@opengeoweb/api 9.16.0 → 9.18.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
@@ -4,7 +4,7 @@ import { useIsMounted, useDebounce } from '@opengeoweb/shared';
4
4
 
5
5
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
6
 
7
- var fails$q = function (exec) {
7
+ var fails$s = function (exec) {
8
8
  try {
9
9
  return !!exec();
10
10
  } catch (error) {
@@ -12,9 +12,9 @@ var fails$q = function (exec) {
12
12
  }
13
13
  };
14
14
 
15
- var fails$p = fails$q;
15
+ var fails$r = fails$s;
16
16
 
17
- var functionBindNative = !fails$p(function () {
17
+ var functionBindNative = !fails$r(function () {
18
18
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
19
19
  var test = (function () { /* empty */ }).bind();
20
20
  // eslint-disable-next-line no-prototype-builtins -- safe
@@ -43,14 +43,14 @@ var classofRaw$2 = function (it) {
43
43
  };
44
44
 
45
45
  var uncurryThis$q = functionUncurryThis;
46
- var fails$o = fails$q;
46
+ var fails$q = fails$s;
47
47
  var classof$a = classofRaw$2;
48
48
 
49
49
  var $Object$4 = Object;
50
50
  var split$1 = uncurryThis$q(''.split);
51
51
 
52
52
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
53
- var indexedObject = fails$o(function () {
53
+ var indexedObject = fails$q(function () {
54
54
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
55
55
  // eslint-disable-next-line no-prototype-builtins -- safe
56
56
  return !$Object$4('z').propertyIsEnumerable(0);
@@ -66,21 +66,21 @@ var isNullOrUndefined$5 = function (it) {
66
66
 
67
67
  var isNullOrUndefined$4 = isNullOrUndefined$5;
68
68
 
69
- var $TypeError$e = TypeError;
69
+ var $TypeError$h = TypeError;
70
70
 
71
71
  // `RequireObjectCoercible` abstract operation
72
72
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
73
73
  var requireObjectCoercible$6 = function (it) {
74
- if (isNullOrUndefined$4(it)) throw new $TypeError$e("Can't call method on " + it);
74
+ if (isNullOrUndefined$4(it)) throw new $TypeError$h("Can't call method on " + it);
75
75
  return it;
76
76
  };
77
77
 
78
78
  // toObject with fallback for non-array-like ES3 strings
79
- var IndexedObject$1 = indexedObject;
79
+ var IndexedObject$2 = indexedObject;
80
80
  var requireObjectCoercible$5 = requireObjectCoercible$6;
81
81
 
82
82
  var toIndexedObject$5 = function (it) {
83
- return IndexedObject$1(requireObjectCoercible$5(it));
83
+ return IndexedObject$2(requireObjectCoercible$5(it));
84
84
  };
85
85
 
86
86
  var check = function (it) {
@@ -142,12 +142,12 @@ var $Object$3 = Object;
142
142
 
143
143
  // `ToObject` abstract operation
144
144
  // https://tc39.es/ecma262/#sec-toobject
145
- var toObject$4 = function (argument) {
145
+ var toObject$6 = function (argument) {
146
146
  return $Object$3(requireObjectCoercible$4(argument));
147
147
  };
148
148
 
149
149
  var uncurryThis$p = functionUncurryThis;
150
- var toObject$3 = toObject$4;
150
+ var toObject$5 = toObject$6;
151
151
 
152
152
  var hasOwnProperty = uncurryThis$p({}.hasOwnProperty);
153
153
 
@@ -155,7 +155,7 @@ var hasOwnProperty = uncurryThis$p({}.hasOwnProperty);
155
155
  // https://tc39.es/ecma262/#sec-hasownproperty
156
156
  // eslint-disable-next-line es/no-object-hasown -- safe
157
157
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
158
- return hasOwnProperty(toObject$3(it), key);
158
+ return hasOwnProperty(toObject$5(it), key);
159
159
  };
160
160
 
161
161
  var uncurryThis$o = functionUncurryThis;
@@ -200,13 +200,13 @@ var engineV8Version = version;
200
200
 
201
201
  /* eslint-disable es/no-symbol -- required for testing */
202
202
  var V8_VERSION$1 = engineV8Version;
203
- var fails$n = fails$q;
203
+ var fails$p = fails$s;
204
204
  var global$m = global$p;
205
205
 
206
206
  var $String$6 = global$m.String;
207
207
 
208
208
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
209
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$n(function () {
209
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$p(function () {
210
210
  var symbol = Symbol('symbol detection');
211
211
  // Chrome 38 Symbol has incorrect toString conversion
212
212
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
@@ -264,30 +264,30 @@ var isObject$e = function (it) {
264
264
  var isObject$d = isObject$e;
265
265
 
266
266
  var $String$5 = String;
267
- var $TypeError$d = TypeError;
267
+ var $TypeError$g = TypeError;
268
268
 
269
269
  // `Assert: Type(argument) is Object`
270
270
  var anObject$g = function (argument) {
271
271
  if (isObject$d(argument)) return argument;
272
- throw new $TypeError$d($String$5(argument) + ' is not an object');
272
+ throw new $TypeError$g($String$5(argument) + ' is not an object');
273
273
  };
274
274
 
275
275
  var objectDefineProperties = {};
276
276
 
277
- var fails$m = fails$q;
277
+ var fails$o = fails$s;
278
278
 
279
279
  // Detect IE8's incomplete defineProperty implementation
280
- var descriptors = !fails$m(function () {
280
+ var descriptors = !fails$o(function () {
281
281
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
282
282
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
283
283
  });
284
284
 
285
- var DESCRIPTORS$i = descriptors;
286
- var fails$l = fails$q;
285
+ var DESCRIPTORS$j = descriptors;
286
+ var fails$n = fails$s;
287
287
 
288
288
  // V8 ~ Chrome 36-
289
289
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
290
- var v8PrototypeDefineBug = DESCRIPTORS$i && fails$l(function () {
290
+ var v8PrototypeDefineBug = DESCRIPTORS$j && fails$n(function () {
291
291
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
292
292
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
293
293
  value: 42,
@@ -308,12 +308,12 @@ var documentCreateElement$2 = function (it) {
308
308
  return EXISTS$1 ? document$3.createElement(it) : {};
309
309
  };
310
310
 
311
- var DESCRIPTORS$h = descriptors;
312
- var fails$k = fails$q;
311
+ var DESCRIPTORS$i = descriptors;
312
+ var fails$m = fails$s;
313
313
  var createElement$1 = documentCreateElement$2;
314
314
 
315
315
  // Thanks to IE8 for its funny defineProperty
316
- var ie8DomDefine = !DESCRIPTORS$h && !fails$k(function () {
316
+ var ie8DomDefine = !DESCRIPTORS$i && !fails$m(function () {
317
317
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
318
318
  return Object.defineProperty(createElement$1('div'), 'a', {
319
319
  get: function () { return 7; }
@@ -370,29 +370,29 @@ var tryToString$4 = function (argument) {
370
370
  var isCallable$l = isCallable$p;
371
371
  var tryToString$3 = tryToString$4;
372
372
 
373
- var $TypeError$c = TypeError;
373
+ var $TypeError$f = TypeError;
374
374
 
375
375
  // `Assert: IsCallable(argument) is true`
376
- var aCallable$8 = function (argument) {
376
+ var aCallable$9 = function (argument) {
377
377
  if (isCallable$l(argument)) return argument;
378
- throw new $TypeError$c(tryToString$3(argument) + ' is not a function');
378
+ throw new $TypeError$f(tryToString$3(argument) + ' is not a function');
379
379
  };
380
380
 
381
- var aCallable$7 = aCallable$8;
381
+ var aCallable$8 = aCallable$9;
382
382
  var isNullOrUndefined$3 = isNullOrUndefined$5;
383
383
 
384
384
  // `GetMethod` abstract operation
385
385
  // https://tc39.es/ecma262/#sec-getmethod
386
386
  var getMethod$4 = function (V, P) {
387
387
  var func = V[P];
388
- return isNullOrUndefined$3(func) ? undefined : aCallable$7(func);
388
+ return isNullOrUndefined$3(func) ? undefined : aCallable$8(func);
389
389
  };
390
390
 
391
391
  var call$j = functionCall;
392
392
  var isCallable$k = isCallable$p;
393
393
  var isObject$b = isObject$e;
394
394
 
395
- var $TypeError$b = TypeError;
395
+ var $TypeError$e = TypeError;
396
396
 
397
397
  // `OrdinaryToPrimitive` abstract operation
398
398
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
@@ -401,7 +401,7 @@ var ordinaryToPrimitive$1 = function (input, pref) {
401
401
  if (pref === 'string' && isCallable$k(fn = input.toString) && !isObject$b(val = call$j(fn, input))) return val;
402
402
  if (isCallable$k(fn = input.valueOf) && !isObject$b(val = call$j(fn, input))) return val;
403
403
  if (pref !== 'string' && isCallable$k(fn = input.toString) && !isObject$b(val = call$j(fn, input))) return val;
404
- throw new $TypeError$b("Can't convert object to primitive value");
404
+ throw new $TypeError$e("Can't convert object to primitive value");
405
405
  };
406
406
 
407
407
  var call$i = functionCall;
@@ -411,7 +411,7 @@ var getMethod$3 = getMethod$4;
411
411
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
412
412
  var wellKnownSymbol$j = wellKnownSymbol$k;
413
413
 
414
- var $TypeError$a = TypeError;
414
+ var $TypeError$d = TypeError;
415
415
  var TO_PRIMITIVE = wellKnownSymbol$j('toPrimitive');
416
416
 
417
417
  // `ToPrimitive` abstract operation
@@ -424,7 +424,7 @@ var toPrimitive$1 = function (input, pref) {
424
424
  if (pref === undefined) pref = 'default';
425
425
  result = call$i(exoticToPrim, input, pref);
426
426
  if (!isObject$a(result) || isSymbol$2(result)) return result;
427
- throw new $TypeError$a("Can't convert object to primitive value");
427
+ throw new $TypeError$d("Can't convert object to primitive value");
428
428
  }
429
429
  if (pref === undefined) pref = 'number';
430
430
  return ordinaryToPrimitive(input, pref);
@@ -440,13 +440,13 @@ var toPropertyKey$2 = function (argument) {
440
440
  return isSymbol$1(key) ? key : key + '';
441
441
  };
442
442
 
443
- var DESCRIPTORS$g = descriptors;
443
+ var DESCRIPTORS$h = descriptors;
444
444
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
445
445
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
446
446
  var anObject$f = anObject$g;
447
447
  var toPropertyKey$1 = toPropertyKey$2;
448
448
 
449
- var $TypeError$9 = TypeError;
449
+ var $TypeError$c = TypeError;
450
450
  // eslint-disable-next-line es/no-object-defineproperty -- safe
451
451
  var $defineProperty = Object.defineProperty;
452
452
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -457,7 +457,7 @@ var WRITABLE = 'writable';
457
457
 
458
458
  // `Object.defineProperty` method
459
459
  // https://tc39.es/ecma262/#sec-object.defineproperty
460
- objectDefineProperty.f = DESCRIPTORS$g ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
460
+ objectDefineProperty.f = DESCRIPTORS$h ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
461
461
  anObject$f(O);
462
462
  P = toPropertyKey$1(P);
463
463
  anObject$f(Attributes);
@@ -479,7 +479,7 @@ objectDefineProperty.f = DESCRIPTORS$g ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
479
479
  if (IE8_DOM_DEFINE$1) try {
480
480
  return $defineProperty(O, P, Attributes);
481
481
  } catch (error) { /* empty */ }
482
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$9('Accessors not supported');
482
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$c('Accessors not supported');
483
483
  if ('value' in Attributes) O[P] = Attributes.value;
484
484
  return O;
485
485
  };
@@ -533,19 +533,19 @@ var toLength$1 = toLength$2;
533
533
 
534
534
  // `LengthOfArrayLike` abstract operation
535
535
  // https://tc39.es/ecma262/#sec-lengthofarraylike
536
- var lengthOfArrayLike$2 = function (obj) {
536
+ var lengthOfArrayLike$4 = function (obj) {
537
537
  return toLength$1(obj.length);
538
538
  };
539
539
 
540
540
  var toIndexedObject$4 = toIndexedObject$5;
541
541
  var toAbsoluteIndex = toAbsoluteIndex$1;
542
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
542
+ var lengthOfArrayLike$3 = lengthOfArrayLike$4;
543
543
 
544
544
  // `Array.prototype.{ indexOf, includes }` methods implementation
545
- var createMethod$1 = function (IS_INCLUDES) {
545
+ var createMethod$2 = function (IS_INCLUDES) {
546
546
  return function ($this, el, fromIndex) {
547
547
  var O = toIndexedObject$4($this);
548
- var length = lengthOfArrayLike$1(O);
548
+ var length = lengthOfArrayLike$3(O);
549
549
  if (length === 0) return !IS_INCLUDES && -1;
550
550
  var index = toAbsoluteIndex(fromIndex, length);
551
551
  var value;
@@ -565,10 +565,10 @@ var createMethod$1 = function (IS_INCLUDES) {
565
565
  var arrayIncludes = {
566
566
  // `Array.prototype.includes` method
567
567
  // https://tc39.es/ecma262/#sec-array.prototype.includes
568
- includes: createMethod$1(true),
568
+ includes: createMethod$2(true),
569
569
  // `Array.prototype.indexOf` method
570
570
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
571
- indexOf: createMethod$1(false)
571
+ indexOf: createMethod$2(false)
572
572
  };
573
573
 
574
574
  var hiddenKeys$4 = {};
@@ -615,7 +615,7 @@ var objectKeys$2 = Object.keys || function keys(O) {
615
615
  return internalObjectKeys$1(O, enumBugKeys$2);
616
616
  };
617
617
 
618
- var DESCRIPTORS$f = descriptors;
618
+ var DESCRIPTORS$g = descriptors;
619
619
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
620
620
  var definePropertyModule$3 = objectDefineProperty;
621
621
  var anObject$e = anObject$g;
@@ -625,7 +625,7 @@ var objectKeys$1 = objectKeys$2;
625
625
  // `Object.defineProperties` method
626
626
  // https://tc39.es/ecma262/#sec-object.defineproperties
627
627
  // eslint-disable-next-line es/no-object-defineproperties -- safe
628
- objectDefineProperties.f = DESCRIPTORS$f && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
628
+ objectDefineProperties.f = DESCRIPTORS$g && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
629
629
  anObject$e(O);
630
630
  var props = toIndexedObject$2(Properties);
631
631
  var keys = objectKeys$1(Properties);
@@ -772,11 +772,11 @@ var createPropertyDescriptor$7 = function (bitmap, value) {
772
772
  };
773
773
  };
774
774
 
775
- var DESCRIPTORS$e = descriptors;
775
+ var DESCRIPTORS$f = descriptors;
776
776
  var definePropertyModule$2 = objectDefineProperty;
777
777
  var createPropertyDescriptor$6 = createPropertyDescriptor$7;
778
778
 
779
- var createNonEnumerableProperty$8 = DESCRIPTORS$e ? function (object, key, value) {
779
+ var createNonEnumerableProperty$8 = DESCRIPTORS$f ? function (object, key, value) {
780
780
  return definePropertyModule$2.f(object, key, createPropertyDescriptor$6(1, value));
781
781
  } : function (object, key, value) {
782
782
  object[key] = value;
@@ -860,19 +860,19 @@ var objectPropertyIsEnumerable = {};
860
860
 
861
861
  var $propertyIsEnumerable = {}.propertyIsEnumerable;
862
862
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
863
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
863
+ var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
864
864
 
865
865
  // Nashorn ~ JDK8 bug
866
- var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
866
+ var NASHORN_BUG = getOwnPropertyDescriptor$3 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
867
867
 
868
868
  // `Object.prototype.propertyIsEnumerable` method implementation
869
869
  // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
870
870
  objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
871
- var descriptor = getOwnPropertyDescriptor$2(this, V);
871
+ var descriptor = getOwnPropertyDescriptor$3(this, V);
872
872
  return !!descriptor && descriptor.enumerable;
873
873
  } : $propertyIsEnumerable;
874
874
 
875
- var DESCRIPTORS$d = descriptors;
875
+ var DESCRIPTORS$e = descriptors;
876
876
  var call$h = functionCall;
877
877
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
878
878
  var createPropertyDescriptor$5 = createPropertyDescriptor$7;
@@ -886,7 +886,7 @@ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
886
886
 
887
887
  // `Object.getOwnPropertyDescriptor` method
888
888
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
889
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$d ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
889
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$e ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
890
890
  O = toIndexedObject$1(O);
891
891
  P = toPropertyKey(P);
892
892
  if (IE8_DOM_DEFINE) try {
@@ -897,17 +897,17 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$d ? $getOwnPropertyDescriptor : f
897
897
 
898
898
  var makeBuiltIn$3 = {exports: {}};
899
899
 
900
- var DESCRIPTORS$c = descriptors;
900
+ var DESCRIPTORS$d = descriptors;
901
901
  var hasOwn$a = hasOwnProperty_1;
902
902
 
903
903
  var FunctionPrototype$1 = Function.prototype;
904
904
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
905
- var getDescriptor = DESCRIPTORS$c && Object.getOwnPropertyDescriptor;
905
+ var getDescriptor = DESCRIPTORS$d && Object.getOwnPropertyDescriptor;
906
906
 
907
907
  var EXISTS = hasOwn$a(FunctionPrototype$1, 'name');
908
908
  // additional protection from minified / mangled / dropped function names
909
909
  var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
910
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$c || (DESCRIPTORS$c && getDescriptor(FunctionPrototype$1, 'name').configurable));
910
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$d || (DESCRIPTORS$d && getDescriptor(FunctionPrototype$1, 'name').configurable));
911
911
 
912
912
  var functionName = {
913
913
  EXISTS: EXISTS,
@@ -931,10 +931,10 @@ if (!isCallable$i(store.inspectSource)) {
931
931
  var inspectSource$3 = store.inspectSource;
932
932
 
933
933
  var uncurryThis$k = functionUncurryThis;
934
- var fails$j = fails$q;
934
+ var fails$l = fails$s;
935
935
  var isCallable$h = isCallable$p;
936
936
  var hasOwn$9 = hasOwnProperty_1;
937
- var DESCRIPTORS$b = descriptors;
937
+ var DESCRIPTORS$c = descriptors;
938
938
  var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
939
939
  var inspectSource$2 = inspectSource$3;
940
940
  var InternalStateModule$4 = internalState;
@@ -948,7 +948,7 @@ var stringSlice$5 = uncurryThis$k(''.slice);
948
948
  var replace$6 = uncurryThis$k(''.replace);
949
949
  var join$1 = uncurryThis$k([].join);
950
950
 
951
- var CONFIGURABLE_LENGTH = DESCRIPTORS$b && !fails$j(function () {
951
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$c && !fails$l(function () {
952
952
  return defineProperty$7(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
953
953
  });
954
954
 
@@ -961,7 +961,7 @@ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
961
961
  if (options && options.getter) name = 'get ' + name;
962
962
  if (options && options.setter) name = 'set ' + name;
963
963
  if (!hasOwn$9(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
964
- if (DESCRIPTORS$b) defineProperty$7(value, 'name', { value: name, configurable: true });
964
+ if (DESCRIPTORS$c) defineProperty$7(value, 'name', { value: name, configurable: true });
965
965
  else value.name = name;
966
966
  }
967
967
  if (CONFIGURABLE_LENGTH && options && hasOwn$9(options, 'arity') && value.length !== options.arity) {
@@ -969,7 +969,7 @@ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
969
969
  }
970
970
  try {
971
971
  if (options && hasOwn$9(options, 'constructor') && options.constructor) {
972
- if (DESCRIPTORS$b) defineProperty$7(value, 'prototype', { writable: false });
972
+ if (DESCRIPTORS$c) defineProperty$7(value, 'prototype', { writable: false });
973
973
  // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
974
974
  } else if (value.prototype) value.prototype = undefined;
975
975
  } catch (error) { /* empty */ }
@@ -1064,7 +1064,7 @@ var copyConstructorProperties$2 = function (target, source, exceptions) {
1064
1064
  }
1065
1065
  };
1066
1066
 
1067
- var fails$i = fails$q;
1067
+ var fails$k = fails$s;
1068
1068
  var isCallable$f = isCallable$p;
1069
1069
 
1070
1070
  var replacement = /#|\.prototype\./;
@@ -1073,7 +1073,7 @@ var isForced$2 = function (feature, detection) {
1073
1073
  var value = data[normalize(feature)];
1074
1074
  return value === POLYFILL ? true
1075
1075
  : value === NATIVE ? false
1076
- : isCallable$f(detection) ? fails$i(detection)
1076
+ : isCallable$f(detection) ? fails$k(detection)
1077
1077
  : !!detection;
1078
1078
  };
1079
1079
 
@@ -1088,7 +1088,7 @@ var POLYFILL = isForced$2.POLYFILL = 'P';
1088
1088
  var isForced_1 = isForced$2;
1089
1089
 
1090
1090
  var global$g = global$p;
1091
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
1091
+ var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
1092
1092
  var createNonEnumerableProperty$6 = createNonEnumerableProperty$8;
1093
1093
  var defineBuiltIn$b = defineBuiltIn$c;
1094
1094
  var defineGlobalProperty = defineGlobalProperty$3;
@@ -1125,7 +1125,7 @@ var _export = function (options, source) {
1125
1125
  if (target) for (key in source) {
1126
1126
  sourceProperty = source[key];
1127
1127
  if (options.dontCallGetSet) {
1128
- descriptor = getOwnPropertyDescriptor$1(target, key);
1128
+ descriptor = getOwnPropertyDescriptor$2(target, key);
1129
1129
  targetProperty = descriptor && descriptor.value;
1130
1130
  } else targetProperty = target[key];
1131
1131
  FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
@@ -1142,9 +1142,9 @@ var _export = function (options, source) {
1142
1142
  }
1143
1143
  };
1144
1144
 
1145
- var fails$h = fails$q;
1145
+ var fails$j = fails$s;
1146
1146
 
1147
- var correctPrototypeGetter = !fails$h(function () {
1147
+ var correctPrototypeGetter = !fails$j(function () {
1148
1148
  function F() { /* empty */ }
1149
1149
  F.prototype.constructor = null;
1150
1150
  // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
@@ -1153,7 +1153,7 @@ var correctPrototypeGetter = !fails$h(function () {
1153
1153
 
1154
1154
  var hasOwn$7 = hasOwnProperty_1;
1155
1155
  var isCallable$e = isCallable$p;
1156
- var toObject$2 = toObject$4;
1156
+ var toObject$4 = toObject$6;
1157
1157
  var sharedKey = sharedKey$3;
1158
1158
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1159
1159
 
@@ -1165,7 +1165,7 @@ var ObjectPrototype = $Object$1.prototype;
1165
1165
  // https://tc39.es/ecma262/#sec-object.getprototypeof
1166
1166
  // eslint-disable-next-line es/no-object-getprototypeof -- safe
1167
1167
  var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1168
- var object = toObject$2(O);
1168
+ var object = toObject$4(O);
1169
1169
  if (hasOwn$7(object, IE_PROTO)) return object[IE_PROTO];
1170
1170
  var constructor = object.constructor;
1171
1171
  if (isCallable$e(constructor) && object instanceof constructor) {
@@ -1173,7 +1173,7 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
1173
1173
  } return object instanceof $Object$1 ? ObjectPrototype : null;
1174
1174
  };
1175
1175
 
1176
- var fails$g = fails$q;
1176
+ var fails$i = fails$s;
1177
1177
  var isCallable$d = isCallable$p;
1178
1178
  var isObject$8 = isObject$e;
1179
1179
  var getPrototypeOf$1 = objectGetPrototypeOf;
@@ -1198,7 +1198,7 @@ if ([].keys) {
1198
1198
  }
1199
1199
  }
1200
1200
 
1201
- var NEW_ITERATOR_PROTOTYPE = !isObject$8(IteratorPrototype$2) || fails$g(function () {
1201
+ var NEW_ITERATOR_PROTOTYPE = !isObject$8(IteratorPrototype$2) || fails$i(function () {
1202
1202
  var test = {};
1203
1203
  // FF44- legacy iterators case
1204
1204
  return IteratorPrototype$2[ITERATOR$7].call(test) !== test;
@@ -1249,12 +1249,12 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
1249
1249
  };
1250
1250
 
1251
1251
  var uncurryThis$i = functionUncurryThis;
1252
- var aCallable$6 = aCallable$8;
1252
+ var aCallable$7 = aCallable$9;
1253
1253
 
1254
1254
  var functionUncurryThisAccessor = function (object, key, method) {
1255
1255
  try {
1256
1256
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1257
- return uncurryThis$i(aCallable$6(Object.getOwnPropertyDescriptor(object, key)[method]));
1257
+ return uncurryThis$i(aCallable$7(Object.getOwnPropertyDescriptor(object, key)[method]));
1258
1258
  } catch (error) { /* empty */ }
1259
1259
  };
1260
1260
 
@@ -1267,11 +1267,11 @@ var isPossiblePrototype$1 = function (argument) {
1267
1267
  var isPossiblePrototype = isPossiblePrototype$1;
1268
1268
 
1269
1269
  var $String$2 = String;
1270
- var $TypeError$8 = TypeError;
1270
+ var $TypeError$b = TypeError;
1271
1271
 
1272
1272
  var aPossiblePrototype$1 = function (argument) {
1273
1273
  if (isPossiblePrototype(argument)) return argument;
1274
- throw new $TypeError$8("Can't set " + $String$2(argument) + ' as a prototype');
1274
+ throw new $TypeError$b("Can't set " + $String$2(argument) + ' as a prototype');
1275
1275
  };
1276
1276
 
1277
1277
  /* eslint-disable no-proto -- safe */
@@ -1303,7 +1303,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1303
1303
  };
1304
1304
  }() : undefined);
1305
1305
 
1306
- var $$g = _export;
1306
+ var $$i = _export;
1307
1307
  var call$g = functionCall;
1308
1308
  var FunctionName = functionName;
1309
1309
  var isCallable$c = isCallable$p;
@@ -1391,7 +1391,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1391
1391
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1392
1392
  defineBuiltIn$9(IterablePrototype, KEY, methods[KEY]);
1393
1393
  }
1394
- } else $$g({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1394
+ } else $$i({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1395
1395
  }
1396
1396
 
1397
1397
  // define iterator
@@ -1416,7 +1416,7 @@ var InternalStateModule$3 = internalState;
1416
1416
  var defineProperty$5 = objectDefineProperty.f;
1417
1417
  var defineIterator = iteratorDefine;
1418
1418
  var createIterResultObject$1 = createIterResultObject$2;
1419
- var DESCRIPTORS$a = descriptors;
1419
+ var DESCRIPTORS$b = descriptors;
1420
1420
 
1421
1421
  var ARRAY_ITERATOR = 'Array Iterator';
1422
1422
  var setInternalState$3 = InternalStateModule$3.set;
@@ -1466,7 +1466,7 @@ addToUnscopables$1('values');
1466
1466
  addToUnscopables$1('entries');
1467
1467
 
1468
1468
  // V8 ~ Chrome 45- bug
1469
- if (DESCRIPTORS$a && values.name !== 'values') try {
1469
+ if (DESCRIPTORS$b && values.name !== 'values') try {
1470
1470
  defineProperty$5(values, 'name', { value: 'values' });
1471
1471
  } catch (error) { /* empty */ }
1472
1472
 
@@ -1490,7 +1490,7 @@ var classof$9 = classofRaw$2;
1490
1490
  // `IsArray` abstract operation
1491
1491
  // https://tc39.es/ecma262/#sec-isarray
1492
1492
  // eslint-disable-next-line es/no-array-isarray -- safe
1493
- var isArray$1 = Array.isArray || function isArray(argument) {
1493
+ var isArray$2 = Array.isArray || function isArray(argument) {
1494
1494
  return classof$9(argument) === 'Array';
1495
1495
  };
1496
1496
 
@@ -1543,7 +1543,7 @@ var toString$9 = function (argument) {
1543
1543
  };
1544
1544
 
1545
1545
  var uncurryThis$g = functionUncurryThis;
1546
- var isArray = isArray$1;
1546
+ var isArray$1 = isArray$2;
1547
1547
  var isCallable$a = isCallable$p;
1548
1548
  var classof$6 = classofRaw$2;
1549
1549
  var toString$8 = toString$9;
@@ -1552,7 +1552,7 @@ var push$3 = uncurryThis$g([].push);
1552
1552
 
1553
1553
  var getJsonReplacerFunction = function (replacer) {
1554
1554
  if (isCallable$a(replacer)) return replacer;
1555
- if (!isArray(replacer)) return;
1555
+ if (!isArray$1(replacer)) return;
1556
1556
  var rawLength = replacer.length;
1557
1557
  var keys = [];
1558
1558
  for (var i = 0; i < rawLength; i++) {
@@ -1567,17 +1567,17 @@ var getJsonReplacerFunction = function (replacer) {
1567
1567
  root = false;
1568
1568
  return value;
1569
1569
  }
1570
- if (isArray(this)) return value;
1570
+ if (isArray$1(this)) return value;
1571
1571
  for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
1572
1572
  };
1573
1573
  };
1574
1574
 
1575
- var $$f = _export;
1575
+ var $$h = _export;
1576
1576
  var getBuiltIn$9 = getBuiltIn$d;
1577
1577
  var apply$3 = functionApply;
1578
1578
  var call$e = functionCall;
1579
1579
  var uncurryThis$f = functionUncurryThis;
1580
- var fails$f = fails$q;
1580
+ var fails$h = fails$s;
1581
1581
  var isCallable$9 = isCallable$p;
1582
1582
  var isSymbol = isSymbol$3;
1583
1583
  var arraySlice$2 = arraySlice$3;
@@ -1596,7 +1596,7 @@ var tester = /[\uD800-\uDFFF]/g;
1596
1596
  var low = /^[\uD800-\uDBFF]$/;
1597
1597
  var hi = /^[\uDC00-\uDFFF]$/;
1598
1598
 
1599
- var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$f(function () {
1599
+ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$h(function () {
1600
1600
  var symbol = getBuiltIn$9('Symbol')('stringify detection');
1601
1601
  // MS Edge converts symbol values to JSON as {}
1602
1602
  return $stringify([symbol]) !== '[null]'
@@ -1607,7 +1607,7 @@ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$f(function () {
1607
1607
  });
1608
1608
 
1609
1609
  // https://github.com/tc39/proposal-well-formed-stringify
1610
- var ILL_FORMED_UNICODE = fails$f(function () {
1610
+ var ILL_FORMED_UNICODE = fails$h(function () {
1611
1611
  return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
1612
1612
  || $stringify('\uDEAD') !== '"\\udead"';
1613
1613
  });
@@ -1635,7 +1635,7 @@ var fixIllFormed = function (match, offset, string) {
1635
1635
  if ($stringify) {
1636
1636
  // `JSON.stringify` method
1637
1637
  // https://tc39.es/ecma262/#sec-json.stringify
1638
- $$f({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
1638
+ $$h({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
1639
1639
  // eslint-disable-next-line no-unused-vars -- required for `.length`
1640
1640
  stringify: function stringify(it, replacer, space) {
1641
1641
  var args = arraySlice$2(arguments);
@@ -1680,14 +1680,14 @@ var PROPER_FUNCTION_NAME = functionName.PROPER;
1680
1680
  var defineBuiltIn$8 = defineBuiltIn$c;
1681
1681
  var anObject$a = anObject$g;
1682
1682
  var $toString$1 = toString$9;
1683
- var fails$e = fails$q;
1683
+ var fails$g = fails$s;
1684
1684
  var getRegExpFlags = regexpGetFlags;
1685
1685
 
1686
1686
  var TO_STRING = 'toString';
1687
1687
  var RegExpPrototype$1 = RegExp.prototype;
1688
1688
  var nativeToString = RegExpPrototype$1[TO_STRING];
1689
1689
 
1690
- var NOT_GENERIC = fails$e(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
1690
+ var NOT_GENERIC = fails$g(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
1691
1691
  // FF44- RegExp#toString has a wrong name
1692
1692
  var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
1693
1693
 
@@ -1985,10 +1985,10 @@ var errorStackClear = function (stack, dropEntries) {
1985
1985
  } return stack;
1986
1986
  };
1987
1987
 
1988
- var fails$d = fails$q;
1988
+ var fails$f = fails$s;
1989
1989
  var createPropertyDescriptor$3 = createPropertyDescriptor$7;
1990
1990
 
1991
- var errorStackInstallable = !fails$d(function () {
1991
+ var errorStackInstallable = !fails$f(function () {
1992
1992
  var error = new Error('a');
1993
1993
  if (!('stack' in error)) return true;
1994
1994
  // eslint-disable-next-line es/no-object-defineproperty -- safe
@@ -2021,7 +2021,7 @@ var inheritIfRequired$1 = inheritIfRequired$2;
2021
2021
  var normalizeStringArgument$3 = normalizeStringArgument$4;
2022
2022
  var installErrorCause = installErrorCause$1;
2023
2023
  var installErrorStack = errorStackInstall;
2024
- var DESCRIPTORS$9 = descriptors;
2024
+ var DESCRIPTORS$a = descriptors;
2025
2025
 
2026
2026
  var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
2027
2027
  var STACK_TRACE_LIMIT = 'stackTraceLimit';
@@ -2056,7 +2056,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
2056
2056
  if (ERROR_NAME !== 'Error') {
2057
2057
  if (setPrototypeOf$1) setPrototypeOf$1(WrappedError, BaseError);
2058
2058
  else copyConstructorProperties(WrappedError, BaseError, { name: true });
2059
- } else if (DESCRIPTORS$9 && STACK_TRACE_LIMIT in OriginalError) {
2059
+ } else if (DESCRIPTORS$a && STACK_TRACE_LIMIT in OriginalError) {
2060
2060
  proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
2061
2061
  proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
2062
2062
  }
@@ -2075,7 +2075,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
2075
2075
  };
2076
2076
 
2077
2077
  /* eslint-disable no-unused-vars -- required for functions `.length` */
2078
- var $$e = _export;
2078
+ var $$g = _export;
2079
2079
  var global$e = global$p;
2080
2080
  var apply$2 = functionApply;
2081
2081
  var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
@@ -2084,19 +2084,19 @@ var WEB_ASSEMBLY = 'WebAssembly';
2084
2084
  var WebAssembly = global$e[WEB_ASSEMBLY];
2085
2085
 
2086
2086
  // eslint-disable-next-line es/no-error-cause -- feature detection
2087
- var FORCED$1 = new Error('e', { cause: 7 }).cause !== 7;
2087
+ var FORCED$3 = new Error('e', { cause: 7 }).cause !== 7;
2088
2088
 
2089
2089
  var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
2090
2090
  var O = {};
2091
- O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$1);
2092
- $$e({ global: true, constructor: true, arity: 1, forced: FORCED$1 }, O);
2091
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$3);
2092
+ $$g({ global: true, constructor: true, arity: 1, forced: FORCED$3 }, O);
2093
2093
  };
2094
2094
 
2095
2095
  var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
2096
2096
  if (WebAssembly && WebAssembly[ERROR_NAME]) {
2097
2097
  var O = {};
2098
- O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$1);
2099
- $$e({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$1 }, O);
2098
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$3);
2099
+ $$g({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$3 }, O);
2100
2100
  }
2101
2101
  };
2102
2102
 
@@ -2132,20 +2132,20 @@ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
2132
2132
  return function RuntimeError(message) { return apply$2(init, this, arguments); };
2133
2133
  });
2134
2134
 
2135
- var $$d = _export;
2135
+ var $$f = _export;
2136
2136
  var $includes = arrayIncludes.includes;
2137
- var fails$c = fails$q;
2137
+ var fails$e = fails$s;
2138
2138
  var addToUnscopables = addToUnscopables$2;
2139
2139
 
2140
2140
  // FF99+ bug
2141
- var BROKEN_ON_SPARSE = fails$c(function () {
2141
+ var BROKEN_ON_SPARSE = fails$e(function () {
2142
2142
  // eslint-disable-next-line es/no-array-prototype-includes -- detection
2143
2143
  return !Array(1).includes();
2144
2144
  });
2145
2145
 
2146
2146
  // `Array.prototype.includes` method
2147
2147
  // https://tc39.es/ecma262/#sec-array.prototype.includes
2148
- $$d({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2148
+ $$f({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2149
2149
  includes: function includes(el /* , fromIndex = 0 */) {
2150
2150
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2151
2151
  }
@@ -2154,14 +2154,172 @@ $$d({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2154
2154
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2155
2155
  addToUnscopables('includes');
2156
2156
 
2157
+ var DESCRIPTORS$9 = descriptors;
2158
+ var isArray = isArray$2;
2159
+
2160
+ var $TypeError$a = TypeError;
2161
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2162
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
2163
+
2164
+ // Safari < 13 does not throw an error in this case
2165
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$9 && !function () {
2166
+ // makes no sense without proper strict mode support
2167
+ if (this !== undefined) return true;
2168
+ try {
2169
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
2170
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
2171
+ } catch (error) {
2172
+ return error instanceof TypeError;
2173
+ }
2174
+ }();
2175
+
2176
+ var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
2177
+ if (isArray(O) && !getOwnPropertyDescriptor$1(O, 'length').writable) {
2178
+ throw new $TypeError$a('Cannot set read only .length');
2179
+ } return O.length = length;
2180
+ } : function (O, length) {
2181
+ return O.length = length;
2182
+ };
2183
+
2184
+ var $TypeError$9 = TypeError;
2185
+ var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
2186
+
2187
+ var doesNotExceedSafeInteger$1 = function (it) {
2188
+ if (it > MAX_SAFE_INTEGER) throw $TypeError$9('Maximum allowed index exceeded');
2189
+ return it;
2190
+ };
2191
+
2192
+ var $$e = _export;
2193
+ var toObject$3 = toObject$6;
2194
+ var lengthOfArrayLike$2 = lengthOfArrayLike$4;
2195
+ var setArrayLength = arraySetLength;
2196
+ var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
2197
+ var fails$d = fails$s;
2198
+
2199
+ var INCORRECT_TO_LENGTH = fails$d(function () {
2200
+ return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
2201
+ });
2202
+
2203
+ // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
2204
+ // https://bugs.chromium.org/p/v8/issues/detail?id=12681
2205
+ var properErrorOnNonWritableLength = function () {
2206
+ try {
2207
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
2208
+ Object.defineProperty([], 'length', { writable: false }).push();
2209
+ } catch (error) {
2210
+ return error instanceof TypeError;
2211
+ }
2212
+ };
2213
+
2214
+ var FORCED$2 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
2215
+
2216
+ // `Array.prototype.push` method
2217
+ // https://tc39.es/ecma262/#sec-array.prototype.push
2218
+ $$e({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
2219
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
2220
+ push: function push(item) {
2221
+ var O = toObject$3(this);
2222
+ var len = lengthOfArrayLike$2(O);
2223
+ var argCount = arguments.length;
2224
+ doesNotExceedSafeInteger(len + argCount);
2225
+ for (var i = 0; i < argCount; i++) {
2226
+ O[len] = arguments[i];
2227
+ len++;
2228
+ }
2229
+ setArrayLength(O, len);
2230
+ return len;
2231
+ }
2232
+ });
2233
+
2234
+ var aCallable$6 = aCallable$9;
2235
+ var toObject$2 = toObject$6;
2236
+ var IndexedObject$1 = indexedObject;
2237
+ var lengthOfArrayLike$1 = lengthOfArrayLike$4;
2238
+
2239
+ var $TypeError$8 = TypeError;
2240
+
2241
+ var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
2242
+
2243
+ // `Array.prototype.{ reduce, reduceRight }` methods implementation
2244
+ var createMethod$1 = function (IS_RIGHT) {
2245
+ return function (that, callbackfn, argumentsLength, memo) {
2246
+ var O = toObject$2(that);
2247
+ var self = IndexedObject$1(O);
2248
+ var length = lengthOfArrayLike$1(O);
2249
+ aCallable$6(callbackfn);
2250
+ if (length === 0 && argumentsLength < 2) throw new $TypeError$8(REDUCE_EMPTY);
2251
+ var index = IS_RIGHT ? length - 1 : 0;
2252
+ var i = IS_RIGHT ? -1 : 1;
2253
+ if (argumentsLength < 2) while (true) {
2254
+ if (index in self) {
2255
+ memo = self[index];
2256
+ index += i;
2257
+ break;
2258
+ }
2259
+ index += i;
2260
+ if (IS_RIGHT ? index < 0 : length <= index) {
2261
+ throw new $TypeError$8(REDUCE_EMPTY);
2262
+ }
2263
+ }
2264
+ for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
2265
+ memo = callbackfn(memo, self[index], index, O);
2266
+ }
2267
+ return memo;
2268
+ };
2269
+ };
2270
+
2271
+ var arrayReduce = {
2272
+ // `Array.prototype.reduce` method
2273
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
2274
+ left: createMethod$1(false),
2275
+ // `Array.prototype.reduceRight` method
2276
+ // https://tc39.es/ecma262/#sec-array.prototype.reduceright
2277
+ right: createMethod$1(true)
2278
+ };
2279
+
2280
+ var fails$c = fails$s;
2281
+
2282
+ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
2283
+ var method = [][METHOD_NAME];
2284
+ return !!method && fails$c(function () {
2285
+ // eslint-disable-next-line no-useless-call -- required for testing
2286
+ method.call(null, argument || function () { return 1; }, 1);
2287
+ });
2288
+ };
2289
+
2290
+ var global$d = global$p;
2291
+ var classof$5 = classofRaw$2;
2292
+
2293
+ var engineIsNode = classof$5(global$d.process) === 'process';
2294
+
2295
+ var $$d = _export;
2296
+ var $reduce = arrayReduce.left;
2297
+ var arrayMethodIsStrict = arrayMethodIsStrict$1;
2298
+ var CHROME_VERSION = engineV8Version;
2299
+ var IS_NODE$5 = engineIsNode;
2300
+
2301
+ // Chrome 80-82 has a critical bug
2302
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
2303
+ var CHROME_BUG = !IS_NODE$5 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
2304
+ var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict('reduce');
2305
+
2306
+ // `Array.prototype.reduce` method
2307
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
2308
+ $$d({ target: 'Array', proto: true, forced: FORCED$1 }, {
2309
+ reduce: function reduce(callbackfn /* , initialValue */) {
2310
+ var length = arguments.length;
2311
+ return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
2312
+ }
2313
+ });
2314
+
2157
2315
  var DESCRIPTORS$8 = descriptors;
2158
2316
  var uncurryThis$d = functionUncurryThis;
2159
2317
  var call$c = functionCall;
2160
- var fails$b = fails$q;
2318
+ var fails$b = fails$s;
2161
2319
  var objectKeys = objectKeys$2;
2162
2320
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2163
2321
  var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2164
- var toObject$1 = toObject$4;
2322
+ var toObject$1 = toObject$6;
2165
2323
  var IndexedObject = indexedObject;
2166
2324
 
2167
2325
  // eslint-disable-next-line es/no-object-assign -- safe
@@ -2221,11 +2379,6 @@ $$c({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }
2221
2379
  assign: assign
2222
2380
  });
2223
2381
 
2224
- var global$d = global$p;
2225
- var classof$5 = classofRaw$2;
2226
-
2227
- var engineIsNode = classof$5(global$d.process) === 'process';
2228
-
2229
2382
  var makeBuiltIn = makeBuiltIn$3.exports;
2230
2383
  var defineProperty$2 = objectDefineProperty;
2231
2384
 
@@ -2263,7 +2416,7 @@ var anInstance$4 = function (it, Prototype) {
2263
2416
  };
2264
2417
 
2265
2418
  var uncurryThis$c = functionUncurryThis;
2266
- var fails$a = fails$q;
2419
+ var fails$a = fails$s;
2267
2420
  var isCallable$7 = isCallable$p;
2268
2421
  var classof$4 = classof$8;
2269
2422
  var getBuiltIn$6 = getBuiltIn$d;
@@ -2351,7 +2504,7 @@ var functionUncurryThisClause = function (fn) {
2351
2504
  };
2352
2505
 
2353
2506
  var uncurryThis$a = functionUncurryThisClause;
2354
- var aCallable$5 = aCallable$8;
2507
+ var aCallable$5 = aCallable$9;
2355
2508
  var NATIVE_BIND = functionBindNative;
2356
2509
 
2357
2510
  var bind$5 = uncurryThis$a(uncurryThis$a.bind);
@@ -2381,7 +2534,7 @@ var apply$1 = functionApply;
2381
2534
  var bind$4 = functionBindContext;
2382
2535
  var isCallable$6 = isCallable$p;
2383
2536
  var hasOwn$3 = hasOwnProperty_1;
2384
- var fails$9 = fails$q;
2537
+ var fails$9 = fails$s;
2385
2538
  var html = html$2;
2386
2539
  var arraySlice$1 = arraySlice$3;
2387
2540
  var createElement = documentCreateElement$2;
@@ -2694,7 +2847,7 @@ var promiseConstructorDetection = {
2694
2847
 
2695
2848
  var newPromiseCapability$2 = {};
2696
2849
 
2697
- var aCallable$4 = aCallable$8;
2850
+ var aCallable$4 = aCallable$9;
2698
2851
 
2699
2852
  var $TypeError$4 = TypeError;
2700
2853
 
@@ -2723,7 +2876,7 @@ var defineBuiltIn$7 = defineBuiltIn$c;
2723
2876
  var setPrototypeOf = objectSetPrototypeOf;
2724
2877
  var setToStringTag$2 = setToStringTag$6;
2725
2878
  var setSpecies = setSpecies$1;
2726
- var aCallable$3 = aCallable$8;
2879
+ var aCallable$3 = aCallable$9;
2727
2880
  var isCallable$4 = isCallable$p;
2728
2881
  var isObject$3 = isObject$e;
2729
2882
  var anInstance$3 = anInstance$4;
@@ -3028,7 +3181,7 @@ var getIteratorMethod$3 = function (it) {
3028
3181
  };
3029
3182
 
3030
3183
  var call$a = functionCall;
3031
- var aCallable$2 = aCallable$8;
3184
+ var aCallable$2 = aCallable$9;
3032
3185
  var anObject$8 = anObject$g;
3033
3186
  var tryToString$1 = tryToString$4;
3034
3187
  var getIteratorMethod$2 = getIteratorMethod$3;
@@ -3070,7 +3223,7 @@ var call$8 = functionCall;
3070
3223
  var anObject$6 = anObject$g;
3071
3224
  var tryToString = tryToString$4;
3072
3225
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
3073
- var lengthOfArrayLike = lengthOfArrayLike$2;
3226
+ var lengthOfArrayLike = lengthOfArrayLike$4;
3074
3227
  var isPrototypeOf = objectIsPrototypeOf;
3075
3228
  var getIterator$1 = getIterator$2;
3076
3229
  var getIteratorMethod$1 = getIteratorMethod$3;
@@ -3185,7 +3338,7 @@ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCor
3185
3338
 
3186
3339
  var $$a = _export;
3187
3340
  var call$7 = functionCall;
3188
- var aCallable$1 = aCallable$8;
3341
+ var aCallable$1 = aCallable$9;
3189
3342
  var newPromiseCapabilityModule$2 = newPromiseCapability$2;
3190
3343
  var perform$1 = perform$3;
3191
3344
  var iterate$1 = iterate$2;
@@ -3249,7 +3402,7 @@ if (isCallable$3(NativePromiseConstructor)) {
3249
3402
 
3250
3403
  var $$8 = _export;
3251
3404
  var call$6 = functionCall;
3252
- var aCallable = aCallable$8;
3405
+ var aCallable = aCallable$9;
3253
3406
  var newPromiseCapabilityModule$1 = newPromiseCapability$2;
3254
3407
  var perform = perform$3;
3255
3408
  var iterate = iterate$2;
@@ -3316,7 +3469,7 @@ $$6({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
3316
3469
  }
3317
3470
  });
3318
3471
 
3319
- var fails$8 = fails$q;
3472
+ var fails$8 = fails$s;
3320
3473
  var global$6 = global$p;
3321
3474
 
3322
3475
  // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
@@ -3347,7 +3500,7 @@ var regexpStickyHelpers = {
3347
3500
  UNSUPPORTED_Y: UNSUPPORTED_Y$1
3348
3501
  };
3349
3502
 
3350
- var fails$7 = fails$q;
3503
+ var fails$7 = fails$s;
3351
3504
  var global$5 = global$p;
3352
3505
 
3353
3506
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
@@ -3358,7 +3511,7 @@ var regexpUnsupportedDotAll = fails$7(function () {
3358
3511
  return !(re.dotAll && re.test('\n') && re.flags === 's');
3359
3512
  });
3360
3513
 
3361
- var fails$6 = fails$q;
3514
+ var fails$6 = fails$s;
3362
3515
  var global$4 = global$p;
3363
3516
 
3364
3517
  // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
@@ -3561,7 +3714,7 @@ $$4({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
3561
3714
  var call$4 = functionCall;
3562
3715
  var defineBuiltIn$5 = defineBuiltIn$c;
3563
3716
  var regexpExec$1 = regexpExec$2;
3564
- var fails$5 = fails$q;
3717
+ var fails$5 = fails$s;
3565
3718
  var wellKnownSymbol$3 = wellKnownSymbol$k;
3566
3719
  var createNonEnumerableProperty = createNonEnumerableProperty$8;
3567
3720
 
@@ -3678,7 +3831,7 @@ var advanceStringIndex$1 = function (S, index, unicode) {
3678
3831
  };
3679
3832
 
3680
3833
  var uncurryThis$6 = functionUncurryThis;
3681
- var toObject = toObject$4;
3834
+ var toObject = toObject$6;
3682
3835
 
3683
3836
  var floor$1 = Math.floor;
3684
3837
  var charAt$2 = uncurryThis$6(''.charAt);
@@ -3748,7 +3901,7 @@ var apply = functionApply;
3748
3901
  var call$2 = functionCall;
3749
3902
  var uncurryThis$5 = functionUncurryThis;
3750
3903
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
3751
- var fails$4 = fails$q;
3904
+ var fails$4 = fails$s;
3752
3905
  var anObject$3 = anObject$g;
3753
3906
  var isCallable$1 = isCallable$p;
3754
3907
  var isNullOrUndefined = isNullOrUndefined$5;
@@ -3910,7 +4063,7 @@ var global$3 = global$p;
3910
4063
  var getBuiltIn$3 = getBuiltIn$d;
3911
4064
  var uncurryThis$4 = functionUncurryThis;
3912
4065
  var call$1 = functionCall;
3913
- var fails$3 = fails$q;
4066
+ var fails$3 = fails$s;
3914
4067
  var toString$2 = toString$9;
3915
4068
  var validateArgumentsLength$3 = validateArgumentsLength$5;
3916
4069
  var c2i = base64Map.c2i;
@@ -3982,7 +4135,7 @@ var tryNodeRequire$1 = function (name) {
3982
4135
  };
3983
4136
 
3984
4137
  var DESCRIPTORS$5 = descriptors;
3985
- var fails$2 = fails$q;
4138
+ var fails$2 = fails$s;
3986
4139
  var anObject$2 = anObject$g;
3987
4140
  var normalizeStringArgument$2 = normalizeStringArgument$4;
3988
4141
 
@@ -4041,7 +4194,7 @@ var domExceptionConstants = {
4041
4194
  var $$2 = _export;
4042
4195
  var tryNodeRequire = tryNodeRequire$1;
4043
4196
  var getBuiltIn$2 = getBuiltIn$d;
4044
- var fails$1 = fails$q;
4197
+ var fails$1 = fails$s;
4045
4198
  var create$1 = objectCreate;
4046
4199
  var createPropertyDescriptor$2 = createPropertyDescriptor$7;
4047
4200
  var defineProperty$1 = objectDefineProperty.f;
@@ -4257,7 +4410,7 @@ var DOM_EXCEPTION = 'DOMException';
4257
4410
  // `DOMException.prototype[@@toStringTag]` property
4258
4411
  setToStringTag$1(getBuiltIn(DOM_EXCEPTION), DOM_EXCEPTION);
4259
4412
 
4260
- var fails = fails$q;
4413
+ var fails = fails$s;
4261
4414
  var wellKnownSymbol$1 = wellKnownSymbol$k;
4262
4415
  var DESCRIPTORS$2 = descriptors;
4263
4416
  var IS_PURE = isPure;
@@ -4863,6 +5016,14 @@ const KEEP_ALIVE_POLLER_IN_SECONDS = 10; // Number of milliseconds to check if c
4863
5016
  const REFRESH_TOKEN_WHEN_PCT_EXPIRED = 75; // Refresh token when 75% expired. Set to (10 / 3600) * 100 = 0.2777778% to test with 10 second interval.
4864
5017
  const DEFAULT_TOKEN_EXPIRES_IN = 3600; // Number of seconds a token expires by default
4865
5018
  const MILLISECOND_TO_SECOND = 1 / 1000;
5019
+ const GEOWEB_ROLE_PRESETS_ADMIN = {
5020
+ name: 'ROLE_PRESET_ADMIN',
5021
+ title: 'Preset-admin'
5022
+ };
5023
+ const GEOWEB_ROLE_USER = {
5024
+ name: 'ROLE_USER',
5025
+ title: 'User'
5026
+ };
4866
5027
  /**
4867
5028
  * Creates a Credentials object based on the axios response from the token service.
4868
5029
  *
@@ -4871,7 +5032,7 @@ const MILLISECOND_TO_SECOND = 1 / 1000;
4871
5032
  * @param tokenResponse Response of the tokenservice as axios response object.
4872
5033
  * @returns Credentials object.
4873
5034
  */
4874
- const makeCredentialsFromTokenResponse = tokenResponse => {
5035
+ const makeCredentialsFromTokenResponse = (tokenResponse, authConfig) => {
4875
5036
  const token = tokenResponse.data.body || tokenResponse.data;
4876
5037
  // eslint-disable-next-line @typescript-eslint/naming-convention
4877
5038
  const {
@@ -4891,8 +5052,11 @@ const makeCredentialsFromTokenResponse = tokenResponse => {
4891
5052
  const pctTokenExpirationInSeconds = tokenExpirationInSeconds * (REFRESH_TOKEN_WHEN_PCT_EXPIRED / 100);
4892
5053
  const epochTimeTokenExpirationInSeconds = pctTokenExpirationInSeconds + getCurrentTimeInSeconds();
4893
5054
  const isAuthCognito = userInfo.iss.includes('cognito');
5055
+ const roleClaimName = authConfig === null || authConfig === void 0 ? void 0 : authConfig.GW_AUTH_ROLE_CLAIM_NAME;
5056
+ const groups = userInfo[roleClaimName];
4894
5057
  const newAuth = {
4895
5058
  username: isAuthCognito ? userInfo['cognito:username'] : userInfo.email,
5059
+ roles: groupsToRoles(groups, authConfig),
4896
5060
  token: access_token,
4897
5061
  refresh_token: refresh_token || '',
4898
5062
  expires_at: epochTimeTokenExpirationInSeconds,
@@ -5069,5 +5233,18 @@ const createFakeApiInstance = () => ({
5069
5233
  patch: (_url, _params, _signal) => fakeApiRequest(_signal)
5070
5234
  });
5071
5235
  const getCurrentTimeInSeconds = () => Date.now() * MILLISECOND_TO_SECOND;
5236
+ const groupsToRoles = (groups, authConfig) => {
5237
+ if (!Array.isArray(groups)) {
5238
+ return [GEOWEB_ROLE_USER];
5239
+ }
5240
+ const requiredGroupForPresetsAdmin = authConfig === null || authConfig === void 0 ? void 0 : authConfig.GW_AUTH_ROLE_CLAIM_VALUE_PRESETS_ADMIN;
5241
+ const roles = groups.reduce((acc, group) => {
5242
+ if (requiredGroupForPresetsAdmin && group === requiredGroupForPresetsAdmin) {
5243
+ acc.push(GEOWEB_ROLE_PRESETS_ADMIN);
5244
+ }
5245
+ return acc;
5246
+ }, [GEOWEB_ROLE_USER]);
5247
+ return roles;
5248
+ };
5072
5249
 
5073
- export { ApiProvider, KEEP_ALIVE_IN_SECONDS, KEEP_ALIVE_POLLER_IN_SECONDS, MILLISECOND_TO_SECOND, REFRESH_TOKEN_WHEN_PCT_EXPIRED, createApiInstance, createFakeApiInstance, createNonAuthApiInstance, fakeApiRequest, getApi, getCurrentTimeInSeconds, makeCredentialsFromTokenResponse, refreshAccessToken, refreshAccessTokenAndSetAuthContext, useApi, useApiContext };
5250
+ export { ApiProvider, GEOWEB_ROLE_PRESETS_ADMIN, GEOWEB_ROLE_USER, KEEP_ALIVE_IN_SECONDS, KEEP_ALIVE_POLLER_IN_SECONDS, MILLISECOND_TO_SECOND, REFRESH_TOKEN_WHEN_PCT_EXPIRED, createApiInstance, createFakeApiInstance, createNonAuthApiInstance, fakeApiRequest, getApi, getCurrentTimeInSeconds, groupsToRoles, makeCredentialsFromTokenResponse, refreshAccessToken, refreshAccessTokenAndSetAuthContext, useApi, useApiContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/api",
3
- "version": "9.16.0",
3
+ "version": "9.18.0",
4
4
  "description": "GeoWeb API library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -6,6 +6,7 @@ export interface GeoWebJWT {
6
6
  }
7
7
  export interface Credentials {
8
8
  username: string;
9
+ roles?: Role[];
9
10
  token: string;
10
11
  refresh_token: string;
11
12
  expires_at?: number;
@@ -28,3 +29,7 @@ export interface CreateApiProps extends ApiModule {
28
29
  timeout?: number;
29
30
  }
30
31
  export type CreateApiFn = (props: CreateApiProps) => void;
32
+ export interface Role {
33
+ name: string;
34
+ title: string;
35
+ }
@@ -1,9 +1,18 @@
1
1
  import { AxiosInstance, AxiosResponse } from 'axios';
2
- import { CreateApiProps, Credentials } from './types';
2
+ import { ConfigType } from '@opengeoweb/shared';
3
+ import { CreateApiProps, Credentials, Role } from './types';
3
4
  export declare const KEEP_ALIVE_IN_SECONDS = 60;
4
5
  export declare const KEEP_ALIVE_POLLER_IN_SECONDS = 10;
5
6
  export declare const REFRESH_TOKEN_WHEN_PCT_EXPIRED = 75;
6
7
  export declare const MILLISECOND_TO_SECOND: number;
8
+ export declare const GEOWEB_ROLE_PRESETS_ADMIN: {
9
+ name: string;
10
+ title: string;
11
+ };
12
+ export declare const GEOWEB_ROLE_USER: {
13
+ name: string;
14
+ title: string;
15
+ };
7
16
  /**
8
17
  * Creates a Credentials object based on the axios response from the token service.
9
18
  *
@@ -12,7 +21,7 @@ export declare const MILLISECOND_TO_SECOND: number;
12
21
  * @param tokenResponse Response of the tokenservice as axios response object.
13
22
  * @returns Credentials object.
14
23
  */
15
- export declare const makeCredentialsFromTokenResponse: (tokenResponse: AxiosResponse) => Credentials;
24
+ export declare const makeCredentialsFromTokenResponse: (tokenResponse: AxiosResponse, authConfig?: ConfigType) => Credentials;
16
25
  export declare const refreshAccessToken: ({ auth, config: { authTokenURL, authClientId, appURL }, timeout, }: CreateApiProps) => Promise<AxiosResponse>;
17
26
  export declare const refreshAccessTokenAndSetAuthContext: ({ auth, onSetAuth, config, timeout, }: CreateApiProps) => Promise<void>;
18
27
  export declare const createApiInstance: ({ auth, onSetAuth, config: { baseURL, authTokenURL, authClientId, appURL }, timeout, }: CreateApiProps) => AxiosInstance;
@@ -20,3 +29,4 @@ export declare const createNonAuthApiInstance: ({ config: { baseURL }, timeout,
20
29
  export declare const fakeApiRequest: (signal?: AbortController) => Promise<void>;
21
30
  export declare const createFakeApiInstance: () => AxiosInstance;
22
31
  export declare const getCurrentTimeInSeconds: () => number;
32
+ export declare const groupsToRoles: (groups: string[] | undefined, authConfig?: ConfigType) => Role[];