@intrig/react 0.0.15-28 → 0.0.15-29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js DELETED
@@ -1,4872 +0,0 @@
1
- import { createContext, useContext, useReducer, useMemo, useState, useCallback, useRef, useEffect, useId } from 'react';
2
- import axios, { isAxiosError } from 'axios';
3
- import log from 'loglevel';
4
- import { flushSync } from 'react-dom';
5
- import { createParser } from 'eventsource-parser';
6
- import { jsxDEV } from 'react/jsx-dev-runtime';
7
- import { XMLParser } from 'fast-xml-parser';
8
-
9
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
10
-
11
- var check = function (it) {
12
- return it && it.Math === Math && it;
13
- };
14
-
15
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
16
- var globalThis_1 =
17
- // eslint-disable-next-line es/no-global-this -- safe
18
- check(typeof globalThis == 'object' && globalThis) ||
19
- check(typeof window == 'object' && window) ||
20
- // eslint-disable-next-line no-restricted-globals -- safe
21
- check(typeof self == 'object' && self) ||
22
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
23
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
24
- // eslint-disable-next-line no-new-func -- fallback
25
- (function () { return this; })() || Function('return this')();
26
-
27
- var objectGetOwnPropertyDescriptor = {};
28
-
29
- var fails$k = function (exec) {
30
- try {
31
- return !!exec();
32
- } catch (error) {
33
- return true;
34
- }
35
- };
36
-
37
- var fails$j = fails$k;
38
-
39
- // Detect IE8's incomplete defineProperty implementation
40
- var descriptors = !fails$j(function () {
41
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
42
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
43
- });
44
-
45
- var fails$i = fails$k;
46
-
47
- var functionBindNative = !fails$i(function () {
48
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
49
- var test = (function () { /* empty */ }).bind();
50
- // eslint-disable-next-line no-prototype-builtins -- safe
51
- return typeof test != 'function' || test.hasOwnProperty('prototype');
52
- });
53
-
54
- var NATIVE_BIND$3 = functionBindNative;
55
-
56
- var call$i = Function.prototype.call;
57
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
58
- var functionCall = NATIVE_BIND$3 ? call$i.bind(call$i) : function () {
59
- return call$i.apply(call$i, arguments);
60
- };
61
-
62
- var objectPropertyIsEnumerable = {};
63
-
64
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
65
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
66
- var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
67
-
68
- // Nashorn ~ JDK8 bug
69
- var NASHORN_BUG = getOwnPropertyDescriptor$3 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
70
-
71
- // `Object.prototype.propertyIsEnumerable` method implementation
72
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
73
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
74
- var descriptor = getOwnPropertyDescriptor$3(this, V);
75
- return !!descriptor && descriptor.enumerable;
76
- } : $propertyIsEnumerable;
77
-
78
- var createPropertyDescriptor$5 = function (bitmap, value) {
79
- return {
80
- enumerable: !(bitmap & 1),
81
- configurable: !(bitmap & 2),
82
- writable: !(bitmap & 4),
83
- value: value
84
- };
85
- };
86
-
87
- var NATIVE_BIND$2 = functionBindNative;
88
-
89
- var FunctionPrototype$2 = Function.prototype;
90
- var call$h = FunctionPrototype$2.call;
91
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
92
- var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$h, call$h);
93
-
94
- var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
95
- return function () {
96
- return call$h.apply(fn, arguments);
97
- };
98
- };
99
-
100
- var uncurryThis$i = functionUncurryThis;
101
-
102
- var toString$5 = uncurryThis$i({}.toString);
103
- var stringSlice$1 = uncurryThis$i(''.slice);
104
-
105
- var classofRaw$2 = function (it) {
106
- return stringSlice$1(toString$5(it), 8, -1);
107
- };
108
-
109
- var uncurryThis$h = functionUncurryThis;
110
- var fails$h = fails$k;
111
- var classof$8 = classofRaw$2;
112
-
113
- var $Object$4 = Object;
114
- var split = uncurryThis$h(''.split);
115
-
116
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
117
- var indexedObject = fails$h(function () {
118
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
119
- // eslint-disable-next-line no-prototype-builtins -- safe
120
- return !$Object$4('z').propertyIsEnumerable(0);
121
- }) ? function (it) {
122
- return classof$8(it) === 'String' ? split(it, '') : $Object$4(it);
123
- } : $Object$4;
124
-
125
- // we can't use just `it == null` since of `document.all` special case
126
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
127
- var isNullOrUndefined$4 = function (it) {
128
- return it === null || it === undefined;
129
- };
130
-
131
- var isNullOrUndefined$3 = isNullOrUndefined$4;
132
-
133
- var $TypeError$i = TypeError;
134
-
135
- // `RequireObjectCoercible` abstract operation
136
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
137
- var requireObjectCoercible$4 = function (it) {
138
- if (isNullOrUndefined$3(it)) throw new $TypeError$i("Can't call method on " + it);
139
- return it;
140
- };
141
-
142
- // toObject with fallback for non-array-like ES3 strings
143
- var IndexedObject$2 = indexedObject;
144
- var requireObjectCoercible$3 = requireObjectCoercible$4;
145
-
146
- var toIndexedObject$5 = function (it) {
147
- return IndexedObject$2(requireObjectCoercible$3(it));
148
- };
149
-
150
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
151
- var documentAll = typeof document == 'object' && document.all;
152
-
153
- // `IsCallable` abstract operation
154
- // https://tc39.es/ecma262/#sec-iscallable
155
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
156
- var isCallable$n = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
157
- return typeof argument == 'function' || argument === documentAll;
158
- } : function (argument) {
159
- return typeof argument == 'function';
160
- };
161
-
162
- var isCallable$m = isCallable$n;
163
-
164
- var isObject$d = function (it) {
165
- return typeof it == 'object' ? it !== null : isCallable$m(it);
166
- };
167
-
168
- var globalThis$n = globalThis_1;
169
- var isCallable$l = isCallable$n;
170
-
171
- var aFunction = function (argument) {
172
- return isCallable$l(argument) ? argument : undefined;
173
- };
174
-
175
- var getBuiltIn$9 = function (namespace, method) {
176
- return arguments.length < 2 ? aFunction(globalThis$n[namespace]) : globalThis$n[namespace] && globalThis$n[namespace][method];
177
- };
178
-
179
- var uncurryThis$g = functionUncurryThis;
180
-
181
- var objectIsPrototypeOf = uncurryThis$g({}.isPrototypeOf);
182
-
183
- var globalThis$m = globalThis_1;
184
-
185
- var navigator = globalThis$m.navigator;
186
- var userAgent$5 = navigator && navigator.userAgent;
187
-
188
- var environmentUserAgent = userAgent$5 ? String(userAgent$5) : '';
189
-
190
- var globalThis$l = globalThis_1;
191
- var userAgent$4 = environmentUserAgent;
192
-
193
- var process$3 = globalThis$l.process;
194
- var Deno$1 = globalThis$l.Deno;
195
- var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
196
- var v8 = versions && versions.v8;
197
- var match, version;
198
-
199
- if (v8) {
200
- match = v8.split('.');
201
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
202
- // but their correct versions are not interesting for us
203
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
204
- }
205
-
206
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
207
- // so check `userAgent` even if `.v8` exists, but 0
208
- if (!version && userAgent$4) {
209
- match = userAgent$4.match(/Edge\/(\d+)/);
210
- if (!match || match[1] >= 74) {
211
- match = userAgent$4.match(/Chrome\/(\d+)/);
212
- if (match) version = +match[1];
213
- }
214
- }
215
-
216
- var environmentV8Version = version;
217
-
218
- /* eslint-disable es/no-symbol -- required for testing */
219
- var V8_VERSION$1 = environmentV8Version;
220
- var fails$g = fails$k;
221
- var globalThis$k = globalThis_1;
222
-
223
- var $String$6 = globalThis$k.String;
224
-
225
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
226
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$g(function () {
227
- var symbol = Symbol('symbol detection');
228
- // Chrome 38 Symbol has incorrect toString conversion
229
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
230
- // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
231
- // of course, fail.
232
- return !$String$6(symbol) || !(Object(symbol) instanceof Symbol) ||
233
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
234
- !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
235
- });
236
-
237
- /* eslint-disable es/no-symbol -- required for testing */
238
- var NATIVE_SYMBOL$2 = symbolConstructorDetection;
239
-
240
- var useSymbolAsUid = NATIVE_SYMBOL$2 &&
241
- !Symbol.sham &&
242
- typeof Symbol.iterator == 'symbol';
243
-
244
- var getBuiltIn$8 = getBuiltIn$9;
245
- var isCallable$k = isCallable$n;
246
- var isPrototypeOf$3 = objectIsPrototypeOf;
247
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
248
-
249
- var $Object$3 = Object;
250
-
251
- var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
252
- return typeof it == 'symbol';
253
- } : function (it) {
254
- var $Symbol = getBuiltIn$8('Symbol');
255
- return isCallable$k($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it));
256
- };
257
-
258
- var $String$5 = String;
259
-
260
- var tryToString$4 = function (argument) {
261
- try {
262
- return $String$5(argument);
263
- } catch (error) {
264
- return 'Object';
265
- }
266
- };
267
-
268
- var isCallable$j = isCallable$n;
269
- var tryToString$3 = tryToString$4;
270
-
271
- var $TypeError$h = TypeError;
272
-
273
- // `Assert: IsCallable(argument) is true`
274
- var aCallable$d = function (argument) {
275
- if (isCallable$j(argument)) return argument;
276
- throw new $TypeError$h(tryToString$3(argument) + ' is not a function');
277
- };
278
-
279
- var aCallable$c = aCallable$d;
280
- var isNullOrUndefined$2 = isNullOrUndefined$4;
281
-
282
- // `GetMethod` abstract operation
283
- // https://tc39.es/ecma262/#sec-getmethod
284
- var getMethod$4 = function (V, P) {
285
- var func = V[P];
286
- return isNullOrUndefined$2(func) ? undefined : aCallable$c(func);
287
- };
288
-
289
- var call$g = functionCall;
290
- var isCallable$i = isCallable$n;
291
- var isObject$c = isObject$d;
292
-
293
- var $TypeError$g = TypeError;
294
-
295
- // `OrdinaryToPrimitive` abstract operation
296
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
297
- var ordinaryToPrimitive$1 = function (input, pref) {
298
- var fn, val;
299
- if (pref === 'string' && isCallable$i(fn = input.toString) && !isObject$c(val = call$g(fn, input))) return val;
300
- if (isCallable$i(fn = input.valueOf) && !isObject$c(val = call$g(fn, input))) return val;
301
- if (pref !== 'string' && isCallable$i(fn = input.toString) && !isObject$c(val = call$g(fn, input))) return val;
302
- throw new $TypeError$g("Can't convert object to primitive value");
303
- };
304
-
305
- var sharedStore = {exports: {}};
306
-
307
- var globalThis$j = globalThis_1;
308
-
309
- // eslint-disable-next-line es/no-object-defineproperty -- safe
310
- var defineProperty$7 = Object.defineProperty;
311
-
312
- var defineGlobalProperty$3 = function (key, value) {
313
- try {
314
- defineProperty$7(globalThis$j, key, { value: value, configurable: true, writable: true });
315
- } catch (error) {
316
- globalThis$j[key] = value;
317
- } return value;
318
- };
319
-
320
- var globalThis$i = globalThis_1;
321
- var defineGlobalProperty$2 = defineGlobalProperty$3;
322
-
323
- var SHARED = '__core-js_shared__';
324
- var store$3 = sharedStore.exports = globalThis$i[SHARED] || defineGlobalProperty$2(SHARED, {});
325
-
326
- (store$3.versions || (store$3.versions = [])).push({
327
- version: '3.45.1',
328
- mode: 'global',
329
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
330
- license: 'https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE',
331
- source: 'https://github.com/zloirock/core-js'
332
- });
333
-
334
- var sharedStoreExports = sharedStore.exports;
335
-
336
- var store$2 = sharedStoreExports;
337
-
338
- var shared$3 = function (key, value) {
339
- return store$2[key] || (store$2[key] = value || {});
340
- };
341
-
342
- var requireObjectCoercible$2 = requireObjectCoercible$4;
343
-
344
- var $Object$2 = Object;
345
-
346
- // `ToObject` abstract operation
347
- // https://tc39.es/ecma262/#sec-toobject
348
- var toObject$5 = function (argument) {
349
- return $Object$2(requireObjectCoercible$2(argument));
350
- };
351
-
352
- var uncurryThis$f = functionUncurryThis;
353
- var toObject$4 = toObject$5;
354
-
355
- var hasOwnProperty = uncurryThis$f({}.hasOwnProperty);
356
-
357
- // `HasOwnProperty` abstract operation
358
- // https://tc39.es/ecma262/#sec-hasownproperty
359
- // eslint-disable-next-line es/no-object-hasown -- safe
360
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
361
- return hasOwnProperty(toObject$4(it), key);
362
- };
363
-
364
- var uncurryThis$e = functionUncurryThis;
365
-
366
- var id = 0;
367
- var postfix = Math.random();
368
- var toString$4 = uncurryThis$e(1.1.toString);
369
-
370
- var uid$2 = function (key) {
371
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
372
- };
373
-
374
- var globalThis$h = globalThis_1;
375
- var shared$2 = shared$3;
376
- var hasOwn$b = hasOwnProperty_1;
377
- var uid$1 = uid$2;
378
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
379
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
380
-
381
- var Symbol$1 = globalThis$h.Symbol;
382
- var WellKnownSymbolsStore = shared$2('wks');
383
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
384
-
385
- var wellKnownSymbol$i = function (name) {
386
- if (!hasOwn$b(WellKnownSymbolsStore, name)) {
387
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$b(Symbol$1, name)
388
- ? Symbol$1[name]
389
- : createWellKnownSymbol('Symbol.' + name);
390
- } return WellKnownSymbolsStore[name];
391
- };
392
-
393
- var call$f = functionCall;
394
- var isObject$b = isObject$d;
395
- var isSymbol$2 = isSymbol$3;
396
- var getMethod$3 = getMethod$4;
397
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
398
- var wellKnownSymbol$h = wellKnownSymbol$i;
399
-
400
- var $TypeError$f = TypeError;
401
- var TO_PRIMITIVE = wellKnownSymbol$h('toPrimitive');
402
-
403
- // `ToPrimitive` abstract operation
404
- // https://tc39.es/ecma262/#sec-toprimitive
405
- var toPrimitive$1 = function (input, pref) {
406
- if (!isObject$b(input) || isSymbol$2(input)) return input;
407
- var exoticToPrim = getMethod$3(input, TO_PRIMITIVE);
408
- var result;
409
- if (exoticToPrim) {
410
- if (pref === undefined) pref = 'default';
411
- result = call$f(exoticToPrim, input, pref);
412
- if (!isObject$b(result) || isSymbol$2(result)) return result;
413
- throw new $TypeError$f("Can't convert object to primitive value");
414
- }
415
- if (pref === undefined) pref = 'number';
416
- return ordinaryToPrimitive(input, pref);
417
- };
418
-
419
- var toPrimitive = toPrimitive$1;
420
- var isSymbol$1 = isSymbol$3;
421
-
422
- // `ToPropertyKey` abstract operation
423
- // https://tc39.es/ecma262/#sec-topropertykey
424
- var toPropertyKey$2 = function (argument) {
425
- var key = toPrimitive(argument, 'string');
426
- return isSymbol$1(key) ? key : key + '';
427
- };
428
-
429
- var globalThis$g = globalThis_1;
430
- var isObject$a = isObject$d;
431
-
432
- var document$3 = globalThis$g.document;
433
- // typeof document.createElement is 'object' in old IE
434
- var EXISTS$1 = isObject$a(document$3) && isObject$a(document$3.createElement);
435
-
436
- var documentCreateElement$2 = function (it) {
437
- return EXISTS$1 ? document$3.createElement(it) : {};
438
- };
439
-
440
- var DESCRIPTORS$f = descriptors;
441
- var fails$f = fails$k;
442
- var createElement$1 = documentCreateElement$2;
443
-
444
- // Thanks to IE8 for its funny defineProperty
445
- var ie8DomDefine = !DESCRIPTORS$f && !fails$f(function () {
446
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
447
- return Object.defineProperty(createElement$1('div'), 'a', {
448
- get: function () { return 7; }
449
- }).a !== 7;
450
- });
451
-
452
- var DESCRIPTORS$e = descriptors;
453
- var call$e = functionCall;
454
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
455
- var createPropertyDescriptor$4 = createPropertyDescriptor$5;
456
- var toIndexedObject$4 = toIndexedObject$5;
457
- var toPropertyKey$1 = toPropertyKey$2;
458
- var hasOwn$a = hasOwnProperty_1;
459
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
460
-
461
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
462
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
463
-
464
- // `Object.getOwnPropertyDescriptor` method
465
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
466
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$e ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
467
- O = toIndexedObject$4(O);
468
- P = toPropertyKey$1(P);
469
- if (IE8_DOM_DEFINE$1) try {
470
- return $getOwnPropertyDescriptor$1(O, P);
471
- } catch (error) { /* empty */ }
472
- if (hasOwn$a(O, P)) return createPropertyDescriptor$4(!call$e(propertyIsEnumerableModule$1.f, O, P), O[P]);
473
- };
474
-
475
- var objectDefineProperty = {};
476
-
477
- var DESCRIPTORS$d = descriptors;
478
- var fails$e = fails$k;
479
-
480
- // V8 ~ Chrome 36-
481
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
482
- var v8PrototypeDefineBug = DESCRIPTORS$d && fails$e(function () {
483
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
484
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
485
- value: 42,
486
- writable: false
487
- }).prototype !== 42;
488
- });
489
-
490
- var isObject$9 = isObject$d;
491
-
492
- var $String$4 = String;
493
- var $TypeError$e = TypeError;
494
-
495
- // `Assert: Type(argument) is Object`
496
- var anObject$f = function (argument) {
497
- if (isObject$9(argument)) return argument;
498
- throw new $TypeError$e($String$4(argument) + ' is not an object');
499
- };
500
-
501
- var DESCRIPTORS$c = descriptors;
502
- var IE8_DOM_DEFINE = ie8DomDefine;
503
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
504
- var anObject$e = anObject$f;
505
- var toPropertyKey = toPropertyKey$2;
506
-
507
- var $TypeError$d = TypeError;
508
- // eslint-disable-next-line es/no-object-defineproperty -- safe
509
- var $defineProperty = Object.defineProperty;
510
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
511
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
512
- var ENUMERABLE = 'enumerable';
513
- var CONFIGURABLE$1 = 'configurable';
514
- var WRITABLE = 'writable';
515
-
516
- // `Object.defineProperty` method
517
- // https://tc39.es/ecma262/#sec-object.defineproperty
518
- objectDefineProperty.f = DESCRIPTORS$c ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
519
- anObject$e(O);
520
- P = toPropertyKey(P);
521
- anObject$e(Attributes);
522
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
523
- var current = $getOwnPropertyDescriptor(O, P);
524
- if (current && current[WRITABLE]) {
525
- O[P] = Attributes.value;
526
- Attributes = {
527
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
528
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
529
- writable: false
530
- };
531
- }
532
- } return $defineProperty(O, P, Attributes);
533
- } : $defineProperty : function defineProperty(O, P, Attributes) {
534
- anObject$e(O);
535
- P = toPropertyKey(P);
536
- anObject$e(Attributes);
537
- if (IE8_DOM_DEFINE) try {
538
- return $defineProperty(O, P, Attributes);
539
- } catch (error) { /* empty */ }
540
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$d('Accessors not supported');
541
- if ('value' in Attributes) O[P] = Attributes.value;
542
- return O;
543
- };
544
-
545
- var DESCRIPTORS$b = descriptors;
546
- var definePropertyModule$4 = objectDefineProperty;
547
- var createPropertyDescriptor$3 = createPropertyDescriptor$5;
548
-
549
- var createNonEnumerableProperty$8 = DESCRIPTORS$b ? function (object, key, value) {
550
- return definePropertyModule$4.f(object, key, createPropertyDescriptor$3(1, value));
551
- } : function (object, key, value) {
552
- object[key] = value;
553
- return object;
554
- };
555
-
556
- var makeBuiltIn$3 = {exports: {}};
557
-
558
- var DESCRIPTORS$a = descriptors;
559
- var hasOwn$9 = hasOwnProperty_1;
560
-
561
- var FunctionPrototype$1 = Function.prototype;
562
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
563
- var getDescriptor = DESCRIPTORS$a && Object.getOwnPropertyDescriptor;
564
-
565
- var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
566
- // additional protection from minified / mangled / dropped function names
567
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
568
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$a || (DESCRIPTORS$a && getDescriptor(FunctionPrototype$1, 'name').configurable));
569
-
570
- var functionName = {
571
- PROPER: PROPER,
572
- CONFIGURABLE: CONFIGURABLE
573
- };
574
-
575
- var uncurryThis$d = functionUncurryThis;
576
- var isCallable$h = isCallable$n;
577
- var store$1 = sharedStoreExports;
578
-
579
- var functionToString = uncurryThis$d(Function.toString);
580
-
581
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
582
- if (!isCallable$h(store$1.inspectSource)) {
583
- store$1.inspectSource = function (it) {
584
- return functionToString(it);
585
- };
586
- }
587
-
588
- var inspectSource$3 = store$1.inspectSource;
589
-
590
- var globalThis$f = globalThis_1;
591
- var isCallable$g = isCallable$n;
592
-
593
- var WeakMap$1 = globalThis$f.WeakMap;
594
-
595
- var weakMapBasicDetection = isCallable$g(WeakMap$1) && /native code/.test(String(WeakMap$1));
596
-
597
- var shared$1 = shared$3;
598
- var uid = uid$2;
599
-
600
- var keys = shared$1('keys');
601
-
602
- var sharedKey$3 = function (key) {
603
- return keys[key] || (keys[key] = uid(key));
604
- };
605
-
606
- var hiddenKeys$4 = {};
607
-
608
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
609
- var globalThis$e = globalThis_1;
610
- var isObject$8 = isObject$d;
611
- var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
612
- var hasOwn$8 = hasOwnProperty_1;
613
- var shared = sharedStoreExports;
614
- var sharedKey$2 = sharedKey$3;
615
- var hiddenKeys$3 = hiddenKeys$4;
616
-
617
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
618
- var TypeError$2 = globalThis$e.TypeError;
619
- var WeakMap = globalThis$e.WeakMap;
620
- var set$1, get, has;
621
-
622
- var enforce = function (it) {
623
- return has(it) ? get(it) : set$1(it, {});
624
- };
625
-
626
- var getterFor = function (TYPE) {
627
- return function (it) {
628
- var state;
629
- if (!isObject$8(it) || (state = get(it)).type !== TYPE) {
630
- throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
631
- } return state;
632
- };
633
- };
634
-
635
- if (NATIVE_WEAK_MAP || shared.state) {
636
- var store = shared.state || (shared.state = new WeakMap());
637
- /* eslint-disable no-self-assign -- prototype methods protection */
638
- store.get = store.get;
639
- store.has = store.has;
640
- store.set = store.set;
641
- /* eslint-enable no-self-assign -- prototype methods protection */
642
- set$1 = function (it, metadata) {
643
- if (store.has(it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
644
- metadata.facade = it;
645
- store.set(it, metadata);
646
- return metadata;
647
- };
648
- get = function (it) {
649
- return store.get(it) || {};
650
- };
651
- has = function (it) {
652
- return store.has(it);
653
- };
654
- } else {
655
- var STATE = sharedKey$2('state');
656
- hiddenKeys$3[STATE] = true;
657
- set$1 = function (it, metadata) {
658
- if (hasOwn$8(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
659
- metadata.facade = it;
660
- createNonEnumerableProperty$7(it, STATE, metadata);
661
- return metadata;
662
- };
663
- get = function (it) {
664
- return hasOwn$8(it, STATE) ? it[STATE] : {};
665
- };
666
- has = function (it) {
667
- return hasOwn$8(it, STATE);
668
- };
669
- }
670
-
671
- var internalState = {
672
- set: set$1,
673
- get: get,
674
- has: has,
675
- enforce: enforce,
676
- getterFor: getterFor
677
- };
678
-
679
- var uncurryThis$c = functionUncurryThis;
680
- var fails$d = fails$k;
681
- var isCallable$f = isCallable$n;
682
- var hasOwn$7 = hasOwnProperty_1;
683
- var DESCRIPTORS$9 = descriptors;
684
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
685
- var inspectSource$2 = inspectSource$3;
686
- var InternalStateModule$3 = internalState;
687
-
688
- var enforceInternalState = InternalStateModule$3.enforce;
689
- var getInternalState$1 = InternalStateModule$3.get;
690
- var $String$3 = String;
691
- // eslint-disable-next-line es/no-object-defineproperty -- safe
692
- var defineProperty$6 = Object.defineProperty;
693
- var stringSlice = uncurryThis$c(''.slice);
694
- var replace$2 = uncurryThis$c(''.replace);
695
- var join = uncurryThis$c([].join);
696
-
697
- var CONFIGURABLE_LENGTH = DESCRIPTORS$9 && !fails$d(function () {
698
- return defineProperty$6(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
699
- });
700
-
701
- var TEMPLATE = String(String).split('String');
702
-
703
- var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
704
- if (stringSlice($String$3(name), 0, 7) === 'Symbol(') {
705
- name = '[' + replace$2($String$3(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
706
- }
707
- if (options && options.getter) name = 'get ' + name;
708
- if (options && options.setter) name = 'set ' + name;
709
- if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
710
- if (DESCRIPTORS$9) defineProperty$6(value, 'name', { value: name, configurable: true });
711
- else value.name = name;
712
- }
713
- if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
714
- defineProperty$6(value, 'length', { value: options.arity });
715
- }
716
- try {
717
- if (options && hasOwn$7(options, 'constructor') && options.constructor) {
718
- if (DESCRIPTORS$9) defineProperty$6(value, 'prototype', { writable: false });
719
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
720
- } else if (value.prototype) value.prototype = undefined;
721
- } catch (error) { /* empty */ }
722
- var state = enforceInternalState(value);
723
- if (!hasOwn$7(state, 'source')) {
724
- state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
725
- } return value;
726
- };
727
-
728
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
729
- // eslint-disable-next-line no-extend-native -- required
730
- Function.prototype.toString = makeBuiltIn$2(function toString() {
731
- return isCallable$f(this) && getInternalState$1(this).source || inspectSource$2(this);
732
- }, 'toString');
733
-
734
- var makeBuiltInExports = makeBuiltIn$3.exports;
735
-
736
- var isCallable$e = isCallable$n;
737
- var definePropertyModule$3 = objectDefineProperty;
738
- var makeBuiltIn$1 = makeBuiltInExports;
739
- var defineGlobalProperty$1 = defineGlobalProperty$3;
740
-
741
- var defineBuiltIn$6 = function (O, key, value, options) {
742
- if (!options) options = {};
743
- var simple = options.enumerable;
744
- var name = options.name !== undefined ? options.name : key;
745
- if (isCallable$e(value)) makeBuiltIn$1(value, name, options);
746
- if (options.global) {
747
- if (simple) O[key] = value;
748
- else defineGlobalProperty$1(key, value);
749
- } else {
750
- try {
751
- if (!options.unsafe) delete O[key];
752
- else if (O[key]) simple = true;
753
- } catch (error) { /* empty */ }
754
- if (simple) O[key] = value;
755
- else definePropertyModule$3.f(O, key, {
756
- value: value,
757
- enumerable: false,
758
- configurable: !options.nonConfigurable,
759
- writable: !options.nonWritable
760
- });
761
- } return O;
762
- };
763
-
764
- var objectGetOwnPropertyNames = {};
765
-
766
- var ceil = Math.ceil;
767
- var floor = Math.floor;
768
-
769
- // `Math.trunc` method
770
- // https://tc39.es/ecma262/#sec-math.trunc
771
- // eslint-disable-next-line es/no-math-trunc -- safe
772
- var mathTrunc = Math.trunc || function trunc(x) {
773
- var n = +x;
774
- return (n > 0 ? floor : ceil)(n);
775
- };
776
-
777
- var trunc = mathTrunc;
778
-
779
- // `ToIntegerOrInfinity` abstract operation
780
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
781
- var toIntegerOrInfinity$2 = function (argument) {
782
- var number = +argument;
783
- // eslint-disable-next-line no-self-compare -- NaN check
784
- return number !== number || number === 0 ? 0 : trunc(number);
785
- };
786
-
787
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
788
-
789
- var max = Math.max;
790
- var min$1 = Math.min;
791
-
792
- // Helper for a popular repeating case of the spec:
793
- // Let integer be ? ToInteger(index).
794
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
795
- var toAbsoluteIndex$1 = function (index, length) {
796
- var integer = toIntegerOrInfinity$1(index);
797
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
798
- };
799
-
800
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
801
-
802
- var min = Math.min;
803
-
804
- // `ToLength` abstract operation
805
- // https://tc39.es/ecma262/#sec-tolength
806
- var toLength$1 = function (argument) {
807
- var len = toIntegerOrInfinity(argument);
808
- return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
809
- };
810
-
811
- var toLength = toLength$1;
812
-
813
- // `LengthOfArrayLike` abstract operation
814
- // https://tc39.es/ecma262/#sec-lengthofarraylike
815
- var lengthOfArrayLike$4 = function (obj) {
816
- return toLength(obj.length);
817
- };
818
-
819
- var toIndexedObject$3 = toIndexedObject$5;
820
- var toAbsoluteIndex = toAbsoluteIndex$1;
821
- var lengthOfArrayLike$3 = lengthOfArrayLike$4;
822
-
823
- // `Array.prototype.{ indexOf, includes }` methods implementation
824
- var createMethod$1 = function (IS_INCLUDES) {
825
- return function ($this, el, fromIndex) {
826
- var O = toIndexedObject$3($this);
827
- var length = lengthOfArrayLike$3(O);
828
- if (length === 0) return !IS_INCLUDES && -1;
829
- var index = toAbsoluteIndex(fromIndex, length);
830
- var value;
831
- // Array#includes uses SameValueZero equality algorithm
832
- // eslint-disable-next-line no-self-compare -- NaN check
833
- if (IS_INCLUDES && el !== el) while (length > index) {
834
- value = O[index++];
835
- // eslint-disable-next-line no-self-compare -- NaN check
836
- if (value !== value) return true;
837
- // Array#indexOf ignores holes, Array#includes - not
838
- } else for (;length > index; index++) {
839
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
840
- } return !IS_INCLUDES && -1;
841
- };
842
- };
843
-
844
- var arrayIncludes = {
845
- // `Array.prototype.includes` method
846
- // https://tc39.es/ecma262/#sec-array.prototype.includes
847
- includes: createMethod$1(true),
848
- // `Array.prototype.indexOf` method
849
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
850
- indexOf: createMethod$1(false)
851
- };
852
-
853
- var uncurryThis$b = functionUncurryThis;
854
- var hasOwn$6 = hasOwnProperty_1;
855
- var toIndexedObject$2 = toIndexedObject$5;
856
- var indexOf = arrayIncludes.indexOf;
857
- var hiddenKeys$2 = hiddenKeys$4;
858
-
859
- var push$1 = uncurryThis$b([].push);
860
-
861
- var objectKeysInternal = function (object, names) {
862
- var O = toIndexedObject$2(object);
863
- var i = 0;
864
- var result = [];
865
- var key;
866
- for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$1(result, key);
867
- // Don't enum bug & hidden keys
868
- while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
869
- ~indexOf(result, key) || push$1(result, key);
870
- }
871
- return result;
872
- };
873
-
874
- // IE8- don't enum bug keys
875
- var enumBugKeys$3 = [
876
- 'constructor',
877
- 'hasOwnProperty',
878
- 'isPrototypeOf',
879
- 'propertyIsEnumerable',
880
- 'toLocaleString',
881
- 'toString',
882
- 'valueOf'
883
- ];
884
-
885
- var internalObjectKeys$1 = objectKeysInternal;
886
- var enumBugKeys$2 = enumBugKeys$3;
887
-
888
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
889
-
890
- // `Object.getOwnPropertyNames` method
891
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
892
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
893
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
894
- return internalObjectKeys$1(O, hiddenKeys$1);
895
- };
896
-
897
- var objectGetOwnPropertySymbols = {};
898
-
899
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
900
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
901
-
902
- var getBuiltIn$7 = getBuiltIn$9;
903
- var uncurryThis$a = functionUncurryThis;
904
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
905
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
906
- var anObject$d = anObject$f;
907
-
908
- var concat$1 = uncurryThis$a([].concat);
909
-
910
- // all object keys, includes non-enumerable and symbols
911
- var ownKeys$1 = getBuiltIn$7('Reflect', 'ownKeys') || function ownKeys(it) {
912
- var keys = getOwnPropertyNamesModule.f(anObject$d(it));
913
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
914
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
915
- };
916
-
917
- var hasOwn$5 = hasOwnProperty_1;
918
- var ownKeys = ownKeys$1;
919
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
920
- var definePropertyModule$2 = objectDefineProperty;
921
-
922
- var copyConstructorProperties$2 = function (target, source, exceptions) {
923
- var keys = ownKeys(source);
924
- var defineProperty = definePropertyModule$2.f;
925
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
926
- for (var i = 0; i < keys.length; i++) {
927
- var key = keys[i];
928
- if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
929
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
930
- }
931
- }
932
- };
933
-
934
- var fails$c = fails$k;
935
- var isCallable$d = isCallable$n;
936
-
937
- var replacement = /#|\.prototype\./;
938
-
939
- var isForced$2 = function (feature, detection) {
940
- var value = data[normalize(feature)];
941
- return value === POLYFILL ? true
942
- : value === NATIVE ? false
943
- : isCallable$d(detection) ? fails$c(detection)
944
- : !!detection;
945
- };
946
-
947
- var normalize = isForced$2.normalize = function (string) {
948
- return String(string).replace(replacement, '.').toLowerCase();
949
- };
950
-
951
- var data = isForced$2.data = {};
952
- var NATIVE = isForced$2.NATIVE = 'N';
953
- var POLYFILL = isForced$2.POLYFILL = 'P';
954
-
955
- var isForced_1 = isForced$2;
956
-
957
- var globalThis$d = globalThis_1;
958
- var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
959
- var createNonEnumerableProperty$6 = createNonEnumerableProperty$8;
960
- var defineBuiltIn$5 = defineBuiltIn$6;
961
- var defineGlobalProperty = defineGlobalProperty$3;
962
- var copyConstructorProperties$1 = copyConstructorProperties$2;
963
- var isForced$1 = isForced_1;
964
-
965
- /*
966
- options.target - name of the target object
967
- options.global - target is the global object
968
- options.stat - export as static methods of target
969
- options.proto - export as prototype methods of target
970
- options.real - real prototype method for the `pure` version
971
- options.forced - export even if the native feature is available
972
- options.bind - bind methods to the target, required for the `pure` version
973
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
974
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
975
- options.sham - add a flag to not completely full polyfills
976
- options.enumerable - export as enumerable property
977
- options.dontCallGetSet - prevent calling a getter on target
978
- options.name - the .name of the function if it does not match the key
979
- */
980
- var _export = function (options, source) {
981
- var TARGET = options.target;
982
- var GLOBAL = options.global;
983
- var STATIC = options.stat;
984
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
985
- if (GLOBAL) {
986
- target = globalThis$d;
987
- } else if (STATIC) {
988
- target = globalThis$d[TARGET] || defineGlobalProperty(TARGET, {});
989
- } else {
990
- target = globalThis$d[TARGET] && globalThis$d[TARGET].prototype;
991
- }
992
- if (target) for (key in source) {
993
- sourceProperty = source[key];
994
- if (options.dontCallGetSet) {
995
- descriptor = getOwnPropertyDescriptor$2(target, key);
996
- targetProperty = descriptor && descriptor.value;
997
- } else targetProperty = target[key];
998
- FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
999
- // contained in target
1000
- if (!FORCED && targetProperty !== undefined) {
1001
- if (typeof sourceProperty == typeof targetProperty) continue;
1002
- copyConstructorProperties$1(sourceProperty, targetProperty);
1003
- }
1004
- // add a flag to not completely full polyfills
1005
- if (options.sham || (targetProperty && targetProperty.sham)) {
1006
- createNonEnumerableProperty$6(sourceProperty, 'sham', true);
1007
- }
1008
- defineBuiltIn$5(target, key, sourceProperty, options);
1009
- }
1010
- };
1011
-
1012
- var objectDefineProperties = {};
1013
-
1014
- var internalObjectKeys = objectKeysInternal;
1015
- var enumBugKeys$1 = enumBugKeys$3;
1016
-
1017
- // `Object.keys` method
1018
- // https://tc39.es/ecma262/#sec-object.keys
1019
- // eslint-disable-next-line es/no-object-keys -- safe
1020
- var objectKeys$2 = Object.keys || function keys(O) {
1021
- return internalObjectKeys(O, enumBugKeys$1);
1022
- };
1023
-
1024
- var DESCRIPTORS$8 = descriptors;
1025
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1026
- var definePropertyModule$1 = objectDefineProperty;
1027
- var anObject$c = anObject$f;
1028
- var toIndexedObject$1 = toIndexedObject$5;
1029
- var objectKeys$1 = objectKeys$2;
1030
-
1031
- // `Object.defineProperties` method
1032
- // https://tc39.es/ecma262/#sec-object.defineproperties
1033
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1034
- objectDefineProperties.f = DESCRIPTORS$8 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1035
- anObject$c(O);
1036
- var props = toIndexedObject$1(Properties);
1037
- var keys = objectKeys$1(Properties);
1038
- var length = keys.length;
1039
- var index = 0;
1040
- var key;
1041
- while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
1042
- return O;
1043
- };
1044
-
1045
- var getBuiltIn$6 = getBuiltIn$9;
1046
-
1047
- var html$2 = getBuiltIn$6('document', 'documentElement');
1048
-
1049
- /* global ActiveXObject -- old IE, WSH */
1050
- var anObject$b = anObject$f;
1051
- var definePropertiesModule = objectDefineProperties;
1052
- var enumBugKeys = enumBugKeys$3;
1053
- var hiddenKeys = hiddenKeys$4;
1054
- var html$1 = html$2;
1055
- var documentCreateElement$1 = documentCreateElement$2;
1056
- var sharedKey$1 = sharedKey$3;
1057
-
1058
- var GT = '>';
1059
- var LT = '<';
1060
- var PROTOTYPE = 'prototype';
1061
- var SCRIPT = 'script';
1062
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1063
-
1064
- var EmptyConstructor = function () { /* empty */ };
1065
-
1066
- var scriptTag = function (content) {
1067
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1068
- };
1069
-
1070
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1071
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1072
- activeXDocument.write(scriptTag(''));
1073
- activeXDocument.close();
1074
- var temp = activeXDocument.parentWindow.Object;
1075
- // eslint-disable-next-line no-useless-assignment -- avoid memory leak
1076
- activeXDocument = null;
1077
- return temp;
1078
- };
1079
-
1080
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1081
- var NullProtoObjectViaIFrame = function () {
1082
- // Thrash, waste and sodomy: IE GC bug
1083
- var iframe = documentCreateElement$1('iframe');
1084
- var JS = 'java' + SCRIPT + ':';
1085
- var iframeDocument;
1086
- iframe.style.display = 'none';
1087
- html$1.appendChild(iframe);
1088
- // https://github.com/zloirock/core-js/issues/475
1089
- iframe.src = String(JS);
1090
- iframeDocument = iframe.contentWindow.document;
1091
- iframeDocument.open();
1092
- iframeDocument.write(scriptTag('document.F=Object'));
1093
- iframeDocument.close();
1094
- return iframeDocument.F;
1095
- };
1096
-
1097
- // Check for document.domain and active x support
1098
- // No need to use active x approach when document.domain is not set
1099
- // see https://github.com/es-shims/es5-shim/issues/150
1100
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1101
- // avoid IE GC bug
1102
- var activeXDocument;
1103
- var NullProtoObject = function () {
1104
- try {
1105
- activeXDocument = new ActiveXObject('htmlfile');
1106
- } catch (error) { /* ignore */ }
1107
- NullProtoObject = typeof document != 'undefined'
1108
- ? document.domain && activeXDocument
1109
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1110
- : NullProtoObjectViaIFrame()
1111
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1112
- var length = enumBugKeys.length;
1113
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1114
- return NullProtoObject();
1115
- };
1116
-
1117
- hiddenKeys[IE_PROTO$1] = true;
1118
-
1119
- // `Object.create` method
1120
- // https://tc39.es/ecma262/#sec-object.create
1121
- // eslint-disable-next-line es/no-object-create -- safe
1122
- var objectCreate = Object.create || function create(O, Properties) {
1123
- var result;
1124
- if (O !== null) {
1125
- EmptyConstructor[PROTOTYPE] = anObject$b(O);
1126
- result = new EmptyConstructor();
1127
- EmptyConstructor[PROTOTYPE] = null;
1128
- // add "__proto__" for Object.getPrototypeOf polyfill
1129
- result[IE_PROTO$1] = O;
1130
- } else result = NullProtoObject();
1131
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1132
- };
1133
-
1134
- var wellKnownSymbol$g = wellKnownSymbol$i;
1135
- var create$2 = objectCreate;
1136
- var defineProperty$5 = objectDefineProperty.f;
1137
-
1138
- var UNSCOPABLES = wellKnownSymbol$g('unscopables');
1139
- var ArrayPrototype$1 = Array.prototype;
1140
-
1141
- // Array.prototype[@@unscopables]
1142
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1143
- if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
1144
- defineProperty$5(ArrayPrototype$1, UNSCOPABLES, {
1145
- configurable: true,
1146
- value: create$2(null)
1147
- });
1148
- }
1149
-
1150
- // add a key to Array.prototype[@@unscopables]
1151
- var addToUnscopables$2 = function (key) {
1152
- ArrayPrototype$1[UNSCOPABLES][key] = true;
1153
- };
1154
-
1155
- var $$j = _export;
1156
- var $includes = arrayIncludes.includes;
1157
- var fails$b = fails$k;
1158
- var addToUnscopables$1 = addToUnscopables$2;
1159
-
1160
- // FF99+ bug
1161
- var BROKEN_ON_SPARSE = fails$b(function () {
1162
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
1163
- return !Array(1).includes();
1164
- });
1165
-
1166
- // `Array.prototype.includes` method
1167
- // https://tc39.es/ecma262/#sec-array.prototype.includes
1168
- $$j({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1169
- includes: function includes(el /* , fromIndex = 0 */) {
1170
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1171
- }
1172
- });
1173
-
1174
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1175
- addToUnscopables$1('includes');
1176
-
1177
- var iterators = {};
1178
-
1179
- var fails$a = fails$k;
1180
-
1181
- var correctPrototypeGetter = !fails$a(function () {
1182
- function F() { /* empty */ }
1183
- F.prototype.constructor = null;
1184
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1185
- return Object.getPrototypeOf(new F()) !== F.prototype;
1186
- });
1187
-
1188
- var hasOwn$4 = hasOwnProperty_1;
1189
- var isCallable$c = isCallable$n;
1190
- var toObject$3 = toObject$5;
1191
- var sharedKey = sharedKey$3;
1192
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1193
-
1194
- var IE_PROTO = sharedKey('IE_PROTO');
1195
- var $Object$1 = Object;
1196
- var ObjectPrototype = $Object$1.prototype;
1197
-
1198
- // `Object.getPrototypeOf` method
1199
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1200
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1201
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1202
- var object = toObject$3(O);
1203
- if (hasOwn$4(object, IE_PROTO)) return object[IE_PROTO];
1204
- var constructor = object.constructor;
1205
- if (isCallable$c(constructor) && object instanceof constructor) {
1206
- return constructor.prototype;
1207
- } return object instanceof $Object$1 ? ObjectPrototype : null;
1208
- };
1209
-
1210
- var fails$9 = fails$k;
1211
- var isCallable$b = isCallable$n;
1212
- var isObject$7 = isObject$d;
1213
- var getPrototypeOf$2 = objectGetPrototypeOf;
1214
- var defineBuiltIn$4 = defineBuiltIn$6;
1215
- var wellKnownSymbol$f = wellKnownSymbol$i;
1216
-
1217
- var ITERATOR$6 = wellKnownSymbol$f('iterator');
1218
- var BUGGY_SAFARI_ITERATORS$1 = false;
1219
-
1220
- // `%IteratorPrototype%` object
1221
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1222
- var IteratorPrototype$4, PrototypeOfArrayIteratorPrototype, arrayIterator;
1223
-
1224
- /* eslint-disable es/no-array-prototype-keys -- safe */
1225
- if ([].keys) {
1226
- arrayIterator = [].keys();
1227
- // Safari 8 has buggy iterators w/o `next`
1228
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1229
- else {
1230
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$2(getPrototypeOf$2(arrayIterator));
1231
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$4 = PrototypeOfArrayIteratorPrototype;
1232
- }
1233
- }
1234
-
1235
- var NEW_ITERATOR_PROTOTYPE = !isObject$7(IteratorPrototype$4) || fails$9(function () {
1236
- var test = {};
1237
- // FF44- legacy iterators case
1238
- return IteratorPrototype$4[ITERATOR$6].call(test) !== test;
1239
- });
1240
-
1241
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$4 = {};
1242
-
1243
- // `%IteratorPrototype%[@@iterator]()` method
1244
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1245
- if (!isCallable$b(IteratorPrototype$4[ITERATOR$6])) {
1246
- defineBuiltIn$4(IteratorPrototype$4, ITERATOR$6, function () {
1247
- return this;
1248
- });
1249
- }
1250
-
1251
- var iteratorsCore = {
1252
- IteratorPrototype: IteratorPrototype$4,
1253
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1254
- };
1255
-
1256
- var defineProperty$4 = objectDefineProperty.f;
1257
- var hasOwn$3 = hasOwnProperty_1;
1258
- var wellKnownSymbol$e = wellKnownSymbol$i;
1259
-
1260
- var TO_STRING_TAG$4 = wellKnownSymbol$e('toStringTag');
1261
-
1262
- var setToStringTag$4 = function (target, TAG, STATIC) {
1263
- if (target && !STATIC) target = target.prototype;
1264
- if (target && !hasOwn$3(target, TO_STRING_TAG$4)) {
1265
- defineProperty$4(target, TO_STRING_TAG$4, { configurable: true, value: TAG });
1266
- }
1267
- };
1268
-
1269
- var IteratorPrototype$3 = iteratorsCore.IteratorPrototype;
1270
- var create$1 = objectCreate;
1271
- var createPropertyDescriptor$2 = createPropertyDescriptor$5;
1272
- var setToStringTag$3 = setToStringTag$4;
1273
- var Iterators$4 = iterators;
1274
-
1275
- var returnThis$1 = function () { return this; };
1276
-
1277
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1278
- var TO_STRING_TAG = NAME + ' Iterator';
1279
- IteratorConstructor.prototype = create$1(IteratorPrototype$3, { next: createPropertyDescriptor$2(+!ENUMERABLE_NEXT, next) });
1280
- setToStringTag$3(IteratorConstructor, TO_STRING_TAG, false);
1281
- Iterators$4[TO_STRING_TAG] = returnThis$1;
1282
- return IteratorConstructor;
1283
- };
1284
-
1285
- var uncurryThis$9 = functionUncurryThis;
1286
- var aCallable$b = aCallable$d;
1287
-
1288
- var functionUncurryThisAccessor = function (object, key, method) {
1289
- try {
1290
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1291
- return uncurryThis$9(aCallable$b(Object.getOwnPropertyDescriptor(object, key)[method]));
1292
- } catch (error) { /* empty */ }
1293
- };
1294
-
1295
- var isObject$6 = isObject$d;
1296
-
1297
- var isPossiblePrototype$1 = function (argument) {
1298
- return isObject$6(argument) || argument === null;
1299
- };
1300
-
1301
- var isPossiblePrototype = isPossiblePrototype$1;
1302
-
1303
- var $String$2 = String;
1304
- var $TypeError$c = TypeError;
1305
-
1306
- var aPossiblePrototype$1 = function (argument) {
1307
- if (isPossiblePrototype(argument)) return argument;
1308
- throw new $TypeError$c("Can't set " + $String$2(argument) + ' as a prototype');
1309
- };
1310
-
1311
- /* eslint-disable no-proto -- safe */
1312
- var uncurryThisAccessor = functionUncurryThisAccessor;
1313
- var isObject$5 = isObject$d;
1314
- var requireObjectCoercible$1 = requireObjectCoercible$4;
1315
- var aPossiblePrototype = aPossiblePrototype$1;
1316
-
1317
- // `Object.setPrototypeOf` method
1318
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1319
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1320
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1321
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1322
- var CORRECT_SETTER = false;
1323
- var test = {};
1324
- var setter;
1325
- try {
1326
- setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1327
- setter(test, []);
1328
- CORRECT_SETTER = test instanceof Array;
1329
- } catch (error) { /* empty */ }
1330
- return function setPrototypeOf(O, proto) {
1331
- requireObjectCoercible$1(O);
1332
- aPossiblePrototype(proto);
1333
- if (!isObject$5(O)) return O;
1334
- if (CORRECT_SETTER) setter(O, proto);
1335
- else O.__proto__ = proto;
1336
- return O;
1337
- };
1338
- }() : undefined);
1339
-
1340
- var $$i = _export;
1341
- var call$d = functionCall;
1342
- var FunctionName = functionName;
1343
- var isCallable$a = isCallable$n;
1344
- var createIteratorConstructor = iteratorCreateConstructor;
1345
- var getPrototypeOf$1 = objectGetPrototypeOf;
1346
- var setPrototypeOf$3 = objectSetPrototypeOf;
1347
- var setToStringTag$2 = setToStringTag$4;
1348
- var createNonEnumerableProperty$5 = createNonEnumerableProperty$8;
1349
- var defineBuiltIn$3 = defineBuiltIn$6;
1350
- var wellKnownSymbol$d = wellKnownSymbol$i;
1351
- var Iterators$3 = iterators;
1352
- var IteratorsCore = iteratorsCore;
1353
-
1354
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1355
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1356
- var IteratorPrototype$2 = IteratorsCore.IteratorPrototype;
1357
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1358
- var ITERATOR$5 = wellKnownSymbol$d('iterator');
1359
- var KEYS = 'keys';
1360
- var VALUES = 'values';
1361
- var ENTRIES = 'entries';
1362
-
1363
- var returnThis = function () { return this; };
1364
-
1365
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1366
- createIteratorConstructor(IteratorConstructor, NAME, next);
1367
-
1368
- var getIterationMethod = function (KIND) {
1369
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1370
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1371
-
1372
- switch (KIND) {
1373
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1374
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1375
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1376
- }
1377
-
1378
- return function () { return new IteratorConstructor(this); };
1379
- };
1380
-
1381
- var TO_STRING_TAG = NAME + ' Iterator';
1382
- var INCORRECT_VALUES_NAME = false;
1383
- var IterablePrototype = Iterable.prototype;
1384
- var nativeIterator = IterablePrototype[ITERATOR$5]
1385
- || IterablePrototype['@@iterator']
1386
- || DEFAULT && IterablePrototype[DEFAULT];
1387
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1388
- var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1389
- var CurrentIteratorPrototype, methods, KEY;
1390
-
1391
- // fix native
1392
- if (anyNativeIterator) {
1393
- CurrentIteratorPrototype = getPrototypeOf$1(anyNativeIterator.call(new Iterable()));
1394
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1395
- if (getPrototypeOf$1(CurrentIteratorPrototype) !== IteratorPrototype$2) {
1396
- if (setPrototypeOf$3) {
1397
- setPrototypeOf$3(CurrentIteratorPrototype, IteratorPrototype$2);
1398
- } else if (!isCallable$a(CurrentIteratorPrototype[ITERATOR$5])) {
1399
- defineBuiltIn$3(CurrentIteratorPrototype, ITERATOR$5, returnThis);
1400
- }
1401
- }
1402
- // Set @@toStringTag to native iterators
1403
- setToStringTag$2(CurrentIteratorPrototype, TO_STRING_TAG, true);
1404
- }
1405
- }
1406
-
1407
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1408
- if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1409
- if (CONFIGURABLE_FUNCTION_NAME) {
1410
- createNonEnumerableProperty$5(IterablePrototype, 'name', VALUES);
1411
- } else {
1412
- INCORRECT_VALUES_NAME = true;
1413
- defaultIterator = function values() { return call$d(nativeIterator, this); };
1414
- }
1415
- }
1416
-
1417
- // export additional methods
1418
- if (DEFAULT) {
1419
- methods = {
1420
- values: getIterationMethod(VALUES),
1421
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1422
- entries: getIterationMethod(ENTRIES)
1423
- };
1424
- if (FORCED) for (KEY in methods) {
1425
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1426
- defineBuiltIn$3(IterablePrototype, KEY, methods[KEY]);
1427
- }
1428
- } else $$i({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1429
- }
1430
-
1431
- // define iterator
1432
- if (IterablePrototype[ITERATOR$5] !== defaultIterator) {
1433
- defineBuiltIn$3(IterablePrototype, ITERATOR$5, defaultIterator, { name: DEFAULT });
1434
- }
1435
- Iterators$3[NAME] = defaultIterator;
1436
-
1437
- return methods;
1438
- };
1439
-
1440
- // `CreateIterResultObject` abstract operation
1441
- // https://tc39.es/ecma262/#sec-createiterresultobject
1442
- var createIterResultObject$2 = function (value, done) {
1443
- return { value: value, done: done };
1444
- };
1445
-
1446
- var toIndexedObject = toIndexedObject$5;
1447
- var addToUnscopables = addToUnscopables$2;
1448
- var Iterators$2 = iterators;
1449
- var InternalStateModule$2 = internalState;
1450
- var defineProperty$3 = objectDefineProperty.f;
1451
- var defineIterator = iteratorDefine;
1452
- var createIterResultObject$1 = createIterResultObject$2;
1453
- var DESCRIPTORS$7 = descriptors;
1454
-
1455
- var ARRAY_ITERATOR = 'Array Iterator';
1456
- var setInternalState$2 = InternalStateModule$2.set;
1457
- var getInternalState = InternalStateModule$2.getterFor(ARRAY_ITERATOR);
1458
-
1459
- // `Array.prototype.entries` method
1460
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1461
- // `Array.prototype.keys` method
1462
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1463
- // `Array.prototype.values` method
1464
- // https://tc39.es/ecma262/#sec-array.prototype.values
1465
- // `Array.prototype[@@iterator]` method
1466
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1467
- // `CreateArrayIterator` internal method
1468
- // https://tc39.es/ecma262/#sec-createarrayiterator
1469
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1470
- setInternalState$2(this, {
1471
- type: ARRAY_ITERATOR,
1472
- target: toIndexedObject(iterated), // target
1473
- index: 0, // next index
1474
- kind: kind // kind
1475
- });
1476
- // `%ArrayIteratorPrototype%.next` method
1477
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1478
- }, function () {
1479
- var state = getInternalState(this);
1480
- var target = state.target;
1481
- var index = state.index++;
1482
- if (!target || index >= target.length) {
1483
- state.target = null;
1484
- return createIterResultObject$1(undefined, true);
1485
- }
1486
- switch (state.kind) {
1487
- case 'keys': return createIterResultObject$1(index, false);
1488
- case 'values': return createIterResultObject$1(target[index], false);
1489
- } return createIterResultObject$1([index, target[index]], false);
1490
- }, 'values');
1491
-
1492
- // argumentsList[@@iterator] is %ArrayProto_values%
1493
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1494
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1495
- var values = Iterators$2.Arguments = Iterators$2.Array;
1496
-
1497
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1498
- addToUnscopables('keys');
1499
- addToUnscopables('values');
1500
- addToUnscopables('entries');
1501
-
1502
- // V8 ~ Chrome 45- bug
1503
- if (DESCRIPTORS$7 && values.name !== 'values') try {
1504
- defineProperty$3(values, 'name', { value: 'values' });
1505
- } catch (error) { /* empty */ }
1506
-
1507
- var aCallable$a = aCallable$d;
1508
- var toObject$2 = toObject$5;
1509
- var IndexedObject$1 = indexedObject;
1510
- var lengthOfArrayLike$2 = lengthOfArrayLike$4;
1511
-
1512
- var $TypeError$b = TypeError;
1513
-
1514
- var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
1515
-
1516
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
1517
- var createMethod = function (IS_RIGHT) {
1518
- return function (that, callbackfn, argumentsLength, memo) {
1519
- var O = toObject$2(that);
1520
- var self = IndexedObject$1(O);
1521
- var length = lengthOfArrayLike$2(O);
1522
- aCallable$a(callbackfn);
1523
- if (length === 0 && argumentsLength < 2) throw new $TypeError$b(REDUCE_EMPTY);
1524
- var index = IS_RIGHT ? length - 1 : 0;
1525
- var i = IS_RIGHT ? -1 : 1;
1526
- if (argumentsLength < 2) while (true) {
1527
- if (index in self) {
1528
- memo = self[index];
1529
- index += i;
1530
- break;
1531
- }
1532
- index += i;
1533
- if (IS_RIGHT ? index < 0 : length <= index) {
1534
- throw new $TypeError$b(REDUCE_EMPTY);
1535
- }
1536
- }
1537
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
1538
- memo = callbackfn(memo, self[index], index, O);
1539
- }
1540
- return memo;
1541
- };
1542
- };
1543
-
1544
- var arrayReduce = {
1545
- // `Array.prototype.reduce` method
1546
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1547
- left: createMethod(false)};
1548
-
1549
- var fails$8 = fails$k;
1550
-
1551
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1552
- var method = [][METHOD_NAME];
1553
- return !!method && fails$8(function () {
1554
- // eslint-disable-next-line no-useless-call -- required for testing
1555
- method.call(null, argument || function () { return 1; }, 1);
1556
- });
1557
- };
1558
-
1559
- /* global Bun, Deno -- detection */
1560
- var globalThis$c = globalThis_1;
1561
- var userAgent$3 = environmentUserAgent;
1562
- var classof$7 = classofRaw$2;
1563
-
1564
- var userAgentStartsWith = function (string) {
1565
- return userAgent$3.slice(0, string.length) === string;
1566
- };
1567
-
1568
- var environment = (function () {
1569
- if (userAgentStartsWith('Bun/')) return 'BUN';
1570
- if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
1571
- if (userAgentStartsWith('Deno/')) return 'DENO';
1572
- if (userAgentStartsWith('Node.js/')) return 'NODE';
1573
- if (globalThis$c.Bun && typeof Bun.version == 'string') return 'BUN';
1574
- if (globalThis$c.Deno && typeof Deno.version == 'object') return 'DENO';
1575
- if (classof$7(globalThis$c.process) === 'process') return 'NODE';
1576
- if (globalThis$c.window && globalThis$c.document) return 'BROWSER';
1577
- return 'REST';
1578
- })();
1579
-
1580
- var ENVIRONMENT$1 = environment;
1581
-
1582
- var environmentIsNode = ENVIRONMENT$1 === 'NODE';
1583
-
1584
- var $$h = _export;
1585
- var $reduce = arrayReduce.left;
1586
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
1587
- var CHROME_VERSION = environmentV8Version;
1588
- var IS_NODE$3 = environmentIsNode;
1589
-
1590
- // Chrome 80-82 has a critical bug
1591
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
1592
- var CHROME_BUG = !IS_NODE$3 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1593
- var FORCED$5 = CHROME_BUG || !arrayMethodIsStrict('reduce');
1594
-
1595
- // `Array.prototype.reduce` method
1596
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
1597
- $$h({ target: 'Array', proto: true, forced: FORCED$5 }, {
1598
- reduce: function reduce(callbackfn /* , initialValue */) {
1599
- var length = arguments.length;
1600
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
1601
- }
1602
- });
1603
-
1604
- var isPrototypeOf$2 = objectIsPrototypeOf;
1605
-
1606
- var $TypeError$a = TypeError;
1607
-
1608
- var anInstance$2 = function (it, Prototype) {
1609
- if (isPrototypeOf$2(Prototype, it)) return it;
1610
- throw new $TypeError$a('Incorrect invocation');
1611
- };
1612
-
1613
- var makeBuiltIn = makeBuiltInExports;
1614
- var defineProperty$2 = objectDefineProperty;
1615
-
1616
- var defineBuiltInAccessor$2 = function (target, name, descriptor) {
1617
- if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
1618
- if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
1619
- return defineProperty$2.f(target, name, descriptor);
1620
- };
1621
-
1622
- var DESCRIPTORS$6 = descriptors;
1623
- var definePropertyModule = objectDefineProperty;
1624
- var createPropertyDescriptor$1 = createPropertyDescriptor$5;
1625
-
1626
- var createProperty$2 = function (object, key, value) {
1627
- if (DESCRIPTORS$6) definePropertyModule.f(object, key, createPropertyDescriptor$1(0, value));
1628
- else object[key] = value;
1629
- };
1630
-
1631
- var $$g = _export;
1632
- var globalThis$b = globalThis_1;
1633
- var anInstance$1 = anInstance$2;
1634
- var anObject$a = anObject$f;
1635
- var isCallable$9 = isCallable$n;
1636
- var getPrototypeOf = objectGetPrototypeOf;
1637
- var defineBuiltInAccessor$1 = defineBuiltInAccessor$2;
1638
- var createProperty$1 = createProperty$2;
1639
- var fails$7 = fails$k;
1640
- var hasOwn$2 = hasOwnProperty_1;
1641
- var wellKnownSymbol$c = wellKnownSymbol$i;
1642
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1643
- var DESCRIPTORS$5 = descriptors;
1644
-
1645
- var CONSTRUCTOR = 'constructor';
1646
- var ITERATOR$4 = 'Iterator';
1647
- var TO_STRING_TAG$3 = wellKnownSymbol$c('toStringTag');
1648
-
1649
- var $TypeError$9 = TypeError;
1650
- var NativeIterator = globalThis$b[ITERATOR$4];
1651
-
1652
- // FF56- have non-standard global helper `Iterator`
1653
- var FORCED$4 = !isCallable$9(NativeIterator)
1654
- || NativeIterator.prototype !== IteratorPrototype$1
1655
- // FF44- non-standard `Iterator` passes previous tests
1656
- || !fails$7(function () { NativeIterator({}); });
1657
-
1658
- var IteratorConstructor = function Iterator() {
1659
- anInstance$1(this, IteratorPrototype$1);
1660
- if (getPrototypeOf(this) === IteratorPrototype$1) throw new $TypeError$9('Abstract class Iterator not directly constructable');
1661
- };
1662
-
1663
- var defineIteratorPrototypeAccessor = function (key, value) {
1664
- if (DESCRIPTORS$5) {
1665
- defineBuiltInAccessor$1(IteratorPrototype$1, key, {
1666
- configurable: true,
1667
- get: function () {
1668
- return value;
1669
- },
1670
- set: function (replacement) {
1671
- anObject$a(this);
1672
- if (this === IteratorPrototype$1) throw new $TypeError$9("You can't redefine this property");
1673
- if (hasOwn$2(this, key)) this[key] = replacement;
1674
- else createProperty$1(this, key, replacement);
1675
- }
1676
- });
1677
- } else IteratorPrototype$1[key] = value;
1678
- };
1679
-
1680
- if (!hasOwn$2(IteratorPrototype$1, TO_STRING_TAG$3)) defineIteratorPrototypeAccessor(TO_STRING_TAG$3, ITERATOR$4);
1681
-
1682
- if (FORCED$4 || !hasOwn$2(IteratorPrototype$1, CONSTRUCTOR) || IteratorPrototype$1[CONSTRUCTOR] === Object) {
1683
- defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
1684
- }
1685
-
1686
- IteratorConstructor.prototype = IteratorPrototype$1;
1687
-
1688
- // `Iterator` constructor
1689
- // https://tc39.es/ecma262/#sec-iterator
1690
- $$g({ global: true, constructor: true, forced: FORCED$4 }, {
1691
- Iterator: IteratorConstructor
1692
- });
1693
-
1694
- // `GetIteratorDirect(obj)` abstract operation
1695
- // https://tc39.es/ecma262/#sec-getiteratordirect
1696
- var getIteratorDirect$4 = function (obj) {
1697
- return {
1698
- iterator: obj,
1699
- next: obj.next,
1700
- done: false
1701
- };
1702
- };
1703
-
1704
- var defineBuiltIn$2 = defineBuiltIn$6;
1705
-
1706
- var defineBuiltIns$1 = function (target, src, options) {
1707
- for (var key in src) defineBuiltIn$2(target, key, src[key], options);
1708
- return target;
1709
- };
1710
-
1711
- var call$c = functionCall;
1712
- var anObject$9 = anObject$f;
1713
- var getMethod$2 = getMethod$4;
1714
-
1715
- var iteratorClose$8 = function (iterator, kind, value) {
1716
- var innerResult, innerError;
1717
- anObject$9(iterator);
1718
- try {
1719
- innerResult = getMethod$2(iterator, 'return');
1720
- if (!innerResult) {
1721
- if (kind === 'throw') throw value;
1722
- return value;
1723
- }
1724
- innerResult = call$c(innerResult, iterator);
1725
- } catch (error) {
1726
- innerError = true;
1727
- innerResult = error;
1728
- }
1729
- if (kind === 'throw') throw value;
1730
- if (innerError) throw innerResult;
1731
- anObject$9(innerResult);
1732
- return value;
1733
- };
1734
-
1735
- var iteratorClose$7 = iteratorClose$8;
1736
-
1737
- var iteratorCloseAll$1 = function (iters, kind, value) {
1738
- for (var i = iters.length - 1; i >= 0; i--) {
1739
- if (iters[i] === undefined) continue;
1740
- try {
1741
- value = iteratorClose$7(iters[i].iterator, kind, value);
1742
- } catch (error) {
1743
- kind = 'throw';
1744
- value = error;
1745
- }
1746
- }
1747
- if (kind === 'throw') throw value;
1748
- return value;
1749
- };
1750
-
1751
- var call$b = functionCall;
1752
- var create = objectCreate;
1753
- var createNonEnumerableProperty$4 = createNonEnumerableProperty$8;
1754
- var defineBuiltIns = defineBuiltIns$1;
1755
- var wellKnownSymbol$b = wellKnownSymbol$i;
1756
- var InternalStateModule$1 = internalState;
1757
- var getMethod$1 = getMethod$4;
1758
- var IteratorPrototype = iteratorsCore.IteratorPrototype;
1759
- var createIterResultObject = createIterResultObject$2;
1760
- var iteratorClose$6 = iteratorClose$8;
1761
- var iteratorCloseAll = iteratorCloseAll$1;
1762
-
1763
- var TO_STRING_TAG$2 = wellKnownSymbol$b('toStringTag');
1764
- var ITERATOR_HELPER = 'IteratorHelper';
1765
- var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
1766
- var NORMAL = 'normal';
1767
- var THROW = 'throw';
1768
- var setInternalState$1 = InternalStateModule$1.set;
1769
-
1770
- var createIteratorProxyPrototype = function (IS_ITERATOR) {
1771
- var getInternalState = InternalStateModule$1.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
1772
-
1773
- return defineBuiltIns(create(IteratorPrototype), {
1774
- next: function next() {
1775
- var state = getInternalState(this);
1776
- // for simplification:
1777
- // for `%WrapForValidIteratorPrototype%.next` or with `state.returnHandlerResult` our `nextHandler` returns `IterResultObject`
1778
- // for `%IteratorHelperPrototype%.next` - just a value
1779
- if (IS_ITERATOR) return state.nextHandler();
1780
- if (state.done) return createIterResultObject(undefined, true);
1781
- try {
1782
- var result = state.nextHandler();
1783
- return state.returnHandlerResult ? result : createIterResultObject(result, state.done);
1784
- } catch (error) {
1785
- state.done = true;
1786
- throw error;
1787
- }
1788
- },
1789
- 'return': function () {
1790
- var state = getInternalState(this);
1791
- var iterator = state.iterator;
1792
- state.done = true;
1793
- if (IS_ITERATOR) {
1794
- var returnMethod = getMethod$1(iterator, 'return');
1795
- return returnMethod ? call$b(returnMethod, iterator) : createIterResultObject(undefined, true);
1796
- }
1797
- if (state.inner) try {
1798
- iteratorClose$6(state.inner.iterator, NORMAL);
1799
- } catch (error) {
1800
- return iteratorClose$6(iterator, THROW, error);
1801
- }
1802
- if (state.openIters) try {
1803
- iteratorCloseAll(state.openIters, NORMAL);
1804
- } catch (error) {
1805
- return iteratorClose$6(iterator, THROW, error);
1806
- }
1807
- if (iterator) iteratorClose$6(iterator, NORMAL);
1808
- return createIterResultObject(undefined, true);
1809
- }
1810
- });
1811
- };
1812
-
1813
- var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
1814
- var IteratorHelperPrototype = createIteratorProxyPrototype(false);
1815
-
1816
- createNonEnumerableProperty$4(IteratorHelperPrototype, TO_STRING_TAG$2, 'Iterator Helper');
1817
-
1818
- var iteratorCreateProxy = function (nextHandler, IS_ITERATOR, RETURN_HANDLER_RESULT) {
1819
- var IteratorProxy = function Iterator(record, state) {
1820
- if (state) {
1821
- state.iterator = record.iterator;
1822
- state.next = record.next;
1823
- } else state = record;
1824
- state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
1825
- state.returnHandlerResult = !!RETURN_HANDLER_RESULT;
1826
- state.nextHandler = nextHandler;
1827
- state.counter = 0;
1828
- state.done = false;
1829
- setInternalState$1(this, state);
1830
- };
1831
-
1832
- IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
1833
-
1834
- return IteratorProxy;
1835
- };
1836
-
1837
- var anObject$8 = anObject$f;
1838
- var iteratorClose$5 = iteratorClose$8;
1839
-
1840
- // call something on iterator step with safe closing on error
1841
- var callWithSafeIterationClosing$2 = function (iterator, fn, value, ENTRIES) {
1842
- try {
1843
- return ENTRIES ? fn(anObject$8(value)[0], value[1]) : fn(value);
1844
- } catch (error) {
1845
- iteratorClose$5(iterator, 'throw', error);
1846
- }
1847
- };
1848
-
1849
- // Should throw an error on invalid iterator
1850
- // https://issues.chromium.org/issues/336839115
1851
- var iteratorHelperThrowsOnInvalidIterator$2 = function (methodName, argument) {
1852
- // eslint-disable-next-line es/no-iterator -- required for testing
1853
- var method = typeof Iterator == 'function' && Iterator.prototype[methodName];
1854
- if (method) try {
1855
- method.call({ next: null }, argument).next();
1856
- } catch (error) {
1857
- return true;
1858
- }
1859
- };
1860
-
1861
- var globalThis$a = globalThis_1;
1862
-
1863
- // https://github.com/tc39/ecma262/pull/3467
1864
- var iteratorHelperWithoutClosingOnEarlyError$4 = function (METHOD_NAME, ExpectedError) {
1865
- var Iterator = globalThis$a.Iterator;
1866
- var IteratorPrototype = Iterator && Iterator.prototype;
1867
- var method = IteratorPrototype && IteratorPrototype[METHOD_NAME];
1868
-
1869
- var CLOSED = false;
1870
-
1871
- if (method) try {
1872
- method.call({
1873
- next: function () { return { done: true }; },
1874
- 'return': function () { CLOSED = true; }
1875
- }, -1);
1876
- } catch (error) {
1877
- // https://bugs.webkit.org/show_bug.cgi?id=291195
1878
- if (!(error instanceof ExpectedError)) CLOSED = false;
1879
- }
1880
-
1881
- if (!CLOSED) return method;
1882
- };
1883
-
1884
- var $$f = _export;
1885
- var call$a = functionCall;
1886
- var aCallable$9 = aCallable$d;
1887
- var anObject$7 = anObject$f;
1888
- var getIteratorDirect$3 = getIteratorDirect$4;
1889
- var createIteratorProxy$1 = iteratorCreateProxy;
1890
- var callWithSafeIterationClosing$1 = callWithSafeIterationClosing$2;
1891
- var iteratorClose$4 = iteratorClose$8;
1892
- var iteratorHelperThrowsOnInvalidIterator$1 = iteratorHelperThrowsOnInvalidIterator$2;
1893
- var iteratorHelperWithoutClosingOnEarlyError$3 = iteratorHelperWithoutClosingOnEarlyError$4;
1894
-
1895
- var FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR = !iteratorHelperThrowsOnInvalidIterator$1('filter', function () { /* empty */ });
1896
- var filterWithoutClosingOnEarlyError = !FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR
1897
- && iteratorHelperWithoutClosingOnEarlyError$3('filter', TypeError);
1898
-
1899
- var FORCED$3 = FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR || filterWithoutClosingOnEarlyError;
1900
-
1901
- var IteratorProxy$1 = createIteratorProxy$1(function () {
1902
- var iterator = this.iterator;
1903
- var predicate = this.predicate;
1904
- var next = this.next;
1905
- var result, done, value;
1906
- while (true) {
1907
- result = anObject$7(call$a(next, iterator));
1908
- done = this.done = !!result.done;
1909
- if (done) return;
1910
- value = result.value;
1911
- if (callWithSafeIterationClosing$1(iterator, predicate, [value, this.counter++], true)) return value;
1912
- }
1913
- });
1914
-
1915
- // `Iterator.prototype.filter` method
1916
- // https://tc39.es/ecma262/#sec-iterator.prototype.filter
1917
- $$f({ target: 'Iterator', proto: true, real: true, forced: FORCED$3 }, {
1918
- filter: function filter(predicate) {
1919
- anObject$7(this);
1920
- try {
1921
- aCallable$9(predicate);
1922
- } catch (error) {
1923
- iteratorClose$4(this, 'throw', error);
1924
- }
1925
-
1926
- if (filterWithoutClosingOnEarlyError) return call$a(filterWithoutClosingOnEarlyError, this, predicate);
1927
-
1928
- return new IteratorProxy$1(getIteratorDirect$3(this), {
1929
- predicate: predicate
1930
- });
1931
- }
1932
- });
1933
-
1934
- var $$e = _export;
1935
- var call$9 = functionCall;
1936
- var aCallable$8 = aCallable$d;
1937
- var anObject$6 = anObject$f;
1938
- var getIteratorDirect$2 = getIteratorDirect$4;
1939
- var createIteratorProxy = iteratorCreateProxy;
1940
- var callWithSafeIterationClosing = callWithSafeIterationClosing$2;
1941
- var iteratorClose$3 = iteratorClose$8;
1942
- var iteratorHelperThrowsOnInvalidIterator = iteratorHelperThrowsOnInvalidIterator$2;
1943
- var iteratorHelperWithoutClosingOnEarlyError$2 = iteratorHelperWithoutClosingOnEarlyError$4;
1944
-
1945
- var MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !iteratorHelperThrowsOnInvalidIterator('map', function () { /* empty */ });
1946
- var mapWithoutClosingOnEarlyError = !MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR
1947
- && iteratorHelperWithoutClosingOnEarlyError$2('map', TypeError);
1948
-
1949
- var FORCED$2 = MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR || mapWithoutClosingOnEarlyError;
1950
-
1951
- var IteratorProxy = createIteratorProxy(function () {
1952
- var iterator = this.iterator;
1953
- var result = anObject$6(call$9(this.next, iterator));
1954
- var done = this.done = !!result.done;
1955
- if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
1956
- });
1957
-
1958
- // `Iterator.prototype.map` method
1959
- // https://tc39.es/ecma262/#sec-iterator.prototype.map
1960
- $$e({ target: 'Iterator', proto: true, real: true, forced: FORCED$2 }, {
1961
- map: function map(mapper) {
1962
- anObject$6(this);
1963
- try {
1964
- aCallable$8(mapper);
1965
- } catch (error) {
1966
- iteratorClose$3(this, 'throw', error);
1967
- }
1968
-
1969
- if (mapWithoutClosingOnEarlyError) return call$9(mapWithoutClosingOnEarlyError, this, mapper);
1970
-
1971
- return new IteratorProxy(getIteratorDirect$2(this), {
1972
- mapper: mapper
1973
- });
1974
- }
1975
- });
1976
-
1977
- var classofRaw$1 = classofRaw$2;
1978
- var uncurryThis$8 = functionUncurryThis;
1979
-
1980
- var functionUncurryThisClause = function (fn) {
1981
- // Nashorn bug:
1982
- // https://github.com/zloirock/core-js/issues/1128
1983
- // https://github.com/zloirock/core-js/issues/1130
1984
- if (classofRaw$1(fn) === 'Function') return uncurryThis$8(fn);
1985
- };
1986
-
1987
- var uncurryThis$7 = functionUncurryThisClause;
1988
- var aCallable$7 = aCallable$d;
1989
- var NATIVE_BIND$1 = functionBindNative;
1990
-
1991
- var bind$4 = uncurryThis$7(uncurryThis$7.bind);
1992
-
1993
- // optional / simple context binding
1994
- var functionBindContext = function (fn, that) {
1995
- aCallable$7(fn);
1996
- return that === undefined ? fn : NATIVE_BIND$1 ? bind$4(fn, that) : function (/* ...args */) {
1997
- return fn.apply(that, arguments);
1998
- };
1999
- };
2000
-
2001
- var wellKnownSymbol$a = wellKnownSymbol$i;
2002
- var Iterators$1 = iterators;
2003
-
2004
- var ITERATOR$3 = wellKnownSymbol$a('iterator');
2005
- var ArrayPrototype = Array.prototype;
2006
-
2007
- // check on default Array iterator
2008
- var isArrayIteratorMethod$1 = function (it) {
2009
- return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$3] === it);
2010
- };
2011
-
2012
- var wellKnownSymbol$9 = wellKnownSymbol$i;
2013
-
2014
- var TO_STRING_TAG$1 = wellKnownSymbol$9('toStringTag');
2015
- var test = {};
2016
-
2017
- test[TO_STRING_TAG$1] = 'z';
2018
-
2019
- var toStringTagSupport = String(test) === '[object z]';
2020
-
2021
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2022
- var isCallable$8 = isCallable$n;
2023
- var classofRaw = classofRaw$2;
2024
- var wellKnownSymbol$8 = wellKnownSymbol$i;
2025
-
2026
- var TO_STRING_TAG = wellKnownSymbol$8('toStringTag');
2027
- var $Object = Object;
2028
-
2029
- // ES3 wrong here
2030
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
2031
-
2032
- // fallback for IE11 Script Access Denied error
2033
- var tryGet = function (it, key) {
2034
- try {
2035
- return it[key];
2036
- } catch (error) { /* empty */ }
2037
- };
2038
-
2039
- // getting tag from ES6+ `Object.prototype.toString`
2040
- var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2041
- var O, tag, result;
2042
- return it === undefined ? 'Undefined' : it === null ? 'Null'
2043
- // @@toStringTag case
2044
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
2045
- // builtinTag case
2046
- : CORRECT_ARGUMENTS ? classofRaw(O)
2047
- // ES3 arguments fallback
2048
- : (result = classofRaw(O)) === 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
2049
- };
2050
-
2051
- var classof$5 = classof$6;
2052
- var getMethod = getMethod$4;
2053
- var isNullOrUndefined$1 = isNullOrUndefined$4;
2054
- var Iterators = iterators;
2055
- var wellKnownSymbol$7 = wellKnownSymbol$i;
2056
-
2057
- var ITERATOR$2 = wellKnownSymbol$7('iterator');
2058
-
2059
- var getIteratorMethod$2 = function (it) {
2060
- if (!isNullOrUndefined$1(it)) return getMethod(it, ITERATOR$2)
2061
- || getMethod(it, '@@iterator')
2062
- || Iterators[classof$5(it)];
2063
- };
2064
-
2065
- var call$8 = functionCall;
2066
- var aCallable$6 = aCallable$d;
2067
- var anObject$5 = anObject$f;
2068
- var tryToString$2 = tryToString$4;
2069
- var getIteratorMethod$1 = getIteratorMethod$2;
2070
-
2071
- var $TypeError$8 = TypeError;
2072
-
2073
- var getIterator$1 = function (argument, usingIterator) {
2074
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2075
- if (aCallable$6(iteratorMethod)) return anObject$5(call$8(iteratorMethod, argument));
2076
- throw new $TypeError$8(tryToString$2(argument) + ' is not iterable');
2077
- };
2078
-
2079
- var bind$3 = functionBindContext;
2080
- var call$7 = functionCall;
2081
- var anObject$4 = anObject$f;
2082
- var tryToString$1 = tryToString$4;
2083
- var isArrayIteratorMethod = isArrayIteratorMethod$1;
2084
- var lengthOfArrayLike$1 = lengthOfArrayLike$4;
2085
- var isPrototypeOf$1 = objectIsPrototypeOf;
2086
- var getIterator = getIterator$1;
2087
- var getIteratorMethod = getIteratorMethod$2;
2088
- var iteratorClose$2 = iteratorClose$8;
2089
-
2090
- var $TypeError$7 = TypeError;
2091
-
2092
- var Result = function (stopped, result) {
2093
- this.stopped = stopped;
2094
- this.result = result;
2095
- };
2096
-
2097
- var ResultPrototype = Result.prototype;
2098
-
2099
- var iterate$5 = function (iterable, unboundFunction, options) {
2100
- var that = options && options.that;
2101
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2102
- var IS_RECORD = !!(options && options.IS_RECORD);
2103
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2104
- var INTERRUPTED = !!(options && options.INTERRUPTED);
2105
- var fn = bind$3(unboundFunction, that);
2106
- var iterator, iterFn, index, length, result, next, step;
2107
-
2108
- var stop = function (condition) {
2109
- if (iterator) iteratorClose$2(iterator, 'normal');
2110
- return new Result(true, condition);
2111
- };
2112
-
2113
- var callFn = function (value) {
2114
- if (AS_ENTRIES) {
2115
- anObject$4(value);
2116
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2117
- } return INTERRUPTED ? fn(value, stop) : fn(value);
2118
- };
2119
-
2120
- if (IS_RECORD) {
2121
- iterator = iterable.iterator;
2122
- } else if (IS_ITERATOR) {
2123
- iterator = iterable;
2124
- } else {
2125
- iterFn = getIteratorMethod(iterable);
2126
- if (!iterFn) throw new $TypeError$7(tryToString$1(iterable) + ' is not iterable');
2127
- // optimisation for array iterators
2128
- if (isArrayIteratorMethod(iterFn)) {
2129
- for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
2130
- result = callFn(iterable[index]);
2131
- if (result && isPrototypeOf$1(ResultPrototype, result)) return result;
2132
- } return new Result(false);
2133
- }
2134
- iterator = getIterator(iterable, iterFn);
2135
- }
2136
-
2137
- next = IS_RECORD ? iterable.next : iterator.next;
2138
- while (!(step = call$7(next, iterator)).done) {
2139
- try {
2140
- result = callFn(step.value);
2141
- } catch (error) {
2142
- iteratorClose$2(iterator, 'throw', error);
2143
- }
2144
- if (typeof result == 'object' && result && isPrototypeOf$1(ResultPrototype, result)) return result;
2145
- } return new Result(false);
2146
- };
2147
-
2148
- var NATIVE_BIND = functionBindNative;
2149
-
2150
- var FunctionPrototype = Function.prototype;
2151
- var apply$4 = FunctionPrototype.apply;
2152
- var call$6 = FunctionPrototype.call;
2153
-
2154
- // eslint-disable-next-line es/no-function-prototype-bind, es/no-reflect -- safe
2155
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$6.bind(apply$4) : function () {
2156
- return call$6.apply(apply$4, arguments);
2157
- });
2158
-
2159
- var $$d = _export;
2160
- var iterate$4 = iterate$5;
2161
- var aCallable$5 = aCallable$d;
2162
- var anObject$3 = anObject$f;
2163
- var getIteratorDirect$1 = getIteratorDirect$4;
2164
- var iteratorClose$1 = iteratorClose$8;
2165
- var iteratorHelperWithoutClosingOnEarlyError$1 = iteratorHelperWithoutClosingOnEarlyError$4;
2166
- var apply$3 = functionApply;
2167
- var fails$6 = fails$k;
2168
-
2169
- var $TypeError$6 = TypeError;
2170
-
2171
- // https://bugs.webkit.org/show_bug.cgi?id=291651
2172
- var FAILS_ON_INITIAL_UNDEFINED = fails$6(function () {
2173
- // eslint-disable-next-line es/no-iterator-prototype-reduce, es/no-array-prototype-keys, array-callback-return -- required for testing
2174
- [].keys().reduce(function () { /* empty */ }, undefined);
2175
- });
2176
-
2177
- var reduceWithoutClosingOnEarlyError = !FAILS_ON_INITIAL_UNDEFINED && iteratorHelperWithoutClosingOnEarlyError$1('reduce', $TypeError$6);
2178
-
2179
- // `Iterator.prototype.reduce` method
2180
- // https://tc39.es/ecma262/#sec-iterator.prototype.reduce
2181
- $$d({ target: 'Iterator', proto: true, real: true, forced: FAILS_ON_INITIAL_UNDEFINED || reduceWithoutClosingOnEarlyError }, {
2182
- reduce: function reduce(reducer /* , initialValue */) {
2183
- anObject$3(this);
2184
- try {
2185
- aCallable$5(reducer);
2186
- } catch (error) {
2187
- iteratorClose$1(this, 'throw', error);
2188
- }
2189
-
2190
- var noInitial = arguments.length < 2;
2191
- var accumulator = noInitial ? undefined : arguments[1];
2192
- if (reduceWithoutClosingOnEarlyError) {
2193
- return apply$3(reduceWithoutClosingOnEarlyError, this, noInitial ? [reducer] : [reducer, accumulator]);
2194
- }
2195
- var record = getIteratorDirect$1(this);
2196
- var counter = 0;
2197
- iterate$4(record, function (value) {
2198
- if (noInitial) {
2199
- noInitial = false;
2200
- accumulator = value;
2201
- } else {
2202
- accumulator = reducer(accumulator, value, counter);
2203
- }
2204
- counter++;
2205
- }, { IS_RECORD: true });
2206
- if (noInitial) throw new $TypeError$6('Reduce of empty iterator with no initial value');
2207
- return accumulator;
2208
- }
2209
- });
2210
-
2211
- var uncurryThis$6 = functionUncurryThis;
2212
-
2213
- var arraySlice$2 = uncurryThis$6([].slice);
2214
-
2215
- var classof$4 = classofRaw$2;
2216
-
2217
- // `IsArray` abstract operation
2218
- // https://tc39.es/ecma262/#sec-isarray
2219
- // eslint-disable-next-line es/no-array-isarray -- safe
2220
- var isArray$2 = Array.isArray || function isArray(argument) {
2221
- return classof$4(argument) === 'Array';
2222
- };
2223
-
2224
- var classof$3 = classof$6;
2225
-
2226
- var $String$1 = String;
2227
-
2228
- var toString$3 = function (argument) {
2229
- if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
2230
- return $String$1(argument);
2231
- };
2232
-
2233
- var uncurryThis$5 = functionUncurryThis;
2234
- var isArray$1 = isArray$2;
2235
- var isCallable$7 = isCallable$n;
2236
- var classof$2 = classofRaw$2;
2237
- var toString$2 = toString$3;
2238
-
2239
- var push = uncurryThis$5([].push);
2240
-
2241
- var getJsonReplacerFunction = function (replacer) {
2242
- if (isCallable$7(replacer)) return replacer;
2243
- if (!isArray$1(replacer)) return;
2244
- var rawLength = replacer.length;
2245
- var keys = [];
2246
- for (var i = 0; i < rawLength; i++) {
2247
- var element = replacer[i];
2248
- if (typeof element == 'string') push(keys, element);
2249
- else if (typeof element == 'number' || classof$2(element) === 'Number' || classof$2(element) === 'String') push(keys, toString$2(element));
2250
- }
2251
- var keysLength = keys.length;
2252
- var root = true;
2253
- return function (key, value) {
2254
- if (root) {
2255
- root = false;
2256
- return value;
2257
- }
2258
- if (isArray$1(this)) return value;
2259
- for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
2260
- };
2261
- };
2262
-
2263
- var $$c = _export;
2264
- var getBuiltIn$5 = getBuiltIn$9;
2265
- var apply$2 = functionApply;
2266
- var call$5 = functionCall;
2267
- var uncurryThis$4 = functionUncurryThis;
2268
- var fails$5 = fails$k;
2269
- var isCallable$6 = isCallable$n;
2270
- var isSymbol = isSymbol$3;
2271
- var arraySlice$1 = arraySlice$2;
2272
- var getReplacerFunction = getJsonReplacerFunction;
2273
- var NATIVE_SYMBOL = symbolConstructorDetection;
2274
-
2275
- var $String = String;
2276
- var $stringify = getBuiltIn$5('JSON', 'stringify');
2277
- var exec$1 = uncurryThis$4(/./.exec);
2278
- var charAt = uncurryThis$4(''.charAt);
2279
- var charCodeAt = uncurryThis$4(''.charCodeAt);
2280
- var replace$1 = uncurryThis$4(''.replace);
2281
- var numberToString = uncurryThis$4(1.1.toString);
2282
-
2283
- var tester = /[\uD800-\uDFFF]/g;
2284
- var low = /^[\uD800-\uDBFF]$/;
2285
- var hi = /^[\uDC00-\uDFFF]$/;
2286
-
2287
- var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$5(function () {
2288
- var symbol = getBuiltIn$5('Symbol')('stringify detection');
2289
- // MS Edge converts symbol values to JSON as {}
2290
- return $stringify([symbol]) !== '[null]'
2291
- // WebKit converts symbol values to JSON as null
2292
- || $stringify({ a: symbol }) !== '{}'
2293
- // V8 throws on boxed symbols
2294
- || $stringify(Object(symbol)) !== '{}';
2295
- });
2296
-
2297
- // https://github.com/tc39/proposal-well-formed-stringify
2298
- var ILL_FORMED_UNICODE = fails$5(function () {
2299
- return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
2300
- || $stringify('\uDEAD') !== '"\\udead"';
2301
- });
2302
-
2303
- var stringifyWithSymbolsFix = function (it, replacer) {
2304
- var args = arraySlice$1(arguments);
2305
- var $replacer = getReplacerFunction(replacer);
2306
- if (!isCallable$6($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
2307
- args[1] = function (key, value) {
2308
- // some old implementations (like WebKit) could pass numbers as keys
2309
- if (isCallable$6($replacer)) value = call$5($replacer, this, $String(key), value);
2310
- if (!isSymbol(value)) return value;
2311
- };
2312
- return apply$2($stringify, null, args);
2313
- };
2314
-
2315
- var fixIllFormed = function (match, offset, string) {
2316
- var prev = charAt(string, offset - 1);
2317
- var next = charAt(string, offset + 1);
2318
- if ((exec$1(low, match) && !exec$1(hi, next)) || (exec$1(hi, match) && !exec$1(low, prev))) {
2319
- return '\\u' + numberToString(charCodeAt(match, 0), 16);
2320
- } return match;
2321
- };
2322
-
2323
- if ($stringify) {
2324
- // `JSON.stringify` method
2325
- // https://tc39.es/ecma262/#sec-json.stringify
2326
- $$c({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
2327
- // eslint-disable-next-line no-unused-vars -- required for `.length`
2328
- stringify: function stringify(it, replacer, space) {
2329
- var args = arraySlice$1(arguments);
2330
- var result = apply$2(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
2331
- return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$1(result, tester, fixIllFormed) : result;
2332
- }
2333
- });
2334
- }
2335
-
2336
- var DESCRIPTORS$4 = descriptors;
2337
- var uncurryThis$3 = functionUncurryThis;
2338
- var call$4 = functionCall;
2339
- var fails$4 = fails$k;
2340
- var objectKeys = objectKeys$2;
2341
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2342
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2343
- var toObject$1 = toObject$5;
2344
- var IndexedObject = indexedObject;
2345
-
2346
- // eslint-disable-next-line es/no-object-assign -- safe
2347
- var $assign = Object.assign;
2348
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2349
- var defineProperty$1 = Object.defineProperty;
2350
- var concat = uncurryThis$3([].concat);
2351
-
2352
- // `Object.assign` method
2353
- // https://tc39.es/ecma262/#sec-object.assign
2354
- var objectAssign = !$assign || fails$4(function () {
2355
- // should have correct order of operations (Edge bug)
2356
- if (DESCRIPTORS$4 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
2357
- enumerable: true,
2358
- get: function () {
2359
- defineProperty$1(this, 'b', {
2360
- value: 3,
2361
- enumerable: false
2362
- });
2363
- }
2364
- }), { b: 2 })).b !== 1) return true;
2365
- // should work with symbols and should have deterministic property order (V8 bug)
2366
- var A = {};
2367
- var B = {};
2368
- // eslint-disable-next-line es/no-symbol -- safe
2369
- var symbol = Symbol('assign detection');
2370
- var alphabet = 'abcdefghijklmnopqrst';
2371
- A[symbol] = 7;
2372
- // eslint-disable-next-line es/no-array-prototype-foreach -- safe
2373
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2374
- return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
2375
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2376
- var T = toObject$1(target);
2377
- var argumentsLength = arguments.length;
2378
- var index = 1;
2379
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2380
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
2381
- while (argumentsLength > index) {
2382
- var S = IndexedObject(arguments[index++]);
2383
- var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2384
- var length = keys.length;
2385
- var j = 0;
2386
- var key;
2387
- while (length > j) {
2388
- key = keys[j++];
2389
- if (!DESCRIPTORS$4 || call$4(propertyIsEnumerable, S, key)) T[key] = S[key];
2390
- }
2391
- } return T;
2392
- } : $assign;
2393
-
2394
- var $$b = _export;
2395
- var assign = objectAssign;
2396
-
2397
- // `Object.assign` method
2398
- // https://tc39.es/ecma262/#sec-object.assign
2399
- // eslint-disable-next-line es/no-object-assign -- required for testing
2400
- $$b({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2401
- assign: assign
2402
- });
2403
-
2404
- var $$a = _export;
2405
- var iterate$3 = iterate$5;
2406
- var createProperty = createProperty$2;
2407
-
2408
- // `Object.fromEntries` method
2409
- // https://tc39.es/ecma262/#sec-object.fromentries
2410
- $$a({ target: 'Object', stat: true }, {
2411
- fromEntries: function fromEntries(iterable) {
2412
- var obj = {};
2413
- iterate$3(iterable, function (k, v) {
2414
- createProperty(obj, k, v);
2415
- }, { AS_ENTRIES: true });
2416
- return obj;
2417
- }
2418
- });
2419
-
2420
- var globalThis$9 = globalThis_1;
2421
-
2422
- var path$1 = globalThis$9;
2423
-
2424
- var getBuiltIn$4 = getBuiltIn$9;
2425
- var defineBuiltInAccessor = defineBuiltInAccessor$2;
2426
- var wellKnownSymbol$6 = wellKnownSymbol$i;
2427
- var DESCRIPTORS$3 = descriptors;
2428
-
2429
- var SPECIES$2 = wellKnownSymbol$6('species');
2430
-
2431
- var setSpecies$1 = function (CONSTRUCTOR_NAME) {
2432
- var Constructor = getBuiltIn$4(CONSTRUCTOR_NAME);
2433
-
2434
- if (DESCRIPTORS$3 && Constructor && !Constructor[SPECIES$2]) {
2435
- defineBuiltInAccessor(Constructor, SPECIES$2, {
2436
- configurable: true,
2437
- get: function () { return this; }
2438
- });
2439
- }
2440
- };
2441
-
2442
- var uncurryThis$2 = functionUncurryThis;
2443
- var fails$3 = fails$k;
2444
- var isCallable$5 = isCallable$n;
2445
- var classof$1 = classof$6;
2446
- var getBuiltIn$3 = getBuiltIn$9;
2447
- var inspectSource$1 = inspectSource$3;
2448
-
2449
- var noop = function () { /* empty */ };
2450
- var construct = getBuiltIn$3('Reflect', 'construct');
2451
- var constructorRegExp = /^\s*(?:class|function)\b/;
2452
- var exec = uncurryThis$2(constructorRegExp.exec);
2453
- var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
2454
-
2455
- var isConstructorModern = function isConstructor(argument) {
2456
- if (!isCallable$5(argument)) return false;
2457
- try {
2458
- construct(noop, [], argument);
2459
- return true;
2460
- } catch (error) {
2461
- return false;
2462
- }
2463
- };
2464
-
2465
- var isConstructorLegacy = function isConstructor(argument) {
2466
- if (!isCallable$5(argument)) return false;
2467
- switch (classof$1(argument)) {
2468
- case 'AsyncFunction':
2469
- case 'GeneratorFunction':
2470
- case 'AsyncGeneratorFunction': return false;
2471
- }
2472
- try {
2473
- // we can't check .prototype since constructors produced by .bind haven't it
2474
- // `Function#toString` throws on some built-it function in some legacy engines
2475
- // (for example, `DOMQuad` and similar in FF41-)
2476
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
2477
- } catch (error) {
2478
- return true;
2479
- }
2480
- };
2481
-
2482
- isConstructorLegacy.sham = true;
2483
-
2484
- // `IsConstructor` abstract operation
2485
- // https://tc39.es/ecma262/#sec-isconstructor
2486
- var isConstructor$1 = !construct || fails$3(function () {
2487
- var called;
2488
- return isConstructorModern(isConstructorModern.call)
2489
- || !isConstructorModern(Object)
2490
- || !isConstructorModern(function () { called = true; })
2491
- || called;
2492
- }) ? isConstructorLegacy : isConstructorModern;
2493
-
2494
- var isConstructor = isConstructor$1;
2495
- var tryToString = tryToString$4;
2496
-
2497
- var $TypeError$5 = TypeError;
2498
-
2499
- // `Assert: IsConstructor(argument) is true`
2500
- var aConstructor$1 = function (argument) {
2501
- if (isConstructor(argument)) return argument;
2502
- throw new $TypeError$5(tryToString(argument) + ' is not a constructor');
2503
- };
2504
-
2505
- var anObject$2 = anObject$f;
2506
- var aConstructor = aConstructor$1;
2507
- var isNullOrUndefined = isNullOrUndefined$4;
2508
- var wellKnownSymbol$5 = wellKnownSymbol$i;
2509
-
2510
- var SPECIES$1 = wellKnownSymbol$5('species');
2511
-
2512
- // `SpeciesConstructor` abstract operation
2513
- // https://tc39.es/ecma262/#sec-speciesconstructor
2514
- var speciesConstructor$1 = function (O, defaultConstructor) {
2515
- var C = anObject$2(O).constructor;
2516
- var S;
2517
- return C === undefined || isNullOrUndefined(S = anObject$2(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
2518
- };
2519
-
2520
- var $TypeError$4 = TypeError;
2521
-
2522
- var validateArgumentsLength$1 = function (passed, required) {
2523
- if (passed < required) throw new $TypeError$4('Not enough arguments');
2524
- return passed;
2525
- };
2526
-
2527
- var userAgent$2 = environmentUserAgent;
2528
-
2529
- // eslint-disable-next-line redos/no-vulnerable -- safe
2530
- var environmentIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
2531
-
2532
- var globalThis$8 = globalThis_1;
2533
- var apply$1 = functionApply;
2534
- var bind$2 = functionBindContext;
2535
- var isCallable$4 = isCallable$n;
2536
- var hasOwn$1 = hasOwnProperty_1;
2537
- var fails$2 = fails$k;
2538
- var html = html$2;
2539
- var arraySlice = arraySlice$2;
2540
- var createElement = documentCreateElement$2;
2541
- var validateArgumentsLength = validateArgumentsLength$1;
2542
- var IS_IOS$1 = environmentIsIos;
2543
- var IS_NODE$2 = environmentIsNode;
2544
-
2545
- var set = globalThis$8.setImmediate;
2546
- var clear = globalThis$8.clearImmediate;
2547
- var process$2 = globalThis$8.process;
2548
- var Dispatch = globalThis$8.Dispatch;
2549
- var Function$1 = globalThis$8.Function;
2550
- var MessageChannel = globalThis$8.MessageChannel;
2551
- var String$1 = globalThis$8.String;
2552
- var counter = 0;
2553
- var queue$2 = {};
2554
- var ONREADYSTATECHANGE = 'onreadystatechange';
2555
- var $location, defer, channel, port;
2556
-
2557
- fails$2(function () {
2558
- // Deno throws a ReferenceError on `location` access without `--location` flag
2559
- $location = globalThis$8.location;
2560
- });
2561
-
2562
- var run = function (id) {
2563
- if (hasOwn$1(queue$2, id)) {
2564
- var fn = queue$2[id];
2565
- delete queue$2[id];
2566
- fn();
2567
- }
2568
- };
2569
-
2570
- var runner = function (id) {
2571
- return function () {
2572
- run(id);
2573
- };
2574
- };
2575
-
2576
- var eventListener = function (event) {
2577
- run(event.data);
2578
- };
2579
-
2580
- var globalPostMessageDefer = function (id) {
2581
- // old engines have not location.origin
2582
- globalThis$8.postMessage(String$1(id), $location.protocol + '//' + $location.host);
2583
- };
2584
-
2585
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
2586
- if (!set || !clear) {
2587
- set = function setImmediate(handler) {
2588
- validateArgumentsLength(arguments.length, 1);
2589
- var fn = isCallable$4(handler) ? handler : Function$1(handler);
2590
- var args = arraySlice(arguments, 1);
2591
- queue$2[++counter] = function () {
2592
- apply$1(fn, undefined, args);
2593
- };
2594
- defer(counter);
2595
- return counter;
2596
- };
2597
- clear = function clearImmediate(id) {
2598
- delete queue$2[id];
2599
- };
2600
- // Node.js 0.8-
2601
- if (IS_NODE$2) {
2602
- defer = function (id) {
2603
- process$2.nextTick(runner(id));
2604
- };
2605
- // Sphere (JS game engine) Dispatch API
2606
- } else if (Dispatch && Dispatch.now) {
2607
- defer = function (id) {
2608
- Dispatch.now(runner(id));
2609
- };
2610
- // Browsers with MessageChannel, includes WebWorkers
2611
- // except iOS - https://github.com/zloirock/core-js/issues/624
2612
- } else if (MessageChannel && !IS_IOS$1) {
2613
- channel = new MessageChannel();
2614
- port = channel.port2;
2615
- channel.port1.onmessage = eventListener;
2616
- defer = bind$2(port.postMessage, port);
2617
- // Browsers with postMessage, skip WebWorkers
2618
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
2619
- } else if (
2620
- globalThis$8.addEventListener &&
2621
- isCallable$4(globalThis$8.postMessage) &&
2622
- !globalThis$8.importScripts &&
2623
- $location && $location.protocol !== 'file:' &&
2624
- !fails$2(globalPostMessageDefer)
2625
- ) {
2626
- defer = globalPostMessageDefer;
2627
- globalThis$8.addEventListener('message', eventListener, false);
2628
- // IE8-
2629
- } else if (ONREADYSTATECHANGE in createElement('script')) {
2630
- defer = function (id) {
2631
- html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
2632
- html.removeChild(this);
2633
- run(id);
2634
- };
2635
- };
2636
- // Rest old browsers
2637
- } else {
2638
- defer = function (id) {
2639
- setTimeout(runner(id), 0);
2640
- };
2641
- }
2642
- }
2643
-
2644
- var task$1 = {
2645
- set: set};
2646
-
2647
- var globalThis$7 = globalThis_1;
2648
- var DESCRIPTORS$2 = descriptors;
2649
-
2650
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2651
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
2652
-
2653
- // Avoid NodeJS experimental warning
2654
- var safeGetBuiltIn$1 = function (name) {
2655
- if (!DESCRIPTORS$2) return globalThis$7[name];
2656
- var descriptor = getOwnPropertyDescriptor$1(globalThis$7, name);
2657
- return descriptor && descriptor.value;
2658
- };
2659
-
2660
- var Queue$2 = function () {
2661
- this.head = null;
2662
- this.tail = null;
2663
- };
2664
-
2665
- Queue$2.prototype = {
2666
- add: function (item) {
2667
- var entry = { item: item, next: null };
2668
- var tail = this.tail;
2669
- if (tail) tail.next = entry;
2670
- else this.head = entry;
2671
- this.tail = entry;
2672
- },
2673
- get: function () {
2674
- var entry = this.head;
2675
- if (entry) {
2676
- var next = this.head = entry.next;
2677
- if (next === null) this.tail = null;
2678
- return entry.item;
2679
- }
2680
- }
2681
- };
2682
-
2683
- var queue$1 = Queue$2;
2684
-
2685
- var userAgent$1 = environmentUserAgent;
2686
-
2687
- var environmentIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && typeof Pebble != 'undefined';
2688
-
2689
- var userAgent = environmentUserAgent;
2690
-
2691
- var environmentIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
2692
-
2693
- var globalThis$6 = globalThis_1;
2694
- var safeGetBuiltIn = safeGetBuiltIn$1;
2695
- var bind$1 = functionBindContext;
2696
- var macrotask = task$1.set;
2697
- var Queue$1 = queue$1;
2698
- var IS_IOS = environmentIsIos;
2699
- var IS_IOS_PEBBLE = environmentIsIosPebble;
2700
- var IS_WEBOS_WEBKIT = environmentIsWebosWebkit;
2701
- var IS_NODE$1 = environmentIsNode;
2702
-
2703
- var MutationObserver = globalThis$6.MutationObserver || globalThis$6.WebKitMutationObserver;
2704
- var document$2 = globalThis$6.document;
2705
- var process$1 = globalThis$6.process;
2706
- var Promise$1 = globalThis$6.Promise;
2707
- var microtask$1 = safeGetBuiltIn('queueMicrotask');
2708
- var notify$1, toggle, node, promise, then;
2709
-
2710
- // modern engines have queueMicrotask method
2711
- if (!microtask$1) {
2712
- var queue = new Queue$1();
2713
-
2714
- var flush = function () {
2715
- var parent, fn;
2716
- if (IS_NODE$1 && (parent = process$1.domain)) parent.exit();
2717
- while (fn = queue.get()) try {
2718
- fn();
2719
- } catch (error) {
2720
- if (queue.head) notify$1();
2721
- throw error;
2722
- }
2723
- if (parent) parent.enter();
2724
- };
2725
-
2726
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
2727
- // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
2728
- if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
2729
- toggle = true;
2730
- node = document$2.createTextNode('');
2731
- new MutationObserver(flush).observe(node, { characterData: true });
2732
- notify$1 = function () {
2733
- node.data = toggle = !toggle;
2734
- };
2735
- // environments with maybe non-completely correct, but existent Promise
2736
- } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
2737
- // Promise.resolve without an argument throws an error in LG WebOS 2
2738
- promise = Promise$1.resolve(undefined);
2739
- // workaround of WebKit ~ iOS Safari 10.1 bug
2740
- promise.constructor = Promise$1;
2741
- then = bind$1(promise.then, promise);
2742
- notify$1 = function () {
2743
- then(flush);
2744
- };
2745
- // Node.js without promises
2746
- } else if (IS_NODE$1) {
2747
- notify$1 = function () {
2748
- process$1.nextTick(flush);
2749
- };
2750
- // for other environments - macrotask based on:
2751
- // - setImmediate
2752
- // - MessageChannel
2753
- // - window.postMessage
2754
- // - onreadystatechange
2755
- // - setTimeout
2756
- } else {
2757
- // `webpack` dev server bug on IE global methods - use bind(fn, global)
2758
- macrotask = bind$1(macrotask, globalThis$6);
2759
- notify$1 = function () {
2760
- macrotask(flush);
2761
- };
2762
- }
2763
-
2764
- microtask$1 = function (fn) {
2765
- if (!queue.head) notify$1();
2766
- queue.add(fn);
2767
- };
2768
- }
2769
-
2770
- var microtask_1 = microtask$1;
2771
-
2772
- var hostReportErrors$1 = function (a, b) {
2773
- try {
2774
- // eslint-disable-next-line no-console -- safe
2775
- arguments.length === 1 ? console.error(a) : console.error(a, b);
2776
- } catch (error) { /* empty */ }
2777
- };
2778
-
2779
- var perform$3 = function (exec) {
2780
- try {
2781
- return { error: false, value: exec() };
2782
- } catch (error) {
2783
- return { error: true, value: error };
2784
- }
2785
- };
2786
-
2787
- var globalThis$5 = globalThis_1;
2788
-
2789
- var promiseNativeConstructor = globalThis$5.Promise;
2790
-
2791
- var globalThis$4 = globalThis_1;
2792
- var NativePromiseConstructor$3 = promiseNativeConstructor;
2793
- var isCallable$3 = isCallable$n;
2794
- var isForced = isForced_1;
2795
- var inspectSource = inspectSource$3;
2796
- var wellKnownSymbol$4 = wellKnownSymbol$i;
2797
- var ENVIRONMENT = environment;
2798
- var V8_VERSION = environmentV8Version;
2799
-
2800
- NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
2801
- var SPECIES = wellKnownSymbol$4('species');
2802
- var SUBCLASSING = false;
2803
- var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$3(globalThis$4.PromiseRejectionEvent);
2804
-
2805
- var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
2806
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
2807
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
2808
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
2809
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
2810
- // We can't detect it synchronously, so just check versions
2811
- if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
2812
- // We can't use @@species feature detection in V8 since it causes
2813
- // deoptimization and performance degradation
2814
- // https://github.com/zloirock/core-js/issues/679
2815
- if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
2816
- // Detect correctness of subclassing with @@species support
2817
- var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
2818
- var FakePromise = function (exec) {
2819
- exec(function () { /* empty */ }, function () { /* empty */ });
2820
- };
2821
- var constructor = promise.constructor = {};
2822
- constructor[SPECIES] = FakePromise;
2823
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
2824
- if (!SUBCLASSING) return true;
2825
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
2826
- } return !GLOBAL_CORE_JS_PROMISE && (ENVIRONMENT === 'BROWSER' || ENVIRONMENT === 'DENO') && !NATIVE_PROMISE_REJECTION_EVENT$1;
2827
- });
2828
-
2829
- var promiseConstructorDetection = {
2830
- CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
2831
- REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
2832
- SUBCLASSING: SUBCLASSING
2833
- };
2834
-
2835
- var newPromiseCapability$2 = {};
2836
-
2837
- var aCallable$4 = aCallable$d;
2838
-
2839
- var $TypeError$3 = TypeError;
2840
-
2841
- var PromiseCapability = function (C) {
2842
- var resolve, reject;
2843
- this.promise = new C(function ($$resolve, $$reject) {
2844
- if (resolve !== undefined || reject !== undefined) throw new $TypeError$3('Bad Promise constructor');
2845
- resolve = $$resolve;
2846
- reject = $$reject;
2847
- });
2848
- this.resolve = aCallable$4(resolve);
2849
- this.reject = aCallable$4(reject);
2850
- };
2851
-
2852
- // `NewPromiseCapability` abstract operation
2853
- // https://tc39.es/ecma262/#sec-newpromisecapability
2854
- newPromiseCapability$2.f = function (C) {
2855
- return new PromiseCapability(C);
2856
- };
2857
-
2858
- var $$9 = _export;
2859
- var IS_NODE = environmentIsNode;
2860
- var globalThis$3 = globalThis_1;
2861
- var path = path$1;
2862
- var call$3 = functionCall;
2863
- var defineBuiltIn$1 = defineBuiltIn$6;
2864
- var setPrototypeOf$2 = objectSetPrototypeOf;
2865
- var setToStringTag$1 = setToStringTag$4;
2866
- var setSpecies = setSpecies$1;
2867
- var aCallable$3 = aCallable$d;
2868
- var isCallable$2 = isCallable$n;
2869
- var isObject$4 = isObject$d;
2870
- var anInstance = anInstance$2;
2871
- var speciesConstructor = speciesConstructor$1;
2872
- var task = task$1.set;
2873
- var microtask = microtask_1;
2874
- var hostReportErrors = hostReportErrors$1;
2875
- var perform$2 = perform$3;
2876
- var Queue = queue$1;
2877
- var InternalStateModule = internalState;
2878
- var NativePromiseConstructor$2 = promiseNativeConstructor;
2879
- var PromiseConstructorDetection = promiseConstructorDetection;
2880
- var newPromiseCapabilityModule$3 = newPromiseCapability$2;
2881
-
2882
- var PROMISE = 'Promise';
2883
- var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
2884
- var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
2885
- var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
2886
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
2887
- var setInternalState = InternalStateModule.set;
2888
- var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
2889
- var PromiseConstructor = NativePromiseConstructor$2;
2890
- var PromisePrototype = NativePromisePrototype$1;
2891
- var TypeError$1 = globalThis$3.TypeError;
2892
- var document$1 = globalThis$3.document;
2893
- var process = globalThis$3.process;
2894
- var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
2895
- var newGenericPromiseCapability = newPromiseCapability$1;
2896
-
2897
- var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && globalThis$3.dispatchEvent);
2898
- var UNHANDLED_REJECTION = 'unhandledrejection';
2899
- var REJECTION_HANDLED = 'rejectionhandled';
2900
- var PENDING = 0;
2901
- var FULFILLED = 1;
2902
- var REJECTED = 2;
2903
- var HANDLED = 1;
2904
- var UNHANDLED = 2;
2905
-
2906
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
2907
-
2908
- // helpers
2909
- var isThenable = function (it) {
2910
- var then;
2911
- return isObject$4(it) && isCallable$2(then = it.then) ? then : false;
2912
- };
2913
-
2914
- var callReaction = function (reaction, state) {
2915
- var value = state.value;
2916
- var ok = state.state === FULFILLED;
2917
- var handler = ok ? reaction.ok : reaction.fail;
2918
- var resolve = reaction.resolve;
2919
- var reject = reaction.reject;
2920
- var domain = reaction.domain;
2921
- var result, then, exited;
2922
- try {
2923
- if (handler) {
2924
- if (!ok) {
2925
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2926
- state.rejection = HANDLED;
2927
- }
2928
- if (handler === true) result = value;
2929
- else {
2930
- if (domain) domain.enter();
2931
- result = handler(value); // can throw
2932
- if (domain) {
2933
- domain.exit();
2934
- exited = true;
2935
- }
2936
- }
2937
- if (result === reaction.promise) {
2938
- reject(new TypeError$1('Promise-chain cycle'));
2939
- } else if (then = isThenable(result)) {
2940
- call$3(then, result, resolve, reject);
2941
- } else resolve(result);
2942
- } else reject(value);
2943
- } catch (error) {
2944
- if (domain && !exited) domain.exit();
2945
- reject(error);
2946
- }
2947
- };
2948
-
2949
- var notify = function (state, isReject) {
2950
- if (state.notified) return;
2951
- state.notified = true;
2952
- microtask(function () {
2953
- var reactions = state.reactions;
2954
- var reaction;
2955
- while (reaction = reactions.get()) {
2956
- callReaction(reaction, state);
2957
- }
2958
- state.notified = false;
2959
- if (isReject && !state.rejection) onUnhandled(state);
2960
- });
2961
- };
2962
-
2963
- var dispatchEvent = function (name, promise, reason) {
2964
- var event, handler;
2965
- if (DISPATCH_EVENT) {
2966
- event = document$1.createEvent('Event');
2967
- event.promise = promise;
2968
- event.reason = reason;
2969
- event.initEvent(name, false, true);
2970
- globalThis$3.dispatchEvent(event);
2971
- } else event = { promise: promise, reason: reason };
2972
- if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = globalThis$3['on' + name])) handler(event);
2973
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
2974
- };
2975
-
2976
- var onUnhandled = function (state) {
2977
- call$3(task, globalThis$3, function () {
2978
- var promise = state.facade;
2979
- var value = state.value;
2980
- var IS_UNHANDLED = isUnhandled(state);
2981
- var result;
2982
- if (IS_UNHANDLED) {
2983
- result = perform$2(function () {
2984
- if (IS_NODE) {
2985
- process.emit('unhandledRejection', value, promise);
2986
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
2987
- });
2988
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
2989
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
2990
- if (result.error) throw result.value;
2991
- }
2992
- });
2993
- };
2994
-
2995
- var isUnhandled = function (state) {
2996
- return state.rejection !== HANDLED && !state.parent;
2997
- };
2998
-
2999
- var onHandleUnhandled = function (state) {
3000
- call$3(task, globalThis$3, function () {
3001
- var promise = state.facade;
3002
- if (IS_NODE) {
3003
- process.emit('rejectionHandled', promise);
3004
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
3005
- });
3006
- };
3007
-
3008
- var bind = function (fn, state, unwrap) {
3009
- return function (value) {
3010
- fn(state, value, unwrap);
3011
- };
3012
- };
3013
-
3014
- var internalReject = function (state, value, unwrap) {
3015
- if (state.done) return;
3016
- state.done = true;
3017
- if (unwrap) state = unwrap;
3018
- state.value = value;
3019
- state.state = REJECTED;
3020
- notify(state, true);
3021
- };
3022
-
3023
- var internalResolve = function (state, value, unwrap) {
3024
- if (state.done) return;
3025
- state.done = true;
3026
- if (unwrap) state = unwrap;
3027
- try {
3028
- if (state.facade === value) throw new TypeError$1("Promise can't be resolved itself");
3029
- var then = isThenable(value);
3030
- if (then) {
3031
- microtask(function () {
3032
- var wrapper = { done: false };
3033
- try {
3034
- call$3(then, value,
3035
- bind(internalResolve, wrapper, state),
3036
- bind(internalReject, wrapper, state)
3037
- );
3038
- } catch (error) {
3039
- internalReject(wrapper, error, state);
3040
- }
3041
- });
3042
- } else {
3043
- state.value = value;
3044
- state.state = FULFILLED;
3045
- notify(state, false);
3046
- }
3047
- } catch (error) {
3048
- internalReject({ done: false }, error, state);
3049
- }
3050
- };
3051
-
3052
- // constructor polyfill
3053
- if (FORCED_PROMISE_CONSTRUCTOR$4) {
3054
- // 25.4.3.1 Promise(executor)
3055
- PromiseConstructor = function Promise(executor) {
3056
- anInstance(this, PromisePrototype);
3057
- aCallable$3(executor);
3058
- call$3(Internal, this);
3059
- var state = getInternalPromiseState(this);
3060
- try {
3061
- executor(bind(internalResolve, state), bind(internalReject, state));
3062
- } catch (error) {
3063
- internalReject(state, error);
3064
- }
3065
- };
3066
-
3067
- PromisePrototype = PromiseConstructor.prototype;
3068
-
3069
- // eslint-disable-next-line no-unused-vars -- required for `.length`
3070
- Internal = function Promise(executor) {
3071
- setInternalState(this, {
3072
- type: PROMISE,
3073
- done: false,
3074
- notified: false,
3075
- parent: false,
3076
- reactions: new Queue(),
3077
- rejection: false,
3078
- state: PENDING,
3079
- value: null
3080
- });
3081
- };
3082
-
3083
- // `Promise.prototype.then` method
3084
- // https://tc39.es/ecma262/#sec-promise.prototype.then
3085
- Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
3086
- var state = getInternalPromiseState(this);
3087
- var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
3088
- state.parent = true;
3089
- reaction.ok = isCallable$2(onFulfilled) ? onFulfilled : true;
3090
- reaction.fail = isCallable$2(onRejected) && onRejected;
3091
- reaction.domain = IS_NODE ? process.domain : undefined;
3092
- if (state.state === PENDING) state.reactions.add(reaction);
3093
- else microtask(function () {
3094
- callReaction(reaction, state);
3095
- });
3096
- return reaction.promise;
3097
- });
3098
-
3099
- OwnPromiseCapability = function () {
3100
- var promise = new Internal();
3101
- var state = getInternalPromiseState(promise);
3102
- this.promise = promise;
3103
- this.resolve = bind(internalResolve, state);
3104
- this.reject = bind(internalReject, state);
3105
- };
3106
-
3107
- newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
3108
- return C === PromiseConstructor || C === PromiseWrapper
3109
- ? new OwnPromiseCapability(C)
3110
- : newGenericPromiseCapability(C);
3111
- };
3112
-
3113
- if (isCallable$2(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
3114
- nativeThen = NativePromisePrototype$1.then;
3115
-
3116
- if (!NATIVE_PROMISE_SUBCLASSING) {
3117
- // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
3118
- defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
3119
- var that = this;
3120
- return new PromiseConstructor(function (resolve, reject) {
3121
- call$3(nativeThen, that, resolve, reject);
3122
- }).then(onFulfilled, onRejected);
3123
- // https://github.com/zloirock/core-js/issues/640
3124
- }, { unsafe: true });
3125
- }
3126
-
3127
- // make `.constructor === Promise` work for native promise-based APIs
3128
- try {
3129
- delete NativePromisePrototype$1.constructor;
3130
- } catch (error) { /* empty */ }
3131
-
3132
- // make `instanceof Promise` work for native promise-based APIs
3133
- if (setPrototypeOf$2) {
3134
- setPrototypeOf$2(NativePromisePrototype$1, PromisePrototype);
3135
- }
3136
- }
3137
- }
3138
-
3139
- // `Promise` constructor
3140
- // https://tc39.es/ecma262/#sec-promise-executor
3141
- $$9({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
3142
- Promise: PromiseConstructor
3143
- });
3144
-
3145
- PromiseWrapper = path.Promise;
3146
-
3147
- setToStringTag$1(PromiseConstructor, PROMISE, false);
3148
- setSpecies(PROMISE);
3149
-
3150
- var wellKnownSymbol$3 = wellKnownSymbol$i;
3151
-
3152
- var ITERATOR$1 = wellKnownSymbol$3('iterator');
3153
- var SAFE_CLOSING = false;
3154
-
3155
- try {
3156
- var called = 0;
3157
- var iteratorWithReturn = {
3158
- next: function () {
3159
- return { done: !!called++ };
3160
- },
3161
- 'return': function () {
3162
- SAFE_CLOSING = true;
3163
- }
3164
- };
3165
- iteratorWithReturn[ITERATOR$1] = function () {
3166
- return this;
3167
- };
3168
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
3169
- Array.from(iteratorWithReturn, function () { throw 2; });
3170
- } catch (error) { /* empty */ }
3171
-
3172
- var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
3173
- try {
3174
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
3175
- } catch (error) { return false; } // workaround of old WebKit + `eval` bug
3176
- var ITERATION_SUPPORT = false;
3177
- try {
3178
- var object = {};
3179
- object[ITERATOR$1] = function () {
3180
- return {
3181
- next: function () {
3182
- return { done: ITERATION_SUPPORT = true };
3183
- }
3184
- };
3185
- };
3186
- exec(object);
3187
- } catch (error) { /* empty */ }
3188
- return ITERATION_SUPPORT;
3189
- };
3190
-
3191
- var NativePromiseConstructor$1 = promiseNativeConstructor;
3192
- var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
3193
- var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
3194
-
3195
- var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
3196
- NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
3197
- });
3198
-
3199
- var $$8 = _export;
3200
- var call$2 = functionCall;
3201
- var aCallable$2 = aCallable$d;
3202
- var newPromiseCapabilityModule$2 = newPromiseCapability$2;
3203
- var perform$1 = perform$3;
3204
- var iterate$2 = iterate$5;
3205
- var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
3206
-
3207
- // `Promise.all` method
3208
- // https://tc39.es/ecma262/#sec-promise.all
3209
- $$8({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
3210
- all: function all(iterable) {
3211
- var C = this;
3212
- var capability = newPromiseCapabilityModule$2.f(C);
3213
- var resolve = capability.resolve;
3214
- var reject = capability.reject;
3215
- var result = perform$1(function () {
3216
- var $promiseResolve = aCallable$2(C.resolve);
3217
- var values = [];
3218
- var counter = 0;
3219
- var remaining = 1;
3220
- iterate$2(iterable, function (promise) {
3221
- var index = counter++;
3222
- var alreadyCalled = false;
3223
- remaining++;
3224
- call$2($promiseResolve, C, promise).then(function (value) {
3225
- if (alreadyCalled) return;
3226
- alreadyCalled = true;
3227
- values[index] = value;
3228
- --remaining || resolve(values);
3229
- }, reject);
3230
- });
3231
- --remaining || resolve(values);
3232
- });
3233
- if (result.error) reject(result.value);
3234
- return capability.promise;
3235
- }
3236
- });
3237
-
3238
- var $$7 = _export;
3239
- var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
3240
- var NativePromiseConstructor = promiseNativeConstructor;
3241
- var getBuiltIn$2 = getBuiltIn$9;
3242
- var isCallable$1 = isCallable$n;
3243
- var defineBuiltIn = defineBuiltIn$6;
3244
-
3245
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
3246
-
3247
- // `Promise.prototype.catch` method
3248
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
3249
- $$7({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
3250
- 'catch': function (onRejected) {
3251
- return this.then(undefined, onRejected);
3252
- }
3253
- });
3254
-
3255
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
3256
- if (isCallable$1(NativePromiseConstructor)) {
3257
- var method = getBuiltIn$2('Promise').prototype['catch'];
3258
- if (NativePromisePrototype['catch'] !== method) {
3259
- defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
3260
- }
3261
- }
3262
-
3263
- var $$6 = _export;
3264
- var call$1 = functionCall;
3265
- var aCallable$1 = aCallable$d;
3266
- var newPromiseCapabilityModule$1 = newPromiseCapability$2;
3267
- var perform = perform$3;
3268
- var iterate$1 = iterate$5;
3269
- var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
3270
-
3271
- // `Promise.race` method
3272
- // https://tc39.es/ecma262/#sec-promise.race
3273
- $$6({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
3274
- race: function race(iterable) {
3275
- var C = this;
3276
- var capability = newPromiseCapabilityModule$1.f(C);
3277
- var reject = capability.reject;
3278
- var result = perform(function () {
3279
- var $promiseResolve = aCallable$1(C.resolve);
3280
- iterate$1(iterable, function (promise) {
3281
- call$1($promiseResolve, C, promise).then(capability.resolve, reject);
3282
- });
3283
- });
3284
- if (result.error) reject(result.value);
3285
- return capability.promise;
3286
- }
3287
- });
3288
-
3289
- var $$5 = _export;
3290
- var newPromiseCapabilityModule = newPromiseCapability$2;
3291
- var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
3292
-
3293
- // `Promise.reject` method
3294
- // https://tc39.es/ecma262/#sec-promise.reject
3295
- $$5({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
3296
- reject: function reject(r) {
3297
- var capability = newPromiseCapabilityModule.f(this);
3298
- var capabilityReject = capability.reject;
3299
- capabilityReject(r);
3300
- return capability.promise;
3301
- }
3302
- });
3303
-
3304
- var anObject$1 = anObject$f;
3305
- var isObject$3 = isObject$d;
3306
- var newPromiseCapability = newPromiseCapability$2;
3307
-
3308
- var promiseResolve$1 = function (C, x) {
3309
- anObject$1(C);
3310
- if (isObject$3(x) && x.constructor === C) return x;
3311
- var promiseCapability = newPromiseCapability.f(C);
3312
- var resolve = promiseCapability.resolve;
3313
- resolve(x);
3314
- return promiseCapability.promise;
3315
- };
3316
-
3317
- var $$4 = _export;
3318
- var getBuiltIn$1 = getBuiltIn$9;
3319
- var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
3320
- var promiseResolve = promiseResolve$1;
3321
-
3322
- getBuiltIn$1('Promise');
3323
-
3324
- // `Promise.resolve` method
3325
- // https://tc39.es/ecma262/#sec-promise.resolve
3326
- $$4({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
3327
- resolve: function resolve(x) {
3328
- return promiseResolve(this, x);
3329
- }
3330
- });
3331
-
3332
- var isObject$2 = isObject$d;
3333
- var classof = classofRaw$2;
3334
- var wellKnownSymbol$2 = wellKnownSymbol$i;
3335
-
3336
- var MATCH$1 = wellKnownSymbol$2('match');
3337
-
3338
- // `IsRegExp` abstract operation
3339
- // https://tc39.es/ecma262/#sec-isregexp
3340
- var isRegexp = function (it) {
3341
- var isRegExp;
3342
- return isObject$2(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
3343
- };
3344
-
3345
- var isRegExp = isRegexp;
3346
-
3347
- var $TypeError$2 = TypeError;
3348
-
3349
- var notARegexp = function (it) {
3350
- if (isRegExp(it)) {
3351
- throw new $TypeError$2("The method doesn't accept regular expressions");
3352
- } return it;
3353
- };
3354
-
3355
- var wellKnownSymbol$1 = wellKnownSymbol$i;
3356
-
3357
- var MATCH = wellKnownSymbol$1('match');
3358
-
3359
- var correctIsRegexpLogic = function (METHOD_NAME) {
3360
- var regexp = /./;
3361
- try {
3362
- '/./'[METHOD_NAME](regexp);
3363
- } catch (error1) {
3364
- try {
3365
- regexp[MATCH] = false;
3366
- return '/./'[METHOD_NAME](regexp);
3367
- } catch (error2) { /* empty */ }
3368
- } return false;
3369
- };
3370
-
3371
- var $$3 = _export;
3372
- var uncurryThis$1 = functionUncurryThis;
3373
- var notARegExp = notARegexp;
3374
- var requireObjectCoercible = requireObjectCoercible$4;
3375
- var toString$1 = toString$3;
3376
- var correctIsRegExpLogic = correctIsRegexpLogic;
3377
-
3378
- var stringIndexOf = uncurryThis$1(''.indexOf);
3379
-
3380
- // `String.prototype.includes` method
3381
- // https://tc39.es/ecma262/#sec-string.prototype.includes
3382
- $$3({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
3383
- includes: function includes(searchString /* , position = 0 */) {
3384
- return !!~stringIndexOf(
3385
- toString$1(requireObjectCoercible(this)),
3386
- toString$1(notARegExp(searchString)),
3387
- arguments.length > 1 ? arguments[1] : undefined
3388
- );
3389
- }
3390
- });
3391
-
3392
- // iterable DOM collections
3393
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
3394
- var domIterables = {
3395
- CSSRuleList: 0,
3396
- CSSStyleDeclaration: 0,
3397
- CSSValueList: 0,
3398
- ClientRectList: 0,
3399
- DOMRectList: 0,
3400
- DOMStringList: 0,
3401
- DOMTokenList: 1,
3402
- DataTransferItemList: 0,
3403
- FileList: 0,
3404
- HTMLAllCollection: 0,
3405
- HTMLCollection: 0,
3406
- HTMLFormElement: 0,
3407
- HTMLSelectElement: 0,
3408
- MediaList: 0,
3409
- MimeTypeArray: 0,
3410
- NamedNodeMap: 0,
3411
- NodeList: 1,
3412
- PaintRequestList: 0,
3413
- Plugin: 0,
3414
- PluginArray: 0,
3415
- SVGLengthList: 0,
3416
- SVGNumberList: 0,
3417
- SVGPathSegList: 0,
3418
- SVGPointList: 0,
3419
- SVGStringList: 0,
3420
- SVGTransformList: 0,
3421
- SourceBufferList: 0,
3422
- StyleSheetList: 0,
3423
- TextTrackCueList: 0,
3424
- TextTrackList: 0,
3425
- TouchList: 0
3426
- };
3427
-
3428
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
3429
- var documentCreateElement = documentCreateElement$2;
3430
-
3431
- var classList = documentCreateElement('span').classList;
3432
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
3433
-
3434
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
3435
-
3436
- var globalThis$2 = globalThis_1;
3437
- var DOMIterables = domIterables;
3438
- var DOMTokenListPrototype = domTokenListPrototype;
3439
- var ArrayIteratorMethods = es_array_iterator;
3440
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$8;
3441
- var setToStringTag = setToStringTag$4;
3442
- var wellKnownSymbol = wellKnownSymbol$i;
3443
-
3444
- var ITERATOR = wellKnownSymbol('iterator');
3445
- var ArrayValues = ArrayIteratorMethods.values;
3446
-
3447
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3448
- if (CollectionPrototype) {
3449
- // some Chrome versions have non-configurable methods on DOMTokenList
3450
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
3451
- createNonEnumerableProperty$3(CollectionPrototype, ITERATOR, ArrayValues);
3452
- } catch (error) {
3453
- CollectionPrototype[ITERATOR] = ArrayValues;
3454
- }
3455
- setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
3456
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
3457
- // some Chrome versions have non-configurable methods on DOMTokenList
3458
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
3459
- createNonEnumerableProperty$3(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
3460
- } catch (error) {
3461
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
3462
- }
3463
- }
3464
- }
3465
- };
3466
-
3467
- for (var COLLECTION_NAME in DOMIterables) {
3468
- handlePrototype(globalThis$2[COLLECTION_NAME] && globalThis$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
3469
- }
3470
-
3471
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
3472
-
3473
- /**
3474
- * State of an asynchronous call. Network state follows the state diagram given below.
3475
- *
3476
- *
3477
- * <pre>
3478
- * ┌──────┐
3479
- * ┌─────────────► Init ◄────────────┐
3480
- * │ └▲────┬┘ │
3481
- * │ │ │ │
3482
- * │ Reset Execute │
3483
- * Reset │ │ Reset
3484
- * │ ┌──┴────┴──┐ │
3485
- * │ ┌────► Pending ◄────┐ │
3486
- * │ │ └──┬────┬──┘ │ │
3487
- * │ Execute │ │ Execute │
3488
- * │ │ │ │ │ │
3489
- * │ │ OnSuccess OnError │ │
3490
- * │ ┌────┴──┐ │ │ ┌──┴───┐ │
3491
- * └─┤Success◄────┘ └────►Error ├─┘
3492
- * └───────┘ └──────┘
3493
- *
3494
- * </pre>
3495
- */
3496
-
3497
- /**
3498
- * Network call is not yet started
3499
- */
3500
-
3501
- /**
3502
- * Checks whether the state is init state
3503
- * @param state
3504
- */
3505
- function isInit(state) {
3506
- return state.state === 'init';
3507
- }
3508
-
3509
- /**
3510
- * Initializes a new state.
3511
- *
3512
- * @template T The type of the state.
3513
- * @return {InitState<T>} An object representing the initial state.
3514
- */
3515
- function init() {
3516
- return {
3517
- state: 'init'
3518
- };
3519
- }
3520
-
3521
- /**
3522
- * Network call is not yet completed
3523
- */
3524
-
3525
- /**
3526
- * Interface representing progress information for an upload or download operation.
3527
- *
3528
- * @typedef {object} Progress
3529
- *
3530
- * @property {'upload' | 'download'} type - The type of the operation.
3531
- *
3532
- * @property {number} loaded - The amount of data that has been loaded so far.
3533
- *
3534
- * @property {number} [total] - The total amount of data to be loaded (if known).
3535
- */
3536
-
3537
- /**
3538
- * Checks whether the state is pending state
3539
- * @param state
3540
- */
3541
- function isPending(state) {
3542
- return state.state === 'pending';
3543
- }
3544
-
3545
- /**
3546
- * Generates a PendingState object with a state of "pending".
3547
- *
3548
- * @return {PendingState<T>} An object representing the pending state.
3549
- */
3550
- function pending(progress = undefined, data = undefined) {
3551
- return {
3552
- state: 'pending',
3553
- progress,
3554
- data
3555
- };
3556
- }
3557
-
3558
- /**
3559
- * Network call is completed with success state
3560
- */
3561
-
3562
- /**
3563
- * Checks whether the state is success response
3564
- * @param state
3565
- */
3566
- function isSuccess(state) {
3567
- return state.state === 'success';
3568
- }
3569
-
3570
- /**
3571
- * Creates a success state object with the provided data.
3572
- *
3573
- * @param {T} data - The data to be included in the success state.
3574
- * @return {SuccessState<T>} An object representing a success state containing the provided data.
3575
- */
3576
- function success(data) {
3577
- return {
3578
- state: 'success',
3579
- data
3580
- };
3581
- }
3582
-
3583
- /**
3584
- * Network call is completed with error response
3585
- */
3586
-
3587
- /**
3588
- * Checks whether the state is error state
3589
- * @param state
3590
- */
3591
- function isError(state) {
3592
- return state.state === 'error';
3593
- }
3594
-
3595
- /**
3596
- * Constructs an ErrorState object representing an error.
3597
- *
3598
- * @param {any} error - The error object or message.
3599
- * @param {string} [statusCode] - An optional status code associated with the error.
3600
- * @return {ErrorState<T>} An object representing the error state.
3601
- */
3602
- function error(error, statusCode, request) {
3603
- return {
3604
- state: 'error',
3605
- error,
3606
- statusCode,
3607
- request
3608
- };
3609
- }
3610
-
3611
- /**
3612
- * Represents an error state with additional contextual information.
3613
- *
3614
- * @typedef {Object} ErrorWithContext
3615
- * @template T
3616
- * @extends ErrorState<T>
3617
- *
3618
- * @property {string} source - The origin of the error.
3619
- * @property {string} operation - The operation being performed when the error occurred.
3620
- * @property {string} key - A unique key identifying the specific error instance.
3621
- */
3622
-
3623
- /**
3624
- * Represents an action in the network context.
3625
- *
3626
- * @template T - The type of data associated with the network action
3627
- *
3628
- * @property {NetworkState<any>} state - The current state of the network action
3629
- * @property {string} key - The unique identifier for the network action
3630
- */
3631
-
3632
- /**
3633
- * Represents the dispatch state of a process.
3634
- *
3635
- * @template T The type of the state information.
3636
- * @interface
3637
- *
3638
- * @property {string} state The current state of the dispatch process.
3639
- */
3640
-
3641
- /**
3642
- * Represents a successful dispatch state.
3643
- *
3644
- * @template T - Type of the data associated with the dispatch.
3645
- *
3646
- * @extends DispatchState<T>
3647
- *
3648
- * @property {string} state - The state of the dispatch, always 'success'.
3649
- */
3650
-
3651
- /**
3652
- * Indicates a successful dispatch state.
3653
- *
3654
- * @return {DispatchState<T>} An object representing a successful state.
3655
- */
3656
- function successfulDispatch() {
3657
- return {
3658
- state: 'success'
3659
- };
3660
- }
3661
-
3662
- /**
3663
- * Determines if the provided dispatch state represents a successful dispatch.
3664
- *
3665
- * @param {DispatchState<T>} value - The dispatch state to check.
3666
- * @return {value is SuccessfulDispatch<T>} - True if the dispatch state indicates success, false otherwise.
3667
- */
3668
- function isSuccessfulDispatch(value) {
3669
- return value.state === 'success';
3670
- }
3671
-
3672
- /**
3673
- * ValidationError interface represents a specific type of dispatch state
3674
- * where a validation error has occurred.
3675
- *
3676
- * @typeparam T - The type of the data associated with this dispatch state.
3677
- */
3678
-
3679
- /**
3680
- * Generates a ValidationError object.
3681
- *
3682
- * @param error The error details that caused the validation to fail.
3683
- * @return The ValidationError object containing the error state and details.
3684
- */
3685
- function validationError(error) {
3686
- return {
3687
- state: 'validation-error',
3688
- error
3689
- };
3690
- }
3691
-
3692
- /**
3693
- * Determines if a provided DispatchState object is a ValidationError.
3694
- *
3695
- * @param {DispatchState<T>} value - The DispatchState object to evaluate.
3696
- * @return {boolean} - Returns true if the provided DispatchState object is a ValidationError, otherwise returns false.
3697
- */
3698
- function isValidationError(value) {
3699
- return value.state === 'validation-error';
3700
- }
3701
-
3702
- /**
3703
- * Represents an error structure with a specified type and associated data.
3704
- *
3705
- * @template T - The type of the data associated with the error.
3706
- * @template E - The type of the error detail.
3707
- *
3708
- * @property {string} type - A string representing the type of the error.
3709
- */
3710
-
3711
- /**
3712
- * Represents an error encountered during a network operation.
3713
- * Extends from the `IntrigError` interface, adding network-specific properties.
3714
- *
3715
- * @template T - The type of the intrinsic data associated with the error.
3716
- * @template E - The type of the error details, defaulting to `unknown`.
3717
- *
3718
- * @property {string} type - A constant property representing the error type, always set to 'network'.
3719
- * @property {string} statusCode - A string representation of the HTTP status code associated with the error, indicating the nature of the network failure.
3720
- * @property {E} error - The detailed error information specific to the failure, type extends from the generic E, allowing flexibility in the error details.
3721
- * @property {any} request - The request object that was attempted when the network error occurred, providing context for what operation failed.
3722
- */
3723
-
3724
- /**
3725
- * Constructs a network error object.
3726
- *
3727
- * @param error The error object corresponding to the network request.
3728
- * @param statusCode A string representing the HTTP status code returned.
3729
- * @param request The request object associated with the network operation.
3730
- * @return A NetworkError object containing the error type, status code, error details, and the original request.
3731
- */
3732
- function networkError(error, statusCode, request) {
3733
- return {
3734
- type: 'network',
3735
- statusCode,
3736
- error,
3737
- request
3738
- };
3739
- }
3740
-
3741
- /**
3742
- * Determines if the provided IntrigError is of type 'network'.
3743
- *
3744
- * @param {IntrigError<T, E>} value - The error value to check the type of.
3745
- * @return {boolean} - Returns true if the error is of type 'network', otherwise false.
3746
- */
3747
- function isNetworkError(value) {
3748
- return value.type === 'network';
3749
- }
3750
-
3751
- /**
3752
- * Interface representing a request validation error.
3753
- *
3754
- * This error occurs when a validation process on a request fails. It extends the IntrigError interface
3755
- * by adding specific properties related to request validation.
3756
- *
3757
- * @template T - The type of the data associated with the error.
3758
- * @template E - The optional type of additional error information. Defaults to unknown.
3759
- *
3760
- * @extends IntrigError<T, E>
3761
- *
3762
- * @property {string} type - A string literal indicating the error type as 'request-validation'.
3763
- * @property {ZodError} error - An instance of ZodError containing detailed validation error information.
3764
- */
3765
-
3766
- /**
3767
- * Constructs a RequestValidationError object encapsulating the ZodError.
3768
- *
3769
- * @param {ZodError} error - The error object resulting from Zod schema validation.
3770
- * @return {RequestValidationError<T, E>} A RequestValidationError object containing the validation error information.
3771
- */
3772
- function requestValidationError(error) {
3773
- return {
3774
- type: 'request-validation',
3775
- error
3776
- };
3777
- }
3778
-
3779
- /**
3780
- * Determines if a given error is of type RequestValidationError.
3781
- *
3782
- * @param value The error object to check, which implements the IntrigError interface.
3783
- * @return A boolean indicating whether the error is a RequestValidationError.
3784
- */
3785
- function isRequestValidationError(value) {
3786
- return value.type === 'request-validation';
3787
- }
3788
-
3789
- /**
3790
- * ResponseValidationError interface is designed to extend the capabilities of the IntrigError interface,
3791
- * specifically for handling errors related to response validation.
3792
- *
3793
- * @template T - Represents the type of the data or payload associated with the error.
3794
- * @template E - Represents the type of any additional error information. Defaults to unknown.
3795
- *
3796
- * @extends IntrigError
3797
- *
3798
- * @property type - A string literal that identifies the type of error as 'response-validation'.
3799
- * @property error - An instance of ZodError representing the validation error encountered.
3800
- */
3801
-
3802
- /**
3803
- * Constructs a ResponseValidationError object with a specified error.
3804
- *
3805
- * @param {ZodError} error - The validation error encountered during response validation.
3806
- * @return {ResponseValidationError<T, E>} An error object containing the type of error and the validation error details.
3807
- */
3808
- function responseValidationError(error) {
3809
- return {
3810
- type: 'response-validation',
3811
- error
3812
- };
3813
- }
3814
-
3815
- /**
3816
- * Determines if the given error is a response validation error.
3817
- *
3818
- * @param {IntrigError<T, E>} value - The error object to assess.
3819
- * @return {boolean} True if the error is a response validation error, otherwise false.
3820
- */
3821
- function isResponseValidationError(value) {
3822
- return value.type === 'response-validation';
3823
- }
3824
-
3825
- var _env, _ref, _ref2;
3826
-
3827
- // Extend the global interfaces
3828
-
3829
- // 1) Build-time default via Vite (if available)
3830
- // Cast import.meta to any to avoid TS errors if env isn't typed
3831
- const buildDefault = typeof import.meta !== 'undefined' ? (_env = import.meta.env) == null ? void 0 : _env.VITE_LOG_LEVEL : undefined;
3832
-
3833
- // 2) Stored default in localStorage
3834
- const storedLevel = typeof localStorage !== 'undefined' ? localStorage.getItem('LOG_LEVEL') : null;
3835
-
3836
- // Determine initial log level: build-time → stored → 'error'
3837
- const defaultLevel = (_ref = (_ref2 = buildDefault) != null ? _ref2 : storedLevel) != null ? _ref : 'error';
3838
-
3839
- // Apply initial level
3840
- log.setLevel(defaultLevel);
3841
-
3842
- // Expose a console setter to change level at runtime
3843
- if (typeof window !== 'undefined') {
3844
- window.setLogLevel = level => {
3845
- log.setLevel(level);
3846
- try {
3847
- localStorage.setItem('LOG_LEVEL', String(level));
3848
- } catch (_unused) {
3849
- // ignore if storage is unavailable
3850
- }
3851
- console.log(`✏️ loglevel set to '${level}'`);
3852
- };
3853
- }
3854
-
3855
- // Consistent wrapper API
3856
- const logger = {
3857
- info: (msg, meta) => meta ? log.info(msg, meta) : log.info(msg),
3858
- warn: (msg, meta) => meta ? log.warn(msg, meta) : log.warn(msg),
3859
- error: (msg, meta) => meta ? log.error(msg, meta) : log.error(msg),
3860
- debug: (msg, meta) => meta ? log.debug(msg, meta) : log.debug(msg)
3861
- };
3862
-
3863
- /**
3864
- * Defines the ContextType interface for managing global state, dispatching actions,
3865
- * and holding a collection of Axios instances.
3866
- *
3867
- * @interface ContextType
3868
- * @property {GlobalState} state - The global state of the application.
3869
- * @property {React.Dispatch<NetworkAction<unknown>>} dispatch - The dispatch function to send network actions.
3870
- * @property {Record<string, AxiosInstance>} axios - A record of Axios instances for making HTTP requests.
3871
- */
3872
-
3873
- /**
3874
- * Context object created using `createContext` function. Provides a way to share state, dispatch functions,
3875
- * and axios instance across components without having to pass props down manually at every level.
3876
- *
3877
- * @type {ContextType}
3878
- */
3879
- const Context = /*#__PURE__*/createContext({
3880
- state: {},
3881
- filteredState: {},
3882
- dispatch() {
3883
- // intentionally kept empty
3884
- },
3885
- configs: {},
3886
- async execute() {
3887
- // intentionally kept empty
3888
- }
3889
- });
3890
- function useIntrigContext() {
3891
- return useContext(Context);
3892
- }
3893
-
3894
- var _jsxFileName = "/home/tiran-intrigsoft/IdeaProjects/intrig-core/lib/react-client/src/intrig-provider.tsx";
3895
- function requestReducer(state, action) {
3896
- return Object.assign({}, state, {
3897
- [`${action.source}:${action.operation}:${action.key}`]: action.state
3898
- });
3899
- }
3900
-
3901
- /**
3902
- * IntrigProvider is a context provider component that sets up global state management
3903
- * and provides Axios instances for API requests.
3904
- *
3905
- * @param {Object} props - The properties object.
3906
- * @param {React.ReactNode} props.children - The child components to be wrapped by the provider.
3907
- * @param {Object} [props.configs={}] - Configuration object for Axios instances.
3908
- * @param {Object} [props.configs.defaults={}] - Default configuration for Axios.
3909
- * @param {Object} [props.configs.petstore={}] - Configuration specific to the petstore API.
3910
- * @return {JSX.Element} A context provider component that wraps the provided children.
3911
- */
3912
- function IntrigProvider({
3913
- children,
3914
- configs = {}
3915
- }) {
3916
- const [state, dispatch] = useReducer(requestReducer, {});
3917
- const axiosInstances = useMemo(() => {
3918
- return {};
3919
- }, [configs]);
3920
- const contextValue = useMemo(() => {
3921
- async function execute(request, dispatch, schema, errorSchema) {
3922
- try {
3923
- dispatch(pending());
3924
- const response = await axiosInstances[request.source].request(request);
3925
- if (response.status >= 200 && response.status < 300) {
3926
- var _response$headers;
3927
- if ((_response$headers = response.headers) != null && (_response$headers = _response$headers['content-type']) != null && _response$headers.includes('text/event-stream')) {
3928
- const reader = response.data.getReader();
3929
- const decoder = new TextDecoder();
3930
- let lastMessage;
3931
- const parser = createParser({
3932
- onEvent(message) {
3933
- let decoded = message.data;
3934
- try {
3935
- let parsed = JSON.parse(decoded);
3936
- if (schema) {
3937
- const validated = schema.safeParse(parsed);
3938
- if (!validated.success) {
3939
- dispatch(error(validated.error.issues, response.status, request));
3940
- return;
3941
- }
3942
- parsed = validated.data;
3943
- }
3944
- decoded = parsed;
3945
- } catch (e) {
3946
- console.error(e);
3947
- }
3948
- lastMessage = decoded;
3949
- flushSync(() => dispatch(pending(undefined, decoded)));
3950
- }
3951
- });
3952
- while (true) {
3953
- const {
3954
- done,
3955
- value
3956
- } = await reader.read();
3957
- if (done) {
3958
- flushSync(() => dispatch(success(lastMessage)));
3959
- break;
3960
- }
3961
- parser.feed(decoder.decode(value, {
3962
- stream: true
3963
- }));
3964
- }
3965
- } else if (schema) {
3966
- const data = schema.safeParse(response.data);
3967
- if (!data.success) {
3968
- dispatch(error(data.error.issues, response.status, request));
3969
- return;
3970
- }
3971
- dispatch(success(data.data));
3972
- } else {
3973
- dispatch(success(response.data));
3974
- }
3975
- } else {
3976
- var _errorSchema$safePars, _response$data, _ref;
3977
- const {
3978
- data
3979
- } = (_errorSchema$safePars = errorSchema == null ? void 0 : errorSchema.safeParse((_response$data = response.data) != null ? _response$data : {})) != null ? _errorSchema$safePars : {};
3980
- //todo: handle error validation error.
3981
- dispatch(error((_ref = data != null ? data : response.data) != null ? _ref : response.statusText, response.status));
3982
- }
3983
- } catch (e) {
3984
- if (isAxiosError(e)) {
3985
- var _errorSchema$safePars2, _e$response$data, _e$response, _e$response2, _e$response3;
3986
- const {
3987
- data
3988
- } = (_errorSchema$safePars2 = errorSchema == null ? void 0 : errorSchema.safeParse((_e$response$data = (_e$response = e.response) == null ? void 0 : _e$response.data) != null ? _e$response$data : {})) != null ? _errorSchema$safePars2 : {};
3989
- dispatch(error(data != null ? data : (_e$response2 = e.response) == null ? void 0 : _e$response2.data, (_e$response3 = e.response) == null ? void 0 : _e$response3.status, request));
3990
- } else {
3991
- dispatch(error(e));
3992
- }
3993
- }
3994
- }
3995
- return {
3996
- state,
3997
- dispatch,
3998
- filteredState: state,
3999
- configs,
4000
- execute
4001
- };
4002
- }, [state, axiosInstances]);
4003
- return /*#__PURE__*/jsxDEV(Context.Provider, {
4004
- value: contextValue,
4005
- children: children
4006
- }, void 0, false, {
4007
- fileName: _jsxFileName,
4008
- lineNumber: 217,
4009
- columnNumber: 10
4010
- }, this);
4011
- }
4012
- function IntrigProviderStub({
4013
- children,
4014
- configs = {},
4015
- stubs = () => {
4016
- // intentionally kept empty
4017
- }
4018
- }) {
4019
- const [state, dispatch] = useReducer(requestReducer, {});
4020
- const collectedStubs = useMemo(() => {
4021
- const fns = {};
4022
- function stub(hook, fn) {
4023
- fns[hook.key] = fn;
4024
- }
4025
- stubs(stub);
4026
- return fns;
4027
- }, [stubs]);
4028
- const contextValue = useMemo(() => {
4029
- async function execute(request, dispatch, schema) {
4030
- const stub = collectedStubs[request.key];
4031
- if (stub) {
4032
- try {
4033
- await stub(request.params, request.data, dispatch);
4034
- } catch (e) {
4035
- dispatch(error(e));
4036
- }
4037
- } else {
4038
- dispatch(init());
4039
- }
4040
- }
4041
- return {
4042
- state,
4043
- dispatch,
4044
- filteredState: state,
4045
- configs,
4046
- execute
4047
- };
4048
- }, [state, dispatch, configs, collectedStubs]);
4049
- return /*#__PURE__*/jsxDEV(Context.Provider, {
4050
- value: contextValue,
4051
- children: children
4052
- }, void 0, false, {
4053
- fileName: _jsxFileName,
4054
- lineNumber: 301,
4055
- columnNumber: 10
4056
- }, this);
4057
- }
4058
- /**
4059
- * StatusTrap component is used to track and manage network request states.
4060
- *
4061
- * @param {Object} props - The properties object.
4062
- * @param {React.ReactNode} props.children - The child elements to be rendered.
4063
- * @param {string} props.type - The type of network state to handle ("error", "pending", "pending + error").
4064
- * @param {boolean} [props.propagate=true] - Whether to propagate the event to the parent context.
4065
- * @return {React.ReactElement} The context provider component with filtered state and custom dispatch.
4066
- */
4067
- function StatusTrap({
4068
- children,
4069
- type,
4070
- propagate = true
4071
- }) {
4072
- const ctx = useContext(Context);
4073
- const [requests, setRequests] = useState([]);
4074
- const shouldHandleEvent = useCallback(state => {
4075
- switch (type) {
4076
- case 'error':
4077
- return isError(state);
4078
- case 'pending':
4079
- return isPending(state);
4080
- case 'pending + error':
4081
- return isPending(state) || isError(state);
4082
- default:
4083
- return false;
4084
- }
4085
- }, [type]);
4086
- const dispatch = useCallback(event => {
4087
- if (!event.handled) {
4088
- if (shouldHandleEvent(event.state)) {
4089
- setRequests(prev => [...prev, event.key]);
4090
- if (!propagate) {
4091
- ctx.dispatch(Object.assign({}, event, {
4092
- handled: true
4093
- }));
4094
- return;
4095
- }
4096
- } else {
4097
- setRequests(prev => prev.filter(k => k !== event.key));
4098
- }
4099
- }
4100
- ctx.dispatch(event);
4101
- }, [ctx, propagate, shouldHandleEvent]);
4102
- const filteredState = useMemo(() => {
4103
- return Object.fromEntries(Object.entries(ctx.state).filter(([key]) => requests.includes(key)));
4104
- }, [ctx.state, requests]);
4105
- return /*#__PURE__*/jsxDEV(Context.Provider, {
4106
- value: Object.assign({}, ctx, {
4107
- dispatch,
4108
- filteredState
4109
- }),
4110
- children: children
4111
- }, void 0, false, {
4112
- fileName: _jsxFileName,
4113
- lineNumber: 371,
4114
- columnNumber: 5
4115
- }, this);
4116
- }
4117
- /**
4118
- * useNetworkState is a custom hook that manages the network state within the specified context.
4119
- * It handles making network requests, dispatching appropriate states based on the request lifecycle,
4120
- * and allows aborting ongoing requests.
4121
- *
4122
- * @param {Object} params - The parameters required to configure and use the network state.
4123
- * @param {string} params.key - A unique identifier for the network request.
4124
- * @param {string} params.operation - The operation type related to the request.
4125
- * @param {string} params.source - The source or endpoint for the network request.
4126
- * @param {Object} params.schema - The schema used for validating the response data.
4127
- * @param {number} [params.debounceDelay] - The debounce delay for executing the network request.
4128
- *
4129
- * @return {[NetworkState<T>, (request: AxiosRequestConfig) => void, () => void]}
4130
- * Returns a state object representing the current network state,
4131
- * a function to execute the network request, and a function to clear the request.
4132
- */
4133
- function useNetworkState({
4134
- key,
4135
- operation,
4136
- source,
4137
- schema,
4138
- errorSchema,
4139
- debounceDelay: requestDebounceDelay
4140
- }) {
4141
- var _context$state3;
4142
- const context = useContext(Context);
4143
- const [abortController, setAbortController] = useState();
4144
- const networkState = useMemo(() => {
4145
- var _context$state, _ref2, _context$state2;
4146
- logger.info(`Updating status ${key} ${operation} ${source}`);
4147
- logger.debug('<=', (_context$state = context.state) == null ? void 0 : _context$state[`${source}:${operation}:${key}`]);
4148
- return (_ref2 = (_context$state2 = context.state) == null ? void 0 : _context$state2[`${source}:${operation}:${key}`]) != null ? _ref2 : init();
4149
- }, [JSON.stringify((_context$state3 = context.state) == null ? void 0 : _context$state3[`${source}:${operation}:${key}`])]);
4150
- const dispatch = useCallback(state => {
4151
- context.dispatch({
4152
- key,
4153
- operation,
4154
- source,
4155
- state
4156
- });
4157
- }, [key, operation, source, context.dispatch]);
4158
- const debounceDelay = useMemo(() => {
4159
- var _ref3, _context$configs;
4160
- return (_ref3 = requestDebounceDelay != null ? requestDebounceDelay : (_context$configs = context.configs) == null ? void 0 : _context$configs.debounceDelay) != null ? _ref3 : 0;
4161
- }, [context.configs, requestDebounceDelay]);
4162
- const execute = useCallback(async request => {
4163
- logger.info(`Executing request ${key} ${operation} ${source}`);
4164
- logger.debug('=>', request);
4165
- const abortController = new AbortController();
4166
- setAbortController(abortController);
4167
- const requestConfig = Object.assign({}, request, {
4168
- onUploadProgress(event) {
4169
- dispatch(pending({
4170
- type: 'upload',
4171
- loaded: event.loaded,
4172
- total: event.total
4173
- }));
4174
- request.onUploadProgress == null || request.onUploadProgress(event);
4175
- },
4176
- onDownloadProgress(event) {
4177
- dispatch(pending({
4178
- type: 'download',
4179
- loaded: event.loaded,
4180
- total: event.total
4181
- }));
4182
- request.onDownloadProgress == null || request.onDownloadProgress(event);
4183
- },
4184
- signal: abortController.signal
4185
- });
4186
- await context.execute(requestConfig, dispatch, schema, errorSchema);
4187
- }, [networkState, context.dispatch, axios]);
4188
- const deboundedExecute = useMemo(() => debounce(execute, debounceDelay != null ? debounceDelay : 0), [execute]);
4189
- const clear = useCallback(() => {
4190
- logger.info(`Clearing request ${key} ${operation} ${source}`);
4191
- dispatch(init());
4192
- setAbortController(abortController => {
4193
- logger.info(`Aborting request ${key} ${operation} ${source}`);
4194
- abortController == null || abortController.abort();
4195
- return undefined;
4196
- });
4197
- }, [dispatch, abortController]);
4198
- return [networkState, deboundedExecute, clear, dispatch];
4199
- }
4200
- function debounce(func, delay) {
4201
- let timeoutId;
4202
- return (...args) => {
4203
- if (timeoutId) {
4204
- clearTimeout(timeoutId);
4205
- }
4206
- timeoutId = setTimeout(() => {
4207
- func(...args);
4208
- }, delay);
4209
- };
4210
- }
4211
-
4212
- /**
4213
- * Handles central error extraction from the provided context.
4214
- * It filters the state to retain error states and maps them to a structured error object with additional context information.
4215
- * @return {Object[]} An array of objects representing the error states with context information such as source, operation, and key.
4216
- */
4217
- function useCentralError() {
4218
- const ctx = useContext(Context);
4219
- return useMemo(() => {
4220
- return Object.entries(ctx.filteredState).filter(([, state]) => isError(state)).map(([k, state]) => {
4221
- const [source, operation, key] = k.split(':');
4222
- return Object.assign({}, state, {
4223
- source,
4224
- operation,
4225
- key
4226
- });
4227
- });
4228
- }, [ctx.filteredState]);
4229
- }
4230
-
4231
- /**
4232
- * Uses central pending state handling by aggregating pending states from context.
4233
- * It calculates the overall progress of pending states if any, or returns an initial state otherwise.
4234
- *
4235
- * @return {NetworkState} The aggregated network state based on the pending states and their progress.
4236
- */
4237
- function useCentralPendingState() {
4238
- const ctx = useContext(Context);
4239
- const result = useMemo(() => {
4240
- const pendingStates = Object.values(ctx.filteredState).filter(isPending);
4241
- if (!pendingStates.length) {
4242
- return init();
4243
- }
4244
- const progress = pendingStates.filter(a => a.progress).reduce((progress, current) => {
4245
- var _current$progress$tot, _current$progress, _current$progress$loa, _current$progress2;
4246
- return {
4247
- total: progress.total + ((_current$progress$tot = (_current$progress = current.progress) == null ? void 0 : _current$progress.total) != null ? _current$progress$tot : 0),
4248
- loaded: progress.loaded + ((_current$progress$loa = (_current$progress2 = current.progress) == null ? void 0 : _current$progress2.loaded) != null ? _current$progress$loa : 0)
4249
- };
4250
- }, {
4251
- total: 0,
4252
- loaded: 0
4253
- });
4254
- return pending(progress.total ? progress : undefined);
4255
- }, [ctx.filteredState]);
4256
- return result;
4257
- }
4258
-
4259
- /**
4260
- * A hook for making transient calls that can be aborted and validated against schemas.
4261
- * Returns a promise-based call function and an abort function.
4262
- *
4263
- * @param schema - Optional Zod schema for validating the response
4264
- * @param errorSchema - Optional Zod schema for validating error responses
4265
- * @returns A tuple of [call function, abort function]
4266
- */
4267
- function useTransitionCall({
4268
- schema,
4269
- errorSchema
4270
- }) {
4271
- const ctx = useContext(Context);
4272
- const controller = useRef(undefined);
4273
- const schemaRef = useRef(schema);
4274
- const errorSchemaRef = useRef(errorSchema);
4275
- useEffect(() => {
4276
- schemaRef.current = schema;
4277
- errorSchemaRef.current = errorSchema;
4278
- });
4279
- const call = useCallback(async request => {
4280
- var _controller$current;
4281
- (_controller$current = controller.current) == null || _controller$current.abort();
4282
- const abort = new AbortController();
4283
- controller.current = abort;
4284
- return new Promise((resolve, reject) => {
4285
- ctx.execute(Object.assign({}, request, {
4286
- signal: abort.signal
4287
- }), state => {
4288
- if (isSuccess(state)) {
4289
- resolve(state.data);
4290
- } else if (isError(state)) {
4291
- reject(state.error);
4292
- }
4293
- }, schemaRef.current, errorSchemaRef.current);
4294
- });
4295
- }, [ctx]);
4296
- const abort = useCallback(() => {
4297
- var _controller$current2;
4298
- (_controller$current2 = controller.current) == null || _controller$current2.abort();
4299
- }, []);
4300
- return [call, abort];
4301
- }
4302
-
4303
- /**
4304
- * Converts a given hook into a promise-based function.
4305
- *
4306
- * @param {IntrigHook<P, B, T>} hook - The hook function to be converted.
4307
- * @param {string} [key='default'] - An optional key to uniquely identify the hook instance.
4308
- *
4309
- * @return {[(...params: Parameters<ReturnType<IntrigHook<P, B, T>>[1]>) => Promise<T>, () => void]}
4310
- * Returns a tuple containing a function that invokes the hook as a promise and a function to clear the state.
4311
- */
4312
-
4313
- // **Implementation**
4314
- function useAsPromise(hook, options) {
4315
- // <- Compatible return type
4316
- const resolveRef = useRef(() => {
4317
- // intentionally kept empty
4318
- });
4319
- const rejectRef = useRef(() => {
4320
- // intentionally kept empty
4321
- });
4322
- const [state, dispatch, clear] = hook(options);
4323
- useEffect(() => {
4324
- if (isSuccess(state)) {
4325
- resolveRef.current == null || resolveRef.current(state.data);
4326
- clear();
4327
- } else if (isError(state)) {
4328
- rejectRef.current == null || rejectRef.current(state.error);
4329
- clear();
4330
- }
4331
- }, [state]);
4332
- const promiseFn = useCallback((...args) => {
4333
- return new Promise((resolve, reject) => {
4334
- resolveRef.current = resolve;
4335
- rejectRef.current = reject;
4336
- const dispatchState = dispatch(...args);
4337
- if (isValidationError(dispatchState)) {
4338
- reject(dispatchState.error);
4339
- }
4340
- });
4341
- }, [dispatch]);
4342
- return [promiseFn, clear];
4343
- }
4344
-
4345
- /**
4346
- * A custom hook that manages and returns the network state of a promise-based function,
4347
- * providing a way to execute the function and clear its state.
4348
- *
4349
- * @param fn The promise-based function whose network state is to be managed. It should be a function that returns a promise.
4350
- * @param key An optional identifier for the network state. Defaults to 'default'.
4351
- * @return A tuple containing the current network state, a function to execute the promise, and a function to clear the state.
4352
- */
4353
- function useAsNetworkState(fn, key = 'default') {
4354
- var _context$state3;
4355
- const id = useId();
4356
- const context = useIntrigContext();
4357
- const networkState = useMemo(() => {
4358
- var _context$state, _context$state2;
4359
- return (_context$state = (_context$state2 = context.state) == null ? void 0 : _context$state2[`promiseState:${id}:${key}}`]) != null ? _context$state : init();
4360
- }, [(_context$state3 = context.state) == null ? void 0 : _context$state3[`promiseState:${id}:${key}}`]]);
4361
- const dispatch = useCallback(state => {
4362
- context.dispatch({
4363
- key,
4364
- operation: id,
4365
- source: 'promiseState',
4366
- state
4367
- });
4368
- }, [key, context.dispatch]);
4369
- const execute = useCallback((...args) => {
4370
- dispatch(pending());
4371
- return fn(...args).then(data => {
4372
- dispatch(success(data));
4373
- }, e => {
4374
- dispatch(error(e));
4375
- });
4376
- }, []);
4377
- const clear = useCallback(() => {
4378
- dispatch(init());
4379
- }, []);
4380
- return [networkState, execute, clear];
4381
- }
4382
-
4383
- /**
4384
- * A custom hook that resolves the value from the provided hook's state and updates it whenever the state changes.
4385
- *
4386
- * @param {IntrigHook<P, B, T>} hook - The hook that provides the state to observe and resolve data from.
4387
- * @param options
4388
- * @return {T | undefined} The resolved value from the hook's state or undefined if the state is not successful.
4389
- */
4390
-
4391
- // **Implementation**
4392
- function useResolvedValue(hook, options) {
4393
- const [value, setValue] = useState();
4394
- const [state] = hook(options); // Ensure compatibility with different hook types
4395
-
4396
- useEffect(() => {
4397
- if (isSuccess(state)) {
4398
- setValue(state.data);
4399
- } else {
4400
- setValue(undefined);
4401
- }
4402
- }, [state]);
4403
- return value;
4404
- }
4405
-
4406
- /**
4407
- * A custom hook that resolves and caches the value from a successful state provided by the given hook.
4408
- * The state is updated only when it is in a successful state.
4409
- *
4410
- * @param {IntrigHook<P, B, T>} hook - The hook that provides the state to observe and cache data from.
4411
- * @param options
4412
- * @return {T | undefined} The cached value from the hook's state or undefined if the state is not successful.
4413
- */
4414
-
4415
- // **Implementation**
4416
- function useResolvedCachedValue(hook, options) {
4417
- const [cachedValue, setCachedValue] = useState();
4418
- const [state] = hook(options); // Ensure compatibility with different hook types
4419
-
4420
- useEffect(() => {
4421
- if (isSuccess(state)) {
4422
- setCachedValue(state.data);
4423
- }
4424
- // Do not clear cached value if state is unsuccessful
4425
- }, [state]);
4426
- return cachedValue;
4427
- }
4428
-
4429
- var defineProperty = objectDefineProperty.f;
4430
-
4431
- var proxyAccessor$1 = function (Target, Source, key) {
4432
- key in Target || defineProperty(Target, key, {
4433
- configurable: true,
4434
- get: function () { return Source[key]; },
4435
- set: function (it) { Source[key] = it; }
4436
- });
4437
- };
4438
-
4439
- var isCallable = isCallable$n;
4440
- var isObject$1 = isObject$d;
4441
- var setPrototypeOf$1 = objectSetPrototypeOf;
4442
-
4443
- // makes subclassing work correct for wrapped built-ins
4444
- var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
4445
- var NewTarget, NewTargetPrototype;
4446
- if (
4447
- // it can work only with native `setPrototypeOf`
4448
- setPrototypeOf$1 &&
4449
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
4450
- isCallable(NewTarget = dummy.constructor) &&
4451
- NewTarget !== Wrapper &&
4452
- isObject$1(NewTargetPrototype = NewTarget.prototype) &&
4453
- NewTargetPrototype !== Wrapper.prototype
4454
- ) setPrototypeOf$1($this, NewTargetPrototype);
4455
- return $this;
4456
- };
4457
-
4458
- var toString = toString$3;
4459
-
4460
- var normalizeStringArgument$1 = function (argument, $default) {
4461
- return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
4462
- };
4463
-
4464
- var isObject = isObject$d;
4465
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$8;
4466
-
4467
- // `InstallErrorCause` abstract operation
4468
- // https://tc39.es/ecma262/#sec-installerrorcause
4469
- var installErrorCause$1 = function (O, options) {
4470
- if (isObject(options) && 'cause' in options) {
4471
- createNonEnumerableProperty$2(O, 'cause', options.cause);
4472
- }
4473
- };
4474
-
4475
- var uncurryThis = functionUncurryThis;
4476
-
4477
- var $Error = Error;
4478
- var replace = uncurryThis(''.replace);
4479
-
4480
- var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
4481
- // eslint-disable-next-line redos/no-vulnerable, sonarjs/slow-regex -- safe
4482
- var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
4483
- var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
4484
-
4485
- var errorStackClear = function (stack, dropEntries) {
4486
- if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
4487
- while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
4488
- } return stack;
4489
- };
4490
-
4491
- var fails$1 = fails$k;
4492
- var createPropertyDescriptor = createPropertyDescriptor$5;
4493
-
4494
- var errorStackInstallable = !fails$1(function () {
4495
- var error = new Error('a');
4496
- if (!('stack' in error)) return true;
4497
- // eslint-disable-next-line es/no-object-defineproperty -- safe
4498
- Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
4499
- return error.stack !== 7;
4500
- });
4501
-
4502
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$8;
4503
- var clearErrorStack = errorStackClear;
4504
- var ERROR_STACK_INSTALLABLE = errorStackInstallable;
4505
-
4506
- // non-standard V8
4507
- // eslint-disable-next-line es/no-nonstandard-error-properties -- safe
4508
- var captureStackTrace = Error.captureStackTrace;
4509
-
4510
- var errorStackInstall = function (error, C, stack, dropEntries) {
4511
- if (ERROR_STACK_INSTALLABLE) {
4512
- if (captureStackTrace) captureStackTrace(error, C);
4513
- else createNonEnumerableProperty$1(error, 'stack', clearErrorStack(stack, dropEntries));
4514
- }
4515
- };
4516
-
4517
- var getBuiltIn = getBuiltIn$9;
4518
- var hasOwn = hasOwnProperty_1;
4519
- var createNonEnumerableProperty = createNonEnumerableProperty$8;
4520
- var isPrototypeOf = objectIsPrototypeOf;
4521
- var setPrototypeOf = objectSetPrototypeOf;
4522
- var copyConstructorProperties = copyConstructorProperties$2;
4523
- var proxyAccessor = proxyAccessor$1;
4524
- var inheritIfRequired = inheritIfRequired$1;
4525
- var normalizeStringArgument = normalizeStringArgument$1;
4526
- var installErrorCause = installErrorCause$1;
4527
- var installErrorStack = errorStackInstall;
4528
- var DESCRIPTORS$1 = descriptors;
4529
-
4530
- var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
4531
- var STACK_TRACE_LIMIT = 'stackTraceLimit';
4532
- var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
4533
- var path = FULL_NAME.split('.');
4534
- var ERROR_NAME = path[path.length - 1];
4535
- var OriginalError = getBuiltIn.apply(null, path);
4536
-
4537
- if (!OriginalError) return;
4538
-
4539
- var OriginalErrorPrototype = OriginalError.prototype;
4540
-
4541
- // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
4542
- if (hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
4543
-
4544
- if (!FORCED) return OriginalError;
4545
-
4546
- var BaseError = getBuiltIn('Error');
4547
-
4548
- var WrappedError = wrapper(function (a, b) {
4549
- var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
4550
- var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
4551
- if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
4552
- installErrorStack(result, WrappedError, result.stack, 2);
4553
- if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
4554
- if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
4555
- return result;
4556
- });
4557
-
4558
- WrappedError.prototype = OriginalErrorPrototype;
4559
-
4560
- if (ERROR_NAME !== 'Error') {
4561
- if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
4562
- else copyConstructorProperties(WrappedError, BaseError, { name: true });
4563
- } else if (DESCRIPTORS$1 && STACK_TRACE_LIMIT in OriginalError) {
4564
- proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
4565
- proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
4566
- }
4567
-
4568
- copyConstructorProperties(WrappedError, OriginalError);
4569
-
4570
- try {
4571
- // Safari 13- bug: WebAssembly errors does not have a proper `.name`
4572
- if (OriginalErrorPrototype.name !== ERROR_NAME) {
4573
- createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);
4574
- }
4575
- OriginalErrorPrototype.constructor = WrappedError;
4576
- } catch (error) { /* empty */ }
4577
-
4578
- return WrappedError;
4579
- };
4580
-
4581
- /* eslint-disable no-unused-vars -- required for functions `.length` */
4582
- var $$2 = _export;
4583
- var globalThis$1 = globalThis_1;
4584
- var apply = functionApply;
4585
- var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
4586
-
4587
- var WEB_ASSEMBLY = 'WebAssembly';
4588
- var WebAssembly = globalThis$1[WEB_ASSEMBLY];
4589
-
4590
- // eslint-disable-next-line es/no-error-cause -- feature detection
4591
- var FORCED$1 = new Error('e', { cause: 7 }).cause !== 7;
4592
-
4593
- var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
4594
- var O = {};
4595
- O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$1);
4596
- $$2({ global: true, constructor: true, arity: 1, forced: FORCED$1 }, O);
4597
- };
4598
-
4599
- var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
4600
- if (WebAssembly && WebAssembly[ERROR_NAME]) {
4601
- var O = {};
4602
- O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$1);
4603
- $$2({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$1 }, O);
4604
- }
4605
- };
4606
-
4607
- // https://tc39.es/ecma262/#sec-nativeerror
4608
- exportGlobalErrorCauseWrapper('Error', function (init) {
4609
- return function Error(message) { return apply(init, this, arguments); };
4610
- });
4611
- exportGlobalErrorCauseWrapper('EvalError', function (init) {
4612
- return function EvalError(message) { return apply(init, this, arguments); };
4613
- });
4614
- exportGlobalErrorCauseWrapper('RangeError', function (init) {
4615
- return function RangeError(message) { return apply(init, this, arguments); };
4616
- });
4617
- exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
4618
- return function ReferenceError(message) { return apply(init, this, arguments); };
4619
- });
4620
- exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
4621
- return function SyntaxError(message) { return apply(init, this, arguments); };
4622
- });
4623
- exportGlobalErrorCauseWrapper('TypeError', function (init) {
4624
- return function TypeError(message) { return apply(init, this, arguments); };
4625
- });
4626
- exportGlobalErrorCauseWrapper('URIError', function (init) {
4627
- return function URIError(message) { return apply(init, this, arguments); };
4628
- });
4629
- exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
4630
- return function CompileError(message) { return apply(init, this, arguments); };
4631
- });
4632
- exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
4633
- return function LinkError(message) { return apply(init, this, arguments); };
4634
- });
4635
- exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
4636
- return function RuntimeError(message) { return apply(init, this, arguments); };
4637
- });
4638
-
4639
- var DESCRIPTORS = descriptors;
4640
- var isArray = isArray$2;
4641
-
4642
- var $TypeError$1 = TypeError;
4643
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
4644
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
4645
-
4646
- // Safari < 13 does not throw an error in this case
4647
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
4648
- // makes no sense without proper strict mode support
4649
- if (this !== undefined) return true;
4650
- try {
4651
- // eslint-disable-next-line es/no-object-defineproperty -- safe
4652
- Object.defineProperty([], 'length', { writable: false }).length = 1;
4653
- } catch (error) {
4654
- return error instanceof TypeError;
4655
- }
4656
- }();
4657
-
4658
- var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
4659
- if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
4660
- throw new $TypeError$1('Cannot set read only .length');
4661
- } return O.length = length;
4662
- } : function (O, length) {
4663
- return O.length = length;
4664
- };
4665
-
4666
- var $TypeError = TypeError;
4667
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
4668
-
4669
- var doesNotExceedSafeInteger$1 = function (it) {
4670
- if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
4671
- return it;
4672
- };
4673
-
4674
- var $$1 = _export;
4675
- var toObject = toObject$5;
4676
- var lengthOfArrayLike = lengthOfArrayLike$4;
4677
- var setArrayLength = arraySetLength;
4678
- var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
4679
- var fails = fails$k;
4680
-
4681
- var INCORRECT_TO_LENGTH = fails(function () {
4682
- return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
4683
- });
4684
-
4685
- // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
4686
- // https://bugs.chromium.org/p/v8/issues/detail?id=12681
4687
- var properErrorOnNonWritableLength = function () {
4688
- try {
4689
- // eslint-disable-next-line es/no-object-defineproperty -- safe
4690
- Object.defineProperty([], 'length', { writable: false }).push();
4691
- } catch (error) {
4692
- return error instanceof TypeError;
4693
- }
4694
- };
4695
-
4696
- var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
4697
-
4698
- // `Array.prototype.push` method
4699
- // https://tc39.es/ecma262/#sec-array.prototype.push
4700
- $$1({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
4701
- // eslint-disable-next-line no-unused-vars -- required for `.length`
4702
- push: function push(item) {
4703
- var O = toObject(this);
4704
- var len = lengthOfArrayLike(O);
4705
- var argCount = arguments.length;
4706
- doesNotExceedSafeInteger(len + argCount);
4707
- for (var i = 0; i < argCount; i++) {
4708
- O[len] = arguments[i];
4709
- len++;
4710
- }
4711
- setArrayLength(O, len);
4712
- return len;
4713
- }
4714
- });
4715
-
4716
- var $ = _export;
4717
- var call = functionCall;
4718
- var iterate = iterate$5;
4719
- var aCallable = aCallable$d;
4720
- var anObject = anObject$f;
4721
- var getIteratorDirect = getIteratorDirect$4;
4722
- var iteratorClose = iteratorClose$8;
4723
- var iteratorHelperWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError$4;
4724
-
4725
- var forEachWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('forEach', TypeError);
4726
-
4727
- // `Iterator.prototype.forEach` method
4728
- // https://tc39.es/ecma262/#sec-iterator.prototype.foreach
4729
- $({ target: 'Iterator', proto: true, real: true, forced: forEachWithoutClosingOnEarlyError }, {
4730
- forEach: function forEach(fn) {
4731
- anObject(this);
4732
- try {
4733
- aCallable(fn);
4734
- } catch (error) {
4735
- iteratorClose(this, 'throw', error);
4736
- }
4737
-
4738
- if (forEachWithoutClosingOnEarlyError) return call(forEachWithoutClosingOnEarlyError, this, fn);
4739
-
4740
- var record = getIteratorDirect(this);
4741
- var counter = 0;
4742
- iterate(record, function (value) {
4743
- fn(value, counter++);
4744
- }, { IS_RECORD: true });
4745
- }
4746
- });
4747
-
4748
- // type Encoders = {
4749
- // [k: string]: <T>(
4750
- // request: T,
4751
- // mediaType: string,
4752
- // schema: ZodSchema,
4753
- // ) => Promise<any>;
4754
- // };
4755
-
4756
- const encoders = {};
4757
- function encode(request, mediaType, schema) {
4758
- if (encoders[mediaType]) {
4759
- return encoders[mediaType](request, mediaType, schema);
4760
- }
4761
- return request;
4762
- }
4763
- encoders['application/json'] = (request, mediaType, schema) => {
4764
- return request;
4765
- };
4766
- function appendFormData(formData, data, parentKey) {
4767
- if (data instanceof Blob || typeof data === 'string') {
4768
- formData.append(parentKey, data);
4769
- } else if (data !== null && typeof data === 'object') {
4770
- if (Array.isArray(data)) {
4771
- data.forEach((item, index) => {
4772
- const key = `${parentKey}`;
4773
- appendFormData(formData, item, key);
4774
- });
4775
- } else {
4776
- Object.keys(data).forEach(key => {
4777
- const newKey = parentKey ? `${parentKey}[${key}]` : key;
4778
- appendFormData(formData, data[key], newKey);
4779
- });
4780
- }
4781
- } else {
4782
- formData.append(parentKey, data == null ? '' : String(data));
4783
- }
4784
- }
4785
- encoders['multipart/form-data'] = (request, mediaType, schema) => {
4786
- const _request = request;
4787
- const formData = new FormData();
4788
- Object.keys(_request).forEach(key => {
4789
- appendFormData(formData, _request[key], key);
4790
- });
4791
- return formData;
4792
- };
4793
- encoders['application/octet-stream'] = (request, mediaType, schema) => {
4794
- return request;
4795
- };
4796
- encoders['application/x-www-form-urlencoded'] = (request, mediaType, schema) => {
4797
- const formData = new FormData();
4798
- for (const key in request) {
4799
- const value = request[key];
4800
- formData.append(key, value instanceof Blob || typeof value === 'string' ? value : String(value));
4801
- }
4802
- return formData;
4803
- };
4804
- const transformers = {};
4805
- function transform(request, mediaType, schema) {
4806
- if (transformers[mediaType]) {
4807
- return transformers[mediaType](request, mediaType, schema);
4808
- }
4809
- throw new Error(`Unsupported media type: ` + mediaType);
4810
- }
4811
- transformers['application/json'] = async (request, mediaType, schema) => {
4812
- return schema.parse(await request.json());
4813
- };
4814
- transformers['multipart/form-data'] = async (request, mediaType, schema) => {
4815
- const formData = await request.formData();
4816
- const content = {};
4817
- formData.forEach((value, key) => {
4818
- if (content[key]) {
4819
- if (!(content[key] instanceof Array)) {
4820
- content[key] = [content[key]];
4821
- }
4822
- content[key].push(value);
4823
- } else {
4824
- content[key] = value;
4825
- }
4826
- });
4827
- return schema.parse(content);
4828
- };
4829
- transformers['application/octet-stream'] = async (request, mediaType, schema) => {
4830
- return schema.parse(new Blob([await request.arrayBuffer()], {
4831
- type: 'application/octet-stream'
4832
- }));
4833
- };
4834
- transformers['application/x-www-form-urlencoded'] = async (request, mediaType, schema) => {
4835
- const formData = await request.formData();
4836
- const content = {};
4837
- formData.forEach((value, key) => content[key] = value);
4838
- return schema.parse(content);
4839
- };
4840
- transformers['application/xml'] = async (request, mediaType, schema) => {
4841
- const xmlParser = new XMLParser();
4842
- const content = await xmlParser.parse(await request.text());
4843
- return schema.parse(await content);
4844
- };
4845
- transformers['text/plain'] = async (request, mediaType, schema) => {
4846
- return schema.parse(await request.text());
4847
- };
4848
- transformers['text/html'] = async (request, mediaType, schema) => {
4849
- return schema.parse(await request.text());
4850
- };
4851
- transformers['text/css'] = async (request, mediaType, schema) => {
4852
- return schema.parse(await request.text());
4853
- };
4854
- transformers['text/javascript'] = async (request, mediaType, schema) => {
4855
- return schema.parse(await request.text());
4856
- };
4857
- const responseTransformers = {};
4858
- responseTransformers['application/json'] = async (data, mediaType, schema) => {
4859
- return schema.parse(data);
4860
- };
4861
- responseTransformers['application/xml'] = async (data, mediaType, schema) => {
4862
- const parsed = new XMLParser().parse(data);
4863
- return schema.parse(parsed);
4864
- };
4865
- async function transformResponse(data, mediaType, schema) {
4866
- if (responseTransformers[mediaType]) {
4867
- return await responseTransformers[mediaType](data, mediaType, schema);
4868
- }
4869
- return data;
4870
- }
4871
-
4872
- export { IntrigProvider, IntrigProviderStub, StatusTrap, encode, error, init, isError, isInit, isNetworkError, isPending, isRequestValidationError, isResponseValidationError, isSuccess, isSuccessfulDispatch, isValidationError, networkError, pending, requestValidationError, responseValidationError, success, successfulDispatch, transform, transformResponse, useAsNetworkState, useAsPromise, useCentralError, useCentralPendingState, useNetworkState, useResolvedCachedValue, useResolvedValue, useTransitionCall, validationError };