@opengeoweb/warnings 19.6.1 → 20.0.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 (34) hide show
  1. package/dist/index.esm.js +2920 -675
  2. package/dist/src/lib/components/AreaDrawingManager/AreaDrawingManager.d.ts +2 -1
  3. package/dist/src/lib/components/AreaDrawingManager/Drawings.d.ts +2 -1
  4. package/dist/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +7 -0
  5. package/dist/src/lib/components/DrawingToolForm/DrawingToolFormConnect.d.ts +1 -0
  6. package/dist/src/lib/components/DrawingToolForm/DrawingToolFormContents.d.ts +7 -0
  7. package/dist/src/lib/components/DrawingToolForm/DrawingToolFormMasks.d.ts +11 -0
  8. package/dist/src/lib/components/DrawingToolForm/drawingObjectUtils.d.ts +3 -0
  9. package/dist/src/lib/components/DrawingToolForm/maskUtils.d.ts +15 -0
  10. package/dist/src/lib/components/DrawingToolForm/useMaskPreviewLayer.d.ts +7 -0
  11. package/dist/src/lib/components/FilterList/filter-utils.d.ts +23 -8
  12. package/dist/src/lib/components/PublicWarningList/warningListFeatureSyncUtils.d.ts +3 -1
  13. package/dist/src/lib/components/PublicWarningsForm/PhenomenonField/PhenomenonField.d.ts +2 -0
  14. package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts +2 -1
  15. package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventFormDialog.d.ts +3 -0
  16. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventFormContent.d.ts +3 -0
  17. package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventItem.d.ts +3 -0
  18. package/dist/src/lib/components/WarningEvents/WarningEventForm/utils.d.ts +3 -0
  19. package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryForm.d.ts +2 -2
  20. package/dist/src/lib/components/WarningsMapView/WarningsMapView.d.ts +3 -0
  21. package/dist/src/lib/components/WarningsTimeline/WarningBlock.d.ts +4 -1
  22. package/dist/src/lib/components/WarningsTimeline/WarningBlockMenu.d.ts +17 -0
  23. package/dist/src/lib/components/WarningsTimeline/WarningsTimeline.d.ts +4 -0
  24. package/dist/src/lib/components/WarningsTimeline/WarningsTimelineLayers.d.ts +5 -1
  25. package/dist/src/lib/store/warningsDrawings/types.d.ts +5 -0
  26. package/dist/src/lib/store/warningsDrawings/utils.d.ts +19 -0
  27. package/dist/src/lib/store/warningsEventForm/reducer.d.ts +5 -0
  28. package/dist/src/lib/store/warningsEventForm/selectors.d.ts +21 -0
  29. package/dist/src/lib/store/warningsFilters/reducer.d.ts +9 -1
  30. package/dist/src/lib/store/warningsFilters/selectors.d.ts +42 -1
  31. package/dist/src/lib/store/warningsFilters/types.d.ts +26 -0
  32. package/dist/src/lib/store/warningsForm/types.d.ts +3 -0
  33. package/dist/src/lib/utils/fakeApi/index.d.ts +2 -1
  34. package/package.json +63 -64
package/dist/index.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useDispatch, useSelector, useStore, shallowEqual } from 'react-redux';
3
3
  import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawingToolSelectors, layerSelectors, uiSelectors, layerActions, drawingToolActions, layerUtils, mapListener, layersListener, drawingToolListener, syncGroupsListener, openlayersListener, syncGroupsReducer, drawingToolReducer, uiReducer, layerReducer, mapReducer, useSetupDialog, PUBLIC_WARNING_DRAW_TOOL_ID, genericSelectors, useUpdateFeatureSyncLayers, genericActions, selectorMemoizationOptions, useRegisterFeatureSyncSource, syncGroupsSelector } from '@opengeoweb/store';
4
- import { Polygons, Edit, Delete, ExitDomain, ChevronDown, DrawPolygon, Remove, Options, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Snow, Lightning, Fog, Wind, Thunderstorm, SevereMountainWaves, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, Visibility, Add, breakpoints, DragHandle, Info, ArrowUpCompact, ArrowDownCompact, CalendarToday, Expire, Cube, AlertBadge, ArrowDropDownDown, Extend24h, Copy, Update, Cancel, Success, VisibilityOff, ChevronUp, Close, Clock } from '@opengeoweb/theme';
5
- import { WEBMAP_REACT_NAMESPACE, defaultPolygon, emptyGeoJSON, MapControlButton, isGeoJSONGeometryEmpty, defaultSmoothLine, defaultLineString, defaultFreehandLine, defaultOval, defaultCircle, defaultRotatableBox, defaultSquare, defaultLocation, defaultPoint, defaultSplit, defaultDelete, getDrawModeIdFromSelectionType, getIcon, rewindGeometry, getGeoJSONPropertyValue, DRAWMODE, currentlySupportedDrawModes, defaultLayers, viewUtils, OpenLayersMapView, MapControls, OpenLayersZoomControl, OpenLayersLayer, OpenLayersFeatureLayer, genericOpenLayersFeatureStyle, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_STROKE_COLOR } from '@opengeoweb/webmap-react';
6
- import { SHARED_NAMESPACE, useConfirmationDialog, dateUtils, ToggleMenu, calculateStartSize, ToolContainerDraggable, AlertBanner, sessionStorageProvider, ConfirmationDialog, CustomIconButton, usePrevious, usePreventBrowserClose, CustomTooltip, Avatar, getInitials, SwitchButton, Filter, CustomToggleButton, FilterChip, TooltipSelect, LastUpdateTime, StatusTag, FilterOption, getAxiosErrorMessage, CustomDialog, ConfirmationButtons, ErrorBoundary } from '@opengeoweb/shared';
4
+ import { Polygons, Edit, Delete, ExitDomain, ChevronDown, DrawPolygon, Remove, Options, Waterspouts, Snow, FreezingRain, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Lightning, Fog, Wind, Thunderstorm, SevereMountainWaves, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, DrawMask, Visibility, Add, breakpoints, DragHandle, Info, ArrowUpCompact, ArrowDownCompact, CalendarToday, Expire, Cube, AlertBadge, ArrowDropDownDown, Extend24h, Copy, Update, Cancel, Success, VisibilityOff, ChevronUp, Close, Clock } from '@opengeoweb/theme';
5
+ import { WEBMAP_REACT_NAMESPACE, defaultPolygon, emptyGeoJSON, MapControlButton, isGeoJSONGeometryEmpty, rewindGeometry, removeTransientFeatureProperties, defaultSmoothLine, defaultLineString, defaultFreehandLine, defaultOval, defaultCircle, defaultRotatableBox, defaultSquare, defaultLocation, defaultPoint, defaultSplit, defaultDelete, getDrawModeIdFromSelectionType, getIcon, getGeoJSONPropertyValue, FEATURE_DRAW_SECONDARY_STROKE_COLOR, DRAWMODE, currentlySupportedDrawModes, defaultLayers, viewUtils, OpenLayersMapView, MapControls, OpenLayersZoomControl, OpenLayersLayer, OpenLayersFeatureLayer, genericOpenLayersFeatureStyle, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_STROKE_COLOR } from '@opengeoweb/webmap-react';
6
+ import { SHARED_NAMESPACE, useConfirmationDialog, dateUtils, sessionStorageProvider, ToggleMenu, calculateStartSize, ToolContainerDraggable, AlertBanner, ConfirmationDialog, CustomIconButton, usePrevious, usePreventBrowserClose, CustomTooltip, Avatar, getInitials, SwitchButton, Filter, CustomToggleButton, FilterChip, TooltipSelect, LastUpdateTime, DateTimePicker, StatusTag, FilterOption, getAxiosErrorMessage, CustomDialog, ConfirmationButtons, ErrorBoundary } from '@opengeoweb/shared';
7
7
  import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, combineReducers, configureStore } from '@reduxjs/toolkit';
8
8
  import { t } from 'i18next';
9
9
  import { useTranslation } from 'react-i18next';
@@ -13,22 +13,20 @@ import { SA_NAMESPACE, isInstanceOfCancelSigmet, getDefaultValidFromValue, isIns
13
13
  import { LayerType, generateMapId, webmapUtils } from '@opengeoweb/webmap';
14
14
  import React, { useRef, useState, useEffect, useCallback, useMemo } from 'react';
15
15
  import { useAuthenticationContext as useAuthenticationContext$1 } from '@opengeoweb/authentication';
16
- import { styled, Box, Typography, useTheme, Accordion, AccordionSummary, ListItem, ListItemButton, Stack, Grid, AccordionDetails, LinearProgress, Tabs, Tab, Button, MenuItem, FormHelperText, Paper, Card, CardContent, FormControl, CircularProgress, InputAdornment, Menu, ListSubheader, Chip, ListItemText, ListItemIcon, Tooltip, IconButton, Checkbox, DialogTitle, DialogContent, Switch, RadioGroup, FormControlLabel, Radio, Collapse } from '@mui/material';
16
+ import { styled, Box, Typography, useTheme, Accordion, AccordionSummary, ListItem, ListItemButton, Stack, Grid, AccordionDetails, LinearProgress, Tabs, Tab, Button, MenuItem, Menu, ListSubheader, FormHelperText, Paper, Card, CardContent, FormControl, CircularProgress, Chip, ListItemText, ListItemIcon, Popover, RadioGroup, FormControlLabel, Radio, Tooltip, IconButton, Checkbox, DialogTitle, DialogContent, Switch, Collapse } from '@mui/material';
17
17
  import { List, useListRef } from 'react-window';
18
18
  import { useQueryClient, useMutation, queryOptions, QueryClient, useQuery } from '@tanstack/react-query';
19
19
  import { getHeaders, handleResponse, AirmetPhenomena, SigmetPhenomena, useAuthQuery, useAuthenticationContext, optimisticUpdate, ProductStatus, LevelUnits } from '@opengeoweb/api';
20
20
  import { snackbarListener, snackbarReducer, snackbarActions, snackbarTypes } from '@opengeoweb/snackbar';
21
- import { isEqual, cloneDeep, clamp, concat, groupBy, pick } from 'lodash';
21
+ import { isEqual, cloneDeep, clamp, omit, concat, groupBy, pick } from 'lodash';
22
22
  import { useFormContext, useFieldArray, useForm, FormProvider, useWatch } from 'react-hook-form';
23
- import { isEmpty, createEmpty, extend } from 'ol/extent';
23
+ import { bbox, intersect, featureCollection, union, bboxClip, polygonToLine, lineSplit, along, length, booleanPointInPolygon, area } from '@turf/turf';
24
+ import { intersects, buffer, getWidth, getHeight, isEmpty, createEmpty, extend } from 'ol/extent';
24
25
  import GeoJSON from 'ol/format/GeoJSON';
25
26
  import { ReactSortable } from 'react-sortablejs';
26
- import { LocalizationProvider } from '@mui/x-date-pickers';
27
- import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
28
- import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
29
- import { intersect, area } from '@turf/turf';
30
27
  import Box$1 from '@mui/material/Box';
31
28
  import Tooltip$1 from '@mui/material/Tooltip';
29
+ import { useTheme as useTheme$1 } from '@mui/material/styles';
32
30
  import { http, HttpResponse, passthrough, delay } from 'msw';
33
31
 
34
32
  var en = {
@@ -118,6 +116,7 @@ var en = {
118
116
  "warning-button-delete-polygon": "Delete polygon",
119
117
  "warning-event-map-edit-drawing-tooltip": "Edit drawing",
120
118
  "warning-event-map-remove-drawing-tooltip": "Remove drawing",
119
+ "warning-event-probability": "Probability (incl. - excl.)",
121
120
  "warning-draw-tools-disabled": "Link a map to enable draw tools",
122
121
  "warning-description-original": "Description original",
123
122
  "warning-description-translation": "Description translation",
@@ -144,6 +143,9 @@ var en = {
144
143
  "warning-phenomenon-low-temp": "Low temperature",
145
144
  "warning-phenomenon-funnel-cloud": "Funnel cloud",
146
145
  "warning-phenomenon-coastal-event": "Coastal event",
146
+ "warning-phenomenon-freezing-rain": "Freezing rain",
147
+ "warning-phenomenon-snow": "Snow",
148
+ "warning-phenomenon-waterspouts": "Waterspouts",
147
149
  "warning-probability-moderate-level-invalid": "Probability should be at least 30% when level is moderate",
148
150
  "warning-valid-from": "Valid from",
149
151
  "warning-valid-until": "Valid until",
@@ -403,6 +405,8 @@ var en = {
403
405
  "warning-event-validation-min-duration": "Warning must have a duration of at least one hour",
404
406
  "warning-event-validation-overlap": "Warnings of the same level cannot overlap in time and/or area, delete or adjust one of the warnings",
405
407
  "warning-event-validation-propbability-collapsed": "A probability is required",
408
+ "warning-event-validation-area-missing": "An area is required",
409
+ "warning-event-validation-area-non-polygon": "Area must be a polygon or multi-polygon",
406
410
  "warning-event-open-summary-dialog-tooltip": "Open the summary dialog to enter detailed texts for all summary fields",
407
411
  "drawing-tool-form-objects": "Objects",
408
412
  "drawing-tool-form-object-name": "Object name",
@@ -410,8 +414,17 @@ var en = {
410
414
  "drawing-tool-form-object-name-unique": "This object name is already in use",
411
415
  "drawing-tool-form-object-name-max-length": "An object name can be at most {{maxLength}} characters",
412
416
  "drawing-tool-form-object-delete": "Delete object",
417
+ "drawing-tool-form-masks": "Masks",
418
+ "drawing-tool-form-masks-clear": "Clear",
419
+ "drawing-tool-form-masks-tooltip": "Select a mask to clip your drawing",
420
+ "drawing-tool-form-masks-empty": "No masks available. Please contact your administrator.",
421
+ "drawing-tool-form-mask-no-overlap": "The drawing does not overlap with the selected mask",
422
+ "drawing-tool-form-mask-clip-error": "The drawing could not be clipped with the selected mask",
423
+ "drawing-tool-form-mask-saved": "Saved mask",
413
424
  "warning-event-button-add-drawing": "Add a drawing to this event, then choose individual objects for each warning",
414
- "warning-event-button-assign-object": "Assign an object from the chosen drawing to this warning"
425
+ "warning-event-button-assign-object": "Assign an object from the chosen drawing to this warning",
426
+ "warning-event-objects-menu-title": "Objects",
427
+ "warning-event-objects-menu-no-objects": "No objects available. Please first select a drawing via the 'Add drawing' button in the first warning"
415
428
  };
416
429
  var nl = {
417
430
  "drawing-tool-form-tools": "Gereedschap",
@@ -500,6 +513,7 @@ var nl = {
500
513
  "warning-button-delete-polygon": "Polygoon verwijderen",
501
514
  "warning-event-map-edit-drawing-tooltip": "Tekening bewerken",
502
515
  "warning-event-map-remove-drawing-tooltip": "Tekening verwijderen",
516
+ "warning-event-probability": "Waarschijnlijkheid (incl. - excl.)",
503
517
  "warning-draw-tools-disabled": "Koppel een kaart om tekentools in te schakelen",
504
518
  "warning-description-original": "Beschrijving origineel",
505
519
  "warning-description-translation": "Beschrijving vertaling",
@@ -513,15 +527,18 @@ var nl = {
513
527
  "warning-level-letter-SIG": "SIG",
514
528
  "warning-level-letter-AIR": "AIR",
515
529
  "warning-phenomenon": "Fenomeen",
516
- "warning-phenomenon-wind": "Wind",
517
- "warning-phenomenon-fog": "Dichte mist",
530
+ "warning-phenomenon-wind": "Windstoten",
531
+ "warning-phenomenon-fog": "Mist",
518
532
  "warning-phenomenon-thunderstorm": "Onweersbuien",
519
533
  "warning-phenomenon-snow-ice": "Sneeuw/gladheid",
520
534
  "warning-phenomenon-rain": "Zware regen",
521
535
  "warning-phenomenon-high-temp": "Hitte",
522
- "warning-phenomenon-low-temp": "Koude",
536
+ "warning-phenomenon-low-temp": "Kou",
523
537
  "warning-phenomenon-funnel-cloud": "Hozen",
524
538
  "warning-phenomenon-coastal-event": "Kust incident",
539
+ "warning-phenomenon-freezing-rain": "Gladheid door ijzel",
540
+ "warning-phenomenon-snow": "Gladheid door sneeuw",
541
+ "warning-phenomenon-waterspouts": "Waterhozen",
525
542
  "warning-probability-moderate-level-invalid": "Waarschijnlijkheid moet tenminste 30% zijn als Niveau Gematigd is",
526
543
  "warning-valid-from": "Geldig vanaf",
527
544
  "warning-valid-until": "Geldig tot",
@@ -740,6 +757,8 @@ var nl = {
740
757
  "warning-event-validation-min-duration": "De duur van een waarschuwing is minimaal 1 uur",
741
758
  "warning-event-validation-overlap": "Waarschuwingen van hetzelfde niveau mogen niet overlappen in tijd en/of gebied, verwijder of pas een van de waarschuwingen aan",
742
759
  "warning-event-validation-propbability-collapsed": "Een waarschijnlijkheid is verplicht",
760
+ "warning-event-validation-area-missing": "Een gebied is verplicht",
761
+ "warning-event-validation-area-non-polygon": "Gebied moet een polygoon of multi-polygoon zijn",
743
762
  "warning-event-open-summary-dialog-tooltip": "Open de samenvatting pop-up om de gedetailleerde samenvattingen in te vullen",
744
763
  "drawing-tool-form-objects": "Objecten",
745
764
  "drawing-tool-form-object-name": "Objectnaam",
@@ -747,8 +766,17 @@ var nl = {
747
766
  "drawing-tool-form-object-name-unique": "Deze objectnaam is al in gebruik",
748
767
  "drawing-tool-form-object-name-max-length": "Een objectnaam mag maximaal {{maxLength}} tekens bevatten",
749
768
  "drawing-tool-form-object-delete": "Object verwijderen",
769
+ "drawing-tool-form-masks": "Maskers",
770
+ "drawing-tool-form-masks-clear": "Wissen",
771
+ "drawing-tool-form-masks-tooltip": "Selecteer een masker om je tekening bij te snijden",
772
+ "drawing-tool-form-masks-empty": "Geen maskers beschikbaar. Neem contact op met je beheerder.",
773
+ "drawing-tool-form-mask-no-overlap": "De tekening overlapt niet met het geselecteerde masker",
774
+ "drawing-tool-form-mask-clip-error": "De tekening kon niet worden bijgesneden met het geselecteerde masker",
775
+ "drawing-tool-form-mask-saved": "Opgeslagen masker",
750
776
  "warning-event-button-add-drawing": "Voeg een tekening toe aan dit event. Wijs daarna individuele objecten toe aan elke waarschuwing",
751
- "warning-event-button-assign-object": "Wijs een object uit de gekozen tekening toe aan deze waarschuwing"
777
+ "warning-event-button-assign-object": "Wijs een object uit de gekozen tekening toe aan deze waarschuwing",
778
+ "warning-event-objects-menu-title": "Objecten",
779
+ "warning-event-objects-menu-no-objects": "Geen objecten beschikbaar, selecteer eerst een tekening via de 'Selecteer tekening' knop bij de eerste waarschuwing"
752
780
  };
753
781
  var fi = {
754
782
  "drawing-tool-form-tools": "Työkalut",
@@ -837,6 +865,7 @@ var fi = {
837
865
  "warning-button-delete-polygon": "Poista monikulmio",
838
866
  "warning-event-map-edit-drawing-tooltip": "Muokkaa piirrosta",
839
867
  "warning-event-map-remove-drawing-tooltip": "Poista piirros",
868
+ "warning-event-probability": "Todennäköisyys (ml. - pl.)",
840
869
  "warning-draw-tools-disabled": "Linkitä kartta piirtotyökalujen ottamiseksi käyttöön",
841
870
  "warning-description-original": "Alkuperäinen kuvaus",
842
871
  "warning-description-translation": "Kuvauksen käännös",
@@ -859,6 +888,9 @@ var fi = {
859
888
  "warning-phenomenon-low-temp": "Alhainen lämpötila",
860
889
  "warning-phenomenon-funnel-cloud": "Suppilopilvi",
861
890
  "warning-phenomenon-coastal-event": "Rannikon sääilmiö",
891
+ "warning-phenomenon-freezing-rain": "Jäätävä sade",
892
+ "warning-phenomenon-snow": "Lumi",
893
+ "warning-phenomenon-waterspouts": "Vesipatsas",
862
894
  "warning-probability-moderate-level-invalid": "Todennäköisyys tulisi olla vähintään 30% sääilmiön vakavuuden ollessa kohtalainen",
863
895
  "warning-valid-from": "Voimassa alkaen",
864
896
  "warning-valid-until": "Voimassa kunnes",
@@ -1029,6 +1061,8 @@ var fi = {
1029
1061
  "warning-event-validation-min-duration": "ei käännetty",
1030
1062
  "warning-event-validation-overlap": "ei käännetty",
1031
1063
  "warning-event-validation-propbability-collapsed": "ei käännetty",
1064
+ "warning-event-validation-area-missing": "ei käännetty",
1065
+ "warning-event-validation-area-non-polygon": "ei käännetty",
1032
1066
  "warning-event-open-summary-dialog-tooltip": "ei käännetty",
1033
1067
  "drawing-tool-form-objects": "ei käännetty",
1034
1068
  "drawing-tool-form-object-name": "ei käännetty",
@@ -1036,8 +1070,17 @@ var fi = {
1036
1070
  "drawing-tool-form-object-name-unique": "ei käännetty",
1037
1071
  "drawing-tool-form-object-name-max-length": "ei käännetty",
1038
1072
  "drawing-tool-form-object-delete": "ei käännetty",
1073
+ "drawing-tool-form-masks": "ei käännetty",
1074
+ "drawing-tool-form-masks-clear": "ei käännetty",
1075
+ "drawing-tool-form-masks-tooltip": "ei käännetty",
1076
+ "drawing-tool-form-masks-empty": "ei käännetty",
1077
+ "drawing-tool-form-mask-no-overlap": "ei käännetty",
1078
+ "drawing-tool-form-mask-clip-error": "ei käännetty",
1079
+ "drawing-tool-form-mask-saved": "ei käännetty",
1039
1080
  "warning-event-button-add-drawing": "ei käännetty",
1040
- "warning-event-button-assign-object": "ei käännetty"
1081
+ "warning-event-button-assign-object": "ei käännetty",
1082
+ "warning-event-objects-menu-title": "ei käännetty",
1083
+ "warning-event-objects-menu-no-objects": "ei käännetty"
1041
1084
  };
1042
1085
  var no = {
1043
1086
  "drawing-tool-form-tools": "Verktøy",
@@ -1126,6 +1169,7 @@ var no = {
1126
1169
  "warning-button-delete-polygon": "Slett polygon",
1127
1170
  "warning-event-map-edit-drawing-tooltip": "Rediger tegning",
1128
1171
  "warning-event-map-remove-drawing-tooltip": "Fjern tegning",
1172
+ "warning-event-probability": "Sannsynlighet (inkl. - ekskl.)",
1129
1173
  "warning-draw-tools-disabled": "Koble til et kart for å aktivere tegneverktøy",
1130
1174
  "warning-description-original": "Original beskrivelse",
1131
1175
  "warning-description-translation": "Oversatt beskrivelse",
@@ -1148,6 +1192,9 @@ var no = {
1148
1192
  "warning-phenomenon-low-temp": "Lav temperatur",
1149
1193
  "warning-phenomenon-funnel-cloud": "Tornado",
1150
1194
  "warning-phenomenon-coastal-event": "Kysthendelse",
1195
+ "warning-phenomenon-freezing-rain": "Underkjølt regn",
1196
+ "warning-phenomenon-snow": "Snø",
1197
+ "warning-phenomenon-waterspouts": "Vannløpere",
1151
1198
  "warning-probability-moderate-level-invalid": "Sannsynlighet bør være minst 30% når level er moderat",
1152
1199
  "warning-valid-from": "Gyldig fra",
1153
1200
  "warning-valid-until": "Gyldig til",
@@ -1316,6 +1363,8 @@ var no = {
1316
1363
  "warning-event-validation-min-duration": "ikke oversatt",
1317
1364
  "warning-event-validation-overlap": "ikke oversatt",
1318
1365
  "warning-event-validation-propbability-collapsed": "ikke oversatt",
1366
+ "warning-event-validation-area-missing": "ikke oversatt",
1367
+ "warning-event-validation-area-non-polygon": "ikke oversatt",
1319
1368
  "warning-event-open-summary-dialog-tooltip": "ikke oversatt",
1320
1369
  "drawing-tool-form-objects": "ikke oversatt",
1321
1370
  "drawing-tool-form-object-name": "ikke oversatt",
@@ -1323,8 +1372,17 @@ var no = {
1323
1372
  "drawing-tool-form-object-name-unique": "ikke oversatt",
1324
1373
  "drawing-tool-form-object-name-max-length": "ikke oversatt",
1325
1374
  "drawing-tool-form-object-delete": "ikke oversatt",
1375
+ "drawing-tool-form-masks": "ikke oversatt",
1376
+ "drawing-tool-form-masks-clear": "ikke oversatt",
1377
+ "drawing-tool-form-masks-tooltip": "ikke oversatt",
1378
+ "drawing-tool-form-masks-empty": "ikke oversatt",
1379
+ "drawing-tool-form-mask-no-overlap": "ikke oversatt",
1380
+ "drawing-tool-form-mask-clip-error": "ikke oversatt",
1381
+ "drawing-tool-form-mask-saved": "ikke oversatt",
1326
1382
  "warning-event-button-add-drawing": "ikke oversatt",
1327
- "warning-event-button-assign-object": "ikke oversatt"
1383
+ "warning-event-button-assign-object": "ikke oversatt",
1384
+ "warning-event-objects-menu-title": "Objekter",
1385
+ "warning-event-objects-menu-no-objects": "ikke oversatt"
1328
1386
  };
1329
1387
  var warningsTranslations = {
1330
1388
  en: en,
@@ -1353,6 +1411,37 @@ var warningsTranslations = {
1353
1411
  var areaDrawingDialogType = uiTypes.DialogTypes.AreaDrawingManager;
1354
1412
  var drawingDialogType = uiTypes.DialogTypes.DrawingTool;
1355
1413
  var areaDrawingLoaderType = uiTypes.DialogTypes.AreaDrawingLoader;
1414
+ /**
1415
+ * Returns the id to identify a single feature of a drawing by. Drawings saved
1416
+ * with the drawing tool have a stable id on every feature (see
1417
+ * `ensureFeatureIds` in the layer reducer), but drawings saved before that was
1418
+ * introduced do not, so fall back to the position within the drawing.
1419
+ * @param drawing The drawing the feature belongs to
1420
+ * @param feature The feature to get the id for
1421
+ * @param index The index of the feature within the drawing
1422
+ * @returns id of the feature
1423
+ */
1424
+ var getDrawingFeatureId = function getDrawingFeatureId(drawingId, feature, index) {
1425
+ var _feature$id;
1426
+ return String((_feature$id = feature.id) != null ? _feature$id : drawingId + "-" + index);
1427
+ };
1428
+ /**
1429
+ * Makes sure every feature of a drawing has an id, so single features can be
1430
+ * identified, selected and assigned.
1431
+ * @param drawing The drawing to add feature ids to
1432
+ * @returns the drawing, with an id on every feature
1433
+ */
1434
+ var withDrawingFeatureIds = function withDrawingFeatureIds(drawing) {
1435
+ return Object.assign({}, drawing, {
1436
+ geoJSON: Object.assign({}, drawing.geoJSON, {
1437
+ features: drawing.geoJSON.features.map(function (feature, index) {
1438
+ return Object.assign({}, feature, {
1439
+ id: getDrawingFeatureId(drawing.id, feature, index)
1440
+ });
1441
+ })
1442
+ })
1443
+ });
1444
+ };
1356
1445
 
1357
1446
  function _arrayLikeToArray(r, a) {
1358
1447
  (null == a || a > r.length) && (a = r.length);
@@ -1518,6 +1607,20 @@ function _regeneratorDefine(e, r, n, t) {
1518
1607
  }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
1519
1608
  }, _regeneratorDefine(e, r, n, t);
1520
1609
  }
1610
+ function _toPrimitive(t, r) {
1611
+ if ("object" != typeof t || !t) return t;
1612
+ var e = t[Symbol.toPrimitive];
1613
+ if (void 0 !== e) {
1614
+ var i = e.call(t, r);
1615
+ if ("object" != typeof i) return i;
1616
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1617
+ }
1618
+ return (String )(t);
1619
+ }
1620
+ function _toPropertyKey(t) {
1621
+ var i = _toPrimitive(t, "string");
1622
+ return "symbol" == typeof i ? i : i + "";
1623
+ }
1521
1624
  function _unsupportedIterableToArray(r, a) {
1522
1625
  if (r) {
1523
1626
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
@@ -2095,6 +2198,8 @@ var RowComponent$3 = function RowComponent(_ref) {
2095
2198
  activeDrawing = _ref.activeDrawing,
2096
2199
  t = _ref.t;
2097
2200
  var theme = useTheme();
2201
+ var config = sessionStorageProvider.getConfig();
2202
+ var showWarningsEventsOption = !!config.GW_FEATURE_WARNINGS_EVENT;
2098
2203
  var listItem = listInclHeaders[index];
2099
2204
  if (!listItem.isDrawing) {
2100
2205
  var header = headerList[listItem.index];
@@ -2199,10 +2304,16 @@ var RowComponent$3 = function RowComponent(_ref) {
2199
2304
  }, {
2200
2305
  text: t('public-warning-title').toUpperCase(),
2201
2306
  action: function action() {
2202
- onClickShare(drawing);
2307
+ onClickShare(drawing, 'public');
2203
2308
  },
2204
2309
  icon: jsx(ExitDomain, {})
2205
- }],
2310
+ }].concat(showWarningsEventsOption ? [{
2311
+ text: t('public-warning-event-title').toUpperCase(),
2312
+ action: function action() {
2313
+ onClickShare(drawing, 'warningsEvent');
2314
+ },
2315
+ icon: jsx(ExitDomain, {})
2316
+ }] : []),
2206
2317
  secondaryMenuTitle: t('area-drawing-manager-share-menu'),
2207
2318
  tooltipTitle: t('area-drawing-manager-options-menu')
2208
2319
  }))
@@ -3310,6 +3421,19 @@ var Phenomenon$1;
3310
3421
  Phenomenon["lowTemp"] = "lowTemp";
3311
3422
  Phenomenon["coastalEvent"] = "coastalEvent";
3312
3423
  })(Phenomenon$1 || (Phenomenon$1 = {}));
3424
+ var WarningEventPhenomenon;
3425
+ (function (WarningEventPhenomenon) {
3426
+ WarningEventPhenomenon["fog"] = "fog";
3427
+ WarningEventPhenomenon["freezingRain"] = "freezingRain";
3428
+ WarningEventPhenomenon["highTemp"] = "highTemp";
3429
+ WarningEventPhenomenon["lowTemp"] = "lowTemp";
3430
+ WarningEventPhenomenon["rain"] = "rain";
3431
+ WarningEventPhenomenon["snow"] = "snow";
3432
+ WarningEventPhenomenon["thunderstorm"] = "thunderstorm";
3433
+ WarningEventPhenomenon["waterspouts"] = "waterspouts";
3434
+ WarningEventPhenomenon["wind"] = "wind";
3435
+ WarningEventPhenomenon["coastalEvent"] = "coastalEvent";
3436
+ })(WarningEventPhenomenon || (WarningEventPhenomenon = {}));
3313
3437
  var emptyFilterId = 'unspecified';
3314
3438
  var defaultDomainFilter = {
3315
3439
  aviation: false,
@@ -3334,23 +3458,21 @@ var makeFilterFromList = function makeFilterFromList(options, value) {
3334
3458
  return property ? Object.assign({}, acc, (_Object$assign = {}, _Object$assign[property] = value, _Object$assign)) : acc;
3335
3459
  }, (_options$reduce = {}, _options$reduce[emptyFilterId] = value, _options$reduce));
3336
3460
  };
3337
- var AllPhenomena = Object.assign({}, AirmetPhenomena, SigmetPhenomena, Phenomenon$1);
3461
+ var AllPhenomena = Object.assign({}, AirmetPhenomena, SigmetPhenomena, Phenomenon$1, WarningEventPhenomenon);
3338
3462
  var AllPhenomenaKeys = Object.fromEntries(Object.keys(AllPhenomena).map(function (key) {
3339
3463
  return [key, key];
3340
3464
  }));
3341
3465
  var domainPhenomena = {
3342
3466
  aviation: [].concat(Object.keys(SigmetPhenomena), Object.keys(AirmetPhenomena)),
3343
3467
  maritime: [Phenomenon$1.wind],
3344
- "public": [].concat(Object.keys(Phenomenon$1))
3468
+ "public": [].concat(Object.keys(Phenomenon$1), Object.keys(WarningEventPhenomenon))
3345
3469
  };
3346
3470
  var defaultPhenomenonFilter = makeFilterFromList(Object.keys(AllPhenomenaKeys));
3347
3471
  var getSelectedOptions = function getSelectedOptions(options) {
3348
3472
  if (options === void 0) {
3349
3473
  options = {};
3350
3474
  }
3351
- var selectedOptions = Object.keys(options).filter(function (key) {
3352
- return options[key];
3353
- });
3475
+ var selectedOptions = Object.values(options).filter(Boolean);
3354
3476
  var allSelected = selectedOptions.length === Object.keys(options).length;
3355
3477
  return {
3356
3478
  noSelectedOptions: selectedOptions.length,
@@ -3750,7 +3872,8 @@ var defaultExpandedWarningSections = {
3750
3872
  var initialWarningFilterPanelState = Object.assign({}, initialFilters, {
3751
3873
  expandedSections: defaultExpandedWarningSections,
3752
3874
  hoveredWarningIds: [],
3753
- hiddenWarningIds: []
3875
+ hiddenWarningIds: [],
3876
+ warningListActionRequest: undefined
3754
3877
  });
3755
3878
  var initialState$2 = {};
3756
3879
  var slice$1 = createSlice({
@@ -3787,6 +3910,18 @@ var slice$1 = createSlice({
3787
3910
  draft[action.payload.panelId] = Object.assign({}, currentPanelState, {
3788
3911
  hiddenWarningIds: (_action$payload$warni2 = action.payload.warningIds) != null ? _action$payload$warni2 : []
3789
3912
  });
3913
+ },
3914
+ requestWarningListAction: function requestWarningListAction(draft, action) {
3915
+ var currentPanelState = draft[action.payload.panelId] || initialWarningFilterPanelState;
3916
+ draft[action.payload.panelId] = Object.assign({}, currentPanelState, {
3917
+ warningListActionRequest: action.payload.request
3918
+ });
3919
+ },
3920
+ clearWarningListActionRequest: function clearWarningListActionRequest(draft, action) {
3921
+ var currentPanelState = draft[action.payload.panelId];
3922
+ if (currentPanelState) {
3923
+ currentPanelState.warningListActionRequest = undefined;
3924
+ }
3790
3925
  }
3791
3926
  }
3792
3927
  });
@@ -3819,11 +3954,9 @@ var slice = createSlice({
3819
3954
  var _action$payload = action.payload,
3820
3955
  event = _action$payload.event,
3821
3956
  formState = _action$payload.formState;
3822
- // if (object) {
3823
- // draft.object = object;
3824
- // }
3825
3957
  if (event) {
3826
3958
  draft.event = event;
3959
+ draft.selectedDrawing = event.selectedDrawing && withDrawingFeatureIds(event.selectedDrawing);
3827
3960
  }
3828
3961
  if (formState !== undefined) {
3829
3962
  draft.formState = formState;
@@ -3836,8 +3969,8 @@ var slice = createSlice({
3836
3969
  formState = _action$payload2$form === void 0 ? '' : _action$payload2$form,
3837
3970
  panelId = _action$payload2.panelId,
3838
3971
  selectedEventId = _action$payload2.selectedEventId;
3839
- // draft.object = object;
3840
3972
  draft.event = event;
3973
+ draft.selectedDrawing = (event == null ? void 0 : event.selectedDrawing) && withDrawingFeatureIds(event.selectedDrawing);
3841
3974
  draft.selectedEventId = selectedEventId || (event == null ? void 0 : event.eventId);
3842
3975
  draft.formState = formState;
3843
3976
  draft.panelId = panelId;
@@ -3868,6 +4001,10 @@ var slice = createSlice({
3868
4001
  },
3869
4002
  setSelectedEventId: function setSelectedEventId(draft, action) {
3870
4003
  draft.selectedEventId = action.payload;
4004
+ },
4005
+ setSelectedDrawing: function setSelectedDrawing(draft, action) {
4006
+ var drawing = action.payload.drawing;
4007
+ draft.selectedDrawing = drawing && withDrawingFeatureIds(drawing);
3871
4008
  }
3872
4009
  },
3873
4010
  extraReducers: function extraReducers(builder) {
@@ -3883,6 +4020,7 @@ var slice = createSlice({
3883
4020
  delete draft.selectedEventId;
3884
4021
  delete draft.isFormDirty;
3885
4022
  delete draft.warningType;
4023
+ delete draft.selectedDrawing;
3886
4024
  }
3887
4025
  });
3888
4026
  }
@@ -4022,6 +4160,12 @@ var getWarningPhenomenaIcon = function getWarningPhenomenaIcon(key) {
4022
4160
  return jsx(TemperatureLow, {});
4023
4161
  case 'coastalEvent':
4024
4162
  return jsx(CoastalEvent, {});
4163
+ case 'freezingRain':
4164
+ return jsx(FreezingRain, {});
4165
+ case 'snow':
4166
+ return jsx(Snow, {});
4167
+ case 'waterspouts':
4168
+ return jsx(Waterspouts, {});
4025
4169
  default:
4026
4170
  return undefined;
4027
4171
  }
@@ -4238,7 +4382,44 @@ var warningPhenomena = [{
4238
4382
  key: 'MT_OBSC',
4239
4383
  isAviation: true
4240
4384
  }];
4241
- var allPhenomenaDict = warningPhenomena.reduce(function (list, item) {
4385
+ var warningEventPhenomena = [{
4386
+ translationKey: 'warning-phenomenon-fog',
4387
+ key: 'fog',
4388
+ isAviation: false
4389
+ }, {
4390
+ translationKey: 'warning-phenomenon-freezing-rain',
4391
+ key: 'freezingRain',
4392
+ isAviation: false
4393
+ }, {
4394
+ translationKey: 'warning-phenomenon-high-temp',
4395
+ key: 'highTemp',
4396
+ isAviation: false
4397
+ }, {
4398
+ translationKey: 'warning-phenomenon-low-temp',
4399
+ key: 'lowTemp',
4400
+ isAviation: false
4401
+ }, {
4402
+ translationKey: 'warning-phenomenon-rain',
4403
+ key: 'rain',
4404
+ isAviation: false
4405
+ }, {
4406
+ translationKey: 'warning-phenomenon-snow',
4407
+ key: 'snow',
4408
+ isAviation: false
4409
+ }, {
4410
+ translationKey: 'warning-phenomenon-thunderstorm',
4411
+ key: 'thunderstorm',
4412
+ isAviation: false
4413
+ }, {
4414
+ translationKey: 'warning-phenomenon-waterspouts',
4415
+ key: 'waterspouts',
4416
+ isAviation: false
4417
+ }, {
4418
+ translationKey: 'warning-phenomenon-wind',
4419
+ key: 'wind',
4420
+ isAviation: false
4421
+ }];
4422
+ var allPhenomenaDict = [].concat(warningPhenomena, warningEventPhenomena).reduce(function (list, item) {
4242
4423
  var _Object$assign;
4243
4424
  return Object.assign({}, list, (_Object$assign = {}, _Object$assign[item.key] = item, _Object$assign));
4244
4425
  }, {});
@@ -4247,14 +4428,21 @@ var getPhenomenaIcon = function getPhenomenaIcon(key) {
4247
4428
  };
4248
4429
  var Phenomenon = function Phenomenon(_ref) {
4249
4430
  var isDisabled = _ref.isDisabled,
4250
- isReadOnly = _ref.isReadOnly;
4431
+ isReadOnly = _ref.isReadOnly,
4432
+ _ref$isWarningEvent = _ref.isWarningEvent,
4433
+ isWarningEvent = _ref$isWarningEvent === void 0 ? false : _ref$isWarningEvent;
4251
4434
  var _useWarningsTranslati = useWarningsTranslation(),
4252
4435
  t = _useWarningsTranslati.t;
4253
4436
  var _useDraftFormHelpers = useDraftFormHelpers(),
4254
4437
  isRequired = _useDraftFormHelpers.isRequired;
4255
- // These phenomena are sent to Public Warning Form
4256
- var warningFormPhenomena = warningPhenomena.filter(function (phenomenon) {
4438
+ var phenomenaList = isWarningEvent ? warningEventPhenomena : warningPhenomena;
4439
+ // These phenomena are sent to Form
4440
+ var warningFormPhenomena = phenomenaList.filter(function (phenomenon) {
4257
4441
  return !phenomenon.isAviation && phenomenon.key !== emptyFilterId;
4442
+ })
4443
+ // sort alphabeticaly
4444
+ .sort(function (phenomenonA, phenomenonB) {
4445
+ return t(phenomenonA.translationKey).localeCompare(t(phenomenonB.translationKey));
4258
4446
  });
4259
4447
  return jsx(ReactHookFormSelect, {
4260
4448
  disabled: isDisabled || isReadOnly,
@@ -4272,15 +4460,20 @@ var Phenomenon = function Phenomenon(_ref) {
4272
4460
  children: jsxs(Grid, {
4273
4461
  container: true,
4274
4462
  sx: {
4275
- justifyContent: 'space-between'
4463
+ alignItems: 'center',
4464
+ flexWrap: 'nowrap',
4465
+ gap: 1,
4466
+ justifyContent: 'flex-start'
4276
4467
  },
4277
4468
  children: [jsx(Grid, {
4278
- children: t(phenomenon.translationKey)
4279
- }), jsx(Grid, {
4280
4469
  sx: {
4281
- minWidth: 56
4470
+ alignItems: 'center',
4471
+ display: 'flex',
4472
+ flexShrink: 0
4282
4473
  },
4283
4474
  children: getPhenomenaIcon(phenomenon.key)
4475
+ }), jsx(Grid, {
4476
+ children: t(phenomenon.translationKey)
4284
4477
  })]
4285
4478
  })
4286
4479
  }, phenomenon.key);
@@ -4289,7 +4482,7 @@ var Phenomenon = function Phenomenon(_ref) {
4289
4482
  };
4290
4483
 
4291
4484
  var _excluded$c = ["id", "warningDetail", "status", "editor"],
4292
- _excluded2$1 = ["id", "linked_to_id", "proposal_id", "warning_handle_uuid"],
4485
+ _excluded2$2 = ["id", "linked_to_id", "proposal_id", "warning_handle_uuid"],
4293
4486
  _excluded3 = ["published_warning_uuid"],
4294
4487
  _excluded4 = ["id"],
4295
4488
  _excluded5 = ["id", "warningDetail"],
@@ -4317,7 +4510,7 @@ var getWarningWithoutIdStatusEditor = function getWarningWithoutIdStatusEditor(w
4317
4510
  warningDetail.linked_to_id;
4318
4511
  warningDetail.proposal_id;
4319
4512
  warningDetail.warning_handle_uuid;
4320
- var cleanWarningDetail = _objectWithoutPropertiesLoose(warningDetail, _excluded2$1);
4513
+ var cleanWarningDetail = _objectWithoutPropertiesLoose(warningDetail, _excluded2$2);
4321
4514
  var areas = (_warningDetail$areas = warningDetail.areas) == null ? void 0 : _warningDetail$areas.map(function (_ref) {
4322
4515
  _ref.published_warning_uuid;
4323
4516
  var area = _objectWithoutPropertiesLoose(_ref, _excluded3);
@@ -4378,10 +4571,8 @@ var getTranslationKey = function getTranslationKey(optionId, id) {
4378
4571
  }
4379
4572
  return optionId;
4380
4573
  }
4381
- var phenomena = warningPhenomena.find(function (phenomenon) {
4382
- return phenomenon.key === optionId;
4383
- });
4384
- return phenomena ? phenomena.translationKey : "warning-" + id + "-" + optionId;
4574
+ var phenomenon = allPhenomenaDict[optionId];
4575
+ return phenomenon ? phenomenon.translationKey : "warning-" + id + "-" + optionId;
4385
4576
  };
4386
4577
  var getIdFromUrl = function getIdFromUrl(url) {
4387
4578
  var splitString = url == null ? void 0 : url.split('/');
@@ -5065,6 +5256,10 @@ var useMutateWarningEvent = function useMutateWarningEvent(snackBarMessage) {
5065
5256
  type: warningEventDialogType,
5066
5257
  setOpen: false
5067
5258
  }));
5259
+ dispatch(uiActions.setToggleOpenDialog({
5260
+ type: uiTypes.DialogTypes.AreaDrawingLoader,
5261
+ setOpen: false
5262
+ }));
5068
5263
  }
5069
5264
  case 2:
5070
5265
  return _context15.a(2);
@@ -5269,7 +5464,7 @@ var buildAreaGeoJSON = function buildAreaGeoJSON(drawing, options) {
5269
5464
  features: drawing.geoJSON.features.map(function (feature, index) {
5270
5465
  var _feature$id, _options$idPrefix, _ref, _feature$properties$o, _feature$properties, _feature$properties2;
5271
5466
  return Object.assign({}, feature, {
5272
- id: (_feature$id = feature.id) != null ? _feature$id : "" + ((_options$idPrefix = options.idPrefix) != null ? _options$idPrefix : '') + drawing.id + "-" + index,
5467
+ id: (_feature$id = feature.id) != null ? _feature$id : "" + ((_options$idPrefix = options.idPrefix) != null ? _options$idPrefix : '') + getDrawingFeatureId(drawing.id, feature, index),
5273
5468
  properties: Object.assign({}, feature.properties, {
5274
5469
  areaId: drawing.id,
5275
5470
  areaFeatureName: (_ref = (_feature$properties$o = (_feature$properties = feature.properties) == null ? void 0 : _feature$properties.objectName) != null ? _feature$properties$o : (_feature$properties2 = feature.properties) == null ? void 0 : _feature$properties2.name) != null ? _ref : feature.id,
@@ -5555,6 +5750,7 @@ var AreaDrawingManagerConnect = function AreaDrawingManagerConnect(_ref2) {
5555
5750
  setSelectedDrawingId(drawingId);
5556
5751
  };
5557
5752
  useEffect(function () {
5753
+ var _drawingDetails$trans, _drawingDetails$trans2;
5558
5754
  if (!selectedDrawingId || !drawingDetails || (drawingDetails == null ? void 0 : drawingDetails.id) !== selectedDrawingId || isFetchingDetails) {
5559
5755
  return;
5560
5756
  }
@@ -5563,7 +5759,7 @@ var AreaDrawingManagerConnect = function AreaDrawingManagerConnect(_ref2) {
5563
5759
  id: selectedDrawingId,
5564
5760
  drawingInstanceId: drawingDialogType
5565
5761
  }));
5566
- openDrawDialog(drawingDetails.geoJSON);
5762
+ openDrawDialog((_drawingDetails$trans = (_drawingDetails$trans2 = drawingDetails.transformation) == null ? void 0 : _drawingDetails$trans2.original) != null ? _drawingDetails$trans : drawingDetails.geoJSON);
5567
5763
  setSelectedDrawingId(undefined);
5568
5764
  // eslint-disable-next-line react-hooks/exhaustive-deps
5569
5765
  }, [selectedDrawingId, drawingDetails, dispatch, isFetchingDetails]);
@@ -5603,7 +5799,16 @@ var AreaDrawingManagerConnect = function AreaDrawingManagerConnect(_ref2) {
5603
5799
  deleteHoverPreviewLayer();
5604
5800
  closeAreaDrawingDialog();
5605
5801
  };
5606
- var onShareDrawing = function onShareDrawing(drawing) {
5802
+ var onShareDrawing = function onShareDrawing(drawing, type) {
5803
+ if (type === 'warningsEvent') {
5804
+ dispatch(warningsEventFormActions.openWarningsEventFormDialog({
5805
+ event: {
5806
+ selectedDrawing: drawing
5807
+ },
5808
+ formState: 'edit'
5809
+ }));
5810
+ return;
5811
+ }
5607
5812
  dispatch(warningsFormActions.openPublicWarningFormDialog({
5608
5813
  object: drawing,
5609
5814
  warning: {
@@ -5817,23 +6022,7 @@ var DrawingTool = function DrawingTool(_ref) {
5817
6022
  });
5818
6023
  };
5819
6024
 
5820
- /* *
5821
- * Licensed under the Apache License, Version 2.0 (the "License");
5822
- * you may not use this file except in compliance with the License.
5823
- * You may obtain a copy of the License at
5824
- *
5825
- * http://www.apache.org/licenses/LICENSE-2.0
5826
- *
5827
- * Unless required by applicable law or agreed to in writing, software
5828
- * distributed under the License is distributed on an "AS IS" BASIS,
5829
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5830
- * See the License for the specific language governing permissions and
5831
- * limitations under the License.
5832
- *
5833
- * Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5834
- * Copyright 2026 - Finnish Meteorological Institute (FMI)
5835
- * Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
5836
- * */
6025
+ var _excluded$b = ["opacity", "geoJSON", "features"];
5837
6026
  var MAX_OBJECT_NAME_LENGTH = 64;
5838
6027
  var formatDefaultObjectName = function formatDefaultObjectName(position) {
5839
6028
  return "Object " + position;
@@ -5936,6 +6125,160 @@ var addObjectNamesToGeoJSON = function addObjectNamesToGeoJSON(geoJSON, objectNa
5936
6125
  })
5937
6126
  });
5938
6127
  };
6128
+ var getDrawingToSubmit = function getDrawingToSubmit(formValues) {
6129
+ // form only values which should not be submitted
6130
+ formValues.opacity;
6131
+ var geoJSON = formValues.geoJSON,
6132
+ _formValues$features = formValues.features,
6133
+ features = _formValues$features === void 0 ? [] : _formValues$features,
6134
+ submitValues = _objectWithoutPropertiesLoose(formValues, _excluded$b);
6135
+ var objectNamesByFeatureId = features.reduce(function (objectNames, _ref2) {
6136
+ var _Object$assign;
6137
+ var featureId = _ref2.featureId,
6138
+ objectName = _ref2.objectName;
6139
+ return Object.assign({}, objectNames, (_Object$assign = {}, _Object$assign[featureId] = objectName, _Object$assign));
6140
+ }, {});
6141
+ return Object.assign({}, submitValues, {
6142
+ // rewind geometry so the winding order is correct
6143
+ geoJSON: rewindGeometry(removeTransientFeatureProperties(addObjectNamesToGeoJSON(geoJSON, objectNamesByFeatureId)))
6144
+ });
6145
+ };
6146
+
6147
+ var DrawingToolFormMasks = function DrawingToolFormMasks(_ref) {
6148
+ var masks = _ref.masks,
6149
+ selectedMaskId = _ref.selectedMaskId,
6150
+ onSelectMask = _ref.onSelectMask,
6151
+ onHoverMask = _ref.onHoverMask,
6152
+ _ref$isDisabled = _ref.isDisabled,
6153
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
6154
+ _ref$isLoadingMasks = _ref.isLoadingMasks,
6155
+ isLoadingMasks = _ref$isLoadingMasks === void 0 ? false : _ref$isLoadingMasks;
6156
+ var _useWarningsTranslati = useWarningsTranslation(),
6157
+ t = _useWarningsTranslati.t;
6158
+ var _React$useState = React.useState(null),
6159
+ anchorEl = _React$useState[0],
6160
+ setAnchorEl = _React$useState[1];
6161
+ var isOpen = Boolean(anchorEl);
6162
+ var selectedMask = masks.find(function (mask) {
6163
+ return mask.id === selectedMaskId;
6164
+ });
6165
+ var closeMenu = function closeMenu() {
6166
+ setAnchorEl(null);
6167
+ onHoverMask(undefined);
6168
+ };
6169
+ var hoverMask = function hoverMask(maskId) {
6170
+ if (isOpen) {
6171
+ onHoverMask(maskId);
6172
+ }
6173
+ };
6174
+ return jsxs(Fragment, {
6175
+ children: [jsx(CustomIconButton, {
6176
+ "data-testid": "drawingToolForm-masks-button",
6177
+ disabled: isDisabled,
6178
+ isSelected: isOpen || !!selectedMask,
6179
+ onClick: function onClick(event) {
6180
+ return setAnchorEl(event.currentTarget);
6181
+ },
6182
+ size: "medium",
6183
+ tooltipTitle: selectedMask ? t('drawing-tool-form-masks') + ": " + selectedMask.objectName : t('drawing-tool-form-masks-tooltip'),
6184
+ variant: "tool",
6185
+ children: jsx(DrawMask, {})
6186
+ }), jsxs(Menu, {
6187
+ anchorEl: anchorEl,
6188
+ anchorOrigin: {
6189
+ vertical: 'bottom',
6190
+ horizontal: 'center'
6191
+ },
6192
+ disableAutoFocusItem: true,
6193
+ onClose: closeMenu,
6194
+ open: isOpen,
6195
+ slotProps: {
6196
+ backdrop: {
6197
+ style: {
6198
+ opacity: 0,
6199
+ transition: 'none'
6200
+ }
6201
+ },
6202
+ paper: {
6203
+ sx: {
6204
+ minWidth: 200
6205
+ }
6206
+ },
6207
+ transition: {
6208
+ onExited: function onExited() {
6209
+ return onHoverMask(undefined);
6210
+ }
6211
+ }
6212
+ },
6213
+ transformOrigin: {
6214
+ vertical: 'top',
6215
+ horizontal: 'center'
6216
+ },
6217
+ children: [jsxs(ListSubheader, {
6218
+ "data-testid": "drawingToolForm-masks-title",
6219
+ sx: {
6220
+ display: 'flex',
6221
+ justifyContent: 'space-between',
6222
+ alignItems: 'center',
6223
+ gap: 2,
6224
+ ' .MuiSvgIcon-root': {
6225
+ mr: 0
6226
+ }
6227
+ },
6228
+ children: [jsx(Typography, {
6229
+ sx: {
6230
+ fontSize: '12px'
6231
+ },
6232
+ children: t('drawing-tool-form-masks')
6233
+ }), selectedMask ? jsx(Button, {
6234
+ "data-testid": "drawingToolForm-masks-clear",
6235
+ endIcon: jsx(Delete, {}),
6236
+ onClick: function onClick() {
6237
+ onSelectMask(undefined);
6238
+ closeMenu();
6239
+ },
6240
+ size: "small",
6241
+ sx: {
6242
+ minWidth: 0,
6243
+ mr: -1
6244
+ },
6245
+ variant: "flat",
6246
+ children: t('drawing-tool-form-masks-clear')
6247
+ }) : null]
6248
+ }), isLoadingMasks ? jsx(Typography, {
6249
+ "data-testid": "drawingToolForm-masks-loading",
6250
+ sx: {
6251
+ padding: 1,
6252
+ fontSize: 14
6253
+ },
6254
+ children: t('loading')
6255
+ }) : null, !isLoadingMasks && masks.length === 0 ? jsx(Typography, {
6256
+ "data-testid": "drawingToolForm-masks-empty",
6257
+ sx: {
6258
+ padding: 1,
6259
+ fontSize: 14,
6260
+ maxWidth: 260
6261
+ },
6262
+ children: t('drawing-tool-form-masks-empty')
6263
+ }) : null, masks.map(function (mask) {
6264
+ return jsx(MenuItem, {
6265
+ onClick: function onClick() {
6266
+ onSelectMask(mask.id === selectedMaskId ? undefined : mask.id);
6267
+ closeMenu();
6268
+ },
6269
+ onMouseEnter: function onMouseEnter() {
6270
+ return hoverMask(mask.id);
6271
+ },
6272
+ onMouseLeave: function onMouseLeave() {
6273
+ return hoverMask(undefined);
6274
+ },
6275
+ selected: mask.id === selectedMaskId,
6276
+ children: mask.objectName
6277
+ }, mask.id);
6278
+ })]
6279
+ })]
6280
+ });
6281
+ };
5939
6282
 
5940
6283
  var opacityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
5941
6284
  var drawToolConfig = [{
@@ -6001,7 +6344,13 @@ var DrawingToolFormContentsNoMemo = function DrawingToolFormContentsNoMemo(_ref)
6001
6344
  onDeleteObject = _ref.onDeleteObject,
6002
6345
  opacity = _ref.opacity,
6003
6346
  onSubmit = _ref.onSubmit,
6004
- geoJSONProperties = _ref.geoJSONProperties;
6347
+ geoJSONProperties = _ref.geoJSONProperties,
6348
+ masks = _ref.masks,
6349
+ isLoadingMasks = _ref.isLoadingMasks,
6350
+ maskError = _ref.maskError,
6351
+ selectedMaskId = _ref.selectedMaskId,
6352
+ onSelectMask = _ref.onSelectMask,
6353
+ onHoverMask = _ref.onHoverMask;
6005
6354
  var _useWarningsTranslati = useWarningsTranslation(),
6006
6355
  t = _useWarningsTranslati.t;
6007
6356
  var hasErrors = Object.keys(errors).length > 0;
@@ -6116,6 +6465,28 @@ var DrawingToolFormContentsNoMemo = function DrawingToolFormContentsNoMemo(_ref)
6116
6465
  }
6117
6466
  }
6118
6467
  })]
6468
+ }), jsxs(Grid, {
6469
+ container: true,
6470
+ sx: {
6471
+ marginBottom: 1
6472
+ },
6473
+ children: [jsx(DrawingToolFormMasks, {
6474
+ isDisabled: isLoading,
6475
+ isLoadingMasks: isLoadingMasks,
6476
+ masks: masks,
6477
+ onHoverMask: onHoverMask,
6478
+ onSelectMask: onSelectMask,
6479
+ selectedMaskId: selectedMaskId
6480
+ }), maskError ? jsx(FormHelperText, {
6481
+ "data-testid": "drawingToolForm-masks-error",
6482
+ error: true,
6483
+ sx: {
6484
+ marginLeft: 0,
6485
+ width: '100%'
6486
+ },
6487
+ variant: "filled",
6488
+ children: t(maskError)
6489
+ }) : null]
6119
6490
  }), jsx(Grid, {
6120
6491
  container: true,
6121
6492
  size: "grow",
@@ -6264,7 +6635,7 @@ var DrawingToolFormContentsNoMemo = function DrawingToolFormContentsNoMemo(_ref)
6264
6635
  },
6265
6636
  children: jsx(Button, {
6266
6637
  "data-testid": "saveDrawingFormButton",
6267
- disabled: isLoading || hasErrors,
6638
+ disabled: isLoading || hasErrors || !!maskError,
6268
6639
  onClick: onSubmit,
6269
6640
  sx: {
6270
6641
  width: '100%',
@@ -6320,7 +6691,9 @@ var useFormDirty = function useFormDirty(_ref) {
6320
6691
  }, [isLoading, error, previousIsLoading, onSuccess]);
6321
6692
  };
6322
6693
 
6323
- var _excluded$b = ["opacity", "geoJSON", "features"];
6694
+ var emptyMasks$1 = [];
6695
+ var noopSelectMask = function noopSelectMask() {};
6696
+ var noopHoverMask = function noopHoverMask() {};
6324
6697
  var getDrawingName = function getDrawingName(drawingName) {
6325
6698
  return drawingName || dateUtils.dateToString(new Date(), dateUtils.DATE_FORMAT_DATEPICKER, true) + " UTC";
6326
6699
  };
@@ -6355,7 +6728,17 @@ var DrawingToolForm = function DrawingToolForm(_ref) {
6355
6728
  onDeleteFeature = _ref$onDeleteFeature === void 0 ? function () {} : _ref$onDeleteFeature,
6356
6729
  _ref$onFormDirty = _ref.onFormDirty,
6357
6730
  onFormDirty = _ref$onFormDirty === void 0 ? function () {} : _ref$onFormDirty,
6358
- geoJSON = _ref.geoJSON;
6731
+ geoJSON = _ref.geoJSON,
6732
+ _ref$masks = _ref.masks,
6733
+ masks = _ref$masks === void 0 ? emptyMasks$1 : _ref$masks,
6734
+ _ref$isLoadingMasks = _ref.isLoadingMasks,
6735
+ isLoadingMasks = _ref$isLoadingMasks === void 0 ? false : _ref$isLoadingMasks,
6736
+ maskError = _ref.maskError,
6737
+ selectedMaskId = _ref.selectedMaskId,
6738
+ _ref$onSelectMask = _ref.onSelectMask,
6739
+ onSelectMask = _ref$onSelectMask === void 0 ? noopSelectMask : _ref$onSelectMask,
6740
+ _ref$onHoverMask = _ref.onHoverMask,
6741
+ onHoverMask = _ref$onHoverMask === void 0 ? noopHoverMask : _ref$onHoverMask;
6359
6742
  var _useFormContext = useFormContext(),
6360
6743
  handleSubmit = _useFormContext.handleSubmit,
6361
6744
  setValue = _useFormContext.setValue,
@@ -6441,24 +6824,8 @@ var DrawingToolForm = function DrawingToolForm(_ref) {
6441
6824
  }, [isLoading, isInEditMode, geoJSON, setValue]);
6442
6825
  var onSubmit = React.useCallback(function (formValues) {
6443
6826
  onDeactivateTool();
6444
- // remove unneeded properties
6445
- formValues.opacity;
6446
- var geoJSON = formValues.geoJSON,
6447
- _formValues$features = formValues.features,
6448
- features = _formValues$features === void 0 ? [] : _formValues$features,
6449
- allFormValues = _objectWithoutPropertiesLoose(formValues, _excluded$b);
6450
- var objectNamesByFeatureId = features.reduce(function (objectNames, _ref3) {
6451
- var _Object$assign;
6452
- var featureId = _ref3.featureId,
6453
- objectName = _ref3.objectName;
6454
- return Object.assign({}, objectNames, (_Object$assign = {}, _Object$assign[featureId] = objectName, _Object$assign));
6455
- }, {});
6456
- var geoJSONWithObjectNames = addObjectNamesToGeoJSON(geoJSON, objectNamesByFeatureId);
6457
- // rewind geometry
6458
- var rewindedGeometry = rewindGeometry(geoJSONWithObjectNames);
6459
- onSubmitForm(Object.assign({}, allFormValues, {
6460
- id: id,
6461
- geoJSON: rewindedGeometry
6827
+ onSubmitForm(Object.assign({}, getDrawingToSubmit(formValues), {
6828
+ id: id
6462
6829
  }));
6463
6830
  }, [id, onDeactivateTool, onSubmitForm]);
6464
6831
  var opacity = React.useMemo(function () {
@@ -6500,14 +6867,20 @@ var DrawingToolForm = function DrawingToolForm(_ref) {
6500
6867
  isDirty: isDirty,
6501
6868
  isInEditMode: isInEditMode,
6502
6869
  isLoading: isLoading,
6870
+ isLoadingMasks: isLoadingMasks,
6871
+ maskError: maskError,
6872
+ masks: masks,
6503
6873
  onBlurName: onBlurName,
6504
6874
  onBlurObjectName: onBlurObjectName,
6505
6875
  onChangeDrawMode: onChangeDrawMode,
6506
6876
  onChangeOpacity: onChangeOpacity,
6507
6877
  onDeleteObject: onDeleteFeature,
6508
6878
  onFocusObject: onSelectFeature,
6879
+ onHoverMask: onHoverMask,
6880
+ onSelectMask: onSelectMask,
6509
6881
  onSubmit: handleSubmit(onSubmit),
6510
- opacity: opacity
6882
+ opacity: opacity,
6883
+ selectedMaskId: selectedMaskId
6511
6884
  });
6512
6885
  };
6513
6886
  var Wrapper = function Wrapper(props) {
@@ -6531,6 +6904,357 @@ var Wrapper = function Wrapper(props) {
6531
6904
  });
6532
6905
  };
6533
6906
 
6907
+ var CLIPPED_RESULT_FILL_OPACITY = 0.4;
6908
+ var MASKED_FILL_OPACITY_KEY = 'maskedFillOpacity';
6909
+ var getDrawnFeatureIndexes = function getDrawnFeatureIndexes(geoJSON) {
6910
+ return geoJSON.features.reduce(function (indexes, feature, index) {
6911
+ return isGeoJSONGeometryEmpty(feature) ? indexes : [].concat(indexes, [index]);
6912
+ }, []);
6913
+ };
6914
+ var getFeatureIndexesToHideFill = function getFeatureIndexesToHideFill(geoJSON) {
6915
+ return getDrawnFeatureIndexes(geoJSON).filter(function (index) {
6916
+ var _geoJSON$features$ind;
6917
+ return ((_geoJSON$features$ind = geoJSON.features[index].properties) == null ? void 0 : _geoJSON$features$ind['fill-opacity']) !== 0;
6918
+ });
6919
+ };
6920
+ var getFeatureIndexesToRestoreFill = function getFeatureIndexesToRestoreFill(geoJSON) {
6921
+ return geoJSON.features.reduce(function (indexes, feature, index) {
6922
+ var _feature$properties;
6923
+ return ((_feature$properties = feature.properties) == null ? void 0 : _feature$properties[MASKED_FILL_OPACITY_KEY]) !== undefined ? [].concat(indexes, [index]) : indexes;
6924
+ }, []);
6925
+ };
6926
+ var restoreMaskedFillProperties = function restoreMaskedFillProperties(properties) {
6927
+ if ((properties == null ? void 0 : properties[MASKED_FILL_OPACITY_KEY]) === undefined) {
6928
+ return properties;
6929
+ }
6930
+ var fillOpacity = properties[MASKED_FILL_OPACITY_KEY],
6931
+ restProperties = _objectWithoutPropertiesLoose(properties, [MASKED_FILL_OPACITY_KEY].map(_toPropertyKey));
6932
+ return fillOpacity === null ? omit(restProperties, 'fill-opacity') : Object.assign({}, restProperties, {
6933
+ 'fill-opacity': fillOpacity
6934
+ });
6935
+ };
6936
+ var restoreMaskedFill = function restoreMaskedFill(geoJSON) {
6937
+ return Object.assign({}, geoJSON, {
6938
+ features: geoJSON.features.map(function (feature) {
6939
+ return Object.assign({}, feature, {
6940
+ properties: restoreMaskedFillProperties(feature.properties)
6941
+ });
6942
+ })
6943
+ });
6944
+ };
6945
+ var maskPolygonCache = new WeakMap();
6946
+ var maskPartsCache = new WeakMap();
6947
+ var clippedGeometryCache = new WeakMap();
6948
+ var isPolygonFeature = function isPolygonFeature(feature) {
6949
+ var _feature$geometry, _feature$geometry2;
6950
+ return ((_feature$geometry = feature.geometry) == null ? void 0 : _feature$geometry.type) === 'Polygon' || ((_feature$geometry2 = feature.geometry) == null ? void 0 : _feature$geometry2.type) === 'MultiPolygon';
6951
+ };
6952
+ var getMaskPolygon = function getMaskPolygon(mask) {
6953
+ var _polygons$;
6954
+ var cachedMaskPolygon = maskPolygonCache.get(mask);
6955
+ if (cachedMaskPolygon !== undefined) {
6956
+ return cachedMaskPolygon;
6957
+ }
6958
+ var polygons = mask.features.filter(isPolygonFeature);
6959
+ var maskPolygon = polygons.length > 1 ? union(featureCollection(polygons)) : (_polygons$ = polygons[0]) != null ? _polygons$ : null;
6960
+ maskPolygonCache.set(mask, maskPolygon);
6961
+ return maskPolygon;
6962
+ };
6963
+ var getMaskParts = function getMaskParts(mask) {
6964
+ var cachedMaskParts = maskPartsCache.get(mask);
6965
+ if (cachedMaskParts) {
6966
+ return cachedMaskParts;
6967
+ }
6968
+ var maskParts = mask.features.filter(isPolygonFeature).map(function (polygon) {
6969
+ return {
6970
+ polygon: polygon,
6971
+ bbox: bbox(polygon)
6972
+ };
6973
+ });
6974
+ maskPartsCache.set(mask, maskParts);
6975
+ return maskParts;
6976
+ };
6977
+ var padBBox = function padBBox(geometryBBox) {
6978
+ return buffer(geometryBBox, Math.max(getWidth(geometryBBox), getHeight(geometryBBox)) * 0.01 + 1e-6);
6979
+ };
6980
+ var removeEmptyRings = function removeEmptyRings(polygon) {
6981
+ var isRing = function isRing(ring) {
6982
+ return ring.length > 3;
6983
+ };
6984
+ if (polygon.geometry.type === 'Polygon') {
6985
+ return Object.assign({}, polygon, {
6986
+ geometry: Object.assign({}, polygon.geometry, {
6987
+ coordinates: polygon.geometry.coordinates.filter(isRing)
6988
+ })
6989
+ });
6990
+ }
6991
+ return Object.assign({}, polygon, {
6992
+ geometry: Object.assign({}, polygon.geometry, {
6993
+ coordinates: polygon.geometry.coordinates.map(function (rings) {
6994
+ return rings.filter(isRing);
6995
+ }).filter(function (rings) {
6996
+ return rings.length > 0;
6997
+ })
6998
+ })
6999
+ });
7000
+ };
7001
+ var getMaskPolygonInBBox = function getMaskPolygonInBBox(maskPolygon, maskBBox, geometryBBox) {
7002
+ if (!intersects(maskBBox, geometryBBox)) {
7003
+ return null;
7004
+ }
7005
+ var clippedMask = removeEmptyRings(bboxClip(maskPolygon, padBBox(geometryBBox)));
7006
+ return clippedMask.geometry.coordinates.length ? clippedMask : null;
7007
+ };
7008
+ var isPointInMask = function isPointInMask(position, maskPolygon) {
7009
+ return booleanPointInPolygon(position, maskPolygon);
7010
+ };
7011
+ var clipLine = function clipLine(coordinates, maskPolygon, splitterPolygon) {
7012
+ var line = {
7013
+ type: 'Feature',
7014
+ properties: {},
7015
+ geometry: {
7016
+ type: 'LineString',
7017
+ coordinates: coordinates
7018
+ }
7019
+ };
7020
+ var outline = polygonToLine(splitterPolygon);
7021
+ var outlines = outline.type === 'FeatureCollection' ? outline.features : [outline];
7022
+ var segments = outlines.reduce(function (currentSegments, splitter) {
7023
+ return currentSegments.flatMap(function (segment) {
7024
+ var split = lineSplit(segment, splitter);
7025
+ return split.features.length ? split.features : [segment];
7026
+ });
7027
+ }, [line]);
7028
+ return segments.filter(function (segment) {
7029
+ var midpoint = along(segment, length(segment) / 2);
7030
+ return isPointInMask(midpoint.geometry.coordinates, maskPolygon);
7031
+ }).map(function (segment) {
7032
+ return segment.geometry.coordinates;
7033
+ });
7034
+ };
7035
+ var isPointInAnyMaskPart = function isPointInAnyMaskPart(position, mask) {
7036
+ return getMaskParts(mask).some(function (part) {
7037
+ return isPointInMask(position, part.polygon);
7038
+ });
7039
+ };
7040
+ var clipGeometry = function clipGeometry(geometry, mask) {
7041
+ switch (geometry.type) {
7042
+ case 'Polygon':
7043
+ case 'MultiPolygon':
7044
+ {
7045
+ var _union$geometry, _union;
7046
+ var geometryBBox = bbox(geometry);
7047
+ var feature = {
7048
+ type: 'Feature',
7049
+ properties: {},
7050
+ geometry: geometry
7051
+ };
7052
+ var clippedParts = getMaskParts(mask).reduce(function (result, part) {
7053
+ var maskInBBox = getMaskPolygonInBBox(part.polygon, part.bbox, geometryBBox);
7054
+ var clippedPart = maskInBBox && intersect(featureCollection([feature, maskInBBox]));
7055
+ return clippedPart ? [].concat(result, [clippedPart]) : result;
7056
+ }, []);
7057
+ if (clippedParts.length <= 1) {
7058
+ var _clippedParts$0$geome, _clippedParts$;
7059
+ return (_clippedParts$0$geome = (_clippedParts$ = clippedParts[0]) == null ? void 0 : _clippedParts$.geometry) != null ? _clippedParts$0$geome : null;
7060
+ }
7061
+ return (_union$geometry = (_union = union(featureCollection(clippedParts))) == null ? void 0 : _union.geometry) != null ? _union$geometry : null;
7062
+ }
7063
+ case 'LineString':
7064
+ case 'MultiLineString':
7065
+ {
7066
+ var maskPolygon = getMaskPolygon(mask);
7067
+ var maskInBBox = maskPolygon && getMaskPolygonInBBox(maskPolygon, bbox(maskPolygon), bbox(geometry));
7068
+ if (!maskPolygon || !maskInBBox) {
7069
+ return null;
7070
+ }
7071
+ var lines = geometry.type === 'LineString' ? [geometry.coordinates] : geometry.coordinates;
7072
+ var clipped = lines.flatMap(function (line) {
7073
+ return clipLine(line, maskPolygon, maskInBBox);
7074
+ });
7075
+ if (clipped.length === 0) {
7076
+ return null;
7077
+ }
7078
+ return clipped.length === 1 ? {
7079
+ type: 'LineString',
7080
+ coordinates: clipped[0]
7081
+ } : {
7082
+ type: 'MultiLineString',
7083
+ coordinates: clipped
7084
+ };
7085
+ }
7086
+ case 'Point':
7087
+ return isPointInAnyMaskPart(geometry.coordinates, mask) ? geometry : null;
7088
+ case 'MultiPoint':
7089
+ {
7090
+ var points = geometry.coordinates.filter(function (point) {
7091
+ return isPointInAnyMaskPart(point, mask);
7092
+ });
7093
+ return points.length ? {
7094
+ type: 'MultiPoint',
7095
+ coordinates: points
7096
+ } : null;
7097
+ }
7098
+ default:
7099
+ return geometry;
7100
+ }
7101
+ };
7102
+ var getClippedGeometry = function getClippedGeometry(geometry, mask) {
7103
+ var _clippedGeometryCache;
7104
+ var cachedByMask = (_clippedGeometryCache = clippedGeometryCache.get(geometry)) != null ? _clippedGeometryCache : new WeakMap();
7105
+ if (cachedByMask.has(mask)) {
7106
+ return cachedByMask.get(mask);
7107
+ }
7108
+ var clippedGeometry = clipGeometry(geometry, mask);
7109
+ cachedByMask.set(mask, clippedGeometry);
7110
+ clippedGeometryCache.set(geometry, cachedByMask);
7111
+ return clippedGeometry;
7112
+ };
7113
+ var clipGeoJSONWithMask = function clipGeoJSONWithMask(geoJSON, mask) {
7114
+ if (getMaskParts(mask).length === 0) {
7115
+ return Object.assign({}, geoJSON, {
7116
+ features: []
7117
+ });
7118
+ }
7119
+ var features = geoJSON.features.reduce(function (result, feature) {
7120
+ if (!feature.geometry || isGeoJSONGeometryEmpty(feature)) {
7121
+ return result;
7122
+ }
7123
+ var geometry = getClippedGeometry(feature.geometry, mask);
7124
+ return geometry ? [].concat(result, [Object.assign({}, feature, {
7125
+ geometry: geometry
7126
+ })]) : result;
7127
+ }, []);
7128
+ return Object.assign({}, geoJSON, {
7129
+ features: features
7130
+ });
7131
+ };
7132
+ var findMaskForTransformation = function findMaskForTransformation(masks, transformation) {
7133
+ if (!transformation) {
7134
+ return undefined;
7135
+ }
7136
+ var getGeometries = function getGeometries(geoJSON) {
7137
+ return geoJSON.features.map(function (feature) {
7138
+ return feature.geometry;
7139
+ });
7140
+ };
7141
+ var transformationGeometries = getGeometries(transformation.mask);
7142
+ return masks.find(function (mask) {
7143
+ return isEqual(getGeometries(mask.geoJSON), transformationGeometries);
7144
+ });
7145
+ };
7146
+ var buildClippedHighlightGeoJSON = function buildClippedHighlightGeoJSON(clipped) {
7147
+ return Object.assign({}, clipped, {
7148
+ features: clipped.features.map(function (feature, index) {
7149
+ var _feature$id;
7150
+ return Object.assign({}, feature, {
7151
+ id: "mask-result-" + ((_feature$id = feature.id) != null ? _feature$id : index),
7152
+ properties: Object.assign({}, feature.properties, {
7153
+ isReadonly: true,
7154
+ mapFeatureClass: 'default',
7155
+ isSelected: false,
7156
+ fill: '#186DFF',
7157
+ 'fill-opacity': CLIPPED_RESULT_FILL_OPACITY,
7158
+ 'stroke-width': 0,
7159
+ 'stroke-opacity': 0
7160
+ })
7161
+ });
7162
+ })
7163
+ });
7164
+ };
7165
+
7166
+ /* *
7167
+ * Licensed under the Apache License, Version 2.0 (the "License");
7168
+ * you may not use this file except in compliance with the License.
7169
+ * You may obtain a copy of the License at
7170
+ *
7171
+ * http://www.apache.org/licenses/LICENSE-2.0
7172
+ *
7173
+ * Unless required by applicable law or agreed to in writing, software
7174
+ * distributed under the License is distributed on an "AS IS" BASIS,
7175
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7176
+ * See the License for the specific language governing permissions and
7177
+ * limitations under the License.
7178
+ *
7179
+ * Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7180
+ * Copyright 2026 - Finnish Meteorological Institute (FMI)
7181
+ * Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
7182
+ * */
7183
+ var MASK_PREVIEW_FILL_OPACITY = 0;
7184
+ var getMaskPreviewLayerId = function getMaskPreviewLayerId(mapId) {
7185
+ return "drawing-mask-preview-" + mapId;
7186
+ };
7187
+ var getClippedResultLayerId = function getClippedResultLayerId(mapId) {
7188
+ return "drawing-mask-result-" + mapId;
7189
+ };
7190
+ var buildMaskPreviewGeoJSON = function buildMaskPreviewGeoJSON(mask) {
7191
+ return Object.assign({}, mask.geoJSON, {
7192
+ features: mask.geoJSON.features.map(function (feature, index) {
7193
+ var _feature$id;
7194
+ return Object.assign({}, feature, {
7195
+ id: (_feature$id = feature.id) != null ? _feature$id : "mask-" + mask.id + "-" + index,
7196
+ properties: Object.assign({}, feature.properties, {
7197
+ isReadonly: true,
7198
+ mapFeatureClass: 'default',
7199
+ isSelected: false,
7200
+ // TODO https://gitlab.com/opengeoweb/opengeoweb/-/work_items/7413: remove this property and make the hover effect based on selectionType
7201
+ selectionType: 'fir',
7202
+ fill: FEATURE_DRAW_SECONDARY_STROKE_COLOR,
7203
+ 'fill-opacity': MASK_PREVIEW_FILL_OPACITY,
7204
+ 'stroke-width': 3,
7205
+ stroke: '#F59E0B'
7206
+ })
7207
+ });
7208
+ })
7209
+ });
7210
+ };
7211
+ var useReadonlyFeatureLayer = function useReadonlyFeatureLayer(mapId, layerId, geojson) {
7212
+ var dispatch = useDispatch();
7213
+ React.useEffect(function () {
7214
+ if (!mapId) {
7215
+ return undefined;
7216
+ }
7217
+ dispatch(layerActions.addLayer({
7218
+ mapId: mapId,
7219
+ layerId: layerId,
7220
+ layer: {
7221
+ geojson: emptyGeoJSON,
7222
+ layerType: LayerType.featureLayer,
7223
+ isSelectable: false,
7224
+ isInEditMode: false,
7225
+ enabled: true
7226
+ },
7227
+ origin: 'warnings-lib'
7228
+ }));
7229
+ return function () {
7230
+ dispatch(layerActions.layerDelete({
7231
+ layerId: layerId,
7232
+ mapId: mapId
7233
+ }));
7234
+ };
7235
+ }, [dispatch, layerId, mapId]);
7236
+ React.useEffect(function () {
7237
+ if (mapId) {
7238
+ dispatch(layerActions.layerChangeGeojson({
7239
+ layerId: layerId,
7240
+ geojson: geojson
7241
+ }));
7242
+ }
7243
+ }, [dispatch, geojson, layerId, mapId]);
7244
+ };
7245
+ var useMaskPreviewLayer = function useMaskPreviewLayer(mapId, mask) {
7246
+ var geojson = React.useMemo(function () {
7247
+ return mask ? buildMaskPreviewGeoJSON(mask) : emptyGeoJSON;
7248
+ }, [mask]);
7249
+ useReadonlyFeatureLayer(mapId, getMaskPreviewLayerId(mapId), geojson);
7250
+ };
7251
+ var useClippedResultLayer = function useClippedResultLayer(mapId, clippedGeoJSON) {
7252
+ var geojson = React.useMemo(function () {
7253
+ return clippedGeoJSON ? buildClippedHighlightGeoJSON(clippedGeoJSON) : emptyGeoJSON;
7254
+ }, [clippedGeoJSON]);
7255
+ useReadonlyFeatureLayer(mapId, getClippedResultLayerId(mapId), geojson);
7256
+ };
7257
+
6534
7258
  /* *
6535
7259
  * Licensed under the Apache License, Version 2.0 (the "License");
6536
7260
  * you may not use this file except in compliance with the License.
@@ -6604,7 +7328,149 @@ var useSelectDrawFeature = function useSelectDrawFeature(layerId) {
6604
7328
  }, [dispatch, geoJSON, layerId, selectedFeatureIds]);
6605
7329
  };
6606
7330
 
7331
+ var emptyMasks = [];
7332
+ var SAVED_MASK_ID = 'saved-mask';
7333
+ var useRestoreSavedMask = function useRestoreSavedMask(drawingId, masks, isLoadingMasks, onRestoreMask) {
7334
+ var _useWarningsTranslati = useWarningsTranslation(),
7335
+ t = _useWarningsTranslati.t;
7336
+ var _useDrawingDetails = useDrawingDetails(drawingId),
7337
+ drawingDetails = _useDrawingDetails.data;
7338
+ var restoredDrawingIdRef = React.useRef(undefined);
7339
+ var _React$useState = React.useState(),
7340
+ unmatchedSavedMask = _React$useState[0],
7341
+ setUnmatchedSavedMask = _React$useState[1];
7342
+ React.useEffect(function () {
7343
+ if (!drawingId || restoredDrawingIdRef.current === drawingId || (drawingDetails == null ? void 0 : drawingDetails.id) !== drawingId || isLoadingMasks) {
7344
+ return;
7345
+ }
7346
+ restoredDrawingIdRef.current = drawingId;
7347
+ var savedMask = findMaskForTransformation(masks, drawingDetails.transformation);
7348
+ if (savedMask) {
7349
+ onRestoreMask(savedMask.id);
7350
+ return;
7351
+ }
7352
+ if (drawingDetails.transformation) {
7353
+ setUnmatchedSavedMask({
7354
+ id: SAVED_MASK_ID,
7355
+ objectName: t('drawing-tool-form-mask-saved'),
7356
+ geoJSON: drawingDetails.transformation.mask,
7357
+ lastUpdatedTime: drawingDetails.lastUpdatedTime,
7358
+ scope: 'user'
7359
+ });
7360
+ onRestoreMask(SAVED_MASK_ID);
7361
+ }
7362
+ }, [drawingDetails, drawingId, isLoadingMasks, masks, onRestoreMask, t]);
7363
+ return unmatchedSavedMask;
7364
+ };
7365
+ var useClippedGeoJSON = function useClippedGeoJSON(mapId, geoJSON, mask) {
7366
+ var result = React.useMemo(function () {
7367
+ if (!mask || !geoJSON) {
7368
+ return {};
7369
+ }
7370
+ try {
7371
+ return {
7372
+ clippedGeoJSON: clipGeoJSONWithMask(geoJSON, mask.geoJSON)
7373
+ };
7374
+ } catch (_unused) {
7375
+ return {
7376
+ hasClipError: true
7377
+ };
7378
+ }
7379
+ }, [geoJSON, mask]);
7380
+ useClippedResultLayer(mapId, result.clippedGeoJSON);
7381
+ return result;
7382
+ };
7383
+ var getMaskError = function getMaskError(_ref, geoJSON) {
7384
+ var clippedGeoJSON = _ref.clippedGeoJSON,
7385
+ hasClipError = _ref.hasClipError;
7386
+ if (hasClipError) {
7387
+ return 'drawing-tool-form-mask-clip-error';
7388
+ }
7389
+ var hasDrawnFeatures = !!geoJSON && getDrawnFeatureIndexes(geoJSON).length > 0;
7390
+ return clippedGeoJSON && hasDrawnFeatures && !clippedGeoJSON.features.length ? 'drawing-tool-form-mask-no-overlap' : undefined;
7391
+ };
7392
+ var useHideFillOutsideMask = function useHideFillOutsideMask(layerId, geoJSON, isMaskSelected) {
7393
+ var dispatch = useDispatch();
7394
+ React.useEffect(function () {
7395
+ if (!layerId || !geoJSON) {
7396
+ return;
7397
+ }
7398
+ if (isMaskSelected) {
7399
+ getFeatureIndexesToHideFill(geoJSON).forEach(function (targetFeatureIndex) {
7400
+ var _geoJSON$features$tar, _geoJSON$features$tar2, _properties;
7401
+ dispatch(layerActions.updateFeatureProperties({
7402
+ layerId: layerId,
7403
+ properties: (_properties = {
7404
+ 'fill-opacity': 0
7405
+ }, _properties[MASKED_FILL_OPACITY_KEY] = (_geoJSON$features$tar = (_geoJSON$features$tar2 = geoJSON.features[targetFeatureIndex].properties) == null ? void 0 : _geoJSON$features$tar2['fill-opacity']) != null ? _geoJSON$features$tar : null, _properties),
7406
+ targetFeatureIndex: targetFeatureIndex,
7407
+ origin: 'DrawingToolFormConnect'
7408
+ }));
7409
+ });
7410
+ return;
7411
+ }
7412
+ getFeatureIndexesToRestoreFill(geoJSON).forEach(function (targetFeatureIndex) {
7413
+ var _geoJSON$features$tar3, _geoJSON$features$tar4, _properties2;
7414
+ dispatch(layerActions.updateFeatureProperties({
7415
+ layerId: layerId,
7416
+ properties: (_properties2 = {
7417
+ 'fill-opacity': (_geoJSON$features$tar3 = (_geoJSON$features$tar4 = geoJSON.features[targetFeatureIndex].properties) == null ? void 0 : _geoJSON$features$tar4[MASKED_FILL_OPACITY_KEY]) != null ? _geoJSON$features$tar3 : undefined
7418
+ }, _properties2[MASKED_FILL_OPACITY_KEY] = undefined, _properties2),
7419
+ targetFeatureIndex: targetFeatureIndex,
7420
+ origin: 'DrawingToolFormConnect'
7421
+ }));
7422
+ });
7423
+ }, [dispatch, geoJSON, isMaskSelected, layerId]);
7424
+ };
7425
+ var useDrawingToolMasks = function useDrawingToolMasks(drawingId, geoJSON) {
7426
+ var _masks$find;
7427
+ var dispatch = useDispatch();
7428
+ var _useDrawings = useDrawings({
7429
+ keywords: 'mask'
7430
+ }),
7431
+ _useDrawings$data = _useDrawings.data,
7432
+ fetchedMasks = _useDrawings$data === void 0 ? emptyMasks : _useDrawings$data,
7433
+ isLoading = _useDrawings.isLoading;
7434
+ var _React$useState2 = React.useState(),
7435
+ selectedMaskId = _React$useState2[0],
7436
+ setSelectedMaskId = _React$useState2[1];
7437
+ var _React$useState3 = React.useState(),
7438
+ hoveredMaskId = _React$useState3[0],
7439
+ setHoveredMaskId = _React$useState3[1];
7440
+ var mapId = useSelector(function (store) {
7441
+ return uiSelectors.getDialogMapId(store, drawingDialogType);
7442
+ });
7443
+ var unmatchedSavedMask = useRestoreSavedMask(drawingId, fetchedMasks, isLoading, setSelectedMaskId);
7444
+ var masks = React.useMemo(function () {
7445
+ return unmatchedSavedMask ? [].concat(fetchedMasks, [unmatchedSavedMask]) : fetchedMasks;
7446
+ }, [fetchedMasks, unmatchedSavedMask]);
7447
+ var selectedMask = masks.find(function (mask) {
7448
+ return mask.id === selectedMaskId;
7449
+ });
7450
+ var previewMask = (_masks$find = masks.find(function (mask) {
7451
+ return mask.id === hoveredMaskId;
7452
+ })) != null ? _masks$find : selectedMask;
7453
+ useMaskPreviewLayer(mapId, previewMask);
7454
+ var clipResult = useClippedGeoJSON(mapId, geoJSON, selectedMask);
7455
+ var onSelectMask = React.useCallback(function (maskId) {
7456
+ setSelectedMaskId(maskId);
7457
+ dispatch(warningsDrawingsActions.setFormDirty({
7458
+ drawingInstanceId: drawingDialogType,
7459
+ isFormDirty: true
7460
+ }));
7461
+ }, [dispatch]);
7462
+ return {
7463
+ masks: masks,
7464
+ isLoading: isLoading,
7465
+ selectedMask: selectedMask,
7466
+ selectedMaskId: selectedMaskId,
7467
+ maskError: getMaskError(clipResult, geoJSON),
7468
+ onSelectMask: onSelectMask,
7469
+ onHoverMask: setHoveredMaskId
7470
+ };
7471
+ };
6607
7472
  var DrawingToolFormConnect = function DrawingToolFormConnect() {
7473
+ var _drawing$id;
6608
7474
  var dispatch = useDispatch();
6609
7475
  var _useMutateSaveOrUpdat = useMutateSaveOrUpdateDrawing(),
6610
7476
  saveOrUpdateDrawing = _useMutateSaveOrUpdat.mutate,
@@ -6631,23 +7497,65 @@ var DrawingToolFormConnect = function DrawingToolFormConnect() {
6631
7497
  return getWarningFormDirty(store, drawingDialogType);
6632
7498
  });
6633
7499
  usePreventBrowserClose(isFormDirty || isLayerInEditMode);
7500
+ var _useDrawingToolMasks = useDrawingToolMasks((_drawing$id = drawing == null ? void 0 : drawing.id) != null ? _drawing$id : '', layerFeatureGeoJSON),
7501
+ masks = _useDrawingToolMasks.masks,
7502
+ isLoadingMasks = _useDrawingToolMasks.isLoading,
7503
+ selectedMask = _useDrawingToolMasks.selectedMask,
7504
+ selectedMaskId = _useDrawingToolMasks.selectedMaskId,
7505
+ maskError = _useDrawingToolMasks.maskError,
7506
+ onSelectMask = _useDrawingToolMasks.onSelectMask,
7507
+ onHoverMask = _useDrawingToolMasks.onHoverMask;
7508
+ useHideFillOutsideMask(drawTool == null ? void 0 : drawTool.geoJSONLayerId, layerFeatureGeoJSON, !!selectedMask);
7509
+ var formGeoJSONRef = React.useRef(undefined);
7510
+ var formGeoJSON = React.useMemo(function () {
7511
+ var restoredGeoJSON = layerFeatureGeoJSON && restoreMaskedFill(layerFeatureGeoJSON);
7512
+ if (!isEqual(formGeoJSONRef.current, restoredGeoJSON)) {
7513
+ formGeoJSONRef.current = restoredGeoJSON;
7514
+ }
7515
+ return formGeoJSONRef.current;
7516
+ }, [layerFeatureGeoJSON]);
7517
+ var geoJSONProperties = React.useMemo(function () {
7518
+ return restoreMaskedFillProperties(featureLayerGeoJSONProperties);
7519
+ }, [featureLayerGeoJSONProperties]);
6634
7520
  var onSubmitForm = React.useCallback(function (formValues) {
7521
+ var original = formValues.geoJSON;
6635
7522
  saveOrUpdateDrawing({
6636
7523
  id: drawing == null ? void 0 : drawing.id,
6637
- data: {
6638
- geoJSON: formValues.geoJSON,
7524
+ data: Object.assign({
7525
+ geoJSON: selectedMask ? clipGeoJSONWithMask(original, selectedMask.geoJSON) : original,
6639
7526
  objectName: formValues.objectName,
6640
7527
  scope: 'user'
6641
- }
7528
+ }, selectedMask && {
7529
+ transformation: {
7530
+ mask: selectedMask.geoJSON,
7531
+ original: original
7532
+ }
7533
+ })
6642
7534
  });
6643
- }, [drawing == null ? void 0 : drawing.id, saveOrUpdateDrawing]);
7535
+ }, [drawing == null ? void 0 : drawing.id, saveOrUpdateDrawing, selectedMask]);
6644
7536
  var onChangeGeoJSONProperties = React.useCallback(function (properties) {
7537
+ var layerId = drawTool == null ? void 0 : drawTool.geoJSONLayerId;
6645
7538
  dispatch(layerActions.updateFeatureProperties({
6646
- layerId: drawTool == null ? void 0 : drawTool.geoJSONLayerId,
7539
+ layerId: layerId,
6647
7540
  properties: properties,
6648
7541
  origin: 'DrawingToolFormConnect'
6649
7542
  }));
6650
- }, [dispatch, drawTool == null ? void 0 : drawTool.geoJSONLayerId]);
7543
+ var fillOpacity = properties == null ? void 0 : properties['fill-opacity'];
7544
+ if (!selectedMask || typeof fillOpacity !== 'number') {
7545
+ return;
7546
+ }
7547
+ getDrawnFeatureIndexes(layerFeatureGeoJSON != null ? layerFeatureGeoJSON : emptyGeoJSON).forEach(function (targetFeatureIndex) {
7548
+ var _properties3;
7549
+ dispatch(layerActions.updateFeatureProperties({
7550
+ layerId: layerId,
7551
+ properties: (_properties3 = {
7552
+ 'fill-opacity': 0
7553
+ }, _properties3[MASKED_FILL_OPACITY_KEY] = fillOpacity, _properties3),
7554
+ targetFeatureIndex: targetFeatureIndex,
7555
+ origin: 'DrawingToolFormConnect'
7556
+ }));
7557
+ });
7558
+ }, [dispatch, drawTool == null ? void 0 : drawTool.geoJSONLayerId, layerFeatureGeoJSON, selectedMask]);
6651
7559
  var onChangeObjectName = React.useCallback(function (featureId, objectName) {
6652
7560
  var _layerFeatureGeoJSON$;
6653
7561
  var featureIndex = ((_layerFeatureGeoJSON$ = layerFeatureGeoJSON == null ? void 0 : layerFeatureGeoJSON.features) != null ? _layerFeatureGeoJSON$ : []).findIndex(function (feature) {
@@ -6711,11 +7619,14 @@ var DrawingToolFormConnect = function DrawingToolFormConnect() {
6711
7619
  dialogError: error == null ? void 0 : error.message,
6712
7620
  drawModes: drawTool == null ? void 0 : drawTool.drawModes,
6713
7621
  drawingName: drawing == null ? void 0 : drawing.objectName,
6714
- geoJSON: layerFeatureGeoJSON,
6715
- geoJSONProperties: featureLayerGeoJSONProperties,
7622
+ geoJSON: formGeoJSON,
7623
+ geoJSONProperties: geoJSONProperties,
6716
7624
  id: drawing == null ? void 0 : drawing.id,
6717
7625
  isInEditMode: isLayerInEditMode,
6718
7626
  isLoading: isPending,
7627
+ isLoadingMasks: isLoadingMasks,
7628
+ maskError: maskError,
7629
+ masks: masks,
6719
7630
  onChangeDrawMode: onChangeDrawMode,
6720
7631
  onChangeName: onChangeName,
6721
7632
  onChangeObjectName: onChangeObjectName,
@@ -6723,8 +7634,11 @@ var DrawingToolFormConnect = function DrawingToolFormConnect() {
6723
7634
  onDeactivateTool: onDeactivateTool,
6724
7635
  onDeleteFeature: onDeleteFeature,
6725
7636
  onFormDirty: onChangeFormDirty,
7637
+ onHoverMask: onHoverMask,
6726
7638
  onSelectFeature: onSelectFeature,
6727
- onSubmitForm: onSubmitForm
7639
+ onSelectMask: onSelectMask,
7640
+ onSubmitForm: onSubmitForm,
7641
+ selectedMaskId: selectedMaskId
6728
7642
  });
6729
7643
  };
6730
7644
 
@@ -8773,6 +9687,43 @@ var AreaDrawingLoader = function AreaDrawingLoader(_ref) {
8773
9687
  });
8774
9688
  };
8775
9689
 
9690
+ /* *
9691
+ * Licensed under the Apache License, Version 2.0 (the "License");
9692
+ * you may not use this file except in compliance with the License.
9693
+ * You may obtain a copy of the License at
9694
+ *
9695
+ * http://www.apache.org/licenses/LICENSE-2.0
9696
+ *
9697
+ * Unless required by applicable law or agreed to in writing, software
9698
+ * distributed under the License is distributed on an "AS IS" BASIS,
9699
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9700
+ * See the License for the specific language governing permissions and
9701
+ * limitations under the License.
9702
+ *
9703
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9704
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
9705
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9706
+ * */
9707
+ var EMPTY_WARNINGS_EVENT_FORM_STATE = {};
9708
+ var selectWarningsEventFormState = function selectWarningsEventFormState(store) {
9709
+ if (store != null && store.warningsEventForm) {
9710
+ return store.warningsEventForm;
9711
+ }
9712
+ return EMPTY_WARNINGS_EVENT_FORM_STATE;
9713
+ };
9714
+ var getWarningEvent = createSelector(selectWarningsEventFormState, function (store) {
9715
+ return store == null ? void 0 : store.event;
9716
+ });
9717
+ var getSelectedEventId = createSelector(selectWarningsEventFormState, function (store) {
9718
+ return (store == null ? void 0 : store.selectedEventId) || '';
9719
+ });
9720
+ var getWarningsEventIsFormDirty = createSelector(selectWarningsEventFormState, function (store) {
9721
+ return (store == null ? void 0 : store.isFormDirty) || false;
9722
+ });
9723
+ var getWarningsEventSelectedDrawing = createSelector(selectWarningsEventFormState, function (store) {
9724
+ return store == null ? void 0 : store.selectedDrawing;
9725
+ });
9726
+
8776
9727
  var EXTENT_PADDING = 50;
8777
9728
  var DEFAULT_SIZE$1 = {
8778
9729
  height: '200px',
@@ -8821,7 +9772,9 @@ var WarningsMapView = function WarningsMapView(_ref) {
8821
9772
  _ref$showMapMousePosi = _ref.showMapMousePosition,
8822
9773
  showMapMousePosition = _ref$showMapMousePosi === void 0 ? true : _ref$showMapMousePosi,
8823
9774
  _ref$showZoomControls = _ref.showZoomControls,
8824
- showZoomControls = _ref$showZoomControls === void 0 ? true : _ref$showZoomControls;
9775
+ showZoomControls = _ref$showZoomControls === void 0 ? true : _ref$showZoomControls,
9776
+ clickOnFeature = _ref.clickOnFeature,
9777
+ hoverSelect = _ref.hoverSelect;
8825
9778
  var containerRef = useRef(null);
8826
9779
  var defaultMapPresetBbox = geojsonFeature != null && geojsonFeature.features.length ? undefined : defaultBbox;
8827
9780
  var defaultBbox$1 = (defaultMapPreset == null ? void 0 : defaultMapPreset.proj) || defaultMapPresetBbox;
@@ -8876,9 +9829,15 @@ var WarningsMapView = function WarningsMapView(_ref) {
8876
9829
  // fallback
8877
9830
  viewUtils.setViewFromFeature(view, geojsonFeature);
8878
9831
  }, [defaultBbox$1, geojsonFeature, geojsonExtent, view]);
9832
+ var defaultBboxBounds = defaultBbox$1 == null ? void 0 : defaultBbox$1.bbox;
9833
+ var bboxKey = defaultBboxBounds ? [defaultBboxBounds.left, defaultBboxBounds.bottom, defaultBboxBounds.right, defaultBboxBounds.top].join(',') : '';
9834
+ var extentKey = geojsonExtent ? geojsonExtent.join(',') : '';
9835
+ var fitKey = viewSrs + "|" + bboxKey + "|" + extentKey;
9836
+ var fitViewToExtentRef = React.useRef(fitViewToExtent);
9837
+ fitViewToExtentRef.current = fitViewToExtent;
8879
9838
  React.useEffect(function () {
8880
- fitViewToExtent();
8881
- }, [fitViewToExtent]);
9839
+ fitViewToExtentRef.current();
9840
+ }, [fitKey, view]);
8882
9841
  return jsx("div", {
8883
9842
  ref: containerRef,
8884
9843
  style: size,
@@ -8897,7 +9856,9 @@ var WarningsMapView = function WarningsMapView(_ref) {
8897
9856
  }), !isSnapshot && jsx(OpenLayersLayer, Object.assign({}, defaultBaseLayer, {
8898
9857
  id: mapId + "_baseLayer"
8899
9858
  })), !!warningLayer.geojson && jsx(OpenLayersFeatureLayer, {
9859
+ clickOnFeature: clickOnFeature,
8900
9860
  featureCollection: warningLayer.geojson,
9861
+ hoverSelect: hoverSelect,
8901
9862
  style: genericOpenLayersFeatureStyle,
8902
9863
  zIndex: 1000
8903
9864
  }), !isSnapshot && jsx(OpenLayersLayer, Object.assign({}, defaultOverLayer, {
@@ -11409,7 +12370,8 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
11409
12370
  });
11410
12371
  };
11411
12372
 
11412
- var _excluded$7 = ["IS_DRAFT", "object", "translation-select"];
12373
+ var _excluded$7 = ["IS_DRAFT", "object", "translation-select"],
12374
+ _excluded2$1 = ["isSelected", "highlightSelectedFeature", "boxSelectPreview"];
11413
12375
  var getEmptyPublicWarning = function getEmptyPublicWarning() {
11414
12376
  var currentTime = new Date();
11415
12377
  var validFromTime = dateUtils.add(currentTime, {
@@ -11531,7 +12493,7 @@ isAviationWarning) {
11531
12493
  }
11532
12494
  return Object.assign({}, geoJSON, {
11533
12495
  features: geoJSON.features.map(function (feature) {
11534
- var _feature$properties2, _feature$properties3;
12496
+ var _feature$properties2;
11535
12497
  var colors;
11536
12498
  if (isAviationWarning) {
11537
12499
  var _feature$properties$i, _feature$properties;
@@ -11558,86 +12520,91 @@ isAviationWarning) {
11558
12520
  'stroke-width': 2,
11559
12521
  'stroke-opacity': 1
11560
12522
  };
12523
+ var _ref5 = (_feature$properties2 = feature.properties) != null ? _feature$properties2 : {};
12524
+ _ref5.isSelected;
12525
+ _ref5.highlightSelectedFeature;
12526
+ _ref5.boxSelectPreview;
12527
+ var featureProperties = _objectWithoutPropertiesLoose(_ref5, _excluded2$1);
11561
12528
  return Object.assign({}, feature, {
11562
- properties: Object.assign({}, defaultProperties, feature.properties, {
11563
- fill: colors.color || ((_feature$properties2 = feature.properties) == null ? void 0 : _feature$properties2.fill),
11564
- stroke: colors.color || ((_feature$properties3 = feature.properties) == null ? void 0 : _feature$properties3.stroke)
12529
+ properties: Object.assign({}, defaultProperties, featureProperties, {
12530
+ fill: colors.color || featureProperties.fill,
12531
+ stroke: colors.color || featureProperties.stroke
11565
12532
  })
11566
12533
  });
11567
12534
  })
11568
12535
  });
11569
12536
  }
11570
- var Form = function Form(_ref5) {
12537
+ var Form = function Form(_ref6) {
11571
12538
  var _publicWarningDetails, _publicWarningDetails2;
11572
- var defaultMapPreset = _ref5.defaultMapPreset,
11573
- _ref5$onSaveForm = _ref5.onSaveForm,
11574
- onSaveForm = _ref5$onSaveForm === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
12539
+ var defaultMapPreset = _ref6.defaultMapPreset,
12540
+ _ref6$onSaveForm = _ref6.onSaveForm,
12541
+ onSaveForm = _ref6$onSaveForm === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
11575
12542
  return _regenerator().w(function (_context) {
11576
12543
  while (1) switch (_context.n) {
11577
12544
  case 0:
11578
12545
  return _context.a(2, null);
11579
12546
  }
11580
12547
  }, _callee);
11581
- })) : _ref5$onSaveForm,
11582
- _ref5$onPublishForm = _ref5.onPublishForm,
11583
- onPublishForm = _ref5$onPublishForm === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
12548
+ })) : _ref6$onSaveForm,
12549
+ _ref6$onPublishForm = _ref6.onPublishForm,
12550
+ onPublishForm = _ref6$onPublishForm === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
11584
12551
  return _regenerator().w(function (_context2) {
11585
12552
  while (1) switch (_context2.n) {
11586
12553
  case 0:
11587
12554
  return _context2.a(2, null);
11588
12555
  }
11589
12556
  }, _callee2);
11590
- })) : _ref5$onPublishForm,
11591
- _ref5$onClearForm = _ref5.onClearForm,
11592
- onClearForm = _ref5$onClearForm === void 0 ? function () {} : _ref5$onClearForm,
11593
- _ref5$onCloseForm = _ref5.onCloseForm,
11594
- onCloseForm = _ref5$onCloseForm === void 0 ? function () {} : _ref5$onCloseForm,
11595
- _ref5$onSaveAviationF = _ref5.onSaveAviationForm,
11596
- onSaveAviationForm = _ref5$onSaveAviationF === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
12557
+ })) : _ref6$onPublishForm,
12558
+ _ref6$onClearForm = _ref6.onClearForm,
12559
+ onClearForm = _ref6$onClearForm === void 0 ? function () {} : _ref6$onClearForm,
12560
+ _ref6$onCloseForm = _ref6.onCloseForm,
12561
+ onCloseForm = _ref6$onCloseForm === void 0 ? function () {} : _ref6$onCloseForm,
12562
+ _ref6$onSaveAviationF = _ref6.onSaveAviationForm,
12563
+ onSaveAviationForm = _ref6$onSaveAviationF === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
11597
12564
  return _regenerator().w(function (_context3) {
11598
12565
  while (1) switch (_context3.n) {
11599
12566
  case 0:
11600
12567
  return _context3.a(2, null);
11601
12568
  }
11602
12569
  }, _callee3);
11603
- })) : _ref5$onSaveAviationF,
11604
- object = _ref5.object,
11605
- publicWarningDetails = _ref5.publicWarningDetails,
11606
- _ref5$error = _ref5.error,
11607
- error = _ref5$error === void 0 ? {
12570
+ })) : _ref6$onSaveAviationF,
12571
+ object = _ref6.object,
12572
+ publicWarningDetails = _ref6.publicWarningDetails,
12573
+ _ref6$error = _ref6.error,
12574
+ error = _ref6$error === void 0 ? {
11608
12575
  severity: 'error',
11609
12576
  message: ''
11610
- } : _ref5$error,
11611
- _ref5$isReadOnly = _ref5.isReadOnly,
11612
- isReadOnly = _ref5$isReadOnly === void 0 ? false : _ref5$isReadOnly,
11613
- _ref5$onFormDirty = _ref5.onFormDirty,
11614
- onFormDirty = _ref5$onFormDirty === void 0 ? function () {} : _ref5$onFormDirty,
11615
- _ref5$isSnapshot = _ref5.isSnapshot,
11616
- isSnapshot = _ref5$isSnapshot === void 0 ? false : _ref5$isSnapshot,
11617
- _ref5$onAddDrawing = _ref5.onAddDrawing,
11618
- onAddDrawing = _ref5$onAddDrawing === void 0 ? function () {} : _ref5$onAddDrawing,
11619
- selectedAviationProduct = _ref5.selectedAviationProduct,
11620
- _ref5$warningType = _ref5.warningType,
11621
- warningType = _ref5$warningType === void 0 ? 'public' : _ref5$warningType,
11622
- mode = _ref5.mode,
11623
- formState = _ref5.formState,
11624
- _ref5$onSetViewModeRe = _ref5.onSetViewModeResetArea,
11625
- onSetViewModeResetArea = _ref5$onSetViewModeRe === void 0 ? function () {} : _ref5$onSetViewModeRe,
11626
- storedStartGeoJSON = _ref5.storedStartGeoJSON,
11627
- storedEndGeoJSON = _ref5.storedEndGeoJSON,
11628
- _ref5$setWarningLevel = _ref5.setWarningLevel,
11629
- setWarningLevel = _ref5$setWarningLevel === void 0 ? function () {} : _ref5$setWarningLevel,
11630
- _ref5$linkedMapIds = _ref5.linkedMapIds,
11631
- linkedMapIds = _ref5$linkedMapIds === void 0 ? [] : _ref5$linkedMapIds,
11632
- _ref5$onDrawPolygon = _ref5.onDrawPolygon,
11633
- onDrawPolygon = _ref5$onDrawPolygon === void 0 ? function () {} : _ref5$onDrawPolygon,
11634
- _ref5$onDeletePolygon = _ref5.onDeletePolygon,
11635
- onDeletePolygon = _ref5$onDeletePolygon === void 0 ? function () {} : _ref5$onDeletePolygon,
11636
- _ref5$isDrawPolygonAc = _ref5.isDrawPolygonActive,
11637
- isDrawPolygonActive = _ref5$isDrawPolygonAc === void 0 ? false : _ref5$isDrawPolygonAc,
11638
- _ref5$isDrawingModeAc = _ref5.isDrawingModeActive,
11639
- isDrawingModeActive = _ref5$isDrawingModeAc === void 0 ? false : _ref5$isDrawingModeAc,
11640
- publicWarningStatus = _ref5.publicWarningStatus;
12577
+ } : _ref6$error,
12578
+ _ref6$isReadOnly = _ref6.isReadOnly,
12579
+ isReadOnly = _ref6$isReadOnly === void 0 ? false : _ref6$isReadOnly,
12580
+ _ref6$onFormDirty = _ref6.onFormDirty,
12581
+ onFormDirty = _ref6$onFormDirty === void 0 ? function () {} : _ref6$onFormDirty,
12582
+ _ref6$isSnapshot = _ref6.isSnapshot,
12583
+ isSnapshot = _ref6$isSnapshot === void 0 ? false : _ref6$isSnapshot,
12584
+ _ref6$onAddDrawing = _ref6.onAddDrawing,
12585
+ onAddDrawing = _ref6$onAddDrawing === void 0 ? function () {} : _ref6$onAddDrawing,
12586
+ selectedAviationProduct = _ref6.selectedAviationProduct,
12587
+ _ref6$warningType = _ref6.warningType,
12588
+ warningType = _ref6$warningType === void 0 ? 'public' : _ref6$warningType,
12589
+ mode = _ref6.mode,
12590
+ formState = _ref6.formState,
12591
+ _ref6$onSetViewModeRe = _ref6.onSetViewModeResetArea,
12592
+ onSetViewModeResetArea = _ref6$onSetViewModeRe === void 0 ? function () {} : _ref6$onSetViewModeRe,
12593
+ storedStartGeoJSON = _ref6.storedStartGeoJSON,
12594
+ storedEndGeoJSON = _ref6.storedEndGeoJSON,
12595
+ _ref6$setWarningLevel = _ref6.setWarningLevel,
12596
+ setWarningLevel = _ref6$setWarningLevel === void 0 ? function () {} : _ref6$setWarningLevel,
12597
+ _ref6$linkedMapIds = _ref6.linkedMapIds,
12598
+ linkedMapIds = _ref6$linkedMapIds === void 0 ? [] : _ref6$linkedMapIds,
12599
+ _ref6$onDrawPolygon = _ref6.onDrawPolygon,
12600
+ onDrawPolygon = _ref6$onDrawPolygon === void 0 ? function () {} : _ref6$onDrawPolygon,
12601
+ _ref6$onDeletePolygon = _ref6.onDeletePolygon,
12602
+ onDeletePolygon = _ref6$onDeletePolygon === void 0 ? function () {} : _ref6$onDeletePolygon,
12603
+ _ref6$isDrawPolygonAc = _ref6.isDrawPolygonActive,
12604
+ isDrawPolygonActive = _ref6$isDrawPolygonAc === void 0 ? false : _ref6$isDrawPolygonAc,
12605
+ _ref6$isDrawingModeAc = _ref6.isDrawingModeActive,
12606
+ isDrawingModeActive = _ref6$isDrawingModeAc === void 0 ? false : _ref6$isDrawingModeAc,
12607
+ publicWarningStatus = _ref6.publicWarningStatus;
11641
12608
  var _React$useState = React.useState(false),
11642
12609
  isPublishing = _React$useState[0],
11643
12610
  setIsPublishing = _React$useState[1];
@@ -11709,7 +12676,7 @@ var Form = function Form(_ref5) {
11709
12676
  if (!isPublishing) {
11710
12677
  toggleIsDraft(false);
11711
12678
  void handleSubmit(/*#__PURE__*/function () {
11712
- var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(data) {
12679
+ var _ref0 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(data) {
11713
12680
  return _regenerator().w(function (_context4) {
11714
12681
  while (1) switch (_context4.n) {
11715
12682
  case 0:
@@ -11724,7 +12691,7 @@ var Form = function Form(_ref5) {
11724
12691
  }, _callee4);
11725
12692
  }));
11726
12693
  return function (_x) {
11727
- return _ref9.apply(this, arguments);
12694
+ return _ref0.apply(this, arguments);
11728
12695
  };
11729
12696
  }())();
11730
12697
  }
@@ -11733,7 +12700,7 @@ var Form = function Form(_ref5) {
11733
12700
  if (!isSaving) {
11734
12701
  toggleIsDraft(true);
11735
12702
  void handleSubmit(/*#__PURE__*/function () {
11736
- var _ref0 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(data) {
12703
+ var _ref1 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(data) {
11737
12704
  return _regenerator().w(function (_context5) {
11738
12705
  while (1) switch (_context5.n) {
11739
12706
  case 0:
@@ -11748,13 +12715,13 @@ var Form = function Form(_ref5) {
11748
12715
  }, _callee5);
11749
12716
  }));
11750
12717
  return function (_x2) {
11751
- return _ref0.apply(this, arguments);
12718
+ return _ref1.apply(this, arguments);
11752
12719
  };
11753
12720
  }())();
11754
12721
  }
11755
12722
  };
11756
12723
  var showConfirmDialog = /*#__PURE__*/function () {
11757
- var _ref1 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(action) {
12724
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(action) {
11758
12725
  return _regenerator().w(function (_context6) {
11759
12726
  while (1) switch (_context6.n) {
11760
12727
  case 0:
@@ -11775,11 +12742,11 @@ var Form = function Form(_ref5) {
11775
12742
  }, _callee6);
11776
12743
  }));
11777
12744
  return function showConfirmDialog(_x3) {
11778
- return _ref1.apply(this, arguments);
12745
+ return _ref10.apply(this, arguments);
11779
12746
  };
11780
12747
  }();
11781
12748
  var cancelAviationProduct = /*#__PURE__*/function () {
11782
- var _ref10 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(warningType) {
12749
+ var _ref11 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(warningType) {
11783
12750
  var result;
11784
12751
  return _regenerator().w(function (_context7) {
11785
12752
  while (1) switch (_context7.n) {
@@ -11793,7 +12760,7 @@ var Form = function Form(_ref5) {
11793
12760
  }, _callee7);
11794
12761
  }));
11795
12762
  return function cancelAviationProduct(_x4) {
11796
- return _ref10.apply(this, arguments);
12763
+ return _ref11.apply(this, arguments);
11797
12764
  };
11798
12765
  }();
11799
12766
  var getPublishButtonLabel = function getPublishButtonLabel() {
@@ -11808,7 +12775,7 @@ var Form = function Form(_ref5) {
11808
12775
  return t('warning-button-publish');
11809
12776
  };
11810
12777
  var saveAviationDraft = /*#__PURE__*/function () {
11811
- var _ref11 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(formValues, warningType) {
12778
+ var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(formValues, warningType) {
11812
12779
  return _regenerator().w(function (_context8) {
11813
12780
  while (1) switch (_context8.n) {
11814
12781
  case 0:
@@ -11830,11 +12797,11 @@ var Form = function Form(_ref5) {
11830
12797
  }, _callee8);
11831
12798
  }));
11832
12799
  return function saveAviationDraft(_x5, _x6) {
11833
- return _ref11.apply(this, arguments);
12800
+ return _ref12.apply(this, arguments);
11834
12801
  };
11835
12802
  }();
11836
12803
  var handleSubmitAviationProduct = /*#__PURE__*/function () {
11837
- var _ref12 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(action, warningType) {
12804
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(action, warningType) {
11838
12805
  var _getFieldState$error, _getFieldState$error2, startGeometryErrorType, endGeometryErrorType, hasConfiguredIntersectionPointLimitError, _t3;
11839
12806
  return _regenerator().w(function (_context1) {
11840
12807
  while (1) switch (_context1.p = _context1.n) {
@@ -11869,7 +12836,7 @@ var Form = function Form(_ref5) {
11869
12836
  case 6:
11870
12837
  toggleIsDraft(false);
11871
12838
  void handleSubmit(/*#__PURE__*/function () {
11872
- var _ref13 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(formValues) {
12839
+ var _ref14 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(formValues) {
11873
12840
  return _regenerator().w(function (_context9) {
11874
12841
  while (1) switch (_context9.p = _context9.n) {
11875
12842
  case 0:
@@ -11905,7 +12872,7 @@ var Form = function Form(_ref5) {
11905
12872
  }, _callee9, null, [[4, 6, 7, 8], [0, 2]]);
11906
12873
  }));
11907
12874
  return function (_x9) {
11908
- return _ref13.apply(this, arguments);
12875
+ return _ref14.apply(this, arguments);
11909
12876
  };
11910
12877
  }())();
11911
12878
  return _context1.a(3, 19);
@@ -11940,7 +12907,7 @@ var Form = function Form(_ref5) {
11940
12907
  return _context1.a(3, 19);
11941
12908
  case 16:
11942
12909
  void handleSubmit(/*#__PURE__*/function () {
11943
- var _ref14 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(formValues) {
12910
+ var _ref15 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(formValues) {
11944
12911
  return _regenerator().w(function (_context0) {
11945
12912
  while (1) switch (_context0.p = _context0.n) {
11946
12913
  case 0:
@@ -11967,7 +12934,7 @@ var Form = function Form(_ref5) {
11967
12934
  }, _callee0, null, [[0,, 4, 5]]);
11968
12935
  }));
11969
12936
  return function (_x0) {
11970
- return _ref14.apply(this, arguments);
12937
+ return _ref15.apply(this, arguments);
11971
12938
  };
11972
12939
  }())();
11973
12940
  return _context1.a(3, 19);
@@ -11981,7 +12948,7 @@ var Form = function Form(_ref5) {
11981
12948
  }, _callee1, null, [[11, 13, 14, 15], [7, 9]]);
11982
12949
  }));
11983
12950
  return function handleSubmitAviationProduct(_x7, _x8) {
11984
- return _ref12.apply(this, arguments);
12951
+ return _ref13.apply(this, arguments);
11985
12952
  };
11986
12953
  }();
11987
12954
  var onPressClear = function onPressClear() {
@@ -13021,7 +13988,7 @@ var AreaDrawingLoaderConnect = function AreaDrawingLoaderConnect(_ref) {
13021
13988
  fetchAreaError = _useAreaRequest.fetchAreaError,
13022
13989
  setAreas = _useAreaRequest.setAreas,
13023
13990
  isAreasLoading = _useAreaRequest.isAreasLoading;
13024
- var selectedAreas = useSelector(function (store) {
13991
+ var publicWarningSelectedAreas = useSelector(function (store) {
13025
13992
  return getPublicWarningAreas(store);
13026
13993
  });
13027
13994
  var warningId = useSelector(function (store) {
@@ -13036,6 +14003,10 @@ var AreaDrawingLoaderConnect = function AreaDrawingLoaderConnect(_ref) {
13036
14003
  var isWarningDialogOpen = useSelector(function (store) {
13037
14004
  return uiSelectors.getisDialogOpen(store, publicWarningDialogType);
13038
14005
  });
14006
+ var isWarningEventDialogOpen = useSelector(function (store) {
14007
+ return uiSelectors.getisDialogOpen(store, warningEventDialogType);
14008
+ });
14009
+ var eventSelectedDrawing = useSelector(getWarningsEventSelectedDrawing);
13039
14010
  var hasPublicWarningDrawLayer = useSelector(function (store) {
13040
14011
  var _store$layers$allIds, _store$layers;
13041
14012
  return ((_store$layers$allIds = (_store$layers = store.layers) == null ? void 0 : _store$layers.allIds) != null ? _store$layers$allIds : []).some(function (layerId) {
@@ -13136,9 +14107,15 @@ var AreaDrawingLoaderConnect = function AreaDrawingLoaderConnect(_ref) {
13136
14107
  var onSearch = function onSearch(queryString) {
13137
14108
  return setSearchQuery(queryString);
13138
14109
  };
13139
- var onAddArea = function onAddArea(_ref4) {
13140
- var geoJSON = _ref4.geoJSON,
13141
- objectName = _ref4.objectName;
14110
+ var onAddArea = function onAddArea(drawingListItem) {
14111
+ var geoJSON = drawingListItem.geoJSON,
14112
+ objectName = drawingListItem.objectName;
14113
+ if (isWarningEventDialogOpen) {
14114
+ dispatch(warningsEventFormActions.setSelectedDrawing({
14115
+ drawing: drawingListItem
14116
+ }));
14117
+ return;
14118
+ }
13142
14119
  dispatch(warningsFormActions.addArea({
13143
14120
  area: {
13144
14121
  geoJSON: geoJSON,
@@ -13146,9 +14123,15 @@ var AreaDrawingLoaderConnect = function AreaDrawingLoaderConnect(_ref) {
13146
14123
  }
13147
14124
  }));
13148
14125
  };
13149
- var onRemoveArea = function onRemoveArea(_ref5) {
13150
- var geoJSON = _ref5.geoJSON,
13151
- objectName = _ref5.objectName;
14126
+ var onRemoveArea = function onRemoveArea(_ref4) {
14127
+ var geoJSON = _ref4.geoJSON,
14128
+ objectName = _ref4.objectName;
14129
+ if (isWarningEventDialogOpen) {
14130
+ dispatch(warningsEventFormActions.setSelectedDrawing({
14131
+ drawing: undefined
14132
+ }));
14133
+ return;
14134
+ }
13152
14135
  dispatch(warningsFormActions.removeArea({
13153
14136
  area: {
13154
14137
  geoJSON: geoJSON,
@@ -13162,6 +14145,11 @@ var AreaDrawingLoaderConnect = function AreaDrawingLoaderConnect(_ref) {
13162
14145
  }
13163
14146
  };
13164
14147
  var isChangeAreaDisabled = warningId !== undefined && typeof warningId === 'string' && warningId.length > 0 && warningStatus !== PublicWarningStatus.DRAFT && warningStatus !== PublicWarningStatus.DRAFT_PUBLISHED;
14148
+ // When opened from the warning event form, show the drawing selected on the event
14149
+ var selectedAreas = isWarningEventDialogOpen ? eventSelectedDrawing && [{
14150
+ geoJSON: eventSelectedDrawing.geoJSON,
14151
+ objectName: eventSelectedDrawing.objectName
14152
+ }] : publicWarningSelectedAreas;
13165
14153
  var drawingError = uiError ? {
13166
14154
  type: areaDrawingLoaderType,
13167
14155
  error: uiError
@@ -13190,7 +14178,7 @@ var AreaDrawingLoaderConnect = function AreaDrawingLoaderConnect(_ref) {
13190
14178
  source: uiSource,
13191
14179
  startPosition: {
13192
14180
  top: 104,
13193
- left: 50
14181
+ left: 450
13194
14182
  },
13195
14183
  title: t('area-drawing-loader-title')
13196
14184
  });
@@ -14253,16 +15241,6 @@ var EDIT_FIELD_SX = {
14253
15241
  fontSize: 16
14254
15242
  }
14255
15243
  };
14256
- // The picker displays UTC times in the local-time based MUI picker
14257
- var toPickerDate = function toPickerDate(utcDate) {
14258
- return new Date(utcDate.getTime() + utcDate.getTimezoneOffset() * 60000);
14259
- };
14260
- var toUtcDate = function toUtcDate(pickerDate) {
14261
- return new Date(pickerDate.getTime() - pickerDate.getTimezoneOffset() * 60000);
14262
- };
14263
- var OpenPickerIcon = function OpenPickerIcon() {
14264
- return jsx(CalendarToday, {});
14265
- };
14266
15244
  var TimeField = function TimeField(_ref) {
14267
15245
  var field = _ref.field,
14268
15246
  label = _ref.label,
@@ -14315,70 +15293,43 @@ var TimeField = function TimeField(_ref) {
14315
15293
  width: TIME_FIELD_WIDTH,
14316
15294
  zIndex: 4
14317
15295
  },
14318
- children: isEditing && !isActive ? jsx(LocalizationProvider, {
14319
- dateAdapter: AdapterDateFns,
14320
- children: jsx(DateTimePicker, {
14321
- ampm: false,
14322
- autoFocus: true,
14323
- desktopModeMediaQuery: "@media (min-width: 720px)",
14324
- format: dateUtils.DATE_FORMAT_DATEPICKER,
14325
- label: label,
14326
- maxDateTime: toPickerDate(maxPickerDate),
14327
- minDateTime: minPickerDate ? toPickerDate(minPickerDate) : undefined,
14328
- onAccept: function onAccept(value) {
14329
- if (isPopupOpenRef.current && value) {
14330
- onCommitSession({
14331
- field: field,
14332
- value: toUtcDate(value)
14333
- });
14334
- }
14335
- },
14336
- onChange: function onChange(value) {
14337
- if (value) {
14338
- onDraftChange(field, toUtcDate(value));
14339
- }
14340
- },
14341
- onClose: function onClose() {
14342
- isPopupOpenRef.current = false;
14343
- },
14344
- onError: function onError(reason) {
14345
- onDraftValidityChange(field, reason != null);
14346
- },
14347
- onOpen: function onOpen() {
14348
- isPopupOpenRef.current = true;
14349
- },
14350
- slotProps: {
14351
- textField: {
14352
- variant: 'filled',
14353
- error: isDraftInvalid && draft != null,
14354
- slotProps: {
14355
- input: {
14356
- endAdornment: jsx(InputAdornment, {
14357
- position: "end",
14358
- children: "UTC"
14359
- })
14360
- }
14361
- }
14362
- },
14363
- field: {
14364
- openPickerButtonPosition: 'start'
14365
- },
14366
- openPickerButton: {
14367
- size: 'small',
14368
- sx: {
14369
- padding: 0
14370
- }
14371
- }
14372
- },
14373
- slots: {
14374
- openPickerIcon: OpenPickerIcon
14375
- },
14376
- sx: EDIT_FIELD_SX,
14377
- timeSteps: {
14378
- minutes: SNAP_MINUTES
14379
- },
14380
- value: toPickerDate(shownTime)
14381
- })
15296
+ children: isEditing && !isActive ? jsx(DateTimePicker, {
15297
+ autoFocus: true,
15298
+ label: label,
15299
+ maxDateTime: maxPickerDate,
15300
+ minDateTime: minPickerDate,
15301
+ onAccept: function onAccept(value) {
15302
+ if (isPopupOpenRef.current && value) {
15303
+ onCommitSession({
15304
+ field: field,
15305
+ value: value
15306
+ });
15307
+ }
15308
+ },
15309
+ onChange: function onChange(value) {
15310
+ if (value) {
15311
+ onDraftChange(field, value);
15312
+ }
15313
+ },
15314
+ onClose: function onClose() {
15315
+ isPopupOpenRef.current = false;
15316
+ },
15317
+ onError: function onError(reason) {
15318
+ onDraftValidityChange(field, reason != null);
15319
+ },
15320
+ onOpen: function onOpen() {
15321
+ isPopupOpenRef.current = true;
15322
+ },
15323
+ slotProps: {
15324
+ textField: {
15325
+ error: isDraftInvalid && draft != null
15326
+ }
15327
+ },
15328
+ sx: EDIT_FIELD_SX,
15329
+ timeSteps: {
15330
+ minutes: SNAP_MINUTES
15331
+ },
15332
+ value: shownTime
14382
15333
  }) : jsxs(Box, {
14383
15334
  "data-testid": "warning-event-block-" + field + "-field",
14384
15335
  onDoubleClick: function onDoubleClick() {
@@ -15618,7 +16569,8 @@ var warningEventItemDefaultValues = {
15618
16569
  authority: '',
15619
16570
  phenomenon: '',
15620
16571
  type: 0,
15621
- warning_handle_uuid: ''
16572
+ warning_handle_uuid: '',
16573
+ areas: []
15622
16574
  };
15623
16575
  var buildDefaultWarningItem = function buildDefaultWarningItem(event) {
15624
16576
  var _getDefaultWarningTim = getDefaultWarningTimes(event.warningEventType),
@@ -15659,30 +16611,6 @@ var getInheritedEventFields = function getInheritedEventFields(values) {
15659
16611
  phenomenon: values.phenomenon
15660
16612
  };
15661
16613
  };
15662
- // FAKE area that is needed for the BE PUBLISH until we implement the real area functionality
15663
- var FAKE_AREAS = [{
15664
- objectName: 'Drawing name',
15665
- geoJSON: {
15666
- type: 'FeatureCollection',
15667
- features: [{
15668
- type: 'Feature',
15669
- geometry: {
15670
- type: 'Polygon',
15671
- coordinates: [[[4.62825, 53.0063], [4.82904, 53.35734], [5.78279, 53.53676], [4.8625, 52.63206], [4.47765, 52.60158], [4.62825, 53.0063]]]
15672
- },
15673
- properties: {
15674
- fill: '#fae21e',
15675
- stroke: '#fae21e',
15676
- 'fill-opacity': 0.2,
15677
- 'stroke-width': 2,
15678
- selectionType: 'poly',
15679
- warning_level: '1',
15680
- 'stroke-opacity': 1,
15681
- objectName: 'Feature name'
15682
- }
15683
- }]
15684
- }
15685
- }];
15686
16614
  var buildSubmitValues = function buildSubmitValues(values) {
15687
16615
  values.IS_DRAFT;
15688
16616
  var productToPost = _objectWithoutPropertiesLoose(values, _excluded$6);
@@ -15690,20 +16618,14 @@ var buildSubmitValues = function buildSubmitValues(values) {
15690
16618
  var eventToPost = Object.assign({}, productToPost, getEventValidity(productToPost.warnings), {
15691
16619
  warnings: productToPost.warnings.map(function (warning) {
15692
16620
  var joinedWarning = Object.assign({}, warning, inherited, {
15693
- domain: 'public',
15694
- // TODO REMOVE WHEN WE IMPLEMENT THE REAL AREAS FUNCTIONALITY
15695
- areas: FAKE_AREAS
16621
+ domain: 'public'
15696
16622
  });
15697
- // Remove empty fields from all warnings
16623
+ // Remove empty fields from all warnings, but always send `areas` (even
16624
+ // when empty) so the backend can clear areas that were removed
15698
16625
  return Object.keys(joinedWarning).reduce(function (warningDetail, fieldName) {
15699
16626
  var key = fieldName;
15700
16627
  var fieldValue = joinedWarning[key];
15701
- if (Array.isArray(fieldValue)) {
15702
- if (!fieldValue.length || fieldValue[0].geoJSON === null) {
15703
- return warningDetail;
15704
- }
15705
- }
15706
- if (fieldValue) {
16628
+ if (key === 'areas' || fieldValue) {
15707
16629
  var _Object$assign;
15708
16630
  return Object.assign({}, warningDetail, (_Object$assign = {}, _Object$assign[key] = fieldValue, _Object$assign));
15709
16631
  }
@@ -15886,7 +16808,7 @@ var probablityOptions = [{
15886
16808
  name: '60 - 90',
15887
16809
  value: 60
15888
16810
  }, {
15889
- name: '100',
16811
+ name: '90 - 100',
15890
16812
  value: 100
15891
16813
  }];
15892
16814
  var getWarningTitle = function getWarningTitle(status, areas, index, t) {
@@ -15924,12 +16846,18 @@ var WarningEventItem = function WarningEventItem(_ref) {
15924
16846
  isCompact = _ref.isCompact,
15925
16847
  _ref$isDeleteButtonDi = _ref.isDeleteButtonDisabled,
15926
16848
  isDeleteButtonDisabled = _ref$isDeleteButtonDi === void 0 ? false : _ref$isDeleteButtonDi,
16849
+ selectedDrawing = _ref.selectedDrawing,
16850
+ _ref$onAddDrawing = _ref.onAddDrawing,
16851
+ onAddDrawing = _ref$onAddDrawing === void 0 ? function () {} : _ref$onAddDrawing,
15927
16852
  onExpireWithdraw = _ref.onExpireWithdraw,
15928
16853
  onToggleCompact = _ref.onToggleCompact,
15929
16854
  onDeleteWarning = _ref.onDeleteWarning;
15930
16855
  var _React$useState = React.useState(null),
15931
16856
  menuAnchorEl = _React$useState[0],
15932
16857
  setMenuAnchorEl = _React$useState[1];
16858
+ var _React$useState2 = React.useState(null),
16859
+ menuMapAnchorEl = _React$useState2[0],
16860
+ setMenuMapAnchorEl = _React$useState2[1];
15933
16861
  var _useWarningsTranslati = useWarningsTranslation(),
15934
16862
  t = _useWarningsTranslati.t;
15935
16863
  var _useFormContext = useFormContext(),
@@ -15969,6 +16897,9 @@ var WarningEventItem = function WarningEventItem(_ref) {
15969
16897
  var _getValidationErrors2 = getValidationErrors(["warnings." + index + ".probability"], fieldErrors),
15970
16898
  hasProbabilityError = _getValidationErrors2.hasErrors,
15971
16899
  probabilityError = _getValidationErrors2.errors;
16900
+ var _getValidationErrors3 = getValidationErrors(["warnings." + index + ".areas"], fieldErrors),
16901
+ hasAreaError = _getValidationErrors3.hasErrors,
16902
+ areaError = _getValidationErrors3.errors;
15972
16903
  var revalidateOverlaps = React.useCallback(function () {
15973
16904
  var warnings = getValues('warnings');
15974
16905
  warnings.forEach(function (_warning, warningIndex) {
@@ -16000,6 +16931,76 @@ var WarningEventItem = function WarningEventItem(_ref) {
16000
16931
  }
16001
16932
  };
16002
16933
  }, [index, setValue, warningAreas, trigger, revalidateOverlaps]);
16934
+ var readOnlyWarning = isReadOnly || warningStatus === PublicWarningStatus.EXPIRED || warningStatus === PublicWarningStatus.WITHDRAWN || eventStatus === PublicWarningStatus.EXPIRED || eventStatus === PublicWarningStatus.WITHDRAWN;
16935
+ var assignedFeatureId = warningAreas == null || (_warningAreas$2 = warningAreas[0]) == null || (_warningAreas$2 = _warningAreas$2.geoJSON) == null || (_warningAreas$2 = _warningAreas$2.features) == null || (_warningAreas$2 = _warningAreas$2[0]) == null ? void 0 : _warningAreas$2.id;
16936
+ var features = React.useMemo(function () {
16937
+ var _selectedDrawing$geoJ, _selectedDrawing$geoJ2;
16938
+ return (_selectedDrawing$geoJ = selectedDrawing == null || (_selectedDrawing$geoJ2 = selectedDrawing.geoJSON) == null ? void 0 : _selectedDrawing$geoJ2.features) != null ? _selectedDrawing$geoJ : [];
16939
+ }, [selectedDrawing]);
16940
+ // Assign the object picked from the selected drawing as the area of this warning
16941
+ var onAssignFeature = React.useCallback(function (featureId) {
16942
+ var _feature$properties$o, _feature$properties;
16943
+ var feature = features.find(function (item) {
16944
+ return String(item.id) === featureId;
16945
+ });
16946
+ if (!feature || featureId === assignedFeatureId) {
16947
+ return;
16948
+ }
16949
+ var area = {
16950
+ objectName: (_feature$properties$o = (_feature$properties = feature.properties) == null ? void 0 : _feature$properties.objectName) != null ? _feature$properties$o : '',
16951
+ geoJSON: warningLevelFeatureColors(level, {
16952
+ type: 'FeatureCollection',
16953
+ features: [feature]
16954
+ })
16955
+ };
16956
+ setValue("warnings." + index + ".areas", [area], {
16957
+ shouldDirty: true
16958
+ });
16959
+ void trigger("warnings." + index + ".areas");
16960
+ }, [features, assignedFeatureId, level, index, setValue, trigger]);
16961
+ var hasAssignedArea = !!(warningAreas != null && (_warningAreas$3 = warningAreas[0]) != null && (_warningAreas$3 = _warningAreas$3.geoJSON) != null && (_warningAreas$3 = _warningAreas$3.features) != null && _warningAreas$3.length);
16962
+ // As long as no area has been assigned to this warning, show all features of the
16963
+ // selected drawing in blue. Once area is chosen, only show that one, in level color
16964
+ var displayedGeoJSON = React.useMemo(function () {
16965
+ var _selectedDrawing$geoJ3;
16966
+ if (hasAssignedArea) {
16967
+ return warningAreas[0].geoJSON;
16968
+ }
16969
+ if (!(selectedDrawing != null && (_selectedDrawing$geoJ3 = selectedDrawing.geoJSON) != null && (_selectedDrawing$geoJ3 = _selectedDrawing$geoJ3.features) != null && _selectedDrawing$geoJ3.length)) {
16970
+ return undefined;
16971
+ }
16972
+ var blueFeatures = warningLevelFeatureColors(undefined, selectedDrawing.geoJSON);
16973
+ // Outline only, no fill, as long as the feature has not been chosen
16974
+ return Object.assign({}, blueFeatures, {
16975
+ features: blueFeatures.features.map(function (feature) {
16976
+ return Object.assign({}, feature, {
16977
+ properties: Object.assign({}, feature.properties, {
16978
+ 'fill-opacity': 0
16979
+ })
16980
+ });
16981
+ })
16982
+ });
16983
+ }, [hasAssignedArea, warningAreas, selectedDrawing]);
16984
+ // Picking a feature directly on the map, only possible on an expanded, editable map
16985
+ var canPickFeatureOnMap = !isCompact && !readOnlyWarning && !hasAssignedArea && features.length > 0;
16986
+ var clickOnFeature = React.useMemo(function () {
16987
+ return canPickFeatureOnMap ? {
16988
+ onClick: function onClick(clickedFeatures) {
16989
+ var _clickedFeatures$;
16990
+ var featureId = (_clickedFeatures$ = clickedFeatures[0]) == null ? void 0 : _clickedFeatures$.getId();
16991
+ if (featureId === undefined) {
16992
+ return;
16993
+ }
16994
+ onAssignFeature(String(featureId));
16995
+ },
16996
+ hitTolerance: 5
16997
+ } : undefined;
16998
+ }, [canPickFeatureOnMap, onAssignFeature]);
16999
+ var hoverSelect = React.useMemo(function () {
17000
+ return canPickFeatureOnMap ? {
17001
+ active: true
17002
+ } : undefined;
17003
+ }, [canPickFeatureOnMap]);
16003
17004
  // Until we implement the full validation, set every field to be required when publishing
16004
17005
  var _useDraftFormHelpers = useDraftFormHelpers(),
16005
17006
  isRequired = _useDraftFormHelpers.isRequired,
@@ -16018,9 +17019,8 @@ var WarningEventItem = function WarningEventItem(_ref) {
16018
17019
  var onWithdraw = function onWithdraw() {
16019
17020
  onExpireWithdraw(PublicWarningStatus.WITHDRAWN, index);
16020
17021
  };
16021
- var readOnlyWarning = isReadOnly || warningStatus === PublicWarningStatus.EXPIRED || warningStatus === PublicWarningStatus.WITHDRAWN || eventStatus === PublicWarningStatus.EXPIRED || eventStatus === PublicWarningStatus.WITHDRAWN;
16022
17022
  var warningTitle = getWarningTitle(status, warningAreas, index, t);
16023
- var mapTitle = (warningAreas == null || (_warningAreas$2 = warningAreas[0]) == null ? void 0 : _warningAreas$2.objectName) || undefined;
17023
+ var mapTitle = (selectedDrawing == null ? void 0 : selectedDrawing.objectName) || (warningAreas == null || (_warningAreas$4 = warningAreas[0]) == null ? void 0 : _warningAreas$4.objectName) || undefined;
16024
17024
  return jsxs(Fragment, {
16025
17025
  children: [isCompact ? jsxs(Box, {
16026
17026
  sx: {
@@ -16049,7 +17049,7 @@ var WarningEventItem = function WarningEventItem(_ref) {
16049
17049
  sx: {
16050
17050
  fontSize: 14,
16051
17051
  flexShrink: 0,
16052
- width: "" + (hasValidationErrors || hasProbabilityError ? '93px' : '125px'),
17052
+ width: "" + (hasValidationErrors || hasProbabilityError || hasAreaError ? '93px' : '125px'),
16053
17053
  display: '-webkit-box',
16054
17054
  WebkitLineClamp: 2,
16055
17055
  WebkitBoxOrient: 'vertical',
@@ -16059,11 +17059,13 @@ var WarningEventItem = function WarningEventItem(_ref) {
16059
17059
  },
16060
17060
  children: warningTitle
16061
17061
  })
16062
- }), !!(hasValidationErrors || hasProbabilityError) && jsx(CustomTooltip, {
17062
+ }), !!(hasValidationErrors || hasProbabilityError || hasAreaError) && jsx(CustomTooltip, {
16063
17063
  title: t('warning-event-validation-warning-incomplete') + ": " + validationErrors.map(function (validationError) {
16064
17064
  return "" + validationError.message;
16065
17065
  }) + " " + probabilityError.map(function (validationError) {
16066
17066
  return "" + t('warning-event-validation-propbability-collapsed');
17067
+ }) + areaError.map(function (validationError) {
17068
+ return ", " + t('warning-event-validation-area-missing');
16067
17069
  }),
16068
17070
  children: jsx("span", {
16069
17071
  children: jsx(Info, {
@@ -16080,7 +17082,7 @@ var WarningEventItem = function WarningEventItem(_ref) {
16080
17082
  },
16081
17083
  children: jsx(WarningsMapView, {
16082
17084
  defaultMapPreset: defaultMapPreset,
16083
- geojsonFeature: (warningAreas == null || (_warningAreas$3 = warningAreas[0]) == null ? void 0 : _warningAreas$3.geoJSON) || undefined,
17085
+ geojsonFeature: displayedGeoJSON,
16084
17086
  isSnapshot: isSnapshot,
16085
17087
  showMapMousePosition: false,
16086
17088
  showZoomControls: false,
@@ -16167,7 +17169,7 @@ var WarningEventItem = function WarningEventItem(_ref) {
16167
17169
  },
16168
17170
  children: jsx(ReactHookFormSelect, {
16169
17171
  disabled: readOnlyWarning,
16170
- label: t('warning-probability'),
17172
+ label: t('warning-event-probability'),
16171
17173
  name: "warnings." + index + ".probability",
16172
17174
  rules: {
16173
17175
  validate: {
@@ -16294,9 +17296,33 @@ var WarningEventItem = function WarningEventItem(_ref) {
16294
17296
  height: 200,
16295
17297
  position: 'relative'
16296
17298
  },
16297
- children: [jsx(WarningsMapView, {
17299
+ children: [!!hasAreaError && jsx(Box, {
17300
+ sx: {
17301
+ position: 'absolute',
17302
+ top: '0px',
17303
+ left: '40px',
17304
+ width: 'calc(100% - 40px)',
17305
+ zIndex: 1
17306
+ },
17307
+ children: jsx(AlertBanner, {
17308
+ info: jsx(Fragment, {
17309
+ children: areaError.map(function (error, errorIndex) {
17310
+ return (
17311
+ // eslint-disable-next-line react/no-array-index-key
17312
+ jsx("div", {
17313
+ children: error.message
17314
+ }, errorIndex)
17315
+ );
17316
+ })
17317
+ }),
17318
+ severity: "error",
17319
+ title: t('warning-event-validation-warning-incomplete')
17320
+ })
17321
+ }), jsx(WarningsMapView, {
17322
+ clickOnFeature: clickOnFeature,
16298
17323
  defaultMapPreset: defaultMapPreset,
16299
- geojsonFeature: (warningAreas == null || (_warningAreas$4 = warningAreas[0]) == null ? void 0 : _warningAreas$4.geoJSON) || undefined,
17324
+ geojsonFeature: displayedGeoJSON,
17325
+ hoverSelect: hoverSelect,
16300
17326
  isSnapshot: isSnapshot,
16301
17327
  showMapMousePosition: false,
16302
17328
  size: {
@@ -16308,7 +17334,7 @@ var WarningEventItem = function WarningEventItem(_ref) {
16308
17334
  // Only show drawing loader on first warning
16309
17335
  index === 0 && jsx(CustomIconButton, {
16310
17336
  isSelected: false,
16311
- onClick: function onClick() {},
17337
+ onClick: onAddDrawing,
16312
17338
  sx: {
16313
17339
  position: 'absolute',
16314
17340
  left: 8,
@@ -16320,7 +17346,9 @@ var WarningEventItem = function WarningEventItem(_ref) {
16320
17346
  children: jsx(Polygons, {})
16321
17347
  }), jsx(CustomIconButton, {
16322
17348
  isSelected: false,
16323
- onClick: function onClick() {},
17349
+ onClick: function onClick(e) {
17350
+ return setMenuMapAnchorEl(e.currentTarget);
17351
+ },
16324
17352
  sx: {
16325
17353
  position: 'absolute',
16326
17354
  left: 8,
@@ -16330,6 +17358,67 @@ var WarningEventItem = function WarningEventItem(_ref) {
16330
17358
  tooltipTitle: t('warning-event-button-assign-object'),
16331
17359
  variant: "tool",
16332
17360
  children: jsx(Cube, {})
17361
+ }), jsx(Popover, {
17362
+ anchorEl: menuMapAnchorEl,
17363
+ anchorOrigin: {
17364
+ vertical: 'bottom',
17365
+ horizontal: 'left'
17366
+ },
17367
+ onClose: function onClose() {
17368
+ return setMenuMapAnchorEl(null);
17369
+ },
17370
+ open: Boolean(menuMapAnchorEl),
17371
+ transformOrigin: {
17372
+ vertical: 'top',
17373
+ horizontal: 'left'
17374
+ },
17375
+ children: jsxs(Box, {
17376
+ sx: {
17377
+ padding: 1
17378
+ },
17379
+ children: [jsx(Typography, {
17380
+ sx: {
17381
+ fontSize: 12,
17382
+ fontWeight: 500,
17383
+ padding: 1
17384
+ },
17385
+ children: t('warning-event-objects-menu-title')
17386
+ }), features.length > 0 ? jsx(RadioGroup, {
17387
+ name: "warnings." + index + ".areas",
17388
+ onChange: function onChange(_event, value) {
17389
+ onAssignFeature(value);
17390
+ setMenuMapAnchorEl(null);
17391
+ },
17392
+ sx: {
17393
+ paddingX: 1
17394
+ },
17395
+ value: assignedFeatureId != null ? assignedFeatureId : '',
17396
+ children: features.map(function (feature, featureIndex) {
17397
+ var _feature$properties2;
17398
+ return jsx(FormControlLabel, {
17399
+ control: jsx(Radio, {
17400
+ size: "small"
17401
+ }),
17402
+ label: (feature == null || (_feature$properties2 = feature.properties) == null ? void 0 : _feature$properties2.objectName) || t('area-drawing-manager-object-name', {
17403
+ number: featureIndex + 1
17404
+ }),
17405
+ slotProps: {
17406
+ typography: {
17407
+ sx: {
17408
+ fontSize: 14
17409
+ }
17410
+ }
17411
+ },
17412
+ value: String(feature.id)
17413
+ }, String(feature.id));
17414
+ })
17415
+ }) : jsx(Typography, {
17416
+ sx: {
17417
+ padding: 1
17418
+ },
17419
+ children: t('warning-event-objects-menu-no-objects')
17420
+ })]
17421
+ })
16333
17422
  })]
16334
17423
  })]
16335
17424
  }), !!mapTitle && jsx(Box, {
@@ -16368,7 +17457,7 @@ var WarningEventItem = function WarningEventItem(_ref) {
16368
17457
  height: '100%'
16369
17458
  },
16370
17459
  children: [jsx(CustomIconButton, {
16371
- disabled: readOnlyWarning,
17460
+ disabled: true,
16372
17461
  isSelected: false,
16373
17462
  onClick: function onClick() {},
16374
17463
  sx: {
@@ -16378,7 +17467,7 @@ var WarningEventItem = function WarningEventItem(_ref) {
16378
17467
  variant: "flat",
16379
17468
  children: jsx(DrawPolygon, {})
16380
17469
  }), jsx(CustomIconButton, {
16381
- disabled: readOnlyWarning,
17470
+ disabled: true,
16382
17471
  isSelected: false,
16383
17472
  onClick: function onClick() {},
16384
17473
  sx: {
@@ -16410,6 +17499,19 @@ var WarningEventItem = function WarningEventItem(_ref) {
16410
17499
  })
16411
17500
  })]
16412
17501
  })]
17502
+ }), jsx(ReactHookFormHiddenInput, {
17503
+ name: "warnings." + index + ".areas",
17504
+ rules: {
17505
+ validate: {
17506
+ isRequired: function isRequired(value) {
17507
+ return isDraft() || hasAreaData(value) ? true : t('warning-event-validation-area-missing');
17508
+ },
17509
+ isPolygonalFeature: function isPolygonalFeature$1(value) {
17510
+ var _value$;
17511
+ return !hasAreaData(value) || isPolygonalFeature(value == null || (_value$ = value[0]) == null || (_value$ = _value$.geoJSON) == null || (_value$ = _value$.features) == null ? void 0 : _value$[0]) ? true : t('warning-event-validation-area-non-polygon');
17512
+ }
17513
+ }
17514
+ }
16413
17515
  }), jsx(ReactHookFormHiddenInput, {
16414
17516
  name: "warnings." + index + ".validFrom",
16415
17517
  rules: {
@@ -16460,8 +17562,8 @@ var WarningEventItem = function WarningEventItem(_ref) {
16460
17562
  };
16461
17563
 
16462
17564
  var SUMMARY_HEADLINE_LIMIT = 150;
16463
- var SUMMARY_CONCISE_SUMMARY_LIMIT = 500;
16464
- var SUMMARY_DESCRIPTION_LIMIT = 1500;
17565
+ var SUMMARY_CONCISE_SUMMARY_LIMIT = 1500;
17566
+ var SUMMARY_DESCRIPTION_LIMIT = 2500;
16465
17567
  var SUMMARY_TEXT_FIELDS = ['headlineOriginal', 'headlineTranslation', 'conciseSummaryOriginal', 'conciseSummaryTranslation', 'descriptionOriginal', 'descriptionTranslation'];
16466
17568
  var RemainingChars = function RemainingChars(_ref) {
16467
17569
  var _useWatch;
@@ -16780,7 +17882,7 @@ var WarningEventSummaryForm = function WarningEventSummaryForm(_ref2) {
16780
17882
  textTransform: 'none',
16781
17883
  fontSize: '12px'
16782
17884
  },
16783
- title: t('warning-event-summary-dialog-clear-button'),
17885
+ title: t('warning-event-summary-dialog-clear-button-title'),
16784
17886
  variant: "tertiary",
16785
17887
  children: t('warning-event-summary-dialog-clear-button')
16786
17888
  }), jsx(Button, {
@@ -16789,7 +17891,7 @@ var WarningEventSummaryForm = function WarningEventSummaryForm(_ref2) {
16789
17891
  textTransform: 'none',
16790
17892
  fontSize: '12px'
16791
17893
  },
16792
- title: t('warning-event-summary-dialog-OK-button'),
17894
+ title: t('warning-event-summary-dialog-OK-button-title'),
16793
17895
  variant: "primary",
16794
17896
  children: t('warning-event-summary-dialog-OK-button')
16795
17897
  })]
@@ -16836,6 +17938,8 @@ var WarningEventFormContent = function WarningEventFormContent(_ref) {
16836
17938
  isDefaultCollapsed = _ref$isDefaultCollaps === void 0 ? false : _ref$isDefaultCollaps,
16837
17939
  _ref$onCancel = _ref.onCancel,
16838
17940
  onCancel = _ref$onCancel === void 0 ? function () {} : _ref$onCancel,
17941
+ _ref$onAddDrawing = _ref.onAddDrawing,
17942
+ onAddDrawing = _ref$onAddDrawing === void 0 ? function () {} : _ref$onAddDrawing,
16839
17943
  _ref$onChangeFormMode = _ref.onChangeFormMode,
16840
17944
  onChangeFormMode = _ref$onChangeFormMode === void 0 ? function () {} : _ref$onChangeFormMode,
16841
17945
  _ref$onDelete = _ref.onDelete,
@@ -16874,6 +17978,7 @@ var WarningEventFormContent = function WarningEventFormContent(_ref) {
16874
17978
  }()) : _ref$onPublish,
16875
17979
  _ref$isSummaryDialogO = _ref.isSummaryDialogOpen,
16876
17980
  isSummaryDialogOpen = _ref$isSummaryDialogO === void 0 ? false : _ref$isSummaryDialogO,
17981
+ selectedDrawing = _ref.selectedDrawing,
16877
17982
  selectedEvent = _ref.selectedEvent;
16878
17983
  var _useWarningsTranslati = useWarningsTranslation(),
16879
17984
  t = _useWarningsTranslati.t;
@@ -16937,26 +18042,38 @@ var WarningEventFormContent = function WarningEventFormContent(_ref) {
16937
18042
  React.useEffect(function () {
16938
18043
  // sync redux with react-hook-form
16939
18044
  reset(getFormData(selectedEvent));
16940
- // TODO once we implement areas
16941
- // setOriginalWarningAreas(publicWarningDetails?.areas);
16942
18045
  }, [eventId, reset, selectedEvent]);
16943
18046
  // When the editor gets set back to viewer and the form is dirty, reset any changes made
16944
18047
  React.useEffect(function () {
16945
- if (isReadOnly && Object.keys(dirtyFields).length > 0
16946
- // TODO once we implement areas
16947
- // ||selectedEvent?.areas !== originalWarningAreas)
16948
- ) {
16949
- // // sync redux with react-hook-form
16950
- var oldEvent = Object.assign({}, selectedEvent);
16951
- reset(getFormData(oldEvent));
16952
- // TODO once we implement areas
16953
- // if (publicWarningDetails?.areas !== originalWarningAreas) {
16954
- // // update the store to contain the original area again
16955
- // onSetViewModeResetArea(originalWarningAreas || []);
16956
- // }
18048
+ if (isReadOnly && Object.keys(dirtyFields).length > 0) {
18049
+ reset(getFormData(selectedEvent));
16957
18050
  }
16958
18051
  // eslint-disable-next-line react-hooks/exhaustive-deps
16959
18052
  }, [isReadOnly]);
18053
+ // Apply a drawing picked in the Area & Drawing Loader to the form
18054
+ React.useEffect(function () {
18055
+ var _getValues, _getValues2;
18056
+ if (((_getValues = getValues('selectedDrawing')) == null ? void 0 : _getValues.id) === (selectedDrawing == null ? void 0 : selectedDrawing.id)) {
18057
+ return;
18058
+ }
18059
+ setValue('selectedDrawing', selectedDrawing, {
18060
+ shouldDirty: true
18061
+ });
18062
+ // the areas of all warnings belong to the previous drawing, clear them.
18063
+ // Finalised (expired/withdrawn) warnings are read-only, keep their areas
18064
+ var currentEventStatus = getValues('status');
18065
+ ((_getValues2 = getValues('warnings')) != null ? _getValues2 : []).forEach(function (warning, warningIndex) {
18066
+ var _warning$status;
18067
+ if (isWarningFinalised({
18068
+ status: (_warning$status = warning.status) != null ? _warning$status : currentEventStatus
18069
+ })) {
18070
+ return;
18071
+ }
18072
+ setValue("warnings." + warningIndex + ".areas", [], {
18073
+ shouldDirty: true
18074
+ });
18075
+ });
18076
+ }, [selectedDrawing, setValue, getValues]);
16960
18077
  var warningEventType = useWatch({
16961
18078
  control: control,
16962
18079
  name: 'warningEventType'
@@ -17028,9 +18145,9 @@ var WarningEventFormContent = function WarningEventFormContent(_ref) {
17028
18145
  deleteCount = _React$useState5[0],
17029
18146
  setDeleteCount = _React$useState5[1];
17030
18147
  var onAddWarning = function onAddWarning() {
17031
- var _getValues;
18148
+ var _getValues3;
17032
18149
  var newWarning = buildDefaultWarningItem(getValues());
17033
- var firstFinalisedIndex = ((_getValues = getValues('warnings')) != null ? _getValues : []).findIndex(isWarningFinalised);
18150
+ var firstFinalisedIndex = ((_getValues3 = getValues('warnings')) != null ? _getValues3 : []).findIndex(isWarningFinalised);
17034
18151
  if (firstFinalisedIndex === -1) {
17035
18152
  append(newWarning);
17036
18153
  return;
@@ -17045,11 +18162,11 @@ var WarningEventFormContent = function WarningEventFormContent(_ref) {
17045
18162
  };
17046
18163
  // re-validate after the removal commits, react-hook-form shifts errors up
17047
18164
  React.useEffect(function () {
17048
- var _getValues2;
18165
+ var _getValues4;
17049
18166
  if (!deleteCount) {
17050
18167
  return;
17051
18168
  }
17052
- var remainingWarnings = (_getValues2 = getValues('warnings')) != null ? _getValues2 : [];
18169
+ var remainingWarnings = (_getValues4 = getValues('warnings')) != null ? _getValues4 : [];
17053
18170
  remainingWarnings.forEach(function (_warning, index) {
17054
18171
  void trigger("warnings." + index + ".validUntil");
17055
18172
  });
@@ -17153,7 +18270,6 @@ var WarningEventFormContent = function WarningEventFormContent(_ref) {
17153
18270
  var onChangeMode = function onChangeMode() {
17154
18271
  onChangeFormMode(!isReadOnly);
17155
18272
  };
17156
- // Until we implement the full validation, set every field to be required when publishing
17157
18273
  var _useDraftFormHelpers2 = useDraftFormHelpers(),
17158
18274
  _isRequired = _useDraftFormHelpers2.isRequired;
17159
18275
  var disabledWarningDeleteButton = fields.length <= 1;
@@ -17296,24 +18412,12 @@ var WarningEventFormContent = function WarningEventFormContent(_ref) {
17296
18412
  }), jsx(Box, {
17297
18413
  sx: {
17298
18414
  flex: '1.3 1 120px',
17299
- position: 'relative',
17300
- '& .MuiSelect-select .MuiGrid-container': {
17301
- flexWrap: 'nowrap',
17302
- alignItems: 'center',
17303
- flexDirection: 'row-reverse',
17304
- justifyContent: 'flex-end !important',
17305
- gap: 1
17306
- },
17307
- '& .MuiSelect-select .MuiGrid-container > .MuiGrid-root:last-child': {
17308
- minWidth: 'auto'
17309
- },
17310
- '& .MuiSelect-select .MuiSvgIcon-root': {
17311
- fontSize: '1.2rem'
17312
- }
18415
+ position: 'relative'
17313
18416
  },
17314
18417
  children: jsx(Phenomenon, {
17315
18418
  isDisabled: areEventFieldsDisabled || !isNewOrDraftEvent,
17316
- isReadOnly: isReadOnly
18419
+ isReadOnly: isReadOnly,
18420
+ isWarningEvent: true
17317
18421
  })
17318
18422
  }), jsx(Box, {
17319
18423
  sx: {
@@ -17487,11 +18591,13 @@ var WarningEventFormContent = function WarningEventFormContent(_ref) {
17487
18591
  isDeleteButtonDisabled: disabledWarningDeleteButton,
17488
18592
  isReadOnly: isReadOnly,
17489
18593
  isSnapshot: isSnapshot,
18594
+ onAddDrawing: onAddDrawing,
17490
18595
  onDeleteWarning: onDeleteWarning,
17491
18596
  onExpireWithdraw: onExpireWithdraw,
17492
18597
  onToggleCompact: function onToggleCompact() {
17493
18598
  return toggleCompact(field.id);
17494
- }
18599
+ },
18600
+ selectedDrawing: selectedDrawing
17495
18601
  })
17496
18602
  }, field.id);
17497
18603
  })
@@ -17798,8 +18904,11 @@ var WarningEventFormDialogContent = function WarningEventFormDialogContent(_ref)
17798
18904
  size = _ref.size,
17799
18905
  source = _ref.source,
17800
18906
  startPosition = _ref.startPosition,
18907
+ selectedDrawing = _ref.selectedDrawing,
17801
18908
  onClose = _ref.onClose,
17802
18909
  onMouseDown = _ref.onMouseDown,
18910
+ _ref$onAddDrawing = _ref.onAddDrawing,
18911
+ onAddDrawing = _ref$onAddDrawing === void 0 ? function () {} : _ref$onAddDrawing,
17803
18912
  _ref$onChangeFormMode = _ref.onChangeFormMode,
17804
18913
  onChangeFormMode = _ref$onChangeFormMode === void 0 ? function () {} : _ref$onChangeFormMode,
17805
18914
  _ref$onDelete = _ref.onDelete,
@@ -17904,6 +19013,7 @@ var WarningEventFormDialogContent = function WarningEventFormDialogContent(_ref)
17904
19013
  isReadOnly: isReadOnly,
17905
19014
  isSnapshot: isSnapshot,
17906
19015
  isSummaryDialogOpen: isSummaryOpen,
19016
+ onAddDrawing: onAddDrawing,
17907
19017
  onCancel: closeDialog,
17908
19018
  onChangeFormMode: onChangeFormMode,
17909
19019
  onDelete: onDelete,
@@ -17911,6 +19021,7 @@ var WarningEventFormDialogContent = function WarningEventFormDialogContent(_ref)
17911
19021
  onOpenWarningSummary: onOpenSummary,
17912
19022
  onPublish: onPublish,
17913
19023
  onSaveDraft: onSaveDraft,
19024
+ selectedDrawing: selectedDrawing,
17914
19025
  selectedEvent: selectedEvent,
17915
19026
  shouldHideFormToggleMode: shouldHideFormToggleMode
17916
19027
  })
@@ -17948,40 +19059,6 @@ var WarningEventFormDialog = function WarningEventFormDialog(_ref5) {
17948
19059
  });
17949
19060
  };
17950
19061
 
17951
- /* *
17952
- * Licensed under the Apache License, Version 2.0 (the "License");
17953
- * you may not use this file except in compliance with the License.
17954
- * You may obtain a copy of the License at
17955
- *
17956
- * http://www.apache.org/licenses/LICENSE-2.0
17957
- *
17958
- * Unless required by applicable law or agreed to in writing, software
17959
- * distributed under the License is distributed on an "AS IS" BASIS,
17960
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17961
- * See the License for the specific language governing permissions and
17962
- * limitations under the License.
17963
- *
17964
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17965
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
17966
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
17967
- * */
17968
- var EMPTY_WARNINGS_EVENT_FORM_STATE = {};
17969
- var selectWarningsEventFormState = function selectWarningsEventFormState(store) {
17970
- if (store != null && store.warningsEventForm) {
17971
- return store.warningsEventForm;
17972
- }
17973
- return EMPTY_WARNINGS_EVENT_FORM_STATE;
17974
- };
17975
- var getWarningEvent = createSelector(selectWarningsEventFormState, function (store) {
17976
- return store == null ? void 0 : store.event;
17977
- });
17978
- var getSelectedEventId = createSelector(selectWarningsEventFormState, function (store) {
17979
- return (store == null ? void 0 : store.selectedEventId) || '';
17980
- });
17981
- var getWarningsEventIsFormDirty = createSelector(selectWarningsEventFormState, function (store) {
17982
- return (store == null ? void 0 : store.isFormDirty) || false;
17983
- });
17984
-
17985
19062
  var _excluded$4 = ["expandedSections", "hoveredWarningIds", "hiddenWarningIds"];
17986
19063
  var getWarningsFilters = function getWarningsFilters(store) {
17987
19064
  if (store != null && store.warningsFilters) {
@@ -18017,6 +19094,9 @@ var getHoveredWarningIdsByPanelId = createSelector(getWarningsFilterPanelById, f
18017
19094
  var getHiddenWarningIdsByPanelId = createSelector(getWarningsFilterPanelById, function (panelState) {
18018
19095
  return (panelState == null ? void 0 : panelState.hiddenWarningIds) || [];
18019
19096
  }, selectorMemoizationOptions);
19097
+ var getWarningListActionRequestByPanelId = createSelector(getWarningsFilterPanelById, function (panelState) {
19098
+ return panelState == null ? void 0 : panelState.warningListActionRequest;
19099
+ }, selectorMemoizationOptions);
18020
19100
  var getWarningsPresetById = createSelector(getWarningsFilterPanelById, function (panelState) {
18021
19101
  if (!panelState) {
18022
19102
  return {
@@ -18035,6 +19115,7 @@ var selectors = /*#__PURE__*/Object.freeze({
18035
19115
  getExpandedSectionsByPanelId: getExpandedSectionsByPanelId,
18036
19116
  getHiddenWarningIdsByPanelId: getHiddenWarningIdsByPanelId,
18037
19117
  getHoveredWarningIdsByPanelId: getHoveredWarningIdsByPanelId,
19118
+ getWarningListActionRequestByPanelId: getWarningListActionRequestByPanelId,
18038
19119
  getWarningsFilterById: getWarningsFilterById,
18039
19120
  getWarningsFilters: getWarningsFilters,
18040
19121
  getWarningsPresetById: getWarningsPresetById
@@ -18058,6 +19139,7 @@ var WarningEventDialogConnect = function WarningEventDialogConnect(_ref) {
18058
19139
  var selectedEventId = useSelector(getSelectedEventId);
18059
19140
  var previousSelectedEventId = usePrevious(selectedEventId);
18060
19141
  var isFormDirty = useSelector(getWarningsEventIsFormDirty);
19142
+ var selectedDrawing = useSelector(getWarningsEventSelectedDrawing);
18061
19143
  var savedFilterState = useSelector(getWarningsFilterById);
18062
19144
  var eventState = useSelector(getWarningEvent);
18063
19145
  var _ref2 = eventState || {},
@@ -18106,6 +19188,12 @@ var WarningEventDialogConnect = function WarningEventDialogConnect(_ref) {
18106
19188
  }));
18107
19189
  onCloseDialogSummary();
18108
19190
  };
19191
+ var closeAreaDrawingLoader = function closeAreaDrawingLoader() {
19192
+ dispatch(uiActions.setToggleOpenDialog({
19193
+ type: uiTypes.DialogTypes.AreaDrawingLoader,
19194
+ setOpen: false
19195
+ }));
19196
+ };
18109
19197
  var onFormDirty = function onFormDirty(isFormDirty) {
18110
19198
  dispatch(warningsEventFormActions.setFormDirty({
18111
19199
  isFormDirty: isFormDirty
@@ -18291,6 +19379,7 @@ var WarningEventDialogConnect = function WarningEventDialogConnect(_ref) {
18291
19379
  dispatch(warningsEventFormActions.setFormValues({
18292
19380
  formState: isReadOnly ? 'readonly' : ''
18293
19381
  }));
19382
+ closeAreaDrawingLoader();
18294
19383
  case 1:
18295
19384
  return _context5.a(2);
18296
19385
  }
@@ -18348,6 +19437,12 @@ var WarningEventDialogConnect = function WarningEventDialogConnect(_ref) {
18348
19437
  void setIsEditor(isReadOnly);
18349
19438
  }
18350
19439
  };
19440
+ var onAddDrawing = function onAddDrawing() {
19441
+ dispatch(uiActions.setToggleOpenDialog({
19442
+ type: uiTypes.DialogTypes.AreaDrawingLoader,
19443
+ setOpen: true
19444
+ }));
19445
+ };
18351
19446
  // Readonly in case you are not creating a new warning and you are not set as the editor
18352
19447
  var isReadOnly = formState === 'readonly' || !isEditor && status !== undefined;
18353
19448
  // Remove any errors when switching events
@@ -18366,11 +19461,13 @@ var WarningEventDialogConnect = function WarningEventDialogConnect(_ref) {
18366
19461
  isOpen: isDialogOpen,
18367
19462
  isReadOnly: isReadOnly,
18368
19463
  isSummaryOpen: isDialogOpenSummary,
19464
+ onAddDrawing: onAddDrawing,
18369
19465
  onAddSummary: onAddSummary,
18370
19466
  onChangeFormMode: onChangeFormMode,
18371
19467
  onClose: function onClose() {
18372
- onCloseDialog();
18373
19468
  onCloseDialogSummary();
19469
+ closeAreaDrawingLoader();
19470
+ onCloseDialog();
18374
19471
  },
18375
19472
  onCloseSummary: onCloseDialogSummary,
18376
19473
  onDelete: onDeleteDraft,
@@ -18381,6 +19478,7 @@ var WarningEventDialogConnect = function WarningEventDialogConnect(_ref) {
18381
19478
  onPublish: onPublishForm,
18382
19479
  onSaveDraft: onSaveDraft,
18383
19480
  order: dialogOrder,
19481
+ selectedDrawing: selectedDrawing,
18384
19482
  selectedEvent: event,
18385
19483
  shouldHideFormToggleMode: shouldHideFormToggleMode,
18386
19484
  size: size,
@@ -19950,7 +21048,6 @@ var ExpandableFilterChip = function ExpandableFilterChip(_ref) {
19950
21048
  };
19951
21049
 
19952
21050
  var TimeFilterChip = function TimeFilterChip(_ref) {
19953
- var _getPickerValue;
19954
21051
  var timeFilter = _ref.timeFilter,
19955
21052
  onUpdateTimeFilter = _ref.onUpdateTimeFilter;
19956
21053
  var _useWarningsTranslati = useWarningsTranslation(),
@@ -19981,7 +21078,6 @@ var TimeFilterChip = function TimeFilterChip(_ref) {
19981
21078
  onUpdateTimeFilter(newFilter);
19982
21079
  };
19983
21080
  var handleTempTimeChange = function handleTempTimeChange(field, value) {
19984
- var _dateUtils$setUTCDate;
19985
21081
  if (!value) {
19986
21082
  if (field === 'customStart') {
19987
21083
  setTempCustomStart(undefined);
@@ -19990,20 +21086,13 @@ var TimeFilterChip = function TimeFilterChip(_ref) {
19990
21086
  }
19991
21087
  return;
19992
21088
  }
19993
- var isoString = (_dateUtils$setUTCDate = dateUtils.setUTCDate(value)) == null ? void 0 : _dateUtils$setUTCDate.toISOString();
21089
+ var isoString = value.toISOString();
19994
21090
  if (field === 'customStart') {
19995
21091
  setTempCustomStart(isoString);
19996
21092
  } else {
19997
21093
  setTempCustomEnd(isoString);
19998
21094
  }
19999
21095
  };
20000
- var getPickerValue = function getPickerValue(isoString) {
20001
- if (!isoString) {
20002
- return null;
20003
- }
20004
- var utc = new Date(isoString);
20005
- return new Date(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate(), utc.getUTCHours(), utc.getUTCMinutes());
20006
- };
20007
21096
  var handleApply = function handleApply() {
20008
21097
  onUpdateTimeFilter({
20009
21098
  mode: TimeFilterMode.custom,
@@ -20156,88 +21245,51 @@ var TimeFilterChip = function TimeFilterChip(_ref) {
20156
21245
  flexDirection: 'column',
20157
21246
  gap: 2
20158
21247
  },
20159
- children: [jsxs(LocalizationProvider, {
20160
- dateAdapter: AdapterDateFns,
20161
- children: [jsxs(Box, {
21248
+ children: [jsxs(Box, {
21249
+ sx: {
21250
+ display: 'flex',
21251
+ justifyContent: 'space-between',
21252
+ alignItems: 'center'
21253
+ },
21254
+ children: [jsx(Typography, {
20162
21255
  sx: {
20163
- display: 'flex',
20164
- justifyContent: 'space-between',
20165
- alignItems: 'center'
21256
+ mr: 1
20166
21257
  },
20167
- children: [jsx(Typography, {
20168
- sx: {
20169
- mr: 1
20170
- },
20171
- children: t('filter-start')
20172
- }), jsx(DateTimePicker, {
20173
- ampm: false,
20174
- format: dateUtils.DATE_FORMAT_DATEPICKER,
20175
- label: t('filter-choose-date-time'),
20176
- onChange: function onChange(value) {
20177
- return handleTempTimeChange('customStart', value);
20178
- },
20179
- slotProps: {
20180
- textField: {
20181
- variant: 'filled',
20182
- slotProps: {
20183
- input: {
20184
- endAdornment: jsx(InputAdornment, {
20185
- position: "end",
20186
- children: "UTC"
20187
- })
20188
- }
20189
- }
20190
- },
20191
- field: {
20192
- clearable: true,
20193
- openPickerButtonPosition: 'start'
20194
- }
20195
- },
20196
- timeSteps: {
20197
- minutes: 1
20198
- },
20199
- value: (_getPickerValue = getPickerValue(pickerStartValue)) != null ? _getPickerValue : new Date(Date.now())
20200
- })]
20201
- }), jsxs(Box, {
21258
+ children: t('filter-start')
21259
+ }), jsx(DateTimePicker, {
21260
+ label: t('filter-choose-date-time'),
21261
+ onChange: function onChange(value) {
21262
+ return handleTempTimeChange('customStart', value);
21263
+ },
21264
+ slotProps: {
21265
+ field: {
21266
+ clearable: true
21267
+ }
21268
+ },
21269
+ value: pickerStartValue ? new Date(pickerStartValue) : new Date(Date.now())
21270
+ })]
21271
+ }), jsxs(Box, {
21272
+ sx: {
21273
+ display: 'flex',
21274
+ justifyContent: 'space-between',
21275
+ alignItems: 'center'
21276
+ },
21277
+ children: [jsx(Typography, {
20202
21278
  sx: {
20203
- display: 'flex',
20204
- justifyContent: 'space-between',
20205
- alignItems: 'center'
21279
+ mr: 1
20206
21280
  },
20207
- children: [jsx(Typography, {
20208
- sx: {
20209
- mr: 1
20210
- },
20211
- children: t('filter-end')
20212
- }), jsx(DateTimePicker, {
20213
- ampm: false,
20214
- format: dateUtils.DATE_FORMAT_DATEPICKER,
20215
- label: t('filter-choose-date-time'),
20216
- onChange: function onChange(value) {
20217
- return handleTempTimeChange('customEnd', value);
20218
- },
20219
- slotProps: {
20220
- textField: {
20221
- variant: 'filled',
20222
- slotProps: {
20223
- input: {
20224
- endAdornment: jsx(InputAdornment, {
20225
- position: "end",
20226
- children: "UTC"
20227
- })
20228
- }
20229
- }
20230
- },
20231
- field: {
20232
- clearable: true,
20233
- openPickerButtonPosition: 'start'
20234
- }
20235
- },
20236
- timeSteps: {
20237
- minutes: 1
20238
- },
20239
- value: getPickerValue(pickerEndValue)
20240
- })]
21281
+ children: t('filter-end')
21282
+ }), jsx(DateTimePicker, {
21283
+ label: t('filter-choose-date-time'),
21284
+ onChange: function onChange(value) {
21285
+ return handleTempTimeChange('customEnd', value);
21286
+ },
21287
+ slotProps: {
21288
+ field: {
21289
+ clearable: true
21290
+ }
21291
+ },
21292
+ value: pickerEndValue ? new Date(pickerEndValue) : null
20241
21293
  })]
20242
21294
  }), jsx(Box, {
20243
21295
  sx: {
@@ -20381,16 +21433,14 @@ var RowComponent = function RowComponent(_ref) {
20381
21433
  var groupWarningsOnStatus = function groupWarningsOnStatus(warnings, sortState) {
20382
21434
  var key = sortState.key,
20383
21435
  direction = sortState.direction;
20384
- var sortedWarnings = warnings.sort(function (warningA, warningB) {
21436
+ var sortedWarnings = warnings.slice().sort(function (warningA, warningB) {
20385
21437
  var _dateStringB$localeCo;
20386
21438
  var dateStringA = key === 'lastUpdatedTime' ? warningA[key] : warningA.warningDetail[key];
20387
21439
  var dateStringB = key === 'lastUpdatedTime' ? warningB[key] : warningB.warningDetail[key];
20388
21440
  return (_dateStringB$localeCo = dateStringB == null ? void 0 : dateStringB.localeCompare(dateStringA != null ? dateStringA : '')) != null ? _dateStringB$localeCo : 0;
20389
21441
  });
20390
- if (direction === 'asc') {
20391
- sortedWarnings.reverse();
20392
- }
20393
- var groupedWarnings = groupBy(sortedWarnings, function (warning) {
21442
+ var directionSortedWarnings = direction === 'asc' ? sortedWarnings.slice().reverse() : sortedWarnings;
21443
+ var groupedWarnings = groupBy(directionSortedWarnings, function (warning) {
20394
21444
  var _warning$status;
20395
21445
  var status = (_warning$status = warning.status) != null ? _warning$status : mapProductStatusToWarningStatus(warning.productStatus);
20396
21446
  switch (status) {
@@ -20882,12 +21932,19 @@ var getSelectedFormAreaIds = function getSelectedFormAreaIds(selectedFormWarning
20882
21932
  return Boolean(areaId);
20883
21933
  }));
20884
21934
  };
21935
+ var isAviationWarning = function isAviationWarning(warning) {
21936
+ return (warning == null ? void 0 : warning.type) === 'airmet' || (warning == null ? void 0 : warning.type) === 'sigmet';
21937
+ };
21938
+ var isUnsavedAviationCopy = function isUnsavedAviationCopy(warning) {
21939
+ return isAviationWarning(warning) && Boolean(warning.id) && warning.sigmetAirmetDetails.uuid === undefined;
21940
+ };
20885
21941
  var shouldExcludeWarningFromFeatureSync = function shouldExcludeWarningFromFeatureSync(_ref) {
20886
21942
  var hiddenWarningIds = _ref.hiddenWarningIds,
20887
21943
  hasMatchingAreaId = _ref.hasMatchingAreaId,
20888
21944
  selectedWarningId = _ref.selectedWarningId,
20889
- warningIds = _ref.warningIds;
20890
- return warningIds.includes(selectedWarningId != null ? selectedWarningId : '') || hasMatchingAreaId || warningIds.some(function (warningId) {
21945
+ warningIds = _ref.warningIds,
21946
+ selectedFormWarning = _ref.selectedFormWarning;
21947
+ return !isUnsavedAviationCopy(selectedFormWarning) && (warningIds.includes(selectedWarningId != null ? selectedWarningId : '') || hasMatchingAreaId) || warningIds.some(function (warningId) {
20891
21948
  return hiddenWarningIds.has(warningId);
20892
21949
  });
20893
21950
  };
@@ -20953,6 +22010,7 @@ var useWarningListFeatureSync = function useWarningListFeatureSync(_ref) {
20953
22010
  if (shouldExcludeWarningFromFeatureSync({
20954
22011
  hiddenWarningIds: hiddenWarningIds,
20955
22012
  hasMatchingAreaId: hasMatchingAreaId,
22013
+ selectedFormWarning: selectedFormWarning,
20956
22014
  selectedWarningId: selectedWarningId,
20957
22015
  warningIds: warningIds
20958
22016
  })) {
@@ -20976,7 +22034,7 @@ var useWarningListFeatureSync = function useWarningListFeatureSync(_ref) {
20976
22034
  }).filter(function (feature) {
20977
22035
  return !!feature.id;
20978
22036
  });
20979
- }, [filteredWarningsByExpandedSections, hiddenWarningIds, selectedFormAreaIds, selectedWarningId]);
22037
+ }, [filteredWarningsByExpandedSections, hiddenWarningIds, selectedFormAreaIds, selectedFormWarning, selectedWarningId]);
20980
22038
  useRegisterFeatureSyncSource(panelId);
20981
22039
  var warningFeatureCollection = React.useMemo(function () {
20982
22040
  return createWarningFeatureCollection(allFeatures);
@@ -21891,6 +22949,9 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
21891
22949
  var hiddenWarningIdsArray = useSelector(function (store) {
21892
22950
  return getHiddenWarningIdsByPanelId(store, panelId);
21893
22951
  });
22952
+ var warningListActionRequest = useSelector(function (store) {
22953
+ return getWarningListActionRequestByPanelId(store, panelId);
22954
+ });
21894
22955
  var hiddenWarningIds = React.useMemo(function () {
21895
22956
  return new Set(hiddenWarningIdsArray);
21896
22957
  }, [hiddenWarningIdsArray]);
@@ -22173,6 +23234,57 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
22173
23234
  });
22174
23235
  void refetchWarnings();
22175
23236
  };
23237
+ var warningListActionHandlersRef = React.useRef({
23238
+ deleteReviewWarning: deleteReviewWarning,
23239
+ deleteWarning: deleteWarning,
23240
+ editWarning: editWarning,
23241
+ expireWarning: expireWarning,
23242
+ handleAviationProductClick: handleAviationProductClick,
23243
+ handleMaritimeProductClick: handleMaritimeProductClick,
23244
+ withdrawWarning: withdrawWarning
23245
+ });
23246
+ warningListActionHandlersRef.current = {
23247
+ deleteReviewWarning: deleteReviewWarning,
23248
+ deleteWarning: deleteWarning,
23249
+ editWarning: editWarning,
23250
+ expireWarning: expireWarning,
23251
+ handleAviationProductClick: handleAviationProductClick,
23252
+ handleMaritimeProductClick: handleMaritimeProductClick,
23253
+ withdrawWarning: withdrawWarning
23254
+ };
23255
+ React.useEffect(function () {
23256
+ if (!warningListActionRequest) {
23257
+ return;
23258
+ }
23259
+ dispatch(warningsFiltersActions.clearWarningListActionRequest({
23260
+ panelId: panelId
23261
+ }));
23262
+ var warning = warningListActionRequest.warning;
23263
+ var handlers = warningListActionHandlersRef.current;
23264
+ switch (warningListActionRequest.type) {
23265
+ case 'edit':
23266
+ void handlers.editWarning(warning);
23267
+ break;
23268
+ case 'delete':
23269
+ handlers.deleteWarning(warning);
23270
+ break;
23271
+ case 'deleteReview':
23272
+ handlers.deleteReviewWarning(warning);
23273
+ break;
23274
+ case 'expire':
23275
+ handlers.expireWarning(warning);
23276
+ break;
23277
+ case 'withdraw':
23278
+ handlers.withdrawWarning(warning);
23279
+ break;
23280
+ case 'aviation':
23281
+ handlers.handleAviationProductClick(warning, warningListActionRequest.actionType);
23282
+ break;
23283
+ case 'maritime':
23284
+ handlers.handleMaritimeProductClick(warning, warningListActionRequest.actionType);
23285
+ break;
23286
+ }
23287
+ }, [dispatch, panelId, warningListActionRequest]);
22176
23288
  var onRemoveSuccessHooks = function onRemoveSuccessHooks(warningId) {
22177
23289
  setConfirmDialogOptions(undefined);
22178
23290
  // Close warning dialog if needed
@@ -22479,6 +23591,97 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
22479
23591
  });
22480
23592
  };
22481
23593
 
23594
+ var WarningBlockMenu = function WarningBlockMenu(_ref) {
23595
+ var _warning$id;
23596
+ var effectiveStatus = _ref.effectiveStatus,
23597
+ hasWarningContent = _ref.hasWarningContent,
23598
+ isAviation = _ref.isAviation,
23599
+ level = _ref.level,
23600
+ onMenuInteraction = _ref.onMenuInteraction,
23601
+ onMenuLeave = _ref.onMenuLeave,
23602
+ warning = _ref.warning,
23603
+ warningListItemActions = _ref.warningListItemActions;
23604
+ var _useWarningsTranslati = useWarningsTranslation(),
23605
+ t = _useWarningsTranslati.t;
23606
+ var theme = useTheme$1();
23607
+ if (!warningListItemActions) {
23608
+ return null;
23609
+ }
23610
+ var tertiaryButton = theme.palette.geowebColors.buttons.tertiary;
23611
+ var primaryButton = theme.palette.geowebColors.buttons.primary;
23612
+ var defaultIconColor = theme.palette.geowebColors.typographyAndIcons.icon;
23613
+ var primaryIconColor = theme.palette.geowebColors.typographyAndIcons.buttonIcon;
23614
+ var menuButtonSize = theme.spacing(2.5);
23615
+ var menuButtonBorderWidth = theme.spacing(0.125);
23616
+ var menuIconColor = effectiveStatus === PublicWarningStatus.PUBLISHED && (isAviation || level === WarningLevel.extreme || level === WarningLevel.severe) ? primaryIconColor : defaultIconColor;
23617
+ var hoverMenuIconColor = theme.palette.mode === 'dark' ? primaryIconColor : defaultIconColor;
23618
+ return jsx(Box$1, {
23619
+ onClick: function onClick(event) {
23620
+ event.stopPropagation();
23621
+ onMenuInteraction == null || onMenuInteraction();
23622
+ },
23623
+ onFocus: onMenuInteraction,
23624
+ onKeyDown: function onKeyDown(event) {
23625
+ event.stopPropagation();
23626
+ onMenuInteraction == null || onMenuInteraction();
23627
+ },
23628
+ onMouseDown: onMenuInteraction,
23629
+ onMouseEnter: onMenuInteraction,
23630
+ onMouseLeave: onMenuLeave,
23631
+ sx: {
23632
+ display: 'flex',
23633
+ flex: "0 0 " + menuButtonSize,
23634
+ margin: hasWarningContent ? undefined : '0 auto'
23635
+ },
23636
+ children: jsx(ToggleMenu, {
23637
+ buttonIcon: jsx(Options, {}),
23638
+ buttonSx: {
23639
+ backgroundColor: tertiaryButton["default"].fill,
23640
+ border: menuButtonBorderWidth + " solid " + tertiaryButton["default"].fill,
23641
+ color: menuIconColor,
23642
+ height: menuButtonSize,
23643
+ minHeight: menuButtonSize,
23644
+ minWidth: menuButtonSize,
23645
+ padding: 0,
23646
+ width: menuButtonSize,
23647
+ '&.flat': {
23648
+ backgroundColor: tertiaryButton["default"].fill,
23649
+ borderColor: tertiaryButton["default"].fill,
23650
+ color: menuIconColor
23651
+ },
23652
+ '&.flat:hover, &.flat.Mui-focusVisible': {
23653
+ backgroundColor: tertiaryButton.mouseOver.fill,
23654
+ borderColor: tertiaryButton["default"].borderColor,
23655
+ color: hoverMenuIconColor
23656
+ },
23657
+ '&.flat:active, &.flat.Mui-selected, &.flat.Mui-selected:hover': {
23658
+ backgroundColor: primaryButton["default"].fill,
23659
+ borderColor: tertiaryButton["default"].borderColor,
23660
+ color: primaryIconColor
23661
+ },
23662
+ '&.flat[class*="sizeSmall"]': {
23663
+ height: menuButtonSize,
23664
+ width: menuButtonSize
23665
+ },
23666
+ '&.flat.Mui-focusVisible': {
23667
+ outline: tertiaryButton.focus.outline,
23668
+ outlineOffset: 0
23669
+ }
23670
+ },
23671
+ buttonTestId: "warning-block-menu-" + ((_warning$id = warning.id) != null ? _warning$id : 'unknown'),
23672
+ menuItems: WarningListItemMenu(Object.assign({
23673
+ warning: warning,
23674
+ t: t
23675
+ }, warningListItemActions)),
23676
+ menuPosition: "bottom",
23677
+ menuTitle: t('warning-list-button-options'),
23678
+ tooltipTitle: t('warning-list-button-options'),
23679
+ variant: "flat"
23680
+ })
23681
+ });
23682
+ };
23683
+
23684
+ var MIN_WIDTH_FOR_LETTER = 75;
22482
23685
  /**
22483
23686
  * Gets the author/editor from a warning.
22484
23687
  * For airmet/sigmet warnings, author is in sigmetAirmetDetails.
@@ -22524,9 +23727,7 @@ var getTooltipContent = function getTooltipContent(warning, t) {
22524
23727
  } else if (!isAviation) {
22525
23728
  warningTypeLabel = t('timeline-tooltip-public-warning');
22526
23729
  }
22527
- var phenomenonEntry = warningPhenomena.find(function (entry) {
22528
- return entry.key === warningDetail.phenomenon;
22529
- });
23730
+ var phenomenonEntry = allPhenomenaDict[warningDetail.phenomenon];
22530
23731
  var phenomenonLabel = phenomenonEntry ? t(phenomenonEntry.translationKey) : warningDetail.phenomenon;
22531
23732
  var probability = type === 'warningsEvent' ? (_probablityOptions$fi = probablityOptions.find(function (probability) {
22532
23733
  return probability.value === warningDetail.probability;
@@ -22557,16 +23758,26 @@ var getTooltipContent = function getTooltipContent(warning, t) {
22557
23758
  });
22558
23759
  };
22559
23760
  var WarningBlock = /*#__PURE__*/React.memo(function (_ref) {
23761
+ var _warning$id;
22560
23762
  var warning = _ref.warning,
22561
23763
  _ref$highlighted = _ref.highlighted,
22562
23764
  highlighted = _ref$highlighted === void 0 ? false : _ref$highlighted,
22563
23765
  left = _ref.left,
22564
23766
  onHoverWarning = _ref.onHoverWarning,
23767
+ onSelectWarning = _ref.onSelectWarning,
22565
23768
  top = _ref.top,
23769
+ warningListItemActions = _ref.warningListItemActions,
22566
23770
  width = _ref.width;
22567
23771
  var _useWarningsTranslati = useWarningsTranslation(),
22568
23772
  t = _useWarningsTranslati.t;
22569
23773
  var theme = useTheme();
23774
+ var _React$useState = React.useState(false),
23775
+ isTooltipOpen = _React$useState[0],
23776
+ setIsTooltipOpen = _React$useState[1];
23777
+ var _React$useState2 = React.useState(false),
23778
+ isTooltipSuppressed = _React$useState2[0],
23779
+ setIsTooltipSuppressed = _React$useState2[1];
23780
+ var isTooltipSuppressedRef = React.useRef(false);
22570
23781
  var warningDetail = warning.warningDetail,
22571
23782
  type = warning.type;
22572
23783
  var author = getWarningAuthor(warning);
@@ -22582,7 +23793,7 @@ var WarningBlock = /*#__PURE__*/React.memo(function (_ref) {
22582
23793
  var size = getBlockSize(width);
22583
23794
  var highlightOutlineColor = theme.palette.geowebColors.typographyAndIcons.iconLinkActive;
22584
23795
  var elements = [];
22585
- if (size === 's' || size === 'l') {
23796
+ if (size === 'l' || width >= MIN_WIDTH_FOR_LETTER) {
22586
23797
  elements.push(jsx(Box, {
22587
23798
  sx: {
22588
23799
  fontSize: 16,
@@ -22593,7 +23804,7 @@ var WarningBlock = /*#__PURE__*/React.memo(function (_ref) {
22593
23804
  children: letter
22594
23805
  }, "letter"));
22595
23806
  }
22596
- if (size !== 'xxs') {
23807
+ if (size === 'l' || size === 's') {
22597
23808
  elements.push(jsx(Box, {
22598
23809
  sx: {
22599
23810
  display: 'flex',
@@ -22616,25 +23827,75 @@ var WarningBlock = /*#__PURE__*/React.memo(function (_ref) {
22616
23827
  })
22617
23828
  }, "avatar"));
22618
23829
  }
23830
+ var warningMenu = size !== 'xxs' ? jsx(WarningBlockMenu, {
23831
+ effectiveStatus: effectiveStatus,
23832
+ hasWarningContent: elements.length > 0,
23833
+ isAviation: isAviation,
23834
+ level: level,
23835
+ onMenuInteraction: function onMenuInteraction() {
23836
+ isTooltipSuppressedRef.current = true;
23837
+ setIsTooltipOpen(false);
23838
+ setIsTooltipSuppressed(true);
23839
+ },
23840
+ onMenuLeave: function onMenuLeave() {
23841
+ isTooltipSuppressedRef.current = false;
23842
+ setIsTooltipSuppressed(false);
23843
+ },
23844
+ warning: warning,
23845
+ warningListItemActions: warningListItemActions
23846
+ }) : null;
23847
+ var warningBlockPadding = '4px 8px';
23848
+ if (warningMenu) {
23849
+ warningBlockPadding = size === 'xs' ? '4px 0' : '4px 2px 4px 8px';
23850
+ }
22619
23851
  return jsx(Tooltip, {
23852
+ onClose: function onClose() {
23853
+ return setIsTooltipOpen(false);
23854
+ },
23855
+ onOpen: function onOpen() {
23856
+ if (isTooltipSuppressed || isTooltipSuppressedRef.current) {
23857
+ return;
23858
+ }
23859
+ setIsTooltipOpen(true);
23860
+ },
23861
+ open: isTooltipOpen,
22620
23862
  placement: "top",
22621
23863
  title: getTooltipContent(warning, t),
22622
- children: jsx(Box, {
23864
+ children: jsxs(Box, {
23865
+ "aria-label": "warning timeline block for " + ((_warning$id = warning.id) != null ? _warning$id : ''),
22623
23866
  "data-highlighted": highlighted ? 'true' : 'false',
22624
23867
  "data-testid": "warning-block",
23868
+ onClick: function onClick() {
23869
+ isTooltipSuppressedRef.current = true;
23870
+ setIsTooltipOpen(false);
23871
+ setIsTooltipSuppressed(true);
23872
+ onSelectWarning == null || onSelectWarning(warning);
23873
+ },
23874
+ onKeyDown: function onKeyDown(event) {
23875
+ if (event.key === 'Enter' || event.key === ' ') {
23876
+ event.preventDefault();
23877
+ isTooltipSuppressedRef.current = true;
23878
+ setIsTooltipOpen(false);
23879
+ setIsTooltipSuppressed(true);
23880
+ onSelectWarning == null || onSelectWarning(warning);
23881
+ }
23882
+ },
22625
23883
  onMouseEnter: function onMouseEnter() {
22626
23884
  return onHoverWarning == null ? void 0 : onHoverWarning(warning.id);
22627
23885
  },
22628
23886
  onMouseLeave: function onMouseLeave() {
22629
- return onHoverWarning == null ? void 0 : onHoverWarning(undefined);
23887
+ isTooltipSuppressedRef.current = false;
23888
+ setIsTooltipSuppressed(false);
23889
+ onHoverWarning == null || onHoverWarning(undefined);
22630
23890
  },
23891
+ role: "button",
22631
23892
  sx: {
22632
23893
  position: 'absolute',
22633
23894
  left: left,
22634
23895
  top: top,
22635
23896
  width: width,
22636
23897
  height: 28,
22637
- padding: '4px 8px',
23898
+ padding: warningBlockPadding,
22638
23899
  background: background,
22639
23900
  border: border,
22640
23901
  borderRadius: 1,
@@ -22644,12 +23905,24 @@ var WarningBlock = /*#__PURE__*/React.memo(function (_ref) {
22644
23905
  justifyContent: elements.length === 1 ? 'center' : 'space-between',
22645
23906
  overflow: 'hidden',
22646
23907
  zIndex: highlighted ? 11 : 1,
23908
+ cursor: 'pointer',
22647
23909
  '&:hover': {
22648
23910
  boxShadow: "0 0 0 2px " + highlightOutlineColor,
22649
23911
  zIndex: 11
22650
23912
  }
22651
23913
  },
22652
- children: elements
23914
+ tabIndex: 0,
23915
+ children: [elements.length ? jsx(Box, {
23916
+ sx: {
23917
+ display: 'flex',
23918
+ alignItems: 'center',
23919
+ flex: '1 1 0',
23920
+ justifyContent: elements.length === 1 ? 'center' : 'space-between',
23921
+ minWidth: 0,
23922
+ overflow: 'hidden'
23923
+ },
23924
+ children: elements
23925
+ }) : null, warningMenu]
22653
23926
  })
22654
23927
  });
22655
23928
  });
@@ -22742,15 +24015,20 @@ var TimelineBackground = function TimelineBackground(_ref) {
22742
24015
  var WarningBlocksLayer = /*#__PURE__*/React.memo(function (_ref2) {
22743
24016
  var warningBlocks = _ref2.warningBlocks,
22744
24017
  hoveredWarningId = _ref2.hoveredWarningId,
22745
- onHoverWarning = _ref2.onHoverWarning;
24018
+ onHoverWarning = _ref2.onHoverWarning,
24019
+ onSelectWarning = _ref2.onSelectWarning,
24020
+ selectedWarningId = _ref2.selectedWarningId,
24021
+ warningListItemActions = _ref2.warningListItemActions;
22746
24022
  return jsx(Fragment, {
22747
24023
  children: warningBlocks.map(function (warningLayout) {
22748
24024
  return jsx(WarningBlock, {
22749
- highlighted: hoveredWarningId === warningLayout.warning.id,
24025
+ highlighted: hoveredWarningId === warningLayout.warning.id || selectedWarningId === warningLayout.warning.id,
22750
24026
  left: warningLayout.left,
22751
24027
  onHoverWarning: onHoverWarning,
24028
+ onSelectWarning: onSelectWarning,
22752
24029
  top: warningLayout.top,
22753
24030
  warning: warningLayout.warning,
24031
+ warningListItemActions: warningListItemActions,
22754
24032
  width: warningLayout.width
22755
24033
  }, warningLayout.key);
22756
24034
  })
@@ -22852,13 +24130,17 @@ var WARNING_BLOCK_HEIGHT = 34;
22852
24130
  var DEFAULT_VISIBLE_ROWS = 10;
22853
24131
  var TIMELINE_BAR_HEIGHT = 40;
22854
24132
  var TIMELINE_TOP_PADDING = 8;
24133
+ var TIMELINE_SCROLLBAR_CLEARANCE = 16;
22855
24134
  var MS_PER_HOUR = 60 * 60 * 1000;
22856
24135
  var MS_PER_DAY = 24 * MS_PER_HOUR;
22857
24136
  var DEFAULT_VISIBLE_HOURS = 4 * 24;
22858
24137
  var WarningsTimeline = function WarningsTimeline(_ref) {
22859
24138
  var warnings = _ref.warnings,
22860
24139
  hoveredWarningId = _ref.hoveredWarningId,
22861
- onHoverWarning = _ref.onHoverWarning;
24140
+ onHoverWarning = _ref.onHoverWarning,
24141
+ onSelectWarning = _ref.onSelectWarning,
24142
+ selectedWarningId = _ref.selectedWarningId,
24143
+ warningListItemActions = _ref.warningListItemActions;
22862
24144
  var timelineWarnings = React.useMemo(function () {
22863
24145
  var _warnings$filter;
22864
24146
  return (_warnings$filter = warnings == null ? void 0 : warnings.filter(function (warning) {
@@ -22997,7 +24279,7 @@ var WarningsTimeline = function WarningsTimeline(_ref) {
22997
24279
  }
22998
24280
  }, [contentWidth, timelineEnd, timelineStart]);
22999
24281
  var timelineRowsHeight = Math.max(timelineWarnings.length * WARNING_BLOCK_HEIGHT + TIMELINE_TOP_PADDING, DEFAULT_VISIBLE_ROWS * WARNING_BLOCK_HEIGHT + TIMELINE_TOP_PADDING);
23000
- var timelineCanvasHeight = Math.max(containerSize.height, timelineRowsHeight);
24282
+ var timelineCanvasHeight = Math.max(containerSize.height, timelineRowsHeight + TIMELINE_SCROLLBAR_CLEARANCE);
23001
24283
  var warningBlocks = React.useMemo(function () {
23002
24284
  return timelineWarnings.map(function (warning, index) {
23003
24285
  var _warning$id;
@@ -23085,7 +24367,10 @@ var WarningsTimeline = function WarningsTimeline(_ref) {
23085
24367
  }) : null, jsx(WarningBlocksLayer, {
23086
24368
  hoveredWarningId: hoveredWarningId,
23087
24369
  onHoverWarning: onHoverWarning,
23088
- warningBlocks: warningBlocks
24370
+ onSelectWarning: onSelectWarning,
24371
+ selectedWarningId: selectedWarningId,
24372
+ warningBlocks: warningBlocks,
24373
+ warningListItemActions: warningListItemActions
23089
24374
  })]
23090
24375
  })
23091
24376
  })
@@ -23146,6 +24431,7 @@ var WarningsTimelineConnect = function WarningsTimelineConnect(_ref) {
23146
24431
  var _useAuthenticationCon = useAuthenticationContext$1(),
23147
24432
  isLoggedIn = _useAuthenticationCon.isLoggedIn;
23148
24433
  var dispatch = useDispatch();
24434
+ var confirmDialog = useConfirmationDialog();
23149
24435
  var workspaceViewsById = useSelector(function (state) {
23150
24436
  return syncGroupsSelector.getWorkspaceViewsById(state);
23151
24437
  });
@@ -23187,6 +24473,11 @@ var WarningsTimelineConnect = function WarningsTimelineConnect(_ref) {
23187
24473
  var hoveredWarningId = isUsingLocalHoverOverride ? localHoveredWarningId : (_hoveredLinkedFeature = hoveredLinkedFeatureIds[0]) != null ? _hoveredLinkedFeature : hoveredLocalWarningIds[0];
23188
24474
  var _useWarnings = useWarnings(!isLoggedIn || !sourcePanelId, savedFilterState.time),
23189
24475
  combinedWarnings = _useWarnings.combinedWarnings;
24476
+ var isFormDirty = useSelector(getSelectedPublicIsFormDirty);
24477
+ var selectedWarningId = useSelector(getSelectedWarningId);
24478
+ var warningType = useSelector(getWarningType);
24479
+ var _useWarningEventActio = useWarningEventActions(sourcePanelId || '', savedFilterState.time),
24480
+ openWarningsEventDialog = _useWarningEventActio.openWarningsEventDialog;
23190
24481
  var byFilterState = React.useMemo(function () {
23191
24482
  return createWarningFilterPredicate(combinedWarnings, savedFilterState);
23192
24483
  }, [combinedWarnings, savedFilterState]);
@@ -23233,6 +24524,148 @@ var WarningsTimelineConnect = function WarningsTimelineConnect(_ref) {
23233
24524
  setIsUsingLocalHoverOverride(false);
23234
24525
  }, WARNING_HOVER_DISPATCH_DELAY);
23235
24526
  }, [dispatch, linkedTargetIds.length, ownedFeatureLayerIds, sourcePanelId]);
24527
+ var openPublicWarningDialog = React.useCallback(/*#__PURE__*/function () {
24528
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(warning) {
24529
+ var mayProceed;
24530
+ return _regenerator().w(function (_context) {
24531
+ while (1) switch (_context.n) {
24532
+ case 0:
24533
+ if (sourcePanelId) {
24534
+ _context.n = 1;
24535
+ break;
24536
+ }
24537
+ return _context.a(2);
24538
+ case 1:
24539
+ if (!isFormDirty) {
24540
+ _context.n = 3;
24541
+ break;
24542
+ }
24543
+ _context.n = 2;
24544
+ return confirmDialog(warningFormConfirmationOptions$2(t)).then(function () {
24545
+ return true;
24546
+ })["catch"](function () {
24547
+ return false;
24548
+ });
24549
+ case 2:
24550
+ mayProceed = _context.v;
24551
+ if (mayProceed) {
24552
+ _context.n = 3;
24553
+ break;
24554
+ }
24555
+ return _context.a(2);
24556
+ case 3:
24557
+ dispatch(warningsFormActions.openPublicWarningFormDialog({
24558
+ warning: warning,
24559
+ formState: 'readonly',
24560
+ warningType: warning.type || warningType,
24561
+ panelId: sourcePanelId
24562
+ }));
24563
+ case 4:
24564
+ return _context.a(2);
24565
+ }
24566
+ }, _callee);
24567
+ }));
24568
+ return function (_x) {
24569
+ return _ref2.apply(this, arguments);
24570
+ };
24571
+ }(), [confirmDialog, dispatch, isFormDirty, sourcePanelId, t, warningType]);
24572
+ var warningListItemActions = React.useMemo(function () {
24573
+ return {
24574
+ onEditWarning: function onEditWarning(warning) {
24575
+ if (!sourcePanelId) {
24576
+ return;
24577
+ }
24578
+ dispatch(warningsFiltersActions.requestWarningListAction({
24579
+ panelId: sourcePanelId,
24580
+ request: {
24581
+ type: 'edit',
24582
+ warning: warning
24583
+ }
24584
+ }));
24585
+ },
24586
+ onDeleteWarning: function onDeleteWarning(warning) {
24587
+ if (!sourcePanelId) {
24588
+ return;
24589
+ }
24590
+ dispatch(warningsFiltersActions.requestWarningListAction({
24591
+ panelId: sourcePanelId,
24592
+ request: {
24593
+ type: 'delete',
24594
+ warning: warning
24595
+ }
24596
+ }));
24597
+ },
24598
+ onDeleteReviewWarning: function onDeleteReviewWarning(warning) {
24599
+ if (!sourcePanelId) {
24600
+ return;
24601
+ }
24602
+ dispatch(warningsFiltersActions.requestWarningListAction({
24603
+ panelId: sourcePanelId,
24604
+ request: {
24605
+ type: 'deleteReview',
24606
+ warning: warning
24607
+ }
24608
+ }));
24609
+ },
24610
+ onExpireWarning: function onExpireWarning(warning) {
24611
+ if (!sourcePanelId) {
24612
+ return;
24613
+ }
24614
+ dispatch(warningsFiltersActions.requestWarningListAction({
24615
+ panelId: sourcePanelId,
24616
+ request: {
24617
+ type: 'expire',
24618
+ warning: warning
24619
+ }
24620
+ }));
24621
+ },
24622
+ onWithdrawWarning: function onWithdrawWarning(warning) {
24623
+ if (!sourcePanelId) {
24624
+ return;
24625
+ }
24626
+ dispatch(warningsFiltersActions.requestWarningListAction({
24627
+ panelId: sourcePanelId,
24628
+ request: {
24629
+ type: 'withdraw',
24630
+ warning: warning
24631
+ }
24632
+ }));
24633
+ },
24634
+ onActionAviationWarning: function onActionAviationWarning(warning, actionType) {
24635
+ if (!sourcePanelId) {
24636
+ return;
24637
+ }
24638
+ dispatch(warningsFiltersActions.requestWarningListAction({
24639
+ panelId: sourcePanelId,
24640
+ request: {
24641
+ type: 'aviation',
24642
+ warning: warning,
24643
+ actionType: actionType
24644
+ }
24645
+ }));
24646
+ },
24647
+ onActionMaritimeWarning: function onActionMaritimeWarning(warning, actionType) {
24648
+ if (!sourcePanelId) {
24649
+ return;
24650
+ }
24651
+ dispatch(warningsFiltersActions.requestWarningListAction({
24652
+ panelId: sourcePanelId,
24653
+ request: {
24654
+ type: 'maritime',
24655
+ warning: warning,
24656
+ actionType: actionType
24657
+ }
24658
+ }));
24659
+ }
24660
+ };
24661
+ }, [dispatch, sourcePanelId]);
24662
+ var selectWarning = React.useCallback(function (warning) {
24663
+ if (warning.type === 'warningsEvent') {
24664
+ void openWarningsEventDialog('readonly', warning);
24665
+ return;
24666
+ }
24667
+ void openPublicWarningDialog(warning);
24668
+ }, [openPublicWarningDialog, openWarningsEventDialog]);
23236
24669
  React.useEffect(function () {
23237
24670
  return function () {
23238
24671
  if (!sourcePanelId) {
@@ -23267,6 +24700,9 @@ var WarningsTimelineConnect = function WarningsTimelineConnect(_ref) {
23267
24700
  return jsx(WarningsTimeline, {
23268
24701
  hoveredWarningId: hoveredWarningId,
23269
24702
  onHoverWarning: handleHoverWarning,
24703
+ onSelectWarning: selectWarning,
24704
+ selectedWarningId: selectedWarningId,
24705
+ warningListItemActions: warningListItemActions,
23270
24706
  warnings: warnings
23271
24707
  });
23272
24708
  };
@@ -23454,8 +24890,10 @@ var drawingListJSON = [
23454
24890
  stroke: "#ff7800",
23455
24891
  "stroke-width": 2,
23456
24892
  "stroke-opacity": 1,
23457
- selectionType: "poly"
24893
+ selectionType: "poly",
24894
+ objectName: "Object 1"
23458
24895
  },
24896
+ id: "object-1",
23459
24897
  geometry: {
23460
24898
  type: "Polygon",
23461
24899
  coordinates: [
@@ -23479,6 +24917,62 @@ var drawingListJSON = [
23479
24917
  ]
23480
24918
  ]
23481
24919
  }
24920
+ },
24921
+ {
24922
+ type: "Feature",
24923
+ properties: {
24924
+ fill: "#ff7800",
24925
+ "fill-opacity": 0,
24926
+ stroke: "#ff7800",
24927
+ "stroke-width": 2,
24928
+ "stroke-opacity": 1,
24929
+ selectionType: "poly",
24930
+ objectName: "Object 2"
24931
+ },
24932
+ id: "object-2",
24933
+ geometry: {
24934
+ type: "Polygon",
24935
+ coordinates: [
24936
+ [
24937
+ [
24938
+ 3.31519,
24939
+ 52.58351
24940
+ ],
24941
+ [
24942
+ 4.43387,
24943
+ 54.33682
24944
+ ],
24945
+ [
24946
+ 6.62875,
24947
+ 54.20452
24948
+ ],
24949
+ [
24950
+ 5.58087,
24951
+ 54.06348
24952
+ ],
24953
+ [
24954
+ 5.01445,
24955
+ 53.08821
24956
+ ],
24957
+ [
24958
+ 5.18438,
24959
+ 50.69441
24960
+ ],
24961
+ [
24962
+ 4.26395,
24963
+ 52.36789
24964
+ ],
24965
+ [
24966
+ 3.48512,
24967
+ 52.11643
24968
+ ],
24969
+ [
24970
+ 3.31519,
24971
+ 52.58351
24972
+ ]
24973
+ ]
24974
+ ]
24975
+ }
23482
24976
  }
23483
24977
  ]
23484
24978
  }
@@ -28983,6 +30477,269 @@ var maritimeConfig = {
28983
30477
  validation: validation
28984
30478
  };
28985
30479
 
30480
+ var maskListJSON = [
30481
+ {
30482
+ id: "mask-nl-territory",
30483
+ objectName: "NL Territory",
30484
+ lastUpdatedTime: "2026-09-01T10:00:00Z",
30485
+ scope: "global",
30486
+ keywords: "mask",
30487
+ geoJSON: {
30488
+ type: "FeatureCollection",
30489
+ features: [
30490
+ {
30491
+ type: "Feature",
30492
+ id: "mask-nl-territory-feature",
30493
+ properties: {
30494
+ fill: "#186DFF",
30495
+ "fill-opacity": 0.2,
30496
+ stroke: "#186DFF",
30497
+ "stroke-width": 2,
30498
+ "stroke-opacity": 1,
30499
+ selectionType: "poly",
30500
+ objectName: "NL Territory"
30501
+ },
30502
+ geometry: {
30503
+ type: "Polygon",
30504
+ coordinates: [
30505
+ [
30506
+ [
30507
+ 3.3,
30508
+ 50.7
30509
+ ],
30510
+ [
30511
+ 7.2,
30512
+ 50.7
30513
+ ],
30514
+ [
30515
+ 7.2,
30516
+ 53.7
30517
+ ],
30518
+ [
30519
+ 3.3,
30520
+ 53.7
30521
+ ],
30522
+ [
30523
+ 3.3,
30524
+ 50.7
30525
+ ]
30526
+ ]
30527
+ ]
30528
+ }
30529
+ }
30530
+ ]
30531
+ }
30532
+ },
30533
+ {
30534
+ id: "mask-nl-land",
30535
+ objectName: "NL Land",
30536
+ lastUpdatedTime: "2026-09-01T10:00:00Z",
30537
+ scope: "global",
30538
+ keywords: "mask",
30539
+ geoJSON: {
30540
+ type: "FeatureCollection",
30541
+ features: [
30542
+ {
30543
+ type: "Feature",
30544
+ id: "mask-nl-land-feature",
30545
+ properties: {
30546
+ fill: "#186DFF",
30547
+ "fill-opacity": 0.2,
30548
+ stroke: "#186DFF",
30549
+ "stroke-width": 2,
30550
+ "stroke-opacity": 1,
30551
+ selectionType: "poly",
30552
+ objectName: "NL Land"
30553
+ },
30554
+ geometry: {
30555
+ type: "Polygon",
30556
+ coordinates: [
30557
+ [
30558
+ [
30559
+ 3.4,
30560
+ 50.75
30561
+ ],
30562
+ [
30563
+ 7.2,
30564
+ 50.75
30565
+ ],
30566
+ [
30567
+ 7.2,
30568
+ 53.5
30569
+ ],
30570
+ [
30571
+ 3.4,
30572
+ 53.5
30573
+ ],
30574
+ [
30575
+ 3.4,
30576
+ 50.75
30577
+ ]
30578
+ ]
30579
+ ]
30580
+ }
30581
+ }
30582
+ ]
30583
+ }
30584
+ },
30585
+ {
30586
+ id: "mask-fir-land-sea",
30587
+ objectName: "FIR Land and Sea",
30588
+ lastUpdatedTime: "2026-09-01T10:00:00Z",
30589
+ scope: "global",
30590
+ keywords: "mask",
30591
+ geoJSON: {
30592
+ type: "FeatureCollection",
30593
+ features: [
30594
+ {
30595
+ type: "Feature",
30596
+ id: "mask-fir-land-sea-feature",
30597
+ properties: {
30598
+ fill: "#186DFF",
30599
+ "fill-opacity": 0.2,
30600
+ stroke: "#186DFF",
30601
+ "stroke-width": 2,
30602
+ "stroke-opacity": 1,
30603
+ selectionType: "poly",
30604
+ objectName: "FIR Land and Sea"
30605
+ },
30606
+ geometry: {
30607
+ type: "Polygon",
30608
+ coordinates: [
30609
+ [
30610
+ [
30611
+ 2,
30612
+ 51
30613
+ ],
30614
+ [
30615
+ 7.2,
30616
+ 51
30617
+ ],
30618
+ [
30619
+ 7.2,
30620
+ 55
30621
+ ],
30622
+ [
30623
+ 2,
30624
+ 55
30625
+ ],
30626
+ [
30627
+ 2,
30628
+ 51
30629
+ ]
30630
+ ]
30631
+ ]
30632
+ }
30633
+ }
30634
+ ]
30635
+ }
30636
+ },
30637
+ {
30638
+ id: "mask-fir-sea",
30639
+ objectName: "FIR Sea",
30640
+ lastUpdatedTime: "2026-09-01T10:00:00Z",
30641
+ scope: "global",
30642
+ keywords: "mask",
30643
+ geoJSON: {
30644
+ type: "FeatureCollection",
30645
+ features: [
30646
+ {
30647
+ type: "Feature",
30648
+ id: "mask-fir-sea-feature",
30649
+ properties: {
30650
+ fill: "#186DFF",
30651
+ "fill-opacity": 0.2,
30652
+ stroke: "#186DFF",
30653
+ "stroke-width": 2,
30654
+ "stroke-opacity": 1,
30655
+ selectionType: "poly",
30656
+ objectName: "FIR Sea"
30657
+ },
30658
+ geometry: {
30659
+ type: "Polygon",
30660
+ coordinates: [
30661
+ [
30662
+ [
30663
+ 2,
30664
+ 51.5
30665
+ ],
30666
+ [
30667
+ 4.5,
30668
+ 51.5
30669
+ ],
30670
+ [
30671
+ 4.5,
30672
+ 55
30673
+ ],
30674
+ [
30675
+ 2,
30676
+ 55
30677
+ ],
30678
+ [
30679
+ 2,
30680
+ 51.5
30681
+ ]
30682
+ ]
30683
+ ]
30684
+ }
30685
+ }
30686
+ ]
30687
+ }
30688
+ },
30689
+ {
30690
+ id: "mask-fir-land",
30691
+ objectName: "FIR Land",
30692
+ lastUpdatedTime: "2026-09-01T10:00:00Z",
30693
+ scope: "global",
30694
+ keywords: "mask",
30695
+ geoJSON: {
30696
+ type: "FeatureCollection",
30697
+ features: [
30698
+ {
30699
+ type: "Feature",
30700
+ id: "mask-fir-land-feature",
30701
+ properties: {
30702
+ fill: "#186DFF",
30703
+ "fill-opacity": 0.2,
30704
+ stroke: "#186DFF",
30705
+ "stroke-width": 2,
30706
+ "stroke-opacity": 1,
30707
+ selectionType: "poly",
30708
+ objectName: "FIR Land"
30709
+ },
30710
+ geometry: {
30711
+ type: "Polygon",
30712
+ coordinates: [
30713
+ [
30714
+ [
30715
+ 3.4,
30716
+ 51
30717
+ ],
30718
+ [
30719
+ 7.2,
30720
+ 51
30721
+ ],
30722
+ [
30723
+ 7.2,
30724
+ 53.5
30725
+ ],
30726
+ [
30727
+ 3.4,
30728
+ 53.5
30729
+ ],
30730
+ [
30731
+ 3.4,
30732
+ 51
30733
+ ]
30734
+ ]
30735
+ ]
30736
+ }
30737
+ }
30738
+ ]
30739
+ }
30740
+ }
30741
+ ];
30742
+
28986
30743
  var predefinedAreaListJSON = [
28987
30744
  {
28988
30745
  id: "northsea_districts",
@@ -114758,7 +116515,7 @@ var warningEventsListJSON = [
114758
116515
  status: "DRAFT_PUBLISHED",
114759
116516
  areas: [
114760
116517
  {
114761
- objectName: "low temp 1",
116518
+ objectName: "Coastal zone north",
114762
116519
  geoJSON: {
114763
116520
  type: "FeatureCollection",
114764
116521
  features: [
@@ -114794,8 +116551,10 @@ var warningEventsListJSON = [
114794
116551
  "stroke-width": 2,
114795
116552
  selectionType: "poly",
114796
116553
  warning_level: "1",
114797
- "stroke-opacity": 1
114798
- }
116554
+ "stroke-opacity": 1,
116555
+ objectName: "Coastal zone north"
116556
+ },
116557
+ id: "drawing-storm-ciaran-object-1"
114799
116558
  }
114800
116559
  ]
114801
116560
  }
@@ -114809,7 +116568,92 @@ var warningEventsListJSON = [
114809
116568
  authority: "KNMI",
114810
116569
  incident: "Storm Ciaran"
114811
116570
  }
114812
- ]
116571
+ ],
116572
+ selectedDrawing: {
116573
+ id: "drawing-storm-ciaran",
116574
+ objectName: "Storm Ciaran areas",
116575
+ scope: "global",
116576
+ lastUpdatedTime: "2026-07-21T15:00:00Z",
116577
+ geoJSON: {
116578
+ type: "FeatureCollection",
116579
+ features: [
116580
+ {
116581
+ type: "Feature",
116582
+ geometry: {
116583
+ type: "Polygon",
116584
+ coordinates: [
116585
+ [
116586
+ [
116587
+ 5.09504,
116588
+ 53.492
116589
+ ],
116590
+ [
116591
+ 4.28015,
116592
+ 52.46456
116593
+ ],
116594
+ [
116595
+ 6.87823,
116596
+ 52.98133
116597
+ ],
116598
+ [
116599
+ 5.09504,
116600
+ 53.492
116601
+ ]
116602
+ ]
116603
+ ]
116604
+ },
116605
+ properties: {
116606
+ fill: "#fae21e",
116607
+ stroke: "#fae21e",
116608
+ "fill-opacity": 0.2,
116609
+ "stroke-width": 2,
116610
+ selectionType: "poly",
116611
+ warning_level: "1",
116612
+ "stroke-opacity": 1,
116613
+ objectName: "Coastal zone north"
116614
+ },
116615
+ id: "drawing-storm-ciaran-object-1"
116616
+ },
116617
+ {
116618
+ type: "Feature",
116619
+ geometry: {
116620
+ type: "Polygon",
116621
+ coordinates: [
116622
+ [
116623
+ [
116624
+ 5.09504,
116625
+ 53.492
116626
+ ],
116627
+ [
116628
+ 4.28015,
116629
+ 52.46456
116630
+ ],
116631
+ [
116632
+ 6.87823,
116633
+ 52.98133
116634
+ ],
116635
+ [
116636
+ 5.09504,
116637
+ 53.492
116638
+ ]
116639
+ ]
116640
+ ]
116641
+ },
116642
+ properties: {
116643
+ fill: "#fae21e",
116644
+ stroke: "#fae21e",
116645
+ "fill-opacity": 0.2,
116646
+ "stroke-width": 2,
116647
+ selectionType: "poly",
116648
+ warning_level: "1",
116649
+ "stroke-opacity": 1,
116650
+ objectName: "Wadden Sea"
116651
+ },
116652
+ id: "drawing-storm-ciaran-object-2"
116653
+ }
116654
+ ]
116655
+ }
116656
+ }
114813
116657
  },
114814
116658
  {
114815
116659
  status: "PUBLISHED",
@@ -114838,7 +116682,7 @@ var warningEventsListJSON = [
114838
116682
  status: "PUBLISHED",
114839
116683
  areas: [
114840
116684
  {
114841
- objectName: "wind test name",
116685
+ objectName: "Coastal zone west",
114842
116686
  geoJSON: {
114843
116687
  type: "FeatureCollection",
114844
116688
  features: [
@@ -114914,8 +116758,10 @@ var warningEventsListJSON = [
114914
116758
  "stroke-width": 2,
114915
116759
  selectionType: "poly",
114916
116760
  warning_level: "1",
114917
- "stroke-opacity": 1
114918
- }
116761
+ "stroke-opacity": 1,
116762
+ objectName: "Coastal zone west"
116763
+ },
116764
+ id: "drawing-storm-coastal-object-1"
114919
116765
  }
114920
116766
  ]
114921
116767
  }
@@ -114937,7 +116783,375 @@ var warningEventsListJSON = [
114937
116783
  status: "PUBLISHED",
114938
116784
  areas: [
114939
116785
  {
114940
- objectName: "test name",
116786
+ objectName: "IJsselmeer",
116787
+ geoJSON: {
116788
+ type: "FeatureCollection",
116789
+ features: [
116790
+ {
116791
+ type: "Feature",
116792
+ geometry: {
116793
+ type: "Polygon",
116794
+ coordinates: [
116795
+ [
116796
+ [
116797
+ 4.9,
116798
+ 53.2
116799
+ ],
116800
+ [
116801
+ 5,
116802
+ 53.3
116803
+ ],
116804
+ [
116805
+ 4.9629,
116806
+ 53.3371
116807
+ ],
116808
+ [
116809
+ 4.91659,
116810
+ 53.32006
116811
+ ],
116812
+ [
116813
+ 4.91232,
116814
+ 53.31826
116815
+ ],
116816
+ [
116817
+ 4.80795,
116818
+ 53.26843
116819
+ ],
116820
+ [
116821
+ 4.7936,
116822
+ 53.25812
116823
+ ],
116824
+ [
116825
+ 4.78373,
116826
+ 53.24347
116827
+ ],
116828
+ [
116829
+ 4.77554,
116830
+ 53.22488
116831
+ ],
116832
+ [
116833
+ 4.74595,
116834
+ 53.18851
116835
+ ],
116836
+ [
116837
+ 4.8,
116838
+ 53.175
116839
+ ],
116840
+ [
116841
+ 4.9,
116842
+ 53.2
116843
+ ]
116844
+ ]
116845
+ ]
116846
+ },
116847
+ properties: {
116848
+ fill: "#fae21e",
116849
+ stroke: "#fae21e",
116850
+ "fill-opacity": 0.2,
116851
+ "stroke-width": 2,
116852
+ selectionType: "poly",
116853
+ warning_level: "1",
116854
+ "stroke-opacity": 1,
116855
+ objectName: "IJsselmeer"
116856
+ },
116857
+ id: "drawing-storm-coastal-object-2"
116858
+ }
116859
+ ]
116860
+ }
116861
+ }
116862
+ ],
116863
+ validFrom: "2026-07-20T04:00:00Z",
116864
+ validUntil: "2026-07-20T06:00:00Z",
116865
+ level: "severe",
116866
+ probability: 30,
116867
+ domain: "public",
116868
+ warningProposalSource: "",
116869
+ authority: "KNMI",
116870
+ incident: "Storm "
116871
+ }
116872
+ ],
116873
+ selectedDrawing: {
116874
+ id: "drawing-storm-coastal",
116875
+ objectName: "Coastal wind areas",
116876
+ scope: "global",
116877
+ lastUpdatedTime: "2026-07-20T00:00:00Z",
116878
+ geoJSON: {
116879
+ type: "FeatureCollection",
116880
+ features: [
116881
+ {
116882
+ type: "Feature",
116883
+ geometry: {
116884
+ type: "Polygon",
116885
+ coordinates: [
116886
+ [
116887
+ [
116888
+ 5.85,
116889
+ 53.5
116890
+ ],
116891
+ [
116892
+ 5.88069,
116893
+ 53.53069
116894
+ ],
116895
+ [
116896
+ 5.83071,
116897
+ 53.5276
116898
+ ],
116899
+ [
116900
+ 5.65979,
116901
+ 53.53259
116902
+ ],
116903
+ [
116904
+ 5.65843,
116905
+ 53.53262
116906
+ ],
116907
+ [
116908
+ 5.58313,
116909
+ 53.53277
116910
+ ],
116911
+ [
116912
+ 5.57114,
116913
+ 53.53133
116914
+ ],
116915
+ [
116916
+ 5.48882,
116917
+ 53.51118
116918
+ ],
116919
+ [
116920
+ 5.5,
116921
+ 53.5
116922
+ ],
116923
+ [
116924
+ 5.6,
116925
+ 53.4
116926
+ ],
116927
+ [
116928
+ 5.7,
116929
+ 53.38333
116930
+ ],
116931
+ [
116932
+ 5.75,
116933
+ 53.4
116934
+ ],
116935
+ [
116936
+ 5.8,
116937
+ 53.45
116938
+ ],
116939
+ [
116940
+ 5.85,
116941
+ 53.5
116942
+ ]
116943
+ ]
116944
+ ]
116945
+ },
116946
+ properties: {
116947
+ fill: "#fae21e",
116948
+ stroke: "#fae21e",
116949
+ "fill-opacity": 0.2,
116950
+ "stroke-width": 2,
116951
+ selectionType: "poly",
116952
+ warning_level: "1",
116953
+ "stroke-opacity": 1,
116954
+ objectName: "Coastal zone west"
116955
+ },
116956
+ id: "drawing-storm-coastal-object-1"
116957
+ },
116958
+ {
116959
+ type: "Feature",
116960
+ geometry: {
116961
+ type: "Polygon",
116962
+ coordinates: [
116963
+ [
116964
+ [
116965
+ 4.9,
116966
+ 53.2
116967
+ ],
116968
+ [
116969
+ 5,
116970
+ 53.3
116971
+ ],
116972
+ [
116973
+ 4.9629,
116974
+ 53.3371
116975
+ ],
116976
+ [
116977
+ 4.91659,
116978
+ 53.32006
116979
+ ],
116980
+ [
116981
+ 4.91232,
116982
+ 53.31826
116983
+ ],
116984
+ [
116985
+ 4.80795,
116986
+ 53.26843
116987
+ ],
116988
+ [
116989
+ 4.7936,
116990
+ 53.25812
116991
+ ],
116992
+ [
116993
+ 4.78373,
116994
+ 53.24347
116995
+ ],
116996
+ [
116997
+ 4.77554,
116998
+ 53.22488
116999
+ ],
117000
+ [
117001
+ 4.74595,
117002
+ 53.18851
117003
+ ],
117004
+ [
117005
+ 4.8,
117006
+ 53.175
117007
+ ],
117008
+ [
117009
+ 4.9,
117010
+ 53.2
117011
+ ]
117012
+ ]
117013
+ ]
117014
+ },
117015
+ properties: {
117016
+ fill: "#fae21e",
117017
+ stroke: "#fae21e",
117018
+ "fill-opacity": 0.2,
117019
+ "stroke-width": 2,
117020
+ selectionType: "poly",
117021
+ warning_level: "1",
117022
+ "stroke-opacity": 1,
117023
+ objectName: "IJsselmeer"
117024
+ },
117025
+ id: "drawing-storm-coastal-object-2"
117026
+ },
117027
+ {
117028
+ type: "Feature",
117029
+ geometry: {
117030
+ type: "Polygon",
117031
+ coordinates: [
117032
+ [
117033
+ [
117034
+ 5.09504,
117035
+ 53.492
117036
+ ],
117037
+ [
117038
+ 4.28015,
117039
+ 52.46456
117040
+ ],
117041
+ [
117042
+ 6.87823,
117043
+ 52.98133
117044
+ ],
117045
+ [
117046
+ 5.09504,
117047
+ 53.492
117048
+ ]
117049
+ ]
117050
+ ]
117051
+ },
117052
+ properties: {
117053
+ fill: "#fae21e",
117054
+ stroke: "#fae21e",
117055
+ "fill-opacity": 0.2,
117056
+ "stroke-width": 2,
117057
+ selectionType: "poly",
117058
+ warning_level: "1",
117059
+ "stroke-opacity": 1,
117060
+ objectName: "Zeeland delta"
117061
+ },
117062
+ id: "drawing-storm-coastal-object-3"
117063
+ }
117064
+ ]
117065
+ }
117066
+ }
117067
+ },
117068
+ {
117069
+ status: "EXPIRED",
117070
+ mode: "ACTUAL",
117071
+ eventId: "event3",
117072
+ linked_to_id: "downstreamid_98475",
117073
+ lastUpdatedTime: "2026-07-10T00:00:00Z",
117074
+ phenomenon: "thunderstorm",
117075
+ validFrom: "2026-07-10T11:00:00Z",
117076
+ validUntil: "2026-07-10T19:00:00Z",
117077
+ incident: "Storm Marcel",
117078
+ warningEventType: "WARNING",
117079
+ texts: {
117080
+ headlineOriginal: "Donders en bliksem!",
117081
+ headlineTranslation: "Thunder and lightning",
117082
+ conciseSummaryOriginal: "",
117083
+ conciseSummaryTranslation: "",
117084
+ descriptionOriginal: "Kijk maar uit hoor!",
117085
+ descriptionTranslation: "You'd better watch out!"
117086
+ },
117087
+ warnings: [
117088
+ {
117089
+ id: "event3-warning1",
117090
+ status: "EXPIRED",
117091
+ eventId: "event3",
117092
+ phenomenon: "thunderstorm",
117093
+ areas: [
117094
+ {
117095
+ objectName: "Inland north",
117096
+ geoJSON: {
117097
+ type: "FeatureCollection",
117098
+ features: [
117099
+ {
117100
+ type: "Feature",
117101
+ geometry: {
117102
+ type: "Polygon",
117103
+ coordinates: [
117104
+ [
117105
+ [
117106
+ 5.09504,
117107
+ 53.492
117108
+ ],
117109
+ [
117110
+ 4.28015,
117111
+ 52.46456
117112
+ ],
117113
+ [
117114
+ 6.87823,
117115
+ 52.98133
117116
+ ],
117117
+ [
117118
+ 5.09504,
117119
+ 53.492
117120
+ ]
117121
+ ]
117122
+ ]
117123
+ },
117124
+ properties: {
117125
+ fill: "#ff7800",
117126
+ stroke: "#ff7800",
117127
+ "fill-opacity": 0.2,
117128
+ "stroke-width": 2,
117129
+ selectionType: "poly",
117130
+ "stroke-opacity": 1,
117131
+ objectName: "Inland north"
117132
+ },
117133
+ id: "drawing-storm-marcel-object-1"
117134
+ }
117135
+ ]
117136
+ }
117137
+ }
117138
+ ],
117139
+ validFrom: "2026-07-10T11:00:00Z",
117140
+ validUntil: "2026-07-10T19:00:00Z",
117141
+ level: "moderate",
117142
+ probability: 30,
117143
+ domain: "public",
117144
+ authority: "KNMI",
117145
+ incident: "Storm Marcel"
117146
+ },
117147
+ {
117148
+ id: "event3-warning2",
117149
+ status: "EXPIRED",
117150
+ eventId: "event3",
117151
+ phenomenon: "thunderstorm",
117152
+ areas: [
117153
+ {
117154
+ objectName: "Inland east",
114941
117155
  geoJSON: {
114942
117156
  type: "FeatureCollection",
114943
117157
  features: [
@@ -115005,178 +117219,10 @@ var warningEventsListJSON = [
115005
117219
  "stroke-width": 2,
115006
117220
  selectionType: "poly",
115007
117221
  warning_level: "1",
115008
- "stroke-opacity": 1
115009
- }
115010
- }
115011
- ]
115012
- }
115013
- }
115014
- ],
115015
- validFrom: "2026-07-20T04:00:00Z",
115016
- validUntil: "2026-07-20T06:00:00Z",
115017
- level: "severe",
115018
- probability: 30,
115019
- domain: "public",
115020
- warningProposalSource: "",
115021
- authority: "KNMI",
115022
- incident: "Storm "
115023
- }
115024
- ]
115025
- },
115026
- {
115027
- status: "EXPIRED",
115028
- mode: "ACTUAL",
115029
- eventId: "event3",
115030
- linked_to_id: "downstreamid_98475",
115031
- lastUpdatedTime: "2026-07-10T00:00:00Z",
115032
- phenomenon: "thunderstorm",
115033
- validFrom: "2026-07-10T11:00:00Z",
115034
- validUntil: "2026-07-10T19:00:00Z",
115035
- incident: "Storm Marcel",
115036
- warningEventType: "WARNING",
115037
- texts: {
115038
- headlineOriginal: "Donders en bliksem!",
115039
- headlineTranslation: "Thunder and lightning",
115040
- conciseSummaryOriginal: "",
115041
- conciseSummaryTranslation: "",
115042
- descriptionOriginal: "Kijk maar uit hoor!",
115043
- descriptionTranslation: "You'd better watch out!"
115044
- },
115045
- warnings: [
115046
- {
115047
- id: "event3-warning1",
115048
- status: "EXPIRED",
115049
- eventId: "event3",
115050
- phenomenon: "thunderstorm",
115051
- areas: [
115052
- {
115053
- objectName: "test name",
115054
- geoJSON: {
115055
- type: "FeatureCollection",
115056
- features: [
115057
- {
115058
- type: "Feature",
115059
- geometry: {
115060
- type: "Polygon",
115061
- coordinates: [
115062
- [
115063
- [
115064
- 5.09504,
115065
- 53.492
115066
- ],
115067
- [
115068
- 4.28015,
115069
- 52.46456
115070
- ],
115071
- [
115072
- 6.87823,
115073
- 52.98133
115074
- ],
115075
- [
115076
- 5.09504,
115077
- 53.492
115078
- ]
115079
- ]
115080
- ]
117222
+ "stroke-opacity": 1,
117223
+ objectName: "Inland east"
115081
117224
  },
115082
- properties: {
115083
- fill: "#ff7800",
115084
- stroke: "#ff7800",
115085
- "fill-opacity": 0.2,
115086
- "stroke-width": 2,
115087
- selectionType: "poly",
115088
- "stroke-opacity": 1
115089
- }
115090
- }
115091
- ]
115092
- }
115093
- }
115094
- ],
115095
- validFrom: "2026-07-10T11:00:00Z",
115096
- validUntil: "2026-07-10T19:00:00Z",
115097
- level: "moderate",
115098
- probability: 30,
115099
- domain: "public",
115100
- authority: "KNMI",
115101
- incident: "Storm Marcel"
115102
- },
115103
- {
115104
- id: "event3-warning2",
115105
- status: "EXPIRED",
115106
- eventId: "event3",
115107
- phenomenon: "thunderstorm",
115108
- areas: [
115109
- {
115110
- objectName: "test name",
115111
- geoJSON: {
115112
- type: "FeatureCollection",
115113
- features: [
115114
- {
115115
- type: "Feature",
115116
- geometry: {
115117
- type: "Polygon",
115118
- coordinates: [
115119
- [
115120
- [
115121
- 4.9,
115122
- 53.2
115123
- ],
115124
- [
115125
- 5,
115126
- 53.3
115127
- ],
115128
- [
115129
- 4.9629,
115130
- 53.3371
115131
- ],
115132
- [
115133
- 4.91659,
115134
- 53.32006
115135
- ],
115136
- [
115137
- 4.91232,
115138
- 53.31826
115139
- ],
115140
- [
115141
- 4.80795,
115142
- 53.26843
115143
- ],
115144
- [
115145
- 4.7936,
115146
- 53.25812
115147
- ],
115148
- [
115149
- 4.78373,
115150
- 53.24347
115151
- ],
115152
- [
115153
- 4.77554,
115154
- 53.22488
115155
- ],
115156
- [
115157
- 4.74595,
115158
- 53.18851
115159
- ],
115160
- [
115161
- 4.8,
115162
- 53.175
115163
- ],
115164
- [
115165
- 4.9,
115166
- 53.2
115167
- ]
115168
- ]
115169
- ]
115170
- },
115171
- properties: {
115172
- fill: "#fae21e",
115173
- stroke: "#fae21e",
115174
- "fill-opacity": 0.2,
115175
- "stroke-width": 2,
115176
- selectionType: "poly",
115177
- warning_level: "1",
115178
- "stroke-opacity": 1
115179
- }
117225
+ id: "drawing-storm-marcel-object-2"
115180
117226
  }
115181
117227
  ]
115182
117228
  }
@@ -115198,7 +117244,7 @@ var warningEventsListJSON = [
115198
117244
  phenomenon: "thunderstorm",
115199
117245
  areas: [
115200
117246
  {
115201
- objectName: "test name 3",
117247
+ objectName: "Inland south",
115202
117248
  geoJSON: {
115203
117249
  type: "FeatureCollection",
115204
117250
  features: [
@@ -115233,8 +117279,10 @@ var warningEventsListJSON = [
115233
117279
  "fill-opacity": 0.2,
115234
117280
  "stroke-width": 2,
115235
117281
  selectionType: "poly",
115236
- "stroke-opacity": 1
115237
- }
117282
+ "stroke-opacity": 1,
117283
+ objectName: "Inland south"
117284
+ },
117285
+ id: "drawing-storm-marcel-object-3"
115238
117286
  }
115239
117287
  ]
115240
117288
  }
@@ -115248,7 +117296,196 @@ var warningEventsListJSON = [
115248
117296
  authority: "KNMI",
115249
117297
  incident: "Storm Marcel"
115250
117298
  }
115251
- ]
117299
+ ],
117300
+ selectedDrawing: {
117301
+ id: "drawing-storm-marcel",
117302
+ objectName: "Storm Marcel areas",
117303
+ scope: "global",
117304
+ lastUpdatedTime: "2026-07-10T00:00:00Z",
117305
+ geoJSON: {
117306
+ type: "FeatureCollection",
117307
+ features: [
117308
+ {
117309
+ type: "Feature",
117310
+ geometry: {
117311
+ type: "Polygon",
117312
+ coordinates: [
117313
+ [
117314
+ [
117315
+ 5.09504,
117316
+ 53.492
117317
+ ],
117318
+ [
117319
+ 4.28015,
117320
+ 52.46456
117321
+ ],
117322
+ [
117323
+ 6.87823,
117324
+ 52.98133
117325
+ ],
117326
+ [
117327
+ 5.09504,
117328
+ 53.492
117329
+ ]
117330
+ ]
117331
+ ]
117332
+ },
117333
+ properties: {
117334
+ fill: "#ff7800",
117335
+ stroke: "#ff7800",
117336
+ "fill-opacity": 0.2,
117337
+ "stroke-width": 2,
117338
+ selectionType: "poly",
117339
+ "stroke-opacity": 1,
117340
+ objectName: "Inland north"
117341
+ },
117342
+ id: "drawing-storm-marcel-object-1"
117343
+ },
117344
+ {
117345
+ type: "Feature",
117346
+ geometry: {
117347
+ type: "Polygon",
117348
+ coordinates: [
117349
+ [
117350
+ [
117351
+ 4.9,
117352
+ 53.2
117353
+ ],
117354
+ [
117355
+ 5,
117356
+ 53.3
117357
+ ],
117358
+ [
117359
+ 4.9629,
117360
+ 53.3371
117361
+ ],
117362
+ [
117363
+ 4.91659,
117364
+ 53.32006
117365
+ ],
117366
+ [
117367
+ 4.91232,
117368
+ 53.31826
117369
+ ],
117370
+ [
117371
+ 4.80795,
117372
+ 53.26843
117373
+ ],
117374
+ [
117375
+ 4.7936,
117376
+ 53.25812
117377
+ ],
117378
+ [
117379
+ 4.78373,
117380
+ 53.24347
117381
+ ],
117382
+ [
117383
+ 4.77554,
117384
+ 53.22488
117385
+ ],
117386
+ [
117387
+ 4.74595,
117388
+ 53.18851
117389
+ ],
117390
+ [
117391
+ 4.8,
117392
+ 53.175
117393
+ ],
117394
+ [
117395
+ 4.9,
117396
+ 53.2
117397
+ ]
117398
+ ]
117399
+ ]
117400
+ },
117401
+ properties: {
117402
+ fill: "#fae21e",
117403
+ stroke: "#fae21e",
117404
+ "fill-opacity": 0.2,
117405
+ "stroke-width": 2,
117406
+ selectionType: "poly",
117407
+ warning_level: "1",
117408
+ "stroke-opacity": 1,
117409
+ objectName: "Inland east"
117410
+ },
117411
+ id: "drawing-storm-marcel-object-2"
117412
+ },
117413
+ {
117414
+ type: "Feature",
117415
+ geometry: {
117416
+ type: "Polygon",
117417
+ coordinates: [
117418
+ [
117419
+ [
117420
+ 5.09504,
117421
+ 53.492
117422
+ ],
117423
+ [
117424
+ 4.28015,
117425
+ 52.46456
117426
+ ],
117427
+ [
117428
+ 6.87823,
117429
+ 52.98133
117430
+ ],
117431
+ [
117432
+ 5.09504,
117433
+ 53.492
117434
+ ]
117435
+ ]
117436
+ ]
117437
+ },
117438
+ properties: {
117439
+ fill: "#ff7800",
117440
+ stroke: "#ff7800",
117441
+ "fill-opacity": 0.2,
117442
+ "stroke-width": 2,
117443
+ selectionType: "poly",
117444
+ "stroke-opacity": 1,
117445
+ objectName: "Inland south"
117446
+ },
117447
+ id: "drawing-storm-marcel-object-3"
117448
+ },
117449
+ {
117450
+ type: "Feature",
117451
+ geometry: {
117452
+ type: "Polygon",
117453
+ coordinates: [
117454
+ [
117455
+ [
117456
+ 5.09504,
117457
+ 53.492
117458
+ ],
117459
+ [
117460
+ 4.28015,
117461
+ 52.46456
117462
+ ],
117463
+ [
117464
+ 6.87823,
117465
+ 52.98133
117466
+ ],
117467
+ [
117468
+ 5.09504,
117469
+ 53.492
117470
+ ]
117471
+ ]
117472
+ ]
117473
+ },
117474
+ properties: {
117475
+ fill: "#fae21e",
117476
+ stroke: "#fae21e",
117477
+ "fill-opacity": 0.2,
117478
+ "stroke-width": 2,
117479
+ selectionType: "poly",
117480
+ warning_level: "1",
117481
+ "stroke-opacity": 1,
117482
+ objectName: "Veluwe"
117483
+ },
117484
+ id: "drawing-storm-marcel-object-4"
117485
+ }
117486
+ ]
117487
+ }
117488
+ }
115252
117489
  }
115253
117490
  ];
115254
117491
 
@@ -117012,6 +119249,7 @@ sessionStorageProvider.setConfig({
117012
119249
  });
117013
119250
  var drawingList = drawingListJSON;
117014
119251
  var drawingsListFullContent = drawingsListFullContentJSON;
119252
+ var maskList = maskListJSON;
117015
119253
  var predefinedAreaList = predefinedAreaListJSON;
117016
119254
  var warningList = warningListJSON.map(function (pw) {
117017
119255
  return Object.assign({}, pw, {
@@ -117125,17 +119363,24 @@ var maritimeWarningEndpoints = [http.post('*/maritime/', /*#__PURE__*/_asyncToGe
117125
119363
  })))];
117126
119364
  var drawingEndpoints = [http.get(/^.*\/drawings\/predefinedAreas$/, function () {
117127
119365
  return HttpResponse.json(predefinedAreaList);
119366
+ }), http.get(/^.*\/drawings$/, function (_ref6) {
119367
+ var request = _ref6.request;
119368
+ var keywords = new URL(request.url).searchParams.get('keywords');
119369
+ if (keywords !== 'mask') {
119370
+ return undefined;
119371
+ }
119372
+ return HttpResponse.json(maskList);
117128
119373
  }), http.get(/^.*\/drawings$/, function () {
117129
119374
  return HttpResponse.json(drawingList);
117130
119375
  }), http.get(/^.*\/area-keywords$/, function () {
117131
119376
  return HttpResponse.json(areaKeywordList);
117132
119377
  }), http.post(/^.*\/drawings\/$/, /*#__PURE__*/function () {
117133
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_ref6) {
119378
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_ref7) {
117134
119379
  var request, body;
117135
119380
  return _regenerator().w(function (_context5) {
117136
119381
  while (1) switch (_context5.n) {
117137
119382
  case 0:
117138
- request = _ref6.request;
119383
+ request = _ref7.request;
117139
119384
  _context5.n = 1;
117140
119385
  return request.json();
117141
119386
  case 1:
@@ -117150,15 +119395,15 @@ var drawingEndpoints = [http.get(/^.*\/drawings\/predefinedAreas$/, function ()
117150
119395
  }, _callee5);
117151
119396
  }));
117152
119397
  return function (_x) {
117153
- return _ref7.apply(this, arguments);
119398
+ return _ref8.apply(this, arguments);
117154
119399
  };
117155
119400
  }()), http.post(/^.*\/drawings\/([^/]+)\/$/, /*#__PURE__*/function () {
117156
- var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref8) {
119401
+ var _ref0 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref9) {
117157
119402
  var params, drawingId, drawing;
117158
119403
  return _regenerator().w(function (_context6) {
117159
119404
  while (1) switch (_context6.n) {
117160
119405
  case 0:
117161
- params = _ref8.params;
119406
+ params = _ref9.params;
117162
119407
  drawingId = params[0];
117163
119408
  drawing = drawingsListFullContent.find(function (drawing) {
117164
119409
  return drawing.id === drawingId;
@@ -117172,11 +119417,11 @@ var drawingEndpoints = [http.get(/^.*\/drawings\/predefinedAreas$/, function ()
117172
119417
  }, _callee6);
117173
119418
  }));
117174
119419
  return function (_x2) {
117175
- return _ref9.apply(this, arguments);
119420
+ return _ref0.apply(this, arguments);
117176
119421
  };
117177
119422
  }())];
117178
- var warningEventsEndpoints = [http.get(/^.*\/events$/, function (_ref0) {
117179
- var request = _ref0.request;
119423
+ var warningEventsEndpoints = [http.get(/^.*\/events$/, function (_ref1) {
119424
+ var request = _ref1.request;
117180
119425
  var url = new URL(request.url);
117181
119426
  var startTime = url.searchParams.get('start_time');
117182
119427
  var endTime = url.searchParams.get('end_time');