@opengeoweb/shared 21.2.0 → 21.3.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 (21) hide show
  1. package/dist/index.esm.js +2842 -48
  2. package/dist/src/lib/components/PlotManager/ParameterInfoDialog/ParameterInfoDialog.d.ts +48 -0
  3. package/dist/src/lib/components/PlotManager/ParameterSelect/ParameterSelect.d.ts +57 -0
  4. package/dist/src/lib/components/PlotManager/ParameterSelect/ParameterSelectList.d.ts +17 -0
  5. package/dist/src/lib/components/PlotManager/ParameterSelect/SelectServices.d.ts +15 -0
  6. package/dist/src/lib/components/PlotManager/ParameterSelect/filterCollections.d.ts +8 -0
  7. package/dist/src/lib/components/PlotManager/PlotManager.d.ts +4 -0
  8. package/dist/src/lib/components/PlotManager/PlotManagerLayout.d.ts +16 -0
  9. package/dist/src/lib/components/PlotManager/PlotManagerParameterControls.d.ts +12 -0
  10. package/dist/src/lib/components/PlotManager/index.d.ts +4 -0
  11. package/dist/src/lib/components/PlotManager/storyComponents/CrossSectionExample.d.ts +4 -0
  12. package/dist/src/lib/components/PlotManager/storyComponents/TimeSeriesExample.d.ts +6 -0
  13. package/dist/src/lib/components/PlotManager/storyComponents/storyUtils.d.ts +30 -0
  14. package/dist/src/lib/components/PlotManager/types.d.ts +100 -0
  15. package/dist/src/lib/components/PlotManager/usePlotManagerColumns.d.ts +6 -0
  16. package/dist/src/lib/components/index.d.ts +1 -0
  17. package/dist/src/lib/types/edr-coverage-types.d.ts +31 -2
  18. package/dist/src/lib/utils/geoConstants.d.ts +1 -0
  19. package/dist/src/lib/utils/index.d.ts +1 -0
  20. package/dist/src/lib/utils/referenceTimeUtils/referenceTimeUtils.d.ts +4 -0
  21. package/package.json +5 -4
package/dist/index.esm.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { Box, Typography, useTheme, Tooltip, IconButton, Menu, ListSubheader, MenuItem, Grid, FormControlLabel, Radio, ListItemText, ListItemIcon, DialogTitle, Button, Dialog, DialogContent, DialogActions, Paper, CircularProgress, Alert, AlertTitle, Drawer, Link, Avatar as Avatar$1, ClickAwayListener, MenuList, RadioGroup, Portal, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, Switch, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, ListItemButton, Checkbox, FormControl, InputLabel, FilledInput, Card } from '@mui/material';
2
+ import { Box, Typography, useTheme, Tooltip, IconButton, Menu, ListSubheader, MenuItem, Grid, FormControlLabel, Radio, ListItemText, ListItemIcon, DialogTitle, Button, Dialog, DialogContent, DialogActions, Paper, CircularProgress, Alert, AlertTitle, Drawer, Link, Avatar as Avatar$1, ClickAwayListener, MenuList, RadioGroup, Portal, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, Switch, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, ListItemButton, Checkbox, FormControl, InputLabel, FilledInput, Card, LinearProgress, Collapse, Input } from '@mui/material';
3
3
  import 'i18next';
4
4
  import { initReactI18next, useTranslation } from 'react-i18next';
5
5
  import React, { useRef, useEffect, useState, Component } from 'react';
6
6
  import Draggable from 'react-draggable';
7
7
  import { Resizable } from 're-resizable';
8
- import { Resize, BORDER_RADIUS, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, ChevronDown, Search, Clear, Cached, Filter as Filter$1, Menu as Menu$1, CalendarToday, ArrowDropDownDown, DragHandle } from '@opengeoweb/theme';
8
+ import { Resize, BORDER_RADIUS, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, ChevronDown, Search, Clear, Cached, Filter as Filter$1, Menu as Menu$1, CalendarToday, ArrowDropDownDown, DragHandle, Add, TimeSeriesSelect, ChevronUp, Copy, Delete, VisibilityOff, Visibility, Edit, DimensionsTime, DrawRegion } from '@opengeoweb/theme';
9
9
  import { throttle, isEqual, merge, escapeRegExp, debounce } from 'lodash';
10
10
  import { add as add$1, addMinutes, addHours, format, differenceInDays as differenceInDays$1, differenceInHours as differenceInHours$1, differenceInMinutes as differenceInMinutes$1, differenceInMonths as differenceInMonths$1, differenceInSeconds as differenceInSeconds$1, differenceInYears as differenceInYears$1, fromUnixTime, getHours as getHours$1, isAfter as isAfter$1, isBefore as isBefore$1, isEqual as isEqual$1, isValid as isValid$1, parseISO, roundToNearestMinutes as roundToNearestMinutes$1, set as set$1, setSeconds as setSeconds$1, parse, sub as sub$1, getUnixTime, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval, startOfDay } from 'date-fns';
11
11
  import { fi as fi$1, nl as nl$1, nb, enGB } from 'date-fns/locale';
@@ -14,8 +14,10 @@ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
14
14
  import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
15
15
  import { useResizable } from 'react-resizable-layout';
16
16
  import { ReactSortable } from 'react-sortablejs';
17
+ import { List as List$1, useListRef } from 'react-window';
17
18
 
18
19
  var en = {
20
+ "shared-missing-units": "The service does not provide a unit for the {{parameter}} parameter.",
19
21
  "shared-choose-app-mode": "Choose your default app mode",
20
22
  "shared-cheat-sheet": "Cheat sheet",
21
23
  "shared-save": "Save",
@@ -84,9 +86,83 @@ var en = {
84
86
  "shared-filter-hide-labels": "Close filter",
85
87
  "shared-filter-show-labels": "Open filter",
86
88
  "shared-shortcut-toggle-location-info": "Toggle location info dialog ON and OFF",
87
- "shared-shortcut-toggle-measure-tool": "Toggle map measure tool ON and OFF"
89
+ "shared-shortcut-toggle-measure-tool": "Toggle map measure tool ON and OFF",
90
+ "shared-collection": "Collection",
91
+ "shared-collection-id": "Collection ID",
92
+ "shared-collection-title": "Collection title",
93
+ "shared-collection-description": "Collection description",
94
+ "shared-parameter": "Parameter",
95
+ "shared-parameter-name": "Parameter name",
96
+ "shared-style": "Style",
97
+ "shared-dimension": "Dimension",
98
+ "shared-dimension-id": "Dimension ID",
99
+ "shared-dimension-value": "Dimension value",
100
+ "shared-dimension-none": "None",
101
+ "shared-reference-time": "Reference time",
102
+ "shared-add-plot": "Add plot",
103
+ "shared-show": "Show",
104
+ "shared-hide": "Hide",
105
+ "shared-duplicate": "Duplicate",
106
+ "shared-remove": "Remove",
107
+ "shared-edit-title": "Edit title",
108
+ "shared-plot-options": "Plot options",
109
+ "shared-reorder": "Reorder",
110
+ "shared-info-name": "Name",
111
+ "shared-info-label": "Label",
112
+ "shared-service": "Service",
113
+ "shared-service-url": "Service URL",
114
+ "shared-service-description": "Service description",
115
+ "shared-service-type": "Service type",
116
+ "shared-queries": "Queries",
117
+ "shared-instance-dimensions": "Instance dimensions",
118
+ "shared-no-data-available": "No data available",
119
+ "shared-time": "Time",
120
+ "shared-bbox": "Bounding box",
121
+ "shared-bbox-rendering": "west {{west}}, east {{east}}, north {{north}}, south {{south}}",
122
+ "shared-service-name": "Service name",
123
+ "shared-service-url-label": "This service refers to this URL",
124
+ "shared-invalid-url": "Not a valid URL.",
125
+ "shared-description-helper": "Short description of what this service does",
126
+ "shared-services": "Services",
127
+ "shared-cancel": "Cancel",
128
+ "shared-description": "Description",
129
+ "shared-type": "Type",
130
+ "shared-results_one": "{{count}} result",
131
+ "shared-results_other": "{{count}} results",
132
+ "shared-color": "Color",
133
+ "shared-opacity": "Opacity",
134
+ "shared-plot-manager": "Plot Manager",
135
+ "shared-plot": "Plot",
136
+ "shared-select-parameters": "Select parameters",
137
+ "shared-expand": "Expand",
138
+ "shared-collapse": "Collapse",
139
+ "shared-parameter-settings": "{{parameter}} settings",
140
+ "shared-parameter-info": "Parameter info",
141
+ "shared-latest": "Latest",
142
+ "shared-latest-offset": "Latest -{{index}}",
143
+ "shared-loading": "Loading",
144
+ "shared-parameter-search": "Search parameters or enter a service URL",
145
+ "shared-add-service": "Add service",
146
+ "shared-add-service-title": "Add a new service",
147
+ "shared-delete-service": "Delete service",
148
+ "shared-cannot-delete-service": "Service has active layers. Cannot remove this service",
149
+ "shared-no-matching-parameters": "No matching parameters",
150
+ "shared-add": "Add",
151
+ "shared-service-options": "Services options",
152
+ "shared-update-service": "Update {{service}}",
153
+ "shared-show-service": "Show service",
154
+ "shared-edit-service": "Edit service",
155
+ "shared-parameter-type": "Parameter type",
156
+ "shared-plot-type": "Plot type",
157
+ "shared-service-url-existing": "URL already exists.",
158
+ "shared-service-name-existing": "This name already exists. Choose another name.",
159
+ "shared-service-request-failed": "Download failed. Check the URL.",
160
+ "shared-service-save-failed": "Unable to save service",
161
+ "shared-copy-service-url": "Copy service URL",
162
+ "shared-copy-failed": "Unable to copy service URL"
88
163
  };
89
164
  var fi = {
165
+ "shared-missing-units": "Palvelu ei tarjoa yksikköä parametrille {{parameter}}.",
90
166
  "shared-choose-app-mode": "Sovelluksen väriteema",
91
167
  "shared-cheat-sheet": "Lunttilappu",
92
168
  "shared-save": "Tallenna",
@@ -155,9 +231,83 @@ var fi = {
155
231
  "shared-filter-hide-labels": "Sulje suodatin",
156
232
  "shared-filter-show-labels": "Avaa suodatin",
157
233
  "shared-shortcut-toggle-location-info": "Näytä/piilota sijaintitietojen valintaikkuna",
158
- "shared-shortcut-toggle-measure-tool": "Ota kartan mittatyökalu käyttöön tai poista se käytöstä"
234
+ "shared-shortcut-toggle-measure-tool": "Ota kartan mittatyökalu käyttöön tai poista se käytöstä",
235
+ "shared-collection": "Kokoelmat",
236
+ "shared-collection-id": "Kokoelman tunniste",
237
+ "shared-collection-title": "Kokoelman nimi",
238
+ "shared-collection-description": "Kokoelman kuvaus",
239
+ "shared-parameter": "Parametrit",
240
+ "shared-parameter-name": "Parametrin nimi",
241
+ "shared-style": "Tyyli",
242
+ "shared-dimension": "Dimensio",
243
+ "shared-dimension-id": "Dimension ID",
244
+ "shared-dimension-value": "Dimension arvo",
245
+ "shared-dimension-none": "Ei valintaa",
246
+ "shared-reference-time": "Vertailuaika",
247
+ "shared-add-plot": "Lisää kuvaaja",
248
+ "shared-show": "Näytä",
249
+ "shared-hide": "Piilota",
250
+ "shared-duplicate": "Monista",
251
+ "shared-remove": "Poista",
252
+ "shared-edit-title": "Muokkaa otsikkoa",
253
+ "shared-plot-options": "Valinnat",
254
+ "shared-reorder": "Vedä",
255
+ "shared-info-name": "Nimi",
256
+ "shared-info-label": "Label",
257
+ "shared-service": "Palvelu",
258
+ "shared-service-url": "Palvelun URL-osoite",
259
+ "shared-service-description": "Palvelun kuvaus",
260
+ "shared-service-type": "Palvelun tyyppi",
261
+ "shared-queries": "Kyselyt",
262
+ "shared-instance-dimensions": "Tapauksen dimensiot",
263
+ "shared-no-data-available": "Tietoja ei ole saatavilla",
264
+ "shared-time": "Aika",
265
+ "shared-bbox": "Rajaava suorakaide",
266
+ "shared-bbox-rendering": "länsi {{west}}, itä {{east}}, pohjoinen {{north}}, etelä {{south}}",
267
+ "shared-service-name": "Palvelun nimi",
268
+ "shared-service-url-label": "Tämä palvelu viittaa tähän URL-osoitteeseen",
269
+ "shared-invalid-url": "Virheellinen URL-osoite.",
270
+ "shared-description-helper": "Lyhyt kuvaus siitä, mitä palvelu tekee",
271
+ "shared-services": "Palvelut",
272
+ "shared-cancel": "Peruuta",
273
+ "shared-description": "Kuvaus",
274
+ "shared-type": "Tyyppi",
275
+ "shared-results_one": "{{count}} tulos",
276
+ "shared-results_other": "{{count}} tulosta",
277
+ "shared-color": "Väri",
278
+ "shared-opacity": "Peittävyys",
279
+ "shared-plot-manager": "Kuvaajien hallinta",
280
+ "shared-plot": "Kuvaaja",
281
+ "shared-select-parameters": "Valitse parametrit",
282
+ "shared-expand": "Laajenna",
283
+ "shared-collapse": "Kutista",
284
+ "shared-parameter-settings": "Parametrin {{parameter}} asetukset",
285
+ "shared-parameter-info": "Parametrin tiedot",
286
+ "shared-latest": "Uusin",
287
+ "shared-latest-offset": "Uusin -{{index}}",
288
+ "shared-loading": "Ladataan",
289
+ "shared-parameter-search": "Etsi parametreja tai anna palvelun URL-osoite",
290
+ "shared-add-service": "Lisää palvelu",
291
+ "shared-add-service-title": "Lisää uusi palvelu",
292
+ "shared-delete-service": "Poista palvelu",
293
+ "shared-cannot-delete-service": "Palvelun tarjoamia karttatasoja on aktiivisena. Tätä palvelua ei voida poistaa",
294
+ "shared-no-matching-parameters": "Ei vastaavia parametreja",
295
+ "shared-add": "Lisää",
296
+ "shared-service-options": "Palveluasetukset",
297
+ "shared-update-service": "Päivitä {{service}}",
298
+ "shared-show-service": "Näytä palvelu",
299
+ "shared-edit-service": "Muokkaa palvelua",
300
+ "shared-parameter-type": "Parametrin tyyppi",
301
+ "shared-plot-type": "Kuvaajan tyyppi",
302
+ "shared-service-url-existing": "URL-osoite on jo käytössä.",
303
+ "shared-service-name-existing": "Tämä nimi on jo olemassa. Valitse toinen nimi.",
304
+ "shared-service-request-failed": "Lataus epäonnistui. Tarkista URL-osoite.",
305
+ "shared-service-save-failed": "Palvelua ei voitu tallentaa",
306
+ "shared-copy-service-url": "Kopioi palvelun URL-osoite",
307
+ "shared-copy-failed": "Palvelun URL-osoitetta ei voitu kopioida"
159
308
  };
160
309
  var no = {
310
+ "shared-missing-units": "Tjenesten oppgir ikke enhet for parameteren {{parameter}}.",
161
311
  "shared-choose-app-mode": "Velg din standardmodus",
162
312
  "shared-cheat-sheet": "Jukselapp",
163
313
  "shared-save": "Lagre",
@@ -223,9 +373,83 @@ var no = {
223
373
  "shared-only": "BARE",
224
374
  "shared-customdialog-back": "Tilbake",
225
375
  "shared-filter-hide-labels": "Skjul nøkkelord",
226
- "shared-filter-show-labels": "Vis nøkkelord"
376
+ "shared-filter-show-labels": "Vis nøkkelord",
377
+ "shared-collection": "Kolleksjon",
378
+ "shared-collection-id": "Collection ID",
379
+ "shared-collection-title": "Collection title",
380
+ "shared-collection-description": "Collection description",
381
+ "shared-parameter": "Parameter",
382
+ "shared-parameter-name": "Parameternavn",
383
+ "shared-style": "Stil",
384
+ "shared-dimension": "Dimensjon",
385
+ "shared-dimension-id": "Dimensjons ID",
386
+ "shared-dimension-value": "Dimensjonsverdi",
387
+ "shared-dimension-none": "None",
388
+ "shared-reference-time": "Referansetid",
389
+ "shared-add-plot": "Legg til plott",
390
+ "shared-show": "Vis",
391
+ "shared-hide": "Skjul",
392
+ "shared-duplicate": "Dupliser",
393
+ "shared-remove": "Fjern",
394
+ "shared-edit-title": "Endre tittel",
395
+ "shared-plot-options": "Alternativer",
396
+ "shared-reorder": "Dra",
397
+ "shared-info-name": "Navn",
398
+ "shared-info-label": "Label",
399
+ "shared-service": "Tjeneste",
400
+ "shared-service-url": "Tjeneste-URL",
401
+ "shared-service-description": "Tjenestebeskrivelse",
402
+ "shared-service-type": "Tjenestetype",
403
+ "shared-queries": "Queries",
404
+ "shared-instance-dimensions": "ikke oversatt",
405
+ "shared-no-data-available": "ikke oversatt",
406
+ "shared-time": "ikke oversatt",
407
+ "shared-bbox": "ikke oversatt",
408
+ "shared-bbox-rendering": "west {{west}}, east {{east}}, north {{north}}, south {{south}}",
409
+ "shared-service-name": "Tjenestenavn",
410
+ "shared-service-url-label": "Denne tjenesten refererer til denne URL",
411
+ "shared-invalid-url": "Ikke en gyldig URL",
412
+ "shared-description-helper": "Kort beskrivelse av hva denne tjenesten gjør",
413
+ "shared-services": "Tjenester",
414
+ "shared-cancel": "Avbryt",
415
+ "shared-description": "Beskrivelse",
416
+ "shared-type": "Type",
417
+ "shared-results_one": "{{count}} resultat",
418
+ "shared-results_other": "{{count}} resultater",
419
+ "shared-color": "Farge",
420
+ "shared-opacity": "Gjennomsiktighet",
421
+ "shared-plot-manager": "Plotthåndtering",
422
+ "shared-plot": "Plott",
423
+ "shared-select-parameters": "Velg parametere",
424
+ "shared-expand": "Utvid",
425
+ "shared-collapse": "Skjul",
426
+ "shared-parameter-settings": "Innstillinger for {{parameter}}",
427
+ "shared-parameter-info": "Parameterinformasjon",
428
+ "shared-latest": "Nyeste",
429
+ "shared-latest-offset": "Nyeste -{{index}}",
430
+ "shared-loading": "Laster",
431
+ "shared-parameter-search": "Søk etter parametere eller skriv inn en tjeneste-URL",
432
+ "shared-add-service": "Legg til tjeneste",
433
+ "shared-add-service-title": "Legg til en ny tjeneste",
434
+ "shared-delete-service": "Slett tjeneste",
435
+ "shared-cannot-delete-service": "Tjenesten har aktive lag. Kan ikke fjerne",
436
+ "shared-no-matching-parameters": "Ingen samsvarende parametere",
437
+ "shared-add": "Legg til",
438
+ "shared-service-options": "Tjenesteinnstillinger",
439
+ "shared-update-service": "Oppdater {{service}}",
440
+ "shared-show-service": "Vis tjeneste",
441
+ "shared-edit-service": "Endre tjeneste",
442
+ "shared-parameter-type": "Parametertype",
443
+ "shared-plot-type": "Plottype",
444
+ "shared-service-url-existing": "URL eksisterer fra før.",
445
+ "shared-service-name-existing": "Dette navnet eksisterer fra før. Velg et annet navn.",
446
+ "shared-service-request-failed": "Nedlasting feilet. Sjekk URL'en.",
447
+ "shared-service-save-failed": "Kunne ikke lagre tjenesten",
448
+ "shared-copy-service-url": "Kopier tjenestens URL",
449
+ "shared-copy-failed": "Kunne ikke kopiere tjenestens URL"
227
450
  };
228
451
  var nl = {
452
+ "shared-missing-units": "De service geeft geen eenheid op voor parameter {{parameter}}.",
229
453
  "shared-choose-app-mode": "Kies je standaard app-modus",
230
454
  "shared-cheat-sheet": "Cheat sheet",
231
455
  "shared-save": "Opslaan",
@@ -293,7 +517,80 @@ var nl = {
293
517
  "shared-filter-hide-labels": "Verberg labels",
294
518
  "shared-filter-show-labels": "Toon labels",
295
519
  "shared-shortcut-toggle-location-info": "Zet locatie informatie AAN en UIT",
296
- "shared-shortcut-toggle-measure-tool": "Zet meten op de kaart AAN en UIT"
520
+ "shared-shortcut-toggle-measure-tool": "Zet meten op de kaart AAN en UIT",
521
+ "shared-collection": "Collectie",
522
+ "shared-collection-id": "Collectie ID",
523
+ "shared-collection-title": "Collectie titel",
524
+ "shared-collection-description": "Collectie beschrijving",
525
+ "shared-parameter": "Parameter",
526
+ "shared-parameter-name": "Parameternaam",
527
+ "shared-style": "Stijl",
528
+ "shared-dimension": "Dimensie",
529
+ "shared-dimension-id": "Dimensie ID",
530
+ "shared-dimension-value": "Dimensie waarde",
531
+ "shared-dimension-none": "Geen",
532
+ "shared-reference-time": "Referentie Tijd",
533
+ "shared-add-plot": "Grafiek toevoegen",
534
+ "shared-show": "Tonen",
535
+ "shared-hide": "Verbergen",
536
+ "shared-duplicate": "Dupliceren",
537
+ "shared-remove": "Verwijderen",
538
+ "shared-edit-title": "Titel bewerken",
539
+ "shared-plot-options": "Opties",
540
+ "shared-reorder": "Slepen",
541
+ "shared-info-name": "Naam",
542
+ "shared-info-label": "Label",
543
+ "shared-service": "Service",
544
+ "shared-service-url": "Service URL",
545
+ "shared-service-description": "Service beschrijving",
546
+ "shared-service-type": "Service type",
547
+ "shared-queries": "Queries",
548
+ "shared-instance-dimensions": "niet vertaald",
549
+ "shared-no-data-available": "niet vertaald",
550
+ "shared-time": "niet vertaald",
551
+ "shared-bbox": "niet vertaald",
552
+ "shared-bbox-rendering": "west {{west}}, east {{east}}, north {{north}}, south {{south}}",
553
+ "shared-service-name": "Service naam",
554
+ "shared-service-url-label": "Deze service verwijst naar deze URL",
555
+ "shared-invalid-url": "Geen geldige URL.",
556
+ "shared-description-helper": "Korte beschrijving van wat de service doet",
557
+ "shared-services": "Services",
558
+ "shared-cancel": "Annuleren",
559
+ "shared-description": "Beschrijving",
560
+ "shared-type": "Type",
561
+ "shared-results_one": "{{count}} resultaat",
562
+ "shared-results_other": "{{count}} resultaten",
563
+ "shared-color": "Kleur",
564
+ "shared-opacity": "Dekking",
565
+ "shared-plot-manager": "Plotbeheer",
566
+ "shared-plot": "Plot",
567
+ "shared-select-parameters": "Selecteer parameters",
568
+ "shared-expand": "Uitklappen",
569
+ "shared-collapse": "Inklappen",
570
+ "shared-parameter-settings": "Instellingen voor {{parameter}}",
571
+ "shared-parameter-info": "Parameterinformatie",
572
+ "shared-latest": "Nieuwste",
573
+ "shared-latest-offset": "Nieuwste -{{index}}",
574
+ "shared-loading": "Laden",
575
+ "shared-parameter-search": "Zoek parameters of voer een service-URL in",
576
+ "shared-add-service": "Service toevoegen",
577
+ "shared-add-service-title": "Een nieuwe service toevoegen",
578
+ "shared-delete-service": "Service verwijderen",
579
+ "shared-cannot-delete-service": "Service heeft actieve lagen. Deze service kan niet verwijderd worden.",
580
+ "shared-no-matching-parameters": "Geen overeenkomende parameters",
581
+ "shared-add": "Toevoegen",
582
+ "shared-service-options": "Serviceopties",
583
+ "shared-update-service": "{{service}} bijwerken",
584
+ "shared-show-service": "Service tonen",
585
+ "shared-edit-service": "Service bewerken",
586
+ "shared-parameter-type": "Parametertype",
587
+ "shared-plot-type": "Plottype",
588
+ "shared-service-url-existing": "URL is al in gebruik.",
589
+ "shared-service-name-existing": "Deze naam is al in gebruik. Kies een andere naam.",
590
+ "shared-service-request-failed": "Download mislukt. Controleer de URL.",
591
+ "shared-service-save-failed": "Kan service niet opslaan",
592
+ "shared-copy-service-url": "Kopieer service-URL",
593
+ "shared-copy-failed": "Kan service-URL niet kopiëren"
297
594
  };
298
595
  var sharedTranslations = {
299
596
  en: en,
@@ -482,7 +779,7 @@ function _unsupportedIterableToArray(r, a) {
482
779
  }
483
780
  }
484
781
 
485
- var _excluded$f = ["content", "color", "icon", "sx"];
782
+ var _excluded$h = ["content", "color", "icon", "sx"];
486
783
  var bgColors = {
487
784
  green: 'geowebColors.functional.successOutline.fill',
488
785
  grey: 'geowebColors.functional.disabledOutline.fill',
@@ -523,7 +820,7 @@ var StatusTag = function StatusTag(_ref) {
523
820
  color = _ref.color,
524
821
  icon = _ref.icon,
525
822
  sx = _ref.sx;
526
- _objectWithoutPropertiesLoose(_ref, _excluded$f);
823
+ _objectWithoutPropertiesLoose(_ref, _excluded$h);
527
824
  return jsxs(Box, {
528
825
  className: "statusTag",
529
826
  "data-testid": "statusTag",
@@ -597,14 +894,14 @@ var useSharedTranslation = function useSharedTranslation() {
597
894
  return useTranslation([SHARED_NAMESPACE]);
598
895
  };
599
896
 
600
- var _excluded$e = ["bounds", "setIsDragging", "children", "onStop"];
897
+ var _excluded$g = ["bounds", "setIsDragging", "children", "onStop"];
601
898
  var DraggableComponent$1 = function DraggableComponent(_ref) {
602
899
  var _ref$bounds = _ref.bounds,
603
900
  bounds = _ref$bounds === void 0 ? 'body' : _ref$bounds,
604
901
  setIsDragging = _ref.setIsDragging,
605
902
  children = _ref.children,
606
903
  onStop = _ref.onStop,
607
- props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
904
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
608
905
  var onDragStart = function onDragStart(e) {
609
906
  // This makes sure that nothing is selected during drag
610
907
  setIsDragging == null || setIsDragging(true);
@@ -629,7 +926,7 @@ var DraggableComponent$1 = function DraggableComponent(_ref) {
629
926
  }));
630
927
  };
631
928
 
632
- var _excluded$d = ["children", "onResizeStart", "onResizeStop", "size", "setSize", "minHeight", "minWidth", "enable", "nodeRef"];
929
+ var _excluded$f = ["children", "onResizeStart", "onResizeStop", "size", "setSize", "minHeight", "minWidth", "enable", "nodeRef"];
633
930
  var isDraggingClassName = 'is-dragging';
634
931
  var useBoundsProps = function useBoundsProps(nodeRef) {
635
932
  var _React$useState = React.useState({}),
@@ -672,7 +969,7 @@ var ResizeComponent = function ResizeComponent(_ref) {
672
969
  topLeft: true
673
970
  } : _ref$enable,
674
971
  nodeRef = _ref.nodeRef,
675
- props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
972
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
676
973
  var theme = useTheme();
677
974
  var onStartResize = React.useCallback(function (event, _direction, node) {
678
975
  event.stopPropagation();
@@ -767,7 +1064,7 @@ var CustomTooltip = function CustomTooltip(props) {
767
1064
  }));
768
1065
  };
769
1066
 
770
- var _excluded$c = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps", "shouldShowExtraOptionsIndicator", "optionsActive"];
1067
+ var _excluded$e = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps", "shouldShowExtraOptionsIndicator", "optionsActive"];
771
1068
  var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
772
1069
  var _defaultTooltipProps$;
773
1070
  var _ref$tooltipTitle = _ref.tooltipTitle,
@@ -787,7 +1084,7 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
787
1084
  shouldShowExtraOptionsIndicator = _ref$shouldShowExtraO === void 0 ? false : _ref$shouldShowExtraO,
788
1085
  _ref$optionsActive = _ref.optionsActive,
789
1086
  optionsActive = _ref$optionsActive === void 0 ? false : _ref$optionsActive,
790
- props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
1087
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
791
1088
  var classNames = [].concat(className ? [className] : [], isSelected ? ['Mui-selected'] : [], [variant]).join(' ');
792
1089
  var tooltipTitle = (_defaultTooltipProps$ = defaultTooltipProps == null ? void 0 : defaultTooltipProps.title) != null ? _defaultTooltipProps$ : defaultTooltipTitle;
793
1090
  var tooltipProps = React.useMemo(function () {
@@ -1205,7 +1502,7 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
1205
1502
  });
1206
1503
  };
1207
1504
 
1208
- var _excluded$b = ["defaultSize", "onResizeStop", "hasLayout", "minWidth"],
1505
+ var _excluded$d = ["defaultSize", "onResizeStop", "hasLayout", "minWidth"],
1209
1506
  _excluded2$2 = ["title", "onClose", "description", "actions", "children", "sx", "resizableDefaultSize", "isResizable", "hasLayout", "shouldRenderInline", "slotProps", "disableRestoreFocus", "headerActions", "minWidth"];
1210
1507
  var PaperComponent = function PaperComponent(_ref) {
1211
1508
  var _ref$defaultSize = _ref.defaultSize,
@@ -1218,7 +1515,7 @@ var PaperComponent = function PaperComponent(_ref) {
1218
1515
  hasLayout = _ref$hasLayout === void 0 ? true : _ref$hasLayout,
1219
1516
  _ref$minWidth = _ref.minWidth,
1220
1517
  minWidth = _ref$minWidth === void 0 ? 280 : _ref$minWidth,
1221
- props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
1518
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
1222
1519
  var maxWidth = '98%';
1223
1520
  var maxHeight = '98%';
1224
1521
  return jsx(ResizeComponent, Object.assign({
@@ -1443,7 +1740,7 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
1443
1740
  });
1444
1741
  };
1445
1742
 
1446
- var _excluded$a = ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"],
1743
+ var _excluded$c = ["open", "title", "description", "confirmLabel", "cancelLabel", "onSubmit", "onClose", "content", "disableAutoFocus", "isLoading"],
1447
1744
  _excluded2$1 = ["catchOnCancel"];
1448
1745
  var ConfirmationDialog = function ConfirmationDialog(_ref) {
1449
1746
  var open = _ref.open,
@@ -1459,7 +1756,7 @@ var ConfirmationDialog = function ConfirmationDialog(_ref) {
1459
1756
  disableAutoFocus = _ref$disableAutoFocus === void 0 ? false : _ref$disableAutoFocus,
1460
1757
  _ref$isLoading = _ref.isLoading,
1461
1758
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
1462
- other = _objectWithoutPropertiesLoose(_ref, _excluded$a);
1759
+ other = _objectWithoutPropertiesLoose(_ref, _excluded$c);
1463
1760
  other.catchOnCancel;
1464
1761
  var rest = _objectWithoutPropertiesLoose(other, _excluded2$1); // remove unwanted props
1465
1762
  var _useSharedTranslation = useSharedTranslation(),
@@ -2758,7 +3055,7 @@ var ToolHeader = function ToolHeader(_ref) {
2758
3055
  });
2759
3056
  };
2760
3057
 
2761
- var _excluded$9 = ["title", "size", "children", "onClose", "isResizable", "isDraggable", "maxHeight", "elevation", "headerClassName", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon"];
3058
+ var _excluded$b = ["title", "size", "children", "onClose", "isResizable", "isDraggable", "maxHeight", "elevation", "headerClassName", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon"];
2762
3059
  var styles$4 = {
2763
3060
  container: {
2764
3061
  overflow: 'hidden',
@@ -2797,7 +3094,7 @@ var ToolContainer = function ToolContainer(_ref) {
2797
3094
  rightHeaderComponent = _ref$rightHeaderCompo === void 0 ? null : _ref$rightHeaderCompo,
2798
3095
  dragHandleIcon = _ref.dragHandleIcon,
2799
3096
  closeIcon = _ref.closeIcon,
2800
- props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
3097
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
2801
3098
  return jsxs(Paper, Object.assign({
2802
3099
  elevation: elevation,
2803
3100
  sx: styles$4.container
@@ -2970,7 +3267,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
2970
3267
  }, [isOpen, getBoundsNode]);
2971
3268
  };
2972
3269
 
2973
- var _excluded$8 = ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "startDraggablePosition", "children", "isOpen", "onClose", "initialMaxHeight", "fixTopPosition", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon", "className", "sx", "resetPositionOnOpen"];
3270
+ var _excluded$a = ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "startDraggablePosition", "children", "isOpen", "onClose", "initialMaxHeight", "fixTopPosition", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon", "className", "sx", "resetPositionOnOpen"];
2974
3271
  // calculate dialog size and position to 85% of screensize
2975
3272
  var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
2976
3273
  var width = window.innerWidth * 0.85;
@@ -3074,7 +3371,7 @@ var DraggableComponent = function DraggableComponent(_ref) {
3074
3371
  sx = _ref$sx === void 0 ? {} : _ref$sx,
3075
3372
  _ref$resetPositionOnO = _ref.resetPositionOnOpen,
3076
3373
  resetPositionOnOpen = _ref$resetPositionOnO === void 0 ? false : _ref$resetPositionOnO,
3077
- props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
3374
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
3078
3375
  var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
3079
3376
  var elevation = BASE_ELEVATION + order;
3080
3377
  var nodeRef = React.useRef(null);
@@ -3902,7 +4199,7 @@ var getInitials = function getInitials(name) {
3902
4199
  }
3903
4200
  };
3904
4201
 
3905
- var _excluded$7 = ["value", "orientation", "shouldAutoFocus", "extraStyles"];
4202
+ var _excluded$9 = ["value", "orientation", "shouldAutoFocus", "extraStyles"];
3906
4203
  var sliderHeaderStyle = {
3907
4204
  fontFamily: 'Roboto-Black, Roboto',
3908
4205
  fontSize: 12,
@@ -3961,7 +4258,7 @@ var CustomSlider = function CustomSlider(_ref) {
3961
4258
  shouldAutoFocus = _ref$shouldAutoFocus === void 0 ? false : _ref$shouldAutoFocus,
3962
4259
  _ref$extraStyles = _ref.extraStyles,
3963
4260
  extraStyles = _ref$extraStyles === void 0 ? {} : _ref$extraStyles,
3964
- props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
4261
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
3965
4262
  // Add custom class (for bold text) to label adjacent to thumb component.
3966
4263
  // Material UI doesn't support highlighing only adjacent label
3967
4264
  // when track is highlighted everywhere below selected value.
@@ -4008,7 +4305,7 @@ var CustomSlider = function CustomSlider(_ref) {
4008
4305
  }, props));
4009
4306
  };
4010
4307
 
4011
- var _excluded$6 = ["variant", "className", "value"];
4308
+ var _excluded$8 = ["variant", "className", "value"];
4012
4309
  // This button is same as MUI ToggleButton but adds the variant prop
4013
4310
  var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
4014
4311
  var _ref$variant = _ref.variant,
@@ -4016,7 +4313,7 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
4016
4313
  className = _ref.className,
4017
4314
  _ref$value = _ref.value,
4018
4315
  value = _ref$value === void 0 ? 0 : _ref$value,
4019
- props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
4316
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
4020
4317
  return jsx(ToggleButton, Object.assign({
4021
4318
  className: variant + " " + className,
4022
4319
  ref: ref,
@@ -4024,7 +4321,7 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
4024
4321
  }, props));
4025
4322
  });
4026
4323
 
4027
- var _excluded$5 = ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "isEnabled", "hasBackgroundColor", "variant", "additionalStyling", "skipLocalStyling"],
4324
+ var _excluded$7 = ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "isEnabled", "hasBackgroundColor", "variant", "additionalStyling", "skipLocalStyling"],
4028
4325
  _excluded2 = ["className", "additionalStyling", "MenuProps"];
4029
4326
  var TooltipSelect = function TooltipSelect(_ref) {
4030
4327
  var _ref$tooltip = _ref.tooltip,
@@ -4043,7 +4340,7 @@ var TooltipSelect = function TooltipSelect(_ref) {
4043
4340
  additionalStyling = _ref$additionalStylin === void 0 ? {} : _ref$additionalStylin,
4044
4341
  _ref$skipLocalStyling = _ref.skipLocalStyling,
4045
4342
  skipLocalStyling = _ref$skipLocalStyling === void 0 ? false : _ref$skipLocalStyling,
4046
- props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
4343
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
4047
4344
  var _React$useState = React.useState(false),
4048
4345
  selectOpen = _React$useState[0],
4049
4346
  setSelectOpen = _React$useState[1];
@@ -4250,7 +4547,7 @@ var tooltipContainerStyles = function tooltipContainerStyles(theme, isEnabled, h
4250
4547
  });
4251
4548
  };
4252
4549
 
4253
- var _excluded$4 = ["title", "title2", "defaultExpanded", "disableGutters", "expandedElevation", "collapsedElevation", "transitionDuration", "detailsSx", "CustomExpandIcon", "children", "amountOfItems"];
4550
+ var _excluded$6 = ["title", "title2", "defaultExpanded", "disableGutters", "expandedElevation", "collapsedElevation", "transitionDuration", "detailsSx", "CustomExpandIcon", "children", "amountOfItems"];
4254
4551
  var CustomAccordion = function CustomAccordion(_ref) {
4255
4552
  var title = _ref.title,
4256
4553
  title2 = _ref.title2,
@@ -4268,7 +4565,7 @@ var CustomAccordion = function CustomAccordion(_ref) {
4268
4565
  CustomExpandIcon = _ref.CustomExpandIcon,
4269
4566
  children = _ref.children,
4270
4567
  amountOfItems = _ref.amountOfItems,
4271
- props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
4568
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
4272
4569
  var _React$useState = React.useState(defaultExpanded),
4273
4570
  expanded = _React$useState[0],
4274
4571
  setExpanded = _React$useState[1];
@@ -4379,7 +4676,7 @@ var SearchHighlight = function SearchHighlight(_ref) {
4379
4676
  });
4380
4677
  };
4381
4678
 
4382
- var _excluded$3 = ["activeLabel", "inActiveLabel", "tooltip"];
4679
+ var _excluded$5 = ["activeLabel", "inActiveLabel", "tooltip"];
4383
4680
  var styles$1 = {
4384
4681
  label: {
4385
4682
  color: 'geowebColors.buttons.tertiary.default.color',
@@ -4395,7 +4692,7 @@ var SwitchButton = function SwitchButton(_ref) {
4395
4692
  inActiveLabel = _ref$inActiveLabel === void 0 ? 'Viewer' : _ref$inActiveLabel,
4396
4693
  _ref$tooltip = _ref.tooltip,
4397
4694
  tooltip = _ref$tooltip === void 0 ? 'Switch mode' : _ref$tooltip,
4398
- props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
4695
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
4399
4696
  return jsx(CustomTooltip, {
4400
4697
  className: "switch-button",
4401
4698
  title: tooltip,
@@ -4511,8 +4808,18 @@ var SearchField$1 = function SearchField(_ref) {
4511
4808
  var _useTranslation = useTranslation(SHARED_NAMESPACE),
4512
4809
  t = _useTranslation.t;
4513
4810
  var translatedLabel = label != null ? label : onOpenServicePopup ? t('shared-search-services') : t('shared-search');
4514
- // eslint-disable-next-line react-hooks/exhaustive-deps
4515
- var setSearchFilterDebounced = React.useCallback(debounce(setSearchFilter, 300), []);
4811
+ var onSearchChange = React.useRef(setSearchFilter);
4812
+ onSearchChange.current = setSearchFilter;
4813
+ var setSearchFilterDebounced = React.useMemo(function () {
4814
+ return debounce(function (value) {
4815
+ return onSearchChange.current(value);
4816
+ }, 300);
4817
+ }, []);
4818
+ React.useEffect(function () {
4819
+ return function () {
4820
+ return setSearchFilterDebounced.cancel();
4821
+ };
4822
+ }, [setSearchFilterDebounced]);
4516
4823
  var handleChange = function handleChange(text) {
4517
4824
  setLocalSearchString(text);
4518
4825
  if (!isURL(text)) {
@@ -4534,14 +4841,16 @@ var SearchField$1 = function SearchField(_ref) {
4534
4841
  }
4535
4842
  }
4536
4843
  };
4537
- // mirror store unless typing a URL
4844
+ // Cancel pending input when the consumer replaces the filter (for example on panel navigation).
4845
+ // Mirror store unless typing a URL.
4538
4846
  React.useEffect(function () {
4847
+ setSearchFilterDebounced.cancel();
4539
4848
  if (isURL(localSearchString)) {
4540
4849
  return;
4541
4850
  }
4542
4851
  setLocalSearchString(searchFilter);
4543
4852
  // eslint-disable-next-line react-hooks/exhaustive-deps
4544
- }, [searchFilter]);
4853
+ }, [searchFilter, setSearchFilterDebounced]);
4545
4854
  return jsx(TextField, {
4546
4855
  autoFocus: true,
4547
4856
  fullWidth: true,
@@ -5165,7 +5474,7 @@ var SearchField = function SearchField(_ref3) {
5165
5474
  });
5166
5475
  };
5167
5476
 
5168
- var _excluded$2 = ["activeLabelFilterCount", "filters", "onClickFilterChip", "onSearch", "isAllSelected", "searchQuery", "showLabelFilterToggle", "isLabelFilterOpen", "onToggleLabelFilter", "showSearchField"];
5477
+ var _excluded$4 = ["activeLabelFilterCount", "filters", "onClickFilterChip", "onSearch", "isAllSelected", "searchQuery", "showLabelFilterToggle", "isLabelFilterOpen", "onToggleLabelFilter", "showSearchField"];
5169
5478
  var DEFAULT_FILTER_HEIGHT = 85;
5170
5479
  var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
5171
5480
  var _ref$activeLabelFilte = _ref.activeLabelFilterCount,
@@ -5183,7 +5492,7 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
5183
5492
  onToggleLabelFilter = _ref.onToggleLabelFilter,
5184
5493
  _ref$showSearchField = _ref.showSearchField,
5185
5494
  showSearchField = _ref$showSearchField === void 0 ? true : _ref$showSearchField,
5186
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
5495
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
5187
5496
  return jsx(Box, {
5188
5497
  ref: ref,
5189
5498
  sx: Object.assign({
@@ -5332,14 +5641,14 @@ var LegendToggleButton = function LegendToggleButton(_ref) {
5332
5641
  });
5333
5642
  };
5334
5643
 
5335
- var _excluded$1 = ["isDark", "children", "sx"];
5644
+ var _excluded$3 = ["isDark", "children", "sx"];
5336
5645
  var StorybookDocsWrapper = function StorybookDocsWrapper(_ref) {
5337
5646
  var _ref$isDark = _ref.isDark,
5338
5647
  isDark = _ref$isDark === void 0 ? false : _ref$isDark,
5339
5648
  children = _ref.children,
5340
5649
  _ref$sx = _ref.sx,
5341
5650
  sx = _ref$sx === void 0 ? [] : _ref$sx,
5342
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
5651
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
5343
5652
  return jsx(Box, Object.assign({
5344
5653
  sx: [].concat(isDark ? [{
5345
5654
  backgroundColor: 'geowebColors.background.surfaceBrowser'
@@ -6250,12 +6559,25 @@ var parseRelativeReferenceTimeOffset = function parseRelativeReferenceTimeOffset
6250
6559
  var formatRelativeReferenceTimeLabel = function formatRelativeReferenceTimeLabel(offset) {
6251
6560
  return offset > 0 ? "Latest -" + offset : 'Latest';
6252
6561
  };
6562
+ /** Sort dated instances newest first and keep other IDs in their supplied order. */
6563
+ var sortInstancesNewestFirst = function sortInstancesNewestFirst(instances) {
6564
+ return instances.map(function (instance) {
6565
+ var timestamp = parseCustomDateString(instance.id).getTime();
6566
+ return {
6567
+ instance: instance,
6568
+ timestamp: Number.isNaN(timestamp) ? Number.NEGATIVE_INFINITY : timestamp
6569
+ };
6570
+ }).sort(function (first, second) {
6571
+ return second.timestamp - first.timestamp || 0;
6572
+ }).map(function (_ref) {
6573
+ var instance = _ref.instance;
6574
+ return instance;
6575
+ });
6576
+ };
6253
6577
  var getValidInstancesNewestFirst = function getValidInstancesNewestFirst(instances) {
6254
- return instances.filter(function (instance) {
6578
+ return sortInstancesNewestFirst(instances.filter(function (instance) {
6255
6579
  return isValid(parseCustomDateString(instance.id));
6256
- }).sort(function (firstInstance, secondInstance) {
6257
- return parseCustomDateString(secondInstance.id).getTime() - parseCustomDateString(firstInstance.id).getTime();
6258
- });
6580
+ }));
6259
6581
  };
6260
6582
  var buildRelativeReferenceTimeOptions = function buildRelativeReferenceTimeOptions(instances, maxOptions) {
6261
6583
  if (maxOptions === void 0) {
@@ -6319,9 +6641,29 @@ var index = /*#__PURE__*/Object.freeze({
6319
6641
  isRelativeReferenceTime: isRelativeReferenceTime,
6320
6642
  parseRelativeReferenceTimeOffset: parseRelativeReferenceTimeOffset,
6321
6643
  relativeReferenceTimeToken: relativeReferenceTimeToken,
6322
- resolveReferenceTimeInstance: resolveReferenceTimeInstance
6644
+ resolveReferenceTimeInstance: resolveReferenceTimeInstance,
6645
+ sortInstancesNewestFirst: sortInstancesNewestFirst
6323
6646
  });
6324
6647
 
6648
+ /* *
6649
+ * Licensed under the Apache License, Version 2.0 (the "License");
6650
+ * you may not use this file except in compliance with the License.
6651
+ * You may obtain a copy of the License at
6652
+ *
6653
+ * http://www.apache.org/licenses/LICENSE-2.0
6654
+ *
6655
+ * Unless required by applicable law or agreed to in writing, software
6656
+ * distributed under the License is distributed on an "AS IS" BASIS,
6657
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6658
+ * See the License for the specific language governing permissions and
6659
+ * limitations under the License.
6660
+ *
6661
+ * Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6662
+ * Copyright 2026 - Finnish Meteorological Institute (FMI)
6663
+ * Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
6664
+ * */
6665
+ var EARTH_MEAN_RADIUS_KM = 6371;
6666
+
6325
6667
  var URL_REGEX = /(https?:\/\/[^\s<>"')]+)/g;
6326
6668
  // Splits text on URLs and turns them into links
6327
6669
  var linkifyText = function linkifyText(text, keyPrefix) {
@@ -6854,7 +7196,7 @@ var NumberWithUnitField = function NumberWithUnitField(_ref) {
6854
7196
  });
6855
7197
  };
6856
7198
 
6857
- var _excluded = ["value", "defaultValue", "minDateTime", "maxDateTime", "onAccept", "onChange", "showUTCAdornment", "slots", "slotProps"];
7199
+ var _excluded$2 = ["value", "defaultValue", "minDateTime", "maxDateTime", "onAccept", "onChange", "showUTCAdornment", "slots", "slotProps"];
6858
7200
  var utcToPickerDate = function utcToPickerDate(value) {
6859
7201
  return new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), 0,
6860
7202
  // seconds to zero
@@ -6910,7 +7252,7 @@ var DateTimePicker = function DateTimePicker(_ref) {
6910
7252
  showUTCAdornment = _ref$showUTCAdornment === void 0 ? true : _ref$showUTCAdornment,
6911
7253
  slots = _ref.slots,
6912
7254
  slotProps = _ref.slotProps,
6913
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
7255
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
6914
7256
  var callerFieldSlotProps = slotProps == null ? void 0 : slotProps.field;
6915
7257
  var callerOpenPickerButtonSlotProps = slotProps == null ? void 0 : slotProps.openPickerButton;
6916
7258
  var callerTextFieldSlotProps = slotProps == null ? void 0 : slotProps.textField;
@@ -7778,6 +8120,2458 @@ var SortablePanels = function SortablePanels(_ref) {
7778
8120
  }) : content;
7779
8121
  };
7780
8122
 
8123
+ var _excluded$1 = ["fields", "leading", "trailing", "renderField"];
8124
+ /** Matches the time-series manager's column widths and spacing. */
8125
+ var PlotManagerLayout = function PlotManagerLayout(_ref) {
8126
+ var fields = _ref.fields,
8127
+ leading = _ref.leading,
8128
+ trailing = _ref.trailing,
8129
+ renderField = _ref.renderField,
8130
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
8131
+ return jsxs(Grid, Object.assign({
8132
+ container: true,
8133
+ spacing: 2
8134
+ }, props, {
8135
+ sx: [{
8136
+ alignItems: 'center',
8137
+ justifyContent: 'space-between'
8138
+ }].concat(Array.isArray(props.sx) ? props.sx : [props.sx]),
8139
+ children: [jsx(Grid, {
8140
+ sx: {
8141
+ width: 48
8142
+ },
8143
+ children: leading
8144
+ }), fields.map(function (field) {
8145
+ return jsx(Grid, {
8146
+ className: "plot-manager-column plot-manager-field-" + field.id,
8147
+ size: field.width ? undefined : 'grow',
8148
+ sx: {
8149
+ width: field.width,
8150
+ minWidth: 0
8151
+ },
8152
+ children: renderField(field)
8153
+ }, field.id);
8154
+ }), jsx(Grid, {
8155
+ sx: {
8156
+ width: 88,
8157
+ pr: 0.5
8158
+ },
8159
+ children: trailing
8160
+ })]
8161
+ }));
8162
+ };
8163
+ var getRowTextStyles = function getRowTextStyles(enabled, plot) {
8164
+ if (plot === void 0) {
8165
+ plot = false;
8166
+ }
8167
+ return {
8168
+ fontSize: plot ? 14 : 12,
8169
+ fontWeight: 500,
8170
+ color: enabled ? 'geowebColors.layerManager.tableRowDefaultText.color' : 'geowebColors.layerManager.tableRowDisabledText.color'
8171
+ };
8172
+ };
8173
+ var getRowStyles = function getRowStyles(enabled, plot) {
8174
+ if (plot === void 0) {
8175
+ plot = false;
8176
+ }
8177
+ return Object.assign({}, getRowTextStyles(enabled, plot), {
8178
+ backgroundColor: enabled ? 'geowebColors.layerManager.tableRowDefaultCardContainer.fill' : 'geowebColors.layerManager.tableRowDisabledCardContainer.fill',
8179
+ borderStyle: 'solid',
8180
+ borderWidth: '1px',
8181
+ borderColor: 'geowebColors.cards.cardContainerBorder',
8182
+ borderRadius: 1,
8183
+ marginBottom: 0.25,
8184
+ height: plot ? 34 : 33,
8185
+ width: '100%'
8186
+ });
8187
+ };
8188
+
8189
+ var PlotManagerParameterSelect = function PlotManagerParameterSelect(_ref) {
8190
+ var _collection$parameter;
8191
+ var parameter = _ref.parameter,
8192
+ collection = _ref.collection,
8193
+ disabled = _ref.disabled,
8194
+ _onChange = _ref.onChange;
8195
+ var _useSharedTranslation = useSharedTranslation(),
8196
+ t = _useSharedTranslation.t;
8197
+ var options = (_collection$parameter = collection == null ? void 0 : collection.parameters) != null ? _collection$parameter : [];
8198
+ var selected = options.find(function (option) {
8199
+ return option.propertyName === parameter.propertyName;
8200
+ });
8201
+ return jsxs(TooltipSelect, {
8202
+ SelectDisplayProps: {
8203
+ 'aria-label': t('shared-parameter-name')
8204
+ },
8205
+ isEnabled: !disabled,
8206
+ onChange: function onChange(event) {
8207
+ var option = options.find(function (item) {
8208
+ return item.propertyName === event.target.value;
8209
+ });
8210
+ if (option) {
8211
+ _onChange({
8212
+ propertyName: option.propertyName,
8213
+ propertyLabel: option.propertyLabel,
8214
+ unit: option.unit
8215
+ });
8216
+ }
8217
+ },
8218
+ tooltip: t('shared-parameter') + ": " + parameter.propertyName,
8219
+ value: parameter.propertyName,
8220
+ children: [jsx(MenuItem, {
8221
+ disabled: true,
8222
+ children: t('shared-parameter')
8223
+ }), collection != null && collection.isLoading ? jsx(LinearProgress, {
8224
+ "aria-label": t('shared-loading'),
8225
+ color: "inherit"
8226
+ }) : null, !selected ? jsx(MenuItem, {
8227
+ value: parameter.propertyName,
8228
+ children: parameter.propertyLabel || parameter.propertyName
8229
+ }) : null, options.map(function (option) {
8230
+ return jsx(MenuItem, {
8231
+ value: option.propertyName,
8232
+ children: option.propertyLabel || option.propertyName
8233
+ }, option.propertyName);
8234
+ })]
8235
+ });
8236
+ };
8237
+ var REFERENCE_TIME = 'reference_time';
8238
+ var DEFAULT_REFERENCE_TIME = 'latest-0';
8239
+ var formatReferenceTime = function formatReferenceTime(id) {
8240
+ var _dateToString;
8241
+ var date = parseCustomDateString(id);
8242
+ return isValid(date) ? (_dateToString = dateToString(date, "yyyy-MM-dd'T'HH:mm:ss 'Z'")) != null ? _dateToString : id : id;
8243
+ };
8244
+ var useReferenceTimeControl = function useReferenceTimeControl(_ref2) {
8245
+ var disabled = _ref2.disabled,
8246
+ hasCurrentReferenceTimes = _ref2.hasCurrentReferenceTimes,
8247
+ instanceId = _ref2.instanceId,
8248
+ isActive = _ref2.isActive,
8249
+ _onChange2 = _ref2.onChange,
8250
+ referenceTimes = _ref2.referenceTimes;
8251
+ var _useSharedTranslation2 = useSharedTranslation(),
8252
+ t = _useSharedTranslation2.t;
8253
+ var _React$useState = React.useState(),
8254
+ lastAvailableRelative = _React$useState[0],
8255
+ setLastAvailableRelative = _React$useState[1];
8256
+ var lastNormalization = React.useRef(null);
8257
+ var latestCount = Math.min(5, referenceTimes.filter(function (_ref3) {
8258
+ var id = _ref3.id;
8259
+ return isValid(parseCustomDateString(id));
8260
+ }).length);
8261
+ var latestOptions = Array.from({
8262
+ length: latestCount
8263
+ }, function (_, index) {
8264
+ return {
8265
+ id: "latest-" + index,
8266
+ label: index === 0 ? t('shared-latest') : t('shared-latest-offset', {
8267
+ index: index
8268
+ })
8269
+ };
8270
+ });
8271
+ var storedReferenceTime = instanceId === 'latest' ? DEFAULT_REFERENCE_TIME : instanceId;
8272
+ var hasReferenceTimes = referenceTimes.length > 0 && !referenceTimes.some(function (_ref4) {
8273
+ var id = _ref4.id;
8274
+ return id === 'unvalidated';
8275
+ });
8276
+ var isAvailableRelative = latestOptions.some(function (_ref5) {
8277
+ var id = _ref5.id;
8278
+ return id === storedReferenceTime;
8279
+ });
8280
+ var hasStoredReferenceTime = isAvailableRelative || lastAvailableRelative !== undefined && lastAvailableRelative === storedReferenceTime || referenceTimes.some(function (_ref6) {
8281
+ var id = _ref6.id;
8282
+ return id === instanceId;
8283
+ });
8284
+ var referenceTime = hasStoredReferenceTime ? storedReferenceTime : DEFAULT_REFERENCE_TIME;
8285
+ React.useEffect(function () {
8286
+ // Preserve a previously available offset through metadata refreshes for the same selection.
8287
+ setLastAvailableRelative(function (previous) {
8288
+ if (hasReferenceTimes && isAvailableRelative) {
8289
+ return storedReferenceTime;
8290
+ }
8291
+ return previous === storedReferenceTime ? previous : undefined;
8292
+ });
8293
+ }, [hasReferenceTimes, isAvailableRelative, storedReferenceTime]);
8294
+ var needsNormalization = isActive && hasCurrentReferenceTimes && hasReferenceTimes && !hasStoredReferenceTime && instanceId !== DEFAULT_REFERENCE_TIME;
8295
+ React.useEffect(function () {
8296
+ if (!needsNormalization) {
8297
+ lastNormalization.current = null;
8298
+ } else if (lastNormalization.current !== instanceId) {
8299
+ lastNormalization.current = instanceId;
8300
+ _onChange2({
8301
+ instanceId: DEFAULT_REFERENCE_TIME
8302
+ });
8303
+ }
8304
+ }, [instanceId, needsNormalization, _onChange2]);
8305
+ if (!isActive || !hasReferenceTimes) {
8306
+ return null;
8307
+ }
8308
+ var options = [].concat(latestOptions, referenceTimes.map(function (_ref7) {
8309
+ var id = _ref7.id,
8310
+ label = _ref7.label;
8311
+ return {
8312
+ id: id,
8313
+ label: label != null ? label : formatReferenceTime(id)
8314
+ };
8315
+ }));
8316
+ return jsxs(TooltipSelect, {
8317
+ SelectDisplayProps: {
8318
+ 'aria-label': t('shared-reference-time')
8319
+ },
8320
+ isEnabled: !disabled,
8321
+ onChange: function onChange(event) {
8322
+ var selectedTime = String(event.target.value);
8323
+ if (selectedTime.startsWith('latest-') && !/^latest-\d+$/.test(selectedTime)) {
8324
+ return;
8325
+ }
8326
+ _onChange2({
8327
+ instanceId: selectedTime
8328
+ });
8329
+ },
8330
+ tooltip: t('shared-reference-time'),
8331
+ value: options.some(function (_ref8) {
8332
+ var id = _ref8.id;
8333
+ return id === referenceTime;
8334
+ }) ? referenceTime : '',
8335
+ children: [jsx(MenuItem, {
8336
+ disabled: true,
8337
+ children: t('shared-reference-time')
8338
+ }), options.map(function (_ref9) {
8339
+ var id = _ref9.id,
8340
+ label = _ref9.label;
8341
+ return jsx(MenuItem, {
8342
+ value: id,
8343
+ children: label
8344
+ }, id);
8345
+ })]
8346
+ });
8347
+ };
8348
+ /** Edits one dimension at a time while preserving values of all other dimensions. */
8349
+ var usePlotManagerDimensionControls = function usePlotManagerDimensionControls(_ref0) {
8350
+ var _collection$dimension, _dimensionOptions$fin, _dimensionOptions$fin2, _dimensionOptions$, _parameter$dimensions, _parameter$dimensions2, _activeDimension$valu;
8351
+ var parameter = _ref0.parameter,
8352
+ collection = _ref0.collection,
8353
+ disabled = _ref0.disabled,
8354
+ _onChange3 = _ref0.onChange;
8355
+ var _useSharedTranslation3 = useSharedTranslation(),
8356
+ t = _useSharedTranslation3.t;
8357
+ var _React$useState2 = React.useState(),
8358
+ selectedId = _React$useState2[0],
8359
+ setSelectedId = _React$useState2[1];
8360
+ var _React$useState3 = React.useState([]),
8361
+ lastReferenceTimes = _React$useState3[0],
8362
+ setLastReferenceTimes = _React$useState3[1];
8363
+ var dimensions = (_collection$dimension = collection == null ? void 0 : collection.dimensions) != null ? _collection$dimension : [];
8364
+ var instances = collection == null ? void 0 : collection.referenceTimes;
8365
+ var sortedInstances = React.useMemo(function () {
8366
+ return instances && sortInstancesNewestFirst(instances);
8367
+ }, [instances]);
8368
+ React.useEffect(function () {
8369
+ if (sortedInstances) {
8370
+ setLastReferenceTimes(sortedInstances);
8371
+ }
8372
+ }, [sortedInstances]);
8373
+ var referenceTimes = sortedInstances != null ? sortedInstances : lastReferenceTimes;
8374
+ var hasReferenceTime = referenceTimes.length > 0 && !referenceTimes.some(function (_ref1) {
8375
+ var id = _ref1.id;
8376
+ return id === 'unvalidated';
8377
+ });
8378
+ var dimensionOptions = [].concat(hasReferenceTime ? [{
8379
+ id: REFERENCE_TIME,
8380
+ label: t('shared-reference-time')
8381
+ }] : [], dimensions.map(function (dimension) {
8382
+ var _dimension$label;
8383
+ return {
8384
+ id: dimension.id,
8385
+ label: (_dimension$label = dimension.label) != null ? _dimension$label : dimension.id
8386
+ };
8387
+ }));
8388
+ var activeId = selectedId === REFERENCE_TIME ? selectedId : (_dimensionOptions$fin = (_dimensionOptions$fin2 = dimensionOptions.find(function (_ref10) {
8389
+ var id = _ref10.id;
8390
+ return id === selectedId;
8391
+ })) == null ? void 0 : _dimensionOptions$fin2.id) != null ? _dimensionOptions$fin : (_dimensionOptions$ = dimensionOptions[0]) == null ? void 0 : _dimensionOptions$.id;
8392
+ var referenceTimeControl = useReferenceTimeControl({
8393
+ disabled: disabled,
8394
+ hasCurrentReferenceTimes: sortedInstances !== undefined,
8395
+ instanceId: parameter.instanceId,
8396
+ isActive: activeId === REFERENCE_TIME && dimensionOptions.length > 0,
8397
+ onChange: _onChange3,
8398
+ referenceTimes: referenceTimes
8399
+ });
8400
+ if (!activeId || dimensionOptions.length === 0) {
8401
+ return null;
8402
+ }
8403
+ var activeDimension = dimensions.find(function (dimension) {
8404
+ return dimension.id === activeId;
8405
+ });
8406
+ var selectedValue = (_parameter$dimensions = (_parameter$dimensions2 = parameter.dimensions) == null || (_parameter$dimensions2 = _parameter$dimensions2.find(function (dimension) {
8407
+ return dimension.id === activeId;
8408
+ })) == null ? void 0 : _parameter$dimensions2.value) != null ? _parameter$dimensions : '';
8409
+ var values = ((_activeDimension$valu = activeDimension == null ? void 0 : activeDimension.values) != null ? _activeDimension$valu : []).map(String).filter(function (value) {
8410
+ return value !== '';
8411
+ });
8412
+ return jsxs(Grid, {
8413
+ container: true,
8414
+ children: [jsx(Grid, {
8415
+ size: "grow",
8416
+ children: jsxs(TooltipSelect, {
8417
+ SelectDisplayProps: {
8418
+ 'aria-label': t('shared-dimension-id')
8419
+ },
8420
+ isEnabled: !disabled,
8421
+ onChange: function onChange(event) {
8422
+ setSelectedId(String(event.target.value));
8423
+ },
8424
+ tooltip: t('shared-dimension-id') + ": " + activeId,
8425
+ value: activeId === REFERENCE_TIME && !hasReferenceTime ? '' : activeId,
8426
+ children: [jsx(MenuItem, {
8427
+ disabled: true,
8428
+ children: t('shared-dimension-id')
8429
+ }), dimensionOptions.map(function (option) {
8430
+ return jsx(MenuItem, {
8431
+ value: option.id,
8432
+ children: option.label
8433
+ }, option.id);
8434
+ })]
8435
+ })
8436
+ }), jsx(Grid, {
8437
+ size: "grow",
8438
+ children: activeId === REFERENCE_TIME ? referenceTimeControl : jsxs(TooltipSelect, {
8439
+ SelectDisplayProps: {
8440
+ 'aria-label': t('shared-dimension-value')
8441
+ },
8442
+ displayEmpty: true,
8443
+ isEnabled: !disabled,
8444
+ onChange: function onChange(event) {
8445
+ var _parameter$dimensions3;
8446
+ _onChange3({
8447
+ dimensions: [].concat(((_parameter$dimensions3 = parameter.dimensions) != null ? _parameter$dimensions3 : []).filter(function (dimension) {
8448
+ return dimension.id !== activeId;
8449
+ }), [{
8450
+ id: activeId,
8451
+ value: String(event.target.value)
8452
+ }])
8453
+ });
8454
+ },
8455
+ renderValue: function renderValue(value) {
8456
+ return String(value) || t('shared-dimension-none');
8457
+ },
8458
+ tooltip: t('shared-dimension-value') + ": " + selectedValue,
8459
+ value: selectedValue,
8460
+ children: [jsx(MenuItem, {
8461
+ disabled: true,
8462
+ children: t('shared-dimension-value')
8463
+ }), jsx(MenuItem, {
8464
+ value: "",
8465
+ children: t('shared-dimension-none')
8466
+ }), selectedValue && !values.includes(selectedValue) ? jsx(MenuItem, {
8467
+ value: selectedValue,
8468
+ children: selectedValue
8469
+ }) : null, values.map(function (value) {
8470
+ return jsx(MenuItem, {
8471
+ value: value,
8472
+ children: value
8473
+ }, value);
8474
+ })]
8475
+ })
8476
+ })]
8477
+ });
8478
+ };
8479
+
8480
+ /** The manager owns all common columns; consumers configure styling columns only. */
8481
+ var usePlotManagerColumns = function usePlotManagerColumns(_ref) {
8482
+ var _ref$collections = _ref.collections,
8483
+ collections = _ref$collections === void 0 ? [] : _ref$collections,
8484
+ _ref$styleFields = _ref.styleFields,
8485
+ styleFields = _ref$styleFields === void 0 ? [] : _ref$styleFields,
8486
+ onChangeParameter = _ref.onChangeParameter;
8487
+ var _useSharedTranslation = useSharedTranslation(),
8488
+ t = _useSharedTranslation.t;
8489
+ return [{
8490
+ id: 'collection',
8491
+ label: t('shared-collection'),
8492
+ width: '60px',
8493
+ render: function render(_ref2) {
8494
+ var parameter = _ref2.parameter,
8495
+ compact = _ref2.compact,
8496
+ disabled = _ref2.disabled;
8497
+ return jsx(Box, {
8498
+ sx: Object.assign({}, compact && getRowTextStyles(!disabled), {
8499
+ overflow: 'hidden',
8500
+ textOverflow: 'ellipsis',
8501
+ whiteSpace: 'nowrap'
8502
+ }),
8503
+ children: parameter.collectionId
8504
+ });
8505
+ }
8506
+ }, {
8507
+ id: 'parameter',
8508
+ label: t('shared-parameter'),
8509
+ width: '15%',
8510
+ render: function render(_ref3) {
8511
+ var parameter = _ref3.parameter,
8512
+ plot = _ref3.plot,
8513
+ disabled = _ref3.disabled;
8514
+ return jsx(PlotManagerParameterSelect, {
8515
+ collection: collections.find(function (collection) {
8516
+ return collection.id === parameter.collectionId && collection.serviceId === parameter.serviceId;
8517
+ }),
8518
+ disabled: disabled,
8519
+ onChange: function onChange(changes) {
8520
+ return onChangeParameter(plot.id, parameter.id, changes);
8521
+ },
8522
+ parameter: parameter
8523
+ });
8524
+ }
8525
+ }].concat(styleFields.map(function (field) {
8526
+ var _field$label;
8527
+ return Object.assign({}, field, {
8528
+ label: (_field$label = field.label) != null ? _field$label : t('shared-style')
8529
+ });
8530
+ }), [{
8531
+ id: 'dimension',
8532
+ label: t('shared-dimension'),
8533
+ render: function render(_context, dimensionControls) {
8534
+ return dimensionControls;
8535
+ }
8536
+ }]);
8537
+ };
8538
+
8539
+ var MissingUnitWarning = function MissingUnitWarning(_ref) {
8540
+ var parameter = _ref.parameter;
8541
+ var _useSharedTranslation = useSharedTranslation(),
8542
+ t = _useSharedTranslation.t;
8543
+ var parameterName = parameter.propertyLabel || parameter.propertyName;
8544
+ var message = t('shared-missing-units', {
8545
+ parameter: parameterName
8546
+ });
8547
+ var _t$split = t('shared-missing-units', {
8548
+ parameter: '{{parameter}}'
8549
+ }).split('{{parameter}}'),
8550
+ beforeParameter = _t$split[0],
8551
+ afterParameter = _t$split[1];
8552
+ return jsx(CustomTooltip, {
8553
+ title: jsxs(Fragment, {
8554
+ children: [beforeParameter, jsx("em", {
8555
+ children: parameterName
8556
+ }), afterParameter]
8557
+ }),
8558
+ children: jsx(Box, {
8559
+ "aria-label": message,
8560
+ component: "span",
8561
+ "data-testid": "missing-unit-warning",
8562
+ role: "img",
8563
+ sx: {
8564
+ display: 'inline-flex',
8565
+ color: 'geowebColors.functional.error'
8566
+ },
8567
+ tabIndex: 0,
8568
+ children: jsx(Exclamation, {})
8569
+ })
8570
+ });
8571
+ };
8572
+ var SelectParametersButton = function SelectParametersButton(_ref2) {
8573
+ var plot = _ref2.plot,
8574
+ onSelectParameters = _ref2.onSelectParameters,
8575
+ selectedPlotId = _ref2.selectedPlotId,
8576
+ label = _ref2.label,
8577
+ _ref2$marginLeft = _ref2.marginLeft,
8578
+ marginLeft = _ref2$marginLeft === void 0 ? '4px' : _ref2$marginLeft;
8579
+ return jsx(CustomTooltip, {
8580
+ title: label + " " + plot.title,
8581
+ children: jsx("span", {
8582
+ children: jsx(CustomToggleButton, {
8583
+ "aria-label": label + " " + plot.title,
8584
+ disabled: plot.enabled === false,
8585
+ onClick: function onClick() {
8586
+ return onSelectParameters(plot.id);
8587
+ },
8588
+ selected: selectedPlotId === plot.id,
8589
+ sx: {
8590
+ marginLeft: marginLeft,
8591
+ height: '24px!important',
8592
+ width: '24px',
8593
+ paddingLeft: '5px',
8594
+ svg: {
8595
+ marginLeft: '8px'
8596
+ }
8597
+ },
8598
+ variant: "tool",
8599
+ children: jsx(TimeSeriesSelect, {})
8600
+ })
8601
+ })
8602
+ });
8603
+ };
8604
+ var PlotTitle = function PlotTitle(_ref3) {
8605
+ var plot = _ref3.plot,
8606
+ onUpdateTitle = _ref3.onUpdateTitle,
8607
+ label = _ref3.label;
8608
+ var _React$useState = React.useState(),
8609
+ draft = _React$useState[0],
8610
+ setDraft = _React$useState[1];
8611
+ var commit = function commit() {
8612
+ if (draft != null && draft.trim() && draft.trim() !== plot.title) {
8613
+ onUpdateTitle == null || onUpdateTitle(plot.id, draft.trim());
8614
+ }
8615
+ setDraft(undefined);
8616
+ };
8617
+ return draft === undefined ? jsx(CustomTooltip, {
8618
+ describeChild: true,
8619
+ placement: "top",
8620
+ title: onUpdateTitle ? jsx(Fragment, {
8621
+ children: label
8622
+ }) : '',
8623
+ children: jsx(Box, {
8624
+ component: onUpdateTitle ? 'button' : 'span',
8625
+ onClick: onUpdateTitle ? function () {
8626
+ return setDraft(plot.title);
8627
+ } : undefined,
8628
+ sx: {
8629
+ color: 'inherit',
8630
+ font: 'inherit',
8631
+ border: 0,
8632
+ padding: 0,
8633
+ background: 'none',
8634
+ textAlign: 'left',
8635
+ cursor: onUpdateTitle ? 'text' : 'default',
8636
+ display: 'block',
8637
+ width: '100%',
8638
+ textOverflow: 'ellipsis',
8639
+ whiteSpace: 'nowrap',
8640
+ overflow: 'hidden'
8641
+ },
8642
+ children: plot.title
8643
+ })
8644
+ }) : jsx(ClickAwayListener, {
8645
+ onClickAway: commit,
8646
+ children: jsx(Input, {
8647
+ autoFocus: true,
8648
+ onBlur: commit,
8649
+ onChange: function onChange(event) {
8650
+ return setDraft(event.target.value);
8651
+ },
8652
+ onFocus: function onFocus(event) {
8653
+ return event.target.select();
8654
+ },
8655
+ onKeyDown: function onKeyDown(event) {
8656
+ if (event.key === 'Enter') {
8657
+ commit();
8658
+ }
8659
+ if (event.key === 'Escape') {
8660
+ setDraft(undefined);
8661
+ }
8662
+ },
8663
+ slotProps: {
8664
+ input: {
8665
+ 'aria-label': label + " " + plot.title
8666
+ }
8667
+ },
8668
+ sx: {
8669
+ font: 'inherit',
8670
+ color: 'inherit',
8671
+ maxWidth: '100%',
8672
+ backgroundColor: 'geowebColors.textInputField.default.rgba'
8673
+ },
8674
+ value: draft
8675
+ })
8676
+ });
8677
+ };
8678
+ var PlotParameterRow = function PlotParameterRow(_ref4) {
8679
+ var _props$collections, _hasMissingUnit, _parameter$unit;
8680
+ var parameter = _ref4.parameter,
8681
+ plot = _ref4.plot,
8682
+ props = _ref4.props,
8683
+ fields = _ref4.fields,
8684
+ labels = _ref4.labels;
8685
+ var hasMissingUnit = props.hasMissingUnit,
8686
+ onDeleteParameter = props.onDeleteParameter,
8687
+ onDuplicateParameter = props.onDuplicateParameter,
8688
+ onToggleParameter = props.onToggleParameter,
8689
+ renderParameterActions = props.renderParameterActions,
8690
+ renderParameterStatus = props.renderParameterStatus;
8691
+ var _useSharedTranslation2 = useSharedTranslation(),
8692
+ t = _useSharedTranslation2.t;
8693
+ var plotDisabled = plot.enabled === false;
8694
+ var disabled = plotDisabled || parameter.enabled === false;
8695
+ var dimensionControls = usePlotManagerDimensionControls({
8696
+ parameter: parameter,
8697
+ collection: (_props$collections = props.collections) == null ? void 0 : _props$collections.find(function (_ref5) {
8698
+ var id = _ref5.id,
8699
+ serviceId = _ref5.serviceId;
8700
+ return id === parameter.collectionId && serviceId === parameter.serviceId;
8701
+ }),
8702
+ disabled: disabled,
8703
+ onChange: function onChange(changes) {
8704
+ return props.onChangeParameter(plot.id, parameter.id, changes);
8705
+ }
8706
+ });
8707
+ var showMissingUnit = (_hasMissingUnit = hasMissingUnit == null ? void 0 : hasMissingUnit(parameter, plot)) != null ? _hasMissingUnit : !((_parameter$unit = parameter.unit) != null && _parameter$unit.trim());
8708
+ var renderParameter = function renderParameter(compact) {
8709
+ var _fields$find$render, _fields$find;
8710
+ var name = parameter.propertyLabel || parameter.propertyName;
8711
+ var context = {
8712
+ parameter: parameter,
8713
+ plot: plot,
8714
+ disabled: disabled,
8715
+ compact: compact
8716
+ };
8717
+ var renderField = function renderField(field) {
8718
+ return field.render(context, dimensionControls);
8719
+ };
8720
+ var controls = jsxs(Grid, {
8721
+ container: true,
8722
+ sx: {
8723
+ justifyContent: 'space-between'
8724
+ },
8725
+ children: [renderParameterActions == null ? void 0 : renderParameterActions(context), onDuplicateParameter ? jsx(CustomIconButton, {
8726
+ onClick: function onClick() {
8727
+ return onDuplicateParameter(plot.id, parameter.id);
8728
+ },
8729
+ shouldShowAsDisabled: plotDisabled,
8730
+ tooltipTitle: labels.duplicate + " " + name,
8731
+ children: jsx(Copy, {})
8732
+ }) : null, onDeleteParameter ? jsx(CustomIconButton, {
8733
+ onClick: function onClick() {
8734
+ return onDeleteParameter(plot.id, parameter.id);
8735
+ },
8736
+ shouldShowAsDisabled: plotDisabled,
8737
+ tooltipTitle: labels.remove + " " + name,
8738
+ children: jsx(Delete, {})
8739
+ }) : null]
8740
+ });
8741
+ var visibility = jsxs(Box, {
8742
+ sx: {
8743
+ display: 'flex',
8744
+ alignItems: 'center',
8745
+ justifyContent: 'flex-end'
8746
+ },
8747
+ children: [renderParameterStatus == null ? void 0 : renderParameterStatus(context), showMissingUnit ? jsx(MissingUnitWarning, {
8748
+ parameter: parameter
8749
+ }) : null, onToggleParameter ? jsx(CustomIconButton, {
8750
+ onClick: function onClick(event) {
8751
+ event.stopPropagation();
8752
+ onToggleParameter(plot.id, parameter.id);
8753
+ },
8754
+ shouldShowAsDisabled: compact ? plotDisabled : disabled,
8755
+ tooltipTitle: (parameter.enabled === false ? labels.show : labels.hide) + " " + name,
8756
+ children: disabled ? jsx(VisibilityOff, {}) : jsx(Visibility, {})
8757
+ }) : null]
8758
+ });
8759
+ return compact ? jsx(Box, {
8760
+ className: "plot-manager-compact",
8761
+ children: jsx(CustomAccordion, {
8762
+ CustomExpandIcon: ArrowDropDownDown,
8763
+ "aria-label": t('shared-parameter-settings', {
8764
+ parameter: name
8765
+ }),
8766
+ defaultExpanded: false,
8767
+ sx: {
8768
+ mx: 0,
8769
+ width: '100%',
8770
+ alignItems: 'center',
8771
+ '.MuiAccordionSummary-content': {
8772
+ margin: 0
8773
+ },
8774
+ backgroundColor: plotDisabled ? 'geowebColors.layerManager.tableRowDisabledCardContainer.fill' : 'geowebColors.layerManager.tableRowDefaultCardContainer.fill'
8775
+ },
8776
+ title: jsxs(Grid, {
8777
+ container: true,
8778
+ spacing: 2,
8779
+ sx: {
8780
+ alignItems: 'center',
8781
+ pl: '14px'
8782
+ },
8783
+ children: [visibility, jsx(Grid, {
8784
+ size: "grow",
8785
+ sx: {
8786
+ minWidth: 0
8787
+ },
8788
+ children: (_fields$find$render = (_fields$find = fields.find(function (field) {
8789
+ return field.id === 'collection';
8790
+ })) == null ? void 0 : _fields$find.render(context)) != null ? _fields$find$render : name
8791
+ })]
8792
+ }),
8793
+ children: jsxs(Grid, {
8794
+ container: true,
8795
+ spacing: 2,
8796
+ sx: {
8797
+ padding: '16px 10px',
8798
+ flexDirection: 'column'
8799
+ },
8800
+ children: [fields.flatMap(function (field) {
8801
+ var _field$compactFields;
8802
+ return ((_field$compactFields = field.compactFields) != null ? _field$compactFields : [field]).map(function (detail) {
8803
+ return jsxs(React.Fragment, {
8804
+ children: [jsx(Grid, {
8805
+ children: detail.label
8806
+ }), jsx(Grid, {
8807
+ children: renderField(detail)
8808
+ })]
8809
+ }, detail.id);
8810
+ });
8811
+ }), jsx(Grid, {
8812
+ children: controls
8813
+ })]
8814
+ })
8815
+ })
8816
+ }) : jsx(PlotManagerLayout, {
8817
+ className: "plot-manager-wide plot-manager-parameter",
8818
+ fields: fields,
8819
+ leading: visibility,
8820
+ renderField: renderField,
8821
+ sx: getRowStyles(!disabled),
8822
+ trailing: controls
8823
+ });
8824
+ };
8825
+ return jsxs(Fragment, {
8826
+ children: [renderParameter(false), renderParameter(true)]
8827
+ });
8828
+ };
8829
+ var PlotGroup = function PlotGroup(_ref6) {
8830
+ var plot = _ref6.plot,
8831
+ props = _ref6.props,
8832
+ fields = _ref6.fields,
8833
+ labels = _ref6.labels,
8834
+ group = _ref6.group,
8835
+ sorting = _ref6.sorting,
8836
+ setSorting = _ref6.setSorting;
8837
+ var plots = props.plots,
8838
+ onMoveParameter = props.onMoveParameter,
8839
+ onMovePlot = props.onMovePlot,
8840
+ onTogglePlot = props.onTogglePlot,
8841
+ onUpdateTitle = props.onUpdateTitle,
8842
+ onSelectParameters = props.onSelectParameters,
8843
+ onDuplicatePlot = props.onDuplicatePlot,
8844
+ onDeletePlot = props.onDeletePlot,
8845
+ selectedPlotId = props.selectedPlotId;
8846
+ var _React$useState2 = React.useState(true),
8847
+ expanded = _React$useState2[0],
8848
+ setExpanded = _React$useState2[1];
8849
+ var plotDisabled = plot.enabled === false;
8850
+ var singlePlot = plots.length === 1 && !props.onAddPlot;
8851
+ var showPlotHeader = !singlePlot || onTogglePlot || onUpdateTitle || onDuplicatePlot || onDeletePlot;
8852
+ return jsxs(Box, {
8853
+ sx: props.onAddPlot ? {
8854
+ boxShadow: 3,
8855
+ borderRadius: 0.75,
8856
+ backgroundColor: 'geowebColors.background.surface'
8857
+ } : undefined,
8858
+ children: [showPlotHeader ? jsx(PlotManagerLayout, {
8859
+ className: "plot-manager-plot",
8860
+ "data-testid": "plot-manager-plot",
8861
+ fields: fields,
8862
+ leading: jsxs(Grid, {
8863
+ container: true,
8864
+ sx: {
8865
+ justifyContent: 'space-between'
8866
+ },
8867
+ children: [!singlePlot && onMovePlot ? jsx(CustomIconButton, {
8868
+ className: "plot-handle",
8869
+ shouldShowAsDisabled: plotDisabled,
8870
+ sx: {
8871
+ cursor: 'grab'
8872
+ },
8873
+ tooltipTitle: sorting ? '' : labels.reorder + " " + plot.title,
8874
+ children: jsx(DragHandle, {})
8875
+ }) : null, onTogglePlot ? jsx(CustomIconButton, {
8876
+ onClick: function onClick() {
8877
+ return onTogglePlot(plot.id);
8878
+ },
8879
+ shouldShowAsDisabled: plotDisabled,
8880
+ tooltipTitle: (plotDisabled ? labels.show : labels.hide) + " " + plot.title,
8881
+ children: plotDisabled ? jsx(VisibilityOff, {}) : jsx(Visibility, {})
8882
+ }) : null]
8883
+ }),
8884
+ renderField: function renderField(field) {
8885
+ if (field.id === 'collection' && onSelectParameters) {
8886
+ return !singlePlot ? jsx(SelectParametersButton, {
8887
+ label: labels.selectParameters,
8888
+ onSelectParameters: onSelectParameters,
8889
+ plot: plot,
8890
+ selectedPlotId: selectedPlotId
8891
+ }) : null;
8892
+ }
8893
+ return field.id === 'parameter' ? jsx(PlotTitle, {
8894
+ label: labels.editTitle,
8895
+ onUpdateTitle: onUpdateTitle,
8896
+ plot: plot
8897
+ }) : null;
8898
+ },
8899
+ sx: getRowStyles(!plotDisabled, true),
8900
+ trailing: jsxs(Grid, {
8901
+ container: true,
8902
+ sx: {
8903
+ alignItems: 'center',
8904
+ justifyContent: 'flex-end'
8905
+ },
8906
+ children: [!singlePlot ? jsx(CustomIconButton, {
8907
+ onClick: function onClick() {
8908
+ return setExpanded(!expanded);
8909
+ },
8910
+ tooltipTitle: (expanded ? labels.collapse : labels.expand) + " " + plot.title,
8911
+ children: expanded ? jsx(ChevronUp, {}) : jsx(ChevronDown, {})
8912
+ }) : null, onDuplicatePlot || onDeletePlot ? jsx(ToggleMenu, {
8913
+ buttonIcon: jsx(Options, {}),
8914
+ buttonSx: {
8915
+ margin: '0 2px',
8916
+ '&.MuiButtonBase-root': {
8917
+ backgroundColor: 'transparent'
8918
+ }
8919
+ },
8920
+ buttonTestId: group + "-options-" + plot.id,
8921
+ menuItems: [].concat(onDuplicatePlot ? [{
8922
+ text: labels.duplicate,
8923
+ action: function action() {
8924
+ return onDuplicatePlot(plot.id);
8925
+ },
8926
+ icon: jsx(Copy, {})
8927
+ }] : [], onDeletePlot ? [{
8928
+ text: labels.remove,
8929
+ action: function action() {
8930
+ return onDeletePlot(plot.id);
8931
+ },
8932
+ icon: jsx(Delete, {})
8933
+ }] : []),
8934
+ tooltipTitle: labels.plotOptions + " " + plot.title,
8935
+ variant: "flat"
8936
+ }) : null]
8937
+ })
8938
+ }) : null, jsx(Collapse, {
8939
+ "in": singlePlot || expanded,
8940
+ sx: {
8941
+ marginBottom: 0.25,
8942
+ '& .plot-manager-parameter-list:empty': {
8943
+ minHeight: sorting === 'parameter' ? '24px' : undefined
8944
+ }
8945
+ },
8946
+ timeout: "auto",
8947
+ unmountOnExit: true,
8948
+ children: jsx(ReactSortable, {
8949
+ animation: 200,
8950
+ className: "plot-manager-parameter-list",
8951
+ direction: "vertical",
8952
+ disabled: !onMoveParameter,
8953
+ group: {
8954
+ name: group + "-parameters",
8955
+ pull: true,
8956
+ put: [group + "-parameters"]
8957
+ },
8958
+ id: group + "-" + plot.id,
8959
+ list: plot.parameters.map(function (_ref7) {
8960
+ var id = _ref7.id;
8961
+ return {
8962
+ id: id
8963
+ };
8964
+ }),
8965
+ onEnd: function onEnd(event) {
8966
+ var _plots$find, _plots$find2;
8967
+ setSorting(undefined);
8968
+ var oldIndex = event.oldIndex,
8969
+ newIndex = event.newIndex,
8970
+ from = event.from,
8971
+ to = event.to;
8972
+ var fromPlotId = (_plots$find = plots.find(function (item) {
8973
+ return group + "-" + item.id === from.id;
8974
+ })) == null ? void 0 : _plots$find.id;
8975
+ var toPlotId = (_plots$find2 = plots.find(function (item) {
8976
+ return group + "-" + item.id === to.id;
8977
+ })) == null ? void 0 : _plots$find2.id;
8978
+ if (oldIndex !== undefined && newIndex !== undefined && fromPlotId && toPlotId && (fromPlotId !== toPlotId || oldIndex !== newIndex)) {
8979
+ onMoveParameter == null || onMoveParameter({
8980
+ oldIndex: oldIndex,
8981
+ newIndex: newIndex,
8982
+ fromPlotId: fromPlotId,
8983
+ toPlotId: toPlotId
8984
+ });
8985
+ }
8986
+ },
8987
+ onStart: function onStart() {
8988
+ return setSorting('parameter');
8989
+ },
8990
+ setList: function setList() {},
8991
+ swapThreshold: 0.3,
8992
+ children: plot.parameters.map(function (parameter) {
8993
+ return jsx(Box, {
8994
+ "data-testid": "parameter-" + parameter.id,
8995
+ sx: {
8996
+ marginBottom: '4px',
8997
+ cursor: onMoveParameter ? 'grab' : undefined,
8998
+ '&.sortable-ghost': {
8999
+ opacity: 0.5
9000
+ }
9001
+ },
9002
+ children: jsx(PlotParameterRow, {
9003
+ fields: fields,
9004
+ labels: labels,
9005
+ parameter: parameter,
9006
+ plot: plot,
9007
+ props: props
9008
+ })
9009
+ }, parameter.id);
9010
+ })
9011
+ })
9012
+ })]
9013
+ });
9014
+ };
9015
+ /** Controlled manager using the time-series manager's visual layout. */
9016
+ var PlotManager = function PlotManager(props) {
9017
+ var _sx;
9018
+ var containerProps = props.containerProps,
9019
+ title = props.title,
9020
+ onAddPlot = props.onAddPlot,
9021
+ plots = props.plots,
9022
+ onMovePlot = props.onMovePlot,
9023
+ _props$compactBreakpo = props.compactBreakpoint,
9024
+ compactBreakpoint = _props$compactBreakpo === void 0 ? 620 : _props$compactBreakpo,
9025
+ onSelectParameters = props.onSelectParameters,
9026
+ selectedPlotId = props.selectedPlotId;
9027
+ var singlePlot = plots.length === 1 && !onAddPlot ? plots[0] : undefined;
9028
+ var group = React.useId();
9029
+ var _React$useState3 = React.useState(),
9030
+ sorting = _React$useState3[0],
9031
+ setSorting = _React$useState3[1];
9032
+ var _useSharedTranslation3 = useSharedTranslation(),
9033
+ t = _useSharedTranslation3.t;
9034
+ var fields = usePlotManagerColumns(props);
9035
+ var labels = {
9036
+ addPlot: t('shared-add-plot'),
9037
+ show: t('shared-show'),
9038
+ hide: t('shared-hide'),
9039
+ duplicate: t('shared-duplicate'),
9040
+ remove: t('shared-remove'),
9041
+ selectParameters: t('shared-select-parameters'),
9042
+ editTitle: t('shared-edit-title'),
9043
+ expand: t('shared-expand'),
9044
+ collapse: t('shared-collapse'),
9045
+ reorder: t('shared-reorder'),
9046
+ plotOptions: t('shared-plot-options')
9047
+ };
9048
+ return jsx(DraggableComponent, Object.assign({
9049
+ isOpen: true,
9050
+ minHeight: 126,
9051
+ minWidth: 320,
9052
+ startPosition: {
9053
+ top: 85,
9054
+ left: 50
9055
+ },
9056
+ startSize: {
9057
+ width: 900,
9058
+ height: 300
9059
+ }
9060
+ }, containerProps, {
9061
+ title: title != null ? title : t('shared-plot-manager'),
9062
+ children: jsxs(Box, {
9063
+ sx: (_sx = {
9064
+ containerType: 'inline-size',
9065
+ padding: '0 6px',
9066
+ '.plot-manager-compact': {
9067
+ display: 'none'
9068
+ }
9069
+ }, _sx["@container (max-width: " + compactBreakpoint + "px)"] = {
9070
+ '.plot-manager-wide': {
9071
+ display: 'none'
9072
+ },
9073
+ '.plot-manager-compact': {
9074
+ display: 'block'
9075
+ },
9076
+ '.plot-manager-header': {
9077
+ justifyContent: 'flex-start'
9078
+ },
9079
+ '.plot-manager-header > .plot-manager-column:not(.plot-manager-field-collection)': {
9080
+ display: 'none'
9081
+ },
9082
+ '.plot-manager-plot': {
9083
+ flexWrap: 'nowrap',
9084
+ justifyContent: 'flex-start',
9085
+ '> .plot-manager-field-collection': {
9086
+ width: 'auto'
9087
+ },
9088
+ '> .plot-manager-field-parameter': {
9089
+ flex: 1
9090
+ },
9091
+ '> :last-child': {
9092
+ width: 'auto',
9093
+ flexShrink: 0
9094
+ }
9095
+ },
9096
+ '.plot-manager-plot > .plot-manager-column:not(.plot-manager-field-collection):not(.plot-manager-field-parameter)': {
9097
+ display: 'none'
9098
+ }
9099
+ }, _sx),
9100
+ children: [jsx(PlotManagerLayout, {
9101
+ className: "plot-manager-header",
9102
+ "data-testid": "plot-manager-header",
9103
+ fields: fields,
9104
+ leading: jsxs(Box, {
9105
+ sx: {
9106
+ display: 'flex',
9107
+ alignItems: 'center'
9108
+ },
9109
+ children: [onAddPlot ? jsx(CustomIconButton, {
9110
+ onClick: onAddPlot,
9111
+ sx: {
9112
+ border: 'none'
9113
+ },
9114
+ tooltipTitle: labels.addPlot,
9115
+ children: jsx("span", {
9116
+ children: jsx(Add, {})
9117
+ })
9118
+ }) : null, singlePlot && onSelectParameters ? jsx(SelectParametersButton, {
9119
+ label: labels.selectParameters,
9120
+ marginLeft: "12px",
9121
+ onSelectParameters: onSelectParameters,
9122
+ plot: singlePlot,
9123
+ selectedPlotId: selectedPlotId
9124
+ }) : null]
9125
+ }),
9126
+ renderField: function renderField(field) {
9127
+ return jsx(Typography, {
9128
+ sx: {
9129
+ fontSize: 12,
9130
+ opacity: 0.67
9131
+ },
9132
+ children: field.label
9133
+ });
9134
+ },
9135
+ sx: {
9136
+ height: 48
9137
+ }
9138
+ }), jsx(ReactSortable, {
9139
+ animation: 200,
9140
+ direction: "vertical",
9141
+ disabled: !onMovePlot,
9142
+ group: {
9143
+ name: group + "-plots",
9144
+ pull: false,
9145
+ put: false
9146
+ },
9147
+ handle: ".plot-handle",
9148
+ list: plots.map(function (_ref8) {
9149
+ var id = _ref8.id;
9150
+ return {
9151
+ id: id
9152
+ };
9153
+ }),
9154
+ onEnd: function onEnd(event) {
9155
+ setSorting(undefined);
9156
+ if (event.oldIndex !== undefined && event.newIndex !== undefined && event.oldIndex !== event.newIndex) {
9157
+ onMovePlot == null || onMovePlot(event.oldIndex, event.newIndex);
9158
+ }
9159
+ },
9160
+ onStart: function onStart() {
9161
+ return setSorting('plot');
9162
+ },
9163
+ setList: function setList() {},
9164
+ swapThreshold: 0.3,
9165
+ children: plots.map(function (plot) {
9166
+ return jsx(Box, {
9167
+ sx: {
9168
+ '&.sortable-ghost': {
9169
+ opacity: 0.5
9170
+ }
9171
+ },
9172
+ children: jsx(PlotGroup, {
9173
+ fields: fields,
9174
+ group: group,
9175
+ labels: labels,
9176
+ plot: plot,
9177
+ props: props,
9178
+ setSorting: setSorting,
9179
+ sorting: sorting
9180
+ })
9181
+ }, plot.id);
9182
+ })
9183
+ })]
9184
+ })
9185
+ }));
9186
+ };
9187
+
9188
+ /* *
9189
+ * Licensed under the Apache License, Version 2.0 (the "License");
9190
+ * you may not use this file except in compliance with the License.
9191
+ * You may obtain a copy of the License at
9192
+ *
9193
+ * http://www.apache.org/licenses/LICENSE-2.0
9194
+ *
9195
+ * Unless required by applicable law or agreed to in writing, software
9196
+ * distributed under the License is distributed on an "AS IS" BASIS,
9197
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9198
+ * See the License for the specific language governing permissions and
9199
+ * limitations under the License.
9200
+ *
9201
+ * Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9202
+ * Copyright 2026 - Finnish Meteorological Institute (FMI)
9203
+ * Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
9204
+ * */
9205
+ var getCollectionKey = function getCollectionKey(collection) {
9206
+ return JSON.stringify([collection.serviceId, collection.id]);
9207
+ };
9208
+ /** Preserve the time-series selector's collection and parameter matching rules. */
9209
+ var filterCollections = function filterCollections(collections, services, serviceIds, search, getParameterSearchText) {
9210
+ var words = search.toLowerCase().split(' ');
9211
+ return collections.flatMap(function (collection) {
9212
+ var service = services.find(function (_ref) {
9213
+ var id = _ref.id;
9214
+ return id === collection.serviceId;
9215
+ });
9216
+ if (!service || serviceIds.length > 0 && !serviceIds.includes(service.id)) {
9217
+ return [];
9218
+ }
9219
+ if (search === '') {
9220
+ return [collection];
9221
+ }
9222
+ var collectionMatches = words.every(function (word) {
9223
+ return [collection.id, collection.title, service.id, service.name].some(function (text) {
9224
+ return text.toLowerCase().includes(word);
9225
+ });
9226
+ });
9227
+ var parameters = collection.parameters.filter(function (parameter) {
9228
+ return words.every(function (word) {
9229
+ return getParameterSearchText(parameter).toLowerCase().includes(word);
9230
+ });
9231
+ });
9232
+ return collectionMatches || parameters.length ? [Object.assign({}, collection, {
9233
+ parameters: parameters
9234
+ })] : [];
9235
+ });
9236
+ };
9237
+
9238
+ var _excluded = ["listRef"];
9239
+ var primaryText = {
9240
+ fontSize: '12px',
9241
+ height: '14px',
9242
+ lineHeight: '14px',
9243
+ fontWeight: 500,
9244
+ textOverflow: 'ellipsis',
9245
+ whiteSpace: 'nowrap',
9246
+ overflow: 'hidden'
9247
+ };
9248
+ var CollectionRow = function CollectionRow(_ref) {
9249
+ var _services$find$name, _services$find;
9250
+ var index = _ref.index,
9251
+ style = _ref.style,
9252
+ ariaAttributes = _ref.ariaAttributes,
9253
+ navigation = _ref.navigation,
9254
+ collections = _ref.collections,
9255
+ services = _ref.services,
9256
+ getParameterId = _ref.getParameterId,
9257
+ getParameterLabel = _ref.getParameterLabel,
9258
+ selectedParameterIds = _ref.selectedParameterIds,
9259
+ onToggleParameter = _ref.onToggleParameter,
9260
+ renderParameterInfo = _ref.renderParameterInfo,
9261
+ search = _ref.search,
9262
+ expanded = _ref.expanded,
9263
+ setExpanded = _ref.setExpanded;
9264
+ var _useSharedTranslation = useSharedTranslation(),
9265
+ t = _useSharedTranslation.t;
9266
+ var resultsLabel = function resultsLabel(count) {
9267
+ return t('shared-results', {
9268
+ count: count
9269
+ });
9270
+ };
9271
+ var collection = collections[index];
9272
+ var key = getCollectionKey(collection);
9273
+ var rowRef = React.useRef(null);
9274
+ React.useLayoutEffect(function () {
9275
+ if ((navigation == null ? void 0 : navigation.key) !== key || !expanded[key] || navigation.completed.current === navigation.requestKey) {
9276
+ return;
9277
+ }
9278
+ var row = rowRef.current;
9279
+ var list = row == null ? void 0 : row.parentElement;
9280
+ if (row && list && typeof list.scrollTo === 'function') {
9281
+ // Align only after the virtual row and its expanded height have committed.
9282
+ list.scrollTo({
9283
+ top: list.scrollTop + row.getBoundingClientRect().top - list.getBoundingClientRect().top
9284
+ });
9285
+ var completedNavigation = navigation.completed;
9286
+ completedNavigation.current = navigation.requestKey;
9287
+ }
9288
+ }, [navigation, key, expanded]);
9289
+ return jsxs(Box, Object.assign({}, ariaAttributes, {
9290
+ "data-collection-key": key,
9291
+ ref: rowRef,
9292
+ style: style,
9293
+ children: [jsx(ListItem, {
9294
+ sx: {
9295
+ backgroundColor: 'geowebColors.cards.cardContainer',
9296
+ height: '44px',
9297
+ marginTop: 0.5,
9298
+ border: '1px solid',
9299
+ borderRadius: '3px',
9300
+ padding: 0,
9301
+ zIndex: 10,
9302
+ overflow: 'hidden',
9303
+ borderColor: 'geowebColors.cards.cardContainerBorder'
9304
+ },
9305
+ children: jsxs(ListItemButton, {
9306
+ "aria-expanded": !!expanded[key],
9307
+ "aria-label": collection.title,
9308
+ onClick: function onClick() {
9309
+ return setExpanded(function (current) {
9310
+ var _Object$assign;
9311
+ return Object.assign({}, current, (_Object$assign = {}, _Object$assign[key] = !current[key], _Object$assign));
9312
+ });
9313
+ },
9314
+ sx: {
9315
+ height: '100%',
9316
+ paddingLeft: '24px',
9317
+ paddingRight: '8px'
9318
+ },
9319
+ children: [jsxs(Grid, {
9320
+ container: true,
9321
+ size: "grow",
9322
+ sx: {
9323
+ justifyContent: 'space-between',
9324
+ alignItems: 'center'
9325
+ },
9326
+ children: [jsxs(Grid, {
9327
+ size: "grow",
9328
+ children: [jsx(Box, {
9329
+ sx: primaryText,
9330
+ children: jsx(SearchHighlight, {
9331
+ search: search,
9332
+ text: collection.title
9333
+ })
9334
+ }), jsx(Box, {
9335
+ sx: Object.assign({}, primaryText, {
9336
+ fontWeight: 'normal'
9337
+ }),
9338
+ children: jsx(SearchHighlight, {
9339
+ search: search,
9340
+ text: (_services$find$name = (_services$find = services.find(function (service) {
9341
+ return service.id === collection.serviceId;
9342
+ })) == null ? void 0 : _services$find.name) != null ? _services$find$name : ''
9343
+ })
9344
+ })]
9345
+ }), jsx(Grid, {
9346
+ children: jsx(ListItemText, {
9347
+ primary: resultsLabel(collection.parameters.length),
9348
+ sx: {
9349
+ paddingLeft: 1,
9350
+ paddingRight: 5,
9351
+ textAlign: 'right',
9352
+ '.MuiListItemText-primary': {
9353
+ fontSize: '12px',
9354
+ fontWeight: 500
9355
+ }
9356
+ }
9357
+ })
9358
+ })]
9359
+ }), expanded[key] ? jsx(ChevronUp, {}) : jsx(ChevronDown, {})]
9360
+ })
9361
+ }), jsx(Collapse, {
9362
+ "in": !!expanded[key],
9363
+ timeout: 0,
9364
+ unmountOnExit: true,
9365
+ children: jsxs(List, {
9366
+ sx: {
9367
+ paddingBottom: 0,
9368
+ paddingTop: 0,
9369
+ backgroundColor: 'geowebColors.cards.cardContainer',
9370
+ borderWidth: '1px',
9371
+ borderStyle: 'none solid solid solid',
9372
+ borderColor: 'geowebColors.cards.cardContainerBorder',
9373
+ borderBottomLeftRadius: '3px',
9374
+ borderBottomRightRadius: '3px',
9375
+ boxShadow: 1,
9376
+ top: -5
9377
+ },
9378
+ children: [collection.parameters.length === 0 ? jsx(ListItem, {
9379
+ sx: {
9380
+ height: 38,
9381
+ pl: '40px',
9382
+ fontSize: 12
9383
+ },
9384
+ children: t('shared-no-matching-parameters')
9385
+ }) : null, collection.parameters.map(function (parameter, index) {
9386
+ var id = getParameterId(parameter);
9387
+ var label = getParameterLabel(parameter);
9388
+ var selected = selectedParameterIds.includes(id);
9389
+ return jsx(ListItem, {
9390
+ "aria-label": label,
9391
+ sx: {
9392
+ paddingLeft: '40px',
9393
+ paddingRight: '4px',
9394
+ height: index === 0 ? 38 : 34,
9395
+ minHeight: index === 0 ? '36px' : '32px',
9396
+ paddingTop: index === 0 ? '13px' : undefined,
9397
+ borderTop: index === 0 ? undefined : '1px solid',
9398
+ borderTopColor: 'geowebColors.cards.cardContainerBorder',
9399
+ ':hover': {
9400
+ backgroundColor: 'geowebColors.cards.cardContainerMouseOver'
9401
+ }
9402
+ },
9403
+ children: jsxs(Grid, {
9404
+ container: true,
9405
+ size: "grow",
9406
+ sx: {
9407
+ justifyContent: 'space-between',
9408
+ alignItems: 'center'
9409
+ },
9410
+ children: [jsx(Grid, {
9411
+ size: "grow",
9412
+ children: jsx(Box, {
9413
+ sx: primaryText,
9414
+ children: jsx(SearchHighlight, {
9415
+ search: search,
9416
+ text: label
9417
+ })
9418
+ })
9419
+ }), jsx(Grid, {
9420
+ children: jsxs(Box, {
9421
+ sx: {
9422
+ marginRight: '8px'
9423
+ },
9424
+ children: [renderParameterInfo == null ? void 0 : renderParameterInfo(parameter), jsx(CustomToggleButton, {
9425
+ "aria-label": t(selected ? 'shared-remove' : 'shared-add') + " " + label,
9426
+ fullWidth: true,
9427
+ onClick: function onClick() {
9428
+ return onToggleParameter(parameter, selected);
9429
+ },
9430
+ selected: selected,
9431
+ sx: {
9432
+ width: '60px',
9433
+ height: '24px!important',
9434
+ marginLeft: '4px'
9435
+ },
9436
+ variant: "tool",
9437
+ children: t(selected ? 'shared-remove' : 'shared-add')
9438
+ })]
9439
+ })
9440
+ })]
9441
+ })
9442
+ }, id);
9443
+ })]
9444
+ })
9445
+ })]
9446
+ }));
9447
+ };
9448
+ var ParameterSelectList = function ParameterSelectList(_ref2) {
9449
+ var listRef = _ref2.listRef,
9450
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded);
9451
+ var _useSharedTranslation2 = useSharedTranslation(),
9452
+ t = _useSharedTranslation2.t;
9453
+ return jsx(List$1, {
9454
+ "aria-label": t('shared-collection'),
9455
+ listRef: listRef,
9456
+ rowComponent: CollectionRow,
9457
+ rowCount: props.collections.length,
9458
+ rowHeight: function rowHeight(index) {
9459
+ var collection = props.collections[index];
9460
+ return props.expanded[getCollectionKey(collection)] ? 48 + Math.max(1, collection.parameters.length) * 34 + 5 : 48;
9461
+ },
9462
+ rowProps: props,
9463
+ style: {
9464
+ height: '100%',
9465
+ width: '100%'
9466
+ }
9467
+ });
9468
+ };
9469
+
9470
+ var isValidServiceUrl = function isValidServiceUrl(value) {
9471
+ try {
9472
+ var parsed = new URL(value);
9473
+ return ['http:', 'https:'].includes(parsed.protocol) && Boolean(parsed.hostname);
9474
+ } catch (_unused) {
9475
+ return false;
9476
+ }
9477
+ };
9478
+ var SelectServices = function SelectServices(_ref) {
9479
+ var _ref2, _ref3, _showService$type, _ref7, _showService$url2, _showService$name, _showService$descript;
9480
+ var services = _ref.services,
9481
+ usedServiceIds = _ref.usedServiceIds,
9482
+ onAddService = _ref.onAddService,
9483
+ onEditService = _ref.onEditService,
9484
+ onRemoveService = _ref.onRemoveService,
9485
+ addServiceTitle = _ref.addServiceTitle,
9486
+ newServiceUrl = _ref.newServiceUrl,
9487
+ serviceType = _ref.serviceType,
9488
+ onCopyServiceUrl = _ref.onCopyServiceUrl,
9489
+ onCloseNewService = _ref.onCloseNewService,
9490
+ loadServiceMetadata = _ref.loadServiceMetadata;
9491
+ var _useSharedTranslation = useSharedTranslation(),
9492
+ t = _useSharedTranslation.t;
9493
+ var addDialogTitle = addServiceTitle != null ? addServiceTitle : t('shared-add-service-title');
9494
+ var _React$useState = React.useState(null),
9495
+ anchor = _React$useState[0],
9496
+ setAnchor = _React$useState[1];
9497
+ var _React$useState2 = React.useState(false),
9498
+ adding = _React$useState2[0],
9499
+ setAdding = _React$useState2[1];
9500
+ var _React$useState3 = React.useState(),
9501
+ showService = _React$useState3[0],
9502
+ setShowService = _React$useState3[1];
9503
+ var _React$useState4 = React.useState(),
9504
+ editingService = _React$useState4[0],
9505
+ setEditingService = _React$useState4[1];
9506
+ var _React$useState5 = React.useState(''),
9507
+ name = _React$useState5[0],
9508
+ setName = _React$useState5[1];
9509
+ var _React$useState6 = React.useState(''),
9510
+ url = _React$useState6[0],
9511
+ setUrl = _React$useState6[1];
9512
+ var _React$useState7 = React.useState(''),
9513
+ description = _React$useState7[0],
9514
+ setDescription = _React$useState7[1];
9515
+ var _React$useState8 = React.useState(false),
9516
+ urlTouched = _React$useState8[0],
9517
+ setUrlTouched = _React$useState8[1];
9518
+ var _React$useState9 = React.useState(false),
9519
+ metadataLoading = _React$useState9[0],
9520
+ setMetadataLoading = _React$useState9[1];
9521
+ var _React$useState0 = React.useState(),
9522
+ metadataError = _React$useState0[0],
9523
+ setMetadataError = _React$useState0[1];
9524
+ var _React$useState1 = React.useState(),
9525
+ submitError = _React$useState1[0],
9526
+ setSubmitError = _React$useState1[1];
9527
+ var _React$useState10 = React.useState(false),
9528
+ saving = _React$useState10[0],
9529
+ setSaving = _React$useState10[1];
9530
+ var savingRef = React.useRef(false);
9531
+ var generation = React.useRef(0);
9532
+ var metadataRequest = React.useRef(0);
9533
+ var metadataUrl = React.useRef(undefined);
9534
+ var validUrl = isValidServiceUrl(url.trim());
9535
+ var duplicateUrl = services.some(function (service) {
9536
+ return service.id !== (editingService == null ? void 0 : editingService.id) && service.url === url.trim();
9537
+ });
9538
+ var duplicateName = services.some(function (service) {
9539
+ return service.id !== (editingService == null ? void 0 : editingService.id) && (service.name || service.id).toLowerCase() === name.trim().toLowerCase();
9540
+ });
9541
+ var canSave = !!name.trim() && !duplicateName && !saving && !metadataLoading && (editingService ? !!onEditService : validUrl && !duplicateUrl && !!onAddService);
9542
+ var displayedServiceType = (_ref2 = (_ref3 = (_showService$type = showService == null ? void 0 : showService.type) != null ? _showService$type : editingService == null ? void 0 : editingService.type) != null ? _ref3 : serviceType) != null ? _ref2 : 'EDR';
9543
+ var editDialogTitle = editingService ? t('shared-edit-service') : undefined;
9544
+ var dialogTitle = editDialogTitle != null ? editDialogTitle : showService ? t('shared-service') : addDialogTitle;
9545
+ var urlError = adding && urlTouched && (!validUrl || duplicateUrl);
9546
+ var formId = React.useId();
9547
+ var resetRequests = function resetRequests() {
9548
+ generation.current += 1;
9549
+ metadataRequest.current += 1;
9550
+ metadataUrl.current = undefined;
9551
+ savingRef.current = false;
9552
+ setSaving(false);
9553
+ setMetadataLoading(false);
9554
+ setMetadataError(undefined);
9555
+ setSubmitError(undefined);
9556
+ };
9557
+ var close = function close() {
9558
+ resetRequests();
9559
+ setAdding(false);
9560
+ setShowService(undefined);
9561
+ setEditingService(undefined);
9562
+ onCloseNewService();
9563
+ };
9564
+ var loadMetadata = /*#__PURE__*/function () {
9565
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(value) {
9566
+ var candidate, request, metadata, _metadata$description, _t;
9567
+ return _regenerator().w(function (_context) {
9568
+ while (1) switch (_context.p = _context.n) {
9569
+ case 0:
9570
+ candidate = value.trim();
9571
+ setUrlTouched(true);
9572
+ if (!(!loadServiceMetadata || metadataUrl.current === candidate || !isValidServiceUrl(candidate) || services.some(function (service) {
9573
+ return service.url === candidate;
9574
+ }))) {
9575
+ _context.n = 1;
9576
+ break;
9577
+ }
9578
+ return _context.a(2);
9579
+ case 1:
9580
+ metadataRequest.current += 1;
9581
+ request = metadataRequest.current;
9582
+ metadataUrl.current = candidate;
9583
+ setMetadataLoading(true);
9584
+ setMetadataError(undefined);
9585
+ _context.p = 2;
9586
+ _context.n = 3;
9587
+ return loadServiceMetadata(candidate);
9588
+ case 3:
9589
+ metadata = _context.v;
9590
+ if (request === metadataRequest.current) {
9591
+ setName(metadata.name);
9592
+ setDescription((_metadata$description = metadata.description) != null ? _metadata$description : '');
9593
+ }
9594
+ _context.n = 5;
9595
+ break;
9596
+ case 4:
9597
+ _context.p = 4;
9598
+ _t = _context.v;
9599
+ if (request === metadataRequest.current) {
9600
+ metadataUrl.current = undefined;
9601
+ setMetadataError(_t instanceof Error ? _t.message : t('shared-service-request-failed'));
9602
+ }
9603
+ case 5:
9604
+ _context.p = 5;
9605
+ if (request === metadataRequest.current) {
9606
+ setMetadataLoading(false);
9607
+ }
9608
+ return _context.f(5);
9609
+ case 6:
9610
+ return _context.a(2);
9611
+ }
9612
+ }, _callee, null, [[2, 4, 5, 6]]);
9613
+ }));
9614
+ return function loadMetadata(_x) {
9615
+ return _ref4.apply(this, arguments);
9616
+ };
9617
+ }();
9618
+ React.useEffect(function () {
9619
+ if (newServiceUrl !== undefined) {
9620
+ resetRequests();
9621
+ setUrl(newServiceUrl);
9622
+ setName('');
9623
+ setDescription('');
9624
+ setUrlTouched(true);
9625
+ setAdding(true);
9626
+ void loadMetadata(newServiceUrl);
9627
+ }
9628
+ // A search-field request starts a new form session, independently of loader identity.
9629
+ // eslint-disable-next-line react-hooks/exhaustive-deps
9630
+ }, [newServiceUrl]);
9631
+ React.useEffect(function () {
9632
+ return function () {
9633
+ metadataRequest.current += 1;
9634
+ generation.current += 1;
9635
+ };
9636
+ }, []);
9637
+ var submit = /*#__PURE__*/function () {
9638
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
9639
+ var session, details, _t2;
9640
+ return _regenerator().w(function (_context2) {
9641
+ while (1) switch (_context2.p = _context2.n) {
9642
+ case 0:
9643
+ if (!(showService || !canSave || savingRef.current)) {
9644
+ _context2.n = 1;
9645
+ break;
9646
+ }
9647
+ return _context2.a(2);
9648
+ case 1:
9649
+ savingRef.current = true;
9650
+ setSaving(true);
9651
+ setSubmitError(undefined);
9652
+ session = generation.current;
9653
+ details = {
9654
+ name: name.trim(),
9655
+ description: description.trim()
9656
+ };
9657
+ _context2.p = 2;
9658
+ if (!editingService) {
9659
+ _context2.n = 4;
9660
+ break;
9661
+ }
9662
+ _context2.n = 3;
9663
+ return onEditService == null ? void 0 : onEditService(editingService.id, details);
9664
+ case 3:
9665
+ _context2.n = 5;
9666
+ break;
9667
+ case 4:
9668
+ _context2.n = 5;
9669
+ return onAddService == null ? void 0 : onAddService(Object.assign({}, details, {
9670
+ url: url.trim(),
9671
+ scope: 'user'
9672
+ }));
9673
+ case 5:
9674
+ if (session === generation.current) {
9675
+ close();
9676
+ }
9677
+ _context2.n = 7;
9678
+ break;
9679
+ case 6:
9680
+ _context2.p = 6;
9681
+ _t2 = _context2.v;
9682
+ if (session === generation.current) {
9683
+ setSubmitError(_t2 instanceof Error ? _t2.message : t('shared-service-save-failed'));
9684
+ }
9685
+ case 7:
9686
+ _context2.p = 7;
9687
+ if (session === generation.current) {
9688
+ savingRef.current = false;
9689
+ setSaving(false);
9690
+ }
9691
+ return _context2.f(7);
9692
+ case 8:
9693
+ return _context2.a(2);
9694
+ }
9695
+ }, _callee2, null, [[2, 6, 7, 8]]);
9696
+ }));
9697
+ return function submit() {
9698
+ return _ref5.apply(this, arguments);
9699
+ };
9700
+ }();
9701
+ return jsxs(Fragment, {
9702
+ children: [jsx(CustomIconButton, {
9703
+ isSelected: !!anchor,
9704
+ onClick: function onClick(event) {
9705
+ return setAnchor(event.currentTarget);
9706
+ },
9707
+ tooltipTitle: t('shared-service-options'),
9708
+ variant: "tool",
9709
+ children: jsx(Options, {})
9710
+ }), jsx(Menu, {
9711
+ anchorEl: anchor,
9712
+ anchorOrigin: {
9713
+ vertical: 'bottom',
9714
+ horizontal: 'center'
9715
+ },
9716
+ onClose: function onClose() {
9717
+ return setAnchor(null);
9718
+ },
9719
+ open: !!anchor,
9720
+ slotProps: {
9721
+ backdrop: {
9722
+ style: {
9723
+ opacity: 0,
9724
+ transition: 'none'
9725
+ }
9726
+ },
9727
+ list: {
9728
+ style: {
9729
+ padding: 0
9730
+ }
9731
+ }
9732
+ },
9733
+ transformOrigin: {
9734
+ vertical: 'top',
9735
+ horizontal: 'center'
9736
+ },
9737
+ children: jsxs(Box, {
9738
+ sx: {
9739
+ width: '360px',
9740
+ maxHeight: '412px',
9741
+ backgroundColor: 'geowebColors.background.surface',
9742
+ boxShadow: 6,
9743
+ overflow: 'auto'
9744
+ },
9745
+ children: [jsx(Box, {
9746
+ sx: {
9747
+ position: 'sticky',
9748
+ top: 0,
9749
+ padding: '12px',
9750
+ fontSize: 14,
9751
+ backgroundColor: 'geowebColors.background.surface',
9752
+ zIndex: 100
9753
+ },
9754
+ children: t('shared-services')
9755
+ }), jsx(List, {
9756
+ disablePadding: true,
9757
+ children: [].concat(services).sort(function (first, second) {
9758
+ return first.name.localeCompare(second.name);
9759
+ }).map(function (service) {
9760
+ var isInUse = usedServiceIds.includes(service.id);
9761
+ return jsx(ListItem, {
9762
+ secondaryAction: jsxs(Grid, {
9763
+ container: true,
9764
+ sx: {
9765
+ justifyContent: 'left',
9766
+ marginRight: 0,
9767
+ width: 96,
9768
+ button: {
9769
+ marginLeft: 1
9770
+ }
9771
+ },
9772
+ children: [jsx(CustomIconButton, {
9773
+ disabled: true,
9774
+ tooltipTitle: t('shared-update-service', {
9775
+ service: service.name
9776
+ }),
9777
+ children: jsx(Cached, {})
9778
+ }), service.scope === 'user' ? jsx(CustomIconButton, {
9779
+ "aria-label": t('shared-edit-service') + " " + service.name,
9780
+ disabled: !onEditService,
9781
+ onClick: function onClick() {
9782
+ var _service$description;
9783
+ resetRequests();
9784
+ setEditingService(service);
9785
+ setName(service.name);
9786
+ setDescription((_service$description = service.description) != null ? _service$description : '');
9787
+ setAnchor(null);
9788
+ },
9789
+ tooltipTitle: t('shared-edit-service'),
9790
+ children: jsx(Edit, {})
9791
+ }) : jsx(CustomIconButton, {
9792
+ "aria-label": t('shared-show-service') + " " + service.name,
9793
+ onClick: function onClick() {
9794
+ resetRequests();
9795
+ setShowService(service);
9796
+ setAnchor(null);
9797
+ },
9798
+ tooltipTitle: t('shared-show-service'),
9799
+ children: jsx(Visibility, {})
9800
+ }), onRemoveService && service.scope === 'user' ? jsx(CustomTooltip, {
9801
+ describeChild: true,
9802
+ placement: isInUse ? 'left' : 'top',
9803
+ title: t(isInUse ? 'shared-cannot-delete-service' : 'shared-delete-service'),
9804
+ children: jsx("span", {
9805
+ children: jsx(CustomIconButton, {
9806
+ "aria-label": t('shared-delete-service') + " " + service.name,
9807
+ disabled: isInUse,
9808
+ onClick: function onClick() {
9809
+ return onRemoveService(service.id);
9810
+ },
9811
+ children: jsx(Delete, {})
9812
+ })
9813
+ })
9814
+ }) : null]
9815
+ }),
9816
+ children: jsx(ListItemText, {
9817
+ children: jsx(Typography, {
9818
+ noWrap: true,
9819
+ sx: {
9820
+ textOverflow: 'ellipsis',
9821
+ paddingRight: '70px'
9822
+ },
9823
+ children: service.name || service.id
9824
+ })
9825
+ })
9826
+ }, service.id);
9827
+ })
9828
+ }), onAddService ? jsx(Box, {
9829
+ sx: {
9830
+ display: 'flex',
9831
+ justifyContent: 'center',
9832
+ alignItems: 'center',
9833
+ position: 'sticky',
9834
+ bottom: 0,
9835
+ backgroundColor: 'geowebColors.background.surface',
9836
+ zIndex: 100
9837
+ },
9838
+ children: jsx(Button, {
9839
+ onClick: function onClick() {
9840
+ resetRequests();
9841
+ setName('');
9842
+ setUrl('');
9843
+ setDescription('');
9844
+ setUrlTouched(false);
9845
+ setAdding(true);
9846
+ setAnchor(null);
9847
+ },
9848
+ startIcon: jsx(Add, {}),
9849
+ sx: {
9850
+ margin: '16px',
9851
+ width: '80%',
9852
+ fontSize: '12px',
9853
+ textTransform: 'none'
9854
+ },
9855
+ variant: "tertiary",
9856
+ children: t('shared-add-service')
9857
+ })
9858
+ }) : null]
9859
+ })
9860
+ }), jsx(CustomDialog, {
9861
+ actions: showService ? jsx(Button, {
9862
+ onClick: close,
9863
+ sx: {
9864
+ width: 117
9865
+ },
9866
+ variant: "tertiary",
9867
+ children: t('shared-close')
9868
+ }) : jsxs(Fragment, {
9869
+ children: [jsx(Button, {
9870
+ onClick: close,
9871
+ sx: {
9872
+ width: 117
9873
+ },
9874
+ variant: "tertiary",
9875
+ children: t('shared-cancel')
9876
+ }), jsx(Button, {
9877
+ disabled: !canSave,
9878
+ form: formId,
9879
+ sx: {
9880
+ width: 117,
9881
+ marginLeft: '16px!important'
9882
+ },
9883
+ type: "submit",
9884
+ variant: "primary",
9885
+ children: t('shared-save')
9886
+ })]
9887
+ }),
9888
+ fullWidth: true,
9889
+ maxWidth: "xs",
9890
+ onClose: close,
9891
+ open: adding || !!showService || !!editingService,
9892
+ title: dialogTitle,
9893
+ children: jsxs(Box, {
9894
+ "aria-label": dialogTitle,
9895
+ component: "form",
9896
+ id: formId,
9897
+ noValidate: true,
9898
+ onSubmit: function onSubmit(event) {
9899
+ event.preventDefault();
9900
+ void submit();
9901
+ },
9902
+ children: [metadataLoading || saving ? jsx(LinearProgress, {
9903
+ "aria-label": t('shared-loading')
9904
+ }) : null, metadataError ? jsx(AlertBanner, {
9905
+ title: metadataError
9906
+ }) : null, submitError ? jsx(AlertBanner, {
9907
+ title: submitError
9908
+ }) : null, jsx(TextField, {
9909
+ autoFocus: adding,
9910
+ disabled: !!showService || !!editingService || saving,
9911
+ error: urlError,
9912
+ fullWidth: true,
9913
+ helperText: urlError ? t(duplicateUrl ? 'shared-service-url-existing' : 'shared-invalid-url') : undefined,
9914
+ label: t('shared-service-url-label'),
9915
+ onBlur: function onBlur() {
9916
+ if (adding) {
9917
+ void loadMetadata(url);
9918
+ }
9919
+ },
9920
+ onChange: function onChange(event) {
9921
+ var nextUrl = event.target.value;
9922
+ if (nextUrl.trim() !== url.trim()) {
9923
+ metadataRequest.current += 1;
9924
+ metadataUrl.current = undefined;
9925
+ setMetadataLoading(false);
9926
+ setMetadataError(undefined);
9927
+ }
9928
+ setUrl(nextUrl);
9929
+ setUrlTouched(true);
9930
+ },
9931
+ onKeyDown: function onKeyDown(event) {
9932
+ if (event.key === 'Enter' && adding) {
9933
+ event.preventDefault();
9934
+ void loadMetadata(url);
9935
+ }
9936
+ },
9937
+ slotProps: {
9938
+ input: {
9939
+ endAdornment: showService || editingService ? jsx(InputAdornment, {
9940
+ position: "end",
9941
+ children: jsx(CustomIconButton, {
9942
+ onClick: function onClick() {
9943
+ var _ref6, _showService$url;
9944
+ void navigator.clipboard.writeText((_ref6 = (_showService$url = showService == null ? void 0 : showService.url) != null ? _showService$url : editingService == null ? void 0 : editingService.url) != null ? _ref6 : url).then(function () {
9945
+ return onCopyServiceUrl == null ? void 0 : onCopyServiceUrl();
9946
+ }, function () {
9947
+ return setSubmitError(t('shared-copy-failed'));
9948
+ });
9949
+ },
9950
+ tooltipTitle: t('shared-copy-service-url'),
9951
+ children: jsx(Copy, {})
9952
+ })
9953
+ }) : undefined
9954
+ }
9955
+ },
9956
+ sx: {
9957
+ marginBottom: 2
9958
+ },
9959
+ value: (_ref7 = (_showService$url2 = showService == null ? void 0 : showService.url) != null ? _showService$url2 : editingService == null ? void 0 : editingService.url) != null ? _ref7 : url,
9960
+ variant: "filled"
9961
+ }), jsx(TextField, {
9962
+ disabled: !!showService || saving,
9963
+ error: !showService && duplicateName,
9964
+ fullWidth: true,
9965
+ helperText: !showService && duplicateName ? t('shared-service-name-existing') : undefined,
9966
+ label: t('shared-service-name'),
9967
+ onChange: function onChange(event) {
9968
+ return setName(event.target.value);
9969
+ },
9970
+ sx: {
9971
+ marginBottom: 2
9972
+ },
9973
+ value: (_showService$name = showService == null ? void 0 : showService.name) != null ? _showService$name : name
9974
+ }), jsx(TextField, {
9975
+ disabled: !!showService || saving,
9976
+ fullWidth: true,
9977
+ helperText: showService ? undefined : t('shared-description-helper'),
9978
+ label: t('shared-description'),
9979
+ multiline: true,
9980
+ onChange: function onChange(event) {
9981
+ return setDescription(event.target.value);
9982
+ },
9983
+ rows: 4,
9984
+ sx: {
9985
+ marginBottom: 2
9986
+ },
9987
+ value: showService ? (_showService$descript = showService.description) != null ? _showService$descript : '' : description
9988
+ }), jsx(TextField, {
9989
+ disabled: true,
9990
+ fullWidth: true,
9991
+ label: t('shared-type'),
9992
+ select: true,
9993
+ value: displayedServiceType,
9994
+ children: jsx(MenuItem, {
9995
+ value: displayedServiceType,
9996
+ children: displayedServiceType
9997
+ })
9998
+ })]
9999
+ })
10000
+ })]
10001
+ });
10002
+ };
10003
+
10004
+ var chipStyle = {
10005
+ borderRadius: '20px!important',
10006
+ marginRight: '4px',
10007
+ whiteSpace: 'nowrap',
10008
+ height: '24px!important',
10009
+ padding: '5px 12px!important',
10010
+ textTransform: 'none!important',
10011
+ fontWeight: 'normal',
10012
+ marginBottom: '4px'
10013
+ };
10014
+ var ParameterSelect = function ParameterSelect(_ref) {
10015
+ var title = _ref.title,
10016
+ testId = _ref['data-testid'],
10017
+ isOpen = _ref.isOpen,
10018
+ onClose = _ref.onClose,
10019
+ services = _ref.services,
10020
+ collections = _ref.collections,
10021
+ getParameterId = _ref.getParameterId,
10022
+ getParameterLabel = _ref.getParameterLabel,
10023
+ _ref$getParameterSear = _ref.getParameterSearchText,
10024
+ getParameterSearchText = _ref$getParameterSear === void 0 ? getParameterLabel : _ref$getParameterSear,
10025
+ controlledFilters = _ref.filters,
10026
+ onFiltersChange = _ref.onFiltersChange,
10027
+ collectionTarget = _ref.collectionTarget,
10028
+ loadServiceMetadata = _ref.loadServiceMetadata,
10029
+ selectedParameterIds = _ref.selectedParameterIds,
10030
+ _ref$serviceIdsInUse = _ref.serviceIdsInUse,
10031
+ serviceIdsInUse = _ref$serviceIdsInUse === void 0 ? [] : _ref$serviceIdsInUse,
10032
+ onToggleParameter = _ref.onToggleParameter,
10033
+ onAddService = _ref.onAddService,
10034
+ onEditService = _ref.onEditService,
10035
+ onRemoveService = _ref.onRemoveService,
10036
+ renderParameterInfo = _ref.renderParameterInfo,
10037
+ isLoading = _ref.isLoading,
10038
+ error = _ref.error,
10039
+ containerProps = _ref.containerProps,
10040
+ addServiceTitle = _ref.addServiceTitle,
10041
+ serviceType = _ref.serviceType,
10042
+ onCopyServiceUrl = _ref.onCopyServiceUrl;
10043
+ var _useSharedTranslation = useSharedTranslation(),
10044
+ t = _useSharedTranslation.t;
10045
+ var resultsLabel = function resultsLabel(count) {
10046
+ return t('shared-results', {
10047
+ count: count
10048
+ });
10049
+ };
10050
+ var _React$useState = React.useState({
10051
+ search: '',
10052
+ serviceIds: []
10053
+ }),
10054
+ localFilters = _React$useState[0],
10055
+ setLocalFilters = _React$useState[1];
10056
+ var _ref2 = controlledFilters != null ? controlledFilters : localFilters,
10057
+ search = _ref2.search,
10058
+ serviceIds = _ref2.serviceIds;
10059
+ var _React$useState2 = React.useState({}),
10060
+ expanded = _React$useState2[0],
10061
+ setExpanded = _React$useState2[1];
10062
+ var _React$useState3 = React.useState(),
10063
+ newServiceUrl = _React$useState3[0],
10064
+ setNewServiceUrl = _React$useState3[1];
10065
+ var setFilters = function setFilters(filters) {
10066
+ if (controlledFilters === undefined) {
10067
+ setLocalFilters(filters);
10068
+ }
10069
+ onFiltersChange == null || onFiltersChange(filters);
10070
+ };
10071
+ var setServiceIds = function setServiceIds(ids) {
10072
+ setFilters({
10073
+ search: search,
10074
+ serviceIds: ids.length === services.length ? [] : ids
10075
+ });
10076
+ };
10077
+ var activeServiceIds = React.useMemo(function () {
10078
+ return serviceIds.filter(function (id) {
10079
+ return services.some(function (service) {
10080
+ return service.id === id;
10081
+ });
10082
+ });
10083
+ }, [serviceIds, services]);
10084
+ var allServicesSelected = activeServiceIds.length === 0 || activeServiceIds.length === services.length;
10085
+ var visibleCollections = React.useMemo(function () {
10086
+ return filterCollections(collections, services, activeServiceIds, search, getParameterSearchText);
10087
+ }, [collections, services, activeServiceIds, search, getParameterSearchText]);
10088
+ var listRef = useListRef(null);
10089
+ var lastNavigation = React.useRef(undefined);
10090
+ var lastExpansionRequest = React.useRef(undefined);
10091
+ var targetKey = collectionTarget ? JSON.stringify([collectionTarget.serviceId, collectionTarget.collectionId, collectionTarget.requestKey]) : undefined;
10092
+ React.useEffect(function () {
10093
+ if (!isOpen || !collectionTarget) {
10094
+ lastNavigation.current = undefined;
10095
+ lastExpansionRequest.current = undefined;
10096
+ return undefined;
10097
+ }
10098
+ if (targetKey === lastNavigation.current) {
10099
+ return undefined;
10100
+ }
10101
+ var key = getCollectionKey({
10102
+ serviceId: collectionTarget.serviceId,
10103
+ id: collectionTarget.collectionId
10104
+ });
10105
+ if (lastExpansionRequest.current !== targetKey) {
10106
+ lastExpansionRequest.current = targetKey;
10107
+ setExpanded(function (current) {
10108
+ var _Object$assign;
10109
+ if (collectionTarget.collapseOtherCollections) {
10110
+ var _ref3;
10111
+ return _ref3 = {}, _ref3[key] = true, _ref3;
10112
+ }
10113
+ return current[key] ? current : Object.assign({}, current, (_Object$assign = {}, _Object$assign[key] = true, _Object$assign));
10114
+ });
10115
+ }
10116
+ var index = visibleCollections.findIndex(function (collection) {
10117
+ return getCollectionKey(collection) === key;
10118
+ });
10119
+ if (index < 0 || !listRef.current) {
10120
+ return undefined;
10121
+ }
10122
+ // Mount a distant target; the row aligns itself after its expanded height commits.
10123
+ var frame = requestAnimationFrame(function () {
10124
+ var _listRef$current;
10125
+ (_listRef$current = listRef.current) == null || _listRef$current.scrollToRow({
10126
+ index: index,
10127
+ align: 'start'
10128
+ });
10129
+ });
10130
+ return function () {
10131
+ return cancelAnimationFrame(frame);
10132
+ };
10133
+ }, [isOpen, collectionTarget, targetKey, visibleCollections, listRef]);
10134
+ var usedServiceIds = collections.filter(function (collection) {
10135
+ return collection.parameters.some(function (parameter) {
10136
+ return selectedParameterIds.includes(getParameterId(parameter));
10137
+ });
10138
+ }).map(function (collection) {
10139
+ return collection.serviceId;
10140
+ });
10141
+ return jsxs(DraggableComponent, Object.assign({
10142
+ "data-testid": testId,
10143
+ minHeight: 200,
10144
+ minWidth: 320,
10145
+ order: 2,
10146
+ startPosition: {
10147
+ top: 150,
10148
+ left: 100
10149
+ },
10150
+ startSize: {
10151
+ width: 750,
10152
+ height: 500
10153
+ }
10154
+ }, containerProps, {
10155
+ isOpen: isOpen,
10156
+ onClose: onClose,
10157
+ title: title != null ? title : t('shared-select-parameters'),
10158
+ children: [isLoading ? jsx(LinearProgress, {
10159
+ color: "secondary",
10160
+ sx: {
10161
+ width: '100%',
10162
+ position: 'absolute'
10163
+ }
10164
+ }) : null, error ? jsx(Box, {
10165
+ sx: {
10166
+ padding: '0 6px'
10167
+ },
10168
+ children: jsx(AlertBanner, {
10169
+ shouldClose: true,
10170
+ title: error
10171
+ })
10172
+ }) : null, jsxs(Box, {
10173
+ sx: {
10174
+ padding: '6px 8px',
10175
+ height: "calc(100% - " + (error ? 48 : 0) + "px)",
10176
+ display: 'flex',
10177
+ flexDirection: 'column',
10178
+ minHeight: 0
10179
+ },
10180
+ children: [jsx(SearchField$1, {
10181
+ label: t('shared-parameter-search'),
10182
+ onOpenServicePopup: onAddService ? function (url) {
10183
+ return setNewServiceUrl(url);
10184
+ } : undefined,
10185
+ searchFilter: search,
10186
+ setSearchFilter: function setSearchFilter(value) {
10187
+ return setFilters({
10188
+ search: value,
10189
+ serviceIds: serviceIds
10190
+ });
10191
+ }
10192
+ }, targetKey), jsx(Box, {
10193
+ sx: {
10194
+ position: 'absolute',
10195
+ margin: '64px 0 0 calc(100% - 40px)',
10196
+ zIndex: 2,
10197
+ "float": 'right'
10198
+ },
10199
+ children: jsx(SelectServices, {
10200
+ addServiceTitle: addServiceTitle,
10201
+ loadServiceMetadata: loadServiceMetadata,
10202
+ newServiceUrl: newServiceUrl,
10203
+ onAddService: onAddService,
10204
+ onCloseNewService: function onCloseNewService() {
10205
+ return setNewServiceUrl(undefined);
10206
+ },
10207
+ onCopyServiceUrl: onCopyServiceUrl,
10208
+ onEditService: onEditService,
10209
+ onRemoveService: onRemoveService,
10210
+ serviceType: serviceType,
10211
+ services: services,
10212
+ usedServiceIds: [].concat(usedServiceIds, serviceIdsInUse)
10213
+ })
10214
+ }), jsx(Box, {
10215
+ sx: {
10216
+ paddingBottom: '6px',
10217
+ paddingRight: '32px'
10218
+ },
10219
+ children: jsx(Box, {
10220
+ sx: {
10221
+ marginTop: '8px',
10222
+ width: '100%',
10223
+ overflow: 'hidden'
10224
+ },
10225
+ children: jsxs(Box, {
10226
+ sx: {
10227
+ width: '100%',
10228
+ display: 'block',
10229
+ alignItems: 'center',
10230
+ "float": 'left',
10231
+ marginBottom: '8px',
10232
+ fontSize: '0.875rem'
10233
+ },
10234
+ children: [services.length > 0 && jsx(CustomToggleButton, {
10235
+ onClick: function onClick() {
10236
+ return setServiceIds([]);
10237
+ },
10238
+ selected: allServicesSelected,
10239
+ sx: chipStyle,
10240
+ variant: "boxed",
10241
+ children: t('shared-filter-all')
10242
+ }), [].concat(services).sort(function (first, second) {
10243
+ return first.name.localeCompare(second.name);
10244
+ }).map(function (service) {
10245
+ return jsx(CustomTooltip, {
10246
+ title: t('shared-service-url') + ": " + service.url,
10247
+ children: jsx("span", {
10248
+ children: jsx(CustomToggleButton, {
10249
+ disabled: service.isLoading,
10250
+ onClick: function onClick() {
10251
+ if (allServicesSelected) {
10252
+ setServiceIds([service.id]);
10253
+ return;
10254
+ }
10255
+ setServiceIds(activeServiceIds.includes(service.id) ? activeServiceIds.filter(function (id) {
10256
+ return id !== service.id;
10257
+ }) : [].concat(activeServiceIds, [service.id]));
10258
+ },
10259
+ selected: !allServicesSelected && activeServiceIds.includes(service.id),
10260
+ sx: chipStyle,
10261
+ variant: "boxed",
10262
+ children: service.name
10263
+ })
10264
+ })
10265
+ }, service.id);
10266
+ })]
10267
+ })
10268
+ })
10269
+ }), jsxs(Box, {
10270
+ sx: {
10271
+ flex: 1,
10272
+ minHeight: 0,
10273
+ overflow: 'hidden',
10274
+ display: 'flex',
10275
+ flexDirection: 'column'
10276
+ },
10277
+ children: [jsx(Box, {
10278
+ sx: {
10279
+ marginBottom: '4px',
10280
+ fontSize: '12px'
10281
+ },
10282
+ children: resultsLabel(visibleCollections.length)
10283
+ }), !isLoading && visibleCollections.length === 0 ? jsx(Typography, {
10284
+ sx: {
10285
+ fontSize: 12
10286
+ },
10287
+ children: t('shared-no-matching-parameters')
10288
+ }) : null, jsx(Box, {
10289
+ sx: {
10290
+ flex: 1,
10291
+ minHeight: 0
10292
+ },
10293
+ children: jsx(ParameterSelectList, {
10294
+ collections: visibleCollections,
10295
+ expanded: expanded,
10296
+ getParameterId: getParameterId,
10297
+ getParameterLabel: getParameterLabel,
10298
+ listRef: listRef,
10299
+ navigation: isOpen && collectionTarget && targetKey ? {
10300
+ key: getCollectionKey({
10301
+ serviceId: collectionTarget.serviceId,
10302
+ id: collectionTarget.collectionId
10303
+ }),
10304
+ requestKey: targetKey,
10305
+ completed: lastNavigation
10306
+ } : undefined,
10307
+ onToggleParameter: onToggleParameter,
10308
+ renderParameterInfo: renderParameterInfo,
10309
+ search: search,
10310
+ selectedParameterIds: selectedParameterIds,
10311
+ services: services,
10312
+ setExpanded: setExpanded
10313
+ })
10314
+ })]
10315
+ })]
10316
+ })]
10317
+ }));
10318
+ };
10319
+
10320
+ var textStyle = {
10321
+ lineHeight: '20px',
10322
+ letterSpacing: '0.25px'
10323
+ };
10324
+ var textWithMargin = Object.assign({}, textStyle, {
10325
+ marginBottom: 1
10326
+ });
10327
+ var InfoText = function InfoText(_ref) {
10328
+ var label = _ref.label,
10329
+ value = _ref.value;
10330
+ return jsxs(Fragment, {
10331
+ children: [jsx(Typography, {
10332
+ sx: textStyle,
10333
+ variant: "subtitle2",
10334
+ children: label
10335
+ }), jsx(Typography, {
10336
+ sx: textWithMargin,
10337
+ variant: "body2",
10338
+ children: value
10339
+ })]
10340
+ });
10341
+ };
10342
+ var LoadingInfo = function LoadingInfo(_ref2) {
10343
+ var label = _ref2.label;
10344
+ return jsxs(Fragment, {
10345
+ children: [jsx(Typography, {
10346
+ sx: textStyle,
10347
+ variant: "subtitle2",
10348
+ children: label
10349
+ }), jsx(Box, {
10350
+ sx: {
10351
+ position: 'relative',
10352
+ marginBottom: 3
10353
+ },
10354
+ children: jsx(LinearProgress, {
10355
+ "aria-label": label,
10356
+ color: "secondary",
10357
+ sx: {
10358
+ position: 'absolute',
10359
+ width: '100%',
10360
+ top: 8
10361
+ }
10362
+ })
10363
+ })]
10364
+ });
10365
+ };
10366
+ var ExtentInfo = function ExtentInfo(_ref3) {
10367
+ var _extent$temporal, _extent$spatial;
10368
+ var label = _ref3.label,
10369
+ extent = _ref3.extent,
10370
+ labels = _ref3.labels,
10371
+ formatBoundingBox = _ref3.formatBoundingBox;
10372
+ var entries = [];
10373
+ if (extent != null && (_extent$temporal = extent.temporal) != null && (_extent$temporal = _extent$temporal.values) != null && _extent$temporal.length) {
10374
+ entries.push({
10375
+ label: labels.time,
10376
+ value: extent.temporal.values.join(', '),
10377
+ icon: jsx(DimensionsTime, {})
10378
+ });
10379
+ }
10380
+ var bbox = extent == null || (_extent$spatial = extent.spatial) == null || (_extent$spatial = _extent$spatial.bbox) == null ? void 0 : _extent$spatial[0];
10381
+ if (bbox && bbox.length >= 4) {
10382
+ entries.push({
10383
+ label: labels.boundingBox,
10384
+ value: formatBoundingBox(bbox),
10385
+ icon: jsx(DrawRegion, {})
10386
+ });
10387
+ }
10388
+ return jsxs(Fragment, {
10389
+ children: [jsx(Typography, {
10390
+ sx: textStyle,
10391
+ variant: "subtitle2",
10392
+ children: label
10393
+ }), entries.length === 0 ? jsx(Typography, {
10394
+ sx: textWithMargin,
10395
+ variant: "body2",
10396
+ children: "-"
10397
+ }) : jsx(Grid, {
10398
+ container: true,
10399
+ sx: {
10400
+ flexDirection: 'column'
10401
+ },
10402
+ children: entries.map(function (entry) {
10403
+ return jsxs("div", {
10404
+ children: [jsxs(Grid, {
10405
+ container: true,
10406
+ sx: {
10407
+ flexDirection: 'row'
10408
+ },
10409
+ children: [entry.icon, jsx(Grid, {
10410
+ sx: {
10411
+ marginLeft: '10px'
10412
+ },
10413
+ children: jsxs(Typography, {
10414
+ sx: textStyle,
10415
+ variant: "body2",
10416
+ children: [entry.label, ":"]
10417
+ })
10418
+ })]
10419
+ }), jsx(Grid, {
10420
+ container: true,
10421
+ sx: {
10422
+ marginBottom: 1,
10423
+ paddingLeft: '34px',
10424
+ flexDirection: 'row'
10425
+ },
10426
+ children: jsx(Typography, {
10427
+ sx: Object.assign({}, textStyle, {
10428
+ overflowWrap: 'break-word'
10429
+ }),
10430
+ variant: "body2",
10431
+ children: entry.value
10432
+ })
10433
+ })]
10434
+ }, entry.label);
10435
+ })
10436
+ })]
10437
+ });
10438
+ };
10439
+ /** Presentational metadata dialog. Consumers own discovery, loading and persistence. */
10440
+ var ParameterInfoDialog = function ParameterInfoDialog(_ref4) {
10441
+ var _collectionInformatio, _relatedService$url, _relatedService$descr, _relatedService$type;
10442
+ var currentParameterInfo = _ref4.currentParameterInfo,
10443
+ relatedService = _ref4.relatedService,
10444
+ collectionInformation = _ref4.collectionInformation,
10445
+ _ref4$isLoadingCollec = _ref4.isLoadingCollectionInformation,
10446
+ isLoadingCollectionInformation = _ref4$isLoadingCollec === void 0 ? false : _ref4$isLoadingCollec,
10447
+ instanceInformation = _ref4.instanceInformation,
10448
+ _ref4$isLoadingInstan = _ref4.isLoadingInstanceInformation,
10449
+ isLoadingInstanceInformation = _ref4$isLoadingInstan === void 0 ? false : _ref4$isLoadingInstan,
10450
+ _ref4$supportsInstanc = _ref4.supportsInstances,
10451
+ supportsInstances = _ref4$supportsInstanc === void 0 ? false : _ref4$supportsInstanc,
10452
+ isOpen = _ref4.isOpen,
10453
+ onClose = _ref4.onClose,
10454
+ title = _ref4.title,
10455
+ containerProps = _ref4.containerProps;
10456
+ var _useSharedTranslation = useSharedTranslation(),
10457
+ t = _useSharedTranslation.t;
10458
+ var labels = {
10459
+ label: t('shared-info-label'),
10460
+ name: t('shared-info-name'),
10461
+ service: t('shared-service'),
10462
+ serviceUrl: t('shared-service-url'),
10463
+ serviceDescription: t('shared-service-description'),
10464
+ serviceType: t('shared-service-type'),
10465
+ collectionId: t('shared-collection-id'),
10466
+ collectionTitle: t('shared-collection-title'),
10467
+ collectionDescription: t('shared-collection-description'),
10468
+ queries: t('shared-queries'),
10469
+ instanceDimensions: t('shared-instance-dimensions'),
10470
+ noDataAvailable: t('shared-no-data-available'),
10471
+ time: t('shared-time'),
10472
+ boundingBox: t('shared-bbox')
10473
+ };
10474
+ var renderBoundingBox = function renderBoundingBox(bounds) {
10475
+ return t('shared-bbox-rendering', {
10476
+ west: bounds[0],
10477
+ east: bounds[2],
10478
+ north: bounds[3],
10479
+ south: bounds[1]
10480
+ });
10481
+ };
10482
+ var queries = Object.entries((_collectionInformatio = collectionInformation == null ? void 0 : collectionInformation.dataQueries) != null ? _collectionInformatio : {}).filter(function (_ref5) {
10483
+ var query = _ref5[1];
10484
+ return Boolean(query);
10485
+ }).map(function (_ref6) {
10486
+ var name = _ref6[0];
10487
+ return name;
10488
+ }).sort(function (first, second) {
10489
+ return first.localeCompare(second);
10490
+ });
10491
+ var instances = sortInstancesNewestFirst(instanceInformation != null ? instanceInformation : []);
10492
+ return jsx(DraggableComponent, Object.assign({
10493
+ order: 3,
10494
+ startPosition: {
10495
+ top: 150,
10496
+ left: 790
10497
+ },
10498
+ startSize: {
10499
+ width: 288,
10500
+ height: 650
10501
+ }
10502
+ }, containerProps, {
10503
+ isOpen: isOpen,
10504
+ onClose: onClose,
10505
+ title: title != null ? title : t('shared-parameter-info'),
10506
+ children: jsxs(Box, {
10507
+ sx: {
10508
+ padding: 2
10509
+ },
10510
+ children: [currentParameterInfo.propertyLabel ? jsx(InfoText, {
10511
+ label: labels.label,
10512
+ value: currentParameterInfo.propertyLabel
10513
+ }) : null, jsx(InfoText, {
10514
+ label: labels.name,
10515
+ value: currentParameterInfo.propertyName
10516
+ }), jsx(InfoText, {
10517
+ label: labels.service,
10518
+ value: (relatedService == null ? void 0 : relatedService.name) || currentParameterInfo.serviceId
10519
+ }), relatedService ? jsxs(Fragment, {
10520
+ children: [jsx(InfoText, {
10521
+ label: labels.serviceUrl,
10522
+ value: (_relatedService$url = relatedService.url) != null ? _relatedService$url : ''
10523
+ }), jsx(InfoText, {
10524
+ label: labels.serviceDescription,
10525
+ value: (_relatedService$descr = relatedService.description) != null ? _relatedService$descr : ''
10526
+ }), jsx(InfoText, {
10527
+ label: labels.serviceType,
10528
+ value: (_relatedService$type = relatedService.type) != null ? _relatedService$type : ''
10529
+ })]
10530
+ }) : null, jsx(InfoText, {
10531
+ label: labels.collectionId,
10532
+ value: currentParameterInfo.collectionId
10533
+ }), collectionInformation != null && collectionInformation.collectionTitle ? jsx(InfoText, {
10534
+ label: labels.collectionTitle,
10535
+ value: collectionInformation.collectionTitle
10536
+ }) : null, collectionInformation != null && collectionInformation.collectionDescription ? jsx(InfoText, {
10537
+ label: labels.collectionDescription,
10538
+ value: collectionInformation.collectionDescription
10539
+ }) : null, isLoadingCollectionInformation ? jsx(LoadingInfo, {
10540
+ label: labels.queries
10541
+ }) : jsx(InfoText, {
10542
+ label: labels.queries,
10543
+ value: queries.length ? queries.join(', ') : labels.noDataAvailable
10544
+ }), supportsInstances ? jsx(Fragment, {
10545
+ children: isLoadingInstanceInformation ? jsx(LoadingInfo, {
10546
+ label: labels.instanceDimensions
10547
+ }) : jsxs(Fragment, {
10548
+ children: [jsx(Typography, {
10549
+ sx: textStyle,
10550
+ variant: "subtitle2",
10551
+ children: labels.instanceDimensions
10552
+ }), instances.length === 0 ? jsx(Typography, {
10553
+ sx: textWithMargin,
10554
+ variant: "body2",
10555
+ children: labels.noDataAvailable
10556
+ }) : instances.map(function (instance) {
10557
+ return jsx(ExtentInfo, {
10558
+ extent: instance.extent,
10559
+ formatBoundingBox: renderBoundingBox,
10560
+ label: instance.id,
10561
+ labels: labels
10562
+ }, instance.id);
10563
+ })]
10564
+ })
10565
+ }) : null, !supportsInstances && collectionInformation && !isLoadingCollectionInformation ? jsx(ExtentInfo, {
10566
+ extent: collectionInformation.extent,
10567
+ formatBoundingBox: renderBoundingBox,
10568
+ label: currentParameterInfo.collectionId,
10569
+ labels: labels
10570
+ }) : null]
10571
+ })
10572
+ }));
10573
+ };
10574
+
7781
10575
  /* *
7782
10576
  * Licensed under the Apache License, Version 2.0 (the "License");
7783
10577
  * you may not use this file except in compliance with the License.
@@ -7802,4 +10596,4 @@ var SystemScope = {
7802
10596
  plugin: 'plugin'
7803
10597
  };
7804
10598
 
7805
- export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomDialogHeader, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DateTimePicker, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, LegendToggleButton, NumberWithUnitField, PANEL_COLLAPSED_SIZE, PROJECTION, ResizeComponent as Resizable, ResizablePanel, ResizablePanelStandalone, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, SessionStorageKey, SortablePanels, StatusTag, StorybookDocsWrapper, StyledSelect, SwitchButton, SystemScope, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, browserNavigation, calculateDialogSizeAndPosition, calculateStartSize, convertNumericInputValue, index$1 as dateUtils, defaultDelay, getAllowedKeys, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, isDialogFocused, isTargetInteractiveInput, linkifyText, loadAllTranslations, pickerDateToUTC, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation, utcToPickerDate };
10599
+ export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomDialogHeader, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DateTimePicker, DraggableComponent$1 as Draggable, EARTH_MEAN_RADIUS_KM, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, LegendToggleButton, NumberWithUnitField, PANEL_COLLAPSED_SIZE, PROJECTION, ParameterInfoDialog, ParameterSelect, PlotManager, ResizeComponent as Resizable, ResizablePanel, ResizablePanelStandalone, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, SessionStorageKey, SortablePanels, StatusTag, StorybookDocsWrapper, StyledSelect, SwitchButton, SystemScope, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, browserNavigation, calculateDialogSizeAndPosition, calculateStartSize, convertNumericInputValue, index$1 as dateUtils, defaultDelay, getAllowedKeys, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, isDialogFocused, isTargetInteractiveInput, linkifyText, loadAllTranslations, pickerDateToUTC, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation, utcToPickerDate };