UNPKG

61.1 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
3 typeof define === 'function' && define.amd ? define(['jquery'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery));
5}(this, (function ($) { 'use strict';
6
7 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
9 var $__default = /*#__PURE__*/_interopDefaultLegacy($);
10
11 function _classCallCheck(instance, Constructor) {
12 if (!(instance instanceof Constructor)) {
13 throw new TypeError("Cannot call a class as a function");
14 }
15 }
16
17 function _defineProperties(target, props) {
18 for (var i = 0; i < props.length; i++) {
19 var descriptor = props[i];
20 descriptor.enumerable = descriptor.enumerable || false;
21 descriptor.configurable = true;
22 if ("value" in descriptor) descriptor.writable = true;
23 Object.defineProperty(target, descriptor.key, descriptor);
24 }
25 }
26
27 function _createClass(Constructor, protoProps, staticProps) {
28 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
29 if (staticProps) _defineProperties(Constructor, staticProps);
30 return Constructor;
31 }
32
33 function _inherits(subClass, superClass) {
34 if (typeof superClass !== "function" && superClass !== null) {
35 throw new TypeError("Super expression must either be null or a function");
36 }
37
38 subClass.prototype = Object.create(superClass && superClass.prototype, {
39 constructor: {
40 value: subClass,
41 writable: true,
42 configurable: true
43 }
44 });
45 if (superClass) _setPrototypeOf(subClass, superClass);
46 }
47
48 function _getPrototypeOf(o) {
49 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
50 return o.__proto__ || Object.getPrototypeOf(o);
51 };
52 return _getPrototypeOf(o);
53 }
54
55 function _setPrototypeOf(o, p) {
56 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
57 o.__proto__ = p;
58 return o;
59 };
60
61 return _setPrototypeOf(o, p);
62 }
63
64 function _isNativeReflectConstruct() {
65 if (typeof Reflect === "undefined" || !Reflect.construct) return false;
66 if (Reflect.construct.sham) return false;
67 if (typeof Proxy === "function") return true;
68
69 try {
70 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
71 return true;
72 } catch (e) {
73 return false;
74 }
75 }
76
77 function _assertThisInitialized(self) {
78 if (self === void 0) {
79 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
80 }
81
82 return self;
83 }
84
85 function _possibleConstructorReturn(self, call) {
86 if (call && (typeof call === "object" || typeof call === "function")) {
87 return call;
88 }
89
90 return _assertThisInitialized(self);
91 }
92
93 function _createSuper(Derived) {
94 var hasNativeReflectConstruct = _isNativeReflectConstruct();
95
96 return function _createSuperInternal() {
97 var Super = _getPrototypeOf(Derived),
98 result;
99
100 if (hasNativeReflectConstruct) {
101 var NewTarget = _getPrototypeOf(this).constructor;
102
103 result = Reflect.construct(Super, arguments, NewTarget);
104 } else {
105 result = Super.apply(this, arguments);
106 }
107
108 return _possibleConstructorReturn(this, result);
109 };
110 }
111
112 function _superPropBase(object, property) {
113 while (!Object.prototype.hasOwnProperty.call(object, property)) {
114 object = _getPrototypeOf(object);
115 if (object === null) break;
116 }
117
118 return object;
119 }
120
121 function _get(target, property, receiver) {
122 if (typeof Reflect !== "undefined" && Reflect.get) {
123 _get = Reflect.get;
124 } else {
125 _get = function _get(target, property, receiver) {
126 var base = _superPropBase(target, property);
127
128 if (!base) return;
129 var desc = Object.getOwnPropertyDescriptor(base, property);
130
131 if (desc.get) {
132 return desc.get.call(receiver);
133 }
134
135 return desc.value;
136 };
137 }
138
139 return _get(target, property, receiver || target);
140 }
141
142 function _slicedToArray(arr, i) {
143 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
144 }
145
146 function _arrayWithHoles(arr) {
147 if (Array.isArray(arr)) return arr;
148 }
149
150 function _iterableToArrayLimit(arr, i) {
151 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
152 var _arr = [];
153 var _n = true;
154 var _d = false;
155 var _e = undefined;
156
157 try {
158 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
159 _arr.push(_s.value);
160
161 if (i && _arr.length === i) break;
162 }
163 } catch (err) {
164 _d = true;
165 _e = err;
166 } finally {
167 try {
168 if (!_n && _i["return"] != null) _i["return"]();
169 } finally {
170 if (_d) throw _e;
171 }
172 }
173
174 return _arr;
175 }
176
177 function _unsupportedIterableToArray(o, minLen) {
178 if (!o) return;
179 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
180 var n = Object.prototype.toString.call(o).slice(8, -1);
181 if (n === "Object" && o.constructor) n = o.constructor.name;
182 if (n === "Map" || n === "Set") return Array.from(o);
183 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
184 }
185
186 function _arrayLikeToArray(arr, len) {
187 if (len == null || len > arr.length) len = arr.length;
188
189 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
190
191 return arr2;
192 }
193
194 function _nonIterableRest() {
195 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
196 }
197
198 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
199
200 function createCommonjsModule(fn, module) {
201 return module = { exports: {} }, fn(module, module.exports), module.exports;
202 }
203
204 var check = function (it) {
205 return it && it.Math == Math && it;
206 };
207
208 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
209 var global_1 =
210 // eslint-disable-next-line es/no-global-this -- safe
211 check(typeof globalThis == 'object' && globalThis) ||
212 check(typeof window == 'object' && window) ||
213 // eslint-disable-next-line no-restricted-globals -- safe
214 check(typeof self == 'object' && self) ||
215 check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
216 // eslint-disable-next-line no-new-func -- fallback
217 (function () { return this; })() || Function('return this')();
218
219 var fails = function (exec) {
220 try {
221 return !!exec();
222 } catch (error) {
223 return true;
224 }
225 };
226
227 // Detect IE8's incomplete defineProperty implementation
228 var descriptors = !fails(function () {
229 // eslint-disable-next-line es/no-object-defineproperty -- required for testing
230 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
231 });
232
233 var $propertyIsEnumerable = {}.propertyIsEnumerable;
234 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
235 var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
236
237 // Nashorn ~ JDK8 bug
238 var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
239
240 // `Object.prototype.propertyIsEnumerable` method implementation
241 // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
242 var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
243 var descriptor = getOwnPropertyDescriptor$1(this, V);
244 return !!descriptor && descriptor.enumerable;
245 } : $propertyIsEnumerable;
246
247 var objectPropertyIsEnumerable = {
248 f: f$4
249 };
250
251 var createPropertyDescriptor = function (bitmap, value) {
252 return {
253 enumerable: !(bitmap & 1),
254 configurable: !(bitmap & 2),
255 writable: !(bitmap & 4),
256 value: value
257 };
258 };
259
260 var toString = {}.toString;
261
262 var classofRaw = function (it) {
263 return toString.call(it).slice(8, -1);
264 };
265
266 var split = ''.split;
267
268 // fallback for non-array-like ES3 and non-enumerable old V8 strings
269 var indexedObject = fails(function () {
270 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
271 // eslint-disable-next-line no-prototype-builtins -- safe
272 return !Object('z').propertyIsEnumerable(0);
273 }) ? function (it) {
274 return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
275 } : Object;
276
277 // `RequireObjectCoercible` abstract operation
278 // https://tc39.es/ecma262/#sec-requireobjectcoercible
279 var requireObjectCoercible = function (it) {
280 if (it == undefined) throw TypeError("Can't call method on " + it);
281 return it;
282 };
283
284 // toObject with fallback for non-array-like ES3 strings
285
286
287
288 var toIndexedObject = function (it) {
289 return indexedObject(requireObjectCoercible(it));
290 };
291
292 var isObject = function (it) {
293 return typeof it === 'object' ? it !== null : typeof it === 'function';
294 };
295
296 // `ToPrimitive` abstract operation
297 // https://tc39.es/ecma262/#sec-toprimitive
298 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
299 // and the second argument - flag - preferred type is a string
300 var toPrimitive = function (input, PREFERRED_STRING) {
301 if (!isObject(input)) return input;
302 var fn, val;
303 if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
304 if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
305 if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
306 throw TypeError("Can't convert object to primitive value");
307 };
308
309 var hasOwnProperty = {}.hasOwnProperty;
310
311 var has$1 = function (it, key) {
312 return hasOwnProperty.call(it, key);
313 };
314
315 var document = global_1.document;
316 // typeof document.createElement is 'object' in old IE
317 var EXISTS = isObject(document) && isObject(document.createElement);
318
319 var documentCreateElement = function (it) {
320 return EXISTS ? document.createElement(it) : {};
321 };
322
323 // Thank's IE8 for his funny defineProperty
324 var ie8DomDefine = !descriptors && !fails(function () {
325 // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
326 return Object.defineProperty(documentCreateElement('div'), 'a', {
327 get: function () { return 7; }
328 }).a != 7;
329 });
330
331 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
332 var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
333
334 // `Object.getOwnPropertyDescriptor` method
335 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
336 var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
337 O = toIndexedObject(O);
338 P = toPrimitive(P, true);
339 if (ie8DomDefine) try {
340 return $getOwnPropertyDescriptor(O, P);
341 } catch (error) { /* empty */ }
342 if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
343 };
344
345 var objectGetOwnPropertyDescriptor = {
346 f: f$3
347 };
348
349 var anObject = function (it) {
350 if (!isObject(it)) {
351 throw TypeError(String(it) + ' is not an object');
352 } return it;
353 };
354
355 // eslint-disable-next-line es/no-object-defineproperty -- safe
356 var $defineProperty = Object.defineProperty;
357
358 // `Object.defineProperty` method
359 // https://tc39.es/ecma262/#sec-object.defineproperty
360 var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
361 anObject(O);
362 P = toPrimitive(P, true);
363 anObject(Attributes);
364 if (ie8DomDefine) try {
365 return $defineProperty(O, P, Attributes);
366 } catch (error) { /* empty */ }
367 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
368 if ('value' in Attributes) O[P] = Attributes.value;
369 return O;
370 };
371
372 var objectDefineProperty = {
373 f: f$2
374 };
375
376 var createNonEnumerableProperty = descriptors ? function (object, key, value) {
377 return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
378 } : function (object, key, value) {
379 object[key] = value;
380 return object;
381 };
382
383 var setGlobal = function (key, value) {
384 try {
385 createNonEnumerableProperty(global_1, key, value);
386 } catch (error) {
387 global_1[key] = value;
388 } return value;
389 };
390
391 var SHARED = '__core-js_shared__';
392 var store$1 = global_1[SHARED] || setGlobal(SHARED, {});
393
394 var sharedStore = store$1;
395
396 var functionToString = Function.toString;
397
398 // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
399 if (typeof sharedStore.inspectSource != 'function') {
400 sharedStore.inspectSource = function (it) {
401 return functionToString.call(it);
402 };
403 }
404
405 var inspectSource = sharedStore.inspectSource;
406
407 var WeakMap$1 = global_1.WeakMap;
408
409 var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));
410
411 var shared = createCommonjsModule(function (module) {
412 (module.exports = function (key, value) {
413 return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
414 })('versions', []).push({
415 version: '3.10.1',
416 mode: 'global',
417 copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
418 });
419 });
420
421 var id = 0;
422 var postfix = Math.random();
423
424 var uid = function (key) {
425 return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
426 };
427
428 var keys$1 = shared('keys');
429
430 var sharedKey = function (key) {
431 return keys$1[key] || (keys$1[key] = uid(key));
432 };
433
434 var hiddenKeys$1 = {};
435
436 var WeakMap = global_1.WeakMap;
437 var set, get, has;
438
439 var enforce = function (it) {
440 return has(it) ? get(it) : set(it, {});
441 };
442
443 var getterFor = function (TYPE) {
444 return function (it) {
445 var state;
446 if (!isObject(it) || (state = get(it)).type !== TYPE) {
447 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
448 } return state;
449 };
450 };
451
452 if (nativeWeakMap) {
453 var store = sharedStore.state || (sharedStore.state = new WeakMap());
454 var wmget = store.get;
455 var wmhas = store.has;
456 var wmset = store.set;
457 set = function (it, metadata) {
458 metadata.facade = it;
459 wmset.call(store, it, metadata);
460 return metadata;
461 };
462 get = function (it) {
463 return wmget.call(store, it) || {};
464 };
465 has = function (it) {
466 return wmhas.call(store, it);
467 };
468 } else {
469 var STATE = sharedKey('state');
470 hiddenKeys$1[STATE] = true;
471 set = function (it, metadata) {
472 metadata.facade = it;
473 createNonEnumerableProperty(it, STATE, metadata);
474 return metadata;
475 };
476 get = function (it) {
477 return has$1(it, STATE) ? it[STATE] : {};
478 };
479 has = function (it) {
480 return has$1(it, STATE);
481 };
482 }
483
484 var internalState = {
485 set: set,
486 get: get,
487 has: has,
488 enforce: enforce,
489 getterFor: getterFor
490 };
491
492 var redefine = createCommonjsModule(function (module) {
493 var getInternalState = internalState.get;
494 var enforceInternalState = internalState.enforce;
495 var TEMPLATE = String(String).split('String');
496
497 (module.exports = function (O, key, value, options) {
498 var unsafe = options ? !!options.unsafe : false;
499 var simple = options ? !!options.enumerable : false;
500 var noTargetGet = options ? !!options.noTargetGet : false;
501 var state;
502 if (typeof value == 'function') {
503 if (typeof key == 'string' && !has$1(value, 'name')) {
504 createNonEnumerableProperty(value, 'name', key);
505 }
506 state = enforceInternalState(value);
507 if (!state.source) {
508 state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
509 }
510 }
511 if (O === global_1) {
512 if (simple) O[key] = value;
513 else setGlobal(key, value);
514 return;
515 } else if (!unsafe) {
516 delete O[key];
517 } else if (!noTargetGet && O[key]) {
518 simple = true;
519 }
520 if (simple) O[key] = value;
521 else createNonEnumerableProperty(O, key, value);
522 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
523 })(Function.prototype, 'toString', function toString() {
524 return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
525 });
526 });
527
528 var path = global_1;
529
530 var aFunction = function (variable) {
531 return typeof variable == 'function' ? variable : undefined;
532 };
533
534 var getBuiltIn = function (namespace, method) {
535 return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
536 : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
537 };
538
539 var ceil = Math.ceil;
540 var floor$1 = Math.floor;
541
542 // `ToInteger` abstract operation
543 // https://tc39.es/ecma262/#sec-tointeger
544 var toInteger = function (argument) {
545 return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$1 : ceil)(argument);
546 };
547
548 var min$2 = Math.min;
549
550 // `ToLength` abstract operation
551 // https://tc39.es/ecma262/#sec-tolength
552 var toLength = function (argument) {
553 return argument > 0 ? min$2(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
554 };
555
556 var max$1 = Math.max;
557 var min$1 = Math.min;
558
559 // Helper for a popular repeating case of the spec:
560 // Let integer be ? ToInteger(index).
561 // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
562 var toAbsoluteIndex = function (index, length) {
563 var integer = toInteger(index);
564 return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
565 };
566
567 // `Array.prototype.{ indexOf, includes }` methods implementation
568 var createMethod$2 = function (IS_INCLUDES) {
569 return function ($this, el, fromIndex) {
570 var O = toIndexedObject($this);
571 var length = toLength(O.length);
572 var index = toAbsoluteIndex(fromIndex, length);
573 var value;
574 // Array#includes uses SameValueZero equality algorithm
575 // eslint-disable-next-line no-self-compare -- NaN check
576 if (IS_INCLUDES && el != el) while (length > index) {
577 value = O[index++];
578 // eslint-disable-next-line no-self-compare -- NaN check
579 if (value != value) return true;
580 // Array#indexOf ignores holes, Array#includes - not
581 } else for (;length > index; index++) {
582 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
583 } return !IS_INCLUDES && -1;
584 };
585 };
586
587 var arrayIncludes = {
588 // `Array.prototype.includes` method
589 // https://tc39.es/ecma262/#sec-array.prototype.includes
590 includes: createMethod$2(true),
591 // `Array.prototype.indexOf` method
592 // https://tc39.es/ecma262/#sec-array.prototype.indexof
593 indexOf: createMethod$2(false)
594 };
595
596 var indexOf = arrayIncludes.indexOf;
597
598
599 var objectKeysInternal = function (object, names) {
600 var O = toIndexedObject(object);
601 var i = 0;
602 var result = [];
603 var key;
604 for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);
605 // Don't enum bug & hidden keys
606 while (names.length > i) if (has$1(O, key = names[i++])) {
607 ~indexOf(result, key) || result.push(key);
608 }
609 return result;
610 };
611
612 // IE8- don't enum bug keys
613 var enumBugKeys = [
614 'constructor',
615 'hasOwnProperty',
616 'isPrototypeOf',
617 'propertyIsEnumerable',
618 'toLocaleString',
619 'toString',
620 'valueOf'
621 ];
622
623 var hiddenKeys = enumBugKeys.concat('length', 'prototype');
624
625 // `Object.getOwnPropertyNames` method
626 // https://tc39.es/ecma262/#sec-object.getownpropertynames
627 // eslint-disable-next-line es/no-object-getownpropertynames -- safe
628 var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
629 return objectKeysInternal(O, hiddenKeys);
630 };
631
632 var objectGetOwnPropertyNames = {
633 f: f$1
634 };
635
636 // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
637 var f = Object.getOwnPropertySymbols;
638
639 var objectGetOwnPropertySymbols = {
640 f: f
641 };
642
643 // all object keys, includes non-enumerable and symbols
644 var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
645 var keys = objectGetOwnPropertyNames.f(anObject(it));
646 var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
647 return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
648 };
649
650 var copyConstructorProperties = function (target, source) {
651 var keys = ownKeys(source);
652 var defineProperty = objectDefineProperty.f;
653 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
654 for (var i = 0; i < keys.length; i++) {
655 var key = keys[i];
656 if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
657 }
658 };
659
660 var replacement = /#|\.prototype\./;
661
662 var isForced = function (feature, detection) {
663 var value = data[normalize(feature)];
664 return value == POLYFILL ? true
665 : value == NATIVE ? false
666 : typeof detection == 'function' ? fails(detection)
667 : !!detection;
668 };
669
670 var normalize = isForced.normalize = function (string) {
671 return String(string).replace(replacement, '.').toLowerCase();
672 };
673
674 var data = isForced.data = {};
675 var NATIVE = isForced.NATIVE = 'N';
676 var POLYFILL = isForced.POLYFILL = 'P';
677
678 var isForced_1 = isForced;
679
680 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
681
682
683
684
685
686
687 /*
688 options.target - name of the target object
689 options.global - target is the global object
690 options.stat - export as static methods of target
691 options.proto - export as prototype methods of target
692 options.real - real prototype method for the `pure` version
693 options.forced - export even if the native feature is available
694 options.bind - bind methods to the target, required for the `pure` version
695 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
696 options.unsafe - use the simple assignment of property instead of delete + defineProperty
697 options.sham - add a flag to not completely full polyfills
698 options.enumerable - export as enumerable property
699 options.noTargetGet - prevent calling a getter on target
700 */
701 var _export = function (options, source) {
702 var TARGET = options.target;
703 var GLOBAL = options.global;
704 var STATIC = options.stat;
705 var FORCED, target, key, targetProperty, sourceProperty, descriptor;
706 if (GLOBAL) {
707 target = global_1;
708 } else if (STATIC) {
709 target = global_1[TARGET] || setGlobal(TARGET, {});
710 } else {
711 target = (global_1[TARGET] || {}).prototype;
712 }
713 if (target) for (key in source) {
714 sourceProperty = source[key];
715 if (options.noTargetGet) {
716 descriptor = getOwnPropertyDescriptor(target, key);
717 targetProperty = descriptor && descriptor.value;
718 } else targetProperty = target[key];
719 FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
720 // contained in target
721 if (!FORCED && targetProperty !== undefined) {
722 if (typeof sourceProperty === typeof targetProperty) continue;
723 copyConstructorProperties(sourceProperty, targetProperty);
724 }
725 // add a flag to not completely full polyfills
726 if (options.sham || (targetProperty && targetProperty.sham)) {
727 createNonEnumerableProperty(sourceProperty, 'sham', true);
728 }
729 // extend global
730 redefine(target, key, sourceProperty, options);
731 }
732 };
733
734 // `RegExp.prototype.flags` getter implementation
735 // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
736 var regexpFlags = function () {
737 var that = anObject(this);
738 var result = '';
739 if (that.global) result += 'g';
740 if (that.ignoreCase) result += 'i';
741 if (that.multiline) result += 'm';
742 if (that.dotAll) result += 's';
743 if (that.unicode) result += 'u';
744 if (that.sticky) result += 'y';
745 return result;
746 };
747
748 // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
749 // so we use an intermediate function.
750 function RE(s, f) {
751 return RegExp(s, f);
752 }
753
754 var UNSUPPORTED_Y$2 = fails(function () {
755 // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
756 var re = RE('a', 'y');
757 re.lastIndex = 2;
758 return re.exec('abcd') != null;
759 });
760
761 var BROKEN_CARET = fails(function () {
762 // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
763 var re = RE('^r', 'gy');
764 re.lastIndex = 2;
765 return re.exec('str') != null;
766 });
767
768 var regexpStickyHelpers = {
769 UNSUPPORTED_Y: UNSUPPORTED_Y$2,
770 BROKEN_CARET: BROKEN_CARET
771 };
772
773 var nativeExec = RegExp.prototype.exec;
774 var nativeReplace = shared('native-string-replace', String.prototype.replace);
775
776 var patchedExec = nativeExec;
777
778 var UPDATES_LAST_INDEX_WRONG = (function () {
779 var re1 = /a/;
780 var re2 = /b*/g;
781 nativeExec.call(re1, 'a');
782 nativeExec.call(re2, 'a');
783 return re1.lastIndex !== 0 || re2.lastIndex !== 0;
784 })();
785
786 var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
787
788 // nonparticipating capturing group, copied from es5-shim's String#split patch.
789 // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
790 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
791
792 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
793
794 if (PATCH) {
795 patchedExec = function exec(str) {
796 var re = this;
797 var lastIndex, reCopy, match, i;
798 var sticky = UNSUPPORTED_Y$1 && re.sticky;
799 var flags = regexpFlags.call(re);
800 var source = re.source;
801 var charsAdded = 0;
802 var strCopy = str;
803
804 if (sticky) {
805 flags = flags.replace('y', '');
806 if (flags.indexOf('g') === -1) {
807 flags += 'g';
808 }
809
810 strCopy = String(str).slice(re.lastIndex);
811 // Support anchored sticky behavior.
812 if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
813 source = '(?: ' + source + ')';
814 strCopy = ' ' + strCopy;
815 charsAdded++;
816 }
817 // ^(? + rx + ) is needed, in combination with some str slicing, to
818 // simulate the 'y' flag.
819 reCopy = new RegExp('^(?:' + source + ')', flags);
820 }
821
822 if (NPCG_INCLUDED) {
823 reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
824 }
825 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
826
827 match = nativeExec.call(sticky ? reCopy : re, strCopy);
828
829 if (sticky) {
830 if (match) {
831 match.input = match.input.slice(charsAdded);
832 match[0] = match[0].slice(charsAdded);
833 match.index = re.lastIndex;
834 re.lastIndex += match[0].length;
835 } else re.lastIndex = 0;
836 } else if (UPDATES_LAST_INDEX_WRONG && match) {
837 re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
838 }
839 if (NPCG_INCLUDED && match && match.length > 1) {
840 // Fix browsers whose `exec` methods don't consistently return `undefined`
841 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
842 nativeReplace.call(match[0], reCopy, function () {
843 for (i = 1; i < arguments.length - 2; i++) {
844 if (arguments[i] === undefined) match[i] = undefined;
845 }
846 });
847 }
848
849 return match;
850 };
851 }
852
853 var regexpExec = patchedExec;
854
855 // `RegExp.prototype.exec` method
856 // https://tc39.es/ecma262/#sec-regexp.prototype.exec
857 _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
858 exec: regexpExec
859 });
860
861 var engineIsNode = classofRaw(global_1.process) == 'process';
862
863 var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
864
865 var process = global_1.process;
866 var versions = process && process.versions;
867 var v8 = versions && versions.v8;
868 var match, version;
869
870 if (v8) {
871 match = v8.split('.');
872 version = match[0] + match[1];
873 } else if (engineUserAgent) {
874 match = engineUserAgent.match(/Edge\/(\d+)/);
875 if (!match || match[1] >= 74) {
876 match = engineUserAgent.match(/Chrome\/(\d+)/);
877 if (match) version = match[1];
878 }
879 }
880
881 var engineV8Version = version && +version;
882
883 // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
884 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
885 // eslint-disable-next-line es/no-symbol -- required for testing
886 return !Symbol.sham &&
887 // Chrome 38 Symbol has incorrect toString conversion
888 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
889 (engineIsNode ? engineV8Version === 38 : engineV8Version > 37 && engineV8Version < 41);
890 });
891
892 /* eslint-disable es/no-symbol -- required for testing */
893
894
895 var useSymbolAsUid = nativeSymbol
896 && !Symbol.sham
897 && typeof Symbol.iterator == 'symbol';
898
899 var WellKnownSymbolsStore = shared('wks');
900 var Symbol$1 = global_1.Symbol;
901 var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
902
903 var wellKnownSymbol = function (name) {
904 if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
905 if (nativeSymbol && has$1(Symbol$1, name)) {
906 WellKnownSymbolsStore[name] = Symbol$1[name];
907 } else {
908 WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
909 }
910 } return WellKnownSymbolsStore[name];
911 };
912
913 // TODO: Remove from `core-js@4` since it's moved to entry points
914
915
916
917
918
919
920 var SPECIES$3 = wellKnownSymbol('species');
921
922 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
923 // #replace needs built-in support for named groups.
924 // #match works fine because it just return the exec results, even if it has
925 // a "grops" property.
926 var re = /./;
927 re.exec = function () {
928 var result = [];
929 result.groups = { a: '7' };
930 return result;
931 };
932 return ''.replace(re, '$<a>') !== '7';
933 });
934
935 // IE <= 11 replaces $0 with the whole match, as if it was $&
936 // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
937 var REPLACE_KEEPS_$0 = (function () {
938 // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
939 return 'a'.replace(/./, '$0') === '$0';
940 })();
941
942 var REPLACE = wellKnownSymbol('replace');
943 // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
944 var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
945 if (/./[REPLACE]) {
946 return /./[REPLACE]('a', '$0') === '';
947 }
948 return false;
949 })();
950
951 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
952 // Weex JS has frozen built-in prototypes, so use try / catch wrapper
953 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
954 // eslint-disable-next-line regexp/no-empty-group -- required for testing
955 var re = /(?:)/;
956 var originalExec = re.exec;
957 re.exec = function () { return originalExec.apply(this, arguments); };
958 var result = 'ab'.split(re);
959 return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
960 });
961
962 var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
963 var SYMBOL = wellKnownSymbol(KEY);
964
965 var DELEGATES_TO_SYMBOL = !fails(function () {
966 // String methods call symbol-named RegEp methods
967 var O = {};
968 O[SYMBOL] = function () { return 7; };
969 return ''[KEY](O) != 7;
970 });
971
972 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
973 // Symbol-named RegExp methods call .exec
974 var execCalled = false;
975 var re = /a/;
976
977 if (KEY === 'split') {
978 // We can't use real regex here since it causes deoptimization
979 // and serious performance degradation in V8
980 // https://github.com/zloirock/core-js/issues/306
981 re = {};
982 // RegExp[@@split] doesn't call the regex's exec method, but first creates
983 // a new one. We need to return the patched regex when creating the new one.
984 re.constructor = {};
985 re.constructor[SPECIES$3] = function () { return re; };
986 re.flags = '';
987 re[SYMBOL] = /./[SYMBOL];
988 }
989
990 re.exec = function () { execCalled = true; return null; };
991
992 re[SYMBOL]('');
993 return !execCalled;
994 });
995
996 if (
997 !DELEGATES_TO_SYMBOL ||
998 !DELEGATES_TO_EXEC ||
999 (KEY === 'replace' && !(
1000 REPLACE_SUPPORTS_NAMED_GROUPS &&
1001 REPLACE_KEEPS_$0 &&
1002 !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
1003 )) ||
1004 (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
1005 ) {
1006 var nativeRegExpMethod = /./[SYMBOL];
1007 var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1008 if (regexp.exec === RegExp.prototype.exec) {
1009 if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1010 // The native String method already delegates to @@method (this
1011 // polyfilled function), leasing to infinite recursion.
1012 // We avoid it by directly calling the native @@method method.
1013 return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
1014 }
1015 return { done: true, value: nativeMethod.call(str, regexp, arg2) };
1016 }
1017 return { done: false };
1018 }, {
1019 REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
1020 REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
1021 });
1022 var stringMethod = methods[0];
1023 var regexMethod = methods[1];
1024
1025 redefine(String.prototype, KEY, stringMethod);
1026 redefine(RegExp.prototype, SYMBOL, length == 2
1027 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
1028 // 21.2.5.11 RegExp.prototype[@@split](string, limit)
1029 ? function (string, arg) { return regexMethod.call(string, this, arg); }
1030 // 21.2.5.6 RegExp.prototype[@@match](string)
1031 // 21.2.5.9 RegExp.prototype[@@search](string)
1032 : function (string) { return regexMethod.call(string, this); }
1033 );
1034 }
1035
1036 if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
1037 };
1038
1039 // `SameValue` abstract operation
1040 // https://tc39.es/ecma262/#sec-samevalue
1041 // eslint-disable-next-line es/no-object-is -- safe
1042 var sameValue = Object.is || function is(x, y) {
1043 // eslint-disable-next-line no-self-compare -- NaN check
1044 return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
1045 };
1046
1047 // `RegExpExec` abstract operation
1048 // https://tc39.es/ecma262/#sec-regexpexec
1049 var regexpExecAbstract = function (R, S) {
1050 var exec = R.exec;
1051 if (typeof exec === 'function') {
1052 var result = exec.call(R, S);
1053 if (typeof result !== 'object') {
1054 throw TypeError('RegExp exec method returned something other than an Object or null');
1055 }
1056 return result;
1057 }
1058
1059 if (classofRaw(R) !== 'RegExp') {
1060 throw TypeError('RegExp#exec called on incompatible receiver');
1061 }
1062
1063 return regexpExec.call(R, S);
1064 };
1065
1066 // @@search logic
1067 fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
1068 return [
1069 // `String.prototype.search` method
1070 // https://tc39.es/ecma262/#sec-string.prototype.search
1071 function search(regexp) {
1072 var O = requireObjectCoercible(this);
1073 var searcher = regexp == undefined ? undefined : regexp[SEARCH];
1074 return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
1075 },
1076 // `RegExp.prototype[@@search]` method
1077 // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
1078 function (regexp) {
1079 var res = maybeCallNative(nativeSearch, regexp, this);
1080 if (res.done) return res.value;
1081
1082 var rx = anObject(regexp);
1083 var S = String(this);
1084
1085 var previousLastIndex = rx.lastIndex;
1086 if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
1087 var result = regexpExecAbstract(rx, S);
1088 if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
1089 return result === null ? -1 : result.index;
1090 }
1091 ];
1092 });
1093
1094 var aPossiblePrototype = function (it) {
1095 if (!isObject(it) && it !== null) {
1096 throw TypeError("Can't set " + String(it) + ' as a prototype');
1097 } return it;
1098 };
1099
1100 /* eslint-disable no-proto -- safe */
1101
1102
1103
1104 // `Object.setPrototypeOf` method
1105 // https://tc39.es/ecma262/#sec-object.setprototypeof
1106 // Works with __proto__ only. Old v8 can't work with null proto objects.
1107 // eslint-disable-next-line es/no-object-setprototypeof -- safe
1108 var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1109 var CORRECT_SETTER = false;
1110 var test = {};
1111 var setter;
1112 try {
1113 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1114 setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
1115 setter.call(test, []);
1116 CORRECT_SETTER = test instanceof Array;
1117 } catch (error) { /* empty */ }
1118 return function setPrototypeOf(O, proto) {
1119 anObject(O);
1120 aPossiblePrototype(proto);
1121 if (CORRECT_SETTER) setter.call(O, proto);
1122 else O.__proto__ = proto;
1123 return O;
1124 };
1125 }() : undefined);
1126
1127 // makes subclassing work correct for wrapped built-ins
1128 var inheritIfRequired = function ($this, dummy, Wrapper) {
1129 var NewTarget, NewTargetPrototype;
1130 if (
1131 // it can work only with native `setPrototypeOf`
1132 objectSetPrototypeOf &&
1133 // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
1134 typeof (NewTarget = dummy.constructor) == 'function' &&
1135 NewTarget !== Wrapper &&
1136 isObject(NewTargetPrototype = NewTarget.prototype) &&
1137 NewTargetPrototype !== Wrapper.prototype
1138 ) objectSetPrototypeOf($this, NewTargetPrototype);
1139 return $this;
1140 };
1141
1142 var MATCH$1 = wellKnownSymbol('match');
1143
1144 // `IsRegExp` abstract operation
1145 // https://tc39.es/ecma262/#sec-isregexp
1146 var isRegexp = function (it) {
1147 var isRegExp;
1148 return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
1149 };
1150
1151 var SPECIES$2 = wellKnownSymbol('species');
1152
1153 var setSpecies = function (CONSTRUCTOR_NAME) {
1154 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
1155 var defineProperty = objectDefineProperty.f;
1156
1157 if (descriptors && Constructor && !Constructor[SPECIES$2]) {
1158 defineProperty(Constructor, SPECIES$2, {
1159 configurable: true,
1160 get: function () { return this; }
1161 });
1162 }
1163 };
1164
1165 var defineProperty = objectDefineProperty.f;
1166 var getOwnPropertyNames = objectGetOwnPropertyNames.f;
1167
1168
1169
1170
1171
1172 var setInternalState = internalState.set;
1173
1174
1175
1176 var MATCH = wellKnownSymbol('match');
1177 var NativeRegExp = global_1.RegExp;
1178 var RegExpPrototype$1 = NativeRegExp.prototype;
1179 var re1 = /a/g;
1180 var re2 = /a/g;
1181
1182 // "new" should create a new object, old webkit bug
1183 var CORRECT_NEW = new NativeRegExp(re1) !== re1;
1184
1185 var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
1186
1187 var FORCED$1 = descriptors && isForced_1('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {
1188 re2[MATCH] = false;
1189 // RegExp constructor can alter flags and IsRegExp works correct with @@match
1190 return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
1191 })));
1192
1193 // `RegExp` constructor
1194 // https://tc39.es/ecma262/#sec-regexp-constructor
1195 if (FORCED$1) {
1196 var RegExpWrapper = function RegExp(pattern, flags) {
1197 var thisIsRegExp = this instanceof RegExpWrapper;
1198 var patternIsRegExp = isRegexp(pattern);
1199 var flagsAreUndefined = flags === undefined;
1200 var sticky;
1201
1202 if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
1203 return pattern;
1204 }
1205
1206 if (CORRECT_NEW) {
1207 if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
1208 } else if (pattern instanceof RegExpWrapper) {
1209 if (flagsAreUndefined) flags = regexpFlags.call(pattern);
1210 pattern = pattern.source;
1211 }
1212
1213 if (UNSUPPORTED_Y) {
1214 sticky = !!flags && flags.indexOf('y') > -1;
1215 if (sticky) flags = flags.replace(/y/g, '');
1216 }
1217
1218 var result = inheritIfRequired(
1219 CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
1220 thisIsRegExp ? this : RegExpPrototype$1,
1221 RegExpWrapper
1222 );
1223
1224 if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky });
1225
1226 return result;
1227 };
1228 var proxy = function (key) {
1229 key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
1230 configurable: true,
1231 get: function () { return NativeRegExp[key]; },
1232 set: function (it) { NativeRegExp[key] = it; }
1233 });
1234 };
1235 var keys = getOwnPropertyNames(NativeRegExp);
1236 var index = 0;
1237 while (keys.length > index) proxy(keys[index++]);
1238 RegExpPrototype$1.constructor = RegExpWrapper;
1239 RegExpWrapper.prototype = RegExpPrototype$1;
1240 redefine(global_1, 'RegExp', RegExpWrapper);
1241 }
1242
1243 // https://tc39.es/ecma262/#sec-get-regexp-@@species
1244 setSpecies('RegExp');
1245
1246 var TO_STRING = 'toString';
1247 var RegExpPrototype = RegExp.prototype;
1248 var nativeToString = RegExpPrototype[TO_STRING];
1249
1250 var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
1251 // FF44- RegExp#toString has a wrong name
1252 var INCORRECT_NAME = nativeToString.name != TO_STRING;
1253
1254 // `RegExp.prototype.toString` method
1255 // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
1256 if (NOT_GENERIC || INCORRECT_NAME) {
1257 redefine(RegExp.prototype, TO_STRING, function toString() {
1258 var R = anObject(this);
1259 var p = String(R.source);
1260 var rf = R.flags;
1261 var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
1262 return '/' + p + '/' + f;
1263 }, { unsafe: true });
1264 }
1265
1266 // `String.prototype.{ codePointAt, at }` methods implementation
1267 var createMethod$1 = function (CONVERT_TO_STRING) {
1268 return function ($this, pos) {
1269 var S = String(requireObjectCoercible($this));
1270 var position = toInteger(pos);
1271 var size = S.length;
1272 var first, second;
1273 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1274 first = S.charCodeAt(position);
1275 return first < 0xD800 || first > 0xDBFF || position + 1 === size
1276 || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
1277 ? CONVERT_TO_STRING ? S.charAt(position) : first
1278 : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1279 };
1280 };
1281
1282 var stringMultibyte = {
1283 // `String.prototype.codePointAt` method
1284 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1285 codeAt: createMethod$1(false),
1286 // `String.prototype.at` method
1287 // https://github.com/mathiasbynens/String.prototype.at
1288 charAt: createMethod$1(true)
1289 };
1290
1291 var charAt = stringMultibyte.charAt;
1292
1293 // `AdvanceStringIndex` abstract operation
1294 // https://tc39.es/ecma262/#sec-advancestringindex
1295 var advanceStringIndex = function (S, index, unicode) {
1296 return index + (unicode ? charAt(S, index).length : 1);
1297 };
1298
1299 // @@match logic
1300 fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
1301 return [
1302 // `String.prototype.match` method
1303 // https://tc39.es/ecma262/#sec-string.prototype.match
1304 function match(regexp) {
1305 var O = requireObjectCoercible(this);
1306 var matcher = regexp == undefined ? undefined : regexp[MATCH];
1307 return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
1308 },
1309 // `RegExp.prototype[@@match]` method
1310 // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
1311 function (regexp) {
1312 var res = maybeCallNative(nativeMatch, regexp, this);
1313 if (res.done) return res.value;
1314
1315 var rx = anObject(regexp);
1316 var S = String(this);
1317
1318 if (!rx.global) return regexpExecAbstract(rx, S);
1319
1320 var fullUnicode = rx.unicode;
1321 rx.lastIndex = 0;
1322 var A = [];
1323 var n = 0;
1324 var result;
1325 while ((result = regexpExecAbstract(rx, S)) !== null) {
1326 var matchStr = String(result[0]);
1327 A[n] = matchStr;
1328 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1329 n++;
1330 }
1331 return n === 0 ? null : A;
1332 }
1333 ];
1334 });
1335
1336 // `Object.keys` method
1337 // https://tc39.es/ecma262/#sec-object.keys
1338 // eslint-disable-next-line es/no-object-keys -- safe
1339 var objectKeys = Object.keys || function keys(O) {
1340 return objectKeysInternal(O, enumBugKeys);
1341 };
1342
1343 var propertyIsEnumerable = objectPropertyIsEnumerable.f;
1344
1345 // `Object.{ entries, values }` methods implementation
1346 var createMethod = function (TO_ENTRIES) {
1347 return function (it) {
1348 var O = toIndexedObject(it);
1349 var keys = objectKeys(O);
1350 var length = keys.length;
1351 var i = 0;
1352 var result = [];
1353 var key;
1354 while (length > i) {
1355 key = keys[i++];
1356 if (!descriptors || propertyIsEnumerable.call(O, key)) {
1357 result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
1358 }
1359 }
1360 return result;
1361 };
1362 };
1363
1364 var objectToArray = {
1365 // `Object.entries` method
1366 // https://tc39.es/ecma262/#sec-object.entries
1367 entries: createMethod(true),
1368 // `Object.values` method
1369 // https://tc39.es/ecma262/#sec-object.values
1370 values: createMethod(false)
1371 };
1372
1373 var $entries = objectToArray.entries;
1374
1375 // `Object.entries` method
1376 // https://tc39.es/ecma262/#sec-object.entries
1377 _export({ target: 'Object', stat: true }, {
1378 entries: function entries(O) {
1379 return $entries(O);
1380 }
1381 });
1382
1383 // `IsArray` abstract operation
1384 // https://tc39.es/ecma262/#sec-isarray
1385 // eslint-disable-next-line es/no-array-isarray -- safe
1386 var isArray = Array.isArray || function isArray(arg) {
1387 return classofRaw(arg) == 'Array';
1388 };
1389
1390 // `ToObject` abstract operation
1391 // https://tc39.es/ecma262/#sec-toobject
1392 var toObject = function (argument) {
1393 return Object(requireObjectCoercible(argument));
1394 };
1395
1396 var createProperty = function (object, key, value) {
1397 var propertyKey = toPrimitive(key);
1398 if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
1399 else object[propertyKey] = value;
1400 };
1401
1402 var SPECIES$1 = wellKnownSymbol('species');
1403
1404 // `ArraySpeciesCreate` abstract operation
1405 // https://tc39.es/ecma262/#sec-arrayspeciescreate
1406 var arraySpeciesCreate = function (originalArray, length) {
1407 var C;
1408 if (isArray(originalArray)) {
1409 C = originalArray.constructor;
1410 // cross-realm fallback
1411 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
1412 else if (isObject(C)) {
1413 C = C[SPECIES$1];
1414 if (C === null) C = undefined;
1415 }
1416 } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
1417 };
1418
1419 var SPECIES = wellKnownSymbol('species');
1420
1421 var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
1422 // We can't use this feature detection in V8 since it causes
1423 // deoptimization and serious performance degradation
1424 // https://github.com/zloirock/core-js/issues/677
1425 return engineV8Version >= 51 || !fails(function () {
1426 var array = [];
1427 var constructor = array.constructor = {};
1428 constructor[SPECIES] = function () {
1429 return { foo: 1 };
1430 };
1431 return array[METHOD_NAME](Boolean).foo !== 1;
1432 });
1433 };
1434
1435 var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
1436 var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
1437 var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
1438
1439 // We can't use this feature detection in V8 since it causes
1440 // deoptimization and serious performance degradation
1441 // https://github.com/zloirock/core-js/issues/679
1442 var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
1443 var array = [];
1444 array[IS_CONCAT_SPREADABLE] = false;
1445 return array.concat()[0] !== array;
1446 });
1447
1448 var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
1449
1450 var isConcatSpreadable = function (O) {
1451 if (!isObject(O)) return false;
1452 var spreadable = O[IS_CONCAT_SPREADABLE];
1453 return spreadable !== undefined ? !!spreadable : isArray(O);
1454 };
1455
1456 var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
1457
1458 // `Array.prototype.concat` method
1459 // https://tc39.es/ecma262/#sec-array.prototype.concat
1460 // with adding support of @@isConcatSpreadable and @@species
1461 _export({ target: 'Array', proto: true, forced: FORCED }, {
1462 // eslint-disable-next-line no-unused-vars -- required for `.length`
1463 concat: function concat(arg) {
1464 var O = toObject(this);
1465 var A = arraySpeciesCreate(O, 0);
1466 var n = 0;
1467 var i, k, length, len, E;
1468 for (i = -1, length = arguments.length; i < length; i++) {
1469 E = i === -1 ? O : arguments[i];
1470 if (isConcatSpreadable(E)) {
1471 len = toLength(E.length);
1472 if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1473 for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
1474 } else {
1475 if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1476 createProperty(A, n++, E);
1477 }
1478 }
1479 A.length = n;
1480 return A;
1481 }
1482 });
1483
1484 var floor = Math.floor;
1485 var replace = ''.replace;
1486 var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
1487 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
1488
1489 // https://tc39.es/ecma262/#sec-getsubstitution
1490 var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
1491 var tailPos = position + matched.length;
1492 var m = captures.length;
1493 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
1494 if (namedCaptures !== undefined) {
1495 namedCaptures = toObject(namedCaptures);
1496 symbols = SUBSTITUTION_SYMBOLS;
1497 }
1498 return replace.call(replacement, symbols, function (match, ch) {
1499 var capture;
1500 switch (ch.charAt(0)) {
1501 case '$': return '$';
1502 case '&': return matched;
1503 case '`': return str.slice(0, position);
1504 case "'": return str.slice(tailPos);
1505 case '<':
1506 capture = namedCaptures[ch.slice(1, -1)];
1507 break;
1508 default: // \d\d?
1509 var n = +ch;
1510 if (n === 0) return match;
1511 if (n > m) {
1512 var f = floor(n / 10);
1513 if (f === 0) return match;
1514 if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
1515 return match;
1516 }
1517 capture = captures[n - 1];
1518 }
1519 return capture === undefined ? '' : capture;
1520 });
1521 };
1522
1523 var max = Math.max;
1524 var min = Math.min;
1525
1526 var maybeToString = function (it) {
1527 return it === undefined ? it : String(it);
1528 };
1529
1530 // @@replace logic
1531 fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
1532 var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
1533 var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
1534 var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
1535
1536 return [
1537 // `String.prototype.replace` method
1538 // https://tc39.es/ecma262/#sec-string.prototype.replace
1539 function replace(searchValue, replaceValue) {
1540 var O = requireObjectCoercible(this);
1541 var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
1542 return replacer !== undefined
1543 ? replacer.call(searchValue, O, replaceValue)
1544 : nativeReplace.call(String(O), searchValue, replaceValue);
1545 },
1546 // `RegExp.prototype[@@replace]` method
1547 // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
1548 function (regexp, replaceValue) {
1549 if (
1550 (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
1551 (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
1552 ) {
1553 var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
1554 if (res.done) return res.value;
1555 }
1556
1557 var rx = anObject(regexp);
1558 var S = String(this);
1559
1560 var functionalReplace = typeof replaceValue === 'function';
1561 if (!functionalReplace) replaceValue = String(replaceValue);
1562
1563 var global = rx.global;
1564 if (global) {
1565 var fullUnicode = rx.unicode;
1566 rx.lastIndex = 0;
1567 }
1568 var results = [];
1569 while (true) {
1570 var result = regexpExecAbstract(rx, S);
1571 if (result === null) break;
1572
1573 results.push(result);
1574 if (!global) break;
1575
1576 var matchStr = String(result[0]);
1577 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
1578 }
1579
1580 var accumulatedResult = '';
1581 var nextSourcePosition = 0;
1582 for (var i = 0; i < results.length; i++) {
1583 result = results[i];
1584
1585 var matched = String(result[0]);
1586 var position = max(min(toInteger(result.index), S.length), 0);
1587 var captures = [];
1588 // NOTE: This is equivalent to
1589 // captures = result.slice(1).map(maybeToString)
1590 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
1591 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
1592 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
1593 for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
1594 var namedCaptures = result.groups;
1595 if (functionalReplace) {
1596 var replacerArgs = [matched].concat(captures, position, S);
1597 if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
1598 var replacement = String(replaceValue.apply(undefined, replacerArgs));
1599 } else {
1600 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
1601 }
1602 if (position >= nextSourcePosition) {
1603 accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
1604 nextSourcePosition = position + matched.length;
1605 }
1606 }
1607 return accumulatedResult + S.slice(nextSourcePosition);
1608 }
1609 ];
1610 });
1611
1612 /**
1613 * @author: general
1614 * @website: note.generals.space
1615 * @email: generals.space@gmail.com
1616 * @github: https://github.com/generals-space/bootstrap-table-addrbar
1617 * @update: zhixin wen <wenzhixin2010@gmail.com>
1618 */
1619
1620 /*
1621 * function: 获取浏览器地址栏中的指定参数.
1622 * key: 参数名
1623 * url: 默认为当前地址栏
1624 */
1625
1626 function _GET(key) {
1627 var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
1628
1629 /*
1630 * 注意这里正则表达式的书写方法
1631 * (^|&)key匹配: 直接以key开始或以&key开始的字符串
1632 * 同理(&|$)表示以&结束或是直接结束的字符串
1633 * ...当然, 我并不知道这种用法.
1634 */
1635 var reg = new RegExp("(^|&)".concat(key, "=([^&]*)(&|$)"));
1636 var result = url.substr(1).match(reg);
1637
1638 if (result) {
1639 return decodeURIComponent(result[2]);
1640 }
1641
1642 return null;
1643 }
1644 /*
1645 * function: 根据给定参数生成url地址
1646 * var dic = {name: 'genreal', age: 24}
1647 * var url = 'https://www.baidu.com?age=22';
1648 * _buildUrl(dic, url);
1649 * 将得到"https://www.baidu.com?age=24&name=genreal"
1650 * 哦, 忽略先后顺序吧...
1651 *
1652 * 补充: 可以参考浏览器URLSearchParams对象, 更加方便和强大.
1653 * 考虑到兼容性, 暂时不使用这个工具.
1654 */
1655
1656
1657 function _buildUrl(dict) {
1658 var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.search;
1659
1660 for (var _i = 0, _Object$entries = Object.entries(dict); _i < _Object$entries.length; _i++) {
1661 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
1662 key = _Object$entries$_i[0],
1663 val = _Object$entries$_i[1];
1664
1665 // 搜索name=general这种形式的字符串(&是分隔符)
1666 var pattern = "".concat(key, "=([^&]*)");
1667 var targetStr = "".concat(key, "=").concat(val);
1668 if (val === undefined) continue;
1669 /*
1670 * 如果目标url中包含了key键, 我们需要将它替换成我们自己的val
1671 * 不然就直接添加好了.
1672 */
1673
1674 if (url.match(pattern)) {
1675 var tmp = new RegExp("(".concat(key, "=)([^&]*)"), 'gi');
1676 url = url.replace(tmp, targetStr);
1677 } else {
1678 var seperator = url.match('[?]') ? '&' : '?';
1679 url = url + seperator + targetStr;
1680 }
1681 }
1682
1683 if (location.hash) {
1684 url += location.hash;
1685 }
1686
1687 return url;
1688 }
1689 /*
1690 * function: _updateHistoryState
1691 * var _prefix = this.options.addrPrefix || ''
1692 * var table = this
1693 * _updateHistoryState( table,_prefix)
1694 * returns void
1695 */
1696
1697
1698 function _updateHistoryState(table, _prefix) {
1699 var params = {};
1700 params["".concat(_prefix, "page")] = table.options.pageNumber;
1701 params["".concat(_prefix, "size")] = table.options.pageSize;
1702 params["".concat(_prefix, "order")] = table.options.sortOrder;
1703 params["".concat(_prefix, "sort")] = table.options.sortName;
1704 params["".concat(_prefix, "search")] = table.options.searchText;
1705 window.history.pushState({}, '', _buildUrl(params));
1706 }
1707
1708 $__default['default'].extend($__default['default'].fn.bootstrapTable.defaults, {
1709 addrbar: false,
1710 addrPrefix: ''
1711 });
1712
1713 $__default['default'].BootstrapTable = /*#__PURE__*/function (_$$BootstrapTable) {
1714 _inherits(_class, _$$BootstrapTable);
1715
1716 var _super = _createSuper(_class);
1717
1718 function _class() {
1719 _classCallCheck(this, _class);
1720
1721 return _super.apply(this, arguments);
1722 }
1723
1724 _createClass(_class, [{
1725 key: "init",
1726 value: function init() {
1727 var _this = this,
1728 _get2;
1729
1730 if (this.options.pagination && this.options.addrbar) {
1731 // 标志位, 初始加载后关闭
1732 this.addrbarInit = true;
1733 this.options.pageNumber = +this.getDefaultOptionValue('pageNumber', 'page');
1734 this.options.pageSize = +this.getDefaultOptionValue('pageSize', 'size');
1735 this.options.sortOrder = this.getDefaultOptionValue('sortOrder', 'order');
1736 this.options.sortName = this.getDefaultOptionValue('sortName', 'sort');
1737 this.options.searchText = this.getDefaultOptionValue('searchText', 'search');
1738
1739 var _prefix = this.options.addrPrefix || '';
1740
1741 var _onLoadSuccess = this.options.onLoadSuccess;
1742 var _onPageChange = this.options.onPageChange;
1743
1744 this.options.onLoadSuccess = function (data) {
1745 if (_this.addrbarInit) {
1746 _this.addrbarInit = false;
1747 } else {
1748 _updateHistoryState(_this, _prefix);
1749 }
1750
1751 if (_onLoadSuccess) {
1752 _onLoadSuccess.call(_this, data);
1753 }
1754 };
1755
1756 this.options.onPageChange = function (number, size) {
1757 _updateHistoryState(_this, _prefix);
1758
1759 if (_onPageChange) {
1760 _onPageChange.call(_this, number, size);
1761 }
1762 };
1763 }
1764
1765 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1766 args[_key] = arguments[_key];
1767 }
1768
1769 (_get2 = _get(_getPrototypeOf(_class.prototype), "init", this)).call.apply(_get2, [this].concat(args));
1770 }
1771 /*
1772 * Priority order:
1773 * The value specified by the user has the highest priority.
1774 * If it is not specified, it will be obtained from the address bar.
1775 * If it is not obtained, the default value will be used.
1776 */
1777
1778 }, {
1779 key: "getDefaultOptionValue",
1780 value: function getDefaultOptionValue(optionName, prefixName) {
1781 if (this.options[optionName] !== $__default['default'].BootstrapTable.DEFAULTS[optionName]) {
1782 return this.options[optionName];
1783 }
1784
1785 return _GET("".concat(this.options.addrPrefix || '').concat(prefixName)) || $__default['default'].BootstrapTable.DEFAULTS[optionName];
1786 }
1787 }]);
1788
1789 return _class;
1790 }($__default['default'].BootstrapTable);
1791
1792})));