mazey 2.0.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.esm.js CHANGED
@@ -1,4739 +1 @@
1
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
-
3
- function createCommonjsModule(fn, module) {
4
- return module = { exports: {} }, fn(module, module.exports), module.exports;
5
- }
6
-
7
- var check = function (it) {
8
- return it && it.Math == Math && it;
9
- };
10
-
11
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
12
- var global_1 =
13
- // eslint-disable-next-line no-undef
14
- check(typeof globalThis == 'object' && globalThis) ||
15
- check(typeof window == 'object' && window) ||
16
- check(typeof self == 'object' && self) ||
17
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
18
- // eslint-disable-next-line no-new-func
19
- Function('return this')();
20
-
21
- var fails = function (exec) {
22
- try {
23
- return !!exec();
24
- } catch (error) {
25
- return true;
26
- }
27
- };
28
-
29
- // Thank's IE8 for his funny defineProperty
30
- var descriptors = !fails(function () {
31
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
32
- });
33
-
34
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
35
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
36
-
37
- // Nashorn ~ JDK8 bug
38
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
39
-
40
- // `Object.prototype.propertyIsEnumerable` method implementation
41
- // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
42
- var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
43
- var descriptor = getOwnPropertyDescriptor(this, V);
44
- return !!descriptor && descriptor.enumerable;
45
- } : nativePropertyIsEnumerable;
46
-
47
- var objectPropertyIsEnumerable = {
48
- f: f
49
- };
50
-
51
- var createPropertyDescriptor = function (bitmap, value) {
52
- return {
53
- enumerable: !(bitmap & 1),
54
- configurable: !(bitmap & 2),
55
- writable: !(bitmap & 4),
56
- value: value
57
- };
58
- };
59
-
60
- var toString = {}.toString;
61
-
62
- var classofRaw = function (it) {
63
- return toString.call(it).slice(8, -1);
64
- };
65
-
66
- var split = ''.split;
67
-
68
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
69
- var indexedObject = fails(function () {
70
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
71
- // eslint-disable-next-line no-prototype-builtins
72
- return !Object('z').propertyIsEnumerable(0);
73
- }) ? function (it) {
74
- return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
75
- } : Object;
76
-
77
- // `RequireObjectCoercible` abstract operation
78
- // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
79
- var requireObjectCoercible = function (it) {
80
- if (it == undefined) throw TypeError("Can't call method on " + it);
81
- return it;
82
- };
83
-
84
- // toObject with fallback for non-array-like ES3 strings
85
-
86
-
87
-
88
- var toIndexedObject = function (it) {
89
- return indexedObject(requireObjectCoercible(it));
90
- };
91
-
92
- var isObject = function (it) {
93
- return typeof it === 'object' ? it !== null : typeof it === 'function';
94
- };
95
-
96
- // `ToPrimitive` abstract operation
97
- // https://tc39.github.io/ecma262/#sec-toprimitive
98
- // instead of the ES6 spec version, we didn't implement @@toPrimitive case
99
- // and the second argument - flag - preferred type is a string
100
- var toPrimitive = function (input, PREFERRED_STRING) {
101
- if (!isObject(input)) return input;
102
- var fn, val;
103
- if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
104
- if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
105
- if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
106
- throw TypeError("Can't convert object to primitive value");
107
- };
108
-
109
- var hasOwnProperty = {}.hasOwnProperty;
110
-
111
- var has = function (it, key) {
112
- return hasOwnProperty.call(it, key);
113
- };
114
-
115
- var document$1 = global_1.document;
116
- // typeof document.createElement is 'object' in old IE
117
- var EXISTS = isObject(document$1) && isObject(document$1.createElement);
118
-
119
- var documentCreateElement = function (it) {
120
- return EXISTS ? document$1.createElement(it) : {};
121
- };
122
-
123
- // Thank's IE8 for his funny defineProperty
124
- var ie8DomDefine = !descriptors && !fails(function () {
125
- return Object.defineProperty(documentCreateElement('div'), 'a', {
126
- get: function () { return 7; }
127
- }).a != 7;
128
- });
129
-
130
- var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
131
-
132
- // `Object.getOwnPropertyDescriptor` method
133
- // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
134
- var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
135
- O = toIndexedObject(O);
136
- P = toPrimitive(P, true);
137
- if (ie8DomDefine) try {
138
- return nativeGetOwnPropertyDescriptor(O, P);
139
- } catch (error) { /* empty */ }
140
- if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
141
- };
142
-
143
- var objectGetOwnPropertyDescriptor = {
144
- f: f$1
145
- };
146
-
147
- var anObject = function (it) {
148
- if (!isObject(it)) {
149
- throw TypeError(String(it) + ' is not an object');
150
- } return it;
151
- };
152
-
153
- var nativeDefineProperty = Object.defineProperty;
154
-
155
- // `Object.defineProperty` method
156
- // https://tc39.github.io/ecma262/#sec-object.defineproperty
157
- var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
158
- anObject(O);
159
- P = toPrimitive(P, true);
160
- anObject(Attributes);
161
- if (ie8DomDefine) try {
162
- return nativeDefineProperty(O, P, Attributes);
163
- } catch (error) { /* empty */ }
164
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
165
- if ('value' in Attributes) O[P] = Attributes.value;
166
- return O;
167
- };
168
-
169
- var objectDefineProperty = {
170
- f: f$2
171
- };
172
-
173
- var createNonEnumerableProperty = descriptors ? function (object, key, value) {
174
- return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
175
- } : function (object, key, value) {
176
- object[key] = value;
177
- return object;
178
- };
179
-
180
- var setGlobal = function (key, value) {
181
- try {
182
- createNonEnumerableProperty(global_1, key, value);
183
- } catch (error) {
184
- global_1[key] = value;
185
- } return value;
186
- };
187
-
188
- var SHARED = '__core-js_shared__';
189
- var store = global_1[SHARED] || setGlobal(SHARED, {});
190
-
191
- var sharedStore = store;
192
-
193
- var functionToString = Function.toString;
194
-
195
- // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
196
- if (typeof sharedStore.inspectSource != 'function') {
197
- sharedStore.inspectSource = function (it) {
198
- return functionToString.call(it);
199
- };
200
- }
201
-
202
- var inspectSource = sharedStore.inspectSource;
203
-
204
- var WeakMap = global_1.WeakMap;
205
-
206
- var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
207
-
208
- var shared = createCommonjsModule(function (module) {
209
- (module.exports = function (key, value) {
210
- return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
211
- })('versions', []).push({
212
- version: '3.6.5',
213
- mode: 'global',
214
- copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
215
- });
216
- });
217
-
218
- var id = 0;
219
- var postfix = Math.random();
220
-
221
- var uid = function (key) {
222
- return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
223
- };
224
-
225
- var keys = shared('keys');
226
-
227
- var sharedKey = function (key) {
228
- return keys[key] || (keys[key] = uid(key));
229
- };
230
-
231
- var hiddenKeys = {};
232
-
233
- var WeakMap$1 = global_1.WeakMap;
234
- var set, get, has$1;
235
-
236
- var enforce = function (it) {
237
- return has$1(it) ? get(it) : set(it, {});
238
- };
239
-
240
- var getterFor = function (TYPE) {
241
- return function (it) {
242
- var state;
243
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
244
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
245
- } return state;
246
- };
247
- };
248
-
249
- if (nativeWeakMap) {
250
- var store$1 = new WeakMap$1();
251
- var wmget = store$1.get;
252
- var wmhas = store$1.has;
253
- var wmset = store$1.set;
254
- set = function (it, metadata) {
255
- wmset.call(store$1, it, metadata);
256
- return metadata;
257
- };
258
- get = function (it) {
259
- return wmget.call(store$1, it) || {};
260
- };
261
- has$1 = function (it) {
262
- return wmhas.call(store$1, it);
263
- };
264
- } else {
265
- var STATE = sharedKey('state');
266
- hiddenKeys[STATE] = true;
267
- set = function (it, metadata) {
268
- createNonEnumerableProperty(it, STATE, metadata);
269
- return metadata;
270
- };
271
- get = function (it) {
272
- return has(it, STATE) ? it[STATE] : {};
273
- };
274
- has$1 = function (it) {
275
- return has(it, STATE);
276
- };
277
- }
278
-
279
- var internalState = {
280
- set: set,
281
- get: get,
282
- has: has$1,
283
- enforce: enforce,
284
- getterFor: getterFor
285
- };
286
-
287
- var redefine = createCommonjsModule(function (module) {
288
- var getInternalState = internalState.get;
289
- var enforceInternalState = internalState.enforce;
290
- var TEMPLATE = String(String).split('String');
291
-
292
- (module.exports = function (O, key, value, options) {
293
- var unsafe = options ? !!options.unsafe : false;
294
- var simple = options ? !!options.enumerable : false;
295
- var noTargetGet = options ? !!options.noTargetGet : false;
296
- if (typeof value == 'function') {
297
- if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
298
- enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
299
- }
300
- if (O === global_1) {
301
- if (simple) O[key] = value;
302
- else setGlobal(key, value);
303
- return;
304
- } else if (!unsafe) {
305
- delete O[key];
306
- } else if (!noTargetGet && O[key]) {
307
- simple = true;
308
- }
309
- if (simple) O[key] = value;
310
- else createNonEnumerableProperty(O, key, value);
311
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
312
- })(Function.prototype, 'toString', function toString() {
313
- return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
314
- });
315
- });
316
-
317
- var path = global_1;
318
-
319
- var aFunction = function (variable) {
320
- return typeof variable == 'function' ? variable : undefined;
321
- };
322
-
323
- var getBuiltIn = function (namespace, method) {
324
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
325
- : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
326
- };
327
-
328
- var ceil = Math.ceil;
329
- var floor = Math.floor;
330
-
331
- // `ToInteger` abstract operation
332
- // https://tc39.github.io/ecma262/#sec-tointeger
333
- var toInteger = function (argument) {
334
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
335
- };
336
-
337
- var min = Math.min;
338
-
339
- // `ToLength` abstract operation
340
- // https://tc39.github.io/ecma262/#sec-tolength
341
- var toLength = function (argument) {
342
- return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
343
- };
344
-
345
- var max = Math.max;
346
- var min$1 = Math.min;
347
-
348
- // Helper for a popular repeating case of the spec:
349
- // Let integer be ? ToInteger(index).
350
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
351
- var toAbsoluteIndex = function (index, length) {
352
- var integer = toInteger(index);
353
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
354
- };
355
-
356
- // `Array.prototype.{ indexOf, includes }` methods implementation
357
- var createMethod = function (IS_INCLUDES) {
358
- return function ($this, el, fromIndex) {
359
- var O = toIndexedObject($this);
360
- var length = toLength(O.length);
361
- var index = toAbsoluteIndex(fromIndex, length);
362
- var value;
363
- // Array#includes uses SameValueZero equality algorithm
364
- // eslint-disable-next-line no-self-compare
365
- if (IS_INCLUDES && el != el) while (length > index) {
366
- value = O[index++];
367
- // eslint-disable-next-line no-self-compare
368
- if (value != value) return true;
369
- // Array#indexOf ignores holes, Array#includes - not
370
- } else for (;length > index; index++) {
371
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
372
- } return !IS_INCLUDES && -1;
373
- };
374
- };
375
-
376
- var arrayIncludes = {
377
- // `Array.prototype.includes` method
378
- // https://tc39.github.io/ecma262/#sec-array.prototype.includes
379
- includes: createMethod(true),
380
- // `Array.prototype.indexOf` method
381
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
382
- indexOf: createMethod(false)
383
- };
384
-
385
- var indexOf = arrayIncludes.indexOf;
386
-
387
-
388
- var objectKeysInternal = function (object, names) {
389
- var O = toIndexedObject(object);
390
- var i = 0;
391
- var result = [];
392
- var key;
393
- for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
394
- // Don't enum bug & hidden keys
395
- while (names.length > i) if (has(O, key = names[i++])) {
396
- ~indexOf(result, key) || result.push(key);
397
- }
398
- return result;
399
- };
400
-
401
- // IE8- don't enum bug keys
402
- var enumBugKeys = [
403
- 'constructor',
404
- 'hasOwnProperty',
405
- 'isPrototypeOf',
406
- 'propertyIsEnumerable',
407
- 'toLocaleString',
408
- 'toString',
409
- 'valueOf'
410
- ];
411
-
412
- var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
413
-
414
- // `Object.getOwnPropertyNames` method
415
- // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
416
- var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
417
- return objectKeysInternal(O, hiddenKeys$1);
418
- };
419
-
420
- var objectGetOwnPropertyNames = {
421
- f: f$3
422
- };
423
-
424
- var f$4 = Object.getOwnPropertySymbols;
425
-
426
- var objectGetOwnPropertySymbols = {
427
- f: f$4
428
- };
429
-
430
- // all object keys, includes non-enumerable and symbols
431
- var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
432
- var keys = objectGetOwnPropertyNames.f(anObject(it));
433
- var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
434
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
435
- };
436
-
437
- var copyConstructorProperties = function (target, source) {
438
- var keys = ownKeys(source);
439
- var defineProperty = objectDefineProperty.f;
440
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
441
- for (var i = 0; i < keys.length; i++) {
442
- var key = keys[i];
443
- if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
444
- }
445
- };
446
-
447
- var replacement = /#|\.prototype\./;
448
-
449
- var isForced = function (feature, detection) {
450
- var value = data[normalize(feature)];
451
- return value == POLYFILL ? true
452
- : value == NATIVE ? false
453
- : typeof detection == 'function' ? fails(detection)
454
- : !!detection;
455
- };
456
-
457
- var normalize = isForced.normalize = function (string) {
458
- return String(string).replace(replacement, '.').toLowerCase();
459
- };
460
-
461
- var data = isForced.data = {};
462
- var NATIVE = isForced.NATIVE = 'N';
463
- var POLYFILL = isForced.POLYFILL = 'P';
464
-
465
- var isForced_1 = isForced;
466
-
467
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
468
-
469
-
470
-
471
-
472
-
473
-
474
- /*
475
- options.target - name of the target object
476
- options.global - target is the global object
477
- options.stat - export as static methods of target
478
- options.proto - export as prototype methods of target
479
- options.real - real prototype method for the `pure` version
480
- options.forced - export even if the native feature is available
481
- options.bind - bind methods to the target, required for the `pure` version
482
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
483
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
484
- options.sham - add a flag to not completely full polyfills
485
- options.enumerable - export as enumerable property
486
- options.noTargetGet - prevent calling a getter on target
487
- */
488
- var _export = function (options, source) {
489
- var TARGET = options.target;
490
- var GLOBAL = options.global;
491
- var STATIC = options.stat;
492
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
493
- if (GLOBAL) {
494
- target = global_1;
495
- } else if (STATIC) {
496
- target = global_1[TARGET] || setGlobal(TARGET, {});
497
- } else {
498
- target = (global_1[TARGET] || {}).prototype;
499
- }
500
- if (target) for (key in source) {
501
- sourceProperty = source[key];
502
- if (options.noTargetGet) {
503
- descriptor = getOwnPropertyDescriptor$1(target, key);
504
- targetProperty = descriptor && descriptor.value;
505
- } else targetProperty = target[key];
506
- FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
507
- // contained in target
508
- if (!FORCED && targetProperty !== undefined) {
509
- if (typeof sourceProperty === typeof targetProperty) continue;
510
- copyConstructorProperties(sourceProperty, targetProperty);
511
- }
512
- // add a flag to not completely full polyfills
513
- if (options.sham || (targetProperty && targetProperty.sham)) {
514
- createNonEnumerableProperty(sourceProperty, 'sham', true);
515
- }
516
- // extend global
517
- redefine(target, key, sourceProperty, options);
518
- }
519
- };
520
-
521
- // `IsArray` abstract operation
522
- // https://tc39.github.io/ecma262/#sec-isarray
523
- var isArray = Array.isArray || function isArray(arg) {
524
- return classofRaw(arg) == 'Array';
525
- };
526
-
527
- // `ToObject` abstract operation
528
- // https://tc39.github.io/ecma262/#sec-toobject
529
- var toObject = function (argument) {
530
- return Object(requireObjectCoercible(argument));
531
- };
532
-
533
- var createProperty = function (object, key, value) {
534
- var propertyKey = toPrimitive(key);
535
- if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
536
- else object[propertyKey] = value;
537
- };
538
-
539
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
540
- // Chrome 38 Symbol has incorrect toString conversion
541
- // eslint-disable-next-line no-undef
542
- return !String(Symbol());
543
- });
544
-
545
- var useSymbolAsUid = nativeSymbol
546
- // eslint-disable-next-line no-undef
547
- && !Symbol.sham
548
- // eslint-disable-next-line no-undef
549
- && typeof Symbol.iterator == 'symbol';
550
-
551
- var WellKnownSymbolsStore = shared('wks');
552
- var Symbol$1 = global_1.Symbol;
553
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
554
-
555
- var wellKnownSymbol = function (name) {
556
- if (!has(WellKnownSymbolsStore, name)) {
557
- if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
558
- else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
559
- } return WellKnownSymbolsStore[name];
560
- };
561
-
562
- var SPECIES = wellKnownSymbol('species');
563
-
564
- // `ArraySpeciesCreate` abstract operation
565
- // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
566
- var arraySpeciesCreate = function (originalArray, length) {
567
- var C;
568
- if (isArray(originalArray)) {
569
- C = originalArray.constructor;
570
- // cross-realm fallback
571
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
572
- else if (isObject(C)) {
573
- C = C[SPECIES];
574
- if (C === null) C = undefined;
575
- }
576
- } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
577
- };
578
-
579
- var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
580
-
581
- var process = global_1.process;
582
- var versions = process && process.versions;
583
- var v8 = versions && versions.v8;
584
- var match, version;
585
-
586
- if (v8) {
587
- match = v8.split('.');
588
- version = match[0] + match[1];
589
- } else if (engineUserAgent) {
590
- match = engineUserAgent.match(/Edge\/(\d+)/);
591
- if (!match || match[1] >= 74) {
592
- match = engineUserAgent.match(/Chrome\/(\d+)/);
593
- if (match) version = match[1];
594
- }
595
- }
596
-
597
- var engineV8Version = version && +version;
598
-
599
- var SPECIES$1 = wellKnownSymbol('species');
600
-
601
- var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
602
- // We can't use this feature detection in V8 since it causes
603
- // deoptimization and serious performance degradation
604
- // https://github.com/zloirock/core-js/issues/677
605
- return engineV8Version >= 51 || !fails(function () {
606
- var array = [];
607
- var constructor = array.constructor = {};
608
- constructor[SPECIES$1] = function () {
609
- return { foo: 1 };
610
- };
611
- return array[METHOD_NAME](Boolean).foo !== 1;
612
- });
613
- };
614
-
615
- var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
616
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
617
- var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
618
-
619
- // We can't use this feature detection in V8 since it causes
620
- // deoptimization and serious performance degradation
621
- // https://github.com/zloirock/core-js/issues/679
622
- var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
623
- var array = [];
624
- array[IS_CONCAT_SPREADABLE] = false;
625
- return array.concat()[0] !== array;
626
- });
627
-
628
- var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
629
-
630
- var isConcatSpreadable = function (O) {
631
- if (!isObject(O)) return false;
632
- var spreadable = O[IS_CONCAT_SPREADABLE];
633
- return spreadable !== undefined ? !!spreadable : isArray(O);
634
- };
635
-
636
- var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
637
-
638
- // `Array.prototype.concat` method
639
- // https://tc39.github.io/ecma262/#sec-array.prototype.concat
640
- // with adding support of @@isConcatSpreadable and @@species
641
- _export({ target: 'Array', proto: true, forced: FORCED }, {
642
- concat: function concat(arg) { // eslint-disable-line no-unused-vars
643
- var O = toObject(this);
644
- var A = arraySpeciesCreate(O, 0);
645
- var n = 0;
646
- var i, k, length, len, E;
647
- for (i = -1, length = arguments.length; i < length; i++) {
648
- E = i === -1 ? O : arguments[i];
649
- if (isConcatSpreadable(E)) {
650
- len = toLength(E.length);
651
- if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
652
- for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
653
- } else {
654
- if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
655
- createProperty(A, n++, E);
656
- }
657
- }
658
- A.length = n;
659
- return A;
660
- }
661
- });
662
-
663
- // `Array.prototype.fill` method implementation
664
- // https://tc39.github.io/ecma262/#sec-array.prototype.fill
665
- var arrayFill = function fill(value /* , start = 0, end = @length */) {
666
- var O = toObject(this);
667
- var length = toLength(O.length);
668
- var argumentsLength = arguments.length;
669
- var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
670
- var end = argumentsLength > 2 ? arguments[2] : undefined;
671
- var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
672
- while (endPos > index) O[index++] = value;
673
- return O;
674
- };
675
-
676
- // `Object.keys` method
677
- // https://tc39.github.io/ecma262/#sec-object.keys
678
- var objectKeys = Object.keys || function keys(O) {
679
- return objectKeysInternal(O, enumBugKeys);
680
- };
681
-
682
- // `Object.defineProperties` method
683
- // https://tc39.github.io/ecma262/#sec-object.defineproperties
684
- var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
685
- anObject(O);
686
- var keys = objectKeys(Properties);
687
- var length = keys.length;
688
- var index = 0;
689
- var key;
690
- while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
691
- return O;
692
- };
693
-
694
- var html = getBuiltIn('document', 'documentElement');
695
-
696
- var GT = '>';
697
- var LT = '<';
698
- var PROTOTYPE = 'prototype';
699
- var SCRIPT = 'script';
700
- var IE_PROTO = sharedKey('IE_PROTO');
701
-
702
- var EmptyConstructor = function () { /* empty */ };
703
-
704
- var scriptTag = function (content) {
705
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
706
- };
707
-
708
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
709
- var NullProtoObjectViaActiveX = function (activeXDocument) {
710
- activeXDocument.write(scriptTag(''));
711
- activeXDocument.close();
712
- var temp = activeXDocument.parentWindow.Object;
713
- activeXDocument = null; // avoid memory leak
714
- return temp;
715
- };
716
-
717
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
718
- var NullProtoObjectViaIFrame = function () {
719
- // Thrash, waste and sodomy: IE GC bug
720
- var iframe = documentCreateElement('iframe');
721
- var JS = 'java' + SCRIPT + ':';
722
- var iframeDocument;
723
- iframe.style.display = 'none';
724
- html.appendChild(iframe);
725
- // https://github.com/zloirock/core-js/issues/475
726
- iframe.src = String(JS);
727
- iframeDocument = iframe.contentWindow.document;
728
- iframeDocument.open();
729
- iframeDocument.write(scriptTag('document.F=Object'));
730
- iframeDocument.close();
731
- return iframeDocument.F;
732
- };
733
-
734
- // Check for document.domain and active x support
735
- // No need to use active x approach when document.domain is not set
736
- // see https://github.com/es-shims/es5-shim/issues/150
737
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
738
- // avoid IE GC bug
739
- var activeXDocument;
740
- var NullProtoObject = function () {
741
- try {
742
- /* global ActiveXObject */
743
- activeXDocument = document.domain && new ActiveXObject('htmlfile');
744
- } catch (error) { /* ignore */ }
745
- NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
746
- var length = enumBugKeys.length;
747
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
748
- return NullProtoObject();
749
- };
750
-
751
- hiddenKeys[IE_PROTO] = true;
752
-
753
- // `Object.create` method
754
- // https://tc39.github.io/ecma262/#sec-object.create
755
- var objectCreate = Object.create || function create(O, Properties) {
756
- var result;
757
- if (O !== null) {
758
- EmptyConstructor[PROTOTYPE] = anObject(O);
759
- result = new EmptyConstructor();
760
- EmptyConstructor[PROTOTYPE] = null;
761
- // add "__proto__" for Object.getPrototypeOf polyfill
762
- result[IE_PROTO] = O;
763
- } else result = NullProtoObject();
764
- return Properties === undefined ? result : objectDefineProperties(result, Properties);
765
- };
766
-
767
- var UNSCOPABLES = wellKnownSymbol('unscopables');
768
- var ArrayPrototype = Array.prototype;
769
-
770
- // Array.prototype[@@unscopables]
771
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
772
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
773
- objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
774
- configurable: true,
775
- value: objectCreate(null)
776
- });
777
- }
778
-
779
- // add a key to Array.prototype[@@unscopables]
780
- var addToUnscopables = function (key) {
781
- ArrayPrototype[UNSCOPABLES][key] = true;
782
- };
783
-
784
- // `Array.prototype.fill` method
785
- // https://tc39.github.io/ecma262/#sec-array.prototype.fill
786
- _export({ target: 'Array', proto: true }, {
787
- fill: arrayFill
788
- });
789
-
790
- // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
791
- addToUnscopables('fill');
792
-
793
- var aFunction$1 = function (it) {
794
- if (typeof it != 'function') {
795
- throw TypeError(String(it) + ' is not a function');
796
- } return it;
797
- };
798
-
799
- // optional / simple context binding
800
- var functionBindContext = function (fn, that, length) {
801
- aFunction$1(fn);
802
- if (that === undefined) return fn;
803
- switch (length) {
804
- case 0: return function () {
805
- return fn.call(that);
806
- };
807
- case 1: return function (a) {
808
- return fn.call(that, a);
809
- };
810
- case 2: return function (a, b) {
811
- return fn.call(that, a, b);
812
- };
813
- case 3: return function (a, b, c) {
814
- return fn.call(that, a, b, c);
815
- };
816
- }
817
- return function (/* ...args */) {
818
- return fn.apply(that, arguments);
819
- };
820
- };
821
-
822
- var push = [].push;
823
-
824
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
825
- var createMethod$1 = function (TYPE) {
826
- var IS_MAP = TYPE == 1;
827
- var IS_FILTER = TYPE == 2;
828
- var IS_SOME = TYPE == 3;
829
- var IS_EVERY = TYPE == 4;
830
- var IS_FIND_INDEX = TYPE == 6;
831
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
832
- return function ($this, callbackfn, that, specificCreate) {
833
- var O = toObject($this);
834
- var self = indexedObject(O);
835
- var boundFunction = functionBindContext(callbackfn, that, 3);
836
- var length = toLength(self.length);
837
- var index = 0;
838
- var create = specificCreate || arraySpeciesCreate;
839
- var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
840
- var value, result;
841
- for (;length > index; index++) if (NO_HOLES || index in self) {
842
- value = self[index];
843
- result = boundFunction(value, index, O);
844
- if (TYPE) {
845
- if (IS_MAP) target[index] = result; // map
846
- else if (result) switch (TYPE) {
847
- case 3: return true; // some
848
- case 5: return value; // find
849
- case 6: return index; // findIndex
850
- case 2: push.call(target, value); // filter
851
- } else if (IS_EVERY) return false; // every
852
- }
853
- }
854
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
855
- };
856
- };
857
-
858
- var arrayIteration = {
859
- // `Array.prototype.forEach` method
860
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
861
- forEach: createMethod$1(0),
862
- // `Array.prototype.map` method
863
- // https://tc39.github.io/ecma262/#sec-array.prototype.map
864
- map: createMethod$1(1),
865
- // `Array.prototype.filter` method
866
- // https://tc39.github.io/ecma262/#sec-array.prototype.filter
867
- filter: createMethod$1(2),
868
- // `Array.prototype.some` method
869
- // https://tc39.github.io/ecma262/#sec-array.prototype.some
870
- some: createMethod$1(3),
871
- // `Array.prototype.every` method
872
- // https://tc39.github.io/ecma262/#sec-array.prototype.every
873
- every: createMethod$1(4),
874
- // `Array.prototype.find` method
875
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
876
- find: createMethod$1(5),
877
- // `Array.prototype.findIndex` method
878
- // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
879
- findIndex: createMethod$1(6)
880
- };
881
-
882
- var arrayMethodIsStrict = function (METHOD_NAME, argument) {
883
- var method = [][METHOD_NAME];
884
- return !!method && fails(function () {
885
- // eslint-disable-next-line no-useless-call,no-throw-literal
886
- method.call(null, argument || function () { throw 1; }, 1);
887
- });
888
- };
889
-
890
- var defineProperty = Object.defineProperty;
891
- var cache = {};
892
-
893
- var thrower = function (it) { throw it; };
894
-
895
- var arrayMethodUsesToLength = function (METHOD_NAME, options) {
896
- if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
897
- if (!options) options = {};
898
- var method = [][METHOD_NAME];
899
- var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
900
- var argument0 = has(options, 0) ? options[0] : thrower;
901
- var argument1 = has(options, 1) ? options[1] : undefined;
902
-
903
- return cache[METHOD_NAME] = !!method && !fails(function () {
904
- if (ACCESSORS && !descriptors) return true;
905
- var O = { length: -1 };
906
-
907
- if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
908
- else O[1] = 1;
909
-
910
- method.call(O, argument0, argument1);
911
- });
912
- };
913
-
914
- var $forEach = arrayIteration.forEach;
915
-
916
-
917
-
918
- var STRICT_METHOD = arrayMethodIsStrict('forEach');
919
- var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
920
-
921
- // `Array.prototype.forEach` method implementation
922
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
923
- var arrayForEach = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
924
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
925
- } : [].forEach;
926
-
927
- // `Array.prototype.forEach` method
928
- // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
929
- _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, {
930
- forEach: arrayForEach
931
- });
932
-
933
- var $indexOf = arrayIncludes.indexOf;
934
-
935
-
936
-
937
- var nativeIndexOf = [].indexOf;
938
-
939
- var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
940
- var STRICT_METHOD$1 = arrayMethodIsStrict('indexOf');
941
- var USES_TO_LENGTH$1 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
942
-
943
- // `Array.prototype.indexOf` method
944
- // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
945
- _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$1 || !USES_TO_LENGTH$1 }, {
946
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
947
- return NEGATIVE_ZERO
948
- // convert -0 to +0
949
- ? nativeIndexOf.apply(this, arguments) || 0
950
- : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
951
- }
952
- });
953
-
954
- var nativeJoin = [].join;
955
-
956
- var ES3_STRINGS = indexedObject != Object;
957
- var STRICT_METHOD$2 = arrayMethodIsStrict('join', ',');
958
-
959
- // `Array.prototype.join` method
960
- // https://tc39.github.io/ecma262/#sec-array.prototype.join
961
- _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$2 }, {
962
- join: function join(separator) {
963
- return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
964
- }
965
- });
966
-
967
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
968
- var createMethod$2 = function (IS_RIGHT) {
969
- return function (that, callbackfn, argumentsLength, memo) {
970
- aFunction$1(callbackfn);
971
- var O = toObject(that);
972
- var self = indexedObject(O);
973
- var length = toLength(O.length);
974
- var index = IS_RIGHT ? length - 1 : 0;
975
- var i = IS_RIGHT ? -1 : 1;
976
- if (argumentsLength < 2) while (true) {
977
- if (index in self) {
978
- memo = self[index];
979
- index += i;
980
- break;
981
- }
982
- index += i;
983
- if (IS_RIGHT ? index < 0 : length <= index) {
984
- throw TypeError('Reduce of empty array with no initial value');
985
- }
986
- }
987
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
988
- memo = callbackfn(memo, self[index], index, O);
989
- }
990
- return memo;
991
- };
992
- };
993
-
994
- var arrayReduce = {
995
- // `Array.prototype.reduce` method
996
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
997
- left: createMethod$2(false),
998
- // `Array.prototype.reduceRight` method
999
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
1000
- right: createMethod$2(true)
1001
- };
1002
-
1003
- var $reduce = arrayReduce.left;
1004
-
1005
-
1006
-
1007
- var STRICT_METHOD$3 = arrayMethodIsStrict('reduce');
1008
- var USES_TO_LENGTH$2 = arrayMethodUsesToLength('reduce', { 1: 0 });
1009
-
1010
- // `Array.prototype.reduce` method
1011
- // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
1012
- _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$3 || !USES_TO_LENGTH$2 }, {
1013
- reduce: function reduce(callbackfn /* , initialValue */) {
1014
- return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
1015
- }
1016
- });
1017
-
1018
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
1019
- var USES_TO_LENGTH$3 = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
1020
-
1021
- var SPECIES$2 = wellKnownSymbol('species');
1022
- var nativeSlice = [].slice;
1023
- var max$1 = Math.max;
1024
-
1025
- // `Array.prototype.slice` method
1026
- // https://tc39.github.io/ecma262/#sec-array.prototype.slice
1027
- // fallback for not array-like ES3 strings and DOM objects
1028
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH$3 }, {
1029
- slice: function slice(start, end) {
1030
- var O = toIndexedObject(this);
1031
- var length = toLength(O.length);
1032
- var k = toAbsoluteIndex(start, length);
1033
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
1034
- // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
1035
- var Constructor, result, n;
1036
- if (isArray(O)) {
1037
- Constructor = O.constructor;
1038
- // cross-realm fallback
1039
- if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
1040
- Constructor = undefined;
1041
- } else if (isObject(Constructor)) {
1042
- Constructor = Constructor[SPECIES$2];
1043
- if (Constructor === null) Constructor = undefined;
1044
- }
1045
- if (Constructor === Array || Constructor === undefined) {
1046
- return nativeSlice.call(O, k, fin);
1047
- }
1048
- }
1049
- result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
1050
- for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
1051
- result.length = n;
1052
- return result;
1053
- }
1054
- });
1055
-
1056
- var defineProperty$1 = objectDefineProperty.f;
1057
-
1058
- var FunctionPrototype = Function.prototype;
1059
- var FunctionPrototypeToString = FunctionPrototype.toString;
1060
- var nameRE = /^\s*function ([^ (]*)/;
1061
- var NAME = 'name';
1062
-
1063
- // Function instances `.name` property
1064
- // https://tc39.github.io/ecma262/#sec-function-instances-name
1065
- if (descriptors && !(NAME in FunctionPrototype)) {
1066
- defineProperty$1(FunctionPrototype, NAME, {
1067
- configurable: true,
1068
- get: function () {
1069
- try {
1070
- return FunctionPrototypeToString.call(this).match(nameRE)[1];
1071
- } catch (error) {
1072
- return '';
1073
- }
1074
- }
1075
- });
1076
- }
1077
-
1078
- // `thisNumberValue` abstract operation
1079
- // https://tc39.github.io/ecma262/#sec-thisnumbervalue
1080
- var thisNumberValue = function (value) {
1081
- if (typeof value != 'number' && classofRaw(value) != 'Number') {
1082
- throw TypeError('Incorrect invocation');
1083
- }
1084
- return +value;
1085
- };
1086
-
1087
- // `String.prototype.repeat` method implementation
1088
- // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
1089
- var stringRepeat = ''.repeat || function repeat(count) {
1090
- var str = String(requireObjectCoercible(this));
1091
- var result = '';
1092
- var n = toInteger(count);
1093
- if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
1094
- for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
1095
- return result;
1096
- };
1097
-
1098
- var nativeToFixed = 1.0.toFixed;
1099
- var floor$1 = Math.floor;
1100
-
1101
- var pow = function (x, n, acc) {
1102
- return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
1103
- };
1104
-
1105
- var log = function (x) {
1106
- var n = 0;
1107
- var x2 = x;
1108
- while (x2 >= 4096) {
1109
- n += 12;
1110
- x2 /= 4096;
1111
- }
1112
- while (x2 >= 2) {
1113
- n += 1;
1114
- x2 /= 2;
1115
- } return n;
1116
- };
1117
-
1118
- var FORCED$1 = nativeToFixed && (
1119
- 0.00008.toFixed(3) !== '0.000' ||
1120
- 0.9.toFixed(0) !== '1' ||
1121
- 1.255.toFixed(2) !== '1.25' ||
1122
- 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
1123
- ) || !fails(function () {
1124
- // V8 ~ Android 4.3-
1125
- nativeToFixed.call({});
1126
- });
1127
-
1128
- // `Number.prototype.toFixed` method
1129
- // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed
1130
- _export({ target: 'Number', proto: true, forced: FORCED$1 }, {
1131
- // eslint-disable-next-line max-statements
1132
- toFixed: function toFixed(fractionDigits) {
1133
- var number = thisNumberValue(this);
1134
- var fractDigits = toInteger(fractionDigits);
1135
- var data = [0, 0, 0, 0, 0, 0];
1136
- var sign = '';
1137
- var result = '0';
1138
- var e, z, j, k;
1139
-
1140
- var multiply = function (n, c) {
1141
- var index = -1;
1142
- var c2 = c;
1143
- while (++index < 6) {
1144
- c2 += n * data[index];
1145
- data[index] = c2 % 1e7;
1146
- c2 = floor$1(c2 / 1e7);
1147
- }
1148
- };
1149
-
1150
- var divide = function (n) {
1151
- var index = 6;
1152
- var c = 0;
1153
- while (--index >= 0) {
1154
- c += data[index];
1155
- data[index] = floor$1(c / n);
1156
- c = (c % n) * 1e7;
1157
- }
1158
- };
1159
-
1160
- var dataToString = function () {
1161
- var index = 6;
1162
- var s = '';
1163
- while (--index >= 0) {
1164
- if (s !== '' || index === 0 || data[index] !== 0) {
1165
- var t = String(data[index]);
1166
- s = s === '' ? t : s + stringRepeat.call('0', 7 - t.length) + t;
1167
- }
1168
- } return s;
1169
- };
1170
-
1171
- if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
1172
- // eslint-disable-next-line no-self-compare
1173
- if (number != number) return 'NaN';
1174
- if (number <= -1e21 || number >= 1e21) return String(number);
1175
- if (number < 0) {
1176
- sign = '-';
1177
- number = -number;
1178
- }
1179
- if (number > 1e-21) {
1180
- e = log(number * pow(2, 69, 1)) - 69;
1181
- z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
1182
- z *= 0x10000000000000;
1183
- e = 52 - e;
1184
- if (e > 0) {
1185
- multiply(0, z);
1186
- j = fractDigits;
1187
- while (j >= 7) {
1188
- multiply(1e7, 0);
1189
- j -= 7;
1190
- }
1191
- multiply(pow(10, j, 1), 0);
1192
- j = e - 1;
1193
- while (j >= 23) {
1194
- divide(1 << 23);
1195
- j -= 23;
1196
- }
1197
- divide(1 << j);
1198
- multiply(1, 1);
1199
- divide(2);
1200
- result = dataToString();
1201
- } else {
1202
- multiply(0, z);
1203
- multiply(1 << -e, 0);
1204
- result = dataToString() + stringRepeat.call('0', fractDigits);
1205
- }
1206
- }
1207
- if (fractDigits > 0) {
1208
- k = result.length;
1209
- result = sign + (k <= fractDigits
1210
- ? '0.' + stringRepeat.call('0', fractDigits - k) + result
1211
- : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
1212
- } else {
1213
- result = sign + result;
1214
- } return result;
1215
- }
1216
- });
1217
-
1218
- var nativeAssign = Object.assign;
1219
- var defineProperty$2 = Object.defineProperty;
1220
-
1221
- // `Object.assign` method
1222
- // https://tc39.github.io/ecma262/#sec-object.assign
1223
- var objectAssign = !nativeAssign || fails(function () {
1224
- // should have correct order of operations (Edge bug)
1225
- if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$2({}, 'a', {
1226
- enumerable: true,
1227
- get: function () {
1228
- defineProperty$2(this, 'b', {
1229
- value: 3,
1230
- enumerable: false
1231
- });
1232
- }
1233
- }), { b: 2 })).b !== 1) return true;
1234
- // should work with symbols and should have deterministic property order (V8 bug)
1235
- var A = {};
1236
- var B = {};
1237
- // eslint-disable-next-line no-undef
1238
- var symbol = Symbol();
1239
- var alphabet = 'abcdefghijklmnopqrst';
1240
- A[symbol] = 7;
1241
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1242
- return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
1243
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
1244
- var T = toObject(target);
1245
- var argumentsLength = arguments.length;
1246
- var index = 1;
1247
- var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
1248
- var propertyIsEnumerable = objectPropertyIsEnumerable.f;
1249
- while (argumentsLength > index) {
1250
- var S = indexedObject(arguments[index++]);
1251
- var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
1252
- var length = keys.length;
1253
- var j = 0;
1254
- var key;
1255
- while (length > j) {
1256
- key = keys[j++];
1257
- if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
1258
- }
1259
- } return T;
1260
- } : nativeAssign;
1261
-
1262
- // `Object.assign` method
1263
- // https://tc39.github.io/ecma262/#sec-object.assign
1264
- _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
1265
- assign: objectAssign
1266
- });
1267
-
1268
- var correctPrototypeGetter = !fails(function () {
1269
- function F() { /* empty */ }
1270
- F.prototype.constructor = null;
1271
- return Object.getPrototypeOf(new F()) !== F.prototype;
1272
- });
1273
-
1274
- var IE_PROTO$1 = sharedKey('IE_PROTO');
1275
- var ObjectPrototype = Object.prototype;
1276
-
1277
- // `Object.getPrototypeOf` method
1278
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
1279
- var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
1280
- O = toObject(O);
1281
- if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
1282
- if (typeof O.constructor == 'function' && O instanceof O.constructor) {
1283
- return O.constructor.prototype;
1284
- } return O instanceof Object ? ObjectPrototype : null;
1285
- };
1286
-
1287
- var FAILS_ON_PRIMITIVES = fails(function () { objectGetPrototypeOf(1); });
1288
-
1289
- // `Object.getPrototypeOf` method
1290
- // https://tc39.github.io/ecma262/#sec-object.getprototypeof
1291
- _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !correctPrototypeGetter }, {
1292
- getPrototypeOf: function getPrototypeOf(it) {
1293
- return objectGetPrototypeOf(toObject(it));
1294
- }
1295
- });
1296
-
1297
- var FAILS_ON_PRIMITIVES$1 = fails(function () { objectKeys(1); });
1298
-
1299
- // `Object.keys` method
1300
- // https://tc39.github.io/ecma262/#sec-object.keys
1301
- _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, {
1302
- keys: function keys(it) {
1303
- return objectKeys(toObject(it));
1304
- }
1305
- });
1306
-
1307
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1308
- var test = {};
1309
-
1310
- test[TO_STRING_TAG] = 'z';
1311
-
1312
- var toStringTagSupport = String(test) === '[object z]';
1313
-
1314
- var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1315
- // ES3 wrong here
1316
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1317
-
1318
- // fallback for IE11 Script Access Denied error
1319
- var tryGet = function (it, key) {
1320
- try {
1321
- return it[key];
1322
- } catch (error) { /* empty */ }
1323
- };
1324
-
1325
- // getting tag from ES6+ `Object.prototype.toString`
1326
- var classof = toStringTagSupport ? classofRaw : function (it) {
1327
- var O, tag, result;
1328
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1329
- // @@toStringTag case
1330
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
1331
- // builtinTag case
1332
- : CORRECT_ARGUMENTS ? classofRaw(O)
1333
- // ES3 arguments fallback
1334
- : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1335
- };
1336
-
1337
- // `Object.prototype.toString` method implementation
1338
- // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1339
- var objectToString = toStringTagSupport ? {}.toString : function toString() {
1340
- return '[object ' + classof(this) + ']';
1341
- };
1342
-
1343
- // `Object.prototype.toString` method
1344
- // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1345
- if (!toStringTagSupport) {
1346
- redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
1347
- }
1348
-
1349
- // a string of all valid unicode whitespaces
1350
- // eslint-disable-next-line max-len
1351
- var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1352
-
1353
- var whitespace = '[' + whitespaces + ']';
1354
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
1355
- var rtrim = RegExp(whitespace + whitespace + '*$');
1356
-
1357
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1358
- var createMethod$3 = function (TYPE) {
1359
- return function ($this) {
1360
- var string = String(requireObjectCoercible($this));
1361
- if (TYPE & 1) string = string.replace(ltrim, '');
1362
- if (TYPE & 2) string = string.replace(rtrim, '');
1363
- return string;
1364
- };
1365
- };
1366
-
1367
- var stringTrim = {
1368
- // `String.prototype.{ trimLeft, trimStart }` methods
1369
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
1370
- start: createMethod$3(1),
1371
- // `String.prototype.{ trimRight, trimEnd }` methods
1372
- // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
1373
- end: createMethod$3(2),
1374
- // `String.prototype.trim` method
1375
- // https://tc39.github.io/ecma262/#sec-string.prototype.trim
1376
- trim: createMethod$3(3)
1377
- };
1378
-
1379
- var trim = stringTrim.trim;
1380
-
1381
-
1382
- var $parseFloat = global_1.parseFloat;
1383
- var FORCED$2 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
1384
-
1385
- // `parseFloat` method
1386
- // https://tc39.github.io/ecma262/#sec-parsefloat-string
1387
- var numberParseFloat = FORCED$2 ? function parseFloat(string) {
1388
- var trimmedString = trim(String(string));
1389
- var result = $parseFloat(trimmedString);
1390
- return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
1391
- } : $parseFloat;
1392
-
1393
- // `parseFloat` method
1394
- // https://tc39.github.io/ecma262/#sec-parsefloat-string
1395
- _export({ global: true, forced: parseFloat != numberParseFloat }, {
1396
- parseFloat: numberParseFloat
1397
- });
1398
-
1399
- var nativePromiseConstructor = global_1.Promise;
1400
-
1401
- var redefineAll = function (target, src, options) {
1402
- for (var key in src) redefine(target, key, src[key], options);
1403
- return target;
1404
- };
1405
-
1406
- var defineProperty$3 = objectDefineProperty.f;
1407
-
1408
-
1409
-
1410
- var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
1411
-
1412
- var setToStringTag = function (it, TAG, STATIC) {
1413
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG$2)) {
1414
- defineProperty$3(it, TO_STRING_TAG$2, { configurable: true, value: TAG });
1415
- }
1416
- };
1417
-
1418
- var SPECIES$3 = wellKnownSymbol('species');
1419
-
1420
- var setSpecies = function (CONSTRUCTOR_NAME) {
1421
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
1422
- var defineProperty = objectDefineProperty.f;
1423
-
1424
- if (descriptors && Constructor && !Constructor[SPECIES$3]) {
1425
- defineProperty(Constructor, SPECIES$3, {
1426
- configurable: true,
1427
- get: function () { return this; }
1428
- });
1429
- }
1430
- };
1431
-
1432
- var anInstance = function (it, Constructor, name) {
1433
- if (!(it instanceof Constructor)) {
1434
- throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
1435
- } return it;
1436
- };
1437
-
1438
- var iterators = {};
1439
-
1440
- var ITERATOR = wellKnownSymbol('iterator');
1441
- var ArrayPrototype$1 = Array.prototype;
1442
-
1443
- // check on default Array iterator
1444
- var isArrayIteratorMethod = function (it) {
1445
- return it !== undefined && (iterators.Array === it || ArrayPrototype$1[ITERATOR] === it);
1446
- };
1447
-
1448
- var ITERATOR$1 = wellKnownSymbol('iterator');
1449
-
1450
- var getIteratorMethod = function (it) {
1451
- if (it != undefined) return it[ITERATOR$1]
1452
- || it['@@iterator']
1453
- || iterators[classof(it)];
1454
- };
1455
-
1456
- // call something on iterator step with safe closing on error
1457
- var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
1458
- try {
1459
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
1460
- // 7.4.6 IteratorClose(iterator, completion)
1461
- } catch (error) {
1462
- var returnMethod = iterator['return'];
1463
- if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
1464
- throw error;
1465
- }
1466
- };
1467
-
1468
- var iterate_1 = createCommonjsModule(function (module) {
1469
- var Result = function (stopped, result) {
1470
- this.stopped = stopped;
1471
- this.result = result;
1472
- };
1473
-
1474
- var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
1475
- var boundFunction = functionBindContext(fn, that, AS_ENTRIES ? 2 : 1);
1476
- var iterator, iterFn, index, length, result, next, step;
1477
-
1478
- if (IS_ITERATOR) {
1479
- iterator = iterable;
1480
- } else {
1481
- iterFn = getIteratorMethod(iterable);
1482
- if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
1483
- // optimisation for array iterators
1484
- if (isArrayIteratorMethod(iterFn)) {
1485
- for (index = 0, length = toLength(iterable.length); length > index; index++) {
1486
- result = AS_ENTRIES
1487
- ? boundFunction(anObject(step = iterable[index])[0], step[1])
1488
- : boundFunction(iterable[index]);
1489
- if (result && result instanceof Result) return result;
1490
- } return new Result(false);
1491
- }
1492
- iterator = iterFn.call(iterable);
1493
- }
1494
-
1495
- next = iterator.next;
1496
- while (!(step = next.call(iterator)).done) {
1497
- result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
1498
- if (typeof result == 'object' && result && result instanceof Result) return result;
1499
- } return new Result(false);
1500
- };
1501
-
1502
- iterate.stop = function (result) {
1503
- return new Result(true, result);
1504
- };
1505
- });
1506
-
1507
- var ITERATOR$2 = wellKnownSymbol('iterator');
1508
- var SAFE_CLOSING = false;
1509
-
1510
- try {
1511
- var called = 0;
1512
- var iteratorWithReturn = {
1513
- next: function () {
1514
- return { done: !!called++ };
1515
- },
1516
- 'return': function () {
1517
- SAFE_CLOSING = true;
1518
- }
1519
- };
1520
- iteratorWithReturn[ITERATOR$2] = function () {
1521
- return this;
1522
- };
1523
- // eslint-disable-next-line no-throw-literal
1524
- Array.from(iteratorWithReturn, function () { throw 2; });
1525
- } catch (error) { /* empty */ }
1526
-
1527
- var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
1528
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
1529
- var ITERATION_SUPPORT = false;
1530
- try {
1531
- var object = {};
1532
- object[ITERATOR$2] = function () {
1533
- return {
1534
- next: function () {
1535
- return { done: ITERATION_SUPPORT = true };
1536
- }
1537
- };
1538
- };
1539
- exec(object);
1540
- } catch (error) { /* empty */ }
1541
- return ITERATION_SUPPORT;
1542
- };
1543
-
1544
- var SPECIES$4 = wellKnownSymbol('species');
1545
-
1546
- // `SpeciesConstructor` abstract operation
1547
- // https://tc39.github.io/ecma262/#sec-speciesconstructor
1548
- var speciesConstructor = function (O, defaultConstructor) {
1549
- var C = anObject(O).constructor;
1550
- var S;
1551
- return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
1552
- };
1553
-
1554
- var engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent);
1555
-
1556
- var location$1 = global_1.location;
1557
- var set$1 = global_1.setImmediate;
1558
- var clear = global_1.clearImmediate;
1559
- var process$1 = global_1.process;
1560
- var MessageChannel = global_1.MessageChannel;
1561
- var Dispatch = global_1.Dispatch;
1562
- var counter = 0;
1563
- var queue = {};
1564
- var ONREADYSTATECHANGE = 'onreadystatechange';
1565
- var defer, channel, port;
1566
-
1567
- var run = function (id) {
1568
- // eslint-disable-next-line no-prototype-builtins
1569
- if (queue.hasOwnProperty(id)) {
1570
- var fn = queue[id];
1571
- delete queue[id];
1572
- fn();
1573
- }
1574
- };
1575
-
1576
- var runner = function (id) {
1577
- return function () {
1578
- run(id);
1579
- };
1580
- };
1581
-
1582
- var listener = function (event) {
1583
- run(event.data);
1584
- };
1585
-
1586
- var post = function (id) {
1587
- // old engines have not location.origin
1588
- global_1.postMessage(id + '', location$1.protocol + '//' + location$1.host);
1589
- };
1590
-
1591
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1592
- if (!set$1 || !clear) {
1593
- set$1 = function setImmediate(fn) {
1594
- var args = [];
1595
- var i = 1;
1596
- while (arguments.length > i) args.push(arguments[i++]);
1597
- queue[++counter] = function () {
1598
- // eslint-disable-next-line no-new-func
1599
- (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
1600
- };
1601
- defer(counter);
1602
- return counter;
1603
- };
1604
- clear = function clearImmediate(id) {
1605
- delete queue[id];
1606
- };
1607
- // Node.js 0.8-
1608
- if (classofRaw(process$1) == 'process') {
1609
- defer = function (id) {
1610
- process$1.nextTick(runner(id));
1611
- };
1612
- // Sphere (JS game engine) Dispatch API
1613
- } else if (Dispatch && Dispatch.now) {
1614
- defer = function (id) {
1615
- Dispatch.now(runner(id));
1616
- };
1617
- // Browsers with MessageChannel, includes WebWorkers
1618
- // except iOS - https://github.com/zloirock/core-js/issues/624
1619
- } else if (MessageChannel && !engineIsIos) {
1620
- channel = new MessageChannel();
1621
- port = channel.port2;
1622
- channel.port1.onmessage = listener;
1623
- defer = functionBindContext(port.postMessage, port, 1);
1624
- // Browsers with postMessage, skip WebWorkers
1625
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1626
- } else if (
1627
- global_1.addEventListener &&
1628
- typeof postMessage == 'function' &&
1629
- !global_1.importScripts &&
1630
- !fails(post) &&
1631
- location$1.protocol !== 'file:'
1632
- ) {
1633
- defer = post;
1634
- global_1.addEventListener('message', listener, false);
1635
- // IE8-
1636
- } else if (ONREADYSTATECHANGE in documentCreateElement('script')) {
1637
- defer = function (id) {
1638
- html.appendChild(documentCreateElement('script'))[ONREADYSTATECHANGE] = function () {
1639
- html.removeChild(this);
1640
- run(id);
1641
- };
1642
- };
1643
- // Rest old browsers
1644
- } else {
1645
- defer = function (id) {
1646
- setTimeout(runner(id), 0);
1647
- };
1648
- }
1649
- }
1650
-
1651
- var task = {
1652
- set: set$1,
1653
- clear: clear
1654
- };
1655
-
1656
- var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
1657
-
1658
- var macrotask = task.set;
1659
-
1660
-
1661
- var MutationObserver = global_1.MutationObserver || global_1.WebKitMutationObserver;
1662
- var process$2 = global_1.process;
1663
- var Promise$1 = global_1.Promise;
1664
- var IS_NODE = classofRaw(process$2) == 'process';
1665
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1666
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor$2(global_1, 'queueMicrotask');
1667
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1668
-
1669
- var flush, head, last, notify, toggle, node, promise, then;
1670
-
1671
- // modern engines have queueMicrotask method
1672
- if (!queueMicrotask) {
1673
- flush = function () {
1674
- var parent, fn;
1675
- if (IS_NODE && (parent = process$2.domain)) parent.exit();
1676
- while (head) {
1677
- fn = head.fn;
1678
- head = head.next;
1679
- try {
1680
- fn();
1681
- } catch (error) {
1682
- if (head) notify();
1683
- else last = undefined;
1684
- throw error;
1685
- }
1686
- } last = undefined;
1687
- if (parent) parent.enter();
1688
- };
1689
-
1690
- // Node.js
1691
- if (IS_NODE) {
1692
- notify = function () {
1693
- process$2.nextTick(flush);
1694
- };
1695
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1696
- } else if (MutationObserver && !engineIsIos) {
1697
- toggle = true;
1698
- node = document.createTextNode('');
1699
- new MutationObserver(flush).observe(node, { characterData: true });
1700
- notify = function () {
1701
- node.data = toggle = !toggle;
1702
- };
1703
- // environments with maybe non-completely correct, but existent Promise
1704
- } else if (Promise$1 && Promise$1.resolve) {
1705
- // Promise.resolve without an argument throws an error in LG WebOS 2
1706
- promise = Promise$1.resolve(undefined);
1707
- then = promise.then;
1708
- notify = function () {
1709
- then.call(promise, flush);
1710
- };
1711
- // for other environments - macrotask based on:
1712
- // - setImmediate
1713
- // - MessageChannel
1714
- // - window.postMessag
1715
- // - onreadystatechange
1716
- // - setTimeout
1717
- } else {
1718
- notify = function () {
1719
- // strange IE + webpack dev server bug - use .call(global)
1720
- macrotask.call(global_1, flush);
1721
- };
1722
- }
1723
- }
1724
-
1725
- var microtask = queueMicrotask || function (fn) {
1726
- var task = { fn: fn, next: undefined };
1727
- if (last) last.next = task;
1728
- if (!head) {
1729
- head = task;
1730
- notify();
1731
- } last = task;
1732
- };
1733
-
1734
- var PromiseCapability = function (C) {
1735
- var resolve, reject;
1736
- this.promise = new C(function ($$resolve, $$reject) {
1737
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1738
- resolve = $$resolve;
1739
- reject = $$reject;
1740
- });
1741
- this.resolve = aFunction$1(resolve);
1742
- this.reject = aFunction$1(reject);
1743
- };
1744
-
1745
- // 25.4.1.5 NewPromiseCapability(C)
1746
- var f$5 = function (C) {
1747
- return new PromiseCapability(C);
1748
- };
1749
-
1750
- var newPromiseCapability = {
1751
- f: f$5
1752
- };
1753
-
1754
- var promiseResolve = function (C, x) {
1755
- anObject(C);
1756
- if (isObject(x) && x.constructor === C) return x;
1757
- var promiseCapability = newPromiseCapability.f(C);
1758
- var resolve = promiseCapability.resolve;
1759
- resolve(x);
1760
- return promiseCapability.promise;
1761
- };
1762
-
1763
- var hostReportErrors = function (a, b) {
1764
- var console = global_1.console;
1765
- if (console && console.error) {
1766
- arguments.length === 1 ? console.error(a) : console.error(a, b);
1767
- }
1768
- };
1769
-
1770
- var perform = function (exec) {
1771
- try {
1772
- return { error: false, value: exec() };
1773
- } catch (error) {
1774
- return { error: true, value: error };
1775
- }
1776
- };
1777
-
1778
- var task$1 = task.set;
1779
-
1780
-
1781
-
1782
-
1783
-
1784
-
1785
-
1786
-
1787
-
1788
-
1789
- var SPECIES$5 = wellKnownSymbol('species');
1790
- var PROMISE = 'Promise';
1791
- var getInternalState = internalState.get;
1792
- var setInternalState = internalState.set;
1793
- var getInternalPromiseState = internalState.getterFor(PROMISE);
1794
- var PromiseConstructor = nativePromiseConstructor;
1795
- var TypeError$1 = global_1.TypeError;
1796
- var document$2 = global_1.document;
1797
- var process$3 = global_1.process;
1798
- var $fetch = getBuiltIn('fetch');
1799
- var newPromiseCapability$1 = newPromiseCapability.f;
1800
- var newGenericPromiseCapability = newPromiseCapability$1;
1801
- var IS_NODE$1 = classofRaw(process$3) == 'process';
1802
- var DISPATCH_EVENT = !!(document$2 && document$2.createEvent && global_1.dispatchEvent);
1803
- var UNHANDLED_REJECTION = 'unhandledrejection';
1804
- var REJECTION_HANDLED = 'rejectionhandled';
1805
- var PENDING = 0;
1806
- var FULFILLED = 1;
1807
- var REJECTED = 2;
1808
- var HANDLED = 1;
1809
- var UNHANDLED = 2;
1810
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1811
-
1812
- var FORCED$3 = isForced_1(PROMISE, function () {
1813
- var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
1814
- if (!GLOBAL_CORE_JS_PROMISE) {
1815
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1816
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1817
- // We can't detect it synchronously, so just check versions
1818
- if (engineV8Version === 66) return true;
1819
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1820
- if (!IS_NODE$1 && typeof PromiseRejectionEvent != 'function') return true;
1821
- }
1822
- // We can't use @@species feature detection in V8 since it causes
1823
- // deoptimization and performance degradation
1824
- // https://github.com/zloirock/core-js/issues/679
1825
- if (engineV8Version >= 51 && /native code/.test(PromiseConstructor)) return false;
1826
- // Detect correctness of subclassing with @@species support
1827
- var promise = PromiseConstructor.resolve(1);
1828
- var FakePromise = function (exec) {
1829
- exec(function () { /* empty */ }, function () { /* empty */ });
1830
- };
1831
- var constructor = promise.constructor = {};
1832
- constructor[SPECIES$5] = FakePromise;
1833
- return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
1834
- });
1835
-
1836
- var INCORRECT_ITERATION = FORCED$3 || !checkCorrectnessOfIteration(function (iterable) {
1837
- PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
1838
- });
1839
-
1840
- // helpers
1841
- var isThenable = function (it) {
1842
- var then;
1843
- return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
1844
- };
1845
-
1846
- var notify$1 = function (promise, state, isReject) {
1847
- if (state.notified) return;
1848
- state.notified = true;
1849
- var chain = state.reactions;
1850
- microtask(function () {
1851
- var value = state.value;
1852
- var ok = state.state == FULFILLED;
1853
- var index = 0;
1854
- // variable length - can't use forEach
1855
- while (chain.length > index) {
1856
- var reaction = chain[index++];
1857
- var handler = ok ? reaction.ok : reaction.fail;
1858
- var resolve = reaction.resolve;
1859
- var reject = reaction.reject;
1860
- var domain = reaction.domain;
1861
- var result, then, exited;
1862
- try {
1863
- if (handler) {
1864
- if (!ok) {
1865
- if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
1866
- state.rejection = HANDLED;
1867
- }
1868
- if (handler === true) result = value;
1869
- else {
1870
- if (domain) domain.enter();
1871
- result = handler(value); // can throw
1872
- if (domain) {
1873
- domain.exit();
1874
- exited = true;
1875
- }
1876
- }
1877
- if (result === reaction.promise) {
1878
- reject(TypeError$1('Promise-chain cycle'));
1879
- } else if (then = isThenable(result)) {
1880
- then.call(result, resolve, reject);
1881
- } else resolve(result);
1882
- } else reject(value);
1883
- } catch (error) {
1884
- if (domain && !exited) domain.exit();
1885
- reject(error);
1886
- }
1887
- }
1888
- state.reactions = [];
1889
- state.notified = false;
1890
- if (isReject && !state.rejection) onUnhandled(promise, state);
1891
- });
1892
- };
1893
-
1894
- var dispatchEvent = function (name, promise, reason) {
1895
- var event, handler;
1896
- if (DISPATCH_EVENT) {
1897
- event = document$2.createEvent('Event');
1898
- event.promise = promise;
1899
- event.reason = reason;
1900
- event.initEvent(name, false, true);
1901
- global_1.dispatchEvent(event);
1902
- } else event = { promise: promise, reason: reason };
1903
- if (handler = global_1['on' + name]) handler(event);
1904
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1905
- };
1906
-
1907
- var onUnhandled = function (promise, state) {
1908
- task$1.call(global_1, function () {
1909
- var value = state.value;
1910
- var IS_UNHANDLED = isUnhandled(state);
1911
- var result;
1912
- if (IS_UNHANDLED) {
1913
- result = perform(function () {
1914
- if (IS_NODE$1) {
1915
- process$3.emit('unhandledRejection', value, promise);
1916
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
1917
- });
1918
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
1919
- state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED;
1920
- if (result.error) throw result.value;
1921
- }
1922
- });
1923
- };
1924
-
1925
- var isUnhandled = function (state) {
1926
- return state.rejection !== HANDLED && !state.parent;
1927
- };
1928
-
1929
- var onHandleUnhandled = function (promise, state) {
1930
- task$1.call(global_1, function () {
1931
- if (IS_NODE$1) {
1932
- process$3.emit('rejectionHandled', promise);
1933
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
1934
- });
1935
- };
1936
-
1937
- var bind = function (fn, promise, state, unwrap) {
1938
- return function (value) {
1939
- fn(promise, state, value, unwrap);
1940
- };
1941
- };
1942
-
1943
- var internalReject = function (promise, state, value, unwrap) {
1944
- if (state.done) return;
1945
- state.done = true;
1946
- if (unwrap) state = unwrap;
1947
- state.value = value;
1948
- state.state = REJECTED;
1949
- notify$1(promise, state, true);
1950
- };
1951
-
1952
- var internalResolve = function (promise, state, value, unwrap) {
1953
- if (state.done) return;
1954
- state.done = true;
1955
- if (unwrap) state = unwrap;
1956
- try {
1957
- if (promise === value) throw TypeError$1("Promise can't be resolved itself");
1958
- var then = isThenable(value);
1959
- if (then) {
1960
- microtask(function () {
1961
- var wrapper = { done: false };
1962
- try {
1963
- then.call(value,
1964
- bind(internalResolve, promise, wrapper, state),
1965
- bind(internalReject, promise, wrapper, state)
1966
- );
1967
- } catch (error) {
1968
- internalReject(promise, wrapper, error, state);
1969
- }
1970
- });
1971
- } else {
1972
- state.value = value;
1973
- state.state = FULFILLED;
1974
- notify$1(promise, state, false);
1975
- }
1976
- } catch (error) {
1977
- internalReject(promise, { done: false }, error, state);
1978
- }
1979
- };
1980
-
1981
- // constructor polyfill
1982
- if (FORCED$3) {
1983
- // 25.4.3.1 Promise(executor)
1984
- PromiseConstructor = function Promise(executor) {
1985
- anInstance(this, PromiseConstructor, PROMISE);
1986
- aFunction$1(executor);
1987
- Internal.call(this);
1988
- var state = getInternalState(this);
1989
- try {
1990
- executor(bind(internalResolve, this, state), bind(internalReject, this, state));
1991
- } catch (error) {
1992
- internalReject(this, state, error);
1993
- }
1994
- };
1995
- // eslint-disable-next-line no-unused-vars
1996
- Internal = function Promise(executor) {
1997
- setInternalState(this, {
1998
- type: PROMISE,
1999
- done: false,
2000
- notified: false,
2001
- parent: false,
2002
- reactions: [],
2003
- rejection: false,
2004
- state: PENDING,
2005
- value: undefined
2006
- });
2007
- };
2008
- Internal.prototype = redefineAll(PromiseConstructor.prototype, {
2009
- // `Promise.prototype.then` method
2010
- // https://tc39.github.io/ecma262/#sec-promise.prototype.then
2011
- then: function then(onFulfilled, onRejected) {
2012
- var state = getInternalPromiseState(this);
2013
- var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2014
- reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
2015
- reaction.fail = typeof onRejected == 'function' && onRejected;
2016
- reaction.domain = IS_NODE$1 ? process$3.domain : undefined;
2017
- state.parent = true;
2018
- state.reactions.push(reaction);
2019
- if (state.state != PENDING) notify$1(this, state, false);
2020
- return reaction.promise;
2021
- },
2022
- // `Promise.prototype.catch` method
2023
- // https://tc39.github.io/ecma262/#sec-promise.prototype.catch
2024
- 'catch': function (onRejected) {
2025
- return this.then(undefined, onRejected);
2026
- }
2027
- });
2028
- OwnPromiseCapability = function () {
2029
- var promise = new Internal();
2030
- var state = getInternalState(promise);
2031
- this.promise = promise;
2032
- this.resolve = bind(internalResolve, promise, state);
2033
- this.reject = bind(internalReject, promise, state);
2034
- };
2035
- newPromiseCapability.f = newPromiseCapability$1 = function (C) {
2036
- return C === PromiseConstructor || C === PromiseWrapper
2037
- ? new OwnPromiseCapability(C)
2038
- : newGenericPromiseCapability(C);
2039
- };
2040
-
2041
- if ( typeof nativePromiseConstructor == 'function') {
2042
- nativeThen = nativePromiseConstructor.prototype.then;
2043
-
2044
- // wrap native Promise#then for native async functions
2045
- redefine(nativePromiseConstructor.prototype, 'then', function then(onFulfilled, onRejected) {
2046
- var that = this;
2047
- return new PromiseConstructor(function (resolve, reject) {
2048
- nativeThen.call(that, resolve, reject);
2049
- }).then(onFulfilled, onRejected);
2050
- // https://github.com/zloirock/core-js/issues/640
2051
- }, { unsafe: true });
2052
-
2053
- // wrap fetch result
2054
- if (typeof $fetch == 'function') _export({ global: true, enumerable: true, forced: true }, {
2055
- // eslint-disable-next-line no-unused-vars
2056
- fetch: function fetch(input /* , init */) {
2057
- return promiseResolve(PromiseConstructor, $fetch.apply(global_1, arguments));
2058
- }
2059
- });
2060
- }
2061
- }
2062
-
2063
- _export({ global: true, wrap: true, forced: FORCED$3 }, {
2064
- Promise: PromiseConstructor
2065
- });
2066
-
2067
- setToStringTag(PromiseConstructor, PROMISE, false);
2068
- setSpecies(PROMISE);
2069
-
2070
- PromiseWrapper = getBuiltIn(PROMISE);
2071
-
2072
- // statics
2073
- _export({ target: PROMISE, stat: true, forced: FORCED$3 }, {
2074
- // `Promise.reject` method
2075
- // https://tc39.github.io/ecma262/#sec-promise.reject
2076
- reject: function reject(r) {
2077
- var capability = newPromiseCapability$1(this);
2078
- capability.reject.call(undefined, r);
2079
- return capability.promise;
2080
- }
2081
- });
2082
-
2083
- _export({ target: PROMISE, stat: true, forced: FORCED$3 }, {
2084
- // `Promise.resolve` method
2085
- // https://tc39.github.io/ecma262/#sec-promise.resolve
2086
- resolve: function resolve(x) {
2087
- return promiseResolve( this, x);
2088
- }
2089
- });
2090
-
2091
- _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
2092
- // `Promise.all` method
2093
- // https://tc39.github.io/ecma262/#sec-promise.all
2094
- all: function all(iterable) {
2095
- var C = this;
2096
- var capability = newPromiseCapability$1(C);
2097
- var resolve = capability.resolve;
2098
- var reject = capability.reject;
2099
- var result = perform(function () {
2100
- var $promiseResolve = aFunction$1(C.resolve);
2101
- var values = [];
2102
- var counter = 0;
2103
- var remaining = 1;
2104
- iterate_1(iterable, function (promise) {
2105
- var index = counter++;
2106
- var alreadyCalled = false;
2107
- values.push(undefined);
2108
- remaining++;
2109
- $promiseResolve.call(C, promise).then(function (value) {
2110
- if (alreadyCalled) return;
2111
- alreadyCalled = true;
2112
- values[index] = value;
2113
- --remaining || resolve(values);
2114
- }, reject);
2115
- });
2116
- --remaining || resolve(values);
2117
- });
2118
- if (result.error) reject(result.value);
2119
- return capability.promise;
2120
- },
2121
- // `Promise.race` method
2122
- // https://tc39.github.io/ecma262/#sec-promise.race
2123
- race: function race(iterable) {
2124
- var C = this;
2125
- var capability = newPromiseCapability$1(C);
2126
- var reject = capability.reject;
2127
- var result = perform(function () {
2128
- var $promiseResolve = aFunction$1(C.resolve);
2129
- iterate_1(iterable, function (promise) {
2130
- $promiseResolve.call(C, promise).then(capability.resolve, reject);
2131
- });
2132
- });
2133
- if (result.error) reject(result.value);
2134
- return capability.promise;
2135
- }
2136
- });
2137
-
2138
- var aPossiblePrototype = function (it) {
2139
- if (!isObject(it) && it !== null) {
2140
- throw TypeError("Can't set " + String(it) + ' as a prototype');
2141
- } return it;
2142
- };
2143
-
2144
- // `Object.setPrototypeOf` method
2145
- // https://tc39.github.io/ecma262/#sec-object.setprototypeof
2146
- // Works with __proto__ only. Old v8 can't work with null proto objects.
2147
- /* eslint-disable no-proto */
2148
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
2149
- var CORRECT_SETTER = false;
2150
- var test = {};
2151
- var setter;
2152
- try {
2153
- setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
2154
- setter.call(test, []);
2155
- CORRECT_SETTER = test instanceof Array;
2156
- } catch (error) { /* empty */ }
2157
- return function setPrototypeOf(O, proto) {
2158
- anObject(O);
2159
- aPossiblePrototype(proto);
2160
- if (CORRECT_SETTER) setter.call(O, proto);
2161
- else O.__proto__ = proto;
2162
- return O;
2163
- };
2164
- }() : undefined);
2165
-
2166
- // makes subclassing work correct for wrapped built-ins
2167
- var inheritIfRequired = function ($this, dummy, Wrapper) {
2168
- var NewTarget, NewTargetPrototype;
2169
- if (
2170
- // it can work only with native `setPrototypeOf`
2171
- objectSetPrototypeOf &&
2172
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
2173
- typeof (NewTarget = dummy.constructor) == 'function' &&
2174
- NewTarget !== Wrapper &&
2175
- isObject(NewTargetPrototype = NewTarget.prototype) &&
2176
- NewTargetPrototype !== Wrapper.prototype
2177
- ) objectSetPrototypeOf($this, NewTargetPrototype);
2178
- return $this;
2179
- };
2180
-
2181
- var MATCH = wellKnownSymbol('match');
2182
-
2183
- // `IsRegExp` abstract operation
2184
- // https://tc39.github.io/ecma262/#sec-isregexp
2185
- var isRegexp = function (it) {
2186
- var isRegExp;
2187
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
2188
- };
2189
-
2190
- // `RegExp.prototype.flags` getter implementation
2191
- // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
2192
- var regexpFlags = function () {
2193
- var that = anObject(this);
2194
- var result = '';
2195
- if (that.global) result += 'g';
2196
- if (that.ignoreCase) result += 'i';
2197
- if (that.multiline) result += 'm';
2198
- if (that.dotAll) result += 's';
2199
- if (that.unicode) result += 'u';
2200
- if (that.sticky) result += 'y';
2201
- return result;
2202
- };
2203
-
2204
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
2205
- // so we use an intermediate function.
2206
- function RE(s, f) {
2207
- return RegExp(s, f);
2208
- }
2209
-
2210
- var UNSUPPORTED_Y = fails(function () {
2211
- // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
2212
- var re = RE('a', 'y');
2213
- re.lastIndex = 2;
2214
- return re.exec('abcd') != null;
2215
- });
2216
-
2217
- var BROKEN_CARET = fails(function () {
2218
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
2219
- var re = RE('^r', 'gy');
2220
- re.lastIndex = 2;
2221
- return re.exec('str') != null;
2222
- });
2223
-
2224
- var regexpStickyHelpers = {
2225
- UNSUPPORTED_Y: UNSUPPORTED_Y,
2226
- BROKEN_CARET: BROKEN_CARET
2227
- };
2228
-
2229
- var defineProperty$4 = objectDefineProperty.f;
2230
- var getOwnPropertyNames = objectGetOwnPropertyNames.f;
2231
-
2232
-
2233
-
2234
-
2235
-
2236
- var setInternalState$1 = internalState.set;
2237
-
2238
-
2239
-
2240
- var MATCH$1 = wellKnownSymbol('match');
2241
- var NativeRegExp = global_1.RegExp;
2242
- var RegExpPrototype = NativeRegExp.prototype;
2243
- var re1 = /a/g;
2244
- var re2 = /a/g;
2245
-
2246
- // "new" should create a new object, old webkit bug
2247
- var CORRECT_NEW = new NativeRegExp(re1) !== re1;
2248
-
2249
- var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y;
2250
-
2251
- var FORCED$4 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y$1 || fails(function () {
2252
- re2[MATCH$1] = false;
2253
- // RegExp constructor can alter flags and IsRegExp works correct with @@match
2254
- return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
2255
- })));
2256
-
2257
- // `RegExp` constructor
2258
- // https://tc39.github.io/ecma262/#sec-regexp-constructor
2259
- if (FORCED$4) {
2260
- var RegExpWrapper = function RegExp(pattern, flags) {
2261
- var thisIsRegExp = this instanceof RegExpWrapper;
2262
- var patternIsRegExp = isRegexp(pattern);
2263
- var flagsAreUndefined = flags === undefined;
2264
- var sticky;
2265
-
2266
- if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
2267
- return pattern;
2268
- }
2269
-
2270
- if (CORRECT_NEW) {
2271
- if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
2272
- } else if (pattern instanceof RegExpWrapper) {
2273
- if (flagsAreUndefined) flags = regexpFlags.call(pattern);
2274
- pattern = pattern.source;
2275
- }
2276
-
2277
- if (UNSUPPORTED_Y$1) {
2278
- sticky = !!flags && flags.indexOf('y') > -1;
2279
- if (sticky) flags = flags.replace(/y/g, '');
2280
- }
2281
-
2282
- var result = inheritIfRequired(
2283
- CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
2284
- thisIsRegExp ? this : RegExpPrototype,
2285
- RegExpWrapper
2286
- );
2287
-
2288
- if (UNSUPPORTED_Y$1 && sticky) setInternalState$1(result, { sticky: sticky });
2289
-
2290
- return result;
2291
- };
2292
- var proxy = function (key) {
2293
- key in RegExpWrapper || defineProperty$4(RegExpWrapper, key, {
2294
- configurable: true,
2295
- get: function () { return NativeRegExp[key]; },
2296
- set: function (it) { NativeRegExp[key] = it; }
2297
- });
2298
- };
2299
- var keys$1 = getOwnPropertyNames(NativeRegExp);
2300
- var index = 0;
2301
- while (keys$1.length > index) proxy(keys$1[index++]);
2302
- RegExpPrototype.constructor = RegExpWrapper;
2303
- RegExpWrapper.prototype = RegExpPrototype;
2304
- redefine(global_1, 'RegExp', RegExpWrapper);
2305
- }
2306
-
2307
- // https://tc39.github.io/ecma262/#sec-get-regexp-@@species
2308
- setSpecies('RegExp');
2309
-
2310
- var nativeExec = RegExp.prototype.exec;
2311
- // This always refers to the native implementation, because the
2312
- // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
2313
- // which loads this file before patching the method.
2314
- var nativeReplace = String.prototype.replace;
2315
-
2316
- var patchedExec = nativeExec;
2317
-
2318
- var UPDATES_LAST_INDEX_WRONG = (function () {
2319
- var re1 = /a/;
2320
- var re2 = /b*/g;
2321
- nativeExec.call(re1, 'a');
2322
- nativeExec.call(re2, 'a');
2323
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2324
- })();
2325
-
2326
- var UNSUPPORTED_Y$2 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
2327
-
2328
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
2329
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2330
-
2331
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2;
2332
-
2333
- if (PATCH) {
2334
- patchedExec = function exec(str) {
2335
- var re = this;
2336
- var lastIndex, reCopy, match, i;
2337
- var sticky = UNSUPPORTED_Y$2 && re.sticky;
2338
- var flags = regexpFlags.call(re);
2339
- var source = re.source;
2340
- var charsAdded = 0;
2341
- var strCopy = str;
2342
-
2343
- if (sticky) {
2344
- flags = flags.replace('y', '');
2345
- if (flags.indexOf('g') === -1) {
2346
- flags += 'g';
2347
- }
2348
-
2349
- strCopy = String(str).slice(re.lastIndex);
2350
- // Support anchored sticky behavior.
2351
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
2352
- source = '(?: ' + source + ')';
2353
- strCopy = ' ' + strCopy;
2354
- charsAdded++;
2355
- }
2356
- // ^(? + rx + ) is needed, in combination with some str slicing, to
2357
- // simulate the 'y' flag.
2358
- reCopy = new RegExp('^(?:' + source + ')', flags);
2359
- }
2360
-
2361
- if (NPCG_INCLUDED) {
2362
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
2363
- }
2364
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2365
-
2366
- match = nativeExec.call(sticky ? reCopy : re, strCopy);
2367
-
2368
- if (sticky) {
2369
- if (match) {
2370
- match.input = match.input.slice(charsAdded);
2371
- match[0] = match[0].slice(charsAdded);
2372
- match.index = re.lastIndex;
2373
- re.lastIndex += match[0].length;
2374
- } else re.lastIndex = 0;
2375
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
2376
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
2377
- }
2378
- if (NPCG_INCLUDED && match && match.length > 1) {
2379
- // Fix browsers whose `exec` methods don't consistently return `undefined`
2380
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
2381
- nativeReplace.call(match[0], reCopy, function () {
2382
- for (i = 1; i < arguments.length - 2; i++) {
2383
- if (arguments[i] === undefined) match[i] = undefined;
2384
- }
2385
- });
2386
- }
2387
-
2388
- return match;
2389
- };
2390
- }
2391
-
2392
- var regexpExec = patchedExec;
2393
-
2394
- _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
2395
- exec: regexpExec
2396
- });
2397
-
2398
- var TO_STRING = 'toString';
2399
- var RegExpPrototype$1 = RegExp.prototype;
2400
- var nativeToString = RegExpPrototype$1[TO_STRING];
2401
-
2402
- var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
2403
- // FF44- RegExp#toString has a wrong name
2404
- var INCORRECT_NAME = nativeToString.name != TO_STRING;
2405
-
2406
- // `RegExp.prototype.toString` method
2407
- // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
2408
- if (NOT_GENERIC || INCORRECT_NAME) {
2409
- redefine(RegExp.prototype, TO_STRING, function toString() {
2410
- var R = anObject(this);
2411
- var p = String(R.source);
2412
- var rf = R.flags;
2413
- var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$1) ? regexpFlags.call(R) : rf);
2414
- return '/' + p + '/' + f;
2415
- }, { unsafe: true });
2416
- }
2417
-
2418
- _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
2419
- exec: regexpExec
2420
- });
2421
-
2422
- // TODO: Remove from `core-js@4` since it's moved to entry points
2423
-
2424
-
2425
-
2426
-
2427
-
2428
-
2429
-
2430
- var SPECIES$6 = wellKnownSymbol('species');
2431
-
2432
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
2433
- // #replace needs built-in support for named groups.
2434
- // #match works fine because it just return the exec results, even if it has
2435
- // a "grops" property.
2436
- var re = /./;
2437
- re.exec = function () {
2438
- var result = [];
2439
- result.groups = { a: '7' };
2440
- return result;
2441
- };
2442
- return ''.replace(re, '$<a>') !== '7';
2443
- });
2444
-
2445
- // IE <= 11 replaces $0 with the whole match, as if it was $&
2446
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2447
- var REPLACE_KEEPS_$0 = (function () {
2448
- return 'a'.replace(/./, '$0') === '$0';
2449
- })();
2450
-
2451
- var REPLACE = wellKnownSymbol('replace');
2452
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2453
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2454
- if (/./[REPLACE]) {
2455
- return /./[REPLACE]('a', '$0') === '';
2456
- }
2457
- return false;
2458
- })();
2459
-
2460
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
2461
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
2462
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
2463
- var re = /(?:)/;
2464
- var originalExec = re.exec;
2465
- re.exec = function () { return originalExec.apply(this, arguments); };
2466
- var result = 'ab'.split(re);
2467
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
2468
- });
2469
-
2470
- var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
2471
- var SYMBOL = wellKnownSymbol(KEY);
2472
-
2473
- var DELEGATES_TO_SYMBOL = !fails(function () {
2474
- // String methods call symbol-named RegEp methods
2475
- var O = {};
2476
- O[SYMBOL] = function () { return 7; };
2477
- return ''[KEY](O) != 7;
2478
- });
2479
-
2480
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
2481
- // Symbol-named RegExp methods call .exec
2482
- var execCalled = false;
2483
- var re = /a/;
2484
-
2485
- if (KEY === 'split') {
2486
- // We can't use real regex here since it causes deoptimization
2487
- // and serious performance degradation in V8
2488
- // https://github.com/zloirock/core-js/issues/306
2489
- re = {};
2490
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
2491
- // a new one. We need to return the patched regex when creating the new one.
2492
- re.constructor = {};
2493
- re.constructor[SPECIES$6] = function () { return re; };
2494
- re.flags = '';
2495
- re[SYMBOL] = /./[SYMBOL];
2496
- }
2497
-
2498
- re.exec = function () { execCalled = true; return null; };
2499
-
2500
- re[SYMBOL]('');
2501
- return !execCalled;
2502
- });
2503
-
2504
- if (
2505
- !DELEGATES_TO_SYMBOL ||
2506
- !DELEGATES_TO_EXEC ||
2507
- (KEY === 'replace' && !(
2508
- REPLACE_SUPPORTS_NAMED_GROUPS &&
2509
- REPLACE_KEEPS_$0 &&
2510
- !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
2511
- )) ||
2512
- (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
2513
- ) {
2514
- var nativeRegExpMethod = /./[SYMBOL];
2515
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2516
- if (regexp.exec === regexpExec) {
2517
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
2518
- // The native String method already delegates to @@method (this
2519
- // polyfilled function), leasing to infinite recursion.
2520
- // We avoid it by directly calling the native @@method method.
2521
- return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
2522
- }
2523
- return { done: true, value: nativeMethod.call(str, regexp, arg2) };
2524
- }
2525
- return { done: false };
2526
- }, {
2527
- REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
2528
- REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
2529
- });
2530
- var stringMethod = methods[0];
2531
- var regexMethod = methods[1];
2532
-
2533
- redefine(String.prototype, KEY, stringMethod);
2534
- redefine(RegExp.prototype, SYMBOL, length == 2
2535
- // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
2536
- // 21.2.5.11 RegExp.prototype[@@split](string, limit)
2537
- ? function (string, arg) { return regexMethod.call(string, this, arg); }
2538
- // 21.2.5.6 RegExp.prototype[@@match](string)
2539
- // 21.2.5.9 RegExp.prototype[@@search](string)
2540
- : function (string) { return regexMethod.call(string, this); }
2541
- );
2542
- }
2543
-
2544
- if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
2545
- };
2546
-
2547
- // `String.prototype.{ codePointAt, at }` methods implementation
2548
- var createMethod$4 = function (CONVERT_TO_STRING) {
2549
- return function ($this, pos) {
2550
- var S = String(requireObjectCoercible($this));
2551
- var position = toInteger(pos);
2552
- var size = S.length;
2553
- var first, second;
2554
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
2555
- first = S.charCodeAt(position);
2556
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
2557
- || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
2558
- ? CONVERT_TO_STRING ? S.charAt(position) : first
2559
- : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2560
- };
2561
- };
2562
-
2563
- var stringMultibyte = {
2564
- // `String.prototype.codePointAt` method
2565
- // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
2566
- codeAt: createMethod$4(false),
2567
- // `String.prototype.at` method
2568
- // https://github.com/mathiasbynens/String.prototype.at
2569
- charAt: createMethod$4(true)
2570
- };
2571
-
2572
- var charAt = stringMultibyte.charAt;
2573
-
2574
- // `AdvanceStringIndex` abstract operation
2575
- // https://tc39.github.io/ecma262/#sec-advancestringindex
2576
- var advanceStringIndex = function (S, index, unicode) {
2577
- return index + (unicode ? charAt(S, index).length : 1);
2578
- };
2579
-
2580
- // `RegExpExec` abstract operation
2581
- // https://tc39.github.io/ecma262/#sec-regexpexec
2582
- var regexpExecAbstract = function (R, S) {
2583
- var exec = R.exec;
2584
- if (typeof exec === 'function') {
2585
- var result = exec.call(R, S);
2586
- if (typeof result !== 'object') {
2587
- throw TypeError('RegExp exec method returned something other than an Object or null');
2588
- }
2589
- return result;
2590
- }
2591
-
2592
- if (classofRaw(R) !== 'RegExp') {
2593
- throw TypeError('RegExp#exec called on incompatible receiver');
2594
- }
2595
-
2596
- return regexpExec.call(R, S);
2597
- };
2598
-
2599
- // @@match logic
2600
- fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
2601
- return [
2602
- // `String.prototype.match` method
2603
- // https://tc39.github.io/ecma262/#sec-string.prototype.match
2604
- function match(regexp) {
2605
- var O = requireObjectCoercible(this);
2606
- var matcher = regexp == undefined ? undefined : regexp[MATCH];
2607
- return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
2608
- },
2609
- // `RegExp.prototype[@@match]` method
2610
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
2611
- function (regexp) {
2612
- var res = maybeCallNative(nativeMatch, regexp, this);
2613
- if (res.done) return res.value;
2614
-
2615
- var rx = anObject(regexp);
2616
- var S = String(this);
2617
-
2618
- if (!rx.global) return regexpExecAbstract(rx, S);
2619
-
2620
- var fullUnicode = rx.unicode;
2621
- rx.lastIndex = 0;
2622
- var A = [];
2623
- var n = 0;
2624
- var result;
2625
- while ((result = regexpExecAbstract(rx, S)) !== null) {
2626
- var matchStr = String(result[0]);
2627
- A[n] = matchStr;
2628
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2629
- n++;
2630
- }
2631
- return n === 0 ? null : A;
2632
- }
2633
- ];
2634
- });
2635
-
2636
- var max$2 = Math.max;
2637
- var min$2 = Math.min;
2638
- var floor$2 = Math.floor;
2639
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
2640
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
2641
-
2642
- var maybeToString = function (it) {
2643
- return it === undefined ? it : String(it);
2644
- };
2645
-
2646
- // @@replace logic
2647
- fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
2648
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
2649
- var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
2650
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2651
-
2652
- return [
2653
- // `String.prototype.replace` method
2654
- // https://tc39.github.io/ecma262/#sec-string.prototype.replace
2655
- function replace(searchValue, replaceValue) {
2656
- var O = requireObjectCoercible(this);
2657
- var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
2658
- return replacer !== undefined
2659
- ? replacer.call(searchValue, O, replaceValue)
2660
- : nativeReplace.call(String(O), searchValue, replaceValue);
2661
- },
2662
- // `RegExp.prototype[@@replace]` method
2663
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
2664
- function (regexp, replaceValue) {
2665
- if (
2666
- (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
2667
- (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
2668
- ) {
2669
- var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
2670
- if (res.done) return res.value;
2671
- }
2672
-
2673
- var rx = anObject(regexp);
2674
- var S = String(this);
2675
-
2676
- var functionalReplace = typeof replaceValue === 'function';
2677
- if (!functionalReplace) replaceValue = String(replaceValue);
2678
-
2679
- var global = rx.global;
2680
- if (global) {
2681
- var fullUnicode = rx.unicode;
2682
- rx.lastIndex = 0;
2683
- }
2684
- var results = [];
2685
- while (true) {
2686
- var result = regexpExecAbstract(rx, S);
2687
- if (result === null) break;
2688
-
2689
- results.push(result);
2690
- if (!global) break;
2691
-
2692
- var matchStr = String(result[0]);
2693
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2694
- }
2695
-
2696
- var accumulatedResult = '';
2697
- var nextSourcePosition = 0;
2698
- for (var i = 0; i < results.length; i++) {
2699
- result = results[i];
2700
-
2701
- var matched = String(result[0]);
2702
- var position = max$2(min$2(toInteger(result.index), S.length), 0);
2703
- var captures = [];
2704
- // NOTE: This is equivalent to
2705
- // captures = result.slice(1).map(maybeToString)
2706
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2707
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2708
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2709
- for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
2710
- var namedCaptures = result.groups;
2711
- if (functionalReplace) {
2712
- var replacerArgs = [matched].concat(captures, position, S);
2713
- if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
2714
- var replacement = String(replaceValue.apply(undefined, replacerArgs));
2715
- } else {
2716
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2717
- }
2718
- if (position >= nextSourcePosition) {
2719
- accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
2720
- nextSourcePosition = position + matched.length;
2721
- }
2722
- }
2723
- return accumulatedResult + S.slice(nextSourcePosition);
2724
- }
2725
- ];
2726
-
2727
- // https://tc39.github.io/ecma262/#sec-getsubstitution
2728
- function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
2729
- var tailPos = position + matched.length;
2730
- var m = captures.length;
2731
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2732
- if (namedCaptures !== undefined) {
2733
- namedCaptures = toObject(namedCaptures);
2734
- symbols = SUBSTITUTION_SYMBOLS;
2735
- }
2736
- return nativeReplace.call(replacement, symbols, function (match, ch) {
2737
- var capture;
2738
- switch (ch.charAt(0)) {
2739
- case '$': return '$';
2740
- case '&': return matched;
2741
- case '`': return str.slice(0, position);
2742
- case "'": return str.slice(tailPos);
2743
- case '<':
2744
- capture = namedCaptures[ch.slice(1, -1)];
2745
- break;
2746
- default: // \d\d?
2747
- var n = +ch;
2748
- if (n === 0) return match;
2749
- if (n > m) {
2750
- var f = floor$2(n / 10);
2751
- if (f === 0) return match;
2752
- if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
2753
- return match;
2754
- }
2755
- capture = captures[n - 1];
2756
- }
2757
- return capture === undefined ? '' : capture;
2758
- });
2759
- }
2760
- });
2761
-
2762
- // `SameValue` abstract operation
2763
- // https://tc39.github.io/ecma262/#sec-samevalue
2764
- var sameValue = Object.is || function is(x, y) {
2765
- // eslint-disable-next-line no-self-compare
2766
- return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
2767
- };
2768
-
2769
- // @@search logic
2770
- fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
2771
- return [
2772
- // `String.prototype.search` method
2773
- // https://tc39.github.io/ecma262/#sec-string.prototype.search
2774
- function search(regexp) {
2775
- var O = requireObjectCoercible(this);
2776
- var searcher = regexp == undefined ? undefined : regexp[SEARCH];
2777
- return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
2778
- },
2779
- // `RegExp.prototype[@@search]` method
2780
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
2781
- function (regexp) {
2782
- var res = maybeCallNative(nativeSearch, regexp, this);
2783
- if (res.done) return res.value;
2784
-
2785
- var rx = anObject(regexp);
2786
- var S = String(this);
2787
-
2788
- var previousLastIndex = rx.lastIndex;
2789
- if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
2790
- var result = regexpExecAbstract(rx, S);
2791
- if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
2792
- return result === null ? -1 : result.index;
2793
- }
2794
- ];
2795
- });
2796
-
2797
- var arrayPush = [].push;
2798
- var min$3 = Math.min;
2799
- var MAX_UINT32 = 0xFFFFFFFF;
2800
-
2801
- // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
2802
- var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
2803
-
2804
- // @@split logic
2805
- fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
2806
- var internalSplit;
2807
- if (
2808
- 'abbc'.split(/(b)*/)[1] == 'c' ||
2809
- 'test'.split(/(?:)/, -1).length != 4 ||
2810
- 'ab'.split(/(?:ab)*/).length != 2 ||
2811
- '.'.split(/(.?)(.?)/).length != 4 ||
2812
- '.'.split(/()()/).length > 1 ||
2813
- ''.split(/.?/).length
2814
- ) {
2815
- // based on es5-shim implementation, need to rework it
2816
- internalSplit = function (separator, limit) {
2817
- var string = String(requireObjectCoercible(this));
2818
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2819
- if (lim === 0) return [];
2820
- if (separator === undefined) return [string];
2821
- // If `separator` is not a regex, use native split
2822
- if (!isRegexp(separator)) {
2823
- return nativeSplit.call(string, separator, lim);
2824
- }
2825
- var output = [];
2826
- var flags = (separator.ignoreCase ? 'i' : '') +
2827
- (separator.multiline ? 'm' : '') +
2828
- (separator.unicode ? 'u' : '') +
2829
- (separator.sticky ? 'y' : '');
2830
- var lastLastIndex = 0;
2831
- // Make `global` and avoid `lastIndex` issues by working with a copy
2832
- var separatorCopy = new RegExp(separator.source, flags + 'g');
2833
- var match, lastIndex, lastLength;
2834
- while (match = regexpExec.call(separatorCopy, string)) {
2835
- lastIndex = separatorCopy.lastIndex;
2836
- if (lastIndex > lastLastIndex) {
2837
- output.push(string.slice(lastLastIndex, match.index));
2838
- if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
2839
- lastLength = match[0].length;
2840
- lastLastIndex = lastIndex;
2841
- if (output.length >= lim) break;
2842
- }
2843
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
2844
- }
2845
- if (lastLastIndex === string.length) {
2846
- if (lastLength || !separatorCopy.test('')) output.push('');
2847
- } else output.push(string.slice(lastLastIndex));
2848
- return output.length > lim ? output.slice(0, lim) : output;
2849
- };
2850
- // Chakra, V8
2851
- } else if ('0'.split(undefined, 0).length) {
2852
- internalSplit = function (separator, limit) {
2853
- return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
2854
- };
2855
- } else internalSplit = nativeSplit;
2856
-
2857
- return [
2858
- // `String.prototype.split` method
2859
- // https://tc39.github.io/ecma262/#sec-string.prototype.split
2860
- function split(separator, limit) {
2861
- var O = requireObjectCoercible(this);
2862
- var splitter = separator == undefined ? undefined : separator[SPLIT];
2863
- return splitter !== undefined
2864
- ? splitter.call(separator, O, limit)
2865
- : internalSplit.call(String(O), separator, limit);
2866
- },
2867
- // `RegExp.prototype[@@split]` method
2868
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
2869
- //
2870
- // NOTE: This cannot be properly polyfilled in engines that don't support
2871
- // the 'y' flag.
2872
- function (regexp, limit) {
2873
- var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
2874
- if (res.done) return res.value;
2875
-
2876
- var rx = anObject(regexp);
2877
- var S = String(this);
2878
- var C = speciesConstructor(rx, RegExp);
2879
-
2880
- var unicodeMatching = rx.unicode;
2881
- var flags = (rx.ignoreCase ? 'i' : '') +
2882
- (rx.multiline ? 'm' : '') +
2883
- (rx.unicode ? 'u' : '') +
2884
- (SUPPORTS_Y ? 'y' : 'g');
2885
-
2886
- // ^(? + rx + ) is needed, in combination with some S slicing, to
2887
- // simulate the 'y' flag.
2888
- var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
2889
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2890
- if (lim === 0) return [];
2891
- if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
2892
- var p = 0;
2893
- var q = 0;
2894
- var A = [];
2895
- while (q < S.length) {
2896
- splitter.lastIndex = SUPPORTS_Y ? q : 0;
2897
- var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
2898
- var e;
2899
- if (
2900
- z === null ||
2901
- (e = min$3(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
2902
- ) {
2903
- q = advanceStringIndex(S, q, unicodeMatching);
2904
- } else {
2905
- A.push(S.slice(p, q));
2906
- if (A.length === lim) return A;
2907
- for (var i = 1; i <= z.length - 1; i++) {
2908
- A.push(z[i]);
2909
- if (A.length === lim) return A;
2910
- }
2911
- q = p = e;
2912
- }
2913
- }
2914
- A.push(S.slice(p));
2915
- return A;
2916
- }
2917
- ];
2918
- }, !SUPPORTS_Y);
2919
-
2920
- // iterable DOM collections
2921
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2922
- var domIterables = {
2923
- CSSRuleList: 0,
2924
- CSSStyleDeclaration: 0,
2925
- CSSValueList: 0,
2926
- ClientRectList: 0,
2927
- DOMRectList: 0,
2928
- DOMStringList: 0,
2929
- DOMTokenList: 1,
2930
- DataTransferItemList: 0,
2931
- FileList: 0,
2932
- HTMLAllCollection: 0,
2933
- HTMLCollection: 0,
2934
- HTMLFormElement: 0,
2935
- HTMLSelectElement: 0,
2936
- MediaList: 0,
2937
- MimeTypeArray: 0,
2938
- NamedNodeMap: 0,
2939
- NodeList: 1,
2940
- PaintRequestList: 0,
2941
- Plugin: 0,
2942
- PluginArray: 0,
2943
- SVGLengthList: 0,
2944
- SVGNumberList: 0,
2945
- SVGPathSegList: 0,
2946
- SVGPointList: 0,
2947
- SVGStringList: 0,
2948
- SVGTransformList: 0,
2949
- SourceBufferList: 0,
2950
- StyleSheetList: 0,
2951
- TextTrackCueList: 0,
2952
- TextTrackList: 0,
2953
- TouchList: 0
2954
- };
2955
-
2956
- for (var COLLECTION_NAME in domIterables) {
2957
- var Collection = global_1[COLLECTION_NAME];
2958
- var CollectionPrototype = Collection && Collection.prototype;
2959
- // some Chrome versions have non-configurable methods on DOMTokenList
2960
- if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
2961
- createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
2962
- } catch (error) {
2963
- CollectionPrototype.forEach = arrayForEach;
2964
- }
2965
- }
2966
-
2967
- var _typeof_1 = createCommonjsModule(function (module) {
2968
- function _typeof(obj) {
2969
- "@babel/helpers - typeof";
2970
-
2971
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
2972
- module.exports = _typeof = function _typeof(obj) {
2973
- return typeof obj;
2974
- };
2975
- } else {
2976
- module.exports = _typeof = function _typeof(obj) {
2977
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2978
- };
2979
- }
2980
-
2981
- return _typeof(obj);
2982
- }
2983
-
2984
- module.exports = _typeof;
2985
- });
2986
-
2987
- /*! *****************************************************************************
2988
- Copyright (c) Microsoft Corporation.
2989
-
2990
- Permission to use, copy, modify, and/or distribute this software for any
2991
- purpose with or without fee is hereby granted.
2992
-
2993
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2994
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2995
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2996
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2997
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2998
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2999
- PERFORMANCE OF THIS SOFTWARE.
3000
- ***************************************************************************** */
3001
-
3002
- function __spreadArrays() {
3003
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3004
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
3005
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
3006
- r[k] = a[j];
3007
- return r;
3008
- }
3009
-
3010
- /**
3011
- * @method calLongestCommonSubstring
3012
- * @description 计算两个字符串的最长公共子串
3013
- * @param {String} aStr 字符串
3014
- * @param {String} bStr 字符串
3015
- * @return {Number} 长度
3016
- */
3017
-
3018
- function calLongestCommonSubstring(aStr, bStr) {
3019
- if (aStr === void 0) {
3020
- aStr = '';
3021
- }
3022
-
3023
- if (bStr === void 0) {
3024
- bStr = '';
3025
- }
3026
-
3027
- var aLen = aStr.length;
3028
- var bLen = bStr.length; // 创建二维数组并且深拷贝
3029
-
3030
- var arr = deepCopyObject(new Array(aLen).fill(new Array(bLen).fill(0)));
3031
-
3032
- for (var i = 0; i < aLen; ++i) {
3033
- for (var j = 0; j < bLen; ++j) {
3034
- if (aStr[i] === bStr[j]) {
3035
- var baseNum = 0;
3036
-
3037
- if (i > 0 && j > 0) {
3038
- baseNum = arr[i - 1][j - 1];
3039
- }
3040
-
3041
- arr[i][j] = baseNum + 1;
3042
- }
3043
- }
3044
- } // 二维数组转一维数组
3045
-
3046
-
3047
- var arr1 = Array.prototype.concat.apply([], arr); // 获取最长公共子串
3048
-
3049
- var maxLong = Math.max.apply(Math, arr1);
3050
- return maxLong;
3051
- }
3052
- /**
3053
- * @method calLongestCommonSubsequence
3054
- * @description 计算两个字符串的最长公共子序列
3055
- * @param {String} aStr 字符串
3056
- * @param {String} bStr 字符串
3057
- * @return {Number} 长度
3058
- */
3059
-
3060
- function calLongestCommonSubsequence(aStr, bStr) {
3061
- if (aStr === void 0) {
3062
- aStr = '';
3063
- }
3064
-
3065
- if (bStr === void 0) {
3066
- bStr = '';
3067
- }
3068
-
3069
- var aLen = aStr.length;
3070
- var bLen = bStr.length; // 创建二维数组并且深拷贝
3071
-
3072
- var arr = deepCopyObject(new Array(aLen).fill(new Array(bLen).fill(0)));
3073
-
3074
- for (var i = 0; i < aLen; ++i) {
3075
- for (var j = 0; j < bLen; ++j) {
3076
- if (aStr[i] === bStr[j]) {
3077
- var baseNum = 0;
3078
-
3079
- if (i > 0 && j > 0) {
3080
- baseNum = arr[i - 1][j - 1];
3081
- }
3082
-
3083
- arr[i][j] = baseNum + 1;
3084
- } else {
3085
- var _a = [0, 0],
3086
- leftValue = _a[0],
3087
- topValue = _a[1];
3088
-
3089
- if (j > 0) {
3090
- leftValue = arr[i][j - 1];
3091
- }
3092
-
3093
- if (i > 0) {
3094
- topValue = arr[i - 1][j];
3095
- }
3096
-
3097
- arr[i][j] = Math.max(leftValue, topValue);
3098
- }
3099
- }
3100
- } // 二维数组转一维数组
3101
-
3102
-
3103
- var arr1 = Array.prototype.concat.apply([], arr); // 获取最长公共子串
3104
-
3105
- var maxLong = Math.max.apply(Math, arr1);
3106
- return maxLong;
3107
- }
3108
- /**
3109
- * @method getQueryParam
3110
- * @description Get the query param's value of the current Web URL(`location.search`).
3111
- * @param {String} param Query param.
3112
- * @return {String} value
3113
- * */
3114
-
3115
- function getQueryParam(param) {
3116
- if (param === void 0) {
3117
- param = '';
3118
- }
3119
-
3120
- var reg = new RegExp('(^|&)' + param + '=([^&]*)(&|$)');
3121
- var r = location.search.substr(1).match(reg);
3122
-
3123
- if (r !== null) {
3124
- return decodeURIComponent(unescape(r[2]));
3125
- }
3126
-
3127
- return '';
3128
- }
3129
- /**
3130
- * @method getUrlParam
3131
- * @description Get the query param's value of the input URL.
3132
- * @param {String} url URL string.
3133
- * @param {String} param Query param.
3134
- * @return {String} value
3135
- * */
3136
-
3137
- function getUrlParam(url, param) {
3138
- if (url === void 0) {
3139
- url = '';
3140
- }
3141
-
3142
- if (param === void 0) {
3143
- param = '';
3144
- }
3145
-
3146
- var result = {}; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
3147
-
3148
- url.replace(/\??(\w+)=([^&]*)&?/g, function (a, k, v) {
3149
- if (result[k] !== undefined) {
3150
- var t = result[k];
3151
- result[k] = [].concat(t, v);
3152
- } else {
3153
- result[k] = v;
3154
- }
3155
- }); // if (param === undefined) {
3156
- // return result;
3157
- // } else {
3158
- // return result[param] || '';
3159
- // }
3160
-
3161
- return result[param] || '';
3162
- }
3163
- /**
3164
- * @method updateQueryParam
3165
- * @description Update the query param's value of the input URL.
3166
- * @param {String} url URL string.
3167
- * @param {String} param Query param.
3168
- * @param {String} value Param's value.
3169
- * @return {String} URL.
3170
- * */
3171
-
3172
- function updateQueryParam(url, param, value) {
3173
- if (url === void 0) {
3174
- url = '';
3175
- }
3176
-
3177
- if (param === void 0) {
3178
- param = '';
3179
- }
3180
-
3181
- if (value === void 0) {
3182
- value = '';
3183
- }
3184
-
3185
- var re = new RegExp('([?&])' + param + '=.*?(&|$)', 'i');
3186
- var separator = url.indexOf('?') !== -1 ? '&' : '?';
3187
-
3188
- if (url.match(re)) {
3189
- return url.replace(re, '$1' + param + '=' + value + '$2');
3190
- } else {
3191
- return url + separator + param + '=' + value;
3192
- }
3193
- }
3194
- /**
3195
- * @method getHashQueryParam
3196
- * @description Get the hash query param's value of the current Web URL(`location.hash`).
3197
- * @param {String} param Query param.
3198
- * @return {String} value
3199
- */
3200
-
3201
- function getHashQueryParam(param) {
3202
- if (param === void 0) {
3203
- param = '';
3204
- }
3205
-
3206
- var hashs = location.hash.split('?');
3207
-
3208
- if (hashs.length === 1) {
3209
- return '';
3210
- }
3211
-
3212
- var reg = new RegExp("(^|&)" + param + "=([^&]*)(&|$)");
3213
- var ret = hashs[1].match(reg);
3214
- return ret ? ret[2] : '';
3215
- }
3216
- /**
3217
- * @method getDomain
3218
- * @description Get the domain of URL, and other params.
3219
- * @param {String} url
3220
- * @param {Array} rules Object.keys(location), ['href', 'protocol', 'host', 'hostname', 'port', 'pathname', 'search', 'hash'], ['hostname', 'pathname'] = 'km.mazey.net/plugins/servlet/mobile'
3221
- * */
3222
-
3223
- function getDomain(url, rules) {
3224
- if (url === void 0) {
3225
- url = '';
3226
- }
3227
-
3228
- if (rules === void 0) {
3229
- rules = ['hostname'];
3230
- }
3231
-
3232
- var aEl = document.createElement('a');
3233
- aEl.href = url;
3234
- return rules.reduce(function (ret, v) {
3235
- ret += aEl[v];
3236
- return ret;
3237
- }, '');
3238
- }
3239
- /**
3240
- * @method camelCaseToKebabCase
3241
- * @description Transfer CamelCase to KebabCase.
3242
- * @param {String} camelCase 'aBC' or 'ABC'
3243
- * @return {String} 'a-b-c'
3244
- * */
3245
-
3246
- function camelCaseToKebabCase(camelCase) {
3247
- if (camelCase === void 0) {
3248
- camelCase = '';
3249
- }
3250
-
3251
- var kebabCase = camelCase.replace(/([A-Z])/g, '-$1').toLowerCase();
3252
- return kebabCase[0] === '-' ? kebabCase.substr(1) : kebabCase;
3253
- }
3254
- /**
3255
- * @method camelCase2Underscore
3256
- * @description Transfer CamelCase to Underscore.
3257
- * @param {String} camelCase 'aBC' or 'ABC'
3258
- * @return {String} 'a_b_c'
3259
- * */
3260
-
3261
- function camelCase2Underscore(camelCase) {
3262
- if (camelCase === void 0) {
3263
- camelCase = '';
3264
- }
3265
-
3266
- var kebabCase = camelCase.replace(/([A-Z])/g, '_$1').toLowerCase();
3267
- return kebabCase[0] === '_' ? kebabCase.substr(1) : kebabCase;
3268
- }
3269
- /**
3270
- * @method mTrim
3271
- * @description Remove leading and trailing whitespace or specified characters from string.
3272
- * @param {String} str The string to trim.
3273
- * @return {String} Trimmed string.
3274
- * */
3275
-
3276
- function mTrim(str) {
3277
- if (str === void 0) {
3278
- str = '';
3279
- }
3280
-
3281
- str = str.replace(/^\s+/, ''); // 去除头部空格
3282
-
3283
- var end = str.length - 1;
3284
- var ws = /\s/;
3285
-
3286
- while (ws.test(str.charAt(end))) {
3287
- end--; // 最后一个非空格字符的索引
3288
- }
3289
-
3290
- return str.slice(0, end + 1);
3291
- }
3292
- /**
3293
- * @method newLine
3294
- * @description Make a newline of HTML.
3295
- * @param {String} str The string to make a newline.
3296
- * @return {String} A newline with `<br />`.
3297
- * */
3298
-
3299
- function newLine(str) {
3300
- if (str === void 0) {
3301
- str = '';
3302
- }
3303
-
3304
- if (!str) {
3305
- return '';
3306
- }
3307
-
3308
- var reg = new RegExp('\\n', 'g');
3309
- return str.replace(reg, '<br />');
3310
- }
3311
- /**
3312
- * @method deepCopyObject
3313
- * @description Clone Object deeply.
3314
- * @param {Object} obj The value to clone.
3315
- * @return {Object} Returns the deep cloned value.
3316
- * */
3317
-
3318
- function deepCopyObject(obj) {
3319
- return JSON.parse(JSON.stringify(obj));
3320
- }
3321
- /**
3322
- * @method isJsonString
3323
- * @description Check whether it is a valid JSON string.
3324
- * @param {String} str The string to check.
3325
- * @return {Boolean} Return the result of checking.
3326
- * */
3327
-
3328
- function isJsonString(str) {
3329
- if (str === void 0) {
3330
- str = '';
3331
- }
3332
-
3333
- try {
3334
- if (_typeof_1(JSON.parse(str)) === 'object') {
3335
- return true;
3336
- }
3337
- } catch (e) {
3338
- /* pass */
3339
- }
3340
-
3341
- return false;
3342
- }
3343
- /**
3344
- * @method generateRndNum
3345
- * @description Produce a random string of number, `generateRndNum(7)` => '7658495'.
3346
- * @param {Number} n Length
3347
- * @return {String} Return the random string.
3348
- * */
3349
-
3350
- function generateRndNum(n) {
3351
- if (n === void 0) {
3352
- n = 5;
3353
- }
3354
-
3355
- var ret = '';
3356
-
3357
- while (n--) {
3358
- ret += Math.floor(Math.random() * 10);
3359
- }
3360
-
3361
- return ret;
3362
- }
3363
- /**
3364
- * @method generateUniqueNum
3365
- * @description 根据时间生成唯一标志的数字 mGenerateUniqueNum() => 1538324722364123。
3366
- * @param {Number} n 随机数的长度
3367
- * */
3368
-
3369
- function generateUniqueNum(n) {
3370
- if (n === void 0) {
3371
- n = 3;
3372
- }
3373
-
3374
- var _a = [mNow(), generateRndNum(n || 3)],
3375
- now = _a[0],
3376
- rnd = _a[1];
3377
- return now + rnd;
3378
- }
3379
- /**
3380
- * @method floatToPercent
3381
- * @description 浮点数转为百分比 0.2 => 20%。
3382
- * @param {Number} num 浮点数
3383
- * @param {Number} fixSize 保留几位浮点数
3384
- * */
3385
-
3386
- function floatToPercent(num, fixSize) {
3387
- if (num === void 0) {
3388
- num = 0;
3389
- }
3390
-
3391
- if (fixSize === void 0) {
3392
- fixSize = 0;
3393
- }
3394
-
3395
- var ret = '';
3396
-
3397
- if (fixSize) {
3398
- ret = (num * 100).toFixed(fixSize);
3399
- } else {
3400
- ret = String(Math.floor(num * 100));
3401
- }
3402
-
3403
- return ret + "%";
3404
- }
3405
- /**
3406
- * @method floatFixed
3407
- * @description 浮点数保留指定位。
3408
- * */
3409
-
3410
- function floatFixed(num, size) {
3411
- if (size === void 0) {
3412
- size = 0;
3413
- }
3414
-
3415
- return parseFloat(num).toFixed(size);
3416
- }
3417
- /**
3418
- * @method cancelBubble
3419
- * @description 阻止冒泡。
3420
- * */
3421
-
3422
- function cancelBubble(e) {
3423
- var ev = e || window.event;
3424
-
3425
- if (ev.stopPropagation) {
3426
- // W3C
3427
- ev.stopPropagation();
3428
- } else {
3429
- // IE
3430
- ev.cancelBubble = true;
3431
- }
3432
- }
3433
- /**
3434
- * @method hasClass
3435
- * */
3436
-
3437
- function hasClass(obj, cls) {
3438
- var oriCls = obj.className; // 获取对象的class值
3439
-
3440
- var oriClsArr = oriCls.split(/\s+/); // 分隔空格转换成数组
3441
-
3442
- for (var i = 0; i < oriClsArr.length; i++) {
3443
- if (oriClsArr[i] === cls) {
3444
- return true; // 若匹配到class则返回True
3445
- }
3446
- }
3447
-
3448
- return false; // 否则返回False
3449
- }
3450
- /**
3451
- * @method addClass
3452
- * */
3453
-
3454
- function addClass(obj, cls) {
3455
- var oriCls = obj.className;
3456
- var space = '';
3457
- var newCls = ''; // 获取对象的class值
3458
-
3459
- if (oriCls !== '') {
3460
- space = ' '; // 若原来的class不为空,跟一个空格
3461
- }
3462
-
3463
- newCls = oriCls + space + cls; // 将新的class加进去
3464
-
3465
- obj.className = newCls; // 替换新class
3466
- }
3467
- /**
3468
- * @method removeClass
3469
- * */
3470
-
3471
- function removeClass(obj, cls) {
3472
- var oriCls = obj.className;
3473
- var newCls; // 获取对象的class值
3474
-
3475
- newCls = ' ' + oriCls + ' '; // 前后加空格
3476
-
3477
- newCls = newCls.replace(/(\s+)/gi, ' '); // 将多余的空格替换成一个空格
3478
-
3479
- newCls = newCls.replace(' ' + cls + ' ', ' '); // 将加了前后空格的cls替换成空格' '
3480
-
3481
- newCls = newCls.replace(/(^\s+)|(\s+$)/g, ''); // 去掉前后空格
3482
-
3483
- obj.className = newCls;
3484
- }
3485
- /**
3486
- * @method throttle
3487
- * @description 节流。
3488
- * */
3489
-
3490
- function throttle(func, wait, options) {
3491
- // timeout: setTimeout Handle
3492
- // previous: 上次时间戳
3493
- var context = null;
3494
- var args = null;
3495
- var timeout = null;
3496
- var _a = [null, 0],
3497
- result = _a[0],
3498
- previous = _a[1];
3499
-
3500
- if (!options) {
3501
- options = {};
3502
- }
3503
-
3504
- var later = function later() {
3505
- previous = options.leading === false ? 0 : mNow();
3506
- timeout = null;
3507
- result = func.apply(context, args);
3508
-
3509
- if (!timeout) {
3510
- context = args = null;
3511
- }
3512
- };
3513
-
3514
- return function () {
3515
- var argRest = [];
3516
-
3517
- for (var _i = 0; _i < arguments.length; _i++) {
3518
- argRest[_i] = arguments[_i];
3519
- }
3520
-
3521
- var now = mNow();
3522
-
3523
- if (!previous && options.leading === false) {
3524
- previous = now;
3525
- }
3526
-
3527
- var remaining = wait - (now - previous);
3528
- context = this;
3529
- args = argRest;
3530
-
3531
- if (remaining <= 0 || remaining > wait) {
3532
- if (timeout) {
3533
- clearTimeout(timeout);
3534
- timeout = null;
3535
- }
3536
-
3537
- previous = now;
3538
- result = func.apply(context, args);
3539
-
3540
- if (!timeout) {
3541
- context = args = null;
3542
- }
3543
- } else if (!timeout && options.trailing !== false) {
3544
- timeout = setTimeout(later, remaining);
3545
- }
3546
-
3547
- return result;
3548
- };
3549
- }
3550
- /**
3551
- * @method debounce
3552
- * @description 去抖。
3553
- * */
3554
-
3555
- function debounce(func, wait, immediate) {
3556
- var context = null;
3557
- var timeout = null;
3558
- var timestamp = null;
3559
- var args = null;
3560
- var result = [null][0];
3561
-
3562
- var later = function later() {
3563
- var last = mNow() - timestamp;
3564
-
3565
- if (last < wait && last >= 0) {
3566
- timeout = setTimeout(later, wait - last);
3567
- } else {
3568
- timeout = null;
3569
-
3570
- if (!immediate) {
3571
- result = func.apply(context, args);
3572
-
3573
- if (!timeout) {
3574
- context = args = null;
3575
- }
3576
- }
3577
- }
3578
- };
3579
-
3580
- return function () {
3581
- var argRest = [];
3582
-
3583
- for (var _i = 0; _i < arguments.length; _i++) {
3584
- argRest[_i] = arguments[_i];
3585
- }
3586
-
3587
- context = this;
3588
- args = argRest;
3589
- timestamp = mNow();
3590
- var callNow = immediate && !timeout;
3591
-
3592
- if (!timeout) {
3593
- timeout = setTimeout(later, wait);
3594
- }
3595
-
3596
- if (callNow) {
3597
- result = func.apply(context, args);
3598
- context = args = null;
3599
- }
3600
-
3601
- return result;
3602
- };
3603
- }
3604
- /**
3605
- * @method friendlyInterval
3606
- * @description 获取间隔时间。
3607
- * @param {Number/Date} start 开始时间戳 1585325367122
3608
- * @param {Number/Date} end 结束时间戳 1585325367122
3609
- * @type {String} type 返回类型 d: 2(天) text: 2 天 4 时...
3610
- * @return {String/Number} 取决于 type
3611
- * */
3612
-
3613
- function friendlyInterval(_a) {
3614
- var _b = _a === void 0 ? {} : _a,
3615
- _c = _b.start,
3616
- start = _c === void 0 ? 0 : _c,
3617
- _d = _b.end,
3618
- end = _d === void 0 ? 0 : _d,
3619
- _e = _b.type,
3620
- type = _e === void 0 ? 'd' : _e;
3621
-
3622
- if (!isNumber(start)) start = new Date(start).getTime();
3623
- if (!isNumber(end)) end = new Date(end).getTime();
3624
- var t = end - start;
3625
- var ret = null;
3626
-
3627
- var _f = new Array(4).fill(0),
3628
- d = _f[0],
3629
- h = _f[1],
3630
- m = _f[2],
3631
- s = _f[3];
3632
-
3633
- if (t >= 0) {
3634
- d = Math.floor(t / 1000 / 60 / 60 / 24);
3635
- h = Math.floor(t / 1000 / 60 / 60);
3636
- m = Math.floor(t / 1000 / 60);
3637
- s = Math.floor(t / 1000);
3638
-
3639
- switch (type) {
3640
- case 'd':
3641
- ret = d;
3642
- break;
3643
-
3644
- case 'text':
3645
- d = Math.floor(t / 1000 / 60 / 60 / 24);
3646
- h = Math.floor(t / 1000 / 60 / 60 % 24);
3647
- m = Math.floor(t / 1000 / 60 % 60);
3648
- s = Math.floor(t / 1000 % 60);
3649
- ret = d + ' 天 ' + h + ' 时 ' + m + ' 分 ' + s + ' 秒';
3650
- break;
3651
-
3652
- default:
3653
- ret = s;
3654
- }
3655
- }
3656
-
3657
- return ret;
3658
- }
3659
- /**
3660
- * @method isNumber
3661
- * @description 判断是否有效数字
3662
- * @param {*} num 被判断的值
3663
- * @param {Boolean} isNaNAsNumber 是否 NaN 算数字(默认不算)
3664
- * @param {Boolean} isUnFiniteAsNumber 是否 无限 算数字(默认不算)
3665
- * @return {Boolean} true 是数字
3666
- */
3667
-
3668
- function isNumber(num, _a) {
3669
- var _b = _a === void 0 ? {} : _a,
3670
- _c = _b.isNaNAsNumber,
3671
- isNaNAsNumber = _c === void 0 ? false : _c,
3672
- _d = _b.isUnFiniteAsNumber,
3673
- isUnFiniteAsNumber = _d === void 0 ? false : _d;
3674
-
3675
- var ret = true; // 数字类型
3676
-
3677
- if (typeof num !== 'number') {
3678
- ret = false;
3679
- } // 无限值
3680
-
3681
-
3682
- if (isUnFiniteAsNumber === false && !isFinite(num)) {
3683
- // console.log('1333');
3684
- ret = false;
3685
- } // NaN
3686
-
3687
-
3688
- if (isNaNAsNumber === false && isNaN(num)) {
3689
- // console.log('2333');
3690
- ret = false;
3691
- }
3692
-
3693
- return ret;
3694
- }
3695
- /**
3696
- * @method doFn
3697
- * @description 执行有效函数
3698
- * @param {Function} fn 等待被执行的未知是否有效的函数
3699
- * */
3700
-
3701
- function doFn(fn) {
3702
- var params = [];
3703
-
3704
- for (var _i = 1; _i < arguments.length; _i++) {
3705
- params[_i - 1] = arguments[_i];
3706
- }
3707
-
3708
- var ret = null;
3709
-
3710
- if (fn && typeof fn === 'function') {
3711
- ret = fn.apply(void 0, params);
3712
- }
3713
-
3714
- return ret;
3715
- }
3716
- /**
3717
- * @method setSessionStorage
3718
- * @description 存储数据到 sessionStorage
3719
- * @param {String} key 键
3720
- * @param {String} value 值
3721
- * */
3722
-
3723
- function setSessionStorage(key, value) {
3724
- if (value === void 0) {
3725
- value = null;
3726
- }
3727
-
3728
- if (key) {
3729
- sessionStorage.setItem(key, JSON.stringify(value));
3730
- }
3731
- }
3732
- /**
3733
- * @method getSessionStorage
3734
- * @description 存储数据到 sessionStorage
3735
- * @param {String} key 键
3736
- * @return {*} 返回值
3737
- * */
3738
-
3739
- function getSessionStorage(key) {
3740
- var ret = null;
3741
-
3742
- if (key) {
3743
- var value = sessionStorage.getItem(key);
3744
-
3745
- if (value) {
3746
- ret = JSON.parse(value);
3747
- }
3748
- }
3749
-
3750
- return ret;
3751
- }
3752
- /**
3753
- * @method setLocalStorage
3754
- * @description 存储数据到 localStorage
3755
- * @param {String} key 键
3756
- * @param {String} value 值
3757
- * */
3758
-
3759
- function setLocalStorage(key, value) {
3760
- if (value === void 0) {
3761
- value = null;
3762
- }
3763
-
3764
- if (key) {
3765
- localStorage.setItem(key, JSON.stringify(value));
3766
- }
3767
- }
3768
- /**
3769
- * @method getLocalStorage
3770
- * @description 存储数据到 localStorage
3771
- * @param {String} key 键
3772
- * @return {*} 返回值
3773
- * */
3774
-
3775
- function getLocalStorage(key) {
3776
- var ret = null;
3777
-
3778
- if (key) {
3779
- var value = localStorage.getItem(key);
3780
-
3781
- if (value) {
3782
- ret = JSON.parse(value);
3783
- }
3784
- }
3785
-
3786
- return ret;
3787
- }
3788
- /**
3789
- * @method loadCSS
3790
- * @description 动态加载css文件
3791
- * @param {String} url -- css资源路径
3792
- * @param {String} id -- link标签id
3793
- * @return {Promise<Boolean>} true -- 加载成功
3794
- */
3795
-
3796
- function loadCSS(_a) {
3797
- var _b = _a === void 0 ? {} : _a,
3798
- _c = _b.url,
3799
- url = _c === void 0 ? '' : _c,
3800
- _d = _b.id,
3801
- id = _d === void 0 ? '' : _d;
3802
-
3803
- var success = null;
3804
- var fail = null;
3805
- var status = new Promise(function (resolve, reject) {
3806
- var _a;
3807
-
3808
- _a = [resolve, reject], success = _a[0], fail = _a[1];
3809
- }); // const tempCB = (typeof callback === 'function' ? callback : function () { });
3810
-
3811
- var callback = function callback() {
3812
- doFn(success, true);
3813
- };
3814
-
3815
- var node = document.createElement('link');
3816
- var supportOnload = ('onload' in node);
3817
- var isOldWebKit = +navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i, '$1') < 536; // webkit旧内核做特殊处理
3818
-
3819
- var protectNum = 300000; // 阈值10分钟,一秒钟执行pollCss 500次
3820
-
3821
- node.rel = 'stylesheet';
3822
- node.type = 'text/css';
3823
- node.href = url;
3824
-
3825
- if (typeof id !== 'undefined') {
3826
- node.id = id;
3827
- }
3828
-
3829
- document.getElementsByTagName('head')[0].appendChild(node); // for Old WebKit and Old Firefox
3830
-
3831
- if (isOldWebKit || !supportOnload) {
3832
- // Begin after node insertion
3833
- setTimeout(function () {
3834
- pollCss(node, callback, 0);
3835
- }, 1);
3836
- return status;
3837
- }
3838
-
3839
- if (supportOnload) {
3840
- node.onload = onload;
3841
-
3842
- node.onerror = function () {
3843
- // 加载失败(404)
3844
- onload();
3845
- };
3846
- } else {
3847
- // todo: 和 !supportOnload 重复
3848
- node.onreadystatechange = function () {
3849
- if (/loaded|complete/.test(node.readyState)) {
3850
- onload();
3851
- }
3852
- };
3853
- }
3854
-
3855
- function onload() {
3856
- // 确保只跑一次下载操作
3857
- node.onload = node.onerror = node.onreadystatechange = null; // 清空node引用,在低版本IE,不清除会造成内存泄露
3858
-
3859
- node = null;
3860
- callback();
3861
- } // 循环判断css是否已加载成功
3862
-
3863
- /*
3864
- * @param node -- link节点
3865
- * @param callback -- 回调函数
3866
- * @param step -- 计步器,避免无限循环
3867
- */
3868
-
3869
-
3870
- function pollCss(node, callback, step) {
3871
- var sheet = node.sheet;
3872
- var isLoaded;
3873
- step += 1; // 保护,大于10分钟,则不再轮询
3874
-
3875
- if (step > protectNum) {
3876
- isLoaded = true; // 清空node引用
3877
-
3878
- node = null;
3879
- callback();
3880
- return;
3881
- }
3882
-
3883
- if (isOldWebKit) {
3884
- // for WebKit < 536
3885
- if (sheet) {
3886
- isLoaded = true;
3887
- }
3888
- } else if (sheet) {
3889
- // for Firefox < 9.0
3890
- try {
3891
- if (sheet.cssRules) {
3892
- isLoaded = true;
3893
- }
3894
- } catch (ex) {
3895
- // 火狐特殊版本,通过特定值获知是否下载成功
3896
- // The value of `ex.name` is changed from "NS_ERROR_DOM_SECURITY_ERR"
3897
- // to "SecurityError" since Firefox 13.0. But Firefox is less than 9.0
3898
- // in here, So it is ok to just rely on "NS_ERROR_DOM_SECURITY_ERR"
3899
- if (ex.name === 'NS_ERROR_DOM_SECURITY_ERR') {
3900
- isLoaded = true;
3901
- }
3902
- }
3903
- }
3904
-
3905
- setTimeout(function () {
3906
- if (isLoaded) {
3907
- // 延迟20ms是为了给下载的样式留够渲染的时间
3908
- callback();
3909
- } else {
3910
- pollCss(node, callback, step);
3911
- }
3912
- }, 20);
3913
- }
3914
-
3915
- return status;
3916
- }
3917
- /**
3918
- * @method loadScript
3919
- * @description 动态加载js文件
3920
- * @param {String} url -- js资源路径
3921
- * @param {String} id -- DOM ID
3922
- * @param {Function} callback -- 加载后回调函数
3923
- * @param {Number} timeout -- 超时时长
3924
- * @param {Boolean} isDefer -- 是否添加 defer 标签
3925
- * @return {Promise<Boolean>} -- true 成功
3926
- */
3927
-
3928
- function loadScript(_a) {
3929
- var _b = _a === void 0 ? {} : _a,
3930
- _c = _b.url,
3931
- url = _c === void 0 ? '' : _c,
3932
- _d = _b.id,
3933
- id = _d === void 0 ? '' : _d,
3934
- _e = _b.callback,
3935
- callback = _e === void 0 ? function () {} : _e,
3936
- _f = _b.timeout,
3937
- timeout = _f === void 0 ? 5000 : _f,
3938
- _g = _b.isDefer,
3939
- isDefer = _g === void 0 ? false : _g;
3940
-
3941
- var success = null;
3942
- var fail = null;
3943
- var script = document.createElement('script'); // 如果没有 script 标签,那么代码就不会运行。可以利用这一事实,在页面的第一个 script 标签上使用 insertBefore()。
3944
-
3945
- var firstScript = document.getElementsByTagName('script')[0];
3946
- script.type = 'text/javascript';
3947
-
3948
- if (isDefer) {
3949
- script.defer = 'defer';
3950
- }
3951
-
3952
- if (id) {
3953
- script.id = id;
3954
- }
3955
-
3956
- if (script.readyState) {
3957
- // IE
3958
- script.onreadystatechange = function () {
3959
- if (script.readyState === 'loaded' || script.readyState === 'complete') {
3960
- script.onreadystatechange = null;
3961
- doFn(callback);
3962
- doFn(success, true);
3963
- }
3964
- };
3965
- } else {
3966
- // Others
3967
- script.onload = function () {
3968
- doFn(callback);
3969
- doFn(success, true);
3970
- };
3971
- }
3972
-
3973
- script.src = url;
3974
- firstScript && firstScript.parentNode.insertBefore(script, firstScript);
3975
- return new Promise(function (resolve, reject) {
3976
- var _a;
3977
-
3978
- _a = [resolve, reject], success = _a[0], fail = _a[1];
3979
-
3980
- if (timeout) {
3981
- setTimeout(fail.bind(null, 'timeout'), timeout);
3982
- }
3983
- });
3984
- }
3985
- /**
3986
- * @method mNow
3987
- * @description 获取时间戳
3988
- */
3989
-
3990
- function mNow() {
3991
- var ret = 0;
3992
-
3993
- if (Date.now) {
3994
- ret = Date.now();
3995
- } else {
3996
- ret = new Date().getTime();
3997
- }
3998
-
3999
- return ret;
4000
- }
4001
- /**
4002
- * @method setCookie
4003
- * @description 设置 Cookie
4004
- */
4005
-
4006
- function setCookie(name, value, days, domain) {
4007
- var domainParts, expires;
4008
- var date;
4009
-
4010
- if (days) {
4011
- date = new Date();
4012
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
4013
- expires = "; expires=" + date.toGMTString();
4014
- } else {
4015
- expires = "";
4016
- }
4017
-
4018
- var host = location.host;
4019
-
4020
- if (host.split('.').length === 1) {
4021
- // no "." in a domain - it's localhost or something similar
4022
- document.cookie = name + "=" + value + expires + "; path=/";
4023
- } else {
4024
- // Remember the cookie on all subdomains.
4025
- //
4026
- // Start with trying to set cookie to the top domain.
4027
- // (example: if user is on foo.com, try to set
4028
- // cookie to domain ".com")
4029
- //
4030
- // If the cookie will not be set, it means ".com"
4031
- // is a top level domain and we need to
4032
- // set the cookie to ".foo.com"
4033
- domainParts = host.split('.');
4034
- domainParts.shift();
4035
- domain = domain || '.' + domainParts.join('.');
4036
- document.cookie = name + "=" + value + expires + "; path=/; domain=" + domain; // check if cookie was successfuly set to the given domain
4037
- // (otherwise it was a Top-Level Domain)
4038
-
4039
- if (getCookie(name) === null || getCookie(name) !== value) {
4040
- // append "." to current domain
4041
- domain = domain || '.' + host;
4042
- document.cookie = name + "=" + value + expires + "; path=/; domain=" + domain;
4043
- }
4044
- }
4045
- }
4046
- /**
4047
- * @method getCookie
4048
- * @description 获取 Cookie
4049
- */
4050
-
4051
- function getCookie(name) {
4052
- var nameEQ = name + "=";
4053
- var ca = document.cookie.split(';');
4054
-
4055
- for (var i = 0; i < ca.length; i++) {
4056
- var c = ca[i];
4057
-
4058
- while (c.charAt(0) == ' ') {
4059
- c = c.substring(1, c.length);
4060
- }
4061
-
4062
- if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
4063
- }
4064
-
4065
- return '';
4066
- }
4067
- /**
4068
- * @method getPerformance
4069
- * @description 获取页面加载相关的各项数据
4070
- * @param {Boolean} camelCase -- true(默认) 以驼峰形式返回数据 false 以下划线形式返回数据
4071
- * @return {Promise<Object>} 加载数据
4072
- */
4073
-
4074
- function getPerformance(_a) {
4075
- var _b = (_a === void 0 ? {} : _a).camelCase,
4076
- camelCase = _b === void 0 ? true : _b;
4077
- var success;
4078
- var fail;
4079
- var status = new Promise(function (resolve, reject) {
4080
- var _a;
4081
-
4082
- _a = [resolve, reject], success = _a[0], fail = _a[1];
4083
- });
4084
- var timing = window.performance.timing;
4085
- var startTime = timing.navigationStart || timing.fetchStart;
4086
- var firstPaintTime;
4087
- var firstContentfulPaintTime; // 是否已经形成数据(页面加载完成之后)
4088
-
4089
- if (window.performance && window.performance.timing && window.performance.timing.loadEventEnd > 0) {
4090
- // console.log('created')
4091
- getTiming();
4092
- } else {
4093
- // console.log('creating')
4094
- window.addEventListener("load", function () {
4095
- //不能影响最后的时间计算
4096
- window.setTimeout(function () {
4097
- getTiming();
4098
- }, 0);
4099
- });
4100
- } // performance
4101
-
4102
-
4103
- function getTiming() {
4104
- // 获取首次渲染时间
4105
- try {
4106
- if (window.performance && Boolean(window.performance.getEntriesByType)) {
4107
- var performance_1 = window.performance;
4108
- var performanceEntries = performance_1.getEntriesByType('paint');
4109
- performanceEntries.forEach(function (performanceEntry, i, entries) {
4110
- var startTime = Math.round(performanceEntry.startTime);
4111
- if (performanceEntry.name === 'first-paint') firstPaintTime = startTime;else if (performanceEntry.name === 'first-contentful-paint') firstContentfulPaintTime = startTime;
4112
- });
4113
- } else {
4114
- console.error('paint');
4115
- }
4116
- } catch (e) {
4117
- console.error(e.message);
4118
- } // 获取加载时间
4119
-
4120
-
4121
- if (window.performance && typeof window.performance.getEntries === 'function') {
4122
- var performanceNavigationTiming = (window.performance.getEntries() || [])[0] || {};
4123
- var data_1 = {
4124
- // url: encodeURI(location.href),
4125
- // ua: navigator.userAgent,
4126
- os: getOS(),
4127
- osVersion: getOSVersion(),
4128
- deviceType: getDeviceType(),
4129
- network: getNetWork(),
4130
- screenDirection: getOrientationStatu(),
4131
- unloadTime: timing.unloadEventEnd - timing.unloadEventStart,
4132
- redirectTime: timing.redirectEnd - timing.redirectStart,
4133
- dnsTime: timing.domainLookupEnd - timing.domainLookupStart,
4134
- tcpTime: timing.connectEnd - timing.connectStart,
4135
- sslTime: getSSLTime(timing.connectEnd, timing.secureConnectionStart),
4136
- responseTime: timing.responseStart - timing.requestStart,
4137
- downloadTime: timing.responseEnd - timing.responseStart,
4138
- firstPaintTime: firstPaintTime,
4139
- firstContentfulPaintTime: firstContentfulPaintTime,
4140
- domreadyTime: timing.domContentLoadedEventStart - startTime || 0,
4141
- onloadTime: timing.loadEventStart - startTime || 0,
4142
- whiteTime: timing.responseStart - startTime,
4143
- renderTime: timing.loadEventEnd - startTime || 0,
4144
- decodedBodySize: performanceNavigationTiming.decodedBodySize || '',
4145
- encodedBodySize: performanceNavigationTiming.encodedBodySize || ''
4146
- }; // 过滤异常数据
4147
-
4148
- Object.keys(data_1).forEach(function (k) {
4149
- // 过滤掉 <0 的数据
4150
- if (isNumber(data_1[k]) && data_1[k] < 0) {
4151
- data_1[k] = 0;
4152
- }
4153
- }); // 过滤掉白屏时间 > onload 的数据
4154
-
4155
- if (isNumber(data_1.whiteTime) && data_1.whiteTime > data_1.onloadTime) {
4156
- data_1.whiteTime = 0;
4157
- }
4158
-
4159
- if (startTime > 0) {
4160
- var Underscore_1;
4161
-
4162
- if (!camelCase) {
4163
- Object.keys(data_1).forEach(function (k) {
4164
- if (!Underscore_1) Underscore_1 = {}; // console.log('camelCase2Underscore', k, data, )
4165
-
4166
- Underscore_1[camelCase2Underscore(k)] = data_1[k];
4167
- });
4168
- }
4169
-
4170
- success(Underscore_1 || data_1);
4171
- } else {
4172
- fail('startTime');
4173
- }
4174
- } else {
4175
- fail('getEntries');
4176
- }
4177
- } //获取当前操作系统
4178
-
4179
-
4180
- function getOS() {
4181
- var os;
4182
-
4183
- if (navigator.userAgent.indexOf('Android') > -1 || navigator.userAgent.indexOf('Linux') > -1) {
4184
- os = 'android';
4185
- } else if (navigator.userAgent.indexOf('iPhone') > -1) {
4186
- os = 'ios';
4187
- } else if (navigator.userAgent.indexOf('Windows Phone') > -1) {
4188
- os = 'wp';
4189
- } else {
4190
- os = 'others';
4191
- }
4192
-
4193
- return os;
4194
- } // 获取操作系统版本
4195
-
4196
-
4197
- function getOSVersion() {
4198
- var OSVision;
4199
- var u = navigator.userAgent;
4200
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //Android
4201
-
4202
- var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
4203
-
4204
- if (isAndroid) {
4205
- OSVision = (navigator.userAgent.split(';')[1].match(/\d+\.\d+/g) || [])[0];
4206
- }
4207
-
4208
- if (isIOS) {
4209
- OSVision = (navigator.userAgent.split(';')[1].match(/(\d+)_(\d+)_?(\d+)?/) || [])[0];
4210
- }
4211
-
4212
- return OSVision;
4213
- } //获取设备类型
4214
-
4215
-
4216
- function getDeviceType() {
4217
- var deviceType;
4218
- var sUserAgent = navigator.userAgent.toLowerCase();
4219
- var bIsIpad = sUserAgent.match(/(ipad)/i) && 'ipad';
4220
- var bIsIphoneOs = sUserAgent.match(/iphone os/i) && 'iphone os';
4221
- var bIsMidp = sUserAgent.match(/midp/i) && 'midp';
4222
- var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) && 'rv:1.2.3.4';
4223
- var bIsUc = sUserAgent.match(/ucweb/i) && 'ucweb';
4224
- var bIsAndroid = sUserAgent.match(/android/i) && 'android';
4225
- var bIsCE = sUserAgent.match(/windows ce/i) && 'windows ce';
4226
- var bIsWM = sUserAgent.match(/windows mobile/i) && 'windows mobile';
4227
-
4228
- if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
4229
- deviceType = 'pc'; //pc
4230
- } else if (bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
4231
- deviceType = 'phone'; //phone
4232
- } else if (bIsIpad) {
4233
- deviceType = 'ipad'; //ipad
4234
- } else {
4235
- deviceType = undefined;
4236
- }
4237
-
4238
- return deviceType;
4239
- } // 获取网络状态
4240
-
4241
-
4242
- function getNetWork() {
4243
- var netWork;
4244
-
4245
- if (navigator.connection && navigator.connection.effectiveType) {
4246
- switch (navigator.connection.effectiveType) {
4247
- case 'wifi':
4248
- netWork = 'wifi'; // wifi
4249
-
4250
- break;
4251
-
4252
- case '4g':
4253
- netWork = '4g'; // 4g
4254
-
4255
- break;
4256
-
4257
- case '2g':
4258
- netWork = '2g'; // 2g
4259
-
4260
- break;
4261
-
4262
- case '3g':
4263
- netWork = '3g'; // 3g
4264
-
4265
- break;
4266
-
4267
- case 'ethernet':
4268
- netWork = 'ethernet'; // ethernet
4269
-
4270
- break;
4271
-
4272
- case 'default':
4273
- netWork = undefined; // 未知
4274
-
4275
- break;
4276
- }
4277
- }
4278
-
4279
- return netWork;
4280
- } // 获取横竖屏状态
4281
-
4282
-
4283
- function getOrientationStatu() {
4284
- var orientationStatu;
4285
-
4286
- if (window.screen && window.screen.orientation && window.screen.orientation.angle) {
4287
- if (window.screen.orientation.angle === 180 || window.screen.orientation.angle === 0) {
4288
- // 竖屏
4289
- orientationStatu = '|';
4290
- }
4291
-
4292
- if (window.screen.orientation.angle === 90 || window.screen.orientation.angle === -90) {
4293
- // 横屏
4294
- orientationStatu = '-';
4295
- }
4296
- }
4297
-
4298
- return orientationStatu;
4299
- } // 获取ssl连接时间
4300
-
4301
-
4302
- function getSSLTime(connectEnd, secureConnectionStart) {
4303
- var ssl_time;
4304
-
4305
- if (secureConnectionStart) {
4306
- ssl_time = connectEnd - secureConnectionStart;
4307
- }
4308
-
4309
- return ssl_time;
4310
- }
4311
-
4312
- return status;
4313
- }
4314
- /**
4315
- * @method inRate
4316
- * @description 百分位概率
4317
- * @param {Number} rate -- 0.1 ~ 1 => 1% ~ 100%
4318
- * @return {Boolean} true 命中
4319
- */
4320
-
4321
- function inRate(rate) {
4322
- if (Math.random() < rate) {
4323
- return true;
4324
- }
4325
-
4326
- return false;
4327
- }
4328
- /**
4329
- * @method isSafePWAEnv
4330
- * @description 判断是否是安全的 PWA 环境
4331
- * @return {Boolean} true 是
4332
- */
4333
-
4334
- function isSafePWAEnv() {
4335
- // 判断是否支持 async await
4336
- function isSupportAsyncAwait() {
4337
- var isSupportAsyncAwaitFunc;
4338
-
4339
- try {
4340
- // eval("func = async function(){};");
4341
- var fn = new Function("return async function(){};");
4342
- isSupportAsyncAwaitFunc = fn(); // console.log('isSupportAsyncAwaitFunc', isSupportAsyncAwaitFunc);
4343
- // 由于async函数的构造器不是全局对象,所以我们需要由下面代码来获取async函数的构造器
4344
- // 具体可以查看以下MDN上有关于AsyncFunction的说明,
4345
- // 地址:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction
4346
-
4347
- return Object.getPrototypeOf(isSupportAsyncAwaitFunc).constructor != null;
4348
- } catch (e) {
4349
- return false;
4350
- }
4351
- } // 判断是否支持 Promise
4352
-
4353
-
4354
- function isSupportPromise() {
4355
- if (typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1) {
4356
- return true;
4357
- }
4358
-
4359
- return false;
4360
- } // 浏览器信息
4361
-
4362
-
4363
- var BrowserType = getBrowserType();
4364
-
4365
- if ('serviceWorker' in navigator && isSupportAsyncAwait() && isSupportPromise() && Boolean(window.fetch) && Boolean(window.indexedDB) && Boolean(window.caches) && !BrowserType['shell']) {
4366
- return true;
4367
- }
4368
-
4369
- return false;
4370
- }
4371
- /**
4372
- * @method getBrowserType
4373
- * @description 返回浏览器信息 https://github.com/JowayYoung/juejin-code/blob/master/browser-type.js
4374
- * @return {Object} 浏览器信息
4375
- */
4376
-
4377
- function getBrowserType() {
4378
- try {
4379
- // 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
4380
- var ua_1 = navigator.userAgent.toLowerCase();
4381
-
4382
- var testUa = function testUa(regexp) {
4383
- return regexp.test(ua_1);
4384
- };
4385
-
4386
- var testVs = function testVs(regexp) {
4387
- return ua_1.match(regexp).toString().replace(/[^0-9|_.]/g, "").replace(/_/g, ".");
4388
- }; // 系统
4389
-
4390
-
4391
- var system = "unknow";
4392
-
4393
- if (testUa(/windows|win32|win64|wow32|wow64/g)) {
4394
- system = "windows"; // windows系统
4395
- } else if (testUa(/macintosh|macintel/g)) {
4396
- system = "macos"; // macos系统
4397
- } else if (testUa(/x11/g)) {
4398
- system = "linux"; // linux系统
4399
- } else if (testUa(/android|adr/g)) {
4400
- system = "android"; // android系统
4401
- } else if (testUa(/ios|iphone|ipad|ipod|iwatch/g)) {
4402
- system = "ios"; // ios系统
4403
- } // 系统版本
4404
-
4405
-
4406
- var systemVs = "unknow";
4407
-
4408
- if (system === "windows") {
4409
- if (testUa(/windows nt 5.0|windows 2000/g)) {
4410
- systemVs = "2000";
4411
- } else if (testUa(/windows nt 5.1|windows xp/g)) {
4412
- systemVs = "xp";
4413
- } else if (testUa(/windows nt 5.2|windows 2003/g)) {
4414
- systemVs = "2003";
4415
- } else if (testUa(/windows nt 6.0|windows vista/g)) {
4416
- systemVs = "vista";
4417
- } else if (testUa(/windows nt 6.1|windows 7/g)) {
4418
- systemVs = "7";
4419
- } else if (testUa(/windows nt 6.2|windows 8/g)) {
4420
- systemVs = "8";
4421
- } else if (testUa(/windows nt 6.3|windows 8.1/g)) {
4422
- systemVs = "8.1";
4423
- } else if (testUa(/windows nt 10.0|windows 10/g)) {
4424
- systemVs = "10";
4425
- }
4426
- } else if (system === "macos") {
4427
- systemVs = testVs(/os x [\d._]+/g);
4428
- } else if (system === "android") {
4429
- systemVs = testVs(/android [\d._]+/g);
4430
- } else if (system === "ios") {
4431
- systemVs = testVs(/os [\d._]+/g);
4432
- } // 平台
4433
-
4434
-
4435
- var platform = "unknow";
4436
-
4437
- if (system === "windows" || system === "macos" || system === "linux") {
4438
- platform = "desktop"; // 桌面端
4439
- } else if (system === "android" || system === "ios" || testUa(/mobile/g)) {
4440
- platform = "mobile"; // 移动端
4441
- } // 内核和载体
4442
-
4443
-
4444
- var engine = "unknow";
4445
- var supporter = "unknow";
4446
-
4447
- if (testUa(/applewebkit/g)) {
4448
- engine = "webkit"; // webkit内核
4449
-
4450
- if (testUa(/edge/g)) {
4451
- supporter = "edge"; // edge浏览器
4452
- } else if (testUa(/opr/g)) {
4453
- supporter = "opera"; // opera浏览器
4454
- } else if (testUa(/chrome/g)) {
4455
- supporter = "chrome"; // chrome浏览器
4456
- } else if (testUa(/safari/g)) {
4457
- supporter = "safari"; // safari浏览器
4458
- }
4459
- } else if (testUa(/gecko/g) && testUa(/firefox/g)) {
4460
- engine = "gecko"; // gecko内核
4461
-
4462
- supporter = "firefox"; // firefox浏览器
4463
- } else if (testUa(/presto/g)) {
4464
- engine = "presto"; // presto内核
4465
-
4466
- supporter = "opera"; // opera浏览器
4467
- } else if (testUa(/trident|compatible|msie/g)) {
4468
- engine = "trident"; // trident内核
4469
-
4470
- supporter = "iexplore"; // iexplore浏览器
4471
- } // 内核版本
4472
-
4473
-
4474
- var engineVs = "unknow";
4475
-
4476
- if (engine === "webkit") {
4477
- engineVs = testVs(/applewebkit\/[\d._]+/g);
4478
- } else if (engine === "gecko") {
4479
- engineVs = testVs(/gecko\/[\d._]+/g);
4480
- } else if (engine === "presto") {
4481
- engineVs = testVs(/presto\/[\d._]+/g);
4482
- } else if (engine === "trident") {
4483
- engineVs = testVs(/trident\/[\d._]+/g);
4484
- } // 载体版本
4485
-
4486
-
4487
- var supporterVs = "unknow";
4488
-
4489
- if (supporter === "chrome") {
4490
- supporterVs = testVs(/chrome\/[\d._]+/g);
4491
- } else if (supporter === "safari") {
4492
- supporterVs = testVs(/version\/[\d._]+/g);
4493
- } else if (supporter === "firefox") {
4494
- supporterVs = testVs(/firefox\/[\d._]+/g);
4495
- } else if (supporter === "opera") {
4496
- supporterVs = testVs(/opr\/[\d._]+/g);
4497
- } else if (supporter === "iexplore") {
4498
- supporterVs = testVs(/(msie [\d._]+)|(rv:[\d._]+)/g);
4499
- } else if (supporter === "edge") {
4500
- supporterVs = testVs(/edge\/[\d._]+/g);
4501
- } // 外壳和外壳版本
4502
-
4503
-
4504
- var shell = "none";
4505
- var shellVs = "unknow";
4506
-
4507
- if (testUa(/micromessenger/g)) {
4508
- shell = "wechat"; // 微信浏览器
4509
-
4510
- shellVs = testVs(/micromessenger\/[\d._]+/g);
4511
- } else if (testUa(/qqbrowser/g)) {
4512
- shell = "qq"; // QQ浏览器
4513
-
4514
- shellVs = testVs(/qqbrowser\/[\d._]+/g);
4515
- } else if (testUa(/ucbrowser/g)) {
4516
- shell = "uc"; // UC浏览器
4517
-
4518
- shellVs = testVs(/ucbrowser\/[\d._]+/g);
4519
- } else if (testUa(/qihu 360se/g)) {
4520
- shell = "360"; // 360浏览器(无版本)
4521
- } else if (testUa(/2345explorer/g)) {
4522
- shell = "2345"; // 2345浏览器
4523
-
4524
- shellVs = testVs(/2345explorer\/[\d._]+/g);
4525
- } else if (testUa(/metasr/g)) {
4526
- shell = "sougou"; // 搜狗浏览器(无版本)
4527
- } else if (testUa(/lbbrowser/g)) {
4528
- shell = "liebao"; // 猎豹浏览器(无版本)
4529
- } else if (testUa(/maxthon/g)) {
4530
- shell = "maxthon"; // 遨游浏览器
4531
-
4532
- shellVs = testVs(/maxthon\/[\d._]+/g);
4533
- }
4534
-
4535
- return Object.assign({
4536
- engine: engine,
4537
- engineVs: engineVs,
4538
- platform: platform,
4539
- supporter: supporter,
4540
- supporterVs: supporterVs,
4541
- system: system,
4542
- systemVs: systemVs
4543
- }, shell === "none" ? {} : {
4544
- shell: shell,
4545
- shellVs: shellVs
4546
- });
4547
- } catch (err) {
4548
- return {};
4549
- }
4550
- }
4551
- /**
4552
- * @method clearHtml
4553
- * @description 去除HTML标签
4554
- * @param {String} string 带html标签的字符串
4555
- * @return {String} 字符串
4556
- */
4557
-
4558
- function clearHtml(string) {
4559
- if (string === void 0) {
4560
- string = '';
4561
- }
4562
-
4563
- return string.replace(/<\/?.+?>/g, '').replace(/[\r\n]/g, '');
4564
- }
4565
- /**
4566
- * @method cutCHSString
4567
- * @description 截取字符串,中文算2个字节
4568
- * @param {String} str 要截取的字符串
4569
- * @param {Number} len
4570
- * @param {Boolean} hasDot
4571
- * @returns {String} 返回截取后的字符串
4572
- */
4573
-
4574
- function cutCHSString(str, len, hasDot) {
4575
- if (str === void 0) {
4576
- str = '';
4577
- }
4578
-
4579
- if (len === void 0) {
4580
- len = str.length;
4581
- }
4582
-
4583
- if (hasDot === void 0) {
4584
- hasDot = false;
4585
- }
4586
-
4587
- if (str == '' || !str) {
4588
- return '';
4589
- } else {
4590
- var newLength = 0;
4591
- var newStr = ''; // eslint-disable-next-line no-control-regex
4592
-
4593
- var chineseRegex = /[^\x00-\xff]/g;
4594
- var singleChar = '';
4595
- var strLength = str.replace(chineseRegex, '**').length;
4596
-
4597
- for (var i = 0; i < strLength; i++) {
4598
- singleChar = str.charAt(i).toString();
4599
-
4600
- if (singleChar.match(chineseRegex) != null) {
4601
- newLength += 2;
4602
- } else {
4603
- newLength++;
4604
- }
4605
-
4606
- if (newLength > len) {
4607
- break;
4608
- }
4609
-
4610
- newStr += singleChar;
4611
- }
4612
-
4613
- if (hasDot && strLength > len) {
4614
- newStr += '...';
4615
- }
4616
-
4617
- return newStr;
4618
- }
4619
- }
4620
- /**
4621
- * @method windowLoaded
4622
- * @description 页面加载完成
4623
- * @param {Number} timeout 超时时间 / 单位:秒
4624
- * @return {Promise<string>} document is loaded? 'complete' 'load' / 'timeout'
4625
- */
4626
-
4627
- function windowLoaded(_a) {
4628
- var _b = (_a === void 0 ? {} : _a).timeout,
4629
- timeout = _b === void 0 ? 90 : _b;
4630
-
4631
- var loaded = function loaded() {
4632
- return undefined;
4633
- };
4634
-
4635
- var loadFail = function loadFail() {
4636
- return undefined;
4637
- };
4638
-
4639
- var status = new Promise(function (resolve, reject) {
4640
- loaded = resolve;
4641
- loadFail = reject;
4642
- });
4643
-
4644
- if (document.readyState === 'complete') {
4645
- loaded('complete');
4646
- } else {
4647
- window.addEventListener('load', function () {
4648
- return loaded('load');
4649
- });
4650
- } // 超过 timeout 秒后加载失败
4651
-
4652
-
4653
- setTimeout(function () {
4654
- return loadFail('timeout');
4655
- }, timeout * 1000);
4656
- return status;
4657
- }
4658
- /**
4659
- * @method addInlineStyle
4660
- * @description 添加内联样式
4661
- * @param {String} inlineStyle 内联样式字符串
4662
- * @param {String} id <style> 标签的 ID
4663
- * @return {Boolean} 添加成功/失败
4664
- */
4665
-
4666
- function addInlineStyle(_a) {
4667
- var _b = _a === void 0 ? {} : _a,
4668
- _c = _b.inlineStyle,
4669
- inlineStyle = _c === void 0 ? '' : _c,
4670
- _d = _b.id,
4671
- id = _d === void 0 ? '' : _d;
4672
-
4673
- if (!inlineStyle) {
4674
- return false;
4675
- } // 创建 style 文档碎片
4676
-
4677
-
4678
- var styleFrag = document.createDocumentFragment();
4679
- var idDom = null;
4680
- var domId = ''; // Custom Style
4681
-
4682
- var customStyle = document.createElement('style'); // 如果需要 ID
4683
-
4684
- if (id) {
4685
- domId = "" + id;
4686
- idDom = document.getElementById(domId); // 如果 Dom 不存在,插入 style
4687
-
4688
- if (!idDom) {
4689
- customStyle.setAttribute('id', id);
4690
- customStyle.innerHTML = inlineStyle;
4691
- styleFrag.appendChild(customStyle);
4692
- document.head.appendChild(styleFrag);
4693
- } else {
4694
- // 如果 Dom 存在,直接更新
4695
- idDom.innerHTML = inlineStyle;
4696
- }
4697
- } else {
4698
- // 不需要 ID,直接添加新标签
4699
- customStyle.innerHTML = inlineStyle;
4700
- styleFrag.appendChild(customStyle);
4701
- document.head.appendChild(styleFrag);
4702
- }
4703
-
4704
- return true;
4705
- }
4706
- /**
4707
- * @method genCustomConsole
4708
- * @description 生成自定义控制台打印
4709
- * @param {String} prefix 前缀
4710
- * @param {Function} allowFn 允许打印的判断函数
4711
- * @return {Object} 新实例
4712
- */
4713
-
4714
- function genCustomConsole(_a) {
4715
- var _b = (_a === void 0 ? {} : _a).prefix,
4716
- prefix = _b === void 0 ? '' : _b;
4717
- var methods = ['log', 'info', 'warn', 'error'];
4718
- var newConsole = Object.create(null);
4719
- methods.forEach(function (method) {
4720
- newConsole[method] = function () {
4721
- var _a, _b;
4722
-
4723
- var argu = [];
4724
-
4725
- for (var _i = 0; _i < arguments.length; _i++) {
4726
- argu[_i] = arguments[_i];
4727
- }
4728
-
4729
- if (prefix) {
4730
- (_a = console)[method].apply(_a, __spreadArrays([prefix], argu));
4731
- } else {
4732
- (_b = console)[method].apply(_b, argu);
4733
- }
4734
- };
4735
- });
4736
- return newConsole;
4737
- }
4738
-
4739
- export { addClass, addInlineStyle, calLongestCommonSubsequence, calLongestCommonSubstring, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHtml, cutCHSString, debounce, deepCopyObject, doFn, floatFixed, floatToPercent, friendlyInterval, genCustomConsole, generateRndNum, generateUniqueNum, getBrowserType, getCookie, getDomain, getHashQueryParam, getLocalStorage, getPerformance, getQueryParam, getSessionStorage, getUrlParam, hasClass, inRate, isJsonString, isNumber, isSafePWAEnv, loadCSS, loadScript, mNow, mTrim, newLine, removeClass, setCookie, setLocalStorage, setSessionStorage, throttle, updateQueryParam, windowLoaded };
1
+ var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=function(t){return t&&t.Math==Math&&t},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")(),o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,u={f:c&&!a.call({1:2},1)?function(t){var e=c(this,t);return!!e&&e.enumerable}:a},f=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},l={}.toString,s=function(t){return l.call(t).slice(8,-1)},d="".split,p=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==s(t)?d.call(t,""):Object(t)}:Object,v=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=function(t){return p(v(t))},h=function(t){return"object"==typeof t?null!==t:"function"==typeof t},m=function(t,e){if(!h(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!h(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!h(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!h(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},y={}.hasOwnProperty,w=function(t,e){return y.call(t,e)},b=r.document,x=h(b)&&h(b.createElement),S=function(t){return x?b.createElement(t):{}},E=!i&&!o((function(){return 7!=Object.defineProperty(S("div"),"a",{get:function(){return 7}}).a})),O=Object.getOwnPropertyDescriptor,T={f:i?O:function(t,e){if(t=g(t),e=m(e,!0),E)try{return O(t,e)}catch(t){}if(w(t,e))return f(!u.f.call(t,e),t[e])}},j=function(t){if(!h(t))throw TypeError(String(t)+" is not an object");return t},A=Object.defineProperty,_={f:i?A:function(t,e,n){if(j(t),e=m(e,!0),j(n),E)try{return A(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},R=i?function(t,e,n){return _.f(t,e,f(1,n))}:function(t,e,n){return t[e]=n,t},P=function(t,e){try{R(r,t,e)}catch(n){r[t]=e}return e},M=r["__core-js_shared__"]||P("__core-js_shared__",{}),k=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(t){return k.call(t)});var C,I,L,N=M.inspectSource,F=r.WeakMap,D="function"==typeof F&&/native code/.test(N(F)),$=e((function(t){(t.exports=function(t,e){return M[t]||(M[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),B=0,U=Math.random(),q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++B+U).toString(36)},V=$("keys"),G=function(t){return V[t]||(V[t]=q(t))},W={},z=r.WeakMap;if(D){var H=new z,K=H.get,J=H.has,Y=H.set;C=function(t,e){return Y.call(H,t,e),e},I=function(t){return K.call(H,t)||{}},L=function(t){return J.call(H,t)}}else{var X=G("state");W[X]=!0,C=function(t,e){return R(t,X,e),e},I=function(t){return w(t,X)?t[X]:{}},L=function(t){return w(t,X)}}var Z,Q,tt={set:C,get:I,has:L,enforce:function(t){return L(t)?I(t):C(t,{})},getterFor:function(t){return function(e){var n;if(!h(e)||(n=I(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},et=e((function(t){var e=tt.get,n=tt.enforce,o=String(String).split("String");(t.exports=function(t,e,i,a){var c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof e||w(i,"name")||R(i,"name",e),n(i).source=o.join("string"==typeof e?e:"")),t!==r?(c?!f&&t[e]&&(u=!0):delete t[e],u?t[e]=i:R(t,e,i)):u?t[e]=i:P(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||N(this)}))})),nt=r,rt=function(t){return"function"==typeof t?t:void 0},ot=function(t,e){return arguments.length<2?rt(nt[t])||rt(r[t]):nt[t]&&nt[t][e]||r[t]&&r[t][e]},it=Math.ceil,at=Math.floor,ct=function(t){return isNaN(t=+t)?0:(t>0?at:it)(t)},ut=Math.min,ft=function(t){return t>0?ut(ct(t),9007199254740991):0},lt=Math.max,st=Math.min,dt=function(t,e){var n=ct(t);return n<0?lt(n+e,0):st(n,e)},pt=function(t){return function(e,n,r){var o,i=g(e),a=ft(i.length),c=dt(r,a);if(t&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},vt={includes:pt(!0),indexOf:pt(!1)},gt=vt.indexOf,ht=function(t,e){var n,r=g(t),o=0,i=[];for(n in r)!w(W,n)&&w(r,n)&&i.push(n);for(;e.length>o;)w(r,n=e[o++])&&(~gt(i,n)||i.push(n));return i},mt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yt=mt.concat("length","prototype"),wt={f:Object.getOwnPropertyNames||function(t){return ht(t,yt)}},bt={f:Object.getOwnPropertySymbols},xt=ot("Reflect","ownKeys")||function(t){var e=wt.f(j(t)),n=bt.f;return n?e.concat(n(t)):e},St=function(t,e){for(var n=xt(e),r=_.f,o=T.f,i=0;i<n.length;i++){var a=n[i];w(t,a)||r(t,a,o(e,a))}},Et=/#|\.prototype\./,Ot=function(t,e){var n=jt[Tt(t)];return n==_t||n!=At&&("function"==typeof e?o(e):!!e)},Tt=Ot.normalize=function(t){return String(t).replace(Et,".").toLowerCase()},jt=Ot.data={},At=Ot.NATIVE="N",_t=Ot.POLYFILL="P",Rt=Ot,Pt=T.f,Mt=function(t,e){var n,o,i,a,c,u=t.target,f=t.global,l=t.stat;if(n=f?r:l?r[u]||P(u,{}):(r[u]||{}).prototype)for(o in e){if(a=e[o],i=t.noTargetGet?(c=Pt(n,o))&&c.value:n[o],!Rt(f?o:u+(l?".":"#")+o,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;St(a,i)}(t.sham||i&&i.sham)&&R(a,"sham",!0),et(n,o,a,t)}},kt=Array.isArray||function(t){return"Array"==s(t)},Ct=function(t){return Object(v(t))},It=function(t,e,n){var r=m(e);r in t?_.f(t,r,f(0,n)):t[r]=n},Lt=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())})),Nt=Lt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ft=$("wks"),Dt=r.Symbol,$t=Nt?Dt:Dt&&Dt.withoutSetter||q,Bt=function(t){return w(Ft,t)||(Lt&&w(Dt,t)?Ft[t]=Dt[t]:Ft[t]=$t("Symbol."+t)),Ft[t]},Ut=Bt("species"),qt=function(t,e){var n;return kt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!kt(n.prototype)?h(n)&&null===(n=n[Ut])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Vt=ot("navigator","userAgent")||"",Gt=r.process,Wt=Gt&&Gt.versions,zt=Wt&&Wt.v8;zt?Q=(Z=zt.split("."))[0]+Z[1]:Vt&&(!(Z=Vt.match(/Edge\/(\d+)/))||Z[1]>=74)&&(Z=Vt.match(/Chrome\/(\d+)/))&&(Q=Z[1]);var Ht=Q&&+Q,Kt=Bt("species"),Jt=function(t){return Ht>=51||!o((function(){var e=[];return(e.constructor={})[Kt]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Yt=Bt("isConcatSpreadable"),Xt=Ht>=51||!o((function(){var t=[];return t[Yt]=!1,t.concat()[0]!==t})),Zt=Jt("concat"),Qt=function(t){if(!h(t))return!1;var e=t[Yt];return void 0!==e?!!e:kt(t)};Mt({target:"Array",proto:!0,forced:!Xt||!Zt},{concat:function(t){var e,n,r,o,i,a=Ct(this),c=qt(a,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(Qt(i=-1===e?a:arguments[e])){if(u+(o=ft(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,u++)n in i&&It(c,u,i[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");It(c,u++,i)}return c.length=u,c}});var te,ee=Object.keys||function(t){return ht(t,mt)},ne=i?Object.defineProperties:function(t,e){j(t);for(var n,r=ee(e),o=r.length,i=0;o>i;)_.f(t,n=r[i++],e[n]);return t},re=ot("document","documentElement"),oe=G("IE_PROTO"),ie=function(){},ae=function(t){return"<script>"+t+"<\/script>"},ce=function(){try{te=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;ce=te?function(t){t.write(ae("")),t.close();var e=t.parentWindow.Object;return t=null,e}(te):((e=S("iframe")).style.display="none",re.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(ae("document.F=Object")),t.close(),t.F);for(var n=mt.length;n--;)delete ce.prototype[mt[n]];return ce()};W[oe]=!0;var ue=Object.create||function(t,e){var n;return null!==t?(ie.prototype=j(t),n=new ie,ie.prototype=null,n[oe]=t):n=ce(),void 0===e?n:ne(n,e)},fe=Bt("unscopables"),le=Array.prototype;null==le[fe]&&_.f(le,fe,{configurable:!0,value:ue(null)});var se;Mt({target:"Array",proto:!0},{fill:function(t){for(var e=Ct(this),n=ft(e.length),r=arguments.length,o=dt(r>1?arguments[1]:void 0,n),i=r>2?arguments[2]:void 0,a=void 0===i?n:dt(i,n);a>o;)e[o++]=t;return e}}),se="fill",le[fe][se]=!0;var de=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},pe=function(t,e,n){if(de(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},ve=[].push,ge=function(t){var e=1==t,n=2==t,r=3==t,o=4==t,i=6==t,a=5==t||i;return function(c,u,f,l){for(var s,d,v=Ct(c),g=p(v),h=pe(u,f,3),m=ft(g.length),y=0,w=l||qt,b=e?w(c,m):n?w(c,0):void 0;m>y;y++)if((a||y in g)&&(d=h(s=g[y],y,v),t))if(e)b[y]=d;else if(d)switch(t){case 3:return!0;case 5:return s;case 6:return y;case 2:ve.call(b,s)}else if(o)return!1;return i?-1:r||o?o:b}},he={forEach:ge(0),map:ge(1),filter:ge(2),some:ge(3),every:ge(4),find:ge(5),findIndex:ge(6)},me=function(t,e){var n=[][t];return!!n&&o((function(){n.call(null,e||function(){throw 1},1)}))},ye=Object.defineProperty,we={},be=function(t){throw t},xe=function(t,e){if(w(we,t))return we[t];e||(e={});var n=[][t],r=!!w(e,"ACCESSORS")&&e.ACCESSORS,a=w(e,0)?e[0]:be,c=w(e,1)?e[1]:void 0;return we[t]=!!n&&!o((function(){if(r&&!i)return!0;var t={length:-1};r?ye(t,1,{enumerable:!0,get:be}):t[1]=1,n.call(t,a,c)}))},Se=he.forEach,Ee=me("forEach"),Oe=xe("forEach"),Te=Ee&&Oe?[].forEach:function(t){return Se(this,t,arguments.length>1?arguments[1]:void 0)};Mt({target:"Array",proto:!0,forced:[].forEach!=Te},{forEach:Te});var je=vt.indexOf,Ae=[].indexOf,_e=!!Ae&&1/[1].indexOf(1,-0)<0,Re=me("indexOf"),Pe=xe("indexOf",{ACCESSORS:!0,1:0});Mt({target:"Array",proto:!0,forced:_e||!Re||!Pe},{indexOf:function(t){return _e?Ae.apply(this,arguments)||0:je(this,t,arguments.length>1?arguments[1]:void 0)}});var Me=[].join,ke=p!=Object,Ce=me("join",",");Mt({target:"Array",proto:!0,forced:ke||!Ce},{join:function(t){return Me.call(g(this),void 0===t?",":t)}});var Ie=function(t){return function(e,n,r,o){de(n);var i=Ct(e),a=p(i),c=ft(i.length),u=t?c-1:0,f=t?-1:1;if(r<2)for(;;){if(u in a){o=a[u],u+=f;break}if(u+=f,t?u<0:c<=u)throw TypeError("Reduce of empty array with no initial value")}for(;t?u>=0:c>u;u+=f)u in a&&(o=n(o,a[u],u,i));return o}},Le={left:Ie(!1),right:Ie(!0)}.left,Ne=me("reduce"),Fe=xe("reduce",{1:0});Mt({target:"Array",proto:!0,forced:!Ne||!Fe},{reduce:function(t){return Le(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var De=Jt("slice"),$e=xe("slice",{ACCESSORS:!0,0:0,1:2}),Be=Bt("species"),Ue=[].slice,qe=Math.max;Mt({target:"Array",proto:!0,forced:!De||!$e},{slice:function(t,e){var n,r,o,i=g(this),a=ft(i.length),c=dt(t,a),u=dt(void 0===e?a:e,a);if(kt(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!kt(n.prototype)?h(n)&&null===(n=n[Be])&&(n=void 0):n=void 0,n===Array||void 0===n))return Ue.call(i,c,u);for(r=new(void 0===n?Array:n)(qe(u-c,0)),o=0;c<u;c++,o++)c in i&&It(r,o,i[c]);return r.length=o,r}});var Ve=_.f,Ge=Function.prototype,We=Ge.toString,ze=/^\s*function ([^ (]*)/;i&&!("name"in Ge)&&Ve(Ge,"name",{configurable:!0,get:function(){try{return We.call(this).match(ze)[1]}catch(t){return""}}});var He="".repeat||function(t){var e=String(v(this)),n="",r=ct(t);if(r<0||r==1/0)throw RangeError("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n},Ke=1..toFixed,Je=Math.floor,Ye=function(t,e,n){return 0===e?n:e%2==1?Ye(t,e-1,n*t):Ye(t*t,e/2,n)};Mt({target:"Number",proto:!0,forced:Ke&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!o((function(){Ke.call({})}))},{toFixed:function(t){var e,n,r,o,i=function(t){if("number"!=typeof t&&"Number"!=s(t))throw TypeError("Incorrect invocation");return+t}(this),a=ct(t),c=[0,0,0,0,0,0],u="",f="0",l=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=Je(r/1e7)},d=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=Je(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+He.call("0",7-n.length)+n}return e};if(a<0||a>20)throw RangeError("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return String(i);if(i<0&&(u="-",i=-i),i>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(i*Ye(2,69,1))-69)<0?i*Ye(2,-e,1):i/Ye(2,e,1),n*=4503599627370496,(e=52-e)>0){for(l(0,n),r=a;r>=7;)l(1e7,0),r-=7;for(l(Ye(10,r,1),0),r=e-1;r>=23;)d(1<<23),r-=23;d(1<<r),l(1,1),d(2),f=p()}else l(0,n),l(1<<-e,0),f=p()+He.call("0",a);return f=a>0?u+((o=f.length)<=a?"0."+He.call("0",a-o)+f:f.slice(0,o-a)+"."+f.slice(o-a)):u+f}});var Xe=Object.assign,Ze=Object.defineProperty,Qe=!Xe||o((function(){if(i&&1!==Xe({b:1},Xe(Ze({},"a",{enumerable:!0,get:function(){Ze(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=Xe({},t)[n]||ee(Xe({},e)).join("")!=r}))?function(t,e){for(var n=Ct(t),r=arguments.length,o=1,a=bt.f,c=u.f;r>o;)for(var f,l=p(arguments[o++]),s=a?ee(l).concat(a(l)):ee(l),d=s.length,v=0;d>v;)f=s[v++],i&&!c.call(l,f)||(n[f]=l[f]);return n}:Xe;Mt({target:"Object",stat:!0,forced:Object.assign!==Qe},{assign:Qe});var tn=!o((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),en=G("IE_PROTO"),nn=Object.prototype,rn=tn?Object.getPrototypeOf:function(t){return t=Ct(t),w(t,en)?t[en]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?nn:null};Mt({target:"Object",stat:!0,forced:o((function(){rn(1)})),sham:!tn},{getPrototypeOf:function(t){return rn(Ct(t))}}),Mt({target:"Object",stat:!0,forced:o((function(){ee(1)}))},{keys:function(t){return ee(Ct(t))}});var on={};on[Bt("toStringTag")]="z";var an="[object z]"===String(on),cn=Bt("toStringTag"),un="Arguments"==s(function(){return arguments}()),fn=an?s:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),cn))?n:un?s(e):"Object"==(r=s(e))&&"function"==typeof e.callee?"Arguments":r},ln=an?{}.toString:function(){return"[object "+fn(this)+"]"};an||et(Object.prototype,"toString",ln,{unsafe:!0});var sn="[\t\n\v\f\r                 \u2028\u2029\ufeff]",dn=RegExp("^"+sn+sn+"*"),pn=RegExp(sn+sn+"*$"),vn=function(t){return function(e){var n=String(v(e));return 1&t&&(n=n.replace(dn,"")),2&t&&(n=n.replace(pn,"")),n}},gn={start:vn(1),end:vn(2),trim:vn(3)}.trim,hn=r.parseFloat,mn=1/hn("\t\n\v\f\r                 \u2028\u2029\ufeff-0")!=-1/0?function(t){var e=gn(String(t)),n=hn(e);return 0===n&&"-"==e.charAt(0)?-0:n}:hn;Mt({global:!0,forced:parseFloat!=mn},{parseFloat:mn});var yn=r.Promise,wn=_.f,bn=Bt("toStringTag"),xn=Bt("species"),Sn=function(t){var e=ot(t),n=_.f;i&&e&&!e[xn]&&n(e,xn,{configurable:!0,get:function(){return this}})},En={},On=Bt("iterator"),Tn=Array.prototype,jn=Bt("iterator"),An=function(t,e,n,r){try{return r?e(j(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&j(o.call(t)),e}},_n=e((function(t){var e=function(t,e){this.stopped=t,this.result=e},n=t.exports=function(t,n,r,o,i){var a,c,u,f,l,s,d,p,v=pe(n,r,o?2:1);if(i)a=t;else{if(c=function(t){if(null!=t)return t[jn]||t["@@iterator"]||En[fn(t)]}(t),"function"!=typeof c)throw TypeError("Target is not iterable");if(void 0!==(p=c)&&(En.Array===p||Tn[On]===p)){for(u=0,f=ft(t.length);f>u;u++)if((l=o?v(j(d=t[u])[0],d[1]):v(t[u]))&&l instanceof e)return l;return new e(!1)}a=c.call(t)}for(s=a.next;!(d=s.call(a)).done;)if("object"==typeof(l=An(a,v,d.value,o))&&l&&l instanceof e)return l;return new e(!1)};n.stop=function(t){return new e(!0,t)}})),Rn=Bt("iterator"),Pn=!1;try{var Mn=0,kn={next:function(){return{done:!!Mn++}},return:function(){Pn=!0}};kn[Rn]=function(){return this},Array.from(kn,(function(){throw 2}))}catch(t){}var Cn,In,Ln,Nn=Bt("species"),Fn=function(t,e){var n,r=j(t).constructor;return void 0===r||null==(n=j(r)[Nn])?e:de(n)},Dn=/(iphone|ipod|ipad).*applewebkit/i.test(Vt),$n=r.location,Bn=r.setImmediate,Un=r.clearImmediate,qn=r.process,Vn=r.MessageChannel,Gn=r.Dispatch,Wn=0,zn={},Hn=function(t){if(zn.hasOwnProperty(t)){var e=zn[t];delete zn[t],e()}},Kn=function(t){return function(){Hn(t)}},Jn=function(t){Hn(t.data)},Yn=function(t){r.postMessage(t+"",$n.protocol+"//"+$n.host)};Bn&&Un||(Bn=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return zn[++Wn]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},Cn(Wn),Wn},Un=function(t){delete zn[t]},"process"==s(qn)?Cn=function(t){qn.nextTick(Kn(t))}:Gn&&Gn.now?Cn=function(t){Gn.now(Kn(t))}:Vn&&!Dn?(Ln=(In=new Vn).port2,In.port1.onmessage=Jn,Cn=pe(Ln.postMessage,Ln,1)):!r.addEventListener||"function"!=typeof postMessage||r.importScripts||o(Yn)||"file:"===$n.protocol?Cn="onreadystatechange"in S("script")?function(t){re.appendChild(S("script")).onreadystatechange=function(){re.removeChild(this),Hn(t)}}:function(t){setTimeout(Kn(t),0)}:(Cn=Yn,r.addEventListener("message",Jn,!1)));var Xn,Zn,Qn,tr,er,nr,rr,or,ir={set:Bn,clear:Un},ar=T.f,cr=ir.set,ur=r.MutationObserver||r.WebKitMutationObserver,fr=r.process,lr=r.Promise,sr="process"==s(fr),dr=ar(r,"queueMicrotask"),pr=dr&&dr.value;pr||(Xn=function(){var t,e;for(sr&&(t=fr.domain)&&t.exit();Zn;){e=Zn.fn,Zn=Zn.next;try{e()}catch(t){throw Zn?tr():Qn=void 0,t}}Qn=void 0,t&&t.enter()},sr?tr=function(){fr.nextTick(Xn)}:ur&&!Dn?(er=!0,nr=document.createTextNode(""),new ur(Xn).observe(nr,{characterData:!0}),tr=function(){nr.data=er=!er}):lr&&lr.resolve?(rr=lr.resolve(void 0),or=rr.then,tr=function(){or.call(rr,Xn)}):tr=function(){cr.call(r,Xn)});var vr,gr,hr,mr,yr,wr,br,xr=pr||function(t){var e={fn:t,next:void 0};Qn&&(Qn.next=e),Zn||(Zn=e,tr()),Qn=e},Sr=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=de(e),this.reject=de(n)},Er={f:function(t){return new Sr(t)}},Or=function(t,e){if(j(t),h(e)&&e.constructor===t)return e;var n=Er.f(t);return(0,n.resolve)(e),n.promise},Tr=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},jr=ir.set,Ar=Bt("species"),_r="Promise",Rr=tt.get,Pr=tt.set,Mr=tt.getterFor(_r),kr=yn,Cr=r.TypeError,Ir=r.document,Lr=r.process,Nr=ot("fetch"),Fr=Er.f,Dr=Fr,$r="process"==s(Lr),Br=!!(Ir&&Ir.createEvent&&r.dispatchEvent),Ur=Rt(_r,(function(){if(!(N(kr)!==String(kr))){if(66===Ht)return!0;if(!$r&&"function"!=typeof PromiseRejectionEvent)return!0}if(Ht>=51&&/native code/.test(kr))return!1;var t=kr.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Ar]=e,!(t.then((function(){}))instanceof e)})),qr=Ur||!function(t,e){if(!e&&!Pn)return!1;var n=!1;try{var r={};r[Rn]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}((function(t){kr.all(t).catch((function(){}))})),Vr=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},Gr=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;xr((function(){for(var o=e.value,i=1==e.state,a=0;r.length>a;){var c,u,f,l=r[a++],s=i?l.ok:l.fail,d=l.resolve,p=l.reject,v=l.domain;try{s?(i||(2===e.rejection&&Kr(t,e),e.rejection=1),!0===s?c=o:(v&&v.enter(),c=s(o),v&&(v.exit(),f=!0)),c===l.promise?p(Cr("Promise-chain cycle")):(u=Vr(c))?u.call(c,d,p):d(c)):p(o)}catch(t){v&&!f&&v.exit(),p(t)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&zr(t,e)}))}},Wr=function(t,e,n){var o,i;Br?((o=Ir.createEvent("Event")).promise=e,o.reason=n,o.initEvent(t,!1,!0),r.dispatchEvent(o)):o={promise:e,reason:n},(i=r["on"+t])?i(o):"unhandledrejection"===t&&function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},zr=function(t,e){jr.call(r,(function(){var n,r=e.value;if(Hr(e)&&(n=Tr((function(){$r?Lr.emit("unhandledRejection",r,t):Wr("unhandledrejection",t,r)})),e.rejection=$r||Hr(e)?2:1,n.error))throw n.value}))},Hr=function(t){return 1!==t.rejection&&!t.parent},Kr=function(t,e){jr.call(r,(function(){$r?Lr.emit("rejectionHandled",t):Wr("rejectionhandled",t,e.value)}))},Jr=function(t,e,n,r){return function(o){t(e,n,o,r)}},Yr=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,Gr(t,e,!0))},Xr=function(t,e,n,r){if(!e.done){e.done=!0,r&&(e=r);try{if(t===n)throw Cr("Promise can't be resolved itself");var o=Vr(n);o?xr((function(){var r={done:!1};try{o.call(n,Jr(Xr,t,r,e),Jr(Yr,t,r,e))}catch(n){Yr(t,r,n,e)}})):(e.value=n,e.state=1,Gr(t,e,!1))}catch(n){Yr(t,{done:!1},n,e)}}};Ur&&(kr=function(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,kr,_r),de(t),vr.call(this);var e=Rr(this);try{t(Jr(Xr,this,e),Jr(Yr,this,e))}catch(t){Yr(this,e,t)}},(vr=function(t){Pr(this,{type:_r,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var r in e)et(t,r,e[r],n);return t}(kr.prototype,{then:function(t,e){var n=Mr(this),r=Fr(Fn(this,kr));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=$r?Lr.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Gr(this,n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),gr=function(){var t=new vr,e=Rr(t);this.promise=t,this.resolve=Jr(Xr,t,e),this.reject=Jr(Yr,t,e)},Er.f=Fr=function(t){return t===kr||t===hr?new gr(t):Dr(t)},"function"==typeof yn&&(mr=yn.prototype.then,et(yn.prototype,"then",(function(t,e){var n=this;return new kr((function(t,e){mr.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof Nr&&Mt({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Or(kr,Nr.apply(r,arguments))}}))),Mt({global:!0,wrap:!0,forced:Ur},{Promise:kr}),wr=_r,br=!1,(yr=kr)&&!w(yr=br?yr:yr.prototype,bn)&&wn(yr,bn,{configurable:!0,value:wr}),Sn(_r),hr=ot(_r),Mt({target:_r,stat:!0,forced:Ur},{reject:function(t){var e=Fr(this);return e.reject.call(void 0,t),e.promise}}),Mt({target:_r,stat:!0,forced:Ur},{resolve:function(t){return Or(this,t)}}),Mt({target:_r,stat:!0,forced:qr},{all:function(t){var e=this,n=Fr(e),r=n.resolve,o=n.reject,i=Tr((function(){var n=de(e.resolve),i=[],a=0,c=1;_n(t,(function(t){var u=a++,f=!1;i.push(void 0),c++,n.call(e,t).then((function(t){f||(f=!0,i[u]=t,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=Fr(e),r=n.reject,o=Tr((function(){var o=de(e.resolve);_n(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var Zr=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return j(n),function(t){if(!h(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),Qr=Bt("match"),to=function(t){var e;return h(t)&&(void 0!==(e=t[Qr])?!!e:"RegExp"==s(t))},eo=function(){var t=j(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e};function no(t,e){return RegExp(t,e)}var ro={UNSUPPORTED_Y:o((function(){var t=no("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:o((function(){var t=no("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},oo=_.f,io=wt.f,ao=tt.set,co=Bt("match"),uo=r.RegExp,fo=uo.prototype,lo=/a/g,so=/a/g,po=new uo(lo)!==lo,vo=ro.UNSUPPORTED_Y;if(i&&Rt("RegExp",!po||vo||o((function(){return so[co]=!1,uo(lo)!=lo||uo(so)==so||"/a/i"!=uo(lo,"i")})))){for(var go=function(t,e){var n,r=this instanceof go,o=to(t),i=void 0===e;if(!r&&o&&t.constructor===go&&i)return t;po?o&&!i&&(t=t.source):t instanceof go&&(i&&(e=eo.call(t)),t=t.source),vo&&(n=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var a,c,u,f,l,s=(a=po?new uo(t,e):uo(t,e),c=r?this:fo,u=go,Zr&&"function"==typeof(f=c.constructor)&&f!==u&&h(l=f.prototype)&&l!==u.prototype&&Zr(a,l),a);return vo&&n&&ao(s,{sticky:n}),s},ho=function(t){t in go||oo(go,t,{configurable:!0,get:function(){return uo[t]},set:function(e){uo[t]=e}})},mo=io(uo),yo=0;mo.length>yo;)ho(mo[yo++]);fo.constructor=go,go.prototype=fo,et(r,"RegExp",go)}Sn("RegExp");var wo=RegExp.prototype.exec,bo=String.prototype.replace,xo=wo,So=function(){var t=/a/,e=/b*/g;return wo.call(t,"a"),wo.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),Eo=ro.UNSUPPORTED_Y||ro.BROKEN_CARET,Oo=void 0!==/()??/.exec("")[1];(So||Oo||Eo)&&(xo=function(t){var e,n,r,o,i=this,a=Eo&&i.sticky,c=eo.call(i),u=i.source,f=0,l=t;return a&&(-1===(c=c.replace("y","")).indexOf("g")&&(c+="g"),l=String(t).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==t[i.lastIndex-1])&&(u="(?: "+u+")",l=" "+l,f++),n=new RegExp("^(?:"+u+")",c)),Oo&&(n=new RegExp("^"+u+"$(?!\\s)",c)),So&&(e=i.lastIndex),r=wo.call(a?n:i,l),a?r?(r.input=r.input.slice(f),r[0]=r[0].slice(f),r.index=i.lastIndex,i.lastIndex+=r[0].length):i.lastIndex=0:So&&r&&(i.lastIndex=i.global?r.index+r[0].length:e),Oo&&r&&r.length>1&&bo.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r});var To=xo;Mt({target:"RegExp",proto:!0,forced:/./.exec!==To},{exec:To});var jo=RegExp.prototype,Ao=jo.toString,_o=o((function(){return"/a/b"!=Ao.call({source:"a",flags:"b"})})),Ro="toString"!=Ao.name;(_o||Ro)&&et(RegExp.prototype,"toString",(function(){var t=j(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in jo)?eo.call(t):n)}),{unsafe:!0}),Mt({target:"RegExp",proto:!0,forced:/./.exec!==To},{exec:To});var Po=Bt("species"),Mo=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),ko="$0"==="a".replace(/./,"$0"),Co=Bt("replace"),Io=!!/./[Co]&&""===/./[Co]("a","$0"),Lo=!o((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),No=function(t,e,n,r){var i=Bt(t),a=!o((function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})),c=a&&!o((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[Po]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return e=!0,null},n[i](""),!e}));if(!a||!c||"replace"===t&&(!Mo||!ko||Io)||"split"===t&&!Lo){var u=/./[i],f=n(i,""[t],(function(t,e,n,r,o){return e.exec===To?a&&!o?{done:!0,value:u.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:ko,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Io}),l=f[0],s=f[1];et(String.prototype,t,l),et(RegExp.prototype,i,2==e?function(t,e){return s.call(t,this,e)}:function(t){return s.call(t,this)})}r&&R(RegExp.prototype[i],"sham",!0)},Fo=function(t){return function(e,n){var r,o,i=String(v(e)),a=ct(n),c=i.length;return a<0||a>=c?t?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):r:t?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}},Do={codeAt:Fo(!1),charAt:Fo(!0)}.charAt,$o=function(t,e,n){return e+(n?Do(t,e).length:1)},Bo=function(t,e){var n=t.exec;if("function"==typeof n){var r=n.call(t,e);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==s(t))throw TypeError("RegExp#exec called on incompatible receiver");return To.call(t,e)};No("match",1,(function(t,e,n){return[function(e){var n=v(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var o=j(t),i=String(this);if(!o.global)return Bo(o,i);var a=o.unicode;o.lastIndex=0;for(var c,u=[],f=0;null!==(c=Bo(o,i));){var l=String(c[0]);u[f]=l,""===l&&(o.lastIndex=$o(i,ft(o.lastIndex),a)),f++}return 0===f?null:u}]}));var Uo=Math.max,qo=Math.min,Vo=Math.floor,Go=/\$([$&'`]|\d\d?|<[^>]*>)/g,Wo=/\$([$&'`]|\d\d?)/g,zo=function(t){return void 0===t?t:String(t)};No("replace",2,(function(t,e,n,r){var o=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=r.REPLACE_KEEPS_$0,a=o?"$":"$0";return[function(n,r){var o=v(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,r){if(!o&&i||"string"==typeof r&&-1===r.indexOf(a)){var u=n(e,t,this,r);if(u.done)return u.value}var f=j(t),l=String(this),s="function"==typeof r;s||(r=String(r));var d=f.global;if(d){var p=f.unicode;f.lastIndex=0}for(var v=[];;){var g=Bo(f,l);if(null===g)break;if(v.push(g),!d)break;""===String(g[0])&&(f.lastIndex=$o(l,ft(f.lastIndex),p))}for(var h="",m=0,y=0;y<v.length;y++){g=v[y];for(var w=String(g[0]),b=Uo(qo(ct(g.index),l.length),0),x=[],S=1;S<g.length;S++)x.push(zo(g[S]));var E=g.groups;if(s){var O=[w].concat(x,b,l);void 0!==E&&O.push(E);var T=String(r.apply(void 0,O))}else T=c(w,l,b,x,E,r);b>=m&&(h+=l.slice(m,b)+T,m=b+w.length)}return h+l.slice(m)}];function c(t,n,r,o,i,a){var c=r+t.length,u=o.length,f=Wo;return void 0!==i&&(i=Ct(i),f=Go),e.call(a,f,(function(e,a){var f;switch(a.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,r);case"'":return n.slice(c);case"<":f=i[a.slice(1,-1)];break;default:var l=+a;if(0===l)return e;if(l>u){var s=Vo(l/10);return 0===s?e:s<=u?void 0===o[s-1]?a.charAt(1):o[s-1]+a.charAt(1):e}f=o[l-1]}return void 0===f?"":f}))}}));var Ho=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};No("search",1,(function(t,e,n){return[function(e){var n=v(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var o=j(t),i=String(this),a=o.lastIndex;Ho(a,0)||(o.lastIndex=0);var c=Bo(o,i);return Ho(o.lastIndex,a)||(o.lastIndex=a),null===c?-1:c.index}]}));var Ko=[].push,Jo=Math.min,Yo=!o((function(){return!RegExp(4294967295,"y")}));No("split",2,(function(t,e,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r=String(v(this)),o=void 0===n?4294967295:n>>>0;if(0===o)return[];if(void 0===t)return[r];if(!to(t))return e.call(r,t,o);for(var i,a,c,u=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,s=new RegExp(t.source,f+"g");(i=To.call(s,r))&&!((a=s.lastIndex)>l&&(u.push(r.slice(l,i.index)),i.length>1&&i.index<r.length&&Ko.apply(u,i.slice(1)),c=i[0].length,l=a,u.length>=o));)s.lastIndex===i.index&&s.lastIndex++;return l===r.length?!c&&s.test("")||u.push(""):u.push(r.slice(l)),u.length>o?u.slice(0,o):u}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var o=v(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,n):r.call(String(o),e,n)},function(t,o){var i=n(r,t,this,o,r!==e);if(i.done)return i.value;var a=j(t),c=String(this),u=Fn(a,RegExp),f=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Yo?"y":"g"),s=new u(Yo?a:"^(?:"+a.source+")",l),d=void 0===o?4294967295:o>>>0;if(0===d)return[];if(0===c.length)return null===Bo(s,c)?[c]:[];for(var p=0,v=0,g=[];v<c.length;){s.lastIndex=Yo?v:0;var h,m=Bo(s,Yo?c:c.slice(v));if(null===m||(h=Jo(ft(s.lastIndex+(Yo?0:v)),c.length))===p)v=$o(c,v,f);else{if(g.push(c.slice(p,v)),g.length===d)return g;for(var y=1;y<=m.length-1;y++)if(g.push(m[y]),g.length===d)return g;v=p=h}}return g.push(c.slice(p)),g}]}),!Yo);for(var Xo in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Zo=r[Xo],Qo=Zo&&Zo.prototype;if(Qo&&Qo.forEach!==Te)try{R(Qo,"forEach",Te)}catch(t){Qo.forEach=Te}}var ti=e((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));function ei(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,c=i.length;a<c;a++,o++)r[o]=i[a];return r}function ni(t,e){void 0===t&&(t=""),void 0===e&&(e="");for(var n=t.length,r=e.length,o=pi(new Array(n).fill(new Array(r).fill(0))),i=0;i<n;++i)for(var a=0;a<r;++a)if(t[i]===e[a]){var c=0;i>0&&a>0&&(c=o[i-1][a-1]),o[i][a]=c+1}var u=Array.prototype.concat.apply([],o);return Math.max.apply(Math,u)}function ri(t,e){void 0===t&&(t=""),void 0===e&&(e="");for(var n=t.length,r=e.length,o=pi(new Array(n).fill(new Array(r).fill(0))),i=0;i<n;++i)for(var a=0;a<r;++a)if(t[i]===e[a]){var c=0;i>0&&a>0&&(c=o[i-1][a-1]),o[i][a]=c+1}else{var u=[0,0],f=u[0],l=u[1];a>0&&(f=o[i][a-1]),i>0&&(l=o[i-1][a]),o[i][a]=Math.max(f,l)}var s=Array.prototype.concat.apply([],o);return Math.max.apply(Math,s)}function oi(t){void 0===t&&(t="");var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),n=location.search.substr(1).match(e);return null!==n?decodeURIComponent(unescape(n[2])):""}function ii(t,e){void 0===t&&(t=""),void 0===e&&(e="");var n={};return t.replace(/\??(\w+)=([^&]*)&?/g,(function(t,e,r){if(void 0!==n[e]){var o=n[e];n[e]=[].concat(o,r)}else n[e]=r})),n[e]||""}function ai(t,e,n){void 0===t&&(t=""),void 0===e&&(e=""),void 0===n&&(n="");var r=new RegExp("([?&])"+e+"=.*?(&|$)","i"),o=-1!==t.indexOf("?")?"&":"?";return t.match(r)?t.replace(r,"$1"+e+"="+n+"$2"):t+o+e+"="+n}function ci(t){void 0===t&&(t="");var e=location.hash.split("?");if(1===e.length)return"";var n=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),r=e[1].match(n);return r?r[2]:""}function ui(t,e){void 0===t&&(t=""),void 0===e&&(e=["hostname"]);var n=document.createElement("a");return n.href=t,e.reduce((function(t,e){return t+=n[e]}),"")}function fi(t){void 0===t&&(t="");var e=t.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===e[0]?e.substr(1):e}function li(t){void 0===t&&(t="");var e=t.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===e[0]?e.substr(1):e}function si(t){void 0===t&&(t="");for(var e=(t=t.replace(/^\s+/,"")).length-1,n=/\s/;n.test(t.charAt(e));)e--;return t.slice(0,e+1)}function di(t){if(void 0===t&&(t=""),!t)return"";var e=new RegExp("\\n","g");return t.replace(e,"<br />")}function pi(t){return JSON.parse(JSON.stringify(t))}function vi(t){void 0===t&&(t="");try{if("object"===ti(JSON.parse(t)))return!0}catch(t){}return!1}function gi(t){void 0===t&&(t=5);for(var e="";t--;)e+=Math.floor(10*Math.random());return e}function hi(t){void 0===t&&(t=3);var e=[Ii(),gi(t||3)];return e[0]+e[1]}function mi(t,e){void 0===t&&(t=0),void 0===e&&(e=0);return(e?(100*t).toFixed(e):String(Math.floor(100*t)))+"%"}function yi(t,e){return void 0===e&&(e=0),parseFloat(t).toFixed(e)}function wi(t){var e=t||window.event;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function bi(t,e){for(var n=t.className.split(/\s+/),r=0;r<n.length;r++)if(n[r]===e)return!0;return!1}function xi(t,e){var n,r=t.className,o="";""!==r&&(o=" "),n=r+o+e,t.className=n}function Si(t,e){var n;n=(n=(n=(n=" "+t.className+" ").replace(/(\s+)/gi," ")).replace(" "+e+" "," ")).replace(/(^\s+)|(\s+$)/g,""),t.className=n}function Ei(t,e,n){var r=null,o=null,i=null,a=[null,0],c=a[0],u=a[1];n||(n={});var f=function(){u=!1===n.leading?0:Ii(),i=null,c=t.apply(r,o),i||(r=o=null)};return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var s=Ii();u||!1!==n.leading||(u=s);var d=e-(s-u);return r=this,o=a,d<=0||d>e?(i&&(clearTimeout(i),i=null),u=s,c=t.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(f,d)),c}}function Oi(t,e,n){var r=null,o=null,i=null,a=null,c=null,u=function u(){var f=Ii()-i;f<e&&f>=0?o=setTimeout(u,e-f):(o=null,n||(c=t.apply(r,a),o||(r=a=null)))};return function(){for(var f=[],l=0;l<arguments.length;l++)f[l]=arguments[l];r=this,a=f,i=Ii();var s=n&&!o;return o||(o=setTimeout(u,e)),s&&(c=t.apply(r,a),r=a=null),c}}function Ti(t){var e=void 0===t?{}:t,n=e.start,r=void 0===n?0:n,o=e.end,i=void 0===o?0:o,a=e.type,c=void 0===a?"d":a;ji(r)||(r=new Date(r).getTime()),ji(i)||(i=new Date(i).getTime());var u=i-r,f=null,l=new Array(4).fill(0),s=l[0],d=(l[1],l[2],l[3]);if(u>=0)switch(s=Math.floor(u/1e3/60/60/24),Math.floor(u/1e3/60/60),Math.floor(u/1e3/60),d=Math.floor(u/1e3),c){case"d":f=s;break;case"text":f=(s=Math.floor(u/1e3/60/60/24))+" 天 "+Math.floor(u/1e3/60/60%24)+" 时 "+Math.floor(u/1e3/60%60)+" 分 "+(d=Math.floor(u/1e3%60))+" 秒";break;default:f=d}return f}function ji(t,e){var n=void 0===e?{}:e,r=n.isNaNAsNumber,o=void 0!==r&&r,i=n.isUnFiniteAsNumber,a=!0;return"number"!=typeof t&&(a=!1),!1!==(void 0!==i&&i)||isFinite(t)||(a=!1),!1===o&&isNaN(t)&&(a=!1),a}function Ai(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=null;return t&&"function"==typeof t&&(r=t.apply(void 0,e)),r}function _i(t,e){void 0===e&&(e=null),t&&sessionStorage.setItem(t,JSON.stringify(e))}function Ri(t){var e=null;if(t){var n=sessionStorage.getItem(t);n&&(e=JSON.parse(n))}return e}function Pi(t,e){void 0===e&&(e=null),t&&localStorage.setItem(t,JSON.stringify(e))}function Mi(t){var e=null;if(t){var n=localStorage.getItem(t);n&&(e=JSON.parse(n))}return e}function ki(t){var e=void 0===t?{}:t,n=e.url,r=void 0===n?"":n,o=e.id,i=void 0===o?"":o,a=null,c=new Promise((function(t,e){var n;a=(n=[t,e])[0],n[1]})),u=function(){Ai(a,!0)},f=document.createElement("link"),l="onload"in f,s=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(f.rel="stylesheet",f.type="text/css",f.href=r,void 0!==i&&(f.id=i),document.getElementsByTagName("head")[0].appendChild(f),s||!l)return setTimeout((function(){p(f,u,0)}),1),c;function d(){f.onload=f.onerror=f.onreadystatechange=null,f=null,u()}function p(t,e,n){var r,o=t.sheet;if((n+=1)>3e5)return r=!0,t=null,void e();if(s)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(t){"NS_ERROR_DOM_SECURITY_ERR"===t.name&&(r=!0)}setTimeout((function(){r?e():p(t,e,n)}),20)}return l?(f.onload=d,f.onerror=function(){d()}):f.onreadystatechange=function(){/loaded|complete/.test(f.readyState)&&d()},c}function Ci(t){var e=void 0===t?{}:t,n=e.url,r=void 0===n?"":n,o=e.id,i=void 0===o?"":o,a=e.callback,c=void 0===a?function(){}:a,u=e.timeout,f=void 0===u?5e3:u,l=e.isDefer,s=void 0!==l&&l,d=null,p=null,v=document.createElement("script"),g=document.getElementsByTagName("script")[0];return v.type="text/javascript",s&&(v.defer="defer"),i&&(v.id=i),v.readyState?v.onreadystatechange=function(){"loaded"!==v.readyState&&"complete"!==v.readyState||(v.onreadystatechange=null,Ai(c),Ai(d,!0))}:v.onload=function(){Ai(c),Ai(d,!0)},v.src=r,g&&g.parentNode.insertBefore(v,g),new Promise((function(t,e){var n;d=(n=[t,e])[0],p=n[1],f&&setTimeout(p.bind(null,"timeout"),f)}))}function Ii(){return Date.now?Date.now():(new Date).getTime()}function Li(t,e,n,r){var o,i,a;n?((a=new Date).setTime(a.getTime()+24*n*60*60*1e3),i="; expires="+a.toGMTString()):i="";var c=location.host;1===c.split(".").length?document.cookie=t+"="+e+i+"; path=/":((o=c.split(".")).shift(),r=r||"."+o.join("."),document.cookie=t+"="+e+i+"; path=/; domain="+r,null!==Ni(t)&&Ni(t)===e||(r=r||"."+c,document.cookie=t+"="+e+i+"; path=/; domain="+r))}function Ni(t){for(var e=t+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(e))return o.substring(e.length,o.length)}return""}function Fi(t){var e,n,r,o,i=(void 0===t?{}:t).camelCase,a=void 0===i||i,c=new Promise((function(t,r){var o;e=(o=[t,r])[0],n=o[1]})),u=window.performance.timing,f=u.navigationStart||u.fetchStart;function l(){try{if(window.performance&&Boolean(window.performance.getEntriesByType))window.performance.getEntriesByType("paint").forEach((function(t,e,n){var i=Math.round(t.startTime);"first-paint"===t.name?r=i:"first-contentful-paint"===t.name&&(o=i)}));else console.error("paint")}catch(t){console.error(t.message)}if(window.performance&&"function"==typeof window.performance.getEntries){var t,i=(window.performance.getEntries()||[])[0]||{},c={os:s(),osVersion:d(),deviceType:p(),network:v(),screenDirection:g(),unloadTime:u.unloadEventEnd-u.unloadEventStart,redirectTime:u.redirectEnd-u.redirectStart,dnsTime:u.domainLookupEnd-u.domainLookupStart,tcpTime:u.connectEnd-u.connectStart,sslTime:h(u.connectEnd,u.secureConnectionStart),responseTime:u.responseStart-u.requestStart,downloadTime:u.responseEnd-u.responseStart,firstPaintTime:r,firstContentfulPaintTime:o,domreadyTime:u.domContentLoadedEventStart-f||0,onloadTime:u.loadEventStart-f||0,whiteTime:u.responseStart-f,renderTime:u.loadEventEnd-f||0,decodedBodySize:i.decodedBodySize||"",encodedBodySize:i.encodedBodySize||""};if(Object.keys(c).forEach((function(t){ji(c[t])&&c[t]<0&&(c[t]=0)})),ji(c.whiteTime)&&c.whiteTime>c.onloadTime&&(c.whiteTime=0),f>0)a||Object.keys(c).forEach((function(e){t||(t={}),t[li(e)]=c[e]})),e(t||c);else n("startTime")}else n("getEntries")}function s(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function d(){var t,e=navigator.userAgent,n=e.indexOf("Android")>-1||e.indexOf("Linux")>-1,r=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return n&&(t=(navigator.userAgent.split(";")[1].match(/\d+\.\d+/g)||[])[0]),r&&(t=(navigator.userAgent.split(";")[1].match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),t}function p(){var t=navigator.userAgent.toLowerCase(),e=t.match(/(ipad)/i)&&"ipad",n=t.match(/iphone os/i)&&"iphone os",r=t.match(/midp/i)&&"midp",o=t.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",i=t.match(/ucweb/i)&&"ucweb",a=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",u=t.match(/windows mobile/i)&&"windows mobile";return e||n||r||o||i||a||c||u?n||r||o||i||a||c||u?"phone":e?"ipad":void 0:"pc"}function v(){var t;if(navigator.connection&&navigator.connection.effectiveType)switch(navigator.connection.effectiveType){case"wifi":t="wifi";break;case"4g":t="4g";break;case"2g":t="2g";break;case"3g":t="3g";break;case"ethernet":t="ethernet";break;case"default":t=void 0}return t}function g(){var t;return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(t="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(t="-")),t}function h(t,e){var n;return e&&(n=t-e),n}return window.performance&&window.performance.timing&&window.performance.timing.loadEventEnd>0?l():window.addEventListener("load",(function(){window.setTimeout((function(){l()}),0)})),c}function Di(t){return Math.random()<t}function $i(){var t=Bi();return!(!("serviceWorker"in navigator&&function(){var t;try{return t=new Function("return async function(){};")(),null!=Object.getPrototypeOf(t).constructor}catch(t){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches))||t.shell)}function Bi(){try{var t=navigator.userAgent.toLowerCase(),e=function(e){return e.test(t)},n=function(e){return t.match(e).toString().replace(/[^0-9|_.]/g,"").replace(/_/g,".")},r="",o="";e(/windows|win32|win64|wow32|wow64/g)?r="windows":e(/macintosh|macintel/g)?r="macos":e(/x11/g)?r="linux":e(/android|adr/g)?r="android":e(/ios|iphone|ipad|ipod|iwatch/g)&&(r="ios",e(/iphone/g)?o="iphone":e(/ipad/g)?o="ipad":e(/iwatch/g)?o="iwatch":e(/ipod/g)&&(o="ipod"));var i="";"windows"===r?e(/windows nt 5.0|windows 2000/g)?i="2000":e(/windows nt 5.1|windows xp/g)?i="xp":e(/windows nt 5.2|windows 2003/g)?i="2003":e(/windows nt 6.0|windows vista/g)?i="vista":e(/windows nt 6.1|windows 7/g)?i="7":e(/windows nt 6.2|windows 8/g)?i="8":e(/windows nt 6.3|windows 8.1/g)?i="8.1":e(/windows nt 10.0|windows 10/g)&&(i="10"):"macos"===r?i=n(/os x [\d._]+/g):"android"===r?i=n(/android [\d._]+/g):"ios"===r&&(i=n(/os [\d._]+/g));var a="";"windows"===r||"macos"===r||"linux"===r?a="desktop":("android"===r||"ios"===r||e(/mobile/g))&&(a="mobile");var c="",u="";e(/applewebkit/g)?(c="webkit",e(/edge/g)?u="edge":e(/opr/g)?u="opera":e(/chrome/g)?u="chrome":e(/safari/g)&&(u="safari")):e(/gecko/g)&&e(/firefox/g)?(c="gecko",u="firefox"):e(/presto/g)?(c="presto",u="opera"):e(/trident|compatible|msie/g)&&(c="trident",u="iexplore");var f="";"webkit"===c?f=n(/applewebkit\/[\d._]+/g):"gecko"===c?f=n(/gecko\/[\d._]+/g):"presto"===c?f=n(/presto\/[\d._]+/g):"trident"===c&&(f=n(/trident\/[\d._]+/g));var l="";"chrome"===u?l=n(/chrome\/[\d._]+/g):"safari"===u?l=n(/version\/[\d._]+/g):"firefox"===u?l=n(/firefox\/[\d._]+/g):"opera"===u?l=n(/opr\/[\d._]+/g):"iexplore"===u?l=n(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===u&&(l=n(/edge\/[\d._]+/g));var s="",d="";return e(/micromessenger/g)?(s="wechat",d=n(/micromessenger\/[\d._]+/g)):e(/qqbrowser/g)?(s="qq_browser",d=n(/qqbrowser\/[\d._]+/g)):e(/\sqq/g)?s="qq_app":e(/ucbrowser/g)?(s="uc",d=n(/ucbrowser\/[\d._]+/g)):e(/qihu 360se/g)?s="360":e(/2345explorer/g)?(s="2345",d=n(/2345explorer\/[\d._]+/g)):e(/metasr/g)?s="sougou":e(/lbbrowser/g)?s="liebao":e(/maxthon/g)?(s="maxthon",d=n(/maxthon\/[\d._]+/g)):e(/biliapp/g)&&(s="bilibili"),Object.assign({engine:c,engineVs:f,platform:a,supporter:u,supporterVs:l,system:r,systemVs:i},{shell:s,shellVs:d,appleType:o})}catch(t){return{}}}function Ui(t){return void 0===t&&(t=""),t.replace(/<\/?.+?>/g,"").replace(/[\r\n]/g,"")}function qi(t,e,n){if(void 0===t&&(t=""),void 0===e&&(e=t.length),void 0===n&&(n=!1),""!=t&&t){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",c=t.replace(i,"**").length,u=0;u<c&&(null!=(a=t.charAt(u).toString()).match(i)?r+=2:r++,!(r>e));u++)o+=a;return n&&c>e&&(o+="..."),o}return""}function Vi(t){var e=(void 0===t?{}:t).timeout,n=void 0===e?90:e,r=function(){},o=function(){},i=new Promise((function(t,e){r=t,o=e}));return"complete"===document.readyState?r("complete"):window.addEventListener("load",(function(){return r("load")})),setTimeout((function(){return o("timeout")}),1e3*n),i}function Gi(t){var e=void 0===t?{}:t,n=e.inlineStyle,r=void 0===n?"":n,o=e.id,i=void 0===o?"":o;if(!r)return!1;var a=document.createDocumentFragment(),c=null,u="",f=document.createElement("style");return i?(u=""+i,(c=document.getElementById(u))?c.innerHTML=r:(f.setAttribute("id",i),f.innerHTML=r,a.appendChild(f),document.head.appendChild(a))):(f.innerHTML=r,a.appendChild(f),document.head.appendChild(a)),!0}function Wi(t){var e=(void 0===t?{}:t).prefix,n=void 0===e?"":e,r=Object.create(null);return["log","info","warn","error"].forEach((function(t){r[t]=function(){for(var e,r,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n?(e=console)[t].apply(e,ei([n],o)):(r=console)[t].apply(r,o)}})),r}export{xi as addClass,Gi as addInlineStyle,ri as calLongestCommonSubsequence,ni as calLongestCommonSubstring,li as camelCase2Underscore,fi as camelCaseToKebabCase,wi as cancelBubble,Ui as clearHtml,qi as cutCHSString,Oi as debounce,pi as deepCopyObject,Ai as doFn,yi as floatFixed,mi as floatToPercent,Ti as friendlyInterval,Wi as genCustomConsole,gi as generateRndNum,hi as generateUniqueNum,Bi as getBrowserInfo,Ni as getCookie,ui as getDomain,ci as getHashQueryParam,Mi as getLocalStorage,Fi as getPerformance,oi as getQueryParam,Ri as getSessionStorage,ii as getUrlParam,bi as hasClass,Di as inRate,vi as isJsonString,ji as isNumber,$i as isSafePWAEnv,ki as loadCSS,Ci as loadScript,Ii as mNow,si as mTrim,di as newLine,Si as removeClass,Li as setCookie,Pi as setLocalStorage,_i as setSessionStorage,Ei as throttle,ai as updateQueryParam,Vi as windowLoaded};