@soma-vertical-web/multi-lib 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1,3 +1,3586 @@
1
- var index = {};
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { createContext, useRef, useContext } from 'react';
3
+
4
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
+
6
+ var check = function (it) {
7
+ return it && it.Math === Math && it;
8
+ };
9
+
10
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
11
+ var global$g =
12
+ // eslint-disable-next-line es/no-global-this -- safe
13
+ check(typeof globalThis == 'object' && globalThis) ||
14
+ check(typeof window == 'object' && window) ||
15
+ // eslint-disable-next-line no-restricted-globals -- safe
16
+ check(typeof self == 'object' && self) ||
17
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
18
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
19
+ // eslint-disable-next-line no-new-func -- fallback
20
+ (function () { return this; })() || Function('return this')();
21
+
22
+ var objectGetOwnPropertyDescriptor = {};
23
+
24
+ var fails$l = function (exec) {
25
+ try {
26
+ return !!exec();
27
+ } catch (error) {
28
+ return true;
29
+ }
30
+ };
31
+
32
+ var fails$k = fails$l;
33
+
34
+ // Detect IE8's incomplete defineProperty implementation
35
+ var descriptors = !fails$k(function () {
36
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
37
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
38
+ });
39
+
40
+ var fails$j = fails$l;
41
+
42
+ var functionBindNative = !fails$j(function () {
43
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
44
+ var test = (function () { /* empty */ }).bind();
45
+ // eslint-disable-next-line no-prototype-builtins -- safe
46
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
47
+ });
48
+
49
+ var NATIVE_BIND$2 = functionBindNative;
50
+
51
+ var call$c = Function.prototype.call;
52
+
53
+ var functionCall = NATIVE_BIND$2 ? call$c.bind(call$c) : function () {
54
+ return call$c.apply(call$c, arguments);
55
+ };
56
+
57
+ var objectPropertyIsEnumerable = {};
58
+
59
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
60
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
61
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
62
+
63
+ // Nashorn ~ JDK8 bug
64
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
65
+
66
+ // `Object.prototype.propertyIsEnumerable` method implementation
67
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
68
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
69
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
70
+ return !!descriptor && descriptor.enumerable;
71
+ } : $propertyIsEnumerable;
72
+
73
+ var createPropertyDescriptor$3 = function (bitmap, value) {
74
+ return {
75
+ enumerable: !(bitmap & 1),
76
+ configurable: !(bitmap & 2),
77
+ writable: !(bitmap & 4),
78
+ value: value
79
+ };
80
+ };
81
+
82
+ var NATIVE_BIND$1 = functionBindNative;
83
+
84
+ var FunctionPrototype$2 = Function.prototype;
85
+ var call$b = FunctionPrototype$2.call;
86
+ var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$2.bind.bind(call$b, call$b);
87
+
88
+ var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
89
+ return function () {
90
+ return call$b.apply(fn, arguments);
91
+ };
92
+ };
93
+
94
+ var uncurryThis$k = functionUncurryThis;
95
+
96
+ var toString$9 = uncurryThis$k({}.toString);
97
+ var stringSlice$6 = uncurryThis$k(''.slice);
98
+
99
+ var classofRaw$2 = function (it) {
100
+ return stringSlice$6(toString$9(it), 8, -1);
101
+ };
102
+
103
+ var uncurryThis$j = functionUncurryThis;
104
+ var fails$i = fails$l;
105
+ var classof$5 = classofRaw$2;
106
+
107
+ var $Object$4 = Object;
108
+ var split = uncurryThis$j(''.split);
109
+
110
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
111
+ var indexedObject = fails$i(function () {
112
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
113
+ // eslint-disable-next-line no-prototype-builtins -- safe
114
+ return !$Object$4('z').propertyIsEnumerable(0);
115
+ }) ? function (it) {
116
+ return classof$5(it) === 'String' ? split(it, '') : $Object$4(it);
117
+ } : $Object$4;
118
+
119
+ // we can't use just `it == null` since of `document.all` special case
120
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
121
+ var isNullOrUndefined$4 = function (it) {
122
+ return it === null || it === undefined;
123
+ };
124
+
125
+ var isNullOrUndefined$3 = isNullOrUndefined$4;
126
+
127
+ var $TypeError$9 = TypeError;
128
+
129
+ // `RequireObjectCoercible` abstract operation
130
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
131
+ var requireObjectCoercible$8 = function (it) {
132
+ if (isNullOrUndefined$3(it)) throw new $TypeError$9("Can't call method on " + it);
133
+ return it;
134
+ };
135
+
136
+ // toObject with fallback for non-array-like ES3 strings
137
+ var IndexedObject$2 = indexedObject;
138
+ var requireObjectCoercible$7 = requireObjectCoercible$8;
139
+
140
+ var toIndexedObject$5 = function (it) {
141
+ return IndexedObject$2(requireObjectCoercible$7(it));
142
+ };
143
+
144
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
145
+ var documentAll = typeof document == 'object' && document.all;
146
+
147
+ // `IsCallable` abstract operation
148
+ // https://tc39.es/ecma262/#sec-iscallable
149
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
150
+ var isCallable$g = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
151
+ return typeof argument == 'function' || argument === documentAll;
152
+ } : function (argument) {
153
+ return typeof argument == 'function';
154
+ };
155
+
156
+ var isCallable$f = isCallable$g;
157
+
158
+ var isObject$8 = function (it) {
159
+ return typeof it == 'object' ? it !== null : isCallable$f(it);
160
+ };
161
+
162
+ var global$f = global$g;
163
+ var isCallable$e = isCallable$g;
164
+
165
+ var aFunction = function (argument) {
166
+ return isCallable$e(argument) ? argument : undefined;
167
+ };
168
+
169
+ var getBuiltIn$3 = function (namespace, method) {
170
+ return arguments.length < 2 ? aFunction(global$f[namespace]) : global$f[namespace] && global$f[namespace][method];
171
+ };
172
+
173
+ var uncurryThis$i = functionUncurryThis;
174
+
175
+ var objectIsPrototypeOf = uncurryThis$i({}.isPrototypeOf);
176
+
177
+ var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
178
+
179
+ var global$e = global$g;
180
+ var userAgent = engineUserAgent;
181
+
182
+ var process = global$e.process;
183
+ var Deno = global$e.Deno;
184
+ var versions = process && process.versions || Deno && Deno.version;
185
+ var v8 = versions && versions.v8;
186
+ var match, version;
187
+
188
+ if (v8) {
189
+ match = v8.split('.');
190
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
191
+ // but their correct versions are not interesting for us
192
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
193
+ }
194
+
195
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
196
+ // so check `userAgent` even if `.v8` exists, but 0
197
+ if (!version && userAgent) {
198
+ match = userAgent.match(/Edge\/(\d+)/);
199
+ if (!match || match[1] >= 74) {
200
+ match = userAgent.match(/Chrome\/(\d+)/);
201
+ if (match) version = +match[1];
202
+ }
203
+ }
204
+
205
+ var engineV8Version = version;
206
+
207
+ /* eslint-disable es/no-symbol -- required for testing */
208
+ var V8_VERSION = engineV8Version;
209
+ var fails$h = fails$l;
210
+ var global$d = global$g;
211
+
212
+ var $String$6 = global$d.String;
213
+
214
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
215
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$h(function () {
216
+ var symbol = Symbol('symbol detection');
217
+ // Chrome 38 Symbol has incorrect toString conversion
218
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
219
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
220
+ // of course, fail.
221
+ return !$String$6(symbol) || !(Object(symbol) instanceof Symbol) ||
222
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
223
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
224
+ });
225
+
226
+ /* eslint-disable es/no-symbol -- required for testing */
227
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
228
+
229
+ var useSymbolAsUid = NATIVE_SYMBOL$1
230
+ && !Symbol.sham
231
+ && typeof Symbol.iterator == 'symbol';
232
+
233
+ var getBuiltIn$2 = getBuiltIn$3;
234
+ var isCallable$d = isCallable$g;
235
+ var isPrototypeOf$1 = objectIsPrototypeOf;
236
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
237
+
238
+ var $Object$3 = Object;
239
+
240
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
241
+ return typeof it == 'symbol';
242
+ } : function (it) {
243
+ var $Symbol = getBuiltIn$2('Symbol');
244
+ return isCallable$d($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$3(it));
245
+ };
246
+
247
+ var $String$5 = String;
248
+
249
+ var tryToString$1 = function (argument) {
250
+ try {
251
+ return $String$5(argument);
252
+ } catch (error) {
253
+ return 'Object';
254
+ }
255
+ };
256
+
257
+ var isCallable$c = isCallable$g;
258
+ var tryToString = tryToString$1;
259
+
260
+ var $TypeError$8 = TypeError;
261
+
262
+ // `Assert: IsCallable(argument) is true`
263
+ var aCallable$3 = function (argument) {
264
+ if (isCallable$c(argument)) return argument;
265
+ throw new $TypeError$8(tryToString(argument) + ' is not a function');
266
+ };
267
+
268
+ var aCallable$2 = aCallable$3;
269
+ var isNullOrUndefined$2 = isNullOrUndefined$4;
270
+
271
+ // `GetMethod` abstract operation
272
+ // https://tc39.es/ecma262/#sec-getmethod
273
+ var getMethod$3 = function (V, P) {
274
+ var func = V[P];
275
+ return isNullOrUndefined$2(func) ? undefined : aCallable$2(func);
276
+ };
277
+
278
+ var call$a = functionCall;
279
+ var isCallable$b = isCallable$g;
280
+ var isObject$7 = isObject$8;
281
+
282
+ var $TypeError$7 = TypeError;
283
+
284
+ // `OrdinaryToPrimitive` abstract operation
285
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
286
+ var ordinaryToPrimitive$1 = function (input, pref) {
287
+ var fn, val;
288
+ if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$a(fn, input))) return val;
289
+ if (isCallable$b(fn = input.valueOf) && !isObject$7(val = call$a(fn, input))) return val;
290
+ if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$a(fn, input))) return val;
291
+ throw new $TypeError$7("Can't convert object to primitive value");
292
+ };
293
+
294
+ var shared$4 = {exports: {}};
295
+
296
+ var global$c = global$g;
297
+
298
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
299
+ var defineProperty$5 = Object.defineProperty;
300
+
301
+ var defineGlobalProperty$3 = function (key, value) {
302
+ try {
303
+ defineProperty$5(global$c, key, { value: value, configurable: true, writable: true });
304
+ } catch (error) {
305
+ global$c[key] = value;
306
+ } return value;
307
+ };
308
+
309
+ var global$b = global$g;
310
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
311
+
312
+ var SHARED = '__core-js_shared__';
313
+ var store$3 = global$b[SHARED] || defineGlobalProperty$2(SHARED, {});
314
+
315
+ var sharedStore = store$3;
316
+
317
+ var store$2 = sharedStore;
318
+
319
+ (shared$4.exports = function (key, value) {
320
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
321
+ })('versions', []).push({
322
+ version: '3.35.0',
323
+ mode: 'global',
324
+ copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
325
+ license: 'https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE',
326
+ source: 'https://github.com/zloirock/core-js'
327
+ });
328
+
329
+ var requireObjectCoercible$6 = requireObjectCoercible$8;
330
+
331
+ var $Object$2 = Object;
332
+
333
+ // `ToObject` abstract operation
334
+ // https://tc39.es/ecma262/#sec-toobject
335
+ var toObject$5 = function (argument) {
336
+ return $Object$2(requireObjectCoercible$6(argument));
337
+ };
338
+
339
+ var uncurryThis$h = functionUncurryThis;
340
+ var toObject$4 = toObject$5;
341
+
342
+ var hasOwnProperty = uncurryThis$h({}.hasOwnProperty);
343
+
344
+ // `HasOwnProperty` abstract operation
345
+ // https://tc39.es/ecma262/#sec-hasownproperty
346
+ // eslint-disable-next-line es/no-object-hasown -- safe
347
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
348
+ return hasOwnProperty(toObject$4(it), key);
349
+ };
350
+
351
+ var uncurryThis$g = functionUncurryThis;
352
+
353
+ var id = 0;
354
+ var postfix = Math.random();
355
+ var toString$8 = uncurryThis$g(1.0.toString);
356
+
357
+ var uid$2 = function (key) {
358
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id + postfix, 36);
359
+ };
360
+
361
+ var global$a = global$g;
362
+ var shared$3 = shared$4.exports;
363
+ var hasOwn$9 = hasOwnProperty_1;
364
+ var uid$1 = uid$2;
365
+ var NATIVE_SYMBOL = symbolConstructorDetection;
366
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
367
+
368
+ var Symbol$1 = global$a.Symbol;
369
+ var WellKnownSymbolsStore = shared$3('wks');
370
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
371
+
372
+ var wellKnownSymbol$c = function (name) {
373
+ if (!hasOwn$9(WellKnownSymbolsStore, name)) {
374
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$9(Symbol$1, name)
375
+ ? Symbol$1[name]
376
+ : createWellKnownSymbol('Symbol.' + name);
377
+ } return WellKnownSymbolsStore[name];
378
+ };
379
+
380
+ var call$9 = functionCall;
381
+ var isObject$6 = isObject$8;
382
+ var isSymbol$1 = isSymbol$2;
383
+ var getMethod$2 = getMethod$3;
384
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
385
+ var wellKnownSymbol$b = wellKnownSymbol$c;
386
+
387
+ var $TypeError$6 = TypeError;
388
+ var TO_PRIMITIVE = wellKnownSymbol$b('toPrimitive');
389
+
390
+ // `ToPrimitive` abstract operation
391
+ // https://tc39.es/ecma262/#sec-toprimitive
392
+ var toPrimitive$1 = function (input, pref) {
393
+ if (!isObject$6(input) || isSymbol$1(input)) return input;
394
+ var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
395
+ var result;
396
+ if (exoticToPrim) {
397
+ if (pref === undefined) pref = 'default';
398
+ result = call$9(exoticToPrim, input, pref);
399
+ if (!isObject$6(result) || isSymbol$1(result)) return result;
400
+ throw new $TypeError$6("Can't convert object to primitive value");
401
+ }
402
+ if (pref === undefined) pref = 'number';
403
+ return ordinaryToPrimitive(input, pref);
404
+ };
405
+
406
+ var toPrimitive = toPrimitive$1;
407
+ var isSymbol = isSymbol$2;
408
+
409
+ // `ToPropertyKey` abstract operation
410
+ // https://tc39.es/ecma262/#sec-topropertykey
411
+ var toPropertyKey$2 = function (argument) {
412
+ var key = toPrimitive(argument, 'string');
413
+ return isSymbol(key) ? key : key + '';
414
+ };
415
+
416
+ var global$9 = global$g;
417
+ var isObject$5 = isObject$8;
418
+
419
+ var document$1 = global$9.document;
420
+ // typeof document.createElement is 'object' in old IE
421
+ var EXISTS$1 = isObject$5(document$1) && isObject$5(document$1.createElement);
422
+
423
+ var documentCreateElement$2 = function (it) {
424
+ return EXISTS$1 ? document$1.createElement(it) : {};
425
+ };
426
+
427
+ var DESCRIPTORS$9 = descriptors;
428
+ var fails$g = fails$l;
429
+ var createElement = documentCreateElement$2;
430
+
431
+ // Thanks to IE8 for its funny defineProperty
432
+ var ie8DomDefine = !DESCRIPTORS$9 && !fails$g(function () {
433
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
434
+ return Object.defineProperty(createElement('div'), 'a', {
435
+ get: function () { return 7; }
436
+ }).a !== 7;
437
+ });
438
+
439
+ var DESCRIPTORS$8 = descriptors;
440
+ var call$8 = functionCall;
441
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
442
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
443
+ var toIndexedObject$4 = toIndexedObject$5;
444
+ var toPropertyKey$1 = toPropertyKey$2;
445
+ var hasOwn$8 = hasOwnProperty_1;
446
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
447
+
448
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
449
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
450
+
451
+ // `Object.getOwnPropertyDescriptor` method
452
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
453
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
454
+ O = toIndexedObject$4(O);
455
+ P = toPropertyKey$1(P);
456
+ if (IE8_DOM_DEFINE$1) try {
457
+ return $getOwnPropertyDescriptor$1(O, P);
458
+ } catch (error) { /* empty */ }
459
+ if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$8(propertyIsEnumerableModule$1.f, O, P), O[P]);
460
+ };
461
+
462
+ var objectDefineProperty = {};
463
+
464
+ var DESCRIPTORS$7 = descriptors;
465
+ var fails$f = fails$l;
466
+
467
+ // V8 ~ Chrome 36-
468
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
469
+ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$f(function () {
470
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
471
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
472
+ value: 42,
473
+ writable: false
474
+ }).prototype !== 42;
475
+ });
476
+
477
+ var isObject$4 = isObject$8;
478
+
479
+ var $String$4 = String;
480
+ var $TypeError$5 = TypeError;
481
+
482
+ // `Assert: Type(argument) is Object`
483
+ var anObject$a = function (argument) {
484
+ if (isObject$4(argument)) return argument;
485
+ throw new $TypeError$5($String$4(argument) + ' is not an object');
486
+ };
487
+
488
+ var DESCRIPTORS$6 = descriptors;
489
+ var IE8_DOM_DEFINE = ie8DomDefine;
490
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
491
+ var anObject$9 = anObject$a;
492
+ var toPropertyKey = toPropertyKey$2;
493
+
494
+ var $TypeError$4 = TypeError;
495
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
496
+ var $defineProperty = Object.defineProperty;
497
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
498
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
499
+ var ENUMERABLE = 'enumerable';
500
+ var CONFIGURABLE$1 = 'configurable';
501
+ var WRITABLE = 'writable';
502
+
503
+ // `Object.defineProperty` method
504
+ // https://tc39.es/ecma262/#sec-object.defineproperty
505
+ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
506
+ anObject$9(O);
507
+ P = toPropertyKey(P);
508
+ anObject$9(Attributes);
509
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
510
+ var current = $getOwnPropertyDescriptor(O, P);
511
+ if (current && current[WRITABLE]) {
512
+ O[P] = Attributes.value;
513
+ Attributes = {
514
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
515
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
516
+ writable: false
517
+ };
518
+ }
519
+ } return $defineProperty(O, P, Attributes);
520
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
521
+ anObject$9(O);
522
+ P = toPropertyKey(P);
523
+ anObject$9(Attributes);
524
+ if (IE8_DOM_DEFINE) try {
525
+ return $defineProperty(O, P, Attributes);
526
+ } catch (error) { /* empty */ }
527
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$4('Accessors not supported');
528
+ if ('value' in Attributes) O[P] = Attributes.value;
529
+ return O;
530
+ };
531
+
532
+ var DESCRIPTORS$5 = descriptors;
533
+ var definePropertyModule$3 = objectDefineProperty;
534
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
535
+
536
+ var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
537
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
538
+ } : function (object, key, value) {
539
+ object[key] = value;
540
+ return object;
541
+ };
542
+
543
+ var makeBuiltIn$2 = {exports: {}};
544
+
545
+ var DESCRIPTORS$4 = descriptors;
546
+ var hasOwn$7 = hasOwnProperty_1;
547
+
548
+ var FunctionPrototype$1 = Function.prototype;
549
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
550
+ var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
551
+
552
+ var EXISTS = hasOwn$7(FunctionPrototype$1, 'name');
553
+ // additional protection from minified / mangled / dropped function names
554
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
555
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, 'name').configurable));
556
+
557
+ var functionName = {
558
+ EXISTS: EXISTS,
559
+ PROPER: PROPER,
560
+ CONFIGURABLE: CONFIGURABLE
561
+ };
562
+
563
+ var uncurryThis$f = functionUncurryThis;
564
+ var isCallable$a = isCallable$g;
565
+ var store$1 = sharedStore;
566
+
567
+ var functionToString = uncurryThis$f(Function.toString);
568
+
569
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
570
+ if (!isCallable$a(store$1.inspectSource)) {
571
+ store$1.inspectSource = function (it) {
572
+ return functionToString(it);
573
+ };
574
+ }
575
+
576
+ var inspectSource$1 = store$1.inspectSource;
577
+
578
+ var global$8 = global$g;
579
+ var isCallable$9 = isCallable$g;
580
+
581
+ var WeakMap$1 = global$8.WeakMap;
582
+
583
+ var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
584
+
585
+ var shared$2 = shared$4.exports;
586
+ var uid = uid$2;
587
+
588
+ var keys = shared$2('keys');
589
+
590
+ var sharedKey$3 = function (key) {
591
+ return keys[key] || (keys[key] = uid(key));
592
+ };
593
+
594
+ var hiddenKeys$4 = {};
595
+
596
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
597
+ var global$7 = global$g;
598
+ var isObject$3 = isObject$8;
599
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
600
+ var hasOwn$6 = hasOwnProperty_1;
601
+ var shared$1 = sharedStore;
602
+ var sharedKey$2 = sharedKey$3;
603
+ var hiddenKeys$3 = hiddenKeys$4;
604
+
605
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
606
+ var TypeError$1 = global$7.TypeError;
607
+ var WeakMap = global$7.WeakMap;
608
+ var set, get, has;
609
+
610
+ var enforce = function (it) {
611
+ return has(it) ? get(it) : set(it, {});
612
+ };
613
+
614
+ var getterFor = function (TYPE) {
615
+ return function (it) {
616
+ var state;
617
+ if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
618
+ throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
619
+ } return state;
620
+ };
621
+ };
622
+
623
+ if (NATIVE_WEAK_MAP || shared$1.state) {
624
+ var store = shared$1.state || (shared$1.state = new WeakMap());
625
+ /* eslint-disable no-self-assign -- prototype methods protection */
626
+ store.get = store.get;
627
+ store.has = store.has;
628
+ store.set = store.set;
629
+ /* eslint-enable no-self-assign -- prototype methods protection */
630
+ set = function (it, metadata) {
631
+ if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
632
+ metadata.facade = it;
633
+ store.set(it, metadata);
634
+ return metadata;
635
+ };
636
+ get = function (it) {
637
+ return store.get(it) || {};
638
+ };
639
+ has = function (it) {
640
+ return store.has(it);
641
+ };
642
+ } else {
643
+ var STATE = sharedKey$2('state');
644
+ hiddenKeys$3[STATE] = true;
645
+ set = function (it, metadata) {
646
+ if (hasOwn$6(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
647
+ metadata.facade = it;
648
+ createNonEnumerableProperty$4(it, STATE, metadata);
649
+ return metadata;
650
+ };
651
+ get = function (it) {
652
+ return hasOwn$6(it, STATE) ? it[STATE] : {};
653
+ };
654
+ has = function (it) {
655
+ return hasOwn$6(it, STATE);
656
+ };
657
+ }
658
+
659
+ var internalState = {
660
+ set: set,
661
+ get: get,
662
+ has: has,
663
+ enforce: enforce,
664
+ getterFor: getterFor
665
+ };
666
+
667
+ var uncurryThis$e = functionUncurryThis;
668
+ var fails$e = fails$l;
669
+ var isCallable$8 = isCallable$g;
670
+ var hasOwn$5 = hasOwnProperty_1;
671
+ var DESCRIPTORS$3 = descriptors;
672
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
673
+ var inspectSource = inspectSource$1;
674
+ var InternalStateModule$1 = internalState;
675
+
676
+ var enforceInternalState = InternalStateModule$1.enforce;
677
+ var getInternalState$2 = InternalStateModule$1.get;
678
+ var $String$3 = String;
679
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
680
+ var defineProperty$4 = Object.defineProperty;
681
+ var stringSlice$5 = uncurryThis$e(''.slice);
682
+ var replace$3 = uncurryThis$e(''.replace);
683
+ var join = uncurryThis$e([].join);
684
+
685
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$e(function () {
686
+ return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
687
+ });
688
+
689
+ var TEMPLATE = String(String).split('String');
690
+
691
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
692
+ if (stringSlice$5($String$3(name), 0, 7) === 'Symbol(') {
693
+ name = '[' + replace$3($String$3(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
694
+ }
695
+ if (options && options.getter) name = 'get ' + name;
696
+ if (options && options.setter) name = 'set ' + name;
697
+ if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
698
+ if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
699
+ else value.name = name;
700
+ }
701
+ if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
702
+ defineProperty$4(value, 'length', { value: options.arity });
703
+ }
704
+ try {
705
+ if (options && hasOwn$5(options, 'constructor') && options.constructor) {
706
+ if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
707
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
708
+ } else if (value.prototype) value.prototype = undefined;
709
+ } catch (error) { /* empty */ }
710
+ var state = enforceInternalState(value);
711
+ if (!hasOwn$5(state, 'source')) {
712
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
713
+ } return value;
714
+ };
715
+
716
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
717
+ // eslint-disable-next-line no-extend-native -- required
718
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
719
+ return isCallable$8(this) && getInternalState$2(this).source || inspectSource(this);
720
+ }, 'toString');
721
+
722
+ var isCallable$7 = isCallable$g;
723
+ var definePropertyModule$2 = objectDefineProperty;
724
+ var makeBuiltIn = makeBuiltIn$2.exports;
725
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
726
+
727
+ var defineBuiltIn$5 = function (O, key, value, options) {
728
+ if (!options) options = {};
729
+ var simple = options.enumerable;
730
+ var name = options.name !== undefined ? options.name : key;
731
+ if (isCallable$7(value)) makeBuiltIn(value, name, options);
732
+ if (options.global) {
733
+ if (simple) O[key] = value;
734
+ else defineGlobalProperty$1(key, value);
735
+ } else {
736
+ try {
737
+ if (!options.unsafe) delete O[key];
738
+ else if (O[key]) simple = true;
739
+ } catch (error) { /* empty */ }
740
+ if (simple) O[key] = value;
741
+ else definePropertyModule$2.f(O, key, {
742
+ value: value,
743
+ enumerable: false,
744
+ configurable: !options.nonConfigurable,
745
+ writable: !options.nonWritable
746
+ });
747
+ } return O;
748
+ };
749
+
750
+ var objectGetOwnPropertyNames = {};
751
+
752
+ var ceil = Math.ceil;
753
+ var floor$2 = Math.floor;
754
+
755
+ // `Math.trunc` method
756
+ // https://tc39.es/ecma262/#sec-math.trunc
757
+ // eslint-disable-next-line es/no-math-trunc -- safe
758
+ var mathTrunc = Math.trunc || function trunc(x) {
759
+ var n = +x;
760
+ return (n > 0 ? floor$2 : ceil)(n);
761
+ };
762
+
763
+ var trunc = mathTrunc;
764
+
765
+ // `ToIntegerOrInfinity` abstract operation
766
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
767
+ var toIntegerOrInfinity$6 = function (argument) {
768
+ var number = +argument;
769
+ // eslint-disable-next-line no-self-compare -- NaN check
770
+ return number !== number || number === 0 ? 0 : trunc(number);
771
+ };
772
+
773
+ var toIntegerOrInfinity$5 = toIntegerOrInfinity$6;
774
+
775
+ var max$1 = Math.max;
776
+ var min$2 = Math.min;
777
+
778
+ // Helper for a popular repeating case of the spec:
779
+ // Let integer be ? ToInteger(index).
780
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
781
+ var toAbsoluteIndex$1 = function (index, length) {
782
+ var integer = toIntegerOrInfinity$5(index);
783
+ return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length);
784
+ };
785
+
786
+ var toIntegerOrInfinity$4 = toIntegerOrInfinity$6;
787
+
788
+ var min$1 = Math.min;
789
+
790
+ // `ToLength` abstract operation
791
+ // https://tc39.es/ecma262/#sec-tolength
792
+ var toLength$3 = function (argument) {
793
+ return argument > 0 ? min$1(toIntegerOrInfinity$4(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
794
+ };
795
+
796
+ var toLength$2 = toLength$3;
797
+
798
+ // `LengthOfArrayLike` abstract operation
799
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
800
+ var lengthOfArrayLike$2 = function (obj) {
801
+ return toLength$2(obj.length);
802
+ };
803
+
804
+ var toIndexedObject$3 = toIndexedObject$5;
805
+ var toAbsoluteIndex = toAbsoluteIndex$1;
806
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
807
+
808
+ // `Array.prototype.{ indexOf, includes }` methods implementation
809
+ var createMethod$3 = function (IS_INCLUDES) {
810
+ return function ($this, el, fromIndex) {
811
+ var O = toIndexedObject$3($this);
812
+ var length = lengthOfArrayLike$1(O);
813
+ var index = toAbsoluteIndex(fromIndex, length);
814
+ var value;
815
+ // Array#includes uses SameValueZero equality algorithm
816
+ // eslint-disable-next-line no-self-compare -- NaN check
817
+ if (IS_INCLUDES && el !== el) while (length > index) {
818
+ value = O[index++];
819
+ // eslint-disable-next-line no-self-compare -- NaN check
820
+ if (value !== value) return true;
821
+ // Array#indexOf ignores holes, Array#includes - not
822
+ } else for (;length > index; index++) {
823
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
824
+ } return !IS_INCLUDES && -1;
825
+ };
826
+ };
827
+
828
+ var arrayIncludes = {
829
+ // `Array.prototype.includes` method
830
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
831
+ includes: createMethod$3(true),
832
+ // `Array.prototype.indexOf` method
833
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
834
+ indexOf: createMethod$3(false)
835
+ };
836
+
837
+ var uncurryThis$d = functionUncurryThis;
838
+ var hasOwn$4 = hasOwnProperty_1;
839
+ var toIndexedObject$2 = toIndexedObject$5;
840
+ var indexOf$1 = arrayIncludes.indexOf;
841
+ var hiddenKeys$2 = hiddenKeys$4;
842
+
843
+ var push$1 = uncurryThis$d([].push);
844
+
845
+ var objectKeysInternal = function (object, names) {
846
+ var O = toIndexedObject$2(object);
847
+ var i = 0;
848
+ var result = [];
849
+ var key;
850
+ for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push$1(result, key);
851
+ // Don't enum bug & hidden keys
852
+ while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
853
+ ~indexOf$1(result, key) || push$1(result, key);
854
+ }
855
+ return result;
856
+ };
857
+
858
+ // IE8- don't enum bug keys
859
+ var enumBugKeys$3 = [
860
+ 'constructor',
861
+ 'hasOwnProperty',
862
+ 'isPrototypeOf',
863
+ 'propertyIsEnumerable',
864
+ 'toLocaleString',
865
+ 'toString',
866
+ 'valueOf'
867
+ ];
868
+
869
+ var internalObjectKeys$1 = objectKeysInternal;
870
+ var enumBugKeys$2 = enumBugKeys$3;
871
+
872
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
873
+
874
+ // `Object.getOwnPropertyNames` method
875
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
876
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
877
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
878
+ return internalObjectKeys$1(O, hiddenKeys$1);
879
+ };
880
+
881
+ var objectGetOwnPropertySymbols = {};
882
+
883
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
884
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
885
+
886
+ var getBuiltIn$1 = getBuiltIn$3;
887
+ var uncurryThis$c = functionUncurryThis;
888
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
889
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
890
+ var anObject$8 = anObject$a;
891
+
892
+ var concat$2 = uncurryThis$c([].concat);
893
+
894
+ // all object keys, includes non-enumerable and symbols
895
+ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
896
+ var keys = getOwnPropertyNamesModule.f(anObject$8(it));
897
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
898
+ return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
899
+ };
900
+
901
+ var hasOwn$3 = hasOwnProperty_1;
902
+ var ownKeys = ownKeys$1;
903
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
904
+ var definePropertyModule$1 = objectDefineProperty;
905
+
906
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
907
+ var keys = ownKeys(source);
908
+ var defineProperty = definePropertyModule$1.f;
909
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
910
+ for (var i = 0; i < keys.length; i++) {
911
+ var key = keys[i];
912
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
913
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
914
+ }
915
+ }
916
+ };
917
+
918
+ var fails$d = fails$l;
919
+ var isCallable$6 = isCallable$g;
920
+
921
+ var replacement = /#|\.prototype\./;
922
+
923
+ var isForced$1 = function (feature, detection) {
924
+ var value = data$1[normalize(feature)];
925
+ return value === POLYFILL ? true
926
+ : value === NATIVE ? false
927
+ : isCallable$6(detection) ? fails$d(detection)
928
+ : !!detection;
929
+ };
930
+
931
+ var normalize = isForced$1.normalize = function (string) {
932
+ return String(string).replace(replacement, '.').toLowerCase();
933
+ };
934
+
935
+ var data$1 = isForced$1.data = {};
936
+ var NATIVE = isForced$1.NATIVE = 'N';
937
+ var POLYFILL = isForced$1.POLYFILL = 'P';
938
+
939
+ var isForced_1 = isForced$1;
940
+
941
+ var global$6 = global$g;
942
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
943
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
944
+ var defineBuiltIn$4 = defineBuiltIn$5;
945
+ var defineGlobalProperty = defineGlobalProperty$3;
946
+ var copyConstructorProperties = copyConstructorProperties$1;
947
+ var isForced = isForced_1;
948
+
949
+ /*
950
+ options.target - name of the target object
951
+ options.global - target is the global object
952
+ options.stat - export as static methods of target
953
+ options.proto - export as prototype methods of target
954
+ options.real - real prototype method for the `pure` version
955
+ options.forced - export even if the native feature is available
956
+ options.bind - bind methods to the target, required for the `pure` version
957
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
958
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
959
+ options.sham - add a flag to not completely full polyfills
960
+ options.enumerable - export as enumerable property
961
+ options.dontCallGetSet - prevent calling a getter on target
962
+ options.name - the .name of the function if it does not match the key
963
+ */
964
+ var _export = function (options, source) {
965
+ var TARGET = options.target;
966
+ var GLOBAL = options.global;
967
+ var STATIC = options.stat;
968
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
969
+ if (GLOBAL) {
970
+ target = global$6;
971
+ } else if (STATIC) {
972
+ target = global$6[TARGET] || defineGlobalProperty(TARGET, {});
973
+ } else {
974
+ target = (global$6[TARGET] || {}).prototype;
975
+ }
976
+ if (target) for (key in source) {
977
+ sourceProperty = source[key];
978
+ if (options.dontCallGetSet) {
979
+ descriptor = getOwnPropertyDescriptor(target, key);
980
+ targetProperty = descriptor && descriptor.value;
981
+ } else targetProperty = target[key];
982
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
983
+ // contained in target
984
+ if (!FORCED && targetProperty !== undefined) {
985
+ if (typeof sourceProperty == typeof targetProperty) continue;
986
+ copyConstructorProperties(sourceProperty, targetProperty);
987
+ }
988
+ // add a flag to not completely full polyfills
989
+ if (options.sham || (targetProperty && targetProperty.sham)) {
990
+ createNonEnumerableProperty$3(sourceProperty, 'sham', true);
991
+ }
992
+ defineBuiltIn$4(target, key, sourceProperty, options);
993
+ }
994
+ };
995
+
996
+ var wellKnownSymbol$a = wellKnownSymbol$c;
997
+
998
+ var TO_STRING_TAG$2 = wellKnownSymbol$a('toStringTag');
999
+ var test = {};
1000
+
1001
+ test[TO_STRING_TAG$2] = 'z';
1002
+
1003
+ var toStringTagSupport = String(test) === '[object z]';
1004
+
1005
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1006
+ var isCallable$5 = isCallable$g;
1007
+ var classofRaw$1 = classofRaw$2;
1008
+ var wellKnownSymbol$9 = wellKnownSymbol$c;
1009
+
1010
+ var TO_STRING_TAG$1 = wellKnownSymbol$9('toStringTag');
1011
+ var $Object$1 = Object;
1012
+
1013
+ // ES3 wrong here
1014
+ var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
1015
+
1016
+ // fallback for IE11 Script Access Denied error
1017
+ var tryGet = function (it, key) {
1018
+ try {
1019
+ return it[key];
1020
+ } catch (error) { /* empty */ }
1021
+ };
1022
+
1023
+ // getting tag from ES6+ `Object.prototype.toString`
1024
+ var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1025
+ var O, tag, result;
1026
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1027
+ // @@toStringTag case
1028
+ : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
1029
+ // builtinTag case
1030
+ : CORRECT_ARGUMENTS ? classofRaw$1(O)
1031
+ // ES3 arguments fallback
1032
+ : (result = classofRaw$1(O)) === 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1033
+ };
1034
+
1035
+ var classof$3 = classof$4;
1036
+
1037
+ var $String$2 = String;
1038
+
1039
+ var toString$7 = function (argument) {
1040
+ if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1041
+ return $String$2(argument);
1042
+ };
1043
+
1044
+ var anObject$7 = anObject$a;
1045
+
1046
+ // `RegExp.prototype.flags` getter implementation
1047
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1048
+ var regexpFlags$1 = function () {
1049
+ var that = anObject$7(this);
1050
+ var result = '';
1051
+ if (that.hasIndices) result += 'd';
1052
+ if (that.global) result += 'g';
1053
+ if (that.ignoreCase) result += 'i';
1054
+ if (that.multiline) result += 'm';
1055
+ if (that.dotAll) result += 's';
1056
+ if (that.unicode) result += 'u';
1057
+ if (that.unicodeSets) result += 'v';
1058
+ if (that.sticky) result += 'y';
1059
+ return result;
1060
+ };
1061
+
1062
+ var fails$c = fails$l;
1063
+ var global$5 = global$g;
1064
+
1065
+ // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1066
+ var $RegExp$2 = global$5.RegExp;
1067
+
1068
+ var UNSUPPORTED_Y$1 = fails$c(function () {
1069
+ var re = $RegExp$2('a', 'y');
1070
+ re.lastIndex = 2;
1071
+ return re.exec('abcd') !== null;
1072
+ });
1073
+
1074
+ // UC Browser bug
1075
+ // https://github.com/zloirock/core-js/issues/1008
1076
+ var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$c(function () {
1077
+ return !$RegExp$2('a', 'y').sticky;
1078
+ });
1079
+
1080
+ var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$c(function () {
1081
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1082
+ var re = $RegExp$2('^r', 'gy');
1083
+ re.lastIndex = 2;
1084
+ return re.exec('str') !== null;
1085
+ });
1086
+
1087
+ var regexpStickyHelpers = {
1088
+ BROKEN_CARET: BROKEN_CARET,
1089
+ MISSED_STICKY: MISSED_STICKY,
1090
+ UNSUPPORTED_Y: UNSUPPORTED_Y$1
1091
+ };
1092
+
1093
+ var objectDefineProperties = {};
1094
+
1095
+ var internalObjectKeys = objectKeysInternal;
1096
+ var enumBugKeys$1 = enumBugKeys$3;
1097
+
1098
+ // `Object.keys` method
1099
+ // https://tc39.es/ecma262/#sec-object.keys
1100
+ // eslint-disable-next-line es/no-object-keys -- safe
1101
+ var objectKeys$2 = Object.keys || function keys(O) {
1102
+ return internalObjectKeys(O, enumBugKeys$1);
1103
+ };
1104
+
1105
+ var DESCRIPTORS$2 = descriptors;
1106
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1107
+ var definePropertyModule = objectDefineProperty;
1108
+ var anObject$6 = anObject$a;
1109
+ var toIndexedObject$1 = toIndexedObject$5;
1110
+ var objectKeys$1 = objectKeys$2;
1111
+
1112
+ // `Object.defineProperties` method
1113
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1114
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
1115
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1116
+ anObject$6(O);
1117
+ var props = toIndexedObject$1(Properties);
1118
+ var keys = objectKeys$1(Properties);
1119
+ var length = keys.length;
1120
+ var index = 0;
1121
+ var key;
1122
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1123
+ return O;
1124
+ };
1125
+
1126
+ var getBuiltIn = getBuiltIn$3;
1127
+
1128
+ var html$1 = getBuiltIn('document', 'documentElement');
1129
+
1130
+ /* global ActiveXObject -- old IE, WSH */
1131
+ var anObject$5 = anObject$a;
1132
+ var definePropertiesModule = objectDefineProperties;
1133
+ var enumBugKeys = enumBugKeys$3;
1134
+ var hiddenKeys = hiddenKeys$4;
1135
+ var html = html$1;
1136
+ var documentCreateElement$1 = documentCreateElement$2;
1137
+ var sharedKey$1 = sharedKey$3;
1138
+
1139
+ var GT = '>';
1140
+ var LT = '<';
1141
+ var PROTOTYPE = 'prototype';
1142
+ var SCRIPT = 'script';
1143
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1144
+
1145
+ var EmptyConstructor = function () { /* empty */ };
1146
+
1147
+ var scriptTag = function (content) {
1148
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1149
+ };
1150
+
1151
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1152
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1153
+ activeXDocument.write(scriptTag(''));
1154
+ activeXDocument.close();
1155
+ var temp = activeXDocument.parentWindow.Object;
1156
+ activeXDocument = null; // avoid memory leak
1157
+ return temp;
1158
+ };
1159
+
1160
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1161
+ var NullProtoObjectViaIFrame = function () {
1162
+ // Thrash, waste and sodomy: IE GC bug
1163
+ var iframe = documentCreateElement$1('iframe');
1164
+ var JS = 'java' + SCRIPT + ':';
1165
+ var iframeDocument;
1166
+ iframe.style.display = 'none';
1167
+ html.appendChild(iframe);
1168
+ // https://github.com/zloirock/core-js/issues/475
1169
+ iframe.src = String(JS);
1170
+ iframeDocument = iframe.contentWindow.document;
1171
+ iframeDocument.open();
1172
+ iframeDocument.write(scriptTag('document.F=Object'));
1173
+ iframeDocument.close();
1174
+ return iframeDocument.F;
1175
+ };
1176
+
1177
+ // Check for document.domain and active x support
1178
+ // No need to use active x approach when document.domain is not set
1179
+ // see https://github.com/es-shims/es5-shim/issues/150
1180
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1181
+ // avoid IE GC bug
1182
+ var activeXDocument;
1183
+ var NullProtoObject = function () {
1184
+ try {
1185
+ activeXDocument = new ActiveXObject('htmlfile');
1186
+ } catch (error) { /* ignore */ }
1187
+ NullProtoObject = typeof document != 'undefined'
1188
+ ? document.domain && activeXDocument
1189
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1190
+ : NullProtoObjectViaIFrame()
1191
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1192
+ var length = enumBugKeys.length;
1193
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1194
+ return NullProtoObject();
1195
+ };
1196
+
1197
+ hiddenKeys[IE_PROTO$1] = true;
1198
+
1199
+ // `Object.create` method
1200
+ // https://tc39.es/ecma262/#sec-object.create
1201
+ // eslint-disable-next-line es/no-object-create -- safe
1202
+ var objectCreate = Object.create || function create(O, Properties) {
1203
+ var result;
1204
+ if (O !== null) {
1205
+ EmptyConstructor[PROTOTYPE] = anObject$5(O);
1206
+ result = new EmptyConstructor();
1207
+ EmptyConstructor[PROTOTYPE] = null;
1208
+ // add "__proto__" for Object.getPrototypeOf polyfill
1209
+ result[IE_PROTO$1] = O;
1210
+ } else result = NullProtoObject();
1211
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1212
+ };
1213
+
1214
+ var fails$b = fails$l;
1215
+ var global$4 = global$g;
1216
+
1217
+ // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1218
+ var $RegExp$1 = global$4.RegExp;
1219
+
1220
+ var regexpUnsupportedDotAll = fails$b(function () {
1221
+ var re = $RegExp$1('.', 's');
1222
+ return !(re.dotAll && re.test('\n') && re.flags === 's');
1223
+ });
1224
+
1225
+ var fails$a = fails$l;
1226
+ var global$3 = global$g;
1227
+
1228
+ // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1229
+ var $RegExp = global$3.RegExp;
1230
+
1231
+ var regexpUnsupportedNcg = fails$a(function () {
1232
+ var re = $RegExp('(?<a>b)', 'g');
1233
+ return re.exec('b').groups.a !== 'b' ||
1234
+ 'b'.replace(re, '$<a>c') !== 'bc';
1235
+ });
1236
+
1237
+ /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1238
+ /* eslint-disable regexp/no-useless-quantifier -- testing */
1239
+ var call$7 = functionCall;
1240
+ var uncurryThis$b = functionUncurryThis;
1241
+ var toString$6 = toString$7;
1242
+ var regexpFlags = regexpFlags$1;
1243
+ var stickyHelpers = regexpStickyHelpers;
1244
+ var shared = shared$4.exports;
1245
+ var create$2 = objectCreate;
1246
+ var getInternalState$1 = internalState.get;
1247
+ var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1248
+ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1249
+
1250
+ var nativeReplace = shared('native-string-replace', String.prototype.replace);
1251
+ var nativeExec = RegExp.prototype.exec;
1252
+ var patchedExec = nativeExec;
1253
+ var charAt$3 = uncurryThis$b(''.charAt);
1254
+ var indexOf = uncurryThis$b(''.indexOf);
1255
+ var replace$2 = uncurryThis$b(''.replace);
1256
+ var stringSlice$4 = uncurryThis$b(''.slice);
1257
+
1258
+ var UPDATES_LAST_INDEX_WRONG = (function () {
1259
+ var re1 = /a/;
1260
+ var re2 = /b*/g;
1261
+ call$7(nativeExec, re1, 'a');
1262
+ call$7(nativeExec, re2, 'a');
1263
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1264
+ })();
1265
+
1266
+ var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1267
+
1268
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
1269
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1270
+
1271
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1272
+
1273
+ if (PATCH) {
1274
+ patchedExec = function exec(string) {
1275
+ var re = this;
1276
+ var state = getInternalState$1(re);
1277
+ var str = toString$6(string);
1278
+ var raw = state.raw;
1279
+ var result, reCopy, lastIndex, match, i, object, group;
1280
+
1281
+ if (raw) {
1282
+ raw.lastIndex = re.lastIndex;
1283
+ result = call$7(patchedExec, raw, str);
1284
+ re.lastIndex = raw.lastIndex;
1285
+ return result;
1286
+ }
1287
+
1288
+ var groups = state.groups;
1289
+ var sticky = UNSUPPORTED_Y && re.sticky;
1290
+ var flags = call$7(regexpFlags, re);
1291
+ var source = re.source;
1292
+ var charsAdded = 0;
1293
+ var strCopy = str;
1294
+
1295
+ if (sticky) {
1296
+ flags = replace$2(flags, 'y', '');
1297
+ if (indexOf(flags, 'g') === -1) {
1298
+ flags += 'g';
1299
+ }
1300
+
1301
+ strCopy = stringSlice$4(str, re.lastIndex);
1302
+ // Support anchored sticky behavior.
1303
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
1304
+ source = '(?: ' + source + ')';
1305
+ strCopy = ' ' + strCopy;
1306
+ charsAdded++;
1307
+ }
1308
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
1309
+ // simulate the 'y' flag.
1310
+ reCopy = new RegExp('^(?:' + source + ')', flags);
1311
+ }
1312
+
1313
+ if (NPCG_INCLUDED) {
1314
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1315
+ }
1316
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1317
+
1318
+ match = call$7(nativeExec, sticky ? reCopy : re, strCopy);
1319
+
1320
+ if (sticky) {
1321
+ if (match) {
1322
+ match.input = stringSlice$4(match.input, charsAdded);
1323
+ match[0] = stringSlice$4(match[0], charsAdded);
1324
+ match.index = re.lastIndex;
1325
+ re.lastIndex += match[0].length;
1326
+ } else re.lastIndex = 0;
1327
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
1328
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1329
+ }
1330
+ if (NPCG_INCLUDED && match && match.length > 1) {
1331
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
1332
+ // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
1333
+ call$7(nativeReplace, match[0], reCopy, function () {
1334
+ for (i = 1; i < arguments.length - 2; i++) {
1335
+ if (arguments[i] === undefined) match[i] = undefined;
1336
+ }
1337
+ });
1338
+ }
1339
+
1340
+ if (match && groups) {
1341
+ match.groups = object = create$2(null);
1342
+ for (i = 0; i < groups.length; i++) {
1343
+ group = groups[i];
1344
+ object[group[0]] = match[group[1]];
1345
+ }
1346
+ }
1347
+
1348
+ return match;
1349
+ };
1350
+ }
1351
+
1352
+ var regexpExec$2 = patchedExec;
1353
+
1354
+ var $$7 = _export;
1355
+ var exec = regexpExec$2;
1356
+
1357
+ // `RegExp.prototype.exec` method
1358
+ // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1359
+ $$7({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
1360
+ exec: exec
1361
+ });
1362
+
1363
+ var NATIVE_BIND = functionBindNative;
1364
+
1365
+ var FunctionPrototype = Function.prototype;
1366
+ var apply$1 = FunctionPrototype.apply;
1367
+ var call$6 = FunctionPrototype.call;
1368
+
1369
+ // eslint-disable-next-line es/no-reflect -- safe
1370
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$6.bind(apply$1) : function () {
1371
+ return call$6.apply(apply$1, arguments);
1372
+ });
1373
+
1374
+ var classofRaw = classofRaw$2;
1375
+ var uncurryThis$a = functionUncurryThis;
1376
+
1377
+ var functionUncurryThisClause = function (fn) {
1378
+ // Nashorn bug:
1379
+ // https://github.com/zloirock/core-js/issues/1128
1380
+ // https://github.com/zloirock/core-js/issues/1130
1381
+ if (classofRaw(fn) === 'Function') return uncurryThis$a(fn);
1382
+ };
1383
+
1384
+ // TODO: Remove from `core-js@4` since it's moved to entry points
1385
+
1386
+ var uncurryThis$9 = functionUncurryThisClause;
1387
+ var defineBuiltIn$3 = defineBuiltIn$5;
1388
+ var regexpExec$1 = regexpExec$2;
1389
+ var fails$9 = fails$l;
1390
+ var wellKnownSymbol$8 = wellKnownSymbol$c;
1391
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1392
+
1393
+ var SPECIES = wellKnownSymbol$8('species');
1394
+ var RegExpPrototype$2 = RegExp.prototype;
1395
+
1396
+ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1397
+ var SYMBOL = wellKnownSymbol$8(KEY);
1398
+
1399
+ var DELEGATES_TO_SYMBOL = !fails$9(function () {
1400
+ // String methods call symbol-named RegEp methods
1401
+ var O = {};
1402
+ O[SYMBOL] = function () { return 7; };
1403
+ return ''[KEY](O) !== 7;
1404
+ });
1405
+
1406
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$9(function () {
1407
+ // Symbol-named RegExp methods call .exec
1408
+ var execCalled = false;
1409
+ var re = /a/;
1410
+
1411
+ if (KEY === 'split') {
1412
+ // We can't use real regex here since it causes deoptimization
1413
+ // and serious performance degradation in V8
1414
+ // https://github.com/zloirock/core-js/issues/306
1415
+ re = {};
1416
+ // RegExp[@@split] doesn't call the regex's exec method, but first creates
1417
+ // a new one. We need to return the patched regex when creating the new one.
1418
+ re.constructor = {};
1419
+ re.constructor[SPECIES] = function () { return re; };
1420
+ re.flags = '';
1421
+ re[SYMBOL] = /./[SYMBOL];
1422
+ }
1423
+
1424
+ re.exec = function () {
1425
+ execCalled = true;
1426
+ return null;
1427
+ };
1428
+
1429
+ re[SYMBOL]('');
1430
+ return !execCalled;
1431
+ });
1432
+
1433
+ if (
1434
+ !DELEGATES_TO_SYMBOL ||
1435
+ !DELEGATES_TO_EXEC ||
1436
+ FORCED
1437
+ ) {
1438
+ var uncurriedNativeRegExpMethod = uncurryThis$9(/./[SYMBOL]);
1439
+ var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1440
+ var uncurriedNativeMethod = uncurryThis$9(nativeMethod);
1441
+ var $exec = regexp.exec;
1442
+ if ($exec === regexpExec$1 || $exec === RegExpPrototype$2.exec) {
1443
+ if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1444
+ // The native String method already delegates to @@method (this
1445
+ // polyfilled function), leasing to infinite recursion.
1446
+ // We avoid it by directly calling the native @@method method.
1447
+ return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
1448
+ }
1449
+ return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
1450
+ }
1451
+ return { done: false };
1452
+ });
1453
+
1454
+ defineBuiltIn$3(String.prototype, KEY, methods[0]);
1455
+ defineBuiltIn$3(RegExpPrototype$2, SYMBOL, methods[1]);
1456
+ }
1457
+
1458
+ if (SHAM) createNonEnumerableProperty$2(RegExpPrototype$2[SYMBOL], 'sham', true);
1459
+ };
1460
+
1461
+ var uncurryThis$8 = functionUncurryThis;
1462
+ var toIntegerOrInfinity$3 = toIntegerOrInfinity$6;
1463
+ var toString$5 = toString$7;
1464
+ var requireObjectCoercible$5 = requireObjectCoercible$8;
1465
+
1466
+ var charAt$2 = uncurryThis$8(''.charAt);
1467
+ var charCodeAt = uncurryThis$8(''.charCodeAt);
1468
+ var stringSlice$3 = uncurryThis$8(''.slice);
1469
+
1470
+ var createMethod$2 = function (CONVERT_TO_STRING) {
1471
+ return function ($this, pos) {
1472
+ var S = toString$5(requireObjectCoercible$5($this));
1473
+ var position = toIntegerOrInfinity$3(pos);
1474
+ var size = S.length;
1475
+ var first, second;
1476
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1477
+ first = charCodeAt(S, position);
1478
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size
1479
+ || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
1480
+ ? CONVERT_TO_STRING
1481
+ ? charAt$2(S, position)
1482
+ : first
1483
+ : CONVERT_TO_STRING
1484
+ ? stringSlice$3(S, position, position + 2)
1485
+ : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1486
+ };
1487
+ };
1488
+
1489
+ var stringMultibyte = {
1490
+ // `String.prototype.codePointAt` method
1491
+ // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1492
+ codeAt: createMethod$2(false),
1493
+ // `String.prototype.at` method
1494
+ // https://github.com/mathiasbynens/String.prototype.at
1495
+ charAt: createMethod$2(true)
1496
+ };
1497
+
1498
+ var charAt$1 = stringMultibyte.charAt;
1499
+
1500
+ // `AdvanceStringIndex` abstract operation
1501
+ // https://tc39.es/ecma262/#sec-advancestringindex
1502
+ var advanceStringIndex$2 = function (S, index, unicode) {
1503
+ return index + (unicode ? charAt$1(S, index).length : 1);
1504
+ };
1505
+
1506
+ var uncurryThis$7 = functionUncurryThis;
1507
+ var toObject$3 = toObject$5;
1508
+
1509
+ var floor$1 = Math.floor;
1510
+ var charAt = uncurryThis$7(''.charAt);
1511
+ var replace$1 = uncurryThis$7(''.replace);
1512
+ var stringSlice$2 = uncurryThis$7(''.slice);
1513
+ // eslint-disable-next-line redos/no-vulnerable -- safe
1514
+ var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
1515
+ var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
1516
+
1517
+ // `GetSubstitution` abstract operation
1518
+ // https://tc39.es/ecma262/#sec-getsubstitution
1519
+ var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
1520
+ var tailPos = position + matched.length;
1521
+ var m = captures.length;
1522
+ var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
1523
+ if (namedCaptures !== undefined) {
1524
+ namedCaptures = toObject$3(namedCaptures);
1525
+ symbols = SUBSTITUTION_SYMBOLS;
1526
+ }
1527
+ return replace$1(replacement, symbols, function (match, ch) {
1528
+ var capture;
1529
+ switch (charAt(ch, 0)) {
1530
+ case '$': return '$';
1531
+ case '&': return matched;
1532
+ case '`': return stringSlice$2(str, 0, position);
1533
+ case "'": return stringSlice$2(str, tailPos);
1534
+ case '<':
1535
+ capture = namedCaptures[stringSlice$2(ch, 1, -1)];
1536
+ break;
1537
+ default: // \d\d?
1538
+ var n = +ch;
1539
+ if (n === 0) return match;
1540
+ if (n > m) {
1541
+ var f = floor$1(n / 10);
1542
+ if (f === 0) return match;
1543
+ if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
1544
+ return match;
1545
+ }
1546
+ capture = captures[n - 1];
1547
+ }
1548
+ return capture === undefined ? '' : capture;
1549
+ });
1550
+ };
1551
+
1552
+ var call$5 = functionCall;
1553
+ var anObject$4 = anObject$a;
1554
+ var isCallable$4 = isCallable$g;
1555
+ var classof$2 = classofRaw$2;
1556
+ var regexpExec = regexpExec$2;
1557
+
1558
+ var $TypeError$3 = TypeError;
1559
+
1560
+ // `RegExpExec` abstract operation
1561
+ // https://tc39.es/ecma262/#sec-regexpexec
1562
+ var regexpExecAbstract = function (R, S) {
1563
+ var exec = R.exec;
1564
+ if (isCallable$4(exec)) {
1565
+ var result = call$5(exec, R, S);
1566
+ if (result !== null) anObject$4(result);
1567
+ return result;
1568
+ }
1569
+ if (classof$2(R) === 'RegExp') return call$5(regexpExec, R, S);
1570
+ throw new $TypeError$3('RegExp#exec called on incompatible receiver');
1571
+ };
1572
+
1573
+ var apply = functionApply;
1574
+ var call$4 = functionCall;
1575
+ var uncurryThis$6 = functionUncurryThis;
1576
+ var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
1577
+ var fails$8 = fails$l;
1578
+ var anObject$3 = anObject$a;
1579
+ var isCallable$3 = isCallable$g;
1580
+ var isNullOrUndefined$1 = isNullOrUndefined$4;
1581
+ var toIntegerOrInfinity$2 = toIntegerOrInfinity$6;
1582
+ var toLength$1 = toLength$3;
1583
+ var toString$4 = toString$7;
1584
+ var requireObjectCoercible$4 = requireObjectCoercible$8;
1585
+ var advanceStringIndex$1 = advanceStringIndex$2;
1586
+ var getMethod$1 = getMethod$3;
1587
+ var getSubstitution = getSubstitution$1;
1588
+ var regExpExec$1 = regexpExecAbstract;
1589
+ var wellKnownSymbol$7 = wellKnownSymbol$c;
1590
+
1591
+ var REPLACE = wellKnownSymbol$7('replace');
1592
+ var max = Math.max;
1593
+ var min = Math.min;
1594
+ var concat$1 = uncurryThis$6([].concat);
1595
+ var push = uncurryThis$6([].push);
1596
+ var stringIndexOf$1 = uncurryThis$6(''.indexOf);
1597
+ var stringSlice$1 = uncurryThis$6(''.slice);
1598
+
1599
+ var maybeToString = function (it) {
1600
+ return it === undefined ? it : String(it);
1601
+ };
1602
+
1603
+ // IE <= 11 replaces $0 with the whole match, as if it was $&
1604
+ // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
1605
+ var REPLACE_KEEPS_$0 = (function () {
1606
+ // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
1607
+ return 'a'.replace(/./, '$0') === '$0';
1608
+ })();
1609
+
1610
+ // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
1611
+ var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
1612
+ if (/./[REPLACE]) {
1613
+ return /./[REPLACE]('a', '$0') === '';
1614
+ }
1615
+ return false;
1616
+ })();
1617
+
1618
+ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$8(function () {
1619
+ var re = /./;
1620
+ re.exec = function () {
1621
+ var result = [];
1622
+ result.groups = { a: '7' };
1623
+ return result;
1624
+ };
1625
+ // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
1626
+ return ''.replace(re, '$<a>') !== '7';
1627
+ });
1628
+
1629
+ // @@replace logic
1630
+ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCallNative) {
1631
+ var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
1632
+
1633
+ return [
1634
+ // `String.prototype.replace` method
1635
+ // https://tc39.es/ecma262/#sec-string.prototype.replace
1636
+ function replace(searchValue, replaceValue) {
1637
+ var O = requireObjectCoercible$4(this);
1638
+ var replacer = isNullOrUndefined$1(searchValue) ? undefined : getMethod$1(searchValue, REPLACE);
1639
+ return replacer
1640
+ ? call$4(replacer, searchValue, O, replaceValue)
1641
+ : call$4(nativeReplace, toString$4(O), searchValue, replaceValue);
1642
+ },
1643
+ // `RegExp.prototype[@@replace]` method
1644
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
1645
+ function (string, replaceValue) {
1646
+ var rx = anObject$3(this);
1647
+ var S = toString$4(string);
1648
+
1649
+ if (
1650
+ typeof replaceValue == 'string' &&
1651
+ stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
1652
+ stringIndexOf$1(replaceValue, '$<') === -1
1653
+ ) {
1654
+ var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
1655
+ if (res.done) return res.value;
1656
+ }
1657
+
1658
+ var functionalReplace = isCallable$3(replaceValue);
1659
+ if (!functionalReplace) replaceValue = toString$4(replaceValue);
1660
+
1661
+ var global = rx.global;
1662
+ var fullUnicode;
1663
+ if (global) {
1664
+ fullUnicode = rx.unicode;
1665
+ rx.lastIndex = 0;
1666
+ }
1667
+
1668
+ var results = [];
1669
+ var result;
1670
+ while (true) {
1671
+ result = regExpExec$1(rx, S);
1672
+ if (result === null) break;
1673
+
1674
+ push(results, result);
1675
+ if (!global) break;
1676
+
1677
+ var matchStr = toString$4(result[0]);
1678
+ if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
1679
+ }
1680
+
1681
+ var accumulatedResult = '';
1682
+ var nextSourcePosition = 0;
1683
+ for (var i = 0; i < results.length; i++) {
1684
+ result = results[i];
1685
+
1686
+ var matched = toString$4(result[0]);
1687
+ var position = max(min(toIntegerOrInfinity$2(result.index), S.length), 0);
1688
+ var captures = [];
1689
+ var replacement;
1690
+ // NOTE: This is equivalent to
1691
+ // captures = result.slice(1).map(maybeToString)
1692
+ // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
1693
+ // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
1694
+ // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
1695
+ for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
1696
+ var namedCaptures = result.groups;
1697
+ if (functionalReplace) {
1698
+ var replacerArgs = concat$1([matched], captures, position, S);
1699
+ if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
1700
+ replacement = toString$4(apply(replaceValue, undefined, replacerArgs));
1701
+ } else {
1702
+ replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
1703
+ }
1704
+ if (position >= nextSourcePosition) {
1705
+ accumulatedResult += stringSlice$1(S, nextSourcePosition, position) + replacement;
1706
+ nextSourcePosition = position + matched.length;
1707
+ }
1708
+ }
1709
+
1710
+ return accumulatedResult + stringSlice$1(S, nextSourcePosition);
1711
+ }
1712
+ ];
1713
+ }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
1714
+
1715
+ var DESCRIPTORS$1 = descriptors;
1716
+ var uncurryThis$5 = functionUncurryThis;
1717
+ var call$3 = functionCall;
1718
+ var fails$7 = fails$l;
1719
+ var objectKeys = objectKeys$2;
1720
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1721
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1722
+ var toObject$2 = toObject$5;
1723
+ var IndexedObject$1 = indexedObject;
1724
+
1725
+ // eslint-disable-next-line es/no-object-assign -- safe
1726
+ var $assign = Object.assign;
1727
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1728
+ var defineProperty$3 = Object.defineProperty;
1729
+ var concat = uncurryThis$5([].concat);
1730
+
1731
+ // `Object.assign` method
1732
+ // https://tc39.es/ecma262/#sec-object.assign
1733
+ var objectAssign = !$assign || fails$7(function () {
1734
+ // should have correct order of operations (Edge bug)
1735
+ if (DESCRIPTORS$1 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
1736
+ enumerable: true,
1737
+ get: function () {
1738
+ defineProperty$3(this, 'b', {
1739
+ value: 3,
1740
+ enumerable: false
1741
+ });
1742
+ }
1743
+ }), { b: 2 })).b !== 1) return true;
1744
+ // should work with symbols and should have deterministic property order (V8 bug)
1745
+ var A = {};
1746
+ var B = {};
1747
+ // eslint-disable-next-line es/no-symbol -- safe
1748
+ var symbol = Symbol('assign detection');
1749
+ var alphabet = 'abcdefghijklmnopqrst';
1750
+ A[symbol] = 7;
1751
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1752
+ return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
1753
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1754
+ var T = toObject$2(target);
1755
+ var argumentsLength = arguments.length;
1756
+ var index = 1;
1757
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1758
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1759
+ while (argumentsLength > index) {
1760
+ var S = IndexedObject$1(arguments[index++]);
1761
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1762
+ var length = keys.length;
1763
+ var j = 0;
1764
+ var key;
1765
+ while (length > j) {
1766
+ key = keys[j++];
1767
+ if (!DESCRIPTORS$1 || call$3(propertyIsEnumerable, S, key)) T[key] = S[key];
1768
+ }
1769
+ } return T;
1770
+ } : $assign;
1771
+
1772
+ var $$6 = _export;
1773
+ var assign = objectAssign;
1774
+
1775
+ // `Object.assign` method
1776
+ // https://tc39.es/ecma262/#sec-object.assign
1777
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1778
+ $$6({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1779
+ assign: assign
1780
+ });
1781
+
1782
+ function _iterableToArrayLimit(r, l) {
1783
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
1784
+ if (null != t) {
1785
+ var e,
1786
+ n,
1787
+ i,
1788
+ u,
1789
+ a = [],
1790
+ f = !0,
1791
+ o = !1;
1792
+ try {
1793
+ if (i = (t = t.call(r)).next, 0 === l) {
1794
+ if (Object(t) !== t) return;
1795
+ f = !1;
1796
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
1797
+ } catch (r) {
1798
+ o = !0, n = r;
1799
+ } finally {
1800
+ try {
1801
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
1802
+ } finally {
1803
+ if (o) throw n;
1804
+ }
1805
+ }
1806
+ return a;
1807
+ }
1808
+ }
1809
+ function _defineProperty(obj, key, value) {
1810
+ key = _toPropertyKey(key);
1811
+ if (key in obj) {
1812
+ Object.defineProperty(obj, key, {
1813
+ value: value,
1814
+ enumerable: true,
1815
+ configurable: true,
1816
+ writable: true
1817
+ });
1818
+ } else {
1819
+ obj[key] = value;
1820
+ }
1821
+ return obj;
1822
+ }
1823
+ function _slicedToArray(arr, i) {
1824
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1825
+ }
1826
+ function _toConsumableArray(arr) {
1827
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
1828
+ }
1829
+ function _arrayWithoutHoles(arr) {
1830
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
1831
+ }
1832
+ function _arrayWithHoles(arr) {
1833
+ if (Array.isArray(arr)) return arr;
1834
+ }
1835
+ function _iterableToArray(iter) {
1836
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1837
+ }
1838
+ function _unsupportedIterableToArray(o, minLen) {
1839
+ if (!o) return;
1840
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
1841
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1842
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1843
+ if (n === "Map" || n === "Set") return Array.from(o);
1844
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
1845
+ }
1846
+ function _arrayLikeToArray(arr, len) {
1847
+ if (len == null || len > arr.length) len = arr.length;
1848
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
1849
+ return arr2;
1850
+ }
1851
+ function _nonIterableSpread() {
1852
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1853
+ }
1854
+ function _nonIterableRest() {
1855
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1856
+ }
1857
+ function _createForOfIteratorHelper(o, allowArrayLike) {
1858
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
1859
+ if (!it) {
1860
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
1861
+ if (it) o = it;
1862
+ var i = 0;
1863
+ var F = function () {};
1864
+ return {
1865
+ s: F,
1866
+ n: function () {
1867
+ if (i >= o.length) return {
1868
+ done: true
1869
+ };
1870
+ return {
1871
+ done: false,
1872
+ value: o[i++]
1873
+ };
1874
+ },
1875
+ e: function (e) {
1876
+ throw e;
1877
+ },
1878
+ f: F
1879
+ };
1880
+ }
1881
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1882
+ }
1883
+ var normalCompletion = true,
1884
+ didErr = false,
1885
+ err;
1886
+ return {
1887
+ s: function () {
1888
+ it = it.call(o);
1889
+ },
1890
+ n: function () {
1891
+ var step = it.next();
1892
+ normalCompletion = step.done;
1893
+ return step;
1894
+ },
1895
+ e: function (e) {
1896
+ didErr = true;
1897
+ err = e;
1898
+ },
1899
+ f: function () {
1900
+ try {
1901
+ if (!normalCompletion && it.return != null) it.return();
1902
+ } finally {
1903
+ if (didErr) throw err;
1904
+ }
1905
+ }
1906
+ };
1907
+ }
1908
+ function _toPrimitive(input, hint) {
1909
+ if (typeof input !== "object" || input === null) return input;
1910
+ var prim = input[Symbol.toPrimitive];
1911
+ if (prim !== undefined) {
1912
+ var res = prim.call(input, hint || "default");
1913
+ if (typeof res !== "object") return res;
1914
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1915
+ }
1916
+ return (hint === "string" ? String : Number)(input);
1917
+ }
1918
+ function _toPropertyKey(arg) {
1919
+ var key = _toPrimitive(arg, "string");
1920
+ return typeof key === "symbol" ? key : String(key);
1921
+ }
1922
+
1923
+ var call$2 = functionCall;
1924
+ var hasOwn$2 = hasOwnProperty_1;
1925
+ var isPrototypeOf = objectIsPrototypeOf;
1926
+ var regExpFlags = regexpFlags$1;
1927
+
1928
+ var RegExpPrototype$1 = RegExp.prototype;
1929
+
1930
+ var regexpGetFlags = function (R) {
1931
+ var flags = R.flags;
1932
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
1933
+ ? call$2(regExpFlags, R) : flags;
1934
+ };
1935
+
1936
+ var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
1937
+ var defineBuiltIn$2 = defineBuiltIn$5;
1938
+ var anObject$2 = anObject$a;
1939
+ var $toString = toString$7;
1940
+ var fails$6 = fails$l;
1941
+ var getRegExpFlags = regexpGetFlags;
1942
+
1943
+ var TO_STRING = 'toString';
1944
+ var RegExpPrototype = RegExp.prototype;
1945
+ var nativeToString = RegExpPrototype[TO_STRING];
1946
+
1947
+ var NOT_GENERIC = fails$6(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
1948
+ // FF44- RegExp#toString has a wrong name
1949
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME$2 && nativeToString.name !== TO_STRING;
1950
+
1951
+ // `RegExp.prototype.toString` method
1952
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
1953
+ if (NOT_GENERIC || INCORRECT_NAME) {
1954
+ defineBuiltIn$2(RegExpPrototype, TO_STRING, function toString() {
1955
+ var R = anObject$2(this);
1956
+ var pattern = $toString(R.source);
1957
+ var flags = $toString(getRegExpFlags(R));
1958
+ return '/' + pattern + '/' + flags;
1959
+ }, { unsafe: true });
1960
+ }
1961
+
1962
+ var aCallable$1 = aCallable$3;
1963
+ var toObject$1 = toObject$5;
1964
+ var IndexedObject = indexedObject;
1965
+ var lengthOfArrayLike = lengthOfArrayLike$2;
1966
+
1967
+ var $TypeError$2 = TypeError;
1968
+
1969
+ // `Array.prototype.{ reduce, reduceRight }` methods implementation
1970
+ var createMethod$1 = function (IS_RIGHT) {
1971
+ return function (that, callbackfn, argumentsLength, memo) {
1972
+ var O = toObject$1(that);
1973
+ var self = IndexedObject(O);
1974
+ var length = lengthOfArrayLike(O);
1975
+ aCallable$1(callbackfn);
1976
+ var index = IS_RIGHT ? length - 1 : 0;
1977
+ var i = IS_RIGHT ? -1 : 1;
1978
+ if (argumentsLength < 2) while (true) {
1979
+ if (index in self) {
1980
+ memo = self[index];
1981
+ index += i;
1982
+ break;
1983
+ }
1984
+ index += i;
1985
+ if (IS_RIGHT ? index < 0 : length <= index) {
1986
+ throw new $TypeError$2('Reduce of empty array with no initial value');
1987
+ }
1988
+ }
1989
+ for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
1990
+ memo = callbackfn(memo, self[index], index, O);
1991
+ }
1992
+ return memo;
1993
+ };
1994
+ };
1995
+
1996
+ var arrayReduce = {
1997
+ // `Array.prototype.reduce` method
1998
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
1999
+ left: createMethod$1(false),
2000
+ // `Array.prototype.reduceRight` method
2001
+ // https://tc39.es/ecma262/#sec-array.prototype.reduceright
2002
+ right: createMethod$1(true)
2003
+ };
2004
+
2005
+ var fails$5 = fails$l;
2006
+
2007
+ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
2008
+ var method = [][METHOD_NAME];
2009
+ return !!method && fails$5(function () {
2010
+ // eslint-disable-next-line no-useless-call -- required for testing
2011
+ method.call(null, argument || function () { return 1; }, 1);
2012
+ });
2013
+ };
2014
+
2015
+ var global$2 = global$g;
2016
+ var classof$1 = classofRaw$2;
2017
+
2018
+ var engineIsNode = classof$1(global$2.process) === 'process';
2019
+
2020
+ var $$5 = _export;
2021
+ var $reduce = arrayReduce.left;
2022
+ var arrayMethodIsStrict = arrayMethodIsStrict$1;
2023
+ var CHROME_VERSION = engineV8Version;
2024
+ var IS_NODE = engineIsNode;
2025
+
2026
+ // Chrome 80-82 has a critical bug
2027
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
2028
+ var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
2029
+ var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict('reduce');
2030
+
2031
+ // `Array.prototype.reduce` method
2032
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
2033
+ $$5({ target: 'Array', proto: true, forced: FORCED$1 }, {
2034
+ reduce: function reduce(callbackfn /* , initialValue */) {
2035
+ var length = arguments.length;
2036
+ return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
2037
+ }
2038
+ });
2039
+
2040
+ var wellKnownSymbol$6 = wellKnownSymbol$c;
2041
+ var create$1 = objectCreate;
2042
+ var defineProperty$2 = objectDefineProperty.f;
2043
+
2044
+ var UNSCOPABLES = wellKnownSymbol$6('unscopables');
2045
+ var ArrayPrototype = Array.prototype;
2046
+
2047
+ // Array.prototype[@@unscopables]
2048
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2049
+ if (ArrayPrototype[UNSCOPABLES] === undefined) {
2050
+ defineProperty$2(ArrayPrototype, UNSCOPABLES, {
2051
+ configurable: true,
2052
+ value: create$1(null)
2053
+ });
2054
+ }
2055
+
2056
+ // add a key to Array.prototype[@@unscopables]
2057
+ var addToUnscopables$2 = function (key) {
2058
+ ArrayPrototype[UNSCOPABLES][key] = true;
2059
+ };
2060
+
2061
+ var $$4 = _export;
2062
+ var $includes = arrayIncludes.includes;
2063
+ var fails$4 = fails$l;
2064
+ var addToUnscopables$1 = addToUnscopables$2;
2065
+
2066
+ // FF99+ bug
2067
+ var BROKEN_ON_SPARSE = fails$4(function () {
2068
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
2069
+ return !Array(1).includes();
2070
+ });
2071
+
2072
+ // `Array.prototype.includes` method
2073
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
2074
+ $$4({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2075
+ includes: function includes(el /* , fromIndex = 0 */) {
2076
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2077
+ }
2078
+ });
2079
+
2080
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2081
+ addToUnscopables$1('includes');
2082
+
2083
+ var isObject$2 = isObject$8;
2084
+ var classof = classofRaw$2;
2085
+ var wellKnownSymbol$5 = wellKnownSymbol$c;
2086
+
2087
+ var MATCH$1 = wellKnownSymbol$5('match');
2088
+
2089
+ // `IsRegExp` abstract operation
2090
+ // https://tc39.es/ecma262/#sec-isregexp
2091
+ var isRegexp = function (it) {
2092
+ var isRegExp;
2093
+ return isObject$2(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
2094
+ };
2095
+
2096
+ var isRegExp = isRegexp;
2097
+
2098
+ var $TypeError$1 = TypeError;
2099
+
2100
+ var notARegexp = function (it) {
2101
+ if (isRegExp(it)) {
2102
+ throw new $TypeError$1("The method doesn't accept regular expressions");
2103
+ } return it;
2104
+ };
2105
+
2106
+ var wellKnownSymbol$4 = wellKnownSymbol$c;
2107
+
2108
+ var MATCH = wellKnownSymbol$4('match');
2109
+
2110
+ var correctIsRegexpLogic = function (METHOD_NAME) {
2111
+ var regexp = /./;
2112
+ try {
2113
+ '/./'[METHOD_NAME](regexp);
2114
+ } catch (error1) {
2115
+ try {
2116
+ regexp[MATCH] = false;
2117
+ return '/./'[METHOD_NAME](regexp);
2118
+ } catch (error2) { /* empty */ }
2119
+ } return false;
2120
+ };
2121
+
2122
+ var $$3 = _export;
2123
+ var uncurryThis$4 = functionUncurryThis;
2124
+ var notARegExp = notARegexp;
2125
+ var requireObjectCoercible$3 = requireObjectCoercible$8;
2126
+ var toString$3 = toString$7;
2127
+ var correctIsRegExpLogic = correctIsRegexpLogic;
2128
+
2129
+ var stringIndexOf = uncurryThis$4(''.indexOf);
2130
+
2131
+ // `String.prototype.includes` method
2132
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
2133
+ $$3({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
2134
+ includes: function includes(searchString /* , position = 0 */) {
2135
+ return !!~stringIndexOf(
2136
+ toString$3(requireObjectCoercible$3(this)),
2137
+ toString$3(notARegExp(searchString)),
2138
+ arguments.length > 1 ? arguments[1] : undefined
2139
+ );
2140
+ }
2141
+ });
2142
+
2143
+ var uncurryThis$3 = functionUncurryThis;
2144
+
2145
+ // `thisNumberValue` abstract operation
2146
+ // https://tc39.es/ecma262/#sec-thisnumbervalue
2147
+ var thisNumberValue$1 = uncurryThis$3(1.0.valueOf);
2148
+
2149
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$6;
2150
+ var toString$2 = toString$7;
2151
+ var requireObjectCoercible$2 = requireObjectCoercible$8;
2152
+
2153
+ var $RangeError$1 = RangeError;
2154
+
2155
+ // `String.prototype.repeat` method implementation
2156
+ // https://tc39.es/ecma262/#sec-string.prototype.repeat
2157
+ var stringRepeat = function repeat(count) {
2158
+ var str = toString$2(requireObjectCoercible$2(this));
2159
+ var result = '';
2160
+ var n = toIntegerOrInfinity$1(count);
2161
+ if (n < 0 || n === Infinity) throw new $RangeError$1('Wrong number of repetitions');
2162
+ for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
2163
+ return result;
2164
+ };
2165
+
2166
+ var $$2 = _export;
2167
+ var uncurryThis$2 = functionUncurryThis;
2168
+ var toIntegerOrInfinity = toIntegerOrInfinity$6;
2169
+ var thisNumberValue = thisNumberValue$1;
2170
+ var $repeat = stringRepeat;
2171
+ var fails$3 = fails$l;
2172
+
2173
+ var $RangeError = RangeError;
2174
+ var $String$1 = String;
2175
+ var floor = Math.floor;
2176
+ var repeat = uncurryThis$2($repeat);
2177
+ var stringSlice = uncurryThis$2(''.slice);
2178
+ var nativeToFixed = uncurryThis$2(1.0.toFixed);
2179
+
2180
+ var pow = function (x, n, acc) {
2181
+ return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
2182
+ };
2183
+
2184
+ var log = function (x) {
2185
+ var n = 0;
2186
+ var x2 = x;
2187
+ while (x2 >= 4096) {
2188
+ n += 12;
2189
+ x2 /= 4096;
2190
+ }
2191
+ while (x2 >= 2) {
2192
+ n += 1;
2193
+ x2 /= 2;
2194
+ } return n;
2195
+ };
2196
+
2197
+ var multiply = function (data, n, c) {
2198
+ var index = -1;
2199
+ var c2 = c;
2200
+ while (++index < 6) {
2201
+ c2 += n * data[index];
2202
+ data[index] = c2 % 1e7;
2203
+ c2 = floor(c2 / 1e7);
2204
+ }
2205
+ };
2206
+
2207
+ var divide = function (data, n) {
2208
+ var index = 6;
2209
+ var c = 0;
2210
+ while (--index >= 0) {
2211
+ c += data[index];
2212
+ data[index] = floor(c / n);
2213
+ c = (c % n) * 1e7;
2214
+ }
2215
+ };
2216
+
2217
+ var dataToString = function (data) {
2218
+ var index = 6;
2219
+ var s = '';
2220
+ while (--index >= 0) {
2221
+ if (s !== '' || index === 0 || data[index] !== 0) {
2222
+ var t = $String$1(data[index]);
2223
+ s = s === '' ? t : s + repeat('0', 7 - t.length) + t;
2224
+ }
2225
+ } return s;
2226
+ };
2227
+
2228
+ var FORCED = fails$3(function () {
2229
+ return nativeToFixed(0.00008, 3) !== '0.000' ||
2230
+ nativeToFixed(0.9, 0) !== '1' ||
2231
+ nativeToFixed(1.255, 2) !== '1.25' ||
2232
+ nativeToFixed(1000000000000000128.0, 0) !== '1000000000000000128';
2233
+ }) || !fails$3(function () {
2234
+ // V8 ~ Android 4.3-
2235
+ nativeToFixed({});
2236
+ });
2237
+
2238
+ // `Number.prototype.toFixed` method
2239
+ // https://tc39.es/ecma262/#sec-number.prototype.tofixed
2240
+ $$2({ target: 'Number', proto: true, forced: FORCED }, {
2241
+ toFixed: function toFixed(fractionDigits) {
2242
+ var number = thisNumberValue(this);
2243
+ var fractDigits = toIntegerOrInfinity(fractionDigits);
2244
+ var data = [0, 0, 0, 0, 0, 0];
2245
+ var sign = '';
2246
+ var result = '0';
2247
+ var e, z, j, k;
2248
+
2249
+ // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation
2250
+ if (fractDigits < 0 || fractDigits > 20) throw new $RangeError('Incorrect fraction digits');
2251
+ // eslint-disable-next-line no-self-compare -- NaN check
2252
+ if (number !== number) return 'NaN';
2253
+ if (number <= -1e21 || number >= 1e21) return $String$1(number);
2254
+ if (number < 0) {
2255
+ sign = '-';
2256
+ number = -number;
2257
+ }
2258
+ if (number > 1e-21) {
2259
+ e = log(number * pow(2, 69, 1)) - 69;
2260
+ z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
2261
+ z *= 0x10000000000000;
2262
+ e = 52 - e;
2263
+ if (e > 0) {
2264
+ multiply(data, 0, z);
2265
+ j = fractDigits;
2266
+ while (j >= 7) {
2267
+ multiply(data, 1e7, 0);
2268
+ j -= 7;
2269
+ }
2270
+ multiply(data, pow(10, j, 1), 0);
2271
+ j = e - 1;
2272
+ while (j >= 23) {
2273
+ divide(data, 1 << 23);
2274
+ j -= 23;
2275
+ }
2276
+ divide(data, 1 << j);
2277
+ multiply(data, 1, 1);
2278
+ divide(data, 2);
2279
+ result = dataToString(data);
2280
+ } else {
2281
+ multiply(data, 0, z);
2282
+ multiply(data, 1 << -e, 0);
2283
+ result = dataToString(data) + repeat('0', fractDigits);
2284
+ }
2285
+ }
2286
+ if (fractDigits > 0) {
2287
+ k = result.length;
2288
+ result = sign + (k <= fractDigits
2289
+ ? '0.' + repeat('0', fractDigits - k) + result
2290
+ : stringSlice(result, 0, k - fractDigits) + '.' + stringSlice(result, k - fractDigits));
2291
+ } else {
2292
+ result = sign + result;
2293
+ } return result;
2294
+ }
2295
+ });
2296
+
2297
+ // a string of all valid unicode whitespaces
2298
+ var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
2299
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
2300
+
2301
+ var uncurryThis$1 = functionUncurryThis;
2302
+ var requireObjectCoercible$1 = requireObjectCoercible$8;
2303
+ var toString$1 = toString$7;
2304
+ var whitespaces$1 = whitespaces$2;
2305
+
2306
+ var replace = uncurryThis$1(''.replace);
2307
+ var ltrim = RegExp('^[' + whitespaces$1 + ']+');
2308
+ var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
2309
+
2310
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
2311
+ var createMethod = function (TYPE) {
2312
+ return function ($this) {
2313
+ var string = toString$1(requireObjectCoercible$1($this));
2314
+ if (TYPE & 1) string = replace(string, ltrim, '');
2315
+ if (TYPE & 2) string = replace(string, rtrim, '$1');
2316
+ return string;
2317
+ };
2318
+ };
2319
+
2320
+ var stringTrim = {
2321
+ // `String.prototype.{ trimLeft, trimStart }` methods
2322
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
2323
+ start: createMethod(1),
2324
+ // `String.prototype.{ trimRight, trimEnd }` methods
2325
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
2326
+ end: createMethod(2),
2327
+ // `String.prototype.trim` method
2328
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
2329
+ trim: createMethod(3)
2330
+ };
2331
+
2332
+ var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
2333
+ var fails$2 = fails$l;
2334
+ var whitespaces = whitespaces$2;
2335
+
2336
+ var non = '\u200B\u0085\u180E';
2337
+
2338
+ // check that a method works with the correct list
2339
+ // of whitespaces and has a correct name
2340
+ var stringTrimForced = function (METHOD_NAME) {
2341
+ return fails$2(function () {
2342
+ return !!whitespaces[METHOD_NAME]()
2343
+ || non[METHOD_NAME]() !== non
2344
+ || (PROPER_FUNCTION_NAME$1 && whitespaces[METHOD_NAME].name !== METHOD_NAME);
2345
+ });
2346
+ };
2347
+
2348
+ var $$1 = _export;
2349
+ var $trim = stringTrim.trim;
2350
+ var forcedStringTrimMethod = stringTrimForced;
2351
+
2352
+ // `String.prototype.trim` method
2353
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
2354
+ $$1({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
2355
+ trim: function trim() {
2356
+ return $trim(this);
2357
+ }
2358
+ });
2359
+
2360
+ var splitNameAndSizeFromFullName = function splitNameAndSizeFromFullName(fullName) {
2361
+ var _fullName$split = fullName.split('-'),
2362
+ _fullName$split2 = _slicedToArray(_fullName$split, 2),
2363
+ name = _fullName$split2[0],
2364
+ size = _fullName$split2[1];
2365
+ return {
2366
+ name: name.trim(),
2367
+ size: size ? size.trim() : ''
2368
+ };
2369
+ };
2370
+ var getColorAndSizeFromSkuName = function getColorAndSizeFromSkuName(skuName) {
2371
+ if (!skuName) {
2372
+ return {};
2373
+ }
2374
+ var _skuName$split = skuName.split('-'),
2375
+ _skuName$split2 = _slicedToArray(_skuName$split, 2),
2376
+ color = _skuName$split2[0],
2377
+ size = _skuName$split2[1];
2378
+ return {
2379
+ color: color === null || color === void 0 ? void 0 : color.trim(),
2380
+ size: size === null || size === void 0 ? void 0 : size.trim()
2381
+ };
2382
+ };
2383
+
2384
+ var pushDatalayer = function pushDatalayer(_ref) {
2385
+ var event = _ref.event,
2386
+ data = _ref.data;
2387
+ var dataLayer = (window === null || window === void 0 ? void 0 : window.dataLayer) || [];
2388
+ if (data.ecommerce) {
2389
+ dataLayer.push({
2390
+ ecommerce: null
2391
+ });
2392
+ }
2393
+ dataLayer.push(Object.assign(Object.assign({}, event && {
2394
+ event: "custom_".concat(event)
2395
+ }), data));
2396
+ };
2397
+ var eventsFunctions = {
2398
+ productEvents: function productEvents(props, callBack) {
2399
+ var event = props.event,
2400
+ commonData = props.commonData,
2401
+ customData = props.customData,
2402
+ promotionInfo = props.promotionInfo,
2403
+ itemList = props.itemList,
2404
+ outsideEcommerceData = props.outsideEcommerceData;
2405
+ var availableSizes = commonData.availableSizes,
2406
+ sizes = commonData.sizes,
2407
+ price = commonData.price;
2408
+ var customEcommerceData = Object.assign(Object.assign({}, event === 'view_item' ? {
2409
+ currency: eventsFunctions.configs.currency,
2410
+ value: price,
2411
+ grade_disponivel: availableSizes !== null && availableSizes !== void 0 ? availableSizes : sizes ? getAvailablesSizes(sizes) : ''
2412
+ } : {}), event === 'add_to_wishlist' || event === 'remove_from_wishlist' ? {
2413
+ value: price,
2414
+ currency: eventsFunctions.configs.currency
2415
+ } : {});
2416
+ var itemData = mountItemData({
2417
+ data: commonData,
2418
+ customData: Object.assign(Object.assign(Object.assign({}, customData), itemList), promotionInfo)
2419
+ });
2420
+ pushDatalayer({
2421
+ event: event,
2422
+ data: Object.assign(Object.assign({}, outsideEcommerceData), {
2423
+ ecommerce: Object.assign(Object.assign(Object.assign({}, itemList), customEcommerceData), {
2424
+ items: [itemData]
2425
+ })
2426
+ })
2427
+ });
2428
+ if (typeof callBack === 'function') {
2429
+ callBack(itemData, customEcommerceData);
2430
+ }
2431
+ },
2432
+ productListEvent: function productListEvent(props) {
2433
+ var products = props.commonData.products,
2434
+ promotionInfo = props.promotionInfo,
2435
+ itemList = props.itemList,
2436
+ outsideEcommerceData = props.outsideEcommerceData,
2437
+ customData = props.customData;
2438
+ var items = products.map(function (_ref2, index) {
2439
+ var node = _ref2.node;
2440
+ return mountItemData({
2441
+ data: Object.assign({}, node),
2442
+ customData: Object.assign(Object.assign(Object.assign({}, promotionInfo), {
2443
+ index: index
2444
+ }), (customData === null || customData === void 0 ? void 0 : customData.item_list_name) ? {
2445
+ item_list_name: customData === null || customData === void 0 ? void 0 : customData.item_list_name
2446
+ } : itemList)
2447
+ });
2448
+ });
2449
+ pushDatalayer({
2450
+ event: 'view_item_list',
2451
+ data: Object.assign(Object.assign({}, outsideEcommerceData), {
2452
+ ecommerce: Object.assign(Object.assign({}, (customData === null || customData === void 0 ? void 0 : customData.item_list_name) ? {
2453
+ item_list_name: customData === null || customData === void 0 ? void 0 : customData.item_list_name
2454
+ } : itemList), {
2455
+ items: items
2456
+ })
2457
+ })
2458
+ });
2459
+ },
2460
+ skuEvents: function skuEvents(props) {
2461
+ var event = props.event,
2462
+ products = props.commonData.products,
2463
+ customData = props.customData,
2464
+ _props$supportData = props.supportData,
2465
+ selectedSkus = _props$supportData.selectedSkus,
2466
+ price = _props$supportData.price,
2467
+ promotionInfo = props.promotionInfo,
2468
+ itemList = props.itemList,
2469
+ outsideEcommerceData = props.outsideEcommerceData;
2470
+ var totalPrice = 0;
2471
+ var items = products.map(function (product) {
2472
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
2473
+ var selectedSku = selectedSkus === null || selectedSkus === void 0 ? void 0 : selectedSkus.find(function (selected) {
2474
+ var _a;
2475
+ return ((_a = product.productId) !== null && _a !== void 0 ? _a : product.id) === selected.productId;
2476
+ });
2477
+ var skuPersistedData = Object.assign(Object.assign({}, promotionInfo), itemList);
2478
+ if (selectedSku) {
2479
+ var persistedData = getPersistedData();
2480
+ var lastSkuPersistedData = findDataInPersistedData(persistedData, selectedSku);
2481
+ if (lastSkuPersistedData) {
2482
+ skuPersistedData = Object.assign(Object.assign({}, skuPersistedData), lastSkuPersistedData);
2483
+ }
2484
+ if (event === 'add_to_cart' && (promotionInfo || itemList)) {
2485
+ updatePersistedData({
2486
+ persistedData: persistedData,
2487
+ type: 'add',
2488
+ sku: (_a = selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.id) !== null && _a !== void 0 ? _a : selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.sku,
2489
+ newData: {
2490
+ promotionInfo: promotionInfo,
2491
+ itemList: itemList
2492
+ }
2493
+ });
2494
+ }
2495
+ if (event === 'remove_from_cart') {
2496
+ updatePersistedData({
2497
+ persistedData: persistedData,
2498
+ type: 'remove',
2499
+ sku: (_b = selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.id) !== null && _b !== void 0 ? _b : selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.sku
2500
+ });
2501
+ }
2502
+ }
2503
+ totalPrice += (_g = (_c = product.price) !== null && _c !== void 0 ? _c : (_f = (_e = (_d = selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.offers) === null || _d === void 0 ? void 0 : _d.offers) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.price) !== null && _g !== void 0 ? _g : 0;
2504
+ var size = (_h = selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.size) !== null && _h !== void 0 ? _h : getColorAndSizeFromSkuName((_k = (_j = selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.skuName) !== null && _j !== void 0 ? _j : selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.name) !== null && _k !== void 0 ? _k : (_l = product.itemOffered) === null || _l === void 0 ? void 0 : _l.skuName).size;
2505
+ return mountItemData({
2506
+ data: product,
2507
+ customData: Object.assign(Object.assign(Object.assign({}, customData), skuPersistedData !== null && skuPersistedData !== void 0 ? skuPersistedData : Object.assign(Object.assign({}, promotionInfo), itemList)), {
2508
+ item_sku: (_o = (_m = selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.id) !== null && _m !== void 0 ? _m : selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.sku) !== null && _o !== void 0 ? _o : (_p = product.itemOffered) === null || _p === void 0 ? void 0 : _p.sku,
2509
+ quantity: (_r = (_q = customData === null || customData === void 0 ? void 0 : customData.quantity) !== null && _q !== void 0 ? _q : product.quantity) !== null && _r !== void 0 ? _r : 1,
2510
+ item_variant2: size,
2511
+ seller_id: (_y = (_t = (_s = selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.sellerId) !== null && _s !== void 0 ? _s : selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.seller) !== null && _t !== void 0 ? _t : (_x = (_w = (_v = (_u = selectedSku === null || selectedSku === void 0 ? void 0 : selectedSku.offers) === null || _u === void 0 ? void 0 : _u.offers) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.seller) === null || _x === void 0 ? void 0 : _x.identifier) !== null && _y !== void 0 ? _y : product.seller
2512
+ })
2513
+ });
2514
+ });
2515
+ pushDatalayer({
2516
+ event: event,
2517
+ data: Object.assign(Object.assign({}, outsideEcommerceData), {
2518
+ ecommerce: {
2519
+ value: price !== null && price !== void 0 ? price : totalPrice,
2520
+ currency: eventsFunctions.configs.currency,
2521
+ items: items
2522
+ }
2523
+ })
2524
+ });
2525
+ },
2526
+ filterEvent: function filterEvent(props) {
2527
+ var _a;
2528
+ var commonData = props.commonData,
2529
+ customData = props.customData,
2530
+ outsideEcommerceData = props.outsideEcommerceData;
2531
+ var filterMap = {};
2532
+ var eventData = {};
2533
+ if (Array.isArray(commonData === null || commonData === void 0 ? void 0 : commonData.selectedFacets) && ((_a = commonData === null || commonData === void 0 ? void 0 : commonData.selectedFacets) === null || _a === void 0 ? void 0 : _a.length)) {
2534
+ /**
2535
+ * TODO: utilizar tipagem SelectedFacet
2536
+ */
2537
+ // (commonData?.selectedFacets as SelectedFacet[]).forEach(
2538
+ (commonData === null || commonData === void 0 ? void 0 : commonData.selectedFacets).forEach(function (_ref3) {
2539
+ var key = _ref3.key,
2540
+ value = _ref3.value;
2541
+ var _a, _b;
2542
+ var mapKey = (_b = (_a = eventsFunctions.configs.PLP_FILTERS.find(function (filter) {
2543
+ return filter.key === key;
2544
+ })) === null || _a === void 0 ? void 0 : _a.eventLabel) !== null && _b !== void 0 ? _b : key;
2545
+ var filterItem = (filterMap === null || filterMap === void 0 ? void 0 : filterMap[mapKey]) || [];
2546
+ if (mapKey === 'price_range') {
2547
+ value.replace(':', '-');
2548
+ }
2549
+ filterMap[mapKey] = [].concat(_toConsumableArray(filterItem), [value]);
2550
+ });
2551
+ Object.keys(filterMap).forEach(function (key) {
2552
+ return eventData[key] = filterMap[key].join(', ');
2553
+ });
2554
+ }
2555
+ pushDatalayer({
2556
+ event: 'filter',
2557
+ data: Object.assign(Object.assign(Object.assign({}, outsideEcommerceData), eventData), customData)
2558
+ });
2559
+ },
2560
+ viewCartEvent: function viewCartEvent(props) {
2561
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
2562
+ var commonData = props.commonData,
2563
+ outsideEcommerceData = props.outsideEcommerceData;
2564
+ /**
2565
+ * TODO: utilizar tipagem CartStore
2566
+ */
2567
+ // const { cartStore }: { cartStore: CartStore } = commonData
2568
+ var cartStore = commonData.cartStore;
2569
+ if (!cartStore) {
2570
+ return;
2571
+ }
2572
+ var persistedData = window.localStorage.getItem('persistedCartEventsData');
2573
+ var parsedPersistedData = persistedData ? JSON.parse(persistedData) : {};
2574
+ var items = cartStore.items.map(function (item) {
2575
+ var _a, _b, _c;
2576
+ var _ref4 = (_a = parsedPersistedData[item.id]) !== null && _a !== void 0 ? _a : {},
2577
+ promotionInfo = _ref4.promotionInfo,
2578
+ itemList = _ref4.itemList;
2579
+ return mountItemData({
2580
+ data: Object.assign(Object.assign({}, item), {
2581
+ price: item.price / 100,
2582
+ listPrice: item.listPrice / 100
2583
+ }),
2584
+ customData: Object.assign(Object.assign(Object.assign({}, promotionInfo), itemList), {
2585
+ item_sku: (_b = item.id) !== null && _b !== void 0 ? _b : item.itemOffered.sku,
2586
+ quantity: (_c = item.quantity) !== null && _c !== void 0 ? _c : 1
2587
+ })
2588
+ });
2589
+ });
2590
+ var subtotal = ((_b = (_a = cartStore.totalizers.find(function (total) {
2591
+ return total.name === 'Total dos Itens';
2592
+ })) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0) / 100;
2593
+ var discountTotal = ((_d = (_c = cartStore.totalizers.find(function (total) {
2594
+ return total.name === 'Total dos Descontos';
2595
+ })) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : 0) / 100;
2596
+ var seller_coupon_name = ((_e = cartStore.marketingData) === null || _e === void 0 ? void 0 : _e.utmiCampaign) === 'codigodavendedora' ? (_f = cartStore.marketingData) === null || _f === void 0 ? void 0 : _f.utmCampaign : (_h = String((_g = cartStore.openTextField) === null || _g === void 0 ? void 0 : _g.value)) === null || _h === void 0 ? void 0 : _h.split(' - ')[0];
2597
+ pushDatalayer({
2598
+ event: 'view_cart',
2599
+ data: Object.assign(Object.assign({}, outsideEcommerceData), {
2600
+ ecommerce: Object.assign(Object.assign(Object.assign({
2601
+ currency: eventsFunctions.configs.currency,
2602
+ value: subtotal + discountTotal,
2603
+ total_discount: Math.abs(discountTotal),
2604
+ cep_preenchido: !!((_k = (_j = cartStore.shippingData) === null || _j === void 0 ? void 0 : _j.address) === null || _k === void 0 ? void 0 : _k.postalCode)
2605
+ }, seller_coupon_name ? {
2606
+ seller_coupon_name: seller_coupon_name
2607
+ } : {}), ((_l = cartStore.marketingData) === null || _l === void 0 ? void 0 : _l.coupon) && {
2608
+ sale_coupon_name: (_m = cartStore.marketingData) === null || _m === void 0 ? void 0 : _m.coupon
2609
+ }), {
2610
+ subtotal: subtotal,
2611
+ items: items
2612
+ })
2613
+ })
2614
+ });
2615
+ },
2616
+ readyEvents: function readyEvents(props) {
2617
+ var event = props.event,
2618
+ readyData = props.readyData;
2619
+ pushDatalayer({
2620
+ event: event,
2621
+ data: Object.assign({}, readyData)
2622
+ });
2623
+ },
2624
+ configs: {
2625
+ PLP_FILTERS: [{
2626
+ key: '',
2627
+ label: '',
2628
+ eventLabel: '',
2629
+ order: 0
2630
+ }],
2631
+ currency: 'BRL',
2632
+ categoryOff: 'bazar',
2633
+ storeUrl: 'https://www.example.com'
2634
+ }
2635
+ };
2636
+ /**
2637
+ * TODO: utilizar tipagem SizeInfoType
2638
+ */
2639
+ // export const getAvailablesSizes = (sizes: SizeInfoType[]) => {
2640
+ var getAvailablesSizes = function getAvailablesSizes(sizes) {
2641
+ return sizes.reduce(function (acc, curr) {
2642
+ if (curr.available) {
2643
+ acc.push(curr.value);
2644
+ }
2645
+ return acc;
2646
+ }, []).toString(); // Tamanhos disponíveis
2647
+ };
2648
+ var getCategories = function getCategories(breadcrumbList) {
2649
+ var breadcrumbLength = breadcrumbList.length;
2650
+ return Object.assign({}, breadcrumbList && breadcrumbList.length > 0 ? Object.assign(Object.assign({
2651
+ item_category: breadcrumbList[0].includes(eventsFunctions.configs.categoryOff) ? 'Bazar' : 'Coleção'
2652
+ }, breadcrumbList[1] ? {
2653
+ item_category2: breadcrumbList[1]
2654
+ } : {}), breadcrumbLength > 2 ? {
2655
+ item_category3: breadcrumbList[breadcrumbLength - 1]
2656
+ } : {}) : {});
2657
+ };
2658
+ var mountItemData = function mountItemData(_ref5) {
2659
+ var data = _ref5.data,
2660
+ customData = _ref5.customData;
2661
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getItemGeneralInfo(data)), getItemCategories(data)), getItemVariants(data)), getItemPriceInfos(data)), customData);
2662
+ };
2663
+ var getProductListInfoFromHead = function getProductListInfoFromHead() {
2664
+ var _a, _b, _c;
2665
+ return document ? (_c = (_b = (_a = document.head.querySelector('meta[name="category"]')) === null || _a === void 0 ? void 0 : _a.getAttribute('content')) === null || _b === void 0 ? void 0 : _b.split('_')) !== null && _c !== void 0 ? _c : [] : [];
2666
+ };
2667
+ // itemList e promotionInfo são informações persistidas durante a navegação atual,
2668
+ // mas no caso do minicart essas informações persistir entre sessões e mudança de navegação
2669
+ // devido a isso o dado é persistido através do localStorage
2670
+ var getPersistedData = function getPersistedData() {
2671
+ var persistedData = window.localStorage.getItem('persistedCartEventsData');
2672
+ if (!persistedData) {
2673
+ return null;
2674
+ }
2675
+ return JSON.parse(persistedData);
2676
+ };
2677
+ var findDataInPersistedData = function findDataInPersistedData(persistedData, sku) {
2678
+ return persistedData === null || persistedData === void 0 ? void 0 : persistedData[sku];
2679
+ };
2680
+ var updatePersistedData = function updatePersistedData(_ref6) {
2681
+ var persistedData = _ref6.persistedData,
2682
+ type = _ref6.type,
2683
+ sku = _ref6.sku,
2684
+ newData = _ref6.newData;
2685
+ if (!persistedData && type === 'add') {
2686
+ window.localStorage.setItem('persistedCartEventsData', JSON.stringify(_defineProperty({}, sku, newData)));
2687
+ return;
2688
+ }
2689
+ if (persistedData && type === 'add') {
2690
+ window.localStorage.setItem('persistedCartEventsData', JSON.stringify(Object.assign(Object.assign({}, persistedData), _defineProperty({}, sku, newData))));
2691
+ return;
2692
+ }
2693
+ if (persistedData && type === 'remove') {
2694
+ delete persistedData[sku];
2695
+ window.localStorage.setItem('persistedCartEventsData', JSON.stringify(persistedData));
2696
+ }
2697
+ };
2698
+ var getItemGeneralInfo = function getItemGeneralInfo(data) {
2699
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
2700
+ var productRef = (_b = (_a = data.productReference) !== null && _a !== void 0 ? _a : data.gtin) !== null && _b !== void 0 ? _b : data.productRefId;
2701
+ var images = (_f = (_c = data.image) !== null && _c !== void 0 ? _c : (_e = (_d = data.items) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.images) !== null && _f !== void 0 ? _f : (_g = data.itemOffered) === null || _g === void 0 ? void 0 : _g.image;
2702
+ var image = images === null || images === void 0 ? void 0 : images.find(function (img) {
2703
+ return img.alternateName === '1' || img.imageLabel === '1' || img.keywords === '1';
2704
+ });
2705
+ return {
2706
+ item_id: (_m = (_k = (_h = data.productId) !== null && _h !== void 0 ? _h : (_j = data.isVariantOf) === null || _j === void 0 ? void 0 : _j.productGroupID) !== null && _k !== void 0 ? _k : (_l = data.isVariationOf) === null || _l === void 0 ? void 0 : _l.productGroupID) !== null && _m !== void 0 ? _m : (_p = (_o = data.itemOffered) === null || _o === void 0 ? void 0 : _o.isVariationOf) === null || _p === void 0 ? void 0 : _p.productGroupID,
2707
+ item_ref: /_\d$/.test(productRef) ? productRef.slice(0, -2) : productRef,
2708
+ item_name: (_s = (_r = (_q = data.productTitle) !== null && _q !== void 0 ? _q : data.productName) !== null && _r !== void 0 ? _r : data.name) !== null && _s !== void 0 ? _s : splitNameAndSizeFromFullName((_t = data.itemOffered) === null || _t === void 0 ? void 0 : _t.name).name,
2709
+ item_brand: (_y = (_x = (_v = (_u = data.brand) === null || _u === void 0 ? void 0 : _u.brandName) !== null && _v !== void 0 ? _v : (_w = data.brand) === null || _w === void 0 ? void 0 : _w.name) !== null && _x !== void 0 ? _x : data.brand) !== null && _y !== void 0 ? _y : (_z = data.itemOffered) === null || _z === void 0 ? void 0 : _z.brand.name,
2710
+ item_url: "".concat(eventsFunctions.configs.storeUrl).concat(data.linkText, "/p"),
2711
+ item_image: (_0 = image === null || image === void 0 ? void 0 : image.url) !== null && _0 !== void 0 ? _0 : image === null || image === void 0 ? void 0 : image.imageUrl
2712
+ };
2713
+ };
2714
+ var getMostCompletedStringFromArray = function getMostCompletedStringFromArray(arr) {
2715
+ if (Array.isArray(arr)) {
2716
+ return arr.reduce(function (acc, curr) {
2717
+ if (curr.length > acc.length) {
2718
+ acc = curr;
2719
+ }
2720
+ return acc;
2721
+ }, '');
2722
+ }
2723
+ return arr;
2724
+ };
2725
+ var getItemCategories = function getItemCategories(data) {
2726
+ var _a, _b;
2727
+ var categories = data.categories,
2728
+ categoriesIds = data.categoriesIds;
2729
+ var categoriesValidated = categories !== null && categories !== void 0 ? categories : (_a = data.itemOffered) === null || _a === void 0 ? void 0 : _a.categories;
2730
+ var categoriesIdsValidated = categoriesIds !== null && categoriesIds !== void 0 ? categoriesIds : (_b = data.itemOffered) === null || _b === void 0 ? void 0 : _b.categoriesIds;
2731
+ var categoriesCompletedString = getMostCompletedStringFromArray(categoriesValidated);
2732
+ var categoriesIdsCompletedString = getMostCompletedStringFromArray(categoriesIdsValidated);
2733
+ //vtex sempre manda com "/" no começo e no fim, por isso o slice(1,-1)
2734
+ var categoriesArr = categoriesCompletedString.slice(1, -1).split('/');
2735
+ var categoriesIdsArr = categoriesIdsCompletedString.slice(1, -1).split('/');
2736
+ return Object.assign(Object.assign(Object.assign(Object.assign({
2737
+ item_category: categoriesArr[0].toLowerCase().includes(eventsFunctions.configs.categoryOff) ? 'Bazar' : 'Coleção'
2738
+ }, categoriesArr[1] && {
2739
+ item_category2: categoriesArr[1]
2740
+ }), categoriesArr.length > 2 && {
2741
+ item_category3: categoriesArr[categoriesArr.length - 1]
2742
+ }), {
2743
+ item_category_id: categoriesIdsArr[categoriesIdsArr.length - 1]
2744
+ }), categoriesIdsArr.length > 1 && {
2745
+ item_parent_category_id: categoriesIdsArr[categoriesIdsArr.length - 2]
2746
+ });
2747
+ };
2748
+ var getItemVariants = function getItemVariants(data) {
2749
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2750
+ var name = (_f = (_b = (_a = data.itemOffered) === null || _a === void 0 ? void 0 : _a.skuName) !== null && _b !== void 0 ? _b : (_e = (_d = (_c = data.isVariantOf) === null || _c === void 0 ? void 0 : _c.hasVariant) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.name) !== null && _f !== void 0 ? _f : (_h = (_g = data.items) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.name;
2751
+ var _getColorAndSizeFromS = getColorAndSizeFromSkuName(name),
2752
+ color = _getColorAndSizeFromS.color,
2753
+ size = _getColorAndSizeFromS.size;
2754
+ /**
2755
+ * TODO: item_variant3: embalagem presente
2756
+ */
2757
+ return Object.assign({
2758
+ item_variant: color
2759
+ }, data.itemOffered && {
2760
+ item_variant2: size
2761
+ });
2762
+ };
2763
+ var getItemPriceInfos = function getItemPriceInfos(data) {
2764
+ var _a, _b, _c, _d;
2765
+ var price = data.price,
2766
+ listPrice = data.listPrice,
2767
+ installments = data.installments;
2768
+ var priceValidated = (_b = price !== null && price !== void 0 ? price : (_a = data.offers) === null || _a === void 0 ? void 0 : _a.lowPrice) !== null && _b !== void 0 ? _b : 0;
2769
+ var listPriceValidated = (_d = listPrice !== null && listPrice !== void 0 ? listPrice : (_c = data.offers) === null || _c === void 0 ? void 0 : _c.highPrice) !== null && _d !== void 0 ? _d : 0;
2770
+ var discount = listPriceValidated ? listPriceValidated - priceValidated : 0;
2771
+ var discountFormatted = discount % 1 === 0 ? discount : Number(discount.toFixed(2));
2772
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, price && {
2773
+ price: priceValidated !== null && priceValidated !== void 0 ? priceValidated : listPriceValidated
2774
+ }), listPriceValidated && {
2775
+ list_price: listPriceValidated,
2776
+ discount: discountFormatted
2777
+ }), installments && {
2778
+ installments: installments === null || installments === void 0 ? void 0 : installments.count,
2779
+ installment_value: installments === null || installments === void 0 ? void 0 : installments.value
2780
+ }), {
2781
+ item_currency: eventsFunctions.configs.currency
2782
+ });
2783
+ };
2784
+
2785
+ var EventContext = /*#__PURE__*/createContext({});
2786
+ var EventProvider = function EventProvider(_ref) {
2787
+ var children = _ref.children,
2788
+ evtFunctionsConfigs = _ref.evtFunctionsConfigs;
2789
+ var promotionEventRef = useRef({});
2790
+ var currentLocalRef = useRef(null);
2791
+ var itemListRef = useRef(null);
2792
+ var cartProductsFullDataRef = useRef({});
2793
+ //recurso técnico para caso ocorra click nos similars do product card, como cada similar não tem a info completa
2794
+ //para montar os dados do produto é necessário disparar o evento de select_item na PDP
2795
+ //obs: caso o usuário abra em uma nova aba essa lógica não funcionará (mas acho que é melhor do que armazenar todas as infos de cada similar pra cada produto)
2796
+ var triggerSelectItemEventRef = useRef({
2797
+ trigger: false,
2798
+ index: 0
2799
+ });
2800
+ var sendDataLayerEvent = function sendDataLayerEvent(_ref2) {
2801
+ var functionKey = _ref2.functionKey,
2802
+ data = _ref2.data,
2803
+ callBack = _ref2.callBack,
2804
+ _ref2$timeout = _ref2.timeout,
2805
+ timeout = _ref2$timeout === void 0 ? 100 : _ref2$timeout;
2806
+ var _a;
2807
+ if (!window.dataLayer) {
2808
+ window.dataLayer = [];
2809
+ }
2810
+ eventsFunctions.configs = evtFunctionsConfigs;
2811
+ try {
2812
+ if (typeof eventsFunctions[functionKey] === 'function') {
2813
+ setTimeout(function () {
2814
+ var _a;
2815
+ data.promotionInfo = promotionEventRef.current;
2816
+ if ((_a = itemListRef.current) === null || _a === void 0 ? void 0 : _a.item_list_name) {
2817
+ data.itemList = itemListRef.current;
2818
+ }
2819
+ eventsFunctions[functionKey](data, callBack);
2820
+ }, timeout);
2821
+ }
2822
+ } catch (error) {
2823
+ pushDatalayer({
2824
+ event: 'error_event',
2825
+ data: {
2826
+ error_message: (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error
2827
+ }
2828
+ });
2829
+ }
2830
+ };
2831
+ var handleSelectContent = function handleSelectContent(_ref3) {
2832
+ var content = _ref3.content;
2833
+ sendDataLayerEvent({
2834
+ functionKey: 'readyEvents',
2835
+ data: {
2836
+ event: 'select_content',
2837
+ readyData: {
2838
+ content_type: content.replace('::', ':')
2839
+ }
2840
+ }
2841
+ });
2842
+ };
2843
+ var handleSelectPromotionEvent = function handleSelectPromotionEvent(_ref4) {
2844
+ var updatePromotionRef = _ref4.updatePromotionRef,
2845
+ promotion = _ref4.promotion,
2846
+ index = _ref4.index;
2847
+ if (updatePromotionRef) {
2848
+ promotionEventRef.current = Object.assign({}, promotion);
2849
+ }
2850
+ sendDataLayerEvent({
2851
+ functionKey: 'readyEvents',
2852
+ data: {
2853
+ event: 'select_promotion',
2854
+ readyData: {
2855
+ ecommerce: Object.assign(Object.assign({}, promotion), index !== undefined && {
2856
+ index: index
2857
+ })
2858
+ }
2859
+ }
2860
+ });
2861
+ };
2862
+ return jsx(EventContext.Provider, {
2863
+ value: {
2864
+ sendDataLayerEvent: sendDataLayerEvent,
2865
+ triggerSelectItemEventRef: triggerSelectItemEventRef,
2866
+ promotionEventRef: promotionEventRef,
2867
+ currentLocalRef: currentLocalRef,
2868
+ itemListRef: itemListRef,
2869
+ cartProductsFullDataRef: cartProductsFullDataRef,
2870
+ handleSelectContent: handleSelectContent,
2871
+ handleSelectPromotionEvent: handleSelectPromotionEvent
2872
+ },
2873
+ children: children
2874
+ });
2875
+ };
2876
+ var useEventContext = function useEventContext() {
2877
+ return useContext(EventContext);
2878
+ };
2879
+
2880
+ var call$1 = functionCall;
2881
+ var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
2882
+ var anObject$1 = anObject$a;
2883
+ var isNullOrUndefined = isNullOrUndefined$4;
2884
+ var toLength = toLength$3;
2885
+ var toString = toString$7;
2886
+ var requireObjectCoercible = requireObjectCoercible$8;
2887
+ var getMethod = getMethod$3;
2888
+ var advanceStringIndex = advanceStringIndex$2;
2889
+ var regExpExec = regexpExecAbstract;
2890
+
2891
+ // @@match logic
2892
+ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
2893
+ return [
2894
+ // `String.prototype.match` method
2895
+ // https://tc39.es/ecma262/#sec-string.prototype.match
2896
+ function match(regexp) {
2897
+ var O = requireObjectCoercible(this);
2898
+ var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
2899
+ return matcher ? call$1(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
2900
+ },
2901
+ // `RegExp.prototype[@@match]` method
2902
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
2903
+ function (string) {
2904
+ var rx = anObject$1(this);
2905
+ var S = toString(string);
2906
+ var res = maybeCallNative(nativeMatch, rx, S);
2907
+
2908
+ if (res.done) return res.value;
2909
+
2910
+ if (!rx.global) return regExpExec(rx, S);
2911
+
2912
+ var fullUnicode = rx.unicode;
2913
+ rx.lastIndex = 0;
2914
+ var A = [];
2915
+ var n = 0;
2916
+ var result;
2917
+ while ((result = regExpExec(rx, S)) !== null) {
2918
+ var matchStr = toString(result[0]);
2919
+ A[n] = matchStr;
2920
+ if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2921
+ n++;
2922
+ }
2923
+ return n === 0 ? null : A;
2924
+ }
2925
+ ];
2926
+ });
2927
+
2928
+ var resizingImg = function resizingImg(url, imageResize) {
2929
+ var regex = /\/ids\/(\d+)\//;
2930
+ var match = url.match(regex);
2931
+ if (match) {
2932
+ return url.replace("/".concat(match[1], "/"), "/".concat(match[1], "-").concat(imageResize.width, "-").concat(imageResize.height, "/"));
2933
+ }
2934
+ return url;
2935
+ };
2936
+ var updatedResizedImg = function updatedResizedImg(url, imageResize) {
2937
+ var regex = /\/ids\/(\d+)-(\d+)-(\d+)\//;
2938
+ var match = url.match(regex);
2939
+ if (match) {
2940
+ return url.replace("/".concat(match[1], "-").concat(match[2], "-").concat(match[3], "/"), "/".concat(match[1], "-").concat(imageResize.width, "-").concat(imageResize.height, "/"));
2941
+ }
2942
+ return url;
2943
+ };
2944
+
2945
+ var formatPriceToCurrency = function formatPriceToCurrency(value) {
2946
+ var hasDecimal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2947
+ var IntlCurrency = Intl.NumberFormat('pt-BR', {
2948
+ style: 'currency',
2949
+ currency: 'BRL',
2950
+ minimumFractionDigits: hasDecimal ? 2 : 0
2951
+ });
2952
+ return IntlCurrency.format(value);
2953
+ };
2954
+
2955
+ var getSkuInfos = function getSkuInfos(items) {
2956
+ var pricesInfos = {
2957
+ price: 0,
2958
+ listPrice: 0,
2959
+ installments: {
2960
+ count: 0,
2961
+ value: 0
2962
+ }
2963
+ };
2964
+ var setInfos = function setInfos(seller, sizeInfo) {
2965
+ var _a;
2966
+ if (sizeInfo) {
2967
+ sizeInfo.sellerId = seller.sellerId;
2968
+ sizeInfo.sellerName = seller.sellerName;
2969
+ sizeInfo.available = true;
2970
+ sizeInfo.isSellerDefault = seller.sellerDefault;
2971
+ }
2972
+ var _seller$commertialOff = seller.commertialOffer,
2973
+ Price = _seller$commertialOff.Price,
2974
+ ListPrice = _seller$commertialOff.ListPrice,
2975
+ installmentOptions = _seller$commertialOff.PaymentOptions.installmentOptions;
2976
+ pricesInfos.price = Price;
2977
+ pricesInfos.listPrice = ListPrice;
2978
+ var installments = (_a = installmentOptions === null || installmentOptions === void 0 ? void 0 : installmentOptions[0]) === null || _a === void 0 ? void 0 : _a.installments;
2979
+ if (installments) {
2980
+ var _installments = installments[installments.length - 1],
2981
+ count = _installments.count,
2982
+ value = _installments.value;
2983
+ pricesInfos.installments = {
2984
+ count: count,
2985
+ value: value / 100
2986
+ };
2987
+ }
2988
+ };
2989
+ var allSizesAvailable = true;
2990
+ var sizes = items.reduce(function (acc, curr) {
2991
+ var _a, _b, _c;
2992
+ var sizeInfo = {
2993
+ name: curr.name,
2994
+ sku: curr.itemId,
2995
+ value: (_b = (_a = curr.Tamanho) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : splitNameAndSizeFromFullName((_c = curr.nameComplete) !== null && _c !== void 0 ? _c : curr.name).size,
2996
+ available: false,
2997
+ sellerId: '',
2998
+ sellerName: '',
2999
+ isSellerDefault: false
3000
+ };
3001
+ var availableSellers = curr.sellers.filter(function (seller) {
3002
+ if (seller.sellerDefault && seller.commertialOffer.IsAvailable) {
3003
+ //priorizar sempre o seller default quando houver estoque
3004
+ sizeInfo.available = true;
3005
+ setInfos(seller, sizeInfo);
3006
+ }
3007
+ return seller.commertialOffer.IsAvailable;
3008
+ });
3009
+ if (!sizeInfo.isSellerDefault && availableSellers.length > 0) {
3010
+ //caso o seller default não foi previamente selecionado, será selecionado o primeiro seller disponível
3011
+ sizeInfo.available = true;
3012
+ setInfos(availableSellers[0], Object.assign(Object.assign({}, sizeInfo), {
3013
+ sellerId: availableSellers[0].sellerId,
3014
+ sellerName: availableSellers[0].sellerName
3015
+ }));
3016
+ }
3017
+ if (sizeInfo.available === false) {
3018
+ allSizesAvailable = false;
3019
+ }
3020
+ acc.push(sizeInfo);
3021
+ return acc;
3022
+ }, []);
3023
+ return Object.assign(Object.assign({}, pricesInfos), {
3024
+ sizes: sizes,
3025
+ allSizesAvailable: allSizesAvailable
3026
+ });
3027
+ };
3028
+
3029
+ var getThumbImage = function getThumbImage(images) {
3030
+ return images.find(function (image) {
3031
+ return image.imageLabel === '10';
3032
+ });
3033
+ };
3034
+
3035
+ var iterators = {};
3036
+
3037
+ var fails$1 = fails$l;
3038
+
3039
+ var correctPrototypeGetter = !fails$1(function () {
3040
+ function F() { /* empty */ }
3041
+ F.prototype.constructor = null;
3042
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
3043
+ return Object.getPrototypeOf(new F()) !== F.prototype;
3044
+ });
3045
+
3046
+ var hasOwn$1 = hasOwnProperty_1;
3047
+ var isCallable$2 = isCallable$g;
3048
+ var toObject = toObject$5;
3049
+ var sharedKey = sharedKey$3;
3050
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
3051
+
3052
+ var IE_PROTO = sharedKey('IE_PROTO');
3053
+ var $Object = Object;
3054
+ var ObjectPrototype = $Object.prototype;
3055
+
3056
+ // `Object.getPrototypeOf` method
3057
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
3058
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
3059
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
3060
+ var object = toObject(O);
3061
+ if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
3062
+ var constructor = object.constructor;
3063
+ if (isCallable$2(constructor) && object instanceof constructor) {
3064
+ return constructor.prototype;
3065
+ } return object instanceof $Object ? ObjectPrototype : null;
3066
+ };
3067
+
3068
+ var fails = fails$l;
3069
+ var isCallable$1 = isCallable$g;
3070
+ var isObject$1 = isObject$8;
3071
+ var getPrototypeOf$1 = objectGetPrototypeOf;
3072
+ var defineBuiltIn$1 = defineBuiltIn$5;
3073
+ var wellKnownSymbol$3 = wellKnownSymbol$c;
3074
+
3075
+ var ITERATOR$2 = wellKnownSymbol$3('iterator');
3076
+ var BUGGY_SAFARI_ITERATORS$1 = false;
3077
+
3078
+ // `%IteratorPrototype%` object
3079
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
3080
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
3081
+
3082
+ /* eslint-disable es/no-array-prototype-keys -- safe */
3083
+ if ([].keys) {
3084
+ arrayIterator = [].keys();
3085
+ // Safari 8 has buggy iterators w/o `next`
3086
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
3087
+ else {
3088
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
3089
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
3090
+ }
3091
+ }
3092
+
3093
+ var NEW_ITERATOR_PROTOTYPE = !isObject$1(IteratorPrototype$2) || fails(function () {
3094
+ var test = {};
3095
+ // FF44- legacy iterators case
3096
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
3097
+ });
3098
+
3099
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
3100
+
3101
+ // `%IteratorPrototype%[@@iterator]()` method
3102
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
3103
+ if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
3104
+ defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
3105
+ return this;
3106
+ });
3107
+ }
3108
+
3109
+ var iteratorsCore = {
3110
+ IteratorPrototype: IteratorPrototype$2,
3111
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
3112
+ };
3113
+
3114
+ var defineProperty$1 = objectDefineProperty.f;
3115
+ var hasOwn = hasOwnProperty_1;
3116
+ var wellKnownSymbol$2 = wellKnownSymbol$c;
3117
+
3118
+ var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
3119
+
3120
+ var setToStringTag$3 = function (target, TAG, STATIC) {
3121
+ if (target && !STATIC) target = target.prototype;
3122
+ if (target && !hasOwn(target, TO_STRING_TAG)) {
3123
+ defineProperty$1(target, TO_STRING_TAG, { configurable: true, value: TAG });
3124
+ }
3125
+ };
3126
+
3127
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
3128
+ var create = objectCreate;
3129
+ var createPropertyDescriptor = createPropertyDescriptor$3;
3130
+ var setToStringTag$2 = setToStringTag$3;
3131
+ var Iterators$2 = iterators;
3132
+
3133
+ var returnThis$1 = function () { return this; };
3134
+
3135
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
3136
+ var TO_STRING_TAG = NAME + ' Iterator';
3137
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
3138
+ setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
3139
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
3140
+ return IteratorConstructor;
3141
+ };
3142
+
3143
+ var uncurryThis = functionUncurryThis;
3144
+ var aCallable = aCallable$3;
3145
+
3146
+ var functionUncurryThisAccessor = function (object, key, method) {
3147
+ try {
3148
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
3149
+ return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
3150
+ } catch (error) { /* empty */ }
3151
+ };
3152
+
3153
+ var isObject = isObject$8;
3154
+
3155
+ var isPossiblePrototype$1 = function (argument) {
3156
+ return isObject(argument) || argument === null;
3157
+ };
3158
+
3159
+ var isPossiblePrototype = isPossiblePrototype$1;
3160
+
3161
+ var $String = String;
3162
+ var $TypeError = TypeError;
3163
+
3164
+ var aPossiblePrototype$1 = function (argument) {
3165
+ if (isPossiblePrototype(argument)) return argument;
3166
+ throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
3167
+ };
3168
+
3169
+ /* eslint-disable no-proto -- safe */
3170
+ var uncurryThisAccessor = functionUncurryThisAccessor;
3171
+ var anObject = anObject$a;
3172
+ var aPossiblePrototype = aPossiblePrototype$1;
3173
+
3174
+ // `Object.setPrototypeOf` method
3175
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
3176
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
3177
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
3178
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3179
+ var CORRECT_SETTER = false;
3180
+ var test = {};
3181
+ var setter;
3182
+ try {
3183
+ setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
3184
+ setter(test, []);
3185
+ CORRECT_SETTER = test instanceof Array;
3186
+ } catch (error) { /* empty */ }
3187
+ return function setPrototypeOf(O, proto) {
3188
+ anObject(O);
3189
+ aPossiblePrototype(proto);
3190
+ if (CORRECT_SETTER) setter(O, proto);
3191
+ else O.__proto__ = proto;
3192
+ return O;
3193
+ };
3194
+ }() : undefined);
3195
+
3196
+ var $ = _export;
3197
+ var call = functionCall;
3198
+ var FunctionName = functionName;
3199
+ var isCallable = isCallable$g;
3200
+ var createIteratorConstructor = iteratorCreateConstructor;
3201
+ var getPrototypeOf = objectGetPrototypeOf;
3202
+ var setPrototypeOf = objectSetPrototypeOf;
3203
+ var setToStringTag$1 = setToStringTag$3;
3204
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
3205
+ var defineBuiltIn = defineBuiltIn$5;
3206
+ var wellKnownSymbol$1 = wellKnownSymbol$c;
3207
+ var Iterators$1 = iterators;
3208
+ var IteratorsCore = iteratorsCore;
3209
+
3210
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
3211
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
3212
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
3213
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
3214
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
3215
+ var KEYS = 'keys';
3216
+ var VALUES = 'values';
3217
+ var ENTRIES = 'entries';
3218
+
3219
+ var returnThis = function () { return this; };
3220
+
3221
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
3222
+ createIteratorConstructor(IteratorConstructor, NAME, next);
3223
+
3224
+ var getIterationMethod = function (KIND) {
3225
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
3226
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
3227
+
3228
+ switch (KIND) {
3229
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
3230
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
3231
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
3232
+ }
3233
+
3234
+ return function () { return new IteratorConstructor(this); };
3235
+ };
3236
+
3237
+ var TO_STRING_TAG = NAME + ' Iterator';
3238
+ var INCORRECT_VALUES_NAME = false;
3239
+ var IterablePrototype = Iterable.prototype;
3240
+ var nativeIterator = IterablePrototype[ITERATOR$1]
3241
+ || IterablePrototype['@@iterator']
3242
+ || DEFAULT && IterablePrototype[DEFAULT];
3243
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
3244
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
3245
+ var CurrentIteratorPrototype, methods, KEY;
3246
+
3247
+ // fix native
3248
+ if (anyNativeIterator) {
3249
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
3250
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
3251
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
3252
+ if (setPrototypeOf) {
3253
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
3254
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
3255
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
3256
+ }
3257
+ }
3258
+ // Set @@toStringTag to native iterators
3259
+ setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
3260
+ }
3261
+ }
3262
+
3263
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
3264
+ if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
3265
+ if (CONFIGURABLE_FUNCTION_NAME) {
3266
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
3267
+ } else {
3268
+ INCORRECT_VALUES_NAME = true;
3269
+ defaultIterator = function values() { return call(nativeIterator, this); };
3270
+ }
3271
+ }
3272
+
3273
+ // export additional methods
3274
+ if (DEFAULT) {
3275
+ methods = {
3276
+ values: getIterationMethod(VALUES),
3277
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
3278
+ entries: getIterationMethod(ENTRIES)
3279
+ };
3280
+ if (FORCED) for (KEY in methods) {
3281
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
3282
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
3283
+ }
3284
+ } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
3285
+ }
3286
+
3287
+ // define iterator
3288
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
3289
+ defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
3290
+ }
3291
+ Iterators$1[NAME] = defaultIterator;
3292
+
3293
+ return methods;
3294
+ };
3295
+
3296
+ // `CreateIterResultObject` abstract operation
3297
+ // https://tc39.es/ecma262/#sec-createiterresultobject
3298
+ var createIterResultObject$1 = function (value, done) {
3299
+ return { value: value, done: done };
3300
+ };
3301
+
3302
+ var toIndexedObject = toIndexedObject$5;
3303
+ var addToUnscopables = addToUnscopables$2;
3304
+ var Iterators = iterators;
3305
+ var InternalStateModule = internalState;
3306
+ var defineProperty = objectDefineProperty.f;
3307
+ var defineIterator = iteratorDefine;
3308
+ var createIterResultObject = createIterResultObject$1;
3309
+ var DESCRIPTORS = descriptors;
3310
+
3311
+ var ARRAY_ITERATOR = 'Array Iterator';
3312
+ var setInternalState = InternalStateModule.set;
3313
+ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
3314
+
3315
+ // `Array.prototype.entries` method
3316
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
3317
+ // `Array.prototype.keys` method
3318
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
3319
+ // `Array.prototype.values` method
3320
+ // https://tc39.es/ecma262/#sec-array.prototype.values
3321
+ // `Array.prototype[@@iterator]` method
3322
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
3323
+ // `CreateArrayIterator` internal method
3324
+ // https://tc39.es/ecma262/#sec-createarrayiterator
3325
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
3326
+ setInternalState(this, {
3327
+ type: ARRAY_ITERATOR,
3328
+ target: toIndexedObject(iterated), // target
3329
+ index: 0, // next index
3330
+ kind: kind // kind
3331
+ });
3332
+ // `%ArrayIteratorPrototype%.next` method
3333
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
3334
+ }, function () {
3335
+ var state = getInternalState(this);
3336
+ var target = state.target;
3337
+ var index = state.index++;
3338
+ if (!target || index >= target.length) {
3339
+ state.target = undefined;
3340
+ return createIterResultObject(undefined, true);
3341
+ }
3342
+ switch (state.kind) {
3343
+ case 'keys': return createIterResultObject(index, false);
3344
+ case 'values': return createIterResultObject(target[index], false);
3345
+ } return createIterResultObject([index, target[index]], false);
3346
+ }, 'values');
3347
+
3348
+ // argumentsList[@@iterator] is %ArrayProto_values%
3349
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
3350
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
3351
+ var values = Iterators.Arguments = Iterators.Array;
3352
+
3353
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3354
+ addToUnscopables('keys');
3355
+ addToUnscopables('values');
3356
+ addToUnscopables('entries');
3357
+
3358
+ // V8 ~ Chrome 45- bug
3359
+ if (DESCRIPTORS && values.name !== 'values') try {
3360
+ defineProperty(values, 'name', { value: 'values' });
3361
+ } catch (error) { /* empty */ }
3362
+
3363
+ // iterable DOM collections
3364
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
3365
+ var domIterables = {
3366
+ CSSRuleList: 0,
3367
+ CSSStyleDeclaration: 0,
3368
+ CSSValueList: 0,
3369
+ ClientRectList: 0,
3370
+ DOMRectList: 0,
3371
+ DOMStringList: 0,
3372
+ DOMTokenList: 1,
3373
+ DataTransferItemList: 0,
3374
+ FileList: 0,
3375
+ HTMLAllCollection: 0,
3376
+ HTMLCollection: 0,
3377
+ HTMLFormElement: 0,
3378
+ HTMLSelectElement: 0,
3379
+ MediaList: 0,
3380
+ MimeTypeArray: 0,
3381
+ NamedNodeMap: 0,
3382
+ NodeList: 1,
3383
+ PaintRequestList: 0,
3384
+ Plugin: 0,
3385
+ PluginArray: 0,
3386
+ SVGLengthList: 0,
3387
+ SVGNumberList: 0,
3388
+ SVGPathSegList: 0,
3389
+ SVGPointList: 0,
3390
+ SVGStringList: 0,
3391
+ SVGTransformList: 0,
3392
+ SourceBufferList: 0,
3393
+ StyleSheetList: 0,
3394
+ TextTrackCueList: 0,
3395
+ TextTrackList: 0,
3396
+ TouchList: 0
3397
+ };
3398
+
3399
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
3400
+ var documentCreateElement = documentCreateElement$2;
3401
+
3402
+ var classList = documentCreateElement('span').classList;
3403
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
3404
+
3405
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
3406
+
3407
+ var global$1 = global$g;
3408
+ var DOMIterables = domIterables;
3409
+ var DOMTokenListPrototype = domTokenListPrototype;
3410
+ var ArrayIteratorMethods = es_array_iterator;
3411
+ var createNonEnumerableProperty = createNonEnumerableProperty$5;
3412
+ var setToStringTag = setToStringTag$3;
3413
+ var wellKnownSymbol = wellKnownSymbol$c;
3414
+
3415
+ var ITERATOR = wellKnownSymbol('iterator');
3416
+ var ArrayValues = ArrayIteratorMethods.values;
3417
+
3418
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3419
+ if (CollectionPrototype) {
3420
+ // some Chrome versions have non-configurable methods on DOMTokenList
3421
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
3422
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
3423
+ } catch (error) {
3424
+ CollectionPrototype[ITERATOR] = ArrayValues;
3425
+ }
3426
+ setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
3427
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
3428
+ // some Chrome versions have non-configurable methods on DOMTokenList
3429
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
3430
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
3431
+ } catch (error) {
3432
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
3433
+ }
3434
+ }
3435
+ }
3436
+ };
3437
+
3438
+ for (var COLLECTION_NAME in DOMIterables) {
3439
+ handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
3440
+ }
3441
+
3442
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
3443
+
3444
+ function getCookie(name) {
3445
+ var cookieString = decodeURIComponent(document.cookie);
3446
+ var cookies = cookieString.split(';');
3447
+ var _iterator = _createForOfIteratorHelper(cookies),
3448
+ _step;
3449
+ try {
3450
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
3451
+ var cookie = _step.value;
3452
+ var _cookie$trim$split = cookie.trim().split('='),
3453
+ _cookie$trim$split2 = _slicedToArray(_cookie$trim$split, 2),
3454
+ cookieName = _cookie$trim$split2[0],
3455
+ cookieValue = _cookie$trim$split2[1];
3456
+ if (cookieName === name) {
3457
+ return cookieValue;
3458
+ }
3459
+ }
3460
+ } catch (err) {
3461
+ _iterator.e(err);
3462
+ } finally {
3463
+ _iterator.f();
3464
+ }
3465
+ return undefined; // Cookie not found
3466
+ }
3467
+ function setCookie(name, value) {
3468
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3469
+ var defaults = {
3470
+ path: '/',
3471
+ // Set to 1 hour by default
3472
+ expires: new Date(Date.now() + 60 * 60 * 1000)
3473
+ };
3474
+ var mergedOptions = Object.assign(Object.assign({}, defaults), options);
3475
+ var cookieString = "".concat(encodeURIComponent(name), "=").concat(encodeURIComponent(value !== null && value !== void 0 ? value : ''));
3476
+ for (var key in mergedOptions) {
3477
+ if (mergedOptions[key] !== undefined) {
3478
+ cookieString += "; ".concat(key);
3479
+ if (key === 'expires') {
3480
+ cookieString += "=".concat(mergedOptions[key].toUTCString());
3481
+ } else if (typeof mergedOptions[key] === 'boolean') {
3482
+ cookieString += "; ".concat(mergedOptions[key] ? 'true' : 'false');
3483
+ } else {
3484
+ cookieString += "=".concat(mergedOptions[key]);
3485
+ }
3486
+ }
3487
+ }
3488
+ // Set the cookie in the browser
3489
+ document.cookie = cookieString;
3490
+ }
3491
+
3492
+ function debounce(cb) {
3493
+ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
3494
+ var timeout;
3495
+ return function () {
3496
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3497
+ args[_key] = arguments[_key];
3498
+ }
3499
+ clearTimeout(timeout);
3500
+ timeout = setTimeout(function () {
3501
+ cb.apply(void 0, args);
3502
+ }, delay);
3503
+ };
3504
+ }
3505
+
3506
+ var removeAccentsAndReplaceSpaces = function removeAccentsAndReplaceSpaces(str) {
3507
+ return str.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(/\s+/g, '-').toLowerCase().trim();
3508
+ };
3509
+
3510
+ function throttle(cb) {
3511
+ var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
3512
+ var shouldWait = false;
3513
+ return function () {
3514
+ if (shouldWait) {
3515
+ return;
3516
+ }
3517
+ cb.apply(void 0, arguments);
3518
+ shouldWait = true;
3519
+ setTimeout(function () {
3520
+ shouldWait = false;
3521
+ }, delay);
3522
+ };
3523
+ }
3524
+
3525
+ // get milliseconds
3526
+ var getMilliSeconds = function getMilliSeconds(dateInit, dateEnd) {
3527
+ if (dateEnd.getTime() > dateInit.getTime()) {
3528
+ return Math.abs(dateEnd.getTime() - dateInit.getTime());
3529
+ }
3530
+ return 0;
3531
+ };
3532
+ // get hour - minute - seconds
3533
+ var getDaysHoursMinutesSeconds = function getDaysHoursMinutesSeconds(milliseconds, type) {
3534
+ if (type === 'days') {
3535
+ return Math.floor(milliseconds / (1000 * 60 * 60 * 24));
3536
+ }
3537
+ if (type === 'hours') {
3538
+ return Math.floor(milliseconds % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
3539
+ }
3540
+ if (type === 'minutes') {
3541
+ return Math.floor(milliseconds % (1000 * 60 * 60) / (1000 * 60));
3542
+ }
3543
+ return Math.floor(milliseconds % (1000 * 60) / 1000);
3544
+ };
3545
+
3546
+ var helpers = {
3547
+ events: {
3548
+ pushDatalayer: pushDatalayer,
3549
+ getAvailablesSizes: getAvailablesSizes,
3550
+ getCategories: getCategories,
3551
+ getProductListInfoFromHead: getProductListInfoFromHead,
3552
+ getPersistedData: getPersistedData,
3553
+ findDataInPersistedData: findDataInPersistedData,
3554
+ updatePersistedData: updatePersistedData
3555
+ },
3556
+ product: {
3557
+ splitNameAndSizeFromFullName: splitNameAndSizeFromFullName,
3558
+ getColorAndSizeFromSkuName: getColorAndSizeFromSkuName,
3559
+ resizingImg: resizingImg,
3560
+ updatedResizedImg: updatedResizedImg,
3561
+ formatPriceToCurrency: formatPriceToCurrency,
3562
+ getSkuInfos: getSkuInfos,
3563
+ getThumbImage: getThumbImage
3564
+ },
3565
+ utils: {
3566
+ getCookie: getCookie,
3567
+ setCookie: setCookie,
3568
+ debounce: debounce,
3569
+ removeAccentsAndReplaceSpaces: removeAccentsAndReplaceSpaces,
3570
+ throttle: throttle,
3571
+ getMilliSeconds: getMilliSeconds,
3572
+ getDaysHoursMinutesSeconds: getDaysHoursMinutesSeconds
3573
+ }
3574
+ };
3575
+ var data = {
3576
+ EventContext: EventContext,
3577
+ EventProvider: EventProvider,
3578
+ useEventContext: useEventContext,
3579
+ helpers: helpers
3580
+ };
3581
+
3582
+ var index = {
3583
+ data: data
3584
+ };
2
3585
 
3
3586
  export { index as default };