@ninetailed/experience.js-react 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 +2980 -0
- package/{index.esm.js → index.js} +1379 -1260
- package/lib/Experience/ESRLoadingComponent.d.ts +4 -3
- package/lib/Experience/Experience.d.ts +11 -11
- package/lib/Experience/ExperimentsContext.d.ts +7 -4
- package/lib/Experience/ExperimentsProvider.d.ts +7 -6
- package/lib/Experience/TrackExperience.d.ts +1 -1
- package/lib/Experience/index.d.ts +6 -1
- package/lib/Experience/types/Baseline.d.ts +1 -1
- package/lib/Experience/types/BaselineWithVariants.d.ts +2 -2
- package/lib/Experience/types/Variant.d.ts +0 -1
- package/lib/Experience/useExperiementsContext.d.ts +4 -0
- package/lib/Experience/useExperience.d.ts +7 -7
- package/lib/Experience/useExperiments.d.ts +1 -1
- package/lib/Experience/useJoinExperiment.d.ts +1 -10
- package/lib/Experience/useProvideJoinExperiment.d.ts +13 -0
- package/lib/NinetailedContext.d.ts +1 -0
- package/lib/NinetailedProvider.d.ts +3 -2
- package/lib/Personalize.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/useProfile.d.ts +2 -2
- package/package.json +10 -15
- package/index.umd.js +0 -2393
package/index.cjs
ADDED
|
@@ -0,0 +1,2980 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var experience_js = require('@ninetailed/experience.js');
|
|
8
|
+
var _debounce = require('lodash/debounce');
|
|
9
|
+
var values$1 = require('lodash/values');
|
|
10
|
+
var experience_jsShared = require('@ninetailed/experience.js-shared');
|
|
11
|
+
var isEqual = require('lodash/isEqual');
|
|
12
|
+
var reactIntersectionObserver = require('react-intersection-observer');
|
|
13
|
+
var get$1 = require('lodash/get');
|
|
14
|
+
var has$1 = require('lodash/has');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
+
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
var _debounce__default = /*#__PURE__*/_interopDefaultLegacy(_debounce);
|
|
20
|
+
var values__default = /*#__PURE__*/_interopDefaultLegacy(values$1);
|
|
21
|
+
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
22
|
+
var get__default = /*#__PURE__*/_interopDefaultLegacy(get$1);
|
|
23
|
+
var has__default = /*#__PURE__*/_interopDefaultLegacy(has$1);
|
|
24
|
+
|
|
25
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
26
|
+
|
|
27
|
+
var check = function (it) {
|
|
28
|
+
return it && it.Math == Math && it;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
32
|
+
var global$f =
|
|
33
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
34
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
35
|
+
check(typeof window == 'object' && window) ||
|
|
36
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
37
|
+
check(typeof self == 'object' && self) ||
|
|
38
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
39
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
40
|
+
(function () { return this; })() || Function('return this')();
|
|
41
|
+
|
|
42
|
+
var objectGetOwnPropertyDescriptor = {};
|
|
43
|
+
|
|
44
|
+
var fails$h = function (exec) {
|
|
45
|
+
try {
|
|
46
|
+
return !!exec();
|
|
47
|
+
} catch (error) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var fails$g = fails$h;
|
|
53
|
+
|
|
54
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
55
|
+
var descriptors = !fails$g(function () {
|
|
56
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
57
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
var fails$f = fails$h;
|
|
61
|
+
|
|
62
|
+
var functionBindNative = !fails$f(function () {
|
|
63
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
64
|
+
var test = (function () { /* empty */ }).bind();
|
|
65
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
66
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
var NATIVE_BIND$2 = functionBindNative;
|
|
70
|
+
|
|
71
|
+
var call$a = Function.prototype.call;
|
|
72
|
+
|
|
73
|
+
var functionCall = NATIVE_BIND$2 ? call$a.bind(call$a) : function () {
|
|
74
|
+
return call$a.apply(call$a, arguments);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var objectPropertyIsEnumerable = {};
|
|
78
|
+
|
|
79
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
80
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
81
|
+
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
82
|
+
|
|
83
|
+
// Nashorn ~ JDK8 bug
|
|
84
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
85
|
+
|
|
86
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
87
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
88
|
+
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
89
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
90
|
+
return !!descriptor && descriptor.enumerable;
|
|
91
|
+
} : $propertyIsEnumerable;
|
|
92
|
+
|
|
93
|
+
var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
94
|
+
return {
|
|
95
|
+
enumerable: !(bitmap & 1),
|
|
96
|
+
configurable: !(bitmap & 2),
|
|
97
|
+
writable: !(bitmap & 4),
|
|
98
|
+
value: value
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var NATIVE_BIND$1 = functionBindNative;
|
|
103
|
+
|
|
104
|
+
var FunctionPrototype$2 = Function.prototype;
|
|
105
|
+
var call$9 = FunctionPrototype$2.call;
|
|
106
|
+
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$2.bind.bind(call$9, call$9);
|
|
107
|
+
|
|
108
|
+
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
109
|
+
return function () {
|
|
110
|
+
return call$9.apply(fn, arguments);
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var uncurryThis$f = functionUncurryThis;
|
|
115
|
+
|
|
116
|
+
var toString$5 = uncurryThis$f({}.toString);
|
|
117
|
+
var stringSlice$4 = uncurryThis$f(''.slice);
|
|
118
|
+
|
|
119
|
+
var classofRaw$2 = function (it) {
|
|
120
|
+
return stringSlice$4(toString$5(it), 8, -1);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var uncurryThis$e = functionUncurryThis;
|
|
124
|
+
var fails$e = fails$h;
|
|
125
|
+
var classof$4 = classofRaw$2;
|
|
126
|
+
|
|
127
|
+
var $Object$4 = Object;
|
|
128
|
+
var split = uncurryThis$e(''.split);
|
|
129
|
+
|
|
130
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
131
|
+
var indexedObject = fails$e(function () {
|
|
132
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
133
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
134
|
+
return !$Object$4('z').propertyIsEnumerable(0);
|
|
135
|
+
}) ? function (it) {
|
|
136
|
+
return classof$4(it) == 'String' ? split(it, '') : $Object$4(it);
|
|
137
|
+
} : $Object$4;
|
|
138
|
+
|
|
139
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
140
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
141
|
+
var isNullOrUndefined$3 = function (it) {
|
|
142
|
+
return it === null || it === undefined;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
var isNullOrUndefined$2 = isNullOrUndefined$3;
|
|
146
|
+
|
|
147
|
+
var $TypeError$8 = TypeError;
|
|
148
|
+
|
|
149
|
+
// `RequireObjectCoercible` abstract operation
|
|
150
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
151
|
+
var requireObjectCoercible$4 = function (it) {
|
|
152
|
+
if (isNullOrUndefined$2(it)) throw $TypeError$8("Can't call method on " + it);
|
|
153
|
+
return it;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
157
|
+
var IndexedObject$2 = indexedObject;
|
|
158
|
+
var requireObjectCoercible$3 = requireObjectCoercible$4;
|
|
159
|
+
|
|
160
|
+
var toIndexedObject$5 = function (it) {
|
|
161
|
+
return IndexedObject$2(requireObjectCoercible$3(it));
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
var documentAll$2 = typeof document == 'object' && document.all;
|
|
165
|
+
|
|
166
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
167
|
+
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
|
168
|
+
|
|
169
|
+
var documentAll_1 = {
|
|
170
|
+
all: documentAll$2,
|
|
171
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
var $documentAll$1 = documentAll_1;
|
|
175
|
+
|
|
176
|
+
var documentAll$1 = $documentAll$1.all;
|
|
177
|
+
|
|
178
|
+
// `IsCallable` abstract operation
|
|
179
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
180
|
+
var isCallable$h = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
|
181
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
182
|
+
} : function (argument) {
|
|
183
|
+
return typeof argument == 'function';
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
var isCallable$g = isCallable$h;
|
|
187
|
+
var $documentAll = documentAll_1;
|
|
188
|
+
|
|
189
|
+
var documentAll = $documentAll.all;
|
|
190
|
+
|
|
191
|
+
var isObject$6 = $documentAll.IS_HTMLDDA ? function (it) {
|
|
192
|
+
return typeof it == 'object' ? it !== null : isCallable$g(it) || it === documentAll;
|
|
193
|
+
} : function (it) {
|
|
194
|
+
return typeof it == 'object' ? it !== null : isCallable$g(it);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
var global$e = global$f;
|
|
198
|
+
var isCallable$f = isCallable$h;
|
|
199
|
+
|
|
200
|
+
var aFunction = function (argument) {
|
|
201
|
+
return isCallable$f(argument) ? argument : undefined;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
var getBuiltIn$4 = function (namespace, method) {
|
|
205
|
+
return arguments.length < 2 ? aFunction(global$e[namespace]) : global$e[namespace] && global$e[namespace][method];
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
var uncurryThis$d = functionUncurryThis;
|
|
209
|
+
|
|
210
|
+
var objectIsPrototypeOf = uncurryThis$d({}.isPrototypeOf);
|
|
211
|
+
|
|
212
|
+
var getBuiltIn$3 = getBuiltIn$4;
|
|
213
|
+
|
|
214
|
+
var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
|
|
215
|
+
|
|
216
|
+
var global$d = global$f;
|
|
217
|
+
var userAgent = engineUserAgent;
|
|
218
|
+
|
|
219
|
+
var process = global$d.process;
|
|
220
|
+
var Deno = global$d.Deno;
|
|
221
|
+
var versions = process && process.versions || Deno && Deno.version;
|
|
222
|
+
var v8 = versions && versions.v8;
|
|
223
|
+
var match, version;
|
|
224
|
+
|
|
225
|
+
if (v8) {
|
|
226
|
+
match = v8.split('.');
|
|
227
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
228
|
+
// but their correct versions are not interesting for us
|
|
229
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
233
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
234
|
+
if (!version && userAgent) {
|
|
235
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
|
236
|
+
if (!match || match[1] >= 74) {
|
|
237
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
|
238
|
+
if (match) version = +match[1];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
var engineV8Version = version;
|
|
243
|
+
|
|
244
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
245
|
+
|
|
246
|
+
var V8_VERSION = engineV8Version;
|
|
247
|
+
var fails$d = fails$h;
|
|
248
|
+
|
|
249
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
250
|
+
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$d(function () {
|
|
251
|
+
var symbol = Symbol();
|
|
252
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
253
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
254
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
255
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
256
|
+
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
260
|
+
|
|
261
|
+
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
262
|
+
|
|
263
|
+
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
264
|
+
&& !Symbol.sham
|
|
265
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
266
|
+
|
|
267
|
+
var getBuiltIn$2 = getBuiltIn$4;
|
|
268
|
+
var isCallable$e = isCallable$h;
|
|
269
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
270
|
+
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
271
|
+
|
|
272
|
+
var $Object$3 = Object;
|
|
273
|
+
|
|
274
|
+
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
275
|
+
return typeof it == 'symbol';
|
|
276
|
+
} : function (it) {
|
|
277
|
+
var $Symbol = getBuiltIn$2('Symbol');
|
|
278
|
+
return isCallable$e($Symbol) && isPrototypeOf($Symbol.prototype, $Object$3(it));
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
var $String$3 = String;
|
|
282
|
+
|
|
283
|
+
var tryToString$1 = function (argument) {
|
|
284
|
+
try {
|
|
285
|
+
return $String$3(argument);
|
|
286
|
+
} catch (error) {
|
|
287
|
+
return 'Object';
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
var isCallable$d = isCallable$h;
|
|
292
|
+
var tryToString = tryToString$1;
|
|
293
|
+
|
|
294
|
+
var $TypeError$7 = TypeError;
|
|
295
|
+
|
|
296
|
+
// `Assert: IsCallable(argument) is true`
|
|
297
|
+
var aCallable$2 = function (argument) {
|
|
298
|
+
if (isCallable$d(argument)) return argument;
|
|
299
|
+
throw $TypeError$7(tryToString(argument) + ' is not a function');
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
var aCallable$1 = aCallable$2;
|
|
303
|
+
var isNullOrUndefined$1 = isNullOrUndefined$3;
|
|
304
|
+
|
|
305
|
+
// `GetMethod` abstract operation
|
|
306
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
307
|
+
var getMethod$2 = function (V, P) {
|
|
308
|
+
var func = V[P];
|
|
309
|
+
return isNullOrUndefined$1(func) ? undefined : aCallable$1(func);
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
var call$8 = functionCall;
|
|
313
|
+
var isCallable$c = isCallable$h;
|
|
314
|
+
var isObject$5 = isObject$6;
|
|
315
|
+
|
|
316
|
+
var $TypeError$6 = TypeError;
|
|
317
|
+
|
|
318
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
319
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
320
|
+
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
321
|
+
var fn, val;
|
|
322
|
+
if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$5(val = call$8(fn, input))) return val;
|
|
323
|
+
if (isCallable$c(fn = input.valueOf) && !isObject$5(val = call$8(fn, input))) return val;
|
|
324
|
+
if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$5(val = call$8(fn, input))) return val;
|
|
325
|
+
throw $TypeError$6("Can't convert object to primitive value");
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
var shared$4 = {exports: {}};
|
|
329
|
+
|
|
330
|
+
var global$c = global$f;
|
|
331
|
+
|
|
332
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
333
|
+
var defineProperty$5 = Object.defineProperty;
|
|
334
|
+
|
|
335
|
+
var defineGlobalProperty$3 = function (key, value) {
|
|
336
|
+
try {
|
|
337
|
+
defineProperty$5(global$c, key, { value: value, configurable: true, writable: true });
|
|
338
|
+
} catch (error) {
|
|
339
|
+
global$c[key] = value;
|
|
340
|
+
} return value;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
var global$b = global$f;
|
|
344
|
+
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
345
|
+
|
|
346
|
+
var SHARED = '__core-js_shared__';
|
|
347
|
+
var store$3 = global$b[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
348
|
+
|
|
349
|
+
var sharedStore = store$3;
|
|
350
|
+
|
|
351
|
+
var store$2 = sharedStore;
|
|
352
|
+
|
|
353
|
+
(shared$4.exports = function (key, value) {
|
|
354
|
+
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
355
|
+
})('versions', []).push({
|
|
356
|
+
version: '3.26.1',
|
|
357
|
+
mode: 'global',
|
|
358
|
+
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
359
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
|
|
360
|
+
source: 'https://github.com/zloirock/core-js'
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
var requireObjectCoercible$2 = requireObjectCoercible$4;
|
|
364
|
+
|
|
365
|
+
var $Object$2 = Object;
|
|
366
|
+
|
|
367
|
+
// `ToObject` abstract operation
|
|
368
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
369
|
+
var toObject$5 = function (argument) {
|
|
370
|
+
return $Object$2(requireObjectCoercible$2(argument));
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
var uncurryThis$c = functionUncurryThis;
|
|
374
|
+
var toObject$4 = toObject$5;
|
|
375
|
+
|
|
376
|
+
var hasOwnProperty = uncurryThis$c({}.hasOwnProperty);
|
|
377
|
+
|
|
378
|
+
// `HasOwnProperty` abstract operation
|
|
379
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
380
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
381
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
382
|
+
return hasOwnProperty(toObject$4(it), key);
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
var uncurryThis$b = functionUncurryThis;
|
|
386
|
+
|
|
387
|
+
var id = 0;
|
|
388
|
+
var postfix = Math.random();
|
|
389
|
+
var toString$4 = uncurryThis$b(1.0.toString);
|
|
390
|
+
|
|
391
|
+
var uid$2 = function (key) {
|
|
392
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$4(++id + postfix, 36);
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
var global$a = global$f;
|
|
396
|
+
var shared$3 = shared$4.exports;
|
|
397
|
+
var hasOwn$8 = hasOwnProperty_1;
|
|
398
|
+
var uid$1 = uid$2;
|
|
399
|
+
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
400
|
+
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
401
|
+
|
|
402
|
+
var WellKnownSymbolsStore = shared$3('wks');
|
|
403
|
+
var Symbol$1 = global$a.Symbol;
|
|
404
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
405
|
+
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
406
|
+
|
|
407
|
+
var wellKnownSymbol$a = function (name) {
|
|
408
|
+
if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
409
|
+
var description = 'Symbol.' + name;
|
|
410
|
+
if (NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)) {
|
|
411
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
412
|
+
} else if (USE_SYMBOL_AS_UID && symbolFor) {
|
|
413
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
414
|
+
} else {
|
|
415
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
416
|
+
}
|
|
417
|
+
} return WellKnownSymbolsStore[name];
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
var call$7 = functionCall;
|
|
421
|
+
var isObject$4 = isObject$6;
|
|
422
|
+
var isSymbol$1 = isSymbol$2;
|
|
423
|
+
var getMethod$1 = getMethod$2;
|
|
424
|
+
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
425
|
+
var wellKnownSymbol$9 = wellKnownSymbol$a;
|
|
426
|
+
|
|
427
|
+
var $TypeError$5 = TypeError;
|
|
428
|
+
var TO_PRIMITIVE = wellKnownSymbol$9('toPrimitive');
|
|
429
|
+
|
|
430
|
+
// `ToPrimitive` abstract operation
|
|
431
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
432
|
+
var toPrimitive$1 = function (input, pref) {
|
|
433
|
+
if (!isObject$4(input) || isSymbol$1(input)) return input;
|
|
434
|
+
var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
|
|
435
|
+
var result;
|
|
436
|
+
if (exoticToPrim) {
|
|
437
|
+
if (pref === undefined) pref = 'default';
|
|
438
|
+
result = call$7(exoticToPrim, input, pref);
|
|
439
|
+
if (!isObject$4(result) || isSymbol$1(result)) return result;
|
|
440
|
+
throw $TypeError$5("Can't convert object to primitive value");
|
|
441
|
+
}
|
|
442
|
+
if (pref === undefined) pref = 'number';
|
|
443
|
+
return ordinaryToPrimitive(input, pref);
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
var toPrimitive = toPrimitive$1;
|
|
447
|
+
var isSymbol = isSymbol$2;
|
|
448
|
+
|
|
449
|
+
// `ToPropertyKey` abstract operation
|
|
450
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
451
|
+
var toPropertyKey$2 = function (argument) {
|
|
452
|
+
var key = toPrimitive(argument, 'string');
|
|
453
|
+
return isSymbol(key) ? key : key + '';
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
var global$9 = global$f;
|
|
457
|
+
var isObject$3 = isObject$6;
|
|
458
|
+
|
|
459
|
+
var document$1 = global$9.document;
|
|
460
|
+
// typeof document.createElement is 'object' in old IE
|
|
461
|
+
var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
|
|
462
|
+
|
|
463
|
+
var documentCreateElement$2 = function (it) {
|
|
464
|
+
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
var DESCRIPTORS$9 = descriptors;
|
|
468
|
+
var fails$c = fails$h;
|
|
469
|
+
var createElement = documentCreateElement$2;
|
|
470
|
+
|
|
471
|
+
// Thanks to IE8 for its funny defineProperty
|
|
472
|
+
var ie8DomDefine = !DESCRIPTORS$9 && !fails$c(function () {
|
|
473
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
474
|
+
return Object.defineProperty(createElement('div'), 'a', {
|
|
475
|
+
get: function () { return 7; }
|
|
476
|
+
}).a != 7;
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
var DESCRIPTORS$8 = descriptors;
|
|
480
|
+
var call$6 = functionCall;
|
|
481
|
+
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
482
|
+
var createPropertyDescriptor$2 = createPropertyDescriptor$3;
|
|
483
|
+
var toIndexedObject$4 = toIndexedObject$5;
|
|
484
|
+
var toPropertyKey$1 = toPropertyKey$2;
|
|
485
|
+
var hasOwn$7 = hasOwnProperty_1;
|
|
486
|
+
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
487
|
+
|
|
488
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
489
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
490
|
+
|
|
491
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
492
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
493
|
+
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
494
|
+
O = toIndexedObject$4(O);
|
|
495
|
+
P = toPropertyKey$1(P);
|
|
496
|
+
if (IE8_DOM_DEFINE$1) try {
|
|
497
|
+
return $getOwnPropertyDescriptor$1(O, P);
|
|
498
|
+
} catch (error) { /* empty */ }
|
|
499
|
+
if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$6(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
var objectDefineProperty = {};
|
|
503
|
+
|
|
504
|
+
var DESCRIPTORS$7 = descriptors;
|
|
505
|
+
var fails$b = fails$h;
|
|
506
|
+
|
|
507
|
+
// V8 ~ Chrome 36-
|
|
508
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
509
|
+
var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$b(function () {
|
|
510
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
511
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
512
|
+
value: 42,
|
|
513
|
+
writable: false
|
|
514
|
+
}).prototype != 42;
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
var isObject$2 = isObject$6;
|
|
518
|
+
|
|
519
|
+
var $String$2 = String;
|
|
520
|
+
var $TypeError$4 = TypeError;
|
|
521
|
+
|
|
522
|
+
// `Assert: Type(argument) is Object`
|
|
523
|
+
var anObject$8 = function (argument) {
|
|
524
|
+
if (isObject$2(argument)) return argument;
|
|
525
|
+
throw $TypeError$4($String$2(argument) + ' is not an object');
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
var DESCRIPTORS$6 = descriptors;
|
|
529
|
+
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
530
|
+
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
531
|
+
var anObject$7 = anObject$8;
|
|
532
|
+
var toPropertyKey = toPropertyKey$2;
|
|
533
|
+
|
|
534
|
+
var $TypeError$3 = TypeError;
|
|
535
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
536
|
+
var $defineProperty = Object.defineProperty;
|
|
537
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
538
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
539
|
+
var ENUMERABLE = 'enumerable';
|
|
540
|
+
var CONFIGURABLE$1 = 'configurable';
|
|
541
|
+
var WRITABLE = 'writable';
|
|
542
|
+
|
|
543
|
+
// `Object.defineProperty` method
|
|
544
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
545
|
+
objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
546
|
+
anObject$7(O);
|
|
547
|
+
P = toPropertyKey(P);
|
|
548
|
+
anObject$7(Attributes);
|
|
549
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
550
|
+
var current = $getOwnPropertyDescriptor(O, P);
|
|
551
|
+
if (current && current[WRITABLE]) {
|
|
552
|
+
O[P] = Attributes.value;
|
|
553
|
+
Attributes = {
|
|
554
|
+
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
555
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
556
|
+
writable: false
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
} return $defineProperty(O, P, Attributes);
|
|
560
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
561
|
+
anObject$7(O);
|
|
562
|
+
P = toPropertyKey(P);
|
|
563
|
+
anObject$7(Attributes);
|
|
564
|
+
if (IE8_DOM_DEFINE) try {
|
|
565
|
+
return $defineProperty(O, P, Attributes);
|
|
566
|
+
} catch (error) { /* empty */ }
|
|
567
|
+
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$3('Accessors not supported');
|
|
568
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
569
|
+
return O;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
var DESCRIPTORS$5 = descriptors;
|
|
573
|
+
var definePropertyModule$3 = objectDefineProperty;
|
|
574
|
+
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
575
|
+
|
|
576
|
+
var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
|
|
577
|
+
return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
|
|
578
|
+
} : function (object, key, value) {
|
|
579
|
+
object[key] = value;
|
|
580
|
+
return object;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
var makeBuiltIn$2 = {exports: {}};
|
|
584
|
+
|
|
585
|
+
var DESCRIPTORS$4 = descriptors;
|
|
586
|
+
var hasOwn$6 = hasOwnProperty_1;
|
|
587
|
+
|
|
588
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
589
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
590
|
+
var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
|
|
591
|
+
|
|
592
|
+
var EXISTS = hasOwn$6(FunctionPrototype$1, 'name');
|
|
593
|
+
// additional protection from minified / mangled / dropped function names
|
|
594
|
+
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
595
|
+
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
596
|
+
|
|
597
|
+
var functionName = {
|
|
598
|
+
EXISTS: EXISTS,
|
|
599
|
+
PROPER: PROPER,
|
|
600
|
+
CONFIGURABLE: CONFIGURABLE
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
var uncurryThis$a = functionUncurryThis;
|
|
604
|
+
var isCallable$b = isCallable$h;
|
|
605
|
+
var store$1 = sharedStore;
|
|
606
|
+
|
|
607
|
+
var functionToString = uncurryThis$a(Function.toString);
|
|
608
|
+
|
|
609
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
610
|
+
if (!isCallable$b(store$1.inspectSource)) {
|
|
611
|
+
store$1.inspectSource = function (it) {
|
|
612
|
+
return functionToString(it);
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
var inspectSource$1 = store$1.inspectSource;
|
|
617
|
+
|
|
618
|
+
var global$8 = global$f;
|
|
619
|
+
var isCallable$a = isCallable$h;
|
|
620
|
+
|
|
621
|
+
var WeakMap$1 = global$8.WeakMap;
|
|
622
|
+
|
|
623
|
+
var weakMapBasicDetection = isCallable$a(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
624
|
+
|
|
625
|
+
var shared$2 = shared$4.exports;
|
|
626
|
+
var uid = uid$2;
|
|
627
|
+
|
|
628
|
+
var keys = shared$2('keys');
|
|
629
|
+
|
|
630
|
+
var sharedKey$3 = function (key) {
|
|
631
|
+
return keys[key] || (keys[key] = uid(key));
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
var hiddenKeys$4 = {};
|
|
635
|
+
|
|
636
|
+
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
637
|
+
var global$7 = global$f;
|
|
638
|
+
var isObject$1 = isObject$6;
|
|
639
|
+
var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
|
|
640
|
+
var hasOwn$5 = hasOwnProperty_1;
|
|
641
|
+
var shared$1 = sharedStore;
|
|
642
|
+
var sharedKey$2 = sharedKey$3;
|
|
643
|
+
var hiddenKeys$3 = hiddenKeys$4;
|
|
644
|
+
|
|
645
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
646
|
+
var TypeError$1 = global$7.TypeError;
|
|
647
|
+
var WeakMap = global$7.WeakMap;
|
|
648
|
+
var set, get, has;
|
|
649
|
+
|
|
650
|
+
var enforce = function (it) {
|
|
651
|
+
return has(it) ? get(it) : set(it, {});
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
var getterFor = function (TYPE) {
|
|
655
|
+
return function (it) {
|
|
656
|
+
var state;
|
|
657
|
+
if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
|
|
658
|
+
throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
659
|
+
} return state;
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
664
|
+
var store = shared$1.state || (shared$1.state = new WeakMap());
|
|
665
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
666
|
+
store.get = store.get;
|
|
667
|
+
store.has = store.has;
|
|
668
|
+
store.set = store.set;
|
|
669
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
670
|
+
set = function (it, metadata) {
|
|
671
|
+
if (store.has(it)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
672
|
+
metadata.facade = it;
|
|
673
|
+
store.set(it, metadata);
|
|
674
|
+
return metadata;
|
|
675
|
+
};
|
|
676
|
+
get = function (it) {
|
|
677
|
+
return store.get(it) || {};
|
|
678
|
+
};
|
|
679
|
+
has = function (it) {
|
|
680
|
+
return store.has(it);
|
|
681
|
+
};
|
|
682
|
+
} else {
|
|
683
|
+
var STATE = sharedKey$2('state');
|
|
684
|
+
hiddenKeys$3[STATE] = true;
|
|
685
|
+
set = function (it, metadata) {
|
|
686
|
+
if (hasOwn$5(it, STATE)) throw TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
687
|
+
metadata.facade = it;
|
|
688
|
+
createNonEnumerableProperty$4(it, STATE, metadata);
|
|
689
|
+
return metadata;
|
|
690
|
+
};
|
|
691
|
+
get = function (it) {
|
|
692
|
+
return hasOwn$5(it, STATE) ? it[STATE] : {};
|
|
693
|
+
};
|
|
694
|
+
has = function (it) {
|
|
695
|
+
return hasOwn$5(it, STATE);
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
var internalState = {
|
|
700
|
+
set: set,
|
|
701
|
+
get: get,
|
|
702
|
+
has: has,
|
|
703
|
+
enforce: enforce,
|
|
704
|
+
getterFor: getterFor
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
var fails$a = fails$h;
|
|
708
|
+
var isCallable$9 = isCallable$h;
|
|
709
|
+
var hasOwn$4 = hasOwnProperty_1;
|
|
710
|
+
var DESCRIPTORS$3 = descriptors;
|
|
711
|
+
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
712
|
+
var inspectSource = inspectSource$1;
|
|
713
|
+
var InternalStateModule$1 = internalState;
|
|
714
|
+
|
|
715
|
+
var enforceInternalState = InternalStateModule$1.enforce;
|
|
716
|
+
var getInternalState$2 = InternalStateModule$1.get;
|
|
717
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
718
|
+
var defineProperty$4 = Object.defineProperty;
|
|
719
|
+
|
|
720
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$a(function () {
|
|
721
|
+
return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
var TEMPLATE = String(String).split('String');
|
|
725
|
+
|
|
726
|
+
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
727
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
728
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
729
|
+
}
|
|
730
|
+
if (options && options.getter) name = 'get ' + name;
|
|
731
|
+
if (options && options.setter) name = 'set ' + name;
|
|
732
|
+
if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
733
|
+
if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
|
|
734
|
+
else value.name = name;
|
|
735
|
+
}
|
|
736
|
+
if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
|
|
737
|
+
defineProperty$4(value, 'length', { value: options.arity });
|
|
738
|
+
}
|
|
739
|
+
try {
|
|
740
|
+
if (options && hasOwn$4(options, 'constructor') && options.constructor) {
|
|
741
|
+
if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
|
|
742
|
+
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
743
|
+
} else if (value.prototype) value.prototype = undefined;
|
|
744
|
+
} catch (error) { /* empty */ }
|
|
745
|
+
var state = enforceInternalState(value);
|
|
746
|
+
if (!hasOwn$4(state, 'source')) {
|
|
747
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
748
|
+
} return value;
|
|
749
|
+
};
|
|
750
|
+
|
|
751
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
752
|
+
// eslint-disable-next-line no-extend-native -- required
|
|
753
|
+
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
754
|
+
return isCallable$9(this) && getInternalState$2(this).source || inspectSource(this);
|
|
755
|
+
}, 'toString');
|
|
756
|
+
|
|
757
|
+
var isCallable$8 = isCallable$h;
|
|
758
|
+
var definePropertyModule$2 = objectDefineProperty;
|
|
759
|
+
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
760
|
+
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
761
|
+
|
|
762
|
+
var defineBuiltIn$4 = function (O, key, value, options) {
|
|
763
|
+
if (!options) options = {};
|
|
764
|
+
var simple = options.enumerable;
|
|
765
|
+
var name = options.name !== undefined ? options.name : key;
|
|
766
|
+
if (isCallable$8(value)) makeBuiltIn(value, name, options);
|
|
767
|
+
if (options.global) {
|
|
768
|
+
if (simple) O[key] = value;
|
|
769
|
+
else defineGlobalProperty$1(key, value);
|
|
770
|
+
} else {
|
|
771
|
+
try {
|
|
772
|
+
if (!options.unsafe) delete O[key];
|
|
773
|
+
else if (O[key]) simple = true;
|
|
774
|
+
} catch (error) { /* empty */ }
|
|
775
|
+
if (simple) O[key] = value;
|
|
776
|
+
else definePropertyModule$2.f(O, key, {
|
|
777
|
+
value: value,
|
|
778
|
+
enumerable: false,
|
|
779
|
+
configurable: !options.nonConfigurable,
|
|
780
|
+
writable: !options.nonWritable
|
|
781
|
+
});
|
|
782
|
+
} return O;
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
var objectGetOwnPropertyNames = {};
|
|
786
|
+
|
|
787
|
+
var ceil = Math.ceil;
|
|
788
|
+
var floor$1 = Math.floor;
|
|
789
|
+
|
|
790
|
+
// `Math.trunc` method
|
|
791
|
+
// https://tc39.es/ecma262/#sec-math.trunc
|
|
792
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
793
|
+
var mathTrunc = Math.trunc || function trunc(x) {
|
|
794
|
+
var n = +x;
|
|
795
|
+
return (n > 0 ? floor$1 : ceil)(n);
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
var trunc = mathTrunc;
|
|
799
|
+
|
|
800
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
801
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
802
|
+
var toIntegerOrInfinity$4 = function (argument) {
|
|
803
|
+
var number = +argument;
|
|
804
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
805
|
+
return number !== number || number === 0 ? 0 : trunc(number);
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
|
|
809
|
+
|
|
810
|
+
var max$1 = Math.max;
|
|
811
|
+
var min$2 = Math.min;
|
|
812
|
+
|
|
813
|
+
// Helper for a popular repeating case of the spec:
|
|
814
|
+
// Let integer be ? ToInteger(index).
|
|
815
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
816
|
+
var toAbsoluteIndex$1 = function (index, length) {
|
|
817
|
+
var integer = toIntegerOrInfinity$3(index);
|
|
818
|
+
return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length);
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
|
|
822
|
+
|
|
823
|
+
var min$1 = Math.min;
|
|
824
|
+
|
|
825
|
+
// `ToLength` abstract operation
|
|
826
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
827
|
+
var toLength$2 = function (argument) {
|
|
828
|
+
return argument > 0 ? min$1(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
var toLength$1 = toLength$2;
|
|
832
|
+
|
|
833
|
+
// `LengthOfArrayLike` abstract operation
|
|
834
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
835
|
+
var lengthOfArrayLike$2 = function (obj) {
|
|
836
|
+
return toLength$1(obj.length);
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
var toIndexedObject$3 = toIndexedObject$5;
|
|
840
|
+
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
841
|
+
var lengthOfArrayLike$1 = lengthOfArrayLike$2;
|
|
842
|
+
|
|
843
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
844
|
+
var createMethod$2 = function (IS_INCLUDES) {
|
|
845
|
+
return function ($this, el, fromIndex) {
|
|
846
|
+
var O = toIndexedObject$3($this);
|
|
847
|
+
var length = lengthOfArrayLike$1(O);
|
|
848
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
849
|
+
var value;
|
|
850
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
851
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
852
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
853
|
+
value = O[index++];
|
|
854
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
855
|
+
if (value != value) return true;
|
|
856
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
857
|
+
} else for (;length > index; index++) {
|
|
858
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
859
|
+
} return !IS_INCLUDES && -1;
|
|
860
|
+
};
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
var arrayIncludes = {
|
|
864
|
+
// `Array.prototype.includes` method
|
|
865
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
866
|
+
includes: createMethod$2(true),
|
|
867
|
+
// `Array.prototype.indexOf` method
|
|
868
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
869
|
+
indexOf: createMethod$2(false)
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
873
|
+
var hasOwn$3 = hasOwnProperty_1;
|
|
874
|
+
var toIndexedObject$2 = toIndexedObject$5;
|
|
875
|
+
var indexOf$1 = arrayIncludes.indexOf;
|
|
876
|
+
var hiddenKeys$2 = hiddenKeys$4;
|
|
877
|
+
|
|
878
|
+
var push$1 = uncurryThis$9([].push);
|
|
879
|
+
|
|
880
|
+
var objectKeysInternal = function (object, names) {
|
|
881
|
+
var O = toIndexedObject$2(object);
|
|
882
|
+
var i = 0;
|
|
883
|
+
var result = [];
|
|
884
|
+
var key;
|
|
885
|
+
for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push$1(result, key);
|
|
886
|
+
// Don't enum bug & hidden keys
|
|
887
|
+
while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
|
|
888
|
+
~indexOf$1(result, key) || push$1(result, key);
|
|
889
|
+
}
|
|
890
|
+
return result;
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
// IE8- don't enum bug keys
|
|
894
|
+
var enumBugKeys$3 = [
|
|
895
|
+
'constructor',
|
|
896
|
+
'hasOwnProperty',
|
|
897
|
+
'isPrototypeOf',
|
|
898
|
+
'propertyIsEnumerable',
|
|
899
|
+
'toLocaleString',
|
|
900
|
+
'toString',
|
|
901
|
+
'valueOf'
|
|
902
|
+
];
|
|
903
|
+
|
|
904
|
+
var internalObjectKeys$1 = objectKeysInternal;
|
|
905
|
+
var enumBugKeys$2 = enumBugKeys$3;
|
|
906
|
+
|
|
907
|
+
var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
908
|
+
|
|
909
|
+
// `Object.getOwnPropertyNames` method
|
|
910
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
911
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
912
|
+
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
913
|
+
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
var objectGetOwnPropertySymbols = {};
|
|
917
|
+
|
|
918
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
919
|
+
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
920
|
+
|
|
921
|
+
var getBuiltIn$1 = getBuiltIn$4;
|
|
922
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
923
|
+
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
924
|
+
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
925
|
+
var anObject$6 = anObject$8;
|
|
926
|
+
|
|
927
|
+
var concat$2 = uncurryThis$8([].concat);
|
|
928
|
+
|
|
929
|
+
// all object keys, includes non-enumerable and symbols
|
|
930
|
+
var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
931
|
+
var keys = getOwnPropertyNamesModule.f(anObject$6(it));
|
|
932
|
+
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
933
|
+
return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
var hasOwn$2 = hasOwnProperty_1;
|
|
937
|
+
var ownKeys = ownKeys$1;
|
|
938
|
+
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
939
|
+
var definePropertyModule$1 = objectDefineProperty;
|
|
940
|
+
|
|
941
|
+
var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
942
|
+
var keys = ownKeys(source);
|
|
943
|
+
var defineProperty = definePropertyModule$1.f;
|
|
944
|
+
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
945
|
+
for (var i = 0; i < keys.length; i++) {
|
|
946
|
+
var key = keys[i];
|
|
947
|
+
if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
|
|
948
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
var fails$9 = fails$h;
|
|
954
|
+
var isCallable$7 = isCallable$h;
|
|
955
|
+
|
|
956
|
+
var replacement = /#|\.prototype\./;
|
|
957
|
+
|
|
958
|
+
var isForced$1 = function (feature, detection) {
|
|
959
|
+
var value = data[normalize(feature)];
|
|
960
|
+
return value == POLYFILL ? true
|
|
961
|
+
: value == NATIVE ? false
|
|
962
|
+
: isCallable$7(detection) ? fails$9(detection)
|
|
963
|
+
: !!detection;
|
|
964
|
+
};
|
|
965
|
+
|
|
966
|
+
var normalize = isForced$1.normalize = function (string) {
|
|
967
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
var data = isForced$1.data = {};
|
|
971
|
+
var NATIVE = isForced$1.NATIVE = 'N';
|
|
972
|
+
var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
973
|
+
|
|
974
|
+
var isForced_1 = isForced$1;
|
|
975
|
+
|
|
976
|
+
var global$6 = global$f;
|
|
977
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
978
|
+
var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
|
|
979
|
+
var defineBuiltIn$3 = defineBuiltIn$4;
|
|
980
|
+
var defineGlobalProperty = defineGlobalProperty$3;
|
|
981
|
+
var copyConstructorProperties = copyConstructorProperties$1;
|
|
982
|
+
var isForced = isForced_1;
|
|
983
|
+
|
|
984
|
+
/*
|
|
985
|
+
options.target - name of the target object
|
|
986
|
+
options.global - target is the global object
|
|
987
|
+
options.stat - export as static methods of target
|
|
988
|
+
options.proto - export as prototype methods of target
|
|
989
|
+
options.real - real prototype method for the `pure` version
|
|
990
|
+
options.forced - export even if the native feature is available
|
|
991
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
992
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
993
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
994
|
+
options.sham - add a flag to not completely full polyfills
|
|
995
|
+
options.enumerable - export as enumerable property
|
|
996
|
+
options.dontCallGetSet - prevent calling a getter on target
|
|
997
|
+
options.name - the .name of the function if it does not match the key
|
|
998
|
+
*/
|
|
999
|
+
var _export = function (options, source) {
|
|
1000
|
+
var TARGET = options.target;
|
|
1001
|
+
var GLOBAL = options.global;
|
|
1002
|
+
var STATIC = options.stat;
|
|
1003
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1004
|
+
if (GLOBAL) {
|
|
1005
|
+
target = global$6;
|
|
1006
|
+
} else if (STATIC) {
|
|
1007
|
+
target = global$6[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1008
|
+
} else {
|
|
1009
|
+
target = (global$6[TARGET] || {}).prototype;
|
|
1010
|
+
}
|
|
1011
|
+
if (target) for (key in source) {
|
|
1012
|
+
sourceProperty = source[key];
|
|
1013
|
+
if (options.dontCallGetSet) {
|
|
1014
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
|
1015
|
+
targetProperty = descriptor && descriptor.value;
|
|
1016
|
+
} else targetProperty = target[key];
|
|
1017
|
+
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
1018
|
+
// contained in target
|
|
1019
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
1020
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
1021
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
|
1022
|
+
}
|
|
1023
|
+
// add a flag to not completely full polyfills
|
|
1024
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1025
|
+
createNonEnumerableProperty$3(sourceProperty, 'sham', true);
|
|
1026
|
+
}
|
|
1027
|
+
defineBuiltIn$3(target, key, sourceProperty, options);
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
var internalObjectKeys = objectKeysInternal;
|
|
1032
|
+
var enumBugKeys$1 = enumBugKeys$3;
|
|
1033
|
+
|
|
1034
|
+
// `Object.keys` method
|
|
1035
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
1036
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1037
|
+
var objectKeys$2 = Object.keys || function keys(O) {
|
|
1038
|
+
return internalObjectKeys(O, enumBugKeys$1);
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
var DESCRIPTORS$2 = descriptors;
|
|
1042
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
1043
|
+
var call$5 = functionCall;
|
|
1044
|
+
var fails$8 = fails$h;
|
|
1045
|
+
var objectKeys$1 = objectKeys$2;
|
|
1046
|
+
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1047
|
+
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
1048
|
+
var toObject$3 = toObject$5;
|
|
1049
|
+
var IndexedObject$1 = indexedObject;
|
|
1050
|
+
|
|
1051
|
+
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1052
|
+
var $assign = Object.assign;
|
|
1053
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1054
|
+
var defineProperty$3 = Object.defineProperty;
|
|
1055
|
+
var concat$1 = uncurryThis$7([].concat);
|
|
1056
|
+
|
|
1057
|
+
// `Object.assign` method
|
|
1058
|
+
// https://tc39.es/ecma262/#sec-object.assign
|
|
1059
|
+
var objectAssign = !$assign || fails$8(function () {
|
|
1060
|
+
// should have correct order of operations (Edge bug)
|
|
1061
|
+
if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
|
|
1062
|
+
enumerable: true,
|
|
1063
|
+
get: function () {
|
|
1064
|
+
defineProperty$3(this, 'b', {
|
|
1065
|
+
value: 3,
|
|
1066
|
+
enumerable: false
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
}), { b: 2 })).b !== 1) return true;
|
|
1070
|
+
// should work with symbols and should have deterministic property order (V8 bug)
|
|
1071
|
+
var A = {};
|
|
1072
|
+
var B = {};
|
|
1073
|
+
// eslint-disable-next-line es/no-symbol -- safe
|
|
1074
|
+
var symbol = Symbol();
|
|
1075
|
+
var alphabet = 'abcdefghijklmnopqrst';
|
|
1076
|
+
A[symbol] = 7;
|
|
1077
|
+
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
1078
|
+
return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
|
|
1079
|
+
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
1080
|
+
var T = toObject$3(target);
|
|
1081
|
+
var argumentsLength = arguments.length;
|
|
1082
|
+
var index = 1;
|
|
1083
|
+
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1084
|
+
var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
1085
|
+
while (argumentsLength > index) {
|
|
1086
|
+
var S = IndexedObject$1(arguments[index++]);
|
|
1087
|
+
var keys = getOwnPropertySymbols ? concat$1(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
|
|
1088
|
+
var length = keys.length;
|
|
1089
|
+
var j = 0;
|
|
1090
|
+
var key;
|
|
1091
|
+
while (length > j) {
|
|
1092
|
+
key = keys[j++];
|
|
1093
|
+
if (!DESCRIPTORS$2 || call$5(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1094
|
+
}
|
|
1095
|
+
} return T;
|
|
1096
|
+
} : $assign;
|
|
1097
|
+
|
|
1098
|
+
var $$3 = _export;
|
|
1099
|
+
var assign = objectAssign;
|
|
1100
|
+
|
|
1101
|
+
// `Object.assign` method
|
|
1102
|
+
// https://tc39.es/ecma262/#sec-object.assign
|
|
1103
|
+
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1104
|
+
$$3({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1105
|
+
assign: assign
|
|
1106
|
+
});
|
|
1107
|
+
|
|
1108
|
+
const NinetailedContext = /*#__PURE__*/React.createContext(undefined);
|
|
1109
|
+
|
|
1110
|
+
const ExperimentsContext = /*#__PURE__*/React.createContext(undefined);
|
|
1111
|
+
|
|
1112
|
+
var aCallable = aCallable$2;
|
|
1113
|
+
var toObject$2 = toObject$5;
|
|
1114
|
+
var IndexedObject = indexedObject;
|
|
1115
|
+
var lengthOfArrayLike = lengthOfArrayLike$2;
|
|
1116
|
+
|
|
1117
|
+
var $TypeError$2 = TypeError;
|
|
1118
|
+
|
|
1119
|
+
// `Array.prototype.{ reduce, reduceRight }` methods implementation
|
|
1120
|
+
var createMethod$1 = function (IS_RIGHT) {
|
|
1121
|
+
return function (that, callbackfn, argumentsLength, memo) {
|
|
1122
|
+
aCallable(callbackfn);
|
|
1123
|
+
var O = toObject$2(that);
|
|
1124
|
+
var self = IndexedObject(O);
|
|
1125
|
+
var length = lengthOfArrayLike(O);
|
|
1126
|
+
var index = IS_RIGHT ? length - 1 : 0;
|
|
1127
|
+
var i = IS_RIGHT ? -1 : 1;
|
|
1128
|
+
if (argumentsLength < 2) while (true) {
|
|
1129
|
+
if (index in self) {
|
|
1130
|
+
memo = self[index];
|
|
1131
|
+
index += i;
|
|
1132
|
+
break;
|
|
1133
|
+
}
|
|
1134
|
+
index += i;
|
|
1135
|
+
if (IS_RIGHT ? index < 0 : length <= index) {
|
|
1136
|
+
throw $TypeError$2('Reduce of empty array with no initial value');
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
|
1140
|
+
memo = callbackfn(memo, self[index], index, O);
|
|
1141
|
+
}
|
|
1142
|
+
return memo;
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
var arrayReduce = {
|
|
1147
|
+
// `Array.prototype.reduce` method
|
|
1148
|
+
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
1149
|
+
left: createMethod$1(false),
|
|
1150
|
+
// `Array.prototype.reduceRight` method
|
|
1151
|
+
// https://tc39.es/ecma262/#sec-array.prototype.reduceright
|
|
1152
|
+
right: createMethod$1(true)
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
var fails$7 = fails$h;
|
|
1156
|
+
|
|
1157
|
+
var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
|
|
1158
|
+
var method = [][METHOD_NAME];
|
|
1159
|
+
return !!method && fails$7(function () {
|
|
1160
|
+
// eslint-disable-next-line no-useless-call -- required for testing
|
|
1161
|
+
method.call(null, argument || function () { return 1; }, 1);
|
|
1162
|
+
});
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
var classof$3 = classofRaw$2;
|
|
1166
|
+
var global$5 = global$f;
|
|
1167
|
+
|
|
1168
|
+
var engineIsNode = classof$3(global$5.process) == 'process';
|
|
1169
|
+
|
|
1170
|
+
var $$2 = _export;
|
|
1171
|
+
var $reduce = arrayReduce.left;
|
|
1172
|
+
var arrayMethodIsStrict = arrayMethodIsStrict$1;
|
|
1173
|
+
var CHROME_VERSION = engineV8Version;
|
|
1174
|
+
var IS_NODE = engineIsNode;
|
|
1175
|
+
|
|
1176
|
+
var STRICT_METHOD = arrayMethodIsStrict('reduce');
|
|
1177
|
+
// Chrome 80-82 has a critical bug
|
|
1178
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
|
1179
|
+
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
|
1180
|
+
|
|
1181
|
+
// `Array.prototype.reduce` method
|
|
1182
|
+
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
1183
|
+
$$2({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
|
1184
|
+
reduce: function reduce(callbackfn /* , initialValue */) {
|
|
1185
|
+
var length = arguments.length;
|
|
1186
|
+
return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
|
1187
|
+
}
|
|
1188
|
+
});
|
|
1189
|
+
|
|
1190
|
+
var objectDefineProperties = {};
|
|
1191
|
+
|
|
1192
|
+
var DESCRIPTORS$1 = descriptors;
|
|
1193
|
+
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
1194
|
+
var definePropertyModule = objectDefineProperty;
|
|
1195
|
+
var anObject$5 = anObject$8;
|
|
1196
|
+
var toIndexedObject$1 = toIndexedObject$5;
|
|
1197
|
+
var objectKeys = objectKeys$2;
|
|
1198
|
+
|
|
1199
|
+
// `Object.defineProperties` method
|
|
1200
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1201
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1202
|
+
objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1203
|
+
anObject$5(O);
|
|
1204
|
+
var props = toIndexedObject$1(Properties);
|
|
1205
|
+
var keys = objectKeys(Properties);
|
|
1206
|
+
var length = keys.length;
|
|
1207
|
+
var index = 0;
|
|
1208
|
+
var key;
|
|
1209
|
+
while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
|
1210
|
+
return O;
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
var getBuiltIn = getBuiltIn$4;
|
|
1214
|
+
|
|
1215
|
+
var html$1 = getBuiltIn('document', 'documentElement');
|
|
1216
|
+
|
|
1217
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
1218
|
+
|
|
1219
|
+
var anObject$4 = anObject$8;
|
|
1220
|
+
var definePropertiesModule = objectDefineProperties;
|
|
1221
|
+
var enumBugKeys = enumBugKeys$3;
|
|
1222
|
+
var hiddenKeys = hiddenKeys$4;
|
|
1223
|
+
var html = html$1;
|
|
1224
|
+
var documentCreateElement$1 = documentCreateElement$2;
|
|
1225
|
+
var sharedKey$1 = sharedKey$3;
|
|
1226
|
+
|
|
1227
|
+
var GT = '>';
|
|
1228
|
+
var LT = '<';
|
|
1229
|
+
var PROTOTYPE = 'prototype';
|
|
1230
|
+
var SCRIPT = 'script';
|
|
1231
|
+
var IE_PROTO$1 = sharedKey$1('IE_PROTO');
|
|
1232
|
+
|
|
1233
|
+
var EmptyConstructor = function () { /* empty */ };
|
|
1234
|
+
|
|
1235
|
+
var scriptTag = function (content) {
|
|
1236
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
1240
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
1241
|
+
activeXDocument.write(scriptTag(''));
|
|
1242
|
+
activeXDocument.close();
|
|
1243
|
+
var temp = activeXDocument.parentWindow.Object;
|
|
1244
|
+
activeXDocument = null; // avoid memory leak
|
|
1245
|
+
return temp;
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
1249
|
+
var NullProtoObjectViaIFrame = function () {
|
|
1250
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
1251
|
+
var iframe = documentCreateElement$1('iframe');
|
|
1252
|
+
var JS = 'java' + SCRIPT + ':';
|
|
1253
|
+
var iframeDocument;
|
|
1254
|
+
iframe.style.display = 'none';
|
|
1255
|
+
html.appendChild(iframe);
|
|
1256
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
1257
|
+
iframe.src = String(JS);
|
|
1258
|
+
iframeDocument = iframe.contentWindow.document;
|
|
1259
|
+
iframeDocument.open();
|
|
1260
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
1261
|
+
iframeDocument.close();
|
|
1262
|
+
return iframeDocument.F;
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
// Check for document.domain and active x support
|
|
1266
|
+
// No need to use active x approach when document.domain is not set
|
|
1267
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
|
1268
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
1269
|
+
// avoid IE GC bug
|
|
1270
|
+
var activeXDocument;
|
|
1271
|
+
var NullProtoObject = function () {
|
|
1272
|
+
try {
|
|
1273
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
1274
|
+
} catch (error) { /* ignore */ }
|
|
1275
|
+
NullProtoObject = typeof document != 'undefined'
|
|
1276
|
+
? document.domain && activeXDocument
|
|
1277
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
1278
|
+
: NullProtoObjectViaIFrame()
|
|
1279
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
1280
|
+
var length = enumBugKeys.length;
|
|
1281
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1282
|
+
return NullProtoObject();
|
|
1283
|
+
};
|
|
1284
|
+
|
|
1285
|
+
hiddenKeys[IE_PROTO$1] = true;
|
|
1286
|
+
|
|
1287
|
+
// `Object.create` method
|
|
1288
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
1289
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
1290
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
|
1291
|
+
var result;
|
|
1292
|
+
if (O !== null) {
|
|
1293
|
+
EmptyConstructor[PROTOTYPE] = anObject$4(O);
|
|
1294
|
+
result = new EmptyConstructor();
|
|
1295
|
+
EmptyConstructor[PROTOTYPE] = null;
|
|
1296
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1297
|
+
result[IE_PROTO$1] = O;
|
|
1298
|
+
} else result = NullProtoObject();
|
|
1299
|
+
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
var wellKnownSymbol$8 = wellKnownSymbol$a;
|
|
1303
|
+
var create$2 = objectCreate;
|
|
1304
|
+
var defineProperty$2 = objectDefineProperty.f;
|
|
1305
|
+
|
|
1306
|
+
var UNSCOPABLES = wellKnownSymbol$8('unscopables');
|
|
1307
|
+
var ArrayPrototype = Array.prototype;
|
|
1308
|
+
|
|
1309
|
+
// Array.prototype[@@unscopables]
|
|
1310
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1311
|
+
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
1312
|
+
defineProperty$2(ArrayPrototype, UNSCOPABLES, {
|
|
1313
|
+
configurable: true,
|
|
1314
|
+
value: create$2(null)
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
// add a key to Array.prototype[@@unscopables]
|
|
1319
|
+
var addToUnscopables$1 = function (key) {
|
|
1320
|
+
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
1321
|
+
};
|
|
1322
|
+
|
|
1323
|
+
var iterators = {};
|
|
1324
|
+
|
|
1325
|
+
var fails$6 = fails$h;
|
|
1326
|
+
|
|
1327
|
+
var correctPrototypeGetter = !fails$6(function () {
|
|
1328
|
+
function F() { /* empty */ }
|
|
1329
|
+
F.prototype.constructor = null;
|
|
1330
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1331
|
+
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1332
|
+
});
|
|
1333
|
+
|
|
1334
|
+
var hasOwn$1 = hasOwnProperty_1;
|
|
1335
|
+
var isCallable$6 = isCallable$h;
|
|
1336
|
+
var toObject$1 = toObject$5;
|
|
1337
|
+
var sharedKey = sharedKey$3;
|
|
1338
|
+
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1339
|
+
|
|
1340
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1341
|
+
var $Object$1 = Object;
|
|
1342
|
+
var ObjectPrototype = $Object$1.prototype;
|
|
1343
|
+
|
|
1344
|
+
// `Object.getPrototypeOf` method
|
|
1345
|
+
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1346
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1347
|
+
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
|
|
1348
|
+
var object = toObject$1(O);
|
|
1349
|
+
if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
|
|
1350
|
+
var constructor = object.constructor;
|
|
1351
|
+
if (isCallable$6(constructor) && object instanceof constructor) {
|
|
1352
|
+
return constructor.prototype;
|
|
1353
|
+
} return object instanceof $Object$1 ? ObjectPrototype : null;
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1356
|
+
var fails$5 = fails$h;
|
|
1357
|
+
var isCallable$5 = isCallable$h;
|
|
1358
|
+
var isObject = isObject$6;
|
|
1359
|
+
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1360
|
+
var defineBuiltIn$2 = defineBuiltIn$4;
|
|
1361
|
+
var wellKnownSymbol$7 = wellKnownSymbol$a;
|
|
1362
|
+
|
|
1363
|
+
var ITERATOR$2 = wellKnownSymbol$7('iterator');
|
|
1364
|
+
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1365
|
+
|
|
1366
|
+
// `%IteratorPrototype%` object
|
|
1367
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1368
|
+
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1369
|
+
|
|
1370
|
+
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
1371
|
+
if ([].keys) {
|
|
1372
|
+
arrayIterator = [].keys();
|
|
1373
|
+
// Safari 8 has buggy iterators w/o `next`
|
|
1374
|
+
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
|
1375
|
+
else {
|
|
1376
|
+
PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
|
|
1377
|
+
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails$5(function () {
|
|
1382
|
+
var test = {};
|
|
1383
|
+
// FF44- legacy iterators case
|
|
1384
|
+
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
1385
|
+
});
|
|
1386
|
+
|
|
1387
|
+
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
1388
|
+
|
|
1389
|
+
// `%IteratorPrototype%[@@iterator]()` method
|
|
1390
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1391
|
+
if (!isCallable$5(IteratorPrototype$2[ITERATOR$2])) {
|
|
1392
|
+
defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
|
|
1393
|
+
return this;
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
var iteratorsCore = {
|
|
1398
|
+
IteratorPrototype: IteratorPrototype$2,
|
|
1399
|
+
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
|
1400
|
+
};
|
|
1401
|
+
|
|
1402
|
+
var defineProperty$1 = objectDefineProperty.f;
|
|
1403
|
+
var hasOwn = hasOwnProperty_1;
|
|
1404
|
+
var wellKnownSymbol$6 = wellKnownSymbol$a;
|
|
1405
|
+
|
|
1406
|
+
var TO_STRING_TAG$3 = wellKnownSymbol$6('toStringTag');
|
|
1407
|
+
|
|
1408
|
+
var setToStringTag$2 = function (target, TAG, STATIC) {
|
|
1409
|
+
if (target && !STATIC) target = target.prototype;
|
|
1410
|
+
if (target && !hasOwn(target, TO_STRING_TAG$3)) {
|
|
1411
|
+
defineProperty$1(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1416
|
+
var create$1 = objectCreate;
|
|
1417
|
+
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
1418
|
+
var setToStringTag$1 = setToStringTag$2;
|
|
1419
|
+
var Iterators$2 = iterators;
|
|
1420
|
+
|
|
1421
|
+
var returnThis$1 = function () { return this; };
|
|
1422
|
+
|
|
1423
|
+
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1424
|
+
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1425
|
+
IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1426
|
+
setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
|
|
1427
|
+
Iterators$2[TO_STRING_TAG] = returnThis$1;
|
|
1428
|
+
return IteratorConstructor;
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1431
|
+
var isCallable$4 = isCallable$h;
|
|
1432
|
+
|
|
1433
|
+
var $String$1 = String;
|
|
1434
|
+
var $TypeError$1 = TypeError;
|
|
1435
|
+
|
|
1436
|
+
var aPossiblePrototype$1 = function (argument) {
|
|
1437
|
+
if (typeof argument == 'object' || isCallable$4(argument)) return argument;
|
|
1438
|
+
throw $TypeError$1("Can't set " + $String$1(argument) + ' as a prototype');
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1441
|
+
/* eslint-disable no-proto -- safe */
|
|
1442
|
+
|
|
1443
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
1444
|
+
var anObject$3 = anObject$8;
|
|
1445
|
+
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1446
|
+
|
|
1447
|
+
// `Object.setPrototypeOf` method
|
|
1448
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
1449
|
+
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
1450
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
1451
|
+
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
1452
|
+
var CORRECT_SETTER = false;
|
|
1453
|
+
var test = {};
|
|
1454
|
+
var setter;
|
|
1455
|
+
try {
|
|
1456
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1457
|
+
setter = uncurryThis$6(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1458
|
+
setter(test, []);
|
|
1459
|
+
CORRECT_SETTER = test instanceof Array;
|
|
1460
|
+
} catch (error) { /* empty */ }
|
|
1461
|
+
return function setPrototypeOf(O, proto) {
|
|
1462
|
+
anObject$3(O);
|
|
1463
|
+
aPossiblePrototype(proto);
|
|
1464
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
1465
|
+
else O.__proto__ = proto;
|
|
1466
|
+
return O;
|
|
1467
|
+
};
|
|
1468
|
+
}() : undefined);
|
|
1469
|
+
|
|
1470
|
+
var $$1 = _export;
|
|
1471
|
+
var call$4 = functionCall;
|
|
1472
|
+
var FunctionName = functionName;
|
|
1473
|
+
var isCallable$3 = isCallable$h;
|
|
1474
|
+
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1475
|
+
var getPrototypeOf = objectGetPrototypeOf;
|
|
1476
|
+
var setPrototypeOf = objectSetPrototypeOf;
|
|
1477
|
+
var setToStringTag = setToStringTag$2;
|
|
1478
|
+
var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
|
|
1479
|
+
var defineBuiltIn$1 = defineBuiltIn$4;
|
|
1480
|
+
var wellKnownSymbol$5 = wellKnownSymbol$a;
|
|
1481
|
+
var Iterators$1 = iterators;
|
|
1482
|
+
var IteratorsCore = iteratorsCore;
|
|
1483
|
+
|
|
1484
|
+
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
|
1485
|
+
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1486
|
+
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1487
|
+
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1488
|
+
var ITERATOR$1 = wellKnownSymbol$5('iterator');
|
|
1489
|
+
var KEYS = 'keys';
|
|
1490
|
+
var VALUES = 'values';
|
|
1491
|
+
var ENTRIES = 'entries';
|
|
1492
|
+
|
|
1493
|
+
var returnThis = function () { return this; };
|
|
1494
|
+
|
|
1495
|
+
var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
|
1496
|
+
createIteratorConstructor(IteratorConstructor, NAME, next);
|
|
1497
|
+
|
|
1498
|
+
var getIterationMethod = function (KIND) {
|
|
1499
|
+
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
|
1500
|
+
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
1501
|
+
switch (KIND) {
|
|
1502
|
+
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
|
1503
|
+
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
|
1504
|
+
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
|
1505
|
+
} return function () { return new IteratorConstructor(this); };
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1508
|
+
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1509
|
+
var INCORRECT_VALUES_NAME = false;
|
|
1510
|
+
var IterablePrototype = Iterable.prototype;
|
|
1511
|
+
var nativeIterator = IterablePrototype[ITERATOR$1]
|
|
1512
|
+
|| IterablePrototype['@@iterator']
|
|
1513
|
+
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
1514
|
+
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
1515
|
+
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
|
1516
|
+
var CurrentIteratorPrototype, methods, KEY;
|
|
1517
|
+
|
|
1518
|
+
// fix native
|
|
1519
|
+
if (anyNativeIterator) {
|
|
1520
|
+
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
|
1521
|
+
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
|
1522
|
+
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1523
|
+
if (setPrototypeOf) {
|
|
1524
|
+
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1525
|
+
} else if (!isCallable$3(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1526
|
+
defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
// Set @@toStringTag to native iterators
|
|
1530
|
+
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1535
|
+
if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1536
|
+
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1537
|
+
createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
|
|
1538
|
+
} else {
|
|
1539
|
+
INCORRECT_VALUES_NAME = true;
|
|
1540
|
+
defaultIterator = function values() { return call$4(nativeIterator, this); };
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
// export additional methods
|
|
1545
|
+
if (DEFAULT) {
|
|
1546
|
+
methods = {
|
|
1547
|
+
values: getIterationMethod(VALUES),
|
|
1548
|
+
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
|
1549
|
+
entries: getIterationMethod(ENTRIES)
|
|
1550
|
+
};
|
|
1551
|
+
if (FORCED) for (KEY in methods) {
|
|
1552
|
+
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1553
|
+
defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
|
|
1554
|
+
}
|
|
1555
|
+
} else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
// define iterator
|
|
1559
|
+
if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
|
1560
|
+
defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
|
1561
|
+
}
|
|
1562
|
+
Iterators$1[NAME] = defaultIterator;
|
|
1563
|
+
|
|
1564
|
+
return methods;
|
|
1565
|
+
};
|
|
1566
|
+
|
|
1567
|
+
// `CreateIterResultObject` abstract operation
|
|
1568
|
+
// https://tc39.es/ecma262/#sec-createiterresultobject
|
|
1569
|
+
var createIterResultObject$1 = function (value, done) {
|
|
1570
|
+
return { value: value, done: done };
|
|
1571
|
+
};
|
|
1572
|
+
|
|
1573
|
+
var toIndexedObject = toIndexedObject$5;
|
|
1574
|
+
var addToUnscopables = addToUnscopables$1;
|
|
1575
|
+
var Iterators = iterators;
|
|
1576
|
+
var InternalStateModule = internalState;
|
|
1577
|
+
var defineProperty = objectDefineProperty.f;
|
|
1578
|
+
var defineIterator = iteratorDefine;
|
|
1579
|
+
var createIterResultObject = createIterResultObject$1;
|
|
1580
|
+
var DESCRIPTORS = descriptors;
|
|
1581
|
+
|
|
1582
|
+
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1583
|
+
var setInternalState = InternalStateModule.set;
|
|
1584
|
+
var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1585
|
+
|
|
1586
|
+
// `Array.prototype.entries` method
|
|
1587
|
+
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
1588
|
+
// `Array.prototype.keys` method
|
|
1589
|
+
// https://tc39.es/ecma262/#sec-array.prototype.keys
|
|
1590
|
+
// `Array.prototype.values` method
|
|
1591
|
+
// https://tc39.es/ecma262/#sec-array.prototype.values
|
|
1592
|
+
// `Array.prototype[@@iterator]` method
|
|
1593
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
|
1594
|
+
// `CreateArrayIterator` internal method
|
|
1595
|
+
// https://tc39.es/ecma262/#sec-createarrayiterator
|
|
1596
|
+
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
|
1597
|
+
setInternalState(this, {
|
|
1598
|
+
type: ARRAY_ITERATOR,
|
|
1599
|
+
target: toIndexedObject(iterated), // target
|
|
1600
|
+
index: 0, // next index
|
|
1601
|
+
kind: kind // kind
|
|
1602
|
+
});
|
|
1603
|
+
// `%ArrayIteratorPrototype%.next` method
|
|
1604
|
+
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1605
|
+
}, function () {
|
|
1606
|
+
var state = getInternalState$1(this);
|
|
1607
|
+
var target = state.target;
|
|
1608
|
+
var kind = state.kind;
|
|
1609
|
+
var index = state.index++;
|
|
1610
|
+
if (!target || index >= target.length) {
|
|
1611
|
+
state.target = undefined;
|
|
1612
|
+
return createIterResultObject(undefined, true);
|
|
1613
|
+
}
|
|
1614
|
+
if (kind == 'keys') return createIterResultObject(index, false);
|
|
1615
|
+
if (kind == 'values') return createIterResultObject(target[index], false);
|
|
1616
|
+
return createIterResultObject([index, target[index]], false);
|
|
1617
|
+
}, 'values');
|
|
1618
|
+
|
|
1619
|
+
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
1620
|
+
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
1621
|
+
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
1622
|
+
var values = Iterators.Arguments = Iterators.Array;
|
|
1623
|
+
|
|
1624
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1625
|
+
addToUnscopables('keys');
|
|
1626
|
+
addToUnscopables('values');
|
|
1627
|
+
addToUnscopables('entries');
|
|
1628
|
+
|
|
1629
|
+
// V8 ~ Chrome 45- bug
|
|
1630
|
+
if (DESCRIPTORS && values.name !== 'values') try {
|
|
1631
|
+
defineProperty(values, 'name', { value: 'values' });
|
|
1632
|
+
} catch (error) { /* empty */ }
|
|
1633
|
+
|
|
1634
|
+
// iterable DOM collections
|
|
1635
|
+
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
1636
|
+
var domIterables = {
|
|
1637
|
+
CSSRuleList: 0,
|
|
1638
|
+
CSSStyleDeclaration: 0,
|
|
1639
|
+
CSSValueList: 0,
|
|
1640
|
+
ClientRectList: 0,
|
|
1641
|
+
DOMRectList: 0,
|
|
1642
|
+
DOMStringList: 0,
|
|
1643
|
+
DOMTokenList: 1,
|
|
1644
|
+
DataTransferItemList: 0,
|
|
1645
|
+
FileList: 0,
|
|
1646
|
+
HTMLAllCollection: 0,
|
|
1647
|
+
HTMLCollection: 0,
|
|
1648
|
+
HTMLFormElement: 0,
|
|
1649
|
+
HTMLSelectElement: 0,
|
|
1650
|
+
MediaList: 0,
|
|
1651
|
+
MimeTypeArray: 0,
|
|
1652
|
+
NamedNodeMap: 0,
|
|
1653
|
+
NodeList: 1,
|
|
1654
|
+
PaintRequestList: 0,
|
|
1655
|
+
Plugin: 0,
|
|
1656
|
+
PluginArray: 0,
|
|
1657
|
+
SVGLengthList: 0,
|
|
1658
|
+
SVGNumberList: 0,
|
|
1659
|
+
SVGPathSegList: 0,
|
|
1660
|
+
SVGPointList: 0,
|
|
1661
|
+
SVGStringList: 0,
|
|
1662
|
+
SVGTransformList: 0,
|
|
1663
|
+
SourceBufferList: 0,
|
|
1664
|
+
StyleSheetList: 0,
|
|
1665
|
+
TextTrackCueList: 0,
|
|
1666
|
+
TextTrackList: 0,
|
|
1667
|
+
TouchList: 0
|
|
1668
|
+
};
|
|
1669
|
+
|
|
1670
|
+
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
|
|
1671
|
+
var documentCreateElement = documentCreateElement$2;
|
|
1672
|
+
|
|
1673
|
+
var classList = documentCreateElement('span').classList;
|
|
1674
|
+
var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
|
|
1675
|
+
|
|
1676
|
+
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1677
|
+
|
|
1678
|
+
var global$4 = global$f;
|
|
1679
|
+
var DOMIterables = domIterables;
|
|
1680
|
+
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1681
|
+
var ArrayIteratorMethods = es_array_iterator;
|
|
1682
|
+
var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
|
|
1683
|
+
var wellKnownSymbol$4 = wellKnownSymbol$a;
|
|
1684
|
+
|
|
1685
|
+
var ITERATOR = wellKnownSymbol$4('iterator');
|
|
1686
|
+
var TO_STRING_TAG$2 = wellKnownSymbol$4('toStringTag');
|
|
1687
|
+
var ArrayValues = ArrayIteratorMethods.values;
|
|
1688
|
+
|
|
1689
|
+
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
1690
|
+
if (CollectionPrototype) {
|
|
1691
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1692
|
+
if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
|
1693
|
+
createNonEnumerableProperty$1(CollectionPrototype, ITERATOR, ArrayValues);
|
|
1694
|
+
} catch (error) {
|
|
1695
|
+
CollectionPrototype[ITERATOR] = ArrayValues;
|
|
1696
|
+
}
|
|
1697
|
+
if (!CollectionPrototype[TO_STRING_TAG$2]) {
|
|
1698
|
+
createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
|
|
1699
|
+
}
|
|
1700
|
+
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
|
1701
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1702
|
+
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
|
1703
|
+
createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
|
1704
|
+
} catch (error) {
|
|
1705
|
+
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1711
|
+
for (var COLLECTION_NAME in DOMIterables) {
|
|
1712
|
+
handlePrototype(global$4[COLLECTION_NAME] && global$4[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1716
|
+
|
|
1717
|
+
/******************************************************************************
|
|
1718
|
+
Copyright (c) Microsoft Corporation.
|
|
1719
|
+
|
|
1720
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
1721
|
+
purpose with or without fee is hereby granted.
|
|
1722
|
+
|
|
1723
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1724
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1725
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1726
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1727
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1728
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1729
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
1730
|
+
***************************************************************************** */
|
|
1731
|
+
|
|
1732
|
+
function __rest(s, e) {
|
|
1733
|
+
var t = {};
|
|
1734
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1735
|
+
t[p] = s[p];
|
|
1736
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1737
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1738
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1739
|
+
t[p[i]] = s[p[i]];
|
|
1740
|
+
}
|
|
1741
|
+
return t;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
1745
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1746
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1747
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
1748
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
1749
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1750
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
const EXPERIENCE_TRAIT_PREFIX = 'nt_experiment_';
|
|
1755
|
+
|
|
1756
|
+
const useNinetailed = () => {
|
|
1757
|
+
const ninetailed = React.useContext(NinetailedContext);
|
|
1758
|
+
if (ninetailed === undefined) {
|
|
1759
|
+
throw new Error('The component using the the context must be a descendant of the NinetailedProvider');
|
|
1760
|
+
}
|
|
1761
|
+
return ninetailed;
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
const debounce = (fn, wait, options) => {
|
|
1765
|
+
let debouncedArgs = [];
|
|
1766
|
+
const debouncedFn = _debounce__default["default"](() => {
|
|
1767
|
+
fn.call(undefined, debouncedArgs);
|
|
1768
|
+
debouncedArgs = [];
|
|
1769
|
+
}, wait, options);
|
|
1770
|
+
return (...args) => {
|
|
1771
|
+
debouncedArgs.push(values__default["default"](args));
|
|
1772
|
+
debouncedFn();
|
|
1773
|
+
};
|
|
1774
|
+
};
|
|
1775
|
+
const useProvideJoinExperiment = ({
|
|
1776
|
+
experiments,
|
|
1777
|
+
maximumActiveExperiments: _maximumActiveExperiments = 1
|
|
1778
|
+
}) => {
|
|
1779
|
+
const {
|
|
1780
|
+
identify
|
|
1781
|
+
} = useNinetailed();
|
|
1782
|
+
const joinExperimentIdentify = debounce(args => {
|
|
1783
|
+
const traits = args.slice(0, _maximumActiveExperiments).reduce((traits, [experimentJoinTraits]) => {
|
|
1784
|
+
return Object.assign(Object.assign({}, experimentJoinTraits), traits);
|
|
1785
|
+
}, {});
|
|
1786
|
+
identify('', traits);
|
|
1787
|
+
});
|
|
1788
|
+
return React.useCallback(data => __awaiter(void 0, void 0, void 0, function* () {
|
|
1789
|
+
const {
|
|
1790
|
+
experiment,
|
|
1791
|
+
profile
|
|
1792
|
+
} = data;
|
|
1793
|
+
const isExperiment = experiment.type === 'nt_experiment';
|
|
1794
|
+
if (!isExperiment) {
|
|
1795
|
+
experience_jsShared.logger.warn(`The experience ${experiment.id}, which you tried to join, is not an experiment.`);
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
const activeExperiments = experience_js.selectActiveExperiments(experiments, profile);
|
|
1799
|
+
if (activeExperiments.length >= _maximumActiveExperiments) {
|
|
1800
|
+
experience_jsShared.logger.warn(`The maximum number of active experiments (${_maximumActiveExperiments}) has been reached.`);
|
|
1801
|
+
return;
|
|
1802
|
+
}
|
|
1803
|
+
if (activeExperiments.some(activeExperiment => activeExperiment.id === experiment.id)) {
|
|
1804
|
+
experience_jsShared.logger.debug(`The user is already part of experiment ${experiment.id}. Won't join again.`);
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
joinExperimentIdentify({
|
|
1808
|
+
[`${EXPERIENCE_TRAIT_PREFIX}${experiment.id}`]: true
|
|
1809
|
+
});
|
|
1810
|
+
experience_jsShared.logger.debug(`Sent event to join experiment ${experiment.id}.`);
|
|
1811
|
+
}), []);
|
|
1812
|
+
};
|
|
1813
|
+
|
|
1814
|
+
const ExperimentsProvider = ({
|
|
1815
|
+
experiments,
|
|
1816
|
+
maximumActiveExperiments: _maximumActiveExperiments = 1,
|
|
1817
|
+
children
|
|
1818
|
+
}) => {
|
|
1819
|
+
const joinExperiment = useProvideJoinExperiment({
|
|
1820
|
+
experiments,
|
|
1821
|
+
maximumActiveExperiments: _maximumActiveExperiments
|
|
1822
|
+
});
|
|
1823
|
+
return jsxRuntime.jsx(ExperimentsContext.Provider, Object.assign({
|
|
1824
|
+
value: {
|
|
1825
|
+
experiments,
|
|
1826
|
+
joinExperiment
|
|
1827
|
+
}
|
|
1828
|
+
}, {
|
|
1829
|
+
children: children
|
|
1830
|
+
}));
|
|
1831
|
+
};
|
|
1832
|
+
|
|
1833
|
+
const NinetailedProvider = ({
|
|
1834
|
+
children,
|
|
1835
|
+
clientId,
|
|
1836
|
+
experiments: _experiments = [],
|
|
1837
|
+
maximumActiveExperiments,
|
|
1838
|
+
environment,
|
|
1839
|
+
preview,
|
|
1840
|
+
url,
|
|
1841
|
+
profile,
|
|
1842
|
+
locale,
|
|
1843
|
+
requestTimeout,
|
|
1844
|
+
plugins: _plugins = [],
|
|
1845
|
+
onLog,
|
|
1846
|
+
onError
|
|
1847
|
+
}) => {
|
|
1848
|
+
const ninetailed = React.useMemo(() => new experience_js.Ninetailed({
|
|
1849
|
+
clientId,
|
|
1850
|
+
environment,
|
|
1851
|
+
preview
|
|
1852
|
+
}, {
|
|
1853
|
+
url,
|
|
1854
|
+
plugins: _plugins,
|
|
1855
|
+
profile,
|
|
1856
|
+
locale,
|
|
1857
|
+
requestTimeout,
|
|
1858
|
+
onLog,
|
|
1859
|
+
onError
|
|
1860
|
+
}), []);
|
|
1861
|
+
return jsxRuntime.jsx(NinetailedContext.Provider, Object.assign({
|
|
1862
|
+
value: ninetailed
|
|
1863
|
+
}, {
|
|
1864
|
+
children: jsxRuntime.jsx(ExperimentsProvider, Object.assign({
|
|
1865
|
+
experiments: _experiments,
|
|
1866
|
+
maximumActiveExperiments: maximumActiveExperiments
|
|
1867
|
+
}, {
|
|
1868
|
+
children: children
|
|
1869
|
+
}))
|
|
1870
|
+
}));
|
|
1871
|
+
};
|
|
1872
|
+
|
|
1873
|
+
const useProfile = () => {
|
|
1874
|
+
const ninetailed = useNinetailed();
|
|
1875
|
+
const [profileState, setProfileState] = React.useState(ninetailed.profileState);
|
|
1876
|
+
const profileStateRef = React.useRef({});
|
|
1877
|
+
/**
|
|
1878
|
+
* This effect compares the old and new profile state before updating it.
|
|
1879
|
+
* We use a ref to avoid an infinite loop which can happen when an empty profile state was updated with no changes.
|
|
1880
|
+
* This behaviour occurred as the validation handling on the error property was not set properly in the "CreateProfile" and "UpdateProfile" endpoint types.
|
|
1881
|
+
* Furthermore, it was also observed, that it "only" occurred when the preview plugin was used in parallel.
|
|
1882
|
+
*/
|
|
1883
|
+
React.useEffect(() => {
|
|
1884
|
+
ninetailed.onProfileChange(profileState => {
|
|
1885
|
+
if (isEqual__default["default"](profileState, profileStateRef.current)) {
|
|
1886
|
+
experience_jsShared.logger.debug('Profile State Did Not Change', profileState);
|
|
1887
|
+
return;
|
|
1888
|
+
} else {
|
|
1889
|
+
setProfileState(profileState);
|
|
1890
|
+
profileStateRef.current = profileState;
|
|
1891
|
+
experience_jsShared.logger.debug('Profile State Changed', profileState);
|
|
1892
|
+
}
|
|
1893
|
+
});
|
|
1894
|
+
}, []);
|
|
1895
|
+
/**
|
|
1896
|
+
* Old implementation without profile state deep comparison
|
|
1897
|
+
*/
|
|
1898
|
+
/*useEffect(() => {
|
|
1899
|
+
return ninetailed.onProfileChange((profileState) => {
|
|
1900
|
+
console.log('profileState', profileState);
|
|
1901
|
+
setProfileState(profileState);
|
|
1902
|
+
});
|
|
1903
|
+
}, []);*/
|
|
1904
|
+
return Object.assign(Object.assign({}, profileState), {
|
|
1905
|
+
loading: profileState.status === 'loading'
|
|
1906
|
+
});
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1909
|
+
const usePersonalize = (baseline, variants, options = {
|
|
1910
|
+
holdout: -1
|
|
1911
|
+
}) => {
|
|
1912
|
+
const profile = useProfile();
|
|
1913
|
+
return experience_js.selectVariant(baseline, variants, profile, options);
|
|
1914
|
+
};
|
|
1915
|
+
|
|
1916
|
+
const TrackHasSeenComponent = ({
|
|
1917
|
+
children,
|
|
1918
|
+
variant,
|
|
1919
|
+
audience,
|
|
1920
|
+
isPersonalized
|
|
1921
|
+
}) => {
|
|
1922
|
+
const ninetailed = useNinetailed();
|
|
1923
|
+
const {
|
|
1924
|
+
ref,
|
|
1925
|
+
inView
|
|
1926
|
+
} = reactIntersectionObserver.useInView({
|
|
1927
|
+
triggerOnce: true
|
|
1928
|
+
});
|
|
1929
|
+
React.useEffect(() => {
|
|
1930
|
+
if (experience_jsShared.isBrowser() && inView) {
|
|
1931
|
+
ninetailed.trackHasSeenComponent({
|
|
1932
|
+
variant,
|
|
1933
|
+
audience,
|
|
1934
|
+
isPersonalized
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
}, [inView]);
|
|
1938
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1939
|
+
children: [jsxRuntime.jsx("div", {
|
|
1940
|
+
ref: ref
|
|
1941
|
+
}), children]
|
|
1942
|
+
});
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1945
|
+
const Personalize = _a => {
|
|
1946
|
+
var {
|
|
1947
|
+
component: Component,
|
|
1948
|
+
loadingComponent: LoadingComponent,
|
|
1949
|
+
variants = [],
|
|
1950
|
+
holdout = -1
|
|
1951
|
+
} = _a,
|
|
1952
|
+
baseline = __rest(_a, ["component", "loadingComponent", "variants", "holdout"]);
|
|
1953
|
+
const {
|
|
1954
|
+
loading,
|
|
1955
|
+
variant,
|
|
1956
|
+
isPersonalized,
|
|
1957
|
+
audience
|
|
1958
|
+
} = usePersonalize(baseline, variants, {
|
|
1959
|
+
holdout
|
|
1960
|
+
});
|
|
1961
|
+
const hasVariants = variants.length > 0;
|
|
1962
|
+
if (!hasVariants) {
|
|
1963
|
+
return jsxRuntime.jsx(Component, Object.assign({}, baseline, {
|
|
1964
|
+
ninetailed: {
|
|
1965
|
+
isPersonalized,
|
|
1966
|
+
audience
|
|
1967
|
+
}
|
|
1968
|
+
}));
|
|
1969
|
+
}
|
|
1970
|
+
if (loading) {
|
|
1971
|
+
if (LoadingComponent) {
|
|
1972
|
+
return jsxRuntime.jsx(LoadingComponent, {});
|
|
1973
|
+
}
|
|
1974
|
+
return jsxRuntime.jsx("div", Object.assign({
|
|
1975
|
+
style: {
|
|
1976
|
+
opacity: 0
|
|
1977
|
+
}
|
|
1978
|
+
}, {
|
|
1979
|
+
children: jsxRuntime.jsx(Component, Object.assign({}, variant, {
|
|
1980
|
+
ninetailed: {
|
|
1981
|
+
isPersonalized,
|
|
1982
|
+
audience
|
|
1983
|
+
}
|
|
1984
|
+
}))
|
|
1985
|
+
}), "hide");
|
|
1986
|
+
}
|
|
1987
|
+
return jsxRuntime.jsx(TrackHasSeenComponent, Object.assign({
|
|
1988
|
+
variant: variant,
|
|
1989
|
+
audience: audience,
|
|
1990
|
+
isPersonalized: isPersonalized
|
|
1991
|
+
}, {
|
|
1992
|
+
children: /*#__PURE__*/React.createElement(Component, Object.assign({}, variant, {
|
|
1993
|
+
key: `${audience.id}-${variant.id}`,
|
|
1994
|
+
ninetailed: {
|
|
1995
|
+
isPersonalized,
|
|
1996
|
+
audience
|
|
1997
|
+
}
|
|
1998
|
+
}))
|
|
1999
|
+
}));
|
|
2000
|
+
};
|
|
2001
|
+
|
|
2002
|
+
var wellKnownSymbol$3 = wellKnownSymbol$a;
|
|
2003
|
+
|
|
2004
|
+
var TO_STRING_TAG$1 = wellKnownSymbol$3('toStringTag');
|
|
2005
|
+
var test = {};
|
|
2006
|
+
|
|
2007
|
+
test[TO_STRING_TAG$1] = 'z';
|
|
2008
|
+
|
|
2009
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
2010
|
+
|
|
2011
|
+
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
2012
|
+
var isCallable$2 = isCallable$h;
|
|
2013
|
+
var classofRaw$1 = classofRaw$2;
|
|
2014
|
+
var wellKnownSymbol$2 = wellKnownSymbol$a;
|
|
2015
|
+
|
|
2016
|
+
var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
|
|
2017
|
+
var $Object = Object;
|
|
2018
|
+
|
|
2019
|
+
// ES3 wrong here
|
|
2020
|
+
var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
|
|
2021
|
+
|
|
2022
|
+
// fallback for IE11 Script Access Denied error
|
|
2023
|
+
var tryGet = function (it, key) {
|
|
2024
|
+
try {
|
|
2025
|
+
return it[key];
|
|
2026
|
+
} catch (error) { /* empty */ }
|
|
2027
|
+
};
|
|
2028
|
+
|
|
2029
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
2030
|
+
var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
|
|
2031
|
+
var O, tag, result;
|
|
2032
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
2033
|
+
// @@toStringTag case
|
|
2034
|
+
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
2035
|
+
// builtinTag case
|
|
2036
|
+
: CORRECT_ARGUMENTS ? classofRaw$1(O)
|
|
2037
|
+
// ES3 arguments fallback
|
|
2038
|
+
: (result = classofRaw$1(O)) == 'Object' && isCallable$2(O.callee) ? 'Arguments' : result;
|
|
2039
|
+
};
|
|
2040
|
+
|
|
2041
|
+
var classof$1 = classof$2;
|
|
2042
|
+
|
|
2043
|
+
var $String = String;
|
|
2044
|
+
|
|
2045
|
+
var toString$3 = function (argument) {
|
|
2046
|
+
if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
2047
|
+
return $String(argument);
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
var anObject$2 = anObject$8;
|
|
2051
|
+
|
|
2052
|
+
// `RegExp.prototype.flags` getter implementation
|
|
2053
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
2054
|
+
var regexpFlags$1 = function () {
|
|
2055
|
+
var that = anObject$2(this);
|
|
2056
|
+
var result = '';
|
|
2057
|
+
if (that.hasIndices) result += 'd';
|
|
2058
|
+
if (that.global) result += 'g';
|
|
2059
|
+
if (that.ignoreCase) result += 'i';
|
|
2060
|
+
if (that.multiline) result += 'm';
|
|
2061
|
+
if (that.dotAll) result += 's';
|
|
2062
|
+
if (that.unicode) result += 'u';
|
|
2063
|
+
if (that.unicodeSets) result += 'v';
|
|
2064
|
+
if (that.sticky) result += 'y';
|
|
2065
|
+
return result;
|
|
2066
|
+
};
|
|
2067
|
+
|
|
2068
|
+
var fails$4 = fails$h;
|
|
2069
|
+
var global$3 = global$f;
|
|
2070
|
+
|
|
2071
|
+
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
2072
|
+
var $RegExp$2 = global$3.RegExp;
|
|
2073
|
+
|
|
2074
|
+
var UNSUPPORTED_Y$1 = fails$4(function () {
|
|
2075
|
+
var re = $RegExp$2('a', 'y');
|
|
2076
|
+
re.lastIndex = 2;
|
|
2077
|
+
return re.exec('abcd') != null;
|
|
2078
|
+
});
|
|
2079
|
+
|
|
2080
|
+
// UC Browser bug
|
|
2081
|
+
// https://github.com/zloirock/core-js/issues/1008
|
|
2082
|
+
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$4(function () {
|
|
2083
|
+
return !$RegExp$2('a', 'y').sticky;
|
|
2084
|
+
});
|
|
2085
|
+
|
|
2086
|
+
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$4(function () {
|
|
2087
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
2088
|
+
var re = $RegExp$2('^r', 'gy');
|
|
2089
|
+
re.lastIndex = 2;
|
|
2090
|
+
return re.exec('str') != null;
|
|
2091
|
+
});
|
|
2092
|
+
|
|
2093
|
+
var regexpStickyHelpers = {
|
|
2094
|
+
BROKEN_CARET: BROKEN_CARET,
|
|
2095
|
+
MISSED_STICKY: MISSED_STICKY,
|
|
2096
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
2097
|
+
};
|
|
2098
|
+
|
|
2099
|
+
var fails$3 = fails$h;
|
|
2100
|
+
var global$2 = global$f;
|
|
2101
|
+
|
|
2102
|
+
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
2103
|
+
var $RegExp$1 = global$2.RegExp;
|
|
2104
|
+
|
|
2105
|
+
var regexpUnsupportedDotAll = fails$3(function () {
|
|
2106
|
+
var re = $RegExp$1('.', 's');
|
|
2107
|
+
return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
|
2108
|
+
});
|
|
2109
|
+
|
|
2110
|
+
var fails$2 = fails$h;
|
|
2111
|
+
var global$1 = global$f;
|
|
2112
|
+
|
|
2113
|
+
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
2114
|
+
var $RegExp = global$1.RegExp;
|
|
2115
|
+
|
|
2116
|
+
var regexpUnsupportedNcg = fails$2(function () {
|
|
2117
|
+
var re = $RegExp('(?<a>b)', 'g');
|
|
2118
|
+
return re.exec('b').groups.a !== 'b' ||
|
|
2119
|
+
'b'.replace(re, '$<a>c') !== 'bc';
|
|
2120
|
+
});
|
|
2121
|
+
|
|
2122
|
+
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
2123
|
+
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
2124
|
+
var call$3 = functionCall;
|
|
2125
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
2126
|
+
var toString$2 = toString$3;
|
|
2127
|
+
var regexpFlags = regexpFlags$1;
|
|
2128
|
+
var stickyHelpers = regexpStickyHelpers;
|
|
2129
|
+
var shared = shared$4.exports;
|
|
2130
|
+
var create = objectCreate;
|
|
2131
|
+
var getInternalState = internalState.get;
|
|
2132
|
+
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
|
2133
|
+
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
2134
|
+
|
|
2135
|
+
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
2136
|
+
var nativeExec = RegExp.prototype.exec;
|
|
2137
|
+
var patchedExec = nativeExec;
|
|
2138
|
+
var charAt$3 = uncurryThis$5(''.charAt);
|
|
2139
|
+
var indexOf = uncurryThis$5(''.indexOf);
|
|
2140
|
+
var replace$1 = uncurryThis$5(''.replace);
|
|
2141
|
+
var stringSlice$3 = uncurryThis$5(''.slice);
|
|
2142
|
+
|
|
2143
|
+
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
2144
|
+
var re1 = /a/;
|
|
2145
|
+
var re2 = /b*/g;
|
|
2146
|
+
call$3(nativeExec, re1, 'a');
|
|
2147
|
+
call$3(nativeExec, re2, 'a');
|
|
2148
|
+
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
2149
|
+
})();
|
|
2150
|
+
|
|
2151
|
+
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
|
2152
|
+
|
|
2153
|
+
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
2154
|
+
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
2155
|
+
|
|
2156
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
2157
|
+
|
|
2158
|
+
if (PATCH) {
|
|
2159
|
+
patchedExec = function exec(string) {
|
|
2160
|
+
var re = this;
|
|
2161
|
+
var state = getInternalState(re);
|
|
2162
|
+
var str = toString$2(string);
|
|
2163
|
+
var raw = state.raw;
|
|
2164
|
+
var result, reCopy, lastIndex, match, i, object, group;
|
|
2165
|
+
|
|
2166
|
+
if (raw) {
|
|
2167
|
+
raw.lastIndex = re.lastIndex;
|
|
2168
|
+
result = call$3(patchedExec, raw, str);
|
|
2169
|
+
re.lastIndex = raw.lastIndex;
|
|
2170
|
+
return result;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
var groups = state.groups;
|
|
2174
|
+
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
2175
|
+
var flags = call$3(regexpFlags, re);
|
|
2176
|
+
var source = re.source;
|
|
2177
|
+
var charsAdded = 0;
|
|
2178
|
+
var strCopy = str;
|
|
2179
|
+
|
|
2180
|
+
if (sticky) {
|
|
2181
|
+
flags = replace$1(flags, 'y', '');
|
|
2182
|
+
if (indexOf(flags, 'g') === -1) {
|
|
2183
|
+
flags += 'g';
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
strCopy = stringSlice$3(str, re.lastIndex);
|
|
2187
|
+
// Support anchored sticky behavior.
|
|
2188
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
|
|
2189
|
+
source = '(?: ' + source + ')';
|
|
2190
|
+
strCopy = ' ' + strCopy;
|
|
2191
|
+
charsAdded++;
|
|
2192
|
+
}
|
|
2193
|
+
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
2194
|
+
// simulate the 'y' flag.
|
|
2195
|
+
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
if (NPCG_INCLUDED) {
|
|
2199
|
+
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
2200
|
+
}
|
|
2201
|
+
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
2202
|
+
|
|
2203
|
+
match = call$3(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2204
|
+
|
|
2205
|
+
if (sticky) {
|
|
2206
|
+
if (match) {
|
|
2207
|
+
match.input = stringSlice$3(match.input, charsAdded);
|
|
2208
|
+
match[0] = stringSlice$3(match[0], charsAdded);
|
|
2209
|
+
match.index = re.lastIndex;
|
|
2210
|
+
re.lastIndex += match[0].length;
|
|
2211
|
+
} else re.lastIndex = 0;
|
|
2212
|
+
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
2213
|
+
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
2214
|
+
}
|
|
2215
|
+
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
2216
|
+
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
2217
|
+
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
2218
|
+
call$3(nativeReplace, match[0], reCopy, function () {
|
|
2219
|
+
for (i = 1; i < arguments.length - 2; i++) {
|
|
2220
|
+
if (arguments[i] === undefined) match[i] = undefined;
|
|
2221
|
+
}
|
|
2222
|
+
});
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
if (match && groups) {
|
|
2226
|
+
match.groups = object = create(null);
|
|
2227
|
+
for (i = 0; i < groups.length; i++) {
|
|
2228
|
+
group = groups[i];
|
|
2229
|
+
object[group[0]] = match[group[1]];
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
return match;
|
|
2234
|
+
};
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
var regexpExec$2 = patchedExec;
|
|
2238
|
+
|
|
2239
|
+
var $ = _export;
|
|
2240
|
+
var exec = regexpExec$2;
|
|
2241
|
+
|
|
2242
|
+
// `RegExp.prototype.exec` method
|
|
2243
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
2244
|
+
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
|
2245
|
+
exec: exec
|
|
2246
|
+
});
|
|
2247
|
+
|
|
2248
|
+
var NATIVE_BIND = functionBindNative;
|
|
2249
|
+
|
|
2250
|
+
var FunctionPrototype = Function.prototype;
|
|
2251
|
+
var apply$1 = FunctionPrototype.apply;
|
|
2252
|
+
var call$2 = FunctionPrototype.call;
|
|
2253
|
+
|
|
2254
|
+
// eslint-disable-next-line es/no-reflect -- safe
|
|
2255
|
+
var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$2.bind(apply$1) : function () {
|
|
2256
|
+
return call$2.apply(apply$1, arguments);
|
|
2257
|
+
});
|
|
2258
|
+
|
|
2259
|
+
var classofRaw = classofRaw$2;
|
|
2260
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
2261
|
+
|
|
2262
|
+
var functionUncurryThisClause = function (fn) {
|
|
2263
|
+
// Nashorn bug:
|
|
2264
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
2265
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
2266
|
+
if (classofRaw(fn) === 'Function') return uncurryThis$4(fn);
|
|
2267
|
+
};
|
|
2268
|
+
|
|
2269
|
+
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
2270
|
+
|
|
2271
|
+
var uncurryThis$3 = functionUncurryThisClause;
|
|
2272
|
+
var defineBuiltIn = defineBuiltIn$4;
|
|
2273
|
+
var regexpExec$1 = regexpExec$2;
|
|
2274
|
+
var fails$1 = fails$h;
|
|
2275
|
+
var wellKnownSymbol$1 = wellKnownSymbol$a;
|
|
2276
|
+
var createNonEnumerableProperty = createNonEnumerableProperty$5;
|
|
2277
|
+
|
|
2278
|
+
var SPECIES = wellKnownSymbol$1('species');
|
|
2279
|
+
var RegExpPrototype = RegExp.prototype;
|
|
2280
|
+
|
|
2281
|
+
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
2282
|
+
var SYMBOL = wellKnownSymbol$1(KEY);
|
|
2283
|
+
|
|
2284
|
+
var DELEGATES_TO_SYMBOL = !fails$1(function () {
|
|
2285
|
+
// String methods call symbol-named RegEp methods
|
|
2286
|
+
var O = {};
|
|
2287
|
+
O[SYMBOL] = function () { return 7; };
|
|
2288
|
+
return ''[KEY](O) != 7;
|
|
2289
|
+
});
|
|
2290
|
+
|
|
2291
|
+
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$1(function () {
|
|
2292
|
+
// Symbol-named RegExp methods call .exec
|
|
2293
|
+
var execCalled = false;
|
|
2294
|
+
var re = /a/;
|
|
2295
|
+
|
|
2296
|
+
if (KEY === 'split') {
|
|
2297
|
+
// We can't use real regex here since it causes deoptimization
|
|
2298
|
+
// and serious performance degradation in V8
|
|
2299
|
+
// https://github.com/zloirock/core-js/issues/306
|
|
2300
|
+
re = {};
|
|
2301
|
+
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
|
2302
|
+
// a new one. We need to return the patched regex when creating the new one.
|
|
2303
|
+
re.constructor = {};
|
|
2304
|
+
re.constructor[SPECIES] = function () { return re; };
|
|
2305
|
+
re.flags = '';
|
|
2306
|
+
re[SYMBOL] = /./[SYMBOL];
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
re.exec = function () { execCalled = true; return null; };
|
|
2310
|
+
|
|
2311
|
+
re[SYMBOL]('');
|
|
2312
|
+
return !execCalled;
|
|
2313
|
+
});
|
|
2314
|
+
|
|
2315
|
+
if (
|
|
2316
|
+
!DELEGATES_TO_SYMBOL ||
|
|
2317
|
+
!DELEGATES_TO_EXEC ||
|
|
2318
|
+
FORCED
|
|
2319
|
+
) {
|
|
2320
|
+
var uncurriedNativeRegExpMethod = uncurryThis$3(/./[SYMBOL]);
|
|
2321
|
+
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
2322
|
+
var uncurriedNativeMethod = uncurryThis$3(nativeMethod);
|
|
2323
|
+
var $exec = regexp.exec;
|
|
2324
|
+
if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
|
|
2325
|
+
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
2326
|
+
// The native String method already delegates to @@method (this
|
|
2327
|
+
// polyfilled function), leasing to infinite recursion.
|
|
2328
|
+
// We avoid it by directly calling the native @@method method.
|
|
2329
|
+
return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
|
|
2330
|
+
}
|
|
2331
|
+
return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
|
|
2332
|
+
}
|
|
2333
|
+
return { done: false };
|
|
2334
|
+
});
|
|
2335
|
+
|
|
2336
|
+
defineBuiltIn(String.prototype, KEY, methods[0]);
|
|
2337
|
+
defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
|
2341
|
+
};
|
|
2342
|
+
|
|
2343
|
+
var uncurryThis$2 = functionUncurryThis;
|
|
2344
|
+
var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
|
|
2345
|
+
var toString$1 = toString$3;
|
|
2346
|
+
var requireObjectCoercible$1 = requireObjectCoercible$4;
|
|
2347
|
+
|
|
2348
|
+
var charAt$2 = uncurryThis$2(''.charAt);
|
|
2349
|
+
var charCodeAt = uncurryThis$2(''.charCodeAt);
|
|
2350
|
+
var stringSlice$2 = uncurryThis$2(''.slice);
|
|
2351
|
+
|
|
2352
|
+
var createMethod = function (CONVERT_TO_STRING) {
|
|
2353
|
+
return function ($this, pos) {
|
|
2354
|
+
var S = toString$1(requireObjectCoercible$1($this));
|
|
2355
|
+
var position = toIntegerOrInfinity$1(pos);
|
|
2356
|
+
var size = S.length;
|
|
2357
|
+
var first, second;
|
|
2358
|
+
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
2359
|
+
first = charCodeAt(S, position);
|
|
2360
|
+
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
2361
|
+
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
|
2362
|
+
? CONVERT_TO_STRING
|
|
2363
|
+
? charAt$2(S, position)
|
|
2364
|
+
: first
|
|
2365
|
+
: CONVERT_TO_STRING
|
|
2366
|
+
? stringSlice$2(S, position, position + 2)
|
|
2367
|
+
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
2368
|
+
};
|
|
2369
|
+
};
|
|
2370
|
+
|
|
2371
|
+
var stringMultibyte = {
|
|
2372
|
+
// `String.prototype.codePointAt` method
|
|
2373
|
+
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
2374
|
+
codeAt: createMethod(false),
|
|
2375
|
+
// `String.prototype.at` method
|
|
2376
|
+
// https://github.com/mathiasbynens/String.prototype.at
|
|
2377
|
+
charAt: createMethod(true)
|
|
2378
|
+
};
|
|
2379
|
+
|
|
2380
|
+
var charAt$1 = stringMultibyte.charAt;
|
|
2381
|
+
|
|
2382
|
+
// `AdvanceStringIndex` abstract operation
|
|
2383
|
+
// https://tc39.es/ecma262/#sec-advancestringindex
|
|
2384
|
+
var advanceStringIndex$1 = function (S, index, unicode) {
|
|
2385
|
+
return index + (unicode ? charAt$1(S, index).length : 1);
|
|
2386
|
+
};
|
|
2387
|
+
|
|
2388
|
+
var uncurryThis$1 = functionUncurryThis;
|
|
2389
|
+
var toObject = toObject$5;
|
|
2390
|
+
|
|
2391
|
+
var floor = Math.floor;
|
|
2392
|
+
var charAt = uncurryThis$1(''.charAt);
|
|
2393
|
+
var replace = uncurryThis$1(''.replace);
|
|
2394
|
+
var stringSlice$1 = uncurryThis$1(''.slice);
|
|
2395
|
+
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
2396
|
+
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
2397
|
+
|
|
2398
|
+
// `GetSubstitution` abstract operation
|
|
2399
|
+
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
2400
|
+
var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
|
|
2401
|
+
var tailPos = position + matched.length;
|
|
2402
|
+
var m = captures.length;
|
|
2403
|
+
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
2404
|
+
if (namedCaptures !== undefined) {
|
|
2405
|
+
namedCaptures = toObject(namedCaptures);
|
|
2406
|
+
symbols = SUBSTITUTION_SYMBOLS;
|
|
2407
|
+
}
|
|
2408
|
+
return replace(replacement, symbols, function (match, ch) {
|
|
2409
|
+
var capture;
|
|
2410
|
+
switch (charAt(ch, 0)) {
|
|
2411
|
+
case '$': return '$';
|
|
2412
|
+
case '&': return matched;
|
|
2413
|
+
case '`': return stringSlice$1(str, 0, position);
|
|
2414
|
+
case "'": return stringSlice$1(str, tailPos);
|
|
2415
|
+
case '<':
|
|
2416
|
+
capture = namedCaptures[stringSlice$1(ch, 1, -1)];
|
|
2417
|
+
break;
|
|
2418
|
+
default: // \d\d?
|
|
2419
|
+
var n = +ch;
|
|
2420
|
+
if (n === 0) return match;
|
|
2421
|
+
if (n > m) {
|
|
2422
|
+
var f = floor(n / 10);
|
|
2423
|
+
if (f === 0) return match;
|
|
2424
|
+
if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
|
|
2425
|
+
return match;
|
|
2426
|
+
}
|
|
2427
|
+
capture = captures[n - 1];
|
|
2428
|
+
}
|
|
2429
|
+
return capture === undefined ? '' : capture;
|
|
2430
|
+
});
|
|
2431
|
+
};
|
|
2432
|
+
|
|
2433
|
+
var call$1 = functionCall;
|
|
2434
|
+
var anObject$1 = anObject$8;
|
|
2435
|
+
var isCallable$1 = isCallable$h;
|
|
2436
|
+
var classof = classofRaw$2;
|
|
2437
|
+
var regexpExec = regexpExec$2;
|
|
2438
|
+
|
|
2439
|
+
var $TypeError = TypeError;
|
|
2440
|
+
|
|
2441
|
+
// `RegExpExec` abstract operation
|
|
2442
|
+
// https://tc39.es/ecma262/#sec-regexpexec
|
|
2443
|
+
var regexpExecAbstract = function (R, S) {
|
|
2444
|
+
var exec = R.exec;
|
|
2445
|
+
if (isCallable$1(exec)) {
|
|
2446
|
+
var result = call$1(exec, R, S);
|
|
2447
|
+
if (result !== null) anObject$1(result);
|
|
2448
|
+
return result;
|
|
2449
|
+
}
|
|
2450
|
+
if (classof(R) === 'RegExp') return call$1(regexpExec, R, S);
|
|
2451
|
+
throw $TypeError('RegExp#exec called on incompatible receiver');
|
|
2452
|
+
};
|
|
2453
|
+
|
|
2454
|
+
var apply = functionApply;
|
|
2455
|
+
var call = functionCall;
|
|
2456
|
+
var uncurryThis = functionUncurryThis;
|
|
2457
|
+
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
2458
|
+
var fails = fails$h;
|
|
2459
|
+
var anObject = anObject$8;
|
|
2460
|
+
var isCallable = isCallable$h;
|
|
2461
|
+
var isNullOrUndefined = isNullOrUndefined$3;
|
|
2462
|
+
var toIntegerOrInfinity = toIntegerOrInfinity$4;
|
|
2463
|
+
var toLength = toLength$2;
|
|
2464
|
+
var toString = toString$3;
|
|
2465
|
+
var requireObjectCoercible = requireObjectCoercible$4;
|
|
2466
|
+
var advanceStringIndex = advanceStringIndex$1;
|
|
2467
|
+
var getMethod = getMethod$2;
|
|
2468
|
+
var getSubstitution = getSubstitution$1;
|
|
2469
|
+
var regExpExec = regexpExecAbstract;
|
|
2470
|
+
var wellKnownSymbol = wellKnownSymbol$a;
|
|
2471
|
+
|
|
2472
|
+
var REPLACE = wellKnownSymbol('replace');
|
|
2473
|
+
var max = Math.max;
|
|
2474
|
+
var min = Math.min;
|
|
2475
|
+
var concat = uncurryThis([].concat);
|
|
2476
|
+
var push = uncurryThis([].push);
|
|
2477
|
+
var stringIndexOf = uncurryThis(''.indexOf);
|
|
2478
|
+
var stringSlice = uncurryThis(''.slice);
|
|
2479
|
+
|
|
2480
|
+
var maybeToString = function (it) {
|
|
2481
|
+
return it === undefined ? it : String(it);
|
|
2482
|
+
};
|
|
2483
|
+
|
|
2484
|
+
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
2485
|
+
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
2486
|
+
var REPLACE_KEEPS_$0 = (function () {
|
|
2487
|
+
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
|
2488
|
+
return 'a'.replace(/./, '$0') === '$0';
|
|
2489
|
+
})();
|
|
2490
|
+
|
|
2491
|
+
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
2492
|
+
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
2493
|
+
if (/./[REPLACE]) {
|
|
2494
|
+
return /./[REPLACE]('a', '$0') === '';
|
|
2495
|
+
}
|
|
2496
|
+
return false;
|
|
2497
|
+
})();
|
|
2498
|
+
|
|
2499
|
+
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
|
2500
|
+
var re = /./;
|
|
2501
|
+
re.exec = function () {
|
|
2502
|
+
var result = [];
|
|
2503
|
+
result.groups = { a: '7' };
|
|
2504
|
+
return result;
|
|
2505
|
+
};
|
|
2506
|
+
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
|
|
2507
|
+
return ''.replace(re, '$<a>') !== '7';
|
|
2508
|
+
});
|
|
2509
|
+
|
|
2510
|
+
// @@replace logic
|
|
2511
|
+
fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
|
|
2512
|
+
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
|
2513
|
+
|
|
2514
|
+
return [
|
|
2515
|
+
// `String.prototype.replace` method
|
|
2516
|
+
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
|
2517
|
+
function replace(searchValue, replaceValue) {
|
|
2518
|
+
var O = requireObjectCoercible(this);
|
|
2519
|
+
var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
|
|
2520
|
+
return replacer
|
|
2521
|
+
? call(replacer, searchValue, O, replaceValue)
|
|
2522
|
+
: call(nativeReplace, toString(O), searchValue, replaceValue);
|
|
2523
|
+
},
|
|
2524
|
+
// `RegExp.prototype[@@replace]` method
|
|
2525
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
|
2526
|
+
function (string, replaceValue) {
|
|
2527
|
+
var rx = anObject(this);
|
|
2528
|
+
var S = toString(string);
|
|
2529
|
+
|
|
2530
|
+
if (
|
|
2531
|
+
typeof replaceValue == 'string' &&
|
|
2532
|
+
stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
|
2533
|
+
stringIndexOf(replaceValue, '$<') === -1
|
|
2534
|
+
) {
|
|
2535
|
+
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
|
2536
|
+
if (res.done) return res.value;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
var functionalReplace = isCallable(replaceValue);
|
|
2540
|
+
if (!functionalReplace) replaceValue = toString(replaceValue);
|
|
2541
|
+
|
|
2542
|
+
var global = rx.global;
|
|
2543
|
+
if (global) {
|
|
2544
|
+
var fullUnicode = rx.unicode;
|
|
2545
|
+
rx.lastIndex = 0;
|
|
2546
|
+
}
|
|
2547
|
+
var results = [];
|
|
2548
|
+
while (true) {
|
|
2549
|
+
var result = regExpExec(rx, S);
|
|
2550
|
+
if (result === null) break;
|
|
2551
|
+
|
|
2552
|
+
push(results, result);
|
|
2553
|
+
if (!global) break;
|
|
2554
|
+
|
|
2555
|
+
var matchStr = toString(result[0]);
|
|
2556
|
+
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
var accumulatedResult = '';
|
|
2560
|
+
var nextSourcePosition = 0;
|
|
2561
|
+
for (var i = 0; i < results.length; i++) {
|
|
2562
|
+
result = results[i];
|
|
2563
|
+
|
|
2564
|
+
var matched = toString(result[0]);
|
|
2565
|
+
var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
|
|
2566
|
+
var captures = [];
|
|
2567
|
+
// NOTE: This is equivalent to
|
|
2568
|
+
// captures = result.slice(1).map(maybeToString)
|
|
2569
|
+
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
|
2570
|
+
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
|
2571
|
+
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
|
2572
|
+
for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
|
|
2573
|
+
var namedCaptures = result.groups;
|
|
2574
|
+
if (functionalReplace) {
|
|
2575
|
+
var replacerArgs = concat([matched], captures, position, S);
|
|
2576
|
+
if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
|
|
2577
|
+
var replacement = toString(apply(replaceValue, undefined, replacerArgs));
|
|
2578
|
+
} else {
|
|
2579
|
+
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
2580
|
+
}
|
|
2581
|
+
if (position >= nextSourcePosition) {
|
|
2582
|
+
accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
|
|
2583
|
+
nextSourcePosition = position + matched.length;
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
return accumulatedResult + stringSlice(S, nextSourcePosition);
|
|
2587
|
+
}
|
|
2588
|
+
];
|
|
2589
|
+
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
2590
|
+
|
|
2591
|
+
const MergeTag = ({
|
|
2592
|
+
id
|
|
2593
|
+
}) => {
|
|
2594
|
+
const {
|
|
2595
|
+
loading,
|
|
2596
|
+
profile
|
|
2597
|
+
} = useProfile();
|
|
2598
|
+
if (loading || !profile) {
|
|
2599
|
+
return null;
|
|
2600
|
+
}
|
|
2601
|
+
const value = get__default["default"](profile, id.replace(/_/g, '.'));
|
|
2602
|
+
// DON'T CHANGE
|
|
2603
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
2604
|
+
children: value
|
|
2605
|
+
});
|
|
2606
|
+
};
|
|
2607
|
+
|
|
2608
|
+
const TrackExperience = ({
|
|
2609
|
+
children,
|
|
2610
|
+
experience,
|
|
2611
|
+
variant,
|
|
2612
|
+
profile
|
|
2613
|
+
}) => {
|
|
2614
|
+
const ninetailed = useNinetailed();
|
|
2615
|
+
const {
|
|
2616
|
+
ref,
|
|
2617
|
+
inView
|
|
2618
|
+
} = reactIntersectionObserver.useInView({
|
|
2619
|
+
triggerOnce: true
|
|
2620
|
+
});
|
|
2621
|
+
React.useEffect(() => {
|
|
2622
|
+
if (experience_jsShared.isBrowser() && inView) {
|
|
2623
|
+
const distribution = experience_js.selectDistribution({
|
|
2624
|
+
experience,
|
|
2625
|
+
profile
|
|
2626
|
+
});
|
|
2627
|
+
ninetailed.trackHasSeenExperience({
|
|
2628
|
+
experience: {
|
|
2629
|
+
id: experience.id,
|
|
2630
|
+
type: experience.type,
|
|
2631
|
+
name: '',
|
|
2632
|
+
description: ''
|
|
2633
|
+
},
|
|
2634
|
+
audience: experience.audience,
|
|
2635
|
+
selectedVariant: variant,
|
|
2636
|
+
selectedVariantIndex: distribution.index
|
|
2637
|
+
});
|
|
2638
|
+
}
|
|
2639
|
+
}, [inView]);
|
|
2640
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2641
|
+
children: [jsxRuntime.jsx("div", {
|
|
2642
|
+
ref: ref,
|
|
2643
|
+
id: "nt-experience-handle"
|
|
2644
|
+
}), children]
|
|
2645
|
+
});
|
|
2646
|
+
};
|
|
2647
|
+
|
|
2648
|
+
const useExperimentsContext = () => {
|
|
2649
|
+
const context = React.useContext(ExperimentsContext);
|
|
2650
|
+
if (context === undefined) {
|
|
2651
|
+
throw new Error('The component using the the context must be a descendant of the ExperimentsProvider');
|
|
2652
|
+
}
|
|
2653
|
+
return context;
|
|
2654
|
+
};
|
|
2655
|
+
|
|
2656
|
+
const useExperiments = () => {
|
|
2657
|
+
const context = useExperimentsContext();
|
|
2658
|
+
return {
|
|
2659
|
+
experiments: context.experiments
|
|
2660
|
+
};
|
|
2661
|
+
};
|
|
2662
|
+
|
|
2663
|
+
const useExperience = ({
|
|
2664
|
+
baseline,
|
|
2665
|
+
experiences
|
|
2666
|
+
}) => {
|
|
2667
|
+
const profileState = useProfile();
|
|
2668
|
+
const {
|
|
2669
|
+
experiments
|
|
2670
|
+
} = useExperiments();
|
|
2671
|
+
const hasVariants = experiences.map(experience => experience_js.selectHasExperienceVariants(experience, baseline)).reduce((acc, curr) => acc || curr, false);
|
|
2672
|
+
const {
|
|
2673
|
+
status,
|
|
2674
|
+
profile
|
|
2675
|
+
} = profileState;
|
|
2676
|
+
const baseReturn = Object.assign(Object.assign({}, profileState), {
|
|
2677
|
+
hasVariants,
|
|
2678
|
+
baseline
|
|
2679
|
+
});
|
|
2680
|
+
const emptyReturn = Object.assign(Object.assign({}, baseReturn), {
|
|
2681
|
+
experience: null,
|
|
2682
|
+
variant: null,
|
|
2683
|
+
audience: null,
|
|
2684
|
+
isPersonalized: false,
|
|
2685
|
+
profile: null
|
|
2686
|
+
});
|
|
2687
|
+
if (status === 'loading') {
|
|
2688
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2689
|
+
// @ts-ignore
|
|
2690
|
+
return emptyReturn;
|
|
2691
|
+
}
|
|
2692
|
+
if (status === 'error') {
|
|
2693
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2694
|
+
// @ts-ignore
|
|
2695
|
+
return emptyReturn;
|
|
2696
|
+
}
|
|
2697
|
+
if (!profile) {
|
|
2698
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2699
|
+
// @ts-ignore
|
|
2700
|
+
return emptyReturn;
|
|
2701
|
+
}
|
|
2702
|
+
const activeExperiments = experience_js.selectActiveExperiments(experiments, profile);
|
|
2703
|
+
const experience = experience_js.selectExperience({
|
|
2704
|
+
experiences,
|
|
2705
|
+
activeExperiments,
|
|
2706
|
+
profile
|
|
2707
|
+
});
|
|
2708
|
+
if (!experience) {
|
|
2709
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2710
|
+
// @ts-ignore
|
|
2711
|
+
return emptyReturn;
|
|
2712
|
+
}
|
|
2713
|
+
const audience = experience.audience;
|
|
2714
|
+
const variant = experience_js.selectExperienceVariant({
|
|
2715
|
+
baseline,
|
|
2716
|
+
experience,
|
|
2717
|
+
profile
|
|
2718
|
+
});
|
|
2719
|
+
if (!variant) {
|
|
2720
|
+
return Object.assign(Object.assign({}, baseReturn), {
|
|
2721
|
+
status: 'success',
|
|
2722
|
+
loading: false,
|
|
2723
|
+
error: null,
|
|
2724
|
+
experience,
|
|
2725
|
+
variant: null,
|
|
2726
|
+
audience: audience ? audience : null,
|
|
2727
|
+
profile,
|
|
2728
|
+
isPersonalized: false
|
|
2729
|
+
});
|
|
2730
|
+
}
|
|
2731
|
+
return Object.assign(Object.assign({}, baseReturn), {
|
|
2732
|
+
status: 'success',
|
|
2733
|
+
loading: false,
|
|
2734
|
+
error: null,
|
|
2735
|
+
experience,
|
|
2736
|
+
variant,
|
|
2737
|
+
audience: audience ? audience : null,
|
|
2738
|
+
profile,
|
|
2739
|
+
isPersonalized: true
|
|
2740
|
+
});
|
|
2741
|
+
};
|
|
2742
|
+
|
|
2743
|
+
const useJoinExperiment = () => {
|
|
2744
|
+
const context = useExperimentsContext();
|
|
2745
|
+
return context.joinExperiment;
|
|
2746
|
+
};
|
|
2747
|
+
|
|
2748
|
+
const DefaultExperienceLoadingComponent = _a => {
|
|
2749
|
+
var {
|
|
2750
|
+
component: Component,
|
|
2751
|
+
unhideAfterMs = 5000,
|
|
2752
|
+
passthroughProps
|
|
2753
|
+
} = _a,
|
|
2754
|
+
baseline = __rest(_a, ["component", "unhideAfterMs", "passthroughProps"]);
|
|
2755
|
+
const {
|
|
2756
|
+
logger
|
|
2757
|
+
} = useNinetailed();
|
|
2758
|
+
const [hidden, setHidden] = React.useState(true);
|
|
2759
|
+
React.useEffect(() => {
|
|
2760
|
+
const timer = setTimeout(() => {
|
|
2761
|
+
setHidden(false);
|
|
2762
|
+
logger.error(new Error(`The experience was still in loading state after ${unhideAfterMs}ms. That happens when no events are sent to the Ninetailed API. The baseline is now shown instead.`));
|
|
2763
|
+
}, unhideAfterMs);
|
|
2764
|
+
return () => {
|
|
2765
|
+
clearTimeout(timer);
|
|
2766
|
+
};
|
|
2767
|
+
}, []);
|
|
2768
|
+
if (hidden) {
|
|
2769
|
+
return jsxRuntime.jsx("div", Object.assign({
|
|
2770
|
+
style: {
|
|
2771
|
+
opacity: 0
|
|
2772
|
+
}
|
|
2773
|
+
}, {
|
|
2774
|
+
children: jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
2775
|
+
ninetailed: {
|
|
2776
|
+
isPersonalized: false,
|
|
2777
|
+
audience: {
|
|
2778
|
+
id: 'baseline'
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
}))
|
|
2782
|
+
}), "hide");
|
|
2783
|
+
}
|
|
2784
|
+
return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
2785
|
+
ninetailed: {
|
|
2786
|
+
isPersonalized: false,
|
|
2787
|
+
audience: {
|
|
2788
|
+
id: 'baseline'
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
}));
|
|
2792
|
+
};
|
|
2793
|
+
const Experience = _a => {
|
|
2794
|
+
var {
|
|
2795
|
+
experiences,
|
|
2796
|
+
component: Component,
|
|
2797
|
+
loadingComponent: LoadingComponent = DefaultExperienceLoadingComponent,
|
|
2798
|
+
passthroughProps
|
|
2799
|
+
} = _a,
|
|
2800
|
+
baseline = __rest(_a, ["experiences", "component", "loadingComponent", "passthroughProps"]);
|
|
2801
|
+
const {
|
|
2802
|
+
status,
|
|
2803
|
+
hasVariants,
|
|
2804
|
+
experience,
|
|
2805
|
+
variant,
|
|
2806
|
+
audience,
|
|
2807
|
+
isPersonalized,
|
|
2808
|
+
profile
|
|
2809
|
+
} = useExperience({
|
|
2810
|
+
baseline,
|
|
2811
|
+
experiences
|
|
2812
|
+
});
|
|
2813
|
+
const joinExperiment = useJoinExperiment();
|
|
2814
|
+
React.useEffect(() => {
|
|
2815
|
+
if (status === 'success' && experience && profile) {
|
|
2816
|
+
joinExperiment({
|
|
2817
|
+
experiences,
|
|
2818
|
+
experiment: experience,
|
|
2819
|
+
profile
|
|
2820
|
+
});
|
|
2821
|
+
}
|
|
2822
|
+
}, [status, experience, profile]);
|
|
2823
|
+
if (!hasVariants) {
|
|
2824
|
+
return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline));
|
|
2825
|
+
}
|
|
2826
|
+
if (status === 'loading') {
|
|
2827
|
+
return jsxRuntime.jsx(LoadingComponent, Object.assign({}, baseline, {
|
|
2828
|
+
passthroughProps: passthroughProps,
|
|
2829
|
+
experiences: experiences,
|
|
2830
|
+
component: Component
|
|
2831
|
+
}));
|
|
2832
|
+
}
|
|
2833
|
+
if (!experience) {
|
|
2834
|
+
return /*#__PURE__*/React.createElement(Component, Object.assign({}, passthroughProps, baseline, {
|
|
2835
|
+
key: baseline.id,
|
|
2836
|
+
ninetailed: {
|
|
2837
|
+
isPersonalized: false,
|
|
2838
|
+
audience: {
|
|
2839
|
+
id: 'baseline'
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
}));
|
|
2843
|
+
}
|
|
2844
|
+
if (!variant) {
|
|
2845
|
+
return jsxRuntime.jsx(TrackExperience, Object.assign({
|
|
2846
|
+
experience: experience,
|
|
2847
|
+
variant: baseline,
|
|
2848
|
+
// the profile is definitely defined, otherwise there wouldn't be an experience selected
|
|
2849
|
+
profile: profile
|
|
2850
|
+
}, {
|
|
2851
|
+
children: /*#__PURE__*/React.createElement(Component, Object.assign({}, passthroughProps, baseline, {
|
|
2852
|
+
key: baseline.id,
|
|
2853
|
+
ninetailed: {
|
|
2854
|
+
isPersonalized: false,
|
|
2855
|
+
audience: {
|
|
2856
|
+
id: (audience === null || audience === void 0 ? void 0 : audience.id) || 'all visitors'
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
}))
|
|
2860
|
+
}));
|
|
2861
|
+
}
|
|
2862
|
+
return jsxRuntime.jsx(TrackExperience, Object.assign({
|
|
2863
|
+
experience: experience,
|
|
2864
|
+
variant: variant,
|
|
2865
|
+
// the profile is definitely defined, otherwise there wouldn't be an experience selected
|
|
2866
|
+
profile: profile
|
|
2867
|
+
}, {
|
|
2868
|
+
children: 'hidden' in variant && variant.hidden ? null : /*#__PURE__*/React.createElement(Component, Object.assign({}, Object.assign(Object.assign({}, passthroughProps), variant), {
|
|
2869
|
+
key: `${experience.id}-${variant.id}`,
|
|
2870
|
+
ninetailed: {
|
|
2871
|
+
isPersonalized,
|
|
2872
|
+
audience: {
|
|
2873
|
+
id: (audience === null || audience === void 0 ? void 0 : audience.id) || 'all visitors'
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
}))
|
|
2877
|
+
}));
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2880
|
+
const ESRContext = /*#__PURE__*/React__default["default"].createContext(undefined);
|
|
2881
|
+
const ESRProvider = ({
|
|
2882
|
+
experienceVariantsMap,
|
|
2883
|
+
children
|
|
2884
|
+
}) => {
|
|
2885
|
+
return jsxRuntime.jsx(ESRContext.Provider, Object.assign({
|
|
2886
|
+
value: {
|
|
2887
|
+
experienceVariantsMap
|
|
2888
|
+
}
|
|
2889
|
+
}, {
|
|
2890
|
+
children: children
|
|
2891
|
+
}));
|
|
2892
|
+
};
|
|
2893
|
+
const useESR = () => {
|
|
2894
|
+
const context = React__default["default"].useContext(ESRContext);
|
|
2895
|
+
if (context === undefined) {
|
|
2896
|
+
throw new Error('The component using the the context must be a descendant of the ESRProvider');
|
|
2897
|
+
}
|
|
2898
|
+
return {
|
|
2899
|
+
experienceVariantsMap: context.experienceVariantsMap
|
|
2900
|
+
};
|
|
2901
|
+
};
|
|
2902
|
+
const ESRLoadingComponent = _a => {
|
|
2903
|
+
var {
|
|
2904
|
+
experiences,
|
|
2905
|
+
component: Component,
|
|
2906
|
+
passthroughProps
|
|
2907
|
+
} = _a,
|
|
2908
|
+
baseline = __rest(_a, ["experiences", "component", "passthroughProps"]);
|
|
2909
|
+
const {
|
|
2910
|
+
experienceVariantsMap
|
|
2911
|
+
} = useESR();
|
|
2912
|
+
const experience = experiences.find(experience => has__default["default"](experienceVariantsMap, experience.id));
|
|
2913
|
+
if (!experience) {
|
|
2914
|
+
return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
2915
|
+
ninetailed: {
|
|
2916
|
+
isPersonalized: false,
|
|
2917
|
+
audience: {
|
|
2918
|
+
id: 'baseline'
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
}));
|
|
2922
|
+
}
|
|
2923
|
+
const component = experience.components.find(component => component.baseline.id === baseline.id);
|
|
2924
|
+
if (!component) {
|
|
2925
|
+
return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
2926
|
+
ninetailed: {
|
|
2927
|
+
isPersonalized: false,
|
|
2928
|
+
audience: {
|
|
2929
|
+
id: 'baseline'
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
}));
|
|
2933
|
+
}
|
|
2934
|
+
if (experienceVariantsMap[experience.id] === 0) {
|
|
2935
|
+
return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
2936
|
+
ninetailed: {
|
|
2937
|
+
isPersonalized: false,
|
|
2938
|
+
audience: {
|
|
2939
|
+
id: 'baseline'
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
}));
|
|
2943
|
+
}
|
|
2944
|
+
const variant = component.variants[experienceVariantsMap[experience.id] - 1];
|
|
2945
|
+
if (!variant) {
|
|
2946
|
+
return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, baseline, {
|
|
2947
|
+
ninetailed: {
|
|
2948
|
+
isPersonalized: false,
|
|
2949
|
+
audience: {
|
|
2950
|
+
id: 'baseline'
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
}));
|
|
2954
|
+
}
|
|
2955
|
+
return jsxRuntime.jsx(Component, Object.assign({}, passthroughProps, variant, {
|
|
2956
|
+
ninetailed: {
|
|
2957
|
+
isPersonalized: false,
|
|
2958
|
+
audience: {
|
|
2959
|
+
id: 'baseline'
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2962
|
+
}));
|
|
2963
|
+
};
|
|
2964
|
+
|
|
2965
|
+
exports.DefaultExperienceLoadingComponent = DefaultExperienceLoadingComponent;
|
|
2966
|
+
exports.ESRLoadingComponent = ESRLoadingComponent;
|
|
2967
|
+
exports.ESRProvider = ESRProvider;
|
|
2968
|
+
exports.Experience = Experience;
|
|
2969
|
+
exports.ExperimentsProvider = ExperimentsProvider;
|
|
2970
|
+
exports.MergeTag = MergeTag;
|
|
2971
|
+
exports.NinetailedProvider = NinetailedProvider;
|
|
2972
|
+
exports.Personalize = Personalize;
|
|
2973
|
+
exports.TrackExperience = TrackExperience;
|
|
2974
|
+
exports.TrackHasSeenComponent = TrackHasSeenComponent;
|
|
2975
|
+
exports.useExperience = useExperience;
|
|
2976
|
+
exports.useExperiments = useExperiments;
|
|
2977
|
+
exports.useJoinExperiment = useJoinExperiment;
|
|
2978
|
+
exports.useNinetailed = useNinetailed;
|
|
2979
|
+
exports.usePersonalize = usePersonalize;
|
|
2980
|
+
exports.useProfile = useProfile;
|