@trackunit/react-core-contexts-test 0.0.1-alpha-afcc978985.0

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/index2.js ADDED
@@ -0,0 +1,2676 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { act, render } from '@testing-library/react';
3
+ import { UserSubscriptionPackageType } from '@trackunit/react-core-contexts-api';
4
+ import { EnvironmentContextProvider, CurrentUserProvider, UserSubscriptionProvider, TokenProvider, ToastProvider } from '@trackunit/react-core-hooks';
5
+ import { tw } from '@trackunit/tailwind-styled-components';
6
+ import { MemoryRouter } from 'react-router-dom';
7
+ import { ApolloLink } from '@apollo/client';
8
+ import { onError } from '@apollo/client/link/error';
9
+ import { MockLink, MockedProvider } from '@apollo/client/testing';
10
+ import { GraphQLError } from 'graphql';
11
+
12
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
13
+
14
+ var check = function (it) {
15
+ return it && it.Math == Math && it;
16
+ };
17
+
18
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
19
+ var global$i =
20
+ // eslint-disable-next-line es/no-global-this -- safe
21
+ check(typeof globalThis == 'object' && globalThis) ||
22
+ check(typeof window == 'object' && window) ||
23
+ // eslint-disable-next-line no-restricted-globals -- safe
24
+ check(typeof self == 'object' && self) ||
25
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
26
+ // eslint-disable-next-line no-new-func -- fallback
27
+ (function () { return this; })() || Function('return this')();
28
+
29
+ var objectGetOwnPropertyDescriptor = {};
30
+
31
+ var fails$b = function (exec) {
32
+ try {
33
+ return !!exec();
34
+ } catch (error) {
35
+ return true;
36
+ }
37
+ };
38
+
39
+ var fails$a = fails$b;
40
+
41
+ // Detect IE8's incomplete defineProperty implementation
42
+ var descriptors = !fails$a(function () {
43
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
44
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
45
+ });
46
+
47
+ var fails$9 = fails$b;
48
+
49
+ var functionBindNative = !fails$9(function () {
50
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
51
+ var test = (function () { /* empty */ }).bind();
52
+ // eslint-disable-next-line no-prototype-builtins -- safe
53
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
54
+ });
55
+
56
+ var NATIVE_BIND$3 = functionBindNative;
57
+
58
+ var call$d = Function.prototype.call;
59
+
60
+ var functionCall = NATIVE_BIND$3 ? call$d.bind(call$d) : function () {
61
+ return call$d.apply(call$d, arguments);
62
+ };
63
+
64
+ var objectPropertyIsEnumerable = {};
65
+
66
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
67
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
68
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
69
+
70
+ // Nashorn ~ JDK8 bug
71
+ var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
72
+
73
+ // `Object.prototype.propertyIsEnumerable` method implementation
74
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
75
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
76
+ var descriptor = getOwnPropertyDescriptor$2(this, V);
77
+ return !!descriptor && descriptor.enumerable;
78
+ } : $propertyIsEnumerable;
79
+
80
+ var createPropertyDescriptor$2 = function (bitmap, value) {
81
+ return {
82
+ enumerable: !(bitmap & 1),
83
+ configurable: !(bitmap & 2),
84
+ writable: !(bitmap & 4),
85
+ value: value
86
+ };
87
+ };
88
+
89
+ var NATIVE_BIND$2 = functionBindNative;
90
+
91
+ var FunctionPrototype$2 = Function.prototype;
92
+ var call$c = FunctionPrototype$2.call;
93
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$c, call$c);
94
+
95
+ var functionUncurryThisRaw = function (fn) {
96
+ return NATIVE_BIND$2 ? uncurryThisWithBind(fn) : function () {
97
+ return call$c.apply(fn, arguments);
98
+ };
99
+ };
100
+
101
+ var uncurryThisRaw$1 = functionUncurryThisRaw;
102
+
103
+ var toString$1 = uncurryThisRaw$1({}.toString);
104
+ var stringSlice = uncurryThisRaw$1(''.slice);
105
+
106
+ var classofRaw$2 = function (it) {
107
+ return stringSlice(toString$1(it), 8, -1);
108
+ };
109
+
110
+ var classofRaw$1 = classofRaw$2;
111
+ var uncurryThisRaw = functionUncurryThisRaw;
112
+
113
+ var functionUncurryThis = function (fn) {
114
+ // Nashorn bug:
115
+ // https://github.com/zloirock/core-js/issues/1128
116
+ // https://github.com/zloirock/core-js/issues/1130
117
+ if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
118
+ };
119
+
120
+ var uncurryThis$b = functionUncurryThis;
121
+ var fails$8 = fails$b;
122
+ var classof$4 = classofRaw$2;
123
+
124
+ var $Object$3 = Object;
125
+ var split = uncurryThis$b(''.split);
126
+
127
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
128
+ var indexedObject = fails$8(function () {
129
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
130
+ // eslint-disable-next-line no-prototype-builtins -- safe
131
+ return !$Object$3('z').propertyIsEnumerable(0);
132
+ }) ? function (it) {
133
+ return classof$4(it) == 'String' ? split(it, '') : $Object$3(it);
134
+ } : $Object$3;
135
+
136
+ // we can't use just `it == null` since of `document.all` special case
137
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
138
+ var isNullOrUndefined$4 = function (it) {
139
+ return it === null || it === undefined;
140
+ };
141
+
142
+ var isNullOrUndefined$3 = isNullOrUndefined$4;
143
+
144
+ var $TypeError$c = TypeError;
145
+
146
+ // `RequireObjectCoercible` abstract operation
147
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
148
+ var requireObjectCoercible$2 = function (it) {
149
+ if (isNullOrUndefined$3(it)) throw $TypeError$c("Can't call method on " + it);
150
+ return it;
151
+ };
152
+
153
+ // toObject with fallback for non-array-like ES3 strings
154
+ var IndexedObject$1 = indexedObject;
155
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
156
+
157
+ var toIndexedObject$3 = function (it) {
158
+ return IndexedObject$1(requireObjectCoercible$1(it));
159
+ };
160
+
161
+ var documentAll$2 = typeof document == 'object' && document.all;
162
+
163
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
164
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
165
+
166
+ var documentAll_1 = {
167
+ all: documentAll$2,
168
+ IS_HTMLDDA: IS_HTMLDDA
169
+ };
170
+
171
+ var $documentAll$1 = documentAll_1;
172
+
173
+ var documentAll$1 = $documentAll$1.all;
174
+
175
+ // `IsCallable` abstract operation
176
+ // https://tc39.es/ecma262/#sec-iscallable
177
+ var isCallable$h = $documentAll$1.IS_HTMLDDA ? function (argument) {
178
+ return typeof argument == 'function' || argument === documentAll$1;
179
+ } : function (argument) {
180
+ return typeof argument == 'function';
181
+ };
182
+
183
+ var isCallable$g = isCallable$h;
184
+ var $documentAll = documentAll_1;
185
+
186
+ var documentAll = $documentAll.all;
187
+
188
+ var isObject$7 = $documentAll.IS_HTMLDDA ? function (it) {
189
+ return typeof it == 'object' ? it !== null : isCallable$g(it) || it === documentAll;
190
+ } : function (it) {
191
+ return typeof it == 'object' ? it !== null : isCallable$g(it);
192
+ };
193
+
194
+ var global$h = global$i;
195
+ var isCallable$f = isCallable$h;
196
+
197
+ var aFunction = function (argument) {
198
+ return isCallable$f(argument) ? argument : undefined;
199
+ };
200
+
201
+ var getBuiltIn$8 = function (namespace, method) {
202
+ return arguments.length < 2 ? aFunction(global$h[namespace]) : global$h[namespace] && global$h[namespace][method];
203
+ };
204
+
205
+ var uncurryThis$a = functionUncurryThis;
206
+
207
+ var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf);
208
+
209
+ var getBuiltIn$7 = getBuiltIn$8;
210
+
211
+ var engineUserAgent = getBuiltIn$7('navigator', 'userAgent') || '';
212
+
213
+ var global$g = global$i;
214
+ var userAgent$3 = engineUserAgent;
215
+
216
+ var process$4 = global$g.process;
217
+ var Deno$1 = global$g.Deno;
218
+ var versions = process$4 && process$4.versions || Deno$1 && Deno$1.version;
219
+ var v8 = versions && versions.v8;
220
+ var match, version;
221
+
222
+ if (v8) {
223
+ match = v8.split('.');
224
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
225
+ // but their correct versions are not interesting for us
226
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
227
+ }
228
+
229
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
230
+ // so check `userAgent` even if `.v8` exists, but 0
231
+ if (!version && userAgent$3) {
232
+ match = userAgent$3.match(/Edge\/(\d+)/);
233
+ if (!match || match[1] >= 74) {
234
+ match = userAgent$3.match(/Chrome\/(\d+)/);
235
+ if (match) version = +match[1];
236
+ }
237
+ }
238
+
239
+ var engineV8Version = version;
240
+
241
+ /* eslint-disable es/no-symbol -- required for testing */
242
+
243
+ var V8_VERSION$1 = engineV8Version;
244
+ var fails$7 = fails$b;
245
+
246
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
247
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$7(function () {
248
+ var symbol = Symbol();
249
+ // Chrome 38 Symbol has incorrect toString conversion
250
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
251
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
252
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
253
+ !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
254
+ });
255
+
256
+ /* eslint-disable es/no-symbol -- required for testing */
257
+
258
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
259
+
260
+ var useSymbolAsUid = NATIVE_SYMBOL$1
261
+ && !Symbol.sham
262
+ && typeof Symbol.iterator == 'symbol';
263
+
264
+ var getBuiltIn$6 = getBuiltIn$8;
265
+ var isCallable$e = isCallable$h;
266
+ var isPrototypeOf$2 = objectIsPrototypeOf;
267
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
268
+
269
+ var $Object$2 = Object;
270
+
271
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
272
+ return typeof it == 'symbol';
273
+ } : function (it) {
274
+ var $Symbol = getBuiltIn$6('Symbol');
275
+ return isCallable$e($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$2(it));
276
+ };
277
+
278
+ var $String$2 = String;
279
+
280
+ var tryToString$4 = function (argument) {
281
+ try {
282
+ return $String$2(argument);
283
+ } catch (error) {
284
+ return 'Object';
285
+ }
286
+ };
287
+
288
+ var isCallable$d = isCallable$h;
289
+ var tryToString$3 = tryToString$4;
290
+
291
+ var $TypeError$b = TypeError;
292
+
293
+ // `Assert: IsCallable(argument) is true`
294
+ var aCallable$7 = function (argument) {
295
+ if (isCallable$d(argument)) return argument;
296
+ throw $TypeError$b(tryToString$3(argument) + ' is not a function');
297
+ };
298
+
299
+ var aCallable$6 = aCallable$7;
300
+ var isNullOrUndefined$2 = isNullOrUndefined$4;
301
+
302
+ // `GetMethod` abstract operation
303
+ // https://tc39.es/ecma262/#sec-getmethod
304
+ var getMethod$3 = function (V, P) {
305
+ var func = V[P];
306
+ return isNullOrUndefined$2(func) ? undefined : aCallable$6(func);
307
+ };
308
+
309
+ var call$b = functionCall;
310
+ var isCallable$c = isCallable$h;
311
+ var isObject$6 = isObject$7;
312
+
313
+ var $TypeError$a = TypeError;
314
+
315
+ // `OrdinaryToPrimitive` abstract operation
316
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
317
+ var ordinaryToPrimitive$1 = function (input, pref) {
318
+ var fn, val;
319
+ if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$6(val = call$b(fn, input))) return val;
320
+ if (isCallable$c(fn = input.valueOf) && !isObject$6(val = call$b(fn, input))) return val;
321
+ if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$6(val = call$b(fn, input))) return val;
322
+ throw $TypeError$a("Can't convert object to primitive value");
323
+ };
324
+
325
+ var shared$3 = {exports: {}};
326
+
327
+ var global$f = global$i;
328
+
329
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
330
+ var defineProperty$3 = Object.defineProperty;
331
+
332
+ var defineGlobalProperty$3 = function (key, value) {
333
+ try {
334
+ defineProperty$3(global$f, key, { value: value, configurable: true, writable: true });
335
+ } catch (error) {
336
+ global$f[key] = value;
337
+ } return value;
338
+ };
339
+
340
+ var global$e = global$i;
341
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
342
+
343
+ var SHARED = '__core-js_shared__';
344
+ var store$3 = global$e[SHARED] || defineGlobalProperty$2(SHARED, {});
345
+
346
+ var sharedStore = store$3;
347
+
348
+ var store$2 = sharedStore;
349
+
350
+ (shared$3.exports = function (key, value) {
351
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
352
+ })('versions', []).push({
353
+ version: '3.25.5',
354
+ mode: 'global',
355
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
356
+ license: 'https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE',
357
+ source: 'https://github.com/zloirock/core-js'
358
+ });
359
+
360
+ var requireObjectCoercible = requireObjectCoercible$2;
361
+
362
+ var $Object$1 = Object;
363
+
364
+ // `ToObject` abstract operation
365
+ // https://tc39.es/ecma262/#sec-toobject
366
+ var toObject$2 = function (argument) {
367
+ return $Object$1(requireObjectCoercible(argument));
368
+ };
369
+
370
+ var uncurryThis$9 = functionUncurryThis;
371
+ var toObject$1 = toObject$2;
372
+
373
+ var hasOwnProperty = uncurryThis$9({}.hasOwnProperty);
374
+
375
+ // `HasOwnProperty` abstract operation
376
+ // https://tc39.es/ecma262/#sec-hasownproperty
377
+ // eslint-disable-next-line es/no-object-hasown -- safe
378
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
379
+ return hasOwnProperty(toObject$1(it), key);
380
+ };
381
+
382
+ var uncurryThis$8 = functionUncurryThis;
383
+
384
+ var id = 0;
385
+ var postfix = Math.random();
386
+ var toString = uncurryThis$8(1.0.toString);
387
+
388
+ var uid$2 = function (key) {
389
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
390
+ };
391
+
392
+ var global$d = global$i;
393
+ var shared$2 = shared$3.exports;
394
+ var hasOwn$8 = hasOwnProperty_1;
395
+ var uid$1 = uid$2;
396
+ var NATIVE_SYMBOL = symbolConstructorDetection;
397
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
398
+
399
+ var WellKnownSymbolsStore = shared$2('wks');
400
+ var Symbol$1 = global$d.Symbol;
401
+ var symbolFor = Symbol$1 && Symbol$1['for'];
402
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
403
+
404
+ var wellKnownSymbol$a = function (name) {
405
+ if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
406
+ var description = 'Symbol.' + name;
407
+ if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
408
+ WellKnownSymbolsStore[name] = Symbol$1[name];
409
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
410
+ WellKnownSymbolsStore[name] = symbolFor(description);
411
+ } else {
412
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
413
+ }
414
+ } return WellKnownSymbolsStore[name];
415
+ };
416
+
417
+ var call$a = functionCall;
418
+ var isObject$5 = isObject$7;
419
+ var isSymbol$1 = isSymbol$2;
420
+ var getMethod$2 = getMethod$3;
421
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
422
+ var wellKnownSymbol$9 = wellKnownSymbol$a;
423
+
424
+ var $TypeError$9 = TypeError;
425
+ var TO_PRIMITIVE = wellKnownSymbol$9('toPrimitive');
426
+
427
+ // `ToPrimitive` abstract operation
428
+ // https://tc39.es/ecma262/#sec-toprimitive
429
+ var toPrimitive$1 = function (input, pref) {
430
+ if (!isObject$5(input) || isSymbol$1(input)) return input;
431
+ var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
432
+ var result;
433
+ if (exoticToPrim) {
434
+ if (pref === undefined) pref = 'default';
435
+ result = call$a(exoticToPrim, input, pref);
436
+ if (!isObject$5(result) || isSymbol$1(result)) return result;
437
+ throw $TypeError$9("Can't convert object to primitive value");
438
+ }
439
+ if (pref === undefined) pref = 'number';
440
+ return ordinaryToPrimitive(input, pref);
441
+ };
442
+
443
+ var toPrimitive = toPrimitive$1;
444
+ var isSymbol = isSymbol$2;
445
+
446
+ // `ToPropertyKey` abstract operation
447
+ // https://tc39.es/ecma262/#sec-topropertykey
448
+ var toPropertyKey$2 = function (argument) {
449
+ var key = toPrimitive(argument, 'string');
450
+ return isSymbol(key) ? key : key + '';
451
+ };
452
+
453
+ var global$c = global$i;
454
+ var isObject$4 = isObject$7;
455
+
456
+ var document$3 = global$c.document;
457
+ // typeof document.createElement is 'object' in old IE
458
+ var EXISTS$1 = isObject$4(document$3) && isObject$4(document$3.createElement);
459
+
460
+ var documentCreateElement = function (it) {
461
+ return EXISTS$1 ? document$3.createElement(it) : {};
462
+ };
463
+
464
+ var DESCRIPTORS$8 = descriptors;
465
+ var fails$6 = fails$b;
466
+ var createElement$1 = documentCreateElement;
467
+
468
+ // Thanks to IE8 for its funny defineProperty
469
+ var ie8DomDefine = !DESCRIPTORS$8 && !fails$6(function () {
470
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
471
+ return Object.defineProperty(createElement$1('div'), 'a', {
472
+ get: function () { return 7; }
473
+ }).a != 7;
474
+ });
475
+
476
+ var DESCRIPTORS$7 = descriptors;
477
+ var call$9 = functionCall;
478
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
479
+ var createPropertyDescriptor$1 = createPropertyDescriptor$2;
480
+ var toIndexedObject$2 = toIndexedObject$3;
481
+ var toPropertyKey$1 = toPropertyKey$2;
482
+ var hasOwn$7 = hasOwnProperty_1;
483
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
484
+
485
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
486
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
487
+
488
+ // `Object.getOwnPropertyDescriptor` method
489
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
490
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$7 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
491
+ O = toIndexedObject$2(O);
492
+ P = toPropertyKey$1(P);
493
+ if (IE8_DOM_DEFINE$1) try {
494
+ return $getOwnPropertyDescriptor$1(O, P);
495
+ } catch (error) { /* empty */ }
496
+ if (hasOwn$7(O, P)) return createPropertyDescriptor$1(!call$9(propertyIsEnumerableModule$1.f, O, P), O[P]);
497
+ };
498
+
499
+ var objectDefineProperty = {};
500
+
501
+ var DESCRIPTORS$6 = descriptors;
502
+ var fails$5 = fails$b;
503
+
504
+ // V8 ~ Chrome 36-
505
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
506
+ var v8PrototypeDefineBug = DESCRIPTORS$6 && fails$5(function () {
507
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
508
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
509
+ value: 42,
510
+ writable: false
511
+ }).prototype != 42;
512
+ });
513
+
514
+ var isObject$3 = isObject$7;
515
+
516
+ var $String$1 = String;
517
+ var $TypeError$8 = TypeError;
518
+
519
+ // `Assert: Type(argument) is Object`
520
+ var anObject$8 = function (argument) {
521
+ if (isObject$3(argument)) return argument;
522
+ throw $TypeError$8($String$1(argument) + ' is not an object');
523
+ };
524
+
525
+ var DESCRIPTORS$5 = descriptors;
526
+ var IE8_DOM_DEFINE = ie8DomDefine;
527
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
528
+ var anObject$7 = anObject$8;
529
+ var toPropertyKey = toPropertyKey$2;
530
+
531
+ var $TypeError$7 = TypeError;
532
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
533
+ var $defineProperty = Object.defineProperty;
534
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
535
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
536
+ var ENUMERABLE = 'enumerable';
537
+ var CONFIGURABLE$1 = 'configurable';
538
+ var WRITABLE = 'writable';
539
+
540
+ // `Object.defineProperty` method
541
+ // https://tc39.es/ecma262/#sec-object.defineproperty
542
+ objectDefineProperty.f = DESCRIPTORS$5 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
543
+ anObject$7(O);
544
+ P = toPropertyKey(P);
545
+ anObject$7(Attributes);
546
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
547
+ var current = $getOwnPropertyDescriptor(O, P);
548
+ if (current && current[WRITABLE]) {
549
+ O[P] = Attributes.value;
550
+ Attributes = {
551
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
552
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
553
+ writable: false
554
+ };
555
+ }
556
+ } return $defineProperty(O, P, Attributes);
557
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
558
+ anObject$7(O);
559
+ P = toPropertyKey(P);
560
+ anObject$7(Attributes);
561
+ if (IE8_DOM_DEFINE) try {
562
+ return $defineProperty(O, P, Attributes);
563
+ } catch (error) { /* empty */ }
564
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$7('Accessors not supported');
565
+ if ('value' in Attributes) O[P] = Attributes.value;
566
+ return O;
567
+ };
568
+
569
+ var DESCRIPTORS$4 = descriptors;
570
+ var definePropertyModule$3 = objectDefineProperty;
571
+ var createPropertyDescriptor = createPropertyDescriptor$2;
572
+
573
+ var createNonEnumerableProperty$2 = DESCRIPTORS$4 ? function (object, key, value) {
574
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor(1, value));
575
+ } : function (object, key, value) {
576
+ object[key] = value;
577
+ return object;
578
+ };
579
+
580
+ var makeBuiltIn$2 = {exports: {}};
581
+
582
+ var DESCRIPTORS$3 = descriptors;
583
+ var hasOwn$6 = hasOwnProperty_1;
584
+
585
+ var FunctionPrototype$1 = Function.prototype;
586
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
587
+ var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
588
+
589
+ var EXISTS = hasOwn$6(FunctionPrototype$1, 'name');
590
+ // additional protection from minified / mangled / dropped function names
591
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
592
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype$1, 'name').configurable));
593
+
594
+ var functionName = {
595
+ EXISTS: EXISTS,
596
+ PROPER: PROPER,
597
+ CONFIGURABLE: CONFIGURABLE
598
+ };
599
+
600
+ var uncurryThis$7 = functionUncurryThis;
601
+ var isCallable$b = isCallable$h;
602
+ var store$1 = sharedStore;
603
+
604
+ var functionToString = uncurryThis$7(Function.toString);
605
+
606
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
607
+ if (!isCallable$b(store$1.inspectSource)) {
608
+ store$1.inspectSource = function (it) {
609
+ return functionToString(it);
610
+ };
611
+ }
612
+
613
+ var inspectSource$3 = store$1.inspectSource;
614
+
615
+ var global$b = global$i;
616
+ var isCallable$a = isCallable$h;
617
+
618
+ var WeakMap$1 = global$b.WeakMap;
619
+
620
+ var weakMapBasicDetection = isCallable$a(WeakMap$1) && /native code/.test(String(WeakMap$1));
621
+
622
+ var shared$1 = shared$3.exports;
623
+ var uid = uid$2;
624
+
625
+ var keys = shared$1('keys');
626
+
627
+ var sharedKey$1 = function (key) {
628
+ return keys[key] || (keys[key] = uid(key));
629
+ };
630
+
631
+ var hiddenKeys$3 = {};
632
+
633
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
634
+ var global$a = global$i;
635
+ var isObject$2 = isObject$7;
636
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
637
+ var hasOwn$5 = hasOwnProperty_1;
638
+ var shared = sharedStore;
639
+ var sharedKey = sharedKey$1;
640
+ var hiddenKeys$2 = hiddenKeys$3;
641
+
642
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
643
+ var TypeError$2 = global$a.TypeError;
644
+ var WeakMap = global$a.WeakMap;
645
+ var set$1, get, has;
646
+
647
+ var enforce = function (it) {
648
+ return has(it) ? get(it) : set$1(it, {});
649
+ };
650
+
651
+ var getterFor = function (TYPE) {
652
+ return function (it) {
653
+ var state;
654
+ if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
655
+ throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
656
+ } return state;
657
+ };
658
+ };
659
+
660
+ if (NATIVE_WEAK_MAP || shared.state) {
661
+ var store = shared.state || (shared.state = new WeakMap());
662
+ /* eslint-disable no-self-assign -- prototype methods protection */
663
+ store.get = store.get;
664
+ store.has = store.has;
665
+ store.set = store.set;
666
+ /* eslint-enable no-self-assign -- prototype methods protection */
667
+ set$1 = function (it, metadata) {
668
+ if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
669
+ metadata.facade = it;
670
+ store.set(it, metadata);
671
+ return metadata;
672
+ };
673
+ get = function (it) {
674
+ return store.get(it) || {};
675
+ };
676
+ has = function (it) {
677
+ return store.has(it);
678
+ };
679
+ } else {
680
+ var STATE = sharedKey('state');
681
+ hiddenKeys$2[STATE] = true;
682
+ set$1 = function (it, metadata) {
683
+ if (hasOwn$5(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
684
+ metadata.facade = it;
685
+ createNonEnumerableProperty$1(it, STATE, metadata);
686
+ return metadata;
687
+ };
688
+ get = function (it) {
689
+ return hasOwn$5(it, STATE) ? it[STATE] : {};
690
+ };
691
+ has = function (it) {
692
+ return hasOwn$5(it, STATE);
693
+ };
694
+ }
695
+
696
+ var internalState = {
697
+ set: set$1,
698
+ get: get,
699
+ has: has,
700
+ enforce: enforce,
701
+ getterFor: getterFor
702
+ };
703
+
704
+ var fails$4 = fails$b;
705
+ var isCallable$9 = isCallable$h;
706
+ var hasOwn$4 = hasOwnProperty_1;
707
+ var DESCRIPTORS$2 = descriptors;
708
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
709
+ var inspectSource$2 = inspectSource$3;
710
+ var InternalStateModule$1 = internalState;
711
+
712
+ var enforceInternalState = InternalStateModule$1.enforce;
713
+ var getInternalState = InternalStateModule$1.get;
714
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
715
+ var defineProperty$2 = Object.defineProperty;
716
+
717
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$4(function () {
718
+ return defineProperty$2(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
719
+ });
720
+
721
+ var TEMPLATE = String(String).split('String');
722
+
723
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
724
+ if (String(name).slice(0, 7) === 'Symbol(') {
725
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
726
+ }
727
+ if (options && options.getter) name = 'get ' + name;
728
+ if (options && options.setter) name = 'set ' + name;
729
+ if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
730
+ if (DESCRIPTORS$2) defineProperty$2(value, 'name', { value: name, configurable: true });
731
+ else value.name = name;
732
+ }
733
+ if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
734
+ defineProperty$2(value, 'length', { value: options.arity });
735
+ }
736
+ try {
737
+ if (options && hasOwn$4(options, 'constructor') && options.constructor) {
738
+ if (DESCRIPTORS$2) defineProperty$2(value, 'prototype', { writable: false });
739
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
740
+ } else if (value.prototype) value.prototype = undefined;
741
+ } catch (error) { /* empty */ }
742
+ var state = enforceInternalState(value);
743
+ if (!hasOwn$4(state, 'source')) {
744
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
745
+ } return value;
746
+ };
747
+
748
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
749
+ // eslint-disable-next-line no-extend-native -- required
750
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
751
+ return isCallable$9(this) && getInternalState(this).source || inspectSource$2(this);
752
+ }, 'toString');
753
+
754
+ var isCallable$8 = isCallable$h;
755
+ var definePropertyModule$2 = objectDefineProperty;
756
+ var makeBuiltIn = makeBuiltIn$2.exports;
757
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
758
+
759
+ var defineBuiltIn$3 = function (O, key, value, options) {
760
+ if (!options) options = {};
761
+ var simple = options.enumerable;
762
+ var name = options.name !== undefined ? options.name : key;
763
+ if (isCallable$8(value)) makeBuiltIn(value, name, options);
764
+ if (options.global) {
765
+ if (simple) O[key] = value;
766
+ else defineGlobalProperty$1(key, value);
767
+ } else {
768
+ try {
769
+ if (!options.unsafe) delete O[key];
770
+ else if (O[key]) simple = true;
771
+ } catch (error) { /* empty */ }
772
+ if (simple) O[key] = value;
773
+ else definePropertyModule$2.f(O, key, {
774
+ value: value,
775
+ enumerable: false,
776
+ configurable: !options.nonConfigurable,
777
+ writable: !options.nonWritable
778
+ });
779
+ } return O;
780
+ };
781
+
782
+ var objectGetOwnPropertyNames = {};
783
+
784
+ var ceil = Math.ceil;
785
+ var floor = Math.floor;
786
+
787
+ // `Math.trunc` method
788
+ // https://tc39.es/ecma262/#sec-math.trunc
789
+ // eslint-disable-next-line es/no-math-trunc -- safe
790
+ var mathTrunc = Math.trunc || function trunc(x) {
791
+ var n = +x;
792
+ return (n > 0 ? floor : ceil)(n);
793
+ };
794
+
795
+ var trunc = mathTrunc;
796
+
797
+ // `ToIntegerOrInfinity` abstract operation
798
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
799
+ var toIntegerOrInfinity$2 = function (argument) {
800
+ var number = +argument;
801
+ // eslint-disable-next-line no-self-compare -- NaN check
802
+ return number !== number || number === 0 ? 0 : trunc(number);
803
+ };
804
+
805
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
806
+
807
+ var max = Math.max;
808
+ var min$1 = Math.min;
809
+
810
+ // Helper for a popular repeating case of the spec:
811
+ // Let integer be ? ToInteger(index).
812
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
813
+ var toAbsoluteIndex$1 = function (index, length) {
814
+ var integer = toIntegerOrInfinity$1(index);
815
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
816
+ };
817
+
818
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
819
+
820
+ var min = Math.min;
821
+
822
+ // `ToLength` abstract operation
823
+ // https://tc39.es/ecma262/#sec-tolength
824
+ var toLength$1 = function (argument) {
825
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
826
+ };
827
+
828
+ var toLength = toLength$1;
829
+
830
+ // `LengthOfArrayLike` abstract operation
831
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
832
+ var lengthOfArrayLike$2 = function (obj) {
833
+ return toLength(obj.length);
834
+ };
835
+
836
+ var toIndexedObject$1 = toIndexedObject$3;
837
+ var toAbsoluteIndex = toAbsoluteIndex$1;
838
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
839
+
840
+ // `Array.prototype.{ indexOf, includes }` methods implementation
841
+ var createMethod = function (IS_INCLUDES) {
842
+ return function ($this, el, fromIndex) {
843
+ var O = toIndexedObject$1($this);
844
+ var length = lengthOfArrayLike$1(O);
845
+ var index = toAbsoluteIndex(fromIndex, length);
846
+ var value;
847
+ // Array#includes uses SameValueZero equality algorithm
848
+ // eslint-disable-next-line no-self-compare -- NaN check
849
+ if (IS_INCLUDES && el != el) while (length > index) {
850
+ value = O[index++];
851
+ // eslint-disable-next-line no-self-compare -- NaN check
852
+ if (value != value) return true;
853
+ // Array#indexOf ignores holes, Array#includes - not
854
+ } else for (;length > index; index++) {
855
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
856
+ } return !IS_INCLUDES && -1;
857
+ };
858
+ };
859
+
860
+ var arrayIncludes = {
861
+ // `Array.prototype.includes` method
862
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
863
+ includes: createMethod(true),
864
+ // `Array.prototype.indexOf` method
865
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
866
+ indexOf: createMethod(false)
867
+ };
868
+
869
+ var uncurryThis$6 = functionUncurryThis;
870
+ var hasOwn$3 = hasOwnProperty_1;
871
+ var toIndexedObject = toIndexedObject$3;
872
+ var indexOf = arrayIncludes.indexOf;
873
+ var hiddenKeys$1 = hiddenKeys$3;
874
+
875
+ var push = uncurryThis$6([].push);
876
+
877
+ var objectKeysInternal = function (object, names) {
878
+ var O = toIndexedObject(object);
879
+ var i = 0;
880
+ var result = [];
881
+ var key;
882
+ for (key in O) !hasOwn$3(hiddenKeys$1, key) && hasOwn$3(O, key) && push(result, key);
883
+ // Don't enum bug & hidden keys
884
+ while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
885
+ ~indexOf(result, key) || push(result, key);
886
+ }
887
+ return result;
888
+ };
889
+
890
+ // IE8- don't enum bug keys
891
+ var enumBugKeys$2 = [
892
+ 'constructor',
893
+ 'hasOwnProperty',
894
+ 'isPrototypeOf',
895
+ 'propertyIsEnumerable',
896
+ 'toLocaleString',
897
+ 'toString',
898
+ 'valueOf'
899
+ ];
900
+
901
+ var internalObjectKeys$1 = objectKeysInternal;
902
+ var enumBugKeys$1 = enumBugKeys$2;
903
+
904
+ var hiddenKeys = enumBugKeys$1.concat('length', 'prototype');
905
+
906
+ // `Object.getOwnPropertyNames` method
907
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
908
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
909
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
910
+ return internalObjectKeys$1(O, hiddenKeys);
911
+ };
912
+
913
+ var objectGetOwnPropertySymbols = {};
914
+
915
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
916
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
917
+
918
+ var getBuiltIn$5 = getBuiltIn$8;
919
+ var uncurryThis$5 = functionUncurryThis;
920
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
921
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
922
+ var anObject$6 = anObject$8;
923
+
924
+ var concat$1 = uncurryThis$5([].concat);
925
+
926
+ // all object keys, includes non-enumerable and symbols
927
+ var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
928
+ var keys = getOwnPropertyNamesModule.f(anObject$6(it));
929
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
930
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
931
+ };
932
+
933
+ var hasOwn$2 = hasOwnProperty_1;
934
+ var ownKeys = ownKeys$1;
935
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
936
+ var definePropertyModule$1 = objectDefineProperty;
937
+
938
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
939
+ var keys = ownKeys(source);
940
+ var defineProperty = definePropertyModule$1.f;
941
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
942
+ for (var i = 0; i < keys.length; i++) {
943
+ var key = keys[i];
944
+ if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
945
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
946
+ }
947
+ }
948
+ };
949
+
950
+ var fails$3 = fails$b;
951
+ var isCallable$7 = isCallable$h;
952
+
953
+ var replacement = /#|\.prototype\./;
954
+
955
+ var isForced$2 = function (feature, detection) {
956
+ var value = data[normalize(feature)];
957
+ return value == POLYFILL ? true
958
+ : value == NATIVE ? false
959
+ : isCallable$7(detection) ? fails$3(detection)
960
+ : !!detection;
961
+ };
962
+
963
+ var normalize = isForced$2.normalize = function (string) {
964
+ return String(string).replace(replacement, '.').toLowerCase();
965
+ };
966
+
967
+ var data = isForced$2.data = {};
968
+ var NATIVE = isForced$2.NATIVE = 'N';
969
+ var POLYFILL = isForced$2.POLYFILL = 'P';
970
+
971
+ var isForced_1 = isForced$2;
972
+
973
+ var global$9 = global$i;
974
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
975
+ var createNonEnumerableProperty = createNonEnumerableProperty$2;
976
+ var defineBuiltIn$2 = defineBuiltIn$3;
977
+ var defineGlobalProperty = defineGlobalProperty$3;
978
+ var copyConstructorProperties = copyConstructorProperties$1;
979
+ var isForced$1 = isForced_1;
980
+
981
+ /*
982
+ options.target - name of the target object
983
+ options.global - target is the global object
984
+ options.stat - export as static methods of target
985
+ options.proto - export as prototype methods of target
986
+ options.real - real prototype method for the `pure` version
987
+ options.forced - export even if the native feature is available
988
+ options.bind - bind methods to the target, required for the `pure` version
989
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
990
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
991
+ options.sham - add a flag to not completely full polyfills
992
+ options.enumerable - export as enumerable property
993
+ options.dontCallGetSet - prevent calling a getter on target
994
+ options.name - the .name of the function if it does not match the key
995
+ */
996
+ var _export = function (options, source) {
997
+ var TARGET = options.target;
998
+ var GLOBAL = options.global;
999
+ var STATIC = options.stat;
1000
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1001
+ if (GLOBAL) {
1002
+ target = global$9;
1003
+ } else if (STATIC) {
1004
+ target = global$9[TARGET] || defineGlobalProperty(TARGET, {});
1005
+ } else {
1006
+ target = (global$9[TARGET] || {}).prototype;
1007
+ }
1008
+ if (target) for (key in source) {
1009
+ sourceProperty = source[key];
1010
+ if (options.dontCallGetSet) {
1011
+ descriptor = getOwnPropertyDescriptor$1(target, key);
1012
+ targetProperty = descriptor && descriptor.value;
1013
+ } else targetProperty = target[key];
1014
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1015
+ // contained in target
1016
+ if (!FORCED && targetProperty !== undefined) {
1017
+ if (typeof sourceProperty == typeof targetProperty) continue;
1018
+ copyConstructorProperties(sourceProperty, targetProperty);
1019
+ }
1020
+ // add a flag to not completely full polyfills
1021
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1022
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
1023
+ }
1024
+ defineBuiltIn$2(target, key, sourceProperty, options);
1025
+ }
1026
+ };
1027
+
1028
+ var classof$3 = classofRaw$2;
1029
+ var global$8 = global$i;
1030
+
1031
+ var engineIsNode = classof$3(global$8.process) == 'process';
1032
+
1033
+ var isCallable$6 = isCallable$h;
1034
+
1035
+ var $String = String;
1036
+ var $TypeError$6 = TypeError;
1037
+
1038
+ var aPossiblePrototype$1 = function (argument) {
1039
+ if (typeof argument == 'object' || isCallable$6(argument)) return argument;
1040
+ throw $TypeError$6("Can't set " + $String(argument) + ' as a prototype');
1041
+ };
1042
+
1043
+ /* eslint-disable no-proto -- safe */
1044
+
1045
+ var uncurryThis$4 = functionUncurryThis;
1046
+ var anObject$5 = anObject$8;
1047
+ var aPossiblePrototype = aPossiblePrototype$1;
1048
+
1049
+ // `Object.setPrototypeOf` method
1050
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1051
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1052
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1053
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1054
+ var CORRECT_SETTER = false;
1055
+ var test = {};
1056
+ var setter;
1057
+ try {
1058
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1059
+ setter = uncurryThis$4(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1060
+ setter(test, []);
1061
+ CORRECT_SETTER = test instanceof Array;
1062
+ } catch (error) { /* empty */ }
1063
+ return function setPrototypeOf(O, proto) {
1064
+ anObject$5(O);
1065
+ aPossiblePrototype(proto);
1066
+ if (CORRECT_SETTER) setter(O, proto);
1067
+ else O.__proto__ = proto;
1068
+ return O;
1069
+ };
1070
+ }() : undefined);
1071
+
1072
+ var defineProperty$1 = objectDefineProperty.f;
1073
+ var hasOwn$1 = hasOwnProperty_1;
1074
+ var wellKnownSymbol$8 = wellKnownSymbol$a;
1075
+
1076
+ var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1077
+
1078
+ var setToStringTag$1 = function (target, TAG, STATIC) {
1079
+ if (target && !STATIC) target = target.prototype;
1080
+ if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
1081
+ defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
1082
+ }
1083
+ };
1084
+
1085
+ var getBuiltIn$4 = getBuiltIn$8;
1086
+ var definePropertyModule = objectDefineProperty;
1087
+ var wellKnownSymbol$7 = wellKnownSymbol$a;
1088
+ var DESCRIPTORS$1 = descriptors;
1089
+
1090
+ var SPECIES$2 = wellKnownSymbol$7('species');
1091
+
1092
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1093
+ var Constructor = getBuiltIn$4(CONSTRUCTOR_NAME);
1094
+ var defineProperty = definePropertyModule.f;
1095
+
1096
+ if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$2]) {
1097
+ defineProperty(Constructor, SPECIES$2, {
1098
+ configurable: true,
1099
+ get: function () { return this; }
1100
+ });
1101
+ }
1102
+ };
1103
+
1104
+ var isPrototypeOf$1 = objectIsPrototypeOf;
1105
+
1106
+ var $TypeError$5 = TypeError;
1107
+
1108
+ var anInstance$1 = function (it, Prototype) {
1109
+ if (isPrototypeOf$1(Prototype, it)) return it;
1110
+ throw $TypeError$5('Incorrect invocation');
1111
+ };
1112
+
1113
+ var wellKnownSymbol$6 = wellKnownSymbol$a;
1114
+
1115
+ var TO_STRING_TAG$1 = wellKnownSymbol$6('toStringTag');
1116
+ var test = {};
1117
+
1118
+ test[TO_STRING_TAG$1] = 'z';
1119
+
1120
+ var toStringTagSupport = String(test) === '[object z]';
1121
+
1122
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1123
+ var isCallable$5 = isCallable$h;
1124
+ var classofRaw = classofRaw$2;
1125
+ var wellKnownSymbol$5 = wellKnownSymbol$a;
1126
+
1127
+ var TO_STRING_TAG = wellKnownSymbol$5('toStringTag');
1128
+ var $Object = Object;
1129
+
1130
+ // ES3 wrong here
1131
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1132
+
1133
+ // fallback for IE11 Script Access Denied error
1134
+ var tryGet = function (it, key) {
1135
+ try {
1136
+ return it[key];
1137
+ } catch (error) { /* empty */ }
1138
+ };
1139
+
1140
+ // getting tag from ES6+ `Object.prototype.toString`
1141
+ var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1142
+ var O, tag, result;
1143
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1144
+ // @@toStringTag case
1145
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1146
+ // builtinTag case
1147
+ : CORRECT_ARGUMENTS ? classofRaw(O)
1148
+ // ES3 arguments fallback
1149
+ : (result = classofRaw(O)) == 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1150
+ };
1151
+
1152
+ var uncurryThis$3 = functionUncurryThis;
1153
+ var fails$2 = fails$b;
1154
+ var isCallable$4 = isCallable$h;
1155
+ var classof$1 = classof$2;
1156
+ var getBuiltIn$3 = getBuiltIn$8;
1157
+ var inspectSource$1 = inspectSource$3;
1158
+
1159
+ var noop = function () { /* empty */ };
1160
+ var empty = [];
1161
+ var construct = getBuiltIn$3('Reflect', 'construct');
1162
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1163
+ var exec = uncurryThis$3(constructorRegExp.exec);
1164
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1165
+
1166
+ var isConstructorModern = function isConstructor(argument) {
1167
+ if (!isCallable$4(argument)) return false;
1168
+ try {
1169
+ construct(noop, empty, argument);
1170
+ return true;
1171
+ } catch (error) {
1172
+ return false;
1173
+ }
1174
+ };
1175
+
1176
+ var isConstructorLegacy = function isConstructor(argument) {
1177
+ if (!isCallable$4(argument)) return false;
1178
+ switch (classof$1(argument)) {
1179
+ case 'AsyncFunction':
1180
+ case 'GeneratorFunction':
1181
+ case 'AsyncGeneratorFunction': return false;
1182
+ }
1183
+ try {
1184
+ // we can't check .prototype since constructors produced by .bind haven't it
1185
+ // `Function#toString` throws on some built-it function in some legacy engines
1186
+ // (for example, `DOMQuad` and similar in FF41-)
1187
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
1188
+ } catch (error) {
1189
+ return true;
1190
+ }
1191
+ };
1192
+
1193
+ isConstructorLegacy.sham = true;
1194
+
1195
+ // `IsConstructor` abstract operation
1196
+ // https://tc39.es/ecma262/#sec-isconstructor
1197
+ var isConstructor$1 = !construct || fails$2(function () {
1198
+ var called;
1199
+ return isConstructorModern(isConstructorModern.call)
1200
+ || !isConstructorModern(Object)
1201
+ || !isConstructorModern(function () { called = true; })
1202
+ || called;
1203
+ }) ? isConstructorLegacy : isConstructorModern;
1204
+
1205
+ var isConstructor = isConstructor$1;
1206
+ var tryToString$2 = tryToString$4;
1207
+
1208
+ var $TypeError$4 = TypeError;
1209
+
1210
+ // `Assert: IsConstructor(argument) is true`
1211
+ var aConstructor$1 = function (argument) {
1212
+ if (isConstructor(argument)) return argument;
1213
+ throw $TypeError$4(tryToString$2(argument) + ' is not a constructor');
1214
+ };
1215
+
1216
+ var anObject$4 = anObject$8;
1217
+ var aConstructor = aConstructor$1;
1218
+ var isNullOrUndefined$1 = isNullOrUndefined$4;
1219
+ var wellKnownSymbol$4 = wellKnownSymbol$a;
1220
+
1221
+ var SPECIES$1 = wellKnownSymbol$4('species');
1222
+
1223
+ // `SpeciesConstructor` abstract operation
1224
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1225
+ var speciesConstructor$1 = function (O, defaultConstructor) {
1226
+ var C = anObject$4(O).constructor;
1227
+ var S;
1228
+ return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
1229
+ };
1230
+
1231
+ var NATIVE_BIND$1 = functionBindNative;
1232
+
1233
+ var FunctionPrototype = Function.prototype;
1234
+ var apply$1 = FunctionPrototype.apply;
1235
+ var call$8 = FunctionPrototype.call;
1236
+
1237
+ // eslint-disable-next-line es/no-reflect -- safe
1238
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$8.bind(apply$1) : function () {
1239
+ return call$8.apply(apply$1, arguments);
1240
+ });
1241
+
1242
+ var uncurryThis$2 = functionUncurryThis;
1243
+ var aCallable$5 = aCallable$7;
1244
+ var NATIVE_BIND = functionBindNative;
1245
+
1246
+ var bind$4 = uncurryThis$2(uncurryThis$2.bind);
1247
+
1248
+ // optional / simple context binding
1249
+ var functionBindContext = function (fn, that) {
1250
+ aCallable$5(fn);
1251
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1252
+ return fn.apply(that, arguments);
1253
+ };
1254
+ };
1255
+
1256
+ var getBuiltIn$2 = getBuiltIn$8;
1257
+
1258
+ var html$1 = getBuiltIn$2('document', 'documentElement');
1259
+
1260
+ var uncurryThis$1 = functionUncurryThis;
1261
+
1262
+ var arraySlice$1 = uncurryThis$1([].slice);
1263
+
1264
+ var $TypeError$3 = TypeError;
1265
+
1266
+ var validateArgumentsLength$1 = function (passed, required) {
1267
+ if (passed < required) throw $TypeError$3('Not enough arguments');
1268
+ return passed;
1269
+ };
1270
+
1271
+ var userAgent$2 = engineUserAgent;
1272
+
1273
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1274
+
1275
+ var global$7 = global$i;
1276
+ var apply = functionApply;
1277
+ var bind$3 = functionBindContext;
1278
+ var isCallable$3 = isCallable$h;
1279
+ var hasOwn = hasOwnProperty_1;
1280
+ var fails$1 = fails$b;
1281
+ var html = html$1;
1282
+ var arraySlice = arraySlice$1;
1283
+ var createElement = documentCreateElement;
1284
+ var validateArgumentsLength = validateArgumentsLength$1;
1285
+ var IS_IOS$1 = engineIsIos;
1286
+ var IS_NODE$3 = engineIsNode;
1287
+
1288
+ var set = global$7.setImmediate;
1289
+ var clear = global$7.clearImmediate;
1290
+ var process$3 = global$7.process;
1291
+ var Dispatch = global$7.Dispatch;
1292
+ var Function$1 = global$7.Function;
1293
+ var MessageChannel = global$7.MessageChannel;
1294
+ var String$1 = global$7.String;
1295
+ var counter = 0;
1296
+ var queue$1 = {};
1297
+ var ONREADYSTATECHANGE = 'onreadystatechange';
1298
+ var $location, defer, channel, port;
1299
+
1300
+ try {
1301
+ // Deno throws a ReferenceError on `location` access without `--location` flag
1302
+ $location = global$7.location;
1303
+ } catch (error) { /* empty */ }
1304
+
1305
+ var run = function (id) {
1306
+ if (hasOwn(queue$1, id)) {
1307
+ var fn = queue$1[id];
1308
+ delete queue$1[id];
1309
+ fn();
1310
+ }
1311
+ };
1312
+
1313
+ var runner = function (id) {
1314
+ return function () {
1315
+ run(id);
1316
+ };
1317
+ };
1318
+
1319
+ var listener = function (event) {
1320
+ run(event.data);
1321
+ };
1322
+
1323
+ var post = function (id) {
1324
+ // old engines have not location.origin
1325
+ global$7.postMessage(String$1(id), $location.protocol + '//' + $location.host);
1326
+ };
1327
+
1328
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1329
+ if (!set || !clear) {
1330
+ set = function setImmediate(handler) {
1331
+ validateArgumentsLength(arguments.length, 1);
1332
+ var fn = isCallable$3(handler) ? handler : Function$1(handler);
1333
+ var args = arraySlice(arguments, 1);
1334
+ queue$1[++counter] = function () {
1335
+ apply(fn, undefined, args);
1336
+ };
1337
+ defer(counter);
1338
+ return counter;
1339
+ };
1340
+ clear = function clearImmediate(id) {
1341
+ delete queue$1[id];
1342
+ };
1343
+ // Node.js 0.8-
1344
+ if (IS_NODE$3) {
1345
+ defer = function (id) {
1346
+ process$3.nextTick(runner(id));
1347
+ };
1348
+ // Sphere (JS game engine) Dispatch API
1349
+ } else if (Dispatch && Dispatch.now) {
1350
+ defer = function (id) {
1351
+ Dispatch.now(runner(id));
1352
+ };
1353
+ // Browsers with MessageChannel, includes WebWorkers
1354
+ // except iOS - https://github.com/zloirock/core-js/issues/624
1355
+ } else if (MessageChannel && !IS_IOS$1) {
1356
+ channel = new MessageChannel();
1357
+ port = channel.port2;
1358
+ channel.port1.onmessage = listener;
1359
+ defer = bind$3(port.postMessage, port);
1360
+ // Browsers with postMessage, skip WebWorkers
1361
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1362
+ } else if (
1363
+ global$7.addEventListener &&
1364
+ isCallable$3(global$7.postMessage) &&
1365
+ !global$7.importScripts &&
1366
+ $location && $location.protocol !== 'file:' &&
1367
+ !fails$1(post)
1368
+ ) {
1369
+ defer = post;
1370
+ global$7.addEventListener('message', listener, false);
1371
+ // IE8-
1372
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
1373
+ defer = function (id) {
1374
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
1375
+ html.removeChild(this);
1376
+ run(id);
1377
+ };
1378
+ };
1379
+ // Rest old browsers
1380
+ } else {
1381
+ defer = function (id) {
1382
+ setTimeout(runner(id), 0);
1383
+ };
1384
+ }
1385
+ }
1386
+
1387
+ var task$1 = {
1388
+ set: set,
1389
+ clear: clear
1390
+ };
1391
+
1392
+ var userAgent$1 = engineUserAgent;
1393
+ var global$6 = global$i;
1394
+
1395
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$6.Pebble !== undefined;
1396
+
1397
+ var userAgent = engineUserAgent;
1398
+
1399
+ var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
1400
+
1401
+ var global$5 = global$i;
1402
+ var bind$2 = functionBindContext;
1403
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1404
+ var macrotask = task$1.set;
1405
+ var IS_IOS = engineIsIos;
1406
+ var IS_IOS_PEBBLE = engineIsIosPebble;
1407
+ var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
1408
+ var IS_NODE$2 = engineIsNode;
1409
+
1410
+ var MutationObserver = global$5.MutationObserver || global$5.WebKitMutationObserver;
1411
+ var document$2 = global$5.document;
1412
+ var process$2 = global$5.process;
1413
+ var Promise$1 = global$5.Promise;
1414
+ // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1415
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$5, 'queueMicrotask');
1416
+ var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1417
+
1418
+ var flush, head, last, notify$1, toggle, node, promise, then;
1419
+
1420
+ // modern engines have queueMicrotask method
1421
+ if (!queueMicrotask) {
1422
+ flush = function () {
1423
+ var parent, fn;
1424
+ if (IS_NODE$2 && (parent = process$2.domain)) parent.exit();
1425
+ while (head) {
1426
+ fn = head.fn;
1427
+ head = head.next;
1428
+ try {
1429
+ fn();
1430
+ } catch (error) {
1431
+ if (head) notify$1();
1432
+ else last = undefined;
1433
+ throw error;
1434
+ }
1435
+ } last = undefined;
1436
+ if (parent) parent.enter();
1437
+ };
1438
+
1439
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1440
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
1441
+ if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
1442
+ toggle = true;
1443
+ node = document$2.createTextNode('');
1444
+ new MutationObserver(flush).observe(node, { characterData: true });
1445
+ notify$1 = function () {
1446
+ node.data = toggle = !toggle;
1447
+ };
1448
+ // environments with maybe non-completely correct, but existent Promise
1449
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
1450
+ // Promise.resolve without an argument throws an error in LG WebOS 2
1451
+ promise = Promise$1.resolve(undefined);
1452
+ // workaround of WebKit ~ iOS Safari 10.1 bug
1453
+ promise.constructor = Promise$1;
1454
+ then = bind$2(promise.then, promise);
1455
+ notify$1 = function () {
1456
+ then(flush);
1457
+ };
1458
+ // Node.js without promises
1459
+ } else if (IS_NODE$2) {
1460
+ notify$1 = function () {
1461
+ process$2.nextTick(flush);
1462
+ };
1463
+ // for other environments - macrotask based on:
1464
+ // - setImmediate
1465
+ // - MessageChannel
1466
+ // - window.postMessage
1467
+ // - onreadystatechange
1468
+ // - setTimeout
1469
+ } else {
1470
+ // strange IE + webpack dev server bug - use .bind(global)
1471
+ macrotask = bind$2(macrotask, global$5);
1472
+ notify$1 = function () {
1473
+ macrotask(flush);
1474
+ };
1475
+ }
1476
+ }
1477
+
1478
+ var microtask$1 = queueMicrotask || function (fn) {
1479
+ var task = { fn: fn, next: undefined };
1480
+ if (last) last.next = task;
1481
+ if (!head) {
1482
+ head = task;
1483
+ notify$1();
1484
+ } last = task;
1485
+ };
1486
+
1487
+ var global$4 = global$i;
1488
+
1489
+ var hostReportErrors$1 = function (a, b) {
1490
+ var console = global$4.console;
1491
+ if (console && console.error) {
1492
+ arguments.length == 1 ? console.error(a) : console.error(a, b);
1493
+ }
1494
+ };
1495
+
1496
+ var perform$3 = function (exec) {
1497
+ try {
1498
+ return { error: false, value: exec() };
1499
+ } catch (error) {
1500
+ return { error: true, value: error };
1501
+ }
1502
+ };
1503
+
1504
+ var Queue$1 = function () {
1505
+ this.head = null;
1506
+ this.tail = null;
1507
+ };
1508
+
1509
+ Queue$1.prototype = {
1510
+ add: function (item) {
1511
+ var entry = { item: item, next: null };
1512
+ if (this.head) this.tail.next = entry;
1513
+ else this.head = entry;
1514
+ this.tail = entry;
1515
+ },
1516
+ get: function () {
1517
+ var entry = this.head;
1518
+ if (entry) {
1519
+ this.head = entry.next;
1520
+ if (this.tail === entry) this.tail = null;
1521
+ return entry.item;
1522
+ }
1523
+ }
1524
+ };
1525
+
1526
+ var queue = Queue$1;
1527
+
1528
+ var global$3 = global$i;
1529
+
1530
+ var promiseNativeConstructor = global$3.Promise;
1531
+
1532
+ /* global Deno -- Deno case */
1533
+
1534
+ var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
1535
+
1536
+ var IS_DENO$1 = engineIsDeno;
1537
+ var IS_NODE$1 = engineIsNode;
1538
+
1539
+ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
1540
+ && typeof window == 'object'
1541
+ && typeof document == 'object';
1542
+
1543
+ var global$2 = global$i;
1544
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
1545
+ var isCallable$2 = isCallable$h;
1546
+ var isForced = isForced_1;
1547
+ var inspectSource = inspectSource$3;
1548
+ var wellKnownSymbol$3 = wellKnownSymbol$a;
1549
+ var IS_BROWSER = engineIsBrowser;
1550
+ var IS_DENO = engineIsDeno;
1551
+ var V8_VERSION = engineV8Version;
1552
+
1553
+ NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
1554
+ var SPECIES = wellKnownSymbol$3('species');
1555
+ var SUBCLASSING = false;
1556
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$2(global$2.PromiseRejectionEvent);
1557
+
1558
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
1559
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
1560
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
1561
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1562
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1563
+ // We can't detect it synchronously, so just check versions
1564
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
1565
+ // We can't use @@species feature detection in V8 since it causes
1566
+ // deoptimization and performance degradation
1567
+ // https://github.com/zloirock/core-js/issues/679
1568
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
1569
+ // Detect correctness of subclassing with @@species support
1570
+ var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
1571
+ var FakePromise = function (exec) {
1572
+ exec(function () { /* empty */ }, function () { /* empty */ });
1573
+ };
1574
+ var constructor = promise.constructor = {};
1575
+ constructor[SPECIES] = FakePromise;
1576
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
1577
+ if (!SUBCLASSING) return true;
1578
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1579
+ } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
1580
+ });
1581
+
1582
+ var promiseConstructorDetection = {
1583
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
1584
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
1585
+ SUBCLASSING: SUBCLASSING
1586
+ };
1587
+
1588
+ var newPromiseCapability$2 = {};
1589
+
1590
+ var aCallable$4 = aCallable$7;
1591
+
1592
+ var $TypeError$2 = TypeError;
1593
+
1594
+ var PromiseCapability = function (C) {
1595
+ var resolve, reject;
1596
+ this.promise = new C(function ($$resolve, $$reject) {
1597
+ if (resolve !== undefined || reject !== undefined) throw $TypeError$2('Bad Promise constructor');
1598
+ resolve = $$resolve;
1599
+ reject = $$reject;
1600
+ });
1601
+ this.resolve = aCallable$4(resolve);
1602
+ this.reject = aCallable$4(reject);
1603
+ };
1604
+
1605
+ // `NewPromiseCapability` abstract operation
1606
+ // https://tc39.es/ecma262/#sec-newpromisecapability
1607
+ newPromiseCapability$2.f = function (C) {
1608
+ return new PromiseCapability(C);
1609
+ };
1610
+
1611
+ var $$6 = _export;
1612
+ var IS_NODE = engineIsNode;
1613
+ var global$1 = global$i;
1614
+ var call$7 = functionCall;
1615
+ var defineBuiltIn$1 = defineBuiltIn$3;
1616
+ var setPrototypeOf = objectSetPrototypeOf;
1617
+ var setToStringTag = setToStringTag$1;
1618
+ var setSpecies = setSpecies$1;
1619
+ var aCallable$3 = aCallable$7;
1620
+ var isCallable$1 = isCallable$h;
1621
+ var isObject$1 = isObject$7;
1622
+ var anInstance = anInstance$1;
1623
+ var speciesConstructor = speciesConstructor$1;
1624
+ var task = task$1.set;
1625
+ var microtask = microtask$1;
1626
+ var hostReportErrors = hostReportErrors$1;
1627
+ var perform$2 = perform$3;
1628
+ var Queue = queue;
1629
+ var InternalStateModule = internalState;
1630
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
1631
+ var PromiseConstructorDetection = promiseConstructorDetection;
1632
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
1633
+
1634
+ var PROMISE = 'Promise';
1635
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
1636
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
1637
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
1638
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
1639
+ var setInternalState = InternalStateModule.set;
1640
+ var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
1641
+ var PromiseConstructor = NativePromiseConstructor$2;
1642
+ var PromisePrototype = NativePromisePrototype$1;
1643
+ var TypeError$1 = global$1.TypeError;
1644
+ var document$1 = global$1.document;
1645
+ var process$1 = global$1.process;
1646
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
1647
+ var newGenericPromiseCapability = newPromiseCapability$1;
1648
+
1649
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
1650
+ var UNHANDLED_REJECTION = 'unhandledrejection';
1651
+ var REJECTION_HANDLED = 'rejectionhandled';
1652
+ var PENDING = 0;
1653
+ var FULFILLED = 1;
1654
+ var REJECTED = 2;
1655
+ var HANDLED = 1;
1656
+ var UNHANDLED = 2;
1657
+
1658
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1659
+
1660
+ // helpers
1661
+ var isThenable = function (it) {
1662
+ var then;
1663
+ return isObject$1(it) && isCallable$1(then = it.then) ? then : false;
1664
+ };
1665
+
1666
+ var callReaction = function (reaction, state) {
1667
+ var value = state.value;
1668
+ var ok = state.state == FULFILLED;
1669
+ var handler = ok ? reaction.ok : reaction.fail;
1670
+ var resolve = reaction.resolve;
1671
+ var reject = reaction.reject;
1672
+ var domain = reaction.domain;
1673
+ var result, then, exited;
1674
+ try {
1675
+ if (handler) {
1676
+ if (!ok) {
1677
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
1678
+ state.rejection = HANDLED;
1679
+ }
1680
+ if (handler === true) result = value;
1681
+ else {
1682
+ if (domain) domain.enter();
1683
+ result = handler(value); // can throw
1684
+ if (domain) {
1685
+ domain.exit();
1686
+ exited = true;
1687
+ }
1688
+ }
1689
+ if (result === reaction.promise) {
1690
+ reject(TypeError$1('Promise-chain cycle'));
1691
+ } else if (then = isThenable(result)) {
1692
+ call$7(then, result, resolve, reject);
1693
+ } else resolve(result);
1694
+ } else reject(value);
1695
+ } catch (error) {
1696
+ if (domain && !exited) domain.exit();
1697
+ reject(error);
1698
+ }
1699
+ };
1700
+
1701
+ var notify = function (state, isReject) {
1702
+ if (state.notified) return;
1703
+ state.notified = true;
1704
+ microtask(function () {
1705
+ var reactions = state.reactions;
1706
+ var reaction;
1707
+ while (reaction = reactions.get()) {
1708
+ callReaction(reaction, state);
1709
+ }
1710
+ state.notified = false;
1711
+ if (isReject && !state.rejection) onUnhandled(state);
1712
+ });
1713
+ };
1714
+
1715
+ var dispatchEvent = function (name, promise, reason) {
1716
+ var event, handler;
1717
+ if (DISPATCH_EVENT) {
1718
+ event = document$1.createEvent('Event');
1719
+ event.promise = promise;
1720
+ event.reason = reason;
1721
+ event.initEvent(name, false, true);
1722
+ global$1.dispatchEvent(event);
1723
+ } else event = { promise: promise, reason: reason };
1724
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$1['on' + name])) handler(event);
1725
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1726
+ };
1727
+
1728
+ var onUnhandled = function (state) {
1729
+ call$7(task, global$1, function () {
1730
+ var promise = state.facade;
1731
+ var value = state.value;
1732
+ var IS_UNHANDLED = isUnhandled(state);
1733
+ var result;
1734
+ if (IS_UNHANDLED) {
1735
+ result = perform$2(function () {
1736
+ if (IS_NODE) {
1737
+ process$1.emit('unhandledRejection', value, promise);
1738
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
1739
+ });
1740
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
1741
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
1742
+ if (result.error) throw result.value;
1743
+ }
1744
+ });
1745
+ };
1746
+
1747
+ var isUnhandled = function (state) {
1748
+ return state.rejection !== HANDLED && !state.parent;
1749
+ };
1750
+
1751
+ var onHandleUnhandled = function (state) {
1752
+ call$7(task, global$1, function () {
1753
+ var promise = state.facade;
1754
+ if (IS_NODE) {
1755
+ process$1.emit('rejectionHandled', promise);
1756
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
1757
+ });
1758
+ };
1759
+
1760
+ var bind$1 = function (fn, state, unwrap) {
1761
+ return function (value) {
1762
+ fn(state, value, unwrap);
1763
+ };
1764
+ };
1765
+
1766
+ var internalReject = function (state, value, unwrap) {
1767
+ if (state.done) return;
1768
+ state.done = true;
1769
+ if (unwrap) state = unwrap;
1770
+ state.value = value;
1771
+ state.state = REJECTED;
1772
+ notify(state, true);
1773
+ };
1774
+
1775
+ var internalResolve = function (state, value, unwrap) {
1776
+ if (state.done) return;
1777
+ state.done = true;
1778
+ if (unwrap) state = unwrap;
1779
+ try {
1780
+ if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
1781
+ var then = isThenable(value);
1782
+ if (then) {
1783
+ microtask(function () {
1784
+ var wrapper = { done: false };
1785
+ try {
1786
+ call$7(then, value,
1787
+ bind$1(internalResolve, wrapper, state),
1788
+ bind$1(internalReject, wrapper, state)
1789
+ );
1790
+ } catch (error) {
1791
+ internalReject(wrapper, error, state);
1792
+ }
1793
+ });
1794
+ } else {
1795
+ state.value = value;
1796
+ state.state = FULFILLED;
1797
+ notify(state, false);
1798
+ }
1799
+ } catch (error) {
1800
+ internalReject({ done: false }, error, state);
1801
+ }
1802
+ };
1803
+
1804
+ // constructor polyfill
1805
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
1806
+ // 25.4.3.1 Promise(executor)
1807
+ PromiseConstructor = function Promise(executor) {
1808
+ anInstance(this, PromisePrototype);
1809
+ aCallable$3(executor);
1810
+ call$7(Internal, this);
1811
+ var state = getInternalPromiseState(this);
1812
+ try {
1813
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
1814
+ } catch (error) {
1815
+ internalReject(state, error);
1816
+ }
1817
+ };
1818
+
1819
+ PromisePrototype = PromiseConstructor.prototype;
1820
+
1821
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
1822
+ Internal = function Promise(executor) {
1823
+ setInternalState(this, {
1824
+ type: PROMISE,
1825
+ done: false,
1826
+ notified: false,
1827
+ parent: false,
1828
+ reactions: new Queue(),
1829
+ rejection: false,
1830
+ state: PENDING,
1831
+ value: undefined
1832
+ });
1833
+ };
1834
+
1835
+ // `Promise.prototype.then` method
1836
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
1837
+ Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
1838
+ var state = getInternalPromiseState(this);
1839
+ var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
1840
+ state.parent = true;
1841
+ reaction.ok = isCallable$1(onFulfilled) ? onFulfilled : true;
1842
+ reaction.fail = isCallable$1(onRejected) && onRejected;
1843
+ reaction.domain = IS_NODE ? process$1.domain : undefined;
1844
+ if (state.state == PENDING) state.reactions.add(reaction);
1845
+ else microtask(function () {
1846
+ callReaction(reaction, state);
1847
+ });
1848
+ return reaction.promise;
1849
+ });
1850
+
1851
+ OwnPromiseCapability = function () {
1852
+ var promise = new Internal();
1853
+ var state = getInternalPromiseState(promise);
1854
+ this.promise = promise;
1855
+ this.resolve = bind$1(internalResolve, state);
1856
+ this.reject = bind$1(internalReject, state);
1857
+ };
1858
+
1859
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
1860
+ return C === PromiseConstructor || C === PromiseWrapper
1861
+ ? new OwnPromiseCapability(C)
1862
+ : newGenericPromiseCapability(C);
1863
+ };
1864
+
1865
+ if (isCallable$1(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
1866
+ nativeThen = NativePromisePrototype$1.then;
1867
+
1868
+ if (!NATIVE_PROMISE_SUBCLASSING) {
1869
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
1870
+ defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
1871
+ var that = this;
1872
+ return new PromiseConstructor(function (resolve, reject) {
1873
+ call$7(nativeThen, that, resolve, reject);
1874
+ }).then(onFulfilled, onRejected);
1875
+ // https://github.com/zloirock/core-js/issues/640
1876
+ }, { unsafe: true });
1877
+ }
1878
+
1879
+ // make `.constructor === Promise` work for native promise-based APIs
1880
+ try {
1881
+ delete NativePromisePrototype$1.constructor;
1882
+ } catch (error) { /* empty */ }
1883
+
1884
+ // make `instanceof Promise` work for native promise-based APIs
1885
+ if (setPrototypeOf) {
1886
+ setPrototypeOf(NativePromisePrototype$1, PromisePrototype);
1887
+ }
1888
+ }
1889
+ }
1890
+
1891
+ $$6({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
1892
+ Promise: PromiseConstructor
1893
+ });
1894
+
1895
+ setToStringTag(PromiseConstructor, PROMISE, false);
1896
+ setSpecies(PROMISE);
1897
+
1898
+ var iterators = {};
1899
+
1900
+ var wellKnownSymbol$2 = wellKnownSymbol$a;
1901
+ var Iterators$1 = iterators;
1902
+
1903
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
1904
+ var ArrayPrototype = Array.prototype;
1905
+
1906
+ // check on default Array iterator
1907
+ var isArrayIteratorMethod$1 = function (it) {
1908
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
1909
+ };
1910
+
1911
+ var classof = classof$2;
1912
+ var getMethod$1 = getMethod$3;
1913
+ var isNullOrUndefined = isNullOrUndefined$4;
1914
+ var Iterators = iterators;
1915
+ var wellKnownSymbol$1 = wellKnownSymbol$a;
1916
+
1917
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
1918
+
1919
+ var getIteratorMethod$2 = function (it) {
1920
+ if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$1)
1921
+ || getMethod$1(it, '@@iterator')
1922
+ || Iterators[classof(it)];
1923
+ };
1924
+
1925
+ var call$6 = functionCall;
1926
+ var aCallable$2 = aCallable$7;
1927
+ var anObject$3 = anObject$8;
1928
+ var tryToString$1 = tryToString$4;
1929
+ var getIteratorMethod$1 = getIteratorMethod$2;
1930
+
1931
+ var $TypeError$1 = TypeError;
1932
+
1933
+ var getIterator$1 = function (argument, usingIterator) {
1934
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
1935
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$6(iteratorMethod, argument));
1936
+ throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
1937
+ };
1938
+
1939
+ var call$5 = functionCall;
1940
+ var anObject$2 = anObject$8;
1941
+ var getMethod = getMethod$3;
1942
+
1943
+ var iteratorClose$1 = function (iterator, kind, value) {
1944
+ var innerResult, innerError;
1945
+ anObject$2(iterator);
1946
+ try {
1947
+ innerResult = getMethod(iterator, 'return');
1948
+ if (!innerResult) {
1949
+ if (kind === 'throw') throw value;
1950
+ return value;
1951
+ }
1952
+ innerResult = call$5(innerResult, iterator);
1953
+ } catch (error) {
1954
+ innerError = true;
1955
+ innerResult = error;
1956
+ }
1957
+ if (kind === 'throw') throw value;
1958
+ if (innerError) throw innerResult;
1959
+ anObject$2(innerResult);
1960
+ return value;
1961
+ };
1962
+
1963
+ var bind = functionBindContext;
1964
+ var call$4 = functionCall;
1965
+ var anObject$1 = anObject$8;
1966
+ var tryToString = tryToString$4;
1967
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
1968
+ var lengthOfArrayLike = lengthOfArrayLike$2;
1969
+ var isPrototypeOf = objectIsPrototypeOf;
1970
+ var getIterator = getIterator$1;
1971
+ var getIteratorMethod = getIteratorMethod$2;
1972
+ var iteratorClose = iteratorClose$1;
1973
+
1974
+ var $TypeError = TypeError;
1975
+
1976
+ var Result = function (stopped, result) {
1977
+ this.stopped = stopped;
1978
+ this.result = result;
1979
+ };
1980
+
1981
+ var ResultPrototype = Result.prototype;
1982
+
1983
+ var iterate$2 = function (iterable, unboundFunction, options) {
1984
+ var that = options && options.that;
1985
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1986
+ var IS_RECORD = !!(options && options.IS_RECORD);
1987
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1988
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
1989
+ var fn = bind(unboundFunction, that);
1990
+ var iterator, iterFn, index, length, result, next, step;
1991
+
1992
+ var stop = function (condition) {
1993
+ if (iterator) iteratorClose(iterator, 'normal', condition);
1994
+ return new Result(true, condition);
1995
+ };
1996
+
1997
+ var callFn = function (value) {
1998
+ if (AS_ENTRIES) {
1999
+ anObject$1(value);
2000
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2001
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2002
+ };
2003
+
2004
+ if (IS_RECORD) {
2005
+ iterator = iterable.iterator;
2006
+ } else if (IS_ITERATOR) {
2007
+ iterator = iterable;
2008
+ } else {
2009
+ iterFn = getIteratorMethod(iterable);
2010
+ if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
2011
+ // optimisation for array iterators
2012
+ if (isArrayIteratorMethod(iterFn)) {
2013
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2014
+ result = callFn(iterable[index]);
2015
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
2016
+ } return new Result(false);
2017
+ }
2018
+ iterator = getIterator(iterable, iterFn);
2019
+ }
2020
+
2021
+ next = IS_RECORD ? iterable.next : iterator.next;
2022
+ while (!(step = call$4(next, iterator)).done) {
2023
+ try {
2024
+ result = callFn(step.value);
2025
+ } catch (error) {
2026
+ iteratorClose(iterator, 'throw', error);
2027
+ }
2028
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2029
+ } return new Result(false);
2030
+ };
2031
+
2032
+ var wellKnownSymbol = wellKnownSymbol$a;
2033
+
2034
+ var ITERATOR = wellKnownSymbol('iterator');
2035
+ var SAFE_CLOSING = false;
2036
+
2037
+ try {
2038
+ var called = 0;
2039
+ var iteratorWithReturn = {
2040
+ next: function () {
2041
+ return { done: !!called++ };
2042
+ },
2043
+ 'return': function () {
2044
+ SAFE_CLOSING = true;
2045
+ }
2046
+ };
2047
+ iteratorWithReturn[ITERATOR] = function () {
2048
+ return this;
2049
+ };
2050
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2051
+ Array.from(iteratorWithReturn, function () { throw 2; });
2052
+ } catch (error) { /* empty */ }
2053
+
2054
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2055
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2056
+ var ITERATION_SUPPORT = false;
2057
+ try {
2058
+ var object = {};
2059
+ object[ITERATOR] = function () {
2060
+ return {
2061
+ next: function () {
2062
+ return { done: ITERATION_SUPPORT = true };
2063
+ }
2064
+ };
2065
+ };
2066
+ exec(object);
2067
+ } catch (error) { /* empty */ }
2068
+ return ITERATION_SUPPORT;
2069
+ };
2070
+
2071
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
2072
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2073
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2074
+
2075
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2076
+ NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2077
+ });
2078
+
2079
+ var $$5 = _export;
2080
+ var call$3 = functionCall;
2081
+ var aCallable$1 = aCallable$7;
2082
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2083
+ var perform$1 = perform$3;
2084
+ var iterate$1 = iterate$2;
2085
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2086
+
2087
+ // `Promise.all` method
2088
+ // https://tc39.es/ecma262/#sec-promise.all
2089
+ $$5({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2090
+ all: function all(iterable) {
2091
+ var C = this;
2092
+ var capability = newPromiseCapabilityModule$2.f(C);
2093
+ var resolve = capability.resolve;
2094
+ var reject = capability.reject;
2095
+ var result = perform$1(function () {
2096
+ var $promiseResolve = aCallable$1(C.resolve);
2097
+ var values = [];
2098
+ var counter = 0;
2099
+ var remaining = 1;
2100
+ iterate$1(iterable, function (promise) {
2101
+ var index = counter++;
2102
+ var alreadyCalled = false;
2103
+ remaining++;
2104
+ call$3($promiseResolve, C, promise).then(function (value) {
2105
+ if (alreadyCalled) return;
2106
+ alreadyCalled = true;
2107
+ values[index] = value;
2108
+ --remaining || resolve(values);
2109
+ }, reject);
2110
+ });
2111
+ --remaining || resolve(values);
2112
+ });
2113
+ if (result.error) reject(result.value);
2114
+ return capability.promise;
2115
+ }
2116
+ });
2117
+
2118
+ var $$4 = _export;
2119
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2120
+ var NativePromiseConstructor = promiseNativeConstructor;
2121
+ var getBuiltIn$1 = getBuiltIn$8;
2122
+ var isCallable = isCallable$h;
2123
+ var defineBuiltIn = defineBuiltIn$3;
2124
+
2125
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2126
+
2127
+ // `Promise.prototype.catch` method
2128
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
2129
+ $$4({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2130
+ 'catch': function (onRejected) {
2131
+ return this.then(undefined, onRejected);
2132
+ }
2133
+ });
2134
+
2135
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2136
+ if (isCallable(NativePromiseConstructor)) {
2137
+ var method = getBuiltIn$1('Promise').prototype['catch'];
2138
+ if (NativePromisePrototype['catch'] !== method) {
2139
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
2140
+ }
2141
+ }
2142
+
2143
+ var $$3 = _export;
2144
+ var call$2 = functionCall;
2145
+ var aCallable = aCallable$7;
2146
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2147
+ var perform = perform$3;
2148
+ var iterate = iterate$2;
2149
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2150
+
2151
+ // `Promise.race` method
2152
+ // https://tc39.es/ecma262/#sec-promise.race
2153
+ $$3({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2154
+ race: function race(iterable) {
2155
+ var C = this;
2156
+ var capability = newPromiseCapabilityModule$1.f(C);
2157
+ var reject = capability.reject;
2158
+ var result = perform(function () {
2159
+ var $promiseResolve = aCallable(C.resolve);
2160
+ iterate(iterable, function (promise) {
2161
+ call$2($promiseResolve, C, promise).then(capability.resolve, reject);
2162
+ });
2163
+ });
2164
+ if (result.error) reject(result.value);
2165
+ return capability.promise;
2166
+ }
2167
+ });
2168
+
2169
+ var $$2 = _export;
2170
+ var call$1 = functionCall;
2171
+ var newPromiseCapabilityModule = newPromiseCapability$2;
2172
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2173
+
2174
+ // `Promise.reject` method
2175
+ // https://tc39.es/ecma262/#sec-promise.reject
2176
+ $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2177
+ reject: function reject(r) {
2178
+ var capability = newPromiseCapabilityModule.f(this);
2179
+ call$1(capability.reject, undefined, r);
2180
+ return capability.promise;
2181
+ }
2182
+ });
2183
+
2184
+ var anObject = anObject$8;
2185
+ var isObject = isObject$7;
2186
+ var newPromiseCapability = newPromiseCapability$2;
2187
+
2188
+ var promiseResolve$1 = function (C, x) {
2189
+ anObject(C);
2190
+ if (isObject(x) && x.constructor === C) return x;
2191
+ var promiseCapability = newPromiseCapability.f(C);
2192
+ var resolve = promiseCapability.resolve;
2193
+ resolve(x);
2194
+ return promiseCapability.promise;
2195
+ };
2196
+
2197
+ var $$1 = _export;
2198
+ var getBuiltIn = getBuiltIn$8;
2199
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2200
+ var promiseResolve = promiseResolve$1;
2201
+
2202
+ getBuiltIn('Promise');
2203
+
2204
+ // `Promise.resolve` method
2205
+ // https://tc39.es/ecma262/#sec-promise.resolve
2206
+ $$1({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2207
+ resolve: function resolve(x) {
2208
+ return promiseResolve(this, x);
2209
+ }
2210
+ });
2211
+
2212
+ var internalObjectKeys = objectKeysInternal;
2213
+ var enumBugKeys = enumBugKeys$2;
2214
+
2215
+ // `Object.keys` method
2216
+ // https://tc39.es/ecma262/#sec-object.keys
2217
+ // eslint-disable-next-line es/no-object-keys -- safe
2218
+ var objectKeys$1 = Object.keys || function keys(O) {
2219
+ return internalObjectKeys(O, enumBugKeys);
2220
+ };
2221
+
2222
+ var DESCRIPTORS = descriptors;
2223
+ var uncurryThis = functionUncurryThis;
2224
+ var call = functionCall;
2225
+ var fails = fails$b;
2226
+ var objectKeys = objectKeys$1;
2227
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2228
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2229
+ var toObject = toObject$2;
2230
+ var IndexedObject = indexedObject;
2231
+
2232
+ // eslint-disable-next-line es/no-object-assign -- safe
2233
+ var $assign = Object.assign;
2234
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2235
+ var defineProperty = Object.defineProperty;
2236
+ var concat = uncurryThis([].concat);
2237
+
2238
+ // `Object.assign` method
2239
+ // https://tc39.es/ecma262/#sec-object.assign
2240
+ var objectAssign = !$assign || fails(function () {
2241
+ // should have correct order of operations (Edge bug)
2242
+ if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
2243
+ enumerable: true,
2244
+ get: function () {
2245
+ defineProperty(this, 'b', {
2246
+ value: 3,
2247
+ enumerable: false
2248
+ });
2249
+ }
2250
+ }), { b: 2 })).b !== 1) return true;
2251
+ // should work with symbols and should have deterministic property order (V8 bug)
2252
+ var A = {};
2253
+ var B = {};
2254
+ // eslint-disable-next-line es/no-symbol -- safe
2255
+ var symbol = Symbol();
2256
+ var alphabet = 'abcdefghijklmnopqrst';
2257
+ A[symbol] = 7;
2258
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2259
+ return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
2260
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2261
+ var T = toObject(target);
2262
+ var argumentsLength = arguments.length;
2263
+ var index = 1;
2264
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2265
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
2266
+ while (argumentsLength > index) {
2267
+ var S = IndexedObject(arguments[index++]);
2268
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2269
+ var length = keys.length;
2270
+ var j = 0;
2271
+ var key;
2272
+ while (length > j) {
2273
+ key = keys[j++];
2274
+ if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
2275
+ }
2276
+ } return T;
2277
+ } : $assign;
2278
+
2279
+ var $ = _export;
2280
+ var assign = objectAssign;
2281
+
2282
+ // `Object.assign` method
2283
+ // https://tc39.es/ecma262/#sec-object.assign
2284
+ // eslint-disable-next-line es/no-object-assign -- required for testing
2285
+ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2286
+ assign: assign
2287
+ });
2288
+
2289
+ /******************************************************************************
2290
+ Copyright (c) Microsoft Corporation.
2291
+
2292
+ Permission to use, copy, modify, and/or distribute this software for any
2293
+ purpose with or without fee is hereby granted.
2294
+
2295
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2296
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2297
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2298
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2299
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2300
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2301
+ PERFORMANCE OF THIS SOFTWARE.
2302
+ ***************************************************************************** */
2303
+
2304
+ function __rest(s, e) {
2305
+ var t = {};
2306
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2307
+ t[p] = s[p];
2308
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
2309
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2310
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
2311
+ t[p[i]] = s[p[i]];
2312
+ }
2313
+ return t;
2314
+ }
2315
+
2316
+ function __awaiter(thisArg, _arguments, P, generator) {
2317
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2318
+ return new (P || (P = Promise))(function (resolve, reject) {
2319
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
2320
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
2321
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
2322
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2323
+ });
2324
+ }
2325
+
2326
+ const defaultOptions = {
2327
+ mutate: {
2328
+ errorPolicy: "all"
2329
+ },
2330
+ query: {
2331
+ errorPolicy: "all"
2332
+ }
2333
+ }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
2334
+
2335
+ function ApolloMockedProviderWithError(props) {
2336
+ const {
2337
+ mocks
2338
+ } = props,
2339
+ otherProps = __rest(props, ["mocks"]);
2340
+
2341
+ const mockLink = new MockLink(mocks);
2342
+ const errorLoggingLink = onError(({
2343
+ graphQLErrors,
2344
+ networkError
2345
+ }) => {
2346
+ if (graphQLErrors) {
2347
+ // eslint-disable-next-line array-callback-return
2348
+ graphQLErrors.map(({
2349
+ message,
2350
+ locations,
2351
+ path
2352
+ }) => {
2353
+ if (process.env["VSCODE_INSPECTOR_OPTIONS"] || process.env["DEBUG"]) {
2354
+ // eslint-disable-next-line no-console
2355
+ console.log(`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`);
2356
+ }
2357
+ });
2358
+ }
2359
+
2360
+ if (networkError) {
2361
+ if (process.env["VSCODE_INSPECTOR_OPTIONS"] || process.env["DEBUG"]) {
2362
+ // eslint-disable-next-line no-console
2363
+ console.log(`[Network error]: ${networkError}`);
2364
+ }
2365
+ }
2366
+ });
2367
+ const link = ApolloLink.from([errorLoggingLink, mockLink]);
2368
+ return jsx(MockedProvider, Object.assign({}, otherProps, {
2369
+ link: link,
2370
+ defaultOptions: defaultOptions
2371
+ }));
2372
+ }
2373
+
2374
+ const mockCurrentUserContext = (overrides = {}) => Object.assign({
2375
+ userName: "",
2376
+ customerId: 12345,
2377
+ userId: 154312,
2378
+ tasUserId: "751ea227-f199-4d00-925f-a608312c5e45",
2379
+ email: "",
2380
+ name: "",
2381
+ accountId: "",
2382
+ assumedUser: null,
2383
+ jobTitle: "",
2384
+ isAuthenticated: true
2385
+ }, overrides);
2386
+
2387
+ const mockEnvironmentContext = {
2388
+ auth: {
2389
+ url: "",
2390
+ clientId: "",
2391
+ issuer: ""
2392
+ },
2393
+ managerClassicUrl: "https://sso.trackunit.com",
2394
+ googleMapsApiKey: "",
2395
+ amplitudeApiKey: "",
2396
+ launchDarklyApiKey: "",
2397
+ graphqlLegacyUrl: "",
2398
+ graphqlManagerUrl: "",
2399
+ graphqlManagerImageUploadUrl: "",
2400
+ graphqlReportUrl: "",
2401
+ graphqlSimulatorUrl: "",
2402
+ buildVersion: "",
2403
+ commitNumber: 0,
2404
+ buildDate: "",
2405
+ irisAppSdkServerUrl: "",
2406
+ publicUrl: "",
2407
+ isDev: true,
2408
+ environment: "",
2409
+ sentryDsn: "",
2410
+ sessionId: "",
2411
+ tracingHeaders: {
2412
+ "X-TrackunitAppVersion": "",
2413
+ "session-id": ""
2414
+ }
2415
+ };
2416
+
2417
+ const mockUserSubscriptionProviderValue = (features, packageType) => {
2418
+ return {
2419
+ features,
2420
+ packageType
2421
+ };
2422
+ };
2423
+
2424
+ const flushPromises = (waitTimeInMS = 0) => {
2425
+ return new Promise(resolve => {
2426
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2427
+ if (global.ORG_setTimeout) {
2428
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2429
+ return global.ORG_setTimeout(() => global.ORG_setTimeout(resolve, waitTimeInMS), 1);
2430
+ } else {
2431
+ setTimeout(() => setTimeout(resolve, waitTimeInMS), 1);
2432
+ }
2433
+ });
2434
+ };
2435
+
2436
+ let _ = t => t,
2437
+ _t;
2438
+ /**
2439
+ * This builder allows you to enable providers using the builder pattern, and then call 1 of either:
2440
+ * - render
2441
+ * - mount
2442
+ */
2443
+
2444
+ class MockContextProviderBuilder {
2445
+ constructor() {
2446
+ this.selectedEnvironmentContext = mockEnvironmentContext;
2447
+ this.selectedTokenContext = {
2448
+ token: "fakeToken"
2449
+ };
2450
+ this.userSubscriptionPackageType = UserSubscriptionPackageType.Insight;
2451
+ this.features = [];
2452
+ this.selectedApolloMocks = [];
2453
+ this.selectedRouterProps = {};
2454
+ this.selectedAssumedUser = mockCurrentUserContext().assumedUser;
2455
+ }
2456
+ /**
2457
+ * Use this Environment Context.
2458
+ *
2459
+ * @param environmentContext
2460
+ */
2461
+
2462
+
2463
+ environment(environmentContext) {
2464
+ this.selectedEnvironmentContext = environmentContext || mockEnvironmentContext;
2465
+ return this;
2466
+ }
2467
+ /**
2468
+ * Use this token.
2469
+ *
2470
+ * @param token
2471
+ */
2472
+
2473
+
2474
+ token(token) {
2475
+ this.selectedTokenContext = {
2476
+ token
2477
+ };
2478
+ return this;
2479
+ }
2480
+ /**
2481
+ * Use this to pass in userSubscriptionPackage.
2482
+ *
2483
+ * @param developerSettingsContext
2484
+ */
2485
+
2486
+
2487
+ userSubscriptionPackage(userSubscriptionPackage) {
2488
+ if (userSubscriptionPackage) {
2489
+ this.userSubscriptionPackageType = userSubscriptionPackage;
2490
+ }
2491
+
2492
+ return this;
2493
+ }
2494
+ /**
2495
+ * Use this to pass in SupportedFeatures.
2496
+ *
2497
+ * @param developerSettingsContext
2498
+ */
2499
+
2500
+
2501
+ supportedFeatures(features) {
2502
+ if (features) {
2503
+ this.features = features.map(feature => {
2504
+ return {
2505
+ id: feature,
2506
+ name: feature
2507
+ };
2508
+ });
2509
+ }
2510
+
2511
+ return this;
2512
+ }
2513
+ /**
2514
+ * Assume this user
2515
+ *
2516
+ * @param assumeUser
2517
+ */
2518
+
2519
+
2520
+ assumeUser(assumeUser) {
2521
+ this.selectedAssumedUser = assumeUser;
2522
+ return this;
2523
+ }
2524
+ /**
2525
+ * Use this Router Props with the given mocks.
2526
+ *
2527
+ * @param routerProps
2528
+ */
2529
+
2530
+
2531
+ routerProps(routerProps) {
2532
+ this.selectedRouterProps = routerProps || {};
2533
+ return this;
2534
+ }
2535
+
2536
+ renderHook(callback, parentElement) {
2537
+ return __awaiter(this, void 0, void 0, function* () {
2538
+ // This ensures correct act loading when using hooks
2539
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
2540
+ const hookRenderer = yield import('./HookRenderer.js');
2541
+ return hookRenderer.reactHooksRenderHook(callback, children => this.getMockedCompositionRoot(parentElement ? parentElement(children) : children));
2542
+ });
2543
+ }
2544
+ /**
2545
+ * Use this Manager Apollo Context Provider with the given mocks.
2546
+ *
2547
+ * @param apolloMocks
2548
+ */
2549
+
2550
+
2551
+ apollo(apolloMocks) {
2552
+ this.selectedApolloMocks = apolloMocks || [];
2553
+ return this;
2554
+ }
2555
+ /**
2556
+ * This will use RTL.render the child in the correct mocked hierarchy of context providers.
2557
+ *
2558
+ * @param child - the child element being tested.
2559
+ */
2560
+
2561
+
2562
+ render(child) {
2563
+ return __awaiter(this, void 0, void 0, function* () {
2564
+ let mountedcomponent;
2565
+ yield act(() => __awaiter(this, void 0, void 0, function* () {
2566
+ mountedcomponent = render(child, {
2567
+ wrapper: ({
2568
+ children
2569
+ }) => this.getMockedCompositionRoot(children)
2570
+ });
2571
+ yield flushPromises();
2572
+ yield flushPromises();
2573
+ }));
2574
+ return mountedcomponent;
2575
+ });
2576
+ }
2577
+ /**
2578
+ * Make sure this represent the same structure as the main index.tsx does.
2579
+ *
2580
+ * @param testChildren - the child element being tested.
2581
+ * @param addTestRootContainer - if you want to add a root container to the test.
2582
+ */
2583
+
2584
+
2585
+ getMockedCompositionRoot(testChildren, addTestRootContainer = true) {
2586
+ return jsx(EnvironmentContextProvider, Object.assign({
2587
+ value: this.selectedEnvironmentContext
2588
+ }, {
2589
+ children: jsx(MemoryRouter, Object.assign({}, this.selectedRouterProps, {
2590
+ children: jsx(CurrentUserProvider, Object.assign({
2591
+ value: mockCurrentUserContext({
2592
+ assumedUser: this.selectedAssumedUser
2593
+ })
2594
+ }, {
2595
+ children: jsx(UserSubscriptionProvider, Object.assign({
2596
+ value: mockUserSubscriptionProviderValue(this.features, this.userSubscriptionPackageType)
2597
+ }, {
2598
+ children: jsx(TokenProvider, Object.assign({
2599
+ value: this.selectedTokenContext
2600
+ }, {
2601
+ children: jsx(ToastProvider, Object.assign({
2602
+ value: {
2603
+ addToast: () => {}
2604
+ }
2605
+ }, {
2606
+ children: jsx(ApolloMockedProviderWithError, Object.assign({
2607
+ mocks: this.selectedApolloMocks,
2608
+ addTypename: false
2609
+ }, {
2610
+ children: addTestRootContainer ? jsx(TestRoot, Object.assign({
2611
+ "data-testid": "testRoot"
2612
+ }, {
2613
+ children: testChildren
2614
+ })) : jsx("div", {
2615
+ children: testChildren
2616
+ })
2617
+ }))
2618
+ }))
2619
+ }))
2620
+ }))
2621
+ }))
2622
+ }))
2623
+ }));
2624
+ }
2625
+
2626
+ }
2627
+ const rootContext = () => new MockContextProviderBuilder();
2628
+ const TestRoot = tw.div(_t || (_t = _`
2629
+ --tw-scale-x: 0.99;
2630
+ --tw-scale-y: 0.99;
2631
+ w[1024px];
2632
+ h[1000px];
2633
+ inline-block;
2634
+ `));
2635
+
2636
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2637
+ const doNothing = () => {
2638
+ /* Do nothing */
2639
+ };
2640
+
2641
+ /**
2642
+ *
2643
+ * @param document Document that represents the specific GQL query / mutation schema.
2644
+ * @param variables Variables that should be passed to the query / mutation.
2645
+ * Note that an *exact* match between the mock and operation is necessary.
2646
+ * @param data Data object to be returned.
2647
+ * Note that *all* properties should be given a value, use `null` in place of `undefined`,
2648
+ * otherwise nothing will be returned.
2649
+ * @param error ApolloError object to be returned.
2650
+ * @returns MockedResponse that can be passed to the mocked ApolloProvider.
2651
+ * @see [Testing React components using MockedProvider and associated APIs](https://www.apollographql.com/docs/react/development-testing/testing/)
2652
+ */
2653
+
2654
+ const queryFor = (document, variables, data, error) => {
2655
+ return {
2656
+ request: {
2657
+ query: document,
2658
+ variables
2659
+ },
2660
+ newData: () => {
2661
+ if (process.env["VSCODE_INSPECTOR_OPTIONS"] || process.env["DEBUG"]) {
2662
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2663
+ const name = document.definitions[0].name.value; // eslint-disable-next-line no-console
2664
+
2665
+ console.log("Found Response for: " + name + " for variables: " + JSON.stringify(variables, null, 2) + " Returning: " + "{ data: " + JSON.stringify(data, null, 2) + ", error: " + JSON.stringify(error, null, 2) + "}");
2666
+ }
2667
+
2668
+ return {
2669
+ data,
2670
+ errors: error ? [new GraphQLError(error.message)] : undefined
2671
+ };
2672
+ }
2673
+ };
2674
+ };
2675
+
2676
+ export { MockContextProviderBuilder as M, __awaiter as _, mockEnvironmentContext as a, doNothing as d, flushPromises as f, mockCurrentUserContext as m, queryFor as q, rootContext as r };