@opengeoweb/warnings 12.10.0 → 12.11.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 (25) hide show
  1. package/index.esm.js +651 -468
  2. package/package.json +15 -12
  3. package/src/lib/components/AreaObjectLoader/AreaObjectLoader.stories.d.ts +1 -1
  4. package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +1 -1
  5. package/src/lib/components/DrawingTool/DrawingTool.stories.d.ts +1 -1
  6. package/src/lib/components/FilterList/ExpandableFilterChip.d.ts +0 -1
  7. package/src/lib/components/FilterList/filter-utils.d.ts +49 -4
  8. package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.stories.d.ts +1 -1
  9. package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.d.ts +2 -0
  10. package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.stories.d.ts +1 -1
  11. package/src/lib/components/MaritimeWarningsForm/useConfirmRetractDialog.d.ts +11 -0
  12. package/src/lib/components/MaritimeWarningsForm/useMaritimeWarningsFormState.d.ts +1 -0
  13. package/src/lib/components/MaritimeWarningsForm/utils.d.ts +2 -0
  14. package/src/lib/components/MaritimeWarningsForm/utils.spec.d.ts +1 -0
  15. package/src/lib/components/ObjectManager/ObjectManager.stories.d.ts +17 -18
  16. package/src/lib/components/ObjectManager/ObjectManagerConnect.stories.d.ts +1 -1
  17. package/src/lib/components/PublicWarningList/NewWarningButton/NewWarningButton.stories.d.ts +1 -1
  18. package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +2 -2
  19. package/src/lib/components/PublicWarningsForm/AreaField/AreaField.stories.d.ts +2 -3
  20. package/src/lib/components/PublicWarningsForm/DescriptionField/DescriptionField.stories.d.ts +1 -1
  21. package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +1 -1
  22. package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +3 -3
  23. package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.stories.d.ts +1 -1
  24. package/src/lib/utils/sig-airmet-util.d.ts +3 -3
  25. /package/src/lib/components/MaritimeWarningsForm/{MartitimeWarningsForm.spec.d.ts → MaritimeWarningsForm.spec.d.ts} +0 -0
package/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import { useDispatch, useSelector } from 'react-redux';
3
3
  import { Polygons, ExitDomain, Share, Edit, Delete, CoastalEvent, TemperatureLow, TemperatureHigh, Rain, Snow, Lightning, Fog, Wind, Thunderstorm, VulcanicEruption, Haze, FreezingPrecipitation, ModerateAircraftIcing, SevereAircraftIcing, ModerateTurbulence, SevereTurbulence, SandStorm, RadioactiveMaterials, DrawPolygon, Visibility, Add, ArrowUpCompact, ArrowDownCompact, breakpoints, DragHandle, Options, Close, ChevronDown, ChevronUp, Copy, Update, Cancel, Success, Expire, Remove } from '@opengeoweb/theme';
4
4
  import { uiTypes, uiActions, getSingularDrawtoolDrawLayerId, drawingToolSelectors, layerSelectors, uiSelectors, drawingToolActions, layerActions, mapListener, layersListener, drawingToolListener, syncGroupsListener, openlayersListener, syncGroupsReducer, drawingToolReducer, uiReducer, layerReducer, mapReducer, useSetupDialog, genericSelectors, useUpdateSharedData, genericActions, selectorMemoizationOptions } from '@opengeoweb/store';
5
5
  import { defaultPolygon, emptyGeoJSON, MapControlButton, getIcon, rewindGeometry, getGeoJSONPropertyValue, currentlySupportedDrawModes, defaultLayers, viewUtils, OpenLayersMapView, MapControls, OpenLayersZoomControl, OpenLayersLayer, OpenLayersFeatureLayer, genericOpenLayersFeatureStyle } from '@opengeoweb/webmap-react';
6
- import { SHARED_NAMESPACE, useConfirmationDialog, dateUtils, ToggleMenu, calculateStartSize, ToolContainerDraggable, AlertBanner, sessionStorageProvider, ConfirmationDialog, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, FilterChip, TooltipSelect, CustomToggleButton, Filter, FilterOption, StatusTag, LastUpdateTime, getAxiosErrorMessage, ErrorBoundary } from '@opengeoweb/shared';
6
+ import { SHARED_NAMESPACE, useConfirmationDialog, dateUtils, ToggleMenu, calculateStartSize, ToolContainerDraggable, AlertBanner, sessionStorageProvider, ConfirmationDialog, usePrevious, CustomIconButton, CustomTooltip, Avatar, getInitials, SwitchButton, FilterChip, TooltipSelect, usePreventBrowserClose, CustomToggleButton, Filter, FilterOption, StatusTag, LastUpdateTime, getAxiosErrorMessage, ErrorBoundary } from '@opengeoweb/shared';
7
7
  import { createEntityAdapter, createSlice, createSelector, createListenerMiddleware, current, combineReducers, configureStore } from '@reduxjs/toolkit';
8
8
  import { defaultBbox } from '@opengeoweb/core';
9
9
  import { FORM_FIELDS_NAMESPACE, useDraftFormHelpers, ReactHookFormSelect, ReactHookFormHiddenInput, isValidGeoJsonCoordinates, ReactHookFormTextField, ReactHookFormProvider, defaultFormOptions, errorMessages, isEmpty, ReactHookFormDateTime, isXHoursAfter, isXHoursBefore } from '@opengeoweb/form-fields';
@@ -14,7 +14,7 @@ import { useTranslation } from 'react-i18next';
14
14
  import * as React from 'react';
15
15
  import React__default, { useState, useEffect, useRef, useMemo, useCallback } from 'react';
16
16
  import { useAuthenticationContext as useAuthenticationContext$1 } from '@opengeoweb/authentication';
17
- import { styled, Box, Typography, ListItem, Paper, ListItemButton, Stack, Grid, LinearProgress, Button, MenuItem, FormHelperText, Card, CardContent, Tabs, Tab, useTheme, FormControl, IconButton, CircularProgress, Menu, DialogTitle, DialogContent, Switch, ListItemText } from '@mui/material';
17
+ import { styled, Box, Typography, ListItem, Paper, ListItemButton, Stack, Grid, LinearProgress, Button, MenuItem, FormHelperText, Card, CardContent, Tabs, Tab, useTheme, FormControl, CircularProgress, Menu, DialogTitle, DialogContent, Switch, ListItemText } from '@mui/material';
18
18
  import { VariableSizeList } from 'react-window';
19
19
  import AutoSizer from 'react-virtualized-auto-sizer';
20
20
  import { getHeaders, handleResponse, AirmetPhenomena, SigmetPhenomena, useAuthQuery, useAuthenticationContext, optimisticUpdate, ProductStatus } from '@opengeoweb/api';
@@ -245,7 +245,19 @@ var en = {
245
245
  "maritime-direction-wnw": "West to Northwest",
246
246
  "maritime-direction-nw": "Northwest",
247
247
  "maritime-direction-nwn": "Northwest to North",
248
- "maritime-delete-button": "Delete"
248
+ "maritime-delete-button": "Delete",
249
+ "maritime-retract-warning": "Retract warning",
250
+ "maritime-no-change-of-direction": "(no change of direction)",
251
+ "maritime-retract-dialog-no-change": "(no change in direction)",
252
+ "maritime-retract-dialog-description-suffix": "will be removed",
253
+ "maritime-retract-dialog-empty-warning-description": "The warning will be retracted",
254
+ "maritime-retract-dialog-confirm": "Retract",
255
+ "maritime-retract-success": "Warning retracted successfully",
256
+ "maritime-clear-dialog-title": "Clear all",
257
+ "maritime-clear-dialog-description": "All warnings will be removed from the list",
258
+ "maritime-clear-success": "Warning list cleared successfully",
259
+ "maritime-warning-title-coastal": "Warning Maritime - Coastal Waters",
260
+ "maritime-warning-title-northsea": "Warning Maritime - North Sea Districts"
249
261
  };
250
262
  var nl = {
251
263
  "drawing-tool-form-tools": "Gereedschap",
@@ -279,7 +291,7 @@ var nl = {
279
291
  "object-manager-object-selected": "object geselecteerd",
280
292
  "object-manager-share-menu": "Object delen naar",
281
293
  "public-warning-title": "Publieke Waarschuwing",
282
- "maritime-warning-coastal-title": "Kust Wateren",
294
+ "maritime-warning-coastal-title": "Kustgebieden",
283
295
  "maritime-warning-northsea-title": "Noordzee Districten",
284
296
  "close-warning-dialog-title": "Waarschuwing sluiten",
285
297
  "warning-edit-mode-title": "Wissel naar bewerken",
@@ -429,7 +441,18 @@ var nl = {
429
441
  "maritime-direction-wnw": "West tot noordwest",
430
442
  "maritime-direction-nw": "Noordwest",
431
443
  "maritime-direction-nwn": "Noordwest tot noord",
432
- "maritime-delete-button": "Verwijderen"
444
+ "maritime-delete-button": "Verwijderen",
445
+ "maritime-retract-warning": "Waarschuwing intrekken",
446
+ "maritime-retract-dialog-no-change": "(geen wijziging in richting)",
447
+ "maritime-retract-dialog-empty-warning-description": "De waarschuwing wordt verwijderd",
448
+ "maritime-retract-dialog-description-suffix": "wordt verwijderd",
449
+ "maritime-retract-dialog-confirm": "Intrekken",
450
+ "maritime-retract-success": "Waarschuwing succesvol ingetrokken",
451
+ "maritime-clear-dialog-title": "Wissen",
452
+ "maritime-clear-dialog-description": "Alle waarschuwingen worden verwijderd",
453
+ "maritime-clear-success": "Alle waarchuwingen zijn verwijderd",
454
+ "maritime-warning-title-coastal": "Maritieme Waarschuwing - Kustgebieden",
455
+ "maritime-warning-title-northsea": "Maritieme Waarschuwing - Noordzee Districten"
433
456
  };
434
457
  var fi = {
435
458
  "drawing-tool-form-tools": "Työkalut",
@@ -742,6 +765,9 @@ var warningsTranslations = {
742
765
  no: no
743
766
  };
744
767
 
768
+ function _OverloadYield(e, d) {
769
+ this.v = e, this.k = d;
770
+ }
745
771
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
746
772
  try {
747
773
  var i = n[a](c),
@@ -776,306 +802,248 @@ function _objectWithoutPropertiesLoose(r, e) {
776
802
  }
777
803
  return t;
778
804
  }
779
- function _regeneratorRuntime() {
780
- _regeneratorRuntime = function () {
781
- return e;
782
- };
783
- var t,
784
- e = {},
785
- r = Object.prototype,
786
- n = r.hasOwnProperty,
787
- o = Object.defineProperty || function (t, e, r) {
788
- t[e] = r.value;
789
- },
790
- i = "function" == typeof Symbol ? Symbol : {},
791
- a = i.iterator || "@@iterator",
792
- c = i.asyncIterator || "@@asyncIterator",
793
- u = i.toStringTag || "@@toStringTag";
794
- function define(t, e, r) {
795
- return Object.defineProperty(t, e, {
796
- value: r,
797
- enumerable: true,
798
- configurable: true,
799
- writable: true
800
- }), t[e];
801
- }
802
- try {
803
- define({}, "");
804
- } catch (t) {
805
- define = function (t, e, r) {
806
- return t[e] = r;
807
- };
808
- }
809
- function wrap(t, e, r, n) {
810
- var i = e && e.prototype instanceof Generator ? e : Generator,
811
- a = Object.create(i.prototype),
812
- c = new Context(n || []);
813
- return o(a, "_invoke", {
814
- value: makeInvokeMethod(t, r, c)
815
- }), a;
816
- }
817
- function tryCatch(t, e, r) {
818
- try {
819
- return {
820
- type: "normal",
821
- arg: t.call(e, r)
822
- };
823
- } catch (t) {
824
- return {
825
- type: "throw",
826
- arg: t
805
+ function _regenerator() {
806
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
807
+ var e,
808
+ t,
809
+ r = "function" == typeof Symbol ? Symbol : {},
810
+ n = r.iterator || "@@iterator",
811
+ o = r.toStringTag || "@@toStringTag";
812
+ function i(r, n, o, i) {
813
+ var c = n && n.prototype instanceof Generator ? n : Generator,
814
+ u = Object.create(c.prototype);
815
+ return _regeneratorDefine(u, "_invoke", function (r, n, o) {
816
+ var i,
817
+ c,
818
+ u,
819
+ f = 0,
820
+ p = o || [],
821
+ y = false,
822
+ G = {
823
+ p: 0,
824
+ n: 0,
825
+ v: e,
826
+ a: d,
827
+ f: d.bind(e, 4),
828
+ d: function (t, r) {
829
+ return i = t, c = 0, u = e, G.n = r, a;
830
+ }
831
+ };
832
+ function d(r, n) {
833
+ for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
834
+ var o,
835
+ i = p[t],
836
+ d = G.p,
837
+ l = i[2];
838
+ r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
839
+ }
840
+ if (o || r > 1) return a;
841
+ throw y = true, n;
842
+ }
843
+ return function (o, p, l) {
844
+ if (f > 1) throw TypeError("Generator is already running");
845
+ for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
846
+ i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
847
+ try {
848
+ if (f = 2, i) {
849
+ if (c || (o = "next"), t = i[o]) {
850
+ if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
851
+ if (!t.done) return t;
852
+ u = t.value, c < 2 && (c = 0);
853
+ } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
854
+ i = e;
855
+ } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
856
+ } catch (t) {
857
+ i = e, c = 1, u = t;
858
+ } finally {
859
+ f = 1;
860
+ }
861
+ }
862
+ return {
863
+ value: t,
864
+ done: y
865
+ };
827
866
  };
828
- }
867
+ }(r, o, i), true), u;
829
868
  }
830
- e.wrap = wrap;
831
- var h = "suspendedStart",
832
- l = "suspendedYield",
833
- f = "executing",
834
- s = "completed",
835
- y = {};
869
+ var a = {};
836
870
  function Generator() {}
837
871
  function GeneratorFunction() {}
838
872
  function GeneratorFunctionPrototype() {}
839
- var p = {};
840
- define(p, a, function () {
873
+ t = Object.getPrototypeOf;
874
+ var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
875
+ return this;
876
+ }), t),
877
+ u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
878
+ function f(e) {
879
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
880
+ }
881
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
841
882
  return this;
883
+ }), _regeneratorDefine(u, "toString", function () {
884
+ return "[object Generator]";
885
+ }), (_regenerator = function () {
886
+ return {
887
+ w: i,
888
+ m: f
889
+ };
890
+ })();
891
+ }
892
+ function _regeneratorAsync(n, e, r, t, o) {
893
+ var a = _regeneratorAsyncGen(n, e, r, t, o);
894
+ return a.next().then(function (n) {
895
+ return n.done ? n.value : a.next();
842
896
  });
843
- var d = Object.getPrototypeOf,
844
- v = d && d(d(values([])));
845
- v && v !== r && n.call(v, a) && (p = v);
846
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
847
- function defineIteratorMethods(t) {
848
- ["next", "throw", "return"].forEach(function (e) {
849
- define(t, e, function (t) {
850
- return this._invoke(e, t);
897
+ }
898
+ function _regeneratorAsyncGen(r, e, t, o, n) {
899
+ return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
900
+ }
901
+ function _regeneratorAsyncIterator(t, e) {
902
+ function n(r, o, i, f) {
903
+ try {
904
+ var c = t[r](o),
905
+ u = c.value;
906
+ return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
907
+ n("next", t, i, f);
908
+ }, function (t) {
909
+ n("throw", t, i, f);
910
+ }) : e.resolve(u).then(function (t) {
911
+ c.value = t, i(c);
912
+ }, function (t) {
913
+ return n("throw", t, i, f);
851
914
  });
852
- });
915
+ } catch (t) {
916
+ f(t);
917
+ }
918
+ }
919
+ var r;
920
+ this.next || (_regeneratorDefine(_regeneratorAsyncIterator.prototype), _regeneratorDefine(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
921
+ return this;
922
+ })), _regeneratorDefine(this, "_invoke", function (t, o, i) {
923
+ function f() {
924
+ return new e(function (e, r) {
925
+ n(t, i, e, r);
926
+ });
927
+ }
928
+ return r = r ? r.then(f, f) : f();
929
+ }, true);
930
+ }
931
+ function _regeneratorDefine(e, r, n, t) {
932
+ var i = Object.defineProperty;
933
+ try {
934
+ i({}, "", {});
935
+ } catch (e) {
936
+ i = 0;
853
937
  }
854
- function AsyncIterator(t, e) {
855
- function invoke(r, o, i, a) {
856
- var c = tryCatch(t[r], t, o);
857
- if ("throw" !== c.type) {
858
- var u = c.arg,
859
- h = u.value;
860
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
861
- invoke("next", t, i, a);
862
- }, function (t) {
863
- invoke("throw", t, i, a);
864
- }) : e.resolve(h).then(function (t) {
865
- u.value = t, i(u);
866
- }, function (t) {
867
- return invoke("throw", t, i, a);
938
+ _regeneratorDefine = function (e, r, n, t) {
939
+ if (r) i ? i(e, r, {
940
+ value: n,
941
+ enumerable: !t,
942
+ configurable: !t,
943
+ writable: !t
944
+ }) : e[r] = n;else {
945
+ function o(r, n) {
946
+ _regeneratorDefine(e, r, function (e) {
947
+ return this._invoke(r, n, e);
868
948
  });
869
949
  }
870
- a(c.arg);
871
- }
872
- var r;
873
- o(this, "_invoke", {
874
- value: function (t, n) {
875
- function callInvokeWithMethodAndArg() {
876
- return new e(function (e, r) {
877
- invoke(t, n, e, r);
878
- });
879
- }
880
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
881
- }
882
- });
883
- }
884
- function makeInvokeMethod(e, r, n) {
885
- var o = h;
886
- return function (i, a) {
887
- if (o === f) throw Error("Generator is already running");
888
- if (o === s) {
889
- if ("throw" === i) throw a;
890
- return {
891
- value: t,
892
- done: true
950
+ o("next", 0), o("throw", 1), o("return", 2);
951
+ }
952
+ }, _regeneratorDefine(e, r, n, t);
953
+ }
954
+ function _regeneratorKeys(e) {
955
+ var n = Object(e),
956
+ r = [];
957
+ for (var t in n) r.unshift(t);
958
+ return function e() {
959
+ for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
960
+ return e.done = true, e;
961
+ };
962
+ }
963
+ function _regeneratorValues(e) {
964
+ if (null != e) {
965
+ var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
966
+ r = 0;
967
+ if (t) return t.call(e);
968
+ if ("function" == typeof e.next) return e;
969
+ if (!isNaN(e.length)) return {
970
+ next: function () {
971
+ return e && r >= e.length && (e = void 0), {
972
+ value: e && e[r++],
973
+ done: !e
893
974
  };
894
975
  }
895
- for (n.method = i, n.arg = a;;) {
896
- var c = n.delegate;
897
- if (c) {
898
- var u = maybeInvokeDelegate(c, n);
899
- if (u) {
900
- if (u === y) continue;
901
- return u;
902
- }
903
- }
904
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
905
- if (o === h) throw o = s, n.arg;
906
- n.dispatchException(n.arg);
907
- } else "return" === n.method && n.abrupt("return", n.arg);
908
- o = f;
909
- var p = tryCatch(e, r, n);
910
- if ("normal" === p.type) {
911
- if (o = n.done ? s : l, p.arg === y) continue;
912
- return {
913
- value: p.arg,
914
- done: n.done
915
- };
916
- }
917
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
918
- }
919
- };
920
- }
921
- function maybeInvokeDelegate(e, r) {
922
- var n = r.method,
923
- o = e.iterator[n];
924
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
925
- var i = tryCatch(o, e.iterator, r.arg);
926
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
927
- var a = i.arg;
928
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
929
- }
930
- function pushTryEntry(t) {
931
- var e = {
932
- tryLoc: t[0]
933
976
  };
934
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
935
- }
936
- function resetTryEntry(t) {
937
- var e = t.completion || {};
938
- e.type = "normal", delete e.arg, t.completion = e;
939
977
  }
940
- function Context(t) {
941
- this.tryEntries = [{
942
- tryLoc: "root"
943
- }], t.forEach(pushTryEntry, this), this.reset(true);
978
+ throw new TypeError(typeof e + " is not iterable");
979
+ }
980
+ function _regeneratorRuntime() {
981
+
982
+ var r = _regenerator(),
983
+ e = r.m(_regeneratorRuntime),
984
+ t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
985
+ function n(r) {
986
+ var e = "function" == typeof r && r.constructor;
987
+ return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
944
988
  }
945
- function values(e) {
946
- if (e || "" === e) {
947
- var r = e[a];
948
- if (r) return r.call(e);
949
- if ("function" == typeof e.next) return e;
950
- if (!isNaN(e.length)) {
951
- var o = -1,
952
- i = function next() {
953
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = false, next;
954
- return next.value = t, next.done = true, next;
955
- };
956
- return i.next = i;
989
+ var o = {
990
+ throw: 1,
991
+ return: 2,
992
+ break: 3,
993
+ continue: 3
994
+ };
995
+ function a(r) {
996
+ var e, t;
997
+ return function (n) {
998
+ e || (e = {
999
+ stop: function () {
1000
+ return t(n.a, 2);
1001
+ },
1002
+ catch: function () {
1003
+ return n.v;
1004
+ },
1005
+ abrupt: function (r, e) {
1006
+ return t(n.a, o[r], e);
1007
+ },
1008
+ delegateYield: function (r, o, a) {
1009
+ return e.resultName = o, t(n.d, _regeneratorValues(r), a);
1010
+ },
1011
+ finish: function (r) {
1012
+ return t(n.f, r);
1013
+ }
1014
+ }, t = function (r, t, o) {
1015
+ n.p = e.prev, n.n = e.next;
1016
+ try {
1017
+ return r(t, o);
1018
+ } finally {
1019
+ e.next = n.n;
1020
+ }
1021
+ }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
1022
+ try {
1023
+ return r.call(this, e);
1024
+ } finally {
1025
+ n.p = e.prev, n.n = e.next;
957
1026
  }
958
- }
959
- throw new TypeError(typeof e + " is not iterable");
1027
+ };
960
1028
  }
961
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
962
- value: GeneratorFunctionPrototype,
963
- configurable: true
964
- }), o(GeneratorFunctionPrototype, "constructor", {
965
- value: GeneratorFunction,
966
- configurable: true
967
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
968
- var e = "function" == typeof t && t.constructor;
969
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
970
- }, e.mark = function (t) {
971
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
972
- }, e.awrap = function (t) {
1029
+ return (_regeneratorRuntime = function () {
973
1030
  return {
974
- __await: t
975
- };
976
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
977
- return this;
978
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
979
- void 0 === i && (i = Promise);
980
- var a = new AsyncIterator(wrap(t, r, n, o), i);
981
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
982
- return t.done ? t.value : a.next();
983
- });
984
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
985
- return this;
986
- }), define(g, "toString", function () {
987
- return "[object Generator]";
988
- }), e.keys = function (t) {
989
- var e = Object(t),
990
- r = [];
991
- for (var n in e) r.push(n);
992
- return r.reverse(), function next() {
993
- for (; r.length;) {
994
- var t = r.pop();
995
- if (t in e) return next.value = t, next.done = false, next;
996
- }
997
- return next.done = true, next;
1031
+ wrap: function (e, t, n, o) {
1032
+ return r.w(a(e), t, n, o && o.reverse());
1033
+ },
1034
+ isGeneratorFunction: n,
1035
+ mark: r.m,
1036
+ awrap: function (r, e) {
1037
+ return new _OverloadYield(r, e);
1038
+ },
1039
+ AsyncIterator: _regeneratorAsyncIterator,
1040
+ async: function (r, e, t, o, u) {
1041
+ return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
1042
+ },
1043
+ keys: _regeneratorKeys,
1044
+ values: _regeneratorValues
998
1045
  };
999
- }, e.values = values, Context.prototype = {
1000
- constructor: Context,
1001
- reset: function (e) {
1002
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
1003
- },
1004
- stop: function () {
1005
- this.done = true;
1006
- var t = this.tryEntries[0].completion;
1007
- if ("throw" === t.type) throw t.arg;
1008
- return this.rval;
1009
- },
1010
- dispatchException: function (e) {
1011
- if (this.done) throw e;
1012
- var r = this;
1013
- function handle(n, o) {
1014
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
1015
- }
1016
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
1017
- var i = this.tryEntries[o],
1018
- a = i.completion;
1019
- if ("root" === i.tryLoc) return handle("end");
1020
- if (i.tryLoc <= this.prev) {
1021
- var c = n.call(i, "catchLoc"),
1022
- u = n.call(i, "finallyLoc");
1023
- if (c && u) {
1024
- if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
1025
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
1026
- } else if (c) {
1027
- if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
1028
- } else {
1029
- if (!u) throw Error("try statement without catch or finally");
1030
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
1031
- }
1032
- }
1033
- }
1034
- },
1035
- abrupt: function (t, e) {
1036
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
1037
- var o = this.tryEntries[r];
1038
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
1039
- var i = o;
1040
- break;
1041
- }
1042
- }
1043
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
1044
- var a = i ? i.completion : {};
1045
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
1046
- },
1047
- complete: function (t, e) {
1048
- if ("throw" === t.type) throw t.arg;
1049
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
1050
- },
1051
- finish: function (t) {
1052
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
1053
- var r = this.tryEntries[e];
1054
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
1055
- }
1056
- },
1057
- catch: function (t) {
1058
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
1059
- var r = this.tryEntries[e];
1060
- if (r.tryLoc === t) {
1061
- var n = r.completion;
1062
- if ("throw" === n.type) {
1063
- var o = n.arg;
1064
- resetTryEntry(r);
1065
- }
1066
- return o;
1067
- }
1068
- }
1069
- throw Error("illegal catch attempt");
1070
- },
1071
- delegateYield: function (e, r, n) {
1072
- return this.delegate = {
1073
- iterator: values(e),
1074
- resultName: r,
1075
- nextLoc: n
1076
- }, "next" === this.method && (this.arg = t), y;
1077
- }
1078
- }, e;
1046
+ })();
1079
1047
  }
1080
1048
 
1081
1049
  /* *
@@ -1272,7 +1240,7 @@ var useCloseDrawDialog = function useCloseDrawDialog(_ref) {
1272
1240
  });
1273
1241
  var confirmDialog = useConfirmationDialog();
1274
1242
  var closeDrawDialog = /*#__PURE__*/function () {
1275
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(skipConfirmationDialog) {
1243
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(skipConfirmationDialog) {
1276
1244
  var mayProceed;
1277
1245
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1278
1246
  while (1) switch (_context.prev = _context.next) {
@@ -1444,7 +1412,7 @@ var useObjectDrawDialogAction = function useObjectDrawDialogAction(_ref5) {
1444
1412
  }));
1445
1413
  };
1446
1414
  var openObjectDialog = /*#__PURE__*/function () {
1447
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1415
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1448
1416
  var mayProceed;
1449
1417
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1450
1418
  while (1) switch (_context2.prev = _context2.next) {
@@ -2096,7 +2064,7 @@ var getAreaKeywords = function getAreaKeywords(auth) {
2096
2064
  }).then(handleResponse);
2097
2065
  };
2098
2066
  var saveDrawingAs = /*#__PURE__*/function () {
2099
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(auth, data) {
2067
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(auth, data) {
2100
2068
  var response;
2101
2069
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2102
2070
  while (1) switch (_context.prev = _context.next) {
@@ -2329,7 +2297,7 @@ var publicWarningFormListener = createListenerMiddleware();
2329
2297
  publicWarningFormListener.startListening({
2330
2298
  actionCreator: publicWarningFormActions.openPublicWarningFormDialog,
2331
2299
  effect: function () {
2332
- var _effect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref, listenerApi) {
2300
+ var _effect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref, listenerApi) {
2333
2301
  var payload, panelId;
2334
2302
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2335
2303
  while (1) switch (_context.prev = _context.next) {
@@ -2357,7 +2325,7 @@ publicWarningFormListener.startListening({
2357
2325
  publicWarningFormListener.startListening({
2358
2326
  actionCreator: uiActions.setToggleOpenDialog,
2359
2327
  effect: function () {
2360
- var _effect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2, listenerApi) {
2328
+ var _effect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2, listenerApi) {
2361
2329
  var payload;
2362
2330
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2363
2331
  while (1) switch (_context2.prev = _context2.next) {
@@ -3037,7 +3005,7 @@ var useMutatePublicWarningEditor = function useMutatePublicWarningEditor() {
3037
3005
  }
3038
3006
  }), {
3039
3007
  onSuccess: function () {
3040
- var _onSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, _ref3) {
3008
+ var _onSuccess = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, _ref3) {
3041
3009
  var isEditor;
3042
3010
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3043
3011
  while (1) switch (_context.prev = _context.next) {
@@ -3087,7 +3055,7 @@ var useMutateWarning = function useMutateWarning(snackBarMessage) {
3087
3055
  }));
3088
3056
  },
3089
3057
  onSuccess: function () {
3090
- var _onSuccess2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data, variables) {
3058
+ var _onSuccess2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data, variables) {
3091
3059
  var location, warningDetail, newId, newWarning;
3092
3060
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3093
3061
  while (1) switch (_context2.prev = _context2.next) {
@@ -3153,7 +3121,7 @@ var useMutateDeleteWarning = function useMutateDeleteWarning() {
3153
3121
  return deleteWarning(id, auth);
3154
3122
  },
3155
3123
  onSuccess: function () {
3156
- var _onSuccess3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_, variables) {
3124
+ var _onSuccess3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_, variables) {
3157
3125
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3158
3126
  while (1) switch (_context3.prev = _context3.next) {
3159
3127
  case 0:
@@ -3221,7 +3189,7 @@ var useMutateSaveOrUpdateDrawing = function useMutateSaveOrUpdateDrawing() {
3221
3189
  var queryClient = useQueryClient();
3222
3190
  return useMutation({
3223
3191
  mutationFn: function () {
3224
- var _mutationFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref6) {
3192
+ var _mutationFn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref6) {
3225
3193
  var data, id, headers, location, newId;
3226
3194
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3227
3195
  while (1) switch (_context4.prev = _context4.next) {
@@ -3291,7 +3259,7 @@ var useMutateDeleteDrawing = function useMutateDeleteDrawing() {
3291
3259
  var dispatch = useDispatch();
3292
3260
  return useMutation({
3293
3261
  mutationFn: function () {
3294
- var _mutationFn2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref8) {
3262
+ var _mutationFn2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref8) {
3295
3263
  var drawingId;
3296
3264
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3297
3265
  while (1) switch (_context5.prev = _context5.next) {
@@ -3469,7 +3437,7 @@ var ObjectManagerConnect = function ObjectManagerConnect(_ref) {
3469
3437
  }
3470
3438
  };
3471
3439
  var onClickDrawing = /*#__PURE__*/function () {
3472
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(drawing) {
3440
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(drawing) {
3473
3441
  var isActive;
3474
3442
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3475
3443
  while (1) switch (_context.prev = _context.next) {
@@ -4267,10 +4235,21 @@ var DEFAULT_WARNING_DIALOG_MIN_SIZE = {
4267
4235
  width: 264,
4268
4236
  height: 300
4269
4237
  };
4238
+ var getTitle = function getTitle(warningType, t) {
4239
+ if (warningType === 'airmet' || warningType === 'sigmet') {
4240
+ return warningType == null ? void 0 : warningType.toUpperCase();
4241
+ }
4242
+ if (warningType === 'maritimeWarningCoastal') {
4243
+ return t('maritime-warning-title-coastal');
4244
+ }
4245
+ if (warningType === 'maritimeWarningNorthSea') {
4246
+ return t('maritime-warning-title-northsea');
4247
+ }
4248
+ return t('public-warning-title');
4249
+ };
4270
4250
  var PublicWarningsFormDialog = function PublicWarningsFormDialog(_ref) {
4271
4251
  var bounds = _ref.bounds,
4272
4252
  onClose = _ref.onClose,
4273
- title = _ref.title,
4274
4253
  isOpen = _ref.isOpen,
4275
4254
  _ref$onMouseDown = _ref.onMouseDown,
4276
4255
  onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
@@ -4307,7 +4286,7 @@ var PublicWarningsFormDialog = function PublicWarningsFormDialog(_ref) {
4307
4286
  var _React$useState = React.useState(startSizeCalc),
4308
4287
  sizeInState = _React$useState[0],
4309
4288
  setSizeInState = _React$useState[1];
4310
- var fullTitle = selectedAviationProduct ? warningType == null ? void 0 : warningType.toUpperCase() : title || t('public-warning-title');
4289
+ var fullTitle = getTitle(warningType, t);
4311
4290
  var onChangeMode = function onChangeMode() {
4312
4291
  onChangeFormMode(!isReadOnly);
4313
4292
  };
@@ -4447,8 +4426,8 @@ var getAirmetTAC = function getAirmetTAC(auth, product) {
4447
4426
  body: JSON.stringify(product),
4448
4427
  method: 'POST',
4449
4428
  headers: getHeaders(auth)
4450
- }).then( /*#__PURE__*/function () {
4451
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(r) {
4429
+ }).then(/*#__PURE__*/function () {
4430
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(r) {
4452
4431
  var textData;
4453
4432
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4454
4433
  while (1) switch (_context.prev = _context.next) {
@@ -4482,8 +4461,8 @@ var getSigmetTAC = function getSigmetTAC(auth, product) {
4482
4461
  body: JSON.stringify(product),
4483
4462
  method: 'POST',
4484
4463
  headers: getHeaders(auth)
4485
- }).then( /*#__PURE__*/function () {
4486
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(r) {
4464
+ }).then(/*#__PURE__*/function () {
4465
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(r) {
4487
4466
  var textData;
4488
4467
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4489
4468
  while (1) switch (_context2.prev = _context2.next) {
@@ -4624,7 +4603,7 @@ var usePostSigmet = function usePostSigmet() {
4624
4603
  }));
4625
4604
  },
4626
4605
  onSuccess: function () {
4627
- var _onSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, variables) {
4606
+ var _onSuccess = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, variables) {
4628
4607
  var snackbarKey, warningType;
4629
4608
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4630
4609
  while (1) switch (_context.prev = _context.next) {
@@ -4685,7 +4664,7 @@ var usePostAirmet = function usePostAirmet() {
4685
4664
  }));
4686
4665
  },
4687
4666
  onSuccess: function () {
4688
- var _onSuccess2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data, variables) {
4667
+ var _onSuccess2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data, variables) {
4689
4668
  var snackbarKey, warningType;
4690
4669
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4691
4670
  while (1) switch (_context2.prev = _context2.next) {
@@ -5992,6 +5971,9 @@ var WindForceSelect = function WindForceSelect(_ref) {
5992
5971
  additionalStyling: {
5993
5972
  '& .MuiSvgIcon-root': {
5994
5973
  fill: arrowColor
5974
+ },
5975
+ '& .MuiSelect-standard': {
5976
+ paddingBlock: 0
5995
5977
  }
5996
5978
  }
5997
5979
  });
@@ -6152,6 +6134,8 @@ var WarningListItem$1 = /*#__PURE__*/React__default.memo(function (_ref) {
6152
6134
  var assignedAreas = React__default.useMemo(function () {
6153
6135
  return warning.assignedAreaIds.map(function (areaId) {
6154
6136
  return areasById.get(areaId);
6137
+ }).filter(function (area) {
6138
+ return area !== undefined;
6155
6139
  });
6156
6140
  }, [warning.assignedAreaIds, areasById]);
6157
6141
  var _useWarningsTranslati = useWarningsTranslation(),
@@ -6218,7 +6202,7 @@ var WarningListItem$1 = /*#__PURE__*/React__default.memo(function (_ref) {
6218
6202
  onChange: handleChangeToDirection,
6219
6203
  value: warning.windDirectionTo,
6220
6204
  isDisabled: shouldDisableDirTo
6221
- }), jsx(IconButton, {
6205
+ }), jsx(CustomIconButton, {
6222
6206
  sx: {
6223
6207
  gridArea: 'delete',
6224
6208
  justifySelf: 'end',
@@ -6230,6 +6214,7 @@ var WarningListItem$1 = /*#__PURE__*/React__default.memo(function (_ref) {
6230
6214
  return onRemove(warning.id);
6231
6215
  },
6232
6216
  "aria-label": t('maritime-delete-button'),
6217
+ tooltipTitle: t('maritime-retract-warning'),
6233
6218
  children: jsx(Delete, {})
6234
6219
  })]
6235
6220
  });
@@ -6281,7 +6266,7 @@ var WarningList = function WarningList(_ref) {
6281
6266
  display: 'flex',
6282
6267
  flexDirection: 'column',
6283
6268
  minHeight: 0,
6284
- '--grid-columns': '30px 150px 60px 2fr 100px 100px 1fr' // FIXME modify this using breakpoints
6269
+ '--grid-columns': '30px 150px 60px 2fr 100px 100px 1fr'
6285
6270
  },
6286
6271
  children: [jsxs(Box, {
6287
6272
  sx: (_sx = {
@@ -6334,97 +6319,6 @@ var WarningList = function WarningList(_ref) {
6334
6319
  });
6335
6320
  };
6336
6321
 
6337
- var MaritimeWarningsForm = function MaritimeWarningsForm(_ref) {
6338
- var _sx, _sx2, _sx3;
6339
- var areas = _ref.areas,
6340
- selectedAreaIds = _ref.selectedAreaIds,
6341
- modified = _ref.modified,
6342
- warnings = _ref.warnings,
6343
- onToggleSelectArea = _ref.onToggleSelectArea,
6344
- onAddSelectedAreas = _ref.onAddSelectedAreas,
6345
- onRemoveWarning = _ref.onRemoveWarning,
6346
- onRemoveArea = _ref.onRemoveArea,
6347
- onAddWarning = _ref.onAddWarning,
6348
- onChangeWarning = _ref.onChangeWarning,
6349
- onSubmit = _ref.onSubmit,
6350
- onClear = _ref.onClear,
6351
- onMoveWarning = _ref.onMoveWarning,
6352
- _ref$shouldShowDistri = _ref.shouldShowDistricts,
6353
- shouldShowDistricts = _ref$shouldShowDistri === void 0 ? false : _ref$shouldShowDistri;
6354
- var _useWarningsTranslati = useWarningsTranslation(),
6355
- t = _useWarningsTranslati.t;
6356
- var disabledAreaIds = warnings.flatMap(function (warning) {
6357
- return warning.assignedAreaIds;
6358
- });
6359
- return jsxs(Stack, {
6360
- direction: "column",
6361
- spacing: 3,
6362
- sx: (_sx = {
6363
- height: '100%',
6364
- containerName: 'maritime',
6365
- containerType: 'inline-size',
6366
- padding: 2
6367
- }, _sx["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
6368
- padding: 3
6369
- }, _sx),
6370
- children: [jsx(AreaList, {
6371
- areas: areas,
6372
- selected: selectedAreaIds,
6373
- disabled: disabledAreaIds,
6374
- onClickItem: onToggleSelectArea
6375
- }), jsx(WarningList, {
6376
- warnings: warnings,
6377
- areas: areas,
6378
- selectedAreaIds: selectedAreaIds,
6379
- onAddSelectedAreas: onAddSelectedAreas,
6380
- onRemoveWarning: onRemoveWarning,
6381
- onChangeWarning: onChangeWarning,
6382
- onToggleSelectArea: onToggleSelectArea,
6383
- onRemoveArea: onRemoveArea,
6384
- onMoveWarning: onMoveWarning,
6385
- shouldShowDistricts: shouldShowDistricts
6386
- }), jsxs(Button, {
6387
- onClick: onAddWarning,
6388
- variant: "tertiary",
6389
- size: "small",
6390
- sx: {
6391
- alignSelf: 'flex-start',
6392
- paddingInline: 2
6393
- },
6394
- children: [jsx(Add, {}), t('maritime-new-warning')]
6395
- }), jsxs(Stack, {
6396
- spacing: 2,
6397
- direction: "row",
6398
- sx: (_sx2 = {}, _sx2["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
6399
- position: 'absolute',
6400
- bottom: 0,
6401
- right: 0,
6402
- padding: 3
6403
- }, _sx2),
6404
- children: [jsx(Button, {
6405
- onClick: onClear,
6406
- variant: "tertiary",
6407
- size: "small",
6408
- sx: {
6409
- width: '134px'
6410
- },
6411
- children: t('warning-button-clear')
6412
- }), jsx(Button, {
6413
- variant: "primary",
6414
- size: "small",
6415
- sx: (_sx3 = {
6416
- width: '134px'
6417
- }, _sx3["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
6418
- marginLeft: '24px!important'
6419
- }, _sx3),
6420
- disabled: !modified,
6421
- onClick: onSubmit,
6422
- children: t('warning-button-publish')
6423
- })]
6424
- })]
6425
- });
6426
- };
6427
-
6428
6322
  /* *
6429
6323
  * Licensed under the Apache License, Version 2.0 (the "License");
6430
6324
  * you may not use this file except in compliance with the License.
@@ -6442,14 +6336,17 @@ var MaritimeWarningsForm = function MaritimeWarningsForm(_ref) {
6442
6336
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
6443
6337
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
6444
6338
  * */
6445
- var localWarningId = 0;
6339
+ var unpublishedWarningId = 0;
6446
6340
  function createWarning() {
6447
- localWarningId += 1;
6341
+ unpublishedWarningId += 1;
6448
6342
  return {
6449
6343
  assignedAreaIds: [],
6450
- id: "local-warning-" + localWarningId
6344
+ id: "unpublished-warning-" + unpublishedWarningId
6451
6345
  };
6452
6346
  }
6347
+ function isPublishedWarning(warning) {
6348
+ return !warning.id.startsWith('unpublished-warning');
6349
+ }
6453
6350
  var initialState = {
6454
6351
  selectedAreaIds: [],
6455
6352
  warnings: [createWarning()],
@@ -6587,19 +6484,262 @@ function useMaritimeWarningsFormState() {
6587
6484
  return React__default.useReducer(reducer, initialState);
6588
6485
  }
6589
6486
 
6487
+ function useConfirmRetractDialog(_ref) {
6488
+ var areas = _ref.areas,
6489
+ warnings = _ref.warnings,
6490
+ onRemoveWarning = _ref.onRemoveWarning;
6491
+ var confirmDialog = useConfirmationDialog();
6492
+ var _useWarningsTranslati = useWarningsTranslation(),
6493
+ t = _useWarningsTranslati.t;
6494
+ var getLabelFromOption = React__default.useCallback(function (options, value) {
6495
+ var option = options.find(function (option) {
6496
+ return option.value === value;
6497
+ });
6498
+ if (!option) {
6499
+ return '';
6500
+ }
6501
+ return typeof option.label === 'function' ? option.label(t) : option.label;
6502
+ }, [t]);
6503
+ var getWarningDescription = React__default.useCallback(function (warning) {
6504
+ if (!isPublishedWarning(warning)) {
6505
+ return t('maritime-retract-dialog-empty-warning-description');
6506
+ }
6507
+ var windDirectionFromLabel = getLabelFromOption(windDirections, warning.windDirectionFrom);
6508
+ var areasById = new Map(areas.map(function (area) {
6509
+ return [area.id, area];
6510
+ }));
6511
+ var areaLabels = warning.assignedAreaIds.map(function (areaId) {
6512
+ return areasById.get(areaId).label;
6513
+ });
6514
+ var changeToLabel = warning.changeType === 'NO_CHANGE' ? t('maritime-retract-dialog-no-change') : getLabelFromOption(change, warning.changeType) + " " + getLabelFromOption(windDirections, warning.windDirectionTo);
6515
+ var warningDescription = [windDirectionFromLabel + " " + t('maritime-windforce', {
6516
+ value: warning.windForce
6517
+ })].concat(areaLabels, [changeToLabel]).join(', ');
6518
+ return warningDescription + ". " + t('maritime-retract-dialog-description-suffix');
6519
+ }, [areas, t, getLabelFromOption]);
6520
+ return {
6521
+ onRemoveWarningWithConfirmation: React__default.useCallback(/*#__PURE__*/function () {
6522
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
6523
+ var warning;
6524
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
6525
+ while (1) switch (_context.prev = _context.next) {
6526
+ case 0:
6527
+ warning = warnings.find(function (warning) {
6528
+ return warning.id === id;
6529
+ });
6530
+ _context.next = 3;
6531
+ return confirmDialog({
6532
+ title: t('maritime-retract-warning'),
6533
+ description: '',
6534
+ confirmLabel: t('maritime-retract-dialog-confirm'),
6535
+ cancelLabel: t('close-dialog-cancel'),
6536
+ content: getWarningDescription(warning)
6537
+ });
6538
+ case 3:
6539
+ onRemoveWarning(id);
6540
+ case 4:
6541
+ case "end":
6542
+ return _context.stop();
6543
+ }
6544
+ }, _callee);
6545
+ }));
6546
+ return function (_x) {
6547
+ return _ref2.apply(this, arguments);
6548
+ };
6549
+ }(), [warnings, getWarningDescription, t, confirmDialog, onRemoveWarning])
6550
+ };
6551
+ }
6552
+
6553
+ /* *
6554
+ * Licensed under the Apache License, Version 2.0 (the "License");
6555
+ * you may not use this file except in compliance with the License.
6556
+ * You may obtain a copy of the License at
6557
+ *
6558
+ * http://www.apache.org/licenses/LICENSE-2.0
6559
+ *
6560
+ * Unless required by applicable law or agreed to in writing, software
6561
+ * distributed under the License is distributed on an "AS IS" BASIS,
6562
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6563
+ * See the License for the specific language governing permissions and
6564
+ * limitations under the License.
6565
+ *
6566
+ * Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6567
+ * Copyright 2025 - Finnish Meteorological Institute (FMI)
6568
+ * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
6569
+ * */
6570
+ var isWarningEmpty = function isWarningEmpty(item) {
6571
+ var windDirectionFrom = item.windDirectionFrom,
6572
+ windForce = item.windForce,
6573
+ changeType = item.changeType,
6574
+ windDirectionTo = item.windDirectionTo,
6575
+ assignedAreaIds = item.assignedAreaIds;
6576
+ if (assignedAreaIds.length) {
6577
+ return false;
6578
+ }
6579
+ return [windDirectionFrom, windForce, changeType, windDirectionTo].every(function (value) {
6580
+ return value === undefined || value.trim() === '';
6581
+ });
6582
+ };
6583
+ var isWarningValid = function isWarningValid(item) {
6584
+ var windDirectionFrom = item.windDirectionFrom,
6585
+ windForce = item.windForce,
6586
+ assignedAreaIds = item.assignedAreaIds,
6587
+ changeType = item.changeType,
6588
+ windDirectionTo = item.windDirectionTo;
6589
+ // Direction, windspeed and areas are required.
6590
+ if (!windDirectionFrom || !windForce || !assignedAreaIds.length) {
6591
+ return false;
6592
+ }
6593
+ // If there is a Change selected, Direction to is also required
6594
+ if (changeType && changeType !== 'NO_CHANGE') {
6595
+ return !!windDirectionTo;
6596
+ }
6597
+ return true;
6598
+ };
6599
+ var isWarningsValid = function isWarningsValid(warnings) {
6600
+ // One single empty row is allowed, if not empty it should be valid
6601
+ if (warnings.length === 1) {
6602
+ return isWarningEmpty(warnings[0]) || isWarningValid(warnings[0]);
6603
+ }
6604
+ return warnings.every(function (warning) {
6605
+ return !isWarningEmpty(warning) && isWarningValid(warning);
6606
+ });
6607
+ };
6608
+
6609
+ var MaritimeWarningsForm = function MaritimeWarningsForm(_ref) {
6610
+ var _sx, _sx2, _sx3;
6611
+ var areas = _ref.areas,
6612
+ selectedAreaIds = _ref.selectedAreaIds,
6613
+ modified = _ref.modified,
6614
+ warnings = _ref.warnings,
6615
+ onToggleSelectArea = _ref.onToggleSelectArea,
6616
+ onAddSelectedAreas = _ref.onAddSelectedAreas,
6617
+ onRemoveWarning = _ref.onRemoveWarning,
6618
+ onRemoveArea = _ref.onRemoveArea,
6619
+ onAddWarning = _ref.onAddWarning,
6620
+ onChangeWarning = _ref.onChangeWarning,
6621
+ onSubmit = _ref.onSubmit,
6622
+ onClear = _ref.onClear,
6623
+ onMoveWarning = _ref.onMoveWarning,
6624
+ _ref$shouldShowDistri = _ref.shouldShowDistricts,
6625
+ shouldShowDistricts = _ref$shouldShowDistri === void 0 ? false : _ref$shouldShowDistri;
6626
+ var _useWarningsTranslati = useWarningsTranslation(),
6627
+ t = _useWarningsTranslati.t;
6628
+ var disabledAreaIds = warnings.flatMap(function (warning) {
6629
+ return warning.assignedAreaIds;
6630
+ });
6631
+ var _useConfirmRetractDia = useConfirmRetractDialog({
6632
+ areas: areas,
6633
+ warnings: warnings,
6634
+ onRemoveWarning: onRemoveWarning
6635
+ }),
6636
+ onRemoveWarningWithConfirmation = _useConfirmRetractDia.onRemoveWarningWithConfirmation;
6637
+ var showConfirmDialog = useConfirmationDialog();
6638
+ var onClearWithConfirmation = React__default.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
6639
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
6640
+ while (1) switch (_context.prev = _context.next) {
6641
+ case 0:
6642
+ _context.next = 2;
6643
+ return showConfirmDialog({
6644
+ title: t('maritime-clear-dialog-title'),
6645
+ description: t('maritime-clear-dialog-description'),
6646
+ confirmLabel: t('warning-button-clear'),
6647
+ cancelLabel: t('close-dialog-cancel')
6648
+ });
6649
+ case 2:
6650
+ onClear();
6651
+ case 3:
6652
+ case "end":
6653
+ return _context.stop();
6654
+ }
6655
+ }, _callee);
6656
+ })), [onClear, t, showConfirmDialog]);
6657
+ var isValid = isWarningsValid(warnings);
6658
+ return jsxs(Stack, {
6659
+ direction: "column",
6660
+ spacing: 3,
6661
+ sx: (_sx = {
6662
+ height: '100%',
6663
+ containerName: 'maritime',
6664
+ containerType: 'inline-size',
6665
+ padding: 2
6666
+ }, _sx["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
6667
+ padding: 3
6668
+ }, _sx),
6669
+ children: [jsx(AreaList, {
6670
+ areas: areas,
6671
+ selected: selectedAreaIds,
6672
+ disabled: disabledAreaIds,
6673
+ onClickItem: onToggleSelectArea
6674
+ }), jsx(WarningList, {
6675
+ warnings: warnings,
6676
+ areas: areas,
6677
+ selectedAreaIds: selectedAreaIds,
6678
+ onAddSelectedAreas: onAddSelectedAreas,
6679
+ onRemoveWarning: onRemoveWarningWithConfirmation,
6680
+ onChangeWarning: onChangeWarning,
6681
+ onToggleSelectArea: onToggleSelectArea,
6682
+ onRemoveArea: onRemoveArea,
6683
+ onMoveWarning: onMoveWarning,
6684
+ shouldShowDistricts: shouldShowDistricts
6685
+ }), jsxs(Button, {
6686
+ onClick: onAddWarning,
6687
+ variant: "tertiary",
6688
+ size: "small",
6689
+ sx: {
6690
+ alignSelf: 'flex-start',
6691
+ paddingInline: 2
6692
+ },
6693
+ children: [jsx(Add, {}), t('maritime-new-warning')]
6694
+ }), jsxs(Stack, {
6695
+ spacing: 2,
6696
+ direction: "row",
6697
+ sx: (_sx2 = {}, _sx2["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
6698
+ position: 'absolute',
6699
+ bottom: 0,
6700
+ right: 0,
6701
+ padding: 3
6702
+ }, _sx2),
6703
+ children: [jsx(Button, {
6704
+ onClick: onClearWithConfirmation,
6705
+ variant: "tertiary",
6706
+ size: "small",
6707
+ sx: {
6708
+ width: '134px'
6709
+ },
6710
+ children: t('warning-button-clear')
6711
+ }), jsx(Button, {
6712
+ variant: "primary",
6713
+ size: "small",
6714
+ sx: (_sx3 = {
6715
+ width: '134px'
6716
+ }, _sx3["@container maritime (min-width: " + breakpoints.tablet + "px)"] = {
6717
+ marginLeft: '24px!important'
6718
+ }, _sx3),
6719
+ disabled: !modified || !isValid,
6720
+ onClick: onSubmit,
6721
+ children: t('warning-button-publish')
6722
+ })]
6723
+ })]
6724
+ });
6725
+ };
6726
+
6590
6727
  var areasByDomain = {
6591
6728
  northSeaDistricts: [{
6592
- id: 'DOGGER',
6593
- label: 'Dogger'
6594
- }, {
6595
6729
  id: 'DOVER',
6596
6730
  label: 'Dover'
6731
+ }, {
6732
+ id: 'THAMES',
6733
+ label: 'Thames'
6597
6734
  }, {
6598
6735
  id: 'HUMBER',
6599
6736
  label: 'Humber'
6600
6737
  }, {
6601
- id: 'THAMES',
6602
- label: 'Thames'
6738
+ id: 'DOGGER',
6739
+ label: 'Dogger'
6740
+ }, {
6741
+ id: 'GERMAN_BIGHT',
6742
+ label: 'German Bight'
6603
6743
  }],
6604
6744
  coastalWaters: [{
6605
6745
  id: 'VLISSINGEN',
@@ -6612,15 +6752,32 @@ var areasByDomain = {
6612
6752
  label: 'Hoek van Holland'
6613
6753
  }, {
6614
6754
  id: 'IJMUIDEN',
6615
- label: 'Ijmuiden'
6755
+ label: 'IJmuiden'
6616
6756
  }, {
6617
6757
  id: 'TEXEL',
6618
6758
  label: 'Texel'
6759
+ }, {
6760
+ id: 'HARLINGEN',
6761
+ label: 'Harlingen'
6762
+ }, {
6763
+ id: 'ROTTUM',
6764
+ label: 'Rottum'
6765
+ }, {
6766
+ id: 'DELFZIJL',
6767
+ label: 'Delfzijl'
6768
+ }, {
6769
+ id: 'IJSSELMEER',
6770
+ label: 'IJsselmeer'
6771
+ }, {
6772
+ id: 'MARKERMEER',
6773
+ label: 'Markermeer'
6619
6774
  }]
6620
6775
  };
6621
6776
 
6622
6777
  var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
6623
- var domain = _ref.domain;
6778
+ var domain = _ref.domain,
6779
+ onPreventCloseView = _ref.onPreventCloseView,
6780
+ onModifyForm = _ref.onModifyForm;
6624
6781
  var areas = areasByDomain[domain];
6625
6782
  var shouldShowDistricts = domain === 'northSeaDistricts';
6626
6783
  var _useMaritimeWarningsF = useMaritimeWarningsFormState(),
@@ -6630,19 +6787,21 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
6630
6787
  // FIXME: replace this by warnings from api
6631
6788
  dispatch({
6632
6789
  type: 'initialize',
6633
- warnings: Array.from({
6634
- length: 1
6635
- }).map(function (_, index) {
6636
- return {
6637
- assignedAreaIds: [],
6638
- id: (index + 1).toString(),
6639
- windDirectionFrom: '',
6640
- windDirectionTo: '',
6641
- changeType: 'NO_CHANGE'
6642
- };
6643
- })
6790
+ warnings: []
6644
6791
  });
6645
- }, [dispatch]);
6792
+ }, [dispatch, domain, areas]);
6793
+ React__default.useEffect(function () {
6794
+ onPreventCloseView == null || onPreventCloseView(state.modified);
6795
+ if (onModifyForm) {
6796
+ onModifyForm(state.modified);
6797
+ }
6798
+ // eslint-disable-next-line react-hooks/exhaustive-deps
6799
+ }, [state.modified]);
6800
+ usePreventBrowserClose(state.modified);
6801
+ var dispatchRedux = useDispatch();
6802
+ var showSnackbar = React__default.useCallback(function (message) {
6803
+ dispatchRedux(snackbarActions.openSnackbar(message));
6804
+ }, [dispatchRedux]);
6646
6805
  var onToggleSelectArea = React__default.useCallback(function (id) {
6647
6806
  React__default.startTransition(function () {
6648
6807
  dispatch({
@@ -6666,7 +6825,11 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
6666
6825
  id: id
6667
6826
  });
6668
6827
  });
6669
- }, [dispatch]);
6828
+ showSnackbar({
6829
+ type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
6830
+ key: 'maritime-retract-success'
6831
+ });
6832
+ }, [dispatch, showSnackbar]);
6670
6833
  var onAddWarning = React__default.useCallback(function () {
6671
6834
  React__default.startTransition(function () {
6672
6835
  dispatch({
@@ -6697,7 +6860,11 @@ var MaritimeWarningsFormConnect = function MaritimeWarningsFormConnect(_ref) {
6697
6860
  type: 'clearWarnings'
6698
6861
  });
6699
6862
  });
6700
- }, [dispatch]);
6863
+ showSnackbar({
6864
+ type: snackbarTypes.SnackbarMessageType.TRANSLATABLE_MESSAGE,
6865
+ key: 'maritime-clear-success'
6866
+ });
6867
+ }, [dispatch, showSnackbar]);
6701
6868
  var onMoveWarning = React__default.useCallback(function (oldIndex, newIndex) {
6702
6869
  dispatch({
6703
6870
  type: 'moveWarning',
@@ -6924,7 +7091,7 @@ var Form = function Form(_ref5) {
6924
7091
  var _publicWarningDetails, _publicWarningDetails2;
6925
7092
  var defaultMapPreset = _ref5.defaultMapPreset,
6926
7093
  _ref5$onSaveForm = _ref5.onSaveForm,
6927
- onSaveForm = _ref5$onSaveForm === void 0 ? /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7094
+ onSaveForm = _ref5$onSaveForm === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
6928
7095
  return _regeneratorRuntime().wrap(function _callee$(_context) {
6929
7096
  while (1) switch (_context.prev = _context.next) {
6930
7097
  case 0:
@@ -6936,7 +7103,7 @@ var Form = function Form(_ref5) {
6936
7103
  }, _callee);
6937
7104
  })) : _ref5$onSaveForm,
6938
7105
  _ref5$onPublishForm = _ref5.onPublishForm,
6939
- onPublishForm = _ref5$onPublishForm === void 0 ? /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
7106
+ onPublishForm = _ref5$onPublishForm === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
6940
7107
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
6941
7108
  while (1) switch (_context2.prev = _context2.next) {
6942
7109
  case 0:
@@ -6952,7 +7119,7 @@ var Form = function Form(_ref5) {
6952
7119
  _ref5$onCloseForm = _ref5.onCloseForm,
6953
7120
  onCloseForm = _ref5$onCloseForm === void 0 ? function () {} : _ref5$onCloseForm,
6954
7121
  _ref5$onSaveAviationF = _ref5.onSaveAviationForm,
6955
- onSaveAviationForm = _ref5$onSaveAviationF === void 0 ? /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
7122
+ onSaveAviationForm = _ref5$onSaveAviationF === void 0 ? /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
6956
7123
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
6957
7124
  while (1) switch (_context3.prev = _context3.next) {
6958
7125
  case 0:
@@ -7039,8 +7206,8 @@ var Form = function Form(_ref5) {
7039
7206
  var onPressPublish = function onPressPublish() {
7040
7207
  if (!isPublishing) {
7041
7208
  toggleIsDraft(false);
7042
- void handleSubmit( /*#__PURE__*/function () {
7043
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
7209
+ void handleSubmit(/*#__PURE__*/function () {
7210
+ var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
7044
7211
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
7045
7212
  while (1) switch (_context4.prev = _context4.next) {
7046
7213
  case 0:
@@ -7064,8 +7231,8 @@ var Form = function Form(_ref5) {
7064
7231
  var onPressSave = function onPressSave() {
7065
7232
  if (!isSaving) {
7066
7233
  toggleIsDraft(true);
7067
- void handleSubmit( /*#__PURE__*/function () {
7068
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
7234
+ void handleSubmit(/*#__PURE__*/function () {
7235
+ var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
7069
7236
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
7070
7237
  while (1) switch (_context5.prev = _context5.next) {
7071
7238
  case 0:
@@ -7081,7 +7248,7 @@ var Form = function Form(_ref5) {
7081
7248
  }, _callee5);
7082
7249
  }));
7083
7250
  return function (_x2) {
7084
- return _ref10.apply(this, arguments);
7251
+ return _ref0.apply(this, arguments);
7085
7252
  };
7086
7253
  }())();
7087
7254
  }
@@ -7121,29 +7288,29 @@ var Form = function Form(_ref5) {
7121
7288
  return t('warning-button-publish');
7122
7289
  };
7123
7290
  var handleSubmitAviationProduct = /*#__PURE__*/function () {
7124
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(action, warningType) {
7291
+ var _ref1 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(action, warningType) {
7125
7292
  var formValues;
7126
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
7127
- while (1) switch (_context10.prev = _context10.next) {
7293
+ return _regeneratorRuntime().wrap(function _callee0$(_context0) {
7294
+ while (1) switch (_context0.prev = _context0.next) {
7128
7295
  case 0:
7129
7296
  if (!isSaving) {
7130
- _context10.next = 2;
7297
+ _context0.next = 2;
7131
7298
  break;
7132
7299
  }
7133
- return _context10.abrupt("return");
7300
+ return _context0.abrupt("return");
7134
7301
  case 2:
7135
- _context10.t0 = action;
7136
- _context10.next = _context10.t0 === ProductAction.SAVE ? 5 : _context10.t0 === ProductAction.PUBLISH ? 14 : _context10.t0 === ProductAction.CANCEL ? 17 : _context10.t0 === ProductAction.AMEND ? 19 : _context10.t0 === ProductAction.RENEW ? 21 : _context10.t0 === ProductAction.DISCARD ? 21 : _context10.t0 === ProductAction.DUPLICATE ? 21 : _context10.t0 === ProductAction.CLOSE ? 21 : 22;
7302
+ _context0.t0 = action;
7303
+ _context0.next = _context0.t0 === ProductAction.SAVE ? 5 : _context0.t0 === ProductAction.PUBLISH ? 14 : _context0.t0 === ProductAction.CANCEL ? 17 : _context0.t0 === ProductAction.AMEND ? 19 : _context0.t0 === ProductAction.RENEW ? 21 : _context0.t0 === ProductAction.DISCARD ? 21 : _context0.t0 === ProductAction.DUPLICATE ? 21 : _context0.t0 === ProductAction.CLOSE ? 21 : 22;
7137
7304
  break;
7138
7305
  case 5:
7139
7306
  toggleIsDraft(true);
7140
- _context10.next = 8;
7307
+ _context0.next = 8;
7141
7308
  return trigger();
7142
7309
  case 8:
7143
7310
  // Run validation and show messages
7144
7311
  formValues = getValues();
7145
7312
  setIsSaving(true);
7146
- _context10.next = 12;
7313
+ _context0.next = 12;
7147
7314
  return onSaveAviationForm(formValues, 'DRAFT', warningType, undefined, function (uuid) {
7148
7315
  setValue('uuid', uuid, {
7149
7316
  shouldValidate: true,
@@ -7152,16 +7319,16 @@ var Form = function Form(_ref5) {
7152
7319
  })["catch"](function () {});
7153
7320
  case 12:
7154
7321
  setIsSaving(false);
7155
- return _context10.abrupt("break", 23);
7322
+ return _context0.abrupt("break", 23);
7156
7323
  case 14:
7157
7324
  toggleIsDraft(false);
7158
- void handleSubmit( /*#__PURE__*/function () {
7159
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(formValues) {
7325
+ void handleSubmit(/*#__PURE__*/function () {
7326
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(formValues) {
7160
7327
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
7161
7328
  while (1) switch (_context7.prev = _context7.next) {
7162
7329
  case 0:
7163
7330
  _context7.next = 2;
7164
- return showConfirmDialog(action).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
7331
+ return showConfirmDialog(action).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
7165
7332
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
7166
7333
  while (1) switch (_context6.prev = _context6.next) {
7167
7334
  case 0:
@@ -7184,10 +7351,10 @@ var Form = function Form(_ref5) {
7184
7351
  }, _callee7);
7185
7352
  }));
7186
7353
  return function (_x5) {
7187
- return _ref12.apply(this, arguments);
7354
+ return _ref10.apply(this, arguments);
7188
7355
  };
7189
7356
  }())();
7190
- return _context10.abrupt("break", 23);
7357
+ return _context0.abrupt("break", 23);
7191
7358
  case 17:
7192
7359
  void showConfirmDialog(action).then(function () {
7193
7360
  setIsCancelling(true);
@@ -7196,15 +7363,15 @@ var Form = function Form(_ref5) {
7196
7363
  onCloseForm();
7197
7364
  });
7198
7365
  });
7199
- return _context10.abrupt("break", 23);
7366
+ return _context0.abrupt("break", 23);
7200
7367
  case 19:
7201
- void handleSubmit( /*#__PURE__*/function () {
7202
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(formValues) {
7368
+ void handleSubmit(/*#__PURE__*/function () {
7369
+ var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(formValues) {
7203
7370
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
7204
7371
  while (1) switch (_context9.prev = _context9.next) {
7205
7372
  case 0:
7206
7373
  _context9.next = 2;
7207
- return showConfirmDialog(action).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
7374
+ return showConfirmDialog(action).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
7208
7375
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
7209
7376
  while (1) switch (_context8.prev = _context8.next) {
7210
7377
  case 0:
@@ -7228,22 +7395,22 @@ var Form = function Form(_ref5) {
7228
7395
  }, _callee9);
7229
7396
  }));
7230
7397
  return function (_x6) {
7231
- return _ref14.apply(this, arguments);
7398
+ return _ref12.apply(this, arguments);
7232
7399
  };
7233
7400
  }())();
7234
- return _context10.abrupt("break", 23);
7401
+ return _context0.abrupt("break", 23);
7235
7402
  case 21:
7236
- return _context10.abrupt("break", 23);
7403
+ return _context0.abrupt("break", 23);
7237
7404
  case 22:
7238
7405
  console.warn("Unhandled product action: " + action);
7239
7406
  case 23:
7240
7407
  case "end":
7241
- return _context10.stop();
7408
+ return _context0.stop();
7242
7409
  }
7243
- }, _callee10);
7410
+ }, _callee0);
7244
7411
  }));
7245
7412
  return function handleSubmitAviationProduct(_x3, _x4) {
7246
- return _ref11.apply(this, arguments);
7413
+ return _ref1.apply(this, arguments);
7247
7414
  };
7248
7415
  }();
7249
7416
  var onPressClear = function onPressClear() {
@@ -7381,12 +7548,14 @@ var Form = function Form(_ref5) {
7381
7548
  }
7382
7549
  if (warningType === 'maritimeWarningCoastal') {
7383
7550
  return jsx(MaritimeWarningsFormConnect, {
7384
- domain: "coastalWaters"
7551
+ domain: "coastalWaters",
7552
+ onModifyForm: onFormDirty
7385
7553
  });
7386
7554
  }
7387
7555
  if (warningType === 'maritimeWarningNorthSea') {
7388
7556
  return jsx(MaritimeWarningsFormConnect, {
7389
- domain: "northSeaDistricts"
7557
+ domain: "northSeaDistricts",
7558
+ onModifyForm: onFormDirty
7390
7559
  });
7391
7560
  }
7392
7561
  // Public warnings form
@@ -7744,7 +7913,7 @@ var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
7744
7913
  var isEditor = editor === (auth == null ? void 0 : auth.username) || false;
7745
7914
  var dispatch = useDispatch();
7746
7915
  var publishForm = /*#__PURE__*/function () {
7747
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(newFormValues) {
7916
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(newFormValues) {
7748
7917
  return _regeneratorRuntime().wrap(function _callee$(_context) {
7749
7918
  while (1) switch (_context.prev = _context.next) {
7750
7919
  case 0:
@@ -7789,7 +7958,7 @@ var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
7789
7958
  return selectedProduct.airmet;
7790
7959
  };
7791
7960
  var saveAviationForm = /*#__PURE__*/function () {
7792
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(productToPost, newStatus, warningType, vaSigmetMoveToFIR, setSelectedUUID) {
7961
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(productToPost, newStatus, warningType, vaSigmetMoveToFIR, setSelectedUUID) {
7793
7962
  var _result;
7794
7963
  var product, uuid, result, postProductParam, _postProductParam;
7795
7964
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -7831,7 +8000,7 @@ var PublicWarningsFormConnect = function PublicWarningsFormConnect(_ref) {
7831
8000
  };
7832
8001
  }();
7833
8002
  var saveForm = /*#__PURE__*/function () {
7834
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(newFormValues) {
8003
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(newFormValues) {
7835
8004
  var status;
7836
8005
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
7837
8006
  while (1) switch (_context3.prev = _context3.next) {
@@ -8752,7 +8921,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
8752
8921
  }, [selectedWarning == null ? void 0 : selectedWarning.editor]);
8753
8922
  var updatePublicWarningEditor = useMutatePublicWarningEditor();
8754
8923
  var setIsEditor = /*#__PURE__*/function () {
8755
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(isReadOnly) {
8924
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(isReadOnly) {
8756
8925
  var username, updateEditor;
8757
8926
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8758
8927
  while (1) switch (_context2.prev = _context2.next) {
@@ -8779,7 +8948,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
8779
8948
  }
8780
8949
  },
8781
8950
  onSuccess: function () {
8782
- var _onSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8951
+ var _onSuccess = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8783
8952
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8784
8953
  while (1) switch (_context.prev = _context.next) {
8785
8954
  case 0:
@@ -8835,7 +9004,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
8835
9004
  description: t('warning-view-mode-description'),
8836
9005
  confirmLabel: t('warning-view-mode-confirm'),
8837
9006
  cancelLabel: t('warning-dialog-cancel')
8838
- }).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
9007
+ }).then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
8839
9008
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8840
9009
  while (1) switch (_context3.prev = _context3.next) {
8841
9010
  case 0:
@@ -8852,7 +9021,7 @@ var PublicWarningsFormDialogConnect = function PublicWarningsFormDialogConnect(_
8852
9021
  }
8853
9022
  };
8854
9023
  var closeDialog = /*#__PURE__*/function () {
8855
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
9024
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
8856
9025
  var mayProceed;
8857
9026
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
8858
9027
  while (1) switch (_context4.prev = _context4.next) {
@@ -10529,7 +10698,7 @@ var ConfirmDeleteWarningDialog = function ConfirmDeleteWarningDialog(_ref) {
10529
10698
  error = _React$useState2[0],
10530
10699
  setError = _React$useState2[1];
10531
10700
  var onSubmit = /*#__PURE__*/function () {
10532
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
10701
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
10533
10702
  return _regeneratorRuntime().wrap(function _callee$(_context) {
10534
10703
  while (1) switch (_context.prev = _context.next) {
10535
10704
  case 0:
@@ -10616,7 +10785,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
10616
10785
  });
10617
10786
  var isFormDirty = useSelector(getSelectedPublicIsFormDirty);
10618
10787
  var openPublicWarningDialog = /*#__PURE__*/function () {
10619
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(formAction, warning, warningType) {
10788
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(formAction, warning, warningType) {
10620
10789
  var mayProceed;
10621
10790
  return _regeneratorRuntime().wrap(function _callee$(_context) {
10622
10791
  while (1) switch (_context.prev = _context.next) {
@@ -10663,7 +10832,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
10663
10832
  void openPublicWarningDialog('', undefined, warningType);
10664
10833
  };
10665
10834
  var editWarning = /*#__PURE__*/function () {
10666
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(publicWarning) {
10835
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(publicWarning) {
10667
10836
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10668
10837
  while (1) switch (_context2.prev = _context2.next) {
10669
10838
  case 0:
@@ -10746,7 +10915,7 @@ var PublicWarningListConnect = function PublicWarningListConnect(_ref) {
10746
10915
  var _usePostAirmet = usePostAirmet(),
10747
10916
  postAirmet = _usePostAirmet.mutateAsync;
10748
10917
  var deleteAviationProduct = /*#__PURE__*/function () {
10749
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(productToPost, newStatus, warningType) {
10918
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(productToPost, newStatus, warningType) {
10750
10919
  var uuid, _postProductParam, postProductParam, errorMessage;
10751
10920
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10752
10921
  while (1) switch (_context3.prev = _context3.next) {
@@ -10988,7 +11157,12 @@ var warningListViewPreset = {
10988
11157
  componentType: 'WarningList'};
10989
11158
  var maritimeWarningsViewPreset = {
10990
11159
  componentType: 'MaritimeWarnings'};
10991
- var componentsLookUp = function componentsLookUp(payload) {
11160
+ var componentsLookUp = function componentsLookUp(payload,
11161
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11162
+ ComponentsLookUpWrapper) {
11163
+ if (ComponentsLookUpWrapper === void 0) {
11164
+ ComponentsLookUpWrapper = null;
11165
+ }
10992
11166
  var id = payload.id,
10993
11167
  componentType = payload.componentType,
10994
11168
  initialProps = payload.initialProps;
@@ -11002,6 +11176,15 @@ var componentsLookUp = function componentsLookUp(payload) {
11002
11176
  })
11003
11177
  });
11004
11178
  case maritimeWarningsViewPreset.componentType:
11179
+ if (ComponentsLookUpWrapper) {
11180
+ return jsx(ErrorBoundary, {
11181
+ children: jsx(ComponentsLookUpWrapper, {
11182
+ component: MaritimeWarningsFormConnect,
11183
+ payload: payload,
11184
+ domain: initialProps.domain || 'northSeaDistricts'
11185
+ })
11186
+ });
11187
+ }
11005
11188
  return jsx(ErrorBoundary, {
11006
11189
  children: jsx(MaritimeWarningsFormConnect, {
11007
11190
  domain: initialProps.domain || 'northSeaDistricts'