@opengeoweb/core 4.19.1 → 4.20.0

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.
Files changed (44) hide show
  1. package/index.esm.js +1734 -810
  2. package/index.umd.js +1820 -872
  3. package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +1 -1
  4. package/lib/components/LayerManager/DockedLayerManagerConnect.d.ts +2 -1
  5. package/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +1 -0
  6. package/lib/components/LayerManager/LayerManager.d.ts +1 -1
  7. package/lib/components/LayerManager/LayerManagerConnect.d.ts +2 -1
  8. package/lib/components/LayerManager/LayerManagerHeaderOptions.d.ts +21 -0
  9. package/lib/components/LayerManager/LayerManagerHeaderOptionsConnect.d.ts +2 -1
  10. package/lib/components/LayerManager/LayerManagerUtils.d.ts +20 -1
  11. package/lib/components/LayerManager/index.d.ts +1 -0
  12. package/lib/components/MapControls/MapControlButton.d.ts +2 -3
  13. package/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +1 -2
  14. package/lib/components/TimeSliderLite/TimeSliderLite.d.ts +35 -0
  15. package/lib/components/TimeSliderLite/TimeSliderLite.spec.d.ts +1 -0
  16. package/lib/components/TimeSliderLite/TimeSliderLite.stories.d.ts +9 -0
  17. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderDraggableNeedle.d.ts +20 -0
  18. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderDraggableNeedle.spec.d.ts +1 -0
  19. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackground.d.ts +17 -0
  20. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackgroundSvg.d.ts +12 -0
  21. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackgroundSvg.spec.d.ts +1 -0
  22. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/ControlButtonGroup/ControlButtonGroup.d.ts +8 -0
  23. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/HideButton/HideButton.d.ts +9 -0
  24. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/MenuButton/MenuButton.d.ts +9 -0
  25. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/PlayButton/PlayButton.d.ts +10 -0
  26. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/StepButton/StepButton.d.ts +10 -0
  27. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/TimeSliderLiteButtonUtils.d.ts +3 -0
  28. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.d.ts +12 -0
  29. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.spec.d.ts +1 -0
  30. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.stories.d.ts +9 -0
  31. package/lib/components/TimeSliderLite/index.d.ts +3 -0
  32. package/lib/components/TimeSliderLite/timeSliderLiteUtils.d.ts +47 -0
  33. package/lib/components/TimeSliderLite/timeSliderLiteUtils.spec.d.ts +1 -0
  34. package/lib/index.d.ts +5 -4
  35. package/lib/store/generic/synchronizationGroups/selectors.d.ts +2 -1
  36. package/lib/store/generic/synchronizationGroups/types.d.ts +4 -4
  37. package/lib/store/mapStore/layers/reducer.d.ts +2 -2
  38. package/lib/store/mapStore/layers/types.d.ts +0 -2
  39. package/lib/store/mapStore/map/index.d.ts +1 -1
  40. package/lib/store/mapStore/utils/helpers.d.ts +1 -0
  41. package/lib/store/ui/index.d.ts +1 -1
  42. package/lib/utils/sanitizeHTML.d.ts +3 -0
  43. package/lib/utils/sanitizeHTML.spec.d.ts +1 -0
  44. package/package.json +10 -9
package/index.esm.js CHANGED
@@ -1,14 +1,14 @@
1
- import { createAction, createSlice, createSelector, createEntityAdapter } from '@reduxjs/toolkit';
1
+ import { createSlice, createSelector, createAction, createEntityAdapter } from '@reduxjs/toolkit';
2
+ import _, { isEqual, debounce, compact, escapeRegExp, groupBy, throttle, range } from 'lodash';
2
3
  import produce$1, { current, produce } from 'immer';
3
4
  import moment from 'moment';
4
5
  import * as React from 'react';
5
- import React__default, { Component, useRef, useState, useEffect, useCallback } from 'react';
6
- import _, { debounce, isEqual, compact, escapeRegExp, groupBy, throttle, range } from 'lodash';
6
+ import React__default, { Component, useRef, useState, useEffect, useCallback, useLayoutEffect } from 'react';
7
7
  import { takeLatest, put, select, call, takeEvery, all, delay } from 'redux-saga/effects';
8
8
  import { connect, useDispatch, useSelector, Provider } from 'react-redux';
9
- import { CustomTooltip, ToolButton, ToolContainerDraggable, CustomIconButton, TooltipSelect, AlertIcon, useControlledTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, CustomAccordion, AlertBanner, calculateDialogSizeAndPosition, CustomToggleButton, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
9
+ import { CustomIconButton, CustomTooltip, ToolContainerDraggable, TooltipSelect, AlertIcon, useControlledTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, CustomAccordion, AlertBanner, calculateDialogSizeAndPosition, CustomToggleButton, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
10
10
  import { Pause, Play, 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, StepForward, StepBackward, dragHandlePath, ChevronDown, ChevronUp, List as List$1, ChevronRight, ChevronLeft, Resize, ExitDomain, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
11
- import { Paper, Box, Typography, Grid, MenuItem, Button, Popper, ListItemText, ListItemIcon, FormControl, InputLabel, List, ListItemButton, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, LinearProgress, Backdrop, ListItem, ListItemSecondaryAction, Checkbox, Switch, styled, Slider, Menu, useTheme, Snackbar } from '@mui/material';
11
+ import { Paper, Box, Typography, Grid, MenuItem, useTheme, Button, Popper, ListItemText, ListItemIcon, FormControl, InputLabel, List, ListItemButton, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, LinearProgress, Backdrop, ListItem, ListItemSecondaryAction, Checkbox, Switch, styled, Slider, Menu, Tooltip, IconButton, ButtonGroup, Divider, Snackbar } from '@mui/material';
12
12
  import { legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, WMGetServiceFromStore, LayerType as LayerType$1, clearImageCache, getMapImageStore, WMBBOX, debug, DebugType, WMJSMap, WMLayer } from '@opengeoweb/webmap';
13
13
  import { ReactSortable } from 'react-sortablejs';
14
14
  import Sortable from 'sortablejs';
@@ -28,10 +28,224 @@ import Draggable from 'react-draggable';
28
28
  import { Resizable } from 're-resizable';
29
29
  import axios from 'axios';
30
30
  import { useDebounce } from '@opengeoweb/api';
31
+ import * as DOMPurify from 'dompurify';
31
32
  import { createStore } from '@redux-eggs/redux-toolkit';
32
33
  import { getSagaExtension } from '@redux-eggs/saga-extension';
33
34
  import { useNavigate } from 'react-router-dom';
34
35
 
36
+ /* *
37
+ * Licensed under the Apache License, Version 2.0 (the "License");
38
+ * you may not use this file except in compliance with the License.
39
+ * You may obtain a copy of the License at
40
+ *
41
+ * http://www.apache.org/licenses/LICENSE-2.0
42
+ *
43
+ * Unless required by applicable law or agreed to in writing, software
44
+ * distributed under the License is distributed on an "AS IS" BASIS,
45
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
46
+ * See the License for the specific language governing permissions and
47
+ * limitations under the License.
48
+ *
49
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
50
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
51
+ * */
52
+ var initialState$8 = {
53
+ byId: {},
54
+ allIds: []
55
+ };
56
+ var slice$8 = createSlice({
57
+ initialState: initialState$8,
58
+ name: 'serviceReducer',
59
+ reducers: {
60
+ serviceSetLayers: function serviceSetLayers(draft, action) {
61
+ var id = action.payload.id;
62
+ draft.byId[id] = Object.assign({}, action.payload);
63
+
64
+ if (!draft.allIds.includes(id)) {
65
+ draft.allIds.push(id);
66
+ }
67
+ },
68
+ mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
69
+ var foundServiceIndex = draft.allIds.findIndex(function (id) {
70
+ return draft.byId[id].serviceUrl === action.payload.serviceUrl;
71
+ });
72
+
73
+ if (foundServiceIndex !== -1) {
74
+ var serviceId = draft.allIds[foundServiceIndex];
75
+ draft.allIds = draft.allIds.filter(function (id) {
76
+ return id !== serviceId;
77
+ });
78
+ delete draft.byId[serviceId];
79
+ }
80
+ },
81
+ fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
82
+ draft, // eslint-disable-next-line no-unused-vars
83
+ action) {}
84
+ }
85
+ });
86
+ var reducer$8 = slice$8.reducer;
87
+ var serviceActions = slice$8.actions;
88
+
89
+ /* *
90
+ * Licensed under the Apache License, Version 2.0 (the "License");
91
+ * you may not use this file except in compliance with the License.
92
+ * You may obtain a copy of the License at
93
+ *
94
+ * http://www.apache.org/licenses/LICENSE-2.0
95
+ *
96
+ * Unless required by applicable law or agreed to in writing, software
97
+ * distributed under the License is distributed on an "AS IS" BASIS,
98
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
+ * See the License for the specific language governing permissions and
100
+ * limitations under the License.
101
+ *
102
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
103
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
104
+ * */
105
+ var selectorMemoizationOptions = {
106
+ memoizeOptions: {
107
+ maxSize: 1000,
108
+ resultEqualityCheck: isEqual
109
+ }
110
+ };
111
+ var isUserAddedService = function isUserAddedService(scope) {
112
+ return scope === 'user';
113
+ };
114
+
115
+ /* *
116
+ * Licensed under the Apache License, Version 2.0 (the "License");
117
+ * you may not use this file except in compliance with the License.
118
+ * You may obtain a copy of the License at
119
+ *
120
+ * http://www.apache.org/licenses/LICENSE-2.0
121
+ *
122
+ * Unless required by applicable law or agreed to in writing, software
123
+ * distributed under the License is distributed on an "AS IS" BASIS,
124
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125
+ * See the License for the specific language governing permissions and
126
+ * limitations under the License.
127
+ *
128
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
129
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
130
+ * */
131
+
132
+ var servicesStore = function servicesStore(store) {
133
+ return store && store.services ? store.services : null;
134
+ };
135
+ /**
136
+ * Retrieves all serviceIds
137
+ *
138
+ * Example: serviceIds = getServiceIds(store)
139
+ * @param {object} store store: object - object from which the service state will be extracted
140
+ * @returns {array} returnType: array - an array of all serviceIds
141
+ */
142
+
143
+
144
+ var getServiceIds = createSelector(servicesStore, function (serviceState) {
145
+ return serviceState ? serviceState.allIds : [];
146
+ }, selectorMemoizationOptions);
147
+ /**
148
+ * Gets map services
149
+ *
150
+ * Example: services = getServices(store)
151
+ * @param {object} store store: object - Store object
152
+ * @returns {object} returnType: ServiceState
153
+ */
154
+
155
+ var getServices = createSelector(servicesStore, function (store) {
156
+ return store ? store.byId : {};
157
+ }, selectorMemoizationOptions);
158
+ /**
159
+ * Gets the service object by its url
160
+ *
161
+ * Example: service = getServiceByName(store, 'serviceName')
162
+ * @param {object} store store: object - Store object
163
+ * @returns {ReduxService} returnType: Service
164
+ */
165
+
166
+ var getServiceByName = createSelector([servicesStore, function (state, serviceUrl) {
167
+ return serviceUrl;
168
+ }], function (serviceState, serviceUrl) {
169
+ var foundServiceIndex = serviceState.allIds.findIndex(function (id) {
170
+ return serviceState.byId[id].serviceUrl === serviceUrl;
171
+ });
172
+ /* Add the service based on a url */
173
+
174
+ var id = foundServiceIndex !== -1 ? serviceState.allIds[foundServiceIndex] : null;
175
+
176
+ if (serviceState && serviceState.byId && serviceState.byId[id]) {
177
+ return serviceState.byId[id];
178
+ }
179
+
180
+ return null;
181
+ }, selectorMemoizationOptions);
182
+ /**
183
+ * Gets the layer from the store using the serviceUrl and layerName
184
+ *
185
+ * Example: layers = getLayersFromService(store, 'https://geoservices.knmi.nl/...')
186
+ * @param {object} store store: object - object from which the layers state will be extracted
187
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
188
+ * @returns {array} returnType: ServiceLayer[] - All layers within the service object.
189
+ */
190
+
191
+ var getLayersFromService$1 = createSelector(getServiceByName, function (service) {
192
+ return service && service.layers || null;
193
+ }, selectorMemoizationOptions);
194
+ /**
195
+ * Gets the layer from the store using the serviceUrl and layerName
196
+ *
197
+ * Example: layer = getLayerFromService(store, 'https://geoservices.knmi.nl/...', 'radar')
198
+ * @param {object} store store: object - The application store
199
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
200
+ * @param {string} layerName layerName: string - Name of the layer in the service
201
+ * @returns {ServiceLayer} returnType: ServiceLayer - The layer from the service object.
202
+ */
203
+
204
+ var getLayerFromService = createSelector(function (store, serviceUrl) {
205
+ return getLayersFromService$1(store, serviceUrl);
206
+ }, function (store, serviceUrl) {
207
+ return serviceUrl;
208
+ }, function (store, serviceUrl, layerName) {
209
+ return layerName;
210
+ }, function (layers, serviceUrl, layerName) {
211
+ if (!layers) {
212
+ return null;
213
+ }
214
+
215
+ var index = layers.findIndex(function (serviceLayer) {
216
+ return serviceLayer.name === layerName;
217
+ });
218
+
219
+ if (index === -1) {
220
+ return null;
221
+ }
222
+
223
+ return layers[index];
224
+ }, selectorMemoizationOptions);
225
+ /**
226
+ * Gets the layers stylelist from the servicestore using the serviceUrl and layerName
227
+ *
228
+ * Example: layerStyles = getLayerStyles(store, layerService, layerName);
229
+ * @param {object} store store: object - store from which the layers state will be extracted
230
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
231
+ * @param {string} layerName layerName: string - Name of the layer in the service
232
+ * @returns {array} returnType: Style[] - array containing layer styles
233
+ */
234
+
235
+ var getLayerStyles$1 = createSelector(getLayerFromService, function (layer) {
236
+ return layer && layer.styles ? layer.styles : [];
237
+ }, selectorMemoizationOptions);
238
+
239
+ var selectors$5 = /*#__PURE__*/Object.freeze({
240
+ __proto__: null,
241
+ getServiceIds: getServiceIds,
242
+ getServices: getServices,
243
+ getServiceByName: getServiceByName,
244
+ getLayersFromService: getLayersFromService$1,
245
+ getLayerFromService: getLayerFromService,
246
+ getLayerStyles: getLayerStyles$1
247
+ });
248
+
35
249
  function _typeof(obj) {
36
250
  "@babel/helpers - typeof";
37
251
 
@@ -293,141 +507,6 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
293
507
  };
294
508
  }
295
509
 
296
- /*! *****************************************************************************
297
- Copyright (c) Microsoft Corporation.
298
-
299
- Permission to use, copy, modify, and/or distribute this software for any
300
- purpose with or without fee is hereby granted.
301
-
302
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
303
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
304
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
305
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
306
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
307
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
308
- PERFORMANCE OF THIS SOFTWARE.
309
- ***************************************************************************** */
310
-
311
- function __rest(s, e) {
312
- var t = {};
313
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
314
- t[p] = s[p];
315
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
316
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
317
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
318
- t[p[i]] = s[p[i]];
319
- }
320
- return t;
321
- }
322
-
323
- function __awaiter(thisArg, _arguments, P, generator) {
324
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
325
- return new (P || (P = Promise))(function (resolve, reject) {
326
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
327
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
328
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
329
- step((generator = generator.apply(thisArg, _arguments || [])).next());
330
- });
331
- }
332
-
333
- /* *
334
- * Licensed under the Apache License, Version 2.0 (the "License");
335
- * you may not use this file except in compliance with the License.
336
- * You may obtain a copy of the License at
337
- *
338
- * http://www.apache.org/licenses/LICENSE-2.0
339
- *
340
- * Unless required by applicable law or agreed to in writing, software
341
- * distributed under the License is distributed on an "AS IS" BASIS,
342
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
343
- * See the License for the specific language governing permissions and
344
- * limitations under the License.
345
- *
346
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
347
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
348
- * */
349
- var LayerType;
350
-
351
- (function (LayerType) {
352
- LayerType["mapLayer"] = "mapLayer";
353
- LayerType["baseLayer"] = "baseLayer";
354
- LayerType["overLayer"] = "overLayer";
355
- })(LayerType || (LayerType = {}));
356
-
357
- var LayerStatus;
358
-
359
- (function (LayerStatus) {
360
- LayerStatus["default"] = "default";
361
- LayerStatus["error"] = "error";
362
- })(LayerStatus || (LayerStatus = {}));
363
-
364
- var LayerActionOrigin;
365
-
366
- (function (LayerActionOrigin) {
367
- LayerActionOrigin["layerManager"] = "layerManager";
368
- LayerActionOrigin["wmsLoader"] = "WMSLayerTreeConnect";
369
- LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
370
- LayerActionOrigin["setLayerDimensionSaga"] = "setLayerDimensionSaga";
371
- LayerActionOrigin["toggleAutoUpdateSaga"] = "toggleAutoUpdateSaga";
372
- LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
373
- })(LayerActionOrigin || (LayerActionOrigin = {}));
374
-
375
- var types$3 = /*#__PURE__*/Object.freeze({
376
- __proto__: null,
377
- get LayerType () { return LayerType; },
378
- get LayerStatus () { return LayerStatus; },
379
- get LayerActionOrigin () { return LayerActionOrigin; }
380
- });
381
-
382
- /* *
383
- * Licensed under the Apache License, Version 2.0 (the "License");
384
- * you may not use this file except in compliance with the License.
385
- * You may obtain a copy of the License at
386
- *
387
- * http://www.apache.org/licenses/LICENSE-2.0
388
- *
389
- * Unless required by applicable law or agreed to in writing, software
390
- * distributed under the License is distributed on an "AS IS" BASIS,
391
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
392
- * See the License for the specific language governing permissions and
393
- * limitations under the License.
394
- *
395
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
396
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
397
- * */
398
- var Scale;
399
-
400
- (function (Scale) {
401
- Scale[Scale["Minutes5"] = 0] = "Minutes5";
402
- Scale[Scale["Hour"] = 1] = "Hour";
403
- Scale[Scale["Hours3"] = 2] = "Hours3";
404
- Scale[Scale["Hours6"] = 3] = "Hours6";
405
- Scale[Scale["Day"] = 4] = "Day";
406
- Scale[Scale["Week"] = 5] = "Week";
407
- Scale[Scale["Month"] = 6] = "Month";
408
- Scale[Scale["Year"] = 7] = "Year";
409
- Scale[Scale["DataScale"] = 8] = "DataScale";
410
- })(Scale || (Scale = {}));
411
-
412
- var AnimationLength;
413
-
414
- (function (AnimationLength) {
415
- AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
416
- AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
417
- AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
418
- AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
419
- AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
420
- AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
421
- AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
422
- AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
423
- })(AnimationLength || (AnimationLength = {}));
424
-
425
- var MapActionOrigin;
426
-
427
- (function (MapActionOrigin) {
428
- MapActionOrigin["map"] = "map";
429
- })(MapActionOrigin || (MapActionOrigin = {}));
430
-
431
510
  /* *
432
511
  * Licensed under the Apache License, Version 2.0 (the "License");
433
512
  * you may not use this file except in compliance with the License.
@@ -489,6 +568,16 @@ var unRegisterWMJSLayer = function unRegisterWMJSLayer(layerId) {
489
568
  delete registeredWMLayersForReactLayerId[layerId];
490
569
  }
491
570
  };
571
+ var unRegisterAllWMJSLayersAndMaps = function unRegisterAllWMJSLayersAndMaps() {
572
+ var allLayerIds = Object.values(registeredWMLayersForReactLayerId);
573
+ allLayerIds.forEach(function (layerId) {
574
+ unRegisterWMJSLayer(layerId);
575
+ });
576
+ var allMapIds = Object.values(registeredWMMapForReactMapId);
577
+ allMapIds.forEach(function (mapId) {
578
+ unRegisterWMJSMap(mapId);
579
+ });
580
+ };
492
581
  /**
493
582
  * Map for registering wmlayers with their id's
494
583
  */
@@ -653,6 +742,104 @@ var getLastTimeStepForLayerId = function getLastTimeStepForLayerId(layerId) {
653
742
  return wmjsTimeDim.getLastValue();
654
743
  };
655
744
 
745
+ /* *
746
+ * Licensed under the Apache License, Version 2.0 (the "License");
747
+ * you may not use this file except in compliance with the License.
748
+ * You may obtain a copy of the License at
749
+ *
750
+ * http://www.apache.org/licenses/LICENSE-2.0
751
+ *
752
+ * Unless required by applicable law or agreed to in writing, software
753
+ * distributed under the License is distributed on an "AS IS" BASIS,
754
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
755
+ * See the License for the specific language governing permissions and
756
+ * limitations under the License.
757
+ *
758
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
759
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
760
+ * */
761
+ var Scale;
762
+
763
+ (function (Scale) {
764
+ Scale[Scale["Minutes5"] = 0] = "Minutes5";
765
+ Scale[Scale["Hour"] = 1] = "Hour";
766
+ Scale[Scale["Hours3"] = 2] = "Hours3";
767
+ Scale[Scale["Hours6"] = 3] = "Hours6";
768
+ Scale[Scale["Day"] = 4] = "Day";
769
+ Scale[Scale["Week"] = 5] = "Week";
770
+ Scale[Scale["Month"] = 6] = "Month";
771
+ Scale[Scale["Year"] = 7] = "Year";
772
+ Scale[Scale["DataScale"] = 8] = "DataScale";
773
+ })(Scale || (Scale = {}));
774
+
775
+ var AnimationLength;
776
+
777
+ (function (AnimationLength) {
778
+ AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
779
+ AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
780
+ AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
781
+ AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
782
+ AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
783
+ AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
784
+ AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
785
+ AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
786
+ })(AnimationLength || (AnimationLength = {}));
787
+
788
+ var MapActionOrigin;
789
+
790
+ (function (MapActionOrigin) {
791
+ MapActionOrigin["map"] = "map";
792
+ })(MapActionOrigin || (MapActionOrigin = {}));
793
+
794
+ /* *
795
+ * Licensed under the Apache License, Version 2.0 (the "License");
796
+ * you may not use this file except in compliance with the License.
797
+ * You may obtain a copy of the License at
798
+ *
799
+ * http://www.apache.org/licenses/LICENSE-2.0
800
+ *
801
+ * Unless required by applicable law or agreed to in writing, software
802
+ * distributed under the License is distributed on an "AS IS" BASIS,
803
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
804
+ * See the License for the specific language governing permissions and
805
+ * limitations under the License.
806
+ *
807
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
808
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
809
+ * */
810
+ var LayerType;
811
+
812
+ (function (LayerType) {
813
+ LayerType["mapLayer"] = "mapLayer";
814
+ LayerType["baseLayer"] = "baseLayer";
815
+ LayerType["overLayer"] = "overLayer";
816
+ })(LayerType || (LayerType = {}));
817
+
818
+ var LayerStatus;
819
+
820
+ (function (LayerStatus) {
821
+ LayerStatus["default"] = "default";
822
+ LayerStatus["error"] = "error";
823
+ })(LayerStatus || (LayerStatus = {}));
824
+
825
+ var LayerActionOrigin;
826
+
827
+ (function (LayerActionOrigin) {
828
+ LayerActionOrigin["layerManager"] = "layerManager";
829
+ LayerActionOrigin["wmsLoader"] = "WMSLayerTreeConnect";
830
+ LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
831
+ LayerActionOrigin["setLayerDimensionSaga"] = "setLayerDimensionSaga";
832
+ LayerActionOrigin["toggleAutoUpdateSaga"] = "toggleAutoUpdateSaga";
833
+ LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
834
+ })(LayerActionOrigin || (LayerActionOrigin = {}));
835
+
836
+ var types$3 = /*#__PURE__*/Object.freeze({
837
+ __proto__: null,
838
+ get LayerType () { return LayerType; },
839
+ get LayerStatus () { return LayerStatus; },
840
+ get LayerActionOrigin () { return LayerActionOrigin; }
841
+ });
842
+
656
843
  /* *
657
844
  * Licensed under the Apache License, Version 2.0 (the "License");
658
845
  * you may not use this file except in compliance with the License.
@@ -1422,32 +1609,192 @@ var utils = /*#__PURE__*/Object.freeze({
1422
1609
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
1423
1610
  * */
1424
1611
  /**
1425
- * Sets a dimension value for a layer in the state. If the dimension does not exist it is added to the layer.
1426
- * @param draft The draft layerstate
1427
- * @param layerId The layerId
1428
- * @param dimensionValueToUpdate The dimension with values to update in the layer.
1612
+ * Generic action to set the time.
1613
+ *
1614
+ * @param payload: SetTimePayload;
1615
+ * {
1616
+ * sourceId: string; // Source where the new time value originates from
1617
+ * value: string; // ISO 8601 string time value like "2010-10-01T00:00:00Z"
1618
+ * }
1429
1619
  */
1430
1620
 
1431
- var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(draft, layerId, dimensionValueToUpdate) {
1432
- if (!draft.byId[layerId].dimensions) {
1433
- draft.byId[layerId].dimensions = [];
1434
- }
1621
+ var setTime = createAction('GENERIC_SETTIME');
1622
+ /**
1623
+ * Generic action to set the bounding box.
1624
+ *
1625
+ * @param payload: SetBboxPayload;
1626
+ *
1627
+ * {
1628
+ * sourceId: string; // Source where the new time value originates from
1629
+ * bbox: { // Bbbox object
1630
+ * left: number;
1631
+ * bottom: number;
1632
+ * right: number;
1633
+ * top: number;
1634
+ * };
1635
+ * srs: string; // Projection string according to EPSG, e.g. (EPSG:3857 == Mercator)
1636
+ * }
1637
+ */
1435
1638
 
1436
- var existingLayerDimIndex = draft.byId[layerId].dimensions.findIndex(function (layerDim) {
1437
- return layerDim.name === dimensionValueToUpdate.name;
1438
- });
1639
+ var setBbox = createAction('GENERIC_SETBBOX');
1439
1640
 
1440
- if (existingLayerDimIndex < 0) {
1441
- draft.byId[layerId].dimensions.push(Object.assign({}, dimensionValueToUpdate));
1442
- } else {
1443
- if (dimensionValueToUpdate.currentValue) {
1444
- draft.byId[layerId].dimensions[existingLayerDimIndex].currentValue = dimensionValueToUpdate.currentValue;
1445
- }
1641
+ /* *
1642
+ * Licensed under the Apache License, Version 2.0 (the "License");
1643
+ * you may not use this file except in compliance with the License.
1644
+ * You may obtain a copy of the License at
1645
+ *
1646
+ * http://www.apache.org/licenses/LICENSE-2.0
1647
+ *
1648
+ * Unless required by applicable law or agreed to in writing, software
1649
+ * distributed under the License is distributed on an "AS IS" BASIS,
1650
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1651
+ * See the License for the specific language governing permissions and
1652
+ * limitations under the License.
1653
+ *
1654
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1655
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1656
+ * */
1657
+ /**
1658
+ * These actions are fired by the generic/saga.ts, based on generic actions and the synchronizationGroup state.
1659
+ *
1660
+ * These actions should not be used by components directly. Components should only use the generic actions.
1661
+ */
1446
1662
 
1447
- if (dimensionValueToUpdate.synced !== undefined) {
1448
- draft.byId[layerId].dimensions[existingLayerDimIndex].synced = dimensionValueToUpdate.synced;
1663
+ var setTimeSync = createAction('GENERIC_SYNC_SETTIME', function (payload, targets, groups) {
1664
+ return {
1665
+ payload: {
1666
+ source: setTime(payload),
1667
+ groups: groups,
1668
+ targets: targets
1449
1669
  }
1450
-
1670
+ };
1671
+ });
1672
+ var setBboxSync = createAction('GENERIC_SYNC_SETBBOX', function (payload, targets, groups) {
1673
+ return {
1674
+ payload: {
1675
+ source: setBbox(payload),
1676
+ groups: groups,
1677
+ targets: targets
1678
+ }
1679
+ };
1680
+ });
1681
+ var setLayerActionSync = createAction('GENERIC_SYNC_SETLAYERACTIONS', function (payload, targets, type) {
1682
+ return {
1683
+ payload: {
1684
+ source: {
1685
+ type: type,
1686
+ payload: payload
1687
+ },
1688
+ targets: targets
1689
+ }
1690
+ };
1691
+ });
1692
+
1693
+ /* *
1694
+ * Licensed under the Apache License, Version 2.0 (the "License");
1695
+ * you may not use this file except in compliance with the License.
1696
+ * You may obtain a copy of the License at
1697
+ *
1698
+ * http://www.apache.org/licenses/LICENSE-2.0
1699
+ *
1700
+ * Unless required by applicable law or agreed to in writing, software
1701
+ * distributed under the License is distributed on an "AS IS" BASIS,
1702
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1703
+ * See the License for the specific language governing permissions and
1704
+ * limitations under the License.
1705
+ *
1706
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1707
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
1708
+ * */
1709
+ /**
1710
+ * These actions causes circular dependency if they are defined in the reducer.ts file.
1711
+ * Therefor they are instead added to this file
1712
+ * https://redux-toolkit.js.org/usage/usage-guide#exporting-and-using-slices
1713
+ */
1714
+
1715
+ var mapChangeDimension = createAction('MAP_CHANGE_DIMENSION');
1716
+ var setMapPreset = createAction('SET_MAP_PRESET');
1717
+
1718
+ /*! *****************************************************************************
1719
+ Copyright (c) Microsoft Corporation.
1720
+
1721
+ Permission to use, copy, modify, and/or distribute this software for any
1722
+ purpose with or without fee is hereby granted.
1723
+
1724
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1725
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1726
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1727
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1728
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1729
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1730
+ PERFORMANCE OF THIS SOFTWARE.
1731
+ ***************************************************************************** */
1732
+
1733
+ function __rest(s, e) {
1734
+ var t = {};
1735
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1736
+ t[p] = s[p];
1737
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1738
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1739
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1740
+ t[p[i]] = s[p[i]];
1741
+ }
1742
+ return t;
1743
+ }
1744
+
1745
+ function __awaiter(thisArg, _arguments, P, generator) {
1746
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1747
+ return new (P || (P = Promise))(function (resolve, reject) {
1748
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1749
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1750
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1751
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1752
+ });
1753
+ }
1754
+
1755
+ /* *
1756
+ * Licensed under the Apache License, Version 2.0 (the "License");
1757
+ * you may not use this file except in compliance with the License.
1758
+ * You may obtain a copy of the License at
1759
+ *
1760
+ * http://www.apache.org/licenses/LICENSE-2.0
1761
+ *
1762
+ * Unless required by applicable law or agreed to in writing, software
1763
+ * distributed under the License is distributed on an "AS IS" BASIS,
1764
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1765
+ * See the License for the specific language governing permissions and
1766
+ * limitations under the License.
1767
+ *
1768
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1769
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1770
+ * */
1771
+ /**
1772
+ * Sets a dimension value for a layer in the state. If the dimension does not exist it is added to the layer.
1773
+ * @param draft The draft layerstate
1774
+ * @param layerId The layerId
1775
+ * @param dimensionValueToUpdate The dimension with values to update in the layer.
1776
+ */
1777
+
1778
+ var produceLayerDimensionDraftState = function produceLayerDimensionDraftState(draft, layerId, dimensionValueToUpdate) {
1779
+ if (!draft.byId[layerId].dimensions) {
1780
+ draft.byId[layerId].dimensions = [];
1781
+ }
1782
+
1783
+ var existingLayerDimIndex = draft.byId[layerId].dimensions.findIndex(function (layerDim) {
1784
+ return layerDim.name === dimensionValueToUpdate.name;
1785
+ });
1786
+
1787
+ if (existingLayerDimIndex < 0) {
1788
+ draft.byId[layerId].dimensions.push(Object.assign({}, dimensionValueToUpdate));
1789
+ } else {
1790
+ if (dimensionValueToUpdate.currentValue) {
1791
+ draft.byId[layerId].dimensions[existingLayerDimIndex].currentValue = dimensionValueToUpdate.currentValue;
1792
+ }
1793
+
1794
+ if (dimensionValueToUpdate.synced !== undefined) {
1795
+ draft.byId[layerId].dimensions[existingLayerDimIndex].synced = dimensionValueToUpdate.synced;
1796
+ }
1797
+
1451
1798
  if (dimensionValueToUpdate.validSyncSelection !== undefined) {
1452
1799
  draft.byId[layerId].dimensions[existingLayerDimIndex].validSyncSelection = dimensionValueToUpdate.validSyncSelection;
1453
1800
  }
@@ -1556,129 +1903,6 @@ var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftSt
1556
1903
  }
1557
1904
  };
1558
1905
 
1559
- /* *
1560
- * Licensed under the Apache License, Version 2.0 (the "License");
1561
- * you may not use this file except in compliance with the License.
1562
- * You may obtain a copy of the License at
1563
- *
1564
- * http://www.apache.org/licenses/LICENSE-2.0
1565
- *
1566
- * Unless required by applicable law or agreed to in writing, software
1567
- * distributed under the License is distributed on an "AS IS" BASIS,
1568
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1569
- * See the License for the specific language governing permissions and
1570
- * limitations under the License.
1571
- *
1572
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1573
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
1574
- * */
1575
- /**
1576
- * These actions causes circular dependency if they are defined in the reducer.ts file.
1577
- * Therefor they are instead added to this file
1578
- * https://redux-toolkit.js.org/usage/usage-guide#exporting-and-using-slices
1579
- */
1580
-
1581
- var mapChangeDimension = createAction('MAP_CHANGE_DIMENSION');
1582
- var setMapPreset = createAction('SET_MAP_PRESET');
1583
-
1584
- /* *
1585
- * Licensed under the Apache License, Version 2.0 (the "License");
1586
- * you may not use this file except in compliance with the License.
1587
- * You may obtain a copy of the License at
1588
- *
1589
- * http://www.apache.org/licenses/LICENSE-2.0
1590
- *
1591
- * Unless required by applicable law or agreed to in writing, software
1592
- * distributed under the License is distributed on an "AS IS" BASIS,
1593
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1594
- * See the License for the specific language governing permissions and
1595
- * limitations under the License.
1596
- *
1597
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1598
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
1599
- * */
1600
- /**
1601
- * Generic action to set the time.
1602
- *
1603
- * @param payload: SetTimePayload;
1604
- * {
1605
- * sourceId: string; // Source where the new time value originates from
1606
- * value: string; // ISO 8601 string time value like "2010-10-01T00:00:00Z"
1607
- * }
1608
- */
1609
-
1610
- var setTime = createAction('GENERIC_SETTIME');
1611
- /**
1612
- * Generic action to set the bounding box.
1613
- *
1614
- * @param payload: SetBboxPayload;
1615
- *
1616
- * {
1617
- * sourceId: string; // Source where the new time value originates from
1618
- * bbox: { // Bbbox object
1619
- * left: number;
1620
- * bottom: number;
1621
- * right: number;
1622
- * top: number;
1623
- * };
1624
- * srs: string; // Projection string according to EPSG, e.g. (EPSG:3857 == Mercator)
1625
- * }
1626
- */
1627
-
1628
- var setBbox = createAction('GENERIC_SETBBOX');
1629
-
1630
- /* *
1631
- * Licensed under the Apache License, Version 2.0 (the "License");
1632
- * you may not use this file except in compliance with the License.
1633
- * You may obtain a copy of the License at
1634
- *
1635
- * http://www.apache.org/licenses/LICENSE-2.0
1636
- *
1637
- * Unless required by applicable law or agreed to in writing, software
1638
- * distributed under the License is distributed on an "AS IS" BASIS,
1639
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1640
- * See the License for the specific language governing permissions and
1641
- * limitations under the License.
1642
- *
1643
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1644
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
1645
- * */
1646
- /**
1647
- * These actions are fired by the generic/saga.ts, based on generic actions and the synchronizationGroup state.
1648
- *
1649
- * These actions should not be used by components directly. Components should only use the generic actions.
1650
- */
1651
-
1652
- var setTimeSync = createAction('GENERIC_SYNC_SETTIME', function (payload, targets, groups) {
1653
- return {
1654
- payload: {
1655
- source: setTime(payload),
1656
- groups: groups,
1657
- targets: targets
1658
- }
1659
- };
1660
- });
1661
- var setBboxSync = createAction('GENERIC_SYNC_SETBBOX', function (payload, targets, groups) {
1662
- return {
1663
- payload: {
1664
- source: setBbox(payload),
1665
- groups: groups,
1666
- targets: targets
1667
- }
1668
- };
1669
- });
1670
- var setLayerActionSync = createAction('GENERIC_SYNC_SETLAYERACTIONS', function (payload, targets, type) {
1671
- return {
1672
- payload: {
1673
- source: {
1674
- type: type,
1675
- payload: payload
1676
- },
1677
- targets: targets
1678
- }
1679
- };
1680
- });
1681
-
1682
1906
  var createLayer = function createLayer(_a) {
1683
1907
  var id = _a.id,
1684
1908
  _a$opacity = _a.opacity,
@@ -1708,7 +1932,7 @@ var createLayer = function createLayer(_a) {
1708
1932
  status: status
1709
1933
  });
1710
1934
  };
1711
- var initialState$8 = {
1935
+ var initialState$7 = {
1712
1936
  byId: {},
1713
1937
  allIds: [],
1714
1938
  availableBaseLayers: {
@@ -1716,9 +1940,9 @@ var initialState$8 = {
1716
1940
  allIds: []
1717
1941
  }
1718
1942
  };
1719
- var slice$8 = createSlice({
1720
- initialState: initialState$8,
1721
- name: 'layerReducer',
1943
+ var slice$7 = createSlice({
1944
+ initialState: initialState$7,
1945
+ name: 'layerReducer',
1722
1946
  reducers: {
1723
1947
  addLayer: function addLayer(draft, action) {
1724
1948
  var _action$payload = action.payload,
@@ -1983,12 +2207,68 @@ var slice$8 = createSlice({
1983
2207
  var _action$payload12 = action.payload,
1984
2208
  layerStyle = _action$payload12.layerStyle,
1985
2209
  layerDimensions = _action$payload12.layerDimensions;
1986
- var layerStyleAction = layerActions.layerChangeStyle(layerStyle);
1987
- var state = current(draft);
1988
- var intermediateState = layerStyle === null ? state : reducer$8(state, layerStyleAction);
1989
- var dimensionsAction = layerActions.layerSetDimensions(layerDimensions);
1990
- var newState = layerDimensions === null ? intermediateState : reducer$8(intermediateState, dimensionsAction);
1991
- return newState;
2210
+ /* Set style */
2211
+
2212
+ if (layerStyle && draft.byId[layerStyle.layerId]) {
2213
+ draft.byId[layerStyle.layerId].style = layerStyle === null || layerStyle === void 0 ? void 0 : layerStyle.style;
2214
+ }
2215
+ /* Set layer dimensions */
2216
+
2217
+
2218
+ if (layerDimensions) {
2219
+ /* Find the corresponding layer we want to update */
2220
+ var currentLayer = draft.byId[layerDimensions.layerId];
2221
+ /* Find all other layers with the same name and service, and update these at once (atomic update) */
2222
+
2223
+ Object.values(draft.byId).filter(function (draftLayer) {
2224
+ return draftLayer.name === currentLayer.name && draftLayer.service === currentLayer.service;
2225
+ }).forEach(function (draftLayer) {
2226
+ var layerId = draftLayer.id;
2227
+
2228
+ if (layerId && draft.byId[layerId]) {
2229
+ if (!draft.byId[layerId].dimensions) {
2230
+ draft.byId[layerId].dimensions = [];
2231
+ }
2232
+
2233
+ var draftLayerDimensions = draft.byId[layerId].dimensions;
2234
+ /* Now update the dimension for each layer */
2235
+
2236
+ layerDimensions.dimensions.forEach(function (newLayerDimension) {
2237
+ /* Find the wmLayer */
2238
+ var wmLayer = getWMLayerById(layerId);
2239
+ /* Find the wmDimension */
2240
+
2241
+ var wmDimension = wmLayer && wmLayer.getDimension(newLayerDimension.name);
2242
+ /* This will set the new range of start/stop values for this dimension, making getClosestValue work properly */
2243
+
2244
+ wmDimension && wmDimension.reInitializeValues(newLayerDimension.values);
2245
+ /* Find corresponding draftLayerDimensions */
2246
+
2247
+ var draftLayerDimension = draftLayerDimensions === null || draftLayerDimensions === void 0 ? void 0 : draftLayerDimensions.find(function (d) {
2248
+ return d.name === newLayerDimension.name && d.units === newLayerDimension.units;
2249
+ });
2250
+
2251
+ if (draftLayerDimension) {
2252
+ /* If found update only minValue, maxValue and values */
2253
+ draftLayerDimension.maxValue = newLayerDimension.maxValue;
2254
+ draftLayerDimension.minValue = newLayerDimension.minValue;
2255
+ draftLayerDimension.values = newLayerDimension.values;
2256
+ } else if (layerId === layerDimensions.layerId) {
2257
+ /* Otherwise add a new one, but only for this layer. */
2258
+ draftLayerDimensions.push({
2259
+ name: newLayerDimension.name,
2260
+ units: newLayerDimension.units,
2261
+ currentValue: newLayerDimension.currentValue,
2262
+ minValue: newLayerDimension.minValue,
2263
+ maxValue: newLayerDimension.maxValue,
2264
+ validSyncSelection: newLayerDimension.validSyncSelection,
2265
+ values: newLayerDimension.values
2266
+ });
2267
+ }
2268
+ });
2269
+ }
2270
+ });
2271
+ }
1992
2272
  },
1993
2273
  setSelectedFeature: function setSelectedFeature(draft, action) {
1994
2274
  var _action$payload13 = action.payload,
@@ -2043,7 +2323,7 @@ var slice$8 = createSlice({
2043
2323
  };
2044
2324
  /* Handle the Layer action with the same logic, using the same reducer */
2045
2325
 
2046
- return reducer$8(prevState, action);
2326
+ return reducer$7(prevState, action);
2047
2327
  }, state);
2048
2328
  }).addCase(setMapPreset, function (draft, action) {
2049
2329
  var mapId = action.payload.mapId;
@@ -2063,224 +2343,8 @@ var slice$8 = createSlice({
2063
2343
  });
2064
2344
  }
2065
2345
  });
2066
- var reducer$8 = slice$8.reducer;
2067
- var layerActions = slice$8.actions;
2068
-
2069
- /* *
2070
- * Licensed under the Apache License, Version 2.0 (the "License");
2071
- * you may not use this file except in compliance with the License.
2072
- * You may obtain a copy of the License at
2073
- *
2074
- * http://www.apache.org/licenses/LICENSE-2.0
2075
- *
2076
- * Unless required by applicable law or agreed to in writing, software
2077
- * distributed under the License is distributed on an "AS IS" BASIS,
2078
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2079
- * See the License for the specific language governing permissions and
2080
- * limitations under the License.
2081
- *
2082
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2083
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
2084
- * */
2085
- var initialState$7 = {
2086
- byId: {},
2087
- allIds: []
2088
- };
2089
- var slice$7 = createSlice({
2090
- initialState: initialState$7,
2091
- name: 'serviceReducer',
2092
- reducers: {
2093
- serviceSetLayers: function serviceSetLayers(draft, action) {
2094
- var id = action.payload.id;
2095
- draft.byId[id] = Object.assign({}, action.payload);
2096
-
2097
- if (!draft.allIds.includes(id)) {
2098
- draft.allIds.push(id);
2099
- }
2100
- },
2101
- mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
2102
- var foundServiceIndex = draft.allIds.findIndex(function (id) {
2103
- return draft.byId[id].serviceUrl === action.payload.serviceUrl;
2104
- });
2105
-
2106
- if (foundServiceIndex !== -1) {
2107
- var serviceId = draft.allIds[foundServiceIndex];
2108
- draft.allIds = draft.allIds.filter(function (id) {
2109
- return id !== serviceId;
2110
- });
2111
- delete draft.byId[serviceId];
2112
- }
2113
- },
2114
- fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
2115
- draft, // eslint-disable-next-line no-unused-vars
2116
- action) {}
2117
- },
2118
- extraReducers: function extraReducers(builder) {
2119
- return builder.addCase(layerActions.onUpdateLayerInformation, function (draft, action) {
2120
- var serviceLayers = action.payload.serviceLayers;
2121
-
2122
- if (serviceLayers === null) {
2123
- return draft;
2124
- }
2125
-
2126
- var mapAction = serviceActions.serviceSetLayers(serviceLayers);
2127
- var newState = reducer$7(draft, mapAction);
2128
- return newState;
2129
- });
2130
- }
2131
- });
2132
2346
  var reducer$7 = slice$7.reducer;
2133
- var serviceActions = slice$7.actions;
2134
-
2135
- /* *
2136
- * Licensed under the Apache License, Version 2.0 (the "License");
2137
- * you may not use this file except in compliance with the License.
2138
- * You may obtain a copy of the License at
2139
- *
2140
- * http://www.apache.org/licenses/LICENSE-2.0
2141
- *
2142
- * Unless required by applicable law or agreed to in writing, software
2143
- * distributed under the License is distributed on an "AS IS" BASIS,
2144
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2145
- * See the License for the specific language governing permissions and
2146
- * limitations under the License.
2147
- *
2148
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2149
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
2150
- * */
2151
- var selectorMemoizationOptions = {
2152
- memoizeOptions: {
2153
- maxSize: 1000,
2154
- resultEqualityCheck: isEqual
2155
- }
2156
- };
2157
- var isUserAddedService = function isUserAddedService(scope) {
2158
- return scope === 'user';
2159
- };
2160
-
2161
- /* *
2162
- * Licensed under the Apache License, Version 2.0 (the "License");
2163
- * you may not use this file except in compliance with the License.
2164
- * You may obtain a copy of the License at
2165
- *
2166
- * http://www.apache.org/licenses/LICENSE-2.0
2167
- *
2168
- * Unless required by applicable law or agreed to in writing, software
2169
- * distributed under the License is distributed on an "AS IS" BASIS,
2170
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2171
- * See the License for the specific language governing permissions and
2172
- * limitations under the License.
2173
- *
2174
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2175
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
2176
- * */
2177
-
2178
- var servicesStore = function servicesStore(store) {
2179
- return store && store.services ? store.services : null;
2180
- };
2181
- /**
2182
- * Retrieves all serviceIds
2183
- *
2184
- * Example: serviceIds = getServiceIds(store)
2185
- * @param {object} store store: object - object from which the service state will be extracted
2186
- * @returns {array} returnType: array - an array of all serviceIds
2187
- */
2188
-
2189
-
2190
- createSelector(servicesStore, function (serviceState) {
2191
- return serviceState ? serviceState.allIds : [];
2192
- }, selectorMemoizationOptions);
2193
- /**
2194
- * Gets map services
2195
- *
2196
- * Example: services = getServices(store)
2197
- * @param {object} store store: object - Store object
2198
- * @returns {object} returnType: ServiceState
2199
- */
2200
-
2201
- var getServices = createSelector(servicesStore, function (store) {
2202
- return store ? store.byId : {};
2203
- }, selectorMemoizationOptions);
2204
- /**
2205
- * Gets the service object by its url
2206
- *
2207
- * Example: service = getServiceByName(store, 'serviceName')
2208
- * @param {object} store store: object - Store object
2209
- * @returns {ReduxService} returnType: Service
2210
- */
2211
-
2212
- var getServiceByName = createSelector([servicesStore, function (state, serviceUrl) {
2213
- return serviceUrl;
2214
- }], function (serviceState, serviceUrl) {
2215
- var foundServiceIndex = serviceState.allIds.findIndex(function (id) {
2216
- return serviceState.byId[id].serviceUrl === serviceUrl;
2217
- });
2218
- /* Add the service based on a url */
2219
-
2220
- var id = foundServiceIndex !== -1 ? serviceState.allIds[foundServiceIndex] : null;
2221
-
2222
- if (serviceState && serviceState.byId && serviceState.byId[id]) {
2223
- return serviceState.byId[id];
2224
- }
2225
-
2226
- return null;
2227
- }, selectorMemoizationOptions);
2228
- /**
2229
- * Gets the layer from the store using the serviceUrl and layerName
2230
- *
2231
- * Example: layers = getLayersFromService(store, 'https://geoservices.knmi.nl/...')
2232
- * @param {object} store store: object - object from which the layers state will be extracted
2233
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2234
- * @returns {array} returnType: ServiceLayer[] - All layers within the service object.
2235
- */
2236
-
2237
- var getLayersFromService$1 = createSelector(getServiceByName, function (service) {
2238
- return service && service.layers || null;
2239
- }, selectorMemoizationOptions);
2240
- /**
2241
- * Gets the layer from the store using the serviceUrl and layerName
2242
- *
2243
- * Example: layer = getLayerFromService(store, 'https://geoservices.knmi.nl/...', 'radar')
2244
- * @param {object} store store: object - The application store
2245
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2246
- * @param {string} layerName layerName: string - Name of the layer in the service
2247
- * @returns {ServiceLayer} returnType: ServiceLayer - The layer from the service object.
2248
- */
2249
-
2250
- var getLayerFromService = createSelector(function (store, serviceUrl) {
2251
- return getLayersFromService$1(store, serviceUrl);
2252
- }, function (store, serviceUrl) {
2253
- return serviceUrl;
2254
- }, function (store, serviceUrl, layerName) {
2255
- return layerName;
2256
- }, function (layers, serviceUrl, layerName) {
2257
- if (!layers) {
2258
- return null;
2259
- }
2260
-
2261
- var index = layers.findIndex(function (serviceLayer) {
2262
- return serviceLayer.name === layerName;
2263
- });
2264
-
2265
- if (index === -1) {
2266
- return null;
2267
- }
2268
-
2269
- return layers[index];
2270
- }, selectorMemoizationOptions);
2271
- /**
2272
- * Gets the layers stylelist from the servicestore using the serviceUrl and layerName
2273
- *
2274
- * Example: layerStyles = getLayerStyles(store, layerService, layerName);
2275
- * @param {object} store store: object - store from which the layers state will be extracted
2276
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2277
- * @param {string} layerName layerName: string - Name of the layer in the service
2278
- * @returns {array} returnType: Style[] - array containing layer styles
2279
- */
2280
-
2281
- var getLayerStyles$1 = createSelector(getLayerFromService, function (layer) {
2282
- return layer && layer.styles ? layer.styles : [];
2283
- }, selectorMemoizationOptions);
2347
+ var layerActions = slice$7.actions;
2284
2348
 
2285
2349
  var moveToTop = function moveToTop(list, element) {
2286
2350
  var filteredList = list.filter(function (item) {
@@ -2423,9 +2487,9 @@ var addBaseLayer = layerActions.addBaseLayer,
2423
2487
  baseLayerDelete = layerActions.baseLayerDelete,
2424
2488
  layerChangeDimension$1 = layerActions.layerChangeDimension,
2425
2489
  layerDelete$1 = layerActions.layerDelete,
2426
- onUpdateLayerInformation = layerActions.onUpdateLayerInformation,
2427
2490
  setBaseLayers$1 = layerActions.setBaseLayers,
2428
- setLayers = layerActions.setLayers;
2491
+ setLayers = layerActions.setLayers,
2492
+ onUpdateLayerInformation = layerActions.onUpdateLayerInformation;
2429
2493
  /**
2430
2494
  * Checks if the layer id is already taken in one of the maps.
2431
2495
  * @param state The WebMapState
@@ -3083,12 +3147,16 @@ var slice$5 = createSlice({
3083
3147
  }).addCase(onUpdateLayerInformation, function (draft, action) {
3084
3148
  var mapDimensions = action.payload.mapDimensions;
3085
3149
 
3086
- if (mapDimensions === null) {
3150
+ if (!mapDimensions) {
3087
3151
  return draft;
3088
3152
  }
3089
3153
 
3090
- var mapAction = mapActions$1.mapUpdateAllMapDimensions(mapDimensions);
3091
- return reducer$5(draft, mapAction);
3154
+ var dimensions = mapDimensions.dimensions,
3155
+ mapId = mapDimensions.mapId;
3156
+ dimensions.forEach(function (dimension) {
3157
+ return produceDraftStateSetWebMapDimension(draft, mapId, dimension, false);
3158
+ });
3159
+ return draft;
3092
3160
  }).addCase(mapChangeDimension, function (draft, action) {
3093
3161
  var _action$payload35 = action.payload,
3094
3162
  mapId = _action$payload35.mapId,
@@ -3557,7 +3625,9 @@ var getDialogOrder = createSelector(function (store, dialogType) {
3557
3625
  if (store && store.ui && store.ui.order) {
3558
3626
  var order = store.ui.order;
3559
3627
  var visibleOrder = order.filter(function (orderedDialogType) {
3560
- return store.ui.dialogs[orderedDialogType].isOpen;
3628
+ var _a;
3629
+
3630
+ return (_a = store.ui.dialogs[orderedDialogType]) === null || _a === void 0 ? void 0 : _a.isOpen;
3561
3631
  });
3562
3632
 
3563
3633
  if (!visibleOrder.includes(dialogType)) {
@@ -4150,6 +4220,24 @@ var syncGroupGetViewState = createSelector(syncGroupStore, function (store) {
4150
4220
  var getSyncedMapIdsForTimeslider = createSelector(syncGroupStore, function (store) {
4151
4221
  return store.viewState.timeslider.groups[0].selected;
4152
4222
  }, selectorMemoizationOptions);
4223
+ var getSyncGroupTargets = function getSyncGroupTargets(state) {
4224
+ var syncStore = syncGroupStore(state);
4225
+
4226
+ if (!syncStore || !syncStore.groups) {
4227
+ return [];
4228
+ }
4229
+
4230
+ return syncStore.groups.allIds.reduce(function (targets, groupId) {
4231
+ var group = syncStore.groups.byId[groupId];
4232
+ return targets.concat(group.targets.allIds.map(function (targetId) {
4233
+ return {
4234
+ groupId: groupId,
4235
+ targetId: targetId,
4236
+ linked: group.targets.byId[targetId].linked
4237
+ };
4238
+ }));
4239
+ }, []);
4240
+ };
4153
4241
 
4154
4242
  var selectors$2 = /*#__PURE__*/Object.freeze({
4155
4243
  __proto__: null,
@@ -4161,7 +4249,8 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
4161
4249
  getTargetGroups: getTargetGroups,
4162
4250
  getAllTargetGroupsForSource: getAllTargetGroupsForSource,
4163
4251
  syncGroupGetViewState: syncGroupGetViewState,
4164
- getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider
4252
+ getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider,
4253
+ getSyncGroupTargets: getSyncGroupTargets
4165
4254
  });
4166
4255
 
4167
4256
  /* *
@@ -6894,11 +6983,11 @@ function replaceLayerIds(layers, autoLayerIdOld, autoLayerIdNew) {
6894
6983
  * See the License for the specific language governing permissions and
6895
6984
  * limitations under the License.
6896
6985
  *
6897
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6898
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
6986
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6987
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
6899
6988
  * */
6900
6989
 
6901
- var PlayButton = function PlayButton(_ref) {
6990
+ var PlayButton$1 = function PlayButton(_ref) {
6902
6991
  var isAnimating = _ref.isAnimating,
6903
6992
  isDisabled = _ref.isDisabled,
6904
6993
  _ref$onTogglePlayButt = _ref.onTogglePlayButton,
@@ -6908,18 +6997,18 @@ var PlayButton = function PlayButton(_ref) {
6908
6997
  onTogglePlayButton();
6909
6998
  };
6910
6999
 
6911
- return /*#__PURE__*/React.createElement(CustomTooltip, {
6912
- title: isAnimating ? 'Pause' : 'Play'
6913
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
7000
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
7001
+ variant: "tool",
7002
+ tooltipTitle: isAnimating ? 'Pause' : 'Play',
6914
7003
  onClick: onTogglePlay,
6915
7004
  disabled: isDisabled,
6916
7005
  "data-testid": "playButton",
6917
- active: isAnimating
7006
+ isSelected: isAnimating
6918
7007
  }, isAnimating ? /*#__PURE__*/React.createElement(Pause, {
6919
7008
  "data-testid": "pause-svg-path"
6920
7009
  }) : /*#__PURE__*/React.createElement(Play, {
6921
7010
  "data-testid": "play-svg-path"
6922
- }))));
7011
+ }));
6923
7012
  };
6924
7013
 
6925
7014
  /* *
@@ -6978,7 +7067,7 @@ var PlayButtonConnect = connectRedux$3(function (_ref) {
6978
7067
  }
6979
7068
  };
6980
7069
 
6981
- return /*#__PURE__*/React__default.createElement(PlayButton, {
7070
+ return /*#__PURE__*/React__default.createElement(PlayButton$1, {
6982
7071
  isAnimating: linkedMapAnimationInfo.isAnimating,
6983
7072
  isDisabled: isDisabled,
6984
7073
  onTogglePlayButton: function onTogglePlayButton() {
@@ -9561,8 +9650,8 @@ var moduleConfig = {
9561
9650
  id: 'webmap-module',
9562
9651
  reducersMap: {
9563
9652
  webmap: reducer$5,
9564
- services: reducer$7,
9565
- layers: reducer$8
9653
+ services: reducer$8,
9654
+ layers: reducer$7
9566
9655
  },
9567
9656
  sagas: [rootSaga$4, rootSaga$3]
9568
9657
  };
@@ -9989,8 +10078,12 @@ var HeaderOptions = function HeaderOptions(_ref) {
9989
10078
  var isDockedLayerManager = _ref.isDockedLayerManager,
9990
10079
  shortcutsEnabled = _ref.shortcutsEnabled,
9991
10080
  onClickDockButton = _ref.onClickDockButton,
9992
- onChangeSize = _ref.onChangeSize;
9993
- React.useEffect(function () {
10081
+ onChangeSize = _ref.onChangeSize,
10082
+ buttonSettings = _ref.buttonSettings;
10083
+
10084
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10085
+
10086
+ React.useEffect(function () {
9994
10087
  var handleKeyDown = function handleKeyDown(event) {
9995
10088
  if (shortcutsEnabled) {
9996
10089
  if (event.ctrlKey && event.altKey && event.code === 'KeyS') {
@@ -10008,28 +10101,28 @@ var HeaderOptions = function HeaderOptions(_ref) {
10008
10101
  document.removeEventListener('keydown', handleKeyDown);
10009
10102
  };
10010
10103
  }, [onChangeSize, shortcutsEnabled]);
10011
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
10104
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !((_a = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.small) === null || _a === void 0 ? void 0 : _a.isDisabled) && /*#__PURE__*/React.createElement(CustomIconButton, {
10012
10105
  tooltipTitle: "small",
10013
10106
  "data-testid": "collapseSmall-btn",
10014
10107
  onClick: function onClick() {
10015
10108
  return onChangeSize(sizeSmall);
10016
10109
  },
10017
10110
  className: "collapseSmall-btn"
10018
- }, /*#__PURE__*/React.createElement(CollapseSmall, null)), /*#__PURE__*/React.createElement(CustomIconButton, {
10111
+ }, (_c = (_b = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.small) === null || _b === void 0 ? void 0 : _b.icon) !== null && _c !== void 0 ? _c : /*#__PURE__*/React.createElement(CollapseSmall, null)), !((_d = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.medium) === null || _d === void 0 ? void 0 : _d.isDisabled) && /*#__PURE__*/React.createElement(CustomIconButton, {
10019
10112
  tooltipTitle: "medium",
10020
10113
  "data-testid": "collapseMedium-btn",
10021
10114
  onClick: function onClick() {
10022
10115
  return onChangeSize(sizeMedium);
10023
10116
  },
10024
10117
  className: "collapseMedium-btn"
10025
- }, /*#__PURE__*/React.createElement(CollapseMedium, null)), /*#__PURE__*/React.createElement(CustomIconButton, {
10118
+ }, (_f = (_e = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.medium) === null || _e === void 0 ? void 0 : _e.icon) !== null && _f !== void 0 ? _f : /*#__PURE__*/React.createElement(CollapseMedium, null)), !((_g = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.large) === null || _g === void 0 ? void 0 : _g.isDisabled) && /*#__PURE__*/React.createElement(CustomIconButton, {
10026
10119
  tooltipTitle: "large",
10027
10120
  "data-testid": "collapseLarge-btn",
10028
10121
  onClick: function onClick() {
10029
10122
  return onChangeSize(sizeLarge);
10030
10123
  },
10031
10124
  className: "collapseLarge-btn"
10032
- }, /*#__PURE__*/React.createElement(CollapseLarge, null)), /*#__PURE__*/React.createElement(CustomIconButton, {
10125
+ }, (_j = (_h = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.large) === null || _h === void 0 ? void 0 : _h.icon) !== null && _j !== void 0 ? _j : /*#__PURE__*/React.createElement(CollapseLarge, null)), !((_k = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.dock) === null || _k === void 0 ? void 0 : _k.isDisabled) && /*#__PURE__*/React.createElement(CustomIconButton, {
10033
10126
  tooltipTitle: isDockedLayerManager ? 'Undock' : 'Dock',
10034
10127
  "data-testid": "dockedBtn",
10035
10128
  disableRipple: true,
@@ -10040,7 +10133,7 @@ var HeaderOptions = function HeaderOptions(_ref) {
10040
10133
  "data-testid": "dockedLayerManager-collapse"
10041
10134
  }) : /*#__PURE__*/React.createElement(ExpandWindow, {
10042
10135
  "data-testid": "dockedLayerManager-uncollapse"
10043
- })));
10136
+ })), (_l = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.divider) === null || _l === void 0 ? void 0 : _l.element);
10044
10137
  };
10045
10138
 
10046
10139
  /* *
@@ -10289,12 +10382,14 @@ var LayerSelectButtonConnect = function LayerSelectButtonConnect(_ref) {
10289
10382
  }, icon);
10290
10383
  };
10291
10384
 
10292
- var styles$4 = {
10293
- text: {
10294
- paddingLeft: '10px',
10295
- fontSize: '12px',
10296
- fontFamily: 'Roboto',
10297
- opacity: 0.67
10385
+ var styles$5 = {
10386
+ text: function text(theme) {
10387
+ return Object.assign({
10388
+ paddingLeft: '10px',
10389
+ fontSize: '12px',
10390
+ fontFamily: 'Roboto',
10391
+ opacity: 0.67
10392
+ }, theme.palette.geowebColors.layerManager.headerRowText);
10298
10393
  }
10299
10394
  };
10300
10395
 
@@ -10337,7 +10432,7 @@ var DescriptionRow = function DescriptionRow(_ref) {
10337
10432
  className: columnClasses.column2
10338
10433
  }, /*#__PURE__*/React.createElement(Box, {
10339
10434
  className: "header-layer ".concat(hasMapPresetsModule ? 'mappresetsModule-enabled' : ''),
10340
- sx: styles$4.text
10435
+ sx: styles$5.text
10341
10436
  }, (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.layerName) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : 'Layer'), /*#__PURE__*/React.createElement(Box, {
10342
10437
  className: "header-mapPresets",
10343
10438
  sx: {
@@ -10346,15 +10441,15 @@ var DescriptionRow = function DescriptionRow(_ref) {
10346
10441
  }, mapPresetsModuleInline)), /*#__PURE__*/React.createElement(Grid, {
10347
10442
  className: columnClasses.column3
10348
10443
  }, /*#__PURE__*/React.createElement(Box, {
10349
- sx: styles$4.text
10444
+ sx: styles$5.text
10350
10445
  }, (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : 'Style')), /*#__PURE__*/React.createElement(Grid, {
10351
10446
  className: columnClasses.column4
10352
10447
  }, /*#__PURE__*/React.createElement(Box, {
10353
- sx: styles$4.text
10448
+ sx: styles$5.text
10354
10449
  }, (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.opacity) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : 'Opacity')), /*#__PURE__*/React.createElement(Grid, {
10355
10450
  className: columnClasses.column5
10356
10451
  }, /*#__PURE__*/React.createElement(Box, {
10357
- sx: styles$4.text
10452
+ sx: styles$5.text
10358
10453
  }, (_k = (_j = settings === null || settings === void 0 ? void 0 : settings.dimensions) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : 'Dimensions')), /*#__PURE__*/React.createElement(Grid, {
10359
10454
  className: columnClasses.column6
10360
10455
  }));
@@ -10675,6 +10770,8 @@ var OpacitySelect = function OpacitySelect(_ref) {
10675
10770
  _ref$tooltipPrefix = _ref.tooltipPrefix,
10676
10771
  tooltipPrefix = _ref$tooltipPrefix === void 0 ? 'Opacity: ' : _ref$tooltipPrefix;
10677
10772
 
10773
+ var _a;
10774
+
10678
10775
  var _useControlledTooltip = useControlledTooltip(),
10679
10776
  _useControlledTooltip2 = _slicedToArray(_useControlledTooltip, 2),
10680
10777
  tooltipOpen = _useControlledTooltip2[0],
@@ -10686,6 +10783,7 @@ var OpacitySelect = function OpacitySelect(_ref) {
10686
10783
  setAnchorEl = _React$useState2[1];
10687
10784
 
10688
10785
  var isOpen = Boolean(anchorEl);
10786
+ var theme = useTheme();
10689
10787
 
10690
10788
  var handleClick = function handleClick(event) {
10691
10789
  setAnchorEl(anchorEl ? null : event.currentTarget);
@@ -10733,10 +10831,10 @@ var OpacitySelect = function OpacitySelect(_ref) {
10733
10831
  onWheel: onWheel,
10734
10832
  className: "opacity-select",
10735
10833
  "data-testid": "scrollOpacity",
10736
- sx: {
10834
+ sx: Object.assign({
10737
10835
  width: '100%',
10738
10836
  height: 32
10739
- }
10837
+ }, (_a = theme.palette.geowebColors.layerManager.opacitySelect) === null || _a === void 0 ? void 0 : _a.root)
10740
10838
  }, /*#__PURE__*/React.createElement(CustomTooltip, {
10741
10839
  title: "".concat(tooltipPrefix).concat(currentOpacityText),
10742
10840
  sx: tooltipContainerStyles(isEnabled),
@@ -10751,12 +10849,17 @@ var OpacitySelect = function OpacitySelect(_ref) {
10751
10849
  onMouseLeave: onMouseLeave,
10752
10850
  onFocus: onFocus,
10753
10851
  onBlur: onBlur,
10754
- style: {
10852
+ sx: Object.assign({
10755
10853
  height: '100%',
10756
10854
  width: '100%',
10757
10855
  borderRadius: '0',
10758
- minWidth: '49px'
10759
- },
10856
+ minWidth: '49px',
10857
+ fontSize: function fontSize(theme) {
10858
+ return theme.palette.geowebColors.layerManager.tableRowDefaultText.fontSize;
10859
+ },
10860
+ color: isEnabled ? 'geowebColors.layerManager.tableRowDefaultText.rgba' : 'geowebColors.layerManager.tableRowDisabledText.rgba'
10861
+ }, theme.palette.geowebColors.layerManager.opacitySelect.button),
10862
+ className: isOpen ? 'open' : '',
10760
10863
  // Safari-based browsers handle focus differently with buttons
10761
10864
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
10762
10865
  // Use div instead to fix onBlur hander's event.relatedTarget below
@@ -10769,14 +10872,14 @@ var OpacitySelect = function OpacitySelect(_ref) {
10769
10872
  },
10770
10873
  placement: "right"
10771
10874
  }, /*#__PURE__*/React.createElement(Box, {
10772
- sx: {
10875
+ sx: Object.assign({
10773
10876
  padding: '0 0 60px 0',
10774
10877
  backgroundColor: 'geowebColors.background.surface',
10775
10878
  width: '82px',
10776
10879
  height: '248px',
10777
10880
  boxSizing: 'initial',
10778
10881
  boxShadow: 8
10779
- }
10882
+ }, theme.palette.geowebColors.layerManager.opacitySelect.popper)
10780
10883
  }, /*#__PURE__*/React.createElement(Box, {
10781
10884
  sx: sliderHeaderStyle
10782
10885
  }, "Opacity"), /*#__PURE__*/React.createElement(CustomSlider, {
@@ -10931,8 +11034,8 @@ var RenderStyles = function RenderStyles(_ref) {
10931
11034
  * See the License for the specific language governing permissions and
10932
11035
  * limitations under the License.
10933
11036
  *
10934
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10935
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11037
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11038
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
10936
11039
  * */
10937
11040
 
10938
11041
  var getIconColor = function getIconColor(isActive, isEnabled) {
@@ -11022,7 +11125,8 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
11022
11125
  isEnabled = _ref2.isEnabled;
11023
11126
  var isActive = current !== AutoOptions.NONE;
11024
11127
  var Icon = getIcon(isActive, isEnabled, current);
11025
- return /*#__PURE__*/React.createElement(ToolButton, {
11128
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
11129
+ variant: "tool",
11026
11130
  "aria-label": current,
11027
11131
  "data-testid": "activateLayer-btn",
11028
11132
  sx: {
@@ -11030,7 +11134,7 @@ var AutoUpdateButton$1 = function AutoUpdateButton(_ref2) {
11030
11134
  backgroundColor: 'inherit'
11031
11135
  }
11032
11136
  },
11033
- active: isActive
11137
+ isSelected: isActive
11034
11138
  }, Icon);
11035
11139
  };
11036
11140
 
@@ -11121,6 +11225,7 @@ var LayerRow = function LayerRow(_ref) {
11121
11225
  layerDeleteLayout = _ref.layerDeleteLayout,
11122
11226
  layerMenuLayout = _ref.layerMenuLayout,
11123
11227
  layerActiveLayout = _ref.layerActiveLayout,
11228
+ disableActivateLayer = _ref.disableActivateLayer,
11124
11229
  dragHandle = _ref.dragHandle;
11125
11230
 
11126
11231
  var onClickRow = function onClickRow() {
@@ -11172,11 +11277,11 @@ var LayerRow = function LayerRow(_ref) {
11172
11277
  });
11173
11278
  },
11174
11279
  "data-testid": "enableButton-medium"
11175
- }, isEnabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)), layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
11280
+ }, isEnabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)), !disableActivateLayer && (layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
11176
11281
  current: AutoOptions.BOTH,
11177
11282
  onChange: onClickRow,
11178
11283
  isEnabled: true
11179
- }), /*#__PURE__*/React__default.createElement(Typography, {
11284
+ })), /*#__PURE__*/React__default.createElement(Typography, {
11180
11285
  sx: {
11181
11286
  fontWeight: '500',
11182
11287
  fontSize: '12px',
@@ -11257,11 +11362,11 @@ var LayerRow = function LayerRow(_ref) {
11257
11362
  });
11258
11363
  },
11259
11364
  "data-testid": "enableButton"
11260
- }, layer.enabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)), layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
11365
+ }, layer.enabled ? /*#__PURE__*/React__default.createElement(Visibility, null) : /*#__PURE__*/React__default.createElement(VisibilityOff, null)), !disableActivateLayer && (layerActiveLayout || /*#__PURE__*/React__default.createElement(ActivateLayer, {
11261
11366
  onChange: onClickRow,
11262
11367
  current: AutoOptions.BOTH,
11263
11368
  isEnabled: true
11264
- })), /*#__PURE__*/React__default.createElement(Grid, {
11369
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
11265
11370
  item: true,
11266
11371
  className: columnClasses.column2
11267
11372
  }, layerServicesLayout || /*#__PURE__*/React__default.createElement(RenderLayers, {
@@ -11947,7 +12052,7 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11947
12052
  layerIndex = _ref.layerIndex,
11948
12053
  settings = _ref.settings;
11949
12054
 
11950
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
12055
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
11951
12056
 
11952
12057
  var isEnabled = useSelector(function (store) {
11953
12058
  return getLayerEnabled(store, layerId);
@@ -11986,10 +12091,13 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11986
12091
  mapId: mapId,
11987
12092
  tooltipPrefix: (_f = settings === null || settings === void 0 ? void 0 : settings.opacity) === null || _f === void 0 ? void 0 : _f.tooltipPrefix
11988
12093
  }),
11989
- layerServicesLayout: /*#__PURE__*/React.createElement(RenderLayersConnect, {
12094
+ layerServicesLayout: ((_g = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _g === void 0 ? void 0 : _g.Element) ? /*#__PURE__*/React.createElement(settings.renderLayer.Element, {
12095
+ layerId: layerId,
12096
+ mapId: mapId
12097
+ }) : /*#__PURE__*/React.createElement(RenderLayersConnect, {
11990
12098
  layerId: layerId,
11991
12099
  mapId: mapId,
11992
- tooltipPrefix: (_g = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _g === void 0 ? void 0 : _g.tooltipPrefix
12100
+ tooltipPrefix: (_h = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _h === void 0 ? void 0 : _h.tooltipPrefix
11993
12101
  }),
11994
12102
  layerDimensionLayout: /*#__PURE__*/React.createElement(DimensionSelectConnect, {
11995
12103
  layerId: layerId,
@@ -11998,26 +12106,27 @@ var LayerRowConnect = function LayerRowConnect(_ref) {
11998
12106
  layerStylesLayout: /*#__PURE__*/React.createElement(RenderStylesConnect, {
11999
12107
  layerId: layerId,
12000
12108
  mapId: mapId,
12001
- tooltipPrefix: (_h = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _h === void 0 ? void 0 : _h.tooltipPrefix,
12002
- icon: (_j = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _j === void 0 ? void 0 : _j.icon
12109
+ tooltipPrefix: (_j = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _j === void 0 ? void 0 : _j.tooltipPrefix,
12110
+ icon: (_k = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _k === void 0 ? void 0 : _k.icon
12003
12111
  }),
12004
12112
  layerDeleteLayout: /*#__PURE__*/React.createElement(DeleteLayerConnect, {
12005
12113
  mapId: mapId,
12006
12114
  layerId: layerId,
12007
12115
  layerIndex: layerIndex,
12008
- tooltipTitle: (_k = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _k === void 0 ? void 0 : _k.tooltipTitle,
12009
- icon: (_l = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _l === void 0 ? void 0 : _l.icon
12116
+ tooltipTitle: (_l = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _l === void 0 ? void 0 : _l.tooltipTitle,
12117
+ icon: (_m = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _m === void 0 ? void 0 : _m.icon
12010
12118
  }),
12011
12119
  layerMenuLayout: /*#__PURE__*/React.createElement(LayerManagerMenuButtonConnect, {
12012
12120
  mapId: mapId,
12013
12121
  layerId: layerId,
12014
- tooltipTitle: (_m = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _m === void 0 ? void 0 : _m.tooltipTitle,
12015
- icon: (_o = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _o === void 0 ? void 0 : _o.icon
12122
+ tooltipTitle: (_o = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _o === void 0 ? void 0 : _o.tooltipTitle,
12123
+ icon: (_p = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _p === void 0 ? void 0 : _p.icon
12016
12124
  }),
12017
- layerActiveLayout: /*#__PURE__*/React.createElement(ActivateLayerConnect, {
12125
+ layerActiveLayout: ((_q = settings === null || settings === void 0 ? void 0 : settings.activateLayer) === null || _q === void 0 ? void 0 : _q.isDisabled) ? undefined : /*#__PURE__*/React.createElement(ActivateLayerConnect, {
12018
12126
  mapId: mapId,
12019
12127
  layerId: layerId
12020
12128
  }),
12129
+ disableActivateLayer: (_r = settings === null || settings === void 0 ? void 0 : settings.activateLayer) === null || _r === void 0 ? void 0 : _r.isDisabled,
12021
12130
  dragHandle: dragHandle
12022
12131
  });
12023
12132
  };
@@ -12065,8 +12174,8 @@ var DragHandle = function DragHandle(_ref) {
12065
12174
  disabled: isDisabled,
12066
12175
  sx: {
12067
12176
  cursor: isSorting ? 'grabbing' : 'grab',
12068
- '&:hover': {
12069
- backgroundColor: 'inherit!important'
12177
+ '&.handle:hover': function handleHover(theme) {
12178
+ return Object.assign({}, theme.palette.geowebColors.layerManager.dragHandleHover);
12070
12179
  },
12071
12180
  marginLeft: '3px',
12072
12181
  marginRight: '3px',
@@ -13030,7 +13139,7 @@ var AddLayersPopup = function AddLayersPopup(_ref) {
13030
13139
  }, "Close")));
13031
13140
  };
13032
13141
 
13033
- var styles$3 = {
13142
+ var styles$4 = {
13034
13143
  buttonDiv: {
13035
13144
  position: 'relative'
13036
13145
  },
@@ -13074,7 +13183,7 @@ var AddLayersButton = function AddLayersButton(_ref) {
13074
13183
  }, []);
13075
13184
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CustomIconButton, {
13076
13185
  onClick: handleClose,
13077
- sx: styles$3.button,
13186
+ sx: styles$4.button,
13078
13187
  disableRipple: true,
13079
13188
  "data-testid": "addLayersButton",
13080
13189
  ref: ref,
@@ -13115,24 +13224,25 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
13115
13224
  tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip,
13116
13225
  settings = _ref.settings;
13117
13226
 
13118
- var _a, _b, _c;
13227
+ var _a, _b, _c, _d, _e;
13119
13228
 
13229
+ var theme = useTheme();
13120
13230
  return /*#__PURE__*/React.createElement(Grid, {
13121
13231
  container: true,
13122
13232
  item: true,
13123
13233
  "data-testid": "baseLayerRow",
13124
13234
  className: "addLayer-column",
13125
- sx: {
13235
+ sx: Object.assign({
13126
13236
  width: '100%',
13127
13237
  height: '36px'
13128
- }
13238
+ }, theme.palette.geowebColors.layerManager.baseLayerRow.root)
13129
13239
  }, /*#__PURE__*/React.createElement(Grid, {
13130
13240
  item: true,
13131
13241
  className: columnClasses.column1,
13132
13242
  sx: {
13133
13243
  marginTop: '-2px'
13134
13244
  }
13135
- }, /*#__PURE__*/React.createElement(AddLayersButton, {
13245
+ }, !((_b = (_a = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _a === void 0 ? void 0 : _a.addLayersButton) === null || _b === void 0 ? void 0 : _b.isDisabled) && /*#__PURE__*/React.createElement(AddLayersButton, {
13136
13246
  preloadedServices: preloadedServices,
13137
13247
  tooltip: tooltip,
13138
13248
  onRenderTree: function onRenderTree(service) {
@@ -13142,14 +13252,14 @@ var BaseLayerRow = function BaseLayerRow(_ref) {
13142
13252
  layerType: LayerType.baseLayer
13143
13253
  });
13144
13254
  }
13145
- })), (_a = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _a === void 0 ? void 0 : _a.title, /*#__PURE__*/React.createElement(Grid, {
13255
+ }), (_c = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _c === void 0 ? void 0 : _c.title), /*#__PURE__*/React.createElement(Grid, {
13146
13256
  item: true,
13147
13257
  className: columnClasses.column2
13148
13258
  }, /*#__PURE__*/React.createElement(BaseLayersConnect, {
13149
13259
  mapId: mapId,
13150
13260
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
13151
- tooltipPrefix: (_b = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _b === void 0 ? void 0 : _b.tooltipPrefix,
13152
- icon: (_c = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _c === void 0 ? void 0 : _c.icon
13261
+ tooltipPrefix: (_d = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _d === void 0 ? void 0 : _d.tooltipPrefix,
13262
+ icon: (_e = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _e === void 0 ? void 0 : _e.icon
13153
13263
  })));
13154
13264
  };
13155
13265
 
@@ -13185,7 +13295,8 @@ var HeaderOptionsConnect = function HeaderOptionsConnect(_ref) {
13185
13295
  var isDockedLayerManager = _ref.isDockedLayerManager,
13186
13296
  mapId = _ref.mapId,
13187
13297
  onClickDockButton = _ref.onClickDockButton,
13188
- onChangeSize = _ref.onChangeSize;
13298
+ onChangeSize = _ref.onChangeSize,
13299
+ buttonSettings = _ref.buttonSettings;
13189
13300
  var activeMapId = useSelector(function (store) {
13190
13301
  return getActiveWindowId(store);
13191
13302
  });
@@ -13197,11 +13308,12 @@ var HeaderOptionsConnect = function HeaderOptionsConnect(_ref) {
13197
13308
  isDockedLayerManager: isDockedLayerManager,
13198
13309
  shortcutsEnabled: shortcutsEnabled,
13199
13310
  onClickDockButton: onClickDockButton,
13200
- onChangeSize: onChangeSize
13311
+ onChangeSize: onChangeSize,
13312
+ buttonSettings: buttonSettings
13201
13313
  });
13202
13314
  };
13203
13315
 
13204
- var styles$2 = {
13316
+ var styles$3 = {
13205
13317
  layerRowContainer: {
13206
13318
  position: 'relative',
13207
13319
  width: '100%',
@@ -13233,7 +13345,8 @@ var LayerManager = function LayerManager(_ref) {
13233
13345
  preloadedBaseServices = _ref.preloadedBaseServices,
13234
13346
  bounds = _ref.bounds,
13235
13347
  onClose = _ref.onClose,
13236
- showTitle = _ref.showTitle,
13348
+ _ref$title = _ref.title,
13349
+ title = _ref$title === void 0 ? 'Layer Manager' : _ref$title,
13237
13350
  isOpen = _ref.isOpen,
13238
13351
  _ref$onMouseDown = _ref.onMouseDown,
13239
13352
  onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
@@ -13260,6 +13373,9 @@ var LayerManager = function LayerManager(_ref) {
13260
13373
  _ref$setFocused = _ref.setFocused,
13261
13374
  setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused,
13262
13375
  settings = _ref.settings;
13376
+
13377
+ var _a, _b, _c, _d, _e;
13378
+
13263
13379
  var minSize = {
13264
13380
  width: 100,
13265
13381
  height: 126
@@ -13271,6 +13387,7 @@ var LayerManager = function LayerManager(_ref) {
13271
13387
  sizeInState = _React$useState2[0],
13272
13388
  setSizeInState = _React$useState2[1];
13273
13389
 
13390
+ var theme = useTheme();
13274
13391
  React.useEffect(function () {
13275
13392
  if (size !== sizeInState && isDockedLayerManager && isOpen) {
13276
13393
  setSizeInState(size);
@@ -13278,7 +13395,7 @@ var LayerManager = function LayerManager(_ref) {
13278
13395
 
13279
13396
  }, [size, isOpen]);
13280
13397
  return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
13281
- title: showTitle ? "Layer Manager ".concat(mapId) : 'Layer Manager',
13398
+ title: title,
13282
13399
  startSize: sizeInState,
13283
13400
  minWidth: minSize.width,
13284
13401
  minHeight: minSize.height,
@@ -13307,10 +13424,13 @@ var LayerManager = function LayerManager(_ref) {
13307
13424
  setSizeInState(Object.assign(Object.assign({}, sizeInState), {
13308
13425
  width: width
13309
13426
  }));
13310
- }
13427
+ },
13428
+ buttonSettings: (_a = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _a === void 0 ? void 0 : _a.controlButtonSettings
13311
13429
  }),
13430
+ dragHandleIcon: (_c = (_b = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _b === void 0 ? void 0 : _b.dragHandle) === null || _c === void 0 ? void 0 : _c.icon,
13431
+ closeIcon: (_e = (_d = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _d === void 0 ? void 0 : _d.closeButton) === null || _e === void 0 ? void 0 : _e.icon,
13312
13432
  className: "layermanager",
13313
- sx: layerManagerStyle,
13433
+ sx: Object.assign(Object.assign({}, layerManagerStyle), theme.palette.geowebColors.layerManager.root),
13314
13434
  onResizeStop: function onResizeStop(_event, _direction, node) {
13315
13435
  var width = node.offsetWidth,
13316
13436
  height = node.offsetHeight;
@@ -13347,7 +13467,7 @@ var LayerManager = function LayerManager(_ref) {
13347
13467
  })), /*#__PURE__*/React.createElement(Grid, {
13348
13468
  container: true,
13349
13469
  "data-testid": "layerManagerRowContainer",
13350
- sx: styles$2.layerRowContainer
13470
+ sx: styles$3.layerRowContainer
13351
13471
  }, /*#__PURE__*/React.createElement(DescriptionRow, {
13352
13472
  mapPresetsModule: leftHeaderComponent,
13353
13473
  mapId: mapId,
@@ -13537,8 +13657,10 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13537
13657
  preloadedMapServices = _ref.preloadedMapServices,
13538
13658
  preloadedBaseServices = _ref.preloadedBaseServices,
13539
13659
  bounds = _ref.bounds,
13540
- _ref$showTitle = _ref.showTitle,
13541
- showTitle = _ref$showTitle === void 0 ? false : _ref$showTitle,
13660
+ _ref$title = _ref.title,
13661
+ title = _ref$title === void 0 ? 'Layer Manager' : _ref$title,
13662
+ _ref$showMapIdInTitle = _ref.showMapIdInTitle,
13663
+ showMapIdInTitle = _ref$showMapIdInTitle === void 0 ? false : _ref$showMapIdInTitle,
13542
13664
  _ref$leftHeaderCompon = _ref.leftHeaderComponent,
13543
13665
  leftHeaderComponent = _ref$leftHeaderCompon === void 0 ? undefined : _ref$leftHeaderCompon;
13544
13666
  var dispatch = useDispatch();
@@ -13567,6 +13689,7 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13567
13689
  }));
13568
13690
  };
13569
13691
 
13692
+ var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
13570
13693
  return /*#__PURE__*/React.createElement(LayerManager, {
13571
13694
  mapId: mapId,
13572
13695
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
@@ -13574,7 +13697,7 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
13574
13697
  bounds: bounds,
13575
13698
  isOpen: isDialogOpen,
13576
13699
  onClose: onCloseDialog,
13577
- showTitle: showTitle,
13700
+ title: shownTitle,
13578
13701
  onMouseDown: setDialogOrder,
13579
13702
  order: dialogOrder,
13580
13703
  source: uiSource,
@@ -13616,8 +13739,10 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13616
13739
  preloadedAvailableBaseLayers = _ref.preloadedAvailableBaseLayers,
13617
13740
  preloadedBaseServices = _ref.preloadedBaseServices,
13618
13741
  bounds = _ref.bounds,
13619
- _ref$showTitle = _ref.showTitle,
13620
- showTitle = _ref$showTitle === void 0 ? false : _ref$showTitle,
13742
+ _ref$title = _ref.title,
13743
+ title = _ref$title === void 0 ? 'Layer Manager' : _ref$title,
13744
+ _ref$showMapIdInTitle = _ref.showMapIdInTitle,
13745
+ showMapIdInTitle = _ref$showMapIdInTitle === void 0 ? false : _ref$showMapIdInTitle,
13621
13746
  _ref$leftHeaderCompon = _ref.leftHeaderComponent,
13622
13747
  leftHeaderComponent = _ref$leftHeaderCompon === void 0 ? undefined : _ref$leftHeaderCompon,
13623
13748
  _ref$source = _ref.source,
@@ -13652,6 +13777,7 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13652
13777
  }));
13653
13778
  };
13654
13779
 
13780
+ var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
13655
13781
  return /*#__PURE__*/React.createElement(LayerManager, {
13656
13782
  mapId: mapId,
13657
13783
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
@@ -13659,7 +13785,7 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13659
13785
  bounds: bounds,
13660
13786
  isOpen: isDialogOpen,
13661
13787
  onClose: onCloseDialog,
13662
- showTitle: showTitle,
13788
+ title: shownTitle,
13663
13789
  leftHeaderComponent: leftHeaderComponent,
13664
13790
  // isLoading={isMapPresetLoading}
13665
13791
  // error={mapPresetError}
@@ -13689,8 +13815,8 @@ var DockedLayerManagerConnect = function DockedLayerManagerConnect(_ref) {
13689
13815
  * See the License for the specific language governing permissions and
13690
13816
  * limitations under the License.
13691
13817
  *
13692
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13693
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
13818
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13819
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
13694
13820
  * */
13695
13821
 
13696
13822
  var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_ref) {
@@ -13712,13 +13838,12 @@ var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_ref) {
13712
13838
  source: source
13713
13839
  }));
13714
13840
  }, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
13715
- return /*#__PURE__*/React.createElement(ToolButton, {
13841
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
13842
+ variant: "tool",
13716
13843
  onClick: openFilterResultsDialog,
13717
- active: isOpenInStore,
13844
+ isSelected: isOpenInStore,
13718
13845
  id: "keywordFilterButton",
13719
- "data-testid": "keywordFilterButton",
13720
- disableRipple: true,
13721
- variant: "tool"
13846
+ "data-testid": "keywordFilterButton"
13722
13847
  }, /*#__PURE__*/React.createElement(Filter, null));
13723
13848
  };
13724
13849
 
@@ -13978,8 +14103,8 @@ var LayerAddRemoveButton = function LayerAddRemoveButton(_ref) {
13978
14103
  * See the License for the specific language governing permissions and
13979
14104
  * limitations under the License.
13980
14105
  *
13981
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13982
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
14106
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14107
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
13983
14108
  * */
13984
14109
 
13985
14110
  var LayerInfoButtonConnect = function LayerInfoButtonConnect(_ref) {
@@ -14033,9 +14158,9 @@ var LayerInfoButtonConnect = function LayerInfoButtonConnect(_ref) {
14033
14158
  }
14034
14159
  };
14035
14160
 
14036
- return /*#__PURE__*/React__default.createElement(ToolButton, {
14037
- variant: "icon",
14038
- active: isActive && isOpenInStore,
14161
+ return /*#__PURE__*/React__default.createElement(CustomIconButton, {
14162
+ variant: "flat",
14163
+ isSelected: isActive && isOpenInStore,
14039
14164
  onClick: onClick,
14040
14165
  id: "layerInfoButton",
14041
14166
  "aria-label": "layer info",
@@ -15123,7 +15248,7 @@ var ServiceListConnect = function ServiceListConnect(_ref) {
15123
15248
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15124
15249
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
15125
15250
  * */
15126
- var styles$1 = {
15251
+ var styles$2 = {
15127
15252
  servicesContainer: {
15128
15253
  width: '360px',
15129
15254
  maxHeight: '412px',
@@ -15190,7 +15315,7 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15190
15315
  (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.focus();
15191
15316
  }, []);
15192
15317
  return /*#__PURE__*/React.createElement(Box, {
15193
- sx: styles$1.servicesContainer,
15318
+ sx: styles$2.servicesContainer,
15194
15319
  "data-testid": "ServiceDialog",
15195
15320
  onKeyDown: function onKeyDown(event) {
15196
15321
  if (event.key !== 'Escape') {
@@ -15200,9 +15325,9 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15200
15325
  tabIndex: -1,
15201
15326
  ref: dialogRef
15202
15327
  }, /*#__PURE__*/React.createElement(Box, {
15203
- sx: styles$1.header
15328
+ sx: styles$2.header
15204
15329
  }, "Services"), /*#__PURE__*/React.createElement(Backdrop, {
15205
- sx: styles$1.loading,
15330
+ sx: styles$2.loading,
15206
15331
  open: isLoading
15207
15332
  }, /*#__PURE__*/React.createElement(CircularProgress, null)), /*#__PURE__*/React.createElement(Rows, {
15208
15333
  services: services,
@@ -15211,12 +15336,12 @@ var ServiceOptionsDialog = function ServiceOptionsDialog(_ref) {
15211
15336
  setServicePopupInfo: setServicePopupInfo,
15212
15337
  selectedLayers: selectedLayers
15213
15338
  }), /*#__PURE__*/React.createElement(Box, {
15214
- sx: styles$1.footer
15339
+ sx: styles$2.footer
15215
15340
  }, /*#__PURE__*/React.createElement(Button, {
15216
15341
  onClick: openAddService,
15217
15342
  onKeyDown: stopTabPropagation,
15218
15343
  "data-testid": "openAddServiceButton",
15219
- sx: styles$1.button,
15344
+ sx: styles$2.button,
15220
15345
  variant: "tertiary",
15221
15346
  startIcon: /*#__PURE__*/React.createElement(Add, null)
15222
15347
  }, "Add a new service")));
@@ -16673,8 +16798,8 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
16673
16798
  * See the License for the specific language governing permissions and
16674
16799
  * limitations under the License.
16675
16800
  *
16676
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16677
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16801
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16802
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
16678
16803
  * */
16679
16804
 
16680
16805
  var MapControlButton = function MapControlButton(_a) {
@@ -16687,13 +16812,15 @@ var MapControlButton = function MapControlButton(_a) {
16687
16812
  isActive = _a$isActive === void 0 ? false : _a$isActive,
16688
16813
  props = __rest(_a, ["onClick", "children", "title", "placement", "isActive"]);
16689
16814
 
16690
- return /*#__PURE__*/React.createElement(CustomTooltip, {
16691
- placement: placement,
16692
- title: title
16693
- }, /*#__PURE__*/React.createElement(ToolButton, Object.assign({
16815
+ return /*#__PURE__*/React.createElement(CustomIconButton, Object.assign({
16816
+ variant: "tool",
16817
+ tooltipProps: {
16818
+ placement: placement,
16819
+ title: title
16820
+ },
16694
16821
  onClick: onClick,
16695
- active: isActive
16696
- }, props), children));
16822
+ isSelected: isActive
16823
+ }, props), children);
16697
16824
  };
16698
16825
 
16699
16826
  /* *
@@ -17476,8 +17603,8 @@ var MultiMapMultiDimensionSelectConnect = function MultiMapMultiDimensionSelectC
17476
17603
  * See the License for the specific language governing permissions and
17477
17604
  * limitations under the License.
17478
17605
  *
17479
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17480
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
17606
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17607
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
17481
17608
  * */
17482
17609
  var titleOn = 'Auto update on';
17483
17610
  var titleOff = 'Auto update off';
@@ -17489,21 +17616,20 @@ var AutoUpdateButton = function AutoUpdateButton(_ref) {
17489
17616
  isAutoUpdating = _ref$isAutoUpdating === void 0 ? false : _ref$isAutoUpdating,
17490
17617
  _ref$disabled = _ref.disabled,
17491
17618
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
17492
- return /*#__PURE__*/React.createElement(CustomTooltip, {
17493
- title: isAutoUpdating ? titleOn : titleOff,
17494
- "data-testid": "autoUpdateButtonTooltip"
17495
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
17496
- active: isAutoUpdating,
17619
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
17620
+ variant: "tool",
17621
+ isSelected: isAutoUpdating,
17497
17622
  disabled: disabled,
17498
17623
  onClick: function onClick() {
17499
17624
  return toggleAutoUpdate();
17500
17625
  },
17501
- "data-testid": "autoUpdateButton"
17626
+ "data-testid": "autoUpdateButton",
17627
+ tooltipTitle: isAutoUpdating ? titleOn : titleOff
17502
17628
  }, isAutoUpdating ? /*#__PURE__*/React.createElement(AutoUpdateActive, {
17503
17629
  "data-testid": "auto-update-svg-on"
17504
17630
  }) : /*#__PURE__*/React.createElement(AutoUpdateInActive, {
17505
17631
  "data-testid": "auto-update-svg-off"
17506
- }))));
17632
+ }));
17507
17633
  };
17508
17634
 
17509
17635
  var THROTTLE_WAIT_TIME = 300; // [ms]
@@ -17559,20 +17685,24 @@ var TimeSliderMenu = function TimeSliderMenu(_ref) {
17559
17685
  onKeyDown: function onKeyDown(event) {
17560
17686
  event.stopPropagation();
17561
17687
  }
17562
- }, /*#__PURE__*/React.createElement(CustomTooltip, {
17563
- title: title
17564
- }, /*#__PURE__*/React.createElement(ToolButton, {
17688
+ }, /*#__PURE__*/React.createElement(CustomIconButton, {
17689
+ variant: "tool",
17690
+ tooltipTitle: title,
17565
17691
  onClick: function onClick() {
17566
17692
  setOpen(true);
17567
17693
  },
17568
17694
  ref: setAnchorRef,
17569
- active: true,
17570
- width: "100%",
17571
- onWheel: onWheel
17695
+ isSelected: true,
17696
+ onWheel: onWheel,
17697
+ sx: {
17698
+ padding: '11px!important',
17699
+ width: '100%!important'
17700
+ }
17572
17701
  }, icon, /*#__PURE__*/React.createElement(Typography, {
17573
17702
  fontSize: 12,
17574
- fontWeight: 400
17575
- }, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text))), /*#__PURE__*/React.createElement(Menu, {
17703
+ fontWeight: 400,
17704
+ textTransform: "none"
17705
+ }, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text)), /*#__PURE__*/React.createElement(Menu, {
17576
17706
  anchorEl: anchorRef,
17577
17707
  open: open,
17578
17708
  onClose: function onClose() {
@@ -17628,12 +17758,19 @@ var TimeSliderMenu = function TimeSliderMenu(_ref) {
17628
17758
  minHeight: '30px!important'
17629
17759
  }
17630
17760
  }
17631
- }, "length"), displayVariableDuration && /*#__PURE__*/React.createElement(ToolButton, {
17761
+ }, "length"), displayVariableDuration && /*#__PURE__*/React.createElement(CustomIconButton, {
17762
+ variant: "tool",
17632
17763
  "data-testid": "menu-animation-length-button",
17633
- active: false,
17634
- disableRipple: true,
17635
- width: "100%"
17636
- }, minutesToDescribedDuration(value))));
17764
+ sx: {
17765
+ padding: '11px!important',
17766
+ width: '100%!important'
17767
+ }
17768
+ }, /*#__PURE__*/React.createElement(Typography, {
17769
+ fontSize: 14,
17770
+ fontWeight: 500,
17771
+ textTransform: "none",
17772
+ lineHeight: 2
17773
+ }, minutesToDescribedDuration(value)))));
17637
17774
  };
17638
17775
 
17639
17776
  var speedTooltipTitle = 'Speed';
@@ -17916,8 +18053,8 @@ var TimeScaleButton = function TimeScaleButton(_ref) {
17916
18053
  * See the License for the specific language governing permissions and
17917
18054
  * limitations under the License.
17918
18055
  *
17919
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17920
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
18056
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18057
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
17921
18058
  * */
17922
18059
  var title$1 = 'Now';
17923
18060
 
@@ -17926,18 +18063,18 @@ var NowButton = function NowButton(_ref) {
17926
18063
  onSetNow = _ref$onSetNow === void 0 ? function () {} : _ref$onSetNow,
17927
18064
  _ref$disabled = _ref.disabled,
17928
18065
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
17929
- return /*#__PURE__*/React.createElement(CustomTooltip, {
17930
- title: title$1,
17931
- "data-testid": "nowButtonTooltip"
17932
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
18066
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
18067
+ variant: "tool",
18068
+ "aria-label": "now",
18069
+ tooltipTitle: title$1,
18070
+ "data-testid": "nowButtonTooltip",
17933
18071
  disabled: disabled,
17934
18072
  onClick: function onClick() {
17935
18073
  return onSetNow();
17936
- },
17937
- "aria-label": "now"
18074
+ }
17938
18075
  }, /*#__PURE__*/React.createElement(Now, {
17939
18076
  "data-testid": "now-svg"
17940
- }))));
18077
+ }));
17941
18078
  };
17942
18079
 
17943
18080
  /* *
@@ -18104,21 +18241,22 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18104
18241
  setOpen(true);
18105
18242
  }
18106
18243
  }, [anchorEl, isOpenByDefault]);
18107
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(CustomTooltip, {
18108
- title: "Animation options",
18109
- placement: "bottom"
18110
- }, /*#__PURE__*/React__default.createElement("span", {
18111
- ref: function ref(_ref2) {
18112
- setAnchorEl(_ref2);
18113
- }
18114
- }, /*#__PURE__*/React__default.createElement(ToolButton, {
18244
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(CustomIconButton, {
18245
+ variant: "tool",
18115
18246
  onClick: function onClick() {
18116
18247
  setOpen(!open);
18117
18248
  },
18118
18249
  "data-testid": "optionsMenuButton",
18119
- active: open,
18120
- "aria-label": "animation options"
18121
- }, /*#__PURE__*/React__default.createElement(Options, null)))), /*#__PURE__*/React__default.createElement(Popper, {
18250
+ isSelected: open,
18251
+ "aria-label": "animation options",
18252
+ tooltipProps: {
18253
+ title: 'Animation options',
18254
+ placement: 'bottom'
18255
+ },
18256
+ ref: function ref(_ref2) {
18257
+ setAnchorEl(_ref2);
18258
+ }
18259
+ }, /*#__PURE__*/React__default.createElement(Options, null)), /*#__PURE__*/React__default.createElement(Popper, {
18122
18260
  sx: {
18123
18261
  zIndex: 3
18124
18262
  },
@@ -18127,7 +18265,11 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18127
18265
  "data-testid": "optionsMenuPopOver",
18128
18266
  anchorEl: anchorEl
18129
18267
  }, /*#__PURE__*/React__default.createElement(Paper, {
18130
- elevation: 3
18268
+ elevation: 3,
18269
+ sx: {
18270
+ position: 'relative',
18271
+ top: 1
18272
+ }
18131
18273
  }, /*#__PURE__*/React__default.createElement(Grid, {
18132
18274
  sx: {
18133
18275
  padding: '0px 10px 10px'
@@ -18157,8 +18299,8 @@ var OptionsMenuButton = function OptionsMenuButton(_ref) {
18157
18299
  * See the License for the specific language governing permissions and
18158
18300
  * limitations under the License.
18159
18301
  *
18160
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18161
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
18302
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18303
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
18162
18304
  * */
18163
18305
  var forwardTooltipTitle = 'Forward';
18164
18306
  var backwardTooltipTitle = 'Backward';
@@ -18168,17 +18310,17 @@ var BackwardForwardStepButton = function BackwardForwardStepButton(_ref) {
18168
18310
  isDisabled = _ref.isDisabled,
18169
18311
  _ref$onClickBFButton = _ref.onClickBFButton,
18170
18312
  onClickBFButton = _ref$onClickBFButton === void 0 ? function () {} : _ref$onClickBFButton;
18171
- return /*#__PURE__*/React.createElement(CustomTooltip, {
18172
- title: isForwardStep ? forwardTooltipTitle : backwardTooltipTitle
18173
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(ToolButton, {
18313
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
18314
+ variant: "tool",
18174
18315
  disabled: isDisabled,
18175
18316
  "aria-label": isForwardStep ? 'forward' : 'backward',
18176
- onClick: onClickBFButton
18317
+ onClick: onClickBFButton,
18318
+ tooltipTitle: isForwardStep ? forwardTooltipTitle : backwardTooltipTitle
18177
18319
  }, isForwardStep ? /*#__PURE__*/React.createElement(StepForward, {
18178
18320
  "data-testid": "step-forward-svg-path"
18179
18321
  }) : /*#__PURE__*/React.createElement(StepBackward, {
18180
18322
  "data-testid": "step-backward-svg-path"
18181
- }))));
18323
+ }));
18182
18324
  };
18183
18325
 
18184
18326
  /* *
@@ -18211,7 +18353,7 @@ var ControlButtons = function ControlButtons(_ref) {
18211
18353
  isForwardStep: true
18212
18354
  })), /*#__PURE__*/React.createElement(Grid, {
18213
18355
  item: true
18214
- }, playBtn || /*#__PURE__*/React.createElement(PlayButton, null)));
18356
+ }, playBtn || /*#__PURE__*/React.createElement(PlayButton$1, null)));
18215
18357
  };
18216
18358
 
18217
18359
  /* *
@@ -19179,7 +19321,7 @@ var isLeftAnimationIconArea = function isLeftAnimationIconArea(x, leftMarkerPx,
19179
19321
  };
19180
19322
 
19181
19323
  var TIME_SLIDER_LEGEND_HEIGHT = 24;
19182
- var DRAG_AREA_WIDTH = 24;
19324
+ var DRAG_AREA_WIDTH$1 = 24;
19183
19325
 
19184
19326
  function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationStartTime, onSetAnimationEndTime, leftMarkerDragging, rightMarkerDragging, animationAreaDragging, centerTime, canvasWidth, secondsPerPx, dragTooltipPosition, pixelsToLeft, setTooltipTime, startDraggingPosition) {
19185
19327
  var _React$useState = React.useState(convertStringTimeToUnix(animationStartTime)),
@@ -19237,7 +19379,7 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
19237
19379
 
19238
19380
  if (leftMarkerDragging) {
19239
19381
  var mousePosition = leftMarkerPx + x;
19240
- var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH * 2;
19382
+ var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH$1 * 2;
19241
19383
 
19242
19384
  if (mousePosition >= rightAnimationPosition || mousePosition <= 0) {
19243
19385
  return;
@@ -19254,7 +19396,7 @@ function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationSt
19254
19396
  if (rightMarkerDragging) {
19255
19397
  var _mousePosition = rightMarkerPx + x;
19256
19398
 
19257
- var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH * 2;
19399
+ var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH$1 * 2;
19258
19400
 
19259
19401
  if (leftAnimationPosition >= _mousePosition || _mousePosition >= canvasWidth) {
19260
19402
  return;
@@ -19456,7 +19598,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19456
19598
  selectedTimePx = _map4[2]; // start dragging selected time.
19457
19599
 
19458
19600
 
19459
- if (isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH)) {
19601
+ if (isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH$1)) {
19460
19602
  setCursorStyle('grabbing');
19461
19603
  setSelectedTimeDragging(true);
19462
19604
  return;
@@ -19465,7 +19607,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19465
19607
  if (animationStartTime && animationEndTime) {
19466
19608
  dragTooltipPosition.current = pixelsToLeft ? x + pixelsToLeft : x; // start dragging either marker
19467
19609
 
19468
- if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH) && !rightMarkerDragging) {
19610
+ if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH$1) && !rightMarkerDragging) {
19469
19611
  setCursorStyle('grabbing');
19470
19612
  setLeftMarkerDragging(true);
19471
19613
  setTooltipTime(moment.utc(animationStartTime));
@@ -19473,7 +19615,7 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19473
19615
  return;
19474
19616
  }
19475
19617
 
19476
- if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH) && !leftMarkerDragging) {
19618
+ if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH$1) && !leftMarkerDragging) {
19477
19619
  setCursorStyle('grabbing');
19478
19620
  setRightMarkerDragging(true);
19479
19621
  setTooltipTime(moment.utc(animationEndTime));
@@ -19520,9 +19662,9 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19520
19662
  selectedTimePx = _map6[2]; // Adjust mouse cursor while hovering draggable areas
19521
19663
 
19522
19664
 
19523
- var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH);
19524
- var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH);
19525
- var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH);
19665
+ var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH$1);
19666
+ var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH$1);
19667
+ var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH$1);
19526
19668
  var insideAnimationArea = isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx);
19527
19669
  var hoveringLegendHandles = leftAnimationIconArea || rightAnimationIconArea || selectedTimeArea || mouseDownInLegend;
19528
19670
 
@@ -19595,22 +19737,21 @@ var TimeSliderLegend = function TimeSliderLegend(_ref) {
19595
19737
  * See the License for the specific language governing permissions and
19596
19738
  * limitations under the License.
19597
19739
  *
19598
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19599
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
19740
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19741
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
19600
19742
  * */
19601
19743
 
19602
19744
  var HideSliderButton = function HideSliderButton(_ref) {
19603
19745
  var isVisible = _ref.isVisible,
19604
19746
  toggleTimeSliderIsVisible = _ref.toggleTimeSliderIsVisible;
19605
- return /*#__PURE__*/React__default.createElement(CustomTooltip, {
19606
- title: isVisible ? 'Hide timeslider' : 'Show timeslider',
19607
- "data-testid": "autoUpdateButtonTooltip"
19608
- }, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(ToolButton, {
19747
+ return /*#__PURE__*/React__default.createElement(CustomIconButton, {
19748
+ variant: "tool",
19609
19749
  onClick: function onClick() {
19610
19750
  toggleTimeSliderIsVisible(!isVisible);
19611
19751
  },
19612
- "data-testid": "hideTimeSliderButton"
19613
- }, isVisible ? /*#__PURE__*/React__default.createElement(ChevronDown, null) : /*#__PURE__*/React__default.createElement(ChevronUp, null))));
19752
+ "data-testid": "hideTimeSliderButton",
19753
+ tooltipTitle: isVisible ? 'Hide timeslider' : 'Show timeslider'
19754
+ }, isVisible ? /*#__PURE__*/React__default.createElement(ChevronDown, null) : /*#__PURE__*/React__default.createElement(ChevronUp, null));
19614
19755
  };
19615
19756
 
19616
19757
  /* *
@@ -20867,7 +21008,7 @@ var ReactMapViewLayer = function ReactMapViewLayer(props) {
20867
21008
  var tileRenderSettings = {
20868
21009
  WorldMap_Light_Grey_Canvas: {
20869
21010
  'EPSG:3857': {
20870
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap_Light_Grey_Canvas/EPSG3857/',
21011
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap_Light_Grey_Canvas/EPSG3857/',
20871
21012
  minLevel: 0,
20872
21013
  maxLevel: 9,
20873
21014
  tileServerType: 'osm',
@@ -20876,7 +21017,7 @@ var tileRenderSettings = {
20876
21017
  },
20877
21018
  OpenStreetMap_NL: {
20878
21019
  'EPSG:3857': {
20879
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreetMap_NL/EPSG3857/',
21020
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreetMap_NL/EPSG3857/',
20880
21021
  minLevel: 0,
20881
21022
  maxLevel: 16,
20882
21023
  tileServerType: 'osm',
@@ -20885,14 +21026,14 @@ var tileRenderSettings = {
20885
21026
  },
20886
21027
  OpenStreets_NL: {
20887
21028
  'EPSG:3857': {
20888
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreets_NL/EPSG3857/',
21029
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG3857/',
20889
21030
  minLevel: 0,
20890
21031
  maxLevel: 16,
20891
21032
  tileServerType: 'osm',
20892
21033
  copyRight: 'OpenStreetMap - contributors | Ingmapping'
20893
21034
  },
20894
21035
  'EPSG:28992': {
20895
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreets_NL/EPSG28992/',
21036
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG28992/',
20896
21037
  minLevel: 0,
20897
21038
  maxLevel: 16,
20898
21039
  tileServerType: 'osm',
@@ -20901,7 +21042,7 @@ var tileRenderSettings = {
20901
21042
  },
20902
21043
  Positron_NL: {
20903
21044
  'EPSG:3857': {
20904
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Positron_NL/EPSG3857/',
21045
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL/EPSG3857/',
20905
21046
  minLevel: 0,
20906
21047
  maxLevel: 16,
20907
21048
  tileServerType: 'osm',
@@ -20910,7 +21051,7 @@ var tileRenderSettings = {
20910
21051
  },
20911
21052
  Positron_NL_NoLabels: {
20912
21053
  'EPSG:3857': {
20913
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Positron_NL_NoLabels/EPSG3857/',
21054
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL_NoLabels/EPSG3857/',
20914
21055
  minLevel: 0,
20915
21056
  maxLevel: 16,
20916
21057
  tileServerType: 'osm',
@@ -20919,7 +21060,7 @@ var tileRenderSettings = {
20919
21060
  },
20920
21061
  Klokantech_Basic_NL: {
20921
21062
  'EPSG:3857': {
20922
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Klokantech_Basic_NL/EPSG3857/',
21063
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL/EPSG3857/',
20923
21064
  minLevel: 0,
20924
21065
  maxLevel: 16,
20925
21066
  tileServerType: 'osm',
@@ -20928,7 +21069,7 @@ var tileRenderSettings = {
20928
21069
  },
20929
21070
  Klokantech_Basic_NL_NoLabels: {
20930
21071
  'EPSG:3857': {
20931
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Klokantech_Basic_NL_NoLabels/EPSG3857/',
21072
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL_NoLabels/EPSG3857/',
20932
21073
  minLevel: 0,
20933
21074
  maxLevel: 16,
20934
21075
  tileServerType: 'osm',
@@ -20937,7 +21078,7 @@ var tileRenderSettings = {
20937
21078
  },
20938
21079
  OSM_Blossom_NL: {
20939
21080
  'EPSG:3857': {
20940
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OSM_Blossom_NL/EPSG3857/',
21081
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Blossom_NL/EPSG3857/',
20941
21082
  minLevel: 0,
20942
21083
  maxLevel: 16,
20943
21084
  tileServerType: 'osm',
@@ -20946,14 +21087,14 @@ var tileRenderSettings = {
20946
21087
  },
20947
21088
  WorldMap: {
20948
21089
  'EPSG:3857': {
20949
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3857/',
21090
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3857/',
20950
21091
  minLevel: 0,
20951
21092
  maxLevel: 9,
20952
21093
  tileServerType: 'osm',
20953
21094
  copyRight: 'Natural Earth II | Ingmapping'
20954
21095
  },
20955
21096
  'TODO__EPSG:4326': {
20956
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG4326/',
21097
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG4326/',
20957
21098
  minLevel: 0,
20958
21099
  maxLevel: 9,
20959
21100
  origX: -180,
@@ -20963,42 +21104,42 @@ var tileRenderSettings = {
20963
21104
  copyRight: 'Natural Earth II | Ingmapping'
20964
21105
  },
20965
21106
  'EPSG:3411': {
20966
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3411/',
21107
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3411/',
20967
21108
  minLevel: 3,
20968
21109
  maxLevel: 9,
20969
21110
  tileServerType: 'osm',
20970
21111
  copyRight: 'Natural Earth II | Ingmapping'
20971
21112
  },
20972
21113
  'EPSG:28992': {
20973
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG28992/',
21114
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG28992/',
20974
21115
  minLevel: 5,
20975
21116
  maxLevel: 9,
20976
21117
  tileServerType: 'osm',
20977
21118
  copyRight: 'Natural Earth II | Ingmapping'
20978
21119
  },
20979
21120
  'EPSG:3412': {
20980
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3412/',
21121
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3412/',
20981
21122
  minLevel: 3,
20982
21123
  maxLevel: 9,
20983
21124
  tileServerType: 'osm',
20984
21125
  copyRight: 'Natural Earth II | Ingmapping'
20985
21126
  },
20986
21127
  'EPSG:32661': {
20987
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG32661/',
21128
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG32661/',
20988
21129
  minLevel: 4,
20989
21130
  maxLevel: 9,
20990
21131
  tileServerType: 'osm',
20991
21132
  copyRight: 'Natural Earth II | Ingmapping'
20992
21133
  },
20993
21134
  'EPSG:54030': {
20994
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG54030/',
21135
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG54030/',
20995
21136
  minLevel: 3,
20996
21137
  maxLevel: 9,
20997
21138
  tileServerType: 'osm',
20998
21139
  copyRight: 'Natural Earth II | Ingmapping'
20999
21140
  },
21000
21141
  'EPSG:3575': {
21001
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3575/',
21142
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3575/',
21002
21143
  minLevel: 5,
21003
21144
  maxLevel: 9,
21004
21145
  tileServerType: 'osm',
@@ -21007,7 +21148,7 @@ var tileRenderSettings = {
21007
21148
  },
21008
21149
  OSM_Antarctica: {
21009
21150
  'EPSG:3412': {
21010
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OSM_Antarctica/EPSG3412/',
21151
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Antarctica/EPSG3412/',
21011
21152
  minLevel: 1,
21012
21153
  maxLevel: 7,
21013
21154
  origX: -3000000,
@@ -21110,7 +21251,7 @@ var tileRenderSettings = {
21110
21251
  },
21111
21252
  NaturalEarth2: {
21112
21253
  'EPSG:3411': {
21113
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3411/',
21254
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3411/',
21114
21255
  minLevel: 1,
21115
21256
  maxLevel: 6,
21116
21257
  origX: -12400000,
@@ -21120,7 +21261,7 @@ var tileRenderSettings = {
21120
21261
  copyRight: 'NPS - Natural Earth II'
21121
21262
  },
21122
21263
  'EPSG:3412': {
21123
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3412/',
21264
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3412/',
21124
21265
  minLevel: 1,
21125
21266
  maxLevel: 6,
21126
21267
  origX: -12400000,
@@ -21130,7 +21271,7 @@ var tileRenderSettings = {
21130
21271
  copyRight: 'NPS - Natural Earth II'
21131
21272
  },
21132
21273
  'EPSG:3575': {
21133
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3575/',
21274
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3575/',
21134
21275
  minLevel: 1,
21135
21276
  maxLevel: 6,
21136
21277
  origX: -13000000,
@@ -21140,14 +21281,14 @@ var tileRenderSettings = {
21140
21281
  copyRight: 'NPS - Natural Earth II'
21141
21282
  },
21142
21283
  'EPSG:3857': {
21143
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3857/',
21284
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3857/',
21144
21285
  minLevel: 1,
21145
21286
  maxLevel: 7,
21146
21287
  tileServerType: 'wmst',
21147
21288
  copyRight: 'NPS - Natural Earth II'
21148
21289
  },
21149
21290
  'EPSG:4258': {
21150
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG4326/',
21291
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
21151
21292
  minLevel: 1,
21152
21293
  maxLevel: 6,
21153
21294
  origX: -180,
@@ -21157,7 +21298,7 @@ var tileRenderSettings = {
21157
21298
  copyRight: 'NPS - Natural Earth II'
21158
21299
  },
21159
21300
  'EPSG:4326': {
21160
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG4326/',
21301
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
21161
21302
  minLevel: 1,
21162
21303
  maxLevel: 6,
21163
21304
  origX: -180,
@@ -21167,7 +21308,7 @@ var tileRenderSettings = {
21167
21308
  copyRight: 'NPS - Natural Earth II'
21168
21309
  },
21169
21310
  'EPSG:28992': {
21170
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG28992/',
21311
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG28992/',
21171
21312
  minLevel: 1,
21172
21313
  maxLevel: 5,
21173
21314
  origX: -2999000,
@@ -21177,7 +21318,7 @@ var tileRenderSettings = {
21177
21318
  copyRight: 'NPS - Natural Earth II'
21178
21319
  },
21179
21320
  'EPSG:32661': {
21180
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG32661/',
21321
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG32661/',
21181
21322
  minLevel: 1,
21182
21323
  maxLevel: 7,
21183
21324
  origX: -5000000,
@@ -21187,7 +21328,7 @@ var tileRenderSettings = {
21187
21328
  copyRight: 'NPS - Natural Earth II'
21188
21329
  },
21189
21330
  'EPSG:54030': {
21190
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG54030/',
21331
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG54030/',
21191
21332
  minLevel: 1,
21192
21333
  maxLevel: 7,
21193
21334
  origX: -17000000,
@@ -21215,86 +21356,50 @@ var tileRenderSettings = {
21215
21356
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21216
21357
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
21217
21358
  * */
21218
- var getCurrentDimensionValue = function getCurrentDimensionValue() {
21219
- var dimensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
21220
- var name = arguments.length > 1 ? arguments[1] : undefined;
21221
- var currentDimension = dimensions.find(function (dim) {
21222
- return dim.name === name;
21223
- });
21224
- return currentDimension === null || currentDimension === void 0 ? void 0 : currentDimension.currentValue;
21225
- };
21226
- var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, mapProperties, onUpdateLayerInformation) {
21359
+ var setLayerInfo = function setLayerInfo(wmLayer, mapId, onUpdateLayerInformation) {
21227
21360
  var origin = LayerActionOrigin.ReactMapViewParseLayer;
21228
- var service = WMGetServiceFromStore(wmLayer.service);
21229
- var serviceName = mapProperties.services && mapProperties.services[service.id] && mapProperties.services[service.id].name || service.id;
21230
- var webMapJSInstance = getWMJSMapById(mapId);
21361
+ var map = getWMJSMapById(mapId);
21231
21362
  /* Update list of layers for service */
21232
21363
 
21233
- var done = function done(layers) {
21234
- var updateObject = {
21364
+ var updateObject = {
21365
+ origin: origin,
21366
+ layerStyle: {
21235
21367
  origin: origin,
21236
- serviceLayers: {
21237
- name: serviceName,
21238
- id: service.id,
21239
- serviceUrl: wmLayer.service,
21240
- layers: layers,
21241
- scope: 'system'
21242
- },
21243
- layerStyle: {
21244
- origin: origin,
21245
- layerId: wmLayer.ReactWMJSLayerId,
21246
- style: wmLayer.currentStyle
21247
- },
21248
- mapDimensions: {
21249
- origin: origin,
21250
- mapId: mapId,
21251
- dimensions: webMapJSInstance.mapdimensions.map(function (_ref) {
21252
- var name = _ref.name,
21253
- units = _ref.units,
21254
- currentValue = _ref.currentValue,
21255
- synced = _ref.synced;
21256
- var reactDim = mapProperties.dimensions && mapProperties.dimensions.find(function (dim) {
21257
- return dim.name === name;
21258
- });
21259
- var newDimValue = reactDim && reactDim.currentValue || currentValue;
21260
- var newDimSynced = reactDim && reactDim.synced || synced;
21261
- return {
21262
- name: name,
21263
- units: units,
21264
- currentValue: newDimValue,
21265
- synced: newDimSynced
21266
- };
21267
- })
21268
- },
21269
- layerDimensions: {
21270
- origin: origin,
21271
- layerId: wmLayer.id,
21272
- dimensions: wmLayer.dimensions.map(function (dim) {
21273
- var name = dim.name,
21274
- units = dim.units,
21275
- synced = dim.synced;
21276
- var currentDimensionValue = getCurrentDimensionValue(wmLayer.dimensions, name);
21277
- var newDimensionValue = currentDimensionValue || dim.getValue();
21278
- return {
21279
- name: name,
21280
- units: units,
21281
- currentValue: newDimensionValue,
21282
- minValue: dim.getFirstValue(),
21283
- maxValue: dim.getLastValue(),
21284
- timeInterval: dim.getDimInterval(),
21285
- values: dim.getValues(),
21286
- synced: synced
21287
- };
21288
- })
21289
- }
21290
- };
21291
- onUpdateLayerInformation && onUpdateLayerInformation(updateObject);
21368
+ layerId: wmLayer.ReactWMJSLayerId,
21369
+ style: wmLayer.currentStyle
21370
+ },
21371
+ mapDimensions: {
21372
+ mapId: mapId,
21373
+ origin: origin,
21374
+ dimensions: map && map.mapdimensions.map(function (mapdim) {
21375
+ return {
21376
+ units: mapdim.units,
21377
+ currentValue: mapdim.currentValue,
21378
+ name: mapdim.name
21379
+ };
21380
+ }) || []
21381
+ },
21382
+ layerDimensions: {
21383
+ origin: origin,
21384
+ layerId: wmLayer.id,
21385
+ dimensions: wmLayer.dimensions.map(function (dim) {
21386
+ var name = dim.name,
21387
+ units = dim.units,
21388
+ synced = dim.synced;
21389
+ return {
21390
+ name: name,
21391
+ units: units,
21392
+ currentValue: dim.getValue(),
21393
+ minValue: dim.getFirstValue(),
21394
+ maxValue: dim.getLastValue(),
21395
+ timeInterval: dim.getDimInterval(),
21396
+ values: dim.getValues(),
21397
+ synced: synced
21398
+ };
21399
+ })
21400
+ }
21292
21401
  };
21293
-
21294
- service.getLayerObjectsFlat(done, function () {// do nothing
21295
- }, false, {
21296
- headers: wmLayer.headers
21297
- });
21402
+ onUpdateLayerInformation && onUpdateLayerInformation(updateObject);
21298
21403
  };
21299
21404
 
21300
21405
  /* *
@@ -21393,8 +21498,7 @@ var checkHoverVertice = function checkHoverVertice(feature, mouseX, mouseY, conv
21393
21498
  coordinateIndexInFeature: _polygonIndex
21394
21499
  };
21395
21500
  }
21396
- } catch (e) {
21397
- console.warn(e);
21501
+ } catch (e) {// console.warn(e);
21398
21502
  }
21399
21503
  }
21400
21504
  }
@@ -24050,7 +24154,7 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
24050
24154
  mapId = _this$props.mapId;
24051
24155
 
24052
24156
  try {
24053
- setServiceMetadata(wmLayer, mapId, _this.props, onUpdateLayerInformation);
24157
+ setLayerInfo(wmLayer, mapId, onUpdateLayerInformation);
24054
24158
  } catch (e) {
24055
24159
  /* Provide a hint on what is going wrong */
24056
24160
  console.error(e);
@@ -24350,7 +24454,6 @@ var ReactMapView = /*#__PURE__*/function (_React$Component) {
24350
24454
  _mapId = props.mapId;
24351
24455
  onUpdateLayerInformation && onUpdateLayerInformation({
24352
24456
  origin: ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO,
24353
- serviceLayers: null,
24354
24457
  layerStyle: null,
24355
24458
  layerDimensions: null,
24356
24459
  mapDimensions: {
@@ -25532,8 +25635,8 @@ var OptionsMenuConnect = function OptionsMenuConnect(_ref) {
25532
25635
  * See the License for the specific language governing permissions and
25533
25636
  * limitations under the License.
25534
25637
  *
25535
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25536
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
25638
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25639
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
25537
25640
  * */
25538
25641
  var ClockContainer = function ClockContainer(_ref) {
25539
25642
  var fontSize = _ref.fontSize,
@@ -25566,13 +25669,14 @@ var ClockContainer = function ClockContainer(_ref) {
25566
25669
  item: true,
25567
25670
  zIndex: 2,
25568
25671
  ref: setButtonElement
25569
- }, /*#__PURE__*/React__default.createElement(ToolButton, {
25672
+ }, /*#__PURE__*/React__default.createElement(CustomIconButton, {
25673
+ variant: "tool",
25570
25674
  onClick: onButtonClick,
25571
25675
  sx: {
25572
25676
  color: '#fff!important'
25573
25677
  },
25574
25678
  "aria-label": "Animation options",
25575
- active: isPopperOpen
25679
+ isSelected: isPopperOpen
25576
25680
  }, /*#__PURE__*/React__default.createElement(Icon, {
25577
25681
  isPopperOpen: isPopperOpen,
25578
25682
  popperPlacement: popperPlacement
@@ -26004,6 +26108,31 @@ var getLayersToUpdate = function getLayersToUpdate(layers, mapId) {
26004
26108
  });
26005
26109
  };
26006
26110
 
26111
+ /* *
26112
+ * Licensed under the Apache License, Version 2.0 (the "License");
26113
+ * you may not use this file except in compliance with the License.
26114
+ * You may obtain a copy of the License at
26115
+ *
26116
+ * http://www.apache.org/licenses/LICENSE-2.0
26117
+ *
26118
+ * Unless required by applicable law or agreed to in writing, software
26119
+ * distributed under the License is distributed on an "AS IS" BASIS,
26120
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26121
+ * See the License for the specific language governing permissions and
26122
+ * limitations under the License.
26123
+ *
26124
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26125
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
26126
+ * */
26127
+ var sanitizeHTML = function sanitizeHTML(htmlToBeSanitezed) {
26128
+ return {
26129
+ __html: DOMPurify.sanitize(htmlToBeSanitezed, {
26130
+ ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a', 'table', 'td', 'tr', 'br', 'hr', 'th'],
26131
+ ALLOWED_ATTR: ['href']
26132
+ })
26133
+ };
26134
+ };
26135
+
26007
26136
  var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
26008
26137
  var layers = _ref.layers,
26009
26138
  isOpen = _ref.isOpen,
@@ -26191,9 +26320,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
26191
26320
  },
26192
26321
  "data-testid": "layer-result-ready-".concat(layerId),
26193
26322
  // eslint-disable-next-line react/no-danger
26194
- dangerouslySetInnerHTML: {
26195
- __html: result.data.replace(/<hr\/>/g, '')
26196
- }
26323
+ dangerouslySetInnerHTML: sanitizeHTML(result.data)
26197
26324
  }) : /*#__PURE__*/React__default.createElement("div", {
26198
26325
  "data-testid": "layer-result-loading-".concat(layerId)
26199
26326
  }, /*#__PURE__*/React__default.createElement(CircularProgress, {
@@ -26549,17 +26676,27 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
26549
26676
  var syncGroupAddTarget = React__default.useCallback(function (payload) {
26550
26677
  dispatch(genericActions.syncGroupAddTarget(payload));
26551
26678
  }, [dispatch]);
26679
+ var syncTargets = useSelector(function (store) {
26680
+ return getSyncGroupTargets(store);
26681
+ });
26552
26682
  React__default.useEffect(function () {
26553
26683
  maps.forEach(function (map) {
26554
26684
  map.syncGroupsIds && map.syncGroupsIds.forEach(function (syncGroupsId) {
26555
- syncGroupAddTarget({
26556
- groupId: syncGroupsId,
26557
- targetId: map.id,
26558
- linked: true
26559
- });
26685
+ var alreadySyncedTargetIndex = syncTargets.findIndex(function (target) {
26686
+ return target.targetId === map.id && target.groupId === syncGroupsId && target.linked === true;
26687
+ }); // Only trigger an action if the target was not yet added to the group or was not linked.
26688
+
26689
+ if (alreadySyncedTargetIndex === -1) {
26690
+ syncGroupAddTarget({
26691
+ groupId: syncGroupsId,
26692
+ targetId: map.id,
26693
+ linked: true,
26694
+ origin: 'system'
26695
+ });
26696
+ }
26560
26697
  });
26561
26698
  });
26562
- }, [maps, syncGroupAddTarget]);
26699
+ }, [maps, syncGroupAddTarget, syncTargets]);
26563
26700
  var mapStyle = {
26564
26701
  width: "".concat(Math.round(100 / cols), "%"),
26565
26702
  height: "".concat(Math.round(100 / rows), "%")
@@ -26824,6 +26961,793 @@ var HarmonieTempAndPrecipPreset = function HarmonieTempAndPrecipPreset(_ref) {
26824
26961
  });
26825
26962
  };
26826
26963
 
26964
+ /* *
26965
+ * Licensed under the Apache License, Version 2.0 (the "License");
26966
+ * you may not use this file except in compliance with the License.
26967
+ * You may obtain a copy of the License at
26968
+ *
26969
+ * http://www.apache.org/licenses/LICENSE-2.0
26970
+ *
26971
+ * Unless required by applicable law or agreed to in writing, software
26972
+ * distributed under the License is distributed on an "AS IS" BASIS,
26973
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26974
+ * See the License for the specific language governing permissions and
26975
+ * limitations under the License.
26976
+ *
26977
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26978
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
26979
+ * */
26980
+ var timeSliderLiteButtonDefaultProps = {
26981
+ sx: {
26982
+ width: '36px',
26983
+ height: '36px'
26984
+ }
26985
+ };
26986
+ var timeSliderLiteTooltipDefaultProps = {
26987
+ placement: 'top'
26988
+ };
26989
+
26990
+ /* *
26991
+ * Licensed under the Apache License, Version 2.0 (the "License");
26992
+ * you may not use this file except in compliance with the License.
26993
+ * You may obtain a copy of the License at
26994
+ *
26995
+ * http://www.apache.org/licenses/LICENSE-2.0
26996
+ *
26997
+ * Unless required by applicable law or agreed to in writing, software
26998
+ * distributed under the License is distributed on an "AS IS" BASIS,
26999
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27000
+ * See the License for the specific language governing permissions and
27001
+ * limitations under the License.
27002
+ *
27003
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27004
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27005
+ * */
27006
+
27007
+ var HideButton = function HideButton(_ref) {
27008
+ var isVisible = _ref.isVisible,
27009
+ settings = _ref.settings,
27010
+ onClick = _ref.onClick;
27011
+
27012
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27013
+
27014
+ var hideTitle = (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.label) === null || _a === void 0 ? void 0 : _a.hide) !== null && _b !== void 0 ? _b : 'Hide timeslider';
27015
+ var showTitle = (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.label) === null || _c === void 0 ? void 0 : _c.show) !== null && _d !== void 0 ? _d : 'Show timeslider';
27016
+ var hideIcon = (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _e === void 0 ? void 0 : _e.hide) !== null && _f !== void 0 ? _f : /*#__PURE__*/React__default.createElement(ChevronDown, null);
27017
+ var showIcon = (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _g === void 0 ? void 0 : _g.show) !== null && _h !== void 0 ? _h : /*#__PURE__*/React__default.createElement(ChevronUp, null);
27018
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27019
+ title: isVisible ? hideTitle : showTitle
27020
+ }), /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27021
+ "aria-selected": !isVisible,
27022
+ onClick: onClick,
27023
+ "data-testid": "TimeSliderLite-HideButton"
27024
+ }), isVisible ? hideIcon : showIcon));
27025
+ };
27026
+
27027
+ /* *
27028
+ * Licensed under the Apache License, Version 2.0 (the "License");
27029
+ * you may not use this file except in compliance with the License.
27030
+ * You may obtain a copy of the License at
27031
+ *
27032
+ * http://www.apache.org/licenses/LICENSE-2.0
27033
+ *
27034
+ * Unless required by applicable law or agreed to in writing, software
27035
+ * distributed under the License is distributed on an "AS IS" BASIS,
27036
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27037
+ * See the License for the specific language governing permissions and
27038
+ * limitations under the License.
27039
+ *
27040
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27041
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27042
+ * */
27043
+
27044
+ var ControlButtonGroup = function ControlButtonGroup(_ref) {
27045
+ var children = _ref.children,
27046
+ right = _ref.right,
27047
+ left = _ref.left;
27048
+ return /*#__PURE__*/React__default.createElement(ButtonGroup, {
27049
+ orientation: "horizontal",
27050
+ fullWidth: true,
27051
+ sx: Object.assign(Object.assign(Object.assign({}, right && {
27052
+ borderTopLeftRadius: 0,
27053
+ borderBottomLeftRadius: 0
27054
+ }), left && {
27055
+ borderTopRightRadius: 0,
27056
+ borderBottomRightRadius: 0
27057
+ }), {
27058
+ backgroundColor: 'geowebColors.background.surface',
27059
+ height: '100%',
27060
+ alignItems: 'center',
27061
+ justifyContent: 'center',
27062
+ padding: '4px',
27063
+ gap: '2px'
27064
+ })
27065
+ }, children);
27066
+ };
27067
+
27068
+ /* *
27069
+ * Licensed under the Apache License, Version 2.0 (the "License");
27070
+ * you may not use this file except in compliance with the License.
27071
+ * You may obtain a copy of the License at
27072
+ *
27073
+ * http://www.apache.org/licenses/LICENSE-2.0
27074
+ *
27075
+ * Unless required by applicable law or agreed to in writing, software
27076
+ * distributed under the License is distributed on an "AS IS" BASIS,
27077
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27078
+ * See the License for the specific language governing permissions and
27079
+ * limitations under the License.
27080
+ *
27081
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27082
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27083
+ * */
27084
+ var TICK_HEIGHT = 8;
27085
+ var TIME_SLIDER_LITE_PADDING_RIGHT = 1;
27086
+
27087
+ var TimeSliderLiteBackgroundSvg = function TimeSliderLiteBackgroundSvg(_ref) {
27088
+ var width = _ref.width,
27089
+ height = _ref.height,
27090
+ startTime = _ref.startTime,
27091
+ endTime = _ref.endTime,
27092
+ style = _ref.style,
27093
+ locale = _ref.locale;
27094
+
27095
+ var _useTheme = useTheme(),
27096
+ timeSliderLite = _useTheme.palette.geowebColors.timeSliderLite;
27097
+
27098
+ if (!width) {
27099
+ return /*#__PURE__*/React__default.createElement("svg", {
27100
+ style: style,
27101
+ height: height
27102
+ });
27103
+ } // Convert start and end time from Unix timestamp to JavaScript Date object
27104
+
27105
+
27106
+ var startDate = new Date(startTime * 1000);
27107
+ var endDate = new Date(endTime * 1000);
27108
+ var totalDays = (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24);
27109
+ var tickSpacing = width / totalDays;
27110
+ var tickOffset = (startDate.getHours() + startDate.getMinutes() / 60) / 24 * tickSpacing; // Set up variables for date labels and background colors
27111
+
27112
+ var dayLabels = [];
27113
+ var currentDate = startDate;
27114
+ var lastDayLabelDate = new Date(endDate.getTime() + 2 * 24 * 60 * 60 * 1000); // Append two more days
27115
+
27116
+ while (currentDate < lastDayLabelDate) {
27117
+ var dateString = currentDate.toLocaleDateString(locale, {
27118
+ weekday: 'short',
27119
+ month: 'numeric',
27120
+ day: 'numeric'
27121
+ });
27122
+ var label = dateString.charAt(0).toUpperCase() + dateString.slice(1);
27123
+ dayLabels.push(label);
27124
+ currentDate.setDate(currentDate.getDate() + 1);
27125
+ }
27126
+
27127
+ var backgroundRectangles = dayLabels.map(function (label, index) {
27128
+ return /*#__PURE__*/React__default.createElement("rect", {
27129
+ x: index * tickSpacing - tickOffset,
27130
+ y: 0,
27131
+ width: tickSpacing,
27132
+ height: height,
27133
+ fill: index % 2 === 0 ? timeSliderLite.timelineBackground.fill : timeSliderLite.timelineBackgroundAlternative.fill,
27134
+ key: "".concat(label, "-color")
27135
+ });
27136
+ });
27137
+ var labels = dayLabels.map(function (label, index) {
27138
+ return /*#__PURE__*/React__default.createElement("text", {
27139
+ x: index * tickSpacing + 8 - tickOffset,
27140
+ y: 14,
27141
+ fill: timeSliderLite.timeline.fill,
27142
+ textAnchor: "left",
27143
+ fontSize: "12px",
27144
+ key: "".concat(label, "-text"),
27145
+ style: {
27146
+ userSelect: 'none'
27147
+ }
27148
+ }, dayLabels[index]);
27149
+ });
27150
+ var ticksPerDay = 4;
27151
+ var tickMarks = dayLabels.map(function (label, index) {
27152
+ return Array.from({
27153
+ length: ticksPerDay + 1
27154
+ }, function (_, value) {
27155
+ return /*#__PURE__*/React__default.createElement("line", {
27156
+ x1: index * tickSpacing + value * (tickSpacing / ticksPerDay) - tickOffset,
27157
+ y1: height,
27158
+ x2: index * tickSpacing + value * (tickSpacing / ticksPerDay) - tickOffset,
27159
+ y2: Math.floor(height - TICK_HEIGHT),
27160
+ stroke: timeSliderLite.timeline.stroke,
27161
+ key: "".concat(label, "-").concat(value)
27162
+ });
27163
+ });
27164
+ }).flat();
27165
+ return /*#__PURE__*/React__default.createElement("svg", {
27166
+ style: style,
27167
+ width: width + TIME_SLIDER_LITE_PADDING_RIGHT,
27168
+ height: height
27169
+ }, backgroundRectangles, tickMarks, labels);
27170
+ };
27171
+
27172
+ /* *
27173
+ * Licensed under the Apache License, Version 2.0 (the "License");
27174
+ * you may not use this file except in compliance with the License.
27175
+ * You may obtain a copy of the License at
27176
+ *
27177
+ * http://www.apache.org/licenses/LICENSE-2.0
27178
+ *
27179
+ * Unless required by applicable law or agreed to in writing, software
27180
+ * distributed under the License is distributed on an "AS IS" BASIS,
27181
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27182
+ * See the License for the specific language governing permissions and
27183
+ * limitations under the License.
27184
+ *
27185
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27186
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27187
+ * */
27188
+ var MILLISECOND_TO_SECOND = 1 / 1000;
27189
+ /**
27190
+ * Reformats a date that has capitalized first letter and colon separator for time
27191
+ * @param dateString Date string from Date.toLocaleDateString
27192
+ * @returns Reformatted date string
27193
+ */
27194
+
27195
+ var reformatFinnishDateString = function reformatFinnishDateString(dateString) {
27196
+ var charPositionOfTimestamp = -4;
27197
+ return dateString.charAt(0).toUpperCase() + dateString.slice(1, charPositionOfTimestamp) + dateString.slice(charPositionOfTimestamp).replace('.', ':');
27198
+ };
27199
+ var getSelectedTimePx = function getSelectedTimePx(startTime, endTime, selectedTime, width) {
27200
+ var startDate = new Date(startTime * 1000);
27201
+ var startDateX = startDate.getTime() * MILLISECOND_TO_SECOND;
27202
+ var selectedTimeX = selectedTime - startDateX;
27203
+ var needleX = Math.floor(selectedTimeX / (endTime - startTime) * width);
27204
+ return needleX;
27205
+ };
27206
+ var boundedValue = function boundedValue(value, bounds) {
27207
+ var _bounds = _slicedToArray(bounds, 2),
27208
+ min = _bounds[0],
27209
+ max = _bounds[1];
27210
+
27211
+ return Math.max(min, Math.min(max, value));
27212
+ };
27213
+ var getSelectedTimeFromPx = function getSelectedTimeFromPx(startTime, endTime, selectedTimePx, width) {
27214
+ var startDate = new Date(startTime * 1000);
27215
+ var startDateX = startDate.getTime() * MILLISECOND_TO_SECOND;
27216
+ var selectedTimeX = Math.floor(selectedTimePx / width * (endTime - startTime));
27217
+ var selectedTime = selectedTimeX + startDateX;
27218
+ return selectedTime;
27219
+ };
27220
+
27221
+ /* *
27222
+ * Licensed under the Apache License, Version 2.0 (the "License");
27223
+ * you may not use this file except in compliance with the License.
27224
+ * You may obtain a copy of the License at
27225
+ *
27226
+ * http://www.apache.org/licenses/LICENSE-2.0
27227
+ *
27228
+ * Unless required by applicable law or agreed to in writing, software
27229
+ * distributed under the License is distributed on an "AS IS" BASIS,
27230
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27231
+ * See the License for the specific language governing permissions and
27232
+ * limitations under the License.
27233
+ *
27234
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27235
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27236
+ * */
27237
+ var DRAG_AREA_WIDTH = 10;
27238
+ var NEEDLE_WIDTH = 5;
27239
+ var SHADOW_SPREAD = 2;
27240
+
27241
+ var NeedleShadow = function NeedleShadow(_ref) {
27242
+ var x = _ref.x,
27243
+ stroke = _ref.stroke,
27244
+ height = _ref.height,
27245
+ width = _ref.width;
27246
+ return /*#__PURE__*/React__default.createElement("line", {
27247
+ x1: x,
27248
+ y1: height - (height - SHADOW_SPREAD / 2),
27249
+ x2: x,
27250
+ y2: height - SHADOW_SPREAD / 2,
27251
+ strokeWidth: width + SHADOW_SPREAD,
27252
+ stroke: stroke,
27253
+ strokeLinecap: "round",
27254
+ filter: "blur(0.5px)",
27255
+ "data-testid": "TimeSliderLite-NeedleShadow"
27256
+ });
27257
+ };
27258
+
27259
+ var NeedleLine = function NeedleLine(_ref2) {
27260
+ var x = _ref2.x,
27261
+ stroke = _ref2.stroke,
27262
+ height = _ref2.height,
27263
+ width = _ref2.width;
27264
+ return /*#__PURE__*/React__default.createElement("line", {
27265
+ x1: x,
27266
+ y1: width / 2,
27267
+ x2: x,
27268
+ y2: height - width / 2,
27269
+ strokeWidth: width,
27270
+ strokeLinecap: "round",
27271
+ stroke: stroke,
27272
+ "data-testid": "TimeSliderLite-NeedleLine"
27273
+ });
27274
+ };
27275
+
27276
+ var TimeSliderDraggableNeedle = function TimeSliderDraggableNeedle(_ref3) {
27277
+ var draggableLabel = _ref3.draggableLabel,
27278
+ width = _ref3.width,
27279
+ height = _ref3.height,
27280
+ locale = _ref3.locale,
27281
+ startTime = _ref3.startTime,
27282
+ endTime = _ref3.endTime,
27283
+ _ref3$needleDragAreaW = _ref3.needleDragAreaWidth,
27284
+ needleDragAreaWidth = _ref3$needleDragAreaW === void 0 ? DRAG_AREA_WIDTH : _ref3$needleDragAreaW,
27285
+ needleLabelZIndex = _ref3.needleLabelZIndex,
27286
+ needleLabelOffset = _ref3.needleLabelOffset,
27287
+ _ref3$needleWidth = _ref3.needleWidth,
27288
+ needleWidth = _ref3$needleWidth === void 0 ? NEEDLE_WIDTH : _ref3$needleWidth,
27289
+ timeStep = _ref3.timeStep,
27290
+ selectedTime = _ref3.selectedTime,
27291
+ setSelectedTime = _ref3.setSelectedTime,
27292
+ style = _ref3.style;
27293
+ var draggableRef = useRef(null);
27294
+
27295
+ var _useTheme = useTheme(),
27296
+ timeSliderLite = _useTheme.palette.geowebColors.timeSliderLite;
27297
+
27298
+ var x = getSelectedTimePx(startTime, endTime, selectedTime, width) - needleDragAreaWidth / 2;
27299
+ var roundedSelectedTime = Math.floor(selectedTime / timeStep) * timeStep;
27300
+ var dateString = new Date(roundedSelectedTime * 1000).toLocaleDateString(locale, {
27301
+ weekday: 'short',
27302
+ month: 'numeric',
27303
+ day: 'numeric',
27304
+ hour: 'numeric',
27305
+ minute: 'numeric'
27306
+ });
27307
+ var label = locale === 'fi' || locale === 'sv-FI' ? reformatFinnishDateString(dateString) : dateString;
27308
+ return /*#__PURE__*/React__default.createElement(Draggable, {
27309
+ handle: ".TimeSliderLite-DraggableNeedle",
27310
+ axis: "x",
27311
+ nodeRef: draggableRef,
27312
+ bounds: {
27313
+ left: -needleDragAreaWidth / 2,
27314
+ right: width - needleDragAreaWidth / 2
27315
+ },
27316
+ position: {
27317
+ x: x,
27318
+ y: 0
27319
+ },
27320
+ onDrag: function onDrag(_, position) {
27321
+ var positionOffsetToCompensateFlooring = 0.5;
27322
+ var newSelectedTime = getSelectedTimeFromPx(startTime, endTime, position.x + needleDragAreaWidth / 2 + positionOffsetToCompensateFlooring, width);
27323
+ setSelectedTime(newSelectedTime);
27324
+ },
27325
+ onStop: function onStop(_, position) {
27326
+ var positionOffsetToCompensateFlooring = 0.5;
27327
+ var newSelectedTime = getSelectedTimeFromPx(startTime, endTime, position.x + needleDragAreaWidth / 2 + positionOffsetToCompensateFlooring, width);
27328
+ var roundedSelectedTime = Math.floor(newSelectedTime / timeStep) * timeStep;
27329
+ setSelectedTime(roundedSelectedTime);
27330
+ }
27331
+ }, /*#__PURE__*/React__default.createElement("div", {
27332
+ className: "TimeSliderLite-DraggableNeedle",
27333
+ ref: draggableRef,
27334
+ "data-testid": "TimeSliderLite-DraggableNeedle"
27335
+ }, /*#__PURE__*/React__default.createElement(Tooltip, {
27336
+ title: label,
27337
+ arrow: true,
27338
+ placement: "top",
27339
+ open: true,
27340
+ componentsProps: {
27341
+ tooltip: {
27342
+ sx: {
27343
+ padding: '0 3px 0 3px',
27344
+ fontSize: '12px',
27345
+ backgroundColor: timeSliderLite.needleLabel.backgroundColor,
27346
+ border: "1px solid ".concat(timeSliderLite.needleLabel.borderColor)
27347
+ }
27348
+ },
27349
+ arrow: {
27350
+ sx: {
27351
+ color: timeSliderLite.needleLabel.backgroundColor
27352
+ }
27353
+ },
27354
+ popper: {
27355
+ className: draggableLabel ? 'TimeSliderLite-DraggableNeedle' : '',
27356
+ sx: {
27357
+ pointerEvents: draggableLabel ? null : 'none',
27358
+ zIndex: needleLabelZIndex !== null && needleLabelZIndex !== void 0 ? needleLabelZIndex : null,
27359
+ cursor: draggableLabel ? 'ew-resize' : 'default'
27360
+ },
27361
+ modifiers: [{
27362
+ name: 'offset',
27363
+ options: {
27364
+ offset: needleLabelOffset !== null && needleLabelOffset !== void 0 ? needleLabelOffset : [0, 30 - height]
27365
+ }
27366
+ }]
27367
+ }
27368
+ }
27369
+ }, /*#__PURE__*/React__default.createElement("svg", {
27370
+ style: style,
27371
+ cursor: "ew-resize",
27372
+ width: needleDragAreaWidth,
27373
+ height: height,
27374
+ "data-testid": "TimeSliderLite-NeedleSvg"
27375
+ }, /*#__PURE__*/React__default.createElement(NeedleShadow, {
27376
+ x: needleDragAreaWidth / 2,
27377
+ stroke: timeSliderLite.needleShadow.stroke,
27378
+ height: height,
27379
+ width: needleWidth
27380
+ }), /*#__PURE__*/React__default.createElement(NeedleLine, {
27381
+ x: needleDragAreaWidth / 2,
27382
+ stroke: timeSliderLite.needle.stroke,
27383
+ height: height,
27384
+ width: needleWidth
27385
+ })))));
27386
+ };
27387
+
27388
+ var TimeSliderLiteBackground = function TimeSliderLiteBackground(_ref) {
27389
+ var height = _ref.height,
27390
+ draggableTimeStamp = _ref.draggableTimeStamp,
27391
+ locale = _ref.locale,
27392
+ startTime = _ref.startTime,
27393
+ endTime = _ref.endTime,
27394
+ needleWidth = _ref.needleWidth,
27395
+ needleDragAreaWidth = _ref.needleDragAreaWidth,
27396
+ needleLabelZIndex = _ref.needleLabelZIndex,
27397
+ needleLabelOffset = _ref.needleLabelOffset,
27398
+ timeStep = _ref.timeStep,
27399
+ selectedTime = _ref.selectedTime,
27400
+ setSelectedTime = _ref.setSelectedTime;
27401
+ var sliderAreaRef = useRef(null);
27402
+
27403
+ var _React$useState = React__default.useState(0),
27404
+ _React$useState2 = _slicedToArray(_React$useState, 2),
27405
+ areaWidth = _React$useState2[0],
27406
+ setAreaWidth = _React$useState2[1];
27407
+
27408
+ var drawNeedle = selectedTime && areaWidth;
27409
+ useLayoutEffect(function () {
27410
+ var sliderArea = sliderAreaRef.current;
27411
+ setAreaWidth(sliderArea.clientWidth - TIME_SLIDER_LITE_PADDING_RIGHT);
27412
+ var observer = new ResizeObserver(function () {
27413
+ setAreaWidth(sliderArea.clientWidth - TIME_SLIDER_LITE_PADDING_RIGHT);
27414
+ });
27415
+ observer.observe(sliderArea);
27416
+ return function () {
27417
+ observer.disconnect();
27418
+ };
27419
+ }, [sliderAreaRef]);
27420
+ return /*#__PURE__*/React__default.createElement(Box, {
27421
+ ref: sliderAreaRef,
27422
+ sx: {
27423
+ position: 'relative',
27424
+ height: "".concat(height, "px"),
27425
+ overflow: 'hidden',
27426
+ width: '100%'
27427
+ },
27428
+ "data-testid": "TimeSliderLite-Background"
27429
+ }, /*#__PURE__*/React__default.createElement(TimeSliderLiteBackgroundSvg, {
27430
+ style: {
27431
+ position: 'absolute',
27432
+ top: 0
27433
+ },
27434
+ width: areaWidth,
27435
+ height: height,
27436
+ startTime: startTime,
27437
+ endTime: endTime,
27438
+ locale: locale
27439
+ }), drawNeedle && /*#__PURE__*/React__default.createElement(TimeSliderDraggableNeedle, {
27440
+ needleWidth: needleWidth,
27441
+ draggableLabel: draggableTimeStamp,
27442
+ style: {
27443
+ position: 'absolute',
27444
+ top: 0
27445
+ },
27446
+ locale: locale,
27447
+ width: areaWidth,
27448
+ needleDragAreaWidth: needleDragAreaWidth,
27449
+ needleLabelZIndex: needleLabelZIndex,
27450
+ needleLabelOffset: needleLabelOffset,
27451
+ height: height,
27452
+ startTime: startTime,
27453
+ endTime: endTime,
27454
+ timeStep: timeStep,
27455
+ selectedTime: selectedTime,
27456
+ setSelectedTime: setSelectedTime
27457
+ }));
27458
+ };
27459
+
27460
+ /* *
27461
+ * Licensed under the Apache License, Version 2.0 (the "License");
27462
+ * you may not use this file except in compliance with the License.
27463
+ * You may obtain a copy of the License at
27464
+ *
27465
+ * http://www.apache.org/licenses/LICENSE-2.0
27466
+ *
27467
+ * Unless required by applicable law or agreed to in writing, software
27468
+ * distributed under the License is distributed on an "AS IS" BASIS,
27469
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27470
+ * See the License for the specific language governing permissions and
27471
+ * limitations under the License.
27472
+ *
27473
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27474
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27475
+ * */
27476
+
27477
+ var StepButton = function StepButton(_ref) {
27478
+ var forward = _ref.forward,
27479
+ isDisabled = _ref.isDisabled,
27480
+ _ref$onClick = _ref.onClick,
27481
+ onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
27482
+ settings = _ref.settings;
27483
+
27484
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27485
+
27486
+ var forwardTitle = (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.label) === null || _a === void 0 ? void 0 : _a.forward) !== null && _b !== void 0 ? _b : 'Forward';
27487
+ var backwardTitle = (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.label) === null || _c === void 0 ? void 0 : _c.backward) !== null && _d !== void 0 ? _d : 'Backward';
27488
+ var forwardIcon = (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _e === void 0 ? void 0 : _e.forward) !== null && _f !== void 0 ? _f : /*#__PURE__*/React.createElement(StepForward, {
27489
+ "data-testid": "step-forward-svg-path"
27490
+ });
27491
+ var backwardIcon = (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _g === void 0 ? void 0 : _g.backward) !== null && _h !== void 0 ? _h : /*#__PURE__*/React.createElement(StepBackward, {
27492
+ "data-testid": "step-backward-svg-path"
27493
+ });
27494
+ return /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27495
+ title: forward ? forwardTitle : backwardTitle
27496
+ }), /*#__PURE__*/React.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27497
+ disabled: isDisabled,
27498
+ "aria-label": forward ? forwardTitle : backwardTitle,
27499
+ onClick: onClick,
27500
+ "data-testid": "TimeSliderLite-StepButton".concat(forward ? 'Forward' : 'Backward')
27501
+ }), forward ? forwardIcon : backwardIcon));
27502
+ };
27503
+
27504
+ /* *
27505
+ * Licensed under the Apache License, Version 2.0 (the "License");
27506
+ * you may not use this file except in compliance with the License.
27507
+ * You may obtain a copy of the License at
27508
+ *
27509
+ * http://www.apache.org/licenses/LICENSE-2.0
27510
+ *
27511
+ * Unless required by applicable law or agreed to in writing, software
27512
+ * distributed under the License is distributed on an "AS IS" BASIS,
27513
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27514
+ * See the License for the specific language governing permissions and
27515
+ * limitations under the License.
27516
+ *
27517
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27518
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27519
+ * */
27520
+
27521
+ var PlayButton = function PlayButton(_ref) {
27522
+ var isAnimating = _ref.isAnimating,
27523
+ isDisabled = _ref.isDisabled,
27524
+ onTogglePlayButton = _ref.onTogglePlayButton,
27525
+ settings = _ref.settings;
27526
+
27527
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27528
+
27529
+ var pauseTitle = (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.label) === null || _a === void 0 ? void 0 : _a.pause) !== null && _b !== void 0 ? _b : 'Pause';
27530
+ var playTitle = (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.label) === null || _c === void 0 ? void 0 : _c.play) !== null && _d !== void 0 ? _d : 'Play';
27531
+ var pauseIcon = (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _e === void 0 ? void 0 : _e.pause) !== null && _f !== void 0 ? _f : /*#__PURE__*/React__default.createElement(Pause, null);
27532
+ var playIcon = (_h = (_g = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _g === void 0 ? void 0 : _g.play) !== null && _h !== void 0 ? _h : /*#__PURE__*/React__default.createElement(Play, null);
27533
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27534
+ title: isAnimating ? pauseTitle : playTitle
27535
+ }), /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27536
+ sx: Object.assign(Object.assign({}, isAnimating && {
27537
+ backgroundColor: 'geowebColors.timeSliderLite.selected.backgroundColor'
27538
+ }), timeSliderLiteButtonDefaultProps.sx),
27539
+ onClick: function onClick() {
27540
+ onTogglePlayButton();
27541
+ },
27542
+ disabled: isDisabled,
27543
+ "data-testid": "TimeSliderLite-PlayButton"
27544
+ }), isAnimating ? pauseIcon : playIcon));
27545
+ };
27546
+
27547
+ /* *
27548
+ * Licensed under the Apache License, Version 2.0 (the "License");
27549
+ * you may not use this file except in compliance with the License.
27550
+ * You may obtain a copy of the License at
27551
+ *
27552
+ * http://www.apache.org/licenses/LICENSE-2.0
27553
+ *
27554
+ * Unless required by applicable law or agreed to in writing, software
27555
+ * distributed under the License is distributed on an "AS IS" BASIS,
27556
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27557
+ * See the License for the specific language governing permissions and
27558
+ * limitations under the License.
27559
+ *
27560
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27561
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27562
+ * */
27563
+
27564
+ var MenuButton = function MenuButton(_ref) {
27565
+ var menuOpen = _ref.menuOpen,
27566
+ onClick = _ref.onClick,
27567
+ settings = _ref.settings;
27568
+
27569
+ var _a, _b;
27570
+
27571
+ var title = (_a = settings === null || settings === void 0 ? void 0 : settings.label) !== null && _a !== void 0 ? _a : 'Animation options';
27572
+ var icon = (_b = settings === null || settings === void 0 ? void 0 : settings.icon) !== null && _b !== void 0 ? _b : /*#__PURE__*/React__default.createElement(Options, null);
27573
+ return /*#__PURE__*/React__default.createElement(Tooltip, Object.assign({}, timeSliderLiteTooltipDefaultProps, {
27574
+ title: title
27575
+ }), /*#__PURE__*/React__default.createElement(IconButton, Object.assign({}, timeSliderLiteButtonDefaultProps, {
27576
+ sx: Object.assign(Object.assign({}, menuOpen && {
27577
+ backgroundColor: 'geowebColors.timeSliderLite.selected.backgroundColor'
27578
+ }), timeSliderLiteButtonDefaultProps.sx),
27579
+ "aria-selected": menuOpen,
27580
+ onClick: onClick,
27581
+ "data-testid": "TimeSliderLite-MenuButton"
27582
+ }), icon));
27583
+ };
27584
+
27585
+ var TIME_SLIDER_LITE_DEFAULT_HEIGHT = 40;
27586
+ var TIME_SLIDER_LITE_DEFAULT_LOCALE = 'en';
27587
+ var TIME_SLIDER_LITE_DEFAULT_TIME_STEP = 5;
27588
+ var styles$1 = {
27589
+ container: {
27590
+ display: 'grid',
27591
+ alignItems: 'center',
27592
+ justifyContent: 'center',
27593
+ borderRadius: '4px'
27594
+ }
27595
+ };
27596
+
27597
+ var TimeSliderLite = function TimeSliderLite(_ref) {
27598
+ var controlButtons = _ref.controlButtons,
27599
+ endTime = _ref.endTime,
27600
+ _ref$height = _ref.height,
27601
+ height = _ref$height === void 0 ? TIME_SLIDER_LITE_DEFAULT_HEIGHT : _ref$height,
27602
+ hideButton = _ref.hideButton,
27603
+ isAnimating = _ref.isAnimating,
27604
+ isVisible = _ref.isVisible,
27605
+ _ref$locale = _ref.locale,
27606
+ locale = _ref$locale === void 0 ? TIME_SLIDER_LITE_DEFAULT_LOCALE : _ref$locale,
27607
+ mapId = _ref.mapId,
27608
+ menuOpen = _ref.menuOpen,
27609
+ overrideAnimation = _ref.overrideAnimation,
27610
+ onToggleAnimation = _ref.onToggleAnimation,
27611
+ onToggleMenu = _ref.onToggleMenu,
27612
+ needleWidth = _ref.needleWidth,
27613
+ needleDragAreaWidth = _ref.needleDragAreaWidth,
27614
+ needleLabelZIndex = _ref.needleLabelZIndex,
27615
+ needleLabelOffset = _ref.needleLabelOffset,
27616
+ draggableTimeStamp = _ref.draggableTimeStamp,
27617
+ onToggleTimeSlider = _ref.onToggleTimeSlider,
27618
+ selectedTime = _ref.selectedTime,
27619
+ setSelectedTime = _ref.setSelectedTime,
27620
+ settings = _ref.settings,
27621
+ startTime = _ref.startTime,
27622
+ sx = _ref.sx,
27623
+ _ref$timeStep = _ref.timeStep,
27624
+ timeStep = _ref$timeStep === void 0 ? TIME_SLIDER_LITE_DEFAULT_TIME_STEP : _ref$timeStep;
27625
+
27626
+ var _useState = useState(selectedTime),
27627
+ _useState2 = _slicedToArray(_useState, 2),
27628
+ rawSelectedTime = _useState2[0],
27629
+ setRawSelectedTime = _useState2[1];
27630
+
27631
+ var timeStepSeconds = timeStep * 60;
27632
+ var roundedStartTime = Math.floor(startTime / timeStepSeconds) * timeStepSeconds;
27633
+ var roundedEndTime = Math.floor(endTime / timeStepSeconds) * timeStepSeconds;
27634
+ var runningExternalAnimation = overrideAnimation && isAnimating;
27635
+ var runningInternalAnimation = !overrideAnimation && isAnimating;
27636
+ useEffect(function () {
27637
+ if (!runningExternalAnimation) {
27638
+ var roundedSelectedTime = Math.floor(rawSelectedTime / timeStepSeconds) * timeStepSeconds;
27639
+ setSelectedTime(roundedSelectedTime);
27640
+ }
27641
+ }, [setSelectedTime, rawSelectedTime, timeStepSeconds, runningExternalAnimation]);
27642
+ useEffect(function () {
27643
+ if (runningInternalAnimation) {
27644
+ var interval = setInterval(function () {
27645
+ setRawSelectedTime(function (prevTime) {
27646
+ if (prevTime + timeStepSeconds > roundedEndTime) {
27647
+ return roundedStartTime;
27648
+ }
27649
+
27650
+ return prevTime + timeStepSeconds;
27651
+ });
27652
+ }, 200);
27653
+ return function () {
27654
+ return clearInterval(interval);
27655
+ };
27656
+ }
27657
+
27658
+ if (runningExternalAnimation) {
27659
+ setRawSelectedTime(selectedTime);
27660
+ }
27661
+
27662
+ return function () {};
27663
+ }, [roundedEndTime, isAnimating, roundedStartTime, timeStepSeconds, runningInternalAnimation, runningExternalAnimation, selectedTime]);
27664
+
27665
+ var handleTimeStep = function handleTimeStep(stepSeconds) {
27666
+ var newSteppedTime = Math.floor(rawSelectedTime / timeStepSeconds) * timeStepSeconds + stepSeconds;
27667
+ setRawSelectedTime(boundedValue(newSteppedTime, [roundedStartTime, roundedEndTime]));
27668
+
27669
+ if (isAnimating && onToggleAnimation) {
27670
+ onToggleAnimation();
27671
+ }
27672
+ };
27673
+
27674
+ var handleTimeSelect = function handleTimeSelect(value) {
27675
+ setRawSelectedTime(boundedValue(value, [roundedStartTime, roundedEndTime]));
27676
+
27677
+ if (isAnimating && onToggleAnimation) {
27678
+ onToggleAnimation();
27679
+ }
27680
+ };
27681
+
27682
+ return /*#__PURE__*/React__default.createElement(Grid, {
27683
+ container: true,
27684
+ sx: Object.assign(Object.assign(Object.assign({}, styles$1.container), sx), {
27685
+ gridTemplateColumns: isVisible ? 'auto 1fr auto' : "1fr auto"
27686
+ }),
27687
+ "data-testid": "timeSliderLite-".concat(mapId)
27688
+ }, isVisible ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
27689
+ item: true,
27690
+ sx: {
27691
+ height: "".concat(height, "px")
27692
+ }
27693
+ }, controlButtons || /*#__PURE__*/React__default.createElement(ControlButtonGroup, {
27694
+ left: true
27695
+ }, /*#__PURE__*/React__default.createElement(MenuButton, {
27696
+ settings: settings === null || settings === void 0 ? void 0 : settings.menuButton,
27697
+ menuOpen: menuOpen,
27698
+ onClick: onToggleMenu
27699
+ }), /*#__PURE__*/React__default.createElement(Divider, {
27700
+ orientation: "vertical",
27701
+ sx: {
27702
+ height: "".concat(height, "px"),
27703
+ margin: '2px'
27704
+ }
27705
+ }), /*#__PURE__*/React__default.createElement(PlayButton, {
27706
+ settings: settings === null || settings === void 0 ? void 0 : settings.playButton,
27707
+ isAnimating: isAnimating,
27708
+ onTogglePlayButton: onToggleAnimation
27709
+ }), /*#__PURE__*/React__default.createElement(StepButton, {
27710
+ settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
27711
+ onClick: function onClick() {
27712
+ return handleTimeStep(-timeStepSeconds);
27713
+ }
27714
+ }), /*#__PURE__*/React__default.createElement(StepButton, {
27715
+ forward: true,
27716
+ settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
27717
+ onClick: function onClick() {
27718
+ return handleTimeStep(timeStepSeconds);
27719
+ }
27720
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
27721
+ item: true
27722
+ }, /*#__PURE__*/React__default.createElement(TimeSliderLiteBackground, {
27723
+ draggableTimeStamp: draggableTimeStamp,
27724
+ startTime: roundedStartTime,
27725
+ locale: locale,
27726
+ endTime: roundedEndTime,
27727
+ needleWidth: needleWidth,
27728
+ needleDragAreaWidth: needleDragAreaWidth,
27729
+ needleLabelZIndex: needleLabelZIndex,
27730
+ needleLabelOffset: needleLabelOffset,
27731
+ timeStep: timeStepSeconds,
27732
+ selectedTime: runningExternalAnimation ? selectedTime : rawSelectedTime,
27733
+ setSelectedTime: handleTimeSelect,
27734
+ height: height
27735
+ }))) : /*#__PURE__*/React__default.createElement(Grid, {
27736
+ item: true
27737
+ }), /*#__PURE__*/React__default.createElement(Grid, {
27738
+ item: true,
27739
+ sx: {
27740
+ height: "".concat(height, "px")
27741
+ }
27742
+ }, hideButton || /*#__PURE__*/React__default.createElement(ControlButtonGroup, {
27743
+ right: isVisible
27744
+ }, /*#__PURE__*/React__default.createElement(HideButton, {
27745
+ settings: settings === null || settings === void 0 ? void 0 : settings.hideButton,
27746
+ onClick: onToggleTimeSlider,
27747
+ isVisible: isVisible
27748
+ }))));
27749
+ };
27750
+
26827
27751
  /* *
26828
27752
  * Licensed under the Apache License, Version 2.0 (the "License");
26829
27753
  * you may not use this file except in compliance with the License.
@@ -27791,4 +28715,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
27791
28715
  * */
27792
28716
  var mapActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions$1), serviceActions);
27793
28717
 
27794
- export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DockedLayerManagerConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, index as SyncGroups, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, appActions, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, selectors$1 as genericSelectors, getDrawFunctionFromStore, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$8 as layerReducer, selectors$4 as layerSelectors, types$3 as layerTypes, mapActions, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils as mapUtils, parseBoolean, parseLayer, publicLayers, publicServices, registerDrawFunction, registerWMJSMap, registerWMLayer, routerActions, snackbarActions, store, genericActions as syncGroupActions, selectors$2 as syncGroupsSelectors, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, timeSliderUtils, uiActions, uiModuleConfig, selectors$3 as uiSelectors, types as uiTypes, unRegisterWMJSLayer, unRegisterWMJSMap, useSetupDialog };
28718
+ export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DockedLayerManagerConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, Legend, LegendConnect, LegendMapButtonConnect, MapControls, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, index as SyncGroups, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, appActions, componentsLookUp, coreModuleConfig, dateFormat, defaultBbox, defaultConfigurations, filterLayers, filterMapPresets, filterNonTimeDimensions, filterServices, generateLayerId, generateMapId, generateTimesliderId, selectors$1 as genericSelectors, getDrawFunctionFromStore, getFirstTimeStepForLayerId, getInitialAppPresets, getLastTimeStepForLayerId, getNextTimeStepForLayerId, getPreviousTimeStepForLayerId, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, layerActions, reducer$7 as layerReducer, selectors$4 as layerSelectors, types$3 as layerTypes, mapActions, moduleConfig as mapModuleConfig, selectors as mapSelectors, types$2 as mapTypes, utils as mapUtils, parseBoolean, parseLayer, publicLayers, publicServices, registerDrawFunction, registerWMJSMap, registerWMLayer, routerActions, selectors$5 as serviceSelectors, snackbarActions, store, genericActions as syncGroupActions, selectors$2 as syncGroupsSelectors, synchronizationGroupConfig as synchronizationGroupModuleConfig, synchronizationGroupConfig as synchronizationGroupsConfig, testLayers, timeSliderUtils, uiActions, uiModuleConfig, reducer$6 as uiReducer, selectors$3 as uiSelectors, types as uiTypes, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, useFetchServices, useSetupDialog, reducer$5 as webmapReducer };