@opengeoweb/core 6.0.0 → 6.0.1

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/index.js CHANGED
@@ -4,9 +4,9 @@ import { Grid, Box as Box$2, MenuItem, Typography, useTheme as useTheme$2, Butto
4
4
  import { CustomIconButton, TooltipSelect, AlertIcon, useControlledTooltip, CustomTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, AlertBanner, CustomAccordion, ToolContainerDraggable, calculateDialogSizeAndPosition, CustomToggleButton, SearchHighlight, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
5
5
  import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, Add, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Filter, Search, Clear, Info, DimensionsOther, DimensionsElevation, DimensionsRefTime, DimensionsTime, Edit, Close, Home, Minus, Layers, Equalizer, Link, LinkOff, AutoUpdateInActive, Speed, Clock, Now, Animation, Options, Pause, Play, StepForward, StepBackward, dragHandlePath, ChevronDown, ChevronUp, Location, DrawPolygon, DrawRegion, List as List$1, ChevronRight, ChevronLeft, Resize, ExitDomain, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
6
6
  import { useDispatch, useSelector, connect, Provider } from 'react-redux';
7
- import { uiTypes, uiSelectors, uiActions, layerTypes, mapStoreUtils, layerActions, layerSelectors, serviceSelectors, serviceActions, getCapabilities, mapSelectors, mapActions, mapEnums, mapConstants, filterLayers, getUserAddedServices, layerSelectSelectors, layerSelectActions, storeUtils, snackbarActions, layerSelectTypes, mapUtils, genericActions, tilesettings, syncConstants, defaultLayers, syncGroupsSelectors, syncGroupsSelector, snackbarModuleConfig, snackbarSelectors, coreModuleConfig, routerUtils, routerModuleConfig, appModuleConfig, appActions } from '@opengeoweb/store';
7
+ import { uiTypes, uiSelectors, uiActions, layerTypes, layerUtils, layerActions, layerSelectors, serviceSelectors, serviceActions, mapSelectors, mapActions, mapEnums, mapConstants, filterLayers, getUserAddedServices, layerSelectSelectors, layerSelectActions, storeUtils, snackbarActions, layerSelectTypes, mapUtils, genericActions, syncConstants, defaultLayers, syncGroupsSelectors, syncGroupsSelector, snackbarModuleConfig, snackbarSelectors, coreModuleConfig, routerUtils, routerModuleConfig, appModuleConfig, appActions } from '@opengeoweb/store';
8
8
  import { ReactSortable } from 'react-sortablejs';
9
- import { WMGetServiceFromStore, LayerType, clearImageCache, getMapImageStore, WMBBOX, debug as debug$3, DebugType, WMJSMap, WMLayer, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer } from '@opengeoweb/webmap';
9
+ import { webmapUtils, WMGetServiceFromStore, getCapabilities, LayerType, clearImageCache, getMapImageStore, WMBBOX, debug as debug$3, DebugType, WMJSMap, tilesettings, WMLayer, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer } from '@opengeoweb/webmap';
10
10
  import { jsx } from 'react/jsx-runtime';
11
11
  import _, { isEqual as isEqual$1, debounce, groupBy, throttle as throttle$2, clamp as clamp$1, range } from 'lodash';
12
12
  import Box$3 from '@mui/material/Box';
@@ -22,8 +22,8 @@ import cloneDeep from 'lodash.clonedeep';
22
22
  import proj4 from 'proj4';
23
23
  import produce from 'immer';
24
24
  import Draggable from 'react-draggable';
25
- import require$$1, { TextEncoder } from 'util';
26
- import stream, { Readable } from 'stream';
25
+ import require$$1 from 'util';
26
+ import stream from 'stream';
27
27
  import require$$1$1 from 'path';
28
28
  import require$$3 from 'http';
29
29
  import require$$4 from 'https';
@@ -171,7 +171,10 @@ function _regeneratorRuntime() {
171
171
  if ("executing" === state) throw new Error("Generator is already running");
172
172
  if ("completed" === state) {
173
173
  if ("throw" === method) throw arg;
174
- return doneResult();
174
+ return {
175
+ value: void 0,
176
+ done: !0
177
+ };
175
178
  }
176
179
  for (context.method = method, context.arg = arg;;) {
177
180
  var delegate = context.delegate;
@@ -224,7 +227,7 @@ function _regeneratorRuntime() {
224
227
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
225
228
  }
226
229
  function values(iterable) {
227
- if (iterable) {
230
+ if (iterable || "" === iterable) {
228
231
  var iteratorMethod = iterable[iteratorSymbol];
229
232
  if (iteratorMethod) return iteratorMethod.call(iterable);
230
233
  if ("function" == typeof iterable.next) return iterable;
@@ -237,15 +240,7 @@ function _regeneratorRuntime() {
237
240
  return next.next = next;
238
241
  }
239
242
  }
240
- return {
241
- next: doneResult
242
- };
243
- }
244
- function doneResult() {
245
- return {
246
- value: undefined,
247
- done: !0
248
- };
243
+ throw new TypeError(typeof iterable + " is not iterable");
249
244
  }
250
245
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
251
246
  value: GeneratorFunctionPrototype,
@@ -4065,7 +4060,7 @@ var DimensionSelect = function DimensionSelect(_ref) {
4065
4060
  return null;
4066
4061
  }
4067
4062
  var getValuesToDisplay = function getValuesToDisplay() {
4068
- var activeWMJSDim = mapStoreUtils.getWMJSDimensionForLayerAndDimension(layerId, activeDimName) || mapStoreUtils.getWMJSDimensionForLayerAndDimension(layerId, layerDimensions[0].name);
4063
+ var activeWMJSDim = webmapUtils.getWMJSDimensionForLayerAndDimension(layerId, activeDimName) || webmapUtils.getWMJSDimensionForLayerAndDimension(layerId, layerDimensions[0].name);
4069
4064
  if (!activeWMJSDim) {
4070
4065
  return null;
4071
4066
  }
@@ -5041,7 +5036,7 @@ var LayerRow = function LayerRow(_ref) {
5041
5036
  className: columnClasses.column5
5042
5037
  }, layerDimensionLayout || /*#__PURE__*/React__default.createElement(DimensionSelect, {
5043
5038
  layerId: layerId,
5044
- layerDimensions: mapStoreUtils.filterNonTimeDimensions(layer.dimensions),
5039
+ layerDimensions: layerUtils.filterNonTimeDimensions(layer.dimensions),
5045
5040
  onLayerChangeDimension: function onLayerChangeDimension(dimensionName, dimensionValue) {
5046
5041
  var dimension = {
5047
5042
  name: dimensionName,
@@ -5583,7 +5578,7 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
5583
5578
  mapId: mapId,
5584
5579
  onLayerDuplicate: function onLayerDuplicate() {
5585
5580
  addLayer({
5586
- layerId: mapStoreUtils.generateLayerId(),
5581
+ layerId: webmapUtils.generateLayerId(),
5587
5582
  mapId: mapId,
5588
5583
  layer: layer
5589
5584
  });
@@ -10989,7 +10984,7 @@ var constructLayerId = function constructLayerId(baseLayer, selectedBaseLayers)
10989
10984
  var foundLayer = selectedBaseLayers.find(function (selectedBaseLayer) {
10990
10985
  return baseLayer.id === selectedBaseLayer.id || baseLayer.name === selectedBaseLayer.name;
10991
10986
  });
10992
- return foundLayer ? foundLayer.id : mapStoreUtils.generateLayerId();
10987
+ return foundLayer ? foundLayer.id : webmapUtils.generateLayerId();
10993
10988
  };
10994
10989
  var constructListAvailableBaseLayers = function constructListAvailableBaseLayers(selectedBaseLayers, preloadedAvailableBaseLayers, mapId) {
10995
10990
  // Ensure we use unique id's for the base layers - excepting the ones that are currently selected, reuse the existing ids
@@ -11318,7 +11313,7 @@ var ConnectedTree = function ConnectedTree(_ref) {
11318
11313
  var newWms = {
11319
11314
  service: serviceURL,
11320
11315
  name: layerName,
11321
- id: mapStoreUtils.generateLayerId(),
11316
+ id: webmapUtils.generateLayerId(),
11322
11317
  layerType: layerTypes.LayerType.mapLayer
11323
11318
  };
11324
11319
  addLayer({
@@ -11332,7 +11327,7 @@ var ConnectedTree = function ConnectedTree(_ref) {
11332
11327
  var newBaseLayer = {
11333
11328
  service: serviceURL,
11334
11329
  name: layerName,
11335
- id: mapStoreUtils.generateLayerId(),
11330
+ id: webmapUtils.generateLayerId(),
11336
11331
  layerType: layerTypes.LayerType.baseLayer,
11337
11332
  mapId: mapId
11338
11333
  };
@@ -14222,7 +14217,7 @@ var LayerListConnect = function LayerListConnect(_ref) {
14222
14217
  var layer = {
14223
14218
  service: serviceUrl,
14224
14219
  name: layerName,
14225
- id: mapStoreUtils.generateLayerId(),
14220
+ id: webmapUtils.generateLayerId(),
14226
14221
  layerType: LayerType.mapLayer
14227
14222
  };
14228
14223
  addMapLayer({
@@ -16049,7 +16044,7 @@ var ZoomControlConnect = function ZoomControlConnect(_ref) {
16049
16044
  });
16050
16045
  var adagucRef = React.useRef(null);
16051
16046
  React.useEffect(function () {
16052
- adagucRef.current = mapStoreUtils.getWMJSMapById(mapId);
16047
+ adagucRef.current = webmapUtils.getWMJSMapById(mapId);
16053
16048
  }, [mapId]);
16054
16049
  var onZoomIn = function onZoomIn() {
16055
16050
  return adagucRef.current.zoomIn(undefined);
@@ -16400,7 +16395,7 @@ var DimensionSelectSliderConnect = function DimensionSelectSliderConnect(_ref) {
16400
16395
  var layerDimension = useSelector(function (store) {
16401
16396
  return layerSelectors.getLayerDimension(store, layerId, dimensionName);
16402
16397
  });
16403
- var wmLayer = mapStoreUtils.getWMLayerById(layerId);
16398
+ var wmLayer = webmapUtils.getWMLayerById(layerId);
16404
16399
  if (!layerDimension || !wmLayer) {
16405
16400
  return null;
16406
16401
  }
@@ -16842,7 +16837,7 @@ var getDataLimitsFromLayers = function getDataLimitsFromLayers(layers) {
16842
16837
  var _ref2 = _slicedToArray(_ref, 2),
16843
16838
  start = _ref2[0],
16844
16839
  end = _ref2[1];
16845
- var dimension = mapStoreUtils.getWMJSTimeDimensionForLayerId(layer.id);
16840
+ var dimension = webmapUtils.getWMJSTimeDimensionForLayerId(layer.id);
16846
16841
  if (dimension) {
16847
16842
  var lastValue = moment(dimension.getLastValue()).unix();
16848
16843
  var firstValue = moment(dimension.getFirstValue()).unix();
@@ -18950,10 +18945,10 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
18950
18945
  var stoppedDragging = !leftMarkerDragging && !rightMarkerDragging && !animationAreaDragging;
18951
18946
  if (stoppedDragging) {
18952
18947
  if (localAnimationStartTime && localAnimationStartTime !== convertStringTimeToUnix(animationStartTime)) {
18953
- onSetAnimationStartTime(moment.utc(localAnimationStartTime * 1000).format(mapStoreUtils.dateFormat));
18948
+ onSetAnimationStartTime(moment.utc(localAnimationStartTime * 1000).format(mapUtils.dateFormat));
18954
18949
  }
18955
18950
  if (localAnimationEndTime && localAnimationEndTime !== convertStringTimeToUnix(animationEndTime)) {
18956
- onSetAnimationEndTime(moment.utc(localAnimationEndTime * 1000).format(mapStoreUtils.dateFormat));
18951
+ onSetAnimationEndTime(moment.utc(localAnimationEndTime * 1000).format(mapUtils.dateFormat));
18957
18952
  }
18958
18953
  }
18959
18954
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -20935,7 +20930,7 @@ var ReactMapViewLayer = function ReactMapViewLayer(props) {
20935
20930
  * */
20936
20931
  var setLayerInfo = function setLayerInfo(wmLayer, mapId, onUpdateLayerInformation) {
20937
20932
  var origin = layerTypes.LayerActionOrigin.ReactMapViewParseLayer;
20938
- var map = mapStoreUtils.getWMJSMapById(mapId);
20933
+ var map = webmapUtils.getWMJSMapById(mapId);
20939
20934
  /* Update list of layers for service */
20940
20935
  var updateObject = {
20941
20936
  origin: origin,
@@ -21186,7 +21181,7 @@ var getWMJSLayerFromReactLayer = function getWMJSLayerFromReactLayer(mapId, wmLa
21186
21181
  var _reactWebMapJSLayer$p = reactWebMapJSLayer.props,
21187
21182
  reactLayerId = _reactWebMapJSLayer$p.id,
21188
21183
  layerName = _reactWebMapJSLayer$p.name;
21189
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
21184
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21190
21185
  /* Some safety checks */
21191
21186
  if (!wmjsMap || !wmLayers || !reactLayerId || !layerName) {
21192
21187
  return {
@@ -27496,6 +27491,485 @@ function useMapDrawContext() {
27496
27491
  return React.useContext(MapDrawToolContext);
27497
27492
  }
27498
27493
 
27494
+ /* *
27495
+ * Licensed under the Apache License, Version 2.0 (the "License");
27496
+ * you may not use this file except in compliance with the License.
27497
+ * You may obtain a copy of the License at
27498
+ *
27499
+ * http://www.apache.org/licenses/LICENSE-2.0
27500
+ *
27501
+ * Unless required by applicable law or agreed to in writing, software
27502
+ * distributed under the License is distributed on an "AS IS" BASIS,
27503
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27504
+ * See the License for the specific language governing permissions and
27505
+ * limitations under the License.
27506
+ *
27507
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27508
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27509
+ * */
27510
+ var DrawingToolMapButtonConnect = function DrawingToolMapButtonConnect(_ref) {
27511
+ var mapId = _ref.mapId,
27512
+ _ref$source = _ref.source,
27513
+ source = _ref$source === void 0 ? 'app' : _ref$source;
27514
+ var dispatch = useDispatch();
27515
+ var _useMapDrawContext = useMapDrawContext(),
27516
+ deactivateTool = _useMapDrawContext.deactivateTool;
27517
+ // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
27518
+ var dialogType = "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
27519
+ // const dialogType = isMultiMap
27520
+ // ? `${uiTypes.DialogTypes.DrawingTool}-${mapId}`
27521
+ // : uiTypes.DialogTypes.DrawingTool;
27522
+ var currentActiveMapId = useSelector(function (store) {
27523
+ return uiSelectors.getDialogMapId(store, dialogType);
27524
+ });
27525
+ var isOpenInStore = useSelector(function (store) {
27526
+ return uiSelectors.getisDialogOpen(store, dialogType);
27527
+ });
27528
+ var openDrawingToolDialog = React.useCallback(function () {
27529
+ var shouldOpen = currentActiveMapId !== mapId ? true : !isOpenInStore;
27530
+ if (!shouldOpen) {
27531
+ deactivateTool();
27532
+ }
27533
+ dispatch(uiActions.setActiveMapIdForDialog({
27534
+ type: dialogType,
27535
+ mapId: mapId,
27536
+ setOpen: shouldOpen,
27537
+ source: source
27538
+ }));
27539
+ }, [currentActiveMapId, dialogType, dispatch, isOpenInStore, mapId, source, deactivateTool]);
27540
+ var isOpen = currentActiveMapId === mapId && isOpenInStore;
27541
+ return /*#__PURE__*/React.createElement(MapControlButton, {
27542
+ title: "Drawing Toolbox",
27543
+ "data-testid": "drawingToolButton",
27544
+ onClick: openDrawingToolDialog,
27545
+ isActive: isOpen
27546
+ }, /*#__PURE__*/React.createElement(DrawPolygon, null));
27547
+ };
27548
+
27549
+ var opacityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
27550
+ var SAVE_AREA_BUTTON = 'Save area';
27551
+ var DRAW_EXIT_MODE_MESSAGE = 'press ESC to exit draw mode';
27552
+ var DrawingToolForm = function DrawingToolForm(_ref) {
27553
+ var onSubmitForm = _ref.onSubmitForm;
27554
+ var _useFormContext = useFormContext(),
27555
+ handleSubmit = _useFormContext.handleSubmit;
27556
+ var _useMapDrawContext = useMapDrawContext(),
27557
+ editModes = _useMapDrawContext.editModes,
27558
+ changeActiveTool = _useMapDrawContext.changeActiveTool,
27559
+ activeTool = _useMapDrawContext.activeTool,
27560
+ deactivateTool = _useMapDrawContext.deactivateTool,
27561
+ geoJSON = _useMapDrawContext.geoJSON,
27562
+ getProperties = _useMapDrawContext.getProperties,
27563
+ changeProperties = _useMapDrawContext.changeProperties,
27564
+ isInEditMode = _useMapDrawContext.isInEditMode;
27565
+ var onSubmit = function onSubmit() {
27566
+ deactivateTool();
27567
+ handleSubmit(function (formValues) {
27568
+ // remove unneeded properties
27569
+ formValues.opacity;
27570
+ var allFormValues = __rest$1(formValues, ["opacity"]);
27571
+ onSubmitForm(Object.assign(Object.assign({}, allFormValues), {
27572
+ geoJSON: geoJSON
27573
+ }));
27574
+ })();
27575
+ };
27576
+ var getInitialGeoJSONPropertyValue = function getInitialGeoJSONPropertyValue(property) {
27577
+ if (getProperties()[property]) {
27578
+ return getProperties()[property];
27579
+ }
27580
+ return defaultStyleProperties[property];
27581
+ };
27582
+ var _React$useState = React.useState(getInitialGeoJSONPropertyValue('fill-opacity') * 100),
27583
+ _React$useState2 = _slicedToArray(_React$useState, 2),
27584
+ opacity = _React$useState2[0],
27585
+ setOpacity = _React$useState2[1];
27586
+ var onChangeOpacity = function onChangeOpacity(event) {
27587
+ var value = event.target.value;
27588
+ var parseValue = parseInt(value, 10);
27589
+ setOpacity(parseValue);
27590
+ var newOpacity = parseValue / 100;
27591
+ var additionalStrokeOpacity = 0.8;
27592
+ changeProperties({
27593
+ 'fill-opacity': newOpacity,
27594
+ 'stroke-opacity': clamp$1(newOpacity + additionalStrokeOpacity, 0.01, 1)
27595
+ });
27596
+ };
27597
+ var onKeyDown = function onKeyDown(event) {
27598
+ if (event.key === 'Escape') {
27599
+ deactivateTool();
27600
+ }
27601
+ };
27602
+ return /*#__PURE__*/React.createElement(Box$2, {
27603
+ "data-testid": "drawingToolForm",
27604
+ sx: {
27605
+ padding: '16px',
27606
+ height: '100%'
27607
+ }
27608
+ }, /*#__PURE__*/React.createElement(Grid, {
27609
+ container: true,
27610
+ direction: "column",
27611
+ justifyContent: "space-between",
27612
+ sx: {
27613
+ height: '100%'
27614
+ }
27615
+ }, /*#__PURE__*/React.createElement(Grid, {
27616
+ item: true,
27617
+ container: true,
27618
+ direction: "column",
27619
+ spacing: 1
27620
+ }, /*#__PURE__*/React.createElement(Grid, {
27621
+ item: true
27622
+ }, /*#__PURE__*/React.createElement(Typography, {
27623
+ variant: "body2"
27624
+ }, "Tools")), /*#__PURE__*/React.createElement(Grid, {
27625
+ item: true,
27626
+ container: true
27627
+ }, /*#__PURE__*/React.createElement(Grid, {
27628
+ item: true
27629
+ }, editModes.map(function (mode) {
27630
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
27631
+ key: mode.id,
27632
+ variant: "tool",
27633
+ tooltipTitle: mode.title,
27634
+ isSelected: mode.isSelectable && activeTool === mode.id,
27635
+ onClick: function onClick() {
27636
+ return changeActiveTool(mode);
27637
+ },
27638
+ sx: {
27639
+ marginRight: 1,
27640
+ marginBottom: 1
27641
+ },
27642
+ "data-testid": mode.id,
27643
+ onKeyDown: onKeyDown
27644
+ }, mode.icon);
27645
+ }), isInEditMode && /*#__PURE__*/React.createElement(Typography, {
27646
+ component: "span",
27647
+ sx: {
27648
+ display: 'inline-block',
27649
+ marginLeft: 2,
27650
+ top: -1,
27651
+ position: 'relative',
27652
+ fontSize: 14
27653
+ }
27654
+ }, DRAW_EXIT_MODE_MESSAGE))), /*#__PURE__*/React.createElement(Grid, {
27655
+ item: true,
27656
+ container: true
27657
+ }, /*#__PURE__*/React.createElement(Grid, {
27658
+ item: true,
27659
+ xs: 12,
27660
+ sm: 6
27661
+ }, /*#__PURE__*/React.createElement(ReactHookFormSelect, {
27662
+ name: "opacity",
27663
+ label: "Opacity",
27664
+ rules: {},
27665
+ disabled: false,
27666
+ isReadOnly: false,
27667
+ "data-testid": "drawingToolForm-opacity",
27668
+ onChange: onChangeOpacity,
27669
+ autoFocus: true,
27670
+ value: opacity
27671
+ }, opacityOptions.map(function (opacity) {
27672
+ return /*#__PURE__*/React.createElement(MenuItem, {
27673
+ value: opacity,
27674
+ key: opacity
27675
+ }, opacity, " %");
27676
+ })))), /*#__PURE__*/React.createElement(Grid, {
27677
+ item: true
27678
+ }, /*#__PURE__*/React.createElement(ReactHookFormTextField, {
27679
+ name: "areaName",
27680
+ label: "Area name",
27681
+ rules: {
27682
+ required: true
27683
+ },
27684
+ disabled: false,
27685
+ isReadOnly: false
27686
+ }))), /*#__PURE__*/React.createElement(Grid, {
27687
+ item: true
27688
+ }, /*#__PURE__*/React.createElement(Button, {
27689
+ variant: "primary",
27690
+ onClick: onSubmit,
27691
+ sx: {
27692
+ width: '100%'
27693
+ },
27694
+ "data-testid": "saveDrawingFormButton"
27695
+ }, SAVE_AREA_BUTTON))));
27696
+ };
27697
+ var Wrapper = function Wrapper(props) {
27698
+ return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
27699
+ options: Object.assign(Object.assign({}, defaultFormOptions), {
27700
+ defaultValues: {
27701
+ areaName: 'Area 51'
27702
+ }
27703
+ })
27704
+ }, /*#__PURE__*/React.createElement(DrawingToolForm, Object.assign({}, props)));
27705
+ };
27706
+
27707
+ /* *
27708
+ * Licensed under the Apache License, Version 2.0 (the "License");
27709
+ * you may not use this file except in compliance with the License.
27710
+ * You may obtain a copy of the License at
27711
+ *
27712
+ * http://www.apache.org/licenses/LICENSE-2.0
27713
+ *
27714
+ * Unless required by applicable law or agreed to in writing, software
27715
+ * distributed under the License is distributed on an "AS IS" BASIS,
27716
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27717
+ * See the License for the specific language governing permissions and
27718
+ * limitations under the License.
27719
+ *
27720
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27721
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27722
+ * */
27723
+ var DrawingToolFormConnect = function DrawingToolFormConnect() {
27724
+ var onSubmitForm = function onSubmitForm(formValues) {
27725
+ // eslint-disable-next-line no-console
27726
+ console.log('You have submitted the form. Nothing will happen now.', formValues);
27727
+ };
27728
+ return /*#__PURE__*/React.createElement(Wrapper, {
27729
+ onSubmitForm: onSubmitForm
27730
+ });
27731
+ };
27732
+
27733
+ var calculateStartSize = function calculateStartSize(minSize, prefSize, startPosition) {
27734
+ var _calculateDialogSizeA = calculateDialogSizeAndPosition(),
27735
+ calcWidth = _calculateDialogSizeA.width,
27736
+ calcHeight = _calculateDialogSizeA.height;
27737
+ return {
27738
+ width: Math.max(minSize.width, Math.min(prefSize.width, calcWidth)),
27739
+ height: Math.max(minSize.height, Math.min(prefSize.height, calcHeight - startPosition.top))
27740
+ };
27741
+ };
27742
+ var DERFAULT_DRAW_TOOL_SIZE = {
27743
+ width: 320,
27744
+ height: 542
27745
+ };
27746
+ var DEFAULT_DRAW_TOOL_POSITION = {
27747
+ top: 120,
27748
+ left: 50
27749
+ };
27750
+ var DEFAULT_DRAW_TOOL_MIN_SIZE = {
27751
+ width: 160,
27752
+ height: 300
27753
+ };
27754
+ var DrawingTool = function DrawingTool(_ref) {
27755
+ var bounds = _ref.bounds,
27756
+ onClose = _ref.onClose,
27757
+ _ref$title = _ref.title,
27758
+ title = _ref$title === void 0 ? 'Drawing Toolbox' : _ref$title,
27759
+ isOpen = _ref.isOpen,
27760
+ _ref$onMouseDown = _ref.onMouseDown,
27761
+ onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
27762
+ _ref$order = _ref.order,
27763
+ order = _ref$order === void 0 ? 0 : _ref$order,
27764
+ _ref$source = _ref.source,
27765
+ source = _ref$source === void 0 ? 'app' : _ref$source,
27766
+ _ref$isLoading = _ref.isLoading,
27767
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
27768
+ error = _ref.error,
27769
+ _ref$isDocked = _ref.isDocked,
27770
+ isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
27771
+ _ref$size = _ref.size,
27772
+ size = _ref$size === void 0 ? DERFAULT_DRAW_TOOL_SIZE : _ref$size,
27773
+ _ref$startPosition = _ref.startPosition,
27774
+ startPosition = _ref$startPosition === void 0 ? DEFAULT_DRAW_TOOL_POSITION : _ref$startPosition,
27775
+ _ref$setFocused = _ref.setFocused,
27776
+ setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused,
27777
+ _ref$headerSize = _ref.headerSize,
27778
+ headerSize = _ref$headerSize === void 0 ? 'xs' : _ref$headerSize;
27779
+ var minSize = DEFAULT_DRAW_TOOL_MIN_SIZE;
27780
+ var startSizeCalc = calculateStartSize(minSize, size, startPosition);
27781
+ var _React$useState = React.useState(startSizeCalc),
27782
+ _React$useState2 = _slicedToArray(_React$useState, 2),
27783
+ sizeInState = _React$useState2[0],
27784
+ setSizeInState = _React$useState2[1];
27785
+ React.useEffect(function () {
27786
+ if (size !== sizeInState && isDocked && isOpen) {
27787
+ setSizeInState(size);
27788
+ }
27789
+ // eslint-disable-next-line react-hooks/exhaustive-deps
27790
+ }, [size, isOpen]);
27791
+ return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
27792
+ title: title,
27793
+ startSize: sizeInState,
27794
+ minWidth: minSize.width,
27795
+ minHeight: minSize.height,
27796
+ startPosition: startPosition,
27797
+ isOpen: isOpen,
27798
+ onClose: onClose,
27799
+ headerSize: headerSize,
27800
+ bounds: bounds,
27801
+ "data-testid": "drawingToolWindow",
27802
+ onMouseDown: onMouseDown,
27803
+ onFocus: function onFocus() {
27804
+ return setFocused(true);
27805
+ },
27806
+ onBlur: function onBlur() {
27807
+ return setFocused(false);
27808
+ },
27809
+ order: order,
27810
+ source: source,
27811
+ // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
27812
+ // rightHeaderComponent={
27813
+ // <CustomIconButton
27814
+ // tooltipTitle={isDocked ? 'Undock' : 'Dock'}
27815
+ // data-testid="dockedBtn"
27816
+ // disableRipple
27817
+ // onClick={(): void => onToggleDock()}
27818
+ // >
27819
+ // {isDocked ? (
27820
+ // <CollapseWindow data-testid="dockedDrawingTool-collapse" />
27821
+ // ) : (
27822
+ // <ExpandWindow data-testid="dockedDrawingTool-uncollapse" />
27823
+ // )}
27824
+ // </CustomIconButton>
27825
+ // }
27826
+ onResizeStop: function onResizeStop(_event, _direction, node) {
27827
+ var width = node.offsetWidth,
27828
+ height = node.offsetHeight;
27829
+ setSizeInState({
27830
+ width: width,
27831
+ height: height
27832
+ });
27833
+ },
27834
+ onDragEnd: function onDragEnd(_position, dragSize) {
27835
+ if (dragSize !== sizeInState) {
27836
+ setSizeInState(dragSize);
27837
+ }
27838
+ }
27839
+ }, /*#__PURE__*/React.createElement(Box$2, {
27840
+ onKeyDown: function onKeyDown(event) {
27841
+ event.stopPropagation();
27842
+ },
27843
+ sx: {
27844
+ height: '100%'
27845
+ }
27846
+ }, isLoading && /*#__PURE__*/React.createElement(LinearProgress, {
27847
+ "data-testid": "loading-bar-drawingTool",
27848
+ color: "secondary",
27849
+ sx: {
27850
+ position: 'absolute',
27851
+ width: '100%'
27852
+ }
27853
+ }), error && /*#__PURE__*/React.createElement(Box$2, {
27854
+ sx: {
27855
+ padding: '0 6px'
27856
+ }
27857
+ }, /*#__PURE__*/React.createElement(AlertBanner, {
27858
+ title: error,
27859
+ shouldClose: true
27860
+ })), /*#__PURE__*/React.createElement(DrawingToolFormConnect, null)));
27861
+ };
27862
+
27863
+ /* *
27864
+ * Licensed under the Apache License, Version 2.0 (the "License");
27865
+ * you may not use this file except in compliance with the License.
27866
+ * You may obtain a copy of the License at
27867
+ *
27868
+ * http://www.apache.org/licenses/LICENSE-2.0
27869
+ *
27870
+ * Unless required by applicable law or agreed to in writing, software
27871
+ * distributed under the License is distributed on an "AS IS" BASIS,
27872
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27873
+ * See the License for the specific language governing permissions and
27874
+ * limitations under the License.
27875
+ *
27876
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27877
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27878
+ * */
27879
+ var getDialogType = function getDialogType(mapId, isMultiMap, isDocked) {
27880
+ if (isDocked) {
27881
+ return "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
27882
+ }
27883
+ if (isMultiMap) {
27884
+ return "".concat(uiTypes.DialogTypes.DrawingTool, "-").concat(mapId);
27885
+ }
27886
+ return uiTypes.DialogTypes.DrawingTool;
27887
+ };
27888
+ var DrawingToolConnect = function DrawingToolConnect(_ref) {
27889
+ var bounds = _ref.bounds,
27890
+ _ref$title = _ref.title,
27891
+ title = _ref$title === void 0 ? 'Drawing Toolbox' : _ref$title,
27892
+ _ref$showMapIdInTitle = _ref.showMapIdInTitle,
27893
+ showMapIdInTitle = _ref$showMapIdInTitle === void 0 ? false : _ref$showMapIdInTitle,
27894
+ _ref$mapId = _ref.mapId,
27895
+ initialMapId = _ref$mapId === void 0 ? null : _ref$mapId,
27896
+ _ref$isMultiMap = _ref.isMultiMap,
27897
+ isMultiMap = _ref$isMultiMap === void 0 ? false : _ref$isMultiMap,
27898
+ _ref$isDocked = _ref.isDocked,
27899
+ isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
27900
+ _ref$source = _ref.source,
27901
+ source = _ref$source === void 0 ? 'app' : _ref$source;
27902
+ // const dispatch = useDispatch();
27903
+ var dialogType = getDialogType(initialMapId, isMultiMap, isDocked);
27904
+ var _useMapDrawContext = useMapDrawContext(),
27905
+ deactivateTool = _useMapDrawContext.deactivateTool;
27906
+ var activeMapId = useSelector(function (store) {
27907
+ return uiSelectors.getDialogMapId(store, dialogType);
27908
+ });
27909
+ // In case of a docked drawing toolbox or multimap, use the map id that is passed
27910
+ // For floating drawingtoolbox, use the currently active, selected mapid
27911
+ var mapId = initialMapId || activeMapId;
27912
+ var _useSetupDialog = useSetupDialog(dialogType, source),
27913
+ dialogOrder = _useSetupDialog.dialogOrder,
27914
+ setDialogOrder = _useSetupDialog.setDialogOrder,
27915
+ onCloseDialog = _useSetupDialog.onCloseDialog,
27916
+ isDialogOpen = _useSetupDialog.isDialogOpen,
27917
+ uiSource = _useSetupDialog.uiSource,
27918
+ uiIsLoading = _useSetupDialog.uiIsLoading,
27919
+ uiError = _useSetupDialog.uiError,
27920
+ setFocused = _useSetupDialog.setFocused;
27921
+ // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
27922
+ // const onToggleDock = (): void => {
27923
+ // onCloseDialog();
27924
+ // if (isDocked) {
27925
+ // // Close docked drawingtool and open the floating drawingtool
27926
+ // dispatch(
27927
+ // uiActions.setActiveMapIdForDialog({
27928
+ // type: uiTypes.DialogTypes.DrawingTool,
27929
+ // mapId,
27930
+ // setOpen: true,
27931
+ // source,
27932
+ // }),
27933
+ // );
27934
+ // } else {
27935
+ // // Close the floating drawingtool and open docked drawingtool
27936
+ // dispatch(
27937
+ // uiActions.setToggleOpenDialog({
27938
+ // type: `${uiTypes.DialogTypes.DockedDrawingTool}-${mapId}`,
27939
+ // setOpen: true,
27940
+ // }),
27941
+ // );
27942
+ // }
27943
+ // };
27944
+ var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
27945
+ var onClose = function onClose() {
27946
+ onCloseDialog();
27947
+ deactivateTool();
27948
+ };
27949
+ if (!isDialogOpen) {
27950
+ return null;
27951
+ }
27952
+ return /*#__PURE__*/React.createElement(DrawingTool, {
27953
+ bounds: bounds,
27954
+ isOpen: isDialogOpen,
27955
+ onClose: onClose,
27956
+ title: shownTitle,
27957
+ onMouseDown: setDialogOrder,
27958
+ order: dialogOrder,
27959
+ source: uiSource,
27960
+ isLoading: uiIsLoading,
27961
+ error: uiError,
27962
+ // onToggleDock={onToggleDock}
27963
+ setFocused: setFocused,
27964
+ headerSize: "xs",
27965
+ isDocked: isDocked,
27966
+ startPosition: {
27967
+ top: 134,
27968
+ left: 50
27969
+ }
27970
+ });
27971
+ };
27972
+
27499
27973
  var getDisplayText = function getDisplayText(currentAdagucTime) {
27500
27974
  var timeFormat = 'ddd DD MMM YYYY HH:mm [UTC]';
27501
27975
  var adagucTime = moment.utc(currentAdagucTime);
@@ -27533,7 +28007,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
27533
28007
  var fetchSpeed = 60000; // 1 minute
27534
28008
  _this.refetchTimer = setInterval(function () {
27535
28009
  var mapId = _this.props.mapId;
27536
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28010
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
27537
28011
  var layers = wmjsMap.getLayers();
27538
28012
  layers.forEach(function (layer) {
27539
28013
  if (layer.enabled !== false) {
@@ -27558,7 +28032,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
27558
28032
  /* Provide a hint on what is going wrong */
27559
28033
  console.error(e);
27560
28034
  }
27561
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28035
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
27562
28036
  if (child) {
27563
28037
  if (wmLayer.hasError) {
27564
28038
  if (child.props.onLayerError) {
@@ -27615,7 +28089,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
27615
28089
  var mapId = this.props.mapId;
27616
28090
  window.removeEventListener('resize', this.handleWindowResize);
27617
28091
  this.clearRefetchTimer();
27618
- mapStoreUtils.unRegisterWMJSMap(mapId);
28092
+ webmapUtils.unRegisterWMJSMap(mapId);
27619
28093
  /* Reset adaguc properties */
27620
28094
  this.adaguc.initialized = false;
27621
28095
  this.adaguc.currentHeight = -1;
@@ -27635,7 +28109,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
27635
28109
  var _this$props3 = this.props,
27636
28110
  mapId = _this$props3.mapId,
27637
28111
  onMapChangeDimension = _this$props3.onMapChangeDimension;
27638
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28112
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
27639
28113
  if (wmjsMap) {
27640
28114
  var timeDimension = wmjsMap.getDimension('time');
27641
28115
  if (timeDimension) {
@@ -27660,7 +28134,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
27660
28134
  MapViewBBOX = _this2$props.bbox,
27661
28135
  mapId = _this2$props.mapId,
27662
28136
  onMapZoomEnd = _this2$props.onMapZoomEnd;
27663
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28137
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
27664
28138
  if (!wmjsMap) {
27665
28139
  return;
27666
28140
  }
@@ -27702,7 +28176,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
27702
28176
  }
27703
28177
  var mapId = props.mapId,
27704
28178
  children = props.children;
27705
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28179
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
27706
28180
  if (!wmjsMap) {
27707
28181
  console.warn('No wmjsMap');
27708
28182
  return;
@@ -27898,7 +28372,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
27898
28372
  var newWMLayer = new WMLayer(Object.assign(Object.assign({}, child.props), {
27899
28373
  keepOnTop: keepOnTop
27900
28374
  }));
27901
- mapStoreUtils.registerWMLayer(newWMLayer, child.props.id);
28375
+ webmapUtils.registerWMLayer(newWMLayer, child.props.id);
27902
28376
  newWMLayer.ReactWMJSLayerId = child.props.id;
27903
28377
  if (isBaselayer) {
27904
28378
  /* Add ADAGUC WebMapJS Baselayer */
@@ -27982,7 +28456,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
27982
28456
  key: "drawDebounced",
27983
28457
  value: function drawDebounced() {
27984
28458
  var mapId = this.props.mapId;
27985
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28459
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
27986
28460
  wmjsMap.getListener().suspendEvents();
27987
28461
  wmjsMap.draw();
27988
28462
  wmjsMap.getListener().resumeEvents();
@@ -28003,16 +28477,16 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
28003
28477
  return null;
28004
28478
  }
28005
28479
  /* Check if webmapjs was not already initialized */
28006
- var existingWMJSMap = mapStoreUtils.getWMJSMapById(mapId);
28480
+ var existingWMJSMap = webmapUtils.getWMJSMapById(mapId);
28007
28481
  if (existingWMJSMap) {
28008
- console.warn("Somehow ".concat(mapId, "mapStoreUtils.unRegisterWMJSMap already exists"));
28009
- mapStoreUtils.unRegisterWMJSMap(mapId);
28482
+ console.warn("Somehow ".concat(mapId, "webmapUtils.unRegisterWMJSMap already exists"));
28483
+ webmapUtils.unRegisterWMJSMap(mapId);
28010
28484
  }
28011
28485
  var wmjsMap = new WMJSMap(this.adagucWebMapJSRef.current);
28012
28486
  this.adaguc.currentMapProps = {};
28013
28487
  this.adaguc.currentMapProps.children = null;
28014
28488
  this.adaguc.baseLayers = [];
28015
- mapStoreUtils.registerWMJSMap(wmjsMap, mapId);
28489
+ webmapUtils.registerWMJSMap(wmjsMap, mapId);
28016
28490
  this.adaguc.initialized = true;
28017
28491
  /* Enable to show actual layer properties in the map */
28018
28492
  wmjsMap.showLayerInfo = false;
@@ -28074,7 +28548,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
28074
28548
  this.adaguc.currentWidth = newWidth;
28075
28549
  this.adaguc.currentHeight = newHeight;
28076
28550
  var mapId = this.props.mapId;
28077
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28551
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
28078
28552
  wmjsMap.setSize(newWidth, newHeight);
28079
28553
  }
28080
28554
  }
@@ -28089,7 +28563,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
28089
28563
  mapId = _this$props5.mapId;
28090
28564
  var adagucInitialised = this.state.adagucInitialised;
28091
28565
  var featureLayers = getFeatureLayers(children);
28092
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28566
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
28093
28567
  return /*#__PURE__*/React.createElement("div", {
28094
28568
  className: "MapView",
28095
28569
  style: {
@@ -28286,15 +28760,15 @@ var MapView = function MapView(_a) {
28286
28760
  }
28287
28761
  }, /*#__PURE__*/React.createElement(ZoomControls, {
28288
28762
  onZoomIn: function onZoomIn() {
28289
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28763
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
28290
28764
  wmjsMap.zoomIn(undefined);
28291
28765
  },
28292
28766
  onZoomOut: function onZoomOut() {
28293
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28767
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
28294
28768
  wmjsMap.zoomOut();
28295
28769
  },
28296
28770
  onZoomReset: function onZoomReset() {
28297
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
28771
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
28298
28772
  wmjsMap.zoomToLayer(wmjsMap.getActiveLayer());
28299
28773
  }
28300
28774
  })), /*#__PURE__*/React.createElement(Box$2, {
@@ -28306,7 +28780,7 @@ var MapView = function MapView(_a) {
28306
28780
  showLegend: false,
28307
28781
  displayTimeInMap: false,
28308
28782
  onWMJSMount: function onWMJSMount(id) {
28309
- wmjsMapRef.current = mapStoreUtils.getWMJSMapById(id);
28783
+ wmjsMapRef.current = webmapUtils.getWMJSMapById(id);
28310
28784
  }
28311
28785
  }), children)), displayTimeInMap && dimensions && /*#__PURE__*/React.createElement(MapTime, {
28312
28786
  dimensions: dimensions
@@ -28381,7 +28855,7 @@ var useTouchZoomPan = function useTouchZoomPan(mapIsActive, mapId) {
28381
28855
  }
28382
28856
  }, []);
28383
28857
  var handleMove = React.useCallback(function (event) {
28384
- var map = mapStoreUtils.getWMJSMapById(mapId);
28858
+ var map = webmapUtils.getWMJSMapById(mapId);
28385
28859
  var targetElem = event.target;
28386
28860
  if (!isCanvasElement(event)) {
28387
28861
  // Elements other than canvas elements are not allowed to be zoomed/panned
@@ -28478,7 +28952,7 @@ var useKeyboardZoomAndPan = function useKeyboardZoomAndPan(mapIsActive, mapId) {
28478
28952
  var keysPressedDown = {};
28479
28953
  var handleKeyPress = function handleKeyPress(event) {
28480
28954
  var target = event.target;
28481
- var map = mapStoreUtils.getWMJSMapById(mapId);
28955
+ var map = webmapUtils.getWMJSMapById(mapId);
28482
28956
  var key = event.key,
28483
28957
  type = event.type;
28484
28958
  keysPressedDown[key] = type === 'keydown';
@@ -28594,7 +29068,7 @@ var MapViewConnect = function MapViewConnect(_a) {
28594
29068
  var dispatch = useDispatch();
28595
29069
  var mapChangeDimension = React.useCallback(function (mapDimensionPayload) {
28596
29070
  if (mapDimensionPayload.dimension) {
28597
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
29071
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
28598
29072
  var dimension = wmjsMap.getDimension(mapDimensionPayload.dimension.name);
28599
29073
  if (dimension && dimension.currentValue === mapDimensionPayload.dimension.currentValue) {
28600
29074
  return;
@@ -28603,7 +29077,7 @@ var MapViewConnect = function MapViewConnect(_a) {
28603
29077
  dispatch(mapActions.mapChangeDimension(mapDimensionPayload));
28604
29078
  }, [dispatch, mapId]);
28605
29079
  var setTime = React.useCallback(function (setTimePayload) {
28606
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
29080
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
28607
29081
  /* Check if the map not already has this value set, otherwise this component will re-render */
28608
29082
  if (wmjsMap && wmjsMap.getDimension('time') && wmjsMap.getDimension('time').currentValue === setTimePayload.value) {
28609
29083
  return;
@@ -28811,7 +29285,7 @@ var Legend = function Legend(_ref) {
28811
29285
  var layerOpacity = layer.opacity ? layer.opacity : 1;
28812
29286
  /* Get the wmLayer, it has more detailed info about the WMS service,
28813
29287
  like a title and the WMS legendgraphic url */
28814
- var wmLayer = mapStoreUtils.getWMLayerById(layer.id);
29288
+ var wmLayer = webmapUtils.getWMLayerById(layer.id);
28815
29289
  return /*#__PURE__*/React__default.createElement(LegendLayout, {
28816
29290
  title: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title,
28817
29291
  name: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.name,
@@ -28826,7 +29300,7 @@ var Legend = function Legend(_ref) {
28826
29300
  Check if the wmLayer is available, this happens when the WMS GetCapabilities is loaded and parsed.
28827
29301
  Note that we cannot use the wmLayer variable above, as this one could contain a non initialized WMJSLayer.
28828
29302
  */
28829
- var legendWmLayer = mapStoreUtils.getWMLayerById(layer.id);
29303
+ var legendWmLayer = webmapUtils.getWMLayerById(layer.id);
28830
29304
  var legendUrl = getLegendGraphicURLForLayer(legendWmLayer);
28831
29305
  var image = legendImageStore.getImage(legendUrl);
28832
29306
  /* If there is no image for the given URL, we do not want to display a legend image (e.g. outside range) */
@@ -30566,16 +31040,12 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
30566
31040
  * @returns {boolean} True if value is an FormData, otherwise false
30567
31041
  */
30568
31042
  const isFormData = (thing) => {
30569
- let kind;
31043
+ const pattern = '[object FormData]';
30570
31044
  return thing && (
30571
- (typeof FormData === 'function' && thing instanceof FormData) || (
30572
- isFunction$1(thing.append) && (
30573
- (kind = kindOf(thing)) === 'formdata' ||
30574
- // detect form-data instance
30575
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
30576
- )
30577
- )
30578
- )
31045
+ (typeof FormData === 'function' && thing instanceof FormData) ||
31046
+ toString.call(thing) === pattern ||
31047
+ (isFunction$1(thing.toString) && thing.toString() === pattern)
31048
+ );
30579
31049
  };
30580
31050
 
30581
31051
  /**
@@ -30659,11 +31129,7 @@ function findKey(obj, key) {
30659
31129
  return null;
30660
31130
  }
30661
31131
 
30662
- const _global = (() => {
30663
- /*eslint no-undef:0*/
30664
- if (typeof globalThis !== "undefined") return globalThis;
30665
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
30666
- })();
31132
+ const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self;
30667
31133
 
30668
31134
  const isContextDefined = (context) => !isUndefined(context) && context !== _global;
30669
31135
 
@@ -30894,7 +31360,7 @@ const matchAll = (regExp, str) => {
30894
31360
  const isHTMLForm = kindOfTest('HTMLFormElement');
30895
31361
 
30896
31362
  const toCamelCase = str => {
30897
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
31363
+ return str.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,
30898
31364
  function replacer(m, p1, p2) {
30899
31365
  return p1.toUpperCase() + p2;
30900
31366
  }
@@ -30978,37 +31444,6 @@ const toFiniteNumber = (value, defaultValue) => {
30978
31444
  return Number.isFinite(value) ? value : defaultValue;
30979
31445
  };
30980
31446
 
30981
- const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
30982
-
30983
- const DIGIT = '0123456789';
30984
-
30985
- const ALPHABET = {
30986
- DIGIT,
30987
- ALPHA,
30988
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
30989
- };
30990
-
30991
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
30992
- let str = '';
30993
- const {length} = alphabet;
30994
- while (size--) {
30995
- str += alphabet[Math.random() * length|0];
30996
- }
30997
-
30998
- return str;
30999
- };
31000
-
31001
- /**
31002
- * If the thing is a FormData object, return true, otherwise return false.
31003
- *
31004
- * @param {unknown} thing - The thing to check.
31005
- *
31006
- * @returns {boolean}
31007
- */
31008
- function isSpecCompliantForm(thing) {
31009
- return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
31010
- }
31011
-
31012
31447
  const toJSONObject = (obj) => {
31013
31448
  const stack = new Array(10);
31014
31449
 
@@ -31040,11 +31475,6 @@ const toJSONObject = (obj) => {
31040
31475
  return visit(obj, 0);
31041
31476
  };
31042
31477
 
31043
- const isAsyncFn = kindOfTest('AsyncFunction');
31044
-
31045
- const isThenable = (thing) =>
31046
- thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
31047
-
31048
31478
  var utils = {
31049
31479
  isArray,
31050
31480
  isArrayBuffer,
@@ -31091,12 +31521,7 @@ var utils = {
31091
31521
  findKey,
31092
31522
  global: _global,
31093
31523
  isContextDefined,
31094
- ALPHABET,
31095
- generateString,
31096
- isSpecCompliantForm,
31097
- toJSONObject,
31098
- isAsyncFn,
31099
- isThenable
31524
+ toJSONObject
31100
31525
  };
31101
31526
 
31102
31527
  /**
@@ -31525,9 +31950,20 @@ var require$$0 = {
31525
31950
  "application/3gpp-ims+xml": {
31526
31951
  source: "iana",
31527
31952
  compressible: true
31953
+ },
31954
+ "application/3gpphal+json": {
31955
+ source: "iana",
31956
+ compressible: true
31957
+ },
31958
+ "application/3gpphalforms+json": {
31959
+ source: "iana",
31960
+ compressible: true
31528
31961
  },
31529
31962
  "application/a2l": {
31530
31963
  source: "iana"
31964
+ },
31965
+ "application/ace+cbor": {
31966
+ source: "iana"
31531
31967
  },
31532
31968
  "application/activemessage": {
31533
31969
  source: "iana"
@@ -31601,6 +32037,9 @@ var require$$0 = {
31601
32037
  extensions: [
31602
32038
  "aw"
31603
32039
  ]
32040
+ },
32041
+ "application/at+jwt": {
32042
+ source: "iana"
31604
32043
  },
31605
32044
  "application/atf": {
31606
32045
  source: "iana"
@@ -31786,6 +32225,10 @@ var require$$0 = {
31786
32225
  },
31787
32226
  "application/cfw": {
31788
32227
  source: "iana"
32228
+ },
32229
+ "application/city+json": {
32230
+ source: "iana",
32231
+ compressible: true
31789
32232
  },
31790
32233
  "application/clr": {
31791
32234
  source: "iana"
@@ -31830,7 +32273,10 @@ var require$$0 = {
31830
32273
  },
31831
32274
  "application/cpl+xml": {
31832
32275
  source: "iana",
31833
- compressible: true
32276
+ compressible: true,
32277
+ extensions: [
32278
+ "cpl"
32279
+ ]
31834
32280
  },
31835
32281
  "application/csrattrs": {
31836
32282
  source: "iana"
@@ -31868,6 +32314,13 @@ var require$$0 = {
31868
32314
  extensions: [
31869
32315
  "mpd"
31870
32316
  ]
32317
+ },
32318
+ "application/dash-patch+xml": {
32319
+ source: "iana",
32320
+ compressible: true,
32321
+ extensions: [
32322
+ "mpp"
32323
+ ]
31871
32324
  },
31872
32325
  "application/dashdelta": {
31873
32326
  source: "iana"
@@ -31953,8 +32406,8 @@ var require$$0 = {
31953
32406
  source: "iana",
31954
32407
  compressible: true,
31955
32408
  extensions: [
31956
- "ecma",
31957
- "es"
32409
+ "es",
32410
+ "ecma"
31958
32411
  ]
31959
32412
  },
31960
32413
  "application/edi-consent": {
@@ -32056,6 +32509,12 @@ var require$$0 = {
32056
32509
  "application/expect-ct-report+json": {
32057
32510
  source: "iana",
32058
32511
  compressible: true
32512
+ },
32513
+ "application/express": {
32514
+ source: "iana",
32515
+ extensions: [
32516
+ "exp"
32517
+ ]
32059
32518
  },
32060
32519
  "application/fastinfoset": {
32061
32520
  source: "iana"
@@ -32398,6 +32857,7 @@ var require$$0 = {
32398
32857
  ]
32399
32858
  },
32400
32859
  "application/manifest+json": {
32860
+ source: "iana",
32401
32861
  charset: "UTF-8",
32402
32862
  compressible: true,
32403
32863
  extensions: [
@@ -32492,7 +32952,10 @@ var require$$0 = {
32492
32952
  },
32493
32953
  "application/media-policy-dataset+xml": {
32494
32954
  source: "iana",
32495
- compressible: true
32955
+ compressible: true,
32956
+ extensions: [
32957
+ "mpf"
32958
+ ]
32496
32959
  },
32497
32960
  "application/media_control+xml": {
32498
32961
  source: "iana",
@@ -32538,6 +33001,9 @@ var require$$0 = {
32538
33001
  },
32539
33002
  "application/mipc": {
32540
33003
  source: "iana"
33004
+ },
33005
+ "application/missing-blocks+cbor-seq": {
33006
+ source: "iana"
32541
33007
  },
32542
33008
  "application/mmt-aei+xml": {
32543
33009
  source: "iana",
@@ -32597,17 +33063,11 @@ var require$$0 = {
32597
33063
  },
32598
33064
  "application/mrb-consumer+xml": {
32599
33065
  source: "iana",
32600
- compressible: true,
32601
- extensions: [
32602
- "xdf"
32603
- ]
33066
+ compressible: true
32604
33067
  },
32605
33068
  "application/mrb-publish+xml": {
32606
33069
  source: "iana",
32607
- compressible: true,
32608
- extensions: [
32609
- "xdf"
32610
- ]
33070
+ compressible: true
32611
33071
  },
32612
33072
  "application/msc-ivr+xml": {
32613
33073
  source: "iana",
@@ -32678,6 +33138,12 @@ var require$$0 = {
32678
33138
  },
32679
33139
  "application/nss": {
32680
33140
  source: "iana"
33141
+ },
33142
+ "application/oauth-authz-req+jwt": {
33143
+ source: "iana"
33144
+ },
33145
+ "application/oblivious-dns-message": {
33146
+ source: "iana"
32681
33147
  },
32682
33148
  "application/ocsp-request": {
32683
33149
  source: "iana"
@@ -32768,6 +33234,13 @@ var require$$0 = {
32768
33234
  extensions: [
32769
33235
  "oxps"
32770
33236
  ]
33237
+ },
33238
+ "application/p21": {
33239
+ source: "iana"
33240
+ },
33241
+ "application/p21+zip": {
33242
+ source: "iana",
33243
+ compressible: false
32771
33244
  },
32772
33245
  "application/p2p-overlay+xml": {
32773
33246
  source: "iana",
@@ -32810,7 +33283,10 @@ var require$$0 = {
32810
33283
  ]
32811
33284
  },
32812
33285
  "application/pgp-keys": {
32813
- source: "iana"
33286
+ source: "iana",
33287
+ extensions: [
33288
+ "asc"
33289
+ ]
32814
33290
  },
32815
33291
  "application/pgp-signature": {
32816
33292
  source: "iana",
@@ -33136,6 +33612,10 @@ var require$$0 = {
33136
33612
  "application/sarif+json": {
33137
33613
  source: "iana",
33138
33614
  compressible: true
33615
+ },
33616
+ "application/sarif-external-properties+json": {
33617
+ source: "iana",
33618
+ compressible: true
33139
33619
  },
33140
33620
  "application/sbe": {
33141
33621
  source: "iana"
@@ -33326,6 +33806,10 @@ var require$$0 = {
33326
33806
  extensions: [
33327
33807
  "srx"
33328
33808
  ]
33809
+ },
33810
+ "application/spdx+json": {
33811
+ source: "iana",
33812
+ compressible: true
33329
33813
  },
33330
33814
  "application/spirits-event+xml": {
33331
33815
  source: "iana",
@@ -33462,6 +33946,9 @@ var require$$0 = {
33462
33946
  },
33463
33947
  "application/tnauthlist": {
33464
33948
  source: "iana"
33949
+ },
33950
+ "application/token-introspection+jwt": {
33951
+ source: "iana"
33465
33952
  },
33466
33953
  "application/toml": {
33467
33954
  compressible: true,
@@ -33473,7 +33960,10 @@ var require$$0 = {
33473
33960
  source: "iana"
33474
33961
  },
33475
33962
  "application/trig": {
33476
- source: "iana"
33963
+ source: "iana",
33964
+ extensions: [
33965
+ "trig"
33966
+ ]
33477
33967
  },
33478
33968
  "application/ttml+xml": {
33479
33969
  source: "iana",
@@ -33553,6 +34043,9 @@ var require$$0 = {
33553
34043
  },
33554
34044
  "application/vnd.3gpp-v2x-local-service-information": {
33555
34045
  source: "iana"
34046
+ },
34047
+ "application/vnd.3gpp.5gnas": {
34048
+ source: "iana"
33556
34049
  },
33557
34050
  "application/vnd.3gpp.access-transfer-events+xml": {
33558
34051
  source: "iana",
@@ -33565,9 +34058,15 @@ var require$$0 = {
33565
34058
  "application/vnd.3gpp.gmop+xml": {
33566
34059
  source: "iana",
33567
34060
  compressible: true
34061
+ },
34062
+ "application/vnd.3gpp.gtpc": {
34063
+ source: "iana"
33568
34064
  },
33569
34065
  "application/vnd.3gpp.interworking-data": {
33570
34066
  source: "iana"
34067
+ },
34068
+ "application/vnd.3gpp.lpp": {
34069
+ source: "iana"
33571
34070
  },
33572
34071
  "application/vnd.3gpp.mc-signalling-ear": {
33573
34072
  source: "iana"
@@ -33677,6 +34176,12 @@ var require$$0 = {
33677
34176
  "application/vnd.3gpp.mid-call+xml": {
33678
34177
  source: "iana",
33679
34178
  compressible: true
34179
+ },
34180
+ "application/vnd.3gpp.ngap": {
34181
+ source: "iana"
34182
+ },
34183
+ "application/vnd.3gpp.pfcp": {
34184
+ source: "iana"
33680
34185
  },
33681
34186
  "application/vnd.3gpp.pic-bw-large": {
33682
34187
  source: "iana",
@@ -33695,6 +34200,9 @@ var require$$0 = {
33695
34200
  extensions: [
33696
34201
  "pvb"
33697
34202
  ]
34203
+ },
34204
+ "application/vnd.3gpp.s1ap": {
34205
+ source: "iana"
33698
34206
  },
33699
34207
  "application/vnd.3gpp.sms": {
33700
34208
  source: "iana"
@@ -33846,6 +34354,12 @@ var require$$0 = {
33846
34354
  },
33847
34355
  "application/vnd.afpc.modca-pagesegment": {
33848
34356
  source: "iana"
34357
+ },
34358
+ "application/vnd.age": {
34359
+ source: "iana",
34360
+ extensions: [
34361
+ "age"
34362
+ ]
33849
34363
  },
33850
34364
  "application/vnd.ah-barcode": {
33851
34365
  source: "iana"
@@ -33927,6 +34441,12 @@ var require$$0 = {
33927
34441
  extensions: [
33928
34442
  "atx"
33929
34443
  ]
34444
+ },
34445
+ "application/vnd.apache.arrow.file": {
34446
+ source: "iana"
34447
+ },
34448
+ "application/vnd.apache.arrow.stream": {
34449
+ source: "iana"
33930
34450
  },
33931
34451
  "application/vnd.apache.thrift.binary": {
33932
34452
  source: "iana"
@@ -34292,6 +34812,12 @@ var require$$0 = {
34292
34812
  },
34293
34813
  "application/vnd.crypto-shade-file": {
34294
34814
  source: "iana"
34815
+ },
34816
+ "application/vnd.cryptomator.encrypted": {
34817
+ source: "iana"
34818
+ },
34819
+ "application/vnd.cryptomator.vault": {
34820
+ source: "iana"
34295
34821
  },
34296
34822
  "application/vnd.ctc-posml": {
34297
34823
  source: "iana",
@@ -34588,6 +35114,10 @@ var require$$0 = {
34588
35114
  },
34589
35115
  "application/vnd.ecip.rlp": {
34590
35116
  source: "iana"
35117
+ },
35118
+ "application/vnd.eclipse.ditto+json": {
35119
+ source: "iana",
35120
+ compressible: true
34591
35121
  },
34592
35122
  "application/vnd.ecowin.chart": {
34593
35123
  source: "iana",
@@ -34762,6 +35292,10 @@ var require$$0 = {
34762
35292
  },
34763
35293
  "application/vnd.etsi.tsl.der": {
34764
35294
  source: "iana"
35295
+ },
35296
+ "application/vnd.eu.kasparian.car+json": {
35297
+ source: "iana",
35298
+ compressible: true
34765
35299
  },
34766
35300
  "application/vnd.eudora.data": {
34767
35301
  source: "iana"
@@ -34796,6 +35330,10 @@ var require$$0 = {
34796
35330
  },
34797
35331
  "application/vnd.f-secure.mobile": {
34798
35332
  source: "iana"
35333
+ },
35334
+ "application/vnd.familysearch.gedcom+zip": {
35335
+ source: "iana",
35336
+ compressible: false
34799
35337
  },
34800
35338
  "application/vnd.fastcopy-disk-image": {
34801
35339
  source: "iana"
@@ -34876,6 +35414,19 @@ var require$$0 = {
34876
35414
  extensions: [
34877
35415
  "fsc"
34878
35416
  ]
35417
+ },
35418
+ "application/vnd.fujifilm.fb.docuworks": {
35419
+ source: "iana"
35420
+ },
35421
+ "application/vnd.fujifilm.fb.docuworks.binder": {
35422
+ source: "iana"
35423
+ },
35424
+ "application/vnd.fujifilm.fb.docuworks.container": {
35425
+ source: "iana"
35426
+ },
35427
+ "application/vnd.fujifilm.fb.jfi+xml": {
35428
+ source: "iana",
35429
+ compressible: true
34879
35430
  },
34880
35431
  "application/vnd.fujitsu.oasys": {
34881
35432
  source: "iana",
@@ -35165,6 +35716,16 @@ var require$$0 = {
35165
35716
  extensions: [
35166
35717
  "les"
35167
35718
  ]
35719
+ },
35720
+ "application/vnd.hl7cda+xml": {
35721
+ source: "iana",
35722
+ charset: "UTF-8",
35723
+ compressible: true
35724
+ },
35725
+ "application/vnd.hl7v2+xml": {
35726
+ source: "iana",
35727
+ charset: "UTF-8",
35728
+ compressible: true
35168
35729
  },
35169
35730
  "application/vnd.hp-hpgl": {
35170
35731
  source: "iana",
@@ -35674,7 +36235,10 @@ var require$$0 = {
35674
36235
  ]
35675
36236
  },
35676
36237
  "application/vnd.mapbox-vector-tile": {
35677
- source: "iana"
36238
+ source: "iana",
36239
+ extensions: [
36240
+ "mvt"
36241
+ ]
35678
36242
  },
35679
36243
  "application/vnd.marlin.drm.actiontoken+xml": {
35680
36244
  source: "iana",
@@ -35694,6 +36258,10 @@ var require$$0 = {
35694
36258
  "application/vnd.mason+json": {
35695
36259
  source: "iana",
35696
36260
  compressible: true
36261
+ },
36262
+ "application/vnd.maxar.archive.3tz+zip": {
36263
+ source: "iana",
36264
+ compressible: false
35697
36265
  },
35698
36266
  "application/vnd.maxmind.maxmind-db": {
35699
36267
  source: "iana"
@@ -36132,6 +36700,10 @@ var require$$0 = {
36132
36700
  extensions: [
36133
36701
  "taglet"
36134
36702
  ]
36703
+ },
36704
+ "application/vnd.nacamar.ybrid+json": {
36705
+ source: "iana",
36706
+ compressible: true
36135
36707
  },
36136
36708
  "application/vnd.ncd.control": {
36137
36709
  source: "iana"
@@ -36142,6 +36714,9 @@ var require$$0 = {
36142
36714
  "application/vnd.nearst.inv+json": {
36143
36715
  source: "iana",
36144
36716
  compressible: true
36717
+ },
36718
+ "application/vnd.nebumind.line": {
36719
+ source: "iana"
36145
36720
  },
36146
36721
  "application/vnd.nervana": {
36147
36722
  source: "iana"
@@ -36661,6 +37236,9 @@ var require$$0 = {
36661
37236
  extensions: [
36662
37237
  "osm"
36663
37238
  ]
37239
+ },
37240
+ "application/vnd.opentimestamps.ots": {
37241
+ source: "iana"
36664
37242
  },
36665
37243
  "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
36666
37244
  source: "iana",
@@ -37255,6 +37833,9 @@ var require$$0 = {
37255
37833
  },
37256
37834
  "application/vnd.renlearn.rlprint": {
37257
37835
  source: "iana"
37836
+ },
37837
+ "application/vnd.resilient.logic": {
37838
+ source: "iana"
37258
37839
  },
37259
37840
  "application/vnd.restful+json": {
37260
37841
  source: "iana",
@@ -37632,6 +38213,10 @@ var require$$0 = {
37632
38213
  "application/vnd.sycle+xml": {
37633
38214
  source: "iana",
37634
38215
  compressible: true
38216
+ },
38217
+ "application/vnd.syft+json": {
38218
+ source: "iana",
38219
+ compressible: true
37635
38220
  },
37636
38221
  "application/vnd.symbian.install": {
37637
38222
  source: "apache",
@@ -37845,6 +38430,10 @@ var require$$0 = {
37845
38430
  },
37846
38431
  "application/vnd.verimatrix.vcas": {
37847
38432
  source: "iana"
38433
+ },
38434
+ "application/vnd.veritone.aion+json": {
38435
+ source: "iana",
38436
+ compressible: true
37848
38437
  },
37849
38438
  "application/vnd.veryant.thin": {
37850
38439
  source: "iana"
@@ -38103,6 +38692,7 @@ var require$$0 = {
38103
38692
  source: "iana"
38104
38693
  },
38105
38694
  "application/wasm": {
38695
+ source: "iana",
38106
38696
  compressible: true,
38107
38697
  extensions: [
38108
38698
  "wasm"
@@ -38110,7 +38700,10 @@ var require$$0 = {
38110
38700
  },
38111
38701
  "application/watcherinfo+xml": {
38112
38702
  source: "iana",
38113
- compressible: true
38703
+ compressible: true,
38704
+ extensions: [
38705
+ "wif"
38706
+ ]
38114
38707
  },
38115
38708
  "application/webpush-options+json": {
38116
38709
  source: "iana",
@@ -38516,6 +39109,21 @@ var require$$0 = {
38516
39109
  extensions: [
38517
39110
  "iso"
38518
39111
  ]
39112
+ },
39113
+ "application/x-iwork-keynote-sffkey": {
39114
+ extensions: [
39115
+ "key"
39116
+ ]
39117
+ },
39118
+ "application/x-iwork-numbers-sffnumbers": {
39119
+ extensions: [
39120
+ "numbers"
39121
+ ]
39122
+ },
39123
+ "application/x-iwork-pages-sffpages": {
39124
+ extensions: [
39125
+ "pages"
39126
+ ]
38519
39127
  },
38520
39128
  "application/x-java-archive-diff": {
38521
39129
  source: "nginx",
@@ -39058,10 +39666,7 @@ var require$$0 = {
39058
39666
  },
39059
39667
  "application/xcap-error+xml": {
39060
39668
  source: "iana",
39061
- compressible: true,
39062
- extensions: [
39063
- "xer"
39064
- ]
39669
+ compressible: true
39065
39670
  },
39066
39671
  "application/xcap-ns+xml": {
39067
39672
  source: "iana",
@@ -39999,10 +40604,16 @@ var require$$0 = {
39999
40604
  ]
40000
40605
  },
40001
40606
  "image/avci": {
40002
- source: "iana"
40607
+ source: "iana",
40608
+ extensions: [
40609
+ "avci"
40610
+ ]
40003
40611
  },
40004
40612
  "image/avcs": {
40005
- source: "iana"
40613
+ source: "iana",
40614
+ extensions: [
40615
+ "avcs"
40616
+ ]
40006
40617
  },
40007
40618
  "image/avif": {
40008
40619
  source: "iana",
@@ -40348,6 +40959,7 @@ var require$$0 = {
40348
40959
  },
40349
40960
  "image/vnd.microsoft.icon": {
40350
40961
  source: "iana",
40962
+ compressible: true,
40351
40963
  extensions: [
40352
40964
  "ico"
40353
40965
  ]
@@ -40359,6 +40971,7 @@ var require$$0 = {
40359
40971
  source: "iana"
40360
40972
  },
40361
40973
  "image/vnd.ms-dds": {
40974
+ compressible: true,
40362
40975
  extensions: [
40363
40976
  "dds"
40364
40977
  ]
@@ -40705,6 +41318,30 @@ var require$$0 = {
40705
41318
  extensions: [
40706
41319
  "obj"
40707
41320
  ]
41321
+ },
41322
+ "model/step": {
41323
+ source: "iana"
41324
+ },
41325
+ "model/step+xml": {
41326
+ source: "iana",
41327
+ compressible: true,
41328
+ extensions: [
41329
+ "stpx"
41330
+ ]
41331
+ },
41332
+ "model/step+zip": {
41333
+ source: "iana",
41334
+ compressible: false,
41335
+ extensions: [
41336
+ "stpz"
41337
+ ]
41338
+ },
41339
+ "model/step-xml+zip": {
41340
+ source: "iana",
41341
+ compressible: false,
41342
+ extensions: [
41343
+ "stpxz"
41344
+ ]
40708
41345
  },
40709
41346
  "model/stl": {
40710
41347
  source: "iana",
@@ -40773,9 +41410,18 @@ var require$$0 = {
40773
41410
  extensions: [
40774
41411
  "x_t"
40775
41412
  ]
41413
+ },
41414
+ "model/vnd.pytha.pyox": {
41415
+ source: "iana"
40776
41416
  },
40777
41417
  "model/vnd.rosette.annotated-data-model": {
40778
41418
  source: "iana"
41419
+ },
41420
+ "model/vnd.sap.vds": {
41421
+ source: "iana",
41422
+ extensions: [
41423
+ "vds"
41424
+ ]
40779
41425
  },
40780
41426
  "model/vnd.usdz+zip": {
40781
41427
  source: "iana",
@@ -41124,6 +41770,7 @@ var require$$0 = {
41124
41770
  source: "iana"
41125
41771
  },
41126
41772
  "text/shex": {
41773
+ source: "iana",
41127
41774
  extensions: [
41128
41775
  "shex"
41129
41776
  ]
@@ -41245,6 +41892,12 @@ var require$$0 = {
41245
41892
  "text/vnd.esmertec.theme-descriptor": {
41246
41893
  source: "iana",
41247
41894
  charset: "UTF-8"
41895
+ },
41896
+ "text/vnd.familysearch.gedcom": {
41897
+ source: "iana",
41898
+ extensions: [
41899
+ "ged"
41900
+ ]
41248
41901
  },
41249
41902
  "text/vnd.ficlab.flt": {
41250
41903
  source: "iana"
@@ -41505,6 +42158,7 @@ var require$$0 = {
41505
42158
  source: "iana"
41506
42159
  },
41507
42160
  "text/yaml": {
42161
+ compressible: true,
41508
42162
  extensions: [
41509
42163
  "yaml",
41510
42164
  "yml"
@@ -41546,6 +42200,9 @@ var require$$0 = {
41546
42200
  },
41547
42201
  "video/encaprtp": {
41548
42202
  source: "iana"
42203
+ },
42204
+ "video/ffv1": {
42205
+ source: "iana"
41549
42206
  },
41550
42207
  "video/flexfec": {
41551
42208
  source: "iana"
@@ -41604,6 +42261,9 @@ var require$$0 = {
41604
42261
  "jpm",
41605
42262
  "jpgm"
41606
42263
  ]
42264
+ },
42265
+ "video/jxsv": {
42266
+ source: "iana"
41607
42267
  },
41608
42268
  "video/mj2": {
41609
42269
  source: "iana",
@@ -41860,6 +42520,9 @@ var require$$0 = {
41860
42520
  },
41861
42521
  "video/vp8": {
41862
42522
  source: "iana"
42523
+ },
42524
+ "video/vp9": {
42525
+ source: "iana"
41863
42526
  },
41864
42527
  "video/webm": {
41865
42528
  source: "apache",
@@ -41981,6 +42644,7 @@ var require$$0 = {
41981
42644
  /*!
41982
42645
  * mime-db
41983
42646
  * Copyright(c) 2014 Jonathan Ong
42647
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
41984
42648
  * MIT Licensed
41985
42649
  */
41986
42650
 
@@ -43133,6 +43797,17 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
43133
43797
  return /^is[A-Z]/.test(prop);
43134
43798
  });
43135
43799
 
43800
+ /**
43801
+ * If the thing is a FormData object, return true, otherwise return false.
43802
+ *
43803
+ * @param {unknown} thing - The thing to check.
43804
+ *
43805
+ * @returns {boolean}
43806
+ */
43807
+ function isSpecCompliant(thing) {
43808
+ return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];
43809
+ }
43810
+
43136
43811
  /**
43137
43812
  * Convert a data object to FormData
43138
43813
  *
@@ -43180,7 +43855,7 @@ function toFormData(obj, formData, options) {
43180
43855
  const dots = options.dots;
43181
43856
  const indexes = options.indexes;
43182
43857
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
43183
- const useBlob = _Blob && utils.isSpecCompliantForm(formData);
43858
+ const useBlob = _Blob && isSpecCompliant(formData);
43184
43859
 
43185
43860
  if (!utils.isFunction(visitor)) {
43186
43861
  throw new TypeError('visitor must be a function');
@@ -43225,7 +43900,7 @@ function toFormData(obj, formData, options) {
43225
43900
  value = JSON.stringify(value);
43226
43901
  } else if (
43227
43902
  (utils.isArray(value) && isFlatArray(value)) ||
43228
- ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
43903
+ (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))
43229
43904
  )) {
43230
43905
  // eslint-disable-next-line no-param-reassign
43231
43906
  key = removeBrackets(key);
@@ -43822,17 +44497,15 @@ function parseTokens(str) {
43822
44497
  return tokens;
43823
44498
  }
43824
44499
 
43825
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
44500
+ function isValidHeaderName(str) {
44501
+ return /^[-_a-zA-Z]+$/.test(str.trim());
44502
+ }
43826
44503
 
43827
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
44504
+ function matchHeaderValue(context, value, header, filter) {
43828
44505
  if (utils.isFunction(filter)) {
43829
44506
  return filter.call(this, value, header);
43830
44507
  }
43831
44508
 
43832
- if (isHeaderNameFilter) {
43833
- value = header;
43834
- }
43835
-
43836
44509
  if (!utils.isString(value)) return;
43837
44510
 
43838
44511
  if (utils.isString(filter)) {
@@ -43936,7 +44609,7 @@ class AxiosHeaders {
43936
44609
  if (header) {
43937
44610
  const key = utils.findKey(this, header);
43938
44611
 
43939
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
44612
+ return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
43940
44613
  }
43941
44614
 
43942
44615
  return false;
@@ -43969,20 +44642,8 @@ class AxiosHeaders {
43969
44642
  return deleted;
43970
44643
  }
43971
44644
 
43972
- clear(matcher) {
43973
- const keys = Object.keys(this);
43974
- let i = keys.length;
43975
- let deleted = false;
43976
-
43977
- while (i--) {
43978
- const key = keys[i];
43979
- if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
43980
- delete this[key];
43981
- deleted = true;
43982
- }
43983
- }
43984
-
43985
- return deleted;
44645
+ clear() {
44646
+ return Object.keys(this).forEach(this.delete.bind(this));
43986
44647
  }
43987
44648
 
43988
44649
  normalize(format) {
@@ -44073,7 +44734,7 @@ class AxiosHeaders {
44073
44734
  }
44074
44735
  }
44075
44736
 
44076
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
44737
+ AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']);
44077
44738
 
44078
44739
  utils.freezeMethods(AxiosHeaders.prototype);
44079
44740
  utils.freezeMethods(AxiosHeaders);
@@ -45759,7 +46420,7 @@ followRedirects$1.exports.wrap = wrap;
45759
46420
 
45760
46421
  var followRedirects = followRedirects$1.exports;
45761
46422
 
45762
- const VERSION = "1.4.0";
46423
+ const VERSION = "1.2.0";
45763
46424
 
45764
46425
  function parseProtocol(url) {
45765
46426
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -45892,7 +46553,7 @@ function speedometer(samplesCount, min) {
45892
46553
 
45893
46554
  const passed = startedAt && now - startedAt;
45894
46555
 
45895
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
46556
+ return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
45896
46557
  };
45897
46558
  }
45898
46559
 
@@ -46081,179 +46742,6 @@ class AxiosTransformStream extends stream.Transform{
46081
46742
 
46082
46743
  var AxiosTransformStream$1 = AxiosTransformStream;
46083
46744
 
46084
- const {asyncIterator} = Symbol;
46085
-
46086
- const readBlob = async function* (blob) {
46087
- if (blob.stream) {
46088
- yield* blob.stream();
46089
- } else if (blob.arrayBuffer) {
46090
- yield await blob.arrayBuffer();
46091
- } else if (blob[asyncIterator]) {
46092
- yield* blob[asyncIterator]();
46093
- } else {
46094
- yield blob;
46095
- }
46096
- };
46097
-
46098
- var readBlob$1 = readBlob;
46099
-
46100
- const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';
46101
-
46102
- const textEncoder = new TextEncoder();
46103
-
46104
- const CRLF = '\r\n';
46105
- const CRLF_BYTES = textEncoder.encode(CRLF);
46106
- const CRLF_BYTES_COUNT = 2;
46107
-
46108
- class FormDataPart {
46109
- constructor(name, value) {
46110
- const {escapeName} = this.constructor;
46111
- const isStringValue = utils.isString(value);
46112
-
46113
- let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
46114
- !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
46115
- }${CRLF}`;
46116
-
46117
- if (isStringValue) {
46118
- value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
46119
- } else {
46120
- headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
46121
- }
46122
-
46123
- this.headers = textEncoder.encode(headers + CRLF);
46124
-
46125
- this.contentLength = isStringValue ? value.byteLength : value.size;
46126
-
46127
- this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
46128
-
46129
- this.name = name;
46130
- this.value = value;
46131
- }
46132
-
46133
- async *encode(){
46134
- yield this.headers;
46135
-
46136
- const {value} = this;
46137
-
46138
- if(utils.isTypedArray(value)) {
46139
- yield value;
46140
- } else {
46141
- yield* readBlob$1(value);
46142
- }
46143
-
46144
- yield CRLF_BYTES;
46145
- }
46146
-
46147
- static escapeName(name) {
46148
- return String(name).replace(/[\r\n"]/g, (match) => ({
46149
- '\r' : '%0D',
46150
- '\n' : '%0A',
46151
- '"' : '%22',
46152
- }[match]));
46153
- }
46154
- }
46155
-
46156
- const formDataToStream = (form, headersHandler, options) => {
46157
- const {
46158
- tag = 'form-data-boundary',
46159
- size = 25,
46160
- boundary = tag + '-' + utils.generateString(size, BOUNDARY_ALPHABET)
46161
- } = options || {};
46162
-
46163
- if(!utils.isFormData(form)) {
46164
- throw TypeError('FormData instance required');
46165
- }
46166
-
46167
- if (boundary.length < 1 || boundary.length > 70) {
46168
- throw Error('boundary must be 10-70 characters long')
46169
- }
46170
-
46171
- const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
46172
- const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
46173
- let contentLength = footerBytes.byteLength;
46174
-
46175
- const parts = Array.from(form.entries()).map(([name, value]) => {
46176
- const part = new FormDataPart(name, value);
46177
- contentLength += part.size;
46178
- return part;
46179
- });
46180
-
46181
- contentLength += boundaryBytes.byteLength * parts.length;
46182
-
46183
- contentLength = utils.toFiniteNumber(contentLength);
46184
-
46185
- const computedHeaders = {
46186
- 'Content-Type': `multipart/form-data; boundary=${boundary}`
46187
- };
46188
-
46189
- if (Number.isFinite(contentLength)) {
46190
- computedHeaders['Content-Length'] = contentLength;
46191
- }
46192
-
46193
- headersHandler && headersHandler(computedHeaders);
46194
-
46195
- return Readable.from((async function *() {
46196
- for(const part of parts) {
46197
- yield boundaryBytes;
46198
- yield* part.encode();
46199
- }
46200
-
46201
- yield footerBytes;
46202
- })());
46203
- };
46204
-
46205
- var formDataToStream$1 = formDataToStream;
46206
-
46207
- class ZlibHeaderTransformStream extends stream.Transform {
46208
- __transform(chunk, encoding, callback) {
46209
- this.push(chunk);
46210
- callback();
46211
- }
46212
-
46213
- _transform(chunk, encoding, callback) {
46214
- if (chunk.length !== 0) {
46215
- this._transform = this.__transform;
46216
-
46217
- // Add Default Compression headers if no zlib headers are present
46218
- if (chunk[0] !== 120) { // Hex: 78
46219
- const header = Buffer.alloc(2);
46220
- header[0] = 120; // Hex: 78
46221
- header[1] = 156; // Hex: 9C
46222
- this.push(header, encoding);
46223
- }
46224
- }
46225
-
46226
- this.__transform(chunk, encoding, callback);
46227
- }
46228
- }
46229
-
46230
- var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
46231
-
46232
- const callbackify = (fn, reducer) => {
46233
- return utils.isAsyncFn(fn) ? function (...args) {
46234
- const cb = args.pop();
46235
- fn.apply(this, args).then((value) => {
46236
- try {
46237
- reducer ? cb(null, ...reducer(value)) : cb(null, value);
46238
- } catch (err) {
46239
- cb(err);
46240
- }
46241
- }, cb);
46242
- } : fn;
46243
- };
46244
-
46245
- var callbackify$1 = callbackify;
46246
-
46247
- const zlibOptions = {
46248
- flush: zlib.constants.Z_SYNC_FLUSH,
46249
- finishFlush: zlib.constants.Z_SYNC_FLUSH
46250
- };
46251
-
46252
- const brotliOptions = {
46253
- flush: zlib.constants.BROTLI_OPERATION_FLUSH,
46254
- finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
46255
- };
46256
-
46257
46745
  const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);
46258
46746
 
46259
46747
  const {http: httpFollow, https: httpsFollow} = followRedirects;
@@ -46336,58 +46824,25 @@ function setProxy(options, configProxy, location) {
46336
46824
 
46337
46825
  const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';
46338
46826
 
46339
- // temporary hotfix
46340
-
46341
- const wrapAsync = (asyncExecutor) => {
46342
- return new Promise((resolve, reject) => {
46343
- let onDone;
46344
- let isDone;
46345
-
46346
- const done = (value, isRejected) => {
46347
- if (isDone) return;
46348
- isDone = true;
46349
- onDone && onDone(value, isRejected);
46350
- };
46351
-
46352
- const _resolve = (value) => {
46353
- done(value);
46354
- resolve(value);
46355
- };
46356
-
46357
- const _reject = (reason) => {
46358
- done(reason, true);
46359
- reject(reason);
46360
- };
46361
-
46362
- asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
46363
- })
46364
- };
46365
-
46366
46827
  /*eslint consistent-return:0*/
46367
46828
  var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46368
- return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
46369
- let {data, lookup, family} = config;
46370
- const {responseType, responseEncoding} = config;
46829
+ return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
46830
+ let data = config.data;
46831
+ const responseType = config.responseType;
46832
+ const responseEncoding = config.responseEncoding;
46371
46833
  const method = config.method.toUpperCase();
46834
+ let isFinished;
46372
46835
  let isDone;
46373
46836
  let rejected = false;
46374
46837
  let req;
46375
46838
 
46376
- if (lookup && utils.isAsyncFn(lookup)) {
46377
- lookup = callbackify$1(lookup, (entry) => {
46378
- if(utils.isString(entry)) {
46379
- entry = [entry, entry.indexOf('.') < 0 ? 6 : 4];
46380
- } else if (!utils.isArray(entry)) {
46381
- throw new TypeError('lookup async function must return an array [ip: string, family: number]]')
46382
- }
46383
- return entry;
46384
- });
46385
- }
46386
-
46387
46839
  // temporary internal emitter until the AxiosRequest class will be implemented
46388
46840
  const emitter = new EventEmitter();
46389
46841
 
46390
- const onFinished = () => {
46842
+ function onFinished() {
46843
+ if (isFinished) return;
46844
+ isFinished = true;
46845
+
46391
46846
  if (config.cancelToken) {
46392
46847
  config.cancelToken.unsubscribe(abort);
46393
46848
  }
@@ -46397,15 +46852,28 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46397
46852
  }
46398
46853
 
46399
46854
  emitter.removeAllListeners();
46400
- };
46855
+ }
46856
+
46857
+ function done(value, isRejected) {
46858
+ if (isDone) return;
46401
46859
 
46402
- onDone((value, isRejected) => {
46403
46860
  isDone = true;
46861
+
46404
46862
  if (isRejected) {
46405
46863
  rejected = true;
46406
46864
  onFinished();
46407
46865
  }
46408
- });
46866
+
46867
+ isRejected ? rejectPromise(value) : resolvePromise(value);
46868
+ }
46869
+
46870
+ const resolve = function resolve(value) {
46871
+ done(value);
46872
+ };
46873
+
46874
+ const reject = function reject(value) {
46875
+ done(value, true);
46876
+ };
46409
46877
 
46410
46878
  function abort(reason) {
46411
46879
  emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
@@ -46422,7 +46890,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46422
46890
 
46423
46891
  // Parse url
46424
46892
  const fullPath = buildFullPath(config.baseURL, config.url);
46425
- const parsed = new URL(fullPath, 'http://localhost');
46893
+ const parsed = new URL(fullPath);
46426
46894
  const protocol = parsed.protocol || supportedProtocols[0];
46427
46895
 
46428
46896
  if (protocol === 'data:') {
@@ -46449,7 +46917,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46449
46917
  convertedData = convertedData.toString(responseEncoding);
46450
46918
 
46451
46919
  if (!responseEncoding || responseEncoding === 'utf8') {
46452
- convertedData = utils.stripBOM(convertedData);
46920
+ data = utils.stripBOM(convertedData);
46453
46921
  }
46454
46922
  } else if (responseType === 'stream') {
46455
46923
  convertedData = stream.Readable.from(convertedData);
@@ -46486,32 +46954,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46486
46954
  let maxUploadRate = undefined;
46487
46955
  let maxDownloadRate = undefined;
46488
46956
 
46489
- // support for spec compliant FormData objects
46490
- if (utils.isSpecCompliantForm(data)) {
46491
- const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
46492
-
46493
- data = formDataToStream$1(data, (formHeaders) => {
46494
- headers.set(formHeaders);
46495
- }, {
46496
- tag: `axios-${VERSION}-boundary`,
46497
- boundary: userBoundary && userBoundary[1] || undefined
46498
- });
46499
- // support for https://www.npmjs.com/package/form-data api
46500
- } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
46957
+ // support for https://www.npmjs.com/package/form-data api
46958
+ if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
46501
46959
  headers.set(data.getHeaders());
46502
-
46503
- if (!headers.hasContentLength()) {
46504
- try {
46505
- const knownLength = await require$$1.promisify(data.getLength).call(data);
46506
- Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
46507
- /*eslint no-empty:0*/
46508
- } catch (e) {
46509
- }
46510
- }
46511
- } else if (utils.isBlob(data)) {
46512
- data.size && headers.setContentType(data.type || 'application/octet-stream');
46513
- headers.setContentLength(data.size || 0);
46514
- data = stream.Readable.from(readBlob$1(data));
46515
46960
  } else if (data && !utils.isStream(data)) {
46516
46961
  if (Buffer.isBuffer(data)) ; else if (utils.isArrayBuffer(data)) {
46517
46962
  data = Buffer.from(new Uint8Array(data));
@@ -46526,7 +46971,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46526
46971
  }
46527
46972
 
46528
46973
  // Add Content-Length header if data exists
46529
- headers.setContentLength(data.length, false);
46974
+ headers.set('Content-Length', data.length, false);
46530
46975
 
46531
46976
  if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
46532
46977
  return reject(new AxiosError(
@@ -46537,7 +46982,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46537
46982
  }
46538
46983
  }
46539
46984
 
46540
- const contentLength = utils.toFiniteNumber(headers.getContentLength());
46985
+ const contentLength = +headers.getContentLength();
46541
46986
 
46542
46987
  if (utils.isArray(maxRate)) {
46543
46988
  maxUploadRate = maxRate[0];
@@ -46552,7 +46997,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46552
46997
  }
46553
46998
 
46554
46999
  data = stream.pipeline([data, new AxiosTransformStream$1({
46555
- length: contentLength,
47000
+ length: utils.toFiniteNumber(contentLength),
46556
47001
  maxRate: utils.toFiniteNumber(maxUploadRate)
46557
47002
  })], utils.noop);
46558
47003
 
@@ -46595,10 +47040,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46595
47040
  return reject(customErr);
46596
47041
  }
46597
47042
 
46598
- headers.set(
46599
- 'Accept-Encoding',
46600
- 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
46601
- );
47043
+ headers.set('Accept-Encoding', 'gzip, deflate, br', false);
46602
47044
 
46603
47045
  const options = {
46604
47046
  path,
@@ -46607,8 +47049,6 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46607
47049
  agents: { http: config.httpAgent, https: config.httpsAgent },
46608
47050
  auth,
46609
47051
  protocol,
46610
- family,
46611
- lookup,
46612
47052
  beforeRedirect: dispatchBeforeRedirect,
46613
47053
  beforeRedirects: {}
46614
47054
  };
@@ -46672,44 +47112,34 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
46672
47112
  streams.push(transformStream);
46673
47113
  }
46674
47114
 
46675
- // decompress the response body transparently if required
47115
+ // uncompress the response body transparently if required
46676
47116
  let responseStream = res;
46677
47117
 
46678
47118
  // return the last request in case of redirects
46679
47119
  const lastRequest = res.req || req;
46680
47120
 
46681
47121
  // if decompress disabled we should not decompress
46682
- if (config.decompress !== false && res.headers['content-encoding']) {
47122
+ if (config.decompress !== false) {
46683
47123
  // if no content, but headers still say that it is encoded,
46684
47124
  // remove the header not confuse downstream operations
46685
- if (method === 'HEAD' || res.statusCode === 204) {
47125
+ if ((!responseLength || res.statusCode === 204) && res.headers['content-encoding']) {
46686
47126
  delete res.headers['content-encoding'];
46687
47127
  }
46688
47128
 
46689
47129
  switch (res.headers['content-encoding']) {
46690
47130
  /*eslint default-case:0*/
46691
47131
  case 'gzip':
46692
- case 'x-gzip':
46693
47132
  case 'compress':
46694
- case 'x-compress':
46695
- // add the unzipper to the body stream processing pipeline
46696
- streams.push(zlib.createUnzip(zlibOptions));
46697
-
46698
- // remove the content-encoding in order to not confuse downstream operations
46699
- delete res.headers['content-encoding'];
46700
- break;
46701
47133
  case 'deflate':
46702
- streams.push(new ZlibHeaderTransformStream$1());
46703
-
46704
47134
  // add the unzipper to the body stream processing pipeline
46705
- streams.push(zlib.createUnzip(zlibOptions));
47135
+ streams.push(zlib.createUnzip());
46706
47136
 
46707
47137
  // remove the content-encoding in order to not confuse downstream operations
46708
47138
  delete res.headers['content-encoding'];
46709
47139
  break;
46710
47140
  case 'br':
46711
47141
  if (isBrotliSupported) {
46712
- streams.push(zlib.createBrotliDecompress(brotliOptions));
47142
+ streams.push(zlib.createBrotliDecompress());
46713
47143
  delete res.headers['content-encoding'];
46714
47144
  }
46715
47145
  }
@@ -47038,12 +47468,8 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
47038
47468
  }
47039
47469
  }
47040
47470
 
47041
- if (utils.isFormData(requestData)) {
47042
- if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
47043
- requestHeaders.setContentType(false); // Let the browser set it
47044
- } else {
47045
- requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
47046
- }
47471
+ if (utils.isFormData(requestData) && platform.isStandardBrowserEnv) {
47472
+ requestHeaders.setContentType(false); // Let the browser set it
47047
47473
  }
47048
47474
 
47049
47475
  let request = new XMLHttpRequest();
@@ -47070,7 +47496,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
47070
47496
  const responseHeaders = AxiosHeaders$1.from(
47071
47497
  'getAllResponseHeaders' in request && request.getAllResponseHeaders()
47072
47498
  );
47073
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
47499
+ const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
47074
47500
  request.responseText : request.response;
47075
47501
  const response = {
47076
47502
  data: responseData,
@@ -47297,7 +47723,7 @@ function throwIfCancellationRequested(config) {
47297
47723
  }
47298
47724
 
47299
47725
  if (config.signal && config.signal.aborted) {
47300
- throw new CanceledError(null, config);
47726
+ throw new CanceledError();
47301
47727
  }
47302
47728
  }
47303
47729
 
@@ -47449,7 +47875,7 @@ function mergeConfig(config1, config2) {
47449
47875
  headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
47450
47876
  };
47451
47877
 
47452
- utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
47878
+ utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
47453
47879
  const merge = mergeMap[prop] || mergeDeepProperties;
47454
47880
  const configValue = merge(config1[prop], config2[prop], prop);
47455
47881
  (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -47593,17 +48019,11 @@ class Axios {
47593
48019
  }, false);
47594
48020
  }
47595
48021
 
47596
- if (paramsSerializer != null) {
47597
- if (utils.isFunction(paramsSerializer)) {
47598
- config.paramsSerializer = {
47599
- serialize: paramsSerializer
47600
- };
47601
- } else {
47602
- validator.assertOptions(paramsSerializer, {
47603
- encode: validators.function,
47604
- serialize: validators.function
47605
- }, true);
47606
- }
48022
+ if (paramsSerializer !== undefined) {
48023
+ validator.assertOptions(paramsSerializer, {
48024
+ encode: validators.function,
48025
+ serialize: validators.function
48026
+ }, true);
47607
48027
  }
47608
48028
 
47609
48029
  // Set config.method
@@ -47894,78 +48314,6 @@ function isAxiosError(payload) {
47894
48314
  return utils.isObject(payload) && (payload.isAxiosError === true);
47895
48315
  }
47896
48316
 
47897
- const HttpStatusCode = {
47898
- Continue: 100,
47899
- SwitchingProtocols: 101,
47900
- Processing: 102,
47901
- EarlyHints: 103,
47902
- Ok: 200,
47903
- Created: 201,
47904
- Accepted: 202,
47905
- NonAuthoritativeInformation: 203,
47906
- NoContent: 204,
47907
- ResetContent: 205,
47908
- PartialContent: 206,
47909
- MultiStatus: 207,
47910
- AlreadyReported: 208,
47911
- ImUsed: 226,
47912
- MultipleChoices: 300,
47913
- MovedPermanently: 301,
47914
- Found: 302,
47915
- SeeOther: 303,
47916
- NotModified: 304,
47917
- UseProxy: 305,
47918
- Unused: 306,
47919
- TemporaryRedirect: 307,
47920
- PermanentRedirect: 308,
47921
- BadRequest: 400,
47922
- Unauthorized: 401,
47923
- PaymentRequired: 402,
47924
- Forbidden: 403,
47925
- NotFound: 404,
47926
- MethodNotAllowed: 405,
47927
- NotAcceptable: 406,
47928
- ProxyAuthenticationRequired: 407,
47929
- RequestTimeout: 408,
47930
- Conflict: 409,
47931
- Gone: 410,
47932
- LengthRequired: 411,
47933
- PreconditionFailed: 412,
47934
- PayloadTooLarge: 413,
47935
- UriTooLong: 414,
47936
- UnsupportedMediaType: 415,
47937
- RangeNotSatisfiable: 416,
47938
- ExpectationFailed: 417,
47939
- ImATeapot: 418,
47940
- MisdirectedRequest: 421,
47941
- UnprocessableEntity: 422,
47942
- Locked: 423,
47943
- FailedDependency: 424,
47944
- TooEarly: 425,
47945
- UpgradeRequired: 426,
47946
- PreconditionRequired: 428,
47947
- TooManyRequests: 429,
47948
- RequestHeaderFieldsTooLarge: 431,
47949
- UnavailableForLegalReasons: 451,
47950
- InternalServerError: 500,
47951
- NotImplemented: 501,
47952
- BadGateway: 502,
47953
- ServiceUnavailable: 503,
47954
- GatewayTimeout: 504,
47955
- HttpVersionNotSupported: 505,
47956
- VariantAlsoNegotiates: 506,
47957
- InsufficientStorage: 507,
47958
- LoopDetected: 508,
47959
- NotExtended: 510,
47960
- NetworkAuthenticationRequired: 511,
47961
- };
47962
-
47963
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
47964
- HttpStatusCode[value] = key;
47965
- });
47966
-
47967
- var HttpStatusCode$1 = HttpStatusCode;
47968
-
47969
48317
  /**
47970
48318
  * Create an instance of Axios
47971
48319
  *
@@ -48020,15 +48368,10 @@ axios.spread = spread;
48020
48368
  // Expose isAxiosError
48021
48369
  axios.isAxiosError = isAxiosError;
48022
48370
 
48023
- // Expose mergeConfig
48024
- axios.mergeConfig = mergeConfig;
48025
-
48026
48371
  axios.AxiosHeaders = AxiosHeaders$1;
48027
48372
 
48028
48373
  axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
48029
48374
 
48030
- axios.HttpStatusCode = HttpStatusCode$1;
48031
-
48032
48375
  axios.default = axios;
48033
48376
 
48034
48377
  // this module should only have a default export
@@ -48056,7 +48399,7 @@ var axios$1 = axios;
48056
48399
  * @returns Title for the layer
48057
48400
  */
48058
48401
  var getTitle = function getTitle(layerId) {
48059
- var wmjsLayer = mapStoreUtils.getWMLayerById(layerId);
48402
+ var wmjsLayer = webmapUtils.getWMLayerById(layerId);
48060
48403
  return wmjsLayer ? wmjsLayer.title || wmjsLayer.name : layerId;
48061
48404
  };
48062
48405
  /**
@@ -48066,12 +48409,12 @@ var getTitle = function getTitle(layerId) {
48066
48409
  * @returns
48067
48410
  */
48068
48411
  var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
48069
- var wmjsMap = mapStoreUtils.getWMJSMapById(mapId);
48412
+ var wmjsMap = webmapUtils.getWMJSMapById(mapId);
48070
48413
  if (!wmjsMap || !layers || layers.length === 0) {
48071
48414
  return [];
48072
48415
  }
48073
48416
  return layers.filter(function (layer) {
48074
- return layer && layer.enabled && !!mapStoreUtils.getWMLayerById(layer.id);
48417
+ return layer && layer.enabled && !!webmapUtils.getWMLayerById(layer.id);
48075
48418
  }).map(function (layer) {
48076
48419
  /*
48077
48420
  We need a wmjsLayer to build the getfeatureinfo url (getWMSGetFeatureInfoRequestURL function).
@@ -48079,7 +48422,7 @@ var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
48079
48422
  Therefore make a clone of this layer and set its dimensions based on the layer object.
48080
48423
  Otherwise we risk making a getfeatureinfo call with outdated dimension values.
48081
48424
  */
48082
- var wmjsLayer = mapStoreUtils.getWMLayerById(layer.id).cloneLayer();
48425
+ var wmjsLayer = webmapUtils.getWMLayerById(layer.id).cloneLayer();
48083
48426
  layer.dimensions && layer.dimensions.forEach(function (dim) {
48084
48427
  var wmDim = wmjsLayer.getDimension(dim.name);
48085
48428
  if (wmDim && wmDim.getValue() !== dim.currentValue) {
@@ -50037,465 +50380,6 @@ var GetFeatureInfoButtonConnect = function GetFeatureInfoButtonConnect(_ref) {
50037
50380
  }, /*#__PURE__*/React.createElement(Info, null));
50038
50381
  };
50039
50382
 
50040
- /* *
50041
- * Licensed under the Apache License, Version 2.0 (the "License");
50042
- * you may not use this file except in compliance with the License.
50043
- * You may obtain a copy of the License at
50044
- *
50045
- * http://www.apache.org/licenses/LICENSE-2.0
50046
- *
50047
- * Unless required by applicable law or agreed to in writing, software
50048
- * distributed under the License is distributed on an "AS IS" BASIS,
50049
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50050
- * See the License for the specific language governing permissions and
50051
- * limitations under the License.
50052
- *
50053
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
50054
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
50055
- * */
50056
- var DrawingToolMapButtonConnect = function DrawingToolMapButtonConnect(_ref) {
50057
- var mapId = _ref.mapId,
50058
- _ref$source = _ref.source,
50059
- source = _ref$source === void 0 ? 'app' : _ref$source;
50060
- var dispatch = useDispatch();
50061
- var _useMapDrawContext = useMapDrawContext(),
50062
- deactivateTool = _useMapDrawContext.deactivateTool;
50063
- // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
50064
- var dialogType = "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
50065
- // const dialogType = isMultiMap
50066
- // ? `${uiTypes.DialogTypes.DrawingTool}-${mapId}`
50067
- // : uiTypes.DialogTypes.DrawingTool;
50068
- var currentActiveMapId = useSelector(function (store) {
50069
- return uiSelectors.getDialogMapId(store, dialogType);
50070
- });
50071
- var isOpenInStore = useSelector(function (store) {
50072
- return uiSelectors.getisDialogOpen(store, dialogType);
50073
- });
50074
- var openDrawingToolDialog = React.useCallback(function () {
50075
- var shouldOpen = currentActiveMapId !== mapId ? true : !isOpenInStore;
50076
- if (!shouldOpen) {
50077
- deactivateTool();
50078
- }
50079
- dispatch(uiActions.setActiveMapIdForDialog({
50080
- type: dialogType,
50081
- mapId: mapId,
50082
- setOpen: shouldOpen,
50083
- source: source
50084
- }));
50085
- }, [currentActiveMapId, dialogType, dispatch, isOpenInStore, mapId, source, deactivateTool]);
50086
- var isOpen = currentActiveMapId === mapId && isOpenInStore;
50087
- return /*#__PURE__*/React.createElement(MapControlButton, {
50088
- title: "Drawing Toolbox",
50089
- "data-testid": "drawingToolButton",
50090
- onClick: openDrawingToolDialog,
50091
- isActive: isOpen
50092
- }, /*#__PURE__*/React.createElement(DrawPolygon, null));
50093
- };
50094
-
50095
- var opacityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
50096
- var SAVE_AREA_BUTTON = 'Save area';
50097
- var DrawingToolForm = function DrawingToolForm(_ref) {
50098
- var onSubmitForm = _ref.onSubmitForm;
50099
- var _useFormContext = useFormContext(),
50100
- handleSubmit = _useFormContext.handleSubmit;
50101
- var _useMapDrawContext = useMapDrawContext(),
50102
- editModes = _useMapDrawContext.editModes,
50103
- changeActiveTool = _useMapDrawContext.changeActiveTool,
50104
- activeTool = _useMapDrawContext.activeTool,
50105
- deactivateTool = _useMapDrawContext.deactivateTool,
50106
- geoJSON = _useMapDrawContext.geoJSON,
50107
- getProperties = _useMapDrawContext.getProperties,
50108
- changeProperties = _useMapDrawContext.changeProperties;
50109
- var onSubmit = function onSubmit() {
50110
- deactivateTool();
50111
- handleSubmit(function (formValues) {
50112
- // remove unneeded properties
50113
- formValues.opacity;
50114
- var allFormValues = __rest$1(formValues, ["opacity"]);
50115
- onSubmitForm(Object.assign(Object.assign({}, allFormValues), {
50116
- geoJSON: geoJSON
50117
- }));
50118
- })();
50119
- };
50120
- var getInitialGeoJSONPropertyValue = function getInitialGeoJSONPropertyValue(property) {
50121
- if (getProperties()[property]) {
50122
- return getProperties()[property];
50123
- }
50124
- return defaultStyleProperties[property];
50125
- };
50126
- var _React$useState = React.useState(getInitialGeoJSONPropertyValue('fill-opacity') * 100),
50127
- _React$useState2 = _slicedToArray(_React$useState, 2),
50128
- opacity = _React$useState2[0],
50129
- setOpacity = _React$useState2[1];
50130
- var onChangeOpacity = function onChangeOpacity(event) {
50131
- var value = event.target.value;
50132
- var parseValue = parseInt(value, 10);
50133
- setOpacity(parseValue);
50134
- var newOpacity = parseValue / 100;
50135
- var additionalStrokeOpacity = 0.8;
50136
- changeProperties({
50137
- 'fill-opacity': newOpacity,
50138
- 'stroke-opacity': clamp$1(newOpacity + additionalStrokeOpacity, 0.01, 1)
50139
- });
50140
- };
50141
- return /*#__PURE__*/React.createElement(Box$2, {
50142
- "data-testid": "drawingToolForm",
50143
- sx: {
50144
- padding: '16px',
50145
- height: '100%'
50146
- }
50147
- }, /*#__PURE__*/React.createElement(Grid, {
50148
- container: true,
50149
- direction: "column",
50150
- justifyContent: "space-between",
50151
- sx: {
50152
- height: '100%'
50153
- }
50154
- }, /*#__PURE__*/React.createElement(Grid, {
50155
- item: true,
50156
- container: true,
50157
- direction: "column",
50158
- spacing: 1
50159
- }, /*#__PURE__*/React.createElement(Grid, {
50160
- item: true
50161
- }, /*#__PURE__*/React.createElement(Typography, {
50162
- variant: "body2"
50163
- }, "Tools")), /*#__PURE__*/React.createElement(Grid, {
50164
- item: true,
50165
- container: true
50166
- }, /*#__PURE__*/React.createElement(Grid, {
50167
- item: true
50168
- }, editModes.map(function (mode) {
50169
- return /*#__PURE__*/React.createElement(CustomIconButton, {
50170
- key: mode.id,
50171
- variant: "tool",
50172
- tooltipTitle: mode.title,
50173
- isSelected: mode.isSelectable && activeTool === mode.id,
50174
- onClick: function onClick() {
50175
- return changeActiveTool(mode);
50176
- },
50177
- sx: {
50178
- marginRight: 1,
50179
- marginBottom: 1
50180
- },
50181
- "data-testid": mode.id
50182
- }, mode.icon);
50183
- }))), /*#__PURE__*/React.createElement(Grid, {
50184
- item: true,
50185
- container: true
50186
- }, /*#__PURE__*/React.createElement(Grid, {
50187
- item: true,
50188
- xs: 12,
50189
- sm: 6
50190
- }, /*#__PURE__*/React.createElement(ReactHookFormSelect, {
50191
- name: "opacity",
50192
- label: "Opacity",
50193
- rules: {},
50194
- disabled: false,
50195
- isReadOnly: false,
50196
- "data-testid": "drawingToolForm-opacity",
50197
- onChange: onChangeOpacity,
50198
- autoFocus: true,
50199
- value: opacity
50200
- }, opacityOptions.map(function (opacity) {
50201
- return /*#__PURE__*/React.createElement(MenuItem, {
50202
- value: opacity,
50203
- key: opacity
50204
- }, opacity, " %");
50205
- })))), /*#__PURE__*/React.createElement(Grid, {
50206
- item: true
50207
- }, /*#__PURE__*/React.createElement(ReactHookFormTextField, {
50208
- name: "areaName",
50209
- label: "Area name",
50210
- rules: {
50211
- required: true
50212
- },
50213
- disabled: false,
50214
- isReadOnly: false
50215
- }))), /*#__PURE__*/React.createElement(Grid, {
50216
- item: true
50217
- }, /*#__PURE__*/React.createElement(Button, {
50218
- variant: "primary",
50219
- onClick: onSubmit,
50220
- sx: {
50221
- width: '100%'
50222
- },
50223
- "data-testid": "saveDrawingFormButton"
50224
- }, SAVE_AREA_BUTTON))));
50225
- };
50226
- var Wrapper = function Wrapper(props) {
50227
- return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
50228
- options: Object.assign(Object.assign({}, defaultFormOptions), {
50229
- defaultValues: {
50230
- areaName: 'Area 51'
50231
- }
50232
- })
50233
- }, /*#__PURE__*/React.createElement(DrawingToolForm, Object.assign({}, props)));
50234
- };
50235
-
50236
- /* *
50237
- * Licensed under the Apache License, Version 2.0 (the "License");
50238
- * you may not use this file except in compliance with the License.
50239
- * You may obtain a copy of the License at
50240
- *
50241
- * http://www.apache.org/licenses/LICENSE-2.0
50242
- *
50243
- * Unless required by applicable law or agreed to in writing, software
50244
- * distributed under the License is distributed on an "AS IS" BASIS,
50245
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50246
- * See the License for the specific language governing permissions and
50247
- * limitations under the License.
50248
- *
50249
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
50250
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
50251
- * */
50252
- var DrawingToolFormConnect = function DrawingToolFormConnect() {
50253
- var onSubmitForm = function onSubmitForm(formValues) {
50254
- // eslint-disable-next-line no-console
50255
- console.log('You have submitted the form. Nothing will happen now.', formValues);
50256
- };
50257
- return /*#__PURE__*/React.createElement(Wrapper, {
50258
- onSubmitForm: onSubmitForm
50259
- });
50260
- };
50261
-
50262
- var calculateStartSize = function calculateStartSize(minSize, prefSize, startPosition) {
50263
- var _calculateDialogSizeA = calculateDialogSizeAndPosition(),
50264
- calcWidth = _calculateDialogSizeA.width,
50265
- calcHeight = _calculateDialogSizeA.height;
50266
- return {
50267
- width: Math.max(minSize.width, Math.min(prefSize.width, calcWidth)),
50268
- height: Math.max(minSize.height, Math.min(prefSize.height, calcHeight - startPosition.top))
50269
- };
50270
- };
50271
- var DERFAULT_DRAW_TOOL_SIZE = {
50272
- width: 320,
50273
- height: 542
50274
- };
50275
- var DEFAULT_DRAW_TOOL_POSITION = {
50276
- top: 120,
50277
- left: 50
50278
- };
50279
- var DEFAULT_DRAW_TOOL_MIN_SIZE = {
50280
- width: 160,
50281
- height: 300
50282
- };
50283
- var DrawingTool = function DrawingTool(_ref) {
50284
- var bounds = _ref.bounds,
50285
- onClose = _ref.onClose,
50286
- _ref$title = _ref.title,
50287
- title = _ref$title === void 0 ? 'Drawing Toolbox' : _ref$title,
50288
- isOpen = _ref.isOpen,
50289
- _ref$onMouseDown = _ref.onMouseDown,
50290
- onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
50291
- _ref$order = _ref.order,
50292
- order = _ref$order === void 0 ? 0 : _ref$order,
50293
- _ref$source = _ref.source,
50294
- source = _ref$source === void 0 ? 'app' : _ref$source,
50295
- _ref$isLoading = _ref.isLoading,
50296
- isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
50297
- error = _ref.error,
50298
- _ref$isDocked = _ref.isDocked,
50299
- isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
50300
- _ref$size = _ref.size,
50301
- size = _ref$size === void 0 ? DERFAULT_DRAW_TOOL_SIZE : _ref$size,
50302
- _ref$startPosition = _ref.startPosition,
50303
- startPosition = _ref$startPosition === void 0 ? DEFAULT_DRAW_TOOL_POSITION : _ref$startPosition,
50304
- _ref$setFocused = _ref.setFocused,
50305
- setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused,
50306
- _ref$headerSize = _ref.headerSize,
50307
- headerSize = _ref$headerSize === void 0 ? 'xs' : _ref$headerSize;
50308
- var minSize = DEFAULT_DRAW_TOOL_MIN_SIZE;
50309
- var startSizeCalc = calculateStartSize(minSize, size, startPosition);
50310
- var _React$useState = React.useState(startSizeCalc),
50311
- _React$useState2 = _slicedToArray(_React$useState, 2),
50312
- sizeInState = _React$useState2[0],
50313
- setSizeInState = _React$useState2[1];
50314
- React.useEffect(function () {
50315
- if (size !== sizeInState && isDocked && isOpen) {
50316
- setSizeInState(size);
50317
- }
50318
- // eslint-disable-next-line react-hooks/exhaustive-deps
50319
- }, [size, isOpen]);
50320
- return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
50321
- title: title,
50322
- startSize: sizeInState,
50323
- minWidth: minSize.width,
50324
- minHeight: minSize.height,
50325
- startPosition: startPosition,
50326
- isOpen: isOpen,
50327
- onClose: onClose,
50328
- headerSize: headerSize,
50329
- bounds: bounds,
50330
- "data-testid": "drawingToolWindow",
50331
- onMouseDown: onMouseDown,
50332
- onFocus: function onFocus() {
50333
- return setFocused(true);
50334
- },
50335
- onBlur: function onBlur() {
50336
- return setFocused(false);
50337
- },
50338
- order: order,
50339
- source: source,
50340
- // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
50341
- // rightHeaderComponent={
50342
- // <CustomIconButton
50343
- // tooltipTitle={isDocked ? 'Undock' : 'Dock'}
50344
- // data-testid="dockedBtn"
50345
- // disableRipple
50346
- // onClick={(): void => onToggleDock()}
50347
- // >
50348
- // {isDocked ? (
50349
- // <CollapseWindow data-testid="dockedDrawingTool-collapse" />
50350
- // ) : (
50351
- // <ExpandWindow data-testid="dockedDrawingTool-uncollapse" />
50352
- // )}
50353
- // </CustomIconButton>
50354
- // }
50355
- onResizeStop: function onResizeStop(_event, _direction, node) {
50356
- var width = node.offsetWidth,
50357
- height = node.offsetHeight;
50358
- setSizeInState({
50359
- width: width,
50360
- height: height
50361
- });
50362
- },
50363
- onDragEnd: function onDragEnd(_position, dragSize) {
50364
- if (dragSize !== sizeInState) {
50365
- setSizeInState(dragSize);
50366
- }
50367
- }
50368
- }, /*#__PURE__*/React.createElement(Box$2, {
50369
- onKeyDown: function onKeyDown(event) {
50370
- event.stopPropagation();
50371
- },
50372
- sx: {
50373
- height: '100%'
50374
- }
50375
- }, isLoading && /*#__PURE__*/React.createElement(LinearProgress, {
50376
- "data-testid": "loading-bar-drawingTool",
50377
- color: "secondary",
50378
- sx: {
50379
- position: 'absolute',
50380
- width: '100%'
50381
- }
50382
- }), error && /*#__PURE__*/React.createElement(Box$2, {
50383
- sx: {
50384
- padding: '0 6px'
50385
- }
50386
- }, /*#__PURE__*/React.createElement(AlertBanner, {
50387
- title: error,
50388
- shouldClose: true
50389
- })), /*#__PURE__*/React.createElement(DrawingToolFormConnect, null)));
50390
- };
50391
-
50392
- /* *
50393
- * Licensed under the Apache License, Version 2.0 (the "License");
50394
- * you may not use this file except in compliance with the License.
50395
- * You may obtain a copy of the License at
50396
- *
50397
- * http://www.apache.org/licenses/LICENSE-2.0
50398
- *
50399
- * Unless required by applicable law or agreed to in writing, software
50400
- * distributed under the License is distributed on an "AS IS" BASIS,
50401
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50402
- * See the License for the specific language governing permissions and
50403
- * limitations under the License.
50404
- *
50405
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
50406
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
50407
- * */
50408
- var getDialogType = function getDialogType(mapId, isMultiMap, isDocked) {
50409
- if (isDocked) {
50410
- return "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
50411
- }
50412
- if (isMultiMap) {
50413
- return "".concat(uiTypes.DialogTypes.DrawingTool, "-").concat(mapId);
50414
- }
50415
- return uiTypes.DialogTypes.DrawingTool;
50416
- };
50417
- var DrawingToolConnect = function DrawingToolConnect(_ref) {
50418
- var bounds = _ref.bounds,
50419
- _ref$title = _ref.title,
50420
- title = _ref$title === void 0 ? 'Drawing Toolbox' : _ref$title,
50421
- _ref$showMapIdInTitle = _ref.showMapIdInTitle,
50422
- showMapIdInTitle = _ref$showMapIdInTitle === void 0 ? false : _ref$showMapIdInTitle,
50423
- _ref$mapId = _ref.mapId,
50424
- initialMapId = _ref$mapId === void 0 ? null : _ref$mapId,
50425
- _ref$isMultiMap = _ref.isMultiMap,
50426
- isMultiMap = _ref$isMultiMap === void 0 ? false : _ref$isMultiMap,
50427
- _ref$isDocked = _ref.isDocked,
50428
- isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
50429
- _ref$source = _ref.source,
50430
- source = _ref$source === void 0 ? 'app' : _ref$source;
50431
- // const dispatch = useDispatch();
50432
- var dialogType = getDialogType(initialMapId, isMultiMap, isDocked);
50433
- var _useMapDrawContext = useMapDrawContext(),
50434
- deactivateTool = _useMapDrawContext.deactivateTool;
50435
- var activeMapId = useSelector(function (store) {
50436
- return uiSelectors.getDialogMapId(store, dialogType);
50437
- });
50438
- // In case of a docked drawing toolbox or multimap, use the map id that is passed
50439
- // For floating drawingtoolbox, use the currently active, selected mapid
50440
- var mapId = initialMapId || activeMapId;
50441
- var _useSetupDialog = useSetupDialog(dialogType, source),
50442
- dialogOrder = _useSetupDialog.dialogOrder,
50443
- setDialogOrder = _useSetupDialog.setDialogOrder,
50444
- onCloseDialog = _useSetupDialog.onCloseDialog,
50445
- isDialogOpen = _useSetupDialog.isDialogOpen,
50446
- uiSource = _useSetupDialog.uiSource,
50447
- uiIsLoading = _useSetupDialog.uiIsLoading,
50448
- uiError = _useSetupDialog.uiError,
50449
- setFocused = _useSetupDialog.setFocused;
50450
- // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
50451
- // const onToggleDock = (): void => {
50452
- // onCloseDialog();
50453
- // if (isDocked) {
50454
- // // Close docked drawingtool and open the floating drawingtool
50455
- // dispatch(
50456
- // uiActions.setActiveMapIdForDialog({
50457
- // type: uiTypes.DialogTypes.DrawingTool,
50458
- // mapId,
50459
- // setOpen: true,
50460
- // source,
50461
- // }),
50462
- // );
50463
- // } else {
50464
- // // Close the floating drawingtool and open docked drawingtool
50465
- // dispatch(
50466
- // uiActions.setToggleOpenDialog({
50467
- // type: `${uiTypes.DialogTypes.DockedDrawingTool}-${mapId}`,
50468
- // setOpen: true,
50469
- // }),
50470
- // );
50471
- // }
50472
- // };
50473
- var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
50474
- var onClose = function onClose() {
50475
- onCloseDialog();
50476
- deactivateTool();
50477
- };
50478
- return /*#__PURE__*/React.createElement(DrawingTool, {
50479
- bounds: bounds,
50480
- isOpen: isDialogOpen,
50481
- onClose: onClose,
50482
- title: shownTitle,
50483
- onMouseDown: setDialogOrder,
50484
- order: dialogOrder,
50485
- source: uiSource,
50486
- isLoading: uiIsLoading,
50487
- error: uiError,
50488
- // onToggleDock={onToggleDock}
50489
- setFocused: setFocused,
50490
- headerSize: "xs",
50491
- isDocked: isDocked,
50492
- startPosition: {
50493
- top: 120,
50494
- left: 50
50495
- }
50496
- });
50497
- };
50498
-
50499
50383
  var titleStyle = function titleStyle(theme) {
50500
50384
  return {
50501
50385
  position: 'absolute',
@@ -50558,7 +50442,7 @@ var BaseConfigurableMapConnect = function BaseConfigurableMapConnect(_a) {
50558
50442
  children = _a.children,
50559
50443
  props = __rest$1(_a, ["id", "dockedLayerManagerSize", "title", "layers", "dimensions", "shouldAutoUpdate", "shouldAnimate", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "shouldShowDockedLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "shouldDisplayDrawControls", "children"]);
50560
50444
  var dispatch = useDispatch();
50561
- var mapId = React__default.useRef(id || mapStoreUtils.generateMapId()).current;
50445
+ var mapId = React__default.useRef(id || webmapUtils.generateMapId()).current;
50562
50446
  React__default.useEffect(function () {
50563
50447
  var layersWithDefaultBaseLayer = layers.find(function (layer) {
50564
50448
  return layer.layerType === layerTypes.LayerType.baseLayer;
@@ -50968,7 +50852,7 @@ var baseLayer$1 = {
50968
50852
  type: 'twms',
50969
50853
  layerType: layerTypes.LayerType.baseLayer,
50970
50854
  enabled: true,
50971
- id: mapStoreUtils.generateLayerId()
50855
+ id: webmapUtils.generateLayerId()
50972
50856
  };
50973
50857
  // Base Layers List
50974
50858
  var baseLayerOpenStreetMapNL$1 = {
@@ -50980,14 +50864,14 @@ var baseLayerOpenStreetMapNL$1 = {
50980
50864
  };
50981
50865
  var baseLayerArcGisCanvas$1 = {
50982
50866
  service: ArcGisCanvas.url,
50983
- id: mapStoreUtils.generateLayerId(),
50867
+ id: webmapUtils.generateLayerId(),
50984
50868
  name: 'arcGisCanvas',
50985
50869
  type: 'twms',
50986
50870
  enabled: true,
50987
50871
  layerType: layerTypes.LayerType.baseLayer
50988
50872
  };
50989
50873
  var baseLayerWorldMap$1 = {
50990
- id: mapStoreUtils.generateLayerId(),
50874
+ id: webmapUtils.generateLayerId(),
50991
50875
  name: 'WorldMap',
50992
50876
  type: 'twms',
50993
50877
  layerType: layerTypes.LayerType.baseLayer,
@@ -50995,7 +50879,7 @@ var baseLayerWorldMap$1 = {
50995
50879
  };
50996
50880
  var baseLayerHeiGit = {
50997
50881
  service: HeiGit.url,
50998
- id: mapStoreUtils.generateLayerId(),
50882
+ id: webmapUtils.generateLayerId(),
50999
50883
  name: 'osm_auto:all',
51000
50884
  layerType: layerTypes.LayerType.baseLayer
51001
50885
  };
@@ -51007,7 +50891,7 @@ var msgCppLayer = {
51007
50891
  format: 'image/png',
51008
50892
  enabled: true,
51009
50893
  style: 'precip-transparent/nearest',
51010
- id: mapStoreUtils.generateLayerId(),
50894
+ id: webmapUtils.generateLayerId(),
51011
50895
  layerType: layerTypes.LayerType.mapLayer
51012
50896
  };
51013
50897
  // Nederlandse Nationaal Georegister Layers list
@@ -51032,7 +50916,7 @@ var radarLayer$1 = {
51032
50916
  format: 'image/png',
51033
50917
  enabled: true,
51034
50918
  style: 'radar/nearest',
51035
- id: mapStoreUtils.generateLayerId(),
50919
+ id: webmapUtils.generateLayerId(),
51036
50920
  layerType: layerTypes.LayerType.mapLayer
51037
50921
  };
51038
50922
  var radarLayerWithError = {
@@ -51041,77 +50925,77 @@ var radarLayerWithError = {
51041
50925
  format: 'image/png',
51042
50926
  enabled: true,
51043
50927
  style: 'knmiradar/nearest',
51044
- id: mapStoreUtils.generateLayerId(),
50928
+ id: webmapUtils.generateLayerId(),
51045
50929
  layerType: layerTypes.LayerType.mapLayer
51046
50930
  };
51047
50931
  var obsAirTemperature = {
51048
50932
  service: KNMIgeoservicesObs.url,
51049
50933
  name: '10M/ta',
51050
- id: mapStoreUtils.generateLayerId(),
50934
+ id: webmapUtils.generateLayerId(),
51051
50935
  layerType: layerTypes.LayerType.mapLayer
51052
50936
  };
51053
50937
  var obsWind = {
51054
50938
  service: KNMIgeoservicesObs.url,
51055
50939
  name: '10M/wind',
51056
- id: mapStoreUtils.generateLayerId(),
50940
+ id: webmapUtils.generateLayerId(),
51057
50941
  layerType: layerTypes.LayerType.mapLayer
51058
50942
  };
51059
50943
  var obsAirPressureAtSeaLevel = {
51060
50944
  service: KNMIgeoservicesObs.url,
51061
50945
  name: '10M/pp',
51062
- id: mapStoreUtils.generateLayerId(),
50946
+ id: webmapUtils.generateLayerId(),
51063
50947
  layerType: layerTypes.LayerType.mapLayer
51064
50948
  };
51065
50949
  var obsRelativeHumidity = {
51066
50950
  service: KNMIgeoservicesObs.url,
51067
50951
  name: '10M/rh',
51068
- id: mapStoreUtils.generateLayerId(),
50952
+ id: webmapUtils.generateLayerId(),
51069
50953
  layerType: layerTypes.LayerType.mapLayer
51070
50954
  };
51071
50955
  var obsGlobalSolarRadiation = {
51072
50956
  service: KNMIgeoservicesObs.url,
51073
50957
  name: '10M/qg',
51074
- id: mapStoreUtils.generateLayerId(),
50958
+ id: webmapUtils.generateLayerId(),
51075
50959
  layerType: layerTypes.LayerType.mapLayer
51076
50960
  };
51077
50961
  var obsPrecipitationIntensityPWS = {
51078
50962
  service: KNMIgeoservicesObs.url,
51079
50963
  name: '10M/pg',
51080
- id: mapStoreUtils.generateLayerId(),
50964
+ id: webmapUtils.generateLayerId(),
51081
50965
  layerType: layerTypes.LayerType.mapLayer
51082
50966
  };
51083
50967
  var harmonieRelativeHumidityPl = {
51084
50968
  service: KNMIgeoservicesHarmonie.url,
51085
50969
  name: 'relative_humidity__at_pl',
51086
- id: mapStoreUtils.generateLayerId(),
50970
+ id: webmapUtils.generateLayerId(),
51087
50971
  layerType: layerTypes.LayerType.mapLayer,
51088
50972
  enabled: true
51089
50973
  };
51090
50974
  var harmonieWindPl = {
51091
50975
  service: KNMIgeoservicesHarmonie.url,
51092
50976
  name: 'wind__at_pl',
51093
- id: mapStoreUtils.generateLayerId(),
50977
+ id: webmapUtils.generateLayerId(),
51094
50978
  layerType: layerTypes.LayerType.mapLayer,
51095
50979
  enabled: true
51096
50980
  };
51097
50981
  var harmonieAirTemperature = {
51098
50982
  service: KNMIgeoservicesHarmonie.url,
51099
50983
  name: 'air_temperature__at_2m',
51100
- id: mapStoreUtils.generateLayerId(),
50984
+ id: webmapUtils.generateLayerId(),
51101
50985
  layerType: layerTypes.LayerType.mapLayer,
51102
50986
  enabled: true
51103
50987
  };
51104
50988
  var harmoniePrecipitation = {
51105
50989
  service: KNMIgeoservicesHarmonie.url,
51106
50990
  name: 'precipitation_flux',
51107
- id: mapStoreUtils.generateLayerId(),
50991
+ id: webmapUtils.generateLayerId(),
51108
50992
  layerType: layerTypes.LayerType.mapLayer,
51109
50993
  enabled: true
51110
50994
  };
51111
50995
  var harmoniePressure = {
51112
50996
  service: KNMIgeoservicesHarmonie.url,
51113
50997
  name: 'air_pressure_at_sea_level',
51114
- id: mapStoreUtils.generateLayerId(),
50998
+ id: webmapUtils.generateLayerId(),
51115
50999
  layerType: layerTypes.LayerType.mapLayer,
51116
51000
  enabled: true
51117
51001
  };
@@ -51119,14 +51003,14 @@ var harmonieWindFlags = {
51119
51003
  service: KNMIgeoservicesHarmonie.url,
51120
51004
  name: 'wind__at_10m',
51121
51005
  enabled: true,
51122
- id: mapStoreUtils.generateLayerId(),
51006
+ id: webmapUtils.generateLayerId(),
51123
51007
  layerType: layerTypes.LayerType.mapLayer
51124
51008
  };
51125
51009
  var klimaatAtlasTG3 = {
51126
51010
  service: KNMIgeoservicesKlimaatAtlas.url,
51127
51011
  name: 'TG3',
51128
51012
  enabled: true,
51129
- id: mapStoreUtils.generateLayerId(),
51013
+ id: webmapUtils.generateLayerId(),
51130
51014
  layerType: layerTypes.LayerType.mapLayer
51131
51015
  };
51132
51016
  // DWD Layers List
@@ -51136,7 +51020,7 @@ var dwdWarningLayer = {
51136
51020
  format: 'image/png',
51137
51021
  // style: 'warnungen_gemeinden_vereinigt_event_seamless_param',
51138
51022
  enabled: true,
51139
- id: mapStoreUtils.generateLayerId(),
51023
+ id: webmapUtils.generateLayerId(),
51140
51024
  layerType: layerTypes.LayerType.mapLayer
51141
51025
  };
51142
51026
  var dwdRadarLayer = {
@@ -51144,7 +51028,7 @@ var dwdRadarLayer = {
51144
51028
  name: 'WX-Produkt',
51145
51029
  format: 'image/png',
51146
51030
  enabled: true,
51147
- id: mapStoreUtils.generateLayerId(),
51031
+ id: webmapUtils.generateLayerId(),
51148
51032
  layerType: layerTypes.LayerType.mapLayer
51149
51033
  };
51150
51034
  // this needs authentication to work
@@ -51154,7 +51038,7 @@ var dwdObservationsWetterLayer = {
51154
51038
  style: 'Wetter_Symbole',
51155
51039
  format: 'image/png',
51156
51040
  enabled: true,
51157
- id: mapStoreUtils.generateLayerId(),
51041
+ id: webmapUtils.generateLayerId(),
51158
51042
  layerType: layerTypes.LayerType.mapLayer
51159
51043
  // headers: [{ name: 'Authorization', value: 'Basic ...' }]
51160
51044
  };
@@ -51165,7 +51049,7 @@ var dwdObservationsWetterLayerWithHeader = {
51165
51049
  style: 'Wetter_Symbole',
51166
51050
  format: 'image/png',
51167
51051
  enabled: true,
51168
- id: mapStoreUtils.generateLayerId(),
51052
+ id: webmapUtils.generateLayerId(),
51169
51053
  layerType: layerTypes.LayerType.mapLayer,
51170
51054
  headers: [{
51171
51055
  name: 'authorization',
@@ -51179,7 +51063,7 @@ var dwdObservationsWindLayer = {
51179
51063
  style: 'Wetter_Wind',
51180
51064
  format: 'image/png',
51181
51065
  enabled: true,
51182
- id: mapStoreUtils.generateLayerId(),
51066
+ id: webmapUtils.generateLayerId(),
51183
51067
  layerType: layerTypes.LayerType.mapLayer
51184
51068
  };
51185
51069
  // FMI open wms Layers List
@@ -51188,7 +51072,7 @@ var FMITemp = {
51188
51072
  name: 'temperature-forecast',
51189
51073
  format: 'image/png',
51190
51074
  enabled: true,
51191
- id: mapStoreUtils.generateLayerId(),
51075
+ id: webmapUtils.generateLayerId(),
51192
51076
  layerType: layerTypes.LayerType.mapLayer
51193
51077
  };
51194
51078
  // Met Norway Layers List
@@ -51197,7 +51081,7 @@ var MetNoTemp = {
51197
51081
  name: 'thredds_meps_latest_wind',
51198
51082
  format: 'image/png',
51199
51083
  enabled: true,
51200
- id: mapStoreUtils.generateLayerId(),
51084
+ id: webmapUtils.generateLayerId(),
51201
51085
  layerType: layerTypes.LayerType.mapLayer
51202
51086
  };
51203
51087
  var metNorwayWind1 = {
@@ -51205,7 +51089,7 @@ var metNorwayWind1 = {
51205
51089
  name: 'thredds_meps_latest_wind',
51206
51090
  format: 'image/png',
51207
51091
  enabled: true,
51208
- id: mapStoreUtils.generateLayerId(),
51092
+ id: webmapUtils.generateLayerId(),
51209
51093
  layerType: layerTypes.LayerType.mapLayer
51210
51094
  };
51211
51095
  var metNorwayWind2 = {
@@ -51213,7 +51097,7 @@ var metNorwayWind2 = {
51213
51097
  name: 'thredds_aromearctic_extracted_t',
51214
51098
  format: 'image/png',
51215
51099
  enabled: true,
51216
- id: mapStoreUtils.generateLayerId(),
51100
+ id: webmapUtils.generateLayerId(),
51217
51101
  layerType: layerTypes.LayerType.mapLayer
51218
51102
  };
51219
51103
  var metNorwayWind3 = {
@@ -51221,7 +51105,7 @@ var metNorwayWind3 = {
51221
51105
  name: 'thredds_nk800_temperature',
51222
51106
  format: 'image/png',
51223
51107
  enabled: true,
51224
- id: mapStoreUtils.generateLayerId(),
51108
+ id: webmapUtils.generateLayerId(),
51225
51109
  layerType: layerTypes.LayerType.mapLayer
51226
51110
  };
51227
51111
  var metNorwayLatestT = {
@@ -51229,7 +51113,7 @@ var metNorwayLatestT = {
51229
51113
  name: 'thredds_meps_latest_t',
51230
51114
  format: 'image/png',
51231
51115
  enabled: true,
51232
- id: mapStoreUtils.generateLayerId(),
51116
+ id: webmapUtils.generateLayerId(),
51233
51117
  layerType: layerTypes.LayerType.mapLayer
51234
51118
  };
51235
51119
  var metNorwaySalinaty = {
@@ -51237,49 +51121,49 @@ var metNorwaySalinaty = {
51237
51121
  name: 'thredds_barents_2_5km_1h_salinity',
51238
51122
  format: 'image/png',
51239
51123
  enabled: true,
51240
- id: mapStoreUtils.generateLayerId(),
51124
+ id: webmapUtils.generateLayerId(),
51241
51125
  layerType: layerTypes.LayerType.mapLayer
51242
51126
  };
51243
51127
  var msgFesEUMETSAT = {
51244
51128
  service: EUMETSAT.url,
51245
51129
  name: 'msg_fes:rgb_eview',
51246
51130
  enabled: true,
51247
- id: mapStoreUtils.generateLayerId(),
51131
+ id: webmapUtils.generateLayerId(),
51248
51132
  layerType: layerTypes.LayerType.mapLayer
51249
51133
  };
51250
51134
  var msgNaturalenhncdEUMETSAT = {
51251
51135
  service: eumetviewEUMETSAT.url,
51252
51136
  name: 'meteosat:msg_naturalenhncd',
51253
51137
  enabled: true,
51254
- id: mapStoreUtils.generateLayerId(),
51138
+ id: webmapUtils.generateLayerId(),
51255
51139
  layerType: layerTypes.LayerType.mapLayer
51256
51140
  };
51257
51141
  var msgAshEUMETSAT = {
51258
51142
  service: eumetviewEUMETSAT.url,
51259
51143
  name: 'meteosat:msg_ash',
51260
51144
  enabled: true,
51261
- id: mapStoreUtils.generateLayerId(),
51145
+ id: webmapUtils.generateLayerId(),
51262
51146
  layerType: layerTypes.LayerType.mapLayer
51263
51147
  };
51264
51148
  var msgCthEUMETSAT = {
51265
51149
  service: eumetviewEUMETSAT.url,
51266
51150
  name: 'meteosat:msg_cth',
51267
51151
  enabled: true,
51268
- id: mapStoreUtils.generateLayerId(),
51152
+ id: webmapUtils.generateLayerId(),
51269
51153
  layerType: layerTypes.LayerType.mapLayer
51270
51154
  };
51271
51155
  var msgFogEUMETSAT = {
51272
51156
  service: eumetviewEUMETSAT.url,
51273
51157
  name: 'meteosat:msg_fog',
51274
51158
  enabled: true,
51275
- id: mapStoreUtils.generateLayerId(),
51159
+ id: webmapUtils.generateLayerId(),
51276
51160
  layerType: layerTypes.LayerType.mapLayer
51277
51161
  };
51278
51162
  var msgNaturalEUMETSAT = {
51279
51163
  service: eumetviewEUMETSAT.url,
51280
51164
  name: 'meteosat:msg_natural',
51281
51165
  enabled: true,
51282
- id: mapStoreUtils.generateLayerId(),
51166
+ id: webmapUtils.generateLayerId(),
51283
51167
  layerType: layerTypes.LayerType.mapLayer
51284
51168
  };
51285
51169
 
@@ -51490,12 +51374,16 @@ var HarmonieTempAndPrecipPreset = function HarmonieTempAndPrecipPreset(_ref) {
51490
51374
  /* Make the preset */
51491
51375
  var nCols = 5;
51492
51376
  /* Add the harmonie air temperature layers with the different referencetimes */
51493
- var mapsTemperature = _toConsumableArray(Array(nCols)).map(function (_, index) {
51377
+ var mapsTemperature = Array.from({
51378
+ length: nCols
51379
+ }, function (_, index) {
51494
51380
  var refTime = referenceTimes[referenceTimes.length - nCols + index];
51495
51381
  return makeMapPreset(refTime, "harm_air".concat(index), layers.topRow, layers.topRowSyncGroups, index);
51496
51382
  });
51497
51383
  /* Add the harmonie precipitation layers with the different referencetimes */
51498
- var mapsPrecipitation = _toConsumableArray(Array(nCols)).map(function (_, index) {
51384
+ var mapsPrecipitation = Array.from({
51385
+ length: nCols
51386
+ }, function (_, index) {
51499
51387
  var refTime = referenceTimes[referenceTimes.length - nCols + index];
51500
51388
  return makeMapPreset(refTime, "harm_precip".concat(index), layers.bottomRow, layers.bottomRowSyncGroups, index);
51501
51389
  });
@@ -51994,6 +51882,18 @@ var getSelectedTimeFromPx = function getSelectedTimeFromPx(startTime, endTime, s
51994
51882
  var selectedTime = selectedTimeX + startDateX;
51995
51883
  return selectedTime;
51996
51884
  };
51885
+ var getNearestSelectableTime = function getNearestSelectableTime(timeStep, startTime, endTime, x, width, currentTime) {
51886
+ var observedTimeStepSeconds = timeStep[0];
51887
+ var forecastTimeStepSeconds = timeStep[1];
51888
+ var hoveredTime = getSelectedTimeFromPx(startTime, endTime, x, width);
51889
+ var timeStepSeconds = hoveredTime >= currentTime ? forecastTimeStepSeconds : observedTimeStepSeconds;
51890
+ var lastObservedTime = floorLocalSeconds(currentTime, observedTimeStepSeconds);
51891
+ var firstForecastTime = floorLocalSeconds(currentTime, forecastTimeStepSeconds) + forecastTimeStepSeconds;
51892
+ var isBetweenObservedAndForecast = hoveredTime >= lastObservedTime && hoveredTime < firstForecastTime;
51893
+ var roundedCurrentTime = hoveredTime >= (lastObservedTime + firstForecastTime) / 2 ? firstForecastTime : lastObservedTime;
51894
+ var result = isBetweenObservedAndForecast ? roundedCurrentTime : floorLocalSeconds(hoveredTime + timeStepSeconds / 2, timeStepSeconds);
51895
+ return result;
51896
+ };
51997
51897
  var floorLocalSeconds = function floorLocalSeconds(selectedTimeSeconds, timeStepSeconds, timeZoneOffsetSeconds) {
51998
51898
  var localTimeZoneOffset = timeZoneOffsetSeconds !== null && timeZoneOffsetSeconds !== void 0 ? timeZoneOffsetSeconds : new Date().getTimezoneOffset() * 60;
51999
51899
  var unFlooredTimeSteps = (selectedTimeSeconds - localTimeZoneOffset) / timeStepSeconds;
@@ -52510,6 +52410,67 @@ var TimeSliderDraggableNeedle = function TimeSliderDraggableNeedle(_ref3) {
52510
52410
  })))));
52511
52411
  };
52512
52412
 
52413
+ var HOVER_NEEDLE_WIDTH = 1;
52414
+ var DEFAULT_OPACITY = 0.5;
52415
+ var TimeSliderClickableTimeline = function TimeSliderClickableTimeline(_ref) {
52416
+ var _ref$currentTime = _ref.currentTime,
52417
+ currentTime = _ref$currentTime === void 0 ? Date.now() * MILLISECOND_TO_SECOND : _ref$currentTime,
52418
+ endTime = _ref.endTime,
52419
+ _ref$opacity = _ref.opacity,
52420
+ opacity = _ref$opacity === void 0 ? DEFAULT_OPACITY : _ref$opacity,
52421
+ setSelectedTime = _ref.setSelectedTime,
52422
+ startTime = _ref.startTime,
52423
+ timeStep = _ref.timeStep,
52424
+ width = _ref.width;
52425
+ var _React$useState = React__default.useState(false),
52426
+ _React$useState2 = _slicedToArray(_React$useState, 2),
52427
+ isShown = _React$useState2[0],
52428
+ setIsShown = _React$useState2[1];
52429
+ var _React$useState3 = React__default.useState(0),
52430
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
52431
+ mouseX = _React$useState4[0],
52432
+ setMouseX = _React$useState4[1];
52433
+ var _useTheme = useTheme$2(),
52434
+ timeSliderLite = _useTheme.palette.geowebColors.timeSliderLite;
52435
+ var needleSuggestion = getNearestSelectableTime(timeStep, startTime, endTime, mouseX, width, currentTime);
52436
+ var x = getSelectedTimePx(startTime, endTime, needleSuggestion, width);
52437
+ if (isNaN(x)) {
52438
+ return null;
52439
+ }
52440
+ return /*#__PURE__*/React__default.createElement("svg", {
52441
+ "data-testid": "TimeSliderLite-clickableTimeline",
52442
+ style: {
52443
+ position: 'absolute',
52444
+ width: '100%',
52445
+ height: '100%',
52446
+ cursor: 'pointer'
52447
+ },
52448
+ onClick: function onClick() {
52449
+ return setSelectedTime(needleSuggestion);
52450
+ },
52451
+ onMouseEnter: function onMouseEnter() {
52452
+ return setIsShown(true);
52453
+ },
52454
+ onMouseLeave: function onMouseLeave() {
52455
+ return setIsShown(false);
52456
+ },
52457
+ onMouseMove: function onMouseMove(event) {
52458
+ isShown && setMouseX(event.nativeEvent.offsetX);
52459
+ }
52460
+ }, /*#__PURE__*/React__default.createElement("line", {
52461
+ opacity: isShown ? opacity : 0,
52462
+ x1: x,
52463
+ y1: "0",
52464
+ x2: x,
52465
+ y2: "100%",
52466
+ stroke: timeSliderLite.timeline.stroke,
52467
+ strokeWidth: HOVER_NEEDLE_WIDTH,
52468
+ style: {
52469
+ transition: 'opacity 0.2s ease-in-out'
52470
+ }
52471
+ }));
52472
+ };
52473
+
52513
52474
  var TimeSliderLiteBackground = function TimeSliderLiteBackground(_ref) {
52514
52475
  var height = _ref.height,
52515
52476
  draggableTimeStamp = _ref.draggableTimeStamp,
@@ -52518,6 +52479,7 @@ var TimeSliderLiteBackground = function TimeSliderLiteBackground(_ref) {
52518
52479
  endTime = _ref.endTime,
52519
52480
  _ref$currentTime = _ref.currentTime,
52520
52481
  currentTime = _ref$currentTime === void 0 ? Date.now() * MILLISECOND_TO_SECOND : _ref$currentTime,
52482
+ mouseHoverNeedleOpacity = _ref.mouseHoverNeedleOpacity,
52521
52483
  needleWidth = _ref.needleWidth,
52522
52484
  needleDragAreaWidth = _ref.needleDragAreaWidth,
52523
52485
  needleLabelZIndex = _ref.needleLabelZIndex,
@@ -52563,6 +52525,14 @@ var TimeSliderLiteBackground = function TimeSliderLiteBackground(_ref) {
52563
52525
  endTime: endTime,
52564
52526
  currentTime: currentTime,
52565
52527
  locale: locale
52528
+ }), /*#__PURE__*/React__default.createElement(TimeSliderClickableTimeline, {
52529
+ currentTime: currentTime,
52530
+ opacity: mouseHoverNeedleOpacity,
52531
+ width: areaWidth,
52532
+ startTime: startTime,
52533
+ endTime: endTime,
52534
+ timeStep: timeStep,
52535
+ setSelectedTime: setSelectedTime
52566
52536
  }), drawNeedle && /*#__PURE__*/React__default.createElement(TimeSliderDraggableNeedle, {
52567
52537
  needleWidth: needleWidth,
52568
52538
  draggableLabel: draggableTimeStamp,
@@ -52738,6 +52708,7 @@ var TimeSliderLite = function TimeSliderLite(_ref) {
52738
52708
  locale = _ref$locale === void 0 ? TIME_SLIDER_LITE_DEFAULT_LOCALE : _ref$locale,
52739
52709
  mapId = _ref.mapId,
52740
52710
  menuOpen = _ref.menuOpen,
52711
+ mouseHoverNeedleOpacity = _ref.mouseHoverNeedleOpacity,
52741
52712
  overrideAnimation = _ref.overrideAnimation,
52742
52713
  onToggleAnimation = _ref.onToggleAnimation,
52743
52714
  onToggleMenu = _ref.onToggleMenu,
@@ -52875,6 +52846,7 @@ var TimeSliderLite = function TimeSliderLite(_ref) {
52875
52846
  startTime: roundedStartTime,
52876
52847
  locale: locale,
52877
52848
  endTime: roundedEndTime,
52849
+ mouseHoverNeedleOpacity: mouseHoverNeedleOpacity,
52878
52850
  needleWidth: needleWidth,
52879
52851
  needleDragAreaWidth: needleDragAreaWidth,
52880
52852
  needleLabelZIndex: needleLabelZIndex,
@@ -53782,4 +53754,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
53782
53754
  }, "Identifier: ", selectedFeatureProperties.identifier)));
53783
53755
  };
53784
53756
 
53785
- export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DRAWMODE, EDITMODE, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControlButton, MapControls, MapDrawContainer, MapDrawToolProvider, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, addFeatureProperties, checkHoverFeatures, componentsLookUp, createInterSections, defaultBbox, defaultBox, defaultConfigurations, defaultDelete, defaultIntersectionStyleProperties, defaultPoint, defaultPolygon, defaultStyleProperties, distance, drawOptions, emptyGeoJSON, featureBox, featureMultiPoint, featurePoint, featurePolygon, filterMapPresets, filterServices, getDrawFunctionFromStore, getFeatureCollection, getGeoJson, intersectGeoJSONS, isGeoJSONFeatureCreatedByTool, lineString, publicLayers, publicServices, registerDrawFunction, store, testLayers, timeSliderUtils, useFetchServices, useMapDrawContext, useMapDrawTool, useSetupDialog };
53757
+ export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DRAWMODE, DrawingToolConnect, DrawingToolMapButtonConnect, EDITMODE, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControlButton, MapControls, MapDrawContainer, MapDrawToolProvider, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, addFeatureProperties, checkHoverFeatures, componentsLookUp, createInterSections, defaultBbox, defaultBox, defaultConfigurations, defaultDelete, defaultIntersectionStyleProperties, defaultPoint, defaultPolygon, defaultStyleProperties, distance, drawOptions, emptyGeoJSON, featureBox, featureMultiPoint, featurePoint, featurePolygon, filterMapPresets, filterServices, getDrawFunctionFromStore, getFeatureCollection, getGeoJson, intersectGeoJSONS, isGeoJSONFeatureCreatedByTool, lineString, publicLayers, publicServices, registerDrawFunction, store, testLayers, timeSliderUtils, useFetchServices, useMapDrawContext, useMapDrawTool, useSetupDialog };