@ninetailed/experience.js-react 1.0.0-beta.12

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