@fluxo-dev/api-client-base 25.1.12 → 25.2.2

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.cjs.js CHANGED
@@ -3,7 +3,6 @@
3
3
  var axios = require('axios');
4
4
  var state = require('@fluxo-dev/state');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- var React = require('react');
7
6
 
8
7
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
9
8
 
@@ -25,7 +24,7 @@ var global$k =
25
24
 
26
25
  var objectGetOwnPropertyDescriptor = {};
27
26
 
28
- var fails$i = function (exec) {
27
+ var fails$j = function (exec) {
29
28
  try {
30
29
  return !!exec();
31
30
  } catch (error) {
@@ -33,17 +32,17 @@ var fails$i = function (exec) {
33
32
  }
34
33
  };
35
34
 
36
- var fails$h = fails$i;
35
+ var fails$i = fails$j;
37
36
 
38
37
  // Detect IE8's incomplete defineProperty implementation
39
- var descriptors = !fails$h(function () {
38
+ var descriptors = !fails$i(function () {
40
39
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
41
40
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
42
41
  });
43
42
 
44
- var fails$g = fails$i;
43
+ var fails$h = fails$j;
45
44
 
46
- var functionBindNative = !fails$g(function () {
45
+ var functionBindNative = !fails$h(function () {
47
46
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
48
47
  var test = (function () { /* empty */ }).bind();
49
48
  // eslint-disable-next-line no-prototype-builtins -- safe
@@ -52,10 +51,10 @@ var functionBindNative = !fails$g(function () {
52
51
 
53
52
  var NATIVE_BIND$3 = functionBindNative;
54
53
 
55
- var call$g = Function.prototype.call;
54
+ var call$h = Function.prototype.call;
56
55
 
57
- var functionCall = NATIVE_BIND$3 ? call$g.bind(call$g) : function () {
58
- return call$g.apply(call$g, arguments);
56
+ var functionCall = NATIVE_BIND$3 ? call$h.bind(call$h) : function () {
57
+ return call$h.apply(call$h, arguments);
59
58
  };
60
59
 
61
60
  var objectPropertyIsEnumerable = {};
@@ -86,12 +85,12 @@ var createPropertyDescriptor$4 = function (bitmap, value) {
86
85
  var NATIVE_BIND$2 = functionBindNative;
87
86
 
88
87
  var FunctionPrototype$2 = Function.prototype;
89
- var call$f = FunctionPrototype$2.call;
90
- var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$f, call$f);
88
+ var call$g = FunctionPrototype$2.call;
89
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$g, call$g);
91
90
 
92
91
  var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
93
92
  return function () {
94
- return call$f.apply(fn, arguments);
93
+ return call$g.apply(fn, arguments);
95
94
  };
96
95
  };
97
96
 
@@ -105,14 +104,14 @@ var classofRaw$2 = function (it) {
105
104
  };
106
105
 
107
106
  var uncurryThis$i = functionUncurryThis;
108
- var fails$f = fails$i;
107
+ var fails$g = fails$j;
109
108
  var classof$8 = classofRaw$2;
110
109
 
111
110
  var $Object$4 = Object;
112
111
  var split = uncurryThis$i(''.split);
113
112
 
114
113
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
115
- var indexedObject = fails$f(function () {
114
+ var indexedObject = fails$g(function () {
116
115
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
117
116
  // eslint-disable-next-line no-prototype-builtins -- safe
118
117
  return !$Object$4('z').propertyIsEnumerable(0);
@@ -210,13 +209,13 @@ var engineV8Version = version;
210
209
 
211
210
  /* eslint-disable es/no-symbol -- required for testing */
212
211
  var V8_VERSION$1 = engineV8Version;
213
- var fails$e = fails$i;
212
+ var fails$f = fails$j;
214
213
  var global$h = global$k;
215
214
 
216
215
  var $String$6 = global$h.String;
217
216
 
218
217
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
219
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$e(function () {
218
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$f(function () {
220
219
  var symbol = Symbol('symbol detection');
221
220
  // Chrome 38 Symbol has incorrect toString conversion
222
221
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
@@ -236,7 +235,7 @@ var useSymbolAsUid = NATIVE_SYMBOL$3
236
235
 
237
236
  var getBuiltIn$8 = getBuiltIn$9;
238
237
  var isCallable$k = isCallable$n;
239
- var isPrototypeOf$4 = objectIsPrototypeOf;
238
+ var isPrototypeOf$5 = objectIsPrototypeOf;
240
239
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
241
240
 
242
241
  var $Object$3 = Object;
@@ -245,7 +244,7 @@ var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
245
244
  return typeof it == 'symbol';
246
245
  } : function (it) {
247
246
  var $Symbol = getBuiltIn$8('Symbol');
248
- return isCallable$k($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
247
+ return isCallable$k($Symbol) && isPrototypeOf$5($Symbol.prototype, $Object$3(it));
249
248
  };
250
249
 
251
250
  var $String$5 = String;
@@ -279,7 +278,7 @@ var getMethod$4 = function (V, P) {
279
278
  return isNullOrUndefined$2(func) ? undefined : aCallable$c(func);
280
279
  };
281
280
 
282
- var call$e = functionCall;
281
+ var call$f = functionCall;
283
282
  var isCallable$i = isCallable$n;
284
283
  var isObject$d = isObject$e;
285
284
 
@@ -289,9 +288,9 @@ var $TypeError$e = TypeError;
289
288
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
290
289
  var ordinaryToPrimitive$1 = function (input, pref) {
291
290
  var fn, val;
292
- if (pref === 'string' && isCallable$i(fn = input.toString) && !isObject$d(val = call$e(fn, input))) return val;
293
- if (isCallable$i(fn = input.valueOf) && !isObject$d(val = call$e(fn, input))) return val;
294
- if (pref !== 'string' && isCallable$i(fn = input.toString) && !isObject$d(val = call$e(fn, input))) return val;
291
+ if (pref === 'string' && isCallable$i(fn = input.toString) && !isObject$d(val = call$f(fn, input))) return val;
292
+ if (isCallable$i(fn = input.valueOf) && !isObject$d(val = call$f(fn, input))) return val;
293
+ if (pref !== 'string' && isCallable$i(fn = input.toString) && !isObject$d(val = call$f(fn, input))) return val;
295
294
  throw new $TypeError$e("Can't convert object to primitive value");
296
295
  };
297
296
 
@@ -368,7 +367,7 @@ var uid$2 = function (key) {
368
367
 
369
368
  var global$f = global$k;
370
369
  var shared$2 = shared$3;
371
- var hasOwn$c = hasOwnProperty_1;
370
+ var hasOwn$d = hasOwnProperty_1;
372
371
  var uid$1 = uid$2;
373
372
  var NATIVE_SYMBOL$2 = symbolConstructorDetection;
374
373
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
@@ -378,14 +377,14 @@ var WellKnownSymbolsStore = shared$2('wks');
378
377
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
379
378
 
380
379
  var wellKnownSymbol$h = function (name) {
381
- if (!hasOwn$c(WellKnownSymbolsStore, name)) {
382
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL$2 && hasOwn$c(Symbol$1, name)
380
+ if (!hasOwn$d(WellKnownSymbolsStore, name)) {
381
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL$2 && hasOwn$d(Symbol$1, name)
383
382
  ? Symbol$1[name]
384
383
  : createWellKnownSymbol('Symbol.' + name);
385
384
  } return WellKnownSymbolsStore[name];
386
385
  };
387
386
 
388
- var call$d = functionCall;
387
+ var call$e = functionCall;
389
388
  var isObject$c = isObject$e;
390
389
  var isSymbol$2 = isSymbol$3;
391
390
  var getMethod$3 = getMethod$4;
@@ -403,7 +402,7 @@ var toPrimitive$1 = function (input, pref) {
403
402
  var result;
404
403
  if (exoticToPrim) {
405
404
  if (pref === undefined) pref = 'default';
406
- result = call$d(exoticToPrim, input, pref);
405
+ result = call$e(exoticToPrim, input, pref);
407
406
  if (!isObject$c(result) || isSymbol$2(result)) return result;
408
407
  throw new $TypeError$d("Can't convert object to primitive value");
409
408
  }
@@ -433,11 +432,11 @@ var documentCreateElement$1 = function (it) {
433
432
  };
434
433
 
435
434
  var DESCRIPTORS$f = descriptors;
436
- var fails$d = fails$i;
435
+ var fails$e = fails$j;
437
436
  var createElement$1 = documentCreateElement$1;
438
437
 
439
438
  // Thanks to IE8 for its funny defineProperty
440
- var ie8DomDefine = !DESCRIPTORS$f && !fails$d(function () {
439
+ var ie8DomDefine = !DESCRIPTORS$f && !fails$e(function () {
441
440
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
442
441
  return Object.defineProperty(createElement$1('div'), 'a', {
443
442
  get: function () { return 7; }
@@ -445,12 +444,12 @@ var ie8DomDefine = !DESCRIPTORS$f && !fails$d(function () {
445
444
  });
446
445
 
447
446
  var DESCRIPTORS$e = descriptors;
448
- var call$c = functionCall;
447
+ var call$d = functionCall;
449
448
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
450
449
  var createPropertyDescriptor$3 = createPropertyDescriptor$4;
451
450
  var toIndexedObject$3 = toIndexedObject$4;
452
451
  var toPropertyKey$1 = toPropertyKey$2;
453
- var hasOwn$b = hasOwnProperty_1;
452
+ var hasOwn$c = hasOwnProperty_1;
454
453
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
455
454
 
456
455
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -464,17 +463,17 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$e ? $getOwnPropertyDescriptor$1 :
464
463
  if (IE8_DOM_DEFINE$1) try {
465
464
  return $getOwnPropertyDescriptor$1(O, P);
466
465
  } catch (error) { /* empty */ }
467
- if (hasOwn$b(O, P)) return createPropertyDescriptor$3(!call$c(propertyIsEnumerableModule$1.f, O, P), O[P]);
466
+ if (hasOwn$c(O, P)) return createPropertyDescriptor$3(!call$d(propertyIsEnumerableModule$1.f, O, P), O[P]);
468
467
  };
469
468
 
470
469
  var objectDefineProperty = {};
471
470
 
472
471
  var DESCRIPTORS$d = descriptors;
473
- var fails$c = fails$i;
472
+ var fails$d = fails$j;
474
473
 
475
474
  // V8 ~ Chrome 36-
476
475
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
477
- var v8PrototypeDefineBug = DESCRIPTORS$d && fails$c(function () {
476
+ var v8PrototypeDefineBug = DESCRIPTORS$d && fails$d(function () {
478
477
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
479
478
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
480
479
  value: 42,
@@ -488,7 +487,7 @@ var $String$4 = String;
488
487
  var $TypeError$c = TypeError;
489
488
 
490
489
  // `Assert: Type(argument) is Object`
491
- var anObject$g = function (argument) {
490
+ var anObject$i = function (argument) {
492
491
  if (isObject$a(argument)) return argument;
493
492
  throw new $TypeError$c($String$4(argument) + ' is not an object');
494
493
  };
@@ -496,7 +495,7 @@ var anObject$g = function (argument) {
496
495
  var DESCRIPTORS$c = descriptors;
497
496
  var IE8_DOM_DEFINE = ie8DomDefine;
498
497
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
499
- var anObject$f = anObject$g;
498
+ var anObject$h = anObject$i;
500
499
  var toPropertyKey = toPropertyKey$2;
501
500
 
502
501
  var $TypeError$b = TypeError;
@@ -511,9 +510,9 @@ var WRITABLE = 'writable';
511
510
  // `Object.defineProperty` method
512
511
  // https://tc39.es/ecma262/#sec-object.defineproperty
513
512
  objectDefineProperty.f = DESCRIPTORS$c ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
514
- anObject$f(O);
513
+ anObject$h(O);
515
514
  P = toPropertyKey(P);
516
- anObject$f(Attributes);
515
+ anObject$h(Attributes);
517
516
  if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
518
517
  var current = $getOwnPropertyDescriptor(O, P);
519
518
  if (current && current[WRITABLE]) {
@@ -526,9 +525,9 @@ objectDefineProperty.f = DESCRIPTORS$c ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
526
525
  }
527
526
  } return $defineProperty(O, P, Attributes);
528
527
  } : $defineProperty : function defineProperty(O, P, Attributes) {
529
- anObject$f(O);
528
+ anObject$h(O);
530
529
  P = toPropertyKey(P);
531
- anObject$f(Attributes);
530
+ anObject$h(Attributes);
532
531
  if (IE8_DOM_DEFINE) try {
533
532
  return $defineProperty(O, P, Attributes);
534
533
  } catch (error) { /* empty */ }
@@ -551,16 +550,19 @@ var createNonEnumerableProperty$6 = DESCRIPTORS$b ? function (object, key, value
551
550
  var makeBuiltIn$3 = {exports: {}};
552
551
 
553
552
  var DESCRIPTORS$a = descriptors;
554
- var hasOwn$a = hasOwnProperty_1;
553
+ var hasOwn$b = hasOwnProperty_1;
555
554
 
556
555
  var FunctionPrototype$1 = Function.prototype;
557
556
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
558
557
  var getDescriptor = DESCRIPTORS$a && Object.getOwnPropertyDescriptor;
559
558
 
560
- var EXISTS = hasOwn$a(FunctionPrototype$1, 'name');
559
+ var EXISTS = hasOwn$b(FunctionPrototype$1, 'name');
560
+ // additional protection from minified / mangled / dropped function names
561
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
561
562
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS$a || (DESCRIPTORS$a && getDescriptor(FunctionPrototype$1, 'name').configurable));
562
563
 
563
564
  var functionName = {
565
+ PROPER: PROPER,
564
566
  CONFIGURABLE: CONFIGURABLE
565
567
  };
566
568
 
@@ -601,7 +603,7 @@ var NATIVE_WEAK_MAP = weakMapBasicDetection;
601
603
  var global$c = global$k;
602
604
  var isObject$9 = isObject$e;
603
605
  var createNonEnumerableProperty$5 = createNonEnumerableProperty$6;
604
- var hasOwn$9 = hasOwnProperty_1;
606
+ var hasOwn$a = hasOwnProperty_1;
605
607
  var shared = sharedStoreExports;
606
608
  var sharedKey$2 = sharedKey$3;
607
609
  var hiddenKeys$3 = hiddenKeys$4;
@@ -647,16 +649,16 @@ if (NATIVE_WEAK_MAP || shared.state) {
647
649
  var STATE = sharedKey$2('state');
648
650
  hiddenKeys$3[STATE] = true;
649
651
  set$1 = function (it, metadata) {
650
- if (hasOwn$9(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
652
+ if (hasOwn$a(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
651
653
  metadata.facade = it;
652
654
  createNonEnumerableProperty$5(it, STATE, metadata);
653
655
  return metadata;
654
656
  };
655
657
  get = function (it) {
656
- return hasOwn$9(it, STATE) ? it[STATE] : {};
658
+ return hasOwn$a(it, STATE) ? it[STATE] : {};
657
659
  };
658
660
  has = function (it) {
659
- return hasOwn$9(it, STATE);
661
+ return hasOwn$a(it, STATE);
660
662
  };
661
663
  }
662
664
 
@@ -669,9 +671,9 @@ var internalState = {
669
671
  };
670
672
 
671
673
  var uncurryThis$d = functionUncurryThis;
672
- var fails$b = fails$i;
674
+ var fails$c = fails$j;
673
675
  var isCallable$f = isCallable$n;
674
- var hasOwn$8 = hasOwnProperty_1;
676
+ var hasOwn$9 = hasOwnProperty_1;
675
677
  var DESCRIPTORS$9 = descriptors;
676
678
  var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
677
679
  var inspectSource$2 = inspectSource$3;
@@ -686,7 +688,7 @@ var stringSlice$1 = uncurryThis$d(''.slice);
686
688
  var replace$3 = uncurryThis$d(''.replace);
687
689
  var join = uncurryThis$d([].join);
688
690
 
689
- var CONFIGURABLE_LENGTH = DESCRIPTORS$9 && !fails$b(function () {
691
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$9 && !fails$c(function () {
690
692
  return defineProperty$5(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
691
693
  });
692
694
 
@@ -698,21 +700,21 @@ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
698
700
  }
699
701
  if (options && options.getter) name = 'get ' + name;
700
702
  if (options && options.setter) name = 'set ' + name;
701
- if (!hasOwn$8(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
703
+ if (!hasOwn$9(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
702
704
  if (DESCRIPTORS$9) defineProperty$5(value, 'name', { value: name, configurable: true });
703
705
  else value.name = name;
704
706
  }
705
- if (CONFIGURABLE_LENGTH && options && hasOwn$8(options, 'arity') && value.length !== options.arity) {
707
+ if (CONFIGURABLE_LENGTH && options && hasOwn$9(options, 'arity') && value.length !== options.arity) {
706
708
  defineProperty$5(value, 'length', { value: options.arity });
707
709
  }
708
710
  try {
709
- if (options && hasOwn$8(options, 'constructor') && options.constructor) {
711
+ if (options && hasOwn$9(options, 'constructor') && options.constructor) {
710
712
  if (DESCRIPTORS$9) defineProperty$5(value, 'prototype', { writable: false });
711
713
  // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
712
714
  } else if (value.prototype) value.prototype = undefined;
713
715
  } catch (error) { /* empty */ }
714
716
  var state = enforceInternalState(value);
715
- if (!hasOwn$8(state, 'source')) {
717
+ if (!hasOwn$9(state, 'source')) {
716
718
  state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
717
719
  } return value;
718
720
  };
@@ -730,7 +732,7 @@ var definePropertyModule$3 = objectDefineProperty;
730
732
  var makeBuiltIn$1 = makeBuiltInExports;
731
733
  var defineGlobalProperty$1 = defineGlobalProperty$3;
732
734
 
733
- var defineBuiltIn$5 = function (O, key, value, options) {
735
+ var defineBuiltIn$6 = function (O, key, value, options) {
734
736
  if (!options) options = {};
735
737
  var simple = options.enumerable;
736
738
  var name = options.name !== undefined ? options.name : key;
@@ -843,7 +845,7 @@ var arrayIncludes = {
843
845
  };
844
846
 
845
847
  var uncurryThis$c = functionUncurryThis;
846
- var hasOwn$7 = hasOwnProperty_1;
848
+ var hasOwn$8 = hasOwnProperty_1;
847
849
  var toIndexedObject$1 = toIndexedObject$4;
848
850
  var indexOf = arrayIncludes.indexOf;
849
851
  var hiddenKeys$2 = hiddenKeys$4;
@@ -855,9 +857,9 @@ var objectKeysInternal = function (object, names) {
855
857
  var i = 0;
856
858
  var result = [];
857
859
  var key;
858
- for (key in O) !hasOwn$7(hiddenKeys$2, key) && hasOwn$7(O, key) && push$1(result, key);
860
+ for (key in O) !hasOwn$8(hiddenKeys$2, key) && hasOwn$8(O, key) && push$1(result, key);
859
861
  // Don't enum bug & hidden keys
860
- while (names.length > i) if (hasOwn$7(O, key = names[i++])) {
862
+ while (names.length > i) if (hasOwn$8(O, key = names[i++])) {
861
863
  ~indexOf(result, key) || push$1(result, key);
862
864
  }
863
865
  return result;
@@ -895,18 +897,18 @@ var getBuiltIn$7 = getBuiltIn$9;
895
897
  var uncurryThis$b = functionUncurryThis;
896
898
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
897
899
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
898
- var anObject$e = anObject$g;
900
+ var anObject$g = anObject$i;
899
901
 
900
902
  var concat$1 = uncurryThis$b([].concat);
901
903
 
902
904
  // all object keys, includes non-enumerable and symbols
903
905
  var ownKeys$1 = getBuiltIn$7('Reflect', 'ownKeys') || function ownKeys(it) {
904
- var keys = getOwnPropertyNamesModule.f(anObject$e(it));
906
+ var keys = getOwnPropertyNamesModule.f(anObject$g(it));
905
907
  var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
906
908
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
907
909
  };
908
910
 
909
- var hasOwn$6 = hasOwnProperty_1;
911
+ var hasOwn$7 = hasOwnProperty_1;
910
912
  var ownKeys = ownKeys$1;
911
913
  var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
912
914
  var definePropertyModule$2 = objectDefineProperty;
@@ -917,13 +919,13 @@ var copyConstructorProperties$3 = function (target, source, exceptions) {
917
919
  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
918
920
  for (var i = 0; i < keys.length; i++) {
919
921
  var key = keys[i];
920
- if (!hasOwn$6(target, key) && !(exceptions && hasOwn$6(exceptions, key))) {
922
+ if (!hasOwn$7(target, key) && !(exceptions && hasOwn$7(exceptions, key))) {
921
923
  defineProperty(target, key, getOwnPropertyDescriptor(source, key));
922
924
  }
923
925
  }
924
926
  };
925
927
 
926
- var fails$a = fails$i;
928
+ var fails$b = fails$j;
927
929
  var isCallable$d = isCallable$n;
928
930
 
929
931
  var replacement = /#|\.prototype\./;
@@ -932,7 +934,7 @@ var isForced$2 = function (feature, detection) {
932
934
  var value = data[normalize(feature)];
933
935
  return value === POLYFILL ? true
934
936
  : value === NATIVE ? false
935
- : isCallable$d(detection) ? fails$a(detection)
937
+ : isCallable$d(detection) ? fails$b(detection)
936
938
  : !!detection;
937
939
  };
938
940
 
@@ -949,7 +951,7 @@ var isForced_1 = isForced$2;
949
951
  var global$b = global$k;
950
952
  var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
951
953
  var createNonEnumerableProperty$4 = createNonEnumerableProperty$6;
952
- var defineBuiltIn$4 = defineBuiltIn$5;
954
+ var defineBuiltIn$5 = defineBuiltIn$6;
953
955
  var defineGlobalProperty = defineGlobalProperty$3;
954
956
  var copyConstructorProperties$2 = copyConstructorProperties$3;
955
957
  var isForced$1 = isForced_1;
@@ -997,7 +999,7 @@ var _export = function (options, source) {
997
999
  if (options.sham || (targetProperty && targetProperty.sham)) {
998
1000
  createNonEnumerableProperty$4(sourceProperty, 'sham', true);
999
1001
  }
1000
- defineBuiltIn$4(target, key, sourceProperty, options);
1002
+ defineBuiltIn$5(target, key, sourceProperty, options);
1001
1003
  }
1002
1004
  };
1003
1005
 
@@ -1005,11 +1007,11 @@ var NATIVE_BIND$1 = functionBindNative;
1005
1007
 
1006
1008
  var FunctionPrototype = Function.prototype;
1007
1009
  var apply$3 = FunctionPrototype.apply;
1008
- var call$b = FunctionPrototype.call;
1010
+ var call$c = FunctionPrototype.call;
1009
1011
 
1010
1012
  // eslint-disable-next-line es/no-reflect -- safe
1011
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$b.bind(apply$3) : function () {
1012
- return call$b.apply(apply$3, arguments);
1013
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$c.bind(apply$3) : function () {
1014
+ return call$c.apply(apply$3, arguments);
1013
1015
  });
1014
1016
 
1015
1017
  var uncurryThis$a = functionUncurryThis;
@@ -1177,10 +1179,10 @@ var errorStackClear = function (stack, dropEntries) {
1177
1179
  } return stack;
1178
1180
  };
1179
1181
 
1180
- var fails$9 = fails$i;
1182
+ var fails$a = fails$j;
1181
1183
  var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1182
1184
 
1183
- var errorStackInstallable = !fails$9(function () {
1185
+ var errorStackInstallable = !fails$a(function () {
1184
1186
  var error = new Error('a');
1185
1187
  if (!('stack' in error)) return true;
1186
1188
  // eslint-disable-next-line es/no-object-defineproperty -- safe
@@ -1203,9 +1205,9 @@ var errorStackInstall = function (error, C, stack, dropEntries) {
1203
1205
  };
1204
1206
 
1205
1207
  var getBuiltIn$6 = getBuiltIn$9;
1206
- var hasOwn$5 = hasOwnProperty_1;
1208
+ var hasOwn$6 = hasOwnProperty_1;
1207
1209
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$6;
1208
- var isPrototypeOf$3 = objectIsPrototypeOf;
1210
+ var isPrototypeOf$4 = objectIsPrototypeOf;
1209
1211
  var setPrototypeOf$1 = objectSetPrototypeOf;
1210
1212
  var copyConstructorProperties$1 = copyConstructorProperties$3;
1211
1213
  var proxyAccessor = proxyAccessor$1;
@@ -1227,7 +1229,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
1227
1229
  var OriginalErrorPrototype = OriginalError.prototype;
1228
1230
 
1229
1231
  // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
1230
- if (hasOwn$5(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
1232
+ if (hasOwn$6(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
1231
1233
 
1232
1234
  if (!FORCED) return OriginalError;
1233
1235
 
@@ -1238,7 +1240,7 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
1238
1240
  var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
1239
1241
  if (message !== undefined) createNonEnumerableProperty$1(result, 'message', message);
1240
1242
  installErrorStack(result, WrappedError, result.stack, 2);
1241
- if (this && isPrototypeOf$3(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
1243
+ if (this && isPrototypeOf$4(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
1242
1244
  if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
1243
1245
  return result;
1244
1246
  });
@@ -1373,9 +1375,9 @@ var toObject$3 = toObject$5;
1373
1375
  var lengthOfArrayLike$3 = lengthOfArrayLike$5;
1374
1376
  var setArrayLength = arraySetLength;
1375
1377
  var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
1376
- var fails$8 = fails$i;
1378
+ var fails$9 = fails$j;
1377
1379
 
1378
- var INCORRECT_TO_LENGTH = fails$8(function () {
1380
+ var INCORRECT_TO_LENGTH = fails$9(function () {
1379
1381
  return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
1380
1382
  });
1381
1383
 
@@ -1454,8 +1456,8 @@ var objectKeys$2 = Object.keys || function keys(O) {
1454
1456
 
1455
1457
  var DESCRIPTORS$6 = descriptors;
1456
1458
  var uncurryThis$8 = functionUncurryThis;
1457
- var call$a = functionCall;
1458
- var fails$7 = fails$i;
1459
+ var call$b = functionCall;
1460
+ var fails$8 = fails$j;
1459
1461
  var objectKeys$1 = objectKeys$2;
1460
1462
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1461
1463
  var propertyIsEnumerableModule = objectPropertyIsEnumerable;
@@ -1470,7 +1472,7 @@ var concat = uncurryThis$8([].concat);
1470
1472
 
1471
1473
  // `Object.assign` method
1472
1474
  // https://tc39.es/ecma262/#sec-object.assign
1473
- var objectAssign = !$assign || fails$7(function () {
1475
+ var objectAssign = !$assign || fails$8(function () {
1474
1476
  // should have correct order of operations (Edge bug)
1475
1477
  if (DESCRIPTORS$6 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1476
1478
  enumerable: true,
@@ -1504,7 +1506,7 @@ var objectAssign = !$assign || fails$7(function () {
1504
1506
  var key;
1505
1507
  while (length > j) {
1506
1508
  key = keys[j++];
1507
- if (!DESCRIPTORS$6 || call$a(propertyIsEnumerable, S, key)) T[key] = S[key];
1509
+ if (!DESCRIPTORS$6 || call$b(propertyIsEnumerable, S, key)) T[key] = S[key];
1508
1510
  }
1509
1511
  } return T;
1510
1512
  } : $assign;
@@ -1525,14 +1527,14 @@ var classof$4 = classofRaw$2;
1525
1527
  var engineIsNode = classof$4(global$9.process) === 'process';
1526
1528
 
1527
1529
  var defineProperty$2 = objectDefineProperty.f;
1528
- var hasOwn$4 = hasOwnProperty_1;
1530
+ var hasOwn$5 = hasOwnProperty_1;
1529
1531
  var wellKnownSymbol$d = wellKnownSymbol$h;
1530
1532
 
1531
1533
  var TO_STRING_TAG$2 = wellKnownSymbol$d('toStringTag');
1532
1534
 
1533
1535
  var setToStringTag$1 = function (target, TAG, STATIC) {
1534
1536
  if (target && !STATIC) target = target.prototype;
1535
- if (target && !hasOwn$4(target, TO_STRING_TAG$2)) {
1537
+ if (target && !hasOwn$5(target, TO_STRING_TAG$2)) {
1536
1538
  defineProperty$2(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
1537
1539
  }
1538
1540
  };
@@ -1564,17 +1566,17 @@ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1564
1566
  }
1565
1567
  };
1566
1568
 
1567
- var isPrototypeOf$2 = objectIsPrototypeOf;
1569
+ var isPrototypeOf$3 = objectIsPrototypeOf;
1568
1570
 
1569
1571
  var $TypeError$7 = TypeError;
1570
1572
 
1571
1573
  var anInstance$2 = function (it, Prototype) {
1572
- if (isPrototypeOf$2(Prototype, it)) return it;
1574
+ if (isPrototypeOf$3(Prototype, it)) return it;
1573
1575
  throw new $TypeError$7('Incorrect invocation');
1574
1576
  };
1575
1577
 
1576
1578
  var uncurryThis$7 = functionUncurryThis;
1577
- var fails$6 = fails$i;
1579
+ var fails$7 = fails$j;
1578
1580
  var isCallable$a = isCallable$n;
1579
1581
  var classof$3 = classof$7;
1580
1582
  var getBuiltIn$4 = getBuiltIn$9;
@@ -1617,7 +1619,7 @@ isConstructorLegacy.sham = true;
1617
1619
 
1618
1620
  // `IsConstructor` abstract operation
1619
1621
  // https://tc39.es/ecma262/#sec-isconstructor
1620
- var isConstructor$2 = !construct || fails$6(function () {
1622
+ var isConstructor$2 = !construct || fails$7(function () {
1621
1623
  var called;
1622
1624
  return isConstructorModern(isConstructorModern.call)
1623
1625
  || !isConstructorModern(Object)
@@ -1636,7 +1638,7 @@ var aConstructor$1 = function (argument) {
1636
1638
  throw new $TypeError$6(tryToString$2(argument) + ' is not a constructor');
1637
1639
  };
1638
1640
 
1639
- var anObject$d = anObject$g;
1641
+ var anObject$f = anObject$i;
1640
1642
  var aConstructor = aConstructor$1;
1641
1643
  var isNullOrUndefined$1 = isNullOrUndefined$4;
1642
1644
  var wellKnownSymbol$b = wellKnownSymbol$h;
@@ -1646,9 +1648,9 @@ var SPECIES$2 = wellKnownSymbol$b('species');
1646
1648
  // `SpeciesConstructor` abstract operation
1647
1649
  // https://tc39.es/ecma262/#sec-speciesconstructor
1648
1650
  var speciesConstructor$1 = function (O, defaultConstructor) {
1649
- var C = anObject$d(O).constructor;
1651
+ var C = anObject$f(O).constructor;
1650
1652
  var S;
1651
- return C === undefined || isNullOrUndefined$1(S = anObject$d(C)[SPECIES$2]) ? defaultConstructor : aConstructor(S);
1653
+ return C === undefined || isNullOrUndefined$1(S = anObject$f(C)[SPECIES$2]) ? defaultConstructor : aConstructor(S);
1652
1654
  };
1653
1655
 
1654
1656
  var classofRaw = classofRaw$2;
@@ -1699,8 +1701,8 @@ var global$8 = global$k;
1699
1701
  var apply$1 = functionApply;
1700
1702
  var bind$4 = functionBindContext;
1701
1703
  var isCallable$9 = isCallable$n;
1702
- var hasOwn$3 = hasOwnProperty_1;
1703
- var fails$5 = fails$i;
1704
+ var hasOwn$4 = hasOwnProperty_1;
1705
+ var fails$6 = fails$j;
1704
1706
  var html$1 = html$2;
1705
1707
  var arraySlice$1 = arraySlice$2;
1706
1708
  var createElement = documentCreateElement$1;
@@ -1720,13 +1722,13 @@ var queue$2 = {};
1720
1722
  var ONREADYSTATECHANGE = 'onreadystatechange';
1721
1723
  var $location, defer, channel, port;
1722
1724
 
1723
- fails$5(function () {
1725
+ fails$6(function () {
1724
1726
  // Deno throws a ReferenceError on `location` access without `--location` flag
1725
1727
  $location = global$8.location;
1726
1728
  });
1727
1729
 
1728
1730
  var run = function (id) {
1729
- if (hasOwn$3(queue$2, id)) {
1731
+ if (hasOwn$4(queue$2, id)) {
1730
1732
  var fn = queue$2[id];
1731
1733
  delete queue$2[id];
1732
1734
  fn();
@@ -1787,7 +1789,7 @@ if (!set || !clear) {
1787
1789
  isCallable$9(global$8.postMessage) &&
1788
1790
  !global$8.importScripts &&
1789
1791
  $location && $location.protocol !== 'file:' &&
1790
- !fails$5(globalPostMessageDefer)
1792
+ !fails$6(globalPostMessageDefer)
1791
1793
  ) {
1792
1794
  defer = globalPostMessageDefer;
1793
1795
  global$8.addEventListener('message', eventListener, false);
@@ -2035,8 +2037,8 @@ newPromiseCapability$2.f = function (C) {
2035
2037
  var $$g = _export;
2036
2038
  var IS_NODE = engineIsNode;
2037
2039
  var global$3 = global$k;
2038
- var call$9 = functionCall;
2039
- var defineBuiltIn$3 = defineBuiltIn$5;
2040
+ var call$a = functionCall;
2041
+ var defineBuiltIn$4 = defineBuiltIn$6;
2040
2042
  var setPrototypeOf = objectSetPrototypeOf;
2041
2043
  var setToStringTag = setToStringTag$1;
2042
2044
  var setSpecies = setSpecies$1;
@@ -2113,7 +2115,7 @@ var callReaction = function (reaction, state) {
2113
2115
  if (result === reaction.promise) {
2114
2116
  reject(new TypeError$1('Promise-chain cycle'));
2115
2117
  } else if (then = isThenable(result)) {
2116
- call$9(then, result, resolve, reject);
2118
+ call$a(then, result, resolve, reject);
2117
2119
  } else resolve(result);
2118
2120
  } else reject(value);
2119
2121
  } catch (error) {
@@ -2150,7 +2152,7 @@ var dispatchEvent = function (name, promise, reason) {
2150
2152
  };
2151
2153
 
2152
2154
  var onUnhandled = function (state) {
2153
- call$9(task, global$3, function () {
2155
+ call$a(task, global$3, function () {
2154
2156
  var promise = state.facade;
2155
2157
  var value = state.value;
2156
2158
  var IS_UNHANDLED = isUnhandled(state);
@@ -2173,7 +2175,7 @@ var isUnhandled = function (state) {
2173
2175
  };
2174
2176
 
2175
2177
  var onHandleUnhandled = function (state) {
2176
- call$9(task, global$3, function () {
2178
+ call$a(task, global$3, function () {
2177
2179
  var promise = state.facade;
2178
2180
  if (IS_NODE) {
2179
2181
  process.emit('rejectionHandled', promise);
@@ -2207,7 +2209,7 @@ var internalResolve = function (state, value, unwrap) {
2207
2209
  microtask(function () {
2208
2210
  var wrapper = { done: false };
2209
2211
  try {
2210
- call$9(then, value,
2212
+ call$a(then, value,
2211
2213
  bind$2(internalResolve, wrapper, state),
2212
2214
  bind$2(internalReject, wrapper, state)
2213
2215
  );
@@ -2231,7 +2233,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2231
2233
  PromiseConstructor = function Promise(executor) {
2232
2234
  anInstance$1(this, PromisePrototype);
2233
2235
  aCallable$8(executor);
2234
- call$9(Internal, this);
2236
+ call$a(Internal, this);
2235
2237
  var state = getInternalPromiseState(this);
2236
2238
  try {
2237
2239
  executor(bind$2(internalResolve, state), bind$2(internalReject, state));
@@ -2258,7 +2260,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2258
2260
 
2259
2261
  // `Promise.prototype.then` method
2260
2262
  // https://tc39.es/ecma262/#sec-promise.prototype.then
2261
- Internal.prototype = defineBuiltIn$3(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2263
+ Internal.prototype = defineBuiltIn$4(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2262
2264
  var state = getInternalPromiseState(this);
2263
2265
  var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2264
2266
  state.parent = true;
@@ -2291,10 +2293,10 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2291
2293
 
2292
2294
  if (!NATIVE_PROMISE_SUBCLASSING) {
2293
2295
  // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2294
- defineBuiltIn$3(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2296
+ defineBuiltIn$4(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2295
2297
  var that = this;
2296
2298
  return new PromiseConstructor(function (resolve, reject) {
2297
- call$9(nativeThen, that, resolve, reject);
2299
+ call$a(nativeThen, that, resolve, reject);
2298
2300
  }).then(onFulfilled, onRejected);
2299
2301
  // https://github.com/zloirock/core-js/issues/640
2300
2302
  }, { unsafe: true });
@@ -2346,9 +2348,9 @@ var getIteratorMethod$2 = function (it) {
2346
2348
  || Iterators[classof$2(it)];
2347
2349
  };
2348
2350
 
2349
- var call$8 = functionCall;
2351
+ var call$9 = functionCall;
2350
2352
  var aCallable$7 = aCallable$d;
2351
- var anObject$c = anObject$g;
2353
+ var anObject$e = anObject$i;
2352
2354
  var tryToString$1 = tryToString$4;
2353
2355
  var getIteratorMethod$1 = getIteratorMethod$2;
2354
2356
 
@@ -2356,41 +2358,41 @@ var $TypeError$3 = TypeError;
2356
2358
 
2357
2359
  var getIterator$1 = function (argument, usingIterator) {
2358
2360
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2359
- if (aCallable$7(iteratorMethod)) return anObject$c(call$8(iteratorMethod, argument));
2361
+ if (aCallable$7(iteratorMethod)) return anObject$e(call$9(iteratorMethod, argument));
2360
2362
  throw new $TypeError$3(tryToString$1(argument) + ' is not iterable');
2361
2363
  };
2362
2364
 
2363
- var call$7 = functionCall;
2364
- var anObject$b = anObject$g;
2365
+ var call$8 = functionCall;
2366
+ var anObject$d = anObject$i;
2365
2367
  var getMethod$1 = getMethod$4;
2366
2368
 
2367
2369
  var iteratorClose$3 = function (iterator, kind, value) {
2368
2370
  var innerResult, innerError;
2369
- anObject$b(iterator);
2371
+ anObject$d(iterator);
2370
2372
  try {
2371
2373
  innerResult = getMethod$1(iterator, 'return');
2372
2374
  if (!innerResult) {
2373
2375
  if (kind === 'throw') throw value;
2374
2376
  return value;
2375
2377
  }
2376
- innerResult = call$7(innerResult, iterator);
2378
+ innerResult = call$8(innerResult, iterator);
2377
2379
  } catch (error) {
2378
2380
  innerError = true;
2379
2381
  innerResult = error;
2380
2382
  }
2381
2383
  if (kind === 'throw') throw value;
2382
2384
  if (innerError) throw innerResult;
2383
- anObject$b(innerResult);
2385
+ anObject$d(innerResult);
2384
2386
  return value;
2385
2387
  };
2386
2388
 
2387
2389
  var bind$1 = functionBindContext;
2388
- var call$6 = functionCall;
2389
- var anObject$a = anObject$g;
2390
+ var call$7 = functionCall;
2391
+ var anObject$c = anObject$i;
2390
2392
  var tryToString = tryToString$4;
2391
2393
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
2392
2394
  var lengthOfArrayLike$2 = lengthOfArrayLike$5;
2393
- var isPrototypeOf$1 = objectIsPrototypeOf;
2395
+ var isPrototypeOf$2 = objectIsPrototypeOf;
2394
2396
  var getIterator = getIterator$1;
2395
2397
  var getIteratorMethod = getIteratorMethod$2;
2396
2398
  var iteratorClose$2 = iteratorClose$3;
@@ -2420,7 +2422,7 @@ var iterate$5 = function (iterable, unboundFunction, options) {
2420
2422
 
2421
2423
  var callFn = function (value) {
2422
2424
  if (AS_ENTRIES) {
2423
- anObject$a(value);
2425
+ anObject$c(value);
2424
2426
  return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2425
2427
  } return INTERRUPTED ? fn(value, stop) : fn(value);
2426
2428
  };
@@ -2436,20 +2438,20 @@ var iterate$5 = function (iterable, unboundFunction, options) {
2436
2438
  if (isArrayIteratorMethod(iterFn)) {
2437
2439
  for (index = 0, length = lengthOfArrayLike$2(iterable); length > index; index++) {
2438
2440
  result = callFn(iterable[index]);
2439
- if (result && isPrototypeOf$1(ResultPrototype, result)) return result;
2441
+ if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
2440
2442
  } return new Result(false);
2441
2443
  }
2442
2444
  iterator = getIterator(iterable, iterFn);
2443
2445
  }
2444
2446
 
2445
2447
  next = IS_RECORD ? iterable.next : iterator.next;
2446
- while (!(step = call$6(next, iterator)).done) {
2448
+ while (!(step = call$7(next, iterator)).done) {
2447
2449
  try {
2448
2450
  result = callFn(step.value);
2449
2451
  } catch (error) {
2450
2452
  iteratorClose$2(iterator, 'throw', error);
2451
2453
  }
2452
- if (typeof result == 'object' && result && isPrototypeOf$1(ResultPrototype, result)) return result;
2454
+ if (typeof result == 'object' && result && isPrototypeOf$2(ResultPrototype, result)) return result;
2453
2455
  } return new Result(false);
2454
2456
  };
2455
2457
 
@@ -2503,7 +2505,7 @@ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCor
2503
2505
  });
2504
2506
 
2505
2507
  var $$f = _export;
2506
- var call$5 = functionCall;
2508
+ var call$6 = functionCall;
2507
2509
  var aCallable$6 = aCallable$d;
2508
2510
  var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2509
2511
  var perform$1 = perform$3;
@@ -2527,7 +2529,7 @@ $$f({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
2527
2529
  var index = counter++;
2528
2530
  var alreadyCalled = false;
2529
2531
  remaining++;
2530
- call$5($promiseResolve, C, promise).then(function (value) {
2532
+ call$6($promiseResolve, C, promise).then(function (value) {
2531
2533
  if (alreadyCalled) return;
2532
2534
  alreadyCalled = true;
2533
2535
  values[index] = value;
@@ -2546,7 +2548,7 @@ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2546
2548
  var NativePromiseConstructor = promiseNativeConstructor;
2547
2549
  var getBuiltIn$2 = getBuiltIn$9;
2548
2550
  var isCallable$6 = isCallable$n;
2549
- var defineBuiltIn$2 = defineBuiltIn$5;
2551
+ var defineBuiltIn$3 = defineBuiltIn$6;
2550
2552
 
2551
2553
  var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2552
2554
 
@@ -2562,12 +2564,12 @@ $$e({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real
2562
2564
  if (isCallable$6(NativePromiseConstructor)) {
2563
2565
  var method = getBuiltIn$2('Promise').prototype['catch'];
2564
2566
  if (NativePromisePrototype['catch'] !== method) {
2565
- defineBuiltIn$2(NativePromisePrototype, 'catch', method, { unsafe: true });
2567
+ defineBuiltIn$3(NativePromisePrototype, 'catch', method, { unsafe: true });
2566
2568
  }
2567
2569
  }
2568
2570
 
2569
2571
  var $$d = _export;
2570
- var call$4 = functionCall;
2572
+ var call$5 = functionCall;
2571
2573
  var aCallable$5 = aCallable$d;
2572
2574
  var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2573
2575
  var perform = perform$3;
@@ -2584,7 +2586,7 @@ $$d({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
2584
2586
  var result = perform(function () {
2585
2587
  var $promiseResolve = aCallable$5(C.resolve);
2586
2588
  iterate$3(iterable, function (promise) {
2587
- call$4($promiseResolve, C, promise).then(capability.resolve, reject);
2589
+ call$5($promiseResolve, C, promise).then(capability.resolve, reject);
2588
2590
  });
2589
2591
  });
2590
2592
  if (result.error) reject(result.value);
@@ -2607,12 +2609,12 @@ $$c({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2607
2609
  }
2608
2610
  });
2609
2611
 
2610
- var anObject$9 = anObject$g;
2612
+ var anObject$b = anObject$i;
2611
2613
  var isObject$3 = isObject$e;
2612
2614
  var newPromiseCapability = newPromiseCapability$2;
2613
2615
 
2614
2616
  var promiseResolve$1 = function (C, x) {
2615
- anObject$9(C);
2617
+ anObject$b(C);
2616
2618
  if (isObject$3(x) && x.constructor === C) return x;
2617
2619
  var promiseCapability = newPromiseCapability.f(C);
2618
2620
  var resolve = promiseCapability.resolve;
@@ -2718,9 +2720,9 @@ var getJsonReplacerFunction = function (replacer) {
2718
2720
  var $$a = _export;
2719
2721
  var getBuiltIn = getBuiltIn$9;
2720
2722
  var apply = functionApply;
2721
- var call$3 = functionCall;
2723
+ var call$4 = functionCall;
2722
2724
  var uncurryThis$2 = functionUncurryThis;
2723
- var fails$4 = fails$i;
2725
+ var fails$5 = fails$j;
2724
2726
  var isCallable$4 = isCallable$n;
2725
2727
  var isSymbol = isSymbol$3;
2726
2728
  var arraySlice = arraySlice$2;
@@ -2739,7 +2741,7 @@ var tester = /[\uD800-\uDFFF]/g;
2739
2741
  var low = /^[\uD800-\uDBFF]$/;
2740
2742
  var hi = /^[\uDC00-\uDFFF]$/;
2741
2743
 
2742
- var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$1 || fails$4(function () {
2744
+ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$1 || fails$5(function () {
2743
2745
  var symbol = getBuiltIn('Symbol')('stringify detection');
2744
2746
  // MS Edge converts symbol values to JSON as {}
2745
2747
  return $stringify([symbol]) !== '[null]'
@@ -2750,7 +2752,7 @@ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$1 || fails$4(function () {
2750
2752
  });
2751
2753
 
2752
2754
  // https://github.com/tc39/proposal-well-formed-stringify
2753
- var ILL_FORMED_UNICODE = fails$4(function () {
2755
+ var ILL_FORMED_UNICODE = fails$5(function () {
2754
2756
  return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
2755
2757
  || $stringify('\uDEAD') !== '"\\udead"';
2756
2758
  });
@@ -2761,7 +2763,7 @@ var stringifyWithSymbolsFix = function (it, replacer) {
2761
2763
  if (!isCallable$4($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
2762
2764
  args[1] = function (key, value) {
2763
2765
  // some old implementations (like WebKit) could pass numbers as keys
2764
- if (isCallable$4($replacer)) value = call$3($replacer, this, $String(key), value);
2766
+ if (isCallable$4($replacer)) value = call$4($replacer, this, $String(key), value);
2765
2767
  if (!isSymbol(value)) return value;
2766
2768
  };
2767
2769
  return apply($stringify, null, args);
@@ -2859,18 +2861,430 @@ class FluxoStateDispatcher {
2859
2861
  static dispatchSetSessionMode(mode) {
2860
2862
  state.store.dispatch(state.setMode(mode));
2861
2863
  }
2864
+ static dispatchSetNavigationMode(mode) {
2865
+ state.store.dispatch(state.setNavigationMode(mode));
2866
+ }
2862
2867
  static dispatchSetRoutes(routes) {
2863
2868
  state.store.dispatch(state.setRoutes(routes));
2864
2869
  }
2865
2870
  }
2866
2871
 
2872
+ var anObject$a = anObject$i;
2873
+
2874
+ // `RegExp.prototype.flags` getter implementation
2875
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
2876
+ var regexpFlags = function () {
2877
+ var that = anObject$a(this);
2878
+ var result = '';
2879
+ if (that.hasIndices) result += 'd';
2880
+ if (that.global) result += 'g';
2881
+ if (that.ignoreCase) result += 'i';
2882
+ if (that.multiline) result += 'm';
2883
+ if (that.dotAll) result += 's';
2884
+ if (that.unicode) result += 'u';
2885
+ if (that.unicodeSets) result += 'v';
2886
+ if (that.sticky) result += 'y';
2887
+ return result;
2888
+ };
2889
+
2890
+ var call$3 = functionCall;
2891
+ var hasOwn$3 = hasOwnProperty_1;
2892
+ var isPrototypeOf$1 = objectIsPrototypeOf;
2893
+ var regExpFlags = regexpFlags;
2894
+
2895
+ var RegExpPrototype$1 = RegExp.prototype;
2896
+
2897
+ var regexpGetFlags = function (R) {
2898
+ var flags = R.flags;
2899
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$3(R, 'flags') && isPrototypeOf$1(RegExpPrototype$1, R)
2900
+ ? call$3(regExpFlags, R) : flags;
2901
+ };
2902
+
2903
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
2904
+ var defineBuiltIn$2 = defineBuiltIn$6;
2905
+ var anObject$9 = anObject$i;
2906
+ var $toString = toString$4;
2907
+ var fails$4 = fails$j;
2908
+ var getRegExpFlags = regexpGetFlags;
2909
+
2910
+ var TO_STRING = 'toString';
2911
+ var RegExpPrototype = RegExp.prototype;
2912
+ var nativeToString = RegExpPrototype[TO_STRING];
2913
+
2914
+ var NOT_GENERIC = fails$4(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
2915
+ // FF44- RegExp#toString has a wrong name
2916
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
2917
+
2918
+ // `RegExp.prototype.toString` method
2919
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
2920
+ if (NOT_GENERIC || INCORRECT_NAME) {
2921
+ defineBuiltIn$2(RegExpPrototype, TO_STRING, function toString() {
2922
+ var R = anObject$9(this);
2923
+ var pattern = $toString(R.source);
2924
+ var flags = $toString(getRegExpFlags(R));
2925
+ return '/' + pattern + '/' + flags;
2926
+ }, { unsafe: true });
2927
+ }
2928
+
2929
+ // Costanti per la gestione del lock
2930
+ const LOCK_TIMEOUT_MS = 10000; // 10 secondi di timeout per il lock
2931
+ const LOCK_KEY = 'auth_refresh_lock';
2932
+ const HEARTBEAT_INTERVAL_MS = 5000; // Heartbeat ogni 5 secondi
2933
+ const LOCK_CLEANUP_INTERVAL_MS = 15000; // Pulizia lock orfani ogni 15 secondi
2934
+ class TabSyncAuthManager {
2935
+ constructor(refreshAction, onErrorCallback) {
2936
+ this.refreshTimeout = null;
2937
+ this.heartbeatInterval = null;
2938
+ this.lockCleanupInterval = null;
2939
+ this.isDestroyed = false;
2940
+ this.tabId = this.generateTabId();
2941
+ this.refreshTokenAction = refreshAction;
2942
+ this.onErrorCallback = onErrorCallback;
2943
+ console.log(`🔄 TabSyncAuthManager: Inizializzazione tab ${this.tabId}`);
2944
+ // Inizializza Broadcast Channel con fallback per browser vecchi
2945
+ this.broadcastChannel = this.initBroadcastChannel();
2946
+ // Setup degli interval per heartbeat e cleanup
2947
+ this.setupIntervals();
2948
+ // Setup event listeners
2949
+ this.setupEventListeners();
2950
+ }
2951
+ static Init(refreshAction, onErrorCallback) {
2952
+ if (!this._instance) {
2953
+ this._instance = new TabSyncAuthManager(refreshAction, onErrorCallback);
2954
+ }
2955
+ }
2956
+ static get Instance() {
2957
+ if (!this._instance) {
2958
+ throw new Error('TabSyncAuthManager not initialized');
2959
+ }
2960
+ return this._instance;
2961
+ }
2962
+ generateTabId() {
2963
+ return `tab_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
2964
+ }
2965
+ initBroadcastChannel() {
2966
+ try {
2967
+ const channel = new BroadcastChannel('fluxo-auth-sync');
2968
+ console.log(`🔄 TabSyncAuthManager: BroadcastChannel inizializzato per tab ${this.tabId}`);
2969
+ return channel;
2970
+ } catch (error) {
2971
+ console.warn('🔄 TabSyncAuthManager: BroadcastChannel non supportato, fallback a storage events');
2972
+ // Fallback: usa storage events (implementazione semplificata)
2973
+ throw new Error('BroadcastChannel not supported - fallback needed');
2974
+ }
2975
+ }
2976
+ setupIntervals() {
2977
+ // Heartbeat per indicare che il tab è ancora vivo
2978
+ this.heartbeatInterval = setInterval(() => {
2979
+ if (!this.isDestroyed) {
2980
+ this.sendHeartbeat();
2981
+ }
2982
+ }, HEARTBEAT_INTERVAL_MS);
2983
+ // Cleanup periodico dei lock orfani
2984
+ this.lockCleanupInterval = setInterval(() => {
2985
+ if (!this.isDestroyed) {
2986
+ this.cleanupOrphanedLocks();
2987
+ }
2988
+ }, LOCK_CLEANUP_INTERVAL_MS);
2989
+ }
2990
+ setupEventListeners() {
2991
+ // Ascolta messaggi da altri tab
2992
+ this.broadcastChannel.onmessage = event => {
2993
+ this.handleTabMessage(event.data);
2994
+ };
2995
+ // Cleanup quando il tab viene chiuso
2996
+ window.addEventListener('beforeunload', () => {
2997
+ this.destroy();
2998
+ });
2999
+ // Gestione visibilità per ottimizzazioni
3000
+ document.addEventListener('visibilitychange', () => {
3001
+ if (document.visibilityState === 'visible') {
3002
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} tornato visibile`);
3003
+ // Potenziale sync quando il tab torna visibile
3004
+ this.syncWithStoredToken();
3005
+ }
3006
+ });
3007
+ }
3008
+ handleTabMessage(message) {
3009
+ if (message.tabId === this.tabId) {
3010
+ return; // Ignora i propri messaggi
3011
+ }
3012
+ //console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} ricevuto messaggio:`, message.type, `da tab ${message.tabId}`);
3013
+ switch (message.type) {
3014
+ case 'TOKEN_REFRESHED':
3015
+ this.handleTokenRefreshed(message);
3016
+ break;
3017
+ case 'TOKEN_REFRESH_FAILED':
3018
+ this.handleTokenRefreshFailed(message);
3019
+ break;
3020
+ }
3021
+ }
3022
+ handleTokenRefreshed(message) {
3023
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} sincronizzazione con nuovo token`);
3024
+ // Cancella il timeout locale se in corso
3025
+ if (this.refreshTimeout) {
3026
+ clearTimeout(this.refreshTimeout);
3027
+ this.refreshTimeout = null;
3028
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} timeout cancellato, token già aggiornato da altro tab`);
3029
+ }
3030
+ // Sincronizza con il nuovo token e riavvia il timer
3031
+ this.syncWithStoredToken();
3032
+ this.scheduleNextRefresh();
3033
+ }
3034
+ handleTokenRefreshFailed(message) {
3035
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} refresh fallito su altro tab, eseguo logout`);
3036
+ this.onErrorCallback();
3037
+ }
3038
+ syncWithStoredToken() {
3039
+ // Verifica che il token in localStorage sia ancora valido
3040
+ const token = localStorage.getItem(LocalStorageConstants.accessToken);
3041
+ if (!token) {
3042
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} nessun token trovato durante sync`);
3043
+ return;
3044
+ }
3045
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} sincronizzato con token esistente`);
3046
+ }
3047
+ startRefreshTimer(timeoutMs) {
3048
+ return __awaiter(this, void 0, void 0, function* () {
3049
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} timer refresh impostato per ${timeoutMs}ms`);
3050
+ if (this.refreshTimeout) {
3051
+ clearTimeout(this.refreshTimeout);
3052
+ }
3053
+ this.refreshTimeout = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
3054
+ yield this.coordinatedRefresh();
3055
+ }), timeoutMs);
3056
+ });
3057
+ }
3058
+ stopRefreshTimer() {
3059
+ if (this.refreshTimeout) {
3060
+ clearTimeout(this.refreshTimeout);
3061
+ this.refreshTimeout = null;
3062
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} timer refresh fermato`);
3063
+ }
3064
+ }
3065
+ // Metodi per compatibilità con RefreshTokenManager
3066
+ start(timeoutMs) {
3067
+ this.startRefreshTimer(timeoutMs);
3068
+ }
3069
+ stop() {
3070
+ this.stopRefreshTimer();
3071
+ }
3072
+ coordinatedRefresh() {
3073
+ return __awaiter(this, void 0, void 0, function* () {
3074
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} tentativo di acquisizione lock per refresh`);
3075
+ if (yield this.acquireLock()) {
3076
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} lock acquisito, eseguo refresh`);
3077
+ try {
3078
+ const success = yield this.refreshTokenAction();
3079
+ if (success) {
3080
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} refresh completato con successo`);
3081
+ this.broadcastMessage({
3082
+ type: 'TOKEN_REFRESHED',
3083
+ tabId: this.tabId,
3084
+ timestamp: Date.now()
3085
+ });
3086
+ this.scheduleNextRefresh();
3087
+ } else {
3088
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} refresh fallito`);
3089
+ this.broadcastMessage({
3090
+ type: 'TOKEN_REFRESH_FAILED',
3091
+ tabId: this.tabId,
3092
+ timestamp: Date.now()
3093
+ });
3094
+ }
3095
+ } catch (error) {
3096
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} errore durante refresh`, error);
3097
+ this.broadcastMessage({
3098
+ type: 'TOKEN_REFRESH_FAILED',
3099
+ tabId: this.tabId,
3100
+ timestamp: Date.now()
3101
+ });
3102
+ } finally {
3103
+ this.releaseLock();
3104
+ }
3105
+ } else {
3106
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} lock non acquisito, aspetto aggiornamento da altro tab`);
3107
+ // Non fa nulla, aspetta che il tab che ha il lock completi il refresh
3108
+ // Il timer verrà reimpostato quando riceverà TOKEN_REFRESHED
3109
+ }
3110
+ });
3111
+ }
3112
+ acquireLock() {
3113
+ return __awaiter(this, void 0, void 0, function* () {
3114
+ const maxRetries = 3;
3115
+ const retryDelayMs = 50; // Piccolo delay tra retry
3116
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
3117
+ if (yield this.tryAcquireLockOnce()) {
3118
+ return true;
3119
+ }
3120
+ // Piccolo delay random per evitare sincronizzazione
3121
+ yield new Promise(resolve => setTimeout(resolve, retryDelayMs + Math.random() * 20));
3122
+ }
3123
+ return false;
3124
+ });
3125
+ }
3126
+ tryAcquireLockOnce() {
3127
+ return __awaiter(this, void 0, void 0, function* () {
3128
+ const now = Date.now();
3129
+ const lockData = {
3130
+ tabId: this.tabId,
3131
+ timestamp: now,
3132
+ expiresAt: now + LOCK_TIMEOUT_MS
3133
+ };
3134
+ try {
3135
+ // FASE 1: Controllo se esiste già un lock valido
3136
+ const existingLockStr = localStorage.getItem(LOCK_KEY);
3137
+ if (existingLockStr) {
3138
+ try {
3139
+ const existingLock = JSON.parse(existingLockStr);
3140
+ // Se il lock non è scaduto e non è il nostro, non possiamo acquisirlo
3141
+ if (existingLock.expiresAt > now && existingLock.tabId !== this.tabId) {
3142
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} lock già occupato da tab ${existingLock.tabId} (scade in ${existingLock.expiresAt - now}ms)`);
3143
+ return false;
3144
+ }
3145
+ } catch (parseError) {
3146
+ console.warn(`🔄 TabSyncAuthManager: Tab ${this.tabId} lock corrotto, procedo con acquisizione`);
3147
+ // Lock corrotto, procediamo con l'acquisizione
3148
+ }
3149
+ }
3150
+ // FASE 2: Tentativo di acquisizione con timestamp unico
3151
+ const uniqueLockData = Object.assign(Object.assign({}, lockData), {
3152
+ timestamp: now + Math.random() // Timestamp leggermente diverso per evitare collisioni
3153
+ });
3154
+ localStorage.setItem(LOCK_KEY, JSON.stringify(uniqueLockData));
3155
+ // FASE 3: Verifica IMMEDIATA che il lock sia nostro
3156
+ // Piccolo delay per permettere ad altri tab di scrivere
3157
+ yield new Promise(resolve => setTimeout(resolve, 10));
3158
+ const verifyLockStr = localStorage.getItem(LOCK_KEY);
3159
+ if (!verifyLockStr) {
3160
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} lock scomparso durante verifica`);
3161
+ return false;
3162
+ }
3163
+ try {
3164
+ const verifyLock = JSON.parse(verifyLockStr);
3165
+ // Verifica che il tabId sia esattamente il nostro
3166
+ if (verifyLock.tabId === this.tabId) {
3167
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} lock acquisito con successo (timestamp: ${verifyLock.timestamp})`);
3168
+ return true;
3169
+ } else {
3170
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} lock perso, ora appartiene a tab ${verifyLock.tabId}`);
3171
+ return false;
3172
+ }
3173
+ } catch (parseError) {
3174
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} errore parsing verifica lock`, parseError);
3175
+ return false;
3176
+ }
3177
+ } catch (error) {
3178
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} errore durante acquisizione lock`, error);
3179
+ return false;
3180
+ }
3181
+ });
3182
+ }
3183
+ releaseLock() {
3184
+ try {
3185
+ const lockStr = localStorage.getItem(LOCK_KEY);
3186
+ if (lockStr) {
3187
+ const lock = JSON.parse(lockStr);
3188
+ if (lock.tabId === this.tabId) {
3189
+ localStorage.removeItem(LOCK_KEY);
3190
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} lock rilasciato`);
3191
+ }
3192
+ }
3193
+ } catch (error) {
3194
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} errore durante rilascio lock`, error);
3195
+ }
3196
+ }
3197
+ cleanupOrphanedLocks() {
3198
+ try {
3199
+ const lockStr = localStorage.getItem(LOCK_KEY);
3200
+ if (lockStr) {
3201
+ const lock = JSON.parse(lockStr);
3202
+ const now = Date.now();
3203
+ if (lock.expiresAt < now) {
3204
+ localStorage.removeItem(LOCK_KEY);
3205
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} rimosso lock orfano di tab ${lock.tabId}`);
3206
+ }
3207
+ }
3208
+ } catch (error) {
3209
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} errore durante cleanup lock`, error);
3210
+ }
3211
+ }
3212
+ scheduleNextRefresh() {
3213
+ // Calcola il tempo rimanente per il prossimo refresh
3214
+ const remainingLifetimeMs = this.getJwtTokenRemainingLifetime();
3215
+ if (remainingLifetimeMs) {
3216
+ const timeoutMs = remainingLifetimeMs - 30000; // 30 secondi di margine
3217
+ if (timeoutMs > 0) {
3218
+ this.startRefreshTimer(timeoutMs);
3219
+ } else {
3220
+ // Token scade molto presto, refresh immediato
3221
+ setTimeout(() => this.coordinatedRefresh(), 1000);
3222
+ }
3223
+ }
3224
+ }
3225
+ getJwtTokenRemainingLifetime() {
3226
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} calcolo tempo rimanente del token`);
3227
+ const token = localStorage.getItem(LocalStorageConstants.accessToken);
3228
+ if (!token) {
3229
+ console.warn(`🔄 TabSyncAuthManager: Tab ${this.tabId} nessun access token trovato`);
3230
+ return null;
3231
+ }
3232
+ try {
3233
+ const decoded = o(token);
3234
+ const expTimeInSeconds = decoded.exp;
3235
+ const currentTimeInMs = Date.now();
3236
+ const expTimeInMs = expTimeInSeconds * 1000;
3237
+ const diffMs = expTimeInMs - currentTimeInMs;
3238
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} token scade in ${diffMs}ms (${Math.round(diffMs / 1000 / 60)} minuti)`);
3239
+ return diffMs <= 0 ? 0 : diffMs;
3240
+ } catch (error) {
3241
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} errore decodifica JWT token`, error);
3242
+ return null;
3243
+ }
3244
+ }
3245
+ sendHeartbeat() {
3246
+ // Riduco il logging degli heartbeat per evitare spam
3247
+ this.broadcastMessage({
3248
+ type: 'HEARTBEAT',
3249
+ tabId: this.tabId,
3250
+ timestamp: Date.now()
3251
+ });
3252
+ }
3253
+ broadcastMessage(message) {
3254
+ try {
3255
+ this.broadcastChannel.postMessage(message);
3256
+ } catch (error) {
3257
+ console.error(`🔄 TabSyncAuthManager: Tab ${this.tabId} errore durante broadcast`, error);
3258
+ }
3259
+ }
3260
+ destroy() {
3261
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} distruzione in corso`);
3262
+ this.isDestroyed = true;
3263
+ // Ferma tutti i timer
3264
+ this.stopRefreshTimer();
3265
+ if (this.heartbeatInterval) {
3266
+ clearInterval(this.heartbeatInterval);
3267
+ this.heartbeatInterval = null;
3268
+ }
3269
+ if (this.lockCleanupInterval) {
3270
+ clearInterval(this.lockCleanupInterval);
3271
+ this.lockCleanupInterval = null;
3272
+ }
3273
+ // Rilascia il lock se lo abbiamo
3274
+ this.releaseLock();
3275
+ // Chiudi il broadcast channel
3276
+ this.broadcastChannel.close();
3277
+ console.log(`🔄 TabSyncAuthManager: Tab ${this.tabId} distrutto`);
3278
+ }
3279
+ }
3280
+
2867
3281
  // Costanti per la gestione del refresh token
2868
3282
  const REFRESH_TOKEN_SAFETY_MARGIN_MS = 30000; // 30 secondi prima della scadenza
2869
3283
  class AuthService {
2870
3284
  constructor() {
2871
3285
  this.isRefreshingToken = false;
2872
3286
  console.log("🔐 AuthService: Inizializzazione");
2873
- RefreshTokenManager.Init(() => this.refreshToken(), () => this.logout());
3287
+ TabSyncAuthManager.Init(() => this.refreshToken(), () => this.logout());
2874
3288
  }
2875
3289
  setup() {
2876
3290
  return __awaiter(this, void 0, void 0, function* () {
@@ -2879,6 +3293,22 @@ class AuthService {
2879
3293
  console.log("🔐 AuthService: Setup completato");
2880
3294
  });
2881
3295
  }
3296
+ getProfile() {
3297
+ return __awaiter(this, void 0, void 0, function* () {
3298
+ console.log("🔐 AuthService: Recupero profilo utente");
3299
+ try {
3300
+ const response = yield HttpClient.Instance().client.get('/identity/me', {
3301
+ withCredentials: true
3302
+ });
3303
+ const data = response;
3304
+ console.log("🔐 AuthService: Profilo utente recuperato con successo");
3305
+ return data;
3306
+ } catch (error) {
3307
+ console.error("🔐 AuthService: Errore durante il recupero del profilo utente", error);
3308
+ return null;
3309
+ }
3310
+ });
3311
+ }
2882
3312
  tryAutoLogin() {
2883
3313
  return __awaiter(this, void 0, void 0, function* () {
2884
3314
  console.log("🔐 AuthService: Tentativo di auto-login");
@@ -2908,7 +3338,7 @@ class AuthService {
2908
3338
  if (remainingLifetimeMs) {
2909
3339
  const timeoutMs = remainingLifetimeMs - REFRESH_TOKEN_SAFETY_MARGIN_MS;
2910
3340
  console.log(`🔐 AuthService: Tempo rimanente: ${remainingLifetimeMs}ms, imposto refresh tra ${timeoutMs}ms`);
2911
- RefreshTokenManager.Instance.start(timeoutMs);
3341
+ TabSyncAuthManager.Instance.start(timeoutMs);
2912
3342
  } else {
2913
3343
  console.log("🔐 AuthService: Impossibile calcolare tempo rimanente per il token");
2914
3344
  }
@@ -2939,6 +3369,14 @@ class AuthService {
2939
3369
  withCredentials: true
2940
3370
  });
2941
3371
  const data = response;
3372
+ if (data.requiresTwoFactor) {
3373
+ console.warn("🔐 AuthService: Login richiede autenticazione a due fattori.");
3374
+ return {
3375
+ success: false,
3376
+ require2FA: true,
3377
+ userId: data.userId
3378
+ };
3379
+ }
2942
3380
  console.log("🔐 AuthService: Login riuscito, token ricevuto");
2943
3381
  localStorage.setItem(LocalStorageConstants.accessToken, data.token);
2944
3382
  localStorage.setItem(LocalStorageConstants.userData, JSON.stringify(data.userData));
@@ -2947,7 +3385,7 @@ class AuthService {
2947
3385
  if (remainingLifetimeMs) {
2948
3386
  const timeoutMs = remainingLifetimeMs - REFRESH_TOKEN_SAFETY_MARGIN_MS;
2949
3387
  console.log(`🔐 AuthService: Imposto refresh token tra ${timeoutMs}ms`);
2950
- RefreshTokenManager.Instance.start(timeoutMs);
3388
+ TabSyncAuthManager.Instance.start(timeoutMs);
2951
3389
  } else {
2952
3390
  console.log("🔐 AuthService: Impossibile calcolare tempo rimanente per il token");
2953
3391
  }
@@ -2955,17 +3393,129 @@ class AuthService {
2955
3393
  FluxoStateDispatcher.dispatchUserLogin({
2956
3394
  data
2957
3395
  });
2958
- return true;
3396
+ return {
3397
+ success: true,
3398
+ require2FA: false,
3399
+ userId: data.userId
3400
+ };
2959
3401
  } catch (error) {
2960
3402
  console.error("🔐 AuthService: Errore durante il login", error);
2961
3403
  FluxoStateDispatcher.dispatchUserLogin(null);
3404
+ return {
3405
+ success: false,
3406
+ require2FA: false,
3407
+ userId: ''
3408
+ };
3409
+ }
3410
+ });
3411
+ }
3412
+ verify2FA(code, userId) {
3413
+ return __awaiter(this, void 0, void 0, function* () {
3414
+ console.log("🔐 AuthService: Tentativo di verifica 2FA");
3415
+ try {
3416
+ console.log("🔐 AuthService: Invio codice 2FA per verifica");
3417
+ const response = yield HttpClient.Instance().client.post('/identity/verify-2fa', {
3418
+ code,
3419
+ userId
3420
+ }, {
3421
+ withCredentials: true
3422
+ });
3423
+ const data = response;
3424
+ console.log("🔐 AuthService: Verifica 2FA riuscita, token ricevuto");
3425
+ localStorage.setItem(LocalStorageConstants.accessToken, data.token);
3426
+ localStorage.setItem(LocalStorageConstants.userData, JSON.stringify(data.userData));
3427
+ console.log("🔐 AuthService: Token e dati utente salvati in localStorage");
3428
+ const remainingLifetimeMs = AuthService.getJwtTokenRemainingLifetime();
3429
+ if (remainingLifetimeMs) {
3430
+ const timeoutMs = remainingLifetimeMs - REFRESH_TOKEN_SAFETY_MARGIN_MS;
3431
+ console.log(`🔐 AuthService: Imposto refresh token tra ${timeoutMs}ms`);
3432
+ TabSyncAuthManager.Instance.start(timeoutMs);
3433
+ } else {
3434
+ console.log("🔐 AuthService: Impossibile calcolare tempo rimanente per il token");
3435
+ }
3436
+ console.log("🔐 AuthService: Dispatch evento login utente dopo verifica 2FA");
3437
+ FluxoStateDispatcher.dispatchUserLogin({
3438
+ data
3439
+ });
3440
+ return true;
3441
+ } catch (error) {
3442
+ console.error("🔐 AuthService: Errore durante la verifica 2FA", error);
3443
+ FluxoStateDispatcher.dispatchUserLogin(null);
2962
3444
  return false;
2963
3445
  }
2964
3446
  });
2965
3447
  }
3448
+ enable2FA(userId) {
3449
+ return __awaiter(this, void 0, void 0, function* () {
3450
+ console.log("🔐 AuthService: Tentativo di abilitazione 2FA");
3451
+ try {
3452
+ console.log("🔐 AuthService: Invio richiesta di abilitazione 2FA");
3453
+ const response = yield HttpClient.Instance().client.post('/identity/enable-2fa', {
3454
+ userId
3455
+ }, {
3456
+ withCredentials: true
3457
+ });
3458
+ const data = response;
3459
+ console.log("🔐 AuthService: 2FA abilitata con successo, QR code e chiave condivisa ricevuti");
3460
+ return data;
3461
+ } catch (error) {
3462
+ console.error("🔐 AuthService: Errore durante l'abilitazione 2FA", error);
3463
+ return null;
3464
+ }
3465
+ });
3466
+ }
3467
+ confirmEnable2FA(code, userId) {
3468
+ return __awaiter(this, void 0, void 0, function* () {
3469
+ console.log("🔐 AuthService: Tentativo di conferma abilitazione 2FA");
3470
+ try {
3471
+ console.log("🔐 AuthService: Invio codice 2FA per conferma abilitazione");
3472
+ const response = yield HttpClient.Instance().client.post('/identity/confirm-2fa', {
3473
+ code,
3474
+ userId
3475
+ }, {
3476
+ withCredentials: true
3477
+ });
3478
+ const data = response;
3479
+ console.log("🔐 AuthService: Abilitazione 2FA confermata con successo, codici di recupero ricevuti");
3480
+ return data;
3481
+ } catch (error) {
3482
+ console.error("🔐 AuthService: Errore durante la conferma abilitazione 2FA", error);
3483
+ throw error;
3484
+ }
3485
+ });
3486
+ }
3487
+ disable2FA(userId) {
3488
+ console.log("🔐 AuthService: Tentativo di disabilitazione 2FA");
3489
+ return HttpClient.Instance().client.post('/identity/disable-2fa', {
3490
+ userId
3491
+ }, {
3492
+ withCredentials: true
3493
+ }).then(() => {
3494
+ console.log("🔐 AuthService: 2FA disabilitata con successo");
3495
+ return true;
3496
+ }).catch(error => {
3497
+ console.error("🔐 AuthService: Errore durante la disabilitazione 2FA", error);
3498
+ return false;
3499
+ });
3500
+ }
3501
+ updateSecurityPolicyInfo(userId, info) {
3502
+ console.log("🔐 AuthService: Aggiornamento informazioni policy di sicurezza");
3503
+ return HttpClient.Instance().client.post('/identity/securitypolicy', {
3504
+ userId,
3505
+ canChangePassword: info.canChangePassword,
3506
+ canHandle2FA: info.canHandle2FA
3507
+ }, {
3508
+ withCredentials: true
3509
+ }).then(() => {
3510
+ console.log("🔐 AuthService: Informazioni policy di sicurezza aggiornate con successo");
3511
+ }).catch(error => {
3512
+ console.error("🔐 AuthService: Errore durante l'aggiornamento delle informazioni della policy di sicurezza", error);
3513
+ throw error;
3514
+ });
3515
+ }
2966
3516
  logout() {
2967
3517
  console.log("🔐 AuthService: Esecuzione logout");
2968
- RefreshTokenManager.Instance.stop();
3518
+ TabSyncAuthManager.Instance.stop();
2969
3519
  localStorage.removeItem(LocalStorageConstants.accessToken);
2970
3520
  localStorage.removeItem(LocalStorageConstants.userData);
2971
3521
  console.log("🔐 AuthService: Token e dati utente rimossi da localStorage");
@@ -2992,13 +3542,13 @@ class AuthService {
2992
3542
  localStorage.setItem(LocalStorageConstants.accessToken, data.token);
2993
3543
  localStorage.setItem(LocalStorageConstants.userData, JSON.stringify(data.userData));
2994
3544
  console.log("🔐 AuthService: Nuovo token e dati utente salvati in localStorage");
2995
- RefreshTokenManager.Instance.stop();
3545
+ TabSyncAuthManager.Instance.stop();
2996
3546
  console.log("🔐 AuthService: Timeout precedente fermato");
2997
3547
  const remainingLifetimeMs = AuthService.getJwtTokenRemainingLifetime();
2998
3548
  if (remainingLifetimeMs) {
2999
3549
  const timeoutMs = remainingLifetimeMs - REFRESH_TOKEN_SAFETY_MARGIN_MS;
3000
3550
  console.log(`🔐 AuthService: Imposto nuovo refresh token tra ${timeoutMs}ms`);
3001
- RefreshTokenManager.Instance.start(timeoutMs);
3551
+ TabSyncAuthManager.Instance.start(timeoutMs);
3002
3552
  } else {
3003
3553
  console.log("🔐 AuthService: Impossibile calcolare tempo rimanente per il nuovo token");
3004
3554
  }
@@ -3035,74 +3585,18 @@ class AuthService {
3035
3585
  }
3036
3586
  }
3037
3587
  }
3038
- class RefreshTokenManager {
3039
- constructor(refreshAction, onErrorCallback) {
3040
- this._refreshTokenTimeout = null;
3041
- console.log("🔄 RefreshTokenManager: Inizializzazione");
3042
- this._refreshTokenAction = refreshAction;
3043
- this._onErrorCallback = onErrorCallback;
3588
+
3589
+ exports.FluxoACLMode = void 0;
3590
+ (function (FluxoACLMode) {
3591
+ FluxoACLMode[FluxoACLMode["DomainRole"] = 1] = "DomainRole";
3592
+ FluxoACLMode[FluxoACLMode["Permission"] = 2] = "Permission";
3593
+ })(exports.FluxoACLMode || (exports.FluxoACLMode = {}));
3594
+ class ConfigurationService {
3595
+ getInitialConfiguration() {
3596
+ return HttpClient.Instance().client.get(`client/initial`);
3044
3597
  }
3045
- static Init(refreshAction, onErrorCallback) {
3046
- console.log("🔄 RefreshTokenManager: Init chiamato");
3047
- if (!this._instance) {
3048
- console.log("🔄 RefreshTokenManager: Creazione nuova istanza");
3049
- this._instance = new RefreshTokenManager(refreshAction, onErrorCallback);
3050
- } else {
3051
- console.log("🔄 RefreshTokenManager: Istanza già esistente");
3052
- }
3053
- }
3054
- static get Instance() {
3055
- if (!this._instance) {
3056
- console.error("🔄 RefreshTokenManager: Tentativo di accesso all'istanza prima dell'inizializzazione");
3057
- throw new Error('RefreshTokenManager not initialized');
3058
- }
3059
- return this._instance;
3060
- }
3061
- start(timeoutMs) {
3062
- // Arrotonda il timeout a un valore positivo
3063
- const safeTimeoutMs = Math.max(1000, Math.floor(timeoutMs));
3064
- console.log(`🔄 RefreshTokenManager: Avvio refresh token in: ${safeTimeoutMs}ms (${Math.round(safeTimeoutMs / 1000 / 60)} minuti)`);
3065
- // Assicuriamoci di fermare qualsiasi timeout precedente
3066
- this.stop();
3067
- this._refreshTokenTimeout = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
3068
- console.log("🔄 RefreshTokenManager: Timeout scaduto, esecuzione refresh token");
3069
- try {
3070
- const success = yield this._refreshTokenAction();
3071
- console.log(`🔄 RefreshTokenManager: Refresh token completato con ${success ? 'successo' : 'fallimento'}`);
3072
- if (!success) {
3073
- console.log("🔄 RefreshTokenManager: Chiamata callback di errore");
3074
- this._onErrorCallback();
3075
- }
3076
- } catch (error) {
3077
- console.error('🔄 RefreshTokenManager: Errore durante refresh token', error);
3078
- console.log("🔄 RefreshTokenManager: Chiamata callback di errore dopo eccezione");
3079
- this._onErrorCallback();
3080
- }
3081
- }), safeTimeoutMs);
3082
- }
3083
- stop() {
3084
- console.log('🔄 RefreshTokenManager: Stop refresh token');
3085
- if (this._refreshTokenTimeout) {
3086
- console.log('🔄 RefreshTokenManager: Cancellazione timeout esistente');
3087
- clearTimeout(this._refreshTokenTimeout);
3088
- this._refreshTokenTimeout = null;
3089
- } else {
3090
- console.log('🔄 RefreshTokenManager: Nessun timeout attivo da cancellare');
3091
- }
3092
- }
3093
- }
3094
-
3095
- exports.FluxoACLMode = void 0;
3096
- (function (FluxoACLMode) {
3097
- FluxoACLMode[FluxoACLMode["DomainRole"] = 1] = "DomainRole";
3098
- FluxoACLMode[FluxoACLMode["Permission"] = 2] = "Permission";
3099
- })(exports.FluxoACLMode || (exports.FluxoACLMode = {}));
3100
- class ConfigurationService {
3101
- getInitialConfiguration() {
3102
- return HttpClient.Instance().client.get(`client/initial`);
3103
- }
3104
- deleteWebMenu(webMenuId) {
3105
- return HttpClient.Instance().client.delete(`client/menu/${webMenuId}/webapp`);
3598
+ deleteWebMenu(webMenuId) {
3599
+ return HttpClient.Instance().client.delete(`client/menu/${webMenuId}/webapp`);
3106
3600
  }
3107
3601
  getClientUi() {
3108
3602
  return HttpClient.Instance().client.get('client/ui');
@@ -3153,6 +3647,14 @@ class ConfigurationService {
3153
3647
  getAllDomainRoleFrontends() {
3154
3648
  return HttpClient.Instance().client.get(`client/frontend`);
3155
3649
  }
3650
+ getMultisessionUserState() {
3651
+ return HttpClient.Instance().client.get('client/multisession');
3652
+ }
3653
+ setMultisessionUserState(state) {
3654
+ return HttpClient.Instance().client.post('client/multisession', {
3655
+ state
3656
+ });
3657
+ }
3156
3658
  }
3157
3659
 
3158
3660
  class UserService {
@@ -3208,7 +3710,7 @@ class UserService {
3208
3710
  }
3209
3711
  }
3210
3712
 
3211
- var fails$3 = fails$i;
3713
+ var fails$3 = fails$j;
3212
3714
 
3213
3715
  var correctPrototypeGetter = !fails$3(function () {
3214
3716
  function F() { /* empty */ }
@@ -3253,7 +3755,7 @@ var objectDefineProperties = {};
3253
3755
  var DESCRIPTORS$2 = descriptors;
3254
3756
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
3255
3757
  var definePropertyModule = objectDefineProperty;
3256
- var anObject$8 = anObject$g;
3758
+ var anObject$8 = anObject$i;
3257
3759
  var toIndexedObject = toIndexedObject$4;
3258
3760
  var objectKeys = objectKeys$2;
3259
3761
 
@@ -3272,7 +3774,7 @@ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.de
3272
3774
  };
3273
3775
 
3274
3776
  /* global ActiveXObject -- old IE, WSH */
3275
- var anObject$7 = anObject$g;
3777
+ var anObject$7 = anObject$i;
3276
3778
  var definePropertiesModule = objectDefineProperties;
3277
3779
  var enumBugKeys = enumBugKeys$3;
3278
3780
  var hiddenKeys = hiddenKeys$4;
@@ -3355,11 +3857,11 @@ var objectCreate = Object.create || function create(O, Properties) {
3355
3857
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
3356
3858
  };
3357
3859
 
3358
- var fails$2 = fails$i;
3860
+ var fails$2 = fails$j;
3359
3861
  var isCallable$2 = isCallable$n;
3360
3862
  var isObject$2 = isObject$e;
3361
3863
  var getPrototypeOf$1 = objectGetPrototypeOf;
3362
- var defineBuiltIn$1 = defineBuiltIn$5;
3864
+ var defineBuiltIn$1 = defineBuiltIn$6;
3363
3865
  var wellKnownSymbol$6 = wellKnownSymbol$h;
3364
3866
 
3365
3867
  var ITERATOR$1 = wellKnownSymbol$6('iterator');
@@ -3401,12 +3903,12 @@ var iteratorsCore = {
3401
3903
  var $$9 = _export;
3402
3904
  var global$2 = global$k;
3403
3905
  var anInstance = anInstance$2;
3404
- var anObject$6 = anObject$g;
3906
+ var anObject$6 = anObject$i;
3405
3907
  var isCallable$1 = isCallable$n;
3406
3908
  var getPrototypeOf = objectGetPrototypeOf;
3407
3909
  var defineBuiltInAccessor$1 = defineBuiltInAccessor$3;
3408
3910
  var createProperty = createProperty$1;
3409
- var fails$1 = fails$i;
3911
+ var fails$1 = fails$j;
3410
3912
  var hasOwn$1 = hasOwnProperty_1;
3411
3913
  var wellKnownSymbol$5 = wellKnownSymbol$h;
3412
3914
  var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
@@ -3474,7 +3976,7 @@ var getIteratorDirect$5 = function (obj) {
3474
3976
  var $$8 = _export;
3475
3977
  var iterate$2 = iterate$5;
3476
3978
  var aCallable$4 = aCallable$d;
3477
- var anObject$5 = anObject$g;
3979
+ var anObject$5 = anObject$i;
3478
3980
  var getIteratorDirect$4 = getIteratorDirect$5;
3479
3981
 
3480
3982
  // `Iterator.prototype.forEach` method
@@ -3491,6 +3993,141 @@ $$8({ target: 'Iterator', proto: true, real: true }, {
3491
3993
  }
3492
3994
  });
3493
3995
 
3996
+ var defineBuiltIn = defineBuiltIn$6;
3997
+
3998
+ var defineBuiltIns$1 = function (target, src, options) {
3999
+ for (var key in src) defineBuiltIn(target, key, src[key], options);
4000
+ return target;
4001
+ };
4002
+
4003
+ // `CreateIterResultObject` abstract operation
4004
+ // https://tc39.es/ecma262/#sec-createiterresultobject
4005
+ var createIterResultObject$1 = function (value, done) {
4006
+ return { value: value, done: done };
4007
+ };
4008
+
4009
+ var call$2 = functionCall;
4010
+ var create$1 = objectCreate;
4011
+ var createNonEnumerableProperty = createNonEnumerableProperty$6;
4012
+ var defineBuiltIns = defineBuiltIns$1;
4013
+ var wellKnownSymbol$4 = wellKnownSymbol$h;
4014
+ var InternalStateModule = internalState;
4015
+ var getMethod = getMethod$4;
4016
+ var IteratorPrototype = iteratorsCore.IteratorPrototype;
4017
+ var createIterResultObject = createIterResultObject$1;
4018
+ var iteratorClose$1 = iteratorClose$3;
4019
+
4020
+ var TO_STRING_TAG = wellKnownSymbol$4('toStringTag');
4021
+ var ITERATOR_HELPER = 'IteratorHelper';
4022
+ var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
4023
+ var setInternalState = InternalStateModule.set;
4024
+
4025
+ var createIteratorProxyPrototype = function (IS_ITERATOR) {
4026
+ var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
4027
+
4028
+ return defineBuiltIns(create$1(IteratorPrototype), {
4029
+ next: function next() {
4030
+ var state = getInternalState(this);
4031
+ // for simplification:
4032
+ // for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject`
4033
+ // for `%IteratorHelperPrototype%.next` - just a value
4034
+ if (IS_ITERATOR) return state.nextHandler();
4035
+ try {
4036
+ var result = state.done ? undefined : state.nextHandler();
4037
+ return createIterResultObject(result, state.done);
4038
+ } catch (error) {
4039
+ state.done = true;
4040
+ throw error;
4041
+ }
4042
+ },
4043
+ 'return': function () {
4044
+ var state = getInternalState(this);
4045
+ var iterator = state.iterator;
4046
+ state.done = true;
4047
+ if (IS_ITERATOR) {
4048
+ var returnMethod = getMethod(iterator, 'return');
4049
+ return returnMethod ? call$2(returnMethod, iterator) : createIterResultObject(undefined, true);
4050
+ }
4051
+ if (state.inner) try {
4052
+ iteratorClose$1(state.inner.iterator, 'normal');
4053
+ } catch (error) {
4054
+ return iteratorClose$1(iterator, 'throw', error);
4055
+ }
4056
+ iteratorClose$1(iterator, 'normal');
4057
+ return createIterResultObject(undefined, true);
4058
+ }
4059
+ });
4060
+ };
4061
+
4062
+ var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
4063
+ var IteratorHelperPrototype = createIteratorProxyPrototype(false);
4064
+
4065
+ createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
4066
+
4067
+ var iteratorCreateProxy = function (nextHandler, IS_ITERATOR) {
4068
+ var IteratorProxy = function Iterator(record, state) {
4069
+ if (state) {
4070
+ state.iterator = record.iterator;
4071
+ state.next = record.next;
4072
+ } else state = record;
4073
+ state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
4074
+ state.nextHandler = nextHandler;
4075
+ state.counter = 0;
4076
+ state.done = false;
4077
+ setInternalState(this, state);
4078
+ };
4079
+
4080
+ IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
4081
+
4082
+ return IteratorProxy;
4083
+ };
4084
+
4085
+ var anObject$4 = anObject$i;
4086
+ var iteratorClose = iteratorClose$3;
4087
+
4088
+ // call something on iterator step with safe closing on error
4089
+ var callWithSafeIterationClosing$2 = function (iterator, fn, value, ENTRIES) {
4090
+ try {
4091
+ return ENTRIES ? fn(anObject$4(value)[0], value[1]) : fn(value);
4092
+ } catch (error) {
4093
+ iteratorClose(iterator, 'throw', error);
4094
+ }
4095
+ };
4096
+
4097
+ var call$1 = functionCall;
4098
+ var aCallable$3 = aCallable$d;
4099
+ var anObject$3 = anObject$i;
4100
+ var getIteratorDirect$3 = getIteratorDirect$5;
4101
+ var createIteratorProxy$1 = iteratorCreateProxy;
4102
+ var callWithSafeIterationClosing$1 = callWithSafeIterationClosing$2;
4103
+
4104
+ var IteratorProxy$1 = createIteratorProxy$1(function () {
4105
+ var iterator = this.iterator;
4106
+ var result = anObject$3(call$1(this.next, iterator));
4107
+ var done = this.done = !!result.done;
4108
+ if (!done) return callWithSafeIterationClosing$1(iterator, this.mapper, [result.value, this.counter++], true);
4109
+ });
4110
+
4111
+ // `Iterator.prototype.map` method
4112
+ // https://github.com/tc39/proposal-iterator-helpers
4113
+ var iteratorMap = function map(mapper) {
4114
+ anObject$3(this);
4115
+ aCallable$3(mapper);
4116
+ return new IteratorProxy$1(getIteratorDirect$3(this), {
4117
+ mapper: mapper
4118
+ });
4119
+ };
4120
+
4121
+ var $$7 = _export;
4122
+ var map = iteratorMap;
4123
+ var IS_PURE$1 = isPure;
4124
+
4125
+ // `Iterator.prototype.map` method
4126
+ // https://github.com/tc39/proposal-iterator-helpers
4127
+ $$7({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
4128
+ map: map
4129
+ });
4130
+
3494
4131
  class BaseCommonService {
3495
4132
  get baseApiPath() {
3496
4133
  return this._baseApiPath;
@@ -3498,13 +4135,17 @@ class BaseCommonService {
3498
4135
  constructor(baseApiPath) {
3499
4136
  this._baseApiPath = baseApiPath;
3500
4137
  }
3501
- find(take, skip, filters, include, namedFilters, orderBy) {
3502
- let url = `/${this._baseApiPath}?take=${take}&skip=${skip}${filters ? `&filter=${encodeURIComponent(filters)}` : ''}${include ? `&includes=${encodeURIComponent(include)}` : ''}${orderBy ? `&orderBy=${encodeURIComponent(orderBy)}` : ''}`;
4138
+ find(take, skip, filters, include, namedFilters, sort) {
4139
+ let url = `/${this._baseApiPath}?take=${take}&skip=${skip}${filters ? `&filter=${encodeURIComponent(filters)}` : ''}${include ? `&includes=${encodeURIComponent(include)}` : ''}`;
3503
4140
  if (namedFilters) {
3504
4141
  namedFilters.forEach(filter => {
3505
4142
  url += `&${filter.key}=${filter.value}`;
3506
4143
  });
3507
4144
  }
4145
+ if (sort && sort.length > 0) {
4146
+ const orderBy = sort.map(s => `${s.selector} ${s.desc ? 'desc' : 'asc'}`).join(',');
4147
+ url += `&orderBy=${encodeURIComponent(orderBy)}`;
4148
+ }
3508
4149
  return HttpClient.Instance().client.get(url);
3509
4150
  }
3510
4151
  create(entity) {
@@ -3762,9 +4403,9 @@ var flattenIntoArray_1 = flattenIntoArray$1;
3762
4403
  var isArray = isArray$4;
3763
4404
  var isConstructor = isConstructor$2;
3764
4405
  var isObject$1 = isObject$e;
3765
- var wellKnownSymbol$4 = wellKnownSymbol$h;
4406
+ var wellKnownSymbol$3 = wellKnownSymbol$h;
3766
4407
 
3767
- var SPECIES = wellKnownSymbol$4('species');
4408
+ var SPECIES = wellKnownSymbol$3('species');
3768
4409
  var $Array = Array;
3769
4410
 
3770
4411
  // a part of `ArraySpeciesCreate` abstract operation
@@ -3790,7 +4431,7 @@ var arraySpeciesCreate$1 = function (originalArray, length) {
3790
4431
  return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
3791
4432
  };
3792
4433
 
3793
- var $$7 = _export;
4434
+ var $$6 = _export;
3794
4435
  var flattenIntoArray = flattenIntoArray_1;
3795
4436
  var toObject = toObject$5;
3796
4437
  var lengthOfArrayLike = lengthOfArrayLike$5;
@@ -3799,7 +4440,7 @@ var arraySpeciesCreate = arraySpeciesCreate$1;
3799
4440
 
3800
4441
  // `Array.prototype.flat` method
3801
4442
  // https://tc39.es/ecma262/#sec-array.prototype.flat
3802
- $$7({ target: 'Array', proto: true }, {
4443
+ $$6({ target: 'Array', proto: true }, {
3803
4444
  flat: function flat(/* depthArg = 1 */) {
3804
4445
  var depthArg = arguments.length ? arguments[0] : undefined;
3805
4446
  var O = toObject(this);
@@ -3810,11 +4451,11 @@ $$7({ target: 'Array', proto: true }, {
3810
4451
  }
3811
4452
  });
3812
4453
 
3813
- var wellKnownSymbol$3 = wellKnownSymbol$h;
3814
- var create$1 = objectCreate;
4454
+ var wellKnownSymbol$2 = wellKnownSymbol$h;
4455
+ var create = objectCreate;
3815
4456
  var defineProperty = objectDefineProperty.f;
3816
4457
 
3817
- var UNSCOPABLES = wellKnownSymbol$3('unscopables');
4458
+ var UNSCOPABLES = wellKnownSymbol$2('unscopables');
3818
4459
  var ArrayPrototype = Array.prototype;
3819
4460
 
3820
4461
  // Array.prototype[@@unscopables]
@@ -3822,7 +4463,7 @@ var ArrayPrototype = Array.prototype;
3822
4463
  if (ArrayPrototype[UNSCOPABLES] === undefined) {
3823
4464
  defineProperty(ArrayPrototype, UNSCOPABLES, {
3824
4465
  configurable: true,
3825
- value: create$1(null)
4466
+ value: create(null)
3826
4467
  });
3827
4468
  }
3828
4469
 
@@ -3838,180 +4479,45 @@ var addToUnscopables$1 = addToUnscopables$2;
3838
4479
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3839
4480
  addToUnscopables$1('flat');
3840
4481
 
3841
- var defineBuiltIn = defineBuiltIn$5;
3842
-
3843
- var defineBuiltIns$1 = function (target, src, options) {
3844
- for (var key in src) defineBuiltIn(target, key, src[key], options);
3845
- return target;
3846
- };
3847
-
3848
- // `CreateIterResultObject` abstract operation
3849
- // https://tc39.es/ecma262/#sec-createiterresultobject
3850
- var createIterResultObject$1 = function (value, done) {
3851
- return { value: value, done: done };
3852
- };
3853
-
3854
- var call$2 = functionCall;
3855
- var create = objectCreate;
3856
- var createNonEnumerableProperty = createNonEnumerableProperty$6;
3857
- var defineBuiltIns = defineBuiltIns$1;
3858
- var wellKnownSymbol$2 = wellKnownSymbol$h;
3859
- var InternalStateModule = internalState;
3860
- var getMethod = getMethod$4;
3861
- var IteratorPrototype = iteratorsCore.IteratorPrototype;
3862
- var createIterResultObject = createIterResultObject$1;
3863
- var iteratorClose$1 = iteratorClose$3;
3864
-
3865
- var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
3866
- var ITERATOR_HELPER = 'IteratorHelper';
3867
- var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
3868
- var setInternalState = InternalStateModule.set;
3869
-
3870
- var createIteratorProxyPrototype = function (IS_ITERATOR) {
3871
- var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
3872
-
3873
- return defineBuiltIns(create(IteratorPrototype), {
3874
- next: function next() {
3875
- var state = getInternalState(this);
3876
- // for simplification:
3877
- // for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject`
3878
- // for `%IteratorHelperPrototype%.next` - just a value
3879
- if (IS_ITERATOR) return state.nextHandler();
3880
- try {
3881
- var result = state.done ? undefined : state.nextHandler();
3882
- return createIterResultObject(result, state.done);
3883
- } catch (error) {
3884
- state.done = true;
3885
- throw error;
3886
- }
3887
- },
3888
- 'return': function () {
3889
- var state = getInternalState(this);
3890
- var iterator = state.iterator;
3891
- state.done = true;
3892
- if (IS_ITERATOR) {
3893
- var returnMethod = getMethod(iterator, 'return');
3894
- return returnMethod ? call$2(returnMethod, iterator) : createIterResultObject(undefined, true);
3895
- }
3896
- if (state.inner) try {
3897
- iteratorClose$1(state.inner.iterator, 'normal');
3898
- } catch (error) {
3899
- return iteratorClose$1(iterator, 'throw', error);
3900
- }
3901
- iteratorClose$1(iterator, 'normal');
3902
- return createIterResultObject(undefined, true);
3903
- }
3904
- });
3905
- };
3906
-
3907
- var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
3908
- var IteratorHelperPrototype = createIteratorProxyPrototype(false);
3909
-
3910
- createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
3911
-
3912
- var iteratorCreateProxy = function (nextHandler, IS_ITERATOR) {
3913
- var IteratorProxy = function Iterator(record, state) {
3914
- if (state) {
3915
- state.iterator = record.iterator;
3916
- state.next = record.next;
3917
- } else state = record;
3918
- state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
3919
- state.nextHandler = nextHandler;
3920
- state.counter = 0;
3921
- state.done = false;
3922
- setInternalState(this, state);
3923
- };
3924
-
3925
- IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
3926
-
3927
- return IteratorProxy;
3928
- };
3929
-
3930
- var anObject$4 = anObject$g;
3931
- var iteratorClose = iteratorClose$3;
3932
-
3933
- // call something on iterator step with safe closing on error
3934
- var callWithSafeIterationClosing$2 = function (iterator, fn, value, ENTRIES) {
3935
- try {
3936
- return ENTRIES ? fn(anObject$4(value)[0], value[1]) : fn(value);
3937
- } catch (error) {
3938
- iteratorClose(iterator, 'throw', error);
3939
- }
3940
- };
3941
-
3942
- var $$6 = _export;
3943
- var call$1 = functionCall;
3944
- var aCallable$3 = aCallable$d;
3945
- var anObject$3 = anObject$g;
3946
- var getIteratorDirect$3 = getIteratorDirect$5;
3947
- var createIteratorProxy$1 = iteratorCreateProxy;
3948
- var callWithSafeIterationClosing$1 = callWithSafeIterationClosing$2;
3949
- var IS_PURE$1 = isPure;
4482
+ var $$5 = _export;
4483
+ var call = functionCall;
4484
+ var aCallable$2 = aCallable$d;
4485
+ var anObject$2 = anObject$i;
4486
+ var getIteratorDirect$2 = getIteratorDirect$5;
4487
+ var createIteratorProxy = iteratorCreateProxy;
4488
+ var callWithSafeIterationClosing = callWithSafeIterationClosing$2;
4489
+ var IS_PURE = isPure;
3950
4490
 
3951
- var IteratorProxy$1 = createIteratorProxy$1(function () {
4491
+ var IteratorProxy = createIteratorProxy(function () {
3952
4492
  var iterator = this.iterator;
3953
4493
  var predicate = this.predicate;
3954
4494
  var next = this.next;
3955
4495
  var result, done, value;
3956
4496
  while (true) {
3957
- result = anObject$3(call$1(next, iterator));
4497
+ result = anObject$2(call(next, iterator));
3958
4498
  done = this.done = !!result.done;
3959
4499
  if (done) return;
3960
4500
  value = result.value;
3961
- if (callWithSafeIterationClosing$1(iterator, predicate, [value, this.counter++], true)) return value;
4501
+ if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value;
3962
4502
  }
3963
4503
  });
3964
4504
 
3965
4505
  // `Iterator.prototype.filter` method
3966
4506
  // https://github.com/tc39/proposal-iterator-helpers
3967
- $$6({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
4507
+ $$5({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
3968
4508
  filter: function filter(predicate) {
3969
- anObject$3(this);
3970
- aCallable$3(predicate);
3971
- return new IteratorProxy$1(getIteratorDirect$3(this), {
4509
+ anObject$2(this);
4510
+ aCallable$2(predicate);
4511
+ return new IteratorProxy(getIteratorDirect$2(this), {
3972
4512
  predicate: predicate
3973
4513
  });
3974
4514
  }
3975
4515
  });
3976
4516
 
3977
- var call = functionCall;
3978
- var aCallable$2 = aCallable$d;
3979
- var anObject$2 = anObject$g;
3980
- var getIteratorDirect$2 = getIteratorDirect$5;
3981
- var createIteratorProxy = iteratorCreateProxy;
3982
- var callWithSafeIterationClosing = callWithSafeIterationClosing$2;
3983
-
3984
- var IteratorProxy = createIteratorProxy(function () {
3985
- var iterator = this.iterator;
3986
- var result = anObject$2(call(this.next, iterator));
3987
- var done = this.done = !!result.done;
3988
- if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
3989
- });
3990
-
3991
- // `Iterator.prototype.map` method
3992
- // https://github.com/tc39/proposal-iterator-helpers
3993
- var iteratorMap = function map(mapper) {
3994
- anObject$2(this);
3995
- aCallable$2(mapper);
3996
- return new IteratorProxy(getIteratorDirect$2(this), {
3997
- mapper: mapper
3998
- });
3999
- };
4000
-
4001
- var $$5 = _export;
4002
- var map = iteratorMap;
4003
- var IS_PURE = isPure;
4004
-
4005
- // `Iterator.prototype.map` method
4006
- // https://github.com/tc39/proposal-iterator-helpers
4007
- $$5({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
4008
- map: map
4009
- });
4010
-
4011
4517
  var $$4 = _export;
4012
4518
  var iterate$1 = iterate$5;
4013
4519
  var aCallable$1 = aCallable$d;
4014
- var anObject$1 = anObject$g;
4520
+ var anObject$1 = anObject$i;
4015
4521
  var getIteratorDirect$1 = getIteratorDirect$5;
4016
4522
 
4017
4523
  // `Iterator.prototype.some` method
@@ -4028,18 +4534,8 @@ $$4({ target: 'Iterator', proto: true, real: true }, {
4028
4534
  }
4029
4535
  });
4030
4536
 
4031
- const useIsomorphicEffect = typeof document !== "undefined" ? React.useLayoutEffect : React.useEffect;
4032
-
4033
- function useDocumentTitle(title) {
4034
- useIsomorphicEffect(() => {
4035
- if (typeof title === "string" && title.trim().length > 0) {
4036
- document.title = title.trim();
4037
- }
4038
- }, [title]);
4039
- }
4040
-
4041
4537
  function NavigationPage(props) {
4042
- useDocumentTitle(props.title);
4538
+ //useDocumentTitle(props.title);
4043
4539
  return jsxRuntime.jsx(jsxRuntime.Fragment, {
4044
4540
  children: props.component
4045
4541
  });
@@ -4726,7 +5222,7 @@ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototy
4726
5222
 
4727
5223
  var $$2 = _export;
4728
5224
  var $includes = arrayIncludes.includes;
4729
- var fails = fails$i;
5225
+ var fails = fails$j;
4730
5226
  var addToUnscopables = addToUnscopables$2;
4731
5227
 
4732
5228
  // FF99+ bug
@@ -4809,7 +5305,7 @@ $$1({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
4809
5305
  var $ = _export;
4810
5306
  var iterate = iterate$5;
4811
5307
  var aCallable = aCallable$d;
4812
- var anObject = anObject$g;
5308
+ var anObject = anObject$i;
4813
5309
  var getIteratorDirect = getIteratorDirect$5;
4814
5310
 
4815
5311
  // `Iterator.prototype.every` method