@evergis/react 3.1.3 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/{Map/components/Layer → Layer}/index.d.ts +1 -0
- package/dist/components/{Map/components/Layer → Layer}/types.d.ts +1 -1
- package/dist/components/{Map/components/Layer → Layer}/utils/getClientStyleItemPrefixSuffix.d.ts +1 -1
- package/dist/components/Map/index.d.ts +0 -1
- package/dist/components/index.d.ts +1 -3
- package/dist/contexts/MapContext/types.d.ts +31 -0
- package/dist/contexts/index.d.ts +2 -0
- package/dist/core/classification/parseClientStyle.d.ts +1 -1
- package/dist/core/feature/convertSpToTurfFeature.d.ts +2 -2
- package/dist/core/index.d.ts +0 -3
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/map/index.d.ts +1 -18
- package/dist/hooks/map/useMapContext.d.ts +1 -1
- package/dist/hooks/map/useMapDraw/customModes.d.ts +6 -1
- package/dist/hooks/map/useZoomToFeatures.d.ts +2 -2
- package/dist/hooks/serverNotifications/index.d.ts +0 -1
- package/dist/hooks/serverNotifications/useServerNotificationsContext.d.ts +1 -1
- package/dist/hooks/useDebouncedCallback.d.ts +1 -0
- package/dist/hooks/useWindowResize.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/react.cjs.development.js +517 -1253
- package/dist/react.cjs.development.js.map +1 -1
- package/dist/react.cjs.production.min.js +1 -1
- package/dist/react.cjs.production.min.js.map +1 -1
- package/dist/react.esm.js +514 -1246
- package/dist/react.esm.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/debounce.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +3 -3
- package/dist/components/Map/components/BuildingsLayer/BuildingsLayer.d.ts +0 -3
- package/dist/components/Map/components/BuildingsLayer/index.d.ts +0 -2
- package/dist/components/Map/components/BuildingsLayer/types.d.ts +0 -4
- package/dist/components/Map/components/index.d.ts +0 -2
- package/dist/components/MapContext/types.d.ts +0 -138
- package/dist/components/ResizablePanel/ResizablePanel.d.ts +0 -3
- package/dist/components/ResizablePanel/index.d.ts +0 -2
- package/dist/components/ResizablePanel/styled.d.ts +0 -11
- package/dist/components/ResizablePanel/types.d.ts +0 -14
- package/dist/core/attributes/index.d.ts +0 -1
- package/dist/core/geometrySelection/drawModeToGeometrySelectionType.d.ts +0 -3
- package/dist/core/geometrySelection/getGeometrySelectionTurfFeature.d.ts +0 -3
- package/dist/core/geometrySelection/index.d.ts +0 -2
- package/dist/core/types/index.d.ts +0 -2
- package/dist/core/types/map.d.ts +0 -5
- package/dist/hooks/map/useCurrentSelectedFeature.d.ts +0 -2
- package/dist/hooks/map/useEditingFeature.d.ts +0 -1
- package/dist/hooks/map/useEwktGeometry.d.ts +0 -1
- package/dist/hooks/map/useGeometryEditor.d.ts +0 -2
- package/dist/hooks/map/useGeometrySelection.d.ts +0 -2
- package/dist/hooks/map/useGeometrySelectionBuffer.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesCount.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesCurrentIndex.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesGeometryMasking.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesInitialized.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesLayerName.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesPagination.d.ts +0 -4
- package/dist/hooks/map/useSelectFeaturesStatisticsActive.d.ts +0 -1
- package/dist/hooks/map/useSelectFeaturesTotalCounts.d.ts +0 -1
- package/dist/hooks/map/useSelectedFeatures.d.ts +0 -2
- package/dist/hooks/map/useUpdateCurrentFeature.d.ts +0 -2
- package/dist/hooks/map/useZoomToLayer.d.ts +0 -7
- package/dist/hooks/useResizer.d.ts +0 -28
- package/dist/utils/geometryToWkt.d.ts +0 -2
- /package/dist/components/{Map/components/Layer → Layer}/Layer.d.ts +0 -0
- /package/dist/components/{Map/components/Layer → Layer}/RasterLayer.d.ts +0 -0
- /package/dist/components/{Map/components/Layer → Layer}/VectorLayer.d.ts +0 -0
- /package/dist/components/{Map/components/Layer → Layer}/constants.d.ts +0 -0
- /package/dist/{components → contexts}/MapContext/MapContext.d.ts +0 -0
- /package/dist/{components → contexts}/MapContext/MapProvider.d.ts +0 -0
- /package/dist/{components → contexts}/MapContext/index.d.ts +0 -0
- /package/dist/{components → contexts}/ServerNotificationsContext/ServerNotificationsContext.d.ts +0 -0
- /package/dist/{components → contexts}/ServerNotificationsContext/ServerNotificationsProvider.d.ts +0 -0
- /package/dist/{hooks/serverNotifications → contexts/ServerNotificationsContext/hooks}/useServerNotifications.d.ts +0 -0
- /package/dist/{components → contexts}/ServerNotificationsContext/index.d.ts +0 -0
- /package/dist/{components → contexts}/ServerNotificationsContext/types.d.ts +0 -0
- /package/dist/{core/attributes/types.d.ts → types/attribute.d.ts} +0 -0
- /package/dist/{core/types → types}/styling.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.cjs.development.js","sources":["../src/components/ErrorBoundary/styled.ts","../src/components/ErrorBoundary/index.tsx","../src/components/Map/styled.ts","../src/hooks/map/useMapContext.ts","../src/hooks/map/useCurrentSelectedFeature.ts","../src/components/MapContext/MapContext.ts","../src/components/MapContext/types.ts","../src/components/MapContext/MapProvider.tsx","../src/hooks/map/useGeometryEditor.ts","../src/hooks/map/useEditingFeature.ts","../src/hooks/map/useGeometrySelection.ts","../src/utils/date.ts","../src/utils/geometryToWkt.ts","../src/utils/isNumeric.ts","../src/utils/isObject.ts","../src/hooks/map/useEwktGeometry.ts","../src/hooks/map/useGeometrySelectionBuffer.ts","../src/hooks/map/useMapDraw/customModes.ts","../src/hooks/map/useMapDraw/customStyles.ts","../src/hooks/map/useMapDraw/index.ts","../src/hooks/map/useRedrawLayer.ts","../src/hooks/map/useSelectedFeatures.ts","../src/hooks/map/useSelectFeaturesCount.ts","../src/hooks/map/useSelectFeaturesCurrentIndex.ts","../src/hooks/map/useSelectFeaturesGeometryMasking.ts","../src/hooks/map/useSelectFeaturesInitialized.ts","../src/hooks/map/useSelectFeaturesLayerName.ts","../src/hooks/map/useSelectFeaturesPagination.ts","../src/hooks/map/useSelectFeaturesStatisticsActive.ts","../src/hooks/map/useSelectFeaturesTotalCounts.ts","../src/hooks/map/useUpdateCurrentFeature.ts","../src/core/classification/findAttributeInExpression.ts","../src/core/classification/getActualExtrusionHeight.ts","../src/core/classification/parseClientStyle.ts","../src/core/feature/convertSpToTurfFeature.ts","../src/core/geometrySelection/drawModeToGeometrySelectionType.ts","../src/core/geometrySelection/getGeometrySelectionTurfFeature.ts","../src/hooks/map/useZoomToFeatures.ts","../src/hooks/map/useZoomToLayer.ts","../src/hooks/map/useZoomToPoint.ts","../src/hooks/serverNotifications/useServerNotifications.ts","../src/components/ServerNotificationsContext/ServerNotificationsContext.ts","../src/hooks/serverNotifications/useServerNotificationsContext.ts","../src/hooks/useResizer.ts","../src/hooks/useToggle.ts","../src/components/Map/Map.tsx","../src/components/Map/components/BuildingsLayer/BuildingsLayer.tsx","../src/components/Map/components/Layer/RasterLayer.tsx","../src/components/Map/components/Layer/constants.ts","../src/components/Map/components/Layer/utils/getClientStyleItemPrefixSuffix.ts","../src/components/Map/components/Layer/VectorLayer.tsx","../src/components/Map/components/Layer/Layer.tsx","../src/components/ResizablePanel/styled.ts","../src/components/ResizablePanel/ResizablePanel.tsx","../src/components/ServerNotificationsContext/ServerNotificationsProvider.tsx"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const ErrorBoundaryContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n`;\n","import React, { Component } from \"react\";\n\nimport { ErrorBoundaryContainer } from \"./styled\";\n\nimport { ErrorBoundaryProps, ErrorBoundaryState } from \"./types\";\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n public state = { hasError: false };\n\n public static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n public componentDidCatch(error: Error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n public render() {\n const { children, errorContents } = this.props;\n const { hasError } = this.state;\n\n return !hasError ? (\n <>{children}</>\n ) : (\n <ErrorBoundaryContainer>\n {errorContents}\n </ErrorBoundaryContainer>\n );\n }\n}\n","import { CSSProperties } from \"react\";\nimport styled from \"styled-components\";\n\nexport const MapWrapper = styled.div<{ $zIndex?: CSSProperties[\"zIndex\"] }>`\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n z-index: ${({ $zIndex }) => $zIndex ?? 1};\n\n .mapbox-gl-draw_trash {\n display: none;\n }\n\n .mapboxgl-ctrl-logo {\n display: none;\n }\n\n .mapboxgl-ctrl.mapboxgl-ctrl-attrib {\n display: none;\n }\n\n .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {\n width: 350px;\n }\n`;\n","import { useContext } from \"react\";\n\nimport { MapContext } from \"../../components\";\n\nexport const useMapContext = () => {\n return useContext(MapContext);\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components/MapContext\";\n\nexport const useCurrentSelectedFeature = (): SelectedFeature => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.find(item => item.id === selectFeatures.currentId);\n }, [selectFeatures]);\n};\n","import { createContext } from \"react\";\n\nimport { MapContextProps } from \"./types\";\n\nexport const MapContext = createContext<MapContextProps>({});\n","import { Dispatch, MutableRefObject, PropsWithChildren, SetStateAction } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\nimport { FeatureDc, LayerDefinitionDc, GeometryType } from \"@evergis/api\";\nimport { Feature } from \"geojson\";\n\nexport enum BaseMapTheme {\n Light = \"light\",\n Dark = \"dark\",\n}\n\nexport interface BaseMapItem {\n name: string;\n source: string;\n preview?: string;\n imgSrc?: string;\n title: string;\n theme?: BaseMapTheme;\n opacity?: number;\n color?: string;\n}\n\nexport enum GeometrySelectionTypes {\n Point = \"select_point\",\n Line = \"select_line\",\n Circle = \"select_circle\",\n Rect = \"select_rect\",\n Polygon = \"select_polygon\",\n Zones = \"zones_selection\",\n Coordinates = \"xy\",\n Route = \"selection_route\",\n}\n\nexport enum GeometrySelectionToolTypes {\n Replace = \"Replace\",\n Unite = \"Unite\",\n Crop = \"Crop\",\n Edit = \"Edit\",\n}\n\nexport type SelectionHistoryFeature = Feature;\n\nexport interface SelectionHistory {\n features: Array<SelectionHistoryFeature[]>;\n zones?: Array<Array<Feature[]>>;\n step: number;\n}\n\nexport enum GeometrySelectionZoneTypes {\n Walking = \"Walking\",\n Car = \"Car\",\n}\n\nexport enum GeometrySelectionRouteTypes {\n Walking = \"Walking\",\n Car = \"Car\",\n}\n\nexport interface GeometrySelectionSettings {\n zoneDuration?: number;\n zoneType?: GeometrySelectionZoneTypes;\n routeType?: GeometrySelectionRouteTypes;\n bufferRadius?: string;\n bufferMultiplier?: string;\n bufferInclude?: boolean;\n selectOutside?: boolean;\n}\n\nexport interface GeometrySelection {\n active?: boolean;\n loading?: boolean;\n type?: GeometrySelectionTypes;\n currentTool?: GeometrySelectionToolTypes;\n history?: SelectionHistory;\n editHistory?: SelectionHistory;\n isBuffer?: boolean;\n settings?: GeometrySelectionSettings;\n}\n\nexport enum GeometryEditorMode {\n Create,\n Edit,\n Transform,\n Expand,\n Unite,\n Subtract,\n}\n\nexport type Coordinates = [number, number];\n\nexport type Positions = Coordinates | Coordinates[] | Coordinates[][];\n\nexport interface GeometryEditor {\n active: boolean;\n geometryType?: GeometryType;\n layerName?: string;\n geometry?: Positions;\n mode?: GeometryEditorMode;\n}\n\nexport interface FeaturedDcExtendedGeometry extends Omit<FeatureDc[\"geometry\"], \"coordinates\"> {\n coordinates?: any;\n}\n\nexport interface FeatureDcExtended extends Omit<FeatureDc, \"geometry\"> {\n geometry: FeaturedDcExtendedGeometry;\n layer: string;\n}\n\nexport interface SelectedFeature extends FeatureDcExtended {\n layerDefinition: LayerDefinitionDc;\n}\n\nexport interface SelectFeatures {\n initialized?: boolean;\n layerName?: string;\n currentId: string | null;\n selectionOffset?: number;\n features: Record<string, SelectedFeature[]>;\n totalCounts: Record<string, number>;\n statisticsActive?: boolean;\n geometryMasking?: boolean;\n}\n\nexport interface MapContextProps {\n map?: MutableRefObject<MapboxGLMap>;\n draw?: MutableRefObject<Omit<MapboxDraw, \"getDefaultPosition\">>;\n loaded?: boolean;\n setLoaded?: Dispatch<SetStateAction<boolean>>;\n basemapItems?: BaseMapItem[];\n basemapName?: string;\n setBasemapName?: Dispatch<SetStateAction<string>>;\n defaultBasemap?: string;\n globeProjection?: boolean;\n setGlobeProjection?: Dispatch<SetStateAction<boolean>>;\n geometrySelection?: GeometrySelection;\n setGeometrySelection?: Dispatch<SetStateAction<GeometrySelection>>;\n resetGeometrySelection?: VoidFunction;\n geometryEditor?: GeometryEditor;\n setGeometryEditor?: Dispatch<SetStateAction<GeometryEditor>>;\n resetGeometryEditor?: VoidFunction;\n selectFeatures?: SelectFeatures;\n setNextFeature?: VoidFunction;\n setPrevFeature?: VoidFunction;\n setSelectedFeatures?: (payload?: SelectFeatures[\"features\"], currentId?: any, offset?: number) => void;\n setSelectedFeaturesTotalCounts?: Dispatch<SetStateAction<SelectFeatures[\"totalCounts\"]>>;\n setSelectFeaturesInitialized?: Dispatch<SetStateAction<boolean>>;\n setSelectFeaturesLayerName?: Dispatch<SetStateAction<string>>;\n setSelectFeaturesStatisticsActive?: Dispatch<SetStateAction<boolean>>;\n setSelectFeaturesGeometryMasking?: Dispatch<SetStateAction<boolean>>;\n updateCurrentFeature?: Dispatch<SetStateAction<Partial<SelectedFeature>>>;\n resetSelectedFeatures?: VoidFunction;\n}\n\nexport interface MapProviderProps extends PropsWithChildren {\n basemapItems: BaseMapItem[];\n defaultBasemap: string;\n}\n","import React, { FC, useCallback, useRef, useState } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\nimport { changeProps } from \"find-and\";\n\nimport { MapContext } from \"./MapContext\";\n\nimport {\n GeometrySelectionRouteTypes,\n GeometrySelectionToolTypes,\n GeometrySelectionTypes,\n GeometrySelectionZoneTypes,\n GeometrySelection,\n MapProviderProps,\n GeometryEditor,\n SelectFeatures,\n SelectedFeature,\n FeatureDcExtended,\n} from \"./types\";\n\nconst initialGeometrySelection: GeometrySelection = {\n active: true,\n loading: false,\n type: GeometrySelectionTypes.Point,\n currentTool: GeometrySelectionToolTypes.Replace,\n history: {\n features: [],\n zones: [],\n step: -1,\n },\n editHistory: {\n features: [],\n step: -1,\n },\n isBuffer: false,\n settings: {\n zoneDuration: 60,\n zoneType: GeometrySelectionZoneTypes.Walking,\n routeType: GeometrySelectionRouteTypes.Walking,\n bufferRadius: \"\",\n bufferMultiplier: \"1\",\n bufferInclude: true,\n selectOutside: false,\n },\n};\n\nconst initialGeometryEditor: GeometryEditor = {\n active: false,\n};\n\nconst initialSelectFeatures: SelectFeatures = {\n initialized: false,\n layerName: undefined,\n currentId: null,\n selectionOffset: 0,\n features: {},\n totalCounts: {},\n statisticsActive: false,\n geometryMasking: false,\n};\n\nexport const MapProvider: FC<MapProviderProps> = ({ basemapItems, defaultBasemap, children }) => {\n const map = useRef<MapboxGLMap | undefined>();\n const draw = useRef<MapboxDraw | undefined>();\n const [loaded, setLoaded] = useState<boolean>(false);\n const [basemapName, setBasemapName] = useState(defaultBasemap);\n const [globeProjection, setGlobeProjection] = useState(false);\n const [geometrySelection, setGeometrySelection] = useState<GeometrySelection>(initialGeometrySelection);\n const [geometryEditor, setGeometryEditor] = useState<GeometryEditor>(initialGeometryEditor);\n const [selectFeatures, setSelectFeatures] = useState<SelectFeatures>(initialSelectFeatures);\n\n const resetGeometrySelection = useCallback(() => {\n setGeometrySelection(initialGeometrySelection);\n }, []);\n\n const resetGeometryEditor = useCallback(() => {\n setGeometryEditor(initialGeometryEditor);\n }, []);\n\n const setNextFeature = useCallback(() => {\n setSelectFeatures((state: SelectFeatures) => {\n const { layerName, features, currentId } = state;\n const currentIndex = features?.[layerName]?.findIndex(item => item.id === currentId);\n\n if (currentIndex === features?.[layerName]?.length - 1) {\n return state;\n }\n\n const nextId = features?.[layerName]?.[currentIndex + 1]?.id;\n\n return {\n ...state,\n currentId: nextId,\n };\n });\n }, []);\n\n const setPrevFeature = useCallback(() => {\n setSelectFeatures((state: SelectFeatures) => {\n const { layerName, features, currentId } = state;\n const currentIndex = features?.[layerName]?.findIndex(item => item.id === currentId);\n\n if (currentIndex === 0) {\n return state;\n }\n\n const prevId = features?.[layerName]?.[currentIndex - 1]?.id;\n\n return {\n ...state,\n currentId: prevId,\n };\n });\n }, []);\n\n const setSelectedFeatures = useCallback((payload?: SelectFeatures[\"features\"], currentId?: any, offset?: number) => {\n setSelectFeatures((state: SelectFeatures) => {\n const features = payload ?? {};\n const firstNotNullLayerName = Object.keys(features).find(key => features[key].length > 0);\n const featureIdsToSelect = features[firstNotNullLayerName]?.map(({ id }: Pick<FeatureDcExtended, \"id\">) => id);\n\n return {\n ...state,\n features,\n layerName: firstNotNullLayerName,\n currentId: currentId ?? featureIdsToSelect?.[0],\n selectionOffset: offset,\n };\n });\n }, []);\n\n const setSelectedFeaturesTotalCounts = useCallback((payload?: SelectFeatures[\"totalCounts\"]) => {\n setSelectFeatures((state: SelectFeatures) => ({\n ...state,\n totalCounts: payload,\n }));\n }, []);\n\n const setSelectFeaturesInitialized = useCallback((payload?: boolean) => {\n setSelectFeatures((state: SelectFeatures) => ({\n ...state,\n initialized: payload,\n }));\n }, []);\n\n const setSelectFeaturesLayerName = useCallback((payload?: string) => {\n setSelectFeatures((state: SelectFeatures) => ({\n ...state,\n layerName: payload,\n currentId: state.features?.[payload]?.[0]?.id,\n selectionOffset: 0,\n }));\n }, []);\n\n const setSelectFeaturesStatisticsActive = useCallback((payload?: boolean) => {\n setSelectFeatures((state: SelectFeatures) => ({\n ...state,\n statisticsActive: payload,\n }));\n }, []);\n\n const setSelectFeaturesGeometryMasking = useCallback((payload?: boolean) => {\n setSelectFeatures((state: SelectFeatures) => ({\n ...state,\n geometryMasking: payload,\n }));\n }, []);\n\n const updateCurrentFeature = useCallback((payload?: SelectedFeature) => {\n setSelectFeatures((state: SelectFeatures) => ({\n ...state,\n features: {\n ...state.features,\n [state.layerName]: changeProps(state.features?.[state.layerName] ?? [], { id: state.currentId }, payload),\n },\n }));\n }, []);\n\n const resetSelectedFeatures = useCallback(() => {\n setSelectFeatures(initialSelectFeatures);\n }, []);\n\n return (\n <MapContext.Provider\n value={{\n map,\n draw,\n loaded,\n setLoaded,\n basemapItems,\n basemapName,\n setBasemapName,\n defaultBasemap,\n globeProjection,\n setGlobeProjection,\n geometrySelection,\n setGeometrySelection,\n resetGeometrySelection,\n geometryEditor,\n setGeometryEditor,\n resetGeometryEditor,\n selectFeatures,\n setNextFeature,\n setPrevFeature,\n setSelectedFeatures,\n setSelectedFeaturesTotalCounts,\n setSelectFeaturesInitialized,\n setSelectFeaturesLayerName,\n setSelectFeaturesStatisticsActive,\n setSelectFeaturesGeometryMasking,\n updateCurrentFeature,\n resetSelectedFeatures,\n }}\n >\n {children}\n </MapContext.Provider>\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { GeometryEditor } from \"../../components\";\n\nexport const useGeometryEditor = (): [GeometryEditor, (state: Partial<GeometryEditor>) => void] => {\n const { geometryEditor, setGeometryEditor } = useMapContext();\n\n const update = useCallback(\n (newState: Partial<GeometryEditor>) => {\n setGeometryEditor(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n [setGeometryEditor],\n );\n\n return [geometryEditor, update];\n};\n","import { useMemo } from \"react\";\n\nimport { GeometryEditorMode } from \"../../components/MapContext\";\n\nimport { useGeometryEditor } from \"./useGeometryEditor\";\nimport { useCurrentSelectedFeature } from \"./useCurrentSelectedFeature\";\n\nexport const useEditingFeature = (): boolean => {\n const [{ layerName, active, mode }] = useGeometryEditor();\n const currentSelectedFeature = useCurrentSelectedFeature();\n\n return useMemo(() => {\n return (\n active &&\n ((mode === GeometryEditorMode.Edit && layerName === currentSelectedFeature?.layer) ||\n mode === GeometryEditorMode.Create)\n );\n }, [active, currentSelectedFeature, layerName, mode]);\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { GeometrySelection } from \"../../components\";\n\nexport const useGeometrySelection = (): [GeometrySelection, (state: Partial<GeometrySelection>) => void] => {\n const { geometrySelection, setGeometrySelection } = useMapContext();\n\n const updateGeometrySelection = useCallback(\n (newState: Partial<GeometrySelection>) => {\n setGeometrySelection(prevState => ({\n ...prevState,\n ...newState,\n }));\n },\n [setGeometrySelection],\n );\n\n return [geometrySelection, updateGeometrySelection];\n};\n","import { parseJSON, parseISO, isValid, format, toDate } from \"date-fns\";\n\nexport const NO_CONTENT_VALUE = \"—\";\n\nexport type DateType = number | Date;\nexport type RawDateType = string | DateType;\n\nexport enum DateFormat {\n ClientDefaultFormat = \"dd.MM.yyyy HH:mm\",\n DateTime = \"dd.MM.yyyy HH:mm:ss\",\n UTC = \"yyyy-MM-dd'T'HH:mm:ss.sssxxx\",\n AxisTooltip = \"d MMMM yyyy\",\n}\n\ninterface FormatDateOptions {\n dateFormat?: DateFormat;\n defaultValue?: RawDateType;\n}\n\nconst stringDateParsers: ((date: string) => DateType)[] = [parseJSON, parseISO, rawDate => new Date(rawDate)];\n\nexport const getDate = (rawDate?: RawDateType | null): Date | null => {\n if (!rawDate) return null;\n\n if (typeof rawDate === \"string\") {\n for (const parser of stringDateParsers) {\n const date = parser(rawDate);\n\n if (isValid(date)) {\n return toDate(date);\n }\n }\n\n return null;\n }\n\n const parsedDate = toDate(rawDate);\n\n return isValid(parsedDate) ? parsedDate : null;\n};\n\nexport const formatDate = (\n date?: RawDateType,\n { dateFormat = DateFormat.ClientDefaultFormat, defaultValue = NO_CONTENT_VALUE }: FormatDateOptions = {},\n): string => {\n const dateValue = date ? getDate(date) : null;\n\n if (isValid(dateValue)) {\n return format(dateValue as Date, dateFormat);\n }\n\n return defaultValue.toString();\n};\n","import { stringify } from \"wkt\";\n\nimport { SelectionHistoryFeature } from \"../components\";\n\nexport const geometryToWkt = (features: SelectionHistoryFeature[] = []): string => {\n if (features.length === 0) {\n return \"\";\n }\n\n return stringify(features[0]);\n};\n","export const isNumeric = (number: string | number): boolean =>\n !isNaN(parseFloat(number as string)) && isFinite(number as number);\n","export function isObject<T>(value: T | object): value is object {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { useMemo } from \"react\";\nimport { isEmpty } from \"lodash\";\n\nimport { useGeometrySelection } from \"./useGeometrySelection\";\nimport { geometryToWkt } from \"../../utils\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const useEwktGeometry = () => {\n const [{ history, type }] = useGeometrySelection();\n\n return useMemo(() => {\n if (history.step === -1) {\n return \"\";\n }\n\n return type === GeometrySelectionTypes.Zones\n ? !isEmpty(history.zones[history.step]?.[0])\n ? `SRID=3857;${geometryToWkt(history.zones[history.step]?.[0])}`\n : `SRID=3857;${geometryToWkt(history.features[history.step])}`\n : `SRID=3857;${geometryToWkt(history.features[history.step])}`;\n }, [history.features, history.step, history.zones, type]);\n};\n","import { useMemo } from \"react\";\n\nimport { useGeometrySelection } from \"./useGeometrySelection\";\n\nexport const useGeometrySelectionBuffer = (): string | undefined => {\n const [\n {\n settings: { bufferRadius, bufferMultiplier },\n isBuffer,\n },\n ] = useGeometrySelection();\n\n return useMemo((): string | undefined => {\n if (!isBuffer || !bufferRadius) {\n return undefined;\n }\n\n return Number((+bufferRadius || 0) * +bufferMultiplier).toFixed(2);\n }, [isBuffer, bufferRadius, bufferMultiplier]);\n};\n","import MapboxDraw, { DrawCustomMode } from \"@mapbox/mapbox-gl-draw\";\n\nimport { ExtendedMapboxDrawModes } from \"../../../core\";\n\nexport const customModes = MapboxDraw.modes as ExtendedMapboxDrawModes;\n\nconst StaticMode = {} as DrawCustomMode;\n\nStaticMode.onSetup = function () {\n this.setActionableState(undefined);\n\n return {};\n};\n\nStaticMode.toDisplayFeatures = function (state, geojson, display) {\n display(geojson);\n};\n\ncustomModes.static = StaticMode;\n","export const customStyles = [\n {\n id: \"gl-draw-point\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-inactive-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"false\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-active-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"true\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-fill-static\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-line\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"LineString\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-fill\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-polygon-midpoint\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"midpoint\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-stroke-active\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-and-line-vertex-active\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"meta\", \"vertex\"], [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n];\n","import { useEffect } from \"react\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { customModes } from \"./customModes\";\nimport { customStyles } from \"./customStyles\";\n\nimport { useMapContext } from \"../useMapContext\";\n\nconst draw = new MapboxDraw({\n displayControlsDefault: false,\n styles: customStyles,\n modes: customModes,\n defaultMode: \"draw_point\",\n controls: {\n trash: true,\n },\n});\n\nexport const useMapDraw = (triggerDeps: Array<unknown> = []) => {\n const { map, draw: drawContext, loaded, basemapName } = useMapContext();\n\n useEffect(() => {\n if (!loaded || !map.current) {\n return;\n }\n\n drawContext.current = draw;\n map.current.addControl(drawContext.current);\n }, [loaded]); // eslint-disable-line\n\n useEffect(() => {\n if (map.current && map.current.hasControl(drawContext.current)) {\n map.current.removeControl(drawContext.current);\n map.current.addControl(drawContext.current);\n }\n }, [basemapName, ...triggerDeps]); // eslint-disable-line\n};\n","import { useCallback } from \"react\";\nimport { VectorSourceImpl } from \"mapbox-gl\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useRedrawLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (layerName: string) => {\n const layerTileSource: VectorSourceImpl = map.current.getSource(layerName);\n\n layerTileSource.setTiles(layerTileSource.tiles);\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components\";\n\nexport const useSelectedFeatures = (): [\n Record<string, SelectedFeature[]>,\n (features: Record<string, SelectedFeature[]>) => void,\n] => {\n const { selectFeatures, setSelectedFeatures } = useMapContext();\n\n const updatSelectedFeatures = useCallback(\n (features: Record<string, SelectedFeature[]>) => {\n setSelectedFeatures(features);\n },\n [setSelectedFeatures],\n );\n\n return [selectFeatures.features ?? ({} as Record<string, SelectedFeature[]>), updatSelectedFeatures];\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesCount = (): number => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.length ?? 0;\n }, [selectFeatures]);\n};\n","import { useMemo } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesCurrentIndex = (): number => {\n const { selectFeatures } = useMapContext();\n\n return useMemo(() => {\n return selectFeatures.features?.[selectFeatures.layerName]?.length\n ? selectFeatures.features?.[selectFeatures.layerName]?.findIndex(\n feature => feature.id === selectFeatures.currentId,\n )\n : -1;\n }, [selectFeatures]);\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesGeometryMasking = (): [boolean, (state: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesGeometryMasking } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesGeometryMasking(state);\n },\n [setSelectFeaturesGeometryMasking],\n );\n\n return [selectFeatures.geometryMasking, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesInitialized = (): [boolean, (value: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesInitialized } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesInitialized(state);\n },\n [setSelectFeaturesInitialized],\n );\n\n return [selectFeatures.initialized, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesLayerName = (): [string, (name?: string) => void] => {\n const { selectFeatures, setSelectFeaturesLayerName } = useMapContext();\n\n const update = useCallback(\n (name: string) => {\n setSelectFeaturesLayerName(name);\n },\n [setSelectFeaturesLayerName],\n );\n\n return [selectFeatures.layerName, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesPagination = () => {\n const { setNextFeature, setPrevFeature } = useMapContext();\n\n const onNext = useCallback(() => {\n setNextFeature();\n }, [setNextFeature]);\n\n const onPrev = useCallback(() => {\n setPrevFeature();\n }, [setPrevFeature]);\n\n return { onNext, onPrev } as const;\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesStatisticsActive = (): [boolean, (state: boolean) => void] => {\n const { selectFeatures, setSelectFeaturesStatisticsActive } = useMapContext();\n\n const update = useCallback(\n (state: boolean) => {\n setSelectFeaturesStatisticsActive(state);\n },\n [setSelectFeaturesStatisticsActive],\n );\n\n return [selectFeatures.statisticsActive, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useSelectFeaturesTotalCounts = (): [\n Record<string, number>,\n (totalCounts: Record<string, number>) => void,\n] => {\n const { selectFeatures, setSelectedFeaturesTotalCounts } = useMapContext();\n\n const update = useCallback(\n (totalCounts: Record<string, number>) => {\n setSelectedFeaturesTotalCounts(totalCounts);\n },\n [setSelectedFeaturesTotalCounts],\n );\n\n return [selectFeatures.totalCounts ?? {}, update];\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nimport { SelectedFeature } from \"../../components\";\n\nexport const useUpdateCurrentFeature = () => {\n const { updateCurrentFeature } = useMapContext();\n\n return useCallback(\n (values: Partial<SelectedFeature>) => {\n updateCurrentFeature(values);\n },\n [updateCurrentFeature],\n );\n};\n","import { ExpressionSpecification } from \"mapbox-gl\";\n\nexport const findAttributeInExpression = (expression: ExpressionSpecification): string[] => {\n if (Array.isArray(expression) && expression.length === 2 && expression[0] === \"get\") {\n return [expression[1]];\n }\n\n return expression.reduce((acc: string[], curr) => {\n if (!Array.isArray(curr)) {\n return acc;\n }\n\n if (curr[0] === \"get\") {\n return [...new Set([...acc, curr[1]])];\n }\n\n return [...new Set([...acc, ...findAttributeInExpression(curr as ExpressionSpecification)])];\n }, []);\n};\n","import { AnyPaint } from \"mapbox-gl\";\n\nexport const getActualExtrusionHeight = (paint: AnyPaint) => {\n return Array.isArray(paint?.[\"fill-extrusion-height\"]) && paint?.[\"fill-extrusion-height\"][0] === \"+\"\n ? paint?.[\"fill-extrusion-height\"][1]\n : paint?.[\"fill-extrusion-height\"];\n};\n","import { isEmpty } from \"lodash\";\nimport { ExpressionSpecification } from \"mapbox-gl\";\n\nimport { findAttributeInExpression } from \"./findAttributeInExpression\";\n\nimport { ClientStyle } from \"../types\";\n\nexport const parseClientStyle = (style?: ClientStyle): string[] => {\n if (!style) {\n return [];\n }\n\n return style?.items?.reduce((acc: string[], curr) => {\n if (!curr.paint || isEmpty(curr.paint)) {\n return acc;\n }\n\n return Object.entries(curr.paint)?.reduce((paintAcc: string[], [, value]) => {\n if (!Array.isArray(value)) {\n return paintAcc;\n }\n\n return [...new Set([...paintAcc, ...findAttributeInExpression(value as ExpressionSpecification)])];\n }, []);\n }, []);\n};\n","import { GeometryType } from \"@evergis/api\";\nimport { multiLineString, multiPoint, point, polygon } from \"@turf/turf\";\nimport { Feature } from \"geojson\";\n\nimport { FeaturedDcExtendedGeometry } from \"../../components\";\n\nexport const convertSpToTurfFeature = (geometry?: FeaturedDcExtendedGeometry): Feature<any> | undefined => {\n if (!geometry) {\n return;\n }\n\n switch (geometry.type) {\n case GeometryType.Point:\n return point(geometry.coordinates);\n case GeometryType.Multipoint:\n return multiPoint(geometry.coordinates);\n case GeometryType.Polyline:\n return multiLineString(geometry.coordinates);\n case GeometryType.Polygon:\n case GeometryType.Envelope:\n return polygon(geometry.coordinates);\n default:\n }\n};\n","import { DrawMode } from \"@mapbox/mapbox-gl-draw\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const drawModeToGeometrySelectionType = (mode: DrawMode | string): GeometrySelectionTypes => {\n switch (mode) {\n case \"draw_point\":\n return GeometrySelectionTypes.Point;\n case \"draw_polygon\":\n return GeometrySelectionTypes.Polygon;\n case \"draw_line_string\":\n return GeometrySelectionTypes.Line;\n default:\n return GeometrySelectionTypes.Point;\n }\n};\n","import { toMercator, toWgs84, point, polygon, lineString } from \"@turf/turf\";\nimport { Feature, LineString, Point, Polygon, Position } from \"geojson\";\n\nimport { GeometrySelectionTypes } from \"../../components\";\n\nexport const getGeometrySelectionTurfFeature = (\n coordinates: Position | Position[] | Position[][] | Position[][][],\n selectionType: GeometrySelectionTypes,\n toWgs?: boolean,\n): Feature<Point | LineString | Polygon> => {\n if (toWgs) {\n switch (selectionType) {\n case GeometrySelectionTypes.Point:\n return toWgs84(point(coordinates as Position));\n case GeometrySelectionTypes.Polygon:\n return toWgs84(polygon(coordinates as Position[][]));\n case GeometrySelectionTypes.Line:\n return toWgs84(lineString(coordinates as Position[]));\n default:\n }\n }\n\n switch (selectionType) {\n case GeometrySelectionTypes.Point:\n return toMercator(point(coordinates as Position));\n case GeometrySelectionTypes.Polygon:\n return toMercator(polygon(coordinates as Position[][]));\n case GeometrySelectionTypes.Line:\n return toMercator(lineString(coordinates as Position[]));\n default:\n }\n};\n","import { useCallback } from \"react\";\nimport { bbox } from \"@turf/turf\";\n\nimport { useMapContext } from \"./useMapContext\";\nimport { convertSpToTurfFeature } from \"../../core\";\n\nimport { FeatureDcExtended } from \"../../components\";\n\nexport const useZoomToFeatures = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (features?: FeatureDcExtended[], padding?: number) => {\n if (!features) {\n return;\n }\n\n const currentFeatureCenter = bbox({\n type: \"FeatureCollection\",\n features: features.map(feature => convertSpToTurfFeature(feature.geometry)),\n });\n\n map.current.fitBounds(currentFeatureCenter as [number, number, number, number], { padding: padding ?? 150 });\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\nimport { BulkExtentsDc } from \"@evergis/api\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nconst DEFAULT_PADDING = 50;\n\ninterface ZoomToLayerOptions {\n discardFilters?: boolean;\n padding?: number;\n}\n\nexport const useZoomToLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n async (bulkExtent: BulkExtentsDc, options?: ZoomToLayerOptions) => {\n if (!bulkExtent || !bulkExtent.overall) {\n return;\n }\n\n map.current.fitBounds(\n [...bulkExtent.overall.coordinates[0], ...bulkExtent.overall.coordinates[1]] as [\n number,\n number,\n number,\n number,\n ],\n { padding: options?.padding ?? DEFAULT_PADDING },\n );\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useZoomToPoint = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (options, callback?: VoidFunction) => {\n if (map.current) {\n if (callback) {\n map.current.once(\"moveend\", () => {\n callback();\n });\n }\n\n map.current.flyTo(options);\n } else {\n callback?.();\n }\n },\n [map],\n );\n};\n","import { useEffect, useRef, useState } from \"react\";\nimport { HubConnection, HubConnectionBuilder, LogLevel } from \"@microsoft/signalr\";\n\nexport const useServerNotifications = (url: string, initialized: boolean): HubConnection | null => {\n const hubConnection = useRef<HubConnection | null>(null);\n const [connection, setConnection] = useState<HubConnection | null>(null);\n\n useEffect(() => {\n if (!initialized) {\n return;\n }\n\n hubConnection.current = new HubConnectionBuilder()\n .withUrl(url, {\n withCredentials: true,\n })\n .configureLogging(LogLevel.Information)\n .build();\n\n hubConnection.current\n .start()\n .then(() => console.info(\"Серверные нотификации подключены\"))\n .catch(err => console.info(\"Ошибка:\", err))\n .finally(() => setConnection(hubConnection.current));\n }, [initialized]); // eslint-disable-line\n\n useEffect(() => {\n if (!connection || connection.state !== \"Connected\") {\n return;\n }\n\n connection\n .invoke(\"SubscribeNotifications\", [])\n .then(() => console.info(\"Подписка `SubscribeNotifications` оформлена\"))\n .catch(err => console.info(\"Ошибка подписки `SubscribeNotifications`:\", err));\n }, [connection]);\n\n return connection;\n};\n","import { createContext } from \"react\";\n\nimport { ServerNotificationsContextProps } from \"./types\";\n\nexport const ServerNotificationsContext = createContext<ServerNotificationsContextProps>({});\n","import { useContext } from \"react\";\n\nimport { ServerNotificationsContext } from \"../../components/ServerNotificationsContext/ServerNotificationsContext\";\n\nexport const useServerNotificationsContext = () => {\n return useContext(ServerNotificationsContext);\n};\n","import { useCallback, useLayoutEffect, useRef } from \"react\";\nimport { isNil } from \"lodash\";\n\nexport enum VerticalPosition {\n Top = \"top\",\n Bottom = \"bottom\",\n}\n\nexport enum HorizontalPosition {\n Left = \"left\",\n Right = \"right\",\n}\n\nexport interface ResizerOptions {\n handleVerticalPosition?: VerticalPosition;\n handleHorizontalPosition?: HorizontalPosition;\n minWidth?: number;\n maxWidth?: number;\n minHeight?: number;\n maxHeight?: number;\n horizontal?: boolean;\n vertical?: boolean;\n useResize?: boolean;\n onResize?: (width: number, height: number) => void;\n onResizeEnd?: (width: number, height: number) => void;\n onResizeStart?: (width: number, height: number) => void;\n}\n\nexport const useResizer = ({\n handleVerticalPosition,\n handleHorizontalPosition,\n minWidth = Number.MIN_SAFE_INTEGER,\n maxWidth = Number.MAX_SAFE_INTEGER,\n horizontal = true,\n minHeight = Number.MIN_SAFE_INTEGER,\n maxHeight = Number.MAX_SAFE_INTEGER,\n vertical = true,\n useResize = false,\n onResize,\n onResizeEnd,\n onResizeStart,\n}: ResizerOptions) => {\n const containerRef = useRef<HTMLDivElement>();\n const verticalHandleRef = useRef<HTMLDivElement>();\n const horizontalHandleRef = useRef<HTMLDivElement>();\n\n const updateSizes = useCallback(\n (width: number, height: number) => {\n let newWidth = width;\n let newHeight = height;\n\n if (horizontal && newWidth < minWidth) {\n newWidth = minWidth;\n }\n\n if (horizontal && newWidth > Math.min(window.innerWidth - horizontalHandleRef.current?.clientWidth, maxWidth)) {\n newWidth = maxWidth;\n }\n\n if (vertical && newHeight < minHeight) {\n newHeight = minHeight;\n }\n\n if (vertical && newHeight > Math.min(window.innerHeight - verticalHandleRef.current?.clientHeight, maxHeight)) {\n newHeight = maxHeight;\n }\n\n if (horizontal) {\n requestAnimationFrame(() => {\n if (!isNil(containerRef.current)) {\n containerRef.current.style.width = `${newWidth}px`;\n }\n });\n }\n\n if (vertical) {\n requestAnimationFrame(() => {\n if (!isNil(containerRef.current)) {\n containerRef.current.style.height = `${newHeight}px`;\n }\n });\n }\n\n onResize?.(newWidth, newHeight);\n },\n [minWidth, maxWidth, minHeight, maxHeight, horizontal, vertical], // eslint-disable-line\n );\n\n const onPointerMove = useCallback(\n (pointerMoveEvent: PointerEvent) => {\n const { x, y } = containerRef.current?.getBoundingClientRect();\n const reverseHorizontal = handleHorizontalPosition === HorizontalPosition.Right;\n const reverseVertical = handleVerticalPosition === VerticalPosition.Bottom;\n\n const newWidth = reverseHorizontal\n ? pointerMoveEvent.pageX - x\n : containerRef.current?.offsetWidth + x - pointerMoveEvent.pageX;\n const newHeight = reverseVertical\n ? pointerMoveEvent.pageY - y\n : containerRef.current?.offsetHeight + y - pointerMoveEvent.pageY;\n\n document.body.style.userSelect = \"none\";\n\n updateSizes(newWidth, newHeight);\n },\n [updateSizes],\n );\n\n const onPointerDown = useCallback(() => {\n const onPointerUp = () => {\n document.body.style.userSelect = \"initial\";\n document.body.removeEventListener(\"pointermove\", onPointerMove);\n\n if (!isNil(containerRef.current)) {\n onResizeEnd?.(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n };\n\n if (!isNil(containerRef.current)) {\n onResizeStart?.(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n\n document.body.addEventListener(\"pointermove\", onPointerMove);\n document.body.addEventListener(\"pointerup\", onPointerUp, { once: true });\n }, [onPointerMove]); // eslint-disable-line\n\n useLayoutEffect(() => {\n if (useResize && !isNil(containerRef.current)) {\n updateSizes(containerRef.current.offsetWidth, containerRef.current.offsetHeight);\n }\n }, [updateSizes, useResize]);\n\n return {\n containerRef,\n verticalHandleRef,\n horizontalHandleRef,\n onPointerDown,\n };\n};\n","import { useCallback, useState } from \"react\";\n\nexport const useToggle = (initial?: boolean): [boolean, VoidFunction, (value: boolean) => void] => {\n const [state, setState] = useState(initial !== undefined ? initial : false);\n\n const toggle = useCallback(() => setState(!state), [state]);\n\n return [state, toggle, setState];\n};\n","import React, { FC } from \"react\";\nimport { default as MapGL } from \"react-map-gl/mapbox\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport \"@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css\";\n\nimport { MapWrapper } from \"./styled\";\n\nimport { useMapContext, useMapDraw } from \"../../hooks\";\n\nimport { MapProps } from \"./types\";\n\nimport \"mapbox-gl/dist/mapbox-gl.css\";\n\nexport const Map: FC<MapProps> = ({\n zIndex,\n lowerSiblings,\n upperSiblings,\n drawTriggerDeps,\n onError,\n children,\n ...rest\n}) => {\n const { map, setLoaded } = useMapContext();\n\n useMapDraw(drawTriggerDeps);\n\n return (\n <MapWrapper $zIndex={zIndex}>\n {lowerSiblings}\n <MapGL\n {...rest}\n renderWorldCopies\n antialias\n doubleClickZoom={false}\n cursor=\"default\"\n onLoad={e => {\n map.current = e.target as MapboxGLMap;\n\n map.current.on(\"error\", onError);\n\n setLoaded(true);\n }}\n >\n {children}\n </MapGL>\n {upperSiblings}\n </MapWrapper>\n );\n};\n","import React, { FC } from \"react\";\nimport { Layer as MapboxLayer } from \"react-map-gl/mapbox\";\n\nimport { BuildingsLayerProps } from \"./types\";\n\nexport const BuildingsLayer: FC<BuildingsLayerProps> = ({ beforeId, transparent }) => {\n return (\n <MapboxLayer\n id=\"mapbox-3d-buildings\"\n source=\"composite\"\n source-layer=\"building\"\n filter={[\"==\", \"extrude\", \"true\"]}\n type=\"fill-extrusion\"\n minzoom={15}\n beforeId={beforeId}\n paint={{\n \"fill-extrusion-color\": \"#aaaaaa\",\n \"fill-extrusion-height\": [\"interpolate\", [\"linear\"], [\"zoom\"], 15, 0, 15.05, [\"get\", \"height\"]],\n \"fill-extrusion-base\": [\"interpolate\", [\"linear\"], [\"zoom\"], 15, 0, 15.05, [\"get\", \"min_height\"]],\n \"fill-extrusion-opacity\": transparent ? 0 : 0.5,\n }}\n />\n );\n};\n","import React, { FC } from \"react\";\nimport { Source, Layer as MapboxLayer } from \"react-map-gl/mapbox\";\n\nimport { LayerProps } from \"./types\";\n\nexport const RasterLayer: FC<Omit<LayerProps, \"layerType\">> = ({\n layer,\n tileUrl,\n visible,\n beforeId,\n}) => {\n if (!layer) {\n return null;\n }\n\n return (\n <Source id={layer.name} type=\"raster\" tiles={[tileUrl]}>\n <MapboxLayer\n id={layer.name}\n type=\"raster\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{ visibility: visible ? \"visible\" : \"none\" }}\n />\n </Source>\n );\n};\n","import { CirclePaint, FillPaint, FillExtrusionPaint, LinePaint } from \"mapbox-gl\";\n\nconst DEFAULT_COLOR = \"#00ffff\";\nconst DEFAULT_OPACITY = 0.5;\nconst DEFAULT_SIZE = 4;\nconst DEFAULT_LINE_WIDTH = 1;\n\nexport const DEFAULT_CIRCLE_PAINT = {\n \"circle-radius\": DEFAULT_SIZE,\n \"circle-color\": DEFAULT_COLOR,\n \"circle-opacity\": DEFAULT_OPACITY,\n \"circle-stroke-width\": 0,\n \"circle-stroke-color\": DEFAULT_COLOR,\n \"circle-stroke-opacity\": DEFAULT_OPACITY,\n} as CirclePaint;\n\nexport const DEFAULT_FILL_PAINT = {\n \"fill-color\": DEFAULT_COLOR,\n \"fill-opacity\": DEFAULT_OPACITY,\n} as FillPaint;\n\nexport const DEFAULT_FILL_EXTRUSION_PAINT = {\n \"fill-extrusion-base\": 0,\n \"fill-extrusion-vertical-gradient\": true,\n \"fill-extrusion-color\": DEFAULT_COLOR,\n \"fill-extrusion-opacity\": DEFAULT_OPACITY,\n \"fill-extrusion-height\": 0,\n} as FillExtrusionPaint;\n\nexport const DEFAULT_LINE_PAINT = {\n \"line-color\": DEFAULT_COLOR,\n \"line-width\": DEFAULT_LINE_WIDTH,\n \"line-opacity\": DEFAULT_OPACITY,\n} as LinePaint;\n","import { GeometryType } from \"@evergis/api\";\n\nimport { ClientStyleItem } from \"../../../../../core\";\n\nexport const getClientStyleItemPrefixSuffix = (\n geometryType: GeometryType,\n type: ClientStyleItem[\"type\"],\n): [string, string] => {\n switch (geometryType) {\n case GeometryType.Point:\n return [\"point-layer-\", \"\"];\n case GeometryType.Polyline:\n return [\"polyline-layer-\", \"\"];\n case GeometryType.Polygon:\n switch (type) {\n case \"line\":\n return [\"polygon-stroke-layer-\", \"-stroke\"];\n case \"fill-extrusion\":\n return [\"polygon-extrusion-layer-\", \"-extrusion\"];\n default:\n return [\"polygon-layer-\", \"\"];\n }\n default:\n return [\"\", \"\"];\n }\n};\n","import React, { FC, useCallback, useEffect } from \"react\";\nimport { Layer as MapboxLayer, Source } from \"react-map-gl/mapbox\";\nimport { FeatureLayerServiceInfoDc, GeometryType, QueryLayerServiceConfigurationDc } from \"@evergis/api\";\nimport { AnyPaint, CirclePaint, FillExtrusionPaint, FillPaint, LinePaint } from \"mapbox-gl\";\n\nimport {\n DEFAULT_CIRCLE_PAINT,\n DEFAULT_FILL_EXTRUSION_PAINT,\n DEFAULT_FILL_PAINT,\n DEFAULT_LINE_PAINT,\n} from \"./constants\";\n\nimport { getClientStyleItemPrefixSuffix } from \"./utils/getClientStyleItemPrefixSuffix\";\nimport { getActualExtrusionHeight } from \"../../../../core\";\n\nimport { LayerProps } from \"./types\";\nimport { ClientStyle } from \"../../../../core\";\n\nexport const VectorLayer: FC<Omit<LayerProps, \"layerType\">> = ({\n layer,\n tileUrl,\n visible,\n beforeId,\n getLayerTempStyle,\n onMount = () => null,\n}) => {\n const clientStyle = (layer?.configuration as QueryLayerServiceConfigurationDc)?.clientStyle as ClientStyle;\n const { idAttribute, geometryType } = (layer as FeatureLayerServiceInfoDc).layerDefinition || {};\n\n const renderLayerByGeometryType = useCallback(() => {\n const visibility = visible ? \"visible\" : \"none\";\n\n switch (geometryType) {\n case GeometryType.Point:\n return (\n <MapboxLayer\n id={layer.name}\n type=\"circle\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"circle\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_CIRCLE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"circle\")?.paint as CirclePaint),\n }}\n />\n );\n case GeometryType.Polygon:\n return [\n <MapboxLayer\n key={`polygon-layer-${layer.name}`}\n id={layer.name}\n type=\"fill\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"fill\")?.layout,\n visibility:\n visible &&\n getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.settings?.fill?.showBottomSurface !== false &&\n Boolean(\n getActualExtrusionHeight({\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }),\n )\n ? \"visible\"\n : \"none\",\n }}\n paint={{\n ...DEFAULT_FILL_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill\")?.paint as FillPaint),\n }}\n />,\n <MapboxLayer\n key={`polygon-stroke-layer-${layer.name}`}\n id={`${layer.name}-stroke`}\n type=\"line\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"line\")?.layout,\n visibility:\n visible &&\n getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.settings?.fill?.showBottomSurface !== false &&\n Boolean(\n getActualExtrusionHeight({\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }),\n )\n ? \"visible\"\n : \"none\",\n }}\n paint={{\n ...DEFAULT_LINE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"line\")?.paint as LinePaint),\n }}\n />,\n <MapboxLayer\n key={`polygon-extrusion-layer-${layer.name}`}\n id={`${layer.name}-extrusion`}\n type=\"fill-extrusion\"\n source-layer=\"default\"\n beforeId={beforeId}\n minzoom={0}\n maxzoom={23}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }}\n />,\n ];\n case GeometryType.Polyline:\n return (\n <MapboxLayer\n id={layer.name}\n type=\"line\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"line\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_LINE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"line\")?.paint as LinePaint),\n }}\n />\n );\n default:\n return null;\n }\n }, [geometryType, layer, beforeId, getLayerTempStyle, visible]);\n\n const renderClientStyle = useCallback(() => {\n return clientStyle.items.map(mockItem => {\n const prefixSuffix = getClientStyleItemPrefixSuffix(geometryType, mockItem.type);\n const isExtrusionItem = mockItem.type === \"fill-extrusion\";\n const isPolygonPart =\n clientStyle.items.some(item => item.type === \"fill-extrusion\") &&\n (mockItem.type === \"fill\" || mockItem.type === \"line\");\n const fillExtrusionPaint =\n isPolygonPart || isExtrusionItem\n ? {\n ...clientStyle.items?.find(item => item.type === \"fill-extrusion\")?.paint,\n ...getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint,\n }\n : undefined;\n const currentSettings = {\n ...clientStyle?.settings,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.settings,\n };\n const processedExtrusionHeight = getActualExtrusionHeight(fillExtrusionPaint);\n const hasExtrusion = Boolean(processedExtrusionHeight);\n const visibility =\n visible &&\n ((isExtrusionItem && hasExtrusion) ||\n (!isPolygonPart && !isExtrusionItem) ||\n (isPolygonPart && (!hasExtrusion || (currentSettings?.fill?.showBottomSurface ?? true))))\n ? \"visible\"\n : \"none\";\n\n return (\n <MapboxLayer\n key={`${prefixSuffix[0]}${layer.name}`}\n id={`${layer.name}${prefixSuffix[1]}`}\n type={mockItem.type}\n source-layer=\"default\"\n beforeId={beforeId}\n minzoom={clientStyle?.minzoom ?? 0}\n maxzoom={clientStyle?.maxzoom ?? 23}\n layout={{\n ...mockItem.layout,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.layout,\n visibility,\n }}\n paint={\n {\n ...mockItem.paint,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.paint,\n } as AnyPaint\n }\n />\n );\n });\n }, [beforeId, clientStyle, geometryType, layer.name, visible, getLayerTempStyle]);\n\n useEffect(onMount, [layer.name]); // eslint-disable-line\n\n if (!layer) {\n return null;\n }\n\n return (\n <Source\n promoteId={idAttribute}\n id={layer.name}\n type=\"vector\"\n tiles={[tileUrl]}\n >\n {clientStyle?.items ? renderClientStyle() : renderLayerByGeometryType()}\n </Source>\n );\n};\n","import React, { FC, useEffect } from \"react\";\n\nimport { RasterLayer } from \"./RasterLayer\";\nimport { VectorLayer } from \"./VectorLayer\";\n\nimport { LayerProps } from \"./types\";\n\nexport const Layer: FC<LayerProps> = ({\n layer,\n layerType,\n visible,\n beforeId,\n tileUrl,\n onMount = () => null,\n}) => {\n useEffect(onMount, [layer.name]); // eslint-disable-line\n\n if (!layer) {\n return null;\n }\n\n if (layerType === \"RasterTileLayer\") {\n return (\n <RasterLayer\n layer={layer}\n tileUrl={tileUrl}\n visible={visible}\n beforeId={beforeId}\n onMount={onMount}\n />\n );\n }\n\n return (\n <VectorLayer\n layer={layer}\n tileUrl={tileUrl}\n visible={visible}\n beforeId={beforeId}\n onMount={onMount}\n />\n );\n};\n","import styled, { css } from \"styled-components\";\n\nimport { HorizontalPosition, ResizerOptions, VerticalPosition } from \"../../hooks\";\n\nimport { HandlePosition } from \"./types\";\n\nexport const ResizablePanelContainer = styled.div<ResizerOptions & { width?: string; height?: string }>`\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n position: relative;\n\n ${({ horizontal, vertical }) =>\n horizontal && !vertical\n ? css`\n height: 100%;\n `\n : !horizontal && vertical\n ? css`\n width: 100%;\n `\n : \"\"}\n\n ${({ horizontal, vertical }) =>\n css`\n will-change: ${[horizontal && \"width\", vertical && \"height\"].filter(Boolean).join(\",\")};\n `}\n\n ${({ maxHeight }) =>\n maxHeight &&\n css`\n max-height: ${maxHeight}px;\n `}\n ${({ minHeight }) =>\n minHeight &&\n css`\n min-height: ${minHeight}px;\n `}\n ${({ maxWidth }) =>\n maxWidth &&\n css`\n max-width: ${maxWidth}px;\n `}\n ${({ height }) =>\n height &&\n css`\n height: ${height};\n `}\n ${({ width }) =>\n width &&\n css`\n width: ${width};\n `}\n`;\n\nexport const getHandlePositionProps = (position: HandlePosition, palette) => {\n switch (position) {\n case HorizontalPosition.Left:\n return css`\n height: 100%;\n border-left: 2px solid ${palette.elementDeep};\n top: 0;\n left: 0;\n cursor: ew-resize;\n `;\n case HorizontalPosition.Right:\n return css`\n height: 100%;\n border-right: 2px solid ${palette.elementDeep};\n top: 0;\n right: 0;\n cursor: ew-resize;\n `;\n case VerticalPosition.Top:\n return css`\n width: 100%;\n border-top: 2px solid ${palette.elementDeep};\n top: 0;\n left: 0;\n cursor: ns-resize;\n `;\n case VerticalPosition.Bottom:\n return css`\n width: 100%;\n border-bottom: 2px solid ${palette.elementDeep};\n bottom: 0;\n left: 0;\n cursor: ns-resize;\n `;\n default:\n return css`\n width: 100%;\n border-top: 2px solid ${palette.elementDeep};\n top: 0;\n left: 0;\n `;\n }\n};\n\nexport const PanelDragHandle = styled.div<{ disabled?: boolean; position: HandlePosition }>`\n position: absolute;\n box-sizing: border-box;\n z-index: 3;\n\n padding: 0.25rem;\n pointer-events: ${({ disabled }) => disabled && \"none\"};\n transition: border-color 150ms cubic-bezier(0.2, 1, 0.6, 1);\n\n &:hover {\n border-color: ${({ theme: { palette } }) => palette.primary};\n }\n\n ${({ position, theme: { palette } }) => getHandlePositionProps(position, palette)}\n`;\n","import React, { FC, useMemo } from \"react\";\n\nimport { PanelDragHandle, ResizablePanelContainer } from \"./styled\";\n\nimport { HorizontalPosition, useResizer, VerticalPosition } from \"../../hooks\";\n\nimport { ResizablePanelProps } from \"./types\";\n\nexport const ResizablePanel: FC<ResizablePanelProps> = ({\n className,\n handleClassName,\n width,\n height,\n disabled,\n handleVerticalPosition = VerticalPosition.Top,\n handleHorizontalPosition = HorizontalPosition.Left,\n Handle,\n children,\n ...resizeProps\n}) => {\n const resizerProps = useMemo(\n () => ({\n ...resizeProps,\n handleVerticalPosition,\n handleHorizontalPosition,\n }),\n [resizeProps, handleVerticalPosition, handleHorizontalPosition],\n );\n\n const { containerRef, verticalHandleRef, horizontalHandleRef, onPointerDown } = useResizer(resizerProps);\n const { vertical, horizontal } = resizeProps;\n\n return (\n <ResizablePanelContainer\n ref={containerRef}\n width={width}\n height={height}\n style={disabled ? { height: \"auto\" } : undefined}\n className={className}\n >\n {vertical && (\n <PanelDragHandle\n ref={verticalHandleRef}\n position={handleVerticalPosition}\n disabled={disabled}\n className={handleClassName}\n onPointerDown={onPointerDown}\n />\n )}\n {horizontal && (\n <PanelDragHandle\n ref={horizontalHandleRef}\n position={handleHorizontalPosition}\n disabled={disabled}\n className={handleClassName}\n onPointerDown={onPointerDown}\n />\n )}\n {children}\n </ResizablePanelContainer>\n );\n};\n","import React, { FC, useCallback } from \"react\";\n\nimport { ServerNotificationsContext } from \"./ServerNotificationsContext\";\n\nimport { useServerNotifications } from \"../../hooks\";\n\nimport { ServerNotificationsProviderProps } from \"./types\";\n\nexport const ServerNotificationsProvider: FC<ServerNotificationsProviderProps> = ({ url, initialized, children }) => {\n const connection = useServerNotifications(url, initialized);\n\n const addSubscription = useCallback(\n async (payload?: any): Promise<string | null> => {\n if (!connection || connection.state !== \"Connected\" || !payload) {\n return;\n }\n\n try {\n const id = await connection.invoke(\"AddSubscription\", payload);\n\n console.info(\"Подписка добавлена, id:\", id);\n\n return id;\n } catch (err) {\n console.info(\"Ошибка добавления подписки:\", err);\n\n return Promise.resolve(null);\n }\n },\n [connection],\n );\n\n const updateSubscription = useCallback(\n async (id: string | null, payload?: any): Promise<void> => {\n if (!connection || connection.state !== \"Connected\" || !id || !payload) {\n return;\n }\n\n try {\n await connection.invoke(\"UpdateSubscription\", id, payload);\n } catch (err) {\n console.info(`Ошибка обновления подписки ${id}:`, err);\n }\n },\n [connection],\n );\n\n const unsubscribeById = useCallback(\n async (id: string | null): Promise<void> => {\n if (!connection || connection.state !== \"Connected\" || !id) {\n return;\n }\n\n try {\n await connection.invoke(\"Unsubscribe\", [id]);\n } catch (err) {\n console.info(`Ошибка отписки по ${id}:`, err);\n }\n },\n [connection],\n );\n\n return (\n <ServerNotificationsContext.Provider value={{ connection, addSubscription, updateSubscription, unsubscribeById }}>\n {children}\n </ServerNotificationsContext.Provider>\n );\n};\n"],"names":["ErrorBoundaryContainer","styled","div","ErrorBoundary","hasError","componentDidCatch","error","console","render","children","errorContents","props","state","React","getDerivedStateFromError","Component","MapWrapper","$zIndex","useMapContext","useContext","MapContext","useCurrentSelectedFeature","selectFeatures","useMemo","features","layerName","find","item","id","currentId","createContext","BaseMapTheme","GeometrySelectionTypes","GeometrySelectionToolTypes","GeometrySelectionZoneTypes","GeometrySelectionRouteTypes","GeometryEditorMode","initialGeometrySelection","active","loading","type","Point","currentTool","Replace","history","zones","step","editHistory","isBuffer","settings","zoneDuration","zoneType","Walking","routeType","bufferRadius","bufferMultiplier","bufferInclude","selectOutside","initialGeometryEditor","initialSelectFeatures","initialized","undefined","selectionOffset","totalCounts","statisticsActive","geometryMasking","MapProvider","basemapItems","defaultBasemap","map","useRef","draw","loaded","setLoaded","useState","basemapName","setBasemapName","globeProjection","setGlobeProjection","geometrySelection","setGeometrySelection","geometryEditor","setGeometryEditor","setSelectFeatures","resetGeometrySelection","useCallback","resetGeometryEditor","setNextFeature","currentIndex","findIndex","length","nextId","setPrevFeature","prevId","setSelectedFeatures","payload","offset","firstNotNullLayerName","Object","keys","key","featureIdsToSelect","setSelectedFeaturesTotalCounts","setSelectFeaturesInitialized","setSelectFeaturesLayerName","setSelectFeaturesStatisticsActive","setSelectFeaturesGeometryMasking","updateCurrentFeature","changeProps","resetSelectedFeatures","Provider","value","useGeometryEditor","update","newState","prevState","useEditingFeature","mode","currentSelectedFeature","Edit","layer","Create","useGeometrySelection","updateGeometrySelection","NO_CONTENT_VALUE","DateFormat","stringDateParsers","parseJSON","parseISO","rawDate","Date","getDate","parser","date","isValid","toDate","parsedDate","formatDate","dateFormat","ClientDefaultFormat","defaultValue","dateValue","format","toString","geometryToWkt","stringify","isNumeric","number","isNaN","parseFloat","isFinite","isObject","Array","isArray","useEwktGeometry","Zones","isEmpty","useGeometrySelectionBuffer","Number","toFixed","customModes","MapboxDraw","modes","StaticMode","onSetup","setActionableState","toDisplayFeatures","geojson","display","static","customStyles","filter","paint","layout","displayControlsDefault","styles","defaultMode","controls","trash","useMapDraw","triggerDeps","drawContext","useEffect","current","addControl","hasControl","removeControl","useRedrawLayer","layerTileSource","getSource","setTiles","tiles","useSelectedFeatures","updatSelectedFeatures","useSelectFeaturesCount","useSelectFeaturesCurrentIndex","feature","useSelectFeaturesGeometryMasking","useSelectFeaturesInitialized","useSelectFeaturesLayerName","name","useSelectFeaturesPagination","onNext","onPrev","useSelectFeaturesStatisticsActive","useSelectFeaturesTotalCounts","useUpdateCurrentFeature","values","findAttributeInExpression","expression","reduce","acc","curr","Set","getActualExtrusionHeight","parseClientStyle","style","items","entries","paintAcc","convertSpToTurfFeature","geometry","GeometryType","point","coordinates","Multipoint","multiPoint","Polyline","multiLineString","Polygon","Envelope","polygon","drawModeToGeometrySelectionType","Line","getGeometrySelectionTurfFeature","selectionType","toWgs","toWgs84","lineString","toMercator","useZoomToFeatures","padding","currentFeatureCenter","bbox","fitBounds","DEFAULT_PADDING","useZoomToLayer","bulkExtent","options","overall","useZoomToPoint","callback","once","flyTo","useServerNotifications","url","hubConnection","connection","setConnection","HubConnectionBuilder","withUrl","withCredentials","configureLogging","LogLevel","Information","build","start","then","info","catch","err","finally","invoke","ServerNotificationsContext","useServerNotificationsContext","VerticalPosition","HorizontalPosition","useResizer","handleVerticalPosition","handleHorizontalPosition","minWidth","MIN_SAFE_INTEGER","maxWidth","MAX_SAFE_INTEGER","horizontal","minHeight","maxHeight","vertical","useResize","onResize","onResizeEnd","onResizeStart","containerRef","verticalHandleRef","horizontalHandleRef","updateSizes","width","height","newWidth","newHeight","Math","min","window","innerWidth","clientWidth","innerHeight","clientHeight","requestAnimationFrame","isNil","onPointerMove","pointerMoveEvent","x","y","getBoundingClientRect","reverseHorizontal","Right","reverseVertical","Bottom","pageX","offsetWidth","pageY","offsetHeight","document","body","userSelect","onPointerDown","onPointerUp","removeEventListener","addEventListener","useLayoutEffect","useToggle","initial","setState","toggle","Map","zIndex","lowerSiblings","upperSiblings","drawTriggerDeps","onError","rest","MapGL","renderWorldCopies","antialias","doubleClickZoom","cursor","onLoad","e","target","on","BuildingsLayer","beforeId","transparent","MapboxLayer","source","minzoom","RasterLayer","tileUrl","visible","Source","visibility","DEFAULT_COLOR","DEFAULT_OPACITY","DEFAULT_SIZE","DEFAULT_LINE_WIDTH","DEFAULT_CIRCLE_PAINT","DEFAULT_FILL_PAINT","DEFAULT_FILL_EXTRUSION_PAINT","DEFAULT_LINE_PAINT","getClientStyleItemPrefixSuffix","geometryType","VectorLayer","getLayerTempStyle","onMount","clientStyle","configuration","idAttribute","layerDefinition","renderLayerByGeometryType","fill","showBottomSurface","Boolean","maxzoom","renderClientStyle","mockItem","prefixSuffix","isExtrusionItem","isPolygonPart","some","fillExtrusionPaint","currentSettings","processedExtrusionHeight","hasExtrusion","promoteId","Layer","layerType","ResizablePanelContainer","css","join","getHandlePositionProps","position","palette","Left","elementDeep","Top","PanelDragHandle","disabled","theme","primary","ResizablePanel","className","handleClassName","resizeProps","resizerProps","ref","ServerNotificationsProvider","addSubscription","Promise","resolve","updateSubscription","unsubscribeById"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,sBAAsB,gBAAGC,eAAM,CAACC,GAAV,iLAA5B;;;;;;;;;;;;;;;;;;ICIMC,aAAb;AAAA;;;;;;AACS,gBAAA,GAAQ;AAAEC,MAAAA,QAAQ,EAAE;AAAZ,KAAR;;AAuBR;;AAxBD;;AAAA;AAAA;AAAA,WAOS,SAAAC,iBAAiB,CAACC,KAAD;AACtB;AACAC,MAAAA,OAAO,CAACD,KAAR,CAAcA,KAAd;AACD;AAVH;AAAA;AAAA,WAYS,SAAAE,MAAM;AACX,YAAM;AAAEC,QAAAA,QAAF;AAAYC,QAAAA;AAAZ,UAA8B,KAAKC,KAAzC;AACA,YAAM;AAAEP,QAAAA;AAAF,UAAe,KAAKQ,KAA1B;AAEA,aAAO,CAACR,QAAD,GACLS,4BAAA,wBAAA,MAAA,EAAGJ,QAAH,CADK,GAGLI,4BAAA,CAACb,sBAAD,MAAA,EACGU,aADH,CAHF;AAOD;AAvBH;AAAA;AAAA,WAGS,SAAOI,wBAAP;AACL,aAAO;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AP,EAAY;AACZvQ,MAAAA,OAAO,CAACqQ,IAAR,yJAA2ChP,EAA3C,QAAkDkP,GAAlD;AACD;AACF,GAXmC,EAYpC,CAACb,UAAD,CAZoC,CAAtC;AAeA,QAAMmK,eAAe,GAAG/U,iBAAW,CACjC,MAAOzD,EAAP;AACE,QAAI,CAACqO,UAAD,IAAeA,UAAU,CAACrP,KAAX,KAAqB,WAApC,IAAmD,CAACgB,EAAxD,EAA4D;AAC1D;AACD;;AAED,QAAI;AACF,YAAMqO,UAAU,CAACe,MAAX,CAAkB,aAAlB,EAAiC,CAACpP,EAAD,CAAjC,CAAN;AACD,KAFD,CAEE,OAAOkP,GAAP,EAAY;AACZvQ,MAAAA,OAAO,CAACqQ,IAAR,mGAAkChP,EAAlC,QAAyCkP,GAAzC;AACD;AACF,GAXgC,EAYjC,CAACb,UAAD,CAZiC,CAAnC;AAeA,SACEpP,4BAAA,CAACoQ,0BAA0B,CAACnK,QAA5B;AAAqCC,IAAAA,KAAK,EAAE;AAAEkJ,MAAAA,UAAF;AAAc+J,MAAAA,eAAd;AAA+BG,MAAAA,kBAA/B;AAAmDC,MAAAA;AAAnD;GAA5C,EACG3Z,QADH,CADF;AAKD,CA3DM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"react.cjs.development.js","sources":["../src/components/ErrorBoundary/styled.ts","../src/components/ErrorBoundary/index.tsx","../src/components/Layer/constants.ts","../src/components/Layer/RasterLayer.tsx","../src/components/Layer/utils/getClientStyleItemPrefixSuffix.ts","../src/core/classification/findAttributeInExpression.ts","../src/core/classification/getActualExtrusionHeight.ts","../src/core/classification/parseClientStyle.ts","../src/core/feature/convertSpToTurfFeature.ts","../src/components/Layer/VectorLayer.tsx","../src/components/Layer/Layer.tsx","../src/components/Map/styled.ts","../src/hooks/map/useMapDraw/customModes.ts","../src/hooks/map/useMapDraw/customStyles.ts","../src/contexts/MapContext/MapContext.ts","../src/contexts/MapContext/MapProvider.tsx","../src/contexts/MapContext/types.ts","../src/contexts/ServerNotificationsContext/ServerNotificationsContext.ts","../src/contexts/ServerNotificationsContext/hooks/useServerNotifications.ts","../src/contexts/ServerNotificationsContext/ServerNotificationsProvider.tsx","../src/hooks/map/useMapContext.ts","../src/hooks/map/useMapDraw/index.ts","../src/hooks/map/useRedrawLayer.ts","../src/hooks/map/useZoomToFeatures.ts","../src/hooks/map/useZoomToPoint.ts","../src/hooks/serverNotifications/useServerNotificationsContext.ts","../src/utils/date.ts","../src/utils/debounce.ts","../src/utils/isNumeric.ts","../src/utils/isObject.ts","../src/hooks/useDebouncedCallback.ts","../src/hooks/useToggle.ts","../src/hooks/useWindowResize.ts","../src/components/Map/Map.tsx"],"sourcesContent":["import styled from \"styled-components\";\n\nexport const ErrorBoundaryContainer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n`;\n","import React, { Component } from \"react\";\n\nimport { ErrorBoundaryContainer } from \"./styled\";\n\nimport { ErrorBoundaryProps, ErrorBoundaryState } from \"./types\";\n\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n public state = { hasError: false };\n\n public static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n public componentDidCatch(error: Error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n\n public render() {\n const { children, errorContents } = this.props;\n const { hasError } = this.state;\n\n return !hasError ? (\n <>{children}</>\n ) : (\n <ErrorBoundaryContainer>\n {errorContents}\n </ErrorBoundaryContainer>\n );\n }\n}\n","import { CirclePaint, FillPaint, FillExtrusionPaint, LinePaint } from \"mapbox-gl\";\n\nconst DEFAULT_COLOR = \"#00ffff\";\nconst DEFAULT_OPACITY = 0.5;\nconst DEFAULT_SIZE = 4;\nconst DEFAULT_LINE_WIDTH = 1;\n\nexport const DEFAULT_CIRCLE_PAINT = {\n \"circle-radius\": DEFAULT_SIZE,\n \"circle-color\": DEFAULT_COLOR,\n \"circle-opacity\": DEFAULT_OPACITY,\n \"circle-stroke-width\": 0,\n \"circle-stroke-color\": DEFAULT_COLOR,\n \"circle-stroke-opacity\": DEFAULT_OPACITY,\n} as CirclePaint;\n\nexport const DEFAULT_FILL_PAINT = {\n \"fill-color\": DEFAULT_COLOR,\n \"fill-opacity\": DEFAULT_OPACITY,\n} as FillPaint;\n\nexport const DEFAULT_FILL_EXTRUSION_PAINT = {\n \"fill-extrusion-base\": 0,\n \"fill-extrusion-vertical-gradient\": true,\n \"fill-extrusion-color\": DEFAULT_COLOR,\n \"fill-extrusion-opacity\": DEFAULT_OPACITY,\n \"fill-extrusion-height\": 0,\n} as FillExtrusionPaint;\n\nexport const DEFAULT_LINE_PAINT = {\n \"line-color\": DEFAULT_COLOR,\n \"line-width\": DEFAULT_LINE_WIDTH,\n \"line-opacity\": DEFAULT_OPACITY,\n} as LinePaint;\n","import React, { FC } from \"react\";\nimport { Source, Layer as MapboxLayer } from \"react-map-gl/mapbox\";\n\nimport { LayerProps } from \"./types\";\n\nexport const RasterLayer: FC<Omit<LayerProps, \"layerType\">> = ({\n layer,\n tileUrl,\n visible,\n beforeId,\n}) => {\n if (!layer) {\n return null;\n }\n\n return (\n <Source id={layer.name} type=\"raster\" tiles={[tileUrl]}>\n <MapboxLayer\n id={layer.name}\n type=\"raster\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{ visibility: visible ? \"visible\" : \"none\" }}\n />\n </Source>\n );\n};\n","import { GeometryType } from \"@evergis/api\";\n\nimport { ClientStyleItem } from \"../../../types\";\n\nexport const getClientStyleItemPrefixSuffix = (\n geometryType: GeometryType,\n type: ClientStyleItem[\"type\"],\n): [string, string] => {\n switch (geometryType) {\n case GeometryType.Point:\n return [\"point-layer-\", \"\"];\n case GeometryType.Polyline:\n return [\"polyline-layer-\", \"\"];\n case GeometryType.Polygon:\n switch (type) {\n case \"line\":\n return [\"polygon-stroke-layer-\", \"-stroke\"];\n case \"fill-extrusion\":\n return [\"polygon-extrusion-layer-\", \"-extrusion\"];\n default:\n return [\"polygon-layer-\", \"\"];\n }\n default:\n return [\"\", \"\"];\n }\n};\n","import { ExpressionSpecification } from \"mapbox-gl\";\n\nexport const findAttributeInExpression = (expression: ExpressionSpecification): string[] => {\n if (Array.isArray(expression) && expression.length === 2 && expression[0] === \"get\") {\n return [expression[1]];\n }\n\n return expression.reduce((acc: string[], curr) => {\n if (!Array.isArray(curr)) {\n return acc;\n }\n\n if (curr[0] === \"get\") {\n return [...new Set([...acc, curr[1]])];\n }\n\n return [...new Set([...acc, ...findAttributeInExpression(curr as ExpressionSpecification)])];\n }, []);\n};\n","import { AnyPaint } from \"mapbox-gl\";\n\nexport const getActualExtrusionHeight = (paint: AnyPaint) => {\n return Array.isArray(paint?.[\"fill-extrusion-height\"]) && paint?.[\"fill-extrusion-height\"][0] === \"+\"\n ? paint?.[\"fill-extrusion-height\"][1]\n : paint?.[\"fill-extrusion-height\"];\n};\n","import { isEmpty } from \"lodash\";\nimport { ExpressionSpecification } from \"mapbox-gl\";\n\nimport { findAttributeInExpression } from \"./findAttributeInExpression\";\n\nimport { ClientStyle } from \"../../types\";\n\nexport const parseClientStyle = (style?: ClientStyle): string[] => {\n if (!style) {\n return [];\n }\n\n return style?.items?.reduce((acc: string[], curr) => {\n if (!curr.paint || isEmpty(curr.paint)) {\n return acc;\n }\n\n return Object.entries(curr.paint)?.reduce((paintAcc: string[], [, value]) => {\n if (!Array.isArray(value)) {\n return paintAcc;\n }\n\n return [...new Set([...paintAcc, ...findAttributeInExpression(value as ExpressionSpecification)])];\n }, []);\n }, []);\n};\n","import { FeatureDc, GeometryType, PositionDc } from \"@evergis/api\";\nimport { multiLineString, multiPoint, point, polygon } from \"@turf/turf\";\nimport { Feature } from \"geojson\";\n\nexport const convertSpToTurfFeature = (geometry?: FeatureDc[\"geometry\"]): Feature<any> | undefined => {\n if (!geometry) {\n return;\n }\n\n switch (geometry.type) {\n case GeometryType.Point:\n return point(geometry.coordinates as PositionDc);\n case GeometryType.Multipoint:\n return multiPoint(geometry.coordinates as PositionDc[]);\n case GeometryType.Polyline:\n return multiLineString(geometry.coordinates as PositionDc[][]);\n case GeometryType.Polygon:\n case GeometryType.Envelope:\n return polygon(geometry.coordinates as PositionDc[][]);\n default:\n }\n};\n","import React, { FC, useCallback, useEffect } from \"react\";\nimport { Layer as MapboxLayer, Source } from \"react-map-gl/mapbox\";\nimport { FeatureLayerServiceInfoDc, GeometryType, QueryLayerServiceConfigurationDc } from \"@evergis/api\";\nimport { AnyPaint, CirclePaint, FillExtrusionPaint, FillPaint, LinePaint } from \"mapbox-gl\";\n\nimport {\n DEFAULT_CIRCLE_PAINT,\n DEFAULT_FILL_EXTRUSION_PAINT,\n DEFAULT_FILL_PAINT,\n DEFAULT_LINE_PAINT,\n} from \"./constants\";\n\nimport { getClientStyleItemPrefixSuffix } from \"./utils/getClientStyleItemPrefixSuffix\";\nimport { getActualExtrusionHeight } from \"../../core\";\n\nimport { LayerProps } from \"./types\";\nimport { ClientStyle } from \"../../types\";\n\nexport const VectorLayer: FC<Omit<LayerProps, \"layerType\">> = ({\n layer,\n tileUrl,\n visible,\n beforeId,\n getLayerTempStyle,\n onMount = () => null,\n}) => {\n const clientStyle = (layer?.configuration as QueryLayerServiceConfigurationDc)?.clientStyle as ClientStyle;\n const { idAttribute, geometryType } = (layer as FeatureLayerServiceInfoDc).layerDefinition || {};\n\n const renderLayerByGeometryType = useCallback(() => {\n const visibility = visible ? \"visible\" : \"none\";\n\n switch (geometryType) {\n case GeometryType.Point:\n return (\n <MapboxLayer\n id={layer.name}\n type=\"circle\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"circle\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_CIRCLE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"circle\")?.paint as CirclePaint),\n }}\n />\n );\n case GeometryType.Polygon:\n return [\n <MapboxLayer\n key={`polygon-layer-${layer.name}`}\n id={layer.name}\n type=\"fill\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"fill\")?.layout,\n visibility:\n visible &&\n getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.settings?.fill?.showBottomSurface !== false &&\n Boolean(\n getActualExtrusionHeight({\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }),\n )\n ? \"visible\"\n : \"none\",\n }}\n paint={{\n ...DEFAULT_FILL_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill\")?.paint as FillPaint),\n }}\n />,\n <MapboxLayer\n key={`polygon-stroke-layer-${layer.name}`}\n id={`${layer.name}-stroke`}\n type=\"line\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"line\")?.layout,\n visibility:\n visible &&\n getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.settings?.fill?.showBottomSurface !== false &&\n Boolean(\n getActualExtrusionHeight({\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }),\n )\n ? \"visible\"\n : \"none\",\n }}\n paint={{\n ...DEFAULT_LINE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"line\")?.paint as LinePaint),\n }}\n />,\n <MapboxLayer\n key={`polygon-extrusion-layer-${layer.name}`}\n id={`${layer.name}-extrusion`}\n type=\"fill-extrusion\"\n source-layer=\"default\"\n beforeId={beforeId}\n minzoom={0}\n maxzoom={23}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_FILL_EXTRUSION_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint as FillExtrusionPaint),\n }}\n />,\n ];\n case GeometryType.Polyline:\n return (\n <MapboxLayer\n id={layer.name}\n type=\"line\"\n source-layer=\"default\"\n beforeId={beforeId}\n layout={{\n ...getLayerTempStyle?.(layer.name, \"line\")?.layout,\n visibility,\n }}\n paint={{\n ...DEFAULT_LINE_PAINT,\n ...(getLayerTempStyle?.(layer.name, \"line\")?.paint as LinePaint),\n }}\n />\n );\n default:\n return null;\n }\n }, [geometryType, layer, beforeId, getLayerTempStyle, visible]);\n\n const renderClientStyle = useCallback(() => {\n return clientStyle.items.map(mockItem => {\n const prefixSuffix = getClientStyleItemPrefixSuffix(geometryType, mockItem.type);\n const isExtrusionItem = mockItem.type === \"fill-extrusion\";\n const isPolygonPart =\n clientStyle.items.some(item => item.type === \"fill-extrusion\") &&\n (mockItem.type === \"fill\" || mockItem.type === \"line\");\n const fillExtrusionPaint =\n isPolygonPart || isExtrusionItem\n ? {\n ...clientStyle.items?.find(item => item.type === \"fill-extrusion\")?.paint,\n ...getLayerTempStyle?.(layer.name, \"fill-extrusion\")?.paint,\n }\n : undefined;\n const currentSettings = {\n ...clientStyle?.settings,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.settings,\n };\n const processedExtrusionHeight = getActualExtrusionHeight(fillExtrusionPaint);\n const hasExtrusion = Boolean(processedExtrusionHeight);\n const visibility =\n visible &&\n ((isExtrusionItem && hasExtrusion) ||\n (!isPolygonPart && !isExtrusionItem) ||\n (isPolygonPart && (!hasExtrusion || (currentSettings?.fill?.showBottomSurface ?? true))))\n ? \"visible\"\n : \"none\";\n\n return (\n <MapboxLayer\n key={`${prefixSuffix[0]}${layer.name}`}\n id={`${layer.name}${prefixSuffix[1]}`}\n type={mockItem.type}\n source-layer=\"default\"\n beforeId={beforeId}\n minzoom={clientStyle?.minzoom ?? 0}\n maxzoom={clientStyle?.maxzoom ?? 23}\n layout={{\n ...mockItem.layout,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.layout,\n visibility,\n }}\n paint={\n {\n ...mockItem.paint,\n ...getLayerTempStyle?.(layer.name, mockItem.type)?.paint,\n } as AnyPaint\n }\n />\n );\n });\n }, [beforeId, clientStyle, geometryType, layer.name, visible, getLayerTempStyle]);\n\n useEffect(onMount, [layer.name]); // eslint-disable-line\n\n if (!layer) {\n return null;\n }\n\n return (\n <Source\n promoteId={idAttribute}\n id={layer.name}\n type=\"vector\"\n tiles={[tileUrl]}\n >\n {clientStyle?.items ? renderClientStyle() : renderLayerByGeometryType()}\n </Source>\n );\n};\n","import React, { FC, useEffect } from \"react\";\n\nimport { RasterLayer } from \"./RasterLayer\";\nimport { VectorLayer } from \"./VectorLayer\";\n\nimport { LayerProps } from \"./types\";\n\nexport const Layer: FC<LayerProps> = ({\n layer,\n layerType,\n visible,\n beforeId,\n tileUrl,\n onMount = () => null,\n}) => {\n useEffect(onMount, [layer.name]); // eslint-disable-line\n\n if (!layer) {\n return null;\n }\n\n if (layerType === \"RasterTileLayer\") {\n return (\n <RasterLayer\n layer={layer}\n tileUrl={tileUrl}\n visible={visible}\n beforeId={beforeId}\n onMount={onMount}\n />\n );\n }\n\n return (\n <VectorLayer\n layer={layer}\n tileUrl={tileUrl}\n visible={visible}\n beforeId={beforeId}\n onMount={onMount}\n />\n );\n};\n","import { CSSProperties } from \"react\";\nimport styled from \"styled-components\";\n\nexport const MapWrapper = styled.div<{ $zIndex?: CSSProperties[\"zIndex\"] }>`\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n z-index: ${({ $zIndex }) => $zIndex ?? 1};\n\n .mapbox-gl-draw_trash {\n display: none;\n }\n\n .mapboxgl-ctrl-logo {\n display: none;\n }\n\n .mapboxgl-ctrl.mapboxgl-ctrl-attrib {\n display: none;\n }\n\n .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {\n width: 350px;\n }\n`;\n","import MapboxDraw, { DrawCustomMode } from \"@mapbox/mapbox-gl-draw\";\n\ninterface ExtendedMapboxDrawModes extends MapboxDraw.Modes {\n [key: string]: DrawCustomMode;\n static: DrawCustomMode;\n}\n\nexport const customModes = MapboxDraw.modes as ExtendedMapboxDrawModes;\n\nconst StaticMode = {} as DrawCustomMode;\n\nStaticMode.onSetup = function () {\n this.setActionableState(undefined);\n\n return {};\n};\n\nStaticMode.toDisplayFeatures = function (state, geojson, display) {\n display(geojson);\n};\n\ncustomModes.static = StaticMode;\n","export const customStyles = [\n {\n id: \"gl-draw-point\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-inactive-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"false\"]],\n paint: {\n \"circle-radius\": 5,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"highlight-active-points\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"feature\"], [\"==\", \"active\", \"true\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-fill-static\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-line\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"LineString\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-fill\",\n type: \"fill\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n paint: {\n \"fill-color\": \"#D20C0C\",\n \"fill-outline-color\": \"#D20C0C\",\n \"fill-opacity\": 0.1,\n },\n },\n {\n id: \"gl-draw-polygon-midpoint\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"$type\", \"Point\"], [\"==\", \"meta\", \"midpoint\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#fbb03b\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 1,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n {\n id: \"gl-draw-polygon-stroke-active\",\n type: \"line\",\n filter: [\"all\", [\"==\", \"$type\", \"Polygon\"]],\n layout: {\n \"line-cap\": \"round\",\n \"line-join\": \"round\",\n },\n paint: {\n \"line-color\": \"#D20C0C\",\n \"line-dasharray\": [0.2, 2],\n \"line-width\": 2,\n },\n },\n {\n id: \"gl-draw-polygon-and-line-vertex-active\",\n type: \"circle\",\n filter: [\"all\", [\"==\", \"meta\", \"vertex\"], [\"==\", \"$type\", \"Point\"]],\n paint: {\n \"circle-radius\": 3,\n \"circle-color\": \"#D20C0C\",\n \"circle-stroke-color\": \"#FFFFFF\",\n \"circle-stroke-width\": 3,\n \"circle-stroke-opacity\": 0.3,\n },\n },\n];\n","import { createContext } from \"react\";\n\nimport { MapContextProps } from \"./types\";\n\nexport const MapContext = createContext<MapContextProps>({});\n","import React, { FC, useRef, useState } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { MapContext } from \"./MapContext\";\n\nimport { MapProviderProps } from \"./types\";\n\nexport const MapProvider: FC<MapProviderProps> = ({ basemapItems, defaultBasemap, children }) => {\n const map = useRef<MapboxGLMap | undefined>();\n const draw = useRef<MapboxDraw | undefined>();\n const [loaded, setLoaded] = useState<boolean>(false);\n const [basemapName, setBasemapName] = useState(defaultBasemap);\n\n return (\n <MapContext.Provider\n value={{\n map,\n draw,\n loaded,\n setLoaded,\n basemapItems,\n basemapName,\n setBasemapName,\n defaultBasemap,\n }}\n >\n {children}\n </MapContext.Provider>\n );\n};\n","import { Dispatch, MutableRefObject, PropsWithChildren, SetStateAction } from \"react\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nexport enum BaseMapTheme {\n Light = \"light\",\n Dark = \"dark\",\n}\n\nexport interface BaseMapItem {\n name: string;\n source: string;\n preview?: string;\n imgSrc?: string;\n title: string;\n theme?: BaseMapTheme;\n opacity?: number;\n color?: string;\n}\n\nexport interface MapContextProps {\n map?: MutableRefObject<MapboxGLMap>;\n draw?: MutableRefObject<Omit<MapboxDraw, \"getDefaultPosition\">>;\n loaded?: boolean;\n setLoaded?: Dispatch<SetStateAction<boolean>>;\n basemapItems?: BaseMapItem[];\n basemapName?: string;\n setBasemapName?: Dispatch<SetStateAction<string>>;\n defaultBasemap?: string;\n}\n\nexport interface MapProviderProps extends PropsWithChildren {\n basemapItems: BaseMapItem[];\n defaultBasemap: string;\n}\n","import { createContext } from \"react\";\n\nimport { ServerNotificationsContextProps } from \"./types\";\n\nexport const ServerNotificationsContext = createContext<ServerNotificationsContextProps>({});\n","import { useEffect, useRef, useState } from \"react\";\nimport { HubConnection, HubConnectionBuilder, LogLevel } from \"@microsoft/signalr\";\n\nexport const useServerNotifications = (url: string, initialized: boolean): HubConnection | null => {\n const hubConnection = useRef<HubConnection | null>(null);\n const [connection, setConnection] = useState<HubConnection | null>(null);\n\n useEffect(() => {\n if (!initialized) {\n return;\n }\n\n hubConnection.current = new HubConnectionBuilder()\n .withUrl(url, {\n withCredentials: true,\n })\n .configureLogging(LogLevel.Information)\n .build();\n\n hubConnection.current\n .start()\n .then(() => console.info(\"Серверные нотификации подключены\"))\n .catch(err => console.info(\"Ошибка:\", err))\n .finally(() => setConnection(hubConnection.current));\n }, [initialized]); // eslint-disable-line\n\n useEffect(() => {\n if (!connection || connection.state !== \"Connected\") {\n return;\n }\n\n connection\n .invoke(\"SubscribeNotifications\", [])\n .then(() => console.info(\"Подписка `SubscribeNotifications` оформлена\"))\n .catch(err => console.info(\"Ошибка подписки `SubscribeNotifications`:\", err));\n }, [connection]);\n\n return connection;\n};\n","import React, { FC, useCallback } from \"react\";\n\nimport { ServerNotificationsContext } from \"./ServerNotificationsContext\";\n\nimport { useServerNotifications } from \"./hooks/useServerNotifications\";\n\nimport { ServerNotificationsProviderProps } from \"./types\";\n\nexport const ServerNotificationsProvider: FC<ServerNotificationsProviderProps> = ({ url, initialized, children }) => {\n const connection = useServerNotifications(url, initialized);\n\n const addSubscription = useCallback(\n async (payload?: any): Promise<string | null> => {\n if (!connection || connection.state !== \"Connected\" || !payload) {\n return;\n }\n\n try {\n const id = await connection.invoke(\"AddSubscription\", payload);\n\n console.info(\"Подписка добавлена, id:\", id);\n\n return id;\n } catch (err) {\n console.info(\"Ошибка добавления подписки:\", err);\n\n return Promise.resolve(null);\n }\n },\n [connection],\n );\n\n const updateSubscription = useCallback(\n async (id: string | null, payload?: any): Promise<void> => {\n if (!connection || connection.state !== \"Connected\" || !id || !payload) {\n return;\n }\n\n try {\n await connection.invoke(\"UpdateSubscription\", id, payload);\n } catch (err) {\n console.info(`Ошибка обновления подписки ${id}:`, err);\n }\n },\n [connection],\n );\n\n const unsubscribeById = useCallback(\n async (id: string | null): Promise<void> => {\n if (!connection || connection.state !== \"Connected\" || !id) {\n return;\n }\n\n try {\n await connection.invoke(\"Unsubscribe\", [id]);\n } catch (err) {\n console.info(`Ошибка отписки по ${id}:`, err);\n }\n },\n [connection],\n );\n\n return (\n <ServerNotificationsContext.Provider value={{ connection, addSubscription, updateSubscription, unsubscribeById }}>\n {children}\n </ServerNotificationsContext.Provider>\n );\n};\n","import { useContext } from \"react\";\n\nimport { MapContext } from \"../../contexts\";\n\nexport const useMapContext = () => {\n return useContext(MapContext);\n};\n","import { useEffect } from \"react\";\nimport MapboxDraw from \"@mapbox/mapbox-gl-draw\";\n\nimport { customModes } from \"./customModes\";\nimport { customStyles } from \"./customStyles\";\n\nimport { useMapContext } from \"../useMapContext\";\n\nconst draw = new MapboxDraw({\n displayControlsDefault: false,\n styles: customStyles,\n modes: customModes,\n defaultMode: \"draw_point\",\n controls: {\n trash: true,\n },\n});\n\nexport const useMapDraw = (triggerDeps: Array<unknown> = []) => {\n const { map, draw: drawContext, loaded, basemapName } = useMapContext();\n\n useEffect(() => {\n if (!loaded || !map.current) {\n return;\n }\n\n drawContext.current = draw;\n map.current.addControl(drawContext.current);\n }, [loaded]); // eslint-disable-line\n\n useEffect(() => {\n if (map.current && map.current.hasControl(drawContext.current)) {\n map.current.removeControl(drawContext.current);\n map.current.addControl(drawContext.current);\n }\n }, [basemapName, ...triggerDeps]); // eslint-disable-line\n};\n","import { useCallback } from \"react\";\nimport { VectorSourceImpl } from \"mapbox-gl\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useRedrawLayer = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (layerName: string) => {\n const layerTileSource: VectorSourceImpl = map.current.getSource(layerName);\n\n layerTileSource.setTiles(layerTileSource.tiles);\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\nimport { bbox } from \"@turf/turf\";\nimport { FeatureDc } from \"@evergis/api\";\n\nimport { useMapContext } from \"./useMapContext\";\nimport { convertSpToTurfFeature } from \"../../core\";\n\nexport const useZoomToFeatures = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (features?: FeatureDc[], padding?: number) => {\n if (!features) {\n return;\n }\n\n const currentFeatureCenter = bbox({\n type: \"FeatureCollection\",\n features: features.map(feature => convertSpToTurfFeature(feature.geometry)),\n });\n\n map.current.fitBounds(currentFeatureCenter as [number, number, number, number], { padding: padding ?? 150 });\n },\n [map],\n );\n};\n","import { useCallback } from \"react\";\n\nimport { useMapContext } from \"./useMapContext\";\n\nexport const useZoomToPoint = () => {\n const { map } = useMapContext();\n\n return useCallback(\n (options, callback?: VoidFunction) => {\n if (map.current) {\n if (callback) {\n map.current.once(\"moveend\", () => {\n callback();\n });\n }\n\n map.current.flyTo(options);\n } else {\n callback?.();\n }\n },\n [map],\n );\n};\n","import { useContext } from \"react\";\n\nimport { ServerNotificationsContext } from \"../../contexts\";\n\nexport const useServerNotificationsContext = () => {\n return useContext(ServerNotificationsContext);\n};\n","import { parseJSON, parseISO, isValid, format, toDate } from \"date-fns\";\n\nexport const NO_CONTENT_VALUE = \"—\";\n\nexport type DateType = number | Date;\nexport type RawDateType = string | DateType;\n\nexport enum DateFormat {\n ClientDefaultFormat = \"dd.MM.yyyy HH:mm\",\n DateTime = \"dd.MM.yyyy HH:mm:ss\",\n UTC = \"yyyy-MM-dd'T'HH:mm:ss.sssxxx\",\n AxisTooltip = \"d MMMM yyyy\",\n}\n\ninterface FormatDateOptions {\n dateFormat?: DateFormat;\n defaultValue?: RawDateType;\n}\n\nconst stringDateParsers: ((date: string) => DateType)[] = [parseJSON, parseISO, rawDate => new Date(rawDate)];\n\nexport const getDate = (rawDate?: RawDateType | null): Date | null => {\n if (!rawDate) return null;\n\n if (typeof rawDate === \"string\") {\n for (const parser of stringDateParsers) {\n const date = parser(rawDate);\n\n if (isValid(date)) {\n return toDate(date);\n }\n }\n\n return null;\n }\n\n const parsedDate = toDate(rawDate);\n\n return isValid(parsedDate) ? parsedDate : null;\n};\n\nexport const formatDate = (\n date?: RawDateType,\n { dateFormat = DateFormat.ClientDefaultFormat, defaultValue = NO_CONTENT_VALUE }: FormatDateOptions = {},\n): string => {\n const dateValue = date ? getDate(date) : null;\n\n if (isValid(dateValue)) {\n return format(dateValue as Date, dateFormat);\n }\n\n return defaultValue.toString();\n};\n","export const debounce = (callback: any, delay: number): ((...args) => void) => {\n let timeId: number;\n\n return (...args) => {\n if (timeId) {\n window.clearTimeout(timeId);\n }\n\n timeId = window.setTimeout(() => {\n callback(...args);\n }, delay);\n };\n};\n","export const isNumeric = (number: string | number): boolean =>\n !isNaN(parseFloat(number as string)) && isFinite(number as number);\n","export function isObject<T>(value: T | object): value is object {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","import { useMemo } from \"react\";\n\nimport { debounce } from \"../utils\";\n\nexport const useDebouncedCallback = <CallbackFn extends () => void>(interval: number): ((cb: CallbackFn) => void) => {\n return useMemo(\n () =>\n debounce((cb: CallbackFn) => {\n cb();\n }, interval),\n [interval],\n );\n};\n","import { useCallback, useState } from \"react\";\n\nexport const useToggle = (initial?: boolean): [boolean, VoidFunction, (value: boolean) => void] => {\n const [state, setState] = useState(initial !== undefined ? initial : false);\n\n const toggle = useCallback(() => setState(!state), [state]);\n\n return [state, toggle, setState];\n};\n","import { useEffect, useMemo } from \"react\";\n\nimport { debounce } from \"../utils\";\n\nconst DEBOUNCE_DELAY = 144;\n\nexport const useWindowResize = (callback?: (...args: any) => any, delay?: number) => {\n const debounceCallback = useMemo(() => {\n return callback ? debounce(callback, delay || DEBOUNCE_DELAY) : undefined;\n }, [callback, delay]);\n\n useEffect(() => {\n debounceCallback && window.addEventListener(\"resize\", debounceCallback);\n\n return () => debounceCallback && window.removeEventListener(\"resize\", debounceCallback);\n }, [debounceCallback]);\n};\n","import React, { FC } from \"react\";\nimport { default as MapGL } from \"react-map-gl/mapbox\";\nimport { Map as MapboxGLMap } from \"mapbox-gl\";\nimport \"@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css\";\n\nimport { MapWrapper } from \"./styled\";\n\nimport { useMapContext } from \"../../hooks\";\n\nimport { MapProps } from \"./types\";\n\nimport \"mapbox-gl/dist/mapbox-gl.css\";\n\nexport const Map: FC<MapProps> = ({\n zIndex,\n lowerSiblings,\n upperSiblings,\n drawTriggerDeps,\n onError,\n children,\n ...rest\n}) => {\n const { map, setLoaded } = useMapContext();\n\n return (\n <MapWrapper $zIndex={zIndex}>\n {lowerSiblings}\n <MapGL\n {...rest}\n renderWorldCopies\n antialias\n doubleClickZoom={false}\n cursor=\"default\"\n onLoad={e => {\n map.current = e.target as MapboxGLMap;\n\n map.current.on(\"error\", onError);\n\n setLoaded(true);\n }}\n >\n {children}\n </MapGL>\n {upperSiblings}\n </MapWrapper>\n );\n};\n"],"names":["ErrorBoundaryContainer","styled","div","ErrorBoundary","hasError","componentDidCatch","error","console","render","children","errorContents","props","state","React","getDerivedStateFromError","Component","DEFAULT_COLOR","DEFAULT_OPACITY","DEFAULT_SIZE","DEFAULT_LINE_WIDTH","DEFAULT_CIRCLE_PAINT","DEFAULT_FILL_PAINT","DEFAULT_FILL_EXTRUSION_PAINT","DEFAULT_LINE_PAINT","RasterLayer","layer","tileUrl","visible","beforeId","Source","id","name","type","tiles","MapboxLayer","layout","visibility","getClientStyleItemPrefixSuffix","geometryType","GeometryType","Point","Polyline","Polygon","findAttributeInExpression","expression","Array","isArray","length","reduce","acc","curr","Set","getActualExtrusionHeight","paint","parseClientStyle","style","items","isEmpty","Object","entries","paintAcc","value","convertSpToTurfFeature","geometry","point","coordinates","Multipoint","multiPoint","multiLineString","Envelope","polygon","VectorLayer","getLayerTempStyle","onMount","clientStyle","configuration","idAttribute","layerDefinition","renderLayerByGeometryType","useCallback","key","settings","fill","showBottomSurface","Boolean","minzoom","maxzoom","renderClientStyle","map","mockItem","prefixSuffix","isExtrusionItem","isPolygonPart","some","item","fillExtrusionPaint","find","undefined","currentSettings","processedExtrusionHeight","hasExtrusion","useEffect","promoteId","Layer","layerType","MapWrapper","$zIndex","customModes","MapboxDraw","modes","StaticMode","onSetup","setActionableState","toDisplayFeatures","geojson","display","static","customStyles","filter","MapContext","createContext","MapProvider","basemapItems","defaultBasemap","useRef","draw","loaded","setLoaded","useState","basemapName","setBasemapName","Provider","BaseMapTheme","ServerNotificationsContext","useServerNotifications","url","initialized","hubConnection","connection","setConnection","current","HubConnectionBuilder","withUrl","withCredentials","configureLogging","LogLevel","Information","build","start","then","info","catch","err","finally","invoke","ServerNotificationsProvider","addSubscription","payload","Promise","resolve","updateSubscription","unsubscribeById","useMapContext","useContext","displayControlsDefault","styles","defaultMode","controls","trash","useMapDraw","triggerDeps","drawContext","addControl","hasControl","removeControl","useRedrawLayer","layerName","layerTileSource","getSource","setTiles","useZoomToFeatures","features","padding","currentFeatureCenter","bbox","feature","fitBounds","useZoomToPoint","options","callback","once","flyTo","useServerNotificationsContext","NO_CONTENT_VALUE","DateFormat","stringDateParsers","parseJSON","parseISO","rawDate","Date","getDate","parser","date","isValid","toDate","parsedDate","formatDate","dateFormat","ClientDefaultFormat","defaultValue","dateValue","format","toString","debounce","delay","timeId","args","window","clearTimeout","setTimeout","isNumeric","number","isNaN","parseFloat","isFinite","isObject","useDebouncedCallback","interval","useMemo","cb","useToggle","initial","setState","toggle","DEBOUNCE_DELAY","useWindowResize","debounceCallback","addEventListener","removeEventListener","Map","zIndex","lowerSiblings","upperSiblings","onError","rest","MapGL","renderWorldCopies","antialias","doubleClickZoom","cursor","onLoad","e","target","on"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,sBAAsB,gBAAGC,MAAM,CAACC,GAAV,iLAA5B;;;;;;;;;;;;;;;;;;ICIMC,aAAb;AAAA;;;;;;AACS,gBAAA,GAAQ;AAAEC,MAAAA,QAAQ,EAAE;AAAZ,KAAR;;AAuBR;;AAxBD;;AAAA;AAAA;AAAA,WAOS,SAAAC,iBAAiB,CAACC,KAAD;AACtB;AACAC,MAAAA,OAAO,CAACD,KAAR,CAAcA,KAAd;AACD;AAVH;AAAA;AAAA,WAYS,SAAAE,MAAM;AACX,YAAM;AAAEC,QAAAA,QAAF;AAAYC,QAAAA;AAAZ,UAA8B,KAAKC,KAAzC;AACA,YAAM;AAAEP,QAAAA;AAAF,UAAe,KAAKQ,KAA1B;AAEA,aAAO,CAACR,QAAD,GACLS,4BAAA,wBAAA,MAAA,EAAGJ,QAAH,CADK,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A;AAAP,MAAqBmC,aAAa,EAAxC;AAEA,SACErJ,4BAAA,CAAC4F,UAAD;eAAqBuI;GAArB,EACGC,aADH,EAEEpO,4BAAA,CAACwO,cAAD,oBACMD;AACJE,IAAAA,iBAAiB;AACjBC,IAAAA,SAAS;AACTC,IAAAA,eAAe,EAAE;AACjBC,IAAAA,MAAM,EAAC;AACPC,IAAAA,MAAM,EAAEC,CAAC;AACPnK,MAAAA,GAAG,CAACoD,OAAJ,GAAc+G,CAAC,CAACC,MAAhB;AAEApK,MAAAA,GAAG,CAACoD,OAAJ,CAAYiH,EAAZ,CAAe,OAAf,EAAwBV,OAAxB;AAEApH,MAAAA,SAAS,CAAC,IAAD,CAAT;AACD;IAZH,EAcGtH,QAdH,CAFF,EAkBGyO,aAlBH,CADF;AAsBD,CAjCM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),r=e(t),n=require("styled-components"),o=e(n),l=require("react-map-gl/mapbox"),i=e(l);require("@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css");var a,s=require("find-and"),u=require("lodash"),c=require("date-fns"),d=require("wkt"),p=e(require("@mapbox/mapbox-gl-draw")),y=require("@turf/turf"),f=require("@evergis/api"),m=require("@microsoft/signalr");function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)t.indexOf(r=l[n])>=0||(o[r]=e[r]);return o}function C(e,t){return t||(t=e.slice(0)),e.raw=t,e}require("mapbox-gl/dist/mapbox-gl.css");const F=o.div(a||(a=C(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n"])));function k(e,t,r){return t=b(t),n=e,!(o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){return!1}}()?Reflect.construct(t,r||[],b(e).constructor):t.apply(e,r))||"object"!=typeof o&&"function"!=typeof o?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n):o;var n,o}let w=function(e){function n(){var e;return x(this,n),(e=k(this,n,arguments)).state={hasError:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(n,t.Component),o=n,i=[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}],(l=[{key:"componentDidCatch",value:function(e){console.error(e)}},{key:"render",value:function(){const{children:e,errorContents:t}=this.props,{hasError:n}=this.state;return n?r.createElement(F,null,t):r.createElement(r.Fragment,null,e)}}])&&g(o.prototype,l),i&&g(o,i),o;var o,l,i}();var T;const E=o.div(T||(T=C(["\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n z-index: ",";\n\n .mapbox-gl-draw_trash {\n display: none;\n }\n\n .mapboxgl-ctrl-logo {\n display: none;\n }\n\n .mapboxgl-ctrl.mapboxgl-ctrl-attrib {\n display: none;\n }\n\n .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {\n width: 350px;\n }\n"])),e=>{let{$zIndex:t}=e;return null!=t?t:1}),P=()=>t.useContext(z),N=()=>{const{selectFeatures:e}=P();return t.useMemo(()=>{var t;return null==(t=e.features)||null==(t=t[e.layerName])?void 0:t.find(t=>t.id===e.currentId)},[e])},z=t.createContext({});var G,M,I,R,D,L;(G=exports.BaseMapTheme||(exports.BaseMapTheme={})).Light="light",G.Dark="dark",(M=exports.GeometrySelectionTypes||(exports.GeometrySelectionTypes={})).Point="select_point",M.Line="select_line",M.Circle="select_circle",M.Rect="select_rect",M.Polygon="select_polygon",M.Zones="zones_selection",M.Coordinates="xy",M.Route="selection_route",(I=exports.GeometrySelectionToolTypes||(exports.GeometrySelectionToolTypes={})).Replace="Replace",I.Unite="Unite",I.Crop="Crop",I.Edit="Edit",(R=exports.GeometrySelectionZoneTypes||(exports.GeometrySelectionZoneTypes={})).Walking="Walking",R.Car="Car",(D=exports.GeometrySelectionRouteTypes||(exports.GeometrySelectionRouteTypes={})).Walking="Walking",D.Car="Car",(L=exports.GeometryEditorMode||(exports.GeometryEditorMode={}))[L.Create=0]="Create",L[L.Edit=1]="Edit",L[L.Transform=2]="Transform",L[L.Expand=3]="Expand",L[L.Unite=4]="Unite",L[L.Subtract=5]="Subtract";const H={active:!0,loading:!1,type:exports.GeometrySelectionTypes.Point,currentTool:exports.GeometrySelectionToolTypes.Replace,history:{features:[],zones:[],step:-1},editHistory:{features:[],step:-1},isBuffer:!1,settings:{zoneDuration:60,zoneType:exports.GeometrySelectionZoneTypes.Walking,routeType:exports.GeometrySelectionRouteTypes.Walking,bufferRadius:"",bufferMultiplier:"1",bufferInclude:!0,selectOutside:!1}},_={active:!1},A={initialized:!1,layerName:void 0,currentId:null,selectionOffset:0,features:{},totalCounts:{},statisticsActive:!1,geometryMasking:!1},O=()=>{const{geometryEditor:e,setGeometryEditor:r}=P();return[e,t.useCallback(e=>{r(t=>h({},t,e))},[r])]},B=()=>{const{geometrySelection:e,setGeometrySelection:r}=P();return[e,t.useCallback(e=>{r(t=>h({},t,e))},[r])]},j="—";var W;(W=exports.DateFormat||(exports.DateFormat={})).ClientDefaultFormat="dd.MM.yyyy HH:mm",W.DateTime="dd.MM.yyyy HH:mm:ss",W.UTC="yyyy-MM-dd'T'HH:mm:ss.sssxxx",W.AxisTooltip="d MMMM yyyy";const q=[c.parseJSON,c.parseISO,e=>new Date(e)],V=e=>{if(!e)return null;if("string"==typeof e){for(const t of q){const r=t(e);if(c.isValid(r))return c.toDate(r)}return null}const t=c.toDate(e);return c.isValid(t)?t:null},U=function(e){return void 0===e&&(e=[]),0===e.length?"":d.stringify(e[0])},$=p.modes;$.static={onSetup:function(){return this.setActionableState(void 0),{}},toDisplayFeatures:function(e,t,r){r(t)}};const Z=new p({displayControlsDefault:!1,styles:[{id:"gl-draw-point",type:"circle",filter:["all",["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}},{id:"highlight-inactive-points",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","false"]],paint:{"circle-radius":5,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}},{id:"highlight-active-points",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","true"]],paint:{"circle-radius":3,"circle-color":"#fbb03b","circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-opacity":.3}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b","circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-opacity":.3}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"]],paint:{"circle-radius":3,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}}],modes:$,defaultMode:"draw_point",controls:{trash:!0}}),X=function(e){void 0===e&&(e=[]);const{map:r,draw:n,loaded:o,basemapName:l}=P();t.useEffect(()=>{o&&r.current&&(n.current=Z,r.current.addControl(n.current))},[o]),t.useEffect(()=>{r.current&&r.current.hasControl(n.current)&&(r.current.removeControl(n.current),r.current.addControl(n.current))},[l,...e])},Y=e=>Array.isArray(e)&&2===e.length&&"get"===e[0]?[e[1]]:e.reduce((e,t)=>Array.isArray(t)?"get"===t[0]?[...new Set([...e,t[1]])]:[...new Set([...e,...Y(t)])]:e,[]),J=e=>Array.isArray(null==e?void 0:e["fill-extrusion-height"])&&"+"===(null==e?void 0:e["fill-extrusion-height"][0])?null==e?void 0:e["fill-extrusion-height"][1]:null==e?void 0:e["fill-extrusion-height"],K=e=>{if(e)switch(e.type){case f.GeometryType.Point:return y.point(e.coordinates);case f.GeometryType.Multipoint:return y.multiPoint(e.coordinates);case f.GeometryType.Polyline:return y.multiLineString(e.coordinates);case f.GeometryType.Polygon:case f.GeometryType.Envelope:return y.polygon(e.coordinates)}},Q=(e,r)=>{const n=t.useRef(null),[o,l]=t.useState(null);return t.useEffect(()=>{r&&(n.current=(new m.HubConnectionBuilder).withUrl(e,{withCredentials:!0}).configureLogging(m.LogLevel.Information).build(),n.current.start().then(()=>console.info("Серверные нотификации подключены")).catch(e=>console.info("Ошибка:",e)).finally(()=>l(n.current)))},[r]),t.useEffect(()=>{o&&"Connected"===o.state&&o.invoke("SubscribeNotifications",[]).then(()=>console.info("Подписка `SubscribeNotifications` оформлена")).catch(e=>console.info("Ошибка подписки `SubscribeNotifications`:",e))},[o]),o},ee=t.createContext({});var te,re;(te=exports.VerticalPosition||(exports.VerticalPosition={})).Top="top",te.Bottom="bottom",(re=exports.HorizontalPosition||(exports.HorizontalPosition={})).Left="left",re.Right="right";const ne=e=>{let{handleVerticalPosition:r,handleHorizontalPosition:n,minWidth:o=Number.MIN_SAFE_INTEGER,maxWidth:l=Number.MAX_SAFE_INTEGER,horizontal:i=!0,minHeight:a=Number.MIN_SAFE_INTEGER,maxHeight:s=Number.MAX_SAFE_INTEGER,vertical:c=!0,useResize:d=!1,onResize:p,onResizeEnd:y,onResizeStart:f}=e;const m=t.useRef(),x=t.useRef(),g=t.useRef(),h=t.useCallback((e,t)=>{var r,n;let d=e,y=t;i&&d<o&&(d=o),i&&d>Math.min(window.innerWidth-(null==(r=g.current)?void 0:r.clientWidth),l)&&(d=l),c&&y<a&&(y=a),c&&y>Math.min(window.innerHeight-(null==(n=x.current)?void 0:n.clientHeight),s)&&(y=s),i&&requestAnimationFrame(()=>{u.isNil(m.current)||(m.current.style.width=d+"px")}),c&&requestAnimationFrame(()=>{u.isNil(m.current)||(m.current.style.height=y+"px")}),null==p||p(d,y)},[o,l,a,s,i,c]),b=t.useCallback(e=>{var t,o,l;const{x:i,y:a}=null==(t=m.current)?void 0:t.getBoundingClientRect(),s=n===exports.HorizontalPosition.Right,u=r===exports.VerticalPosition.Bottom,c=s?e.pageX-i:(null==(o=m.current)?void 0:o.offsetWidth)+i-e.pageX,d=u?e.pageY-a:(null==(l=m.current)?void 0:l.offsetHeight)+a-e.pageY;document.body.style.userSelect="none",h(c,d)},[h]),v=t.useCallback(()=>{u.isNil(m.current)||null==f||f(m.current.offsetWidth,m.current.offsetHeight),document.body.addEventListener("pointermove",b),document.body.addEventListener("pointerup",()=>{document.body.style.userSelect="initial",document.body.removeEventListener("pointermove",b),u.isNil(m.current)||null==y||y(m.current.offsetWidth,m.current.offsetHeight)},{once:!0})},[b]);return t.useLayoutEffect(()=>{d&&!u.isNil(m.current)&&h(m.current.offsetWidth,m.current.offsetHeight)},[h,d]),{containerRef:m,verticalHandleRef:x,horizontalHandleRef:g,onPointerDown:v}},oe=["zIndex","lowerSiblings","upperSiblings","drawTriggerDeps","onError","children"],le=e=>{let{layer:t,tileUrl:n,visible:o,beforeId:i}=e;return t?r.createElement(l.Source,{id:t.name,type:"raster",tiles:[n]},r.createElement(l.Layer,{id:t.name,type:"raster","source-layer":"default",beforeId:i,layout:{visibility:o?"visible":"none"}})):null},ie={"circle-radius":4,"circle-color":"#00ffff","circle-opacity":.5,"circle-stroke-width":0,"circle-stroke-color":"#00ffff","circle-stroke-opacity":.5},ae={"fill-color":"#00ffff","fill-opacity":.5},se={"fill-extrusion-base":0,"fill-extrusion-vertical-gradient":!0,"fill-extrusion-color":"#00ffff","fill-extrusion-opacity":.5,"fill-extrusion-height":0},ue={"line-color":"#00ffff","line-width":1,"line-opacity":.5},ce=e=>{var n;let{layer:o,tileUrl:i,visible:a,beforeId:s,getLayerTempStyle:u,onMount:c=(()=>null)}=e;const d=null==o||null==(n=o.configuration)?void 0:n.clientStyle,{idAttribute:p,geometryType:y}=o.layerDefinition||{},m=t.useCallback(()=>{var e,t,n,i,c,d,p,m,x,g,b,v,S,C;const F=a?"visible":"none";switch(y){case f.GeometryType.Point:return r.createElement(l.Layer,{id:o.name,type:"circle","source-layer":"default",beforeId:s,layout:h({},null==u||null==(e=u(o.name,"circle"))?void 0:e.layout,{visibility:F}),paint:h({},ie,null==u||null==(t=u(o.name,"circle"))?void 0:t.paint)});case f.GeometryType.Polygon:return[r.createElement(l.Layer,{key:"polygon-layer-"+o.name,id:o.name,type:"fill","source-layer":"default",beforeId:s,layout:h({},null==u||null==(n=u(o.name,"fill"))?void 0:n.layout,{visibility:a&&!1!==(null==u||null==(i=u(o.name,"fill-extrusion"))||null==(i=i.settings)||null==(i=i.fill)?void 0:i.showBottomSurface)&&Boolean(J(h({},se,null==u||null==(c=u(o.name,"fill-extrusion"))?void 0:c.paint)))?"visible":"none"}),paint:h({},ae,null==u||null==(d=u(o.name,"fill"))?void 0:d.paint)}),r.createElement(l.Layer,{key:"polygon-stroke-layer-"+o.name,id:o.name+"-stroke",type:"line","source-layer":"default",beforeId:s,layout:h({},null==u||null==(p=u(o.name,"line"))?void 0:p.layout,{visibility:a&&!1!==(null==u||null==(m=u(o.name,"fill-extrusion"))||null==(m=m.settings)||null==(m=m.fill)?void 0:m.showBottomSurface)&&Boolean(J(h({},se,null==u||null==(x=u(o.name,"fill-extrusion"))?void 0:x.paint)))?"visible":"none"}),paint:h({},ue,null==u||null==(g=u(o.name,"line"))?void 0:g.paint)}),r.createElement(l.Layer,{key:"polygon-extrusion-layer-"+o.name,id:o.name+"-extrusion",type:"fill-extrusion","source-layer":"default",beforeId:s,minzoom:0,maxzoom:23,layout:h({},null==u||null==(b=u(o.name,"fill-extrusion"))?void 0:b.layout,{visibility:F}),paint:h({},se,null==u||null==(v=u(o.name,"fill-extrusion"))?void 0:v.paint)})];case f.GeometryType.Polyline:return r.createElement(l.Layer,{id:o.name,type:"line","source-layer":"default",beforeId:s,layout:h({},null==u||null==(S=u(o.name,"line"))?void 0:S.layout,{visibility:F}),paint:h({},ue,null==u||null==(C=u(o.name,"line"))?void 0:C.paint)});default:return null}},[y,o,s,u,a]),x=t.useCallback(()=>d.items.map(e=>{var t,n,i,c,p,m,x,g,b;const v=((e,t)=>{switch(e){case f.GeometryType.Point:return["point-layer-",""];case f.GeometryType.Polyline:return["polyline-layer-",""];case f.GeometryType.Polygon:switch(t){case"line":return["polygon-stroke-layer-","-stroke"];case"fill-extrusion":return["polygon-extrusion-layer-","-extrusion"];default:return["polygon-layer-",""]}default:return["",""]}})(y,e.type),S="fill-extrusion"===e.type,C=d.items.some(e=>"fill-extrusion"===e.type)&&("fill"===e.type||"line"===e.type),F=C||S?h({},null==(t=d.items)||null==(t=t.find(e=>"fill-extrusion"===e.type))?void 0:t.paint,null==u||null==(n=u(o.name,"fill-extrusion"))?void 0:n.paint):void 0,k=h({},null==d?void 0:d.settings,null==u||null==(i=u(o.name,e.type))?void 0:i.settings),w=J(F),T=Boolean(w),E=a&&(S&&T||!C&&!S||C&&(!T||null==(c=null==k||null==(p=k.fill)?void 0:p.showBottomSurface)||c))?"visible":"none";return r.createElement(l.Layer,{key:""+v[0]+o.name,id:""+o.name+v[1],type:e.type,"source-layer":"default",beforeId:s,minzoom:null!=(m=null==d?void 0:d.minzoom)?m:0,maxzoom:null!=(x=null==d?void 0:d.maxzoom)?x:23,layout:h({},e.layout,null==u||null==(g=u(o.name,e.type))?void 0:g.layout,{visibility:E}),paint:h({},e.paint,null==u||null==(b=u(o.name,e.type))?void 0:b.paint)})}),[s,d,y,o.name,a,u]);return t.useEffect(c,[o.name]),o?r.createElement(l.Source,{promoteId:p,id:o.name,type:"vector",tiles:[i]},null!=d&&d.items?x():m()):null};var de,pe,ye,fe,me,xe,ge,he,be,ve,Se,Ce,Fe,ke,we;const Te=o.div(de||(de=C(["\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n position: relative;\n\n ","\n\n ","\n\n ","\n ","\n ","\n ","\n ","\n"])),e=>{let{horizontal:t,vertical:r}=e;return t&&!r?n.css(pe||(pe=C(["\n height: 100%;\n "]))):!t&&r?n.css(ye||(ye=C(["\n width: 100%;\n "]))):""},e=>{let{horizontal:t,vertical:r}=e;return n.css(fe||(fe=C(["\n will-change: ",";\n "])),[t&&"width",r&&"height"].filter(Boolean).join(","))},e=>{let{maxHeight:t}=e;return t&&n.css(me||(me=C(["\n max-height: ","px;\n "])),t)},e=>{let{minHeight:t}=e;return t&&n.css(xe||(xe=C(["\n min-height: ","px;\n "])),t)},e=>{let{maxWidth:t}=e;return t&&n.css(ge||(ge=C(["\n max-width: ","px;\n "])),t)},e=>{let{height:t}=e;return t&&n.css(he||(he=C(["\n height: ",";\n "])),t)},e=>{let{width:t}=e;return t&&n.css(be||(be=C(["\n width: ",";\n "])),t)}),Ee=o.div(we||(we=C(["\n position: absolute;\n box-sizing: border-box;\n z-index: 3;\n\n padding: 0.25rem;\n pointer-events: ",";\n transition: border-color 150ms cubic-bezier(0.2, 1, 0.6, 1);\n\n &:hover {\n border-color: ",";\n }\n\n ","\n"])),e=>{let{disabled:t}=e;return t&&"none"},e=>{let{theme:{palette:t}}=e;return t.primary},e=>{let{position:t,theme:{palette:r}}=e;return((e,t)=>{switch(e){case exports.HorizontalPosition.Left:return n.css(ve||(ve=C(["\n height: 100%;\n border-left: 2px solid ",";\n top: 0;\n left: 0;\n cursor: ew-resize;\n "])),t.elementDeep);case exports.HorizontalPosition.Right:return n.css(Se||(Se=C(["\n height: 100%;\n border-right: 2px solid ",";\n top: 0;\n right: 0;\n cursor: ew-resize;\n "])),t.elementDeep);case exports.VerticalPosition.Top:return n.css(Ce||(Ce=C(["\n width: 100%;\n border-top: 2px solid ",";\n top: 0;\n left: 0;\n cursor: ns-resize;\n "])),t.elementDeep);case exports.VerticalPosition.Bottom:return n.css(Fe||(Fe=C(["\n width: 100%;\n border-bottom: 2px solid ",";\n bottom: 0;\n left: 0;\n cursor: ns-resize;\n "])),t.elementDeep);default:return n.css(ke||(ke=C(["\n width: 100%;\n border-top: 2px solid ",";\n top: 0;\n left: 0;\n "])),t.elementDeep)}})(t,r)}),Pe=["className","handleClassName","width","height","disabled","handleVerticalPosition","handleHorizontalPosition","Handle","children"];exports.BuildingsLayer=e=>{let{beforeId:t,transparent:n}=e;return r.createElement(l.Layer,{id:"mapbox-3d-buildings",source:"composite","source-layer":"building",filter:["==","extrude","true"],type:"fill-extrusion",minzoom:15,beforeId:t,paint:{"fill-extrusion-color":"#aaaaaa","fill-extrusion-height":["interpolate",["linear"],["zoom"],15,0,15.05,["get","height"]],"fill-extrusion-base":["interpolate",["linear"],["zoom"],15,0,15.05,["get","min_height"]],"fill-extrusion-opacity":n?0:.5}})},exports.ErrorBoundary=w,exports.Layer=e=>{let{layer:n,layerType:o,visible:l,beforeId:i,tileUrl:a,onMount:s=(()=>null)}=e;return t.useEffect(s,[n.name]),n?r.createElement("RasterTileLayer"===o?le:ce,{layer:n,tileUrl:a,visible:l,beforeId:i,onMount:s}):null},exports.Map=e=>{let{zIndex:t,lowerSiblings:n,upperSiblings:o,drawTriggerDeps:l,onError:a,children:s}=e,u=S(e,oe);const{map:c,setLoaded:d}=P();return X(l),r.createElement(E,{$zIndex:t},n,r.createElement(i,Object.assign({},u,{renderWorldCopies:!0,antialias:!0,doubleClickZoom:!1,cursor:"default",onLoad:e=>{c.current=e.target,c.current.on("error",a),d(!0)}}),s),o)},exports.MapContext=z,exports.MapProvider=e=>{let{basemapItems:n,defaultBasemap:o,children:l}=e;const i=t.useRef(),a=t.useRef(),[u,c]=t.useState(!1),[d,p]=t.useState(o),[y,f]=t.useState(!1),[m,x]=t.useState(H),[g,b]=t.useState(_),[v,S]=t.useState(A),C=t.useCallback(()=>{x(H)},[]),F=t.useCallback(()=>{b(_)},[]),k=t.useCallback(()=>{S(e=>{var t,r,n;const{layerName:o,features:l,currentId:i}=e,a=null==l||null==(t=l[o])?void 0:t.findIndex(e=>e.id===i);return a===(null==l||null==(r=l[o])?void 0:r.length)-1?e:h({},e,{currentId:null==l||null==(n=l[o])||null==(n=n[a+1])?void 0:n.id})})},[]),w=t.useCallback(()=>{S(e=>{var t,r;const{layerName:n,features:o,currentId:l}=e,i=null==o||null==(t=o[n])?void 0:t.findIndex(e=>e.id===l);return 0===i?e:h({},e,{currentId:null==o||null==(r=o[n])||null==(r=r[i-1])?void 0:r.id})})},[]),T=t.useCallback((e,t,r)=>{S(n=>{var o;const l=null!=e?e:{},i=Object.keys(l).find(e=>l[e].length>0),a=null==(o=l[i])?void 0:o.map(e=>{let{id:t}=e;return t});return h({},n,{features:l,layerName:i,currentId:null!=t?t:null==a?void 0:a[0],selectionOffset:r})})},[]),E=t.useCallback(e=>{S(t=>h({},t,{totalCounts:e}))},[]),P=t.useCallback(e=>{S(t=>h({},t,{initialized:e}))},[]),N=t.useCallback(e=>{S(t=>{var r;return h({},t,{layerName:e,currentId:null==(r=t.features)||null==(r=r[e])||null==(r=r[0])?void 0:r.id,selectionOffset:0})})},[]),G=t.useCallback(e=>{S(t=>h({},t,{statisticsActive:e}))},[]),M=t.useCallback(e=>{S(t=>h({},t,{geometryMasking:e}))},[]),I=t.useCallback(e=>{S(t=>{var r,n;return h({},t,{features:h({},t.features,{[t.layerName]:s.changeProps(null!=(r=null==(n=t.features)?void 0:n[t.layerName])?r:[],{id:t.currentId},e)})})})},[]),R=t.useCallback(()=>{S(A)},[]);return r.createElement(z.Provider,{value:{map:i,draw:a,loaded:u,setLoaded:c,basemapItems:n,basemapName:d,setBasemapName:p,defaultBasemap:o,globeProjection:y,setGlobeProjection:f,geometrySelection:m,setGeometrySelection:x,resetGeometrySelection:C,geometryEditor:g,setGeometryEditor:b,resetGeometryEditor:F,selectFeatures:v,setNextFeature:k,setPrevFeature:w,setSelectedFeatures:T,setSelectedFeaturesTotalCounts:E,setSelectFeaturesInitialized:P,setSelectFeaturesLayerName:N,setSelectFeaturesStatisticsActive:G,setSelectFeaturesGeometryMasking:M,updateCurrentFeature:I,resetSelectedFeatures:R}},l)},exports.NO_CONTENT_VALUE=j,exports.ResizablePanel=e=>{let{className:n,handleClassName:o,width:l,height:i,disabled:a,handleVerticalPosition:s=exports.VerticalPosition.Top,handleHorizontalPosition:u=exports.HorizontalPosition.Left,children:c}=e,d=S(e,Pe);const p=t.useMemo(()=>h({},d,{handleVerticalPosition:s,handleHorizontalPosition:u}),[d,s,u]),{containerRef:y,verticalHandleRef:f,horizontalHandleRef:m,onPointerDown:x}=ne(p),{vertical:g,horizontal:b}=d;return r.createElement(Te,{ref:y,width:l,height:i,style:a?{height:"auto"}:void 0,className:n},g&&r.createElement(Ee,{ref:f,position:s,disabled:a,className:o,onPointerDown:x}),b&&r.createElement(Ee,{ref:m,position:u,disabled:a,className:o,onPointerDown:x}),c)},exports.ServerNotificationsContext=ee,exports.ServerNotificationsProvider=e=>{let{url:n,initialized:o,children:l}=e;const i=Q(n,o),a=t.useCallback(async e=>{if(i&&"Connected"===i.state&&e)try{const t=await i.invoke("AddSubscription",e);return console.info("Подписка добавлена, id:",t),t}catch(e){return console.info("Ошибка добавления подписки:",e),Promise.resolve(null)}},[i]),s=t.useCallback(async(e,t)=>{if(i&&"Connected"===i.state&&e&&t)try{await i.invoke("UpdateSubscription",e,t)}catch(t){console.info("Ошибка обновления подписки "+e+":",t)}},[i]),u=t.useCallback(async e=>{if(i&&"Connected"===i.state&&e)try{await i.invoke("Unsubscribe",[e])}catch(t){console.info("Ошибка отписки по "+e+":",t)}},[i]);return r.createElement(ee.Provider,{value:{connection:i,addSubscription:a,updateSubscription:s,unsubscribeById:u}},l)},exports.convertSpToTurfFeature=K,exports.drawModeToGeometrySelectionType=e=>{switch(e){case"draw_point":return exports.GeometrySelectionTypes.Point;case"draw_polygon":return exports.GeometrySelectionTypes.Polygon;case"draw_line_string":return exports.GeometrySelectionTypes.Line;default:return exports.GeometrySelectionTypes.Point}},exports.findAttributeInExpression=Y,exports.formatDate=function(e,t){let{dateFormat:r=exports.DateFormat.ClientDefaultFormat,defaultValue:n=j}=void 0===t?{}:t;const o=e?V(e):null;return c.isValid(o)?c.format(o,r):n.toString()},exports.geometryToWkt=U,exports.getActualExtrusionHeight=J,exports.getDate=V,exports.getGeometrySelectionTurfFeature=(e,t,r)=>{if(r)switch(t){case exports.GeometrySelectionTypes.Point:return y.toWgs84(y.point(e));case exports.GeometrySelectionTypes.Polygon:return y.toWgs84(y.polygon(e));case exports.GeometrySelectionTypes.Line:return y.toWgs84(y.lineString(e))}switch(t){case exports.GeometrySelectionTypes.Point:return y.toMercator(y.point(e));case exports.GeometrySelectionTypes.Polygon:return y.toMercator(y.polygon(e));case exports.GeometrySelectionTypes.Line:return y.toMercator(y.lineString(e))}},exports.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),exports.isObject=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},exports.parseClientStyle=e=>{var t;return e?null==e||null==(t=e.items)?void 0:t.reduce((e,t)=>{var r;return!t.paint||u.isEmpty(t.paint)?e:null==(r=Object.entries(t.paint))?void 0:r.reduce((e,t)=>{let[,r]=t;return Array.isArray(r)?[...new Set([...e,...Y(r)])]:e},[])},[]):[]},exports.useCurrentSelectedFeature=N,exports.useEditingFeature=()=>{const[{layerName:e,active:r,mode:n}]=O(),o=N();return t.useMemo(()=>r&&(n===exports.GeometryEditorMode.Edit&&e===(null==o?void 0:o.layer)||n===exports.GeometryEditorMode.Create),[r,o,e,n])},exports.useEwktGeometry=()=>{const[{history:e,type:r}]=B();return t.useMemo(()=>{var t,n;return-1===e.step?"":r===exports.GeometrySelectionTypes.Zones?u.isEmpty(null==(t=e.zones[e.step])?void 0:t[0])?"SRID=3857;"+U(e.features[e.step]):"SRID=3857;"+U(null==(n=e.zones[e.step])?void 0:n[0]):"SRID=3857;"+U(e.features[e.step])},[e.features,e.step,e.zones,r])},exports.useGeometryEditor=O,exports.useGeometrySelection=B,exports.useGeometrySelectionBuffer=()=>{const[{settings:{bufferRadius:e,bufferMultiplier:r},isBuffer:n}]=B();return t.useMemo(()=>{if(n&&e)return Number((+e||0)*+r).toFixed(2)},[n,e,r])},exports.useMapContext=P,exports.useMapDraw=X,exports.useRedrawLayer=()=>{const{map:e}=P();return t.useCallback(t=>{const r=e.current.getSource(t);r.setTiles(r.tiles)},[e])},exports.useResizer=ne,exports.useSelectFeaturesCount=()=>{const{selectFeatures:e}=P();return t.useMemo(()=>{var t,r;return null!=(t=null==(r=e.features)||null==(r=r[e.layerName])?void 0:r.length)?t:0},[e])},exports.useSelectFeaturesCurrentIndex=()=>{const{selectFeatures:e}=P();return t.useMemo(()=>{var t,r;return null!=(t=e.features)&&null!=(t=t[e.layerName])&&t.length?null==(r=e.features)||null==(r=r[e.layerName])?void 0:r.findIndex(t=>t.id===e.currentId):-1},[e])},exports.useSelectFeaturesGeometryMasking=()=>{const{selectFeatures:e,setSelectFeaturesGeometryMasking:r}=P(),n=t.useCallback(e=>{r(e)},[r]);return[e.geometryMasking,n]},exports.useSelectFeaturesInitialized=()=>{const{selectFeatures:e,setSelectFeaturesInitialized:r}=P(),n=t.useCallback(e=>{r(e)},[r]);return[e.initialized,n]},exports.useSelectFeaturesLayerName=()=>{const{selectFeatures:e,setSelectFeaturesLayerName:r}=P(),n=t.useCallback(e=>{r(e)},[r]);return[e.layerName,n]},exports.useSelectFeaturesPagination=()=>{const{setNextFeature:e,setPrevFeature:r}=P();return{onNext:t.useCallback(()=>{e()},[e]),onPrev:t.useCallback(()=>{r()},[r])}},exports.useSelectFeaturesStatisticsActive=()=>{const{selectFeatures:e,setSelectFeaturesStatisticsActive:r}=P(),n=t.useCallback(e=>{r(e)},[r]);return[e.statisticsActive,n]},exports.useSelectFeaturesTotalCounts=()=>{var e;const{selectFeatures:r,setSelectedFeaturesTotalCounts:n}=P(),o=t.useCallback(e=>{n(e)},[n]);return[null!=(e=r.totalCounts)?e:{},o]},exports.useSelectedFeatures=()=>{var e;const{selectFeatures:r,setSelectedFeatures:n}=P(),o=t.useCallback(e=>{n(e)},[n]);return[null!=(e=r.features)?e:{},o]},exports.useServerNotifications=Q,exports.useServerNotificationsContext=()=>t.useContext(ee),exports.useToggle=e=>{const[r,n]=t.useState(void 0!==e&&e),o=t.useCallback(()=>n(!r),[r]);return[r,o,n]},exports.useUpdateCurrentFeature=()=>{const{updateCurrentFeature:e}=P();return t.useCallback(t=>{e(t)},[e])},exports.useZoomToFeatures=()=>{const{map:e}=P();return t.useCallback((t,r)=>{if(!t)return;const n=y.bbox({type:"FeatureCollection",features:t.map(e=>K(e.geometry))});e.current.fitBounds(n,{padding:null!=r?r:150})},[e])},exports.useZoomToLayer=()=>{const{map:e}=P();return t.useCallback(async(t,r)=>{var n;t&&t.overall&&e.current.fitBounds([...t.overall.coordinates[0],...t.overall.coordinates[1]],{padding:null!=(n=null==r?void 0:r.padding)?n:50})},[e])},exports.useZoomToPoint=()=>{const{map:e}=P();return t.useCallback((t,r)=>{e.current?(r&&e.current.once("moveend",()=>{r()}),e.current.flyTo(t)):null==r||r()},[e])};
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),r=e(t),n=e(require("styled-components")),o=require("react-map-gl/mapbox"),l=e(o),i=require("@evergis/api"),a=require("lodash"),u=require("@turf/turf");require("@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css");var s,c=e(require("@mapbox/mapbox-gl-draw")),p=require("@microsoft/signalr"),y=require("date-fns");function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e,t){return t||(t=e.slice(0)),e.raw=t,e}require("mapbox-gl/dist/mapbox-gl.css");const g=n.div(s||(s=x(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100vh;\n"])));function h(e,t,r){return t=b(t),n=e,!(o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){return!1}}()?Reflect.construct(t,r||[],b(e).constructor):t.apply(e,r))||"object"!=typeof o&&"function"!=typeof o?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n):o;var n,o}let w=function(e){function n(){var e;return f(this,n),(e=h(this,n,arguments)).state={hasError:!1},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(n,t.Component),o=n,i=[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}],(l=[{key:"componentDidCatch",value:function(e){console.error(e)}},{key:"render",value:function(){const{children:e,errorContents:t}=this.props,{hasError:n}=this.state;return n?r.createElement(g,null,t):r.createElement(r.Fragment,null,e)}}])&&d(o.prototype,l),i&&d(o,i),o;var o,l,i}();const C={"circle-radius":4,"circle-color":"#00ffff","circle-opacity":.5,"circle-stroke-width":0,"circle-stroke-color":"#00ffff","circle-stroke-opacity":.5},F={"fill-color":"#00ffff","fill-opacity":.5},k={"fill-extrusion-base":0,"fill-extrusion-vertical-gradient":!0,"fill-extrusion-color":"#00ffff","fill-extrusion-opacity":.5,"fill-extrusion-height":0},E={"line-color":"#00ffff","line-width":1,"line-opacity":.5},T=e=>{let{layer:t,tileUrl:n,visible:l,beforeId:i}=e;return t?r.createElement(o.Source,{id:t.name,type:"raster",tiles:[n]},r.createElement(o.Layer,{id:t.name,type:"raster","source-layer":"default",beforeId:i,layout:{visibility:l?"visible":"none"}})):null},S=e=>Array.isArray(e)&&2===e.length&&"get"===e[0]?[e[1]]:e.reduce((e,t)=>Array.isArray(t)?"get"===t[0]?[...new Set([...e,t[1]])]:[...new Set([...e,...S(t)])]:e,[]),P=e=>Array.isArray(null==e?void 0:e["fill-extrusion-height"])&&"+"===(null==e?void 0:e["fill-extrusion-height"][0])?null==e?void 0:e["fill-extrusion-height"][1]:null==e?void 0:e["fill-extrusion-height"],D=e=>{if(e)switch(e.type){case i.GeometryType.Point:return u.point(e.coordinates);case i.GeometryType.Multipoint:return u.multiPoint(e.coordinates);case i.GeometryType.Polyline:return u.multiLineString(e.coordinates);case i.GeometryType.Polygon:case i.GeometryType.Envelope:return u.polygon(e.coordinates)}},L=e=>{var n;let{layer:l,tileUrl:a,visible:u,beforeId:s,getLayerTempStyle:c,onMount:p=(()=>null)}=e;const y=null==l||null==(n=l.configuration)?void 0:n.clientStyle,{idAttribute:f,geometryType:d}=l.layerDefinition||{},b=t.useCallback(()=>{var e,t,n,a,p,y,f,b,v,x,g,h,w,T;const S=u?"visible":"none";switch(d){case i.GeometryType.Point:return r.createElement(o.Layer,{id:l.name,type:"circle","source-layer":"default",beforeId:s,layout:m({},null==c||null==(e=c(l.name,"circle"))?void 0:e.layout,{visibility:S}),paint:m({},C,null==c||null==(t=c(l.name,"circle"))?void 0:t.paint)});case i.GeometryType.Polygon:return[r.createElement(o.Layer,{key:"polygon-layer-"+l.name,id:l.name,type:"fill","source-layer":"default",beforeId:s,layout:m({},null==c||null==(n=c(l.name,"fill"))?void 0:n.layout,{visibility:u&&!1!==(null==c||null==(a=c(l.name,"fill-extrusion"))||null==(a=a.settings)||null==(a=a.fill)?void 0:a.showBottomSurface)&&Boolean(P(m({},k,null==c||null==(p=c(l.name,"fill-extrusion"))?void 0:p.paint)))?"visible":"none"}),paint:m({},F,null==c||null==(y=c(l.name,"fill"))?void 0:y.paint)}),r.createElement(o.Layer,{key:"polygon-stroke-layer-"+l.name,id:l.name+"-stroke",type:"line","source-layer":"default",beforeId:s,layout:m({},null==c||null==(f=c(l.name,"line"))?void 0:f.layout,{visibility:u&&!1!==(null==c||null==(b=c(l.name,"fill-extrusion"))||null==(b=b.settings)||null==(b=b.fill)?void 0:b.showBottomSurface)&&Boolean(P(m({},k,null==c||null==(v=c(l.name,"fill-extrusion"))?void 0:v.paint)))?"visible":"none"}),paint:m({},E,null==c||null==(x=c(l.name,"line"))?void 0:x.paint)}),r.createElement(o.Layer,{key:"polygon-extrusion-layer-"+l.name,id:l.name+"-extrusion",type:"fill-extrusion","source-layer":"default",beforeId:s,minzoom:0,maxzoom:23,layout:m({},null==c||null==(g=c(l.name,"fill-extrusion"))?void 0:g.layout,{visibility:S}),paint:m({},k,null==c||null==(h=c(l.name,"fill-extrusion"))?void 0:h.paint)})];case i.GeometryType.Polyline:return r.createElement(o.Layer,{id:l.name,type:"line","source-layer":"default",beforeId:s,layout:m({},null==c||null==(w=c(l.name,"line"))?void 0:w.layout,{visibility:S}),paint:m({},E,null==c||null==(T=c(l.name,"line"))?void 0:T.paint)});default:return null}},[d,l,s,c,u]),v=t.useCallback(()=>y.items.map(e=>{var t,n,a,p,f,b,v,x,g;const h=((e,t)=>{switch(e){case i.GeometryType.Point:return["point-layer-",""];case i.GeometryType.Polyline:return["polyline-layer-",""];case i.GeometryType.Polygon:switch(t){case"line":return["polygon-stroke-layer-","-stroke"];case"fill-extrusion":return["polygon-extrusion-layer-","-extrusion"];default:return["polygon-layer-",""]}default:return["",""]}})(d,e.type),w="fill-extrusion"===e.type,C=y.items.some(e=>"fill-extrusion"===e.type)&&("fill"===e.type||"line"===e.type),F=C||w?m({},null==(t=y.items)||null==(t=t.find(e=>"fill-extrusion"===e.type))?void 0:t.paint,null==c||null==(n=c(l.name,"fill-extrusion"))?void 0:n.paint):void 0,k=m({},null==y?void 0:y.settings,null==c||null==(a=c(l.name,e.type))?void 0:a.settings),E=P(F),T=Boolean(E),S=u&&(w&&T||!C&&!w||C&&(!T||null==(p=null==k||null==(f=k.fill)?void 0:f.showBottomSurface)||p))?"visible":"none";return r.createElement(o.Layer,{key:""+h[0]+l.name,id:""+l.name+h[1],type:e.type,"source-layer":"default",beforeId:s,minzoom:null!=(b=null==y?void 0:y.minzoom)?b:0,maxzoom:null!=(v=null==y?void 0:y.maxzoom)?v:23,layout:m({},e.layout,null==c||null==(x=c(l.name,e.type))?void 0:x.layout,{visibility:S}),paint:m({},e.paint,null==c||null==(g=c(l.name,e.type))?void 0:g.paint)})}),[s,y,d,l.name,u,c]);return t.useEffect(p,[l.name]),l?r.createElement(o.Source,{promoteId:f,id:l.name,type:"vector",tiles:[a]},null!=y&&y.items?v():b()):null};var I;const A=n.div(I||(I=x(["\n position: relative;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n z-index: ",";\n\n .mapbox-gl-draw_trash {\n display: none;\n }\n\n .mapboxgl-ctrl-logo {\n display: none;\n }\n\n .mapboxgl-ctrl.mapboxgl-ctrl-attrib {\n display: none;\n }\n\n .mapboxgl-ctrl-geocoder.mapboxgl-ctrl {\n width: 350px;\n }\n"])),e=>{let{$zIndex:t}=e;return null!=t?t:1}),M=c.modes;M.static={onSetup:function(){return this.setActionableState(void 0),{}},toDisplayFeatures:function(e,t,r){r(t)}};const O=t.createContext({});var _;(_=exports.BaseMapTheme||(exports.BaseMapTheme={})).Light="light",_.Dark="dark";const N=t.createContext({}),j=()=>t.useContext(O),B=new c({displayControlsDefault:!1,styles:[{id:"gl-draw-point",type:"circle",filter:["all",["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}},{id:"highlight-inactive-points",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","false"]],paint:{"circle-radius":5,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}},{id:"highlight-active-points",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","true"]],paint:{"circle-radius":3,"circle-color":"#fbb03b","circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-opacity":.3}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b","circle-stroke-color":"#FFFFFF","circle-stroke-width":1,"circle-stroke-opacity":.3}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"]],paint:{"circle-radius":3,"circle-color":"#D20C0C","circle-stroke-color":"#FFFFFF","circle-stroke-width":3,"circle-stroke-opacity":.3}}],modes:M,defaultMode:"draw_point",controls:{trash:!0}}),z="—";var R;(R=exports.DateFormat||(exports.DateFormat={})).ClientDefaultFormat="dd.MM.yyyy HH:mm",R.DateTime="dd.MM.yyyy HH:mm:ss",R.UTC="yyyy-MM-dd'T'HH:mm:ss.sssxxx",R.AxisTooltip="d MMMM yyyy";const U=[y.parseJSON,y.parseISO,e=>new Date(e)],q=e=>{if(!e)return null;if("string"==typeof e){for(const t of U){const r=t(e);if(y.isValid(r))return y.toDate(r)}return null}const t=y.toDate(e);return y.isValid(t)?t:null},G=(e,t)=>{let r;return function(){for(var n=arguments.length,o=new Array(n),l=0;l<n;l++)o[l]=arguments[l];r&&window.clearTimeout(r),r=window.setTimeout(()=>{e(...o)},t)}},$=["zIndex","lowerSiblings","upperSiblings","drawTriggerDeps","onError","children"];exports.DEFAULT_CIRCLE_PAINT=C,exports.DEFAULT_FILL_EXTRUSION_PAINT=k,exports.DEFAULT_FILL_PAINT=F,exports.DEFAULT_LINE_PAINT=E,exports.ErrorBoundary=w,exports.Layer=e=>{let{layer:n,layerType:o,visible:l,beforeId:i,tileUrl:a,onMount:u=(()=>null)}=e;return t.useEffect(u,[n.name]),n?r.createElement("RasterTileLayer"===o?T:L,{layer:n,tileUrl:a,visible:l,beforeId:i,onMount:u}):null},exports.Map=e=>{let{zIndex:t,lowerSiblings:n,upperSiblings:o,onError:i,children:a}=e,u=function(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)t.indexOf(r=l[n])>=0||(o[r]=e[r]);return o}(e,$);const{map:s,setLoaded:c}=j();return r.createElement(A,{$zIndex:t},n,r.createElement(l,Object.assign({},u,{renderWorldCopies:!0,antialias:!0,doubleClickZoom:!1,cursor:"default",onLoad:e=>{s.current=e.target,s.current.on("error",i),c(!0)}}),a),o)},exports.MapContext=O,exports.MapProvider=e=>{let{basemapItems:n,defaultBasemap:o,children:l}=e;const i=t.useRef(),a=t.useRef(),[u,s]=t.useState(!1),[c,p]=t.useState(o);return r.createElement(O.Provider,{value:{map:i,draw:a,loaded:u,setLoaded:s,basemapItems:n,basemapName:c,setBasemapName:p,defaultBasemap:o}},l)},exports.NO_CONTENT_VALUE=z,exports.ServerNotificationsContext=N,exports.ServerNotificationsProvider=e=>{let{url:n,initialized:o,children:l}=e;const i=((e,r)=>{const n=t.useRef(null),[o,l]=t.useState(null);return t.useEffect(()=>{r&&(n.current=(new p.HubConnectionBuilder).withUrl(e,{withCredentials:!0}).configureLogging(p.LogLevel.Information).build(),n.current.start().then(()=>console.info("Серверные нотификации подключены")).catch(e=>console.info("Ошибка:",e)).finally(()=>l(n.current)))},[r]),t.useEffect(()=>{o&&"Connected"===o.state&&o.invoke("SubscribeNotifications",[]).then(()=>console.info("Подписка `SubscribeNotifications` оформлена")).catch(e=>console.info("Ошибка подписки `SubscribeNotifications`:",e))},[o]),o})(n,o),a=t.useCallback(async e=>{if(i&&"Connected"===i.state&&e)try{const t=await i.invoke("AddSubscription",e);return console.info("Подписка добавлена, id:",t),t}catch(e){return console.info("Ошибка добавления подписки:",e),Promise.resolve(null)}},[i]),u=t.useCallback(async(e,t)=>{if(i&&"Connected"===i.state&&e&&t)try{await i.invoke("UpdateSubscription",e,t)}catch(t){console.info("Ошибка обновления подписки "+e+":",t)}},[i]),s=t.useCallback(async e=>{if(i&&"Connected"===i.state&&e)try{await i.invoke("Unsubscribe",[e])}catch(t){console.info("Ошибка отписки по "+e+":",t)}},[i]);return r.createElement(N.Provider,{value:{connection:i,addSubscription:a,updateSubscription:u,unsubscribeById:s}},l)},exports.convertSpToTurfFeature=D,exports.debounce=G,exports.findAttributeInExpression=S,exports.formatDate=function(e,t){let{dateFormat:r=exports.DateFormat.ClientDefaultFormat,defaultValue:n=z}=void 0===t?{}:t;const o=e?q(e):null;return y.isValid(o)?y.format(o,r):n.toString()},exports.getActualExtrusionHeight=P,exports.getDate=q,exports.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),exports.isObject=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)},exports.parseClientStyle=e=>{var t;return e?null==e||null==(t=e.items)?void 0:t.reduce((e,t)=>{var r;return!t.paint||a.isEmpty(t.paint)?e:null==(r=Object.entries(t.paint))?void 0:r.reduce((e,t)=>{let[,r]=t;return Array.isArray(r)?[...new Set([...e,...S(r)])]:e},[])},[]):[]},exports.useDebouncedCallback=e=>t.useMemo(()=>G(e=>{e()},e),[e]),exports.useMapContext=j,exports.useMapDraw=function(e){void 0===e&&(e=[]);const{map:r,draw:n,loaded:o,basemapName:l}=j();t.useEffect(()=>{o&&r.current&&(n.current=B,r.current.addControl(n.current))},[o]),t.useEffect(()=>{r.current&&r.current.hasControl(n.current)&&(r.current.removeControl(n.current),r.current.addControl(n.current))},[l,...e])},exports.useRedrawLayer=()=>{const{map:e}=j();return t.useCallback(t=>{const r=e.current.getSource(t);r.setTiles(r.tiles)},[e])},exports.useServerNotificationsContext=()=>t.useContext(N),exports.useToggle=e=>{const[r,n]=t.useState(void 0!==e&&e),o=t.useCallback(()=>n(!r),[r]);return[r,o,n]},exports.useWindowResize=(e,r)=>{const n=t.useMemo(()=>e?G(e,r||144):void 0,[e,r]);t.useEffect(()=>(n&&window.addEventListener("resize",n),()=>n&&window.removeEventListener("resize",n)),[n])},exports.useZoomToFeatures=()=>{const{map:e}=j();return t.useCallback((t,r)=>{if(!t)return;const n=u.bbox({type:"FeatureCollection",features:t.map(e=>D(e.geometry))});e.current.fitBounds(n,{padding:null!=r?r:150})},[e])},exports.useZoomToPoint=()=>{const{map:e}=j();return t.useCallback((t,r)=>{e.current?(r&&e.current.once("moveend",()=>{r()}),e.current.flyTo(t)):null==r||r()},[e])};
|
|
2
2
|
//# sourceMappingURL=react.cjs.production.min.js.map
|