@bcrumbs.net/bc-shared 0.0.7 → 0.0.9

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
@@ -15,6 +15,9 @@ const BroadcastRoot = '/broadcast';
15
15
  const ResourcesRoot = '/resources';
16
16
  const ManagemnetRoot = '/management';
17
17
  const ContactRoot = '/contact';
18
+ const BillingRoot = '/billing';
19
+ /** Base path for analytics / operational reports (not broadcast CRUD). */
20
+ const ReportsRoot = '/reports';
18
21
  const AiRoot = '/ai';
19
22
  const BCRoutes = {
20
23
  AccountDashboard: AccountPortalRoot,
@@ -30,6 +33,7 @@ const BCRoutes = {
30
33
  // It should be like that while it's used by BC-API
31
34
  Register: `${AccountPortalRoot}/register`,
32
35
  Password: `${AccountPortalRoot}/reset/:token`,
36
+ PartnerLogin: `${AccountPortalRoot}/partner-login`,
33
37
  Profile: `${AccountPortalRoot}/profile`,
34
38
  Logout: `${AccountPortalRoot}/logout`,
35
39
  NotFound: `${AccountPortalRoot}/404`,
@@ -65,11 +69,17 @@ const BCRoutes = {
65
69
  AiPreferencesPrompts: `${AiRoot}/preferences/prompts`,
66
70
  AiPreferencesTestNumber: `${AiRoot}/preferences/test-number`,
67
71
  AiPreferencesSuggestedQs: `${AiRoot}/preferences/suggested-qs`,
72
+ AiPreferencesCrumbySettings: `${AiRoot}/preferences/crumby-settings`,
68
73
  Inbox: `${InboxPortalRoot}`,
74
+ AiChat: `${InboxPortalRoot}/ai`,
69
75
  EmbeddedInbox: `${InboxPortalRoot}/embedded`,
70
76
  Broadcast: `${BroadcastRoot}`,
77
+ BroadcastAnalysis: `${BroadcastRoot}/analysis/:id`,
71
78
  BroadcastEdit: `${BroadcastRoot}/edit/:id`,
72
79
  BroadcastCreate: `${BroadcastRoot}/create`,
80
+ BroadcastHistory: `${BroadcastRoot}/history`,
81
+ /** Recipients / message-status report for a date range under {@link ReportsRoot}. */
82
+ DeliveryReport: `${ReportsRoot}/delivery`,
73
83
  ConvsSearch: `${SearchPortalRoot}`,
74
84
  Dashboard: `${Dashboard}`,
75
85
  Managemnet: `${ManagemnetRoot}`,
@@ -77,12 +87,22 @@ const BCRoutes = {
77
87
  AiManagemnet: `${ManagemnetRoot}/ai`,
78
88
  ApikeyManagemnet: `${ManagemnetRoot}/apikey`,
79
89
  WebhookManagemnet: `${ManagemnetRoot}/webhook`,
90
+ CrmIntegrationManagemnet: `${ManagemnetRoot}/crm-integrations`,
80
91
  ConvstageManagemnet: `${ManagemnetRoot}/convstage`,
81
92
  IntegrationManagemnet: `${ManagemnetRoot}/integration`,
93
+ InstagramOAuthCallback: `${ManagemnetRoot}/instagram-oauth-callback`,
94
+ GeneralSettings: `${ManagemnetRoot}/general-settings`,
82
95
  Contact: `${ContactRoot}`,
83
96
  ContactLifeCycle: `${ContactRoot}/contact-life-cycle`,
84
97
  AiAutomation: `${ManagemnetRoot}/ai-automation`,
85
98
  ConversationManagement: `${ManagemnetRoot}/conversation-management`,
99
+ BillingInvoices: `${BillingRoot}/invoices`,
100
+ BillingPendingPayment: `${BillingRoot}/pending-payment`,
101
+ BillingPayment: `${BillingRoot}/payment`,
102
+ BillingPaymentMethod: `${BillingRoot}/payment-method`,
103
+ BillingCheckout: `${BillingRoot}/checkout`,
104
+ BillingRenew: `${BillingRoot}/renew`,
105
+ BillingDone: `${BillingRoot}/done`,
86
106
  Root: '/'
87
107
  };
88
108
 
@@ -7223,11 +7243,103 @@ const auth = {
7223
7243
  }
7224
7244
  };
7225
7245
 
7226
- var objectDefineProperties = {};
7246
+ const BCRoutesGuard = props => {
7247
+ const {
7248
+ component: BaseComponent,
7249
+ location
7250
+ } = props,
7251
+ rest = __rest(props, ["component", "location"]);
7252
+ const currentToken = auth.getToken();
7253
+ function CheckNavigation() {
7254
+ // if Unauthenticated go to login page
7255
+ if (!currentToken) return jsx(Redirect, {
7256
+ to: {
7257
+ pathname: BCRoutes.Login,
7258
+ state: {
7259
+ from: location
7260
+ }
7261
+ }
7262
+ });
7263
+ return jsx(BaseComponent, Object.assign({}, props));
7264
+ }
7265
+ return jsx(Route, Object.assign({}, rest, {
7266
+ render: CheckNavigation
7267
+ }));
7268
+ };
7269
+
7270
+ const LogoutRoute = _a => {
7271
+ var props = __rest(_a, []);
7272
+ auth.clearAllAppStorage();
7273
+ return jsx(Route, Object.assign({}, props, {
7274
+ children: jsx(Redirect, {
7275
+ to: BCRoutes.Login
7276
+ })
7277
+ }));
7278
+ };
7279
+
7280
+ var isPrototypeOf$1 = objectIsPrototypeOf;
7281
+
7282
+ var $TypeError$7 = TypeError;
7283
+
7284
+ var anInstance$1 = function (it, Prototype) {
7285
+ if (isPrototypeOf$1(Prototype, it)) return it;
7286
+ throw new $TypeError$7('Incorrect invocation');
7287
+ };
7288
+
7289
+ var fails$5 = fails$i;
7290
+
7291
+ var correctPrototypeGetter = !fails$5(function () {
7292
+ function F() { /* empty */ }
7293
+ F.prototype.constructor = null;
7294
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
7295
+ return Object.getPrototypeOf(new F()) !== F.prototype;
7296
+ });
7297
+
7298
+ var hasOwn$2 = hasOwnProperty_1;
7299
+ var isCallable$3 = isCallable$i;
7300
+ var toObject$1 = toObject$4;
7301
+ var sharedKey$1 = sharedKey$3;
7302
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
7303
+
7304
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
7305
+ var $Object = Object;
7306
+ var ObjectPrototype = $Object.prototype;
7307
+
7308
+ // `Object.getPrototypeOf` method
7309
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
7310
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
7311
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
7312
+ var object = toObject$1(O);
7313
+ if (hasOwn$2(object, IE_PROTO$1)) return object[IE_PROTO$1];
7314
+ var constructor = object.constructor;
7315
+ if (isCallable$3(constructor) && object instanceof constructor) {
7316
+ return constructor.prototype;
7317
+ } return object instanceof $Object ? ObjectPrototype : null;
7318
+ };
7319
+
7320
+ var makeBuiltIn = makeBuiltInExports;
7321
+ var defineProperty$3 = objectDefineProperty;
7322
+
7323
+ var defineBuiltInAccessor$1 = function (target, name, descriptor) {
7324
+ if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
7325
+ if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
7326
+ return defineProperty$3.f(target, name, descriptor);
7327
+ };
7227
7328
 
7228
7329
  var DESCRIPTORS$4 = descriptors;
7229
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
7230
7330
  var definePropertyModule$1 = objectDefineProperty;
7331
+ var createPropertyDescriptor$1 = createPropertyDescriptor$5;
7332
+
7333
+ var createProperty$1 = function (object, key, value) {
7334
+ if (DESCRIPTORS$4) definePropertyModule$1.f(object, key, createPropertyDescriptor$1(0, value));
7335
+ else object[key] = value;
7336
+ };
7337
+
7338
+ var objectDefineProperties = {};
7339
+
7340
+ var DESCRIPTORS$3 = descriptors;
7341
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
7342
+ var definePropertyModule = objectDefineProperty;
7231
7343
  var anObject$7 = anObject$a;
7232
7344
  var toIndexedObject$1 = toIndexedObject$5;
7233
7345
  var objectKeys = objectKeys$2;
@@ -7235,14 +7347,14 @@ var objectKeys = objectKeys$2;
7235
7347
  // `Object.defineProperties` method
7236
7348
  // https://tc39.es/ecma262/#sec-object.defineproperties
7237
7349
  // eslint-disable-next-line es/no-object-defineproperties -- safe
7238
- objectDefineProperties.f = DESCRIPTORS$4 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
7350
+ objectDefineProperties.f = DESCRIPTORS$3 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
7239
7351
  anObject$7(O);
7240
7352
  var props = toIndexedObject$1(Properties);
7241
7353
  var keys = objectKeys(Properties);
7242
7354
  var length = keys.length;
7243
7355
  var index = 0;
7244
7356
  var key;
7245
- while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
7357
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
7246
7358
  return O;
7247
7359
  };
7248
7360
 
@@ -7257,13 +7369,13 @@ var enumBugKeys = enumBugKeys$3;
7257
7369
  var hiddenKeys = hiddenKeys$4;
7258
7370
  var html = html$1;
7259
7371
  var documentCreateElement$1 = documentCreateElement$2;
7260
- var sharedKey$1 = sharedKey$3;
7372
+ var sharedKey = sharedKey$3;
7261
7373
 
7262
7374
  var GT = '>';
7263
7375
  var LT = '<';
7264
7376
  var PROTOTYPE = 'prototype';
7265
7377
  var SCRIPT = 'script';
7266
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
7378
+ var IE_PROTO = sharedKey('IE_PROTO');
7267
7379
 
7268
7380
  var EmptyConstructor = function () { /* empty */ };
7269
7381
 
@@ -7317,7 +7429,7 @@ var NullProtoObject = function () {
7317
7429
  return NullProtoObject();
7318
7430
  };
7319
7431
 
7320
- hiddenKeys[IE_PROTO$1] = true;
7432
+ hiddenKeys[IE_PROTO] = true;
7321
7433
 
7322
7434
  // `Object.create` method
7323
7435
  // https://tc39.es/ecma262/#sec-object.create
@@ -7329,73 +7441,19 @@ var objectCreate = Object.create || function create(O, Properties) {
7329
7441
  result = new EmptyConstructor();
7330
7442
  EmptyConstructor[PROTOTYPE] = null;
7331
7443
  // add "__proto__" for Object.getPrototypeOf polyfill
7332
- result[IE_PROTO$1] = O;
7444
+ result[IE_PROTO] = O;
7333
7445
  } else result = NullProtoObject();
7334
7446
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
7335
7447
  };
7336
7448
 
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
7449
  var fails$4 = fails$i;
7392
7450
  var isCallable$2 = isCallable$i;
7393
7451
  var isObject$1 = isObject$b;
7394
7452
  var getPrototypeOf$2 = objectGetPrototypeOf;
7395
7453
  var defineBuiltIn$1 = defineBuiltIn$3;
7396
- var wellKnownSymbol$8 = wellKnownSymbol$d;
7454
+ var wellKnownSymbol$9 = wellKnownSymbol$d;
7397
7455
 
7398
- var ITERATOR$5 = wellKnownSymbol$8('iterator');
7456
+ var ITERATOR$5 = wellKnownSymbol$9('iterator');
7399
7457
  var BUGGY_SAFARI_ITERATORS$1 = false;
7400
7458
 
7401
7459
  // `%IteratorPrototype%` object
@@ -7434,96 +7492,368 @@ var iteratorsCore = {
7434
7492
  BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
7435
7493
  };
7436
7494
 
7437
- var defineProperty$2 = objectDefineProperty.f;
7495
+ var $$c = _export;
7496
+ var global$2 = global$f;
7497
+ var anInstance = anInstance$1;
7498
+ var anObject$5 = anObject$a;
7499
+ var isCallable$1 = isCallable$i;
7500
+ var getPrototypeOf$1 = objectGetPrototypeOf;
7501
+ var defineBuiltInAccessor = defineBuiltInAccessor$1;
7502
+ var createProperty = createProperty$1;
7503
+ var fails$3 = fails$i;
7438
7504
  var hasOwn$1 = hasOwnProperty_1;
7439
- var wellKnownSymbol$7 = wellKnownSymbol$d;
7505
+ var wellKnownSymbol$8 = wellKnownSymbol$d;
7506
+ var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
7507
+ var DESCRIPTORS$2 = descriptors;
7440
7508
 
7441
- var TO_STRING_TAG$1 = wellKnownSymbol$7('toStringTag');
7509
+ var CONSTRUCTOR = 'constructor';
7510
+ var ITERATOR$4 = 'Iterator';
7511
+ var TO_STRING_TAG$1 = wellKnownSymbol$8('toStringTag');
7442
7512
 
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
- };
7513
+ var $TypeError$6 = TypeError;
7514
+ var NativeIterator = global$2[ITERATOR$4];
7449
7515
 
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;
7516
+ // FF56- have non-standard global helper `Iterator`
7517
+ var FORCED$1 = !isCallable$1(NativeIterator)
7518
+ || NativeIterator.prototype !== IteratorPrototype$2
7519
+ // FF44- non-standard `Iterator` passes previous tests
7520
+ || !fails$3(function () { NativeIterator({}); });
7455
7521
 
7456
- var returnThis$1 = function () { return this; };
7522
+ var IteratorConstructor = function Iterator() {
7523
+ anInstance(this, IteratorPrototype$2);
7524
+ if (getPrototypeOf$1(this) === IteratorPrototype$2) throw new $TypeError$6('Abstract class Iterator not directly constructable');
7525
+ };
7457
7526
 
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;
7527
+ var defineIteratorPrototypeAccessor = function (key, value) {
7528
+ if (DESCRIPTORS$2) {
7529
+ defineBuiltInAccessor(IteratorPrototype$2, key, {
7530
+ configurable: true,
7531
+ get: function () {
7532
+ return value;
7533
+ },
7534
+ set: function (replacement) {
7535
+ anObject$5(this);
7536
+ if (this === IteratorPrototype$2) throw new $TypeError$6("You can't redefine this property");
7537
+ if (hasOwn$1(this, key)) this[key] = replacement;
7538
+ else createProperty(this, key, replacement);
7539
+ }
7540
+ });
7541
+ } else IteratorPrototype$2[key] = value;
7464
7542
  };
7465
7543
 
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;
7544
+ if (!hasOwn$1(IteratorPrototype$2, TO_STRING_TAG$1)) defineIteratorPrototypeAccessor(TO_STRING_TAG$1, ITERATOR$4);
7479
7545
 
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';
7546
+ if (FORCED$1 || !hasOwn$1(IteratorPrototype$2, CONSTRUCTOR) || IteratorPrototype$2[CONSTRUCTOR] === Object) {
7547
+ defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
7548
+ }
7488
7549
 
7489
- var returnThis = function () { return this; };
7550
+ IteratorConstructor.prototype = IteratorPrototype$2;
7490
7551
 
7491
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
7492
- createIteratorConstructor(IteratorConstructor, NAME, next);
7552
+ // `Iterator` constructor
7553
+ // https://github.com/tc39/proposal-iterator-helpers
7554
+ $$c({ global: true, constructor: true, forced: FORCED$1 }, {
7555
+ Iterator: IteratorConstructor
7556
+ });
7493
7557
 
7494
- var getIterationMethod = function (KIND) {
7495
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
7496
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
7558
+ var classofRaw = classofRaw$2;
7559
+ var uncurryThis$4 = functionUncurryThis;
7497
7560
 
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
- }
7561
+ var functionUncurryThisClause = function (fn) {
7562
+ // Nashorn bug:
7563
+ // https://github.com/zloirock/core-js/issues/1128
7564
+ // https://github.com/zloirock/core-js/issues/1130
7565
+ if (classofRaw(fn) === 'Function') return uncurryThis$4(fn);
7566
+ };
7503
7567
 
7504
- return function () { return new IteratorConstructor(this); };
7568
+ var uncurryThis$3 = functionUncurryThisClause;
7569
+ var aCallable$3 = aCallable$6;
7570
+ var NATIVE_BIND = functionBindNative;
7571
+
7572
+ var bind$1 = uncurryThis$3(uncurryThis$3.bind);
7573
+
7574
+ // optional / simple context binding
7575
+ var functionBindContext = function (fn, that) {
7576
+ aCallable$3(fn);
7577
+ return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
7578
+ return fn.apply(that, arguments);
7505
7579
  };
7580
+ };
7506
7581
 
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;
7582
+ var iterators = {};
7516
7583
 
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
- }
7584
+ var wellKnownSymbol$7 = wellKnownSymbol$d;
7585
+ var Iterators$4 = iterators;
7586
+
7587
+ var ITERATOR$3 = wellKnownSymbol$7('iterator');
7588
+ var ArrayPrototype$1 = Array.prototype;
7589
+
7590
+ // check on default Array iterator
7591
+ var isArrayIteratorMethod$1 = function (it) {
7592
+ return it !== undefined && (Iterators$4.Array === it || ArrayPrototype$1[ITERATOR$3] === it);
7593
+ };
7594
+
7595
+ var classof$1 = classof$5;
7596
+ var getMethod$1 = getMethod$3;
7597
+ var isNullOrUndefined = isNullOrUndefined$3;
7598
+ var Iterators$3 = iterators;
7599
+ var wellKnownSymbol$6 = wellKnownSymbol$d;
7600
+
7601
+ var ITERATOR$2 = wellKnownSymbol$6('iterator');
7602
+
7603
+ var getIteratorMethod$2 = function (it) {
7604
+ if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$2)
7605
+ || getMethod$1(it, '@@iterator')
7606
+ || Iterators$3[classof$1(it)];
7607
+ };
7608
+
7609
+ var call$5 = functionCall;
7610
+ var aCallable$2 = aCallable$6;
7611
+ var anObject$4 = anObject$a;
7612
+ var tryToString$1 = tryToString$3;
7613
+ var getIteratorMethod$1 = getIteratorMethod$2;
7614
+
7615
+ var $TypeError$5 = TypeError;
7616
+
7617
+ var getIterator$1 = function (argument, usingIterator) {
7618
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
7619
+ if (aCallable$2(iteratorMethod)) return anObject$4(call$5(iteratorMethod, argument));
7620
+ throw new $TypeError$5(tryToString$1(argument) + ' is not iterable');
7621
+ };
7622
+
7623
+ var call$4 = functionCall;
7624
+ var anObject$3 = anObject$a;
7625
+ var getMethod = getMethod$3;
7626
+
7627
+ var iteratorClose$3 = function (iterator, kind, value) {
7628
+ var innerResult, innerError;
7629
+ anObject$3(iterator);
7630
+ try {
7631
+ innerResult = getMethod(iterator, 'return');
7632
+ if (!innerResult) {
7633
+ if (kind === 'throw') throw value;
7634
+ return value;
7635
+ }
7636
+ innerResult = call$4(innerResult, iterator);
7637
+ } catch (error) {
7638
+ innerError = true;
7639
+ innerResult = error;
7640
+ }
7641
+ if (kind === 'throw') throw value;
7642
+ if (innerError) throw innerResult;
7643
+ anObject$3(innerResult);
7644
+ return value;
7645
+ };
7646
+
7647
+ var bind = functionBindContext;
7648
+ var call$3 = functionCall;
7649
+ var anObject$2 = anObject$a;
7650
+ var tryToString = tryToString$3;
7651
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
7652
+ var lengthOfArrayLike$1 = lengthOfArrayLike$3;
7653
+ var isPrototypeOf = objectIsPrototypeOf;
7654
+ var getIterator = getIterator$1;
7655
+ var getIteratorMethod = getIteratorMethod$2;
7656
+ var iteratorClose$2 = iteratorClose$3;
7657
+
7658
+ var $TypeError$4 = TypeError;
7659
+
7660
+ var Result = function (stopped, result) {
7661
+ this.stopped = stopped;
7662
+ this.result = result;
7663
+ };
7664
+
7665
+ var ResultPrototype = Result.prototype;
7666
+
7667
+ var iterate$3 = function (iterable, unboundFunction, options) {
7668
+ var that = options && options.that;
7669
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
7670
+ var IS_RECORD = !!(options && options.IS_RECORD);
7671
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
7672
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
7673
+ var fn = bind(unboundFunction, that);
7674
+ var iterator, iterFn, index, length, result, next, step;
7675
+
7676
+ var stop = function (condition) {
7677
+ if (iterator) iteratorClose$2(iterator, 'normal', condition);
7678
+ return new Result(true, condition);
7679
+ };
7680
+
7681
+ var callFn = function (value) {
7682
+ if (AS_ENTRIES) {
7683
+ anObject$2(value);
7684
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
7685
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
7686
+ };
7687
+
7688
+ if (IS_RECORD) {
7689
+ iterator = iterable.iterator;
7690
+ } else if (IS_ITERATOR) {
7691
+ iterator = iterable;
7692
+ } else {
7693
+ iterFn = getIteratorMethod(iterable);
7694
+ if (!iterFn) throw new $TypeError$4(tryToString(iterable) + ' is not iterable');
7695
+ // optimisation for array iterators
7696
+ if (isArrayIteratorMethod(iterFn)) {
7697
+ for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
7698
+ result = callFn(iterable[index]);
7699
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
7700
+ } return new Result(false);
7701
+ }
7702
+ iterator = getIterator(iterable, iterFn);
7703
+ }
7704
+
7705
+ next = IS_RECORD ? iterable.next : iterator.next;
7706
+ while (!(step = call$3(next, iterator)).done) {
7707
+ try {
7708
+ result = callFn(step.value);
7709
+ } catch (error) {
7710
+ iteratorClose$2(iterator, 'throw', error);
7711
+ }
7712
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
7713
+ } return new Result(false);
7714
+ };
7715
+
7716
+ // `GetIteratorDirect(obj)` abstract operation
7717
+ // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
7718
+ var getIteratorDirect$2 = function (obj) {
7719
+ return {
7720
+ iterator: obj,
7721
+ next: obj.next,
7722
+ done: false
7723
+ };
7724
+ };
7725
+
7726
+ var $$b = _export;
7727
+ var iterate$2 = iterate$3;
7728
+ var aCallable$1 = aCallable$6;
7729
+ var anObject$1 = anObject$a;
7730
+ var getIteratorDirect$1 = getIteratorDirect$2;
7731
+
7732
+ // `Iterator.prototype.every` method
7733
+ // https://github.com/tc39/proposal-iterator-helpers
7734
+ $$b({ target: 'Iterator', proto: true, real: true }, {
7735
+ every: function every(predicate) {
7736
+ anObject$1(this);
7737
+ aCallable$1(predicate);
7738
+ var record = getIteratorDirect$1(this);
7739
+ var counter = 0;
7740
+ return !iterate$2(record, function (value, stop) {
7741
+ if (!predicate(value, counter++)) return stop();
7742
+ }, { IS_RECORD: true, INTERRUPTED: true }).stopped;
7743
+ }
7744
+ });
7745
+
7746
+ var wellKnownSymbol$5 = wellKnownSymbol$d;
7747
+ var create$1 = objectCreate;
7748
+ var defineProperty$2 = objectDefineProperty.f;
7749
+
7750
+ var UNSCOPABLES = wellKnownSymbol$5('unscopables');
7751
+ var ArrayPrototype = Array.prototype;
7752
+
7753
+ // Array.prototype[@@unscopables]
7754
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
7755
+ if (ArrayPrototype[UNSCOPABLES] === undefined) {
7756
+ defineProperty$2(ArrayPrototype, UNSCOPABLES, {
7757
+ configurable: true,
7758
+ value: create$1(null)
7759
+ });
7760
+ }
7761
+
7762
+ // add a key to Array.prototype[@@unscopables]
7763
+ var addToUnscopables$2 = function (key) {
7764
+ ArrayPrototype[UNSCOPABLES][key] = true;
7765
+ };
7766
+
7767
+ var defineProperty$1 = objectDefineProperty.f;
7768
+ var hasOwn = hasOwnProperty_1;
7769
+ var wellKnownSymbol$4 = wellKnownSymbol$d;
7770
+
7771
+ var TO_STRING_TAG = wellKnownSymbol$4('toStringTag');
7772
+
7773
+ var setToStringTag$3 = function (target, TAG, STATIC) {
7774
+ if (target && !STATIC) target = target.prototype;
7775
+ if (target && !hasOwn(target, TO_STRING_TAG)) {
7776
+ defineProperty$1(target, TO_STRING_TAG, { configurable: true, value: TAG });
7777
+ }
7778
+ };
7779
+
7780
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
7781
+ var create = objectCreate;
7782
+ var createPropertyDescriptor = createPropertyDescriptor$5;
7783
+ var setToStringTag$2 = setToStringTag$3;
7784
+ var Iterators$2 = iterators;
7785
+
7786
+ var returnThis$1 = function () { return this; };
7787
+
7788
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
7789
+ var TO_STRING_TAG = NAME + ' Iterator';
7790
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
7791
+ setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
7792
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
7793
+ return IteratorConstructor;
7794
+ };
7795
+
7796
+ var $$a = _export;
7797
+ var call$2 = functionCall;
7798
+ var FunctionName = functionName;
7799
+ var isCallable = isCallable$i;
7800
+ var createIteratorConstructor = iteratorCreateConstructor;
7801
+ var getPrototypeOf = objectGetPrototypeOf;
7802
+ var setPrototypeOf = objectSetPrototypeOf;
7803
+ var setToStringTag$1 = setToStringTag$3;
7804
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
7805
+ var defineBuiltIn = defineBuiltIn$3;
7806
+ var wellKnownSymbol$3 = wellKnownSymbol$d;
7807
+ var Iterators$1 = iterators;
7808
+ var IteratorsCore = iteratorsCore;
7809
+
7810
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
7811
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
7812
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
7813
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
7814
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
7815
+ var KEYS = 'keys';
7816
+ var VALUES = 'values';
7817
+ var ENTRIES = 'entries';
7818
+
7819
+ var returnThis = function () { return this; };
7820
+
7821
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
7822
+ createIteratorConstructor(IteratorConstructor, NAME, next);
7823
+
7824
+ var getIterationMethod = function (KIND) {
7825
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
7826
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
7827
+
7828
+ switch (KIND) {
7829
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
7830
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
7831
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
7832
+ }
7833
+
7834
+ return function () { return new IteratorConstructor(this); };
7835
+ };
7836
+
7837
+ var TO_STRING_TAG = NAME + ' Iterator';
7838
+ var INCORRECT_VALUES_NAME = false;
7839
+ var IterablePrototype = Iterable.prototype;
7840
+ var nativeIterator = IterablePrototype[ITERATOR$1]
7841
+ || IterablePrototype['@@iterator']
7842
+ || DEFAULT && IterablePrototype[DEFAULT];
7843
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
7844
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
7845
+ var CurrentIteratorPrototype, methods, KEY;
7846
+
7847
+ // fix native
7848
+ if (anyNativeIterator) {
7849
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
7850
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
7851
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
7852
+ if (setPrototypeOf) {
7853
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
7854
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
7855
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
7856
+ }
7527
7857
  }
7528
7858
  // Set @@toStringTag to native iterators
7529
7859
  setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
@@ -7536,7 +7866,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
7536
7866
  createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
7537
7867
  } else {
7538
7868
  INCORRECT_VALUES_NAME = true;
7539
- defaultIterator = function values() { return call$5(nativeIterator, this); };
7869
+ defaultIterator = function values() { return call$2(nativeIterator, this); };
7540
7870
  }
7541
7871
  }
7542
7872
 
@@ -7551,14 +7881,14 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
7551
7881
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
7552
7882
  defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
7553
7883
  }
7554
- } else $$c({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
7884
+ } else $$a({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
7555
7885
  }
7556
7886
 
7557
7887
  // define iterator
7558
- if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
7559
- defineBuiltIn(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
7888
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
7889
+ defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
7560
7890
  }
7561
- Iterators$3[NAME] = defaultIterator;
7891
+ Iterators$1[NAME] = defaultIterator;
7562
7892
 
7563
7893
  return methods;
7564
7894
  };
@@ -7571,12 +7901,12 @@ var createIterResultObject$1 = function (value, done) {
7571
7901
 
7572
7902
  var toIndexedObject = toIndexedObject$5;
7573
7903
  var addToUnscopables$1 = addToUnscopables$2;
7574
- var Iterators$2 = iterators;
7904
+ var Iterators = iterators;
7575
7905
  var InternalStateModule = internalState;
7576
- var defineProperty$1 = objectDefineProperty.f;
7906
+ var defineProperty = objectDefineProperty.f;
7577
7907
  var defineIterator = iteratorDefine;
7578
7908
  var createIterResultObject = createIterResultObject$1;
7579
- var DESCRIPTORS$3 = descriptors;
7909
+ var DESCRIPTORS$1 = descriptors;
7580
7910
 
7581
7911
  var ARRAY_ITERATOR = 'Array Iterator';
7582
7912
  var setInternalState = InternalStateModule.set;
@@ -7618,7 +7948,7 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
7618
7948
  // argumentsList[@@iterator] is %ArrayProto_values%
7619
7949
  // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
7620
7950
  // https://tc39.es/ecma262/#sec-createmappedargumentsobject
7621
- var values = Iterators$2.Arguments = Iterators$2.Array;
7951
+ var values = Iterators.Arguments = Iterators.Array;
7622
7952
 
7623
7953
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
7624
7954
  addToUnscopables$1('keys');
@@ -7626,19 +7956,19 @@ addToUnscopables$1('values');
7626
7956
  addToUnscopables$1('entries');
7627
7957
 
7628
7958
  // V8 ~ Chrome 45- bug
7629
- if (DESCRIPTORS$3 && values.name !== 'values') try {
7630
- defineProperty$1(values, 'name', { value: 'values' });
7959
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
7960
+ defineProperty(values, 'name', { value: 'values' });
7631
7961
  } catch (error) { /* empty */ }
7632
7962
 
7633
- var DESCRIPTORS$2 = descriptors;
7963
+ var DESCRIPTORS = descriptors;
7634
7964
  var isArray = isArray$2;
7635
7965
 
7636
- var $TypeError$7 = TypeError;
7966
+ var $TypeError$3 = TypeError;
7637
7967
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
7638
7968
  var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
7639
7969
 
7640
7970
  // Safari < 13 does not throw an error in this case
7641
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$2 && !function () {
7971
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
7642
7972
  // makes no sense without proper strict mode support
7643
7973
  if (this !== undefined) return true;
7644
7974
  try {
@@ -7651,28 +7981,28 @@ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$2 && !function () {
7651
7981
 
7652
7982
  var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
7653
7983
  if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
7654
- throw new $TypeError$7('Cannot set read only .length');
7984
+ throw new $TypeError$3('Cannot set read only .length');
7655
7985
  } return O.length = length;
7656
7986
  } : function (O, length) {
7657
7987
  return O.length = length;
7658
7988
  };
7659
7989
 
7660
- var $TypeError$6 = TypeError;
7990
+ var $TypeError$2 = TypeError;
7661
7991
  var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
7662
7992
 
7663
7993
  var doesNotExceedSafeInteger$1 = function (it) {
7664
- if (it > MAX_SAFE_INTEGER) throw $TypeError$6('Maximum allowed index exceeded');
7994
+ if (it > MAX_SAFE_INTEGER) throw $TypeError$2('Maximum allowed index exceeded');
7665
7995
  return it;
7666
7996
  };
7667
7997
 
7668
- var $$b = _export;
7998
+ var $$9 = _export;
7669
7999
  var toObject = toObject$4;
7670
- var lengthOfArrayLike$1 = lengthOfArrayLike$3;
8000
+ var lengthOfArrayLike = lengthOfArrayLike$3;
7671
8001
  var setArrayLength = arraySetLength;
7672
8002
  var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
7673
- var fails$3 = fails$i;
8003
+ var fails$2 = fails$i;
7674
8004
 
7675
- var INCORRECT_TO_LENGTH = fails$3(function () {
8005
+ var INCORRECT_TO_LENGTH = fails$2(function () {
7676
8006
  return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
7677
8007
  });
7678
8008
 
@@ -7687,15 +8017,15 @@ var properErrorOnNonWritableLength = function () {
7687
8017
  }
7688
8018
  };
7689
8019
 
7690
- var FORCED$1 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
8020
+ var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
7691
8021
 
7692
8022
  // `Array.prototype.push` method
7693
8023
  // https://tc39.es/ecma262/#sec-array.prototype.push
7694
- $$b({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
8024
+ $$9({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
7695
8025
  // eslint-disable-next-line no-unused-vars -- required for `.length`
7696
8026
  push: function push(item) {
7697
8027
  var O = toObject(this);
7698
- var len = lengthOfArrayLike$1(O);
8028
+ var len = lengthOfArrayLike(O);
7699
8029
  var argCount = arguments.length;
7700
8030
  doesNotExceedSafeInteger(len + argCount);
7701
8031
  for (var i = 0; i < argCount; i++) {
@@ -7751,24 +8081,24 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
7751
8081
 
7752
8082
  var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
7753
8083
 
7754
- var global$2 = global$f;
8084
+ var global$1 = global$f;
7755
8085
  var DOMIterables = domIterables;
7756
8086
  var DOMTokenListPrototype = domTokenListPrototype;
7757
8087
  var ArrayIteratorMethods = es_array_iterator;
7758
8088
  var createNonEnumerableProperty = createNonEnumerableProperty$7;
7759
8089
  var setToStringTag = setToStringTag$3;
7760
- var wellKnownSymbol$5 = wellKnownSymbol$d;
8090
+ var wellKnownSymbol$2 = wellKnownSymbol$d;
7761
8091
 
7762
- var ITERATOR$3 = wellKnownSymbol$5('iterator');
8092
+ var ITERATOR = wellKnownSymbol$2('iterator');
7763
8093
  var ArrayValues = ArrayIteratorMethods.values;
7764
8094
 
7765
8095
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
7766
8096
  if (CollectionPrototype) {
7767
8097
  // some Chrome versions have non-configurable methods on DOMTokenList
7768
- if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
7769
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$3, ArrayValues);
8098
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
8099
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
7770
8100
  } catch (error) {
7771
- CollectionPrototype[ITERATOR$3] = ArrayValues;
8101
+ CollectionPrototype[ITERATOR] = ArrayValues;
7772
8102
  }
7773
8103
  setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
7774
8104
  if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
@@ -7782,486 +8112,176 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
7782
8112
  }
7783
8113
  };
7784
8114
 
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());
7796
- }
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 : ''}`
7917
- }
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));
7974
- }
7975
- return jsx(Route, Object.assign({}, rest, {
7976
- render: CheckNavigation
7977
- }));
7978
- };
7979
-
7980
- const LogoutRoute = _a => {
7981
- var props = __rest(_a, []);
7982
- auth.clearAllAppStorage();
7983
- return jsx(Route, Object.assign({}, props, {
7984
- children: jsx(Redirect, {
7985
- to: BCRoutes.Login
7986
- })
7987
- }));
7988
- };
7989
-
7990
- var isPrototypeOf$1 = objectIsPrototypeOf;
7991
-
7992
- var $TypeError$4 = TypeError;
7993
-
7994
- var anInstance$1 = function (it, Prototype) {
7995
- if (isPrototypeOf$1(Prototype, it)) return it;
7996
- throw new $TypeError$4('Incorrect invocation');
7997
- };
7998
-
7999
- var makeBuiltIn = makeBuiltInExports;
8000
- var defineProperty = objectDefineProperty;
8001
-
8002
- var defineBuiltInAccessor$1 = function (target, name, descriptor) {
8003
- if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
8004
- if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
8005
- return defineProperty.f(target, name, descriptor);
8006
- };
8007
-
8008
- var DESCRIPTORS$1 = descriptors;
8009
- var definePropertyModule = objectDefineProperty;
8010
- var createPropertyDescriptor = createPropertyDescriptor$5;
8011
-
8012
- var createProperty$1 = function (object, key, value) {
8013
- if (DESCRIPTORS$1) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
8014
- else object[key] = value;
8015
- };
8016
-
8017
- var $$8 = _export;
8018
- var global$1 = global$f;
8019
- var anInstance = anInstance$1;
8020
- var anObject$5 = anObject$a;
8021
- var isCallable = isCallable$i;
8022
- var getPrototypeOf = objectGetPrototypeOf;
8023
- var defineBuiltInAccessor = defineBuiltInAccessor$1;
8024
- var createProperty = createProperty$1;
8025
- var fails$1 = fails$i;
8026
- var hasOwn = hasOwnProperty_1;
8027
- var wellKnownSymbol$2 = wellKnownSymbol$d;
8028
- var IteratorPrototype = iteratorsCore.IteratorPrototype;
8029
- var DESCRIPTORS = descriptors;
8030
-
8031
- var CONSTRUCTOR = 'constructor';
8032
- var ITERATOR$2 = 'Iterator';
8033
- var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
8034
-
8035
- var $TypeError$3 = TypeError;
8036
- var NativeIterator = global$1[ITERATOR$2];
8037
-
8038
- // FF56- have non-standard global helper `Iterator`
8039
- var FORCED = !isCallable(NativeIterator)
8040
- || NativeIterator.prototype !== IteratorPrototype
8041
- // FF44- non-standard `Iterator` passes previous tests
8042
- || !fails$1(function () { NativeIterator({}); });
8043
-
8044
- var IteratorConstructor = function Iterator() {
8045
- anInstance(this, IteratorPrototype);
8046
- if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError$3('Abstract class Iterator not directly constructable');
8047
- };
8048
-
8049
- var defineIteratorPrototypeAccessor = function (key, value) {
8050
- if (DESCRIPTORS) {
8051
- defineBuiltInAccessor(IteratorPrototype, key, {
8052
- configurable: true,
8053
- get: function () {
8054
- return value;
8055
- },
8056
- set: function (replacement) {
8057
- anObject$5(this);
8058
- if (this === IteratorPrototype) throw new $TypeError$3("You can't redefine this property");
8059
- if (hasOwn(this, key)) this[key] = replacement;
8060
- else createProperty(this, key, replacement);
8061
- }
8062
- });
8063
- } else IteratorPrototype[key] = value;
8064
- };
8065
-
8066
- if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR$2);
8067
-
8068
- if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
8069
- defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
8070
- }
8071
-
8072
- IteratorConstructor.prototype = IteratorPrototype;
8073
-
8074
- // `Iterator` constructor
8075
- // https://github.com/tc39/proposal-iterator-helpers
8076
- $$8({ global: true, constructor: true, forced: FORCED }, {
8077
- Iterator: IteratorConstructor
8078
- });
8079
-
8080
- var classofRaw = classofRaw$2;
8081
- var uncurryThis$3 = functionUncurryThis;
8082
-
8083
- var functionUncurryThisClause = function (fn) {
8084
- // Nashorn bug:
8085
- // https://github.com/zloirock/core-js/issues/1128
8086
- // https://github.com/zloirock/core-js/issues/1130
8087
- if (classofRaw(fn) === 'Function') return uncurryThis$3(fn);
8088
- };
8089
-
8090
- var uncurryThis$2 = functionUncurryThisClause;
8091
- var aCallable$3 = aCallable$6;
8092
- var NATIVE_BIND = functionBindNative;
8093
-
8094
- var bind$1 = uncurryThis$2(uncurryThis$2.bind);
8095
-
8096
- // optional / simple context binding
8097
- var functionBindContext = function (fn, that) {
8098
- aCallable$3(fn);
8099
- return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
8100
- return fn.apply(that, arguments);
8101
- };
8102
- };
8103
-
8104
- var wellKnownSymbol$1 = wellKnownSymbol$d;
8105
- var Iterators$1 = iterators;
8115
+ for (var COLLECTION_NAME in DOMIterables) {
8116
+ handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
8117
+ }
8106
8118
 
8107
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
8108
- var ArrayPrototype = Array.prototype;
8119
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
8109
8120
 
8110
- // check on default Array iterator
8111
- var isArrayIteratorMethod$1 = function (it) {
8112
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$1] === it);
8113
- };
8121
+ function allSynchronously(resolvables) {
8122
+ return __awaiter(this, void 0, void 0, function* () {
8123
+ const results = [];
8124
+ for (const resolvable of resolvables) {
8125
+ results.push(yield resolvable());
8126
+ }
8127
+ return results;
8128
+ });
8129
+ }
8114
8130
 
8115
- var classof = classof$5;
8116
- var getMethod$1 = getMethod$3;
8117
- var isNullOrUndefined = isNullOrUndefined$3;
8118
- var Iterators = iterators;
8119
- var wellKnownSymbol = wellKnownSymbol$d;
8131
+ const propertyOf = name => name;
8120
8132
 
8121
- var ITERATOR = wellKnownSymbol('iterator');
8133
+ class ArraysUtils {
8134
+ static isArrayAndContainItems(dataList) {
8135
+ return dataList && Array.isArray(dataList) && dataList.length > 0;
8136
+ }
8137
+ static pushToArray(array, object) {
8138
+ if (ArraysUtils.isArrayAndContainItems(array)) array.push(object);else array = [object];
8139
+ }
8140
+ }
8122
8141
 
8123
- var getIteratorMethod$2 = function (it) {
8124
- if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR)
8125
- || getMethod$1(it, '@@iterator')
8126
- || Iterators[classof(it)];
8127
- };
8142
+ var $$8 = _export;
8143
+ var $includes = arrayIncludes.includes;
8144
+ var fails$1 = fails$i;
8145
+ var addToUnscopables = addToUnscopables$2;
8128
8146
 
8129
- var call$4 = functionCall;
8130
- var aCallable$2 = aCallable$6;
8131
- var anObject$4 = anObject$a;
8132
- var tryToString$1 = tryToString$3;
8133
- var getIteratorMethod$1 = getIteratorMethod$2;
8147
+ // FF99+ bug
8148
+ var BROKEN_ON_SPARSE = fails$1(function () {
8149
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
8150
+ return !Array(1).includes();
8151
+ });
8134
8152
 
8135
- var $TypeError$2 = TypeError;
8153
+ // `Array.prototype.includes` method
8154
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
8155
+ $$8({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
8156
+ includes: function includes(el /* , fromIndex = 0 */) {
8157
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
8158
+ }
8159
+ });
8136
8160
 
8137
- var getIterator$1 = function (argument, usingIterator) {
8138
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
8139
- if (aCallable$2(iteratorMethod)) return anObject$4(call$4(iteratorMethod, argument));
8140
- throw new $TypeError$2(tryToString$1(argument) + ' is not iterable');
8141
- };
8161
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
8162
+ addToUnscopables('includes');
8142
8163
 
8143
- var call$3 = functionCall;
8144
- var anObject$3 = anObject$a;
8145
- var getMethod = getMethod$3;
8164
+ var isObject = isObject$b;
8165
+ var classof = classofRaw$2;
8166
+ var wellKnownSymbol$1 = wellKnownSymbol$d;
8146
8167
 
8147
- var iteratorClose$3 = function (iterator, kind, value) {
8148
- var innerResult, innerError;
8149
- anObject$3(iterator);
8150
- try {
8151
- innerResult = getMethod(iterator, 'return');
8152
- if (!innerResult) {
8153
- if (kind === 'throw') throw value;
8154
- return value;
8155
- }
8156
- innerResult = call$3(innerResult, iterator);
8157
- } catch (error) {
8158
- innerError = true;
8159
- innerResult = error;
8160
- }
8161
- if (kind === 'throw') throw value;
8162
- if (innerError) throw innerResult;
8163
- anObject$3(innerResult);
8164
- return value;
8168
+ var MATCH$1 = wellKnownSymbol$1('match');
8169
+
8170
+ // `IsRegExp` abstract operation
8171
+ // https://tc39.es/ecma262/#sec-isregexp
8172
+ var isRegexp = function (it) {
8173
+ var isRegExp;
8174
+ return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
8165
8175
  };
8166
8176
 
8167
- var bind = functionBindContext;
8168
- var call$2 = functionCall;
8169
- var anObject$2 = anObject$a;
8170
- var tryToString = tryToString$3;
8171
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
8172
- var lengthOfArrayLike = lengthOfArrayLike$3;
8173
- var isPrototypeOf = objectIsPrototypeOf;
8174
- var getIterator = getIterator$1;
8175
- var getIteratorMethod = getIteratorMethod$2;
8176
- var iteratorClose$2 = iteratorClose$3;
8177
+ var isRegExp = isRegexp;
8177
8178
 
8178
8179
  var $TypeError$1 = TypeError;
8179
8180
 
8180
- var Result = function (stopped, result) {
8181
- this.stopped = stopped;
8182
- this.result = result;
8181
+ var notARegexp = function (it) {
8182
+ if (isRegExp(it)) {
8183
+ throw new $TypeError$1("The method doesn't accept regular expressions");
8184
+ } return it;
8183
8185
  };
8184
8186
 
8185
- var ResultPrototype = Result.prototype;
8187
+ var wellKnownSymbol = wellKnownSymbol$d;
8186
8188
 
8187
- var iterate$3 = function (iterable, unboundFunction, options) {
8188
- var that = options && options.that;
8189
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
8190
- var IS_RECORD = !!(options && options.IS_RECORD);
8191
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
8192
- var INTERRUPTED = !!(options && options.INTERRUPTED);
8193
- var fn = bind(unboundFunction, that);
8194
- var iterator, iterFn, index, length, result, next, step;
8189
+ var MATCH = wellKnownSymbol('match');
8195
8190
 
8196
- var stop = function (condition) {
8197
- if (iterator) iteratorClose$2(iterator, 'normal', condition);
8198
- return new Result(true, condition);
8199
- };
8191
+ var correctIsRegexpLogic = function (METHOD_NAME) {
8192
+ var regexp = /./;
8193
+ try {
8194
+ '/./'[METHOD_NAME](regexp);
8195
+ } catch (error1) {
8196
+ try {
8197
+ regexp[MATCH] = false;
8198
+ return '/./'[METHOD_NAME](regexp);
8199
+ } catch (error2) { /* empty */ }
8200
+ } return false;
8201
+ };
8200
8202
 
8201
- var callFn = function (value) {
8202
- if (AS_ENTRIES) {
8203
- anObject$2(value);
8204
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
8205
- } return INTERRUPTED ? fn(value, stop) : fn(value);
8206
- };
8203
+ var $$7 = _export;
8204
+ var uncurryThis$2 = functionUncurryThis;
8205
+ var notARegExp = notARegexp;
8206
+ var requireObjectCoercible = requireObjectCoercible$5;
8207
+ var toString = toString$5;
8208
+ var correctIsRegExpLogic = correctIsRegexpLogic;
8207
8209
 
8208
- if (IS_RECORD) {
8209
- iterator = iterable.iterator;
8210
- } else if (IS_ITERATOR) {
8211
- iterator = iterable;
8212
- } else {
8213
- iterFn = getIteratorMethod(iterable);
8214
- if (!iterFn) throw new $TypeError$1(tryToString(iterable) + ' is not iterable');
8215
- // optimisation for array iterators
8216
- if (isArrayIteratorMethod(iterFn)) {
8217
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
8218
- result = callFn(iterable[index]);
8219
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
8220
- } return new Result(false);
8221
- }
8222
- iterator = getIterator(iterable, iterFn);
8210
+ var stringIndexOf = uncurryThis$2(''.indexOf);
8211
+
8212
+ // `String.prototype.includes` method
8213
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
8214
+ $$7({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
8215
+ includes: function includes(searchString /* , position = 0 */) {
8216
+ return !!~stringIndexOf(
8217
+ toString(requireObjectCoercible(this)),
8218
+ toString(notARegExp(searchString)),
8219
+ arguments.length > 1 ? arguments[1] : undefined
8220
+ );
8223
8221
  }
8222
+ });
8224
8223
 
8225
- next = IS_RECORD ? iterable.next : iterator.next;
8226
- while (!(step = call$2(next, iterator)).done) {
8227
- try {
8228
- result = callFn(step.value);
8229
- } catch (error) {
8230
- iteratorClose$2(iterator, 'throw', error);
8224
+ // import LanguageDetector from 'i18next-browser-languagedetector';
8225
+ const LOCAL_STORAGE_I18N_STRING = 'I18N_SELECTION';
8226
+ const systemDefaultLang = 'en';
8227
+ const init = ({
8228
+ version,
8229
+ customPath
8230
+ }) => {
8231
+ const currentLng = localStorage.getItem(LOCAL_STORAGE_I18N_STRING) || systemDefaultLang;
8232
+ document.documentElement.setAttribute('lang', currentLng);
8233
+ i18n.use(Backend) // load translation using http
8234
+ // .use(LanguageDetector) // detect user language
8235
+ .use(initReactI18next) // passes i18n down to react-i18next
8236
+ .init({
8237
+ lng: currentLng,
8238
+ fallbackLng: systemDefaultLang,
8239
+ ns: ['common', 'inbox'],
8240
+ // define your namespaces
8241
+ defaultNS: 'common',
8242
+ interpolation: {
8243
+ escapeValue: false
8244
+ },
8245
+ load: 'languageOnly',
8246
+ backend: {
8247
+ loadPath: customPath ? customPath : `/assets/locales/{{lng}}/{{ns}}.json?v=${version !== null && version !== void 0 ? version : ''}`
8231
8248
  }
8232
- if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
8233
- } return new Result(false);
8249
+ });
8234
8250
  };
8235
-
8236
- // `GetIteratorDirect(obj)` abstract operation
8237
- // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
8238
- var getIteratorDirect$2 = function (obj) {
8239
- return {
8240
- iterator: obj,
8241
- next: obj.next,
8242
- done: false
8243
- };
8251
+ const changeLang = lang => {
8252
+ localStorage.setItem(LOCAL_STORAGE_I18N_STRING, lang);
8253
+ document.documentElement.setAttribute('lang', lang);
8254
+ i18n.changeLanguage(lang);
8244
8255
  };
8256
+ const getLang = () => {
8257
+ var _a;
8258
+ return (_a = localStorage.getItem(LOCAL_STORAGE_I18N_STRING)) !== null && _a !== void 0 ? _a : systemDefaultLang;
8259
+ };
8260
+ const LangService = {
8261
+ init,
8262
+ changeLang,
8263
+ getLang
8264
+ };
8265
+ var Languages;
8266
+ (function (Languages) {
8267
+ Languages["EN"] = "en";
8268
+ Languages["AR"] = "ar";
8269
+ Languages["TR"] = "tr";
8270
+ })(Languages || (Languages = {}));
8245
8271
 
8246
- var $$7 = _export;
8247
- var iterate$2 = iterate$3;
8248
- var aCallable$1 = aCallable$6;
8249
- var anObject$1 = anObject$a;
8250
- var getIteratorDirect$1 = getIteratorDirect$2;
8251
-
8252
- // `Iterator.prototype.every` method
8253
- // https://github.com/tc39/proposal-iterator-helpers
8254
- $$7({ target: 'Iterator', proto: true, real: true }, {
8255
- every: function every(predicate) {
8256
- anObject$1(this);
8257
- aCallable$1(predicate);
8258
- var record = getIteratorDirect$1(this);
8259
- var counter = 0;
8260
- return !iterate$2(record, function (value, stop) {
8261
- if (!predicate(value, counter++)) return stop();
8262
- }, { IS_RECORD: true, INTERRUPTED: true }).stopped;
8272
+ class StringsUtils {
8273
+ static localCompareStrings(a, b) {
8274
+ const language = LangService.getLang();
8275
+ 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');
8263
8276
  }
8264
- });
8277
+ static localeIncludeString(a, b) {
8278
+ const language = LangService.getLang();
8279
+ return a.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr').includes(b.toLocaleLowerCase(language !== null && language !== void 0 ? language : 'tr'));
8280
+ }
8281
+ static isStringHasCharacters(text) {
8282
+ return text && text.length > 0;
8283
+ }
8284
+ }
8265
8285
 
8266
8286
  var uncurryThis$1 = functionUncurryThis;
8267
8287
 
@@ -8697,18 +8717,6 @@ const usePermissions = () => {
8697
8717
  };
8698
8718
  };
8699
8719
 
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
-
8712
8720
  const PermissionGuard = _a => {
8713
8721
  var {
8714
8722
  component: Component,
@@ -8753,4 +8761,4 @@ const PermissionGuard = _a => {
8753
8761
  }));
8754
8762
  };
8755
8763
 
8756
- export { ArraysUtils, BCRoutes, BCRoutesGuard, LOCAL_STORAGE_I18N_STRING, LangService, Languages, Loading, LogoutRoute, Permission, PermissionGuard, Role, StringsUtils, allSynchronously, auth, propertyOf, usePermissions, useRoles };
8764
+ export { ArraysUtils, BCRoutes, BCRoutesGuard, LOCAL_STORAGE_I18N_STRING, LangService, Languages, Loading, LogoutRoute, Permission, PermissionGuard, Role, StringsUtils, allSynchronously, auth, propertyOf, usePermissions };