@bcrumbs.net/bc-api 0.0.42 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -11,6 +11,8 @@ var Url = require('url');
11
11
  var require$$0$1 = require('punycode');
12
12
  var https = require('https');
13
13
  var zlib = require('zlib');
14
+ var batchHttp = require('@apollo/client/link/batch-http');
15
+ var utilities = require('@apollo/client/utilities');
14
16
 
15
17
  /******************************************************************************
16
18
  Copyright (c) Microsoft Corporation.
@@ -461,19 +463,19 @@ var tryToString$3 = tryToString$4;
461
463
  var $TypeError$d = TypeError;
462
464
 
463
465
  // `Assert: IsCallable(argument) is true`
464
- var aCallable$9 = function (argument) {
466
+ var aCallable$a = function (argument) {
465
467
  if (isCallable$i(argument)) return argument;
466
468
  throw new $TypeError$d(tryToString$3(argument) + ' is not a function');
467
469
  };
468
470
 
469
- var aCallable$8 = aCallable$9;
471
+ var aCallable$9 = aCallable$a;
470
472
  var isNullOrUndefined$4 = isNullOrUndefined$6;
471
473
 
472
474
  // `GetMethod` abstract operation
473
475
  // https://tc39.es/ecma262/#sec-getmethod
474
476
  var getMethod$5 = function (V, P) {
475
477
  var func = V[P];
476
- return isNullOrUndefined$4(func) ? undefined : aCallable$8(func);
478
+ return isNullOrUndefined$4(func) ? undefined : aCallable$9(func);
477
479
  };
478
480
 
479
481
  var call$g = functionCall;
@@ -683,7 +685,7 @@ var $String$3 = String;
683
685
  var $TypeError$a = TypeError;
684
686
 
685
687
  // `Assert: Type(argument) is Object`
686
- var anObject$f = function (argument) {
688
+ var anObject$g = function (argument) {
687
689
  if (isObject$6(argument)) return argument;
688
690
  throw new $TypeError$a($String$3(argument) + ' is not an object');
689
691
  };
@@ -691,7 +693,7 @@ var anObject$f = function (argument) {
691
693
  var DESCRIPTORS$a = descriptors;
692
694
  var IE8_DOM_DEFINE = ie8DomDefine;
693
695
  var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
694
- var anObject$e = anObject$f;
696
+ var anObject$f = anObject$g;
695
697
  var toPropertyKey = toPropertyKey$2;
696
698
 
697
699
  var $TypeError$9 = TypeError;
@@ -706,9 +708,9 @@ var WRITABLE = 'writable';
706
708
  // `Object.defineProperty` method
707
709
  // https://tc39.es/ecma262/#sec-object.defineproperty
708
710
  objectDefineProperty.f = DESCRIPTORS$a ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
709
- anObject$e(O);
711
+ anObject$f(O);
710
712
  P = toPropertyKey(P);
711
- anObject$e(Attributes);
713
+ anObject$f(Attributes);
712
714
  if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
713
715
  var current = $getOwnPropertyDescriptor(O, P);
714
716
  if (current && current[WRITABLE]) {
@@ -721,9 +723,9 @@ objectDefineProperty.f = DESCRIPTORS$a ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
721
723
  }
722
724
  } return $defineProperty(O, P, Attributes);
723
725
  } : $defineProperty : function defineProperty(O, P, Attributes) {
724
- anObject$e(O);
726
+ anObject$f(O);
725
727
  P = toPropertyKey(P);
726
- anObject$e(Attributes);
728
+ anObject$f(Attributes);
727
729
  if (IE8_DOM_DEFINE) try {
728
730
  return $defineProperty(O, P, Attributes);
729
731
  } catch (error) { /* empty */ }
@@ -1090,13 +1092,13 @@ var getBuiltIn$5 = getBuiltIn$7;
1090
1092
  var uncurryThis$a = functionUncurryThis;
1091
1093
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1092
1094
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
1093
- var anObject$d = anObject$f;
1095
+ var anObject$e = anObject$g;
1094
1096
 
1095
1097
  var concat$2 = uncurryThis$a([].concat);
1096
1098
 
1097
1099
  // all object keys, includes non-enumerable and symbols
1098
1100
  var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
1099
- var keys = getOwnPropertyNamesModule.f(anObject$d(it));
1101
+ var keys = getOwnPropertyNamesModule.f(anObject$e(it));
1100
1102
  var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1101
1103
  return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
1102
1104
  };
@@ -1263,13 +1265,13 @@ var objectAssign = !$assign || fails$a(function () {
1263
1265
  } return T;
1264
1266
  } : $assign;
1265
1267
 
1266
- var $$a = _export;
1268
+ var $$b = _export;
1267
1269
  var assign = objectAssign;
1268
1270
 
1269
1271
  // `Object.assign` method
1270
1272
  // https://tc39.es/ecma262/#sec-object.assign
1271
1273
  // eslint-disable-next-line es/no-object-assign -- required for testing
1272
- $$a({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1274
+ $$b({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1273
1275
  assign: assign
1274
1276
  });
1275
1277
 
@@ -1321,12 +1323,12 @@ var toString$4 = function (argument) {
1321
1323
  return $String$1(argument);
1322
1324
  };
1323
1325
 
1324
- var anObject$c = anObject$f;
1326
+ var anObject$d = anObject$g;
1325
1327
 
1326
1328
  // `RegExp.prototype.flags` getter implementation
1327
1329
  // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1328
1330
  var regexpFlags$1 = function () {
1329
- var that = anObject$c(this);
1331
+ var that = anObject$d(this);
1330
1332
  var result = '';
1331
1333
  if (that.hasIndices) result += 'd';
1332
1334
  if (that.global) result += 'g';
@@ -1372,7 +1374,7 @@ var objectDefineProperties = {};
1372
1374
  var DESCRIPTORS$5 = descriptors;
1373
1375
  var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1374
1376
  var definePropertyModule$1 = objectDefineProperty;
1375
- var anObject$b = anObject$f;
1377
+ var anObject$c = anObject$g;
1376
1378
  var toIndexedObject$1 = toIndexedObject$5;
1377
1379
  var objectKeys = objectKeys$2;
1378
1380
 
@@ -1380,7 +1382,7 @@ var objectKeys = objectKeys$2;
1380
1382
  // https://tc39.es/ecma262/#sec-object.defineproperties
1381
1383
  // eslint-disable-next-line es/no-object-defineproperties -- safe
1382
1384
  objectDefineProperties.f = DESCRIPTORS$5 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1383
- anObject$b(O);
1385
+ anObject$c(O);
1384
1386
  var props = toIndexedObject$1(Properties);
1385
1387
  var keys = objectKeys(Properties);
1386
1388
  var length = keys.length;
@@ -1395,7 +1397,7 @@ var getBuiltIn$4 = getBuiltIn$7;
1395
1397
  var html$2 = getBuiltIn$4('document', 'documentElement');
1396
1398
 
1397
1399
  /* global ActiveXObject -- old IE, WSH */
1398
- var anObject$a = anObject$f;
1400
+ var anObject$b = anObject$g;
1399
1401
  var definePropertiesModule = objectDefineProperties;
1400
1402
  var enumBugKeys = enumBugKeys$3;
1401
1403
  var hiddenKeys = hiddenKeys$4;
@@ -1469,7 +1471,7 @@ hiddenKeys[IE_PROTO$1] = true;
1469
1471
  var objectCreate = Object.create || function create(O, Properties) {
1470
1472
  var result;
1471
1473
  if (O !== null) {
1472
- EmptyConstructor[PROTOTYPE] = anObject$a(O);
1474
+ EmptyConstructor[PROTOTYPE] = anObject$b(O);
1473
1475
  result = new EmptyConstructor();
1474
1476
  EmptyConstructor[PROTOTYPE] = null;
1475
1477
  // add "__proto__" for Object.getPrototypeOf polyfill
@@ -1618,12 +1620,12 @@ if (PATCH) {
1618
1620
 
1619
1621
  var regexpExec$2 = patchedExec;
1620
1622
 
1621
- var $$9 = _export;
1623
+ var $$a = _export;
1622
1624
  var exec$1 = regexpExec$2;
1623
1625
 
1624
1626
  // `RegExp.prototype.exec` method
1625
1627
  // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1626
- $$9({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
1628
+ $$a({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
1627
1629
  exec: exec$1
1628
1630
  });
1629
1631
 
@@ -1803,7 +1805,7 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
1803
1805
  };
1804
1806
 
1805
1807
  var call$9 = functionCall;
1806
- var anObject$9 = anObject$f;
1808
+ var anObject$a = anObject$g;
1807
1809
  var isCallable$a = isCallable$m;
1808
1810
  var classof$3 = classofRaw$2;
1809
1811
  var regexpExec = regexpExec$2;
@@ -1816,7 +1818,7 @@ var regexpExecAbstract = function (R, S) {
1816
1818
  var exec = R.exec;
1817
1819
  if (isCallable$a(exec)) {
1818
1820
  var result = call$9(exec, R, S);
1819
- if (result !== null) anObject$9(result);
1821
+ if (result !== null) anObject$a(result);
1820
1822
  return result;
1821
1823
  }
1822
1824
  if (classof$3(R) === 'RegExp') return call$9(regexpExec, R, S);
@@ -1828,7 +1830,7 @@ var call$8 = functionCall;
1828
1830
  var uncurryThis$5 = functionUncurryThis;
1829
1831
  var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
1830
1832
  var fails$5 = fails$j;
1831
- var anObject$8 = anObject$f;
1833
+ var anObject$9 = anObject$g;
1832
1834
  var isCallable$9 = isCallable$m;
1833
1835
  var isNullOrUndefined$3 = isNullOrUndefined$6;
1834
1836
  var toIntegerOrInfinity = toIntegerOrInfinity$4;
@@ -1896,7 +1898,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
1896
1898
  // `RegExp.prototype[@@replace]` method
1897
1899
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
1898
1900
  function (string, replaceValue) {
1899
- var rx = anObject$8(this);
1901
+ var rx = anObject$9(this);
1900
1902
  var S = toString$1(string);
1901
1903
 
1902
1904
  if (
@@ -1975,7 +1977,7 @@ var sameValue$1 = Object.is || function is(x, y) {
1975
1977
 
1976
1978
  var call$7 = functionCall;
1977
1979
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
1978
- var anObject$7 = anObject$f;
1980
+ var anObject$8 = anObject$g;
1979
1981
  var isNullOrUndefined$2 = isNullOrUndefined$6;
1980
1982
  var requireObjectCoercible$1 = requireObjectCoercible$6;
1981
1983
  var sameValue = sameValue$1;
@@ -1996,7 +1998,7 @@ fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCal
1996
1998
  // `RegExp.prototype[@@search]` method
1997
1999
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
1998
2000
  function (string) {
1999
- var rx = anObject$7(this);
2001
+ var rx = anObject$8(this);
2000
2002
  var S = toString(string);
2001
2003
  var res = maybeCallNative(nativeSearch, rx, S);
2002
2004
 
@@ -2038,6 +2040,7 @@ function initBackendsLocations() {
2038
2040
  exports.apiBackend = 'https://api.bcrumbs.net';
2039
2041
  exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
2040
2042
  showcaseRenderer = 'https://test-showcase.bcrumbs.net';
2043
+ gateway = 'https://gateway.bcrumbs.net';
2041
2044
  break;
2042
2045
  case 'test':
2043
2046
  dBackend = 'https://query.bcrumbs.net';
@@ -2045,6 +2048,7 @@ function initBackendsLocations() {
2045
2048
  exports.apiBackend = 'https://api.bcrumbs.net';
2046
2049
  exports.apiV2Backend = 'apiv2-dev.bcrumbs.net';
2047
2050
  showcaseRenderer = 'https://test-showcase.bcrumbs.net';
2051
+ gateway = 'https://gateway.bcrumbs.net';
2048
2052
  break;
2049
2053
  case 'local':
2050
2054
  dBackend = 'https://localhost:44322';
@@ -2052,6 +2056,7 @@ function initBackendsLocations() {
2052
2056
  exports.apiBackend = 'http://localhost:6085';
2053
2057
  exports.apiV2Backend = 'https://apiv2-dev.bcrumbs.net';
2054
2058
  showcaseRenderer = 'https://test-showcase.bcrumbs.net';
2059
+ gateway = 'https://gateway.bcrumbs.net';
2055
2060
  break;
2056
2061
  default:
2057
2062
  if (currentUrl && currentUrl.indexOf('localhost') > -1) {
@@ -2060,24 +2065,28 @@ function initBackendsLocations() {
2060
2065
  exports.apiBackend = 'https://api.bcrumbs.net';
2061
2066
  exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
2062
2067
  showcaseRenderer = 'https://test-showcase.bcrumbs.net';
2068
+ gateway = 'https://gateway.bcrumbs.net';
2063
2069
  } else if (currentUrl && currentUrl.indexOf('dconfig.com') > -1) {
2064
2070
  dBackend = 'https://query.bcrumbs.net';
2065
2071
  exports.frontend = 'https://app.bcrumbs.net';
2066
2072
  exports.apiBackend = 'https://api.bcrumbs.net';
2067
2073
  exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
2068
2074
  showcaseRenderer = 'https://test-showcase.bcrumbs.net';
2075
+ gateway = 'https://gateway.bcrumbs.net';
2069
2076
  } else if (currentUrl && currentUrl.indexOf('dev.bcrumbs.net') > -1) {
2070
2077
  dBackend = 'https://query.bcrumbs.net';
2071
2078
  exports.frontend = 'https://dev.bcrumbs.net';
2072
2079
  exports.apiBackend = 'https://api.bcrumbs.net';
2073
2080
  exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
2074
2081
  showcaseRenderer = 'https://test-showcase.bcrumbs.net';
2082
+ gateway = 'https://gateway.bcrumbs.net';
2075
2083
  } else {
2076
2084
  dBackend = 'https://query.bcrumbs.net';
2077
2085
  exports.frontend = 'https://app.bcrumbs.net';
2078
2086
  exports.apiBackend = 'https://api.bcrumbs.net';
2079
2087
  exports.apiV2Backend = 'https://apiv2.bcrumbs.net';
2080
2088
  showcaseRenderer = 'https://test-showcase.bcrumbs.net';
2089
+ gateway = 'https://gateway.bcrumbs.net';
2081
2090
  }
2082
2091
  break;
2083
2092
  }
@@ -2089,6 +2098,7 @@ let dBackend;
2089
2098
  exports.apiBackend = void 0;
2090
2099
  exports.apiV2Backend = void 0;
2091
2100
  let showcaseRenderer;
2101
+ let gateway;
2092
2102
  let api;
2093
2103
  initBackendsLocations();
2094
2104
  const appConfig = {
@@ -2102,13 +2112,16 @@ const appConfig = {
2102
2112
  networkInterface: showcaseRenderer
2103
2113
  },
2104
2114
  billing: {
2105
- networkInterface: exports.apiV2Backend + '/billing'
2115
+ networkInterface: gateway + '/billing'
2106
2116
  },
2107
2117
  core: {
2108
- networkInterface: exports.apiV2Backend + '/core'
2118
+ networkInterface: gateway + '/core'
2109
2119
  },
2110
2120
  bot: {
2111
- networkInterface: exports.apiV2Backend + '/bot'
2121
+ networkInterface: gateway + '/bot'
2122
+ },
2123
+ auth: {
2124
+ networkInterface: gateway + '/auth'
2112
2125
  },
2113
2126
  // sw path
2114
2127
  sw: {
@@ -2246,12 +2259,12 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
2246
2259
  };
2247
2260
 
2248
2261
  var uncurryThis$4 = functionUncurryThis;
2249
- var aCallable$7 = aCallable$9;
2262
+ var aCallable$8 = aCallable$a;
2250
2263
 
2251
2264
  var functionUncurryThisAccessor = function (object, key, method) {
2252
2265
  try {
2253
2266
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2254
- return uncurryThis$4(aCallable$7(Object.getOwnPropertyDescriptor(object, key)[method]));
2267
+ return uncurryThis$4(aCallable$8(Object.getOwnPropertyDescriptor(object, key)[method]));
2255
2268
  } catch (error) { /* empty */ }
2256
2269
  };
2257
2270
 
@@ -2300,7 +2313,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
2300
2313
  };
2301
2314
  }() : undefined);
2302
2315
 
2303
- var $$8 = _export;
2316
+ var $$9 = _export;
2304
2317
  var call$6 = functionCall;
2305
2318
  var FunctionName = functionName;
2306
2319
  var isCallable$6 = isCallable$m;
@@ -2388,7 +2401,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
2388
2401
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
2389
2402
  defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
2390
2403
  }
2391
- } else $$8({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
2404
+ } else $$9({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
2392
2405
  }
2393
2406
 
2394
2407
  // define iterator
@@ -2571,7 +2584,7 @@ var aConstructor$1 = function (argument) {
2571
2584
  throw new $TypeError$5(tryToString$2(argument) + ' is not a constructor');
2572
2585
  };
2573
2586
 
2574
- var anObject$6 = anObject$f;
2587
+ var anObject$7 = anObject$g;
2575
2588
  var aConstructor = aConstructor$1;
2576
2589
  var isNullOrUndefined$1 = isNullOrUndefined$6;
2577
2590
  var wellKnownSymbol$6 = wellKnownSymbol$h;
@@ -2581,9 +2594,9 @@ var SPECIES$1 = wellKnownSymbol$6('species');
2581
2594
  // `SpeciesConstructor` abstract operation
2582
2595
  // https://tc39.es/ecma262/#sec-speciesconstructor
2583
2596
  var speciesConstructor$1 = function (O, defaultConstructor) {
2584
- var C = anObject$6(O).constructor;
2597
+ var C = anObject$7(O).constructor;
2585
2598
  var S;
2586
- return C === undefined || isNullOrUndefined$1(S = anObject$6(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
2599
+ return C === undefined || isNullOrUndefined$1(S = anObject$7(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
2587
2600
  };
2588
2601
 
2589
2602
  var classofRaw = classofRaw$2;
@@ -2597,14 +2610,14 @@ var functionUncurryThisClause = function (fn) {
2597
2610
  };
2598
2611
 
2599
2612
  var uncurryThis$1 = functionUncurryThisClause;
2600
- var aCallable$6 = aCallable$9;
2613
+ var aCallable$7 = aCallable$a;
2601
2614
  var NATIVE_BIND = functionBindNative;
2602
2615
 
2603
2616
  var bind$4 = uncurryThis$1(uncurryThis$1.bind);
2604
2617
 
2605
2618
  // optional / simple context binding
2606
2619
  var functionBindContext = function (fn, that) {
2607
- aCallable$6(fn);
2620
+ aCallable$7(fn);
2608
2621
  return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
2609
2622
  return fn.apply(that, arguments);
2610
2623
  };
@@ -2942,7 +2955,7 @@ var promiseConstructorDetection = {
2942
2955
 
2943
2956
  var newPromiseCapability$2 = {};
2944
2957
 
2945
- var aCallable$5 = aCallable$9;
2958
+ var aCallable$6 = aCallable$a;
2946
2959
 
2947
2960
  var $TypeError$3 = TypeError;
2948
2961
 
@@ -2953,8 +2966,8 @@ var PromiseCapability = function (C) {
2953
2966
  resolve = $$resolve;
2954
2967
  reject = $$reject;
2955
2968
  });
2956
- this.resolve = aCallable$5(resolve);
2957
- this.reject = aCallable$5(reject);
2969
+ this.resolve = aCallable$6(resolve);
2970
+ this.reject = aCallable$6(reject);
2958
2971
  };
2959
2972
 
2960
2973
  // `NewPromiseCapability` abstract operation
@@ -2963,7 +2976,7 @@ newPromiseCapability$2.f = function (C) {
2963
2976
  return new PromiseCapability(C);
2964
2977
  };
2965
2978
 
2966
- var $$7 = _export;
2979
+ var $$8 = _export;
2967
2980
  var IS_NODE = engineIsNode;
2968
2981
  var global$3 = global$m;
2969
2982
  var call$5 = functionCall;
@@ -2971,7 +2984,7 @@ var defineBuiltIn$1 = defineBuiltIn$6;
2971
2984
  var setPrototypeOf = objectSetPrototypeOf;
2972
2985
  var setToStringTag$1 = setToStringTag$4;
2973
2986
  var setSpecies = setSpecies$1;
2974
- var aCallable$4 = aCallable$9;
2987
+ var aCallable$5 = aCallable$a;
2975
2988
  var isCallable$2 = isCallable$m;
2976
2989
  var isObject$1 = isObject$a;
2977
2990
  var anInstance$1 = anInstance$2;
@@ -3161,7 +3174,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
3161
3174
  // 25.4.3.1 Promise(executor)
3162
3175
  PromiseConstructor = function Promise(executor) {
3163
3176
  anInstance$1(this, PromisePrototype);
3164
- aCallable$4(executor);
3177
+ aCallable$5(executor);
3165
3178
  call$5(Internal, this);
3166
3179
  var state = getInternalPromiseState(this);
3167
3180
  try {
@@ -3243,7 +3256,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
3243
3256
  }
3244
3257
  }
3245
3258
 
3246
- $$7({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
3259
+ $$8({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
3247
3260
  Promise: PromiseConstructor
3248
3261
  });
3249
3262
 
@@ -3276,8 +3289,8 @@ var getIteratorMethod$2 = function (it) {
3276
3289
  };
3277
3290
 
3278
3291
  var call$4 = functionCall;
3279
- var aCallable$3 = aCallable$9;
3280
- var anObject$5 = anObject$f;
3292
+ var aCallable$4 = aCallable$a;
3293
+ var anObject$6 = anObject$g;
3281
3294
  var tryToString$1 = tryToString$4;
3282
3295
  var getIteratorMethod$1 = getIteratorMethod$2;
3283
3296
 
@@ -3285,17 +3298,17 @@ var $TypeError$2 = TypeError;
3285
3298
 
3286
3299
  var getIterator$1 = function (argument, usingIterator) {
3287
3300
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
3288
- if (aCallable$3(iteratorMethod)) return anObject$5(call$4(iteratorMethod, argument));
3301
+ if (aCallable$4(iteratorMethod)) return anObject$6(call$4(iteratorMethod, argument));
3289
3302
  throw new $TypeError$2(tryToString$1(argument) + ' is not iterable');
3290
3303
  };
3291
3304
 
3292
3305
  var call$3 = functionCall;
3293
- var anObject$4 = anObject$f;
3306
+ var anObject$5 = anObject$g;
3294
3307
  var getMethod = getMethod$5;
3295
3308
 
3296
3309
  var iteratorClose$1 = function (iterator, kind, value) {
3297
3310
  var innerResult, innerError;
3298
- anObject$4(iterator);
3311
+ anObject$5(iterator);
3299
3312
  try {
3300
3313
  innerResult = getMethod(iterator, 'return');
3301
3314
  if (!innerResult) {
@@ -3309,13 +3322,13 @@ var iteratorClose$1 = function (iterator, kind, value) {
3309
3322
  }
3310
3323
  if (kind === 'throw') throw value;
3311
3324
  if (innerError) throw innerResult;
3312
- anObject$4(innerResult);
3325
+ anObject$5(innerResult);
3313
3326
  return value;
3314
3327
  };
3315
3328
 
3316
3329
  var bind = functionBindContext;
3317
3330
  var call$2 = functionCall;
3318
- var anObject$3 = anObject$f;
3331
+ var anObject$4 = anObject$g;
3319
3332
  var tryToString = tryToString$4;
3320
3333
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
3321
3334
  var lengthOfArrayLike = lengthOfArrayLike$2;
@@ -3333,7 +3346,7 @@ var Result = function (stopped, result) {
3333
3346
 
3334
3347
  var ResultPrototype = Result.prototype;
3335
3348
 
3336
- var iterate$3 = function (iterable, unboundFunction, options) {
3349
+ var iterate$4 = function (iterable, unboundFunction, options) {
3337
3350
  var that = options && options.that;
3338
3351
  var AS_ENTRIES = !!(options && options.AS_ENTRIES);
3339
3352
  var IS_RECORD = !!(options && options.IS_RECORD);
@@ -3349,7 +3362,7 @@ var iterate$3 = function (iterable, unboundFunction, options) {
3349
3362
 
3350
3363
  var callFn = function (value) {
3351
3364
  if (AS_ENTRIES) {
3352
- anObject$3(value);
3365
+ anObject$4(value);
3353
3366
  return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
3354
3367
  } return INTERRUPTED ? fn(value, stop) : fn(value);
3355
3368
  };
@@ -3431,28 +3444,28 @@ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCor
3431
3444
  NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
3432
3445
  });
3433
3446
 
3434
- var $$6 = _export;
3447
+ var $$7 = _export;
3435
3448
  var call$1 = functionCall;
3436
- var aCallable$2 = aCallable$9;
3449
+ var aCallable$3 = aCallable$a;
3437
3450
  var newPromiseCapabilityModule$2 = newPromiseCapability$2;
3438
3451
  var perform$1 = perform$3;
3439
- var iterate$2 = iterate$3;
3452
+ var iterate$3 = iterate$4;
3440
3453
  var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
3441
3454
 
3442
3455
  // `Promise.all` method
3443
3456
  // https://tc39.es/ecma262/#sec-promise.all
3444
- $$6({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
3457
+ $$7({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
3445
3458
  all: function all(iterable) {
3446
3459
  var C = this;
3447
3460
  var capability = newPromiseCapabilityModule$2.f(C);
3448
3461
  var resolve = capability.resolve;
3449
3462
  var reject = capability.reject;
3450
3463
  var result = perform$1(function () {
3451
- var $promiseResolve = aCallable$2(C.resolve);
3464
+ var $promiseResolve = aCallable$3(C.resolve);
3452
3465
  var values = [];
3453
3466
  var counter = 0;
3454
3467
  var remaining = 1;
3455
- iterate$2(iterable, function (promise) {
3468
+ iterate$3(iterable, function (promise) {
3456
3469
  var index = counter++;
3457
3470
  var alreadyCalled = false;
3458
3471
  remaining++;
@@ -3470,7 +3483,7 @@ $$6({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
3470
3483
  }
3471
3484
  });
3472
3485
 
3473
- var $$5 = _export;
3486
+ var $$6 = _export;
3474
3487
  var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
3475
3488
  var NativePromiseConstructor = promiseNativeConstructor;
3476
3489
  var getBuiltIn$1 = getBuiltIn$7;
@@ -3481,7 +3494,7 @@ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructo
3481
3494
 
3482
3495
  // `Promise.prototype.catch` method
3483
3496
  // https://tc39.es/ecma262/#sec-promise.prototype.catch
3484
- $$5({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
3497
+ $$6({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
3485
3498
  'catch': function (onRejected) {
3486
3499
  return this.then(undefined, onRejected);
3487
3500
  }
@@ -3495,24 +3508,24 @@ if (isCallable$1(NativePromiseConstructor)) {
3495
3508
  }
3496
3509
  }
3497
3510
 
3498
- var $$4 = _export;
3511
+ var $$5 = _export;
3499
3512
  var call = functionCall;
3500
- var aCallable$1 = aCallable$9;
3513
+ var aCallable$2 = aCallable$a;
3501
3514
  var newPromiseCapabilityModule$1 = newPromiseCapability$2;
3502
3515
  var perform = perform$3;
3503
- var iterate$1 = iterate$3;
3516
+ var iterate$2 = iterate$4;
3504
3517
  var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
3505
3518
 
3506
3519
  // `Promise.race` method
3507
3520
  // https://tc39.es/ecma262/#sec-promise.race
3508
- $$4({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
3521
+ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
3509
3522
  race: function race(iterable) {
3510
3523
  var C = this;
3511
3524
  var capability = newPromiseCapabilityModule$1.f(C);
3512
3525
  var reject = capability.reject;
3513
3526
  var result = perform(function () {
3514
- var $promiseResolve = aCallable$1(C.resolve);
3515
- iterate$1(iterable, function (promise) {
3527
+ var $promiseResolve = aCallable$2(C.resolve);
3528
+ iterate$2(iterable, function (promise) {
3516
3529
  call($promiseResolve, C, promise).then(capability.resolve, reject);
3517
3530
  });
3518
3531
  });
@@ -3521,13 +3534,13 @@ $$4({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
3521
3534
  }
3522
3535
  });
3523
3536
 
3524
- var $$3 = _export;
3537
+ var $$4 = _export;
3525
3538
  var newPromiseCapabilityModule = newPromiseCapability$2;
3526
3539
  var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
3527
3540
 
3528
3541
  // `Promise.reject` method
3529
3542
  // https://tc39.es/ecma262/#sec-promise.reject
3530
- $$3({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
3543
+ $$4({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
3531
3544
  reject: function reject(r) {
3532
3545
  var capability = newPromiseCapabilityModule.f(this);
3533
3546
  var capabilityReject = capability.reject;
@@ -3536,12 +3549,12 @@ $$3({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
3536
3549
  }
3537
3550
  });
3538
3551
 
3539
- var anObject$2 = anObject$f;
3552
+ var anObject$3 = anObject$g;
3540
3553
  var isObject = isObject$a;
3541
3554
  var newPromiseCapability = newPromiseCapability$2;
3542
3555
 
3543
3556
  var promiseResolve$1 = function (C, x) {
3544
- anObject$2(C);
3557
+ anObject$3(C);
3545
3558
  if (isObject(x) && x.constructor === C) return x;
3546
3559
  var promiseCapability = newPromiseCapability.f(C);
3547
3560
  var resolve = promiseCapability.resolve;
@@ -3549,7 +3562,7 @@ var promiseResolve$1 = function (C, x) {
3549
3562
  return promiseCapability.promise;
3550
3563
  };
3551
3564
 
3552
- var $$2 = _export;
3565
+ var $$3 = _export;
3553
3566
  var getBuiltIn = getBuiltIn$7;
3554
3567
  var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
3555
3568
  var promiseResolve = promiseResolve$1;
@@ -3558,12 +3571,114 @@ getBuiltIn('Promise');
3558
3571
 
3559
3572
  // `Promise.resolve` method
3560
3573
  // https://tc39.es/ecma262/#sec-promise.resolve
3561
- $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
3574
+ $$3({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
3562
3575
  resolve: function resolve(x) {
3563
3576
  return promiseResolve(this, x);
3564
3577
  }
3565
3578
  });
3566
3579
 
3580
+ var DESCRIPTORS$1 = descriptors;
3581
+ var definePropertyModule = objectDefineProperty;
3582
+ var createPropertyDescriptor = createPropertyDescriptor$4;
3583
+
3584
+ var createProperty$1 = function (object, key, value) {
3585
+ if (DESCRIPTORS$1) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
3586
+ else object[key] = value;
3587
+ };
3588
+
3589
+ var $$2 = _export;
3590
+ var global$2 = global$m;
3591
+ var anInstance = anInstance$2;
3592
+ var anObject$2 = anObject$g;
3593
+ var isCallable = isCallable$m;
3594
+ var getPrototypeOf = objectGetPrototypeOf;
3595
+ var defineBuiltInAccessor = defineBuiltInAccessor$2;
3596
+ var createProperty = createProperty$1;
3597
+ var fails = fails$j;
3598
+ var hasOwn = hasOwnProperty_1;
3599
+ var wellKnownSymbol$1 = wellKnownSymbol$h;
3600
+ var IteratorPrototype = iteratorsCore.IteratorPrototype;
3601
+ var DESCRIPTORS = descriptors;
3602
+
3603
+ var CONSTRUCTOR = 'constructor';
3604
+ var ITERATOR$1 = 'Iterator';
3605
+ var TO_STRING_TAG = wellKnownSymbol$1('toStringTag');
3606
+
3607
+ var $TypeError = TypeError;
3608
+ var NativeIterator = global$2[ITERATOR$1];
3609
+
3610
+ // FF56- have non-standard global helper `Iterator`
3611
+ var FORCED = !isCallable(NativeIterator)
3612
+ || NativeIterator.prototype !== IteratorPrototype
3613
+ // FF44- non-standard `Iterator` passes previous tests
3614
+ || !fails(function () { NativeIterator({}); });
3615
+
3616
+ var IteratorConstructor = function Iterator() {
3617
+ anInstance(this, IteratorPrototype);
3618
+ if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable');
3619
+ };
3620
+
3621
+ var defineIteratorPrototypeAccessor = function (key, value) {
3622
+ if (DESCRIPTORS) {
3623
+ defineBuiltInAccessor(IteratorPrototype, key, {
3624
+ configurable: true,
3625
+ get: function () {
3626
+ return value;
3627
+ },
3628
+ set: function (replacement) {
3629
+ anObject$2(this);
3630
+ if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
3631
+ if (hasOwn(this, key)) this[key] = replacement;
3632
+ else createProperty(this, key, replacement);
3633
+ }
3634
+ });
3635
+ } else IteratorPrototype[key] = value;
3636
+ };
3637
+
3638
+ if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR$1);
3639
+
3640
+ if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
3641
+ defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
3642
+ }
3643
+
3644
+ IteratorConstructor.prototype = IteratorPrototype;
3645
+
3646
+ // `Iterator` constructor
3647
+ // https://github.com/tc39/proposal-iterator-helpers
3648
+ $$2({ global: true, constructor: true, forced: FORCED }, {
3649
+ Iterator: IteratorConstructor
3650
+ });
3651
+
3652
+ // `GetIteratorDirect(obj)` abstract operation
3653
+ // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
3654
+ var getIteratorDirect$2 = function (obj) {
3655
+ return {
3656
+ iterator: obj,
3657
+ next: obj.next,
3658
+ done: false
3659
+ };
3660
+ };
3661
+
3662
+ var $$1 = _export;
3663
+ var iterate$1 = iterate$4;
3664
+ var aCallable$1 = aCallable$a;
3665
+ var anObject$1 = anObject$g;
3666
+ var getIteratorDirect$1 = getIteratorDirect$2;
3667
+
3668
+ // `Iterator.prototype.find` method
3669
+ // https://github.com/tc39/proposal-iterator-helpers
3670
+ $$1({ target: 'Iterator', proto: true, real: true }, {
3671
+ find: function find(predicate) {
3672
+ anObject$1(this);
3673
+ aCallable$1(predicate);
3674
+ var record = getIteratorDirect$1(this);
3675
+ var counter = 0;
3676
+ return iterate$1(record, function (value, stop) {
3677
+ if (predicate(value, counter++)) return stop(value);
3678
+ }, { IS_RECORD: true, INTERRUPTED: true }).result;
3679
+ }
3680
+ });
3681
+
3567
3682
  // iterable DOM collections
3568
3683
  // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
3569
3684
  var domIterables = {
@@ -3608,24 +3723,24 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
3608
3723
 
3609
3724
  var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
3610
3725
 
3611
- var global$2 = global$m;
3726
+ var global$1 = global$m;
3612
3727
  var DOMIterables = domIterables;
3613
3728
  var DOMTokenListPrototype = domTokenListPrototype;
3614
3729
  var ArrayIteratorMethods = es_array_iterator;
3615
3730
  var createNonEnumerableProperty = createNonEnumerableProperty$5;
3616
3731
  var setToStringTag = setToStringTag$4;
3617
- var wellKnownSymbol$1 = wellKnownSymbol$h;
3732
+ var wellKnownSymbol = wellKnownSymbol$h;
3618
3733
 
3619
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
3734
+ var ITERATOR = wellKnownSymbol('iterator');
3620
3735
  var ArrayValues = ArrayIteratorMethods.values;
3621
3736
 
3622
3737
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3623
3738
  if (CollectionPrototype) {
3624
3739
  // some Chrome versions have non-configurable methods on DOMTokenList
3625
- if (CollectionPrototype[ITERATOR$1] !== ArrayValues) try {
3626
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$1, ArrayValues);
3740
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
3741
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
3627
3742
  } catch (error) {
3628
- CollectionPrototype[ITERATOR$1] = ArrayValues;
3743
+ CollectionPrototype[ITERATOR] = ArrayValues;
3629
3744
  }
3630
3745
  setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
3631
3746
  if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
@@ -3640,7 +3755,7 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3640
3755
  };
3641
3756
 
3642
3757
  for (var COLLECTION_NAME in DOMIterables) {
3643
- handlePrototype(global$2[COLLECTION_NAME] && global$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
3758
+ handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
3644
3759
  }
3645
3760
 
3646
3761
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
@@ -3651,16 +3766,25 @@ const defaultErrorHandler = ({
3651
3766
  graphQLErrors
3652
3767
  }) => {
3653
3768
  if (networkError && networkError.statusCode === 401) {
3654
- // redirect to login page
3655
- if (typeof window !== 'undefined' && window.location.pathname !== '/account/login') {
3656
- return window.location.replace('/account/login');
3769
+ redirectToLogin();
3770
+ return;
3771
+ }
3772
+ if (graphQLErrors && graphQLErrors.length > 0) {
3773
+ const unauthenticatedError = graphQLErrors.find(error => {
3774
+ var _a;
3775
+ return ((_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a['code']) === 'UNAUTHENTICATED';
3776
+ });
3777
+ if (unauthenticatedError) {
3778
+ redirectToLogin();
3779
+ return;
3657
3780
  }
3658
- } else if (networkError && networkError.statusCode > 500 && networkError.statusCode !== 503) {
3781
+ }
3782
+ if (networkError && networkError.statusCode > 500 && networkError.statusCode !== 503) {
3659
3783
  if (typeof window !== 'undefined' && window.location.pathname !== '/error') {
3660
3784
  return window.location.replace('/error?message=' + networkError.message);
3661
3785
  }
3662
3786
  }
3663
- // TODO: Uncomment this and fix when we have a proper way to handle 403 errors
3787
+ // TODO: Uncomment this and fix when we have a proper way to handle 403 errors, if needed
3664
3788
  // if (
3665
3789
  // graphQLErrors &&
3666
3790
  // graphQLErrors.find((error) => error?.extensions?.['code'] === 'FORBIDDEN')
@@ -3725,11 +3849,24 @@ function getUserContext() {
3725
3849
  });
3726
3850
  });
3727
3851
  }
3852
+ const clearAuthData = () => {
3853
+ if (typeof window !== 'undefined') {
3854
+ window.localStorage.removeItem('token');
3855
+ window.localStorage.removeItem('ContextId');
3856
+ window.localStorage.removeItem('userInfo');
3857
+ }
3858
+ };
3859
+ const redirectToLogin = () => {
3860
+ if (typeof window !== 'undefined' && window.location.pathname !== '/account/login') {
3861
+ clearAuthData();
3862
+ window.location.href = '/account/login';
3863
+ }
3864
+ };
3728
3865
 
3729
3866
  const {
3730
- networkInterface: uri$4
3867
+ networkInterface: uri$5
3731
3868
  } = appConfig.dconfig;
3732
- const authLink$2 = context.setContext((operation_1, _a) => __awaiter(void 0, [operation_1, _a], void 0, function* (operation, {
3869
+ const authLink$3 = context.setContext((operation_1, _a) => __awaiter(void 0, [operation_1, _a], void 0, function* (operation, {
3733
3870
  headers
3734
3871
  }) {
3735
3872
  const currentUsertoken = yield getUserToken();
@@ -3753,8 +3890,8 @@ const authLink$2 = context.setContext((operation_1, _a) => __awaiter(void 0, [op
3753
3890
  };
3754
3891
  return resultHeaders;
3755
3892
  }));
3756
- const cache$4 = new client.InMemoryCache();
3757
- const errorLink$3 = error.onError(({
3893
+ const cache$5 = new client.InMemoryCache();
3894
+ const errorLink$4 = error.onError(({
3758
3895
  networkError
3759
3896
  }) => {
3760
3897
  if (networkError && networkError.statusCode === 401) {
@@ -3764,19 +3901,19 @@ const errorLink$3 = error.onError(({
3764
3901
  }
3765
3902
  } else if (networkError && networkError.statusCode > 500 && networkError.statusCode !== 503) {
3766
3903
  if (typeof window !== 'undefined' && window.location.pathname !== '/error') {
3767
- return window.location.replace('/account/error?message=' + networkError.message);
3904
+ return window.location.replace('/error?message=' + networkError.message);
3768
3905
  }
3769
3906
  } else {
3770
3907
  if (typeof window !== 'undefined' && window.location.pathname !== '/error') {
3771
- return window.location.replace('/account/error?message=Cannot connect to the server, please make sure you have an active internet connection');
3908
+ return window.location.replace('/error?message=Cannot connect to the server, please make sure you have an active internet connection');
3772
3909
  }
3773
3910
  }
3774
3911
  });
3775
3912
  /* eslint-disable no-process-env */
3776
- const isDevEnv$4 = process.env['NODE_ENV'] !== 'production';
3913
+ const isDevEnv$5 = process.env['NODE_ENV'] !== 'production';
3777
3914
  /* eslint-enable no-process-env */
3778
3915
  const link_dconfig = new apolloLinkRest.RestLink({
3779
- uri: uri$4 || 'https://api.bcrumbs.net',
3916
+ uri: uri$5 || 'https://api.bcrumbs.net',
3780
3917
  bodySerializers: {
3781
3918
  fileEncode: (data, headers) => {
3782
3919
  const formData = new FormData();
@@ -3790,9 +3927,9 @@ const link_dconfig = new apolloLinkRest.RestLink({
3790
3927
  }
3791
3928
  });
3792
3929
  const dconfigClient = new client.ApolloClient({
3793
- link: client.from([authLink$2, errorLink$3, link_dconfig]),
3794
- cache: cache$4,
3795
- connectToDevTools: isDevEnv$4,
3930
+ link: client.from([authLink$3, errorLink$4, link_dconfig]),
3931
+ cache: cache$5,
3932
+ connectToDevTools: isDevEnv$5,
3796
3933
  queryDeduplication: true
3797
3934
  });
3798
3935
  const formSerializer = (data, headers) => {
@@ -3810,13 +3947,13 @@ const formSerializer = (data, headers) => {
3810
3947
  };
3811
3948
  };
3812
3949
  const link_dconfig_token = new apolloLinkRest.RestLink({
3813
- uri: uri$4 || 'https://api.bcrumbs.net',
3950
+ uri: uri$5 || 'https://api.bcrumbs.net',
3814
3951
  defaultSerializer: formSerializer
3815
3952
  });
3816
3953
  const tokenClient = new client.ApolloClient({
3817
- link: client.from([link_dconfig_token, errorLink$3]),
3818
- cache: cache$4,
3819
- connectToDevTools: isDevEnv$4
3954
+ link: client.from([link_dconfig_token, errorLink$4]),
3955
+ cache: cache$5,
3956
+ connectToDevTools: isDevEnv$5
3820
3957
  });
3821
3958
 
3822
3959
  let _$8 = t => t,
@@ -3919,23 +4056,23 @@ const useModelChildrenQuery = (parentId, templateId) => client.useQuery(viewType
3919
4056
  });
3920
4057
 
3921
4058
  const {
3922
- networkInterface: uri$3
4059
+ networkInterface: uri$4
3923
4060
  } = appConfig.dquery;
3924
- const cache$3 = new client.InMemoryCache();
3925
- const errorLink$2 = error.onError(handleHandler);
4061
+ const cache$4 = new client.InMemoryCache();
4062
+ const errorLink$3 = error.onError(handleHandler);
3926
4063
  /* eslint-disable no-process-env */
3927
- const isDevEnv$3 = process.env['NODE_ENV'] !== 'production';
4064
+ const isDevEnv$4 = process.env['NODE_ENV'] !== 'production';
3928
4065
  /* eslint-enable no-process-env */
3929
- const link_dquery$2 = client.createHttpLink({
3930
- uri: uri$3,
4066
+ const link_dquery$1 = client.createHttpLink({
4067
+ uri: uri$4,
3931
4068
  fetchOptions: {
3932
4069
  mode: 'cors'
3933
4070
  }
3934
4071
  });
3935
4072
  const dqueryClient = new client.ApolloClient({
3936
- link: client.from([errorLink$2, link_dquery$2]),
3937
- cache: cache$3,
3938
- connectToDevTools: isDevEnv$3,
4073
+ link: client.from([errorLink$3, link_dquery$1]),
4074
+ cache: cache$4,
4075
+ connectToDevTools: isDevEnv$4,
3939
4076
  queryDeduplication: true
3940
4077
  });
3941
4078
 
@@ -3946,12 +4083,13 @@ const portalThemeConfig = gql(_t$7 || (_t$7 = _$7`
3946
4083
  configuration(type: "portalTheme", domain: $domain)
3947
4084
  }
3948
4085
  `));
3949
- const usePortalThemeConfig = domain => client.useQuery(portalThemeConfig, {
4086
+ const usePortalThemeConfig = (domain, skip = false) => client.useQuery(portalThemeConfig, {
3950
4087
  fetchPolicy: 'cache-first',
3951
4088
  client: dqueryClient,
3952
4089
  variables: {
3953
4090
  domain
3954
- }
4091
+ },
4092
+ skip
3955
4093
  });
3956
4094
 
3957
4095
  let _$6 = t => t,
@@ -5256,19 +5394,19 @@ const useUpdateContentsOrderingMutation = () => client.useMutation(updateContent
5256
5394
  });
5257
5395
 
5258
5396
  const {
5259
- networkInterface: uri$2
5397
+ networkInterface: uri$3
5260
5398
  } = appConfig.showcase;
5261
- const cache$2 = new client.InMemoryCache();
5399
+ const cache$3 = new client.InMemoryCache();
5262
5400
  /* eslint-disable no-process-env */
5263
- const isDevEnv$2 = process.env['NODE_ENV'] !== 'production';
5401
+ const isDevEnv$3 = process.env['NODE_ENV'] !== 'production';
5264
5402
  /* eslint-enable no-process-env */
5265
5403
  const link$1 = new apolloLinkRest.RestLink({
5266
- uri: uri$2 || "https://api.bcrumbs.net"
5404
+ uri: uri$3 || "https://api.bcrumbs.net"
5267
5405
  });
5268
5406
  const showcaseRendererClient = new client.ApolloClient({
5269
5407
  link: link$1,
5270
- cache: cache$2,
5271
- connectToDevTools: isDevEnv$2,
5408
+ cache: cache$3,
5409
+ connectToDevTools: isDevEnv$3,
5272
5410
  queryDeduplication: true
5273
5411
  });
5274
5412
 
@@ -5341,13 +5479,13 @@ const menuConfigurationQuery = gql(_t2$1 || (_t2$1 = _$1`
5341
5479
  )
5342
5480
  }
5343
5481
  `));
5344
- const useMenuConfigurationQuery = ContextId => client.useQuery(menuConfigurationQuery, {
5482
+ const useMenuConfigurationQuery = (ContextId, skip = false) => client.useQuery(menuConfigurationQuery, {
5345
5483
  fetchPolicy: 'cache-first',
5346
5484
  client: dconfigClient,
5347
5485
  variables: {
5348
5486
  ContextId
5349
5487
  },
5350
- skip: !ContextId
5488
+ skip: !ContextId || skip
5351
5489
  });
5352
5490
  const addDomain = gql(_t3$1 || (_t3$1 = _$1`
5353
5491
  mutation ($rootContent: String!, $body: JSON!) {
@@ -87308,22 +87446,61 @@ const showcaseClient = new client.ApolloClient({
87308
87446
  });
87309
87447
 
87310
87448
  const {
87311
- networkInterface: uri$1
87449
+ networkInterface: uri$2
87312
87450
  } = appConfig.core;
87451
+ const authLink$2 = context.setContext(handleAuth);
87452
+ const cache$2 = new client.InMemoryCache();
87453
+ const errorLink$2 = error.onError(handleHandler);
87454
+ /* eslint-disable no-process-env */
87455
+ const isDevEnv$2 = process.env['NODE_ENV'] !== 'production';
87456
+ /* eslint-enable no-process-env */
87457
+ const httpLink = client.createHttpLink({
87458
+ uri: `${uri$2}/gq`,
87459
+ fetchOptions: {
87460
+ mode: 'cors'
87461
+ }
87462
+ });
87463
+ const batchLink = new batchHttp.BatchHttpLink({
87464
+ uri: `${uri$2}/gq`,
87465
+ batchMax: 5,
87466
+ // Max number of operations in a single batch
87467
+ batchInterval: 200,
87468
+ // Time in ms to wait for operations to accumulate
87469
+ fetchOptions: {
87470
+ mode: 'cors'
87471
+ }
87472
+ });
87473
+ // use batch link for queries and http link for mutations
87474
+ const splitLink = client.split(({
87475
+ query
87476
+ }) => {
87477
+ const definition = utilities.getMainDefinition(query);
87478
+ return definition.kind === 'OperationDefinition' && definition.operation === 'query';
87479
+ }, batchLink, httpLink);
87480
+ const coreClient = new client.ApolloClient({
87481
+ link: client.from([authLink$2, errorLink$2, splitLink]),
87482
+ cache: cache$2,
87483
+ connectToDevTools: isDevEnv$2,
87484
+ queryDeduplication: true
87485
+ });
87486
+
87487
+ const {
87488
+ networkInterface: uri$1
87489
+ } = appConfig.bot;
87313
87490
  const authLink$1 = context.setContext(handleAuth);
87314
87491
  const cache$1 = new client.InMemoryCache();
87315
87492
  const errorLink$1 = error.onError(handleHandler);
87316
87493
  /* eslint-disable no-process-env */
87317
87494
  const isDevEnv$1 = process.env['NODE_ENV'] !== 'production';
87318
87495
  /* eslint-enable no-process-env */
87319
- const link_dquery$1 = client.createHttpLink({
87496
+ const link_dquery = client.createHttpLink({
87320
87497
  uri: `${uri$1}/gq`,
87321
87498
  fetchOptions: {
87322
87499
  mode: 'cors'
87323
87500
  }
87324
87501
  });
87325
- const coreClient = new client.ApolloClient({
87326
- link: client.from([authLink$1, errorLink$1, link_dquery$1]),
87502
+ const botClient = new client.ApolloClient({
87503
+ link: client.from([authLink$1, errorLink$1, link_dquery]),
87327
87504
  cache: cache$1,
87328
87505
  connectToDevTools: isDevEnv$1,
87329
87506
  queryDeduplication: true
@@ -87331,113 +87508,31 @@ const coreClient = new client.ApolloClient({
87331
87508
 
87332
87509
  const {
87333
87510
  networkInterface: uri
87334
- } = appConfig.bot;
87511
+ } = appConfig.auth;
87335
87512
  const authLink = context.setContext(handleAuth);
87336
87513
  const cache = new client.InMemoryCache();
87337
87514
  const errorLink = error.onError(handleHandler);
87338
87515
  /* eslint-disable no-process-env */
87339
87516
  const isDevEnv = process.env['NODE_ENV'] !== 'production';
87340
87517
  /* eslint-enable no-process-env */
87341
- const link_dquery = client.createHttpLink({
87518
+ const link_auth = client.createHttpLink({
87342
87519
  uri: `${uri}/gq`,
87343
87520
  fetchOptions: {
87344
87521
  mode: 'cors'
87345
87522
  }
87346
87523
  });
87347
- const botClient = new client.ApolloClient({
87348
- link: client.from([authLink, errorLink, link_dquery]),
87524
+ const authClient = new client.ApolloClient({
87525
+ link: client.from([authLink, errorLink, link_auth]),
87349
87526
  cache,
87350
87527
  connectToDevTools: isDevEnv,
87351
87528
  queryDeduplication: true
87352
87529
  });
87353
87530
 
87354
- var DESCRIPTORS$1 = descriptors;
87355
- var definePropertyModule = objectDefineProperty;
87356
- var createPropertyDescriptor = createPropertyDescriptor$4;
87357
-
87358
- var createProperty$1 = function (object, key, value) {
87359
- if (DESCRIPTORS$1) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
87360
- else object[key] = value;
87361
- };
87362
-
87363
- var $$1 = _export;
87364
- var global$1 = global$m;
87365
- var anInstance = anInstance$2;
87366
- var anObject$1 = anObject$f;
87367
- var isCallable = isCallable$m;
87368
- var getPrototypeOf = objectGetPrototypeOf;
87369
- var defineBuiltInAccessor = defineBuiltInAccessor$2;
87370
- var createProperty = createProperty$1;
87371
- var fails = fails$j;
87372
- var hasOwn = hasOwnProperty_1;
87373
- var wellKnownSymbol = wellKnownSymbol$h;
87374
- var IteratorPrototype = iteratorsCore.IteratorPrototype;
87375
- var DESCRIPTORS = descriptors;
87376
-
87377
- var CONSTRUCTOR = 'constructor';
87378
- var ITERATOR = 'Iterator';
87379
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
87380
-
87381
- var $TypeError = TypeError;
87382
- var NativeIterator = global$1[ITERATOR];
87383
-
87384
- // FF56- have non-standard global helper `Iterator`
87385
- var FORCED = !isCallable(NativeIterator)
87386
- || NativeIterator.prototype !== IteratorPrototype
87387
- // FF44- non-standard `Iterator` passes previous tests
87388
- || !fails(function () { NativeIterator({}); });
87389
-
87390
- var IteratorConstructor = function Iterator() {
87391
- anInstance(this, IteratorPrototype);
87392
- if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable');
87393
- };
87394
-
87395
- var defineIteratorPrototypeAccessor = function (key, value) {
87396
- if (DESCRIPTORS) {
87397
- defineBuiltInAccessor(IteratorPrototype, key, {
87398
- configurable: true,
87399
- get: function () {
87400
- return value;
87401
- },
87402
- set: function (replacement) {
87403
- anObject$1(this);
87404
- if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
87405
- if (hasOwn(this, key)) this[key] = replacement;
87406
- else createProperty(this, key, replacement);
87407
- }
87408
- });
87409
- } else IteratorPrototype[key] = value;
87410
- };
87411
-
87412
- if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
87413
-
87414
- if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
87415
- defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
87416
- }
87417
-
87418
- IteratorConstructor.prototype = IteratorPrototype;
87419
-
87420
- // `Iterator` constructor
87421
- // https://github.com/tc39/proposal-iterator-helpers
87422
- $$1({ global: true, constructor: true, forced: FORCED }, {
87423
- Iterator: IteratorConstructor
87424
- });
87425
-
87426
- // `GetIteratorDirect(obj)` abstract operation
87427
- // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
87428
- var getIteratorDirect$1 = function (obj) {
87429
- return {
87430
- iterator: obj,
87431
- next: obj.next,
87432
- done: false
87433
- };
87434
- };
87435
-
87436
87531
  var $ = _export;
87437
- var iterate = iterate$3;
87438
- var aCallable = aCallable$9;
87439
- var anObject = anObject$f;
87440
- var getIteratorDirect = getIteratorDirect$1;
87532
+ var iterate = iterate$4;
87533
+ var aCallable = aCallable$a;
87534
+ var anObject = anObject$g;
87535
+ var getIteratorDirect = getIteratorDirect$2;
87441
87536
 
87442
87537
  // `Iterator.prototype.forEach` method
87443
87538
  // https://github.com/tc39/proposal-iterator-helpers
@@ -87494,7 +87589,9 @@ exports.VALIDATE_COMPANY_NAME = VALIDATE_COMPANY_NAME;
87494
87589
  exports.addDomain = addDomain;
87495
87590
  exports.addDomainOptions = addDomainOptions;
87496
87591
  exports.appConfig = appConfig;
87592
+ exports.authClient = authClient;
87497
87593
  exports.botClient = botClient;
87594
+ exports.clearAuthData = clearAuthData;
87498
87595
  exports.companyUsersQuery = companyUsersQuery;
87499
87596
  exports.contentInstancesQuery = contentInstancesQuery;
87500
87597
  exports.coreClient = coreClient;
@@ -87514,6 +87611,10 @@ exports.foldersTreeQuery = foldersTreeQuery;
87514
87611
  exports.forgetPassword = forgetPassword;
87515
87612
  exports.forgetPasswordOptions = forgetPasswordOptions;
87516
87613
  exports.getErrorHandler = getErrorHandler;
87614
+ exports.getUserContext = getUserContext;
87615
+ exports.getUserToken = getUserToken;
87616
+ exports.handleAuth = handleAuth;
87617
+ exports.handleHandler = handleHandler;
87517
87618
  exports.inviteUser = inviteUser;
87518
87619
  exports.inviteUserOptions = inviteUserOptions;
87519
87620
  exports.login = login;
@@ -87522,6 +87623,7 @@ exports.menuConfigurationQuery = menuConfigurationQuery;
87522
87623
  exports.portalThemeConfig = portalThemeConfig;
87523
87624
  exports.querySectionThumb = querySectionThumb;
87524
87625
  exports.queryUsage = queryUsage;
87626
+ exports.redirectToLogin = redirectToLogin;
87525
87627
  exports.registeUsage = registeUsage;
87526
87628
  exports.register = register;
87527
87629
  exports.registerOptions = registerOptions;