@dynamic-labs/react-hooks 2.0.0-alpha.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.js ADDED
@@ -0,0 +1,1648 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useRef, useState, useCallback, useEffect, useMemo, useContext, createContext } from 'react';
3
+ import { effect, stop } from '@vue/reactivity';
4
+
5
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
+
7
+ var fails$a = function (exec) {
8
+ try {
9
+ return !!exec();
10
+ } catch (error) {
11
+ return true;
12
+ }
13
+ };
14
+
15
+ var fails$9 = fails$a;
16
+
17
+ var functionBindNative = !fails$9(function () {
18
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
19
+ var test = (function () { /* empty */ }).bind();
20
+ // eslint-disable-next-line no-prototype-builtins -- safe
21
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
22
+ });
23
+
24
+ var NATIVE_BIND$1 = functionBindNative;
25
+
26
+ var FunctionPrototype$1 = Function.prototype;
27
+ var call$5 = FunctionPrototype$1.call;
28
+ var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$5, call$5);
29
+
30
+ var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
31
+ return function () {
32
+ return call$5.apply(fn, arguments);
33
+ };
34
+ };
35
+
36
+ var uncurryThis$8 = functionUncurryThis;
37
+
38
+ var toString$1 = uncurryThis$8({}.toString);
39
+ var stringSlice = uncurryThis$8(''.slice);
40
+
41
+ var classofRaw = function (it) {
42
+ return stringSlice(toString$1(it), 8, -1);
43
+ };
44
+
45
+ var uncurryThis$7 = functionUncurryThis;
46
+ var fails$8 = fails$a;
47
+ var classof = classofRaw;
48
+
49
+ var $Object$3 = Object;
50
+ var split = uncurryThis$7(''.split);
51
+
52
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
53
+ var indexedObject = fails$8(function () {
54
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
55
+ // eslint-disable-next-line no-prototype-builtins -- safe
56
+ return !$Object$3('z').propertyIsEnumerable(0);
57
+ }) ? function (it) {
58
+ return classof(it) == 'String' ? split(it, '') : $Object$3(it);
59
+ } : $Object$3;
60
+
61
+ // we can't use just `it == null` since of `document.all` special case
62
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
63
+ var isNullOrUndefined$2 = function (it) {
64
+ return it === null || it === undefined;
65
+ };
66
+
67
+ var isNullOrUndefined$1 = isNullOrUndefined$2;
68
+
69
+ var $TypeError$6 = TypeError;
70
+
71
+ // `RequireObjectCoercible` abstract operation
72
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
73
+ var requireObjectCoercible$2 = function (it) {
74
+ if (isNullOrUndefined$1(it)) throw $TypeError$6("Can't call method on " + it);
75
+ return it;
76
+ };
77
+
78
+ // toObject with fallback for non-array-like ES3 strings
79
+ var IndexedObject = indexedObject;
80
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
81
+
82
+ var toIndexedObject$5 = function (it) {
83
+ return IndexedObject(requireObjectCoercible$1(it));
84
+ };
85
+
86
+ var check = function (it) {
87
+ return it && it.Math == Math && it;
88
+ };
89
+
90
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
91
+ var global$b =
92
+ // eslint-disable-next-line es/no-global-this -- safe
93
+ check(typeof globalThis == 'object' && globalThis) ||
94
+ check(typeof window == 'object' && window) ||
95
+ // eslint-disable-next-line no-restricted-globals -- safe
96
+ check(typeof self == 'object' && self) ||
97
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
98
+ // eslint-disable-next-line no-new-func -- fallback
99
+ (function () { return this; })() || Function('return this')();
100
+
101
+ var shared$3 = {exports: {}};
102
+
103
+ var global$a = global$b;
104
+
105
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
106
+ var defineProperty$4 = Object.defineProperty;
107
+
108
+ var defineGlobalProperty$3 = function (key, value) {
109
+ try {
110
+ defineProperty$4(global$a, key, { value: value, configurable: true, writable: true });
111
+ } catch (error) {
112
+ global$a[key] = value;
113
+ } return value;
114
+ };
115
+
116
+ var global$9 = global$b;
117
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
118
+
119
+ var SHARED = '__core-js_shared__';
120
+ var store$3 = global$9[SHARED] || defineGlobalProperty$2(SHARED, {});
121
+
122
+ var sharedStore = store$3;
123
+
124
+ var store$2 = sharedStore;
125
+
126
+ (shared$3.exports = function (key, value) {
127
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
128
+ })('versions', []).push({
129
+ version: '3.27.0',
130
+ mode: 'global',
131
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
132
+ license: 'https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE',
133
+ source: 'https://github.com/zloirock/core-js'
134
+ });
135
+
136
+ var requireObjectCoercible = requireObjectCoercible$2;
137
+
138
+ var $Object$2 = Object;
139
+
140
+ // `ToObject` abstract operation
141
+ // https://tc39.es/ecma262/#sec-toobject
142
+ var toObject$2 = function (argument) {
143
+ return $Object$2(requireObjectCoercible(argument));
144
+ };
145
+
146
+ var uncurryThis$6 = functionUncurryThis;
147
+ var toObject$1 = toObject$2;
148
+
149
+ var hasOwnProperty = uncurryThis$6({}.hasOwnProperty);
150
+
151
+ // `HasOwnProperty` abstract operation
152
+ // https://tc39.es/ecma262/#sec-hasownproperty
153
+ // eslint-disable-next-line es/no-object-hasown -- safe
154
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
155
+ return hasOwnProperty(toObject$1(it), key);
156
+ };
157
+
158
+ var uncurryThis$5 = functionUncurryThis;
159
+
160
+ var id = 0;
161
+ var postfix = Math.random();
162
+ var toString = uncurryThis$5(1.0.toString);
163
+
164
+ var uid$2 = function (key) {
165
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
166
+ };
167
+
168
+ var documentAll$2 = typeof document == 'object' && document.all;
169
+
170
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
171
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
172
+ var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
173
+
174
+ var documentAll_1 = {
175
+ all: documentAll$2,
176
+ IS_HTMLDDA: IS_HTMLDDA
177
+ };
178
+
179
+ var $documentAll$1 = documentAll_1;
180
+
181
+ var documentAll$1 = $documentAll$1.all;
182
+
183
+ // `IsCallable` abstract operation
184
+ // https://tc39.es/ecma262/#sec-iscallable
185
+ var isCallable$e = $documentAll$1.IS_HTMLDDA ? function (argument) {
186
+ return typeof argument == 'function' || argument === documentAll$1;
187
+ } : function (argument) {
188
+ return typeof argument == 'function';
189
+ };
190
+
191
+ var global$8 = global$b;
192
+ var isCallable$d = isCallable$e;
193
+
194
+ var aFunction = function (argument) {
195
+ return isCallable$d(argument) ? argument : undefined;
196
+ };
197
+
198
+ var getBuiltIn$4 = function (namespace, method) {
199
+ return arguments.length < 2 ? aFunction(global$8[namespace]) : global$8[namespace] && global$8[namespace][method];
200
+ };
201
+
202
+ var getBuiltIn$3 = getBuiltIn$4;
203
+
204
+ var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
205
+
206
+ var global$7 = global$b;
207
+ var userAgent = engineUserAgent;
208
+
209
+ var process = global$7.process;
210
+ var Deno = global$7.Deno;
211
+ var versions = process && process.versions || Deno && Deno.version;
212
+ var v8 = versions && versions.v8;
213
+ var match, version;
214
+
215
+ if (v8) {
216
+ match = v8.split('.');
217
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
218
+ // but their correct versions are not interesting for us
219
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
220
+ }
221
+
222
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
223
+ // so check `userAgent` even if `.v8` exists, but 0
224
+ if (!version && userAgent) {
225
+ match = userAgent.match(/Edge\/(\d+)/);
226
+ if (!match || match[1] >= 74) {
227
+ match = userAgent.match(/Chrome\/(\d+)/);
228
+ if (match) version = +match[1];
229
+ }
230
+ }
231
+
232
+ var engineV8Version = version;
233
+
234
+ /* eslint-disable es/no-symbol -- required for testing */
235
+
236
+ var V8_VERSION = engineV8Version;
237
+ var fails$7 = fails$a;
238
+
239
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
240
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$7(function () {
241
+ var symbol = Symbol();
242
+ // Chrome 38 Symbol has incorrect toString conversion
243
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
244
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
245
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
246
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
247
+ });
248
+
249
+ /* eslint-disable es/no-symbol -- required for testing */
250
+
251
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
252
+
253
+ var useSymbolAsUid = NATIVE_SYMBOL$1
254
+ && !Symbol.sham
255
+ && typeof Symbol.iterator == 'symbol';
256
+
257
+ var global$6 = global$b;
258
+ var shared$2 = shared$3.exports;
259
+ var hasOwn$8 = hasOwnProperty_1;
260
+ var uid$1 = uid$2;
261
+ var NATIVE_SYMBOL = symbolConstructorDetection;
262
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
263
+
264
+ var WellKnownSymbolsStore = shared$2('wks');
265
+ var Symbol$1 = global$6.Symbol;
266
+ var symbolFor = Symbol$1 && Symbol$1['for'];
267
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
268
+
269
+ var wellKnownSymbol$6 = function (name) {
270
+ if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
271
+ var description = 'Symbol.' + name;
272
+ if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
273
+ WellKnownSymbolsStore[name] = Symbol$1[name];
274
+ } else if (USE_SYMBOL_AS_UID$1 && symbolFor) {
275
+ WellKnownSymbolsStore[name] = symbolFor(description);
276
+ } else {
277
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
278
+ }
279
+ } return WellKnownSymbolsStore[name];
280
+ };
281
+
282
+ var isCallable$c = isCallable$e;
283
+ var $documentAll = documentAll_1;
284
+
285
+ var documentAll = $documentAll.all;
286
+
287
+ var isObject$7 = $documentAll.IS_HTMLDDA ? function (it) {
288
+ return typeof it == 'object' ? it !== null : isCallable$c(it) || it === documentAll;
289
+ } : function (it) {
290
+ return typeof it == 'object' ? it !== null : isCallable$c(it);
291
+ };
292
+
293
+ var isObject$6 = isObject$7;
294
+
295
+ var $String$2 = String;
296
+ var $TypeError$5 = TypeError;
297
+
298
+ // `Assert: Type(argument) is Object`
299
+ var anObject$5 = function (argument) {
300
+ if (isObject$6(argument)) return argument;
301
+ throw $TypeError$5($String$2(argument) + ' is not an object');
302
+ };
303
+
304
+ var objectDefineProperties = {};
305
+
306
+ var fails$6 = fails$a;
307
+
308
+ // Detect IE8's incomplete defineProperty implementation
309
+ var descriptors = !fails$6(function () {
310
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
311
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
312
+ });
313
+
314
+ var DESCRIPTORS$8 = descriptors;
315
+ var fails$5 = fails$a;
316
+
317
+ // V8 ~ Chrome 36-
318
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
319
+ var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$5(function () {
320
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
321
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
322
+ value: 42,
323
+ writable: false
324
+ }).prototype != 42;
325
+ });
326
+
327
+ var objectDefineProperty = {};
328
+
329
+ var global$5 = global$b;
330
+ var isObject$5 = isObject$7;
331
+
332
+ var document$1 = global$5.document;
333
+ // typeof document.createElement is 'object' in old IE
334
+ var EXISTS$1 = isObject$5(document$1) && isObject$5(document$1.createElement);
335
+
336
+ var documentCreateElement$2 = function (it) {
337
+ return EXISTS$1 ? document$1.createElement(it) : {};
338
+ };
339
+
340
+ var DESCRIPTORS$7 = descriptors;
341
+ var fails$4 = fails$a;
342
+ var createElement = documentCreateElement$2;
343
+
344
+ // Thanks to IE8 for its funny defineProperty
345
+ var ie8DomDefine = !DESCRIPTORS$7 && !fails$4(function () {
346
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
347
+ return Object.defineProperty(createElement('div'), 'a', {
348
+ get: function () { return 7; }
349
+ }).a != 7;
350
+ });
351
+
352
+ var NATIVE_BIND = functionBindNative;
353
+
354
+ var call$4 = Function.prototype.call;
355
+
356
+ var functionCall = NATIVE_BIND ? call$4.bind(call$4) : function () {
357
+ return call$4.apply(call$4, arguments);
358
+ };
359
+
360
+ var uncurryThis$4 = functionUncurryThis;
361
+
362
+ var objectIsPrototypeOf = uncurryThis$4({}.isPrototypeOf);
363
+
364
+ var getBuiltIn$2 = getBuiltIn$4;
365
+ var isCallable$b = isCallable$e;
366
+ var isPrototypeOf = objectIsPrototypeOf;
367
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
368
+
369
+ var $Object$1 = Object;
370
+
371
+ var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
372
+ return typeof it == 'symbol';
373
+ } : function (it) {
374
+ var $Symbol = getBuiltIn$2('Symbol');
375
+ return isCallable$b($Symbol) && isPrototypeOf($Symbol.prototype, $Object$1(it));
376
+ };
377
+
378
+ var $String$1 = String;
379
+
380
+ var tryToString$1 = function (argument) {
381
+ try {
382
+ return $String$1(argument);
383
+ } catch (error) {
384
+ return 'Object';
385
+ }
386
+ };
387
+
388
+ var isCallable$a = isCallable$e;
389
+ var tryToString = tryToString$1;
390
+
391
+ var $TypeError$4 = TypeError;
392
+
393
+ // `Assert: IsCallable(argument) is true`
394
+ var aCallable$1 = function (argument) {
395
+ if (isCallable$a(argument)) return argument;
396
+ throw $TypeError$4(tryToString(argument) + ' is not a function');
397
+ };
398
+
399
+ var aCallable = aCallable$1;
400
+ var isNullOrUndefined = isNullOrUndefined$2;
401
+
402
+ // `GetMethod` abstract operation
403
+ // https://tc39.es/ecma262/#sec-getmethod
404
+ var getMethod$1 = function (V, P) {
405
+ var func = V[P];
406
+ return isNullOrUndefined(func) ? undefined : aCallable(func);
407
+ };
408
+
409
+ var call$3 = functionCall;
410
+ var isCallable$9 = isCallable$e;
411
+ var isObject$4 = isObject$7;
412
+
413
+ var $TypeError$3 = TypeError;
414
+
415
+ // `OrdinaryToPrimitive` abstract operation
416
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
417
+ var ordinaryToPrimitive$1 = function (input, pref) {
418
+ var fn, val;
419
+ if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$4(val = call$3(fn, input))) return val;
420
+ if (isCallable$9(fn = input.valueOf) && !isObject$4(val = call$3(fn, input))) return val;
421
+ if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$4(val = call$3(fn, input))) return val;
422
+ throw $TypeError$3("Can't convert object to primitive value");
423
+ };
424
+
425
+ var call$2 = functionCall;
426
+ var isObject$3 = isObject$7;
427
+ var isSymbol$1 = isSymbol$2;
428
+ var getMethod = getMethod$1;
429
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
430
+ var wellKnownSymbol$5 = wellKnownSymbol$6;
431
+
432
+ var $TypeError$2 = TypeError;
433
+ var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
434
+
435
+ // `ToPrimitive` abstract operation
436
+ // https://tc39.es/ecma262/#sec-toprimitive
437
+ var toPrimitive$1 = function (input, pref) {
438
+ if (!isObject$3(input) || isSymbol$1(input)) return input;
439
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
440
+ var result;
441
+ if (exoticToPrim) {
442
+ if (pref === undefined) pref = 'default';
443
+ result = call$2(exoticToPrim, input, pref);
444
+ if (!isObject$3(result) || isSymbol$1(result)) return result;
445
+ throw $TypeError$2("Can't convert object to primitive value");
446
+ }
447
+ if (pref === undefined) pref = 'number';
448
+ return ordinaryToPrimitive(input, pref);
449
+ };
450
+
451
+ var toPrimitive = toPrimitive$1;
452
+ var isSymbol = isSymbol$2;
453
+
454
+ // `ToPropertyKey` abstract operation
455
+ // https://tc39.es/ecma262/#sec-topropertykey
456
+ var toPropertyKey$2 = function (argument) {
457
+ var key = toPrimitive(argument, 'string');
458
+ return isSymbol(key) ? key : key + '';
459
+ };
460
+
461
+ var DESCRIPTORS$6 = descriptors;
462
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
463
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
464
+ var anObject$4 = anObject$5;
465
+ var toPropertyKey$1 = toPropertyKey$2;
466
+
467
+ var $TypeError$1 = TypeError;
468
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
469
+ var $defineProperty = Object.defineProperty;
470
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
471
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
472
+ var ENUMERABLE = 'enumerable';
473
+ var CONFIGURABLE$1 = 'configurable';
474
+ var WRITABLE = 'writable';
475
+
476
+ // `Object.defineProperty` method
477
+ // https://tc39.es/ecma262/#sec-object.defineproperty
478
+ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
479
+ anObject$4(O);
480
+ P = toPropertyKey$1(P);
481
+ anObject$4(Attributes);
482
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
483
+ var current = $getOwnPropertyDescriptor$1(O, P);
484
+ if (current && current[WRITABLE]) {
485
+ O[P] = Attributes.value;
486
+ Attributes = {
487
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
488
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
489
+ writable: false
490
+ };
491
+ }
492
+ } return $defineProperty(O, P, Attributes);
493
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
494
+ anObject$4(O);
495
+ P = toPropertyKey$1(P);
496
+ anObject$4(Attributes);
497
+ if (IE8_DOM_DEFINE$1) try {
498
+ return $defineProperty(O, P, Attributes);
499
+ } catch (error) { /* empty */ }
500
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$1('Accessors not supported');
501
+ if ('value' in Attributes) O[P] = Attributes.value;
502
+ return O;
503
+ };
504
+
505
+ var ceil = Math.ceil;
506
+ var floor = Math.floor;
507
+
508
+ // `Math.trunc` method
509
+ // https://tc39.es/ecma262/#sec-math.trunc
510
+ // eslint-disable-next-line es/no-math-trunc -- safe
511
+ var mathTrunc = Math.trunc || function trunc(x) {
512
+ var n = +x;
513
+ return (n > 0 ? floor : ceil)(n);
514
+ };
515
+
516
+ var trunc = mathTrunc;
517
+
518
+ // `ToIntegerOrInfinity` abstract operation
519
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
520
+ var toIntegerOrInfinity$2 = function (argument) {
521
+ var number = +argument;
522
+ // eslint-disable-next-line no-self-compare -- NaN check
523
+ return number !== number || number === 0 ? 0 : trunc(number);
524
+ };
525
+
526
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
527
+
528
+ var max = Math.max;
529
+ var min$1 = Math.min;
530
+
531
+ // Helper for a popular repeating case of the spec:
532
+ // Let integer be ? ToInteger(index).
533
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
534
+ var toAbsoluteIndex$1 = function (index, length) {
535
+ var integer = toIntegerOrInfinity$1(index);
536
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
537
+ };
538
+
539
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
540
+
541
+ var min = Math.min;
542
+
543
+ // `ToLength` abstract operation
544
+ // https://tc39.es/ecma262/#sec-tolength
545
+ var toLength$1 = function (argument) {
546
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
547
+ };
548
+
549
+ var toLength = toLength$1;
550
+
551
+ // `LengthOfArrayLike` abstract operation
552
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
553
+ var lengthOfArrayLike$1 = function (obj) {
554
+ return toLength(obj.length);
555
+ };
556
+
557
+ var toIndexedObject$4 = toIndexedObject$5;
558
+ var toAbsoluteIndex = toAbsoluteIndex$1;
559
+ var lengthOfArrayLike = lengthOfArrayLike$1;
560
+
561
+ // `Array.prototype.{ indexOf, includes }` methods implementation
562
+ var createMethod = function (IS_INCLUDES) {
563
+ return function ($this, el, fromIndex) {
564
+ var O = toIndexedObject$4($this);
565
+ var length = lengthOfArrayLike(O);
566
+ var index = toAbsoluteIndex(fromIndex, length);
567
+ var value;
568
+ // Array#includes uses SameValueZero equality algorithm
569
+ // eslint-disable-next-line no-self-compare -- NaN check
570
+ if (IS_INCLUDES && el != el) while (length > index) {
571
+ value = O[index++];
572
+ // eslint-disable-next-line no-self-compare -- NaN check
573
+ if (value != value) return true;
574
+ // Array#indexOf ignores holes, Array#includes - not
575
+ } else for (;length > index; index++) {
576
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
577
+ } return !IS_INCLUDES && -1;
578
+ };
579
+ };
580
+
581
+ var arrayIncludes = {
582
+ // `Array.prototype.includes` method
583
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
584
+ includes: createMethod(true),
585
+ // `Array.prototype.indexOf` method
586
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
587
+ indexOf: createMethod(false)
588
+ };
589
+
590
+ var hiddenKeys$4 = {};
591
+
592
+ var uncurryThis$3 = functionUncurryThis;
593
+ var hasOwn$7 = hasOwnProperty_1;
594
+ var toIndexedObject$3 = toIndexedObject$5;
595
+ var indexOf = arrayIncludes.indexOf;
596
+ var hiddenKeys$3 = hiddenKeys$4;
597
+
598
+ var push = uncurryThis$3([].push);
599
+
600
+ var objectKeysInternal = function (object, names) {
601
+ var O = toIndexedObject$3(object);
602
+ var i = 0;
603
+ var result = [];
604
+ var key;
605
+ for (key in O) !hasOwn$7(hiddenKeys$3, key) && hasOwn$7(O, key) && push(result, key);
606
+ // Don't enum bug & hidden keys
607
+ while (names.length > i) if (hasOwn$7(O, key = names[i++])) {
608
+ ~indexOf(result, key) || push(result, key);
609
+ }
610
+ return result;
611
+ };
612
+
613
+ // IE8- don't enum bug keys
614
+ var enumBugKeys$3 = [
615
+ 'constructor',
616
+ 'hasOwnProperty',
617
+ 'isPrototypeOf',
618
+ 'propertyIsEnumerable',
619
+ 'toLocaleString',
620
+ 'toString',
621
+ 'valueOf'
622
+ ];
623
+
624
+ var internalObjectKeys$1 = objectKeysInternal;
625
+ var enumBugKeys$2 = enumBugKeys$3;
626
+
627
+ // `Object.keys` method
628
+ // https://tc39.es/ecma262/#sec-object.keys
629
+ // eslint-disable-next-line es/no-object-keys -- safe
630
+ var objectKeys$1 = Object.keys || function keys(O) {
631
+ return internalObjectKeys$1(O, enumBugKeys$2);
632
+ };
633
+
634
+ var DESCRIPTORS$5 = descriptors;
635
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
636
+ var definePropertyModule$3 = objectDefineProperty;
637
+ var anObject$3 = anObject$5;
638
+ var toIndexedObject$2 = toIndexedObject$5;
639
+ var objectKeys = objectKeys$1;
640
+
641
+ // `Object.defineProperties` method
642
+ // https://tc39.es/ecma262/#sec-object.defineproperties
643
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
644
+ objectDefineProperties.f = DESCRIPTORS$5 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
645
+ anObject$3(O);
646
+ var props = toIndexedObject$2(Properties);
647
+ var keys = objectKeys(Properties);
648
+ var length = keys.length;
649
+ var index = 0;
650
+ var key;
651
+ while (length > index) definePropertyModule$3.f(O, key = keys[index++], props[key]);
652
+ return O;
653
+ };
654
+
655
+ var getBuiltIn$1 = getBuiltIn$4;
656
+
657
+ var html$1 = getBuiltIn$1('document', 'documentElement');
658
+
659
+ var shared$1 = shared$3.exports;
660
+ var uid = uid$2;
661
+
662
+ var keys = shared$1('keys');
663
+
664
+ var sharedKey$3 = function (key) {
665
+ return keys[key] || (keys[key] = uid(key));
666
+ };
667
+
668
+ /* global ActiveXObject -- old IE, WSH */
669
+
670
+ var anObject$2 = anObject$5;
671
+ var definePropertiesModule = objectDefineProperties;
672
+ var enumBugKeys$1 = enumBugKeys$3;
673
+ var hiddenKeys$2 = hiddenKeys$4;
674
+ var html = html$1;
675
+ var documentCreateElement$1 = documentCreateElement$2;
676
+ var sharedKey$2 = sharedKey$3;
677
+
678
+ var GT = '>';
679
+ var LT = '<';
680
+ var PROTOTYPE = 'prototype';
681
+ var SCRIPT = 'script';
682
+ var IE_PROTO$1 = sharedKey$2('IE_PROTO');
683
+
684
+ var EmptyConstructor = function () { /* empty */ };
685
+
686
+ var scriptTag = function (content) {
687
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
688
+ };
689
+
690
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
691
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
692
+ activeXDocument.write(scriptTag(''));
693
+ activeXDocument.close();
694
+ var temp = activeXDocument.parentWindow.Object;
695
+ activeXDocument = null; // avoid memory leak
696
+ return temp;
697
+ };
698
+
699
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
700
+ var NullProtoObjectViaIFrame = function () {
701
+ // Thrash, waste and sodomy: IE GC bug
702
+ var iframe = documentCreateElement$1('iframe');
703
+ var JS = 'java' + SCRIPT + ':';
704
+ var iframeDocument;
705
+ iframe.style.display = 'none';
706
+ html.appendChild(iframe);
707
+ // https://github.com/zloirock/core-js/issues/475
708
+ iframe.src = String(JS);
709
+ iframeDocument = iframe.contentWindow.document;
710
+ iframeDocument.open();
711
+ iframeDocument.write(scriptTag('document.F=Object'));
712
+ iframeDocument.close();
713
+ return iframeDocument.F;
714
+ };
715
+
716
+ // Check for document.domain and active x support
717
+ // No need to use active x approach when document.domain is not set
718
+ // see https://github.com/es-shims/es5-shim/issues/150
719
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
720
+ // avoid IE GC bug
721
+ var activeXDocument;
722
+ var NullProtoObject = function () {
723
+ try {
724
+ activeXDocument = new ActiveXObject('htmlfile');
725
+ } catch (error) { /* ignore */ }
726
+ NullProtoObject = typeof document != 'undefined'
727
+ ? document.domain && activeXDocument
728
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
729
+ : NullProtoObjectViaIFrame()
730
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
731
+ var length = enumBugKeys$1.length;
732
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys$1[length]];
733
+ return NullProtoObject();
734
+ };
735
+
736
+ hiddenKeys$2[IE_PROTO$1] = true;
737
+
738
+ // `Object.create` method
739
+ // https://tc39.es/ecma262/#sec-object.create
740
+ // eslint-disable-next-line es/no-object-create -- safe
741
+ var objectCreate = Object.create || function create(O, Properties) {
742
+ var result;
743
+ if (O !== null) {
744
+ EmptyConstructor[PROTOTYPE] = anObject$2(O);
745
+ result = new EmptyConstructor();
746
+ EmptyConstructor[PROTOTYPE] = null;
747
+ // add "__proto__" for Object.getPrototypeOf polyfill
748
+ result[IE_PROTO$1] = O;
749
+ } else result = NullProtoObject();
750
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
751
+ };
752
+
753
+ var wellKnownSymbol$4 = wellKnownSymbol$6;
754
+ var create$1 = objectCreate;
755
+ var defineProperty$3 = objectDefineProperty.f;
756
+
757
+ var UNSCOPABLES = wellKnownSymbol$4('unscopables');
758
+ var ArrayPrototype = Array.prototype;
759
+
760
+ // Array.prototype[@@unscopables]
761
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
762
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
763
+ defineProperty$3(ArrayPrototype, UNSCOPABLES, {
764
+ configurable: true,
765
+ value: create$1(null)
766
+ });
767
+ }
768
+
769
+ // add a key to Array.prototype[@@unscopables]
770
+ var addToUnscopables$1 = function (key) {
771
+ ArrayPrototype[UNSCOPABLES][key] = true;
772
+ };
773
+
774
+ var iterators = {};
775
+
776
+ var global$4 = global$b;
777
+ var isCallable$8 = isCallable$e;
778
+
779
+ var WeakMap$1 = global$4.WeakMap;
780
+
781
+ var weakMapBasicDetection = isCallable$8(WeakMap$1) && /native code/.test(String(WeakMap$1));
782
+
783
+ var createPropertyDescriptor$3 = function (bitmap, value) {
784
+ return {
785
+ enumerable: !(bitmap & 1),
786
+ configurable: !(bitmap & 2),
787
+ writable: !(bitmap & 4),
788
+ value: value
789
+ };
790
+ };
791
+
792
+ var DESCRIPTORS$4 = descriptors;
793
+ var definePropertyModule$2 = objectDefineProperty;
794
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
795
+
796
+ var createNonEnumerableProperty$4 = DESCRIPTORS$4 ? function (object, key, value) {
797
+ return definePropertyModule$2.f(object, key, createPropertyDescriptor$2(1, value));
798
+ } : function (object, key, value) {
799
+ object[key] = value;
800
+ return object;
801
+ };
802
+
803
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
804
+ var global$3 = global$b;
805
+ var isObject$2 = isObject$7;
806
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
807
+ var hasOwn$6 = hasOwnProperty_1;
808
+ var shared = sharedStore;
809
+ var sharedKey$1 = sharedKey$3;
810
+ var hiddenKeys$1 = hiddenKeys$4;
811
+
812
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
813
+ var TypeError$1 = global$3.TypeError;
814
+ var WeakMap = global$3.WeakMap;
815
+ var set, get, has;
816
+
817
+ var enforce = function (it) {
818
+ return has(it) ? get(it) : set(it, {});
819
+ };
820
+
821
+ var getterFor = function (TYPE) {
822
+ return function (it) {
823
+ var state;
824
+ if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
825
+ throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
826
+ } return state;
827
+ };
828
+ };
829
+
830
+ if (NATIVE_WEAK_MAP || shared.state) {
831
+ var store$1 = shared.state || (shared.state = new WeakMap());
832
+ /* eslint-disable no-self-assign -- prototype methods protection */
833
+ store$1.get = store$1.get;
834
+ store$1.has = store$1.has;
835
+ store$1.set = store$1.set;
836
+ /* eslint-enable no-self-assign -- prototype methods protection */
837
+ set = function (it, metadata) {
838
+ if (store$1.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
839
+ metadata.facade = it;
840
+ store$1.set(it, metadata);
841
+ return metadata;
842
+ };
843
+ get = function (it) {
844
+ return store$1.get(it) || {};
845
+ };
846
+ has = function (it) {
847
+ return store$1.has(it);
848
+ };
849
+ } else {
850
+ var STATE = sharedKey$1('state');
851
+ hiddenKeys$1[STATE] = true;
852
+ set = function (it, metadata) {
853
+ if (hasOwn$6(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
854
+ metadata.facade = it;
855
+ createNonEnumerableProperty$3(it, STATE, metadata);
856
+ return metadata;
857
+ };
858
+ get = function (it) {
859
+ return hasOwn$6(it, STATE) ? it[STATE] : {};
860
+ };
861
+ has = function (it) {
862
+ return hasOwn$6(it, STATE);
863
+ };
864
+ }
865
+
866
+ var internalState = {
867
+ set: set,
868
+ get: get,
869
+ has: has,
870
+ enforce: enforce,
871
+ getterFor: getterFor
872
+ };
873
+
874
+ var objectGetOwnPropertyDescriptor = {};
875
+
876
+ var objectPropertyIsEnumerable = {};
877
+
878
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
879
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
880
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
881
+
882
+ // Nashorn ~ JDK8 bug
883
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
884
+
885
+ // `Object.prototype.propertyIsEnumerable` method implementation
886
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
887
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
888
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
889
+ return !!descriptor && descriptor.enumerable;
890
+ } : $propertyIsEnumerable;
891
+
892
+ var DESCRIPTORS$3 = descriptors;
893
+ var call$1 = functionCall;
894
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
895
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
896
+ var toIndexedObject$1 = toIndexedObject$5;
897
+ var toPropertyKey = toPropertyKey$2;
898
+ var hasOwn$5 = hasOwnProperty_1;
899
+ var IE8_DOM_DEFINE = ie8DomDefine;
900
+
901
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
902
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
903
+
904
+ // `Object.getOwnPropertyDescriptor` method
905
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
906
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
907
+ O = toIndexedObject$1(O);
908
+ P = toPropertyKey(P);
909
+ if (IE8_DOM_DEFINE) try {
910
+ return $getOwnPropertyDescriptor(O, P);
911
+ } catch (error) { /* empty */ }
912
+ if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$1(propertyIsEnumerableModule.f, O, P), O[P]);
913
+ };
914
+
915
+ var makeBuiltIn$2 = {exports: {}};
916
+
917
+ var DESCRIPTORS$2 = descriptors;
918
+ var hasOwn$4 = hasOwnProperty_1;
919
+
920
+ var FunctionPrototype = Function.prototype;
921
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
922
+ var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
923
+
924
+ var EXISTS = hasOwn$4(FunctionPrototype, 'name');
925
+ // additional protection from minified / mangled / dropped function names
926
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
927
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
928
+
929
+ var functionName = {
930
+ EXISTS: EXISTS,
931
+ PROPER: PROPER,
932
+ CONFIGURABLE: CONFIGURABLE
933
+ };
934
+
935
+ var uncurryThis$2 = functionUncurryThis;
936
+ var isCallable$7 = isCallable$e;
937
+ var store = sharedStore;
938
+
939
+ var functionToString = uncurryThis$2(Function.toString);
940
+
941
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
942
+ if (!isCallable$7(store.inspectSource)) {
943
+ store.inspectSource = function (it) {
944
+ return functionToString(it);
945
+ };
946
+ }
947
+
948
+ var inspectSource$1 = store.inspectSource;
949
+
950
+ var fails$3 = fails$a;
951
+ var isCallable$6 = isCallable$e;
952
+ var hasOwn$3 = hasOwnProperty_1;
953
+ var DESCRIPTORS$1 = descriptors;
954
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
955
+ var inspectSource = inspectSource$1;
956
+ var InternalStateModule$1 = internalState;
957
+
958
+ var enforceInternalState = InternalStateModule$1.enforce;
959
+ var getInternalState$1 = InternalStateModule$1.get;
960
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
961
+ var defineProperty$2 = Object.defineProperty;
962
+
963
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$1 && !fails$3(function () {
964
+ return defineProperty$2(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
965
+ });
966
+
967
+ var TEMPLATE = String(String).split('String');
968
+
969
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
970
+ if (String(name).slice(0, 7) === 'Symbol(') {
971
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
972
+ }
973
+ if (options && options.getter) name = 'get ' + name;
974
+ if (options && options.setter) name = 'set ' + name;
975
+ if (!hasOwn$3(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
976
+ if (DESCRIPTORS$1) defineProperty$2(value, 'name', { value: name, configurable: true });
977
+ else value.name = name;
978
+ }
979
+ if (CONFIGURABLE_LENGTH && options && hasOwn$3(options, 'arity') && value.length !== options.arity) {
980
+ defineProperty$2(value, 'length', { value: options.arity });
981
+ }
982
+ try {
983
+ if (options && hasOwn$3(options, 'constructor') && options.constructor) {
984
+ if (DESCRIPTORS$1) defineProperty$2(value, 'prototype', { writable: false });
985
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
986
+ } else if (value.prototype) value.prototype = undefined;
987
+ } catch (error) { /* empty */ }
988
+ var state = enforceInternalState(value);
989
+ if (!hasOwn$3(state, 'source')) {
990
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
991
+ } return value;
992
+ };
993
+
994
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
995
+ // eslint-disable-next-line no-extend-native -- required
996
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
997
+ return isCallable$6(this) && getInternalState$1(this).source || inspectSource(this);
998
+ }, 'toString');
999
+
1000
+ var isCallable$5 = isCallable$e;
1001
+ var definePropertyModule$1 = objectDefineProperty;
1002
+ var makeBuiltIn = makeBuiltIn$2.exports;
1003
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
1004
+
1005
+ var defineBuiltIn$3 = function (O, key, value, options) {
1006
+ if (!options) options = {};
1007
+ var simple = options.enumerable;
1008
+ var name = options.name !== undefined ? options.name : key;
1009
+ if (isCallable$5(value)) makeBuiltIn(value, name, options);
1010
+ if (options.global) {
1011
+ if (simple) O[key] = value;
1012
+ else defineGlobalProperty$1(key, value);
1013
+ } else {
1014
+ try {
1015
+ if (!options.unsafe) delete O[key];
1016
+ else if (O[key]) simple = true;
1017
+ } catch (error) { /* empty */ }
1018
+ if (simple) O[key] = value;
1019
+ else definePropertyModule$1.f(O, key, {
1020
+ value: value,
1021
+ enumerable: false,
1022
+ configurable: !options.nonConfigurable,
1023
+ writable: !options.nonWritable
1024
+ });
1025
+ } return O;
1026
+ };
1027
+
1028
+ var objectGetOwnPropertyNames = {};
1029
+
1030
+ var internalObjectKeys = objectKeysInternal;
1031
+ var enumBugKeys = enumBugKeys$3;
1032
+
1033
+ var hiddenKeys = enumBugKeys.concat('length', 'prototype');
1034
+
1035
+ // `Object.getOwnPropertyNames` method
1036
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
1037
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1038
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1039
+ return internalObjectKeys(O, hiddenKeys);
1040
+ };
1041
+
1042
+ var objectGetOwnPropertySymbols = {};
1043
+
1044
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1045
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1046
+
1047
+ var getBuiltIn = getBuiltIn$4;
1048
+ var uncurryThis$1 = functionUncurryThis;
1049
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1050
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1051
+ var anObject$1 = anObject$5;
1052
+
1053
+ var concat = uncurryThis$1([].concat);
1054
+
1055
+ // all object keys, includes non-enumerable and symbols
1056
+ var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
1057
+ var keys = getOwnPropertyNamesModule.f(anObject$1(it));
1058
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1059
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
1060
+ };
1061
+
1062
+ var hasOwn$2 = hasOwnProperty_1;
1063
+ var ownKeys = ownKeys$1;
1064
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1065
+ var definePropertyModule = objectDefineProperty;
1066
+
1067
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
1068
+ var keys = ownKeys(source);
1069
+ var defineProperty = definePropertyModule.f;
1070
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1071
+ for (var i = 0; i < keys.length; i++) {
1072
+ var key = keys[i];
1073
+ if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
1074
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1075
+ }
1076
+ }
1077
+ };
1078
+
1079
+ var fails$2 = fails$a;
1080
+ var isCallable$4 = isCallable$e;
1081
+
1082
+ var replacement = /#|\.prototype\./;
1083
+
1084
+ var isForced$1 = function (feature, detection) {
1085
+ var value = data[normalize(feature)];
1086
+ return value == POLYFILL ? true
1087
+ : value == NATIVE ? false
1088
+ : isCallable$4(detection) ? fails$2(detection)
1089
+ : !!detection;
1090
+ };
1091
+
1092
+ var normalize = isForced$1.normalize = function (string) {
1093
+ return String(string).replace(replacement, '.').toLowerCase();
1094
+ };
1095
+
1096
+ var data = isForced$1.data = {};
1097
+ var NATIVE = isForced$1.NATIVE = 'N';
1098
+ var POLYFILL = isForced$1.POLYFILL = 'P';
1099
+
1100
+ var isForced_1 = isForced$1;
1101
+
1102
+ var global$2 = global$b;
1103
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1104
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
1105
+ var defineBuiltIn$2 = defineBuiltIn$3;
1106
+ var defineGlobalProperty = defineGlobalProperty$3;
1107
+ var copyConstructorProperties = copyConstructorProperties$1;
1108
+ var isForced = isForced_1;
1109
+
1110
+ /*
1111
+ options.target - name of the target object
1112
+ options.global - target is the global object
1113
+ options.stat - export as static methods of target
1114
+ options.proto - export as prototype methods of target
1115
+ options.real - real prototype method for the `pure` version
1116
+ options.forced - export even if the native feature is available
1117
+ options.bind - bind methods to the target, required for the `pure` version
1118
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1119
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
1120
+ options.sham - add a flag to not completely full polyfills
1121
+ options.enumerable - export as enumerable property
1122
+ options.dontCallGetSet - prevent calling a getter on target
1123
+ options.name - the .name of the function if it does not match the key
1124
+ */
1125
+ var _export = function (options, source) {
1126
+ var TARGET = options.target;
1127
+ var GLOBAL = options.global;
1128
+ var STATIC = options.stat;
1129
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1130
+ if (GLOBAL) {
1131
+ target = global$2;
1132
+ } else if (STATIC) {
1133
+ target = global$2[TARGET] || defineGlobalProperty(TARGET, {});
1134
+ } else {
1135
+ target = (global$2[TARGET] || {}).prototype;
1136
+ }
1137
+ if (target) for (key in source) {
1138
+ sourceProperty = source[key];
1139
+ if (options.dontCallGetSet) {
1140
+ descriptor = getOwnPropertyDescriptor(target, key);
1141
+ targetProperty = descriptor && descriptor.value;
1142
+ } else targetProperty = target[key];
1143
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1144
+ // contained in target
1145
+ if (!FORCED && targetProperty !== undefined) {
1146
+ if (typeof sourceProperty == typeof targetProperty) continue;
1147
+ copyConstructorProperties(sourceProperty, targetProperty);
1148
+ }
1149
+ // add a flag to not completely full polyfills
1150
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1151
+ createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1152
+ }
1153
+ defineBuiltIn$2(target, key, sourceProperty, options);
1154
+ }
1155
+ };
1156
+
1157
+ var fails$1 = fails$a;
1158
+
1159
+ var correctPrototypeGetter = !fails$1(function () {
1160
+ function F() { /* empty */ }
1161
+ F.prototype.constructor = null;
1162
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1163
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1164
+ });
1165
+
1166
+ var hasOwn$1 = hasOwnProperty_1;
1167
+ var isCallable$3 = isCallable$e;
1168
+ var toObject = toObject$2;
1169
+ var sharedKey = sharedKey$3;
1170
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1171
+
1172
+ var IE_PROTO = sharedKey('IE_PROTO');
1173
+ var $Object = Object;
1174
+ var ObjectPrototype = $Object.prototype;
1175
+
1176
+ // `Object.getPrototypeOf` method
1177
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1178
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1179
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1180
+ var object = toObject(O);
1181
+ if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1182
+ var constructor = object.constructor;
1183
+ if (isCallable$3(constructor) && object instanceof constructor) {
1184
+ return constructor.prototype;
1185
+ } return object instanceof $Object ? ObjectPrototype : null;
1186
+ };
1187
+
1188
+ var fails = fails$a;
1189
+ var isCallable$2 = isCallable$e;
1190
+ var isObject$1 = isObject$7;
1191
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1192
+ var defineBuiltIn$1 = defineBuiltIn$3;
1193
+ var wellKnownSymbol$3 = wellKnownSymbol$6;
1194
+
1195
+ var ITERATOR$2 = wellKnownSymbol$3('iterator');
1196
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1197
+
1198
+ // `%IteratorPrototype%` object
1199
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1200
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1201
+
1202
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1203
+ if ([].keys) {
1204
+ arrayIterator = [].keys();
1205
+ // Safari 8 has buggy iterators w/o `next`
1206
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1207
+ else {
1208
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1209
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1210
+ }
1211
+ }
1212
+
1213
+ var NEW_ITERATOR_PROTOTYPE = !isObject$1(IteratorPrototype$2) || fails(function () {
1214
+ var test = {};
1215
+ // FF44- legacy iterators case
1216
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1217
+ });
1218
+
1219
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1220
+
1221
+ // `%IteratorPrototype%[@@iterator]()` method
1222
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1223
+ if (!isCallable$2(IteratorPrototype$2[ITERATOR$2])) {
1224
+ defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
1225
+ return this;
1226
+ });
1227
+ }
1228
+
1229
+ var iteratorsCore = {
1230
+ IteratorPrototype: IteratorPrototype$2,
1231
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1232
+ };
1233
+
1234
+ var defineProperty$1 = objectDefineProperty.f;
1235
+ var hasOwn = hasOwnProperty_1;
1236
+ var wellKnownSymbol$2 = wellKnownSymbol$6;
1237
+
1238
+ var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
1239
+
1240
+ var setToStringTag$2 = function (target, TAG, STATIC) {
1241
+ if (target && !STATIC) target = target.prototype;
1242
+ if (target && !hasOwn(target, TO_STRING_TAG$1)) {
1243
+ defineProperty$1(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
1244
+ }
1245
+ };
1246
+
1247
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1248
+ var create = objectCreate;
1249
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1250
+ var setToStringTag$1 = setToStringTag$2;
1251
+ var Iterators$2 = iterators;
1252
+
1253
+ var returnThis$1 = function () { return this; };
1254
+
1255
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1256
+ var TO_STRING_TAG = NAME + ' Iterator';
1257
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1258
+ setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
1259
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
1260
+ return IteratorConstructor;
1261
+ };
1262
+
1263
+ var isCallable$1 = isCallable$e;
1264
+
1265
+ var $String = String;
1266
+ var $TypeError = TypeError;
1267
+
1268
+ var aPossiblePrototype$1 = function (argument) {
1269
+ if (typeof argument == 'object' || isCallable$1(argument)) return argument;
1270
+ throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
1271
+ };
1272
+
1273
+ /* eslint-disable no-proto -- safe */
1274
+
1275
+ var uncurryThis = functionUncurryThis;
1276
+ var anObject = anObject$5;
1277
+ var aPossiblePrototype = aPossiblePrototype$1;
1278
+
1279
+ // `Object.setPrototypeOf` method
1280
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1281
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1282
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1283
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1284
+ var CORRECT_SETTER = false;
1285
+ var test = {};
1286
+ var setter;
1287
+ try {
1288
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1289
+ setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1290
+ setter(test, []);
1291
+ CORRECT_SETTER = test instanceof Array;
1292
+ } catch (error) { /* empty */ }
1293
+ return function setPrototypeOf(O, proto) {
1294
+ anObject(O);
1295
+ aPossiblePrototype(proto);
1296
+ if (CORRECT_SETTER) setter(O, proto);
1297
+ else O.__proto__ = proto;
1298
+ return O;
1299
+ };
1300
+ }() : undefined);
1301
+
1302
+ var $ = _export;
1303
+ var call = functionCall;
1304
+ var FunctionName = functionName;
1305
+ var isCallable = isCallable$e;
1306
+ var createIteratorConstructor = iteratorCreateConstructor;
1307
+ var getPrototypeOf = objectGetPrototypeOf;
1308
+ var setPrototypeOf = objectSetPrototypeOf;
1309
+ var setToStringTag = setToStringTag$2;
1310
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1311
+ var defineBuiltIn = defineBuiltIn$3;
1312
+ var wellKnownSymbol$1 = wellKnownSymbol$6;
1313
+ var Iterators$1 = iterators;
1314
+ var IteratorsCore = iteratorsCore;
1315
+
1316
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1317
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1318
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1319
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1320
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
1321
+ var KEYS = 'keys';
1322
+ var VALUES = 'values';
1323
+ var ENTRIES = 'entries';
1324
+
1325
+ var returnThis = function () { return this; };
1326
+
1327
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1328
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1329
+
1330
+ var getIterationMethod = function (KIND) {
1331
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1332
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1333
+ switch (KIND) {
1334
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1335
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1336
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1337
+ } return function () { return new IteratorConstructor(this); };
1338
+ };
1339
+
1340
+ var TO_STRING_TAG = NAME + ' Iterator';
1341
+ var INCORRECT_VALUES_NAME = false;
1342
+ var IterablePrototype = Iterable.prototype;
1343
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1344
+ || IterablePrototype['@@iterator']
1345
+ || DEFAULT && IterablePrototype[DEFAULT];
1346
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1347
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1348
+ var CurrentIteratorPrototype, methods, KEY;
1349
+
1350
+ // fix native
1351
+ if (anyNativeIterator) {
1352
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1353
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1354
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1355
+ if (setPrototypeOf) {
1356
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1357
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
1358
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1359
+ }
1360
+ }
1361
+ // Set @@toStringTag to native iterators
1362
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1363
+ }
1364
+ }
1365
+
1366
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1367
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1368
+ if (CONFIGURABLE_FUNCTION_NAME) {
1369
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1370
+ } else {
1371
+ INCORRECT_VALUES_NAME = true;
1372
+ defaultIterator = function values() { return call(nativeIterator, this); };
1373
+ }
1374
+ }
1375
+
1376
+ // export additional methods
1377
+ if (DEFAULT) {
1378
+ methods = {
1379
+ values: getIterationMethod(VALUES),
1380
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1381
+ entries: getIterationMethod(ENTRIES)
1382
+ };
1383
+ if (FORCED) for (KEY in methods) {
1384
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1385
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
1386
+ }
1387
+ } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1388
+ }
1389
+
1390
+ // define iterator
1391
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1392
+ defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1393
+ }
1394
+ Iterators$1[NAME] = defaultIterator;
1395
+
1396
+ return methods;
1397
+ };
1398
+
1399
+ // `CreateIterResultObject` abstract operation
1400
+ // https://tc39.es/ecma262/#sec-createiterresultobject
1401
+ var createIterResultObject$1 = function (value, done) {
1402
+ return { value: value, done: done };
1403
+ };
1404
+
1405
+ var toIndexedObject = toIndexedObject$5;
1406
+ var addToUnscopables = addToUnscopables$1;
1407
+ var Iterators = iterators;
1408
+ var InternalStateModule = internalState;
1409
+ var defineProperty = objectDefineProperty.f;
1410
+ var defineIterator = iteratorDefine;
1411
+ var createIterResultObject = createIterResultObject$1;
1412
+ var DESCRIPTORS = descriptors;
1413
+
1414
+ var ARRAY_ITERATOR = 'Array Iterator';
1415
+ var setInternalState = InternalStateModule.set;
1416
+ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
1417
+
1418
+ // `Array.prototype.entries` method
1419
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1420
+ // `Array.prototype.keys` method
1421
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1422
+ // `Array.prototype.values` method
1423
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1424
+ // `Array.prototype[@@iterator]` method
1425
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1426
+ // `CreateArrayIterator` internal method
1427
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1428
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1429
+ setInternalState(this, {
1430
+ type: ARRAY_ITERATOR,
1431
+ target: toIndexedObject(iterated), // target
1432
+ index: 0, // next index
1433
+ kind: kind // kind
1434
+ });
1435
+ // `%ArrayIteratorPrototype%.next` method
1436
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1437
+ }, function () {
1438
+ var state = getInternalState(this);
1439
+ var target = state.target;
1440
+ var kind = state.kind;
1441
+ var index = state.index++;
1442
+ if (!target || index >= target.length) {
1443
+ state.target = undefined;
1444
+ return createIterResultObject(undefined, true);
1445
+ }
1446
+ if (kind == 'keys') return createIterResultObject(index, false);
1447
+ if (kind == 'values') return createIterResultObject(target[index], false);
1448
+ return createIterResultObject([index, target[index]], false);
1449
+ }, 'values');
1450
+
1451
+ // argumentsList[@@iterator] is %ArrayProto_values%
1452
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1453
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1454
+ var values = Iterators.Arguments = Iterators.Array;
1455
+
1456
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1457
+ addToUnscopables('keys');
1458
+ addToUnscopables('values');
1459
+ addToUnscopables('entries');
1460
+
1461
+ // V8 ~ Chrome 45- bug
1462
+ if (DESCRIPTORS && values.name !== 'values') try {
1463
+ defineProperty(values, 'name', { value: 'values' });
1464
+ } catch (error) { /* empty */ }
1465
+
1466
+ // iterable DOM collections
1467
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1468
+ var domIterables = {
1469
+ CSSRuleList: 0,
1470
+ CSSStyleDeclaration: 0,
1471
+ CSSValueList: 0,
1472
+ ClientRectList: 0,
1473
+ DOMRectList: 0,
1474
+ DOMStringList: 0,
1475
+ DOMTokenList: 1,
1476
+ DataTransferItemList: 0,
1477
+ FileList: 0,
1478
+ HTMLAllCollection: 0,
1479
+ HTMLCollection: 0,
1480
+ HTMLFormElement: 0,
1481
+ HTMLSelectElement: 0,
1482
+ MediaList: 0,
1483
+ MimeTypeArray: 0,
1484
+ NamedNodeMap: 0,
1485
+ NodeList: 1,
1486
+ PaintRequestList: 0,
1487
+ Plugin: 0,
1488
+ PluginArray: 0,
1489
+ SVGLengthList: 0,
1490
+ SVGNumberList: 0,
1491
+ SVGPathSegList: 0,
1492
+ SVGPointList: 0,
1493
+ SVGStringList: 0,
1494
+ SVGTransformList: 0,
1495
+ SourceBufferList: 0,
1496
+ StyleSheetList: 0,
1497
+ TextTrackCueList: 0,
1498
+ TextTrackList: 0,
1499
+ TouchList: 0
1500
+ };
1501
+
1502
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1503
+ var documentCreateElement = documentCreateElement$2;
1504
+
1505
+ var classList = documentCreateElement('span').classList;
1506
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1507
+
1508
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1509
+
1510
+ var global$1 = global$b;
1511
+ var DOMIterables = domIterables;
1512
+ var DOMTokenListPrototype = domTokenListPrototype;
1513
+ var ArrayIteratorMethods = es_array_iterator;
1514
+ var createNonEnumerableProperty = createNonEnumerableProperty$4;
1515
+ var wellKnownSymbol = wellKnownSymbol$6;
1516
+
1517
+ var ITERATOR = wellKnownSymbol('iterator');
1518
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1519
+ var ArrayValues = ArrayIteratorMethods.values;
1520
+
1521
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1522
+ if (CollectionPrototype) {
1523
+ // some Chrome versions have non-configurable methods on DOMTokenList
1524
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1525
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1526
+ } catch (error) {
1527
+ CollectionPrototype[ITERATOR] = ArrayValues;
1528
+ }
1529
+ if (!CollectionPrototype[TO_STRING_TAG]) {
1530
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
1531
+ }
1532
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1533
+ // some Chrome versions have non-configurable methods on DOMTokenList
1534
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1535
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1536
+ } catch (error) {
1537
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1538
+ }
1539
+ }
1540
+ }
1541
+ };
1542
+
1543
+ for (var COLLECTION_NAME in DOMIterables) {
1544
+ handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
1545
+ }
1546
+
1547
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1548
+
1549
+ const isObject = value => typeof value === 'object' && value !== null && value !== undefined;
1550
+ /**
1551
+ * Watches for changes in the source and calls the callback when the source changes
1552
+ * @param source - The source to watch for changes
1553
+ * @param callback - The callback to call when the source changes
1554
+ * @returns The unsubscribe function
1555
+ */
1556
+ const watch = (source, callback) => {
1557
+ const runner = effect(source, {
1558
+ scheduler: callback
1559
+ });
1560
+ return () => {
1561
+ stop(runner);
1562
+ };
1563
+ };
1564
+ const useReactivityProxy = target => {
1565
+ /**
1566
+ * Stores all unsubscribe functions in a particular render
1567
+ */
1568
+ const unsubscribeFunctionsRef = useRef(new Set());
1569
+ /**
1570
+ * Store all new proxy objects references created when accessed to present unnecessary reactivity.
1571
+ * When an attribute is accessed by the customer and we create a proxy for it, we store it here
1572
+ * so in the next render, we can reuse the same proxy object and that way not cause a new render
1573
+ * by creating a new proxy object reference
1574
+ */
1575
+ const proxyObjectCacheRef = useRef(new Map());
1576
+ // Rerender count to force rerender when the target changes
1577
+ const [, setRerenderCount] = useState(0);
1578
+ const rerender = useCallback(() => setRerenderCount(rerenderCount => rerenderCount + 1), [setRerenderCount]);
1579
+ const unsubscribeAll = useCallback(() => {
1580
+ unsubscribeFunctionsRef.current.forEach(unsubscribeFunction => unsubscribeFunction());
1581
+ unsubscribeFunctionsRef.current.clear();
1582
+ }, []);
1583
+ /**
1584
+ * On every render it cleans the previous subscriptions.
1585
+ * This is necessary because different renders can have different subscriptions.
1586
+ */
1587
+ unsubscribeAll();
1588
+ /**
1589
+ * Unsubscribe all subscriptions when the component is unmounted
1590
+ */
1591
+ useEffect(() => () => unsubscribeAll(), [unsubscribeAll]);
1592
+ const addSubscriptionProxy = (target, proxyCacheKey) => {
1593
+ // Check if object path is already cached
1594
+ if (proxyObjectCacheRef.current.has(proxyCacheKey)) {
1595
+ return proxyObjectCacheRef.current.get(proxyCacheKey);
1596
+ }
1597
+ // Create a proxy object to subscribe to the accessed attribute
1598
+ const proxyObject = new Proxy(target, {
1599
+ get: (target, prop, receiver) => {
1600
+ const value = Reflect.get(target, prop, receiver);
1601
+ // Subscribe to the accessed attribute
1602
+ const unsubscribeFunction = watch(() => Reflect.get(target, prop, receiver), rerender);
1603
+ unsubscribeFunctionsRef.current.add(unsubscribeFunction);
1604
+ // If the value is an object, we need to create a proxy for it too
1605
+ if (isObject(value)) {
1606
+ const propCachePath = `${proxyCacheKey}.${String(prop)}`;
1607
+ return addSubscriptionProxy(value, propCachePath);
1608
+ }
1609
+ return value;
1610
+ }
1611
+ });
1612
+ // Cache the proxy object
1613
+ proxyObjectCacheRef.current.set(proxyCacheKey, proxyObject);
1614
+ return proxyObject;
1615
+ };
1616
+ return useMemo(() => {
1617
+ // target changed, clear all proxy cache to allow for the new object to be proxied
1618
+ proxyObjectCacheRef.current.clear();
1619
+ return addSubscriptionProxy(target, '');
1620
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1621
+ }, [target]);
1622
+ };
1623
+
1624
+ const dynamicClientContext = /*#__PURE__*/createContext(undefined);
1625
+ const DynamicClientProvider = ({
1626
+ client,
1627
+ children
1628
+ }) => jsx(dynamicClientContext.Provider, {
1629
+ value: {
1630
+ client
1631
+ },
1632
+ children: children
1633
+ });
1634
+ const useDynamicClient = ({
1635
+ watch: _watch = true
1636
+ } = {}) => {
1637
+ const context = useContext(dynamicClientContext);
1638
+ if (context === undefined) {
1639
+ throw new Error('useDynamicClient must be used within a DynamicClientProvider');
1640
+ }
1641
+ const reactiveClient = useReactivityProxy(context.client);
1642
+ if (_watch) {
1643
+ return reactiveClient;
1644
+ }
1645
+ return context.client;
1646
+ };
1647
+
1648
+ export { DynamicClientProvider, useDynamicClient };