@bcrumbs.net/bc-shared 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -13,8 +13,9 @@ const InboxPortalRoot = '/inbox';
13
13
  const SearchPortalRoot = '/search';
14
14
  const BroadcastRoot = '/broadcast';
15
15
  const ResourcesRoot = '/resources';
16
+ const ManagemnetRoot = '/management';
16
17
  const ContactRoot = '/contact';
17
- const ContactLifeCycleRoot = '/contact-life-cycle';
18
+ const AiRoot = '/ai';
18
19
  const BCRoutes = {
19
20
  AccountDashboard: AccountPortalRoot,
20
21
  Subscriptions: `${AccountPortalRoot}/workspace`,
@@ -26,13 +27,16 @@ const BCRoutes = {
26
27
  Guide: `${AccountPortalRoot}/guide`,
27
28
  Welcome: `${AccountPortalRoot}/welcome`,
28
29
  Login: `${AccountPortalRoot}/login`,
30
+ // It should be like that while it's used by BC-API
29
31
  Register: `${AccountPortalRoot}/register`,
30
32
  Password: `${AccountPortalRoot}/reset/:token`,
31
33
  Profile: `${AccountPortalRoot}/profile`,
32
34
  Logout: `${AccountPortalRoot}/logout`,
33
35
  NotFound: `${AccountPortalRoot}/404`,
34
36
  Error: `/error`,
37
+ // It should be like that while it's used by BC-API
35
38
  NoPermissions: `/403`,
39
+ // It should be like that while it's used by BC-API
36
40
  ShowcaseDashboard: ShowcasePortalRoot,
37
41
  ShowcasePages: `${ShowcasePortalRoot}/pages`,
38
42
  ShowcaseSections: `${ShowcasePortalRoot}/pages/:pageId/:templateId/:modelId/sections`,
@@ -50,6 +54,17 @@ const BCRoutes = {
50
54
  PatchResource: `${ResourcesRoot}/patch`,
51
55
  DeleteResource: `${ResourcesRoot}/delete`,
52
56
  ResourcesNotFound: `${ResourcesRoot}/404`,
57
+ Ai: AiRoot,
58
+ AiPlayground: `${AiRoot}/playground`,
59
+ AiSourcesFiles: `${AiRoot}/sources/files`,
60
+ AiSourcesText: `${AiRoot}/sources/text`,
61
+ AiSourcesWebsites: `${AiRoot}/sources/websites`,
62
+ AiSourcesIntegrations: `${AiRoot}/sources/integrations`,
63
+ AiPreferencesModels: `${AiRoot}/preferences/models`,
64
+ AiPreferencesFineTuning: `${AiRoot}/preferences/fine-tuning`,
65
+ AiPreferencesPrompts: `${AiRoot}/preferences/prompts`,
66
+ AiPreferencesTestNumber: `${AiRoot}/preferences/test-number`,
67
+ AiPreferencesSuggestedQs: `${AiRoot}/preferences/suggested-qs`,
53
68
  Inbox: `${InboxPortalRoot}`,
54
69
  EmbeddedInbox: `${InboxPortalRoot}/embedded`,
55
70
  Broadcast: `${BroadcastRoot}`,
@@ -57,8 +72,18 @@ const BCRoutes = {
57
72
  BroadcastCreate: `${BroadcastRoot}/create`,
58
73
  ConvsSearch: `${SearchPortalRoot}`,
59
74
  Dashboard: `${Dashboard}`,
75
+ Managemnet: `${ManagemnetRoot}`,
76
+ AgentManagemnet: `${ManagemnetRoot}/agent`,
77
+ AiManagemnet: `${ManagemnetRoot}/ai`,
78
+ ApikeyManagemnet: `${ManagemnetRoot}/apikey`,
79
+ WebhookManagemnet: `${ManagemnetRoot}/webhook`,
80
+ ConvstageManagemnet: `${ManagemnetRoot}/convstage`,
81
+ IntegrationManagemnet: `${ManagemnetRoot}/integration`,
60
82
  Contact: `${ContactRoot}`,
61
- ContactLifeCycle: `${ContactLifeCycleRoot}`
83
+ ContactLifeCycle: `${ContactRoot}/contact-life-cycle`,
84
+ AiAutomation: `${ManagemnetRoot}/ai-automation`,
85
+ ConversationManagement: `${ManagemnetRoot}/conversation-management`,
86
+ Root: '/'
62
87
  };
63
88
 
64
89
  var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -6374,246 +6399,17 @@ if (process.env.NODE_ENV !== "production") {
6374
6399
  }
6375
6400
  }
6376
6401
 
6377
- var objectDefineProperties = {};
6378
-
6379
- var DESCRIPTORS$5 = descriptors;
6380
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
6381
- var definePropertyModule$1 = objectDefineProperty;
6382
- var anObject$7 = anObject$a;
6383
- var toIndexedObject$1 = toIndexedObject$5;
6384
- var objectKeys = objectKeys$2;
6385
-
6386
- // `Object.defineProperties` method
6387
- // https://tc39.es/ecma262/#sec-object.defineproperties
6388
- // eslint-disable-next-line es/no-object-defineproperties -- safe
6389
- objectDefineProperties.f = DESCRIPTORS$5 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
6390
- anObject$7(O);
6391
- var props = toIndexedObject$1(Properties);
6392
- var keys = objectKeys(Properties);
6393
- var length = keys.length;
6394
- var index = 0;
6395
- var key;
6396
- while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
6397
- return O;
6398
- };
6399
-
6400
- var getBuiltIn$3 = getBuiltIn$6;
6401
-
6402
- var html$1 = getBuiltIn$3('document', 'documentElement');
6403
-
6404
- /* global ActiveXObject -- old IE, WSH */
6405
- var anObject$6 = anObject$a;
6406
- var definePropertiesModule = objectDefineProperties;
6407
- var enumBugKeys = enumBugKeys$3;
6408
- var hiddenKeys = hiddenKeys$4;
6409
- var html = html$1;
6410
- var documentCreateElement$1 = documentCreateElement$2;
6411
- var sharedKey$1 = sharedKey$3;
6412
-
6413
- var GT = '>';
6414
- var LT = '<';
6415
- var PROTOTYPE = 'prototype';
6416
- var SCRIPT = 'script';
6417
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
6418
-
6419
- var EmptyConstructor = function () { /* empty */ };
6420
-
6421
- var scriptTag = function (content) {
6422
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
6423
- };
6424
-
6425
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
6426
- var NullProtoObjectViaActiveX = function (activeXDocument) {
6427
- activeXDocument.write(scriptTag(''));
6428
- activeXDocument.close();
6429
- var temp = activeXDocument.parentWindow.Object;
6430
- activeXDocument = null; // avoid memory leak
6431
- return temp;
6432
- };
6433
-
6434
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
6435
- var NullProtoObjectViaIFrame = function () {
6436
- // Thrash, waste and sodomy: IE GC bug
6437
- var iframe = documentCreateElement$1('iframe');
6438
- var JS = 'java' + SCRIPT + ':';
6439
- var iframeDocument;
6440
- iframe.style.display = 'none';
6441
- html.appendChild(iframe);
6442
- // https://github.com/zloirock/core-js/issues/475
6443
- iframe.src = String(JS);
6444
- iframeDocument = iframe.contentWindow.document;
6445
- iframeDocument.open();
6446
- iframeDocument.write(scriptTag('document.F=Object'));
6447
- iframeDocument.close();
6448
- return iframeDocument.F;
6449
- };
6450
-
6451
- // Check for document.domain and active x support
6452
- // No need to use active x approach when document.domain is not set
6453
- // see https://github.com/es-shims/es5-shim/issues/150
6454
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
6455
- // avoid IE GC bug
6456
- var activeXDocument;
6457
- var NullProtoObject = function () {
6458
- try {
6459
- activeXDocument = new ActiveXObject('htmlfile');
6460
- } catch (error) { /* ignore */ }
6461
- NullProtoObject = typeof document != 'undefined'
6462
- ? document.domain && activeXDocument
6463
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
6464
- : NullProtoObjectViaIFrame()
6465
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
6466
- var length = enumBugKeys.length;
6467
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
6468
- return NullProtoObject();
6469
- };
6470
-
6471
- hiddenKeys[IE_PROTO$1] = true;
6472
-
6473
- // `Object.create` method
6474
- // https://tc39.es/ecma262/#sec-object.create
6475
- // eslint-disable-next-line es/no-object-create -- safe
6476
- var objectCreate = Object.create || function create(O, Properties) {
6477
- var result;
6478
- if (O !== null) {
6479
- EmptyConstructor[PROTOTYPE] = anObject$6(O);
6480
- result = new EmptyConstructor();
6481
- EmptyConstructor[PROTOTYPE] = null;
6482
- // add "__proto__" for Object.getPrototypeOf polyfill
6483
- result[IE_PROTO$1] = O;
6484
- } else result = NullProtoObject();
6485
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
6486
- };
6487
-
6488
- var wellKnownSymbol$b = wellKnownSymbol$d;
6489
- var create$1 = objectCreate;
6490
- var defineProperty$4 = objectDefineProperty.f;
6491
-
6492
- var UNSCOPABLES = wellKnownSymbol$b('unscopables');
6493
- var ArrayPrototype$1 = Array.prototype;
6494
-
6495
- // Array.prototype[@@unscopables]
6496
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
6497
- if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
6498
- defineProperty$4(ArrayPrototype$1, UNSCOPABLES, {
6499
- configurable: true,
6500
- value: create$1(null)
6501
- });
6502
- }
6503
-
6504
- // add a key to Array.prototype[@@unscopables]
6505
- var addToUnscopables$2 = function (key) {
6506
- ArrayPrototype$1[UNSCOPABLES][key] = true;
6507
- };
6508
-
6509
- var iterators = {};
6510
-
6511
- var fails$8 = fails$i;
6512
-
6513
- var correctPrototypeGetter = !fails$8(function () {
6514
- function F() { /* empty */ }
6515
- F.prototype.constructor = null;
6516
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
6517
- return Object.getPrototypeOf(new F()) !== F.prototype;
6518
- });
6519
-
6520
- var hasOwn$3 = hasOwnProperty_1;
6521
- var isCallable$7 = isCallable$i;
6522
- var toObject$1 = toObject$4;
6523
- var sharedKey = sharedKey$3;
6524
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
6525
-
6526
- var IE_PROTO = sharedKey('IE_PROTO');
6527
- var $Object$1 = Object;
6528
- var ObjectPrototype = $Object$1.prototype;
6529
-
6530
- // `Object.getPrototypeOf` method
6531
- // https://tc39.es/ecma262/#sec-object.getprototypeof
6532
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
6533
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
6534
- var object = toObject$1(O);
6535
- if (hasOwn$3(object, IE_PROTO)) return object[IE_PROTO];
6536
- var constructor = object.constructor;
6537
- if (isCallable$7(constructor) && object instanceof constructor) {
6538
- return constructor.prototype;
6539
- } return object instanceof $Object$1 ? ObjectPrototype : null;
6540
- };
6541
-
6542
- var fails$7 = fails$i;
6543
- var isCallable$6 = isCallable$i;
6544
- var isObject$5 = isObject$b;
6545
- var getPrototypeOf$2 = objectGetPrototypeOf;
6546
- var defineBuiltIn$1 = defineBuiltIn$3;
6547
- var wellKnownSymbol$a = wellKnownSymbol$d;
6548
-
6549
- var ITERATOR$6 = wellKnownSymbol$a('iterator');
6550
- var BUGGY_SAFARI_ITERATORS$1 = false;
6551
-
6552
- // `%IteratorPrototype%` object
6553
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
6554
- var IteratorPrototype$3, PrototypeOfArrayIteratorPrototype, arrayIterator;
6402
+ var NATIVE_BIND$1 = functionBindNative;
6555
6403
 
6556
- /* eslint-disable es/no-array-prototype-keys -- safe */
6557
- if ([].keys) {
6558
- arrayIterator = [].keys();
6559
- // Safari 8 has buggy iterators w/o `next`
6560
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
6561
- else {
6562
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$2(getPrototypeOf$2(arrayIterator));
6563
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$3 = PrototypeOfArrayIteratorPrototype;
6564
- }
6565
- }
6404
+ var FunctionPrototype = Function.prototype;
6405
+ var apply$2 = FunctionPrototype.apply;
6406
+ var call$7 = FunctionPrototype.call;
6566
6407
 
6567
- var NEW_ITERATOR_PROTOTYPE = !isObject$5(IteratorPrototype$3) || fails$7(function () {
6568
- var test = {};
6569
- // FF44- legacy iterators case
6570
- return IteratorPrototype$3[ITERATOR$6].call(test) !== test;
6408
+ // eslint-disable-next-line es/no-reflect -- safe
6409
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$2) : function () {
6410
+ return call$7.apply(apply$2, arguments);
6571
6411
  });
6572
6412
 
6573
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$3 = {};
6574
-
6575
- // `%IteratorPrototype%[@@iterator]()` method
6576
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
6577
- if (!isCallable$6(IteratorPrototype$3[ITERATOR$6])) {
6578
- defineBuiltIn$1(IteratorPrototype$3, ITERATOR$6, function () {
6579
- return this;
6580
- });
6581
- }
6582
-
6583
- var iteratorsCore = {
6584
- IteratorPrototype: IteratorPrototype$3,
6585
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
6586
- };
6587
-
6588
- var defineProperty$3 = objectDefineProperty.f;
6589
- var hasOwn$2 = hasOwnProperty_1;
6590
- var wellKnownSymbol$9 = wellKnownSymbol$d;
6591
-
6592
- var TO_STRING_TAG$3 = wellKnownSymbol$9('toStringTag');
6593
-
6594
- var setToStringTag$3 = function (target, TAG, STATIC) {
6595
- if (target && !STATIC) target = target.prototype;
6596
- if (target && !hasOwn$2(target, TO_STRING_TAG$3)) {
6597
- defineProperty$3(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
6598
- }
6599
- };
6600
-
6601
- var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
6602
- var create = objectCreate;
6603
- var createPropertyDescriptor$2 = createPropertyDescriptor$5;
6604
- var setToStringTag$2 = setToStringTag$3;
6605
- var Iterators$4 = iterators;
6606
-
6607
- var returnThis$1 = function () { return this; };
6608
-
6609
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
6610
- var TO_STRING_TAG = NAME + ' Iterator';
6611
- IteratorConstructor.prototype = create(IteratorPrototype$2, { next: createPropertyDescriptor$2(+!ENUMERABLE_NEXT, next) });
6612
- setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
6613
- Iterators$4[TO_STRING_TAG] = returnThis$1;
6614
- return IteratorConstructor;
6615
- };
6616
-
6617
6413
  var uncurryThis$b = functionUncurryThis;
6618
6414
  var aCallable$4 = aCallable$6;
6619
6415
 
@@ -6624,10 +6420,10 @@ var functionUncurryThisAccessor = function (object, key, method) {
6624
6420
  } catch (error) { /* empty */ }
6625
6421
  };
6626
6422
 
6627
- var isObject$4 = isObject$b;
6423
+ var isObject$5 = isObject$b;
6628
6424
 
6629
6425
  var isPossiblePrototype$1 = function (argument) {
6630
- return isObject$4(argument) || argument === null;
6426
+ return isObject$5(argument) || argument === null;
6631
6427
  };
6632
6428
 
6633
6429
  var isPossiblePrototype = isPossiblePrototype$1;
@@ -6642,7 +6438,7 @@ var aPossiblePrototype$1 = function (argument) {
6642
6438
 
6643
6439
  /* eslint-disable no-proto -- safe */
6644
6440
  var uncurryThisAccessor$1 = functionUncurryThisAccessor;
6645
- var isObject$3 = isObject$b;
6441
+ var isObject$4 = isObject$b;
6646
6442
  var requireObjectCoercible$2 = requireObjectCoercible$5;
6647
6443
  var aPossiblePrototype = aPossiblePrototype$1;
6648
6444
 
@@ -6662,970 +6458,445 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
6662
6458
  return function setPrototypeOf(O, proto) {
6663
6459
  requireObjectCoercible$2(O);
6664
6460
  aPossiblePrototype(proto);
6665
- if (!isObject$3(O)) return O;
6461
+ if (!isObject$4(O)) return O;
6666
6462
  if (CORRECT_SETTER) setter(O, proto);
6667
6463
  else O.__proto__ = proto;
6668
6464
  return O;
6669
6465
  };
6670
6466
  }() : undefined);
6671
6467
 
6672
- var $$f = _export;
6673
- var call$7 = functionCall;
6674
- var FunctionName = functionName;
6675
- var isCallable$5 = isCallable$i;
6676
- var createIteratorConstructor = iteratorCreateConstructor;
6677
- var getPrototypeOf$1 = objectGetPrototypeOf;
6678
- var setPrototypeOf$2 = objectSetPrototypeOf;
6679
- var setToStringTag$1 = setToStringTag$3;
6680
- var createNonEnumerableProperty$4 = createNonEnumerableProperty$7;
6681
- var defineBuiltIn = defineBuiltIn$3;
6682
- var wellKnownSymbol$8 = wellKnownSymbol$d;
6683
- var Iterators$3 = iterators;
6684
- var IteratorsCore = iteratorsCore;
6468
+ var defineProperty$4 = objectDefineProperty.f;
6685
6469
 
6686
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
6687
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
6688
- var IteratorPrototype$1 = IteratorsCore.IteratorPrototype;
6689
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
6690
- var ITERATOR$5 = wellKnownSymbol$8('iterator');
6691
- var KEYS = 'keys';
6692
- var VALUES = 'values';
6693
- var ENTRIES = 'entries';
6470
+ var proxyAccessor$1 = function (Target, Source, key) {
6471
+ key in Target || defineProperty$4(Target, key, {
6472
+ configurable: true,
6473
+ get: function () { return Source[key]; },
6474
+ set: function (it) { Source[key] = it; }
6475
+ });
6476
+ };
6694
6477
 
6695
- var returnThis = function () { return this; };
6478
+ var isCallable$7 = isCallable$i;
6479
+ var isObject$3 = isObject$b;
6480
+ var setPrototypeOf$2 = objectSetPrototypeOf;
6696
6481
 
6697
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
6698
- createIteratorConstructor(IteratorConstructor, NAME, next);
6699
-
6700
- var getIterationMethod = function (KIND) {
6701
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
6702
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
6482
+ // makes subclassing work correct for wrapped built-ins
6483
+ var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
6484
+ var NewTarget, NewTargetPrototype;
6485
+ if (
6486
+ // it can work only with native `setPrototypeOf`
6487
+ setPrototypeOf$2 &&
6488
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
6489
+ isCallable$7(NewTarget = dummy.constructor) &&
6490
+ NewTarget !== Wrapper &&
6491
+ isObject$3(NewTargetPrototype = NewTarget.prototype) &&
6492
+ NewTargetPrototype !== Wrapper.prototype
6493
+ ) setPrototypeOf$2($this, NewTargetPrototype);
6494
+ return $this;
6495
+ };
6703
6496
 
6704
- switch (KIND) {
6705
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
6706
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
6707
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
6708
- }
6497
+ var wellKnownSymbol$b = wellKnownSymbol$d;
6709
6498
 
6710
- return function () { return new IteratorConstructor(this); };
6711
- };
6499
+ var TO_STRING_TAG$3 = wellKnownSymbol$b('toStringTag');
6500
+ var test = {};
6712
6501
 
6713
- var TO_STRING_TAG = NAME + ' Iterator';
6714
- var INCORRECT_VALUES_NAME = false;
6715
- var IterablePrototype = Iterable.prototype;
6716
- var nativeIterator = IterablePrototype[ITERATOR$5]
6717
- || IterablePrototype['@@iterator']
6718
- || DEFAULT && IterablePrototype[DEFAULT];
6719
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
6720
- var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
6721
- var CurrentIteratorPrototype, methods, KEY;
6502
+ test[TO_STRING_TAG$3] = 'z';
6722
6503
 
6723
- // fix native
6724
- if (anyNativeIterator) {
6725
- CurrentIteratorPrototype = getPrototypeOf$1(anyNativeIterator.call(new Iterable()));
6726
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
6727
- if (getPrototypeOf$1(CurrentIteratorPrototype) !== IteratorPrototype$1) {
6728
- if (setPrototypeOf$2) {
6729
- setPrototypeOf$2(CurrentIteratorPrototype, IteratorPrototype$1);
6730
- } else if (!isCallable$5(CurrentIteratorPrototype[ITERATOR$5])) {
6731
- defineBuiltIn(CurrentIteratorPrototype, ITERATOR$5, returnThis);
6732
- }
6733
- }
6734
- // Set @@toStringTag to native iterators
6735
- setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
6736
- }
6737
- }
6504
+ var toStringTagSupport = String(test) === '[object z]';
6738
6505
 
6739
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
6740
- if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
6741
- if (CONFIGURABLE_FUNCTION_NAME) {
6742
- createNonEnumerableProperty$4(IterablePrototype, 'name', VALUES);
6743
- } else {
6744
- INCORRECT_VALUES_NAME = true;
6745
- defaultIterator = function values() { return call$7(nativeIterator, this); };
6746
- }
6747
- }
6506
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
6507
+ var isCallable$6 = isCallable$i;
6508
+ var classofRaw$1 = classofRaw$2;
6509
+ var wellKnownSymbol$a = wellKnownSymbol$d;
6748
6510
 
6749
- // export additional methods
6750
- if (DEFAULT) {
6751
- methods = {
6752
- values: getIterationMethod(VALUES),
6753
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
6754
- entries: getIterationMethod(ENTRIES)
6755
- };
6756
- if (FORCED) for (KEY in methods) {
6757
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
6758
- defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
6759
- }
6760
- } else $$f({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
6761
- }
6511
+ var TO_STRING_TAG$2 = wellKnownSymbol$a('toStringTag');
6512
+ var $Object$1 = Object;
6762
6513
 
6763
- // define iterator
6764
- if (IterablePrototype[ITERATOR$5] !== defaultIterator) {
6765
- defineBuiltIn(IterablePrototype, ITERATOR$5, defaultIterator, { name: DEFAULT });
6766
- }
6767
- Iterators$3[NAME] = defaultIterator;
6514
+ // ES3 wrong here
6515
+ var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
6768
6516
 
6769
- return methods;
6517
+ // fallback for IE11 Script Access Denied error
6518
+ var tryGet = function (it, key) {
6519
+ try {
6520
+ return it[key];
6521
+ } catch (error) { /* empty */ }
6770
6522
  };
6771
6523
 
6772
- // `CreateIterResultObject` abstract operation
6773
- // https://tc39.es/ecma262/#sec-createiterresultobject
6774
- var createIterResultObject$1 = function (value, done) {
6775
- return { value: value, done: done };
6524
+ // getting tag from ES6+ `Object.prototype.toString`
6525
+ var classof$5 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
6526
+ var O, tag, result;
6527
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
6528
+ // @@toStringTag case
6529
+ : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$2)) == 'string' ? tag
6530
+ // builtinTag case
6531
+ : CORRECT_ARGUMENTS ? classofRaw$1(O)
6532
+ // ES3 arguments fallback
6533
+ : (result = classofRaw$1(O)) === 'Object' && isCallable$6(O.callee) ? 'Arguments' : result;
6776
6534
  };
6777
6535
 
6778
- var toIndexedObject = toIndexedObject$5;
6779
- var addToUnscopables$1 = addToUnscopables$2;
6780
- var Iterators$2 = iterators;
6781
- var InternalStateModule = internalState;
6782
- var defineProperty$2 = objectDefineProperty.f;
6783
- var defineIterator = iteratorDefine;
6784
- var createIterResultObject = createIterResultObject$1;
6785
- var DESCRIPTORS$4 = descriptors;
6786
-
6787
- var ARRAY_ITERATOR = 'Array Iterator';
6788
- var setInternalState = InternalStateModule.set;
6789
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
6536
+ var classof$4 = classof$5;
6790
6537
 
6791
- // `Array.prototype.entries` method
6792
- // https://tc39.es/ecma262/#sec-array.prototype.entries
6793
- // `Array.prototype.keys` method
6794
- // https://tc39.es/ecma262/#sec-array.prototype.keys
6795
- // `Array.prototype.values` method
6796
- // https://tc39.es/ecma262/#sec-array.prototype.values
6797
- // `Array.prototype[@@iterator]` method
6798
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
6799
- // `CreateArrayIterator` internal method
6800
- // https://tc39.es/ecma262/#sec-createarrayiterator
6801
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
6802
- setInternalState(this, {
6803
- type: ARRAY_ITERATOR,
6804
- target: toIndexedObject(iterated), // target
6805
- index: 0, // next index
6806
- kind: kind // kind
6807
- });
6808
- // `%ArrayIteratorPrototype%.next` method
6809
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
6810
- }, function () {
6811
- var state = getInternalState(this);
6812
- var target = state.target;
6813
- var index = state.index++;
6814
- if (!target || index >= target.length) {
6815
- state.target = undefined;
6816
- return createIterResultObject(undefined, true);
6817
- }
6818
- switch (state.kind) {
6819
- case 'keys': return createIterResultObject(index, false);
6820
- case 'values': return createIterResultObject(target[index], false);
6821
- } return createIterResultObject([index, target[index]], false);
6822
- }, 'values');
6538
+ var $String$1 = String;
6823
6539
 
6824
- // argumentsList[@@iterator] is %ArrayProto_values%
6825
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
6826
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
6827
- var values = Iterators$2.Arguments = Iterators$2.Array;
6540
+ var toString$5 = function (argument) {
6541
+ if (classof$4(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
6542
+ return $String$1(argument);
6543
+ };
6828
6544
 
6829
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
6830
- addToUnscopables$1('keys');
6831
- addToUnscopables$1('values');
6832
- addToUnscopables$1('entries');
6545
+ var toString$4 = toString$5;
6833
6546
 
6834
- // V8 ~ Chrome 45- bug
6835
- if (DESCRIPTORS$4 && values.name !== 'values') try {
6836
- defineProperty$2(values, 'name', { value: 'values' });
6837
- } catch (error) { /* empty */ }
6547
+ var normalizeStringArgument$1 = function (argument, $default) {
6548
+ return argument === undefined ? arguments.length < 2 ? '' : $default : toString$4(argument);
6549
+ };
6838
6550
 
6839
- var classof$5 = classofRaw$2;
6551
+ var isObject$2 = isObject$b;
6552
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$7;
6840
6553
 
6841
- // `IsArray` abstract operation
6842
- // https://tc39.es/ecma262/#sec-isarray
6843
- // eslint-disable-next-line es/no-array-isarray -- safe
6844
- var isArray$2 = Array.isArray || function isArray(argument) {
6845
- return classof$5(argument) === 'Array';
6554
+ // `InstallErrorCause` abstract operation
6555
+ // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
6556
+ var installErrorCause$1 = function (O, options) {
6557
+ if (isObject$2(options) && 'cause' in options) {
6558
+ createNonEnumerableProperty$4(O, 'cause', options.cause);
6559
+ }
6846
6560
  };
6847
6561
 
6848
- var DESCRIPTORS$3 = descriptors;
6849
- var isArray$1 = isArray$2;
6562
+ var uncurryThis$a = functionUncurryThis;
6850
6563
 
6851
- var $TypeError$7 = TypeError;
6852
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
6853
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
6564
+ var $Error = Error;
6565
+ var replace$2 = uncurryThis$a(''.replace);
6854
6566
 
6855
- // Safari < 13 does not throw an error in this case
6856
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$3 && !function () {
6857
- // makes no sense without proper strict mode support
6858
- if (this !== undefined) return true;
6859
- try {
6860
- // eslint-disable-next-line es/no-object-defineproperty -- safe
6861
- Object.defineProperty([], 'length', { writable: false }).length = 1;
6862
- } catch (error) {
6863
- return error instanceof TypeError;
6864
- }
6865
- }();
6567
+ var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
6568
+ // eslint-disable-next-line redos/no-vulnerable -- safe
6569
+ var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
6570
+ var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
6866
6571
 
6867
- var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
6868
- if (isArray$1(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
6869
- throw new $TypeError$7('Cannot set read only .length');
6870
- } return O.length = length;
6871
- } : function (O, length) {
6872
- return O.length = length;
6572
+ var errorStackClear = function (stack, dropEntries) {
6573
+ if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
6574
+ while (dropEntries--) stack = replace$2(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
6575
+ } return stack;
6873
6576
  };
6874
6577
 
6875
- var $TypeError$6 = TypeError;
6876
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
6578
+ var fails$8 = fails$i;
6579
+ var createPropertyDescriptor$2 = createPropertyDescriptor$5;
6877
6580
 
6878
- var doesNotExceedSafeInteger$1 = function (it) {
6879
- if (it > MAX_SAFE_INTEGER) throw $TypeError$6('Maximum allowed index exceeded');
6880
- return it;
6881
- };
6581
+ var errorStackInstallable = !fails$8(function () {
6582
+ var error = new Error('a');
6583
+ if (!('stack' in error)) return true;
6584
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
6585
+ Object.defineProperty(error, 'stack', createPropertyDescriptor$2(1, 7));
6586
+ return error.stack !== 7;
6587
+ });
6882
6588
 
6883
- var $$e = _export;
6884
- var toObject = toObject$4;
6885
- var lengthOfArrayLike$1 = lengthOfArrayLike$3;
6886
- var setArrayLength = arraySetLength;
6887
- var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
6888
- var fails$6 = fails$i;
6589
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$7;
6590
+ var clearErrorStack = errorStackClear;
6591
+ var ERROR_STACK_INSTALLABLE = errorStackInstallable;
6889
6592
 
6890
- var INCORRECT_TO_LENGTH = fails$6(function () {
6891
- return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
6892
- });
6593
+ // non-standard V8
6594
+ var captureStackTrace = Error.captureStackTrace;
6893
6595
 
6894
- // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
6895
- // https://bugs.chromium.org/p/v8/issues/detail?id=12681
6896
- var properErrorOnNonWritableLength = function () {
6897
- try {
6898
- // eslint-disable-next-line es/no-object-defineproperty -- safe
6899
- Object.defineProperty([], 'length', { writable: false }).push();
6900
- } catch (error) {
6901
- return error instanceof TypeError;
6596
+ var errorStackInstall = function (error, C, stack, dropEntries) {
6597
+ if (ERROR_STACK_INSTALLABLE) {
6598
+ if (captureStackTrace) captureStackTrace(error, C);
6599
+ else createNonEnumerableProperty$3(error, 'stack', clearErrorStack(stack, dropEntries));
6902
6600
  }
6903
6601
  };
6904
6602
 
6905
- var FORCED$3 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
6603
+ var getBuiltIn$3 = getBuiltIn$6;
6604
+ var hasOwn$3 = hasOwnProperty_1;
6605
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$7;
6606
+ var isPrototypeOf$2 = objectIsPrototypeOf;
6607
+ var setPrototypeOf$1 = objectSetPrototypeOf;
6608
+ var copyConstructorProperties = copyConstructorProperties$2;
6609
+ var proxyAccessor = proxyAccessor$1;
6610
+ var inheritIfRequired = inheritIfRequired$1;
6611
+ var normalizeStringArgument = normalizeStringArgument$1;
6612
+ var installErrorCause = installErrorCause$1;
6613
+ var installErrorStack = errorStackInstall;
6614
+ var DESCRIPTORS$5 = descriptors;
6906
6615
 
6907
- // `Array.prototype.push` method
6908
- // https://tc39.es/ecma262/#sec-array.prototype.push
6909
- $$e({ target: 'Array', proto: true, arity: 1, forced: FORCED$3 }, {
6910
- // eslint-disable-next-line no-unused-vars -- required for `.length`
6911
- push: function push(item) {
6912
- var O = toObject(this);
6913
- var len = lengthOfArrayLike$1(O);
6914
- var argCount = arguments.length;
6915
- doesNotExceedSafeInteger(len + argCount);
6916
- for (var i = 0; i < argCount; i++) {
6917
- O[len] = arguments[i];
6918
- len++;
6919
- }
6920
- setArrayLength(O, len);
6921
- return len;
6922
- }
6923
- });
6616
+ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
6617
+ var STACK_TRACE_LIMIT = 'stackTraceLimit';
6618
+ var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
6619
+ var path = FULL_NAME.split('.');
6620
+ var ERROR_NAME = path[path.length - 1];
6621
+ var OriginalError = getBuiltIn$3.apply(null, path);
6924
6622
 
6925
- // iterable DOM collections
6926
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
6927
- var domIterables = {
6928
- CSSRuleList: 0,
6929
- CSSStyleDeclaration: 0,
6930
- CSSValueList: 0,
6931
- ClientRectList: 0,
6932
- DOMRectList: 0,
6933
- DOMStringList: 0,
6934
- DOMTokenList: 1,
6935
- DataTransferItemList: 0,
6936
- FileList: 0,
6937
- HTMLAllCollection: 0,
6938
- HTMLCollection: 0,
6939
- HTMLFormElement: 0,
6940
- HTMLSelectElement: 0,
6941
- MediaList: 0,
6942
- MimeTypeArray: 0,
6943
- NamedNodeMap: 0,
6944
- NodeList: 1,
6945
- PaintRequestList: 0,
6946
- Plugin: 0,
6947
- PluginArray: 0,
6948
- SVGLengthList: 0,
6949
- SVGNumberList: 0,
6950
- SVGPathSegList: 0,
6951
- SVGPointList: 0,
6952
- SVGStringList: 0,
6953
- SVGTransformList: 0,
6954
- SourceBufferList: 0,
6955
- StyleSheetList: 0,
6956
- TextTrackCueList: 0,
6957
- TextTrackList: 0,
6958
- TouchList: 0
6959
- };
6623
+ if (!OriginalError) return;
6960
6624
 
6961
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
6962
- var documentCreateElement = documentCreateElement$2;
6625
+ var OriginalErrorPrototype = OriginalError.prototype;
6963
6626
 
6964
- var classList = documentCreateElement('span').classList;
6965
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
6627
+ // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
6628
+ if (hasOwn$3(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
6966
6629
 
6967
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
6630
+ if (!FORCED) return OriginalError;
6968
6631
 
6969
- var global$4 = global$f;
6970
- var DOMIterables = domIterables;
6971
- var DOMTokenListPrototype = domTokenListPrototype;
6972
- var ArrayIteratorMethods = es_array_iterator;
6973
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$7;
6974
- var setToStringTag = setToStringTag$3;
6975
- var wellKnownSymbol$7 = wellKnownSymbol$d;
6632
+ var BaseError = getBuiltIn$3('Error');
6976
6633
 
6977
- var ITERATOR$4 = wellKnownSymbol$7('iterator');
6978
- var ArrayValues = ArrayIteratorMethods.values;
6634
+ var WrappedError = wrapper(function (a, b) {
6635
+ var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
6636
+ var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
6637
+ if (message !== undefined) createNonEnumerableProperty$2(result, 'message', message);
6638
+ installErrorStack(result, WrappedError, result.stack, 2);
6639
+ if (this && isPrototypeOf$2(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
6640
+ if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
6641
+ return result;
6642
+ });
6979
6643
 
6980
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
6981
- if (CollectionPrototype) {
6982
- // some Chrome versions have non-configurable methods on DOMTokenList
6983
- if (CollectionPrototype[ITERATOR$4] !== ArrayValues) try {
6984
- createNonEnumerableProperty$3(CollectionPrototype, ITERATOR$4, ArrayValues);
6985
- } catch (error) {
6986
- CollectionPrototype[ITERATOR$4] = ArrayValues;
6987
- }
6988
- setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
6989
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
6990
- // some Chrome versions have non-configurable methods on DOMTokenList
6991
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
6992
- createNonEnumerableProperty$3(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
6993
- } catch (error) {
6994
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
6995
- }
6996
- }
6997
- }
6998
- };
6644
+ WrappedError.prototype = OriginalErrorPrototype;
6999
6645
 
7000
- for (var COLLECTION_NAME in DOMIterables) {
7001
- handlePrototype(global$4[COLLECTION_NAME] && global$4[COLLECTION_NAME].prototype, COLLECTION_NAME);
7002
- }
6646
+ if (ERROR_NAME !== 'Error') {
6647
+ if (setPrototypeOf$1) setPrototypeOf$1(WrappedError, BaseError);
6648
+ else copyConstructorProperties(WrappedError, BaseError, { name: true });
6649
+ } else if (DESCRIPTORS$5 && STACK_TRACE_LIMIT in OriginalError) {
6650
+ proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
6651
+ proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
6652
+ }
7003
6653
 
7004
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
6654
+ copyConstructorProperties(WrappedError, OriginalError);
7005
6655
 
7006
- function allSynchronously(resolvables) {
7007
- return __awaiter(this, void 0, void 0, function* () {
7008
- const results = [];
7009
- for (const resolvable of resolvables) {
7010
- results.push(yield resolvable());
6656
+ try {
6657
+ // Safari 13- bug: WebAssembly errors does not have a proper `.name`
6658
+ if (OriginalErrorPrototype.name !== ERROR_NAME) {
6659
+ createNonEnumerableProperty$2(OriginalErrorPrototype, 'name', ERROR_NAME);
7011
6660
  }
7012
- return results;
7013
- });
7014
- }
6661
+ OriginalErrorPrototype.constructor = WrappedError;
6662
+ } catch (error) { /* empty */ }
7015
6663
 
7016
- const propertyOf = name => name;
6664
+ return WrappedError;
6665
+ };
7017
6666
 
7018
- class ArraysUtils {
7019
- static isArrayAndContainItems(dataList) {
7020
- return dataList && Array.isArray(dataList) && dataList.length > 0;
7021
- }
7022
- static pushToArray(array, object) {
7023
- if (ArraysUtils.isArrayAndContainItems(array)) array.push(object);else array = [object];
7024
- }
7025
- }
6667
+ /* eslint-disable no-unused-vars -- required for functions `.length` */
6668
+ var $$f = _export;
6669
+ var global$4 = global$f;
6670
+ var apply$1 = functionApply;
6671
+ var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
7026
6672
 
7027
- var $$d = _export;
7028
- var $includes = arrayIncludes.includes;
7029
- var fails$5 = fails$i;
7030
- var addToUnscopables = addToUnscopables$2;
6673
+ var WEB_ASSEMBLY = 'WebAssembly';
6674
+ var WebAssembly = global$4[WEB_ASSEMBLY];
7031
6675
 
7032
- // FF99+ bug
7033
- var BROKEN_ON_SPARSE = fails$5(function () {
7034
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
7035
- return !Array(1).includes();
7036
- });
6676
+ // eslint-disable-next-line es/no-error-cause -- feature detection
6677
+ var FORCED$3 = new Error('e', { cause: 7 }).cause !== 7;
7037
6678
 
7038
- // `Array.prototype.includes` method
7039
- // https://tc39.es/ecma262/#sec-array.prototype.includes
7040
- $$d({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
7041
- includes: function includes(el /* , fromIndex = 0 */) {
7042
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
6679
+ var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
6680
+ var O = {};
6681
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$3);
6682
+ $$f({ global: true, constructor: true, arity: 1, forced: FORCED$3 }, O);
6683
+ };
6684
+
6685
+ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
6686
+ if (WebAssembly && WebAssembly[ERROR_NAME]) {
6687
+ var O = {};
6688
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$3);
6689
+ $$f({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$3 }, O);
7043
6690
  }
6691
+ };
6692
+
6693
+ // https://tc39.es/ecma262/#sec-nativeerror
6694
+ exportGlobalErrorCauseWrapper('Error', function (init) {
6695
+ return function Error(message) { return apply$1(init, this, arguments); };
6696
+ });
6697
+ exportGlobalErrorCauseWrapper('EvalError', function (init) {
6698
+ return function EvalError(message) { return apply$1(init, this, arguments); };
6699
+ });
6700
+ exportGlobalErrorCauseWrapper('RangeError', function (init) {
6701
+ return function RangeError(message) { return apply$1(init, this, arguments); };
6702
+ });
6703
+ exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
6704
+ return function ReferenceError(message) { return apply$1(init, this, arguments); };
6705
+ });
6706
+ exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
6707
+ return function SyntaxError(message) { return apply$1(init, this, arguments); };
6708
+ });
6709
+ exportGlobalErrorCauseWrapper('TypeError', function (init) {
6710
+ return function TypeError(message) { return apply$1(init, this, arguments); };
6711
+ });
6712
+ exportGlobalErrorCauseWrapper('URIError', function (init) {
6713
+ return function URIError(message) { return apply$1(init, this, arguments); };
6714
+ });
6715
+ exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
6716
+ return function CompileError(message) { return apply$1(init, this, arguments); };
6717
+ });
6718
+ exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
6719
+ return function LinkError(message) { return apply$1(init, this, arguments); };
6720
+ });
6721
+ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
6722
+ return function RuntimeError(message) { return apply$1(init, this, arguments); };
7044
6723
  });
7045
6724
 
7046
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
7047
- addToUnscopables('includes');
6725
+ var uncurryThis$9 = functionUncurryThis;
7048
6726
 
7049
- var isObject$2 = isObject$b;
7050
- var classof$4 = classofRaw$2;
7051
- var wellKnownSymbol$6 = wellKnownSymbol$d;
6727
+ var arraySlice$1 = uncurryThis$9([].slice);
7052
6728
 
7053
- var MATCH$1 = wellKnownSymbol$6('match');
6729
+ var classof$3 = classofRaw$2;
7054
6730
 
7055
- // `IsRegExp` abstract operation
7056
- // https://tc39.es/ecma262/#sec-isregexp
7057
- var isRegexp = function (it) {
7058
- var isRegExp;
7059
- return isObject$2(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$4(it) === 'RegExp');
6731
+ // `IsArray` abstract operation
6732
+ // https://tc39.es/ecma262/#sec-isarray
6733
+ // eslint-disable-next-line es/no-array-isarray -- safe
6734
+ var isArray$2 = Array.isArray || function isArray(argument) {
6735
+ return classof$3(argument) === 'Array';
7060
6736
  };
7061
6737
 
7062
- var isRegExp = isRegexp;
6738
+ var uncurryThis$8 = functionUncurryThis;
6739
+ var isArray$1 = isArray$2;
6740
+ var isCallable$5 = isCallable$i;
6741
+ var classof$2 = classofRaw$2;
6742
+ var toString$3 = toString$5;
7063
6743
 
7064
- var $TypeError$5 = TypeError;
6744
+ var push = uncurryThis$8([].push);
7065
6745
 
7066
- var notARegexp = function (it) {
7067
- if (isRegExp(it)) {
7068
- throw new $TypeError$5("The method doesn't accept regular expressions");
7069
- } return it;
6746
+ var getJsonReplacerFunction = function (replacer) {
6747
+ if (isCallable$5(replacer)) return replacer;
6748
+ if (!isArray$1(replacer)) return;
6749
+ var rawLength = replacer.length;
6750
+ var keys = [];
6751
+ for (var i = 0; i < rawLength; i++) {
6752
+ var element = replacer[i];
6753
+ if (typeof element == 'string') push(keys, element);
6754
+ else if (typeof element == 'number' || classof$2(element) === 'Number' || classof$2(element) === 'String') push(keys, toString$3(element));
6755
+ }
6756
+ var keysLength = keys.length;
6757
+ var root = true;
6758
+ return function (key, value) {
6759
+ if (root) {
6760
+ root = false;
6761
+ return value;
6762
+ }
6763
+ if (isArray$1(this)) return value;
6764
+ for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
6765
+ };
7070
6766
  };
7071
6767
 
7072
- var wellKnownSymbol$5 = wellKnownSymbol$d;
6768
+ var $$e = _export;
6769
+ var getBuiltIn$2 = getBuiltIn$6;
6770
+ var apply = functionApply;
6771
+ var call$6 = functionCall;
6772
+ var uncurryThis$7 = functionUncurryThis;
6773
+ var fails$7 = fails$i;
6774
+ var isCallable$4 = isCallable$i;
6775
+ var isSymbol = isSymbol$3;
6776
+ var arraySlice = arraySlice$1;
6777
+ var getReplacerFunction = getJsonReplacerFunction;
6778
+ var NATIVE_SYMBOL = symbolConstructorDetection;
7073
6779
 
7074
- var TO_STRING_TAG$2 = wellKnownSymbol$5('toStringTag');
7075
- var test = {};
6780
+ var $String = String;
6781
+ var $stringify = getBuiltIn$2('JSON', 'stringify');
6782
+ var exec$1 = uncurryThis$7(/./.exec);
6783
+ var charAt = uncurryThis$7(''.charAt);
6784
+ var charCodeAt = uncurryThis$7(''.charCodeAt);
6785
+ var replace$1 = uncurryThis$7(''.replace);
6786
+ var numberToString = uncurryThis$7(1.0.toString);
7076
6787
 
7077
- test[TO_STRING_TAG$2] = 'z';
6788
+ var tester = /[\uD800-\uDFFF]/g;
6789
+ var low = /^[\uD800-\uDBFF]$/;
6790
+ var hi = /^[\uDC00-\uDFFF]$/;
7078
6791
 
7079
- var toStringTagSupport = String(test) === '[object z]';
6792
+ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$7(function () {
6793
+ var symbol = getBuiltIn$2('Symbol')('stringify detection');
6794
+ // MS Edge converts symbol values to JSON as {}
6795
+ return $stringify([symbol]) !== '[null]'
6796
+ // WebKit converts symbol values to JSON as null
6797
+ || $stringify({ a: symbol }) !== '{}'
6798
+ // V8 throws on boxed symbols
6799
+ || $stringify(Object(symbol)) !== '{}';
6800
+ });
7080
6801
 
7081
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
7082
- var isCallable$4 = isCallable$i;
7083
- var classofRaw$1 = classofRaw$2;
7084
- var wellKnownSymbol$4 = wellKnownSymbol$d;
6802
+ // https://github.com/tc39/proposal-well-formed-stringify
6803
+ var ILL_FORMED_UNICODE = fails$7(function () {
6804
+ return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
6805
+ || $stringify('\uDEAD') !== '"\\udead"';
6806
+ });
7085
6807
 
7086
- var TO_STRING_TAG$1 = wellKnownSymbol$4('toStringTag');
7087
- var $Object = Object;
6808
+ var stringifyWithSymbolsFix = function (it, replacer) {
6809
+ var args = arraySlice(arguments);
6810
+ var $replacer = getReplacerFunction(replacer);
6811
+ if (!isCallable$4($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
6812
+ args[1] = function (key, value) {
6813
+ // some old implementations (like WebKit) could pass numbers as keys
6814
+ if (isCallable$4($replacer)) value = call$6($replacer, this, $String(key), value);
6815
+ if (!isSymbol(value)) return value;
6816
+ };
6817
+ return apply($stringify, null, args);
6818
+ };
7088
6819
 
7089
- // ES3 wrong here
7090
- var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
7091
-
7092
- // fallback for IE11 Script Access Denied error
7093
- var tryGet = function (it, key) {
7094
- try {
7095
- return it[key];
7096
- } catch (error) { /* empty */ }
7097
- };
7098
-
7099
- // getting tag from ES6+ `Object.prototype.toString`
7100
- var classof$3 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
7101
- var O, tag, result;
7102
- return it === undefined ? 'Undefined' : it === null ? 'Null'
7103
- // @@toStringTag case
7104
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG$1)) == 'string' ? tag
7105
- // builtinTag case
7106
- : CORRECT_ARGUMENTS ? classofRaw$1(O)
7107
- // ES3 arguments fallback
7108
- : (result = classofRaw$1(O)) === 'Object' && isCallable$4(O.callee) ? 'Arguments' : result;
7109
- };
7110
-
7111
- var classof$2 = classof$3;
7112
-
7113
- var $String$1 = String;
7114
-
7115
- var toString$5 = function (argument) {
7116
- if (classof$2(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
7117
- return $String$1(argument);
7118
- };
7119
-
7120
- var wellKnownSymbol$3 = wellKnownSymbol$d;
7121
-
7122
- var MATCH = wellKnownSymbol$3('match');
7123
-
7124
- var correctIsRegexpLogic = function (METHOD_NAME) {
7125
- var regexp = /./;
7126
- try {
7127
- '/./'[METHOD_NAME](regexp);
7128
- } catch (error1) {
7129
- try {
7130
- regexp[MATCH] = false;
7131
- return '/./'[METHOD_NAME](regexp);
7132
- } catch (error2) { /* empty */ }
7133
- } return false;
6820
+ var fixIllFormed = function (match, offset, string) {
6821
+ var prev = charAt(string, offset - 1);
6822
+ var next = charAt(string, offset + 1);
6823
+ if ((exec$1(low, match) && !exec$1(hi, next)) || (exec$1(hi, match) && !exec$1(low, prev))) {
6824
+ return '\\u' + numberToString(charCodeAt(match, 0), 16);
6825
+ } return match;
7134
6826
  };
7135
6827
 
7136
- var $$c = _export;
7137
- var uncurryThis$a = functionUncurryThis;
7138
- var notARegExp = notARegexp;
7139
- var requireObjectCoercible$1 = requireObjectCoercible$5;
7140
- var toString$4 = toString$5;
7141
- var correctIsRegExpLogic = correctIsRegexpLogic;
7142
-
7143
- var stringIndexOf = uncurryThis$a(''.indexOf);
7144
-
7145
- // `String.prototype.includes` method
7146
- // https://tc39.es/ecma262/#sec-string.prototype.includes
7147
- $$c({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
7148
- includes: function includes(searchString /* , position = 0 */) {
7149
- return !!~stringIndexOf(
7150
- toString$4(requireObjectCoercible$1(this)),
7151
- toString$4(notARegExp(searchString)),
7152
- arguments.length > 1 ? arguments[1] : undefined
7153
- );
7154
- }
7155
- });
7156
-
7157
- // import LanguageDetector from 'i18next-browser-languagedetector';
7158
- const LOCAL_STORAGE_I18N_STRING = 'I18N_SELECTION';
7159
- const systemDefaultLang = 'en';
7160
- const init = ({
7161
- version,
7162
- customPath
7163
- }) => {
7164
- const currentLng = localStorage.getItem(LOCAL_STORAGE_I18N_STRING) || systemDefaultLang;
7165
- i18n.use(Backend) // load translation using http
7166
- // .use(LanguageDetector) // detect user language
7167
- .use(initReactI18next) // passes i18n down to react-i18next
7168
- .init({
7169
- lng: currentLng,
7170
- fallbackLng: systemDefaultLang,
7171
- ns: ['common', 'inbox'],
7172
- // define your namespaces
7173
- defaultNS: 'common',
7174
- interpolation: {
7175
- escapeValue: false
7176
- },
7177
- load: 'languageOnly',
7178
- backend: {
7179
- loadPath: customPath ? customPath : `/assets/locales/{{lng}}/{{ns}}.json?v=${version !== null && version !== void 0 ? version : ''}`
6828
+ if ($stringify) {
6829
+ // `JSON.stringify` method
6830
+ // https://tc39.es/ecma262/#sec-json.stringify
6831
+ $$e({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
6832
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
6833
+ stringify: function stringify(it, replacer, space) {
6834
+ var args = arraySlice(arguments);
6835
+ var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
6836
+ return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$1(result, tester, fixIllFormed) : result;
7180
6837
  }
7181
6838
  });
7182
- };
7183
- const changeLang = lang => {
7184
- localStorage.setItem(LOCAL_STORAGE_I18N_STRING, lang);
7185
- i18n.changeLanguage(lang);
7186
- };
7187
- const getLang = () => {
7188
- var _a;
7189
- return (_a = localStorage.getItem(LOCAL_STORAGE_I18N_STRING)) !== null && _a !== void 0 ? _a : systemDefaultLang;
7190
- };
7191
- const LangService = {
7192
- init,
7193
- changeLang,
7194
- getLang
7195
- };
7196
- var Languages;
7197
- (function (Languages) {
7198
- Languages["EN"] = "en";
7199
- Languages["AR"] = "ar";
7200
- Languages["TR"] = "tr";
7201
- })(Languages || (Languages = {}));
7202
-
7203
- class StringsUtils {
7204
- static localCompareStrings(a, b) {
7205
- const language = LangService.getLang();
7206
- return a.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr').localeCompare(b.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr'), language !== null && language !== void 0 ? language : 'tr');
7207
- }
7208
- static localeIncludeString(a, b) {
7209
- const language = LangService.getLang();
7210
- return a.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr').includes(b.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr'));
7211
- }
7212
- static isStringHasCharacters(text) {
7213
- return text && text.length > 0;
7214
- }
7215
6839
  }
7216
6840
 
7217
- const BCRoutesGuard = props => {
7218
- var _a;
7219
- const {
7220
- component: BaseComponent,
7221
- location
7222
- } = props,
7223
- rest = __rest(props, ["component", "location"]);
7224
- const isUserAuthenticated = !!(auth.getToken() && StringsUtils.isStringHasCharacters((_a = auth.getUserInfo()) === null || _a === void 0 ? void 0 : _a.id));
7225
- const currentToken = auth.getToken();
7226
- function CheckNavigation() {
7227
- // if Unauthenticated go to login page
7228
- if (!currentToken || !isUserAuthenticated) return jsx(Redirect, {
7229
- to: {
7230
- pathname: BCRoutes.Login,
7231
- state: {
7232
- from: location
7233
- }
7234
- }
7235
- });
7236
- return jsx(BaseComponent, Object.assign({}, props));
7237
- }
7238
- return jsx(Route, Object.assign({}, rest, {
7239
- render: CheckNavigation
7240
- }));
7241
- };
7242
-
7243
- var NATIVE_BIND$1 = functionBindNative;
7244
-
7245
- var FunctionPrototype = Function.prototype;
7246
- var apply$2 = FunctionPrototype.apply;
7247
- var call$6 = FunctionPrototype.call;
7248
-
7249
- // eslint-disable-next-line es/no-reflect -- safe
7250
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$6.bind(apply$2) : function () {
7251
- return call$6.apply(apply$2, arguments);
7252
- });
7253
-
7254
- var defineProperty$1 = objectDefineProperty.f;
7255
-
7256
- var proxyAccessor$1 = function (Target, Source, key) {
7257
- key in Target || defineProperty$1(Target, key, {
7258
- configurable: true,
7259
- get: function () { return Source[key]; },
7260
- set: function (it) { Source[key] = it; }
7261
- });
7262
- };
7263
-
7264
- var isCallable$3 = isCallable$i;
7265
- var isObject$1 = isObject$b;
7266
- var setPrototypeOf$1 = objectSetPrototypeOf;
6841
+ // a string of all valid unicode whitespaces
6842
+ var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
6843
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
7267
6844
 
7268
- // makes subclassing work correct for wrapped built-ins
7269
- var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
7270
- var NewTarget, NewTargetPrototype;
7271
- if (
7272
- // it can work only with native `setPrototypeOf`
7273
- setPrototypeOf$1 &&
7274
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
7275
- isCallable$3(NewTarget = dummy.constructor) &&
7276
- NewTarget !== Wrapper &&
7277
- isObject$1(NewTargetPrototype = NewTarget.prototype) &&
7278
- NewTargetPrototype !== Wrapper.prototype
7279
- ) setPrototypeOf$1($this, NewTargetPrototype);
7280
- return $this;
7281
- };
6845
+ var uncurryThis$6 = functionUncurryThis;
6846
+ var requireObjectCoercible$1 = requireObjectCoercible$5;
6847
+ var toString$2 = toString$5;
6848
+ var whitespaces$1 = whitespaces$2;
7282
6849
 
7283
- var toString$3 = toString$5;
6850
+ var replace = uncurryThis$6(''.replace);
6851
+ var ltrim = RegExp('^[' + whitespaces$1 + ']+');
6852
+ var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
7284
6853
 
7285
- var normalizeStringArgument$1 = function (argument, $default) {
7286
- return argument === undefined ? arguments.length < 2 ? '' : $default : toString$3(argument);
6854
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
6855
+ var createMethod = function (TYPE) {
6856
+ return function ($this) {
6857
+ var string = toString$2(requireObjectCoercible$1($this));
6858
+ if (TYPE & 1) string = replace(string, ltrim, '');
6859
+ if (TYPE & 2) string = replace(string, rtrim, '$1');
6860
+ return string;
6861
+ };
7287
6862
  };
7288
6863
 
7289
- var isObject = isObject$b;
7290
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$7;
7291
-
7292
- // `InstallErrorCause` abstract operation
7293
- // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
7294
- var installErrorCause$1 = function (O, options) {
7295
- if (isObject(options) && 'cause' in options) {
7296
- createNonEnumerableProperty$2(O, 'cause', options.cause);
7297
- }
6864
+ var stringTrim = {
6865
+ // `String.prototype.trim` method
6866
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
6867
+ trim: createMethod(3)
7298
6868
  };
7299
6869
 
7300
- var uncurryThis$9 = functionUncurryThis;
7301
-
7302
- var $Error = Error;
7303
- var replace$2 = uncurryThis$9(''.replace);
6870
+ var global$3 = global$f;
6871
+ var fails$6 = fails$i;
6872
+ var uncurryThis$5 = functionUncurryThis;
6873
+ var toString$1 = toString$5;
6874
+ var trim = stringTrim.trim;
6875
+ var whitespaces = whitespaces$2;
7304
6876
 
7305
- var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
7306
- // eslint-disable-next-line redos/no-vulnerable -- safe
7307
- var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
7308
- var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
6877
+ var $parseInt$1 = global$3.parseInt;
6878
+ var Symbol$1 = global$3.Symbol;
6879
+ var ITERATOR$6 = Symbol$1 && Symbol$1.iterator;
6880
+ var hex = /^[+-]?0x/i;
6881
+ var exec = uncurryThis$5(hex.exec);
6882
+ var FORCED$2 = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
6883
+ // MS Edge 18- broken with boxed symbols
6884
+ || (ITERATOR$6 && !fails$6(function () { $parseInt$1(Object(ITERATOR$6)); }));
7309
6885
 
7310
- var errorStackClear = function (stack, dropEntries) {
7311
- if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
7312
- while (dropEntries--) stack = replace$2(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
7313
- } return stack;
7314
- };
6886
+ // `parseInt` method
6887
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
6888
+ var numberParseInt = FORCED$2 ? function parseInt(string, radix) {
6889
+ var S = trim(toString$1(string));
6890
+ return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
6891
+ } : $parseInt$1;
7315
6892
 
7316
- var fails$4 = fails$i;
7317
- var createPropertyDescriptor$1 = createPropertyDescriptor$5;
6893
+ var $$d = _export;
6894
+ var $parseInt = numberParseInt;
7318
6895
 
7319
- var errorStackInstallable = !fails$4(function () {
7320
- var error = new Error('a');
7321
- if (!('stack' in error)) return true;
7322
- // eslint-disable-next-line es/no-object-defineproperty -- safe
7323
- Object.defineProperty(error, 'stack', createPropertyDescriptor$1(1, 7));
7324
- return error.stack !== 7;
7325
- });
7326
-
7327
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
7328
- var clearErrorStack = errorStackClear;
7329
- var ERROR_STACK_INSTALLABLE = errorStackInstallable;
7330
-
7331
- // non-standard V8
7332
- var captureStackTrace = Error.captureStackTrace;
7333
-
7334
- var errorStackInstall = function (error, C, stack, dropEntries) {
7335
- if (ERROR_STACK_INSTALLABLE) {
7336
- if (captureStackTrace) captureStackTrace(error, C);
7337
- else createNonEnumerableProperty$1(error, 'stack', clearErrorStack(stack, dropEntries));
7338
- }
7339
- };
7340
-
7341
- var getBuiltIn$2 = getBuiltIn$6;
7342
- var hasOwn$1 = hasOwnProperty_1;
7343
- var createNonEnumerableProperty = createNonEnumerableProperty$7;
7344
- var isPrototypeOf$2 = objectIsPrototypeOf;
7345
- var setPrototypeOf = objectSetPrototypeOf;
7346
- var copyConstructorProperties = copyConstructorProperties$2;
7347
- var proxyAccessor = proxyAccessor$1;
7348
- var inheritIfRequired = inheritIfRequired$1;
7349
- var normalizeStringArgument = normalizeStringArgument$1;
7350
- var installErrorCause = installErrorCause$1;
7351
- var installErrorStack = errorStackInstall;
7352
- var DESCRIPTORS$2 = descriptors;
7353
-
7354
- var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
7355
- var STACK_TRACE_LIMIT = 'stackTraceLimit';
7356
- var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
7357
- var path = FULL_NAME.split('.');
7358
- var ERROR_NAME = path[path.length - 1];
7359
- var OriginalError = getBuiltIn$2.apply(null, path);
7360
-
7361
- if (!OriginalError) return;
7362
-
7363
- var OriginalErrorPrototype = OriginalError.prototype;
7364
-
7365
- // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
7366
- if (hasOwn$1(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
7367
-
7368
- if (!FORCED) return OriginalError;
7369
-
7370
- var BaseError = getBuiltIn$2('Error');
7371
-
7372
- var WrappedError = wrapper(function (a, b) {
7373
- var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
7374
- var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
7375
- if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
7376
- installErrorStack(result, WrappedError, result.stack, 2);
7377
- if (this && isPrototypeOf$2(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
7378
- if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
7379
- return result;
7380
- });
7381
-
7382
- WrappedError.prototype = OriginalErrorPrototype;
7383
-
7384
- if (ERROR_NAME !== 'Error') {
7385
- if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
7386
- else copyConstructorProperties(WrappedError, BaseError, { name: true });
7387
- } else if (DESCRIPTORS$2 && STACK_TRACE_LIMIT in OriginalError) {
7388
- proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
7389
- proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
7390
- }
7391
-
7392
- copyConstructorProperties(WrappedError, OriginalError);
7393
-
7394
- try {
7395
- // Safari 13- bug: WebAssembly errors does not have a proper `.name`
7396
- if (OriginalErrorPrototype.name !== ERROR_NAME) {
7397
- createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);
7398
- }
7399
- OriginalErrorPrototype.constructor = WrappedError;
7400
- } catch (error) { /* empty */ }
7401
-
7402
- return WrappedError;
7403
- };
7404
-
7405
- /* eslint-disable no-unused-vars -- required for functions `.length` */
7406
- var $$b = _export;
7407
- var global$3 = global$f;
7408
- var apply$1 = functionApply;
7409
- var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
7410
-
7411
- var WEB_ASSEMBLY = 'WebAssembly';
7412
- var WebAssembly = global$3[WEB_ASSEMBLY];
7413
-
7414
- // eslint-disable-next-line es/no-error-cause -- feature detection
7415
- var FORCED$2 = new Error('e', { cause: 7 }).cause !== 7;
7416
-
7417
- var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
7418
- var O = {};
7419
- O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$2);
7420
- $$b({ global: true, constructor: true, arity: 1, forced: FORCED$2 }, O);
7421
- };
7422
-
7423
- var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
7424
- if (WebAssembly && WebAssembly[ERROR_NAME]) {
7425
- var O = {};
7426
- O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$2);
7427
- $$b({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$2 }, O);
7428
- }
7429
- };
7430
-
7431
- // https://tc39.es/ecma262/#sec-nativeerror
7432
- exportGlobalErrorCauseWrapper('Error', function (init) {
7433
- return function Error(message) { return apply$1(init, this, arguments); };
7434
- });
7435
- exportGlobalErrorCauseWrapper('EvalError', function (init) {
7436
- return function EvalError(message) { return apply$1(init, this, arguments); };
7437
- });
7438
- exportGlobalErrorCauseWrapper('RangeError', function (init) {
7439
- return function RangeError(message) { return apply$1(init, this, arguments); };
7440
- });
7441
- exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
7442
- return function ReferenceError(message) { return apply$1(init, this, arguments); };
7443
- });
7444
- exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
7445
- return function SyntaxError(message) { return apply$1(init, this, arguments); };
7446
- });
7447
- exportGlobalErrorCauseWrapper('TypeError', function (init) {
7448
- return function TypeError(message) { return apply$1(init, this, arguments); };
7449
- });
7450
- exportGlobalErrorCauseWrapper('URIError', function (init) {
7451
- return function URIError(message) { return apply$1(init, this, arguments); };
7452
- });
7453
- exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
7454
- return function CompileError(message) { return apply$1(init, this, arguments); };
7455
- });
7456
- exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
7457
- return function LinkError(message) { return apply$1(init, this, arguments); };
7458
- });
7459
- exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
7460
- return function RuntimeError(message) { return apply$1(init, this, arguments); };
7461
- });
7462
-
7463
- var uncurryThis$8 = functionUncurryThis;
7464
-
7465
- var arraySlice$1 = uncurryThis$8([].slice);
7466
-
7467
- var uncurryThis$7 = functionUncurryThis;
7468
- var isArray = isArray$2;
7469
- var isCallable$2 = isCallable$i;
7470
- var classof$1 = classofRaw$2;
7471
- var toString$2 = toString$5;
7472
-
7473
- var push = uncurryThis$7([].push);
7474
-
7475
- var getJsonReplacerFunction = function (replacer) {
7476
- if (isCallable$2(replacer)) return replacer;
7477
- if (!isArray(replacer)) return;
7478
- var rawLength = replacer.length;
7479
- var keys = [];
7480
- for (var i = 0; i < rawLength; i++) {
7481
- var element = replacer[i];
7482
- if (typeof element == 'string') push(keys, element);
7483
- else if (typeof element == 'number' || classof$1(element) === 'Number' || classof$1(element) === 'String') push(keys, toString$2(element));
7484
- }
7485
- var keysLength = keys.length;
7486
- var root = true;
7487
- return function (key, value) {
7488
- if (root) {
7489
- root = false;
7490
- return value;
7491
- }
7492
- if (isArray(this)) return value;
7493
- for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
7494
- };
7495
- };
7496
-
7497
- var $$a = _export;
7498
- var getBuiltIn$1 = getBuiltIn$6;
7499
- var apply = functionApply;
7500
- var call$5 = functionCall;
7501
- var uncurryThis$6 = functionUncurryThis;
7502
- var fails$3 = fails$i;
7503
- var isCallable$1 = isCallable$i;
7504
- var isSymbol = isSymbol$3;
7505
- var arraySlice = arraySlice$1;
7506
- var getReplacerFunction = getJsonReplacerFunction;
7507
- var NATIVE_SYMBOL = symbolConstructorDetection;
7508
-
7509
- var $String = String;
7510
- var $stringify = getBuiltIn$1('JSON', 'stringify');
7511
- var exec$1 = uncurryThis$6(/./.exec);
7512
- var charAt = uncurryThis$6(''.charAt);
7513
- var charCodeAt = uncurryThis$6(''.charCodeAt);
7514
- var replace$1 = uncurryThis$6(''.replace);
7515
- var numberToString = uncurryThis$6(1.0.toString);
7516
-
7517
- var tester = /[\uD800-\uDFFF]/g;
7518
- var low = /^[\uD800-\uDBFF]$/;
7519
- var hi = /^[\uDC00-\uDFFF]$/;
7520
-
7521
- var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$3(function () {
7522
- var symbol = getBuiltIn$1('Symbol')('stringify detection');
7523
- // MS Edge converts symbol values to JSON as {}
7524
- return $stringify([symbol]) !== '[null]'
7525
- // WebKit converts symbol values to JSON as null
7526
- || $stringify({ a: symbol }) !== '{}'
7527
- // V8 throws on boxed symbols
7528
- || $stringify(Object(symbol)) !== '{}';
7529
- });
7530
-
7531
- // https://github.com/tc39/proposal-well-formed-stringify
7532
- var ILL_FORMED_UNICODE = fails$3(function () {
7533
- return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
7534
- || $stringify('\uDEAD') !== '"\\udead"';
7535
- });
7536
-
7537
- var stringifyWithSymbolsFix = function (it, replacer) {
7538
- var args = arraySlice(arguments);
7539
- var $replacer = getReplacerFunction(replacer);
7540
- if (!isCallable$1($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
7541
- args[1] = function (key, value) {
7542
- // some old implementations (like WebKit) could pass numbers as keys
7543
- if (isCallable$1($replacer)) value = call$5($replacer, this, $String(key), value);
7544
- if (!isSymbol(value)) return value;
7545
- };
7546
- return apply($stringify, null, args);
7547
- };
7548
-
7549
- var fixIllFormed = function (match, offset, string) {
7550
- var prev = charAt(string, offset - 1);
7551
- var next = charAt(string, offset + 1);
7552
- if ((exec$1(low, match) && !exec$1(hi, next)) || (exec$1(hi, match) && !exec$1(low, prev))) {
7553
- return '\\u' + numberToString(charCodeAt(match, 0), 16);
7554
- } return match;
7555
- };
7556
-
7557
- if ($stringify) {
7558
- // `JSON.stringify` method
7559
- // https://tc39.es/ecma262/#sec-json.stringify
7560
- $$a({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
7561
- // eslint-disable-next-line no-unused-vars -- required for `.length`
7562
- stringify: function stringify(it, replacer, space) {
7563
- var args = arraySlice(arguments);
7564
- var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
7565
- return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$1(result, tester, fixIllFormed) : result;
7566
- }
7567
- });
7568
- }
7569
-
7570
- // a string of all valid unicode whitespaces
7571
- var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
7572
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
7573
-
7574
- var uncurryThis$5 = functionUncurryThis;
7575
- var requireObjectCoercible = requireObjectCoercible$5;
7576
- var toString$1 = toString$5;
7577
- var whitespaces$1 = whitespaces$2;
7578
-
7579
- var replace = uncurryThis$5(''.replace);
7580
- var ltrim = RegExp('^[' + whitespaces$1 + ']+');
7581
- var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
7582
-
7583
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
7584
- var createMethod = function (TYPE) {
7585
- return function ($this) {
7586
- var string = toString$1(requireObjectCoercible($this));
7587
- if (TYPE & 1) string = replace(string, ltrim, '');
7588
- if (TYPE & 2) string = replace(string, rtrim, '$1');
7589
- return string;
7590
- };
7591
- };
7592
-
7593
- var stringTrim = {
7594
- // `String.prototype.trim` method
7595
- // https://tc39.es/ecma262/#sec-string.prototype.trim
7596
- trim: createMethod(3)
7597
- };
7598
-
7599
- var global$2 = global$f;
7600
- var fails$2 = fails$i;
7601
- var uncurryThis$4 = functionUncurryThis;
7602
- var toString = toString$5;
7603
- var trim = stringTrim.trim;
7604
- var whitespaces = whitespaces$2;
7605
-
7606
- var $parseInt$1 = global$2.parseInt;
7607
- var Symbol$1 = global$2.Symbol;
7608
- var ITERATOR$3 = Symbol$1 && Symbol$1.iterator;
7609
- var hex = /^[+-]?0x/i;
7610
- var exec = uncurryThis$4(hex.exec);
7611
- var FORCED$1 = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
7612
- // MS Edge 18- broken with boxed symbols
7613
- || (ITERATOR$3 && !fails$2(function () { $parseInt$1(Object(ITERATOR$3)); }));
7614
-
7615
- // `parseInt` method
7616
- // https://tc39.es/ecma262/#sec-parseint-string-radix
7617
- var numberParseInt = FORCED$1 ? function parseInt(string, radix) {
7618
- var S = trim(toString(string));
7619
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
7620
- } : $parseInt$1;
7621
-
7622
- var $$9 = _export;
7623
- var $parseInt = numberParseInt;
7624
-
7625
- // `parseInt` method
7626
- // https://tc39.es/ecma262/#sec-parseint-string-radix
7627
- $$9({ global: true, forced: parseInt !== $parseInt }, {
7628
- parseInt: $parseInt
6896
+ // `parseInt` method
6897
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
6898
+ $$d({ global: true, forced: parseInt !== $parseInt }, {
6899
+ parseInt: $parseInt
7629
6900
  });
7630
6901
 
7631
6902
  const CONTEXT_KEY = 'ContextId';
@@ -7921,35 +7192,789 @@ const auth = {
7921
7192
  window.localStorage.setItem(contextKey, value);
7922
7193
  }
7923
7194
  }
7924
- // sessionStorage:
7925
- if (toStorage === APP_PERSIST_STORES_TYPES[1]) {
7926
- if (window.sessionStorage) {
7927
- window.sessionStorage.setItem(contextKey, value);
7195
+ // sessionStorage:
7196
+ if (toStorage === APP_PERSIST_STORES_TYPES[1]) {
7197
+ if (window.sessionStorage) {
7198
+ window.sessionStorage.setItem(contextKey, value);
7199
+ }
7200
+ }
7201
+ },
7202
+ /**
7203
+ * get context from localstorage
7204
+ *
7205
+ * @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
7206
+ * @param {any} [tokenKey=TOKEN_KEY] optionnal parameter to specify a token key
7207
+ * @returns {number} token value
7208
+ */
7209
+ getContext(fromStorage = APP_PERSIST_STORES_TYPES[0], contextKey = CONTEXT_KEY) {
7210
+ if (typeof window === 'undefined') {
7211
+ return undefined;
7212
+ }
7213
+ // localStorage:
7214
+ if (fromStorage === APP_PERSIST_STORES_TYPES[0]) {
7215
+ return parseInt(window.localStorage && window.localStorage.getItem(contextKey) || '');
7216
+ }
7217
+ // sessionStorage:
7218
+ if (fromStorage === APP_PERSIST_STORES_TYPES[1]) {
7219
+ return parseInt(window.sessionStorage && window.sessionStorage.getItem(contextKey) || '');
7220
+ }
7221
+ // default:
7222
+ return null;
7223
+ }
7224
+ };
7225
+
7226
+ var objectDefineProperties = {};
7227
+
7228
+ var DESCRIPTORS$4 = descriptors;
7229
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
7230
+ var definePropertyModule$1 = objectDefineProperty;
7231
+ var anObject$7 = anObject$a;
7232
+ var toIndexedObject$1 = toIndexedObject$5;
7233
+ var objectKeys = objectKeys$2;
7234
+
7235
+ // `Object.defineProperties` method
7236
+ // https://tc39.es/ecma262/#sec-object.defineproperties
7237
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
7238
+ objectDefineProperties.f = DESCRIPTORS$4 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
7239
+ anObject$7(O);
7240
+ var props = toIndexedObject$1(Properties);
7241
+ var keys = objectKeys(Properties);
7242
+ var length = keys.length;
7243
+ var index = 0;
7244
+ var key;
7245
+ while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
7246
+ return O;
7247
+ };
7248
+
7249
+ var getBuiltIn$1 = getBuiltIn$6;
7250
+
7251
+ var html$1 = getBuiltIn$1('document', 'documentElement');
7252
+
7253
+ /* global ActiveXObject -- old IE, WSH */
7254
+ var anObject$6 = anObject$a;
7255
+ var definePropertiesModule = objectDefineProperties;
7256
+ var enumBugKeys = enumBugKeys$3;
7257
+ var hiddenKeys = hiddenKeys$4;
7258
+ var html = html$1;
7259
+ var documentCreateElement$1 = documentCreateElement$2;
7260
+ var sharedKey$1 = sharedKey$3;
7261
+
7262
+ var GT = '>';
7263
+ var LT = '<';
7264
+ var PROTOTYPE = 'prototype';
7265
+ var SCRIPT = 'script';
7266
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
7267
+
7268
+ var EmptyConstructor = function () { /* empty */ };
7269
+
7270
+ var scriptTag = function (content) {
7271
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
7272
+ };
7273
+
7274
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
7275
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
7276
+ activeXDocument.write(scriptTag(''));
7277
+ activeXDocument.close();
7278
+ var temp = activeXDocument.parentWindow.Object;
7279
+ activeXDocument = null; // avoid memory leak
7280
+ return temp;
7281
+ };
7282
+
7283
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
7284
+ var NullProtoObjectViaIFrame = function () {
7285
+ // Thrash, waste and sodomy: IE GC bug
7286
+ var iframe = documentCreateElement$1('iframe');
7287
+ var JS = 'java' + SCRIPT + ':';
7288
+ var iframeDocument;
7289
+ iframe.style.display = 'none';
7290
+ html.appendChild(iframe);
7291
+ // https://github.com/zloirock/core-js/issues/475
7292
+ iframe.src = String(JS);
7293
+ iframeDocument = iframe.contentWindow.document;
7294
+ iframeDocument.open();
7295
+ iframeDocument.write(scriptTag('document.F=Object'));
7296
+ iframeDocument.close();
7297
+ return iframeDocument.F;
7298
+ };
7299
+
7300
+ // Check for document.domain and active x support
7301
+ // No need to use active x approach when document.domain is not set
7302
+ // see https://github.com/es-shims/es5-shim/issues/150
7303
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
7304
+ // avoid IE GC bug
7305
+ var activeXDocument;
7306
+ var NullProtoObject = function () {
7307
+ try {
7308
+ activeXDocument = new ActiveXObject('htmlfile');
7309
+ } catch (error) { /* ignore */ }
7310
+ NullProtoObject = typeof document != 'undefined'
7311
+ ? document.domain && activeXDocument
7312
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
7313
+ : NullProtoObjectViaIFrame()
7314
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
7315
+ var length = enumBugKeys.length;
7316
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
7317
+ return NullProtoObject();
7318
+ };
7319
+
7320
+ hiddenKeys[IE_PROTO$1] = true;
7321
+
7322
+ // `Object.create` method
7323
+ // https://tc39.es/ecma262/#sec-object.create
7324
+ // eslint-disable-next-line es/no-object-create -- safe
7325
+ var objectCreate = Object.create || function create(O, Properties) {
7326
+ var result;
7327
+ if (O !== null) {
7328
+ EmptyConstructor[PROTOTYPE] = anObject$6(O);
7329
+ result = new EmptyConstructor();
7330
+ EmptyConstructor[PROTOTYPE] = null;
7331
+ // add "__proto__" for Object.getPrototypeOf polyfill
7332
+ result[IE_PROTO$1] = O;
7333
+ } else result = NullProtoObject();
7334
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
7335
+ };
7336
+
7337
+ var wellKnownSymbol$9 = wellKnownSymbol$d;
7338
+ var create$1 = objectCreate;
7339
+ var defineProperty$3 = objectDefineProperty.f;
7340
+
7341
+ var UNSCOPABLES = wellKnownSymbol$9('unscopables');
7342
+ var ArrayPrototype$1 = Array.prototype;
7343
+
7344
+ // Array.prototype[@@unscopables]
7345
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
7346
+ if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
7347
+ defineProperty$3(ArrayPrototype$1, UNSCOPABLES, {
7348
+ configurable: true,
7349
+ value: create$1(null)
7350
+ });
7351
+ }
7352
+
7353
+ // add a key to Array.prototype[@@unscopables]
7354
+ var addToUnscopables$2 = function (key) {
7355
+ ArrayPrototype$1[UNSCOPABLES][key] = true;
7356
+ };
7357
+
7358
+ var iterators = {};
7359
+
7360
+ var fails$5 = fails$i;
7361
+
7362
+ var correctPrototypeGetter = !fails$5(function () {
7363
+ function F() { /* empty */ }
7364
+ F.prototype.constructor = null;
7365
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
7366
+ return Object.getPrototypeOf(new F()) !== F.prototype;
7367
+ });
7368
+
7369
+ var hasOwn$2 = hasOwnProperty_1;
7370
+ var isCallable$3 = isCallable$i;
7371
+ var toObject$1 = toObject$4;
7372
+ var sharedKey = sharedKey$3;
7373
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
7374
+
7375
+ var IE_PROTO = sharedKey('IE_PROTO');
7376
+ var $Object = Object;
7377
+ var ObjectPrototype = $Object.prototype;
7378
+
7379
+ // `Object.getPrototypeOf` method
7380
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
7381
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
7382
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
7383
+ var object = toObject$1(O);
7384
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
7385
+ var constructor = object.constructor;
7386
+ if (isCallable$3(constructor) && object instanceof constructor) {
7387
+ return constructor.prototype;
7388
+ } return object instanceof $Object ? ObjectPrototype : null;
7389
+ };
7390
+
7391
+ var fails$4 = fails$i;
7392
+ var isCallable$2 = isCallable$i;
7393
+ var isObject$1 = isObject$b;
7394
+ var getPrototypeOf$2 = objectGetPrototypeOf;
7395
+ var defineBuiltIn$1 = defineBuiltIn$3;
7396
+ var wellKnownSymbol$8 = wellKnownSymbol$d;
7397
+
7398
+ var ITERATOR$5 = wellKnownSymbol$8('iterator');
7399
+ var BUGGY_SAFARI_ITERATORS$1 = false;
7400
+
7401
+ // `%IteratorPrototype%` object
7402
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
7403
+ var IteratorPrototype$3, PrototypeOfArrayIteratorPrototype, arrayIterator;
7404
+
7405
+ /* eslint-disable es/no-array-prototype-keys -- safe */
7406
+ if ([].keys) {
7407
+ arrayIterator = [].keys();
7408
+ // Safari 8 has buggy iterators w/o `next`
7409
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
7410
+ else {
7411
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$2(getPrototypeOf$2(arrayIterator));
7412
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$3 = PrototypeOfArrayIteratorPrototype;
7413
+ }
7414
+ }
7415
+
7416
+ var NEW_ITERATOR_PROTOTYPE = !isObject$1(IteratorPrototype$3) || fails$4(function () {
7417
+ var test = {};
7418
+ // FF44- legacy iterators case
7419
+ return IteratorPrototype$3[ITERATOR$5].call(test) !== test;
7420
+ });
7421
+
7422
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$3 = {};
7423
+
7424
+ // `%IteratorPrototype%[@@iterator]()` method
7425
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
7426
+ if (!isCallable$2(IteratorPrototype$3[ITERATOR$5])) {
7427
+ defineBuiltIn$1(IteratorPrototype$3, ITERATOR$5, function () {
7428
+ return this;
7429
+ });
7430
+ }
7431
+
7432
+ var iteratorsCore = {
7433
+ IteratorPrototype: IteratorPrototype$3,
7434
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
7435
+ };
7436
+
7437
+ var defineProperty$2 = objectDefineProperty.f;
7438
+ var hasOwn$1 = hasOwnProperty_1;
7439
+ var wellKnownSymbol$7 = wellKnownSymbol$d;
7440
+
7441
+ var TO_STRING_TAG$1 = wellKnownSymbol$7('toStringTag');
7442
+
7443
+ var setToStringTag$3 = function (target, TAG, STATIC) {
7444
+ if (target && !STATIC) target = target.prototype;
7445
+ if (target && !hasOwn$1(target, TO_STRING_TAG$1)) {
7446
+ defineProperty$2(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
7447
+ }
7448
+ };
7449
+
7450
+ var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
7451
+ var create = objectCreate;
7452
+ var createPropertyDescriptor$1 = createPropertyDescriptor$5;
7453
+ var setToStringTag$2 = setToStringTag$3;
7454
+ var Iterators$4 = iterators;
7455
+
7456
+ var returnThis$1 = function () { return this; };
7457
+
7458
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
7459
+ var TO_STRING_TAG = NAME + ' Iterator';
7460
+ IteratorConstructor.prototype = create(IteratorPrototype$2, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
7461
+ setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
7462
+ Iterators$4[TO_STRING_TAG] = returnThis$1;
7463
+ return IteratorConstructor;
7464
+ };
7465
+
7466
+ var $$c = _export;
7467
+ var call$5 = functionCall;
7468
+ var FunctionName = functionName;
7469
+ var isCallable$1 = isCallable$i;
7470
+ var createIteratorConstructor = iteratorCreateConstructor;
7471
+ var getPrototypeOf$1 = objectGetPrototypeOf;
7472
+ var setPrototypeOf = objectSetPrototypeOf;
7473
+ var setToStringTag$1 = setToStringTag$3;
7474
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
7475
+ var defineBuiltIn = defineBuiltIn$3;
7476
+ var wellKnownSymbol$6 = wellKnownSymbol$d;
7477
+ var Iterators$3 = iterators;
7478
+ var IteratorsCore = iteratorsCore;
7479
+
7480
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
7481
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
7482
+ var IteratorPrototype$1 = IteratorsCore.IteratorPrototype;
7483
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
7484
+ var ITERATOR$4 = wellKnownSymbol$6('iterator');
7485
+ var KEYS = 'keys';
7486
+ var VALUES = 'values';
7487
+ var ENTRIES = 'entries';
7488
+
7489
+ var returnThis = function () { return this; };
7490
+
7491
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
7492
+ createIteratorConstructor(IteratorConstructor, NAME, next);
7493
+
7494
+ var getIterationMethod = function (KIND) {
7495
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
7496
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
7497
+
7498
+ switch (KIND) {
7499
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
7500
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
7501
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
7502
+ }
7503
+
7504
+ return function () { return new IteratorConstructor(this); };
7505
+ };
7506
+
7507
+ var TO_STRING_TAG = NAME + ' Iterator';
7508
+ var INCORRECT_VALUES_NAME = false;
7509
+ var IterablePrototype = Iterable.prototype;
7510
+ var nativeIterator = IterablePrototype[ITERATOR$4]
7511
+ || IterablePrototype['@@iterator']
7512
+ || DEFAULT && IterablePrototype[DEFAULT];
7513
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
7514
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
7515
+ var CurrentIteratorPrototype, methods, KEY;
7516
+
7517
+ // fix native
7518
+ if (anyNativeIterator) {
7519
+ CurrentIteratorPrototype = getPrototypeOf$1(anyNativeIterator.call(new Iterable()));
7520
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
7521
+ if (getPrototypeOf$1(CurrentIteratorPrototype) !== IteratorPrototype$1) {
7522
+ if (setPrototypeOf) {
7523
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$1);
7524
+ } else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$4])) {
7525
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$4, returnThis);
7526
+ }
7527
+ }
7528
+ // Set @@toStringTag to native iterators
7529
+ setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
7530
+ }
7531
+ }
7532
+
7533
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
7534
+ if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
7535
+ if (CONFIGURABLE_FUNCTION_NAME) {
7536
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
7537
+ } else {
7538
+ INCORRECT_VALUES_NAME = true;
7539
+ defaultIterator = function values() { return call$5(nativeIterator, this); };
7540
+ }
7541
+ }
7542
+
7543
+ // export additional methods
7544
+ if (DEFAULT) {
7545
+ methods = {
7546
+ values: getIterationMethod(VALUES),
7547
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
7548
+ entries: getIterationMethod(ENTRIES)
7549
+ };
7550
+ if (FORCED) for (KEY in methods) {
7551
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
7552
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
7553
+ }
7554
+ } else $$c({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
7555
+ }
7556
+
7557
+ // define iterator
7558
+ if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
7559
+ defineBuiltIn(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
7560
+ }
7561
+ Iterators$3[NAME] = defaultIterator;
7562
+
7563
+ return methods;
7564
+ };
7565
+
7566
+ // `CreateIterResultObject` abstract operation
7567
+ // https://tc39.es/ecma262/#sec-createiterresultobject
7568
+ var createIterResultObject$1 = function (value, done) {
7569
+ return { value: value, done: done };
7570
+ };
7571
+
7572
+ var toIndexedObject = toIndexedObject$5;
7573
+ var addToUnscopables$1 = addToUnscopables$2;
7574
+ var Iterators$2 = iterators;
7575
+ var InternalStateModule = internalState;
7576
+ var defineProperty$1 = objectDefineProperty.f;
7577
+ var defineIterator = iteratorDefine;
7578
+ var createIterResultObject = createIterResultObject$1;
7579
+ var DESCRIPTORS$3 = descriptors;
7580
+
7581
+ var ARRAY_ITERATOR = 'Array Iterator';
7582
+ var setInternalState = InternalStateModule.set;
7583
+ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
7584
+
7585
+ // `Array.prototype.entries` method
7586
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
7587
+ // `Array.prototype.keys` method
7588
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
7589
+ // `Array.prototype.values` method
7590
+ // https://tc39.es/ecma262/#sec-array.prototype.values
7591
+ // `Array.prototype[@@iterator]` method
7592
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
7593
+ // `CreateArrayIterator` internal method
7594
+ // https://tc39.es/ecma262/#sec-createarrayiterator
7595
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
7596
+ setInternalState(this, {
7597
+ type: ARRAY_ITERATOR,
7598
+ target: toIndexedObject(iterated), // target
7599
+ index: 0, // next index
7600
+ kind: kind // kind
7601
+ });
7602
+ // `%ArrayIteratorPrototype%.next` method
7603
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
7604
+ }, function () {
7605
+ var state = getInternalState(this);
7606
+ var target = state.target;
7607
+ var index = state.index++;
7608
+ if (!target || index >= target.length) {
7609
+ state.target = undefined;
7610
+ return createIterResultObject(undefined, true);
7611
+ }
7612
+ switch (state.kind) {
7613
+ case 'keys': return createIterResultObject(index, false);
7614
+ case 'values': return createIterResultObject(target[index], false);
7615
+ } return createIterResultObject([index, target[index]], false);
7616
+ }, 'values');
7617
+
7618
+ // argumentsList[@@iterator] is %ArrayProto_values%
7619
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
7620
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
7621
+ var values = Iterators$2.Arguments = Iterators$2.Array;
7622
+
7623
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
7624
+ addToUnscopables$1('keys');
7625
+ addToUnscopables$1('values');
7626
+ addToUnscopables$1('entries');
7627
+
7628
+ // V8 ~ Chrome 45- bug
7629
+ if (DESCRIPTORS$3 && values.name !== 'values') try {
7630
+ defineProperty$1(values, 'name', { value: 'values' });
7631
+ } catch (error) { /* empty */ }
7632
+
7633
+ var DESCRIPTORS$2 = descriptors;
7634
+ var isArray = isArray$2;
7635
+
7636
+ var $TypeError$7 = TypeError;
7637
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
7638
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
7639
+
7640
+ // Safari < 13 does not throw an error in this case
7641
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$2 && !function () {
7642
+ // makes no sense without proper strict mode support
7643
+ if (this !== undefined) return true;
7644
+ try {
7645
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
7646
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
7647
+ } catch (error) {
7648
+ return error instanceof TypeError;
7649
+ }
7650
+ }();
7651
+
7652
+ var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
7653
+ if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
7654
+ throw new $TypeError$7('Cannot set read only .length');
7655
+ } return O.length = length;
7656
+ } : function (O, length) {
7657
+ return O.length = length;
7658
+ };
7659
+
7660
+ var $TypeError$6 = TypeError;
7661
+ var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
7662
+
7663
+ var doesNotExceedSafeInteger$1 = function (it) {
7664
+ if (it > MAX_SAFE_INTEGER) throw $TypeError$6('Maximum allowed index exceeded');
7665
+ return it;
7666
+ };
7667
+
7668
+ var $$b = _export;
7669
+ var toObject = toObject$4;
7670
+ var lengthOfArrayLike$1 = lengthOfArrayLike$3;
7671
+ var setArrayLength = arraySetLength;
7672
+ var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
7673
+ var fails$3 = fails$i;
7674
+
7675
+ var INCORRECT_TO_LENGTH = fails$3(function () {
7676
+ return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
7677
+ });
7678
+
7679
+ // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
7680
+ // https://bugs.chromium.org/p/v8/issues/detail?id=12681
7681
+ var properErrorOnNonWritableLength = function () {
7682
+ try {
7683
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
7684
+ Object.defineProperty([], 'length', { writable: false }).push();
7685
+ } catch (error) {
7686
+ return error instanceof TypeError;
7687
+ }
7688
+ };
7689
+
7690
+ var FORCED$1 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
7691
+
7692
+ // `Array.prototype.push` method
7693
+ // https://tc39.es/ecma262/#sec-array.prototype.push
7694
+ $$b({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
7695
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
7696
+ push: function push(item) {
7697
+ var O = toObject(this);
7698
+ var len = lengthOfArrayLike$1(O);
7699
+ var argCount = arguments.length;
7700
+ doesNotExceedSafeInteger(len + argCount);
7701
+ for (var i = 0; i < argCount; i++) {
7702
+ O[len] = arguments[i];
7703
+ len++;
7704
+ }
7705
+ setArrayLength(O, len);
7706
+ return len;
7707
+ }
7708
+ });
7709
+
7710
+ // iterable DOM collections
7711
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
7712
+ var domIterables = {
7713
+ CSSRuleList: 0,
7714
+ CSSStyleDeclaration: 0,
7715
+ CSSValueList: 0,
7716
+ ClientRectList: 0,
7717
+ DOMRectList: 0,
7718
+ DOMStringList: 0,
7719
+ DOMTokenList: 1,
7720
+ DataTransferItemList: 0,
7721
+ FileList: 0,
7722
+ HTMLAllCollection: 0,
7723
+ HTMLCollection: 0,
7724
+ HTMLFormElement: 0,
7725
+ HTMLSelectElement: 0,
7726
+ MediaList: 0,
7727
+ MimeTypeArray: 0,
7728
+ NamedNodeMap: 0,
7729
+ NodeList: 1,
7730
+ PaintRequestList: 0,
7731
+ Plugin: 0,
7732
+ PluginArray: 0,
7733
+ SVGLengthList: 0,
7734
+ SVGNumberList: 0,
7735
+ SVGPathSegList: 0,
7736
+ SVGPointList: 0,
7737
+ SVGStringList: 0,
7738
+ SVGTransformList: 0,
7739
+ SourceBufferList: 0,
7740
+ StyleSheetList: 0,
7741
+ TextTrackCueList: 0,
7742
+ TextTrackList: 0,
7743
+ TouchList: 0
7744
+ };
7745
+
7746
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
7747
+ var documentCreateElement = documentCreateElement$2;
7748
+
7749
+ var classList = documentCreateElement('span').classList;
7750
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
7751
+
7752
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
7753
+
7754
+ var global$2 = global$f;
7755
+ var DOMIterables = domIterables;
7756
+ var DOMTokenListPrototype = domTokenListPrototype;
7757
+ var ArrayIteratorMethods = es_array_iterator;
7758
+ var createNonEnumerableProperty = createNonEnumerableProperty$7;
7759
+ var setToStringTag = setToStringTag$3;
7760
+ var wellKnownSymbol$5 = wellKnownSymbol$d;
7761
+
7762
+ var ITERATOR$3 = wellKnownSymbol$5('iterator');
7763
+ var ArrayValues = ArrayIteratorMethods.values;
7764
+
7765
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
7766
+ if (CollectionPrototype) {
7767
+ // some Chrome versions have non-configurable methods on DOMTokenList
7768
+ if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
7769
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR$3, ArrayValues);
7770
+ } catch (error) {
7771
+ CollectionPrototype[ITERATOR$3] = ArrayValues;
7772
+ }
7773
+ setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
7774
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
7775
+ // some Chrome versions have non-configurable methods on DOMTokenList
7776
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
7777
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
7778
+ } catch (error) {
7779
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
7928
7780
  }
7929
7781
  }
7930
- },
7931
- /**
7932
- * get context from localstorage
7933
- *
7934
- * @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
7935
- * @param {any} [tokenKey=TOKEN_KEY] optionnal parameter to specify a token key
7936
- * @returns {number} token value
7937
- */
7938
- getContext(fromStorage = APP_PERSIST_STORES_TYPES[0], contextKey = CONTEXT_KEY) {
7939
- if (typeof window === 'undefined') {
7940
- return undefined;
7941
- }
7942
- // localStorage:
7943
- if (fromStorage === APP_PERSIST_STORES_TYPES[0]) {
7944
- return parseInt(window.localStorage && window.localStorage.getItem(contextKey) || '');
7782
+ }
7783
+ };
7784
+
7785
+ for (var COLLECTION_NAME in DOMIterables) {
7786
+ handlePrototype(global$2[COLLECTION_NAME] && global$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
7787
+ }
7788
+
7789
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
7790
+
7791
+ function allSynchronously(resolvables) {
7792
+ return __awaiter(this, void 0, void 0, function* () {
7793
+ const results = [];
7794
+ for (const resolvable of resolvables) {
7795
+ results.push(yield resolvable());
7945
7796
  }
7946
- // sessionStorage:
7947
- if (fromStorage === APP_PERSIST_STORES_TYPES[1]) {
7948
- return parseInt(window.sessionStorage && window.sessionStorage.getItem(contextKey) || '');
7797
+ return results;
7798
+ });
7799
+ }
7800
+
7801
+ const propertyOf = name => name;
7802
+
7803
+ class ArraysUtils {
7804
+ static isArrayAndContainItems(dataList) {
7805
+ return dataList && Array.isArray(dataList) && dataList.length > 0;
7806
+ }
7807
+ static pushToArray(array, object) {
7808
+ if (ArraysUtils.isArrayAndContainItems(array)) array.push(object);else array = [object];
7809
+ }
7810
+ }
7811
+
7812
+ var $$a = _export;
7813
+ var $includes = arrayIncludes.includes;
7814
+ var fails$2 = fails$i;
7815
+ var addToUnscopables = addToUnscopables$2;
7816
+
7817
+ // FF99+ bug
7818
+ var BROKEN_ON_SPARSE = fails$2(function () {
7819
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
7820
+ return !Array(1).includes();
7821
+ });
7822
+
7823
+ // `Array.prototype.includes` method
7824
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
7825
+ $$a({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
7826
+ includes: function includes(el /* , fromIndex = 0 */) {
7827
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
7828
+ }
7829
+ });
7830
+
7831
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
7832
+ addToUnscopables('includes');
7833
+
7834
+ var isObject = isObject$b;
7835
+ var classof$1 = classofRaw$2;
7836
+ var wellKnownSymbol$4 = wellKnownSymbol$d;
7837
+
7838
+ var MATCH$1 = wellKnownSymbol$4('match');
7839
+
7840
+ // `IsRegExp` abstract operation
7841
+ // https://tc39.es/ecma262/#sec-isregexp
7842
+ var isRegexp = function (it) {
7843
+ var isRegExp;
7844
+ return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$1(it) === 'RegExp');
7845
+ };
7846
+
7847
+ var isRegExp = isRegexp;
7848
+
7849
+ var $TypeError$5 = TypeError;
7850
+
7851
+ var notARegexp = function (it) {
7852
+ if (isRegExp(it)) {
7853
+ throw new $TypeError$5("The method doesn't accept regular expressions");
7854
+ } return it;
7855
+ };
7856
+
7857
+ var wellKnownSymbol$3 = wellKnownSymbol$d;
7858
+
7859
+ var MATCH = wellKnownSymbol$3('match');
7860
+
7861
+ var correctIsRegexpLogic = function (METHOD_NAME) {
7862
+ var regexp = /./;
7863
+ try {
7864
+ '/./'[METHOD_NAME](regexp);
7865
+ } catch (error1) {
7866
+ try {
7867
+ regexp[MATCH] = false;
7868
+ return '/./'[METHOD_NAME](regexp);
7869
+ } catch (error2) { /* empty */ }
7870
+ } return false;
7871
+ };
7872
+
7873
+ var $$9 = _export;
7874
+ var uncurryThis$4 = functionUncurryThis;
7875
+ var notARegExp = notARegexp;
7876
+ var requireObjectCoercible = requireObjectCoercible$5;
7877
+ var toString = toString$5;
7878
+ var correctIsRegExpLogic = correctIsRegexpLogic;
7879
+
7880
+ var stringIndexOf = uncurryThis$4(''.indexOf);
7881
+
7882
+ // `String.prototype.includes` method
7883
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
7884
+ $$9({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
7885
+ includes: function includes(searchString /* , position = 0 */) {
7886
+ return !!~stringIndexOf(
7887
+ toString(requireObjectCoercible(this)),
7888
+ toString(notARegExp(searchString)),
7889
+ arguments.length > 1 ? arguments[1] : undefined
7890
+ );
7891
+ }
7892
+ });
7893
+
7894
+ // import LanguageDetector from 'i18next-browser-languagedetector';
7895
+ const LOCAL_STORAGE_I18N_STRING = 'I18N_SELECTION';
7896
+ const systemDefaultLang = 'en';
7897
+ const init = ({
7898
+ version,
7899
+ customPath
7900
+ }) => {
7901
+ const currentLng = localStorage.getItem(LOCAL_STORAGE_I18N_STRING) || systemDefaultLang;
7902
+ i18n.use(Backend) // load translation using http
7903
+ // .use(LanguageDetector) // detect user language
7904
+ .use(initReactI18next) // passes i18n down to react-i18next
7905
+ .init({
7906
+ lng: currentLng,
7907
+ fallbackLng: systemDefaultLang,
7908
+ ns: ['common', 'inbox'],
7909
+ // define your namespaces
7910
+ defaultNS: 'common',
7911
+ interpolation: {
7912
+ escapeValue: false
7913
+ },
7914
+ load: 'languageOnly',
7915
+ backend: {
7916
+ loadPath: customPath ? customPath : `/assets/locales/{{lng}}/{{ns}}.json?v=${version !== null && version !== void 0 ? version : ''}`
7949
7917
  }
7950
- // default:
7951
- return null;
7918
+ });
7919
+ };
7920
+ const changeLang = lang => {
7921
+ localStorage.setItem(LOCAL_STORAGE_I18N_STRING, lang);
7922
+ i18n.changeLanguage(lang);
7923
+ };
7924
+ const getLang = () => {
7925
+ var _a;
7926
+ return (_a = localStorage.getItem(LOCAL_STORAGE_I18N_STRING)) !== null && _a !== void 0 ? _a : systemDefaultLang;
7927
+ };
7928
+ const LangService = {
7929
+ init,
7930
+ changeLang,
7931
+ getLang
7932
+ };
7933
+ var Languages;
7934
+ (function (Languages) {
7935
+ Languages["EN"] = "en";
7936
+ Languages["AR"] = "ar";
7937
+ Languages["TR"] = "tr";
7938
+ })(Languages || (Languages = {}));
7939
+
7940
+ class StringsUtils {
7941
+ static localCompareStrings(a, b) {
7942
+ const language = LangService.getLang();
7943
+ return a.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr').localeCompare(b.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr'), language !== null && language !== void 0 ? language : 'tr');
7944
+ }
7945
+ static localeIncludeString(a, b) {
7946
+ const language = LangService.getLang();
7947
+ return a.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr').includes(b.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr'));
7948
+ }
7949
+ static isStringHasCharacters(text) {
7950
+ return text && text.length > 0;
7951
+ }
7952
+ }
7953
+
7954
+ const BCRoutesGuard = props => {
7955
+ var _a;
7956
+ const {
7957
+ component: BaseComponent,
7958
+ location
7959
+ } = props,
7960
+ rest = __rest(props, ["component", "location"]);
7961
+ const isUserAuthenticated = !!(auth.getToken() && StringsUtils.isStringHasCharacters((_a = auth.getUserInfo()) === null || _a === void 0 ? void 0 : _a.id));
7962
+ const currentToken = auth.getToken();
7963
+ function CheckNavigation() {
7964
+ // if Unauthenticated go to login page
7965
+ if (!currentToken || !isUserAuthenticated) return jsx(Redirect, {
7966
+ to: {
7967
+ pathname: BCRoutes.Login,
7968
+ state: {
7969
+ from: location
7970
+ }
7971
+ }
7972
+ });
7973
+ return jsx(BaseComponent, Object.assign({}, props));
7952
7974
  }
7975
+ return jsx(Route, Object.assign({}, rest, {
7976
+ render: CheckNavigation
7977
+ }));
7953
7978
  };
7954
7979
 
7955
7980
  const LogoutRoute = _a => {
@@ -8087,7 +8112,7 @@ var isArrayIteratorMethod$1 = function (it) {
8087
8112
  return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$1] === it);
8088
8113
  };
8089
8114
 
8090
- var classof = classof$3;
8115
+ var classof = classof$5;
8091
8116
  var getMethod$1 = getMethod$3;
8092
8117
  var isNullOrUndefined = isNullOrUndefined$3;
8093
8118
  var Iterators = iterators;
@@ -8626,6 +8651,14 @@ var Permission;
8626
8651
  Permission["MANAGE_CONVS"] = "MANAGE_CONVS";
8627
8652
  Permission["MANAGE_CLIENTS"] = "MANAGE_CLIENTS";
8628
8653
  })(Permission || (Permission = {}));
8654
+ var Role;
8655
+ (function (Role) {
8656
+ Role["OWNER"] = "OWNER";
8657
+ Role["ADMIN"] = "ADMIN";
8658
+ Role["MANAGER"] = "MANAGER";
8659
+ Role["AGENT_PLUS"] = "AGENT_PLUS";
8660
+ Role["AGENT"] = "AGENT";
8661
+ })(Role || (Role = {}));
8629
8662
 
8630
8663
  const usePermissions = () => {
8631
8664
  var _a;
@@ -8633,25 +8666,26 @@ const usePermissions = () => {
8633
8666
  const permissions = useMemo(() => {
8634
8667
  const grants = new Set();
8635
8668
  switch (role) {
8636
- case 'OWNER':
8637
- case 'ADMIN':
8669
+ case Role.OWNER:
8670
+ case Role.ADMIN:
8638
8671
  {
8639
8672
  grants.add(Permission.MANAGE_WORKSPACE);
8640
8673
  grants.add(Permission.MANAGE_CONVS);
8641
8674
  grants.add(Permission.MANAGE_CLIENTS);
8642
8675
  break;
8643
8676
  }
8644
- case 'MANAGER':
8677
+ case Role.MANAGER:
8645
8678
  {
8646
8679
  grants.add(Permission.MANAGE_CONVS);
8647
8680
  grants.add(Permission.MANAGE_CLIENTS);
8648
8681
  break;
8649
8682
  }
8650
- case 'AGENT_PLUS':
8683
+ case Role.AGENT_PLUS:
8651
8684
  {
8652
8685
  grants.add(Permission.MANAGE_CLIENTS);
8653
8686
  break;
8654
8687
  }
8688
+ case Role.AGENT:
8655
8689
  }
8656
8690
  return grants;
8657
8691
  }, [role]);
@@ -8663,6 +8697,18 @@ const usePermissions = () => {
8663
8697
  };
8664
8698
  };
8665
8699
 
8700
+ const useRoles = () => {
8701
+ var _a;
8702
+ const role = (_a = auth.getUserInfo()) === null || _a === void 0 ? void 0 : _a.role;
8703
+ const has = checkRole => role === checkRole;
8704
+ const hasAny = checkRoles => checkRoles.includes(role);
8705
+ return {
8706
+ role,
8707
+ has,
8708
+ hasAny
8709
+ };
8710
+ };
8711
+
8666
8712
  const PermissionGuard = _a => {
8667
8713
  var {
8668
8714
  component: Component,
@@ -8707,4 +8753,4 @@ const PermissionGuard = _a => {
8707
8753
  }));
8708
8754
  };
8709
8755
 
8710
- export { ArraysUtils, BCRoutes, BCRoutesGuard, LOCAL_STORAGE_I18N_STRING, LangService, Languages, Loading, LogoutRoute, Permission, PermissionGuard, StringsUtils, allSynchronously, auth, propertyOf, usePermissions };
8756
+ export { ArraysUtils, BCRoutes, BCRoutesGuard, LOCAL_STORAGE_I18N_STRING, LangService, Languages, Loading, LogoutRoute, Permission, PermissionGuard, Role, StringsUtils, allSynchronously, auth, propertyOf, usePermissions, useRoles };