{"version":3,"sources":["../node_modules/@aws-amplify/ui-components/dist/esm-es5 lazy /^/.*/.entry/.js$/ include: /.entry/.js$/ exclude: /.system/.entry/.js$/ groupOptions: {} namespace object","reportWebVitals.ts","locales/i18n.ts","api/models.ts","contexts/authContext.ts","api/errorCodes.ts","contexts/dataRefreshContext.ts","contexts/environmentContext.ts","util/toAntdPagination.ts","util/useDimension.ts","util/useDownloadCsv.ts","util/minByMaxBy.ts","util/useOnChangeListener.ts","util/useRefreshAll.ts","util/useSetting.ts","util/useTransformedState.ts","api/useApiState.ts","api/api.utils.ts","util/useIncrementingCounter.ts","components/map/Map.tsx","components/map/mapUtils.ts","components/Maximizable.tsx","components/beacon-details/map/BeaconMapDetails.tsx","components/BeaconActiveErrorsTooltip.tsx","components/BeaconErrorStatus.tsx","components/ActionsIcon.tsx","components/BeaconsErrors.tsx","api/api.beacons.ts","components/BeaconStatus.tsx","components/TimeRangePicker.tsx","components/TimeRangeSelection.tsx","components/beacon-drawer/BeaconDrawer.tsx","components/beacon-drawer/BeaconDrawerContext.tsx","api/api.construction-projects.ts","api/api.telemetry-history.ts","components/beacon-configuration/BeaconConfigurationForm.tsx","components/beacon-configuration/BeaconConfigurationModal.tsx","components/BeaconTableBase.tsx","screens/beacons/BeaconsBeaconTable.tsx","components/OrganizationPropertyModal.tsx","components/Badge.tsx","components/UserTable.tsx","api/api.organizations.ts","components/beacon-configuration/SelectBeaconsModal.tsx","components/beacon-configuration/AssignBeaconsModal.tsx","components/SelectUsersModal.tsx","screens/organization/AssignUsersModal.tsx","components/beacon-configuration/UnassignBeaconsButton.tsx","screens/organization/OrganizationBeaconTableFooter.tsx","screens/organization/OrganizationBeaconTable.tsx","screens/organization/OrganizationUserTableFooter.tsx","screens/no-role/NoRole.tsx","components/BeaconTelemetryFilter.tsx","components/beacon-details/about/BeaconAboutCard.tsx","util/useComputeFromToDateRange.ts","components/Chart.tsx","components/DownloadEnvironmentMessages.tsx","components/beacon-details/battery/BeaconBatteryDrawer.tsx","components/beacon-details/battery/BeaconBatteryCard.tsx","components/beacon-details/error/BeaconErrorTable.tsx","components/beacon-details/error/BeaconErrorDrawer.tsx","components/beacon-details/error/BeaconErrorCard.tsx","components/beacon-details/event/BeaconEventTable.tsx","components/beacon-details/event/BeaconEventDrawer.tsx","components/beacon-details/event/BeaconEventCard.tsx","components/MultiAxisChart.tsx","components/DownloadPositions.tsx","components/beacon-details/location/BeaconLocationDrawer.tsx","components/beacon-details/location/BeaconLocationCard.tsx","components/map/BeaconMapLegend.tsx","components/beacon-details/map/BeaconMapDrawer.tsx","components/beacon-details/map/BeaconMapCard.tsx","components/beacon-details/BeaconDetails.tsx","screens/construction-project/NodeSelectedContext.tsx","components/map/MapLegendButton.tsx","screens/construction-project/map/ConstructionProjectMap.tsx","screens/construction-project/project-tree/treeUtils.tsx","util/TruncateLongText.tsx","screens/construction-project/project-tree/ConstructionProjectIcons.tsx","screens/construction-project/project-tree/ConstructionProjectTree.tsx","util/EditableText.tsx","screens/construction-project/drawers/useUpdateInformation.tsx","util/NavigatableText.tsx","screens/construction-project/drawers/project/SitesDetails.tsx","screens/construction-project/drawers/project/SummaryInformation.tsx","screens/construction-project/drawers/project/ConstructionProjectDrawer.tsx","screens/construction-project/drawers/site/BeaconDetails.tsx","screens/construction-project/drawers/site/SummaryInformation.tsx","screens/construction-project/drawers/site/ConstructionSiteDrawer.tsx","screens/construction-project/ConstructionProjectWrapper.tsx","routes.ts","screens/construction-project/ConstructionProject.tsx","screens/beacons/Beacons.tsx","screens/beacons/Beacon.tsx","screens/organizations/Organizations.tsx","screens/organization/Organization.tsx","screens/users/Users.tsx","components/NavigationMenu.tsx","components/UserMenu.tsx","components/Environment.tsx","App.tsx","index.tsx"],"names":["map","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","Error","code","ids","id","all","slice","keys","Object","module","exports","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","options","resources","en","de","fallbackLng","defaultNS","debug","interpolation","escapeValue","react","wait","bindI18n","bindI18nStore","nsMode","i18n","use","LanguageDetector","initReactI18next","init","ForwardToPlatform","BeaconSortingColumn","BeaconSortingOrder","BeaconTableColumns","ErrorSeverity","StateOfPosition","Trigger","SensorTypes","AccessToken","cognitoAccessToken","jwt","payload","expiresAt","this","intitialize","Date","a","isExpired","Auth","currentSession","session","getAccessToken","role","indexOf","accessTokenPayload","decodePayload","getJwtToken","exp","AuthContext","React","createContext","errorCodes","getErrorCode","name","useErrorTranslation","t","useTranslation","isRoadSafetyManager","useContext","currentUser","accessToken","hasRole","useCallback","severity","resolved","acknowledged","resolvedSuffix","ackPrefix","codeKey","isOn","trigger","POWER_ON","isOff","POWER_OFF","DataRefreshContext","refreshCounter","refresh","DataAutoRefreshContext","interval","disabled","enable","disable","setInterval","EnvironmentContext","undefined","toAntdPagination","page","hideOnSinglePage","current","currentPage","pageSize","currentPageSize","total","value","totalCount","showSizeChanger","pageSizeOptions","onChange","newPage","newPageSize","goToPage","setPageSize","initialState","width","height","useDimension","ref","useState","dimensions","setDimensions","handlers","setHandlers","setHandler","handler","length","push","resizeObserverRef","useRef","useEffect","ResizeObserver","entries","forEach","entry","contentRect","d","h","observe","disconnect","useDownloadCsv","beaconId","items","columns","fileName","culture","csv","unparse","p","reduce","v","c","nv","title","delimiter","type","test","navigator","userAgent","blob","Blob","dataURI","URL","window","webkitURL","uri","createObjectURL","link","document","createElement","href","download","body","appendChild","click","remove","minBy","pluck","values","i","item","filter","b","maxBy","get","properties","useRefreshAll","apiStates","refreshes","r","jsonSerialize","JSON","stringify","jsonDeserialize","json","parse","useSetting","defaultValue","serialize","deserialize","key","onSerialize","toString","onDeserialize","deserialized","parseFloat","storedValue","localStorage","getItem","tryRead","tryStore","setValue","persist","setItem","emptyArray","useTransformedState","source","transform","dependency","target","setTarget","dependencies","Array","isArray","defaultDependency","useApiState","set","loading","setLoading","failed","setFailed","lastLoadedAt","setLastLoadedAt","authContext","environmentContext","dataRefreshContext","dependencyList","result","usePagedApiState","apiVersion","setCurrentPage","setCurrentPageSize","effectivePageSize","offsetText","limitText","getter","state","useGetAuthorized","url","postProcessor","manipulateUrl","token","environment","query","refreshIfExpired","effectiveUrl","baseUrl","api","baseUrlv2","fetch","method","headers","Headers","response","useAuthorizedFetch","jsonBody","useFromToFilter","fromText","toText","to","from","getTime","toISOString","useRefreshCounter","intervalMs","counter","setCounter","clearInterval","useIncrementingCounter","createMarkerIcon","color","Icon","iconUrl","process","shadowUrl","iconSize","iconAnchor","popupAnchor","shadowSize","icons","blue","green","grey","red","orange","ClickOutsideHandler","onMapClick","useMapEvent","originalEvent","closest","Map","markers","polylines","polygons","testId","onMapClicked","mapRef","prevMarkersRef","hasSetInitialView","containerRef","setDimensionHandler","marker","setView","lat","lon","bounds","LatLngBounds","extend","polygon","ring","point","latitude","longitude","polyline","line","isValid","fitBounds","style","data-testid","MapContainer","center","zoom","whenCreated","mapInstance","invalidateSize","TileLayer","attribution","Marker","position","icon","eventHandlers","onClick","Popup","index","Polygon","positions","pathOptions","Polyline","weight","getMarkerColor","beacon","onOffSwitch","activeErrors","md","cprs","Maximizable","props","isMaximized","setIsMaximized","onToggled","toggle","m","hide","children","buttonPositioning","buttonPosition","right","bottom","top","left","backgroundColor","zIndex","display","gridTemplateColumns","gridColumnGap","alignSelf","label","className","padding","aspectRatio","border","cursor","FullscreenExitOutlined","FullscreenOutlined","BeaconMapDetails","polyLines","aria-label","pos","serial","at","measuredAt","toLocaleString","message","showIcon","ActiveErrorsLabel","errors","Warning","warnings","errorLabel","count","warningLabel","BeaconActiveErrorsTooltip","errorTranslation","fontWeight","margin","BeaconErrorStatus","isError","some","showTooltip","ExclamationCircleOutlined","WarningOutlined","overlayStyle","maxWidth","ActionsIcon","fontSize","noop","stopPropagation","BeaconErrorActionButton","markErrorAsRead","useMarkErrorAsRead","deleteError","authorizedFetch","ok","status","useDeleteError","allSuffix","error","dataRefresh","onRead","onDelete","placement","content","gridTemplateRows","hasBeenRead","CheckOutlined","danger","DeleteOutlined","marginTop","marginRight","BeaconDetailedErrorContent","columnGap","since","startedAt","BeaconErrors","borderRadius","Battery","voltage","batt","percentage","remainingRuntimeRatio","roundedPercentage","Math","round","days","floor","remainingRuntimeHours","tooltip","toFixed","iconOnly","BeaconStatus","hideErrorStatus","hasWarningsOrErrors","marginLeft","textAlign","lastReportedAt","TimeRangePicker","range","setRange","isOpen","setIsOpen","open","moment","cancel","okDisabled","isBefore","onSelected","toDate","visible","onOk","onCancel","okText","cancelText","okButtonProps","RangePicker","showTime","startOf","endOf","placeholder","DAY","PredefinedFilterOptions","useTimeRangeSelection","customDateFilter","setCustomDateFilter","f","custom","toLocaleDateString","toLocaleTimeString","fromToFilterOptions","setFromToFilterOptions","selectedFromToFilterOptionIndex","setSelectedFromToFilterOptionIndex","onSelectCustomTimeFrame","currentOptions","newOptions","onSelectFilterOption","selectedFromToFilter","TimeRangeSelection","overlay","Item","every","preventDefault","DownOutlined","pushOnOffSwitch","tl","onOff","text","time","PoweroffOutlined","BeaconDrawerContent","idOrSerial","boardType","positionHistory","usePositionHistory","environmentHistory","useEnvironmentHistory","errorHistory","useErrorHistory","lifecycleHistory","useLifecycleHistory","useActiveErrors","beaconWithPos","positionHistoryValue","newestPosition","timeline","err","life","active","CheckCircleOutlined","tag","pushErrors","pushOnOff","hasBeenReadAt","pushErrorAcknowledgements","sort","t1","t2","resortRequired","lastActivation","find","lastDeactivation","activationIsNotShown","oldActivationIsShown","loadingTimeline","gridRowGap","whiteSpace","overflowX","overflowY","paddingTop","paddingLeft","dot","BeaconDrawer","onClose","history","useHistory","currentUserIsSolutionOperator","navigateToBeacon","drawerWidth","innerWidth","maskStyle","BeaconDrawerContext","show","close","BeaconDrawerContextProvider","beaconShownInDrawer","setBeaconShownInDrawer","closeBeaconDrawer","Provider","useUpdateDrawer","beaconsFromApi","beacons","drawer","useBeacons","assignedToOrganization","filterString","onlyWithError","sorting","assigned","alreadyHasQueryParameter","trim","sortColumnId","sortOrderId","fixDatesOfPagedBeacons","fromToFilter","take","fixDates","appendDateFilter","getReasonFromNordicEvent","eventText","TIME","MOVE","console","warn","reason","event","ts","fixDatesOfBeacon","lastMessageReceivedAt","withPosition","nordicBeacon","repmappedNordicPosition","pvt","l","lo","alt","hAcc","vAcc","tAcc","hDop","dop","pDop","vDop","satU","s","pst","useAssignConstructionSite","constructionProjectId","assignment","constructionSiteId","exclusive","beaconIds","endPath","legacyMapper","apiV","manipulatedUrl","replace","mapNordicToLegacy","nm","acc","sats","sensors","cell","iccid","ConfigurationValueStatus","desired","reported","CloseCircleOutlined","QuestionCircleOutlined","getProperty","config","property","BeaconConfigurationField","mode","translationKey","number","edited","onEdited","onChanged","currentValue","listener","newValue","changedObject","useOnChangeListenerDynamic","step","BeaconConfigurationForm","reloadToken","configuration","showCorrectionServiceConfiguration","editedConfiguration","activityIntervalPeriod","motionDetectionThreshold","correctionServiceType","correctionServiceConfiguration","endpoint","port","ntripConfiguration","mountpoint","username","password","ntripRequestInterval","pointPerfectConfiguration","correctionTopic","distributionTopic","clientId","intitializeConfig","onConfigurationEdited","onNtrip","newConfig","onPointPerfect","usesNtrip","size","BeaconConfigurationModal","setReloadToken","isSaving","setIsSaving","isEditing","setIsEditing","setEditedConfiguration","original","configureBeacon","input","useConfigureBeacon","onSave","isEditedConfigurationValid","hasNtrip","hasPointPerfect","hasAllRequiredFields","c1","c2","hasDifferences","modalFooter","SettingOutlined","serial_or_id","footer","BeaconTableBase","beaconData","visibleColumns","disableCellClick","showPagination","showFooter","showClearSelected","rowsSelectable","showBeaconFilter","showSorter","footerContent","onSort","onFilter","onSelect","isPageRendered","selectedRowKeys","previousPage","isFiltering","onFilterChange","debounce","visibleColumnsDefintion","getVisibleColumnDefinitions","urlPathPart","setTimeout","selectedId","alignItems","beaconFilter","dataSource","pagination","_","__","sorter","extra","mapSortingToApiDefintions","onSortingChange","scroll","y","rowKey","rowSelection","selectedKeys","rowSelectFooter","handleCellClick","render","onCell","hwv","fwv","imei","manufacturedOn","constructionSiteName","constructionProjectName","organizationName","organizationId","column","includes","selectedRowIds","onClearAllSelectedBeacons","onFilterChanged","suffix","SearchOutlined","allowClear","columnKey","order","Ascending","Descending","BeaconsBeaconTable","setSorting","useSorting","setFilter","onFiltering","useFiltering","Serial","Status","ConstructionProjectName","ConstructionSiteName","OrganizationName","OmmitColumn","LastMessageReceivedAt","ConfigurationButton","OrganizationPropertyModal","newName","setNewName","newForward","setNewForward","effectiveName","organization","effectiveForward","forwardToPlatform","modalButtonIcon","checked","UDP","NONE","checkedChildren","unCheckedChildren","MOVEMENT_MAIL_ALERTING","Badge","rest","effectiveStyle","UserTable","users","selectedUserIds","setSelectedUserIds","hideFooter","sticky","isOnCurrentPage","is","selectedUserIdsOnCurrentPage","email","OrganizationUsersTable","AllUsersTable","SelectBeaconsModal","isSelecting","setIsSelecting","selectedBeaconIds","setSelectedBeaconIds","openModal","onBeaconsSelected","selectButtonTitle","selectButtonText","modalButton","max","innerHeight","bodyStyle","AssignBeaconsModalConstructionSite","assignBeaconsToConstructionSite","onAssignBeaconsToConstructionProject","instruction","PlusCircleOutlined","AssignBeaconsModalOrganization","assignBeaconsToOrganization","useAssignBeaconsToOrganization","onAssignBeaconsToOrganization","SelectUsersModal","onUsersSelected","maxHeight","AssignUsersModal","assignUsersToOrganization","userIds","useAssignUsersToOrganization","onAssignUsersToOrganization","UnassignBeaconsButtonSite","isUnassigning","setIsUnassigning","unassignBeaconsFromSite","onUnassignBeaconsFromSite","MinusCircleOutlined","UnassignBeaconsButtonOrganization","onClearSelectedBeaconIds","unassignBeaconsFromOrganization","useUnassignBeaconsFromOrganization","onUnassignBeaconsFromOrganization","OrganizationBeaconTableFooter","OrganizationBeaconTable","clearSelectedBeaconIds","useSelectedBeacons","orgBeacons","useOrganizationBeacons","Iccid","OrganizationUserTableFooter","unassignUsersFromOrganization","useUnassignUsersFromOrganization","onUnassignUsersFromOrganization","onClearSelectedUserIds","NoRole","NoOrganization","BeaconTelemetryFilter","showAccurate","showGpsOnly","showLatestOnly","showAll","BeaconAboutCard","renderBeaconProperty","overflow","useComputeFromToDateRange","offsetX","chartRef","g","querySelector","leftMostX","baseVal","matrix","x2","relativeX","min","Chart","series","crossHairValues","setCrossHairValues","selectedSeries","chartDimensions","zoomFrom","setZoomFrom","zoomTo","setZoomTo","onMouseLeave","onZoomStart","nativeEvent","onZoomMove","onZoomEnd","onZoom","chv","seriesIndex","activeSeries","dataPoints","x","xDomain","onMouseDown","onMouseMove","onMouseUp","xType","data","onNearestX","findIndex","os","setCrossHair","atDate","tickLabelAngle","join","orientation","language","ZoomOverlay","pointerEvents","_p","_c","DownloadEnvironmentMessages","environmentMessages","BeaconBatteryDrawer","environmentFromToDateRange","environmentSeries","batteryDrawerVisible","onCloseDrawer","closeDrawer","justifyContent","CloseOutlined","closable","BeaconBatteryCard","setBatteryDrawerVisible","handleDrawerOpenClose","environmentHistoryValue","PlusOutlined","BeaconErrorTableColumns","BeaconErrorTable","filteredColumns","gridColumn","BeaconErrorDrawer","errorDrawerVisible","activeErrorCount","ErrorText","Severity","CreatedAt","ErrorCode","BeaconErrorCard","setErrorDrawerVisible","marginBottom","TabPane","BeaconEventTable","dataIndex","isHeartbeat","BeaconEventDrawer","eventDrawerVisible","BeaconEventCard","setEventDrawerVisible","DualAxisLineChart","lineColor","hideTicks","opacity","maximumSignificantDigits","DownloadPositions","BeaconLocationDrawer","positionSeries","locationDrawerVisible","positionFromToDateRange","BeaconLocationCard","locationBatteryVisible","setLocationBatteryVisible","LegendItem","BeaconMapLegend","legendItems","legendItemsMarkers","legendItemsPolygons","Markers","Polygons","BeaconMapDrawer","mapDrawerVisible","isMapInfoVisible","setIsMapInfoVisible","latestPositionAsFallbackForMap","toggleMapInfo","forceRender","InfoCircleOutlined","onMouseEnter","BeaconMapCard","setMapDrawerVisible","posHistory","toggleDrawer","BeaconDetails","breadcrumb","justifySelf","defaultSelectedNode","selectedSiteId","selectedSiteName","selectedProjectId","selectedProjectName","projectDrawerVisible","siteDrawerVisible","defaultContextValue","selectedNode","nodeVisitiblyDisabledList","setSelectedNode","setNodeVisitiblyDisabledList","NodeSelectedContext","useNodeSelectedContext","NodeSelectedProvider","mapLegendStyle","MapLegendButton","legendStyle","buttonStyle","ConstructionProjectMap","constructionSites","constructionProjects","isLoading","onClickEvent","log","transformBeaconsToMarkers","filteredMarkers","useMemo","filteredConstructionSites","site","filteredConstructionProjects","project","combinedPolygons","projects","coord","area","getPolygonsProjects","sites","getPolygonsSites","siteId","siteName","siteBeaconCount","getPolylinesSites","filteredNodes","node","search","filteredNodesKey","toLowerCase","filterTreeDataByKeys","keySet","Set","filterNodes","nodes","has","filteredChildren","getAllKeys","treeData","traverse","getChildKeys","childNode","getParentKeys","tree","parentKeys","parent","findNode","foundNode","TruncatedLongText","maxLength","textOverflow","BeaconIcon","EnvironmentOutlined","ProjectIcon","BorderOuterOutlined","SiteIcon","BorderInnerOutlined","OrganizationIcon","TeamOutlined","EmptyIcon","EyeOutlined","visibility","IconWrapper","IconComponent","ariaLabel","InfoIcon","handleIconClick","EyeIconBase","EyeIcon","EyeInvisibleOutlined","EyeIconAll","isVisible","setIsVisible","ExpandIcon","isExpanded","setIsExpanded","PlusSquareOutlined","MinusSquareOutlined","DirectoryTree","Tree","RenderTitle","defaultIdExpanded","handleTitleClick","isOrganization","isConstructionProject","isConstructionSite","isSerail","renderSerial","displayVisibility","MemoizedRenderTitle","memo","ConstructionProjectTree","searchTerm","setSearchTerm","expandedKeys","setExpandedKeys","savedExpandedKeys","setSavedExpandedKeys","isSolutionOperator","transformedData","buildTree","groupByKeys","currentKey","remainingKeys","group","nullKey","random","String","groupedItems","firstItem","currentKeyName","flatMap","transformToTreeData","filteredNodeData","filteredNodeKeys","targetNode","allExpandedKeys","filteredExpandedKeys","action","showLine","showLeafIcon","selectable","titleRender","onExpand","SearchBar","TreeGlobalOptions","LoadingSpinner","EditableText","saveCallback","titleText","setTitle","tempText","setTempText","addEventListener","handleClickOutsideText","removeEventListener","handleSaveClick","handleEditClick","contains","onKeyDown","SaveOutlined","EditOutlined","useUpdateConstructionProjectInformation","constructionProjectData","updatedValue","completed","updateResult","setUpdateResult","update","constructionProject","useUpdateConstructionProject","updateProjectName","resetUpdateInfo","updateProjectCity","city","address","zipCode","street","useUpdateConstructionSiteInformation","constructionSite","useUpdateConstructionSite","updateSiteName","NavigatableText","params","route","callBack","textDecoration","SitesDetails","handleSiteClicked","constructionProjectSitesData","createdAt","useConstructionProjectSites","handleSiteNameClick","projectName","projectId","record","SummaryInformation","dateCreated","location","currentUserIsRSM","ConstructionProjectDrawer","drawerVisible","useConstructionProject","refreshProjectData","destroyOnClose","showSitesDrawer","siteBeacons","projectBeacons","handleProjectClicked","ConstructionSiteDrawer","constructionProjectSiteData","useConstructionProjectSite","filteredSiteBeacons","filteredBeacons","filteredProjectBeacons","filteredBeaconsNoSite","showProjectDrawer","ConstructionProjectWrapper","refreshTimeStamp","setRefreshTimeStamp","refreshAll","archived","useConstructionProjects","constructionProjectIds","setData","Authorization","responses","flat","useGetAllConstructionProjectSites","projectsInBeaconArrayWithOnBeacons","projectIds","filteredProjects","dataLoading","allRoutes","path","component","navigationMenu","labelKey","roles","useParams","useBeacon","isDisabled","organiztations","createOrganization","useCreateOrganization","onCreateOrganization","org","onRow","MailOutlined","useOrganization","activeTab","setActiveTab","currentUserIsUserAdministrator","deleteOrganization","useDeleteOrganization","isDeleting","setIsDeleting","useUpdateOrganization","onSaveEditing","usersTable","beaconsTable","activeKey","k","tab","routes","user","NavigationMenu","useLocation","match","useRouteMatch","exact","pathname","routesInMenu","matchingRoutes","startsWith","matchingRoute","theme","parseInt","UserMenu","ready","german","changeLanguage","english","Divider","Option","Environment","environmentConfig","setEnvironmentConfig","onEnvironmentConfigLoaded","authConfig","mandatorySignIn","region","cognito","userPoolId","userPoolWebClientId","Amplify","configure","loadEnvironmentConfig","configBaseUrl","host","origin","REACT_APP_LOCAL_API","VerifyRoadSafetyManagerHasAnOrganization","myOrg","App","setUser","setRefreshCounter","autoRefreshInterval","setAutoRefreshInterval","autoRefreshDisabled","setAutoRefreshDisabled","enableAutoRefresh","disableAutoRefresh","handleAuthStateChange","attributes","onRefresh","againWithDelay","Header","float","userSelect","ReloadOutlined","Content","ReactDOM","StrictMode","getElementById"],"mappings":"8t3BAAA,IAAIA,EAAM,CACT,qCAAsC,CACrC,IACA,GAED,mCAAoC,CACnC,IACA,IAED,mCAAoC,CACnC,IACA,EACA,IAED,8BAA+B,CAC9B,IACA,GAED,6BAA8B,CAC7B,IACA,GAED,8BAA+B,CAC9B,IACA,IAED,uCAAwC,CACvC,IACA,EACA,IAED,+BAAgC,CAC/B,IACA,IAED,yCAA0C,CACzC,IACA,GAED,uCAAwC,CACvC,IACA,IAED,kCAAmC,CAClC,IACA,IAED,+BAAgC,CAC/B,IACA,GAED,iCAAkC,CACjC,IACA,IAED,0BAA2B,CAC1B,IACA,IAED,0BAA2B,CAC1B,IACA,IAED,2BAA4B,CAC3B,IACA,IAED,kCAAmC,CAClC,IACA,IAED,4BAA6B,CAC5B,IACA,IAED,oCAAqC,CACpC,IACA,EACA,IAED,8BAA+B,CAC9B,IACA,IAED,qCAAsC,CACrC,IACA,IAED,8BAA+B,CAC9B,IACA,IAED,oCAAqC,CACpC,IACA,IAED,6BAA8B,CAC7B,IACA,IAED,qCAAsC,CACrC,IACA,IAED,oCAAqC,CACpC,IACA,IAED,2BAA4B,CAC3B,IACA,IAED,6BAA8B,CAC7B,IACA,KAGF,SAASC,EAAoBC,GAC5B,IAAIC,EAAoBC,EAAEJ,EAAKE,GAC9B,OAAOG,QAAQC,UAAUC,MAAK,WAC7B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBP,EAAM,KAEjD,MADAM,EAAEE,KAAO,mBACHF,KAIR,IAAIG,EAAMX,EAAIE,GAAMU,EAAKD,EAAI,GAC7B,OAAON,QAAQQ,IAAIF,EAAIG,MAAM,GAAGd,IAAIG,EAAoBK,IAAID,MAAK,WAChE,OAAOJ,EAAoBS,MAG7BX,EAAoBc,KAAO,WA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C,EAAwBzsC,SAAU0sC,EAAqBxsC,QAAS2sC,EAAoB5sC,OAAQ2sC,GAAlL,WACK9C,GACD,eAACqC,GAAD,UACE,eAAC,IAAD,UACE,eAACluB,GAAD,UACE,gBAAC,IAAD,CAAQrP,MAAO,CAAEnN,OAAQ,SAAzB,UACE,gBAAC,IAAOyrC,OAAR,WACE,sBAAKp7B,UAAU,iBACf,sBAAKlD,MAAO,CAAEu+B,MAAO,QAASx3B,aAAc,GAAIy3B,WAAY,QAA5D,SACE,eAACzC,GAAD,MAEF,sBAAK/7B,MAAO,CAAEu+B,MAAO,QAASx3B,YAAa,MAAO7N,UAAW,kBAAmBslC,WAAY,QAA5F,SACE,eAACC,GAAA,EAAD,CAAgBvpC,MAAOtF,EAAE,UAAWsT,UAAU,YAAYpC,QAlB3D,WAAQs9B,SAoBT,eAACjD,GAAD,OAEF,eAAC,IAAOuD,QAAR,CAAgB1+B,MAAO,CAAEmD,QAAS,IAAlC,SACE,gBAAC,IAAD,WACG83B,GAAOC,GAAMvwC,KAAI,SAACsrC,EAAOj1B,GAAR,OAChB,eAAC,IAAD,CAEEm4B,KAAMlD,EAAMkD,KACZoC,OAAK,EACLn5B,SAAU,eAAC6zB,EAAMmD,UAAP,KAHLp4B,MAMT,eAAC,IAAD,CAAyB1E,GAAI4+B,EAAKjrC,YAAYC,QAAQ,uBAAyB,wBAA0B,WAA3F,qC,cCjFxCyuC,IAAS/jB,OACP,eAAC,IAAMgkB,WAAP,UACE,eAAC,GAAD,MAEF3oC,SAAS4oC,eAAe,SAM1B/yC,M","file":"static/js/main.aa2dc203.chunk.js","sourcesContent":["var map = {\n\t\"./amplify-amazon-button_5.entry.js\": [\n\t\t613,\n\t\t6\n\t],\n\t\"./amplify-auth-fields_9.entry.js\": [\n\t\t614,\n\t\t16\n\t],\n\t\"./amplify-authenticator.entry.js\": [\n\t\t615,\n\t\t0,\n\t\t24\n\t],\n\t\"./amplify-button_3.entry.js\": [\n\t\t616,\n\t\t7\n\t],\n\t\"./amplify-chatbot.entry.js\": [\n\t\t617,\n\t\t5\n\t],\n\t\"./amplify-checkbox.entry.js\": [\n\t\t618,\n\t\t25\n\t],\n\t\"./amplify-confirm-sign-in_7.entry.js\": [\n\t\t619,\n\t\t0,\n\t\t26\n\t],\n\t\"./amplify-container.entry.js\": [\n\t\t620,\n\t\t27\n\t],\n\t\"./amplify-federated-buttons_2.entry.js\": [\n\t\t621,\n\t\t8\n\t],\n\t\"./amplify-federated-sign-in.entry.js\": [\n\t\t622,\n\t\t20\n\t],\n\t\"./amplify-form-field_4.entry.js\": [\n\t\t623,\n\t\t28\n\t],\n\t\"./amplify-greetings.entry.js\": [\n\t\t624,\n\t\t9\n\t],\n\t\"./amplify-icon-button.entry.js\": [\n\t\t625,\n\t\t29\n\t],\n\t\"./amplify-icon.entry.js\": [\n\t\t626,\n\t\t21\n\t],\n\t\"./amplify-link.entry.js\": [\n\t\t627,\n\t\t30\n\t],\n\t\"./amplify-nav_2.entry.js\": [\n\t\t628,\n\t\t10\n\t],\n\t\"./amplify-photo-picker.entry.js\": [\n\t\t629,\n\t\t18\n\t],\n\t\"./amplify-picker.entry.js\": [\n\t\t630,\n\t\t19\n\t],\n\t\"./amplify-radio-button_2.entry.js\": [\n\t\t631,\n\t\t0,\n\t\t31\n\t],\n\t\"./amplify-s3-album.entry.js\": [\n\t\t632,\n\t\t11\n\t],\n\t\"./amplify-s3-image-picker.entry.js\": [\n\t\t633,\n\t\t12\n\t],\n\t\"./amplify-s3-image.entry.js\": [\n\t\t634,\n\t\t17\n\t],\n\t\"./amplify-s3-text-picker.entry.js\": [\n\t\t635,\n\t\t13\n\t],\n\t\"./amplify-s3-text.entry.js\": [\n\t\t636,\n\t\t14\n\t],\n\t\"./amplify-select-mfa-type.entry.js\": [\n\t\t637,\n\t\t15\n\t],\n\t\"./amplify-sign-in-button.entry.js\": [\n\t\t638,\n\t\t22\n\t],\n\t\"./amplify-toast.entry.js\": [\n\t\t639,\n\t\t32\n\t],\n\t\"./amplify-tooltip.entry.js\": [\n\t\t640,\n\t\t33\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn Promise.all(ids.slice(1).map(__webpack_require__.e)).then(function() {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = function webpackAsyncContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackAsyncContext.id = 475;\nmodule.exports = webpackAsyncContext;","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import i18n, { InitOptions } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\nimport LanguageDetector from 'i18next-browser-languagedetector';\nimport en from './en.json';\nimport de from './de.json';\n\nconst options: InitOptions = {\n resources: { en, de } as any,\n fallbackLng: 'de',\n defaultNS: 'translations',\n debug: true,\n interpolation: {\n escapeValue: false\n },\n react: {\n wait: false,\n bindI18n: 'languageChanged loaded',\n bindI18nStore: 'added removed',\n nsMode: 'default'\n }\n};\n\ni18n\n .use(LanguageDetector)\n .use(initReactI18next)\n .init(options);\n\nexport default i18n;","export * from \"./errorCodes\";\n\nexport interface PagedResponse {\n totalCount: number;\n items: T[];\n}\n\nexport type LinearRing = {\n latitude: number;\n longitude: number;\n}[];\n\nexport interface Address {\n zipCode?: string;\n city?: string;\n street?: string;\n}\n\nexport interface GeolocationResponse {\n longitude: number;\n latitude: number;\n}\n\nexport enum ForwardToPlatform {\n NONE = 0,\n UDP = 1,\n MOVEMENT_MAIL_ALERTING = 2,\n}\n\nexport enum BeaconSortingColumn {\n Id = 0,\n Serial = 1,\n OnOffSwitch = 2,\n BatteryVoltage = 3,\n ConstructionProjectName = 4,\n Iccid = 5,\n ActiveWarnings = 6,\n LastMessageReceivedAt = 7,\n ConstructionSiteName = 8,\n OrganizationName = 9,\n}\n\nexport enum BeaconSortingOrder {\n Ascending = 0,\n Descending = 1,\n}\n\nexport interface BeaconTableSorting {\n sortColumnId: BeaconSortingColumn | undefined;\n sortOrderId: BeaconSortingOrder | undefined;\n}\n\nexport enum BeaconTableColumns {\n Serial = \"Serial\",\n Status = \"OnOffSwitch\",\n Iccid = \"Iccid\",\n Hwv = \"Hwv\",\n Fwv = \"Fwv\",\n Imei = \"Imei\",\n ManufacturedOn = \"ManufacturedOn\",\n ConstructionProjectName = \"ConstructionProjectName\",\n ConstructionSiteName = \"ConstructionSiteName\",\n OrganizationName = \"OrganizationName\",\n LastMessageReceivedAt = \"LastMessageReceivedAt\",\n ConfigurationButton = \"ConfigurationButton\",\n OmmitColumn = \"OmmitColumn\",\n}\n\nexport enum ErrorSeverity {\n Warning = 0,\n Error = 1,\n}\n\nexport interface ConstructionProject {\n id: string;\n name: string;\n isArchived: boolean;\n createdAutomatically: boolean;\n address?: Address | null;\n area?: LinearRing | null;\n forwardToPlatform?: ForwardToPlatform;\n organizationName?: string;\n organizationId?: string;\n}\n\nexport type ConstructionProjectMutableProperties = Pick<\n ConstructionProject,\n \"name\" | \"area\" | \"address\" | \"forwardToPlatform\"\n> &\n Partial>;\n\nexport interface ConstructionSite {\n id: string;\n name: string;\n createdAt: Date;\n polygon?: LinearRing | null;\n}\n\nexport type ConstructionSiteMutableProperties = Pick;\n\nexport interface PostConstructionSiteRequest {\n name?: string;\n beaconIds: string[];\n}\n\nexport interface ConstructionSiteWithStatus extends ConstructionSite {\n numberOfBeacons: number;\n hasActiveError: boolean;\n}\n\nexport interface BeaconOnOffSwitch {\n isOn: boolean;\n lastReportedAt: Date;\n}\n\nexport interface BeaconActiveError {\n startedAt: Date;\n code: string;\n severity: ErrorSeverity;\n hasBeenRead: boolean;\n hasBeenReadAt?: Date;\n}\n\nexport interface ActiveSensorPosition {\n latitude: number;\n longitude: number;\n}\n\nexport interface Beacon {\n id: string;\n serial: string;\n iccid: string;\n isDisabled: boolean;\n constructionProjectId?: string;\n constructionProjectName?: string;\n constructionProjectCreatedAutomatically?: boolean;\n constructionSiteId?: string;\n constructionSiteName?: string;\n organizationName?: string;\n organizationId?: string;\n lastMessageReceivedAt?: Date;\n environment?: BeaconEnvironment;\n onOffSwitch?: BeaconOnOffSwitch;\n activeErrors?: BeaconActiveError[];\n fwv?: string;\n hwv?: string;\n manufacturedOn?: String;\n imei?: string;\n activePosition?: ActiveSensorPosition,\n boardType: number;\n}\n\nexport interface BeaconWithPosition extends Beacon {\n position: BeaconPosition;\n}\n\nexport interface FindBeaconInAreaRequest {\n area: LinearRing;\n}\n\nexport interface PutBeaconBySolutionOperatorRequest {\n isDisabled: boolean;\n}\n\nexport interface BeaconWithNordicPosition extends Beacon {\n position: {\n measuredAt: Date,\n reason?: number,\n value: {\n v: number,\n ts: Date,\n t: number,\n p: {\n pvt: {\n ts: Date,\n l: number,\n lo: number,\n e: number,\n f: number,\n h: number,\n v: number,\n s: number,\n a: number\n },\n dop: {\n g: number,\n p: number,\n h: number,\n v: number,\n t: number\n },\n rf: {\n n: number[],\n a: number[],\n c: number[]\n }\n }\n }\n }\n}\n\nexport interface Organization {\n id: string;\n name: string;\n forwardToPlatform?: ForwardToPlatform;\n}\n\nexport type OrganizationMutableProperties = Pick<\n Organization,\n \"name\" | \"forwardToPlatform\"\n>;\n\nexport interface User {\n id: string;\n email: string;\n}\n\nexport interface LatestBeaconPosition {\n beaconId: string;\n position: {\n measuredAt: Date;\n ts: Date;\n value: {\n latitude: number;\n longitude: number;\n altitude: number;\n };\n };\n}\n\nexport enum StateOfPosition {\n GPSOnly = 1,\n CorrectedButInaccurate = 2,\n CorrectedAndAccurate = 3,\n}\n\nexport enum Trigger {\n TIME = 1,\n MOVE = 2,\n BATTERY_LOW = 4,\n POWER_ON = 8,\n POWER_OFF = 16,\n}\n\nexport function isOn(trigger: Trigger) {\n return (trigger & Trigger.POWER_ON) === Trigger.POWER_ON && !isOff(trigger);\n}\n\nexport function isOff(trigger: Trigger) {\n return (trigger & Trigger.POWER_OFF) === Trigger.POWER_OFF;\n}\n\nexport function isHeartbeat(trigger: Trigger) {\n return (trigger & Trigger.TIME) === Trigger.TIME && !isOff(trigger);\n}\n\nexport function isMovement(trigger: Trigger) {\n return (trigger & Trigger.MOVE) === Trigger.MOVE && !isOff(trigger);\n}\n\nexport interface Measurement {\n measuredAt: Date;\n reason: Trigger;\n}\n\nexport interface BeaconPosition extends Measurement {\n value: {\n pos: {\n lat: number;\n lon: number;\n alt: number;\n };\n md: {\n hAcc: number;\n vAcc: number;\n tAcc: number;\n hDop: number;\n pDop: number;\n vDop: number;\n satU: number;\n pst: number;\n cprs: number;\n };\n };\n}\n\nexport interface BeaconNordicPosition {\n measuredAt?: Date,\n position: {\n ts: Date;\n lat: number;\n lon: number;\n f: number;\n sats: number;\n acc: {\n h: number;\n v: number;\n t: number;\n },\n dop: {\n g: number;\n p: number;\n h: number;\n v: number;\n t: number;\n }\n };\n}\n\nexport interface BeaconNordicEnvironment {\n ts?: Date,\n sensors: {\n accel: {\n x: number,\n y: number,\n z: number\n },\n batt: {\n v: number,\n ts: Date,\n hoursLeft: number,\n percentLeft: number\n }\n };\n}\n\n\nexport interface BeaconEnvironment extends Measurement {\n value: {\n batt: {\n v: number;\n };\n cell: {\n iccid: string;\n };\n remainingRuntimeHours: number;\n remainingRuntimeRatio: number;\n };\n}\n\nexport interface BeaconError extends Measurement {\n value: {\n code: string;\n data?: any;\n active: boolean;\n severity: ErrorSeverity;\n };\n}\n\nexport interface BeaconLifecycle extends Measurement {\n value: Trigger;\n}\n\nexport interface BeaconNordicEvent {\n ts: Date;\n event: string;\n}\n\nexport interface BeaconActiveErrorResponse {\n startedAt: Date;\n code: string;\n beaconId: string;\n severity: ErrorSeverity;\n hasBeenRead: boolean;\n hasBeenReadAt?: Date;\n}\n\nexport type CorrectionServiceType = \"NTRIP\" | \"PointPerfect\";\n\nexport interface PutBeaconConfigurationRequest {\n activityIntervalPeriod: number;\n motionDetectionThreshold: number;\n correctionServiceType: CorrectionServiceType;\n correctionServiceConfiguration: {\n endpoint: string;\n port: number;\n };\n ntripConfiguration?: {\n mountpoint: string;\n username: string;\n password: string;\n ntripRequestInterval: number;\n };\n pointPerfectConfiguration?: {\n correctionTopic: string;\n distributionTopic: string;\n clientId: string;\n };\n}\n\nexport type GetBeaconConfigurationResponse = PutBeaconConfigurationRequest;\n\nexport interface GetBeaconConfigurationStateResponse {\n desired?: GetBeaconConfigurationResponse;\n reported?: GetBeaconConfigurationResponse;\n}\n\n\nexport type MarkerColor = \"blue\" | \"green\" | \"red\" | \"orange\" | \"grey\";\n\nexport enum SensorTypes {\n NTRIP = \"NTRIP\",\n PointPerfect = \"PointPerfect\",\n}\n","import React from 'react';\nimport Auth from '@aws-amplify/auth';\nimport { CognitoAccessToken } from 'amazon-cognito-identity-js';\n\nexport type Role = 'user-administrator' | 'solution-operator' | 'road-safety-manager';\n\nexport interface TokenPaylod {\n \"cognito:groups\": Role[];\n exp: number;\n}\n\nexport interface Token {\n jwt: string;\n payload: TokenPaylod;\n expiresAt: Date;\n isExpired: boolean;\n refreshIfExpired(): Promise;\n hasRole(role: Role): boolean;\n}\n\nexport interface CurrentUser {\n email: string;\n accessToken: Token;\n}\n\nexport class AccessToken implements Token {\n\n jwt!: string;\n payload!: TokenPaylod;\n expiresAt!: Date;\n\n constructor(cognitoAccessToken: CognitoAccessToken) {\n this.intitialize(cognitoAccessToken);\n }\n\n get isExpired() {\n return new Date() >= this.expiresAt;\n }\n\n async refreshIfExpired() {\n if (!this.isExpired) {\n return;\n }\n\n const session = await Auth.currentSession();\n this.intitialize(session.getAccessToken());\n }\n\n hasRole(role: Role): boolean {\n return this.payload['cognito:groups'].indexOf(role) >= 0;\n }\n\n private intitialize(cognitoAccessToken: CognitoAccessToken) {\n const accessTokenPayload = cognitoAccessToken.decodePayload() as TokenPaylod;\n this.jwt = cognitoAccessToken.getJwtToken();\n this.payload = accessTokenPayload;\n this.expiresAt = new Date(accessTokenPayload.exp * 1000);\n\n if(!this.payload['cognito:groups']){\n this.payload['cognito:groups'] = [];\n }\n }\n}\n\nexport const AuthContext = React.createContext<{ currentUser?: CurrentUser }>({});","import { useCallback, useContext } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { ErrorSeverity } from \".\";\nimport { AuthContext } from \"../contexts/authContext\";\n\nconst errorCodes: { [code: string]: string } = {\n '0': 'COULD_NOT_START_OTA_AGENT',\n '1': 'NO_GNSS_POSITION',\n '2': 'NO_GNSS_CORRECTION_DATA',\n '3': 'NO_GNSS_CORRECTED_POSITION',\n '4': 'GNSS_CORRECTION_DATA_NOT_ACCEPTED',\n '5': 'INVALID_NTRIP_CREDENTIALS',\n '6': 'COULD_NOT_OPEN_SOCKET_TO_NTRIP_SERVER',\n '254': 'LOW_BATTERY'\n}\n\nexport function getErrorCode(code: string) {\n const name = errorCodes[code];\n return name ? name : 'GENERIC';\n}\n\nexport function useErrorTranslation() {\n const { t } = useTranslation();\n const auth = useContext(AuthContext);\n const isRoadSafetyManager = auth.currentUser?.accessToken.hasRole('road-safety-manager');\n\n return useCallback((code: string, severity: ErrorSeverity, resolved: boolean = false, acknowledged: boolean = false) => {\n\n const resolvedSuffix = resolved ? '_resolved' : '';\n const ackPrefix = acknowledged ? (t('error:acknowledged') + ': ') : '';\n\n const codeKey = code === '254'\n ? (severity === ErrorSeverity.Error ? 'DEAD_BATTERY' : 'LOW_BATTERY')\n : isRoadSafetyManager\n ? 'RSM'\n : getErrorCode(code);\n\n\n return `${ackPrefix}${t('error-codes:' + codeKey + resolvedSuffix)} (${code})`\n\n }, [t, isRoadSafetyManager]);\n}","import React from 'react';\n\nexport const DataRefreshContext = React.createContext<{ refreshCounter: number, refresh: (againWithDelay?: boolean) => void }>({ refreshCounter: 0, refresh: () => { } });\n\nexport const DataAutoRefreshContext = React.createContext<{ interval: number, disabled: boolean, enable: () => void, disable: () => void, setInterval: (i: number) => void }>({ interval: 60000, disabled: false, enable: () => { }, disable: () => { }, setInterval: () => { } });","import React from 'react';\n\nexport interface EnvironmentConfig {\n api: {\n baseUrl: string;\n baseUrlv2?: string\n };\n cognito: {\n region: string;\n userPoolId: string;\n userPoolWebClientId: string;\n };\n}\n\nexport const EnvironmentContext = React.createContext(undefined!);","import { TablePaginationConfig } from \"antd\";\nimport { PagedApiState } from \"../api/useApiState\";\n\nexport function toAntdPagination(\n page: PagedApiState,\n hideOnSinglePage?: boolean\n): TablePaginationConfig {\n return {\n hideOnSinglePage: hideOnSinglePage !== undefined ? hideOnSinglePage : true,\n current: page.currentPage + 1,\n pageSize: page.currentPageSize,\n total: page.value?.totalCount,\n showSizeChanger: true,\n pageSizeOptions: [\"10\", \"15\", \"50\", \"100\"],\n onChange: (newPage, newPageSize) => {\n newPage -= 1;\n if (newPage !== page.currentPage) {\n page.goToPage(newPage);\n }\n\n if (newPageSize && newPageSize !== page.currentPageSize) {\n page.setPageSize(newPageSize);\n }\n },\n };\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\n\ninterface Dimensions { width: number; height: number; }\nconst initialState: Dimensions = { width: 0, height: 0 };\n\nexport function useDimension(ref: React.MutableRefObject) {\n const [dimensions, setDimensions] = useState(initialState);\n const [handlers, setHandlers] = useState<((d: Dimensions) => void)[]>([]);\n const setHandler = useCallback((handler: (d: Dimensions) => void) => {\n if (handlers.length) {\n handlers[0] = handler;\n } else {\n handlers.push(handler);\n }\n }, []);\n const resizeObserverRef = useRef();\n\n useEffect(() => {\n try {\n resizeObserverRef.current = new ResizeObserver((entries = []) => {\n entries.forEach((entry) => {\n const { width, height } = entry.contentRect;\n const d = { width, height };\n setDimensions(d);\n handlers.forEach(h => h(d));\n });\n });\n if (ref.current) resizeObserverRef.current.observe(ref.current);\n }\n catch { }\n return () => {\n try {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.disconnect();\n setDimensions(initialState);\n setHandlers([]);\n }\n } catch { }\n };\n }, [ref.current]);\n return {\n ...dimensions,\n setHandler\n };\n};","import { useCallback } from \"react\";\nimport { unparse } from 'papaparse';\nimport { useTranslation } from \"react-i18next\";\n\nexport interface CsvColumn {\n title: string;\n value(p: T, culture: string, beaconId: string): any;\n}\n\nconst isSafari = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n\nexport function useDownloadCsv(beaconId: string, items: T[], columns: CsvColumn[], fileName: string){\n const { t } = useTranslation();\n const culture = t('culture');\n const download = useCallback(() => {\n var csv = unparse(\n items.map(p => columns.reduce((v: any, c) => {\n const nv = {\n ...v,\n };\n nv[c.title] = c.value(p, culture, beaconId);\n return nv;\n }, {})), { delimiter: ';' });\n\n const type = isSafari() ? 'application/csv' : 'text/csv';\n const blob = new Blob(['', csv], { type });\n const dataURI = `data:${type};charset=utf-8,${csv}`;\n\n const URL = window.URL || window.webkitURL;\n\n const uri = (typeof URL.createObjectURL === 'undefined')\n ? dataURI\n : URL.createObjectURL(blob);\n\n var link = document.createElement(\"a\");\n link.href = uri;\n link.download = fileName;\n document.body.appendChild(link);\n link.click();\n link.remove();\n }, [culture, items.length, beaconId, fileName]);\n\n return download;\n}","export function minBy(items: T[], pluck: (i: T) => number | undefined | null) {\n const values = items.map(i => ({ item: i, value: pluck(i) })).filter(i => i.value !== undefined && i.value !== null);\n if (values.length === 0) {\n return undefined;\n }\n\n let min = values.reduce((a, b) => (a.value! < b.value! ? a : b));\n\n return min;\n};\n\nexport function maxBy(items: T[], pluck: (i: T) => number | undefined | null) {\n\n const values = items.map(i => ({ item: i, value: pluck(i) })).filter(i => i.value !== undefined && i.value !== null);\n if (values.length === 0) {\n return undefined;\n }\n\n let max = values.reduce((a, b) => a.value! > b.value! ? a : b);\n\n return max;\n};\n\nexport function averageBy(items: T[], pluck: (i: T) => number | undefined | null) {\n\n const values = items.map(i => ({ item: i, value: pluck(i) })).filter(i => i.value !== undefined && i.value !== null);\n if (values.length === 0) {\n return undefined;\n }\n\n let average = values[0].value || 0;\n\n for (let i = 1; i < items.length; i++) {\n const v = values[i]\n if (v.value) {\n average += v.value;\n }\n }\n\n return average / items.length;\n};\n\n\n\nexport function count(items: T[], filter: (i: T) => boolean) {\n let c = 0;\n items.forEach(i => {\n if (filter(i)) {\n c++;\n }\n });\n return c;\n};","import { useCallback } from \"react\";\n\nexport function get<\n T,\n P1 extends keyof NonNullable>(value: T, prop1: P1)\n : NonNullable[P1]\nexport function get<\n T,\n P1 extends keyof NonNullable,\n P2 extends keyof NonNullable[P1]>>(value: T, prop1: P1, prop2: P2)\n : NonNullable[P1]>[P2];\nexport function get(value: T, ...properties: string[]) {\n let v = value as any;\n for (let i = 0; i < properties.length; i++) {\n v = v[properties[i]];\n if (v === null || v === undefined) {\n return v;\n }\n }\n return v;\n}\n\nexport function useOnChangeListener<\n T,\n P1 extends keyof NonNullable>(currentValue: T, listener: (newValue: T) => void, prop1: P1)\n : (value: NonNullable[P1]) => void | undefined;\nexport function useOnChangeListener<\n T,\n P1 extends keyof NonNullable,\n P2 extends keyof NonNullable[P1]>>(currentValue: T, listener: (newValue: T) => void, prop1: P1, prop2: P2)\n : (value: NonNullable[P1]>[P2]) => void | undefined;\nexport function useOnChangeListener(currentValue: T, listener: (newValue: T) => void, ...properties: string[]) {\n return useCallback((value: any) => {\n const newValue = JSON.parse(JSON.stringify(currentValue));\n let changedObject = newValue as any;\n for (let i = 0; i < properties.length - 1; i++) {\n changedObject = changedObject[properties[i]];\n }\n changedObject[properties[properties.length - 1]] = value;\n listener(newValue);\n }, [currentValue, listener, ...properties]);\n}\n\nexport function useOnChangeListenerDynamic>(currentValue: T, listener: (newValue: T) => void, properties: keyof NonNullable | [keyof NonNullable, keyof NonNullable[P1]>]) {\n\n const props = Array.isArray(properties) ? properties : [properties];\n\n return useCallback((value: any) => {\n const newValue = JSON.parse(JSON.stringify(currentValue));\n let changedObject = newValue as any;\n for (let i = 0; i < props.length - 1; i++) {\n changedObject = changedObject[props[i]];\n }\n changedObject[props[props.length - 1]] = value;\n listener(newValue);\n }, [currentValue, listener, ...props]);\n}","import { useCallback } from \"react\";\nimport { ApiState } from \"../api/useApiState\";\n\nexport function useRefreshAll(...apiStates: ApiState[]){\n const refreshes = apiStates.map(a => a.refresh);\n return useCallback(async () => {\n await Promise.all(refreshes.map(r => r()));\n }, refreshes);\n}","import { useCallback, useState } from \"react\";\n\nexport function jsonSerialize(item: T){\n if(item === undefined || item === null){\n return \"\";\n }\n return JSON.stringify(item);\n}\n\nexport function jsonDeserialize(json: string){\n if(json === undefined || json === null || json === \"\"){\n return undefined;\n }\n return JSON.parse(json) as T;\n}\n\nexport function useSetting(name: string, defaultValue: T, serialize?: (item: T) => string, deserialize?: (json: string) => T | undefined): [T, (v: T, persist?: boolean) => void] {\n const key = 'setting:' + name;\n\n const onSerialize = useCallback((item: T)=>{\n if(serialize){\n return serialize(item);\n }\n\n return (item as any as number | string).toString();\n }, []);\n\n const onDeserialize = useCallback((json: string)=>{\n if(deserialize){\n const deserialized = deserialize(json);\n if(deserialized === undefined){\n return defaultValue;\n }\n return deserialized;\n }\n\n return (typeof (defaultValue) === 'number' ? parseFloat(json) : json) as any as T;\n }, [defaultValue]);\n\n const [value, setValue] = useState(() => {\n const storedValue = tryRead(key);\n if (storedValue === undefined || storedValue === null) {\n tryStore(key, defaultValue, onSerialize);\n return defaultValue;\n } else {\n return onDeserialize(storedValue);\n }\n });\n\n const setAndStoreValue = useCallback((v: T, persist?: boolean) => {\n setValue(v);\n if (persist !== false) {\n tryStore(key, v, onSerialize);\n }\n }, [setValue, key, onSerialize]);\n\n return [value, setAndStoreValue];\n}\n\nfunction tryRead(key: string) {\n try {\n return window.localStorage.getItem(key);\n } catch {\n return undefined;\n }\n}\n\nfunction tryStore(key: string, v: T, serialize: (item: T) => string) {\n try {\n window.localStorage.setItem(key, serialize(v));\n } catch { }\n}\n","import { useCallback, useEffect, useState } from \"react\";\n\nconst emptyArray: any[] = [];\n\nexport function useTransformedState(source: TSource, transform: (s: TSource) => TTarget, dependency?: any) {\n const [target, setTarget] = useState(transform(source));\n const dependencies = Array.isArray(source)\n ? [source.length ? source : emptyArray, source.length, setTarget]\n : [source, setTarget];\n if (dependency) {\n if (Array.isArray(dependency)) {\n dependency.forEach(d => dependencies.push(d));\n } else {\n dependencies.push(dependency);\n }\n }\n useEffect(() => {\n setTarget(transform(source));\n }, dependencies);\n\n return target;\n}","import { useCallback, useContext, useEffect, useState } from \"react\";\nimport { AuthContext, Token } from \"../contexts/authContext\";\nimport { DataRefreshContext } from \"../contexts/dataRefreshContext\";\nimport { EnvironmentConfig, EnvironmentContext } from \"../contexts/environmentContext\";\nimport { useSetting } from \"../util\";\nimport { PagedResponse } from \"./models\";\n\ntype ApiGetter = (token: Token, environment: EnvironmentConfig, query?: string) => Promise;\n\nconst defaultDependency = {};\nconst awaitApiCall = async function (\n setState: React.Dispatch>,\n setLoading: React.Dispatch>,\n setLastLoadedAt: React.Dispatch>,\n value: Promise\n) {\n const result = await value;\n setState(result);\n setLoading(false);\n setLastLoadedAt(new Date());\n};\n\nexport interface ApiState {\n value: T,\n loading: boolean;\n failed: boolean;\n lastLoadedAt?: Date;\n refresh(): Promise;\n}\n\nexport interface PagedApiState extends ApiState | undefined> {\n currentPage: number;\n currentPageSize: number;\n goToPage(page: number): void;\n setPageSize(pageSize: number): void;\n}\n\nexport function useApiState(get: ApiGetter, defaultValue: T, dependency?: any): ApiState {\n const [value, set] = useState(defaultValue);\n const [loading, setLoading] = useState(false);\n const [failed, setFailed] = useState(false);\n\n const [lastLoadedAt, setLastLoadedAt] = useState();\n const authContext = useContext(AuthContext);\n const environmentContext = useContext(EnvironmentContext);\n const dataRefreshContext = useContext(DataRefreshContext);\n\n if (!authContext.currentUser) {\n throw new Error('useApiState should not be called before the user is authenticated');\n }\n\n const dependencyList = dependency\n ? (Array.isArray(dependency) ? dependency : [dependency])\n : [defaultDependency];\n\n dependencyList.push(dataRefreshContext.refreshCounter);\n\n const refresh = useCallback(async () => {\n setLoading(true);\n setFailed(false);\n try {\n const result = await get(authContext.currentUser!.accessToken, environmentContext);\n set(result);\n setLastLoadedAt(new Date());\n }\n catch {\n setFailed(true);\n }\n finally {\n setLoading(false);\n }\n }, [get, set, setLoading, authContext, environmentContext]);\n\n useEffect(() => {\n refresh();\n }, [...dependencyList, refresh]);\n\n return { value, loading, failed, lastLoadedAt, refresh };\n};\n\nexport function usePagedApiState(\n get: ApiGetter>, \n apiVersion: number = 1,\n dependency?: any, \n pageSize?: number): PagedApiState {\n \n const [currentPage, setCurrentPage] = useState(0);\n const [currentPageSize, setCurrentPageSize] = useSetting('default-page-size', 50);\n const effectivePageSize = pageSize === undefined ? currentPageSize : pageSize;\n\n const dependencyList = dependency\n ? (Array.isArray(dependency) ? dependency : [dependency])\n : [defaultDependency];\n\n dependencyList.push(currentPage);\n dependencyList.push(currentPageSize);\n let offsetText = 'skip'\n let limitText = 'take'\n if (apiVersion === 2) { \n offsetText = 'offset'\n limitText = 'limit'\n }\n\n const getter = useCallback((t, e) => get(t, e, `${limitText}=${effectivePageSize}&${offsetText}=${effectivePageSize * currentPage}`),\n [effectivePageSize, currentPage, get]);\n const state = useApiState(getter, undefined, dependencyList);\n\n return {\n currentPage,\n currentPageSize: effectivePageSize,\n goToPage: p => setCurrentPage(p),\n setPageSize: (pageSize) => setCurrentPageSize(pageSize),\n ...state\n };\n}\n\nexport function useGetAuthorized(url: string, \n postProcessor?: (t: T, apiV: number) => T, \n manipulateUrl?: (url: string) => string,\n apiVersion: number = 1): ApiGetter {\n return useCallback(async (token, environment, query) => {\n\n await token.refreshIfExpired();\n\n let effectiveUrl = url;\n if (query) {\n effectiveUrl = effectiveUrl + (effectiveUrl.indexOf('?') >= 0 ? '&' : '?') + query;\n }\n let baseUrl = apiVersion === 2 ? environment.api.baseUrlv2 : environment.api.baseUrl;\n\n effectiveUrl = baseUrl + 'api/' + effectiveUrl;\n\n if (manipulateUrl) {\n effectiveUrl = manipulateUrl(effectiveUrl);\n }\n\n let response = await fetch(effectiveUrl, {\n method: 'get',\n headers: new Headers({\n 'Authorization': 'Bearer ' + token.jwt,\n })\n });\n let json = await response.json() as T;\n if (postProcessor) {\n json = postProcessor(json, apiVersion);\n }\n \n return json;\n }, manipulateUrl ? [url, manipulateUrl] : [url]);\n}\n\nexport interface ApiCall {\n (input: TInput): Promise;\n}\n\nexport function useAuthorizedFetch(jsonBody: boolean = true, apiVersion: number = 1) {\n const authContext = useContext(AuthContext);\n const environmentContext = useContext(EnvironmentContext);\n return useCallback(async (url: string, init?: RequestInit) => {\n\n const token = authContext.currentUser!.accessToken;\n await token.refreshIfExpired();\n\n const headers = new Headers({\n ...(init?.headers || {}),\n 'Authorization': 'Bearer ' + token.jwt,\n ...(jsonBody ? { 'Content-Type': 'application/json; charset=utf-8' } : {})\n });\n const baseUrl = apiVersion === 2 ? environmentContext.api.baseUrlv2 : environmentContext.api.baseUrl;\n return fetch(baseUrl + 'api/' + url, {\n ...(init || {}),\n headers\n });\n }, [authContext, environmentContext, jsonBody, apiVersion]);\n}","import { useCallback, useContext } from \"react\";\nimport { DataAutoRefreshContext } from \"../contexts/dataRefreshContext\";\nimport { useIncrementingCounter } from \"../util\";\n\nexport type FromToFilter = number | { from: Date, to: Date };\n\nexport function useFromToFilter(filter: FromToFilter, apiVersion: number = 1) {\n\n return useCallback((url: string) => {\n let fromText = 'from';\n let toText = 'to';\n if (apiVersion === 2) {\n fromText = 'start';\n toText = 'end';\n }\n if (typeof (filter) === 'number') {\n const to = new Date();\n const from = new Date(to.getTime() - filter * 1000);\n return url + `&${fromText}=` + from.toISOString() + `&${toText}=` + to.toISOString();\n }\n return url + `&${fromText}=` + filter.from.toISOString() + `&${toText}=` + filter.to.toISOString();\n }, [filter, apiVersion]);\n}\n\nexport function useRefreshCounter() {\n const { interval, disabled } = useContext(DataAutoRefreshContext);\n return useIncrementingCounter(interval, disabled);\n}","import { useEffect, useState } from \"react\";\n\nexport function useIncrementingCounter(intervalMs: number, disabled?: boolean) {\n const [counter, setCounter] = useState(0);\n useEffect(() => {\n const interval = setInterval(() => {\n if (!disabled) {\n setCounter(c => c + 1);\n }\n }, intervalMs);\n return () => {\n clearInterval(interval);\n };\n }, [intervalMs, disabled]);\n return counter;\n}\n","import { Icon, LatLngBounds } from \"leaflet\";\nimport \"leaflet/dist/leaflet.css\";\nimport React, { useEffect, useRef } from \"react\";\nimport {\n MapContainer,\n Marker,\n Polyline,\n Polygon,\n Popup,\n TileLayer,\n useMapEvent,\n} from \"react-leaflet\";\nimport { LinearRing, MarkerColor } from \"../../api\";\nimport { useDimension } from \"../../util\";\n\nconst createMarkerIcon = (color: string) =>\n new Icon({\n iconUrl: `${process.env.PUBLIC_URL}/images/marker-icon-2x-${color}.png`,\n shadowUrl: `${process.env.PUBLIC_URL}/images/marker-shadow.png`,\n iconSize: [25, 41],\n iconAnchor: [12, 41],\n popupAnchor: [1, -34],\n shadowSize: [41, 41],\n });\n\nconst icons: Record = {\n blue: createMarkerIcon(\"blue\"),\n green: createMarkerIcon(\"green\"),\n grey: createMarkerIcon(\"grey\"),\n red: createMarkerIcon(\"red\"),\n orange: createMarkerIcon(\"orange\"),\n};\n\nexport interface Position {\n lat: number;\n lon: number;\n}\n\nexport interface MarkerData extends Position {\n title: string;\n id?: string;\n color?: MarkerColor;\n hasError?: boolean;\n errorText?: React.ReactNode;\n errorSeverity?: \"error\" | \"warning\";\n onClick?: () => void;\n}\n\nexport interface PolyLineData {\n line: Position[];\n id?: string;\n title?: string;\n color?: React.CSSProperties[\"color\"];\n width?: number;\n onClick?: () => void;\n}\n\nexport interface PolygonData {\n title?: string;\n ring: LinearRing;\n color?: React.CSSProperties[\"color\"];\n id?: string;\n onClick?: () => void;\n}\n\ninterface MapProps {\n markers: MarkerData[];\n polylines?: PolyLineData[];\n polygons?: PolygonData[];\n testId?: string;\n onMapClicked?: (e: L.LeafletMouseEvent) => void;\n}\n\ninterface ClickOutsideHandlerProps {\n onMapClick: (e: L.LeafletMouseEvent) => void;\n}\n\n\n// This component is used to handle clicks on map outside of markers\nconst ClickOutsideHandler = ({ onMapClick }: ClickOutsideHandlerProps) => {\n useMapEvent(\"click\", (e) => {\n if (\n !(e.originalEvent.target as HTMLElement).closest(\".leaflet-interactive\")\n ) {\n onMapClick(e);\n }\n });\n\n return null;\n};\n\nexport function Map({\n markers,\n polylines,\n polygons,\n testId,\n onMapClicked,\n}: MapProps) {\n const mapRef = useRef(null);\n const prevMarkersRef = useRef(markers);\n const hasSetInitialView = useRef(false);\n\n const containerRef = useRef(null!);\n const dimension = useDimension(containerRef);\n const setDimensionHandler = dimension.setHandler;\n\n useEffect(() => {\n const map = mapRef.current;\n\n // If there is only one marker, set the view to that marker\n if (markers?.length === 1 && map && !hasSetInitialView.current) {\n const marker = markers[0];\n map.setView([marker.lat, marker.lon], 19);\n hasSetInitialView.current = true;\n }\n // If multiple markers, fit bounds and fit bounds when markers are updated\n else if (\n JSON.stringify(prevMarkersRef.current) !== JSON.stringify(markers)\n ) {\n prevMarkersRef.current = markers;\n\n const bounds = new LatLngBounds([]);\n\n markers.forEach((marker) => {\n bounds.extend([marker.lat, marker.lon]);\n });\n\n polygons?.forEach((polygon) => {\n polygon.ring.forEach((point) => {\n bounds.extend([point.latitude, point.longitude]);\n });\n });\n\n polylines?.forEach((polyline) => {\n polyline.line.forEach((point) => {\n bounds.extend([point.lat, point.lon]);\n });\n });\n\n if (map && bounds.isValid()) {\n map.fitBounds(bounds);\n }\n }\n // If markers are the same, do nothing\n else {\n return;\n }\n }, [markers]);\n\n return (\n \n {\n mapRef.current = mapInstance;\n setDimensionHandler(() => {\n try {\n mapInstance.invalidateSize();\n } catch {}\n });\n }}\n >\n \n {onMapClicked && }\n {markers.map((marker) => (\n \n {marker.title}\n \n ))}\n {polygons &&\n polygons.map((polygon, index) => (\n [p.latitude, p.longitude])}\n pathOptions={{ color: polygon.color }}\n eventHandlers={{ click: polygon.onClick }}\n />\n ))}\n {polylines &&\n polylines.map((polyline, index) => (\n [p.lat, p.lon])}\n eventHandlers={{ click: polyline.onClick }}\n >\n ))}\n \n \n );\n}\n","import {\n Beacon,\n ConstructionProject,\n ConstructionSite,\n BeaconWithPosition,\n MarkerColor,\n} from \"../../api\";\nimport { MarkerData, PolyLineData, PolygonData } from \"./Map\";\n\nexport const getPolygonsSites = (\n sites: ConstructionSite[],\n color: string,\n onClickEvent: (node: T) => void\n): PolygonData[] => {\n try {\n return sites\n .filter((coord) => coord.polygon !== null)\n .map((coord) => ({\n color: color,\n ring: coord.polygon!,\n title: coord.name,\n id: coord.id,\n onClick: () => onClickEvent({ selectedId: coord.id } as unknown as T),\n }));\n } catch (error) {\n console.log(\"Error in getPolygonsSites\", error);\n return [];\n }\n};\n\nexport const getPolygonsProjects = (\n projects: ConstructionProject[],\n color: string,\n onClickEvent: (node: T) => void\n): PolygonData[] => {\n try {\n return projects\n .filter((coord) => coord.area !== null)\n .map((coord) => ({\n color: color,\n ring: coord.area!,\n title: coord.name,\n id: coord.id,\n onClick: () => onClickEvent({ selectedId: coord.id } as unknown as T),\n }));\n } catch (error) {\n console.log(\"Error in getPolygonsProjects\", error);\n return [];\n }\n};\n\n// No API as of Feb 25 to get this data, so handling it in client side\nexport const getPolylinesSites = (\n beacons: Beacon[] | undefined,\n sites: ConstructionSite[] | undefined,\n color: string,\n width: number,\n onClickEvent: (node: T) => void\n): PolyLineData[] => {\n if (!sites || !beacons) return [];\n\n try {\n return sites\n .map((site) => {\n const beaconsForSite =\n beacons.filter((beacon) => beacon.constructionSiteId === site.id) ??\n [];\n const positions = beaconsForSite\n .filter(\n (beacon): beacon is BeaconWithPosition =>\n (beacon as BeaconWithPosition).position !== null\n )\n .map((beacon) => beacon.position.value.pos);\n const count = positions.length;\n return { siteId: site.id, siteName: site.name, positions, count };\n })\n .filter((siteBeaconCount) => siteBeaconCount.count === 2)\n .map((site) => ({\n line: site.positions,\n title: site.siteName,\n id: site.siteId,\n color: color,\n width: width,\n onClick: () =>\n onClickEvent({ selectedId: site.siteId } as unknown as T),\n }));\n } catch (error) {\n console.log(\"Error in getPolylinesSites\", error);\n return [];\n }\n};\n\nexport const transformBeaconsToMarkers = (\n beacons: Beacon[] | undefined,\n onClickEvent: (node: T) => void\n): MarkerData[] => {\n if (beacons === undefined) return [];\n\n try {\n const filteredBeacons = beacons.filter(\n (beacon: Beacon) => beacon.onOffSwitch?.isOn === true\n );\n\n const markers: MarkerData[] = (filteredBeacons as BeaconWithPosition[])\n .map((beacon) => {\n if (beacon.position === null) return undefined;\n return {\n title: beacon.serial,\n lat: beacon.position.value.pos.lat,\n lon: beacon.position.value.pos.lon,\n color: getMarkerColor(beacon),\n onClick: () =>\n onClickEvent({ selectedId: beacon.serial } as unknown as T),\n };\n })\n .filter((marker) => marker !== undefined) as MarkerData[];\n\n return markers;\n } catch (error) {\n console.log(\"Error in transformBeaconsToMarkers\", error);\n return [];\n }\n};\n\nexport const getMarkerColor = (beacon: BeaconWithPosition): MarkerColor => {\n if (beacon.onOffSwitch?.isOn === false) {\n return \"grey\";\n }\n\n if (beacon.activeErrors?.length) {\n return \"red\";\n }\n\n return beacon.position?.value.md.cprs === 2 ? \"green\" : \"orange\";\n};\n","import React, { useCallback, useState } from \"react\";\nimport { FullscreenOutlined, FullscreenExitOutlined } from \"@ant-design/icons\";\n\ninterface MaximizableProps {\n children: React.ReactNode;\n buttonPosition?: \"top-right\" | \"bottom-right\";\n hide?: boolean;\n label?: React.ReactNode;\n onToggled?(): void;\n}\n\nexport function Maximizable(props: MaximizableProps) {\n const [isMaximized, setIsMaximized] = useState(false);\n const { onToggled } = props;\n\n const toggle = useCallback(() => {\n setIsMaximized((m) => !m);\n if (onToggled) {\n onToggled();\n }\n }, [setIsMaximized, onToggled]);\n\n if (props.hide) {\n return <>{props.children};\n }\n\n const buttonPosition = props.buttonPosition || \"top-right\";\n const buttonPositioning: React.CSSProperties =\n buttonPosition === \"bottom-right\"\n ? { right: \"10px\", bottom: \"10px\" }\n : { right: \"10px\", top: \"10px\" };\n\n const minimizedStyle: React.CSSProperties = {\n position: \"relative\",\n height: \"100%\",\n };\n const maximizedStyle: React.CSSProperties = {\n position: \"fixed\",\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: \"rgb(240, 242, 245)\",\n zIndex: 100000000,\n };\n\n return (\n
\n {props.children}\n \n {props.label}\n \n {isMaximized ? : }\n
\n \n \n );\n}\n","import { Alert, Spin } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n BeaconPosition,\n BeaconWithPosition,\n} from \"../../../api\";\nimport { Map, PolyLineData } from \"../../map/Map\";\nimport { getMarkerColor } from \"../../map/mapUtils\";\nimport { Maximizable } from \"../../Maximizable\";\n\ninterface BeaconDetailMapProps {\n loading: boolean;\n lastLoadedAt?: Date;\n beacon: Beacon;\n position?: BeaconPosition;\n polyLines?: PolyLineData[];\n}\n\nexport function BeaconMapDetails({\n loading,\n beacon,\n position,\n polyLines,\n}: BeaconDetailMapProps) {\n const { t } = useTranslation();\n\n if (loading && !position) {\n return ;\n }\n\n if (!position) {\n return (\n <>\n {loading && }\n \n \n );\n }\n\n return (\n \n {},\n },\n ]}\n polylines={polyLines}\n />\n \n );\n}\n","import { Divider } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { BeaconActiveError, ErrorSeverity, getErrorCode, useErrorTranslation } from \"../api\";\n\ninterface BeaconActiveErrorsTooltipProps {\n errors: BeaconActiveError[];\n}\n\nexport function ActiveErrorsLabel(props: { errors: BeaconActiveError[] }) {\n const { t } = useTranslation();\n const errors = props.errors.filter(e => e.severity !== ErrorSeverity.Warning);\n const warnings = props.errors.filter(e => e.severity === ErrorSeverity.Warning);\n\n const errorLabel = errors.length ? t('beacon:active-errors-tooltip', { count: errors.length }) : undefined;\n const warningLabel = warnings.length ? t('beacon:active-warnings-tooltip', { count: warnings.length }) : undefined;\n\n const label = `${errorLabel ?? ''}${(errorLabel && warningLabel ? ', ' : '')}${warningLabel ?? ''}`;\n return <>{label};\n}\n\nexport function BeaconActiveErrorsTooltip(props: BeaconActiveErrorsTooltipProps) {\n\n const errorTranslation = useErrorTranslation();\n\n const errors = props.errors.filter(e => e.severity !== ErrorSeverity.Warning);\n const warnings = props.errors.filter(e => e.severity === ErrorSeverity.Warning);\n\n return
\n \n {!!errors.length && <>\n \n {errors.map((e, i) =>
{errorTranslation(e.code, e.severity)}
)}}\n {!!warnings.length && <>\n \n {warnings.map((e, i) =>
{errorTranslation(e.code, e.severity)}
)}}\n
;\n}","import React from \"react\";\nimport { ExclamationCircleOutlined, WarningOutlined } from \"@ant-design/icons\";\nimport { BeaconActiveError, ErrorSeverity } from \"../api\";\nimport { Tooltip } from \"antd\";\nimport { BeaconActiveErrorsTooltip } from \"./BeaconActiveErrorsTooltip\";\n\ninterface BeaconErrorStatusProps {\n errors?: BeaconActiveError[];\n severity?: ErrorSeverity;\n style?: React.CSSProperties;\n showTooltip?: boolean;\n}\n\nexport function BeaconErrorStatus(props: BeaconErrorStatusProps) {\n\n const isError = props.severity === ErrorSeverity.Error ||\n (props.errors && props.errors.some(e => e.severity === ErrorSeverity.Error));\n\n const showTooltip = props.showTooltip && props.errors?.length;\n\n const style = {\n ...(props.style ?? {}),\n color: isError ? 'red' : 'orange'\n };\n\n const icon = isError\n ? \n : ;\n\n return showTooltip\n ? } overlayStyle={{ width: 'auto', maxWidth: 800 }}>\n {icon}\n \n : icon;\n}","export function ActionsIcon() {\n return ;\n}","import { CheckOutlined, DeleteOutlined } from \"@ant-design/icons\";\nimport { Badge, Button, Card, Divider, Dropdown, Popover } from \"antd\";\nimport React, { useCallback, useContext } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n BeaconActiveError,\n BeaconSortingColumn,\n BeaconSortingOrder,\n BeaconTableSorting,\n ErrorSeverity,\n useBeacons,\n useDeleteError,\n useErrorTranslation,\n useMarkErrorAsRead,\n} from \"../api\";\nimport { AuthContext } from \"../contexts/authContext\";\nimport { DataRefreshContext } from \"../contexts/dataRefreshContext\";\nimport { count } from \"../util\";\nimport { ActionsIcon } from \"./ActionsIcon\";\nimport { BeaconDrawerContext } from \"./beacon-drawer/BeaconDrawerContext\";\nimport { BeaconErrorStatus } from \"./BeaconErrorStatus\";\n\ninterface BeaconsErrorsProps {\n severity: ErrorSeverity;\n assignedToOrganization?: boolean;\n filter?: string;\n style?: React.CSSProperties;\n}\n\nfunction noop(e: React.MouseEvent) {\n e.stopPropagation();\n};\n\nexport function BeaconErrorActionButton(props: { beaconId?: string; error?: BeaconActiveError, severity?: ErrorSeverity }) {\n const { t } = useTranslation();\n const markErrorAsRead = useMarkErrorAsRead();\n const deleteError = useDeleteError();\n const allSuffix = props.error ? '' : '-all';\n const dataRefresh = useContext(DataRefreshContext);\n const isRoadSafetyManager = useContext(AuthContext).currentUser?.accessToken?.hasRole('road-safety-manager');\n\n const onRead = useCallback(async () => {\n if (props.error && props.beaconId) {\n await markErrorAsRead({ beaconId: props.beaconId, code: props.error.code });\n } else if (props.severity !== undefined) {\n await markErrorAsRead(props.severity);\n }\n dataRefresh.refresh(true);\n }, [props.error, markErrorAsRead, dataRefresh]);\n\n const onDelete = useCallback(async () => {\n if (props.error && props.beaconId) {\n await deleteError({ beaconId: props.beaconId, code: props.error.code });\n } else if (props.severity !== undefined) {\n await deleteError(props.severity);\n }\n dataRefresh.refresh(true);\n }, [props.error, deleteError, dataRefresh]);\n\n if (!isRoadSafetyManager) {\n return <>;\n }\n\n return \n \n \n }>\n \n \n}\n\nfunction BeaconErrorContent(props: { beacon: Beacon; error: BeaconActiveError, onClick: () => void }) {\n const errorTranslation = useErrorTranslation();\n const fontWeight: React.CSSProperties['fontWeight'] = props.error.hasBeenRead ? 'normal' : 'bold';\n\n return
\n
\n
{props.beacon.serial || props.beacon.id}
\n
{errorTranslation(props.error.code, props.error.severity)}
\n
\n \n
;\n}\n\nfunction BeaconDetailedErrorContent(props: { beacon: Beacon; error: BeaconActiveError }) {\n const { t } = useTranslation();\n const errorTranslation = useErrorTranslation();\n const fontWeight: React.CSSProperties['fontWeight'] = props.error.hasBeenRead ? 'normal' : 'bold';\n\n return
\n \n
\n
{errorTranslation(props.error.code, props.error.severity)}
\n
{t('error:active-since', { since: props.error.startedAt.toLocaleString() })}
\n
\n \n
;\n}\n\nexport function BeaconError(props: { beacon: Beacon; error: BeaconActiveError }) {\n const drawer = useContext(BeaconDrawerContext);\n const dataRefresh = useContext(DataRefreshContext);\n const isRoadSafetyManager = useContext(AuthContext).currentUser?.accessToken?.hasRole('road-safety-manager');\n const markErrorAsRead = useMarkErrorAsRead();\n\n const open = useCallback(async () => {\n if (!props.error.hasBeenRead) {\n if (isRoadSafetyManager) {\n await markErrorAsRead({ beaconId: props.beacon.id, code: props.error.code });\n dataRefresh.refresh(true);\n }\n }\n drawer.show(props.beacon);\n }, [drawer, props.beacon, props.error, dataRefresh, markErrorAsRead, isRoadSafetyManager]);\n\n\n return <>\n \n \n ;\n}\n\nexport function BeaconErrors(props: { beacon: Beacon }) {\n const { beacon } = props;\n\n if (!beacon.activeErrors?.length) {\n return <>;\n }\n\n return
\n {beacon.activeErrors.map(e =>
\n \n
)}\n
\n}\n\nexport function BeaconsErrors(props: BeaconsErrorsProps) {\n const { t } = useTranslation();\n\n const errorBeaconSorting: BeaconTableSorting = {\n sortColumnId: BeaconSortingColumn.LastMessageReceivedAt,\n sortOrderId: BeaconSortingOrder.Descending,\n }; \n\n const beaconsWithError = useBeacons(\n props.assignedToOrganization,\n props.filter,\n props.severity,\n errorBeaconSorting,\n 1000\n );\n\n if (!beaconsWithError?.value?.totalCount) {\n return <>;\n }\n\n const errors = beaconsWithError.value.items.flatMap(b => (b.activeErrors || []).map(e => ({ e, b })));\n const unreadErrors = count(errors, e => !e.e.hasBeenRead);\n\n return \n
\n {t('error:alerts')}\n \n
\n
\n {errors.map(e => )}\n
\n }>\n \n \n \n \n
\n \n
\n
\n \n}","import { DownOutlined } from \"@ant-design/icons\";\nimport { Dropdown, Menu } from \"antd\";\nimport { useCallback, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { FromToFilter } from \"../api\";\nimport { jsonDeserialize, jsonSerialize, useSetting } from \"../util\";\nimport { TimeRangePicker } from \"./TimeRangePicker\";\n\n\ninterface PredefinedFromToFilterOption {\n title: string;\n filter: FromToFilter & number;\n}\n\ninterface CustomFromToFilterOption {\n title: string;\n filter: FromToFilter & { from: Date, to: Date };\n}\n\nexport type FromToFilterOption = PredefinedFromToFilterOption | CustomFromToFilterOption;\n\n\nconst DAY = 60 * 60 * 24;\nexport const PredefinedFilterOptions: PredefinedFromToFilterOption[] = [\n { title: 'beacon:last-messages', filter: 3 * DAY },\n { title: 'beacon:last-day', filter: DAY },\n { title: 'beacon:last-week', filter: 7 * DAY }\n];\n\nexport function useTimeRangeSelection(beaconId: string) {\n const { t } = useTranslation();\n const [customDateFilter, setCustomDateFilter] = useSetting<{ from: number, to: number } | undefined>('beacon:custom-from-to-filter:' + beaconId, undefined, jsonSerialize, jsonDeserialize);\n\n const [fromToFilterOptions, setFromToFilterOptions] = useState(() => {\n const options: FromToFilterOption[] = PredefinedFilterOptions.map(f => ({ title: t(f.title), filter: f.filter }));\n\n if (customDateFilter) {\n const from = new Date(customDateFilter.from);\n const to = new Date(customDateFilter.to);\n const custom: FromToFilterOption = { title: t('beacon:last-custom', { from: from.toLocaleString(), to: to.toLocaleDateString() === from.toLocaleDateString() ? to.toLocaleTimeString() : to.toLocaleString() }), filter: { from, to } };\n options.push(custom);\n }\n return options;\n });\n\n const [selectedFromToFilterOptionIndex, setSelectedFromToFilterOptionIndex] = useSetting('beacon:from-to-filter', 2);\n\n const onSelectCustomTimeFrame = useCallback((from: Date, to: Date) => {\n const custom: FromToFilterOption = { title: t('beacon:last-custom', { from: from.toLocaleString(), to: to.toLocaleDateString() === from.toLocaleDateString() ? to.toLocaleTimeString() : to.toLocaleString() }), filter: { from, to } };\n setFromToFilterOptions(currentOptions => {\n const newOptions = currentOptions.filter(o => typeof (o.filter) === 'number');\n newOptions.push(custom);\n return newOptions;\n });\n setSelectedFromToFilterOptionIndex(PredefinedFilterOptions.length, false);\n setCustomDateFilter({ from: from.getTime(), to: to.getTime() });\n }, [setFromToFilterOptions, setCustomDateFilter, setSelectedFromToFilterOptionIndex]);\n\n const onSelectFilterOption = useCallback((index: number) => {\n if (typeof (fromToFilterOptions[index].filter) === 'number') {\n setSelectedFromToFilterOptionIndex(index, true);\n } else {\n setSelectedFromToFilterOptionIndex(index, false);\n }\n }, [setSelectedFromToFilterOptionIndex, fromToFilterOptions]);\n\n const selectedFromToFilter = fromToFilterOptions[selectedFromToFilterOptionIndex].filter;\n\n return { selectedFromToFilter, fromToFilterOptions, selectedFromToFilterOptionIndex, onSelectFilterOption, onSelectCustomTimeFrame };\n}\n\ninterface TimeRangeSelectionProps {\n fromToFilterOptions: FromToFilterOption[];\n selectedFromToFilterOptionIndex: number;\n onSelectFilterOption(index: number): void;\n onSelectCustomTimeFrame(from: Date, to: Date): void;\n}\n\nexport function TimeRangeSelection(props: TimeRangeSelectionProps) {\n\n const { fromToFilterOptions, selectedFromToFilterOptionIndex, onSelectFilterOption, onSelectCustomTimeFrame } = props;\n\n return \n {fromToFilterOptions.map((o, i) => onSelectFilterOption(i)}>\n {typeof (o.filter) === 'number' ? o.title : })}\n {fromToFilterOptions.every(o => typeof (o.filter) === 'number') && }\n }>\n e.preventDefault()}>\n {fromToFilterOptions[selectedFromToFilterOptionIndex].title} \n \n \n}","import { CheckCircleOutlined, PoweroffOutlined } from \"@ant-design/icons\";\nimport { Alert, Drawer, Spin, Timeline } from \"antd\";\nimport React, { useCallback, useContext } from \"react\";\nimport { TFunction, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router\";\nimport { Beacon, \n BeaconActiveErrorResponse, \n BeaconError, \n BeaconLifecycle, \n BeaconOnOffSwitch, \n BeaconPosition,\n BeaconWithPosition, \n ErrorSeverity, \n isOff, \n isOn, \n useActiveErrors, \n useEnvironmentHistory, \n useErrorHistory, \n useErrorTranslation, \n useLifecycleHistory, \n usePositionHistory } from \"../../api\";\nimport { AuthContext } from \"../../contexts/authContext\";\nimport { maxBy, useTransformedState } from \"../../util\";\nimport { BeaconMapDetails } from \"../beacon-details/map/BeaconMapDetails\";\nimport { BeaconErrorStatus } from \"../BeaconErrorStatus\";\nimport { BeaconErrors } from \"../BeaconsErrors\";\nimport { BeaconStatus } from \"../BeaconStatus\";\nimport { TimeRangeSelection, useTimeRangeSelection } from \"../TimeRangeSelection\";\n\ninterface BeaconDrawerProps {\n onClose(): void;\n beacon: Beacon | undefined;\n}\n\ninterface BeaconDrawerContentProps {\n beacon: Beacon;\n}\n\ntype TimelineItem = {\n text: React.ReactNode;\n time: Date;\n icon?: React.ReactNode;\n type: 'ERROR_ACTIVATION' | 'ERROR_DEACTIVATION' | 'ERROR_ACKNOWLEDGEMENT' | 'POWER_ON' | 'POWER_OFF',\n tag?: any;\n};\n\nfunction pushErrors(t: (code: string, severity: ErrorSeverity, resolved: boolean) => string, tl: TimelineItem[], message: BeaconError) {\n tl.push({\n text: t(message.value.code, message.value.severity, !message.value.active),\n time: message.measuredAt,\n icon: message.value.active ? : ,\n type: message.value.active ? 'ERROR_ACTIVATION' : 'ERROR_DEACTIVATION',\n tag: message.value.code\n });\n}\n\nfunction pushErrorAcknowledgements(t: (code: string, severity: ErrorSeverity, resolved: boolean, acknowledged: boolean) => string, tl: TimelineItem[], message: BeaconActiveErrorResponse) {\n if (message.hasBeenRead && message.hasBeenReadAt)\n tl.push({\n text: t(message.code, message.severity, false, true),\n time: message.hasBeenReadAt,\n icon: ,\n type: 'ERROR_ACKNOWLEDGEMENT'\n });\n}\n\nfunction pushOnOff(t: TFunction<'translation'>, tl: TimelineItem[], message: BeaconLifecycle) {\n if (isOn(message.value)) {\n tl.push({ text: t('beacon:turned-on'), time: message.measuredAt, icon: , type: 'POWER_ON' });\n } else if (isOff(message.value)) {\n tl.push({ text: t('beacon:turned-off'), time: message.measuredAt, icon: , type: 'POWER_OFF' });\n }\n}\n\nfunction pushOnOffSwitch(t: TFunction<'translation'>, tl: TimelineItem[], onOff: BeaconOnOffSwitch) {\n if (onOff.isOn) {\n tl.push({ text: t('beacon:turned-on'), time: onOff.lastReportedAt, icon: , type: 'POWER_ON' });\n } else {\n tl.push({ text: t('beacon:turned-off'), time: onOff.lastReportedAt, icon: , type: 'POWER_OFF' });\n }\n}\n\n\nfunction BeaconDrawerContent(props: BeaconDrawerContentProps) {\n\n const { t } = useTranslation();\n const errorTranslation = useErrorTranslation();\n\n const { beacon } = props;\n\n const { selectedFromToFilter, fromToFilterOptions, selectedFromToFilterOptionIndex, onSelectFilterOption, onSelectCustomTimeFrame } = useTimeRangeSelection(beacon.id);\n let idOrSerial = beacon?.serial\n if (beacon.boardType === 1){\n idOrSerial = beacon?.id\n }\n const positionHistory = usePositionHistory(undefined, idOrSerial, selectedFromToFilter, beacon?.boardType || 1);\n const environmentHistory = useEnvironmentHistory(undefined, idOrSerial, selectedFromToFilter);\n const errorHistory = useErrorHistory(idOrSerial, selectedFromToFilter, 10000);\n const lifecycleHistory = useLifecycleHistory(idOrSerial, selectedFromToFilter, 10000);\n const activeErrors = useActiveErrors(idOrSerial);\n\n const beaconWithPos = beacon as BeaconWithPosition;\n const positionHistoryValue = positionHistory.value as BeaconPosition[];\n const newestPosition = beaconWithPos.position || maxBy(positionHistoryValue || [], p => p.measuredAt.getTime())?.item;\n\n const timeline: TimelineItem[] = useTransformedState(undefined,\n () => {\n const err = errorHistory.value;\n const life = lifecycleHistory.value;\n\n const tl: TimelineItem[] = [];\n\n err?.items?.forEach(m => pushErrors(errorTranslation, tl, m));\n life?.items?.forEach(m => pushOnOff(t, tl, m));\n activeErrors?.value?.forEach(m => pushErrorAcknowledgements(errorTranslation, tl, m));\n\n tl.sort((t1: TimelineItem, t2: TimelineItem) => t2.time > t1.time ? 1 : t1.time === t2.time ? 0 : -1);\n\n let resortRequired = false;\n\n if (selectedFromToFilterOptionIndex === 0) {\n if (activeErrors.value?.length) {\n activeErrors.value.forEach(e => {\n const lastActivation = tl.find(i => i.type === 'ERROR_ACTIVATION' && i.tag === e.code);\n const lastDeactivation = tl.find(i => i.type === 'ERROR_DEACTIVATION' && i.tag === e.code);\n\n const activationIsNotShown = !lastActivation;\n const oldActivationIsShown = lastActivation && lastDeactivation && lastDeactivation.time > lastActivation.time;\n\n if (activationIsNotShown || oldActivationIsShown) {\n tl.push({\n text: errorTranslation(e.code, e.severity),\n time: e.startedAt,\n icon: ,\n type: 'ERROR_ACTIVATION',\n tag: e.code\n });\n resortRequired = true;\n }\n\n });\n }\n\n if (!tl.some(t => t.type === 'POWER_ON') && beacon.onOffSwitch?.isOn) {\n pushOnOffSwitch(t, tl, beacon.onOffSwitch);\n resortRequired = true;\n }\n\n if (!tl.some(t => t.type === 'POWER_OFF') && beacon.onOffSwitch && !beacon.onOffSwitch.isOn) {\n pushOnOffSwitch(t, tl, beacon.onOffSwitch);\n resortRequired = true;\n }\n }\n\n if (resortRequired) {\n tl.sort((t1: TimelineItem, t2: TimelineItem) => t2.time > t1.time ? 1 : t1.time === t2.time ? 0 : -1);\n }\n\n return tl;\n }, [errorHistory.value, lifecycleHistory.value, activeErrors.value, t, errorTranslation, selectedFromToFilterOptionIndex, beacon]);\n\n const loadingTimeline = positionHistory.loading || environmentHistory.loading || errorHistory.loading || lifecycleHistory.loading;\n\n return
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n {!timeline.length\n ? (loadingTimeline ? : )\n : \n {timeline?.map((t, i) => \n
\n {t.time.toLocaleString()}\n {t.text}\n
)}\n
\n }\n
\n
\n
\n \n
\n
\n}\n\nexport function BeaconDrawer(props: BeaconDrawerProps) {\n const { t } = useTranslation();\n const { beacon, onClose } = props;\n\n const history = useHistory();\n\n const { currentUser } = useContext(AuthContext);\n const currentUserIsSolutionOperator = currentUser?.accessToken?.hasRole('solution-operator');\n\n const navigateToBeacon = useCallback(() => {\n if (!beacon) {\n return;\n }\n\n onClose();\n history.push(`/beacons/${beacon.id}`);\n }, [history, beacon, onClose]);\n\n const drawerWidth: React.CSSProperties['width'] = window.innerWidth < 800\n ? '100%'\n : window.innerWidth > 1800\n ? '1170px'\n : '65%';\n\n return \n {beacon?.serial || beacon?.id}\n {currentUserIsSolutionOperator && {t('beacon:show-details')}}\n } width={drawerWidth} maskStyle={{ backgroundColor: 'rgba(0, 0, 0, 0.75)' }}>\n {!!beacon && }\n ;\n}","import React, { useCallback, useContext, useState } from \"react\";\nimport { Beacon, BeaconWithPosition } from \"../../api\";\nimport { ApiState, PagedApiState } from \"../../api/useApiState\";\nimport { BeaconDrawer } from \"./BeaconDrawer\";\n\nexport interface BeaconDrawerState {\n beacon: Beacon | undefined;\n show(beacon: Beacon): void;\n close(): void;\n}\n\nexport const BeaconDrawerContext = React.createContext({ beacon: undefined, show: () => { }, close: () => { } });\n\nexport function BeaconDrawerContextProvider(props: { children: React.ReactNode }) {\n const [beaconShownInDrawer, setBeaconShownInDrawer] = useState();\n const closeBeaconDrawer = useCallback(() => {\n setBeaconShownInDrawer(undefined);\n }, [setBeaconShownInDrawer]);\n\n return \n {props.children}\n \n ;\n}\n\nexport function useUpdateDrawer(beaconsFromApi: PagedApiState | ApiState){\n\n const beacons = Array.isArray(beaconsFromApi.value) ? beaconsFromApi.value : beaconsFromApi.value?.items;\n const drawer = useContext(BeaconDrawerContext);\n \n if(drawer.beacon && beacons?.length){\n const beacon = beacons.find(b => b.id === drawer.beacon?.id);\n if(beacon){\n drawer.show(beacon);\n }\n }\n}","import { useCallback, useContext, useEffect, useState } from \"react\";\nimport { useUpdateDrawer } from \"../components/beacon-drawer/BeaconDrawerContext\";\nimport { fixDatesOfBeacons } from \"./api.beacons\";\nimport { useRefreshCounter } from \"./api.utils\";\nimport {\n BeaconTableSorting,\n BeaconWithPosition,\n ConstructionProject,\n ConstructionProjectMutableProperties,\n ConstructionSite,\n ConstructionSiteMutableProperties,\n PagedResponse,\n PostConstructionSiteRequest,\n} from \"./models\";\nimport {\n ApiCall,\n ApiState,\n PagedApiState,\n useApiState,\n useAuthorizedFetch,\n useGetAuthorized,\n usePagedApiState,\n} from \"./useApiState\";\nimport { AuthContext } from \"../contexts/authContext\";\nimport { EnvironmentContext } from \"../contexts/environmentContext\";\n\nexport function useConstructionProjects(\n filter?: string,\n archived?: boolean\n): PagedApiState {\n let url = \"construction-projects\";\n\n filter = filter?.trim();\n if (filter) {\n url += \"?filter=\" + filter;\n }\n\n if (archived !== undefined) {\n const prefix = filter ? \"&\" : \"?\";\n url += prefix + \"archived=\" + archived;\n }\n\n return usePagedApiState(\n useGetAuthorized>(url)\n );\n}\n\nexport function useConstructionProject(\n constructionProjectId: string\n): ApiState {\n return useApiState(\n useGetAuthorized(\n `construction-projects/${constructionProjectId}`\n ),\n undefined\n );\n}\n\nexport function useCreateConstructionProject(): ApiCall<\n ConstructionProjectMutableProperties,\n ConstructionProject\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (constructionProject: ConstructionProjectMutableProperties) => {\n const result = await authorizedFetch(\"construction-projects\", {\n method: \"post\",\n body: JSON.stringify(constructionProject),\n });\n const response = await result.json();\n return response as ConstructionProject;\n };\n}\n\nexport function useUpdateConstructionProject(\n constructionProjectId: string\n): ApiCall {\n const authorizedFetch = useAuthorizedFetch();\n return async (constructionProject: ConstructionProjectMutableProperties) => {\n const result = await authorizedFetch(\n `construction-projects/${constructionProjectId}`,\n { method: \"put\", body: JSON.stringify(constructionProject) }\n );\n const response = await result.json();\n return response as ConstructionProject;\n };\n}\n\nexport function useDeleteConstructionProject(\n constructionProjectId: string\n): ApiCall {\n const authorizedFetch = useAuthorizedFetch();\n return async () => {\n const result = await authorizedFetch(\n `construction-projects/${constructionProjectId}`,\n { method: \"delete\" }\n );\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useConstructionProjectBeacons(\n constructionProjectId: string,\n sorting?: BeaconTableSorting\n): ApiState {\n const refreshCounter = useRefreshCounter();\n const get = useGetAuthorized(\n `construction-projects/${constructionProjectId}/beacons?sort=${sorting?.sortColumnId}&order=${sorting?.sortOrderId}`,\n fixDatesOfBeacons\n );\n const beacons = useApiState(get, undefined, refreshCounter);\n\n useUpdateDrawer(beacons);\n return beacons;\n}\n\nexport function useAssignBeaconsToConstructionProject(): ApiCall<\n { beaconIds: string[]; constructionProjectId: string },\n void\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (a: { beaconIds: string[]; constructionProjectId: string }) => {\n const result = await authorizedFetch(\n `construction-projects/${a.constructionProjectId}/beacons`,\n { method: \"post\", body: JSON.stringify(a.beaconIds) }\n );\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useUnassignBeaconsFromConstructionProject(): ApiCall<\n { beaconIds: string[]; constructionProjectId: string },\n void\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (a: { beaconIds: string[]; constructionProjectId: string }) => {\n const result = await authorizedFetch(\n `construction-projects/${a.constructionProjectId}/beacons`,\n { method: \"delete\", body: JSON.stringify(a.beaconIds) }\n );\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useCreateConstructionSite(\n constructionProjectId: string\n): ApiCall {\n const authorizedFetch = useAuthorizedFetch();\n return async (constructionSite: PostConstructionSiteRequest) => {\n const result = await authorizedFetch(\n `construction-projects/${constructionProjectId}/construction-sites`,\n { method: \"post\", body: JSON.stringify(constructionSite) }\n );\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useAssignConstructionSite(\n constructionProjectId: string\n): ApiCall<\n { constructionSiteId?: string; beaconIds: string[]; exclusive?: boolean },\n void\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (assignment: {\n constructionSiteId?: string;\n beaconIds: string[];\n exclusive?: boolean;\n }) => {\n const url = assignment.constructionSiteId\n ? `construction-projects/${constructionProjectId}/construction-sites/${\n assignment.constructionSiteId\n }${assignment.exclusive === true ? \"?exclusive=true\" : \"\"}`\n : `construction-projects/${constructionProjectId}/construction-sites/none`;\n const result = await authorizedFetch(url, {\n method: \"put\",\n body: JSON.stringify(assignment.beaconIds),\n });\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useConstructionProjectSites(\n constructionProjectId: string\n): ApiState {\n const refreshCounter = useRefreshCounter();\n const fixDates = useCallback((sites: ConstructionSite[]) => {\n sites.forEach((site) => {\n site.createdAt = new Date(site.createdAt);\n });\n return sites;\n }, []);\n const get = useGetAuthorized(\n `construction-projects/${constructionProjectId}/construction-sites`,\n fixDates\n );\n return useApiState(get, undefined, refreshCounter);\n}\n\nexport function useGetConstructionProjectSite(): ApiCall<\n { constructionProjectId: string; constructionSiteId: string },\n ConstructionSite\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (ids: {\n constructionProjectId: string;\n constructionSiteId: string;\n }) => {\n const url = `construction-projects/${ids.constructionProjectId}/construction-sites/${ids.constructionSiteId}`;\n const result = await authorizedFetch(url, { method: \"get\" });\n if (!result.ok) {\n throw result.status;\n }\n const site = (await result.json()) as ConstructionSite;\n site.createdAt = new Date(site.createdAt);\n return site;\n };\n}\n\nexport function useGetAllConstructionProjectSites(\n constructionProjectIds: string[], apiVersion: number = 1\n): ApiState {\n const [data, setData] = useState([]);\n const [loading, setLoading] = useState(true);\n const [failed, setFailed] = useState(false);\n\n const authContext = useContext(AuthContext);\n const environmentContext = useContext(EnvironmentContext);\n\n const refresh = useCallback(\n async (ids: string[]) => {\n try {\n const token = authContext.currentUser!.accessToken;\n await token.refreshIfExpired();\n const baseUrl = apiVersion === 2 ? environmentContext.api.baseUrlv2 : environmentContext.api.baseUrl\n const responses = await Promise.all(\n ids.map(async (id) => {\n const response = await fetch(\n `${baseUrl}api/construction-projects/${id}/construction-sites`,\n {\n method: \"GET\",\n headers: new Headers({\n Authorization: `Bearer ${token.jwt}`,\n }),\n }\n );\n return response.json();\n })\n );\n\n const sites = responses.flat();\n setData(sites);\n setLoading(false);\n return { completed: true };\n } catch (error) {\n setFailed(true);\n setLoading(false);\n return { completed: true };\n }\n },\n [authContext, environmentContext, constructionProjectIds]\n );\n\n useEffect(() => {\n if (constructionProjectIds.length > 0) {\n refresh(constructionProjectIds);\n } else {\n setLoading(false);\n }\n }, [refresh]);\n\n return {\n value: data,\n loading,\n failed,\n refresh: async () => {\n refresh(constructionProjectIds);\n },\n };\n}\n\nexport function useConstructionProjectSite(\n constructionProjectId: string,\n constructionSiteId: string\n): ApiState {\n return useApiState(\n useGetAuthorized(\n `construction-projects/${constructionProjectId}/construction-sites/${constructionSiteId}`\n ),\n undefined\n );\n}\n\nexport function useUpdateConstructionSite(\n constructionProjectId: string,\n constructionSiteId: string\n): ApiCall {\n const authorizedFetch = useAuthorizedFetch();\n return async (constructionSite: ConstructionSiteMutableProperties) => {\n const result = await authorizedFetch(\n `construction-projects/${constructionProjectId}/construction-sites/${constructionSiteId}`,\n { method: \"post\", body: JSON.stringify(constructionSite) }\n );\n const response = await result.json();\n return response as ConstructionSite;\n };\n}\n","import { useCallback, useContext } from \"react\";\nimport { FromToFilter, useFromToFilter, useRefreshCounter } from \"./api.utils\";\nimport { BeaconEnvironment, BeaconPosition } from \"./models\";\nimport { ApiState, useApiState, useGetAuthorized } from \"./useApiState\";\nimport { EnvironmentContext } from \"../contexts/environmentContext\";\n\nfunction useHistory(constructionProjectId: string | undefined, \n beaconId: string, fromToFilter: FromToFilter, type: 'POS' | 'ENV', \n boardType: number = 1, \n endPath: string = 'position-telemetry',\n legacyMapper: (nm: TMessage[] | TMessageResult) => TMessage[]): ApiState {\n const refreshCounter = useRefreshCounter();\n const fixDates = useCallback((positions: TMessage[], apiV: number) => {\n if (apiV === 1 && !Array.isArray(positions)) {\n return [];\n }\n if (apiV === 2){\n positions = legacyMapper(positions);\n }\n positions.forEach(p => {\n p.measuredAt = new Date(p.measuredAt!);\n });\n\n return positions;\n }, [legacyMapper]);\n const appendDateFilter = useFromToFilter(fromToFilter);\n let manipulateUrl = (url: string) => {\n return appendDateFilter(url)\n }\n const environmentContext = useContext(EnvironmentContext);\n let apiVersion = 1;\n if(boardType === 2){\n apiVersion = 2;\n manipulateUrl = (url: string) => {\n let manipulatedUrl = appendDateFilter(url.replace(environmentContext.api.baseUrl, \"https://i5ge0av74k.execute-api.eu-central-1.amazonaws.com/\"))\n manipulatedUrl = manipulatedUrl.replace(\"from=\", \"start=\")\n manipulatedUrl = manipulatedUrl.replace(\"to=\", \"end=\")\n manipulatedUrl = manipulatedUrl.replace(\"skip=\", \"offset=\")\n manipulatedUrl = manipulatedUrl.replace(\"take=\", \"limit=\")\n manipulatedUrl = manipulatedUrl.replace(\"history?\", `history/${endPath}?`)\n manipulatedUrl = manipulatedUrl.replace(\"messageType=POS&\", '')\n manipulatedUrl = manipulatedUrl.replace(\"messageType=ENV&\", '')\n manipulatedUrl = manipulatedUrl.replace(\"messageType=LIFE&\", '')\n manipulatedUrl = manipulatedUrl.replace(\"messageType=ERR&\", '')\n return manipulatedUrl\n }\n }\n\n const url = constructionProjectId\n ? `construction-projects/${constructionProjectId}/beacons/${beaconId}/history?messageType=${type}&take=1000`\n : `beacons/${beaconId}/history?messageType=${type}&take=10000`;\n\n const get = useGetAuthorized(url, fixDates, useCallback(manipulateUrl, [appendDateFilter]), apiVersion);\n return useApiState(get, undefined, refreshCounter);\n}\n\nexport function usePositionHistory(constructionProjectId: string | undefined, beaconId: string, fromToFilter: FromToFilter, boardType: number = 1): ApiState {\n const mapNordicToLegacy = (nm: TMessageResult | TMessage[]): TMessage[] => {\n const nmResult = nm as TMessageResult\n return nmResult.items.map(p => {\n return {\n measuredAt: p.position!.ts,\n reason: 2,\n value: {\n pos: {\n lat: p.position!.lat,\n lon: p.position!.lon,\n alt: 0\n },\n md: {\n hAcc: p.position!.acc.h,\n vAcc: p.position!.acc.v,\n tAcc: p.position!.acc.t,\n hDop: p.position!.dop.h,\n pDop: p.position!.dop.p,\n vDop: p.position!.dop.v,\n satU: p.position!.sats,\n pst: p.position!.f,\n cprs: 0\n }\n }\n }\n })\n }\n return useHistory(constructionProjectId, beaconId, fromToFilter, 'POS', boardType, 'position-telemetry', mapNordicToLegacy);\n}\n\nexport function useEnvironmentHistory(constructionProjectId: string | undefined, beaconId: string, fromToFilter: FromToFilter, boardType: number = 1): ApiState {\n const mapNordicToLegacy = (nm: TMessageResult | TMessage[]): TMessage[] => {\n const nmResult = nm as TMessageResult\n return nmResult.items.map(s => {\n return {\n measuredAt: s.sensors!.batt.ts,\n reason: 2,\n value: {\n batt: {\n v: s.sensors!.batt.v\n },\n cell: {\n iccid: ''\n },\n remainingRuntimeHours: 4,\n remainingRuntimeRatio: 25.0\n }\n }\n })\n }\n return useHistory(constructionProjectId, beaconId, fromToFilter, 'ENV', boardType, 'sensor-telemetry', mapNordicToLegacy);\n}\n\ninterface TMessageResult {\n items: TMessage[]\n}\n\ninterface TMessage {\n measuredAt?: Date,\n reason?: number,\n position?: {\n ts: Date;\n lat: number;\n lon: number;\n f: number;\n sats: number;\n acc: {\n h: number;\n v: number;\n t: number;\n },\n dop: {\n g: number;\n p: number;\n h: number;\n v: number;\n t: number;\n }\n };\n value?: {\n pos?: {\n lat: number;\n lon: number;\n alt: number;\n };\n md?: {\n hAcc: number;\n vAcc: number;\n tAcc: number;\n hDop: number;\n pDop: number;\n vDop: number;\n satU: number;\n pst: number;\n cprs: number;\n };\n batt?: {\n v: number;\n };\n cell?: {\n iccid: string;\n };\n remainingRuntimeHours?: number;\n remainingRuntimeRatio?: number;\n };\n sensors?: {\n accel: {\n x: number,\n y: number,\n z: number\n },\n batt: {\n v: number,\n ts: Date,\n hoursLeft: number,\n percentLeft: number\n }\n };\n}\n","import { InputNumber, Input, Button } from \"antd\";\nimport {\n CheckCircleOutlined,\n CloseCircleOutlined,\n QuestionCircleOutlined,\n} from \"@ant-design/icons\";\nimport { useCallback, useContext } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n GetBeaconConfigurationResponse,\n GetBeaconConfigurationStateResponse,\n PutBeaconConfigurationRequest,\n useBeaconConfiguration,\n CorrectionServiceType,\n} from \"../../api\";\nimport { AuthContext } from \"../../contexts/authContext\";\nimport {\n get,\n useOnChangeListenerDynamic,\n} from \"../../util/useOnChangeListener\";\n\ninterface BeaconConfigurationFormProps {\n beacon: Beacon;\n reloadToken: number;\n mode: \"readonly\" | \"edit\";\n editedConfiguration?: PutBeaconConfigurationRequest;\n onConfigurationEdited(\n edited: PutBeaconConfigurationRequest,\n original: GetBeaconConfigurationResponse\n ): void;\n}\n\nfunction ConfigurationValueStatus(props: { desired?: T; reported?: T }) {\n const { desired, reported } = props;\n\n if (!desired && !reported) {\n return ;\n }\n\n if (desired !== reported) {\n return ;\n }\n return ;\n}\n\ntype Config = PutBeaconConfigurationRequest | GetBeaconConfigurationResponse;\n\ninterface BeaconConfigurationFieldProps {\n mode: \"readonly\" | \"edit\";\n translationKey: string;\n current: GetBeaconConfigurationStateResponse | undefined;\n edited: PutBeaconConfigurationRequest;\n onEdited(e: PutBeaconConfigurationRequest): void;\n}\n\ninterface BeaconConfigurationStringFieldProps\n extends BeaconConfigurationFieldProps {\n number?: false | undefined;\n property: keyof Config;\n}\n\ninterface BeaconConfigurationStringFieldProps2\n extends BeaconConfigurationFieldProps {\n number?: false | undefined;\n property: [P1, keyof NonNullable[P1]>];\n}\n\ninterface BeaconConfigurationNumberFieldProps\n extends BeaconConfigurationFieldProps {\n number: true;\n property: keyof Config;\n}\n\ninterface BeaconConfigurationNumberFieldProps2\n extends BeaconConfigurationFieldProps {\n number: true;\n property: [P1, keyof NonNullable[P1]>];\n}\n\nfunction getProperty(\n config: Config | undefined,\n property: keyof Config | [P1, keyof NonNullable[P1]>]\n) {\n if (!config) {\n return undefined;\n }\n\n return Array.isArray(property)\n ? get(config, property[0], property[1])\n : get(config, property);\n}\n\nfunction BeaconConfigurationField(\n props:\n | BeaconConfigurationStringFieldProps\n | BeaconConfigurationStringFieldProps2\n | BeaconConfigurationNumberFieldProps\n | BeaconConfigurationNumberFieldProps2\n) {\n const { t } = useTranslation();\n const { mode, translationKey, number, current, edited, onEdited, property } =\n props;\n\n const desired = getProperty(current?.desired, property);\n const reported = getProperty(current?.reported, property);\n const value = getProperty(edited, property);\n const onChanged = useOnChangeListenerDynamic(edited, onEdited, property);\n\n return (\n <>\n \n {t(\"beacon:configuration-\" + translationKey)}\n \n \n {number ? (\n <>\n {mode === \"edit\" && !!current ? (\n \n ) : (\n \n {(desired as number)?.toLocaleString() || \"-\"}\n \n )}\n \n {(reported as number)?.toLocaleString() || \"-\"}\n \n \n ) : (\n <>\n {mode === \"edit\" && !!current ? (\n onChanged(e.target.value)}\n value={value as any as string}\n />\n ) : (\n {desired || \"-\"}\n )}\n {reported || \"-\"}\n \n )}\n \n );\n}\n\nfunction intitializeConfig(\n e: PutBeaconConfigurationRequest | undefined,\n desired: GetBeaconConfigurationResponse | undefined\n): PutBeaconConfigurationRequest {\n if (e) {\n return e;\n }\n\n return {\n activityIntervalPeriod: desired?.activityIntervalPeriod || 24 * 60 * 60,\n motionDetectionThreshold: desired?.motionDetectionThreshold || 1200,\n correctionServiceType: desired ? desired.correctionServiceType : \"NTRIP\",\n correctionServiceConfiguration: desired?.correctionServiceConfiguration || {\n endpoint: \"\",\n port: 0,\n },\n ntripConfiguration: desired?.ntripConfiguration || {\n mountpoint: \"\",\n username: \"\",\n password: \"\",\n ntripRequestInterval: 30,\n },\n pointPerfectConfiguration: desired?.pointPerfectConfiguration || {\n correctionTopic: \"/pp/ip/eu\",\n distributionTopic: \"/pp/key/ip\",\n clientId: \"\",\n },\n };\n}\n\nexport function BeaconConfigurationForm(props: BeaconConfigurationFormProps) {\n const { t } = useTranslation();\n const { beacon } = props;\n\n const configuration = useBeaconConfiguration(beacon.id, props.reloadToken);\n\n const authContext = useContext(AuthContext);\n const currentUserIsSolutionOperator =\n authContext.currentUser?.accessToken?.hasRole(\"solution-operator\");\n const showCorrectionServiceConfiguration = currentUserIsSolutionOperator;\n\n const desired = configuration.value?.desired;\n\n const editedConfiguration: PutBeaconConfigurationRequest = intitializeConfig(\n props.editedConfiguration,\n desired\n );\n\n const onConfigurationEdited = useCallback(\n (c: PutBeaconConfigurationRequest) => {\n props.onConfigurationEdited(c, configuration.value!.desired!);\n },\n [props.onConfigurationEdited, configuration.value]\n );\n\n const onNtrip = useCallback(() => {\n if (editedConfiguration.correctionServiceType === \"NTRIP\") {\n return;\n }\n const newConfig: PutBeaconConfigurationRequest = { ...editedConfiguration };\n newConfig.correctionServiceType = \"NTRIP\";\n onConfigurationEdited(newConfig);\n }, [editedConfiguration, onConfigurationEdited, desired]);\n\n const onPointPerfect = useCallback(() => {\n if (editedConfiguration.correctionServiceType === \"PointPerfect\") {\n return;\n }\n const newConfig: PutBeaconConfigurationRequest = { ...editedConfiguration };\n newConfig.correctionServiceType = \"PointPerfect\";\n onConfigurationEdited(newConfig);\n }, [editedConfiguration, onConfigurationEdited, desired]);\n\n const usesNtrip = editedConfiguration.correctionServiceType === \"NTRIP\";\n\n return (\n
\n \n {t(\"beacon:configuration-status\")}\n {t(\"beacon:configuration-desired\")}\n {t(\"beacon:configuration-reported\")}\n\n \n \n\n {showCorrectionServiceConfiguration && (\n <>\n \n \n\n {props.mode === \"edit\" && (\n
\n \n \n NTRIP\n \n \n PointPerfect\n \n
\n
\n )}\n\n {usesNtrip && (\n <>\n \n \n \n \n \n )}\n\n {!usesNtrip && (\n <>\n \n \n \n )}\n \n )}\n \n );\n}\n","import { SettingOutlined } from \"@ant-design/icons\";\nimport { Button, Modal, Spin } from \"antd\";\nimport React, { useCallback, useContext, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n GetBeaconConfigurationResponse,\n PutBeaconConfigurationRequest,\n useConfigureBeacon,\n} from \"../../api\";\nimport { AuthContext } from \"../../contexts/authContext\";\nimport { BeaconConfigurationForm } from \"./BeaconConfigurationForm\";\n\ninterface BeaconConfigurationModalProps {\n beacon?: Beacon;\n style?: React.CSSProperties;\n}\n\nfunction hasDifferences(\n c1: PutBeaconConfigurationRequest | undefined,\n c2: GetBeaconConfigurationResponse | undefined\n) {\n return (\n c1?.activityIntervalPeriod !== c2?.activityIntervalPeriod ||\n c1?.motionDetectionThreshold !== c2?.motionDetectionThreshold ||\n c1?.correctionServiceConfiguration.endpoint !==\n c2?.correctionServiceConfiguration.endpoint ||\n c1?.correctionServiceConfiguration.port !==\n c2?.correctionServiceConfiguration.port ||\n c1?.ntripConfiguration?.mountpoint !== c2?.ntripConfiguration?.mountpoint ||\n c1?.ntripConfiguration?.username !== c2?.ntripConfiguration?.username ||\n c1?.ntripConfiguration?.password !== c2?.ntripConfiguration?.password ||\n c1?.ntripConfiguration?.ntripRequestInterval !==\n c2?.ntripConfiguration?.ntripRequestInterval ||\n c1?.pointPerfectConfiguration?.correctionTopic !==\n c2?.pointPerfectConfiguration?.correctionTopic ||\n c1?.pointPerfectConfiguration?.distributionTopic !==\n c2?.pointPerfectConfiguration?.distributionTopic ||\n c1?.correctionServiceType !== c2?.correctionServiceType\n );\n}\n\nfunction hasAllRequiredFields(c: PutBeaconConfigurationRequest | undefined) {\n if (!c?.activityIntervalPeriod || !c?.motionDetectionThreshold) {\n return false;\n }\n\n if (\n !c?.correctionServiceConfiguration.endpoint ||\n !c?.correctionServiceConfiguration.port\n ) {\n return false;\n }\n\n const hasNtrip =\n !!c.ntripConfiguration?.mountpoint &&\n !!c.ntripConfiguration?.password &&\n !!c.ntripConfiguration?.username &&\n !!c.ntripConfiguration?.ntripRequestInterval;\n\n const hasPointPerfect =\n !!c.pointPerfectConfiguration?.correctionTopic &&\n !!c.pointPerfectConfiguration.distributionTopic;\n\n return hasNtrip || hasPointPerfect;\n}\n\nexport function BeaconConfigurationModal(props: BeaconConfigurationModalProps) {\n const { t } = useTranslation();\n const { beacon } = props;\n const [reloadToken, setReloadToken] = useState(0);\n const [isOpen, setIsOpen] = useState(false);\n const [isSaving, setIsSaving] = useState(false);\n const [isEditing, setIsEditing] = useState(false);\n const [editedConfiguration, setEditedConfiguration] = useState<{\n edited: PutBeaconConfigurationRequest;\n original: GetBeaconConfigurationResponse;\n }>();\n const onConfigurationEdited = useCallback(\n (\n edited: PutBeaconConfigurationRequest,\n original: GetBeaconConfigurationResponse\n ) => {\n setEditedConfiguration({ edited, original });\n },\n [setEditedConfiguration]\n );\n const configureBeacon = useConfigureBeacon();\n\n const open = useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n setIsOpen(true);\n },\n [setIsOpen]\n );\n\n const authContext = useContext(AuthContext);\n const currentUserIsSolutionOperator =\n authContext.currentUser?.accessToken?.hasRole(\"solution-operator\");\n\n const onCancel = (e: React.MouseEvent) => {\n e.preventDefault();\n if (isSaving) {\n return;\n }\n setIsEditing(false);\n setEditedConfiguration(undefined);\n setIsOpen(false);\n setReloadToken(reloadToken + 1);\n };\n\n const onSave = async (e: React.MouseEvent) => {\n e.preventDefault();\n if (isSaving) {\n return;\n }\n setIsSaving(true);\n\n try {\n await configureBeacon({\n beaconId: beacon!.id,\n configuration: editedConfiguration!.edited,\n });\n setReloadToken(reloadToken + 1);\n setIsEditing(false);\n setEditedConfiguration(undefined);\n } finally {\n setIsSaving(false);\n }\n };\n\n const onEdit = (e: React.MouseEvent) => {\n e.preventDefault();\n if (isEditing) {\n return;\n }\n setIsEditing(true);\n };\n\n const isEditedConfigurationValid =\n hasAllRequiredFields(editedConfiguration?.edited) &&\n hasDifferences(editedConfiguration?.edited, editedConfiguration?.original);\n\n const modalFooter = [\n ,\n ];\n\n if (currentUserIsSolutionOperator) {\n if (isEditing) {\n modalFooter.push(\n \n {t(\"save\")}\n \n );\n } else {\n modalFooter.push(\n \n );\n }\n }\n\n return (\n <>\n \n \n
e.preventDefault()}>\n {beacon ? (\n \n ) : (\n \n )}\n
\n \n \n );\n}\n","import { SearchOutlined } from \"@ant-design/icons\";\nimport { Badge, Button, Input, Table } from \"antd\";\nimport { SorterResult } from \"antd/lib/table/interface\";\nimport { debounce } from \"lodash\";\nimport { useEffect, useRef } from \"react\";\nimport { TFunction, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\nimport {\n Beacon,\n BeaconSortingColumn,\n BeaconSortingOrder,\n BeaconTableColumns,\n BeaconTableSorting,\n ErrorSeverity,\n} from \"../api\";\nimport { PagedApiState } from \"../api/useApiState\";\nimport { toAntdPagination } from \"../util\";\nimport { BeaconConfigurationModal } from \"./beacon-configuration/BeaconConfigurationModal\";\nimport { BeaconsErrors } from \"./BeaconsErrors\";\nimport { BeaconStatus } from \"./BeaconStatus\";\n\ninterface BeaconTableProps {\n beaconData: PagedApiState;\n visibleColumns: BeaconTableColumns[];\n disableCellClick?: boolean;\n showPagination?: boolean;\n showFooter?: boolean;\n showClearSelected?: boolean;\n rowsSelectable?: boolean;\n showBeaconFilter?: boolean;\n showSorter?: boolean;\n footerContent?: React.ReactNode;\n onSort?: (sorting: BeaconTableSorting) => void;\n onFilter?: (filter: string) => void;\n onSelect?: (selectedRowKeys: string[]) => void;\n}\n\nexport function BeaconTableBase({\n beaconData,\n visibleColumns,\n disableCellClick = false,\n showPagination = true,\n showFooter = false,\n showClearSelected = false,\n rowsSelectable = false,\n showBeaconFilter = false,\n showSorter = true,\n footerContent,\n onSort,\n onFilter,\n onSelect,\n}: BeaconTableProps) {\n const { t } = useTranslation();\n const history = useHistory();\n const isPageRendered = useRef(false);\n const filter = useRef(\"\");\n const selectedRowKeys = useRef([]);\n\n useEffect(() => {\n if (!isPageRendered.current) {\n isPageRendered.current = true;\n }\n }, []);\n\n const onSortingChange = (\n sorter: SorterResult | SorterResult[]\n ) => {\n const sort = Array.isArray(sorter) ? sorter[0] : sorter;\n if (onSort) {\n onSort(mapSortingToApiDefintions(sort));\n }\n };\n\n /*\n When user filters on any page that is not the first page (page 0), the table needs to go back to page 0\n to display the results. When the user removes the filter, the table needs to go back to the page it was \n before filtering took place. \n\n This is done by keeping track of the current page in a ref and updating it when the user filters.\n */\n const previousPage = useRef(0);\n const isFiltering = useRef(false);\n\n const onFilterChange = debounce((e: React.ChangeEvent) => {\n if (!onFilter) return;\n\n if (!isFiltering.current) {\n previousPage.current = beaconData.currentPage;\n }\n\n if (e.target.value === \"\") {\n isFiltering.current = false;\n beaconData.goToPage(previousPage.current);\n } else {\n isFiltering.current = true;\n beaconData.goToPage(0);\n }\n\n filter.current = e.target.value;\n onFilter(e.target.value);\n }, 300);\n\n const onRowSelectChange = (selectedKeys: React.Key[]) => {\n if (onSelect) onSelect(selectedKeys as string[]);\n selectedRowKeys.current = selectedKeys as string[];\n };\n\n const clearAllSelectedRows = () => {\n if (onSelect) onSelect([] as string[]);\n selectedRowKeys.current = [];\n };\n\n const handleCellClick = (urlPathPart: string, id: string) => {\n if (urlPathPart === \"/construction-projects/\" && id) {\n setTimeout(\n () =>\n history.push(urlPathPart, {\n selectedId: id,\n }),\n 0\n );\n } else if (id) {\n setTimeout(() => history.push(urlPathPart + id), 0);\n }\n };\n\n const visibleColumnsDefintion = getVisibleColumnDefinitions(\n t,\n handleCellClick,\n visibleColumns,\n disableCellClick,\n showSorter\n );\n\n return (\n <>\n {showBeaconFilter && (\n
\n {beaconFilter(onFilterChange, filter.current, t)}\n {/* {beaconAlerts(filter.current)} */}\n
\n )}\n onSortingChange(sorter) : undefined}\n scroll={{ y: \"calc(100vh - 250px)\" }}\n rowKey=\"id\"\n rowSelection={\n rowsSelectable\n ? {\n selectedRowKeys: selectedRowKeys.current,\n onChange: onRowSelectChange,\n }\n : undefined\n }\n footer={\n showFooter\n ? showClearSelected\n ? rowSelectFooter(\n selectedRowKeys.current,\n clearAllSelectedRows,\n t,\n footerContent\n )\n : () => footerContent\n : undefined\n }\n />\n \n );\n}\n\nconst getVisibleColumnDefinitions = (\n t: TFunction,\n handleCellClick: (urlPathPart: string, id: string) => void,\n visibleColumns: BeaconTableColumns[],\n disableCellClick: boolean,\n showSorter?: boolean\n) => {\n const columns = [\n {\n key: \"Serial\",\n title: t(\"beacon:serial\"),\n render: (b: Beacon) => b.serial || b.id,\n sorter: showSorter,\n onCell: (b: Beacon) =>\n !disableCellClick\n ? {\n onClick: () => {\n handleCellClick(\"/beacons/\", b.serial);\n },\n style: { cursor: \"pointer\" },\n }\n : {},\n },\n {\n key: \"OnOffSwitch\",\n title: t(\"beacon:status\"),\n render: (b: Beacon) => ,\n sorter: showSorter,\n },\n {\n key: \"Iccid\",\n title: t(\"beacon:iccid\"),\n render: (b: Beacon) => b.iccid,\n sorter: showSorter,\n },\n // hwv & fwv sorting not supported by current API (Nov, 2024)\n {\n key: \"Hwv\",\n title: t(\"beacon:hardware-version\"),\n render: (b: Beacon) => b.hwv,\n sorter: false,\n },\n {\n key: \"Fwv\",\n title: t(\"beacon:firmware-version\"),\n // width: 100,\n render: (b: Beacon) => b.fwv,\n sorter: false,\n },\n // imei not yet implemented in current API (Nov, 2024)\n {\n key: \"Imei\",\n title: \"IMEI\",\n render: (b: Beacon) => b.imei ?? \"\",\n sorter: false,\n },\n\n // manufacturedOn sorting not supported by current API (Nov, 2024)\n // manufacturedOn stored as string in current API (Nov, 2024)\n {\n key: \"ManufacturedOn\",\n title: t(\"beacon:manufactured-on\"),\n render: (b: Beacon) =>\n b.manufacturedOn\n ? new Date(b.manufacturedOn.toString()).toLocaleString()\n : \"\",\n sorter: false,\n },\n {\n key: \"ConstructionSiteName\",\n title: t(\"translations:construction-site\"),\n render: (b: Beacon) => b.constructionSiteName,\n sorter: showSorter,\n onCell: (b: Beacon) =>\n !disableCellClick\n ? {\n onClick: () => {\n handleCellClick(\n \"/construction-projects/\",\n b.constructionSiteId ?? \"\"\n );\n },\n style: { cursor: \"pointer\" },\n }\n : {},\n },\n {\n key: \"ConstructionProjectName\",\n title: t(\"translations:construction-project\"),\n render: (b: Beacon) => b.constructionProjectName,\n sorter: showSorter,\n onCell: (b: Beacon) =>\n !disableCellClick\n ? {\n onClick: () => {\n handleCellClick(\n \"/construction-projects/\",\n b.constructionProjectId ?? \"\"\n );\n },\n style: { cursor: \"pointer\" },\n }\n : {},\n },\n {\n key: \"OrganizationName\",\n title: t(\"translations:organization\"),\n render: (b: Beacon) => b.organizationName,\n sorter: showSorter,\n onCell: (b: Beacon) =>\n !disableCellClick\n ? {\n onClick: () => {\n handleCellClick(\"/organizations/\", b.organizationId ?? \"\");\n },\n style: { cursor: \"pointer\" },\n }\n : {},\n },\n {\n key: \"LastMessageReceivedAt\",\n title: t(\"beacon:last-message-received-at\"),\n render: (b: Beacon) => b.lastMessageReceivedAt?.toLocaleString(),\n sorter: showSorter,\n },\n {\n key: \"ConfigurationButton\",\n width: 100,\n render: (b: Beacon) => ,\n },\n ];\n\n return columns.filter((column) =>\n visibleColumns.includes(column.key as BeaconTableColumns)\n );\n};\n\nconst rowSelectFooter = (\n selectedRowIds: string[] | undefined,\n onClearAllSelectedBeacons: () => void,\n t: TFunction,\n footerContent?: React.ReactNode\n) => {\n return () => (\n \n \n onClearAllSelectedBeacons()}\n >\n {t(\"construction-site:clear-selected-beacons\")}\n \n \n {footerContent}\n \n );\n};\n\nconst beaconFilter = (\n onFilterChanged: (e: React.ChangeEvent) => void,\n filter: string,\n t: TFunction\n) => {\n return (\n }\n placeholder={t(\"beacon:filter-placeholder\")}\n onChange={onFilterChanged}\n allowClear\n style={{ margin: \"1rem\", width: \"25em\" }}\n />\n );\n};\n\nconst beaconAlerts = (filter: string) => {\n return (\n <>\n \n \n \n );\n};\n\nconst mapSortingToApiDefintions = (sorting: SorterResult) => {\n const sortColumnId =\n BeaconSortingColumn[sorting.columnKey as keyof typeof BeaconSortingColumn];\n\n switch (sorting.order) {\n case \"ascend\":\n return {\n sortColumnId,\n sortOrderId: BeaconSortingOrder.Ascending,\n };\n case \"descend\":\n return {\n sortColumnId,\n sortOrderId: BeaconSortingOrder.Descending,\n };\n default:\n return {\n sortColumnId: undefined,\n sortOrderId: undefined,\n };\n }\n};\n","import { useState } from \"react\";\nimport { BeaconTableColumns, BeaconTableSorting, useBeacons } from \"../../api\";\nimport { BeaconTableBase } from \"../../components/BeaconTableBase\";\ninterface BeaconsBeaconTableProps {\n currentUserIsSolutionOperator: boolean;\n}\n\nconst useSorting = () => {\n const [sorting, setSorting] = useState({\n sortColumnId: undefined,\n sortOrderId: undefined,\n });\n\n const onSortingChange = (sorting: BeaconTableSorting) => {\n setSorting(sorting);\n };\n\n return { sorting, onSortingChange };\n};\n\nconst useFiltering = () => {\n const [filter, setFilter] = useState(\"\");\n\n const onFiltering = (filter: string) => {\n /* \n Debounce filter in BaconTableBase.tsx causes a race case condition (I believe), dude to this \n setting a timeout of the same duration as the debounce in the BeaconTableBase.tsx\n Not a good solution, but it works for now.\n */\n setTimeout(() => {\n setFilter(filter);\n }, 300);\n };\n\n return { filter, onFiltering };\n};\n\n/*\n This component is used to display a table of beacons on the /beacons screen.\n Component and file naming convention follows {screen}BeaconsTable.tsx. \n This component name might be a bit confusing, but it is consistent with the \n naming convention.\n\n Open to suggestions for a better name.\n*/\nexport function BeaconsBeaconTable({\n currentUserIsSolutionOperator,\n}: BeaconsBeaconTableProps) {\n const { sorting, onSortingChange } = useSorting();\n const { filter, onFiltering } = useFiltering();\n const beacons = useBeacons(undefined, filter, undefined, sorting);\n\n return (\n \n );\n}\n","import { Button, Modal, Input, Switch } from 'antd';\nimport { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { ForwardToPlatform, Organization, OrganizationMutableProperties } from '../api';\n\ninterface OrganizationPropertyModalProps {\n modalButtonIcon?: React.ReactNode;\n title: string;\n organization?: Organization;\n onSave(organization: OrganizationMutableProperties): Promise\n}\n\nexport function OrganizationPropertyModal(props: OrganizationPropertyModalProps) {\n\n const { t } = useTranslation();\n const [isOpen, setIsOpen] = useState(false);\n const [isSaving, setIsSaving] = useState(false);\n\n const [newName, setNewName] = useState();\n const [newForward, setNewForward] = useState();\n\n const effectiveName = newName ?? props.organization?.name;\n const effectiveForward = newForward ?? props.organization?.forwardToPlatform;\n\n const onSave = async () => {\n setIsSaving(true);\n try {\n await props.onSave({\n name: effectiveName!,\n forwardToPlatform: effectiveForward\n });\n } catch {\n setIsSaving(false);\n return;\n }\n setNewName(undefined);\n setNewForward(undefined);\n setIsOpen(false);\n setIsSaving(false);\n }\n\n const onCancel = () => {\n if (isSaving) {\n return;\n }\n setNewName(undefined);\n setNewForward(undefined);\n setIsOpen(false);\n }\n\n const modalFooter = [\n ,\n \n ];\n\n return <>\n \n \n
\n {t('organization:name')}\n setNewName(e.target.value)} placeholder={t('organization:name')} />\n {t('organization:forward-to-udp')}\n
\n setNewForward(c ? ForwardToPlatform.UDP : ForwardToPlatform.NONE)} checkedChildren={t('yes')} unCheckedChildren={t('no')} />\n
\n {t('organization:forward-to-movement-mail')}\n
\n setNewForward(c ? ForwardToPlatform.MOVEMENT_MAIL_ALERTING : ForwardToPlatform.NONE)} checkedChildren={t('yes')} unCheckedChildren={t('no')} />\n
\n
\n
\n ;\n}","import React from \"react\";\nimport { Badge as AntdBadge, BadgeProps as AntdBadgeProps } from 'antd';\n\nexport function Badge(props: { children: React.ReactNode } & AntdBadgeProps) {\n\n const { color, children, style, ...rest } = props;\n const effectiveStyle = style || {};\n effectiveStyle.backgroundColor = color || 'red';\n return <>{props.count === 0\n ? props.children\n : \n {children}\n }\n ;\n}","import { AmplifyLoadingSpinner } from \"@aws-amplify/ui-react\";\nimport { Button, Table } from \"antd\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useOrganizationUsers, useUsers } from \"../api\";\nimport { User } from \"../api/models\";\nimport { PagedApiState } from \"../api/useApiState\";\nimport { toAntdPagination } from \"../util\";\nimport { Badge } from \"./Badge\";\n\ninterface UserTableProps {\n users: PagedApiState;\n selectedUserIds?: string[];\n setSelectedUserIds?(ids: string[]): void;\n footer?: React.ReactNode;\n hideFooter?: boolean;\n}\n\nfunction UserTable(props: UserTableProps) {\n const { users, selectedUserIds, setSelectedUserIds } = props;\n const { t } = useTranslation();\n\n let { hideFooter } = props;\n hideFooter = hideFooter || (!props.footer && !setSelectedUserIds);\n\n const onChange = (selectedRowKeys: React.Key[]) => {\n\n const isOnCurrentPage = users.value!.items.reduce((is, b) => {\n is[b.id] = true;\n return is;\n }, {} as { [id: string]: boolean });\n\n const selectedUserIdsOnCurrentPage = selectedRowKeys.filter(r => isOnCurrentPage[r]) as string[];\n\n setSelectedUserIds!([\n ...selectedUserIds!.filter(b => !isOnCurrentPage[b]),\n ...selectedUserIdsOnCurrentPage\n ]);\n };\n\n return !users.loading && !users.value\n ? \n : b.email\n },\n {\n title: t('user:id'),\n render: (b: User) => b.id\n }\n ]}\n pagination={toAntdPagination(users)}\n footer={hideFooter ? undefined : () =>\n
\n {selectedUserIds && setSelectedUserIds && \n setSelectedUserIds([])}>\n {t('organization:clear-selected-users')}\n \n }\n {props.footer}\n
}\n />;\n}\n\ninterface OrganizationUsersTableProps {\n organizationId: string;\n selectedUserIds?: string[];\n setSelectedUserIds?(ids: string[]): void;\n footer?: React.ReactNode;\n hideFooter?: boolean;\n}\n\nexport function OrganizationUsersTable(props: OrganizationUsersTableProps) {\n const users = useOrganizationUsers(props.organizationId);\n return ;\n}\n\ninterface AllUsersTableProps {\n assignedToOrganization?: boolean;\n selectedUserIds?: string[];\n setSelectedUserIds?(ids: string[]): void;\n footer?: React.ReactNode;\n hideFooter?: boolean;\n}\n\nexport function AllUsersTable(props: AllUsersTableProps) {\n const users = useUsers(props.assignedToOrganization);\n return ;\n}","import { fixDatesOfPagedBeacons } from \"./api.beacons\";\nimport {\n Beacon,\n BeaconTableSorting,\n Organization,\n OrganizationMutableProperties,\n PagedResponse,\n User,\n} from \"./models\";\nimport {\n ApiCall,\n ApiState,\n PagedApiState,\n useApiState,\n useAuthorizedFetch,\n useGetAuthorized,\n usePagedApiState,\n} from \"./useApiState\";\n\nexport function useOrganizations(): PagedApiState {\n return usePagedApiState(\n useGetAuthorized>(\"organizations\")\n );\n}\n\nexport function useOrganization(\n organizationId: string\n): ApiState {\n return useApiState(\n useGetAuthorized(`organizations/${organizationId}`),\n undefined\n );\n}\n\nexport function useMyOrganization(): ApiState {\n return useApiState(\n useGetAuthorized(\"organizations/my\"),\n undefined\n );\n}\n\nexport function useCreateOrganization(): ApiCall<\n OrganizationMutableProperties,\n Organization\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (organization: OrganizationMutableProperties) => {\n const result = await authorizedFetch(\"organizations\", {\n method: \"post\",\n body: JSON.stringify(organization),\n });\n return (await result.json()) as Organization;\n };\n}\n\nexport function useUpdateOrganization(\n organizationId: string\n): ApiCall {\n const authorizedFetch = useAuthorizedFetch();\n return async (organization: OrganizationMutableProperties) => {\n const result = await authorizedFetch(`organizations/${organizationId}`, {\n method: \"put\",\n body: JSON.stringify(organization),\n });\n return (await result.json()) as Organization;\n };\n}\n\nexport function useDeleteOrganization(\n organizationId: string\n): ApiCall {\n const authorizedFetch = useAuthorizedFetch();\n return async () => {\n const result = await authorizedFetch(`organizations/${organizationId}`, {\n method: \"delete\",\n });\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useOrganizationUsers(\n organizationId: string\n): PagedApiState {\n return usePagedApiState(\n useGetAuthorized>(\n `organizations/${organizationId}/users`\n )\n );\n}\n\nexport function useUsers(\n assignedToOrganization?: boolean\n): PagedApiState {\n const query =\n assignedToOrganization === undefined\n ? \"\"\n : `?assignedToOrganization=${assignedToOrganization}`;\n return usePagedApiState(\n useGetAuthorized>(\"users\" + query)\n );\n}\n\nexport function useAssignUsersToOrganization(): ApiCall<\n { userIds: string[]; organizationId: string },\n void\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (a: { userIds: string[]; organizationId: string }) => {\n const result = await authorizedFetch(\n `organizations/${a.organizationId}/users`,\n { method: \"post\", body: JSON.stringify(a.userIds) }\n );\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useUnassignUsersFromOrganization(): ApiCall<\n { userIds: string[]; organizationId: string },\n void\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (a: { userIds: string[]; organizationId: string }) => {\n const result = await authorizedFetch(\n `organizations/${a.organizationId}/users`,\n { method: \"delete\", body: JSON.stringify(a.userIds) }\n );\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useOrganizationBeacons(\n organizationId: string,\n sorting?: BeaconTableSorting\n): PagedApiState {\n return usePagedApiState(\n useGetAuthorized>(\n `organizations/${organizationId}/beacons?sort=${sorting?.sortColumnId}&order=${sorting?.sortOrderId}`,\n fixDatesOfPagedBeacons\n )\n );\n}\n\nexport function useAssignBeaconsToOrganization(): ApiCall<\n { beaconIds: string[]; organizationId: string },\n void\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (a: { beaconIds: string[]; organizationId: string }) => {\n const result = await authorizedFetch(\n `organizations/${a.organizationId}/beacons`,\n { method: \"post\", body: JSON.stringify(a.beaconIds) }\n );\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n\nexport function useUnassignBeaconsFromOrganization(): ApiCall<\n { beaconIds: string[]; organizationId: string },\n void\n> {\n const authorizedFetch = useAuthorizedFetch();\n return async (a: { beaconIds: string[]; organizationId: string }) => {\n const result = await authorizedFetch(\n `organizations/${a.organizationId}/beacons`,\n { method: \"delete\", body: JSON.stringify(a.beaconIds) }\n );\n if (!result.ok) {\n throw result.status;\n }\n };\n}\n","import { Button, Modal } from \"antd\";\nimport { useCallback, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Beacon, BeaconTableColumns, BeaconWithPosition } from \"../../api\";\nimport { BeaconTableBase } from \"../BeaconTableBase\";\nimport { PagedApiState } from \"../../api/useApiState\";\n\ninterface SelectBeaconsModalProps {\n modalButton?: (openModal: () => void) => React.ReactNode;\n modalButtonIcon?: React.ReactNode;\n title: string;\n instruction: string;\n selectButtonText(beaconIds: string[]): string;\n selectButtonTitle(beaconIds: string[]): string;\n assignedToOrganization?: boolean;\n onBeaconsSelected(beaconIds: string[]): Promise;\n beacons: PagedApiState;\n}\n\nexport function SelectBeaconsModal(props: SelectBeaconsModalProps) {\n const { t } = useTranslation();\n const [isOpen, setIsOpen] = useState(false);\n const [isSelecting, setIsSelecting] = useState(false);\n const [selectedBeaconIds, setSelectedBeaconIds] = useState([]);\n\n const openModal = useCallback(() => {\n setIsOpen(true);\n }, [setIsOpen]);\n\n const onSelect = async () => {\n setIsSelecting(true);\n try {\n await props.onBeaconsSelected(selectedBeaconIds);\n } catch {\n setIsSelecting(false);\n return;\n }\n setIsOpen(false);\n setIsSelecting(false);\n setSelectedBeaconIds([]);\n };\n\n const onCancel = () => {\n if (isSelecting) {\n return;\n }\n setIsOpen(false);\n setIsSelecting(false);\n setSelectedBeaconIds([]);\n };\n\n const modalFooter = [\n ,\n \n {props.selectButtonText(selectedBeaconIds)}\n ,\n ];\n\n return (\n <>\n {props.modalButton ? (\n props.modalButton(openModal)\n ) : (\n \n )}\n \n
\n \n
\n \n \n );\n}\n","import { useContext } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { PlusCircleOutlined } from \"@ant-design/icons\";\nimport {\n Beacon,\n useAssignBeaconsToOrganization,\n useAssignConstructionSite,\n useBeacons,\n} from \"../../api\";\nimport { SelectBeaconsModal } from \"./SelectBeaconsModal\";\nimport { DataRefreshContext } from \"../../contexts/dataRefreshContext\";\nimport { PagedApiState } from \"../../api/useApiState\";\n\ninterface AssignBeaconsModalConstructionSiteProps {\n constructionProjectId: string;\n constructionSiteId: string;\n beacons: PagedApiState;\n title?: string;\n modalButton?: (openModal: () => void) => React.ReactNode;\n}\n\nexport function AssignBeaconsModalConstructionSite({\n constructionProjectId,\n constructionSiteId,\n beacons,\n title,\n modalButton,\n}: AssignBeaconsModalConstructionSiteProps) {\n const { t } = useTranslation();\n const assignBeaconsToConstructionSite = useAssignConstructionSite(\n constructionProjectId\n );\n const dataRefreshContext = useContext(DataRefreshContext);\n\n const onAssignBeaconsToConstructionProject = async (beaconIds: string[]) => {\n await assignBeaconsToConstructionSite({\n constructionSiteId: constructionSiteId,\n beaconIds: beaconIds,\n });\n\n dataRefreshContext.refresh();\n };\n\n return (\n \n t(\"construction-project:assign-beacons\", { count: beaconIds.length })\n }\n selectButtonTitle={(beaconIds) =>\n t(\"construction-project:assign-beacons-message\", {\n count: beaconIds.length,\n })\n }\n modalButton={modalButton}\n modalButtonIcon={modalButton ? undefined : }\n onBeaconsSelected={onAssignBeaconsToConstructionProject}\n />\n );\n}\n\ninterface AssignBeaconsModalOrganizationProps {\n organizationId: string;\n}\n\nexport function AssignBeaconsModalOrganization({\n organizationId,\n}: AssignBeaconsModalOrganizationProps) {\n const { t } = useTranslation();\n const assignBeaconsToOrganization = useAssignBeaconsToOrganization();\n const dataRefreshContext = useContext(DataRefreshContext);\n\n const beacons = useBeacons(false, undefined, undefined, undefined);\n\n const onAssignBeaconsToOrganization = async (beaconIds: string[]) => {\n await assignBeaconsToOrganization({ beaconIds, organizationId });\n dataRefreshContext.refresh();\n };\n\n return (\n \n t(\"organization:assign-beacons\", { count: beaconIds.length })\n }\n selectButtonTitle={(beaconIds) =>\n t(\"organization:assign-beacons-message\", { count: beaconIds.length })\n }\n modalButtonIcon={}\n onBeaconsSelected={onAssignBeaconsToOrganization}\n />\n );\n}\n","import { Button, Modal } from 'antd';\nimport { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { AllUsersTable } from './UserTable';\n\ninterface SelectUsersModalProps {\n modalButtonIcon?: React.ReactNode;\n title: string;\n selectButtonText(userIds: string[]): string;\n selectButtonTitle(userIds: string[]): string;\n assignedToOrganization?: boolean;\n onUsersSelected(userIds: string[]): Promise;\n}\n\nexport function SelectUsersModal(props: SelectUsersModalProps) {\n\n const { t } = useTranslation();\n const [isOpen, setIsOpen] = useState(false);\n const [isSelecting, setIsSelecting] = useState(false);\n const [selectedUserIds, setSelectedUserIds] = useState([]);\n\n const onSelect = async () => {\n setIsSelecting(true);\n try {\n await props.onUsersSelected(selectedUserIds);\n } catch {\n setIsSelecting(false);\n return;\n }\n setIsOpen(false);\n setIsSelecting(false);\n setSelectedUserIds([]);\n }\n\n const onCancel = () => {\n if (isSelecting) {\n return;\n }\n setIsOpen(false);\n setIsSelecting(false);\n setSelectedUserIds([]);\n }\n\n const modalFooter = [\n ,\n \n ];\n\n return <>\n \n \n \n \n ;\n}","import { useContext } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { PlusCircleOutlined } from '@ant-design/icons';\nimport { useAssignUsersToOrganization } from \"../../api\";\nimport { DataRefreshContext } from \"../../contexts/dataRefreshContext\";\nimport { SelectUsersModal } from \"../../components/SelectUsersModal\";\n\ninterface AssignUsersModalProps {\n organizationId: string;\n}\n\nexport function AssignUsersModal(props: AssignUsersModalProps) {\n const { organizationId } = props;\n const { t } = useTranslation();\n const assignUsersToOrganization = useAssignUsersToOrganization();\n const dataRefreshContext = useContext(DataRefreshContext);\n\n const onAssignUsersToOrganization = async (userIds: string[]) => {\n await assignUsersToOrganization({ userIds, organizationId });\n dataRefreshContext.refresh();\n }\n\n return t('organization:assign-users', { count: userIds.length })}\n selectButtonTitle={userIds => t('organization:assign-users-message', { count: userIds.length })}\n modalButtonIcon={}\n onUsersSelected={onAssignUsersToOrganization} />\n}","import { MinusCircleOutlined } from \"@ant-design/icons\";\nimport { Button } from \"antd\";\nimport { useContext, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n useAssignConstructionSite,\n useUnassignBeaconsFromOrganization,\n} from \"../../api\";\nimport { DataRefreshContext } from \"../../contexts/dataRefreshContext\";\nimport { Badge } from \"../Badge\";\n\ninterface UnassignBeaconsButtonSiteProps {\n constructionProjectId: string;\n selectedBeaconIds: string[];\n}\n\nexport function UnassignBeaconsButtonSite({\n selectedBeaconIds,\n constructionProjectId,\n}: UnassignBeaconsButtonSiteProps) {\n const [isUnassigning, setIsUnassigning] = useState(false);\n const unassignBeaconsFromSite = useAssignConstructionSite(\n constructionProjectId\n );\n const { t } = useTranslation();\n const dataRefreshContext = useContext(DataRefreshContext);\n\n const onUnassignBeaconsFromSite = async () => {\n try {\n setIsUnassigning(true);\n await unassignBeaconsFromSite({\n beaconIds: selectedBeaconIds,\n });\n dataRefreshContext.refresh();\n } finally {\n setIsUnassigning(false);\n }\n };\n\n return (\n <>\n \n \n \n {t(\"construction-site:unassign-beacons\", {\n count: selectedBeaconIds.length,\n })}\n \n \n \n );\n}\n\ninterface UnassignBeaconsButtonOrganizationProps {\n organizationId: string;\n selectedBeaconIds: string[];\n onClearSelectedBeaconIds(): void;\n}\n\nexport function UnassignBeaconsButtonOrganization({\n organizationId,\n selectedBeaconIds,\n onClearSelectedBeaconIds,\n}: UnassignBeaconsButtonOrganizationProps) {\n const [isUnassigning, setIsUnassigning] = useState(false);\n const unassignBeaconsFromOrganization = useUnassignBeaconsFromOrganization();\n const { t } = useTranslation();\n const dataRefreshContext = useContext(DataRefreshContext);\n\n const onUnassignBeaconsFromOrganization = async () => {\n try {\n setIsUnassigning(true);\n await unassignBeaconsFromOrganization({\n beaconIds: selectedBeaconIds,\n organizationId,\n });\n onClearSelectedBeaconIds();\n dataRefreshContext.refresh();\n } finally {\n setIsUnassigning(false);\n }\n };\n\n return (\n <>\n \n \n \n {t(\"organization:unassign-beacons\", {\n count: selectedBeaconIds.length,\n })}\n \n \n \n );\n}\n","import { AssignBeaconsModalOrganization } from \"../../components/beacon-configuration/AssignBeaconsModal\";\nimport { UnassignBeaconsButtonOrganization } from \"../../components/beacon-configuration/UnassignBeaconsButton\";\n\ninterface OrganizationBeaconTableFooterProps {\n organizationId: string;\n selectedBeaconIds: string[];\n onClearSelectedBeaconIds(): void;\n}\n\nexport function OrganizationBeaconTableFooter({\n organizationId,\n selectedBeaconIds,\n onClearSelectedBeaconIds,\n}: OrganizationBeaconTableFooterProps) {\n return (\n <>\n \n \n \n );\n}\n","import { useState } from \"react\";\nimport {\n BeaconTableColumns,\n BeaconTableSorting,\n useOrganizationBeacons,\n} from \"../../api\";\nimport { BeaconTableBase } from \"../../components/BeaconTableBase\";\nimport { OrganizationBeaconTableFooter } from \"./OrganizationBeaconTableFooter\";\n\ninterface OrganizationBeaconTableProps {\n organizationId: string;\n}\n\nconst useSorting = () => {\n const [sorting, setSorting] = useState({\n sortColumnId: undefined,\n sortOrderId: undefined,\n });\n\n const onSortingChange = (sorting: BeaconTableSorting) => {\n setSorting(sorting);\n };\n\n return { sorting, onSortingChange };\n};\n\nconst useSelectedBeacons = () => {\n const [selectedBeaconIds, setSelectedBeaconIds] = useState([]);\n\n const onSelect = (selectedRowKeys: string[]) => {\n setSelectedBeaconIds(selectedRowKeys);\n };\n\n const clearSelectedBeaconIds = () => {\n setSelectedBeaconIds([]);\n };\n\n return { selectedBeaconIds, onSelect, clearSelectedBeaconIds };\n}\n\n/*\n This component is used to display a table of beacons that belong to an organization.\n Component and file naming convention follows {screen}BeaconsTabkle.tsx. \n*/\nexport function OrganizationBeaconTable({\n organizationId,\n}: OrganizationBeaconTableProps) {\n const { sorting, onSortingChange } = useSorting();\n const { selectedBeaconIds, onSelect, clearSelectedBeaconIds } = useSelectedBeacons();\n const orgBeacons = useOrganizationBeacons(organizationId, sorting);\n\n return (\n \n }\n rowsSelectable={true}\n onSort={onSortingChange}\n onSelect={onSelect}\n />\n );\n}\n","import { useContext, useState } from \"react\";\nimport { Button } from 'antd';\nimport { MinusCircleOutlined } from '@ant-design/icons';\nimport { useUnassignUsersFromOrganization } from '../../api';\nimport { Badge } from '../../components/Badge';\nimport { useTranslation } from \"react-i18next\";\nimport { DataRefreshContext } from \"../../contexts/dataRefreshContext\";\nimport { AssignUsersModal } from \"./AssignUsersModal\";\n\ninterface OrganizationUserTableFooterProps {\n organizationId: string;\n selectedUserIds: string[];\n onClearSelectedUserIds(): void;\n}\n\nexport function OrganizationUserTableFooter(props: OrganizationUserTableFooterProps) {\n const { organizationId, selectedUserIds } = props;\n const [isUnassigning, setIsUnassigning] = useState(false);\n const unassignUsersFromOrganization = useUnassignUsersFromOrganization();\n const { t } = useTranslation();\n const dataRefreshContext = useContext(DataRefreshContext);\n\n const onUnassignUsersFromOrganization = async () => {\n try {\n setIsUnassigning(true);\n await unassignUsersFromOrganization({ userIds: selectedUserIds, organizationId });\n props.onClearSelectedUserIds();\n dataRefreshContext.refresh();\n } finally {\n setIsUnassigning(false);\n }\n };\n\n return <>\n \n \n {t('organization:unassign-users', { count: selectedUserIds.length })}\n \n \n\n \n ;\n}","import { useTranslation } from \"react-i18next\";\n\nexport function NoRole() {\n const { t } = useTranslation();\n return
\n
\n {t('no-role-header')}\n {t('no-role-message')}\n
\n
;\n}\n\nexport function NoOrganization() {\n const { t } = useTranslation();\n return
\n
\n {t('no-org-header')}\n {t('no-org-message')}\n
\n
;\n}","import { Button } from \"antd\";\nimport { useCallback } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport type BeaconTelemetryFilterValue = 'ShowAll' | 'GpsOnly' | 'AccurateCorrectedPosition' | 'LatestOnly';\n\ninterface BeaconTelemetryFilterProps {\n style?: React.CSSProperties;\n filter: BeaconTelemetryFilterValue;\n onFilterChanged(newFilter: BeaconTelemetryFilterValue): void;\n}\n\nexport function BeaconTelemetryFilter(props: BeaconTelemetryFilterProps) {\n\n const { filter, onFilterChanged } = props;\n const { t } = useTranslation();\n const showAccurate = useCallback(() => onFilterChanged('AccurateCorrectedPosition'), [onFilterChanged]);\n const showGpsOnly = useCallback(() => onFilterChanged('GpsOnly'), [onFilterChanged]);\n const showLatestOnly = useCallback(() => onFilterChanged('LatestOnly'), [onFilterChanged]);\n const showAll = useCallback(() => onFilterChanged('ShowAll'), [onFilterChanged]);\n\n return
\n \n \n \n \n
\n}","import { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\nimport { Beacon } from \"../../../api/models\";\n\nexport interface BeaconAboutCardProps {\n beacon: Beacon;\n}\n\nexport function BeaconAboutCard({ beacon }: BeaconAboutCardProps) {\n const history = useHistory();\n const { t } = useTranslation();\n\n function renderBeaconProperty(beacon: Beacon, property: keyof Beacon) {\n if (\n (property === \"constructionProjectName\" ||\n property === \"organizationName\" || property === \"constructionSiteName\") &&\n beacon[property] !== null\n ) {\n return beacon ? {beacon[property] || \"-\"} : <>Loading...;\n }\n return beacon ? <>{beacon[property] || \"-\"} : <>Loading...;\n }\n\n return (\n
\n
{t(\"beacon:about-this-device\")}
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n if (beacon.organizationName) {\n history.push(`/organizations/${beacon.organizationId}`);\n }\n }}\n >\n {renderBeaconProperty(beacon, \"organizationName\")}\n \n \n \n \n {\n if (beacon.constructionProjectName) {\n history.push(`/construction-projects`, {\n selectedId: beacon.constructionProjectId,\n });\n }\n }}\n >\n {renderBeaconProperty(beacon, \"constructionProjectName\")}\n \n \n \n \n {\n if (beacon.constructionProjectName) {\n history.push(`/construction-projects`, {\n selectedId: beacon.constructionSiteId,\n });\n }\n }}\n >\n {renderBeaconProperty(beacon, \"constructionSiteName\")}\n \n \n \n
\n {t(\"beacon:thing-name\")}\n \n {renderBeaconProperty(beacon, \"id\")}\n
ICCID\n {renderBeaconProperty(beacon, \"iccid\")}\n
\n {t(\"beacon:hardware-version\")}\n \n {renderBeaconProperty(beacon, \"hwv\")}\n
\n {t(\"beacon:firmware-version\")}\n \n {renderBeaconProperty(beacon, \"fwv\")}\n
\n {t(\"translations:organization\")}\n
\n {t(\"translations:construction-project\")}\n
\n {t(\"translations:construction-site\")}\n
\n
\n
\n
\n );\n}\n","import { FromToFilter } from \"../api\";\n\n/* \n Determines a date range based on the provided lastLoadedAt date and selectedFromToFilter.\n\n lastLoadedAt: This parameter is a Date object or undefined. It represents the last time some \n data was loaded.\n\n selectedFromToFilter: This parameter is of type FromToFilter. Based on the context, it can \n either be a number (representing seconds) or an object with from and to properties.\n*/\nexport const useComputeFromToDateRange = (\n lastLoadedAt: Date | undefined,\n selectedFromToFilter: FromToFilter\n) => {\n const from =\n typeof selectedFromToFilter === \"number\"\n ? new Date(\n (lastLoadedAt || new Date()).getTime() - selectedFromToFilter * 1000\n )\n : selectedFromToFilter.from;\n\n const to =\n typeof selectedFromToFilter === \"number\"\n ? lastLoadedAt || new Date()\n : selectedFromToFilter.to;\n\n return { from, to };\n};\n","import { Alert, Spin } from \"antd\";\nimport React, { useCallback, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Crosshair,\n DiscreteColorLegend,\n LineSeries,\n LineSeriesPoint,\n XAxis,\n XYPlot,\n YAxis,\n} from \"react-vis\";\nimport { maxBy, minBy, useDimension } from \"../util\";\nimport \"./Chart.css\";\n\nexport interface SeriesDefintion {\n value: (r: T) => number | undefined;\n title: string;\n}\n\ninterface HasMeasuredAtDate {\n measuredAt: Date;\n}\n\ninterface ChartProps {\n from: Date;\n to: Date;\n lastRefreshDone?: Date;\n loading: boolean;\n atDate?: Date;\n items: T[];\n series: SeriesDefintion[];\n mode?: \"showAllSeries\" | \"userSelectSeries\";\n onZoom?(from: Date, to: Date): void;\n}\n\nfunction toDate(\n offsetX: number,\n chartRef: React.MutableRefObject,\n from: Date,\n to: Date\n): Date {\n const g = chartRef.current.querySelector(\"g\");\n const leftMostX = g.transform.baseVal[0].matrix.e;\n const width = g.querySelector(\"line\").x2.baseVal.value;\n const relativeX = Math.max(0, Math.min(1, (offsetX - leftMostX) / width));\n return new Date(from.getTime() + (to.getTime() - from.getTime()) * relativeX);\n}\n\nexport function Chart(props: ChartProps) {\n const [crossHairValues, setCrossHairValues] = useState<\n { p: LineSeriesPoint | undefined }[]\n >(props.series.map((s) => ({ p: undefined })));\n const [selectedSeries, setSelectedSeries] = useState([0]);\n const mode = props.mode || \"showAllSeries\";\n const { t, i18n } = useTranslation();\n\n const chartRef = useRef();\n const chartDimensions = useDimension(chartRef);\n\n const [zoomFrom, setZoomFrom] = useState();\n const [zoomTo, setZoomTo] = useState();\n\n const onMouseLeave = useCallback(() => {\n setZoomFrom(undefined);\n setZoomTo(undefined);\n setCrossHairValues(props.series.map((s) => ({ p: undefined })));\n }, [setCrossHairValues, setZoomFrom, setZoomTo]);\n\n const onZoomStart = useCallback(\n (e: React.MouseEvent) => {\n setZoomFrom(e.nativeEvent.offsetX);\n setZoomTo(undefined);\n },\n [setZoomFrom]\n );\n\n const onZoomMove = useCallback(\n (e: React.MouseEvent) => {\n setZoomTo(e.nativeEvent.offsetX);\n },\n [setZoomTo]\n );\n\n const onZoomEnd = useCallback(\n (e: React.MouseEvent) => {\n if (zoomFrom === undefined || zoomTo === undefined) {\n return;\n }\n\n try {\n const left = Math.min(zoomFrom, zoomTo);\n const right = Math.max(zoomFrom, zoomTo);\n\n if (right - left > 10 && props.onZoom) {\n const from = toDate(left, chartRef, props.from, props.to);\n const to = toDate(right, chartRef, props.from, props.to);\n props.onZoom(from, to);\n }\n } finally {\n setZoomFrom(undefined);\n setZoomTo(undefined);\n }\n },\n [\n setZoomFrom,\n setZoomTo,\n chartRef,\n props.onZoom,\n props.from,\n props.to,\n zoomFrom,\n zoomTo,\n ]\n );\n\n if (!props.items || !props.items.length) {\n return props.loading ? (\n \n ) : (\n
\n \n
\n );\n }\n\n props.items.sort((a, b) => (a.measuredAt > b.measuredAt ? 1 : -1));\n\n const chv = crossHairValues\n .map((c, i) => ({ seriesIndex: i, point: c.p }))\n .filter((c) => !!c.point);\n\n let activeSeries = props.series;\n if (mode === \"userSelectSeries\") {\n activeSeries = selectedSeries.map((i) => props.series[i]);\n }\n\n let min = minBy(\n props.items,\n (r) => minBy(activeSeries, (s) => s.value(r))?.value\n )?.value;\n let max = maxBy(\n props.items,\n (r) => maxBy(activeSeries, (s) => s.value(r))?.value\n )?.value;\n\n if (min === undefined && max === undefined) {\n min = 0;\n max = 1;\n }\n\n const dataPoints = (s: SeriesDefintion) => {\n const p = props.items\n .filter((r) => {\n const v = s.value(r);\n return v !== undefined && v !== null;\n })\n .map((r) => ({ x: r.measuredAt as any, y: s.value(r)! }));\n\n if (p.length === 0) {\n p.push({ x: props.items[0].measuredAt as any, y: 0 });\n }\n return p;\n };\n\n const setCrossHair = (d: LineSeriesPoint, title: string) => {\n const index = props.series.findIndex((os) => os.title === title);\n crossHairValues[index].p = d;\n setCrossHairValues([...crossHairValues]);\n };\n\n return (\n \n {props.loading && }\n
\n
\n \n {activeSeries.map((s, i) => (\n setCrossHair(d, s.title)}\n />\n ))}\n {props.atDate && (\n \n )}\n \n \n `selected-${i}`).join(\" \")\n : \"\")\n }\n items={[{ title: t(\"battery-voltage\"), color: \"#439198\" }]}\n orientation=\"horizontal\"\n />\n {!!chv.length && (\n c.point)}>\n
\n

\n {t(\"date\")}:{\" \"}\n {(\n chv.find((p) => p?.point?.x)?.point?.x as any as Date\n ).toLocaleString(\n i18n.language === \"de\" ? \"en-GB\" : undefined\n )}\n

\n {chv.map((v) => (\n

\n {props.series[v.seriesIndex].title}:{\" \"}\n {v?.point?.y?.toLocaleString()}\n

\n ))}\n
\n
\n )}\n \n \n
\n
\n \n );\n}\n\nfunction ZoomOverlay(props: { from?: number; to?: number }) {\n if (!props.from || !props.to) {\n return <>;\n }\n\n return (\n \n );\n}\n","import React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { BeaconEnvironment } from '../api';\nimport { Button } from 'antd';\nimport { CsvColumn, useDownloadCsv } from '../util';\n\ninterface DownloadEnvironmentMessagesProps {\n style?: React.CSSProperties;\n beaconId: string;\n environmentMessages: BeaconEnvironment[];\n from: Date;\n to: Date;\n}\n\nconst columns: CsvColumn[] = [\n {\n title: 'BeaconId',\n value: (_p, _c, i) => i\n },\n {\n title: 'MeasuredAt',\n value: (p, c) => p.measuredAt.toLocaleString(c)\n },\n {\n title: 'Batt',\n value: (p, c) => p.value.batt.v.toLocaleString(c)\n },\n {\n title: 'IccId',\n value: (p, c) => p.value.cell.iccid\n }\n];\n\nexport function DownloadEnvironmentMessages(props: DownloadEnvironmentMessagesProps) {\n\n const { t } = useTranslation();\n const { environmentMessages, from, to, beaconId } = props;\n const download = useDownloadCsv(beaconId, environmentMessages, columns, `EnvironmentMessages_${beaconId}_${from.toISOString()}_${to.toISOString()}.csv`);\n\n return
\n \n
;\n}","import { CloseOutlined } from \"@ant-design/icons\";\nimport { Button, Drawer } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { Beacon, BeaconEnvironment } from \"../../../api\";\nimport { ApiState } from \"../../../api/useApiState\";\nimport { Chart, SeriesDefintion } from \"../../Chart\";\nimport { DownloadEnvironmentMessages } from \"../../DownloadEnvironmentMessages\";\n\ninterface BeaconBatteryDrawerProps {\n beaconId: Beacon[\"id\"];\n environmentHistory: ApiState;\n environmentFromToDateRange: {\n from: Date;\n to: Date;\n };\n environmentSeries: SeriesDefintion[];\n batteryDrawerVisible: boolean;\n onSelectCustomTimeFrame: (from: Date, to: Date) => void;\n onCloseDrawer: (visible: boolean) => void;\n}\n\nexport function BeaconBatteryDrawer({\n beaconId,\n environmentHistory,\n environmentFromToDateRange,\n environmentSeries,\n onSelectCustomTimeFrame,\n batteryDrawerVisible,\n onCloseDrawer,\n}: BeaconBatteryDrawerProps) {\n const { t } = useTranslation();\n\n const closeDrawer = () => {\n onCloseDrawer(false);\n };\n\n return (\n \n {t(\"battery-voltage\")}\n }\n onClick={closeDrawer}\n />\n \n }\n placement=\"right\"\n closable={false}\n onClose={closeDrawer}\n visible={batteryDrawerVisible}\n width={1200}\n >\n \n {!!environmentHistory.value?.length && (\n \n )}\n \n );\n}\n","import { PlusOutlined } from \"@ant-design/icons\";\nimport { Button } from \"antd\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n BeaconEnvironment,\n FromToFilter,\n useEnvironmentHistory,\n} from \"../../../api\";\nimport { useComputeFromToDateRange } from \"../../../util/useComputeFromToDateRange\";\nimport { Chart, SeriesDefintion } from \"../../Chart\";\nimport { DownloadEnvironmentMessages } from \"../../DownloadEnvironmentMessages\";\nimport { BeaconBatteryDrawer } from \"./BeaconBatteryDrawer\";\nimport { ApiState } from \"../../../api/useApiState\";\n\ninterface BeaconBatteryCardProps {\n beacon: Beacon;\n selectedFromToFilter:\n | (FromToFilter & number)\n | (FromToFilter & {\n from: Date;\n to: Date;\n });\n onSelectCustomTimeFrame: (from: Date, to: Date) => void;\n}\n\nexport function BeaconBatteryCard({\n beacon,\n selectedFromToFilter,\n onSelectCustomTimeFrame,\n}: BeaconBatteryCardProps) {\n const [batteryDrawerVisible, setBatteryDrawerVisible] = useState(false);\n\n const { t } = useTranslation();\n\n const handleDrawerOpenClose = (state: boolean) => {\n setBatteryDrawerVisible(state);\n };\n\n const environmentHistory = useEnvironmentHistory(\n undefined,\n beacon.serial,\n selectedFromToFilter,\n beacon.boardType\n );\n\n const environmentHistoryValue = environmentHistory.value as BeaconEnvironment[];\n\n const environmentFromToDateRange = useComputeFromToDateRange(\n environmentHistory.lastLoadedAt,\n selectedFromToFilter\n );\n\n const environmentSeries: SeriesDefintion[] = [\n { title: t(\"battery-voltage\"), value: (p) => p.value.batt.v },\n ];\n\n return (\n
\n
{t(\"battery-voltage\")}
\n
\n \n
\n {!!environmentHistoryValue?.length && (\n \n )}\n }\n environmentFromToDateRange={environmentFromToDateRange}\n environmentSeries={environmentSeries}\n onSelectCustomTimeFrame={onSelectCustomTimeFrame}\n batteryDrawerVisible={batteryDrawerVisible}\n onCloseDrawer={handleDrawerOpenClose}\n />\n handleDrawerOpenClose(true)}\n icon={}\n >\n
\n );\n}\n","import { Table, Tag } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { BeaconError, ErrorSeverity, useErrorTranslation } from \"../../../api\";\nimport { PagedApiState } from \"../../../api/useApiState\";\nimport { toAntdPagination } from \"../../../util\";\n\nexport enum BeaconErrorTableColumns {\n Status = \"status\",\n ErrorText = \"errorText\",\n Severity = \"severity\",\n CreatedAt = \"createdAt\",\n ErrorCode = \"errorCode\",\n AdditionalData = \"additionalData\",\n}\n\ninterface BeaconErrorTableProps {\n errorHistory: PagedApiState;\n visibleColumns: BeaconErrorTableColumns[];\n}\n\nexport function BeaconErrorTable({\n errorHistory,\n visibleColumns,\n}: BeaconErrorTableProps) {\n const { t } = useTranslation();\n const errorTranslation = useErrorTranslation();\n\n const columns = [\n {\n key: \"status\",\n title: t(\"error:active-state\"),\n width: \"auto\",\n render: (e: BeaconError) =>\n e.value.active ? (\n {t(\"error:active-state-active\")}\n ) : (\n {t(\"error:active-state-inactive\")}\n ),\n },\n {\n key: \"errorText\",\n title: t(\"error:text\"),\n width: \"auto\",\n render: (e: BeaconError) =>\n errorTranslation(e.value.code, e.value.severity, !e.value.active),\n },\n {\n key: \"severity\",\n title: t(\"error:severity\"),\n width: \"auto\",\n render: (e: BeaconError) =>\n e.value.severity === ErrorSeverity.Warning ? (\n {t(\"error:severity-warning\")}\n ) : (\n {t(\"error:severity-error\")}\n ),\n },\n {\n key: \"createdAt\",\n title: t(\"error:measured-at\"),\n render: (e: BeaconError) => e.measuredAt.toLocaleString(),\n },\n {\n key: \"errorCode\",\n title: t(\"error:code\"),\n width: \"auto\",\n render: (e: BeaconError) => e.value.code,\n },\n {\n key: \"additionalData\",\n title: t(\"error:data\"),\n render: (e: BeaconError) =>\n e.value.data ? JSON.stringify(e.value.data) : \"\",\n },\n ];\n\n /*\n Changing pattern for creating ant.design tables. Currently columns are defined in the \n return statement of a component. This is not a good practice as it makes the code harder\n to read and leads to messy nested logic to display certain columns based on certain conditions.\n\n This pattern is changed by defining the columns in a separate array and then filtering them \n based on the visibleColumns prop. This way the columns are defined in a single place and the\n logic to display certain columns is much cleaner.\n\n Recommended to update existing tables to this pattern.\n */\n const filteredColumns = columns.filter((column) =>\n visibleColumns.includes(column.key as BeaconErrorTableColumns)\n );\n\n return (\n \n );\n}\n","import { CheckCircleOutlined, CloseOutlined } from \"@ant-design/icons\";\nimport { Button, Card, Drawer } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n BeaconError,\n useActiveErrors,\n useErrorTranslation,\n} from \"../../../api\";\nimport { PagedApiState } from \"../../../api/useApiState\";\nimport \"../../../styles/card.scss\";\nimport { ActiveErrorsLabel } from \"../../BeaconActiveErrorsTooltip\";\nimport { BeaconErrorStatus } from \"../../BeaconErrorStatus\";\nimport { BeaconErrorTable, BeaconErrorTableColumns } from \"./BeaconErrorTable\";\n\ninterface BeaconErrorDrawerProps {\n beaconId: Beacon[\"id\"];\n errorHistory: PagedApiState;\n errorDrawerVisible: boolean;\n onCloseDrawer: (visible: boolean) => void;\n}\n\nexport function BeaconErrorDrawer({\n beaconId,\n errorHistory,\n errorDrawerVisible,\n onCloseDrawer,\n}: BeaconErrorDrawerProps) {\n const { t } = useTranslation();\n const errorTranslation = useErrorTranslation();\n\n const activeErrors = useActiveErrors(beaconId);\n const activeErrorCount = activeErrors?.value?.length || 0;\n\n const closeDrawer = () => {\n onCloseDrawer(false);\n };\n\n return (\n \n {t(\"beacon:error-details\")}\n }\n onClick={closeDrawer}\n />\n \n }\n placement=\"right\"\n closable={false}\n onClose={closeDrawer}\n visible={errorDrawerVisible}\n width={1200}\n >\n \n \n {activeErrorCount === 0 ? (\n
\n \n
{t(\"error:no-active-errors\")}
\n
\n ) : (\n
\n \n
\n \n
\n
\n )}\n
\n {activeErrorCount > 0 && (\n \n \n {activeErrors.value!.map((e) => (\n <>\n \n {errorTranslation(e.code, e.severity)}\n \n \n {t(\"error:active-since\", {\n since: e.startedAt.toLocaleString(),\n })}\n \n \n ))}\n \n \n )}\n \n
\n \n \n );\n}\n"," import { PlusOutlined } from \"@ant-design/icons\";\nimport { Button, Tabs } from \"antd\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Beacon, FromToFilter, useErrorHistory } from \"../../../api\";\nimport \"../../../styles/card.scss\";\nimport { BeaconErrorDrawer } from \"./BeaconErrorDrawer\";\nimport { BeaconErrorTable, BeaconErrorTableColumns } from \"./BeaconErrorTable\";\n\ninterface BeaconErrorCardProps {\n beacon: Beacon;\n selectedFromToFilter:\n | (FromToFilter & number)\n | (FromToFilter & {\n from: Date;\n to: Date;\n });\n} \n\nexport function BeaconErrorCard({\n beacon,\n selectedFromToFilter,\n}: BeaconErrorCardProps) {\n\n const [errorDrawerVisible, setErrorDrawerVisible] = useState(false);\n const { t } = useTranslation();\n const errorHistory = useErrorHistory(beacon.id, selectedFromToFilter);\n const handleDrawerOpenClose = (state: boolean) => {\n setErrorDrawerVisible(state);\n };\n return (\n
\n
{t(\"beacon:error-details\")}
\n \n \n \n \n \n \n handleDrawerOpenClose(true)}\n icon={}\n >\n
\n );\n}\n","import { Table, Tag } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { BeaconLifecycle, isOff, isOn, isMovement, isHeartbeat } from \"../../../api\";\nimport { PagedApiState } from \"../../../api/useApiState\";\nimport { toAntdPagination } from \"../../../util\";\n\ninterface BeaconEventTableProps {\n lifecycleHistory: PagedApiState;\n}\n\nexport function BeaconEventTable({ lifecycleHistory }: BeaconEventTableProps) {\n const { t } = useTranslation();\n\n return (\n \n (a.measuredAt?.getTime() || 0) - (b.measuredAt?.getTime() || 0),\n render: (measuredAt) =>\n measuredAt\n ? measuredAt.toLocaleString()\n : t(\"beacon:is-on-off-unknown\"),\n },\n {\n title: t(\"lifecycle:status\"),\n render: (e: BeaconLifecycle) =>\n isOn(e.value) ? (\n {t(\"beacon:is-on-off-on\")}\n ) : isOff(e.value) ? (\n {t(\"beacon:is-on-off-off\")}\n ) : isMovement(e.value) ? (\n {t(\"beacon:is-on-off-movement\")}\n ) : isHeartbeat(e.value) ? (\n {t(\"beacon:is-on-off-heartbeat\")}\n ) : (\n \n {t(\"beacon:is-on-off-unknown\")}\n \n ),\n },\n ]}\n pagination={toAntdPagination(lifecycleHistory, false)}\n >\n );\n}","import { CloseOutlined } from \"@ant-design/icons\";\nimport { Button, Drawer } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { BeaconLifecycle } from \"../../../api\";\nimport { PagedApiState } from \"../../../api/useApiState\";\nimport \"../../../styles/card.scss\";\nimport { BeaconEventTable } from \"./BeaconEventTable\";\n\ninterface BeaconEventDrawerProps {\n lifecycleHistory: PagedApiState;\n eventDrawerVisible: boolean;\n onCloseDrawer: (visible: boolean) => void;\n}\n\nexport function BeaconEventDrawer({\n lifecycleHistory,\n eventDrawerVisible,\n onCloseDrawer,\n}: BeaconEventDrawerProps) {\n const { t } = useTranslation();\n const closeDrawer = () => {\n onCloseDrawer(false);\n };\n\n return (\n \n {t(\"beacon:events\")}\n }\n onClick={closeDrawer}\n />\n \n }\n placement=\"right\"\n closable={false}\n onClose={closeDrawer}\n visible={eventDrawerVisible}\n width={1200}\n >\n \n \n );\n}\n","import { PlusOutlined } from \"@ant-design/icons\";\nimport { Button, Tabs } from \"antd\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Beacon, FromToFilter, useLifecycleHistory } from \"../../../api\";\nimport { BeaconEventDrawer } from \"./BeaconEventDrawer\";\nimport { BeaconEventTable } from \"./BeaconEventTable\";\n\ninterface BeaconEventCardProps {\n beacon: Beacon;\n selectedFromToFilter: FromToFilter & { from?: Date; to?: Date };\n}\n\nexport function BeaconEventCard({\n beacon,\n selectedFromToFilter,\n}: BeaconEventCardProps) {\n const [eventDrawerVisible, setEventDrawerVisible] = useState(false);\n const { t } = useTranslation();\n let idOrSerial = beacon.serial\n if (beacon.boardType === 1){\n idOrSerial = beacon.id\n }\n const lifecycleHistory = useLifecycleHistory(idOrSerial, selectedFromToFilter, beacon.boardType);\n\n const handleDrawerOpenClose = (state: boolean) => {\n setEventDrawerVisible(state);\n };\n\n return (\n
\n
{t(\"beacon:events\")}
\n \n \n \n \n \n \n handleDrawerOpenClose(true)}\n icon={}\n />\n
\n );\n}\n","import { Alert, Spin } from \"antd\";\nimport React, { useCallback, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Crosshair,\n DiscreteColorLegend,\n LineSeries,\n LineSeriesPoint,\n XAxis,\n XYPlot,\n YAxis,\n} from \"react-vis\";\nimport { maxBy, minBy, useDimension } from \"../util\";\nimport \"./Chart.css\";\nexport interface DualAxisSeriesDefintion {\n value: (r: T) => number | undefined;\n title: string;\n}\n\ninterface HasMeasuredAtDate {\n measuredAt: Date;\n}\n\ninterface ChartProps {\n from: Date;\n to: Date;\n lastRefreshDone?: Date;\n loading: boolean;\n atDate?: Date;\n items: T[];\n series: DualAxisSeriesDefintion[];\n mode?: \"showAllSeries\" | \"userSelectSeries\";\n onZoom?(from: Date, to: Date): void;\n}\n\nfunction toDate(\n offsetX: number,\n chartRef: React.MutableRefObject,\n from: Date,\n to: Date\n): Date {\n const g = chartRef.current.querySelector(\"g\");\n const leftMostX = g.transform.baseVal[0].matrix.e;\n const width = g.querySelector(\"line\").x2.baseVal.value;\n const relativeX = Math.max(0, Math.min(1, (offsetX - leftMostX) / width));\n return new Date(from.getTime() + (to.getTime() - from.getTime()) * relativeX);\n}\n\nexport function DualAxisLineChart(\n props: ChartProps\n) {\n const [crossHairValues, setCrossHairValues] = useState<\n { p: LineSeriesPoint | undefined }[]\n >(props.series.map((s) => ({ p: undefined })));\n const [selectedSeries, setSelectedSeries] = useState([0]);\n\n const mode = props.mode || \"showAllSeries\";\n const { t, i18n } = useTranslation();\n\n const chartRef = useRef();\n const chartDimensions = useDimension(chartRef);\n\n const [zoomFrom, setZoomFrom] = useState();\n const [zoomTo, setZoomTo] = useState();\n\n const onMouseLeave = useCallback(() => {\n setZoomFrom(undefined);\n setZoomTo(undefined);\n setCrossHairValues(props.series.map((s) => ({ p: undefined })));\n }, [setCrossHairValues, setZoomFrom, setZoomTo]);\n\n const onZoomStart = useCallback(\n (e: React.MouseEvent) => {\n setZoomFrom(e.nativeEvent.offsetX);\n setZoomTo(undefined);\n },\n [setZoomFrom]\n );\n\n const onZoomMove = useCallback(\n (e: React.MouseEvent) => {\n setZoomTo(e.nativeEvent.offsetX);\n },\n [setZoomTo]\n );\n\n const onZoomEnd = useCallback(\n (e: React.MouseEvent) => {\n if (zoomFrom === undefined || zoomTo === undefined) {\n return;\n }\n try {\n const left = Math.min(zoomFrom, zoomTo);\n const right = Math.max(zoomFrom, zoomTo);\n if (right - left > 10 && props.onZoom) {\n const from = toDate(left, chartRef, props.from, props.to);\n const to = toDate(right, chartRef, props.from, props.to);\n props.onZoom(from, to);\n }\n } finally {\n setZoomFrom(undefined);\n setZoomTo(undefined);\n }\n },\n [\n setZoomFrom,\n setZoomTo,\n chartRef,\n props.onZoom,\n props.from,\n props.to,\n zoomFrom,\n zoomTo,\n ]\n );\n if (!props.items || !props.items.length) {\n return props.loading ? (\n \n ) : (\n
\n \n
\n );\n }\n\n props.items.sort((a, b) => (a.measuredAt > b.measuredAt ? 1 : -1));\n const chv = crossHairValues\n .map((c, i) => ({ seriesIndex: i, point: c.p }))\n .filter((c) => !!c.point);\n\n let activeSeries = props.series;\n\n if (mode === \"userSelectSeries\") {\n activeSeries = selectedSeries.map((i) => props.series[i]);\n }\n\n let min = minBy(\n props.items,\n (r) => minBy(activeSeries, (s) => s.value(r))?.value\n )?.value;\n let max = maxBy(\n props.items,\n (r) => maxBy(activeSeries, (s) => s.value(r))?.value\n )?.value;\n\n if (min === undefined && max === undefined) {\n min = 0;\n max = 1;\n }\n\n const dataPoints = (s: DualAxisSeriesDefintion) => {\n const p = props.items\n .filter((r) => {\n const v = s.value(r);\n return v !== undefined && v !== null;\n })\n .map((r) => ({ x: r.measuredAt as any, y: s.value(r)! }));\n\n if (p.length === 0) {\n p.push({ x: props.items[0].measuredAt as any, y: 0 });\n }\n return p;\n };\n\n const setCrossHair = (d: LineSeriesPoint, title: string) => {\n const index = props.series.findIndex((os) => os.title === title);\n crossHairValues[index].p = d;\n setCrossHairValues([...crossHairValues]);\n };\n\n return (\n \n {props.loading && }\n
\n
\n \n {activeSeries.map((s, i) => {\n if (s.title !== \"HDOP\") {\n const lineColor = i === 0 ? \"#0b03fc\" : \"#03a9fc\";\n return (\n setCrossHair(d, s.title)}\n color={lineColor}\n />\n );\n }\n return null;\n })}\n \n \n \n \n
\n
\n \n {activeSeries.map((s, i) => {\n if (s.title === \"HDOP\") {\n return (\n setCrossHair(d, s.title)}\n />\n );\n }\n return null;\n })}\n \n \n \n `selected-${i}`).join(\" \")\n : \"\")\n }\n items={[\n { title: t(\"horizontal-accuracy\"), color: \"blue\" },\n { title: t(\"hdop\"), color: \"green\" },\n ]}\n orientation=\"horizontal\"\n />\n \n
\n
\n \n {activeSeries.map((s, i) => (\n setCrossHair(d, s.title)}\n />\n ))}\n {props.atDate && (\n \n )}\n {!!chv.length && (\n c.point)}>\n
\n

\n {t(\"date\")}:{\" \"}\n {new Date(\n chv.find((p) => p?.point?.x)?.point?.x as any\n ).toLocaleString(\n i18n.language === \"de\" ? \"en-GB\" : undefined\n )}\n

\n {chv.map((v) => (\n

\n {props.series[v.seriesIndex].title}:{\" \"}\n {v?.point?.y?.toLocaleString()}\n

\n ))}\n
\n
\n )}\n \n
\n
\n \n );\n}\n","import React from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { BeaconPosition } from '../api';\nimport { Button } from 'antd';\nimport { CsvColumn, useDownloadCsv } from '../util';\n\ninterface DownloadPositionsProps {\n style?: React.CSSProperties;\n beaconId: string;\n positions: BeaconPosition[];\n from: Date;\n to: Date;\n}\n\nconst columns: CsvColumn[] = [\n {\n title: 'BeaconId',\n value: (_p, _c, i) => i\n },\n {\n title: 'MeasuredAt',\n value: (p, c) => p.measuredAt.toLocaleString(c)\n },\n {\n title: 'Latitude',\n value: (p, c) => p.value.pos.lat.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'Longitude',\n value: (p, c) => p.value.pos.lon.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'Altitude',\n value: (p, c) => p.value.pos.alt.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'Horizontal Accuracy',\n value: (p, c) => p.value.md.hAcc.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'Vertical Accuracy',\n value: (p, c) => p.value.md.vAcc.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'Timestamp Accuracy',\n value: (p, c) => p.value.md.tAcc.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'HDOP',\n value: (p, c) => p.value.md.hDop.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'PDOP',\n value: (p, c) => p.value.md.pDop.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'VDOP',\n value: (p, c) => p.value.md.vDop.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'Satellites Used',\n value: (p, c) => p.value.md.satU.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'State Of Position',\n value: (p, c) => p.value.md.pst.toLocaleString(c, { maximumSignificantDigits: 20 })\n },\n {\n title: 'Carrier Phase Range Solution',\n value: (p, c) => p.value.md.cprs.toLocaleString(c, { maximumSignificantDigits: 20 })\n }\n];\n\nexport function DownloadPositions(props: DownloadPositionsProps) {\n\n const { t } = useTranslation();\n\n const { positions, from, to, beaconId } = props;\n const download = useDownloadCsv(beaconId, positions, columns, `BeaconPositions_${beaconId}_${from.toISOString()}_${to.toISOString()}.csv`);\n\n return
\n \n
;\n}","import { CloseOutlined } from \"@ant-design/icons\";\nimport { Button, Drawer } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { Beacon, BeaconPosition } from \"../../../api\";\nimport { ApiState } from \"../../../api/useApiState\";\nimport { SeriesDefintion } from \"../../Chart\";\nimport { DownloadPositions } from \"../../DownloadPositions\";\nimport { DualAxisLineChart } from \"../../MultiAxisChart\";\n\ninterface BeaconLocationDrawerProps {\n beaconId: Beacon[\"id\"];\n positions: BeaconPosition[];\n positionHistory: ApiState;\n positionSeries: SeriesDefintion[];\n locationDrawerVisible: boolean;\n positionFromToDateRange: {\n from: Date;\n to: Date;\n };\n onSelectCustomTimeFrame: (from: Date, to: Date) => void;\n onCloseDrawer: (visible: boolean) => void;\n}\n\nexport function BeaconLocationDrawer({\n beaconId,\n positions,\n positionHistory,\n positionSeries,\n locationDrawerVisible,\n positionFromToDateRange,\n onSelectCustomTimeFrame,\n onCloseDrawer,\n}: BeaconLocationDrawerProps) {\n const { t } = useTranslation();\n\n const closeDrawer = () => {\n onCloseDrawer(false);\n };\n\n return (\n \n {t(\"beacon:position-data\")}\n }\n onClick={closeDrawer}\n />\n \n }\n placement=\"right\"\n closable={false}\n onClose={closeDrawer}\n visible={locationDrawerVisible}\n width={1200}\n >\n index === 0 || index === 4)}\n from={positionFromToDateRange.from}\n to={positionFromToDateRange.to}\n />\n {!!positions.length && (\n \n )}\n \n );\n}\n","import { PlusOutlined } from \"@ant-design/icons\";\nimport { Button } from \"antd\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n BeaconPosition,\n FromToFilter,\n usePositionHistory,\n} from \"../../../api\";\nimport { DualAxisLineChart } from \"../../../components/MultiAxisChart\";\nimport { useComputeFromToDateRange } from \"../../../util/useComputeFromToDateRange\";\nimport { BeaconTelemetryFilterValue } from \"../../BeaconTelemetryFilter\";\nimport { SeriesDefintion } from \"../../Chart\";\nimport { DownloadPositions } from \"../../DownloadPositions\";\nimport { BeaconLocationDrawer } from \"./BeaconLocationDrawer\";\nimport { ApiState } from \"../../../api/useApiState\";\n\ninterface BeaconLocationCardProps {\n selectedFromToFilter:\n | (FromToFilter & number)\n | (FromToFilter & {\n from: Date;\n to: Date;\n });\n filter: BeaconTelemetryFilterValue;\n onSelectCustomTimeFrame: (from: Date, to: Date) => void;\n beacon: Beacon;\n}\n\nexport function BeaconLocationCard({\n selectedFromToFilter,\n onSelectCustomTimeFrame,\n filter,\n beacon,\n}: BeaconLocationCardProps) {\n const [locationBatteryVisible, setLocationBatteryVisible] = useState(false);\n\n const { t } = useTranslation();\n\n const handleDrawerOpenClose = (state: boolean) => {\n setLocationBatteryVisible(state);\n };\n\n let idOrSerial = beacon.serial\n if (beacon.boardType === 1){\n idOrSerial = beacon.id\n }\n\n const positionHistory = usePositionHistory(\n undefined,\n idOrSerial,\n selectedFromToFilter,\n beacon.boardType\n );\n\n const positionFromToDateRange = useComputeFromToDateRange(\n positionHistory.lastLoadedAt,\n selectedFromToFilter\n );\n\n let positionHistoryValue = positionHistory.value as BeaconPosition[];\n let positions: BeaconPosition[] = positionHistoryValue || [];\n if (filter === \"GpsOnly\") {\n positions = positions.filter((p) => p.value.md.pst === 1);\n } else if (filter === \"AccurateCorrectedPosition\") {\n positions = positions.filter((p) => p.value.md.pst === 3);\n }\n\n const positionSeries: SeriesDefintion[] = [\n { title: t(\"horizontal-accuracy\"), value: (p) => p.value.md.hAcc },\n { title: t(\"carrier-phase-range-solution\"), value: (p) => p.value.md.cprs },\n { title: t(\"vertical-accuracy\"), value: (p) => p.value.md.vAcc },\n { title: t(\"timestamp-accuracy\"), value: (p) => p.value.md.tAcc },\n { title: t(\"hdop\"), value: (p) => p.value.md.hDop },\n { title: t(\"pdop\"), value: (p) => p.value.md.pDop },\n { title: t(\"vdop\"), value: (p) => p.value.md.vDop },\n { title: t(\"satellites-used\"), value: (p) => p.value.md.satU },\n { title: t(\"state-of-position\"), value: (p) => p.value.md.pst },\n { title: t(\"latitude\"), value: (p) => p.value.pos.lat },\n { title: t(\"longitude\"), value: (p) => p.value.pos.lon },\n { title: t(\"altitude\"), value: (p) => p.value.pos.alt },\n ];\n\n return (\n
\n
{t(\"beacon:position-data\")}
\n
\n index === 0 || index === 4\n )}\n from={positionFromToDateRange.from}\n to={positionFromToDateRange.to}\n />\n
\n {!!positions.length && (\n \n )}\n }\n positionSeries={positionSeries}\n positionFromToDateRange={positionFromToDateRange}\n locationDrawerVisible={locationBatteryVisible}\n onSelectCustomTimeFrame={onSelectCustomTimeFrame}\n onCloseDrawer={handleDrawerOpenClose}\n />\n handleDrawerOpenClose(true)}\n icon={}\n >\n
\n );\n}\n","import { useTranslation } from \"react-i18next\";\nimport \"./Map.css\";\n\nexport enum LegendItem {\n Markers = \"Markers\",\n Polygons = \"Polygons\",\n}\n\ninterface BeaconMapLegendProps {\n legendItems: LegendItem[];\n style?: React.CSSProperties;\n}\n\nexport function BeaconMapLegend({ style, legendItems }: BeaconMapLegendProps) {\n const { t } = useTranslation();\n\n const legendItemsMarkers = [\n { color: \"green\", text: t(\"beacon:on-accurate-position\") },\n { color: \"orange\", text: t(\"beacon:on-inaccurate-position\") },\n { color: \"red\", text: t(\"beacon:on-error\") },\n { color: \"grey\", text: t(\"beacon:off\") },\n ];\n\n const legendItemsPolygons = [\n { color: \"#5A85EF\", text: t(\"translations:construction-project\") },\n { color: \"yellow\", text: t(\"translations:construction-site\") },\n ];\n\n return (\n \n {legendItems.includes(LegendItem.Markers) &&\n legendItemsMarkers.map((item, index) => (\n

\n {item.text}\n

\n ))}\n {legendItems.includes(LegendItem.Polygons) &&\n legendItemsPolygons.map((item, index) => (\n

\n {item.text}\n

\n ))}\n \n );\n}\n","import { CloseOutlined, InfoCircleOutlined } from \"@ant-design/icons\";\nimport { Button, Drawer } from \"antd\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n BeaconPosition,\n BeaconWithPosition,\n FromToFilter,\n} from \"../../../api\";\nimport { ApiState } from \"../../../api/useApiState\";\nimport { maxBy } from \"../../../util\";\nimport { BeaconTelemetryFilterValue } from \"../../BeaconTelemetryFilter\";\nimport { BeaconMapDetails } from \"./BeaconMapDetails\";\nimport { BeaconMapLegend, LegendItem } from \"../../map/BeaconMapLegend\";\nimport \"./Map.css\"\n\ninterface BeaconMapDrawerProps {\n positionHistory: ApiState;\n beacon: Beacon;\n selectedFromToFilter:\n | (FromToFilter & number)\n | (FromToFilter & {\n from: Date;\n to: Date;\n });\n filter: BeaconTelemetryFilterValue;\n positions: BeaconPosition[];\n mapDrawerVisible: boolean;\n onCloseDrawer: (visible: boolean) => void;\n}\n\nexport function BeaconMapDrawer({\n positionHistory,\n beacon,\n selectedFromToFilter,\n filter,\n positions,\n mapDrawerVisible,\n onCloseDrawer,\n}: BeaconMapDrawerProps) {\n const { t } = useTranslation();\n\n const [isMapInfoVisible, setIsMapInfoVisible] = useState(false);\n\n const newestPosition = maxBy(positionHistory.value || [], (p) =>\n p.measuredAt.getTime()\n )?.item;\n\n const latestPositionAsFallbackForMap =\n typeof selectedFromToFilter === \"number\"\n ? (beacon as BeaconWithPosition)?.position\n : undefined;\n\n const toggleMapInfo = (visible: boolean) => {\n setIsMapInfoVisible(visible);\n };\n\n const closeDrawer = () => {\n onCloseDrawer(false);\n };\n\n return (\n \n {t(\"beacon:position-map\")}\n
\n }\n onMouseEnter={() => toggleMapInfo(true)}\n onMouseLeave={() => toggleMapInfo(false)}\n />\n }\n onClick={closeDrawer}\n />\n {isMapInfoVisible && (\n \n )}\n
\n \n }\n placement=\"right\"\n closable={false}\n onClose={closeDrawer}\n visible={mapDrawerVisible}\n width={1200}\n >\n ({\n lat: p.value.pos.lat,\n lon: p.value.pos.lon,\n })),\n },\n ]\n }\n />\n \n );\n}\n","import { InfoCircleOutlined, PlusOutlined } from \"@ant-design/icons\";\nimport { Button } from \"antd\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Beacon,\n BeaconPosition,\n BeaconWithPosition,\n FromToFilter,\n usePositionHistory,\n} from \"../../../api\";\nimport { maxBy } from \"../../../util\";\nimport { BeaconTelemetryFilterValue } from \"../../BeaconTelemetryFilter\";\nimport { BeaconMapDetails } from \"./BeaconMapDetails\";\nimport { BeaconMapDrawer } from \"./BeaconMapDrawer\";\nimport { BeaconMapLegend, LegendItem } from \"../../map/BeaconMapLegend\";\nimport \"./Map.css\";\nimport { ApiState } from \"../../../api/useApiState\";\n\nexport interface BeaconMapCardProps {\n beacon: Beacon;\n selectedFromToFilter:\n | (FromToFilter & number)\n | (FromToFilter & {\n from: Date;\n to: Date;\n });\n filter: BeaconTelemetryFilterValue;\n}\n\nexport function BeaconMapCard({\n beacon,\n selectedFromToFilter,\n filter,\n}: BeaconMapCardProps) {\n const [mapDrawerVisible, setMapDrawerVisible] = useState(false);\n const { t } = useTranslation();\n const [isMapInfoVisible, setIsMapInfoVisible] = useState(false);\n\n let idOrSerial = beacon.serial\n if (beacon.boardType === 1){\n idOrSerial = beacon.id\n }\n\n const positionHistory = usePositionHistory(\n undefined,\n idOrSerial,\n selectedFromToFilter,\n beacon.boardType\n );\n\n let posHistory = positionHistory.value as BeaconPosition[];\n let positions = posHistory || [];\n positions = positions.filter((p) => {\n if (filter === \"GpsOnly\") return p.value.md.pst === 1;\n if (filter === \"AccurateCorrectedPosition\") return p.value.md.pst === 3;\n return true;\n });\n\n const newestPosition = maxBy(posHistory || [], (p) =>\n p.measuredAt.getTime()\n )?.item;\n\n const latestPositionAsFallbackForMap =\n typeof selectedFromToFilter === \"number\"\n ? (beacon as BeaconWithPosition)?.position\n : undefined;\n\n const toggleMapInfo = (state: boolean) => {\n setIsMapInfoVisible(state);\n };\n\n const toggleDrawer = (state: boolean) => {\n setMapDrawerVisible(state);\n };\n\n return (\n
\n
{t(\"beacon:position-map\")}
\n
\n ({\n lat: p.value.pos.lat,\n lon: p.value.pos.lon,\n })),\n },\n ]\n }\n />\n
\n }\n beacon={beacon}\n selectedFromToFilter={selectedFromToFilter}\n filter={filter}\n positions={positions}\n mapDrawerVisible={mapDrawerVisible}\n onCloseDrawer={toggleDrawer}\n />\n
\n toggleMapInfo(true)}\n onMouseLeave={() => toggleMapInfo(false)}\n icon={}\n />\n toggleDrawer(true)}\n icon={}\n >\n {isMapInfoVisible && (\n \n )}\n
\n
\n );\n}\n","import { Beacon } from \"../../api\";\nimport { useSetting } from \"../../util\";\nimport {\n BeaconTelemetryFilter,\n BeaconTelemetryFilterValue,\n} from \"../BeaconTelemetryFilter\";\nimport {\n TimeRangeSelection,\n useTimeRangeSelection,\n} from \"../TimeRangeSelection\";\nimport { BeaconAboutCard } from \"./about/BeaconAboutCard\";\nimport { BeaconBatteryCard } from \"./battery/BeaconBatteryCard\";\nimport { BeaconErrorCard } from \"./error/BeaconErrorCard\";\nimport { BeaconEventCard } from \"./event/BeaconEventCard\";\nimport { BeaconLocationCard } from \"./location/BeaconLocationCard\";\nimport { BeaconMapCard } from \"./map/BeaconMapCard\";\n\ninterface BeaconProps {\n constructionProjectId?: string;\n beacon: Beacon;\n breadcrumb: React.ReactElement;\n}\n\nexport function BeaconDetails({ beacon, breadcrumb }: BeaconProps) {\n const [filter, setFilter] = useSetting(\n \"beacon:telemetry-filter\",\n \"ShowAll\"\n );\n\n const {\n selectedFromToFilter,\n fromToFilterOptions,\n selectedFromToFilterOptionIndex,\n onSelectFilterOption,\n onSelectCustomTimeFrame,\n } = useTimeRangeSelection(beacon.id);\n\n return (\n
\n
\n
{breadcrumb}
\n
\n \n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n
\n
\n );\n}\n","import { createContext, ReactNode, useContext, useState } from \"react\";\n\ninterface NodeSelectedContextType {\n selectedNode: NodeContextData;\n nodeVisitiblyDisabledList: string[];\n setSelectedNode: (node: NodeContextData) => void;\n setNodeVisitiblyDisabledList: (node: string[]) => void;\n}\n\nexport interface NodeContextData {\n selectedSiteId?: string;\n selectedSiteName?: string;\n selectedProjectId?: string;\n selectedProjectName?: string;\n selectedId?: string;\n projectDrawerVisible?: boolean;\n siteDrawerVisible?: boolean;\n}\n\nexport const defaultSelectedNode: NodeContextData = {\n selectedSiteId: \"\",\n selectedSiteName: \"\",\n selectedProjectId: \"\",\n selectedProjectName: \"\",\n selectedId: \"\",\n projectDrawerVisible: false,\n siteDrawerVisible: false,\n};\n\nconst defaultContextValue: NodeSelectedContextType = {\n selectedNode: defaultSelectedNode,\n nodeVisitiblyDisabledList: [],\n setSelectedNode: () => {},\n setNodeVisitiblyDisabledList: () => {},\n};\n\nconst NodeSelectedContext =\n createContext(defaultContextValue);\n\nexport const useNodeSelectedContext = () => useContext(NodeSelectedContext);\n\nexport const NodeSelectedProvider = ({ children }: { children: ReactNode }) => {\n const [selectedNode, setSelectedNode] =\n useState(defaultSelectedNode);\n\n const [nodeVisitiblyDisabledList, setNodeVisitiblyDisabledList] = useState<\n string[]\n >([]);\n\n return (\n \n {children}\n \n );\n};\n","import { InfoCircleOutlined } from \"@ant-design/icons\";\nimport { Button } from \"antd\";\nimport { useState } from \"react\";\nimport { BeaconMapLegend, LegendItem } from \"./BeaconMapLegend\";\n\ninterface MapLegendButtonProps {\n legendStyle?: React.CSSProperties;\n buttonStyle?: React.CSSProperties;\n}\n\nconst mapLegendStyle = {\n position: \"absolute\" as \"absolute\",\n right: \"10px\",\n margin: \"10px\",\n zIndex: 1000,\n};\n\nexport function MapLegendButton({\n legendStyle,\n buttonStyle,\n}: MapLegendButtonProps) {\n const [isMapInfoVisible, setIsMapInfoVisible] = useState(false);\n\n const toggleMapInfo = (state: boolean) => {\n setIsMapInfoVisible(state);\n };\n\n return (\n <>\n
\n toggleMapInfo(true)}\n onMouseLeave={() => toggleMapInfo(false)}\n icon={}\n />\n {isMapInfoVisible && (\n \n )}\n
\n \n );\n}\n","import { Beacon, ConstructionProject, ConstructionSite } from \"../../../api\";\nimport { Map } from \"../../../components/map/Map\";\nimport { useNodeSelectedContext } from \"../NodeSelectedContext\";\nimport {\n getPolygonsProjects,\n getPolygonsSites,\n getPolylinesSites,\n transformBeaconsToMarkers,\n} from \"../../../components/map/mapUtils\";\nimport { useMemo } from \"react\";\nimport { MapLegendButton } from \"../../../components/map/MapLegendButton\";\n\ninterface ConstructionProjectMapProps {\n beacons: Beacon[] | undefined;\n constructionSites: ConstructionSite[] | undefined;\n constructionProjects: ConstructionProject[] | undefined;\n isLoading: boolean;\n}\n\nexport function ConstructionProjectMap({\n beacons,\n constructionSites,\n constructionProjects,\n isLoading,\n}: ConstructionProjectMapProps) {\n const { nodeVisitiblyDisabledList, setSelectedNode } =\n useNodeSelectedContext();\n\n const markers = transformBeaconsToMarkers(beacons, setSelectedNode);\n\n const filteredMarkers = useMemo(\n () =>\n markers.filter(\n (marker) => !nodeVisitiblyDisabledList.includes(marker.title)\n ),\n [markers, nodeVisitiblyDisabledList]\n );\n\n const filteredConstructionSites =\n constructionSites?.filter(\n (site) => site && !nodeVisitiblyDisabledList.includes(site.id)\n ) || [];\n\n const filteredConstructionProjects =\n constructionProjects?.filter(\n (project) => project && !nodeVisitiblyDisabledList.includes(project.id)\n ) || [];\n\n const combinedPolygons = [\n ...getPolygonsProjects(\n filteredConstructionProjects,\n \"#4C86F7\",\n setSelectedNode\n ),\n ...getPolygonsSites(filteredConstructionSites, \"yellow\", setSelectedNode),\n ];\n const polylines = getPolylinesSites(\n beacons,\n filteredConstructionSites,\n \"yellow\",\n 3,\n setSelectedNode\n );\n\n return (\n <>\n \n setSelectedNode({ selectedId: \"\" })}\n />\n \n );\n}\n","import { DataNode } from \"antd/lib/tree\";\nimport { Beacon } from \"../../../api\";\n\nexport interface TreeNode extends DataNode {\n title: TreeTitle;\n id: string;\n key: string;\n icon?: React.ReactNode;\n displayVisibility?: boolean;\n children?: TreeNode[];\n}\n\nexport interface TreeTitle {\n title: string;\n data: Beacon;\n}\n\nexport const filteredNodes = (\n node: TreeNode[],\n search: string | null\n): [TreeNode[], string[]] => {\n if (!node || !Array.isArray(node)) return [[], []];\n\n let filteredNodesKey: string[] = [];\n\n node.forEach((node) => {\n if (\n !search ||\n node.title?.title.toString().toLowerCase().includes(search.toLowerCase())\n ) {\n if (node.children && Array.isArray(node.children)) {\n filteredNodesKey = [\n ...filteredNodesKey,\n node.key,\n ...filteredNodes(node.children, null)[1],\n ];\n } else {\n filteredNodesKey = [...filteredNodesKey, node.key];\n }\n } else {\n if (node.children && Array.isArray(node.children)) {\n let children = filteredNodes(node.children, search);\n if (children[0].length != 0) {\n filteredNodesKey = [...filteredNodesKey, node.key, ...children[1]];\n }\n }\n }\n });\n\n const filteredNodeData = filterTreeDataByKeys(node, filteredNodesKey);\n\n return [filteredNodeData, filteredNodesKey];\n};\n\nexport const transformToTreeData = (\n data: Beacon[] | undefined,\n isSolutionOperator: boolean\n) => {\n if (data === undefined) return;\n\n const buildTree = (\n items: Beacon[],\n groupByKeys: (keyof Beacon)[]\n ): TreeNode[] => {\n if (!groupByKeys.length) return [];\n\n const [currentKey, ...remainingKeys] = groupByKeys;\n const group: { [key: string]: Beacon[] } = {};\n const nullKey = Math.random().toString(16).slice(2);\n\n items.forEach((item: Beacon) => {\n const key = String(item[currentKey as keyof Beacon] ?? nullKey);\n\n if (!group[key]) {\n group[key] = [];\n }\n group[key].push(item);\n });\n\n return Object.entries(group).map(([key, groupedItems]) => {\n const firstItem = groupedItems[0];\n\n const currentKeyName = (): keyof Beacon => {\n if (currentKey === \"serial\") return currentKey;\n else return currentKey.replace(\"Id\", \"Name\") as keyof Beacon;\n };\n\n const visibility =\n groupedItems.filter((item) => item.onOffSwitch?.isOn === true).length >\n 0;\n\n const title = (key: string) => {\n return {\n title:\n key === nullKey\n ? \"Unassigned\"\n : String(firstItem[currentKeyName()]),\n data: firstItem,\n };\n };\n return {\n title: title(key),\n key,\n id: currentKeyName(),\n icon: <>,\n children: buildTree(groupedItems, remainingKeys),\n displayVisibility: visibility,\n };\n });\n };\n\n // Define the grouping hierarchy\n const groupingKeys: (keyof Beacon)[] = [\n \"organizationId\",\n \"constructionProjectId\",\n \"constructionSiteId\",\n \"serial\",\n ];\n const transformedData = buildTree(data, groupingKeys);\n\n // If the user is a Solution Operator, return the top-level node (all data including organization)\n // Otherwise, return the children of the top-level node (all data excluding organization)\n return isSolutionOperator\n ? transformedData\n : transformedData.flatMap((node: TreeNode) => node.children || []);\n};\n\nexport const filterTreeDataByKeys = (\n data: TreeNode[],\n keys: string[]\n): TreeNode[] => {\n const keySet = new Set(keys);\n\n const filterNodes = (nodes: TreeNode[]): TreeNode[] => {\n return nodes\n .map((node) => {\n if (keySet.has(node.key)) {\n const filteredChildren = node.children\n ? filterNodes(node.children)\n : [];\n return {\n ...node,\n children: filteredChildren.length ? filteredChildren : undefined,\n };\n }\n return null;\n })\n .filter((node) => node !== null) as TreeNode[];\n };\n\n return filterNodes(data);\n};\n\nexport const getAllKeys = (treeData: TreeNode[] | undefined): string[] => {\n if (!treeData) {\n return [];\n }\n const keys: string[] = [];\n\n const traverse = (nodes: TreeNode[]) => {\n nodes.forEach((node) => {\n if (node.key) {\n keys.push(node.key);\n }\n if (node.children) {\n traverse(node.children);\n }\n });\n };\n\n traverse(treeData);\n\n return keys;\n};\n\nexport const getChildKeys = (node: TreeNode | undefined): string[] => {\n if (!node) return [];\n\n const keys: string[] = [node.key];\n\n const traverse = (nodes: TreeNode[]) => {\n nodes.forEach((childNode) => {\n if (childNode.key) {\n keys.push(childNode.key);\n }\n if (childNode.children) {\n traverse(childNode.children);\n }\n });\n };\n\n if (node.children) {\n traverse(node.children);\n }\n\n return keys;\n};\n\nexport const getParentKeys = (key: string, tree: TreeNode[]): string[] => {\n const parentKeys: string[] = [];\n\n const traverse = (nodes: TreeNode[], parent: string | undefined) => {\n nodes.forEach((node) => {\n if (node.key === key) {\n if (parent) {\n parentKeys.push(parent);\n parentKeys.push(...getParentKeys(parent, tree));\n }\n }\n if (node.children) {\n traverse(node.children, node.key);\n }\n });\n };\n\n traverse(tree, undefined);\n\n return parentKeys;\n};\n\nexport const findNode = (\n nodes: TreeNode[],\n key: string\n): TreeNode | undefined => {\n for (const node of nodes) {\n if (node.key === key) {\n return node;\n }\n if (node.children) {\n const foundNode = findNode(node.children, key);\n if (foundNode) {\n return foundNode;\n }\n }\n }\n return undefined;\n};\n","type CSSWidth =\n | `${number}px`\n | `${number}em`\n | `${number}rem`\n | `${number}%`\n | \"auto\";\n\ninterface TruncatedLongTextProps {\n text: string;\n maxLength: CSSWidth;\n id?: string;\n onClick?: (id: string) => void;\n}\n\nexport function TruncatedLongText({ text, maxLength, id, onClick }: TruncatedLongTextProps) {\n return (\n onClick && onClick(id) : undefined}\n >\n {text}\n \n );\n}\n","import {\n BorderInnerOutlined,\n BorderOuterOutlined,\n EnvironmentOutlined,\n EyeInvisibleOutlined,\n EyeOutlined,\n InfoCircleOutlined,\n MinusSquareOutlined,\n PlusSquareOutlined,\n TeamOutlined,\n} from \"@ant-design/icons\";\nimport { useState } from \"react\";\nimport \"./../../../styles/typography/icons.scss\";\nimport { TreeNode } from \"./treeUtils\";\n\ninterface IconTreeProps {\n data: TreeNode | undefined;\n id: string;\n handleIconClick: (node: TreeNode | undefined, action: string) => void;\n}\n\ninterface IconTreePropsWithState extends IconTreeProps {\n disabled: boolean;\n}\n\nexport const BeaconIcon = () => ;\nexport const ProjectIcon = () => ;\nexport const SiteIcon = () => ;\nexport const OrganizationIcon = () => ;\nexport const EmptyIcon = () => (\n \n);\n\nconst IconWrapper = ({\n IconComponent,\n ariaLabel,\n className,\n onClick,\n}: {\n IconComponent: React.ComponentType;\n ariaLabel: string;\n className?: string;\n onClick: React.MouseEventHandler;\n}) => (\n \n);\n\nexport const InfoIcon = ({ data, id, handleIconClick }: IconTreeProps) => (\n handleIconClick(data, id)}\n />\n);\n\nconst EyeIconBase = ({\n IconComponent,\n ariaLabel,\n className,\n onClick,\n}: {\n IconComponent: React.ComponentType;\n ariaLabel: string;\n className?: string;\n onClick: React.MouseEventHandler;\n}) => (\n \n);\n\nexport const EyeIcon = ({\n data,\n id,\n disabled,\n handleIconClick,\n}: IconTreePropsWithState) => (\n {\n if (data) handleIconClick(data, disabled ? id : `${id}-disabled`);\n }}\n />\n);\n\nexport const EyeIconAll = ({\n data,\n id,\n disabled,\n handleIconClick,\n}: IconTreePropsWithState) => {\n const [isVisible, setIsVisible] = useState(true);\n\n if (disabled) return ;\n\n return (\n {\n handleIconClick(data, isVisible ? `${id}-disabled` : id);\n setIsVisible(!isVisible);\n }}\n />\n );\n};\n\nexport const ExpandIcon = ({\n data,\n id,\n disabled,\n handleIconClick,\n}: IconTreePropsWithState) => {\n const [isExpanded, setIsExpanded] = useState(false);\n\n if (disabled) return ;\n\n return (\n {\n handleIconClick(data, isExpanded ? `${id}-disabled` : id);\n setIsExpanded(!isExpanded);\n }}\n />\n );\n};\n","import { SearchOutlined } from \"@ant-design/icons\";\nimport { Input, Spin } from \"antd\";\nimport Tree from \"antd/lib/tree\";\nimport React, { useContext, useEffect, useMemo, useState, memo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\nimport { Beacon } from \"../../../api\";\nimport { BeaconStatus } from \"../../../components/BeaconStatus\";\nimport { AuthContext } from \"../../../contexts/authContext\";\nimport { useNodeSelectedContext } from \"../NodeSelectedContext\";\nimport {\n TreeNode,\n filteredNodes,\n findNode,\n getAllKeys,\n getChildKeys,\n getParentKeys,\n transformToTreeData,\n} from \"../project-tree/treeUtils\";\nimport \"./../../../styles/typography/icons.scss\";\nimport { TruncatedLongText } from \"./../../../util/TruncateLongText\";\nimport {\n BeaconIcon,\n ExpandIcon,\n EyeIcon,\n EyeIconAll,\n InfoIcon,\n OrganizationIcon,\n ProjectIcon,\n SiteIcon,\n EmptyIcon,\n} from \"./ConstructionProjectIcons\";\nimport \"./tree.scss\";\n\ninterface ConstructionProjectTreeProps {\n beacons: Beacon[] | undefined;\n isLoading: boolean;\n defaultIdExpanded: string;\n}\n\nconst { DirectoryTree } = Tree;\n\nconst RenderTitle = ({\n node,\n defaultIdExpanded = \"\",\n nodeVisitiblyDisabledList = [],\n handleIconClick = () => {},\n handleTitleClick = () => {},\n}: RenderTitleProps) => {\n const { t } = useTranslation();\n const history = useHistory();\n\n const isOrganization = node.id === \"organizationName\";\n const isConstructionProject = node.id === \"constructionProjectName\";\n const isConstructionSite = node.id === \"constructionSiteName\";\n const isSerail = node.id === \"serial\";\n\n const renderSerial = (node: TreeNode) => {\n return (\n history.push(`/beacons/${node.title.data.serial}`)}\n className=\"title-line-serial\"\n >\n \n {node.title.title}\n \n \n \n );\n };\n\n return (\n
e.stopPropagation()} className=\"title-container\">\n {isOrganization ? (\n \n \n \n \n ) : isConstructionProject ? (\n \n \n \n \n ) : isConstructionSite ? (\n \n \n \n \n ) : (\n
\n \n {renderSerial(node)}\n
\n )}\n \n {/* \n Need to account for beacons that do not have sites assigned\n If no site is assigned, do not show the info icon\n */}\n {isSerail || isOrganization ? null : node.title.title ===\n \"Unassigned\" ? null : (\n \n )}\n {node.displayVisibility ? (\n \n ) : (\n \n )}\n \n
\n );\n};\n\nconst MemoizedRenderTitle = memo(RenderTitle);\n\nexport function ConstructionProjectTree({\n beacons,\n isLoading,\n defaultIdExpanded,\n}: ConstructionProjectTreeProps) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [expandedKeys, setExpandedKeys] = useState([]);\n const [savedExpandedKeys, setSavedExpandedKeys] = useState([]);\n\n const authContext = useContext(AuthContext);\n const isSolutionOperator =\n authContext.currentUser?.accessToken?.hasRole(\"solution-operator\") ?? false;\n\n const {\n nodeVisitiblyDisabledList,\n setSelectedNode,\n setNodeVisitiblyDisabledList,\n } = useNodeSelectedContext();\n\n const treeData = useMemo(() => {\n return transformToTreeData(beacons, isSolutionOperator);\n }, [beacons, isSolutionOperator]);\n\n const [filteredNodeData, filteredNodeKeys] = useMemo(() => {\n if (!treeData) return [[], []];\n else return filteredNodes(treeData, searchTerm);\n }, [treeData, searchTerm]);\n\n /*\n When user clicks on a marker or polygon, expand that node on load\n */\n useEffect(() => {\n if (defaultIdExpanded && treeData) {\n const targetNode = findNode(treeData, defaultIdExpanded);\n const expandedKeys = getChildKeys(targetNode);\n const parentKeys = getParentKeys(defaultIdExpanded, treeData);\n const allExpandedKeys = [...expandedKeys, ...parentKeys];\n setExpandedKeys(allExpandedKeys);\n }\n }, [defaultIdExpanded]);\n\n /*\n When coming from a user clicking on a project from a different page (beacons, beacon details), expand that node on load\n make other nodes not visible\n */\n useEffect(() => {\n if (defaultIdExpanded && treeData) {\n const targetNode = findNode(treeData, defaultIdExpanded);\n const expandedKeys = getChildKeys(targetNode);\n const parentKeys = getParentKeys(defaultIdExpanded, treeData);\n\n if (parentKeys) {\n const allExpandedKeys = [...expandedKeys, ...parentKeys];\n setExpandedKeys(allExpandedKeys);\n\n const filteredExpandedKeys = getAllKeys(treeData).filter(\n (key) => !allExpandedKeys.includes(key)\n );\n\n setNodeVisitiblyDisabledList(filteredExpandedKeys);\n } else {\n setExpandedKeys(expandedKeys);\n\n const filteredExpandedKeys = getAllKeys(treeData).filter(\n (key) => !expandedKeys.includes(key)\n );\n\n setNodeVisitiblyDisabledList(filteredExpandedKeys);\n }\n }\n }, [treeData]);\n\n useMemo(() => {\n if (searchTerm !== \"\") {\n setExpandedKeys(filteredNodeKeys);\n } else {\n setExpandedKeys(savedExpandedKeys);\n }\n }, [searchTerm]);\n\n useMemo(() => {\n if (searchTerm === \"\") {\n setSavedExpandedKeys(expandedKeys);\n }\n }, [expandedKeys]);\n\n const handleTitleClick = (id: string) => {\n if (id && treeData) {\n const targetNode = findNode(treeData, id);\n const expandedKeys = getChildKeys(targetNode);\n const parentKeys = getParentKeys(id, treeData);\n const allExpandedKeys = [...expandedKeys, ...parentKeys];\n const filteredExpandedKeys = getAllKeys(treeData).filter(\n (key) => !allExpandedKeys.includes(key)\n );\n setNodeVisitiblyDisabledList(filteredExpandedKeys);\n setExpandedKeys(allExpandedKeys);\n }\n };\n\n const handleIconClick = (node: TreeNode | undefined, action: string) => {\n switch (action) {\n case \"info\":\n if (node?.id === \"constructionSiteName\") {\n setSelectedNode({\n siteDrawerVisible: true,\n selectedSiteId: node?.title.data.constructionSiteId,\n selectedProjectId: node?.title?.data.constructionProjectId,\n selectedProjectName: node?.title?.data.constructionProjectName,\n });\n } else if (node?.id === \"constructionProjectName\") {\n setSelectedNode({\n projectDrawerVisible: true,\n siteDrawerVisible: false,\n selectedProjectId: node?.title?.data.constructionProjectId,\n });\n } else {\n setSelectedNode({\n siteDrawerVisible: false,\n projectDrawerVisible: false,\n });\n }\n break;\n case \"visible-single\":\n setNodeVisitiblyDisabledList(\n nodeVisitiblyDisabledList.filter(\n (key) => !getChildKeys(node).includes(key)\n )\n );\n break;\n case \"visible-single-disabled\":\n setNodeVisitiblyDisabledList([\n ...nodeVisitiblyDisabledList,\n ...(getChildKeys(node) ?? \"\"),\n ]);\n break;\n case \"visible-all\":\n setNodeVisitiblyDisabledList([]);\n break;\n case \"visible-all-disabled\":\n setNodeVisitiblyDisabledList(getAllKeys(treeData));\n break;\n case \"expand-all\":\n setExpandedKeys(getAllKeys(treeData));\n break;\n case \"expand-all-disabled\":\n setExpandedKeys([]);\n break;\n default:\n break;\n }\n };\n\n return (\n <>\n
\n \n \n
\n
\n {isLoading ? (\n \n ) : (\n (\n \n )}\n expandedKeys={expandedKeys}\n onExpand={(keys) => setExpandedKeys(keys)}\n treeData={treeData && treeData.length > 0 ? filteredNodeData : []}\n style={{ padding: \".25em\" }}\n />\n )}\n
\n \n );\n}\n\ninterface SearchBarProps {\n searchTerm: string;\n setSearchTerm: (term: string) => void;\n}\n\nconst SearchBar: React.FC = ({ searchTerm, setSearchTerm }) => {\n const { t } = useTranslation();\n\n return (\n
\n setSearchTerm(e.target.value)}\n suffix={}\n placeholder={t(\"construction-project:search-placeholder\")}\n allowClear\n />\n
\n );\n};\n\ninterface TreeGlobalOptionsProps {\n isLoading: boolean;\n handleIconClick: (node: TreeNode | undefined, action: string) => void;\n}\n\nconst TreeGlobalOptions = ({\n isLoading,\n handleIconClick,\n}: TreeGlobalOptionsProps) => {\n return (\n
\n \n \n \n \n \n \n
\n );\n};\n\nconst LoadingSpinner = () => {\n return (\n \n \n \n );\n};\n\ninterface RenderTitleProps {\n node: TreeNode;\n defaultIdExpanded?: string;\n nodeVisitiblyDisabledList?: string[];\n handleIconClick?: (node: TreeNode | undefined, action: string) => void;\n handleTitleClick?: (id: string) => void;\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport { Input } from \"antd\";\nimport {\n CloseCircleOutlined,\n EditOutlined,\n SaveOutlined,\n} from \"@ant-design/icons\";\nimport { useTranslation } from \"react-i18next\";\nimport \"../styles/typography/icons.scss\";\n\ninterface EditableTextProps {\n text: string | undefined;\n style?: React.CSSProperties;\n saveCallback: (text: string) => void;\n}\n\nexport const EditableText = ({\n text,\n style,\n saveCallback,\n}: EditableTextProps) => {\n const { t } = useTranslation(\"translations\");\n\n const [isEditing, setIsEditing] = useState(false);\n const [titleText, setTitle] = useState(\"\");\n const [tempText, setTempText] = useState(titleText);\n\n const ref = useRef(null);\n\n useEffect(() => {\n setTitle(text ?? \"\");\n setTempText(text ?? \"\");\n }, [text]);\n\n useEffect(() => {\n document.addEventListener(\"click\", handleClickOutsideText);\n return () => {\n document.removeEventListener(\"click\", handleClickOutsideText);\n };\n }, [isEditing, tempText]);\n\n const handleSaveClick = () => {\n setTitle(tempText);\n setIsEditing(false);\n saveCallback(tempText);\n };\n\n const handleCancelClick = () => {\n setTempText(titleText);\n setIsEditing(false);\n };\n\n const handleEditClick = () => {\n setIsEditing(true);\n };\n\n const handleClickOutsideText = (event: MouseEvent) => {\n if (\n ref.current &&\n ref.current.input &&\n !ref.current.input.contains(event.target as Node) &&\n isEditing\n ) {\n handleSaveClick();\n }\n };\n\n const handleChange = (e: React.ChangeEvent) => {\n setTempText(e.target.value);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\") {\n handleSaveClick();\n }\n };\n\n return (\n \n {isEditing ? (\n \n ) : (\n \n {titleText}\n \n )}\n {!isEditing ? (\n \n handleEditClick()}\n className=\"icon-drawer\"\n />\n \n ) : (\n \n handleSaveClick()}\n className=\"icon-drawer-save\"\n title={t(\"translations:save\")}\n />\n handleCancelClick()}\n className=\"icon-drawer-cancel\"\n title={t(\"translations:cancel\")}\n />\n \n )}\n \n );\n};\n","import { useState } from \"react\";\nimport {\n ConstructionProject,\n useUpdateConstructionProject,\n useUpdateConstructionSite,\n} from \"../../../api\";\n\nexport interface UpdateApiResponse {\n updatedValue: { key: string; value: string };\n completed: boolean;\n status: number;\n}\n\nexport const useUpdateConstructionProjectInformation = (\n constructionProjectData: ConstructionProject | undefined,\n onSave: (refreshTimeStamp: string) => void\n) => {\n const [updateResult, setUpdateResult] = useState({\n updatedValue: { key: \"\", value: \"\" },\n completed: true,\n status: 0,\n });\n\n const update = useUpdateConstructionProject(\n constructionProjectData?.id || \"\"\n );\n\n // API is destructive for existing data, so we need to update the entire data object before sending it to the API\n const updateProjectName = async (name: string) => {\n if (constructionProjectData) {\n constructionProjectData.name = name;\n } else {\n setUpdateResult({\n updatedValue: { key: \"\", value: \"\" },\n completed: true,\n status: 400,\n });\n return;\n }\n try {\n setUpdateResult({\n updatedValue: { key: \"projectName\", value: name },\n completed: false,\n status: 0,\n });\n\n await update(constructionProjectData);\n\n setUpdateResult({\n updatedValue: { key: \"projectName\", value: name },\n completed: true,\n status: 200,\n });\n\n onSave(new Date().toISOString());\n } catch {\n setUpdateResult({\n updatedValue: { key: \"projectName\", value: \"\" },\n completed: true,\n status: 400,\n });\n }\n };\n\n const updateProjectCity = async (city: string) => {\n if (!constructionProjectData) {\n setUpdateResult({\n updatedValue: { key: \"\", value: \"\" },\n completed: true,\n status: 400,\n });\n return;\n }\n\n if (constructionProjectData?.address) {\n constructionProjectData.address.city = city;\n } else {\n constructionProjectData.address = {\n zipCode: \"\",\n city: city,\n street: \"\",\n };\n }\n\n try {\n setUpdateResult({\n updatedValue: { key: \"projectLocation\", value: city },\n completed: false,\n status: 0,\n });\n\n await update(constructionProjectData);\n \n setUpdateResult({\n updatedValue: { key: \"projectLocation\", value: city },\n completed: true,\n status: 200,\n });\n } catch {\n setUpdateResult({\n updatedValue: { key: \"projectLocation\", value: \"\" },\n completed: true,\n status: 400,\n });\n }\n };\n\n const resetUpdateInfo = () => {\n setUpdateResult({\n updatedValue: { key: \"\", value: \"\" },\n completed: true,\n status: 0,\n });\n };\n\n return {\n updateResult,\n updateProjectName,\n resetUpdateInfo,\n updateProjectCity,\n };\n};\n\nexport const useUpdateConstructionSiteInformation = (\n constructionProjectId: string,\n constructionSiteId: string,\n onSave: (refreshTimeStamp: string) => void\n) => {\n const [updateResult, setUpdateResult] = useState({\n updatedValue: { key: \"\", value: \"\" },\n completed: true,\n status: 0,\n });\n\n const update = useUpdateConstructionSite(\n constructionProjectId,\n constructionSiteId\n );\n\n const updateSiteName = async (name: string) => {\n try {\n setUpdateResult({\n updatedValue: { key: \"siteName\", value: name },\n completed: false,\n status: 0,\n });\n\n await update({\n name: name,\n });\n\n setUpdateResult({\n updatedValue: { key: \"siteName\", value: name },\n completed: true,\n status: 200,\n });\n\n onSave(new Date().toISOString());\n } catch {\n setUpdateResult({\n updatedValue: { key: \"siteName\", value: \"\" },\n completed: true,\n status: 400,\n });\n }\n };\n\n const resetUpdateInfo = () => {\n setUpdateResult({\n updatedValue: { key: \"\", value: \"\" },\n completed: true,\n status: 0,\n });\n };\n\n return {\n updateResult,\n updateSiteName,\n resetUpdateInfo,\n };\n};\n","import { useHistory } from \"react-router-dom\";\n\ninterface NavigatableText {\n text: string;\n type: \"router\" | \"callback\";\n params?: { [key: string]: string };\n route?: string;\n callBack?: (params: { [key: string]: string }) => void;\n style?: React.CSSProperties;\n}\nexport const NavigatableText = ({\n text,\n type,\n params,\n route,\n callBack,\n style,\n}: NavigatableText) => {\n const history = useHistory();\n return (\n history.push(route)\n : type === \"callback\" && callBack\n ? () => params && callBack(params)\n : undefined\n }\n style={{\n ...style,\n cursor: \"pointer\",\n textDecoration: \"underline\",\n color: \"#438EFB\",\n }}\n >\n {text}\n \n );\n};\n","import { Table } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { ConstructionSite, useConstructionProjectSites } from \"../../../../api\";\nimport { NavigatableText } from \"../../../../util/NavigatableText\";\nimport { ApiState } from \"../../../../api/useApiState\";\n\ninterface SitesDetailsProps {\n constructionProjectId: string;\n constructionProjectName: string;\n handleSiteClicked: (\n siteId: string,\n projectName: string,\n projectId: string\n ) => void;\n}\n\nexport const SitesDetails = ({\n constructionProjectId,\n constructionProjectName,\n handleSiteClicked,\n}: SitesDetailsProps) => {\n const { t } = useTranslation();\n\n /*\n Ant Design drawer component renders at initial load, so we need to fetch the data\n only after the drawer has become visible, else the API will throw an error. \n\n To achieve this, we use the useConstructionProjectSites hook in this child component \n and only redner the child component when the parent (ProjectDrawer) is visible.\n */\n const constructionProjectSitesData = useConstructionProjectSites(\n constructionProjectId\n );\n\n const handleSiteNameClick = (params: { [key: string]: string }) => {\n if (handleSiteClicked) {\n handleSiteClicked(params.id, params.projectName, params.projectId);\n }\n };\n\n const columns = [\n {\n key: \"name\",\n title: t(\"construction-site:name\"),\n width: \"auto\",\n render: (s: ConstructionSite) => (\n \n ),\n },\n {\n key: \"createdAt\",\n title: t(\"translations:created-date\"),\n width: \"auto\",\n render: (s: ConstructionSite) => s.createdAt.toLocaleString(),\n },\n ];\n return (\n
\n
\n {t(\"construction-site:sites-in-project\")}\n
\n record.id}\n dataSource={constructionProjectSitesData.value}\n pagination={false}\n loading={constructionProjectSitesData.loading}\n />\n
\n );\n};\n","import { Alert, Spin } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { EditableText } from \"../../../../util/EditableText\";\nimport { NavigatableText } from \"../../../../util/NavigatableText\";\nimport { UpdateApiResponse } from \"../useUpdateInformation\";\nimport { useContext } from \"react\";\nimport { AuthContext } from \"../../../../contexts/authContext\";\n\ninterface SummaryInformationProps {\n dateCreated: Date;\n location: string;\n organizationName: string;\n organizationId: string;\n isLoading: boolean;\n updateResult: UpdateApiResponse;\n onSave: (city: string) => Promise;\n}\n\nexport const SummaryInformation = ({\n dateCreated,\n location,\n organizationName,\n organizationId,\n isLoading,\n updateResult,\n onSave,\n}: SummaryInformationProps) => {\n const { t } = useTranslation();\n\n const authContext = useContext(AuthContext);\n const currentUserIsRSM = authContext.currentUser?.accessToken?.hasRole(\n \"road-safety-manager\"\n );\n\n return (\n
\n {updateResult.status === 400 &&\n updateResult.updatedValue.key === \"projectLocation\" && (\n \n )}\n {updateResult.status === 200 &&\n updateResult.updatedValue.key === \"projectLocation\" && (\n \n )}\n {isLoading ? (\n
\n \n
\n ) : (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {t(\"translations:created-date\")}:  \n \n {/* {dateCreated.toLocaleString()} */}\n Not available\n
\n {t(\"translations:location\")}:  \n \n {currentUserIsRSM ? (\n onSave(value)}\n />\n ) : (\n location\n )}\n
\n {t(\"translations:organization\")}:  \n \n \n
\n )}\n
\n );\n};\n","import { CloseOutlined } from \"@ant-design/icons\";\nimport { Alert, Button, Drawer, Spin } from \"antd\";\nimport { useContext, useEffect } from \"react\";\nimport {\n useConstructionProject,\n} from \"../../../../api\";\nimport { useRefreshAll } from \"../../../../util\";\nimport { EditableText } from \"../../../../util/EditableText\";\nimport \"../drawer.scss\";\nimport { useUpdateConstructionProjectInformation } from \"../useUpdateInformation\";\nimport { SitesDetails } from \"./SitesDetails\";\nimport { SummaryInformation } from \"./SummaryInformation\";\nimport { useNodeSelectedContext } from \"../../NodeSelectedContext\";\nimport { useTranslation } from \"react-i18next\";\nimport { AuthContext } from \"../../../../contexts/authContext\";\n\ninterface ConstructionProjectDrawerProps {\n constructionProjectId: string;\n constructionProjectName: string;\n drawerVisible: boolean;\n onSave: (refreshTimeStamp: string) => void;\n}\n\nexport function ConstructionProjectDrawer({\n constructionProjectId,\n drawerVisible,\n onSave,\n}: ConstructionProjectDrawerProps) {\n const { t } = useTranslation();\n\n const authContext = useContext(AuthContext);\n const currentUserIsRSM = authContext.currentUser?.accessToken?.hasRole(\n \"road-safety-manager\"\n );\n\n const constructionProjectData = useConstructionProject(constructionProjectId);\n\n const refreshProjectData = useRefreshAll(constructionProjectData);\n\n const {\n updateResult,\n updateProjectCity,\n updateProjectName,\n resetUpdateInfo,\n } = useUpdateConstructionProjectInformation(\n constructionProjectData.value,\n onSave\n );\n\n useEffect(() => {\n if (!drawerVisible) resetUpdateInfo();\n }, [drawerVisible]);\n\n useEffect(() => {\n if (updateResult.status === 200) refreshProjectData();\n }, [updateResult]);\n\n const { setSelectedNode } = useNodeSelectedContext();\n\n const showSitesDrawer = (\n siteId: string,\n projectName: string,\n projectId: string\n ) => {\n setSelectedNode({\n selectedSiteId: siteId,\n selectedProjectId: projectId,\n selectedProjectName: projectName,\n siteDrawerVisible: true,\n projectDrawerVisible: false,\n });\n };\n\n return (\n \n {constructionProjectData.loading ? (\n
\n {true ? : undefined}\n
\n ) : (\n
\n {currentUserIsRSM ? (\n {\n updateProjectName(value);\n }}\n />\n ) : (\n constructionProjectData.value?.name\n )}\n }\n onClick={() => setSelectedNode({ projectDrawerVisible: false })}\n />\n
\n )}\n \n }\n placement=\"right\"\n closable={false}\n onClose={() => setSelectedNode({ projectDrawerVisible: false })}\n visible={drawerVisible}\n destroyOnClose={true}\n width={600}\n >\n {updateResult.status === 400 &&\n updateResult.updatedValue.key === \"projectName\" && (\n \n )}\n {updateResult.status === 200 &&\n updateResult.updatedValue.key === \"projectName\" && (\n \n )}\n \n {drawerVisible && (\n {\n showSitesDrawer(siteId, projectName, projectId);\n }}\n />\n )}\n \n );\n}\n","import { useContext, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Beacon, BeaconTableColumns } from \"../../../../api\";\nimport { PagedApiState } from \"../../../../api/useApiState\";\nimport { AssignBeaconsModalConstructionSite } from \"../../../../components/beacon-configuration/AssignBeaconsModal\";\nimport { BulkConfigureModal } from \"../../../../components/beacon-configuration/BulkConfigureModal\";\nimport { UnassignBeaconsButtonSite } from \"../../../../components/beacon-configuration/UnassignBeaconsButton\";\nimport { BeaconTableBase } from \"../../../../components/BeaconTableBase\";\nimport { AuthContext } from \"../../../../contexts/authContext\";\n\ninterface BeaconDetailsProps {\n constructionProjectId: string;\n constructionSiteId: string;\n siteBeacons: PagedApiState;\n projectBeacons: PagedApiState;\n}\n\nconst useSelectedBeacons = () => {\n const [selectedBeaconIds, setSelectedBeaconIds] = useState([]);\n\n const onSelect = (selectedRowKeys: string[]) => {\n setSelectedBeaconIds(selectedRowKeys);\n };\n\n const clearSelectedBeaconIds = () => {\n setSelectedBeaconIds([]);\n };\n\n return { selectedBeaconIds, onSelect, clearSelectedBeaconIds };\n};\n\nexport const BeaconDetails = ({\n constructionProjectId,\n constructionSiteId,\n siteBeacons,\n projectBeacons,\n}: BeaconDetailsProps) => {\n const { t } = useTranslation();\n const authContext = useContext(AuthContext);\n const currentUserIsRSM = authContext.currentUser?.accessToken?.hasRole(\n \"road-safety-manager\"\n );\n \n const { selectedBeaconIds, onSelect } = useSelectedBeacons();\n\n return (\n
\n
\n {t(\"construction-site:beacons-in-site\")}\n
\n \n {currentUserIsRSM && (\n <>\n \n \n \n )}\n {/* \n Removing this component from the UI until it is implemented fully\n \n */}\n
\n }\n />\n \n );\n};\n","import { Spin } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { NavigatableText } from \"../../../../util/NavigatableText\";\n\ninterface SummaryInformationProps {\n dateCreated: Date;\n project: string;\n projectId: string;\n isLoading: boolean;\n handleProjectClicked: (siteId: string) => void;\n}\n\nexport const SummaryInformation = ({\n dateCreated,\n project,\n projectId,\n isLoading,\n handleProjectClicked,\n}: SummaryInformationProps) => {\n const { t } = useTranslation();\n\n const handleProjectNameClick = (params: { [key: string]: string }) => {\n if (handleProjectClicked) {\n handleProjectClicked(params.projectId);\n }\n };\n\n return (\n
\n {isLoading ? (\n \n ) : (\n \n \n \n \n \n \n \n \n \n \n \n
\n {t(\"translations:created-date\")}:  \n {dateCreated.toLocaleString()}
\n {t(\"translations:construction-project\")}:  \n \n \n
\n )}\n
\n );\n};\n","import { CloseOutlined } from \"@ant-design/icons\";\nimport { Alert, Button, Drawer, Spin } from \"antd\";\nimport { useContext, useMemo } from \"react\";\nimport { Beacon, useConstructionProjectSite } from \"../../../../api\";\nimport { PagedApiState } from \"../../../../api/useApiState\";\nimport { EditableText } from \"../../../../util/EditableText\";\nimport \"../drawer.scss\";\nimport { useUpdateConstructionSiteInformation } from \"../useUpdateInformation\";\nimport { BeaconDetails } from \"./BeaconDetails\";\nimport { SummaryInformation } from \"./SummaryInformation\";\nimport { useNodeSelectedContext } from \"../../NodeSelectedContext\";\nimport { useTranslation } from \"react-i18next\";\nimport { AuthContext } from \"../../../../contexts/authContext\";\n\ninterface ConstructionSiteDrawerProps {\n constructionProjectId: string;\n constructionProjectName: string;\n beacons: PagedApiState;\n constructionSiteId: string;\n drawerVisible: boolean;\n onSave: (refreshTimeStamp: string) => void;\n}\n\nexport function ConstructionSiteDrawer({\n constructionProjectId,\n constructionProjectName,\n beacons,\n constructionSiteId,\n drawerVisible,\n onSave,\n}: ConstructionSiteDrawerProps) {\n const { t } = useTranslation();\n const { setSelectedNode } = useNodeSelectedContext();\n\n const authContext = useContext(AuthContext);\n const currentUserIsRSM = authContext.currentUser?.accessToken?.hasRole(\n \"road-safety-manager\"\n );\n\n const showProjectDrawer = (projectId: string) => {\n setSelectedNode({\n selectedProjectId: projectId,\n projectDrawerVisible: true,\n siteDrawerVisible: false,\n });\n };\n\n const constructionProjectSiteData = useConstructionProjectSite(\n constructionProjectId,\n constructionSiteId\n );\n\n const { updateResult, updateSiteName } = useUpdateConstructionSiteInformation(\n constructionProjectId,\n constructionSiteId,\n onSave\n );\n\n const filteredSiteBeacons: PagedApiState = useMemo(() => {\n if (!beacons.value) {\n return {\n ...beacons,\n value: { totalCount: 0, items: [] },\n };\n }\n const filteredBeacons = beacons.value.items.filter(\n (beacon) => beacon.constructionSiteId === constructionSiteId\n );\n return {\n ...beacons,\n value: {\n totalCount: filteredBeacons.length,\n items: filteredBeacons,\n },\n };\n }, [beacons, constructionSiteId]);\n\n const filteredProjectBeacons: PagedApiState = useMemo(() => {\n if (!beacons.value) {\n return {\n ...beacons,\n value: { totalCount: 0, items: [] },\n };\n }\n const filteredBeacons = beacons.value.items.filter(\n (beacon) => beacon.constructionProjectId === constructionProjectId\n );\n\n // Filter out beacons that are already assigned to a site and part of the project\n // To be used in assign beacon modal\n const filteredBeaconsNoSite = filteredBeacons.filter(\n (beacon) => beacon.constructionSiteId === null\n );\n\n return {\n ...beacons,\n value: {\n totalCount: filteredBeaconsNoSite.length,\n items: filteredBeaconsNoSite,\n },\n };\n }, [beacons, constructionSiteId]);\n\n return (\n \n {constructionProjectSiteData.loading ? (\n
\n {true ? : undefined}\n
\n ) : (\n
\n {currentUserIsRSM ? (\n updateSiteName(value)}\n />\n ) : (\n constructionProjectSiteData.value?.name\n )}\n\n }\n onClick={() => setSelectedNode({ siteDrawerVisible: false })}\n />\n
\n )}\n \n }\n placement=\"right\"\n closable={false}\n onClose={() => setSelectedNode({ siteDrawerVisible: false })}\n visible={drawerVisible}\n width={600}\n >\n {updateResult.status === 400 &&\n updateResult.updatedValue.key === \"siteName\" && (\n \n )}\n {updateResult.status === 200 &&\n updateResult.updatedValue.key === \"siteName\" && (\n \n )}\n {constructionProjectSiteData.loading ? (\n \n ) : (\n <>\n {\n showProjectDrawer(projectId);\n }}\n />\n \n \n )}\n \n );\n}\n","import { useEffect, useMemo, useState } from \"react\";\nimport { useHistory } from \"react-router-dom\";\nimport {\n ConstructionProject as ConstructionProjectInterface,\n useBeacons,\n useConstructionProjects,\n useGetAllConstructionProjectSites,\n} from \"../../api\";\nimport { useRefreshAll } from \"../../util\";\nimport \"./construction-project.scss\";\nimport { ConstructionProjectMap } from \"./map/ConstructionProjectMap\";\nimport { useNodeSelectedContext } from \"./NodeSelectedContext\";\nimport { ConstructionProjectTree } from \"./project-tree/ConstructionProjectTree\";\nimport { ConstructionProjectDrawer } from \"./drawers/project/ConstructionProjectDrawer\";\nimport { ConstructionSiteDrawer } from \"./drawers/site/ConstructionSiteDrawer\";\n\ninterface HistoryState {\n selectedId: string;\n}\n\nexport function ConstructionProjectWrapper() {\n const [refreshTimeStamp, setRefreshTimeStamp] = useState(\"\");\n const { selectedNode, setSelectedNode } = useNodeSelectedContext();\n const history = useHistory();\n\n useEffect(() => {\n if (refreshTimeStamp) {\n refreshAll();\n }\n }, [refreshTimeStamp]);\n\n /*\n When user is navigating to the construction-project page from a different page after \n they have clicked on a project or site name on that page (/beaons & /beacon-details), \n get which project or site was clicked on and set the selectedNode state to that project \n or site.\n\n This will set the selected node upon load of the construction project page which will \n collapse all other nodes and turn other node visible off while having the selected \n node expanded and visible.\n */\n useEffect(() => {\n if (\n history.location.state &&\n typeof history.location.state === \"object\" &&\n \"selectedId\" in history.location.state\n ) {\n const state = history.location.state as HistoryState;\n setSelectedNode({ selectedId: state.selectedId });\n }\n }, [history]);\n\n /*\n Fetching beacons with take of 1000 as there is not an api to support the use case for the \n updated construction-project page.\n\n If implemented a different wayt to fetch all the beacons, orgs, sites and projects there \n would be many api calls to then have to compose that data into the structure we can get with one\n api call from the /beacons endpoint with a take of 1000. \n\n This will obviously exclude beacons when the total number of beacons is greater than 1000.\n */\n\n const beacons = useBeacons(undefined, undefined, undefined, undefined, 1000);\n const projects = useConstructionProjects(undefined, false);\n const projectIds = useMemo(\n () =>\n projects.value?.items.map(\n (project: ConstructionProjectInterface) => project.id\n ) || [],\n [projects.loading]\n );\n const sites = useGetAllConstructionProjectSites(projectIds);\n\n /* \n projectsInBeaconArraywithOnBeacons and filteredProjects are used to filter the projects that are\n displayed on the map. This is to address data issues when a project could be returned from the \n construction-projects API that does not have any beacons associated with it or only off beacons. \n\n If a project with no beacons or only off beacons, then the polygon for that project will always be \n present on the map and cause update bounds/view issues when changing visibility in the tree.\n */\n const projectsInBeaconArrayWithOnBeacons = useMemo(() => {\n if (!beacons.value?.items) {\n return [];\n }\n const projectIds = beacons.value.items\n .filter((beacon) => beacon.onOffSwitch?.isOn !== false)\n .map((beacon) => beacon.constructionProjectId)\n .filter((projectId) => projectId !== null);\n\n return Array.from(new Set(projectIds));\n }, [beacons.value?.items]);\n\n const filteredProjects = useMemo(() => {\n if (!projects.value?.items) {\n return [];\n }\n return projects.value?.items.filter((project) =>\n projectsInBeaconArrayWithOnBeacons.includes(project.id)\n );\n }, [projects.value?.items, projectsInBeaconArrayWithOnBeacons]);\n\n const refreshAll = useRefreshAll(beacons);\n\n const dataLoading = beacons.loading || projects.loading || sites.loading;\n\n return (\n
\n
\n \n
\n
\n \n
\n \n setRefreshTimeStamp(refreshTimeStamp)\n }\n />\n {selectedNode.siteDrawerVisible ? (\n \n setRefreshTimeStamp(refreshTimeStamp)\n }\n />\n ) : null}\n
\n );\n}\n","import { CurrentUser, Role } from './contexts/authContext';\nimport { Beacons } from './screens/beacons/Beacons';\nimport { Organiztations } from './screens/organizations/Organizations';\nimport { Organization } from './screens/organization/Organization';\nimport { Users } from './screens/users/Users';\nimport { NoRole } from './screens/no-role/NoRole';\nimport { Beacon } from './screens/beacons/Beacon';\nimport { ConstructionProject } from './screens/construction-project/ConstructionProject';\n\ninterface Route {\n path: string;\n component: () => JSX.Element;\n navigationMenu?: { labelKey: string };\n roles?: Role[];\n};\n\nconst allRoutes: Route[] = [\n {\n path: '/construction-projects',\n component: ConstructionProject,\n navigationMenu: {\n labelKey: 'construction-projects'\n },\n roles: ['road-safety-manager', 'solution-operator']\n },\n {\n path: '/beacons',\n component: Beacons,\n navigationMenu: {\n labelKey: 'beacons'\n },\n roles: ['solution-operator', 'road-safety-manager']\n },\n {\n path: '/beacons/:beaconId',\n component: Beacon,\n roles: ['solution-operator', 'road-safety-manager']\n },\n {\n path: '/organizations',\n component: Organiztations,\n navigationMenu: {\n labelKey: 'organizations'\n },\n roles: ['solution-operator', 'user-administrator']\n },\n {\n path: '/organizations/:organizationId',\n component: Organization,\n roles: ['solution-operator', 'user-administrator']\n },\n {\n path: '/users',\n component: Users,\n navigationMenu: {\n labelKey: 'users'\n },\n roles: ['user-administrator']\n }\n];\n\nexport function routes(user: CurrentUser): Route[] {\n\n if (user.accessToken.payload['cognito:groups'].length === 0) {\n return [\n {\n path: '/',\n component: NoRole\n }\n ];\n }\n\n return allRoutes.filter(route => !route.roles?.length || route.roles.some((role) => user.accessToken.payload['cognito:groups'].indexOf(role) >= 0));\n}","import { NodeSelectedProvider } from \"./NodeSelectedContext\";\nimport { ConstructionProjectWrapper } from \"./ConstructionProjectWrapper\";\n\nexport function ConstructionProject() {\n return (\n \n \n \n );\n}","import { useContext } from \"react\";\nimport { AuthContext } from \"../../contexts/authContext\";\nimport { BeaconsBeaconTable } from \"./BeaconsBeaconTable\";\n\nexport function Beacons() {\n const authContext = useContext(AuthContext);\n const currentUserIsSolutionOperator =\n authContext.currentUser?.accessToken?.hasRole(\"solution-operator\") ?? false;\n\n\n return ;\n}\n","import { Breadcrumb, Spin, Tag } from \"antd\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory, useParams } from \"react-router-dom\";\nimport { useBeacon } from \"../../api\";\nimport { BeaconConfigurationModal } from \"../../components/beacon-configuration/BeaconConfigurationModal\";\nimport { BeaconDetails } from \"../../components/beacon-details/BeaconDetails\";\n\nexport function Beacon() {\n const { t } = useTranslation();\n const history = useHistory();\n const { beaconId } = useParams<{ beaconId: string }>();\n const beacon = useBeacon(beaconId);\n\n if (!beacon.value) {\n return (\n \n );\n }\n\n return (\n \n \n {\n e.preventDefault();\n history.push(\"/beacons\");\n }}\n >\n {t(\"beacons\")}\n \n \n \n \n {beacon.value ? beacon.value.serial || beacon.value.id : beaconId}\n \n \n {beacon.value && (\n \n )}\n \n {beacon.value.isDisabled && (\n \n \n {t(\"beacon:disabled\")}\n \n \n )}\n \n \n }\n />\n );\n}\n","import { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\nimport { AmplifyLoadingSpinner } from '@aws-amplify/ui-react';\nimport { Table, Tag } from 'antd';\nimport { MailOutlined, PlusCircleOutlined } from '@ant-design/icons';\nimport { ForwardToPlatform, Organization, OrganizationMutableProperties, useCreateOrganization, useOrganizations } from \"../../api\";\nimport { toAntdPagination } from \"../../util\";\nimport { OrganizationPropertyModal } from \"../../components/OrganizationPropertyModal\";\n\nexport function Organiztations() {\n\n const history = useHistory();\n const { t } = useTranslation();\n\n const organiztations = useOrganizations();\n const createOrganization = useCreateOrganization();\n\n const onCreateOrganization = async (org: OrganizationMutableProperties) => {\n const organization = await createOrganization(org);\n history.push('/organizations/' + organization.id);\n };\n\n if (!organiztations.loading && !organiztations.value) {\n return ;\n }\n\n return {\n return {\n onClick: event => {\n history.push('/organizations/' + record.id);\n },\n style: {\n cursor: 'pointer'\n }\n };\n }}\n columns={[\n {\n title: t('organization:name'),\n render: (c: Organization) => <>{c.name} {c.forwardToPlatform === ForwardToPlatform.UDP ? UDP : c.forwardToPlatform === ForwardToPlatform.MOVEMENT_MAIL_ALERTING ? : undefined}\n },\n ]}\n pagination={toAntdPagination(organiztations)}\n footer={() => } onSave={onCreateOrganization} />}>\n ;\n}","import { DeleteOutlined, EditOutlined } from \"@ant-design/icons\";\nimport { AmplifyLoadingSpinner } from \"@aws-amplify/ui-react\";\nimport { Breadcrumb, Button, Card, Dropdown, Menu, Tabs } from \"antd\";\nimport { useCallback, useContext, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory, useParams } from \"react-router-dom\";\nimport {\n OrganizationMutableProperties,\n useDeleteOrganization,\n useOrganization,\n useUpdateOrganization,\n} from \"../../api\";\nimport { ActionsIcon } from \"../../components/ActionsIcon\";\nimport { OrganizationPropertyModal } from \"../../components/OrganizationPropertyModal\";\nimport { OrganizationUsersTable } from \"../../components/UserTable\";\nimport { AuthContext } from \"../../contexts/authContext\";\nimport { AssignBeaconsModalOrganization } from \"../../components/beacon-configuration/AssignBeaconsModal\";\nimport { AssignUsersModal } from \"./AssignUsersModal\";\nimport { OrganizationBeaconTable } from \"./OrganizationBeaconTable\";\nimport { OrganizationUserTableFooter } from \"./OrganizationUserTableFooter\";\n\nexport function Organization() {\n const { organizationId } = useParams<{ organizationId: string }>();\n const organization = useOrganization(organizationId);\n const { t } = useTranslation();\n const history = useHistory();\n const [selectedUserIds, setSelectedUserIds] = useState([]);\n\n const [activeTab, setActiveTab] = useState<\"users\" | \"beacons\">(\"users\");\n\n const authContext = useContext(AuthContext);\n const currentUserIsUserAdministrator =\n authContext.currentUser?.accessToken?.hasRole(\"user-administrator\");\n const currentUserIsSolutionOperator =\n authContext.currentUser?.accessToken?.hasRole(\"solution-operator\");\n\n const deleteOrganization = useDeleteOrganization(organizationId);\n const [isDeleting, setIsDeleting] = useState(false);\n const onDelete = async () => {\n setIsDeleting(true);\n try {\n await deleteOrganization();\n history.push(\"/organizations\");\n } finally {\n setIsDeleting(false);\n }\n };\n\n const update = useUpdateOrganization(organizationId);\n const onSaveEditing = useCallback(\n async (org: OrganizationMutableProperties) => {\n await update(org);\n organization.refresh();\n },\n [update, organization.refresh]\n );\n\n if (organization.loading || !organization.value || isDeleting) {\n return ;\n }\n\n const usersTable = () => (\n setSelectedUserIds([])}\n />\n }\n />\n );\n\n const beaconsTable = () => {\n return ;\n };\n\n return (\n
\n \n \n {\n e.preventDefault();\n history.push(\"/organizations\");\n }}\n >\n {t(\"organizations\")}\n \n \n {organization.value.name}\n \n \n \n {t(\"organization\")}\n \n\n \n {currentUserIsUserAdministrator && (\n \n \n \n )}\n {currentUserIsUserAdministrator && (\n \n }\n title={t(\"edit\")}\n organization={organization.value}\n />\n \n )}\n {currentUserIsUserAdministrator && (\n \n \n \n )}\n {currentUserIsSolutionOperator && (\n \n \n \n )}\n \n }\n >\n \n \n
\n }\n >\n
\n {t(\"organization:name\")}\n {organization.value.name}\n
\n \n {currentUserIsSolutionOperator && currentUserIsUserAdministrator ? (\n setActiveTab(k as any)}>\n \n {usersTable()}\n \n \n {beaconsTable()}\n \n \n ) : currentUserIsUserAdministrator ? (\n usersTable()\n ) : (\n currentUserIsSolutionOperator && beaconsTable()\n )}\n \n \n );\n}\n","import { AllUsersTable } from \"../../components/UserTable\";\n\nexport function Users() {\n return \n}","import { useContext } from 'react';\nimport { useRouteMatch, useLocation, useHistory } from 'react-router-dom';\nimport { Menu } from 'antd';\nimport '../App.css';\nimport { routes } from '../routes';\nimport { useTranslation } from 'react-i18next';\nimport { AuthContext } from '../contexts/authContext';\n\nexport function NavigationMenu(this: any) {\n const location = useLocation();\n const { t } = useTranslation();\n const match = useRouteMatch({ exact: true, path: location.pathname });\n const history = useHistory();\n const path = match?.path?.trim() || '';\n\n const authContext = useContext(AuthContext);\n const routesInMenu = routes(authContext.currentUser!).filter(r => r.navigationMenu);\n\n const onNav = (key: string) => {\n history.push(routesInMenu[parseInt(key)].path);\n };\n\n const matchingRoutes = routesInMenu.filter(r => path.startsWith(r.path));\n let matchingRoute = matchingRoutes.length ? matchingRoutes[0] : undefined;\n if (matchingRoute && matchingRoutes.length > 1) {\n for (let i = 1; i < matchingRoutes.length; i++) {\n if (matchingRoutes[i].path.length > matchingRoute.path.length) {\n matchingRoute = matchingRoutes[i];\n }\n }\n }\n\n const selectedKeys = matchingRoute ? [routesInMenu.indexOf(matchingRoute).toString(10)] : [];\n\n return onNav(e.key.toString())}>\n {routesInMenu.map((r, i) => {t(r.navigationMenu!.labelKey)}\n )}\n ;\n}","import { useCallback, useContext } from 'react';\nimport { AmplifySignOut } from '@aws-amplify/ui-react';\nimport { useTranslation } from 'react-i18next';\nimport { AuthContext } from '../contexts/authContext';\nimport { Button, Dropdown, Menu, Select } from 'antd';\nimport { DownOutlined } from '@ant-design/icons';\nimport { DataAutoRefreshContext } from '../contexts/dataRefreshContext';\n\nexport function UserMenu() {\n\n const authContext = useContext(AuthContext);\n const { interval, setInterval } = useContext(DataAutoRefreshContext);\n const { i18n, ready, t } = useTranslation();\n\n const german = useCallback(() => { i18n.changeLanguage('de') }, [i18n]);\n const english = useCallback(() => { i18n.changeLanguage('en') }, [i18n]);\n\n if (!authContext.currentUser) {\n return <>;\n }\n\n return \n {ready &&
\n \n \n
}\n \n
\n
{t('reload-rate')}
\n \n
\n \n \n \n \n\n }>\n e.preventDefault()} style={{ color: 'white' }}>\n {authContext.currentUser.email} \n \n
;\n}","\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { AmplifyLoadingSpinner } from '@aws-amplify/ui-react';\nimport Amplify, { Auth } from 'aws-amplify';\nimport './Environment.css';\nimport { EnvironmentConfig, EnvironmentContext } from '../contexts/environmentContext';\n\n\nexport function Environment(props: { children: React.ReactNode }) {\n const [environmentConfig, setEnvironmentConfig] = useState('NotLoaded');\n const onEnvironmentConfigLoaded = (config: EnvironmentConfig) => {\n const authConfig = {\n mandatorySignIn: true,\n region: config.cognito.region,\n userPoolId: config.cognito.userPoolId,\n userPoolWebClientId: config.cognito.userPoolWebClientId\n };\n Amplify.configure({ Auth: authConfig });\n Auth.configure(authConfig);\n\n setEnvironmentConfig(config);\n }\n\n const loadEnvironmentConfig = useCallback(async () => {\n try {\n const configBaseUrl = process.env.NODE_ENV === 'development'\n ? 'https://artemis-ui-config-dev.s3.eu-central-1.amazonaws.com'\n : window.location.host === 'app.cm-one.de'\n ? 'https://artemis-ui-config-prod.s3.eu-central-1.amazonaws.com'\n : window.location.origin\n .replace('artemis-ui', 'artemis-ui-config')\n .replace('http://', 'https://')\n .replace('.s3-website.', '.s3.');\n\n const response = await fetch(configBaseUrl + '/environment-config.json');\n if (response.status !== 200) {\n setEnvironmentConfig('Error');\n }\n else {\n const json = await response.json() as EnvironmentConfig;\n if (process.env.REACT_APP_LOCAL_API === 'true') {\n json.api.baseUrl = 'http://localhost:5000/';\n json.api.baseUrlv2 = 'http://localhost:5000/';\n }\n onEnvironmentConfigLoaded(json);\n }\n }\n catch (e) {\n console.error(e);\n setEnvironmentConfig('Error');\n }\n }, []);\n useEffect(() => { loadEnvironmentConfig(); }, [loadEnvironmentConfig]);\n\n if (environmentConfig === 'NotLoaded') {\n return
\n \n
\n Loading...\n
\n
;\n }\n\n if (environmentConfig === 'Error') {\n return
\n Error loading environment\n
;\n }\n\n return {props.children};\n}","import { useCallback, useContext, useState } from 'react';\nimport './App.css';\nimport { AmplifyAuthenticator } from '@aws-amplify/ui-react';\nimport Auth from '@aws-amplify/auth';\nimport { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom';\nimport { Layout } from 'antd';\nimport 'antd/dist/antd.css';\nimport { routes } from './routes';\nimport { NavigationMenu } from './components/NavigationMenu';\nimport { AuthContext, CurrentUser, AccessToken } from './contexts/authContext';\nimport { DataAutoRefreshContext, DataRefreshContext } from './contexts/dataRefreshContext';\nimport { UserMenu } from './components/UserMenu';\nimport { Environment } from './components/Environment';\nimport { ReloadOutlined } from '@ant-design/icons';\nimport { useTranslation } from 'react-i18next';\nimport { useSetting } from './util';\nimport { useMyOrganization } from './api';\nimport { NoOrganization } from './screens/no-role/NoRole';\nimport { BeaconDrawerContext, BeaconDrawerContextProvider } from './components/beacon-drawer/BeaconDrawerContext';\n\nfunction VerifyRoadSafetyManagerHasAnOrganization(props: { children: React.ReactNode }) {\n const authContext = useContext(AuthContext);\n const isRoadSafetyManager = authContext.currentUser?.accessToken?.hasRole('road-safety-manager');\n const myOrg = useMyOrganization();\n return <>{isRoadSafetyManager && !myOrg.loading && !myOrg.value?.id ? : props.children};\n}\n\nfunction App() {\n\n const { t } = useTranslation();\n const [user, setUser] = useState(undefined);\n const [refreshCounter, setRefreshCounter] = useState(1);\n\n const [autoRefreshInterval, setAutoRefreshInterval] = useSetting('auto-refresh-interval', 60000);\n const [autoRefreshDisabled, setAutoRefreshDisabled] = useState(false);\n const enableAutoRefresh = useCallback(() => setAutoRefreshDisabled(false), [setAutoRefreshDisabled]);\n const disableAutoRefresh = useCallback(() => setAutoRefreshDisabled(true), [setAutoRefreshDisabled]);\n\n const handleAuthStateChange = async (a: any, c?: any) => {\n if (c?.attributes?.email) {\n const session = await Auth.currentSession();\n const accessToken = new AccessToken(session.getAccessToken());\n setUser({\n email: c?.attributes?.email,\n accessToken\n });\n }\n else {\n setUser(undefined);\n }\n };\n\n const onRefresh = (againWithDelay?: boolean) => {\n setRefreshCounter(c => c + 1);\n if (againWithDelay) {\n setTimeout(() => setRefreshCounter(c => c + 1), 2000);\n }\n };\n\n const onRefreshClick = () => { onRefresh(); };\n\n return \n \n \n \n \n {!!user &&\n \n \n \n \n \n
\n
\n \n
\n
\n \n
\n \n
\n \n \n {routes(user).map((route, index) => (\n }\n />\n ))}\n \n \n \n
\n
\n
\n
\n }\n
\n
\n
\n
\n
;\n}\n\nexport default App;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport reportWebVitals from './reportWebVitals';\nimport './locales/i18n';\nimport './index.scss';\nimport App from './App';\nimport 'leaflet/dist/leaflet.css';\nimport 'leaflet-draw/dist/leaflet.draw.css';\nimport 'react-vis/dist/style.css';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}