{"version":3,"file":"index-C9_c_a-v.js","sources":["../../src/enums/role.enum.ts","../../src/store/user.store.ts","../../src/store/refreshToken.store.ts","../../src/routing/routeUrl.enum.ts","../../src/hooks/useIsLoggedIn.ts","../../src/api/axiosInstance.ts","../../src/helpers/classNames.ts","../../src/hooks/useNotification.tsx","../../src/api/auth/auth.endpoints.ts","../../src/components/ErrorAlert.tsx","../../src/components/input/PasswordInput.tsx","../../src/components/input/TextInput.tsx","../../src/constants/regex.ts","../../src/helpers/validation.ts","../../../../../../../logos/flower-hub-logo.png","../../src/constants/environment.ts","../../src/pages/login/LoginPage.tsx","../../src/hooks/useLogout.ts","../../../../../../../logos/flower-symbol-logo.svg","../../../../../../../icons/double.left-arrow-head.svg","../../../../../../../icons/double.right-arrow-head.svg","../../../../../../../operational-status/flowerHub.svg","../../../../../../../operational-status/flowerCloud.svg","../../../../../../../operational-status/inverter.svg","../../src/components/appWrapper/MobileMenu.tsx","../../src/routing/routeLabel.enum.ts","../../src/store/menu.store.ts","../../src/api/pagination/pagination.endpoint.ts","../../src/api/assetOwner/assetOwner.endpoints.ts","../../src/api/asset/asset.endpoints.ts","../../src/components/animations/Transition.tsx","../../src/components/animations/SnapUp.tsx","../../src/components/loaders/SmallLoader.tsx","../../src/components/loaders/MediumLoader.tsx","../../src/components/loaders/LargeLoader.tsx","../../src/components/loaders/PageLoader.tsx","../../src/components/CustomPlaceholder.tsx","../../src/components/PageWrapper.tsx","../../src/helpers/array.ts","../../src/components/Modal.tsx","../../src/api/distributor/distributor.dto.ts","../../src/api/distributor/distributor.endpoints.ts","../../src/components/ModalContentWrapper.tsx","../../src/components/distributor/AddDistributorForm.tsx","../../src/components/buttons/SecondaryButton.tsx","../../src/components/distributor/AddDistributor.tsx","../../src/components/table/Table.tsx","../../src/components/table/TBody.tsx","../../src/components/table/TD.tsx","../../src/components/table/TH.tsx","../../src/components/table/THead.tsx","../../src/components/table/TR.tsx","../../src/helpers/role.ts","../../src/components/distributor/DistributorList.tsx","../../src/pages/app/distributorList/DistributorListPage.tsx","../../src/components/tab/TabPageWrapper.tsx","../../src/api/statistics/statistics.endpoints.ts","../../src/components/statistics/DashboardTile.tsx","../../src/enums/statistic.enum.ts","../../src/components/statistics/PeriodFilterTabs.tsx","../../src/components/statistics/DashboardStatistics.tsx","../../src/components/tags/Badge.tsx","../../src/components/tooltip/Tooltip.tsx","../../src/components/Panel.tsx","../../src/helpers/date.ts","../../src/api/installer/installer.endpoints.ts","../../src/api/installer/installer.dto.ts","../../src/components/input/Checkbox.tsx","../../src/components/installer/AddInstallerForm.tsx","../../src/components/installer/AddInstaller.tsx","../../src/api/pagination/pagination.helper.ts","../../src/hooks/useDebounce.ts","../../src/components/tableBeta/FilterMenu.tsx","../../src/components/tableBeta/SearchField.tsx","../../src/components/tableBeta/Toolbar.tsx","../../src/components/tableBeta/TH.tsx","../../src/components/tableBeta/TRH.tsx","../../src/components/tableBeta/THead.tsx","../../src/components/tableBeta/TableStyle.tsx","../../src/components/tableBeta/TD.tsx","../../src/components/tableBeta/TRB.tsx","../../src/components/tableBeta/TBody.tsx","../../src/components/tableBeta/Title.tsx","../../src/components/tableBeta/LoadingToaster.tsx","../../src/hooks/useFetchMoreOnBottomReached.ts","../../src/hooks/useAutoScrollbarWidth.ts","../../src/components/tableBeta/Table.tsx","../../src/enums/installerStatus.enum.ts","../../src/components/installer/InstallerTable.tsx","../../src/components/listBeta/ListStyle.tsx","../../src/components/listBeta/Title.tsx","../../src/components/listBeta/UL.tsx","../../src/components/listBeta/LI.tsx","../../src/components/listBeta/List.tsx","../../src/components/installer/InstallerList.tsx","../../src/components/installer/Installers.tsx","../../src/pages/app/installerList/InstallerListPage.tsx","../../src/helpers/installer.ts","../../src/components/installer/LatestInstallerList.tsx","../../src/components/input/Dropdown.tsx","../../src/components/distributor/AddDistributorUserForm.tsx","../../src/api/distributorInvitation/distributorInvitation.endpoints.ts","../../src/components/distributor/AddDistributorUser.tsx","../../src/components/distributor/DeleteDistributorConfirmation.tsx","../../src/components/buttons/DangerButton.tsx","../../src/api/user/user.endpoints.ts","../../src/components/distributor/DeleteDistributorUser.tsx","../../src/components/distributor/DeleteDistributorInvitation.tsx","../../src/components/distributor/DistributorUsersTab.tsx","../../src/components/descriptionList/Item.tsx","../../src/components/descriptionList/Label.tsx","../../src/components/descriptionList/List.tsx","../../src/components/descriptionList/Value.tsx","../../src/components/descriptionList/ValueContainer.tsx","../../src/components/Shadow.tsx","../../src/components/input/PostalCodeInput.tsx","../../src/components/distributor/EditDistributorForm.tsx","../../src/components/distributor/EditDistributor.tsx","../../src/components/Address.tsx","../../src/components/distributor/DistributorAccountDetails.tsx","../../src/components/tab/TabContainer.tsx","../../src/components/compensation/CompensationStatistics.helpers.ts","../../src/components/compensation/CompensationStatistics.tsx","../../src/components/compensation/Compensation.tsx","../../src/api/compensation/compensation.endpoints.ts","../../src/pages/app/distributor/DistributorPage.tsx","../../src/enums/assetOwnerStatus.enum.ts","../../src/components/tags/AssetOwnerStatusTag.tsx","../../src/components/assetOwner/EditAssetOwnerProfileForm.tsx","../../src/components/assetOwner/EditAssetOwnerProfile.tsx","../../src/components/assetOwner/DeleteAssetOwner.tsx","../../src/api/assetOwnerInvitation/assetOwnerInvitation.endpoints.ts","../../src/components/assetOwner/ResendAssetOwnerInvitation.tsx","../../src/components/assetOwner/EditAssetOwnerInvitationForm.tsx","../../src/components/assetOwner/EditAssetOwnerInvitation.tsx","../../src/components/assetOwner/AccountDetails.tsx","../../src/helpers/assetOwnerDashboard.ts","../../src/components/consumption/DesktopVersion.tsx","../../src/components/consumption/MobileVersion.tsx","../../src/components/systemNotification/MaintenanceState.tsx","../../src/components/consumption/Consumption.tsx","../../src/components/FlowerLink.tsx","../../src/components/flowerRevenue/FlowerRevenue.tsx","../../src/components/systemNotification/SystemNotificationInfo.tsx","../../src/api/system-notification/systemNotification.endpoints.ts","../../src/components/flowerHub/flowerHubStatistics/FlowerHubStatisticContainer.tsx","../../src/components/flowerHub/flowerHubStatistics/FlowerHubStatisticsFlowerVersion.tsx","../../src/api/flowerHub/flowerHub.endpoints.ts","../../src/components/flowerHub/FlowerHubComponents.tsx","../../src/components/installationFlow/installFlowerHub.helpers.ts","../../src/components/installationFlow/bessTypes.ts","../../src/components/buttons/ActionButton.tsx","../../src/api/assetManufacturer/assetManufacturer.endpoints.ts","../../src/components/installationFlow/steps/AssetInformationStep.tsx","../../src/helpers/installationFlow.ts","../../src/components/installationFlow/steps/ConnectedEthStep.tsx","../../src/components/input/SerialNumberInput.tsx","../../src/components/installationFlow/steps/SerialNumberStep.tsx","../../src/styles/icons/InverterIcon.tsx","../../src/styles/icons/FlowerHubIcon.tsx","../../src/styles/icons/HomeIcon.tsx","../../src/components/installationFlow/ContentCard.tsx","../../src/styles/icons/BatteryIcon.tsx","../../src/components/installationFlow/steps/MetaDataConfirmationStep.tsx","../../src/components/installationFlow/steps/PowerConfirmationStep.tsx","../../src/enums/flowerHubStatus.enum.ts","../../src/styles/icons/BoltIcon.tsx","../../src/styles/icons/ConfirmedDocIcon.tsx","../../src/styles/icons/ConfirmedIcon.tsx","../../src/components/installationFlow/progress/InstallationStepProgress.tsx","../../src/components/installationFlow/steps/FinishingStep.tsx","../../src/constants/externalLinks.ts","../../src/components/installationFlow/steps/BeforeYouStartStep.tsx","../../src/components/installationFlow/InstallFlowerhub.tsx","../../src/helpers/installationProgress.ts","../../src/styles/icons/OfflineWifiIcon.tsx","../../src/styles/icons/UnstableWifiIcon.tsx","../../src/components/flowerHub/IoTConnectivityNotificationToaster.tsx","../../src/components/flowerHub/installationProgress/InstallationProgress.tsx","../../src/components/flowerHub/operationalProgress/LottiePlayer.tsx","../../src/components/flowerHub/operationalProgress/OperationStatusGrid.tsx","../../src/helpers/operationalProgress.ts","../../src/components/flowerHub/operationalProgress/OperationalStatistics.tsx","../../src/components/flowerHub/operationalProgress/OperationalProgress.tsx","../../src/components/flowerHub/installationProgress/installationStep/StepItem.tsx","../../src/components/flowerHub/installationProgress/InstallationProgressFlowerVersion.tsx","../../src/components/table/ContentTable.tsx","../../src/enums/flowerHubPresenceEvent.enum.ts","../../src/components/flowerHub/presenceEvents/PresenceEventLog.tsx","../../src/components/flowerHub/presenceEvents/PresenceEventLogs.tsx","../../src/api/flowerHubLog/flowerHubLog.endpoints.ts","../../src/components/flowerHub/flowerHubLogs/FlowerHubLog.tsx","../../src/components/flowerHub/flowerHubLogs/FlowerHubLogs.tsx","../../src/api/flowerHubPresenceEvent/flowerHubPresenceEvent.endpoints.ts","../../src/components/flowerHub/FlowerHubDetails.tsx","../../src/enums/zavannSiteStateCategory.enum.ts","../../src/components/tags/ElectricityAgreementTag.tsx","../../src/enums/zavannInvoiceStatus.enum.ts","../../src/components/Link.tsx","../../src/components/tags/InvoiceStatusTag.tsx","../../src/components/invoices/MobileVersion.tsx","../../src/components/invoices/DesktopVersion.tsx","../../src/components/invoices/Invoices.tsx","../../src/components/electricityAgreement/EditZavannSiteIdsForm.tsx","../../src/components/electricityAgreement/EditZavannSiteIds.tsx","../../src/components/electricityAgreement/ElectricityAgreementTab.tsx","../../src/components/tags/FlowerHubStatusTag.tsx","../../src/components/battery/BatteryDetails.tsx","../../src/api/assetModel/assetModel.helper.ts","../../src/api/assetModel/assetModel.endpoints.ts","../../src/components/battery/EditAssetForm.tsx","../../src/components/battery/EditAsset.tsx","../../src/api/flowerHubStorage/flowerHubStorage.endpoints.ts","../../src/components/asset/FlowerHubDataStorageDetails/BatteryDetails.tsx","../../src/enums/flowerHubDataStorage.enums.ts","../../src/components/asset/FlowerHubDataStorageDetails/InverterDetails.tsx","../../src/components/asset/FlowerHubDataStorageDetails/InverterDongleDetails.tsx","../../src/components/asset/FlowerHubDataStorageDetails/FlowerHubDataStorageDetails.tsx","../../src/components/asset/AssetTab.tsx","../../src/pages/app/assetOwnerPage/AssetOwnerPage.tsx","../../src/helpers/assetOwnerList.ts","../../src/helpers/assetOwner.ts","../../src/components/flowerHub/FlowerHubTable.tsx","../../src/components/flowerHub/FlowerHubList.tsx","../../src/components/flowerHub/FlowerHubs.tsx","../../src/pages/app/assetList/AssetListPage.tsx","../../src/components/appWrapper/AppWrapper.helpers.tsx","../../src/components/appWrapper/DesktopMenu.tsx","../../src/components/appWrapper/MobileMenuButton.tsx","../../src/components/appWrapper/Header.tsx","../../src/components/appWrapper/Content.tsx","../../src/components/appWrapper/AppWrapper.tsx","../../src/components/SignUp.tsx","../../src/pages/sign-up/SignUpDistributorPage.tsx","../../src/components/input/LoadingToggle.tsx","../../src/components/installer/EditInstallerCanInviteAssetOwner.tsx","../../src/components/installer/EditInstallerForm.tsx","../../src/components/installer/EditInstaller.tsx","../../src/components/installer/InstallerAccountDetails.tsx","../../src/api/installerInvitation/installerInvitation.endpoints.ts","../../src/components/installer/AddInstallerUserForm.tsx","../../src/components/installer/AddInstallerUser.tsx","../../src/components/installer/DeleteInstallerConfirmation.tsx","../../src/components/installer/DeleteInstallerInvitation.tsx","../../src/components/installer/DeleteInstallerUser.tsx","../../src/components/installer/ResendInstallerInvitation.tsx","../../src/components/installer/EditInstallerInvitationForm.tsx","../../src/components/installer/EditInstallerInvitation.tsx","../../src/components/installer/EditInstallerUserForm.tsx","../../src/components/installer/EditInstallerUser.tsx","../../src/components/installer/InstallerUsersTab.tsx","../../src/components/assetOwner/LatestAssetOwners.tsx","../../src/components/assetOwner/AddAssetOwnerForm.tsx","../../src/api/assetOwner/assetOwner.helper.ts","../../src/components/assetOwner/AddAssetOwner.tsx","../../src/components/assetOwner/AssetOwnersEmptyState.tsx","../../src/enums/assetOwnerCompensationStatus.enum.ts","../../src/components/tags/CompensationEligibilityStatusTag.tsx","../../src/components/assetOwner/AssetOwnerTable.tsx","../../src/components/assetOwner/AssetOwnerList.tsx","../../src/components/assetOwner/AssetOwners.tsx","../../src/pages/app/installer/InstallerPage.tsx","../../src/pages/app/assetOwnerList/AssetOwnerListPage.tsx","../../src/components/AuthFlowWrapper.tsx","../../src/pages/forgot-password/ForgotPasswordPage.tsx","../../src/pages/reset-password/ResetPasswordPage.tsx","../../src/pages/sign-up/SignUpInstallerPage.tsx","../../src/components/Steps.tsx","../../src/pages/sign-up-flow/components/Container.tsx","../../src/components/buttons/SimpleButton.tsx","../../src/pages/sign-up-flow/components/UserDetailsForm.tsx","../../src/pages/sign-up-flow/steps/UserDetails.tsx","../../src/components/input/DateTimePicker.tsx","../../src/pages/sign-up-flow/steps/ElectricityContract.tsx","../../src/pages/sign-up-flow/components/Button.tsx","../../src/pages/sign-up-flow/steps/FinalStep.tsx","../../src/pages/sign-up-flow/components/TermsAndConditions.tsx","../../src/pages/sign-up-flow/steps/Landing.tsx","../../src/components/input/CreatePasswordField.tsx","../../src/pages/sign-up-flow/steps/ChoosePassword.tsx","../../src/pages/sign-up-flow/steps/bankIDSteps/SignOptions.tsx","../../src/pages/sign-up-flow/steps/bankIDSteps/AnimatedQRCode.tsx","../../src/pages/sign-up-flow/steps/bankIDSteps/FailedSignUp.tsx","../../src/api/zavann/zavann.endpoints.ts","../../src/hooks/useDevice.ts","../../src/pages/sign-up-flow/steps/bankIDSteps/OpenBankIdApp.tsx","../../src/pages/sign-up-flow/steps/BankIDVerification.tsx","../../src/enums/signUpStep.enum.ts","../../src/pages/sign-up-flow/steps/SameUserWarning.tsx","../../src/api/assetOwnerInvitation/assetOwnerInvitation.helper.ts","../../src/pages/sign-up-flow/components/StepsComponentContainer.tsx","../../src/pages/sign-up-flow/components/DesktopView.tsx","../../src/components/NotFound.tsx","../../src/i18n/i18n.constants.ts","../../src/components/systemNotification/MaintenanceScreen.tsx","../../src/pages/sign-up-flow/components/MobileView.tsx","../../src/pages/sign-up-flow/components/TabletView.tsx","../../src/pages/sign-up-flow/SignUpFlowPage.tsx","../../src/api/flowerInvitation/flowerInvitation.endpoints.ts","../../src/pages/sign-up/SignUpFlowerPage.tsx","../../src/components/shared/DashboardGreetingHeader.tsx","../../src/components/assetOwner/LatestAssetOwnersWithAssetList.tsx","../../src/components/compensation/DistributorCompensation.tsx","../../src/components/compensation/InstallerCompensation.tsx","../../src/pages/app/dashboard/DashboardPage.tsx","../../src/components/flowerUser/AddFlowerUserForm.tsx","../../src/components/flowerUser/AddFlowerUser.tsx","../../src/components/flowerUser/DeleteFlowerUserConfirmation.tsx","../../src/components/flowerUser/DeleteFlowerUser.tsx","../../src/components/flowerUser/DeleteFlowerUserInvitation.tsx","../../src/components/flowerUser/FlowerUsersTab.tsx","../../src/pages/app/flowerOrganization/FlowerOrganizationPage.tsx","../../src/components/input/TextArea.tsx","../../src/components/assetModel-old/EditAssetModelForm.tsx","../../src/components/assetModel-old/EditAssetModel.tsx","../../src/components/assetModel-old/DeleteAssetModel.tsx","../../src/components/assetModel-old/AddAssetModelForm.tsx","../../src/components/assetModel-old/AddAssetModel.tsx","../../src/components/assetModel-old/AssetModelList.tsx","../../src/enums/brp.enum.ts","../../src/api/flowerSettings/flowerSettings.endpoints.ts","../../src/enums/biddingRegion.enum.ts","../../src/components/input/CheckboxGroup.tsx","../../src/components/prequalificationGroup/PrequalificationGroupForm.tsx","../../src/api/flowerSettings/flowerSettings.dto.ts","../../src/components/prequalificationGroup/AddPrequalificationGroup.tsx","../../src/components/prequalificationGroup/EditPrequalificationGroup.tsx","../../src/components/prequalificationGroup/PrequalificationGroups.tsx","../../src/enums/systemNotificationType.enum.ts","../../src/components/filters/Filters.tsx","../../src/components/systemNotification/DeleteSystemNotification.tsx","../../src/components/systemNotification/AddSystemNotificationForm.tsx","../../src/api/system-notification/systemNotification.dto.ts","../../src/components/systemNotification/AddSystemNotification.tsx","../../src/components/input/SearchField.tsx","../../src/components/table/TanStackTable.tsx","../../src/components/systemNotification/SystemNotificationList.tsx","../../src/pages/app/flowerSettings/FlowerSettingsPage.tsx","../../src/pages/app/distributor/DistributorOrganizationPage.tsx","../../src/pages/app/assetOwner/ProfilePage.tsx","../../src/pages/app/notFound/NotFoundPage.tsx","../../src/pages/app/manualAction/ManualActionPage.tsx","../../src/components/Centered.tsx","../../src/pages/maintenance/maintenance.tsx","../../src/pages/app/assetOwner/InvoicesPage.tsx","../../src/pages/app/assetOwner/ConsumptionAndRevenuePage.tsx","../../src/components/battery/BatteryTab.tsx","../../src/pages/app/assetOwner/BatteryPage.tsx","../../src/components/PanelRow.tsx","../../src/components/invoices/LatestInvoices.tsx","../../src/components/electricityAgreement/ElectricityAgreement.tsx","../../src/components/battery/Battery.tsx","../../src/pages/app/assetOwner/AssetOwnerDashboardPage.tsx","../../src/pages/app/installer/InstallerOrganizationPage.tsx","../../src/api/assetManufacturer/assetManufacturer.helper.ts","../../src/components/assetModelConfiguration/manufacturer/AddAssetManufacturerForm.tsx","../../src/components/assetModelConfiguration/manufacturer/AddAssetManufacturer.tsx","../../src/components/assetModelConfiguration/manufacturer/EditAssetManufacturerForm.tsx","../../src/components/assetModelConfiguration/manufacturer/EditAssetManufacturer.tsx","../../src/components/assetModelConfiguration/inverterModel/PowerCapacity.tsx","../../src/components/assetModelConfiguration/inverterModel/AddInverterModelForm.tsx","../../src/api/inverterModel/inverterModel.endpoints.ts","../../src/api/inverterModel/inverterModel.helper.ts","../../src/components/assetModelConfiguration/inverterModel/AddInverterModel.tsx","../../src/components/assetModelConfiguration/batteryModel/Capacity.tsx","../../src/components/assetModelConfiguration/batteryModel/AddBatteryModelForm.tsx","../../src/api/batteryModel/batteryModel.endpoints.ts","../../src/api/batteryModel/batteryModel.helper.ts","../../src/components/assetModelConfiguration/batteryModel/AddBatteryModel.tsx","../../src/components/assetModelConfiguration/batteryModel/AddBatteryCapacityForm.tsx","../../src/components/assetModelConfiguration/batteryModel/AddBatteryCapacity.tsx","../../src/components/assetModelConfiguration/batteryModel/EditBatteryModelForm.tsx","../../src/components/assetModelConfiguration/batteryModel/EditBatteryModel.tsx","../../src/components/assetModelConfiguration/inverterModel/EditInverterModelForm.tsx","../../src/components/assetModelConfiguration/inverterModel/EditInverterModel.tsx","../../src/components/assetModelConfiguration/MapDataStep2.tsx","../../src/components/assetModelConfiguration/AssetModelConfiguration.tsx","../../src/components/assetModelConfiguration/InverterModelList.tsx","../../src/pages/app/assetModelConfiguration/AssetModelConfigurationPage.tsx","../../src/components/appWrapper/ScrollablePage.tsx","../../src/components/appWrapper/NotScrollablePage.tsx","../../src/components/compensation/DeleteCompensationModel.tsx","../../src/components/input/MonthDatePicker.tsx","../../src/components/compensation/AddCompensationModelPeriodForm.tsx","../../src/components/compensation/AddCompensationModelPeriod.tsx","../../src/components/compensation/CompensationModelTab.tsx","../../src/api/bessCompensation/bessCompensation.endpoints.ts","../../src/components/statistics/KeyValueTile.tsx","../../src/components/billingAdjustment/BillingAdjustmentStatistics.tsx","../../src/components/billingAdjustment/BillingAdjustment.helper.ts","../../src/enums/postBillingAdjustmentStatus.enums.ts","../../src/components/tags/BillingAdjustmentStatusTag.tsx","../../src/components/tags/PayoutInformationStatusTag.tsx","../../src/components/input/OtpInput.tsx","../../src/components/billingAdjustment/postBillingAdjustment/PostBillingAdjustmentConfirmationModal.tsx","../../src/components/billingAdjustment/postBillingAdjustment/PostBillingAdjustmentModal.tsx","../../src/constants/billingAdjustments.ts","../../src/components/billingAdjustment/postBillingAdjustment/PostBillingAdjustment.tsx","../../src/components/billingAdjustment/BillingAdjustmentExcelExport.tsx","../../src/components/billingAdjustment/QualifiedAssetOwnerList.tsx","../../src/components/billingAdjustment/BillingAdjustmentTab.tsx","../../src/components/compensation/CompensationStatisticsTab.tsx","../../src/components/compensation/InstallerPayoutCSVExport.tsx","../../src/components/compensation/InstallerCompensationTab.tsx","../../src/pages/app/compensation/CompensationPage.tsx","../../src/routing/routes.tsx","../../src/App.tsx","../../src/i18n/i18n.ts","../../src/main.tsx"],"sourcesContent":["export enum Role {\n Guest = -1,\n AssetOwner = 100,\n InstallerUser = 200,\n InstallerAdmin = 300,\n DistributorUser = 400,\n DistributorAdmin = 500,\n Flower = 1000,\n}\n","import { User } from \"api/user/user.type\";\nimport { Role } from \"enums/role.enum\";\nimport { create } from \"zustand\";\nimport { persist } from \"zustand/middleware\";\n\nconst userStore = create()(\n persist(\n (set) => ({\n user: undefined,\n setUser: (user: User) =>\n set((state) => ({\n ...state,\n user,\n })),\n clearUser: () =>\n set((state) => ({\n ...state,\n user: undefined,\n })),\n }),\n {\n name: \"user-storage\",\n },\n ),\n);\n\nexport const getUserId = (state: UserState): number | undefined =>\n state.user?.id;\n\nexport const getUserRole = (state: UserState) =>\n state?.user?.role ?? Role.Guest;\n\nexport const getAssetOwnerId = (state: UserState): number | undefined =>\n state.user?.assetOwnerId ?? undefined;\n\nexport const getDistributorId = (state: UserState): number | undefined =>\n state.user?.distributorId;\n\nexport const getInstallerId = (state: UserState): number | undefined =>\n state.user?.installerId;\n\nexport const getUserName = (state: UserState) => state?.user?.name ?? \"\";\n\ninterface UserState {\n user?: User;\n setUser: (user: User) => void;\n clearUser: () => void;\n}\n\nexport default userStore;\n","const REFRESH_TOKEN_EXPIRATION_DATE_KEY = \"refreshTokenExpirationDate\";\n\nexport const getRefreshTokenExpirationDate = () =>\n localStorage.getItem(REFRESH_TOKEN_EXPIRATION_DATE_KEY);\n\nexport const setRefreshTokenExpirationDate = (dateInMilliseconds: string) =>\n localStorage.setItem(REFRESH_TOKEN_EXPIRATION_DATE_KEY, dateInMilliseconds);\n\nexport const clearRefreshTokenExpirationDate = () =>\n localStorage.removeItem(REFRESH_TOKEN_EXPIRATION_DATE_KEY);\n\nexport const refreshTokenHasExpired = () => {\n const refreshTokenExpirationDate = getRefreshTokenExpirationDate();\n if (!refreshTokenExpirationDate) {\n return true;\n }\n return +refreshTokenExpirationDate < new Date().getTime();\n};\n","export enum RouteUrl {\n AllRoutes = \"*\",\n Home = \"/\",\n Login = \"/login\",\n App = \"/app\",\n Distributors = \"distributors\",\n Installers = \"installers\",\n Assets = \"assets\",\n AssetOwners = \"asset-owners\",\n SignUpFlower = \"sign-up-flower\",\n SignUpDistributor = \"sign-up-distributor\",\n SignUpInstaller = \"sign-up-installer\",\n SignUpAssetOwner = \"sign-up-asset-owner\",\n ForgotPassword = \"forgot-password\",\n ResetPassword = \"reset-password\",\n Dashboard = \"dashboard\",\n Organization = \"organization\",\n Settings = \"settings\",\n AssetModelConfiguration = \"asset-model-configuration\",\n Battery = \"battery\",\n ConsumptionAndRevenue = \"consumption-and-revenue\",\n InvoiceList = \"invoices\",\n SignUpFlow = \"sign-up-flow\",\n Profile = \"profile\",\n ManualAction = \"manual-action\",\n Compensation = \"compensation\",\n}\n","import { useEffect } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport userStore from \"store/user.store\";\nimport {\n clearRefreshTokenExpirationDate,\n refreshTokenHasExpired,\n} from \"store/refreshToken.store\";\nimport { RouteUrl } from \"../routing/routeUrl.enum\";\n\nexport const useIsLoggedIn = () => {\n const { user, clearUser } = userStore();\n const navigate = useNavigate();\n\n useEffect(() => {\n if (!user || refreshTokenHasExpired()) {\n clearUser();\n clearRefreshTokenExpirationDate();\n\n if (checkPathBeforeRedirect()) {\n navigate(RouteUrl.Login);\n }\n }\n }, [user, navigate]);\n\n return Boolean(user);\n};\n\nconst checkPathBeforeRedirect = () => {\n const pathsToCheck = [\n `/${RouteUrl.SignUpFlower}`,\n `/${RouteUrl.SignUpDistributor}`,\n `/${RouteUrl.SignUpInstaller}`,\n `/${RouteUrl.SignUpAssetOwner}`,\n `/${RouteUrl.ForgotPassword}`,\n `/${RouteUrl.ResetPassword}`,\n `/${RouteUrl.SignUpFlow}`,\n ];\n\n return !pathsToCheck.includes(window.location.pathname);\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport axios from \"axios\";\nimport userStore from \"store/user.store\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { clearRefreshTokenExpirationDate } from \"store/refreshToken.store\";\nimport { AuthEndPoints } from \"./auth/auth.endpoints\";\n\nconst api = axios.create({\n baseURL: import.meta.env.VITE_API_URL,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n withCredentials: true,\n});\n\n// The following interceptor checks for calls that become unauthorized\n// and retrieves a new access token if the current one seems to have expired.\n// The original call is redone immediately afterwards without the user\n// having time to notice what happened.\napi.interceptors.response.use(\n (res) => res,\n async (err) => {\n const originalConfig = err.config;\n\n if (isUnauthorized(err)) {\n if (isRefreshTokenRequest(err)) {\n // Refresh token has expired, redirect to login\n clearRefreshTokenExpirationDate();\n userStore.getState().clearUser();\n window.location.href = RouteUrl.Login;\n return Promise.reject(err);\n }\n\n if (isLoginRequest(err)) {\n return Promise.reject(err);\n }\n\n if (!originalConfig._retry) {\n originalConfig._retry = true;\n\n try {\n // Attempt to refresh the token\n await api.get(AuthEndPoints.RefreshToken);\n\n // Retry the original request\n return api(originalConfig);\n } catch (_error) {\n clearRefreshTokenExpirationDate();\n userStore.getState().clearUser();\n window.location.href = RouteUrl.Login;\n return Promise.reject(_error);\n }\n }\n }\n return Promise.reject(err);\n },\n);\nexport default api;\n\nconst isUnauthorized = (err: any) =>\n err.response && err.response.status === 401 && !err.config._retry;\n\nconst isRefreshTokenRequest = (err: any) =>\n err.config.url === AuthEndPoints.RefreshToken;\n\nconst isLoginRequest = (err: any) => err.config.url === AuthEndPoints.Login;\n","export const classNames = (...classes: ClassName[]) =>\n classes.filter(Boolean).join(\" \");\n\ntype ClassName = string | boolean;\n","import { CheckCircleIcon, XCircleIcon } from \"@heroicons/react/20/solid\";\nimport toast from \"react-hot-toast\";\nimport { classNames } from \"helpers/classNames\";\n\nexport const useNotification = () => {\n const info = (message: string) => {\n toast.custom((t) => (\n \n
\n
\n \n
\n
\n

{message}

\n
\n
\n \n ));\n };\n\n const success = (message: string) => {\n toast.custom((t) => (\n \n
\n
\n \n
\n
\n

{message}

\n
\n
\n \n ));\n };\n\n const error = (\n message: string = \"Something went wrong, please try again\",\n ) => {\n toast.custom((t) => (\n \n
\n
\n \n
\n
\n

{message}

\n
\n
\n \n ));\n };\n\n return { info, success, error };\n};\n","import {\n clearRefreshTokenExpirationDate,\n setRefreshTokenExpirationDate,\n} from \"store/refreshToken.store\";\nimport userStore from \"store/user.store\";\nimport api from \"../axiosInstance\";\nimport { LoginDTO, VerifyRequestDTO } from \"./auth.dto\";\nimport { User } from \"api/user/user.type\";\nimport { useNotification } from \"hooks/useNotification\";\nimport { useMutation } from \"@tanstack/react-query\";\n\nexport enum AuthEndPoints {\n Login = \"/auth/login\",\n Logout = \"/auth/logout\",\n RefreshToken = \"/auth/refresh-token\",\n RequestOTP = \"/auth/request-otp\",\n VerifyOTP = \"/auth/verify-otp\",\n}\n\nexport const useLogin = () => {\n const { setUser } = userStore();\n\n const {\n mutate: login,\n isPending: isLoading,\n isSuccess,\n isError,\n } = useMutation({\n mutationFn: async (payload: LoginDTO): Promise =>\n (await api.post(AuthEndPoints.Login, payload)).data,\n onSuccess: (data) => {\n setUser(data.user);\n setRefreshTokenExpirationDate(\n new Date(data.refreshTokenExpirationDate).getTime().toString(),\n );\n },\n });\n\n return { login, isLoading, isSuccess, isError };\n};\n\nexport const useServerLogout = () => {\n const { clearUser } = userStore();\n\n return useMutation({\n mutationFn: async (): Promise => await api.post(AuthEndPoints.Logout),\n onSuccess: () => {\n clearUser();\n clearRefreshTokenExpirationDate();\n },\n });\n};\n\nexport const useRequestOTP = () => {\n const notification = useNotification();\n\n return useMutation({\n mutationFn: async (): Promise => {\n const response = await api.post(AuthEndPoints.RequestOTP);\n return response.data?.otpToken;\n },\n onError: () => {\n notification.error(\"Failed to send the OTP\");\n },\n });\n};\n\nexport const useVerifyOTP = () => {\n const notification = useNotification();\n\n return useMutation({\n mutationFn: async ({ userOtp }: VerifyRequestDTO): Promise => {\n const response = await api.post(AuthEndPoints.VerifyOTP, {\n userOtp,\n });\n return response.data?.isValid;\n },\n onError: () => {\n notification.error(\"Failed to verify the OTP\");\n },\n });\n};\n\nexport type LoginResponse = {\n user: User;\n refreshTokenExpirationDate: Date;\n};\n","import { XCircleIcon } from \"@heroicons/react/20/solid\";\nimport { FC } from \"react\";\n\ninterface Props {\n text: string;\n}\n\nexport const ErrorAlert: FC = ({ text }) => {\n return (\n
\n
\n
\n \n
\n
\n

{text}

\n
\n
\n
\n );\n};\n","import { EyeIcon, EyeSlashIcon } from \"@heroicons/react/24/outline\";\nimport { FC, useState } from \"react\";\nimport { RegisterOptions, UseFormRegister } from \"react-hook-form\";\nimport { ExclamationCircleIcon } from \"@heroicons/react/20/solid\";\ninterface Props {\n label?: string;\n name: string;\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: UseFormRegister;\n registerOptions?: RegisterOptions;\n tabIndex?: number;\n errorMessage?: string;\n}\nexport const PasswordInput: FC = ({\n label = \"Password\",\n name,\n register,\n registerOptions,\n tabIndex,\n errorMessage,\n}) => {\n const hasError = !!errorMessage;\n const [showPassword, setShowPassword] = useState(false);\n\n const toggleShow = () => setShowPassword((prev) => !prev);\n\n if (!registerOptions) {\n registerOptions = {};\n }\n\n return (\n
\n \n
\n \n {hasError && (\n
\n \n
\n )}\n {\n if (e.key === \"Enter\") {\n toggleShow();\n }\n }}\n className=\"absolute inset-y-0 right-0 flex items-center px-2 outline-flowerSky-500 focus:rounded-r-md cursor-pointer\"\n tabIndex={tabIndex ? tabIndex + 1 : 0}\n >\n {!showPassword && }\n {showPassword && }\n
\n
\n {hasError &&

{errorMessage}

}\n \n );\n};\n","import { ExclamationCircleIcon } from \"@heroicons/react/20/solid\";\nimport { FC, useState } from \"react\";\nimport { RegisterOptions, UseFormRegister } from \"react-hook-form\";\nimport { classNames } from \"helpers/classNames\";\nimport { QuestionMarkCircleIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n label?: string;\n name: string;\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: UseFormRegister;\n appendix?: string;\n registerOptions?: RegisterOptions;\n size?: \"third\" | \"half\" | \"full\";\n errorMessage?: string;\n autoFocus?: boolean;\n placeholder?: string;\n link?: string;\n linkText?: string;\n type?: \"text\" | \"password\" | \"number\" | \"email\";\n onKeyUp?: () => void;\n autoComplete?: string;\n hoverDetails?: string;\n tabIndex?: number;\n isDisabled?: boolean;\n}\n\nexport const TextInput: FC = ({\n label,\n name,\n register,\n registerOptions,\n appendix,\n size = \"full\",\n errorMessage,\n autoFocus = false,\n placeholder,\n link,\n linkText,\n type = \"text\",\n onKeyUp = () => null,\n autoComplete = \"nope\",\n hoverDetails,\n tabIndex,\n isDisabled = false,\n}) => {\n const hasError = !!errorMessage;\n const sizeClass = size === \"third\" ? \"w-1/3\" : size === \"half\" ? \"w-1/2\" : \"\";\n\n const [isHoveringDetails, setIsHoveringDetails] = useState(false);\n\n if (!registerOptions) {\n registerOptions = {};\n }\n if (type === \"number\") {\n registerOptions.valueAsNumber = true;\n }\n return (\n
\n {label && (\n
\n )}\n \n )}\n \n {\n if (e.key === \"Enter\") {\n onKeyUp();\n }\n }}\n onChange={(event) => {\n event.target.value =\n type === \"email\"\n ? event.target.value.toLowerCase()\n : event.target.value;\n }}\n />\n {hasError && (\n
\n \n
\n )}\n {appendix && !hasError && (\n
\n {appendix}\n
\n )}\n \n {hasError &&

{errorMessage}

}\n \n );\n};\n","export const DECIMAL_REGEX = /^\\d*\\.?\\d*$/;\nexport const SINGLE_DIGIT_REGEX = /^\\d?$/;\nexport const DIGIT_REGEX = /^\\d$/;\n","import { DECIMAL_REGEX } from \"constants/regex\";\n\nexport const positiveNumberValidator = {\n isNumeric: true,\n validate: (value: number) => {\n return (\n (!isNaN(value) && value > 0) || \"Please enter a number bigger than 0\"\n );\n },\n};\n\nexport const decimalNumberValidator = {\n validate: (value: string) => {\n return (\n (Boolean(value.match(DECIMAL_REGEX)) && +value > 0) ||\n \"Please enter a decimal number bigger than 0\"\n );\n },\n};\n\nexport const naturalNumberValidator = {\n isNumeric: true,\n validate: (value: number) => {\n return (\n (!isNaN(value) && value >= 0) ||\n \"Please enter a number bigger or equal than 0\"\n );\n },\n};\n\nexport const noEmptyStringValidator = (\n errorMessage = \"Please fill in this field\",\n) => ({\n required: errorMessage,\n});\n\nexport const inviteHasExpired = (expiryDate: Date) => {\n const today = new Date();\n return new Date(expiryDate) < today;\n};\n\nexport const emailValidator = {\n required: \"Please fill in this field\",\n pattern: {\n value: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/,\n message: \"Invalid email format\",\n },\n};\n\nexport const passwordValidator = {\n required: \"Please fill in this field\",\n pattern: {\n value: /^(.{10}).*$/,\n message: \"The password needs to be at least 10 characters long\",\n },\n};\n\nexport const isPasswordStrongEnough = (password: string) =>\n (password ?? \"\").length >= 10;\n\nexport const organizationNumberValidator = {\n required: \"Please enter the organization number\",\n pattern: {\n value: /^[0-9]{10}$/,\n message:\n 'The organization number must contain only 10 digits and no \"-\" symbol',\n },\n};\n\nexport const giroNumberValidator = {\n required: \"Please enter the Bankgiro number\",\n pattern: {\n value: /^[0-9]{7,8}$/,\n message:\n 'The Bankgiro number must contain only 7 or 8 digits and no \"-\" symbol',\n },\n};\n","export default \"__VITE_PUBLIC_ASSET__cafa65aa__\"","export const isLocal = () => import.meta.env.VITE_NODE_ENV === \"local\";\nexport const isDev = () => import.meta.env.VITE_NODE_ENV === \"dev\";\nexport const isProd = () => import.meta.env.VITE_NODE_ENV === \"prod\";\nexport const cloudFrontDomainUrl = \"https://d3067a615pqkyh.cloudfront.net\";\n","import { Link } from \"react-router-dom\";\nimport userStore from \"store/user.store\";\nimport { useLogin } from \"api/auth/auth.endpoints\";\nimport { useForm } from \"react-hook-form\";\nimport { useEffect } from \"react\";\nimport { refreshTokenHasExpired } from \"store/refreshToken.store\";\nimport { ErrorAlert } from \"components/ErrorAlert\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { LoginDTO } from \"api/auth/auth.dto\";\nimport { PasswordInput } from \"components/input/PasswordInput\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport FlowerHubLogo from \"/logos/flower-hub-logo.png\";\nimport { useTranslation } from \"react-i18next\";\nimport { motion } from \"framer-motion\";\nimport { cloudFrontDomainUrl } from \"constants/environment\";\n\nconst transitionProps = {\n duration: 1,\n ease: \"easeOut\",\n};\n\nconst fadeInFromRight = {\n hidden: { opacity: 0, x: 50 },\n visible: { opacity: 1, x: 0 },\n};\n\nexport const LoginPage = () => {\n const { t } = useTranslation();\n\n const { login, isError, isLoading } = useLogin();\n\n const {\n register,\n handleSubmit,\n formState: { errors: loginErrors },\n } = useForm();\n\n const { user, clearUser } = userStore((state) => state);\n\n const onSubmit = handleSubmit((data: LoginDTO) => login(data));\n\n useEffect(() => {\n if (user && refreshTokenHasExpired()) {\n clearUser();\n }\n }, [user, clearUser]);\n\n return (\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n

\n {t(\"login.Header\")}\n

\n

\n {t(\"login.SubHeader\")}\n

\n
\n
\n \n
\n
\n \n
\n {isError && (\n \n )}\n\n
\n
\n\n
\n \n {t(\"login.Forgot your password?\")}\n \n
\n
\n\n
\n \n {isLoading && (\n \n \n \n \n )}\n {isLoading ? t(\"login.Signing in\") : t(\"login.Sign in\")}\n \n
\n \n
\n
\n
\n \n
\n );\n};\n","import { clearRefreshTokenExpirationDate } from \"store/refreshToken.store\";\nimport userStore from \"store/user.store\";\n\nexport const useLogout = () => {\n const clearUser = userStore((state) => state.clearUser);\n return () => {\n clearUser();\n clearRefreshTokenExpirationDate();\n };\n};\n","export default \"__VITE_PUBLIC_ASSET__e1507b55__\"","export default \"__VITE_PUBLIC_ASSET__51cee035__\"","export default \"__VITE_PUBLIC_ASSET__d1423a82__\"","export default \"__VITE_PUBLIC_ASSET__ae457016__\"","export default \"__VITE_PUBLIC_ASSET__a95a2a11__\"","export default \"__VITE_PUBLIC_ASSET__54eeab49__\"","import {\n Dialog,\n DialogPanel,\n Transition,\n TransitionChild,\n} from \"@headlessui/react\";\nimport { Dispatch, FC, Fragment, SetStateAction } from \"react\";\nimport { NavigationItem } from \"./AppWrapper.helpers\";\nimport { PowerIcon, XMarkIcon } from \"@heroicons/react/24/outline\";\nimport { Link } from \"react-router-dom\";\nimport { classNames } from \"helpers/classNames\";\nimport { FlowerHubLogo } from \"styles/Icons\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n navigation: NavigationItem[];\n sidebarOpen: boolean;\n setSidebarOpen: Dispatch>;\n logout: () => void;\n}\n\nexport const MobileMenu: FC = ({\n navigation,\n sidebarOpen,\n setSidebarOpen,\n logout,\n}) => {\n const { t } = useTranslation();\n\n return (\n \n \n \n
\n \n\n
\n \n \n
\n setSidebarOpen(false)}\n >\n Close sidebar\n \n \n
\n
\n \n
\n \n
\n
\n \n \n {t(`navigation.Sign out`)}\n \n
\n
\n
\n \n \n
\n \n
\n );\n};\n","// enum also used as a key in json files for translation\nexport enum RouteLabel {\n Dashboard = \"Dashboard\",\n Organization = \"Organization\",\n Settings = \"Settings\",\n Distributors = \"Distributors\",\n Installers = \"Installers\",\n AssetOwners = \"Asset owners\",\n Battery = \"Battery\",\n Profile = \"Profile\",\n Invoices = \"Invoices\",\n ManualAction = \"Manual Action\",\n AssetModelConfiguration = \"Asset model configuration\",\n Assets = \"Flower Hubs\",\n ConsumptionAndRevenue = \"Consumption & Revenue\",\n Compensation = \"Compensation\",\n}\n","import { create } from \"zustand\";\nimport { persist } from \"zustand/middleware\";\n\nexport const menuStore = create()(\n persist(\n (set) => ({\n breadCrumbs: [],\n setBreadCrumbs: (breadCrumbs: BreadCrumb[]) =>\n set((state) => ({\n ...state,\n breadCrumbs,\n })),\n }),\n {\n name: \"menu-store\",\n },\n ),\n);\n\ninterface MenuState {\n breadCrumbs: BreadCrumb[];\n setBreadCrumbs: (list: BreadCrumb[]) => void;\n}\n\nexport interface BreadCrumb {\n label: string;\n to: string;\n iconType?: BreadCrumbIconType;\n}\n\nexport type BreadCrumbIconType = \"distributor\" | \"installer\" | \"assetOwner\";\n","// Fetcher function that implements pagination to handle server-side data fetching\nimport api from \"../axiosInstance\";\nimport qs from \"qs\";\n\ninterface Props {\n url: string;\n pageParam: number;\n queryString?: string; // Query string that is used to search/order/filter data\n extraQueryString?: string; // Query string that is used to filter data by other parameters, e.g. IDs\n}\n\nexport const fetchPages = async ({\n url,\n pageParam,\n queryString = \"\",\n extraQueryString = \"\",\n}: Props) => {\n const parsedQueryString = qs.parse(queryString);\n const parsedExtraQueryString = qs.parse(extraQueryString);\n const paginationQueryString = qs.stringify(\n {\n page: pageParam,\n ...parsedQueryString,\n ...parsedExtraQueryString,\n },\n { arrayFormat: \"repeat\" },\n );\n return await api.get(`${url}?${paginationQueryString}`);\n};\n","import { useNotification } from \"hooks/useNotification\";\n\nimport { ConsumptionMonth } from \"types/consumptionMonth.type\";\nimport api from \"../axiosInstance\";\nimport {\n CreateAssetOwnerRequestDTO,\n GetAllAssetOwnerResponseDTO,\n GetAssetOwnerProfileResponseDTO,\n GetAssetOwnerResponseDTO,\n GetAssetOwnersByUserRoleQueryParams,\n GetAssetOwnerWithAssetIdResponseDTO,\n GetElectricityAgreementResponseDTO,\n GetLatestAssetOwnerBasedOnAssetCreationDTO,\n GetLatestAssetOwnerForInstallerDTO,\n UpdateAssetOwnerRequestDTO,\n UpdateZavannSiteIdsRequestDTO,\n} from \"./assetOwner.dto\";\nimport { GetInvoiceItemResponseDTO } from \"types/invoice.type\";\nimport {\n keepPreviousData,\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n} from \"@tanstack/react-query\";\nimport { fetchPages } from \"../pagination/pagination.endpoint\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\nimport qs from \"qs\";\n\nconst ENDPOINT = \"/asset-owner\";\n\nexport enum AssetOwnerQueryKeys {\n GetAllPagination = \"asset-owner-get-all-pagination\",\n GetOne = \"asset-owner-get-one\",\n GetInvoices = \"asset-owner-get-invoices\",\n GetConsumption = \"asset-owner-get-consumption\",\n GetProfile = \"asset-owner-get-profile\",\n GetElectricityAgreement = \"asset-owner-get-electricity-agreement\",\n GetAssetOwnerWithAssetId = \"asset-owner-get-with-asset-id\",\n GetLatestBasedOnAssetCreationForFlower = \"asset-owner-get-latest-for-asset-created\",\n GetLatestAssetOwnerForInstaller = \"asset-owner-get-latest-for-installers\",\n}\n\nexport const useAssetOwnersPagination = (\n queryString: string,\n optionalParams?: GetAssetOwnersByUserRoleQueryParams,\n) => {\n const { distributorId, installerId } = optionalParams || {};\n\n // Create optional query string\n const optionalQueryString = qs.stringify({\n installerId: installerId ? installerId : undefined,\n distributorId: installerId\n ? undefined\n : distributorId\n ? distributorId\n : undefined,\n });\n\n return useInfiniteQuery({\n queryKey: [\n AssetOwnerQueryKeys.GetAllPagination,\n { queryString, installerId, distributorId },\n ],\n queryFn: async ({ pageParam }): Promise =>\n (\n await fetchPages({\n url: `${ENDPOINT}`,\n pageParam,\n queryString,\n extraQueryString: optionalQueryString,\n })\n ).data,\n getNextPageParam: (lastPage, pages) =>\n lastPage.hasNextPage ? pages.length : undefined,\n initialPageParam: 0,\n refetchOnWindowFocus: false,\n placeholderData: keepPreviousData,\n gcTime: 2000,\n });\n};\n\nexport const useAssetOwner = (id: number) =>\n useQuery({\n queryKey: [AssetOwnerQueryKeys.GetOne, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}`)).data,\n enabled: !!id,\n });\n\nexport const useAssetOwnerWithAssetId = (id: number) =>\n useQuery({\n queryKey: [AssetOwnerQueryKeys.GetAssetOwnerWithAssetId, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}/withAssetId`)).data,\n enabled: !!id,\n });\n\nexport const useAssetOwnerProfile = (id?: number) =>\n useQuery({\n queryKey: [AssetOwnerQueryKeys.GetProfile, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}/profile`)).data,\n enabled: !!id,\n });\n\nexport const useCreateAssetOwner = (options = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (payload: CreateAssetOwnerRequestDTO): Promise =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetAllPagination],\n });\n notification.info(`Asset owner created`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n ...options,\n });\n};\n\nexport const useUpdateAssetOwner = (id: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: UpdateAssetOwnerRequestDTO,\n ): Promise =>\n (await api.put(`${ENDPOINT}/${id}`, payload)).data,\n onSuccess: (data: GetAssetOwnerResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetOne, data.id],\n });\n notification.info(`Changes saved`);\n },\n\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useDeleteAssetOwner = (settings = {}) => {\n const notification = useNotification();\n return useMutation({\n mutationFn: async (id: number): Promise<{ id: number }> =>\n await api.delete(`${ENDPOINT}/${id}`),\n onError: () => {\n notification.error(\"Something went wrong, please try again\");\n },\n ...settings,\n });\n};\n\nexport const useInvoices = (assetOwnerId: number) =>\n useQuery({\n queryKey: [AssetOwnerQueryKeys.GetInvoices, assetOwnerId],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${assetOwnerId}/invoice`)).data,\n });\n\nexport const useConsumption = (assetOwnerId: number) =>\n useQuery({\n queryKey: [AssetOwnerQueryKeys.GetConsumption, assetOwnerId],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${assetOwnerId}/consumption`)).data,\n });\n\nexport const useAssetOwnerElectricityAgreement = (id?: number) =>\n useQuery({\n queryKey: [AssetOwnerQueryKeys.GetElectricityAgreement, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}/electricity-agreement`)).data,\n enabled: !!id,\n });\n\nexport const useLatestBasedOnAssetCreationForFlower = () => {\n return useQuery({\n queryKey: [AssetOwnerQueryKeys.GetLatestBasedOnAssetCreationForFlower],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/dashboard/latest-with-asset`)).data,\n });\n};\n\nexport const useLatestAssetOwnersForInstaller = (installerId?: number) => {\n return useQuery({\n queryKey: [\n AssetOwnerQueryKeys.GetLatestAssetOwnerForInstaller,\n installerId,\n ],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${installerId}/dashboard/latest-asset-owner`))\n .data,\n enabled: !!installerId,\n });\n};\n\nexport const useUpdateZavannSiteIds = (assetOwnerId: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: UpdateZavannSiteIdsRequestDTO,\n ): Promise =>\n (await api.put(`${ENDPOINT}/${assetOwnerId}/zavann-site`, payload)).data,\n onSuccess: (data: GetAssetOwnerResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetOne, data.id],\n });\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetElectricityAgreement, data.id],\n });\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetAllPagination],\n });\n notification.info(`Zavann site ids updated`);\n },\n onError: () => {\n notification.error();\n },\n });\n};\n","import { useNotification } from \"hooks/useNotification\";\nimport api from \"../axiosInstance\";\nimport {\n CreateAssetRequestDTO,\n CreateAssetResponseDTO,\n GetAllAssetResponseDTO,\n GetAssetResponseDTO,\n GetAssetRevenueWithAssetModelResponseDTO,\n GetAssetStatisticsResponseDTO,\n GetLatestPresenceEventsResponseDTO,\n UpdateAssetRequestDTO,\n UpdateAssetResponseDTO,\n} from \"./asset.dto\";\nimport { AssetOwnerQueryKeys } from \"api/assetOwner/assetOwner.endpoints\";\nimport {\n keepPreviousData,\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n} from \"@tanstack/react-query\";\nimport { fetchPages } from \"../pagination/pagination.endpoint\";\n\nconst ENDPOINT = \"/asset\";\n\nexport enum AssetQueryKeys {\n GetAllPagination = \"asset-get-assets-pagination\",\n GetOne = \"asset-get-asset\",\n GetRevenue = \"asset-get-revenue\",\n GetAssetStatistics = \"asset-get-asset-statistics\",\n GetLatestPresenceEvents = \"asset-get-latest-presence-events\",\n}\n\nexport const useAssetsPagination = (queryString: string) => {\n return useInfiniteQuery({\n queryKey: [AssetQueryKeys.GetAllPagination, { queryString }],\n queryFn: async ({ pageParam }): Promise =>\n (\n await fetchPages({\n url: `${ENDPOINT}`,\n pageParam,\n queryString,\n })\n ).data,\n getNextPageParam: (lastPage, pages) =>\n lastPage.hasNextPage ? pages.length : undefined,\n initialPageParam: 0,\n refetchOnWindowFocus: false,\n placeholderData: keepPreviousData,\n gcTime: 2000,\n });\n};\n\nexport const useAssetRevenue = (id?: number) => {\n return useQuery({\n queryKey: [AssetQueryKeys.GetRevenue, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}/revenue`)).data,\n enabled: !!id,\n });\n};\n\nexport const useAsset = (id?: number) => {\n return useQuery({\n queryKey: [AssetQueryKeys.GetOne, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}`)).data,\n enabled: !!id,\n });\n};\n\nexport const useLatestPresenceEventsForAsset = (id?: number) => {\n return useQuery({\n queryKey: [AssetQueryKeys.GetLatestPresenceEvents, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/presence-events/${id}`)).data,\n enabled: !!id,\n refetchInterval: 30000, // pooling every 30 seconds\n });\n};\n\nexport const useAssetStatistics = (id: number) => {\n return useQuery({\n queryKey: [AssetQueryKeys.GetAssetStatistics, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}/statistics`)).data,\n });\n};\n\nexport const useCreateAsset = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreateAssetRequestDTO,\n ): Promise =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: (data: CreateAssetResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetOne, data.assetOwnerId],\n });\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetAllPagination],\n });\n },\n onError: () => {\n notification.error();\n },\n });\n};\n\nexport const useUpdateAsset = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (data: {\n payload: UpdateAssetRequestDTO;\n id: number;\n }): Promise =>\n (await api.put(`${ENDPOINT}/${data.id}`, data.payload)).data,\n\n onSuccess: (data: UpdateAssetResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetQueryKeys.GetOne, data.id],\n });\n },\n onError: () => {\n notification.error(\n \"Failed to update site ids, please double check site ids and try again.\",\n );\n },\n });\n};\n","import { animated, useTransition } from \"react-spring\";\nimport { FC, ReactNode } from \"react\";\n\ninterface Props {\n children: ReactNode;\n settings: object;\n isVisible?: boolean;\n className?: string;\n}\n\nexport const Transition: FC = ({\n children,\n settings,\n isVisible = true,\n className = undefined,\n}) => {\n const transitions = useTransition(isVisible, settings);\n return transitions(\n (styles, item) =>\n item && (\n \n {children}\n \n ),\n );\n};\n","import { FC } from \"react\";\nimport { config } from \"react-spring\";\nimport { ChildrenProps } from \"types/childrenProps.type\";\nimport { Transition } from \"./Transition\";\n\nexport const SmoothUp: FC = ({ children }) => {\n return (\n \n {children}\n \n );\n};\n\nexport const OpacityTransition: FC = ({ children }) => (\n \n {children}\n \n);\n\nexport const ScaleUp: FC = ({ children }) => (\n \n {children}\n \n);\n","export const SmallLoader = () => (\n
\n \n \n \n \n Loading...\n
\n);\n","export const MediumLoader = () => (\n
\n \n \n \n \n Loading...\n
\n);\n","export const LargeLoader = () => (\n
\n \n \n \n \n Loading...\n
\n);\n","import { SmoothUp } from \"components/animations/SnapUp\";\nimport { LargeLoader } from \"components/loaders/LargeLoader\";\n\nexport const PageLoader = () => (\n // a component that centers in the middle of the page\n
\n \n \n \n
\n);\n","import React, { FC } from \"react\";\nimport { SmoothUp } from \"components/animations/SnapUp\";\nimport { SmallLoader } from \"components/loaders/SmallLoader\";\nimport { MediumLoader } from \"./loaders/MediumLoader\";\nimport { PageLoader } from \"./loaders/PageLoader\";\n\ninterface Props {\n isEmpty: boolean;\n isLoading: boolean;\n isError: boolean;\n icon: React.ReactNode;\n errorMessage?: string;\n emptyDataMessage?: string;\n loaderSize?: \"small\" | \"medium\" | \"page\";\n}\n\nconst CustomPlaceholder: FC = ({\n isEmpty,\n isLoading,\n isError,\n icon,\n errorMessage,\n emptyDataMessage,\n loaderSize = \"small\",\n}) => {\n const getLoaderForSize = (size: \"small\" | \"medium\" | \"page\") => {\n switch (size) {\n case \"page\":\n return ;\n case \"medium\":\n return ;\n case \"small\":\n default:\n return ;\n }\n };\n\n return (\n
\n
\n {isLoading ? {getLoaderForSize(loaderSize)} : icon}\n
\n\n {isError && (\n

\n {errorMessage}\n

\n )}\n {!isLoading && isEmpty && emptyDataMessage && (\n

\n {emptyDataMessage}\n

\n )}\n
\n );\n};\n\nexport default CustomPlaceholder;\n","import React, { FC } from \"react\";\nimport { SmoothUp } from \"./animations/SnapUp\";\n\ninterface Props {\n children: React.ReactNode;\n}\nexport const PageWrapper: FC = ({ children }) => {\n return (\n \n <>{children}\n \n );\n};\n\nexport const PageWrapperSmall: FC<{ children: React.ReactNode }> = ({\n children,\n}) => (\n \n
{children}
\n
\n);\n","export const isEmptyArray = (array?: T[] | undefined): boolean =>\n !array || array.length === 0;\n\nexport const getFirstElementOfArray = (\n array?: T[] | undefined,\n): T | undefined => (!array || array.length === 0 ? undefined : array[0]);\n","/* This example requires Tailwind CSS v2.0+ */\n\nimport { FC, Fragment, ReactNode } from \"react\";\nimport { Dialog, Transition } from \"@headlessui/react\";\nimport { classNames } from \"helpers/classNames\";\nimport { XMarkIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n isOpen: boolean;\n onClose: () => void;\n children: ReactNode;\n rightButtonText?: string;\n rightButtonActionHandler?: () => void;\n isRightButtonHidden?: boolean;\n title: string;\n rightButtonDisabled?: boolean;\n isLoading?: boolean;\n loadingText?: string;\n leftButtonAction?: () => void;\n leftButtonText?: string;\n // TODO: should we add a disabled state for the left button?\n middleButtonAction?: () => void;\n middleButtonText?: string;\n maxSize?: string;\n}\nconst Modal: FC = ({\n isOpen,\n onClose,\n children,\n rightButtonText,\n rightButtonActionHandler,\n isRightButtonHidden,\n rightButtonDisabled = false,\n title,\n isLoading = false,\n loadingText = \"Saving...\",\n leftButtonAction,\n leftButtonText = \"Close\",\n middleButtonAction,\n middleButtonText,\n maxSize = \"sm:max-w-lg\",\n}) => {\n return (\n \n \n \n
\n \n\n
\n
\n \n \n
\n \n Close\n \n \n
\n
\n
\n \n {title}\n \n\n
\n\n
{children}
\n
\n
\n
\n\n \n {!isRightButtonHidden && !!rightButtonActionHandler && (\n \n {isLoading && (\n \n \n \n \n )}\n\n {isLoading\n ? loadingText\n ? loadingText\n : rightButtonText || title\n : rightButtonText || title}\n \n )}\n\n {leftButtonAction && (\n \n {leftButtonText}\n \n )}\n\n {middleButtonAction && (\n \n {middleButtonText}\n \n )}\n
\n \n \n
\n
\n
\n
\n );\n};\n\nexport default Modal;\n","import { Role } from \"enums/role.enum\";\nimport { AddressDTO } from \"../shared/address.dto\";\nimport { DistributorInvitationDTO } from \"../distributorInvitation/distributorInvitation.dto\";\n\nexport type GetDistributorItemResponseDTO = {\n id: number;\n name: string;\n organizationNumber: string;\n city?: string;\n};\n\nexport type GetLatestInstallersItemResponseDTO = {\n installerId: number;\n name: string;\n organization: string;\n role: Role;\n createdAt: Date;\n};\n\nexport type DistributorUserDTO = {\n id: number;\n name: string;\n email: string;\n role: Role;\n};\n\nexport type GetDistributorUsersResponseDTO = {\n users?: DistributorUserDTO[];\n invitations?: DistributorInvitationDTO[];\n};\n\nexport type GetDistributorResponseDTO = {\n id: number;\n name: string;\n organizationNumber: string;\n address: AddressDTO;\n giroNumber: string;\n};\n\nexport type CreateDistributorRequestDTO = {\n name: string;\n organizationNumber: string;\n firstUserEmail: string;\n};\n\nexport type CreateDistributorResponseDTO = {\n id: number;\n name: string;\n};\n\nexport const getEmptyCreateDistributorDTO =\n (): CreateDistributorRequestDTO => ({\n name: \"\",\n organizationNumber: \"\",\n firstUserEmail: \"\",\n });\n\nexport type UpdateDistributorRequestDTO = {\n name: string;\n organizationNumber: string;\n address: AddressDTO;\n giroNumber: string;\n};\n\nexport type UpdateDistributorResponseDTO = {\n id: number;\n name: string;\n};\n\nexport type DeleteInvitationDTO = {\n distributorId: number;\n invitationId: number;\n};\n","import { useNotification } from \"hooks/useNotification\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport api from \"../axiosInstance\";\nimport {\n CreateDistributorRequestDTO,\n CreateDistributorResponseDTO,\n GetDistributorItemResponseDTO,\n GetDistributorResponseDTO,\n GetDistributorUsersResponseDTO,\n GetLatestInstallersItemResponseDTO,\n UpdateDistributorRequestDTO,\n UpdateDistributorResponseDTO,\n} from \"./distributor.dto\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\n\nconst ENDPOINT = \"/distributor\";\n\nexport enum DistributorQueryKeys {\n GetOne = \"distributor-get-one\",\n GetAll = \"distributor-get-all\",\n GetUsers = \"distributor-get-users\",\n GetLatestInstallers = \"distributor-get-latest-installers\",\n}\n\nexport const useDistributors = () =>\n useQuery({\n queryKey: [DistributorQueryKeys.GetAll],\n queryFn: async (): Promise =>\n (await api.get(ENDPOINT)).data,\n });\n\nexport const useDistributorUsers = (id: number) =>\n useQuery({\n queryKey: [DistributorQueryKeys.GetUsers, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}/user`)).data,\n initialData: { users: [], invitations: [] },\n });\n\nexport const useGetLatestInstallers = (distributorId?: number) => {\n return useQuery({\n queryKey: [DistributorQueryKeys.GetLatestInstallers, distributorId],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${distributorId}/dashboard/latest-installer`))\n .data,\n enabled: !!distributorId,\n });\n};\n\nexport const useDistributor = (id: number) =>\n useQuery({\n queryKey: [DistributorQueryKeys.GetOne, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}`)).data,\n });\n\nexport const useCreateDistributor = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreateDistributorRequestDTO,\n ): Promise =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: (data) => {\n queryClient.invalidateQueries({\n queryKey: [DistributorQueryKeys.GetAll],\n });\n notification.info(`${data.name} created`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useUpdateDistributor = (id: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: UpdateDistributorRequestDTO,\n ): Promise =>\n (await api.put(`${ENDPOINT}/${id}`, payload)).data,\n onSuccess: (data) => {\n queryClient.invalidateQueries({\n queryKey: [DistributorQueryKeys.GetOne, data.id],\n });\n notification.info(`${data.name} updated`);\n },\n onError: () => {\n notification.error();\n },\n });\n};\n","import { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n}\n\nexport const ModalContentWrapper: FC = ({ children }) => (\n
{children}
\n);\n","import { CreateDistributorRequestDTO } from \"api/distributor/distributor.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister;\n errors: Partial>;\n}\nconst AddDistributorForm: FC = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n \n \n \n \n \n );\n};\n\nexport default AddDistributorForm;\n","import { classNames } from \"helpers/classNames\";\nimport React, { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n size?: \"small\" | \"medium\" | \"large\";\n className?: string;\n disableFocus?: boolean;\n disabled?: boolean;\n}\n\nconst SecondaryButton: FC<\n Props &\n React.DetailedHTMLProps<\n React.ButtonHTMLAttributes,\n HTMLButtonElement\n >\n> = ({\n children,\n size = \"medium\",\n className = \"\",\n disableFocus = false,\n disabled = false,\n ...rest\n}) => {\n const getClassForSize = (size: \"small\" | \"medium\" | \"large\") => {\n const styling =\n \"inline-flex items-center rounded-md bg-flowerPeach-500 font-medium text-flowerPeach-900 shadow-sm border border-flowerPeach-900 hover:bg-flowerPeach-900 hover:text-white cursor-pointer disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-400 disabled:shadow-none disabled:cursor-not-allowed disabled:pointer-events-none\";\n switch (size) {\n case \"small\":\n return classNames(styling, \"px-2.5 py-1.5 text-xs\");\n case \"large\":\n return classNames(styling, \"px-4 py-2 text-sm\");\n case \"medium\":\n default:\n return classNames(styling, \"px-3 py-2 text-sm leading-4\");\n }\n };\n return (\n \n {children}\n \n );\n};\n\nexport default SecondaryButton;\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { UserPlusIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n CreateDistributorRequestDTO,\n getEmptyCreateDistributorDTO,\n} from \"api/distributor/distributor.dto\";\nimport { useCreateDistributor } from \"api/distributor/distributor.endpoints\";\nimport AddDistributorForm from \"./AddDistributorForm\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\n\ninterface Props {\n isCentered?: boolean;\n}\n\nexport const AddDistributor: FC = ({ isCentered = false }) => {\n const { t } = useTranslation();\n\n // state\n const [isAddDistributorModalOpen, setIsAddDistributorModalOpen] =\n useState(false);\n\n // api\n const {\n mutate: createDistributor,\n isPending: isCreating,\n isSuccess,\n } = useCreateDistributor();\n\n // form\n const {\n register,\n handleSubmit,\n reset,\n formState: { errors },\n } = useForm({\n defaultValues: getEmptyCreateDistributorDTO(),\n });\n\n // submit\n const onSubmit = handleSubmit((data: CreateDistributorRequestDTO) =>\n createDistributor(data),\n );\n\n // modal close\n const closeModal = () => {\n setIsAddDistributorModalOpen(false);\n setTimeout(() => reset(), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n closeModal();\n }\n }, [isSuccess]);\n\n const renderAddDistributorButton = () => {\n return (\n \n setIsAddDistributorModalOpen(true)}>\n \n {t(`distributorList.Add distributor`)}\n \n \n );\n };\n\n return (\n <>\n {renderAddDistributorButton()}\n\n \n \n \n \n );\n};\n","import React, { FC } from \"react\";\ninterface Props {\n children: React.ReactNode;\n}\nexport const Table: FC<\n Props &\n React.DetailedHTMLProps<\n React.TableHTMLAttributes,\n HTMLTableElement\n >\n> = ({ children, ...rest }) => (\n
\n
\n
\n
\n \n {children}\n
\n
\n
\n
\n
\n);\n","import React, { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n}\n\nexport const TBody: FC<\n Props &\n React.DetailedHTMLProps<\n React.TableHTMLAttributes,\n HTMLTableSectionElement\n >\n> = ({ children, ...rest }) => (\n \n {children}\n \n);\n","import { classNames } from \"helpers/classNames\";\nimport React, { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n className?: string;\n addLeftMargin?: boolean;\n alignRight?: boolean;\n}\n\nexport const TD: FC<\n Props &\n React.DetailedHTMLProps<\n React.TableHTMLAttributes,\n HTMLTableCellElement\n >\n> = ({\n children,\n className,\n addLeftMargin = false,\n alignRight = false,\n ...rest\n}) => (\n \n {children}\n \n);\n","import { classNames } from \"helpers/classNames\";\nimport React, { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n isFirstColumn?: boolean;\n alignRight?: boolean;\n}\n\nexport const TH: FC<\n Props &\n React.DetailedHTMLProps<\n React.TableHTMLAttributes,\n HTMLTableCellElement\n >\n> = ({ children, isFirstColumn = false, alignRight = false, ...rest }) => (\n \n {children}\n \n);\n","import React, { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n}\n\nexport const THead: FC<\n Props &\n React.DetailedHTMLProps<\n React.TableHTMLAttributes,\n HTMLTableSectionElement\n >\n> = ({ children, ...rest }) => (\n \n {children}\n \n);\n","import { FC, ReactNode } from \"react\";\n\ninterface Props {\n children: ReactNode;\n}\n\nexport const TR: FC<\n Props &\n React.DetailedHTMLProps<\n React.TableHTMLAttributes,\n HTMLTableRowElement\n >\n> = ({ children, ...props }) => (\n \n {children}\n \n);\n","import { Role } from \"../enums/role.enum\";\n\nexport const isFlower = (role: Role) => role === Role.Flower;\nexport const isDistributor = (role: Role) =>\n [Role.DistributorAdmin, Role.DistributorUser].includes(role);\nexport const isInstaller = (role: Role) =>\n [Role.InstallerAdmin, Role.InstallerUser].includes(role);\nexport const isAssetOwner = (role: Role) => role === Role.AssetOwner;\nexport const isGuest = (role: Role) => role === Role.Guest;\n\nexport const getRoleName = (role: Role) => {\n switch (role) {\n case Role.AssetOwner:\n return \"Asset owner\";\n case Role.Flower:\n return \"Flower\";\n case Role.DistributorAdmin:\n case Role.InstallerAdmin:\n return \"Administrator\";\n case Role.DistributorUser:\n case Role.InstallerUser:\n return \"User\";\n default:\n return \"Unknown type\";\n }\n};\n","import { PageWrapper } from \"components/PageWrapper\";\nimport { isEmptyArray } from \"helpers/array\";\nimport { FC } from \"react\";\n\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { Role } from \"enums/role.enum\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNavigate } from \"react-router-dom\";\nimport { AddDistributor } from \"./AddDistributor\";\nimport { useDistributors } from \"api/distributor/distributor.endpoints\";\nimport { Table, THead, TR, TH, TBody, TD } from \"components/table\";\nimport { isFlower } from \"../../helpers/role\";\nimport { GetDistributorItemResponseDTO } from \"../../api/distributor/distributor.dto\";\n\ninterface Props {\n userRole: Role;\n}\n\nexport const DistributorList: FC = ({ userRole }) => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n\n // get distributor list\n const { data: distributors, isLoading, isError } = useDistributors();\n\n const onDistributorClick = (id: number) => navigate(`${id}`);\n\n if (isLoading || isError) {\n return (\n }\n errorMessage={t(`distributorList.Error`)}\n loaderSize=\"page\"\n />\n );\n }\n\n if (!isLoading && isEmptyArray([distributors])) {\n return (\n <>\n }\n />\n\n {isFlower(userRole) && }\n \n );\n }\n\n return (\n \n
\n
\n
\n \n

\n {t(`distributorList.A list of our existing distributors.`)}\n

\n
\n
\n\n \n \n \n \n \n \n \n \n \n {distributors?.map(\n ({\n id,\n name,\n organizationNumber,\n city,\n }: GetDistributorItemResponseDTO) => (\n onDistributorClick(id)}>\n \n \n \n \n ),\n )}\n \n
{t(\"distributorList.Company\")}{t(\"distributorList.Organization number\")}{t(\"distributorList.City\")}
{name}{organizationNumber}{city}
\n
\n
\n );\n};\n","import { useEffect } from \"react\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\n\nimport { DistributorList } from \"../../../components/distributor/DistributorList\";\nimport userStore, { getUserRole } from \"store/user.store\";\n\nexport const DistributorsPage = () => {\n const userRole = userStore(getUserRole);\n\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n setBreadCrumbs([getDistributorListBreadcrumb()]);\n }, []);\n\n return ;\n};\n\nexport const getDistributorListBreadcrumb = (): BreadCrumb => ({\n label: \"Distributors\",\n to: `${RouteUrl.App}/${RouteUrl.Distributors}`,\n});\n","import { Transition } from \"components/animations/Transition\";\nimport React, { FC } from \"react\";\nimport { classNames } from \"../../helpers/classNames\";\nimport { isMobile } from \"react-device-detect\";\n\nexport interface Tab {\n label: string;\n param: string;\n content: React.ReactNode;\n isSelected: boolean;\n labelName?: string;\n button?: React.ReactNode;\n}\n\ninterface Props {\n tabs: Tab[];\n setTab: (param: string) => void;\n}\n\nexport const TabPageWrapper: FC = ({ tabs, setTab }) => {\n return (\n \n {isMobile ? (\n \n ) : (\n \n )}\n {/* content */}\n
\n {tabs.find((tab) => tab?.isSelected)?.content}\n
\n \n );\n};\n\nconst MobileVersion: FC = ({ tabs, setTab }) => (\n
\n \n tab?.isSelected)?.label}\n onChange={(e) => setTab(e.target.value)}\n >\n {tabs.map((tab) => (\n \n ))}\n \n {tabs.find((tab) => tab?.isSelected)?.button && (\n
\n {tabs.find((tab) => tab?.isSelected)?.button}\n
\n )}\n
\n);\n\nconst DesktopVersion: FC = ({ tabs, setTab }) => (\n
\n
\n
\n ))}\n \n {tabs.find((tab) => tab?.isSelected)?.button &&\n tabs.find((tab) => tab?.isSelected)?.button}\n
\n \n);\n","import api from \"api/axiosInstance\";\nimport { DashboardStatisticsResponseDTO } from \"./statistics.dto\";\nimport { StatisticPeriodType } from \"enums/statistic.enum\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ENDPOINT = \"/statistics\";\n\nexport enum DashboardQueryKeys {\n GetDashboardStatistics = \"get-dashboard-statistics\",\n}\n\nexport const useDashboardStatistics = (\n filterDistributorId?: number,\n filterInstallerId?: number,\n periodType?: StatisticPeriodType,\n) => {\n const params = new URLSearchParams();\n\n if (filterDistributorId !== undefined) {\n params.append(\"distributorId\", filterDistributorId.toString());\n }\n if (filterInstallerId !== undefined) {\n params.append(\"installerId\", filterInstallerId.toString());\n }\n if (periodType !== undefined) {\n params.append(\"periodType\", periodType.toString());\n }\n\n const queryString = params.toString();\n const url = queryString\n ? `${ENDPOINT}/dashboard?${queryString}`\n : `${ENDPOINT}/dashboard`;\n\n return useQuery({\n queryKey: [DashboardQueryKeys.GetDashboardStatistics, queryString],\n queryFn: async (): Promise =>\n (await api.get(url)).data,\n });\n};\n","import React from \"react\";\nimport {\n ArrowLongRightIcon,\n ArrowTrendingDownIcon,\n ArrowTrendingUpIcon,\n} from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Statistic {\n count: number | string;\n label?: string;\n}\n\ninterface DashboardTileProps {\n title: string;\n leftStat: Statistic;\n deviation?: number;\n icon: React.ReactNode;\n rightStat?: Statistic;\n showDeviation?: boolean;\n}\n\nconst DashboardTile: React.FC = ({\n title,\n leftStat,\n deviation = 0,\n icon,\n rightStat,\n showDeviation = true,\n}) => {\n const { t } = useTranslation();\n // Determine icon color based on deviation\n const deviationColor =\n deviation > 0\n ? \"text-flowerGreen-300\"\n : deviation == 0\n ? \"text-flowerGray-200\"\n : \"text-flowerRed-500\";\n const deviationText =\n deviation > 0\n ? t(`dashboardStatistics.HigherThanPreviousPeriod`)\n : deviation == 0\n ? t(`dashboardStatistics.EqualToPreviousPeriod`)\n : t(`dashboardStatistics.LowerThanPreviousPeriod`);\n\n return (\n
\n
\n \n {title}\n \n
{icon}
\n
\n
\n
\n \n {leftStat.count}\n \n \n {leftStat.label ?? \"\"}\n \n
\n {rightStat && (\n
\n \n {rightStat.count}\n \n \n {rightStat.label ?? \"\"}\n \n
\n )}\n
\n {showDeviation && (\n
\n
\n
\n {deviation > 0 ? (\n \n ) : deviation === 0 ? (\n \n ) : (\n \n )}\n
\n {deviation !== 0 && (\n {`${Math.abs(deviation)}%`}\n )}\n
\n \n {deviationText}\n \n
\n )}\n
\n );\n};\n\nexport default DashboardTile;\n","export enum StatisticPeriodType {\n Last30Days = \"last30days\",\n All = \"all\",\n}\n","import React from \"react\";\nimport { Tab, TabList, TabGroup } from \"@headlessui/react\";\nimport { StatisticPeriodType } from \"enums/statistic.enum\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface PeriodFilterTabsProps {\n selectedPeriod: StatisticPeriodType;\n onPeriodChange: (period: StatisticPeriodType) => void;\n}\n\nconst PeriodFilterTabs: React.FC = ({\n selectedPeriod,\n onPeriodChange,\n}) => {\n const { t } = useTranslation();\n\n return (\n \n \n {Object.values(StatisticPeriodType).map((type) => (\n onPeriodChange(type)}\n className={`min-w-20 rounded-full py-1 px-3 text-sm font-normal focus:outline-none ${\n selectedPeriod === type\n ? \"bg-flowerPeach-500 text-flowerPeach-900\"\n : \"text-flowerGray-400 hover:text-flowerPeach-900\"\n }`}\n >\n {t(`dashboardStatistics.periodTypeLabels.${type}`)}\n \n ))}\n \n \n );\n};\n\nexport default PeriodFilterTabs;\n","import {\n BoltIcon,\n ClipboardDocumentListIcon,\n CubeIcon,\n HomeModernIcon,\n ServerStackIcon,\n TruckIcon,\n} from \"@heroicons/react/24/outline\";\nimport { useDashboardStatistics } from \"api/statistics/statistics.endpoints\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport DashboardTile from \"components/statistics/DashboardTile\";\nimport { StatisticPeriodType } from \"enums/statistic.enum\";\nimport { FC, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport PeriodFilterTabs from \"./PeriodFilterTabs\";\nimport { isDistributor, isFlower } from \"../../helpers/role\";\n\ninterface Props {\n distributorId?: number;\n installerId?: number;\n}\nexport const DashboardStatistics: FC = ({\n distributorId,\n installerId,\n}) => {\n const { t } = useTranslation();\n const userRole = userStore(getUserRole);\n const [selectedPeriod, setSelectedPeriod] = useState(\n StatisticPeriodType.Last30Days,\n );\n\n const handlePeriodChange = (period: StatisticPeriodType) => {\n setSelectedPeriod(period);\n };\n\n const {\n data: statisticsData,\n isLoading: isLoadingStatistics,\n isError: statisticsIsErrored,\n } = useDashboardStatistics(distributorId, installerId, selectedPeriod);\n\n const calculatePercentageChange = (\n current: number,\n previous: number,\n decimalPlaces: number = 1,\n ) => {\n if (previous === 0) {\n if (current === 0) {\n return 0;\n }\n return current * 100;\n }\n return parseFloat(\n (((current - previous) / previous) * 100).toFixed(decimalPlaces),\n );\n };\n\n const formatActivePower = (valueInKw: number): string => {\n // Define the conversion factor\n const conversionFactor = 0.001; // 1 kW = 0.001 MW\n const valueInMw = valueInKw * conversionFactor;\n\n if (valueInMw >= 1) {\n return `${valueInMw.toFixed(3)} MW`;\n } else {\n return `${Math.round(valueInKw)} kW`;\n }\n };\n\n return (\n
\n \n {isLoadingStatistics || !statisticsData || statisticsIsErrored ? (\n }\n errorMessage={t(`dashboardStatistics.UnableToLoad`)}\n emptyDataMessage={t(`dashboardStatistics.NotFound`)}\n />\n ) : (\n
\n {statisticsData?.distributorStats && isFlower(userRole) && (\n }\n showDeviation={selectedPeriod !== StatisticPeriodType.All}\n />\n )}\n {statisticsData?.installerStats &&\n (isFlower(userRole) || isDistributor(userRole)) && (\n }\n showDeviation={selectedPeriod !== StatisticPeriodType.All}\n />\n )}\n }\n showDeviation={selectedPeriod !== StatisticPeriodType.All}\n />\n }\n showDeviation={selectedPeriod !== StatisticPeriodType.All}\n />\n }\n showDeviation={selectedPeriod !== StatisticPeriodType.All}\n />\n
\n )}\n
\n );\n};\n","import { classNames } from \"helpers/classNames\";\nimport { FC } from \"react\";\n\ninterface Props {\n text: string;\n color: BadgeColor;\n size?: BadgeSize;\n}\n\nexport const Badge: FC = ({ text, color, size = \"small\" }) => (\n \n {text}\n \n);\n\nexport type BadgeColor = \"red\" | \"yellow\" | \"green\" | \"blue\" | \"gray\";\n\nexport const colorClass = (color: BadgeColor): string => {\n switch (color) {\n case \"red\":\n return \"bg-red-100 text-flowerRed-500\";\n case \"blue\":\n return \"bg-flowerSky-50 text-flowerSkyVivid-500\";\n case \"green\":\n return \"bg-green-100 text-green-500\";\n case \"yellow\":\n return \"bg-yellow-100 text-yellow-500\";\n case \"gray\":\n return \"bg-gray-100 text-gray-500\";\n default:\n return \"bg-gray-100 text-gray-500\";\n }\n};\n\nexport type BadgeSize = \"small\" | \"big\" | \"extra-big\";\n","import React, { FC, useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\"; // It allows to render a child component into a different part of the DOM tree\nimport { BadgeColor, colorClass } from \"../tags/Badge\";\nimport { classNames } from \"../../helpers/classNames\";\n\ntype TooltipSize = \"small\" | \"medium\" | \"large\";\ntype TooltipPosition = \"top\" | \"bottom\" | \"left\" | \"right\" | \"bottom-left\";\n\ninterface Props {\n children: React.ReactNode;\n message: string;\n color?: BadgeColor;\n size?: TooltipSize;\n position?: TooltipPosition;\n isPreWrapText?: boolean;\n}\n\nexport const Tooltip: FC = ({\n children,\n message,\n color = \"gray\",\n size = \"medium\",\n position = \"top\",\n isPreWrapText = false,\n}) => {\n const [isVisible, setIsVisible] = useState(false);\n const [coords, setCoords] = useState({ x: 0, y: 0 });\n const triggerRef = useRef(null);\n const tooltipRef = useRef(null);\n\n // Prevent tooltip from showing on scroll\n useEffect(() => {\n const hideOnScroll = () => setIsVisible(false);\n window.addEventListener(\"scroll\", hideOnScroll, true);\n return () => window.removeEventListener(\"scroll\", hideOnScroll, true);\n }, []);\n\n // Calculate tooltip position\n useEffect(() => {\n if (isVisible && triggerRef.current && tooltipRef.current) {\n const triggerRect = triggerRef.current.getBoundingClientRect();\n const tooltipRect = tooltipRef.current.getBoundingClientRect();\n\n let { x, y } = coords;\n const offset = 0; // Reduced offset value\n\n switch (position) {\n case \"top\":\n x = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;\n y = triggerRect.top - tooltipRect.height - offset;\n break;\n case \"bottom\":\n x = triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2;\n y = triggerRect.bottom + offset;\n break;\n case \"left\":\n x = triggerRect.left - tooltipRect.width - offset;\n y = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;\n break;\n case \"right\":\n x = triggerRect.right + offset;\n y = triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2;\n break;\n case \"bottom-left\":\n x = triggerRect.right - 10;\n y = triggerRect.bottom + offset - 10;\n break;\n }\n\n // Constrain to window boundaries\n x = Math.max(8, Math.min(x, window.innerWidth - tooltipRect.width - 8));\n y = Math.max(8, Math.min(y, window.innerHeight - tooltipRect.height - 8));\n\n setCoords({ x: x + window.scrollX, y: y + window.scrollY });\n }\n }, [isVisible, position]);\n\n const handleMouseEnter = () => setIsVisible(true);\n const handleMouseLeave = () => setIsVisible(false);\n\n return (\n <>\n \n {children}\n \n {isVisible &&\n createPortal(\n \n
\n \n {message}\n
\n \n ,\n document.body,\n )}\n \n );\n};\n\nconst getTooltipSize = (size: TooltipSize): string => {\n switch (size) {\n case \"small\":\n return \"w-32\";\n case \"medium\":\n return \"w-52\";\n case \"large\":\n return \"w-72\";\n default:\n throw Error(`getTooltipSize missing implementation for ${size}`);\n }\n};\n","import { LargeLoader } from \"./loaders/LargeLoader\";\nimport { OpacityTransition } from \"./animations/SnapUp\";\nimport React from \"react\";\nimport { InformationCircleIcon } from \"@heroicons/react/20/solid\";\nimport { Tooltip } from \"./tooltip/Tooltip\";\n\ninterface Props {\n header: string;\n children: React.ReactNode;\n button?: React.ReactNode;\n isLoading?: boolean;\n isError?: boolean;\n infoText?: string;\n toaster?: React.ReactNode;\n}\n\nexport const Panel = ({\n header,\n children,\n button,\n isLoading = false,\n isError = false,\n infoText,\n toaster,\n}: Props) => (\n
\n
\n

{header}

\n {infoText && (\n \n
\n \n
\n
\n )}\n
\n {isLoading ? (\n
\n \n
\n ) : isError ? (\n
Server error
\n ) : (\n
\n {toaster}\n
\n {!!button &&
{button}
}\n {children}\n
\n
\n )}\n
\n);\n","import {\n differenceInSeconds,\n differenceInMinutes,\n differenceInHours,\n differenceInDays,\n differenceInMonths,\n format,\n} from \"date-fns\";\n//import swedish from \"date-fns/locale/sv\"; // todo: connect the locale logic with 18next\nimport { enGB } from \"date-fns/locale/en-GB\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const formatDate = (date?: string | Date): string => {\n if (!date) return \"-\";\n return format(new Date(date), \"dd MMM yyyy\", {\n //locale: swedish,\n locale: enGB,\n });\n};\n\nexport const formatDateMonth = (date?: string | Date): string => {\n if (!date) return \"-\";\n return format(new Date(date), \"dd MMMM\", {\n //locale: swedish,\n locale: enGB,\n });\n};\n\nexport const dateToChartName = (date: string | Date): string => {\n return format(new Date(date), \"MMM-yy\", {\n //locale: swedish,\n locale: enGB,\n }).replace(\".\", \"\");\n};\n\nexport const formatDateTime = (\n date: Date | string | number,\n locale = \"en-US\",\n options?: Intl.DateTimeFormatOptions,\n) => {\n const defaultOptions: Intl.DateTimeFormatOptions = {\n dateStyle: \"medium\",\n timeStyle: \"short\",\n };\n\n const dateToFormat =\n typeof date === \"string\" || typeof date === \"number\"\n ? new Date(date)\n : date;\n\n return new Intl.DateTimeFormat(locale, options || defaultOptions).format(\n dateToFormat,\n );\n};\n\nexport function getRelativeTimeLabel(fromDate: Date): {\n label: string;\n isStale: boolean;\n isVeryStale: boolean;\n} {\n const now = new Date();\n const { t } = useTranslation();\n const seconds = differenceInSeconds(now, fromDate);\n const minutes = differenceInMinutes(now, fromDate);\n const hours = differenceInHours(now, fromDate);\n const days = differenceInDays(now, fromDate);\n const months = differenceInMonths(now, fromDate);\n\n let label = \"\";\n if (seconds < 60) {\n label =\n seconds === 0\n ? t(\"monitoring.Just now\")\n : `${seconds} ${t(\"monitoring.Seconds ago\")}`;\n } else if (minutes < 60) {\n label = `${minutes} ${t(\"monitoring.Minutes ago\")}`;\n } else if (hours < 24) {\n label = `${hours} ${t(\"monitoring.Hours ago\")}`;\n } else if (days < 30) {\n label = `${days} ${t(\"monitoring.Days ago\")}`;\n } else {\n label = `${months} ${months !== 1 ? t(\"monitoring.Month ago\") : t(\"monitoring.Months ago\")} `;\n }\n\n return {\n label,\n isStale: minutes >= 15,\n isVeryStale: hours >= 1,\n };\n}\n","import { useNotification } from \"hooks/useNotification\";\nimport api from \"../axiosInstance\";\nimport {\n CreateInstallerRequestDTO,\n GetAllInstallerResponseDTO,\n GetInstallerInfoForPayoutResponseDTO,\n GetInstallerResponseDTO,\n GetInstallersByUserRoleQueryParams,\n GetInstallerUsersResponseDTO,\n UpdateInstallerCanInviteAssetOwnersRequestDTO,\n UpdateInstallerRequestDTO,\n UpdateInstallerResponseDTO,\n} from \"./installer.dto\";\nimport {\n keepPreviousData,\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n} from \"@tanstack/react-query\";\nimport { ErrorResponse } from \"../../types/errorResponse.type\";\nimport { fetchPages } from \"../pagination/pagination.endpoint\";\nimport qs from \"qs\";\n\nconst ENDPOINT = \"/installer\";\n\nexport enum InstallerQueryKeys {\n GetOne = \"installer-get-one\",\n GetAllPagination = \"installer-get-all-pagination\",\n GetUsers = \"installer-get-installer-users\",\n GetInformationForPayouts = \"information-for-payout\",\n}\n\nexport const useInstallersPagination = (\n queryString: string,\n optionalParams?: GetInstallersByUserRoleQueryParams,\n) => {\n const { distributorId } = optionalParams || {};\n\n // Create optional query string\n const extraQueryString = qs.stringify({\n distributorId: distributorId ? distributorId : undefined,\n });\n\n return useInfiniteQuery({\n queryKey: [\n InstallerQueryKeys.GetAllPagination,\n { queryString, distributorId },\n ],\n queryFn: async ({ pageParam }): Promise =>\n (\n await fetchPages({\n url: `${ENDPOINT}`,\n pageParam,\n queryString,\n extraQueryString,\n })\n ).data,\n getNextPageParam: (lastPage, pages) =>\n lastPage.hasNextPage ? pages.length : undefined,\n initialPageParam: 0,\n refetchOnWindowFocus: false,\n placeholderData: keepPreviousData,\n gcTime: 2000,\n });\n};\n\nexport const useInstallerInstallerInformationForPayout = () =>\n useQuery({\n queryKey: [InstallerQueryKeys.GetInformationForPayouts],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/information-for-payout`)).data,\n });\n\nexport const useInstallerUsers = (id: number) =>\n useQuery({\n queryKey: [InstallerQueryKeys.GetUsers, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}/user`)).data,\n initialData: { users: [], invitations: [] },\n });\n\nexport const useInstaller = (id?: number) =>\n useQuery({\n queryKey: [InstallerQueryKeys.GetOne, id],\n queryFn: async (): Promise =>\n (await api.get(`${ENDPOINT}/${id}`)).data,\n enabled: !!id,\n });\n\nexport const useCreateInstaller = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreateInstallerRequestDTO,\n ): Promise =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: (data) => {\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetAllPagination],\n });\n notification.info(`${data.name} successfully created`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useUpdateInstaller = (id: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: UpdateInstallerRequestDTO,\n ): Promise =>\n (await api.put(`${ENDPOINT}/${id}`, payload)).data,\n onSuccess: (data) => {\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetOne, data.id],\n });\n notification.info(`${data.name} successfully updated`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useUpdateInstallerCanInviteAssetOwners = (id: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: UpdateInstallerCanInviteAssetOwnersRequestDTO,\n ): Promise =>\n (await api.put(`${ENDPOINT}/${id}/canInviteAssetOwners`, payload)).data,\n onSuccess: (data) => {\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetOne, data.id],\n });\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetAllPagination],\n });\n notification.info(`${data.name} successfully updated`);\n },\n onError: () => {\n notification.error();\n },\n });\n};\n","import { AddressDTO } from \"api/shared/address.dto\";\nimport { InstallerStatus } from \"../../enums/installerStatus.enum\";\nimport { Role } from \"../../enums/role.enum\";\nimport { InstallerInvitationDTO } from \"../installerInvitation/installerInvitation.dto\";\nimport { FilterDTO } from \"../pagination/pagination.type\";\n\nexport type InstallerContactDTO = {\n id: number;\n name: string;\n address: AddressDTO;\n};\n\nexport type GetInstallersByUserRoleQueryParams = {\n distributorId?: number;\n};\n\nexport type InstallerItemDTO = {\n id: number;\n name: string;\n organizationNumber: string;\n city?: string;\n distributorId: number;\n canInviteAssetOwners: boolean;\n status: InstallerStatus;\n};\n\nexport type GetAllInstallerResponseDTO = {\n items: InstallerItemDTO[];\n hasNextPage: boolean;\n filters: FilterDTO[];\n};\n\ntype DistributorDTO = {\n id: number;\n name: string;\n};\n\nexport type GetInstallerResponseDTO = {\n id: number;\n name: string;\n organizationNumber: string;\n distributor: DistributorDTO;\n address: AddressDTO;\n giroNumber?: string;\n canInviteAssetOwners: boolean;\n invoiceContactPerson?: string;\n invoiceContactEmail?: string;\n};\n\nexport type InstallerUserDTO = {\n id: number;\n name: string;\n email: string;\n role: Role;\n};\n\nexport type GetInstallerUsersResponseDTO = {\n users?: InstallerUserDTO[];\n invitations?: InstallerInvitationDTO[];\n};\n\nexport type CreateInstallerRequestDTO = {\n distributorId: number;\n name: string;\n organizationNumber: string;\n firstUserEmail: string;\n canInviteAssetOwners: boolean;\n};\n\nexport const getEmptyCreateInstallerDTO = (): CreateInstallerRequestDTO => ({\n distributorId: -1,\n name: \"\",\n organizationNumber: \"\",\n firstUserEmail: \"\",\n canInviteAssetOwners: true,\n});\n\nexport type UpdateInstallerRequestDTO = {\n name: string;\n organizationNumber: string;\n address: AddressDTO;\n giroNumber: string;\n invoiceContactPerson: string;\n invoiceContactEmail: string;\n};\n\nexport type UpdateInstallerCanInviteAssetOwnersRequestDTO = {\n canInviteAssetOwners: boolean;\n};\n\nexport type UpdateInstallerResponseDTO = {\n id: number;\n name: string;\n};\n\nexport type GetInstallerInfoForPayoutResponseDTO = {\n id: number;\n installerOrganization: string;\n organizationNumber: string;\n distributorOrganization: string;\n street: string;\n postalCode: string;\n city: string;\n invoiceContactPerson?: string;\n invoiceContactEmail?: string;\n bankgiroNumber?: string;\n vatNumber?: string;\n};\n","import { classNames } from \"helpers/classNames\";\nimport { UseFormRegister } from \"react-hook-form\";\n\nexport interface CheckboxItem {\n label: string;\n name: string;\n}\ninterface CheckboxProps {\n item: CheckboxItem;\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: UseFormRegister;\n textSize?: string;\n}\nexport const Checkbox = ({\n item,\n register,\n textSize = \"text-sm\",\n}: CheckboxProps) => (\n
\n
\n \n
\n
\n \n
\n
\n);\n","import { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Checkbox } from \"components/input/Checkbox\";\nimport { CreateInstallerRequestDTO } from \"../../api/installer/installer.dto\";\n\ninterface Props {\n register: UseFormRegister;\n errors: Partial>;\n}\n\nexport const AddInstallerForm: FC = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n \n \n \n \n \n \n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { UserPlusIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"../buttons/SecondaryButton\";\nimport { useCreateInstaller } from \"api/installer/installer.endpoints\";\nimport {\n CreateInstallerRequestDTO,\n getEmptyCreateInstallerDTO,\n} from \"api/installer/installer.dto\";\nimport { AddInstallerForm } from \"./AddInstallerForm\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n distributorId: number;\n isCentered?: boolean;\n}\n\nexport const AddInstaller: FC = ({\n distributorId,\n isCentered = false,\n}) => {\n const { t } = useTranslation();\n\n // state\n const [isAddInstallerModalOpen, setIsAddInstallerModalOpen] =\n useState(false);\n\n // api\n const {\n mutate: createInstaller,\n isPending: isCreating,\n isSuccess,\n } = useCreateInstaller();\n\n // form\n const {\n register,\n handleSubmit,\n reset,\n formState: { errors },\n } = useForm({\n defaultValues: getEmptyCreateInstallerDTO(),\n });\n\n // submit\n const onSubmit = handleSubmit((data: CreateInstallerRequestDTO) =>\n createInstaller({ ...data, distributorId }),\n );\n\n // modal close\n const closeModal = () => {\n setIsAddInstallerModalOpen(false);\n setTimeout(() => reset(), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n closeModal();\n }\n }, [isSuccess]);\n\n const renderAddInstallerButton = () => {\n return (\n \n setIsAddInstallerModalOpen(true)}>\n \n {t(`installerList.Add installer`)}\n \n \n );\n };\n\n return (\n <>\n {renderAddInstallerButton()}\n\n \n \n \n \n );\n};\n","import { FilterValues } from \"./pagination.type\";\n\nexport function createFilterParams(array: FilterValues[]): {\n [key: string]: string[];\n} {\n const params: { [key: string]: string[] } = {};\n array.forEach((item) => {\n params[item.id] = item.value;\n });\n return params;\n}\n","import { useEffect, useState } from \"react\";\n\nconst useDebounce = (value: string, delay = 500) => {\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const id = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(id);\n };\n }, [value, delay]);\n\n return debouncedValue;\n};\nexport default useDebounce;\n","import {\n Disclosure,\n DisclosureButton,\n DisclosurePanel,\n Menu,\n MenuButton,\n MenuItems,\n Transition,\n} from \"@headlessui/react\";\nimport React, { FC, Fragment, useEffect, useState } from \"react\";\nimport { MinusIcon, PlusIcon } from \"@heroicons/react/20/solid\";\nimport { AdjustmentsHorizontalIcon } from \"@heroicons/react/24/outline\";\nimport {\n FilterValues,\n FilterWithLabelDTO,\n OptionDTO,\n} from \"../../api/pagination/pagination.type\";\nimport { useTranslation } from \"react-i18next\";\nimport qs from \"qs\";\nimport { createFilterParams } from \"../../api/pagination/pagination.helper\";\nimport useDebounce from \"../../hooks/useDebounce\";\n\ninterface Props {\n setPaginationUrl: React.Dispatch>;\n filters: FilterWithLabelDTO[];\n}\n\nexport const FilterMenu: FC = ({ filters, setPaginationUrl }) => {\n const { t } = useTranslation();\n\n // State to store the column filters\n const [columnFilters, setColumnFilters] = useState([]);\n\n // Debounce the column filters state\n\n // Convert columnFilters to a string for debouncing\n const debouncedColumnFiltersString = useDebounce(\n JSON.stringify(columnFilters),\n 1000,\n );\n\n // Parse the debounced string back to an array\n const debouncedColumnFilters = JSON.parse(debouncedColumnFiltersString);\n\n // Function to update the column filters\n const changeColumnFilter = (option: string, column: string) => {\n setColumnFilters((prev: FilterValues[]) => {\n const existingFilter = prev.find((filter) => filter.id === column);\n if (!existingFilter) {\n // If the filter doesn't exist, create a new one\n return [\n ...prev,\n {\n id: column,\n value: [option],\n },\n ];\n } else {\n // If the filter already exists, update its value\n const isActive = existingFilter.value.includes(option);\n const updatedFilter = {\n ...existingFilter,\n value: isActive\n ? existingFilter.value.filter((s: string) => s !== option)\n : [...existingFilter.value, option],\n };\n // Replace the existing filter in the array\n return prev.map((f) => (f.id === column ? updatedFilter : f));\n }\n });\n };\n\n // Update the pagination URL when the column filters change\n useEffect(() => {\n const filterParams = createFilterParams(debouncedColumnFilters);\n setPaginationUrl((queryString) => {\n const parsedQueryString = qs.parse(queryString);\n return qs.stringify(\n {\n ...parsedQueryString,\n ...filterParams,\n },\n { arrayFormat: \"repeat\" },\n );\n });\n }, [debouncedColumnFilters]);\n\n const allSectionsEmpty = filters.every(\n (section) => section.options.length === 0,\n );\n\n return (\n \n \n \n \n\n \n \n {allSectionsEmpty ? (\n
\n {t(\"No filters available.\")}\n
\n ) : (\n filters.map((section: FilterWithLabelDTO) => {\n const filterStatuses =\n columnFilters.find((f) => f.id === section.id)?.value || [];\n if (section.options.length === 0) return null;\n return (\n \n {({ open }) => (\n <>\n

\n \n \n {t(`columnFilterGroup.${section.id}`)}\n \n \n {open ? (\n \n ) : (\n \n )}\n \n \n

\n \n
\n {section.options.map(\n (option: OptionDTO, optionIdx: number) => (\n \n \n changeColumnFilter(option.value, section.id)\n }\n />\n \n {option.label}\n \n
\n ),\n )}\n \n
\n \n )}\n \n );\n })\n )}\n
\n \n
\n );\n};\n","import { MagnifyingGlassIcon } from \"@heroicons/react/20/solid\";\nimport React, { FC, useEffect, useState } from \"react\";\nimport useDebounce from \"../../hooks/useDebounce\";\nimport qs from \"qs\";\n\ninterface Props {\n setPaginationUrl: React.Dispatch>;\n placeholder?: string;\n}\n\nexport const SearchField: FC = ({ placeholder, setPaginationUrl }) => {\n // State used to store the global filter value\n const [searchFilterValue, setSearchFilterValue] = useState(\"\");\n\n // Debounce the search value to avoid making unnecessary requests\n const debouncedSearchValue = useDebounce(searchFilterValue, 1000);\n\n // Update the global filter value and the pagination url when the search value\n useEffect(() => {\n setSearchFilterValue(debouncedSearchValue);\n setPaginationUrl((queryString) => {\n const parsedQueryString = qs.parse(queryString);\n return qs.stringify(\n {\n ...parsedQueryString,\n searchFilter: searchFilterValue ? searchFilterValue : undefined,\n },\n { arrayFormat: \"repeat\" },\n );\n });\n }, [debouncedSearchValue]);\n\n return (\n
\n
\n \n
\n setSearchFilterValue(e.target.value)}\n value={searchFilterValue}\n />\n
\n );\n};\n","import { FC, ReactNode } from \"react\";\nimport { classNames } from \"../../helpers/classNames\";\n\ninterface Props {\n children: ReactNode;\n size?: \"small\" | \"big\";\n}\n\nexport const ToolBar: FC = ({ children, size = \"big\" }) => {\n return (\n \n
\n {children}\n
\n \n );\n};\n","import React from \"react\";\nimport { ChevronDownIcon, ChevronUpIcon } from \"@heroicons/react/16/solid\";\nimport { ChevronUpDownIcon } from \"@heroicons/react/20/solid\";\nimport { flexRender, Header } from \"@tanstack/react-table\";\n\ninterface Props {\n header: Header;\n}\n\nexport const TH = ({ header }: Props): React.ReactElement => {\n const arrow = {\n desc: (\n \n \n \n ),\n asc: (\n \n \n \n ),\n default: (\n \n \n \n ),\n }[header.column.getIsSorted() || \"default\"];\n return (\n \n \n {flexRender(header.column.columnDef.header, header.getContext())}\n \n {header.column.getCanSort() && arrow}\n \n );\n};\n","import React from \"react\";\nimport { HeaderGroup } from \"@tanstack/react-table\";\nimport { TH } from \"./TH\";\n\ninterface Props {\n headerGroup: HeaderGroup;\n}\n\nexport const TRH = ({ headerGroup }: Props): React.ReactElement => {\n return (\n
\n {headerGroup.headers.map((header) => (\n \n ))}\n
\n );\n};\n","import React from \"react\";\n\nimport { Table } from \"@tanstack/react-table\";\nimport { TRH } from \"./TRH\";\n\ninterface Props {\n table: Table;\n scrollbarWidth: number;\n}\n\nexport const THead = ({\n table,\n scrollbarWidth,\n}: Props): React.ReactElement => {\n return (\n \n {table.getHeaderGroups().map((headerGroup) => (\n \n ))}\n \n );\n};\n","import React, { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n}\n\nexport const TableStyle: FC = ({ children }) => (\n
{children}
\n);\n","import React from \"react\";\nimport { Cell, flexRender } from \"@tanstack/react-table\";\n\ninterface Props {\n cell: Cell;\n}\n\nexport const TD = ({ cell }: Props): React.ReactElement => (\n \n \n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n \n \n);\n","import React from \"react\";\nimport { classNames } from \"../../helpers/classNames\";\nimport { Row } from \"@tanstack/react-table\";\nimport { VirtualItem, Virtualizer } from \"@tanstack/react-virtual\";\nimport { TD } from \"./TD\";\n\ninterface Props {\n virtualRow: VirtualItem;\n rows: Row[];\n rowVirtualizer: Virtualizer;\n onSelectRow?: (data: T) => void;\n}\n\nexport const TRB = ({\n virtualRow,\n rowVirtualizer,\n rows,\n onSelectRow,\n}: Props): React.ReactElement => {\n const row = rows[virtualRow.index];\n return (\n rowVirtualizer.measureElement(node)} //measure dynamic row height\n className={classNames(\n `flex w-full pl-2 absolute text-black text-sm font-normal h-12 leading-relaxed items-center ${virtualRow.index % 2 === 0 ? \"bg-[#f3f3f2]\" : \"bg-white\"}`,\n onSelectRow ? \"cursor-pointer hover:opacity-75\" : \"\",\n )}\n style={{\n transform: `translateY(${virtualRow.start}px)`, //this should always be a `style` as it changes on scroll\n }}\n onClick={() => onSelectRow && onSelectRow(row.original)}\n >\n {row.getVisibleCells().map((cell) => (\n \n ))}\n \n );\n};\n","import React from \"react\";\nimport { Row } from \"@tanstack/react-table\";\nimport { Virtualizer } from \"@tanstack/react-virtual\";\nimport { TRB } from \"./TRB\";\nimport { classNames } from \"../../helpers/classNames\";\n\ninterface Props {\n tableContainerRef: React.RefObject;\n rowVirtualizer: Virtualizer;\n rows: Row[];\n onSelectRow?: (data: T) => void;\n isRefetching: boolean;\n}\n\nexport const TBody = ({\n tableContainerRef,\n rowVirtualizer,\n rows,\n onSelectRow,\n isRefetching,\n}: Props): React.ReactElement => (\n \n \n {rowVirtualizer.getVirtualItems().map((virtualRow) => (\n \n ))}\n \n {rowVirtualizer.getVirtualItems().length === 0 && (\n
\n No data available.\n
\n )}\n \n);\n","import React from \"react\";\n\ninterface Props {\n title: string;\n}\n\nexport const Title = ({ title }: Props) => (\n
\n
\n {title}\n
\n
\n);\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { config } from \"react-spring\";\nimport { Transition } from \"../animations/Transition\";\n\nexport const LoadingToaster = () => {\n const { t } = useTranslation();\n\n return (\n \n
\n {t(\"Loading more data\")}\n
\n \n );\n};\n","import {\n Dispatch,\n RefObject,\n SetStateAction,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport { InfiniteQueryResult } from \"../api/pagination/pagination.type\";\n\nexport const useFetchMoreOnBottomReached = (\n paginationQuery: InfiniteQueryResult,\n offSetToTriggerPagination: number,\n setShowLoadingToast: Dispatch>,\n containerRef: RefObject,\n) => {\n const { data, fetchNextPage, isFetchingNextPage, hasNextPage } =\n paginationQuery;\n\n const isFetchingRef = useRef(false);\n\n const numberOfPages = useMemo(() => data?.pages?.length ?? 0, [data]);\n\n const fetchMoreOnBottomReached = useCallback(\n (containerElement?: HTMLDivElement | null) => {\n if (containerElement) {\n const { scrollHeight, scrollTop, clientHeight } = containerElement;\n setShowLoadingToast(\n scrollHeight - scrollTop - clientHeight < 20 * numberOfPages,\n );\n if (\n scrollHeight - scrollTop - clientHeight <\n offSetToTriggerPagination * numberOfPages &&\n hasNextPage &&\n !isFetchingRef.current &&\n !isFetchingNextPage\n ) {\n isFetchingRef.current = true;\n fetchNextPage().finally(() => {\n isFetchingRef.current = false;\n });\n }\n }\n },\n [\n fetchNextPage,\n isFetchingNextPage,\n hasNextPage,\n numberOfPages,\n offSetToTriggerPagination,\n setShowLoadingToast,\n ],\n );\n\n // Attach scroll event to the container\n useEffect(() => {\n const tableContainerElement = containerRef.current;\n\n if (tableContainerElement) {\n const handleScroll = () =>\n fetchMoreOnBottomReached(tableContainerElement);\n tableContainerElement.addEventListener(\"scroll\", handleScroll);\n\n return () => {\n tableContainerElement.removeEventListener(\"scroll\", handleScroll);\n };\n }\n }, [fetchMoreOnBottomReached]);\n};\n","import { RefObject, useCallback, useEffect, useState } from \"react\";\n\nexport const useAutoScrollbarWidth = (\n containerRef: RefObject,\n): number => {\n const [scrollbarWidth, setScrollbarWidth] = useState(0);\n\n const updateScrollbarWidth = useCallback(() => {\n if (containerRef.current) {\n setScrollbarWidth(\n containerRef.current.offsetWidth - containerRef.current.clientWidth,\n );\n }\n }, [containerRef]);\n\n useEffect(() => {\n const containerElement = containerRef.current;\n if (containerElement) {\n const resizeObserver = new ResizeObserver(updateScrollbarWidth);\n resizeObserver.observe(containerElement);\n\n return () => resizeObserver.disconnect();\n }\n }, [updateScrollbarWidth, containerRef]);\n\n return scrollbarWidth;\n};\n","import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n ColumnDef,\n getCoreRowModel,\n getSortedRowModel,\n OnChangeFn,\n SortingState,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport { FilterMenu } from \"./FilterMenu\";\nimport { SearchField } from \"./SearchField\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n InfiniteQueryResult,\n} from \"../../api/pagination/pagination.type\";\nimport { ToolBar } from \"./Toolbar\";\nimport { THead } from \"./THead\";\nimport { TableStyle } from \"./TableStyle\";\nimport { TBody } from \"./TBody\";\nimport { Title } from \"./Title\";\nimport qs from \"qs\";\nimport { LoadingToaster } from \"./LoadingToaster\";\nimport { useFetchMoreOnBottomReached } from \"../../hooks/useFetchMoreOnBottomReached\";\nimport { useAutoScrollbarWidth } from \"../../hooks/useAutoScrollbarWidth\";\nimport useDebounce from \"../../hooks/useDebounce\";\n\ninterface Props {\n paginationQuery: InfiniteQueryResult;\n columns: ColumnDef[];\n onSelectRow?: (data: T) => void;\n columnVisibility?: Record;\n setPaginationUrl: React.Dispatch>;\n title?: string;\n searchPlaceholder?: string;\n hasToolbar?: boolean;\n offSetToTriggerPagination?: number;\n createColumnFilter: (filter: FilterDTO[]) => FilterWithLabelDTO[];\n}\n\nexport const Table = ({\n paginationQuery,\n columns,\n onSelectRow,\n columnVisibility,\n setPaginationUrl,\n title = \"\",\n searchPlaceholder = \"\",\n hasToolbar = true,\n offSetToTriggerPagination = 300,\n createColumnFilter,\n}: Props): React.ReactElement => {\n // State used to store the sorting state of the table\n const [sorting, setSorting] = useState([]);\n\n // Convert sorting to a string for debouncing\n const debouncedSortingString = useDebounce(JSON.stringify(sorting), 1000);\n\n // Parse the debounced string back to an array\n const debouncedSorting = JSON.parse(debouncedSortingString);\n\n // State used to store the visibility of the loading toast when fetching more data\n const [showLoadingToast, setShowLoadingToast] = useState(false);\n\n // Reference to the container of the table's body element for the infinite scrolling logic down below\n const tableContainerRef = useRef(null);\n\n // Destructure the data from the paginationQuery to have relevant data for the table\n const { data, isFetchingNextPage, isRefetching } = paginationQuery;\n\n // Flatten the array of arrays from the useInfiniteQuery hook\n const flatData = useMemo(\n () => data?.pages?.flatMap((page) => page?.items) ?? [],\n [data],\n );\n\n // Getting updated filters, if any, from the server. Checked only first page, because filters are static (same for each page)\n const filters = useMemo(() => data?.pages?.[0]?.filters ?? [], [data]);\n\n // Called on scroll to fetch more pages as the user scrolls and reaches bottom of the list body\n useFetchMoreOnBottomReached(\n paginationQuery,\n offSetToTriggerPagination,\n setShowLoadingToast,\n tableContainerRef,\n );\n\n const scrollbarWidth = useAutoScrollbarWidth(tableContainerRef);\n\n // Update pagination url when sorting changes\n useEffect(() => {\n setPaginationUrl((queryString) => {\n const parsedQueryString = qs.parse(queryString);\n return qs.stringify(\n {\n ...parsedQueryString,\n sortId:\n debouncedSorting.length > 0 ? debouncedSorting[0].id : undefined,\n sortOrder:\n debouncedSorting.length > 0\n ? debouncedSorting[0].desc\n ? \"desc\"\n : \"asc\"\n : undefined,\n },\n { arrayFormat: \"repeat\" },\n );\n });\n }, [debouncedSorting, setPaginationUrl]);\n\n // Set up table props\n const table = useReactTable({\n data: flatData,\n columns,\n state: {\n sorting,\n columnVisibility,\n },\n enableRowSelection: true,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n manualSorting: true,\n manualPagination: true,\n manualFiltering: true,\n debugTable: false,\n });\n\n // Scroll to the top of table when sorting changes\n const handleSortingChange: OnChangeFn = (updater) => {\n setSorting(updater);\n if (table.getRowModel().rows.length) {\n rowVirtualizer.scrollToIndex?.(0);\n }\n };\n\n // Since this table option is derived from table row model state, we use the table.setOptions utility\n table.setOptions((prev) => ({\n ...prev,\n onSortingChange: (updater) => {\n if (isRefetching) return;\n handleSortingChange(updater);\n },\n }));\n\n const { rows } = table.getRowModel();\n\n // Virtualizer for the table rows to improve performance\n const rowVirtualizer = useVirtualizer({\n count: rows.length,\n estimateSize: () => 48,\n getScrollElement: () => tableContainerRef.current,\n overscan: 5, // number of rows to render above and below the visible area\n });\n\n return (\n
\n {(title || hasToolbar) && (\n
\n \n {hasToolbar && (\n <ToolBar>\n <SearchField\n placeholder={searchPlaceholder}\n setPaginationUrl={setPaginationUrl}\n />\n {filters.length !== 0 && (\n <FilterMenu\n filters={createColumnFilter(filters)}\n setPaginationUrl={setPaginationUrl}\n />\n )}\n </ToolBar>\n )}\n </div>\n )}\n <div className=\"flex-grow overflow-hidden bg-white w-full rounded-lg\">\n <TableStyle>\n <THead table={table} scrollbarWidth={scrollbarWidth} />\n <TBody\n rowVirtualizer={rowVirtualizer}\n rows={rows}\n tableContainerRef={tableContainerRef}\n onSelectRow={onSelectRow}\n isRefetching={isRefetching}\n />\n {isFetchingNextPage && showLoadingToast && <LoadingToaster />}\n </TableStyle>\n </div>\n </div>\n );\n};\n","export enum InstallerStatus {\n Pending = \"Pending\",\n Activated = \"Activated\",\n}\n\nexport enum InstallerCanInviteFilterStatus {\n Yes = \"Yes\",\n No = \"No\",\n}\n","import { Dispatch, FC, SetStateAction, useMemo } from \"react\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { Table } from \"../tableBeta/Table\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n InfiniteQueryResult,\n} from \"../../api/pagination/pagination.type\";\nimport { InstallerItemDTO } from \"../../api/installer/installer.dto\";\nimport { Badge } from \"../tags/Badge\";\nimport {\n InstallerCanInviteFilterStatus,\n InstallerStatus,\n} from \"../../enums/installerStatus.enum\";\n\ninterface Props {\n paginationQuery: InfiniteQueryResult<InstallerItemDTO>;\n setPaginationUrl: Dispatch<SetStateAction<string>>;\n onInstallerClick: (installerId: number, distributorId: number) => void;\n createColumnFilter: (filter: FilterDTO[]) => FilterWithLabelDTO[];\n}\n\nexport const InstallerTable: FC<Props> = ({\n paginationQuery,\n setPaginationUrl,\n onInstallerClick,\n createColumnFilter,\n}) => {\n const { t } = useTranslation();\n\n const handleRowClick = (row: InstallerItemDTO) => {\n if (row) onInstallerClick(row.id, row.distributorId);\n };\n\n // Table columns definition\n const columns: ColumnDef<InstallerItemDTO>[] = useMemo(\n () => [\n {\n accessorKey: \"name\",\n header: t(`installerList.Company`),\n accessorFn: (row: InstallerItemDTO) => (row.name ? `${row.name}` : \"\"),\n },\n {\n accessorKey: \"organizationNumber\",\n header: t(`installerList.Organization number`),\n accessorFn: (row: InstallerItemDTO) =>\n row.organizationNumber ? `${row.organizationNumber}` : \"\",\n },\n {\n accessorKey: \"city\",\n header: t(`installerList.City`),\n accessorFn: (row: InstallerItemDTO) => (row.city ? `${row.city}` : \"\"),\n },\n {\n accessorKey: \"status\",\n header: t(`installerList.Status`),\n cell: (row) => (\n <Badge\n text={row.getValue() as string}\n color={\n row.getValue() === InstallerStatus.Pending ? \"blue\" : \"green\"\n }\n />\n ),\n enableSorting: false,\n },\n {\n accessorKey: \"canInviteAssetOwners\",\n header: t(`installerList.Can invite asset owners`),\n accessorFn: (row: InstallerItemDTO) =>\n row?.canInviteAssetOwners\n ? InstallerCanInviteFilterStatus.Yes\n : InstallerCanInviteFilterStatus.No,\n cell: (row) => (\n <Badge\n text={row.getValue() as string}\n color={\n row.getValue() === InstallerCanInviteFilterStatus.Yes\n ? \"green\"\n : \"red\"\n }\n />\n ),\n enableSorting: false,\n },\n ],\n [],\n );\n\n return (\n <Table\n columns={columns}\n paginationQuery={paginationQuery}\n onSelectRow={handleRowClick}\n setPaginationUrl={setPaginationUrl}\n title={`${t(\"installerList.Installers\")}`}\n searchPlaceholder={`${t(\"installerList.SearchForInstallers\")}`}\n createColumnFilter={createColumnFilter}\n />\n );\n};\n","import React, { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n}\n\nexport const ListStyle: FC<Props> = ({ children }) => (\n <div className=\"relative h-full rounded-lg flex flex-col\">{children}</div>\n);\n","import React from \"react\";\n\ninterface Props {\n title: string;\n}\n\nexport const Title = ({ title }: Props) => (\n <div className=\"px-2 justify-start items-start gap-2.5 flex\">\n <div className=\"text-black text-normal font-medium leading-normal\">\n {title}\n </div>\n </div>\n);\n","import { ReactNode } from \"react\";\nimport { Virtualizer } from \"@tanstack/react-virtual\";\n\ninterface Props {\n rowVirtualizer: Virtualizer<HTMLDivElement, Element>;\n children: ReactNode;\n}\n\nexport const UL = ({ rowVirtualizer, children }: Props) => {\n return (\n <ul\n className=\"flex flex-col relative rounded-lg\"\n style={{\n height: `${rowVirtualizer.getTotalSize()}px`,\n }}\n >\n {children}\n </ul>\n );\n};\n","import { classNames } from \"../../helpers/classNames\";\nimport React from \"react\";\nimport { VirtualItem, Virtualizer } from \"@tanstack/react-virtual\";\n\nexport type ElementDef<T> = (row: T) => {\n left: {\n key: string;\n cell: () => React.ReactElement | undefined;\n }[];\n right: {\n key: string;\n cell: () => React.ReactElement | undefined;\n }[];\n};\n\nexport interface Identifiable {\n id: string | number;\n}\n\ninterface Props<T> {\n virtualRow: VirtualItem;\n rowVirtualizer: Virtualizer<HTMLDivElement, Element>;\n row: T & Identifiable;\n elements: ElementDef<T>;\n onSelectRow?: (data: T) => void;\n}\n\nexport const LI = <T,>({\n virtualRow,\n row,\n elements,\n onSelectRow,\n rowVirtualizer,\n}: Props<T>) => {\n return (\n <li\n className=\"absolute top-0 left-0 w-full\"\n key={virtualRow.index}\n style={{\n height: `${virtualRow.size}px`,\n transform: `translateY(${virtualRow.start}px)`,\n }}\n data-index={virtualRow.index} //needed for dynamic row height measurement\n ref={(node) => rowVirtualizer.measureElement(node)} //measure dynamic row height\n >\n <div\n key={row.id}\n className={classNames(\n `list-none flex h-full w-full absolute py-4 px-3 text-black text-sm font-normal leading-relaxed justify-between items-center ${virtualRow.index % 2 === 0 ? \"bg-[#f3f3f2]\" : \"bg-white\"}`,\n onSelectRow ? \"cursor-pointer hover:opacity-75\" : \"\",\n )}\n onClick={() => onSelectRow && onSelectRow(row)}\n >\n <div className=\"flex flex-col items-start justify-center truncate gap-3\">\n {elements(row).left.map((elem) => {\n return elem.cell() ? (\n <div className=\"w-full truncate\" key={elem.key}>\n {elem.cell()}\n </div>\n ) : null;\n })}\n </div>\n <div className=\"flex flex-col items-end justify-center gap-3\">\n {elements(row).right.map((elem) => {\n return elem.cell() ? (\n <div className=\"w-full truncate\" key={elem.key}>\n {elem.cell()}\n </div>\n ) : null;\n })}\n </div>\n </div>\n </li>\n );\n};\n","import React, {\n Dispatch,\n ReactElement,\n SetStateAction,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n InfiniteQueryResult,\n} from \"../../api/pagination/pagination.type\";\nimport { ListStyle } from \"./ListStyle\";\nimport { Title } from \"./Title\";\nimport { ToolBar } from \"../tableBeta/Toolbar\";\nimport { SearchField } from \"../tableBeta/SearchField\";\nimport { FilterMenu } from \"../tableBeta/FilterMenu\";\nimport { UL } from \"./UL\";\nimport { ElementDef, Identifiable, LI } from \"./LI\";\nimport { classNames } from \"../../helpers/classNames\";\nimport { LoadingToaster } from \"../tableBeta/LoadingToaster\";\nimport { useFetchMoreOnBottomReached } from \"../../hooks/useFetchMoreOnBottomReached\";\n\ninterface Props<T> {\n elements: ElementDef<T>;\n paginationQuery: InfiniteQueryResult<T>;\n onSelectRow?: (data: T) => void;\n setPaginationUrl: Dispatch<SetStateAction<string>>;\n title?: string;\n searchPlaceholder?: string;\n hasToolbar?: boolean;\n offSetToTriggerPagination?: number;\n createColumnFilter: (filter: FilterDTO[]) => FilterWithLabelDTO[];\n}\n\nexport const List = <T,>({\n elements,\n paginationQuery,\n onSelectRow,\n setPaginationUrl,\n title = \"\",\n searchPlaceholder = \"\",\n hasToolbar = true,\n offSetToTriggerPagination = 300,\n createColumnFilter,\n}: Props<T>): ReactElement => {\n // State used to store the visibility of the loading toast when fetching more data\n const [showLoadingToast, setShowLoadingToast] = useState<boolean>(false);\n\n // Reference to the parent div of the list\n const listContainerElement = useRef<HTMLDivElement>(null);\n\n // Destructure the data from the paginationQuery\n const { data, isFetchingNextPage, isRefetching } = paginationQuery;\n\n // Flatten the array of arrays from the useInfiniteQuery hook\n const flatData = useMemo(\n () => data?.pages?.flatMap((page) => page?.items) ?? [],\n [data],\n );\n\n // Getting updated filters, if any, from the server. Checked only first page, because filters are static (same for each page)\n const filters = useMemo(() => data?.pages?.[0]?.filters ?? [], [data]);\n\n // Called on scroll to fetch more pages as the user scrolls and reaches bottom of the table body\n useFetchMoreOnBottomReached(\n paginationQuery,\n offSetToTriggerPagination,\n setShowLoadingToast,\n listContainerElement,\n );\n\n // Virtualizer for the list rows to improve performance\n const rowVirtualizer = useVirtualizer({\n count: flatData.length,\n getScrollElement: () => listContainerElement.current,\n estimateSize: () => 110,\n overscan: 4, // number of rows to render above and below the visible area\n });\n\n return (\n <div className=\"w-full p-4 rounded-2xl flex flex-col bg-white h-max-full min-h-12 shadow\">\n {(title || hasToolbar) && (\n <div className=\"flex-shrink-0 h-8 justify-between items-center flex mb-4\">\n <Title title={title} />\n {hasToolbar && (\n <ToolBar size={\"small\"}>\n <SearchField\n placeholder={searchPlaceholder}\n setPaginationUrl={setPaginationUrl}\n />\n {filters.length !== 0 && (\n <FilterMenu\n filters={createColumnFilter(filters)}\n setPaginationUrl={setPaginationUrl}\n />\n )}\n </ToolBar>\n )}\n </div>\n )}\n <div className=\"flex-grow overflow-hidden bg-white w-full rounded-lg\">\n <ListStyle>\n <div\n ref={listContainerElement}\n className={classNames(\n \"relative overflow-auto rounded-bl-lg rounded-br-lg h-full\",\n isRefetching ? \"opacity-50\" : \"\",\n )}\n >\n <UL rowVirtualizer={rowVirtualizer}>\n {rowVirtualizer.getVirtualItems().map((virtualRow) => {\n const row = flatData[virtualRow.index] as T & Identifiable; // Every row must have an id\n return (\n <LI\n key={virtualRow.index}\n virtualRow={virtualRow}\n row={row}\n elements={elements}\n onSelectRow={isRefetching ? undefined : onSelectRow}\n rowVirtualizer={rowVirtualizer}\n />\n );\n })}\n </UL>\n {rowVirtualizer.getVirtualItems().length === 0 && (\n <div className=\"flex justify-center items-center h-36\">\n <span className=\"text-gray-400\">No data available.</span>\n </div>\n )}\n </div>\n {isFetchingNextPage && showLoadingToast && <LoadingToaster />}\n </ListStyle>\n </div>\n </div>\n );\n};\n","import React, { Dispatch, FC, SetStateAction } from \"react\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n InfiniteQueryResult,\n} from \"../../api/pagination/pagination.type\";\nimport { List } from \"../listBeta/List\";\nimport { useTranslation } from \"react-i18next\";\nimport { MapPinIcon, TruckIcon } from \"@heroicons/react/24/outline\";\nimport { ElementDef } from \"../listBeta/LI\";\nimport { InstallerItemDTO } from \"../../api/installer/installer.dto\";\nimport { InstallerStatus } from \"../../enums/installerStatus.enum\";\nimport { Badge } from \"../tags/Badge\";\n\ninterface Props {\n paginationQuery: InfiniteQueryResult<InstallerItemDTO>;\n setPaginationUrl: Dispatch<SetStateAction<string>>;\n onInstallerClick: (installerId: number, distributorId: number) => void;\n createColumnFilter: (filter: FilterDTO[]) => FilterWithLabelDTO[];\n}\n\nexport const InstallerList: FC<Props> = ({\n paginationQuery,\n setPaginationUrl,\n onInstallerClick,\n createColumnFilter,\n}) => {\n const { t } = useTranslation();\n\n const handleRowClick = (row: InstallerItemDTO) => {\n if (row) onInstallerClick(row.id, row.distributorId);\n };\n\n // As Table component has columns, elements should contain left and right elements that will be displayed in the list\n // I defined this function to make the List component more generic\n const elements: ElementDef<InstallerItemDTO> = (\n element: InstallerItemDTO,\n ) => {\n return {\n left: [\n {\n key: \"name\",\n cell: () => (\n <div className=\"flex items-center text-sm font-medium truncate text-gray-500\">\n <TruckIcon\n className=\"h-5 w-5 mr-2 flex-shrink-0\"\n aria-hidden=\"true\"\n />\n <div className=\"flex flex-col items-start w-full truncate text-sm\">\n <span className=\"w-full truncate\">{element.name}</span>\n <span className=\"w-full truncate text-gray-300\">\n {element.organizationNumber}\n </span>\n </div>\n </div>\n ),\n },\n {\n key: \"city\",\n cell: () =>\n element.city ? (\n <div className=\"flex items-center text-sm font-medium truncate text-gray-500\">\n <MapPinIcon\n className=\"h-5 w-5 mr-2 flex-shrink-0\"\n aria-hidden=\"true\"\n />\n <span className=\"w-full truncate\">{element.city}</span>\n </div>\n ) : undefined,\n },\n ],\n right: [\n {\n key: \"flowerHubStatus\",\n cell: () => (\n <Badge\n text={element.status}\n color={\n element.status === InstallerStatus.Pending ? \"blue\" : \"green\"\n }\n />\n ),\n },\n ],\n };\n };\n\n return (\n <List\n elements={elements}\n paginationQuery={paginationQuery}\n onSelectRow={handleRowClick}\n setPaginationUrl={setPaginationUrl}\n title={`${t(\"installerList.Installers\")}`}\n searchPlaceholder={`${t(\"installerList.Search\")}`}\n createColumnFilter={createColumnFilter}\n />\n );\n};\n","import { isEmptyArray } from \"helpers/array\";\nimport React, { FC, useState } from \"react\";\n\nimport { useInstallersPagination } from \"api/installer/installer.endpoints\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { Role } from \"enums/role.enum\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNavigate } from \"react-router-dom\";\nimport { AddInstaller } from \"./AddInstaller\";\nimport { getInstallerPageRoute } from \"helpers/installer\";\nimport { GetAllInstallerResponseDTO } from \"../../api/installer/installer.dto\";\nimport { isDistributor } from \"../../helpers/role\";\nimport { InfiniteData, UseInfiniteQueryResult } from \"@tanstack/react-query\";\nimport { isMobile } from \"react-device-detect\";\nimport { InstallerTable } from \"./InstallerTable\";\nimport { InstallerCanInviteFilterStatus } from \"../../enums/installerStatus.enum\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n} from \"../../api/pagination/pagination.type\";\nimport { InstallerList } from \"./InstallerList\";\n\ninterface Props {\n userRole: Role;\n distributorId?: number;\n}\n\nexport const Installers: FC<Props> = ({ userRole, distributorId }) => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n\n // Pagination query string state is defined to store the query string in the parent component\n const [queryString, setQueryString] = useState<string>(\"\");\n\n // Infinite query to get installers with pagination\n const paginationQuery: UseInfiniteQueryResult<\n InfiniteData<GetAllInstallerResponseDTO>\n > = useInstallersPagination(queryString, {\n distributorId,\n });\n\n // Extract relevant information for this component from the pagination query\n const { data: installers, isLoading, isError, isSuccess } = paginationQuery;\n\n const flatInstallers = installers?.pages.flatMap((page) => page.items);\n\n const onInstallerClick = (installerId: number, distributorId: number) =>\n navigate(getInstallerPageRoute(userRole, installerId, distributorId));\n\n // Convert the filter options to the enum values for the installer can invite filter\n const createColumnFilter = (filters: FilterDTO[]): FilterWithLabelDTO[] =>\n filters.map((filter) => {\n if (filter.id === \"canInviteAssetOwners\") {\n return {\n id: filter.id,\n options: filter.options.map((option) => {\n return {\n label: option\n ? InstallerCanInviteFilterStatus.Yes\n : InstallerCanInviteFilterStatus.No,\n value: option,\n };\n }),\n };\n }\n return {\n id: filter.id,\n options: filter.options.map((option) => {\n return {\n label: option,\n value: option,\n };\n }),\n };\n });\n\n if (isLoading || isError) {\n return (\n <div className=\"flex h-full items-center lg:items-start lg:pt-8\">\n <CustomPlaceholder\n isEmpty={false}\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`installerList.Error`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n if (isSuccess && isEmptyArray(flatInstallers) && queryString === \"\") {\n return (\n <div className=\"flex flex-col h-full items-center justify-center lg:justify-start lg:pt-8\">\n <CustomPlaceholder\n isEmpty={true}\n emptyDataMessage={t(`installerList.Empty`)}\n isLoading={false}\n isError={false}\n icon={<UserIcon />}\n />\n\n {isDistributor(userRole) && distributorId && (\n <AddInstaller distributorId={distributorId} isCentered />\n )}\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col h-full\">\n {isDistributor(userRole) && distributorId && (\n <AddInstaller distributorId={distributorId} />\n )}\n {isMobile ? (\n <InstallerList\n paginationQuery={paginationQuery}\n setPaginationUrl={setQueryString}\n onInstallerClick={onInstallerClick}\n createColumnFilter={createColumnFilter}\n />\n ) : (\n <InstallerTable\n paginationQuery={paginationQuery}\n setPaginationUrl={setQueryString}\n onInstallerClick={onInstallerClick}\n createColumnFilter={createColumnFilter}\n />\n )}\n </div>\n );\n};\n","/* cspell:disable-next-line */\nimport { useEffect } from \"react\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport userStore, { getDistributorId, getUserRole } from \"store/user.store\";\nimport { Installers } from \"../../../components/installer/Installers\";\nimport { SmoothUp } from \"../../../components/animations/SnapUp\";\n\nexport const InstallerListPage = () => {\n const userRole = userStore(getUserRole);\n const distributorId = userStore(getDistributorId);\n\n // breadcrumbs\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs([getInstallerListBreadcrumb()]);\n }, []);\n\n return (\n <SmoothUp>\n <Installers userRole={userRole} distributorId={distributorId} />\n </SmoothUp>\n );\n};\n\nexport const getInstallerListBreadcrumb = (): BreadCrumb => ({\n label: RouteLabel.Installers,\n to: `${RouteUrl.App}/${RouteUrl.Installers}`,\n});\n","import { Role } from \"enums/role.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb } from \"store/menu.store\";\nimport { getDistributorListBreadcrumb } from \"../pages/app/distributorList/DistributorListPage\";\nimport { getDistributorBreadcrumb } from \"../pages/app/distributor/DistributorPage\";\nimport { getInstallerListBreadcrumb } from \"../pages/app/installerList/InstallerListPage\";\nimport { GetInstallerResponseDTO } from \"../api/installer/installer.dto\";\n\nexport const getBreadCrumbs = (\n userRole: Role,\n installer: GetInstallerResponseDTO,\n) => {\n switch (userRole) {\n case Role.Flower:\n return [\n getDistributorListBreadcrumb(),\n getDistributorBreadcrumb({\n id: installer.distributor.id,\n name: installer.distributor.name ?? \"\",\n }),\n getInstallerBreadcrumb(\n installer.name,\n installer.id,\n installer.distributor.id,\n Role.Flower,\n ),\n ];\n case Role.DistributorAdmin:\n case Role.DistributorUser:\n return [\n getInstallerListBreadcrumb(),\n getInstallerBreadcrumb(\n installer.name,\n installer.id,\n installer.distributor.id,\n userRole,\n ),\n ];\n default:\n throw new Error(\n `InstallerPage.getBreadCrumbs is missing implementation for role ${userRole}`,\n );\n }\n};\n\nexport const getInstallerPageRoute = (\n userRole: Role,\n installerId: number,\n distributorId?: number,\n) => {\n switch (userRole) {\n case Role.Flower:\n return `${RouteUrl.App}/${RouteUrl.Distributors}/${distributorId}/${installerId}`;\n case Role.DistributorAdmin:\n case Role.DistributorUser:\n return `${RouteUrl.App}/${RouteUrl.Installers}/${installerId}`;\n default:\n throw Error(`Role ${userRole} should not access getInstallerPageRoute`);\n }\n};\n\nexport const getInstallerBreadcrumb = (\n installerName: string,\n installerId: number,\n distributorId: number,\n userRole: Role,\n): BreadCrumb => {\n return {\n label: installerName,\n to: getInstallerPageRoute(userRole, installerId, distributorId),\n iconType: \"installer\",\n };\n};\n\nexport const formatVatNumber = (organizationNumber?: string) => {\n if (!organizationNumber) {\n return undefined;\n }\n\n // Remove any non-digit characters\n const cleanOrgNumber = organizationNumber.replace(/\\D/g, \"\");\n\n // Check if we have a valid 10-digit organization number\n if (cleanOrgNumber.length !== 10) {\n return undefined;\n }\n\n return `SE${cleanOrgNumber}01`;\n};\n\nexport const formatOrganizationNumber = (organizationNumber?: string) => {\n if (!organizationNumber) {\n return undefined;\n }\n\n // Remove any non-digit characters\n const cleanOrgNumber = organizationNumber.replace(/\\D/g, \"\");\n\n // Check if we have a valid 10-digit organization number\n if (cleanOrgNumber.length !== 10) {\n return undefined;\n }\n\n return `${cleanOrgNumber.slice(0, 6)}-${cleanOrgNumber.slice(6)}`;\n};\n\nexport const formatGiroNumber = (giroNumber?: string) => {\n if (!giroNumber) {\n return undefined;\n }\n\n // Remove any non-digit characters\n const cleanGiroNumber = giroNumber.replace(/\\D/g, \"\");\n\n // Check if we have a valid 7 or 8 digit giro number\n if (cleanGiroNumber.length !== 7 && cleanGiroNumber.length !== 8) {\n return undefined;\n }\n\n return `${cleanGiroNumber.slice(0, 3)}-${cleanGiroNumber.slice(3)}`;\n};\n","import { FC } from \"react\";\nimport { Panel } from \"components/Panel\";\nimport { useTranslation } from \"react-i18next\";\nimport { useGetLatestInstallers } from \"api/distributor/distributor.endpoints\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport { Link } from \"react-router-dom\";\nimport { ChevronRightIcon } from \"@heroicons/react/24/outline\";\nimport { formatDate } from \"helpers/date\";\nimport { getInstallerPageRoute } from \"helpers/installer\";\nimport { getRoleName } from \"../../helpers/role\";\n\ninterface Props {\n distributorId?: number;\n}\nexport const LatestInstallerList: FC<Props> = ({ distributorId }) => {\n const { t } = useTranslation();\n const userRole = userStore(getUserRole);\n\n const {\n data: installers,\n isLoading,\n isError,\n } = useGetLatestInstallers(distributorId);\n\n if (isLoading || isError || !installers || installers.length === 0)\n return null; // Mitigate placeholder views in dashboard\n\n return (\n <Panel header={t(\"installerList.Recent installer users\")}>\n <ul role=\"list\" className=\"divide-y divide-gray-100\">\n {installers.map((installer) => (\n <Link\n key={installer.installerId}\n className=\"block hover:bg-gray-50\"\n to={getInstallerPageRoute(\n userRole,\n installer.installerId,\n distributorId,\n )}\n >\n <div className=\"flex items-center py-4\">\n <div className=\"flex min-w-0 flex-1 items-center\">\n <div className=\"min-w-0 flex-1 px-4 md:grid md:grid-cols-5 md:gap-4\">\n <div className=\"col-span-3\">\n <p className=\"truncate text-sm font-medium text-flowerSky-500\">\n {installer.name}\n </p>\n <p className=\"mt-2 flex items-center text-sm text-gray-900\">\n <span className=\"truncate\">{installer.organization}</span>\n </p>\n </div>\n <div className=\"hidden md:block col-span-2\">\n <div>\n <p className=\"flex items-center text-sm text-gray-900\">\n {getRoleName(installer.role)}\n </p>\n <p className=\"mt-2 text-sm text-gray-500\">\n {formatDate(new Date(installer.createdAt))}\n </p>\n </div>\n </div>\n </div>\n </div>\n <div>\n <ChevronRightIcon\n className=\"h-5 w-5 text-gray-400\"\n aria-hidden=\"true\"\n />\n </div>\n </div>\n </Link>\n ))}\n </ul>\n </Panel>\n );\n};\n","import { ExclamationCircleIcon } from \"@heroicons/react/20/solid\";\nimport { classNames } from \"helpers/classNames\";\nimport { FC } from \"react\";\nimport { UseFormRegister } from \"react-hook-form\";\n\ninterface Item {\n value: string | number;\n label: string;\n}\ninterface Props {\n items: Item[];\n name: string;\n label: string;\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: UseFormRegister<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n validation?: any;\n errorMessage?: string;\n isDisabled?: boolean;\n}\n\nconst Dropdown: FC<Props> = ({\n items,\n name,\n label,\n register,\n validation,\n errorMessage,\n isDisabled,\n}) => {\n return (\n <div>\n <label htmlFor={name} className=\"block text-sm font-medium text-gray-700\">\n {label}\n </label>\n <select\n disabled={isDisabled}\n id=\"location\"\n className={classNames(\n \"mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-flowerSky-600 focus:border-flowerSky-600 sm:text-sm rounded-md\",\n isDisabled ? \"bg-gray-60 text-gray-400\" : \"bg-white\",\n )}\n {...register(name, validation && validation)}\n >\n {items.map((item) => (\n <option key={item.value} value={item.value}>\n {item.label}\n </option>\n ))}\n </select>\n {!!errorMessage && (\n <div className=\"flex flex-row items-center mt-2\">\n <ExclamationCircleIcon\n className=\"h-5 w-5 text-red-500\"\n aria-hidden=\"true\"\n />\n <p className=\"ml-1 text-sm text-red-600\">{errorMessage}</p>\n </div>\n )}\n </div>\n );\n};\n\nexport default Dropdown;\n","import Dropdown from \"components/input/Dropdown\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { Role } from \"enums/role.enum\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { useTranslation } from \"react-i18next\";\nimport { CreateDistributorInvitationRequestDTO } from \"api/distributorInvitation/distributorInvitation.dto\";\n\ninterface Props {\n register: UseFormRegister<CreateDistributorInvitationRequestDTO>;\n errors: Partial<FieldErrorsImpl<CreateDistributorInvitationRequestDTO>>;\n}\nexport const AddDistributorUserForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`distributor.Name`)}\n name=\"name\"\n register={register}\n errorMessage={errors?.name?.message}\n registerOptions={noEmptyStringValidator()}\n />\n <TextInput\n label={t(`distributor.Email`)}\n name=\"email\"\n type=\"email\"\n register={register}\n registerOptions={emailValidator}\n errorMessage={errors?.email?.message}\n />\n <Dropdown\n items={[\n {\n label: t(`distributor.User`),\n value: Role.DistributorUser.toString(),\n },\n {\n label: t(`distributor.Admin`),\n value: Role.DistributorAdmin.toString(),\n },\n ]}\n name=\"role\"\n label={t(`distributor.Account type`)}\n register={register}\n />\n </ModalContentWrapper>\n );\n};\n","import { useNotification } from \"hooks/useNotification\";\nimport api from \"../axiosInstance\";\nimport {\n CreateDistributorInvitationRequestDTO,\n CreateDistributorInvitationResponseDTO,\n} from \"./distributorInvitation.dto\";\nimport { DistributorQueryKeys } from \"api/distributor/distributor.endpoints\";\nimport { SignupByCodeRequestDTO } from \"../shared/signUpByCode.dto\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\n\nconst ENDPOINT = \"/distributor-invitation\";\n\nexport const useDistributorSignUp = () => {\n return useMutation({\n mutationFn: async (payload: SignupByCodeRequestDTO) =>\n (await api.post(`${ENDPOINT}/sign-up-by-code`, payload)).data,\n });\n};\n\nexport const useInviteDistributorUser = (settings = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreateDistributorInvitationRequestDTO,\n ): Promise<CreateDistributorInvitationResponseDTO> =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: (result: CreateDistributorInvitationResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [DistributorQueryKeys.GetOne, result.distributorId],\n });\n queryClient.invalidateQueries({\n queryKey: [DistributorQueryKeys.GetUsers, result.distributorId],\n });\n notification.info(`${result.name} invited`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n ...settings,\n });\n};\n\nexport const useDeleteDistributorInvitation = (settings = {}) => {\n const queryClient = useQueryClient();\n const notification = useNotification();\n\n return useMutation({\n mutationFn: async (id: number) => await api.delete(`${ENDPOINT}/${id}`),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [DistributorQueryKeys.GetOne],\n });\n notification.info(\"Invitation deleted\");\n },\n onError: () => {\n notification.error();\n },\n ...settings,\n });\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm, UseFormRegister } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { UserPlusIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"../buttons/SecondaryButton\";\nimport { useTranslation } from \"react-i18next\";\nimport { AddDistributorUserForm } from \"./AddDistributorUserForm\";\nimport { useInviteDistributorUser } from \"api/distributorInvitation/distributorInvitation.endpoints\";\nimport { CreateDistributorInvitationRequestDTO } from \"api/distributorInvitation/distributorInvitation.dto\";\n\ninterface Props {\n distributorId: number;\n}\n\nexport const AddDistributorUser: FC<Props> = ({ distributorId }) => {\n const { t } = useTranslation();\n\n // state\n const [isInviteUserModalOpen, setIsInviteUserModalOpen] = useState(false);\n\n // api\n const {\n mutate: inviteUser,\n isPending: isInvitingUser,\n isSuccess: isInviteUserSuccess,\n } = useInviteDistributorUser();\n\n // form\n const {\n register: registerInvitation,\n handleSubmit: handleInvitationSubmit,\n reset: resetInvitation,\n formState: { errors: invitationErrors },\n setValue,\n } = useForm<CreateDistributorInvitationRequestDTO>({\n defaultValues: { distributorId },\n });\n\n useEffect(() => {\n setValue(\"distributorId\", distributorId);\n }, [distributorId]);\n\n // submit\n const onInvitationSubmit = handleInvitationSubmit(\n (data: CreateDistributorInvitationRequestDTO) =>\n inviteUser({ ...data, role: Number(data.role) }),\n );\n\n // modal close\n const onInvitationModalClose = () => {\n setIsInviteUserModalOpen(false);\n setTimeout(() => resetInvitation(), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isInviteUserSuccess) {\n onInvitationModalClose();\n }\n }, [isInviteUserSuccess]);\n\n const renderAddDistributorButton = () => {\n return (\n <div className={`pb-2 flex justify-end`}>\n <SecondaryButton onClick={() => setIsInviteUserModalOpen(true)}>\n <UserPlusIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(`distributor.Add distributor`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderAddDistributorButton()}\n\n <Modal\n isOpen={isInviteUserModalOpen}\n onClose={onInvitationModalClose}\n title={t(`distributor.Add distributor`)}\n rightButtonText={t(`distributor.Send invitation`)}\n rightButtonActionHandler={onInvitationSubmit}\n isLoading={isInvitingUser}\n loadingText={t(`distributor.Sending invitation...`)}\n leftButtonAction={onInvitationModalClose}\n leftButtonText={t(`Close`)}\n >\n <AddDistributorUserForm\n register={\n registerInvitation as UseFormRegister<CreateDistributorInvitationRequestDTO>\n }\n errors={invitationErrors}\n />\n </Modal>\n </>\n );\n};\n","import { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DeleteDistributorConfirmation = () => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n {t(\n `distributor.Are you sure that you want to delete this distributor?`,\n )}\n </p>\n </div>\n </ModalContentWrapper>\n );\n};\n","import React, { FC } from \"react\";\nimport { classNames } from \"helpers/classNames\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n children: React.ReactNode;\n size?: \"small\" | \"medium\" | \"large\";\n fullWidth?: boolean;\n isLoading?: boolean;\n loadingText?: string;\n className?: string;\n}\n\nconst DangerButton: FC<\n Props &\n React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >\n> = ({\n children,\n size = \"medium\",\n fullWidth = false,\n isLoading = false,\n className,\n loadingText = \"Loading\",\n ...rest\n}) => {\n const { t } = useTranslation();\n\n const getClassForSize = (size: \"small\" | \"medium\" | \"large\") => {\n const styling =\n \"inline-flex items-center border font-medium border-flowerRed-500 rounded-md shadow-sm text-flowerRed-500 hover:text-white bg-flowerRed-300 hover:bg-flowerRed-500\";\n switch (size) {\n case \"small\":\n return classNames(\n \"px-2.5 py-1.5 text-xs\",\n styling,\n fullWidth && \"w-full\",\n );\n case \"large\":\n return classNames(\n \"items-center px-4 py-2 text-sm\",\n styling,\n fullWidth && \"w-full\",\n );\n case \"medium\":\n default:\n return classNames(\n \"px-4 py-2 text-sm leading-4\",\n styling,\n fullWidth && \"w-full\",\n );\n }\n };\n\n return (\n <button\n type=\"button\"\n className={classNames(getClassForSize(size), className ?? false)}\n {...rest}\n >\n {isLoading && (\n <svg\n className=\"w-5 h-5 mr-3 -ml-1 text-white animate-spin\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n )}\n {isLoading ? t(loadingText) : <>{children}</>}\n </button>\n );\n};\n\nexport default DangerButton;\n","import { useNotification } from \"hooks/useNotification\";\nimport api from \"../axiosInstance\";\nimport {\n ForgotPasswordRequestDTO,\n GetFlowerUsersResponseDTO,\n ResetPasswordRequestDTO,\n UpdateInstallerUserRequestDTO,\n UpdateInstallerUserResponseDTO,\n} from \"./user.dto\";\nimport { InstallerQueryKeys } from \"api/installer/installer.endpoints\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\n\nconst ENDPOINT = \"user\";\n\nexport enum UserQueryKeys {\n GetUsers = \"user-get-users\",\n GetFlowerUsers = \"user-get-flower-users\",\n}\n\nexport const useFlowerUsers = () =>\n useQuery({\n queryKey: [UserQueryKeys.GetFlowerUsers],\n queryFn: async (): Promise<GetFlowerUsersResponseDTO> =>\n (await api.get(`${ENDPOINT}/flower`)).data,\n initialData: { users: [], invitations: [] },\n });\n\nexport const useForgotPassword = () => {\n return useMutation({\n mutationFn: async (payload: ForgotPasswordRequestDTO): Promise<void> =>\n await api.post(`${ENDPOINT}/forgot-password`, payload),\n });\n};\n\nexport const useResetPassword = () => {\n const notification = useNotification();\n return useMutation({\n mutationFn: async (payload: ResetPasswordRequestDTO): Promise<void> =>\n await api.put(`${ENDPOINT}/reset-password`, payload),\n onError: () => {\n notification.error();\n },\n });\n};\n\nexport const useUpdateInstallerUser = (installerUserId: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: UpdateInstallerUserRequestDTO,\n ): Promise<UpdateInstallerUserResponseDTO> =>\n (await api.put(`${ENDPOINT}/${installerUserId}`, payload)).data,\n onSuccess: (data) => {\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetUsers, data.installerId],\n });\n notification.info(`${data.name} updated`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useDeactivateUser = (settings = {}) => {\n const notification = useNotification();\n return useMutation({\n mutationFn: async (id: number): Promise<void> =>\n await api.delete(`${ENDPOINT}/${id}`),\n onError: () => {\n notification.error();\n },\n ...settings,\n });\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"components/Modal\";\nimport { DeleteDistributorConfirmation } from \"./DeleteDistributorConfirmation\";\nimport DangerButton from \"components/buttons/DangerButton\";\nimport { useDeactivateUser } from \"api/user/user.endpoints\";\nimport { DistributorQueryKeys } from \"api/distributor/distributor.endpoints\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\ninterface Props {\n distributorId: number;\n userId: number;\n}\n\nexport const DeleteDistributorUser: FC<Props> = ({ distributorId, userId }) => {\n const { t } = useTranslation();\n const queryClient = useQueryClient();\n\n const [isDeleteDistributorModalOpen, setIsDistributorModalOpen] =\n useState(false);\n\n // api\n const { mutate: deactivateUser, isSuccess } = useDeactivateUser({\n onSuccess: () =>\n queryClient.invalidateQueries({\n queryKey: [DistributorQueryKeys.GetUsers, distributorId],\n }),\n });\n\n // submit\n const onDeactivateUser = () => deactivateUser(userId);\n\n // modal close\n const onDeleteDistributorModalClose = () => {\n setIsDistributorModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onDeleteDistributorModalClose();\n }\n }, [isSuccess]);\n return (\n <>\n <DangerButton\n size=\"small\"\n onClick={() => setIsDistributorModalOpen(true)}\n >\n {t(`distributor.Deactivate user`)}\n </DangerButton>\n\n <Modal\n title={t(`distributor.Delete distributor`)}\n leftButtonAction={onDeleteDistributorModalClose}\n leftButtonText={t(`Close`)}\n rightButtonActionHandler={() => onDeactivateUser()}\n isOpen={isDeleteDistributorModalOpen}\n onClose={onDeleteDistributorModalClose}\n loadingText={t(`distributor.Deleting distributor`)}\n >\n <DeleteDistributorConfirmation />\n </Modal>\n </>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"components/Modal\";\nimport { DeleteDistributorConfirmation } from \"./DeleteDistributorConfirmation\";\nimport { useDeleteDistributorInvitation } from \"api/distributorInvitation/distributorInvitation.endpoints\";\nimport { useNotification } from \"hooks/useNotification\";\nimport { DistributorQueryKeys } from \"api/distributor/distributor.endpoints\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { TrashIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n distributorId: number;\n invitationId: number;\n}\n\nexport const DeleteDistributorInvitation: FC<Props> = ({\n distributorId,\n invitationId,\n}) => {\n const { t } = useTranslation();\n const queryClient = useQueryClient();\n const notification = useNotification();\n\n const [isDeleteDistributorModalOpen, setIsDistributorModalOpen] =\n useState(false);\n\n // api\n const { mutate: deleteInvitation, isSuccess } =\n useDeleteDistributorInvitation({\n onSuccess: () =>\n queryClient\n .invalidateQueries({\n queryKey: [DistributorQueryKeys.GetUsers, distributorId],\n })\n .then(() => notification.info(\"Invitation deleted\")),\n });\n\n // submit\n const onDeleteInvitation = () => deleteInvitation(invitationId);\n\n // modal close\n const onDeleteDistributorModalClose = () => {\n setIsDistributorModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onDeleteDistributorModalClose();\n }\n }, [isSuccess]);\n\n return (\n <>\n <button onClick={() => setIsDistributorModalOpen(true)}>\n <TrashIcon\n className=\"h-5 w-5 text-flowerRed-800 hover:text-flowerRed-500 cursor-pointer\"\n aria-hidden=\"true\"\n />\n </button>\n\n <Modal\n title={t(`distributor.Delete distributor`)}\n leftButtonAction={onDeleteDistributorModalClose}\n leftButtonText={t(`Close`)}\n rightButtonActionHandler={() => onDeleteInvitation()}\n isOpen={isDeleteDistributorModalOpen}\n onClose={onDeleteDistributorModalClose}\n loadingText={t(`distributor.Deleting invitation`)}\n >\n <DeleteDistributorConfirmation />\n </Modal>\n </>\n );\n};\n","import { FC } from \"react\";\nimport { Table, TBody, TD, TH, THead, TR } from \"components/table\";\nimport { Badge } from \"components/tags/Badge\";\nimport { useDistributorUsers } from \"api/distributor/distributor.endpoints\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { Role } from \"enums/role.enum\";\nimport { AddDistributorUser } from \"components/distributor/AddDistributorUser\";\nimport { DeleteDistributorUser } from \"./DeleteDistributorUser\";\nimport { DeleteDistributorInvitation } from \"./DeleteDistributorInvitation\";\nimport { getRoleName, isDistributor } from \"../../helpers/role\";\nimport { DistributorUserDTO } from \"../../api/distributor/distributor.dto\";\nimport { DistributorInvitationDTO } from \"../../api/distributorInvitation/distributorInvitation.dto\";\n\ninterface Props {\n distributorId: number;\n userRole: Role;\n userId?: number;\n className?: string;\n}\n\nexport const DistributorUsersTab: FC<Props> = ({\n distributorId,\n userRole,\n userId,\n className = \"\",\n}) => {\n const { t } = useTranslation();\n\n // Get users and invitations\n const {\n data: useDistributorUsersResponse,\n isLoading,\n isError,\n } = useDistributorUsers(distributorId);\n\n if (\n isLoading ||\n isError ||\n !useDistributorUsersResponse?.users ||\n !useDistributorUsersResponse.invitations\n ) {\n return (\n <CustomPlaceholder\n isEmpty={\n !isLoading &&\n !isError &&\n !useDistributorUsersResponse?.users &&\n !useDistributorUsersResponse?.invitations\n }\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`distributor.Error`)}\n emptyDataMessage={t(`distributor.EmptyUsers`)}\n loaderSize=\"page\"\n />\n );\n }\n\n const { users, invitations } = useDistributorUsersResponse;\n\n return (\n <div className={className}>\n <div className=\"mb-4\">\n <Table>\n <THead>\n <TR>\n <TH isFirstColumn>{t(`distributor.Email`)}</TH>\n <TH>{t(`distributor.Name`)}</TH>\n <TH>{t(`distributor.Account type`)}</TH>\n <TH>{t(`distributor.Status`)}</TH>\n <TH>\n <></>\n </TH>\n </TR>\n </THead>\n <TBody>\n {users.map(({ id, email, role, name }: DistributorUserDTO) => (\n <TR key={email}>\n <TD addLeftMargin>{email}</TD>\n <TD>{name}</TD>\n <TD>{getRoleName(role)}</TD>\n <TD>\n <Badge\n color=\"green\"\n text={t(`badgeAccountStatus.Account created`)}\n />\n </TD>\n <TD alignRight>\n {userId != id && isDistributor(userRole) && (\n <DeleteDistributorUser\n distributorId={distributorId}\n userId={id}\n />\n )}\n </TD>\n </TR>\n ))}\n {invitations.map(\n ({ email, id, role, name }: DistributorInvitationDTO) => (\n <TR key={id}>\n <TD addLeftMargin>{email}</TD>\n <TD>{name}</TD>\n <TD>{getRoleName(role)}</TD>\n <TD>\n <Badge color=\"blue\" text=\"Invited\" />\n </TD>\n <TD alignRight>\n <div className=\"flex justify-end\">\n {isDistributor(userRole) && (\n <DeleteDistributorInvitation\n distributorId={distributorId}\n invitationId={id}\n />\n )}\n </div>\n </TD>\n </TR>\n ),\n )}\n </TBody>\n </Table>\n </div>\n {isDistributor(userRole) && (\n <AddDistributorUser distributorId={distributorId} />\n )}\n </div>\n );\n};\n","import { classNames } from \"helpers/classNames\";\nimport React, { FC } from \"react\";\n\nexport const Item: FC<{ children: React.ReactNode; className?: string }> = ({\n children,\n className = \"\",\n}) => (\n <div\n className={classNames(\n \"grid grid-cols-1 md:grid-cols-3 gap-4 p-6 items-center\",\n className,\n )}\n >\n {children}\n </div>\n);\n","import React, { FC } from \"react\";\nimport { Tooltip } from \"../tooltip/Tooltip\";\nimport { InformationCircleIcon } from \"@heroicons/react/24/solid\";\n\ninterface Props {\n children: React.ReactNode;\n tooltipMessage?: string;\n}\n\nexport const Label: FC<Props> = ({ children, tooltipMessage }) => (\n <dt className=\"flex text-sm font-medium text-gray-500\">\n {children}\n {tooltipMessage && (\n <Tooltip message={tooltipMessage} position=\"bottom-left\" size={\"large\"}>\n <div className=\"group relative flex items-center\">\n <InformationCircleIcon className=\"inline h-4 w-4 ml-2 text-gray-500 hover:text-gray-400 hover:text-white-400\" />\n </div>\n </Tooltip>\n )}\n </dt>\n);\n","import React, { FC } from \"react\";\n\nexport const List: FC<{ children: React.ReactNode }> = ({ children }) => (\n <dl className=\"divide-y divide-gray-50 p-2 bg-white rounded-md\">\n {children}\n </dl>\n);\n","import React, { FC } from \"react\";\n\ninterface Props {\n children: React.ReactNode;\n appendix?: string;\n}\nexport const Value: FC<Props> = ({ children, appendix }) => (\n <dd className=\"text-base text-gray-900 col-span-2\">\n {children}\n {!!appendix && ` ${appendix}`}\n </dd>\n);\n","import React, { FC } from \"react\";\nimport { ChildrenProps } from \"types/childrenProps.type\";\n\nexport const ValueContainer: FC<ChildrenProps> = ({ children }) => (\n <dt className=\"mt-1 flex text-base text-gray-900 sm:col-span-2 sm:mt-0\">\n {children}\n </dt>\n);\n","import * as React from \"react\";\nimport { ChildrenProps } from \"types/childrenProps.type\";\n\nexport const Shadow: React.FC<ChildrenProps> = ({ children }) => {\n return <div className=\"overflow-hidden mb-4 shadow\">{children}</div>;\n};\n","import { ExclamationCircleIcon } from \"@heroicons/react/20/solid\";\nimport { FC } from \"react\";\nimport { UseFormRegister } from \"react-hook-form\";\nimport { classNames } from \"helpers/classNames\";\nimport { useTranslation } from \"react-i18next\";\ninterface Props {\n label?: string;\n name: string;\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: UseFormRegister<any>;\n errorMessage?: string;\n}\nexport const PostalCodeInput: FC<Props> = ({\n label,\n name,\n register,\n errorMessage,\n}) => {\n const { t } = useTranslation();\n const hasError = !!errorMessage;\n\n return (\n <div>\n {label && (\n <label\n htmlFor={name}\n className=\"flex text-sm font-medium text-gray-700\"\n >\n {label}\n </label>\n )}\n <div className={classNames(\"mt-1 relative rounded-md shadow-sm\")}>\n <input\n type=\"text\"\n className={classNames(\n \"block w-full rounded-md shadow-sm sm:text-sm\",\n hasError\n ? \"border-red-300 focus:border-red-500 focus:outline-none focus:ring-red-500 pr-10 text-red-900 placeholder-red-300\"\n : \"border-gray-300 focus:border-flowerblue-500 focus:ring-flowerblue-500\",\n )}\n {...register(name, {\n required: t(\n \"validation.Please provide a valid postal code on the format XXXXX\",\n ),\n pattern: {\n value: /^\\d{5}$/,\n message: t(\n \"validation.Please provide a valid postal code on the format XXXXX\",\n ),\n },\n })}\n placeholder={\"XXXXX\"}\n />\n {hasError && (\n <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3\">\n <ExclamationCircleIcon\n className=\"h-5 w-5 text-red-500\"\n aria-hidden=\"true\"\n />\n </div>\n )}\n </div>\n\n {hasError && <p className=\"mt-2 text-sm text-red-600\">{errorMessage}</p>}\n </div>\n );\n};\n","import { UpdateDistributorRequestDTO } from \"api/distributor/distributor.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { PostalCodeInput } from \"components/input/PostalCodeInput\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<UpdateDistributorRequestDTO>;\n errors: Partial<FieldErrorsImpl<UpdateDistributorRequestDTO>>;\n}\n\nexport const EditDistributorForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`distributor.Company name`)}\n name=\"name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.name?.message}\n autoFocus\n />\n <TextInput\n label={t(`distributor.Organization number`)}\n name=\"organizationNumber\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.organizationNumber?.message}\n />\n <TextInput\n label={t(`distributor.Address`)}\n name=\"address.street\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.address?.street?.message}\n />\n <PostalCodeInput\n label={t(`distributor.Postal code`)}\n name=\"address.postalCode\"\n register={register}\n errorMessage={errors?.address?.postalCode?.message}\n />\n <TextInput\n label={t(`distributor.City`)}\n name=\"address.city\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.address?.city?.message}\n />\n <TextInput\n label={t(`distributor.Bankgiro / postgiro`)}\n name=\"giroNumber\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.giroNumber?.message}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport Modal from \"components/Modal\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n GetDistributorResponseDTO,\n UpdateDistributorRequestDTO,\n} from \"api/distributor/distributor.dto\";\nimport { useUpdateDistributor } from \"api/distributor/distributor.endpoints\";\nimport { EditDistributorForm } from \"./EditDistributorForm\";\n\ninterface Props {\n distributor: GetDistributorResponseDTO;\n}\n\nexport const EditDistributor: FC<Props> = ({ distributor }) => {\n const { t } = useTranslation();\n\n const [isEditDistributorModalOpen, setIsEditDistributorModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: updateDistributor,\n isPending: isUpdating,\n isSuccess,\n } = useUpdateDistributor(distributor.id);\n\n // form\n const {\n register,\n handleSubmit,\n reset,\n formState: { errors },\n } = useForm<UpdateDistributorRequestDTO>();\n\n // submit\n const onSubmit = handleSubmit((data: UpdateDistributorRequestDTO) =>\n updateDistributor(data),\n );\n\n // modal close\n const onEditDistributorModalClose = () => {\n setIsEditDistributorModalOpen(false);\n setTimeout(() => reset(), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onEditDistributorModalClose();\n }\n }, [isSuccess]);\n\n // Populate or clear the form\n useEffect(() => {\n if (isEditDistributorModalOpen) {\n reset(distributor);\n }\n }, [isEditDistributorModalOpen]);\n\n const renderEditDistributorButton = () => {\n return (\n <div className=\"flex justify-end mb-4\">\n <SecondaryButton onClick={() => setIsEditDistributorModalOpen(true)}>\n <PencilSquareIcon className=\"h-5 w-5 mr-1\" />\n {t(`distributor.Edit`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderEditDistributorButton()}\n\n <Modal\n isOpen={isEditDistributorModalOpen}\n rightButtonActionHandler={onSubmit}\n title={`${t(`distributor.Edit`)} ${distributor.name}`}\n rightButtonText={t(`Save`)}\n onClose={onEditDistributorModalClose}\n isLoading={isUpdating}\n leftButtonAction={onEditDistributorModalClose}\n leftButtonText={t(`Close`)}\n >\n <EditDistributorForm register={register} errors={errors} />\n </Modal>\n </>\n );\n};\n","import React, { FC } from \"react\";\nimport { AddressDTO } from \"api/shared/address.dto\";\n\ninterface Props {\n address: AddressDTO;\n}\n\nexport const Address: FC<Props> = ({ address }) => {\n const { street, postalCode, city } = address;\n if (!street && !postalCode && !city) return \"-\";\n return (\n <div className=\"space-y-1\">\n {!!street && <p>{street}</p>}\n <p>\n {!!postalCode && <span>{postalCode} </span>}\n {!!city && <span>{city}</span>}\n </p>\n </div>\n );\n};\n","import { Item, Label, List, Value } from \"components/descriptionList\";\nimport { Shadow } from \"components/Shadow\";\nimport { Role } from \"enums/role.enum\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { EditDistributor } from \"./EditDistributor\";\nimport { GetDistributorResponseDTO } from \"../../api/distributor/distributor.dto\";\nimport { Address } from \"../Address\";\n\ninterface Props {\n distributor: GetDistributorResponseDTO;\n userRole: Role;\n}\n\nexport const DistributorAccountDetails: FC<Props> = ({\n distributor,\n userRole,\n}) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"overflow-auto\">\n <Shadow>\n <List>\n <Item>\n <Label>{t(`distributor.Company name`)}</Label>\n <Value>{distributor.name}</Value>\n </Item>\n <Item>\n <Label>{t(`distributor.Organization number`)}</Label>\n <Value>{distributor.organizationNumber}</Value>\n </Item>\n <Item>\n <Label>{t(`assetOwnerAccountDetails.Address`)}</Label>\n <Value>\n <Address address={distributor.address} />\n </Value>\n </Item>\n <Item>\n <Label>{t(`distributor.Bankgiro / postgiro`)}</Label>\n <Value>{distributor.giroNumber}</Value>\n </Item>\n </List>\n </Shadow>\n\n {[Role.Flower, Role.DistributorAdmin].includes(userRole) && (\n <EditDistributor distributor={distributor} />\n )}\n </div>\n );\n};\n","import { Transition } from \"components/animations/Transition\";\nimport * as React from \"react\";\nimport { config } from \"react-spring\";\n\ninterface Props {\n children: React.ReactNode;\n}\n\nconst TabContainer: React.FC<Props> = ({ children }) => {\n return (\n <Transition\n settings={{\n from: { opacity: 0.7 },\n enter: { opacity: 1 },\n leave: { opacity: 0.7 },\n config: { ...config.gentle, duration: 100, precision: 0.01 },\n }}\n className={\"flex flex-col h-full w-full\"}\n >\n {children}\n </Transition>\n );\n};\n\nexport default TabContainer;\n","import { sub } from \"date-fns\";\nimport { GetCompensationResponseDTO } from \"../../api/compensation/compensation.dto\";\n\nexport const getTotalCompensation = (\n compensationResponse: GetCompensationResponseDTO[],\n): string => {\n return compensationResponse\n .reduce(\n (yearlyAcc, yearlyValue) =>\n yearlyAcc +\n yearlyValue.compensations.reduce(\n (monthlyAcc, monthlyValue) => monthlyAcc + monthlyValue.compensation,\n 0,\n ),\n 0,\n )\n .toLocaleString(\"sv-SE\");\n};\n\nexport const getPreviousYearCompensation = (\n compensationResponse: GetCompensationResponseDTO[],\n): string | number => {\n const currentYearCompensation = compensationResponse.find(\n (item) => item.year === new Date().getFullYear() - 1,\n );\n\n if (!currentYearCompensation) {\n return 0;\n } else {\n return currentYearCompensation.compensations\n .reduce(\n (monthlyAcc, monthlyValue) => monthlyAcc + monthlyValue.compensation,\n 0,\n )\n .toLocaleString(\"sv-SE\");\n }\n};\n\nexport const getCurrentYearCompensation = (\n compensationResponse: GetCompensationResponseDTO[],\n): string | number => {\n const currentYearCompensation = compensationResponse.find(\n (item) => item.year === new Date().getFullYear(),\n );\n\n if (!currentYearCompensation) {\n return 0;\n } else {\n return currentYearCompensation.compensations\n .reduce(\n (monthlyAcc, monthlyValue) => monthlyAcc + monthlyValue.compensation,\n 0,\n )\n .toLocaleString(\"sv-SE\");\n }\n};\n\nexport const getPreviousMonthCompensation = (\n compensationRes: GetCompensationResponseDTO[],\n): string | number => {\n const previousMonthCompensation = compensationRes.find(\n (item) =>\n item.year ===\n sub(new Date(), {\n months: 1,\n }).getFullYear(),\n );\n\n if (!previousMonthCompensation) {\n return 0;\n } else {\n return previousMonthCompensation.compensations[\n sub(new Date(), {\n months: 1,\n }).getMonth()\n ].compensation.toLocaleString(\"sv-SE\");\n }\n};\n","import React, { FC } from \"react\";\nimport {\n BanknotesIcon,\n ExclamationTriangleIcon,\n} from \"@heroicons/react/24/outline\";\n\nexport interface Tile {\n title: string;\n value?: string | number;\n unit?: string;\n}\n\ninterface Props {\n title: string;\n icon: React.ReactNode | React.ReactNode[];\n tiles: Tile[];\n emptyDataMessage?: string;\n warmingMessage?: string;\n}\n\nexport const CompensationStatistics: FC<Props> = ({\n title,\n icon,\n tiles,\n emptyDataMessage = \"\",\n warmingMessage = \"\",\n}: Props) => {\n return (\n <div className=\"w-full p-4 rounded-2xl flex flex-col bg-white h-max-full min-h-12 shadow\">\n <div className=\"flex justify-between gap-2 items-center\">\n <span className=\"text-xl md:text-lg font-medium text-black drop-shadow\">\n {title}\n </span>\n {Array.isArray(icon) ? (\n <div className=\"flex gap-1\">\n {icon.map((iconElement, index) => (\n <div\n key={index}\n className=\"w-8 h-8 md:w-6 md:h-6 text-flowerPeach-900\"\n >\n {iconElement}\n </div>\n ))}\n </div>\n ) : (\n <div className=\"w-8 h-8 md:w-6 md:h-6 text-flowerPeach-900\">\n {icon}\n </div>\n )}\n </div>\n\n <div className=\"flex-grow overflow-hidden bg-white w-full\">\n <dl\n className={`mt-4 grid grid-cols-1 gap-2 overflow-hidden text-center ${setColumnsNumber(tiles.length)}`}\n >\n {tiles.length ? (\n tiles.map((tile) => (\n <div\n key={tile.title}\n className=\"flex flex-col bg-white p-4 py-10 md:py-6 rounded-2xl shadow m-1\"\n >\n <dt className=\"text-sm font-base leading-6 text-gray-600\">\n {tile.title}\n </dt>\n <dd className=\"flex items-baseline gap-1 justify-center order-first text-3xl\">\n <span className=\"text-3xl md:text-2xl font-medium text-flowerSkyVivid-500\">\n {tile.value}\n </span>\n {tile.unit && (\n <span className=\"text-lg font-medium text-flowerGray-400\">\n {tile.unit}\n </span>\n )}\n </dd>\n </div>\n ))\n ) : (\n <div className=\"w-full flex flex-col justify-center items-center text-center mb-4 px-2 sm:px:0\">\n <div className=\"flex justify-center items-center w-12 h-12 sm:w-12 sm:h-12 text-gray-400\">\n <BanknotesIcon />\n </div>\n {emptyDataMessage && (\n <h3 className=\"mt-2 text-sm font-medium text-gray-600\">\n {emptyDataMessage}\n </h3>\n )}\n </div>\n )}\n </dl>\n </div>\n {warmingMessage && (\n <div className=\"flex mt-2 gap-2 md:gap-1 justify-center items-center\">\n <div className=\"flex-shrink-0\">\n <ExclamationTriangleIcon\n aria-hidden=\"true\"\n className=\"h-5 w-5 text-flowerRed-500\"\n />\n </div>\n <span className=\"text-flowerRed-500\">{warmingMessage}</span>\n </div>\n )}\n </div>\n );\n};\n\nconst setColumnsNumber = (tilesNumber: number): string => {\n switch (tilesNumber) {\n case 1:\n return \"sm:grid-cols-1 lg:grid-cols-1\";\n case 2:\n return \"sm:grid-cols-2 lg:grid-cols-2\";\n case 3:\n return \"sm:grid-cols-2 lg:grid-cols-3\";\n case 4:\n return \"sm:grid-cols-2 lg:grid-cols-4\";\n default:\n return \"sm:grid-cols-1 lg:grid-cols-1\";\n }\n};\n","import { GetCompensationResponseDTO } from \"../../api/compensation/compensation.dto\";\nimport React, { FC, useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n getCurrentYearCompensation,\n getPreviousMonthCompensation,\n getPreviousYearCompensation,\n getTotalCompensation,\n} from \"./CompensationStatistics.helpers\";\nimport { BanknotesIcon } from \"@heroicons/react/24/outline\";\nimport { CompensationStatistics, Tile } from \"./CompensationStatistics\";\n\ninterface Props {\n compensation: GetCompensationResponseDTO[] | undefined;\n}\n\nexport const Compensation: FC<Props> = ({ compensation }) => {\n const { t } = useTranslation();\n\n const compensationTiles: Tile[] = useMemo(\n () =>\n compensation\n ? [\n {\n title: t(\"compensation.Total\"),\n value: `${getTotalCompensation(compensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousYear\"),\n value: `${getPreviousYearCompensation(compensation)} SEK`,\n },\n {\n title: t(\"compensation.CurrentYear\"),\n value: `${getCurrentYearCompensation(compensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousMonth\"),\n value: `${getPreviousMonthCompensation(compensation)} SEK`,\n },\n ]\n : [],\n [compensation],\n );\n\n return (\n <div className=\"overflow-auto\">\n <CompensationStatistics\n title={t(\"compensation.CompensationStatistics\")}\n icon={<BanknotesIcon />}\n tiles={compensationTiles}\n emptyDataMessage={t(\"compensation.NotFound\")}\n />\n </div>\n );\n};\n","import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport api from \"../axiosInstance\";\nimport {\n CreateCompensationModelHistoryRequestDTO,\n CreateCompensationModelHistoryResponseDTO,\n GetCompensationModelHistoryResponseDTO,\n GetCompensationResponseDTO,\n} from \"./compensation.dto\";\nimport { useNotification } from \"../../hooks/useNotification\";\nimport { ErrorResponse } from \"../../types/errorResponse.type\";\n\nconst ENDPOINT = \"/compensation\";\n\nexport enum CompensationQueryKeys {\n GetTotalCompensation = \"get-total-compensation\",\n GetDistributorsCompensation = \"get-distributors-compensation\",\n GetInstallersCompensation = \"get-installers-compensation\",\n GetDistributorCompensation = \"get-distributor-compensation\",\n GetInstallerCompensation = \"get-installer-compensation\",\n GetCompensationModelHistory = \"get-compensation-model-history\",\n GetCurrentCompensationModel = \"get-current-compensation-model\",\n}\n\nexport const useTotalCompensation = () => {\n return useQuery({\n queryKey: [CompensationQueryKeys.GetTotalCompensation],\n queryFn: async (): Promise<GetCompensationResponseDTO[]> =>\n (await api.get(`${ENDPOINT}`)).data,\n });\n};\n\nexport const useDistributorsCompensation = () => {\n return useQuery({\n queryKey: [CompensationQueryKeys.GetDistributorsCompensation],\n queryFn: async (): Promise<GetCompensationResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/distributor`)).data,\n });\n};\n\nexport const useInstallersCompensation = () => {\n return useQuery({\n queryKey: [CompensationQueryKeys.GetInstallersCompensation],\n queryFn: async (): Promise<GetCompensationResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/installer`)).data,\n });\n};\n\nexport const useDistributorCompensation = (distributorId?: number) => {\n return useQuery({\n queryKey: [CompensationQueryKeys.GetDistributorCompensation],\n queryFn: async (): Promise<GetCompensationResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/distributor/${distributorId}`)).data,\n enabled: !!distributorId,\n });\n};\n\nexport const useInstallerCompensation = (installerId?: number) => {\n return useQuery({\n queryKey: [CompensationQueryKeys.GetInstallerCompensation],\n queryFn: async (): Promise<GetCompensationResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/installer/${installerId}`)).data,\n enabled: !!installerId,\n });\n};\n\nexport const useCompensationModelHistory = () => {\n return useQuery({\n queryKey: [CompensationQueryKeys.GetCompensationModelHistory],\n queryFn: async (): Promise<GetCompensationModelHistoryResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/model`)).data,\n });\n};\n\nexport const useCurrentCompensationModelPeriod = () => {\n return useQuery({\n queryKey: [CompensationQueryKeys.GetCurrentCompensationModel],\n queryFn: async (): Promise<GetCompensationModelHistoryResponseDTO> =>\n (await api.get(`${ENDPOINT}/model/current`)).data,\n });\n};\n\nexport const useCreateCompensationModelPeriod = (options = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreateCompensationModelHistoryRequestDTO,\n ): Promise<CreateCompensationModelHistoryResponseDTO> =>\n (await api.post(`${ENDPOINT}/model`, payload)).data,\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [CompensationQueryKeys.GetCompensationModelHistory],\n });\n queryClient.invalidateQueries({\n queryKey: [CompensationQueryKeys.GetCurrentCompensationModel],\n });\n notification.info(`Compensation model period created`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n ...options,\n });\n};\n\nexport const useDeleteCompensationModelPeriod = (settings = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (id: number): Promise<void> => {\n await api.delete(`${ENDPOINT}/model/${id}`);\n },\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [CompensationQueryKeys.GetCompensationModelHistory],\n });\n queryClient.invalidateQueries({\n queryKey: [CompensationQueryKeys.GetCurrentCompensationModel],\n });\n notification.info(`Compensation period deleted`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n ...settings,\n });\n};\n","import { useDistributor } from \"api/distributor/distributor.endpoints\";\nimport { Tab, TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { useParams, useSearchParams } from \"react-router-dom\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { getDistributorListBreadcrumb } from \"../distributorList/DistributorListPage\";\nimport { DashboardStatistics } from \"../../../components/statistics/DashboardStatistics\";\nimport { LatestInstallerList } from \"components/installer/LatestInstallerList\";\nimport { DistributorUsersTab } from \"../../../components/distributor/DistributorUsersTab\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { DistributorAccountDetails } from \"components/distributor/DistributorAccountDetails\";\nimport { Installers } from \"../../../components/installer/Installers\";\nimport TabContainer from \"../../../components/tab/TabContainer\";\nimport { isFlower } from \"../../../helpers/role\";\nimport { Compensation } from \"../../../components/compensation/Compensation\";\nimport { useDistributorCompensation } from \"../../../api/compensation/compensation.endpoints\";\n\nconst DASHBOARD_TAB = \"dashboard\";\nconst ORGANIZATION_TAB = \"organization\";\nconst INSTALLERS_TAB = \"installers\";\nconst USERS_TAB = \"users\";\nconst COMPENSATION_TAB = \"compensation\";\n\nexport default function DistributorPage() {\n const { t } = useTranslation();\n\n const params = useParams();\n const distributorId: string = params?.distributorId || \"-1\";\n const userRole = userStore(getUserRole);\n\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n\n const currentTab = searchParams.get(\"tab\") || DASHBOARD_TAB;\n const { setBreadCrumbs } = menuStore();\n\n // Get distributor\n const {\n data: distributor,\n isLoading: isLoadingDistributor,\n isError: isErrorDistributor,\n } = useDistributor(+distributorId);\n\n // Get distributor compensation\n const {\n data: distributorCompensation,\n isLoading: isLoadingDistributorCompensation,\n } = useDistributorCompensation(+distributorId);\n\n const isLoading = isLoadingDistributor || isLoadingDistributorCompensation;\n const isError = isErrorDistributor;\n const isEmpty = !distributor;\n\n useEffect(() => {\n if (distributor) {\n setBreadCrumbs([\n getDistributorListBreadcrumb(),\n getDistributorBreadcrumb({\n id: distributor.id,\n name: distributor.name,\n }),\n ]);\n }\n }, [distributor]);\n\n if (isLoading || isError || isEmpty) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isEmpty={!distributor && !distributorCompensation}\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`distributor.Error`)}\n emptyDataMessage={t(`distributor.Empty`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n const tabs: Tab[] = [\n {\n param: DASHBOARD_TAB,\n label: t(\"distributor.DashboardTitle\"),\n content: (\n <TabContainer key={DASHBOARD_TAB}>\n <div className=\"overflow-auto\">\n <DashboardStatistics distributorId={distributor.id} />\n <LatestInstallerList distributorId={distributor.id} />\n </div>\n </TabContainer>\n ),\n\n isSelected: currentTab === DASHBOARD_TAB,\n },\n {\n param: ORGANIZATION_TAB,\n label: t(\"distributor.OrganizationTitle\"),\n content: (\n <TabContainer key={ORGANIZATION_TAB}>\n <DistributorAccountDetails\n distributor={distributor}\n userRole={userRole}\n />\n </TabContainer>\n ),\n isSelected: currentTab === ORGANIZATION_TAB,\n },\n {\n param: INSTALLERS_TAB,\n label: t(\"distributor.InstallersTitle\"),\n content: (\n <TabContainer key={INSTALLERS_TAB}>\n <div className=\"flex flex-col h-full pb-4 md:pb-8\">\n <Installers userRole={userRole} distributorId={distributor.id} />\n </div>\n </TabContainer>\n ),\n isSelected: currentTab === INSTALLERS_TAB,\n },\n {\n param: USERS_TAB,\n label: t(\"distributor.UsersTitle\"),\n content: (\n <TabContainer key={USERS_TAB}>\n <DistributorUsersTab\n distributorId={distributor.id}\n userRole={userRole}\n className={\"flex flex-col overflow-x-hidden overflow-auto\"}\n />\n </TabContainer>\n ),\n isSelected: currentTab === USERS_TAB,\n },\n ];\n\n if (isFlower(userRole)) {\n const flowerUserTab = [\n {\n param: COMPENSATION_TAB,\n label: t(`compensation.Compensation`),\n content: (\n <TabContainer key={COMPENSATION_TAB}>\n <Compensation compensation={distributorCompensation} />\n </TabContainer>\n ),\n isSelected: currentTab === COMPENSATION_TAB,\n },\n ];\n\n tabs.push(...flowerUserTab);\n }\n\n return <TabPageWrapper tabs={tabs} setTab={setTab} />;\n}\n\nexport const getDistributorBreadcrumb = ({\n id,\n name,\n}: {\n id: number;\n name: string;\n}): BreadCrumb => ({\n label: name,\n to: `${RouteUrl.App}/${RouteUrl.Distributors}/${id}`,\n iconType: \"distributor\",\n});\n","//Using for coordinate badge colors\nexport enum AssetOwnerStatus {\n Unknown = \"Unknown\",\n Invited = \"Invited\",\n AccountVerified = \"Verified\",\n InvitationExpired = \"Invitation Expired\",\n}\n","import { FC } from \"react\";\n\nimport { Badge, BadgeColor, BadgeSize } from \"./Badge\";\nimport { AssetOwnerStatus } from \"enums/assetOwnerStatus.enum\";\n\ninterface Props {\n status: AssetOwnerStatus;\n size?: BadgeSize;\n}\nexport const AssetOwnerStatusTag: FC<Props> = ({ status, size = \"small\" }) => (\n <Badge color={getColor(status)} text={status} size={size} />\n);\n\nconst getColor = (status: AssetOwnerStatus): BadgeColor => {\n switch (status) {\n case AssetOwnerStatus.AccountVerified:\n return \"green\";\n case AssetOwnerStatus.Invited:\n return \"blue\";\n case AssetOwnerStatus.InvitationExpired:\n return \"yellow\";\n default:\n return \"gray\";\n }\n};\n","import { UpdateAssetOwnerRequestDTO } from \"api/assetOwner/assetOwner.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { PostalCodeInput } from \"components/input/PostalCodeInput\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<UpdateAssetOwnerRequestDTO>;\n errors: Partial<FieldErrorsImpl<UpdateAssetOwnerRequestDTO>>;\n}\n\nexport const EditAssetOwnerProfileForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`assetOwnerAccountDetails.First name`)}\n name=\"firstName\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.firstName?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.Last name`)}\n name=\"lastName\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.lastName?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.Address`)}\n name=\"address.street\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.address?.message}\n />\n <PostalCodeInput\n label={t(`assetOwnerAccountDetails.Postal code`)}\n name=\"address.postalCode\"\n register={register}\n errorMessage={errors.address?.postalCode?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.City`)}\n name=\"address.city\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.address?.city?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.Phone`)}\n name=\"phone\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.phone?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.AccountEmail`)}\n hoverDetails={t(`assetOwnerAccountDetails.AccountEmailHover`)}\n name=\"mainEmail\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.mainEmail?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.InvoiceEmail`)}\n hoverDetails={t(`assetOwnerAccountDetails.InvoiceEmailHover`)}\n name=\"contactEmail\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.contactEmail?.message}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"../Modal\";\nimport SecondaryButton from \"../buttons/SecondaryButton\";\nimport { useForm } from \"react-hook-form\";\nimport {\n AssetOwnerQueryKeys,\n useUpdateAssetOwner,\n} from \"api/assetOwner/assetOwner.endpoints\";\nimport {\n GetAssetOwnerProfileResponseDTO,\n UpdateAssetOwnerRequestDTO,\n} from \"api/assetOwner/assetOwner.dto\";\nimport { EditAssetOwnerProfileForm } from \"./EditAssetOwnerProfileForm\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\ninterface Props {\n assetOwnerProfile: GetAssetOwnerProfileResponseDTO;\n}\n\nexport const EditAssetOwnerProfile: FC<Props> = ({ assetOwnerProfile }) => {\n const { t } = useTranslation();\n\n const [isEditAssetOwnerModalOpen, setIsEditAssetOwnerModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: updateAssetOwner,\n isPending: isUpdating,\n isSuccess: isUpdateAssetOwnerSuccess,\n } = useUpdateAssetOwner(assetOwnerProfile.id);\n\n // form\n const {\n register: registerUpdateAssetOwner,\n handleSubmit: handleUpdateAssetOwnerSubmit,\n reset: resetUpdateAssetOwner,\n formState: { errors: updateAssetOwnerErrors },\n } = useForm<UpdateAssetOwnerRequestDTO>();\n\n // submit\n const onUpdateProfileSubmit = handleUpdateAssetOwnerSubmit(\n (payload: UpdateAssetOwnerRequestDTO) => updateAssetOwner(payload),\n );\n\n // modal close\n const onEditAssetOwnerModalClose = () => {\n setIsEditAssetOwnerModalOpen(false);\n setTimeout(() => resetUpdateAssetOwner(), 300);\n };\n\n // after submit success\n const queryClient = useQueryClient();\n\n useEffect(() => {\n if (isUpdateAssetOwnerSuccess) {\n onEditAssetOwnerModalClose();\n\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetProfile, assetOwnerProfile.id],\n });\n }\n }, [isUpdateAssetOwnerSuccess]);\n\n // Populate or clear the form every time isEditAssetOwnerModalOpen is set\n useEffect(() => {\n if (isEditAssetOwnerModalOpen) {\n resetUpdateAssetOwner({\n ...assetOwnerProfile,\n });\n } else {\n setTimeout(() => resetUpdateAssetOwner(), 300);\n }\n }, [isEditAssetOwnerModalOpen]);\n\n const renderEditAssetOwnerButton = () => {\n return (\n <div className=\"flex justify-end mb-4\">\n <SecondaryButton onClick={() => setIsEditAssetOwnerModalOpen(true)}>\n <PencilSquareIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(`assetOwnerAccountDetails.EditAssetOwner`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderEditAssetOwnerButton()}\n\n <Modal\n title={t(`assetOwnerAccountDetails.EditAssetOwner`)}\n rightButtonText={t(`Save`)}\n rightButtonActionHandler={onUpdateProfileSubmit}\n isOpen={isEditAssetOwnerModalOpen}\n onClose={onEditAssetOwnerModalClose}\n isLoading={isUpdating}\n >\n <EditAssetOwnerProfileForm\n register={registerUpdateAssetOwner}\n errors={updateAssetOwnerErrors}\n />\n </Modal>\n </>\n );\n};\n","import { FC, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"../Modal\";\nimport { useDeleteAssetOwner } from \"api/assetOwner/assetOwner.endpoints\";\nimport { useNavigate } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { TrashIcon } from \"@heroicons/react/24/outline\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\n\ninterface Props {\n assetOwnerId: number;\n}\n\nexport const DeleteAssetOwner: FC<Props> = ({ assetOwnerId }) => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n\n const [isDeleteAssetOwnerModalOpen, setIsDeleteAssetOwnerModalOpen] =\n useState(false);\n\n // api\n const { mutate: deleteAssetOwner } = useDeleteAssetOwner({\n onSuccess: () => navigate(`${RouteUrl.App}/${RouteUrl.AssetOwners}`),\n });\n\n // submit\n const onDeleteAssetOwner = (id: number) => deleteAssetOwner(id);\n\n // modal close\n const onDeleteAssetOwnerModalClose = () => {\n setIsDeleteAssetOwnerModalOpen(false);\n };\n\n return (\n <>\n <div className=\"w-4 h-5 justify-center flex\">\n <button onClick={() => setIsDeleteAssetOwnerModalOpen(true)}>\n <TrashIcon\n className=\"h-5 w-5 text-flowerRed-800 hover:text-flowerRed-500\"\n aria-hidden=\"true\"\n />\n </button>\n </div>\n\n <Modal\n title={t(`assetOwnerAccountDetails.DeleteAssetOwner`)}\n leftButtonAction={onDeleteAssetOwnerModalClose}\n leftButtonText={t(`Close`)}\n rightButtonText={t(`assetOwnerAccountDetails.DeleteAssetOwner`)}\n rightButtonActionHandler={() => onDeleteAssetOwner(+assetOwnerId)}\n isOpen={isDeleteAssetOwnerModalOpen}\n onClose={onDeleteAssetOwnerModalClose}\n loadingText={t(`assetOwnerAccountDetails.DeletingInvitation`)}\n >\n <ModalContentWrapper>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n {t(\n `assetOwnerAccountDetails.Are you sure that you want to delete this asset owner?`,\n )}\n </p>\n </div>\n </ModalContentWrapper>\n </Modal>\n </>\n );\n};\n","import api from \"../axiosInstance\";\nimport {\n GetAssetOwnerInvitationResponseDTO,\n ResendAssetOwnerInvitationRequestDTO,\n SignupFlowByCodeRequestDTO,\n} from \"./assetOwnerInvitation.dto\";\nimport { useNotification } from \"hooks/useNotification\";\nimport { AssetOwnerQueryKeys } from \"api/assetOwner/assetOwner.endpoints\";\nimport {\n UpdateAssetOwnerInvitationRequestDTO,\n UpdateAssetOwnerInvitationResponseDTO,\n} from \"api/assetOwner/assetOwner.dto\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\n\nexport const ENDPOINT = \"/asset-owner-invitation\";\n\nexport enum AssetOwnerInvitationQueryKeys {\n GetOne = \"asset-owner-invitation-get-one\",\n}\n\nexport const useAssetOwnerSignUp = () => {\n const notification = useNotification();\n return useMutation({\n mutationFn: async (payload: SignupFlowByCodeRequestDTO) =>\n (await api.post(`${ENDPOINT}/signup-flow-by-code`, payload)).data,\n onError: () => {\n notification.error();\n },\n });\n};\n\nexport const useAssetOwnerInvitation = (code: string, enabled: boolean) =>\n useQuery({\n queryKey: [AssetOwnerInvitationQueryKeys.GetOne],\n queryFn: async (): Promise<GetAssetOwnerInvitationResponseDTO> =>\n (await api.get(`${ENDPOINT}/${code}`)).data,\n enabled,\n });\n\nexport const useResendInvitation = (settings = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: ResendAssetOwnerInvitationRequestDTO,\n ): Promise<void> =>\n await api.put(`${ENDPOINT}/${payload.oldInvitationId}/resend`, {\n installerId: payload.installerId,\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [AssetOwnerQueryKeys.GetOne] });\n notification.info(\"Invitation resent, invalidated old one\");\n },\n onError: () => {\n notification.error();\n },\n ...settings,\n });\n};\n\nexport const useUpdateAssetOwnerInvitation = (oldInvitationId: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: UpdateAssetOwnerInvitationRequestDTO,\n ): Promise<UpdateAssetOwnerInvitationResponseDTO> =>\n (await api.put(`${ENDPOINT}/${oldInvitationId}`, payload)).data,\n onSuccess: (data: UpdateAssetOwnerInvitationResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetProfile, data.id],\n });\n notification.info(`${data.name} updated`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { AssetOwnerQueryKeys } from \"api/assetOwner/assetOwner.endpoints\";\nimport { useResendInvitation } from \"api/assetOwnerInvitation/assetOwnerInvitation.endpoints\";\nimport { useNotification } from \"hooks/useNotification\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { ArrowPathIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n assetOwnerId: number;\n installerId: number;\n oldInvitationId?: number;\n}\n\nexport const ResendAssetOwnerInvitation: FC<Props> = ({\n assetOwnerId,\n installerId,\n oldInvitationId,\n}) => {\n const { t } = useTranslation();\n const queryClient = useQueryClient();\n const notification = useNotification();\n\n // api\n const { mutate: resendInvitation } = useResendInvitation({\n onSuccess: async () => {\n queryClient\n .invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetProfile, assetOwnerId],\n })\n .then(() =>\n notification.info(t(`assetOwnerAccountDetails.InvitationResent`)),\n );\n },\n });\n\n // submit\n const onResendInvitation = () => {\n if (oldInvitationId && installerId) {\n resendInvitation({ oldInvitationId, installerId });\n }\n };\n\n return (\n <SecondaryButton size=\"small\" onClick={onResendInvitation}>\n <ArrowPathIcon className=\"h-5 w-5 mr-1\" />\n {t(`assetOwnerAccountDetails.ResendInvitation`)}{\" \"}\n </SecondaryButton>\n );\n};\n","import { UpdateAssetOwnerInvitationRequestDTO } from \"api/assetOwner/assetOwner.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { PostalCodeInput } from \"components/input/PostalCodeInput\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<UpdateAssetOwnerInvitationRequestDTO>;\n errors: Partial<FieldErrorsImpl<UpdateAssetOwnerInvitationRequestDTO>>;\n}\n\nexport const EditAssetOwnerInvitationForm: FC<Props> = ({\n register,\n errors,\n}) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`assetOwnerAccountDetails.Email`)}\n name=\"mainEmail\"\n type=\"email\"\n register={register}\n registerOptions={emailValidator}\n errorMessage={errors?.mainEmail?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.First name`)}\n name=\"firstName\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.firstName?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.Last name`)}\n name=\"lastName\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.lastName?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.Address`)}\n name=\"address.street\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.address?.street?.message}\n />\n <PostalCodeInput\n label={t(`assetOwnerAccountDetails.Postal code`)}\n name=\"address.postalCode\"\n register={register}\n errorMessage={errors.address?.postalCode?.message}\n />\n <TextInput\n label={t(`assetOwnerAccountDetails.City`)}\n name=\"address.city\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.address?.city?.message}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport Modal from \"components/Modal\";\nimport { useTranslation } from \"react-i18next\";\nimport { EditAssetOwnerInvitationForm } from \"./EditAssetOwnerInvitationForm\";\nimport { UpdateAssetOwnerInvitationRequestDTO } from \"api/assetOwner/assetOwner.dto\";\nimport { useUpdateAssetOwnerInvitation } from \"api/assetOwnerInvitation/assetOwnerInvitation.endpoints\";\n\ninterface Props {\n assetOwner: UpdateAssetOwnerInvitationRequestDTO;\n oldInvitationId: number;\n}\n\nexport const EditAssetOwnerInvitation: FC<Props> = ({\n assetOwner,\n oldInvitationId,\n}) => {\n const { t } = useTranslation();\n\n const [isEditInvitationModalOpen, setIsEditInvitationModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: updateInvitation,\n isPending: isUpdating,\n isSuccess,\n } = useUpdateAssetOwnerInvitation(oldInvitationId);\n\n // form\n const {\n register,\n handleSubmit,\n reset,\n formState: { errors },\n } = useForm<UpdateAssetOwnerInvitationRequestDTO>();\n\n // submit\n const onSubmit = handleSubmit((data: UpdateAssetOwnerInvitationRequestDTO) =>\n updateInvitation(data),\n );\n\n // modal close\n const onEditInvitationModalClose = () => {\n setTimeout(() => reset(), 300);\n setIsEditInvitationModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onEditInvitationModalClose();\n }\n }, [isSuccess]);\n\n // Populate or clear the form every time isEditInvitationModalOpen is set\n useEffect(() => {\n if (isEditInvitationModalOpen) {\n reset({ ...assetOwner });\n }\n }, [isEditInvitationModalOpen]);\n\n const renderEditInvitationButton = () => {\n return (\n <div className=\"py-5 flex justify-end\">\n <PencilSquareIcon\n className=\"h-5 w-5 text-gray-700 hover:text-flowerPeach-900 cursor-pointer\"\n onClick={() => setIsEditInvitationModalOpen(true)}\n />\n </div>\n );\n };\n\n return (\n <>\n {renderEditInvitationButton()}\n\n <Modal\n isOpen={isEditInvitationModalOpen}\n rightButtonActionHandler={onSubmit}\n title={t(`assetOwnerAccountDetails.EditAssetOwner`)}\n rightButtonText={t(`Save`)}\n onClose={onEditInvitationModalClose}\n isLoading={isUpdating}\n >\n <EditAssetOwnerInvitationForm register={register} errors={errors} />\n </Modal>\n </>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { hasDifferentContactEmail } from \"../../helpers/assetOwner\";\nimport { Address } from \"../Address\";\nimport { AssetOwnerStatusTag } from \"components/tags/AssetOwnerStatusTag\";\nimport {\n Item,\n Label,\n List,\n Value,\n ValueContainer,\n} from \"components/descriptionList\";\nimport { useAssetOwnerProfile } from \"api/assetOwner/assetOwner.endpoints\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { AssetOwnerStatus } from \"enums/assetOwnerStatus.enum\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\n\nimport { EditAssetOwnerProfile } from \"components/assetOwner/EditAssetOwnerProfile\";\nimport { DeleteAssetOwner } from \"components/assetOwner/DeleteAssetOwner\";\nimport { ResendAssetOwnerInvitation } from \"./ResendAssetOwnerInvitation\";\nimport { Role } from \"enums/role.enum\";\nimport { isAssetOwner, isFlower } from \"../../helpers/role\";\nimport { EditAssetOwnerInvitation } from \"./EditAssetOwnerInvitation\";\nimport { Shadow } from \"../Shadow\";\n\ninterface Props {\n assetOwnerId: number;\n userRole: Role;\n hasAsset?: boolean;\n}\n\nexport const AccountDetails: FC<Props> = ({\n assetOwnerId,\n userRole,\n hasAsset = false,\n}) => {\n const { t } = useTranslation();\n\n /**\n * Get asset owner profile\n */\n const {\n data: assetOwnerProfile,\n isLoading,\n isError,\n } = useAssetOwnerProfile(assetOwnerId);\n\n const renderStatusWithActions = () => {\n if (!assetOwnerProfile?.accountStatus) return null;\n\n return (\n <Item className=\"relative\">\n <Label>{t(`assetOwnerAccountDetails.Status`)}</Label>\n <Value>\n <div className=\"flex items-center gap-10\">\n <AssetOwnerStatusTag\n status={assetOwnerProfile?.accountStatus}\n size=\"small\"\n />\n {assetOwnerProfile.accountStatus !==\n AssetOwnerStatus.AccountVerified && (\n <ResendAssetOwnerInvitation\n assetOwnerId={assetOwnerProfile.id}\n installerId={assetOwnerProfile.installer.id}\n oldInvitationId={assetOwnerProfile.oldInvitationId}\n />\n )}\n {assetOwnerProfile.accountStatus === AssetOwnerStatus.Invited && (\n <EditAssetOwnerInvitation\n assetOwner={{\n assetOwnerId: assetOwnerProfile.id,\n mainEmail: assetOwnerProfile.mainEmail,\n firstName: assetOwnerProfile.firstName,\n lastName: assetOwnerProfile.lastName,\n address: assetOwnerProfile.address,\n installerId: assetOwnerProfile.installer.id,\n }}\n oldInvitationId={assetOwnerProfile.oldInvitationId || -1}\n />\n )}\n {assetOwnerProfile.accountStatus === AssetOwnerStatus.Invited &&\n !hasAsset && (\n <DeleteAssetOwner assetOwnerId={assetOwnerProfile.id} />\n )}\n </div>\n </Value>\n </Item>\n );\n };\n\n const renderPlaceholder = () => (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && !assetOwnerProfile}\n icon={<UserIcon />}\n errorMessage={t(\n `assetOwnerAccountDetails.UnableToFetchAssetOwnerAccountDetails`,\n )}\n emptyDataMessage={t(\n `assetOwnerAccountDetails.NoAssetOwnerAccountDetails`,\n )}\n loaderSize=\"medium\"\n />\n </div>\n );\n\n if (isLoading || !assetOwnerProfile || isError) {\n return renderPlaceholder();\n }\n\n return (\n <div className=\"overflow-auto\">\n <Shadow>\n <List>\n <Item>\n <Label>{t(`assetOwnerAccountDetails.Name`)}</Label>\n <Value>{`${assetOwnerProfile.firstName} ${assetOwnerProfile.lastName}`}</Value>\n </Item>\n {renderStatusWithActions()}\n <Item>\n <Label>{t(`assetOwnerAccountDetails.Address`)}</Label>\n <Value>\n <Address address={assetOwnerProfile.address} />\n </Value>\n </Item>\n <Item>\n <Label>{t(`assetOwnerAccountDetails.Phone`)}</Label>\n <Value>{assetOwnerProfile.phone ?? \"-\"}</Value>\n </Item>\n <Item>\n <Label>\n {hasDifferentContactEmail(\n assetOwnerProfile.mainEmail,\n assetOwnerProfile.contactEmail,\n )\n ? t(`assetOwnerAccountDetails.AccountEmail`)\n : t(`assetOwnerAccountDetails.Email`)}\n </Label>\n <Value>{assetOwnerProfile.mainEmail}</Value>\n </Item>\n {hasDifferentContactEmail(\n assetOwnerProfile.mainEmail,\n assetOwnerProfile.contactEmail,\n ) && (\n <Item>\n <Label>{t(`assetOwnerAccountDetails.InvoiceEmail`)}</Label>\n <Value>{assetOwnerProfile.contactEmail}</Value>\n </Item>\n )}\n\n {isAssetOwner(userRole) && (\n <Item>\n <Label>{t(`assetOwnerAccountDetails.Installer contact`)}</Label>\n <ValueContainer>\n <Value>\n <div className=\"space-y-1\">\n {!!assetOwnerProfile.installer?.name && (\n <p>{assetOwnerProfile.installer?.name}</p>\n )}\n <Address address={assetOwnerProfile.installer.address} />\n </div>\n </Value>\n </ValueContainer>\n </Item>\n )}\n </List>\n </Shadow>\n\n {isFlower(userRole) &&\n assetOwnerProfile.accountStatus ===\n AssetOwnerStatus.AccountVerified && (\n <EditAssetOwnerProfile assetOwnerProfile={assetOwnerProfile} />\n )}\n </div>\n );\n};\n","import { dateToChartName } from \"helpers/date\";\nimport { ConsumptionMonth } from \"types/consumptionMonth.type\";\nimport {\n InvoiceItemDTO,\n InvoiceDataInGraph,\n GetInvoiceItemResponseDTO,\n} from \"types/invoice.type\";\n\nexport type ConsumptionChartItem = {\n name: string;\n kWh: string;\n SEK: number;\n flower: number;\n};\n\nexport const datePreviousMonth = (invoicedMonth: string): string => {\n const [year, month, day] = invoicedMonth.split(\"-\").map(Number);\n const prevYear = month === 1 ? year - 1 : year;\n const prevMonth = month === 1 ? 12 : month - 1;\n const resultingDate = [prevYear, prevMonth, day]\n .map((dateComponent) => {\n if (dateComponent.toString().length === 1) {\n return `0${dateComponent}`;\n }\n return dateComponent;\n })\n .join(\"-\");\n\n return resultingDate;\n};\n\n// invoiceMonth is always beginning at the first day of the month for both consumption and invoice data,\n// i.e. YYYY-MM-01\n// An invoice relates to the data of the previous month,\n// i.e. the invoice with invoiceMonth 2023-01-01 is related to the consumption with invoiceMonth 2022-12-01\nexport const sameInvoicedMonth = (\n invoiceMonth: string,\n consumptionMonth: string,\n): boolean => {\n return datePreviousMonth(invoiceMonth) === consumptionMonth;\n};\n\nexport const flowerCompensation = (\n invoice: GetInvoiceItemResponseDTO,\n): string => {\n const flowerCompensationItemId = \"100005\";\n const subGroupInvoices = invoice.sub_group_invoices;\n\n const compensation =\n subGroupInvoices\n ?.flatMap((invoice: InvoiceItemDTO) => invoice.invoice_lines)\n ?.find((invoiceLine) => invoiceLine.item_id === flowerCompensationItemId)\n ?.amount ?? \"0\";\n\n return compensation;\n};\n\nconst negateSEK = (amount: number): number => {\n return -1 * Number(amount);\n};\n\nconst aggregateMultipleInvoicesForSameMonth = (\n invoices: GetInvoiceItemResponseDTO[],\n): InvoiceDataInGraph => {\n const combinedDataOfAllInvoices: InvoiceDataInGraph = {\n totalInvoiceAmount: 0,\n totalFlowerCompensationAmount: 0,\n };\n\n invoices.forEach((invoice) => {\n combinedDataOfAllInvoices.totalInvoiceAmount += Number(\n invoice.total_amount,\n );\n combinedDataOfAllInvoices.totalFlowerCompensationAmount += Number(\n flowerCompensation(invoice),\n );\n });\n return combinedDataOfAllInvoices;\n};\n\nexport const getChartData = (\n months?: ConsumptionMonth[],\n invoices?: GetInvoiceItemResponseDTO[],\n): ConsumptionChartItem[] =>\n (months ?? [])\n .filter((month) =>\n (invoices ?? []).some((inv) =>\n sameInvoicedMonth(inv.invoiced_month, month.invoiced_month),\n ),\n )\n .map((month) => {\n const invoicesForSameMonth = (invoices ?? []).filter((invoice) =>\n sameInvoicedMonth(invoice.invoiced_month, month.invoiced_month),\n );\n\n if (!invoicesForSameMonth) {\n // Will never be able to get here due to the filter logic above but TypeScript does not catch that\n throw Error(\"Missing invoice for month\");\n }\n\n const InvoicesForSameMonthAggregated =\n aggregateMultipleInvoicesForSameMonth(invoicesForSameMonth);\n\n return {\n name: dateToChartName(month.invoiced_month),\n kWh: month.volume,\n SEK: negateSEK(InvoicesForSameMonthAggregated.totalInvoiceAmount),\n flower: negateSEK(\n InvoicesForSameMonthAggregated.totalFlowerCompensationAmount,\n ),\n };\n });\n\nconst yAxisMaxCalc = (maxValue: number, yMaxMultiple: number): number => {\n const yMaxRoundedToMultiple =\n Math.ceil(maxValue / yMaxMultiple) * yMaxMultiple;\n\n // This is to avoid the max value of the graph being close to to the max value of the y axis\n // since this not visually appealing\n return maxValue > 0.9 * yMaxRoundedToMultiple\n ? yMaxRoundedToMultiple + yMaxMultiple / 2\n : yMaxRoundedToMultiple;\n};\n\nexport const getChartDomainMoney = (chartData: ConsumptionChartItem[]) => {\n const max_money = Math.max(\n ...chartData.map((item) => Number(item.flower)),\n ...chartData.map((item) => Number(item.SEK)),\n );\n\n return [0, yAxisMaxCalc(max_money, 1000)];\n};\n\nexport const getChartDomainPower = (chartData: ConsumptionChartItem[]) => {\n const max_energy = Math.max(...chartData.map((item) => Number(item.kWh)));\n\n return [0, yAxisMaxCalc(max_energy, 1000)];\n};\n","import { FC } from \"react\";\nimport {\n Bar,\n CartesianGrid,\n ComposedChart,\n Legend,\n Line,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport {\n ConsumptionChartItem,\n getChartDomainMoney,\n getChartDomainPower,\n} from \"../../helpers/assetOwnerDashboard\";\n\ninterface Props {\n data?: ConsumptionChartItem[];\n}\n\nexport const DesktopVersion: FC<Props> = ({ data = [] }) => {\n return (\n <div className=\"bg-white p-2 rounded\">\n <ResponsiveContainer height={400}>\n <ComposedChart\n data={data}\n margin={{\n top: 20,\n bottom: 20,\n left: 10,\n right: 10,\n }}\n >\n <CartesianGrid stroke=\"#f5f5f5\" />\n <XAxis dataKey=\"name\" />\n <YAxis\n yAxisId=\"left\"\n label={<CustomYAxisLabel value={\"SEK\"} xIncrease={5} />}\n axisLine={false}\n domain={getChartDomainMoney(data)}\n tickCount={5}\n tickLine={false}\n />\n <YAxis\n yAxisId=\"right\"\n orientation=\"right\"\n label={<CustomYAxisLabel value={\"kWh\"} xIncrease={60} />}\n axisLine={false}\n domain={getChartDomainPower(data)}\n tickCount={5}\n tickLine={false}\n />\n <Tooltip />\n <Legend\n fontStyle={\"0.5rem\"}\n formatter={(value) => (\n <span className=\"font-normal text-gray-600\">{value}</span>\n )}\n />\n <Bar\n name=\"Household consumption (kWh)\"\n yAxisId=\"right\"\n dataKey=\"kWh\"\n barSize={20}\n // This is not part of the FlowerHub color scheme in tailwind.config\n // flowerblue-500 is too light and flowerblue-600 too dark\n // So we will use this until we have a suitable one in the color scheme\n fill=\"#78A7D3\"\n />\n <Line\n name=\"Monthly total (SEK)\"\n yAxisId=\"left\"\n type=\"linear\"\n dataKey=\"SEK\"\n stroke=\"#f472b6\"\n dot={false}\n strokeWidth={2}\n strokeDasharray=\"5 5\"\n />\n <Line\n name=\"Flower Hub revenue (SEK)\"\n yAxisId=\"left\"\n type=\"linear\"\n dataKey=\"flower\"\n stroke=\"#fb923c\"\n dot={false}\n strokeWidth={2}\n strokeDasharray=\"5 5\"\n />\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n );\n};\n\ntype ViewBox = { x: number; y: number; height: number };\n\ninterface CustomYAxisLabelProps {\n viewBox?: ViewBox;\n value?: string;\n xIncrease?: number;\n isMobile?: boolean;\n}\n\nexport const CustomYAxisLabel: FC<CustomYAxisLabelProps> = ({\n viewBox = { x: 0, y: 0, height: 0 },\n value,\n xIncrease = 0,\n isMobile = false,\n}) => {\n const { x, y, height } = viewBox;\n\n return (\n <text\n x={x + xIncrease}\n y={y + height / 2}\n fill=\"#616E7C\"\n fontSize={isMobile ? \"0.8em\" : \"default\"}\n textAnchor=\"middle\"\n transform={`rotate(-90, ${x + xIncrease}, ${y + height / 2})`}\n >\n {value}\n </text>\n );\n};\n","import { FC } from \"react\";\nimport {\n Bar,\n CartesianGrid,\n ComposedChart,\n Legend,\n Line,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\";\nimport {\n ConsumptionChartItem,\n getChartDomainMoney,\n getChartDomainPower,\n} from \"../../helpers/assetOwnerDashboard\";\nimport { CustomYAxisLabel } from \"./DesktopVersion\";\n\ninterface Props {\n data?: ConsumptionChartItem[];\n}\n\nexport const MobileVersion: FC<Props> = ({ data = [] }) => {\n return (\n <div className=\"bg-white py-4 px-2 rounded-md\">\n <ResponsiveContainer height={400} width=\"100%\">\n <ComposedChart\n data={data}\n margin={{\n top: 5,\n bottom: 5,\n left: 0,\n right: 0,\n }}\n >\n <CartesianGrid stroke=\"#f5f5f5\" />\n <XAxis dataKey=\"name\" />\n <YAxis\n yAxisId=\"left\"\n label={\n <CustomYAxisLabel value={\"SEK\"} xIncrease={15} isMobile={true} />\n }\n axisLine={false}\n domain={getChartDomainMoney(data)}\n tickCount={5}\n tickLine={false}\n fontSize=\"12\"\n style={{\n fontSize: \"0.7rem\",\n fontFamily: \"Arial\",\n }}\n ></YAxis>\n <YAxis\n yAxisId=\"right\"\n orientation=\"right\"\n label={\n <CustomYAxisLabel value={\"kWh\"} xIncrease={50} isMobile={true} />\n }\n axisLine={false}\n domain={getChartDomainPower(data)}\n tickCount={5}\n tickLine={false}\n style={{\n fontSize: \"0.7rem\",\n fontFamily: \"Arial\",\n }}\n />\n <Tooltip />\n <Legend\n fontStyle={\"0.5rem\"}\n formatter={(value) => (\n <span className=\"font-normal text-gray-600\"> {value} </span>\n )}\n />\n <Bar\n name=\"Household consumption (kWh)\"\n yAxisId=\"right\"\n dataKey=\"kWh\"\n barSize={10}\n // This is not part of the FlowerHub color scheme in tailwind.config\n // flowerblue-500 is too light and flowerblue-600 too dark\n // So we will use this until we have a suitable one in the color scheme\n fill=\"#78A7D3\"\n />\n <Line\n name=\"Monthly total (SEK)\"\n yAxisId=\"left\"\n type=\"linear\"\n dataKey=\"SEK\"\n stroke=\"#f472b6\"\n dot={false}\n strokeWidth={1}\n strokeDasharray=\"5 5\"\n />\n <Line\n name=\"Flower Hub revenue (SEK)\"\n yAxisId=\"left\"\n type=\"linear\"\n dataKey=\"flower\"\n stroke=\"#fb923c\"\n dot={false}\n strokeWidth={1}\n strokeDasharray=\"5 5\"\n />\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n );\n};\n","import { FC } from \"react\";\ninterface Props {\n header: string;\n subHeader?: string;\n}\n\nconst MaintenanceState: FC<Props> = ({ header, subHeader }) => (\n <div className=\"text-center\">\n <svg\n className=\"mx-auto h-12 w-12 text-gray-400\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z\"\n />\n </svg>\n <h3 className=\"mt-2 text-sm font-medium text-gray-900\">{header}</h3>\n {subHeader && <p className=\"mt-1 text-sm text-gray-500\">{subHeader}</p>}\n </div>\n);\n\nexport default MaintenanceState;\n","import { ChartBarIcon } from \"@heroicons/react/24/outline\";\nimport { FC } from \"react\";\nimport { DesktopVersion } from \"./DesktopVersion\";\nimport { MobileVersion } from \"./MobileVersion\";\nimport MaintenanceState from \"components/systemNotification/MaintenanceState\";\nimport {\n useConsumption,\n useInvoices,\n} from \"api/assetOwner/assetOwner.endpoints\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { getChartData } from \"../../helpers/assetOwnerDashboard\";\nimport { isMobile } from \"react-device-detect\";\nimport { Shadow } from \"../Shadow\";\n\ninterface Props {\n assetOwnerId: number;\n hasSystemNotification?: boolean;\n hasShadow?: boolean;\n}\n\nexport const Consumption: FC<Props> = ({\n assetOwnerId,\n hasSystemNotification = false,\n hasShadow = true,\n}) => {\n const { t } = useTranslation();\n\n // Invoices\n const {\n data: invoices,\n isLoading: isLoadingInvoices,\n isError: isErrorInvoices,\n } = useInvoices(assetOwnerId);\n\n // Consumption Data\n const {\n data: consumption,\n isLoading: isLoadingConsumption,\n isError: isErrorConsumption,\n } = useConsumption(assetOwnerId);\n\n // const chartData = getChartData(consumptionData, invoices);\n const chartData = getChartData(consumption, invoices);\n\n if (hasSystemNotification)\n return <MaintenanceState header={t(`maintenance.Maintenance ongoing`)} />;\n\n const isLoading = isLoadingInvoices || isLoadingConsumption;\n const isError = isErrorInvoices || isErrorConsumption;\n\n const renderConsumptionPlaceholder = () => {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && chartData.length === 0}\n icon={<ChartBarIcon />}\n errorMessage={t(`graph.error`)}\n emptyDataMessage={t(`graph.Nothing to display`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n };\n\n if (isLoading || isError || chartData.length === 0) {\n return renderConsumptionPlaceholder();\n }\n\n return (\n <>\n {hasShadow ? (\n <Shadow>\n {isMobile ? (\n <MobileVersion data={chartData} />\n ) : (\n <DesktopVersion data={chartData} />\n )}\n </Shadow>\n ) : (\n <>\n {isMobile ? (\n <MobileVersion data={chartData} />\n ) : (\n <DesktopVersion data={chartData} />\n )}\n </>\n )}\n </>\n );\n};\n","import { FC } from \"react\";\nimport { Link, LinkProps } from \"react-router-dom\";\n\nexport const FlowerLink: FC<\n LinkProps & React.RefAttributes<HTMLAnchorElement>\n> = ({ children, ...rest }) => (\n <Link\n className=\"text-sm font-medium text-flowerSky-800 hover:text-flowerSky-500\"\n {...rest}\n >\n {children}\n </Link>\n);\n","import { Item, Label, List, Value } from \"components/descriptionList\";\nimport React, { FC } from \"react\";\nimport { FlowerLink } from \"../FlowerLink\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { useTranslation } from \"react-i18next\";\nimport { useAssetRevenue } from \"api/asset/asset.endpoints\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport { DocumentTextIcon } from \"@heroicons/react/24/outline\";\nimport { Shadow } from \"../Shadow\";\n\ninterface Props {\n assetId?: number;\n bessCompensationStartDate?: string;\n showLink?: boolean;\n}\n\nexport const FlowerRevenue: FC<Props> = ({\n assetId,\n bessCompensationStartDate,\n showLink = true,\n}) => {\n const { t } = useTranslation();\n\n // Get asset\n const { data: asset, isLoading, isError } = useAssetRevenue(assetId);\n\n const compensationStartText = bessCompensationStartDate\n ? new Date(bessCompensationStartDate).toLocaleString(\"default\", {\n year: \"numeric\",\n month: \"long\",\n })\n : t(\"flowerRevenue.Start date unavailable\");\n\n const renderFlowerRevenuePlaceholder = () => {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && !asset}\n icon={<DocumentTextIcon />}\n errorMessage={t(`graph.error`)}\n emptyDataMessage={t(`header.noFlowerHub`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n };\n\n if (isLoading || !asset || isError) {\n return renderFlowerRevenuePlaceholder();\n }\n\n return (\n <div className=\"overflow-auto\">\n <Shadow>\n <List>\n <Item>\n <Label>\n {t(\"flowerRevenue.Model compensation\")} (\n {asset.assetModel.manufacturer} {asset.assetModel.name})\n </Label>\n <Value appendix=\"SEK/kW/month\">\n {asset.assetModel.compensationPerKW}\n </Value>\n </Item>\n <Item>\n <Label\n tooltipMessage={t(\n \"flowerRevenue.Power and energy capacity difference\",\n )}\n >\n {t(\"flowerRevenue.Available power\")}\n </Label>\n <Value appendix=\"kW\">{asset.minAvailablePower}</Value>\n </Item>\n <Item>\n <Label>{t(\"flowerRevenue.Monthly revenue\")}</Label>\n <Value appendix=\"SEK/month\">{asset.compensation} </Value>\n </Item>\n <Item>\n <Label\n tooltipMessage={t(\n \"flowerRevenue.Date from which Flower Hub is installed\",\n )}\n >\n {t(\"flowerRevenue.Starting from\")}\n </Label>\n <Value>{compensationStartText}</Value>\n </Item>\n </List>\n </Shadow>\n\n <div className=\"sm:grid sm:grid-cols-1 sm:gap-4 px-2 md:px-6 mb-6 md:mt-8 mt-10 text-sm font-normal text-gray-500\">\n <div className=\"my-3 sm:my-0\">\n {t(\n \"flowerRevenue.The revenue for a certain month is part of the invoice for that month\",\n )}\n </div>\n <div className=\"my-3 sm:my-0\">\n {t(\"flowerRevenue.An invoice is sent out in the following month\")}\n </div>\n {showLink && (\n <div className=\"my-3 sm:my-0\">\n {t(\"flowerRevenue.Your can find your invoices in the\")}{\" \"}\n <FlowerLink to={`${RouteUrl.App}/${RouteUrl.InvoiceList}`}>\n {t(\"flowerRevenue.invoices tab\")}\n </FlowerLink>\n </div>\n )}\n </div>\n </div>\n );\n};\n","import { SystemNotification } from \"api/system-notification/systemNotification.type\";\nimport { FC } from \"react\";\n\ninterface Props {\n notification: SystemNotification;\n}\n\nexport const SystemNotificationInfo: FC<Props> = ({ notification }) => (\n <div\n key={notification.id}\n className=\"relative my-3 flex items-center space-x-3 rounded-lg border border-red-500 bg-white px-6 py-5 shadow-sm\"\n >\n <div className=\"flex-shrink-0\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"#ef4444\"\n className=\"w-6 h-6\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z\"\n />\n </svg>\n </div>\n <div className=\"min-w-0 flex-1\">\n <a href=\"#\" className=\"focus:outline-none\">\n <span className=\"absolute inset-0\" aria-hidden=\"true\" />\n <p className=\"text-sm text-gray-500\">{notification.message}</p>\n </a>\n </div>\n </div>\n);\n","import { useNotification } from \"hooks/useNotification\";\nimport api from \"../axiosInstance\";\nimport { CreateSystemNotificationDTO } from \"./systemNotification.dto\";\nimport { SystemNotification } from \"./systemNotification.type\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\n\nconst ENDPOINT = \"/system-notification\";\n\nexport enum SystemNotificationQueryKeys {\n GetAll = \"system-notification\",\n GetActiveZavann = \"active-zavann\",\n GetActiveFlower = \"active-flower\",\n}\n\nexport const useSystemNotifications = () =>\n useQuery({\n queryKey: [SystemNotificationQueryKeys.GetAll],\n queryFn: async (): Promise<SystemNotification[]> =>\n (await api.get(ENDPOINT)).data,\n });\n\nexport const useActiveZavannSystemNotifications = () =>\n useQuery({\n queryKey: [SystemNotificationQueryKeys.GetActiveZavann],\n queryFn: async (): Promise<SystemNotification> =>\n (\n await api.get(\n `${ENDPOINT}/${SystemNotificationQueryKeys.GetActiveZavann}`,\n )\n ).data,\n });\n\nexport const useActiveZavannSystemNotificationsByCode = (code: string) =>\n useQuery({\n queryKey: [SystemNotificationQueryKeys.GetActiveZavann, code],\n queryFn: async (): Promise<SystemNotification> =>\n (\n await api.get(\n `${ENDPOINT}/${SystemNotificationQueryKeys.GetActiveZavann}/${code}`,\n )\n ).data,\n });\n\nexport const useCreateSystemNotification = (options = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreateSystemNotificationDTO,\n ): Promise<SystemNotification> => (await api.post(ENDPOINT, payload)).data,\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [SystemNotificationQueryKeys.GetAll],\n });\n notification.info(`System notification created`);\n },\n onError: () => {\n notification.error();\n },\n ...options,\n });\n};\n\nexport const useDeleteSystemNotification = (settings = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (id: number) => await api.delete(`${ENDPOINT}/${id}`),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [SystemNotificationQueryKeys.GetAll],\n });\n notification.info(`System notification deleted`);\n },\n onError: () => {\n notification.error(\"Something went wrong, please try again\");\n },\n ...settings,\n });\n};\n\nexport const useActiveFlowerSystemNotifications = () =>\n useQuery({\n queryKey: [SystemNotificationQueryKeys.GetActiveFlower],\n queryFn: async (): Promise<SystemNotification> =>\n (\n await api.get(\n `${ENDPOINT}/${SystemNotificationQueryKeys.GetActiveFlower}`,\n )\n ).data,\n });\n","import { classNames } from \"helpers/classNames\";\nimport { FC } from \"react\";\n\ninterface FlowerHubStatProps {\n name: string;\n data?: string;\n list?: string[];\n isPlaceholder?: boolean;\n}\nexport const FlowerHubStatisticContainer: FC<FlowerHubStatProps> = ({\n name,\n data,\n list = [],\n isPlaceholder = false,\n}) => {\n return (\n <div\n key={name}\n className={classNames(\n \"flex items-baseline flex-wrap justify-between gap-y-2 gap-x-4 border-gray-900/4 px-8 py-10 sm:px-8 xl:px-8\",\n )}\n >\n <dt className=\"text-sm font-medium leading-6 text-gray-500\">{name}</dt>\n {data ? (\n <DataDisplay data={data} isPlaceholder={isPlaceholder} />\n ) : list.length > 0 ? (\n <ListDataDisplay list={list} />\n ) : (\n <NoDataDisplay />\n )}\n </div>\n );\n};\n\nconst DataDisplay: FC<{ data: string; isPlaceholder: boolean }> = ({\n data,\n isPlaceholder,\n}) => (\n <dd\n className={classNames(\n isPlaceholder ? \"text-sm text-gray-600\" : \"text-xl text-gray-900\",\n \"w-full flex-none font-medium leading-10 tracking-tight break-all\",\n )}\n >\n {data}\n </dd>\n);\n\nconst ListDataDisplay: FC<{ list: string[] }> = ({ list }) => (\n <dd className=\"w-full flex-none text-xl font-medium leading-10 tracking-tight text-gray-900\">\n {list.map((item) => (\n <div\n key={item}\n className=\"flex items-center justify-end gap-x-2 sm:justify-start\"\n >\n <div className=\"flex-none rounded-full p-1 text-green-400 bg-green-400/10\">\n <div className=\"h-1.5 w-1.5 rounded-full bg-current\" />\n </div>\n <div className=\"hidden text-xl sm:block\">{item}</div>\n </div>\n ))}\n </dd>\n);\n\nconst NoDataDisplay: FC = () => <dd className=\"w-full flex-none\">{\"-\"}</dd>;\n","import { useAssetStatistics } from \"api/asset/asset.endpoints\";\nimport { FC } from \"react\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { useTranslation } from \"react-i18next\";\nimport { ExclamationCircleIcon } from \"@heroicons/react/24/outline\";\nimport { FlowerHubStatisticContainer } from \"./FlowerHubStatisticContainer\";\n\ninterface Props {\n assetId: number;\n}\n\nexport const FlowerHubStatisticsFlowerVersion: FC<Props> = ({ assetId }) => {\n const { t } = useTranslation();\n const { data, isError, isLoading } = useAssetStatistics(assetId);\n\n return (\n <div className=\"flex flex-col items-stretch justify-center mb-8 rounded-lg border border-gray-100 bg-white shadow min-h-40 p-2\">\n {isLoading || !data || isError ? (\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && !data}\n icon={<ExclamationCircleIcon />}\n errorMessage={t(\n `flowerHubStatistics.UnableToLoadFlowerHubStatistics`,\n )}\n />\n ) : (\n <dl className=\"grid grid-cols-1 lg:grid-cols-4 lg:divide-x divide-y sm:divide-y lg:divide-y-0 lg:px-2 xl:px-0\">\n <FlowerHubStatisticContainer\n name={t(`flowerHubStatistics.Serial number`)}\n data={data?.serialNumber}\n />\n <FlowerHubStatisticContainer\n name={t(`flowerHubStatistics.Prequalification group`)}\n data={data?.prequalificationGroupName}\n />\n <FlowerHubStatisticContainer\n name={t(`flowerHubStatistics.Market approvals`)}\n list={data?.marketApprovals}\n />\n <FlowerHubStatisticContainer\n name={t(`flowerHubStatistics.Asset control`)}\n data={data?.assetControlStatus}\n />\n </dl>\n )}\n </div>\n );\n};\n","import {\n GetComponentStatusItemResponseDTO,\n GetFlowerHubResponseDTO,\n} from \"./flowerHub.dto\";\nimport api from \"../axiosInstance\";\nimport { useQuery } from \"@tanstack/react-query\";\nconst ENDPOINT = \"/flower-hub\";\n\nexport enum FlowerHubQueryKeys {\n Get = \"get-flower-hub\",\n GetComponents = \"get-components\",\n}\n\nexport const useFlowerHub = (serialNumber?: string) => {\n return useQuery({\n queryKey: [FlowerHubQueryKeys.Get, serialNumber],\n queryFn: async (): Promise<GetFlowerHubResponseDTO> =>\n (await api.get(`${ENDPOINT}/${serialNumber}`)).data,\n enabled: !!serialNumber,\n refetchInterval: 30000,\n });\n};\n\nexport const useFlowerHubComponents = (serialNumber: string) => {\n return useQuery({\n queryKey: [FlowerHubQueryKeys.GetComponents, serialNumber],\n queryFn: async (): Promise<GetComponentStatusItemResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/components/${serialNumber}`)).data,\n });\n};\n","import CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Panel } from \"components/Panel\";\nimport { PresentationChartLineIcon } from \"@heroicons/react/24/outline\";\nimport { useFlowerHubComponents } from \"api/flowerHub/flowerHub.endpoints\";\n\ninterface Props {\n serialNumber: string;\n}\n\nexport const FlowerHubComponents: FC<Props> = ({ serialNumber }) => {\n const { t } = useTranslation();\n\n const { data, isError, isLoading } = useFlowerHubComponents(serialNumber);\n\n return (\n <Panel\n header={t(`flowerHubComponents.Title`)}\n infoText={t(`flowerHubComponents.Info`)}\n >\n <nav className=\"mx-auto max-w-7xl\" aria-label=\"Progress\">\n {isLoading || data?.length === 0 || isError ? (\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && data?.length === 0}\n icon={<PresentationChartLineIcon />}\n errorMessage={t(`flowerHubComponents.UnableToLoad`)}\n emptyDataMessage={t(`flowerHubComponents.NoComponents`)}\n />\n ) : (\n <dl className=\"grid grid-cols-1 overflow-hidden md:grid-cols-4\">\n {data?.map((component) => (\n <DisplayItem\n key={component.name}\n label={t([\n `flowerHubComponents.components.${component.name}`,\n `flowerHubComponents.components.fallback`,\n ])}\n status={component.status}\n />\n ))}\n </dl>\n )}\n </nav>\n </Panel>\n );\n};\n\ninterface DisplayItemProp {\n label: string;\n status: React.ReactNode;\n}\n\nconst DisplayItem: FC<DisplayItemProp> = ({ label, status }) => (\n <div key={label} className=\"px-2 py-3 sm:p-3 m-3 rounded-lg bg-white shadow\">\n <dt className=\"text-gray-500 text-sm font-medium\">{label}</dt>\n <dd className=\"mt-2 flex items-baseline justify-between md:block lg:flex\">\n <div className=\"flex items-baseline text-xs font-semibold tracking-tight text-gray-900\">\n {status ?? \"-\"}\n </div>\n </dd>\n </div>\n);\n","import { AssetInformation } from \"components/installationFlow/steps/AssetInformationStep\";\nimport { Fuse } from \"./bessTypes\";\nimport {\n BatteryCapacitiesDTO,\n BatteryWithCapacitiesDTO,\n GetAllManufacturerWithBatteriesResponseDTO,\n GetAllManufacturerWithInvertersResponseDTO,\n InverterCapacityDTO,\n InverterWithCapacitiesDTO,\n} from \"api/assetManufacturer/assetManufacturer.dto\";\n\nexport enum AssetStep {\n CONNECT_ETH = 1,\n ASSET_INFORMATION = 2,\n SERIAL_NUMBER = 3,\n META_DATA_CONFIRMATION = 4,\n POWER_CONFIRMATION = 5,\n FINISHING = 6,\n}\n\nexport const getEmptyAssetInformation = (): AssetInformation => {\n return {\n inverterManufacturer: {\n id: 0,\n name: \"\",\n inverterModels: [],\n },\n inverterModel: {\n id: 0,\n name: \"\",\n powerCapacities: [],\n },\n inverterCapacity: {\n id: 0,\n power: 0,\n },\n batteryManufacturer: {\n id: 0,\n name: \"\",\n batteryModels: [],\n },\n batteryModel: {\n id: 0,\n name: \"\",\n capacities: [],\n },\n batteryCapacity: {\n id: 0,\n energy: 0,\n power: 0,\n },\n };\n};\n\nexport const getEmptyInverterManufacturer =\n (): GetAllManufacturerWithInvertersResponseDTO => {\n return {\n id: 0,\n name: \"\",\n inverterModels: [],\n };\n };\n\nexport const getEmptyInverterModel = (): InverterWithCapacitiesDTO => {\n return {\n id: 0,\n name: \"\",\n powerCapacities: [],\n };\n};\n\nexport const getEmptyInverterCapacity = (): InverterCapacityDTO => {\n return {\n id: 0,\n power: 0,\n };\n};\n\nexport const getEmptyBatteryManufacturer =\n (): GetAllManufacturerWithBatteriesResponseDTO => {\n return {\n id: 0,\n name: \"\",\n batteryModels: [],\n };\n };\n\nexport const getEmptyBatteryModel = (): BatteryWithCapacitiesDTO => {\n return {\n id: 0,\n name: \"\",\n capacities: [],\n };\n};\n\nexport const getEmptyBatteryCapacities = (): BatteryCapacitiesDTO => {\n return {\n id: 0,\n energy: 0,\n power: 0,\n };\n};\n\nexport const isAssetInformationComplete = (\n assetInformation: AssetInformation,\n fuse?: Fuse,\n) => {\n return (\n assetInformation.batteryCapacity.id &&\n assetInformation.inverterCapacity.id &&\n fuse?.ampere\n );\n};\n\nexport const isSerialNumberComplete = (\n addAssetSerialNumber: string | undefined,\n) => !!addAssetSerialNumber && addAssetSerialNumber.length === 7;\n","export interface Fuse {\n ampere: number;\n}\n\nexport const fuses: Fuse[] = [\n {\n ampere: 16,\n },\n {\n ampere: 20,\n },\n {\n ampere: 25,\n },\n {\n ampere: 35,\n },\n {\n ampere: 50,\n },\n {\n ampere: 63,\n },\n];\n","import { FC } from \"react\";\n\nexport const ActionButton: FC<{\n onClick: () => void;\n label: string;\n variant: \"black\" | \"primary\";\n disabled?: boolean;\n}> = ({ onClick, label, variant, disabled = false }) => {\n const baseClasses =\n \"py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-600\";\n const variants = {\n black: \"bg-black text-white hover:bg-gray-900\",\n primary:\n \"bg-flowerSkyVivid-500 text-white hover:bg-gray-900 disabled:opacity-75 disabled:bg-gray-600 disabled:cursor-not-allowed\",\n };\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n className={`${baseClasses} ${variants[variant]}`}\n >\n {label}\n </button>\n );\n};\n","import api from \"../axiosInstance\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport {\n CreateAssetManufacturerRequestDTO,\n CreateAssetManufacturerResponseDTO,\n GetAllManufacturerResponseDTO,\n GetAllManufacturerWithAssetsResponseDTO,\n GetAllManufacturerWithBatteriesResponseDTO,\n GetAllManufacturerWithInvertersResponseDTO,\n GetInverterModelListResponseDTO,\n UpdateAssetManufacturerRequestDTO,\n UpdateAssetManufacturerResponseDTO,\n} from \"./assetManufacturer.dto\";\nimport { useNotification } from \"hooks/useNotification\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\n\nconst ENDPOINT = \"/asset-manufacturer\";\n\nexport enum AssetManufacturerQueryKeys {\n GetAllWithInverters = \"asset-manufacturer-get-all-with-inverters\",\n GetAllWithBatteries = \"asset-manufacturer-get-all-with-batteries\",\n GetAllWithAssets = \"asset-manufacturer-get-all-with-asset\",\n GetAll = \"asset-manufacturer-get-all\",\n GetInverterList = \"asset-manufacturer-get-inverter-list\",\n}\n\nexport const useAssetManufacturers = (enabled: boolean) =>\n useQuery({\n queryKey: [AssetManufacturerQueryKeys.GetAll],\n queryFn: async (): Promise<GetAllManufacturerResponseDTO[]> =>\n (await api.get(`${ENDPOINT}`)).data,\n enabled,\n });\n\nexport const useAssetManufacturersWithAssets = () =>\n useQuery({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n queryFn: async (): Promise<GetAllManufacturerWithAssetsResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/configuration`)).data,\n });\n\nexport const useAssetManufacturersWithInverters = () =>\n useQuery({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithInverters],\n queryFn: async (): Promise<GetAllManufacturerWithInvertersResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/inverter-models`)).data,\n });\n\nexport const useAssetManufacturersWithCompatibleBatteries = (\n inverterId: number,\n) =>\n useQuery({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithBatteries, inverterId],\n queryFn: async (): Promise<GetAllManufacturerWithBatteriesResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/battery-models/${inverterId}`)).data,\n enabled: !!inverterId,\n });\n\nexport const useInverterList = () =>\n useQuery({\n queryKey: [AssetManufacturerQueryKeys.GetInverterList],\n queryFn: async (): Promise<GetInverterModelListResponseDTO[]> =>\n (await api.get(`${ENDPOINT}/inverter-list`)).data,\n });\n\nexport const useCreateAssetManufacturer = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: CreateAssetManufacturerRequestDTO,\n ): Promise<CreateAssetManufacturerResponseDTO> =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: (data: CreateAssetManufacturerResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAll],\n });\n notification.info(`Asset manufacturer ${data.name} created`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useUpdateAssetManufacturer = (id: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: UpdateAssetManufacturerRequestDTO,\n ): Promise<UpdateAssetManufacturerResponseDTO> =>\n (await api.put(`${ENDPOINT}/${id}`, payload)).data,\n onSuccess: (data: UpdateAssetManufacturerResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAll],\n });\n notification.info(`Asset manufacturer ${data.name} updated`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useDeleteAssetManufacturer = () => {\n const queryClient = useQueryClient();\n const notification = useNotification();\n\n return useMutation({\n mutationFn: async (id: number) => await api.delete(`${ENDPOINT}/${id}`),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAll],\n });\n notification.info(`Asset manufacturer deleted`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n","import { FC } from \"react\";\nimport { fuses, Fuse } from \"components/installationFlow/bessTypes\";\nimport { InformationCircleIcon } from \"@heroicons/react/20/solid\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n getEmptyAssetInformation,\n getEmptyBatteryCapacities,\n getEmptyBatteryManufacturer,\n getEmptyBatteryModel,\n getEmptyInverterCapacity,\n getEmptyInverterManufacturer,\n getEmptyInverterModel,\n isAssetInformationComplete,\n} from \"../installFlowerHub.helpers\";\nimport { ActionButton } from \"../../buttons/ActionButton\";\nimport {\n useAssetManufacturersWithCompatibleBatteries,\n useAssetManufacturersWithInverters,\n} from \"api/assetManufacturer/assetManufacturer.endpoints\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { isEmptyArray } from \"helpers/array\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport {\n BatteryCapacitiesDTO,\n BatteryWithCapacitiesDTO,\n GetAllManufacturerWithBatteriesResponseDTO,\n GetAllManufacturerWithInvertersResponseDTO,\n InverterCapacityDTO,\n InverterWithCapacitiesDTO,\n} from \"api/assetManufacturer/assetManufacturer.dto\";\nimport { ExclamationTriangleIcon } from \"@heroicons/react/24/outline\";\n\nexport interface AssetInformation {\n inverterManufacturer: GetAllManufacturerWithInvertersResponseDTO;\n inverterModel: InverterWithCapacitiesDTO;\n inverterCapacity: InverterCapacityDTO;\n batteryManufacturer: GetAllManufacturerWithBatteriesResponseDTO;\n batteryModel: BatteryWithCapacitiesDTO;\n batteryCapacity: BatteryCapacitiesDTO;\n}\n\ntype Props = {\n changeStep: (step: number) => void;\n assetInformation: AssetInformation;\n setAssetInformation: (assetInformation: AssetInformation) => void;\n fuse?: Fuse;\n setFuse: (fuse: Fuse) => void;\n};\n\nexport const AssetInformationStep: FC<Props> = ({\n changeStep,\n assetInformation,\n setAssetInformation,\n fuse,\n setFuse,\n}) => {\n const { t } = useTranslation();\n\n const {\n data: inverterManufacturerData,\n isLoading: inverterManufacturerIsLoading,\n isError: inverterManufacturerIsError,\n } = useAssetManufacturersWithInverters();\n\n const {\n data: batteryManufacturerData,\n isLoading: isLoadingBattery,\n isError: batteryManufacturerIsError,\n } = useAssetManufacturersWithCompatibleBatteries(\n assetInformation.inverterModel?.id,\n );\n\n if (\n inverterManufacturerIsLoading ||\n inverterManufacturerIsError ||\n inverterManufacturerData === undefined ||\n isEmptyArray(inverterManufacturerData)\n ) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={\n inverterManufacturerIsError ||\n inverterManufacturerData === undefined\n }\n isLoading={inverterManufacturerIsLoading}\n isEmpty={isEmptyArray(inverterManufacturerData)}\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`batteryOverview.Error`)}\n emptyDataMessage={t(`batteryOverview.Empty`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n }\n\n const showErrorMessage =\n assetInformation.inverterModel.id !== 0 &&\n !isLoadingBattery &&\n (batteryManufacturerData === undefined ||\n isEmptyArray(batteryManufacturerData) ||\n batteryManufacturerIsError);\n\n return (\n <div className=\"space-y-8\">\n <h2 className=\"text-2xl font-bold text-center\">\n {t(\"batteryOverview.Property information\")}\n </h2>\n\n <div className=\"space-y-6\">\n <AssetInformationStepDropdown\n label={t(`batteryOverview.MainFuseSize`)}\n items={[\n {\n label: t(`batteryOverview.PickAFuseSize`),\n value: null,\n key: \"None\",\n },\n ...fuses.map((item) => ({\n label: \"\" + item.ampere,\n value: item,\n key: \"\" + item.ampere,\n })),\n ]}\n selectedItem={\n fuse\n ? {\n label: \"\" + fuse.ampere,\n value: fuse,\n key: \"\" + fuse.ampere,\n }\n : {\n label: t(`batteryOverview.PickAFuseSize`),\n value: null,\n key: \"None\",\n }\n }\n onItemSelect={(item) => setFuse(item.value)}\n />\n <h3 className=\"text-xl font-semibold text-flowerblue-700\">\n {t(`batteryOverview.InverterInformation`)}\n </h3>\n <AssetInformationStepDropdown\n label={t(`batteryOverview.InverterManufacturer`)}\n items={[\n {\n label: t(`batteryOverview.PickInverterManufacturer`),\n value: getEmptyInverterManufacturer(),\n key: \"selectInverterManufacturer\",\n },\n ...inverterManufacturerData.map((manufacturer) => ({\n label: manufacturer.name,\n value: manufacturer,\n key: \"\" + manufacturer.id,\n })),\n ]}\n selectedItem={\n assetInformation.inverterManufacturer\n ? {\n label: assetInformation.inverterManufacturer.name,\n value: assetInformation.inverterManufacturer,\n key: \"\" + assetInformation.inverterManufacturer.id,\n }\n : {\n label: t(`batteryOverview.PickInverterManufacturer`),\n value: getEmptyInverterManufacturer(),\n key: \"selectInverterManufacturer\",\n }\n }\n onItemSelect={(item) => {\n setAssetInformation({\n ...getEmptyAssetInformation(),\n inverterManufacturer: item.value,\n });\n }}\n />\n <AssetInformationStepDropdown\n label={t(`batteryOverview.InverterModel`)}\n items={[\n {\n label: t(`batteryOverview.PickInverterModel`),\n value: getEmptyInverterModel(),\n key: \"selectInverterModel\",\n },\n ...(assetInformation.inverterManufacturer?.inverterModels.map(\n (inverterModel) => ({\n label: inverterModel.name,\n value: inverterModel,\n key: \"\" + inverterModel.id,\n }),\n ) ?? []),\n ]}\n isDisabled={assetInformation.inverterManufacturer.id === 0}\n selectedItem={\n assetInformation.inverterModel\n ? {\n label: assetInformation.inverterModel.name,\n value: assetInformation.inverterModel,\n key: \"\" + assetInformation.inverterModel.id,\n }\n : {\n label: t(`batteryOverview.PickInverterModel`),\n value: getEmptyInverterModel(),\n key: \"selectInverterModel\",\n }\n }\n onItemSelect={(item) => {\n setAssetInformation({\n ...assetInformation,\n inverterModel: item.value,\n inverterCapacity: { id: 0, power: 0 },\n batteryManufacturer: { id: 0, name: \"\", batteryModels: [] },\n batteryModel: { id: 0, name: \"\", capacities: [] },\n batteryCapacity: { id: 0, energy: 0, power: 0 },\n });\n }}\n />\n <AssetInformationStepDropdown\n label={t(`batteryOverview.InverterPowerCapacityKw`)}\n items={[\n {\n label: t(`batteryOverview.PickInverterCapacity`),\n value: getEmptyInverterCapacity(),\n key: \"selectInverterCapacity\",\n },\n ...(assetInformation.inverterModel?.powerCapacities.map(\n (powerCapacity) => ({\n label: \"\" + powerCapacity.power,\n value: powerCapacity,\n key: \"\" + powerCapacity.id,\n }),\n ) ?? []),\n ]}\n isDisabled={assetInformation.inverterModel.id === 0}\n selectedItem={\n assetInformation.inverterCapacity\n ? {\n label: \"\" + assetInformation.inverterCapacity.power,\n value: assetInformation.inverterCapacity,\n key: \"\" + assetInformation.inverterCapacity.id,\n }\n : {\n label: t(`batteryOverview.PickInverterCapacity`),\n value: getEmptyInverterCapacity(),\n key: \"selectInverterCapacity\",\n }\n }\n onItemSelect={(item) => {\n setAssetInformation({\n ...assetInformation,\n inverterCapacity: item.value,\n });\n }}\n />\n <h3 className=\"text-xl font-semibold text-flowerblue-700\">\n {t(`batteryOverview.BatteryInformation`)}\n </h3>\n {showErrorMessage && (\n <div className=\"flex mt-2 gap-2 md:gap-1\">\n <div className=\"flex-shrink-0\">\n <ExclamationTriangleIcon\n aria-hidden=\"true\"\n className=\"h-5 w-5 text-flowerRed-500\"\n />\n </div>\n <span className=\"text-flowerRed-500\">\n {t(`batteryOverview.ErrorBattery`)}\n </span>\n </div>\n )}\n <AssetInformationStepDropdown\n label={t(`batteryOverview.BatteryManufacturer`)}\n items={[\n {\n label: t(`batteryOverview.PickBatteryManufacturer`),\n value: getEmptyBatteryManufacturer(),\n key: \"selectBatteryManufacturer\",\n },\n\n ...(batteryManufacturerData ?? []).map((manufacturer) => ({\n label: manufacturer.name,\n value: manufacturer,\n key: \"\" + manufacturer.id,\n })),\n ]}\n isDisabled={assetInformation.inverterModel.id === 0}\n selectedItem={\n assetInformation.batteryManufacturer\n ? {\n label: assetInformation.batteryManufacturer.name,\n value: assetInformation.batteryManufacturer,\n key: \"\" + assetInformation.batteryManufacturer.id,\n }\n : {\n label: t(`batteryOverview.PickBatteryManufacturer`),\n value: getEmptyBatteryManufacturer(),\n key: \"selectBatteryManufacturer\",\n }\n }\n onItemSelect={(item) => {\n setAssetInformation({\n ...assetInformation,\n batteryManufacturer: item.value,\n batteryModel: { id: 0, name: \"\", capacities: [] },\n batteryCapacity: { id: 0, energy: 0, power: 0 },\n });\n }}\n />\n <AssetInformationStepDropdown\n label={t(`batteryOverview.BatteryModel`)}\n items={[\n {\n label: t(`batteryOverview.PickBatteryModel`),\n value: getEmptyBatteryModel(),\n key: \"selectBatteryModel\",\n },\n ...(assetInformation.batteryManufacturer?.batteryModels.map(\n (batteryModel) => ({\n label: batteryModel.name,\n value: batteryModel,\n key: \"\" + batteryModel.id,\n }),\n ) ?? []),\n ]}\n isDisabled={assetInformation.batteryManufacturer.id === 0}\n selectedItem={\n assetInformation.batteryModel\n ? {\n label: assetInformation.batteryModel.name,\n value: assetInformation.batteryModel,\n key: \"\" + assetInformation.batteryModel.id,\n }\n : {\n label: t(`batteryOverview.PickBatteryModel`),\n value: getEmptyBatteryModel(),\n key: \"selectBatteryModel\",\n }\n }\n onItemSelect={(item) => {\n setAssetInformation({\n ...assetInformation,\n batteryModel: item.value,\n batteryCapacity: { id: 0, energy: 0, power: 0 },\n });\n }}\n />\n <AssetInformationStepDropdown\n label={t(`batteryOverview.BatteryEnergyCapacity`)}\n items={[\n {\n label: t(`batteryOverview.PickBatteryEnergyCapacity`),\n value: getEmptyBatteryCapacities(),\n key: \"selectBatteryCapacity\",\n },\n ...(assetInformation.batteryModel?.capacities.map((capacity) => ({\n label: \"\" + capacity.energy,\n value: capacity,\n key: \"\" + capacity.id,\n })) ?? []),\n ]}\n isDisabled={assetInformation.batteryModel.id === 0}\n selectedItem={\n assetInformation.batteryCapacity\n ? {\n label: \"\" + assetInformation.batteryCapacity.energy,\n value: assetInformation.batteryCapacity,\n key: \"\" + assetInformation.batteryCapacity.id,\n }\n : {\n label: t(`batteryOverview.PickBatteryEnergyCapacity`),\n value: getEmptyBatteryCapacities(),\n key: \"selectBatteryCapacity\",\n }\n }\n onItemSelect={(item) => {\n setAssetInformation({\n ...assetInformation,\n batteryCapacity: item.value,\n });\n }}\n />\n {/* Static power capacity info */}\n <StaticInfo\n label={t(\"batteryOverview.BatteryPowerCapacity\")}\n value={assetInformation.batteryCapacity.power}\n helpText={t(\n \"batteryOverview.Pre-defined, depends on above configuration\",\n )}\n />\n </div>\n\n <div className=\"flex justify-between\">\n <ActionButton\n onClick={() => changeStep(1)}\n label={t(\"Back\")}\n variant=\"black\"\n />\n <ActionButton\n onClick={() => changeStep(3)}\n label={t(\"Next\")}\n variant=\"primary\"\n disabled={!isAssetInformationComplete(assetInformation, fuse)}\n />\n </div>\n </div>\n );\n};\n\ninterface AssetInformationStepDropdownItem {\n //[LINT_TODO] This will fix with asset model configuration changes\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n key: string;\n label: string;\n}\ninterface AssetInformationStepDropdownProps {\n label: string;\n items: AssetInformationStepDropdownItem[];\n selectedItem: AssetInformationStepDropdownItem;\n onItemSelect: (item: AssetInformationStepDropdownItem) => void;\n isDisabled?: boolean;\n}\n\nconst AssetInformationStepDropdown: FC<AssetInformationStepDropdownProps> = ({\n label,\n items,\n selectedItem,\n onItemSelect,\n isDisabled,\n}) => {\n const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n const newItem = items.find((item) => item.key === e.target.value);\n selectedItem = newItem ? newItem : selectedItem;\n onItemSelect(selectedItem);\n };\n return (\n <div>\n <label className=\"block text-sm font-medium text-gray-700\">{label}</label>\n <select\n className=\"block w-3/4 text-base text-gray-800 border-gray-500 focus:outline-none focus:ring-flowerblue-600 focus:border-flowerblue-600 sm:text-sm rounded-md disabled:text-gray-400 disabled:border-gray-200\"\n value={selectedItem.key}\n onChange={handleChange}\n disabled={isDisabled}\n >\n {\n // We use key because you cannot have an object value in option\n items.map((item) => (\n <option key={item.key} value={item.key}>\n {item.label}\n </option>\n ))\n }\n </select>\n </div>\n );\n};\n\n// Static information display component\nconst StaticInfo: FC<{ label: string; value?: number; helpText: string }> = ({\n label,\n value,\n helpText,\n}) => (\n <div>\n <label className=\"block text-sm font-medium text-gray-700\">{label}</label>\n <input\n type=\"text\"\n className=\"mt-1 block rounded-md bg-gray-60 text-gray-400 border-gray-300 w-3/4\"\n disabled\n value={value ?? \"-\"}\n />\n <div className=\"flex items-center mt-1\">\n <InformationCircleIcon\n className=\"h-5 w-5 mr-1 text-blue-500\"\n aria-hidden=\"true\"\n />\n <p className=\"text-sm text-gray-600\">{helpText}</p>\n </div>\n </div>\n);\n","import { isMobile, isTablet, isIPad13 } from \"react-device-detect\";\n\nexport const getDeviceForMedia = () => {\n if (isTablet || isIPad13) return \"tablet\";\n else if (isMobile) return \"mobile\";\n else return \"desktop\";\n};\n","import { FC } from \"react\";\nimport { LightBulbIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { ActionButton } from \"../../buttons/ActionButton\";\nimport { cloudFrontDomainUrl } from \"constants/environment\";\nimport { getDeviceForMedia } from \"helpers/installationFlow\";\n\ntype Props = {\n changeStep: (step: number) => void;\n onCancel: () => void;\n};\n\nexport const ConnectedEthStep: FC<Props> = ({ changeStep, onCancel }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"space-y-8\">\n <span className=\"text-4xl font-normal leading-[105%]\">\n {t(\"Let's install the Flower Hub\")}\n </span>\n <div className=\"flex justify-center\">\n <img\n src={`${cloudFrontDomainUrl}/installation-flow/${getDeviceForMedia()}/initial-setup.jpg`}\n alt=\"Initial setup\"\n className=\"w-full lg:w-2/3\"\n />\n </div>\n\n <div className=\"flex justify-center\">\n <div className=\"text-base w-9/12 font-normal text-gray-600\">\n <ul className=\"list-disc pl-8 text-base text-gray-800 pt-2\">\n <span className=\"flex mb-4 text-base text-gray-800\">\n <LightBulbIcon className=\"h-5 w-5 mr-2\" aria-hidden=\"true\" />\n {t(\n `batteryOverview.Do not plug in the power cable yet We will tell you when to do so`,\n )}\n </span>\n <span className=\"flex mb-4 text-base text-gray-800\">\n <LightBulbIcon className=\"h-5 w-5 mr-2\" aria-hidden=\"true\" />\n {t(\n \"batteryOverview.Connect the Flower Hub with an Ethernet cable to the same router as the inverter\",\n )}\n </span>\n </ul>\n </div>\n </div>\n <div className=\"flex justify-between\">\n <ActionButton\n onClick={() => onCancel()}\n label={t(\"Cancel\")}\n variant=\"black\"\n />\n <ActionButton\n onClick={() => changeStep(2)}\n label={t(\"Next\")}\n variant=\"primary\"\n />\n </div>\n </div>\n );\n};\n","import { DIGIT_REGEX } from \"constants/regex\";\nimport { FC, ChangeEvent, KeyboardEvent, RefObject } from \"react\";\n\ninterface SerialNumberInputProps {\n value: string[];\n onChange: (e: ChangeEvent<HTMLInputElement>, index: number) => void;\n onKeyDown: (e: KeyboardEvent<HTMLInputElement>, index: number) => void;\n inputRefs: RefObject<(HTMLInputElement | null)[]>;\n error: string | null;\n}\n\nconst SerialNumberInput: FC<SerialNumberInputProps> = ({\n value,\n onChange,\n onKeyDown,\n inputRefs,\n error,\n}) => {\n return (\n <>\n <div className=\"mt-8 flex justify-center items-center space-x-4\">\n <p className=\"text-xl lg:text-3xl font-bold\">E</p>\n <div className=\"flex space-x-2\">\n {value.map((val, index) => (\n <input\n key={index}\n ref={(el) => inputRefs.current && (inputRefs.current[index] = el)}\n id={`serial-number-input-${index}`}\n type=\"text\"\n value={val}\n onChange={(e) => onChange(e, index)}\n onKeyDown={(e) => onKeyDown(e, index)}\n maxLength={1}\n className={`w-10 h-10 lg:w-12 lg:h-12 text-center text-sm lg:text-xl border rounded-md ${\n error && !value.every((v) => DIGIT_REGEX.test(v))\n ? \"border-red-500\"\n : \"border-gray-300\"\n }`}\n />\n ))}\n </div>\n </div>\n {error && <p className=\"mt-2 text-red-500 text-sm\">{error}</p>}\n </>\n );\n};\n\nexport default SerialNumberInput;\n","import {\n FC,\n useState,\n ChangeEvent,\n KeyboardEvent,\n useEffect,\n useRef,\n} from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport SerialNumberInput from \"components/input/SerialNumberInput\";\nimport { isSerialNumberComplete } from \"../installFlowerHub.helpers\";\nimport { ActionButton } from \"../../buttons/ActionButton\";\nimport { SINGLE_DIGIT_REGEX } from \"constants/regex\";\nimport { cloudFrontDomainUrl } from \"constants/environment\";\nimport { getDeviceForMedia } from \"helpers/installationFlow\";\n\ntype SerialNumberStepProps = {\n changeStep: (step: number) => void;\n serialNumber?: string;\n setSerialNumber: (serialNumber: string | undefined) => void;\n};\n\nexport const SerialNumberStep: FC<SerialNumberStepProps> = ({\n changeStep,\n serialNumber,\n setSerialNumber,\n}) => {\n const [inputCode, setInputCode] = useState<string[]>(new Array(6).fill(\"\"));\n const [error, setError] = useState<string | null>(null);\n const { t } = useTranslation();\n const inputRefs = useRef<(HTMLInputElement | null)[]>([]);\n\n useEffect(() => {\n if (serialNumber && serialNumber.length === 7) {\n const serialArray = serialNumber.slice(1, 7).split(\"\");\n setInputCode(serialArray);\n inputRefs.current[5]?.focus();\n } else {\n inputRefs.current[0]?.focus();\n }\n }, []);\n\n useEffect(() => {\n setSerialNumber(`E${inputCode.join(\"\")}`);\n }, [inputCode, setSerialNumber]);\n\n const handleInputChange = (\n e: ChangeEvent<HTMLInputElement>,\n index: number,\n ) => {\n const value = e.target.value;\n\n if (SINGLE_DIGIT_REGEX.test(value)) {\n const newCode = [...inputCode];\n newCode[index] = value;\n setInputCode(newCode);\n\n // Move focus to the next input\n if (value && index < inputCode.length - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n setError(null);\n }\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>, index: number) => {\n if (e.key === \"Backspace\" && !inputCode[index] && index > 0) {\n // Focus previous input on backspace if current is empty\n inputRefs.current[index - 1]?.focus();\n }\n };\n\n return (\n <div className=\"flex flex-col items-center space-y-8\">\n <img\n src={`${cloudFrontDomainUrl}/installation-flow/${getDeviceForMedia()}/check-serial-number.jpg`}\n alt=\"Check serial number\"\n className=\"w-2/3\"\n />\n\n <h2 className=\"text-xl font-bold text-center leading-tight\">\n {t(\"batteryOverview.Enter the Flower Hub serial number\")}\n </h2>\n <p className=\"text-base text-gray-800 text-center\">\n {t(\n \"batteryOverview.Look for the serial number on the back of the device below the Flower Hub logo\",\n )}\n </p>\n\n <SerialNumberInput\n value={inputCode}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n inputRefs={inputRefs}\n error={error}\n />\n\n <div className=\"flex justify-between w-full\">\n <ActionButton\n onClick={() => changeStep(2)}\n label={t(\"Back\")}\n variant=\"black\"\n />\n <ActionButton\n onClick={() => changeStep(4)}\n label={t(\"Next\")}\n variant=\"primary\"\n disabled={!isSerialNumberComplete(serialNumber)}\n />\n </div>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { CustomSvgComponentProps } from \"./FlowerHubIcon\";\n\nconst InverterIcon: FC<CustomSvgComponentProps> = ({ color = \"black\" }) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 450 450\"\n fill={color}\n stroke={color}\n strokeWidth=\"3\"\n >\n <path d=\"M403.6,65.2H96.4c-10.59,0-19.2,8.61-19.2,19.2v292.8c0,10.59,8.61,19.2,19.2,19.2h16.8v21.6h26.4v16.8h33.6v-16.8h28.8v16.8h33.6v-16.8h28.8v16.8h33.6v-16.8h28.8v16.8h33.6v-16.8h26.4v-21.6h16.8c10.59,0,19.2-8.61,19.2-19.2V84.4c0-10.59-8.61-19.2-19.2-19.2ZM418,377.2c0,7.94-6.46,14.4-14.4,14.4H96.4c-7.94,0-14.4-6.46-14.4-14.4V84.4c0-7.94,6.46-14.4,14.4-14.4h307.2c7.94,0,14.4,6.46,14.4,14.4v292.8Z\" />\n <circle cx=\"120.4\" cy=\"353.2\" r=\"9.6\" />\n <circle cx=\"379.6\" cy=\"353.2\" r=\"9.6\" />\n <circle cx=\"120.4\" cy=\"108.4\" r=\"9.6\" />\n <circle cx=\"379.6\" cy=\"108.4\" r=\"9.6\" />\n <polygon points=\"249.8 192.49 249.8 192.49 249.8 187.69 201.31 187.69 201.31 192.49 201.31 192.49 249.8 192.49\" />\n <polygon points=\"218.99 205.11 218.99 205.11 218.99 200.31 201.31 200.31 201.31 205.11 201.31 205.11 218.99 205.11\" />\n <polygon points=\"249.8 205.11 249.8 200.31 232.12 200.31 232.12 205.11 232.12 205.11 249.8 205.11 249.8 205.11\" />\n <path d=\"M287.6,254.18c-1.78,2.61-2.9,4.09-5.03,4.09s-3.26-1.48-5.04-4.09c-1.88-2.75-4.23-6.18-9-6.18s-7.12,3.43-9,6.18c-1.79,2.61-2.9,4.09-5.04,4.09v4.8c4.78,0,7.12-3.43,9-6.18,1.79-2.61,2.9-4.09,5.04-4.09s3.25,1.48,5.04,4.09c1.88,2.75,4.23,6.18,9.01,6.18s7.12-3.43,9-6.18c1.78-2.61,2.9-4.09,5.03-4.09v-4.8c-4.78,0-7.12,3.43-9,6.18Z\" />\n <path d=\"M181.8,298.06h137.65v-137.65h-137.65v137.65ZM190.21,293.26l124.43-124.43v124.43h-124.43ZM311.47,165.21l-124.87,124.87v-124.87h124.87Z\" />\n </svg>\n );\n};\n\nexport default InverterIcon;\n","import { FC } from \"react\";\n\nexport interface CustomSvgComponentProps {\n className?: string;\n color?: string;\n}\n\nconst FlowerHubIcon: FC<CustomSvgComponentProps> = ({ className, color }) => {\n return (\n <svg\n width=\"79\"\n height=\"auto\"\n viewBox=\"0 0 78 79\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <g clipPath=\"url(#clip0_2053_2640)\">\n <path\n d=\"M27.85 0.5H64.19C64.19 0.5 64.24 0.53 64.23 0.56L39.34 62.32C38.26 64.99 35.67 66.74 32.79 66.74H4.17002C1.57002 66.74 -0.209978 64.1 0.780022 61.69L25.05 2.37C25.51 1.24 26.62 0.5 27.84 0.5H27.85Z\"\n className=\"stroke-current\"\n stroke={color}\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M61.7 0.560059L37 61.4501C36.29 63.2201 34.57 64.3801 32.66 64.3801H4.80002C3.56002 64.3801 2.72002 63.1201 3.19002 61.9801L28.45 0.560059\"\n className=\"stroke-current\"\n stroke={color}\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M64.23 0.560059L75.47 10.0301C76.53 10.9301 76.9 12.4201 76.38 13.7101L52.76 72.7401C51.58 75.6901 48.72 77.6301 45.54 77.6301H17.6C16.66 77.6301 15.76 77.3001 15.04 76.7101L1.34998 65.4101\"\n className=\"stroke-current\"\n stroke={color}\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M6.46002 66.53L16.12 74.51C16.57 74.88 17.14 75.09 17.73 75.09H44.35C47.11 75.09 49.58 73.42 50.62 70.86L73.9 13.2C74.16 12.57 73.97 11.84 73.45 11.4L63.08 2.79004\"\n className=\"stroke-current\"\n stroke={color}\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M31.96 0.969971L5.95001 64.61\"\n className=\"stroke-current\"\n stroke={color}\n strokeWidth=\"0.5\"\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M35.65 0.939941L9.64001 64.5799\"\n className=\"stroke-current\"\n stroke={color}\n strokeWidth=\"0.5\"\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M39.34 0.909912L13.33 64.5499\"\n className=\"stroke-current\"\n stroke={color}\n strokeWidth=\"0.5\"\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M43.02 0.870117L17.01 64.5201\"\n className=\"stroke-current\"\n stroke={color}\n strokeWidth=\"0.5\"\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M46.71 0.840088L20.7 64.4901\"\n className=\"stroke-current\"\n stroke={color}\n strokeWidth=\"0.5\"\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M50.4 0.810059L24.39 64.4601\"\n className=\"stroke-current\"\n stroke={color}\n strokeWidth=\"0.5\"\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M54.08 0.780029L28.07 64.43\"\n className=\"stroke-current\"\n stroke={color}\n strokeWidth=\"0.5\"\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M57.77 0.75L31.76 64.4\"\n className=\"stroke-current\"\n stroke={color}\n strokeWidth=\"0.5\"\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M64.81 28.4001L62.8 27.8501L62.56 28.4601L64.1 30.1901L62.09 29.6401L61.9 30.1101L64.32 30.7201L64.55 30.1401L62.96 28.3401L65.04 28.9101L65.27 28.3201L63.44 26.2201L63.26 26.6701L64.81 28.3901V28.4001ZM65.44 24.8601L65.16 24.6801L64.65 25.9801L64.93 26.1601L65.44 24.8601ZM64.19 26.2501C64.34 26.3501 64.53 26.2601 64.61 26.0601L64.64 25.9801L64.04 25.6001L64.61 24.1701L64.33 23.9901L63.59 25.8601L64.2 26.2501H64.19ZM65.03 26.7801L65.71 27.2101L66.45 25.3401L66.18 25.1701L65.61 26.6001L64.93 26.1601L64.9 26.2401C64.82 26.4401 64.88 26.6801 65.03 26.7801ZM60.75 36.7101L60.47 36.5301L59.97 37.7901L60.25 37.9701L60.75 36.7101ZM59.52 38.0601C59.67 38.1601 59.86 38.0601 59.94 37.8701L59.97 37.7901L59.37 37.4101L59.94 35.9801L59.66 35.8001L58.92 37.6701L59.53 38.0601H59.52ZM60.35 38.5901L61.03 39.0201L61.2 38.5801L60.24 37.9701L60.21 38.0501C60.13 38.2501 60.19 38.4901 60.34 38.5901H60.35ZM59.98 34.9601L59.81 35.4001L61.94 36.7501L62.68 34.8801L62.39 34.7001L61.82 36.1301L59.98 34.9601ZM66.19 22.6601C66.21 22.5001 66.2 22.3301 66.15 22.1701C66.1 22.0101 66.01 21.8901 65.88 21.8101C65.7 21.7001 65.53 21.6901 65.37 21.7901C65.21 21.8901 65.08 22.0801 64.97 22.3501L64.49 23.5601L66.62 24.9101L66.79 24.4701L65.89 23.9001L66.14 23.2601C66.22 23.0701 66.3 22.9501 66.39 22.9101C66.48 22.8701 66.6 22.8901 66.74 22.9901L67.25 23.3101L67.43 22.8701L66.86 22.5101C66.72 22.4201 66.6 22.4001 66.48 22.4201C66.36 22.4501 66.26 22.5301 66.19 22.6601ZM65.96 22.7101C65.96 22.8001 65.93 22.9101 65.89 23.0201L65.62 23.7001L64.96 23.2801L65.23 22.6001C65.3 22.4301 65.37 22.3101 65.46 22.2601C65.55 22.2101 65.65 22.2101 65.76 22.2801C65.83 22.3301 65.89 22.3901 65.92 22.4601C65.95 22.5301 65.97 22.6201 65.96 22.7101Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M63.39 31.8701C63.35 31.7501 63.3 31.6501 63.24 31.5501C63.31 31.5001 63.37 31.4501 63.43 31.4301C63.46 31.4201 63.49 31.4101 63.52 31.4301C63.55 31.4401 63.57 31.4601 63.59 31.5101C63.61 31.5501 63.61 31.5901 63.61 31.6301C63.61 31.6301 63.61 31.6501 63.61 31.6601C63.61 31.6601 63.61 31.6801 63.6 31.6901C63.6 31.7101 63.58 31.7201 63.57 31.7401C63.53 31.8001 63.46 31.8501 63.4 31.9001L63.39 31.8701ZM61.52 31.0101C61.52 31.0101 61.49 30.9901 61.48 30.9801C61.47 30.9801 61.45 30.9701 61.44 30.9701C61.43 30.9701 61.41 30.9701 61.4 30.9701C61.4 30.9701 61.38 30.9701 61.38 30.9801C61.38 30.9801 61.37 30.9901 61.36 31.0001C61.35 31.0201 61.33 31.0301 61.33 31.0501C61.33 31.0701 61.32 31.0901 61.31 31.1001C61.31 31.1201 61.31 31.1401 61.31 31.1601C61.31 31.1801 61.31 31.2001 61.32 31.2201C61.34 31.2901 61.39 31.3601 61.44 31.4401C61.51 31.3501 61.59 31.2701 61.67 31.2001C61.62 31.1201 61.58 31.0501 61.53 31.0001L61.52 31.0101ZM62.28 30.6901C62.28 30.6901 62.25 30.6101 62.23 30.5901C62.21 30.5701 62.18 30.5601 62.14 30.5601C62.1 30.5601 62.07 30.5901 62.05 30.6101C62.05 30.6101 62.05 30.6201 62.04 30.6301C62.04 30.6301 62.04 30.6501 62.03 30.6601C62.03 30.6801 62.02 30.7001 62.02 30.7201C62.01 30.8001 62.02 30.8901 62.02 30.9901C62.12 30.9601 62.21 30.9401 62.31 30.9401C62.31 30.8401 62.3 30.7501 62.28 30.6801V30.6901ZM61 31.8001C61 31.8001 60.94 31.8001 60.91 31.8201C60.9 31.8201 60.88 31.8401 60.88 31.8601C60.88 31.8801 60.86 31.9001 60.86 31.9201C60.86 31.9401 60.86 31.9701 60.86 31.9901C60.86 32.0101 60.86 32.0301 60.86 32.0501C60.87 32.0801 60.89 32.1101 60.92 32.1401C60.97 32.1801 61.04 32.2101 61.11 32.2401C61.13 32.1201 61.16 32.0001 61.21 31.8801C61.14 31.8501 61.07 31.8201 61.01 31.8201L61 31.8001ZM61.08 32.7301C61.01 32.7501 60.93 32.7801 60.88 32.8201C60.85 32.8401 60.83 32.8701 60.81 32.9001C60.8 32.9301 60.79 32.9701 60.8 33.0201C60.8 33.0701 60.83 33.1001 60.85 33.1201C60.87 33.1401 60.9 33.1501 60.94 33.1501C61 33.1501 61.07 33.1301 61.14 33.1001C61.11 32.9801 61.08 32.8601 61.07 32.7301H61.08ZM62.58 34.0101C62.61 34.1001 62.63 34.1901 62.67 34.2501C62.69 34.2801 62.71 34.3101 62.74 34.3201C62.77 34.3301 62.8 34.3301 62.83 34.3201C62.87 34.3001 62.89 34.2701 62.9 34.2401C62.91 34.2101 62.92 34.1701 62.91 34.1201C62.91 34.0401 62.88 33.9601 62.85 33.8701C62.76 33.9301 62.67 33.9801 62.58 34.0201V34.0101ZM63.34 33.6701C63.34 33.6701 63.4 33.6901 63.43 33.6801C63.44 33.6801 63.46 33.6701 63.47 33.6601C63.48 33.6501 63.5 33.6301 63.51 33.6101C63.52 33.5901 63.53 33.5701 63.53 33.5501C63.53 33.5301 63.53 33.5101 63.53 33.4901C63.53 33.4501 63.51 33.4201 63.49 33.3801C63.45 33.3201 63.39 33.2701 63.33 33.2101C63.28 33.3301 63.22 33.4301 63.16 33.5301C63.22 33.5901 63.28 33.6401 63.34 33.6601V33.6701ZM62.93 30.7301C62.93 30.7301 62.9 30.7301 62.89 30.7301C62.86 30.7401 62.84 30.7701 62.81 30.8001C62.79 30.8301 62.77 30.8801 62.75 30.9201C62.73 30.9601 62.72 30.9901 62.7 31.0301C62.75 31.0501 62.79 31.0701 62.83 31.1001C62.87 31.1301 62.92 31.1601 62.96 31.1901C62.98 31.1501 62.99 31.1101 63 31.0801C63.02 31.0301 63.03 30.9901 63.04 30.9401C63.04 30.9001 63.04 30.8601 63.04 30.8201C63.04 30.8001 63.03 30.7901 63.02 30.7701C63.01 30.7601 63 30.7401 62.98 30.7301C62.96 30.7201 62.95 30.7101 62.93 30.7101V30.7301ZM63.67 32.7301C63.67 32.7301 63.7 32.7201 63.72 32.7101C63.73 32.7101 63.75 32.6901 63.76 32.6801C63.77 32.6701 63.78 32.6501 63.79 32.6301C63.79 32.6101 63.79 32.5901 63.8 32.5601C63.8 32.5501 63.8 32.5401 63.8 32.5301C63.8 32.5201 63.8 32.5101 63.8 32.5001C63.8 32.4801 63.79 32.4601 63.78 32.4501C63.78 32.4401 63.76 32.4201 63.75 32.4101C63.74 32.4101 63.72 32.3901 63.71 32.3901C63.65 32.3701 63.58 32.3701 63.5 32.3701C63.5 32.5001 63.5 32.6201 63.49 32.7501C63.57 32.7501 63.64 32.7501 63.7 32.7401L63.67 32.7301ZM61.88 34.2701C61.88 34.2701 61.89 34.3501 61.91 34.3801C61.91 34.3901 61.93 34.4101 61.94 34.4201C61.95 34.4201 61.97 34.4401 61.99 34.4401C61.99 34.4401 62.01 34.4401 62.02 34.4401H62.04C62.06 34.4401 62.07 34.4301 62.08 34.4201C62.1 34.4001 62.12 34.3701 62.14 34.3301C62.15 34.2901 62.17 34.2401 62.18 34.1901C62.18 34.1501 62.19 34.1101 62.2 34.0701C62.1 34.0701 62.01 34.0401 61.91 34.0101C61.89 34.1101 61.88 34.2001 61.88 34.2801V34.2701ZM61.28 33.6201C61.28 33.6201 61.23 33.7001 61.21 33.7401C61.19 33.7801 61.18 33.8201 61.19 33.8601C61.19 33.8801 61.19 33.9001 61.2 33.9201C61.2 33.9201 61.2 33.9401 61.21 33.9501C61.21 33.9501 61.22 33.9701 61.23 33.9801C61.24 34.0001 61.26 34.0101 61.27 34.0201C61.28 34.0201 61.3 34.0301 61.31 34.0301C61.34 34.0301 61.37 34.0201 61.4 33.9901C61.45 33.9501 61.5 33.8801 61.55 33.8001C61.47 33.7301 61.4 33.6401 61.34 33.5401C61.32 33.5701 61.29 33.6001 61.27 33.6301L61.28 33.6201ZM61.83 31.4601C61.83 31.4601 61.88 31.5101 61.9 31.5201C61.91 31.5201 61.92 31.5201 61.94 31.5201C61.94 31.5201 61.95 31.5201 61.96 31.5201C61.96 31.5201 61.97 31.5201 61.98 31.5201C61.99 31.5201 61.99 31.5201 62 31.5101C62 31.5101 62 31.5101 62.01 31.5001C62.01 31.4901 62.02 31.4801 62.03 31.4601C62.04 31.4301 62.05 31.3901 62.05 31.3501C62.05 31.2601 62.05 31.1501 62.04 31.0401C62.04 31.0301 62.04 31.0201 62.04 31.0001C61.91 31.0401 61.79 31.1101 61.68 31.2001C61.68 31.2001 61.69 31.2201 61.7 31.2301C61.75 31.3201 61.8 31.4001 61.85 31.4601H61.83ZM62.35 31.3001C62.35 31.3001 62.37 31.3801 62.38 31.4001C62.38 31.4101 62.4 31.4201 62.41 31.4301C62.41 31.4301 62.43 31.4401 62.44 31.4501C62.44 31.4501 62.45 31.4501 62.46 31.4501C62.46 31.4501 62.47 31.4501 62.48 31.4501C62.49 31.4501 62.5 31.4501 62.51 31.4301C62.53 31.4101 62.55 31.3801 62.57 31.3501C62.59 31.3101 62.61 31.2701 62.63 31.2301C62.65 31.1801 62.67 31.1301 62.69 31.0801C62.69 31.0701 62.69 31.0601 62.7 31.0501C62.57 30.9901 62.45 30.9701 62.32 30.9701C62.32 30.9801 62.32 30.9901 62.32 31.0101C62.32 31.1201 62.33 31.2301 62.35 31.3101V31.3001ZM61.95 33.6601C61.95 33.6601 61.95 33.6201 61.95 33.6001C61.95 33.5801 61.95 33.5601 61.95 33.5501C61.95 33.5301 61.94 33.5201 61.93 33.5101C61.93 33.5001 61.91 33.4901 61.9 33.4801C61.89 33.4801 61.88 33.4701 61.87 33.4701C61.86 33.4701 61.85 33.4701 61.83 33.4701C61.82 33.4701 61.81 33.4801 61.79 33.4901C61.78 33.4901 61.76 33.5101 61.75 33.5201C61.7 33.5701 61.64 33.6601 61.58 33.7401C61.58 33.7401 61.57 33.7601 61.56 33.7701C61.61 33.8201 61.67 33.8601 61.73 33.9001C61.79 33.9401 61.85 33.9701 61.91 33.9901C61.91 33.9801 61.91 33.9701 61.91 33.9501C61.93 33.8401 61.95 33.7301 61.95 33.6501V33.6601ZM63.16 32.0601C63.16 32.0601 63.11 32.1201 63.1 32.1501C63.1 32.1601 63.09 32.1801 63.09 32.1901C63.09 32.1901 63.09 32.2001 63.09 32.2101V32.2301V32.2501C63.09 32.2501 63.09 32.2601 63.09 32.2701C63.09 32.2801 63.11 32.2901 63.12 32.3001C63.14 32.3201 63.17 32.3301 63.2 32.3401C63.27 32.3601 63.35 32.3601 63.44 32.3601C63.44 32.3601 63.46 32.3601 63.47 32.3601C63.47 32.1901 63.43 32.0301 63.38 31.8701C63.38 31.8701 63.36 31.8801 63.36 31.8901C63.28 31.9501 63.21 32.0001 63.16 32.0601ZM61.46 31.9601C61.46 31.9601 61.52 31.9601 61.55 31.9601C61.56 31.9601 61.57 31.9601 61.58 31.9401C61.59 31.9401 61.6 31.9201 61.61 31.9101C61.61 31.9101 61.61 31.9001 61.61 31.8901C61.61 31.8901 61.61 31.8801 61.61 31.8701V31.8501V31.8301C61.61 31.8001 61.6 31.7601 61.58 31.7301C61.55 31.6601 61.49 31.5701 61.44 31.4901C61.44 31.4901 61.43 31.4701 61.42 31.4601C61.34 31.5701 61.26 31.7001 61.2 31.8501C61.2 31.8501 61.2 31.8701 61.19 31.8801C61.19 31.8801 61.21 31.8801 61.22 31.8901C61.3 31.9301 61.38 31.9601 61.45 31.9701L61.46 31.9601ZM62.95 33.3501C62.95 33.3501 62.89 33.3201 62.87 33.3201C62.84 33.3201 62.82 33.3201 62.8 33.3501C62.8 33.3501 62.8 33.3601 62.79 33.3701C62.79 33.3701 62.79 33.3801 62.78 33.3901C62.78 33.4001 62.78 33.4201 62.77 33.4301C62.77 33.4601 62.77 33.5001 62.77 33.5401C62.78 33.6201 62.82 33.7201 62.85 33.8301C62.85 33.8401 62.85 33.8501 62.86 33.8601C62.97 33.7801 63.08 33.6701 63.17 33.5401C63.17 33.5401 63.15 33.5301 63.15 33.5201C63.08 33.4601 63.01 33.3901 62.95 33.3601V33.3501ZM62.89 31.3901C62.89 31.3901 62.86 31.4801 62.85 31.5201C62.84 31.5601 62.83 31.6001 62.83 31.6301C62.83 31.6501 62.83 31.6601 62.83 31.6701C62.83 31.6701 62.83 31.6801 62.83 31.6901C62.83 31.6901 62.83 31.7001 62.84 31.7101C62.84 31.7201 62.86 31.7301 62.87 31.7301C62.88 31.7301 62.89 31.7301 62.91 31.7301C62.93 31.7301 62.96 31.7201 63 31.7001C63.06 31.6701 63.14 31.6101 63.21 31.5501C63.21 31.5501 63.23 31.5401 63.23 31.5301C63.15 31.4001 63.06 31.2801 62.95 31.1901C62.95 31.2001 62.95 31.2101 62.94 31.2201C62.92 31.2701 62.9 31.3201 62.88 31.3701L62.89 31.3901ZM63.2 32.7401C63.2 32.7401 63.14 32.7601 63.12 32.7701C63.12 32.7701 63.11 32.7701 63.1 32.7801C63.1 32.7801 63.1 32.7801 63.09 32.8001C63.09 32.8001 63.09 32.8101 63.08 32.8201C63.08 32.8201 63.08 32.8301 63.08 32.8401C63.08 32.8601 63.08 32.8701 63.08 32.8901C63.08 32.9001 63.08 32.9201 63.08 32.9301C63.09 32.9601 63.11 32.9901 63.13 33.0201C63.18 33.0801 63.25 33.1401 63.32 33.2001C63.32 33.2001 63.34 33.2101 63.34 33.2201C63.34 33.2201 63.34 33.2001 63.35 33.1901C63.41 33.0401 63.45 32.8901 63.47 32.7401C63.47 32.7401 63.45 32.7401 63.44 32.7401C63.35 32.7401 63.27 32.7401 63.2 32.7401ZM62.48 33.6901C62.48 33.6901 62.44 33.6201 62.42 33.6001C62.42 33.6001 62.4 33.5801 62.39 33.5801C62.39 33.5801 62.38 33.5801 62.37 33.5801C62.37 33.5801 62.36 33.5801 62.35 33.5801C62.34 33.5801 62.33 33.5801 62.32 33.5901C62.31 33.5901 62.3 33.6101 62.29 33.6201C62.27 33.6401 62.26 33.6801 62.25 33.7201C62.23 33.8001 62.21 33.9101 62.2 34.0201C62.2 34.0301 62.2 34.0501 62.2 34.0601C62.33 34.0601 62.46 34.0501 62.59 34.0001C62.59 33.9901 62.59 33.9801 62.58 33.9701C62.55 33.8701 62.52 33.7701 62.49 33.6901H62.48ZM61.34 32.6301C61.34 32.6301 61.4 32.5901 61.41 32.5701C61.41 32.5601 61.43 32.5501 61.43 32.5301C61.43 32.5301 61.43 32.5201 61.43 32.5101V32.4901C61.43 32.4601 61.43 32.4301 61.41 32.4101C61.39 32.3901 61.37 32.3601 61.34 32.3501C61.28 32.3101 61.2 32.2801 61.12 32.2501C61.12 32.2501 61.1 32.2501 61.09 32.2401C61.06 32.4101 61.06 32.5801 61.07 32.7401C61.07 32.7401 61.09 32.7401 61.1 32.7401C61.18 32.7101 61.27 32.6901 61.33 32.6501L61.34 32.6301ZM61.53 33.2701C61.53 33.2701 61.56 33.2001 61.57 33.1701C61.57 33.1501 61.57 33.1401 61.57 33.1201C61.57 33.1101 61.57 33.0901 61.56 33.0801C61.56 33.0801 61.56 33.0701 61.55 33.0601C61.55 33.0601 61.55 33.0501 61.54 33.0401C61.54 33.0401 61.52 33.0301 61.51 33.0201C61.49 33.0201 61.46 33.0201 61.42 33.0201C61.35 33.0201 61.27 33.0601 61.19 33.0901C61.19 33.0901 61.17 33.0901 61.16 33.1001C61.21 33.2601 61.27 33.4001 61.35 33.5301C61.35 33.5301 61.36 33.5101 61.37 33.5001C61.43 33.4201 61.49 33.3401 61.53 33.2701Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M69.25 18.1099C69.12 18.2299 68.97 18.2899 68.81 18.2999C68.65 18.2999 68.47 18.2499 68.28 18.1299L66.97 17.2999L67.15 16.8599L68.41 17.6599C68.55 17.7499 68.68 17.7999 68.8 17.8099C68.91 17.8199 69.01 17.7899 69.1 17.7299C69.18 17.6599 69.25 17.5599 69.31 17.4199C69.4 17.2099 69.41 17.0099 69.35 16.8299C69.29 16.6499 69.15 16.4999 68.94 16.3599L67.68 15.5599L67.85 15.1199L69.16 15.9499C69.44 16.1299 69.62 16.3599 69.69 16.6499C69.76 16.9399 69.73 17.2499 69.59 17.5999C69.5 17.8299 69.39 17.9999 69.26 18.1199L69.25 18.1099ZM68.02 14.6699L68.47 13.5399C68.58 13.2599 68.71 13.0699 68.87 12.9599C69.02 12.8499 69.19 12.8499 69.37 12.9599C69.49 13.0299 69.57 13.1399 69.61 13.2899C69.65 13.4399 69.66 13.5899 69.64 13.7599C69.75 13.6099 69.87 13.4999 70 13.4599C70.13 13.4099 70.26 13.4299 70.39 13.5199C70.54 13.6099 70.64 13.7399 70.69 13.8899C70.74 14.0399 70.75 14.2099 70.73 14.3999C70.7 14.5899 70.65 14.7799 70.57 14.9799L70.15 16.0299L68.02 14.6799V14.6699ZM69.4 13.8499C69.4 13.7499 69.4 13.6699 69.37 13.6099C69.34 13.5399 69.29 13.4899 69.23 13.4499C69.14 13.3899 69.05 13.3899 68.97 13.4399C68.89 13.4899 68.81 13.5999 68.74 13.7799L68.48 14.4299L69.08 14.8099L69.33 14.1699C69.38 14.0599 69.4 13.9499 69.41 13.8599L69.4 13.8499ZM70.38 14.2599C70.36 14.1299 70.29 14.0299 70.18 13.9599C70.07 13.8899 69.96 13.8799 69.87 13.9399C69.78 13.9999 69.69 14.1299 69.61 14.3299L69.35 14.9799L70.03 15.4099L70.29 14.7499C70.37 14.5499 70.4 14.3899 70.38 14.2599ZM66.08 19.5599L66.97 20.1199L66.94 20.1999C66.86 20.3999 66.67 20.4799 66.52 20.3899L65.91 19.9999L66.08 19.5599ZM67.35 20.9199L68.03 21.3499L68.2 20.9099L67.24 20.2999L67.21 20.3799C67.13 20.5799 67.19 20.8199 67.34 20.9199H67.35ZM66.63 18.1699L67.52 18.7299L66.97 20.1199L67.25 20.2999L67.8 18.9099L68.76 19.5199L68.93 19.0799L66.8 17.7299L66.63 18.1699Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M46.36 55.6501L49.18 48.4201C49.32 48.0601 49.77 47.9401 50.07 48.1901L53.74 51.1901C53.93 51.3501 54 51.6101 53.91 51.8501L50.89 59.2101C50.74 59.5701 50.28 59.6801 49.99 59.4201L46.52 56.3001C46.34 56.1401 46.28 55.8901 46.37 55.6701L46.36 55.6501Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M50.18 45.9799L53 38.7499C53.14 38.3899 53.59 38.2699 53.89 38.5199L57.56 41.5199C57.75 41.6799 57.82 41.9399 57.73 42.1799L54.71 49.5399C54.56 49.8999 54.1 50.0099 53.8 49.7499L50.33 46.6299C50.15 46.4699 50.09 46.2199 50.18 45.9999V45.9799Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M55.34 34.2001L57.26 29.2901C57.36 29.0501 57.66 28.9701 57.86 29.1301L58.91 29.9901C59.04 30.1001 59.09 30.2801 59.02 30.4401L56.97 35.4301C56.87 35.6801 56.55 35.7501 56.36 35.5701L55.45 34.6301C55.33 34.5201 55.29 34.3501 55.35 34.2001H55.34Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M58.29 27.2599L60.21 22.3499C60.31 22.1099 60.61 22.0299 60.81 22.1899L61.86 23.0499C61.99 23.1599 62.04 23.3399 61.97 23.4999L59.92 28.4899C59.82 28.7399 59.5 28.8099 59.31 28.6299L58.4 27.6899C58.28 27.5799 58.24 27.4099 58.3 27.2599H58.29Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M42.54 65.3501L45.37 58.1001C45.51 57.7401 45.97 57.6201 46.27 57.8801L47.34 58.7901C47.53 58.9501 47.59 59.2101 47.5 59.4401L44.5 66.7301C44.34 67.1101 43.84 67.2001 43.56 66.9001L42.66 65.9401C42.51 65.7801 42.47 65.5501 42.54 65.3401V65.3501Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M45.05 67.49L47.88 60.24C48.02 59.88 48.48 59.76 48.78 60.02L49.85 60.93C50.04 61.09 50.1 61.35 50.01 61.58L47.01 68.87C46.85 69.25 46.35 69.34 46.07 69.04L45.17 68.08C45.02 67.92 44.98 67.69 45.05 67.48V67.49Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M63.29 19.88C63.903 19.88 64.4 19.1771 64.4 18.31C64.4 17.4429 63.903 16.74 63.29 16.74C62.677 16.74 62.18 17.4429 62.18 18.31C62.18 19.1771 62.677 19.88 63.29 19.88Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M35.6115 72.7356C35.7822 72.3102 35.1145 71.6419 34.1201 71.243C33.1257 70.844 32.1812 70.8655 32.0105 71.291C31.8398 71.7164 32.5076 72.3847 33.502 72.7836C34.4964 73.1826 35.4409 73.1611 35.6115 72.7356Z\"\n className=\"stroke-current\"\n fill={color}\n />\n <path\n d=\"M16.35 71.3899L18.8 73.4599C18.9 73.5499 19.03 73.5899 19.17 73.5899H27.63C28.16 73.5899 28.4 72.9299 28 72.5899L25.57 70.5199C25.47 70.4299 25.34 70.3799 25.2 70.3799H16.72C16.19 70.3799 15.95 71.0399 16.35 71.3799V71.3899Z\"\n className=\"stroke-current\"\n fill={color}\n />\n </g>\n </svg>\n );\n};\n\nexport default FlowerHubIcon;\n","import { FC } from \"react\";\nimport { CustomSvgComponentProps } from \"./FlowerHubIcon\";\n\nconst HomeIcon: FC<CustomSvgComponentProps> = ({ color = \"black\" }) => {\n return (\n <svg\n width=\"79\"\n height=\"auto\"\n viewBox=\"0 0 106 106\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M9 48L52 18L95 48\" stroke={color} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M18 48.5L52 26L86 48.5V96H18V48.5ZM47 71H32V95.5H47V71Z\"\n fill={color}\n />\n <path\n d=\"M52 26L52.2759 25.583L52 25.4004L51.7241 25.583L52 26ZM18 48.5L17.7241 48.083L17.5 48.2313V48.5H18ZM86 48.5H86.5V48.2313L86.2759 48.083L86 48.5ZM86 96V96.5H86.5V96H86ZM18 96H17.5V96.5H18V96ZM32 71V70.5H31.5V71H32ZM47 71H47.5V70.5H47V71ZM32 95.5H31.5V96H32V95.5ZM47 95.5V96H47.5V95.5H47ZM51.7241 25.583L17.7241 48.083L18.2759 48.917L52.2759 26.417L51.7241 25.583ZM86.2759 48.083L52.2759 25.583L51.7241 26.417L85.7241 48.917L86.2759 48.083ZM86.5 96V48.5H85.5V96H86.5ZM18 96.5H86V95.5H18V96.5ZM17.5 48.5V96H18.5V48.5H17.5ZM32 71.5H47V70.5H32V71.5ZM32.5 95.5V71H31.5V95.5H32.5ZM47 95H32V96H47V95ZM46.5 71V95.5H47.5V71H46.5Z\"\n fill={color}\n />\n <path d=\"M26 21V35L34 30.5V21H26Z\" fill={color} stroke={color} />\n </svg>\n );\n};\n\nexport default HomeIcon;\n","import { classNames } from \"helpers/classNames\";\nimport { FC, ReactNode } from \"react\";\n\ninterface ContentCardProps {\n title: string;\n color: string;\n icon: ReactNode;\n content: ReactNode;\n}\n\nexport const ContentCard: FC<ContentCardProps> = ({\n title,\n color,\n icon,\n content,\n}) => {\n return (\n <div\n className={classNames(\n \"group relative bg-white p-6 focus-within:ring-2 focus-within:ring-inset focus-within:ring-indigo-500 px-20\",\n )}\n >\n <div className=\"flex justify-content items-center\">\n <span\n className={classNames(\n `bg-${color}-50`,\n `text-${color}-700`,\n \"inline-flex rounded-lg p-3 ring-4 ring-white w-12 h-12 mr-4 \",\n )}\n >\n {icon}\n </span>\n <h3 className=\"text-base font-semibold leading-6 text-gray-900\">\n <span aria-hidden=\"true\" className=\"absolute inset-0\" />\n {title}\n </h3>\n </div>\n <div className=\"mt-4\">{content}</div>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { CustomSvgComponentProps } from \"./FlowerHubIcon\";\n\nconst BatteryIcon: FC<CustomSvgComponentProps> = ({ color = \"black\" }) => {\n return (\n <svg\n width=\"106\"\n height=\"auto\"\n viewBox=\"0 0 106 106\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke={color}\n >\n <path\n d=\"M92.3582 28.3735H49.6932V77.6264H92.3582V28.3735Z\"\n stroke={color}\n />\n <path\n d=\"M49.3653 28.3735H6.70026V77.6264H49.3653V28.3735Z\"\n fill={color}\n stroke={color}\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M49.0376 28.3735H6.3725V77.6264H49.0376V28.3735Z\"\n stroke={color}\n />\n <path\n d=\"M100.635 42.8984H92.3657V64.1253H100.635V42.8984Z\"\n stroke={color}\n />\n </svg>\n );\n};\n\nexport default BatteryIcon;\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { AssetInformation } from \"./AssetInformationStep\";\nimport { Fuse } from \"../bessTypes\";\nimport InverterIcon from \"styles/icons/InverterIcon\";\nimport FlowerHubIcon from \"styles/icons/FlowerHubIcon\";\nimport HomeIcon from \"styles/icons/HomeIcon\";\nimport { ContentCard } from \"../ContentCard\";\nimport { ActionButton } from \"../../buttons/ActionButton\";\nimport BatteryIcon from \"styles/icons/BatteryIcon\";\n\ntype MetaDataConfirmationProps = {\n changeStep: (step: number) => void;\n assetInformation: AssetInformation;\n assetSerialNumber?: string;\n fuse?: Fuse;\n};\n\nexport const MetaDataConfirmationStep: FC<MetaDataConfirmationProps> = ({\n changeStep,\n assetInformation,\n assetSerialNumber,\n fuse,\n}) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"space-y-8\">\n <h2 className=\"text-xl font-bold text-center leading-tight mt-6\">\n {t(\"batteryOverview.One last check we're almost done!\")}\n </h2>\n <p className=\"text-base text-gray-800 text-center\">\n {t(\n \"batteryOverview.Please review the details you ve entered carefully as you will not be able to make any changes after this step\",\n )}\n </p>\n <div className=\"flex justify-center\">\n <div className=\"max-w-4xl divide-y divide-gray-200 overflow-hidden rounded-lg bg-gray-200 sm:grid sm:grid-cols-2 sm:gap-px sm:divide-y-0 mb-4\">\n <ContentCard\n title={t(\"batteryOverview.Serial number\")}\n icon={<FlowerHubIcon color={\"#1d4fd8\"} />}\n color=\"blue\"\n content={<p className=\"mt-2 text-sm\">{assetSerialNumber}</p>}\n />\n <ContentCard\n title={t(\"batteryOverview.FuseSize\")}\n icon={<HomeIcon color={\"#a16107\"} />}\n color=\"yellow\"\n content={<p className=\"mt-2 text-sm\">{`${fuse?.ampere} A`}</p>}\n />\n <ContentCard\n title={t(\"batteryOverview.Inverter\")}\n color=\"green\"\n icon={<InverterIcon color=\"#15803c\" />}\n content={\n <div className=\"grid grid-cols-1 gap-2\">\n <DetailItem\n label={t(\"assetModel.Model\")}\n value={`${assetInformation.inverterManufacturer.name} ${assetInformation.inverterModel.name}`}\n />\n <DetailItem\n label={t(\"batteryOverview.Power capacity\")}\n value={`${assetInformation.inverterCapacity.power} kw`}\n />\n </div>\n }\n />\n <ContentCard\n title={t(\"batteryOverview.Battery\")}\n icon={<BatteryIcon color=\"#4438ca\" />}\n color=\"indigo\"\n content={\n <div className=\"grid grid-cols-1 gap-2\">\n <DetailItem\n label={t(\"assetModel.Model\")}\n value={`${assetInformation.batteryManufacturer.name} ${assetInformation.batteryModel.name}`}\n />\n <DetailItem\n label={t(\"batteryOverview.Energy capacity\")}\n value={`${assetInformation.batteryCapacity.energy} kwh`}\n />\n <DetailItem\n label={t(\"batteryOverview.Power capacity\")}\n value={`${assetInformation.batteryCapacity.power} kw`}\n />\n </div>\n }\n />\n </div>\n </div>\n\n <div className=\"flex justify-between w-full\">\n <ActionButton\n onClick={() => changeStep(3)}\n label={t(\"Back\")}\n variant=\"black\"\n />\n <ActionButton\n onClick={() => changeStep(5)}\n label={t(\"All details are correct!\")}\n variant=\"primary\"\n />\n </div>\n </div>\n );\n};\n\nconst DetailItem: FC<{ label: string; value: string }> = ({ label, value }) => (\n <p className=\"text-sm\">\n <span className=\"text-gray-500\">{`${label}:`}</span>\n <span>{` ${value}`}</span>\n </p>\n);\n","import { useTranslation } from \"react-i18next\";\nimport { ActionButton } from \"../../buttons/ActionButton\";\nimport { FC } from \"react\";\nimport { cloudFrontDomainUrl } from \"constants/environment\";\nimport { getDeviceForMedia } from \"helpers/installationFlow\";\n\ntype Props = {\n changeStep: (step: number) => void;\n};\n\nexport const PowerConfirmationStep: FC<Props> = ({ changeStep }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"flex flex-col items-center space-y-8\">\n <img\n src={`${cloudFrontDomainUrl}/installation-flow/${getDeviceForMedia()}/final-setup.jpg`}\n alt=\"Final setup\"\n className=\"w-full lg:w-2/3\"\n />\n\n <h2 className=\"text-xl font-bold text-center leading-tight\">\n {t(\"batteryOverview.Time to connect the power cable\")}\n </h2>\n <p className=\"text-base text-gray-800 text-center\">\n {t(\n `batteryOverview.Connect the Flower Hub to a power outlet using the power cable provided in the box`,\n )}\n </p>\n <div className=\"flex flex-col items-start\">\n <p className=\"text-base text-gray-800 text-center\">\n {t(`batteryOverview.The Flower Hub should now be connected with`)}\n </p>\n <ul className=\"list-disc pl-8 text-base text-gray-800 pt-2\">\n <li>{t(`batteryOverview.A power cable`)}</li>\n <li>\n {t(\n `batteryOverview.An Ethernet cable connecting to the same network as the inverter`,\n )}\n </li>\n </ul>\n </div>\n <div className=\"flex justify-between w-full\">\n <ActionButton\n onClick={() => changeStep(4)}\n label={t(\"Back\")}\n variant=\"black\"\n />\n <ActionButton\n onClick={() => changeStep(6)}\n label={t(\"batteryOverview.All cables are connected\")}\n variant=\"primary\"\n />\n </div>\n </div>\n );\n};\n","export enum StepStatus {\n Current = \"current\",\n Complete = \"complete\",\n Upcoming = \"upcoming\",\n}\n\nexport enum FlowerHubInstallationProgressTitle {\n ConfigurationFailed = \"Configuration failed\",\n ConfiguringFlowerHub = \"Configuring Flower Hub\",\n ConfigurationStarting = \"Configuration starting\",\n}\n\nexport enum FlowerHubInstallationStatusMessageCode {\n //Flower hub installation and requirement related message codes\n FlowerHubNeverAttemptedToCertificateProvisioning = \"FlowerHubNeverAttemptedToCertificateProvisioning\",\n FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration = \"FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration\",\n FlowerHubCertificateProvisioningLastAttemptFailed = \"FlowerHubCertificateProvisioningLastAttemptFailed\",\n FlowerHubWaitingForCertificateProvisioning = \"FlowerHubWaitingForCertificateProvisioning\",\n\n // Green grass 'thing' related message codes\n WaitingToCreateIoTThing = \"WaitingToCreateIoTThing\",\n IoTThingCreationFailed = \"IoTThingCreationFailed\",\n\n // Green grass 'core device' related message codes\n WaitingToCreateCoreDevice = \"WaitingToCreateCoreDevice\",\n CoreDeviceCreationFailed = \"CoreDeviceCreationFailed\",\n\n // Green grass 'deployments' related message codes\n WaitingToStartDeployment = \"WaitingToStartDeployment\",\n GreengrassDeploymentSucceeded = \"GreengrassDeploymentSucceeded\",\n GreengrassDeploymentInProgress = \"GreengrassDeploymentInProgress\",\n GreengrassDeploymentFailed = \"GreengrassDeploymentFailed\",\n GreengrassDeploymentErrored = \"GreengrassDeploymentErrored\",\n GreengrassDeploymentUnknownStatus = \"GreengrassDeploymentUnknownStatus\",\n RetryingDeploymentDueToFailure = \"RetryingDeploymentDueToFailure\",\n UnableToFindGreengrassDeployment = \"UnableToFindGreengrassDeployment\",\n GreengrassDeploymentTimeout = \"GreengrassDeploymentTimeout\",\n\n FirstInstallationCompleted = \"FirstInstallationCompleted\",\n}\n\nexport enum FlowerHubOperationalStatusMessageCode {\n GreengrassDeploymentInProgress = \"GreengrassDeploymentInProgress\",\n GreengrassDeploymentFailed = \"GreengrassDeploymentFailed\",\n GreengrassDeploymentErrored = \"GreengrassDeploymentErrored\",\n GreengrassDeploymentUnknownStatus = \"GreengrassDeploymentUnknownStatus\",\n\n InverterDongleScanningAndComponentsAreRunning = \"InverterDongleScanningAndComponentsAreRunning\",\n InverterDongleScanningAndComponentsAreUnhealthy = \"InverterDongleScanningAndComponentsAreUnhealthy\",\n InverterDongleScanningAndComponentsAreBroken = \"InverterDongleScanningAndComponentsAreBroken\",\n\n InverterDongleFoundAndComponentsAreRunning = \"InverterDongleFoundAndComponentsAreRunning\",\n InverterDongleFoundAndComponentsAreUnhealthy = \"InverterDongleFoundAndComponentsAreUnhealthy\",\n InverterDongleFoundAndComponentsAreBroken = \"InverterDongleFoundAndComponentsAreBroken\",\n InverterDongleFoundAndComponentsAreRunningWithUnstableIoTConnectivity = \"InverterDongleFoundAndComponentsAreRunningWithUnstableIoTConnectivity\",\n\n InverterDongleNotFoundAndComponentsAreRunning = \"InverterDongleNotFoundAndComponentsAreRunning\",\n InverterDongleNotFoundAndComponentsAreUnhealthy = \"InverterDongleNotFoundAndComponentsAreUnhealthy\",\n InverterDongleNotFoundAndComponentsAreBroken = \"InverterDongleNotFoundAndComponentsAreBroken\",\n\n InverterDongleScanningTimeoutAndComponentsAreRunning = \"InverterDongleScanningTimeoutAndComponentsAreRunning\",\n InverterDongleScanningTimeoutAndComponentsAreUnhealthy = \"InverterDongleScanningTimeoutAndComponentsAreUnhealthy\",\n InverterDongleScanningTimeoutAndComponentsAreBroken = \"InverterDongleScanningTimeoutAndComponentsAreBroken\",\n\n InverterDongleUnstableConnectivityAndComponentsAreRunning = \"InverterDongleUnstableConnectivityAndComponentsAreRunning\",\n InverterDongleUnstableConnectivityAndComponentsAreUnhealthy = \"InverterDongleUnstableConnectivityAndComponentsAreUnhealthy\",\n InverterDongleUnstableConnectivityAndComponentsAreBroken = \"InverterDongleUnstableConnectivityAndComponentsAreBroken\",\n\n OfflineIoTConnectivity = \"OfflineIoTConnectivity\",\n}\n\nexport enum IoTConnectivityStatus {\n Online = \"OnlineIoTConnectivity\",\n Offline = \"OfflineIoTConnectivity\",\n Unstable = \"UnstableIoTConnectivity\",\n}\n\nexport enum FlowerHubStatus {\n Offline = \"Offline\",\n UnstableConnection = \"Unstable connection\",\n ConfigurationFailed = \"Configuration failed\",\n Configuring = \"Configuring\",\n Connected = \"Connected\",\n Connecting = \"Connecting\",\n ConnectionFailed = \"Connection failed\",\n ConnectionTimeout = \"Connection timeout\",\n DeviceError = \"Device error\",\n Unhealthy = \"Unhealthy\",\n Unknown = \"Unknown\",\n UpdateFailed = \"Update failed\",\n Updating = \"Updating\",\n}\n","import { FC } from \"react\";\nimport { CustomSvgComponentProps } from \"./FlowerHubIcon\";\n\nconst BoltIcon: FC<CustomSvgComponentProps> = ({ color = \"black\" }) => {\n return (\n <svg\n width=\"79\"\n height=\"auto\"\n viewBox=\"0 0 106 106\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19.7908 53.3393H53.7798L56.9578 8.14111L19.7908 53.3393Z\"\n fill={color}\n stroke={color}\n strokeMiterlimit=\"10\"\n />\n <path\n d=\"M50.6017 97.8589L87.2092 53.3394H53.7275L50.6017 97.8589Z\"\n stroke={color}\n />\n </svg>\n );\n};\n\nexport default BoltIcon;\n","import { FC } from \"react\";\nimport { CustomSvgComponentProps } from \"./FlowerHubIcon\";\n\nconst ConfirmedDocIcon: FC<CustomSvgComponentProps> = ({ color = \"black\" }) => {\n return (\n <svg\n width=\"79\"\n height=\"auto\"\n viewBox=\"0 0 49 70\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M22.93 1.06006C23.48 1.06006 24.05 1.09005 24.6 1.15005C31.17 1.89005 36.5 7.18007 37.28 13.7401C38.12 20.8001 33.8 27.3701 27 29.3701C26.52 29.5101 26.2 29.9601 26.22 30.4601C26.24 30.9601 26.6 31.3801 27.1 31.4701C36.84 33.3801 44 41.7601 44.45 51.6101H1.40001C1.86001 41.7701 9.01002 33.3801 18.75 31.4701C19.24 31.3701 19.6 30.9601 19.63 30.4601C19.65 29.9601 19.33 29.5101 18.85 29.3701C12.74 27.5801 8.47002 21.8801 8.47002 15.5201C8.47002 7.55007 14.95 1.06006 22.93 1.06006ZM22.93 0.0600586C14.39 0.0600586 7.47002 6.98007 7.47002 15.5201C7.47002 22.5401 12.16 28.4501 18.57 30.3301C18.66 30.3601 18.65 30.4701 18.57 30.4901C8.21002 32.5201 0.390015 41.6501 0.390015 52.6101H45.48C45.48 41.6501 37.66 32.5301 27.3 30.4901C27.21 30.4701 27.2 30.3501 27.3 30.3301C34.28 28.2801 39.22 21.4601 38.29 13.6301C37.46 6.60007 31.76 0.950065 24.73 0.160065C24.13 0.0900647 23.53 0.0600586 22.94 0.0600586H22.93Z\"\n fill={color}\n />\n <path d=\"M48.59 44.1899H22.96V69.8199H48.59V44.1899Z\" fill={color} />\n <path\n d=\"M28.14 57.5602L32.86 62.2702L43.39 51.7402\"\n stroke=\"white\"\n strokeMiterlimit=\"10\"\n />\n </svg>\n );\n};\n\nexport default ConfirmedDocIcon;\n","import { FC } from \"react\";\nimport { CustomSvgComponentProps } from \"./FlowerHubIcon\";\n\nconst ConfirmedIcon: FC<CustomSvgComponentProps> = ({ color = \"black\" }) => {\n return (\n <svg\n width=\"106\"\n height=\"106\"\n viewBox=\"0 0 106 106\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M59.8 14V32.9H78.7\" stroke={color} strokeMiterlimit=\"10\" />\n <path\n d=\"M78.7 32.9V92H25.1V14H59.8L78.7 32.9Z\"\n stroke={color}\n strokeMiterlimit=\"10\"\n />\n <path d=\"M85.4 56.7H59.8V82.3H85.4V56.7Z\" fill={color} />\n <path\n d=\"M65 70.1L69.7 74.8L80.2 64.2\"\n stroke=\"white\"\n strokeMiterlimit=\"10\"\n />\n </svg>\n );\n};\n\nexport default ConfirmedIcon;\n","import { cloneElement, FC, ReactNode } from \"react\";\nimport { CheckIcon } from \"@heroicons/react/24/outline\";\nimport { AssetStep } from \"../installFlowerHub.helpers\";\nimport { classNames } from \"helpers/classNames\";\nimport FlowerHubIcon, {\n CustomSvgComponentProps,\n} from \"styles/icons/FlowerHubIcon\";\nimport { StepStatus } from \"enums/flowerHubStatus.enum\";\nimport BoltIcon from \"styles/icons/BoltIcon\";\nimport HomeIcon from \"styles/icons/HomeIcon\";\nimport ConfirmedDocIcon from \"styles/icons/ConfirmedDocIcon\";\nimport ConfirmedIcon from \"styles/icons/ConfirmedIcon\";\n\nconst steps: StepProp[] = [\n { name: AssetStep.CONNECT_ETH, icon: <ConfirmedIcon /> },\n { name: AssetStep.ASSET_INFORMATION, icon: <HomeIcon /> },\n { name: AssetStep.SERIAL_NUMBER, icon: <FlowerHubIcon /> },\n { name: AssetStep.META_DATA_CONFIRMATION, icon: <ConfirmedDocIcon /> },\n { name: AssetStep.POWER_CONFIRMATION, icon: <BoltIcon /> },\n];\n\ntype InstallationStepProgressProps = {\n currentStep: AssetStep;\n};\n\nconst getStepStatus = (\n stepName: AssetStep,\n currentStep: AssetStep,\n): StepStatus => {\n const stepIndex = steps.findIndex((s) => s.name === stepName);\n const currentStepIndex = steps.findIndex((s) => s.name === currentStep);\n\n if (stepIndex < currentStepIndex) return StepStatus.Complete;\n if (stepIndex === currentStepIndex) return StepStatus.Current;\n return StepStatus.Upcoming;\n};\n\nconst InstallationStepProgress: FC<InstallationStepProgressProps> = ({\n currentStep,\n}) => {\n return (\n <nav className=\"flex w-full justify-center mb-8\">\n <ol role=\"list\" className=\"flex items-center\">\n {steps.map((step, stepIdx) => {\n const status = getStepStatus(step.name, currentStep);\n const isLastStep = stepIdx === steps.length - 1;\n\n return (\n <li\n key={step.name}\n className={classNames(\n !isLastStep ? \"pr-4 sm:pr-20\" : \"\",\n \"relative\",\n )}\n >\n <StepIcon status={status} step={step} />\n {!isLastStep && (\n <div\n aria-hidden=\"true\"\n className=\"absolute inset-0 flex items-center\"\n >\n <div\n className={classNames(\n status === StepStatus.Complete\n ? \"bg-flowerSkyVivid-500\"\n : \"bg-gray-200\",\n \"h-0.5 w-full\",\n )}\n />\n </div>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n\ntype StepProp = {\n name: AssetStep;\n icon: ReactNode;\n};\n\ntype StepIconProps = {\n status: StepStatus;\n step: StepProp;\n};\n\nconst StepIcon: FC<StepIconProps> = ({ status, step }) => {\n switch (status) {\n case StepStatus.Complete:\n return (\n <div className=\"relative flex h-12 w-12 p-3 items-center justify-center rounded-full bg-flowerSkyVivid-500 z-10\">\n <CheckIcon className=\"h-8 w-8 text-white\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{step.name}</span>\n </div>\n );\n\n case StepStatus.Current:\n return (\n <div\n aria-current=\"step\"\n className=\"relative flex h-12 w-12 p-3 items-center justify-center rounded-full bg-flowerSky-50 z-10\"\n >\n {cloneElement(\n step.icon as React.ReactElement<CustomSvgComponentProps>,\n {\n color: \"#4467FE\",\n className: \"text-flowerSkyVivid-500\",\n },\n )}\n <span className=\"sr-only\">{step.name}</span>\n </div>\n );\n\n case StepStatus.Upcoming:\n return (\n <div className=\"relative flex h-12 w-12 p-3 items-center justify-center rounded-full bg-gray-100 z-10\">\n {step.icon}\n <span className=\"sr-only\">{step.name}</span>\n </div>\n );\n\n default:\n return null;\n }\n};\n\nexport default InstallationStepProgress;\n","import { useTranslation } from \"react-i18next\";\nimport { ActionButton } from \"../../buttons/ActionButton\";\nimport { FC } from \"react\";\nimport { cloudFrontDomainUrl } from \"constants/environment\";\nimport { getDeviceForMedia } from \"helpers/installationFlow\";\n\ntype Props = {\n isErrored: boolean;\n changeStep: (step: number) => void;\n};\n\nexport const FinishingStep: FC<Props> = ({ isErrored, changeStep }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"flex flex-col items-center space-y-8\">\n <img\n src={`${cloudFrontDomainUrl}/installation-flow/${getDeviceForMedia()}/final-setup.jpg`}\n alt=\"Final setup\"\n className=\"w-full lg:w-2/3\"\n />\n\n <h2 className=\"text-xl font-bold text-center leading-tight\">\n {isErrored\n ? t(`batteryOverview.We are sorry, unable to register Flower Hub`)\n : t(`batteryOverview.Connecting to Flower Hub...`)}\n </h2>\n <p className=\"text-base text-gray-800 text-center\">\n {isErrored\n ? t(\n `batteryOverview.Double check the Serial number and retry the process, otherwise please contact distributor`,\n )\n : t(`batteryOverview.This might take a couple of minutes`)}\n </p>\n {isErrored && (\n <div className=\"flex w-full justify-end\">\n <ActionButton\n onClick={() => changeStep(1)}\n label={t(\"batteryOverview.Return to the first step\")}\n variant=\"primary\"\n />\n </div>\n )}\n </div>\n );\n};\n","export const debuggingGuide = \"https://www.flower.se/hub/felsokning/\";\nexport const installationGuide = \"https://flower.se/hub/installation-guide/\";\n\nexport const contactSupport = \"mailto:support@flowerhub.se\";\n","import { FC, Fragment } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { Checkbox } from \"components/input/Checkbox\";\nimport { useForm } from \"react-hook-form\";\nimport { installationGuide } from \"constants/externalLinks\";\nimport { cloudFrontDomainUrl } from \"constants/environment\";\nimport { Dialog, Transition } from \"@headlessui/react\";\nimport { XMarkIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\n\ntype Props = {\n isOpen: boolean;\n startTheInstallationSteps: () => void;\n onClose: () => void;\n};\n\nexport const BeforeYouStartStepModal: FC<Props> = ({\n isOpen,\n startTheInstallationSteps,\n onClose,\n}) => {\n const { t } = useTranslation();\n const { register, watch } = useForm<{ isRead: boolean }>({\n defaultValues: {\n isRead: false,\n },\n });\n\n const isRead = watch(\"isRead\");\n\n return (\n <Transition.Root show={isOpen} as={Fragment}>\n <Dialog as=\"div\" className=\"relative z-50\" onClose={onClose}>\n {/* Background Overlay */}\n <Transition.Child\n as={Fragment}\n enter=\"ease-out duration-300\"\n enterFrom=\"opacity-0\"\n enterTo=\"opacity-100\"\n leave=\"ease-in duration-100\"\n leaveFrom=\"opacity-100\"\n leaveTo=\"opacity-0\"\n >\n <div className=\"fixed inset-0 bg-black bg-opacity-50 transition-opacity\" />\n </Transition.Child>\n\n {/* Modal Content */}\n <div className=\"fixed inset-0 overflow-y-auto\">\n <div className=\"flex items-center justify-center min-h-full p-4 text-center sm:p-0\">\n <Transition.Child\n as={Fragment}\n enter=\"ease-out duration-300\"\n enterFrom=\"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95\"\n enterTo=\"opacity-100 translate-y-0 sm:scale-100\"\n leave=\"ease-in duration-200\"\n leaveFrom=\"opacity-100 translate-y-0 sm:scale-100\"\n leaveTo=\"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95\"\n >\n <Dialog.Panel className=\"relative bg-white rounded-lg shadow-xl transform transition-all sm:my-8 w-full max-w-2xl p-6\">\n {/* Close Button */}\n <button\n type=\"button\"\n className=\"absolute top-4 right-4 rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-flowerSky-500\"\n onClick={onClose}\n >\n <span className=\"sr-only\">Close</span>\n <XMarkIcon className=\"h-6 w-6\" aria-hidden=\"true\" />\n </button>\n\n {/* Modal Body */}\n <div>\n <div className=\"flex justify-center mt-4\">\n <img\n src={`${cloudFrontDomainUrl}/installation-flow/installation-guide-scroll.gif`}\n alt=\"installation guide setup\"\n className=\"w-full lg:w-2/5\"\n />\n </div>\n {/* Modal Title */}\n <Dialog.Title\n as=\"h2\"\n className=\"text-2xl font-medium text-gray-900 mt-8 mb-4\"\n >\n {t(\"batteryOverview.Before you start\")}\n </Dialog.Title>\n\n <div className=\"flex justify-center\">\n <div className=\"text-center lg:text-left text-sm w-9/12 font-normal text-gray-800\">\n <Trans\n i18nKey={\"batteryOverview.installationGuideReadCheck\"}\n components={{\n InstallationGuideLink: (\n <a\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n href={installationGuide}\n className=\"underline text-blue-600 hover:text-blue-800\"\n />\n ),\n }}\n />\n <div className=\"mt-4 text-left\">\n <Checkbox\n register={register}\n item={{\n label: t(\n \"batteryOverview.I have completed all the prerequisite steps in the installation guide\",\n ),\n name: \"isRead\",\n }}\n textSize=\"text-sm\"\n />\n </div>\n </div>\n </div>\n </div>\n\n {/* Modal Actions */}\n <div className=\"mt-8 flex justify-end\">\n <SecondaryButton\n size=\"small\"\n onClick={startTheInstallationSteps}\n disabled={!isRead}\n >\n {t(\"Get started\")}\n </SecondaryButton>\n </div>\n </Dialog.Panel>\n </Transition.Child>\n </div>\n </div>\n </Dialog>\n </Transition.Root>\n );\n};\n","import {\n AssetStep,\n getEmptyAssetInformation,\n} from \"components/installationFlow/installFlowerHub.helpers\";\nimport React, { useEffect, useState } from \"react\";\nimport { useCreateAsset } from \"api/asset/asset.endpoints\";\nimport {\n AssetInformation,\n AssetInformationStep,\n} from \"components/installationFlow/steps/AssetInformationStep\";\nimport { Fuse } from \"components/installationFlow/bessTypes\";\nimport { ConnectedEthStep } from \"./steps/ConnectedEthStep\";\nimport { SerialNumberStep } from \"./steps/SerialNumberStep\";\nimport { MetaDataConfirmationStep } from \"./steps/MetaDataConfirmationStep\";\nimport { PowerConfirmationStep } from \"./steps/PowerConfirmationStep\";\nimport InstallationStepProgress from \"./progress/InstallationStepProgress\";\nimport { FinishingStep } from \"./steps/FinishingStep\";\nimport { BeforeYouStartStepModal } from \"./steps/BeforeYouStartStep\";\n\ninterface Props {\n assetOwnerId: number;\n closeInstallationSteps: () => void;\n}\n\nexport const InstallFlowerHub: React.FC<Props> = ({\n assetOwnerId,\n closeInstallationSteps,\n}) => {\n // states\n const [currentStep, setCurrentStep] = useState<AssetStep | undefined>(\n undefined,\n );\n\n const [\n isReadInstallationGuideModalOpen,\n setIsReadInstallationGuideModalOpen,\n ] = React.useState(true);\n\n const handleCloseModal = () => setIsReadInstallationGuideModalOpen(false);\n\n const [assetInformation, setAssetInformation] = useState<AssetInformation>(\n getEmptyAssetInformation(),\n );\n\n const [serialNumber, setSerialNumber] = useState<string | undefined>(\n undefined,\n );\n\n const [fuse, setFuse] = useState<Fuse>();\n\n // api\n const { mutate: createAsset, isError } = useCreateAsset();\n\n useEffect(() => {\n if (currentStep === AssetStep.FINISHING) {\n onSubmitAsset();\n }\n }, [currentStep]);\n\n // submit\n const onSubmitAsset = () => {\n if (\n assetInformation.batteryCapacity &&\n assetInformation.inverterCapacity &&\n fuse &&\n serialNumber\n ) {\n return createAsset({\n assetOwnerId: assetOwnerId,\n serialNumber: serialNumber,\n fuseSize: fuse.ampere,\n inverterCapacityId: assetInformation.inverterCapacity.id,\n batteryCapacityId: assetInformation.batteryCapacity.id,\n\n // todo : remove these lines when only use new solution for asset model configuration\n inverterModelName: assetInformation.inverterModel.name,\n batteryModelName: assetInformation.batteryModel.name,\n inverterPowerCapacity: +assetInformation.inverterCapacity.power,\n bessCapacity: +assetInformation.batteryCapacity.energy,\n bessPowerCapacity: +assetInformation.batteryCapacity.power,\n });\n }\n };\n\n const resetTheView = () => {\n setCurrentStep(undefined);\n resetAssetInformation();\n handleCloseModal();\n closeInstallationSteps();\n };\n\n const resetAssetInformation = () => {\n setAssetInformation(getEmptyAssetInformation());\n setSerialNumber(\"\");\n setFuse(undefined);\n };\n\n const startTheInstallationSteps = () => {\n handleCloseModal();\n setCurrentStep(AssetStep.CONNECT_ETH);\n };\n\n return (\n <>\n <BeforeYouStartStepModal\n isOpen={isReadInstallationGuideModalOpen}\n startTheInstallationSteps={startTheInstallationSteps}\n onClose={resetTheView}\n />\n\n {currentStep && (\n <div className=\"flex justify-center bg-white rounded-md\">\n <div className=\"p-6 lg:px-10 w-full\">\n {!isReadInstallationGuideModalOpen &&\n currentStep !== AssetStep.FINISHING && (\n <InstallationStepProgress currentStep={currentStep} />\n )}\n <>\n {currentStep === AssetStep.CONNECT_ETH &&\n !isReadInstallationGuideModalOpen ? (\n <ConnectedEthStep\n changeStep={setCurrentStep}\n onCancel={resetTheView}\n />\n ) : currentStep === AssetStep.ASSET_INFORMATION ? (\n <AssetInformationStep\n changeStep={setCurrentStep}\n assetInformation={assetInformation}\n setAssetInformation={setAssetInformation}\n fuse={fuse}\n setFuse={setFuse}\n />\n ) : currentStep === AssetStep.SERIAL_NUMBER ? (\n <SerialNumberStep\n changeStep={setCurrentStep}\n serialNumber={serialNumber}\n setSerialNumber={setSerialNumber}\n />\n ) : currentStep === AssetStep.META_DATA_CONFIRMATION ? (\n <MetaDataConfirmationStep\n changeStep={setCurrentStep}\n assetInformation={assetInformation}\n assetSerialNumber={serialNumber}\n fuse={fuse}\n />\n ) : currentStep === AssetStep.POWER_CONFIRMATION ? (\n <PowerConfirmationStep changeStep={setCurrentStep} />\n ) : currentStep === AssetStep.FINISHING ? (\n <FinishingStep\n isErrored={isError}\n changeStep={setCurrentStep}\n />\n ) : null}\n </>\n </div>\n </div>\n )}\n </>\n );\n};\n","import { BadgeColor } from \"components/tags/Badge\";\nimport {\n FlowerHubInstallationProgressTitle,\n FlowerHubInstallationStatusMessageCode,\n FlowerHubStatus,\n} from \"enums/flowerHubStatus.enum\";\n\ntype ProgressInfo = {\n percentage: number;\n title?: FlowerHubInstallationProgressTitle;\n};\n\nexport function getProgressInfo(\n message: FlowerHubInstallationStatusMessageCode,\n): ProgressInfo {\n const progressMap: Record<\n FlowerHubInstallationStatusMessageCode,\n ProgressInfo\n > = {\n [FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningLastAttemptFailed]:\n {\n percentage: 5,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.FlowerHubWaitingForCertificateProvisioning]:\n {\n percentage: 10,\n title: FlowerHubInstallationProgressTitle.ConfigurationStarting,\n },\n [FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration]:\n {\n percentage: 20,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.FlowerHubNeverAttemptedToCertificateProvisioning]:\n {\n percentage: 20,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.WaitingToCreateIoTThing]: {\n percentage: 35,\n title: FlowerHubInstallationProgressTitle.ConfiguringFlowerHub,\n },\n [FlowerHubInstallationStatusMessageCode.IoTThingCreationFailed]: {\n percentage: 35,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.WaitingToCreateCoreDevice]: {\n percentage: 45,\n title: FlowerHubInstallationProgressTitle.ConfiguringFlowerHub,\n },\n [FlowerHubInstallationStatusMessageCode.CoreDeviceCreationFailed]: {\n percentage: 45,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.WaitingToStartDeployment]: {\n percentage: 50,\n title: FlowerHubInstallationProgressTitle.ConfiguringFlowerHub,\n },\n [FlowerHubInstallationStatusMessageCode.GreengrassDeploymentSucceeded]: {\n percentage: 100,\n title: FlowerHubInstallationProgressTitle.ConfiguringFlowerHub,\n },\n [FlowerHubInstallationStatusMessageCode.GreengrassDeploymentInProgress]: {\n percentage: 70,\n title: FlowerHubInstallationProgressTitle.ConfiguringFlowerHub,\n },\n [FlowerHubInstallationStatusMessageCode.RetryingDeploymentDueToFailure]: {\n percentage: 70,\n title: FlowerHubInstallationProgressTitle.ConfiguringFlowerHub,\n },\n [FlowerHubInstallationStatusMessageCode.GreengrassDeploymentFailed]: {\n percentage: 60,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.GreengrassDeploymentErrored]: {\n percentage: 60,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.UnableToFindGreengrassDeployment]: {\n percentage: 60,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.GreengrassDeploymentTimeout]: {\n percentage: 80,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.GreengrassDeploymentUnknownStatus]:\n {\n percentage: 60,\n title: FlowerHubInstallationProgressTitle.ConfigurationFailed,\n },\n [FlowerHubInstallationStatusMessageCode.FirstInstallationCompleted]: {\n percentage: 100,\n title: FlowerHubInstallationProgressTitle.ConfiguringFlowerHub,\n },\n };\n\n return progressMap[message];\n}\n\nexport function getStatusColor(status: FlowerHubStatus) {\n const progressMap: Record<FlowerHubStatus, BadgeColor> = {\n [FlowerHubStatus.Offline]: \"gray\",\n [FlowerHubStatus.UnstableConnection]: \"yellow\",\n [FlowerHubStatus.Connected]: \"green\",\n [FlowerHubStatus.Connecting]: \"blue\",\n [FlowerHubStatus.Unhealthy]: \"yellow\",\n [FlowerHubStatus.ConnectionFailed]: \"red\",\n [FlowerHubStatus.ConnectionTimeout]: \"red\",\n [FlowerHubStatus.UpdateFailed]: \"red\",\n [FlowerHubStatus.Updating]: \"blue\",\n [FlowerHubStatus.DeviceError]: \"red\",\n [FlowerHubStatus.ConfigurationFailed]: \"red\",\n [FlowerHubStatus.Configuring]: \"blue\",\n [FlowerHubStatus.Unknown]: \"gray\",\n };\n\n return progressMap[status];\n}\n\nexport function getCurrentStepIndex(\n message: FlowerHubInstallationStatusMessageCode,\n firstDeploymentCompletedAt?: Date,\n): number {\n if (firstDeploymentCompletedAt) return 5;\n switch (message) {\n // Certificate Provisioning\n case FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration:\n case FlowerHubInstallationStatusMessageCode.FlowerHubNeverAttemptedToCertificateProvisioning:\n case FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningLastAttemptFailed:\n case FlowerHubInstallationStatusMessageCode.FlowerHubWaitingForCertificateProvisioning:\n return 1;\n\n // IoT Stack Creating\n case FlowerHubInstallationStatusMessageCode.WaitingToCreateIoTThing:\n case FlowerHubInstallationStatusMessageCode.IoTThingCreationFailed:\n return 2;\n\n // Core Device Creating\n case FlowerHubInstallationStatusMessageCode.WaitingToCreateCoreDevice:\n case FlowerHubInstallationStatusMessageCode.CoreDeviceCreationFailed:\n return 3;\n\n // First Deployment\n case FlowerHubInstallationStatusMessageCode.WaitingToStartDeployment:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentInProgress:\n case FlowerHubInstallationStatusMessageCode.RetryingDeploymentDueToFailure:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentSucceeded:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentFailed:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentErrored:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentTimeout:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentUnknownStatus:\n case FlowerHubInstallationStatusMessageCode.UnableToFindGreengrassDeployment:\n return 4;\n\n default:\n return 5;\n }\n}\n\nexport function isInstallationFailureMessageCode(\n message: FlowerHubInstallationStatusMessageCode,\n): boolean {\n switch (message) {\n case FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration:\n case FlowerHubInstallationStatusMessageCode.FlowerHubNeverAttemptedToCertificateProvisioning:\n case FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningLastAttemptFailed:\n case FlowerHubInstallationStatusMessageCode.IoTThingCreationFailed:\n case FlowerHubInstallationStatusMessageCode.CoreDeviceCreationFailed:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentFailed:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentErrored:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentTimeout:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentUnknownStatus:\n case FlowerHubInstallationStatusMessageCode.UnableToFindGreengrassDeployment:\n return true;\n\n default:\n return false;\n }\n}\n\nexport function mapInstallationFailureActionByMessageCode(\n message: FlowerHubInstallationStatusMessageCode,\n): string | undefined {\n switch (message) {\n case FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration:\n case FlowerHubInstallationStatusMessageCode.FlowerHubNeverAttemptedToCertificateProvisioning:\n case FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningLastAttemptFailed:\n return \"IE1\";\n case FlowerHubInstallationStatusMessageCode.IoTThingCreationFailed:\n return \"IE2\";\n case FlowerHubInstallationStatusMessageCode.CoreDeviceCreationFailed:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentTimeout:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentUnknownStatus:\n case FlowerHubInstallationStatusMessageCode.UnableToFindGreengrassDeployment:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentFailed:\n case FlowerHubInstallationStatusMessageCode.GreengrassDeploymentErrored:\n return \"IE3\";\n\n default:\n return undefined;\n }\n}\n","import React from \"react\";\nimport { classNames } from \"../../helpers/classNames\";\n\nexport const OfflineWifiIcon: React.FC<{ className?: string }> = ({\n className,\n}) => (\n <svg\n className={classNames(\"h-5 w-5 flex-shrink-0\", className ? className : \"\")}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <g id=\"Wifi_Off\">\n <path\n d=\"M17.8506 11.5442C17.0475 10.6829 16.0641 10.0096 14.9707 9.57227M20.7759 8.81625C19.5712 7.52437 18.0961 6.51439 16.4561 5.8584C14.816 5.20241 13.0514 4.91635 11.2881 5.02111M8.34277 14.5905C8.95571 13.9332 9.73448 13.4532 10.5971 13.2012C11.4598 12.9491 12.3745 12.9335 13.2449 13.1574M6.14941 11.5438C7.09778 10.5268 8.29486 9.77461 9.62259 9.36133M3.22363 8.81604C4.1215 7.85319 5.17169 7.04466 6.33211 6.42285M4.41406 4L18.5562 18.1421M12 19C11.4477 19 11 18.5523 11 18C11 17.4477 11.4477 17 12 17C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n </svg>\n);\n","import React from \"react\";\nimport { classNames } from \"../../helpers/classNames\";\n\nexport const UnstableWifiIcon: React.FC<{ className?: string }> = ({\n className,\n}) => (\n <svg\n className={classNames(\"h-5 w-5 flex-shrink-0\", className ? className : \"\")}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <g id=\"Wifi_Unstable\">\n <path\n d=\"M8.34277 14.5898C8.80861 14.0902 9.37187 13.6914 9.9978 13.418C10.6237 13.1445 11.2995 13.0024 11.9826 13C12.6656 12.9976 13.3419 13.1353 13.9697 13.4044C14.5975 13.6734 15.1637 14.0682 15.633 14.5645M6.14941 11.5439C6.89312 10.7464 7.79203 10.1093 8.79091 9.67188C9.7898 9.23441 10.8678 9.00575 11.9583 9M3.22363 8.81649C4.34177 7.61743 5.69376 6.66021 7.19618 6.00391C8.69859 5.3476 10.3198 5.00558 11.9593 5M16 8.99997L18 6.99998M18 6.99998L20 5M18 6.99998L16 5M18 6.99998L20 8.99997M12 19C11.4477 19 11 18.5523 11 18C11 17.4477 11.4477 17 12 17C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19Z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n </svg>\n);\n","import React from \"react\";\nimport { config } from \"react-spring\";\nimport { Transition } from \"../animations/Transition\";\nimport { classNames } from \"../../helpers/classNames\";\nimport { useTranslation } from \"react-i18next\";\nimport { IoTConnectivityStatus } from \"../../enums/flowerHubStatus.enum\";\nimport { OfflineWifiIcon } from \"../../styles/icons/OfflineWifiIcon\";\nimport { UnstableWifiIcon } from \"../../styles/icons/UnstableWifiIcon\";\n\ntype Props = {\n iotConnectivityStatus?: IoTConnectivityStatus;\n className?: string;\n transitionOptions?: object;\n};\n\nexport const IoTConnectivityNotificationToaster: React.FC<Props> = ({\n iotConnectivityStatus,\n className = \"\",\n transitionOptions = {},\n}) => {\n const { t } = useTranslation();\n\n return (\n <Transition\n isVisible={\n iotConnectivityStatus === IoTConnectivityStatus.Offline ||\n iotConnectivityStatus === IoTConnectivityStatus.Unstable\n }\n settings={{\n ...{\n from: {\n opacity: 0,\n transform: \"translate3d(0, -44px, 0px)\",\n },\n enter: {\n opacity: 1,\n transform: \"translate3d(0px, 0px, 0px)\",\n },\n config: { ...config.default },\n },\n ...transitionOptions,\n }}\n className={\"w-full\"}\n >\n <div\n className={classNames(\n \"flex absolute justify-center items-center text-sm h-9 w-full px-6\",\n getColorFromIoTConnectivityStatus(iotConnectivityStatus),\n className,\n )}\n >\n {getIconFromIoTConnectivityStatus(iotConnectivityStatus)}\n <span>\n {t(getTextFromIoTConnectivityStatus(iotConnectivityStatus))}\n </span>\n </div>\n </Transition>\n );\n};\n\nconst getColorFromIoTConnectivityStatus = (\n connectivityStatus?: IoTConnectivityStatus,\n): string => {\n switch (connectivityStatus) {\n case IoTConnectivityStatus.Offline:\n return \"bg-gray-100 text-gray-500\";\n case IoTConnectivityStatus.Unstable:\n return \"bg-yellow-100 text-yellow-500\";\n default:\n return \"bg-gray-100 text-gray-500\";\n }\n};\n\nconst getTextFromIoTConnectivityStatus = (\n connectivityStatus?: IoTConnectivityStatus,\n): string => {\n switch (connectivityStatus) {\n case IoTConnectivityStatus.Offline:\n return \"PresenceEvents.notifyDisconnection\";\n case IoTConnectivityStatus.Unstable:\n return \"PresenceEvents.notifyUnstableConnection\";\n default:\n return \"PresenceEvents.notifyUnknownConnection\";\n }\n};\n\nconst getIconFromIoTConnectivityStatus = (\n connectivityStatus?: IoTConnectivityStatus,\n): React.ReactNode => {\n switch (connectivityStatus) {\n case IoTConnectivityStatus.Offline:\n return <OfflineWifiIcon className={\"mr-2\"} />;\n case IoTConnectivityStatus.Unstable:\n return <UnstableWifiIcon className={\"mr-2\"} />;\n default:\n return;\n }\n};\n","import { FC } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport {\n ExclamationTriangleIcon,\n LightBulbIcon,\n} from \"@heroicons/react/24/outline\";\nimport {\n FlowerHubInstallationProgressTitle,\n FlowerHubInstallationStatusMessageCode,\n IoTConnectivityStatus,\n} from \"enums/flowerHubStatus.enum\";\nimport {\n getProgressInfo,\n mapInstallationFailureActionByMessageCode,\n} from \"helpers/installationProgress\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport { debuggingGuide } from \"constants/externalLinks\";\nimport { IoTConnectivityNotificationToaster } from \"../IoTConnectivityNotificationToaster\";\n\ntype Prop = {\n serialNumber: string;\n installationStatus: FlowerHubInstallationStatusMessageCode;\n maxDeploymentAttempts: number;\n retryDeploymentAttempt?: number;\n iotConnectivityStatus?: IoTConnectivityStatus;\n};\n\nconst InstallationProgress: FC<Prop> = ({\n serialNumber,\n installationStatus,\n maxDeploymentAttempts,\n retryDeploymentAttempt,\n iotConnectivityStatus,\n}) => {\n const { t } = useTranslation();\n const { percentage, title } = getProgressInfo(installationStatus);\n const actionMessage =\n mapInstallationFailureActionByMessageCode(installationStatus);\n\n const renderIcon = () => {\n switch (title) {\n case FlowerHubInstallationProgressTitle.ConfigurationFailed:\n return (\n <ExclamationTriangleIcon className=\"h-7 w-7 mr-2 text-red-500\" />\n );\n default:\n return null;\n }\n };\n\n return (\n <div className=\"bg-white w-full rounded-md mb-4\">\n <IoTConnectivityNotificationToaster\n iotConnectivityStatus={iotConnectivityStatus}\n className={\"rounded-t-md\"}\n />\n\n <div className=\"flex flex-col items-center p-6 pt-12\">\n <img\n src={FlowerSymbolLogo}\n alt=\"Flower symbol\"\n className=\"w-16 h-16 my-6 animate-spin-slow\"\n />\n\n <span className=\"text-3xl font-medium mb-14\">{serialNumber}</span>\n\n <div className=\"w-3/4 lg:w-1/2 rounded-full bg-gray-200 overflow-hidden\">\n <div\n style={{ width: `${percentage}%` }}\n className=\"h-2 bg-flowerSkyVivid-500 rounded-full\"\n />\n </div>\n\n <h2 className=\"mt-8 text-xl text-center flex items-center\">\n {renderIcon()}\n {title}\n </h2>\n\n {installationStatus ===\n FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration ? (\n <div className=\"mt-8 text-gray-800 text-start\">\n <p>\n {t(\n \"flowerHubProgress.installerInstallationProgressMessageForInstallerView.FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration_I\",\n )}\n </p>\n <ul className=\"list-disc pl-8 pt-2\">\n <li>\n {t(\"flowerHubProgress.Flower Hub is connected to the internet\")}\n </li>\n <li>\n {t(\n \"flowerHubProgress.The correct serial number has been entered\",\n )}\n </li>\n </ul>\n </div>\n ) : installationStatus ===\n FlowerHubInstallationStatusMessageCode.FlowerHubNeverAttemptedToCertificateProvisioning ? (\n <div className=\"mt-8 text-gray-800 text-start\">\n <p>\n {t(\n \"flowerHubProgress.installerInstallationProgressMessageForInstallerView.FlowerHubNeverAttemptedToCertificateProvisioning_I\",\n )}\n </p>\n <ul className=\"list-disc pl-8 pt-2\">\n <li>\n {t(\"flowerHubProgress.Flower Hub is connected to the internet\")}\n </li>\n <li>\n {t(\n \"flowerHubProgress.The correct serial number has been entered\",\n )}\n </li>\n </ul>\n </div>\n ) : (\n <p className=\"mt-8 text-gray-800 text-center\">\n {t(\n `flowerHubProgress.installerInstallationProgressMessageForInstallerView.${installationStatus}`,\n {\n attempt: retryDeploymentAttempt,\n totalAttempts: maxDeploymentAttempts,\n },\n )}\n </p>\n )}\n\n {actionMessage && (\n <div className=\"rounded-md bg-blue-100 p-2 sm:mt-10 mt-4\">\n <div className=\"flex\">\n <div className=\"flex-shrink-0 mt-[2px]\">\n <LightBulbIcon\n aria-hidden=\"true\"\n className=\"h-4 w-4 text-blue-500\"\n />\n </div>\n <div className=\"ml-1 flex-1 md:flex\">\n <p className=\"text-sm text-blue-700 text-left whitespace-pre-line\">\n <Trans\n i18nKey={`flowerHubProgress.installationProgressErrorDebuggingGuideAction.${actionMessage}`}\n components={{\n DebuggingGuideLink: (\n <a\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n href={debuggingGuide}\n style={{ textDecoration: \"underline\" }}\n />\n ),\n }}\n />\n </p>\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default InstallationProgress;\n","import React, { RefObject, useRef, useState } from \"react\";\nimport { Player } from \"@lottiefiles/react-lottie-player\";\nimport { isMobile } from \"react-device-detect\";\n\nexport enum OperationalStatusAnimationTypes {\n ConnectingAnimation = \"connecting\",\n ConnectedAnimation = \"connected\",\n ErrorAnimation = \"error\",\n UnhealthyAnimation = \"unhealthy\",\n Unknown = \"unknown\",\n}\n\nexport interface LottiePlayerProps {\n animationType: OperationalStatusAnimationTypes;\n id: string;\n}\n\nconst LottiePlayer: React.FC<LottiePlayerProps> = ({ animationType, id }) => {\n const playerRef: RefObject<Player> = useRef<Player>(null);\n const [animationIndex, setAnimationIndex] = useState(1);\n\n const moveToNextAnimation = () => {\n const player = playerRef.current;\n if (player) {\n if (\n animationType === OperationalStatusAnimationTypes.ConnectedAnimation ||\n animationType === OperationalStatusAnimationTypes.UnhealthyAnimation\n ) {\n setAnimationIndex(animationIndex + 1);\n }\n }\n };\n\n const isLoopingAnimation =\n animationType === OperationalStatusAnimationTypes.ConnectingAnimation ||\n (animationType === OperationalStatusAnimationTypes.ConnectedAnimation &&\n animationIndex === 2) ||\n (animationType === OperationalStatusAnimationTypes.UnhealthyAnimation &&\n animationIndex === 2);\n\n const animationSrc = `/operational-status/${isMobile ? \"mobile/\" : \"\"}${animationType}${\n animationType === OperationalStatusAnimationTypes.ConnectedAnimation ||\n animationType === OperationalStatusAnimationTypes.UnhealthyAnimation\n ? `_${animationIndex}`\n : \"\"\n }.json`;\n\n return (\n <Player\n id={id}\n autoplay={\n animationType === OperationalStatusAnimationTypes.Unknown ? false : true\n }\n loop={isLoopingAnimation}\n keepLastFrame={true}\n ref={playerRef}\n src={animationSrc}\n style={{\n width: isMobile ? \"40px\" : \"160px\",\n height: isMobile ? \"100px\" : \"40px\",\n }}\n onEvent={(event) => {\n if (event === \"complete\") {\n moveToNextAnimation();\n }\n }}\n ></Player>\n );\n};\n\nexport default LottiePlayer;\n","import React from \"react\";\nimport { LightBulbIcon } from \"@heroicons/react/24/outline\";\nimport {\n OperationalStatusFlowerCloudIcon,\n OperationalStatusFlowerHubIcon,\n OperationalStatusInverterIcon,\n} from \"styles/Icons\";\nimport { Trans } from \"react-i18next\";\nimport { debuggingGuide } from \"constants/externalLinks\";\nimport { isMobile } from \"react-device-detect\";\nimport { classNames } from \"helpers/classNames\";\nimport LottiePlayer from \"./LottiePlayer\";\n\nexport enum OperationalStatusAnimationTypes {\n ConnectingAnimation = \"connecting\",\n ConnectedAnimation = \"connected\",\n ErrorAnimation = \"error\",\n UnhealthyAnimation = \"unhealthy\",\n Unknown = \"unknown\",\n}\nexport interface OperationStatusGridProps {\n leftAnimationType: OperationalStatusAnimationTypes;\n rightAnimationType: OperationalStatusAnimationTypes;\n leftText?: string;\n rightText?: string;\n leftActionText?: string;\n rightActionText?: string;\n}\n\nconst OperationStatusGrid: React.FC<OperationStatusGridProps> = ({\n leftAnimationType,\n rightAnimationType,\n leftText,\n rightText,\n leftActionText,\n rightActionText,\n}) => {\n return (\n <div className=\"w-full flex justify-center my-10\">\n <div\n className={classNames(\n isMobile ? \"grid-cols-1\" : \"grid-cols-5 gap-6\",\n \"grid max-w-4xl\",\n )}\n >\n {/* Inverter Section */}\n <div className=\"flex flex-col items-center text-center\">\n <img\n src={OperationalStatusInverterIcon}\n alt=\"Inverter\"\n className={isMobile ? \"w-24\" : \"w-32\"}\n />\n </div>\n\n {/* First connector and Text Section */}\n {isMobile ? (\n <div className=\"grid grid-cols-3 items-center w-full my-4\">\n <div className=\"text-right\">\n <p className=\"text-sm font-medium\">{leftText ?? \" \"}</p>\n </div>\n\n <div className=\"flex justify-center\">\n <LottiePlayer\n animationType={leftAnimationType}\n id=\"leftAnimation\"\n />\n </div>\n\n <div className=\"text-left\">\n {leftActionText && (\n <div className=\"rounded-md bg-blue-100 p-2 mt-4\">\n <div className=\"flex\">\n <div className=\"flex-shrink-0\">\n <LightBulbIcon\n aria-hidden=\"true\"\n className=\"h-4 w-4 text-blue-500\"\n />\n </div>\n <div className=\"ml-1 flex-1 md:flex\">\n <p className=\"text-xs text-blue-700 text-left whitespace-pre-line\">\n <Trans\n i18nKey={leftActionText}\n components={{\n DebuggingGuideLink: (\n <a\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n href={debuggingGuide}\n style={{ textDecoration: \"underline\" }}\n />\n ),\n }}\n />\n </p>\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-start text-center pt-4 mb-8\">\n <LottiePlayer\n animationType={leftAnimationType}\n id=\"leftAnimation\"\n />\n <p className=\"text-sm font-medium mt-4\">{leftText ?? \" \"}</p>\n\n {leftActionText && (\n <div className=\"rounded-md bg-blue-100 p-2 mt-4\">\n <div className=\"flex\">\n <div className=\"flex-shrink-0\">\n <LightBulbIcon\n aria-hidden=\"true\"\n className=\"h-4 w-4 text-blue-500\"\n />\n </div>\n <div className=\"ml-1 flex-1 md:flex\">\n <p className=\"text-xs text-blue-700 text-left whitespace-pre-line\">\n <Trans\n i18nKey={leftActionText}\n components={{\n DebuggingGuideLink: (\n <a\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n href={debuggingGuide}\n style={{ textDecoration: \"underline\" }}\n />\n ),\n }}\n />\n </p>\n </div>\n </div>\n </div>\n )}\n </div>\n )}\n\n {/* Flower Hub Section */}\n <div className=\"flex flex-col items-center text-center\">\n <img\n src={OperationalStatusFlowerHubIcon}\n alt=\"Flower Hub Device\"\n className={isMobile ? \"w-24\" : \"w-32\"}\n />\n </div>\n\n {/* Second connector and Text Section */}\n {isMobile ? (\n <div className=\"grid grid-cols-3 items-center w-full my-4\">\n <div className=\"text-right\">\n <p className=\"text-sm font-medium\">{rightText ?? \" \"}</p>\n </div>\n\n <div className=\"flex justify-center\">\n <LottiePlayer\n animationType={rightAnimationType}\n id=\"rightAnimation\"\n />\n </div>\n\n <div className=\"text-left\">\n {rightActionText && (\n <div className=\"rounded-md bg-blue-100 p-2\">\n <div className=\"flex\">\n <div className=\"flex-shrink-0\">\n <LightBulbIcon\n aria-hidden=\"true\"\n className=\"h-4 w-4 text-blue-500\"\n />\n </div>\n <div className=\"ml-1 flex-1 md:flex\">\n <p className=\"text-xs text-blue-700 text-left whitespace-pre-line\">\n <Trans\n i18nKey={rightActionText}\n components={{\n DebuggingGuideLink: (\n <a\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n href={debuggingGuide}\n style={{ textDecoration: \"underline\" }}\n />\n ),\n }}\n />\n </p>\n </div>\n </div>\n </div>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex-col items-center justify-start text-center pt-4 mb-8\">\n <LottiePlayer\n animationType={rightAnimationType}\n id=\"rightAnimation\"\n />\n <p className=\"text-sm font-medium mt-4\">{rightText ?? \" \"}</p>\n\n {rightActionText && (\n <div className=\"rounded-md bg-blue-100 p-2 mt-4 \">\n <div className=\"flex\">\n <div className=\"flex-shrink-0\">\n <LightBulbIcon\n aria-hidden=\"true\"\n className=\"h-4 w-4 text-blue-500\"\n />\n </div>\n <div className=\"ml-1 flex-1 md:flex\">\n <p className=\"text-xs text-blue-700 text-left whitespace-pre-line\">\n <Trans\n i18nKey={rightActionText}\n components={{\n DebuggingGuideLink: (\n <a\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n href={debuggingGuide}\n style={{ textDecoration: \"underline\" }}\n />\n ),\n }}\n />\n </p>\n </div>\n </div>\n </div>\n )}\n </div>\n )}\n\n {/* Cloud Section */}\n <div className=\"flex flex-col items-center text-center\">\n <img\n src={OperationalStatusFlowerCloudIcon}\n alt=\"Cloud\"\n className={isMobile ? \"w-24\" : \"w-32\"}\n />\n </div>\n </div>\n </div>\n );\n};\n\nexport default OperationStatusGrid;\n","import {\n OperationalStatusAnimationTypes,\n OperationStatusGridProps,\n} from \"components/flowerHub/operationalProgress/OperationStatusGrid\";\nimport { BadgeColor } from \"components/tags/Badge\";\nimport {\n FlowerHubOperationalStatusMessageCode,\n FlowerHubStatus,\n} from \"enums/flowerHubStatus.enum\";\n\nexport function getOperationalStatus(\n message: FlowerHubOperationalStatusMessageCode,\n): {\n status: FlowerHubStatus;\n color: BadgeColor;\n} {\n switch (message) {\n case FlowerHubOperationalStatusMessageCode.GreengrassDeploymentInProgress:\n return { status: FlowerHubStatus.Updating, color: \"blue\" };\n case FlowerHubOperationalStatusMessageCode.GreengrassDeploymentFailed:\n case FlowerHubOperationalStatusMessageCode.GreengrassDeploymentErrored:\n case FlowerHubOperationalStatusMessageCode.GreengrassDeploymentUnknownStatus:\n return { status: FlowerHubStatus.UpdateFailed, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleScanningAndComponentsAreRunning:\n return { status: FlowerHubStatus.Connecting, color: \"blue\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleScanningAndComponentsAreUnhealthy:\n return { status: FlowerHubStatus.Connecting, color: \"blue\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleScanningAndComponentsAreBroken:\n return { status: FlowerHubStatus.DeviceError, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleFoundAndComponentsAreRunning:\n return { status: FlowerHubStatus.Connected, color: \"green\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleFoundAndComponentsAreRunningWithUnstableIoTConnectivity:\n return { status: FlowerHubStatus.UnstableConnection, color: \"yellow\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleFoundAndComponentsAreUnhealthy:\n return { status: FlowerHubStatus.Unhealthy, color: \"yellow\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleFoundAndComponentsAreBroken:\n return { status: FlowerHubStatus.DeviceError, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleNotFoundAndComponentsAreRunning:\n return { status: FlowerHubStatus.ConnectionFailed, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleNotFoundAndComponentsAreUnhealthy:\n return { status: FlowerHubStatus.ConnectionFailed, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleNotFoundAndComponentsAreBroken:\n return { status: FlowerHubStatus.DeviceError, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleScanningTimeoutAndComponentsAreRunning:\n return { status: FlowerHubStatus.ConnectionTimeout, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleScanningTimeoutAndComponentsAreUnhealthy:\n return { status: FlowerHubStatus.ConnectionTimeout, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleScanningTimeoutAndComponentsAreBroken:\n return { status: FlowerHubStatus.DeviceError, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleUnstableConnectivityAndComponentsAreRunning:\n return { status: FlowerHubStatus.UnstableConnection, color: \"yellow\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleUnstableConnectivityAndComponentsAreUnhealthy:\n return { status: FlowerHubStatus.Unhealthy, color: \"yellow\" };\n case FlowerHubOperationalStatusMessageCode.InverterDongleUnstableConnectivityAndComponentsAreBroken:\n return { status: FlowerHubStatus.DeviceError, color: \"red\" };\n case FlowerHubOperationalStatusMessageCode.OfflineIoTConnectivity:\n return { status: FlowerHubStatus.Offline, color: \"gray\" };\n default:\n return { status: FlowerHubStatus.Unknown, color: \"gray\" };\n }\n}\n\nexport const operationStatusMapping: Record<\n FlowerHubOperationalStatusMessageCode,\n OperationStatusGridProps\n> = {\n [FlowerHubOperationalStatusMessageCode.GreengrassDeploymentInProgress]: {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ConnectingAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentInProgress.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentInProgress.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentInProgress.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.GreengrassDeploymentFailed]: {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentFailed.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentFailed.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentFailed.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.GreengrassDeploymentErrored]: {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentErrored.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentErrored.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentErrored.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.GreengrassDeploymentUnknownStatus]: {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentUnknownStatus.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentUnknownStatus.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.GreengrassDeploymentUnknownStatus.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleScanningAndComponentsAreRunning]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.ConnectingAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.ConnectedAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningAndComponentsAreRunning.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningAndComponentsAreRunning.rightText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleScanningAndComponentsAreUnhealthy]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.ConnectingAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningAndComponentsAreUnhealthy.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningAndComponentsAreUnhealthy.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningAndComponentsAreUnhealthy.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleScanningAndComponentsAreBroken]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningAndComponentsAreBroken.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningAndComponentsAreBroken.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningAndComponentsAreBroken.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleFoundAndComponentsAreRunning]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.ConnectedAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.ConnectedAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreRunning.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreRunning.rightText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleFoundAndComponentsAreUnhealthy]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.ConnectedAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreUnhealthy.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreUnhealthy.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreUnhealthy.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleFoundAndComponentsAreBroken]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreBroken.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreBroken.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreBroken.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleFoundAndComponentsAreRunningWithUnstableIoTConnectivity]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.ConnectedAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreRunning.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleFoundAndComponentsAreRunningWithUnstableIoTConnectivity.rightText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleNotFoundAndComponentsAreRunning]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.ConnectedAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreRunning.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreRunning.rightText\",\n leftActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreRunning.leftActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleNotFoundAndComponentsAreUnhealthy]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreUnhealthy.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreUnhealthy.rightText\",\n leftActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreUnhealthy.leftActionText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreUnhealthy.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleNotFoundAndComponentsAreBroken]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreBroken.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreBroken.rightText\",\n leftActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleNotFoundAndComponentsAreBroken.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleScanningTimeoutAndComponentsAreRunning]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ConnectedAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreRunning.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreRunning.rightText\",\n leftActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreRunning.leftActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleScanningTimeoutAndComponentsAreUnhealthy]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreUnhealthy.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreUnhealthy.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreUnhealthy.rightActionText\",\n leftActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreUnhealthy.leftActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleScanningTimeoutAndComponentsAreBroken]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreBroken.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreBroken.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreBroken.rightActionText\",\n leftActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleScanningTimeoutAndComponentsAreBroken.leftActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleUnstableConnectivityAndComponentsAreRunning]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.ConnectedAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleUnstableConnectivityAndComponentsAreRunning.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleUnstableConnectivityAndComponentsAreRunning.rightText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleUnstableConnectivityAndComponentsAreUnhealthy]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleUnstableConnectivityAndComponentsAreUnhealthy.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleUnstableConnectivityAndComponentsAreUnhealthy.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleUnstableConnectivityAndComponentsAreUnhealthy.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.InverterDongleUnstableConnectivityAndComponentsAreBroken]:\n {\n leftAnimationType: OperationalStatusAnimationTypes.UnhealthyAnimation,\n rightAnimationType: OperationalStatusAnimationTypes.ErrorAnimation,\n leftText:\n \"flowerHubProgress.operationalStatus.InverterDongleUnstableConnectivityAndComponentsAreBroken.leftText\",\n rightText:\n \"flowerHubProgress.operationalStatus.InverterDongleUnstableConnectivityAndComponentsAreBroken.rightText\",\n rightActionText:\n \"flowerHubProgress.operationalStatus.InverterDongleUnstableConnectivityAndComponentsAreBroken.rightActionText\",\n },\n [FlowerHubOperationalStatusMessageCode.OfflineIoTConnectivity]: {\n leftAnimationType: OperationalStatusAnimationTypes.Unknown,\n rightAnimationType: OperationalStatusAnimationTypes.Unknown,\n leftText: \"\",\n rightText:\n \"flowerHubProgress.operationalStatus.OfflineIoTConnectivity.rightText\",\n },\n};\n","import { OperationalStatusDTO } from \"api/flowerHub/flowerHub.dto\";\nimport { Role } from \"enums/role.enum\";\nimport { classNames } from \"helpers/classNames\";\nimport { getOperationalStatus } from \"helpers/operationalProgress\";\nimport { isFlower } from \"helpers/role\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ntype Prop = {\n operationalStatus: OperationalStatusDTO;\n serialNumber: string;\n userRole: Role;\n};\n\nconst OperationalStatistics: FC<Prop> = ({\n operationalStatus,\n serialNumber,\n userRole,\n}) => {\n const { t } = useTranslation();\n const { status, color } = getOperationalStatus(operationalStatus.status);\n\n let stats = [\n { name: t(`batteryOverview.Serial number`), stat: serialNumber },\n {\n name: t(`flowerHubProgress.operationalStats.Dongle Ip address`),\n stat: operationalStatus.dongleIp ?? \"-\",\n },\n {\n name: t(`flowerHubProgress.operationalStats.Flower Hub Ip address`),\n stat: operationalStatus.flowerHubIp ?? \"-\",\n },\n {\n name: t(`flowerHubProgress.operationalStats.Status`),\n stat: status,\n color,\n },\n ];\n\n // Remove the first item (serialNumber) if the user is a flower user\n if (isFlower(userRole)) {\n stats = stats.slice(1);\n }\n\n return (\n <dl\n className={classNames(\n isFlower(userRole) ? \"sm:grid-cols-3\" : \"sm:grid-cols-4\",\n \"mt-2 grid grid-cols-1 gap-5\",\n )}\n >\n {stats.map((item) => (\n <div\n key={item.name}\n className=\"overflow-hidden rounded-lg bg-white px-4 py-5 shadow sm:p-6\"\n >\n <dt className=\"truncate text-sm text-xs lg:text-sm font-medium text-gray-500\">\n {item.name}\n </dt>\n <dd\n className={classNames(\n item?.color ? `text-${item.color}-500` : \"text-gray-900\",\n \"mt-1 text-l lg:text-xl tracking-tight\",\n )}\n >\n {item.stat}\n </dd>\n </div>\n ))}\n </dl>\n );\n};\n\nexport default OperationalStatistics;\n","import { OperationalStatusDTO } from \"api/flowerHub/flowerHub.dto\";\nimport { Badge } from \"components/tags/Badge\";\nimport { Role } from \"enums/role.enum\";\nimport { isFlower } from \"helpers/role\";\nimport React, { FC } from \"react\";\nimport OperationalStatistics from \"./OperationalStatistics\";\nimport { Panel } from \"components/Panel\";\nimport { useTranslation } from \"react-i18next\";\nimport OperationStatusGrid from \"./OperationStatusGrid\";\nimport { operationStatusMapping } from \"helpers/operationalProgress\";\nimport { IoTConnectivityNotificationToaster } from \"../IoTConnectivityNotificationToaster\";\nimport { IoTConnectivityStatus } from \"../../../enums/flowerHubStatus.enum\";\n\ntype Prop = {\n operationalStatus: OperationalStatusDTO;\n serialNumber: string;\n userRole: Role;\n iotConnectivityStatus?: IoTConnectivityStatus;\n};\n\nconst OperationalProgress: FC<Prop> = ({\n operationalStatus,\n serialNumber,\n userRole,\n iotConnectivityStatus,\n}) => {\n const { t } = useTranslation();\n\n const {\n leftAnimationType,\n rightAnimationType,\n leftText,\n rightText,\n leftActionText,\n rightActionText,\n } = operationStatusMapping[operationalStatus.status];\n\n return (\n <Panel\n header={t(`flowerHubProgress.Device status`)}\n infoText={t(`flowerHubProgress.Device status info`)}\n toaster={\n <IoTConnectivityNotificationToaster\n iotConnectivityStatus={iotConnectivityStatus}\n className={\"relative\"}\n transitionOptions={{\n from: {\n opacity: 0,\n transform: \"translate3d(0, 0px, 0px)\",\n },\n }}\n />\n }\n >\n <div className=\"bg-white p-4 w-full rounded-md\">\n <OperationalStatistics\n serialNumber={serialNumber}\n operationalStatus={operationalStatus}\n userRole={userRole}\n />\n <OperationStatusGrid\n leftAnimationType={leftAnimationType}\n rightAnimationType={rightAnimationType}\n leftText={t(`${leftText}`)}\n rightText={t(`${rightText}`)}\n leftActionText={leftActionText}\n rightActionText={rightActionText}\n />\n {isFlower(userRole) && (\n <div className=\"flex justify-center items-center\">\n <Badge color=\"gray\" text={operationalStatus.status} />\n </div>\n )}\n </div>\n </Panel>\n );\n};\n\nexport default OperationalProgress;\n","import React from \"react\";\nimport { StepStatus } from \"enums/flowerHubStatus.enum\";\nimport { CheckIcon } from \"@heroicons/react/24/solid\";\nimport { useTranslation } from \"react-i18next\";\nimport { formatDateTime } from \"helpers/date\";\nimport { XMarkIcon } from \"@heroicons/react/24/outline\";\nimport { classNames } from \"helpers/classNames\";\n\nexport interface Step {\n name: string;\n status: StepStatus;\n isErrored?: boolean;\n completedAt?: Date | null;\n}\n\ninterface StepItemProps {\n step: Step;\n isLastStep: boolean;\n stepIdx: number;\n isErrored?: boolean;\n}\n\nexport const StepItem: React.FC<StepItemProps> = ({\n step,\n isLastStep,\n stepIdx,\n isErrored = false,\n}) => {\n return (\n <li className=\"relative lg:flex lg:flex-1\" key={stepIdx}>\n <div className=\"group flex items-center\">\n <StepIndicator\n status={step.status}\n stepIdx={stepIdx}\n isErrored={isErrored}\n />\n <StepContent\n name={step.name}\n status={step.status}\n completedAt={step.completedAt}\n isErrored={isErrored}\n />\n </div>\n {!isLastStep && <StepConnector />}\n </li>\n );\n};\n\ninterface StepIndicatorProps {\n status: StepStatus;\n stepIdx: number;\n isErrored: boolean;\n}\n\nconst StepIndicator: React.FC<StepIndicatorProps> = ({\n status,\n stepIdx,\n isErrored,\n}) => {\n if (status === StepStatus.Complete) {\n return (\n <span className=\"flex items-center pl-1 py-4 text-sm font-medium\">\n <span className=\"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-green-500\">\n <CheckIcon aria-hidden=\"true\" className=\"h-6 w-6 text-white\" />\n </span>\n </span>\n );\n }\n\n if (status === StepStatus.Current) {\n return (\n <span className=\"flex items-center pl-1 py-4 text-sm font-medium\">\n <span\n className={classNames(\n isErrored ? \"bg-red-500 border-none\" : \"border-flowerSkyVivid-500\",\n \"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2\",\n )}\n >\n {isErrored ? (\n <XMarkIcon aria-hidden=\"true\" className=\"h-6 w-6 text-white\" />\n ) : (\n <span className=\"text-flowerSkyVivid-500\">{stepIdx}</span>\n )}\n </span>\n </span>\n );\n }\n\n return (\n <span className=\"flex items-center pl-1 py-4 text-sm font-medium\">\n <span className=\"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 border-gray-300\">\n <span className=\"text-gray-500 group-hover:text-gray-900\">\n {stepIdx}\n </span>\n </span>\n </span>\n );\n};\n\ninterface StepContentProps {\n name: string;\n status: StepStatus;\n completedAt?: Date | null;\n isErrored: boolean;\n}\n\nconst StepContent: React.FC<StepContentProps> = ({\n name,\n status,\n completedAt,\n isErrored,\n}) => {\n const { t } = useTranslation();\n const textColor =\n status === StepStatus.Complete\n ? \"text-gray-900\"\n : status === StepStatus.Current\n ? isErrored\n ? \"text-red-600\"\n : \"text-flowerSkyVivid-500\"\n : \"text-gray-500 group-hover:text-gray-900\";\n\n return (\n <span className={`ml-2 text-sm font-medium ${textColor}`}>\n {t(`flowerHubProgress.installationProgressSteps.${name}`)}\n {completedAt && (\n <span className=\"block text-xs text-gray-400 whitespace-pre-line\">\n {status === StepStatus.Current &&\n name === \"Device handshake\" &&\n completedAt\n ? t(`flowerHubProgress.Last attempt`, {\n dateTime: formatDateTime(completedAt),\n })\n : formatDateTime(completedAt)}\n </span>\n )}\n </span>\n );\n};\n\nconst StepConnector: React.FC = () => {\n return (\n <div\n aria-hidden=\"true\"\n className=\"absolute right-0 top-0 invisible lg:visible h-full w-8 md:block\"\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 22 80\"\n preserveAspectRatio=\"none\"\n className=\"h-full w-full text-gray-300\"\n >\n <path\n d=\"M0 -2L20 40L0 82\"\n stroke=\"currentColor\"\n vectorEffect=\"non-scaling-stroke\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n};\n","import React, { FC } from \"react\";\nimport { GetFlowerHubResponseDTO } from \"api/flowerHub/flowerHub.dto\";\nimport {\n FlowerHubInstallationStatusMessageCode,\n IoTConnectivityStatus,\n StepStatus,\n} from \"enums/flowerHubStatus.enum\";\nimport { Step, StepItem } from \"./installationStep/StepItem\";\nimport {\n getCurrentStepIndex,\n isInstallationFailureMessageCode,\n} from \"helpers/installationProgress\";\nimport { Badge } from \"components/tags/Badge\";\nimport { useTranslation } from \"react-i18next\";\nimport { classNames } from \"helpers/classNames\";\nimport { Panel } from \"components/Panel\";\nimport { IoTConnectivityNotificationToaster } from \"../IoTConnectivityNotificationToaster\";\n\ntype Prop = {\n flowerHub: GetFlowerHubResponseDTO;\n isDistributor?: boolean;\n iotConnectivityStatus?: IoTConnectivityStatus;\n};\n\n// Translations for these names using in the StepContent component\nconst stepsConfig: Step[] = [\n { name: \"Installation start\", status: StepStatus.Complete },\n { name: \"Device handshake\", status: StepStatus.Upcoming },\n { name: \"Create cloud resources\", status: StepStatus.Upcoming },\n { name: \"Create device resources\", status: StepStatus.Upcoming },\n { name: \"Software deployment\", status: StepStatus.Upcoming },\n];\n\nconst getCompletedAtDate = (\n index: number,\n flowerHub: GetFlowerHubResponseDTO,\n): Date | null => {\n switch (index) {\n case 0:\n return new Date(flowerHub.installerEntryCreatedAt);\n case 1:\n return flowerHub.lastCertProvisionAttemptAt\n ? new Date(flowerHub.lastCertProvisionAttemptAt)\n : null;\n case 2:\n return flowerHub.stackCreatedAt\n ? new Date(flowerHub.stackCreatedAt)\n : null;\n case 3:\n return flowerHub.coreDeviceCreatedAt\n ? new Date(flowerHub.coreDeviceCreatedAt)\n : null;\n case 4:\n return flowerHub.firstDeploymentCompletedAt\n ? new Date(flowerHub.firstDeploymentCompletedAt)\n : null;\n default:\n return null;\n }\n};\n\nconst mapSteps = (\n steps: Step[],\n flowerHub: GetFlowerHubResponseDTO,\n currentStepIndex: number,\n): Step[] =>\n steps.map((step, index) => {\n const completedAt = getCompletedAtDate(index, flowerHub);\n const isErrored = isInstallationFailureMessageCode(\n flowerHub.installationStatus,\n );\n\n if (index < currentStepIndex) {\n return { ...step, status: StepStatus.Complete, completedAt, isErrored };\n } else if (index === currentStepIndex) {\n return { ...step, status: StepStatus.Current, isErrored, completedAt };\n } else {\n return { ...step, status: StepStatus.Upcoming, isErrored };\n }\n });\n\nconst ProgressMessages: FC<{\n message: FlowerHubInstallationStatusMessageCode;\n isDistributor: boolean;\n retryDeploymentAttempt?: number;\n maxDeploymentAttempts?: number;\n}> = ({\n message,\n isDistributor,\n retryDeploymentAttempt,\n maxDeploymentAttempts,\n}) => {\n const { t } = useTranslation();\n return (\n <div className=\"flex flex-col md:flex-row w-full mt-4 gap-4\">\n <div className=\"bg-flowerSky-50 p-4 w-full md:w-1/2 rounded-lg\">\n <span className=\"block text-sm font-semibold text-gray-700\">\n {t(\n isDistributor\n ? \"flowerHubProgress.Distributor message\"\n : \"flowerHubProgress.Flower user message\",\n )}\n </span>\n <span\n className={classNames(\n message ===\n FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration ||\n message ===\n FlowerHubInstallationStatusMessageCode.FlowerHubNeverAttemptedToCertificateProvisioning\n ? \"whitespace-pre-line\"\n : \"\",\n \"flex text-xs md:text-sm leading-6 mt-2 text-gray-700\",\n )}\n >\n {isDistributor\n ? t(\n [\n `flowerHubProgress.distributorInstallationProgressMessage.${message}`,\n \"flowerHubProgress.distributorInstallationProgressMessage.FallbackMessage\",\n ],\n {\n attempt: retryDeploymentAttempt,\n totalAttempts: maxDeploymentAttempts,\n },\n )\n : t(\n [\n `flowerHubProgress.flowerUserInstallationProgressMessage.${message}`,\n \"flowerHubProgress.flowerUserInstallationProgressMessage.FallbackMessage\",\n ],\n {\n attempt: retryDeploymentAttempt,\n totalAttempts: maxDeploymentAttempts,\n },\n )}\n </span>\n </div>\n <div className=\"bg-gray-50 p-4 w-full md:w-1/2 rounded-lg\">\n <span className=\"block text-sm font-semibold text-gray-700\">\n {t(\"flowerHubProgress.Installer message\")}\n </span>\n <span\n className={classNames(\n message ===\n FlowerHubInstallationStatusMessageCode.FlowerHubCertificateProvisioningNotAttemptedAfterAssetRegistration ||\n message ===\n FlowerHubInstallationStatusMessageCode.FlowerHubNeverAttemptedToCertificateProvisioning\n ? \"whitespace-pre-line\"\n : \"\",\n \"flex text-xs md:text-sm leading-6 mt-2 text-gray-700\",\n )}\n >\n {t(\n [\n `flowerHubProgress.installerInstallationProgressMessageForFlowerUserView.${message}`,\n \"flowerHubProgress.installerInstallationProgressMessageForFlowerUserView.FallbackMessage\",\n ],\n {\n attempt: retryDeploymentAttempt,\n totalAttempts: maxDeploymentAttempts,\n },\n )}\n </span>\n </div>\n </div>\n );\n};\n\nconst InstallationProgressFlowerVersion: FC<Prop> = ({\n flowerHub,\n isDistributor = false,\n iotConnectivityStatus,\n}) => {\n const { t } = useTranslation();\n const currentStepIndex = getCurrentStepIndex(\n flowerHub.installationStatus,\n flowerHub?.firstDeploymentCompletedAt,\n );\n\n const updatedSteps = mapSteps(stepsConfig, flowerHub, currentStepIndex);\n\n return (\n <Panel\n header={t(`flowerHubProgress.Installation progress`)}\n infoText={t(`flowerHubProgress.Installation progress info`)}\n toaster={\n !flowerHub.operationalStatus && (\n <IoTConnectivityNotificationToaster\n iotConnectivityStatus={iotConnectivityStatus}\n className={\"relative\"}\n transitionOptions={{\n from: {\n opacity: 0,\n transform: \"translate3d(0, 0px, 0px)\",\n },\n }}\n />\n )\n }\n >\n <div className=\"bg-white p-0 lg:pt-6 w-full rounded-md\">\n <nav className=\"pl-2 md:pl-4 lg:pl-0\" aria-label=\"Progress\">\n <ol role=\"list\" className=\"overflow-hidden lg:flex mb-2 md:mb-4\">\n {updatedSteps.map((step, index) => (\n <StepItem\n key={step.name}\n step={step}\n isLastStep={index === updatedSteps.length - 1}\n stepIdx={index + 1}\n isErrored={step.isErrored}\n />\n ))}\n </ol>\n </nav>\n\n {!flowerHub.firstDeploymentCompletedAt && (\n <div className=\"flex flex-col justify-center items-center mt-4 lg:mt-8 w-full\">\n {!isDistributor && (\n <Badge color=\"gray\" text={flowerHub.installationStatus} />\n )}\n <ProgressMessages\n message={flowerHub.installationStatus}\n isDistributor={isDistributor}\n retryDeploymentAttempt={flowerHub?.deploymentCount}\n maxDeploymentAttempts={flowerHub.maxAllowedFirstDeploymentCount}\n />\n </div>\n )}\n </div>\n </Panel>\n );\n};\n\nexport default InstallationProgressFlowerVersion;\n","import React from \"react\";\n\ninterface TableColumn {\n label: string;\n}\n\ninterface TableProps<T> {\n columns: TableColumn[];\n data: T[];\n renderRow: (item: T) => React.ReactNode;\n}\n\nconst ContentTable = <T extends object>({\n columns,\n data,\n renderRow,\n}: TableProps<T>) => {\n return (\n <div className=\"overflow-x-auto\">\n <table className=\"w-full text-left table-auto min-w-max\">\n <thead>\n <tr>\n {columns.map((column, index) => (\n <th\n key={index}\n className=\"p-4 border-b border-slate-300 bg-slate-50\"\n >\n <p className=\"block text-sm font-medium leading-none text-slate-500\">\n {column.label}\n </p>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {data.map((item, index) => (\n <tr key={index} className=\"hover:bg-slate-50\">\n {renderRow(item)}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n};\n\nexport default ContentTable;\n","export enum PresenceEventType {\n connected = \"connected\",\n disconnected = \"disconnected\",\n}\n\nexport enum PresenceDisconnectReason {\n AUTH_ERROR = \"AUTH_ERROR\",\n CLIENT_INITIATED_DISCONNECT = \"CLIENT_INITIATED_DISCONNECT\",\n CLIENT_ERROR = \"CLIENT_ERROR\",\n CONNECTION_LOST = \"CONNECTION_LOST\",\n DUPLICATE_CLIENTID = \"DUPLICATE_CLIENTID\",\n FORBIDDEN_ACCESS = \"FORBIDDEN_ACCESS\",\n MQTT_KEEP_ALIVE_TIMEOUT = \"MQTT_KEEP_ALIVE_TIMEOUT\",\n SERVER_ERROR = \"SERVER_ERROR\",\n SERVER_INITIATED_DISCONNECT = \"SERVER_INITIATED_DISCONNECT\",\n THROTTLED = \"THROTTLED\",\n WEBSOCKET_TTL_EXPIRATION = \"WEBSOCKET_TTL_EXPIRATION\",\n CUSTOMAUTH_TTL_EXPIRATION = \"CUSTOMAUTH_TTL_EXPIRATION\",\n}\n","import { Badge } from \"components/tags/Badge\";\nimport { formatDateTime } from \"helpers/date\";\nimport { FC } from \"react\";\nimport { GetLatestPresenceEventsResponseDTO } from \"../../../api/asset/asset.dto\";\nimport { PresenceEventType } from \"../../../enums/flowerHubPresenceEvent.enum\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface FlowerHubLogProps {\n log: GetLatestPresenceEventsResponseDTO;\n}\n\nexport const PresenceEventLog: FC<FlowerHubLogProps> = ({ log }) => {\n const { t } = useTranslation();\n\n return (\n <>\n <td className=\"p-4 border-b border-slate-200\">\n <p className=\"text-sm font-semibold leading-6 text-gray-900\">\n <Badge\n color={\n log.eventType === PresenceEventType.connected ? \"green\" : \"gray\"\n }\n text={t(`PresenceEvents.${log.eventType}`)}\n />\n </p>\n </td>\n <td className=\"p-4 border-b border-slate-200\">\n <p className=\"mt-1 flex text-xs leading-5 text-gray-500\">\n {log.disconnectReason ? (\n <span className=\"relative truncate\">{log.disconnectReason}</span>\n ) : (\n \"-\"\n )}\n </p>\n </td>\n <td className=\"p-4 border-b border-slate-200\">\n <p className=\"block text-sm text-slate-800\">\n {formatDateTime(log.timestamp)}\n </p>\n </td>\n </>\n );\n};\n","import { FC } from \"react\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { Panel } from \"components/Panel\";\nimport { useTranslation } from \"react-i18next\";\nimport { ClipboardDocumentListIcon } from \"@heroicons/react/24/outline\";\nimport ContentTable from \"components/table/ContentTable\";\nimport { useLatestPresenceEventsForAsset } from \"../../../api/asset/asset.endpoints\";\nimport { PresenceEventLog } from \"./PresenceEventLog\";\nimport { GetLatestPresenceEventsResponseDTO } from \"../../../api/asset/asset.dto\";\n\ninterface Props {\n assetId: number;\n}\n\nexport const PresenceEventLogs: FC<Props> = ({ assetId }) => {\n const { t } = useTranslation();\n const { data, isError, isLoading } = useLatestPresenceEventsForAsset(assetId);\n\n const columns = [\n { label: \"\" },\n { label: t(\"PresenceEvents.Disconnect reason\") },\n { label: t(\"PresenceEvents.ReportedDate\") },\n ];\n\n return (\n <Panel\n header={t(`PresenceEvents.Title`)}\n infoText={t(`PresenceEvents.Info`)}\n >\n <div className=\"flow-root w-full pl-3 pr-3 overflow-y-auto\">\n {isLoading || !data || data?.length === 0 || isError ? (\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && data?.length === 0}\n icon={<ClipboardDocumentListIcon />}\n errorMessage={t(`PresenceEvents.UnableToLoad`)}\n emptyDataMessage={t(`PresenceEvents.NotFound`)}\n />\n ) : (\n <ContentTable\n columns={columns}\n data={data}\n renderRow={(log: GetLatestPresenceEventsResponseDTO) => (\n <PresenceEventLog log={log} key={log.id} />\n )}\n />\n )}\n </div>\n </Panel>\n );\n};\n","import api from \"../axiosInstance\";\nimport { GetFlowerHubLogForAssetDTO } from \"./flowerHubLog.dto\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nconst ENDPOINT = \"/flower-hub-log\";\n\nexport enum FlowerHubLogQueryKeys {\n GetAllForAsset = \"flower-hub-log-for-asset\",\n}\n\nexport const useFlowerHubLogsForAsset = (assetId: number) =>\n useQuery({\n queryKey: [FlowerHubLogQueryKeys.GetAllForAsset, assetId],\n queryFn: async (): Promise<GetFlowerHubLogForAssetDTO[]> =>\n (await api.get(`${ENDPOINT}/${assetId}`)).data,\n gcTime: 0,\n });\n","import { GetFlowerHubLogForAssetDTO } from \"api/flowerHubLog/flowerHubLog.dto\";\nimport { Badge } from \"components/tags/Badge\";\nimport { formatDateTime } from \"helpers/date\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface FlowerHubLogProps {\n log: GetFlowerHubLogForAssetDTO;\n}\n\nexport const FlowerHubLog: FC<FlowerHubLogProps> = ({ log }) => {\n const { t } = useTranslation();\n return (\n <>\n <td className=\"p-4 border-b border-slate-200\">\n <p className=\"text-sm font-semibold leading-6 text-gray-900\">\n <Badge color={log.isResolved ? \"green\" : \"red\"} text={log.type} />\n </p>\n <p className=\"mt-1 flex text-xs leading-5 text-gray-500\">\n <span className=\"relative truncate\">\n {t(`flowerHubLogs.${log.type}`)}\n </span>\n </p>\n </td>\n <td className=\"p-4 border-b border-slate-200\">\n <p className=\"block text-sm text-slate-800\">{log.flowerHubIp ?? \"-\"}</p>\n </td>\n <td className=\"p-4 border-b border-slate-200\">\n <p className=\"block text-sm text-slate-800\">{log.dongleIp ?? \"-\"}</p>\n </td>\n <td className=\"p-4 border-b border-slate-200\">\n <p className=\"block text-sm text-slate-800\">\n {formatDateTime(log.reportedAt)}\n </p>\n </td>\n </>\n );\n};\n","import { FC } from \"react\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { useFlowerHubLogsForAsset } from \"api/flowerHubLog/flowerHubLog.endpoints\";\nimport { Panel } from \"components/Panel\";\nimport { useTranslation } from \"react-i18next\";\nimport { ClipboardDocumentListIcon } from \"@heroicons/react/24/outline\";\nimport ContentTable from \"components/table/ContentTable\";\nimport { GetFlowerHubLogForAssetDTO } from \"api/flowerHubLog/flowerHubLog.dto\";\nimport { FlowerHubLog } from \"./FlowerHubLog\";\n\ninterface Props {\n assetId: number;\n serialNumber: string;\n}\n\nexport const FlowerHubLogs: FC<Props> = ({ assetId }) => {\n const { t } = useTranslation();\n const { data, isError, isLoading } = useFlowerHubLogsForAsset(assetId);\n\n const columns = [\n { label: \"\" },\n { label: t(`flowerHubProgress.operationalStats.Flower Hub Ip address`) },\n { label: t(`flowerHubProgress.operationalStats.Dongle Ip address`) },\n { label: t(`flowerHubProgress.operationalStats.Reported date`) },\n ];\n\n return (\n <Panel header={t(`flowerHubLogs.Title`)} infoText={t(`flowerHubLogs.Info`)}>\n <div className=\"flow-root w-full pl-3 pr-3 overflow-y-auto\">\n {isLoading || !data || data?.length === 0 || isError ? (\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && data?.length === 0}\n icon={<ClipboardDocumentListIcon />}\n errorMessage={t(`flowerHubLogs.UnableToLoad`)}\n emptyDataMessage={t(`flowerHubLogs.NotFound`)}\n />\n ) : (\n <ContentTable\n columns={columns}\n data={data}\n renderRow={(log: GetFlowerHubLogForAssetDTO) => (\n <FlowerHubLog log={log} key={log.id} />\n )}\n />\n )}\n </div>\n </Panel>\n );\n};\n","import api from \"../axiosInstance\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { NotifyAboutIoTConnectivityStatusResponseDTO } from \"./flowerHubPresenceEvent.dto\";\n\nconst ENDPOINT = \"/flower-hub-presence-event\";\n\nexport enum FlowerHubQueryKeys {\n iotConnectivityStatus = \"iot-connectivity-status\",\n}\n\nexport const useNotifyAboutIoTConnectivityStatus = (serialNumber?: string) => {\n return useQuery({\n queryKey: [FlowerHubQueryKeys.iotConnectivityStatus, serialNumber],\n queryFn: async (): Promise<\n NotifyAboutIoTConnectivityStatusResponseDTO | undefined\n > =>\n (await api.get(`${ENDPOINT}/iot-connectivity-status/${serialNumber}`))\n .data,\n enabled: !!serialNumber,\n refetchInterval: 15000, // pooling every 15 seconds\n });\n};\n","import { FC, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport { FlowerHubStatisticsFlowerVersion } from \"./flowerHubStatistics/FlowerHubStatisticsFlowerVersion\";\nimport { FlowerHubComponents } from \"components/flowerHub/FlowerHubComponents\";\nimport { InstallFlowerHub } from \"components/installationFlow/InstallFlowerhub\";\nimport { isDistributor, isFlower, isInstaller } from \"../../helpers/role\";\nimport InstallationProgress from \"./installationProgress/InstallationProgress\";\nimport { useFlowerHub } from \"api/flowerHub/flowerHub.endpoints\";\nimport OperationalProgress from \"./operationalProgress/OperationalProgress\";\nimport InstallationProgressFlowerVersion from \"./installationProgress/InstallationProgressFlowerVersion\";\nimport { ServerIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport FlowerHubIcon from \"styles/icons/FlowerHubIcon\";\nimport { classNames } from \"helpers/classNames\";\nimport { PresenceEventLogs } from \"./presenceEvents/PresenceEventLogs\";\nimport { FlowerHubLogs } from \"./flowerHubLogs/FlowerHubLogs\";\nimport { useNotifyAboutIoTConnectivityStatus } from \"../../api/flowerHubPresenceEvent/flowerHubPresenceEvent.endpoints\";\n\ninterface Props {\n assetOwnerId: number;\n assetId?: number;\n serialNumber?: string;\n}\n\nexport const FlowerHubDetails: FC<Props> = ({\n assetOwnerId,\n assetId,\n serialNumber,\n}) => {\n const { t } = useTranslation();\n const userRole = userStore(getUserRole);\n const { data, isError, isLoading } = useFlowerHub(serialNumber);\n const { data: iotConnectivityData } =\n useNotifyAboutIoTConnectivityStatus(serialNumber);\n // State to toggle InstallFlowerHub steps visibility\n const [showInstall, setShowInstall] = useState(false);\n\n // Asset data\n if (!assetId || !serialNumber) {\n return (\n <>\n {isInstaller(userRole) ? (\n <div className=\"overflow-auto mb-4\">\n {!showInstall ? (\n <div className=\"my-8 flex justify-center items-center\">\n <div className=\"flex flex-col items-center\">\n <SecondaryButton\n size=\"small\"\n onClick={() => setShowInstall(true)}\n >\n <span\n className={classNames(\n `bg-flowerPeach-50`,\n `text-flowerPeach-700`,\n \"inline-flex rounded-lg p-1 mr-1 hover:bg-flowerPeach-900 hover:text-white\",\n )}\n >\n <FlowerHubIcon className=\"w-5 h-5\" />\n </span>\n\n {t(`batteryOverview.Install Flower Hub`)}\n </SecondaryButton>\n <h3 className=\"mt-4 text-sm font-medium text-gray-600 text-center\">\n {t(`batteryOverview.Install Flower Hub start text`)}\n </h3>\n </div>\n </div>\n ) : (\n <InstallFlowerHub\n assetOwnerId={assetOwnerId}\n closeInstallationSteps={() => setShowInstall(false)}\n />\n )}\n </div>\n ) : (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={false}\n isLoading={false}\n isEmpty={true}\n icon={<ServerIcon />}\n errorMessage=\"\"\n emptyDataMessage={t(`flowerHub.NoFlowerHub`)}\n />\n </div>\n )}\n </>\n );\n }\n\n // Flower Hub data\n if (isLoading || !data || isError) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && !data}\n icon={<ServerIcon />}\n errorMessage={t(`flowerHubProgress.UnableToLoad`)}\n />\n </div>\n );\n }\n\n return (\n <div className=\"overflow-auto\">\n {/* Installer View */}\n {isInstaller(userRole) &&\n (data.operationalStatus ? (\n <OperationalProgress\n operationalStatus={data.operationalStatus}\n userRole={userRole}\n serialNumber={serialNumber}\n iotConnectivityStatus={iotConnectivityData?.status}\n />\n ) : (\n <InstallationProgress\n serialNumber={serialNumber}\n installationStatus={data.installationStatus}\n retryDeploymentAttempt={data?.deploymentCount}\n maxDeploymentAttempts={data.maxAllowedFirstDeploymentCount}\n iotConnectivityStatus={iotConnectivityData?.status}\n />\n ))}\n\n {/* Distributor View */}\n {isDistributor(userRole) && (\n <>\n {data.operationalStatus ? (\n <OperationalProgress\n operationalStatus={data.operationalStatus}\n iotConnectivityStatus={iotConnectivityData?.status}\n userRole={userRole}\n serialNumber={serialNumber}\n />\n ) : (\n <InstallationProgressFlowerVersion\n flowerHub={data}\n isDistributor\n iotConnectivityStatus={iotConnectivityData?.status}\n />\n )}\n {data.coreDeviceCreatedAt && <PresenceEventLogs assetId={assetId} />}\n </>\n )}\n\n {/* Flower user View */}\n {isFlower(userRole) && (\n <>\n <FlowerHubStatisticsFlowerVersion assetId={assetId} />\n <InstallationProgressFlowerVersion\n flowerHub={data}\n iotConnectivityStatus={iotConnectivityData?.status}\n />\n {data.operationalStatus && (\n <OperationalProgress\n operationalStatus={data.operationalStatus}\n iotConnectivityStatus={iotConnectivityData?.status}\n userRole={userRole}\n serialNumber={serialNumber}\n />\n )}\n <FlowerHubComponents serialNumber={serialNumber} />\n {data.coreDeviceCreatedAt && <PresenceEventLogs assetId={assetId} />}\n </>\n )}\n\n {/* Common View */}\n {data.firstDeploymentCompletedAt && (\n <FlowerHubLogs assetId={assetId} serialNumber={serialNumber} />\n )}\n </div>\n );\n};\n","export enum ZavannSiteStateCategory {\n Error = \"Error\",\n InProgress = \"In progress\",\n AwaitingTermination = \"Awaiting termination\",\n Active = \"Active\",\n Terminated = \"Terminated\",\n}\n","import { FC } from \"react\";\nimport { Badge, BadgeColor, BadgeSize } from \"./Badge\";\n\nimport { Tooltip } from \"../tooltip/Tooltip\";\nimport { ZavannSiteStateCategory } from \"../../enums/zavannSiteStateCategory.enum\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n stateCategory: ZavannSiteStateCategory;\n stateId: number;\n stateReasonId?: number;\n size?: BadgeSize;\n withTooltip?: boolean;\n}\n\nexport const ElectricityAgreementTag: FC<Props> = ({\n stateCategory,\n stateId,\n stateReasonId,\n size = \"small\",\n withTooltip = true,\n}) => {\n const { t } = useTranslation();\n\n const electricAgreementTagColor =\n getElectricityAgreementTagColor(stateCategory);\n\n return (\n <div className=\"relative inline-block group\">\n <div className=\"relative inline-block group\">\n {withTooltip ? (\n <Tooltip\n message={\n stateReasonId\n ? t(`zavannSiteState.${stateId}`) +\n \": \" +\n t(`zavannSiteStateReason.${stateReasonId}`)\n : t(`zavannSiteState.${stateId}`)\n }\n color={electricAgreementTagColor}\n position=\"right\"\n >\n <Badge\n color={electricAgreementTagColor}\n text={stateCategory ? stateCategory : \"Unknown\"}\n size={size}\n />\n </Tooltip>\n ) : (\n <Badge\n color={electricAgreementTagColor}\n text={stateCategory ? stateCategory : \"Unknown\"}\n size={size}\n />\n )}\n </div>\n </div>\n );\n};\n\nconst getElectricityAgreementTagColor = (\n stateCategory: ZavannSiteStateCategory,\n): BadgeColor => {\n switch (stateCategory) {\n case ZavannSiteStateCategory.Active:\n return \"green\";\n case ZavannSiteStateCategory.InProgress:\n return \"blue\";\n case ZavannSiteStateCategory.AwaitingTermination:\n return \"yellow\";\n case ZavannSiteStateCategory.Terminated:\n return \"gray\";\n case ZavannSiteStateCategory.Error:\n return \"red\";\n default:\n return \"gray\";\n }\n};\n","export enum ZavannInvoiceStatus {\n Obetald = \"1\",\n Överbetald = \"2\",\n Delbetald = \"3\",\n Betald = \"4\",\n Krediterad = \"5\",\n Försenad = \"6\",\n EnergiKonto = \"8\",\n FordranÖverlÃ¥ten = \"9\",\n Ã…terbetald = \"5000002\",\n}\n\nexport const getZavannInvoiceStatusName = (status: ZavannInvoiceStatus) => {\n switch (status) {\n case ZavannInvoiceStatus.Obetald:\n return \"Obetald\";\n case ZavannInvoiceStatus.Överbetald:\n return \"Överbetald\";\n case ZavannInvoiceStatus.Delbetald:\n return \"Delbetald\";\n case ZavannInvoiceStatus.Betald:\n return \"Betald\";\n case ZavannInvoiceStatus.Krediterad:\n return \"Krediterad\";\n case ZavannInvoiceStatus.Försenad:\n return \"Försenad\";\n case ZavannInvoiceStatus.EnergiKonto:\n return \"EnergiKonto\";\n case ZavannInvoiceStatus.FordranÖverlÃ¥ten:\n return \"FordranÖverlÃ¥ten\";\n case ZavannInvoiceStatus.Ã…terbetald:\n return \"Ã…terbetald\";\n default:\n throw Error(\n `getZavannInvoiceStatusName is missing implementation for ${status}`,\n );\n }\n};\n\nexport const getStatusStyle = (status: ZavannInvoiceStatus) => {\n switch (status) {\n case ZavannInvoiceStatus.Betald:\n case ZavannInvoiceStatus.EnergiKonto:\n case ZavannInvoiceStatus.Ã…terbetald:\n return \"bg-green-200 text-green-600\";\n case ZavannInvoiceStatus.Krediterad:\n case ZavannInvoiceStatus.Överbetald:\n return \"bg-yellow-100 text-yellow-800\";\n case ZavannInvoiceStatus.Försenad:\n case ZavannInvoiceStatus.FordranÖverlÃ¥ten:\n return \"bg-red-100 text-red-800\";\n case ZavannInvoiceStatus.Obetald:\n case ZavannInvoiceStatus.Delbetald:\n return \"bg-gray-100 text-gray-800\";\n default:\n throw Error(\n `getZavannInvoiceStatusName is missing implementation for ${status}`,\n );\n }\n};\n","import { FC } from \"react\";\nimport { ChildrenProps } from \"types/childrenProps.type\";\n\nexport const Link: FC<\n ChildrenProps &\n React.DetailedHTMLProps<\n React.AnchorHTMLAttributes<HTMLAnchorElement>,\n HTMLAnchorElement\n >\n> = ({ children, ...rest }) => (\n <a\n className=\"text-sm font-medium text-flowerblue-600 hover:text-flowerblue-500\"\n {...rest}\n >\n {children}\n </a>\n);\n","import {\n getZavannInvoiceStatusName,\n ZavannInvoiceStatus,\n} from \"enums/zavannInvoiceStatus.enum\";\nimport { FC } from \"react\";\nimport { Badge, BadgeColor, BadgeSize } from \"./Badge\";\n\ninterface Props {\n status: ZavannInvoiceStatus;\n size?: BadgeSize;\n}\n\nexport const InvoiceStatusTag: FC<Props> = ({ status, size = \"small\" }) => (\n <Badge\n color={getColor(status)}\n text={getZavannInvoiceStatusName(status)}\n size={size}\n />\n);\n\nconst getColor = (status: ZavannInvoiceStatus): BadgeColor => {\n switch (status) {\n case ZavannInvoiceStatus.Betald:\n case ZavannInvoiceStatus.EnergiKonto:\n case ZavannInvoiceStatus.Ã…terbetald:\n return \"green\";\n case ZavannInvoiceStatus.Krediterad:\n case ZavannInvoiceStatus.Överbetald:\n return \"yellow\";\n case ZavannInvoiceStatus.Försenad:\n case ZavannInvoiceStatus.FordranÖverlÃ¥ten:\n return \"red\";\n case ZavannInvoiceStatus.Obetald:\n case ZavannInvoiceStatus.Delbetald:\n return \"gray\";\n default:\n return \"gray\";\n }\n};\n","import { formatDateMonth } from \"helpers/date\";\nimport { GetInvoiceItemResponseDTO } from \"types/invoice.type\";\nimport { ZavannInvoiceStatus } from \"enums/zavannInvoiceStatus.enum\";\nimport { Link } from \"components/Link\";\nimport { FC } from \"react\";\nimport { InvoiceStatusTag } from \"components/tags/InvoiceStatusTag\";\n\ninterface Props {\n invoices: GetInvoiceItemResponseDTO[];\n}\n\nexport const MobileVersion: FC<Props> = ({ invoices }) => {\n return (\n <div className=\"my-8 flex flex-col\">\n <div className=\"overflow-hidden rounded-md shadow\">\n <table className=\"min-w-full divide-y divide-gray-50\">\n <tbody className=\"divide-y divide-gray-200 bg-white\">\n {invoices.map((invoice) => (\n <tr key={invoice.id}>\n <td className=\"w-full max-w-0 py-4 pl-4 pr-3 text-sm font-medium text-gray-900\">\n {`${invoice.total_amount} kr`}\n <dl className=\"font-normal\">\n <dt className=\"sr-only\">Förfallodatum</dt>\n <dd className=\"mt-1 truncate text-gray-700\">\n {`${\n invoice.invoice_status_id ===\n ZavannInvoiceStatus.Försenad\n ? \"Förföll \"\n : \"Förfaller \"\n }den ${formatDateMonth(invoice.due_date)}`}\n </dd>\n <dt className=\"sr-only\">Fakturanummer</dt>\n <dd className=\"mt-1 truncate text-gray-500\">\n {invoice.id}\n </dd>\n </dl>\n </td>\n\n <td className=\"px-3 py-4 text-sm text-gray-500\">\n <InvoiceStatusTag status={invoice.invoice_status_id} />\n </td>\n <td className=\"py-4 pl-3 pr-4 text-right text-sm font-medium\">\n <Link\n href={invoice.invoice_pdf}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n Visa\n <span className=\"sr-only\">, {invoice.id}</span>\n </Link>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n};\n","import { formatDate } from \"helpers/date\";\nimport { GetInvoiceItemResponseDTO } from \"types/invoice.type\";\nimport { Link } from \"components/Link\";\nimport { FC } from \"react\";\nimport { InvoiceStatusTag } from \"components/tags/InvoiceStatusTag\";\n\ninterface Props {\n invoices: GetInvoiceItemResponseDTO[];\n}\n\nexport const DesktopVersion: FC<Props> = ({ invoices = [] }: Props) => (\n <div className=\"flex flex-col my-8 \">\n <div className=\"overflow-hidden rounded-md shadow\">\n <table className=\"min-w-full divide-y divide-gray-300\">\n <thead className=\"bg-flowerSky-500\">\n <tr>\n <th\n scope=\"col\"\n className=\"whitespace-nowrap py-3.5 pr-3 text-left text-sm font-semibold text-white pl-6\"\n >\n Fakturanummer\n </th>\n <th\n scope=\"col\"\n className=\"whitespace-nowrap px-2 py-3.5 text-left text-sm font-semibold text-white\"\n >\n Summa\n </th>\n <th\n scope=\"col\"\n className=\"whitespace-nowrap px-2 py-3.5 text-left text-sm font-semibold text-white\"\n >\n Fakturadatum\n </th>\n <th\n scope=\"col\"\n className=\"whitespace-nowrap px-2 py-3.5 text-left text-sm font-semibold text-white\"\n >\n Betalas senast\n </th>\n\n <th\n scope=\"col\"\n className=\"whitespace-nowrap px-2 py-3.5 text-left text-sm font-semibold text-white\"\n >\n Status\n </th>\n <th\n scope=\"col\"\n className=\"relative whitespace-nowrap py-3.5 pl-3 pr-6\"\n >\n <span className=\"sr-only\">View details</span>\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-gray-200 bg-white\">\n {invoices.map((invoice) => (\n <tr key={invoice.id}>\n <td className=\"whitespace-nowrap py-2 pr-3 text-sm text-gray-900 pl-6\">\n {invoice.id}\n </td>\n <td className=\"whitespace-nowrap px-2 py-2 text-sm text-gray-900\">\n {`${invoice.total_amount} kr`}\n </td>\n <td className=\"whitespace-nowrap px-2 py-2 text-sm text-gray-900\">\n {formatDate(invoice.invoice_date)}\n </td>\n <td className=\"whitespace-nowrap px-2 py-2 text-sm text-gray-900\">\n {formatDate(invoice.due_date)}\n </td>\n <td className=\"whitespace-nowrap px-2 py-2 text-sm text-gray-900\">\n <InvoiceStatusTag status={invoice.invoice_status_id} />\n </td>\n <td className=\"relative whitespace-nowrap py-2 pl-3 text-right text-sm font-medium pr-6\">\n <Link\n href={invoice.invoice_pdf}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n View\n <span className=\"sr-only\">, {invoice.id}</span>\n </Link>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n);\n","import { FC } from \"react\";\nimport { MobileVersion } from \"./MobileVersion\";\nimport { DesktopVersion } from \"./DesktopVersion\";\nimport { isEmptyArray } from \"helpers/array\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { DocumentTextIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { isMobile } from \"react-device-detect\";\nimport { useInvoices } from \"../../api/assetOwner/assetOwner.endpoints\";\n\ninterface Props {\n assetOwnerId: number;\n loaderSize: \"medium\" | \"page\";\n}\n\nexport const Invoices: FC<Props> = ({ assetOwnerId, loaderSize }: Props) => {\n const { t } = useTranslation();\n\n // Get invoices\n const {\n data: invoices,\n isLoading: isLoadingInvoices,\n isError: isErrorInvoices,\n } = useInvoices(assetOwnerId);\n\n if (isLoadingInvoices || isErrorInvoices || isEmptyArray(invoices)) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isErrorInvoices}\n isLoading={isLoadingInvoices}\n isEmpty={!isLoadingInvoices && !isErrorInvoices}\n icon={<DocumentTextIcon />}\n errorMessage={t(`subHeader.errorFetchingInvoices`)}\n emptyDataMessage={t(`subHeader.noInvoicesFU`)}\n loaderSize={loaderSize}\n />\n </div>\n );\n }\n\n return (\n <>\n {isMobile ? (\n <MobileVersion invoices={invoices ?? []} />\n ) : (\n <DesktopVersion invoices={invoices ?? []} />\n )}\n </>\n );\n};\n","import { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { positiveNumberValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { UpdateZavannSiteIdsRequestDTO } from \"api/assetOwner/assetOwner.dto\";\n\ninterface Props {\n register: UseFormRegister<UpdateZavannSiteIdsRequestDTO>;\n errors?: Partial<FieldErrorsImpl<UpdateZavannSiteIdsRequestDTO>>;\n}\nexport const EditZavannSiteIdsForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(\"editZavannSiteIdsForm.Consumption site id\")}\n name=\"zavannNewAccountConsumptionSiteId\"\n register={register}\n size=\"half\"\n registerOptions={positiveNumberValidator}\n type=\"number\"\n errorMessage={errors?.zavannNewAccountConsumptionSiteId?.message}\n />\n <TextInput\n label={t(\"editZavannSiteIdsForm.Production site id\")}\n name=\"zavannNewAccountProductionSiteId\"\n register={register}\n size=\"half\"\n registerOptions={positiveNumberValidator}\n type=\"number\"\n errorMessage={errors?.zavannNewAccountProductionSiteId?.message}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"../Modal\";\nimport SecondaryButton from \"../buttons/SecondaryButton\";\nimport { useForm } from \"react-hook-form\";\nimport { useUpdateZavannSiteIds } from \"api/assetOwner/assetOwner.endpoints\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport {\n GetElectricityAgreementResponseDTO,\n UpdateZavannSiteIdsRequestDTO,\n} from \"api/assetOwner/assetOwner.dto\";\nimport { EditZavannSiteIdsForm } from \"./EditZavannSiteIdsForm\";\n\ninterface Props {\n assetOwnerId: number;\n electricityAgreement: GetElectricityAgreementResponseDTO;\n}\n\nexport const EditZavannSiteIds: FC<Props> = ({\n assetOwnerId,\n electricityAgreement,\n}) => {\n const { t } = useTranslation();\n\n const [isEditModalOpen, setIsEditModalOpen] = useState<boolean>(false);\n\n // api\n const {\n mutate: updateZavannSiteIds,\n isPending: isUpdating,\n isSuccess: isUpdateSuccess,\n } = useUpdateZavannSiteIds(assetOwnerId);\n\n // form\n const {\n register: registerUpdateZavannSiteIds,\n handleSubmit: handleUpdateZavannSiteIdsSubmit,\n reset: resetUpdateZavannSiteIds,\n formState: { errors: updateZavannSiteIdsErrors },\n } = useForm<UpdateZavannSiteIdsRequestDTO>();\n\n // submit\n const onUpdateZavannSiteIdsSubmit = handleUpdateZavannSiteIdsSubmit(\n (payload: UpdateZavannSiteIdsRequestDTO) => {\n updateZavannSiteIds(payload);\n },\n );\n\n // modal close\n const onUpdateZavannSiteIdsModalClose = () => {\n setIsEditModalOpen(false);\n setTimeout(() => resetUpdateZavannSiteIds(), 300);\n };\n\n useEffect(() => {\n if (isUpdateSuccess) {\n onUpdateZavannSiteIdsModalClose();\n }\n }, [isUpdateSuccess]);\n\n // Populate or clear the form every time isEditModalOpen is set to true\n useEffect(() => {\n if (isEditModalOpen) {\n resetUpdateZavannSiteIds({\n zavannNewAccountConsumptionSiteId:\n electricityAgreement.consumption?.siteId,\n zavannNewAccountProductionSiteId:\n electricityAgreement.production?.siteId,\n });\n }\n }, [isEditModalOpen]);\n\n return (\n <>\n <div className=\"py-4 pr-4 flex justify-end\">\n <SecondaryButton\n onClick={() => setIsEditModalOpen(true)}\n size={\"small\"}\n >\n <PencilSquareIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(`editZavannSiteIdsForm.Edit Zavann site ids`)}\n </SecondaryButton>\n </div>\n\n <Modal\n title={t(`editZavannSiteIdsForm.Edit Zavann site ids`)}\n rightButtonText={t(`Save`)}\n rightButtonActionHandler={onUpdateZavannSiteIdsSubmit}\n isOpen={isEditModalOpen}\n onClose={onUpdateZavannSiteIdsModalClose}\n isLoading={isUpdating}\n >\n <EditZavannSiteIdsForm\n register={registerUpdateZavannSiteIds}\n errors={updateZavannSiteIdsErrors}\n />\n </Modal>\n </>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { formatDate } from \"../../helpers/date\";\nimport { SiteForElectricityAgreementDTO } from \"../../api/assetOwner/assetOwner.dto\";\nimport { Item, Label, List } from \"components/descriptionList\";\nimport { ElectricityAgreementTag } from \"../tags/ElectricityAgreementTag\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { useAssetOwnerElectricityAgreement } from \"api/assetOwner/assetOwner.endpoints\";\nimport { DocumentTextIcon } from \"@heroicons/react/24/outline\";\nimport { Invoices } from \"../invoices/Invoices\";\nimport { Role } from \"enums/role.enum\";\nimport { EditZavannSiteIds } from \"./EditZavannSiteIds\";\nimport { isFlower } from \"../../helpers/role\";\nimport { Shadow } from \"../Shadow\";\n\ninterface Props {\n assetOwnerId: number;\n userRole: Role;\n}\n\nexport const ElectricityAgreementTab: FC<Props> = ({\n assetOwnerId,\n userRole,\n}) => {\n const { t } = useTranslation();\n\n // Get electricity agreement\n const {\n data: electricityAgreement,\n isLoading: isLoadingElectricityAgreement,\n isError: isErrorElectricityAgreement,\n } = useAssetOwnerElectricityAgreement(assetOwnerId);\n\n const renderElectricityAgreementPlaceholder = () => (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isErrorElectricityAgreement}\n isLoading={isLoadingElectricityAgreement}\n isEmpty={\n !isLoadingElectricityAgreement &&\n !isErrorElectricityAgreement &&\n !electricityAgreement\n }\n icon={<DocumentTextIcon />}\n errorMessage={t(\n `electricityAgreement.UnableToFetchElectricityAgreement`,\n )}\n emptyDataMessage={t(`electricityAgreement.NoElectricityAgreement`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n\n if (\n isLoadingElectricityAgreement ||\n !electricityAgreement ||\n isErrorElectricityAgreement\n ) {\n return renderElectricityAgreementPlaceholder();\n }\n\n const shouldShowEditZavannSiteIdsOption = (): boolean => {\n return (\n isFlower(userRole) &&\n !!electricityAgreement?.consumption &&\n !!electricityAgreement?.production\n );\n };\n\n return (\n <div className=\"flex flex-col overflow-auto\">\n <div>\n <Shadow>\n <List>\n {electricityAgreement.consumption && (\n <AgreementItem\n label={t(`electricityAgreement.Consumption`)}\n agreement={electricityAgreement.consumption}\n userRole={userRole}\n />\n )}\n {electricityAgreement.production && (\n <AgreementItem\n label={t(`electricityAgreement.Production`)}\n agreement={electricityAgreement.production}\n userRole={userRole}\n />\n )}\n {shouldShowEditZavannSiteIdsOption() && (\n <EditZavannSiteIds\n assetOwnerId={assetOwnerId}\n electricityAgreement={electricityAgreement}\n />\n )}\n </List>\n </Shadow>\n </div>\n {isFlower(userRole) && (\n <Invoices assetOwnerId={assetOwnerId} loaderSize=\"medium\" />\n )}\n </div>\n );\n};\n\ninterface AgreementItemProp {\n label: string;\n agreement: SiteForElectricityAgreementDTO;\n userRole: Role;\n}\n\nconst AgreementItem = ({ label, agreement, userRole }: AgreementItemProp) => {\n return (\n <Item className=\"relative\">\n <div className=\"mt-1 text-base sm:mt-0 text-gray-900 flex justify-between items-center\">\n <Label>{label}</Label>\n <ElectricityAgreementTag\n stateCategory={agreement.stateCategory}\n stateId={agreement.stateId}\n stateReasonId={agreement.stateReasonId}\n />\n </div>\n <div className=\"flex justify-between md:justify-end align-middle items-center text-sm\">\n {isFlower(userRole) && (\n <>\n <span className=\"font-medium text-gray-500\">Site Id: </span>\n <span className=\"ml-4\">\n {agreement.siteId ? agreement.siteId : \" - \"}\n </span>\n </>\n )}\n </div>\n <div className=\"mt-1 text-base text-gray-900 sm:mt-0\">\n {agreement.startDate && (\n <DateItem\n label=\"electricityAgreement.Start\"\n date={agreement.startDate}\n />\n )}\n {agreement.terminationDate && (\n <DateItem\n label=\"electricityAgreement.End\"\n date={agreement.terminationDate}\n />\n )}\n </div>\n </Item>\n );\n};\n\ninterface DateItemProp {\n label: string;\n date: Date;\n}\n\nconst DateItem = ({ label, date }: DateItemProp) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"flex justify-between md:justify-end align-middle items-center text-sm\">\n <span className=\"font-medium text-gray-500\">{`${t(label)}:`}</span>\n <span className=\"ml-4\">{formatDate(date)}</span>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Badge, BadgeSize } from \"components/tags/Badge\";\nimport { Tooltip } from \"components/tooltip/Tooltip\";\nimport { getStatusColor } from \"helpers/installationProgress\";\nimport { FlowerHubStatusDTO } from \"api/flowerHub/flowerHub.dto\";\nimport { FlowerHubStatus } from \"enums/flowerHubStatus.enum\";\n\ninterface Props {\n flowerHubStatus: FlowerHubStatusDTO;\n size?: BadgeSize;\n}\n\nexport const FlowerHubStatusTag: FC<Props> = ({\n flowerHubStatus,\n size = \"small\",\n}) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"flex\">\n <Tooltip\n message={\n flowerHubStatus.status === FlowerHubStatus.Updating ||\n flowerHubStatus.status === FlowerHubStatus.UpdateFailed\n ? t([\n `flowerHubProgress.listView.operational.${flowerHubStatus.message}`,\n \"flowerHubProgress.listView.operational.FallbackMessage\",\n ])\n : t([\n `flowerHubProgress.listView.installation.${flowerHubStatus.message}`,\n `flowerHubProgress.listView.operational.${flowerHubStatus.message}`,\n \"flowerHubProgress.listView.installation.FallbackMessage\",\n ])\n }\n color={getStatusColor(flowerHubStatus.status)}\n isPreWrapText\n >\n <Badge\n color={getStatusColor(flowerHubStatus.status)}\n text={flowerHubStatus.status}\n size={size}\n />\n </Tooltip>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Item, Label, List, Value } from \"components/descriptionList\";\nimport { Role } from \"enums/role.enum\";\nimport { FlowerHubStatusTag } from \"components/tags/FlowerHubStatusTag\";\nimport { isAssetOwner } from \"../../helpers/role\";\nimport { GetAssetResponseDTO } from \"../../api/asset/asset.dto\";\n\ninterface Props {\n userRole: Role;\n asset: GetAssetResponseDTO;\n}\n\nexport const BatteryDetails: FC<Props> = ({ userRole, asset }) => {\n const { t } = useTranslation();\n\n return (\n <List>\n {isAssetOwner(userRole) && (\n <Item>\n <Label>{t(`flowerHub.Title`)}</Label>\n <FlowerHubStatusTag flowerHubStatus={asset.flowerHubStatus} />\n </Item>\n )}\n <Item>\n <Label>{t(`batteryOverview.Asset model`)}</Label>\n <Value>{`${asset.assetModel.manufacturer} ${asset.assetModel.name}`}</Value>\n </Item>\n <Item>\n <Label>{t(`batteryOverview.BESS power capacity`)}</Label>\n <Value appendix=\"kW\">{asset.bessPowerCapacity}</Value>\n </Item>\n <Item>\n <Label>{t(`batteryOverview.Capacity`)}</Label>\n <Value appendix=\"kWh\">{asset.bessCapacity}</Value>\n </Item>\n <Item>\n <Label>{t(`batteryOverview.InverterPowerCapacity`)}</Label>\n <Value appendix=\"kW\">{asset.inverterPowerCapacity}</Value>\n </Item>\n <Item>\n <Label>{t(`batteryOverview.FuseSize`)}</Label>\n {asset.fuseSize != 0 ? (\n <Value appendix=\"A\">{asset.fuseSize}</Value>\n ) : (\n <Value>-</Value>\n )}\n </Item>\n </List>\n );\n};\n","import {\n CreateAssetModelRequestDTO,\n MappedAssetModelResponseDTO,\n} from \"./assetModel.dto\";\nimport { saveAs } from \"file-saver\";\nimport * as XLSX from \"xlsx\";\n\nexport const getEmptyAssetModelDTO = (): CreateAssetModelRequestDTO => ({\n name: \"\",\n manufacturer: \"\",\n description: \"\",\n compensation: 0,\n});\n\nexport const exportToExcel = (data: MappedAssetModelResponseDTO[]) => {\n const workbook = XLSX.utils.book_new();\n const worksheet = XLSX.utils.json_to_sheet(data);\n XLSX.utils.book_append_sheet(workbook, worksheet, \"All data\");\n\n const excelBuffer = XLSX.write(workbook, {\n bookType: \"xlsx\",\n type: \"array\",\n });\n const blob = new Blob([excelBuffer], { type: \"application/octet-stream\" });\n saveAs(blob, `mappedDataStep2.xlsx`);\n};\n","import { useNotification } from \"hooks/useNotification\";\nimport api from \"../axiosInstance\";\nimport {\n CreateAssetModelRequestDTO,\n GetAssetModelItemResponseDTO,\n GetAssetModelResponseDTO,\n MappedAssetModelResponseDTO,\n} from \"./assetModel.dto\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { exportToExcel } from \"./assetModel.helper\";\n\nconst ENDPOINT = \"/asset-model\";\n\nexport enum AssetModelQueryKeys {\n GetAll = \"asset-model-get-all\",\n}\n\nexport const useMapData = () => {\n return useMutation({\n mutationFn: async (): Promise<MappedAssetModelResponseDTO[]> =>\n (await api.post(`${ENDPOINT}/map-asset-model`)).data,\n onSuccess: (data: MappedAssetModelResponseDTO[]) => {\n exportToExcel(data);\n },\n });\n};\n\n//! old endpoints\n// used in\n// - settings page/assets list\n// - edit battery form to get the manufacturer and model names\n// --> can be deleted later and use another endpoint to get what we need\n\nexport const useAssetModels = () =>\n useQuery({\n queryKey: [AssetModelQueryKeys.GetAll],\n queryFn: async (): Promise<GetAssetModelItemResponseDTO[]> =>\n (await api.get(ENDPOINT)).data,\n });\n\n// used in\n// - flowerSettingsPage/AssetList/Add asset form\n// --> can be deleted later\nexport const useCreateAssetModel = (options = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreateAssetModelRequestDTO,\n ): Promise<GetAssetModelResponseDTO> =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [AssetModelQueryKeys.GetAll] });\n notification.info(`Asset created`);\n },\n onError: () => {\n notification.error();\n },\n ...options,\n });\n};\n\n// used in\n// - flowerSettingsPage/AssetList/Edit asset form\n// --> can be deleted later\nexport const useUpdateAssetModel = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: GetAssetModelItemResponseDTO,\n ): Promise<GetAssetModelResponseDTO> =>\n (await api.put(`${ENDPOINT}/${payload.id}`, payload)).data,\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [AssetModelQueryKeys.GetAll] });\n notification.info(`Changes saved`);\n },\n onError: () => {\n notification.error();\n },\n });\n};\n\n// used in\n// - flowerSettingsPage/AssetList/Delete asset form\n// --> can be deleted later\nexport const useDeleteAssetModel = (settings = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (id: number) => await api.delete(`${ENDPOINT}/${id}`),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [AssetModelQueryKeys.GetAll] });\n notification.info(`Asset model deleted`);\n },\n onError: () => {\n notification.error(\"Something went wrong, please try again\");\n },\n ...settings,\n });\n};\n","import Dropdown from \"components/input/Dropdown\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { positiveNumberValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { UpdateAssetRequestDTO } from \"api/asset/asset.dto\";\nimport { useAssetModels } from \"api/assetModel/assetModel.endpoints\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { useTranslation } from \"react-i18next\";\nimport { Battery0Icon } from \"@heroicons/react/24/outline\";\nimport { fuses } from \"components/installationFlow/bessTypes\";\n\ninterface Props {\n register: UseFormRegister<UpdateAssetRequestDTO>;\n errors?: Partial<FieldErrorsImpl<UpdateAssetRequestDTO>>;\n}\nexport const EditAssetForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n const { data: assetModels, isLoading, isError } = useAssetModels();\n\n if (isLoading || !assetModels || isError) {\n return (\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && !assetModels}\n icon={<Battery0Icon />}\n errorMessage={t(`batteryOverview.UnableToFetchTheBattery`)}\n />\n );\n }\n\n return (\n <ModalContentWrapper>\n <Dropdown\n items={[\n { label: t(\"batteryOverview.PickAFuseSize\"), value: 0 },\n ...fuses.map((fuse) => ({\n label: \"\" + fuse.ampere,\n value: fuse.ampere,\n })),\n ]}\n name=\"fuseSize\"\n label={t(\"batteryOverview.MainFuseSize\")}\n register={register}\n validation={{\n valueAsNumber: true,\n // check this validation\n validate: (value: number) =>\n +value !== -1 || \"Select one from the list\",\n }}\n errorMessage={errors?.fuseSize?.message}\n />\n <Dropdown\n items={[\n { label: t(\"batteryOverview.PickAModel\"), value: 0 },\n ...assetModels.map((am) => ({\n label: `${am.manufacturer} ${am.name}`,\n value: am.id,\n })),\n ]}\n name=\"assetModelId\"\n label={t(\"batteryOverview.Asset model\")}\n register={register}\n validation={{\n validate: (value: string) =>\n +value !== -1 || \"Select one from the list\",\n }}\n errorMessage={errors?.assetModelId?.message}\n />\n <TextInput\n label={t(\"batteryOverview.BESS power capacity\")}\n name=\"bessPowerCapacity\"\n register={register}\n appendix=\"kW\"\n size=\"third\"\n registerOptions={positiveNumberValidator}\n type=\"number\"\n errorMessage={errors?.bessPowerCapacity?.message}\n />\n <TextInput\n label={t(\"batteryOverview.Capacity\")}\n name=\"bessCapacity\"\n register={register}\n appendix=\"kWh\"\n size=\"third\"\n registerOptions={positiveNumberValidator}\n type=\"number\"\n errorMessage={errors?.bessCapacity?.message}\n />\n <TextInput\n label={t(\"batteryOverview.InverterPowerCapacity\")}\n name=\"inverterPowerCapacity\"\n register={register}\n appendix=\"kW\"\n size=\"third\"\n errorMessage={errors?.inverterPowerCapacity?.message}\n registerOptions={positiveNumberValidator}\n type=\"number\"\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n AssetQueryKeys,\n useUpdateAsset,\n} from \"../../api/asset/asset.endpoints\";\nimport Modal from \"../Modal\";\nimport SecondaryButton from \"../buttons/SecondaryButton\";\nimport { useForm } from \"react-hook-form\";\nimport {\n GetAssetResponseDTO,\n UpdateAssetRequestDTO,\n} from \"api/asset/asset.dto\";\nimport { AssetOwnerQueryKeys } from \"api/assetOwner/assetOwner.endpoints\";\nimport { EditAssetForm } from \"./EditAssetForm\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\ninterface Props {\n assetOwnerId?: number;\n asset: GetAssetResponseDTO;\n}\n\nexport const EditAsset: FC<Props> = ({ assetOwnerId, asset }) => {\n const { t } = useTranslation();\n\n // id of the asset you want to edit, populate the form with\n const [assetIdToUpdate, setAssetIdToUpdate] = useState<number | null>(null);\n\n // api\n\n // todo\n // new endpoint here to get all battery models/inverter models and related capacities\n // select the correct one in dropdown lists (copy paste the same dropdown lists from the installation flow and update where the data are from)\n // if the current value is not in the list, add it to the different possibilities so there is no error\n // add the 2 new ids in the update request but as optional fields\n // add the 2 new ids in the get request but as optional fields and use them if they are present\n // on server side: map the new and old asset model names\n\n const {\n mutate: updateAsset,\n isPending: isUpdatingAsset,\n isSuccess: isUpdateAssetSuccess,\n } = useUpdateAsset();\n\n // form\n const {\n register: registerUpdateAsset,\n handleSubmit: handleUpdateAssetSubmit,\n reset: resetUpdateAsset,\n formState: { errors: updateAssetErrors },\n } = useForm<UpdateAssetRequestDTO>();\n\n // submit\n const onUpdateAssetSubmit = handleUpdateAssetSubmit(\n (payload: UpdateAssetRequestDTO) => {\n if (!assetIdToUpdate || !asset) {\n throw Error(\"Missing asset in onUpdateAssetSubmit\");\n }\n\n updateAsset({\n payload: {\n ...payload,\n assetModelId: +payload.assetModelId,\n },\n id: assetIdToUpdate,\n });\n },\n );\n\n // modal close\n const onUpdateAssetModalClose = () => {\n setAssetIdToUpdate(null);\n setTimeout(() => resetUpdateAsset(), 300);\n };\n\n // after submit success\n const queryClient = useQueryClient();\n useEffect(() => {\n if (isUpdateAssetSuccess) {\n onUpdateAssetModalClose();\n queryClient.invalidateQueries({\n queryKey: [AssetOwnerQueryKeys.GetAllPagination, assetOwnerId],\n });\n queryClient.invalidateQueries({\n queryKey: [AssetQueryKeys.GetOne, assetIdToUpdate],\n });\n queryClient.invalidateQueries({\n queryKey: [AssetQueryKeys.GetAllPagination, assetIdToUpdate],\n });\n }\n }, [isUpdateAssetSuccess]);\n\n // Populate or clear the form every time assetIdToUpdate is set\n useEffect(() => {\n if (assetIdToUpdate) {\n resetUpdateAsset({\n ...asset,\n assetModelId: asset.assetModel.id,\n });\n } else {\n setTimeout(() => resetUpdateAsset(), 300);\n }\n }, [assetIdToUpdate]);\n\n const renderEditAssetButton = (assetId: number) => {\n return (\n <div className=\"flex justify-end mb-8\">\n <SecondaryButton onClick={() => setAssetIdToUpdate(assetId)}>\n <PencilSquareIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(`batteryOverview.EditBattery`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderEditAssetButton(asset.id)}\n\n <Modal\n title={t(`batteryOverview.EditBattery`)}\n rightButtonText={t(`Save`)}\n rightButtonActionHandler={onUpdateAssetSubmit}\n isOpen={!!assetIdToUpdate}\n onClose={onUpdateAssetModalClose}\n isLoading={isUpdatingAsset}\n >\n <EditAssetForm\n register={registerUpdateAsset}\n errors={updateAssetErrors}\n />\n </Modal>\n </>\n );\n};\n","import api from \"../axiosInstance\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { GetDataStorageResponseDTO } from \"./flowerHubStorage.dto\";\n\nconst ENDPOINT = \"/flower-hub-data-storage\";\n\nexport enum FlowerHubDataStorageQueryKeys {\n GetForAsset = \"flower-hub-data-storage-for-asset\",\n}\n\nexport const useFlowerHubDataStorageForAsset = (assetId: number) =>\n useQuery({\n queryKey: [FlowerHubDataStorageQueryKeys.GetForAsset, assetId],\n queryFn: async (): Promise<GetDataStorageResponseDTO> =>\n (await api.get(`${ENDPOINT}/${assetId}`)).data,\n gcTime: 0,\n enabled: !!assetId,\n });\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport BatteryIcon from \"styles/icons/BatteryIcon\";\nimport { GetDataStorageResponseDTO } from \"api/flowerHubStorage/flowerHubStorage.dto\";\nimport {\n DeviceInfoCard,\n InfoRow,\n StatusLabel,\n} from \"./FlowerHubDataStorageDetails\";\n\ninterface Props {\n data: GetDataStorageResponseDTO;\n}\nconst BatteryDetails: React.FC<Props> = ({ data }) => {\n const { t } = useTranslation();\n const {\n batteryRatedEnergy,\n batteryRatedPower,\n batteryTemperature,\n batteryUpperSoCLimit,\n batteryLowerSoCLimit,\n } = data;\n\n return (\n <DeviceInfoCard icon={<BatteryIcon color=\"#4438ca\" />} title={t(\"Battery\")}>\n <InfoRow\n label={t(\"Rated energy\")}\n value={`${batteryRatedEnergy} kWh`}\n data={batteryRatedEnergy}\n />\n <InfoRow\n label={t(\"Rated power\")}\n value={`${batteryRatedPower} kW`}\n data={batteryRatedPower}\n />\n <InfoRow\n label={t(\"Temperature\")}\n value={\n <div className=\"flex items-center gap-x-2\">\n {!batteryTemperature?.isValid && (\n <StatusLabel text={t(\"Out of range\")} />\n )}\n {batteryTemperature?.value} °C\n </div>\n }\n data={batteryTemperature}\n />\n <InfoRow\n label={t(\"Upper SoC limit\")}\n value={\n <div className=\"flex items-center gap-x-2\">\n {!batteryUpperSoCLimit?.isValid && (\n <StatusLabel text={t(\"Invalid\")} />\n )}\n {batteryUpperSoCLimit?.value ?? \"-\"}\n </div>\n }\n data={batteryUpperSoCLimit}\n />\n <InfoRow\n label={t(\"Lower SoC limit\")}\n value={\n <div className=\"flex items-center gap-x-2\">\n {!batteryLowerSoCLimit?.isValid && (\n <StatusLabel text={t(\"Invalid\")} />\n )}\n {batteryLowerSoCLimit?.value ?? \"-\"}\n </div>\n }\n data={batteryLowerSoCLimit}\n />\n </DeviceInfoCard>\n );\n};\n\nexport default BatteryDetails;\n","export enum InverterOEMTypes {\n Saj = \"Saj\",\n Huawei = \"Huawei\",\n Sungrow = \"Sungrow\",\n Unknown = \"Unknown\",\n}\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport InverterIcon from \"styles/icons/InverterIcon\";\nimport { InverterOEMTypes } from \"enums/flowerHubDataStorage.enums\";\nimport { GetDataStorageResponseDTO } from \"api/flowerHubStorage/flowerHubStorage.dto\";\nimport {\n DeviceInfoCard,\n InfoRow,\n StatusLabel,\n} from \"./FlowerHubDataStorageDetails\";\n\ninterface Props {\n data: GetDataStorageResponseDTO;\n}\nconst InverterDetails: React.FC<Props> = ({ data }) => {\n const { t } = useTranslation();\n const {\n oem,\n inverterModel,\n inverterOperatingMode,\n inverterRatedPower,\n inverterSerialNumber,\n inverterSoftwareVersionForHuawei,\n inverterSoftwareVersionOfArmForSungrow,\n inverterSoftwareVersionOfDspForSungrow,\n inverterCommunicationProtocolForSungrow,\n inverterCommunicationProtocolVersionForSungrow,\n controlBoardForSaj,\n displayBoardForSaj,\n } = data;\n\n return (\n <DeviceInfoCard\n icon={<InverterIcon color=\"#15803c\" />}\n title={t(\"Inverter\")}\n >\n <InfoRow label={t(\"OEM\")} value={oem} data={oem} />\n <InfoRow label={t(\"Model\")} value={inverterModel} data={inverterModel} />\n <InfoRow\n label={t(\"Serial number\")}\n value={inverterSerialNumber}\n data={inverterSerialNumber}\n />\n <InfoRow\n label={t(\"Operating mode\")}\n value={inverterOperatingMode}\n data={inverterOperatingMode}\n />\n <InfoRow\n label={t(\"Rated power\")}\n value={`${inverterRatedPower} kW`}\n data={inverterRatedPower}\n />\n\n {oem === InverterOEMTypes.Sungrow && (\n <>\n <InfoRow\n label={t(\"Communication protocol version\")}\n value={inverterCommunicationProtocolForSungrow}\n data={inverterCommunicationProtocolForSungrow}\n />\n <InfoRow\n label={t(\"Communication protocol version\")}\n value={inverterCommunicationProtocolVersionForSungrow}\n data={inverterCommunicationProtocolVersionForSungrow}\n />\n <InfoRow\n label={t(\"Software version of ARM\")}\n value={inverterSoftwareVersionOfArmForSungrow}\n data={inverterSoftwareVersionOfArmForSungrow}\n />\n <InfoRow\n label={t(\"Software version of DSP\")}\n value={inverterSoftwareVersionOfDspForSungrow}\n data={inverterSoftwareVersionOfDspForSungrow}\n />\n </>\n )}\n\n {oem === InverterOEMTypes.Saj && (\n <>\n <InfoRow\n label={t(\"Control board\")}\n value={\n <div className=\"flex items-center gap-x-2\">\n {!controlBoardForSaj?.isValid && (\n <StatusLabel text={t(\"Invalid\")} />\n )}\n {controlBoardForSaj?.value}\n </div>\n }\n data={controlBoardForSaj}\n />\n <InfoRow\n label={t(\"Display board\")}\n value={\n <div className=\"flex items-center gap-x-2\">\n {!displayBoardForSaj?.isValid && (\n <StatusLabel text={t(\"Invalid\")} />\n )}\n {displayBoardForSaj?.value}\n </div>\n }\n data={displayBoardForSaj}\n />\n </>\n )}\n\n {oem === InverterOEMTypes.Huawei && (\n <InfoRow\n label={t(\"Software version\")}\n value={\n <div className=\"flex items-center gap-x-2\">\n {!inverterSoftwareVersionForHuawei?.isValid && (\n <StatusLabel text={t(\"Invalid\")} />\n )}\n {inverterSoftwareVersionForHuawei?.value}\n </div>\n }\n data={inverterSoftwareVersionForHuawei}\n />\n )}\n </DeviceInfoCard>\n );\n};\n\nexport default InverterDetails;\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Rss } from \"lucide-react\";\nimport { InverterOEMTypes } from \"enums/flowerHubDataStorage.enums\";\nimport { GetDataStorageResponseDTO } from \"api/flowerHubStorage/flowerHubStorage.dto\";\nimport {\n DeviceInfoCard,\n InfoRow,\n StatusLabel,\n} from \"./FlowerHubDataStorageDetails\";\n\ninterface Props {\n data: GetDataStorageResponseDTO;\n}\nconst InverterDongleDetails: React.FC<Props> = ({ data }) => {\n const { t } = useTranslation();\n const {\n oem,\n inverterDongleMacAddress,\n inverterDongleIpAddress,\n inverterDongleSoftwareVersionForHuawei,\n } = data;\n\n return (\n <DeviceInfoCard\n icon={<Rss className=\"w-5 h-5 text-orange-600\" />}\n title={t(\"Inverter dongle\")}\n >\n <InfoRow\n label={t(\"MAC address\")}\n value={inverterDongleMacAddress}\n data={inverterDongleMacAddress}\n />\n <InfoRow\n label={t(\"IP address\")}\n value={inverterDongleIpAddress}\n data={inverterDongleIpAddress}\n />\n {oem === InverterOEMTypes.Huawei && (\n <InfoRow\n label={t(\"Software version\")}\n value={\n <div className=\"flex items-center gap-x-2\">\n {!inverterDongleSoftwareVersionForHuawei?.isValid && (\n <StatusLabel text={t(\"Invalid\")} />\n )}\n {inverterDongleSoftwareVersionForHuawei?.value}\n </div>\n }\n data={inverterDongleSoftwareVersionForHuawei}\n />\n )}\n </DeviceInfoCard>\n );\n};\n\nexport default InverterDongleDetails;\n","import React, { ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useFlowerHubDataStorageForAsset } from \"api/flowerHubStorage/flowerHubStorage.endpoints\";\nimport { Panel } from \"components/Panel\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport {\n ServerIcon,\n PresentationChartLineIcon,\n} from \"@heroicons/react/24/outline\";\nimport { CheckCircle2, ClockAlert } from \"lucide-react\";\nimport { getRelativeTimeLabel } from \"helpers/date\";\nimport BatteryDetails from \"./BatteryDetails\";\nimport InverterDetails from \"./InverterDetails\";\nimport InverterDongleDetails from \"./InverterDongleDetails\";\nimport { ValueWithValidationDTO } from \"api/flowerHubStorage/flowerHubStorage.dto\";\n\ninterface Props {\n assetId?: number;\n}\n\nconst FlowerHubDataStorageDetails: React.FC<Props> = ({ assetId }) => {\n const { t } = useTranslation();\n\n if (!assetId) {\n return (\n <Panel header={t(\"monitoring.Title\")} infoText={t(\"monitoring.Info\")}>\n <CustomPlaceholder\n isError={false}\n isLoading={false}\n isEmpty={true}\n icon={<ServerIcon />}\n errorMessage=\"\"\n emptyDataMessage={t(\"flowerHub.NoFlowerHub\")}\n />\n </Panel>\n );\n }\n\n const { data, isLoading, isError } = useFlowerHubDataStorageForAsset(assetId);\n\n if (isLoading || isError || !data) {\n return (\n <Panel header={t(\"monitoring.Title\")} infoText={t(\"monitoring.Info\")}>\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && !data}\n emptyDataMessage={t(\"monitoring.DataNotFound\")}\n icon={<PresentationChartLineIcon />}\n errorMessage={t(\"monitoring.UnableToLoad\")}\n />\n </Panel>\n );\n }\n\n const { lastUpdatedAt } = data;\n\n return (\n <Panel header={t(\"monitoring.Title\")} infoText={t(\"monitoring.Info\")}>\n <LastReportedStatus lastUpdatedAt={lastUpdatedAt} />\n <ul className=\"grid grid-cols-1 gap-x-6 gap-y-8 lg:grid-cols-3 xl:gap-x-8\">\n <BatteryDetails data={data} />\n <InverterDetails data={data} />\n <InverterDongleDetails data={data} />\n </ul>\n </Panel>\n );\n};\n\nexport default FlowerHubDataStorageDetails;\n\ntype StatusLabelProps = {\n text: string;\n color?: \"red\" | \"yellow\";\n};\n\nexport const StatusLabel = ({ text, color = \"red\" }: StatusLabelProps) => {\n const bg = color === \"red\" ? \"bg-red-50\" : \"bg-yellow-50\";\n const textColor = color === \"red\" ? \"text-red-700\" : \"text-yellow-700\";\n const ringColor = color === \"red\" ? \"ring-red-600/10\" : \"ring-yellow-600/10\";\n\n return (\n <div\n className={`${textColor} ${bg} ${ringColor} rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset`}\n >\n {text}\n </div>\n );\n};\n\ntype InfoRowProps = {\n label: string;\n value: ReactNode;\n data?: string | ValueWithValidationDTO | null;\n};\n\nexport const InfoRow = ({ label, value, data }: InfoRowProps) => (\n <div className=\"flex justify-between gap-x-4 py-3\">\n <dt className=\"text-gray-500\">{label}</dt>\n <dd className=\"text-gray-700\">\n <div className=\"font-medium text-gray-900 break-all\">\n {data ? value : \"-\"}\n </div>\n </dd>\n </div>\n);\n\ntype DeviceInfoCardProps = {\n icon: ReactNode;\n title: string;\n children: ReactNode;\n};\n\nexport const DeviceInfoCard = ({\n icon,\n title,\n children,\n}: DeviceInfoCardProps) => (\n <li>\n <div className=\"flex items-center gap-x-4 border-b border-gray-900/5 bg-gray-50 p-6\">\n <span className=\"inline-flex items-center justify-center rounded-lg p-3 ring-4 bg-white ring-white w-12 h-12\">\n {icon}\n </span>\n <div className=\"text-sm font-semibold text-gray-900\">{title}</div>\n </div>\n <dl className=\"-my-3 divide-y divide-gray-100 px-6 py-4 text-sm\">\n {children}\n </dl>\n </li>\n);\n\ntype LastReportedStatusProps = {\n lastUpdatedAt: string | Date;\n};\n\nconst LastReportedStatus = ({ lastUpdatedAt }: LastReportedStatusProps) => {\n const { t } = useTranslation();\n const { label, isStale, isVeryStale } = getRelativeTimeLabel(\n new Date(lastUpdatedAt),\n );\n\n const bgColor = isVeryStale\n ? \"bg-red-50 border border-red-200\"\n : isStale\n ? \"bg-yellow-50 border border-yellow-200\"\n : \"bg-green-50 border border-green-200\";\n\n const textAndTextColor = isVeryStale\n ? \"text-red-800\"\n : isStale\n ? \"text-yellow-800\"\n : \"text-green-800\";\n\n const Icon = isStale || isVeryStale ? ClockAlert : CheckCircle2;\n\n return (\n <div\n className={`flex items-center gap-x-3 rounded-md px-4 py-2 mb-4 w-fit ${bgColor}`}\n >\n <Icon className={`w-4 h-4 ${textAndTextColor}`} />\n <p className={`text-sm font-medium ${textAndTextColor}`}>\n {t(\"Last reported\")} {label}\n </p>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport { useAsset } from \"../../api/asset/asset.endpoints\";\nimport { Battery0Icon } from \"@heroicons/react/24/outline\";\nimport { Role } from \"enums/role.enum\";\nimport { BatteryDetails } from \"components/battery/BatteryDetails\";\nimport { EditAsset } from \"components/battery/EditAsset\";\nimport FlowerHubDataStorageDetails from \"components/asset/FlowerHubDataStorageDetails/FlowerHubDataStorageDetails\";\nimport { Panel } from \"components/Panel\";\nimport { isFlower } from \"helpers/role\";\n\ninterface Props {\n userRole: Role;\n assetOwnerId?: number;\n assetId?: number;\n showEditAsset?: boolean;\n}\n\nexport const AssetTab: FC<Props> = ({\n userRole,\n assetOwnerId,\n assetId,\n showEditAsset = false,\n}) => {\n const { t } = useTranslation();\n\n // Get asset\n const {\n data: asset,\n isLoading: isLoadingAsset,\n isError: isErrorAsset,\n } = useAsset(assetId);\n\n const renderPlaceholder = () => (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isErrorAsset}\n isLoading={isLoadingAsset}\n isEmpty={!isLoadingAsset && !isErrorAsset && !asset}\n icon={<Battery0Icon />}\n errorMessage={t(`batteryOverview.UnableToFetchTheBattery`)}\n emptyDataMessage={t(`batteryOverview.NoBattery`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n\n if (isLoadingAsset || !asset || isErrorAsset) {\n return renderPlaceholder();\n }\n\n return (\n <div className=\"overflow-auto\">\n <>\n {isFlower(userRole) && (\n <FlowerHubDataStorageDetails assetId={assetId} />\n )}\n <Panel\n header={t(`batteryOverview.Title`)}\n infoText={t(`batteryOverview.Info`)}\n >\n <BatteryDetails userRole={userRole} asset={asset} />\n </Panel>\n </>\n\n {showEditAsset && <EditAsset assetOwnerId={assetOwnerId} asset={asset} />}\n </div>\n );\n};\n","import { TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { useParams, useSearchParams } from \"react-router-dom\";\nimport { AccountDetails } from \"../../../components/assetOwner/AccountDetails\";\nimport { menuStore } from \"store/menu.store\";\nimport { useAssetOwner } from \"api/assetOwner/assetOwner.endpoints\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport { getBreadCrumbs } from \"../../../helpers/assetOwner\";\nimport TabContainer from \"components/tab/TabContainer\";\nimport { Consumption } from \"../../../components/consumption/Consumption\";\nimport { FlowerRevenue } from \"components/flowerRevenue/FlowerRevenue\";\nimport { SystemNotificationInfo } from \"components/systemNotification/SystemNotificationInfo\";\nimport { useActiveZavannSystemNotifications } from \"api/system-notification/systemNotification.endpoints\";\nimport { useTranslation } from \"react-i18next\";\nimport { FlowerHubDetails } from \"components/flowerHub/FlowerHubDetails\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { isFlower } from \"../../../helpers/role\";\nimport { ElectricityAgreementTab } from \"../../../components/electricityAgreement/ElectricityAgreementTab\";\nimport { AssetTab } from \"components/asset/AssetTab\";\n\nexport enum AssetOwnerTabs {\n FlowerHub = \"flowerhub\",\n Asset = \"asset\",\n AccountDetails = \"account-details\",\n ElectricityAgreement = \"electricity-agreement\",\n Graph = \"consumption-graph\",\n FlowerRevenue = \"flower-revenue\",\n}\n\nexport default function AssetOwnerPage() {\n const params = useParams();\n const assetOwnerId: string = params?.assetOwnerId || \"-1\";\n\n const userRole = userStore(getUserRole);\n\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n const currentTab = searchParams.get(\"tab\") || AssetOwnerTabs.FlowerHub;\n\n const { t } = useTranslation();\n\n //Get active zavann system notifications\n const { data: systemNotification } = useActiveZavannSystemNotifications();\n\n // Get asset owner\n const {\n data: assetOwner,\n isLoading: isLoadingAssetOwner,\n isError: isErrorAssetOwner,\n } = useAssetOwner(+assetOwnerId);\n\n // breadcrumbs\n const { setBreadCrumbs } = menuStore();\n\n // Set breadcrumbs and form every time assetOwner updates\n useEffect(() => {\n if (assetOwner) {\n setBreadCrumbs(getBreadCrumbs(assetOwner, userRole));\n }\n }, [assetOwner]);\n\n if (isLoadingAssetOwner || isErrorAssetOwner || !assetOwner) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isErrorAssetOwner}\n isLoading={isLoadingAssetOwner}\n isEmpty={!isLoadingAssetOwner && !isErrorAssetOwner && !assetOwner}\n icon={<UserIcon />}\n errorMessage={t(`assetOwnerAccountDetails.assetOwnerNotFound`)}\n emptyDataMessage={t(`assetOwnerAccountDetails.assetOwnerNotFound`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n const tabs = [\n {\n param: AssetOwnerTabs.FlowerHub,\n label: t(`flowerHub.Title`),\n content: (\n <TabContainer key={AssetOwnerTabs.FlowerHub}>\n <FlowerHubDetails\n assetOwnerId={assetOwner.id}\n assetId={assetOwner.asset?.id}\n serialNumber={assetOwner.asset?.serialNumber}\n />\n </TabContainer>\n ),\n isSelected: currentTab === AssetOwnerTabs.FlowerHub,\n },\n {\n param: AssetOwnerTabs.Asset,\n label: t(`batteryOverview.Asset`),\n content: (\n <TabContainer key={AssetOwnerTabs.Asset}>\n <AssetTab\n assetOwnerId={+assetOwnerId}\n assetId={assetOwner.asset?.id}\n showEditAsset={isFlower(userRole)}\n userRole={userRole}\n />\n </TabContainer>\n ),\n isSelected: currentTab === AssetOwnerTabs.Asset,\n },\n {\n param: AssetOwnerTabs.AccountDetails,\n label: t(`assetOwnerAccountDetails.Title`),\n content: (\n <TabContainer key={AssetOwnerTabs.AccountDetails}>\n <AccountDetails\n assetOwnerId={assetOwner.id}\n userRole={userRole}\n hasAsset={!!assetOwner.asset?.id}\n />\n </TabContainer>\n ),\n isSelected: currentTab === AssetOwnerTabs.AccountDetails,\n },\n {\n param: AssetOwnerTabs.ElectricityAgreement,\n label: t(`electricityAgreement.Title`),\n content: (\n <TabContainer key={AssetOwnerTabs.ElectricityAgreement}>\n {systemNotification ? (\n <SystemNotificationInfo notification={systemNotification} />\n ) : (\n <ElectricityAgreementTab\n assetOwnerId={assetOwner.id}\n userRole={userRole}\n />\n )}\n </TabContainer>\n ),\n isSelected: currentTab === AssetOwnerTabs.ElectricityAgreement,\n },\n ];\n\n if (isFlower(userRole)) {\n const flowerUserTabs = [\n {\n param: AssetOwnerTabs.Graph,\n label: t(`graph.Title`),\n content: (\n <TabContainer key={AssetOwnerTabs.Graph}>\n {systemNotification ? (\n <SystemNotificationInfo notification={systemNotification} />\n ) : (\n <Consumption assetOwnerId={assetOwner.id} />\n )}\n </TabContainer>\n ),\n isSelected: currentTab === AssetOwnerTabs.Graph,\n },\n {\n param: AssetOwnerTabs.FlowerRevenue,\n label: t(`flowerRevenue.Title`),\n content: (\n <TabContainer key={AssetOwnerTabs.FlowerRevenue}>\n <FlowerRevenue\n assetId={assetOwner.asset?.id}\n bessCompensationStartDate={assetOwner?.bessCompensationStartDate}\n showLink={false}\n />\n </TabContainer>\n ),\n isSelected: currentTab === AssetOwnerTabs.FlowerRevenue,\n },\n ];\n\n tabs.push(...flowerUserTabs);\n }\n\n return <TabPageWrapper tabs={tabs} setTab={setTab} />;\n}\n","import {\n GetAssetOwnerProfileResponseDTO,\n AssetOwnerItemDTO,\n} from \"api/assetOwner/assetOwner.dto\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb } from \"store/menu.store\";\n\n// Question: necessary to have a function for that?\nexport const getAssetOwnerName = ({\n firstName,\n lastName,\n}: AssetOwnerItemDTO | GetAssetOwnerProfileResponseDTO) =>\n `${firstName} ${lastName}`;\n\nexport const getAssetOwnerListBreadcrumb = (): BreadCrumb => ({\n label: \"Asset owners\",\n to: getAssetOwnerListLink(),\n});\n\nexport const getAssetOwnerListLink = (): string =>\n `${RouteUrl.App}/${RouteUrl.AssetOwners}`;\n","import { Role } from \"enums/role.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb } from \"store/menu.store\";\nimport { getDistributorListBreadcrumb } from \"../pages/app/distributorList/DistributorListPage\";\nimport { getDistributorBreadcrumb } from \"../pages/app/distributor/DistributorPage\";\nimport { getInstallerListBreadcrumb } from \"../pages/app/installerList/InstallerListPage\";\nimport { getInstallerBreadcrumb } from \"./installer\";\n\nimport { GetAssetOwnerResponseDTO } from \"api/assetOwner/assetOwner.dto\";\nimport { AssetOwnerTabs } from \"../pages/app/assetOwnerPage/AssetOwnerPage\";\nimport { getAssetOwnerListBreadcrumb } from \"./assetOwnerList\";\n\nexport const getBreadCrumbs = (\n assetOwner: GetAssetOwnerResponseDTO,\n userRole: Role,\n) => {\n switch (userRole) {\n case Role.Flower:\n return [\n getDistributorListBreadcrumb(),\n getDistributorBreadcrumb({\n id: assetOwner.distributor.id ?? -1,\n name: assetOwner.distributor.name,\n }),\n getInstallerBreadcrumb(\n assetOwner.installer.name,\n assetOwner.installer.id ?? -1,\n assetOwner.distributor.id ?? -1,\n Role.Flower,\n ),\n getAssetOwnerBreadcrumb(assetOwner, Role.Flower),\n ];\n case Role.DistributorAdmin:\n case Role.DistributorUser:\n return [\n getInstallerListBreadcrumb(),\n getInstallerBreadcrumb(\n assetOwner.installer.name,\n assetOwner.installer.id ?? -1,\n assetOwner.distributor.id ?? -1,\n userRole,\n ),\n getAssetOwnerBreadcrumb(assetOwner, userRole),\n ];\n case Role.InstallerAdmin:\n case Role.InstallerUser:\n return [\n getAssetOwnerListBreadcrumb(),\n getAssetOwnerBreadcrumb(assetOwner, userRole),\n ];\n\n default:\n throw new Error(\n `AssetOwnerPage.getBreadCrumbs is missing implementation for role ${userRole}`,\n );\n }\n};\n\nconst getAssetOwnerBreadcrumb = (\n assetOwner: GetAssetOwnerResponseDTO,\n userRole: Role,\n): BreadCrumb => {\n return {\n label: `${assetOwner.firstName} ${assetOwner.lastName}`,\n to: getAssetOwnerPageRoute(\n userRole,\n assetOwner.id,\n assetOwner.installer.id,\n assetOwner.distributor.id,\n ),\n iconType: \"assetOwner\",\n };\n};\n\nexport const getAssetOwnerPageRoute = (\n userRole: Role,\n assetOwnerId: number,\n installerId?: number,\n distributorId?: number,\n) => {\n switch (userRole) {\n case Role.Flower:\n return `${RouteUrl.App}/${RouteUrl.Distributors}/${distributorId}/${installerId}/${assetOwnerId}`;\n case Role.DistributorAdmin:\n case Role.DistributorUser:\n return `${RouteUrl.App}/${RouteUrl.Installers}/${installerId}/${assetOwnerId}`;\n case Role.InstallerAdmin:\n case Role.InstallerUser:\n return `${RouteUrl.App}/${RouteUrl.AssetOwners}/${assetOwnerId}`;\n default:\n throw new Error(\n `Role ${userRole} should not access getAssetOwnerPageRoute`,\n );\n }\n};\n\n// Only available for Flower Users\nexport const getAssetRoute = (\n assetOwnerId: number,\n installerId?: number,\n distributorId?: number,\n) =>\n `${getAssetOwnerPageRoute(\n Role.Flower,\n assetOwnerId,\n installerId,\n distributorId,\n )}?tab=${AssetOwnerTabs.FlowerHub}`;\n\nexport function hasDifferentContactEmail(\n mainEmail: string,\n contactEmail?: string,\n): boolean {\n // When the user is pending with signing, contactEmail can be null\n return !!contactEmail && mainEmail !== contactEmail;\n}\n","import { Dispatch, FC, SetStateAction, useMemo } from \"react\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { FlowerHubStatusTag } from \"../tags/FlowerHubStatusTag\";\nimport { AssetItemDTO } from \"../../api/asset/asset.dto\";\nimport { Table } from \"../tableBeta/Table\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n InfiniteQueryResult,\n} from \"../../api/pagination/pagination.type\";\nimport { FlowerHubStatusDTO } from \"api/flowerHub/flowerHub.dto\";\n\ninterface Props {\n paginationQuery: InfiniteQueryResult<AssetItemDTO>;\n setPaginationUrl: Dispatch<SetStateAction<string>>;\n onAssetClick: (\n assetOwnerId: number,\n installerId: number,\n distributorId: number | undefined,\n ) => void;\n createColumnFilter: (filter: FilterDTO[]) => FilterWithLabelDTO[];\n}\n\nexport const FlowerHubTable: FC<Props> = ({\n paginationQuery,\n setPaginationUrl,\n onAssetClick,\n createColumnFilter,\n}) => {\n const { t } = useTranslation();\n\n const handleRowClick = (row: AssetItemDTO) => {\n if (row)\n onAssetClick(row.assetOwnerId, row.installer.id, row.distributorId);\n };\n\n // Table columns definition\n const columns: ColumnDef<AssetItemDTO>[] = useMemo(\n () => [\n {\n accessorKey: \"serialNumber\",\n header: `${t(\"FlowerHubList.columnHeader.serialNumber\")}`,\n },\n {\n accessorKey: \"flowerHubStatus\",\n header: `${t(\"FlowerHubList.columnHeader.flowerHubStatus\")}`,\n cell: (row) => {\n if (!row.row.original?.flowerHubStatus) {\n return null;\n }\n return (\n <FlowerHubStatusTag\n flowerHubStatus={\n row.row.original?.flowerHubStatus as FlowerHubStatusDTO\n }\n />\n );\n },\n enableSorting: false,\n },\n {\n accessorKey: \"model\",\n header: `${t(\"FlowerHubList.columnHeader.model\")}`,\n cell: (row) => {\n return (\n <div className=\"flex flex-col truncate leading-5\">\n <span className=\"truncate\">\n {row.row.original?.assetModel.manufacturer}\n </span>\n <span className=\"truncate\">\n {row.row.original?.assetModel.name}\n </span>\n </div>\n );\n },\n },\n {\n accessorKey: \"bessPowerCapacity\",\n header: `${t(\"FlowerHubList.columnHeader.bessPowerCapacity\")}`,\n accessorFn: (row: AssetItemDTO) => `${row.bessPowerCapacity} kW`,\n },\n {\n accessorKey: \"bessCapacity\",\n header: `${t(\"FlowerHubList.columnHeader.bessCapacity\")}`,\n accessorFn: (row: AssetItemDTO) => `${row.bessCapacity} kWh`,\n },\n {\n accessorKey: \"inverterPowerCapacity\",\n header: `${t(\"FlowerHubList.columnHeader.inverterPowerCapacity\")}`,\n accessorFn: (row: AssetItemDTO) => `${row.inverterPowerCapacity} kW`,\n },\n {\n accessorKey: \"installerName\",\n header: `${t(\"FlowerHubList.columnHeader.installerName\")}`,\n accessorFn: (row: AssetItemDTO) => `${row.installer.name}`,\n },\n ],\n [],\n );\n\n return (\n <Table\n columns={columns}\n paginationQuery={paginationQuery}\n onSelectRow={handleRowClick}\n setPaginationUrl={setPaginationUrl}\n title={\"Flower Hubs\"}\n searchPlaceholder={`${t(\"FlowerHubList.SearchForFlowerHubs\")}`}\n createColumnFilter={createColumnFilter}\n />\n );\n};\n","import React, { Dispatch, FC, SetStateAction } from \"react\";\nimport { FlowerHubStatusTag } from \"../tags/FlowerHubStatusTag\";\nimport { AssetItemDTO } from \"../../api/asset/asset.dto\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n InfiniteQueryResult,\n} from \"../../api/pagination/pagination.type\";\nimport { List } from \"../listBeta/List\";\nimport { ElementDef } from \"../listBeta/LI\";\nimport { BoltIcon, ServerIcon, TruckIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n paginationQuery: InfiniteQueryResult<AssetItemDTO>;\n setPaginationUrl: Dispatch<SetStateAction<string>>;\n onAssetClick: (\n assetOwnerId: number,\n installerId: number,\n distributorId: number | undefined,\n ) => void;\n createColumnFilter: (filter: FilterDTO[]) => FilterWithLabelDTO[];\n}\n\nexport const FlowerHubList: FC<Props> = ({\n paginationQuery,\n setPaginationUrl,\n onAssetClick,\n createColumnFilter,\n}) => {\n const { t } = useTranslation();\n\n const handleRowClick = (row: AssetItemDTO) => {\n if (row)\n onAssetClick(row.assetOwnerId, row.installer.id, row.distributorId);\n };\n\n const elements: ElementDef<AssetItemDTO> = (element: AssetItemDTO) => {\n return {\n left: [\n {\n key: \"installerName\",\n cell: () => (\n <div className=\"flex items-center text-sm font-medium truncate text-gray-500\">\n <TruckIcon\n className=\"h-5 w-5 mr-2 flex-shrink-0\"\n aria-hidden=\"true\"\n />\n <span className=\"w-full truncate\">{element.installer.name}</span>\n </div>\n ),\n },\n {\n key: \"model\",\n cell: () => (\n <div className=\"flex items-center text-sm font-medium truncate text-gray-500\">\n <BoltIcon\n className=\"h-5 w-5 mr-2 flex-shrink-0\"\n aria-hidden=\"true\"\n />\n <div className=\"flex flex-col w-full truncate items-start text-sm\">\n <span className=\"w-full truncate\">\n {element.assetModel.manufacturer}\n </span>\n <span className=\"w-full truncate\">\n {element.assetModel.name}\n </span>\n </div>\n </div>\n ),\n },\n ],\n right: [\n {\n key: \"serialNumber\",\n cell: () => (\n <div className=\"flex items-center justify-end text-sm text-gray-500\">\n {element.serialNumber}\n <ServerIcon\n className=\"h-5 w-5 ml-2 flex-shrink-0\"\n aria-hidden=\"true\"\n />\n </div>\n ),\n },\n {\n key: \"flowerHubStatus\",\n cell: () =>\n element?.flowerHubStatus ? (\n <FlowerHubStatusTag flowerHubStatus={element.flowerHubStatus} />\n ) : undefined,\n },\n ],\n };\n };\n\n return (\n <List\n elements={elements}\n paginationQuery={paginationQuery}\n onSelectRow={handleRowClick}\n setPaginationUrl={setPaginationUrl}\n title={\"Flower Hubs\"}\n searchPlaceholder={`${t(\"FlowerHubList.Search\")}`}\n createColumnFilter={createColumnFilter}\n />\n );\n};\n","import { useAssetsPagination } from \"api/asset/asset.endpoints\";\n\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { ServerIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNavigate } from \"react-router-dom\";\nimport { getAssetRoute } from \"../../helpers/assetOwner\";\nimport { FlowerHubTable } from \"./FlowerHubTable\";\nimport { InfiniteData, UseInfiniteQueryResult } from \"@tanstack/react-query\";\nimport { GetAllAssetResponseDTO } from \"../../api/asset/asset.dto\";\nimport { useState } from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { FlowerHubList } from \"./FlowerHubList\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n} from \"../../api/pagination/pagination.type\";\n\nexport const FlowerHubs = () => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n\n // Pagination query string state is defined to store the query string in the parent component\n const [queryString, setQueryString] = useState<string>(\"\");\n\n // Infinite query to get asset owners with pagination\n const paginationQuery: UseInfiniteQueryResult<\n InfiniteData<GetAllAssetResponseDTO>\n > = useAssetsPagination(queryString);\n\n // Extract relevant information for this component from the pagination query\n const { isLoading, isError } = paginationQuery;\n\n const onAssetClick = (\n assetOwnerId: number,\n installerId: number,\n distributorId: number | undefined,\n ) => {\n navigate(getAssetRoute(assetOwnerId, installerId, distributorId));\n };\n\n // Convert the filter options to the enum values for the installer can invite filter\n const createColumnFilter = (filters: FilterDTO[]): FilterWithLabelDTO[] =>\n filters.map((filter) => {\n return {\n id: filter.id,\n options: filter.options.map((option) => {\n return {\n label: option,\n value: option,\n };\n }),\n };\n });\n\n if (isLoading || isError) {\n return (\n <div className=\"flex h-full items-center lg:items-start lg:pt-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError}\n icon={<ServerIcon />}\n errorMessage={t(`flowerHub.UnableToLoadFlowerHubs`)}\n emptyDataMessage={t(`flowerHub.NoFlowerHubs`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col h-full\">\n {isMobile ? (\n <FlowerHubList\n paginationQuery={paginationQuery}\n setPaginationUrl={setQueryString}\n onAssetClick={onAssetClick}\n createColumnFilter={createColumnFilter}\n />\n ) : (\n <FlowerHubTable\n paginationQuery={paginationQuery}\n setPaginationUrl={setQueryString}\n onAssetClick={onAssetClick}\n createColumnFilter={createColumnFilter}\n />\n )}\n </div>\n );\n};\n","import { useEffect } from \"react\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport { FlowerHubs } from \"../../../components/flowerHub/FlowerHubs\";\nimport { SmoothUp } from \"../../../components/animations/SnapUp\";\n\nexport const AssetListPage = () => {\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n setBreadCrumbs(getAssetListBreadcrumbs());\n }, []);\n\n return (\n <SmoothUp>\n <FlowerHubs />\n </SmoothUp>\n );\n};\n\nconst getAssetListBreadcrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.Assets,\n to: getAssetListLink(),\n },\n];\n\nexport const getAssetListLink = (): string =>\n [RouteUrl.App, RouteUrl.Assets].join(\"/\");\n","import {\n BanknotesIcon,\n Battery0Icon,\n BoltIcon,\n ChartBarIcon,\n CogIcon,\n CubeIcon,\n DocumentDuplicateIcon,\n HandRaisedIcon,\n HomeModernIcon,\n ServerStackIcon,\n TruckIcon,\n UserCircleIcon,\n UsersIcon,\n} from \"@heroicons/react/24/outline\";\nimport { BreadCrumbIconType } from \"store/menu.store\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { Role } from \"enums/role.enum\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { getAssetListLink } from \"pages/app/assetList/AssetListPage\";\nimport { ForwardRefExoticComponent, RefAttributes, SVGProps } from \"react\";\n\nexport const getBreadCrumbIcon = (type: BreadCrumbIconType) => {\n switch (type) {\n case \"assetOwner\":\n return (\n <HomeModernIcon\n className=\"flex-shrink-0 h-4 w-4 mr-1 text-gray-400\"\n aria-hidden=\"true\"\n />\n );\n case \"distributor\":\n return (\n <CubeIcon\n className=\"flex-shrink-0 h-4 w-4 mr-1 text-gray-400\"\n aria-hidden=\"true\"\n />\n );\n case \"installer\":\n return (\n <TruckIcon\n className=\"flex-shrink-0 h-4 w-4 mr-1 text-gray-400\"\n aria-hidden=\"true\"\n />\n );\n default:\n return null;\n }\n};\n\nexport const navigation: NavigationItem[] = [\n // Property \"name\" is a key for translation (navigation.name). Update json files if you change it\n {\n name: RouteLabel.Dashboard,\n href: `${RouteUrl.App}/${RouteUrl.Dashboard}`,\n allowedRoles: [\n Role.InstallerAdmin,\n Role.InstallerUser,\n Role.AssetOwner,\n Role.DistributorAdmin,\n Role.DistributorUser,\n Role.Flower,\n ],\n icon: BoltIcon,\n },\n {\n name: RouteLabel.Battery,\n href: `${RouteUrl.App}/${RouteUrl.Battery}`,\n allowedRoles: [Role.AssetOwner],\n icon: Battery0Icon,\n },\n {\n name: RouteLabel.ConsumptionAndRevenue,\n href: `${RouteUrl.App}/${RouteUrl.ConsumptionAndRevenue}`,\n allowedRoles: [Role.AssetOwner],\n icon: ChartBarIcon,\n },\n {\n name: RouteLabel.Distributors,\n href: `${RouteUrl.App}/${RouteUrl.Distributors}`,\n allowedRoles: [Role.Flower],\n icon: CubeIcon,\n },\n {\n name: RouteLabel.Installers,\n href: `${RouteUrl.App}/${RouteUrl.Installers}`,\n allowedRoles: [Role.Flower, Role.DistributorAdmin, Role.DistributorUser],\n icon: TruckIcon,\n },\n {\n name: RouteLabel.AssetOwners,\n href: `${RouteUrl.App}/${RouteUrl.AssetOwners}`,\n allowedRoles: [\n Role.Flower,\n Role.DistributorAdmin,\n Role.DistributorUser,\n Role.InstallerAdmin,\n Role.InstallerUser,\n ],\n icon: HomeModernIcon,\n },\n {\n name: RouteLabel.Assets,\n href: getAssetListLink(),\n allowedRoles: [Role.Flower],\n icon: ServerStackIcon,\n },\n {\n name: RouteLabel.Invoices,\n href: `${RouteUrl.App}/${RouteUrl.InvoiceList}`,\n allowedRoles: [Role.AssetOwner],\n icon: DocumentDuplicateIcon,\n },\n {\n name: RouteLabel.Organization,\n href: `${RouteUrl.App}/${RouteUrl.Organization}`,\n allowedRoles: [Role.Flower, Role.DistributorAdmin, Role.InstallerAdmin],\n icon: UsersIcon,\n },\n {\n name: RouteLabel.Settings,\n href: `${RouteUrl.App}/${RouteUrl.Settings}`,\n allowedRoles: [Role.Flower],\n icon: CogIcon,\n },\n {\n name: RouteLabel.AssetModelConfiguration,\n href: `${RouteUrl.App}/${RouteUrl.AssetModelConfiguration}`,\n allowedRoles: [Role.Flower],\n icon: Battery0Icon,\n },\n {\n name: RouteLabel.Profile,\n href: `${RouteUrl.App}/${RouteUrl.Profile}`,\n allowedRoles: [Role.AssetOwner],\n icon: UserCircleIcon,\n },\n {\n name: RouteLabel.Compensation,\n href: `${RouteUrl.App}/${RouteUrl.Compensation}`,\n allowedRoles: [Role.Flower],\n icon: BanknotesIcon,\n },\n {\n name: RouteLabel.ManualAction,\n href: `${RouteUrl.App}/${RouteUrl.ManualAction}`,\n allowedRoles: [Role.Flower],\n icon: HandRaisedIcon,\n },\n];\n\ntype IconSVGProps = ForwardRefExoticComponent<\n Omit<SVGProps<SVGSVGElement>, \"ref\"> & {\n title?: string | undefined;\n titleId?: string | undefined;\n } & RefAttributes<SVGSVGElement>\n>;\n\nexport interface NavigationItem {\n name: string;\n href: string;\n isCurrentRoute?: boolean;\n allowedRoles: Role[];\n icon: IconSVGProps;\n}\n","import { classNames } from \"helpers/classNames\";\nimport { FC } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { NavigationItem } from \"./AppWrapper.helpers\";\nimport { PowerIcon } from \"@heroicons/react/24/outline\";\nimport {\n DoubleLeftArrowHead,\n DoubleRightArrowHead,\n FlowerHubLogo,\n FlowerSymbolLogo,\n} from \"styles/Icons\";\nimport { motion } from \"framer-motion\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n menuCollapsed: boolean;\n onMenuCollapse: () => void;\n navigation: NavigationItem[];\n logout: () => void;\n}\n\nconst framerMenuBackground = {\n initial: { x: \"-100%\" },\n animate: { x: 0 },\n exit: { x: \"-100%\" },\n transition: { duration: 0.3 },\n};\n\nexport const DesktopMenu: FC<Props> = ({\n menuCollapsed,\n onMenuCollapse,\n navigation,\n logout,\n}) => {\n const { t } = useTranslation();\n\n return (\n <motion.div\n {...framerMenuBackground}\n className={`hidden lg:flex ${menuCollapsed ? \"lg:w-14\" : \"lg:w-56\"} lg:flex-col lg:fixed lg:inset-y-0`}\n >\n <div className=\"flex-1 flex flex-col min-h-0 bg-white\">\n <div\n className=\"flex flex-shrink-0 items-center justify-end -mr-2 cursor-pointer\"\n onClick={onMenuCollapse}\n >\n <img\n className=\"h-auto w-5\"\n src={menuCollapsed ? DoubleRightArrowHead : DoubleLeftArrowHead}\n alt=\"Arrow\"\n />\n </div>\n <div className=\"flex-1 flex flex-col pt-5 pb-4 overflow-y-auto\">\n <div className=\"flex flex-shrink-0 items-center justify-center\">\n <img\n className={`h-auto ${menuCollapsed ? \"w-7\" : \"w-48\"}`}\n src={menuCollapsed ? FlowerSymbolLogo : FlowerHubLogo}\n alt=\"Flower Hub\"\n />\n </div>\n <nav className=\"mt-5 flex-1 space-y-1 px-2\">\n {navigation.map((item) => (\n <Link\n key={item.name}\n to={item.href}\n className={classNames(\n item.isCurrentRoute\n ? \"bg-flowerPeach-500 text-flowerPeach-900 border border-flowerPeach-900\"\n : \"text-flowerGray-600 hover:text-flowerPeach-900\",\n \"group flex items-center px-2 py-2 text-sm font-normal rounded-md border-white\",\n )}\n >\n <item.icon\n className={classNames(\n item.isCurrentRoute\n ? \"text-flowerPeach-900\"\n : \"text-flowerGray-600 group-hover:text-flowerPeach-900\",\n \"mr-3 flex-shrink-0 h-6 w-6\",\n )}\n aria-hidden=\"true\"\n />\n {!menuCollapsed && t(`navigation.${item.name}`)}\n </Link>\n ))}\n </nav>\n </div>\n <div\n onClick={() => logout()}\n className=\"flex-shrink-0 flex p-4 cursor-pointer\"\n >\n <div className=\"flex-shrink-0 w-full group block cursor-pointer\">\n <div className=\"flex items-center text-flowerGray-600 hover:text-flowerPeach-900\">\n <PowerIcon\n className={\n \"text-flowerGray-600 mr-3 flex-shrink-0 h-6 w-6 group-hover:text-flowerPeach-900\"\n }\n aria-hidden=\"true\"\n />\n {!menuCollapsed && (\n <div className=\"ml-3\">\n <span className=\"text-sm font-medium \">\n {t(`navigation.Sign out`)}\n </span>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </motion.div>\n );\n};\n","import { FC } from \"react\";\nimport { FlowerHubLogo } from \"styles/Icons\";\nimport { Bars3Icon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n openSidebar: () => void;\n}\nexport const MobileMenuButton: FC<Props> = ({ openSidebar }) => {\n const { t } = useTranslation();\n return (\n <div className=\"sticky top-0 z-10 lg:hidden pl-1 pt-1 sm:pl-3 bg-white flex items-center justify-between\">\n <button\n type=\"button\"\n className=\"-ml-0.5 -mt-0.5 inline-flex h-12 w-12 items-center justify-center rounded-md text-gray-500 hover:text-gray-900 focus:outline-none\"\n onClick={openSidebar}\n tabIndex={-1}\n >\n <span className=\"sr-only\">{t(\"Open sidebar\")}</span>\n <Bars3Icon className=\"h-6 w-6 text-flowerGray-600\" aria-hidden=\"true\" />\n </button>\n\n <img\n className={`h-auto w-40 mr-4`}\n src={FlowerHubLogo}\n alt=\"Flower Hub\"\n />\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { menuStore } from \"store/menu.store\";\nimport { ChevronRightIcon } from \"@heroicons/react/20/solid\";\nimport { Link } from \"react-router-dom\";\nimport { getBreadCrumbIcon } from \"./AppWrapper.helpers\";\nimport { isMobile } from \"react-device-detect\";\n\nexport const Header: FC = () => {\n const { breadCrumbs } = menuStore();\n if (breadCrumbs.length === 1) return null;\n return (\n <header className=\"flex h-12 md:h-14 items-center mr-auto max-w-7xl w-full py-2 md:py-6 px-4 md:px-8\">\n {/* Breadcrumbs */}\n <nav className=\"flex sm:text-xs w-full\" aria-label=\"Breadcrumb\">\n <ol role=\"list\" className=\"flex items-center space-x-4 w-full\">\n {breadCrumbs.map((breadCrumb, index) => (\n <li key={breadCrumb.to} className=\"!ml-0\">\n <div\n className={\n index > 0 ? \"flex items-center !ml-1 md:!ml-4\" : \"flex\"\n }\n >\n {index > 0 && (\n <ChevronRightIcon\n className=\"flex-shrink-0 h-5 w-5 text-gray-400\"\n aria-hidden=\"true\"\n />\n )}\n <Link\n to={breadCrumb.to}\n className={\n index > 0\n ? \"ml-1 md:ml-4 text-xs md:text-sm font-medium text-gray-400 hover:text-gray-700 flex items-center\"\n : \"text-xs md:text-sm font-medium text-gray-400 hover:text-gray-700 flex items-center\"\n }\n >\n <>\n {!!breadCrumb.iconType &&\n !isMobile &&\n getBreadCrumbIcon(breadCrumb.iconType)}\n {breadCrumb.label}\n </>\n </Link>\n </div>\n </li>\n ))}\n </ol>\n </nav>\n </header>\n );\n};\n","import { FC, ReactNode } from \"react\";\nimport { Header } from \"./Header\";\n\ninterface Props {\n children: ReactNode;\n}\n\nexport const Content: FC<Props> = ({ children }) => (\n <main className=\"flex flex-col w-full h-full overflow-hidden\">\n <Header />\n {children}\n </main>\n);\n","import { FC, ReactNode, useEffect, useState } from \"react\";\nimport { useLocation } from \"react-router-dom\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport { useServerLogout } from \"api/auth/auth.endpoints\";\nimport { useLogout } from \"hooks/useLogout\";\nimport { MobileMenu } from \"./MobileMenu\";\nimport { navigation, NavigationItem } from \"./AppWrapper.helpers\";\nimport { DesktopMenu } from \"./DesktopMenu\";\nimport { MobileMenuButton } from \"./MobileMenuButton\";\nimport { Content } from \"./Content\";\n\ntype Props = {\n children?: ReactNode;\n};\n\nexport const AppWrapper: FC<Props> = ({ children }) => {\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const [menuCollapsed, setSidebarCollapsed] = useState(false);\n const authLevel = userStore(getUserRole);\n const { pathname } = useLocation();\n const filteredNavigation: NavigationItem[] = navigation\n .filter((item) => item.allowedRoles.includes(authLevel))\n .map((item: NavigationItem) => ({\n ...item,\n isCurrentRoute: pathname.includes(item.href),\n }));\n\n // useServerLogout kills the auth-cookie.\n // useLogout clears the user-data in the client so that the app rerenders and routes to the login page\n const { mutate: logout, isSuccess } = useServerLogout();\n const handleLogout = () => logout();\n const afterLogout = useLogout();\n\n useEffect(() => {\n if (isSuccess) {\n afterLogout();\n }\n }, [isSuccess, afterLogout]);\n\n useEffect(() => {\n if (sidebarOpen) {\n setSidebarOpen(false);\n }\n }, [pathname]);\n\n return (\n <>\n <MobileMenu\n navigation={filteredNavigation}\n sidebarOpen={sidebarOpen}\n setSidebarOpen={setSidebarOpen}\n logout={handleLogout}\n />\n <DesktopMenu\n navigation={filteredNavigation}\n logout={handleLogout}\n menuCollapsed={menuCollapsed}\n onMenuCollapse={() => setSidebarCollapsed(!menuCollapsed)}\n />\n\n <div\n className={`flex flex-1 flex-col h-lvh overflow-y-auto ${menuCollapsed ? \"lg:pl-14\" : \"lg:pl-56\"}`}\n >\n <MobileMenuButton openSidebar={() => setSidebarOpen(true)} />\n <Content>{children}</Content>\n </div>\n </>\n );\n};\n","import { ErrorAlert } from \"components/ErrorAlert\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { CheckCircleIcon } from \"@heroicons/react/20/solid\";\nimport { ExclamationCircleIcon } from \"@heroicons/react/24/outline\";\nimport { SignUpDTO } from \"types/signUp.type\";\nimport { PasswordInput } from \"./input/PasswordInput\";\nimport { passwordValidator } from \"helpers/validation\";\nimport { FlowerHubLogo } from \"styles/Icons\";\nimport { ResetPasswordRequestDTO } from \"../api/user/user.dto\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface SignUpButton {\n loading: string;\n default: string;\n}\n\ninterface Props {\n header?: string;\n buttonText?: SignUpButton;\n installerTerms?: boolean;\n register: UseFormRegister<SignUpDTO | ResetPasswordRequestDTO>;\n errors: Partial<FieldErrorsImpl<SignUpDTO | ResetPasswordRequestDTO>>;\n onSubmit: () => void;\n isLoading: boolean;\n isError: boolean;\n isPasswordValid: boolean;\n}\n\nexport const SignUp = ({\n header = \"Choose a password to create your account\",\n buttonText = { loading: \"Creating account...\", default: \"Create account\" },\n installerTerms = false,\n register,\n errors,\n onSubmit,\n isLoading,\n isError,\n isPasswordValid,\n}: Props) => {\n const { t } = useTranslation();\n\n return (\n <>\n <div className=\"min-h-full flex flex-col justify-center py-12 px-6 md:px-8 gap-4\">\n <div className=\"sm:mx-auto sm:w-full sm:max-w-md\">\n <img\n className=\"mx-auto h-16 w-auto h-auto\"\n src={FlowerHubLogo}\n alt={t(`signUp.Your Company`)}\n />\n <h2 className=\"mt-6 text-center text-3xl font-extrabold text-flowerblue-700\">\n {t(`signUp.${header}`)}\n </h2>\n </div>\n\n <div className=\"mt-8 mx-2 sm:mx-auto sm:w-full sm:max-w-lg\">\n <div className=\"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10\">\n <form\n onSubmit={(e) => {\n e.preventDefault();\n onSubmit();\n }}\n >\n <PasswordInput\n register={register}\n name=\"password\"\n label={t(\"password.title\")}\n registerOptions={passwordValidator}\n errorMessage={errors.password?.message}\n />\n <div className=\"flex flex-col mt-3 mb-7\">\n <p className=\"text-sm text-gray-400 mb-1\">\n {t(\"password.Password requirements\")}\n </p>\n <div className=\"flex items-center\">\n {isPasswordValid ? (\n <>\n <CheckCircleIcon className=\"h-5 w-5 mr-1 text-flowerSky-500\" />\n <p className=\"text-sm text-gray-500\">\n {t(\"password.At least 10 characters\")}\n </p>\n </>\n ) : (\n <>\n <ExclamationCircleIcon className=\"h-5 w-5 mr-1 text-gray-400\" />\n <p className=\"text-sm text-gray-400\">\n {t(\"password.At least 10 characters\")}\n </p>\n </>\n )}\n </div>\n </div>\n\n <div>\n {installerTerms && (\n <div className=\"text-sm text-gray-600 font-medium mt-3 mb-2\">\n {t(\"signUp.By creating an account, you agree\")}{\" \"}\n <a\n href=\"https://flowerhub.se/anvandarvillkor\"\n className=\"text-sm font-medium text-flowerSky-600 hover:text-flowerSky-500\"\n >\n {t(\"signUp.The terms of use\")}\n </a>\n </div>\n )}\n\n <button\n type=\"button\"\n className=\"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-flowerSky-500 disabled:bg-gray-400 text-base font-medium text-white hover:bg-flowerSky-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-flowerSky-300 sm:col-start-2 sm:text-sm\"\n onClick={onSubmit}\n disabled={!isPasswordValid}\n >\n {isLoading && (\n <svg\n className=\"w-5 h-5 mr-3 -ml-1 text-white animate-spin\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n )}\n\n {isLoading\n ? t(`signUp.${buttonText.loading}`)\n : t(`signUp.${buttonText.default}`)}\n </button>\n </div>\n {isError && (\n <div className=\"mt-6\">\n <ErrorAlert\n text={t(`signUp.Your link is invalid or has expired`)}\n />\n </div>\n )}\n </form>\n </div>\n </div>\n </div>\n </>\n );\n};\n","import { useForm } from \"react-hook-form\";\nimport { useEffect } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { useDistributorSignUp } from \"api/distributorInvitation/distributorInvitation.endpoints\";\nimport { SignUp } from \"components/SignUp\";\nimport { SmoothUp } from \"components/animations/SnapUp\";\nimport { SignupByCodeRequestDTO } from \"../../api/shared/signUpByCode.dto\";\nimport { isPasswordStrongEnough } from \"helpers/validation\";\n\nfunction SignUpDistributorPage() {\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n const code = urlParams.get(\"code\") ?? \"\";\n const navigate = useNavigate();\n\n const {\n mutate: signUp,\n isPending: isLoading,\n isSuccess: isSignUpSuccess,\n isError,\n } = useDistributorSignUp();\n\n const {\n register,\n handleSubmit,\n formState: { errors },\n watch,\n } = useForm<SignupByCodeRequestDTO>();\n\n const password = watch(\"password\");\n\n const onSubmit = handleSubmit((data: SignupByCodeRequestDTO) => {\n signUp({ ...data, code });\n });\n\n useEffect(() => {\n if (isSignUpSuccess) {\n navigate(RouteUrl.App);\n }\n }, [isSignUpSuccess]);\n\n return (\n <SmoothUp>\n <SignUp\n register={register}\n onSubmit={onSubmit}\n isLoading={isLoading}\n errors={errors}\n isError={isError}\n isPasswordValid={isPasswordStrongEnough(password)}\n />\n </SmoothUp>\n );\n}\n\nexport default SignUpDistributorPage;\n","import React from \"react\";\nimport { classNames } from \"helpers/classNames\";\nimport { Switch } from \"@headlessui/react\";\n\ninterface Props {\n isLoading: boolean;\n isChecked: boolean;\n onToggle: (newState: boolean) => void;\n}\n\nexport const LoadingToggle: React.FC<Props> = ({\n isChecked,\n isLoading,\n onToggle,\n}) => {\n return (\n <label className=\"relative inline-flex items-center\">\n <>\n <Switch\n checked={isChecked}\n onChange={() => onToggle(!isChecked)}\n className={classNames(\n isChecked ? \"bg-flowerblue-600\" : \"bg-gray-200\",\n \"relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out\",\n )}\n >\n <span className=\"sr-only\">Use setting</span>\n <span\n aria-hidden=\"true\"\n className={classNames(\n isChecked ? \"translate-x-5\" : \"translate-x-0\",\n \"pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out\",\n )}\n >\n {isLoading && (\n <svg\n aria-hidden=\"true\"\n className={`w-5 h-5 text-flowerSky-200 animate-spin dark:text-flowerSky-600 fill-flowerSky-400 absolute`}\n viewBox=\"0 0 100 100\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z\"\n fill=\"currentFill\"\n />\n </svg>\n )}\n </span>\n </Switch>\n </>\n </label>\n );\n};\n","import { FC } from \"react\";\nimport { useUpdateInstallerCanInviteAssetOwners } from \"api/installer/installer.endpoints\";\nimport { LoadingToggle } from \"components/input/LoadingToggle\";\nimport { GetInstallerResponseDTO } from \"../../api/installer/installer.dto\";\n\ninterface Props {\n installer: GetInstallerResponseDTO;\n}\n\nexport const EditInstallerCanInviteAssetOwner: FC<Props> = ({ installer }) => {\n const {\n mutate: updateCanInviteAssetOwners,\n isPending: isUpdatingCanInviteAssetOwners,\n } = useUpdateInstallerCanInviteAssetOwners(installer.id);\n\n return (\n <LoadingToggle\n isLoading={isUpdatingCanInviteAssetOwners}\n onToggle={(newState) =>\n updateCanInviteAssetOwners({\n canInviteAssetOwners: newState,\n })\n }\n isChecked={installer.canInviteAssetOwners}\n />\n );\n};\n","import { UpdateInstallerRequestDTO } from \"api/installer/installer.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { PostalCodeInput } from \"components/input/PostalCodeInput\";\nimport { TextInput } from \"components/input/TextInput\";\nimport {\n emailValidator,\n giroNumberValidator,\n noEmptyStringValidator,\n organizationNumberValidator,\n} from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<UpdateInstallerRequestDTO>;\n errors: Partial<FieldErrorsImpl<UpdateInstallerRequestDTO>>;\n}\n\nexport const EditInstallerForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={`${t(`installer.Company name`)}*`}\n name=\"name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.name?.message}\n autoFocus\n />\n <TextInput\n label={`${t(`installer.Organization number`)}*`}\n name=\"organizationNumber\"\n register={register}\n registerOptions={organizationNumberValidator}\n hoverDetails={t(`installer.FormTooltip.OrganizationNumber`)}\n errorMessage={errors?.organizationNumber?.message}\n />\n <TextInput\n label={`${t(`installer.Address`)}*`}\n name=\"address.street\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n hoverDetails={t(`installer.FormTooltip.Address`)}\n errorMessage={errors?.address?.street?.message}\n />\n <PostalCodeInput\n label={`${t(`installer.Postal code`)}*`}\n name=\"address.postalCode\"\n register={register}\n errorMessage={errors?.address?.postalCode?.message}\n />\n <TextInput\n label={`${t(`installer.City`)}*`}\n name=\"address.city\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.address?.city?.message}\n />\n <TextInput\n label={`${t(`installer.BillingContactPerson`)}*`}\n name=\"invoiceContactPerson\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n hoverDetails={t(`installer.Tooltip.BillingContactPerson`)}\n errorMessage={errors?.invoiceContactPerson?.message}\n />\n <TextInput\n label={`${t(`installer.BillingContactEmail`)}*`}\n name=\"invoiceContactEmail\"\n register={register}\n registerOptions={emailValidator}\n hoverDetails={t(`installer.Tooltip.BillingContactEmail`)}\n errorMessage={errors?.invoiceContactEmail?.message}\n />\n <TextInput\n label={`${t(`installer.Bankgiro`)}*`}\n name=\"giroNumber\"\n register={register}\n registerOptions={giroNumberValidator}\n hoverDetails={t(`installer.FormTooltip.Bankgiro`)}\n errorMessage={errors?.giroNumber?.message}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport {\n GetInstallerResponseDTO,\n UpdateInstallerRequestDTO,\n} from \"api/installer/installer.dto\";\nimport { useUpdateInstaller } from \"api/installer/installer.endpoints\";\nimport { EditInstallerForm } from \"./EditInstallerForm\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport Modal from \"components/Modal\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n installer: GetInstallerResponseDTO;\n}\n\nexport const EditInstaller: FC<Props> = ({ installer }) => {\n const { t } = useTranslation();\n\n const [isEditInstallerModalOpen, setIsEditInstallerModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: updateInstaller,\n isPending: isUpdating,\n isSuccess,\n } = useUpdateInstaller(installer.id);\n\n // form\n const {\n register,\n handleSubmit,\n reset,\n formState: { errors },\n } = useForm<UpdateInstallerRequestDTO>();\n\n // submit\n const onSubmit = handleSubmit((data: UpdateInstallerRequestDTO) =>\n updateInstaller(data),\n );\n\n // modal close\n const onEditInstallerModalClose = () => {\n setTimeout(() => reset(), 300);\n setIsEditInstallerModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onEditInstallerModalClose();\n }\n }, [isSuccess]);\n\n // Populate or clear the form every time isEditAssetOwnerModalOpen is set\n useEffect(() => {\n if (isEditInstallerModalOpen) {\n reset(installer);\n }\n }, [isEditInstallerModalOpen]);\n\n const renderEditInstallerButton = () => {\n return (\n <div className=\"flex justify-end mb-4\">\n <SecondaryButton onClick={() => setIsEditInstallerModalOpen(true)}>\n <PencilSquareIcon className=\"h-5 w-5 mr-1\" />\n {t(`installer.Edit`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderEditInstallerButton()}\n\n <Modal\n isOpen={isEditInstallerModalOpen}\n rightButtonActionHandler={onSubmit}\n title={t(`installer.EditInstaller`)}\n rightButtonText={t(`Save`)}\n onClose={onEditInstallerModalClose}\n isLoading={isUpdating}\n >\n <EditInstallerForm register={register} errors={errors} />\n </Modal>\n </>\n );\n};\n","import { Item, Label, List, Value } from \"components/descriptionList\";\nimport { Shadow } from \"components/Shadow\";\nimport { FC } from \"react\";\nimport { Badge } from \"components/tags/Badge\";\nimport { useTranslation } from \"react-i18next\";\nimport { EditInstallerCanInviteAssetOwner } from \"./EditInstallerCanInviteAssetOwner\";\nimport { EditInstaller } from \"./EditInstaller\";\nimport { Role } from \"enums/role.enum\";\nimport { GetInstallerResponseDTO } from \"../../api/installer/installer.dto\";\nimport { Address } from \"../Address\";\nimport { isDistributor, isFlower } from \"../../helpers/role\";\nimport {\n formatGiroNumber,\n formatOrganizationNumber,\n formatVatNumber,\n} from \"../../helpers/installer\";\n\ninterface Props {\n installer: GetInstallerResponseDTO;\n userRole: Role;\n}\n\nexport const InstallerAccountDetails: FC<Props> = ({ installer, userRole }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"flex flex-col h-full overflow-auto\">\n <div>\n <Shadow>\n <List>\n {(isFlower(userRole) || isDistributor(userRole)) && (\n <Item>\n <Label>\n {t(\"installer.thisInstallerCanInviteAssetOwners\")}\n </Label>\n <Value>\n <div className=\"flex flex-row justify-between\">\n {installer.canInviteAssetOwners ? (\n <Badge\n text={t(\"installer.yes\")}\n color=\"green\"\n size=\"big\"\n />\n ) : (\n <Badge text={t(\"installer.no\")} color=\"red\" size=\"big\" />\n )}\n <EditInstallerCanInviteAssetOwner installer={installer} />\n </div>\n </Value>\n </Item>\n )}\n <Item>\n <Label>{t(\"installer.Company name\")}</Label>\n <Value>{installer.name}</Value>\n </Item>\n <Item>\n <Label>{t(\"installer.Organization number\")}</Label>\n <Value>\n {formatOrganizationNumber(installer.organizationNumber) ?? \"-\"}\n </Value>\n </Item>\n <Item>\n <Label>{t(`installer.BillingAddress`)}</Label>\n <Value>\n <Address address={installer.address} />\n </Value>\n </Item>\n <Item>\n <Label\n tooltipMessage={t(\"installer.Tooltip.BillingContactPerson\")}\n >\n {t(\"installer.BillingContactPerson\")}\n </Label>\n <Value>{installer.invoiceContactPerson ?? \"-\"}</Value>\n </Item>\n <Item>\n <Label\n tooltipMessage={t(\"installer.Tooltip.BillingContactEmail\")}\n >\n {t(\"installer.BillingContactEmail\")}\n </Label>\n <Value>{installer.invoiceContactEmail ?? \"-\"}</Value>\n </Item>\n <Item>\n <Label tooltipMessage={t(\"installer.Tooltip.Bankgiro\")}>\n {t(\"installer.Bankgiro\")}\n </Label>\n <Value>{formatGiroNumber(installer.giroNumber) ?? \"-\"}</Value>\n </Item>\n <Item>\n <Label tooltipMessage={t(\"installer.Tooltip.VatNumber\")}>\n {t(\"installer.VatNumber\")}\n </Label>\n <Value>\n {formatVatNumber(installer.organizationNumber) ?? \"-\"}\n </Value>\n </Item>\n </List>\n </Shadow>\n </div>\n\n {[Role.Flower, Role.InstallerAdmin].includes(userRole) && (\n <EditInstaller installer={installer} />\n )}\n </div>\n );\n};\n","import { useNotification } from \"hooks/useNotification\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport api from \"../axiosInstance\";\nimport { InstallerQueryKeys } from \"api/installer/installer.endpoints\";\nimport {\n CreateInstallerInvitationRequestDTO,\n CreateInstallerInvitationResponseDTO,\n UpdateInstallerInvitationRequestDTO,\n UpdateInstallerInvitationResponseDTO,\n} from \"./installerInvitation.dto\";\nimport { SignupByCodeRequestDTO } from \"../shared/signUpByCode.dto\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\n\nconst ENDPOINT = \"/installer-invitation\";\n\nexport const useInstallerSignUp = () => {\n return useMutation({\n mutationFn: async (payload: SignupByCodeRequestDTO): Promise<void> =>\n (await api.post(`${ENDPOINT}/sign-up-by-code`, payload)).data,\n });\n};\n\nexport const useInviteInstallerUser = (settings = {}) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreateInstallerInvitationRequestDTO,\n ): Promise<CreateInstallerInvitationResponseDTO> =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: (data) => {\n queryClient.invalidateQueries({ queryKey: [InstallerQueryKeys.GetOne] });\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetUsers, data.installerId],\n });\n notification.info(\"Invitation sent\");\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n ...settings,\n });\n};\n\nexport const useResendInvitation = (settings = {}) => {\n const notification = useNotification();\n\n return useMutation({\n mutationFn: async (oldInvitationId: number): Promise<void> =>\n (await api.post(`${ENDPOINT}/${oldInvitationId}`)).data,\n onError: () => {\n notification.error();\n },\n ...settings,\n });\n};\n\nexport const useUpdateInstallerInvitation = (invitationId: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: UpdateInstallerInvitationRequestDTO,\n ): Promise<UpdateInstallerInvitationResponseDTO> =>\n (await api.put(`${ENDPOINT}/${invitationId}`, payload)).data,\n onSuccess: (data) => {\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetUsers, data.installerId],\n });\n notification.info(`${data.name} updated`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useDeleteInstallerInvitation = (settings = {}) => {\n const notification = useNotification();\n return useMutation({\n mutationFn: async (id: number) => await api.delete(`${ENDPOINT}/${id}`),\n onError: () => {\n notification.error();\n },\n ...settings,\n });\n};\n","import Dropdown from \"components/input/Dropdown\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { Role } from \"enums/role.enum\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { CreateInstallerInvitationRequestDTO } from \"../../api/installerInvitation/installerInvitation.dto\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<CreateInstallerInvitationRequestDTO>;\n errors: Partial<FieldErrorsImpl<CreateInstallerInvitationRequestDTO>>;\n}\nexport const AddInstallerUserForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`installer.Name`)}\n name=\"name\"\n register={register}\n errorMessage={errors?.name?.message}\n registerOptions={noEmptyStringValidator()}\n />\n <TextInput\n label={t(`installer.Email`)}\n name=\"email\"\n type=\"email\"\n register={register}\n registerOptions={emailValidator}\n errorMessage={errors?.email?.message}\n />\n <Dropdown\n items={[\n { label: t(`installer.User`), value: Role.InstallerUser.toString() },\n {\n label: t(`installer.Admin`),\n value: Role.InstallerAdmin.toString(),\n },\n ]}\n name=\"role\"\n label={t(`installer.Account type`)}\n register={register}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm, UseFormRegister } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { UserPlusIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"../buttons/SecondaryButton\";\nimport { useTranslation } from \"react-i18next\";\nimport { CreateInstallerInvitationRequestDTO } from \"api/installerInvitation/installerInvitation.dto\";\nimport { useInviteInstallerUser } from \"api/installerInvitation/installerInvitation.endpoints\";\nimport { AddInstallerUserForm } from \"./AddInstallerUserForm\";\n\ninterface Props {\n installerId: number;\n}\n\nexport const AddInstallerUser: FC<Props> = ({ installerId }) => {\n const { t } = useTranslation();\n\n // state\n const [isInviteUserModalOpen, setIsInviteUserModalOpen] = useState(false);\n\n // api\n const {\n mutate: inviteUser,\n isPending: isInvitingUser,\n isSuccess: isInviteUserSuccess,\n } = useInviteInstallerUser();\n\n // form\n const {\n register: registerInvitation,\n handleSubmit: handleInvitationSubmit,\n reset: resetInvitation,\n formState: { errors: invitationErrors },\n setValue,\n } = useForm<CreateInstallerInvitationRequestDTO>({\n defaultValues: { installerId },\n });\n\n useEffect(() => {\n setValue(\"installerId\", installerId ?? -1);\n }, [installerId]);\n\n // submit\n const onInvitationSubmit = handleInvitationSubmit(\n (data: CreateInstallerInvitationRequestDTO) =>\n inviteUser({ ...data, role: Number(data.role) }),\n );\n\n // modal close\n const onInvitationModalClose = () => {\n setIsInviteUserModalOpen(false);\n setTimeout(() => resetInvitation(), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isInviteUserSuccess) {\n onInvitationModalClose();\n }\n }, [isInviteUserSuccess]);\n\n const renderAddInstallerButton = () => {\n return (\n <div className={`pb-2 flex justify-end`}>\n <SecondaryButton onClick={() => setIsInviteUserModalOpen(true)}>\n <UserPlusIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(`installer.Add installer user`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderAddInstallerButton()}\n\n <Modal\n isOpen={isInviteUserModalOpen}\n onClose={onInvitationModalClose}\n title={t(`installer.Add installer user`)}\n rightButtonText={t(`installer.Send`)}\n rightButtonActionHandler={onInvitationSubmit}\n isLoading={isInvitingUser}\n loadingText={t(`installer.Sending invitation`)}\n leftButtonAction={onInvitationModalClose}\n leftButtonText={t(`Close`)}\n >\n <AddInstallerUserForm\n register={\n registerInvitation as UseFormRegister<CreateInstallerInvitationRequestDTO>\n }\n errors={invitationErrors}\n />\n </Modal>\n </>\n );\n};\n","import { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DeleteInstallerConfirmation = () => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n {t(`installer.Are you sure that you want to delete this installer?`)}\n </p>\n </div>\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useDeleteInstallerInvitation } from \"api/installerInvitation/installerInvitation.endpoints\";\nimport { InstallerQueryKeys } from \"api/installer/installer.endpoints\";\nimport Modal from \"components/Modal\";\nimport { DeleteInstallerConfirmation } from \"./DeleteInstallerConfirmation\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { TrashIcon } from \"@heroicons/react/24/outline\";\nimport { useNotification } from \"hooks/useNotification\";\n\ninterface Props {\n installerId: number;\n invitationId: number;\n}\n\nexport const DeleteInstallerInvitation: FC<Props> = ({\n installerId,\n invitationId,\n}) => {\n const { t } = useTranslation();\n const queryClient = useQueryClient();\n const notification = useNotification();\n\n const [isDeleteInstallerModalOpen, setIsInstallerModalOpen] = useState(false);\n\n // api\n const { mutate: deleteInstaller, isSuccess } = useDeleteInstallerInvitation({\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetUsers, installerId],\n });\n notification.info(`Invitation deleted`);\n },\n });\n\n // submit\n const onDeleteInstaller = () => deleteInstaller(invitationId);\n\n // modal close\n const onDeleteInstallerModalClose = () => {\n setIsInstallerModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onDeleteInstallerModalClose();\n }\n }, [isSuccess]);\n\n return (\n <>\n <div className=\"w-4 h-5 justify-center flex\">\n <button onClick={() => setIsInstallerModalOpen(true)}>\n <TrashIcon\n className=\"h-5 w-5 text-flowerRed-800 hover:text-flowerRed-500\"\n aria-hidden=\"true\"\n />\n </button>\n </div>\n\n <Modal\n title={t(`installer.Delete invitation`)}\n leftButtonAction={onDeleteInstallerModalClose}\n leftButtonText={t(`Close`)}\n rightButtonActionHandler={() => onDeleteInstaller()}\n isOpen={isDeleteInstallerModalOpen}\n onClose={onDeleteInstallerModalClose}\n loadingText={t(`installer.Deleting invitation`)}\n >\n <DeleteInstallerConfirmation />\n </Modal>\n </>\n );\n};\n","import { FC, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { InstallerQueryKeys } from \"api/installer/installer.endpoints\";\nimport Modal from \"components/Modal\";\nimport { DeleteInstallerConfirmation } from \"./DeleteInstallerConfirmation\";\nimport DangerButton from \"components/buttons/DangerButton\";\nimport { useDeactivateUser } from \"api/user/user.endpoints\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\ninterface Props {\n installerId: number;\n userId: number;\n}\n\nexport const DeleteInstallerUser: FC<Props> = ({ installerId, userId }) => {\n const { t } = useTranslation();\n const queryClient = useQueryClient();\n\n const [isDeleteInstallerModalOpen, setIsInstallerModalOpen] = useState(false);\n\n // api\n const { mutate: deactivateUser } = useDeactivateUser({\n onSuccess: () =>\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetUsers, installerId],\n }),\n });\n // submit\n const onDeactivateUser = () => deactivateUser(userId);\n\n // modal close\n const onDeleteInstallerModalClose = () => {\n setIsInstallerModalOpen(false);\n };\n\n return (\n <>\n <DangerButton size=\"small\" onClick={() => setIsInstallerModalOpen(true)}>\n {t(`installer.Deactivate user`)}\n </DangerButton>\n\n <Modal\n title={t(`installer.Delete installer`)}\n leftButtonAction={onDeleteInstallerModalClose}\n leftButtonText={t(`Close`)}\n rightButtonActionHandler={() => onDeactivateUser()}\n isOpen={isDeleteInstallerModalOpen}\n onClose={onDeleteInstallerModalClose}\n loadingText={t(`installer.Deleting user`)}\n >\n <DeleteInstallerConfirmation />\n </Modal>\n </>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNotification } from \"hooks/useNotification\";\nimport { InstallerQueryKeys } from \"api/installer/installer.endpoints\";\nimport { useResendInvitation } from \"api/installerInvitation/installerInvitation.endpoints\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { ArrowPathIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n installerId: number;\n oldInvitationId: number;\n}\n\nexport const ResendInstallerInvitation: FC<Props> = ({\n installerId,\n oldInvitationId,\n}) => {\n const { t } = useTranslation();\n const queryClient = useQueryClient();\n const notification = useNotification();\n\n // api\n const { mutate: resendInvitation } = useResendInvitation({\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [InstallerQueryKeys.GetUsers, installerId],\n });\n notification.info(`Invitation resent`);\n },\n });\n\n // submit\n const onResendInvitation = (inviteId: number) => resendInvitation(inviteId);\n\n return (\n <SecondaryButton\n size=\"small\"\n onClick={() => onResendInvitation(oldInvitationId)}\n >\n <ArrowPathIcon className=\"h-5 w-5 mr-1\" />\n {t(`installer.ResendInvitation`)}{\" \"}\n </SecondaryButton>\n );\n};\n","import { UpdateInstallerInvitationRequestDTO } from \"api/installerInvitation/installerInvitation.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { Checkbox } from \"components/input/Checkbox\";\nimport Dropdown from \"components/input/Dropdown\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { Role } from \"enums/role.enum\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<UpdateInstallerInvitationRequestDTO>;\n errors: Partial<FieldErrorsImpl<UpdateInstallerInvitationRequestDTO>>;\n}\n\nexport const EditInstallerInvitationForm: FC<Props> = ({\n register,\n errors,\n}) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`installer.Name`)}\n name=\"name\"\n register={register}\n errorMessage={errors?.name?.message}\n registerOptions={noEmptyStringValidator()}\n />\n <TextInput\n label={t(`installer.Email`)}\n name=\"email\"\n type=\"email\"\n register={register}\n registerOptions={emailValidator}\n errorMessage={errors?.email?.message}\n />\n <Dropdown\n items={[\n { label: t(`installer.User`), value: Role.InstallerUser.toString() },\n {\n label: t(`installer.Admin`),\n value: Role.InstallerAdmin.toString(),\n },\n ]}\n name=\"role\"\n label={t(`installer.Account type`)}\n register={register}\n />\n <Checkbox\n register={register}\n item={{\n label: t(\"installer.Resend invitation\"),\n name: \"resendInvitation\",\n }}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport Modal from \"components/Modal\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n InstallerInvitationDTO,\n UpdateInstallerInvitationRequestDTO,\n} from \"api/installerInvitation/installerInvitation.dto\";\nimport { EditInstallerInvitationForm } from \"./EditInstallerInvitationForm\";\nimport { useUpdateInstallerInvitation } from \"api/installerInvitation/installerInvitation.endpoints\";\n\ninterface Props {\n installerInvitation: InstallerInvitationDTO;\n}\n\nexport const EditInstallerInvitation: FC<Props> = ({ installerInvitation }) => {\n const { t } = useTranslation();\n\n const [isEditInstallerModalOpen, setIsEditInstallerModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: updateInvitation,\n isPending: isUpdating,\n isSuccess,\n } = useUpdateInstallerInvitation(installerInvitation.id);\n\n // form\n const {\n register,\n handleSubmit,\n reset,\n formState: { errors },\n } = useForm<UpdateInstallerInvitationRequestDTO>({\n defaultValues: {\n resendInvitation: true,\n },\n });\n\n // submit\n const onSubmit = handleSubmit((data: UpdateInstallerInvitationRequestDTO) => {\n updateInvitation({\n ...data,\n role: Number(data.role),\n });\n });\n\n // modal close\n const onEditInstallerModalClose = () => {\n setTimeout(() => reset(), 300);\n setIsEditInstallerModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onEditInstallerModalClose();\n }\n }, [isSuccess]);\n\n // Populate or clear the form every time isEditInstallerModalOpen is set\n useEffect(() => {\n if (isEditInstallerModalOpen) {\n reset({ ...installerInvitation, resendInvitation: true });\n }\n }, [isEditInstallerModalOpen]);\n\n const renderEditInstallerButton = () => {\n return (\n <div className=\"py-5 flex justify-end\">\n <PencilSquareIcon\n className=\"h-5 w-5 ml-1 text-gray-700 hover:text-flowerPeach-900 cursor-pointer\"\n onClick={() => setIsEditInstallerModalOpen(true)}\n />\n </div>\n );\n };\n\n return (\n <>\n {renderEditInstallerButton()}\n\n <Modal\n isOpen={isEditInstallerModalOpen}\n rightButtonActionHandler={onSubmit}\n title={t(`installer.EditInstaller`)}\n rightButtonText={t(`Save`)}\n onClose={onEditInstallerModalClose}\n isLoading={isUpdating}\n >\n <EditInstallerInvitationForm register={register} errors={errors} />\n </Modal>\n </>\n );\n};\n","import { UpdateInstallerUserRequestDTO } from \"api/user/user.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport Dropdown from \"components/input/Dropdown\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { Role } from \"enums/role.enum\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<UpdateInstallerUserRequestDTO>;\n errors: Partial<FieldErrorsImpl<UpdateInstallerUserRequestDTO>>;\n}\n\nexport const EditInstallerUserForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`installer.Name`)}\n name=\"name\"\n register={register}\n errorMessage={errors?.name?.message}\n registerOptions={noEmptyStringValidator()}\n />\n <TextInput\n label={t(`installer.Email`)}\n name=\"email\"\n type=\"email\"\n register={register}\n registerOptions={emailValidator}\n errorMessage={errors?.email?.message}\n />\n <Dropdown\n items={[\n { label: t(`installer.User`), value: Role.InstallerUser.toString() },\n {\n label: t(`installer.Admin`),\n value: Role.InstallerAdmin.toString(),\n },\n ]}\n name=\"role\"\n label={t(`installer.Account type`)}\n register={register}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport Modal from \"components/Modal\";\nimport { useTranslation } from \"react-i18next\";\nimport { InstallerUserDTO } from \"api/installer/installer.dto\";\nimport { EditInstallerUserForm } from \"./EditInstallerUserForm\";\nimport { useUpdateInstallerUser } from \"api/user/user.endpoints\";\nimport { UpdateInstallerUserRequestDTO } from \"api/user/user.dto\";\n\ninterface Props {\n installerUser: InstallerUserDTO;\n}\n\nexport const EditInstallerUser: FC<Props> = ({ installerUser }) => {\n const { t } = useTranslation();\n\n const [isEditInstallerModalOpen, setIsEditInstallerModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: updateUser,\n isPending: isUpdating,\n isSuccess,\n } = useUpdateInstallerUser(installerUser.id);\n\n // form\n const {\n register,\n handleSubmit,\n reset,\n formState: { errors },\n } = useForm<UpdateInstallerUserRequestDTO>();\n\n // submit\n const onSubmit = handleSubmit((data: UpdateInstallerUserRequestDTO) => {\n updateUser({\n ...data,\n role: Number(data.role),\n });\n });\n\n // modal close\n const onEditInstallerModalClose = () => {\n setTimeout(() => reset(), 300);\n setIsEditInstallerModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onEditInstallerModalClose();\n }\n }, [isSuccess]);\n\n // Populate or clear the form every time isEditInstallerModalOpen is set\n useEffect(() => {\n if (isEditInstallerModalOpen) {\n reset(installerUser);\n }\n }, [isEditInstallerModalOpen]);\n\n const renderEditInstallerButton = () => {\n return (\n <div className=\"py-5 flex justify-end\">\n <PencilSquareIcon\n className=\"h-5 w-5 ml-1 text-gray-700 hover:text-flowerPeach-900 cursor-pointer\"\n onClick={() => setIsEditInstallerModalOpen(true)}\n />\n </div>\n );\n };\n\n return (\n <>\n {renderEditInstallerButton()}\n\n <Modal\n isOpen={isEditInstallerModalOpen}\n rightButtonActionHandler={onSubmit}\n title={t(`installer.EditInstaller`)}\n rightButtonText={t(`Save`)}\n onClose={onEditInstallerModalClose}\n isLoading={isUpdating}\n >\n <EditInstallerUserForm register={register} errors={errors} />\n </Modal>\n </>\n );\n};\n","import { FC } from \"react\";\nimport { Table, TBody, TD, TH, THead, TR } from \"components/table\";\nimport { UserIcon } from \"@heroicons/react/20/solid\";\nimport { useInstallerUsers } from \"api/installer/installer.endpoints\";\nimport { inviteHasExpired } from \"helpers/validation\";\nimport { useTranslation } from \"react-i18next\";\nimport { Badge, BadgeColor } from \"components/tags/Badge\";\nimport { AddInstallerUser } from \"components/installer/AddInstallerUser\";\nimport { DeleteInstallerInvitation } from \"./DeleteInstallerInvitation\";\nimport { DeleteInstallerUser } from \"./DeleteInstallerUser\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { ResendInstallerInvitation } from \"./ResendInstallerInvitation\";\nimport { Role } from \"enums/role.enum\";\nimport { InstallerUserDTO } from \"../../api/installer/installer.dto\";\nimport {\n getRoleName,\n isDistributor,\n isFlower,\n isInstaller,\n} from \"../../helpers/role\";\nimport { InstallerInvitationDTO } from \"../../api/installerInvitation/installerInvitation.dto\";\nimport { EditInstallerInvitation } from \"./EditInstallerInvitation\";\nimport { EditInstallerUser } from \"./EditInstallerUser\";\n\ninterface Props {\n installerId: number;\n userRole: Role;\n userId?: number;\n className?: string;\n}\n\nexport const InstallerUsersTab: FC<Props> = ({\n installerId,\n userRole,\n userId,\n className = \"\",\n}) => {\n const { t } = useTranslation();\n\n const {\n data: useInstallerUsersResponse,\n isLoading,\n isError,\n } = useInstallerUsers(installerId);\n\n if (\n isLoading ||\n isError ||\n !useInstallerUsersResponse?.users ||\n !useInstallerUsersResponse.invitations\n ) {\n return (\n <CustomPlaceholder\n isEmpty={\n !isLoading &&\n !isError &&\n !useInstallerUsersResponse?.users &&\n !useInstallerUsersResponse?.invitations\n }\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`installer.Error`)}\n emptyDataMessage={t(`installer.EmptyUser`)}\n loaderSize=\"page\"\n />\n );\n }\n\n const { users, invitations } = useInstallerUsersResponse;\n\n const badgeColor = (date: Date): BadgeColor => {\n return inviteHasExpired(date) ? \"yellow\" : \"blue\";\n };\n\n const badgeText = (date: Date): string => {\n return inviteHasExpired(date)\n ? t(`badgeAccountStatus.Invitation expired`)\n : t(`badgeAccountStatus.Invited`);\n };\n\n return (\n <div className={className}>\n <div className=\"mb-4\">\n <Table>\n <THead>\n <TR>\n <TH isFirstColumn>{t(`installer.Email`)}</TH>\n <TH>{t(`installer.Name`)}</TH>\n <TH>{t(`installer.Account type`)}</TH>\n <TH>{t(`installer.Status`)}</TH>\n <TH>\n <></>\n </TH>\n </TR>\n </THead>\n <TBody>\n {users.map(({ id, email, role, name }: InstallerUserDTO) => (\n <TR key={email}>\n <TD addLeftMargin>{email}</TD>\n <TD>{name}</TD>\n <TD>{getRoleName(role)}</TD>\n <TD>\n <Badge\n color=\"green\"\n text={t(`badgeAccountStatus.Account created`)}\n />\n </TD>\n <TD alignRight>\n {isFlower(userRole) && (\n <EditInstallerUser\n installerUser={{ id, name, email, role }}\n />\n )}\n {userId != id && isInstaller(userRole) && (\n <DeleteInstallerUser\n installerId={installerId}\n userId={id}\n />\n )}\n </TD>\n </TR>\n ))}\n {invitations.map(\n ({\n id,\n email,\n role,\n name,\n expiryDate,\n }: InstallerInvitationDTO) => (\n <TR key={id}>\n <TD addLeftMargin>{email}</TD>\n <TD>{name}</TD>\n <TD>{getRoleName(role)}</TD>\n <TD>\n <div className=\"flex\">\n <Badge\n color={badgeColor(expiryDate)}\n text={badgeText(expiryDate)}\n />\n </div>\n </TD>\n <TD>\n <div className=\"flex items-center justify-end gap-5 pr-3\">\n {(isFlower(userRole) ||\n isDistributor(userRole) ||\n isInstaller(userRole)) && (\n <ResendInstallerInvitation\n installerId={installerId}\n oldInvitationId={id}\n />\n )}\n {(isFlower(userRole) ||\n (isDistributor(userRole) &&\n !inviteHasExpired(expiryDate))) && (\n <EditInstallerInvitation\n installerInvitation={{\n id,\n email,\n role,\n name,\n expiryDate,\n }}\n />\n )}\n {(isFlower(userRole) ||\n isDistributor(userRole) ||\n isInstaller(userRole)) && (\n <DeleteInstallerInvitation\n installerId={installerId}\n invitationId={id}\n />\n )}\n </div>\n </TD>\n </TR>\n ),\n )}\n </TBody>\n </Table>\n </div>\n\n {isInstaller(userRole) && <AddInstallerUser installerId={installerId} />}\n </div>\n );\n};\n","import { ChevronRightIcon } from \"@heroicons/react/20/solid\";\nimport { Panel } from \"components/Panel\";\nimport { FC } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { AssetOwnerStatusTag } from \"components/tags/AssetOwnerStatusTag\";\n\nimport { useTranslation } from \"react-i18next\";\nimport { useLatestAssetOwnersForInstaller } from \"api/assetOwner/assetOwner.endpoints\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport { getAssetOwnerPageRoute } from \"../../helpers/assetOwner\";\nimport { GetLatestAssetOwnerForInstallerDTO } from \"../../api/assetOwner/assetOwner.dto\";\n\ninterface Props {\n installerId?: number;\n}\n\nexport const LatestAssetOwners: FC<Props> = ({ installerId }) => {\n const navigate = useNavigate();\n const { t } = useTranslation();\n const userRole = userStore(getUserRole);\n\n const {\n data: assetOwners,\n isLoading,\n isError,\n } = useLatestAssetOwnersForInstaller(installerId);\n\n const onAssetOwnerClick = (\n assetOwner: GetLatestAssetOwnerForInstallerDTO,\n ) => {\n navigate(\n getAssetOwnerPageRoute(\n userRole,\n assetOwner.id,\n assetOwner.installerId,\n assetOwner.distributorId,\n ),\n );\n };\n\n if (isLoading || isError || !assetOwners || assetOwners.length === 0)\n return null; // Mitigate placeholder views in dashboard\n\n return (\n <Panel header={t(\"dashboardStatistics.AssetOwners\")}>\n <ul\n role=\"list\"\n className=\"divide-y divide-gray-100 border-y border-y-gray-100\"\n >\n {assetOwners.map((assetOwner) => (\n <li key={assetOwner.id}>\n <div\n onClick={() => onAssetOwnerClick(assetOwner)}\n className=\"block hover:bg-gray-50 cursor-pointer\"\n >\n <div className=\"flex items-center py-4\">\n <div className=\"flex min-w-0 flex-1 items-center\">\n <div className=\"min-w-0 flex-1 px-4 md:grid md:grid-cols-5 md:gap-2\">\n <div className=\"col-span-3\">\n <p className=\"truncate text-sm font-medium text-flowerSky-500\">\n {`${assetOwner.firstName} ${assetOwner.lastName}`}\n </p>\n <p className=\"flex items-center text-sm text-gray-900 mt-2\">\n <AssetOwnerStatusTag\n status={assetOwner.accountStatus}\n />\n </p>\n </div>\n <div className=\"hidden md:block col-span-2\">\n <div>\n <p className=\" text-sm text-gray-600\">\n {assetOwner.address.street}\n </p>\n <p className=\"mt-2 flex items-center text-sm text-gray-600\">\n <span className=\"truncate\">\n {`${assetOwner.address.postalCode} ${assetOwner.address.city}`}\n </span>\n </p>\n </div>\n </div>\n </div>\n </div>\n <div>\n <ChevronRightIcon\n className=\"h-5 w-5 text-gray-400\"\n aria-hidden=\"true\"\n />\n </div>\n </div>\n </div>\n </li>\n ))}\n </ul>\n </Panel>\n );\n};\n","import { CreateAssetOwnerRequestDTO } from \"api/assetOwner/assetOwner.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { PostalCodeInput } from \"components/input/PostalCodeInput\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<CreateAssetOwnerRequestDTO>;\n errors: Partial<FieldErrorsImpl<CreateAssetOwnerRequestDTO>>;\n}\nexport const AddAssetOwnerForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`assetOwnerList.Email`)}\n name=\"mainEmail\"\n type=\"email\"\n register={register}\n registerOptions={emailValidator}\n errorMessage={errors?.mainEmail?.message}\n />\n <TextInput\n label={t(`assetOwnerList.First name`)}\n name=\"firstName\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.firstName?.message}\n />\n <TextInput\n label={t(`assetOwnerList.Last name`)}\n name=\"lastName\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.lastName?.message}\n />\n <TextInput\n label={t(`assetOwnerList.Address`)}\n name=\"address.street\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.address?.street?.message}\n />\n <PostalCodeInput\n label={t(`assetOwnerList.Postal code`)}\n name=\"address.postalCode\"\n register={register}\n errorMessage={errors.address?.postalCode?.message}\n />\n <TextInput\n label={t(`assetOwnerList.City`)}\n name=\"address.city\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors.address?.city?.message}\n />\n </ModalContentWrapper>\n );\n};\n","import { CreateAssetOwnerRequestDTO } from \"./assetOwner.dto\";\n\nexport const getEmptyCreateAssetOwnerDTO = (\n installerId?: number,\n): CreateAssetOwnerRequestDTO => ({\n installerId: installerId ?? -1,\n mainEmail: \"\",\n firstName: \"\",\n lastName: \"\",\n address: {\n street: \"\",\n postalCode: \"\",\n city: \"\",\n },\n});\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { useCreateAssetOwner } from \"api/assetOwner/assetOwner.endpoints\";\nimport { CreateAssetOwnerRequestDTO } from \"api/assetOwner/assetOwner.dto\";\nimport Modal from \"components/Modal\";\nimport { AddAssetOwnerForm } from \"./AddAssetOwnerForm\";\nimport { UserPlusIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"../buttons/SecondaryButton\";\nimport { getEmptyCreateAssetOwnerDTO } from \"api/assetOwner/assetOwner.helper\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n label: string;\n installerId: number;\n centered?: boolean;\n}\n\nexport const AddAssetOwner: FC<Props> = ({\n label,\n installerId,\n centered = false,\n}) => {\n const { t } = useTranslation();\n\n const [isAddAssetOwnerModalOpen, setIsAddAssetOwnerModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: createAssetOwner,\n isPending: isCreating,\n isSuccess,\n } = useCreateAssetOwner();\n\n // form\n const {\n register,\n handleSubmit,\n reset,\n formState: { errors },\n } = useForm<CreateAssetOwnerRequestDTO>({\n defaultValues: getEmptyCreateAssetOwnerDTO(installerId),\n });\n\n // submit\n const onSubmit = handleSubmit((data: CreateAssetOwnerRequestDTO) =>\n createAssetOwner(data),\n );\n\n // modal close\n const closeModal = () => {\n setTimeout(() => reset(), 300);\n setIsAddAssetOwnerModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n closeModal();\n }\n }, [isSuccess]);\n\n const renderAddAssetOwnerButton = () => {\n return (\n <div\n className={`pb-4 flex ${centered ? \"justify-center\" : \"justify-end\"}`}\n >\n <SecondaryButton onClick={() => setIsAddAssetOwnerModalOpen(true)}>\n <UserPlusIcon className=\"h-5 w-5 mr-1\" /> {label}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderAddAssetOwnerButton()}\n\n <Modal\n isOpen={isAddAssetOwnerModalOpen}\n onClose={closeModal}\n title={label}\n rightButtonActionHandler={onSubmit}\n isLoading={isCreating}\n loadingText={t(`assetOwnerAccountDetails.SendingInvitation`)}\n >\n <AddAssetOwnerForm register={register} errors={errors} />\n </Modal>\n </>\n );\n};\n","/* This example requires Tailwind CSS v2.0+ */\nimport { FC } from \"react\";\nimport { AddAssetOwner } from \"./AddAssetOwner\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n canInviteAssetOwners: boolean;\n installerId: number;\n}\n\nexport const AssetOwnersEmptyState: FC<Props> = ({\n canInviteAssetOwners,\n installerId,\n}) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"flex flex-col h-full items-center justify-center lg:justify-start lg:pt-8\">\n <div className=\"w-full h-12 flex flex-col justify-center items-center text-center text-gray-400 mb-4 px-2 sm:px:0\">\n <UserIcon />\n </div>\n <h3 className=\"mt-2 text-sm font-medium text-gray-900\">\n {t(`assetOwnerList.No asset owners`)}\n </h3>\n <p className=\"mt-1 text-sm text-gray-500\">\n {canInviteAssetOwners\n ? t(`assetOwnerList.Get started by creating your first Asset owner`)\n : t(\n `assetOwnerList.Contact your distributor to get permission to invite asset owners`,\n )}\n </p>\n\n {canInviteAssetOwners && (\n <div className=\"my-6\">\n <AddAssetOwner\n label={t(`assetOwnerList.Create asset owner`)}\n installerId={installerId}\n centered={true}\n />\n </div>\n )}\n </div>\n );\n};\n","export enum CompensationStatus {\n Qualified = \"Qualified\",\n Unqualified = \"Unqualified\",\n}\n\nexport enum CompensationStatusMessage {\n FlowerHubNotInstalled = \"FlowerHubNotInstalled\",\n Qualified = \"Qualified\",\n BothSitesNotActive = \"BothSitesNotActive\",\n ConsumptionSiteNotActive = \"ConsumptionSiteNotActive\",\n ProductionSiteNotActive = \"ProductionSiteNotActive\",\n NotAZavannCustomer = \"NotAZavannCustomer\",\n}\n","import { FC } from \"react\";\n\nimport { Badge, BadgeColor, BadgeSize } from \"./Badge\";\nimport {\n CompensationStatus,\n CompensationStatusMessage,\n} from \"enums/assetOwnerCompensationStatus.enum\";\nimport { Tooltip } from \"../tooltip/Tooltip\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n status: CompensationStatus;\n message: CompensationStatusMessage;\n size?: BadgeSize;\n}\n\nexport const CompensationEligibilityStatusTag: FC<Props> = ({\n status,\n message,\n size = \"small\",\n}) => {\n const { t } = useTranslation();\n const color = getColor(status);\n\n return (\n <div className=\"flex items-center\">\n <div className=\"absolute group flex flex-col items-center justify-center\">\n <Tooltip\n message={t([\n `compensationEligibilityStatus.${message}`,\n \"compensationEligibilityStatus.FallbackMessage\",\n ])}\n color={color}\n >\n <Badge color={color} text={status} size={size} />\n </Tooltip>\n </div>\n </div>\n );\n};\n\nconst getColor = (status: CompensationStatus): BadgeColor => {\n switch (status) {\n case CompensationStatus.Qualified:\n return \"green\";\n default:\n return \"gray\";\n }\n};\n","import { Dispatch, FC, SetStateAction, useMemo } from \"react\";\nimport { ColumnDef } from \"@tanstack/react-table\";\nimport { AssetOwnerItemDTO } from \"../../api/assetOwner/assetOwner.dto\";\nimport { AssetOwnerStatusTag } from \"../tags/AssetOwnerStatusTag\";\nimport { AssetOwnerStatus } from \"../../enums/assetOwnerStatus.enum\";\nimport { FlowerHubStatusTag } from \"../tags/FlowerHubStatusTag\";\nimport { CompensationEligibilityStatusTag } from \"../tags/CompensationEligibilityStatusTag\";\nimport {\n CompensationStatus,\n CompensationStatusMessage,\n} from \"../../enums/assetOwnerCompensationStatus.enum\";\nimport { Role } from \"../../enums/role.enum\";\nimport { Table } from \"../tableBeta/Table\";\nimport { isFlower } from \"../../helpers/role\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n InfiniteQueryResult,\n} from \"../../api/pagination/pagination.type\";\n\ninterface Props {\n paginationQuery: InfiniteQueryResult<AssetOwnerItemDTO>;\n setPaginationUrl: Dispatch<SetStateAction<string>>;\n onAssetOwnerClick: (\n assetOwnerId: number,\n installerId: number,\n distributorId: number | undefined,\n ) => void;\n userRole: Role;\n createColumnFilter: (filter: FilterDTO[]) => FilterWithLabelDTO[];\n}\n\nexport const AssetOwnerTable: FC<Props> = ({\n paginationQuery,\n setPaginationUrl,\n onAssetOwnerClick,\n userRole,\n createColumnFilter,\n}) => {\n const { t } = useTranslation();\n\n const handleRowClick = (row: AssetOwnerItemDTO) => {\n if (row) onAssetOwnerClick(row.id, row.installerId, row.distributorId);\n };\n\n // Table columns definition\n const columns: ColumnDef<AssetOwnerItemDTO>[] = useMemo(\n () => [\n {\n accessorKey: \"name\",\n header: `${t(\"assetOwnerList.columnHeader.name\")}`,\n accessorFn: (row: AssetOwnerItemDTO) =>\n `${row.firstName} ${row.lastName}`,\n },\n {\n accessorKey: \"accountStatus\",\n header: `${t(\"assetOwnerList.columnHeader.account\")}`,\n cell: (row) => (\n <AssetOwnerStatusTag status={row.getValue() as AssetOwnerStatus} />\n ),\n enableSorting: false,\n },\n {\n accessorKey: \"address\",\n header: `${t(\"assetOwnerList.columnHeader.address\")}`,\n cell: (row) => {\n if (!row.row.original?.address) {\n return null;\n }\n return (\n <div className=\"flex flex-col truncate leading-5\">\n <span className=\"truncate\">\n {row.row.original?.address.street}\n </span>\n <span className=\"truncate\">\n {row.row.original?.address.postalCode}{\" \"}\n {row.row.original?.address.city}\n </span>\n </div>\n );\n },\n },\n {\n accessorKey: \"assetModel\",\n header: `${t(\"assetOwnerList.columnHeader.assetModel\")}`,\n cell: (row) => {\n return (\n <div className=\"flex flex-col truncate leading-5\">\n <span className=\"truncate\">\n {row.row.original?.asset?.assetModel.manufacturer}\n </span>\n <span className=\"truncate\">\n {row.row.original?.asset?.assetModel.name}\n </span>\n </div>\n );\n },\n },\n {\n accessorKey: \"serialNumber\",\n header: `${t(\"assetOwnerList.columnHeader.serialNumber\")}`,\n accessorFn: (row: AssetOwnerItemDTO) => row?.asset?.serialNumber || \"\",\n },\n {\n accessorKey: \"flowerHub\",\n header: `${t(\"assetOwnerList.columnHeader.flowerHub\")}`,\n cell: (row) => {\n if (!row.row.original?.asset?.flowerHubStatus) {\n // if asset owner is not associate with an asset , cell will be empty\n return null;\n }\n return (\n <FlowerHubStatusTag\n flowerHubStatus={row.row.original?.asset?.flowerHubStatus}\n />\n );\n },\n enableSorting: false,\n },\n {\n accessorKey: \"compensation\",\n header: `${t(\"assetOwnerList.columnHeader.compensation\")}`,\n cell: (row) => {\n return (\n <CompensationEligibilityStatusTag\n status={\n row.row.original?.compensation?.status as CompensationStatus\n }\n message={\n row.row.original?.compensation\n ?.message as CompensationStatusMessage\n }\n />\n );\n },\n enableSorting: false,\n },\n ],\n [],\n );\n\n // Column visibility based on user role\n const columnVisibility = {\n assetModel: isFlower(userRole),\n address: !isFlower(userRole),\n };\n\n return (\n <Table\n columns={columns}\n paginationQuery={paginationQuery}\n onSelectRow={handleRowClick}\n columnVisibility={columnVisibility}\n setPaginationUrl={setPaginationUrl}\n title={`${t(\"assetOwnerList.AssetOwners\")}`}\n searchPlaceholder={`${t(\"assetOwnerList.SearchForAssetOwners\")}`}\n createColumnFilter={createColumnFilter}\n />\n );\n};\n","import React, { FC } from \"react\";\nimport { AssetOwnerItemDTO } from \"../../api/assetOwner/assetOwner.dto\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n InfiniteQueryResult,\n} from \"../../api/pagination/pagination.type\";\nimport { List } from \"../listBeta/List\";\nimport { useTranslation } from \"react-i18next\";\nimport { MapPinIcon, ServerIcon, UserIcon } from \"@heroicons/react/24/outline\";\nimport { getAssetOwnerName } from \"../../helpers/assetOwnerList\";\nimport { FlowerHubStatusTag } from \"../tags/FlowerHubStatusTag\";\nimport { ElementDef } from \"../listBeta/LI\";\n\ninterface Props {\n paginationQuery: InfiniteQueryResult<AssetOwnerItemDTO>;\n setPaginationUrl: React.Dispatch<React.SetStateAction<string>>;\n onAssetOwnerClick: (\n assetOwnerId: number,\n installerId: number,\n distributorId: number | undefined,\n ) => void;\n createColumnFilter: (filter: FilterDTO[]) => FilterWithLabelDTO[];\n}\n\nexport const AssetOwnerList: FC<Props> = ({\n paginationQuery,\n setPaginationUrl,\n onAssetOwnerClick,\n createColumnFilter,\n}) => {\n const { t } = useTranslation();\n\n const handleRowClick = (row: AssetOwnerItemDTO) => {\n if (row) onAssetOwnerClick(row.id, row.installerId, row.distributorId);\n };\n\n // As Table component has columns, elements should contain left and right elements that will be displayed in the list\n // I defined this function to make the List component more generic\n const elements: ElementDef<AssetOwnerItemDTO> = (\n element: AssetOwnerItemDTO,\n ) => {\n return {\n left: [\n {\n key: \"user\",\n cell: () => (\n <div className=\"flex items-center text-sm font-medium truncate text-gray-500\">\n <UserIcon\n className=\"h-5 w-5 mr-2 flex-shrink-0\"\n aria-hidden=\"true\"\n />\n <span className=\"w-full truncate\">\n {getAssetOwnerName(element)}\n </span>\n </div>\n ),\n },\n {\n key: \"address\",\n cell: () => (\n <div className=\"flex items-center text-sm font-medium truncate text-gray-500\">\n <MapPinIcon\n className=\"h-5 w-5 mr-2 flex-shrink-0\"\n aria-hidden=\"true\"\n />\n <div className=\"flex flex-col items-start w-full truncate text-sm\">\n <span className=\"w-full truncate\">\n {element.address.street}\n </span>\n <span className=\"w-full truncate\">\n {element.address.postalCode} {element.address.city}\n </span>\n </div>\n </div>\n ),\n },\n ],\n right: [\n {\n key: \"serialNumber\",\n cell: () => (\n <div className=\"flex items-center justify-end text-sm text-gray-500\">\n {element?.asset?.id\n ? element.asset?.serialNumber\n : \"Not installed\"}\n <ServerIcon\n className=\"h-5 w-5 ml-2 flex-shrink-0\"\n aria-hidden=\"true\"\n />\n </div>\n ),\n },\n {\n key: \"flowerHubStatus\",\n cell: () =>\n element?.asset?.flowerHubStatus ? (\n <FlowerHubStatusTag\n flowerHubStatus={element?.asset?.flowerHubStatus}\n />\n ) : undefined,\n },\n ],\n };\n };\n\n return (\n <List\n elements={elements}\n paginationQuery={paginationQuery}\n onSelectRow={handleRowClick}\n setPaginationUrl={setPaginationUrl}\n title={`${t(\"assetOwnerList.AssetOwners\")}`}\n searchPlaceholder={`${t(\"assetOwnerList.Search\")}`}\n createColumnFilter={createColumnFilter}\n />\n );\n};\n","import { useAssetOwnersPagination } from \"api/assetOwner/assetOwner.endpoints\";\nimport { FC, useState } from \"react\";\nimport { useInstaller } from \"api/installer/installer.endpoints\";\nimport { AssetOwnersEmptyState } from \"components/assetOwner/AssetOwnersEmptyState\";\nimport { AddAssetOwner } from \"./AddAssetOwner\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { Role } from \"enums/role.enum\";\nimport { useTranslation } from \"react-i18next\";\nimport { AssetOwnerTable } from \"./AssetOwnerTable\";\nimport { isInstaller } from \"../../helpers/role\";\nimport { AssetOwnerList } from \"./AssetOwnerList\";\nimport { useNavigate } from \"react-router-dom\";\nimport { InfiniteData, UseInfiniteQueryResult } from \"@tanstack/react-query\";\nimport { GetAllAssetOwnerResponseDTO } from \"../../api/assetOwner/assetOwner.dto\";\nimport { getAssetOwnerPageRoute } from \"../../helpers/assetOwner\";\nimport { isMobile } from \"react-device-detect\";\nimport { isEmptyArray } from \"../../helpers/array\";\nimport {\n FilterDTO,\n FilterWithLabelDTO,\n} from \"../../api/pagination/pagination.type\";\n\ninterface Props {\n userRole: Role;\n distributorId?: number;\n installerId?: number;\n}\n\nexport const AssetOwners: FC<Props> = ({\n userRole,\n distributorId,\n installerId,\n}) => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n\n // Pagination query string state is defined to store the query string in the parent component\n const [queryString, setQueryString] = useState<string>(\"\");\n\n // Infinite query to get asset owners with pagination\n const paginationQuery: UseInfiniteQueryResult<\n InfiniteData<GetAllAssetOwnerResponseDTO>\n > = useAssetOwnersPagination(queryString, {\n installerId,\n distributorId,\n });\n\n // Extract relevant information for this component from the pagination query\n const {\n data: assetOwners,\n isLoading: isLoadingAssetOwners,\n isError: isErrorAssetOwners,\n isRefetching: isRefetchingAssetOwners,\n } = paginationQuery;\n\n const flatAssetOwner = assetOwners?.pages.flatMap((page) => page.items);\n\n const onAssetOwnerClick = (\n assetOwnerId: number,\n installerId: number,\n distributorId: number | undefined,\n ) => {\n navigate(\n getAssetOwnerPageRoute(\n userRole,\n assetOwnerId,\n installerId,\n distributorId,\n ),\n );\n };\n\n // Get installer data\n const {\n data: installer,\n isLoading: isLoadingInstaller,\n isError: isErrorInstaller,\n } = useInstaller(installerId);\n\n // Convert the filter options to the enum values for the installer can invite filter\n const createColumnFilter = (filters: FilterDTO[]): FilterWithLabelDTO[] =>\n filters.map((filter) => {\n return {\n id: filter.id,\n options: filter.options.map((option) => {\n return {\n label: option,\n value: option,\n };\n }),\n };\n });\n\n const isLoading = isLoadingAssetOwners || isLoadingInstaller;\n const isError = isErrorAssetOwners || isErrorInstaller;\n\n if (isLoading || isError) {\n return (\n <div className=\"flex h-full items-center lg:items-start lg:pt-8\">\n <CustomPlaceholder\n isEmpty={false}\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`assetOwnerList.Error`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n if (\n isEmptyArray(flatAssetOwner) &&\n !isRefetchingAssetOwners &&\n queryString === \"\"\n ) {\n return isInstaller(userRole) && installer ? (\n <AssetOwnersEmptyState\n canInviteAssetOwners={installer.canInviteAssetOwners}\n installerId={installer.id}\n />\n ) : (\n <div className=\"flex h-full items-center lg:items-start lg:pt-8\">\n <CustomPlaceholder\n isEmpty={true}\n emptyDataMessage={t(`assetOwnerList.Empty`)}\n isLoading={false}\n isError={false}\n icon={<UserIcon />}\n />\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col h-full\">\n {isInstaller(userRole) && installer?.canInviteAssetOwners && (\n <AddAssetOwner\n label={t(`assetOwnerList.Add asset owner`)}\n installerId={installer.id}\n />\n )}\n {isMobile ? (\n <AssetOwnerList\n paginationQuery={paginationQuery}\n setPaginationUrl={setQueryString}\n onAssetOwnerClick={onAssetOwnerClick}\n createColumnFilter={createColumnFilter}\n />\n ) : (\n <AssetOwnerTable\n paginationQuery={paginationQuery}\n setPaginationUrl={setQueryString}\n onAssetOwnerClick={onAssetOwnerClick}\n userRole={userRole}\n createColumnFilter={createColumnFilter}\n />\n )}\n </div>\n );\n};\n","import { Tab, TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { useParams, useSearchParams } from \"react-router-dom\";\nimport { InstallerAccountDetails } from \"../../../components/installer/InstallerAccountDetails\";\nimport { InstallerUsersTab } from \"../../../components/installer/InstallerUsersTab\";\nimport { menuStore } from \"store/menu.store\";\nimport { useInstaller } from \"api/installer/installer.endpoints\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport { getBreadCrumbs } from \"../../../helpers/installer\";\n\nimport { DashboardStatistics } from \"../../../components/statistics/DashboardStatistics\";\nimport { LatestAssetOwners } from \"components/assetOwner/LatestAssetOwners\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { AssetOwners } from \"components/assetOwner/AssetOwners\";\nimport TabContainer from \"../../../components/tab/TabContainer\";\nimport { isFlower } from \"../../../helpers/role\";\nimport { useInstallerCompensation } from \"../../../api/compensation/compensation.endpoints\";\nimport { Compensation } from \"../../../components/compensation/Compensation\";\n\nconst DASHBOARD_TAB = \"dashboard\";\nconst ORGANIZATION_TAB = \"organization\";\nconst ASSET_OWNER_TAB = \"asset-owners\";\nconst USERS_TAB = \"users\";\nconst COMPENSATION_TAB = \"compensation\";\n\nexport default function InstallerPage() {\n const { t } = useTranslation();\n\n const params = useParams();\n const installerId: string = params?.installerId || \"-1\";\n const userRole = userStore(getUserRole);\n\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n\n const currentTab = searchParams.get(\"tab\") || DASHBOARD_TAB;\n\n // Get installer\n const {\n data: installer,\n isLoading: isLoadingInstaller,\n isError: isErrorInstaller,\n } = useInstaller(+installerId);\n\n // Get installer compensation\n const {\n data: installerCompensation,\n isLoading: isLoadingInstallerCompensation,\n } = useInstallerCompensation(+installerId);\n\n const isLoading = isLoadingInstaller || isLoadingInstallerCompensation;\n const isError = isErrorInstaller;\n const isEmpty = !installer;\n\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n if (installer) {\n setBreadCrumbs(getBreadCrumbs(userRole, installer));\n }\n }, [installer]);\n\n if (isLoading || isError || isEmpty) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isEmpty={!installer && !installerCompensation}\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`installer.Error`)}\n emptyDataMessage={t(`installer.Empty`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n const tabs: Tab[] = [\n {\n param: DASHBOARD_TAB,\n label: t(\"installer.DashboardTitle\"),\n content: (\n <TabContainer key={DASHBOARD_TAB}>\n <div className=\"overflow-auto\">\n <DashboardStatistics installerId={installer.id} />\n <LatestAssetOwners installerId={installer.id} />\n </div>\n </TabContainer>\n ),\n isSelected: currentTab === DASHBOARD_TAB,\n },\n {\n param: ORGANIZATION_TAB,\n label: t(\"installer.OrganizationTitle\"),\n content: (\n <TabContainer key={ORGANIZATION_TAB}>\n <InstallerAccountDetails installer={installer} userRole={userRole} />\n </TabContainer>\n ),\n isSelected: currentTab === ORGANIZATION_TAB,\n },\n {\n param: ASSET_OWNER_TAB,\n label: t(\"installer.AssetOwnersTitle\"),\n content: (\n <TabContainer key={ASSET_OWNER_TAB}>\n <div className=\"flex flex-col h-full pb-4 md:pb-8\">\n <AssetOwners\n userRole={userRole}\n distributorId={installer.distributor.id}\n installerId={installer.id}\n />\n </div>\n </TabContainer>\n ),\n isSelected: currentTab === ASSET_OWNER_TAB,\n },\n {\n param: USERS_TAB,\n label: t(\"installer.UsersTitle\"),\n content: (\n <TabContainer key={USERS_TAB}>\n <InstallerUsersTab\n installerId={installer.id}\n userRole={userRole}\n className={\"flex flex-col overflow-x-hidden overflow-auto\"}\n />\n </TabContainer>\n ),\n isSelected: currentTab === USERS_TAB,\n },\n ];\n\n if (isFlower(userRole)) {\n const flowerUserTab = [\n {\n param: COMPENSATION_TAB,\n label: t(`compensation.Compensation`),\n content: (\n <TabContainer key={COMPENSATION_TAB}>\n <Compensation compensation={installerCompensation} />\n </TabContainer>\n ),\n isSelected: currentTab === COMPENSATION_TAB,\n },\n ];\n\n tabs.push(...flowerUserTab);\n }\n\n return <TabPageWrapper tabs={tabs} setTab={setTab} />;\n}\n","import { useEffect } from \"react\";\nimport { menuStore } from \"store/menu.store\";\nimport userStore, { getUserRole } from \"store/user.store\";\n\nimport { getAssetOwnerListBreadcrumb } from \"helpers/assetOwnerList\";\nimport { AssetOwners } from \"../../../components/assetOwner/AssetOwners\";\nimport { SmoothUp } from \"../../../components/animations/SnapUp\";\n\nexport const AssetOwnerListPage = () => {\n const { user } = userStore();\n const userRole = userStore(getUserRole);\n\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n setBreadCrumbs([getAssetOwnerListBreadcrumb()]);\n }, []);\n\n return (\n <SmoothUp>\n <AssetOwners\n userRole={userRole}\n distributorId={user?.distributorId}\n installerId={user?.installerId}\n />\n </SmoothUp>\n );\n};\n","import { FC } from \"react\";\nimport { FlowerHubLogo } from \"styles/Icons\";\n\ninterface Props {\n children: React.ReactNode;\n isLoading?: boolean;\n headerText: string;\n buttonText: string;\n buttonTextLoading?: string;\n onActionClick: () => void;\n hideAction?: boolean;\n}\n\nexport const AuthFlowWrapper: FC<Props> = ({\n children,\n isLoading = false,\n headerText,\n buttonText,\n buttonTextLoading,\n onActionClick,\n hideAction = false,\n}) => (\n <>\n <div className=\"min-h-full flex flex-col justify-center justify-center py-12 px-6 md:px-8 gap-4\">\n <div className=\"sm:mx-auto sm:w-full sm:max-w-md\">\n <img className=\"h-16 w-auto h-auto mx-auto\" src={FlowerHubLogo} />\n <h2 className=\"mt-6 text-center text-3xl font-extrabold text-gray-900\">\n {headerText}\n </h2>\n </div>\n\n <div className=\"mt-8 sm:mx-auto sm:w-full sm:max-w-md\">\n <div className=\"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10\">\n <div className=\"space-y-6\">\n <>{children}</>\n\n {!hideAction && (\n <div>\n <button\n type=\"button\"\n className=\"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-flowerSky-500 disabled:bg-gray-400 text-base font-medium text-white hover:bg-flowerSky-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-flowerSky-300 sm:col-start-2 sm:text-sm\"\n onClick={onActionClick}\n >\n {isLoading && (\n <svg\n className=\"w-5 h-5 mr-3 -ml-1 text-white animate-spin\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n )}\n\n {isLoading && !!buttonTextLoading\n ? buttonTextLoading\n : buttonText}\n </button>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </>\n);\n","import { useForm } from \"react-hook-form\";\nimport { useForgotPassword } from \"api/user/user.endpoints\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { AuthFlowWrapper } from \"components/AuthFlowWrapper\";\nimport { CheckCircleIcon } from \"@heroicons/react/24/solid\";\nimport { Transition } from \"components/animations/Transition\";\nimport { config } from \"react-spring\";\nimport { SmoothUp } from \"components/animations/SnapUp\";\nimport { emailValidator } from \"helpers/validation\";\nimport { ForgotPasswordRequestDTO } from \"../../api/user/user.dto\";\nimport { useTranslation } from \"react-i18next\";\n\nfunction ForgotPasswordPage() {\n const { t } = useTranslation();\n\n const {\n mutate: resetPassword,\n isPending: isLoading,\n isSuccess,\n } = useForgotPassword();\n\n const {\n register,\n handleSubmit,\n formState: { errors },\n } = useForm<ForgotPasswordRequestDTO>();\n\n const onSubmit = handleSubmit((data: ForgotPasswordRequestDTO) => {\n resetPassword(data);\n });\n\n return (\n <SmoothUp>\n <AuthFlowWrapper\n headerText={t(\"password.Reset your password\")}\n onActionClick={onSubmit}\n isLoading={isLoading}\n buttonText={t(\"password.Submit\")}\n buttonTextLoading={t(\"password.Submitting\")}\n hideAction={isSuccess}\n >\n {isSuccess ? (\n <>\n <Transition\n settings={{\n from: {\n transform: \"scale(0)\",\n },\n enter: {\n transform: \"scale(1)\",\n },\n delay: 100,\n config: { ...config.wobbly },\n }}\n isVisible={true}\n >\n <CheckCircleIcon className=\"mx-auto h-10 w-auto text-flowerSky-400 mb-2\" />\n </Transition>\n <p className=\"text-gray-700 text-center\">\n {t(\n \"password.Check your inbox to complete the password reset process\",\n )}\n </p>\n </>\n ) : (\n <>\n <p className=\"text-gray-400 text-sm text-center\">\n {t(\n \"password.We will send a link to your email address with information on how to reset your password\",\n )}\n </p>\n <TextInput\n register={register}\n name=\"email\"\n label={t(\"password.Email\")}\n type=\"email\"\n registerOptions={emailValidator}\n errorMessage={errors.email?.message}\n autoFocus\n />\n </>\n )}\n </AuthFlowWrapper>\n </SmoothUp>\n );\n}\n\nexport default ForgotPasswordPage;\n","import { useForm } from \"react-hook-form\";\nimport { useEffect } from \"react\";\nimport { useResetPassword } from \"api/user/user.endpoints\";\nimport { CheckCircleIcon } from \"@heroicons/react/24/solid\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { SignUp } from \"components/SignUp\";\nimport { AuthFlowWrapper } from \"components/AuthFlowWrapper\";\nimport { Transition } from \"components/animations/Transition\";\nimport { config } from \"react-spring\";\nimport { SmoothUp } from \"components/animations/SnapUp\";\nimport { useTranslation } from \"react-i18next\";\nimport { isPasswordStrongEnough } from \"../../helpers/validation\";\nimport { ResetPasswordRequestDTO } from \"../../api/user/user.dto\";\n\nfunction ResetPasswordPage() {\n const { t } = useTranslation();\n\n const navigate = useNavigate();\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n const code = urlParams.get(\"code\") ?? \"\";\n\n const {\n mutate: resetPassword,\n isPending: isLoading,\n isSuccess,\n isError,\n } = useResetPassword();\n\n const {\n register,\n handleSubmit,\n formState: { errors },\n watch,\n } = useForm<ResetPasswordRequestDTO>();\n const password = watch(\"password\");\n\n const onSubmit = handleSubmit((data: ResetPasswordRequestDTO) => {\n resetPassword({ ...data, code });\n });\n\n useEffect(() => {\n if (isSuccess) {\n navigate(`${RouteUrl.Login}`);\n }\n }, [isSuccess, navigate]);\n\n return (\n <SmoothUp>\n {isSuccess ? (\n <AuthFlowWrapper\n headerText={t(\"password.Restore your account\")}\n onActionClick={onSubmit}\n isLoading={isLoading}\n buttonText={t(\"password.Submit\")}\n buttonTextLoading={t(\"password.Submitting\")}\n hideAction={isSuccess || true}\n >\n <Transition\n settings={{\n from: {\n transform: \"scale(0)\",\n },\n enter: {\n transform: \"scale(1)\",\n },\n delay: 100,\n config: { ...config.wobbly },\n }}\n isVisible={true}\n >\n <CheckCircleIcon className=\"mx-auto h-10 w-auto text-flowerSky-400 mb-2\" />\n </Transition>\n <p className=\"text-gray-700 text-center\">\n {t(\"password.Password reset\")}\n </p>\n <div className=\"flex items-center justify-center\">\n <Link\n to={RouteUrl.Login}\n className=\"font-medium text-flowerSky-600 hover:text-flowerSky-500\"\n >\n {t(\"password.To login page\")}\n </Link>\n </div>\n </AuthFlowWrapper>\n ) : (\n <SignUp\n header=\"Create a new password\"\n buttonText={{\n loading: \"Resetting password\",\n default: \"Reset password\",\n }}\n register={register}\n errors={errors}\n onSubmit={onSubmit}\n isLoading={isLoading}\n isError={isError}\n isPasswordValid={isPasswordStrongEnough(password)}\n />\n )}\n </SmoothUp>\n );\n}\n\nexport default ResetPasswordPage;\n","import { useForm } from \"react-hook-form\";\nimport { useEffect } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { useInstallerSignUp } from \"api/installerInvitation/installerInvitation.endpoints\";\nimport { SignUp } from \"components/SignUp\";\nimport { SmoothUp } from \"components/animations/SnapUp\";\nimport { SignupByCodeRequestDTO } from \"../../api/shared/signUpByCode.dto\";\nimport { isPasswordStrongEnough } from \"../../helpers/validation\";\n\nfunction SignUpInstallerPage() {\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n const code = urlParams.get(\"code\") ?? \"\";\n const navigate = useNavigate();\n\n const {\n mutate: signUp,\n isPending: isLoading,\n isSuccess: isSignUpSuccess,\n isError,\n } = useInstallerSignUp();\n\n const {\n register,\n handleSubmit,\n formState: { errors },\n watch,\n } = useForm<SignupByCodeRequestDTO>();\n\n const password = watch(\"password\");\n\n const onSubmit = handleSubmit((data: SignupByCodeRequestDTO) => {\n signUp({ ...data, code });\n });\n\n useEffect(() => {\n if (isSignUpSuccess) {\n navigate(RouteUrl.App);\n }\n }, [isSignUpSuccess]);\n\n return (\n <SmoothUp>\n <SignUp\n register={register}\n onSubmit={onSubmit}\n isLoading={isLoading}\n errors={errors}\n isError={isError}\n isPasswordValid={isPasswordStrongEnough(password)}\n installerTerms\n />\n </SmoothUp>\n );\n}\n\nexport default SignUpInstallerPage;\n","import { CheckIcon } from \"@heroicons/react/20/solid\";\nimport { classNames } from \"helpers/classNames\";\nimport { FC } from \"react\";\n\ntype Props = {\n steps: Step[];\n isModal?: boolean;\n smallPadding?: boolean;\n};\n\nexport const Steps: FC<Props> = ({\n steps = [],\n isModal = false,\n smallPadding = false,\n}) => {\n return (\n <nav aria-label=\"Progress\">\n <ol\n role=\"list\"\n className={classNames(\n \"flex items-center justify-center\",\n isModal && \"bg-flowerSky-100 p-8\",\n )}\n >\n {steps.map((step, stepIndex) => (\n <li\n key={step.label}\n className={classNames(\n stepIndex !== steps.length - 1\n ? isModal\n ? \"pr-24\"\n : smallPadding\n ? \"pr-6 sm:pr-12 md:14\"\n : \"pr-10 sm:pr-12 md:14\"\n : \"\",\n \"relative\",\n )}\n >\n {step.status === StepStatus.Complete ? (\n <>\n <div\n className=\"absolute inset-0 flex items-center\"\n aria-hidden=\"true\"\n >\n <div className=\"h-0.5 w-full bg-flowerSky-500\" />\n </div>\n <button\n onClick={() => !!step.onClick && step.onClick()}\n type=\"button\"\n className=\"relative flex h-8 w-8 items-center justify-center rounded-full bg-flowerSky-500 hover:bg-flowerSky-800\"\n >\n <CheckIcon\n className=\"h-5 w-5 text-flowerSky-100\"\n aria-hidden=\"true\"\n />\n <span className=\"sr-only\">{step.label}</span>\n </button>\n </>\n ) : step.status === StepStatus.Current ? (\n <>\n <div\n className=\"absolute inset-0 flex items-center\"\n aria-hidden=\"true\"\n >\n <div className=\"h-0.5 w-full bg-flowerSky-200\" />\n </div>\n <a\n href=\"#\"\n className=\"relative flex h-8 w-8 items-center justify-center rounded-full border-2 border-flowerSky-600 bg-flowerSky-100\"\n aria-current=\"step\"\n >\n <span\n className=\"h-2.5 w-2.5 rounded-full bg-flowerSky-600\"\n aria-hidden=\"true\"\n />\n <span className=\"sr-only\">{step.label}</span>\n </a>\n </>\n ) : (\n <>\n <div\n className=\"absolute inset-0 flex items-center\"\n aria-hidden=\"true\"\n >\n <div className=\"h-0.5 w-full bg-flowerSky-200\" />\n </div>\n <a\n href=\"#\"\n className=\"group relative flex h-8 w-8 items-center justify-center rounded-full border-2 border-flowerSky-300 bg-flowerSky-100 hover:border-flowerSky-400\"\n >\n <span\n className=\"h-2.5 w-2.5 rounded-full bg-transparent group-hover:bg-gray-300\"\n aria-hidden=\"true\"\n />\n <span className=\"sr-only\">{step.label}</span>\n </a>\n </>\n )}\n </li>\n ))}\n </ol>\n </nav>\n );\n};\n\nexport const StepsDesktop: FC<Props> = ({ steps = [] }) => {\n return (\n <nav aria-label=\"Progress\" className=\"mt-8 mr-16\">\n <ol role=\"list\" className=\"overflow-hidden\">\n {steps.map((step, stepIdx) => (\n <li\n key={step.label}\n className={classNames(\n stepIdx !== steps.length - 1 ? \"pb-10\" : \"\",\n \"relative\",\n )}\n >\n {step.status === StepStatus.Complete ? (\n <>\n {stepIdx !== steps.length - 1 ? (\n <div\n className=\"absolute top-4 left-4 -ml-px mt-0.5 h-full w-0.5 bg-flowerSky-500\"\n aria-hidden=\"true\"\n />\n ) : null}\n <a className=\"group relative flex items-start\">\n <span className=\"flex h-9 items-center\">\n <span className=\"relative z-10 flex h-8 w-8 items-center justify-center rounded-full bg-flowerSky-500 group-hover:bg-flowerSky-700\">\n <CheckIcon\n className=\"h-5 w-5 text-white\"\n aria-hidden=\"true\"\n />\n </span>\n </span>\n <span className=\"ml-4 flex min-w-0 flex-col\">\n <span\n className=\"text-sm text-gray-700\"\n style={{ transform: \"translateY(8px)\" }}\n >\n {step.label}\n </span>\n </span>\n </a>\n </>\n ) : step.status === StepStatus.Current ? (\n <>\n {stepIdx !== steps.length - 1 ? (\n <div\n className=\"absolute top-4 left-4 -ml-px mt-0.5 h-full w-0.5 bg-gray-300\"\n aria-hidden=\"true\"\n />\n ) : null}\n <a\n className=\"group relative flex items-start\"\n aria-current=\"step\"\n >\n <span className=\"flex h-9 items-center\" aria-hidden=\"true\">\n <span className=\"relative z-10 flex h-8 w-8 items-center justify-center rounded-full border-2 border-flowerSky-500 bg-white\">\n <span className=\"h-2.5 w-2.5 rounded-full bg-flowerSky-500\" />\n </span>\n </span>\n <span className=\"ml-4 flex min-w-0 flex-col\">\n <span\n className=\"text-sm font-medium text-flowerSky-500\"\n style={{ transform: \"translateY(8px)\" }}\n >\n {step.label}\n </span>\n </span>\n </a>\n </>\n ) : (\n <>\n {stepIdx !== steps.length - 1 ? (\n <div\n className=\"absolute top-4 left-4 -ml-px mt-0.5 h-full w-0.5 bg-gray-300\"\n aria-hidden=\"true\"\n />\n ) : null}\n <a className=\"group relative flex items-start\">\n <span className=\"flex h-9 items-center\" aria-hidden=\"true\">\n <span className=\"relative z-10 flex h-8 w-8 items-center justify-center rounded-full border-2 border-gray-300 bg-white group-hover:border-gray-400\">\n <span className=\"h-2.5 w-2.5 rounded-full bg-transparent group-hover:bg-gray-300\" />\n </span>\n </span>\n <span className=\"ml-4 flex min-w-0 flex-col\">\n <span\n className=\"text-sm font-medium text-gray-500\"\n style={{ transform: \"translateY(8px)\" }}\n >\n {step.label}\n </span>\n </span>\n </a>\n </>\n )}\n </li>\n ))}\n </ol>\n </nav>\n );\n};\n\nexport type Step = {\n label: string;\n status: StepStatus;\n onClick?: () => void;\n};\n\nexport enum StepStatus {\n Current,\n Complete,\n Upcoming,\n}\n","import { FC } from \"react\";\n\ntype ContainerProps = {\n children: React.ReactNode;\n};\nexport const Container: FC<ContainerProps> = ({ children }) => (\n <div className=\"mx-auto max-w-7xl bg-white\">{children}</div>\n);\n","import { FC } from \"react\";\n\ntype Props = {\n onClick: () => void;\n text: string;\n style: \"primary\" | \"secondary\";\n};\n\nexport const SimpleButton: FC<Props> = ({ onClick, text, style }) => {\n const colors =\n style === \"primary\"\n ? \"border border-transparent bg-flowerSky-600 hover:bg-flowerSky-700 focus:ring-flowerSky-600 text-white\"\n : \"border border-gray-300 bg-white hover:bg-gray-50 focus:ring-flowerblue-600 text-gray-700\";\n const classNames =\n colors +\n \" w-full inline-flex justify-center rounded-md shadow-sm px-4 py-2 text-base font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 sm:col-start-2 sm:text-sm mt-8\";\n return (\n <button type={\"button\"} className={classNames} onClick={onClick}>\n {text}\n </button>\n );\n};\n","import { FC } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { SimpleButton } from \"components/buttons/SimpleButton\";\nimport { PostalCodeInput } from \"components/input/PostalCodeInput\";\nimport { emailValidator } from \"helpers/validation\";\nimport {\n AssetOwnerDetailsDTO,\n GetAssetOwnerInvitationResponseDTO,\n} from \"../../../api/assetOwnerInvitation/assetOwnerInvitation.dto\";\n\ntype Props = {\n invitation: GetAssetOwnerInvitationResponseDTO;\n assetOwnerDetails: AssetOwnerDetailsDTO;\n onBackButtonPressed: () => void;\n onUserDetailsFormCompleted: (assetOwnerDetails: AssetOwnerDetailsDTO) => void;\n};\n\nexport const UserDetailsForm: FC<Props> = ({\n invitation,\n assetOwnerDetails,\n onBackButtonPressed,\n onUserDetailsFormCompleted,\n}) => {\n const {\n register,\n handleSubmit,\n formState: { errors },\n watch,\n } = useForm<AssetOwnerDetailsDTO>({\n defaultValues: assetOwnerDetails,\n mode: \"onSubmit\",\n reValidateMode: \"onChange\",\n });\n\n const onSubmit = handleSubmit((data: AssetOwnerDetailsDTO) => {\n onUserDetailsFormCompleted(data);\n });\n\n const postalCodeUpdated = watch(\"postalCode\");\n\n const isPostalCodeUpdated =\n postalCodeUpdated !== invitation.address.postalCode &&\n postalCodeUpdated.length === 5;\n\n return (\n <div className=\"sm:grid sm:grid-cols-6 sm:items-start sm:gap-2\">\n <div className=\"sm:mt-0 sm:col-span-3\">\n <TextInput\n name={\"firstName\"}\n register={register}\n errorMessage={errors?.firstName?.message}\n registerOptions={{ required: \"Fyll i ditt tilltalsnamn\" }}\n label={\"Tilltalsnamn\"}\n />\n </div>\n <div className=\"sm:mt-0 sm:col-span-3\">\n <TextInput\n name={\"lastName\"}\n register={register}\n errorMessage={errors?.lastName?.message}\n registerOptions={{ required: \"Fyll i ditt efternamn\" }}\n label={\"Efternamn\"}\n />\n </div>\n <div className=\"sm:col-span-6 mt-2\">\n <TextInput\n name={\"address\"}\n register={register}\n errorMessage={errors?.address?.message}\n registerOptions={{ required: \"Fyll i din adress\" }}\n hoverDetails={\n \"Denna adress mÃ¥ste vara samma som elavtalet gäller för.\"\n }\n label={\"Adress\"}\n />\n </div>\n <div className=\"sm:col-span-2 mt-2\">\n <PostalCodeInput\n label=\"Postnummer\"\n name=\"postalCode\"\n register={register}\n errorMessage={errors?.postalCode?.message}\n />\n </div>\n <div className=\"sm:col-span-4 mt-2\">\n <TextInput\n name={\"city\"}\n register={register}\n errorMessage={errors?.city?.message}\n registerOptions={{ required: \"Fyll i vilken stad du bor\" }}\n label={\"Stad\"}\n />\n </div>\n {isPostalCodeUpdated && (\n <div className={\"sm:col-span-6 mt-2 p-3 bg-gray-50 rounded-lg shadow\"}>\n <p className=\"flex text-sm text-flowerblue-600\">\n Adressen stämmer inte med den som installatören angett. Adressen du\n anger ska vara den där batteriet är installerat. Var god dubbelkolla\n att det är sÃ¥ innan du gÃ¥r vidare till nästa steg.\n </p>\n </div>\n )}\n <div className=\"sm:col-span-6 mt-2\">\n <div className=\"text-sm font-medium text-gray-700\">\n Email för inloggning\n </div>\n <div className=\"border p-2 bg-gray-100 rounded-md text-sm text-gray-500 font-normal\">\n {invitation.email}\n </div>\n </div>\n <div className=\"sm:col-span-6 mt-2\">\n <TextInput\n name={\"contactEmail\"}\n register={register}\n errorMessage={errors?.contactEmail?.message}\n registerOptions={emailValidator}\n type=\"email\"\n hoverDetails={\n \"Denna email används för att skicka information och fakturor angÃ¥ende elavtalet. Det kan vara en annan email än den som används för att logga in.\"\n }\n label={\"Email för kontakt\"}\n />\n </div>\n <div className=\"sm:col-span-6 mt-2\">\n <TextInput\n name={\"phone\"}\n register={register}\n errorMessage={errors?.phone?.message}\n registerOptions={{\n required: \"Fyll i ditt telefonnummer\",\n pattern: {\n value: /^\\+?[\\d ]{10,}$/, // optional +, at least 10 digits-or-spaces. Not perfect but good enough and simple.\n message:\n \"Ange telefonnummer inklusive riktnummer utan parenteser eller bindestreck.\",\n },\n }}\n label={\"Telefonnummer\"}\n />\n </div>\n <div className=\"sm:col-span-1 sm:mt-0\">\n <div className=\"sm:col-span-5 sm:mt-0\">\n <SimpleButton\n onClick={onBackButtonPressed}\n text={\"Tillbaka\"}\n style={\"secondary\"}\n ></SimpleButton>\n </div>\n </div>\n <div className=\"sm:col-span-5 sm:mt-0\">\n <SimpleButton onClick={onSubmit} text={\"Nästa\"} style={\"primary\"} />\n </div>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { UserDetailsForm } from \"pages/sign-up-flow/components/UserDetailsForm\";\nimport { LargeLoader } from \"components/loaders/LargeLoader\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n AssetOwnerDetailsDTO,\n GetAssetOwnerInvitationResponseDTO,\n} from \"../../../api/assetOwnerInvitation/assetOwnerInvitation.dto\";\n\ntype Props = {\n invitation: GetAssetOwnerInvitationResponseDTO;\n assetOwnerDetails: AssetOwnerDetailsDTO;\n onBackButtonPressed: () => void;\n onUserDetailsFormCompleted: (assetOwnerDetails: AssetOwnerDetailsDTO) => void;\n};\n\nexport const UserDetails: FC<Props> = ({\n invitation,\n assetOwnerDetails,\n onBackButtonPressed,\n onUserDetailsFormCompleted,\n}) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"space-y-6 sm:space-y-5 sm:pb-8 sm:px-6\">\n <div className=\"space-y-6 sm:space-y-8\">\n <div>\n <h3 className=\"text-lg font-medium leading-6 text-gray-900\">\n {t(\"signUpFlow.Your personal details\")}\n </h3>\n <p className=\"mt-1 max-w-2xl text-sm text-red-600\">\n {t(\n \"signUpFlow.Important! Note that these details must agree with those on the household's current electricity contract.\",\n )}\n </p>\n <p className=\"mt-1 max-w-2xl text-sm text-gray-500\">\n {t(\n \"signUpFlow.We never disclose your data to third parties without your consent. Read more about our privacy policy\",\n )}{\" \"}\n <a\n className=\"text-sm font-medium text-flowerSky-800 hover:text-flowerSky-500\"\n href=\"https://flowerhub.se/integritetspolicy\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {t(\"signUpFlow.Here\")}\n </a>\n .\n </p>\n </div>\n <div className=\"space-y-8 sm:space-y-5\">\n {invitation && (\n <UserDetailsForm\n invitation={invitation}\n assetOwnerDetails={assetOwnerDetails}\n onBackButtonPressed={onBackButtonPressed}\n onUserDetailsFormCompleted={onUserDetailsFormCompleted}\n />\n )}\n {!invitation && <LargeLoader />}\n </div>\n </div>\n </div>\n );\n};\n","import { ExclamationCircleIcon } from \"@heroicons/react/20/solid\";\nimport { classNames } from \"helpers/classNames\";\nimport { FC } from \"react\";\nimport {\n Control,\n Controller,\n RegisterOptions,\n FieldValues,\n} from \"react-hook-form\";\nimport DatePicker from \"react-datepicker\";\nimport \"react-datepicker/dist/react-datepicker.css\";\n\ninterface Props {\n label: string;\n name: string;\n validation?: Pick<\n RegisterOptions<FieldValues>,\n \"maxLength\" | \"minLength\" | \"validate\" | \"required\"\n >;\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n control?: Control<any>;\n minDate?: Date;\n maxDate?: Date;\n showTimeSelect?: boolean;\n}\n\nexport const DateTimePicker: FC<Props> = ({\n label,\n name,\n validation,\n control,\n minDate = undefined,\n maxDate = undefined,\n showTimeSelect = true,\n}) => {\n return (\n <div>\n <label htmlFor={name} className=\"block text-sm font-medium text-gray-700\">\n {label}\n </label>\n <div className=\"mt-1 relative rounded-md\">\n <Controller\n control={control}\n name={name}\n rules={validation}\n render={({ field, fieldState }) => (\n <>\n <DatePicker\n onChange={(date) => field.onChange(date)}\n selected={field.value}\n toggleCalendarOnIconClick\n preventOpenOnFocus\n showIcon\n icon={\n <svg\n className=\"w-4 h-5 text-gray-500 dark:text-gray-400\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path d=\"M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z\" />\n </svg>\n }\n showTimeSelect={showTimeSelect}\n dateFormat={\n showTimeSelect ? \"MMMM d, yyyy h:mm\" : \"MMMM d, yyyy\"\n }\n minDate={minDate}\n maxDate={maxDate}\n className={classNames(\n fieldState.error\n ? \"border-red-300 focus:border-red-500 focus:outline-none focus:ring-red-500 pr-10 text-red-900 placeholder-red-300 rounded-md shadow-sm !pl-8\"\n : \"border-gray-300 focus:border-flowerblue-500 focus:ring-flowerblue-500 rounded-md shadow-sm !pl-8\",\n )}\n />\n {fieldState.error && (\n <div className=\"flex flex-row items-center mt-2\">\n <ExclamationCircleIcon\n className=\"h-5 w-5 text-red-500\"\n aria-hidden=\"true\"\n />\n <p className=\"ml-1 text-sm text-red-600\">\n {fieldState.error.message}\n </p>\n </div>\n )}\n </>\n )}\n />\n </div>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { SimpleButton } from \"components/buttons/SimpleButton\";\nimport { DateTimePicker } from \"../../../components/input/DateTimePicker\";\nimport { useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface ElectricityContractUseFormProps {\n startDate: Date;\n}\n\ninterface Props {\n onStartDateChosen: (arg: Date) => void;\n startDate: Date;\n onBackButtonClicked: () => void;\n}\n\nexport const ElectricityContract: FC<Props> = ({\n onStartDateChosen,\n onBackButtonClicked,\n startDate,\n}) => {\n const { t } = useTranslation();\n const { handleSubmit: handleStartDateSubmit, control } =\n useForm<ElectricityContractUseFormProps>({\n defaultValues: { startDate: startDate },\n mode: \"onSubmit\",\n });\n\n const onStartDateSubmit = handleStartDateSubmit(\n (data: ElectricityContractUseFormProps) =>\n onStartDateChosen(data.startDate),\n );\n\n return (\n <div className=\"space-y-8 sm:w-fit bg-white px-6 py-8\">\n <div className=\"space-y-8 sm:space-y-5 sm:grid sm:grid-cols-6 sm:gap-2\">\n <div className=\"space-y-6 sm:space-y-5 sm:col-span-6\">\n <h3 className=\"text-lg font-medium leading-6 text-gray-900\">\n {t(\"signUpFlow.Electricity contract\")}\n </h3>\n <p className=\"mt-1 max-w-2xl text-sm text-gray-600 leading-6\">\n {t(\"signUpFlow.To use Flower Hub\")}{\" \"}\n <a\n className=\"text-sm font-medium text-flowerSky-800 hover:text-flowerSky-500\"\n href=\"https://flowerhub.se/elavtal\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {t(\"signUpFlow.Here\")}\n </a>\n .\n </p>\n <div className={\"p-3 bg-gray-50 rounded-lg shadow\"}>\n <p className=\"mt-1 max-w-2xl text-sm text-gray-600 leading-6\">\n {t(\"signUpFlow.At the end of this registration flow\")}\n </p>\n <p className=\"mt-1 max-w-2xl text-sm text-red-600 leading-6 mb-4\">\n {t(\n \"signUpFlow.Important! If you select a start date that conflicts\",\n )}\n </p>\n <DateTimePicker\n label={t(\"signUpFlow.Start date for electricity contract\")}\n name=\"startDate\"\n control={control}\n minDate={\n new Date(new Date().setDate(new Date().getDate() + 7 * 3)) // three weeks form now\n }\n maxDate={new Date(new Date().setMonth(new Date().getMonth() + 2))}\n showTimeSelect={false}\n validation={{\n required: \"Start date is required\",\n validate: (value: string) => value !== \"\",\n }}\n />\n </div>\n <p className=\"mt-1 max-w-2xl text-sm text-gray-600 leading-6\">\n {t(\"signUpFlow.By going ahead and then signing\")}{\" \"}\n <a\n className=\"text-sm font-medium text-flowerSky-800 hover:text-flowerSky-500\"\n href=\"https://flowerhub.se/elavtal-villkor\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n {t(\"signUpFlow.terms\")}\n </a>\n .\n </p>\n </div>\n <div className=\"sm:col-span-1 sm:mt-0\">\n <SimpleButton\n onClick={onBackButtonClicked}\n text={\"Tillbaka\"}\n style={\"secondary\"}\n />\n </div>\n <div className=\"sm:col-span-5 sm:mt-0\">\n <SimpleButton\n onClick={onStartDateSubmit}\n text={\"Jag vill byta elavtal\"}\n style={\"primary\"}\n />\n </div>\n </div>\n </div>\n );\n};\n","import { FC } from \"react\";\n\ntype ButtonProps = {\n label?: string;\n handleClick: () => void;\n isLoading?: boolean;\n type?: \"button\" | \"submit\";\n disabled?: boolean;\n};\nexport const Button: FC<ButtonProps> = ({\n label = \"Nästa\",\n handleClick,\n isLoading = false,\n type = \"button\",\n disabled = false,\n}) => (\n <button\n type={type}\n className=\"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-flowerSky-500 disabled:bg-gray-400 text-base font-medium text-white hover:bg-flowerSky-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-flowerSky-300 sm:col-start-2 sm:text-sm mt-8 sm:mt-12\"\n onClick={handleClick}\n disabled={disabled}\n >\n {isLoading && (\n <svg\n className=\"w-5 h-5 mr-3 -ml-1 text-white animate-spin\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n ></circle>\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n ></path>\n </svg>\n )}\n {label}\n </button>\n);\n","import { FC } from \"react\";\nimport { StepProps } from \"pages/sign-up-flow/SignUpFlowPage\";\nimport { Button } from \"pages/sign-up-flow/components/Button\";\n\nexport const FinalStep: FC<StepProps> = ({ handleClick }) => {\n return (\n <form className=\"space-y-8 divide-y divide-gray-200 bg-white px-4 py-4 pb-8\">\n <div className=\"space-y-8 divide-y divide-gray-200 sm:space-y-5\">\n <div className=\"space-y-6 sm:space-y-5 pt-6 sm:pt-4 lg:pt-10\">\n <h3 className=\"text-lg font-medium leading-6 text-gray-900\">\n Grattis! Nu är du registrerad.\n </h3>\n <p className=\"mt-1 max-w-2xl text-sm text-gray-600 leading-6\">\n Du kan nu logga in pÃ¥ Flower Hub-portalen genom att trycka pÃ¥ länken\n nedan.\n </p>\n </div>\n <Button handleClick={handleClick} label=\"Logga in\" />\n </div>\n </form>\n );\n};\n","import { FC } from \"react\";\nimport { SimpleButton } from \"components/buttons/SimpleButton\";\n\ntype Props = {\n onBackButtonClicked: () => void;\n onNextButtonClicked: () => void;\n};\n\nexport const TermsAndConditions: FC<Props> = ({\n onBackButtonClicked,\n onNextButtonClicked,\n}) => {\n return (\n <form className=\"space-y-8 sm:w-fit bg-white px-6 py-8\">\n <div className=\"space-y-8 sm:space-y-5 sm:grid sm:grid-cols-6 sm:gap-2\">\n <div className=\"space-y-6 sm:space-y-5 sm:col-span-6\">\n <h3 className=\"text-lg font-medium leading-6 text-gray-900\">\n Villkor för Flower Hub\n </h3>\n <ul className=\"mt-1 max-w-2xl text-sm text-gray-600 leading-6 list-disc px-4 space-y-3\">\n <li>\n Flower Hub ska vara uppkopplad med ström och internet sÃ¥ som\n installatören installerade den\n </li>\n <li>\n Du behöver behÃ¥lla vÃ¥rt elavtal för att fortsätta fÃ¥ intäkt frÃ¥n\n Flower Hub\n </li>\n <li>\n Flower Hub kommer att generera en intäkt till dig varje mÃ¥nad som\n dras av pÃ¥ din elfaktura (enligt prislista)\n </li>\n </ul>\n <p className=\"mt-1 max-w-2xl text-sm text-gray-600 leading-6\">\n Genom att gÃ¥ vidare till nästa steg accepterar du Flower Hubs{\" \"}\n <a\n href=\"https://flowerhub.se/anvandarvillkor\"\n className=\"text-sm font-medium text-flowerSky-800 hover:text-flowerSky-500\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n användarvillkor\n </a>\n .\n </p>\n </div>\n <div className=\"sm:col-span-1 sm:mt-0\">\n <SimpleButton\n onClick={onBackButtonClicked}\n text={\"Tillbaka\"}\n style={\"secondary\"}\n />\n </div>\n <div className=\"sm:col-span-5 sm:mt-0\">\n <SimpleButton\n onClick={onNextButtonClicked}\n text={\"Jag godkänner villkoren\"}\n style={\"primary\"}\n />\n </div>\n </div>\n </form>\n );\n};\n","import { ChangeEvent, FC, useId, useState } from \"react\";\nimport { Button } from \"pages/sign-up-flow/components/Button\";\nimport { GetAssetOwnerInvitationResponseDTO } from \"api/assetOwnerInvitation/assetOwnerInvitation.dto\";\n\nenum SelectedAssetOwner {\n SAME_AS_INVITATION = \"same\",\n OTHER_THAN_INVITATION = \"other\",\n NOT_SELECTED = \"not_selected\",\n}\n\ntype Props = {\n invitation: GetAssetOwnerInvitationResponseDTO;\n onSamePersonSelectedContinue: () => void;\n onAnotherPersonSelectedContinue: () => void;\n};\n\nexport const Landing: FC<Props> = ({\n invitation,\n onSamePersonSelectedContinue,\n onAnotherPersonSelectedContinue,\n}) => {\n const samePersonRadioId = useId();\n const otherPersonRadioId = useId();\n\n const [selectedPerson, setSelectedPerson] = useState(\n SelectedAssetOwner.NOT_SELECTED,\n );\n\n const handleOptionChange = (changeEvent: ChangeEvent<HTMLInputElement>) => {\n if (\n !Object.values<string>(SelectedAssetOwner).includes(\n changeEvent.target.value,\n )\n ) {\n // Actually an error but needs some kind of fallback.\n setSelectedPerson(SelectedAssetOwner.NOT_SELECTED);\n } else {\n setSelectedPerson(changeEvent.target.value as SelectedAssetOwner);\n }\n };\n\n return (\n <div className=\"px-6 py-6\">\n <h2 className=\"text-2xl font-medium leading-6 text-gray-900 mx-auto mb-4\">\n Välkommen till Flower Hub\n </h2>\n <p className=\"mt-1 max-w-2xl text-base text-gray-600 leading-6\">\n Du kommer i detta flöde starta processen att byta elavtal.\n </p>\n <div>\n <p className=\"mt-1 max-w-2xl text-base text-gray-600 leading-6\">\n För att kunna byta elavtal behöver vi veta vem som stÃ¥r pÃ¥ nuvarande\n elavtal.\n </p>\n <p className=\"mt-4 max-w-2xl text-lg text-base text-flowerblue-700 leading-6\">\n Vem stÃ¥r pÃ¥ nuvarande elavtal?\n </p>\n <form className=\"ml-6 mt-6\">\n <div className=\"p-1 pl-2 border border-solid rounded flex flex-row items-center\">\n <input\n type=\"radio\"\n id={samePersonRadioId}\n value={SelectedAssetOwner.SAME_AS_INVITATION}\n checked={selectedPerson === SelectedAssetOwner.SAME_AS_INVITATION}\n onChange={handleOptionChange}\n />\n <label\n className=\"ml-2 text-gray-800 text-sm font-medium\"\n htmlFor={samePersonRadioId}\n >\n {`Jag, ${invitation?.firstName} ${invitation?.lastName}`}\n </label>\n </div>\n <div className=\"mt-2 p-1 pl-2 border border-solid rounded flex flex-row items-center\">\n <input\n type=\"radio\"\n id={otherPersonRadioId}\n value={SelectedAssetOwner.OTHER_THAN_INVITATION}\n checked={\n selectedPerson === SelectedAssetOwner.OTHER_THAN_INVITATION\n }\n onChange={handleOptionChange}\n />\n <label\n className=\"ml-2 text-gray-800 text-sm font-medium\"\n htmlFor={otherPersonRadioId}\n >\n NÃ¥gon annan\n </label>\n </div>\n </form>\n </div>\n <Button\n disabled={selectedPerson === SelectedAssetOwner.NOT_SELECTED}\n handleClick={() => {\n if (selectedPerson === SelectedAssetOwner.SAME_AS_INVITATION) {\n onSamePersonSelectedContinue();\n } else if (\n selectedPerson === SelectedAssetOwner.OTHER_THAN_INVITATION\n ) {\n onAnotherPersonSelectedContinue();\n }\n }}\n label=\"GÃ¥ vidare\"\n />\n </div>\n );\n};\n","import { FC, useEffect } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { CheckCircleIcon } from \"@heroicons/react/20/solid\";\nimport { ExclamationCircleIcon } from \"@heroicons/react/24/outline\";\nimport { PasswordInput } from \"components/input/PasswordInput\";\nimport { useTranslation } from \"react-i18next\";\nimport { passwordValidator } from \"helpers/validation\";\nimport { isPasswordStrongEnough } from \"../../helpers/validation\";\n\ntype Props = {\n setPasswordIntermediate: (password: string) => void;\n};\n\nexport const CreatePasswordField: FC<Props> = ({ setPasswordIntermediate }) => {\n const { t } = useTranslation();\n\n const {\n register,\n watch,\n formState: { errors },\n } = useForm<{ password: string }>();\n\n const password = watch(\"password\");\n\n useEffect(() => {\n if (isPasswordStrongEnough(password)) {\n setPasswordIntermediate(password);\n }\n }, [password]);\n\n return (\n <div>\n <PasswordInput\n register={register}\n name=\"password\"\n label={t(\"password.title\")}\n registerOptions={passwordValidator}\n errorMessage={errors?.password?.message}\n />\n <div className=\"flex flex-col mt-5\">\n <div className=\"flex items-center\">\n {isPasswordStrongEnough(password) ? (\n <>\n <CheckCircleIcon className=\"h-5 w-5 mr-1 text-flowerSky-500\" />\n <p className=\"text-sm text-flowerSky-700\">\n {t(\n \"password.The password needs to be at least 10 characters long\",\n )}\n </p>\n </>\n ) : (\n <>\n <ExclamationCircleIcon className=\"h-5 w-5 mr-1 text-gray-400\" />\n <p className=\"text-sm text-gray-400\">\n {t(\n \"password.The password needs to be at least 10 characters long\",\n )}\n </p>\n </>\n )}\n </div>\n </div>\n </div>\n );\n};\n","import { CreatePasswordField } from \"components/input/CreatePasswordField\";\nimport { FC, useState } from \"react\";\nimport { Button } from \"pages/sign-up-flow/components/Button\";\nimport { GetAssetOwnerInvitationResponseDTO } from \"../../../api/assetOwnerInvitation/assetOwnerInvitation.dto\";\nimport { isPasswordStrongEnough } from \"../../../helpers/validation\";\nimport { useTranslation } from \"react-i18next\";\n\ntype Props = {\n onPasswordConfirmed: (arg: string) => void;\n invitation: GetAssetOwnerInvitationResponseDTO;\n};\nexport const ChoosePassword: FC<Props> = ({\n onPasswordConfirmed,\n invitation,\n}) => {\n const { t } = useTranslation();\n\n const [passwordIntermediate, setPasswordIntermediate] = useState(\"\");\n\n return (\n <form\n className=\"space-y-8 divide-y divide-gray-200 bg-white px-6 py-8\"\n autoComplete=\"off\"\n >\n <div className=\"space-y-8 divide-y divide-gray-200 sm:space-y-5\">\n <div className=\"space-y-6 sm:space-y-8\">\n <div>\n <h3 className=\"text-lg font-medium leading-6 text-gray-900\">\n {t(\"password.Choose a password\")}\n </h3>\n </div>\n\n {/* For prompting user to store email/password in browser */}\n <input hidden type=\"email\" value={invitation.email} readOnly />\n <CreatePasswordField\n setPasswordIntermediate={setPasswordIntermediate}\n />\n <Button\n handleClick={() => onPasswordConfirmed(passwordIntermediate)}\n type=\"submit\"\n disabled={!isPasswordStrongEnough(passwordIntermediate)}\n />\n </div>\n </div>\n </form>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n signWithQrCode: () => void;\n signOnSameDevice: () => void;\n url: string;\n text: string;\n}\n\nexport const SignOptions: FC<Props> = ({\n signWithQrCode,\n signOnSameDevice,\n text,\n}) => {\n const { t } = useTranslation();\n\n const classNames =\n \"border border-white bg-flowerSky-600 hover:bg-flowerSky-700 focus:ring-flowerSky-600 text-white w-full inline-flex justify-center items-center rounded-md shadow-sm px-4 py-2 text-base font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 sm:col-start-2 sm:text-sm mt-8\";\n\n return (\n <div className=\"sm:grid sm:grid-cols-4 sm:gap-1\">\n <p className=\"text-sm font-medium leading-6 text-gray-600 sm:col-span-6\">\n {text}\n </p>\n <div className=\"sm:col-span-4\">\n <button className={classNames} onClick={signWithQrCode}>\n <span>{t(\"bankID.UseBankIDOnAnotherDevice\")}</span>\n <img\n className={`h-8 \"w-8\" pl-2 fill-red-900`}\n src=\"/qrCodeLogo.svg\"\n alt=\"\"\n />\n </button>\n </div>\n <div className=\"sm:col-span-4 -mt-5\">\n <button className={classNames} onClick={signOnSameDevice}>\n <span>{t(\"bankID.UseBankIDOnThisDevice\")}</span>\n <img\n className={`h-8 \"w-12\" pl-2 fill-red-900`}\n src=\"/bankIdLogo.svg\"\n alt=\"\"\n />\n </button>\n </div>\n </div>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport QRLib from \"qrcode\";\n\ninterface Props {\n qrCode: string;\n}\n\nexport const AnimatedQRCode: FC<Props> = ({ qrCode }) => {\n const { t } = useTranslation();\n\n const [qrImage, setQrImage] = useState<string>();\n\n useEffect(() => {\n QRLib.toDataURL(qrCode)\n .then((url: string) => {\n setQrImage(url);\n })\n .catch(() => {\n setQrImage(undefined);\n });\n }, [qrCode]);\n\n return (\n <div className=\"flex flex-col items-center\">\n <p className=\"text-sm text-gray-500 mt-4 mb-4\">\n {t(\"bankID.OpenBankIDAppAndScanQRCode\")}\n </p>\n <img className=\"min-w-60 max-w-60\" src={qrImage} />\n </div>\n );\n};\n","import { SimpleButton } from \"components/buttons/SimpleButton\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const FailedSignUp: FC = () => {\n const { t } = useTranslation();\n\n const navigateToStepZero = () => {\n const url = location.href;\n\n location.assign(url.replace(\"step=6\", \"step=0\"));\n };\n\n return (\n <div>\n <p className=\"text-sm text-gray-500 mt-4\">\n {t(\"bankID.SomethingWrongGoBack\")}\n </p>\n <p className=\"text-sm text-gray-500 mt-4\">\n {t(\"bankID.DoNotReloadPage\")}\n </p>\n <SimpleButton\n onClick={navigateToStepZero}\n text={t(\"Back\")}\n style=\"primary\"\n />\n </div>\n );\n};\n","import api from \"../axiosInstance\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNotification } from \"hooks/useNotification\";\nimport { CollectResponseDTO, InitiateBankIDResponseDTO } from \"./zavann.dto\";\nimport { useMutation, useQuery } from \"@tanstack/react-query\";\n\nconst ENDPOINT = \"/zavann\";\n\nexport enum ZavannQueryKeys {\n PollQRCode = \"zavann-poll-bank-id-qr-code\",\n PollBankID = \"zavann-poll-bank-id\",\n}\n\nexport const useInitiateBankIDSignature = () => {\n const { t } = useTranslation();\n const notification = useNotification();\n return useMutation({\n mutationFn: async (): Promise<InitiateBankIDResponseDTO> =>\n (await api.post(`${ENDPOINT}/bankid`)).data,\n onError: () => {\n notification.error(\n t(\n \"bankID.Something went wrong. Check your details in previous steps and try again\",\n ),\n );\n },\n });\n};\n\nexport const usePollBankIDGenerateQRCode = (id: string, settings = {}) =>\n useQuery({\n queryKey: [ZavannQueryKeys.PollQRCode, id],\n queryFn: async (): Promise<string> =>\n (await api.get(`${ENDPOINT}/bankid-qr-code/${id}`)).data,\n ...settings,\n });\n\nexport const usePollBankID = (id: string, settings = {}) =>\n useQuery({\n queryKey: [ZavannQueryKeys.PollBankID, id],\n queryFn: async (): Promise<CollectResponseDTO> =>\n (await api.get(`${ENDPOINT}/bankid/${id}`)).data,\n ...settings,\n });\n","import isMobile from \"is-mobile\";\n\nconst useDevice = () => {\n const isMobileOrTablet = isMobile({ tablet: true, featureDetect: true });\n const isChromeOnAppleDevice = Boolean(navigator.userAgent.match(/CriOS/));\n const isFirefoxOnAppleDevice = Boolean(navigator.userAgent.match(/FxiOS/));\n const isOperaTouchOnAppleDevice = Boolean(navigator.userAgent.match(/OPT/));\n\n return {\n isMobileOrTablet,\n isChromeOnAppleDevice,\n isFirefoxOnAppleDevice,\n isOperaTouchOnAppleDevice,\n };\n};\n\nexport default useDevice;\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n url: string;\n setIsWaitingToOpenApp: () => void;\n}\n\nexport const OpenBankIdApp: FC<Props> = ({ url, setIsWaitingToOpenApp }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"sm:grid sm:grid-cols-4 sm:gap-1\">\n <p className=\"text-sm font-medium leading-6 text-gray-600 sm:col-span-6\">\n {t(\"bankID.OpenBankIDOnThisDevice\")}\n </p>\n\n <div className=\"sm:col-span-4 -mt-5\">\n <a href={url}>\n <button\n className=\"border border-white bg-flowerSky-600 hover:bg-flowerSky-700 focus:ring-flowerSky-600 text-white w-full inline-flex justify-center items-center rounded-md shadow-sm px-4 py-2 text-base font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 sm:col-start-2 sm:text-sm mt-8\"\n onClick={setIsWaitingToOpenApp}\n >\n <span>{t(\"bankID.OpenBankIDButton\")}</span>\n <img\n className={`h-8 \"w-12\" pl-2 fill-red-900`}\n src=\"/bankIdLogo.svg\"\n alt=\"\"\n />\n </button>\n </a>\n </div>\n </div>\n );\n};\n","import { LargeLoader } from \"components/loaders/LargeLoader\";\nimport { FC, useEffect, useState } from \"react\";\nimport { SimpleButton } from \"components/buttons/SimpleButton\";\nimport { SignOptions } from \"./bankIDSteps/SignOptions\";\nimport { AnimatedQRCode } from \"./bankIDSteps/AnimatedQRCode\";\nimport { FailedSignUp } from \"./bankIDSteps/FailedSignUp\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n useInitiateBankIDSignature,\n usePollBankID,\n usePollBankIDGenerateQRCode,\n} from \"api/zavann/zavann.endpoints\";\nimport useDevice from \"hooks/useDevice\";\nimport { OpenBankIdApp } from \"./bankIDSteps/OpenBankIdApp\";\nimport { AssetOwnerDetailsDTO } from \"../../../api/assetOwnerInvitation/assetOwnerInvitation.dto\";\nimport { CollectResponseDTO } from \"../../../api/zavann/zavann.dto\";\nimport { UserBrowserType } from \"../../../api/assetOwnerInvitation/assetOwnerInvitation.type\";\n\ninterface Props {\n assetOwnerDetails?: AssetOwnerDetailsDTO;\n passwordIsEntered: boolean;\n isCollectCompleted: boolean;\n setIsCollectCompleted: (isCollectCompleted: boolean) => void;\n setCollectResult: (collectResult: CollectResponseDTO) => void;\n}\n\nexport const BankIDVerification: FC<Props> = ({\n assetOwnerDetails,\n passwordIsEntered,\n isCollectCompleted,\n setIsCollectCompleted,\n setCollectResult,\n}) => {\n const { t } = useTranslation();\n const [loaderText, setLoaderText] = useState<string>(\"\");\n\n /**\n * Get OrderRef from BankID\n */\n const [orderRef, setOrderRef] = useState<string>(\"\");\n const [url, setUrl] = useState<string>(\"\");\n const [isAutoStart, setIsAutoStart] = useState<boolean>(false);\n const [isWaitingToOpenApp, setIsWaitingToOpenApp] = useState<boolean>(false);\n const [isCancelled, setIsCancelled] = useState<boolean>(false);\n const [retryBankIDSign, setRetryBankIDSign] = useState<boolean>(false);\n\n const device = useDevice();\n\n const { mutate: initiateBankIDSignature, data: initiateBankIDSignResponse } =\n useInitiateBankIDSignature();\n\n useEffect(() => {\n if (initiateBankIDSignResponse?.orderRef) {\n setOrderRef(initiateBankIDSignResponse.orderRef);\n }\n\n if (isAutoStart && initiateBankIDSignResponse?.autoStartToken) {\n const returnUrl = createReturnUrl(device);\n\n const autoStartUrl = device.isMobileOrTablet\n ? \"https://app.bankid.com/\"\n : \"bankid:///\";\n\n setUrl(\n `${autoStartUrl}?autostarttoken=${initiateBankIDSignResponse.autoStartToken}&redirect=${returnUrl}`,\n );\n }\n }, [initiateBankIDSignResponse]);\n\n /**\n * Poll BankID QR Code\n */\n const [qrCode, setQrCode] = useState<string>(\"\");\n const [isGeneratingQrCode, setIsGeneratingQrCode] = useState<boolean>(false);\n\n const { data: qrCodeBankIDResponse, isFetching: isWaitingForQrCode } =\n usePollBankIDGenerateQRCode(orderRef, {\n enabled: !!orderRef && isGeneratingQrCode,\n refetchInterval: 1000,\n gcTime: 0,\n });\n\n useEffect(() => {\n if (qrCodeBankIDResponse) {\n setQrCode(qrCodeBankIDResponse);\n }\n }, [qrCodeBankIDResponse]);\n\n const signWithQrCode = () => {\n initiateBankIDSignature();\n\n setLoaderText(t(\"bankID.FetchingQRCode\"));\n setIsGeneratingQrCode(true);\n\n setRetryBankIDSign(false);\n setIsCancelled(false);\n };\n\n const signOnSameDevice = () => {\n initiateBankIDSignature();\n\n setLoaderText(t(\"bankID.StartingBankIDApp\"));\n setIsAutoStart(true);\n\n setRetryBankIDSign(false);\n setIsCancelled(false);\n };\n\n /**\n * Poll BankID status\n */\n const { data: collectResult } = usePollBankID(orderRef, {\n enabled: !!orderRef && !isCollectCompleted,\n refetchInterval: 1000,\n gcTime: 0,\n });\n\n // Check the status of the bankID signature\n useEffect(() => {\n if (!!collectResult && collectResult.status === \"complete\") {\n setIsGeneratingQrCode(false);\n setLoaderText(t(\"bankID.WaitingCollectCompleted\"));\n setIsCollectCompleted(true);\n setCollectResult(collectResult);\n } else if (!!collectResult && collectResult.status === \"failed\") {\n setFlagsToFalsyValue();\n setRetryBankIDSign(true);\n }\n }, [collectResult]);\n\n useEffect(() => {\n if (retryBankIDSign || isCancelled) {\n setFlagsToFalsyValue();\n }\n }, [retryBankIDSign, isCancelled]);\n\n const setFlagsToFalsyValue = () => {\n setOrderRef(\"\");\n setQrCode(\"\");\n setUrl(\"\");\n setIsGeneratingQrCode(false);\n setIsWaitingToOpenApp(false);\n setIsAutoStart(false);\n };\n const displayLoader =\n (isWaitingForQrCode && !qrCode) || isWaitingToOpenApp || isCollectCompleted;\n\n const displayCancelButton = (qrCode || url) && !isCollectCompleted;\n\n return (\n <div className=\"space-y-8 bg-white px-6 py-8\">\n <div className=\"space-y-8 sm:space-y-5 flex flex-col items-center\">\n <h3 className=\"text-lg font-medium leading-6 text-gray-900\">\n {t(\"bankID.SignWithBankIDTitle\")}\n </h3>\n\n {!assetOwnerDetails || !passwordIsEntered ? (\n <FailedSignUp />\n ) : retryBankIDSign ? (\n <SignOptions\n signWithQrCode={signWithQrCode}\n signOnSameDevice={signOnSameDevice}\n url={url}\n text={t(\"bankID.RetrySignature\")}\n />\n ) : displayLoader ? (\n <div className=\"flex flex-col items-center\">\n <LargeLoader />\n <p className=\"text-sm text-gray-500 mt-4\">{loaderText}</p>\n </div>\n ) : url ? (\n <OpenBankIdApp\n url={url}\n setIsWaitingToOpenApp={() => setIsWaitingToOpenApp(true)}\n />\n ) : qrCode ? (\n <AnimatedQRCode qrCode={qrCode} />\n ) : (\n <SignOptions\n signWithQrCode={signWithQrCode}\n signOnSameDevice={signOnSameDevice}\n url={url}\n text={t(\"bankID.SignWithBankID\")}\n />\n )}\n\n {displayCancelButton && (\n <div className=\"sm:col-span-1 sm:mt-0\">\n <SimpleButton\n onClick={() => setIsCancelled(true)}\n text={t(\"Back\")}\n style={\"secondary\"}\n />\n </div>\n )}\n </div>\n </div>\n );\n};\n\n/**\n * Define url to redirect from BankID to Flower Hub portal\n */\nexport const createReturnUrl = (device: UserBrowserType) => {\n // IOS\n if (device.isChromeOnAppleDevice) {\n return encodeURIComponent(\"googlechrome://\");\n }\n if (device.isFirefoxOnAppleDevice) {\n return encodeURIComponent(\"firefox://\");\n }\n if (device.isOperaTouchOnAppleDevice) {\n return encodeURIComponent(\n `${window.location.href.replace(\"http\", \"touch-http\")}`,\n );\n }\n\n // Safari: redirect manually from BankID to Flower Hub portal\n\n // Android\n return null;\n};\n","export enum SignUpStep {\n Landing,\n SamePersonWarning,\n UserDetails,\n ElectricityContract,\n Terms,\n ChoosePassword,\n BankID,\n Final,\n}\n","import { FC, useId, useState } from \"react\";\nimport { SignUpStep } from \"enums/signUpStep.enum\";\nimport { Button } from \"pages/sign-up-flow/components/Button\";\nimport { ExclamationCircleIcon } from \"@heroicons/react/24/outline\";\n\ntype Props = {\n setStep: (step: SignUpStep) => void;\n};\n\nexport const SameUserWarning: FC<Props> = ({ setStep }) => {\n const checkboxId = useId();\n\n const [confirmed, setConfirmed] = useState(false);\n\n return (\n <div className=\"px-6 py-6\">\n <ExclamationCircleIcon className=\"ml-auto mr-auto h-20 w-20 animate-attention mr-1 text-red-600\" />\n <h2 className=\"text-2xl font-medium leading-6 text-gray-900 mx-auto mb-4\">\n Varning!\n </h2>\n <p className=\"mt-1 max-w-2xl text-base text-gray-600 leading-6\">\n Personen som stÃ¥r pÃ¥ hushÃ¥llets nuvarande elavtal mÃ¥ste signera med\n BankID för att slutföra registreringen. Se därför till att fylla i den\n personens uppgifter i kommande steg samt att den personen är tillgänglig\n för signering med BankID.\n </p>\n <div className=\"mt-6\">\n <input\n name=\"confirmed\"\n type=\"checkbox\"\n id={checkboxId}\n onChange={(event) => setConfirmed(event.target.checked)}\n />\n <label className=\"ml-2\" htmlFor={checkboxId}>\n Jag förstÃ¥r att jag ska fylla i personuppgifterna för personen som\n stÃ¥r pÃ¥ hushÃ¥llets elavtal.\n </label>\n </div>\n <Button\n disabled={!confirmed}\n handleClick={() => setStep(SignUpStep.UserDetails)}\n label=\"GÃ¥ vidare\"\n />\n </div>\n );\n};\n","import {\n AssetOwnerDetailsDTO,\n GetAssetOwnerInvitationResponseDTO,\n} from \"./assetOwnerInvitation.dto\";\n\n// Used for someone else than the person in the invitation\nexport const getAddressOnlyAssetDetailsFromInvitation = (\n invitation: GetAssetOwnerInvitationResponseDTO,\n): AssetOwnerDetailsDTO => ({\n firstName: \"\",\n lastName: \"\",\n personalNumber: \"\",\n address: invitation.address.street,\n postalCode: invitation.address.postalCode,\n city: invitation.address.city,\n phone: \"\",\n contactEmail: \"\",\n});\n\nexport const getEmptyAssetOwnerDetails = (): AssetOwnerDetailsDTO => ({\n firstName: \"\",\n lastName: \"\",\n personalNumber: \"\",\n address: \"\",\n postalCode: \"\",\n city: \"\",\n phone: \"\",\n contactEmail: \"\",\n});\n\n// Used if the invitation is the same person that is on the electricity contract\nexport const getFullAssetDetailsFromInvitation = (\n invitation: GetAssetOwnerInvitationResponseDTO,\n): AssetOwnerDetailsDTO => {\n return {\n firstName: invitation.firstName,\n lastName: invitation.lastName,\n personalNumber: \"\",\n address: invitation.address.street,\n postalCode: invitation.address.postalCode,\n city: invitation.address.city,\n phone: \"\",\n contactEmail: invitation.email,\n };\n};\n","import { FC } from \"react\";\nimport { ViewProps } from \"../SignUpFlowPage\";\nimport { Container } from \"./Container\";\nimport { UserDetails } from \"pages/sign-up-flow/steps/UserDetails\";\nimport { ElectricityContract } from \"pages/sign-up-flow/steps/ElectricityContract\";\nimport { FinalStep } from \"pages/sign-up-flow/steps/FinalStep\";\nimport { TermsAndConditions } from \"./TermsAndConditions\";\nimport { Landing } from \"pages/sign-up-flow/steps/Landing\";\nimport { ChoosePassword } from \"pages/sign-up-flow/steps/ChoosePassword\";\nimport { FlowerHubLogo } from \"styles/Icons\";\nimport { BankIDVerification } from \"pages/sign-up-flow/steps/BankIDVerification\";\nimport { SignUpStep } from \"enums/signUpStep.enum\";\nimport { SameUserWarning } from \"pages/sign-up-flow/steps/SameUserWarning\";\nimport {\n getAddressOnlyAssetDetailsFromInvitation,\n getFullAssetDetailsFromInvitation,\n} from \"api/assetOwnerInvitation/assetOwnerInvitation.helper\";\n\nexport const StepsComponentContainer: FC<ViewProps> = ({\n currentStep,\n setStep,\n setStartDate,\n startDate,\n invitation,\n assetOwnerDetails,\n setAssetOwnerDetails,\n setPassword,\n passwordIsEntered,\n isCollectCompleted,\n setIsCollectCompleted,\n setCollectResult,\n}) => (\n <Container>\n <div className=\"px-6 py-6\">\n <img\n className=\"h-16 w-auto h-auto mx-auto\"\n alt=\"FlowerHub logo\"\n src={FlowerHubLogo}\n />\n </div>\n {currentStep === SignUpStep.Landing && (\n <Landing\n invitation={invitation}\n onSamePersonSelectedContinue={() => {\n setAssetOwnerDetails(getFullAssetDetailsFromInvitation(invitation));\n setStep(SignUpStep.UserDetails);\n }}\n onAnotherPersonSelectedContinue={() => {\n setAssetOwnerDetails(\n getAddressOnlyAssetDetailsFromInvitation(invitation),\n );\n setStep(SignUpStep.SamePersonWarning);\n }}\n />\n )}\n {currentStep === SignUpStep.SamePersonWarning && (\n <SameUserWarning setStep={setStep} />\n )}\n {currentStep === SignUpStep.UserDetails && (\n <UserDetails\n invitation={invitation}\n assetOwnerDetails={assetOwnerDetails}\n onBackButtonPressed={() => setStep(SignUpStep.Landing)}\n onUserDetailsFormCompleted={(assetOwnerDetails) => {\n setAssetOwnerDetails(assetOwnerDetails);\n setStep(SignUpStep.ElectricityContract);\n }}\n />\n )}\n {currentStep === SignUpStep.ElectricityContract && (\n <ElectricityContract\n onStartDateChosen={(startDate) => {\n setStartDate(startDate);\n setStep(SignUpStep.Terms);\n }}\n onBackButtonClicked={() => setStep(SignUpStep.UserDetails)}\n startDate={startDate}\n />\n )}\n {currentStep === SignUpStep.Terms && (\n <TermsAndConditions\n onBackButtonClicked={() => setStep(SignUpStep.ElectricityContract)}\n onNextButtonClicked={() => setStep(SignUpStep.ChoosePassword)}\n />\n )}\n {currentStep === SignUpStep.ChoosePassword && (\n <ChoosePassword\n onPasswordConfirmed={(password) => {\n setPassword(password);\n setStep(SignUpStep.BankID);\n }}\n invitation={invitation}\n />\n )}\n {currentStep === SignUpStep.BankID && (\n <BankIDVerification\n assetOwnerDetails={assetOwnerDetails}\n passwordIsEntered={passwordIsEntered}\n isCollectCompleted={isCollectCompleted}\n setIsCollectCompleted={setIsCollectCompleted}\n setCollectResult={setCollectResult}\n />\n )}\n {currentStep === SignUpStep.Final && (\n <FinalStep handleClick={() => (window.location.href = \"login\")} />\n )}\n </Container>\n);\n","import { StepsDesktop } from \"components/Steps\";\nimport { FC } from \"react\";\nimport { getSteps, ViewProps } from \"../SignUpFlowPage\";\nimport { StepsComponentContainer } from \"./StepsComponentContainer\";\n\nexport const DesktopView: FC<ViewProps> = ({\n currentStep,\n setStep,\n setStartDate,\n startDate,\n invitation,\n assetOwnerDetails,\n setAssetOwnerDetails,\n setPassword,\n passwordIsEntered,\n isCollectCompleted,\n setIsCollectCompleted,\n setCollectResult,\n}) => (\n <div className=\"flex flex-col items-center py-12 min-h-screen justify-around\">\n <div className=\"flex\">\n <div\n style={{\n position: \"absolute\",\n transform: \"translate3d(-200px, -30px, 0)\",\n }}\n >\n <StepsDesktop steps={getSteps(currentStep)} />\n </div>\n <div className=\"w-128\">\n <div className=\"bg-white rounded-lg shadow-lg px-4 pt-8 pb-4\">\n <StepsComponentContainer\n currentStep={currentStep}\n setStep={setStep}\n setStartDate={setStartDate}\n startDate={startDate}\n invitation={invitation}\n assetOwnerDetails={assetOwnerDetails}\n setAssetOwnerDetails={setAssetOwnerDetails}\n setPassword={setPassword}\n passwordIsEntered={passwordIsEntered}\n isCollectCompleted={isCollectCompleted}\n setIsCollectCompleted={setIsCollectCompleted}\n setCollectResult={setCollectResult}\n />\n </div>\n </div>\n </div>\n </div>\n);\n","import { FC } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { FlowerHubLogo } from \"styles/Icons\";\n\ninterface Props {\n header?: string;\n text?: string;\n link?: string;\n linkText?: string;\n errorCode?: string;\n}\nexport const NotFound: FC<Props> = ({\n header = \"Page not found.\",\n text = \"Sorry, we couldn't find the page you're looking for.\",\n link = `${RouteUrl.App}`,\n linkText = \"Go back home\",\n errorCode = \"404\",\n}) => {\n return (\n <div className=\"flex h-screen flex-col bg-white pt-16 pb-12\">\n <main className=\"mx-auto flex w-full max-w-7xl flex-grow flex-col justify-center px-4 sm:px-6 lg:px-8\">\n <div className=\"flex flex-shrink-0 justify-center\">\n <a href=\"/\" className=\"inline-flex\">\n <span className=\"sr-only\">Flower Hub</span>\n <img className=\"h-16 w-auto h-auto mx-auto\" src={FlowerHubLogo} />\n </a>\n </div>\n <div className=\"py-12\">\n <div className=\"text-center flex flex-col items-center\">\n <p className=\"text-base font-semibold text-flowerSky-600\">\n {errorCode}\n </p>\n <h1 className=\"mt-2 text-4xl font-bold tracking-tight text-flowerblue-700 sm:text-5xl\">\n {header}\n </h1>\n <p className=\"mt-4 text-base text-gray-500 max-w-md\">{text}</p>\n <div className=\"mt-6\">\n <Link\n to={link}\n className={\n \"text-base font-medium text-flowerSky-600 hover:text-flowerSky-500\"\n }\n >\n {linkText}\n <span aria-hidden=\"true\"> →</span>\n </Link>\n </div>\n </div>\n </div>\n </main>\n </div>\n );\n};\n","export enum Language {\n English = \"en\",\n Swedish = \"sv\",\n}\n","import { FlowerHubLogo } from \"styles/Icons\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n header?: string;\n text?: string;\n}\nexport const MaintenanceScreen: FC<Props> = ({\n header = \"System maintenance ongoing!\",\n text = \"Functionality unavailable due to maintenance, Sorry for the inconvenience.\",\n}) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"flex h-screen flex-col bg-white pt-16 pb-12\">\n <main className=\"mx-auto flex w-full max-w-7xl flex-grow flex-col justify-center px-4 sm:px-6 lg:px-8\">\n <div className=\"flex flex-shrink-0 justify-center\">\n <a href=\"/\" className=\"inline-flex\">\n <span className=\"sr-only\">Flower Hub</span>\n <img className=\"h-16 w-auto h-auto mx-auto\" src={FlowerHubLogo} />\n </a>\n </div>\n <div className=\"py-12\">\n <div className=\"text-center flex flex-col items-center\">\n <div className=\"flex-shrink-0\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"#ef4444\"\n className=\"w-10 h-10\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z\"\n />\n </svg>\n </div>\n <h1 className=\"mt-2 text-4xl font-bold tracking-tight text-flowerblue-700 sm:text-5xl\">\n {t(`maintenance.${header}`)}\n </h1>\n <p className=\"mt-4 text-base text-gray-500 max-w-md\">\n {\" \"}\n {t(`maintenance.${text}`)}\n </p>\n </div>\n </div>\n </main>\n </div>\n );\n};\n","import { Steps } from \"components/Steps\";\nimport { FC } from \"react\";\nimport { getSteps, ViewProps } from \"../SignUpFlowPage\";\nimport { StepsComponentContainer } from \"./StepsComponentContainer\";\n\nexport const MobileView: FC<ViewProps> = ({\n currentStep,\n setStep,\n setStartDate,\n startDate,\n invitation,\n assetOwnerDetails,\n setAssetOwnerDetails,\n setPassword,\n passwordIsEntered,\n isCollectCompleted,\n setIsCollectCompleted,\n setCollectResult,\n}) => {\n return (\n <div className=\"flex flex-col justify-center w-full items-center px-4 py-10\">\n <div className=\"bg-white flex flex-col shadow-lg py-6 px-6 w-full\">\n <Steps steps={getSteps(currentStep)} />\n <StepsComponentContainer\n currentStep={currentStep}\n setStep={setStep}\n setStartDate={setStartDate}\n startDate={startDate}\n invitation={invitation}\n assetOwnerDetails={assetOwnerDetails}\n setAssetOwnerDetails={setAssetOwnerDetails}\n setPassword={setPassword}\n passwordIsEntered={passwordIsEntered}\n isCollectCompleted={isCollectCompleted}\n setIsCollectCompleted={setIsCollectCompleted}\n setCollectResult={setCollectResult}\n />\n </div>\n </div>\n );\n};\n","import { Steps } from \"components/Steps\";\nimport { FC } from \"react\";\nimport { getSteps, ViewProps } from \"../SignUpFlowPage\";\nimport { StepsComponentContainer } from \"./StepsComponentContainer\";\n\nexport const TabletView: FC<ViewProps> = ({\n currentStep,\n setStep,\n setStartDate,\n startDate,\n invitation,\n assetOwnerDetails,\n setAssetOwnerDetails,\n setPassword,\n passwordIsEntered,\n isCollectCompleted,\n setIsCollectCompleted,\n setCollectResult,\n}) => (\n <div className=\"flex flex-col w-full items-center flex-1 justify-around\">\n <div className=\"mx-auto shadow-xl bg-white pt-10 pb-6 px-16 w-full\">\n <Steps steps={getSteps(currentStep)} />\n <StepsComponentContainer\n currentStep={currentStep}\n setStep={setStep}\n setStartDate={setStartDate}\n startDate={startDate}\n invitation={invitation}\n assetOwnerDetails={assetOwnerDetails}\n setAssetOwnerDetails={setAssetOwnerDetails}\n setPassword={setPassword}\n passwordIsEntered={passwordIsEntered}\n isCollectCompleted={isCollectCompleted}\n setIsCollectCompleted={setIsCollectCompleted}\n setCollectResult={setCollectResult}\n />\n </div>\n </div>\n);\n","import { StepStatus } from \"components/Steps\";\nimport { useEffect, useState } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport {\n useAssetOwnerInvitation,\n useAssetOwnerSignUp,\n} from \"api/assetOwnerInvitation/assetOwnerInvitation.endpoints\";\nimport { SmoothUp } from \"components/animations/SnapUp\";\nimport { DesktopView } from \"./components/DesktopView\";\nimport { PageLoader } from \"components/loaders/PageLoader\";\nimport { NotFound } from \"components/NotFound\";\nimport { SignUpStep } from \"enums/signUpStep.enum\";\nimport { useTranslation } from \"react-i18next\";\nimport { Language } from \"i18n/i18n.constants\";\nimport { useActiveZavannSystemNotificationsByCode } from \"api/system-notification/systemNotification.endpoints\";\nimport { MaintenanceScreen } from \"components/systemNotification/MaintenanceScreen\";\nimport { MobileView } from \"./components/MobileView\";\nimport { TabletView } from \"./components/TabletView\";\nimport {\n AssetOwnerDetailsDTO,\n GetAssetOwnerInvitationResponseDTO,\n} from \"../../api/assetOwnerInvitation/assetOwnerInvitation.dto\";\nimport { CollectResponseDTO } from \"../../api/zavann/zavann.dto\";\nimport { getEmptyAssetOwnerDetails } from \"api/assetOwnerInvitation/assetOwnerInvitation.helper\";\nimport { isMobile, isTablet } from \"react-device-detect\";\n\nexport const SignUpFlowPage = () => {\n /**\n * Set language\n */\n const { i18n } = useTranslation();\n if (i18n.language !== Language.Swedish) {\n i18n.changeLanguage(Language.Swedish);\n }\n\n /**\n * Set step\n */\n const [searchParams, setSearchParams] = useSearchParams();\n const setStep = (step: SignUpStep) => {\n searchParams.set(\"step\", step.toString());\n setSearchParams(searchParams);\n };\n const currentStep = +(searchParams.get(\"step\") || SignUpStep.Landing);\n const code = searchParams.get(\"code\") || \"-1\";\n\n /**\n * Get invitation\n */\n const {\n data: invitation,\n isError,\n isLoading: isLoadingInvitation,\n } = useAssetOwnerInvitation(code, currentStep < SignUpStep.Final);\n\n /**\n * Get empty asset owner details\n */\n const [assetOwnerDetails, setAssetOwnerDetails] =\n useState<AssetOwnerDetailsDTO>(getEmptyAssetOwnerDetails());\n\n /**\n * Get active zavann system notifications\n */\n const { data: systemNotification } =\n useActiveZavannSystemNotificationsByCode(code);\n\n /**\n * Start date\n */\n const currentDate = new Date();\n const [startDate, setStartDate] = useState(\n new Date(currentDate.setMonth(currentDate.getMonth() + 1)),\n );\n\n /**\n * Password\n */\n const [password, setPassword] = useState(\"\");\n // Used instead of sending password in the final step\n const [passwordIsEntered, setPasswordIsEntered] = useState(false);\n\n useEffect(() => {\n if (password.length > 0) {\n setPasswordIsEntered(true);\n }\n }, [password]);\n\n /**\n * BankID status\n */\n const [isCollectCompleted, setIsCollectCompleted] = useState<boolean>(false);\n const [collectResult, setCollectResult] = useState<CollectResponseDTO>();\n\n /**\n * Complete sign up\n */\n const {\n mutate: completeSignUp,\n isSuccess: isSignUpSuccess,\n isError: isSignUpError,\n } = useAssetOwnerSignUp();\n\n useEffect(() => {\n if (isCollectCompleted) {\n if (!assetOwnerDetails) {\n throw Error(\"Missing asset owner details\");\n }\n\n if (!startDate) {\n throw Error(\"Missing electricity contract starting date\");\n }\n\n if (!collectResult) {\n throw Error(\"Missing BankID details\");\n }\n\n const bankIdDetails = {\n bankIdOrderRef: collectResult.orderRef,\n bankIdIp: collectResult.completionData.device.ipAddress,\n bankIdName: collectResult.completionData.user.name,\n bankIdStatus: collectResult.status,\n };\n\n assetOwnerDetails.personalNumber =\n collectResult.completionData.user.personalNumber;\n\n completeSignUp({\n code,\n password,\n assetOwnerDetails,\n bankIdDetails,\n startDate: startDate.toISOString(),\n });\n }\n }, [isCollectCompleted]);\n\n useEffect(() => {\n if (isSignUpSuccess) {\n setStep(SignUpStep.Final);\n }\n }, [isSignUpSuccess]);\n\n if (isLoadingInvitation) {\n return <PageLoader />;\n }\n\n if (isError || !invitation) {\n return (\n <NotFound text=\"This link is either incorrect or has expired. If you have already created an account and forgotten your password, you can reset it.\" />\n );\n }\n\n if (systemNotification) {\n return (\n <MaintenanceScreen text=\"Account creation unavailable due to system maintenance. Please try again later!\" />\n );\n }\n\n if (isSignUpError) {\n return (\n <NotFound\n errorCode=\"500\"\n header=\"Something went wrong.\"\n text=\"We are currently experiencing problem with our servers. Please try again.\"\n link={`?code=${code}`}\n linkText=\"Start over\"\n />\n );\n }\n\n return (\n <SmoothUp>\n {isMobile ? (\n <MobileView\n currentStep={currentStep}\n setStep={setStep}\n invitation={invitation}\n setStartDate={setStartDate}\n startDate={startDate}\n assetOwnerDetails={assetOwnerDetails}\n setAssetOwnerDetails={setAssetOwnerDetails}\n setPassword={setPassword}\n passwordIsEntered={passwordIsEntered}\n isCollectCompleted={isCollectCompleted}\n setIsCollectCompleted={setIsCollectCompleted}\n setCollectResult={setCollectResult}\n />\n ) : isTablet ? (\n <TabletView\n currentStep={currentStep}\n setStep={setStep}\n invitation={invitation}\n setStartDate={setStartDate}\n startDate={startDate}\n assetOwnerDetails={assetOwnerDetails}\n setAssetOwnerDetails={setAssetOwnerDetails}\n setPassword={setPassword}\n passwordIsEntered={passwordIsEntered}\n isCollectCompleted={isCollectCompleted}\n setIsCollectCompleted={setIsCollectCompleted}\n setCollectResult={setCollectResult}\n />\n ) : (\n <DesktopView\n currentStep={currentStep}\n setStep={setStep}\n invitation={invitation}\n setStartDate={setStartDate}\n startDate={startDate}\n assetOwnerDetails={assetOwnerDetails}\n setAssetOwnerDetails={setAssetOwnerDetails}\n setPassword={setPassword}\n passwordIsEntered={passwordIsEntered}\n isCollectCompleted={isCollectCompleted}\n setIsCollectCompleted={setIsCollectCompleted}\n setCollectResult={setCollectResult}\n />\n )}\n </SmoothUp>\n );\n};\n\nexport type ViewProps = {\n currentStep: number;\n setStep: (step: SignUpStep) => void;\n setStartDate: (startDate: Date) => void;\n startDate: Date;\n setPassword: (password: string) => void;\n invitation: GetAssetOwnerInvitationResponseDTO;\n assetOwnerDetails: AssetOwnerDetailsDTO;\n setAssetOwnerDetails: (assetOwnerDetails: AssetOwnerDetailsDTO) => void;\n passwordIsEntered: boolean;\n isCollectCompleted: boolean;\n setIsCollectCompleted: (isCollectCompleted: boolean) => void;\n setCollectResult: (collectResult: CollectResponseDTO) => void;\n};\n\nexport const getStepStatus = (\n stepToAssignStatus: SignUpStep,\n currentStep: SignUpStep,\n): StepStatus =>\n currentStep === SignUpStep.Landing || stepToAssignStatus > currentStep\n ? StepStatus.Upcoming\n : stepToAssignStatus === currentStep\n ? StepStatus.Current\n : StepStatus.Complete;\n\nexport type StepProps = {\n handleClick: () => void;\n isLoading?: boolean;\n invitation?: GetAssetOwnerInvitationResponseDTO;\n};\n\nexport const getSteps = (currentStep: SignUpStep) => [\n {\n label: \"Välkommen\",\n status: getStepStatus(SignUpStep.Landing, currentStep),\n },\n {\n label: \"Uppgifter\",\n status: getStepStatus(SignUpStep.UserDetails, currentStep),\n },\n {\n label: \"Elavtal\",\n status: getStepStatus(SignUpStep.ElectricityContract, currentStep),\n },\n { label: \"Villkor\", status: getStepStatus(SignUpStep.Terms, currentStep) },\n {\n label: \"Lösenord\",\n status: getStepStatus(SignUpStep.ChoosePassword, currentStep),\n },\n {\n label: \"E-legitimation\",\n status: getStepStatus(SignUpStep.BankID, currentStep),\n },\n];\n","import { useNotification } from \"hooks/useNotification\";\nimport api from \"../axiosInstance\";\nimport { CreateFlowerInvitationRequestDTO } from \"./flowerInvitation.dto\";\nimport { SignupByCodeRequestDTO } from \"../shared/signUpByCode.dto\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\n\nconst ENDPOINT = \"/flower-invitation\";\n\nexport enum FlowerInvitationQueryKeys {\n GetAll = \"flower-invitation-get-all\",\n}\n\nexport const useFlowerSignUp = () => {\n return useMutation({\n mutationFn: async (payload: SignupByCodeRequestDTO) =>\n (await api.post(`${ENDPOINT}/sign-up-by-code`, payload)).data,\n });\n};\n\nexport const useCreateFlowerInvitation = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (payload: CreateFlowerInvitationRequestDTO) =>\n await api.post(ENDPOINT, payload),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [FlowerInvitationQueryKeys.GetAll],\n });\n notification.info(\"Invitation sent\");\n },\n onError: () => {\n notification.error(\"Something went wrong, please try again\");\n },\n });\n};\n\nexport const useDeleteFlowerInvitation = () => {\n const queryClient = useQueryClient();\n const notification = useNotification();\n return useMutation({\n mutationFn: async (id: number) => await api.delete(`${ENDPOINT}/${id}`),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [FlowerInvitationQueryKeys.GetAll],\n });\n },\n onError: () => {\n notification.error();\n },\n });\n};\n","import { useForm } from \"react-hook-form\";\nimport { useEffect } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { SignUp } from \"components/SignUp\";\nimport { SmoothUp } from \"components/animations/SnapUp\";\nimport { useFlowerSignUp } from \"api/flowerInvitation/flowerInvitation.endpoints\";\nimport { SignupByCodeRequestDTO } from \"../../api/shared/signUpByCode.dto\";\nimport { isPasswordStrongEnough } from \"../../helpers/validation\";\n\nexport const SignUpFlowerPage = () => {\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n const code = urlParams.get(\"code\") ?? \"\";\n const navigate = useNavigate();\n\n const {\n mutate: signUp,\n isPending: isLoading,\n isSuccess: isSignUpSuccess,\n isError,\n } = useFlowerSignUp();\n\n const {\n register,\n handleSubmit,\n formState: { errors },\n watch,\n } = useForm<SignupByCodeRequestDTO>();\n\n const password = watch(\"password\");\n\n const onSubmit = handleSubmit((data: SignupByCodeRequestDTO) => {\n signUp({ ...data, code });\n });\n\n useEffect(() => {\n if (isSignUpSuccess) {\n navigate(RouteUrl.App);\n }\n }, [isSignUpSuccess]);\n\n return (\n <SmoothUp>\n <SignUp\n register={register}\n onSubmit={onSubmit}\n isLoading={isLoading}\n errors={errors}\n isError={isError}\n isPasswordValid={isPasswordStrongEnough(password)}\n />\n </SmoothUp>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n name: string;\n}\n\nexport const DashboardGreetingHeader: FC<Props> = ({ name }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"md:flex md:items-center md:justify-between mb-4 md:mb-6 lg:md-8 lg:mt-4\">\n <div className=\"min-w-0 flex-1\">\n <h2 className=\"text-xl sm:text-2xl lg:text-3xl font-bold sm:truncate leading-7 sm:tracking-tight after:content-['👋']\">\n {t(`greetingHeader`, { name })}\n </h2>\n <h4 className=\"text-base mt-3 font-medium leading-7 sm:truncate sm:tracking-tight text-flowerGray-400\">\n {t(`greetingSubHeader`)}\n </h4>\n </div>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { Panel } from \"components/Panel\";\nimport { FlowerHubStatusTag } from \"components/tags/FlowerHubStatusTag\";\nimport { useLatestBasedOnAssetCreationForFlower } from \"api/assetOwner/assetOwner.endpoints\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const LatestAssetOwnersWithAssetList: FC = () => {\n const { t } = useTranslation();\n const {\n data: assetOwners,\n isLoading,\n isError,\n } = useLatestBasedOnAssetCreationForFlower();\n\n if (isLoading || isError || !assetOwners) return null; // Mitigate placeholder views in dashboard\n\n return (\n <Panel header={t(\"flowerHub.Recently installed Flower Hubs\")}>\n <div className=\"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8\">\n <table className=\"min-w-full divide-y divide-gray-300\">\n <thead className=\"\">\n <tr>\n <th\n scope=\"col\"\n className=\"py-3.5 pl-4 pr-3 text-left text-sm font-medium text-gray-500 sm:pl-0\"\n >\n {t(\"flowerHub.SerialNumber\")}\n </th>\n <th\n scope=\"col\"\n className=\"py-3.5 pl-4 pr-3 text-left text-sm font-medium text-gray-500 sm:pl-0\"\n >\n {t(\"assetOwnerAccountDetails.Name\")}\n </th>\n <th\n scope=\"col\"\n className=\"px-3 py-3.5 text-left text-sm font-medium text-gray-500\"\n >\n {t(\"assetOwnerAccountDetails.Address\")}\n </th>\n <th\n scope=\"col\"\n className=\"px-3 py-3.5 text-left text-sm font-medium text-gray-500\"\n >\n {t(\"flowerHub.Model\")}\n </th>\n <th\n scope=\"col\"\n className=\"px-3 py-3.5 text-left text-sm font-medium text-gray-500\"\n >\n {t(\"flowerHub.Title\")}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-gray-200\">\n {assetOwners.map((assetOwner) => (\n <tr key={assetOwner.id}>\n <td className=\"whitespace-nowrap py-4 text-sm font-medium text-gray-900 sm:pl-0\">\n {assetOwner.asset.serialNumber}\n </td>\n <td className=\"whitespace-nowrap py-4 text-sm font-medium text-gray-900 sm:pl-0\">\n {assetOwner.installerName}\n </td>\n <td className=\"whitespace-nowrap px-3 py-4 text-sm text-gray-900\">\n {`${assetOwner.address.postalCode}, ${assetOwner.address.city}`}\n </td>\n <td className=\"whitespace-nowrap px-3 py-4 text-sm text-gray-900\">\n {`${assetOwner.asset.assetModel?.manufacturer}, ${assetOwner.asset.assetModel.name}`}\n </td>\n <td className=\"px-3 py-4\">\n <FlowerHubStatusTag\n flowerHubStatus={assetOwner.asset.flowerHubStatus}\n />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </Panel>\n );\n};\n","import { useTranslation } from \"react-i18next\";\nimport { BanknotesIcon } from \"@heroicons/react/24/outline\";\nimport { useDistributorCompensation } from \"../../api/compensation/compensation.endpoints\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport {\n getCurrentYearCompensation,\n getPreviousYearCompensation,\n getTotalCompensation,\n} from \"./CompensationStatistics.helpers\";\nimport React, { FC, useMemo } from \"react\";\nimport { CompensationStatistics, Tile } from \"./CompensationStatistics\";\n\ninterface Props {\n distributorId?: number;\n}\n\nexport const DistributorCompensation: FC<Props> = ({ distributorId }) => {\n const { t } = useTranslation();\n\n // Get distributor compensation\n const {\n data: distributorCompensation,\n isLoading,\n isError,\n } = useDistributorCompensation(distributorId);\n\n const currentCompensationTiles: Tile[] = useMemo(\n () =>\n distributorCompensation\n ? [\n {\n title: t(\"compensation.Total\"),\n value: `${getTotalCompensation(distributorCompensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousYear\"),\n value: `${getPreviousYearCompensation(distributorCompensation)} SEK`,\n },\n {\n title: t(\"compensation.CurrentYear\"),\n value: `${getCurrentYearCompensation(distributorCompensation)} SEK`,\n },\n ]\n : [],\n [distributorCompensation],\n );\n\n if (isLoading || isError) {\n return (\n <CustomPlaceholder\n isLoading={isLoading}\n isError={isError}\n isEmpty={false}\n icon={<BanknotesIcon />}\n errorMessage={t(`compensation.UnableToLoad`)}\n emptyDataMessage={t(`compensation.NotFound`)}\n loaderSize=\"page\"\n />\n );\n }\n\n return (\n <CompensationStatistics\n title={t(\"compensation.Compensation\")}\n icon={<BanknotesIcon />}\n tiles={currentCompensationTiles}\n emptyDataMessage={t(\"compensation.NotFound\")}\n />\n );\n};\n","import { useTranslation } from \"react-i18next\";\nimport { BanknotesIcon } from \"@heroicons/react/24/outline\";\nimport { useInstallerCompensation } from \"../../api/compensation/compensation.endpoints\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport {\n getCurrentYearCompensation,\n getPreviousYearCompensation,\n getTotalCompensation,\n} from \"./CompensationStatistics.helpers\";\nimport React, { FC, useMemo } from \"react\";\nimport { CompensationStatistics, Tile } from \"./CompensationStatistics\";\n\ninterface Props {\n installerId?: number;\n}\n\nexport const InstallerCompensation: FC<Props> = ({ installerId }) => {\n const { t } = useTranslation();\n\n // Get installer compensation\n const {\n data: installerCompensation,\n isLoading,\n isError,\n } = useInstallerCompensation(installerId);\n\n const currentCompensationTiles: Tile[] = useMemo(\n () =>\n installerCompensation\n ? [\n {\n title: t(\"compensation.Total\"),\n value: `${getTotalCompensation(installerCompensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousYear\"),\n value: `${getPreviousYearCompensation(installerCompensation)} SEK`,\n },\n {\n title: t(\"compensation.CurrentYear\"),\n value: `${getCurrentYearCompensation(installerCompensation)} SEK`,\n },\n ]\n : [],\n [installerCompensation],\n );\n\n if (isLoading || isError) {\n return (\n <CustomPlaceholder\n isLoading={isLoading}\n isError={isError}\n isEmpty={false}\n icon={<BanknotesIcon />}\n errorMessage={t(`compensation.UnableToLoad`)}\n emptyDataMessage={t(`compensation.NotFound`)}\n loaderSize=\"page\"\n />\n );\n }\n\n return (\n <CompensationStatistics\n title={t(\"compensation.Compensation\")}\n icon={<BanknotesIcon />}\n tiles={currentCompensationTiles}\n emptyDataMessage={t(\"compensation.NotFound\")}\n />\n );\n};\n","import { SmoothUp } from \"components/animations/SnapUp\";\nimport { DashboardGreetingHeader } from \"components/shared/DashboardGreetingHeader\";\nimport userStore, {\n getDistributorId,\n getInstallerId,\n getUserName,\n getUserRole,\n} from \"store/user.store\";\nimport { DashboardStatistics } from \"../../../components/statistics/DashboardStatistics\";\nimport { LatestAssetOwnersWithAssetList } from \"components/assetOwner/LatestAssetOwnersWithAssetList\";\nimport { LatestInstallerList } from \"components/installer/LatestInstallerList\";\nimport { LatestAssetOwners } from \"components/assetOwner/LatestAssetOwners\";\nimport { BreadCrumb, menuStore } from \"../../../store/menu.store\";\nimport { useEffect } from \"react\";\nimport { RouteLabel } from \"../../../routing/routeLabel.enum\";\nimport { RouteUrl } from \"../../../routing/routeUrl.enum\";\nimport { isDistributor, isFlower, isInstaller } from \"../../../helpers/role\";\nimport { DistributorCompensation } from \"../../../components/compensation/DistributorCompensation\";\nimport { InstallerCompensation } from \"../../../components/compensation/InstallerCompensation\";\n\nexport const DashboardPage = () => {\n const { user } = userStore();\n const userName = userStore(getUserName);\n const distributorId = userStore(getDistributorId);\n const installerId = userStore(getInstallerId);\n const userRole = userStore(getUserRole);\n\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs(getBreadCrumbs());\n }, []);\n\n return (\n <SmoothUp>\n <DashboardGreetingHeader name={userName} />\n <DashboardStatistics\n installerId={isInstaller(userRole) ? user?.installerId : undefined}\n distributorId={\n isDistributor(userRole) ? user?.distributorId : undefined\n }\n />\n <div className=\"flex flex-col flex-wrap w-full h-full\">\n {isFlower(userRole) && <LatestAssetOwnersWithAssetList />}\n {isDistributor(userRole) && (\n <LatestInstallerList distributorId={distributorId} />\n )}\n {isInstaller(userRole) && (\n <LatestAssetOwners installerId={installerId} />\n )}\n </div>\n <div className=\"flex flex-col flex-wrap w-full h-full\">\n {isDistributor(userRole) && (\n <DistributorCompensation distributorId={distributorId} />\n )}\n {isInstaller(userRole) && (\n <InstallerCompensation installerId={installerId} />\n )}\n </div>\n </SmoothUp>\n );\n};\n\nconst getBreadCrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.Dashboard,\n to: `${RouteUrl.App}/${RouteUrl.Dashboard}`,\n },\n];\n","import { CreateFlowerInvitationRequestDTO } from \"api/flowerInvitation/flowerInvitation.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { emailValidator, noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<CreateFlowerInvitationRequestDTO>;\n errors: Partial<FieldErrorsImpl<CreateFlowerInvitationRequestDTO>>;\n}\n\nexport const AddFlowerUserForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`flowerUser.Name`)}\n name=\"name\"\n register={register}\n errorMessage={errors?.name?.message}\n registerOptions={noEmptyStringValidator()}\n />\n <TextInput\n label={t(`flowerUser.Email`)}\n name=\"email\"\n type=\"email\"\n register={register}\n errorMessage={errors?.email?.message}\n registerOptions={emailValidator}\n />\n </ModalContentWrapper>\n );\n};\n","import { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { UserPlusIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { CreateFlowerInvitationRequestDTO } from \"api/flowerInvitation/flowerInvitation.dto\";\nimport { useCreateFlowerInvitation } from \"api/flowerInvitation/flowerInvitation.endpoints\";\nimport { AddFlowerUserForm } from \"./AddFlowerUserForm\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\n\nexport const AddFlowerUser = () => {\n const { t } = useTranslation();\n\n // state\n const [isInviteUserModalOpen, setIsInviteUserModalOpen] = useState(false);\n\n // api\n const {\n mutate: inviteUser,\n isPending: isInvitingUser,\n isSuccess: isInviteUserSuccess,\n } = useCreateFlowerInvitation();\n\n // form\n const {\n register: registerInvitation,\n handleSubmit: handleInvitationSubmit,\n reset: resetInvitation,\n formState: { errors: invitationErrors },\n } = useForm<CreateFlowerInvitationRequestDTO>();\n\n // submit\n const onInvitationSubmit = handleInvitationSubmit(\n (data: CreateFlowerInvitationRequestDTO) => inviteUser(data),\n );\n\n // modal close\n const onInvitationModalClose = () => {\n setIsInviteUserModalOpen(false);\n setTimeout(() => resetInvitation(), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isInviteUserSuccess) {\n onInvitationModalClose();\n }\n }, [isInviteUserSuccess]);\n\n const renderAddFlowerUserButton = () => {\n return (\n <div className={`pb-2 flex justify-end`}>\n <SecondaryButton onClick={() => setIsInviteUserModalOpen(true)}>\n <UserPlusIcon className=\"h-5 w-5 mr-1\" />\n {t(`flowerUser.Add flower user`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderAddFlowerUserButton()}\n\n <Modal\n isOpen={isInviteUserModalOpen}\n onClose={onInvitationModalClose}\n title={t(`flowerUser.Invite user`)}\n rightButtonText={t(`flowerUser.Send invitation`)}\n rightButtonActionHandler={onInvitationSubmit}\n isLoading={isInvitingUser}\n loadingText={t(`flowerUser.Sending invitation...`)}\n >\n <AddFlowerUserForm\n register={registerInvitation}\n errors={invitationErrors}\n />\n </Modal>\n </>\n );\n};\n","import { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DeleteFlowerUserConfirmation = () => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n {t(\n `flowerUser.Are you sure that you want to delete this flower user?`,\n )}\n </p>\n </div>\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"components/Modal\";\nimport { DeleteFlowerUserConfirmation } from \"./DeleteFlowerUserConfirmation\";\nimport DangerButton from \"components/buttons/DangerButton\";\nimport { useDeactivateUser, UserQueryKeys } from \"api/user/user.endpoints\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\ninterface Props {\n userId: number;\n}\n\nexport const DeleteFlowerUser: FC<Props> = ({ userId }) => {\n const { t } = useTranslation();\n const queryClient = useQueryClient();\n\n const [isDeleteUserModalOpen, setIsUserModalOpen] = useState(false);\n\n // api\n const { mutate: deactivateUser, isSuccess } = useDeactivateUser({\n onSuccess: () =>\n queryClient.invalidateQueries({\n queryKey: [UserQueryKeys.GetFlowerUsers],\n }),\n });\n\n // submit\n const onDeactivateUser = () => deactivateUser(userId);\n\n // modal close\n const onDeleteUserModalClose = () => {\n setIsUserModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onDeleteUserModalClose();\n }\n }, [isSuccess]);\n\n return (\n <>\n <DangerButton size=\"small\" onClick={() => setIsUserModalOpen(true)}>\n {t(`flowerUser.Deactivate user`)}\n </DangerButton>\n\n <Modal\n title={t(`flowerUser.Delete user`)}\n leftButtonAction={onDeleteUserModalClose}\n leftButtonText={t(`Close`)}\n rightButtonActionHandler={() => onDeactivateUser()}\n isOpen={isDeleteUserModalOpen}\n onClose={onDeleteUserModalClose}\n loadingText={t(`flowerUser.Deleting user`)}\n >\n <DeleteFlowerUserConfirmation />\n </Modal>\n </>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"components/Modal\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { DeleteFlowerUserConfirmation } from \"./DeleteFlowerUserConfirmation\";\nimport { useDeleteFlowerInvitation } from \"api/flowerInvitation/flowerInvitation.endpoints\";\n\ninterface Props {\n invitationId: number;\n}\n\nexport const DeleteFlowerUserInvitation: FC<Props> = ({ invitationId }) => {\n const { t } = useTranslation();\n\n const [isDeleteInvitationModalOpen, setIsInvitationModalOpen] =\n useState(false);\n\n // api\n const { mutate: deleteInvitation, isSuccess } = useDeleteFlowerInvitation();\n\n // submit\n const onDeleteInvitation = () => deleteInvitation(invitationId);\n\n // modal close\n const onDeleteInvitationModalClose = () => {\n setIsInvitationModalOpen(false);\n };\n\n // after submit success\n useEffect(() => {\n if (isSuccess) {\n onDeleteInvitationModalClose();\n }\n }, [isSuccess]);\n\n return (\n <>\n <SecondaryButton\n size=\"small\"\n onClick={() => setIsInvitationModalOpen(true)}\n >\n {t(`flowerUser.Delete invitation`)}\n </SecondaryButton>\n\n <Modal\n title={t(`flowerUser.Delete invitation`)}\n leftButtonAction={onDeleteInvitationModalClose}\n leftButtonText={t(`Close`)}\n rightButtonActionHandler={() => onDeleteInvitation()}\n isOpen={isDeleteInvitationModalOpen}\n onClose={onDeleteInvitationModalClose}\n loadingText={t(`flowerUser.Deleting invitation`)}\n >\n <DeleteFlowerUserConfirmation />\n </Modal>\n </>\n );\n};\n","import { FC } from \"react\";\nimport { Table, TBody, TD, TH, THead, TR } from \"components/table\";\nimport { Badge } from \"components/tags/Badge\";\nimport { Role } from \"enums/role.enum\";\nimport { AddFlowerUser } from \"./AddFlowerUser\";\nimport { useFlowerUsers } from \"api/user/user.endpoints\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/20/solid\";\nimport { useTranslation } from \"react-i18next\";\nimport { DeleteFlowerUser } from \"./DeleteFlowerUser\";\nimport { DeleteFlowerUserInvitation } from \"./DeleteFlowerUserInvitation\";\nimport { FlowerInvitationDTO } from \"api/flowerInvitation/flowerInvitation.dto\";\nimport { FlowerUserDTO } from \"api/user/user.dto\";\nimport { isFlower } from \"helpers/role\";\n\ninterface Props {\n userRole: Role;\n userId: number;\n}\n\nexport const FlowerUsersTab: FC<Props> = ({ userRole, userId }) => {\n const { t } = useTranslation();\n\n const { data: useFlowerUsersResponse, isLoading, isError } = useFlowerUsers();\n\n if (\n isLoading ||\n isError ||\n !useFlowerUsersResponse?.users ||\n !useFlowerUsersResponse?.invitations\n ) {\n return (\n <CustomPlaceholder\n isEmpty={\n !isLoading &&\n !isError &&\n !useFlowerUsersResponse?.users &&\n !useFlowerUsersResponse?.invitations\n }\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`flowerUser.Error`)}\n emptyDataMessage={t(`flowerUser.EmptyUser`)}\n loaderSize=\"page\"\n />\n );\n }\n\n const { users, invitations } = useFlowerUsersResponse;\n\n return (\n <div className=\"overflow-hidden overflow-y-auto\">\n <div className=\"mb-4\">\n <Table>\n <THead>\n <TR>\n <TH isFirstColumn>{t(`flowerUser.Email`)}</TH>\n <TH>{t(`flowerUser.Name`)}</TH>\n <TH>{t(`flowerUser.Status`)}</TH>\n <TH>\n <></>\n </TH>\n </TR>\n </THead>\n <TBody>\n {users.map(({ email, id, name }: FlowerUserDTO) => (\n <TR key={email}>\n <TD addLeftMargin>{email}</TD>\n <TD>{name}</TD>\n <TD>\n <Badge\n color=\"green\"\n text={t(`badgeAccountStatus.Account created`)}\n />\n </TD>\n <TD alignRight>\n {userId != id && isFlower(userRole) && (\n <DeleteFlowerUser userId={id} />\n )}\n </TD>\n </TR>\n ))}\n {invitations.map(({ email, id, name }: FlowerInvitationDTO) => (\n <TR key={id}>\n <TD addLeftMargin>{email}</TD>\n <TD>{name}</TD>\n <TD>\n <Badge color=\"blue\" text={t(`badgeAccountStatus.Invited`)} />\n </TD>\n <TD alignRight>\n {isFlower(userRole) && (\n <DeleteFlowerUserInvitation invitationId={id} />\n )}\n </TD>\n </TR>\n ))}\n </TBody>\n </Table>\n </div>\n\n {isFlower(userRole) && <AddFlowerUser />}\n </div>\n );\n};\n","import { TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport userStore, { getUserId, getUserRole } from \"store/user.store\";\nimport { useTranslation } from \"react-i18next\";\nimport { FlowerUsersTab } from \"components/flowerUser/FlowerUsersTab\";\nimport TabContainer from \"../../../components/tab/TabContainer\";\n\nconst USERS_TAB = \"users\";\n\nexport const FlowerOrganizationPage = () => {\n const { t } = useTranslation();\n\n const userRole = userStore(getUserRole);\n const loggedInUserId = userStore(getUserId) || -1;\n\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n const currentTab = searchParams.get(\"tab\") || USERS_TAB;\n\n // breadcrumbs\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs(getBreadcrumbs());\n }, []);\n\n return (\n <TabPageWrapper\n tabs={[\n {\n param: USERS_TAB,\n label: t(`flowerUser.UsersTitle`),\n content: (\n <TabContainer key={USERS_TAB}>\n <FlowerUsersTab userRole={userRole} userId={loggedInUserId} />\n </TabContainer>\n ),\n isSelected: currentTab === USERS_TAB,\n },\n ]}\n setTab={setTab}\n />\n );\n};\n\nconst getBreadcrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.Organization,\n to: `${RouteUrl.App}/${RouteUrl.Organization}`,\n },\n];\n","import { ExclamationCircleIcon } from \"@heroicons/react/20/solid\";\nimport { classNames } from \"helpers/classNames\";\nimport { FC } from \"react\";\nimport { UseFormRegister } from \"react-hook-form\";\ninterface Props {\n label: string;\n name: string;\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: UseFormRegister<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n validation?: any;\n errorMessage?: string;\n autoFocus?: boolean;\n placeholder?: string;\n}\nexport const TextArea: FC<Props> = ({\n label,\n name,\n register,\n validation,\n errorMessage,\n autoFocus = false,\n placeholder,\n}) => {\n const hasError = !!errorMessage;\n return (\n <div>\n <label htmlFor={name} className=\"block text-sm font-medium text-gray-700\">\n {label}\n </label>\n <div className=\"mt-1 relative rounded-md shadow-sm\">\n <textarea\n className={classNames(\n \"block w-full rounded-md shadow-sm sm:text-sm\",\n hasError\n ? \"border-red-300 focus:border-red-500 focus:outline-none focus:ring-red-500 pr-10 text-red-900 placeholder-red-300\"\n : \"border-gray-300 focus:border-flowerblue-500 focus:ring-flowerblue-500\",\n )}\n autoComplete=\"off\"\n {...register(name, validation && validation)}\n autoFocus={autoFocus}\n placeholder={placeholder}\n rows={3}\n />\n </div>\n {hasError && (\n <div className=\"flex flex-row items-center mt-2\">\n <ExclamationCircleIcon\n className=\"h-5 w-5 text-red-500\"\n aria-hidden=\"true\"\n />\n <p className=\"ml-1 text-sm text-red-600\">{errorMessage}</p>\n </div>\n )}\n </div>\n );\n};\n","import { GetAssetModelItemResponseDTO } from \"api/assetModel/assetModel.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<GetAssetModelItemResponseDTO>;\n errors: Partial<\n FieldErrorsImpl<{\n name: string;\n manufacturer: string;\n description: string;\n }>\n >;\n}\nexport const EditAssetModelForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`assetModel.Model`)}\n name=\"name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.name?.message}\n />\n <TextInput\n label={t(`assetModel.Manufacturer`)}\n name=\"manufacturer\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.manufacturer?.message}\n />\n <TextInput\n label={t(`assetModel.Compensation`)}\n name=\"compensation\"\n type=\"number\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.manufacturer?.message}\n />\n <TextArea\n label={t(`assetModel.Description`)}\n name=\"description\"\n register={register}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { GetAssetModelItemResponseDTO } from \"api/assetModel/assetModel.dto\";\nimport { useUpdateAssetModel } from \"api/assetModel/assetModel.endpoints\";\nimport { getEmptyAssetModelDTO } from \"api/assetModel/assetModel.helper\";\nimport { EditAssetModelForm } from \"./EditAssetModelForm\";\nimport { useTranslation } from \"react-i18next\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n assetModel: GetAssetModelItemResponseDTO;\n}\n\nexport const EditAssetModel: FC<Props> = ({ assetModel }) => {\n const { t } = useTranslation();\n\n // state\n const [isEditAssetModelModalOpen, setIsEditAssetModelModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: updateAssetModel,\n isPending: isUpdatingAssetModel,\n isSuccess: isUpdateAssetModelSuccess,\n } = useUpdateAssetModel();\n\n // form\n const {\n register: registerUpdateAssetModel,\n handleSubmit: handleUpdateAssetModelSubmit,\n reset: resetUpdateAssetModel,\n formState: { errors: assetModelErrors },\n } = useForm<GetAssetModelItemResponseDTO>();\n\n // submit\n const onUpdateAssetModelSubmit = handleUpdateAssetModelSubmit(\n (data: GetAssetModelItemResponseDTO) => updateAssetModel(data),\n );\n\n // modal close\n const onUpdateAssetModelModalClose = () => {\n setIsEditAssetModelModalOpen(false);\n setTimeout(() => resetUpdateAssetModel(getEmptyAssetModelDTO()), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isUpdateAssetModelSuccess) {\n onUpdateAssetModelModalClose();\n }\n }, [isUpdateAssetModelSuccess]);\n\n // reset form on isEditAssetModelModalOpen change\n useEffect(() => {\n if (isEditAssetModelModalOpen) {\n resetUpdateAssetModel({ ...assetModel });\n }\n }, [isEditAssetModelModalOpen]);\n\n const renderEditAssetModelButton = () => {\n return (\n <PencilSquareIcon\n className=\"h-5 w-5 text-gray-700 hover:text-flowerPeach-900 cursor-pointer\"\n onClick={() => setIsEditAssetModelModalOpen(true)}\n />\n );\n };\n\n return (\n <>\n {renderEditAssetModelButton()}\n\n <Modal\n isOpen={!!isEditAssetModelModalOpen}\n onClose={onUpdateAssetModelModalClose}\n leftButtonAction={onUpdateAssetModelModalClose}\n leftButtonText={t(`Close`)}\n title={t(`assetModel.Edit asset model`)}\n rightButtonActionHandler={onUpdateAssetModelSubmit}\n isLoading={isUpdatingAssetModel}\n rightButtonText={t(`Save`)}\n >\n <EditAssetModelForm\n register={registerUpdateAssetModel}\n errors={assetModelErrors}\n />\n </Modal>\n </>\n );\n};\n","import { FC, useState } from \"react\";\nimport Modal from \"components/Modal\";\nimport { GetAssetModelItemResponseDTO } from \"api/assetModel/assetModel.dto\";\nimport { useDeleteAssetModel } from \"api/assetModel/assetModel.endpoints\";\nimport { useTranslation } from \"react-i18next\";\nimport { TrashIcon } from \"@heroicons/react/24/outline\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\n\ninterface Props {\n assetModel: GetAssetModelItemResponseDTO;\n}\n\nexport const DeleteAssetModel: FC<Props> = ({ assetModel }) => {\n const { t } = useTranslation();\n\n // state\n const [isDeleteAssetModelModalOpen, setIsDeleteAssetModelModalOpen] =\n useState<boolean>(false);\n\n // api\n const { mutate: deleteAssetModel } = useDeleteAssetModel();\n\n // submit\n const onDeleteAssetModel = (id: number) => {\n deleteAssetModel(id);\n };\n\n // modal close\n const onDeleteAssetModelModalClose = () => {\n setIsDeleteAssetModelModalOpen(false);\n };\n\n const renderDeleteAssetModelButton = () => {\n return (\n <TrashIcon\n className=\"h-5 w-5 ml-6 text-flowerRed-800 hover:text-flowerRed-500 cursor-pointer\"\n aria-hidden=\"true\"\n onClick={() => setIsDeleteAssetModelModalOpen(true)}\n />\n );\n };\n\n return (\n <>\n {assetModel.safeToRemove && renderDeleteAssetModelButton()}\n\n <Modal\n isOpen={!!isDeleteAssetModelModalOpen}\n onClose={onDeleteAssetModelModalClose}\n title={t(`assetModel.Delete asset model`)}\n rightButtonActionHandler={() => onDeleteAssetModel(assetModel.id)}\n loadingText={t(`assetModel.Deleting`)}\n leftButtonAction={onDeleteAssetModelModalClose}\n leftButtonText={t(`Close`)}\n >\n <ModalContentWrapper>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n {t(`assetModel.Are you sure that you want to delete`)}{\" \"}\n {assetModel.name} {assetModel.manufacturer}?\n </p>\n </div>\n </ModalContentWrapper>\n </Modal>\n </>\n );\n};\n","import { CreateAssetModelRequestDTO } from \"api/assetModel/assetModel.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<CreateAssetModelRequestDTO>;\n errors: Partial<\n FieldErrorsImpl<{\n name: string;\n manufacturer: string;\n description: string;\n }>\n >;\n}\nexport const AddAssetModelForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`assetModel.Model`)}\n name=\"name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.name?.message}\n />\n <TextInput\n label={t(`assetModel.Manufacturer`)}\n name=\"manufacturer\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.manufacturer?.message}\n />\n <TextInput\n label={t(`assetModel.Compensation`)}\n name=\"compensation\"\n type=\"number\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.manufacturer?.message}\n />\n <TextArea\n label={t(`assetModel.Description`)}\n name=\"description\"\n register={register}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport { CreateAssetModelRequestDTO } from \"api/assetModel/assetModel.dto\";\nimport { useCreateAssetModel } from \"api/assetModel/assetModel.endpoints\";\nimport { getEmptyAssetModelDTO } from \"api/assetModel/assetModel.helper\";\nimport { AddAssetModelForm } from \"./AddAssetModelForm\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n centered?: boolean;\n}\n\nexport const AddAssetModel: FC<Props> = ({ centered = false }) => {\n const { t } = useTranslation();\n\n // state\n const [isAddAssetModelModalOpen, setIsAddAssetModelModalOpen] =\n useState<boolean>(false);\n\n // api\n const {\n mutate: createAssetModel,\n isPending: isCreatingAssetModel,\n isSuccess: isCreateAssetModelSuccess,\n } = useCreateAssetModel();\n\n // form\n const {\n register: registerAssetModel,\n handleSubmit: handleAssetModelSubmit,\n reset: resetAssetModel,\n formState: { errors: assetModelErrors },\n } = useForm<CreateAssetModelRequestDTO>();\n\n // submit\n const onAssetModelSubmit = handleAssetModelSubmit(\n (data: CreateAssetModelRequestDTO) => createAssetModel(data),\n );\n\n // modal close\n const closeAddAssetModelModal = () => {\n setIsAddAssetModelModalOpen(false);\n setTimeout(() => resetAssetModel(getEmptyAssetModelDTO()), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isCreateAssetModelSuccess) {\n closeAddAssetModelModal();\n }\n }, [isCreateAssetModelSuccess]);\n\n const renderAddAssetModelButton = () => {\n return (\n <div\n className={`pb-2 flex ${centered ? \"justify-center\" : \"justify-end\"}`}\n >\n <SecondaryButton onClick={() => setIsAddAssetModelModalOpen(true)}>\n <PlusCircleIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(`assetModel.Add asset model`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderAddAssetModelButton()}\n\n <Modal\n isOpen={isAddAssetModelModalOpen}\n onClose={closeAddAssetModelModal}\n leftButtonAction={closeAddAssetModelModal}\n leftButtonText={t(`Close`)}\n title={t(`assetModel.Add asset model`)}\n rightButtonActionHandler={onAssetModelSubmit}\n isLoading={isCreatingAssetModel}\n >\n <AddAssetModelForm\n register={registerAssetModel}\n errors={assetModelErrors}\n />\n </Modal>\n </>\n );\n};\n","import { Shadow } from \"components/Shadow\";\nimport { Table, TBody, TD, TH, THead, TR } from \"components/table\";\n\nimport { GetAssetModelItemResponseDTO } from \"api/assetModel/assetModel.dto\";\nimport { useAssetModels } from \"api/assetModel/assetModel.endpoints\";\nimport { EditAssetModel } from \"./EditAssetModel\";\nimport { DeleteAssetModel } from \"./DeleteAssetModel\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { FolderPlusIcon } from \"@heroicons/react/24/outline\";\nimport { AddAssetModel } from \"./AddAssetModel\";\nimport { isEmptyArray } from \"helpers/array\";\nimport { useTranslation } from \"react-i18next\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\n\nexport const AssetModelList = () => {\n const { t } = useTranslation();\n\n const { data: assetModels, isLoading, isError } = useAssetModels();\n\n if (isLoading || isError || assetModels === undefined) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError || assetModels === undefined}\n isLoading={isLoading}\n isEmpty={false}\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`assetModel.Error`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n if (isEmptyArray(assetModels)) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={isEmptyArray(assetModels)}\n icon={<FolderPlusIcon />}\n emptyDataMessage={t(`assetModel.Empty`)}\n />\n <AddAssetModel centered={true} />\n </div>\n );\n }\n\n return (\n <div className=\"overflow-auto\">\n <Shadow>\n <Table>\n <THead>\n <TR>\n <TH isFirstColumn>{t(`assetModel.Model`)}</TH>\n <TH>{t(`assetModel.Manufacturer`)}</TH>\n <TH>{t(`assetModel.Description`)}</TH>\n <TH>{t(`assetModel.Compensation`)}</TH>\n <TH>\n <></>\n </TH>\n </TR>\n </THead>\n <TBody>\n {assetModels?.map((assetModel: GetAssetModelItemResponseDTO) => (\n <TR key={assetModel.id}>\n <TD addLeftMargin>{assetModel.name}</TD>\n <TD>{assetModel.manufacturer}</TD>\n <TD>{assetModel.description}</TD>\n <TD>{assetModel.compensation}</TD>\n <TD>\n <div className=\"flex justify-end pr-4\">\n <EditAssetModel assetModel={assetModel} />\n <DeleteAssetModel assetModel={assetModel} />\n </div>\n </TD>\n </TR>\n ))}\n </TBody>\n </Table>\n </Shadow>\n\n <AddAssetModel />\n </div>\n );\n};\n","export enum BRP {\n Volue = 1,\n Jämtkraft = 2,\n Bixia = 3,\n Undefined = -1,\n}\n\nexport const brpLabel = (brp: BRP): string => {\n switch (brp) {\n case BRP.Volue:\n return \"Volue\";\n case BRP.Jämtkraft:\n return \"Jämtkraft\";\n case BRP.Bixia:\n return \"Bixia\";\n default:\n throw Error(`brpLabel is missing implementation for ${brp}`);\n }\n};\n\nexport const BRP_DROPDOWN_ITEMS = [\n {\n label: brpLabel(BRP.Volue),\n value: BRP.Volue,\n },\n {\n label: brpLabel(BRP.Jämtkraft),\n value: BRP.Jämtkraft,\n },\n {\n label: brpLabel(BRP.Bixia),\n value: BRP.Bixia,\n },\n];\n","import api from \"../axiosInstance\";\nimport {\n CreatePrequalificationGroupDTO,\n PrequalificationGroupDTO,\n} from \"./flowerSettings.dto\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\n\nexport const ENDPOINT = \"/flower-settings\";\n\nexport enum FlowerSettingsQueryKeys {\n GetPrequalificationGroup = \"prequalification-groups-get\",\n}\n\nexport const usePrequalificationGroup = () =>\n useQuery({\n queryKey: [FlowerSettingsQueryKeys.GetPrequalificationGroup],\n queryFn: async (): Promise<PrequalificationGroupDTO[]> =>\n (await api.get(`${ENDPOINT}/prequalification-group`)).data,\n });\n\nexport const useCreatePrequalificationGroup = () => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: CreatePrequalificationGroupDTO,\n ): Promise<PrequalificationGroupDTO> =>\n (await api.post(`${ENDPOINT}/prequalification-group`, payload)).data,\n onSuccess: () =>\n queryClient.invalidateQueries({\n queryKey: [FlowerSettingsQueryKeys.GetPrequalificationGroup],\n }),\n });\n};\n\nexport const useUpdatePrequalificationGroup = () => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (\n payload: PrequalificationGroupDTO,\n ): Promise<PrequalificationGroupDTO> =>\n (\n await api.put(\n `${ENDPOINT}/prequalification-group/${payload.id}`,\n payload,\n )\n ).data,\n onSuccess: () =>\n queryClient.invalidateQueries({\n queryKey: [FlowerSettingsQueryKeys.GetPrequalificationGroup],\n }),\n });\n};\n","export enum BiddingRegion {\n SE1 = \"SE1\",\n SE2 = \"SE2\",\n SE3 = \"SE3\",\n SE4 = \"SE4\",\n}\n\nexport const BIDDING_REGION_DROPDOWN_ITEMS = [\n {\n label: BiddingRegion.SE1,\n value: BiddingRegion.SE1,\n },\n {\n label: BiddingRegion.SE2,\n value: BiddingRegion.SE2,\n },\n {\n label: BiddingRegion.SE3,\n value: BiddingRegion.SE3,\n },\n {\n label: BiddingRegion.SE4,\n value: BiddingRegion.SE4,\n },\n];\n","import { FC } from \"react\";\nimport { UseFormRegister } from \"react-hook-form\";\nimport { Checkbox, CheckboxItem } from \"components/input/Checkbox\";\n\ninterface CheckboxGroupProps {\n label: string;\n items: CheckboxItem[];\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: UseFormRegister<any>;\n}\nexport const CheckboxGroup: FC<CheckboxGroupProps> = ({\n label,\n items,\n register,\n}) => (\n <fieldset>\n <legend className=\"sr-only\">{label}</legend>\n <div className=\"flex text-sm font-medium text-gray-700\" aria-hidden=\"true\">\n {label}\n </div>\n <div className=\"mt-2 space-y-2\">\n {items.map((item: CheckboxItem) => (\n <Checkbox key={item.name} item={item} register={register} />\n ))}\n </div>\n </fieldset>\n);\n","import { FC } from \"react\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport {\n BiddingRegion,\n BIDDING_REGION_DROPDOWN_ITEMS,\n} from \"enums/biddingRegion.enum\";\nimport Dropdown from \"components/input/Dropdown\";\nimport { BRP, BRP_DROPDOWN_ITEMS } from \"enums/brp.enum\";\nimport { CheckboxGroup } from \"components/input/CheckboxGroup\";\nimport { TextInput } from \"components/input/TextInput\";\nimport {\n positiveNumberValidator,\n noEmptyStringValidator,\n} from \"helpers/validation\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n CreatePrequalificationGroupDTO,\n PrequalificationGroupDTO,\n} from \"../../api/flowerSettings/flowerSettings.dto\";\n\ninterface Props {\n register: UseFormRegister<\n CreatePrequalificationGroupDTO | PrequalificationGroupDTO\n >;\n errors: Partial<\n FieldErrorsImpl<CreatePrequalificationGroupDTO | PrequalificationGroupDTO>\n >;\n}\nexport const PrequalificationGroupForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`prequalificationGroup.Name`)}\n name=\"name\"\n register={register}\n errorMessage={errors?.name?.message}\n registerOptions={noEmptyStringValidator()}\n />\n <Dropdown\n label={t(`prequalificationGroup.Bidding region`)}\n name=\"biddingRegion\"\n items={BIDDING_REGION_DROPDOWN_ITEMS}\n register={register}\n validation={{\n validate: (value?: BiddingRegion) =>\n !!value || t(`prequalificationGroup.Select a bidding region`),\n }}\n errorMessage={errors?.biddingRegion?.message}\n />\n <Dropdown\n label={t(`prequalificationGroup.BRP`)}\n name=\"brp\"\n items={BRP_DROPDOWN_ITEMS}\n register={register}\n validation={{\n validate: (value?: BRP) =>\n (!!value && value !== BRP.Undefined) ||\n t(`prequalificationGroup.Select a BRP`),\n }}\n errorMessage={errors?.brp?.message}\n />\n <CheckboxGroup\n label={t(`prequalificationGroup.Market approvals`)}\n items={[\n {\n label: t(`prequalificationGroup.FCR-D-up`),\n name: \"marketApprovalFcrdUp\",\n },\n {\n label: t(`prequalificationGroup.FCR-D-down`),\n name: \"marketApprovalFcrdDown\",\n },\n {\n label: t(`prequalificationGroup.FCR-N`),\n name: \"marketApprovalFcrN\",\n },\n ]}\n register={register}\n />\n <TextInput\n label={t(`prequalificationGroup.Approved capacity`)}\n name=\"approvedCapacity\"\n register={register}\n appendix=\"kW\"\n size=\"third\"\n registerOptions={positiveNumberValidator}\n type=\"number\"\n />\n </ModalContentWrapper>\n );\n};\n","import { BiddingRegion } from \"enums/biddingRegion.enum\";\nimport { BRP } from \"enums/brp.enum\";\n\nexport type PrequalificationGroupDTO = {\n id: number;\n name: string;\n biddingRegion: BiddingRegion;\n brp: BRP;\n marketApprovalFcrdUp: boolean;\n marketApprovalFcrdDown: boolean;\n marketApprovalFcrN: boolean;\n approvedCapacity: number;\n};\n\nexport type CreatePrequalificationGroupDTO = {\n name: string | null;\n biddingRegion: BiddingRegion | null;\n brp: BRP | null;\n marketApprovalFcrdUp: boolean;\n marketApprovalFcrdDown: boolean;\n marketApprovalFcrN: boolean;\n approvedCapacity: number | null;\n};\n\nexport const getEmptyPrequalificationGroupDTO =\n (): CreatePrequalificationGroupDTO => ({\n name: null,\n biddingRegion: null,\n brp: BRP.Undefined,\n marketApprovalFcrdUp: false,\n marketApprovalFcrdDown: false,\n marketApprovalFcrN: false,\n approvedCapacity: null,\n });\n","import { useCreatePrequalificationGroup } from \"api/flowerSettings/flowerSettings.endpoints\";\nimport Modal from \"components/Modal\";\nimport { FC, useEffect, useState } from \"react\";\nimport { useForm, UseFormRegister } from \"react-hook-form\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { useTranslation } from \"react-i18next\";\nimport { BRP } from \"enums/brp.enum\";\nimport { PrequalificationGroupForm } from \"./PrequalificationGroupForm\";\nimport { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport {\n CreatePrequalificationGroupDTO,\n getEmptyPrequalificationGroupDTO,\n PrequalificationGroupDTO,\n} from \"../../api/flowerSettings/flowerSettings.dto\";\n\ninterface Props {\n centered?: boolean;\n}\nexport const AddPrequalificationGroup: FC<Props> = ({ centered = false }) => {\n const { t } = useTranslation();\n\n // state\n const [\n isAddPrequalificationGroupModalOpen,\n setIsAddPrequalificationGroupModalOpen,\n ] = useState(false);\n\n // api\n const {\n mutate: createPrequalificationGroup,\n isPending: isCreatingPrequalificationGroup,\n isSuccess: isCreatePrequalificationGroupSuccess,\n } = useCreatePrequalificationGroup();\n\n // form\n const {\n register: registerPrequalificationGroup,\n handleSubmit: handleAddPrequalificationGroupSubmit,\n reset: resetPrequalificationGroup,\n formState: { errors: createPrequalificationGroupErrors },\n } = useForm<CreatePrequalificationGroupDTO>({\n defaultValues: {\n biddingRegion: null,\n brp: BRP.Undefined,\n },\n });\n\n // submit form\n const onAddPrequalificationGroupSubmit = handleAddPrequalificationGroupSubmit(\n (data: CreatePrequalificationGroupDTO) =>\n createPrequalificationGroup({\n ...data,\n brp: +(data.brp ?? -1),\n }),\n );\n\n // close modal\n const handleAddAssetModalClose = () => {\n setIsAddPrequalificationGroupModalOpen(false);\n setTimeout(\n () => resetPrequalificationGroup(getEmptyPrequalificationGroupDTO()),\n 300,\n );\n };\n\n // trigger on success\n useEffect(() => {\n if (isCreatePrequalificationGroupSuccess) {\n handleAddAssetModalClose();\n }\n }, [isCreatePrequalificationGroupSuccess]);\n\n const renderAddPrequalificationGroupButton = () => {\n return (\n <div className={`flex ${centered ? \"justify-center\" : \"justify-end\"}`}>\n <SecondaryButton\n onClick={() => setIsAddPrequalificationGroupModalOpen(true)}\n >\n <PlusCircleIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(`prequalificationGroup.Add prequalification group`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderAddPrequalificationGroupButton()}\n\n <Modal\n isOpen={isAddPrequalificationGroupModalOpen}\n rightButtonActionHandler={onAddPrequalificationGroupSubmit}\n onClose={handleAddAssetModalClose}\n title={t(`prequalificationGroup.Add prequalification group`)}\n isLoading={isCreatingPrequalificationGroup}\n leftButtonAction={handleAddAssetModalClose}\n leftButtonText={t(`Close`)}\n >\n <PrequalificationGroupForm\n register={\n registerPrequalificationGroup as UseFormRegister<\n CreatePrequalificationGroupDTO | PrequalificationGroupDTO\n >\n }\n errors={createPrequalificationGroupErrors}\n />\n </Modal>\n </>\n );\n};\n","import { useUpdatePrequalificationGroup } from \"api/flowerSettings/flowerSettings.endpoints\";\nimport Modal from \"components/Modal\";\nimport { FC, useEffect, useState } from \"react\";\nimport { useForm, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { PrequalificationGroupForm } from \"./PrequalificationGroupForm\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport {\n CreatePrequalificationGroupDTO,\n PrequalificationGroupDTO,\n} from \"../../api/flowerSettings/flowerSettings.dto\";\n\ninterface Props {\n prequalificationGroup: PrequalificationGroupDTO;\n}\n\nexport const EditPrequalificationGroup: FC<Props> = ({\n prequalificationGroup,\n}) => {\n const { t } = useTranslation();\n\n // state\n const [\n isEditPrequalificationGroupModalOpen,\n setPrequalificationGroupModalOpen,\n ] = useState<boolean>(false);\n\n // api\n const {\n mutate: updatePrequalificationGroup,\n isPending: isUpdatingPrequalificationGroup,\n isSuccess: isUpdatePrequalificationGroupSuccess,\n } = useUpdatePrequalificationGroup();\n\n // form\n const {\n register: registerUpdatePrequalificationGroup,\n handleSubmit: handleUpdatePrequalificationGroupSubmit,\n reset: resetUpdatePrequalificationGroup,\n formState: { errors: updatePrequalificationGroupErrors },\n } = useForm<PrequalificationGroupDTO>();\n\n // Populate or clear the form\n useEffect(() => {\n if (isEditPrequalificationGroupModalOpen) {\n resetUpdatePrequalificationGroup({ ...prequalificationGroup });\n }\n }, [isEditPrequalificationGroupModalOpen]);\n\n // submit form\n const onUpdatePrequalificationGroupSubmit =\n handleUpdatePrequalificationGroupSubmit(\n (data: PrequalificationGroupDTO) => {\n updatePrequalificationGroup({\n ...data,\n brp: +(data.brp ?? -1),\n });\n },\n );\n\n // close modal\n const onUpdatePrequalificationGroupModalClose = () => {\n setPrequalificationGroupModalOpen(false);\n setTimeout(() => resetUpdatePrequalificationGroup(), 300);\n };\n\n // trigger on success\n useEffect(() => {\n if (isUpdatePrequalificationGroupSuccess) {\n onUpdatePrequalificationGroupModalClose();\n }\n }, [isUpdatePrequalificationGroupSuccess]);\n\n return (\n <>\n <PencilSquareIcon\n className=\"h-5 w-5 ml-4 text-gray-700 hover:text-flowerPeach-900 cursor-pointer\"\n onClick={() => setPrequalificationGroupModalOpen(true)}\n />\n\n <Modal\n isOpen={!!isEditPrequalificationGroupModalOpen}\n rightButtonActionHandler={onUpdatePrequalificationGroupSubmit}\n onClose={onUpdatePrequalificationGroupModalClose}\n leftButtonAction={onUpdatePrequalificationGroupModalClose}\n leftButtonText={t(`Close`)}\n title={t(`prequalificationGroup.Update prequalification group`)}\n isLoading={isUpdatingPrequalificationGroup}\n rightButtonText={t(`Save`)}\n >\n <PrequalificationGroupForm\n register={\n registerUpdatePrequalificationGroup as UseFormRegister<\n CreatePrequalificationGroupDTO | PrequalificationGroupDTO\n >\n }\n errors={updatePrequalificationGroupErrors}\n />\n </Modal>\n </>\n );\n};\n","import { Table, TBody, TD, TH, THead, TR } from \"components/table\";\nimport { brpLabel } from \"enums/brp.enum\";\nimport { CheckCircleIcon } from \"@heroicons/react/20/solid\";\nimport { Shadow } from \"components/Shadow\";\nimport { usePrequalificationGroup } from \"api/flowerSettings/flowerSettings.endpoints\";\nimport { isEmptyArray } from \"helpers/array\";\nimport { AddPrequalificationGroup } from \"./AddPrequalificationGroup\";\nimport { EditPrequalificationGroup } from \"./EditPrequalificationGroup\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport { PrequalificationGroupDTO } from \"../../api/flowerSettings/flowerSettings.dto\";\n\nexport const PrequalificationGroups = () => {\n const { t } = useTranslation();\n\n const {\n data: prequalificationGroups,\n isLoading,\n isError,\n } = usePrequalificationGroup();\n\n if (isLoading || isError || prequalificationGroups === undefined) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError || prequalificationGroups === undefined}\n isLoading={isLoading}\n isEmpty={false}\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`prequalificationGroup.Error`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n if (isEmptyArray(prequalificationGroups)) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={isEmptyArray(prequalificationGroups)}\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n emptyDataMessage={t(`prequalificationGroup.Empty`)}\n />\n <AddPrequalificationGroup centered={true} />\n </div>\n );\n }\n\n const thClassName =\n \"px-3 py-3 text-xs font-medium uppercase tracking-wide text-white text-center\";\n const checkCircleClassName = \"h-4 w-4 text-flowerSky-500 mx-auto\";\n\n return (\n <div className=\"overflow-auto\">\n <Shadow>\n <Table>\n <THead>\n <TR>\n <TH isFirstColumn>{t(`prequalificationGroup.Name`)}</TH>\n <TH>{t(`prequalificationGroup.Bidding region`)}</TH>\n <TH>{t(`prequalificationGroup.BRP`)}</TH>\n <TH className={thClassName}>\n {t(`prequalificationGroup.FCR-D-up`)}\n </TH>\n <TH className={thClassName}>\n {t(`prequalificationGroup.FCR-D-down`)}\n </TH>\n <TH className={thClassName}>\n {t(`prequalificationGroup.FCR-N`)}\n </TH>\n <TH className={thClassName}>\n {t(`prequalificationGroup.Approved capacity`)}\n </TH>\n <TH>\n <></>\n </TH>\n </TR>\n </THead>\n <TBody>\n {prequalificationGroups\n .sort((a, b) => (a.id < b.id ? -1 : 1))\n .map((group: PrequalificationGroupDTO) => (\n <TR key={group.id}>\n <TD addLeftMargin>{group.name}</TD>\n <TD>{group.biddingRegion}</TD>\n <TD>{brpLabel(group.brp)}</TD>\n <TD>\n {group.marketApprovalFcrdUp && (\n <CheckCircleIcon className={checkCircleClassName} />\n )}\n </TD>\n <TD>\n {group.marketApprovalFcrdDown && (\n <CheckCircleIcon className={checkCircleClassName} />\n )}\n </TD>\n <TD>\n {group.marketApprovalFcrN && (\n <CheckCircleIcon className={checkCircleClassName} />\n )}\n </TD>\n <TD className=\"whitespace-nowrap px-3 py-4 text-sm text-gray-900 text-right\">\n {group.approvedCapacity}\n <span className=\"text-gray-400\"> kW</span>\n </TD>\n <TD alignRight>\n {\" \"}\n <EditPrequalificationGroup prequalificationGroup={group} />\n </TD>\n </TR>\n ))}\n </TBody>\n </Table>\n </Shadow>\n\n <AddPrequalificationGroup />\n </div>\n );\n};\n","export enum SystemNotificationType {\n ZavannMaintenance = \"Zavann Maintenance\",\n FlowerMaintenance = \"Flower Maintenance\",\n}\n\nexport enum SystemNotificationStatus {\n Upcoming = \"Upcoming\",\n OnGoing = \"Ongoing\",\n Ended = \"Ended\",\n}\n","import { Disclosure, Menu, Transition } from \"@headlessui/react\";\nimport { FC, Fragment } from \"react\";\nimport { MinusIcon, PlusIcon } from \"@heroicons/react/20/solid\";\nimport { Row } from \"@tanstack/react-table\";\nimport { FunnelIcon } from \"@heroicons/react/24/outline\";\n\nexport interface Filter {\n id: string;\n name: string;\n options: string[];\n}\n\ninterface FiltersProps {\n filters: Filter[];\n columnFilters: { id: string; value: string[] }[];\n setColumnFilters: (option: string, column: string) => void;\n}\n\ntype FilterTags<T, K extends keyof T> = {\n data: T[];\n columnName: K;\n firstNestedProperty?: string;\n secondNestedProperty?: string;\n};\n\ntype NestedCombinedFilterTags<T, K extends keyof T> = {\n data: T[];\n firstProperty: string;\n secondProperty: string;\n columnName: K;\n};\n\nconst Filters: FC<FiltersProps> = ({\n filters,\n columnFilters,\n setColumnFilters,\n}) => {\n return (\n <Menu as=\"div\" className=\"relative inline-block text-left\">\n <div>\n <Menu.Button className=\"inline-flex items-center border border-flowerPeach-900 font-medium px-4 py-2 text-sm leading-4 rounded-md shadow-sm text-flowerPeach-900 bg-flowerPeach-500 hover:bg-flowerPeach-900 hover:border-flowerPeach-900 hover:text-white\">\n <FunnelIcon className=\"h-5 w-5 mr-1\" /> Filters\n </Menu.Button>\n </div>\n\n <Transition\n as={Fragment}\n enter=\"transition ease-out duration-100\"\n enterFrom=\"transform opacity-0 scale-95\"\n enterTo=\"transform opacity-100 scale-100\"\n leave=\"transition ease-in duration-75\"\n leaveFrom=\"transform opacity-100 scale-100\"\n leaveTo=\"transform opacity-0 scale-95\"\n >\n <Menu.Items className=\"fixed right-0 z-10 mt-2 w-56 origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none\">\n {filters.map((section: Filter) => {\n const filterStatuses =\n columnFilters.find((f) => f.id === section.id)?.value || [];\n return (\n <Disclosure\n as=\"div\"\n key={section.id}\n className=\"border-gray-200 px-4 py-3\"\n >\n {({ open }) => (\n <>\n <h3 className=\"-mx-2 -my-3 flow-root\">\n <Disclosure.Button className=\"flex w-full items-center justify-between bg-white px-2 py-3 text-gray-400 hover:text-gray-500\">\n <span className=\"text-sm font-medium text-gray-900\">\n {section.name}\n </span>\n <span className=\"ml-6 flex items-center\">\n {open ? (\n <MinusIcon className=\"h-5 w-5\" aria-hidden=\"true\" />\n ) : (\n <PlusIcon className=\"h-5 w-5\" aria-hidden=\"true\" />\n )}\n </span>\n </Disclosure.Button>\n </h3>\n <Disclosure.Panel className=\"pt-6\">\n <div className=\"space-y-6\">\n {section.options.map(\n (option: string, optionIdx: number) => (\n <div key={option} className=\"flex items-center\">\n <input\n id={`filter-${option}-${optionIdx}`}\n type=\"checkbox\"\n checked={filterStatuses.includes(option)}\n className=\"h-4 w-4 rounded border-gray-300 text-sm text-indigo-600 focus:ring-indigo-500 cursor-pointer\"\n onChange={() =>\n setColumnFilters(option, section.id)\n }\n />\n <label\n htmlFor={`filter-${option}-${optionIdx}`}\n className=\"ml-3 min-w-0 flex-1 text-sm text-gray-500 cursor-pointer\"\n >\n {option}\n </label>\n </div>\n ),\n )}\n </div>\n </Disclosure.Panel>\n </>\n )}\n </Disclosure>\n );\n })}\n </Menu.Items>\n </Transition>\n </Menu>\n );\n};\nexport default Filters;\n\nexport function getUniqueFilterTags<T extends object, K extends keyof T>(\n props: FilterTags<T, K>,\n): string[] {\n const { data, columnName, firstNestedProperty, secondNestedProperty } = props;\n const uniqueFilterTags: Set<string> = new Set();\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data.forEach((item: any) => {\n if (item[columnName]) {\n if (firstNestedProperty) {\n if (secondNestedProperty)\n uniqueFilterTags.add(\n item[columnName][firstNestedProperty][secondNestedProperty],\n );\n else uniqueFilterTags.add(item[columnName][firstNestedProperty]);\n } else {\n uniqueFilterTags.add(item[columnName]);\n }\n }\n });\n\n return Array.from(uniqueFilterTags);\n}\n\nexport function getNestedCombinedFilterTags<\n T extends object,\n K extends keyof T,\n>(props: NestedCombinedFilterTags<T, K>): string[] {\n const { data, columnName, firstProperty, secondProperty } = props;\n const uniqueFilterTags: Set<string> = new Set();\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data.forEach((item: any) => {\n if (columnName && item[columnName])\n uniqueFilterTags.add(\n `${item[columnName][firstProperty]} ${item[columnName][secondProperty]}`,\n );\n });\n\n return Array.from(uniqueFilterTags);\n}\n\nexport const filterFunction = <T extends object>(\n row: Row<T>,\n columnId: string,\n filterStatuses: string[],\n) => {\n if (filterStatuses.length === 0) return true;\n const status: string = row.getValue(columnId);\n return filterStatuses.includes(status);\n};\n","import { FC, useState } from \"react\";\nimport Modal from \"components/Modal\";\nimport { useTranslation } from \"react-i18next\";\nimport { TrashIcon } from \"@heroicons/react/24/outline\";\nimport { SystemNotification } from \"api/system-notification/systemNotification.type\";\nimport { useDeleteSystemNotification } from \"api/system-notification/systemNotification.endpoints\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\n\ninterface Props {\n systemNotification: SystemNotification;\n}\n\nexport const DeleteSystemNotification: FC<Props> = ({ systemNotification }) => {\n const { t } = useTranslation();\n\n // state\n const [\n isDeleteSystemNotificationModalOpen,\n setIsDeleteSystemNotificationModalOpen,\n ] = useState<boolean>(false);\n\n // api\n const { mutate: deleteSystemNotification } = useDeleteSystemNotification();\n\n // submit\n const onDeleteSystemNotification = (id: number) =>\n deleteSystemNotification(id);\n\n // modal close\n const onDeleteSystemNotificationModalClose = () => {\n setIsDeleteSystemNotificationModalOpen(false);\n };\n\n const renderDeleteSystemNotificationButton = () => {\n return (\n <TrashIcon\n className=\"h-5 w-5 text-flowerRed-800 hover:text-flowerRed-500\"\n onClick={() => setIsDeleteSystemNotificationModalOpen(true)}\n />\n );\n };\n\n return (\n <>\n {renderDeleteSystemNotificationButton()}\n\n <Modal\n isOpen={isDeleteSystemNotificationModalOpen}\n onClose={onDeleteSystemNotificationModalClose}\n title={t(`systemNotification.Delete system notification`)}\n rightButtonActionHandler={() =>\n onDeleteSystemNotification(systemNotification.id)\n }\n loadingText={t(`systemNotification.Deleting...`)}\n leftButtonAction={onDeleteSystemNotificationModalClose}\n leftButtonText={t(`Close`)}\n >\n <ModalContentWrapper>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n Are you sure that you want to delete {systemNotification.type}{\" \"}\n notification?\n </p>\n </div>\n </ModalContentWrapper>{\" \"}\n </Modal>\n </>\n );\n};\n","import { CreateSystemNotificationDTO } from \"api/system-notification/systemNotification.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { DateTimePicker } from \"components/input/DateTimePicker\";\nimport Dropdown from \"components/input/Dropdown\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { SystemNotificationType } from \"enums/systemNotificationType.enum\";\nimport { FC } from \"react\";\nimport { Control, FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<CreateSystemNotificationDTO>;\n control: Control<CreateSystemNotificationDTO>;\n errors: Partial<\n FieldErrorsImpl<{\n message: string;\n startDate: string;\n endDate: string;\n type: SystemNotificationType;\n }>\n >;\n}\nexport const AddSystemNotificationForm: FC<Props> = ({\n register,\n control,\n errors,\n}) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n {/* Todo : start date end date validation and show error message when start date is greater than end date */}\n <DateTimePicker\n label={t(`systemNotification.Start Date`)}\n name=\"startDate\"\n control={control}\n minDate={new Date()}\n validation={{\n required: t(`systemNotification.Start date is required`),\n validate: (value: string) => value !== \"\",\n }}\n />\n <DateTimePicker\n label={t(`systemNotification.End Date`)}\n name=\"endDate\"\n control={control}\n minDate={new Date()}\n validation={{\n required: t(`systemNotification.End date is required`),\n validate: (value: string) => value !== \"\",\n }}\n />\n <Dropdown\n items={[\n { label: t(`systemNotification.Pick a type`), value: -1 },\n ...Object.values(SystemNotificationType).map((nt) => ({\n label: `${nt}`,\n value: nt,\n })),\n ]}\n name=\"type\"\n label={t(`systemNotification.Type`)}\n register={register}\n validation={{\n validate: (value: string) =>\n +value !== -1 || t(`systemNotification.Select one from the list`),\n }}\n errorMessage={errors?.type?.message}\n />\n <TextArea\n label={t(`systemNotification.Message`)}\n name=\"message\"\n register={register}\n validation={{\n validate: (value: string) =>\n value !== \"\" ||\n t(`systemNotification.Notification Message is required`),\n }}\n errorMessage={errors?.message?.message}\n />\n </ModalContentWrapper>\n );\n};\n","import { SystemNotificationType } from \"enums/systemNotificationType.enum\";\n\nexport type CreateSystemNotificationDTO = {\n message: string;\n startDate: Date;\n endDate: Date;\n type: SystemNotificationType;\n};\n\nexport const getEmptySystemNotificationDTO = () => ({\n message: \"\",\n startDate: undefined,\n endDate: undefined,\n type: undefined,\n});\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { useTranslation } from \"react-i18next\";\nimport { AddSystemNotificationForm } from \"./AddSystemNotificationForm\";\nimport {\n CreateSystemNotificationDTO,\n getEmptySystemNotificationDTO,\n} from \"api/system-notification/systemNotification.dto\";\nimport { useCreateSystemNotification } from \"api/system-notification/systemNotification.endpoints\";\n\ninterface Props {\n centered?: boolean;\n}\n\nexport const AddSystemNotification: FC<Props> = ({ centered = false }) => {\n const { t } = useTranslation();\n\n // state\n const [\n isAddSystemNotificationModalOpen,\n setIsAddSystemNotificationModalOpen,\n ] = useState<boolean>(false);\n\n // api\n const {\n mutate: createSystemNotification,\n isPending: isCreatingSystemNotification,\n isSuccess: isSystemNotificationSuccess,\n } = useCreateSystemNotification();\n\n // form\n const {\n register: registerSystemNotificationModal,\n handleSubmit: handleSystemNotificationModalSubmit,\n reset: resetSystemNotificationModal,\n control,\n formState: { errors: systemNotificationModalErrors },\n } = useForm<CreateSystemNotificationDTO>();\n\n // submit\n const onSystemNotificationModalSubmit = handleSystemNotificationModalSubmit(\n (data: CreateSystemNotificationDTO) =>\n createSystemNotification({\n ...data,\n startDate: new Date(data.startDate),\n endDate: new Date(data.endDate),\n }),\n );\n\n // modal close\n const closeAddSystemNotificationModal = () => {\n setIsAddSystemNotificationModalOpen(false);\n setTimeout(\n () => resetSystemNotificationModal(getEmptySystemNotificationDTO()),\n 300,\n );\n };\n\n // after submit success\n useEffect(() => {\n if (isSystemNotificationSuccess) {\n closeAddSystemNotificationModal();\n }\n }, [isSystemNotificationSuccess]);\n\n const renderAddSystemNotificationButton = () => {\n return (\n <div\n className={`py-4 flex ${centered ? \"justify-center\" : \"justify-end\"}`}\n >\n <SecondaryButton\n onClick={() => setIsAddSystemNotificationModalOpen(true)}\n >\n <PlusCircleIcon className=\"h-5 w-5 mr-1\" />\n {t(`systemNotification.Add system notification`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderAddSystemNotificationButton()}\n\n <Modal\n isOpen={isAddSystemNotificationModalOpen}\n onClose={closeAddSystemNotificationModal}\n leftButtonAction={closeAddSystemNotificationModal}\n leftButtonText={t(`Close`)}\n title={t(`systemNotification.Add system notification`)}\n rightButtonActionHandler={onSystemNotificationModalSubmit}\n isLoading={isCreatingSystemNotification}\n >\n <AddSystemNotificationForm\n register={registerSystemNotificationModal}\n control={control}\n errors={systemNotificationModalErrors}\n />\n </Modal>\n </>\n );\n};\n","import { MagnifyingGlassIcon } from \"@heroicons/react/20/solid\";\nimport useDebounce from \"hooks/useDebounce\";\nimport { FC, useEffect, useState } from \"react\";\n\ninterface Props {\n placeholder?: string;\n onSearch: (value: string) => void;\n initialValue?: string;\n}\nexport const SearchField: FC<Props> = ({\n placeholder,\n onSearch,\n initialValue = \"\",\n}) => {\n const [value, setValue] = useState(initialValue);\n const debouncedSearchValue = useDebounce(value);\n\n useEffect(() => {\n onSearch(debouncedSearchValue);\n }, [debouncedSearchValue]);\n\n return (\n <div className=\"mt-2 mb-2 w-full flex rounded-md shadow-sm max-w-md align-middle\">\n <div className=\"relative flex flex-grow items-stretch focus-within:z-10\">\n <input\n className=\"block w-full rounded-md border-gray-100 pl-5 focus:border-flowerSkyVivid-500 focus:ring-indigo-500 sm:text-sm box py-2\"\n placeholder={placeholder ?? \"\"}\n autoComplete=\"off\"\n type=\"text\"\n onChange={(e) => setValue(e.target.value)}\n value={value}\n />\n <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3\">\n <MagnifyingGlassIcon\n className=\"h-5 w-5 text-gray-400\"\n aria-hidden=\"true\"\n />\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from \"react\";\nimport {\n flexRender,\n getCoreRowModel,\n getFilteredRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\n/* cspell:disable-next-line */\nimport { TableOptions } from \"@tanstack/table-core\";\nimport {\n Table as TableStyle,\n TBody,\n TD,\n TH,\n THead,\n TR,\n} from \"components/table\";\nimport Filters, { Filter } from \"components/filters/Filters\";\nimport { SearchField } from \"components/input/SearchField\";\n\nexport type ColumnFilter = { id: string; value: string[] };\n\ninterface TableProps<T extends object> {\n columns: TableOptions<T>[\"columns\"];\n data: T[];\n filters: Filter[];\n onSelectRow?: (data: T) => void;\n columnVisibility?: Record<string, boolean>;\n}\n\nexport function TanStackTable<T extends { id?: number }>({\n columns,\n data,\n filters,\n onSelectRow,\n columnVisibility,\n}: TableProps<T>): React.ReactElement {\n const [columnFilters, setColumnFilters] = useState<ColumnFilter[]>([]);\n const [globalFilter, setGlobalFilter] = useState(\"\");\n const table = useReactTable({\n data,\n columns,\n state: {\n columnFilters,\n globalFilter,\n columnVisibility,\n },\n enableRowSelection: true,\n onGlobalFilterChange: setGlobalFilter,\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n });\n\n const changeColumnFilter = (option: string, column: string) => {\n setColumnFilters((prev: ColumnFilter[]) => {\n const existingFilter = prev.find((filter) => filter.id === column);\n if (!existingFilter) {\n // If the filter doesn't exist, create a new one\n return [\n ...prev,\n {\n id: column,\n value: [option],\n },\n ];\n } else {\n // If the filter already exists, update its value\n const isActive = existingFilter.value.includes(option);\n const updatedFilter = {\n ...existingFilter,\n value: isActive\n ? existingFilter.value.filter((s: string) => s !== option)\n : [...existingFilter.value, option],\n };\n // Replace the existing filter in the array\n return prev.map((f) => (f.id === column ? updatedFilter : f));\n }\n });\n };\n\n return (\n <div className=\"lg:block min-h-20\">\n <div className=\"lg:flex lg:items-center space-x-4 w-full justify-end\">\n <SearchField onSearch={(value) => setGlobalFilter(value)} />\n {filters.length > 0 && (\n <Filters\n filters={filters}\n columnFilters={columnFilters}\n setColumnFilters={changeColumnFilter}\n />\n )}\n </div>\n\n <div className=\"lg:block\">\n <TableStyle>\n <THead>\n {table.getHeaderGroups().map((headerGroup) => (\n <TR key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TH key={header.id}>\n {header.column.columnDef.header as string}\n </TH>\n ))}\n </TR>\n ))}\n </THead>\n <TBody>\n {table.getRowModel().rows.map((row) => (\n <TR\n key={row.id}\n onClick={\n onSelectRow\n ? () => onSelectRow && onSelectRow(row.original)\n : undefined\n }\n >\n {row.getVisibleCells().map((cell) => (\n <TD key={cell.id}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TD>\n ))}\n </TR>\n ))}\n </TBody>\n </TableStyle>\n </div>\n </div>\n );\n}\n","import { useMemo } from \"react\";\n/* cspell:disable-next-line */\nimport { TableOptions } from \"@tanstack/react-table\";\nimport { Badge, BadgeColor } from \"components/tags/Badge\";\nimport { SystemNotificationStatus } from \"enums/systemNotificationType.enum\";\nimport {\n Filter,\n filterFunction,\n getUniqueFilterTags,\n} from \"components/filters/Filters\";\nimport { SystemNotification } from \"api/system-notification/systemNotification.type\";\nimport { useSystemNotifications } from \"api/system-notification/systemNotification.endpoints\";\nimport { DeleteSystemNotification } from \"./DeleteSystemNotification\";\nimport { AddSystemNotification } from \"./AddSystemNotification\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { isEmptyArray } from \"helpers/array\";\nimport { useTranslation } from \"react-i18next\";\nimport { BellAlertIcon } from \"@heroicons/react/24/outline\";\nimport { TanStackTable } from \"../table/TanStackTable\";\n\nexport const SystemNotificationList = () => {\n const { t } = useTranslation();\n\n const {\n data: systemNotifications,\n isLoading,\n isError,\n } = useSystemNotifications();\n\n const columns: TableOptions<SystemNotification>[\"columns\"] = useMemo(\n () => [\n {\n header: t(`systemNotification.Type`),\n accessorKey: \"type\",\n filterFn: \"includesString\",\n },\n {\n header: t(`systemNotification.Start Date`),\n accessorKey: \"startDate\",\n accessorFn: (row: SystemNotification) =>\n `${new Date(row.startDate).toLocaleString()}`,\n },\n {\n header: t(`systemNotification.End Date`),\n accessorKey: \"endDate\",\n accessorFn: (row: SystemNotification) =>\n `${new Date(row.endDate).toLocaleString()}`,\n },\n {\n accessorKey: \"message\",\n header: t(`systemNotification.Message`),\n filterFn: \"includesString\",\n },\n {\n header: t(`systemNotification.Status`),\n accessorKey: \"status\",\n cell: (row) => (\n <Badge text={row.getValue()} color={getColor(row.getValue())} />\n ),\n filterFn: filterFunction,\n enableColumnFilter: true,\n },\n {\n header: t(`systemNotification.Action`),\n accessorKey: \"action\",\n cell: (row) => (\n <DeleteSystemNotification systemNotification={row.row.original} />\n ),\n },\n ],\n [systemNotifications],\n );\n\n const filters: Filter[] = [\n {\n id: \"status\",\n name: t(`systemNotification.Status`),\n options: getUniqueFilterTags({\n data: systemNotifications || [],\n columnName: \"status\",\n }),\n },\n ];\n\n if (isLoading || isError || systemNotifications === undefined) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError || systemNotifications === undefined}\n isLoading={isLoading}\n isEmpty={false}\n icon={<BellAlertIcon />}\n errorMessage={t(`systemNotification.Error`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n if (isEmptyArray(systemNotifications)) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={isEmptyArray(systemNotifications)}\n icon={<BellAlertIcon />}\n emptyDataMessage={t(`systemNotification.Empty`)}\n />\n <AddSystemNotification centered={true} />\n </div>\n );\n }\n\n return (\n <div className=\"overflow-auto\">\n <div className=\"overflow-hidden md:rounded-lg shadow\">\n <TanStackTable\n columns={columns}\n data={systemNotifications}\n filters={filters}\n />\n </div>\n <AddSystemNotification />\n </div>\n );\n};\n\nconst getColor = (status: SystemNotificationStatus): BadgeColor => {\n switch (status) {\n case SystemNotificationStatus.OnGoing:\n return \"blue\";\n case SystemNotificationStatus.Upcoming:\n return \"yellow\";\n case SystemNotificationStatus.Ended:\n return \"green\";\n default:\n return \"gray\";\n }\n};\n","import { TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\n\nimport { AssetModelList } from \"../../../components/assetModel-old/AssetModelList\";\nimport { PrequalificationGroups } from \"../../../components/prequalificationGroup/PrequalificationGroups\";\nimport { SystemNotificationList } from \"../../../components/systemNotification/SystemNotificationList\";\nimport { useTranslation } from \"react-i18next\";\nimport TabContainer from \"../../../components/tab/TabContainer\";\n\nconst PREQUALIFICATION_GROUP_TAB = \"prequalification-groups\";\nconst ASSET_MODELS_TAB = \"asset-models\";\nconst SYSTEM_NOTIFICATION_TAB = \"system-notification\";\n\nexport const FlowerSettingsPage = () => {\n const { t } = useTranslation();\n\n // Tab\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs(getBreadCrumbs());\n }, []);\n\n const currentTab = searchParams.get(\"tab\") || PREQUALIFICATION_GROUP_TAB;\n\n return (\n <TabPageWrapper\n tabs={[\n {\n param: PREQUALIFICATION_GROUP_TAB,\n label: t(`prequalificationGroup.Title`),\n content: (\n <TabContainer key={PREQUALIFICATION_GROUP_TAB}>\n <PrequalificationGroups />\n </TabContainer>\n ),\n isSelected: currentTab === PREQUALIFICATION_GROUP_TAB,\n },\n {\n param: ASSET_MODELS_TAB,\n label: t(`assetModel.Title`),\n content: (\n <TabContainer key={ASSET_MODELS_TAB}>\n <AssetModelList />\n </TabContainer>\n ),\n isSelected: currentTab === ASSET_MODELS_TAB,\n },\n {\n param: SYSTEM_NOTIFICATION_TAB,\n label: t(`systemNotification.Title`),\n content: (\n <TabContainer key={SYSTEM_NOTIFICATION_TAB}>\n <SystemNotificationList />\n </TabContainer>\n ),\n isSelected: currentTab === SYSTEM_NOTIFICATION_TAB,\n },\n ]}\n setTab={setTab}\n />\n );\n};\n\nconst getBreadCrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.Settings,\n to: `${RouteUrl.App}/${RouteUrl.Settings}`,\n },\n];\n","import { UserIcon } from \"@heroicons/react/24/outline\";\nimport { TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport { useDistributor } from \"api/distributor/distributor.endpoints\";\nimport userStore, {\n getDistributorId,\n getUserId,\n getUserRole,\n} from \"store/user.store\";\n\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { DistributorAccountDetails } from \"components/distributor/DistributorAccountDetails\";\nimport { DistributorUsersTab } from \"components/distributor/DistributorUsersTab\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport TabContainer from \"../../../components/tab/TabContainer\";\n\nconst GENERAL_TAB = \"general\";\nconst USERS_TAB = \"users\";\n\nexport const DistributorOrganizationPage = () => {\n const { t } = useTranslation();\n\n const userRole = userStore(getUserRole);\n const loggedInUserId = userStore(getUserId) || -1;\n const distributorId = userStore(getDistributorId) || -1;\n\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n\n const currentTab = searchParams.get(\"tab\") || GENERAL_TAB;\n\n /**\n * Breadcrumbs\n */\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs([getOrganizationBreadcrumb()]);\n }, []);\n\n /**\n * Get distributor\n */\n const {\n data: distributor,\n isLoading,\n isError,\n } = useDistributor(distributorId);\n\n if (isLoading || isError || !distributor) {\n return (\n <CustomPlaceholder\n isEmpty={!isLoading && !isError && !distributor}\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`distributor.Error`)}\n emptyDataMessage={t(`distributor.Empty`)}\n loaderSize=\"page\"\n />\n );\n }\n\n return (\n <TabPageWrapper\n tabs={[\n {\n param: GENERAL_TAB,\n label: t(\"distributor.OrganizationTitle\"),\n content: (\n <TabContainer key={GENERAL_TAB}>\n <DistributorAccountDetails\n distributor={distributor}\n userRole={userRole}\n />\n </TabContainer>\n ),\n isSelected: currentTab === GENERAL_TAB,\n },\n {\n param: USERS_TAB,\n label: t(\"distributor.UsersTitle\"),\n content: (\n <TabContainer key={USERS_TAB}>\n <DistributorUsersTab\n distributorId={distributor.id}\n userRole={userRole}\n userId={loggedInUserId}\n />\n </TabContainer>\n ),\n isSelected: currentTab === USERS_TAB,\n },\n ]}\n setTab={setTab}\n />\n );\n};\n\nconst getOrganizationBreadcrumb = (): BreadCrumb => ({\n label: RouteLabel.Organization,\n to: `${RouteUrl.App}/${RouteUrl.Organization}`,\n});\n","import { AccountDetails } from \"components/assetOwner/AccountDetails\";\nimport { PageWrapperSmall } from \"components/PageWrapper\";\nimport { useEffect } from \"react\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport userStore, { getAssetOwnerId, getUserRole } from \"store/user.store\";\n\nexport const ProfilePage = () => {\n const userRole = userStore(getUserRole);\n\n /**\n * Breadcrumbs\n */\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n setBreadCrumbs(getBreadcrumbs());\n }, []);\n\n /**\n * Get asset owner\n */\n const assetOwnerId = userStore(getAssetOwnerId) || -1;\n\n return (\n <PageWrapperSmall>\n <AccountDetails assetOwnerId={assetOwnerId} userRole={userRole} />\n </PageWrapperSmall>\n );\n};\n\nconst getBreadcrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.Profile,\n to: `${RouteUrl.App}/${RouteUrl.Profile}`,\n },\n];\n","import { useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { menuStore } from \"store/menu.store\";\nimport { FlowerHubLogo } from \"styles/Icons\";\n\nexport const NotFoundPage = () => {\n const { t } = useTranslation();\n\n /**\n * Breadcrumbs\n */\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n setBreadCrumbs([]);\n }, []);\n\n return (\n <div className=\"flex flex-col min-h-full py-14 sm:py-14 space-y-4 sm:space-y-8\">\n <img className=\"h-16 w-auto h-auto\" src={FlowerHubLogo} />\n\n <main className=\"sm:flex\">\n <p className=\"text-4xl font-bold tracking-tight sm:text-5xl text-gray-700\">\n {t(\"notFound.404\")}\n </p>\n <div className=\"sm:ml-6\">\n <div className=\"sm:border-l sm:border-gray-200 sm:pl-6\">\n <h1 className=\"text-4xl font-bold tracking-tight text-gray-700 sm:text-5xl\">\n {t(\"notFound.Page not found\")}\n </h1>\n <p className=\"mt-1 text-base text-gray-500\">\n {t(\n \"notFound.Please check the URL in the address bar and try again.\",\n )}\n </p>\n </div>\n <div className=\"mt-10 flex space-x-3 sm:border-l sm:border-transparent sm:pl-6\"></div>\n </div>\n </main>\n </div>\n );\n};\n","import { HandRaisedIcon } from \"@heroicons/react/24/outline\";\nimport { PageWrapper } from \"components/PageWrapper\";\nimport React, { useEffect } from \"react\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\n\n// useManualAction endpoint commented because we are not currently using it, please uncomment the code accordingly when you gonna use it.\nexport const ManualActionPage = () => {\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs(getBreadCrumbs());\n }, []);\n // const [manualActionInput, setManualActionInput] = useState(\"\");\n // const {\n // data: manualAction,\n // isLoading,\n // isError,\n // } = useManualAction(manualActionInput, { enabled: !!manualActionInput });\n\n // const { register, handleSubmit } = useForm<{ tableName: string }>();\n\n // const onSubmit = handleSubmit((data) => {\n // setManualActionInput(data.tableName);\n // });\n\n return (\n <PageWrapper>\n <div>\n <div className=\"my-8 text-m text-gray-600\">\n <p>\n We only have this page as a way to trigger functionality, such as\n logging something we need, if we have no other means of doing it.\n </p>\n <p className=\"mt-2\">\n A developer needs to update this page and the related backend to\n make something happen.\n </p>\n </div>\n {/* <div>\n <TextInput\n label=\"Write the name of the manual action you want to do\"\n name=\"tableName\"\n register={register}\n size=\"third\"\n />\n <PrimaryButton\n type=\"button\"\n className=\"mt-2 rounded-md border border-transparent shadow-sm px-4 py-2 bg-flowerSky-500 text-base font-medium text-white hover:bg-flowerSky-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-flowerSky-300 sm:col-start-2 sm:text-sm\"\n onClick={onSubmit}\n size=\"small\"\n >\n Perform action\n </PrimaryButton>\n </div> */}\n <div className=\"text-center my-8 text-m text-gray-600\">\n <HandRaisedIcon className=\"mx-auto my-3 h-20 w-20 text-flowerSky-500\" />\n {/* <p>\n {manualAction &&\n manualActionInput &&\n `Visit Cloudwatch or relevant service for result of manual action ${manualActionInput}`}\n </p>\n <p>{isLoading && `Loading...`}</p>\n <p>{isError && `Error performing ${manualActionInput}`}</p> */}\n </div>\n </div>\n </PageWrapper>\n );\n};\n\nconst getBreadCrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.ManualAction,\n to: `${RouteUrl.App}/${RouteUrl.ManualAction}`,\n },\n];\n","import { FC } from \"react\";\nimport { ChildrenProps } from \"types/childrenProps.type\";\n\nexport const Centered: FC<ChildrenProps> = ({ children }) => (\n <div className=\"min-h-full flex flex-col justify-center py-12 px-4 sm:px-6 lg:px-8\">\n <div className=\"sm:mx-auto sm:w-full sm:max-w-md\">{children}</div>\n </div>\n);\n","import { SystemNotification } from \"api/system-notification/systemNotification.type\";\nimport { FlowerHubLogo } from \"styles/Icons\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n maintenance?: SystemNotification;\n}\nexport const Maintenance: FC<Props> = ({ maintenance }) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"min-h-full pl-8 py-14 sm:py-14 space-y-4 sm:space-y-8\">\n <img className=\"h-16 w-auto h-auto\" src={FlowerHubLogo} />\n\n <main className=\"sm:flex\">\n <div className=\"flex-shrink-0\">\n <svg\n className=\"mx-auto h-12 w-12 text-red-400\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z\"\n />\n </svg>\n </div>\n <div className=\"sm:ml-6\">\n <div className=\"sm:border-l sm:border-gray-200 sm:pl-6\">\n <h1 className=\"text-4xl font-bold tracking-tight text-gray-700 sm:text-5xl\">\n {t(\"maintenance.title\")}\n </h1>\n <p className=\"mt-1 text-base text-gray-500\">\n {maintenance?.message}\n </p>\n </div>\n <div className=\"mt-10 flex space-x-3 sm:border-l sm:border-transparent sm:pl-6\"></div>\n </div>\n </main>\n </div>\n );\n};\n","import { PageWrapper } from \"components/PageWrapper\";\nimport { useEffect } from \"react\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport userStore, { getAssetOwnerId } from \"store/user.store\";\nimport { Invoices } from \"../../../components/invoices/Invoices\";\nimport { useActiveZavannSystemNotifications } from \"api/system-notification/systemNotification.endpoints\";\nimport { SystemNotificationInfo } from \"components/systemNotification/SystemNotificationInfo\";\n\nexport const InvoicesPage = () => {\n const assetOwnerId = userStore(getAssetOwnerId) || -1;\n\n //Get active zavann system notifications\n const { data: systemNotification } = useActiveZavannSystemNotifications();\n\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n setBreadCrumbs(getBreadcrumbs());\n }, []);\n\n if (systemNotification) {\n return <SystemNotificationInfo notification={systemNotification} />;\n }\n\n return (\n <PageWrapper>\n <Invoices assetOwnerId={assetOwnerId} loaderSize=\"page\" />\n </PageWrapper>\n );\n};\n\nconst getBreadcrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.Invoices,\n to: `${RouteUrl.App}/${RouteUrl.InvoiceList}`,\n },\n];\n","import { useAssetOwner } from \"api/assetOwner/assetOwner.endpoints\";\nimport { TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport userStore, { getAssetOwnerId } from \"store/user.store\";\nimport { Consumption } from \"../../../components/consumption/Consumption\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { FlowerRevenue } from \"components/flowerRevenue/FlowerRevenue\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { useActiveZavannSystemNotifications } from \"api/system-notification/systemNotification.endpoints\";\nimport TabContainer from \"components/tab/TabContainer\";\nimport { SystemNotificationInfo } from \"components/systemNotification/SystemNotificationInfo\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\n\nconst OVERVIEW_TAB = \"overview\";\nconst FLOWER_REVENUE = \"flower-revenue\";\n\nexport const ConsumptionAndRevenuePage = () => {\n const { t } = useTranslation();\n\n const { setBreadCrumbs } = menuStore();\n\n const getBreadcrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.ConsumptionAndRevenue,\n to: `${RouteUrl.App}/${RouteUrl.Profile}`,\n },\n ];\n\n useEffect(() => {\n setBreadCrumbs(getBreadcrumbs());\n }, []);\n\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n\n const currentTab = searchParams.get(\"tab\") || OVERVIEW_TAB;\n\n const assetOwnerId = userStore(getAssetOwnerId) || -1;\n\n // asset owner\n const {\n data: assetOwner,\n isLoading,\n isError,\n } = useAssetOwner(assetOwnerId ?? -1);\n\n //Get active zavann system notifications\n const { data: systemNotification } = useActiveZavannSystemNotifications();\n\n if (isLoading || isError || !assetOwner) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && !assetOwner}\n icon={<UserIcon />}\n errorMessage={t(`consumptionAndRevenue.assetOwnerNotFound`)}\n emptyDataMessage={t(`consumptionAndRevenue.assetOwnerNotFound`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n return (\n <TabPageWrapper\n tabs={[\n {\n param: OVERVIEW_TAB,\n label: t(`consumptionAndRevenue.Overview`),\n content: (\n <TabContainer key={OVERVIEW_TAB}>\n {systemNotification ? (\n <SystemNotificationInfo notification={systemNotification} />\n ) : (\n <Consumption\n assetOwnerId={+assetOwnerId}\n hasSystemNotification={!!systemNotification}\n />\n )}\n </TabContainer>\n ),\n isSelected: currentTab === OVERVIEW_TAB,\n },\n {\n param: FLOWER_REVENUE,\n label: t(`consumptionAndRevenue.Revenue calculation`),\n content: (\n <TabContainer key={FLOWER_REVENUE}>\n <FlowerRevenue\n assetId={assetOwner.asset?.id}\n bessCompensationStartDate={\n assetOwner?.bessCompensationStartDate\n }\n />\n </TabContainer>\n ),\n isSelected: currentTab === FLOWER_REVENUE,\n },\n ]}\n setTab={setTab}\n />\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport { useAsset } from \"../../api/asset/asset.endpoints\";\nimport { Battery0Icon } from \"@heroicons/react/24/outline\";\nimport { EditAsset } from \"./EditAsset\";\nimport { Role } from \"enums/role.enum\";\nimport { Shadow } from \"../Shadow\";\nimport { BatteryDetails } from \"./BatteryDetails\";\n\ninterface Props {\n userRole: Role;\n assetOwnerId?: number;\n assetId?: number;\n showEditAsset?: boolean;\n}\n\nexport const BatteryTab: FC<Props> = ({\n userRole,\n assetOwnerId,\n assetId,\n showEditAsset = false,\n}) => {\n const { t } = useTranslation();\n\n // Get asset\n const {\n data: asset,\n isLoading: isLoadingAsset,\n isError: isErrorAsset,\n } = useAsset(assetId);\n\n const renderPlaceholder = () => (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isErrorAsset}\n isLoading={isLoadingAsset}\n isEmpty={!isLoadingAsset && !isErrorAsset && !asset}\n icon={<Battery0Icon />}\n errorMessage={t(`batteryOverview.UnableToFetchTheBattery`)}\n emptyDataMessage={t(`batteryOverview.NoBattery`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n\n if (isLoadingAsset || !asset || isErrorAsset) {\n return renderPlaceholder();\n }\n\n return (\n <div className=\"overflow-auto\">\n <Shadow>\n <BatteryDetails userRole={userRole} asset={asset} />\n </Shadow>\n\n {showEditAsset && <EditAsset assetOwnerId={assetOwnerId} asset={asset} />}\n </div>\n );\n};\n","import { useAssetOwnerWithAssetId } from \"api/assetOwner/assetOwner.endpoints\";\nimport { PageWrapperSmall } from \"components/PageWrapper\";\nimport { useEffect } from \"react\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport userStore, { getAssetOwnerId } from \"store/user.store\";\nimport { Role } from \"enums/role.enum\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { Battery0Icon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { BatteryTab } from \"../../../components/battery/BatteryTab\";\n\nexport const BatteryPage = () => {\n const { t } = useTranslation();\n\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n setBreadCrumbs(getBreadcrumbs());\n }, []);\n\n const assetOwnerId = userStore(getAssetOwnerId) ?? -1;\n\n const {\n data: assetOwnerWithAssetId,\n isLoading,\n isError,\n } = useAssetOwnerWithAssetId(assetOwnerId);\n\n if (isLoading || isError || !assetOwnerWithAssetId?.assetId) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={!isLoading && !isError && !assetOwnerWithAssetId?.assetId}\n icon={<Battery0Icon />}\n errorMessage={t(`batteryOverview.UnableToFetchTheBattery`)}\n emptyDataMessage={t(`batteryOverview.NoBattery`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n return (\n <PageWrapperSmall>\n <BatteryTab\n userRole={Role.AssetOwner}\n assetId={assetOwnerWithAssetId.assetId}\n />\n </PageWrapperSmall>\n );\n};\n\nconst getBreadcrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.Battery,\n to: `${RouteUrl.App}/${RouteUrl.Battery}`,\n },\n];\n","interface Props {\n children: React.ReactNode;\n}\nexport const PanelRow = ({ children }: Props) => (\n <div className=\"lg:grid lg:grid-cols-2 lg:gap-6\">{children}</div>\n);\n","import {\n getStatusStyle,\n getZavannInvoiceStatusName,\n} from \"enums/zavannInvoiceStatus.enum\";\nimport { classNames } from \"helpers/classNames\";\nimport { GetInvoiceItemResponseDTO } from \"types/invoice.type\";\nimport { FC } from \"react\";\nimport { formatDate } from \"helpers/date\";\nimport { FlowerLink } from \"components/FlowerLink\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { Link } from \"components/Link\";\nimport { isAfter } from \"date-fns\";\nimport { isEmptyArray } from \"helpers/array\";\nimport { Label } from \"../descriptionList\";\nimport { useTranslation } from \"react-i18next\";\nimport { useInvoices } from \"api/assetOwner/assetOwner.endpoints\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { DocumentTextIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n assetOwnerId: number;\n}\nexport const LatestInvoices: FC<Props> = ({ assetOwnerId }) => {\n const { t } = useTranslation();\n\n // Get invoices\n const {\n data: invoices,\n isLoading: isLoadingInvoices,\n isError: isErrorInvoices,\n } = useInvoices(assetOwnerId);\n\n if (isLoadingInvoices || isErrorInvoices || isEmptyArray(invoices)) {\n return (\n <div className=\"py-8\">\n <CustomPlaceholder\n isError={isErrorInvoices}\n isLoading={isLoadingInvoices}\n isEmpty={!isLoadingInvoices && !isErrorInvoices}\n icon={<DocumentTextIcon />}\n errorMessage={t(`subHeader.errorFetchingInvoices`)}\n emptyDataMessage={t(`subHeader.noInvoicesFU`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"px-2 sm:px:0\">\n <div className=\"inline-block min-w-full align-middle py-4 sm:py-5 sm:px-6\">\n <Label>Latest invoices</Label>\n <div className=\"overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg mt-4 sm:mt-5\">\n <table className=\"min-w-full divide-y divide-gray-300\">\n <tbody>\n {getLatestInvoices(invoices).map(\n (invoice: GetInvoiceItemResponseDTO) => (\n <tr key={invoice.id}>\n <td className=\"whitespace-nowrap px-2 py-2 text-sm text-gray-500\">\n {formatDate(invoice.due_date)}\n </td>\n <td className=\"whitespace-nowrap px-2 py-2 text-sm text-gray-900\">\n {`${invoice.total_amount} kr`}\n </td>\n <td className=\"whitespace-nowrap px-2 py-2 text-sm text-gray-500\">\n <span\n className={classNames(\n getStatusStyle(invoice.invoice_status_id),\n \"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium\",\n )}\n >\n {getZavannInvoiceStatusName(invoice.invoice_status_id)}\n </span>\n </td>\n <td className=\"relative whitespace-nowrap py-2 pl-3 pr-4 text-right text-sm font-medium sm:pr-6\">\n <Link\n href={invoice.invoice_pdf}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n View\n <span className=\"sr-only\">, {invoice.id}</span>\n </Link>\n </td>\n </tr>\n ),\n )}\n </tbody>\n </table>\n </div>\n </div>\n <div className=\"flex sm:px-6 mb-4\">\n <FlowerLink to={`${RouteUrl.App}/${RouteUrl.InvoiceList}`}>\n See all invoices\n <span aria-hidden=\"true\"> →</span>\n </FlowerLink>\n </div>\n </div>\n );\n};\n\nconst getLatestInvoices = (\n invoices: GetInvoiceItemResponseDTO[] = [],\n maxCount = 3,\n): GetInvoiceItemResponseDTO[] =>\n invoices\n .sort((a, b) =>\n isAfter(new Date(a.invoice_date), new Date(b.invoice_date)) ? -1 : 1,\n )\n .slice(0, maxCount);\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { formatDate } from \"../../helpers/date\";\nimport { SiteForElectricityAgreementDTO } from \"../../api/assetOwner/assetOwner.dto\";\nimport { Item, Label, List } from \"components/descriptionList\";\nimport { ElectricityAgreementTag } from \"../tags/ElectricityAgreementTag\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { useAssetOwnerElectricityAgreement } from \"api/assetOwner/assetOwner.endpoints\";\nimport { DocumentTextIcon } from \"@heroicons/react/24/outline\";\nimport { LatestInvoices } from \"../invoices/LatestInvoices\";\n\ninterface Props {\n assetOwnerId: number;\n}\n\nexport const ElectricityAgreement: FC<Props> = ({ assetOwnerId }) => {\n const { t } = useTranslation();\n\n // Get electricity agreement\n const {\n data: electricityAgreement,\n isLoading: isLoadingElectricityAgreement,\n isError: isErrorElectricityAgreement,\n } = useAssetOwnerElectricityAgreement(assetOwnerId);\n\n const renderElectricityAgreementPlaceholder = () => (\n <div className=\"sm:divide-y sm:divide-gray-50 bg-white rounded-md my-8\">\n <CustomPlaceholder\n isError={isErrorElectricityAgreement}\n isLoading={isLoadingElectricityAgreement}\n isEmpty={\n !isLoadingElectricityAgreement &&\n !isErrorElectricityAgreement &&\n !electricityAgreement\n }\n icon={<DocumentTextIcon />}\n errorMessage={t(\n `electricityAgreement.UnableToFetchElectricityAgreement`,\n )}\n emptyDataMessage={t(`electricityAgreement.NoElectricityAgreement`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n\n if (\n isLoadingElectricityAgreement ||\n !electricityAgreement ||\n isErrorElectricityAgreement\n ) {\n return renderElectricityAgreementPlaceholder();\n }\n\n return (\n <div className=\"sm:divide-y sm:divide-gray-50 bg-white rounded-md\">\n <List>\n {electricityAgreement.consumption && (\n <AgreementItem\n label={t(`electricityAgreement.Consumption`)}\n agreement={electricityAgreement.consumption}\n />\n )}\n {electricityAgreement.production && (\n <AgreementItem\n label={t(`electricityAgreement.Production`)}\n agreement={electricityAgreement.production}\n />\n )}\n </List>\n <LatestInvoices assetOwnerId={assetOwnerId} />\n </div>\n );\n};\n\ninterface AgreementItemProp {\n label: string;\n agreement: SiteForElectricityAgreementDTO;\n}\n\nconst AgreementItem = ({ label, agreement }: AgreementItemProp) => {\n return (\n <Item className=\"relative\">\n <div className=\"mt-1 text-base sm:mt-0 text-gray-900 flex justify-between items-center\">\n <Label>{label}</Label>\n </div>\n <div className=\"flex justify-start align-middle items-center text-sm\">\n <ElectricityAgreementTag\n stateCategory={agreement.stateCategory}\n stateId={agreement.stateId}\n stateReasonId={agreement.stateReasonId}\n />\n </div>\n <div className=\"mt-1 text-base text-gray-900 sm:mt-0\">\n {agreement.startDate && (\n <DateItem\n label=\"electricityAgreement.Start\"\n date={agreement.startDate}\n />\n )}\n {agreement.terminationDate && (\n <DateItem\n label=\"electricityAgreement.End\"\n date={agreement.terminationDate}\n />\n )}\n </div>\n </Item>\n );\n};\n\ninterface DateItemProp {\n label: string;\n date: Date;\n}\n\nconst DateItem = ({ label, date }: DateItemProp) => {\n const { t } = useTranslation();\n\n return (\n <div className=\"flex justify-between md:justify-end align-middle items-center text-sm\">\n <span className=\"font-medium text-gray-500\">{`${t(label)}:`}</span>\n <span className=\"ml-4\">{formatDate(date)}</span>\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport { useAsset } from \"../../api/asset/asset.endpoints\";\nimport { Battery0Icon } from \"@heroicons/react/24/outline\";\nimport { Role } from \"enums/role.enum\";\nimport { BatteryDetails } from \"./BatteryDetails\";\n\ninterface Props {\n userRole: Role;\n assetOwnerId?: number;\n assetId?: number;\n showEditAsset?: boolean;\n}\n\nexport const Battery: FC<Props> = ({ userRole, assetId }) => {\n const { t } = useTranslation();\n\n // Get asset\n const {\n data: asset,\n isLoading: isLoadingAsset,\n isError: isErrorAsset,\n } = useAsset(assetId);\n\n const renderPlaceholder = () => (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isErrorAsset}\n isLoading={isLoadingAsset}\n isEmpty={!isLoadingAsset && !isErrorAsset && !asset}\n icon={<Battery0Icon />}\n errorMessage={t(`batteryOverview.UnableToFetchTheBattery`)}\n emptyDataMessage={t(`batteryOverview.NoBattery`)}\n loaderSize=\"medium\"\n />\n </div>\n );\n\n if (isLoadingAsset || !asset || isErrorAsset) {\n return renderPlaceholder();\n }\n\n return <BatteryDetails userRole={userRole} asset={asset} />;\n};\n","import { Consumption } from \"../../../components/consumption/Consumption\";\nimport { ScaleUp, SmoothUp } from \"components/animations/SnapUp\";\nimport userStore, { getAssetOwnerId, getUserRole } from \"store/user.store\";\nimport { useAssetOwnerWithAssetId } from \"api/assetOwner/assetOwner.endpoints\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { PanelRow } from \"components/PanelRow\";\nimport { useEffect } from \"react\";\nimport { SystemNotificationInfo } from \"components/systemNotification/SystemNotificationInfo\";\nimport { useActiveZavannSystemNotifications } from \"api/system-notification/systemNotification.endpoints\";\nimport { Panel } from \"../../../components/Panel\";\nimport { ElectricityAgreement } from \"../../../components/electricityAgreement/ElectricityAgreement\";\nimport { useTranslation } from \"react-i18next\";\nimport { DashboardGreetingHeader } from \"components/shared/DashboardGreetingHeader\";\nimport { Battery } from \"../../../components/battery/Battery\";\n\nexport const AssetOwnerDashboardPage = () => {\n const { t } = useTranslation();\n\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n\n useEffect(() => {\n setBreadCrumbs([getAssetOwnerDashboardPageBreadcrumb()]);\n }, []);\n\n const userRole = userStore(getUserRole);\n\n const assetOwnerId = userStore(getAssetOwnerId) || -1;\n\n // Get Asset owner\n const { data: assetOwner, isLoading: isLoadingAssetOwner } =\n useAssetOwnerWithAssetId(+assetOwnerId);\n\n // Get active zavann system notifications\n const { data: systemNotification } = useActiveZavannSystemNotifications();\n\n return (\n <SmoothUp>\n <DashboardGreetingHeader name={assetOwner?.firstName ?? \"\"} />\n <PanelRow>\n <Panel\n header={t(`batteryOverview.Title`)}\n isLoading={isLoadingAssetOwner}\n >\n <Battery assetId={assetOwner?.assetId} userRole={userRole} />\n </Panel>\n\n <Panel\n header={t(`electricityAgreement.Title`)}\n isLoading={isLoadingAssetOwner}\n >\n {systemNotification ? (\n <SystemNotificationInfo notification={systemNotification} />\n ) : (\n <ElectricityAgreement assetOwnerId={+assetOwnerId} />\n )}\n </Panel>\n </PanelRow>\n <Panel\n header={t(`consumptionAndRevenue.title`)}\n isLoading={isLoadingAssetOwner}\n >\n <ScaleUp>\n <Consumption\n assetOwnerId={+assetOwnerId}\n hasSystemNotification={!!systemNotification}\n hasShadow={false}\n />\n </ScaleUp>\n </Panel>\n </SmoothUp>\n );\n};\n\nexport const getAssetOwnerDashboardPageBreadcrumb = (): BreadCrumb => ({\n label: RouteLabel.Dashboard,\n to: `${RouteUrl.App}/${RouteUrl.Dashboard}`,\n});\n","import { TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\nimport userStore, {\n getInstallerId,\n getUserId,\n getUserRole,\n} from \"store/user.store\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { useInstaller } from \"api/installer/installer.endpoints\";\n\nimport { InstallerUsersTab } from \"components/installer/InstallerUsersTab\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { UserIcon } from \"@heroicons/react/20/solid\";\nimport { useTranslation } from \"react-i18next\";\nimport { InstallerAccountDetails } from \"components/installer/InstallerAccountDetails\";\nimport TabContainer from \"../../../components/tab/TabContainer\";\n\nconst GENERAL_TAB = \"general\";\nconst USERS_TAB = \"users\";\n\nexport const InstallerOrganizationPage = () => {\n const { t } = useTranslation();\n\n const userRole = userStore(getUserRole);\n const loggedInUserId = userStore(getUserId) || -1;\n const installerId = userStore(getInstallerId) || -1;\n\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n\n const currentTab = searchParams.get(\"tab\") || GENERAL_TAB;\n\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs([getOrganizationBreadcrumb()]);\n }, []);\n\n // Get installer\n const { data: installer, isLoading, isError } = useInstaller(installerId);\n\n if (isLoading || isError || !installer) {\n return (\n <CustomPlaceholder\n isEmpty={!isLoading && !isError && !installer}\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`installer.Error`)}\n emptyDataMessage={t(`installer.Empty`)}\n loaderSize=\"page\"\n />\n );\n }\n\n return (\n <TabPageWrapper\n tabs={[\n {\n param: GENERAL_TAB,\n label: t(\"installer.OrganizationTitle\"),\n content: (\n <TabContainer key={GENERAL_TAB}>\n <InstallerAccountDetails\n installer={installer}\n userRole={userRole}\n />\n </TabContainer>\n ),\n isSelected: currentTab === GENERAL_TAB,\n },\n {\n param: USERS_TAB,\n label: t(\"installer.UsersTitle\"),\n content: (\n <TabContainer key={USERS_TAB}>\n <InstallerUsersTab\n installerId={installer.id}\n userRole={userRole}\n userId={loggedInUserId}\n />\n </TabContainer>\n ),\n isSelected: currentTab === USERS_TAB,\n },\n ]}\n setTab={setTab}\n />\n );\n};\n\nexport const getOrganizationBreadcrumb = (): BreadCrumb => ({\n label: RouteLabel.Organization,\n to: `${RouteUrl.App}/${RouteUrl.Organization}`,\n});\n","import { CreateAssetManufacturerRequestDTO } from \"./assetManufacturer.dto\";\n\nexport const createEmptyAssetManufacturerDTO =\n (): CreateAssetManufacturerRequestDTO => ({\n name: \"\",\n comment: \"\",\n });\n","import { CreateAssetManufacturerRequestDTO } from \"api/assetManufacturer/assetManufacturer.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<CreateAssetManufacturerRequestDTO>;\n errors: Partial<FieldErrorsImpl<CreateAssetManufacturerRequestDTO>>;\n}\nexport const AddAssetManufacturerForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`assetManufacturer.Name`)}\n name=\"name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.name?.message}\n />\n <TextArea\n label={t(`assetManufacturer.Comment`)}\n name=\"comment\"\n register={register}\n />\n </ModalContentWrapper>\n );\n};\n","import { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { useTranslation } from \"react-i18next\";\nimport { useCreateAssetManufacturer } from \"api/assetManufacturer/assetManufacturer.endpoints\";\nimport { CreateAssetManufacturerRequestDTO } from \"api/assetManufacturer/assetManufacturer.dto\";\nimport { createEmptyAssetManufacturerDTO } from \"api/assetManufacturer/assetManufacturer.helper\";\nimport { AddAssetManufacturerForm } from \"./AddAssetManufacturerForm\";\n\nexport const AddAssetManufacturer = () => {\n const { t } = useTranslation();\n\n // state\n const [isAddModalOpen, setIsAddModalOpen] = useState<boolean>(false);\n\n // api\n const {\n mutate: createAssetManufacturer,\n isPending: isCreating,\n isSuccess: isCreated,\n } = useCreateAssetManufacturer();\n\n // form\n const {\n register: registerAssetManufacturer,\n handleSubmit: handleAssetManufacturerSubmit,\n reset: resetAssetManufacturer,\n formState: { errors: assetManufacturerErrors },\n } = useForm<CreateAssetManufacturerRequestDTO>();\n\n // submit\n const onAssetManufacturerSubmit = handleAssetManufacturerSubmit(\n (data: CreateAssetManufacturerRequestDTO) => createAssetManufacturer(data),\n );\n\n // modal close\n const closeAddModal = () => {\n setIsAddModalOpen(false);\n setTimeout(\n () => resetAssetManufacturer(createEmptyAssetManufacturerDTO()),\n 300,\n );\n };\n\n // after submit success\n useEffect(() => {\n if (isCreated) {\n closeAddModal();\n }\n }, [isCreated]);\n\n const renderAddAssetManufacturerButton = () => {\n return (\n <div className=\"pt-4 flex justify-end\">\n <SecondaryButton onClick={() => setIsAddModalOpen(true)}>\n <PlusCircleIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(`assetManufacturer.Add asset manufacturer`)}\n </SecondaryButton>\n </div>\n );\n };\n\n return (\n <>\n {renderAddAssetManufacturerButton()}\n\n <Modal\n isOpen={isAddModalOpen}\n onClose={closeAddModal}\n leftButtonAction={closeAddModal}\n leftButtonText={t(`Close`)}\n title={t(`assetManufacturer.Add asset manufacturer`)}\n rightButtonActionHandler={onAssetManufacturerSubmit}\n rightButtonText={t(`assetManufacturer.Add`)}\n isLoading={isCreating}\n >\n <AddAssetManufacturerForm\n register={registerAssetManufacturer}\n errors={assetManufacturerErrors}\n />\n </Modal>\n </>\n );\n};\n","import { UpdateAssetManufacturerRequestDTO } from \"api/assetManufacturer/assetManufacturer.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface Props {\n register: UseFormRegister<UpdateAssetManufacturerRequestDTO>;\n errors: Partial<FieldErrorsImpl<UpdateAssetManufacturerRequestDTO>>;\n}\nexport const EditAssetManufacturerForm: FC<Props> = ({ register, errors }) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`assetManufacturer.Name`)}\n name=\"name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.name?.message}\n />\n <TextArea\n label={t(`assetManufacturer.Comment`)}\n name=\"comment\"\n register={register}\n />\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n useDeleteAssetManufacturer,\n useUpdateAssetManufacturer,\n} from \"api/assetManufacturer/assetManufacturer.endpoints\";\nimport {\n GetAllManufacturerWithAssetsResponseDTO,\n UpdateAssetManufacturerRequestDTO,\n} from \"api/assetManufacturer/assetManufacturer.dto\";\nimport { createEmptyAssetManufacturerDTO } from \"api/assetManufacturer/assetManufacturer.helper\";\nimport { EditAssetManufacturerForm } from \"./EditAssetManufacturerForm\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\n\ninterface Props {\n assetManufacturer: GetAllManufacturerWithAssetsResponseDTO;\n canBeDeleted: boolean;\n}\n\nexport const EditAssetManufacturer: FC<Props> = ({\n assetManufacturer,\n canBeDeleted,\n}) => {\n const { t } = useTranslation();\n\n // state\n const [isEditManufacturerModalOpen, setIsEditManufacturerModalOpen] =\n useState<boolean>(false);\n\n // api\n const { mutate: editAssetManufacturer, isSuccess: isUpdated } =\n useUpdateAssetManufacturer(assetManufacturer.id);\n\n const { mutate: deleteAssetManufacturer, isSuccess: isDeleted } =\n useDeleteAssetManufacturer();\n\n // form\n const {\n register: registerAssetManufacturer,\n handleSubmit: handleAssetManufacturerSubmit,\n reset: resetAssetManufacturer,\n formState: { errors: assetManufacturerErrors },\n } = useForm<UpdateAssetManufacturerRequestDTO>();\n\n // submit\n const onEditAssetManufacturerSubmit = handleAssetManufacturerSubmit(\n (data: UpdateAssetManufacturerRequestDTO) => editAssetManufacturer(data),\n );\n\n const onDeleteAssetManufacturerSubmit = () =>\n deleteAssetManufacturer(assetManufacturer.id);\n\n // modal close\n const closeEditModal = () => {\n setIsEditManufacturerModalOpen(false);\n setTimeout(\n () => resetAssetManufacturer(createEmptyAssetManufacturerDTO()),\n 300,\n );\n };\n\n useEffect(() => {\n if (isEditManufacturerModalOpen) {\n resetAssetManufacturer({ ...assetManufacturer });\n }\n }, [isEditManufacturerModalOpen]);\n\n // after submit success\n useEffect(() => {\n if (isUpdated || isDeleted) {\n closeEditModal();\n }\n }, [isUpdated, isDeleted]);\n\n const renderEditManufacturerButton = () => {\n return (\n <div className=\"pt-4 flex justify-end\">\n <PencilSquareIcon\n className=\"h-5 w-5 mb-4 ml-2 mt-1 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={() => setIsEditManufacturerModalOpen(true)}\n />{\" \"}\n </div>\n );\n };\n\n return (\n <>\n {renderEditManufacturerButton()}\n\n <Modal\n isOpen={isEditManufacturerModalOpen}\n onClose={closeEditModal}\n leftButtonAction={closeEditModal}\n leftButtonText={t(`Close`)}\n title={t(`assetManufacturer.Edit asset manufacturer`)}\n rightButtonText={t(`Save`)}\n rightButtonActionHandler={onEditAssetManufacturerSubmit}\n middleButtonAction={\n canBeDeleted ? onDeleteAssetManufacturerSubmit : undefined\n }\n middleButtonText=\"Delete\"\n >\n <EditAssetManufacturerForm\n register={registerAssetManufacturer}\n errors={assetManufacturerErrors}\n />\n </Modal>\n </>\n );\n};\n","import { TrashIcon } from \"@heroicons/react/20/solid\";\nimport { classNames } from \"helpers/classNames\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface PowerCapacityProp {\n powerCapacity: number;\n handleDeleteCapacity?: (valueToDelete: number) => void;\n disabled?: boolean;\n}\n\nexport const PowerCapacity = ({\n powerCapacity,\n handleDeleteCapacity,\n disabled = false,\n}: PowerCapacityProp) => {\n const { t } = useTranslation();\n\n return (\n <div\n className={classNames(\n \"flex justify-between items-center border border-gray-300 rounded-md p-2\",\n disabled ? \"bg-gray-60 text-gray-400 border-gray-300\" : \"\",\n )}\n >\n <label className=\"text-sm font-medium text-gray-700 relative pl-2\">\n {powerCapacity} {t(`inverter.outputPowerCapacity unit`)}\n </label>\n {handleDeleteCapacity && (\n <TrashIcon\n className=\"h-4 w-4 text-flowerRed-800 hover:text-flowerRed-500 cursor-pointer\"\n aria-hidden=\"true\"\n onClick={() => handleDeleteCapacity(powerCapacity)}\n />\n )}\n </div>\n );\n};\n","import { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport { GetAllManufacturerResponseDTO } from \"api/assetManufacturer/assetManufacturer.dto\";\nimport { CreateInverterModelRequestDTO } from \"api/inverterModel/inverterModel.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport Dropdown from \"components/input/Dropdown\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { TextInput } from \"components/input/TextInput\";\nimport {\n naturalNumberValidator,\n noEmptyStringValidator,\n positiveNumberValidator,\n} from \"helpers/validation\";\nimport { ChangeEvent, FC, KeyboardEvent, useState } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { PowerCapacity } from \"./PowerCapacity\";\n\ninterface Props {\n register: UseFormRegister<CreateInverterModelRequestDTO>;\n errors: Partial<FieldErrorsImpl<CreateInverterModelRequestDTO>>;\n manufacturers: GetAllManufacturerResponseDTO[];\n powerInputs: number[];\n setPowerInputs: React.Dispatch<React.SetStateAction<number[]>>;\n}\n\nexport const AddInverterModelForm: FC<Props> = ({\n register,\n errors,\n manufacturers,\n powerInputs,\n setPowerInputs,\n}) => {\n const { t } = useTranslation();\n\n const [tempPowerCapacity, setTempPowerCapacity] = useState<string>(\"\");\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>) =>\n setTempPowerCapacity(event.target.value);\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \"Tab\") {\n handleAddPowerCapacity();\n }\n };\n\n const handleAddPowerCapacity = () => {\n if (\n tempPowerCapacity != \"\" &&\n !powerInputs.some(\n (powerCapacity) =>\n powerCapacity === parseFloat(tempPowerCapacity.trim()),\n )\n ) {\n setPowerInputs((prev) => [...prev, parseFloat(tempPowerCapacity.trim())]);\n setTempPowerCapacity(\"\");\n }\n };\n\n const handleDeleteCapacity = (valueToDelete: number) =>\n setPowerInputs((prev) =>\n prev.filter((powerCapacity) => powerCapacity !== valueToDelete),\n );\n\n return (\n <ModalContentWrapper>\n <Dropdown\n label={t(`inverter.manufacturer`)}\n name={\"assetManufacturerId\"}\n items={[\n ...manufacturers.map((manufacturer) => ({\n label: manufacturer.name,\n value: manufacturer.id,\n })),\n ]}\n register={register}\n />\n <TextInput\n label={t(`inverter.Name`)}\n name=\"name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.name?.message}\n />\n <TextInput\n label={t(`inverter.numberOfBatteryStacksCurrentlySupported`)}\n name=\"numberOfBatteryStacksCurrentlySupported\"\n register={register}\n registerOptions={naturalNumberValidator}\n errorMessage={errors.numberOfBatteryStacksCurrentlySupported?.message}\n type=\"number\"\n size=\"half\"\n />\n <TextInput\n label={t(`inverter.maxNumberOfBatteryStacksSupported`)}\n name=\"maxNumberOfBatteryStacksSupported\"\n register={register}\n registerOptions={positiveNumberValidator}\n errorMessage={errors.maxNumberOfBatteryStacksSupported?.message}\n type=\"number\"\n size=\"half\"\n />\n <div>\n <label className=\"flex text-sm font-medium text-gray-700 relative\">\n {t(`inverter.outputPowerCapacity`)}\n </label>\n <div className=\"flex items-center\">\n <div className=\"mt-1 relative rounded-md shadow-sm w-1/2\">\n <input\n type=\"number\"\n className=\"block w-full rounded-md shadow-sm sm:text-sm\"\n value={tempPowerCapacity}\n onChange={(event) => handleInputChange(event)}\n onKeyDown={handleKeyDown}\n />\n <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3\">\n <span className=\"text-gray-500 sm:text-sm\">\n {t(`inverter.outputPowerCapacity unit`)}\n </span>\n </div>\n </div>\n <div className=\"pt-4 flex justify-end\">\n <PlusCircleIcon\n className=\"h-5 w-8 mb-4 ml-2 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={handleAddPowerCapacity}\n />{\" \"}\n </div>\n </div>\n <div className=\"grid grid-cols-4 gap-4 mt-2 \">\n {powerInputs.map((powerCapacity, index) => (\n <PowerCapacity\n key={index}\n powerCapacity={powerCapacity}\n handleDeleteCapacity={handleDeleteCapacity}\n />\n ))}\n </div>\n </div>\n <TextArea\n label={t(`inverter.Comment`)}\n name=\"comment\"\n register={register}\n />\n </ModalContentWrapper>\n );\n};\n","import api from \"../axiosInstance\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\n\nimport { useNotification } from \"hooks/useNotification\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\nimport {\n CreateInverterModelRequestDTO,\n CreateInverterModelResponseDTO,\n GetAllInverterModelResponseDTO,\n GetInverterModelResponseDTO,\n UpdateInverterModelRequestDTO,\n UpdateInverterModelResponseDTO,\n} from \"./inverterModel.dto\";\nimport { AssetManufacturerQueryKeys } from \"api/assetManufacturer/assetManufacturer.endpoints\";\n\nconst ENDPOINT = \"/inverter-model\";\n\nexport enum InverterQueryKeys {\n GetAll = \"inverter-get-all\",\n GetOne = \"inverter-get\",\n}\n\nexport const useInverters = (enabled: boolean) =>\n useQuery({\n queryKey: [InverterQueryKeys.GetAll],\n queryFn: async (): Promise<GetAllInverterModelResponseDTO[]> =>\n (await api.get(`${ENDPOINT}`)).data,\n enabled,\n });\n\nexport const useInverter = (id: number, enabled: boolean) =>\n useQuery({\n queryKey: [InverterQueryKeys.GetOne, id],\n queryFn: async (): Promise<GetInverterModelResponseDTO> =>\n (await api.get(`${ENDPOINT}/${id}`)).data,\n enabled: !!id && enabled,\n });\n\nexport const useCreateInverter = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: CreateInverterModelRequestDTO,\n ): Promise<CreateInverterModelResponseDTO> =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: (data: CreateInverterModelResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n notification.info(`Inverter ${data.name} created`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useUpdateInverter = (id: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: UpdateInverterModelRequestDTO,\n ): Promise<UpdateInverterModelResponseDTO> =>\n (await api.put(`${ENDPOINT}/${id}`, payload)).data,\n onSuccess: (data: UpdateInverterModelResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n queryClient.invalidateQueries({\n queryKey: [InverterQueryKeys.GetOne, data.id],\n });\n notification.info(`Inverter ${data.name} updated`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useDeleteInverter = () => {\n const queryClient = useQueryClient();\n const notification = useNotification();\n\n return useMutation({\n mutationFn: async (id: number) => await api.delete(`${ENDPOINT}/${id}`),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n queryClient.invalidateQueries({\n queryKey: [InverterQueryKeys.GetAll],\n });\n notification.info(`Inverter deleted`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n","import {\n CreateInverterModelRequestDTO,\n GetInverterModelResponseDTO,\n} from \"./inverterModel.dto\";\n\nexport const createEmptyInverterModelDTO =\n (): CreateInverterModelRequestDTO => ({\n assetManufacturerId: 0,\n name: \"\",\n numberOfBatteryStacksCurrentlySupported: 0,\n maxNumberOfBatteryStacksSupported: 0,\n comment: \"\",\n outputPowerCapacities: [],\n });\n\nexport const getEmptyInverterModelDTO = (): GetInverterModelResponseDTO => ({\n assetManufacturer: {\n id: 0,\n name: \"\",\n },\n inverterModel: {\n id: 0,\n name: \"\",\n numberOfBatteryStacksCurrentlySupported: 0,\n maxNumberOfBatteryStacksSupported: 0,\n comment: \"\",\n outputPowerCapacities: [],\n },\n batteryCompatibilities: [],\n});\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { AddInverterModelForm } from \"./AddInverterModelForm\";\nimport { CreateInverterModelRequestDTO } from \"api/inverterModel/inverterModel.dto\";\nimport { useCreateInverter } from \"api/inverterModel/inverterModel.endpoints\";\nimport { createEmptyInverterModelDTO } from \"api/inverterModel/inverterModel.helper\";\nimport { useAssetManufacturers } from \"api/assetManufacturer/assetManufacturer.endpoints\";\nimport { isEmptyArray } from \"helpers/array\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\n\ninterface Props {\n manufacturerId: number;\n}\n\nexport const AddInverterModel: FC<Props> = ({ manufacturerId }) => {\n const { t } = useTranslation();\n\n // state\n const [isAddModalOpen, setIsAddModalOpen] = useState<boolean>(false);\n const [powerInputs, setPowerInputs] = useState<number[]>([]);\n\n // api\n const {\n mutate: createInverter,\n isPending: isCreating,\n isSuccess: isCreated,\n } = useCreateInverter();\n\n const {\n data: assetManufacturers,\n isLoading,\n isError,\n } = useAssetManufacturers(isAddModalOpen);\n\n // form\n const {\n register: registerInverter,\n handleSubmit: handleAddInverterSubmit,\n reset: resetInverter,\n formState: { errors: inverterErrors },\n } = useForm<CreateInverterModelRequestDTO>();\n\n // submit\n const onInverterSubmit = handleAddInverterSubmit(\n (data: CreateInverterModelRequestDTO) =>\n createInverter({\n ...data,\n assetManufacturerId: +data.assetManufacturerId,\n outputPowerCapacities: powerInputs,\n }),\n );\n\n // modal close\n const closeAddModal = () => {\n setIsAddModalOpen(false);\n setTimeout(() => resetInverter(createEmptyInverterModelDTO()), 300);\n setPowerInputs([]);\n };\n\n useEffect(() => {\n if (isAddModalOpen) {\n resetInverter({\n assetManufacturerId: manufacturerId,\n });\n }\n }, [isAddModalOpen]);\n\n // after submit success\n useEffect(() => {\n if (isCreated) {\n closeAddModal();\n }\n }, [isCreated]);\n\n const renderAddInverterButton = () => {\n return (\n <div className=\"pt-4 flex justify-end\">\n <PlusCircleIcon\n className=\"h-5 w-5 mb-4 ml-2 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={() => setIsAddModalOpen(true)}\n />{\" \"}\n </div>\n );\n };\n\n return (\n <>\n {renderAddInverterButton()}\n\n <Modal\n isOpen={isAddModalOpen}\n onClose={closeAddModal}\n leftButtonAction={closeAddModal}\n leftButtonText={t(`Close`)}\n title={t(`inverter.Add inverter`)}\n rightButtonActionHandler={onInverterSubmit}\n rightButtonText={t(`inverter.Add`)}\n isLoading={isCreating}\n >\n {isLoading ||\n isError ||\n assetManufacturers === undefined ||\n isEmptyArray(assetManufacturers) ? (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError || assetManufacturers === undefined}\n isLoading={isLoading}\n isEmpty={false}\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`assetManufacturers.Error`)}\n loaderSize=\"page\"\n />\n </div>\n ) : (\n <AddInverterModelForm\n register={registerInverter}\n errors={inverterErrors}\n manufacturers={assetManufacturers}\n powerInputs={powerInputs}\n setPowerInputs={setPowerInputs}\n />\n )}\n </Modal>\n </>\n );\n};\n","import { TrashIcon } from \"@heroicons/react/20/solid\";\nimport { BatteryCapacityDTO } from \"api/batteryModel/batteryModel.dto\";\nimport { classNames } from \"helpers/classNames\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface CapacityProp {\n capacity: BatteryCapacityDTO;\n handleDeleteCapacity?: (valueToDelete: BatteryCapacityDTO) => void;\n disabled?: boolean;\n}\n\nexport const Capacity = ({\n capacity,\n handleDeleteCapacity,\n disabled = false,\n}: CapacityProp) => {\n const { t } = useTranslation();\n\n return (\n <div\n className={classNames(\n \"flex justify-between items-center border border-gray-300 rounded-md p-1 px-2\",\n disabled ? \"bg-gray-60 text-gray-400 border-gray-300\" : \"\",\n )}\n >\n <div className=\"flex\">\n <div className=\"flex border-r border-gray-300 px-2\">\n <label className=\"flex text-xs text-gray-700\">\n {capacity.energyCapacity} {t(`battery.energyCapacity unit`)}\n </label>\n </div>\n <div>\n <label className=\"flex text-xs text-gray-700 px-2\">\n {capacity.powerCapacity} {t(`battery.powerCapacity unit`)}\n </label>\n </div>\n </div>\n\n {handleDeleteCapacity && (\n <TrashIcon\n className=\"h-4 w-4 text-flowerRed-800 hover:text-flowerRed-500 cursor-pointer\"\n aria-hidden=\"true\"\n onClick={() => handleDeleteCapacity(capacity)}\n />\n )}\n </div>\n );\n};\n","import { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport { GetAllManufacturerResponseDTO } from \"api/assetManufacturer/assetManufacturer.dto\";\nimport {\n BatteryCapacityDTO,\n CreateBatteryModelRequestDTO,\n} from \"api/batteryModel/batteryModel.dto\";\nimport { GetAllInverterModelResponseDTO } from \"api/inverterModel/inverterModel.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport Dropdown from \"components/input/Dropdown\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { TextInput } from \"components/input/TextInput\";\nimport {\n decimalNumberValidator,\n noEmptyStringValidator,\n} from \"helpers/validation\";\nimport { ChangeEvent, FC, useState, KeyboardEvent, useRef } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Capacity } from \"./Capacity\";\n\ninterface Props {\n register: UseFormRegister<CreateBatteryModelRequestDTO>;\n errors: Partial<FieldErrorsImpl<CreateBatteryModelRequestDTO>>;\n manufacturers: GetAllManufacturerResponseDTO[];\n invertersData: GetAllInverterModelResponseDTO[];\n inverterCompatibilities: number[];\n handleCheckboxChange: (id: number) => void;\n capacityInputs: BatteryCapacityDTO[];\n setCapacityInputs: React.Dispatch<React.SetStateAction<BatteryCapacityDTO[]>>;\n}\nexport const AddBatteryModelForm: FC<Props> = ({\n register,\n errors,\n manufacturers,\n invertersData,\n inverterCompatibilities,\n handleCheckboxChange,\n capacityInputs,\n setCapacityInputs,\n}) => {\n const { t } = useTranslation();\n\n const [tempEnergyCapacity, setTempEnergyCapacity] = useState<string>(\"\");\n const [tempPowerCapacity, setTempPowerCapacity] = useState<string>(\"\");\n\n const energyInputRef = useRef<HTMLInputElement>(null);\n const powerInputRef = useRef<HTMLInputElement>(null);\n\n const handleEnergyInputChange = (event: ChangeEvent<HTMLInputElement>) =>\n setTempEnergyCapacity(event.target.value);\n\n const handlePowerInputChange = (event: ChangeEvent<HTMLInputElement>) =>\n setTempPowerCapacity(event.target.value);\n\n const handleAddCapacity = () => {\n if (\n tempEnergyCapacity != \"\" &&\n tempPowerCapacity != \"\" &&\n !capacityInputs.some(\n (capacity) =>\n capacity.energyCapacity === parseFloat(tempEnergyCapacity.trim()) &&\n capacity.powerCapacity === parseFloat(tempPowerCapacity.trim()),\n )\n ) {\n setCapacityInputs((prev) => [\n ...prev,\n {\n energyCapacity: parseFloat(tempEnergyCapacity.trim()),\n powerCapacity: parseFloat(tempPowerCapacity.trim()),\n },\n ]);\n setTempEnergyCapacity(\"\");\n setTempPowerCapacity(\"\");\n energyInputRef.current?.focus();\n }\n };\n\n const handleEnergyKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \"Tab\") {\n powerInputRef.current?.focus();\n }\n };\n\n const handlePowerKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \"Tab\") {\n handleAddCapacity();\n }\n };\n\n const handleDeleteCapacity = (valueToDelete: BatteryCapacityDTO) => {\n const capacityIndexToDelete = capacityInputs.findIndex(\n (capacity) =>\n capacity.energyCapacity === valueToDelete.energyCapacity &&\n capacity.powerCapacity === valueToDelete.powerCapacity,\n );\n\n if (capacityIndexToDelete !== -1) {\n setCapacityInputs((prev) => {\n return prev.filter((_, index) => index !== capacityIndexToDelete);\n });\n }\n };\n\n return (\n <ModalContentWrapper>\n <div className=\"sm:grid sm:grid-cols-2 \">\n <div className=\"border-r border-gray-200 pr-3 space-y-3\">\n <h2 className=\"text-xl font-bold text-flowerblue-700\">\n {t(`battery.Battery information`)}\n </h2>\n <Dropdown\n label={t(`battery.manufacturer`)}\n name={\"assetManufacturerId\"}\n items={[\n ...manufacturers.map((manufacturer) => ({\n label: manufacturer.name,\n value: manufacturer.id,\n })),\n ]}\n register={register}\n />\n <TextInput\n label={t(`battery.Name`)}\n name=\"name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.name?.message}\n />\n <TextInput\n label={t(`battery.minNumberOfBatteryModules`)}\n name=\"minNumberOfBatteryModules\"\n register={register}\n registerOptions={decimalNumberValidator}\n errorMessage={errors.minNumberOfBatteryModules?.message}\n size=\"half\"\n />\n <TextInput\n label={t(`battery.maxNumberOfBatteryModules`)}\n name=\"maxNumberOfBatteryModules\"\n register={register}\n registerOptions={decimalNumberValidator}\n errorMessage={errors.maxNumberOfBatteryModules?.message}\n size=\"half\"\n />\n\n <div className=\"flex items-center\">\n <div>\n <label className=\"flex text-sm font-medium text-gray-700 relative\">\n {t(`battery.energy`)}\n </label>\n <div className=\"mt-1 relative rounded-md shadow-sm w-4/5\">\n <input\n type=\"number\"\n ref={energyInputRef}\n className=\"block w-full rounded-md shadow-sm sm:text-sm\"\n value={tempEnergyCapacity}\n onChange={(event) => handleEnergyInputChange(event)}\n onKeyDown={handleEnergyKeyDown}\n />\n <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3\">\n <span className=\"text-gray-500 sm:text-sm\">\n {t(`battery.energyCapacity unit`)}\n </span>\n </div>\n </div>\n </div>\n <div>\n <label className=\"flex text-sm font-medium text-gray-700 relative\">\n {t(`battery.power`)}\n </label>\n <div className=\"mt-1 relative rounded-md shadow-sm w-4/5\">\n <input\n type=\"number\"\n ref={powerInputRef}\n className=\"block w-full rounded-md shadow-sm sm:text-sm\"\n value={tempPowerCapacity}\n onChange={(event) => handlePowerInputChange(event)}\n onKeyDown={handlePowerKeyDown}\n />\n <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3\">\n <span className=\"text-gray-500 sm:text-sm\">\n {t(`battery.powerCapacity unit`)}\n </span>\n </div>\n </div>\n </div>\n <PlusCircleIcon\n className=\"h-5 w-8 mt-6 mr-4 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={handleAddCapacity}\n />{\" \"}\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-6 gap-y-3 mt-2 \">\n {capacityInputs.map((capacity, index) => (\n <Capacity\n key={index}\n capacity={capacity}\n handleDeleteCapacity={handleDeleteCapacity}\n />\n ))}\n </div>\n\n <TextArea\n label={t(`battery.Comment`)}\n name=\"comment\"\n register={register}\n />\n </div>\n\n <div className=\"pl-3\">\n <h2 className=\"text-xl font-bold text-flowerblue-700\">\n {t(`battery.Inverter compatibilities`)}\n </h2>\n\n <div>\n {invertersData.map((manufacturer) => (\n <div key={manufacturer.assetManufacturerName}>\n <h3 className=\"text-l font-bold text-flowerblue-600 pt-4\">\n {manufacturer.assetManufacturerName}\n </h3>\n {manufacturer.inverters.map((inverter) => (\n <div key={inverter.id} className=\"ml-4 p-1\">\n <label>\n <input\n type=\"checkbox\"\n value={inverter.id}\n checked={inverterCompatibilities.includes(inverter.id)}\n onChange={() => handleCheckboxChange(inverter.id)}\n className=\"mr-2\"\n />\n {inverter.name}\n </label>\n </div>\n ))}\n </div>\n ))}\n </div>\n </div>\n </div>\n </ModalContentWrapper>\n );\n};\n","import api from \"../axiosInstance\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\n\nimport { useNotification } from \"hooks/useNotification\";\nimport { ErrorResponse } from \"types/errorResponse.type\";\nimport {\n CreateBatteryCapacitiesRequestDTO,\n CreateBatteryCapacitiesResponseDTO,\n CreateBatteryModelRequestDTO,\n CreateBatteryModelResponseDTO,\n GetBatteryModelResponseDTO,\n UpdateBatteryModelRequestDTO,\n UpdateBatteryModelResponseDTO,\n} from \"./batteryModel.dto\";\nimport { AssetManufacturerQueryKeys } from \"api/assetManufacturer/assetManufacturer.endpoints\";\n\nconst ENDPOINT = \"/battery-model\";\n\nexport enum BatteryQueryKeys {\n GetOne = \"battery-get\",\n}\n\nexport const useBattery = (id: number, enabled: boolean) =>\n useQuery({\n queryKey: [BatteryQueryKeys.GetOne, id],\n queryFn: async (): Promise<GetBatteryModelResponseDTO> =>\n (await api.get(`${ENDPOINT}/${id}`)).data,\n enabled: !!id && enabled,\n });\n\nexport const useCreateBattery = () => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: CreateBatteryModelRequestDTO,\n ): Promise<CreateBatteryModelResponseDTO> =>\n (await api.post(ENDPOINT, payload)).data,\n onSuccess: (data: CreateBatteryModelResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n notification.info(`Battery ${data.name} created`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useCreateBatteryCapacities = (id: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: CreateBatteryCapacitiesRequestDTO,\n ): Promise<CreateBatteryCapacitiesResponseDTO> =>\n (await api.post(`${ENDPOINT}/${id}`, payload)).data,\n onSuccess: (data: CreateBatteryCapacitiesResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n queryClient.invalidateQueries({\n queryKey: [BatteryQueryKeys.GetOne, id],\n });\n notification.info(`Battery capacities for ${data.name} created`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useUpdateBattery = (id: number) => {\n const notification = useNotification();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: async (\n payload: UpdateBatteryModelRequestDTO,\n ): Promise<UpdateBatteryModelResponseDTO> =>\n (await api.put(`${ENDPOINT}/${id}`, payload)).data,\n onSuccess: (data: UpdateBatteryModelResponseDTO) => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n queryClient.invalidateQueries({\n queryKey: [BatteryQueryKeys.GetOne, data.id],\n });\n notification.info(`Battery ${data.name} updated`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n\nexport const useDeleteBattery = () => {\n const queryClient = useQueryClient();\n const notification = useNotification();\n\n return useMutation({\n mutationFn: async (id: number) => await api.delete(`${ENDPOINT}/${id}`),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [AssetManufacturerQueryKeys.GetAllWithAssets],\n });\n notification.info(`Battery deleted`);\n },\n onError: (error: ErrorResponse) => {\n notification.error(error.response.data.message);\n },\n });\n};\n","import {\n CreateBatteryModelRequestDTO,\n GetBatteryModelResponseDTO,\n} from \"./batteryModel.dto\";\n\nexport const createEmptyBatteryModelDTO = (): CreateBatteryModelRequestDTO => ({\n assetManufacturerId: 0,\n name: \"\",\n comment: \"\",\n minNumberOfBatteryModules: 0,\n maxNumberOfBatteryModules: 0,\n capacities: [],\n inverterCompatibilities: [],\n});\n\nexport const getEmptyBatteryModelDTO = (): GetBatteryModelResponseDTO => ({\n assetManufacturer: {\n id: 0,\n name: \"\",\n },\n batteryModel: {\n id: 0,\n name: \"\",\n minNumberOfBatteryModules: 0,\n maxNumberOfBatteryModules: 0,\n comment: \"\",\n capacities: [],\n },\n inverterCompatibilities: [],\n});\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { Battery0Icon, PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { AddBatteryModelForm } from \"./AddBatteryModelForm\";\nimport { useAssetManufacturers } from \"api/assetManufacturer/assetManufacturer.endpoints\";\nimport { isEmptyArray } from \"helpers/array\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport {\n BatteryCapacityDTO,\n CreateBatteryModelRequestDTO,\n} from \"api/batteryModel/batteryModel.dto\";\nimport { useCreateBattery } from \"api/batteryModel/batteryModel.endpoints\";\nimport { createEmptyBatteryModelDTO } from \"api/batteryModel/batteryModel.helper\";\nimport { useInverters } from \"api/inverterModel/inverterModel.endpoints\";\n\ninterface Props {\n manufacturerId: number;\n}\n\nexport const AddBatteryModel: FC<Props> = ({ manufacturerId }) => {\n const { t } = useTranslation();\n\n // state\n const [isAddModalOpen, setIsAddModalOpen] = useState<boolean>(false);\n const [capacityInputs, setCapacityInputs] = useState<BatteryCapacityDTO[]>(\n [],\n );\n const [inverterCompatibilities, setInverterCompatibilities] = useState<\n number[]\n >([]);\n\n const handleCheckboxChange = (id: number) => {\n setInverterCompatibilities((prev) =>\n prev.includes(id) ? prev.filter((item) => item !== id) : [...prev, id],\n );\n };\n\n // api\n const {\n mutate: createBattery,\n isPending: isCreating,\n isSuccess: isCreated,\n } = useCreateBattery();\n\n const {\n data: assetManufacturers,\n isLoading: isLoadingManufacturers,\n isError: isErrorManufacturers,\n } = useAssetManufacturers(isAddModalOpen);\n\n const {\n data: inverters,\n isLoading: isLoadingInverters,\n isError: isErrorInverters,\n } = useInverters(isAddModalOpen);\n\n // form\n const {\n register: registerBattery,\n handleSubmit: handleAddBatterySubmit,\n reset: resetBattery,\n formState: { errors: batteryErrors },\n } = useForm<CreateBatteryModelRequestDTO>();\n\n // submit\n const onBatterySubmit = handleAddBatterySubmit(\n (data: CreateBatteryModelRequestDTO) =>\n createBattery({\n ...data,\n assetManufacturerId: +data.assetManufacturerId,\n minNumberOfBatteryModules: +data.minNumberOfBatteryModules,\n maxNumberOfBatteryModules: +data.maxNumberOfBatteryModules,\n capacities: capacityInputs,\n inverterCompatibilities,\n }),\n );\n\n // modal close\n const closeAddModal = () => {\n setIsAddModalOpen(false);\n setTimeout(() => resetBattery(createEmptyBatteryModelDTO()), 300);\n setCapacityInputs([]);\n setInverterCompatibilities([]);\n };\n\n useEffect(() => {\n if (isAddModalOpen) {\n resetBattery({\n assetManufacturerId: manufacturerId,\n });\n }\n }, [isAddModalOpen]);\n\n // after submit success\n useEffect(() => {\n if (isCreated) {\n closeAddModal();\n }\n }, [isCreated]);\n\n const renderAddBatteryButton = () => {\n return (\n <div className=\"pt-4 flex justify-end\">\n <PlusCircleIcon\n className=\"h-5 w-5 mb-4 ml-2 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={() => setIsAddModalOpen(true)}\n />{\" \"}\n </div>\n );\n };\n\n const isManufacturerNotValid =\n isLoadingManufacturers ||\n isErrorManufacturers ||\n assetManufacturers === undefined ||\n isEmptyArray(assetManufacturers);\n\n const isInvertersNotValid =\n isLoadingInverters ||\n isErrorInverters ||\n inverters === undefined ||\n isEmptyArray(inverters);\n\n return (\n <>\n {renderAddBatteryButton()}\n\n <div className=\"sm:max-w-xl\">\n <Modal\n isOpen={isAddModalOpen}\n onClose={closeAddModal}\n leftButtonAction={\n isManufacturerNotValid || isInvertersNotValid\n ? undefined\n : closeAddModal\n }\n leftButtonText={t(`Close`)}\n title={t(`battery.Add battery`)}\n rightButtonActionHandler={\n isManufacturerNotValid || isInvertersNotValid\n ? undefined\n : onBatterySubmit\n }\n rightButtonText={t(`inverter.Add`)}\n isLoading={isCreating}\n maxSize=\"sm:max-w-4xl\"\n >\n {isManufacturerNotValid ? (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isErrorManufacturers}\n isLoading={isLoadingManufacturers}\n isEmpty={\n assetManufacturers === undefined ||\n isEmptyArray(assetManufacturers)\n }\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`assetManufacturer.Error`)}\n emptyDataMessage={t(`assetManufacturer.Error`)}\n loaderSize=\"page\"\n />\n </div>\n ) : isInvertersNotValid ? (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={false}\n isLoading={false}\n isEmpty={inverters === undefined || isEmptyArray(inverters)}\n icon={<Battery0Icon />}\n emptyDataMessage={t(`inverter.Empty`)}\n loaderSize=\"page\"\n />\n </div>\n ) : (\n <AddBatteryModelForm\n register={registerBattery}\n errors={batteryErrors}\n manufacturers={assetManufacturers}\n invertersData={inverters}\n inverterCompatibilities={inverterCompatibilities}\n handleCheckboxChange={handleCheckboxChange}\n capacityInputs={capacityInputs}\n setCapacityInputs={setCapacityInputs}\n />\n )}\n </Modal>\n </div>\n </>\n );\n};\n","import { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport { BatteryCapacityDTO } from \"api/batteryModel/batteryModel.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { ChangeEvent, FC, useState, KeyboardEvent, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Capacity } from \"./Capacity\";\n\ninterface Props {\n capacityInputs: BatteryCapacityDTO[];\n setCapacityInputs: React.Dispatch<React.SetStateAction<BatteryCapacityDTO[]>>;\n}\nexport const AddBatteryCapacityForm: FC<Props> = ({\n capacityInputs,\n setCapacityInputs,\n}) => {\n const { t } = useTranslation();\n\n const [tempEnergyCapacity, setTempEnergyCapacity] = useState<string>(\"\");\n const [tempPowerCapacity, setTempPowerCapacity] = useState<string>(\"\");\n\n const energyInputRef = useRef<HTMLInputElement>(null);\n const powerInputRef = useRef<HTMLInputElement>(null);\n\n const handleEnergyInputChange = (event: ChangeEvent<HTMLInputElement>) =>\n setTempEnergyCapacity(event.target.value);\n\n const handlePowerInputChange = (event: ChangeEvent<HTMLInputElement>) =>\n setTempPowerCapacity(event.target.value);\n\n const handleAddCapacity = () => {\n if (\n tempEnergyCapacity != \"\" &&\n tempPowerCapacity != \"\" &&\n !capacityInputs.some(\n (capacity) =>\n capacity.energyCapacity === parseFloat(tempEnergyCapacity.trim()) &&\n capacity.powerCapacity === parseFloat(tempPowerCapacity.trim()),\n )\n ) {\n setCapacityInputs((prev) => [\n ...prev,\n {\n energyCapacity: parseFloat(tempEnergyCapacity.trim()),\n powerCapacity: parseFloat(tempPowerCapacity.trim()),\n },\n ]);\n setTempEnergyCapacity(\"\");\n setTempPowerCapacity(\"\");\n energyInputRef.current?.focus();\n }\n };\n\n const handleEnergyKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \"Tab\") {\n powerInputRef.current?.focus();\n }\n };\n\n const handlePowerKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \"Tab\") {\n handleAddCapacity();\n }\n };\n\n const handleDeleteCapacity = (valueToDelete: BatteryCapacityDTO) => {\n const capacityIndexToDelete = capacityInputs.findIndex(\n (capacity) =>\n capacity.energyCapacity === valueToDelete.energyCapacity &&\n capacity.powerCapacity === valueToDelete.powerCapacity,\n );\n\n if (capacityIndexToDelete !== -1) {\n setCapacityInputs((prev) => {\n return prev.filter((_, index) => index !== capacityIndexToDelete);\n });\n }\n };\n\n return (\n <ModalContentWrapper>\n <div className=\"flex items-center\">\n <div>\n <label className=\"flex text-sm font-medium text-gray-700 relative\">\n {t(`battery.energy`)}\n </label>\n <div className=\"mt-1 relative rounded-md shadow-sm w-4/5\">\n <input\n type=\"number\"\n ref={energyInputRef}\n className=\"block w-full rounded-md shadow-sm sm:text-sm\"\n value={tempEnergyCapacity}\n onChange={(event) => handleEnergyInputChange(event)}\n onKeyDown={handleEnergyKeyDown}\n />\n <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3\">\n <span className=\"text-gray-500 sm:text-sm\">\n {t(`battery.energyCapacity unit`)}\n </span>\n </div>\n </div>\n </div>\n <div>\n <label className=\"flex text-sm font-medium text-gray-700 relative\">\n {t(`battery.power`)}\n </label>\n <div className=\"mt-1 relative rounded-md shadow-sm w-4/5\">\n <input\n type=\"number\"\n ref={powerInputRef}\n className=\"block w-full rounded-md shadow-sm sm:text-sm\"\n value={tempPowerCapacity}\n onChange={(event) => handlePowerInputChange(event)}\n onKeyDown={handlePowerKeyDown}\n />\n <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3\">\n <span className=\"text-gray-500 sm:text-sm\">\n {t(`battery.powerCapacity unit`)}\n </span>\n </div>\n </div>\n </div>\n <PlusCircleIcon\n className=\"h-5 w-8 mt-6 mr-4 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={handleAddCapacity}\n />{\" \"}\n </div>\n\n <div className=\"grid grid-cols-3 gap-x-3 gap-y-3 mt-2 \">\n {capacityInputs.map((capacity, index) => (\n <Capacity\n key={index}\n capacity={capacity}\n handleDeleteCapacity={handleDeleteCapacity}\n />\n ))}\n </div>\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport Modal from \"components/Modal\";\nimport { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { BatteryCapacityDTO } from \"api/batteryModel/batteryModel.dto\";\nimport { useCreateBatteryCapacities } from \"api/batteryModel/batteryModel.endpoints\";\nimport { AddBatteryCapacityForm } from \"./AddBatteryCapacityForm\";\n\ninterface Props {\n batteryId: number;\n}\n\nexport const AddBatteryCapacity: FC<Props> = ({ batteryId }) => {\n const { t } = useTranslation();\n\n // state\n const [isAddModalOpen, setIsAddModalOpen] = useState<boolean>(false);\n const [capacityInputs, setCapacityInputs] = useState<BatteryCapacityDTO[]>(\n [],\n );\n\n // api\n const {\n mutate: createCapacities,\n isPending: isCreating,\n isSuccess: isCreated,\n } = useCreateBatteryCapacities(batteryId);\n\n // submit\n const onBatterySubmit = () =>\n createCapacities({\n batteryModelId: batteryId,\n capacities: capacityInputs,\n });\n\n // modal close\n const closeEditModal = () => {\n setIsAddModalOpen(false);\n setTimeout(() => setCapacityInputs([]), 300);\n };\n\n // after submit success\n useEffect(() => {\n if (isCreated) {\n closeEditModal();\n }\n }, [isCreated]);\n\n const renderAddBatteryCapacitiesButton = () => {\n return (\n <div className=\"pt-4 flex justify-end\">\n <PlusCircleIcon\n className=\"h-5 w-5 mb-4 ml-4 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={() => setIsAddModalOpen(true)}\n />\n </div>\n );\n };\n\n return (\n <>\n {renderAddBatteryCapacitiesButton()}\n\n <div className=\"sm:max-w-xl\">\n <Modal\n isOpen={isAddModalOpen}\n onClose={closeEditModal}\n leftButtonAction={closeEditModal}\n leftButtonText={t(`Close`)}\n title={t(`battery.Add battery capacities`)}\n rightButtonActionHandler={onBatterySubmit}\n rightButtonText={t(`Save`)}\n isLoading={isCreating}\n >\n <AddBatteryCapacityForm\n capacityInputs={capacityInputs}\n setCapacityInputs={setCapacityInputs}\n />\n </Modal>\n </div>\n </>\n );\n};\n","import { GetBatteryModelResponseDTO } from \"api/batteryModel/batteryModel.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport Dropdown from \"components/input/Dropdown\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { noEmptyStringValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Capacity } from \"./Capacity\";\nimport { classNames } from \"helpers/classNames\";\nimport { AddBatteryCapacity } from \"./AddBatteryCapacity\";\n\ninterface Props {\n register: UseFormRegister<GetBatteryModelResponseDTO>;\n errors: Partial<FieldErrorsImpl<GetBatteryModelResponseDTO>>;\n batteryData: GetBatteryModelResponseDTO;\n inverterCompatibilities: number[];\n handleCheckboxChange: (id: number) => void;\n}\nexport const EditBatteryModelForm: FC<Props> = ({\n register,\n errors,\n batteryData,\n inverterCompatibilities,\n handleCheckboxChange,\n}) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <div className=\"sm:grid sm:grid-cols-2\">\n <div className=\"border-r border-gray-200 pr-3 space-y-3\">\n <h2 className=\"text-xl font-bold text-flowerblue-700\">\n {t(`battery.Battery information`)}\n </h2>\n <Dropdown\n label={t(`battery.manufacturer`)}\n name={\"assetManufacturer.id\"}\n items={[\n {\n label: batteryData.assetManufacturer.name,\n value: batteryData.assetManufacturer.id,\n },\n ]}\n register={register}\n isDisabled\n />\n <TextInput\n label={t(`battery.Name`)}\n name=\"batteryModel.name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.batteryModel?.name?.message}\n isDisabled\n />\n <TextInput\n label={t(`battery.minNumberOfBatteryModules`)}\n name=\"batteryModel.minNumberOfBatteryModules\"\n register={register}\n errorMessage={\n errors?.batteryModel?.minNumberOfBatteryModules?.message\n }\n type=\"number\"\n size=\"half\"\n isDisabled\n />\n <TextInput\n label={t(`battery.maxNumberOfBatteryModules`)}\n name=\"batteryModel.maxNumberOfBatteryModules\"\n register={register}\n errorMessage={\n errors?.batteryModel?.maxNumberOfBatteryModules?.message\n }\n type=\"number\"\n size=\"half\"\n isDisabled\n />\n\n <div className=\"flex items-center\">\n <label className=\"flex text-sm font-medium text-gray-700 relative\">\n {t(`battery.energy`)} / {t(`battery.power`)}\n </label>\n <AddBatteryCapacity batteryId={batteryData.batteryModel.id} />\n </div>\n\n <div className=\"grid grid-cols-2 gap-x-6 gap-y-3 mt-2\">\n {batteryData.batteryModel.capacities.map((capacity, index) => (\n <Capacity key={index} capacity={capacity} disabled />\n ))}\n </div>\n\n <TextArea\n label={t(`battery.Comment`)}\n name=\"batteryModel.comment\"\n register={register}\n />\n </div>\n\n <div className=\"pl-3\">\n <h2 className=\"text-xl font-bold text-flowerblue-700\">\n {t(`battery.Inverter compatibilities`)}\n </h2>\n\n <div>\n {batteryData.inverterCompatibilities.map((manufacturer) => (\n <div key={manufacturer.assetManufacturerName}>\n <h3 className=\"text-l font-bold text-flowerblue-600 pt-4\">\n {manufacturer.assetManufacturerName}\n </h3>\n {manufacturer.inverters.map((inverter) => (\n <div key={inverter.id} className=\"ml-4 p-1\">\n <label>\n <input\n type=\"checkbox\"\n value={inverter.id}\n checked={inverterCompatibilities.includes(inverter.id)}\n onChange={() => handleCheckboxChange(inverter.id)}\n className={classNames(\n \"mr-2\",\n inverter.isUsed &&\n inverterCompatibilities.includes(inverter.id)\n ? \"bg-gray-60 text-gray-400 border-gray-300\"\n : \"\",\n )}\n disabled={\n inverter.isUsed &&\n inverterCompatibilities.includes(inverter.id)\n }\n />\n {inverter.name}\n </label>\n </div>\n ))}\n </div>\n ))}\n </div>\n </div>\n </div>\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport { GetBatteryModelResponseDTO } from \"api/batteryModel/batteryModel.dto\";\nimport {\n useBattery,\n useDeleteBattery,\n useUpdateBattery,\n} from \"api/batteryModel/batteryModel.endpoints\";\nimport { getEmptyBatteryModelDTO } from \"api/batteryModel/batteryModel.helper\";\nimport { EditBatteryModelForm } from \"./EditBatteryModelForm\";\n\ninterface Props {\n batteryId: number;\n canBeDeleted: boolean;\n}\n\nexport const EditBatteryModel: FC<Props> = ({ batteryId, canBeDeleted }) => {\n const { t } = useTranslation();\n\n // state\n const [isEditModalOpen, setIsEditModalOpen] = useState<boolean>(false);\n const [inverterCompatibilities, setInverterCompatibilities] = useState<\n number[]\n >([]);\n\n const handleCheckboxChange = (id: number) => {\n setInverterCompatibilities((prev) =>\n prev.includes(id) ? prev.filter((item) => item !== id) : [...prev, id],\n );\n };\n\n // api\n const {\n mutate: updateBattery,\n isPending: isUpdating,\n isSuccess: isUpdated,\n } = useUpdateBattery(batteryId);\n\n const {\n data: battery,\n isLoading,\n isError,\n } = useBattery(batteryId, isEditModalOpen);\n\n const { mutate: deleteBattery, isSuccess: isDeleted } = useDeleteBattery();\n\n // form\n const {\n register: registerBattery,\n handleSubmit: handleEditBatterySubmit,\n reset: resetBattery,\n formState: { errors: batteryErrors },\n } = useForm<GetBatteryModelResponseDTO>();\n\n // submit\n const onBatterySubmit = handleEditBatterySubmit(\n (data: GetBatteryModelResponseDTO) =>\n updateBattery({\n batteryModelId: data.batteryModel.id,\n name: data.batteryModel.name,\n comment: data.batteryModel.comment,\n inverterCompatibilities,\n }),\n );\n\n const onDeleteBatterySubmit = () => deleteBattery(batteryId);\n\n // modal close\n const closeEditModal = () => {\n setIsEditModalOpen(false);\n setTimeout(() => resetBattery(getEmptyBatteryModelDTO()), 300);\n setTimeout(() => setInverterCompatibilities([]), 300);\n };\n\n useEffect(() => {\n if (isEditModalOpen) {\n setInverterCompatibilities([]);\n\n resetBattery({\n assetManufacturer: {\n id: battery?.assetManufacturer.id,\n name: battery?.assetManufacturer.name,\n },\n batteryModel: {\n id: battery?.batteryModel.id,\n name: battery?.batteryModel.name,\n minNumberOfBatteryModules:\n battery?.batteryModel.minNumberOfBatteryModules,\n maxNumberOfBatteryModules:\n battery?.batteryModel.maxNumberOfBatteryModules,\n comment: battery?.batteryModel.comment,\n },\n inverterCompatibilities: [],\n });\n\n battery?.inverterCompatibilities.forEach((manufacturer) => {\n manufacturer.inverters.forEach((inverter) => {\n if (inverter.isCompatible) {\n setInverterCompatibilities((prev) => [...prev, inverter.id]);\n }\n });\n });\n }\n }, [isEditModalOpen, battery]);\n\n // after submit success\n useEffect(() => {\n if (isUpdated || isDeleted) {\n closeEditModal();\n }\n }, [isUpdated, isDeleted]);\n\n const renderEditBatteryButton = () => {\n return (\n <div className=\"pt-4 flex justify-end\">\n <PencilSquareIcon\n className=\"h-5 w-5 mb-4 ml-2 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={() => setIsEditModalOpen(true)}\n />\n </div>\n );\n };\n\n return (\n <>\n {renderEditBatteryButton()}\n\n <div className=\"sm:max-w-xl\">\n <Modal\n isOpen={isEditModalOpen}\n onClose={closeEditModal}\n leftButtonAction={closeEditModal}\n leftButtonText={t(`Close`)}\n title={t(`battery.Edit battery`)}\n rightButtonActionHandler={onBatterySubmit}\n rightButtonText={t(`Save`)}\n isLoading={isUpdating}\n maxSize=\"sm:max-w-4xl\"\n middleButtonAction={canBeDeleted ? onDeleteBatterySubmit : undefined}\n middleButtonText=\"Delete\"\n >\n {isLoading || isError || battery === undefined ? (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={false}\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`battery.Error`)}\n loaderSize=\"page\"\n />\n </div>\n ) : (\n <EditBatteryModelForm\n register={registerBattery}\n errors={batteryErrors}\n batteryData={battery}\n inverterCompatibilities={inverterCompatibilities}\n handleCheckboxChange={handleCheckboxChange}\n />\n )}\n </Modal>\n </div>\n </>\n );\n};\n","import { GetInverterModelResponseDTO } from \"api/inverterModel/inverterModel.dto\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport Dropdown from \"components/input/Dropdown\";\nimport { TextArea } from \"components/input/TextArea\";\nimport { TextInput } from \"components/input/TextInput\";\nimport {\n noEmptyStringValidator,\n positiveNumberValidator,\n} from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { Battery0Icon } from \"@heroicons/react/24/outline\";\nimport { PowerCapacity } from \"./PowerCapacity\";\nimport { classNames } from \"helpers/classNames\";\n\ninterface Props {\n register: UseFormRegister<GetInverterModelResponseDTO>;\n errors: Partial<FieldErrorsImpl<GetInverterModelResponseDTO>>;\n inverterData: GetInverterModelResponseDTO;\n batteryCompatibilities: number[];\n handleCheckboxChange: (id: number) => void;\n}\nexport const EditInverterModelForm: FC<Props> = ({\n register,\n errors,\n inverterData,\n batteryCompatibilities,\n handleCheckboxChange,\n}) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <div className=\"sm:grid sm:grid-cols-2 \">\n <div className=\"border-r border-gray-200 pr-3 space-y-3\">\n <h2 className=\"text-xl font-bold text-flowerblue-700\">\n {t(`inverter.Inverter information`)}\n </h2>\n <Dropdown\n label={t(`inverter.manufacturer`)}\n name={\"assetManufacturer.id\"}\n items={[\n {\n label: inverterData.assetManufacturer.name,\n value: inverterData.assetManufacturer.id,\n },\n ]}\n register={register}\n isDisabled\n />\n <TextInput\n label={t(`inverter.Name`)}\n name=\"inverterModel.name\"\n register={register}\n registerOptions={noEmptyStringValidator()}\n errorMessage={errors?.inverterModel?.name?.message}\n isDisabled\n />\n <TextInput\n label={t(`inverter.numberOfBatteryStacksCurrentlySupported`)}\n name=\"inverterModel.numberOfBatteryStacksCurrentlySupported\"\n register={register}\n registerOptions={positiveNumberValidator}\n errorMessage={\n errors?.inverterModel?.numberOfBatteryStacksCurrentlySupported\n ?.message\n }\n type=\"number\"\n size=\"half\"\n />\n <TextInput\n label={t(`battery.maxNumberOfBatteryStacksSupported`)}\n name=\"inverterModel.maxNumberOfBatteryStacksSupported\"\n register={register}\n registerOptions={positiveNumberValidator}\n errorMessage={\n errors?.inverterModel?.maxNumberOfBatteryStacksSupported?.message\n }\n type=\"number\"\n size=\"half\"\n isDisabled\n />\n\n <div>\n <label className=\"flex text-sm font-medium text-gray-700 relative\">\n {t(`inverter.outputPowerCapacity`)}\n </label>\n <div className=\"grid grid-cols-5 gap-4 mt-2 \">\n {inverterData.inverterModel.outputPowerCapacities.map(\n (powerCapacity, index) => (\n <PowerCapacity\n key={index}\n powerCapacity={powerCapacity}\n disabled\n />\n ),\n )}\n </div>\n </div>\n\n <TextArea\n label={t(`battery.Comment`)}\n name=\"inverterModel.comment\"\n register={register}\n />\n </div>\n\n <div className=\"pl-3\">\n <h2 className=\"text-xl font-bold text-flowerblue-700\">\n {t(`inverter.Battery compatibilities`)}\n </h2>\n\n <div>\n {inverterData.batteryCompatibilities.length > 0 ? (\n inverterData.batteryCompatibilities.map((manufacturer) => (\n <div key={manufacturer.assetManufacturerName}>\n <h3 className=\"text-l font-bold text-flowerblue-600 pt-4\">\n {manufacturer.assetManufacturerName}\n </h3>\n {manufacturer.batteries.map((battery) => (\n <div key={battery.id} className=\"ml-4 p-1\">\n <label>\n <input\n type=\"checkbox\"\n value={battery.id}\n checked={batteryCompatibilities.includes(battery.id)}\n onChange={() => handleCheckboxChange(battery.id)}\n className={classNames(\n \"mr-2\",\n battery.isUsed &&\n batteryCompatibilities.includes(battery.id)\n ? \"bg-gray-60 text-gray-400 border-gray-300\"\n : \"\",\n )}\n disabled={\n battery.isUsed &&\n batteryCompatibilities.includes(battery.id)\n }\n />\n {battery.name}\n </label>\n </div>\n ))}\n </div>\n ))\n ) : (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={false}\n isLoading={false}\n isEmpty={true}\n icon={<Battery0Icon />}\n emptyDataMessage={t(`battery.Empty`)}\n loaderSize=\"page\"\n />\n </div>\n )}\n </div>\n </div>\n </div>\n </ModalContentWrapper>\n );\n};\n","import { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport Modal from \"components/Modal\";\nimport { PencilSquareIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport { EditInverterModelForm } from \"./EditInverterModelForm\";\nimport {\n useDeleteInverter,\n useInverter,\n useUpdateInverter,\n} from \"api/inverterModel/inverterModel.endpoints\";\nimport { GetInverterModelResponseDTO } from \"api/inverterModel/inverterModel.dto\";\nimport { getEmptyInverterModelDTO } from \"api/inverterModel/inverterModel.helper\";\n\ninterface Props {\n inverterId: number;\n canBeDeleted: boolean;\n}\n\nexport const EditInverterModel: FC<Props> = ({ inverterId, canBeDeleted }) => {\n const { t } = useTranslation();\n\n // state\n const [isEditModalOpen, setIsEditModalOpen] = useState<boolean>(false);\n const [batteryCompatibilities, setBatteryCompatibilities] = useState<\n number[]\n >([]);\n\n const handleCheckboxChange = (id: number) => {\n setBatteryCompatibilities((prev) =>\n prev.includes(id) ? prev.filter((item) => item !== id) : [...prev, id],\n );\n };\n\n // api\n const {\n mutate: updateInverter,\n isPending: isUpdating,\n isSuccess: isUpdated,\n } = useUpdateInverter(inverterId);\n\n const {\n data: inverter,\n isLoading,\n isError,\n } = useInverter(inverterId, isEditModalOpen);\n\n const { mutate: deleteInverter, isSuccess: isDeleted } = useDeleteInverter();\n\n // form\n const {\n register: registerInverter,\n handleSubmit: handleEditInverterSubmit,\n reset: resetInverter,\n formState: { errors: inverterErrors },\n } = useForm<GetInverterModelResponseDTO>();\n\n // submit\n const onInverterSubmit = handleEditInverterSubmit(\n (data: GetInverterModelResponseDTO) =>\n updateInverter({\n inverterModelId: data.inverterModel.id,\n name: data.inverterModel.name,\n comment: data.inverterModel.comment,\n numberOfBatteryStacksCurrentlySupported:\n data.inverterModel.numberOfBatteryStacksCurrentlySupported,\n batteryCompatibilities,\n }),\n );\n\n const onDeleteInverterSubmit = () => deleteInverter(inverterId);\n\n // modal close\n const closeEditModal = () => {\n setIsEditModalOpen(false);\n setTimeout(() => resetInverter(getEmptyInverterModelDTO()), 300);\n setTimeout(() => setBatteryCompatibilities([]), 300);\n };\n\n useEffect(() => {\n if (isEditModalOpen) {\n setBatteryCompatibilities([]);\n\n resetInverter({\n assetManufacturer: {\n id: inverter?.assetManufacturer.id,\n name: inverter?.assetManufacturer.name,\n },\n inverterModel: {\n id: inverter?.inverterModel.id,\n name: inverter?.inverterModel.name,\n comment: inverter?.inverterModel.comment,\n numberOfBatteryStacksCurrentlySupported:\n inverter?.inverterModel.numberOfBatteryStacksCurrentlySupported,\n maxNumberOfBatteryStacksSupported:\n inverter?.inverterModel.maxNumberOfBatteryStacksSupported,\n },\n batteryCompatibilities: [],\n });\n\n inverter?.batteryCompatibilities.forEach((manufacturer) => {\n manufacturer.batteries.forEach((battery) => {\n if (battery.isCompatible) {\n setBatteryCompatibilities((prev) => [...prev, battery.id]);\n }\n });\n });\n }\n }, [isEditModalOpen, inverter]);\n\n // after submit success\n useEffect(() => {\n if (isUpdated || isDeleted) {\n closeEditModal();\n }\n }, [isUpdated, isDeleted]);\n\n const renderEditInverterButton = () => {\n return (\n <div className=\"pt-4 flex justify-end\">\n <PencilSquareIcon\n className=\"h-5 w-5 mb-4 ml-2 text-flowerblue-700 cursor-pointer hover:text-flowerPeach-900\"\n onClick={() => setIsEditModalOpen(true)}\n />\n </div>\n );\n };\n\n return (\n <>\n {renderEditInverterButton()}\n\n <div className=\"sm:max-w-xl\">\n <Modal\n isOpen={isEditModalOpen}\n onClose={closeEditModal}\n leftButtonAction={closeEditModal}\n leftButtonText={t(`Close`)}\n title={t(`inverter.Edit inverter`)}\n rightButtonActionHandler={onInverterSubmit}\n rightButtonText={t(`Save`)}\n isLoading={isUpdating}\n maxSize=\"sm:max-w-4xl\"\n middleButtonAction={canBeDeleted ? onDeleteInverterSubmit : undefined}\n middleButtonText=\"Delete\"\n >\n {isLoading || isError || inverter === undefined ? (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={false}\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`inverter.Error`)}\n loaderSize=\"page\"\n />\n </div>\n ) : (\n <EditInverterModelForm\n register={registerInverter}\n errors={inverterErrors}\n inverterData={inverter}\n batteryCompatibilities={batteryCompatibilities}\n handleCheckboxChange={handleCheckboxChange}\n />\n )}\n </Modal>\n </div>\n </>\n );\n};\n","import SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { useMapData } from \"api/assetModel/assetModel.endpoints\";\n\nexport const MapDataStep2 = () => {\n // api\n const { mutate: mapData } = useMapData();\n\n return (\n <div className=\"pt-4 flex justify-end\">\n <SecondaryButton onClick={() => mapData()}>Map data</SecondaryButton>\n </div>\n );\n};\n","import CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { isEmptyArray } from \"helpers/array\";\nimport { useTranslation } from \"react-i18next\";\nimport { useAssetManufacturersWithAssets } from \"api/assetManufacturer/assetManufacturer.endpoints\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport { AddAssetManufacturer } from \"./manufacturer/AddAssetManufacturer\";\nimport { EditAssetManufacturer } from \"./manufacturer/EditAssetManufacturer\";\nimport { AddInverterModel } from \"./inverterModel/AddInverterModel\";\nimport { AddBatteryModel } from \"./batteryModel/AddBatteryModel\";\nimport { EditBatteryModel } from \"./batteryModel/EditBatteryModel\";\nimport { EditInverterModel } from \"./inverterModel/EditInverterModel\";\nimport { MapDataStep2 } from \"./MapDataStep2\";\n\nexport const AssetModelConfiguration = () => {\n const { t } = useTranslation();\n\n const {\n data: assetManufacturers,\n isLoading,\n isError,\n } = useAssetManufacturersWithAssets();\n\n if (\n isLoading ||\n isError ||\n assetManufacturers === undefined ||\n isEmptyArray(assetManufacturers)\n ) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError || assetManufacturers === undefined}\n isLoading={isLoading}\n isEmpty={\n assetManufacturers === undefined || isEmptyArray(assetManufacturers)\n }\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`assetManufacturer.Error`)}\n emptyDataMessage={t(`assetManufacturer.Empty`)}\n loaderSize=\"page\"\n />\n\n {!isError && !isLoading && <AddAssetManufacturer />}\n </div>\n );\n }\n\n return (\n <div>\n <div className=\"w-full p-4 rounded-2xl flex flex-col h-max-full min-h-12\">\n <div className=\"flex-grow w-full rounded-lg\">\n {assetManufacturers.map((assetManufacturer) => (\n <div\n key={assetManufacturer.id}\n className=\"mb-4 rounded-lg bg-white shadow\"\n >\n <div className=\"flex justify-center items-center\">\n <h2 className=\"mt-2 text-center text-2xl font-extrabold text-flowerblue-700\">\n {assetManufacturer.name}\n </h2>\n <EditAssetManufacturer\n assetManufacturer={assetManufacturer}\n canBeDeleted={\n !assetManufacturer.batteryModels.some(\n (battery) => battery.isUsed,\n ) ||\n !assetManufacturer.inverterModels.some(\n (inverter) => inverter.isUsed,\n )\n }\n />{\" \"}\n </div>\n\n <div className=\"flex flex-wrap gap-10 my-4 justify-self-center md:justify-start\">\n <div>\n <div className=\"flex justify-center items-center\">\n <h3 className=\"text-xl font-bold text-flowerblue-600\">\n Battery Models\n </h3>\n <AddBatteryModel manufacturerId={assetManufacturer.id} />\n </div>\n {assetManufacturer.batteryModels.length > 0 ? (\n <ul>\n {assetManufacturer.batteryModels.map((battery) => (\n <div\n key={battery.id}\n className=\"flex justify-center items-center\"\n >\n <li>{battery.name}</li>\n <EditBatteryModel\n batteryId={battery.id}\n canBeDeleted={!battery.isUsed}\n />\n </div>\n ))}\n </ul>\n ) : (\n <p>-</p>\n )}\n </div>\n <div>\n <div className=\"flex justify-center items-center\">\n <h3 className=\"text-xl font-bold text-flowerblue-600\">\n Inverter Models\n </h3>\n <AddInverterModel manufacturerId={assetManufacturer.id} />\n </div>\n\n {assetManufacturer.inverterModels.length > 0 ? (\n <ul>\n {assetManufacturer.inverterModels.map((inverter) => (\n <div\n key={inverter.id}\n className=\"flex justify-center items-center\"\n >\n <li key={inverter.id}>{inverter.name}</li>\n <EditInverterModel\n inverterId={inverter.id}\n canBeDeleted={!inverter.isUsed}\n />\n </div>\n ))}\n </ul>\n ) : (\n <p>-</p>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n <AddAssetManufacturer />\n <MapDataStep2 />\n </div>\n );\n};\n","import CustomPlaceholder from \"components/CustomPlaceholder\";\nimport { isEmptyArray } from \"helpers/array\";\nimport { useTranslation } from \"react-i18next\";\nimport { useInverterList } from \"api/assetManufacturer/assetManufacturer.endpoints\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport { PowerCapacity } from \"./inverterModel/PowerCapacity\";\nimport { InverterModelDTO } from \"api/assetManufacturer/assetManufacturer.dto\";\nexport const InverterModelList = () => {\n const { t } = useTranslation();\n\n const { data: invertersList, isLoading, isError } = useInverterList();\n\n if (\n isLoading ||\n isError ||\n invertersList === undefined ||\n isEmptyArray(invertersList)\n ) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={invertersList === undefined || isEmptyArray(invertersList)}\n icon={\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n }\n errorMessage={t(`inverter.Error`)}\n emptyDataMessage={t(`inverter.Empty`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n return (\n <div>\n <div className=\"w-full p-4 rounded-2xl flex flex-col h-max-full min-h-12\">\n <div className=\"flex-grow w-full rounded-lg\">\n {invertersList.map((assetManufacturer) => (\n <div\n key={assetManufacturer.id}\n className=\"mb-4 rounded-lg bg-white shadow\"\n >\n <div className=\"flex justify-center items-center\">\n <h2 className=\"my-2 pt-2 text-center text-2xl font-extrabold text-flowerblue-700\">\n {assetManufacturer.name}\n </h2>\n </div>\n <div className=\"flex flex-wrap gap-10 my-2 justify-self-center md:justify-center\">\n <div>\n {assetManufacturer.inverterModels.length > 0 ? (\n <div>\n {assetManufacturer.inverterModels.map((inverter) => (\n <InverterTile key={inverter.id} inverter={inverter} />\n ))}\n </div>\n ) : (\n <p>-</p>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\n\ninterface InverterTileProp {\n inverter: InverterModelDTO;\n}\n\nconst InverterTile = ({ inverter }: InverterTileProp) => {\n return (\n <div key={inverter.id} className=\"my-4 border rounded-lg\">\n <div\n key={inverter.id}\n className=\"text-xl font-bold text-flowerblue-600 justify-self-center ml-4 my-2\"\n >\n {inverter.name}\n </div>\n\n <div className=\"grid grid-cols-2 gap-4 \">\n <div className=\"ml-4 mb-4 border-r border-gray-200 pr-10 space-y-3\">\n <div>\n <span className=\"text-sm justify-self-center ml-2\">\n Number of battery stacks currently supported : {\"\"}\n </span>\n {inverter.numberOfBatteryStacksCurrentlySupported}\n </div>\n <div>\n <span className=\"text-sm justify-self-center ml-2\">\n Max number of battery stacks supported : {\"\"}\n </span>\n {inverter.maxNumberOfBatteryStacksSupported}\n </div>\n <div>\n <span className=\"text-sm justify-self-center ml-2\">\n Output power capacities : {\"\"}\n </span>\n </div>\n <div className=\"grid grid-cols-4 gap-4 my-4 \">\n {inverter.outputPowerCapacities.map((powerCapacity, index) => (\n <PowerCapacity key={index} powerCapacity={powerCapacity} />\n ))}\n </div>\n <div className=\"text-sm ml-2 mb-4\">{inverter.comment}</div>\n </div>\n\n <div className=\"pl-3\">\n <span className=\"text-sm justify-self-center ml-2\">\n Compatible batteries\n </span>\n {inverter.constraints.length > 0 ? (\n <ul>\n {inverter.constraints.map((constraint) => (\n <div\n key={constraint.id}\n className=\"flex justify-start items-center mt-2\"\n >\n <li key={constraint.id}>{constraint.batteryModelName}</li>\n </div>\n ))}\n </ul>\n ) : (\n <p>-</p>\n )}\n </div>\n </div>\n </div>\n );\n};\n","import { TabPageWrapper } from \"components/tab/TabPageWrapper\";\nimport { useEffect } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { RouteUrl } from \"routing/routeUrl.enum\";\nimport { RouteLabel } from \"routing/routeLabel.enum\";\nimport { BreadCrumb, menuStore } from \"store/menu.store\";\n\nimport { useTranslation } from \"react-i18next\";\nimport TabContainer from \"../../../components/tab/TabContainer\";\nimport { AssetModelConfiguration } from \"components/assetModelConfiguration/AssetModelConfiguration\";\nimport { InverterModelList } from \"components/assetModelConfiguration/InverterModelList\";\n\nconst INVERTERS_LIST = \"inverters-list\";\nconst CONFIGURATION = \"configuration\";\n\nexport const AssetModelConfigurationPage = () => {\n const { t } = useTranslation();\n\n // Tab\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs(getBreadCrumbs());\n }, []);\n\n const currentTab = searchParams.get(\"tab\") || CONFIGURATION;\n\n return (\n <TabPageWrapper\n tabs={[\n {\n param: CONFIGURATION,\n label: t(`assetModel.configuration`),\n content: (\n <TabContainer key={CONFIGURATION}>\n <AssetModelConfiguration />\n </TabContainer>\n ),\n isSelected: currentTab === CONFIGURATION,\n },\n {\n param: INVERTERS_LIST,\n label: t(`assetModel.Inverter-list`),\n content: (\n <TabContainer key={INVERTERS_LIST}>\n <InverterModelList />\n </TabContainer>\n ),\n isSelected: currentTab === INVERTERS_LIST,\n },\n ]}\n setTab={setTab}\n />\n );\n};\n\nconst getBreadCrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.AssetModelConfiguration,\n to: `${RouteUrl.App}/${RouteUrl.AssetModelConfiguration}`,\n },\n];\n","import { classNames } from \"../../helpers/classNames\";\nimport { FC, ReactNode } from \"react\";\n\ninterface Props {\n children: ReactNode;\n isWide?: boolean;\n}\n\nexport const ScrollablePage: FC<Props> = ({ children, isWide = false }) => (\n <div className=\"flex flex-col flex-1 mr-auto py-4 md:py-8 px-4 md:px-8 w-full h-full overflow-x-hidden overflow-y-auto\">\n <div\n className={classNames(\n \"flex flex-col\",\n isWide ? \"max-w-screen-2xl\" : \"max-w-screen-xl\",\n )}\n >\n {children}\n </div>\n </div>\n);\n","import { classNames } from \"../../helpers/classNames\";\nimport { FC, ReactNode } from \"react\";\n\ninterface Props {\n children: ReactNode;\n isWide?: boolean;\n style?: string;\n}\n\nexport const NotScrollablePage: FC<Props> = ({\n children,\n isWide = false,\n style = \"\",\n}) => (\n <div\n className={classNames(\n \"flex flex-col mr-auto px-4 md:px-8 w-full h-full overflow-hidden\",\n isWide ? \"max-w-screen-2xl\" : \"max-w-screen-xl\",\n style,\n )}\n >\n {children}\n </div>\n);\n","import { FC, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport Modal from \"../Modal\";\nimport { TrashIcon } from \"@heroicons/react/24/outline\";\nimport { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { useDeleteCompensationModelPeriod } from \"../../api/compensation/compensation.endpoints\";\n\ninterface Props {\n compensationModelPeriodId: number;\n}\n\nexport const DeleteCompensationModel: FC<Props> = ({\n compensationModelPeriodId,\n}) => {\n const { t } = useTranslation();\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n // api\n const { mutate } = useDeleteCompensationModelPeriod();\n\n // submit\n const onDeleteCompensationModelPeriod = (compensationModelPeriodId: number) =>\n mutate(compensationModelPeriodId);\n\n // modal close\n const onCloseModal = () => {\n setIsModalOpen(false);\n };\n\n return (\n <>\n <div className=\"w-4 h-5 justify-center flex\">\n <button onClick={() => setIsModalOpen(true)}>\n <TrashIcon\n className=\"h-5 w-5 text-flowerRed-800 hover:text-flowerRed-500\"\n aria-hidden=\"true\"\n />\n </button>\n </div>\n\n <Modal\n title={t(\"compensationModel.Delete compensation model period\")}\n leftButtonAction={onCloseModal}\n leftButtonText={t(`Close`)}\n rightButtonText={t(\"Delete\")}\n rightButtonActionHandler={() =>\n onDeleteCompensationModelPeriod(compensationModelPeriodId)\n }\n isOpen={isModalOpen}\n onClose={onCloseModal}\n loadingText={t(\"compensationModel.Delete compensation model period\")}\n >\n <ModalContentWrapper>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n {t(\n \"compensationModel.Are you sure you want to delete this compensation period?\",\n )}\n </p>\n </div>\n </ModalContentWrapper>\n </Modal>\n </>\n );\n};\n","import { ExclamationCircleIcon } from \"@heroicons/react/20/solid\";\nimport { classNames } from \"helpers/classNames\";\nimport { FC } from \"react\";\nimport {\n Control,\n Controller,\n FieldValues,\n RegisterOptions,\n} from \"react-hook-form\";\nimport moment from \"moment\";\nimport DatePicker from \"react-datepicker\";\nimport \"react-datepicker/dist/react-datepicker.css\";\n\ninterface Props {\n label: string;\n name: string;\n validation?: Pick<\n RegisterOptions<FieldValues>,\n \"maxLength\" | \"minLength\" | \"validate\" | \"required\"\n >;\n //[LINT_TODO] Type casting with generic Filed value not working here. Do more research and make a solution.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n control?: Control<any>;\n minDate?: Date;\n maxDate?: Date;\n getEndOfTheMonth?: boolean;\n}\n\nexport const MonthTimePicker: FC<Props> = ({\n label,\n name,\n validation,\n control,\n minDate = undefined,\n maxDate = undefined,\n getEndOfTheMonth = false,\n}) => {\n return (\n <div>\n <label htmlFor={name} className=\"block text-sm font-medium text-gray-700\">\n {label}\n </label>\n <div className=\"mt-1 relative rounded-md\">\n <Controller\n control={control}\n name={name}\n rules={validation}\n render={({ field, fieldState }) => (\n <>\n <DatePicker\n onChange={(date) => {\n const newDate =\n getEndOfTheMonth && date\n ? moment(date)\n .endOf(\"month\")\n .format(\"YYYY-MM-DD HH:mm:ss\")\n : moment(date)\n .startOf(\"month\")\n .format(\"YYYY-MM-DD HH:mm:ss\");\n field.onChange(newDate);\n }}\n selected={field.value}\n toggleCalendarOnIconClick\n preventOpenOnFocus\n showMonthYearPicker={true}\n showIcon\n icon={\n <svg\n className=\"w-4 h-5 text-gray-500 dark:text-gray-400\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n >\n <path d=\"M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z\" />\n </svg>\n }\n dateFormat={\"MMMM d, yyyy\"}\n minDate={minDate}\n maxDate={maxDate}\n className={classNames(\n fieldState.error\n ? \"border-red-300 focus:border-red-500 focus:outline-none focus:ring-red-500 pr-10 text-red-900 placeholder-red-300 rounded-md shadow-sm !pl-8\"\n : \"border-gray-300 focus:border-flowerblue-500 focus:ring-flowerblue-500 rounded-md shadow-sm !pl-8\",\n )}\n />\n {fieldState.error && (\n <div className=\"flex flex-row items-center mt-2\">\n <ExclamationCircleIcon\n className=\"h-5 w-5 text-red-500\"\n aria-hidden=\"true\"\n />\n <p className=\"ml-1 text-sm text-red-600\">\n {fieldState.error.message}\n </p>\n </div>\n )}\n </>\n )}\n />\n </div>\n </div>\n );\n};\n","import { ModalContentWrapper } from \"components/ModalContentWrapper\";\nimport { TextInput } from \"components/input/TextInput\";\nimport { naturalNumberValidator } from \"helpers/validation\";\nimport { FC } from \"react\";\nimport { Control, FieldErrorsImpl, UseFormRegister } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { MonthTimePicker } from \"../input/MonthDatePicker\";\nimport { CreateCompensationModelHistoryRequestDTO } from \"../../api/compensation/compensation.dto\";\nimport moment from \"moment/moment\";\n\ninterface Props {\n register: UseFormRegister<CreateCompensationModelHistoryRequestDTO>;\n control: Control<CreateCompensationModelHistoryRequestDTO>;\n getValues: (\n payload?: string | string[],\n ) => CreateCompensationModelHistoryRequestDTO;\n errors: Partial<FieldErrorsImpl<CreateCompensationModelHistoryRequestDTO>>;\n}\n\nexport const AddCompensationModelPeriodForm: FC<Props> = ({\n register,\n control,\n getValues,\n errors,\n}) => {\n const { t } = useTranslation();\n\n return (\n <ModalContentWrapper>\n <TextInput\n label={t(`compensationModel.asset owner compensation`)}\n name=\"assetOwnerCompensation\"\n register={register}\n registerOptions={naturalNumberValidator}\n errorMessage={errors.assetOwnerCompensation?.message}\n type=\"number\"\n appendix={t(`compensationModel.compensation unit`)}\n />\n <TextInput\n label={t(`compensationModel.installer compensation`)}\n name=\"installerCompensation\"\n register={register}\n registerOptions={naturalNumberValidator}\n errorMessage={errors.installerCompensation?.message}\n type=\"number\"\n appendix={t(`compensationModel.compensation unit`)}\n />\n <TextInput\n label={t(`compensationModel.distributor compensation`)}\n name=\"distributorCompensation\"\n register={register}\n registerOptions={naturalNumberValidator}\n errorMessage={errors.distributorCompensation?.message}\n type=\"number\"\n appendix={t(`compensationModel.compensation unit`)}\n />\n <MonthTimePicker\n label={t(\"From\")}\n name=\"startDate\"\n control={control}\n validation={{\n required: t(`compensation.DateIsRequired`),\n }}\n />\n <MonthTimePicker\n label={t(\"To\")}\n name=\"endDate\"\n control={control}\n getEndOfTheMonth={true}\n validation={{\n required: t(`compensation.DateIsRequired`),\n validate: (value) => {\n const obj = getValues();\n return (\n moment.utc(new Date(value)) >\n moment.utc(new Date(obj.startDate)) ||\n t(`compensation.EndDateMustBeAfterStartDate`)\n );\n },\n }}\n />\n </ModalContentWrapper>\n );\n};\n","import Modal from \"components/Modal\";\nimport { FC, useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { AddCompensationModelPeriodForm } from \"./AddCompensationModelPeriodForm\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { useTranslation } from \"react-i18next\";\nimport { useCreateCompensationModelPeriod } from \"../../api/compensation/compensation.endpoints\";\nimport { PlusCircleIcon } from \"@heroicons/react/24/outline\";\nimport { CreateCompensationModelHistoryRequestDTO } from \"../../api/compensation/compensation.dto\";\n\nexport const AddCompensationModelPeriod: FC = () => {\n const { t } = useTranslation();\n const [isModalOpen, setIsModalOpen] = useState<boolean>(false);\n\n // api\n const { mutate, isPending, isSuccess } = useCreateCompensationModelPeriod();\n\n // form\n const {\n register,\n control,\n handleSubmit,\n reset,\n getValues,\n formState: { errors },\n } = useForm<CreateCompensationModelHistoryRequestDTO>();\n\n // submit\n const onSubmit = handleSubmit((data) => {\n mutate(data);\n });\n\n // close modal\n const closeModal = () => {\n setIsModalOpen(false);\n setTimeout(() => reset(), 300);\n };\n\n // trigger on successful add\n useEffect(() => {\n if (isSuccess) {\n closeModal();\n }\n }, [isSuccess]);\n\n return (\n <>\n <div className=\"flex justify-end\">\n <SecondaryButton onClick={() => setIsModalOpen(true)}>\n <PlusCircleIcon className=\"h-5 w-5 mr-1\" />\n {t(\"compensation.AddCompensationPeriod\")}\n </SecondaryButton>\n </div>\n\n <Modal\n isOpen={isModalOpen}\n onClose={closeModal}\n leftButtonAction={closeModal}\n leftButtonText={t(`Close`)}\n title={t(\"compensation.AddCompensationPeriod\")}\n rightButtonActionHandler={onSubmit}\n isLoading={isPending}\n rightButtonText={t(\"Add\")}\n >\n <AddCompensationModelPeriodForm\n register={register}\n control={control}\n getValues={getValues}\n errors={errors}\n />\n </Modal>\n </>\n );\n};\n","import { useTranslation } from \"react-i18next\";\nimport {\n useCompensationModelHistory,\n useCurrentCompensationModelPeriod,\n} from \"../../api/compensation/compensation.endpoints\";\nimport React, { useMemo } from \"react\";\nimport { CompensationStatistics, Tile } from \"./CompensationStatistics\";\nimport { TableOptions } from \"@tanstack/react-table\";\nimport { DeleteCompensationModel } from \"./DeleteCompensationModel\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport { Cog6ToothIcon } from \"@heroicons/react/16/solid\";\nimport { BanknotesIcon } from \"@heroicons/react/24/outline\";\nimport { AddCompensationModelPeriod } from \"./AddCompensationModelPeriod\";\nimport { TanStackTable } from \"../table/TanStackTable\";\nimport { GetCompensationModelHistoryResponseDTO } from \"../../api/compensation/compensation.dto\";\nimport moment from \"moment\";\n\nexport const CompensationModelTab = () => {\n const { t } = useTranslation();\n\n const {\n data: currentCompensationModel,\n isLoading: isLoadingCurrentCompensationModel,\n isError: isErrorCurrentCompensationModel,\n } = useCurrentCompensationModelPeriod();\n\n const {\n data: compensationModelHistory,\n isLoading: isLoadingCompensationModelHistory,\n isError: isErrorCompensationModelHistory,\n } = useCompensationModelHistory();\n\n const isLoading =\n isLoadingCurrentCompensationModel || isLoadingCompensationModelHistory;\n const isError =\n isErrorCurrentCompensationModel || isErrorCompensationModelHistory;\n\n const currentCompensationTiles: Tile[] = useMemo(\n () =>\n currentCompensationModel\n ? [\n {\n title: t(\"compensationModel.asset owner\"),\n value: `${currentCompensationModel.assetOwnerCompensation} ${t(\"compensationModel.compensation unit\")}`,\n },\n {\n title: t(\"compensationModel.installer\"),\n value: `${currentCompensationModel.installerCompensation} ${t(\"compensationModel.compensation unit\")}`,\n },\n {\n title: t(\"compensationModel.distributor\"),\n value: `${currentCompensationModel.distributorCompensation} ${t(\"compensationModel.compensation unit\")}`,\n },\n ]\n : [],\n [currentCompensationModel],\n );\n\n const columns: TableOptions<GetCompensationModelHistoryResponseDTO>[\"columns\"] =\n useMemo(\n () => [\n {\n header: t(\"From\"),\n accessorKey: \"startDate\",\n accessorFn: (row) => moment.utc(row?.startDate).format(\"DD MMM YYYY\"),\n },\n {\n header: t(\"To\"),\n accessorKey: \"endDate\",\n accessorFn: (row) => moment.utc(row?.endDate).format(\"DD MMM YYYY\"),\n },\n {\n header: t(\"compensationModel.asset owner\"),\n accessorKey: \"assetOwnerCompensation\",\n accessorFn: (row) => {\n return `${row?.assetOwnerCompensation} ${t(\"compensationModel.compensation unit\")}`;\n },\n },\n {\n header: t(\"compensationModel.installer\"),\n accessorKey: \"installerCompensation\",\n accessorFn: (row) => {\n return `${row?.installerCompensation} ${t(\"compensationModel.compensation unit\")}`;\n },\n },\n {\n header: t(\"compensationModel.distributor\"),\n accessorKey: \"distributorCompensation\",\n accessorFn: (row) => {\n return `${row?.distributorCompensation} ${t(\"compensationModel.compensation unit\")}`;\n },\n },\n {\n header: \"\",\n accessorKey: \"action\",\n accessorFn: (row) => row,\n cell: (row) => {\n const data: GetCompensationModelHistoryResponseDTO = row.getValue();\n if (new Date(data.startDate) < new Date()) {\n return <div className=\"w-4 h-5 justify-center flex\"></div>;\n }\n return (\n <DeleteCompensationModel compensationModelPeriodId={data.id} />\n );\n },\n },\n ],\n [compensationModelHistory],\n );\n\n if (isLoading || isError) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={isError}\n isLoading={isLoading}\n isEmpty={false}\n icon={<Cog6ToothIcon />}\n errorMessage={t(`compensationModel.error`)}\n emptyDataMessage={t(`compensationModel.empty`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"overflow-auto\">\n <CompensationStatistics\n title={t(\"compensationModel.Current compensation\")}\n icon={<BanknotesIcon />}\n tiles={currentCompensationTiles}\n emptyDataMessage={t(\"compensationModel.NotFound\")}\n warmingMessage={\n currentCompensationModel ? \"\" : t(\"compensationModel.WarningMessage\")\n }\n />\n\n <div className=\"flex flex-col\">\n <div className=\"relative top-11 w-fit min-w-60 rounded flex justify-between items-end\">\n <AddCompensationModelPeriod />\n </div>\n <div className=\"flex flex-col w-full overflow-hidden\">\n <TanStackTable\n columns={columns}\n data={compensationModelHistory ? compensationModelHistory : []}\n filters={[]}\n />\n </div>\n </div>\n </div>\n );\n};\n","import api from \"api/axiosInstance\";\nimport {\n GetBillingAdjustmentStatisticsResponseDTO,\n GetQualifiedAssetOwnerItemResponseDTO,\n} from \"./bessCompensation.dto\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\n\nconst ENDPOINT = \"/bess-compensation\";\n\nexport enum BessCompensationQueryKeys {\n GetBillingAdjustmentStatistics = \"get-statistics\",\n GetQualifiedAssetOwners = \"get-qualified-asset-owners\",\n}\n\nexport const useBillingAdjustmentStatistics = () => {\n return useQuery({\n queryKey: [BessCompensationQueryKeys.GetBillingAdjustmentStatistics],\n queryFn: async (): Promise<GetBillingAdjustmentStatisticsResponseDTO> =>\n (await api.get(`${ENDPOINT}/billing-adjustment-statistics`)).data,\n });\n};\n\nexport const useQualifiedAssetOwners = () => {\n return useQuery({\n queryKey: [BessCompensationQueryKeys.GetQualifiedAssetOwners],\n queryFn: async (): Promise<GetQualifiedAssetOwnerItemResponseDTO[]> =>\n (await api.get(`${ENDPOINT}`)).data,\n });\n};\n\nexport const usePostBillingAdjustments = () => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: async (): Promise<void> =>\n (await api.post(`${ENDPOINT}/billing-adjustments`)).data,\n\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: [\n BessCompensationQueryKeys.GetQualifiedAssetOwners,\n BessCompensationQueryKeys.GetBillingAdjustmentStatistics,\n ],\n });\n },\n });\n};\n","import React from \"react\";\n\ninterface KeyValueTileProp {\n keyword: string;\n value: number | string;\n}\n\nconst KeyValueTile: React.FC<KeyValueTileProp> = ({ keyword, value }) => {\n return (\n <div key={keyword} className=\"flex flex-col bg-white p-4\">\n <dt className=\"text-sm font-base leading-6 text-gray-600\">{keyword}</dt>\n <dd className=\"order-first text-3xl font-base tracking-tight text-gray-900\">\n {value}\n </dd>\n </div>\n );\n};\n\nexport default KeyValueTile;\n","import {\n BuildingLibraryIcon,\n CheckBadgeIcon,\n ClipboardDocumentListIcon,\n HomeModernIcon,\n PaperAirplaneIcon,\n} from \"@heroicons/react/24/outline\";\nimport { useBillingAdjustmentStatistics } from \"api/bessCompensation/bessCompensation.endpoints\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport DashboardTile from \"components/statistics/DashboardTile\";\nimport KeyValueTile from \"components/statistics/KeyValueTile\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const BillingAdjustmentStatistics: FC = () => {\n const { t } = useTranslation();\n\n const {\n data: statisticsData,\n isLoading: isLoadingStatistics,\n isError: statisticsIsErrored,\n } = useBillingAdjustmentStatistics();\n\n if (isLoadingStatistics || !statisticsData || statisticsIsErrored) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isError={statisticsIsErrored}\n isLoading={isLoadingStatistics}\n isEmpty={\n !isLoadingStatistics && !statisticsIsErrored && !statisticsData\n }\n icon={<ClipboardDocumentListIcon />}\n errorMessage={t(`dashboardStatistics.UnableToLoad`)}\n emptyDataMessage={t(`dashboardStatistics.NotFound`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"flow-root w-full mb-6\">\n <dl className=\"flex flex-wrap gap-4 my-2 justify-center md:justify-start\">\n <DashboardTile\n title={t(\"billingAdjustment.TotalAssetOwners\")}\n leftStat={{\n count: statisticsData.totalAssetOwners,\n }}\n showDeviation={false}\n icon={<HomeModernIcon />}\n />\n <DashboardTile\n title={t(\"billingAdjustment.QualifiedAssetOwners\")}\n leftStat={{\n count: statisticsData.qualifiedAssetOwnersCount,\n }}\n showDeviation={false}\n icon={<CheckBadgeIcon />}\n />\n <DashboardTile\n title={t(\"billingAdjustment.RegisteredBankAccount\")}\n leftStat={{\n count: statisticsData.bankAccountRegisteredAssetOwnersCount,\n }}\n icon={<BuildingLibraryIcon />}\n showDeviation={false}\n />\n <DashboardTile\n title={t(\"billingAdjustment.BillingAdjustmentPosted\")}\n leftStat={{\n count: statisticsData.billingAdjustmentPostedAssetOwnerCount,\n }}\n icon={<PaperAirplaneIcon />}\n showDeviation={false}\n />\n </dl>\n <dl className=\"mt-4 grid grid-cols-1 gap-0.5 overflow-hidden rounded-2xl text-center sm:grid-cols-2 lg:grid-cols-3 shadow\">\n <KeyValueTile\n keyword={t(\"billingAdjustment.QualifiedTotal\")}\n value={`${statisticsData.qualifiedTotalAmount} SEK`}\n />\n <KeyValueTile\n keyword={t(\"billingAdjustment.PayoutTotal\")}\n value={`${statisticsData.payoutTotal} SEK`}\n />\n <KeyValueTile\n keyword={t(\"billingAdjustment.BillingAdjustmentPostedTotal\")}\n value={`${statisticsData.billingAdjustmentPostedTotal} SEK`}\n />\n </dl>\n </div>\n );\n};\n","import { sub } from \"date-fns\";\n\nexport const currentInvoicedMonth = sub(new Date(), {\n months: 1,\n}).toLocaleString(\"default\", { month: \"long\", year: \"numeric\" });\n","export enum PostBillingAdjustmentsStatusTypes {\n Sent = \"Sent\",\n NotSent = \"Not sent\",\n}\n\nexport enum PayoutInformationStatusTypes {\n Registered = \"Registered\",\n NotRegistered = \"Not registered\",\n}\n","import { FC } from \"react\";\nimport { Badge, BadgeSize } from \"./Badge\";\nimport { PostBillingAdjustmentsStatusTypes } from \"enums/postBillingAdjustmentStatus.enums\";\n\ninterface Props {\n status: PostBillingAdjustmentsStatusTypes;\n size?: BadgeSize;\n}\n\nexport const BillingAdjustmentStatusTag: FC<Props> = ({\n status,\n size = \"small\",\n}) => {\n return (\n <div className=\"flex items-center\">\n <Badge\n color={\n status === PostBillingAdjustmentsStatusTypes.Sent ? \"green\" : \"red\"\n }\n text={status}\n size={size}\n />\n </div>\n );\n};\n","import { FC } from \"react\";\nimport { Badge, BadgeSize } from \"./Badge\";\nimport { PayoutInformationStatusTypes } from \"enums/postBillingAdjustmentStatus.enums\";\n\ninterface Props {\n status: PayoutInformationStatusTypes;\n size?: BadgeSize;\n}\n\nexport const PayoutInformationStatusTag: FC<Props> = ({\n status,\n size = \"small\",\n}) => {\n return (\n <div className=\"flex items-center\">\n <Badge\n color={\n status === PayoutInformationStatusTypes.Registered ? \"green\" : \"red\"\n }\n text={status}\n size={size}\n />\n </div>\n );\n};\n","import { DIGIT_REGEX } from \"constants/regex\";\nimport { FC, ChangeEvent, KeyboardEvent } from \"react\";\n\ninterface OtpInputProps {\n value: string[];\n onChange: (e: ChangeEvent<HTMLInputElement>, index: number) => void;\n onKeyDown: (e: KeyboardEvent<HTMLInputElement>, index: number) => void;\n error: string | null;\n}\n\nconst OtpInput: FC<OtpInputProps> = ({ value, onChange, onKeyDown, error }) => {\n return (\n <>\n <div className=\"mt-8 flex justify-center space-x-2\">\n {value.map((val, index) => (\n <input\n key={index}\n id={`code-input-${index}`}\n type=\"text\"\n value={val}\n onChange={(e) => onChange(e, index)}\n onKeyDown={(e) => onKeyDown(e, index)}\n maxLength={1}\n className={`w-12 h-12 text-center text-xl border rounded-md ${\n error && !value.every((v) => DIGIT_REGEX.test(v))\n ? \"border-red-500\"\n : \"border-gray-300\"\n }`}\n />\n ))}\n </div>\n {error && <p className=\"mt-2 text-red-500 text-sm\">{error}</p>}\n </>\n );\n};\n\nexport default OtpInput;\n","import {\n Dialog,\n DialogBackdrop,\n DialogPanel,\n DialogTitle,\n} from \"@headlessui/react\";\nimport { BanknotesIcon } from \"@heroicons/react/24/outline\";\nimport { useRequestOTP, useVerifyOTP } from \"api/auth/auth.endpoints\";\nimport OtpInput from \"components/input/OtpInput\";\nimport { Badge } from \"components/tags/Badge\";\nimport { SINGLE_DIGIT_REGEX } from \"constants/regex\";\nimport { FC, useState, ChangeEvent, KeyboardEvent, useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface PostBillingConfirmationModalProps {\n open: boolean;\n closeModal: () => void;\n onOTPVerified: () => void;\n}\n\nconst PostBillingAdjustmentConfirmationModal: FC<\n PostBillingConfirmationModalProps\n> = ({ open, closeModal, onOTPVerified }) => {\n const { t } = useTranslation();\n const [inputCode, setInputCode] = useState<string[]>(new Array(6).fill(\"\"));\n const [error, setError] = useState<string | null>(null);\n const {\n mutate: validateOtp,\n data: isValidOtp,\n isPending: isVerifyingOtp,\n } = useVerifyOTP();\n const { mutate: requestOtp } = useRequestOTP();\n\n useEffect(() => {\n if (open) {\n requestOtp();\n } else {\n setInputCode(new Array(6).fill(\"\"));\n }\n }, [open, requestOtp]);\n\n useEffect(() => {\n if (!isVerifyingOtp) {\n if (isValidOtp === false) {\n setError(\n t(\n \"billingAdjustment.The OTP you entered is invalid, please try again\",\n ),\n );\n } else if (isValidOtp === true) {\n onOTPVerified();\n setError(null); // Clear any existing error on success\n } else {\n setError(null); // No OTP validation result yet\n }\n }\n }, [isVerifyingOtp, isValidOtp, onOTPVerified]);\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>, index: number) => {\n const value = e.target.value;\n if (SINGLE_DIGIT_REGEX.test(value)) {\n const newCode = [...inputCode];\n newCode[index] = value;\n setInputCode(newCode);\n\n // Focus the next input if a value is entered\n if (value && index < 5) {\n (\n document.getElementById(`code-input-${index + 1}`) as HTMLInputElement\n )?.focus();\n }\n }\n setError(null);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>, index: number) => {\n if (e.key === \"Backspace\" && !inputCode[index] && index > 0) {\n // Focus the previous input if backspace is pressed and current input is empty\n (\n document.getElementById(`code-input-${index - 1}`) as HTMLInputElement\n )?.focus();\n }\n };\n\n const isValidCode = () => {\n const code = inputCode.join(\"\");\n return code.length === 6 && /^\\d+$/.test(code);\n };\n\n const handleSend = async () => {\n validateOtp({ userOtp: inputCode.join(\"\") });\n };\n\n return (\n <Dialog open={open} onClose={closeModal} className=\"relative z-10\">\n <DialogBackdrop\n transition\n className=\"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity\"\n />\n <div className=\"fixed inset-0 z-10 w-screen overflow-y-auto\">\n <div className=\"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0\">\n <DialogPanel\n transition\n className=\"relative transform overflow-hidden rounded-lg bg-white px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:w-full sm:my-8 max-w-xl sm:p-6\"\n >\n <div className=\"text-center\">\n <div className=\"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100\">\n <BanknotesIcon\n aria-hidden=\"true\"\n className=\"h-6 w-6 text-green-600\"\n />\n </div>\n <div className=\"mt-3 sm:mt-5\">\n <DialogTitle\n as=\"h3\"\n className=\"text-base font-semibold leading-6 text-gray-900\"\n >\n {t(\"billingAdjustment.Send Billing Adjustments\")}\n </DialogTitle>\n <p className=\"mt-2 text-sm text-gray-500\">\n {t(\n \"billingAdjustment.An OTP which is valid for 2 minutes, has been sent to your email. Enter that code below to proceed\",\n )}\n </p>\n <div className=\"cursor-pointer\" onClick={() => requestOtp()}>\n <Badge color=\"yellow\" text={t(\"Resend OTP\")} />\n </div>\n <OtpInput\n value={inputCode}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n error={error}\n />\n </div>\n </div>\n <div className=\"mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3\">\n <button\n type=\"button\"\n onClick={() => handleSend()}\n disabled={!isValidCode()}\n className={`inline-flex w-full justify-center rounded-md px-3 py-2 text-sm font-semibold shadow-sm sm:col-start-2 ${\n isValidCode()\n ? \"bg-indigo-600 text-white hover:bg-indigo-500\"\n : \"bg-gray-300 text-gray-500 cursor-not-allowed\"\n }`}\n >\n {t(\"Send\")}\n </button>\n <button\n type=\"button\"\n data-autofocus\n onClick={closeModal}\n className=\"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:col-start-1 sm:mt-0\"\n >\n {t(\"Cancel\")}\n </button>\n </div>\n </DialogPanel>\n </div>\n </div>\n </Dialog>\n );\n};\n\nexport default PostBillingAdjustmentConfirmationModal;\n","import { FC, useEffect } from \"react\";\nimport {\n Dialog,\n DialogBackdrop,\n DialogPanel,\n DialogTitle,\n} from \"@headlessui/react\";\nimport { useTranslation } from \"react-i18next\";\nimport { usePostBillingAdjustments } from \"api/bessCompensation/bessCompensation.endpoints\";\nimport { FlowerSymbolLogo } from \"styles/Icons\";\nimport { debounce } from \"lodash\";\n\ninterface PostBillingAdjustmentModalProps {\n open: boolean;\n closeModal: () => void;\n}\n\nconst PostBillingAdjustmentModal: FC<PostBillingAdjustmentModalProps> = ({\n open,\n closeModal,\n}) => {\n const { t } = useTranslation();\n\n const {\n mutate: sendAdjustment,\n isPending: isLoading,\n isError,\n isSuccess,\n } = usePostBillingAdjustments();\n\n useEffect(() => {\n const handleAdjustment = debounce(() => {\n if (open) {\n sendAdjustment();\n }\n }, 300); // 1000ms debounce\n\n handleAdjustment();\n\n return () => {\n handleAdjustment.cancel();\n };\n }, [open]);\n\n return (\n <Dialog open={open} onClose={() => {}} className=\"relative z-10\">\n <DialogBackdrop\n transition\n className=\"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity\"\n />\n <div className=\"fixed inset-0 z-10 w-screen overflow-y-auto\">\n <div className=\"flex min-h-full items-center justify-center p-4 text-center sm:p-0\">\n <DialogPanel\n transition\n className=\"relative z-10 flex flex-col justify-between overflow-hidden rounded-lg px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-xl sm:p-6 min-h-96 bg-white\"\n >\n <div className=\"flex-grow flex flex-col items-center justify-center\">\n <div className=\"flex flex-shrink-0 items-center justify-center my-4\">\n <img\n className={`h-auto w-28`}\n src={FlowerSymbolLogo}\n alt=\"Flower Hub\"\n />\n </div>\n <div className=\"text-center\">\n <DialogTitle\n as=\"h3\"\n className=\"text-lg font-semibold leading-6 text-gray-600\"\n >\n <p>\n {isLoading &&\n t(\"billingAdjustment.Sending post billing adjustment\")}\n {isSuccess &&\n t(\"billingAdjustment.Adjustment sent successfully\")}\n {isError &&\n t(\"billingAdjustment.Post billing adjustments failed\")}\n </p>\n </DialogTitle>\n </div>\n </div>\n\n <div className=\"mt-5\">\n {!isLoading && (\n <button\n type=\"button\"\n onClick={closeModal}\n className=\"inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50\"\n >\n {t(\"Close\")}\n </button>\n )}\n </div>\n </DialogPanel>\n </div>\n </div>\n </Dialog>\n );\n};\n\nexport default PostBillingAdjustmentModal;\n","import { isDev, isLocal, isProd } from \"./environment\";\n\n//Only certain flower users are allowed to post billing adjustments\nconst LocalPostBillingAdjustmentAllowedUserIDs = [1];\nconst DevPostBillingAdjustmentAllowedUserIDs = [71, 198]; // Usernames = I, A\nconst ProdPostBillingAdjustmentAllowedUserIDs = [8, 647, 981, 1265]; // Usernames = E, M, A, K\n\nexport const postBillingAdjustmentAllowedUserIDs = (): number[] => {\n if (isLocal()) return LocalPostBillingAdjustmentAllowedUserIDs;\n if (isDev()) return DevPostBillingAdjustmentAllowedUserIDs;\n if (isProd()) return ProdPostBillingAdjustmentAllowedUserIDs;\n return [];\n};\n","import { FC, useMemo, useState } from \"react\";\nimport { PaperAirplaneIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { GetQualifiedAssetOwnerItemResponseDTO } from \"api/bessCompensation/bessCompensation.dto\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport PostBillingAdjustmentConfirmationModal from \"./PostBillingAdjustmentConfirmationModal\";\nimport PostBillingAdjustmentModal from \"./PostBillingAdjustmentModal\";\nimport { postBillingAdjustmentAllowedUserIDs } from \"constants/billingAdjustments\";\nimport userStore, { getUserId } from \"store/user.store\";\n\ninterface Props {\n assetOwners: GetQualifiedAssetOwnerItemResponseDTO[];\n}\nexport const PostBillingAdjustment: FC<Props> = ({ assetOwners }) => {\n const { t } = useTranslation();\n const userId = userStore(getUserId);\n const [isConfirmationModalOpen, setIsConfirmationModalOpen] = useState(false);\n const [\n isPostBillingAdjustmentModalOpen,\n setIsPostBillingAdjustmentModalOpen,\n ] = useState(false);\n\n const shouldShowSendBillingAdjustmentButton = (): boolean => {\n const hasNotPostedBillingAdjustments =\n assetOwners.some(\n (customer) => !customer.compensation.billingAdjustmentsHasPosted,\n ) ?? false; // Ensure it defaults to false if undefined\n\n return (\n hasNotPostedBillingAdjustments &&\n userId !== undefined &&\n postBillingAdjustmentAllowedUserIDs().includes(userId)\n );\n };\n\n const displayButton = useMemo(\n () => shouldShowSendBillingAdjustmentButton(),\n [assetOwners],\n );\n\n const startPostingBillingAdjustments = () => {\n setIsConfirmationModalOpen(false);\n setTimeout(() => {\n setIsPostBillingAdjustmentModalOpen(true);\n }, 300);\n };\n\n return (\n <div className=\"block\">\n {displayButton && (\n <SecondaryButton\n onClick={() => setIsConfirmationModalOpen(true)}\n className=\"max-h-10\"\n >\n <PaperAirplaneIcon className=\"h-5 w-5 mr-1\" />{\" \"}\n {t(\"billingAdjustment.SendBillingAdjustments\")}\n </SecondaryButton>\n )}\n {isConfirmationModalOpen && (\n <PostBillingAdjustmentConfirmationModal\n open={isConfirmationModalOpen}\n closeModal={() => setIsConfirmationModalOpen(false)}\n onOTPVerified={startPostingBillingAdjustments}\n />\n )}\n <PostBillingAdjustmentModal\n open={isPostBillingAdjustmentModalOpen}\n closeModal={() => setIsPostBillingAdjustmentModalOpen(false)}\n />\n </div>\n );\n};\n","import { ArrowDownTrayIcon } from \"@heroicons/react/24/outline\";\nimport { GetQualifiedAssetOwnerItemResponseDTO } from \"api/bessCompensation/bessCompensation.dto\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport { saveAs } from \"file-saver\";\nimport { FC } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as XLSX from \"xlsx\";\n\ntype BillingAdjustmentExcelExportProps = {\n assetOwners: GetQualifiedAssetOwnerItemResponseDTO[];\n invoiceMonth: string;\n};\n\nconst BillingAdjustmentExcelExport: FC<BillingAdjustmentExcelExportProps> = ({\n assetOwners,\n invoiceMonth,\n}) => {\n const { t } = useTranslation();\n const transformData = (data: GetQualifiedAssetOwnerItemResponseDTO[]) => {\n return data.map((assetOwner) => ({\n id: assetOwner.id,\n firstName: assetOwner.firstName,\n lastName: assetOwner.lastName,\n installerId: assetOwner.installerId,\n distributorId: assetOwner.distributorId,\n zavannCustomerId: assetOwner.zavannCustomerId,\n zavannSiteId: assetOwner.zavannSiteId,\n availablePower: assetOwner.asset.minAvailablePower,\n assetModelCompensation: assetOwner.asset.assetModelCompensation,\n dateByWhichBothSitesWereActive: assetOwner.dateByWhichBothSitesWereActive,\n amount: assetOwner.compensation.amount,\n }));\n };\n\n const generateDataSheets = () => {\n const sentAdjustments = transformData(\n assetOwners.filter(\n (assetOwner) => assetOwner.compensation.billingAdjustmentsHasPosted,\n ),\n );\n const unsentAdjustments = transformData(\n assetOwners.filter(\n (assetOwner) => !assetOwner.compensation.billingAdjustmentsHasPosted,\n ),\n );\n const bankAccountsRegistered = transformData(\n assetOwners.filter(\n (assetOwner) => assetOwner.compensation.isPayoutInformationRegistered,\n ),\n );\n const bankAccountsMissing = transformData(\n assetOwners.filter(\n (assetOwner) => !assetOwner.compensation.isPayoutInformationRegistered,\n ),\n );\n\n return {\n \"Sent Billing Adjustments\": sentAdjustments,\n \"Unsent Billing Adjustments\": unsentAdjustments,\n \"Bank Accounts Registered\": bankAccountsRegistered,\n \"Bank Accounts Missing\": bankAccountsMissing,\n };\n };\n\n const exportToExcel = () => {\n const dataSheets = generateDataSheets();\n const workbook = XLSX.utils.book_new();\n\n Object.entries(dataSheets).forEach(([sheetName, data]) => {\n const worksheet = XLSX.utils.json_to_sheet(data);\n XLSX.utils.book_append_sheet(workbook, worksheet, sheetName);\n });\n\n const excelBuffer = XLSX.write(workbook, {\n bookType: \"xlsx\",\n type: \"array\",\n });\n const blob = new Blob([excelBuffer], { type: \"application/octet-stream\" });\n saveAs(blob, `${invoiceMonth}_summary.xlsx`);\n };\n\n return (\n <SecondaryButton onClick={() => exportToExcel()} className=\"mr-3\">\n <ArrowDownTrayIcon className=\"h-5 w-5 mr-2\" />\n {t(\"billingAdjustment.Summary\")}\n </SecondaryButton>\n );\n};\n\nexport default BillingAdjustmentExcelExport;\n","import { isEmptyArray } from \"helpers/array\";\nimport { FC, useMemo } from \"react\";\nimport CustomPlaceholder from \"components/CustomPlaceholder\";\nimport {\n ArrowTopRightOnSquareIcon,\n UserIcon,\n} from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { useQualifiedAssetOwners } from \"api/bessCompensation/bessCompensation.endpoints\";\nimport { GetQualifiedAssetOwnerItemResponseDTO } from \"api/bessCompensation/bessCompensation.dto\";\nimport { Filter, filterFunction } from \"components/filters/Filters\";\nimport { BillingAdjustmentStatusTag } from \"components/tags/BillingAdjustmentStatusTag\";\nimport {\n PayoutInformationStatusTypes,\n PostBillingAdjustmentsStatusTypes,\n} from \"enums/postBillingAdjustmentStatus.enums\";\nimport { TableOptions } from \"@tanstack/react-table\";\nimport { Link } from \"react-router-dom\";\nimport { Role } from \"enums/role.enum\";\n\nimport { PayoutInformationStatusTag } from \"components/tags/PayoutInformationStatusTag\";\n\nimport { PostBillingAdjustment } from \"./postBillingAdjustment/PostBillingAdjustment\";\nimport BillingAdjustmentExcelExport from \"./BillingAdjustmentExcelExport\";\nimport { currentInvoicedMonth } from \"components/billingAdjustment/BillingAdjustment.helper\";\nimport { getAssetOwnerPageRoute } from \"helpers/assetOwner\";\nimport { TanStackTable } from \"../table/TanStackTable\";\n\nexport const QualifiedAssetOwnerList: FC = () => {\n const { t } = useTranslation();\n\n // get qualified assetOwner list\n const { data: assetOwners, isLoading, isError } = useQualifiedAssetOwners();\n\n const columns: TableOptions<GetQualifiedAssetOwnerItemResponseDTO>[\"columns\"] =\n useMemo(\n () => [\n {\n header: t(`billingAdjustment.Name`),\n accessorKey: \"name\",\n accessorFn: (row: GetQualifiedAssetOwnerItemResponseDTO) =>\n `${row.firstName} ${row.lastName}`,\n filterFn: \"includesString\",\n },\n {\n header: t(`billingAdjustment.Customer id`),\n accessorKey: \"zavannCustomerId\",\n accessorFn: (row: GetQualifiedAssetOwnerItemResponseDTO) =>\n row?.zavannCustomerId,\n filterFn: \"includesString\",\n },\n {\n header: t(`billingAdjustment.Available Power`),\n accessorKey: \"minAvailablePower\",\n accessorFn: (row: GetQualifiedAssetOwnerItemResponseDTO) =>\n `${row?.asset?.minAvailablePower} kW`,\n filterFn: \"includesString\",\n },\n {\n header: t(`billingAdjustment.Model compensation`),\n accessorKey: \"assetModelCompensation\",\n accessorFn: (row: GetQualifiedAssetOwnerItemResponseDTO) =>\n `${row?.asset?.assetModelCompensation} SEK`,\n filterFn: \"includesString\",\n },\n {\n header: t(`billingAdjustment.Compensation`),\n accessorKey: \"amount\",\n accessorFn: (row: GetQualifiedAssetOwnerItemResponseDTO) =>\n `${row?.compensation?.amount} SEK`,\n filterFn: \"includesString\",\n },\n {\n header: t(`billingAdjustment.Billing adjustment`),\n accessorKey: \"billingAdjustmentStatus\",\n accessorFn: (row: GetQualifiedAssetOwnerItemResponseDTO) =>\n row?.compensation?.billingAdjustmentsHasPosted\n ? PostBillingAdjustmentsStatusTypes.Sent\n : PostBillingAdjustmentsStatusTypes.NotSent,\n cell: (row) => <BillingAdjustmentStatusTag status={row.getValue()} />,\n filterFn: filterFunction,\n },\n {\n header: t(`billingAdjustment.Bank account`),\n accessorKey: \"payoutInformationStatus\",\n accessorFn: (row: GetQualifiedAssetOwnerItemResponseDTO) =>\n row?.compensation?.isPayoutInformationRegistered\n ? PayoutInformationStatusTypes.Registered\n : PayoutInformationStatusTypes.NotRegistered,\n cell: (row) => <PayoutInformationStatusTag status={row.getValue()} />,\n filterFn: filterFunction,\n },\n {\n header: t(`billingAdjustment.View details`),\n accessorKey: \"id\",\n accessorFn: (row: GetQualifiedAssetOwnerItemResponseDTO) =>\n getAssetOwnerPageRoute(\n Role.Flower,\n row?.id,\n row?.installerId,\n row?.distributorId,\n ),\n cell: (row) => (\n <Link\n to={row.getValue()}\n target=\"blank\"\n className=\"w-full flex justify-center\"\n >\n <ArrowTopRightOnSquareIcon className=\"w-5 h-5\" />\n </Link>\n ),\n },\n ],\n [assetOwners],\n );\n\n const filters: Filter[] = useMemo(\n () => [\n {\n id: \"billingAdjustmentStatus\",\n name: t(`billingAdjustment.Billing adjustment`),\n options: [\n PostBillingAdjustmentsStatusTypes.Sent,\n PostBillingAdjustmentsStatusTypes.NotSent,\n ],\n },\n {\n id: \"payoutInformationStatus\",\n name: t(`billingAdjustment.Bank account`),\n options: [\n PayoutInformationStatusTypes.Registered,\n PayoutInformationStatusTypes.NotRegistered,\n ],\n },\n ],\n [],\n );\n\n if (isLoading || isError || !assetOwners || assetOwners.length === 0) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isEmpty={isEmptyArray(assetOwners)}\n isLoading={isLoading}\n isError={isError}\n icon={<UserIcon />}\n errorMessage={t(`billingAdjustment.QualifiedAssetOwnerListError`)}\n emptyDataMessage={t(`assetOwnerList.QualifiedAssetOwnerListEmpty`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n return (\n <div className=\"flex flex-col\">\n <div className=\"relative top-11 w-fit min-w-60 rounded flex justify-between items-end\">\n <BillingAdjustmentExcelExport\n assetOwners={assetOwners}\n invoiceMonth={currentInvoicedMonth}\n />\n <PostBillingAdjustment assetOwners={assetOwners} />\n </div>\n <div className=\"flex flex-col w-full overflow-hidden\">\n <TanStackTable columns={columns} data={assetOwners} filters={filters} />\n </div>\n </div>\n );\n};\n","import { BillingAdjustmentStatistics } from \"components/billingAdjustment/BillingAdjustmentStatistics\";\nimport { currentInvoicedMonth } from \"./BillingAdjustment.helper\";\nimport { QualifiedAssetOwnerList } from \"components/billingAdjustment/QualifiedAssetOwnerList\";\n\nexport default function BillingAdjustmentTab() {\n return (\n <div className=\"overflow-auto\">\n <div className=\"bg-gradient-to-r from-slate-50 flex items-center justify-between gap-x-6 px-6 py-2.5 sm:pr-3.5 lg:pl-8 \">\n <p className=\"text-base font-semibold text-flowerGray-800\">\n {currentInvoicedMonth}\n </p>\n </div>\n <BillingAdjustmentStatistics />\n <QualifiedAssetOwnerList />\n </div>\n );\n}\n","import {\n useDistributorsCompensation,\n useInstallersCompensation,\n useTotalCompensation,\n} from \"../../api/compensation/compensation.endpoints\";\nimport {\n getCurrentYearCompensation,\n getPreviousMonthCompensation,\n getPreviousYearCompensation,\n getTotalCompensation,\n} from \"./CompensationStatistics.helpers\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport {\n ClipboardDocumentListIcon,\n CubeIcon,\n HomeModernIcon,\n TruckIcon,\n} from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\nimport { CompensationStatistics, Tile } from \"./CompensationStatistics\";\nimport React, { useMemo } from \"react\";\n\nexport const CompensationStatisticsTab = () => {\n const { t } = useTranslation();\n\n const {\n data: totalCompensation,\n isLoading: isLoadingTotalCompensation,\n isError: isErrorTotalCompensation,\n } = useTotalCompensation();\n\n const {\n data: distributorsCompensation,\n isLoading: isLoadingDistributorsCompensation,\n isError: isErrorDistributorsCompensation,\n } = useDistributorsCompensation();\n\n const {\n data: installerCompensation,\n isLoading: isLoadingInstallersCompensation,\n isError: isErrorInstallersCompensation,\n } = useInstallersCompensation();\n\n const allStakeholdersTiles: Tile[] = useMemo(\n () =>\n totalCompensation\n ? [\n {\n title: t(\"compensation.Total\"),\n value: `${getTotalCompensation(totalCompensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousYear\"),\n value: `${getPreviousYearCompensation(totalCompensation)} SEK`,\n },\n {\n title: t(\"compensation.CurrentYear\"),\n value: `${getCurrentYearCompensation(totalCompensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousMonth\"),\n value: `${getPreviousMonthCompensation(totalCompensation)} SEK`,\n },\n ]\n : [],\n [totalCompensation],\n );\n\n const distributorsTiles: Tile[] = useMemo(\n () =>\n distributorsCompensation\n ? [\n {\n title: t(\"compensation.Total\"),\n value: `${getTotalCompensation(distributorsCompensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousYear\"),\n value: `${getPreviousYearCompensation(distributorsCompensation)} SEK`,\n },\n {\n title: t(\"compensation.CurrentYear\"),\n value: `${getCurrentYearCompensation(distributorsCompensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousMonth\"),\n value: `${getPreviousMonthCompensation(distributorsCompensation)} SEK`,\n },\n ]\n : [],\n [distributorsCompensation],\n );\n\n const installersTiles: Tile[] = useMemo(\n () =>\n installerCompensation\n ? [\n {\n title: t(\"compensation.Total\"),\n value: `${getTotalCompensation(installerCompensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousYear\"),\n value: `${getPreviousYearCompensation(installerCompensation)} SEK`,\n },\n {\n title: t(\"compensation.CurrentYear\"),\n value: `${getCurrentYearCompensation(installerCompensation)} SEK`,\n },\n {\n title: t(\"compensation.PreviousMonth\"),\n value: `${getPreviousMonthCompensation(installerCompensation)} SEK`,\n },\n ]\n : [],\n [installerCompensation],\n );\n\n const isLoading =\n isLoadingTotalCompensation ||\n isLoadingDistributorsCompensation ||\n isLoadingInstallersCompensation;\n\n const isError =\n isErrorTotalCompensation ||\n isErrorDistributorsCompensation ||\n isErrorInstallersCompensation;\n\n if (isLoading || isError) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isLoading={isLoading}\n isError={isError}\n isEmpty={false}\n icon={<ClipboardDocumentListIcon />}\n errorMessage={t(`compensation.UnableToLoad`)}\n emptyDataMessage={t(`compensation.NotFound`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"overflow-auto\">\n <div className=\"mb-4\">\n <CompensationStatistics\n title={t(\"compensation.AllStakeholders\")}\n icon={[\n <CubeIcon key=\"cube\" />,\n <TruckIcon key=\"truck\" />,\n <HomeModernIcon key=\"home\" />,\n ]}\n tiles={allStakeholdersTiles}\n emptyDataMessage={t(\"compensation.NotFound\")}\n />\n </div>\n\n <div className=\"mb-4\">\n <CompensationStatistics\n title={t(\"compensation.Distributors\")}\n icon={<CubeIcon key=\"cube\" />}\n tiles={distributorsTiles}\n emptyDataMessage={t(\"compensation.NotFound\")}\n />\n </div>\n\n <div>\n <CompensationStatistics\n title={t(\"compensation.Installers\")}\n icon={<TruckIcon key=\"truck\" />}\n tiles={installersTiles}\n emptyDataMessage={t(\"compensation.NotFound\")}\n />\n </div>\n </div>\n );\n};\n","import { ArrowDownTrayIcon } from \"@heroicons/react/24/outline\";\nimport SecondaryButton from \"components/buttons/SecondaryButton\";\nimport React, { FC } from \"react\";\nimport { GetInstallerInfoForPayoutResponseDTO } from \"../../api/installer/installer.dto\";\nimport { useTranslation } from \"react-i18next\";\n\ntype Props = {\n installerInfo: GetInstallerInfoForPayoutResponseDTO[];\n};\n\nexport const InstallerPayoutCSVExport: FC<Props> = ({ installerInfo }) => {\n const { t } = useTranslation();\n\n const handleDownload = () => {\n if (installerInfo.length === 0) return;\n\n // Get headers\n const headers = Object.keys(installerInfo[0]);\n\n // Convert to CSV\n const csvRows = [];\n csvRows.push(headers.join(\";\"));\n\n installerInfo.forEach((row) => {\n const values = headers.map((header) => {\n const value =\n row[header as keyof GetInstallerInfoForPayoutResponseDTO] || \"\";\n\n return `\"${value}\"`; // Quote values to handle commas\n });\n csvRows.push(values.join(\";\"));\n });\n\n const csvString = csvRows.join(\"\\n\");\n\n // Create blob and trigger download\n const blob = new Blob([csvString], { type: \"text/csv;charset=utf-8;\" });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = \"installer_information_for_payout.csv\";\n a.click();\n URL.revokeObjectURL(url);\n };\n\n return (\n <SecondaryButton onClick={() => handleDownload()}>\n <ArrowDownTrayIcon className=\"h-5 w-5 mr-2\" />\n {t(`compensation.DownloadPayloadInformation`)}\n </SecondaryButton>\n );\n};\n","import React from \"react\";\nimport { InstallerPayoutCSVExport } from \"./InstallerPayoutCSVExport\";\nimport { useInstallerInstallerInformationForPayout } from \"../../api/installer/installer.endpoints\";\nimport CustomPlaceholder from \"../CustomPlaceholder\";\nimport { TruckIcon } from \"@heroicons/react/24/outline\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const InstallerCompensationTab = () => {\n const { t } = useTranslation();\n const { data, isLoading, isError } =\n useInstallerInstallerInformationForPayout();\n\n if (!data || isLoading || isError) {\n return (\n <div className=\"my-8\">\n <CustomPlaceholder\n isLoading={isLoading}\n isError={isError}\n isEmpty={!data}\n icon={<TruckIcon />}\n errorMessage={t(`compensation.UnableToLoad`)}\n emptyDataMessage={t(`compensation.NotFound`)}\n loaderSize=\"page\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"flex items-center justify-center mt-16\">\n <InstallerPayoutCSVExport installerInfo={data} />\n </div>\n );\n};\n","import { TabPageWrapper } from \"../../../components/tab/TabPageWrapper\";\nimport TabContainer from \"../../../components/tab/TabContainer\";\nimport { CompensationModelTab } from \"../../../components/compensation/CompensationModelTab\";\nimport { useTranslation } from \"react-i18next\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { BreadCrumb, menuStore } from \"../../../store/menu.store\";\nimport { useEffect } from \"react\";\nimport { RouteLabel } from \"../../../routing/routeLabel.enum\";\nimport { RouteUrl } from \"../../../routing/routeUrl.enum\";\nimport BillingAdjustmentTab from \"../../../components/billingAdjustment/BillingAdjustmentTab\";\nimport { CompensationStatisticsTab } from \"../../../components/compensation/CompensationStatisticsTab\";\nimport { InstallerCompensationTab } from \"../../../components/compensation/InstallerCompensationTab\";\n\nconst MONTHLY_BILLING_ADJUSTMENT_TAB = \"monthly-billing-adjustment\";\nconst COMPENSATION_MODEL = \"compensation-model\";\nconst COMPENSATION_STATISTICS = \"compensation-statistics\";\nconst INSTALLER_COMPENSATION = \"installer-compensation\";\n\nexport const CompensationPage = () => {\n const { t } = useTranslation();\n\n // Tab\n const [searchParams, setSearchParams] = useSearchParams();\n const setTab = (tab: string) => setSearchParams({ tab: tab.toLowerCase() });\n\n // Breadcrumbs\n const { setBreadCrumbs } = menuStore();\n useEffect(() => {\n setBreadCrumbs(getBreadCrumbs());\n }, []);\n\n const currentTab = searchParams.get(\"tab\") || MONTHLY_BILLING_ADJUSTMENT_TAB;\n\n return (\n <TabPageWrapper\n tabs={[\n {\n param: MONTHLY_BILLING_ADJUSTMENT_TAB,\n label: t(`compensation.MonthlyBillingAdjustment`),\n content: (\n <TabContainer key={MONTHLY_BILLING_ADJUSTMENT_TAB}>\n <BillingAdjustmentTab />\n </TabContainer>\n ),\n isSelected: currentTab === MONTHLY_BILLING_ADJUSTMENT_TAB,\n },\n {\n param: COMPENSATION_MODEL,\n label: t(`compensation.CompensationModel`),\n content: (\n <TabContainer key={COMPENSATION_MODEL}>\n <CompensationModelTab />\n </TabContainer>\n ),\n isSelected: currentTab === COMPENSATION_MODEL,\n },\n {\n param: COMPENSATION_STATISTICS,\n label: t(`compensation.CompensationStatistics`),\n content: (\n <TabContainer key={COMPENSATION_STATISTICS}>\n <CompensationStatisticsTab />\n </TabContainer>\n ),\n isSelected: currentTab === COMPENSATION_STATISTICS,\n },\n {\n param: INSTALLER_COMPENSATION,\n label: t(`compensation.InstallerPayout`),\n content: (\n <TabContainer key={INSTALLER_COMPENSATION}>\n <InstallerCompensationTab />\n </TabContainer>\n ),\n isSelected: currentTab === INSTALLER_COMPENSATION,\n },\n ]}\n setTab={setTab}\n />\n );\n};\n\nconst getBreadCrumbs = (): BreadCrumb[] => [\n {\n label: RouteLabel.Compensation,\n to: `${RouteUrl.App}/${RouteUrl.Compensation}`,\n },\n];\n","import { LoginPage } from \"../pages/login/LoginPage\";\nimport { Navigate, Outlet } from \"react-router-dom\";\nimport { AppWrapper } from \"../components/appWrapper/AppWrapper\";\nimport { RouteUrl } from \"./routeUrl.enum\";\nimport { DistributorsPage } from \"pages/app/distributorList/DistributorListPage\";\nimport DistributorPage from \"pages/app/distributor/DistributorPage\";\nimport SignUpDistributorPage from \"pages/sign-up/SignUpDistributorPage\";\nimport InstallerPage from \"pages/app/installer/InstallerPage\";\nimport { InstallerListPage } from \"pages/app/installerList/InstallerListPage\";\nimport { AssetOwnerListPage } from \"pages/app/assetOwnerList/AssetOwnerListPage\";\nimport ForgotPasswordPage from \"pages/forgot-password/ForgotPasswordPage\";\nimport ResetPasswordPage from \"pages/reset-password/ResetPasswordPage\";\nimport SignUpInstallerPage from \"pages/sign-up/SignUpInstallerPage\";\nimport { SignUpFlowPage } from \"pages/sign-up-flow/SignUpFlowPage\";\nimport { Role } from \"enums/role.enum\";\nimport { SignUpFlowerPage } from \"pages/sign-up/SignUpFlowerPage\";\nimport { DashboardPage } from \"pages/app/dashboard/DashboardPage\";\nimport { FlowerOrganizationPage } from \"pages/app/flowerOrganization/FlowerOrganizationPage\";\nimport { FlowerSettingsPage } from \"pages/app/flowerSettings/FlowerSettingsPage\";\nimport { DistributorOrganizationPage } from \"pages/app/distributor/DistributorOrganizationPage\";\nimport { ProfilePage } from \"pages/app/assetOwner/ProfilePage\";\nimport { NotFoundPage } from \"pages/app/notFound/NotFoundPage\";\nimport { ManualActionPage } from \"pages/app/manualAction/ManualActionPage\";\nimport { AssetListPage } from \"pages/app/assetList/AssetListPage\";\nimport { Centered } from \"components/Centered\";\nimport { Maintenance } from \"pages/maintenance/maintenance\";\nimport { SystemNotification } from \"api/system-notification/systemNotification.type\";\nimport { InvoicesPage } from \"pages/app/assetOwner/InvoicesPage\";\nimport { ConsumptionAndRevenuePage } from \"pages/app/assetOwner/ConsumptionAndRevenuePage\";\nimport { BatteryPage } from \"pages/app/assetOwner/BatteryPage\";\nimport { AssetOwnerDashboardPage } from \"pages/app/assetOwner/AssetOwnerDashboardPage\";\nimport AssetOwnerPage from \"pages/app/assetOwnerPage/AssetOwnerPage\";\nimport { InstallerOrganizationPage } from \"pages/app/installer/InstallerOrganizationPage\";\nimport { AssetModelConfigurationPage } from \"pages/app/assetModelConfiguration/AssetModelConfigurationPage\";\nimport {\n isAssetOwner,\n isDistributor,\n isFlower,\n isGuest,\n isInstaller,\n} from \"../helpers/role\";\nimport { ScrollablePage } from \"../components/appWrapper/ScrollablePage\";\nimport { NotScrollablePage } from \"../components/appWrapper/NotScrollablePage\";\nimport { CompensationPage } from \"../pages/app/compensation/CompensationPage\";\n\nexport const maintenanceRoute = (maintenance?: SystemNotification) => [\n {\n path: RouteUrl.AllRoutes,\n element: <Navigate to={RouteUrl.Home} />,\n },\n {\n path: RouteUrl.Home,\n element: (\n <Centered>\n <Maintenance maintenance={maintenance} />\n </Centered>\n ),\n },\n];\n\nconst routes = (isLoggedIn: boolean, userRole: Role) => [\n {\n path: RouteUrl.App + \"/*\",\n element: isLoggedIn ? (\n <AppWrapper>\n <Outlet />\n </AppWrapper>\n ) : (\n <Navigate to={RouteUrl.Login} />\n ),\n children: [\n ...getAppRoutes(userRole),\n {\n path: \"*\",\n element: (\n <Centered>\n <NotFoundPage />\n </Centered>\n ),\n },\n ],\n },\n {\n path: RouteUrl.Login,\n element: isLoggedIn ? <Navigate to={RouteUrl.App} /> : <LoginPage />,\n },\n {\n path: `/${RouteUrl.SignUpFlower}`,\n element: isLoggedIn ? <Navigate to={RouteUrl.App} /> : <SignUpFlowerPage />,\n },\n {\n path: `/${RouteUrl.SignUpDistributor}`,\n element: isLoggedIn ? (\n <Navigate to={RouteUrl.App} />\n ) : (\n <SignUpDistributorPage />\n ),\n },\n {\n path: `/${RouteUrl.SignUpInstaller}`,\n element: isLoggedIn ? (\n <Navigate to={RouteUrl.App} />\n ) : (\n <SignUpInstallerPage />\n ),\n },\n {\n path: `/${RouteUrl.SignUpAssetOwner}`, // This should be merged with SIGN_UP_FLOW\n element: isLoggedIn ? <Navigate to={RouteUrl.App} /> : <SignUpFlowPage />,\n },\n {\n path: `/${RouteUrl.ForgotPassword}`,\n element: isLoggedIn ? (\n <Navigate to={RouteUrl.App} />\n ) : (\n <ForgotPasswordPage />\n ),\n },\n {\n path: `/${RouteUrl.ResetPassword}`,\n element: isLoggedIn ? (\n <Navigate to={RouteUrl.App} />\n ) : (\n <ResetPasswordPage />\n ),\n },\n {\n path: `/${RouteUrl.SignUpFlow}`,\n element: isLoggedIn ? <Navigate to={RouteUrl.App} /> : <SignUpFlowPage />,\n },\n {\n path: RouteUrl.Home,\n element: isLoggedIn ? <Navigate to={RouteUrl.App} /> : <LoginPage />,\n },\n {\n path: \"*\",\n element: (\n <Centered>\n <NotFoundPage />\n </Centered>\n ),\n },\n];\n\nexport default routes;\n\nconst getAppRoutes = (userRole: Role) => {\n if (isFlower(userRole)) {\n return FLOWER_APP_ROUTES;\n } else if (isDistributor(userRole)) {\n return getDistributorAppRoutes(userRole);\n } else if (isInstaller(userRole)) {\n return getInstallerAppRoutes(userRole);\n } else if (isAssetOwner(userRole)) {\n return ASSET_OWNER_APP_ROUTES;\n } else if (isGuest(userRole)) {\n return [];\n } else throw Error(\"getAppRoutes not implemented for \" + userRole);\n};\n\nconst FLOWER_APP_ROUTES = [\n {\n path: RouteUrl.Dashboard,\n element: (\n <ScrollablePage isWide={true}>\n <DashboardPage />\n </ScrollablePage>\n ),\n },\n {\n path: RouteUrl.Distributors,\n element: <Outlet />,\n children: [\n {\n path: \":distributorId\",\n element: <Outlet />,\n children: [\n {\n path: \":installerId\",\n element: <Outlet />,\n children: [\n {\n path: \":assetOwnerId\",\n element: (\n <NotScrollablePage isWide={true}>\n <AssetOwnerPage />\n </NotScrollablePage>\n ),\n },\n {\n path: \"\",\n element: (\n <NotScrollablePage isWide={true}>\n <InstallerPage />\n </NotScrollablePage>\n ),\n },\n ],\n },\n {\n path: \"\",\n element: (\n <NotScrollablePage isWide={true}>\n <DistributorPage />\n </NotScrollablePage>\n ),\n },\n ],\n },\n {\n path: \"\",\n element: (\n <ScrollablePage isWide={true}>\n <DistributorsPage />\n </ScrollablePage>\n ),\n },\n ],\n },\n {\n path: RouteUrl.Installers,\n element: <Outlet />,\n children: [\n {\n path: \"\",\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <InstallerListPage />\n </NotScrollablePage>\n ),\n },\n ],\n },\n {\n path: RouteUrl.AssetOwners,\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <AssetOwnerListPage />\n </NotScrollablePage>\n ),\n },\n {\n path: RouteUrl.Assets,\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <AssetListPage />\n </NotScrollablePage>\n ),\n },\n {\n path: RouteUrl.Organization,\n element: (\n <NotScrollablePage style={\"py-4 md:py-8\"}>\n <FlowerOrganizationPage />\n </NotScrollablePage>\n ),\n },\n {\n path: RouteUrl.Settings,\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <FlowerSettingsPage />\n </NotScrollablePage>\n ),\n },\n\n {\n path: RouteUrl.AssetModelConfiguration,\n element: (\n <ScrollablePage isWide={true}>\n <AssetModelConfigurationPage />\n </ScrollablePage>\n ),\n },\n {\n path: RouteUrl.ManualAction,\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <ManualActionPage />\n </NotScrollablePage>\n ),\n },\n {\n path: RouteUrl.Compensation,\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <CompensationPage />\n </NotScrollablePage>\n ),\n },\n {\n path: \"\",\n element: <Navigate to={`${RouteUrl.App}/${RouteUrl.Dashboard}`} />,\n },\n];\n\nconst getDistributorAppRoutes = (loggedInUserRole: Role) =>\n DISTRIBUTOR_APP_ROUTES.filter(\n (item) => loggedInUserRole >= (item.minRole ?? Role.DistributorUser),\n ).map((item) => {\n const { minRole, ...route } = item;\n return route;\n });\n\nconst DISTRIBUTOR_APP_ROUTES = [\n {\n path: RouteUrl.Dashboard,\n element: (\n <ScrollablePage isWide={true}>\n <DashboardPage />\n </ScrollablePage>\n ),\n minRole: Role.DistributorUser,\n },\n {\n path: RouteUrl.Installers,\n element: <Outlet />,\n children: [\n {\n path: \":installerId\",\n element: <Outlet />,\n children: [\n {\n path: \":assetOwnerId\",\n element: (\n <NotScrollablePage isWide={true}>\n <AssetOwnerPage />\n </NotScrollablePage>\n ),\n },\n {\n path: \"\",\n element: (\n <NotScrollablePage isWide={true}>\n <InstallerPage />\n </NotScrollablePage>\n ),\n },\n ],\n },\n {\n path: \"\",\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <InstallerListPage />\n </NotScrollablePage>\n ),\n },\n ],\n minRole: Role.DistributorUser,\n },\n {\n path: RouteUrl.AssetOwners,\n element: <Outlet />,\n children: [\n {\n path: \"\",\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <AssetOwnerListPage />\n </NotScrollablePage>\n ),\n },\n ],\n minRole: Role.DistributorUser,\n },\n {\n path: RouteUrl.Organization,\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <DistributorOrganizationPage />\n </NotScrollablePage>\n ),\n minRole: Role.DistributorAdmin,\n },\n {\n path: \"\",\n element: <Navigate to={`${RouteUrl.App}/${RouteUrl.Dashboard}`} />,\n },\n];\n\nconst getInstallerAppRoutes = (loggedInUserRole: Role) =>\n INSTALLER_APP_ROUTES.filter(\n (item) => loggedInUserRole >= (item.minRole ?? Role.InstallerUser),\n ).map((item) => {\n const { minRole, ...route } = item;\n return route;\n });\n\nconst INSTALLER_APP_ROUTES = [\n {\n path: RouteUrl.Dashboard,\n element: (\n <ScrollablePage isWide={true}>\n <DashboardPage />\n </ScrollablePage>\n ),\n minRole: Role.InstallerUser,\n },\n {\n path: RouteUrl.AssetOwners,\n element: <Outlet />,\n children: [\n {\n path: \":assetOwnerId\",\n element: (\n <NotScrollablePage isWide={true}>\n <AssetOwnerPage />\n </NotScrollablePage>\n ),\n },\n {\n path: \"\",\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <AssetOwnerListPage />\n </NotScrollablePage>\n ),\n },\n ],\n minRole: Role.InstallerUser,\n },\n {\n path: RouteUrl.Organization,\n element: (\n <NotScrollablePage isWide={true} style={\"py-4 md:py-8\"}>\n <InstallerOrganizationPage />\n </NotScrollablePage>\n ),\n minRole: Role.InstallerAdmin,\n },\n {\n path: \"\",\n element: <Navigate to={`${RouteUrl.App}/${RouteUrl.Dashboard}`} />,\n minRole: Role.InstallerUser,\n },\n];\n\nconst ASSET_OWNER_APP_ROUTES = [\n {\n path: RouteUrl.Dashboard,\n element: (\n <ScrollablePage isWide={true}>\n <AssetOwnerDashboardPage />\n </ScrollablePage>\n ),\n },\n {\n path: RouteUrl.InvoiceList,\n element: (\n <ScrollablePage>\n <InvoicesPage />\n </ScrollablePage>\n ),\n },\n {\n path: RouteUrl.Battery,\n element: (\n <ScrollablePage>\n <BatteryPage />\n </ScrollablePage>\n ),\n },\n {\n path: RouteUrl.Profile,\n element: (\n <ScrollablePage>\n <ProfilePage />\n </ScrollablePage>\n ),\n },\n {\n path: RouteUrl.ConsumptionAndRevenue,\n element: (\n <NotScrollablePage style={\"py-4 md:py-8\"}>\n <ConsumptionAndRevenuePage />\n </NotScrollablePage>\n ),\n },\n {\n path: \"\",\n element: <Navigate to={`${RouteUrl.App}/${RouteUrl.Dashboard}`} />,\n },\n];\n","import { useRoutes } from \"react-router-dom\";\nimport userStore, { getUserRole } from \"store/user.store\";\nimport { useIsLoggedIn } from \"./hooks/useIsLoggedIn\";\nimport routes from \"./routing/routes\";\nimport { wrapUseRoutes } from \"@sentry/react\";\nimport { useActiveFlowerSystemNotifications } from \"api/system-notification/systemNotification.endpoints\";\nimport { maintenanceRoute } from \"routing/routes\";\n\nconst useSentryRoutes = wrapUseRoutes(useRoutes);\n\nfunction App() {\n const isLoggedIn = useIsLoggedIn();\n\n const userRole = userStore(getUserRole);\n\n //Get active Flower system notifications\n const { data: systemNotification, isLoading: isLoadingSystemNotification } =\n useActiveFlowerSystemNotifications();\n\n // different routes table depending if there is an active FLower maintenance\n // use to block every routes in the app\n const routing = useSentryRoutes(\n systemNotification\n ? maintenanceRoute(systemNotification)\n : routes(isLoggedIn, userRole),\n );\n\n if (!isLoadingSystemNotification) {\n return <>{routing}</>;\n }\n\n return null;\n}\n\nexport default App;\n","import i18next from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport { Language } from \"./i18n.constants\";\n\nimport englishTranslation from \"./translations/english.json\";\nimport swedishTranslation from \"./translations/swedish.json\";\n\nconst resources = {\n [Language.English]: {\n translation: englishTranslation,\n },\n [Language.Swedish]: {\n translation: swedishTranslation,\n },\n};\n\ni18next.use(initReactI18next).init({\n resources,\n lng: Language.English,\n pluralSeparator: \"_\",\n});\n\nexport default i18next;\n","import React from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport App from \"./App\";\nimport \"./styles/index.css\";\nimport { BrowserRouter as Router } from \"react-router-dom\";\nimport \"./i18n/i18n\";\nimport { Toaster } from \"react-hot-toast\";\nimport * as Sentry from \"@sentry/react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\n// This redacts a string after a certain amount of characters, which would hopefully hide secret codes from sentry\nconst redactLongUrl = (url?: string) => {\n if (url) {\n const replaceAfterUrlLength = 60; // A little longer than on the server side since this includes base url\n return (\n url.substring(0, replaceAfterUrlLength) +\n \"*\".repeat(Math.max(url.length - replaceAfterUrlLength, 0))\n );\n } else {\n return url;\n }\n};\n\nSentry.init({\n // Does not need to be secret, see https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/#dsn-utilization\n dsn: \"https://1b7317b3ffa4c53744d7deae2bd92308@o4506541719945216.ingest.sentry.io/4506671149613056\",\n environment: import.meta.env.VITE_NODE_ENV,\n tracePropagationTargets: [\"localhost\", import.meta.env.VITE_API_URL],\n integrations: [\n // Let's add this if it becomes relevant.\n /*replayIntegration({\n maskAllText: true,\n blockAllMedia: true,\n })*/\n ],\n //replaysSessionSampleRate: 0.1, // Comment in if replays are used\n //replaysOnErrorSampleRate: 1.0, // Comment in if replays are used\n tracesSampleRate: 0.2, // Logging only 20% of traces (for performance) as this counts towards our bill\n beforeSend(event) {\n if (event.request?.url) {\n event.request.url = redactLongUrl(event.request.url);\n }\n if (event.user?.ip_address) {\n event.user.ip_address = \"REDACTED\";\n }\n if (event.breadcrumbs) {\n event.breadcrumbs?.map((breadcrumb) => {\n if (breadcrumb.data?.url) {\n breadcrumb.data.url = redactLongUrl(breadcrumb.data.url);\n }\n return breadcrumb;\n });\n }\n return event;\n },\n});\n\nconst queryClient = new QueryClient();\nReactDOM.createRoot(document.getElementById(\"root\") as HTMLElement).render(\n <React.StrictMode>\n <QueryClientProvider client={queryClient}>\n <Router>\n <App />\n </Router>\n <Toaster position=\"top-right\" toastOptions={{ duration: 3000 }} />\n </QueryClientProvider>\n </React.StrictMode>,\n);\n"],"names":["Role","userStore","create","persist","set","user","state","getUserId","_a","getUserRole","getAssetOwnerId","getDistributorId","getInstallerId","getUserName","REFRESH_TOKEN_EXPIRATION_DATE_KEY","getRefreshTokenExpirationDate","setRefreshTokenExpirationDate","dateInMilliseconds","clearRefreshTokenExpirationDate","refreshTokenHasExpired","refreshTokenExpirationDate","RouteUrl","useIsLoggedIn","clearUser","navigate","useNavigate","useEffect","checkPathBeforeRedirect","api","axios","res","err","originalConfig","isUnauthorized","isRefreshTokenRequest","isLoginRequest","AuthEndPoints","_error","classNames","classes","useNotification","message","toast","t","jsx","jsxs","CheckCircleIcon","XCircleIcon","useLogin","setUser","login","isLoading","isSuccess","isError","useMutation","payload","data","useServerLogout","useRequestOTP","notification","useVerifyOTP","userOtp","ErrorAlert","text","PasswordInput","label","name","register","registerOptions","tabIndex","errorMessage","hasError","showPassword","setShowPassword","useState","toggleShow","prev","ExclamationCircleIcon","e","EyeIcon","EyeSlashIcon","TextInput","appendix","size","autoFocus","placeholder","link","linkText","type","onKeyUp","autoComplete","hoverDetails","isDisabled","sizeClass","isHoveringDetails","setIsHoveringDetails","QuestionMarkCircleIcon","event","DECIMAL_REGEX","SINGLE_DIGIT_REGEX","DIGIT_REGEX","positiveNumberValidator","value","decimalNumberValidator","naturalNumberValidator","noEmptyStringValidator","inviteHasExpired","expiryDate","today","emailValidator","passwordValidator","isPasswordStrongEnough","password","organizationNumberValidator","giroNumberValidator","FlowerHubLogo","cloudFrontDomainUrl","transitionProps","fadeInFromRight","LoginPage","useTranslation","handleSubmit","loginErrors","useForm","onSubmit","motion","_b","Link","useLogout","FlowerSymbolLogo","DoubleLeftArrowHead","DoubleRightArrowHead","OperationalStatusFlowerHubIcon","OperationalStatusFlowerCloudIcon","OperationalStatusInverterIcon","MobileMenu","navigation","sidebarOpen","setSidebarOpen","logout","Transition","Fragment","Dialog","TransitionChild","DialogPanel","XMarkIcon","item","PowerIcon","RouteLabel","menuStore","breadCrumbs","fetchPages","url","pageParam","queryString","extraQueryString","parsedQueryString","qs","parsedExtraQueryString","paginationQueryString","ENDPOINT","AssetOwnerQueryKeys","useAssetOwnersPagination","optionalParams","distributorId","installerId","optionalQueryString","useInfiniteQuery","lastPage","pages","keepPreviousData","useAssetOwner","id","useQuery","useAssetOwnerWithAssetId","useAssetOwnerProfile","useCreateAssetOwner","options","queryClient","useQueryClient","error","useUpdateAssetOwner","useDeleteAssetOwner","settings","useInvoices","assetOwnerId","useConsumption","useAssetOwnerElectricityAgreement","useLatestBasedOnAssetCreationForFlower","useLatestAssetOwnersForInstaller","useUpdateZavannSiteIds","AssetQueryKeys","useAssetsPagination","useAssetRevenue","useAsset","useLatestPresenceEventsForAsset","useAssetStatistics","useCreateAsset","useUpdateAsset","children","isVisible","className","useTransition","styles","animated","SmoothUp","config","OpacityTransition","ScaleUp","SmallLoader","MediumLoader","LargeLoader","PageLoader","CustomPlaceholder","isEmpty","icon","emptyDataMessage","loaderSize","getLoaderForSize","PageWrapper","PageWrapperSmall","isEmptyArray","array","Modal","isOpen","onClose","rightButtonText","rightButtonActionHandler","isRightButtonHidden","rightButtonDisabled","title","loadingText","leftButtonAction","leftButtonText","middleButtonAction","middleButtonText","maxSize","getEmptyCreateDistributorDTO","DistributorQueryKeys","useDistributors","useDistributorUsers","useGetLatestInstallers","useDistributor","useCreateDistributor","useUpdateDistributor","ModalContentWrapper","AddDistributorForm","errors","_c","SecondaryButton","disableFocus","disabled","rest","getClassForSize","styling","AddDistributor","isCentered","isAddDistributorModalOpen","setIsAddDistributorModalOpen","createDistributor","isCreating","reset","closeModal","renderAddDistributorButton","UserPlusIcon","Table","TBody","TD","addLeftMargin","alignRight","TH","isFirstColumn","THead","TR","props","isFlower","role","isDistributor","isInstaller","isAssetOwner","isGuest","getRoleName","DistributorList","userRole","distributors","onDistributorClick","UserIcon","organizationNumber","city","DistributorsPage","setBreadCrumbs","getDistributorListBreadcrumb","TabPageWrapper","tabs","setTab","isMobile","MobileVersion","DesktopVersion","tab","isSelected","labelName","param","useDashboardStatistics","filterDistributorId","filterInstallerId","periodType","params","DashboardTile","leftStat","deviation","rightStat","showDeviation","deviationColor","deviationText","ArrowTrendingUpIcon","ArrowLongRightIcon","ArrowTrendingDownIcon","StatisticPeriodType","PeriodFilterTabs","selectedPeriod","onPeriodChange","TabGroup","TabList","Tab","DashboardStatistics","setSelectedPeriod","handlePeriodChange","period","statisticsData","isLoadingStatistics","statisticsIsErrored","calculatePercentageChange","current","previous","decimalPlaces","formatActivePower","valueInKw","valueInMw","ClipboardDocumentListIcon","CubeIcon","TruckIcon","HomeModernIcon","ServerStackIcon","BoltIcon","Badge","color","colorClass","Tooltip","position","isPreWrapText","setIsVisible","coords","setCoords","triggerRef","useRef","tooltipRef","hideOnScroll","triggerRect","tooltipRect","x","y","offset","handleMouseEnter","handleMouseLeave","createPortal","getTooltipSize","Panel","header","button","infoText","toaster","InformationCircleIcon","formatDate","date","format","enGB","formatDateMonth","dateToChartName","formatDateTime","locale","defaultOptions","dateToFormat","getRelativeTimeLabel","fromDate","now","seconds","differenceInSeconds","minutes","differenceInMinutes","hours","differenceInHours","days","differenceInDays","months","differenceInMonths","InstallerQueryKeys","useInstallersPagination","useInstallerInstallerInformationForPayout","useInstallerUsers","useInstaller","useCreateInstaller","useUpdateInstaller","useUpdateInstallerCanInviteAssetOwners","getEmptyCreateInstallerDTO","Checkbox","textSize","AddInstallerForm","AddInstaller","isAddInstallerModalOpen","setIsAddInstallerModalOpen","createInstaller","renderAddInstallerButton","createFilterParams","useDebounce","delay","debouncedValue","setDebouncedValue","FilterMenu","filters","setPaginationUrl","columnFilters","setColumnFilters","debouncedColumnFiltersString","debouncedColumnFilters","changeColumnFilter","option","column","existingFilter","filter","isActive","updatedFilter","s","f","filterParams","allSectionsEmpty","section","Menu","MenuButton","AdjustmentsHorizontalIcon","MenuItems","filterStatuses","Disclosure","open","DisclosureButton","MinusIcon","PlusIcon","DisclosurePanel","optionIdx","SearchField","searchFilterValue","setSearchFilterValue","debouncedSearchValue","MagnifyingGlassIcon","ToolBar","arrow","ChevronDownIcon","ChevronUpIcon","ChevronUpDownIcon","flexRender","TRH","headerGroup","table","scrollbarWidth","TableStyle","cell","TRB","virtualRow","rowVirtualizer","rows","onSelectRow","row","node","tableContainerRef","isRefetching","Title","LoadingToaster","useFetchMoreOnBottomReached","paginationQuery","offSetToTriggerPagination","setShowLoadingToast","containerRef","fetchNextPage","isFetchingNextPage","hasNextPage","isFetchingRef","numberOfPages","useMemo","fetchMoreOnBottomReached","useCallback","containerElement","scrollHeight","scrollTop","clientHeight","tableContainerElement","handleScroll","useAutoScrollbarWidth","setScrollbarWidth","updateScrollbarWidth","resizeObserver","columns","columnVisibility","searchPlaceholder","hasToolbar","createColumnFilter","sorting","setSorting","debouncedSortingString","debouncedSorting","showLoadingToast","flatData","page","useReactTable","getCoreRowModel","getSortedRowModel","handleSortingChange","updater","useVirtualizer","InstallerStatus","InstallerCanInviteFilterStatus","InstallerTable","onInstallerClick","handleRowClick","ListStyle","UL","LI","elements","elem","List","listContainerElement","InstallerList","element","MapPinIcon","Installers","setQueryString","installers","flatInstallers","getInstallerPageRoute","InstallerListPage","getInstallerListBreadcrumb","getBreadCrumbs","installer","getDistributorBreadcrumb","getInstallerBreadcrumb","installerName","formatVatNumber","cleanOrgNumber","formatOrganizationNumber","formatGiroNumber","giroNumber","cleanGiroNumber","LatestInstallerList","ChevronRightIcon","Dropdown","items","validation","AddDistributorUserForm","useDistributorSignUp","useInviteDistributorUser","result","useDeleteDistributorInvitation","AddDistributorUser","isInviteUserModalOpen","setIsInviteUserModalOpen","inviteUser","isInvitingUser","isInviteUserSuccess","registerInvitation","handleInvitationSubmit","resetInvitation","invitationErrors","setValue","onInvitationSubmit","onInvitationModalClose","DeleteDistributorConfirmation","DangerButton","fullWidth","UserQueryKeys","useFlowerUsers","useForgotPassword","useResetPassword","useUpdateInstallerUser","installerUserId","useDeactivateUser","DeleteDistributorUser","userId","isDeleteDistributorModalOpen","setIsDistributorModalOpen","deactivateUser","onDeactivateUser","onDeleteDistributorModalClose","DeleteDistributorInvitation","invitationId","deleteInvitation","onDeleteInvitation","TrashIcon","DistributorUsersTab","useDistributorUsersResponse","users","invitations","email","Item","Label","tooltipMessage","Value","ValueContainer","Shadow","PostalCodeInput","EditDistributorForm","_d","_f","_e","_h","_g","_i","EditDistributor","distributor","isEditDistributorModalOpen","setIsEditDistributorModalOpen","updateDistributor","isUpdating","onEditDistributorModalClose","renderEditDistributorButton","PencilSquareIcon","Address","address","street","postalCode","DistributorAccountDetails","TabContainer","getTotalCompensation","compensationResponse","yearlyAcc","yearlyValue","monthlyAcc","monthlyValue","getPreviousYearCompensation","currentYearCompensation","getCurrentYearCompensation","getPreviousMonthCompensation","compensationRes","previousMonthCompensation","sub","CompensationStatistics","tiles","warmingMessage","iconElement","index","setColumnsNumber","tile","BanknotesIcon","ExclamationTriangleIcon","tilesNumber","Compensation","compensation","compensationTiles","useTotalCompensation","useDistributorsCompensation","useInstallersCompensation","useDistributorCompensation","useInstallerCompensation","useCompensationModelHistory","useCurrentCompensationModelPeriod","useCreateCompensationModelPeriod","useDeleteCompensationModelPeriod","DASHBOARD_TAB","ORGANIZATION_TAB","INSTALLERS_TAB","USERS_TAB","COMPENSATION_TAB","DistributorPage","useParams","searchParams","setSearchParams","useSearchParams","currentTab","isLoadingDistributor","isErrorDistributor","distributorCompensation","isLoadingDistributorCompensation","flowerUserTab","AssetOwnerStatus","AssetOwnerStatusTag","status","getColor","EditAssetOwnerProfileForm","_j","EditAssetOwnerProfile","assetOwnerProfile","isEditAssetOwnerModalOpen","setIsEditAssetOwnerModalOpen","updateAssetOwner","isUpdateAssetOwnerSuccess","registerUpdateAssetOwner","handleUpdateAssetOwnerSubmit","resetUpdateAssetOwner","updateAssetOwnerErrors","onUpdateProfileSubmit","onEditAssetOwnerModalClose","renderEditAssetOwnerButton","DeleteAssetOwner","isDeleteAssetOwnerModalOpen","setIsDeleteAssetOwnerModalOpen","deleteAssetOwner","onDeleteAssetOwner","onDeleteAssetOwnerModalClose","useAssetOwnerSignUp","useAssetOwnerInvitation","code","enabled","useResendInvitation","useUpdateAssetOwnerInvitation","oldInvitationId","ResendAssetOwnerInvitation","resendInvitation","onResendInvitation","ArrowPathIcon","EditAssetOwnerInvitationForm","EditAssetOwnerInvitation","assetOwner","isEditInvitationModalOpen","setIsEditInvitationModalOpen","updateInvitation","onEditInvitationModalClose","renderEditInvitationButton","AccountDetails","hasAsset","renderStatusWithActions","renderPlaceholder","hasDifferentContactEmail","datePreviousMonth","invoicedMonth","year","month","day","prevYear","prevMonth","dateComponent","sameInvoicedMonth","invoiceMonth","consumptionMonth","flowerCompensation","invoice","flowerCompensationItemId","subGroupInvoices","invoiceLine","negateSEK","amount","aggregateMultipleInvoicesForSameMonth","invoices","combinedDataOfAllInvoices","getChartData","inv","invoicesForSameMonth","InvoicesForSameMonthAggregated","yAxisMaxCalc","maxValue","yMaxMultiple","yMaxRoundedToMultiple","getChartDomainMoney","chartData","max_money","getChartDomainPower","max_energy","ResponsiveContainer","ComposedChart","CartesianGrid","XAxis","YAxis","CustomYAxisLabel","Legend","Bar","Line","viewBox","xIncrease","height","MaintenanceState","subHeader","Consumption","hasSystemNotification","hasShadow","isLoadingInvoices","isErrorInvoices","consumption","isLoadingConsumption","isErrorConsumption","renderConsumptionPlaceholder","ChartBarIcon","FlowerLink","FlowerRevenue","assetId","bessCompensationStartDate","showLink","asset","compensationStartText","renderFlowerRevenuePlaceholder","DocumentTextIcon","SystemNotificationInfo","useSystemNotifications","useActiveZavannSystemNotifications","useActiveZavannSystemNotificationsByCode","useCreateSystemNotification","useDeleteSystemNotification","useActiveFlowerSystemNotifications","FlowerHubStatisticContainer","list","isPlaceholder","DataDisplay","ListDataDisplay","NoDataDisplay","FlowerHubStatisticsFlowerVersion","useFlowerHub","serialNumber","useFlowerHubComponents","FlowerHubComponents","PresentationChartLineIcon","component","DisplayItem","AssetStep","getEmptyAssetInformation","getEmptyInverterManufacturer","getEmptyInverterModel","getEmptyInverterCapacity","getEmptyBatteryManufacturer","getEmptyBatteryModel","getEmptyBatteryCapacities","isAssetInformationComplete","assetInformation","fuse","isSerialNumberComplete","addAssetSerialNumber","fuses","ActionButton","onClick","variant","baseClasses","variants","AssetManufacturerQueryKeys","useAssetManufacturers","useAssetManufacturersWithAssets","useAssetManufacturersWithInverters","useAssetManufacturersWithCompatibleBatteries","inverterId","useInverterList","useCreateAssetManufacturer","useUpdateAssetManufacturer","useDeleteAssetManufacturer","AssetInformationStep","changeStep","setAssetInformation","setFuse","inverterManufacturerData","inverterManufacturerIsLoading","inverterManufacturerIsError","batteryManufacturerData","isLoadingBattery","batteryManufacturerIsError","showErrorMessage","AssetInformationStepDropdown","manufacturer","inverterModel","powerCapacity","batteryModel","capacity","StaticInfo","selectedItem","onItemSelect","handleChange","newItem","helpText","getDeviceForMedia","isTablet","isIPad13","ConnectedEthStep","onCancel","LightBulbIcon","SerialNumberInput","onChange","onKeyDown","inputRefs","val","el","v","SerialNumberStep","setSerialNumber","inputCode","setInputCode","setError","serialArray","handleInputChange","newCode","handleKeyDown","InverterIcon","FlowerHubIcon","HomeIcon","ContentCard","content","BatteryIcon","MetaDataConfirmationStep","assetSerialNumber","DetailItem","PowerConfirmationStep","StepStatus","FlowerHubInstallationProgressTitle","FlowerHubInstallationStatusMessageCode","FlowerHubOperationalStatusMessageCode","IoTConnectivityStatus","FlowerHubStatus","ConfirmedDocIcon","ConfirmedIcon","steps","getStepStatus","stepName","currentStep","stepIndex","currentStepIndex","InstallationStepProgress","step","stepIdx","isLastStep","StepIcon","CheckIcon","cloneElement","FinishingStep","isErrored","debuggingGuide","installationGuide","BeforeYouStartStepModal","startTheInstallationSteps","watch","isRead","Trans","InstallFlowerHub","closeInstallationSteps","setCurrentStep","isReadInstallationGuideModalOpen","setIsReadInstallationGuideModalOpen","React","handleCloseModal","createAsset","onSubmitAsset","resetTheView","resetAssetInformation","getProgressInfo","getStatusColor","getCurrentStepIndex","firstDeploymentCompletedAt","isInstallationFailureMessageCode","mapInstallationFailureActionByMessageCode","OfflineWifiIcon","UnstableWifiIcon","IoTConnectivityNotificationToaster","iotConnectivityStatus","transitionOptions","getColorFromIoTConnectivityStatus","getIconFromIoTConnectivityStatus","getTextFromIoTConnectivityStatus","connectivityStatus","InstallationProgress","installationStatus","maxDeploymentAttempts","retryDeploymentAttempt","percentage","actionMessage","renderIcon","LottiePlayer","animationType","playerRef","animationIndex","setAnimationIndex","moveToNextAnimation","isLoopingAnimation","animationSrc","Player","OperationalStatusAnimationTypes","OperationStatusGrid","leftAnimationType","rightAnimationType","leftText","rightText","leftActionText","rightActionText","getOperationalStatus","operationStatusMapping","OperationalStatistics","operationalStatus","stats","OperationalProgress","StepItem","StepIndicator","StepContent","StepConnector","completedAt","textColor","stepsConfig","getCompletedAtDate","flowerHub","mapSteps","ProgressMessages","InstallationProgressFlowerVersion","updatedSteps","ContentTable","renderRow","PresenceEventType","PresenceEventLog","log","PresenceEventLogs","useFlowerHubLogsForAsset","FlowerHubLog","FlowerHubLogs","useNotifyAboutIoTConnectivityStatus","FlowerHubDetails","iotConnectivityData","showInstall","setShowInstall","ServerIcon","ZavannSiteStateCategory","ElectricityAgreementTag","stateCategory","stateId","stateReasonId","withTooltip","electricAgreementTagColor","getElectricityAgreementTagColor","ZavannInvoiceStatus","getZavannInvoiceStatusName","getStatusStyle","InvoiceStatusTag","Invoices","EditZavannSiteIdsForm","EditZavannSiteIds","electricityAgreement","isEditModalOpen","setIsEditModalOpen","updateZavannSiteIds","isUpdateSuccess","registerUpdateZavannSiteIds","handleUpdateZavannSiteIdsSubmit","resetUpdateZavannSiteIds","updateZavannSiteIdsErrors","onUpdateZavannSiteIdsSubmit","onUpdateZavannSiteIdsModalClose","ElectricityAgreementTab","isLoadingElectricityAgreement","isErrorElectricityAgreement","renderElectricityAgreementPlaceholder","shouldShowEditZavannSiteIdsOption","AgreementItem","agreement","DateItem","FlowerHubStatusTag","flowerHubStatus","BatteryDetails","getEmptyAssetModelDTO","exportToExcel","workbook","XLSX.utils","worksheet","excelBuffer","XLSX.write","blob","saveAs","useMapData","useAssetModels","useCreateAssetModel","useUpdateAssetModel","useDeleteAssetModel","EditAssetForm","assetModels","Battery0Icon","am","EditAsset","assetIdToUpdate","setAssetIdToUpdate","updateAsset","isUpdatingAsset","isUpdateAssetSuccess","registerUpdateAsset","handleUpdateAssetSubmit","resetUpdateAsset","updateAssetErrors","onUpdateAssetSubmit","onUpdateAssetModalClose","renderEditAssetButton","useFlowerHubDataStorageForAsset","batteryRatedEnergy","batteryRatedPower","batteryTemperature","batteryUpperSoCLimit","batteryLowerSoCLimit","DeviceInfoCard","InfoRow","StatusLabel","InverterOEMTypes","InverterDetails","oem","inverterOperatingMode","inverterRatedPower","inverterSerialNumber","inverterSoftwareVersionForHuawei","inverterSoftwareVersionOfArmForSungrow","inverterSoftwareVersionOfDspForSungrow","inverterCommunicationProtocolForSungrow","inverterCommunicationProtocolVersionForSungrow","controlBoardForSaj","displayBoardForSaj","InverterDongleDetails","inverterDongleMacAddress","inverterDongleIpAddress","inverterDongleSoftwareVersionForHuawei","Rss","FlowerHubDataStorageDetails","lastUpdatedAt","LastReportedStatus","bg","ringColor","isStale","isVeryStale","bgColor","textAndTextColor","Icon","ClockAlert","CheckCircle2","AssetTab","showEditAsset","isLoadingAsset","isErrorAsset","AssetOwnerTabs","AssetOwnerPage","systemNotification","isLoadingAssetOwner","isErrorAssetOwner","flowerUserTabs","getAssetOwnerName","firstName","lastName","getAssetOwnerListBreadcrumb","getAssetOwnerListLink","getAssetOwnerBreadcrumb","getAssetOwnerPageRoute","getAssetRoute","mainEmail","contactEmail","FlowerHubTable","onAssetClick","FlowerHubList","FlowerHubs","AssetListPage","getAssetListBreadcrumbs","getAssetListLink","getBreadCrumbIcon","DocumentDuplicateIcon","UsersIcon","CogIcon","UserCircleIcon","HandRaisedIcon","framerMenuBackground","DesktopMenu","menuCollapsed","onMenuCollapse","MobileMenuButton","openSidebar","Bars3Icon","Header","breadCrumb","Content","AppWrapper","setSidebarCollapsed","authLevel","pathname","useLocation","filteredNavigation","handleLogout","afterLogout","SignUp","buttonText","installerTerms","isPasswordValid","SignUpDistributorPage","signUp","isSignUpSuccess","LoadingToggle","isChecked","onToggle","Switch","EditInstallerCanInviteAssetOwner","updateCanInviteAssetOwners","isUpdatingCanInviteAssetOwners","newState","EditInstallerForm","_k","EditInstaller","isEditInstallerModalOpen","setIsEditInstallerModalOpen","updateInstaller","onEditInstallerModalClose","renderEditInstallerButton","InstallerAccountDetails","useInstallerSignUp","useInviteInstallerUser","useUpdateInstallerInvitation","useDeleteInstallerInvitation","AddInstallerUserForm","AddInstallerUser","DeleteInstallerConfirmation","DeleteInstallerInvitation","isDeleteInstallerModalOpen","setIsInstallerModalOpen","deleteInstaller","onDeleteInstaller","onDeleteInstallerModalClose","DeleteInstallerUser","ResendInstallerInvitation","inviteId","EditInstallerInvitationForm","EditInstallerInvitation","installerInvitation","EditInstallerUserForm","EditInstallerUser","installerUser","updateUser","InstallerUsersTab","useInstallerUsersResponse","badgeColor","badgeText","LatestAssetOwners","assetOwners","onAssetOwnerClick","AddAssetOwnerForm","getEmptyCreateAssetOwnerDTO","AddAssetOwner","centered","isAddAssetOwnerModalOpen","setIsAddAssetOwnerModalOpen","createAssetOwner","renderAddAssetOwnerButton","AssetOwnersEmptyState","canInviteAssetOwners","CompensationStatus","CompensationEligibilityStatusTag","AssetOwnerTable","AssetOwnerList","AssetOwners","isLoadingAssetOwners","isErrorAssetOwners","isRefetchingAssetOwners","flatAssetOwner","isLoadingInstaller","isErrorInstaller","ASSET_OWNER_TAB","InstallerPage","installerCompensation","isLoadingInstallerCompensation","AssetOwnerListPage","AuthFlowWrapper","headerText","buttonTextLoading","onActionClick","hideAction","ForgotPasswordPage","resetPassword","ResetPasswordPage","SignUpInstallerPage","Steps","isModal","smallPadding","StepsDesktop","StepStatus2","Container","SimpleButton","style","UserDetailsForm","invitation","assetOwnerDetails","onBackButtonPressed","onUserDetailsFormCompleted","postalCodeUpdated","isPostalCodeUpdated","UserDetails","DateTimePicker","control","minDate","maxDate","showTimeSelect","Controller","field","fieldState","DatePicker","ElectricityContract","onStartDateChosen","onBackButtonClicked","startDate","handleStartDateSubmit","onStartDateSubmit","Button","handleClick","FinalStep","TermsAndConditions","onNextButtonClicked","SelectedAssetOwner","Landing","onSamePersonSelectedContinue","onAnotherPersonSelectedContinue","samePersonRadioId","useId","otherPersonRadioId","selectedPerson","setSelectedPerson","handleOptionChange","changeEvent","CreatePasswordField","setPasswordIntermediate","ChoosePassword","onPasswordConfirmed","passwordIntermediate","SignOptions","signWithQrCode","signOnSameDevice","AnimatedQRCode","qrCode","qrImage","setQrImage","QRLib","FailedSignUp","navigateToStepZero","useInitiateBankIDSignature","usePollBankIDGenerateQRCode","usePollBankID","useDevice","isMobileOrTablet","isChromeOnAppleDevice","isFirefoxOnAppleDevice","isOperaTouchOnAppleDevice","OpenBankIdApp","setIsWaitingToOpenApp","BankIDVerification","passwordIsEntered","isCollectCompleted","setIsCollectCompleted","setCollectResult","loaderText","setLoaderText","orderRef","setOrderRef","setUrl","isAutoStart","setIsAutoStart","isWaitingToOpenApp","isCancelled","setIsCancelled","retryBankIDSign","setRetryBankIDSign","device","initiateBankIDSignature","initiateBankIDSignResponse","returnUrl","createReturnUrl","autoStartUrl","setQrCode","isGeneratingQrCode","setIsGeneratingQrCode","qrCodeBankIDResponse","isWaitingForQrCode","collectResult","setFlagsToFalsyValue","displayLoader","displayCancelButton","SignUpStep","SignUpStep2","SameUserWarning","setStep","checkboxId","confirmed","setConfirmed","getAddressOnlyAssetDetailsFromInvitation","getEmptyAssetOwnerDetails","getFullAssetDetailsFromInvitation","StepsComponentContainer","setStartDate","setAssetOwnerDetails","setPassword","DesktopView","getSteps","NotFound","errorCode","Language","MaintenanceScreen","MobileView","TabletView","SignUpFlowPage","i18n","isLoadingInvitation","currentDate","setPasswordIsEntered","completeSignUp","isSignUpError","bankIdDetails","stepToAssignStatus","useFlowerSignUp","useCreateFlowerInvitation","useDeleteFlowerInvitation","SignUpFlowerPage","DashboardGreetingHeader","LatestAssetOwnersWithAssetList","DistributorCompensation","currentCompensationTiles","InstallerCompensation","DashboardPage","userName","AddFlowerUserForm","AddFlowerUser","renderAddFlowerUserButton","DeleteFlowerUserConfirmation","DeleteFlowerUser","isDeleteUserModalOpen","setIsUserModalOpen","onDeleteUserModalClose","DeleteFlowerUserInvitation","isDeleteInvitationModalOpen","setIsInvitationModalOpen","onDeleteInvitationModalClose","FlowerUsersTab","useFlowerUsersResponse","FlowerOrganizationPage","loggedInUserId","getBreadcrumbs","TextArea","EditAssetModelForm","EditAssetModel","assetModel","isEditAssetModelModalOpen","setIsEditAssetModelModalOpen","updateAssetModel","isUpdatingAssetModel","isUpdateAssetModelSuccess","registerUpdateAssetModel","handleUpdateAssetModelSubmit","resetUpdateAssetModel","assetModelErrors","onUpdateAssetModelSubmit","onUpdateAssetModelModalClose","renderEditAssetModelButton","DeleteAssetModel","isDeleteAssetModelModalOpen","setIsDeleteAssetModelModalOpen","deleteAssetModel","onDeleteAssetModel","onDeleteAssetModelModalClose","renderDeleteAssetModelButton","AddAssetModelForm","AddAssetModel","isAddAssetModelModalOpen","setIsAddAssetModelModalOpen","createAssetModel","isCreatingAssetModel","isCreateAssetModelSuccess","registerAssetModel","handleAssetModelSubmit","resetAssetModel","onAssetModelSubmit","closeAddAssetModelModal","renderAddAssetModelButton","PlusCircleIcon","AssetModelList","FolderPlusIcon","BRP","brpLabel","brp","BRP_DROPDOWN_ITEMS","usePrequalificationGroup","useCreatePrequalificationGroup","useUpdatePrequalificationGroup","BIDDING_REGION_DROPDOWN_ITEMS","CheckboxGroup","PrequalificationGroupForm","getEmptyPrequalificationGroupDTO","AddPrequalificationGroup","isAddPrequalificationGroupModalOpen","setIsAddPrequalificationGroupModalOpen","createPrequalificationGroup","isCreatingPrequalificationGroup","isCreatePrequalificationGroupSuccess","registerPrequalificationGroup","handleAddPrequalificationGroupSubmit","resetPrequalificationGroup","createPrequalificationGroupErrors","onAddPrequalificationGroupSubmit","handleAddAssetModalClose","renderAddPrequalificationGroupButton","EditPrequalificationGroup","prequalificationGroup","isEditPrequalificationGroupModalOpen","setPrequalificationGroupModalOpen","updatePrequalificationGroup","isUpdatingPrequalificationGroup","isUpdatePrequalificationGroupSuccess","registerUpdatePrequalificationGroup","handleUpdatePrequalificationGroupSubmit","resetUpdatePrequalificationGroup","updatePrequalificationGroupErrors","onUpdatePrequalificationGroupSubmit","onUpdatePrequalificationGroupModalClose","PrequalificationGroups","prequalificationGroups","thClassName","checkCircleClassName","a","b","group","SystemNotificationType","SystemNotificationStatus","Filters","FunnelIcon","getUniqueFilterTags","columnName","firstNestedProperty","secondNestedProperty","uniqueFilterTags","filterFunction","columnId","DeleteSystemNotification","isDeleteSystemNotificationModalOpen","setIsDeleteSystemNotificationModalOpen","deleteSystemNotification","onDeleteSystemNotification","onDeleteSystemNotificationModalClose","renderDeleteSystemNotificationButton","AddSystemNotificationForm","nt","getEmptySystemNotificationDTO","AddSystemNotification","isAddSystemNotificationModalOpen","setIsAddSystemNotificationModalOpen","createSystemNotification","isCreatingSystemNotification","isSystemNotificationSuccess","registerSystemNotificationModal","handleSystemNotificationModalSubmit","resetSystemNotificationModal","systemNotificationModalErrors","onSystemNotificationModalSubmit","closeAddSystemNotificationModal","renderAddSystemNotificationButton","onSearch","initialValue","TanStackTable","globalFilter","setGlobalFilter","getFilteredRowModel","SystemNotificationList","systemNotifications","BellAlertIcon","PREQUALIFICATION_GROUP_TAB","ASSET_MODELS_TAB","SYSTEM_NOTIFICATION_TAB","FlowerSettingsPage","GENERAL_TAB","DistributorOrganizationPage","getOrganizationBreadcrumb","ProfilePage","NotFoundPage","ManualActionPage","Centered","Maintenance","maintenance","InvoicesPage","OVERVIEW_TAB","FLOWER_REVENUE","ConsumptionAndRevenuePage","BatteryTab","BatteryPage","assetOwnerWithAssetId","PanelRow","LatestInvoices","getLatestInvoices","maxCount","isAfter","ElectricityAgreement","Battery","AssetOwnerDashboardPage","getAssetOwnerDashboardPageBreadcrumb","InstallerOrganizationPage","createEmptyAssetManufacturerDTO","AddAssetManufacturerForm","AddAssetManufacturer","isAddModalOpen","setIsAddModalOpen","createAssetManufacturer","isCreated","registerAssetManufacturer","handleAssetManufacturerSubmit","resetAssetManufacturer","assetManufacturerErrors","onAssetManufacturerSubmit","closeAddModal","renderAddAssetManufacturerButton","EditAssetManufacturerForm","EditAssetManufacturer","assetManufacturer","canBeDeleted","isEditManufacturerModalOpen","setIsEditManufacturerModalOpen","editAssetManufacturer","isUpdated","deleteAssetManufacturer","isDeleted","onEditAssetManufacturerSubmit","onDeleteAssetManufacturerSubmit","closeEditModal","renderEditManufacturerButton","PowerCapacity","handleDeleteCapacity","AddInverterModelForm","manufacturers","powerInputs","setPowerInputs","tempPowerCapacity","setTempPowerCapacity","handleAddPowerCapacity","valueToDelete","useInverters","useInverter","useCreateInverter","useUpdateInverter","useDeleteInverter","createEmptyInverterModelDTO","getEmptyInverterModelDTO","AddInverterModel","manufacturerId","createInverter","assetManufacturers","registerInverter","handleAddInverterSubmit","resetInverter","inverterErrors","onInverterSubmit","renderAddInverterButton","Capacity","AddBatteryModelForm","invertersData","inverterCompatibilities","handleCheckboxChange","capacityInputs","setCapacityInputs","tempEnergyCapacity","setTempEnergyCapacity","energyInputRef","powerInputRef","handleEnergyInputChange","handlePowerInputChange","handleAddCapacity","handleEnergyKeyDown","handlePowerKeyDown","capacityIndexToDelete","_","inverter","useBattery","useCreateBattery","useCreateBatteryCapacities","useUpdateBattery","useDeleteBattery","createEmptyBatteryModelDTO","getEmptyBatteryModelDTO","AddBatteryModel","setInverterCompatibilities","createBattery","isLoadingManufacturers","isErrorManufacturers","inverters","isLoadingInverters","isErrorInverters","registerBattery","handleAddBatterySubmit","resetBattery","batteryErrors","onBatterySubmit","renderAddBatteryButton","isManufacturerNotValid","isInvertersNotValid","AddBatteryCapacityForm","AddBatteryCapacity","batteryId","createCapacities","renderAddBatteryCapacitiesButton","EditBatteryModelForm","batteryData","EditBatteryModel","updateBattery","battery","deleteBattery","handleEditBatterySubmit","onDeleteBatterySubmit","renderEditBatteryButton","EditInverterModelForm","inverterData","batteryCompatibilities","EditInverterModel","setBatteryCompatibilities","updateInverter","deleteInverter","handleEditInverterSubmit","onDeleteInverterSubmit","renderEditInverterButton","MapDataStep2","mapData","AssetModelConfiguration","InverterModelList","invertersList","InverterTile","constraint","INVERTERS_LIST","CONFIGURATION","AssetModelConfigurationPage","ScrollablePage","isWide","NotScrollablePage","DeleteCompensationModel","compensationModelPeriodId","isModalOpen","setIsModalOpen","mutate","onDeleteCompensationModelPeriod","onCloseModal","MonthTimePicker","getEndOfTheMonth","newDate","moment","AddCompensationModelPeriodForm","getValues","obj","AddCompensationModelPeriod","isPending","CompensationModelTab","currentCompensationModel","isLoadingCurrentCompensationModel","isErrorCurrentCompensationModel","compensationModelHistory","isLoadingCompensationModelHistory","isErrorCompensationModelHistory","Cog6ToothIcon","useBillingAdjustmentStatistics","useQualifiedAssetOwners","usePostBillingAdjustments","KeyValueTile","keyword","BillingAdjustmentStatistics","CheckBadgeIcon","BuildingLibraryIcon","PaperAirplaneIcon","currentInvoicedMonth","PostBillingAdjustmentsStatusTypes","PayoutInformationStatusTypes","BillingAdjustmentStatusTag","PayoutInformationStatusTag","OtpInput","PostBillingAdjustmentConfirmationModal","onOTPVerified","validateOtp","isValidOtp","isVerifyingOtp","requestOtp","isValidCode","handleSend","DialogBackdrop","DialogTitle","PostBillingAdjustmentModal","sendAdjustment","handleAdjustment","debounce","ProdPostBillingAdjustmentAllowedUserIDs","postBillingAdjustmentAllowedUserIDs","PostBillingAdjustment","isConfirmationModalOpen","setIsConfirmationModalOpen","isPostBillingAdjustmentModalOpen","setIsPostBillingAdjustmentModalOpen","shouldShowSendBillingAdjustmentButton","customer","displayButton","startPostingBillingAdjustments","BillingAdjustmentExcelExport","transformData","generateDataSheets","sentAdjustments","unsentAdjustments","bankAccountsRegistered","bankAccountsMissing","dataSheets","sheetName","ArrowDownTrayIcon","QualifiedAssetOwnerList","ArrowTopRightOnSquareIcon","BillingAdjustmentTab","CompensationStatisticsTab","totalCompensation","isLoadingTotalCompensation","isErrorTotalCompensation","distributorsCompensation","isLoadingDistributorsCompensation","isErrorDistributorsCompensation","isLoadingInstallersCompensation","isErrorInstallersCompensation","allStakeholdersTiles","distributorsTiles","installersTiles","InstallerPayoutCSVExport","installerInfo","handleDownload","headers","csvRows","values","csvString","InstallerCompensationTab","MONTHLY_BILLING_ADJUSTMENT_TAB","COMPENSATION_MODEL","COMPENSATION_STATISTICS","INSTALLER_COMPENSATION","CompensationPage","maintenanceRoute","Navigate","routes","isLoggedIn","Outlet","getAppRoutes","FLOWER_APP_ROUTES","getDistributorAppRoutes","getInstallerAppRoutes","ASSET_OWNER_APP_ROUTES","loggedInUserRole","DISTRIBUTOR_APP_ROUTES","minRole","route","INSTALLER_APP_ROUTES","useSentryRoutes","wrapUseRoutes","useRoutes","App","isLoadingSystemNotification","routing","resources","englishTranslation","swedishTranslation","i18next","initReactI18next","redactLongUrl","Sentry.init","breadcrumb","QueryClient","ReactDOM","QueryClientProvider","Router","Toaster"],"mappings":"m5EAAY,IAAAA,GAAAA,IACVA,EAAAA,EAAA,MAAQ,EAAR,EAAA,QACAA,EAAAA,EAAA,WAAa,GAAb,EAAA,aACAA,EAAAA,EAAA,cAAgB,GAAhB,EAAA,gBACAA,EAAAA,EAAA,eAAiB,GAAjB,EAAA,iBACAA,EAAAA,EAAA,gBAAkB,GAAlB,EAAA,kBACAA,EAAAA,EAAA,iBAAmB,GAAnB,EAAA,mBACAA,EAAAA,EAAA,OAAS,GAAT,EAAA,SAPUA,IAAAA,GAAA,CAAA,CAAA,ECKZ,MAAMC,EAAYC,GAAkB,EAClCC,GACGC,IAAS,CACR,KAAM,OACN,QAAUC,GACRD,EAAKE,IAAW,CACd,GAAGA,EACH,KAAAD,CAAA,EACA,EACJ,UAAW,IACTD,EAAKE,IAAW,CACd,GAAGA,EACH,KAAM,MAAA,EACN,CAAA,GAEN,CACE,KAAM,cAAA,CACR,CAEJ,EAEaC,GAAaD,UACxB,OAAAE,EAAAF,EAAM,OAAN,YAAAE,EAAY,IAEDC,GAAeH,GAC1B,OAAA,QAAAE,EAAAF,GAAA,YAAAA,EAAO,OAAP,YAAAE,EAAa,OAAQR,EAAK,OAEfU,GAAmBJ,GAC9B,OAAA,QAAAE,EAAAF,EAAM,OAAN,YAAAE,EAAY,eAAgB,QAEjBG,GAAoBL,UAC/B,OAAAE,EAAAF,EAAM,OAAN,YAAAE,EAAY,eAEDI,GAAkBN,UAC7B,OAAAE,EAAAF,EAAM,OAAN,YAAAE,EAAY,aAEDK,GAAeP,GAAq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EAAgC,mBACnD,mBAAoBA,EAAgC,mBACpD,SACE,0FACF,UACE,qHACJ,EACF,CAACrE,EAAsC,6CAA6C,EAClF,CACE,kBAAmBqE,EAAgC,eACnD,mBAAoBA,EAAgC,mBACpD,SACE,6FACF,UACE,8FACF,eACE,kGACJ,EACF,CAACrE,EAAsC,+CAA+C,EACpF,CACE,kBAAmBqE,EAAgC,eACnD,mBAAoBA,EAAgC,mBACpD,SACE,+FACF,UACE,gGACF,eACE,qGACF,gBACE,qGACJ,EACF,CAACrE,EAAsC,4CAA4C,EACjF,CACE,kBAAmBqE,EAAgC,QACnD,mBAAoBA,EAAgC,eACpD,SACE,4FACF,UACE,6FACF,eACE,kGACJ,EACF,CAACrE,EAAsC,oDAAoD,EACzF,CACE,kBAAmBqE,EAAgC,QACnD,mBAAoBA,EAAgC,mBACpD,SACE,oGACF,UACE,qGACF,eACE,yGACJ,EACF,CAACrE,EAAsC,sDAAsD,EAC3F,CACE,kBAAmBqE,EAAgC,QACnD,mBAAoBA,EAAgC,mBACpD,SACE,sGACF,UACE,uGACF,gBACE,6GACF,eACE,2GACJ,EACF,CAACrE,EAAsC,mDAAmD,EACxF,CACE,kBAAmBqE,EAAgC,QACnD,mBAAoBA,EAAgC,eACpD,SACE,mGACF,UACE,oGACF,gBACE,0GACF,eACE,wGACJ,EACF,CAACrE,EAAsC,yDAAyD,EAC9F,CACE,kBAAmBqE,EAAgC,mBACnD,mBAAoBA,EAAgC,mBACpD,SACE,yGACF,UACE,yGACJ,EACF,CAACrE,EAAsC,2DAA2D,EAChG,CACE,kBAAmBqE,EAAgC,mBACnD,mBAAoBA,EAAgC,mBACpD,SACE,2GACF,UACE,4GACF,gBACE,iHACJ,EACF,CAACrE,EAAsC,wDAAwD,EAC7F,CACE,kBAAmBqE,EAAgC,mBACnD,mBAAoBA,EAAgC,eACpD,SACE,wGACF,UACE,yGACF,gBACE,8GACJ,EACF,CAACrE,EAAsC,sBAAsB,EAAG,CAC9D,kBAAmBqE,EAAg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