@opengeoweb/shared 9.14.0 → 9.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -7,9 +7,10 @@ import Draggable from 'react-draggable';
7
7
  import { Resizable } from 're-resizable';
8
8
  import { styled } from '@mui/material/styles';
9
9
  import { useStore } from 'react-redux';
10
- import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$3, startOfDay, isWithinInterval } from 'date-fns';
10
+ import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$3, getHours as getHours$1, startOfDay, isWithinInterval, getDay, getMonth, getYear, getWeek } from 'date-fns';
11
11
  import configureStore from 'redux-mock-store';
12
12
  import { configureStore as configureStore$1 } from '@reduxjs/toolkit';
13
+ import i18next from 'i18next';
13
14
 
14
15
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
15
16
 
@@ -18,7 +19,7 @@ var check = function (it) {
18
19
  };
19
20
 
20
21
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
21
- var global$q =
22
+ var global$p =
22
23
  // eslint-disable-next-line es/no-global-this -- safe
23
24
  check(typeof globalThis == 'object' && globalThis) ||
24
25
  check(typeof window == 'object' && window) ||
@@ -138,17 +139,17 @@ var $TypeError$h = TypeError;
138
139
 
139
140
  // `RequireObjectCoercible` abstract operation
140
141
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
141
- var requireObjectCoercible$8 = function (it) {
142
+ var requireObjectCoercible$9 = function (it) {
142
143
  if (isNullOrUndefined$6(it)) throw new $TypeError$h("Can't call method on " + it);
143
144
  return it;
144
145
  };
145
146
 
146
147
  // toObject with fallback for non-array-like ES3 strings
147
148
  var IndexedObject$2 = indexedObject;
148
- var requireObjectCoercible$7 = requireObjectCoercible$8;
149
+ var requireObjectCoercible$8 = requireObjectCoercible$9;
149
150
 
150
151
  var toIndexedObject$5 = function (it) {
151
- return IndexedObject$2(requireObjectCoercible$7(it));
152
+ return IndexedObject$2(requireObjectCoercible$8(it));
152
153
  };
153
154
 
154
155
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
@@ -165,11 +166,11 @@ var isCallable$n = typeof documentAll == 'undefined' && documentAll !== undefine
165
166
 
166
167
  var isCallable$m = isCallable$n;
167
168
 
168
- var isObject$d = function (it) {
169
+ var isObject$e = function (it) {
169
170
  return typeof it == 'object' ? it !== null : isCallable$m(it);
170
171
  };
171
172
 
172
- var global$p = global$q;
173
+ var global$o = global$p;
173
174
  var isCallable$l = isCallable$n;
174
175
 
175
176
  var aFunction = function (argument) {
@@ -177,7 +178,7 @@ var aFunction = function (argument) {
177
178
  };
178
179
 
179
180
  var getBuiltIn$8 = function (namespace, method) {
180
- return arguments.length < 2 ? aFunction(global$p[namespace]) : global$p[namespace] && global$p[namespace][method];
181
+ return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
181
182
  };
182
183
 
183
184
  var uncurryThis$m = functionUncurryThis;
@@ -186,11 +187,11 @@ var objectIsPrototypeOf = uncurryThis$m({}.isPrototypeOf);
186
187
 
187
188
  var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
188
189
 
189
- var global$o = global$q;
190
+ var global$n = global$p;
190
191
  var userAgent$3 = engineUserAgent;
191
192
 
192
- var process$3 = global$o.process;
193
- var Deno$1 = global$o.Deno;
193
+ var process$3 = global$n.process;
194
+ var Deno$1 = global$n.Deno;
194
195
  var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
195
196
  var v8 = versions && versions.v8;
196
197
  var match, version;
@@ -217,9 +218,9 @@ var engineV8Version = version;
217
218
  /* eslint-disable es/no-symbol -- required for testing */
218
219
  var V8_VERSION$1 = engineV8Version;
219
220
  var fails$k = fails$o;
220
- var global$n = global$q;
221
+ var global$m = global$p;
221
222
 
222
- var $String$5 = global$n.String;
223
+ var $String$5 = global$m.String;
223
224
 
224
225
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
225
226
  var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$k(function () {
@@ -287,7 +288,7 @@ var getMethod$6 = function (V, P) {
287
288
 
288
289
  var call$j = functionCall;
289
290
  var isCallable$i = isCallable$n;
290
- var isObject$c = isObject$d;
291
+ var isObject$d = isObject$e;
291
292
 
292
293
  var $TypeError$f = TypeError;
293
294
 
@@ -295,55 +296,55 @@ var $TypeError$f = TypeError;
295
296
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
296
297
  var ordinaryToPrimitive$1 = function (input, pref) {
297
298
  var fn, val;
298
- if (pref === 'string' && isCallable$i(fn = input.toString) && !isObject$c(val = call$j(fn, input))) return val;
299
- if (isCallable$i(fn = input.valueOf) && !isObject$c(val = call$j(fn, input))) return val;
300
- if (pref !== 'string' && isCallable$i(fn = input.toString) && !isObject$c(val = call$j(fn, input))) return val;
299
+ if (pref === 'string' && isCallable$i(fn = input.toString) && !isObject$d(val = call$j(fn, input))) return val;
300
+ if (isCallable$i(fn = input.valueOf) && !isObject$d(val = call$j(fn, input))) return val;
301
+ if (pref !== 'string' && isCallable$i(fn = input.toString) && !isObject$d(val = call$j(fn, input))) return val;
301
302
  throw new $TypeError$f("Can't convert object to primitive value");
302
303
  };
303
304
 
304
- var shared$4 = {exports: {}};
305
+ var sharedStore = {exports: {}};
305
306
 
306
- var global$m = global$q;
307
+ var global$l = global$p;
307
308
 
308
309
  // eslint-disable-next-line es/no-object-defineproperty -- safe
309
310
  var defineProperty$7 = Object.defineProperty;
310
311
 
311
312
  var defineGlobalProperty$3 = function (key, value) {
312
313
  try {
313
- defineProperty$7(global$m, key, { value: value, configurable: true, writable: true });
314
+ defineProperty$7(global$l, key, { value: value, configurable: true, writable: true });
314
315
  } catch (error) {
315
- global$m[key] = value;
316
+ global$l[key] = value;
316
317
  } return value;
317
318
  };
318
319
 
319
- var global$l = global$q;
320
+ var globalThis$1 = global$p;
320
321
  var defineGlobalProperty$2 = defineGlobalProperty$3;
321
322
 
322
323
  var SHARED = '__core-js_shared__';
323
- var store$3 = global$l[SHARED] || defineGlobalProperty$2(SHARED, {});
324
+ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
324
325
 
325
- var sharedStore = store$3;
326
-
327
- var store$2 = sharedStore;
328
-
329
- (shared$4.exports = function (key, value) {
330
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
331
- })('versions', []).push({
332
- version: '3.35.1',
326
+ (store$3.versions || (store$3.versions = [])).push({
327
+ version: '3.36.1',
333
328
  mode: 'global',
334
329
  copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
335
- license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
330
+ license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
336
331
  source: 'https://github.com/zloirock/core-js'
337
332
  });
338
333
 
339
- var requireObjectCoercible$6 = requireObjectCoercible$8;
334
+ var store$2 = sharedStore.exports;
335
+
336
+ var shared$4 = function (key, value) {
337
+ return store$2[key] || (store$2[key] = value || {});
338
+ };
339
+
340
+ var requireObjectCoercible$7 = requireObjectCoercible$9;
340
341
 
341
342
  var $Object$2 = Object;
342
343
 
343
344
  // `ToObject` abstract operation
344
345
  // https://tc39.es/ecma262/#sec-toobject
345
346
  var toObject$5 = function (argument) {
346
- return $Object$2(requireObjectCoercible$6(argument));
347
+ return $Object$2(requireObjectCoercible$7(argument));
347
348
  };
348
349
 
349
350
  var uncurryThis$l = functionUncurryThis;
@@ -368,8 +369,8 @@ var uid$2 = function (key) {
368
369
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$d(++id + postfix, 36);
369
370
  };
370
371
 
371
- var global$k = global$q;
372
- var shared$3 = shared$4.exports;
372
+ var global$k = global$p;
373
+ var shared$3 = shared$4;
373
374
  var hasOwn$d = hasOwnProperty_1;
374
375
  var uid$1 = uid$2;
375
376
  var NATIVE_SYMBOL$1 = symbolConstructorDetection;
@@ -388,7 +389,7 @@ var wellKnownSymbol$j = function (name) {
388
389
  };
389
390
 
390
391
  var call$i = functionCall;
391
- var isObject$b = isObject$d;
392
+ var isObject$c = isObject$e;
392
393
  var isSymbol$1 = isSymbol$2;
393
394
  var getMethod$5 = getMethod$6;
394
395
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
@@ -400,13 +401,13 @@ var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
400
401
  // `ToPrimitive` abstract operation
401
402
  // https://tc39.es/ecma262/#sec-toprimitive
402
403
  var toPrimitive$1 = function (input, pref) {
403
- if (!isObject$b(input) || isSymbol$1(input)) return input;
404
+ if (!isObject$c(input) || isSymbol$1(input)) return input;
404
405
  var exoticToPrim = getMethod$5(input, TO_PRIMITIVE);
405
406
  var result;
406
407
  if (exoticToPrim) {
407
408
  if (pref === undefined) pref = 'default';
408
409
  result = call$i(exoticToPrim, input, pref);
409
- if (!isObject$b(result) || isSymbol$1(result)) return result;
410
+ if (!isObject$c(result) || isSymbol$1(result)) return result;
410
411
  throw new $TypeError$e("Can't convert object to primitive value");
411
412
  }
412
413
  if (pref === undefined) pref = 'number';
@@ -423,12 +424,12 @@ var toPropertyKey$2 = function (argument) {
423
424
  return isSymbol(key) ? key : key + '';
424
425
  };
425
426
 
426
- var global$j = global$q;
427
- var isObject$a = isObject$d;
427
+ var global$j = global$p;
428
+ var isObject$b = isObject$e;
428
429
 
429
430
  var document$3 = global$j.document;
430
431
  // typeof document.createElement is 'object' in old IE
431
- var EXISTS$1 = isObject$a(document$3) && isObject$a(document$3.createElement);
432
+ var EXISTS$1 = isObject$b(document$3) && isObject$b(document$3.createElement);
432
433
 
433
434
  var documentCreateElement$2 = function (it) {
434
435
  return EXISTS$1 ? document$3.createElement(it) : {};
@@ -484,21 +485,21 @@ var v8PrototypeDefineBug = DESCRIPTORS$d && fails$i(function () {
484
485
  }).prototype !== 42;
485
486
  });
486
487
 
487
- var isObject$9 = isObject$d;
488
+ var isObject$a = isObject$e;
488
489
 
489
490
  var $String$3 = String;
490
491
  var $TypeError$d = TypeError;
491
492
 
492
493
  // `Assert: Type(argument) is Object`
493
- var anObject$h = function (argument) {
494
- if (isObject$9(argument)) return argument;
494
+ var anObject$g = function (argument) {
495
+ if (isObject$a(argument)) return argument;
495
496
  throw new $TypeError$d($String$3(argument) + ' is not an object');
496
497
  };
497
498
 
498
499
  var DESCRIPTORS$c = descriptors;
499
500
  var IE8_DOM_DEFINE = ie8DomDefine;
500
501
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
501
- var anObject$g = anObject$h;
502
+ var anObject$f = anObject$g;
502
503
  var toPropertyKey = toPropertyKey$2;
503
504
 
504
505
  var $TypeError$c = TypeError;
@@ -513,9 +514,9 @@ var WRITABLE = 'writable';
513
514
  // `Object.defineProperty` method
514
515
  // https://tc39.es/ecma262/#sec-object.defineproperty
515
516
  objectDefineProperty.f = DESCRIPTORS$c ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
516
- anObject$g(O);
517
+ anObject$f(O);
517
518
  P = toPropertyKey(P);
518
- anObject$g(Attributes);
519
+ anObject$f(Attributes);
519
520
  if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
520
521
  var current = $getOwnPropertyDescriptor(O, P);
521
522
  if (current && current[WRITABLE]) {
@@ -528,9 +529,9 @@ objectDefineProperty.f = DESCRIPTORS$c ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
528
529
  }
529
530
  } return $defineProperty(O, P, Attributes);
530
531
  } : $defineProperty : function defineProperty(O, P, Attributes) {
531
- anObject$g(O);
532
+ anObject$f(O);
532
533
  P = toPropertyKey(P);
533
- anObject$g(Attributes);
534
+ anObject$f(Attributes);
534
535
  if (IE8_DOM_DEFINE) try {
535
536
  return $defineProperty(O, P, Attributes);
536
537
  } catch (error) { /* empty */ }
@@ -572,7 +573,7 @@ var functionName = {
572
573
 
573
574
  var uncurryThis$j = functionUncurryThis;
574
575
  var isCallable$h = isCallable$n;
575
- var store$1 = sharedStore;
576
+ var store$1 = sharedStore.exports;
576
577
 
577
578
  var functionToString = uncurryThis$j(Function.toString);
578
579
 
@@ -585,14 +586,14 @@ if (!isCallable$h(store$1.inspectSource)) {
585
586
 
586
587
  var inspectSource$3 = store$1.inspectSource;
587
588
 
588
- var global$i = global$q;
589
+ var global$i = global$p;
589
590
  var isCallable$g = isCallable$n;
590
591
 
591
592
  var WeakMap$1 = global$i.WeakMap;
592
593
 
593
594
  var weakMapBasicDetection = isCallable$g(WeakMap$1) && /native code/.test(String(WeakMap$1));
594
595
 
595
- var shared$2 = shared$4.exports;
596
+ var shared$2 = shared$4;
596
597
  var uid = uid$2;
597
598
 
598
599
  var keys$1 = shared$2('keys');
@@ -604,11 +605,11 @@ var sharedKey$3 = function (key) {
604
605
  var hiddenKeys$4 = {};
605
606
 
606
607
  var NATIVE_WEAK_MAP = weakMapBasicDetection;
607
- var global$h = global$q;
608
- var isObject$8 = isObject$d;
608
+ var global$h = global$p;
609
+ var isObject$9 = isObject$e;
609
610
  var createNonEnumerableProperty$8 = createNonEnumerableProperty$9;
610
611
  var hasOwn$a = hasOwnProperty_1;
611
- var shared$1 = sharedStore;
612
+ var shared$1 = sharedStore.exports;
612
613
  var sharedKey$2 = sharedKey$3;
613
614
  var hiddenKeys$3 = hiddenKeys$4;
614
615
 
@@ -624,7 +625,7 @@ var enforce = function (it) {
624
625
  var getterFor = function (TYPE) {
625
626
  return function (it) {
626
627
  var state;
627
- if (!isObject$8(it) || (state = get(it)).type !== TYPE) {
628
+ if (!isObject$9(it) || (state = get(it)).type !== TYPE) {
628
629
  throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
629
630
  } return state;
630
631
  };
@@ -821,6 +822,7 @@ var createMethod$3 = function (IS_INCLUDES) {
821
822
  return function ($this, el, fromIndex) {
822
823
  var O = toIndexedObject$3($this);
823
824
  var length = lengthOfArrayLike$4(O);
825
+ if (length === 0) return !IS_INCLUDES && -1;
824
826
  var index = toAbsoluteIndex(fromIndex, length);
825
827
  var value;
826
828
  // Array#includes uses SameValueZero equality algorithm
@@ -898,13 +900,13 @@ var getBuiltIn$6 = getBuiltIn$8;
898
900
  var uncurryThis$g = functionUncurryThis;
899
901
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
900
902
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
901
- var anObject$f = anObject$h;
903
+ var anObject$e = anObject$g;
902
904
 
903
905
  var concat$1 = uncurryThis$g([].concat);
904
906
 
905
907
  // all object keys, includes non-enumerable and symbols
906
908
  var ownKeys$1 = getBuiltIn$6('Reflect', 'ownKeys') || function ownKeys(it) {
907
- var keys = getOwnPropertyNamesModule.f(anObject$f(it));
909
+ var keys = getOwnPropertyNamesModule.f(anObject$e(it));
908
910
  var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
909
911
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
910
912
  };
@@ -949,7 +951,7 @@ var POLYFILL = isForced$3.POLYFILL = 'P';
949
951
 
950
952
  var isForced_1 = isForced$3;
951
953
 
952
- var global$g = global$q;
954
+ var global$g = global$p;
953
955
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
954
956
  var createNonEnumerableProperty$7 = createNonEnumerableProperty$9;
955
957
  var defineBuiltIn$7 = defineBuiltIn$8;
@@ -1223,7 +1225,7 @@ var defineBuiltInAccessor$3 = function (target, name, descriptor) {
1223
1225
 
1224
1226
  var $$g = _export;
1225
1227
  var DESCRIPTORS$7 = descriptors;
1226
- var global$f = global$q;
1228
+ var global$f = global$p;
1227
1229
  var uncurryThis$e = functionUncurryThis;
1228
1230
  var hasOwn$6 = hasOwnProperty_1;
1229
1231
  var isCallable$b = isCallable$n;
@@ -1283,7 +1285,7 @@ var objectDefineProperties = {};
1283
1285
  var DESCRIPTORS$6 = descriptors;
1284
1286
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1285
1287
  var definePropertyModule = objectDefineProperty;
1286
- var anObject$e = anObject$h;
1288
+ var anObject$d = anObject$g;
1287
1289
  var toIndexedObject$1 = toIndexedObject$5;
1288
1290
  var objectKeys = objectKeys$2;
1289
1291
 
@@ -1291,7 +1293,7 @@ var objectKeys = objectKeys$2;
1291
1293
  // https://tc39.es/ecma262/#sec-object.defineproperties
1292
1294
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1293
1295
  objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1294
- anObject$e(O);
1296
+ anObject$d(O);
1295
1297
  var props = toIndexedObject$1(Properties);
1296
1298
  var keys = objectKeys(Properties);
1297
1299
  var length = keys.length;
@@ -1306,7 +1308,7 @@ var getBuiltIn$5 = getBuiltIn$8;
1306
1308
  var html$2 = getBuiltIn$5('document', 'documentElement');
1307
1309
 
1308
1310
  /* global ActiveXObject -- old IE, WSH */
1309
- var anObject$d = anObject$h;
1311
+ var anObject$c = anObject$g;
1310
1312
  var definePropertiesModule = objectDefineProperties;
1311
1313
  var enumBugKeys = enumBugKeys$3;
1312
1314
  var hiddenKeys = hiddenKeys$4;
@@ -1380,7 +1382,7 @@ hiddenKeys[IE_PROTO$1] = true;
1380
1382
  var objectCreate = Object.create || function create(O, Properties) {
1381
1383
  var result;
1382
1384
  if (O !== null) {
1383
- EmptyConstructor[PROTOTYPE] = anObject$d(O);
1385
+ EmptyConstructor[PROTOTYPE] = anObject$c(O);
1384
1386
  result = new EmptyConstructor();
1385
1387
  EmptyConstructor[PROTOTYPE] = null;
1386
1388
  // add "__proto__" for Object.getPrototypeOf polyfill
@@ -1445,7 +1447,7 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : f
1445
1447
 
1446
1448
  var fails$d = fails$o;
1447
1449
  var isCallable$9 = isCallable$n;
1448
- var isObject$7 = isObject$d;
1450
+ var isObject$8 = isObject$e;
1449
1451
  var getPrototypeOf$1 = objectGetPrototypeOf;
1450
1452
  var defineBuiltIn$6 = defineBuiltIn$8;
1451
1453
  var wellKnownSymbol$e = wellKnownSymbol$j;
@@ -1468,7 +1470,7 @@ if ([].keys) {
1468
1470
  }
1469
1471
  }
1470
1472
 
1471
- var NEW_ITERATOR_PROTOTYPE = !isObject$7(IteratorPrototype$2) || fails$d(function () {
1473
+ var NEW_ITERATOR_PROTOTYPE = !isObject$8(IteratorPrototype$2) || fails$d(function () {
1472
1474
  var test = {};
1473
1475
  // FF44- legacy iterators case
1474
1476
  return IteratorPrototype$2[ITERATOR$6].call(test) !== test;
@@ -1528,10 +1530,10 @@ var functionUncurryThisAccessor = function (object, key, method) {
1528
1530
  } catch (error) { /* empty */ }
1529
1531
  };
1530
1532
 
1531
- var isObject$6 = isObject$d;
1533
+ var isObject$7 = isObject$e;
1532
1534
 
1533
1535
  var isPossiblePrototype$1 = function (argument) {
1534
- return isObject$6(argument) || argument === null;
1536
+ return isObject$7(argument) || argument === null;
1535
1537
  };
1536
1538
 
1537
1539
  var isPossiblePrototype = isPossiblePrototype$1;
@@ -1546,7 +1548,8 @@ var aPossiblePrototype$1 = function (argument) {
1546
1548
 
1547
1549
  /* eslint-disable no-proto -- safe */
1548
1550
  var uncurryThisAccessor = functionUncurryThisAccessor;
1549
- var anObject$c = anObject$h;
1551
+ var isObject$6 = isObject$e;
1552
+ var requireObjectCoercible$6 = requireObjectCoercible$9;
1550
1553
  var aPossiblePrototype = aPossiblePrototype$1;
1551
1554
 
1552
1555
  // `Object.setPrototypeOf` method
@@ -1563,8 +1566,9 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1563
1566
  CORRECT_SETTER = test instanceof Array;
1564
1567
  } catch (error) { /* empty */ }
1565
1568
  return function setPrototypeOf(O, proto) {
1566
- anObject$c(O);
1569
+ requireObjectCoercible$6(O);
1567
1570
  aPossiblePrototype(proto);
1571
+ if (!isObject$6(O)) return O;
1568
1572
  if (CORRECT_SETTER) setter(O, proto);
1569
1573
  else O.__proto__ = proto;
1570
1574
  return O;
@@ -1782,7 +1786,7 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
1782
1786
 
1783
1787
  var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1784
1788
 
1785
- var global$e = global$q;
1789
+ var global$e = global$p;
1786
1790
  var DOMIterables = domIterables;
1787
1791
  var DOMTokenListPrototype = domTokenListPrototype;
1788
1792
  var ArrayIteratorMethods = es_array_iterator;
@@ -2031,7 +2035,7 @@ const ConfirmationDialog = _a => {
2031
2035
  }, rest), content);
2032
2036
  };
2033
2037
 
2034
- var global$d = global$q;
2038
+ var global$d = global$p;
2035
2039
  var classof$6 = classofRaw$2;
2036
2040
 
2037
2041
  var engineIsNode = classof$6(global$d.process) === 'process';
@@ -2126,7 +2130,7 @@ var aConstructor$1 = function (argument) {
2126
2130
  throw new $TypeError$9(tryToString$2(argument) + ' is not a constructor');
2127
2131
  };
2128
2132
 
2129
- var anObject$b = anObject$h;
2133
+ var anObject$b = anObject$g;
2130
2134
  var aConstructor = aConstructor$1;
2131
2135
  var isNullOrUndefined$4 = isNullOrUndefined$7;
2132
2136
  var wellKnownSymbol$9 = wellKnownSymbol$j;
@@ -2192,7 +2196,7 @@ var userAgent$2 = engineUserAgent;
2192
2196
  // eslint-disable-next-line redos/no-vulnerable -- safe
2193
2197
  var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
2194
2198
 
2195
- var global$c = global$q;
2199
+ var global$c = global$p;
2196
2200
  var apply$1 = functionApply;
2197
2201
  var bind$4 = functionBindContext;
2198
2202
  var isCallable$6 = isCallable$n;
@@ -2309,7 +2313,7 @@ var task$1 = {
2309
2313
  clear: clear
2310
2314
  };
2311
2315
 
2312
- var global$b = global$q;
2316
+ var global$b = global$p;
2313
2317
  var DESCRIPTORS$3 = descriptors;
2314
2318
 
2315
2319
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -2355,7 +2359,7 @@ var userAgent = engineUserAgent;
2355
2359
 
2356
2360
  var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
2357
2361
 
2358
- var global$a = global$q;
2362
+ var global$a = global$p;
2359
2363
  var safeGetBuiltIn = safeGetBuiltIn$1;
2360
2364
  var bind$3 = functionBindContext;
2361
2365
  var macrotask = task$1.set;
@@ -2449,7 +2453,7 @@ var perform$3 = function (exec) {
2449
2453
  }
2450
2454
  };
2451
2455
 
2452
- var global$9 = global$q;
2456
+ var global$9 = global$p;
2453
2457
 
2454
2458
  var promiseNativeConstructor = global$9.Promise;
2455
2459
 
@@ -2463,7 +2467,7 @@ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$2
2463
2467
  && typeof window == 'object'
2464
2468
  && typeof document == 'object';
2465
2469
 
2466
- var global$8 = global$q;
2470
+ var global$8 = global$p;
2467
2471
  var NativePromiseConstructor$3 = promiseNativeConstructor;
2468
2472
  var isCallable$5 = isCallable$n;
2469
2473
  var isForced$1 = isForced_1;
@@ -2533,7 +2537,7 @@ newPromiseCapability$2.f = function (C) {
2533
2537
 
2534
2538
  var $$e = _export;
2535
2539
  var IS_NODE$1 = engineIsNode;
2536
- var global$7 = global$q;
2540
+ var global$7 = global$p;
2537
2541
  var call$d = functionCall;
2538
2542
  var defineBuiltIn$4 = defineBuiltIn$8;
2539
2543
  var setPrototypeOf$2 = objectSetPrototypeOf;
@@ -2541,7 +2545,7 @@ var setToStringTag = setToStringTag$4;
2541
2545
  var setSpecies$1 = setSpecies$2;
2542
2546
  var aCallable$4 = aCallable$9;
2543
2547
  var isCallable$4 = isCallable$n;
2544
- var isObject$5 = isObject$d;
2548
+ var isObject$5 = isObject$e;
2545
2549
  var anInstance = anInstance$1;
2546
2550
  var speciesConstructor$1 = speciesConstructor$2;
2547
2551
  var task = task$1.set;
@@ -2845,7 +2849,7 @@ var getIteratorMethod$2 = function (it) {
2845
2849
 
2846
2850
  var call$c = functionCall;
2847
2851
  var aCallable$3 = aCallable$9;
2848
- var anObject$a = anObject$h;
2852
+ var anObject$a = anObject$g;
2849
2853
  var tryToString$1 = tryToString$4;
2850
2854
  var getIteratorMethod$1 = getIteratorMethod$2;
2851
2855
 
@@ -2858,7 +2862,7 @@ var getIterator$1 = function (argument, usingIterator) {
2858
2862
  };
2859
2863
 
2860
2864
  var call$b = functionCall;
2861
- var anObject$9 = anObject$h;
2865
+ var anObject$9 = anObject$g;
2862
2866
  var getMethod$3 = getMethod$6;
2863
2867
 
2864
2868
  var iteratorClose$1 = function (iterator, kind, value) {
@@ -2883,7 +2887,7 @@ var iteratorClose$1 = function (iterator, kind, value) {
2883
2887
 
2884
2888
  var bind$1 = functionBindContext;
2885
2889
  var call$a = functionCall;
2886
- var anObject$8 = anObject$h;
2890
+ var anObject$8 = anObject$g;
2887
2891
  var tryToString = tryToString$4;
2888
2892
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
2889
2893
  var lengthOfArrayLike$3 = lengthOfArrayLike$5;
@@ -3104,8 +3108,8 @@ $$a({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
3104
3108
  }
3105
3109
  });
3106
3110
 
3107
- var anObject$7 = anObject$h;
3108
- var isObject$4 = isObject$d;
3111
+ var anObject$7 = anObject$g;
3112
+ var isObject$4 = isObject$e;
3109
3113
  var newPromiseCapability = newPromiseCapability$2;
3110
3114
 
3111
3115
  var promiseResolve$1 = function (C, x) {
@@ -3323,6 +3327,25 @@ const useMakeSureContainerStaysInsideWindow = (nodeRef, position, setPosition) =
3323
3327
  }, [onResizeWindow]);
3324
3328
  };
3325
3329
 
3330
+ /*
3331
+ Accepts a value and timeout and will debounce
3332
+
3333
+ @param {string} value: value of element
3334
+ @param {timeout} number: timer
3335
+ @return {value: string}
3336
+
3337
+ @example:
3338
+ const debouncedName = useDebounce('testing', 2000)
3339
+ */
3340
+ const useDebounce = (value, timeout) => {
3341
+ const [state, setState] = React.useState(value);
3342
+ React.useEffect(() => {
3343
+ const handler = setTimeout(() => setState(value), timeout);
3344
+ return () => clearTimeout(handler);
3345
+ }, [value, timeout]);
3346
+ return state;
3347
+ };
3348
+
3326
3349
  const ConfirmationServiceContext = /*#__PURE__*/React.createContext(Promise.reject);
3327
3350
  const useConfirmationDialog = () => React.useContext(ConfirmationServiceContext);
3328
3351
  const useDialogActions = (awaitingPromiseRef, defaultOptions = null) => {
@@ -3753,7 +3776,7 @@ var flattenIntoArray_1 = flattenIntoArray$1;
3753
3776
 
3754
3777
  var isArray$1 = isArray$3;
3755
3778
  var isConstructor = isConstructor$2;
3756
- var isObject$3 = isObject$d;
3779
+ var isObject$3 = isObject$e;
3757
3780
  var wellKnownSymbol$4 = wellKnownSymbol$j;
3758
3781
 
3759
3782
  var SPECIES$1 = wellKnownSymbol$4('species');
@@ -3814,7 +3837,7 @@ var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u200
3814
3837
  '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
3815
3838
 
3816
3839
  var uncurryThis$8 = functionUncurryThis;
3817
- var requireObjectCoercible$5 = requireObjectCoercible$8;
3840
+ var requireObjectCoercible$5 = requireObjectCoercible$9;
3818
3841
  var toString$a = toString$c;
3819
3842
  var whitespaces$1 = whitespaces$2;
3820
3843
 
@@ -3844,7 +3867,7 @@ var stringTrim = {
3844
3867
  trim: createMethod$2(3)
3845
3868
  };
3846
3869
 
3847
- var global$6 = global$q;
3870
+ var global$6 = global$p;
3848
3871
  var fails$a = fails$o;
3849
3872
  var uncurryThis$7 = functionUncurryThis;
3850
3873
  var toString$9 = toString$c;
@@ -3958,7 +3981,7 @@ const ResizeComponent = _a => {
3958
3981
  }, props), children);
3959
3982
  };
3960
3983
 
3961
- var anObject$6 = anObject$h;
3984
+ var anObject$6 = anObject$g;
3962
3985
 
3963
3986
  // `RegExp.prototype.flags` getter implementation
3964
3987
  // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
@@ -3991,7 +4014,7 @@ var regexpGetFlags = function (R) {
3991
4014
 
3992
4015
  var PROPER_FUNCTION_NAME = functionName.PROPER;
3993
4016
  var defineBuiltIn$2 = defineBuiltIn$8;
3994
- var anObject$5 = anObject$h;
4017
+ var anObject$5 = anObject$g;
3995
4018
  var $toString = toString$c;
3996
4019
  var fails$9 = fails$o;
3997
4020
  var getRegExpFlags$1 = regexpGetFlags;
@@ -5434,9 +5457,10 @@ const TooltipSelect = _a => {
5434
5457
  isEnabled,
5435
5458
  hasBackgroundColor,
5436
5459
  variant = 'standard',
5437
- additionalStyling = {}
5460
+ additionalStyling = {},
5461
+ skipLocalStyling = false
5438
5462
  } = _a,
5439
- props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange", "isEnabled", "hasBackgroundColor", "variant", "additionalStyling"]);
5463
+ props = __rest(_a, ["tooltip", "list", "currentIndex", "onChangeMouseWheel", "requiresCtrlToChange", "isEnabled", "hasBackgroundColor", "variant", "additionalStyling", "skipLocalStyling"]);
5440
5464
  const [selectOpen, setSelectOpen] = React.useState(false);
5441
5465
  const [tooltipOpen, setTooltipOpen] = useControlledTooltip();
5442
5466
  const onWheel = React.useCallback(event => {
@@ -5489,18 +5513,20 @@ const TooltipSelect = _a => {
5489
5513
  onWheel: onWheel,
5490
5514
  isEnabled: isEnabled,
5491
5515
  hasBackgroundColor: hasBackgroundColor,
5492
- additionalStyling: additionalStyling
5516
+ additionalStyling: additionalStyling,
5517
+ skipLocalStyling: skipLocalStyling
5493
5518
  }, props)));
5494
5519
  };
5495
5520
  // Style the select
5496
5521
  const BaseSelect = styled(Select, {
5497
- shouldForwardProp: prop => prop !== 'isEnabled' && prop !== 'hasBackgroundColor'
5522
+ shouldForwardProp: prop => prop !== 'isEnabled' && prop !== 'hasBackgroundColor' && prop !== 'skipLocalStyling'
5498
5523
  })(({
5499
5524
  theme,
5500
5525
  isEnabled,
5501
- hasBackgroundColor
5526
+ hasBackgroundColor,
5527
+ skipLocalStyling
5502
5528
  }) => {
5503
- return Object.assign(Object.assign({}, tooltipContainerStyles(theme, !!isEnabled, hasBackgroundColor)), theme.palette.geowebColors.tooltips.tooltipSelect.select);
5529
+ return Object.assign({}, !skipLocalStyling && tooltipContainerStyles(theme, !!isEnabled, hasBackgroundColor));
5504
5530
  });
5505
5531
  // Style the menu pop-over
5506
5532
  const StyledSelect = styled( /*#__PURE__*/React.forwardRef((_a, ref) => {
@@ -5568,7 +5594,7 @@ const StyledSelect = styled( /*#__PURE__*/React.forwardRef((_a, ref) => {
5568
5594
  }
5569
5595
  }
5570
5596
  }));
5571
- const tooltipContainerStyles = (theme, isEnabled, hasBackgroundColor = true) => Object.assign({
5597
+ const tooltipContainerStyles = (theme, isEnabled, hasBackgroundColor = true) => Object.assign(Object.assign({
5572
5598
  width: '100%',
5573
5599
  height: 32,
5574
5600
  fontWeight: 500,
@@ -5596,7 +5622,7 @@ const tooltipContainerStyles = (theme, isEnabled, hasBackgroundColor = true) =>
5596
5622
  '&>div': {
5597
5623
  paddingLeft: '8px!important'
5598
5624
  }
5599
- }, hasBackgroundColor && {
5625
+ }, theme.palette.geowebColors.tooltips.tooltipSelect.select), hasBackgroundColor && {
5600
5626
  '&:hover': {
5601
5627
  backgroundColor: theme.palette.geowebColors.buttons.tool.mouseOver.fill,
5602
5628
  borderRadius: 0
@@ -5692,6 +5718,8 @@ var lengthOfArrayLike = lengthOfArrayLike$5;
5692
5718
 
5693
5719
  var $TypeError$3 = TypeError;
5694
5720
 
5721
+ var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
5722
+
5695
5723
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
5696
5724
  var createMethod$1 = function (IS_RIGHT) {
5697
5725
  return function (that, callbackfn, argumentsLength, memo) {
@@ -5699,6 +5727,7 @@ var createMethod$1 = function (IS_RIGHT) {
5699
5727
  var self = IndexedObject(O);
5700
5728
  var length = lengthOfArrayLike(O);
5701
5729
  aCallable(callbackfn);
5730
+ if (length === 0 && argumentsLength < 2) throw new $TypeError$3(REDUCE_EMPTY);
5702
5731
  var index = IS_RIGHT ? length - 1 : 0;
5703
5732
  var i = IS_RIGHT ? -1 : 1;
5704
5733
  if (argumentsLength < 2) while (true) {
@@ -5709,7 +5738,7 @@ var createMethod$1 = function (IS_RIGHT) {
5709
5738
  }
5710
5739
  index += i;
5711
5740
  if (IS_RIGHT ? index < 0 : length <= index) {
5712
- throw new $TypeError$3('Reduce of empty array with no initial value');
5741
+ throw new $TypeError$3(REDUCE_EMPTY);
5713
5742
  }
5714
5743
  }
5715
5744
  for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
@@ -5759,7 +5788,7 @@ $$4({ target: 'Array', proto: true, forced: FORCED$1 }, {
5759
5788
  });
5760
5789
 
5761
5790
  var isCallable$2 = isCallable$n;
5762
- var isObject$2 = isObject$d;
5791
+ var isObject$2 = isObject$e;
5763
5792
  var setPrototypeOf$1 = objectSetPrototypeOf;
5764
5793
 
5765
5794
  // makes subclassing work correct for wrapped built-ins
@@ -5777,7 +5806,7 @@ var inheritIfRequired$2 = function ($this, dummy, Wrapper) {
5777
5806
  return $this;
5778
5807
  };
5779
5808
 
5780
- var isObject$1 = isObject$d;
5809
+ var isObject$1 = isObject$e;
5781
5810
  var classof$2 = classofRaw$2;
5782
5811
  var wellKnownSymbol$3 = wellKnownSymbol$j;
5783
5812
 
@@ -5791,7 +5820,7 @@ var isRegexp = function (it) {
5791
5820
  };
5792
5821
 
5793
5822
  var fails$6 = fails$o;
5794
- var global$5 = global$q;
5823
+ var global$5 = global$p;
5795
5824
 
5796
5825
  // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
5797
5826
  var $RegExp$2 = global$5.RegExp;
@@ -5832,7 +5861,7 @@ var proxyAccessor$2 = function (Target, Source, key) {
5832
5861
  };
5833
5862
 
5834
5863
  var fails$5 = fails$o;
5835
- var global$4 = global$q;
5864
+ var global$4 = global$p;
5836
5865
 
5837
5866
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
5838
5867
  var $RegExp$1 = global$4.RegExp;
@@ -5843,7 +5872,7 @@ var regexpUnsupportedDotAll = fails$5(function () {
5843
5872
  });
5844
5873
 
5845
5874
  var fails$4 = fails$o;
5846
- var global$3 = global$q;
5875
+ var global$3 = global$p;
5847
5876
 
5848
5877
  // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
5849
5878
  var $RegExp = global$3.RegExp;
@@ -5855,7 +5884,7 @@ var regexpUnsupportedNcg = fails$4(function () {
5855
5884
  });
5856
5885
 
5857
5886
  var DESCRIPTORS$2 = descriptors;
5858
- var global$2 = global$q;
5887
+ var global$2 = global$p;
5859
5888
  var uncurryThis$5 = functionUncurryThis;
5860
5889
  var isForced = isForced_1;
5861
5890
  var inheritIfRequired$1 = inheritIfRequired$2;
@@ -6079,7 +6108,7 @@ var uncurryThis$4 = functionUncurryThis;
6079
6108
  var toString$7 = toString$c;
6080
6109
  var regexpFlags = regexpFlags$1;
6081
6110
  var stickyHelpers$1 = regexpStickyHelpers;
6082
- var shared = shared$4.exports;
6111
+ var shared = shared$4;
6083
6112
  var create = objectCreate;
6084
6113
  var getInternalState = internalState.get;
6085
6114
  var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
@@ -6227,7 +6256,7 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
6227
6256
  var $$2 = _export;
6228
6257
  var uncurryThis$3 = functionUncurryThis;
6229
6258
  var notARegExp = notARegexp;
6230
- var requireObjectCoercible$4 = requireObjectCoercible$8;
6259
+ var requireObjectCoercible$4 = requireObjectCoercible$9;
6231
6260
  var toString$6 = toString$c;
6232
6261
  var correctIsRegExpLogic = correctIsRegexpLogic;
6233
6262
 
@@ -6330,7 +6359,7 @@ var sameValue$1 = Object.is || function is(x, y) {
6330
6359
  };
6331
6360
 
6332
6361
  var call$4 = functionCall;
6333
- var anObject$4 = anObject$h;
6362
+ var anObject$4 = anObject$g;
6334
6363
  var isCallable$1 = isCallable$n;
6335
6364
  var classof = classofRaw$2;
6336
6365
  var regexpExec = regexpExec$2;
@@ -6352,9 +6381,9 @@ var regexpExecAbstract = function (R, S) {
6352
6381
 
6353
6382
  var call$3 = functionCall;
6354
6383
  var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
6355
- var anObject$3 = anObject$h;
6384
+ var anObject$3 = anObject$g;
6356
6385
  var isNullOrUndefined$2 = isNullOrUndefined$7;
6357
- var requireObjectCoercible$3 = requireObjectCoercible$8;
6386
+ var requireObjectCoercible$3 = requireObjectCoercible$9;
6358
6387
  var sameValue = sameValue$1;
6359
6388
  var toString$5 = toString$c;
6360
6389
  var getMethod$2 = getMethod$6;
@@ -6391,7 +6420,7 @@ fixRegExpWellKnownSymbolLogic$2('search', function (SEARCH, nativeSearch, maybeC
6391
6420
  var uncurryThis$2 = functionUncurryThis;
6392
6421
  var toIntegerOrInfinity = toIntegerOrInfinity$4;
6393
6422
  var toString$4 = toString$c;
6394
- var requireObjectCoercible$2 = requireObjectCoercible$8;
6423
+ var requireObjectCoercible$2 = requireObjectCoercible$9;
6395
6424
 
6396
6425
  var charAt$1 = uncurryThis$2(''.charAt);
6397
6426
  var charCodeAt = uncurryThis$2(''.charCodeAt);
@@ -6436,9 +6465,9 @@ var advanceStringIndex$2 = function (S, index, unicode) {
6436
6465
  var call$2 = functionCall;
6437
6466
  var uncurryThis$1 = functionUncurryThis;
6438
6467
  var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
6439
- var anObject$2 = anObject$h;
6468
+ var anObject$2 = anObject$g;
6440
6469
  var isNullOrUndefined$1 = isNullOrUndefined$7;
6441
- var requireObjectCoercible$1 = requireObjectCoercible$8;
6470
+ var requireObjectCoercible$1 = requireObjectCoercible$9;
6442
6471
  var speciesConstructor = speciesConstructor$2;
6443
6472
  var advanceStringIndex$1 = advanceStringIndex$2;
6444
6473
  var toLength$1 = toLength$3;
@@ -6580,16 +6609,24 @@ const styles = {
6580
6609
  fontWeight: 500
6581
6610
  }
6582
6611
  };
6583
- const SwitchButton = props => {
6612
+ const SwitchButton = _a => {
6613
+ var {
6614
+ activeLabel = 'Editor',
6615
+ inActiveLabel = 'Viewer',
6616
+ tooltip = 'Switch mode'
6617
+ } = _a,
6618
+ props = __rest(_a, ["activeLabel", "inActiveLabel", "tooltip"]);
6584
6619
  return /*#__PURE__*/React.createElement(CustomTooltip, {
6585
- title: "Switch mode"
6586
- }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormLabel, {
6620
+ title: tooltip
6621
+ }, /*#__PURE__*/React.createElement("span", {
6622
+ role: "button"
6623
+ }, /*#__PURE__*/React.createElement(FormLabel, {
6587
6624
  sx: styles.label
6588
- }, "Viewer"), /*#__PURE__*/React.createElement(Switch, Object.assign({
6625
+ }, inActiveLabel), /*#__PURE__*/React.createElement(Switch, Object.assign({
6589
6626
  "data-testid": "switchMode"
6590
6627
  }, props)), /*#__PURE__*/React.createElement(FormLabel, {
6591
6628
  sx: styles.label
6592
- }, "Editor")));
6629
+ }, activeLabel)));
6593
6630
  };
6594
6631
 
6595
6632
  // TODO: Remove from `core-js@4` since it's moved to entry points
@@ -6597,7 +6634,7 @@ const SwitchButton = props => {
6597
6634
  var $$1 = _export;
6598
6635
  var call$1 = functionCall;
6599
6636
  var isCallable = isCallable$n;
6600
- var anObject$1 = anObject$h;
6637
+ var anObject$1 = anObject$g;
6601
6638
  var toString$2 = toString$c;
6602
6639
 
6603
6640
  var DELEGATES_TO_EXEC = function () {
@@ -7216,7 +7253,7 @@ var normalizeStringArgument$1 = function (argument, $default) {
7216
7253
  return argument === undefined ? arguments.length < 2 ? '' : $default : toString$1(argument);
7217
7254
  };
7218
7255
 
7219
- var isObject = isObject$d;
7256
+ var isObject = isObject$e;
7220
7257
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$9;
7221
7258
 
7222
7259
  // `InstallErrorCause` abstract operation
@@ -7334,7 +7371,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
7334
7371
 
7335
7372
  /* eslint-disable no-unused-vars -- required for functions `.length` */
7336
7373
  var $ = _export;
7337
- var global$1 = global$q;
7374
+ var global$1 = global$p;
7338
7375
  var apply = functionApply;
7339
7376
  var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
7340
7377
 
@@ -7392,11 +7429,11 @@ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
7392
7429
 
7393
7430
  var call = functionCall;
7394
7431
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
7395
- var anObject = anObject$h;
7432
+ var anObject = anObject$g;
7396
7433
  var isNullOrUndefined = isNullOrUndefined$7;
7397
7434
  var toLength = toLength$3;
7398
7435
  var toString = toString$c;
7399
- var requireObjectCoercible = requireObjectCoercible$8;
7436
+ var requireObjectCoercible = requireObjectCoercible$9;
7400
7437
  var getMethod = getMethod$6;
7401
7438
  var advanceStringIndex = advanceStringIndex$2;
7402
7439
  var regExpExec = regexpExecAbstract;
@@ -7834,6 +7871,7 @@ const getCurrentTimeAsString = (strFormat = DATE_FORMAT_UTC, utc = true) => {
7834
7871
  };
7835
7872
  /**
7836
7873
  * Set date values to a given date (by default it is assumed you are passing the new values in UTC).
7874
+ * Note that months start at 0!
7837
7875
  * @param date - the dater to be changed
7838
7876
  * @param values - an object with options
7839
7877
  * @param useLocalTimeZone - boolean true if you are passing the values in local timezone
@@ -7867,6 +7905,95 @@ const set = (date, values, useLocalTimeZone = false) => {
7867
7905
  }
7868
7906
  return newDate;
7869
7907
  };
7908
+ /**
7909
+ * Get hours of a passed date in UTC (or local timezone if passed false)
7910
+ * @param date - the date of which to extract hours
7911
+ * @param utc - boolean true - whether to get UTC hours
7912
+ * @returns the hour number
7913
+ */
7914
+ const getHours = (date, utc = true) => {
7915
+ if (utc) {
7916
+ return date.getUTCHours();
7917
+ }
7918
+ return getHours$1(date);
7919
+ };
7920
+ /**
7921
+ * Return the start of hour for the given date. The result will be in UTC.
7922
+ * @param date - the date of which to retrieve the start of the hour
7923
+ * @returns the new date
7924
+ */
7925
+ const startOfHourUTC = date => {
7926
+ const hourNum = date.getUTCHours();
7927
+ return set(new Date(date), {
7928
+ hours: hourNum,
7929
+ minutes: 0,
7930
+ seconds: 0,
7931
+ milliseconds: 0
7932
+ });
7933
+ };
7934
+ /**
7935
+ * Return the start of a day for the given date. The result will be in UTC.
7936
+ * @param date - the date of which to retrieve the start of day
7937
+ * @returns the new date
7938
+ */
7939
+ const startOfDayUTC = date => {
7940
+ const dateNum = date.getUTCDate();
7941
+ return set(new Date(date), {
7942
+ date: dateNum,
7943
+ hours: 0,
7944
+ minutes: 0,
7945
+ seconds: 0,
7946
+ milliseconds: 0
7947
+ });
7948
+ };
7949
+ /**
7950
+ * Return the start of a week for the given date. The result will be in UTC.
7951
+ * @param date - the date of which to retrieve the start of the week
7952
+ * @returns the new date
7953
+ */
7954
+ const startOfWeekUTC = date => {
7955
+ const dateNum = date.getUTCDate();
7956
+ const dayNum = date.getUTCDay();
7957
+ const dayDifference = (dayNum < 1 ? 7 : 0) + dayNum - 1;
7958
+ return set(new Date(date), {
7959
+ date: dateNum - dayDifference,
7960
+ hours: 0,
7961
+ minutes: 0,
7962
+ seconds: 0,
7963
+ milliseconds: 0
7964
+ });
7965
+ };
7966
+ /**
7967
+ * Return the start of a month for the given date. The result will be in UTC.
7968
+ * @param date - the date of which to retrieve the start of the month
7969
+ * @returns the new date
7970
+ */
7971
+ const startOfMonthUTC = date => {
7972
+ return set(new Date(date), {
7973
+ date: 1,
7974
+ hours: 0,
7975
+ minutes: 0,
7976
+ seconds: 0,
7977
+ milliseconds: 0
7978
+ });
7979
+ };
7980
+ /**
7981
+ * Return the start of a year for the given date. The result will be in UTC.
7982
+ * @param date - the date of which to retrieve the start of the year
7983
+ * @returns the new date
7984
+ */
7985
+ const startOfYearUTC = date => {
7986
+ const yearNum = date.getUTCFullYear();
7987
+ return set(new Date(date), {
7988
+ year: yearNum,
7989
+ month: 0,
7990
+ date: 1,
7991
+ hours: 0,
7992
+ minutes: 0,
7993
+ seconds: 0,
7994
+ milliseconds: 0
7995
+ });
7996
+ };
7870
7997
 
7871
7998
  /* *
7872
7999
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -7913,10 +8040,20 @@ var index = /*#__PURE__*/Object.freeze({
7913
8040
  getNowUtc: getNowUtc,
7914
8041
  getCurrentTimeAsString: getCurrentTimeAsString,
7915
8042
  set: set,
8043
+ getHours: getHours,
8044
+ startOfHourUTC: startOfHourUTC,
8045
+ startOfDayUTC: startOfDayUTC,
8046
+ startOfWeekUTC: startOfWeekUTC,
8047
+ startOfMonthUTC: startOfMonthUTC,
8048
+ startOfYearUTC: startOfYearUTC,
7916
8049
  isEqual: isEqual,
7917
8050
  startOfDay: startOfDay,
7918
8051
  parseISO: parseISO,
7919
- isWithinInterval: isWithinInterval
8052
+ isWithinInterval: isWithinInterval,
8053
+ getDay: getDay,
8054
+ getMonth: getMonth,
8055
+ getYear: getYear,
8056
+ getWeek: getWeek
7920
8057
  });
7921
8058
 
7922
8059
  /* *
@@ -7962,6 +8099,39 @@ const createToolkitMockStoreWithEggs = storeConfig => {
7962
8099
  return store;
7963
8100
  };
7964
8101
 
8102
+ /**
8103
+ * Update i18next translations on the fly when used outside React components
8104
+ * NOTE: If possible pass the `t` function instead of using this
8105
+ * Because this doesnt trigger a rerender when using a language select
8106
+ * This only works for simple values, no interpolation
8107
+ */
8108
+ const handleOutsideComponentTranslations = (translationList, namespace, defaultLanguage = 'en') => {
8109
+ var _a;
8110
+ // we need to create a new object, do not reference the original list directly
8111
+ const outsideComponentTranslations = Object.assign({}, translationList[defaultLanguage]);
8112
+ const updateOutsideComponentTranslations = () => {
8113
+ Object.keys(outsideComponentTranslations).forEach(key => {
8114
+ // @ts-expect-error we need to reassign the translations
8115
+ outsideComponentTranslations[key] = i18next.t(key, {
8116
+ ns: namespace
8117
+ });
8118
+ });
8119
+ };
8120
+ if (i18next.isInitialized) {
8121
+ updateOutsideComponentTranslations();
8122
+ }
8123
+ i18next.on('initialized', () => {
8124
+ updateOutsideComponentTranslations();
8125
+ });
8126
+ i18next.on('languageChanged', () => {
8127
+ updateOutsideComponentTranslations();
8128
+ });
8129
+ (_a = i18next.store) === null || _a === void 0 ? void 0 : _a.on('added', () => {
8130
+ updateOutsideComponentTranslations();
8131
+ });
8132
+ return outsideComponentTranslations;
8133
+ };
8134
+
7965
8135
  /* *
7966
8136
  * Licensed under the Apache License, Version 2.0 (the "License");
7967
8137
  * you may not use this file except in compliance with the License.
@@ -8010,4 +8180,4 @@ class RenderCounter {
8010
8180
  }
8011
8181
  const renderCounter = new RenderCounter();
8012
8182
 
8013
- export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, BUTTON_TITLE, CanvasComponent, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, ErrorBoundary, LastUpdateTime, ResizeComponent as Resizable, SearchField, SearchFieldButton, SearchHighlight, StatusTag, SwitchButton, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosError, pollingIntervalTimeout, renderCounter, showPrompt, sliderHeaderStyle, useConfirmationDialog, useControlledTooltip, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
8183
+ export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, BUTTON_TITLE, CanvasComponent, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, ErrorBoundary, LastUpdateTime, ResizeComponent as Resizable, SearchField, SearchFieldButton, SearchHighlight, StatusTag, SwitchButton, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, handleOutsideComponentTranslations, isAxiosError, pollingIntervalTimeout, renderCounter, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "9.14.0",
3
+ "version": "9.15.0",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -18,7 +18,8 @@
18
18
  "axios": "1.5.0",
19
19
  "date-fns": "^3.3.0",
20
20
  "redux-mock-store": "^1.5.4",
21
- "@reduxjs/toolkit": "^1.9.7"
21
+ "@reduxjs/toolkit": "^1.9.7",
22
+ "i18next": "^23.7.19"
22
23
  },
23
24
  "peerDependencies": {
24
25
  "react": "18"
@@ -1,4 +1,8 @@
1
1
  import { SwitchProps } from '@mui/material';
2
2
  import * as React from 'react';
3
- declare const SwitchButton: React.FC<SwitchProps>;
3
+ declare const SwitchButton: React.FC<SwitchProps & {
4
+ activeLabel?: string;
5
+ inActiveLabel?: string;
6
+ tooltip?: string;
7
+ }>;
4
8
  export default SwitchButton;
@@ -1,19 +1,21 @@
1
1
  import * as React from 'react';
2
2
  import { BaseSelectProps, SelectVariants } from '@mui/material';
3
- import { SxProps } from '@mui/material/styles';
4
- interface ListELement {
3
+ import { SxProps, Theme } from '@mui/material/styles';
4
+ interface ListElement {
5
5
  value: string;
6
6
  }
7
7
  type TooltipSelectProps = Omit<BaseSelectProps, 'sx'> & {
8
8
  tooltip: string;
9
- list?: ListELement[];
9
+ list?: ListElement[];
10
10
  currentIndex?: number;
11
- onChangeMouseWheel?: (element: ListELement) => void;
11
+ onChangeMouseWheel?: (element: ListElement) => void;
12
12
  requiresCtrlToChange?: boolean;
13
13
  isEnabled?: boolean;
14
14
  hasBackgroundColor?: boolean;
15
15
  variant?: SelectVariants;
16
16
  additionalStyling?: SxProps;
17
+ skipLocalStyling?: boolean;
17
18
  };
18
19
  export declare const TooltipSelect: React.FC<TooltipSelectProps>;
20
+ export declare const tooltipContainerStyles: (theme: Theme, isEnabled: boolean, hasBackgroundColor?: boolean) => object;
19
21
  export {};
@@ -3,3 +3,4 @@ export * from './usePoller/usePoller';
3
3
  export * from './usePrevious/usePrevious';
4
4
  export * from './useIsMounted/useIsMounted';
5
5
  export * from './useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow';
6
+ export * from './useDebounce/useDebounce';
@@ -0,0 +1 @@
1
+ export declare const useDebounce: (value: string, timeout: number) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { parseISO, isEqual, Duration, startOfDay, isWithinInterval } from 'date-fns';
1
+ import { parseISO, isEqual, Duration, startOfDay, isWithinInterval, getDay, getMonth, getYear, getWeek } from 'date-fns';
2
2
  export interface DateValues {
3
3
  year?: number;
4
4
  month?: number;
@@ -268,16 +268,54 @@ export declare const getNowUtc: () => Date;
268
268
  export declare const getCurrentTimeAsString: (strFormat?: string, utc?: boolean) => string;
269
269
  /**
270
270
  * Set date values to a given date (by default it is assumed you are passing the new values in UTC).
271
+ * Note that months start at 0!
271
272
  * @param date - the dater to be changed
272
273
  * @param values - an object with options
273
274
  * @param useLocalTimeZone - boolean true if you are passing the values in local timezone
274
275
  * @returns the new date with options set
275
276
  */
276
277
  export declare const set: (date: Date, values: DateValues, useLocalTimeZone?: boolean) => Date;
278
+ /**
279
+ * Get hours of a passed date in UTC (or local timezone if passed false)
280
+ * @param date - the date of which to extract hours
281
+ * @param utc - boolean true - whether to get UTC hours
282
+ * @returns the hour number
283
+ */
284
+ export declare const getHours: (date: Date, utc?: boolean) => number;
285
+ /**
286
+ * Return the start of hour for the given date. The result will be in UTC.
287
+ * @param date - the date of which to retrieve the start of the hour
288
+ * @returns the new date
289
+ */
290
+ export declare const startOfHourUTC: (date: Date) => Date;
291
+ /**
292
+ * Return the start of a day for the given date. The result will be in UTC.
293
+ * @param date - the date of which to retrieve the start of day
294
+ * @returns the new date
295
+ */
296
+ export declare const startOfDayUTC: (date: Date) => Date;
297
+ /**
298
+ * Return the start of a week for the given date. The result will be in UTC.
299
+ * @param date - the date of which to retrieve the start of the week
300
+ * @returns the new date
301
+ */
302
+ export declare const startOfWeekUTC: (date: Date) => Date;
303
+ /**
304
+ * Return the start of a month for the given date. The result will be in UTC.
305
+ * @param date - the date of which to retrieve the start of the month
306
+ * @returns the new date
307
+ */
308
+ export declare const startOfMonthUTC: (date: Date) => Date;
309
+ /**
310
+ * Return the start of a year for the given date. The result will be in UTC.
311
+ * @param date - the date of which to retrieve the start of the year
312
+ * @returns the new date
313
+ */
314
+ export declare const startOfYearUTC: (date: Date) => Date;
277
315
  /**
278
316
  * Compares two dates if values are the same
279
317
  * @param {Date} date - first date
280
318
  * @param {Date} date - second date
281
319
  * @returns {boolean} - True if dates are equal
282
320
  */
283
- export { isEqual, startOfDay, parseISO, isWithinInterval };
321
+ export { isEqual, startOfDay, parseISO, isWithinInterval, getDay, getMonth, getYear, getWeek, };
@@ -1,4 +1,5 @@
1
1
  export * from './axiosErrorUtils';
2
2
  export * as dateUtils from './dateUtils';
3
3
  export * from './reduxTestUtils';
4
+ export * from './translationUtils';
4
5
  export { renderCounter } from './renderCounter';
@@ -0,0 +1 @@
1
+ export * from './translationUtils';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Update i18next translations on the fly when used outside React components
3
+ * NOTE: If possible pass the `t` function instead of using this
4
+ * Because this doesnt trigger a rerender when using a language select
5
+ * This only works for simple values, no interpolation
6
+ */
7
+ export declare const handleOutsideComponentTranslations: <T extends Record<string, string>>(translationList: Record<string, T>, namespace: string, defaultLanguage?: string) => T;