@opengeoweb/workspace 6.0.2 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -3,19 +3,401 @@ import { createApiInstance, createNonAuthApiInstance, getApi, createFakeApiInsta
3
3
  import { getLeaves, MosaicContext, getAndAssertNodeAtPathExists, createBalancedTreeFromLeaves, MosaicWindow, MosaicWithoutDragDropContext } from 'react-mosaic-component';
4
4
  import { isAxiosError, getAxiosErrorMessage, withEggs, useConfirmationDialog, CustomIconButton, AlertBanner, CustomTooltip, SearchHighlight, ToggleMenu, usePrevious, ToolContainer, CustomToggleButton, ConfirmationServiceProvider, ConfirmationDialog } from '@opengeoweb/shared';
5
5
  import * as React from 'react';
6
- import React__default, { useContext, useRef, useCallback, useDebugValue, createContext, memo, useEffect, forwardRef } from 'react';
7
- import { ThemeWrapper, lightTheme, Menu, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, Clear, Search, WebAssetOff } from '@opengeoweb/theme';
6
+ import React__default, { useContext, useRef, useCallback, useDebugValue, createContext, memo, useEffect, createElement, PureComponent, forwardRef } from 'react';
7
+ import { ThemeWrapper, lightTheme, Menu, SplitVertical, SplitHorizontal, Expand, UnExpand, Close, Delete, Preset, PresetWorkspace, PresetTiles, Search, Clear, WebAssetOff } from '@opengeoweb/theme';
8
8
  import { unstable_batchedUpdates } from 'react-dom';
9
9
  import { SnackbarWrapperConnect } from '@opengeoweb/core';
10
10
  import { timeSeriesModuleConfig } from '@opengeoweb/timeseries';
11
11
  import { AuthenticationProvider, useAuthenticationContext } from '@opengeoweb/authentication';
12
12
  import { jsx } from 'react/jsx-runtime';
13
- import { useTheme as useTheme$2, LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid, Box as Box$2, List, Chip, Stack, debounce as debounce$1, TextField, InputAdornment, Backdrop, Menu as Menu$1, ListSubheader, MenuItem, Tabs } from '@mui/material';
13
+ import { useTheme as useTheme$2, LinearProgress, Typography, ListItem, ListItemButton, ListItemIcon, ListItemText, Grid, Chip, Stack, debounce as debounce$1, TextField, InputAdornment, Box as Box$2, Backdrop, Menu as Menu$1, ListSubheader, MenuItem, Tabs } from '@mui/material';
14
14
  import 'react-mosaic-component/react-mosaic-component.css';
15
15
  import { ReactHookFormTextField, ReactHookFormHiddenInput, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
16
16
 
17
17
  function n$5(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r$5(n){return !!n&&!!n[Q]}function t$5(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v$4(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v$4(n)?3:0}function u$3(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f$3(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t;}function c$3(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v$4(n){return q$5&&n instanceof Set}function p$5(n){return n.o||n.t}function l$4(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d$3(n,e){return void 0===e&&(e=!1),y$2(n)||r$5(n)||!t$5(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h$5),Object.freeze(n),e&&i(n,(function(n,r){return d$3(r,!0)}),!0)),n}function h$5(){n$5(2);}function y$2(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b$3(r){var t=tn[r];return t||n$5(18,r),t}function m$4(n,r){tn[n]||(tn[n]=r);}function _(){return "production"===process.env.NODE_ENV||U||n$5(0),U}function j(n,r){r&&(b$3("Patches"),n.u=[],n.s=[],n.v=r);}function g$3(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U&&(U=n.l);}function w$3(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b$3("ES5").S(e,r,o),o?(i[Q].P&&(g$3(e),n$5(4)),t$5(r)&&(r=M(e,r),e.l||x$2(e,r)),e.u&&b$3("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g$3(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y$2(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A$2(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x$2(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l$4(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A$2(n,e,o,r,i,t,a)})),x$2(n,o,!1),t&&n.u&&b$3("Patches").N(e,t,n.u,n.s);}return e.o}function A$2(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n$5(5),r$5(c)){var p=M(e,c,s&&i&&3!==i.i&&!u$3(i.R,a)?s.concat(a):void 0);if(f$3(o,a,p),!r$5(p))return;e.m=!1;}else v&&o.add(c);if(t$5(c)&&!y$2(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x$2(e,c);}}function x$2(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d$3(r,t);}function z$2(n,r){var t=n[Q];return (t?p$5(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k$4(n){n.P||(n.P=!0,n.l&&k$4(n.l));}function E(n){n.o||(n.o=l$4(n.t));}function N(n,r,t){var e=s(r)?b$3("MapSet").F(r,t):v$4(r)?b$3("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b$3("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function R(e){return r$5(e)||n$5(22,e),function n(r){if(!t$5(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b$3("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1;}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f$3(e,r,n(t));})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l$4(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return "production"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];"production"!==process.env.NODE_ENV&&f(t),en.set(t,n,r);}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k$4(t);break;case 4:o(t)&&k$4(t);}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u$3(r,o))return !0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c$3(f,a))return !0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return !0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return !0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return !0;return !1}function f(r){r.g&&n$5(3,JSON.stringify(p$5(r)));}var s={};m$4("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable);}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r$5(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u$3(e,r)?f[r]||n(o[r]):(f[r]=!0,k$4(t)));})),i(e,(function(n){void 0!==o[n]||u$3(o,n)||(f[n]=!1,k$4(t));}));else if(5===c){if(a(t)&&(k$4(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l]);}}}}(n.p[0]),e(n.p));},K:function(n){return 4===n.i?o(n):a(n)}});}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q$5="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p$5(n);if(!u$3(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t$5(i)?i:i===z$2(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p$5(n)},ownKeys:function(n){return Reflect.ownKeys(p$5(n))},set:function(n,r,t){var e=I(p$5(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z$2(p$5(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c$3(t,i)&&(void 0!==t||u$3(n.t,r)))return !0;E(n),k$4(n);}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z$2(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k$4(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p$5(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n$5(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n$5(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n$5(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n$5(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n$5(6),void 0!==o&&"function"!=typeof o&&n$5(7),t$5(r)){var c=w$3(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g$3(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g$3(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d$3(f,!0),o){var p=[],l=[];b$3("Patches").M(r,f,p,l),o(p,l);}return f}n$5(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t$5(e)||n$5(8),r$5(e)&&(e=R(e));var i=w$3(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n$5(9),e.I&&n$5(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B&&n$5(20),this.O=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b$3("Patches").$;return r$5(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var createNextState3 = fn;
18
18
 
19
+ /**
20
+ * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
21
+ *
22
+ * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
23
+ * during build.
24
+ * @param {number} code
25
+ */
26
+ function formatProdErrorMessage(code) {
27
+ return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
28
+ }
29
+
30
+ // Inlined version of the `symbol-observable` polyfill
31
+ var $$observable = (function () {
32
+ return typeof Symbol === 'function' && Symbol.observable || '@@observable';
33
+ })();
34
+
35
+ /**
36
+ * These are private action types reserved by Redux.
37
+ * For any unknown actions, you must return the current state.
38
+ * If the current state is undefined, you must return the initial state.
39
+ * Do not reference these action types directly in your code.
40
+ */
41
+ var randomString = function randomString() {
42
+ return Math.random().toString(36).substring(7).split('').join('.');
43
+ };
44
+
45
+ var ActionTypes = {
46
+ INIT: "@@redux/INIT" + randomString(),
47
+ REPLACE: "@@redux/REPLACE" + randomString(),
48
+ PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
49
+ return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
50
+ }
51
+ };
52
+
53
+ /**
54
+ * @param {any} obj The object to inspect.
55
+ * @returns {boolean} True if the argument appears to be a plain object.
56
+ */
57
+ function isPlainObject$2(obj) {
58
+ if (typeof obj !== 'object' || obj === null) return false;
59
+ var proto = obj;
60
+
61
+ while (Object.getPrototypeOf(proto) !== null) {
62
+ proto = Object.getPrototypeOf(proto);
63
+ }
64
+
65
+ return Object.getPrototypeOf(obj) === proto;
66
+ }
67
+
68
+ // Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
69
+ function miniKindOf(val) {
70
+ if (val === void 0) return 'undefined';
71
+ if (val === null) return 'null';
72
+ var type = typeof val;
73
+
74
+ switch (type) {
75
+ case 'boolean':
76
+ case 'string':
77
+ case 'number':
78
+ case 'symbol':
79
+ case 'function':
80
+ {
81
+ return type;
82
+ }
83
+ }
84
+
85
+ if (Array.isArray(val)) return 'array';
86
+ if (isDate(val)) return 'date';
87
+ if (isError(val)) return 'error';
88
+ var constructorName = ctorName(val);
89
+
90
+ switch (constructorName) {
91
+ case 'Symbol':
92
+ case 'Promise':
93
+ case 'WeakMap':
94
+ case 'WeakSet':
95
+ case 'Map':
96
+ case 'Set':
97
+ return constructorName;
98
+ } // other
99
+
100
+
101
+ return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
102
+ }
103
+
104
+ function ctorName(val) {
105
+ return typeof val.constructor === 'function' ? val.constructor.name : null;
106
+ }
107
+
108
+ function isError(val) {
109
+ return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
110
+ }
111
+
112
+ function isDate(val) {
113
+ if (val instanceof Date) return true;
114
+ return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
115
+ }
116
+
117
+ function kindOf(val) {
118
+ var typeOfVal = typeof val;
119
+
120
+ if (process.env.NODE_ENV !== 'production') {
121
+ typeOfVal = miniKindOf(val);
122
+ }
123
+
124
+ return typeOfVal;
125
+ }
126
+
127
+ /**
128
+ * @deprecated
129
+ *
130
+ * **We recommend using the `configureStore` method
131
+ * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
132
+ *
133
+ * Redux Toolkit is our recommended approach for writing Redux logic today,
134
+ * including store setup, reducers, data fetching, and more.
135
+ *
136
+ * **For more details, please read this Redux docs page:**
137
+ * **https://redux.js.org/introduction/why-rtk-is-redux-today**
138
+ *
139
+ * `configureStore` from Redux Toolkit is an improved version of `createStore` that
140
+ * simplifies setup and helps avoid common bugs.
141
+ *
142
+ * You should not be using the `redux` core package by itself today, except for learning purposes.
143
+ * The `createStore` method from the core `redux` package will not be removed, but we encourage
144
+ * all users to migrate to using Redux Toolkit for all Redux code.
145
+ *
146
+ * If you want to use `createStore` without this visual deprecation warning, use
147
+ * the `legacy_createStore` import instead:
148
+ *
149
+ * `import { legacy_createStore as createStore} from 'redux'`
150
+ *
151
+ */
152
+
153
+ function createStore(reducer, preloadedState, enhancer) {
154
+ var _ref2;
155
+
156
+ if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
157
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
158
+ }
159
+
160
+ if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
161
+ enhancer = preloadedState;
162
+ preloadedState = undefined;
163
+ }
164
+
165
+ if (typeof enhancer !== 'undefined') {
166
+ if (typeof enhancer !== 'function') {
167
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(1) : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
168
+ }
169
+
170
+ return enhancer(createStore)(reducer, preloadedState);
171
+ }
172
+
173
+ if (typeof reducer !== 'function') {
174
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(2) : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
175
+ }
176
+
177
+ var currentReducer = reducer;
178
+ var currentState = preloadedState;
179
+ var currentListeners = [];
180
+ var nextListeners = currentListeners;
181
+ var isDispatching = false;
182
+ /**
183
+ * This makes a shallow copy of currentListeners so we can use
184
+ * nextListeners as a temporary list while dispatching.
185
+ *
186
+ * This prevents any bugs around consumers calling
187
+ * subscribe/unsubscribe in the middle of a dispatch.
188
+ */
189
+
190
+ function ensureCanMutateNextListeners() {
191
+ if (nextListeners === currentListeners) {
192
+ nextListeners = currentListeners.slice();
193
+ }
194
+ }
195
+ /**
196
+ * Reads the state tree managed by the store.
197
+ *
198
+ * @returns {any} The current state tree of your application.
199
+ */
200
+
201
+
202
+ function getState() {
203
+ if (isDispatching) {
204
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
205
+ }
206
+
207
+ return currentState;
208
+ }
209
+ /**
210
+ * Adds a change listener. It will be called any time an action is dispatched,
211
+ * and some part of the state tree may potentially have changed. You may then
212
+ * call `getState()` to read the current state tree inside the callback.
213
+ *
214
+ * You may call `dispatch()` from a change listener, with the following
215
+ * caveats:
216
+ *
217
+ * 1. The subscriptions are snapshotted just before every `dispatch()` call.
218
+ * If you subscribe or unsubscribe while the listeners are being invoked, this
219
+ * will not have any effect on the `dispatch()` that is currently in progress.
220
+ * However, the next `dispatch()` call, whether nested or not, will use a more
221
+ * recent snapshot of the subscription list.
222
+ *
223
+ * 2. The listener should not expect to see all state changes, as the state
224
+ * might have been updated multiple times during a nested `dispatch()` before
225
+ * the listener is called. It is, however, guaranteed that all subscribers
226
+ * registered before the `dispatch()` started will be called with the latest
227
+ * state by the time it exits.
228
+ *
229
+ * @param {Function} listener A callback to be invoked on every dispatch.
230
+ * @returns {Function} A function to remove this change listener.
231
+ */
232
+
233
+
234
+ function subscribe(listener) {
235
+ if (typeof listener !== 'function') {
236
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(4) : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
237
+ }
238
+
239
+ if (isDispatching) {
240
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
241
+ }
242
+
243
+ var isSubscribed = true;
244
+ ensureCanMutateNextListeners();
245
+ nextListeners.push(listener);
246
+ return function unsubscribe() {
247
+ if (!isSubscribed) {
248
+ return;
249
+ }
250
+
251
+ if (isDispatching) {
252
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
253
+ }
254
+
255
+ isSubscribed = false;
256
+ ensureCanMutateNextListeners();
257
+ var index = nextListeners.indexOf(listener);
258
+ nextListeners.splice(index, 1);
259
+ currentListeners = null;
260
+ };
261
+ }
262
+ /**
263
+ * Dispatches an action. It is the only way to trigger a state change.
264
+ *
265
+ * The `reducer` function, used to create the store, will be called with the
266
+ * current state tree and the given `action`. Its return value will
267
+ * be considered the **next** state of the tree, and the change listeners
268
+ * will be notified.
269
+ *
270
+ * The base implementation only supports plain object actions. If you want to
271
+ * dispatch a Promise, an Observable, a thunk, or something else, you need to
272
+ * wrap your store creating function into the corresponding middleware. For
273
+ * example, see the documentation for the `redux-thunk` package. Even the
274
+ * middleware will eventually dispatch plain object actions using this method.
275
+ *
276
+ * @param {Object} action A plain object representing “what changed”. It is
277
+ * a good idea to keep actions serializable so you can record and replay user
278
+ * sessions, or use the time travelling `redux-devtools`. An action must have
279
+ * a `type` property which may not be `undefined`. It is a good idea to use
280
+ * string constants for action types.
281
+ *
282
+ * @returns {Object} For convenience, the same action object you dispatched.
283
+ *
284
+ * Note that, if you use a custom middleware, it may wrap `dispatch()` to
285
+ * return something else (for example, a Promise you can await).
286
+ */
287
+
288
+
289
+ function dispatch(action) {
290
+ if (!isPlainObject$2(action)) {
291
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(7) : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
292
+ }
293
+
294
+ if (typeof action.type === 'undefined') {
295
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
296
+ }
297
+
298
+ if (isDispatching) {
299
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');
300
+ }
301
+
302
+ try {
303
+ isDispatching = true;
304
+ currentState = currentReducer(currentState, action);
305
+ } finally {
306
+ isDispatching = false;
307
+ }
308
+
309
+ var listeners = currentListeners = nextListeners;
310
+
311
+ for (var i = 0; i < listeners.length; i++) {
312
+ var listener = listeners[i];
313
+ listener();
314
+ }
315
+
316
+ return action;
317
+ }
318
+ /**
319
+ * Replaces the reducer currently used by the store to calculate the state.
320
+ *
321
+ * You might need this if your app implements code splitting and you want to
322
+ * load some of the reducers dynamically. You might also need this if you
323
+ * implement a hot reloading mechanism for Redux.
324
+ *
325
+ * @param {Function} nextReducer The reducer for the store to use instead.
326
+ * @returns {void}
327
+ */
328
+
329
+
330
+ function replaceReducer(nextReducer) {
331
+ if (typeof nextReducer !== 'function') {
332
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(10) : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
333
+ }
334
+
335
+ currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
336
+ // Any reducers that existed in both the new and old rootReducer
337
+ // will receive the previous state. This effectively populates
338
+ // the new state tree with any relevant data from the old one.
339
+
340
+ dispatch({
341
+ type: ActionTypes.REPLACE
342
+ });
343
+ }
344
+ /**
345
+ * Interoperability point for observable/reactive libraries.
346
+ * @returns {observable} A minimal observable of state changes.
347
+ * For more information, see the observable proposal:
348
+ * https://github.com/tc39/proposal-observable
349
+ */
350
+
351
+
352
+ function observable() {
353
+ var _ref;
354
+
355
+ var outerSubscribe = subscribe;
356
+ return _ref = {
357
+ /**
358
+ * The minimal observable subscription method.
359
+ * @param {Object} observer Any object that can be used as an observer.
360
+ * The observer object should have a `next` method.
361
+ * @returns {subscription} An object with an `unsubscribe` method that can
362
+ * be used to unsubscribe the observable from the store, and prevent further
363
+ * emission of values from the observable.
364
+ */
365
+ subscribe: function subscribe(observer) {
366
+ if (typeof observer !== 'object' || observer === null) {
367
+ throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(11) : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
368
+ }
369
+
370
+ function observeState() {
371
+ if (observer.next) {
372
+ observer.next(getState());
373
+ }
374
+ }
375
+
376
+ observeState();
377
+ var unsubscribe = outerSubscribe(observeState);
378
+ return {
379
+ unsubscribe: unsubscribe
380
+ };
381
+ }
382
+ }, _ref[$$observable] = function () {
383
+ return this;
384
+ }, _ref;
385
+ } // When a store is created, an "INIT" action is dispatched so that every
386
+ // reducer returns their initial state. This effectively populates
387
+ // the initial state tree.
388
+
389
+
390
+ dispatch({
391
+ type: ActionTypes.INIT
392
+ });
393
+ return _ref2 = {
394
+ dispatch: dispatch,
395
+ subscribe: subscribe,
396
+ getState: getState,
397
+ replaceReducer: replaceReducer
398
+ }, _ref2[$$observable] = observable, _ref2;
399
+ }
400
+
19
401
  // Cache implementation based on Erik Rasmussen's `lru-memoize`:
20
402
  // https://github.com/erikras/lru-memoize
21
403
  var NOT_FOUND = 'NOT_FOUND';
@@ -371,7 +753,7 @@ var createDraftSafeSelector = function () {
371
753
  return wrappedSelector;
372
754
  };
373
755
  // src/isPlainObject.ts
374
- function isPlainObject$2(value) {
756
+ function isPlainObject$1(value) {
375
757
  if (typeof value !== "object" || value === null)
376
758
  return false;
377
759
  var proto = Object.getPrototypeOf(value);
@@ -490,7 +872,7 @@ function createAction(type, prepareAction) {
490
872
  return actionCreator;
491
873
  }
492
874
  function isAction(action) {
493
- return isPlainObject$2(action) && "type" in action;
875
+ return isPlainObject$1(action) && "type" in action;
494
876
  }
495
877
  function isFSA(action) {
496
878
  return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
@@ -19846,6 +20228,12 @@ var getViewPresetActiveId = function getViewPresetActiveId(store, panelId) {
19846
20228
  var _a;
19847
20229
  return (_a = getViewPresetById(store, panelId)) === null || _a === void 0 ? void 0 : _a.activeViewPresetId;
19848
20230
  };
20231
+ var getViewPresetPanelId = function getViewPresetPanelId(store, mapId) {
20232
+ var _a, _b;
20233
+ return (_b = (_a = getViewPresets(store).find(function (preset) {
20234
+ return preset.activeViewPresetId === mapId;
20235
+ })) === null || _a === void 0 ? void 0 : _a.panelId) !== null && _b !== void 0 ? _b : '';
20236
+ };
19849
20237
  var getDialogOptions = function getDialogOptions(store) {
19850
20238
  return getViewPresetsStore(store).viewPresetDialog || undefined;
19851
20239
  };
@@ -20009,10 +20397,7 @@ var getMosaicNode = createSelector(getWorkspaceState, function (state) {
20009
20397
  */
20010
20398
  var getViewById = function getViewById(store, viewId) {
20011
20399
  var _a, _b;
20012
- if ((_b = (_a = store === null || store === void 0 ? void 0 : store.workspace) === null || _a === void 0 ? void 0 : _a.views.byId) === null || _b === void 0 ? void 0 : _b[viewId]) {
20013
- return store.workspace.views.byId[viewId];
20014
- }
20015
- return null;
20400
+ return (_b = (_a = store === null || store === void 0 ? void 0 : store.workspace) === null || _a === void 0 ? void 0 : _a.views.byId) === null || _b === void 0 ? void 0 : _b[viewId];
20016
20401
  };
20017
20402
  /**
20018
20403
  * Gets all view ids
@@ -27426,422 +27811,6 @@ var DragDropManagerImpl = /*#__PURE__*/function () {
27426
27811
  return DragDropManagerImpl;
27427
27812
  }();
27428
27813
 
27429
- /**
27430
- * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
27431
- *
27432
- * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
27433
- * during build.
27434
- * @param {number} code
27435
- */
27436
- function formatProdErrorMessage(code) {
27437
- return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
27438
- }
27439
-
27440
- // Inlined version of the `symbol-observable` polyfill
27441
- var $$observable = (function () {
27442
- return typeof Symbol === 'function' && Symbol.observable || '@@observable';
27443
- })();
27444
-
27445
- /**
27446
- * These are private action types reserved by Redux.
27447
- * For any unknown actions, you must return the current state.
27448
- * If the current state is undefined, you must return the initial state.
27449
- * Do not reference these action types directly in your code.
27450
- */
27451
- var randomString = function randomString() {
27452
- return Math.random().toString(36).substring(7).split('').join('.');
27453
- };
27454
-
27455
- var ActionTypes = {
27456
- INIT: "@@redux/INIT" + randomString(),
27457
- REPLACE: "@@redux/REPLACE" + randomString(),
27458
- PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
27459
- return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
27460
- }
27461
- };
27462
-
27463
- /**
27464
- * @param {any} obj The object to inspect.
27465
- * @returns {boolean} True if the argument appears to be a plain object.
27466
- */
27467
- function isPlainObject$1(obj) {
27468
- if (typeof obj !== 'object' || obj === null) return false;
27469
- var proto = obj;
27470
-
27471
- while (Object.getPrototypeOf(proto) !== null) {
27472
- proto = Object.getPrototypeOf(proto);
27473
- }
27474
-
27475
- return Object.getPrototypeOf(obj) === proto;
27476
- }
27477
-
27478
- // Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
27479
- function miniKindOf(val) {
27480
- if (val === void 0) return 'undefined';
27481
- if (val === null) return 'null';
27482
- var type = typeof val;
27483
-
27484
- switch (type) {
27485
- case 'boolean':
27486
- case 'string':
27487
- case 'number':
27488
- case 'symbol':
27489
- case 'function':
27490
- {
27491
- return type;
27492
- }
27493
- }
27494
-
27495
- if (Array.isArray(val)) return 'array';
27496
- if (isDate(val)) return 'date';
27497
- if (isError(val)) return 'error';
27498
- var constructorName = ctorName(val);
27499
-
27500
- switch (constructorName) {
27501
- case 'Symbol':
27502
- case 'Promise':
27503
- case 'WeakMap':
27504
- case 'WeakSet':
27505
- case 'Map':
27506
- case 'Set':
27507
- return constructorName;
27508
- } // other
27509
-
27510
-
27511
- return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
27512
- }
27513
-
27514
- function ctorName(val) {
27515
- return typeof val.constructor === 'function' ? val.constructor.name : null;
27516
- }
27517
-
27518
- function isError(val) {
27519
- return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
27520
- }
27521
-
27522
- function isDate(val) {
27523
- if (val instanceof Date) return true;
27524
- return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
27525
- }
27526
-
27527
- function kindOf(val) {
27528
- var typeOfVal = typeof val;
27529
-
27530
- if (process.env.NODE_ENV !== 'production') {
27531
- typeOfVal = miniKindOf(val);
27532
- }
27533
-
27534
- return typeOfVal;
27535
- }
27536
-
27537
- /**
27538
- * @deprecated
27539
- *
27540
- * **We recommend using the `configureStore` method
27541
- * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
27542
- *
27543
- * Redux Toolkit is our recommended approach for writing Redux logic today,
27544
- * including store setup, reducers, data fetching, and more.
27545
- *
27546
- * **For more details, please read this Redux docs page:**
27547
- * **https://redux.js.org/introduction/why-rtk-is-redux-today**
27548
- *
27549
- * `configureStore` from Redux Toolkit is an improved version of `createStore` that
27550
- * simplifies setup and helps avoid common bugs.
27551
- *
27552
- * You should not be using the `redux` core package by itself today, except for learning purposes.
27553
- * The `createStore` method from the core `redux` package will not be removed, but we encourage
27554
- * all users to migrate to using Redux Toolkit for all Redux code.
27555
- *
27556
- * If you want to use `createStore` without this visual deprecation warning, use
27557
- * the `legacy_createStore` import instead:
27558
- *
27559
- * `import { legacy_createStore as createStore} from 'redux'`
27560
- *
27561
- */
27562
-
27563
- function createStore(reducer, preloadedState, enhancer) {
27564
- var _ref2;
27565
-
27566
- if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
27567
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
27568
- }
27569
-
27570
- if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
27571
- enhancer = preloadedState;
27572
- preloadedState = undefined;
27573
- }
27574
-
27575
- if (typeof enhancer !== 'undefined') {
27576
- if (typeof enhancer !== 'function') {
27577
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(1) : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
27578
- }
27579
-
27580
- return enhancer(createStore)(reducer, preloadedState);
27581
- }
27582
-
27583
- if (typeof reducer !== 'function') {
27584
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(2) : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
27585
- }
27586
-
27587
- var currentReducer = reducer;
27588
- var currentState = preloadedState;
27589
- var currentListeners = [];
27590
- var nextListeners = currentListeners;
27591
- var isDispatching = false;
27592
- /**
27593
- * This makes a shallow copy of currentListeners so we can use
27594
- * nextListeners as a temporary list while dispatching.
27595
- *
27596
- * This prevents any bugs around consumers calling
27597
- * subscribe/unsubscribe in the middle of a dispatch.
27598
- */
27599
-
27600
- function ensureCanMutateNextListeners() {
27601
- if (nextListeners === currentListeners) {
27602
- nextListeners = currentListeners.slice();
27603
- }
27604
- }
27605
- /**
27606
- * Reads the state tree managed by the store.
27607
- *
27608
- * @returns {any} The current state tree of your application.
27609
- */
27610
-
27611
-
27612
- function getState() {
27613
- if (isDispatching) {
27614
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
27615
- }
27616
-
27617
- return currentState;
27618
- }
27619
- /**
27620
- * Adds a change listener. It will be called any time an action is dispatched,
27621
- * and some part of the state tree may potentially have changed. You may then
27622
- * call `getState()` to read the current state tree inside the callback.
27623
- *
27624
- * You may call `dispatch()` from a change listener, with the following
27625
- * caveats:
27626
- *
27627
- * 1. The subscriptions are snapshotted just before every `dispatch()` call.
27628
- * If you subscribe or unsubscribe while the listeners are being invoked, this
27629
- * will not have any effect on the `dispatch()` that is currently in progress.
27630
- * However, the next `dispatch()` call, whether nested or not, will use a more
27631
- * recent snapshot of the subscription list.
27632
- *
27633
- * 2. The listener should not expect to see all state changes, as the state
27634
- * might have been updated multiple times during a nested `dispatch()` before
27635
- * the listener is called. It is, however, guaranteed that all subscribers
27636
- * registered before the `dispatch()` started will be called with the latest
27637
- * state by the time it exits.
27638
- *
27639
- * @param {Function} listener A callback to be invoked on every dispatch.
27640
- * @returns {Function} A function to remove this change listener.
27641
- */
27642
-
27643
-
27644
- function subscribe(listener) {
27645
- if (typeof listener !== 'function') {
27646
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(4) : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
27647
- }
27648
-
27649
- if (isDispatching) {
27650
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
27651
- }
27652
-
27653
- var isSubscribed = true;
27654
- ensureCanMutateNextListeners();
27655
- nextListeners.push(listener);
27656
- return function unsubscribe() {
27657
- if (!isSubscribed) {
27658
- return;
27659
- }
27660
-
27661
- if (isDispatching) {
27662
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
27663
- }
27664
-
27665
- isSubscribed = false;
27666
- ensureCanMutateNextListeners();
27667
- var index = nextListeners.indexOf(listener);
27668
- nextListeners.splice(index, 1);
27669
- currentListeners = null;
27670
- };
27671
- }
27672
- /**
27673
- * Dispatches an action. It is the only way to trigger a state change.
27674
- *
27675
- * The `reducer` function, used to create the store, will be called with the
27676
- * current state tree and the given `action`. Its return value will
27677
- * be considered the **next** state of the tree, and the change listeners
27678
- * will be notified.
27679
- *
27680
- * The base implementation only supports plain object actions. If you want to
27681
- * dispatch a Promise, an Observable, a thunk, or something else, you need to
27682
- * wrap your store creating function into the corresponding middleware. For
27683
- * example, see the documentation for the `redux-thunk` package. Even the
27684
- * middleware will eventually dispatch plain object actions using this method.
27685
- *
27686
- * @param {Object} action A plain object representing “what changed”. It is
27687
- * a good idea to keep actions serializable so you can record and replay user
27688
- * sessions, or use the time travelling `redux-devtools`. An action must have
27689
- * a `type` property which may not be `undefined`. It is a good idea to use
27690
- * string constants for action types.
27691
- *
27692
- * @returns {Object} For convenience, the same action object you dispatched.
27693
- *
27694
- * Note that, if you use a custom middleware, it may wrap `dispatch()` to
27695
- * return something else (for example, a Promise you can await).
27696
- */
27697
-
27698
-
27699
- function dispatch(action) {
27700
- if (!isPlainObject$1(action)) {
27701
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(7) : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
27702
- }
27703
-
27704
- if (typeof action.type === 'undefined') {
27705
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
27706
- }
27707
-
27708
- if (isDispatching) {
27709
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');
27710
- }
27711
-
27712
- try {
27713
- isDispatching = true;
27714
- currentState = currentReducer(currentState, action);
27715
- } finally {
27716
- isDispatching = false;
27717
- }
27718
-
27719
- var listeners = currentListeners = nextListeners;
27720
-
27721
- for (var i = 0; i < listeners.length; i++) {
27722
- var listener = listeners[i];
27723
- listener();
27724
- }
27725
-
27726
- return action;
27727
- }
27728
- /**
27729
- * Replaces the reducer currently used by the store to calculate the state.
27730
- *
27731
- * You might need this if your app implements code splitting and you want to
27732
- * load some of the reducers dynamically. You might also need this if you
27733
- * implement a hot reloading mechanism for Redux.
27734
- *
27735
- * @param {Function} nextReducer The reducer for the store to use instead.
27736
- * @returns {void}
27737
- */
27738
-
27739
-
27740
- function replaceReducer(nextReducer) {
27741
- if (typeof nextReducer !== 'function') {
27742
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(10) : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
27743
- }
27744
-
27745
- currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
27746
- // Any reducers that existed in both the new and old rootReducer
27747
- // will receive the previous state. This effectively populates
27748
- // the new state tree with any relevant data from the old one.
27749
-
27750
- dispatch({
27751
- type: ActionTypes.REPLACE
27752
- });
27753
- }
27754
- /**
27755
- * Interoperability point for observable/reactive libraries.
27756
- * @returns {observable} A minimal observable of state changes.
27757
- * For more information, see the observable proposal:
27758
- * https://github.com/tc39/proposal-observable
27759
- */
27760
-
27761
-
27762
- function observable() {
27763
- var _ref;
27764
-
27765
- var outerSubscribe = subscribe;
27766
- return _ref = {
27767
- /**
27768
- * The minimal observable subscription method.
27769
- * @param {Object} observer Any object that can be used as an observer.
27770
- * The observer object should have a `next` method.
27771
- * @returns {subscription} An object with an `unsubscribe` method that can
27772
- * be used to unsubscribe the observable from the store, and prevent further
27773
- * emission of values from the observable.
27774
- */
27775
- subscribe: function subscribe(observer) {
27776
- if (typeof observer !== 'object' || observer === null) {
27777
- throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(11) : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
27778
- }
27779
-
27780
- function observeState() {
27781
- if (observer.next) {
27782
- observer.next(getState());
27783
- }
27784
- }
27785
-
27786
- observeState();
27787
- var unsubscribe = outerSubscribe(observeState);
27788
- return {
27789
- unsubscribe: unsubscribe
27790
- };
27791
- }
27792
- }, _ref[$$observable] = function () {
27793
- return this;
27794
- }, _ref;
27795
- } // When a store is created, an "INIT" action is dispatched so that every
27796
- // reducer returns their initial state. This effectively populates
27797
- // the initial state tree.
27798
-
27799
-
27800
- dispatch({
27801
- type: ActionTypes.INIT
27802
- });
27803
- return _ref2 = {
27804
- dispatch: dispatch,
27805
- subscribe: subscribe,
27806
- getState: getState,
27807
- replaceReducer: replaceReducer
27808
- }, _ref2[$$observable] = observable, _ref2;
27809
- }
27810
-
27811
- /**
27812
- * Prints a warning in the console if it exists.
27813
- *
27814
- * @param {String} message The warning message.
27815
- * @returns {void}
27816
- */
27817
- function warning(message) {
27818
- /* eslint-disable no-console */
27819
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
27820
- console.error(message);
27821
- }
27822
- /* eslint-enable no-console */
27823
-
27824
-
27825
- try {
27826
- // This error was thrown as a convenience so that if you enable
27827
- // "break on all exceptions" in your console,
27828
- // it would pause the execution at this line.
27829
- throw new Error(message);
27830
- } catch (e) {} // eslint-disable-line no-empty
27831
-
27832
- }
27833
-
27834
- /*
27835
- * This is a dummy function to check if the function name has been altered by minification.
27836
- * If the function has been minified and NODE_ENV !== 'production', warn the user.
27837
- */
27838
-
27839
- function isCrushed() {}
27840
-
27841
- if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
27842
- warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
27843
- }
27844
-
27845
27814
  var strictEquality = function strictEquality(a, b) {
27846
27815
  return a === b;
27847
27816
  };
@@ -31688,6 +31657,798 @@ var getFilteredViewPresetListForView = createSelector(getViewPresetsList, getVie
31688
31657
  };
31689
31658
  });
31690
31659
 
31660
+ function _assertThisInitialized(self) {
31661
+ if (self === void 0) {
31662
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
31663
+ }
31664
+ return self;
31665
+ }
31666
+
31667
+ function _setPrototypeOf(o, p) {
31668
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
31669
+ o.__proto__ = p;
31670
+ return o;
31671
+ };
31672
+ return _setPrototypeOf(o, p);
31673
+ }
31674
+
31675
+ function _inheritsLoose(subClass, superClass) {
31676
+ subClass.prototype = Object.create(superClass.prototype);
31677
+ subClass.prototype.constructor = subClass;
31678
+ _setPrototypeOf(subClass, superClass);
31679
+ }
31680
+
31681
+ var safeIsNaN = Number.isNaN ||
31682
+ function ponyfill(value) {
31683
+ return typeof value === 'number' && value !== value;
31684
+ };
31685
+ function isEqual(first, second) {
31686
+ if (first === second) {
31687
+ return true;
31688
+ }
31689
+ if (safeIsNaN(first) && safeIsNaN(second)) {
31690
+ return true;
31691
+ }
31692
+ return false;
31693
+ }
31694
+ function areInputsEqual(newInputs, lastInputs) {
31695
+ if (newInputs.length !== lastInputs.length) {
31696
+ return false;
31697
+ }
31698
+ for (var i = 0; i < newInputs.length; i++) {
31699
+ if (!isEqual(newInputs[i], lastInputs[i])) {
31700
+ return false;
31701
+ }
31702
+ }
31703
+ return true;
31704
+ }
31705
+
31706
+ function memoizeOne(resultFn, isEqual) {
31707
+ if (isEqual === void 0) { isEqual = areInputsEqual; }
31708
+ var lastThis;
31709
+ var lastArgs = [];
31710
+ var lastResult;
31711
+ var calledOnce = false;
31712
+ function memoized() {
31713
+ var newArgs = [];
31714
+ for (var _i = 0; _i < arguments.length; _i++) {
31715
+ newArgs[_i] = arguments[_i];
31716
+ }
31717
+ if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
31718
+ return lastResult;
31719
+ }
31720
+ lastResult = resultFn.apply(this, newArgs);
31721
+ calledOnce = true;
31722
+ lastThis = this;
31723
+ lastArgs = newArgs;
31724
+ return lastResult;
31725
+ }
31726
+ return memoized;
31727
+ }
31728
+
31729
+ // Animation frame based implementation of setTimeout.
31730
+ // Inspired by Joe Lambert, https://gist.github.com/joelambert/1002116#file-requesttimeout-js
31731
+ var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
31732
+ var now = hasNativePerformanceNow ? function () {
31733
+ return performance.now();
31734
+ } : function () {
31735
+ return Date.now();
31736
+ };
31737
+ function cancelTimeout(timeoutID) {
31738
+ cancelAnimationFrame(timeoutID.id);
31739
+ }
31740
+ function requestTimeout(callback, delay) {
31741
+ var start = now();
31742
+
31743
+ function tick() {
31744
+ if (now() - start >= delay) {
31745
+ callback.call(null);
31746
+ } else {
31747
+ timeoutID.id = requestAnimationFrame(tick);
31748
+ }
31749
+ }
31750
+
31751
+ var timeoutID = {
31752
+ id: requestAnimationFrame(tick)
31753
+ };
31754
+ return timeoutID;
31755
+ }
31756
+
31757
+ var size = -1; // This utility copied from "dom-helpers" package.
31758
+
31759
+ function getScrollbarSize(recalculate) {
31760
+ if (recalculate === void 0) {
31761
+ recalculate = false;
31762
+ }
31763
+
31764
+ if (size === -1 || recalculate) {
31765
+ var div = document.createElement('div');
31766
+ var style = div.style;
31767
+ style.width = '50px';
31768
+ style.height = '50px';
31769
+ style.overflow = 'scroll';
31770
+ document.body.appendChild(div);
31771
+ size = div.offsetWidth - div.clientWidth;
31772
+ document.body.removeChild(div);
31773
+ }
31774
+
31775
+ return size;
31776
+ }
31777
+ var cachedRTLResult = null; // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
31778
+ // Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).
31779
+ // Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.
31780
+ // The safest way to check this is to intentionally set a negative offset,
31781
+ // and then verify that the subsequent "scroll" event matches the negative offset.
31782
+ // If it does not match, then we can assume a non-standard RTL scroll implementation.
31783
+
31784
+ function getRTLOffsetType(recalculate) {
31785
+ if (recalculate === void 0) {
31786
+ recalculate = false;
31787
+ }
31788
+
31789
+ if (cachedRTLResult === null || recalculate) {
31790
+ var outerDiv = document.createElement('div');
31791
+ var outerStyle = outerDiv.style;
31792
+ outerStyle.width = '50px';
31793
+ outerStyle.height = '50px';
31794
+ outerStyle.overflow = 'scroll';
31795
+ outerStyle.direction = 'rtl';
31796
+ var innerDiv = document.createElement('div');
31797
+ var innerStyle = innerDiv.style;
31798
+ innerStyle.width = '100px';
31799
+ innerStyle.height = '100px';
31800
+ outerDiv.appendChild(innerDiv);
31801
+ document.body.appendChild(outerDiv);
31802
+
31803
+ if (outerDiv.scrollLeft > 0) {
31804
+ cachedRTLResult = 'positive-descending';
31805
+ } else {
31806
+ outerDiv.scrollLeft = 1;
31807
+
31808
+ if (outerDiv.scrollLeft === 0) {
31809
+ cachedRTLResult = 'negative';
31810
+ } else {
31811
+ cachedRTLResult = 'positive-ascending';
31812
+ }
31813
+ }
31814
+
31815
+ document.body.removeChild(outerDiv);
31816
+ return cachedRTLResult;
31817
+ }
31818
+
31819
+ return cachedRTLResult;
31820
+ }
31821
+
31822
+ if (process.env.NODE_ENV !== 'production') ;
31823
+
31824
+ var IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150;
31825
+
31826
+ var defaultItemKey$1 = function defaultItemKey(index, data) {
31827
+ return index;
31828
+ }; // In DEV mode, this Set helps us only log a warning once per component instance.
31829
+ // This avoids spamming the console every time a render happens.
31830
+
31831
+
31832
+ var devWarningsDirection = null;
31833
+ var devWarningsTagName$1 = null;
31834
+
31835
+ if (process.env.NODE_ENV !== 'production') {
31836
+ if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {
31837
+ devWarningsDirection = /*#__PURE__*/new WeakSet();
31838
+ devWarningsTagName$1 = /*#__PURE__*/new WeakSet();
31839
+ }
31840
+ }
31841
+
31842
+ function createListComponent(_ref) {
31843
+ var _class;
31844
+
31845
+ var getItemOffset = _ref.getItemOffset,
31846
+ getEstimatedTotalSize = _ref.getEstimatedTotalSize,
31847
+ getItemSize = _ref.getItemSize,
31848
+ getOffsetForIndexAndAlignment = _ref.getOffsetForIndexAndAlignment,
31849
+ getStartIndexForOffset = _ref.getStartIndexForOffset,
31850
+ getStopIndexForStartIndex = _ref.getStopIndexForStartIndex,
31851
+ initInstanceProps = _ref.initInstanceProps,
31852
+ shouldResetStyleCacheOnItemSizeChange = _ref.shouldResetStyleCacheOnItemSizeChange,
31853
+ validateProps = _ref.validateProps;
31854
+ return _class = /*#__PURE__*/function (_PureComponent) {
31855
+ _inheritsLoose(List, _PureComponent);
31856
+
31857
+ // Always use explicit constructor for React components.
31858
+ // It produces less code after transpilation. (#26)
31859
+ // eslint-disable-next-line no-useless-constructor
31860
+ function List(props) {
31861
+ var _this;
31862
+
31863
+ _this = _PureComponent.call(this, props) || this;
31864
+ _this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_this));
31865
+ _this._outerRef = void 0;
31866
+ _this._resetIsScrollingTimeoutId = null;
31867
+ _this.state = {
31868
+ instance: _assertThisInitialized(_this),
31869
+ isScrolling: false,
31870
+ scrollDirection: 'forward',
31871
+ scrollOffset: typeof _this.props.initialScrollOffset === 'number' ? _this.props.initialScrollOffset : 0,
31872
+ scrollUpdateWasRequested: false
31873
+ };
31874
+ _this._callOnItemsRendered = void 0;
31875
+ _this._callOnItemsRendered = memoizeOne(function (overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
31876
+ return _this.props.onItemsRendered({
31877
+ overscanStartIndex: overscanStartIndex,
31878
+ overscanStopIndex: overscanStopIndex,
31879
+ visibleStartIndex: visibleStartIndex,
31880
+ visibleStopIndex: visibleStopIndex
31881
+ });
31882
+ });
31883
+ _this._callOnScroll = void 0;
31884
+ _this._callOnScroll = memoizeOne(function (scrollDirection, scrollOffset, scrollUpdateWasRequested) {
31885
+ return _this.props.onScroll({
31886
+ scrollDirection: scrollDirection,
31887
+ scrollOffset: scrollOffset,
31888
+ scrollUpdateWasRequested: scrollUpdateWasRequested
31889
+ });
31890
+ });
31891
+ _this._getItemStyle = void 0;
31892
+
31893
+ _this._getItemStyle = function (index) {
31894
+ var _this$props = _this.props,
31895
+ direction = _this$props.direction,
31896
+ itemSize = _this$props.itemSize,
31897
+ layout = _this$props.layout;
31898
+
31899
+ var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize, shouldResetStyleCacheOnItemSizeChange && layout, shouldResetStyleCacheOnItemSizeChange && direction);
31900
+
31901
+ var style;
31902
+
31903
+ if (itemStyleCache.hasOwnProperty(index)) {
31904
+ style = itemStyleCache[index];
31905
+ } else {
31906
+ var _offset = getItemOffset(_this.props, index, _this._instanceProps);
31907
+
31908
+ var size = getItemSize(_this.props, index, _this._instanceProps); // TODO Deprecate direction "horizontal"
31909
+
31910
+ var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
31911
+ var isRtl = direction === 'rtl';
31912
+ var offsetHorizontal = isHorizontal ? _offset : 0;
31913
+ itemStyleCache[index] = style = {
31914
+ position: 'absolute',
31915
+ left: isRtl ? undefined : offsetHorizontal,
31916
+ right: isRtl ? offsetHorizontal : undefined,
31917
+ top: !isHorizontal ? _offset : 0,
31918
+ height: !isHorizontal ? size : '100%',
31919
+ width: isHorizontal ? size : '100%'
31920
+ };
31921
+ }
31922
+
31923
+ return style;
31924
+ };
31925
+
31926
+ _this._getItemStyleCache = void 0;
31927
+ _this._getItemStyleCache = memoizeOne(function (_, __, ___) {
31928
+ return {};
31929
+ });
31930
+
31931
+ _this._onScrollHorizontal = function (event) {
31932
+ var _event$currentTarget = event.currentTarget,
31933
+ clientWidth = _event$currentTarget.clientWidth,
31934
+ scrollLeft = _event$currentTarget.scrollLeft,
31935
+ scrollWidth = _event$currentTarget.scrollWidth;
31936
+
31937
+ _this.setState(function (prevState) {
31938
+ if (prevState.scrollOffset === scrollLeft) {
31939
+ // Scroll position may have been updated by cDM/cDU,
31940
+ // In which case we don't need to trigger another render,
31941
+ // And we don't want to update state.isScrolling.
31942
+ return null;
31943
+ }
31944
+
31945
+ var direction = _this.props.direction;
31946
+ var scrollOffset = scrollLeft;
31947
+
31948
+ if (direction === 'rtl') {
31949
+ // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
31950
+ // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
31951
+ // It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
31952
+ // So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.
31953
+ switch (getRTLOffsetType()) {
31954
+ case 'negative':
31955
+ scrollOffset = -scrollLeft;
31956
+ break;
31957
+
31958
+ case 'positive-descending':
31959
+ scrollOffset = scrollWidth - clientWidth - scrollLeft;
31960
+ break;
31961
+ }
31962
+ } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
31963
+
31964
+
31965
+ scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
31966
+ return {
31967
+ isScrolling: true,
31968
+ scrollDirection: prevState.scrollOffset < scrollLeft ? 'forward' : 'backward',
31969
+ scrollOffset: scrollOffset,
31970
+ scrollUpdateWasRequested: false
31971
+ };
31972
+ }, _this._resetIsScrollingDebounced);
31973
+ };
31974
+
31975
+ _this._onScrollVertical = function (event) {
31976
+ var _event$currentTarget2 = event.currentTarget,
31977
+ clientHeight = _event$currentTarget2.clientHeight,
31978
+ scrollHeight = _event$currentTarget2.scrollHeight,
31979
+ scrollTop = _event$currentTarget2.scrollTop;
31980
+
31981
+ _this.setState(function (prevState) {
31982
+ if (prevState.scrollOffset === scrollTop) {
31983
+ // Scroll position may have been updated by cDM/cDU,
31984
+ // In which case we don't need to trigger another render,
31985
+ // And we don't want to update state.isScrolling.
31986
+ return null;
31987
+ } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
31988
+
31989
+
31990
+ var scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
31991
+ return {
31992
+ isScrolling: true,
31993
+ scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',
31994
+ scrollOffset: scrollOffset,
31995
+ scrollUpdateWasRequested: false
31996
+ };
31997
+ }, _this._resetIsScrollingDebounced);
31998
+ };
31999
+
32000
+ _this._outerRefSetter = function (ref) {
32001
+ var outerRef = _this.props.outerRef;
32002
+ _this._outerRef = ref;
32003
+
32004
+ if (typeof outerRef === 'function') {
32005
+ outerRef(ref);
32006
+ } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {
32007
+ outerRef.current = ref;
32008
+ }
32009
+ };
32010
+
32011
+ _this._resetIsScrollingDebounced = function () {
32012
+ if (_this._resetIsScrollingTimeoutId !== null) {
32013
+ cancelTimeout(_this._resetIsScrollingTimeoutId);
32014
+ }
32015
+
32016
+ _this._resetIsScrollingTimeoutId = requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1);
32017
+ };
32018
+
32019
+ _this._resetIsScrolling = function () {
32020
+ _this._resetIsScrollingTimeoutId = null;
32021
+
32022
+ _this.setState({
32023
+ isScrolling: false
32024
+ }, function () {
32025
+ // Clear style cache after state update has been committed.
32026
+ // This way we don't break pure sCU for items that don't use isScrolling param.
32027
+ _this._getItemStyleCache(-1, null);
32028
+ });
32029
+ };
32030
+
32031
+ return _this;
32032
+ }
32033
+
32034
+ List.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
32035
+ validateSharedProps$1(nextProps, prevState);
32036
+ validateProps(nextProps);
32037
+ return null;
32038
+ };
32039
+
32040
+ var _proto = List.prototype;
32041
+
32042
+ _proto.scrollTo = function scrollTo(scrollOffset) {
32043
+ scrollOffset = Math.max(0, scrollOffset);
32044
+ this.setState(function (prevState) {
32045
+ if (prevState.scrollOffset === scrollOffset) {
32046
+ return null;
32047
+ }
32048
+
32049
+ return {
32050
+ scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',
32051
+ scrollOffset: scrollOffset,
32052
+ scrollUpdateWasRequested: true
32053
+ };
32054
+ }, this._resetIsScrollingDebounced);
32055
+ };
32056
+
32057
+ _proto.scrollToItem = function scrollToItem(index, align) {
32058
+ if (align === void 0) {
32059
+ align = 'auto';
32060
+ }
32061
+
32062
+ var _this$props2 = this.props,
32063
+ itemCount = _this$props2.itemCount,
32064
+ layout = _this$props2.layout;
32065
+ var scrollOffset = this.state.scrollOffset;
32066
+ index = Math.max(0, Math.min(index, itemCount - 1)); // The scrollbar size should be considered when scrolling an item into view, to ensure it's fully visible.
32067
+ // But we only need to account for its size when it's actually visible.
32068
+ // This is an edge case for lists; normally they only scroll in the dominant direction.
32069
+
32070
+ var scrollbarSize = 0;
32071
+
32072
+ if (this._outerRef) {
32073
+ var outerRef = this._outerRef;
32074
+
32075
+ if (layout === 'vertical') {
32076
+ scrollbarSize = outerRef.scrollWidth > outerRef.clientWidth ? getScrollbarSize() : 0;
32077
+ } else {
32078
+ scrollbarSize = outerRef.scrollHeight > outerRef.clientHeight ? getScrollbarSize() : 0;
32079
+ }
32080
+ }
32081
+
32082
+ this.scrollTo(getOffsetForIndexAndAlignment(this.props, index, align, scrollOffset, this._instanceProps, scrollbarSize));
32083
+ };
32084
+
32085
+ _proto.componentDidMount = function componentDidMount() {
32086
+ var _this$props3 = this.props,
32087
+ direction = _this$props3.direction,
32088
+ initialScrollOffset = _this$props3.initialScrollOffset,
32089
+ layout = _this$props3.layout;
32090
+
32091
+ if (typeof initialScrollOffset === 'number' && this._outerRef != null) {
32092
+ var outerRef = this._outerRef; // TODO Deprecate direction "horizontal"
32093
+
32094
+ if (direction === 'horizontal' || layout === 'horizontal') {
32095
+ outerRef.scrollLeft = initialScrollOffset;
32096
+ } else {
32097
+ outerRef.scrollTop = initialScrollOffset;
32098
+ }
32099
+ }
32100
+
32101
+ this._callPropsCallbacks();
32102
+ };
32103
+
32104
+ _proto.componentDidUpdate = function componentDidUpdate() {
32105
+ var _this$props4 = this.props,
32106
+ direction = _this$props4.direction,
32107
+ layout = _this$props4.layout;
32108
+ var _this$state = this.state,
32109
+ scrollOffset = _this$state.scrollOffset,
32110
+ scrollUpdateWasRequested = _this$state.scrollUpdateWasRequested;
32111
+
32112
+ if (scrollUpdateWasRequested && this._outerRef != null) {
32113
+ var outerRef = this._outerRef; // TODO Deprecate direction "horizontal"
32114
+
32115
+ if (direction === 'horizontal' || layout === 'horizontal') {
32116
+ if (direction === 'rtl') {
32117
+ // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
32118
+ // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
32119
+ // So we need to determine which browser behavior we're dealing with, and mimic it.
32120
+ switch (getRTLOffsetType()) {
32121
+ case 'negative':
32122
+ outerRef.scrollLeft = -scrollOffset;
32123
+ break;
32124
+
32125
+ case 'positive-ascending':
32126
+ outerRef.scrollLeft = scrollOffset;
32127
+ break;
32128
+
32129
+ default:
32130
+ var clientWidth = outerRef.clientWidth,
32131
+ scrollWidth = outerRef.scrollWidth;
32132
+ outerRef.scrollLeft = scrollWidth - clientWidth - scrollOffset;
32133
+ break;
32134
+ }
32135
+ } else {
32136
+ outerRef.scrollLeft = scrollOffset;
32137
+ }
32138
+ } else {
32139
+ outerRef.scrollTop = scrollOffset;
32140
+ }
32141
+ }
32142
+
32143
+ this._callPropsCallbacks();
32144
+ };
32145
+
32146
+ _proto.componentWillUnmount = function componentWillUnmount() {
32147
+ if (this._resetIsScrollingTimeoutId !== null) {
32148
+ cancelTimeout(this._resetIsScrollingTimeoutId);
32149
+ }
32150
+ };
32151
+
32152
+ _proto.render = function render() {
32153
+ var _this$props5 = this.props,
32154
+ children = _this$props5.children,
32155
+ className = _this$props5.className,
32156
+ direction = _this$props5.direction,
32157
+ height = _this$props5.height,
32158
+ innerRef = _this$props5.innerRef,
32159
+ innerElementType = _this$props5.innerElementType,
32160
+ innerTagName = _this$props5.innerTagName,
32161
+ itemCount = _this$props5.itemCount,
32162
+ itemData = _this$props5.itemData,
32163
+ _this$props5$itemKey = _this$props5.itemKey,
32164
+ itemKey = _this$props5$itemKey === void 0 ? defaultItemKey$1 : _this$props5$itemKey,
32165
+ layout = _this$props5.layout,
32166
+ outerElementType = _this$props5.outerElementType,
32167
+ outerTagName = _this$props5.outerTagName,
32168
+ style = _this$props5.style,
32169
+ useIsScrolling = _this$props5.useIsScrolling,
32170
+ width = _this$props5.width;
32171
+ var isScrolling = this.state.isScrolling; // TODO Deprecate direction "horizontal"
32172
+
32173
+ var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
32174
+ var onScroll = isHorizontal ? this._onScrollHorizontal : this._onScrollVertical;
32175
+
32176
+ var _this$_getRangeToRend = this._getRangeToRender(),
32177
+ startIndex = _this$_getRangeToRend[0],
32178
+ stopIndex = _this$_getRangeToRend[1];
32179
+
32180
+ var items = [];
32181
+
32182
+ if (itemCount > 0) {
32183
+ for (var _index = startIndex; _index <= stopIndex; _index++) {
32184
+ items.push(createElement(children, {
32185
+ data: itemData,
32186
+ key: itemKey(_index, itemData),
32187
+ index: _index,
32188
+ isScrolling: useIsScrolling ? isScrolling : undefined,
32189
+ style: this._getItemStyle(_index)
32190
+ }));
32191
+ }
32192
+ } // Read this value AFTER items have been created,
32193
+ // So their actual sizes (if variable) are taken into consideration.
32194
+
32195
+
32196
+ var estimatedTotalSize = getEstimatedTotalSize(this.props, this._instanceProps);
32197
+ return createElement(outerElementType || outerTagName || 'div', {
32198
+ className: className,
32199
+ onScroll: onScroll,
32200
+ ref: this._outerRefSetter,
32201
+ style: _extends$1({
32202
+ position: 'relative',
32203
+ height: height,
32204
+ width: width,
32205
+ overflow: 'auto',
32206
+ WebkitOverflowScrolling: 'touch',
32207
+ willChange: 'transform',
32208
+ direction: direction
32209
+ }, style)
32210
+ }, createElement(innerElementType || innerTagName || 'div', {
32211
+ children: items,
32212
+ ref: innerRef,
32213
+ style: {
32214
+ height: isHorizontal ? '100%' : estimatedTotalSize,
32215
+ pointerEvents: isScrolling ? 'none' : undefined,
32216
+ width: isHorizontal ? estimatedTotalSize : '100%'
32217
+ }
32218
+ }));
32219
+ };
32220
+
32221
+ _proto._callPropsCallbacks = function _callPropsCallbacks() {
32222
+ if (typeof this.props.onItemsRendered === 'function') {
32223
+ var itemCount = this.props.itemCount;
32224
+
32225
+ if (itemCount > 0) {
32226
+ var _this$_getRangeToRend2 = this._getRangeToRender(),
32227
+ _overscanStartIndex = _this$_getRangeToRend2[0],
32228
+ _overscanStopIndex = _this$_getRangeToRend2[1],
32229
+ _visibleStartIndex = _this$_getRangeToRend2[2],
32230
+ _visibleStopIndex = _this$_getRangeToRend2[3];
32231
+
32232
+ this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex);
32233
+ }
32234
+ }
32235
+
32236
+ if (typeof this.props.onScroll === 'function') {
32237
+ var _this$state2 = this.state,
32238
+ _scrollDirection = _this$state2.scrollDirection,
32239
+ _scrollOffset = _this$state2.scrollOffset,
32240
+ _scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;
32241
+
32242
+ this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested);
32243
+ }
32244
+ } // Lazily create and cache item styles while scrolling,
32245
+ // So that pure component sCU will prevent re-renders.
32246
+ // We maintain this cache, and pass a style prop rather than index,
32247
+ // So that List can clear cached styles and force item re-render if necessary.
32248
+ ;
32249
+
32250
+ _proto._getRangeToRender = function _getRangeToRender() {
32251
+ var _this$props6 = this.props,
32252
+ itemCount = _this$props6.itemCount,
32253
+ overscanCount = _this$props6.overscanCount;
32254
+ var _this$state3 = this.state,
32255
+ isScrolling = _this$state3.isScrolling,
32256
+ scrollDirection = _this$state3.scrollDirection,
32257
+ scrollOffset = _this$state3.scrollOffset;
32258
+
32259
+ if (itemCount === 0) {
32260
+ return [0, 0, 0, 0];
32261
+ }
32262
+
32263
+ var startIndex = getStartIndexForOffset(this.props, scrollOffset, this._instanceProps);
32264
+ var stopIndex = getStopIndexForStartIndex(this.props, startIndex, scrollOffset, this._instanceProps); // Overscan by one item in each direction so that tab/focus works.
32265
+ // If there isn't at least one extra item, tab loops back around.
32266
+
32267
+ var overscanBackward = !isScrolling || scrollDirection === 'backward' ? Math.max(1, overscanCount) : 1;
32268
+ var overscanForward = !isScrolling || scrollDirection === 'forward' ? Math.max(1, overscanCount) : 1;
32269
+ return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
32270
+ };
32271
+
32272
+ return List;
32273
+ }(PureComponent), _class.defaultProps = {
32274
+ direction: 'ltr',
32275
+ itemData: undefined,
32276
+ layout: 'vertical',
32277
+ overscanCount: 2,
32278
+ useIsScrolling: false
32279
+ }, _class;
32280
+ } // NOTE: I considered further wrapping individual items with a pure ListItem component.
32281
+ // This would avoid ever calling the render function for the same index more than once,
32282
+ // But it would also add the overhead of a lot of components/fibers.
32283
+ // I assume people already do this (render function returning a class component),
32284
+ // So my doing it would just unnecessarily double the wrappers.
32285
+
32286
+ var validateSharedProps$1 = function validateSharedProps(_ref2, _ref3) {
32287
+ var children = _ref2.children,
32288
+ direction = _ref2.direction,
32289
+ height = _ref2.height,
32290
+ layout = _ref2.layout,
32291
+ innerTagName = _ref2.innerTagName,
32292
+ outerTagName = _ref2.outerTagName,
32293
+ width = _ref2.width;
32294
+ var instance = _ref3.instance;
32295
+
32296
+ if (process.env.NODE_ENV !== 'production') {
32297
+ if (innerTagName != null || outerTagName != null) {
32298
+ if (devWarningsTagName$1 && !devWarningsTagName$1.has(instance)) {
32299
+ devWarningsTagName$1.add(instance);
32300
+ console.warn('The innerTagName and outerTagName props have been deprecated. ' + 'Please use the innerElementType and outerElementType props instead.');
32301
+ }
32302
+ } // TODO Deprecate direction "horizontal"
32303
+
32304
+
32305
+ var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
32306
+
32307
+ switch (direction) {
32308
+ case 'horizontal':
32309
+ case 'vertical':
32310
+ if (devWarningsDirection && !devWarningsDirection.has(instance)) {
32311
+ devWarningsDirection.add(instance);
32312
+ console.warn('The direction prop should be either "ltr" (default) or "rtl". ' + 'Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.');
32313
+ }
32314
+
32315
+ break;
32316
+
32317
+ case 'ltr':
32318
+ case 'rtl':
32319
+ // Valid values
32320
+ break;
32321
+
32322
+ default:
32323
+ throw Error('An invalid "direction" prop has been specified. ' + 'Value should be either "ltr" or "rtl". ' + ("\"" + direction + "\" was specified."));
32324
+ }
32325
+
32326
+ switch (layout) {
32327
+ case 'horizontal':
32328
+ case 'vertical':
32329
+ // Valid values
32330
+ break;
32331
+
32332
+ default:
32333
+ throw Error('An invalid "layout" prop has been specified. ' + 'Value should be either "horizontal" or "vertical". ' + ("\"" + layout + "\" was specified."));
32334
+ }
32335
+
32336
+ if (children == null) {
32337
+ throw Error('An invalid "children" prop has been specified. ' + 'Value should be a React component. ' + ("\"" + (children === null ? 'null' : typeof children) + "\" was specified."));
32338
+ }
32339
+
32340
+ if (isHorizontal && typeof width !== 'number') {
32341
+ throw Error('An invalid "width" prop has been specified. ' + 'Horizontal lists must specify a number for width. ' + ("\"" + (width === null ? 'null' : typeof width) + "\" was specified."));
32342
+ } else if (!isHorizontal && typeof height !== 'number') {
32343
+ throw Error('An invalid "height" prop has been specified. ' + 'Vertical lists must specify a number for height. ' + ("\"" + (height === null ? 'null' : typeof height) + "\" was specified."));
32344
+ }
32345
+ }
32346
+ };
32347
+
32348
+ var FixedSizeList = /*#__PURE__*/createListComponent({
32349
+ getItemOffset: function getItemOffset(_ref, index) {
32350
+ var itemSize = _ref.itemSize;
32351
+ return index * itemSize;
32352
+ },
32353
+ getItemSize: function getItemSize(_ref2, index) {
32354
+ var itemSize = _ref2.itemSize;
32355
+ return itemSize;
32356
+ },
32357
+ getEstimatedTotalSize: function getEstimatedTotalSize(_ref3) {
32358
+ var itemCount = _ref3.itemCount,
32359
+ itemSize = _ref3.itemSize;
32360
+ return itemSize * itemCount;
32361
+ },
32362
+ getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment(_ref4, index, align, scrollOffset, instanceProps, scrollbarSize) {
32363
+ var direction = _ref4.direction,
32364
+ height = _ref4.height,
32365
+ itemCount = _ref4.itemCount,
32366
+ itemSize = _ref4.itemSize,
32367
+ layout = _ref4.layout,
32368
+ width = _ref4.width;
32369
+ // TODO Deprecate direction "horizontal"
32370
+ var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
32371
+ var size = isHorizontal ? width : height;
32372
+ var lastItemOffset = Math.max(0, itemCount * itemSize - size);
32373
+ var maxOffset = Math.min(lastItemOffset, index * itemSize);
32374
+ var minOffset = Math.max(0, index * itemSize - size + itemSize + scrollbarSize);
32375
+
32376
+ if (align === 'smart') {
32377
+ if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
32378
+ align = 'auto';
32379
+ } else {
32380
+ align = 'center';
32381
+ }
32382
+ }
32383
+
32384
+ switch (align) {
32385
+ case 'start':
32386
+ return maxOffset;
32387
+
32388
+ case 'end':
32389
+ return minOffset;
32390
+
32391
+ case 'center':
32392
+ {
32393
+ // "Centered" offset is usually the average of the min and max.
32394
+ // But near the edges of the list, this doesn't hold true.
32395
+ var middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
32396
+
32397
+ if (middleOffset < Math.ceil(size / 2)) {
32398
+ return 0; // near the beginning
32399
+ } else if (middleOffset > lastItemOffset + Math.floor(size / 2)) {
32400
+ return lastItemOffset; // near the end
32401
+ } else {
32402
+ return middleOffset;
32403
+ }
32404
+ }
32405
+
32406
+ case 'auto':
32407
+ default:
32408
+ if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
32409
+ return scrollOffset;
32410
+ } else if (scrollOffset < minOffset) {
32411
+ return minOffset;
32412
+ } else {
32413
+ return maxOffset;
32414
+ }
32415
+
32416
+ }
32417
+ },
32418
+ getStartIndexForOffset: function getStartIndexForOffset(_ref5, offset) {
32419
+ var itemCount = _ref5.itemCount,
32420
+ itemSize = _ref5.itemSize;
32421
+ return Math.max(0, Math.min(itemCount - 1, Math.floor(offset / itemSize)));
32422
+ },
32423
+ getStopIndexForStartIndex: function getStopIndexForStartIndex(_ref6, startIndex, scrollOffset) {
32424
+ var direction = _ref6.direction,
32425
+ height = _ref6.height,
32426
+ itemCount = _ref6.itemCount,
32427
+ itemSize = _ref6.itemSize,
32428
+ layout = _ref6.layout,
32429
+ width = _ref6.width;
32430
+ // TODO Deprecate direction "horizontal"
32431
+ var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
32432
+ var offset = startIndex * itemSize;
32433
+ var size = isHorizontal ? width : height;
32434
+ var numVisibleItems = Math.ceil((size + scrollOffset - offset) / itemSize);
32435
+ return Math.max(0, Math.min(itemCount - 1, startIndex + numVisibleItems - 1 // -1 is because stop index is inclusive
32436
+ ));
32437
+ },
32438
+ initInstanceProps: function initInstanceProps(props) {// Noop
32439
+ },
32440
+ shouldResetStyleCacheOnItemSizeChange: true,
32441
+ validateProps: function validateProps(_ref7) {
32442
+ var itemSize = _ref7.itemSize;
32443
+
32444
+ if (process.env.NODE_ENV !== 'production') {
32445
+ if (typeof itemSize !== 'number') {
32446
+ throw Error('An invalid "itemSize" prop has been specified. ' + 'Value should be a number. ' + ("\"" + (itemSize === null ? 'null' : typeof itemSize) + "\" was specified."));
32447
+ }
32448
+ }
32449
+ }
32450
+ });
32451
+
31691
32452
  /* *
31692
32453
  * Licensed under the Apache License, Version 2.0 (the "License");
31693
32454
  * you may not use this file except in compliance with the License.
@@ -31704,6 +32465,7 @@ var getFilteredViewPresetListForView = createSelector(getViewPresetsList, getVie
31704
32465
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
31705
32466
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
31706
32467
  * */
32468
+ var WORKSPACE_SELECT_LIST_ROW_HEIGHT = 46;
31707
32469
  var getPresetIcon = function getPresetIcon(preset) {
31708
32470
  switch (preset.viewType) {
31709
32471
  case 'tiledWindow':
@@ -31771,7 +32533,8 @@ var WorkspaceSelectListRow = function WorkspaceSelectListRow(_ref) {
31771
32533
  onClickPreset(workspacePreset.id);
31772
32534
  },
31773
32535
  sx: {
31774
- padding: 1
32536
+ padding: 1,
32537
+ height: "".concat(WORKSPACE_SELECT_LIST_ROW_HEIGHT, "px")
31775
32538
  }
31776
32539
  }, /*#__PURE__*/React__default.createElement(ListItemIcon, null, getPresetIcon(workspacePreset)), /*#__PURE__*/React__default.createElement(CustomTooltip, {
31777
32540
  title: workspacePreset.title
@@ -31822,68 +32585,38 @@ var WorkspaceSelectListRow = function WorkspaceSelectListRow(_ref) {
31822
32585
  }, /*#__PURE__*/React__default.createElement(Delete, null))))));
31823
32586
  };
31824
32587
 
31825
- /* *
31826
- * Licensed under the Apache License, Version 2.0 (the "License");
31827
- * you may not use this file except in compliance with the License.
31828
- * You may obtain a copy of the License at
31829
- *
31830
- * http://www.apache.org/licenses/LICENSE-2.0
31831
- *
31832
- * Unless required by applicable law or agreed to in writing, software
31833
- * distributed under the License is distributed on an "AS IS" BASIS,
31834
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31835
- * See the License for the specific language governing permissions and
31836
- * limitations under the License.
31837
- *
31838
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
31839
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
31840
- * */
31841
- var emptyWorkspaceListItem = {
31842
- id: emptyMapWorkspace.id,
31843
- title: emptyMapWorkspace.title,
31844
- scope: emptyMapWorkspace.scope,
31845
- viewType: emptyMapWorkspace.viewType,
31846
- "abstract": emptyMapWorkspace["abstract"]
32588
+ var getHeight = function getHeight(element) {
32589
+ if (!element) {
32590
+ return null;
32591
+ }
32592
+ var style = getComputedStyle(element);
32593
+ var marginTop = style.marginTop ? parseInt(style.marginTop, 10) : 0;
32594
+ var marginBottom = style.marginTop ? parseInt(style.marginBottom, 10) : 0;
32595
+ return element.offsetHeight + marginTop + marginBottom;
31847
32596
  };
31848
- var WorkspaceSelectList = function WorkspaceSelectList(_ref) {
31849
- var workspacePresets = _ref.workspacePresets,
31850
- currentSelectedId = _ref.currentSelectedId,
31851
- onClickPreset = _ref.onClickPreset,
31852
- onClickWorkspacePresetOption = _ref.onClickWorkspacePresetOption,
31853
- hideNewWorkspace = _ref.hideNewWorkspace,
31854
- isLoggedIn = _ref.isLoggedIn,
31855
- searchQuery = _ref.searchQuery,
31856
- _ref$newPreset = _ref.newPreset,
31857
- newPreset = _ref$newPreset === void 0 ? emptyWorkspaceListItem : _ref$newPreset,
31858
- _ref$testIdPrefix = _ref.testIdPrefix,
31859
- testIdPrefix = _ref$testIdPrefix === void 0 ? 'workspace' : _ref$testIdPrefix;
31860
- return /*#__PURE__*/React.createElement(Box$2, {
31861
- "data-testid": "".concat(testIdPrefix, "-selectList")
31862
- }, /*#__PURE__*/React.createElement(Box$2, {
31863
- sx: {
31864
- marginBottom: '4px',
31865
- fontSize: '12px'
31866
- }
31867
- }, workspacePresets.length, " results"), /*#__PURE__*/React.createElement(List, null, !hideNewWorkspace && /*#__PURE__*/React.createElement(WorkspaceSelectListRow, {
31868
- key: newPreset.id,
31869
- workspacePreset: newPreset,
31870
- onClickPreset: onClickPreset,
31871
- onClickWorkspacePresetOption: onClickWorkspacePresetOption,
31872
- isSelected: currentSelectedId === '' || currentSelectedId === undefined,
31873
- isEditable: isLoggedIn,
31874
- testIdPrefix: testIdPrefix
31875
- }), workspacePresets.map(function (preset) {
31876
- return /*#__PURE__*/React.createElement(WorkspaceSelectListRow, {
31877
- key: preset.id,
31878
- workspacePreset: preset,
31879
- onClickPreset: onClickPreset,
31880
- onClickWorkspacePresetOption: onClickWorkspacePresetOption,
31881
- isEditable: isLoggedIn,
31882
- searchQuery: searchQuery,
31883
- isSelected: currentSelectedId === preset.id,
31884
- testIdPrefix: testIdPrefix
32597
+ // Gets element height incl padding, border and margins
32598
+ var useGetElementHeight = function useGetElementHeight(ref, defaultHeight) {
32599
+ var _React$useState = React__default.useState(defaultHeight),
32600
+ _React$useState2 = _slicedToArray$2(_React$useState, 2),
32601
+ height = _React$useState2[0],
32602
+ setHeight = _React$useState2[1];
32603
+ React__default.useLayoutEffect(function () {
32604
+ var element = ref === null || ref === void 0 ? void 0 : ref.current;
32605
+ if (element) {
32606
+ setHeight(element.offsetHeight);
32607
+ }
32608
+ var observer = new ResizeObserver(function () {
32609
+ var height = getHeight(element);
32610
+ height && setHeight(height);
31885
32611
  });
31886
- })));
32612
+ observer.observe(element);
32613
+ return function () {
32614
+ observer.disconnect();
32615
+ };
32616
+ }, [ref]);
32617
+ return {
32618
+ height: height
32619
+ };
31887
32620
  };
31888
32621
 
31889
32622
  /* *
@@ -31981,36 +32714,35 @@ var FilterList = function FilterList(_ref) {
31981
32714
  };
31982
32715
 
31983
32716
  var DEBOUNCE_TIMEOUT = 300;
31984
- var SearchField = function SearchField(_ref) {
31985
- var _ref$label = _ref.label,
31986
- label = _ref$label === void 0 ? 'Search' : _ref$label,
31987
- valueChanged = _ref.valueChanged,
31988
- _ref$value = _ref.value,
31989
- value = _ref$value === void 0 ? '' : _ref$value;
32717
+ var SearchButton = function SearchButton(_ref) {
32718
+ var label = _ref.label;
32719
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
32720
+ tooltipTitle: label,
32721
+ edge: "end",
32722
+ size: "large"
32723
+ }, /*#__PURE__*/React.createElement(Search, null));
32724
+ };
32725
+ var ClearButton = function ClearButton(_ref2) {
32726
+ var onClick = _ref2.onClick;
32727
+ return /*#__PURE__*/React.createElement(CustomIconButton, {
32728
+ tooltipTitle: "Clear",
32729
+ edge: "end",
32730
+ onClick: onClick,
32731
+ size: "large"
32732
+ }, /*#__PURE__*/React.createElement(Clear, null));
32733
+ };
32734
+ var SearchField = function SearchField(_ref3) {
32735
+ var _ref3$label = _ref3.label,
32736
+ label = _ref3$label === void 0 ? 'Search' : _ref3$label,
32737
+ valueChanged = _ref3.valueChanged,
32738
+ _ref3$value = _ref3.value,
32739
+ value = _ref3$value === void 0 ? '' : _ref3$value;
31990
32740
  var _React$useState = React.useState(value),
31991
32741
  _React$useState2 = _slicedToArray$2(_React$useState, 2),
31992
32742
  localValue = _React$useState2[0],
31993
32743
  setLocalValue = _React$useState2[1];
31994
32744
  // eslint-disable-next-line react-hooks/exhaustive-deps
31995
32745
  var handleValueChangeDebounced = React.useCallback(debounce$1(valueChanged, DEBOUNCE_TIMEOUT), []);
31996
- var ClearButton = function ClearButton() {
31997
- return /*#__PURE__*/React.createElement(CustomIconButton, {
31998
- tooltipTitle: "Clear",
31999
- edge: "end",
32000
- onClick: function onClick() {
32001
- setLocalValue('');
32002
- valueChanged('');
32003
- },
32004
- size: "large"
32005
- }, /*#__PURE__*/React.createElement(Clear, null));
32006
- };
32007
- var SearchButton = function SearchButton() {
32008
- return /*#__PURE__*/React.createElement(CustomIconButton, {
32009
- tooltipTitle: label,
32010
- edge: "end",
32011
- size: "large"
32012
- }, /*#__PURE__*/React.createElement(Search, null));
32013
- };
32014
32746
  return /*#__PURE__*/React.createElement(TextField, {
32015
32747
  variant: "filled",
32016
32748
  size: "small",
@@ -32030,7 +32762,14 @@ var SearchField = function SearchField(_ref) {
32030
32762
  InputProps: {
32031
32763
  endAdornment: /*#__PURE__*/React.createElement(InputAdornment, {
32032
32764
  position: "end"
32033
- }, localValue ? /*#__PURE__*/React.createElement(ClearButton, null) : /*#__PURE__*/React.createElement(SearchButton, null))
32765
+ }, localValue ? /*#__PURE__*/React.createElement(ClearButton, {
32766
+ onClick: function onClick() {
32767
+ setLocalValue('');
32768
+ valueChanged('');
32769
+ }
32770
+ }) : /*#__PURE__*/React.createElement(SearchButton, {
32771
+ label: label
32772
+ }))
32034
32773
  }
32035
32774
  });
32036
32775
  };
@@ -32051,30 +32790,149 @@ var SearchField = function SearchField(_ref) {
32051
32790
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
32052
32791
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
32053
32792
  * */
32054
- var WorkspaceFilter = function WorkspaceFilter(_ref) {
32793
+ var DEFAULT_FILTER_HEIGHT = 85;
32794
+ var WorkspaceFilter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
32055
32795
  var filters = _ref.filters,
32056
32796
  _ref$onClickFilterChi = _ref.onClickFilterChip,
32057
32797
  onClickFilterChip = _ref$onClickFilterChi === void 0 ? function () {} : _ref$onClickFilterChi,
32058
32798
  _ref$onSearch = _ref.onSearch,
32059
32799
  onSearch = _ref$onSearch === void 0 ? function () {} : _ref$onSearch,
32060
32800
  isAllSelected = _ref.isAllSelected,
32061
- searchQuery = _ref.searchQuery,
32062
- _ref$showSearch = _ref.showSearch,
32063
- showSearch = _ref$showSearch === void 0 ? true : _ref$showSearch;
32064
- return /*#__PURE__*/React.createElement(Stack, {
32065
- spacing: 1,
32801
+ searchQuery = _ref.searchQuery;
32802
+ return /*#__PURE__*/React.createElement(Box$2, {
32803
+ ref: ref,
32066
32804
  sx: {
32067
32805
  marginBottom: '8px'
32068
32806
  }
32069
- }, showSearch && /*#__PURE__*/React.createElement(SearchField, {
32807
+ }, /*#__PURE__*/React.createElement(Stack, {
32808
+ spacing: 1
32809
+ }, /*#__PURE__*/React.createElement(SearchField, {
32070
32810
  value: searchQuery,
32071
32811
  valueChanged: onSearch
32072
32812
  }), /*#__PURE__*/React.createElement(FilterList, {
32073
32813
  filters: filters,
32074
32814
  onChipClick: onClickFilterChip,
32075
32815
  isAllSelected: isAllSelected
32076
- }));
32816
+ })));
32817
+ });
32818
+
32819
+ var emptyWorkspaceListItem = {
32820
+ id: emptyMapWorkspace.id,
32821
+ title: emptyMapWorkspace.title,
32822
+ scope: emptyMapWorkspace.scope,
32823
+ viewType: emptyMapWorkspace.viewType,
32824
+ "abstract": emptyMapWorkspace["abstract"]
32077
32825
  };
32826
+ var DEFAULT_DIALOG_HEIGHT = 900;
32827
+ var MIN_HEIGHT_SCROLLABLE_LIST = 88; // Slightly less than 2 rows
32828
+ var LIST_PADDING_TOP = 8;
32829
+ var DEFAULT_PARENT_PADDING = 8;
32830
+ var DEFAULT_RESULTS_HEIGHT = 22;
32831
+ var useGetRequiredHeights = function useGetRequiredHeights(ref) {
32832
+ // Used to store the height of the list dialog content
32833
+ var _React$useState = React.useState(DEFAULT_DIALOG_HEIGHT),
32834
+ _React$useState2 = _slicedToArray$2(_React$useState, 2),
32835
+ dialogHeight = _React$useState2[0],
32836
+ setDialogHeight = _React$useState2[1];
32837
+ // Used to store the padding height surrounding the list and the filters
32838
+ var _React$useState3 = React.useState(DEFAULT_PARENT_PADDING),
32839
+ _React$useState4 = _slicedToArray$2(_React$useState3, 2),
32840
+ parentPaddingHeight = _React$useState4[0],
32841
+ setParentPaddingHeight = _React$useState4[1];
32842
+ // Obtain the height of the results div
32843
+ var resultsRef = React.useRef(null);
32844
+ var _useGetElementHeight = useGetElementHeight(resultsRef, DEFAULT_RESULTS_HEIGHT),
32845
+ resultsHeight = _useGetElementHeight.height;
32846
+ // Obtain the height of the filters and search
32847
+ var _useGetElementHeight2 = useGetElementHeight(ref, DEFAULT_FILTER_HEIGHT),
32848
+ filterHeight = _useGetElementHeight2.height;
32849
+ // Obtain the height of of the list dialog content
32850
+ React.useLayoutEffect(function () {
32851
+ var _a, _b, _c, _d;
32852
+ var dialogElement = (_d = (_c = (_b = (_a = resultsRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.parentElement;
32853
+ setDialogHeight(dialogElement.offsetHeight);
32854
+ var observer = new ResizeObserver(function () {
32855
+ var height = getHeight(dialogElement);
32856
+ height && setDialogHeight(height);
32857
+ });
32858
+ observer.observe(dialogElement);
32859
+ return function () {
32860
+ observer.disconnect();
32861
+ };
32862
+ }, [resultsRef]);
32863
+ // Obtain the padding height surrounding the list and the filters
32864
+ React.useEffect(function () {
32865
+ var _a, _b;
32866
+ var parentElement = (_b = (_a = resultsRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement;
32867
+ var style = getComputedStyle(parentElement);
32868
+ var paddingTop = parseInt(style.paddingTop, 10);
32869
+ paddingTop && setParentPaddingHeight(paddingTop);
32870
+ }, []);
32871
+ var heightOtherElements = filterHeight + resultsHeight + LIST_PADDING_TOP + 2 * parentPaddingHeight;
32872
+ // row height = height + margin
32873
+ var rowHeight = WORKSPACE_SELECT_LIST_ROW_HEIGHT + 4;
32874
+ var availableSpaceForList = dialogHeight - heightOtherElements;
32875
+ var listHeight = availableSpaceForList && availableSpaceForList < MIN_HEIGHT_SCROLLABLE_LIST ? MIN_HEIGHT_SCROLLABLE_LIST : availableSpaceForList;
32876
+ return {
32877
+ resultsRef: resultsRef,
32878
+ rowHeight: rowHeight,
32879
+ listHeight: listHeight
32880
+ };
32881
+ };
32882
+ var WorkspaceSelectList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
32883
+ var workspacePresets = _ref.workspacePresets,
32884
+ currentSelectedId = _ref.currentSelectedId,
32885
+ onClickPreset = _ref.onClickPreset,
32886
+ onClickWorkspacePresetOption = _ref.onClickWorkspacePresetOption,
32887
+ hideNewWorkspace = _ref.hideNewWorkspace,
32888
+ isLoggedIn = _ref.isLoggedIn,
32889
+ searchQuery = _ref.searchQuery,
32890
+ _ref$newPreset = _ref.newPreset,
32891
+ newPreset = _ref$newPreset === void 0 ? emptyWorkspaceListItem : _ref$newPreset,
32892
+ _ref$testIdPrefix = _ref.testIdPrefix,
32893
+ testIdPrefix = _ref$testIdPrefix === void 0 ? 'workspace' : _ref$testIdPrefix;
32894
+ var _useGetRequiredHeight = useGetRequiredHeights(ref),
32895
+ resultsRef = _useGetRequiredHeight.resultsRef,
32896
+ rowHeight = _useGetRequiredHeight.rowHeight,
32897
+ listHeight = _useGetRequiredHeight.listHeight;
32898
+ // Height of other elements in dialog besides the list:
32899
+ // filter, results text , padding list top and 2x padding around dialog children (top & bottom)
32900
+ var items = !hideNewWorkspace ? [newPreset].concat(_toConsumableArray$1(workspacePresets)) : workspacePresets;
32901
+ // console.log(filterHeight, resultsHeight, parentPaddingHeight);
32902
+ return /*#__PURE__*/React.createElement(Box$2, {
32903
+ "data-testid": "".concat(testIdPrefix, "-selectList")
32904
+ }, /*#__PURE__*/React.createElement(Box$2, {
32905
+ ref: resultsRef,
32906
+ sx: {
32907
+ marginBottom: '4px',
32908
+ fontSize: '12px'
32909
+ }
32910
+ }, workspacePresets.length, " results"), /*#__PURE__*/React.createElement(Box$2, {
32911
+ sx: {
32912
+ paddingTop: "".concat(LIST_PADDING_TOP, "px")
32913
+ }
32914
+ }, /*#__PURE__*/React.createElement(FixedSizeList, {
32915
+ height: listHeight,
32916
+ itemCount: items.length,
32917
+ itemSize: rowHeight
32918
+ }, function (_ref2) {
32919
+ var index = _ref2.index,
32920
+ style = _ref2.style;
32921
+ var preset = items[index];
32922
+ return /*#__PURE__*/React.createElement("div", {
32923
+ style: style,
32924
+ key: preset.id || 'emptyPreset'
32925
+ }, /*#__PURE__*/React.createElement(WorkspaceSelectListRow, {
32926
+ workspacePreset: preset,
32927
+ onClickPreset: onClickPreset,
32928
+ onClickWorkspacePresetOption: onClickWorkspacePresetOption,
32929
+ isEditable: isLoggedIn,
32930
+ searchQuery: searchQuery,
32931
+ isSelected: currentSelectedId === preset.id || currentSelectedId === '' && preset.id === undefined,
32932
+ testIdPrefix: testIdPrefix
32933
+ }));
32934
+ })));
32935
+ });
32078
32936
 
32079
32937
  /* *
32080
32938
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -32096,6 +32954,7 @@ var ERROR_TITLE = 'View presets not available';
32096
32954
  var ERROR_RETRY = 'Try again';
32097
32955
  var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
32098
32956
  var panelId = _ref.panelId;
32957
+ var filterRef = React.useRef(null);
32099
32958
  var viewPresets = useSelector(function (store) {
32100
32959
  return getFilteredViewPresetListForView(store, panelId);
32101
32960
  });
@@ -32221,7 +33080,9 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
32221
33080
  return filter.isSelected;
32222
33081
  });
32223
33082
  var shouldHideNewWorkspace = !isAllSelectedForFilters || viewPresetListSearchQuery.length > 0;
32224
- return /*#__PURE__*/React.createElement(React.Fragment, null, isViewPresetsListFetching && /*#__PURE__*/React.createElement(LinearProgress, {
33083
+ return /*#__PURE__*/React.createElement("div", {
33084
+ "data-testid": "viewpreset-selectlist-connect"
33085
+ }, isViewPresetsListFetching && /*#__PURE__*/React.createElement(LinearProgress, {
32225
33086
  "data-testid": "loading-bar",
32226
33087
  color: "secondary",
32227
33088
  sx: {
@@ -32244,7 +33105,8 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
32244
33105
  onClickFilterChip: onClickFilterChip,
32245
33106
  isAllSelected: isAllSelectedForFilters,
32246
33107
  searchQuery: viewPresetListSearchQuery,
32247
- onSearch: onSearchFilter
33108
+ onSearch: onSearchFilter,
33109
+ ref: filterRef
32248
33110
  }), /*#__PURE__*/React.createElement(WorkspaceSelectList, {
32249
33111
  workspacePresets: viewPresets,
32250
33112
  currentSelectedId: activeViewPresetId || undefined,
@@ -32257,7 +33119,8 @@ var ViewPresetMenuListConnect = function ViewPresetMenuListConnect(_ref) {
32257
33119
  isLoggedIn: isLoggedIn,
32258
33120
  hideNewWorkspace: shouldHideNewWorkspace,
32259
33121
  searchQuery: viewPresetListSearchQuery,
32260
- testIdPrefix: "viewpreset"
33122
+ testIdPrefix: "viewpreset",
33123
+ ref: filterRef
32261
33124
  })));
32262
33125
  };
32263
33126
 
@@ -32286,8 +33149,7 @@ var ViewPresetMenu = function ViewPresetMenu(_ref) {
32286
33149
  var toolContainer = /*#__PURE__*/React__default.createElement(ToolContainer, {
32287
33150
  style: {
32288
33151
  width: 320,
32289
- maxHeight: 'calc(100% - 80px)',
32290
- height: 'auto',
33152
+ height: 'calc(100% - 80px)',
32291
33153
  position: 'absolute',
32292
33154
  top: '16px'
32293
33155
  },
@@ -32661,6 +33523,16 @@ var WorkspaceTileConnect = function WorkspaceTileConnect(_ref) {
32661
33523
  };
32662
33524
  // eslint-disable-next-line react-hooks/exhaustive-deps
32663
33525
  }, [unregisterView, registerView]);
33526
+ var connectedMap = useSelector(function (store) {
33527
+ var _a;
33528
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33529
+ var initialProps = view === null || view === void 0 ? void 0 : view.initialProps;
33530
+ var mapId = (_a = initialProps === null || initialProps === void 0 ? void 0 : initialProps.plotPreset) === null || _a === void 0 ? void 0 : _a.mapId;
33531
+ if (mapId) {
33532
+ return getViewPresetPanelId(store, mapId);
33533
+ }
33534
+ return undefined;
33535
+ });
32664
33536
  return /*#__PURE__*/React.createElement(MosaicWindow, {
32665
33537
  path: path,
32666
33538
  createNode: createNode,
@@ -32706,7 +33578,8 @@ var WorkspaceTileConnect = function WorkspaceTileConnect(_ref) {
32706
33578
  title: title,
32707
33579
  id: mosaicNodeId,
32708
33580
  componentType: view === null || view === void 0 ? void 0 : view.componentType,
32709
- initialProps: view === null || view === void 0 ? void 0 : view.initialProps
33581
+ initialProps: view === null || view === void 0 ? void 0 : view.initialProps,
33582
+ connectedMap: connectedMap
32710
33583
  }), isViewPresetDialogOpen && /*#__PURE__*/React.createElement(ViewPresetMenu, {
32711
33584
  panelId: mosaicNodeId,
32712
33585
  closeMenu: function closeMenu() {
@@ -36477,6 +37350,7 @@ var Box$1 = Box;
36477
37350
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
36478
37351
  * */
36479
37352
  var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
37353
+ var filterRef = React.useRef(null);
36480
37354
  var currentView = useSelector(function (store) {
36481
37355
  return getWorkspaceState(store);
36482
37356
  });
@@ -36625,12 +37499,17 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
36625
37499
  return fetchWorkspaceList();
36626
37500
  }
36627
37501
  }
36628
- }))), !error && /*#__PURE__*/React.createElement(WorkspaceFilter, {
37502
+ }))), /*#__PURE__*/React.createElement(Box$2, {
37503
+ sx: {
37504
+ padding: 1
37505
+ }
37506
+ }, !error && /*#__PURE__*/React.createElement(WorkspaceFilter, {
36629
37507
  filters: workspaceListFilters,
36630
37508
  onClickFilterChip: onClickFilterChip,
36631
37509
  isAllSelected: isAllSelected,
36632
37510
  searchQuery: workspaceSearchQuery,
36633
- onSearch: searchFilter
37511
+ onSearch: searchFilter,
37512
+ ref: filterRef
36634
37513
  }), /*#__PURE__*/React.createElement(WorkspaceSelectList, {
36635
37514
  workspacePresets: workspacePresets,
36636
37515
  currentSelectedId: currentView.id || '',
@@ -36638,8 +37517,9 @@ var WorkspaceSelectListConnect = function WorkspaceSelectListConnect() {
36638
37517
  onClickWorkspacePresetOption: onClickWorkspacePresetOption,
36639
37518
  hideNewWorkspace: shouldHideNewWorkspace,
36640
37519
  isLoggedIn: isLoggedIn,
36641
- searchQuery: workspaceSearchQuery
36642
- }));
37520
+ searchQuery: workspaceSearchQuery,
37521
+ ref: filterRef
37522
+ })));
36643
37523
  };
36644
37524
 
36645
37525
  /* *
@@ -36663,12 +37543,10 @@ var WorkspaceMenu = function WorkspaceMenu(_ref) {
36663
37543
  _ref$hideBackdrop = _ref.hideBackdrop,
36664
37544
  hideBackdrop = _ref$hideBackdrop === void 0 ? false : _ref$hideBackdrop,
36665
37545
  closeMenu = _ref.closeMenu;
36666
- _ref.filter;
36667
37546
  var toolContainer = /*#__PURE__*/React__default.createElement(ToolContainer, {
36668
37547
  style: {
36669
37548
  width: 320,
36670
- maxHeight: 'calc(100vh - 88px)',
36671
- height: 'auto',
37549
+ height: 'calc(100vh - 88px)',
36672
37550
  position: 'absolute',
36673
37551
  top: '16px'
36674
37552
  },
@@ -36677,11 +37555,7 @@ var WorkspaceMenu = function WorkspaceMenu(_ref) {
36677
37555
  onClick: function onClick(event) {
36678
37556
  event.stopPropagation();
36679
37557
  }
36680
- }, /*#__PURE__*/React__default.createElement(Box$2, {
36681
- sx: {
36682
- padding: 1
36683
- }
36684
- }, /*#__PURE__*/React__default.createElement(WorkspaceSelectListConnect, null)));
37558
+ }, /*#__PURE__*/React__default.createElement(WorkspaceSelectListConnect, null));
36685
37559
  return /*#__PURE__*/React__default.createElement("div", null, hideBackdrop ?
36686
37560
  // Enable hiding backdrop from snapshot tests
36687
37561
  toolContainer : /*#__PURE__*/React__default.createElement(Backdrop, {