@ninetailed/experience.js-plugin-preview 3.0.1-beta.4 → 3.0.2-beta.0

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