@trackunit/react-core-contexts 0.4.29 → 0.4.30

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.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
- import { ApolloClient, InMemoryCache, from, split as split$1, ApolloProvider } from '@apollo/client';
2
+ import { ApolloClient, InMemoryCache, from, split, ApolloProvider } from '@apollo/client';
3
3
  import { setContext } from '@apollo/client/link/context';
4
4
  import { onError } from '@apollo/client/link/error';
5
5
  import * as Sentry from '@sentry/browser';
@@ -12,1892 +12,6 @@ import { registerTranslations, initializeTranslationsForApp } from '@trackunit/i
12
12
  import { Spinner } from '@trackunit/react-components';
13
13
  import { BrowserRouter } from 'react-router-dom';
14
14
 
15
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
16
-
17
- var check = function (it) {
18
- return it && it.Math == Math && it;
19
- };
20
-
21
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
22
- var global$e =
23
- // eslint-disable-next-line es/no-global-this -- safe
24
- check(typeof globalThis == 'object' && globalThis) ||
25
- check(typeof window == 'object' && window) ||
26
- // eslint-disable-next-line no-restricted-globals -- safe
27
- check(typeof self == 'object' && self) ||
28
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
29
- // eslint-disable-next-line no-new-func -- fallback
30
- (function () { return this; })() || Function('return this')();
31
-
32
- var objectGetOwnPropertyDescriptor = {};
33
-
34
- var fails$h = function (exec) {
35
- try {
36
- return !!exec();
37
- } catch (error) {
38
- return true;
39
- }
40
- };
41
-
42
- var fails$g = fails$h;
43
-
44
- // Detect IE8's incomplete defineProperty implementation
45
- var descriptors = !fails$g(function () {
46
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
47
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
48
- });
49
-
50
- var fails$f = fails$h;
51
-
52
- var functionBindNative = !fails$f(function () {
53
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
54
- var test = (function () { /* empty */ }).bind();
55
- // eslint-disable-next-line no-prototype-builtins -- safe
56
- return typeof test != 'function' || test.hasOwnProperty('prototype');
57
- });
58
-
59
- var NATIVE_BIND$2 = functionBindNative;
60
-
61
- var call$a = Function.prototype.call;
62
-
63
- var functionCall = NATIVE_BIND$2 ? call$a.bind(call$a) : function () {
64
- return call$a.apply(call$a, arguments);
65
- };
66
-
67
- var objectPropertyIsEnumerable = {};
68
-
69
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
70
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
71
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
72
-
73
- // Nashorn ~ JDK8 bug
74
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
75
-
76
- // `Object.prototype.propertyIsEnumerable` method implementation
77
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
78
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
79
- var descriptor = getOwnPropertyDescriptor$1(this, V);
80
- return !!descriptor && descriptor.enumerable;
81
- } : $propertyIsEnumerable;
82
-
83
- var createPropertyDescriptor$3 = function (bitmap, value) {
84
- return {
85
- enumerable: !(bitmap & 1),
86
- configurable: !(bitmap & 2),
87
- writable: !(bitmap & 4),
88
- value: value
89
- };
90
- };
91
-
92
- var NATIVE_BIND$1 = functionBindNative;
93
-
94
- var FunctionPrototype$2 = Function.prototype;
95
- var call$9 = FunctionPrototype$2.call;
96
- var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$2.bind.bind(call$9, call$9);
97
-
98
- var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
99
- return function () {
100
- return call$9.apply(fn, arguments);
101
- };
102
- };
103
-
104
- var uncurryThis$g = functionUncurryThis;
105
-
106
- var toString$6 = uncurryThis$g({}.toString);
107
- var stringSlice$4 = uncurryThis$g(''.slice);
108
-
109
- var classofRaw$2 = function (it) {
110
- return stringSlice$4(toString$6(it), 8, -1);
111
- };
112
-
113
- var uncurryThis$f = functionUncurryThis;
114
- var fails$e = fails$h;
115
- var classof$4 = classofRaw$2;
116
-
117
- var $Object$4 = Object;
118
- var split = uncurryThis$f(''.split);
119
-
120
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
121
- var indexedObject = fails$e(function () {
122
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
123
- // eslint-disable-next-line no-prototype-builtins -- safe
124
- return !$Object$4('z').propertyIsEnumerable(0);
125
- }) ? function (it) {
126
- return classof$4(it) == 'String' ? split(it, '') : $Object$4(it);
127
- } : $Object$4;
128
-
129
- // we can't use just `it == null` since of `document.all` special case
130
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
131
- var isNullOrUndefined$3 = function (it) {
132
- return it === null || it === undefined;
133
- };
134
-
135
- var isNullOrUndefined$2 = isNullOrUndefined$3;
136
-
137
- var $TypeError$8 = TypeError;
138
-
139
- // `RequireObjectCoercible` abstract operation
140
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
141
- var requireObjectCoercible$5 = function (it) {
142
- if (isNullOrUndefined$2(it)) throw $TypeError$8("Can't call method on " + it);
143
- return it;
144
- };
145
-
146
- // toObject with fallback for non-array-like ES3 strings
147
- var IndexedObject$1 = indexedObject;
148
- var requireObjectCoercible$4 = requireObjectCoercible$5;
149
-
150
- var toIndexedObject$5 = function (it) {
151
- return IndexedObject$1(requireObjectCoercible$4(it));
152
- };
153
-
154
- var documentAll$2 = typeof document == 'object' && document.all;
155
-
156
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
157
- var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
158
-
159
- var documentAll_1 = {
160
- all: documentAll$2,
161
- IS_HTMLDDA: IS_HTMLDDA
162
- };
163
-
164
- var $documentAll$1 = documentAll_1;
165
-
166
- var documentAll$1 = $documentAll$1.all;
167
-
168
- // `IsCallable` abstract operation
169
- // https://tc39.es/ecma262/#sec-iscallable
170
- var isCallable$h = $documentAll$1.IS_HTMLDDA ? function (argument) {
171
- return typeof argument == 'function' || argument === documentAll$1;
172
- } : function (argument) {
173
- return typeof argument == 'function';
174
- };
175
-
176
- var isCallable$g = isCallable$h;
177
- var $documentAll = documentAll_1;
178
-
179
- var documentAll = $documentAll.all;
180
-
181
- var isObject$7 = $documentAll.IS_HTMLDDA ? function (it) {
182
- return typeof it == 'object' ? it !== null : isCallable$g(it) || it === documentAll;
183
- } : function (it) {
184
- return typeof it == 'object' ? it !== null : isCallable$g(it);
185
- };
186
-
187
- var global$d = global$e;
188
- var isCallable$f = isCallable$h;
189
-
190
- var aFunction = function (argument) {
191
- return isCallable$f(argument) ? argument : undefined;
192
- };
193
-
194
- var getBuiltIn$4 = function (namespace, method) {
195
- return arguments.length < 2 ? aFunction(global$d[namespace]) : global$d[namespace] && global$d[namespace][method];
196
- };
197
-
198
- var uncurryThis$e = functionUncurryThis;
199
-
200
- var objectIsPrototypeOf = uncurryThis$e({}.isPrototypeOf);
201
-
202
- var getBuiltIn$3 = getBuiltIn$4;
203
-
204
- var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
205
-
206
- var global$c = global$e;
207
- var userAgent = engineUserAgent;
208
-
209
- var process = global$c.process;
210
- var Deno = global$c.Deno;
211
- var versions = process && process.versions || Deno && Deno.version;
212
- var v8 = versions && versions.v8;
213
- var match, version;
214
-
215
- if (v8) {
216
- match = v8.split('.');
217
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
218
- // but their correct versions are not interesting for us
219
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
220
- }
221
-
222
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
223
- // so check `userAgent` even if `.v8` exists, but 0
224
- if (!version && userAgent) {
225
- match = userAgent.match(/Edge\/(\d+)/);
226
- if (!match || match[1] >= 74) {
227
- match = userAgent.match(/Chrome\/(\d+)/);
228
- if (match) version = +match[1];
229
- }
230
- }
231
-
232
- var engineV8Version = version;
233
-
234
- /* eslint-disable es/no-symbol -- required for testing */
235
-
236
- var V8_VERSION = engineV8Version;
237
- var fails$d = fails$h;
238
-
239
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
240
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$d(function () {
241
- var symbol = Symbol();
242
- // Chrome 38 Symbol has incorrect toString conversion
243
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
244
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
245
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
246
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
247
- });
248
-
249
- /* eslint-disable es/no-symbol -- required for testing */
250
-
251
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
252
-
253
- var useSymbolAsUid = NATIVE_SYMBOL$1
254
- && !Symbol.sham
255
- && typeof Symbol.iterator == 'symbol';
256
-
257
- var getBuiltIn$2 = getBuiltIn$4;
258
- var isCallable$e = isCallable$h;
259
- var isPrototypeOf = objectIsPrototypeOf;
260
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
261
-
262
- var $Object$3 = Object;
263
-
264
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
265
- return typeof it == 'symbol';
266
- } : function (it) {
267
- var $Symbol = getBuiltIn$2('Symbol');
268
- return isCallable$e($Symbol) && isPrototypeOf($Symbol.prototype, $Object$3(it));
269
- };
270
-
271
- var $String$3 = String;
272
-
273
- var tryToString$1 = function (argument) {
274
- try {
275
- return $String$3(argument);
276
- } catch (error) {
277
- return 'Object';
278
- }
279
- };
280
-
281
- var isCallable$d = isCallable$h;
282
- var tryToString = tryToString$1;
283
-
284
- var $TypeError$7 = TypeError;
285
-
286
- // `Assert: IsCallable(argument) is true`
287
- var aCallable$1 = function (argument) {
288
- if (isCallable$d(argument)) return argument;
289
- throw $TypeError$7(tryToString(argument) + ' is not a function');
290
- };
291
-
292
- var aCallable = aCallable$1;
293
- var isNullOrUndefined$1 = isNullOrUndefined$3;
294
-
295
- // `GetMethod` abstract operation
296
- // https://tc39.es/ecma262/#sec-getmethod
297
- var getMethod$2 = function (V, P) {
298
- var func = V[P];
299
- return isNullOrUndefined$1(func) ? undefined : aCallable(func);
300
- };
301
-
302
- var call$8 = functionCall;
303
- var isCallable$c = isCallable$h;
304
- var isObject$6 = isObject$7;
305
-
306
- var $TypeError$6 = TypeError;
307
-
308
- // `OrdinaryToPrimitive` abstract operation
309
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
310
- var ordinaryToPrimitive$1 = function (input, pref) {
311
- var fn, val;
312
- if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$6(val = call$8(fn, input))) return val;
313
- if (isCallable$c(fn = input.valueOf) && !isObject$6(val = call$8(fn, input))) return val;
314
- if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$6(val = call$8(fn, input))) return val;
315
- throw $TypeError$6("Can't convert object to primitive value");
316
- };
317
-
318
- var shared$4 = {exports: {}};
319
-
320
- var global$b = global$e;
321
-
322
- // eslint-disable-next-line es/no-object-defineproperty -- safe
323
- var defineProperty$5 = Object.defineProperty;
324
-
325
- var defineGlobalProperty$3 = function (key, value) {
326
- try {
327
- defineProperty$5(global$b, key, { value: value, configurable: true, writable: true });
328
- } catch (error) {
329
- global$b[key] = value;
330
- } return value;
331
- };
332
-
333
- var global$a = global$e;
334
- var defineGlobalProperty$2 = defineGlobalProperty$3;
335
-
336
- var SHARED = '__core-js_shared__';
337
- var store$3 = global$a[SHARED] || defineGlobalProperty$2(SHARED, {});
338
-
339
- var sharedStore = store$3;
340
-
341
- var store$2 = sharedStore;
342
-
343
- (shared$4.exports = function (key, value) {
344
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
345
- })('versions', []).push({
346
- version: '3.26.1',
347
- mode: 'global',
348
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
349
- license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
350
- source: 'https://github.com/zloirock/core-js'
351
- });
352
-
353
- var requireObjectCoercible$3 = requireObjectCoercible$5;
354
-
355
- var $Object$2 = Object;
356
-
357
- // `ToObject` abstract operation
358
- // https://tc39.es/ecma262/#sec-toobject
359
- var toObject$4 = function (argument) {
360
- return $Object$2(requireObjectCoercible$3(argument));
361
- };
362
-
363
- var uncurryThis$d = functionUncurryThis;
364
- var toObject$3 = toObject$4;
365
-
366
- var hasOwnProperty = uncurryThis$d({}.hasOwnProperty);
367
-
368
- // `HasOwnProperty` abstract operation
369
- // https://tc39.es/ecma262/#sec-hasownproperty
370
- // eslint-disable-next-line es/no-object-hasown -- safe
371
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
372
- return hasOwnProperty(toObject$3(it), key);
373
- };
374
-
375
- var uncurryThis$c = functionUncurryThis;
376
-
377
- var id = 0;
378
- var postfix = Math.random();
379
- var toString$5 = uncurryThis$c(1.0.toString);
380
-
381
- var uid$2 = function (key) {
382
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$5(++id + postfix, 36);
383
- };
384
-
385
- var global$9 = global$e;
386
- var shared$3 = shared$4.exports;
387
- var hasOwn$8 = hasOwnProperty_1;
388
- var uid$1 = uid$2;
389
- var NATIVE_SYMBOL = symbolConstructorDetection;
390
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
391
-
392
- var WellKnownSymbolsStore = shared$3('wks');
393
- var Symbol$1 = global$9.Symbol;
394
- var symbolFor = Symbol$1 && Symbol$1['for'];
395
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
396
-
397
- var wellKnownSymbol$c = function (name) {
398
- if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
399
- var description = 'Symbol.' + name;
400
- if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
401
- WellKnownSymbolsStore[name] = Symbol$1[name];
402
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
403
- WellKnownSymbolsStore[name] = symbolFor(description);
404
- } else {
405
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
406
- }
407
- } return WellKnownSymbolsStore[name];
408
- };
409
-
410
- var call$7 = functionCall;
411
- var isObject$5 = isObject$7;
412
- var isSymbol$1 = isSymbol$2;
413
- var getMethod$1 = getMethod$2;
414
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
415
- var wellKnownSymbol$b = wellKnownSymbol$c;
416
-
417
- var $TypeError$5 = TypeError;
418
- var TO_PRIMITIVE = wellKnownSymbol$b('toPrimitive');
419
-
420
- // `ToPrimitive` abstract operation
421
- // https://tc39.es/ecma262/#sec-toprimitive
422
- var toPrimitive$1 = function (input, pref) {
423
- if (!isObject$5(input) || isSymbol$1(input)) return input;
424
- var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
425
- var result;
426
- if (exoticToPrim) {
427
- if (pref === undefined) pref = 'default';
428
- result = call$7(exoticToPrim, input, pref);
429
- if (!isObject$5(result) || isSymbol$1(result)) return result;
430
- throw $TypeError$5("Can't convert object to primitive value");
431
- }
432
- if (pref === undefined) pref = 'number';
433
- return ordinaryToPrimitive(input, pref);
434
- };
435
-
436
- var toPrimitive = toPrimitive$1;
437
- var isSymbol = isSymbol$2;
438
-
439
- // `ToPropertyKey` abstract operation
440
- // https://tc39.es/ecma262/#sec-topropertykey
441
- var toPropertyKey$2 = function (argument) {
442
- var key = toPrimitive(argument, 'string');
443
- return isSymbol(key) ? key : key + '';
444
- };
445
-
446
- var global$8 = global$e;
447
- var isObject$4 = isObject$7;
448
-
449
- var document$1 = global$8.document;
450
- // typeof document.createElement is 'object' in old IE
451
- var EXISTS$1 = isObject$4(document$1) && isObject$4(document$1.createElement);
452
-
453
- var documentCreateElement$2 = function (it) {
454
- return EXISTS$1 ? document$1.createElement(it) : {};
455
- };
456
-
457
- var DESCRIPTORS$9 = descriptors;
458
- var fails$c = fails$h;
459
- var createElement = documentCreateElement$2;
460
-
461
- // Thanks to IE8 for its funny defineProperty
462
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$c(function () {
463
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
464
- return Object.defineProperty(createElement('div'), 'a', {
465
- get: function () { return 7; }
466
- }).a != 7;
467
- });
468
-
469
- var DESCRIPTORS$8 = descriptors;
470
- var call$6 = functionCall;
471
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
472
- var createPropertyDescriptor$2 = createPropertyDescriptor$3;
473
- var toIndexedObject$4 = toIndexedObject$5;
474
- var toPropertyKey$1 = toPropertyKey$2;
475
- var hasOwn$7 = hasOwnProperty_1;
476
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
477
-
478
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
479
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
480
-
481
- // `Object.getOwnPropertyDescriptor` method
482
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
483
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
484
- O = toIndexedObject$4(O);
485
- P = toPropertyKey$1(P);
486
- if (IE8_DOM_DEFINE$1) try {
487
- return $getOwnPropertyDescriptor$1(O, P);
488
- } catch (error) { /* empty */ }
489
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$6(propertyIsEnumerableModule$1.f, O, P), O[P]);
490
- };
491
-
492
- var objectDefineProperty = {};
493
-
494
- var DESCRIPTORS$7 = descriptors;
495
- var fails$b = fails$h;
496
-
497
- // V8 ~ Chrome 36-
498
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
499
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$b(function () {
500
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
501
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
502
- value: 42,
503
- writable: false
504
- }).prototype != 42;
505
- });
506
-
507
- var isObject$3 = isObject$7;
508
-
509
- var $String$2 = String;
510
- var $TypeError$4 = TypeError;
511
-
512
- // `Assert: Type(argument) is Object`
513
- var anObject$8 = function (argument) {
514
- if (isObject$3(argument)) return argument;
515
- throw $TypeError$4($String$2(argument) + ' is not an object');
516
- };
517
-
518
- var DESCRIPTORS$6 = descriptors;
519
- var IE8_DOM_DEFINE = ie8DomDefine;
520
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
521
- var anObject$7 = anObject$8;
522
- var toPropertyKey = toPropertyKey$2;
523
-
524
- var $TypeError$3 = TypeError;
525
- // eslint-disable-next-line es/no-object-defineproperty -- safe
526
- var $defineProperty = Object.defineProperty;
527
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
528
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
529
- var ENUMERABLE = 'enumerable';
530
- var CONFIGURABLE$1 = 'configurable';
531
- var WRITABLE = 'writable';
532
-
533
- // `Object.defineProperty` method
534
- // https://tc39.es/ecma262/#sec-object.defineproperty
535
- objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
536
- anObject$7(O);
537
- P = toPropertyKey(P);
538
- anObject$7(Attributes);
539
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
540
- var current = $getOwnPropertyDescriptor(O, P);
541
- if (current && current[WRITABLE]) {
542
- O[P] = Attributes.value;
543
- Attributes = {
544
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
545
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
546
- writable: false
547
- };
548
- }
549
- } return $defineProperty(O, P, Attributes);
550
- } : $defineProperty : function defineProperty(O, P, Attributes) {
551
- anObject$7(O);
552
- P = toPropertyKey(P);
553
- anObject$7(Attributes);
554
- if (IE8_DOM_DEFINE) try {
555
- return $defineProperty(O, P, Attributes);
556
- } catch (error) { /* empty */ }
557
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$3('Accessors not supported');
558
- if ('value' in Attributes) O[P] = Attributes.value;
559
- return O;
560
- };
561
-
562
- var DESCRIPTORS$5 = descriptors;
563
- var definePropertyModule$3 = objectDefineProperty;
564
- var createPropertyDescriptor$1 = createPropertyDescriptor$3;
565
-
566
- var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
567
- return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
568
- } : function (object, key, value) {
569
- object[key] = value;
570
- return object;
571
- };
572
-
573
- var makeBuiltIn$2 = {exports: {}};
574
-
575
- var DESCRIPTORS$4 = descriptors;
576
- var hasOwn$6 = hasOwnProperty_1;
577
-
578
- var FunctionPrototype$1 = Function.prototype;
579
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
580
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
581
-
582
- var EXISTS = hasOwn$6(FunctionPrototype$1, 'name');
583
- // additional protection from minified / mangled / dropped function names
584
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
585
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, 'name').configurable));
586
-
587
- var functionName = {
588
- EXISTS: EXISTS,
589
- PROPER: PROPER,
590
- CONFIGURABLE: CONFIGURABLE
591
- };
592
-
593
- var uncurryThis$b = functionUncurryThis;
594
- var isCallable$b = isCallable$h;
595
- var store$1 = sharedStore;
596
-
597
- var functionToString = uncurryThis$b(Function.toString);
598
-
599
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
600
- if (!isCallable$b(store$1.inspectSource)) {
601
- store$1.inspectSource = function (it) {
602
- return functionToString(it);
603
- };
604
- }
605
-
606
- var inspectSource$1 = store$1.inspectSource;
607
-
608
- var global$7 = global$e;
609
- var isCallable$a = isCallable$h;
610
-
611
- var WeakMap$1 = global$7.WeakMap;
612
-
613
- var weakMapBasicDetection = isCallable$a(WeakMap$1) && /native code/.test(String(WeakMap$1));
614
-
615
- var shared$2 = shared$4.exports;
616
- var uid = uid$2;
617
-
618
- var keys = shared$2('keys');
619
-
620
- var sharedKey$3 = function (key) {
621
- return keys[key] || (keys[key] = uid(key));
622
- };
623
-
624
- var hiddenKeys$4 = {};
625
-
626
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
627
- var global$6 = global$e;
628
- var isObject$2 = isObject$7;
629
- var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
630
- var hasOwn$5 = hasOwnProperty_1;
631
- var shared$1 = sharedStore;
632
- var sharedKey$2 = sharedKey$3;
633
- var hiddenKeys$3 = hiddenKeys$4;
634
-
635
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
636
- var TypeError$1 = global$6.TypeError;
637
- var WeakMap = global$6.WeakMap;
638
- var set, get, has;
639
-
640
- var enforce = function (it) {
641
- return has(it) ? get(it) : set(it, {});
642
- };
643
-
644
- var getterFor = function (TYPE) {
645
- return function (it) {
646
- var state;
647
- if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
648
- throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
649
- } return state;
650
- };
651
- };
652
-
653
- if (NATIVE_WEAK_MAP || shared$1.state) {
654
- var store = shared$1.state || (shared$1.state = new WeakMap());
655
- /* eslint-disable no-self-assign -- prototype methods protection */
656
- store.get = store.get;
657
- store.has = store.has;
658
- store.set = store.set;
659
- /* eslint-enable no-self-assign -- prototype methods protection */
660
- set = function (it, metadata) {
661
- if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
662
- metadata.facade = it;
663
- store.set(it, metadata);
664
- return metadata;
665
- };
666
- get = function (it) {
667
- return store.get(it) || {};
668
- };
669
- has = function (it) {
670
- return store.has(it);
671
- };
672
- } else {
673
- var STATE = sharedKey$2('state');
674
- hiddenKeys$3[STATE] = true;
675
- set = function (it, metadata) {
676
- if (hasOwn$5(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
677
- metadata.facade = it;
678
- createNonEnumerableProperty$4(it, STATE, metadata);
679
- return metadata;
680
- };
681
- get = function (it) {
682
- return hasOwn$5(it, STATE) ? it[STATE] : {};
683
- };
684
- has = function (it) {
685
- return hasOwn$5(it, STATE);
686
- };
687
- }
688
-
689
- var internalState = {
690
- set: set,
691
- get: get,
692
- has: has,
693
- enforce: enforce,
694
- getterFor: getterFor
695
- };
696
-
697
- var fails$a = fails$h;
698
- var isCallable$9 = isCallable$h;
699
- var hasOwn$4 = hasOwnProperty_1;
700
- var DESCRIPTORS$3 = descriptors;
701
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
702
- var inspectSource = inspectSource$1;
703
- var InternalStateModule$1 = internalState;
704
-
705
- var enforceInternalState = InternalStateModule$1.enforce;
706
- var getInternalState$2 = InternalStateModule$1.get;
707
- // eslint-disable-next-line es/no-object-defineproperty -- safe
708
- var defineProperty$4 = Object.defineProperty;
709
-
710
- var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$a(function () {
711
- return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
712
- });
713
-
714
- var TEMPLATE = String(String).split('String');
715
-
716
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
717
- if (String(name).slice(0, 7) === 'Symbol(') {
718
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
719
- }
720
- if (options && options.getter) name = 'get ' + name;
721
- if (options && options.setter) name = 'set ' + name;
722
- if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
723
- if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
724
- else value.name = name;
725
- }
726
- if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
727
- defineProperty$4(value, 'length', { value: options.arity });
728
- }
729
- try {
730
- if (options && hasOwn$4(options, 'constructor') && options.constructor) {
731
- if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
732
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
733
- } else if (value.prototype) value.prototype = undefined;
734
- } catch (error) { /* empty */ }
735
- var state = enforceInternalState(value);
736
- if (!hasOwn$4(state, 'source')) {
737
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
738
- } return value;
739
- };
740
-
741
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
742
- // eslint-disable-next-line no-extend-native -- required
743
- Function.prototype.toString = makeBuiltIn$1(function toString() {
744
- return isCallable$9(this) && getInternalState$2(this).source || inspectSource(this);
745
- }, 'toString');
746
-
747
- var isCallable$8 = isCallable$h;
748
- var definePropertyModule$2 = objectDefineProperty;
749
- var makeBuiltIn = makeBuiltIn$2.exports;
750
- var defineGlobalProperty$1 = defineGlobalProperty$3;
751
-
752
- var defineBuiltIn$4 = function (O, key, value, options) {
753
- if (!options) options = {};
754
- var simple = options.enumerable;
755
- var name = options.name !== undefined ? options.name : key;
756
- if (isCallable$8(value)) makeBuiltIn(value, name, options);
757
- if (options.global) {
758
- if (simple) O[key] = value;
759
- else defineGlobalProperty$1(key, value);
760
- } else {
761
- try {
762
- if (!options.unsafe) delete O[key];
763
- else if (O[key]) simple = true;
764
- } catch (error) { /* empty */ }
765
- if (simple) O[key] = value;
766
- else definePropertyModule$2.f(O, key, {
767
- value: value,
768
- enumerable: false,
769
- configurable: !options.nonConfigurable,
770
- writable: !options.nonWritable
771
- });
772
- } return O;
773
- };
774
-
775
- var objectGetOwnPropertyNames = {};
776
-
777
- var ceil = Math.ceil;
778
- var floor$1 = Math.floor;
779
-
780
- // `Math.trunc` method
781
- // https://tc39.es/ecma262/#sec-math.trunc
782
- // eslint-disable-next-line es/no-math-trunc -- safe
783
- var mathTrunc = Math.trunc || function trunc(x) {
784
- var n = +x;
785
- return (n > 0 ? floor$1 : ceil)(n);
786
- };
787
-
788
- var trunc = mathTrunc;
789
-
790
- // `ToIntegerOrInfinity` abstract operation
791
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
792
- var toIntegerOrInfinity$4 = function (argument) {
793
- var number = +argument;
794
- // eslint-disable-next-line no-self-compare -- NaN check
795
- return number !== number || number === 0 ? 0 : trunc(number);
796
- };
797
-
798
- var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
799
-
800
- var max$1 = Math.max;
801
- var min$2 = Math.min;
802
-
803
- // Helper for a popular repeating case of the spec:
804
- // Let integer be ? ToInteger(index).
805
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
806
- var toAbsoluteIndex$1 = function (index, length) {
807
- var integer = toIntegerOrInfinity$3(index);
808
- return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length);
809
- };
810
-
811
- var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
812
-
813
- var min$1 = Math.min;
814
-
815
- // `ToLength` abstract operation
816
- // https://tc39.es/ecma262/#sec-tolength
817
- var toLength$2 = function (argument) {
818
- return argument > 0 ? min$1(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
819
- };
820
-
821
- var toLength$1 = toLength$2;
822
-
823
- // `LengthOfArrayLike` abstract operation
824
- // https://tc39.es/ecma262/#sec-lengthofarraylike
825
- var lengthOfArrayLike$1 = function (obj) {
826
- return toLength$1(obj.length);
827
- };
828
-
829
- var toIndexedObject$3 = toIndexedObject$5;
830
- var toAbsoluteIndex = toAbsoluteIndex$1;
831
- var lengthOfArrayLike = lengthOfArrayLike$1;
832
-
833
- // `Array.prototype.{ indexOf, includes }` methods implementation
834
- var createMethod$1 = function (IS_INCLUDES) {
835
- return function ($this, el, fromIndex) {
836
- var O = toIndexedObject$3($this);
837
- var length = lengthOfArrayLike(O);
838
- var index = toAbsoluteIndex(fromIndex, length);
839
- var value;
840
- // Array#includes uses SameValueZero equality algorithm
841
- // eslint-disable-next-line no-self-compare -- NaN check
842
- if (IS_INCLUDES && el != el) while (length > index) {
843
- value = O[index++];
844
- // eslint-disable-next-line no-self-compare -- NaN check
845
- if (value != value) return true;
846
- // Array#indexOf ignores holes, Array#includes - not
847
- } else for (;length > index; index++) {
848
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
849
- } return !IS_INCLUDES && -1;
850
- };
851
- };
852
-
853
- var arrayIncludes = {
854
- // `Array.prototype.includes` method
855
- // https://tc39.es/ecma262/#sec-array.prototype.includes
856
- includes: createMethod$1(true),
857
- // `Array.prototype.indexOf` method
858
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
859
- indexOf: createMethod$1(false)
860
- };
861
-
862
- var uncurryThis$a = functionUncurryThis;
863
- var hasOwn$3 = hasOwnProperty_1;
864
- var toIndexedObject$2 = toIndexedObject$5;
865
- var indexOf$1 = arrayIncludes.indexOf;
866
- var hiddenKeys$2 = hiddenKeys$4;
867
-
868
- var push$1 = uncurryThis$a([].push);
869
-
870
- var objectKeysInternal = function (object, names) {
871
- var O = toIndexedObject$2(object);
872
- var i = 0;
873
- var result = [];
874
- var key;
875
- for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push$1(result, key);
876
- // Don't enum bug & hidden keys
877
- while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
878
- ~indexOf$1(result, key) || push$1(result, key);
879
- }
880
- return result;
881
- };
882
-
883
- // IE8- don't enum bug keys
884
- var enumBugKeys$3 = [
885
- 'constructor',
886
- 'hasOwnProperty',
887
- 'isPrototypeOf',
888
- 'propertyIsEnumerable',
889
- 'toLocaleString',
890
- 'toString',
891
- 'valueOf'
892
- ];
893
-
894
- var internalObjectKeys$1 = objectKeysInternal;
895
- var enumBugKeys$2 = enumBugKeys$3;
896
-
897
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
898
-
899
- // `Object.getOwnPropertyNames` method
900
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
901
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
902
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
903
- return internalObjectKeys$1(O, hiddenKeys$1);
904
- };
905
-
906
- var objectGetOwnPropertySymbols = {};
907
-
908
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
909
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
910
-
911
- var getBuiltIn$1 = getBuiltIn$4;
912
- var uncurryThis$9 = functionUncurryThis;
913
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
914
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
915
- var anObject$6 = anObject$8;
916
-
917
- var concat$2 = uncurryThis$9([].concat);
918
-
919
- // all object keys, includes non-enumerable and symbols
920
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
921
- var keys = getOwnPropertyNamesModule.f(anObject$6(it));
922
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
923
- return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
924
- };
925
-
926
- var hasOwn$2 = hasOwnProperty_1;
927
- var ownKeys = ownKeys$1;
928
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
929
- var definePropertyModule$1 = objectDefineProperty;
930
-
931
- var copyConstructorProperties$1 = function (target, source, exceptions) {
932
- var keys = ownKeys(source);
933
- var defineProperty = definePropertyModule$1.f;
934
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
935
- for (var i = 0; i < keys.length; i++) {
936
- var key = keys[i];
937
- if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
938
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
939
- }
940
- }
941
- };
942
-
943
- var fails$9 = fails$h;
944
- var isCallable$7 = isCallable$h;
945
-
946
- var replacement = /#|\.prototype\./;
947
-
948
- var isForced$1 = function (feature, detection) {
949
- var value = data[normalize(feature)];
950
- return value == POLYFILL ? true
951
- : value == NATIVE ? false
952
- : isCallable$7(detection) ? fails$9(detection)
953
- : !!detection;
954
- };
955
-
956
- var normalize = isForced$1.normalize = function (string) {
957
- return String(string).replace(replacement, '.').toLowerCase();
958
- };
959
-
960
- var data = isForced$1.data = {};
961
- var NATIVE = isForced$1.NATIVE = 'N';
962
- var POLYFILL = isForced$1.POLYFILL = 'P';
963
-
964
- var isForced_1 = isForced$1;
965
-
966
- var global$5 = global$e;
967
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
968
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
969
- var defineBuiltIn$3 = defineBuiltIn$4;
970
- var defineGlobalProperty = defineGlobalProperty$3;
971
- var copyConstructorProperties = copyConstructorProperties$1;
972
- var isForced = isForced_1;
973
-
974
- /*
975
- options.target - name of the target object
976
- options.global - target is the global object
977
- options.stat - export as static methods of target
978
- options.proto - export as prototype methods of target
979
- options.real - real prototype method for the `pure` version
980
- options.forced - export even if the native feature is available
981
- options.bind - bind methods to the target, required for the `pure` version
982
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
983
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
984
- options.sham - add a flag to not completely full polyfills
985
- options.enumerable - export as enumerable property
986
- options.dontCallGetSet - prevent calling a getter on target
987
- options.name - the .name of the function if it does not match the key
988
- */
989
- var _export = function (options, source) {
990
- var TARGET = options.target;
991
- var GLOBAL = options.global;
992
- var STATIC = options.stat;
993
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
994
- if (GLOBAL) {
995
- target = global$5;
996
- } else if (STATIC) {
997
- target = global$5[TARGET] || defineGlobalProperty(TARGET, {});
998
- } else {
999
- target = (global$5[TARGET] || {}).prototype;
1000
- }
1001
- if (target) for (key in source) {
1002
- sourceProperty = source[key];
1003
- if (options.dontCallGetSet) {
1004
- descriptor = getOwnPropertyDescriptor(target, key);
1005
- targetProperty = descriptor && descriptor.value;
1006
- } else targetProperty = target[key];
1007
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1008
- // contained in target
1009
- if (!FORCED && targetProperty !== undefined) {
1010
- if (typeof sourceProperty == typeof targetProperty) continue;
1011
- copyConstructorProperties(sourceProperty, targetProperty);
1012
- }
1013
- // add a flag to not completely full polyfills
1014
- if (options.sham || (targetProperty && targetProperty.sham)) {
1015
- createNonEnumerableProperty$3(sourceProperty, 'sham', true);
1016
- }
1017
- defineBuiltIn$3(target, key, sourceProperty, options);
1018
- }
1019
- };
1020
-
1021
- var internalObjectKeys = objectKeysInternal;
1022
- var enumBugKeys$1 = enumBugKeys$3;
1023
-
1024
- // `Object.keys` method
1025
- // https://tc39.es/ecma262/#sec-object.keys
1026
- // eslint-disable-next-line es/no-object-keys -- safe
1027
- var objectKeys$2 = Object.keys || function keys(O) {
1028
- return internalObjectKeys(O, enumBugKeys$1);
1029
- };
1030
-
1031
- var DESCRIPTORS$2 = descriptors;
1032
- var uncurryThis$8 = functionUncurryThis;
1033
- var call$5 = functionCall;
1034
- var fails$8 = fails$h;
1035
- var objectKeys$1 = objectKeys$2;
1036
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1037
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1038
- var toObject$2 = toObject$4;
1039
- var IndexedObject = indexedObject;
1040
-
1041
- // eslint-disable-next-line es/no-object-assign -- safe
1042
- var $assign = Object.assign;
1043
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1044
- var defineProperty$3 = Object.defineProperty;
1045
- var concat$1 = uncurryThis$8([].concat);
1046
-
1047
- // `Object.assign` method
1048
- // https://tc39.es/ecma262/#sec-object.assign
1049
- var objectAssign = !$assign || fails$8(function () {
1050
- // should have correct order of operations (Edge bug)
1051
- if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1052
- enumerable: true,
1053
- get: function () {
1054
- defineProperty$3(this, 'b', {
1055
- value: 3,
1056
- enumerable: false
1057
- });
1058
- }
1059
- }), { b: 2 })).b !== 1) return true;
1060
- // should work with symbols and should have deterministic property order (V8 bug)
1061
- var A = {};
1062
- var B = {};
1063
- // eslint-disable-next-line es/no-symbol -- safe
1064
- var symbol = Symbol();
1065
- var alphabet = 'abcdefghijklmnopqrst';
1066
- A[symbol] = 7;
1067
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1068
- return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1069
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1070
- var T = toObject$2(target);
1071
- var argumentsLength = arguments.length;
1072
- var index = 1;
1073
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1074
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1075
- while (argumentsLength > index) {
1076
- var S = IndexedObject(arguments[index++]);
1077
- var keys = getOwnPropertySymbols ? concat$1(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1078
- var length = keys.length;
1079
- var j = 0;
1080
- var key;
1081
- while (length > j) {
1082
- key = keys[j++];
1083
- if (!DESCRIPTORS$2 || call$5(propertyIsEnumerable, S, key)) T[key] = S[key];
1084
- }
1085
- } return T;
1086
- } : $assign;
1087
-
1088
- var $$4 = _export;
1089
- var assign = objectAssign;
1090
-
1091
- // `Object.assign` method
1092
- // https://tc39.es/ecma262/#sec-object.assign
1093
- // eslint-disable-next-line es/no-object-assign -- required for testing
1094
- $$4({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1095
- assign: assign
1096
- });
1097
-
1098
- var objectDefineProperties = {};
1099
-
1100
- var DESCRIPTORS$1 = descriptors;
1101
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1102
- var definePropertyModule = objectDefineProperty;
1103
- var anObject$5 = anObject$8;
1104
- var toIndexedObject$1 = toIndexedObject$5;
1105
- var objectKeys = objectKeys$2;
1106
-
1107
- // `Object.defineProperties` method
1108
- // https://tc39.es/ecma262/#sec-object.defineproperties
1109
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1110
- objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1111
- anObject$5(O);
1112
- var props = toIndexedObject$1(Properties);
1113
- var keys = objectKeys(Properties);
1114
- var length = keys.length;
1115
- var index = 0;
1116
- var key;
1117
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1118
- return O;
1119
- };
1120
-
1121
- var getBuiltIn = getBuiltIn$4;
1122
-
1123
- var html$1 = getBuiltIn('document', 'documentElement');
1124
-
1125
- /* global ActiveXObject -- old IE, WSH */
1126
-
1127
- var anObject$4 = anObject$8;
1128
- var definePropertiesModule = objectDefineProperties;
1129
- var enumBugKeys = enumBugKeys$3;
1130
- var hiddenKeys = hiddenKeys$4;
1131
- var html = html$1;
1132
- var documentCreateElement$1 = documentCreateElement$2;
1133
- var sharedKey$1 = sharedKey$3;
1134
-
1135
- var GT = '>';
1136
- var LT = '<';
1137
- var PROTOTYPE = 'prototype';
1138
- var SCRIPT = 'script';
1139
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1140
-
1141
- var EmptyConstructor = function () { /* empty */ };
1142
-
1143
- var scriptTag = function (content) {
1144
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1145
- };
1146
-
1147
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1148
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1149
- activeXDocument.write(scriptTag(''));
1150
- activeXDocument.close();
1151
- var temp = activeXDocument.parentWindow.Object;
1152
- activeXDocument = null; // avoid memory leak
1153
- return temp;
1154
- };
1155
-
1156
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1157
- var NullProtoObjectViaIFrame = function () {
1158
- // Thrash, waste and sodomy: IE GC bug
1159
- var iframe = documentCreateElement$1('iframe');
1160
- var JS = 'java' + SCRIPT + ':';
1161
- var iframeDocument;
1162
- iframe.style.display = 'none';
1163
- html.appendChild(iframe);
1164
- // https://github.com/zloirock/core-js/issues/475
1165
- iframe.src = String(JS);
1166
- iframeDocument = iframe.contentWindow.document;
1167
- iframeDocument.open();
1168
- iframeDocument.write(scriptTag('document.F=Object'));
1169
- iframeDocument.close();
1170
- return iframeDocument.F;
1171
- };
1172
-
1173
- // Check for document.domain and active x support
1174
- // No need to use active x approach when document.domain is not set
1175
- // see https://github.com/es-shims/es5-shim/issues/150
1176
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1177
- // avoid IE GC bug
1178
- var activeXDocument;
1179
- var NullProtoObject = function () {
1180
- try {
1181
- activeXDocument = new ActiveXObject('htmlfile');
1182
- } catch (error) { /* ignore */ }
1183
- NullProtoObject = typeof document != 'undefined'
1184
- ? document.domain && activeXDocument
1185
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1186
- : NullProtoObjectViaIFrame()
1187
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1188
- var length = enumBugKeys.length;
1189
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1190
- return NullProtoObject();
1191
- };
1192
-
1193
- hiddenKeys[IE_PROTO$1] = true;
1194
-
1195
- // `Object.create` method
1196
- // https://tc39.es/ecma262/#sec-object.create
1197
- // eslint-disable-next-line es/no-object-create -- safe
1198
- var objectCreate = Object.create || function create(O, Properties) {
1199
- var result;
1200
- if (O !== null) {
1201
- EmptyConstructor[PROTOTYPE] = anObject$4(O);
1202
- result = new EmptyConstructor();
1203
- EmptyConstructor[PROTOTYPE] = null;
1204
- // add "__proto__" for Object.getPrototypeOf polyfill
1205
- result[IE_PROTO$1] = O;
1206
- } else result = NullProtoObject();
1207
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1208
- };
1209
-
1210
- var wellKnownSymbol$a = wellKnownSymbol$c;
1211
- var create$2 = objectCreate;
1212
- var defineProperty$2 = objectDefineProperty.f;
1213
-
1214
- var UNSCOPABLES = wellKnownSymbol$a('unscopables');
1215
- var ArrayPrototype = Array.prototype;
1216
-
1217
- // Array.prototype[@@unscopables]
1218
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1219
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
1220
- defineProperty$2(ArrayPrototype, UNSCOPABLES, {
1221
- configurable: true,
1222
- value: create$2(null)
1223
- });
1224
- }
1225
-
1226
- // add a key to Array.prototype[@@unscopables]
1227
- var addToUnscopables$2 = function (key) {
1228
- ArrayPrototype[UNSCOPABLES][key] = true;
1229
- };
1230
-
1231
- var $$3 = _export;
1232
- var $includes = arrayIncludes.includes;
1233
- var fails$7 = fails$h;
1234
- var addToUnscopables$1 = addToUnscopables$2;
1235
-
1236
- // FF99+ bug
1237
- var BROKEN_ON_SPARSE = fails$7(function () {
1238
- return !Array(1).includes();
1239
- });
1240
-
1241
- // `Array.prototype.includes` method
1242
- // https://tc39.es/ecma262/#sec-array.prototype.includes
1243
- $$3({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1244
- includes: function includes(el /* , fromIndex = 0 */) {
1245
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1246
- }
1247
- });
1248
-
1249
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1250
- addToUnscopables$1('includes');
1251
-
1252
- var isObject$1 = isObject$7;
1253
- var classof$3 = classofRaw$2;
1254
- var wellKnownSymbol$9 = wellKnownSymbol$c;
1255
-
1256
- var MATCH$1 = wellKnownSymbol$9('match');
1257
-
1258
- // `IsRegExp` abstract operation
1259
- // https://tc39.es/ecma262/#sec-isregexp
1260
- var isRegexp = function (it) {
1261
- var isRegExp;
1262
- return isObject$1(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$3(it) == 'RegExp');
1263
- };
1264
-
1265
- var isRegExp = isRegexp;
1266
-
1267
- var $TypeError$2 = TypeError;
1268
-
1269
- var notARegexp = function (it) {
1270
- if (isRegExp(it)) {
1271
- throw $TypeError$2("The method doesn't accept regular expressions");
1272
- } return it;
1273
- };
1274
-
1275
- var wellKnownSymbol$8 = wellKnownSymbol$c;
1276
-
1277
- var TO_STRING_TAG$3 = wellKnownSymbol$8('toStringTag');
1278
- var test = {};
1279
-
1280
- test[TO_STRING_TAG$3] = 'z';
1281
-
1282
- var toStringTagSupport = String(test) === '[object z]';
1283
-
1284
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1285
- var isCallable$6 = isCallable$h;
1286
- var classofRaw$1 = classofRaw$2;
1287
- var wellKnownSymbol$7 = wellKnownSymbol$c;
1288
-
1289
- var TO_STRING_TAG$2 = wellKnownSymbol$7('toStringTag');
1290
- var $Object$1 = Object;
1291
-
1292
- // ES3 wrong here
1293
- var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
1294
-
1295
- // fallback for IE11 Script Access Denied error
1296
- var tryGet = function (it, key) {
1297
- try {
1298
- return it[key];
1299
- } catch (error) { /* empty */ }
1300
- };
1301
-
1302
- // getting tag from ES6+ `Object.prototype.toString`
1303
- var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1304
- var O, tag, result;
1305
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1306
- // @@toStringTag case
1307
- : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$2)) == 'string' ? tag
1308
- // builtinTag case
1309
- : CORRECT_ARGUMENTS ? classofRaw$1(O)
1310
- // ES3 arguments fallback
1311
- : (result = classofRaw$1(O)) == 'Object' && isCallable$6(O.callee) ? 'Arguments' : result;
1312
- };
1313
-
1314
- var classof$1 = classof$2;
1315
-
1316
- var $String$1 = String;
1317
-
1318
- var toString$4 = function (argument) {
1319
- if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1320
- return $String$1(argument);
1321
- };
1322
-
1323
- var wellKnownSymbol$6 = wellKnownSymbol$c;
1324
-
1325
- var MATCH = wellKnownSymbol$6('match');
1326
-
1327
- var correctIsRegexpLogic = function (METHOD_NAME) {
1328
- var regexp = /./;
1329
- try {
1330
- '/./'[METHOD_NAME](regexp);
1331
- } catch (error1) {
1332
- try {
1333
- regexp[MATCH] = false;
1334
- return '/./'[METHOD_NAME](regexp);
1335
- } catch (error2) { /* empty */ }
1336
- } return false;
1337
- };
1338
-
1339
- var $$2 = _export;
1340
- var uncurryThis$7 = functionUncurryThis;
1341
- var notARegExp = notARegexp;
1342
- var requireObjectCoercible$2 = requireObjectCoercible$5;
1343
- var toString$3 = toString$4;
1344
- var correctIsRegExpLogic = correctIsRegexpLogic;
1345
-
1346
- var stringIndexOf$1 = uncurryThis$7(''.indexOf);
1347
-
1348
- // `String.prototype.includes` method
1349
- // https://tc39.es/ecma262/#sec-string.prototype.includes
1350
- $$2({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
1351
- includes: function includes(searchString /* , position = 0 */) {
1352
- return !!~stringIndexOf$1(
1353
- toString$3(requireObjectCoercible$2(this)),
1354
- toString$3(notARegExp(searchString)),
1355
- arguments.length > 1 ? arguments[1] : undefined
1356
- );
1357
- }
1358
- });
1359
-
1360
- var anObject$3 = anObject$8;
1361
-
1362
- // `RegExp.prototype.flags` getter implementation
1363
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1364
- var regexpFlags$1 = function () {
1365
- var that = anObject$3(this);
1366
- var result = '';
1367
- if (that.hasIndices) result += 'd';
1368
- if (that.global) result += 'g';
1369
- if (that.ignoreCase) result += 'i';
1370
- if (that.multiline) result += 'm';
1371
- if (that.dotAll) result += 's';
1372
- if (that.unicode) result += 'u';
1373
- if (that.unicodeSets) result += 'v';
1374
- if (that.sticky) result += 'y';
1375
- return result;
1376
- };
1377
-
1378
- var fails$6 = fails$h;
1379
- var global$4 = global$e;
1380
-
1381
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1382
- var $RegExp$2 = global$4.RegExp;
1383
-
1384
- var UNSUPPORTED_Y$1 = fails$6(function () {
1385
- var re = $RegExp$2('a', 'y');
1386
- re.lastIndex = 2;
1387
- return re.exec('abcd') != null;
1388
- });
1389
-
1390
- // UC Browser bug
1391
- // https://github.com/zloirock/core-js/issues/1008
1392
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$6(function () {
1393
- return !$RegExp$2('a', 'y').sticky;
1394
- });
1395
-
1396
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$6(function () {
1397
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1398
- var re = $RegExp$2('^r', 'gy');
1399
- re.lastIndex = 2;
1400
- return re.exec('str') != null;
1401
- });
1402
-
1403
- var regexpStickyHelpers = {
1404
- BROKEN_CARET: BROKEN_CARET,
1405
- MISSED_STICKY: MISSED_STICKY,
1406
- UNSUPPORTED_Y: UNSUPPORTED_Y$1
1407
- };
1408
-
1409
- var fails$5 = fails$h;
1410
- var global$3 = global$e;
1411
-
1412
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1413
- var $RegExp$1 = global$3.RegExp;
1414
-
1415
- var regexpUnsupportedDotAll = fails$5(function () {
1416
- var re = $RegExp$1('.', 's');
1417
- return !(re.dotAll && re.exec('\n') && re.flags === 's');
1418
- });
1419
-
1420
- var fails$4 = fails$h;
1421
- var global$2 = global$e;
1422
-
1423
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1424
- var $RegExp = global$2.RegExp;
1425
-
1426
- var regexpUnsupportedNcg = fails$4(function () {
1427
- var re = $RegExp('(?<a>b)', 'g');
1428
- return re.exec('b').groups.a !== 'b' ||
1429
- 'b'.replace(re, '$<a>c') !== 'bc';
1430
- });
1431
-
1432
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1433
- /* eslint-disable regexp/no-useless-quantifier -- testing */
1434
- var call$4 = functionCall;
1435
- var uncurryThis$6 = functionUncurryThis;
1436
- var toString$2 = toString$4;
1437
- var regexpFlags = regexpFlags$1;
1438
- var stickyHelpers = regexpStickyHelpers;
1439
- var shared = shared$4.exports;
1440
- var create$1 = objectCreate;
1441
- var getInternalState$1 = internalState.get;
1442
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1443
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1444
-
1445
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
1446
- var nativeExec = RegExp.prototype.exec;
1447
- var patchedExec = nativeExec;
1448
- var charAt$3 = uncurryThis$6(''.charAt);
1449
- var indexOf = uncurryThis$6(''.indexOf);
1450
- var replace$1 = uncurryThis$6(''.replace);
1451
- var stringSlice$3 = uncurryThis$6(''.slice);
1452
-
1453
- var UPDATES_LAST_INDEX_WRONG = (function () {
1454
- var re1 = /a/;
1455
- var re2 = /b*/g;
1456
- call$4(nativeExec, re1, 'a');
1457
- call$4(nativeExec, re2, 'a');
1458
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1459
- })();
1460
-
1461
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1462
-
1463
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
1464
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1465
-
1466
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1467
-
1468
- if (PATCH) {
1469
- patchedExec = function exec(string) {
1470
- var re = this;
1471
- var state = getInternalState$1(re);
1472
- var str = toString$2(string);
1473
- var raw = state.raw;
1474
- var result, reCopy, lastIndex, match, i, object, group;
1475
-
1476
- if (raw) {
1477
- raw.lastIndex = re.lastIndex;
1478
- result = call$4(patchedExec, raw, str);
1479
- re.lastIndex = raw.lastIndex;
1480
- return result;
1481
- }
1482
-
1483
- var groups = state.groups;
1484
- var sticky = UNSUPPORTED_Y && re.sticky;
1485
- var flags = call$4(regexpFlags, re);
1486
- var source = re.source;
1487
- var charsAdded = 0;
1488
- var strCopy = str;
1489
-
1490
- if (sticky) {
1491
- flags = replace$1(flags, 'y', '');
1492
- if (indexOf(flags, 'g') === -1) {
1493
- flags += 'g';
1494
- }
1495
-
1496
- strCopy = stringSlice$3(str, re.lastIndex);
1497
- // Support anchored sticky behavior.
1498
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
1499
- source = '(?: ' + source + ')';
1500
- strCopy = ' ' + strCopy;
1501
- charsAdded++;
1502
- }
1503
- // ^(? + rx + ) is needed, in combination with some str slicing, to
1504
- // simulate the 'y' flag.
1505
- reCopy = new RegExp('^(?:' + source + ')', flags);
1506
- }
1507
-
1508
- if (NPCG_INCLUDED) {
1509
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1510
- }
1511
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1512
-
1513
- match = call$4(nativeExec, sticky ? reCopy : re, strCopy);
1514
-
1515
- if (sticky) {
1516
- if (match) {
1517
- match.input = stringSlice$3(match.input, charsAdded);
1518
- match[0] = stringSlice$3(match[0], charsAdded);
1519
- match.index = re.lastIndex;
1520
- re.lastIndex += match[0].length;
1521
- } else re.lastIndex = 0;
1522
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
1523
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1524
- }
1525
- if (NPCG_INCLUDED && match && match.length > 1) {
1526
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1527
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
1528
- call$4(nativeReplace, match[0], reCopy, function () {
1529
- for (i = 1; i < arguments.length - 2; i++) {
1530
- if (arguments[i] === undefined) match[i] = undefined;
1531
- }
1532
- });
1533
- }
1534
-
1535
- if (match && groups) {
1536
- match.groups = object = create$1(null);
1537
- for (i = 0; i < groups.length; i++) {
1538
- group = groups[i];
1539
- object[group[0]] = match[group[1]];
1540
- }
1541
- }
1542
-
1543
- return match;
1544
- };
1545
- }
1546
-
1547
- var regexpExec$2 = patchedExec;
1548
-
1549
- var $$1 = _export;
1550
- var exec = regexpExec$2;
1551
-
1552
- // `RegExp.prototype.exec` method
1553
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1554
- $$1({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
1555
- exec: exec
1556
- });
1557
-
1558
- var NATIVE_BIND = functionBindNative;
1559
-
1560
- var FunctionPrototype = Function.prototype;
1561
- var apply$1 = FunctionPrototype.apply;
1562
- var call$3 = FunctionPrototype.call;
1563
-
1564
- // eslint-disable-next-line es/no-reflect -- safe
1565
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$3.bind(apply$1) : function () {
1566
- return call$3.apply(apply$1, arguments);
1567
- });
1568
-
1569
- var classofRaw = classofRaw$2;
1570
- var uncurryThis$5 = functionUncurryThis;
1571
-
1572
- var functionUncurryThisClause = function (fn) {
1573
- // Nashorn bug:
1574
- // https://github.com/zloirock/core-js/issues/1128
1575
- // https://github.com/zloirock/core-js/issues/1130
1576
- if (classofRaw(fn) === 'Function') return uncurryThis$5(fn);
1577
- };
1578
-
1579
- // TODO: Remove from `core-js@4` since it's moved to entry points
1580
-
1581
- var uncurryThis$4 = functionUncurryThisClause;
1582
- var defineBuiltIn$2 = defineBuiltIn$4;
1583
- var regexpExec$1 = regexpExec$2;
1584
- var fails$3 = fails$h;
1585
- var wellKnownSymbol$5 = wellKnownSymbol$c;
1586
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1587
-
1588
- var SPECIES = wellKnownSymbol$5('species');
1589
- var RegExpPrototype = RegExp.prototype;
1590
-
1591
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1592
- var SYMBOL = wellKnownSymbol$5(KEY);
1593
-
1594
- var DELEGATES_TO_SYMBOL = !fails$3(function () {
1595
- // String methods call symbol-named RegEp methods
1596
- var O = {};
1597
- O[SYMBOL] = function () { return 7; };
1598
- return ''[KEY](O) != 7;
1599
- });
1600
-
1601
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$3(function () {
1602
- // Symbol-named RegExp methods call .exec
1603
- var execCalled = false;
1604
- var re = /a/;
1605
-
1606
- if (KEY === 'split') {
1607
- // We can't use real regex here since it causes deoptimization
1608
- // and serious performance degradation in V8
1609
- // https://github.com/zloirock/core-js/issues/306
1610
- re = {};
1611
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
1612
- // a new one. We need to return the patched regex when creating the new one.
1613
- re.constructor = {};
1614
- re.constructor[SPECIES] = function () { return re; };
1615
- re.flags = '';
1616
- re[SYMBOL] = /./[SYMBOL];
1617
- }
1618
-
1619
- re.exec = function () { execCalled = true; return null; };
1620
-
1621
- re[SYMBOL]('');
1622
- return !execCalled;
1623
- });
1624
-
1625
- if (
1626
- !DELEGATES_TO_SYMBOL ||
1627
- !DELEGATES_TO_EXEC ||
1628
- FORCED
1629
- ) {
1630
- var uncurriedNativeRegExpMethod = uncurryThis$4(/./[SYMBOL]);
1631
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1632
- var uncurriedNativeMethod = uncurryThis$4(nativeMethod);
1633
- var $exec = regexp.exec;
1634
- if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
1635
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1636
- // The native String method already delegates to @@method (this
1637
- // polyfilled function), leasing to infinite recursion.
1638
- // We avoid it by directly calling the native @@method method.
1639
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
1640
- }
1641
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
1642
- }
1643
- return { done: false };
1644
- });
1645
-
1646
- defineBuiltIn$2(String.prototype, KEY, methods[0]);
1647
- defineBuiltIn$2(RegExpPrototype, SYMBOL, methods[1]);
1648
- }
1649
-
1650
- if (SHAM) createNonEnumerableProperty$2(RegExpPrototype[SYMBOL], 'sham', true);
1651
- };
1652
-
1653
- var uncurryThis$3 = functionUncurryThis;
1654
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
1655
- var toString$1 = toString$4;
1656
- var requireObjectCoercible$1 = requireObjectCoercible$5;
1657
-
1658
- var charAt$2 = uncurryThis$3(''.charAt);
1659
- var charCodeAt = uncurryThis$3(''.charCodeAt);
1660
- var stringSlice$2 = uncurryThis$3(''.slice);
1661
-
1662
- var createMethod = function (CONVERT_TO_STRING) {
1663
- return function ($this, pos) {
1664
- var S = toString$1(requireObjectCoercible$1($this));
1665
- var position = toIntegerOrInfinity$1(pos);
1666
- var size = S.length;
1667
- var first, second;
1668
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1669
- first = charCodeAt(S, position);
1670
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
1671
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
1672
- ? CONVERT_TO_STRING
1673
- ? charAt$2(S, position)
1674
- : first
1675
- : CONVERT_TO_STRING
1676
- ? stringSlice$2(S, position, position + 2)
1677
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1678
- };
1679
- };
1680
-
1681
- var stringMultibyte = {
1682
- // `String.prototype.codePointAt` method
1683
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1684
- codeAt: createMethod(false),
1685
- // `String.prototype.at` method
1686
- // https://github.com/mathiasbynens/String.prototype.at
1687
- charAt: createMethod(true)
1688
- };
1689
-
1690
- var charAt$1 = stringMultibyte.charAt;
1691
-
1692
- // `AdvanceStringIndex` abstract operation
1693
- // https://tc39.es/ecma262/#sec-advancestringindex
1694
- var advanceStringIndex$1 = function (S, index, unicode) {
1695
- return index + (unicode ? charAt$1(S, index).length : 1);
1696
- };
1697
-
1698
- var uncurryThis$2 = functionUncurryThis;
1699
- var toObject$1 = toObject$4;
1700
-
1701
- var floor = Math.floor;
1702
- var charAt = uncurryThis$2(''.charAt);
1703
- var replace = uncurryThis$2(''.replace);
1704
- var stringSlice$1 = uncurryThis$2(''.slice);
1705
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
1706
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
1707
-
1708
- // `GetSubstitution` abstract operation
1709
- // https://tc39.es/ecma262/#sec-getsubstitution
1710
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
1711
- var tailPos = position + matched.length;
1712
- var m = captures.length;
1713
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
1714
- if (namedCaptures !== undefined) {
1715
- namedCaptures = toObject$1(namedCaptures);
1716
- symbols = SUBSTITUTION_SYMBOLS;
1717
- }
1718
- return replace(replacement, symbols, function (match, ch) {
1719
- var capture;
1720
- switch (charAt(ch, 0)) {
1721
- case '$': return '$';
1722
- case '&': return matched;
1723
- case '`': return stringSlice$1(str, 0, position);
1724
- case "'": return stringSlice$1(str, tailPos);
1725
- case '<':
1726
- capture = namedCaptures[stringSlice$1(ch, 1, -1)];
1727
- break;
1728
- default: // \d\d?
1729
- var n = +ch;
1730
- if (n === 0) return match;
1731
- if (n > m) {
1732
- var f = floor(n / 10);
1733
- if (f === 0) return match;
1734
- if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
1735
- return match;
1736
- }
1737
- capture = captures[n - 1];
1738
- }
1739
- return capture === undefined ? '' : capture;
1740
- });
1741
- };
1742
-
1743
- var call$2 = functionCall;
1744
- var anObject$2 = anObject$8;
1745
- var isCallable$5 = isCallable$h;
1746
- var classof = classofRaw$2;
1747
- var regexpExec = regexpExec$2;
1748
-
1749
- var $TypeError$1 = TypeError;
1750
-
1751
- // `RegExpExec` abstract operation
1752
- // https://tc39.es/ecma262/#sec-regexpexec
1753
- var regexpExecAbstract = function (R, S) {
1754
- var exec = R.exec;
1755
- if (isCallable$5(exec)) {
1756
- var result = call$2(exec, R, S);
1757
- if (result !== null) anObject$2(result);
1758
- return result;
1759
- }
1760
- if (classof(R) === 'RegExp') return call$2(regexpExec, R, S);
1761
- throw $TypeError$1('RegExp#exec called on incompatible receiver');
1762
- };
1763
-
1764
- var apply = functionApply;
1765
- var call$1 = functionCall;
1766
- var uncurryThis$1 = functionUncurryThis;
1767
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
1768
- var fails$2 = fails$h;
1769
- var anObject$1 = anObject$8;
1770
- var isCallable$4 = isCallable$h;
1771
- var isNullOrUndefined = isNullOrUndefined$3;
1772
- var toIntegerOrInfinity = toIntegerOrInfinity$4;
1773
- var toLength = toLength$2;
1774
- var toString = toString$4;
1775
- var requireObjectCoercible = requireObjectCoercible$5;
1776
- var advanceStringIndex = advanceStringIndex$1;
1777
- var getMethod = getMethod$2;
1778
- var getSubstitution = getSubstitution$1;
1779
- var regExpExec = regexpExecAbstract;
1780
- var wellKnownSymbol$4 = wellKnownSymbol$c;
1781
-
1782
- var REPLACE = wellKnownSymbol$4('replace');
1783
- var max = Math.max;
1784
- var min = Math.min;
1785
- var concat = uncurryThis$1([].concat);
1786
- var push = uncurryThis$1([].push);
1787
- var stringIndexOf = uncurryThis$1(''.indexOf);
1788
- var stringSlice = uncurryThis$1(''.slice);
1789
-
1790
- var maybeToString = function (it) {
1791
- return it === undefined ? it : String(it);
1792
- };
1793
-
1794
- // IE <= 11 replaces $0 with the whole match, as if it was $&
1795
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
1796
- var REPLACE_KEEPS_$0 = (function () {
1797
- // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
1798
- return 'a'.replace(/./, '$0') === '$0';
1799
- })();
1800
-
1801
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
1802
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
1803
- if (/./[REPLACE]) {
1804
- return /./[REPLACE]('a', '$0') === '';
1805
- }
1806
- return false;
1807
- })();
1808
-
1809
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$2(function () {
1810
- var re = /./;
1811
- re.exec = function () {
1812
- var result = [];
1813
- result.groups = { a: '7' };
1814
- return result;
1815
- };
1816
- // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
1817
- return ''.replace(re, '$<a>') !== '7';
1818
- });
1819
-
1820
- // @@replace logic
1821
- fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
1822
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
1823
-
1824
- return [
1825
- // `String.prototype.replace` method
1826
- // https://tc39.es/ecma262/#sec-string.prototype.replace
1827
- function replace(searchValue, replaceValue) {
1828
- var O = requireObjectCoercible(this);
1829
- var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
1830
- return replacer
1831
- ? call$1(replacer, searchValue, O, replaceValue)
1832
- : call$1(nativeReplace, toString(O), searchValue, replaceValue);
1833
- },
1834
- // `RegExp.prototype[@@replace]` method
1835
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
1836
- function (string, replaceValue) {
1837
- var rx = anObject$1(this);
1838
- var S = toString(string);
1839
-
1840
- if (
1841
- typeof replaceValue == 'string' &&
1842
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
1843
- stringIndexOf(replaceValue, '$<') === -1
1844
- ) {
1845
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
1846
- if (res.done) return res.value;
1847
- }
1848
-
1849
- var functionalReplace = isCallable$4(replaceValue);
1850
- if (!functionalReplace) replaceValue = toString(replaceValue);
1851
-
1852
- var global = rx.global;
1853
- if (global) {
1854
- var fullUnicode = rx.unicode;
1855
- rx.lastIndex = 0;
1856
- }
1857
- var results = [];
1858
- while (true) {
1859
- var result = regExpExec(rx, S);
1860
- if (result === null) break;
1861
-
1862
- push(results, result);
1863
- if (!global) break;
1864
-
1865
- var matchStr = toString(result[0]);
1866
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1867
- }
1868
-
1869
- var accumulatedResult = '';
1870
- var nextSourcePosition = 0;
1871
- for (var i = 0; i < results.length; i++) {
1872
- result = results[i];
1873
-
1874
- var matched = toString(result[0]);
1875
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
1876
- var captures = [];
1877
- // NOTE: This is equivalent to
1878
- // captures = result.slice(1).map(maybeToString)
1879
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
1880
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
1881
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
1882
- for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
1883
- var namedCaptures = result.groups;
1884
- if (functionalReplace) {
1885
- var replacerArgs = concat([matched], captures, position, S);
1886
- if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
1887
- var replacement = toString(apply(replaceValue, undefined, replacerArgs));
1888
- } else {
1889
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
1890
- }
1891
- if (position >= nextSourcePosition) {
1892
- accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
1893
- nextSourcePosition = position + matched.length;
1894
- }
1895
- }
1896
- return accumulatedResult + stringSlice(S, nextSourcePosition);
1897
- }
1898
- ];
1899
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
1900
-
1901
15
  /******************************************************************************
1902
16
  Copyright (c) Microsoft Corporation.
1903
17
 
@@ -1923,731 +37,241 @@ function __awaiter(thisArg, _arguments, P, generator) {
1923
37
  });
1924
38
  }
1925
39
 
1926
- const ManagerApolloProvider = ({
1927
- children
1928
- }) => {
1929
- const {
1930
- publicUrl,
1931
- graphqlLegacyUrl,
1932
- graphqlManagerUrl,
1933
- graphqlManagerImageUploadUrl,
1934
- graphqlReportUrl,
1935
- graphqlSimulatorUrl,
1936
- isDev,
1937
- tracingHeaders
1938
- } = useEnvironment();
1939
- const {
1940
- token
1941
- } = useToken();
1942
- const legacyGraphQLLink = createUploadLink({
1943
- uri: request => graphqlLegacyUrl + "/" + request.operationName
1944
- });
1945
- const managerGraphQLLink = createUploadLink({
1946
- uri: request => graphqlManagerUrl + "/" + request.operationName
1947
- });
1948
- const imageUploadGraphQLLink = createUploadLink({
1949
- uri: request => graphqlManagerImageUploadUrl + "/" + request.operationName
1950
- });
1951
- const reportGraphQLLink = createUploadLink({
1952
- uri: request => graphqlReportUrl + "/" + request.operationName
1953
- });
1954
- const simulatorGraphQLLink = createUploadLink({
1955
- uri: request => graphqlSimulatorUrl + "/" + request.operationName
1956
- });
1957
- const authLink = setContext((_, {
1958
- headers
1959
- }) => __awaiter(void 0, void 0, void 0, function* () {
1960
- return {
1961
- headers: Object.assign(Object.assign(Object.assign({}, headers), tracingHeaders), {
1962
- Authorization: token ? `Bearer ${token}` : null
1963
- })
1964
- };
1965
- }));
1966
- const errorLink = onError(errorResponse => {
1967
- var _a, _b;
1968
- const traceIds = []; // Used to hold id's for use in Sentry
1969
- if (errorResponse.graphQLErrors) {
1970
- // eslint-disable-next-line no-console
1971
- console.error("Error Fetching Data", errorResponse.graphQLErrors);
1972
- (_a = errorResponse.graphQLErrors) === null || _a === void 0 ? void 0 : _a.forEach(error => {
1973
- var _a, _b;
1974
- if (error === null || error === void 0 ? void 0 : error.extensions) {
1975
- error.extensions.traceId = (_b = (_a = errorResponse.response) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.traceId;
1976
- traceIds.push(error.extensions.traceId);
1977
- }
1978
- });
1979
- /**
1980
- * We want to see the full graphQL error since
1981
- * it contains extra details like the query/mutation
1982
- * name.
1983
- */
1984
- if (Sentry) {
1985
- if (traceIds.length) {
1986
- Sentry.setTag("traceIds", traceIds.join(", "));
1987
- }
1988
- Sentry.addBreadcrumb({
1989
- category: "GraphQL",
1990
- message: "GraphQL Error",
1991
- level: 'error',
1992
- data: {
1993
- log: JSON.stringify(errorResponse.graphQLErrors)
1994
- }
1995
- });
1996
- }
1997
- }
1998
- const invalidToken = (_b = errorResponse.graphQLErrors) === null || _b === void 0 ? void 0 : _b.some(x => {
1999
- var _a, _b;
2000
- return ((_a = x === null || x === void 0 ? void 0 : x.extensions) === null || _a === void 0 ? void 0 : _a.code) === "UNAUTHENTICATED" || ((_b = x === null || x === void 0 ? void 0 : x.message) === null || _b === void 0 ? void 0 : _b.includes("Invalid token specified"));
2001
- });
2002
- if (invalidToken) {
2003
- window.location.replace(`${publicUrl}logout`);
2004
- }
2005
- if (errorResponse.networkError) {
2006
- // eslint-disable-next-line no-console
2007
- console.error(errorResponse.networkError);
2008
- }
2009
- });
2010
- const defaultOptions = {
2011
- watchQuery: {
2012
- fetchPolicy: "no-cache",
2013
- errorPolicy: "all"
2014
- },
2015
- query: {
2016
- fetchPolicy: "no-cache"
2017
- }
2018
- };
2019
- const client = new ApolloClient({
2020
- name: "Manager",
2021
- connectToDevTools: isDev,
2022
- cache: new InMemoryCache(),
2023
- defaultOptions,
2024
- link: from([errorLink, authLink, split$1(operation => operation.getContext().clientName === "imageupload", imageUploadGraphQLLink), split$1(operation => operation.getContext().clientName === "simulator", simulatorGraphQLLink), split$1(operation => operation.getContext().clientName === "manager", managerGraphQLLink, split$1(operation => operation.getContext().clientName === "report", reportGraphQLLink, legacyGraphQLLink))])
2025
- });
2026
- return jsx(ApolloProvider, Object.assign({
2027
- client: client
2028
- }, {
2029
- children: children
2030
- }));
2031
- };
2032
-
2033
- const ToastProviderApp = ({
2034
- children
2035
- }) => {
2036
- const value = useMemo(() => ({
2037
- addToast: ToastRuntime.addToast
2038
- }), []);
2039
- return jsx(ToastProvider, Object.assign({
2040
- value: value
2041
- }, {
2042
- children: children
2043
- }));
2044
- };
2045
-
2046
- var iterators = {};
2047
-
2048
- var fails$1 = fails$h;
2049
-
2050
- var correctPrototypeGetter = !fails$1(function () {
2051
- function F() { /* empty */ }
2052
- F.prototype.constructor = null;
2053
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
2054
- return Object.getPrototypeOf(new F()) !== F.prototype;
2055
- });
2056
-
2057
- var hasOwn$1 = hasOwnProperty_1;
2058
- var isCallable$3 = isCallable$h;
2059
- var toObject = toObject$4;
2060
- var sharedKey = sharedKey$3;
2061
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
2062
-
2063
- var IE_PROTO = sharedKey('IE_PROTO');
2064
- var $Object = Object;
2065
- var ObjectPrototype = $Object.prototype;
2066
-
2067
- // `Object.getPrototypeOf` method
2068
- // https://tc39.es/ecma262/#sec-object.getprototypeof
2069
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
2070
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
2071
- var object = toObject(O);
2072
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
2073
- var constructor = object.constructor;
2074
- if (isCallable$3(constructor) && object instanceof constructor) {
2075
- return constructor.prototype;
2076
- } return object instanceof $Object ? ObjectPrototype : null;
2077
- };
2078
-
2079
- var fails = fails$h;
2080
- var isCallable$2 = isCallable$h;
2081
- var isObject = isObject$7;
2082
- var getPrototypeOf$1 = objectGetPrototypeOf;
2083
- var defineBuiltIn$1 = defineBuiltIn$4;
2084
- var wellKnownSymbol$3 = wellKnownSymbol$c;
2085
-
2086
- var ITERATOR$2 = wellKnownSymbol$3('iterator');
2087
- var BUGGY_SAFARI_ITERATORS$1 = false;
2088
-
2089
- // `%IteratorPrototype%` object
2090
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
2091
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
2092
-
2093
- /* eslint-disable es/no-array-prototype-keys -- safe */
2094
- if ([].keys) {
2095
- arrayIterator = [].keys();
2096
- // Safari 8 has buggy iterators w/o `next`
2097
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
2098
- else {
2099
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
2100
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
2101
- }
2102
- }
2103
-
2104
- var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails(function () {
2105
- var test = {};
2106
- // FF44- legacy iterators case
2107
- return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
2108
- });
2109
-
2110
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
2111
-
2112
- // `%IteratorPrototype%[@@iterator]()` method
2113
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
2114
- if (!isCallable$2(IteratorPrototype$2[ITERATOR$2])) {
2115
- defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
2116
- return this;
2117
- });
2118
- }
2119
-
2120
- var iteratorsCore = {
2121
- IteratorPrototype: IteratorPrototype$2,
2122
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
2123
- };
2124
-
2125
- var defineProperty$1 = objectDefineProperty.f;
2126
- var hasOwn = hasOwnProperty_1;
2127
- var wellKnownSymbol$2 = wellKnownSymbol$c;
2128
-
2129
- var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
2130
-
2131
- var setToStringTag$2 = function (target, TAG, STATIC) {
2132
- if (target && !STATIC) target = target.prototype;
2133
- if (target && !hasOwn(target, TO_STRING_TAG$1)) {
2134
- defineProperty$1(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
2135
- }
2136
- };
2137
-
2138
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
2139
- var create = objectCreate;
2140
- var createPropertyDescriptor = createPropertyDescriptor$3;
2141
- var setToStringTag$1 = setToStringTag$2;
2142
- var Iterators$2 = iterators;
2143
-
2144
- var returnThis$1 = function () { return this; };
2145
-
2146
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
2147
- var TO_STRING_TAG = NAME + ' Iterator';
2148
- IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
2149
- setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
2150
- Iterators$2[TO_STRING_TAG] = returnThis$1;
2151
- return IteratorConstructor;
2152
- };
2153
-
2154
- var isCallable$1 = isCallable$h;
2155
-
2156
- var $String = String;
2157
- var $TypeError = TypeError;
2158
-
2159
- var aPossiblePrototype$1 = function (argument) {
2160
- if (typeof argument == 'object' || isCallable$1(argument)) return argument;
2161
- throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
2162
- };
2163
-
2164
- /* eslint-disable no-proto -- safe */
2165
-
2166
- var uncurryThis = functionUncurryThis;
2167
- var anObject = anObject$8;
2168
- var aPossiblePrototype = aPossiblePrototype$1;
2169
-
2170
- // `Object.setPrototypeOf` method
2171
- // https://tc39.es/ecma262/#sec-object.setprototypeof
2172
- // Works with __proto__ only. Old v8 can't work with null proto objects.
2173
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
2174
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
2175
- var CORRECT_SETTER = false;
2176
- var test = {};
2177
- var setter;
2178
- try {
2179
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2180
- setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
2181
- setter(test, []);
2182
- CORRECT_SETTER = test instanceof Array;
2183
- } catch (error) { /* empty */ }
2184
- return function setPrototypeOf(O, proto) {
2185
- anObject(O);
2186
- aPossiblePrototype(proto);
2187
- if (CORRECT_SETTER) setter(O, proto);
2188
- else O.__proto__ = proto;
2189
- return O;
2190
- };
2191
- }() : undefined);
2192
-
2193
- var $ = _export;
2194
- var call = functionCall;
2195
- var FunctionName = functionName;
2196
- var isCallable = isCallable$h;
2197
- var createIteratorConstructor = iteratorCreateConstructor;
2198
- var getPrototypeOf = objectGetPrototypeOf;
2199
- var setPrototypeOf = objectSetPrototypeOf;
2200
- var setToStringTag = setToStringTag$2;
2201
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
2202
- var defineBuiltIn = defineBuiltIn$4;
2203
- var wellKnownSymbol$1 = wellKnownSymbol$c;
2204
- var Iterators$1 = iterators;
2205
- var IteratorsCore = iteratorsCore;
2206
-
2207
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
2208
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
2209
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
2210
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
2211
- var ITERATOR$1 = wellKnownSymbol$1('iterator');
2212
- var KEYS = 'keys';
2213
- var VALUES = 'values';
2214
- var ENTRIES = 'entries';
2215
-
2216
- var returnThis = function () { return this; };
2217
-
2218
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
2219
- createIteratorConstructor(IteratorConstructor, NAME, next);
2220
-
2221
- var getIterationMethod = function (KIND) {
2222
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
2223
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
2224
- switch (KIND) {
2225
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
2226
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
2227
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
2228
- } return function () { return new IteratorConstructor(this); };
2229
- };
2230
-
2231
- var TO_STRING_TAG = NAME + ' Iterator';
2232
- var INCORRECT_VALUES_NAME = false;
2233
- var IterablePrototype = Iterable.prototype;
2234
- var nativeIterator = IterablePrototype[ITERATOR$1]
2235
- || IterablePrototype['@@iterator']
2236
- || DEFAULT && IterablePrototype[DEFAULT];
2237
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
2238
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
2239
- var CurrentIteratorPrototype, methods, KEY;
2240
-
2241
- // fix native
2242
- if (anyNativeIterator) {
2243
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
2244
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
2245
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
2246
- if (setPrototypeOf) {
2247
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
2248
- } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
2249
- defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
2250
- }
2251
- }
2252
- // Set @@toStringTag to native iterators
2253
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
2254
- }
2255
- }
2256
-
2257
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
2258
- if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
2259
- if (CONFIGURABLE_FUNCTION_NAME) {
2260
- createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
2261
- } else {
2262
- INCORRECT_VALUES_NAME = true;
2263
- defaultIterator = function values() { return call(nativeIterator, this); };
2264
- }
2265
- }
2266
-
2267
- // export additional methods
2268
- if (DEFAULT) {
2269
- methods = {
2270
- values: getIterationMethod(VALUES),
2271
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
2272
- entries: getIterationMethod(ENTRIES)
2273
- };
2274
- if (FORCED) for (KEY in methods) {
2275
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
2276
- defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
2277
- }
2278
- } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
2279
- }
2280
-
2281
- // define iterator
2282
- if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
2283
- defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
2284
- }
2285
- Iterators$1[NAME] = defaultIterator;
2286
-
2287
- return methods;
2288
- };
2289
-
2290
- // `CreateIterResultObject` abstract operation
2291
- // https://tc39.es/ecma262/#sec-createiterresultobject
2292
- var createIterResultObject$1 = function (value, done) {
2293
- return { value: value, done: done };
2294
- };
2295
-
2296
- var toIndexedObject = toIndexedObject$5;
2297
- var addToUnscopables = addToUnscopables$2;
2298
- var Iterators = iterators;
2299
- var InternalStateModule = internalState;
2300
- var defineProperty = objectDefineProperty.f;
2301
- var defineIterator = iteratorDefine;
2302
- var createIterResultObject = createIterResultObject$1;
2303
- var DESCRIPTORS = descriptors;
2304
-
2305
- var ARRAY_ITERATOR = 'Array Iterator';
2306
- var setInternalState = InternalStateModule.set;
2307
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
2308
-
2309
- // `Array.prototype.entries` method
2310
- // https://tc39.es/ecma262/#sec-array.prototype.entries
2311
- // `Array.prototype.keys` method
2312
- // https://tc39.es/ecma262/#sec-array.prototype.keys
2313
- // `Array.prototype.values` method
2314
- // https://tc39.es/ecma262/#sec-array.prototype.values
2315
- // `Array.prototype[@@iterator]` method
2316
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
2317
- // `CreateArrayIterator` internal method
2318
- // https://tc39.es/ecma262/#sec-createarrayiterator
2319
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
2320
- setInternalState(this, {
2321
- type: ARRAY_ITERATOR,
2322
- target: toIndexedObject(iterated), // target
2323
- index: 0, // next index
2324
- kind: kind // kind
2325
- });
2326
- // `%ArrayIteratorPrototype%.next` method
2327
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
2328
- }, function () {
2329
- var state = getInternalState(this);
2330
- var target = state.target;
2331
- var kind = state.kind;
2332
- var index = state.index++;
2333
- if (!target || index >= target.length) {
2334
- state.target = undefined;
2335
- return createIterResultObject(undefined, true);
2336
- }
2337
- if (kind == 'keys') return createIterResultObject(index, false);
2338
- if (kind == 'values') return createIterResultObject(target[index], false);
2339
- return createIterResultObject([index, target[index]], false);
2340
- }, 'values');
2341
-
2342
- // argumentsList[@@iterator] is %ArrayProto_values%
2343
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
2344
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
2345
- var values = Iterators.Arguments = Iterators.Array;
2346
-
2347
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2348
- addToUnscopables('keys');
2349
- addToUnscopables('values');
2350
- addToUnscopables('entries');
2351
-
2352
- // V8 ~ Chrome 45- bug
2353
- if (DESCRIPTORS && values.name !== 'values') try {
2354
- defineProperty(values, 'name', { value: 'values' });
2355
- } catch (error) { /* empty */ }
2356
-
2357
- // iterable DOM collections
2358
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2359
- var domIterables = {
2360
- CSSRuleList: 0,
2361
- CSSStyleDeclaration: 0,
2362
- CSSValueList: 0,
2363
- ClientRectList: 0,
2364
- DOMRectList: 0,
2365
- DOMStringList: 0,
2366
- DOMTokenList: 1,
2367
- DataTransferItemList: 0,
2368
- FileList: 0,
2369
- HTMLAllCollection: 0,
2370
- HTMLCollection: 0,
2371
- HTMLFormElement: 0,
2372
- HTMLSelectElement: 0,
2373
- MediaList: 0,
2374
- MimeTypeArray: 0,
2375
- NamedNodeMap: 0,
2376
- NodeList: 1,
2377
- PaintRequestList: 0,
2378
- Plugin: 0,
2379
- PluginArray: 0,
2380
- SVGLengthList: 0,
2381
- SVGNumberList: 0,
2382
- SVGPathSegList: 0,
2383
- SVGPointList: 0,
2384
- SVGStringList: 0,
2385
- SVGTransformList: 0,
2386
- SourceBufferList: 0,
2387
- StyleSheetList: 0,
2388
- TextTrackCueList: 0,
2389
- TextTrackList: 0,
2390
- TouchList: 0
40
+ const ManagerApolloProvider = ({ children }) => {
41
+ const { publicUrl, graphqlLegacyUrl, graphqlManagerUrl, graphqlManagerImageUploadUrl, graphqlReportUrl, graphqlSimulatorUrl, isDev, tracingHeaders, } = useEnvironment();
42
+ const { token } = useToken();
43
+ const legacyGraphQLLink = createUploadLink({
44
+ uri: request => graphqlLegacyUrl + "/" + request.operationName,
45
+ });
46
+ const managerGraphQLLink = createUploadLink({
47
+ uri: request => graphqlManagerUrl + "/" + request.operationName,
48
+ });
49
+ const imageUploadGraphQLLink = createUploadLink({
50
+ uri: request => graphqlManagerImageUploadUrl + "/" + request.operationName,
51
+ });
52
+ const reportGraphQLLink = createUploadLink({
53
+ uri: request => graphqlReportUrl + "/" + request.operationName,
54
+ });
55
+ const simulatorGraphQLLink = createUploadLink({
56
+ uri: request => graphqlSimulatorUrl + "/" + request.operationName,
57
+ });
58
+ const authLink = setContext((_, { headers }) => __awaiter(void 0, void 0, void 0, function* () {
59
+ return {
60
+ headers: Object.assign(Object.assign(Object.assign({}, headers), tracingHeaders), { Authorization: token ? `Bearer ${token}` : null }),
61
+ };
62
+ }));
63
+ const errorLink = onError((errorResponse) => {
64
+ var _a, _b;
65
+ const traceIds = []; // Used to hold id's for use in Sentry
66
+ if (errorResponse.graphQLErrors) {
67
+ // eslint-disable-next-line no-console
68
+ console.error("Error Fetching Data", errorResponse.graphQLErrors);
69
+ (_a = errorResponse.graphQLErrors) === null || _a === void 0 ? void 0 : _a.forEach(error => {
70
+ var _a, _b;
71
+ if (error === null || error === void 0 ? void 0 : error.extensions) {
72
+ error.extensions.traceId = (_b = (_a = errorResponse.response) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.traceId;
73
+ traceIds.push(error.extensions.traceId);
74
+ }
75
+ });
76
+ /**
77
+ * We want to see the full graphQL error since
78
+ * it contains extra details like the query/mutation
79
+ * name.
80
+ */
81
+ if (Sentry) {
82
+ if (traceIds.length) {
83
+ Sentry.setTag("traceIds", traceIds.join(", "));
84
+ }
85
+ Sentry.addBreadcrumb({
86
+ category: "GraphQL",
87
+ message: "GraphQL Error",
88
+ level: 'error',
89
+ data: {
90
+ log: JSON.stringify(errorResponse.graphQLErrors),
91
+ },
92
+ });
93
+ }
94
+ }
95
+ const invalidToken = (_b = errorResponse.graphQLErrors) === null || _b === void 0 ? void 0 : _b.some(x => { var _a, _b; return ((_a = x === null || x === void 0 ? void 0 : x.extensions) === null || _a === void 0 ? void 0 : _a.code) === "UNAUTHENTICATED" || ((_b = x === null || x === void 0 ? void 0 : x.message) === null || _b === void 0 ? void 0 : _b.includes("Invalid token specified")); });
96
+ if (invalidToken) {
97
+ window.location.replace(`${publicUrl}logout`);
98
+ }
99
+ if (errorResponse.networkError) {
100
+ // eslint-disable-next-line no-console
101
+ console.error(errorResponse.networkError);
102
+ }
103
+ });
104
+ const defaultOptions = {
105
+ watchQuery: {
106
+ fetchPolicy: "no-cache",
107
+ errorPolicy: "all",
108
+ },
109
+ query: {
110
+ fetchPolicy: "no-cache",
111
+ },
112
+ };
113
+ const client = new ApolloClient({
114
+ name: "Manager",
115
+ connectToDevTools: isDev,
116
+ cache: new InMemoryCache(),
117
+ defaultOptions,
118
+ link: from([
119
+ errorLink,
120
+ authLink,
121
+ split(operation => operation.getContext().clientName === "imageupload", imageUploadGraphQLLink),
122
+ split(operation => operation.getContext().clientName === "simulator", simulatorGraphQLLink),
123
+ split(operation => operation.getContext().clientName === "manager", managerGraphQLLink, split(operation => operation.getContext().clientName === "report", reportGraphQLLink, legacyGraphQLLink)),
124
+ ]),
125
+ });
126
+ return jsx(ApolloProvider, Object.assign({ client: client }, { children: children }));
2391
127
  };
2392
128
 
2393
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2394
- var documentCreateElement = documentCreateElement$2;
2395
-
2396
- var classList = documentCreateElement('span').classList;
2397
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
2398
-
2399
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2400
-
2401
- var global$1 = global$e;
2402
- var DOMIterables = domIterables;
2403
- var DOMTokenListPrototype = domTokenListPrototype;
2404
- var ArrayIteratorMethods = es_array_iterator;
2405
- var createNonEnumerableProperty = createNonEnumerableProperty$5;
2406
- var wellKnownSymbol = wellKnownSymbol$c;
2407
-
2408
- var ITERATOR = wellKnownSymbol('iterator');
2409
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2410
- var ArrayValues = ArrayIteratorMethods.values;
2411
-
2412
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
2413
- if (CollectionPrototype) {
2414
- // some Chrome versions have non-configurable methods on DOMTokenList
2415
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
2416
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
2417
- } catch (error) {
2418
- CollectionPrototype[ITERATOR] = ArrayValues;
2419
- }
2420
- if (!CollectionPrototype[TO_STRING_TAG]) {
2421
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
2422
- }
2423
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
2424
- // some Chrome versions have non-configurable methods on DOMTokenList
2425
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
2426
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
2427
- } catch (error) {
2428
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
2429
- }
2430
- }
2431
- }
129
+ const ToastProviderApp = ({ children }) => {
130
+ const value = useMemo(() => ({ addToast: ToastRuntime.addToast }), []);
131
+ return jsx(ToastProvider, Object.assign({ value: value }, { children: children }));
2432
132
  };
2433
133
 
2434
- for (var COLLECTION_NAME in DOMIterables) {
2435
- handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
2436
- }
2437
-
2438
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
2439
-
2440
134
  /**
2441
135
  * Subscribe to methods initiated by changes in the host
2442
136
  *
2443
137
  * @param methods STABLE object with the methods you'd want to subscribe to. Wrap in useMemo for instance to make it stable
2444
- */
2445
- const useSubscribeToHostChanges = methods => {
2446
- useEffect(() => {
2447
- const connection = setupHostConnector(methods);
2448
- return () => {
2449
- connection.destroy();
2450
- };
2451
- }, [methods]);
2452
- };
2453
-
2454
- const TileAssetSortingProvider = ({
2455
- children
2456
- }) => {
2457
- const [assetSortingState, setAssetSortingState] = useState(null);
2458
- useEffect(() => {
2459
- AssetSortingRuntime.getAssetSortingState().catch(() => null).then(setAssetSortingState);
2460
- }, []);
2461
- const methods = useMemo(() => ({
2462
- onAssetSortingStateChanged: setAssetSortingState
2463
- }), [setAssetSortingState]);
2464
- useSubscribeToHostChanges(methods);
2465
- const contextValue = useMemo(() => ({
2466
- sortingState: assetSortingState,
2467
- setSortBy: AssetSortingRuntime.setAssetSortingState
2468
- }), [assetSortingState]);
2469
- if (!assetSortingState) {
2470
- return null;
2471
- }
2472
- return jsx(AssetSortingProvider, Object.assign({
2473
- value: contextValue
2474
- }, {
2475
- children: children
2476
- }));
2477
- };
2478
-
2479
- const TileEnvironmentProvider = ({
2480
- children
2481
- }) => {
2482
- const [environment, setEnvironment] = React.useState(null);
2483
- React.useEffect(() => {
2484
- const updateEnv = () => __awaiter(void 0, void 0, void 0, function* () {
2485
- try {
2486
- setEnvironment(yield EnvironmentRuntime.getEnvironmentContext());
2487
- } catch (error) {
2488
- setEnvironment(null);
2489
- // eslint-disable-next-line no-console
2490
- console.error("Could not load environment!");
2491
- }
2492
- });
2493
- updateEnv();
2494
- }, []);
2495
- if (!environment) {
2496
- return null;
2497
- }
2498
- return jsx(EnvironmentContextProvider, Object.assign({
2499
- value: environment
2500
- }, {
2501
- children: children
2502
- }));
2503
- };
2504
-
2505
- const TileGlobalSelectionProvider = ({
2506
- children
2507
- }) => {
2508
- const [GlobalSelectionContext, setGlobalSelectionContext] = useState(null);
2509
- useEffect(() => {
2510
- GlobalSelectionRuntime.getGlobalSelection().catch(() => null).then(setGlobalSelectionContext);
2511
- }, []);
2512
- const methods = useMemo(() => ({
2513
- onGlobalSelectionChanged: setGlobalSelectionContext
2514
- }), [setGlobalSelectionContext]);
2515
- useSubscribeToHostChanges(methods);
2516
- if (!GlobalSelectionContext) {
2517
- return null;
2518
- }
2519
- return jsx(GlobalSelectionProvider, Object.assign({
2520
- value: GlobalSelectionContext
2521
- }, {
2522
- children: children
2523
- }));
2524
- };
2525
-
2526
- const TileTokenProvider = ({
2527
- children
2528
- }) => {
2529
- const [tokenContext, setTokenContext] = React.useState(null);
2530
- React.useEffect(() => {
2531
- const updateContext = () => __awaiter(void 0, void 0, void 0, function* () {
2532
- try {
2533
- setTokenContext(yield TokenRuntime.getTokenContext());
2534
- } catch (error) {
2535
- setTokenContext(null);
2536
- }
2537
- });
2538
- updateContext();
2539
- }, []);
2540
- const methods = React.useMemo(() => ({
2541
- onTokenChanged: setTokenContext
2542
- }), [setTokenContext]);
2543
- useSubscribeToHostChanges(methods);
2544
- if (!tokenContext) {
2545
- return null;
2546
- }
2547
- return jsx(TokenProvider, Object.assign({
2548
- value: tokenContext
2549
- }, {
2550
- children: children
2551
- }));
2552
- };
2553
-
2554
- const TileCurrentUserProvider = ({
2555
- children
2556
- }) => {
2557
- const [currentuserContext, setCurrentUserContext] = React.useState(null);
2558
- React.useEffect(() => {
2559
- CurrentUserRuntime.getCurrentUserContext().catch(() => null).then(setCurrentUserContext);
2560
- }, []);
2561
- if (!currentuserContext) {
2562
- return null;
2563
- }
2564
- return jsx(CurrentUserProvider, Object.assign({
2565
- value: currentuserContext
2566
- }, {
2567
- children: children
2568
- }));
2569
- };
2570
-
2571
- const UserSubscriptionProvider = ({
2572
- children
2573
- }) => {
2574
- const [subscription, setSubscription] = React.useState(null);
2575
- React.useEffect(() => {
2576
- UserSubscriptionRuntime.getUserSubscriptionContext().catch(() => null).then(setSubscription);
2577
- }, []);
2578
- if (!subscription) {
2579
- return null;
2580
- }
2581
- return jsx(UserSubscriptionProvider$1, Object.assign({
2582
- value: subscription
2583
- }, {
2584
- children: children
2585
- }));
2586
- };
2587
-
2588
- const TrackunitDataProviders = ({
2589
- children
2590
- }) => jsx(TileEnvironmentProvider, {
2591
- children: jsx(TileTokenProvider, {
2592
- children: jsx(TileCurrentUserProvider, {
2593
- children: jsx(UserSubscriptionProvider, {
2594
- children: jsx(TileGlobalSelectionProvider, {
2595
- children: jsx(TileAssetSortingProvider, {
2596
- children: jsx(ManagerApolloProvider, {
2597
- children: children
2598
- })
2599
- })
2600
- })
2601
- })
2602
- })
2603
- })
2604
- });
2605
-
2606
- const HostNavigator = ({
2607
- children
2608
- }) => {
2609
- useURLSynchronization();
2610
- // eslint-disable-next-line react/jsx-no-useless-fragment
2611
- return jsx(Fragment, {
2612
- children: children
2613
- });
2614
- };
2615
- const TrackunitRouter = ({
2616
- children
2617
- }) => {
2618
- var _a;
2619
- useEnvironment();
2620
- return jsx(BrowserRouter, Object.assign({
2621
- basename: `${((_a = document.getElementById("baseHref")) === null || _a === void 0 ? void 0 : _a.getAttribute("href")) || "<missing baseHref>"}${global.module}`
2622
- }, {
2623
- children: jsx(HostNavigator, {
2624
- children: children
2625
- })
2626
- }));
2627
- };
2628
-
2629
- const TrackunitProviders = ({
2630
- translations,
2631
- children
2632
- }) => {
2633
- if (translations) {
2634
- registerTranslations(translations); // Register the apps translations if passed.
2635
- }
2636
-
2637
- initializeTranslationsForApp(); // Initialize all registered translations
2638
- return jsx(TrackunitDataProviders, {
2639
- children: jsx(ToastProviderApp, {
2640
- children: jsx(React.Suspense, Object.assign({
2641
- fallback: jsx(Spinner, {
2642
- centered: true
2643
- })
2644
- }, {
2645
- children: jsx(TrackunitRouter, {
2646
- children: children
2647
- })
2648
- }))
2649
- })
2650
- });
138
+ */
139
+ const useSubscribeToHostChanges = (methods) => {
140
+ useEffect(() => {
141
+ const connection = setupHostConnector(methods);
142
+ return () => {
143
+ connection.destroy();
144
+ };
145
+ }, [methods]);
146
+ };
147
+
148
+ const TileAssetSortingProvider = ({ children }) => {
149
+ const [assetSortingState, setAssetSortingState] = useState(null);
150
+ useEffect(() => {
151
+ AssetSortingRuntime.getAssetSortingState()
152
+ .catch(() => null)
153
+ .then(setAssetSortingState);
154
+ }, []);
155
+ const methods = useMemo(() => ({
156
+ onAssetSortingStateChanged: setAssetSortingState,
157
+ }), [setAssetSortingState]);
158
+ useSubscribeToHostChanges(methods);
159
+ const contextValue = useMemo(() => ({
160
+ sortingState: assetSortingState,
161
+ setSortBy: AssetSortingRuntime.setAssetSortingState,
162
+ }), [assetSortingState]);
163
+ if (!assetSortingState) {
164
+ return null;
165
+ }
166
+ return jsx(AssetSortingProvider, Object.assign({ value: contextValue }, { children: children }));
167
+ };
168
+
169
+ const TileEnvironmentProvider = ({ children }) => {
170
+ const [environment, setEnvironment] = React.useState(null);
171
+ React.useEffect(() => {
172
+ const updateEnv = () => __awaiter(void 0, void 0, void 0, function* () {
173
+ try {
174
+ setEnvironment(yield EnvironmentRuntime.getEnvironmentContext());
175
+ }
176
+ catch (error) {
177
+ setEnvironment(null);
178
+ // eslint-disable-next-line no-console
179
+ console.error("Could not load environment!");
180
+ }
181
+ });
182
+ updateEnv();
183
+ }, []);
184
+ if (!environment) {
185
+ return null;
186
+ }
187
+ return jsx(EnvironmentContextProvider, Object.assign({ value: environment }, { children: children }));
188
+ };
189
+
190
+ const TileGlobalSelectionProvider = ({ children }) => {
191
+ const [GlobalSelectionContext, setGlobalSelectionContext] = useState(null);
192
+ useEffect(() => {
193
+ GlobalSelectionRuntime.getGlobalSelection()
194
+ .catch(() => null)
195
+ .then(setGlobalSelectionContext);
196
+ }, []);
197
+ const methods = useMemo(() => ({
198
+ onGlobalSelectionChanged: setGlobalSelectionContext,
199
+ }), [setGlobalSelectionContext]);
200
+ useSubscribeToHostChanges(methods);
201
+ if (!GlobalSelectionContext) {
202
+ return null;
203
+ }
204
+ return jsx(GlobalSelectionProvider, Object.assign({ value: GlobalSelectionContext }, { children: children }));
205
+ };
206
+
207
+ const TileTokenProvider = ({ children }) => {
208
+ const [tokenContext, setTokenContext] = React.useState(null);
209
+ React.useEffect(() => {
210
+ const updateContext = () => __awaiter(void 0, void 0, void 0, function* () {
211
+ try {
212
+ setTokenContext(yield TokenRuntime.getTokenContext());
213
+ }
214
+ catch (error) {
215
+ setTokenContext(null);
216
+ }
217
+ });
218
+ updateContext();
219
+ }, []);
220
+ const methods = React.useMemo(() => ({
221
+ onTokenChanged: setTokenContext,
222
+ }), [setTokenContext]);
223
+ useSubscribeToHostChanges(methods);
224
+ if (!tokenContext) {
225
+ return null;
226
+ }
227
+ return jsx(TokenProvider, Object.assign({ value: tokenContext }, { children: children }));
228
+ };
229
+
230
+ const TileCurrentUserProvider = ({ children }) => {
231
+ const [currentuserContext, setCurrentUserContext] = React.useState(null);
232
+ React.useEffect(() => {
233
+ CurrentUserRuntime.getCurrentUserContext()
234
+ .catch(() => null)
235
+ .then(setCurrentUserContext);
236
+ }, []);
237
+ if (!currentuserContext) {
238
+ return null;
239
+ }
240
+ return jsx(CurrentUserProvider, Object.assign({ value: currentuserContext }, { children: children }));
241
+ };
242
+
243
+ const UserSubscriptionProvider = ({ children }) => {
244
+ const [subscription, setSubscription] = React.useState(null);
245
+ React.useEffect(() => {
246
+ UserSubscriptionRuntime.getUserSubscriptionContext()
247
+ .catch(() => null)
248
+ .then(setSubscription);
249
+ }, []);
250
+ if (!subscription) {
251
+ return null;
252
+ }
253
+ return jsx(UserSubscriptionProvider$1, Object.assign({ value: subscription }, { children: children }));
254
+ };
255
+
256
+ const TrackunitDataProviders = ({ children }) => (jsx(TileEnvironmentProvider, { children: jsx(TileTokenProvider, { children: jsx(TileCurrentUserProvider, { children: jsx(UserSubscriptionProvider, { children: jsx(TileGlobalSelectionProvider, { children: jsx(TileAssetSortingProvider, { children: jsx(ManagerApolloProvider, { children: children }) }) }) }) }) }) }));
257
+
258
+ const HostNavigator = ({ children }) => {
259
+ useURLSynchronization();
260
+ // eslint-disable-next-line react/jsx-no-useless-fragment
261
+ return jsx(Fragment, { children: children });
262
+ };
263
+ const TrackunitRouter = ({ children }) => {
264
+ var _a;
265
+ useEnvironment();
266
+ return (jsx(BrowserRouter, Object.assign({ basename: `${((_a = document.getElementById("baseHref")) === null || _a === void 0 ? void 0 : _a.getAttribute("href")) || "<missing baseHref>"}${global.module}` }, { children: jsx(HostNavigator, { children: children }) })));
267
+ };
268
+
269
+ const TrackunitProviders = ({ translations, children }) => {
270
+ if (translations) {
271
+ registerTranslations(translations); // Register the apps translations if passed.
272
+ }
273
+ initializeTranslationsForApp(); // Initialize all registered translations
274
+ return (jsx(TrackunitDataProviders, { children: jsx(ToastProviderApp, { children: jsx(React.Suspense, Object.assign({ fallback: jsx(Spinner, { centered: true }) }, { children: jsx(TrackunitRouter, { children: children }) })) }) }));
2651
275
  };
2652
276
 
2653
277
  export { ManagerApolloProvider, ToastProviderApp, TrackunitProviders };