@cubejs-client/vue3 0.36.2 → 1.0.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.
@@ -56,15 +56,15 @@
56
56
 
57
57
  var $propertyIsEnumerable$2 = {}.propertyIsEnumerable;
58
58
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
59
- var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
59
+ var getOwnPropertyDescriptor$6 = Object.getOwnPropertyDescriptor;
60
60
 
61
61
  // Nashorn ~ JDK8 bug
62
- var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$2.call({ 1: 2 }, 1);
62
+ var NASHORN_BUG = getOwnPropertyDescriptor$6 && !$propertyIsEnumerable$2.call({ 1: 2 }, 1);
63
63
 
64
64
  // `Object.prototype.propertyIsEnumerable` method implementation
65
65
  // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
66
66
  var f$8 = NASHORN_BUG ? function propertyIsEnumerable(V) {
67
- var descriptor = getOwnPropertyDescriptor$5(this, V);
67
+ var descriptor = getOwnPropertyDescriptor$6(this, V);
68
68
  return !!descriptor && descriptor.enumerable;
69
69
  } : $propertyIsEnumerable$2;
70
70
 
@@ -329,14 +329,14 @@
329
329
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
330
330
  };
331
331
 
332
- var Symbol$2 = global$1.Symbol;
332
+ var Symbol$3 = global$1.Symbol;
333
333
  var WellKnownSymbolsStore$1 = shared('wks');
334
- var createWellKnownSymbol = useSymbolAsUid ? Symbol$2['for'] || Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid;
334
+ var createWellKnownSymbol = useSymbolAsUid ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid;
335
335
 
336
336
  var wellKnownSymbol = function (name) {
337
337
  if (!hasOwnProperty_1(WellKnownSymbolsStore$1, name)) {
338
- WellKnownSymbolsStore$1[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$2, name)
339
- ? Symbol$2[name]
338
+ WellKnownSymbolsStore$1[name] = symbolConstructorDetection && hasOwnProperty_1(Symbol$3, name)
339
+ ? Symbol$3[name]
340
340
  : createWellKnownSymbol('Symbol.' + name);
341
341
  } return WellKnownSymbolsStore$1[name];
342
342
  };
@@ -669,22 +669,22 @@
669
669
  };
670
670
 
671
671
  var max$3 = Math.max;
672
- var min$3 = Math.min;
672
+ var min$4 = Math.min;
673
673
 
674
674
  // Helper for a popular repeating case of the spec:
675
675
  // Let integer be ? ToInteger(index).
676
676
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
677
677
  var toAbsoluteIndex = function (index, length) {
678
678
  var integer = toIntegerOrInfinity(index);
679
- return integer < 0 ? max$3(integer + length, 0) : min$3(integer, length);
679
+ return integer < 0 ? max$3(integer + length, 0) : min$4(integer, length);
680
680
  };
681
681
 
682
- var min$2 = Math.min;
682
+ var min$3 = Math.min;
683
683
 
684
684
  // `ToLength` abstract operation
685
685
  // https://tc39.es/ecma262/#sec-tolength
686
686
  var toLength = function (argument) {
687
- return argument > 0 ? min$2(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
687
+ return argument > 0 ? min$3(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
688
688
  };
689
689
 
690
690
  // `LengthOfArrayLike` abstract operation
@@ -812,7 +812,7 @@
812
812
 
813
813
  var isForced_1 = isForced;
814
814
 
815
- var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
815
+ var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f;
816
816
 
817
817
 
818
818
 
@@ -849,7 +849,7 @@
849
849
  if (target) for (key in source) {
850
850
  sourceProperty = source[key];
851
851
  if (options.dontCallGetSet) {
852
- descriptor = getOwnPropertyDescriptor$4(target, key);
852
+ descriptor = getOwnPropertyDescriptor$5(target, key);
853
853
  targetProperty = descriptor && descriptor.value;
854
854
  } else targetProperty = target[key];
855
855
  FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
@@ -1144,7 +1144,7 @@
1144
1144
  var empty = [];
1145
1145
  var construct$1 = getBuiltIn('Reflect', 'construct');
1146
1146
  var constructorRegExp = /^\s*(?:class|function)\b/;
1147
- var exec$3 = functionUncurryThis(constructorRegExp.exec);
1147
+ var exec$4 = functionUncurryThis(constructorRegExp.exec);
1148
1148
  var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
1149
1149
 
1150
1150
  var isConstructorModern = function isConstructor(argument) {
@@ -1168,7 +1168,7 @@
1168
1168
  // we can't check .prototype since constructors produced by .bind haven't it
1169
1169
  // `Function#toString` throws on some built-it function in some legacy engines
1170
1170
  // (for example, `DOMQuad` and similar in FF41-)
1171
- return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource(argument));
1171
+ return INCORRECT_TO_STRING || !!exec$4(constructorRegExp, inspectSource(argument));
1172
1172
  } catch (error) {
1173
1173
  return true;
1174
1174
  }
@@ -1571,7 +1571,7 @@
1571
1571
 
1572
1572
  var $String$1 = String;
1573
1573
  var $stringify = getBuiltIn('JSON', 'stringify');
1574
- var exec$2 = functionUncurryThis(/./.exec);
1574
+ var exec$3 = functionUncurryThis(/./.exec);
1575
1575
  var charAt$7 = functionUncurryThis(''.charAt);
1576
1576
  var charCodeAt$2 = functionUncurryThis(''.charCodeAt);
1577
1577
  var replace$4 = functionUncurryThis(''.replace);
@@ -1612,7 +1612,7 @@
1612
1612
  var fixIllFormed = function (match, offset, string) {
1613
1613
  var prev = charAt$7(string, offset - 1);
1614
1614
  var next = charAt$7(string, offset + 1);
1615
- if ((exec$2(low, match) && !exec$2(hi, next)) || (exec$2(hi, match) && !exec$2(low, prev))) {
1615
+ if ((exec$3(low, match) && !exec$3(hi, next)) || (exec$3(hi, match) && !exec$3(low, prev))) {
1616
1616
  return '\\u' + numberToString(charCodeAt$2(match, 0), 16);
1617
1617
  } return match;
1618
1618
  };
@@ -1632,11 +1632,11 @@
1632
1632
 
1633
1633
  // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
1634
1634
  // https://bugs.chromium.org/p/v8/issues/detail?id=3443
1635
- var FORCED$9 = !symbolConstructorDetection || fails(function () { objectGetOwnPropertySymbols.f(1); });
1635
+ var FORCED$a = !symbolConstructorDetection || fails(function () { objectGetOwnPropertySymbols.f(1); });
1636
1636
 
1637
1637
  // `Object.getOwnPropertySymbols` method
1638
1638
  // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
1639
- _export({ target: 'Object', stat: true, forced: FORCED$9 }, {
1639
+ _export({ target: 'Object', stat: true, forced: FORCED$a }, {
1640
1640
  getOwnPropertySymbols: function getOwnPropertySymbols(it) {
1641
1641
  var $getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
1642
1642
  return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
@@ -1646,11 +1646,11 @@
1646
1646
  var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1647
1647
 
1648
1648
 
1649
- var FORCED$8 = !descriptors || fails(function () { nativeGetOwnPropertyDescriptor(1); });
1649
+ var FORCED$9 = !descriptors || fails(function () { nativeGetOwnPropertyDescriptor(1); });
1650
1650
 
1651
1651
  // `Object.getOwnPropertyDescriptor` method
1652
1652
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
1653
- _export({ target: 'Object', stat: true, forced: FORCED$8, sham: !descriptors }, {
1653
+ _export({ target: 'Object', stat: true, forced: FORCED$9, sham: !descriptors }, {
1654
1654
  getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
1655
1655
  return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
1656
1656
  }
@@ -1746,9 +1746,9 @@
1746
1746
  nativeConstruct(function () { /* empty */ });
1747
1747
  });
1748
1748
 
1749
- var FORCED$7 = NEW_TARGET_BUG || ARGS_BUG;
1749
+ var FORCED$8 = NEW_TARGET_BUG || ARGS_BUG;
1750
1750
 
1751
- _export({ target: 'Reflect', stat: true, forced: FORCED$7, sham: FORCED$7 }, {
1751
+ _export({ target: 'Reflect', stat: true, forced: FORCED$8, sham: FORCED$8 }, {
1752
1752
  construct: function construct(Target, args /* , newTarget */) {
1753
1753
  aConstructor(Target);
1754
1754
  anObject(args);
@@ -1916,21 +1916,6 @@
1916
1916
  return target;
1917
1917
  }
1918
1918
 
1919
- function _defineProperty(obj, key, value) {
1920
- if (key in obj) {
1921
- Object.defineProperty(obj, key, {
1922
- value: value,
1923
- enumerable: true,
1924
- configurable: true,
1925
- writable: true
1926
- });
1927
- } else {
1928
- obj[key] = value;
1929
- }
1930
-
1931
- return obj;
1932
- }
1933
-
1934
1919
  function _arrayWithHoles(arr) {
1935
1920
  if (Array.isArray(arr)) return arr;
1936
1921
  }
@@ -1973,6 +1958,21 @@
1973
1958
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
1974
1959
  }
1975
1960
 
1961
+ function _defineProperty(obj, key, value) {
1962
+ if (key in obj) {
1963
+ Object.defineProperty(obj, key, {
1964
+ value: value,
1965
+ enumerable: true,
1966
+ configurable: true,
1967
+ writable: true
1968
+ });
1969
+ } else {
1970
+ obj[key] = value;
1971
+ }
1972
+
1973
+ return obj;
1974
+ }
1975
+
1976
1976
  /**
1977
1977
  * Copyright (c) 2014-present, Facebook, Inc.
1978
1978
  *
@@ -2747,1987 +2747,2138 @@
2747
2747
  });
2748
2748
  };
2749
2749
 
2750
- var $filter = arrayIteration.filter;
2751
-
2752
-
2753
- var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport('filter');
2754
-
2755
- // `Array.prototype.filter` method
2756
- // https://tc39.es/ecma262/#sec-array.prototype.filter
2757
- // with adding support of @@species
2758
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
2759
- filter: function filter(callbackfn /* , thisArg */) {
2760
- return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2761
- }
2762
- });
2763
-
2764
- // `Object.prototype.toString` method implementation
2765
- // https://tc39.es/ecma262/#sec-object.prototype.tostring
2766
- var objectToString = toStringTagSupport ? {}.toString : function toString() {
2767
- return '[object ' + classof(this) + ']';
2768
- };
2769
-
2770
- // `Object.prototype.toString` method
2771
- // https://tc39.es/ecma262/#sec-object.prototype.tostring
2772
- if (!toStringTagSupport) {
2773
- defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
2774
- }
2775
-
2776
2750
  var $map = arrayIteration.map;
2777
2751
 
2778
2752
 
2779
- var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('map');
2753
+ var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport('map');
2780
2754
 
2781
2755
  // `Array.prototype.map` method
2782
2756
  // https://tc39.es/ecma262/#sec-array.prototype.map
2783
2757
  // with adding support of @@species
2784
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
2758
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
2785
2759
  map: function map(callbackfn /* , thisArg */) {
2786
2760
  return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2787
2761
  }
2788
2762
  });
2789
2763
 
2790
- var defineProperty$3 = objectDefineProperty.f;
2791
-
2792
- var UNSCOPABLES = wellKnownSymbol('unscopables');
2793
- var ArrayPrototype$1 = Array.prototype;
2794
-
2795
- // Array.prototype[@@unscopables]
2796
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2797
- if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
2798
- defineProperty$3(ArrayPrototype$1, UNSCOPABLES, {
2799
- configurable: true,
2800
- value: objectCreate(null)
2801
- });
2802
- }
2803
-
2804
- // add a key to Array.prototype[@@unscopables]
2805
- var addToUnscopables = function (key) {
2806
- ArrayPrototype$1[UNSCOPABLES][key] = true;
2764
+ // `RegExp.prototype.flags` getter implementation
2765
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
2766
+ var regexpFlags = function () {
2767
+ var that = anObject(this);
2768
+ var result = '';
2769
+ if (that.hasIndices) result += 'd';
2770
+ if (that.global) result += 'g';
2771
+ if (that.ignoreCase) result += 'i';
2772
+ if (that.multiline) result += 'm';
2773
+ if (that.dotAll) result += 's';
2774
+ if (that.unicode) result += 'u';
2775
+ if (that.unicodeSets) result += 'v';
2776
+ if (that.sticky) result += 'y';
2777
+ return result;
2807
2778
  };
2808
2779
 
2809
- var $includes = arrayIncludes.includes;
2810
-
2780
+ // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
2781
+ var $RegExp$2 = global$1.RegExp;
2811
2782
 
2783
+ var UNSUPPORTED_Y$3 = fails(function () {
2784
+ var re = $RegExp$2('a', 'y');
2785
+ re.lastIndex = 2;
2786
+ return re.exec('abcd') !== null;
2787
+ });
2812
2788
 
2813
- // FF99+ bug
2814
- var BROKEN_ON_SPARSE = fails(function () {
2815
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
2816
- return !Array(1).includes();
2789
+ // UC Browser bug
2790
+ // https://github.com/zloirock/core-js/issues/1008
2791
+ var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails(function () {
2792
+ return !$RegExp$2('a', 'y').sticky;
2817
2793
  });
2818
2794
 
2819
- // `Array.prototype.includes` method
2820
- // https://tc39.es/ecma262/#sec-array.prototype.includes
2821
- _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2822
- includes: function includes(el /* , fromIndex = 0 */) {
2823
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2824
- }
2795
+ var BROKEN_CARET = UNSUPPORTED_Y$3 || fails(function () {
2796
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
2797
+ var re = $RegExp$2('^r', 'gy');
2798
+ re.lastIndex = 2;
2799
+ return re.exec('str') !== null;
2825
2800
  });
2826
2801
 
2827
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2828
- addToUnscopables('includes');
2802
+ var regexpStickyHelpers = {
2803
+ BROKEN_CARET: BROKEN_CARET,
2804
+ MISSED_STICKY: MISSED_STICKY$1,
2805
+ UNSUPPORTED_Y: UNSUPPORTED_Y$3
2806
+ };
2829
2807
 
2830
- // `Array.isArray` method
2831
- // https://tc39.es/ecma262/#sec-array.isarray
2832
- _export({ target: 'Array', stat: true }, {
2833
- isArray: isArray
2808
+ // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
2809
+ var $RegExp$1 = global$1.RegExp;
2810
+
2811
+ var regexpUnsupportedDotAll = fails(function () {
2812
+ var re = $RegExp$1('.', 's');
2813
+ return !(re.dotAll && re.test('\n') && re.flags === 's');
2834
2814
  });
2835
2815
 
2836
- var FAILS_ON_PRIMITIVES$1 = fails(function () { objectKeys(1); });
2816
+ // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
2817
+ var $RegExp = global$1.RegExp;
2837
2818
 
2838
- // `Object.keys` method
2839
- // https://tc39.es/ecma262/#sec-object.keys
2840
- _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, {
2841
- keys: function keys(it) {
2842
- return objectKeys(toObject(it));
2843
- }
2819
+ var regexpUnsupportedNcg = fails(function () {
2820
+ var re = $RegExp('(?<a>b)', 'g');
2821
+ return re.exec('b').groups.a !== 'b' ||
2822
+ 'b'.replace(re, '$<a>c') !== 'bc';
2844
2823
  });
2845
2824
 
2846
- var correctPrototypeGetter = !fails(function () {
2847
- function F() { /* empty */ }
2848
- F.prototype.constructor = null;
2849
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
2850
- return Object.getPrototypeOf(new F()) !== F.prototype;
2851
- });
2825
+ /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
2826
+ /* eslint-disable regexp/no-useless-quantifier -- testing */
2852
2827
 
2853
- var IE_PROTO = sharedKey('IE_PROTO');
2854
- var $Object = Object;
2855
- var ObjectPrototype = $Object.prototype;
2856
2828
 
2857
- // `Object.getPrototypeOf` method
2858
- // https://tc39.es/ecma262/#sec-object.getprototypeof
2859
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
2860
- var objectGetPrototypeOf = correctPrototypeGetter ? $Object.getPrototypeOf : function (O) {
2861
- var object = toObject(O);
2862
- if (hasOwnProperty_1(object, IE_PROTO)) return object[IE_PROTO];
2863
- var constructor = object.constructor;
2864
- if (isCallable(constructor) && object instanceof constructor) {
2865
- return constructor.prototype;
2866
- } return object instanceof $Object ? ObjectPrototype : null;
2867
- };
2868
2829
 
2869
- var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
2870
2830
 
2871
- var propertyIsEnumerable = functionUncurryThis($propertyIsEnumerable);
2872
- var push$3 = functionUncurryThis([].push);
2873
2831
 
2874
- // in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys
2875
- // of `null` prototype objects
2876
- var IE_BUG = descriptors && fails(function () {
2877
- // eslint-disable-next-line es/no-object-create -- safe
2878
- var O = Object.create(null);
2879
- O[2] = 2;
2880
- return !propertyIsEnumerable(O, 2);
2881
- });
2882
2832
 
2883
- // `Object.{ entries, values }` methods implementation
2884
- var createMethod$3 = function (TO_ENTRIES) {
2885
- return function (it) {
2886
- var O = toIndexedObject(it);
2887
- var keys = objectKeys(O);
2888
- var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
2889
- var length = keys.length;
2890
- var i = 0;
2891
- var result = [];
2892
- var key;
2893
- while (length > i) {
2894
- key = keys[i++];
2895
- if (!descriptors || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
2896
- push$3(result, TO_ENTRIES ? [key, O[key]] : O[key]);
2897
- }
2898
- }
2899
- return result;
2900
- };
2901
- };
2902
2833
 
2903
- var objectToArray = {
2904
- // `Object.entries` method
2905
- // https://tc39.es/ecma262/#sec-object.entries
2906
- entries: createMethod$3(true),
2907
- // `Object.values` method
2908
- // https://tc39.es/ecma262/#sec-object.values
2909
- values: createMethod$3(false)
2910
- };
2834
+ var getInternalState$2 = internalState.get;
2911
2835
 
2912
- var $entries = objectToArray.entries;
2913
2836
 
2914
- // `Object.entries` method
2915
- // https://tc39.es/ecma262/#sec-object.entries
2916
- _export({ target: 'Object', stat: true }, {
2917
- entries: function entries(O) {
2918
- return $entries(O);
2919
- }
2920
- });
2921
2837
 
2922
- var $find = arrayIteration.find;
2838
+ var nativeReplace = shared('native-string-replace', String.prototype.replace);
2839
+ var nativeExec = RegExp.prototype.exec;
2840
+ var patchedExec = nativeExec;
2841
+ var charAt$6 = functionUncurryThis(''.charAt);
2842
+ var indexOf = functionUncurryThis(''.indexOf);
2843
+ var replace$3 = functionUncurryThis(''.replace);
2844
+ var stringSlice$5 = functionUncurryThis(''.slice);
2923
2845
 
2846
+ var UPDATES_LAST_INDEX_WRONG = (function () {
2847
+ var re1 = /a/;
2848
+ var re2 = /b*/g;
2849
+ functionCall(nativeExec, re1, 'a');
2850
+ functionCall(nativeExec, re2, 'a');
2851
+ return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2852
+ })();
2924
2853
 
2925
- var FIND = 'find';
2926
- var SKIPS_HOLES$1 = true;
2854
+ var UNSUPPORTED_Y$2 = regexpStickyHelpers.BROKEN_CARET;
2927
2855
 
2928
- // Shouldn't skip holes
2929
- // eslint-disable-next-line es/no-array-prototype-find -- testing
2930
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
2856
+ // nonparticipating capturing group, copied from es5-shim's String#split patch.
2857
+ var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2931
2858
 
2932
- // `Array.prototype.find` method
2933
- // https://tc39.es/ecma262/#sec-array.prototype.find
2934
- _export({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
2935
- find: function find(callbackfn /* , that = undefined */) {
2936
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2937
- }
2938
- });
2859
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
2939
2860
 
2940
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2941
- addToUnscopables(FIND);
2861
+ if (PATCH) {
2862
+ patchedExec = function exec(string) {
2863
+ var re = this;
2864
+ var state = getInternalState$2(re);
2865
+ var str = toString$2(string);
2866
+ var raw = state.raw;
2867
+ var result, reCopy, lastIndex, match, i, object, group;
2942
2868
 
2943
- var arrayMethodIsStrict = function (METHOD_NAME, argument) {
2944
- var method = [][METHOD_NAME];
2945
- return !!method && fails(function () {
2946
- // eslint-disable-next-line no-useless-call -- required for testing
2947
- method.call(null, argument || function () { return 1; }, 1);
2948
- });
2949
- };
2950
-
2951
- var $every = arrayIteration.every;
2952
-
2953
-
2954
- var STRICT_METHOD$3 = arrayMethodIsStrict('every');
2955
-
2956
- // `Array.prototype.every` method
2957
- // https://tc39.es/ecma262/#sec-array.prototype.every
2958
- _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$3 }, {
2959
- every: function every(callbackfn /* , thisArg */) {
2960
- return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2961
- }
2962
- });
2963
-
2964
- var $TypeError$b = TypeError;
2965
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2966
- var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
2967
-
2968
- // Safari < 13 does not throw an error in this case
2969
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = descriptors && !function () {
2970
- // makes no sense without proper strict mode support
2971
- if (this !== undefined) return true;
2972
- try {
2973
- // eslint-disable-next-line es/no-object-defineproperty -- safe
2974
- Object.defineProperty([], 'length', { writable: false }).length = 1;
2975
- } catch (error) {
2976
- return error instanceof TypeError;
2977
- }
2978
- }();
2979
-
2980
- var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
2981
- if (isArray(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
2982
- throw new $TypeError$b('Cannot set read only .length');
2983
- } return O.length = length;
2984
- } : function (O, length) {
2985
- return O.length = length;
2986
- };
2987
-
2988
- var $TypeError$a = TypeError;
2989
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
2869
+ if (raw) {
2870
+ raw.lastIndex = re.lastIndex;
2871
+ result = functionCall(patchedExec, raw, str);
2872
+ re.lastIndex = raw.lastIndex;
2873
+ return result;
2874
+ }
2990
2875
 
2991
- var doesNotExceedSafeInteger = function (it) {
2992
- if (it > MAX_SAFE_INTEGER) throw $TypeError$a('Maximum allowed index exceeded');
2993
- return it;
2994
- };
2876
+ var groups = state.groups;
2877
+ var sticky = UNSUPPORTED_Y$2 && re.sticky;
2878
+ var flags = functionCall(regexpFlags, re);
2879
+ var source = re.source;
2880
+ var charsAdded = 0;
2881
+ var strCopy = str;
2995
2882
 
2996
- var $TypeError$9 = TypeError;
2883
+ if (sticky) {
2884
+ flags = replace$3(flags, 'y', '');
2885
+ if (indexOf(flags, 'g') === -1) {
2886
+ flags += 'g';
2887
+ }
2997
2888
 
2998
- var deletePropertyOrThrow = function (O, P) {
2999
- if (!delete O[P]) throw new $TypeError$9('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
3000
- };
2889
+ strCopy = stringSlice$5(str, re.lastIndex);
2890
+ // Support anchored sticky behavior.
2891
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$6(str, re.lastIndex - 1) !== '\n')) {
2892
+ source = '(?: ' + source + ')';
2893
+ strCopy = ' ' + strCopy;
2894
+ charsAdded++;
2895
+ }
2896
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
2897
+ // simulate the 'y' flag.
2898
+ reCopy = new RegExp('^(?:' + source + ')', flags);
2899
+ }
3001
2900
 
3002
- var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('splice');
2901
+ if (NPCG_INCLUDED) {
2902
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
2903
+ }
2904
+ if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
3003
2905
 
3004
- var max$1 = Math.max;
3005
- var min$1 = Math.min;
2906
+ match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
3006
2907
 
3007
- // `Array.prototype.splice` method
3008
- // https://tc39.es/ecma262/#sec-array.prototype.splice
3009
- // with adding support of @@species
3010
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
3011
- splice: function splice(start, deleteCount /* , ...items */) {
3012
- var O = toObject(this);
3013
- var len = lengthOfArrayLike(O);
3014
- var actualStart = toAbsoluteIndex(start, len);
3015
- var argumentsLength = arguments.length;
3016
- var insertCount, actualDeleteCount, A, k, from, to;
3017
- if (argumentsLength === 0) {
3018
- insertCount = actualDeleteCount = 0;
3019
- } else if (argumentsLength === 1) {
3020
- insertCount = 0;
3021
- actualDeleteCount = len - actualStart;
3022
- } else {
3023
- insertCount = argumentsLength - 2;
3024
- actualDeleteCount = min$1(max$1(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
3025
- }
3026
- doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
3027
- A = arraySpeciesCreate(O, actualDeleteCount);
3028
- for (k = 0; k < actualDeleteCount; k++) {
3029
- from = actualStart + k;
3030
- if (from in O) createProperty(A, k, O[from]);
3031
- }
3032
- A.length = actualDeleteCount;
3033
- if (insertCount < actualDeleteCount) {
3034
- for (k = actualStart; k < len - actualDeleteCount; k++) {
3035
- from = k + actualDeleteCount;
3036
- to = k + insertCount;
3037
- if (from in O) O[to] = O[from];
3038
- else deletePropertyOrThrow(O, to);
3039
- }
3040
- for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
3041
- } else if (insertCount > actualDeleteCount) {
3042
- for (k = len - actualDeleteCount; k > actualStart; k--) {
3043
- from = k + actualDeleteCount - 1;
3044
- to = k + insertCount - 1;
3045
- if (from in O) O[to] = O[from];
3046
- else deletePropertyOrThrow(O, to);
3047
- }
2908
+ if (sticky) {
2909
+ if (match) {
2910
+ match.input = stringSlice$5(match.input, charsAdded);
2911
+ match[0] = stringSlice$5(match[0], charsAdded);
2912
+ match.index = re.lastIndex;
2913
+ re.lastIndex += match[0].length;
2914
+ } else re.lastIndex = 0;
2915
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
2916
+ re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
3048
2917
  }
3049
- for (k = 0; k < insertCount; k++) {
3050
- O[k + actualStart] = arguments[k + 2];
2918
+ if (NPCG_INCLUDED && match && match.length > 1) {
2919
+ // Fix browsers whose `exec` methods don't consistently return `undefined`
2920
+ // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
2921
+ functionCall(nativeReplace, match[0], reCopy, function () {
2922
+ for (i = 1; i < arguments.length - 2; i++) {
2923
+ if (arguments[i] === undefined) match[i] = undefined;
2924
+ }
2925
+ });
3051
2926
  }
3052
- arraySetLength(O, len - actualDeleteCount + insertCount);
3053
- return A;
3054
- }
3055
- });
3056
-
3057
- var $TypeError$8 = TypeError;
3058
2927
 
3059
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
3060
- var createMethod$2 = function (IS_RIGHT) {
3061
- return function (that, callbackfn, argumentsLength, memo) {
3062
- var O = toObject(that);
3063
- var self = indexedObject(O);
3064
- var length = lengthOfArrayLike(O);
3065
- aCallable(callbackfn);
3066
- var index = IS_RIGHT ? length - 1 : 0;
3067
- var i = IS_RIGHT ? -1 : 1;
3068
- if (argumentsLength < 2) while (true) {
3069
- if (index in self) {
3070
- memo = self[index];
3071
- index += i;
3072
- break;
3073
- }
3074
- index += i;
3075
- if (IS_RIGHT ? index < 0 : length <= index) {
3076
- throw new $TypeError$8('Reduce of empty array with no initial value');
2928
+ if (match && groups) {
2929
+ match.groups = object = objectCreate(null);
2930
+ for (i = 0; i < groups.length; i++) {
2931
+ group = groups[i];
2932
+ object[group[0]] = match[group[1]];
3077
2933
  }
3078
2934
  }
3079
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
3080
- memo = callbackfn(memo, self[index], index, O);
3081
- }
3082
- return memo;
3083
- };
3084
- };
3085
2935
 
3086
- var arrayReduce = {
3087
- // `Array.prototype.reduce` method
3088
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
3089
- left: createMethod$2(false),
3090
- // `Array.prototype.reduceRight` method
3091
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
3092
- right: createMethod$2(true)
3093
- };
2936
+ return match;
2937
+ };
2938
+ }
3094
2939
 
3095
- var engineIsNode = classofRaw(global$1.process) === 'process';
2940
+ var regexpExec = patchedExec;
3096
2941
 
3097
- var $reduce = arrayReduce.left;
2942
+ // `RegExp.prototype.exec` method
2943
+ // https://tc39.es/ecma262/#sec-regexp.prototype.exec
2944
+ _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
2945
+ exec: regexpExec
2946
+ });
3098
2947
 
2948
+ // TODO: Remove from `core-js@4` since it's moved to entry points
3099
2949
 
3100
2950
 
3101
2951
 
3102
- // Chrome 80-82 has a critical bug
3103
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
3104
- var CHROME_BUG = !engineIsNode && engineV8Version > 79 && engineV8Version < 83;
3105
- var FORCED$6 = CHROME_BUG || !arrayMethodIsStrict('reduce');
3106
2952
 
3107
- // `Array.prototype.reduce` method
3108
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
3109
- _export({ target: 'Array', proto: true, forced: FORCED$6 }, {
3110
- reduce: function reduce(callbackfn /* , initialValue */) {
3111
- var length = arguments.length;
3112
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
3113
- }
3114
- });
3115
2953
 
3116
- var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
3117
2954
 
3118
- // We can't use this feature detection in V8 since it causes
3119
- // deoptimization and serious performance degradation
3120
- // https://github.com/zloirock/core-js/issues/679
3121
- var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
3122
- var array = [];
3123
- array[IS_CONCAT_SPREADABLE] = false;
3124
- return array.concat()[0] !== array;
3125
- });
3126
2955
 
3127
- var isConcatSpreadable = function (O) {
3128
- if (!isObject(O)) return false;
3129
- var spreadable = O[IS_CONCAT_SPREADABLE];
3130
- return spreadable !== undefined ? !!spreadable : isArray(O);
3131
- };
3132
2956
 
3133
- var FORCED$5 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');
2957
+ var SPECIES$4 = wellKnownSymbol('species');
2958
+ var RegExpPrototype$3 = RegExp.prototype;
3134
2959
 
3135
- // `Array.prototype.concat` method
3136
- // https://tc39.es/ecma262/#sec-array.prototype.concat
3137
- // with adding support of @@isConcatSpreadable and @@species
3138
- _export({ target: 'Array', proto: true, arity: 1, forced: FORCED$5 }, {
3139
- // eslint-disable-next-line no-unused-vars -- required for `.length`
3140
- concat: function concat(arg) {
3141
- var O = toObject(this);
3142
- var A = arraySpeciesCreate(O, 0);
3143
- var n = 0;
3144
- var i, k, length, len, E;
3145
- for (i = -1, length = arguments.length; i < length; i++) {
3146
- E = i === -1 ? O : arguments[i];
3147
- if (isConcatSpreadable(E)) {
3148
- len = lengthOfArrayLike(E);
3149
- doesNotExceedSafeInteger(n + len);
3150
- for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
3151
- } else {
3152
- doesNotExceedSafeInteger(n + 1);
3153
- createProperty(A, n++, E);
3154
- }
3155
- }
3156
- A.length = n;
3157
- return A;
3158
- }
3159
- });
2960
+ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2961
+ var SYMBOL = wellKnownSymbol(KEY);
3160
2962
 
3161
- var iterators = {};
2963
+ var DELEGATES_TO_SYMBOL = !fails(function () {
2964
+ // String methods call symbol-named RegEp methods
2965
+ var O = {};
2966
+ O[SYMBOL] = function () { return 7; };
2967
+ return ''[KEY](O) !== 7;
2968
+ });
3162
2969
 
3163
- var ITERATOR$8 = wellKnownSymbol('iterator');
3164
- var BUGGY_SAFARI_ITERATORS$1 = false;
2970
+ var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
2971
+ // Symbol-named RegExp methods call .exec
2972
+ var execCalled = false;
2973
+ var re = /a/;
3165
2974
 
3166
- // `%IteratorPrototype%` object
3167
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
3168
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
2975
+ if (KEY === 'split') {
2976
+ // We can't use real regex here since it causes deoptimization
2977
+ // and serious performance degradation in V8
2978
+ // https://github.com/zloirock/core-js/issues/306
2979
+ re = {};
2980
+ // RegExp[@@split] doesn't call the regex's exec method, but first creates
2981
+ // a new one. We need to return the patched regex when creating the new one.
2982
+ re.constructor = {};
2983
+ re.constructor[SPECIES$4] = function () { return re; };
2984
+ re.flags = '';
2985
+ re[SYMBOL] = /./[SYMBOL];
2986
+ }
3169
2987
 
3170
- /* eslint-disable es/no-array-prototype-keys -- safe */
3171
- if ([].keys) {
3172
- arrayIterator = [].keys();
3173
- // Safari 8 has buggy iterators w/o `next`
3174
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
3175
- else {
3176
- PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
3177
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
3178
- }
3179
- }
2988
+ re.exec = function () {
2989
+ execCalled = true;
2990
+ return null;
2991
+ };
3180
2992
 
3181
- var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails(function () {
3182
- var test = {};
3183
- // FF44- legacy iterators case
3184
- return IteratorPrototype$2[ITERATOR$8].call(test) !== test;
3185
- });
2993
+ re[SYMBOL]('');
2994
+ return !execCalled;
2995
+ });
3186
2996
 
3187
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
2997
+ if (
2998
+ !DELEGATES_TO_SYMBOL ||
2999
+ !DELEGATES_TO_EXEC ||
3000
+ FORCED
3001
+ ) {
3002
+ var uncurriedNativeRegExpMethod = functionUncurryThisClause(/./[SYMBOL]);
3003
+ var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
3004
+ var uncurriedNativeMethod = functionUncurryThisClause(nativeMethod);
3005
+ var $exec = regexp.exec;
3006
+ if ($exec === regexpExec || $exec === RegExpPrototype$3.exec) {
3007
+ if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
3008
+ // The native String method already delegates to @@method (this
3009
+ // polyfilled function), leasing to infinite recursion.
3010
+ // We avoid it by directly calling the native @@method method.
3011
+ return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
3012
+ }
3013
+ return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
3014
+ }
3015
+ return { done: false };
3016
+ });
3188
3017
 
3189
- // `%IteratorPrototype%[@@iterator]()` method
3190
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
3191
- if (!isCallable(IteratorPrototype$2[ITERATOR$8])) {
3192
- defineBuiltIn(IteratorPrototype$2, ITERATOR$8, function () {
3193
- return this;
3194
- });
3195
- }
3018
+ defineBuiltIn(String.prototype, KEY, methods[0]);
3019
+ defineBuiltIn(RegExpPrototype$3, SYMBOL, methods[1]);
3020
+ }
3196
3021
 
3197
- var iteratorsCore = {
3198
- IteratorPrototype: IteratorPrototype$2,
3199
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
3022
+ if (SHAM) createNonEnumerableProperty(RegExpPrototype$3[SYMBOL], 'sham', true);
3200
3023
  };
3201
3024
 
3202
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
3203
-
3025
+ var MATCH$2 = wellKnownSymbol('match');
3204
3026
 
3027
+ // `IsRegExp` abstract operation
3028
+ // https://tc39.es/ecma262/#sec-isregexp
3029
+ var isRegexp = function (it) {
3030
+ var isRegExp;
3031
+ return isObject(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classofRaw(it) === 'RegExp');
3032
+ };
3205
3033
 
3034
+ var SPECIES$3 = wellKnownSymbol('species');
3206
3035
 
3036
+ // `SpeciesConstructor` abstract operation
3037
+ // https://tc39.es/ecma262/#sec-speciesconstructor
3038
+ var speciesConstructor = function (O, defaultConstructor) {
3039
+ var C = anObject(O).constructor;
3040
+ var S;
3041
+ return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES$3]) ? defaultConstructor : aConstructor(S);
3042
+ };
3207
3043
 
3208
- var returnThis$1 = function () { return this; };
3044
+ var charAt$5 = functionUncurryThis(''.charAt);
3045
+ var charCodeAt$1 = functionUncurryThis(''.charCodeAt);
3046
+ var stringSlice$4 = functionUncurryThis(''.slice);
3209
3047
 
3210
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
3211
- var TO_STRING_TAG = NAME + ' Iterator';
3212
- IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
3213
- setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
3214
- iterators[TO_STRING_TAG] = returnThis$1;
3215
- return IteratorConstructor;
3048
+ var createMethod$3 = function (CONVERT_TO_STRING) {
3049
+ return function ($this, pos) {
3050
+ var S = toString$2(requireObjectCoercible($this));
3051
+ var position = toIntegerOrInfinity(pos);
3052
+ var size = S.length;
3053
+ var first, second;
3054
+ if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
3055
+ first = charCodeAt$1(S, position);
3056
+ return first < 0xD800 || first > 0xDBFF || position + 1 === size
3057
+ || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
3058
+ ? CONVERT_TO_STRING
3059
+ ? charAt$5(S, position)
3060
+ : first
3061
+ : CONVERT_TO_STRING
3062
+ ? stringSlice$4(S, position, position + 2)
3063
+ : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
3064
+ };
3216
3065
  };
3217
3066
 
3218
- var functionUncurryThisAccessor = function (object, key, method) {
3219
- try {
3220
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
3221
- return functionUncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
3222
- } catch (error) { /* empty */ }
3067
+ var stringMultibyte = {
3068
+ // `String.prototype.codePointAt` method
3069
+ // https://tc39.es/ecma262/#sec-string.prototype.codepointat
3070
+ codeAt: createMethod$3(false),
3071
+ // `String.prototype.at` method
3072
+ // https://github.com/mathiasbynens/String.prototype.at
3073
+ charAt: createMethod$3(true)
3223
3074
  };
3224
3075
 
3225
- var $String = String;
3226
- var $TypeError$7 = TypeError;
3076
+ var charAt$4 = stringMultibyte.charAt;
3227
3077
 
3228
- var aPossiblePrototype = function (argument) {
3229
- if (typeof argument == 'object' || isCallable(argument)) return argument;
3230
- throw new $TypeError$7("Can't set " + $String(argument) + ' as a prototype');
3078
+ // `AdvanceStringIndex` abstract operation
3079
+ // https://tc39.es/ecma262/#sec-advancestringindex
3080
+ var advanceStringIndex = function (S, index, unicode) {
3081
+ return index + (unicode ? charAt$4(S, index).length : 1);
3231
3082
  };
3232
3083
 
3233
- /* eslint-disable no-proto -- safe */
3084
+ var $TypeError$b = TypeError;
3234
3085
 
3086
+ // `RegExpExec` abstract operation
3087
+ // https://tc39.es/ecma262/#sec-regexpexec
3088
+ var regexpExecAbstract = function (R, S) {
3089
+ var exec = R.exec;
3090
+ if (isCallable(exec)) {
3091
+ var result = functionCall(exec, R, S);
3092
+ if (result !== null) anObject(result);
3093
+ return result;
3094
+ }
3095
+ if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
3096
+ throw new $TypeError$b('RegExp#exec called on incompatible receiver');
3097
+ };
3235
3098
 
3099
+ var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y;
3100
+ var MAX_UINT32 = 0xFFFFFFFF;
3101
+ var min$2 = Math.min;
3102
+ var $push = [].push;
3103
+ var exec$2 = functionUncurryThis(/./.exec);
3104
+ var push$3 = functionUncurryThis($push);
3105
+ var stringSlice$3 = functionUncurryThis(''.slice);
3236
3106
 
3107
+ // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
3108
+ // Weex JS has frozen built-in prototypes, so use try / catch wrapper
3109
+ var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
3110
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
3111
+ var re = /(?:)/;
3112
+ var originalExec = re.exec;
3113
+ re.exec = function () { return originalExec.apply(this, arguments); };
3114
+ var result = 'ab'.split(re);
3115
+ return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
3116
+ });
3237
3117
 
3238
- // `Object.setPrototypeOf` method
3239
- // https://tc39.es/ecma262/#sec-object.setprototypeof
3240
- // Works with __proto__ only. Old v8 can't work with null proto objects.
3241
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
3242
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3243
- var CORRECT_SETTER = false;
3244
- var test = {};
3245
- var setter;
3246
- try {
3247
- setter = functionUncurryThisAccessor(Object.prototype, '__proto__', 'set');
3248
- setter(test, []);
3249
- CORRECT_SETTER = test instanceof Array;
3250
- } catch (error) { /* empty */ }
3251
- return function setPrototypeOf(O, proto) {
3252
- anObject(O);
3253
- aPossiblePrototype(proto);
3254
- if (CORRECT_SETTER) setter(O, proto);
3255
- else O.__proto__ = proto;
3256
- return O;
3257
- };
3258
- }() : undefined);
3118
+ // @@split logic
3119
+ fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
3120
+ var internalSplit;
3121
+ if (
3122
+ 'abbc'.split(/(b)*/)[1] === 'c' ||
3123
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
3124
+ 'test'.split(/(?:)/, -1).length !== 4 ||
3125
+ 'ab'.split(/(?:ab)*/).length !== 2 ||
3126
+ '.'.split(/(.?)(.?)/).length !== 4 ||
3127
+ // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
3128
+ '.'.split(/()()/).length > 1 ||
3129
+ ''.split(/.?/).length
3130
+ ) {
3131
+ // based on es5-shim implementation, need to rework it
3132
+ internalSplit = function (separator, limit) {
3133
+ var string = toString$2(requireObjectCoercible(this));
3134
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
3135
+ if (lim === 0) return [];
3136
+ if (separator === undefined) return [string];
3137
+ // If `separator` is not a regex, use native split
3138
+ if (!isRegexp(separator)) {
3139
+ return functionCall(nativeSplit, string, separator, lim);
3140
+ }
3141
+ var output = [];
3142
+ var flags = (separator.ignoreCase ? 'i' : '') +
3143
+ (separator.multiline ? 'm' : '') +
3144
+ (separator.unicode ? 'u' : '') +
3145
+ (separator.sticky ? 'y' : '');
3146
+ var lastLastIndex = 0;
3147
+ // Make `global` and avoid `lastIndex` issues by working with a copy
3148
+ var separatorCopy = new RegExp(separator.source, flags + 'g');
3149
+ var match, lastIndex, lastLength;
3150
+ while (match = functionCall(regexpExec, separatorCopy, string)) {
3151
+ lastIndex = separatorCopy.lastIndex;
3152
+ if (lastIndex > lastLastIndex) {
3153
+ push$3(output, stringSlice$3(string, lastLastIndex, match.index));
3154
+ if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
3155
+ lastLength = match[0].length;
3156
+ lastLastIndex = lastIndex;
3157
+ if (output.length >= lim) break;
3158
+ }
3159
+ if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
3160
+ }
3161
+ if (lastLastIndex === string.length) {
3162
+ if (lastLength || !exec$2(separatorCopy, '')) push$3(output, '');
3163
+ } else push$3(output, stringSlice$3(string, lastLastIndex));
3164
+ return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
3165
+ };
3166
+ // Chakra, V8
3167
+ } else if ('0'.split(undefined, 0).length) {
3168
+ internalSplit = function (separator, limit) {
3169
+ return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
3170
+ };
3171
+ } else internalSplit = nativeSplit;
3259
3172
 
3260
- var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
3261
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
3262
- var IteratorPrototype = iteratorsCore.IteratorPrototype;
3263
- var BUGGY_SAFARI_ITERATORS = iteratorsCore.BUGGY_SAFARI_ITERATORS;
3264
- var ITERATOR$7 = wellKnownSymbol('iterator');
3265
- var KEYS = 'keys';
3266
- var VALUES = 'values';
3267
- var ENTRIES = 'entries';
3173
+ return [
3174
+ // `String.prototype.split` method
3175
+ // https://tc39.es/ecma262/#sec-string.prototype.split
3176
+ function split(separator, limit) {
3177
+ var O = requireObjectCoercible(this);
3178
+ var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
3179
+ return splitter
3180
+ ? functionCall(splitter, separator, O, limit)
3181
+ : functionCall(internalSplit, toString$2(O), separator, limit);
3182
+ },
3183
+ // `RegExp.prototype[@@split]` method
3184
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
3185
+ //
3186
+ // NOTE: This cannot be properly polyfilled in engines that don't support
3187
+ // the 'y' flag.
3188
+ function (string, limit) {
3189
+ var rx = anObject(this);
3190
+ var S = toString$2(string);
3191
+ var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
3268
3192
 
3269
- var returnThis = function () { return this; };
3193
+ if (res.done) return res.value;
3270
3194
 
3271
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
3272
- iteratorCreateConstructor(IteratorConstructor, NAME, next);
3273
-
3274
- var getIterationMethod = function (KIND) {
3275
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
3276
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
3277
-
3278
- switch (KIND) {
3279
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
3280
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
3281
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
3282
- }
3283
-
3284
- return function () { return new IteratorConstructor(this); };
3285
- };
3195
+ var C = speciesConstructor(rx, RegExp);
3286
3196
 
3287
- var TO_STRING_TAG = NAME + ' Iterator';
3288
- var INCORRECT_VALUES_NAME = false;
3289
- var IterablePrototype = Iterable.prototype;
3290
- var nativeIterator = IterablePrototype[ITERATOR$7]
3291
- || IterablePrototype['@@iterator']
3292
- || DEFAULT && IterablePrototype[DEFAULT];
3293
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
3294
- var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
3295
- var CurrentIteratorPrototype, methods, KEY;
3197
+ var unicodeMatching = rx.unicode;
3198
+ var flags = (rx.ignoreCase ? 'i' : '') +
3199
+ (rx.multiline ? 'm' : '') +
3200
+ (rx.unicode ? 'u' : '') +
3201
+ (UNSUPPORTED_Y$1 ? 'g' : 'y');
3296
3202
 
3297
- // fix native
3298
- if (anyNativeIterator) {
3299
- CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
3300
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
3301
- if (objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
3302
- if (objectSetPrototypeOf) {
3303
- objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
3304
- } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$7])) {
3305
- defineBuiltIn(CurrentIteratorPrototype, ITERATOR$7, returnThis);
3203
+ // ^(? + rx + ) is needed, in combination with some S slicing, to
3204
+ // simulate the 'y' flag.
3205
+ var splitter = new C(UNSUPPORTED_Y$1 ? '^(?:' + rx.source + ')' : rx, flags);
3206
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
3207
+ if (lim === 0) return [];
3208
+ if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
3209
+ var p = 0;
3210
+ var q = 0;
3211
+ var A = [];
3212
+ while (q < S.length) {
3213
+ splitter.lastIndex = UNSUPPORTED_Y$1 ? 0 : q;
3214
+ var z = regexpExecAbstract(splitter, UNSUPPORTED_Y$1 ? stringSlice$3(S, q) : S);
3215
+ var e;
3216
+ if (
3217
+ z === null ||
3218
+ (e = min$2(toLength(splitter.lastIndex + (UNSUPPORTED_Y$1 ? q : 0)), S.length)) === p
3219
+ ) {
3220
+ q = advanceStringIndex(S, q, unicodeMatching);
3221
+ } else {
3222
+ push$3(A, stringSlice$3(S, p, q));
3223
+ if (A.length === lim) return A;
3224
+ for (var i = 1; i <= z.length - 1; i++) {
3225
+ push$3(A, z[i]);
3226
+ if (A.length === lim) return A;
3227
+ }
3228
+ q = p = e;
3306
3229
  }
3307
3230
  }
3308
- // Set @@toStringTag to native iterators
3309
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
3310
- }
3311
- }
3312
-
3313
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
3314
- if (PROPER_FUNCTION_NAME$2 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
3315
- if (CONFIGURABLE_FUNCTION_NAME) {
3316
- createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
3317
- } else {
3318
- INCORRECT_VALUES_NAME = true;
3319
- defaultIterator = function values() { return functionCall(nativeIterator, this); };
3231
+ push$3(A, stringSlice$3(S, p));
3232
+ return A;
3320
3233
  }
3321
- }
3234
+ ];
3235
+ }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y$1);
3322
3236
 
3323
- // export additional methods
3324
- if (DEFAULT) {
3325
- methods = {
3326
- values: getIterationMethod(VALUES),
3327
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
3328
- entries: getIterationMethod(ENTRIES)
3329
- };
3330
- if (FORCED) for (KEY in methods) {
3331
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
3332
- defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
3333
- }
3334
- } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
3335
- }
3237
+ // a string of all valid unicode whitespaces
3238
+ var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
3239
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
3336
3240
 
3337
- // define iterator
3338
- if (IterablePrototype[ITERATOR$7] !== defaultIterator) {
3339
- defineBuiltIn(IterablePrototype, ITERATOR$7, defaultIterator, { name: DEFAULT });
3340
- }
3341
- iterators[NAME] = defaultIterator;
3241
+ var replace$2 = functionUncurryThis(''.replace);
3242
+ var ltrim = RegExp('^[' + whitespaces + ']+');
3243
+ var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
3342
3244
 
3343
- return methods;
3245
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
3246
+ var createMethod$2 = function (TYPE) {
3247
+ return function ($this) {
3248
+ var string = toString$2(requireObjectCoercible($this));
3249
+ if (TYPE & 1) string = replace$2(string, ltrim, '');
3250
+ if (TYPE & 2) string = replace$2(string, rtrim, '$1');
3251
+ return string;
3252
+ };
3344
3253
  };
3345
3254
 
3346
- // `CreateIterResultObject` abstract operation
3347
- // https://tc39.es/ecma262/#sec-createiterresultobject
3348
- var createIterResultObject = function (value, done) {
3349
- return { value: value, done: done };
3255
+ var stringTrim = {
3256
+ // `String.prototype.{ trimLeft, trimStart }` methods
3257
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
3258
+ start: createMethod$2(1),
3259
+ // `String.prototype.{ trimRight, trimEnd }` methods
3260
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
3261
+ end: createMethod$2(2),
3262
+ // `String.prototype.trim` method
3263
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
3264
+ trim: createMethod$2(3)
3350
3265
  };
3351
3266
 
3352
- var defineProperty$2 = objectDefineProperty.f;
3353
-
3354
-
3267
+ var trim$2 = stringTrim.trim;
3355
3268
 
3356
3269
 
3270
+ var $parseInt = global$1.parseInt;
3271
+ var Symbol$2 = global$1.Symbol;
3272
+ var ITERATOR$9 = Symbol$2 && Symbol$2.iterator;
3273
+ var hex = /^[+-]?0x/i;
3274
+ var exec$1 = functionUncurryThis(hex.exec);
3275
+ var FORCED$7 = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
3276
+ // MS Edge 18- broken with boxed symbols
3277
+ || (ITERATOR$9 && !fails(function () { $parseInt(Object(ITERATOR$9)); }));
3278
+
3279
+ // `parseInt` method
3280
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
3281
+ var numberParseInt = FORCED$7 ? function parseInt(string, radix) {
3282
+ var S = trim$2(toString$2(string));
3283
+ return $parseInt(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10));
3284
+ } : $parseInt;
3285
+
3286
+ // `parseInt` method
3287
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
3288
+ _export({ global: true, forced: parseInt !== numberParseInt }, {
3289
+ parseInt: numberParseInt
3290
+ });
3357
3291
 
3358
- var ARRAY_ITERATOR = 'Array Iterator';
3359
- var setInternalState$4 = internalState.set;
3360
- var getInternalState$2 = internalState.getterFor(ARRAY_ITERATOR);
3361
-
3362
- // `Array.prototype.entries` method
3363
- // https://tc39.es/ecma262/#sec-array.prototype.entries
3364
- // `Array.prototype.keys` method
3365
- // https://tc39.es/ecma262/#sec-array.prototype.keys
3366
- // `Array.prototype.values` method
3367
- // https://tc39.es/ecma262/#sec-array.prototype.values
3368
- // `Array.prototype[@@iterator]` method
3369
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
3370
- // `CreateArrayIterator` internal method
3371
- // https://tc39.es/ecma262/#sec-createarrayiterator
3372
- var es_array_iterator = iteratorDefine(Array, 'Array', function (iterated, kind) {
3373
- setInternalState$4(this, {
3374
- type: ARRAY_ITERATOR,
3375
- target: toIndexedObject(iterated), // target
3376
- index: 0, // next index
3377
- kind: kind // kind
3378
- });
3379
- // `%ArrayIteratorPrototype%.next` method
3380
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
3381
- }, function () {
3382
- var state = getInternalState$2(this);
3383
- var target = state.target;
3384
- var index = state.index++;
3385
- if (!target || index >= target.length) {
3386
- state.target = undefined;
3387
- return createIterResultObject(undefined, true);
3388
- }
3389
- switch (state.kind) {
3390
- case 'keys': return createIterResultObject(index, false);
3391
- case 'values': return createIterResultObject(target[index], false);
3392
- } return createIterResultObject([index, target[index]], false);
3393
- }, 'values');
3292
+ var $TypeError$a = TypeError;
3394
3293
 
3395
- // argumentsList[@@iterator] is %ArrayProto_values%
3396
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
3397
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
3398
- var values = iterators.Arguments = iterators.Array;
3294
+ var notARegexp = function (it) {
3295
+ if (isRegexp(it)) {
3296
+ throw new $TypeError$a("The method doesn't accept regular expressions");
3297
+ } return it;
3298
+ };
3399
3299
 
3400
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3401
- addToUnscopables('keys');
3402
- addToUnscopables('values');
3403
- addToUnscopables('entries');
3300
+ var MATCH$1 = wellKnownSymbol('match');
3404
3301
 
3405
- // V8 ~ Chrome 45- bug
3406
- if (descriptors && values.name !== 'values') try {
3407
- defineProperty$2(values, 'name', { value: 'values' });
3408
- } catch (error) { /* empty */ }
3302
+ var correctIsRegexpLogic = function (METHOD_NAME) {
3303
+ var regexp = /./;
3304
+ try {
3305
+ '/./'[METHOD_NAME](regexp);
3306
+ } catch (error1) {
3307
+ try {
3308
+ regexp[MATCH$1] = false;
3309
+ return '/./'[METHOD_NAME](regexp);
3310
+ } catch (error2) { /* empty */ }
3311
+ } return false;
3312
+ };
3409
3313
 
3410
- // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
3314
+ var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
3411
3315
 
3412
3316
 
3413
- var arrayBufferNonExtensible = fails(function () {
3414
- if (typeof ArrayBuffer == 'function') {
3415
- var buffer = new ArrayBuffer(8);
3416
- // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
3417
- if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
3418
- }
3419
- });
3420
3317
 
3421
- // eslint-disable-next-line es/no-object-isextensible -- safe
3422
- var $isExtensible = Object.isExtensible;
3423
- var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
3424
3318
 
3425
- // `Object.isExtensible` method
3426
- // https://tc39.es/ecma262/#sec-object.isextensible
3427
- var objectIsExtensible = (FAILS_ON_PRIMITIVES || arrayBufferNonExtensible) ? function isExtensible(it) {
3428
- if (!isObject(it)) return false;
3429
- if (arrayBufferNonExtensible && classofRaw(it) === 'ArrayBuffer') return false;
3430
- return $isExtensible ? $isExtensible(it) : true;
3431
- } : $isExtensible;
3432
3319
 
3433
- var freezing = !fails(function () {
3434
- // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
3435
- return Object.isExtensible(Object.preventExtensions({}));
3436
- });
3437
3320
 
3438
- var internalMetadata = createCommonjsModule(function (module) {
3439
3321
 
3322
+ // eslint-disable-next-line es/no-string-prototype-endswith -- safe
3323
+ var nativeEndsWith = functionUncurryThisClause(''.endsWith);
3324
+ var slice$1 = functionUncurryThisClause(''.slice);
3325
+ var min$1 = Math.min;
3440
3326
 
3327
+ var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('endsWith');
3328
+ // https://github.com/zloirock/core-js/pull/702
3329
+ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
3330
+ var descriptor = getOwnPropertyDescriptor$4(String.prototype, 'endsWith');
3331
+ return descriptor && !descriptor.writable;
3332
+ }();
3441
3333
 
3334
+ // `String.prototype.endsWith` method
3335
+ // https://tc39.es/ecma262/#sec-string.prototype.endswith
3336
+ _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
3337
+ endsWith: function endsWith(searchString /* , endPosition = @length */) {
3338
+ var that = toString$2(requireObjectCoercible(this));
3339
+ notARegexp(searchString);
3340
+ var endPosition = arguments.length > 1 ? arguments[1] : undefined;
3341
+ var len = that.length;
3342
+ var end = endPosition === undefined ? len : min$1(toLength(endPosition), len);
3343
+ var search = toString$2(searchString);
3344
+ return nativeEndsWith
3345
+ ? nativeEndsWith(that, search, end)
3346
+ : slice$1(that, end - search.length, end) === search;
3347
+ }
3348
+ });
3442
3349
 
3350
+ var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('slice');
3443
3351
 
3444
- var defineProperty = objectDefineProperty.f;
3352
+ var SPECIES$2 = wellKnownSymbol('species');
3353
+ var $Array$1 = Array;
3354
+ var max$1 = Math.max;
3445
3355
 
3356
+ // `Array.prototype.slice` method
3357
+ // https://tc39.es/ecma262/#sec-array.prototype.slice
3358
+ // fallback for not array-like ES3 strings and DOM objects
3359
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
3360
+ slice: function slice(start, end) {
3361
+ var O = toIndexedObject(this);
3362
+ var length = lengthOfArrayLike(O);
3363
+ var k = toAbsoluteIndex(start, length);
3364
+ var fin = toAbsoluteIndex(end === undefined ? length : end, length);
3365
+ // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
3366
+ var Constructor, result, n;
3367
+ if (isArray(O)) {
3368
+ Constructor = O.constructor;
3369
+ // cross-realm fallback
3370
+ if (isConstructor(Constructor) && (Constructor === $Array$1 || isArray(Constructor.prototype))) {
3371
+ Constructor = undefined;
3372
+ } else if (isObject(Constructor)) {
3373
+ Constructor = Constructor[SPECIES$2];
3374
+ if (Constructor === null) Constructor = undefined;
3375
+ }
3376
+ if (Constructor === $Array$1 || Constructor === undefined) {
3377
+ return arraySlice(O, k, fin);
3378
+ }
3379
+ }
3380
+ result = new (Constructor === undefined ? $Array$1 : Constructor)(max$1(fin - k, 0));
3381
+ for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
3382
+ result.length = n;
3383
+ return result;
3384
+ }
3385
+ });
3446
3386
 
3387
+ var arrayMethodIsStrict = function (METHOD_NAME, argument) {
3388
+ var method = [][METHOD_NAME];
3389
+ return !!method && fails(function () {
3390
+ // eslint-disable-next-line no-useless-call -- required for testing
3391
+ method.call(null, argument || function () { return 1; }, 1);
3392
+ });
3393
+ };
3447
3394
 
3395
+ var $forEach = arrayIteration.forEach;
3448
3396
 
3449
3397
 
3398
+ var STRICT_METHOD$3 = arrayMethodIsStrict('forEach');
3450
3399
 
3451
- var REQUIRED = false;
3452
- var METADATA = uid('meta');
3453
- var id = 0;
3400
+ // `Array.prototype.forEach` method implementation
3401
+ // https://tc39.es/ecma262/#sec-array.prototype.foreach
3402
+ var arrayForEach = !STRICT_METHOD$3 ? function forEach(callbackfn /* , thisArg */) {
3403
+ return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3404
+ // eslint-disable-next-line es/no-array-prototype-foreach -- safe
3405
+ } : [].forEach;
3454
3406
 
3455
- var setMetadata = function (it) {
3456
- defineProperty(it, METADATA, { value: {
3457
- objectID: 'O' + id++, // object ID
3458
- weakData: {} // weak collections IDs
3459
- } });
3460
- };
3407
+ // `Array.prototype.forEach` method
3408
+ // https://tc39.es/ecma262/#sec-array.prototype.foreach
3409
+ // eslint-disable-next-line es/no-array-prototype-foreach -- safe
3410
+ _export({ target: 'Array', proto: true, forced: [].forEach !== arrayForEach }, {
3411
+ forEach: arrayForEach
3412
+ });
3461
3413
 
3462
- var fastKey = function (it, create) {
3463
- // return a primitive with prefix
3464
- if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
3465
- if (!hasOwnProperty_1(it, METADATA)) {
3466
- // can't set metadata to uncaught frozen object
3467
- if (!objectIsExtensible(it)) return 'F';
3468
- // not necessary to add metadata
3469
- if (!create) return 'E';
3470
- // add missing metadata
3471
- setMetadata(it);
3472
- // return object ID
3473
- } return it[METADATA].objectID;
3414
+ // `Object.prototype.toString` method implementation
3415
+ // https://tc39.es/ecma262/#sec-object.prototype.tostring
3416
+ var objectToString = toStringTagSupport ? {}.toString : function toString() {
3417
+ return '[object ' + classof(this) + ']';
3474
3418
  };
3475
3419
 
3476
- var getWeakData = function (it, create) {
3477
- if (!hasOwnProperty_1(it, METADATA)) {
3478
- // can't set metadata to uncaught frozen object
3479
- if (!objectIsExtensible(it)) return true;
3480
- // not necessary to add metadata
3481
- if (!create) return false;
3482
- // add missing metadata
3483
- setMetadata(it);
3484
- // return the store of weak collections IDs
3485
- } return it[METADATA].weakData;
3486
- };
3420
+ // `Object.prototype.toString` method
3421
+ // https://tc39.es/ecma262/#sec-object.prototype.tostring
3422
+ if (!toStringTagSupport) {
3423
+ defineBuiltIn(Object.prototype, 'toString', objectToString, { unsafe: true });
3424
+ }
3487
3425
 
3488
- // add metadata on freeze-family methods calling
3489
- var onFreeze = function (it) {
3490
- if (freezing && REQUIRED && objectIsExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
3491
- return it;
3426
+ // iterable DOM collections
3427
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
3428
+ var domIterables = {
3429
+ CSSRuleList: 0,
3430
+ CSSStyleDeclaration: 0,
3431
+ CSSValueList: 0,
3432
+ ClientRectList: 0,
3433
+ DOMRectList: 0,
3434
+ DOMStringList: 0,
3435
+ DOMTokenList: 1,
3436
+ DataTransferItemList: 0,
3437
+ FileList: 0,
3438
+ HTMLAllCollection: 0,
3439
+ HTMLCollection: 0,
3440
+ HTMLFormElement: 0,
3441
+ HTMLSelectElement: 0,
3442
+ MediaList: 0,
3443
+ MimeTypeArray: 0,
3444
+ NamedNodeMap: 0,
3445
+ NodeList: 1,
3446
+ PaintRequestList: 0,
3447
+ Plugin: 0,
3448
+ PluginArray: 0,
3449
+ SVGLengthList: 0,
3450
+ SVGNumberList: 0,
3451
+ SVGPathSegList: 0,
3452
+ SVGPointList: 0,
3453
+ SVGStringList: 0,
3454
+ SVGTransformList: 0,
3455
+ SourceBufferList: 0,
3456
+ StyleSheetList: 0,
3457
+ TextTrackCueList: 0,
3458
+ TextTrackList: 0,
3459
+ TouchList: 0
3492
3460
  };
3493
3461
 
3494
- var enable = function () {
3495
- meta.enable = function () { /* empty */ };
3496
- REQUIRED = true;
3497
- var getOwnPropertyNames = objectGetOwnPropertyNames.f;
3498
- var splice = functionUncurryThis([].splice);
3499
- var test = {};
3500
- test[METADATA] = 1;
3462
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
3501
3463
 
3502
- // prevent exposing of metadata key
3503
- if (getOwnPropertyNames(test).length) {
3504
- objectGetOwnPropertyNames.f = function (it) {
3505
- var result = getOwnPropertyNames(it);
3506
- for (var i = 0, length = result.length; i < length; i++) {
3507
- if (result[i] === METADATA) {
3508
- splice(result, i, 1);
3509
- break;
3510
- }
3511
- } return result;
3512
- };
3513
3464
 
3514
- _export({ target: 'Object', stat: true, forced: true }, {
3515
- getOwnPropertyNames: objectGetOwnPropertyNamesExternal.f
3516
- });
3465
+ var classList = documentCreateElement('span').classList;
3466
+ var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
3467
+
3468
+ var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
3469
+
3470
+ var handlePrototype$1 = function (CollectionPrototype) {
3471
+ // some Chrome versions have non-configurable methods on DOMTokenList
3472
+ if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
3473
+ createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
3474
+ } catch (error) {
3475
+ CollectionPrototype.forEach = arrayForEach;
3517
3476
  }
3518
3477
  };
3519
3478
 
3520
- var meta = module.exports = {
3521
- enable: enable,
3522
- fastKey: fastKey,
3523
- getWeakData: getWeakData,
3524
- onFreeze: onFreeze
3525
- };
3479
+ for (var COLLECTION_NAME$1 in domIterables) {
3480
+ if (domIterables[COLLECTION_NAME$1]) {
3481
+ handlePrototype$1(global$1[COLLECTION_NAME$1] && global$1[COLLECTION_NAME$1].prototype);
3482
+ }
3483
+ }
3526
3484
 
3527
- hiddenKeys$1[METADATA] = true;
3485
+ handlePrototype$1(domTokenListPrototype);
3486
+
3487
+ var correctPrototypeGetter = !fails(function () {
3488
+ function F() { /* empty */ }
3489
+ F.prototype.constructor = null;
3490
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
3491
+ return Object.getPrototypeOf(new F()) !== F.prototype;
3528
3492
  });
3529
3493
 
3530
- var ITERATOR$6 = wellKnownSymbol('iterator');
3531
- var ArrayPrototype = Array.prototype;
3494
+ var IE_PROTO = sharedKey('IE_PROTO');
3495
+ var $Object = Object;
3496
+ var ObjectPrototype = $Object.prototype;
3532
3497
 
3533
- // check on default Array iterator
3534
- var isArrayIteratorMethod = function (it) {
3535
- return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$6] === it);
3498
+ // `Object.getPrototypeOf` method
3499
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
3500
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
3501
+ var objectGetPrototypeOf = correctPrototypeGetter ? $Object.getPrototypeOf : function (O) {
3502
+ var object = toObject(O);
3503
+ if (hasOwnProperty_1(object, IE_PROTO)) return object[IE_PROTO];
3504
+ var constructor = object.constructor;
3505
+ if (isCallable(constructor) && object instanceof constructor) {
3506
+ return constructor.prototype;
3507
+ } return object instanceof $Object ? ObjectPrototype : null;
3536
3508
  };
3537
3509
 
3538
- var ITERATOR$5 = wellKnownSymbol('iterator');
3510
+ var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
3539
3511
 
3540
- var getIteratorMethod = function (it) {
3541
- if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$5)
3542
- || getMethod(it, '@@iterator')
3543
- || iterators[classof(it)];
3544
- };
3512
+ var propertyIsEnumerable = functionUncurryThis($propertyIsEnumerable);
3513
+ var push$2 = functionUncurryThis([].push);
3545
3514
 
3546
- var $TypeError$6 = TypeError;
3515
+ // in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys
3516
+ // of `null` prototype objects
3517
+ var IE_BUG = descriptors && fails(function () {
3518
+ // eslint-disable-next-line es/no-object-create -- safe
3519
+ var O = Object.create(null);
3520
+ O[2] = 2;
3521
+ return !propertyIsEnumerable(O, 2);
3522
+ });
3547
3523
 
3548
- var getIterator = function (argument, usingIterator) {
3549
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
3550
- if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
3551
- throw new $TypeError$6(tryToString(argument) + ' is not iterable');
3524
+ // `Object.{ entries, values }` methods implementation
3525
+ var createMethod$1 = function (TO_ENTRIES) {
3526
+ return function (it) {
3527
+ var O = toIndexedObject(it);
3528
+ var keys = objectKeys(O);
3529
+ var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
3530
+ var length = keys.length;
3531
+ var i = 0;
3532
+ var result = [];
3533
+ var key;
3534
+ while (length > i) {
3535
+ key = keys[i++];
3536
+ if (!descriptors || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
3537
+ push$2(result, TO_ENTRIES ? [key, O[key]] : O[key]);
3538
+ }
3539
+ }
3540
+ return result;
3541
+ };
3552
3542
  };
3553
3543
 
3554
- var iteratorClose = function (iterator, kind, value) {
3555
- var innerResult, innerError;
3556
- anObject(iterator);
3557
- try {
3558
- innerResult = getMethod(iterator, 'return');
3559
- if (!innerResult) {
3560
- if (kind === 'throw') throw value;
3561
- return value;
3562
- }
3563
- innerResult = functionCall(innerResult, iterator);
3564
- } catch (error) {
3565
- innerError = true;
3566
- innerResult = error;
3567
- }
3568
- if (kind === 'throw') throw value;
3569
- if (innerError) throw innerResult;
3570
- anObject(innerResult);
3571
- return value;
3544
+ var objectToArray = {
3545
+ // `Object.entries` method
3546
+ // https://tc39.es/ecma262/#sec-object.entries
3547
+ entries: createMethod$1(true),
3548
+ // `Object.values` method
3549
+ // https://tc39.es/ecma262/#sec-object.values
3550
+ values: createMethod$1(false)
3572
3551
  };
3573
3552
 
3574
- var $TypeError$5 = TypeError;
3553
+ var $entries = objectToArray.entries;
3575
3554
 
3576
- var Result = function (stopped, result) {
3577
- this.stopped = stopped;
3578
- this.result = result;
3579
- };
3555
+ // `Object.entries` method
3556
+ // https://tc39.es/ecma262/#sec-object.entries
3557
+ _export({ target: 'Object', stat: true }, {
3558
+ entries: function entries(O) {
3559
+ return $entries(O);
3560
+ }
3561
+ });
3580
3562
 
3581
- var ResultPrototype = Result.prototype;
3563
+ /* eslint-disable es/no-array-prototype-indexof -- required for testing */
3582
3564
 
3583
- var iterate = function (iterable, unboundFunction, options) {
3584
- var that = options && options.that;
3585
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
3586
- var IS_RECORD = !!(options && options.IS_RECORD);
3587
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
3588
- var INTERRUPTED = !!(options && options.INTERRUPTED);
3589
- var fn = functionBindContext(unboundFunction, that);
3590
- var iterator, iterFn, index, length, result, next, step;
3591
3565
 
3592
- var stop = function (condition) {
3593
- if (iterator) iteratorClose(iterator, 'normal', condition);
3594
- return new Result(true, condition);
3595
- };
3566
+ var $indexOf = arrayIncludes.indexOf;
3596
3567
 
3597
- var callFn = function (value) {
3598
- if (AS_ENTRIES) {
3599
- anObject(value);
3600
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
3601
- } return INTERRUPTED ? fn(value, stop) : fn(value);
3602
- };
3603
3568
 
3604
- if (IS_RECORD) {
3605
- iterator = iterable.iterator;
3606
- } else if (IS_ITERATOR) {
3607
- iterator = iterable;
3608
- } else {
3609
- iterFn = getIteratorMethod(iterable);
3610
- if (!iterFn) throw new $TypeError$5(tryToString(iterable) + ' is not iterable');
3611
- // optimisation for array iterators
3612
- if (isArrayIteratorMethod(iterFn)) {
3613
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
3614
- result = callFn(iterable[index]);
3615
- if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
3616
- } return new Result(false);
3617
- }
3618
- iterator = getIterator(iterable, iterFn);
3569
+ var nativeIndexOf = functionUncurryThisClause([].indexOf);
3570
+
3571
+ var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
3572
+ var FORCED$6 = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf');
3573
+
3574
+ // `Array.prototype.indexOf` method
3575
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
3576
+ _export({ target: 'Array', proto: true, forced: FORCED$6 }, {
3577
+ indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
3578
+ var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
3579
+ return NEGATIVE_ZERO
3580
+ // convert -0 to +0
3581
+ ? nativeIndexOf(this, searchElement, fromIndex) || 0
3582
+ : $indexOf(this, searchElement, fromIndex);
3619
3583
  }
3584
+ });
3620
3585
 
3621
- next = IS_RECORD ? iterable.next : iterator.next;
3622
- while (!(step = functionCall(next, iterator)).done) {
3623
- try {
3624
- result = callFn(step.value);
3625
- } catch (error) {
3626
- iteratorClose(iterator, 'throw', error);
3627
- }
3628
- if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
3629
- } return new Result(false);
3630
- };
3586
+ var $filter = arrayIteration.filter;
3631
3587
 
3632
- var $TypeError$4 = TypeError;
3633
3588
 
3634
- var anInstance = function (it, Prototype) {
3635
- if (objectIsPrototypeOf(Prototype, it)) return it;
3636
- throw new $TypeError$4('Incorrect invocation');
3637
- };
3589
+ var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('filter');
3638
3590
 
3639
- var ITERATOR$4 = wellKnownSymbol('iterator');
3640
- var SAFE_CLOSING = false;
3591
+ // `Array.prototype.filter` method
3592
+ // https://tc39.es/ecma262/#sec-array.prototype.filter
3593
+ // with adding support of @@species
3594
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
3595
+ filter: function filter(callbackfn /* , thisArg */) {
3596
+ return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3597
+ }
3598
+ });
3641
3599
 
3642
- try {
3643
- var called = 0;
3644
- var iteratorWithReturn = {
3645
- next: function () {
3646
- return { done: !!called++ };
3647
- },
3648
- 'return': function () {
3649
- SAFE_CLOSING = true;
3650
- }
3651
- };
3652
- iteratorWithReturn[ITERATOR$4] = function () {
3653
- return this;
3654
- };
3655
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
3656
- Array.from(iteratorWithReturn, function () { throw 2; });
3657
- } catch (error) { /* empty */ }
3600
+ var defineProperty$3 = objectDefineProperty.f;
3658
3601
 
3659
- var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
3660
- try {
3661
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
3662
- } catch (error) { return false; } // workaround of old WebKit + `eval` bug
3663
- var ITERATION_SUPPORT = false;
3664
- try {
3665
- var object = {};
3666
- object[ITERATOR$4] = function () {
3667
- return {
3668
- next: function () {
3669
- return { done: ITERATION_SUPPORT = true };
3670
- }
3671
- };
3672
- };
3673
- exec(object);
3674
- } catch (error) { /* empty */ }
3675
- return ITERATION_SUPPORT;
3676
- };
3602
+ var UNSCOPABLES = wellKnownSymbol('unscopables');
3603
+ var ArrayPrototype$1 = Array.prototype;
3677
3604
 
3678
- // makes subclassing work correct for wrapped built-ins
3679
- var inheritIfRequired = function ($this, dummy, Wrapper) {
3680
- var NewTarget, NewTargetPrototype;
3681
- if (
3682
- // it can work only with native `setPrototypeOf`
3683
- objectSetPrototypeOf &&
3684
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
3685
- isCallable(NewTarget = dummy.constructor) &&
3686
- NewTarget !== Wrapper &&
3687
- isObject(NewTargetPrototype = NewTarget.prototype) &&
3688
- NewTargetPrototype !== Wrapper.prototype
3689
- ) objectSetPrototypeOf($this, NewTargetPrototype);
3690
- return $this;
3605
+ // Array.prototype[@@unscopables]
3606
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3607
+ if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
3608
+ defineProperty$3(ArrayPrototype$1, UNSCOPABLES, {
3609
+ configurable: true,
3610
+ value: objectCreate(null)
3611
+ });
3612
+ }
3613
+
3614
+ // add a key to Array.prototype[@@unscopables]
3615
+ var addToUnscopables = function (key) {
3616
+ ArrayPrototype$1[UNSCOPABLES][key] = true;
3691
3617
  };
3692
3618
 
3693
- var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
3694
- var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
3695
- var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
3696
- var ADDER = IS_MAP ? 'set' : 'add';
3697
- var NativeConstructor = global$1[CONSTRUCTOR_NAME];
3698
- var NativePrototype = NativeConstructor && NativeConstructor.prototype;
3699
- var Constructor = NativeConstructor;
3700
- var exported = {};
3619
+ var $includes = arrayIncludes.includes;
3701
3620
 
3702
- var fixMethod = function (KEY) {
3703
- var uncurriedNativeMethod = functionUncurryThis(NativePrototype[KEY]);
3704
- defineBuiltIn(NativePrototype, KEY,
3705
- KEY === 'add' ? function add(value) {
3706
- uncurriedNativeMethod(this, value === 0 ? 0 : value);
3707
- return this;
3708
- } : KEY === 'delete' ? function (key) {
3709
- return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
3710
- } : KEY === 'get' ? function get(key) {
3711
- return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
3712
- } : KEY === 'has' ? function has(key) {
3713
- return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
3714
- } : function set(key, value) {
3715
- uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
3716
- return this;
3717
- }
3718
- );
3719
- };
3720
3621
 
3721
- var REPLACE = isForced_1(
3722
- CONSTRUCTOR_NAME,
3723
- !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
3724
- new NativeConstructor().entries().next();
3725
- }))
3726
- );
3727
3622
 
3728
- if (REPLACE) {
3729
- // create collection constructor
3730
- Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
3731
- internalMetadata.enable();
3732
- } else if (isForced_1(CONSTRUCTOR_NAME, true)) {
3733
- var instance = new Constructor();
3734
- // early implementations not supports chaining
3735
- var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
3736
- // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
3737
- var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
3738
- // most early implementations doesn't supports iterables, most modern - not close it correctly
3739
- // eslint-disable-next-line no-new -- required for testing
3740
- var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
3741
- // for early implementations -0 and +0 not the same
3742
- var BUGGY_ZERO = !IS_WEAK && fails(function () {
3743
- // V8 ~ Chromium 42- fails only with 5+ elements
3744
- var $instance = new NativeConstructor();
3745
- var index = 5;
3746
- while (index--) $instance[ADDER](index, index);
3747
- return !$instance.has(-0);
3748
- });
3623
+ // FF99+ bug
3624
+ var BROKEN_ON_SPARSE = fails(function () {
3625
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
3626
+ return !Array(1).includes();
3627
+ });
3749
3628
 
3750
- if (!ACCEPT_ITERABLES) {
3751
- Constructor = wrapper(function (dummy, iterable) {
3752
- anInstance(dummy, NativePrototype);
3753
- var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
3754
- if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
3755
- return that;
3756
- });
3757
- Constructor.prototype = NativePrototype;
3758
- NativePrototype.constructor = Constructor;
3759
- }
3629
+ // `Array.prototype.includes` method
3630
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
3631
+ _export({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
3632
+ includes: function includes(el /* , fromIndex = 0 */) {
3633
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
3634
+ }
3635
+ });
3760
3636
 
3761
- if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
3762
- fixMethod('delete');
3763
- fixMethod('has');
3764
- IS_MAP && fixMethod('get');
3765
- }
3637
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3638
+ addToUnscopables('includes');
3766
3639
 
3767
- if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
3640
+ // `Array.isArray` method
3641
+ // https://tc39.es/ecma262/#sec-array.isarray
3642
+ _export({ target: 'Array', stat: true }, {
3643
+ isArray: isArray
3644
+ });
3768
3645
 
3769
- // weak collections should not contains .clear method
3770
- if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
3646
+ var FAILS_ON_PRIMITIVES$1 = fails(function () { objectKeys(1); });
3647
+
3648
+ // `Object.keys` method
3649
+ // https://tc39.es/ecma262/#sec-object.keys
3650
+ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, {
3651
+ keys: function keys(it) {
3652
+ return objectKeys(toObject(it));
3771
3653
  }
3654
+ });
3772
3655
 
3773
- exported[CONSTRUCTOR_NAME] = Constructor;
3774
- _export({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);
3656
+ var $find = arrayIteration.find;
3775
3657
 
3776
- setToStringTag(Constructor, CONSTRUCTOR_NAME);
3777
3658
 
3778
- if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
3659
+ var FIND = 'find';
3660
+ var SKIPS_HOLES$1 = true;
3779
3661
 
3780
- return Constructor;
3781
- };
3662
+ // Shouldn't skip holes
3663
+ // eslint-disable-next-line es/no-array-prototype-find -- testing
3664
+ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
3782
3665
 
3783
- var defineBuiltIns = function (target, src, options) {
3784
- for (var key in src) defineBuiltIn(target, key, src[key], options);
3785
- return target;
3786
- };
3666
+ // `Array.prototype.find` method
3667
+ // https://tc39.es/ecma262/#sec-array.prototype.find
3668
+ _export({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
3669
+ find: function find(callbackfn /* , that = undefined */) {
3670
+ return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3671
+ }
3672
+ });
3787
3673
 
3788
- var SPECIES$4 = wellKnownSymbol('species');
3674
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3675
+ addToUnscopables(FIND);
3789
3676
 
3790
- var setSpecies = function (CONSTRUCTOR_NAME) {
3791
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
3677
+ var $every = arrayIteration.every;
3792
3678
 
3793
- if (descriptors && Constructor && !Constructor[SPECIES$4]) {
3794
- defineBuiltInAccessor(Constructor, SPECIES$4, {
3795
- configurable: true,
3796
- get: function () { return this; }
3797
- });
3798
- }
3799
- };
3800
3679
 
3801
- var fastKey = internalMetadata.fastKey;
3680
+ var STRICT_METHOD$2 = arrayMethodIsStrict('every');
3802
3681
 
3682
+ // `Array.prototype.every` method
3683
+ // https://tc39.es/ecma262/#sec-array.prototype.every
3684
+ _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$2 }, {
3685
+ every: function every(callbackfn /* , thisArg */) {
3686
+ return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3687
+ }
3688
+ });
3803
3689
 
3804
- var setInternalState$3 = internalState.set;
3805
- var internalStateGetterFor = internalState.getterFor;
3690
+ var $TypeError$9 = TypeError;
3691
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
3692
+ var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
3806
3693
 
3807
- var collectionStrong = {
3808
- getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
3809
- var Constructor = wrapper(function (that, iterable) {
3810
- anInstance(that, Prototype);
3811
- setInternalState$3(that, {
3812
- type: CONSTRUCTOR_NAME,
3813
- index: objectCreate(null),
3814
- first: undefined,
3815
- last: undefined,
3816
- size: 0
3817
- });
3818
- if (!descriptors) that.size = 0;
3819
- if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
3820
- });
3694
+ // Safari < 13 does not throw an error in this case
3695
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = descriptors && !function () {
3696
+ // makes no sense without proper strict mode support
3697
+ if (this !== undefined) return true;
3698
+ try {
3699
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
3700
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
3701
+ } catch (error) {
3702
+ return error instanceof TypeError;
3703
+ }
3704
+ }();
3705
+
3706
+ var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
3707
+ if (isArray(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
3708
+ throw new $TypeError$9('Cannot set read only .length');
3709
+ } return O.length = length;
3710
+ } : function (O, length) {
3711
+ return O.length = length;
3712
+ };
3713
+
3714
+ var $TypeError$8 = TypeError;
3715
+ var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
3716
+
3717
+ var doesNotExceedSafeInteger = function (it) {
3718
+ if (it > MAX_SAFE_INTEGER) throw $TypeError$8('Maximum allowed index exceeded');
3719
+ return it;
3720
+ };
3721
+
3722
+ var $TypeError$7 = TypeError;
3723
+
3724
+ var deletePropertyOrThrow = function (O, P) {
3725
+ if (!delete O[P]) throw new $TypeError$7('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
3726
+ };
3727
+
3728
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
3729
+
3730
+ var max = Math.max;
3731
+ var min = Math.min;
3732
+
3733
+ // `Array.prototype.splice` method
3734
+ // https://tc39.es/ecma262/#sec-array.prototype.splice
3735
+ // with adding support of @@species
3736
+ _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
3737
+ splice: function splice(start, deleteCount /* , ...items */) {
3738
+ var O = toObject(this);
3739
+ var len = lengthOfArrayLike(O);
3740
+ var actualStart = toAbsoluteIndex(start, len);
3741
+ var argumentsLength = arguments.length;
3742
+ var insertCount, actualDeleteCount, A, k, from, to;
3743
+ if (argumentsLength === 0) {
3744
+ insertCount = actualDeleteCount = 0;
3745
+ } else if (argumentsLength === 1) {
3746
+ insertCount = 0;
3747
+ actualDeleteCount = len - actualStart;
3748
+ } else {
3749
+ insertCount = argumentsLength - 2;
3750
+ actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
3751
+ }
3752
+ doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
3753
+ A = arraySpeciesCreate(O, actualDeleteCount);
3754
+ for (k = 0; k < actualDeleteCount; k++) {
3755
+ from = actualStart + k;
3756
+ if (from in O) createProperty(A, k, O[from]);
3757
+ }
3758
+ A.length = actualDeleteCount;
3759
+ if (insertCount < actualDeleteCount) {
3760
+ for (k = actualStart; k < len - actualDeleteCount; k++) {
3761
+ from = k + actualDeleteCount;
3762
+ to = k + insertCount;
3763
+ if (from in O) O[to] = O[from];
3764
+ else deletePropertyOrThrow(O, to);
3765
+ }
3766
+ for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
3767
+ } else if (insertCount > actualDeleteCount) {
3768
+ for (k = len - actualDeleteCount; k > actualStart; k--) {
3769
+ from = k + actualDeleteCount - 1;
3770
+ to = k + insertCount - 1;
3771
+ if (from in O) O[to] = O[from];
3772
+ else deletePropertyOrThrow(O, to);
3773
+ }
3774
+ }
3775
+ for (k = 0; k < insertCount; k++) {
3776
+ O[k + actualStart] = arguments[k + 2];
3777
+ }
3778
+ arraySetLength(O, len - actualDeleteCount + insertCount);
3779
+ return A;
3780
+ }
3781
+ });
3782
+
3783
+ var $TypeError$6 = TypeError;
3784
+
3785
+ // `Array.prototype.{ reduce, reduceRight }` methods implementation
3786
+ var createMethod = function (IS_RIGHT) {
3787
+ return function (that, callbackfn, argumentsLength, memo) {
3788
+ var O = toObject(that);
3789
+ var self = indexedObject(O);
3790
+ var length = lengthOfArrayLike(O);
3791
+ aCallable(callbackfn);
3792
+ var index = IS_RIGHT ? length - 1 : 0;
3793
+ var i = IS_RIGHT ? -1 : 1;
3794
+ if (argumentsLength < 2) while (true) {
3795
+ if (index in self) {
3796
+ memo = self[index];
3797
+ index += i;
3798
+ break;
3799
+ }
3800
+ index += i;
3801
+ if (IS_RIGHT ? index < 0 : length <= index) {
3802
+ throw new $TypeError$6('Reduce of empty array with no initial value');
3803
+ }
3804
+ }
3805
+ for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
3806
+ memo = callbackfn(memo, self[index], index, O);
3807
+ }
3808
+ return memo;
3809
+ };
3810
+ };
3811
+
3812
+ var arrayReduce = {
3813
+ // `Array.prototype.reduce` method
3814
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
3815
+ left: createMethod(false),
3816
+ // `Array.prototype.reduceRight` method
3817
+ // https://tc39.es/ecma262/#sec-array.prototype.reduceright
3818
+ right: createMethod(true)
3819
+ };
3820
+
3821
+ var engineIsNode = classofRaw(global$1.process) === 'process';
3822
+
3823
+ var $reduce = arrayReduce.left;
3824
+
3825
+
3826
+
3827
+
3828
+ // Chrome 80-82 has a critical bug
3829
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
3830
+ var CHROME_BUG = !engineIsNode && engineV8Version > 79 && engineV8Version < 83;
3831
+ var FORCED$5 = CHROME_BUG || !arrayMethodIsStrict('reduce');
3832
+
3833
+ // `Array.prototype.reduce` method
3834
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
3835
+ _export({ target: 'Array', proto: true, forced: FORCED$5 }, {
3836
+ reduce: function reduce(callbackfn /* , initialValue */) {
3837
+ var length = arguments.length;
3838
+ return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
3839
+ }
3840
+ });
3841
+
3842
+ var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
3843
+
3844
+ // We can't use this feature detection in V8 since it causes
3845
+ // deoptimization and serious performance degradation
3846
+ // https://github.com/zloirock/core-js/issues/679
3847
+ var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {
3848
+ var array = [];
3849
+ array[IS_CONCAT_SPREADABLE] = false;
3850
+ return array.concat()[0] !== array;
3851
+ });
3852
+
3853
+ var isConcatSpreadable = function (O) {
3854
+ if (!isObject(O)) return false;
3855
+ var spreadable = O[IS_CONCAT_SPREADABLE];
3856
+ return spreadable !== undefined ? !!spreadable : isArray(O);
3857
+ };
3858
+
3859
+ var FORCED$4 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');
3860
+
3861
+ // `Array.prototype.concat` method
3862
+ // https://tc39.es/ecma262/#sec-array.prototype.concat
3863
+ // with adding support of @@isConcatSpreadable and @@species
3864
+ _export({ target: 'Array', proto: true, arity: 1, forced: FORCED$4 }, {
3865
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
3866
+ concat: function concat(arg) {
3867
+ var O = toObject(this);
3868
+ var A = arraySpeciesCreate(O, 0);
3869
+ var n = 0;
3870
+ var i, k, length, len, E;
3871
+ for (i = -1, length = arguments.length; i < length; i++) {
3872
+ E = i === -1 ? O : arguments[i];
3873
+ if (isConcatSpreadable(E)) {
3874
+ len = lengthOfArrayLike(E);
3875
+ doesNotExceedSafeInteger(n + len);
3876
+ for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
3877
+ } else {
3878
+ doesNotExceedSafeInteger(n + 1);
3879
+ createProperty(A, n++, E);
3880
+ }
3881
+ }
3882
+ A.length = n;
3883
+ return A;
3884
+ }
3885
+ });
3886
+
3887
+ var iterators = {};
3888
+
3889
+ var ITERATOR$8 = wellKnownSymbol('iterator');
3890
+ var BUGGY_SAFARI_ITERATORS$1 = false;
3891
+
3892
+ // `%IteratorPrototype%` object
3893
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
3894
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
3895
+
3896
+ /* eslint-disable es/no-array-prototype-keys -- safe */
3897
+ if ([].keys) {
3898
+ arrayIterator = [].keys();
3899
+ // Safari 8 has buggy iterators w/o `next`
3900
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
3901
+ else {
3902
+ PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
3903
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
3904
+ }
3905
+ }
3906
+
3907
+ var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails(function () {
3908
+ var test = {};
3909
+ // FF44- legacy iterators case
3910
+ return IteratorPrototype$2[ITERATOR$8].call(test) !== test;
3911
+ });
3912
+
3913
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
3914
+
3915
+ // `%IteratorPrototype%[@@iterator]()` method
3916
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
3917
+ if (!isCallable(IteratorPrototype$2[ITERATOR$8])) {
3918
+ defineBuiltIn(IteratorPrototype$2, ITERATOR$8, function () {
3919
+ return this;
3920
+ });
3921
+ }
3922
+
3923
+ var iteratorsCore = {
3924
+ IteratorPrototype: IteratorPrototype$2,
3925
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
3926
+ };
3927
+
3928
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
3929
+
3930
+
3931
+
3932
+
3933
+
3934
+ var returnThis$1 = function () { return this; };
3935
+
3936
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
3937
+ var TO_STRING_TAG = NAME + ' Iterator';
3938
+ IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
3939
+ setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
3940
+ iterators[TO_STRING_TAG] = returnThis$1;
3941
+ return IteratorConstructor;
3942
+ };
3943
+
3944
+ var functionUncurryThisAccessor = function (object, key, method) {
3945
+ try {
3946
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
3947
+ return functionUncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
3948
+ } catch (error) { /* empty */ }
3949
+ };
3950
+
3951
+ var $String = String;
3952
+ var $TypeError$5 = TypeError;
3953
+
3954
+ var aPossiblePrototype = function (argument) {
3955
+ if (typeof argument == 'object' || isCallable(argument)) return argument;
3956
+ throw new $TypeError$5("Can't set " + $String(argument) + ' as a prototype');
3957
+ };
3958
+
3959
+ /* eslint-disable no-proto -- safe */
3960
+
3961
+
3962
+
3963
+
3964
+ // `Object.setPrototypeOf` method
3965
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
3966
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
3967
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
3968
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3969
+ var CORRECT_SETTER = false;
3970
+ var test = {};
3971
+ var setter;
3972
+ try {
3973
+ setter = functionUncurryThisAccessor(Object.prototype, '__proto__', 'set');
3974
+ setter(test, []);
3975
+ CORRECT_SETTER = test instanceof Array;
3976
+ } catch (error) { /* empty */ }
3977
+ return function setPrototypeOf(O, proto) {
3978
+ anObject(O);
3979
+ aPossiblePrototype(proto);
3980
+ if (CORRECT_SETTER) setter(O, proto);
3981
+ else O.__proto__ = proto;
3982
+ return O;
3983
+ };
3984
+ }() : undefined);
3821
3985
 
3822
- var Prototype = Constructor.prototype;
3986
+ var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
3987
+ var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
3988
+ var IteratorPrototype = iteratorsCore.IteratorPrototype;
3989
+ var BUGGY_SAFARI_ITERATORS = iteratorsCore.BUGGY_SAFARI_ITERATORS;
3990
+ var ITERATOR$7 = wellKnownSymbol('iterator');
3991
+ var KEYS = 'keys';
3992
+ var VALUES = 'values';
3993
+ var ENTRIES = 'entries';
3823
3994
 
3824
- var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
3995
+ var returnThis = function () { return this; };
3825
3996
 
3826
- var define = function (that, key, value) {
3827
- var state = getInternalState(that);
3828
- var entry = getEntry(that, key);
3829
- var previous, index;
3830
- // change existing entry
3831
- if (entry) {
3832
- entry.value = value;
3833
- // create new entry
3834
- } else {
3835
- state.last = entry = {
3836
- index: index = fastKey(key, true),
3837
- key: key,
3838
- value: value,
3839
- previous: previous = state.last,
3840
- next: undefined,
3841
- removed: false
3842
- };
3843
- if (!state.first) state.first = entry;
3844
- if (previous) previous.next = entry;
3845
- if (descriptors) state.size++;
3846
- else that.size++;
3847
- // add to index
3848
- if (index !== 'F') state.index[index] = entry;
3849
- } return that;
3850
- };
3997
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
3998
+ iteratorCreateConstructor(IteratorConstructor, NAME, next);
3851
3999
 
3852
- var getEntry = function (that, key) {
3853
- var state = getInternalState(that);
3854
- // fast case
3855
- var index = fastKey(key);
3856
- var entry;
3857
- if (index !== 'F') return state.index[index];
3858
- // frozen object case
3859
- for (entry = state.first; entry; entry = entry.next) {
3860
- if (entry.key === key) return entry;
3861
- }
3862
- };
4000
+ var getIterationMethod = function (KIND) {
4001
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
4002
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
3863
4003
 
3864
- defineBuiltIns(Prototype, {
3865
- // `{ Map, Set }.prototype.clear()` methods
3866
- // https://tc39.es/ecma262/#sec-map.prototype.clear
3867
- // https://tc39.es/ecma262/#sec-set.prototype.clear
3868
- clear: function clear() {
3869
- var that = this;
3870
- var state = getInternalState(that);
3871
- var data = state.index;
3872
- var entry = state.first;
3873
- while (entry) {
3874
- entry.removed = true;
3875
- if (entry.previous) entry.previous = entry.previous.next = undefined;
3876
- delete data[entry.index];
3877
- entry = entry.next;
3878
- }
3879
- state.first = state.last = undefined;
3880
- if (descriptors) state.size = 0;
3881
- else that.size = 0;
3882
- },
3883
- // `{ Map, Set }.prototype.delete(key)` methods
3884
- // https://tc39.es/ecma262/#sec-map.prototype.delete
3885
- // https://tc39.es/ecma262/#sec-set.prototype.delete
3886
- 'delete': function (key) {
3887
- var that = this;
3888
- var state = getInternalState(that);
3889
- var entry = getEntry(that, key);
3890
- if (entry) {
3891
- var next = entry.next;
3892
- var prev = entry.previous;
3893
- delete state.index[entry.index];
3894
- entry.removed = true;
3895
- if (prev) prev.next = next;
3896
- if (next) next.previous = prev;
3897
- if (state.first === entry) state.first = next;
3898
- if (state.last === entry) state.last = prev;
3899
- if (descriptors) state.size--;
3900
- else that.size--;
3901
- } return !!entry;
3902
- },
3903
- // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
3904
- // https://tc39.es/ecma262/#sec-map.prototype.foreach
3905
- // https://tc39.es/ecma262/#sec-set.prototype.foreach
3906
- forEach: function forEach(callbackfn /* , that = undefined */) {
3907
- var state = getInternalState(this);
3908
- var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3909
- var entry;
3910
- while (entry = entry ? entry.next : state.first) {
3911
- boundFunction(entry.value, entry.key, this);
3912
- // revert to the last existing entry
3913
- while (entry && entry.removed) entry = entry.previous;
3914
- }
3915
- },
3916
- // `{ Map, Set}.prototype.has(key)` methods
3917
- // https://tc39.es/ecma262/#sec-map.prototype.has
3918
- // https://tc39.es/ecma262/#sec-set.prototype.has
3919
- has: function has(key) {
3920
- return !!getEntry(this, key);
3921
- }
3922
- });
4004
+ switch (KIND) {
4005
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
4006
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
4007
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
4008
+ }
3923
4009
 
3924
- defineBuiltIns(Prototype, IS_MAP ? {
3925
- // `Map.prototype.get(key)` method
3926
- // https://tc39.es/ecma262/#sec-map.prototype.get
3927
- get: function get(key) {
3928
- var entry = getEntry(this, key);
3929
- return entry && entry.value;
3930
- },
3931
- // `Map.prototype.set(key, value)` method
3932
- // https://tc39.es/ecma262/#sec-map.prototype.set
3933
- set: function set(key, value) {
3934
- return define(this, key === 0 ? 0 : key, value);
3935
- }
3936
- } : {
3937
- // `Set.prototype.add(value)` method
3938
- // https://tc39.es/ecma262/#sec-set.prototype.add
3939
- add: function add(value) {
3940
- return define(this, value = value === 0 ? 0 : value, value);
3941
- }
3942
- });
3943
- if (descriptors) defineBuiltInAccessor(Prototype, 'size', {
3944
- configurable: true,
3945
- get: function () {
3946
- return getInternalState(this).size;
3947
- }
3948
- });
3949
- return Constructor;
3950
- },
3951
- setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
3952
- var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
3953
- var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
3954
- var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
3955
- // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
3956
- // https://tc39.es/ecma262/#sec-map.prototype.entries
3957
- // https://tc39.es/ecma262/#sec-map.prototype.keys
3958
- // https://tc39.es/ecma262/#sec-map.prototype.values
3959
- // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
3960
- // https://tc39.es/ecma262/#sec-set.prototype.entries
3961
- // https://tc39.es/ecma262/#sec-set.prototype.keys
3962
- // https://tc39.es/ecma262/#sec-set.prototype.values
3963
- // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
3964
- iteratorDefine(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
3965
- setInternalState$3(this, {
3966
- type: ITERATOR_NAME,
3967
- target: iterated,
3968
- state: getInternalCollectionState(iterated),
3969
- kind: kind,
3970
- last: undefined
3971
- });
3972
- }, function () {
3973
- var state = getInternalIteratorState(this);
3974
- var kind = state.kind;
3975
- var entry = state.last;
3976
- // revert to the last existing entry
3977
- while (entry && entry.removed) entry = entry.previous;
3978
- // get next entry
3979
- if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
3980
- // or finish the iteration
3981
- state.target = undefined;
3982
- return createIterResultObject(undefined, true);
4010
+ return function () { return new IteratorConstructor(this); };
4011
+ };
4012
+
4013
+ var TO_STRING_TAG = NAME + ' Iterator';
4014
+ var INCORRECT_VALUES_NAME = false;
4015
+ var IterablePrototype = Iterable.prototype;
4016
+ var nativeIterator = IterablePrototype[ITERATOR$7]
4017
+ || IterablePrototype['@@iterator']
4018
+ || DEFAULT && IterablePrototype[DEFAULT];
4019
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
4020
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
4021
+ var CurrentIteratorPrototype, methods, KEY;
4022
+
4023
+ // fix native
4024
+ if (anyNativeIterator) {
4025
+ CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
4026
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
4027
+ if (objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
4028
+ if (objectSetPrototypeOf) {
4029
+ objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
4030
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$7])) {
4031
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$7, returnThis);
4032
+ }
3983
4033
  }
3984
- // return step by kind
3985
- if (kind === 'keys') return createIterResultObject(entry.key, false);
3986
- if (kind === 'values') return createIterResultObject(entry.value, false);
3987
- return createIterResultObject([entry.key, entry.value], false);
3988
- }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
4034
+ // Set @@toStringTag to native iterators
4035
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
4036
+ }
4037
+ }
3989
4038
 
3990
- // `{ Map, Set }.prototype[@@species]` accessors
3991
- // https://tc39.es/ecma262/#sec-get-map-@@species
3992
- // https://tc39.es/ecma262/#sec-get-set-@@species
3993
- setSpecies(CONSTRUCTOR_NAME);
4039
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
4040
+ if (PROPER_FUNCTION_NAME$2 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
4041
+ if (CONFIGURABLE_FUNCTION_NAME) {
4042
+ createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
4043
+ } else {
4044
+ INCORRECT_VALUES_NAME = true;
4045
+ defaultIterator = function values() { return functionCall(nativeIterator, this); };
4046
+ }
3994
4047
  }
3995
- };
3996
4048
 
3997
- // `Set` constructor
3998
- // https://tc39.es/ecma262/#sec-set-objects
3999
- collection('Set', function (init) {
4000
- return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
4001
- }, collectionStrong);
4049
+ // export additional methods
4050
+ if (DEFAULT) {
4051
+ methods = {
4052
+ values: getIterationMethod(VALUES),
4053
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
4054
+ entries: getIterationMethod(ENTRIES)
4055
+ };
4056
+ if (FORCED) for (KEY in methods) {
4057
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
4058
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
4059
+ }
4060
+ } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
4061
+ }
4002
4062
 
4003
- var charAt$6 = functionUncurryThis(''.charAt);
4004
- var charCodeAt$1 = functionUncurryThis(''.charCodeAt);
4005
- var stringSlice$5 = functionUncurryThis(''.slice);
4063
+ // define iterator
4064
+ if (IterablePrototype[ITERATOR$7] !== defaultIterator) {
4065
+ defineBuiltIn(IterablePrototype, ITERATOR$7, defaultIterator, { name: DEFAULT });
4066
+ }
4067
+ iterators[NAME] = defaultIterator;
4006
4068
 
4007
- var createMethod$1 = function (CONVERT_TO_STRING) {
4008
- return function ($this, pos) {
4009
- var S = toString$2(requireObjectCoercible($this));
4010
- var position = toIntegerOrInfinity(pos);
4011
- var size = S.length;
4012
- var first, second;
4013
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
4014
- first = charCodeAt$1(S, position);
4015
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
4016
- || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
4017
- ? CONVERT_TO_STRING
4018
- ? charAt$6(S, position)
4019
- : first
4020
- : CONVERT_TO_STRING
4021
- ? stringSlice$5(S, position, position + 2)
4022
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
4023
- };
4069
+ return methods;
4024
4070
  };
4025
4071
 
4026
- var stringMultibyte = {
4027
- // `String.prototype.codePointAt` method
4028
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
4029
- codeAt: createMethod$1(false),
4030
- // `String.prototype.at` method
4031
- // https://github.com/mathiasbynens/String.prototype.at
4032
- charAt: createMethod$1(true)
4072
+ // `CreateIterResultObject` abstract operation
4073
+ // https://tc39.es/ecma262/#sec-createiterresultobject
4074
+ var createIterResultObject = function (value, done) {
4075
+ return { value: value, done: done };
4033
4076
  };
4034
4077
 
4035
- var charAt$5 = stringMultibyte.charAt;
4078
+ var defineProperty$2 = objectDefineProperty.f;
4036
4079
 
4037
4080
 
4038
4081
 
4039
4082
 
4040
4083
 
4041
- var STRING_ITERATOR = 'String Iterator';
4042
- var setInternalState$2 = internalState.set;
4043
- var getInternalState$1 = internalState.getterFor(STRING_ITERATOR);
4084
+ var ARRAY_ITERATOR = 'Array Iterator';
4085
+ var setInternalState$4 = internalState.set;
4086
+ var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
4044
4087
 
4045
- // `String.prototype[@@iterator]` method
4046
- // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
4047
- iteratorDefine(String, 'String', function (iterated) {
4048
- setInternalState$2(this, {
4049
- type: STRING_ITERATOR,
4050
- string: toString$2(iterated),
4051
- index: 0
4088
+ // `Array.prototype.entries` method
4089
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
4090
+ // `Array.prototype.keys` method
4091
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
4092
+ // `Array.prototype.values` method
4093
+ // https://tc39.es/ecma262/#sec-array.prototype.values
4094
+ // `Array.prototype[@@iterator]` method
4095
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
4096
+ // `CreateArrayIterator` internal method
4097
+ // https://tc39.es/ecma262/#sec-createarrayiterator
4098
+ var es_array_iterator = iteratorDefine(Array, 'Array', function (iterated, kind) {
4099
+ setInternalState$4(this, {
4100
+ type: ARRAY_ITERATOR,
4101
+ target: toIndexedObject(iterated), // target
4102
+ index: 0, // next index
4103
+ kind: kind // kind
4052
4104
  });
4053
- // `%StringIteratorPrototype%.next` method
4054
- // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
4055
- }, function next() {
4105
+ // `%ArrayIteratorPrototype%.next` method
4106
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
4107
+ }, function () {
4056
4108
  var state = getInternalState$1(this);
4057
- var string = state.string;
4058
- var index = state.index;
4059
- var point;
4060
- if (index >= string.length) return createIterResultObject(undefined, true);
4061
- point = charAt$5(string, index);
4062
- state.index += point.length;
4063
- return createIterResultObject(point, false);
4109
+ var target = state.target;
4110
+ var index = state.index++;
4111
+ if (!target || index >= target.length) {
4112
+ state.target = undefined;
4113
+ return createIterResultObject(undefined, true);
4114
+ }
4115
+ switch (state.kind) {
4116
+ case 'keys': return createIterResultObject(index, false);
4117
+ case 'values': return createIterResultObject(target[index], false);
4118
+ } return createIterResultObject([index, target[index]], false);
4119
+ }, 'values');
4120
+
4121
+ // argumentsList[@@iterator] is %ArrayProto_values%
4122
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
4123
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
4124
+ var values = iterators.Arguments = iterators.Array;
4125
+
4126
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
4127
+ addToUnscopables('keys');
4128
+ addToUnscopables('values');
4129
+ addToUnscopables('entries');
4130
+
4131
+ // V8 ~ Chrome 45- bug
4132
+ if (descriptors && values.name !== 'values') try {
4133
+ defineProperty$2(values, 'name', { value: 'values' });
4134
+ } catch (error) { /* empty */ }
4135
+
4136
+ // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
4137
+
4138
+
4139
+ var arrayBufferNonExtensible = fails(function () {
4140
+ if (typeof ArrayBuffer == 'function') {
4141
+ var buffer = new ArrayBuffer(8);
4142
+ // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
4143
+ if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
4144
+ }
4064
4145
  });
4065
4146
 
4066
- // iterable DOM collections
4067
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
4068
- var domIterables = {
4069
- CSSRuleList: 0,
4070
- CSSStyleDeclaration: 0,
4071
- CSSValueList: 0,
4072
- ClientRectList: 0,
4073
- DOMRectList: 0,
4074
- DOMStringList: 0,
4075
- DOMTokenList: 1,
4076
- DataTransferItemList: 0,
4077
- FileList: 0,
4078
- HTMLAllCollection: 0,
4079
- HTMLCollection: 0,
4080
- HTMLFormElement: 0,
4081
- HTMLSelectElement: 0,
4082
- MediaList: 0,
4083
- MimeTypeArray: 0,
4084
- NamedNodeMap: 0,
4085
- NodeList: 1,
4086
- PaintRequestList: 0,
4087
- Plugin: 0,
4088
- PluginArray: 0,
4089
- SVGLengthList: 0,
4090
- SVGNumberList: 0,
4091
- SVGPathSegList: 0,
4092
- SVGPointList: 0,
4093
- SVGStringList: 0,
4094
- SVGTransformList: 0,
4095
- SourceBufferList: 0,
4096
- StyleSheetList: 0,
4097
- TextTrackCueList: 0,
4098
- TextTrackList: 0,
4099
- TouchList: 0
4147
+ // eslint-disable-next-line es/no-object-isextensible -- safe
4148
+ var $isExtensible = Object.isExtensible;
4149
+ var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
4150
+
4151
+ // `Object.isExtensible` method
4152
+ // https://tc39.es/ecma262/#sec-object.isextensible
4153
+ var objectIsExtensible = (FAILS_ON_PRIMITIVES || arrayBufferNonExtensible) ? function isExtensible(it) {
4154
+ if (!isObject(it)) return false;
4155
+ if (arrayBufferNonExtensible && classofRaw(it) === 'ArrayBuffer') return false;
4156
+ return $isExtensible ? $isExtensible(it) : true;
4157
+ } : $isExtensible;
4158
+
4159
+ var freezing = !fails(function () {
4160
+ // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
4161
+ return Object.isExtensible(Object.preventExtensions({}));
4162
+ });
4163
+
4164
+ var internalMetadata = createCommonjsModule(function (module) {
4165
+
4166
+
4167
+
4168
+
4169
+
4170
+ var defineProperty = objectDefineProperty.f;
4171
+
4172
+
4173
+
4174
+
4175
+
4176
+
4177
+ var REQUIRED = false;
4178
+ var METADATA = uid('meta');
4179
+ var id = 0;
4180
+
4181
+ var setMetadata = function (it) {
4182
+ defineProperty(it, METADATA, { value: {
4183
+ objectID: 'O' + id++, // object ID
4184
+ weakData: {} // weak collections IDs
4185
+ } });
4100
4186
  };
4101
4187
 
4102
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
4188
+ var fastKey = function (it, create) {
4189
+ // return a primitive with prefix
4190
+ if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
4191
+ if (!hasOwnProperty_1(it, METADATA)) {
4192
+ // can't set metadata to uncaught frozen object
4193
+ if (!objectIsExtensible(it)) return 'F';
4194
+ // not necessary to add metadata
4195
+ if (!create) return 'E';
4196
+ // add missing metadata
4197
+ setMetadata(it);
4198
+ // return object ID
4199
+ } return it[METADATA].objectID;
4200
+ };
4103
4201
 
4202
+ var getWeakData = function (it, create) {
4203
+ if (!hasOwnProperty_1(it, METADATA)) {
4204
+ // can't set metadata to uncaught frozen object
4205
+ if (!objectIsExtensible(it)) return true;
4206
+ // not necessary to add metadata
4207
+ if (!create) return false;
4208
+ // add missing metadata
4209
+ setMetadata(it);
4210
+ // return the store of weak collections IDs
4211
+ } return it[METADATA].weakData;
4212
+ };
4104
4213
 
4105
- var classList = documentCreateElement('span').classList;
4106
- var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
4214
+ // add metadata on freeze-family methods calling
4215
+ var onFreeze = function (it) {
4216
+ if (freezing && REQUIRED && objectIsExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
4217
+ return it;
4218
+ };
4107
4219
 
4108
- var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
4220
+ var enable = function () {
4221
+ meta.enable = function () { /* empty */ };
4222
+ REQUIRED = true;
4223
+ var getOwnPropertyNames = objectGetOwnPropertyNames.f;
4224
+ var splice = functionUncurryThis([].splice);
4225
+ var test = {};
4226
+ test[METADATA] = 1;
4109
4227
 
4110
- var ITERATOR$3 = wellKnownSymbol('iterator');
4111
- var ArrayValues = es_array_iterator.values;
4228
+ // prevent exposing of metadata key
4229
+ if (getOwnPropertyNames(test).length) {
4230
+ objectGetOwnPropertyNames.f = function (it) {
4231
+ var result = getOwnPropertyNames(it);
4232
+ for (var i = 0, length = result.length; i < length; i++) {
4233
+ if (result[i] === METADATA) {
4234
+ splice(result, i, 1);
4235
+ break;
4236
+ }
4237
+ } return result;
4238
+ };
4112
4239
 
4113
- var handlePrototype$1 = function (CollectionPrototype, COLLECTION_NAME) {
4114
- if (CollectionPrototype) {
4115
- // some Chrome versions have non-configurable methods on DOMTokenList
4116
- if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
4117
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$3, ArrayValues);
4118
- } catch (error) {
4119
- CollectionPrototype[ITERATOR$3] = ArrayValues;
4120
- }
4121
- setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
4122
- if (domIterables[COLLECTION_NAME]) for (var METHOD_NAME in es_array_iterator) {
4123
- // some Chrome versions have non-configurable methods on DOMTokenList
4124
- if (CollectionPrototype[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
4125
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, es_array_iterator[METHOD_NAME]);
4126
- } catch (error) {
4127
- CollectionPrototype[METHOD_NAME] = es_array_iterator[METHOD_NAME];
4128
- }
4129
- }
4240
+ _export({ target: 'Object', stat: true, forced: true }, {
4241
+ getOwnPropertyNames: objectGetOwnPropertyNamesExternal.f
4242
+ });
4130
4243
  }
4131
4244
  };
4132
4245
 
4133
- for (var COLLECTION_NAME$1 in domIterables) {
4134
- handlePrototype$1(global$1[COLLECTION_NAME$1] && global$1[COLLECTION_NAME$1].prototype, COLLECTION_NAME$1);
4135
- }
4136
-
4137
- handlePrototype$1(domTokenListPrototype, 'DOMTokenList');
4138
-
4139
- var $forEach = arrayIteration.forEach;
4246
+ var meta = module.exports = {
4247
+ enable: enable,
4248
+ fastKey: fastKey,
4249
+ getWeakData: getWeakData,
4250
+ onFreeze: onFreeze
4251
+ };
4140
4252
 
4253
+ hiddenKeys$1[METADATA] = true;
4254
+ });
4141
4255
 
4142
- var STRICT_METHOD$2 = arrayMethodIsStrict('forEach');
4256
+ var ITERATOR$6 = wellKnownSymbol('iterator');
4257
+ var ArrayPrototype = Array.prototype;
4143
4258
 
4144
- // `Array.prototype.forEach` method implementation
4145
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
4146
- var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
4147
- return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
4148
- // eslint-disable-next-line es/no-array-prototype-foreach -- safe
4149
- } : [].forEach;
4259
+ // check on default Array iterator
4260
+ var isArrayIteratorMethod = function (it) {
4261
+ return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$6] === it);
4262
+ };
4150
4263
 
4151
- // `Array.prototype.forEach` method
4152
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
4153
- // eslint-disable-next-line es/no-array-prototype-foreach -- safe
4154
- _export({ target: 'Array', proto: true, forced: [].forEach !== arrayForEach }, {
4155
- forEach: arrayForEach
4156
- });
4264
+ var ITERATOR$5 = wellKnownSymbol('iterator');
4157
4265
 
4158
- var handlePrototype = function (CollectionPrototype) {
4159
- // some Chrome versions have non-configurable methods on DOMTokenList
4160
- if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
4161
- createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
4162
- } catch (error) {
4163
- CollectionPrototype.forEach = arrayForEach;
4164
- }
4266
+ var getIteratorMethod = function (it) {
4267
+ if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR$5)
4268
+ || getMethod(it, '@@iterator')
4269
+ || iterators[classof(it)];
4165
4270
  };
4166
4271
 
4167
- for (var COLLECTION_NAME in domIterables) {
4168
- if (domIterables[COLLECTION_NAME]) {
4169
- handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype);
4170
- }
4171
- }
4172
-
4173
- handlePrototype(domTokenListPrototype);
4272
+ var $TypeError$4 = TypeError;
4174
4273
 
4175
- // `Map` constructor
4176
- // https://tc39.es/ecma262/#sec-map-objects
4177
- collection('Map', function (init) {
4178
- return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
4179
- }, collectionStrong);
4274
+ var getIterator = function (argument, usingIterator) {
4275
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
4276
+ if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
4277
+ throw new $TypeError$4(tryToString(argument) + ' is not iterable');
4278
+ };
4180
4279
 
4181
- // call something on iterator step with safe closing on error
4182
- var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
4280
+ var iteratorClose = function (iterator, kind, value) {
4281
+ var innerResult, innerError;
4282
+ anObject(iterator);
4183
4283
  try {
4184
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
4284
+ innerResult = getMethod(iterator, 'return');
4285
+ if (!innerResult) {
4286
+ if (kind === 'throw') throw value;
4287
+ return value;
4288
+ }
4289
+ innerResult = functionCall(innerResult, iterator);
4185
4290
  } catch (error) {
4186
- iteratorClose(iterator, 'throw', error);
4291
+ innerError = true;
4292
+ innerResult = error;
4187
4293
  }
4294
+ if (kind === 'throw') throw value;
4295
+ if (innerError) throw innerResult;
4296
+ anObject(innerResult);
4297
+ return value;
4188
4298
  };
4189
4299
 
4190
- var $Array$1 = Array;
4300
+ var $TypeError$3 = TypeError;
4191
4301
 
4192
- // `Array.from` method implementation
4193
- // https://tc39.es/ecma262/#sec-array.from
4194
- var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
4195
- var O = toObject(arrayLike);
4196
- var IS_CONSTRUCTOR = isConstructor(this);
4197
- var argumentsLength = arguments.length;
4198
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
4199
- var mapping = mapfn !== undefined;
4200
- if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
4201
- var iteratorMethod = getIteratorMethod(O);
4202
- var index = 0;
4203
- var length, result, step, iterator, next, value;
4204
- // if the target is not iterable or it's an array with the default iterator - use a simple case
4205
- if (iteratorMethod && !(this === $Array$1 && isArrayIteratorMethod(iteratorMethod))) {
4206
- iterator = getIterator(O, iteratorMethod);
4207
- next = iterator.next;
4208
- result = IS_CONSTRUCTOR ? new this() : [];
4209
- for (;!(step = functionCall(next, iterator)).done; index++) {
4210
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
4211
- createProperty(result, index, value);
4212
- }
4213
- } else {
4214
- length = lengthOfArrayLike(O);
4215
- result = IS_CONSTRUCTOR ? new this(length) : $Array$1(length);
4216
- for (;length > index; index++) {
4217
- value = mapping ? mapfn(O[index], index) : O[index];
4218
- createProperty(result, index, value);
4219
- }
4220
- }
4221
- result.length = index;
4222
- return result;
4302
+ var Result = function (stopped, result) {
4303
+ this.stopped = stopped;
4304
+ this.result = result;
4223
4305
  };
4224
4306
 
4225
- var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
4226
- // eslint-disable-next-line es/no-array-from -- required for testing
4227
- Array.from(iterable);
4228
- });
4229
-
4230
- // `Array.from` method
4231
- // https://tc39.es/ecma262/#sec-array.from
4232
- _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
4233
- from: arrayFrom
4234
- });
4235
-
4236
- var MATCH$2 = wellKnownSymbol('match');
4307
+ var ResultPrototype = Result.prototype;
4237
4308
 
4238
- // `IsRegExp` abstract operation
4239
- // https://tc39.es/ecma262/#sec-isregexp
4240
- var isRegexp = function (it) {
4241
- var isRegExp;
4242
- return isObject(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classofRaw(it) === 'RegExp');
4243
- };
4309
+ var iterate = function (iterable, unboundFunction, options) {
4310
+ var that = options && options.that;
4311
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
4312
+ var IS_RECORD = !!(options && options.IS_RECORD);
4313
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
4314
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
4315
+ var fn = functionBindContext(unboundFunction, that);
4316
+ var iterator, iterFn, index, length, result, next, step;
4244
4317
 
4245
- var $TypeError$3 = TypeError;
4318
+ var stop = function (condition) {
4319
+ if (iterator) iteratorClose(iterator, 'normal', condition);
4320
+ return new Result(true, condition);
4321
+ };
4246
4322
 
4247
- var notARegexp = function (it) {
4248
- if (isRegexp(it)) {
4249
- throw new $TypeError$3("The method doesn't accept regular expressions");
4250
- } return it;
4251
- };
4323
+ var callFn = function (value) {
4324
+ if (AS_ENTRIES) {
4325
+ anObject(value);
4326
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
4327
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
4328
+ };
4252
4329
 
4253
- var MATCH$1 = wellKnownSymbol('match');
4330
+ if (IS_RECORD) {
4331
+ iterator = iterable.iterator;
4332
+ } else if (IS_ITERATOR) {
4333
+ iterator = iterable;
4334
+ } else {
4335
+ iterFn = getIteratorMethod(iterable);
4336
+ if (!iterFn) throw new $TypeError$3(tryToString(iterable) + ' is not iterable');
4337
+ // optimisation for array iterators
4338
+ if (isArrayIteratorMethod(iterFn)) {
4339
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
4340
+ result = callFn(iterable[index]);
4341
+ if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
4342
+ } return new Result(false);
4343
+ }
4344
+ iterator = getIterator(iterable, iterFn);
4345
+ }
4254
4346
 
4255
- var correctIsRegexpLogic = function (METHOD_NAME) {
4256
- var regexp = /./;
4257
- try {
4258
- '/./'[METHOD_NAME](regexp);
4259
- } catch (error1) {
4347
+ next = IS_RECORD ? iterable.next : iterator.next;
4348
+ while (!(step = functionCall(next, iterator)).done) {
4260
4349
  try {
4261
- regexp[MATCH$1] = false;
4262
- return '/./'[METHOD_NAME](regexp);
4263
- } catch (error2) { /* empty */ }
4264
- } return false;
4350
+ result = callFn(step.value);
4351
+ } catch (error) {
4352
+ iteratorClose(iterator, 'throw', error);
4353
+ }
4354
+ if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
4355
+ } return new Result(false);
4265
4356
  };
4266
4357
 
4267
- var stringIndexOf$1 = functionUncurryThis(''.indexOf);
4358
+ var $TypeError$2 = TypeError;
4268
4359
 
4269
- // `String.prototype.includes` method
4270
- // https://tc39.es/ecma262/#sec-string.prototype.includes
4271
- _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
4272
- includes: function includes(searchString /* , position = 0 */) {
4273
- return !!~stringIndexOf$1(
4274
- toString$2(requireObjectCoercible(this)),
4275
- toString$2(notARegexp(searchString)),
4276
- arguments.length > 1 ? arguments[1] : undefined
4277
- );
4278
- }
4279
- });
4360
+ var anInstance = function (it, Prototype) {
4361
+ if (objectIsPrototypeOf(Prototype, it)) return it;
4362
+ throw new $TypeError$2('Incorrect invocation');
4363
+ };
4280
4364
 
4281
- var $values = objectToArray.values;
4365
+ var ITERATOR$4 = wellKnownSymbol('iterator');
4366
+ var SAFE_CLOSING = false;
4282
4367
 
4283
- // `Object.values` method
4284
- // https://tc39.es/ecma262/#sec-object.values
4285
- _export({ target: 'Object', stat: true }, {
4286
- values: function values(O) {
4287
- return $values(O);
4288
- }
4289
- });
4368
+ try {
4369
+ var called = 0;
4370
+ var iteratorWithReturn = {
4371
+ next: function () {
4372
+ return { done: !!called++ };
4373
+ },
4374
+ 'return': function () {
4375
+ SAFE_CLOSING = true;
4376
+ }
4377
+ };
4378
+ iteratorWithReturn[ITERATOR$4] = function () {
4379
+ return this;
4380
+ };
4381
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
4382
+ Array.from(iteratorWithReturn, function () { throw 2; });
4383
+ } catch (error) { /* empty */ }
4290
4384
 
4291
- // `RegExp.prototype.flags` getter implementation
4292
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
4293
- var regexpFlags = function () {
4294
- var that = anObject(this);
4295
- var result = '';
4296
- if (that.hasIndices) result += 'd';
4297
- if (that.global) result += 'g';
4298
- if (that.ignoreCase) result += 'i';
4299
- if (that.multiline) result += 'm';
4300
- if (that.dotAll) result += 's';
4301
- if (that.unicode) result += 'u';
4302
- if (that.unicodeSets) result += 'v';
4303
- if (that.sticky) result += 'y';
4304
- return result;
4385
+ var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
4386
+ try {
4387
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
4388
+ } catch (error) { return false; } // workaround of old WebKit + `eval` bug
4389
+ var ITERATION_SUPPORT = false;
4390
+ try {
4391
+ var object = {};
4392
+ object[ITERATOR$4] = function () {
4393
+ return {
4394
+ next: function () {
4395
+ return { done: ITERATION_SUPPORT = true };
4396
+ }
4397
+ };
4398
+ };
4399
+ exec(object);
4400
+ } catch (error) { /* empty */ }
4401
+ return ITERATION_SUPPORT;
4305
4402
  };
4306
4403
 
4307
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
4308
- var $RegExp$2 = global$1.RegExp;
4309
-
4310
- var UNSUPPORTED_Y$3 = fails(function () {
4311
- var re = $RegExp$2('a', 'y');
4312
- re.lastIndex = 2;
4313
- return re.exec('abcd') !== null;
4314
- });
4315
-
4316
- // UC Browser bug
4317
- // https://github.com/zloirock/core-js/issues/1008
4318
- var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails(function () {
4319
- return !$RegExp$2('a', 'y').sticky;
4320
- });
4404
+ // makes subclassing work correct for wrapped built-ins
4405
+ var inheritIfRequired = function ($this, dummy, Wrapper) {
4406
+ var NewTarget, NewTargetPrototype;
4407
+ if (
4408
+ // it can work only with native `setPrototypeOf`
4409
+ objectSetPrototypeOf &&
4410
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
4411
+ isCallable(NewTarget = dummy.constructor) &&
4412
+ NewTarget !== Wrapper &&
4413
+ isObject(NewTargetPrototype = NewTarget.prototype) &&
4414
+ NewTargetPrototype !== Wrapper.prototype
4415
+ ) objectSetPrototypeOf($this, NewTargetPrototype);
4416
+ return $this;
4417
+ };
4321
4418
 
4322
- var BROKEN_CARET = UNSUPPORTED_Y$3 || fails(function () {
4323
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
4324
- var re = $RegExp$2('^r', 'gy');
4325
- re.lastIndex = 2;
4326
- return re.exec('str') !== null;
4327
- });
4419
+ var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
4420
+ var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
4421
+ var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
4422
+ var ADDER = IS_MAP ? 'set' : 'add';
4423
+ var NativeConstructor = global$1[CONSTRUCTOR_NAME];
4424
+ var NativePrototype = NativeConstructor && NativeConstructor.prototype;
4425
+ var Constructor = NativeConstructor;
4426
+ var exported = {};
4328
4427
 
4329
- var regexpStickyHelpers = {
4330
- BROKEN_CARET: BROKEN_CARET,
4331
- MISSED_STICKY: MISSED_STICKY$1,
4332
- UNSUPPORTED_Y: UNSUPPORTED_Y$3
4333
- };
4428
+ var fixMethod = function (KEY) {
4429
+ var uncurriedNativeMethod = functionUncurryThis(NativePrototype[KEY]);
4430
+ defineBuiltIn(NativePrototype, KEY,
4431
+ KEY === 'add' ? function add(value) {
4432
+ uncurriedNativeMethod(this, value === 0 ? 0 : value);
4433
+ return this;
4434
+ } : KEY === 'delete' ? function (key) {
4435
+ return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
4436
+ } : KEY === 'get' ? function get(key) {
4437
+ return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
4438
+ } : KEY === 'has' ? function has(key) {
4439
+ return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
4440
+ } : function set(key, value) {
4441
+ uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
4442
+ return this;
4443
+ }
4444
+ );
4445
+ };
4334
4446
 
4335
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
4336
- var $RegExp$1 = global$1.RegExp;
4447
+ var REPLACE = isForced_1(
4448
+ CONSTRUCTOR_NAME,
4449
+ !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
4450
+ new NativeConstructor().entries().next();
4451
+ }))
4452
+ );
4337
4453
 
4338
- var regexpUnsupportedDotAll = fails(function () {
4339
- var re = $RegExp$1('.', 's');
4340
- return !(re.dotAll && re.test('\n') && re.flags === 's');
4341
- });
4454
+ if (REPLACE) {
4455
+ // create collection constructor
4456
+ Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
4457
+ internalMetadata.enable();
4458
+ } else if (isForced_1(CONSTRUCTOR_NAME, true)) {
4459
+ var instance = new Constructor();
4460
+ // early implementations not supports chaining
4461
+ var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
4462
+ // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
4463
+ var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
4464
+ // most early implementations doesn't supports iterables, most modern - not close it correctly
4465
+ // eslint-disable-next-line no-new -- required for testing
4466
+ var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
4467
+ // for early implementations -0 and +0 not the same
4468
+ var BUGGY_ZERO = !IS_WEAK && fails(function () {
4469
+ // V8 ~ Chromium 42- fails only with 5+ elements
4470
+ var $instance = new NativeConstructor();
4471
+ var index = 5;
4472
+ while (index--) $instance[ADDER](index, index);
4473
+ return !$instance.has(-0);
4474
+ });
4342
4475
 
4343
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
4344
- var $RegExp = global$1.RegExp;
4476
+ if (!ACCEPT_ITERABLES) {
4477
+ Constructor = wrapper(function (dummy, iterable) {
4478
+ anInstance(dummy, NativePrototype);
4479
+ var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
4480
+ if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
4481
+ return that;
4482
+ });
4483
+ Constructor.prototype = NativePrototype;
4484
+ NativePrototype.constructor = Constructor;
4485
+ }
4345
4486
 
4346
- var regexpUnsupportedNcg = fails(function () {
4347
- var re = $RegExp('(?<a>b)', 'g');
4348
- return re.exec('b').groups.a !== 'b' ||
4349
- 'b'.replace(re, '$<a>c') !== 'bc';
4350
- });
4487
+ if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
4488
+ fixMethod('delete');
4489
+ fixMethod('has');
4490
+ IS_MAP && fixMethod('get');
4491
+ }
4351
4492
 
4352
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
4353
- /* eslint-disable regexp/no-useless-quantifier -- testing */
4493
+ if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
4354
4494
 
4495
+ // weak collections should not contains .clear method
4496
+ if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
4497
+ }
4355
4498
 
4499
+ exported[CONSTRUCTOR_NAME] = Constructor;
4500
+ _export({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);
4356
4501
 
4502
+ setToStringTag(Constructor, CONSTRUCTOR_NAME);
4357
4503
 
4504
+ if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
4358
4505
 
4506
+ return Constructor;
4507
+ };
4359
4508
 
4509
+ var defineBuiltIns = function (target, src, options) {
4510
+ for (var key in src) defineBuiltIn(target, key, src[key], options);
4511
+ return target;
4512
+ };
4360
4513
 
4361
- var getInternalState = internalState.get;
4514
+ var SPECIES$1 = wellKnownSymbol('species');
4362
4515
 
4516
+ var setSpecies = function (CONSTRUCTOR_NAME) {
4517
+ var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
4363
4518
 
4519
+ if (descriptors && Constructor && !Constructor[SPECIES$1]) {
4520
+ defineBuiltInAccessor(Constructor, SPECIES$1, {
4521
+ configurable: true,
4522
+ get: function () { return this; }
4523
+ });
4524
+ }
4525
+ };
4364
4526
 
4365
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
4366
- var nativeExec = RegExp.prototype.exec;
4367
- var patchedExec = nativeExec;
4368
- var charAt$4 = functionUncurryThis(''.charAt);
4369
- var indexOf = functionUncurryThis(''.indexOf);
4370
- var replace$3 = functionUncurryThis(''.replace);
4371
- var stringSlice$4 = functionUncurryThis(''.slice);
4527
+ var fastKey = internalMetadata.fastKey;
4372
4528
 
4373
- var UPDATES_LAST_INDEX_WRONG = (function () {
4374
- var re1 = /a/;
4375
- var re2 = /b*/g;
4376
- functionCall(nativeExec, re1, 'a');
4377
- functionCall(nativeExec, re2, 'a');
4378
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
4379
- })();
4380
4529
 
4381
- var UNSUPPORTED_Y$2 = regexpStickyHelpers.BROKEN_CARET;
4530
+ var setInternalState$3 = internalState.set;
4531
+ var internalStateGetterFor = internalState.getterFor;
4382
4532
 
4383
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
4384
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
4533
+ var collectionStrong = {
4534
+ getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
4535
+ var Constructor = wrapper(function (that, iterable) {
4536
+ anInstance(that, Prototype);
4537
+ setInternalState$3(that, {
4538
+ type: CONSTRUCTOR_NAME,
4539
+ index: objectCreate(null),
4540
+ first: undefined,
4541
+ last: undefined,
4542
+ size: 0
4543
+ });
4544
+ if (!descriptors) that.size = 0;
4545
+ if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
4546
+ });
4385
4547
 
4386
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2 || regexpUnsupportedDotAll || regexpUnsupportedNcg;
4548
+ var Prototype = Constructor.prototype;
4387
4549
 
4388
- if (PATCH) {
4389
- patchedExec = function exec(string) {
4390
- var re = this;
4391
- var state = getInternalState(re);
4392
- var str = toString$2(string);
4393
- var raw = state.raw;
4394
- var result, reCopy, lastIndex, match, i, object, group;
4550
+ var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
4395
4551
 
4396
- if (raw) {
4397
- raw.lastIndex = re.lastIndex;
4398
- result = functionCall(patchedExec, raw, str);
4399
- re.lastIndex = raw.lastIndex;
4400
- return result;
4401
- }
4552
+ var define = function (that, key, value) {
4553
+ var state = getInternalState(that);
4554
+ var entry = getEntry(that, key);
4555
+ var previous, index;
4556
+ // change existing entry
4557
+ if (entry) {
4558
+ entry.value = value;
4559
+ // create new entry
4560
+ } else {
4561
+ state.last = entry = {
4562
+ index: index = fastKey(key, true),
4563
+ key: key,
4564
+ value: value,
4565
+ previous: previous = state.last,
4566
+ next: undefined,
4567
+ removed: false
4568
+ };
4569
+ if (!state.first) state.first = entry;
4570
+ if (previous) previous.next = entry;
4571
+ if (descriptors) state.size++;
4572
+ else that.size++;
4573
+ // add to index
4574
+ if (index !== 'F') state.index[index] = entry;
4575
+ } return that;
4576
+ };
4402
4577
 
4403
- var groups = state.groups;
4404
- var sticky = UNSUPPORTED_Y$2 && re.sticky;
4405
- var flags = functionCall(regexpFlags, re);
4406
- var source = re.source;
4407
- var charsAdded = 0;
4408
- var strCopy = str;
4578
+ var getEntry = function (that, key) {
4579
+ var state = getInternalState(that);
4580
+ // fast case
4581
+ var index = fastKey(key);
4582
+ var entry;
4583
+ if (index !== 'F') return state.index[index];
4584
+ // frozen object case
4585
+ for (entry = state.first; entry; entry = entry.next) {
4586
+ if (entry.key === key) return entry;
4587
+ }
4588
+ };
4409
4589
 
4410
- if (sticky) {
4411
- flags = replace$3(flags, 'y', '');
4412
- if (indexOf(flags, 'g') === -1) {
4413
- flags += 'g';
4590
+ defineBuiltIns(Prototype, {
4591
+ // `{ Map, Set }.prototype.clear()` methods
4592
+ // https://tc39.es/ecma262/#sec-map.prototype.clear
4593
+ // https://tc39.es/ecma262/#sec-set.prototype.clear
4594
+ clear: function clear() {
4595
+ var that = this;
4596
+ var state = getInternalState(that);
4597
+ var data = state.index;
4598
+ var entry = state.first;
4599
+ while (entry) {
4600
+ entry.removed = true;
4601
+ if (entry.previous) entry.previous = entry.previous.next = undefined;
4602
+ delete data[entry.index];
4603
+ entry = entry.next;
4604
+ }
4605
+ state.first = state.last = undefined;
4606
+ if (descriptors) state.size = 0;
4607
+ else that.size = 0;
4608
+ },
4609
+ // `{ Map, Set }.prototype.delete(key)` methods
4610
+ // https://tc39.es/ecma262/#sec-map.prototype.delete
4611
+ // https://tc39.es/ecma262/#sec-set.prototype.delete
4612
+ 'delete': function (key) {
4613
+ var that = this;
4614
+ var state = getInternalState(that);
4615
+ var entry = getEntry(that, key);
4616
+ if (entry) {
4617
+ var next = entry.next;
4618
+ var prev = entry.previous;
4619
+ delete state.index[entry.index];
4620
+ entry.removed = true;
4621
+ if (prev) prev.next = next;
4622
+ if (next) next.previous = prev;
4623
+ if (state.first === entry) state.first = next;
4624
+ if (state.last === entry) state.last = prev;
4625
+ if (descriptors) state.size--;
4626
+ else that.size--;
4627
+ } return !!entry;
4628
+ },
4629
+ // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
4630
+ // https://tc39.es/ecma262/#sec-map.prototype.foreach
4631
+ // https://tc39.es/ecma262/#sec-set.prototype.foreach
4632
+ forEach: function forEach(callbackfn /* , that = undefined */) {
4633
+ var state = getInternalState(this);
4634
+ var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
4635
+ var entry;
4636
+ while (entry = entry ? entry.next : state.first) {
4637
+ boundFunction(entry.value, entry.key, this);
4638
+ // revert to the last existing entry
4639
+ while (entry && entry.removed) entry = entry.previous;
4640
+ }
4641
+ },
4642
+ // `{ Map, Set}.prototype.has(key)` methods
4643
+ // https://tc39.es/ecma262/#sec-map.prototype.has
4644
+ // https://tc39.es/ecma262/#sec-set.prototype.has
4645
+ has: function has(key) {
4646
+ return !!getEntry(this, key);
4414
4647
  }
4648
+ });
4415
4649
 
4416
- strCopy = stringSlice$4(str, re.lastIndex);
4417
- // Support anchored sticky behavior.
4418
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
4419
- source = '(?: ' + source + ')';
4420
- strCopy = ' ' + strCopy;
4421
- charsAdded++;
4650
+ defineBuiltIns(Prototype, IS_MAP ? {
4651
+ // `Map.prototype.get(key)` method
4652
+ // https://tc39.es/ecma262/#sec-map.prototype.get
4653
+ get: function get(key) {
4654
+ var entry = getEntry(this, key);
4655
+ return entry && entry.value;
4656
+ },
4657
+ // `Map.prototype.set(key, value)` method
4658
+ // https://tc39.es/ecma262/#sec-map.prototype.set
4659
+ set: function set(key, value) {
4660
+ return define(this, key === 0 ? 0 : key, value);
4422
4661
  }
4423
- // ^(? + rx + ) is needed, in combination with some str slicing, to
4424
- // simulate the 'y' flag.
4425
- reCopy = new RegExp('^(?:' + source + ')', flags);
4426
- }
4427
-
4428
- if (NPCG_INCLUDED) {
4429
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
4430
- }
4431
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
4432
-
4433
- match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
4434
-
4435
- if (sticky) {
4436
- if (match) {
4437
- match.input = stringSlice$4(match.input, charsAdded);
4438
- match[0] = stringSlice$4(match[0], charsAdded);
4439
- match.index = re.lastIndex;
4440
- re.lastIndex += match[0].length;
4441
- } else re.lastIndex = 0;
4442
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
4443
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
4444
- }
4445
- if (NPCG_INCLUDED && match && match.length > 1) {
4446
- // Fix browsers whose `exec` methods don't consistently return `undefined`
4447
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
4448
- functionCall(nativeReplace, match[0], reCopy, function () {
4449
- for (i = 1; i < arguments.length - 2; i++) {
4450
- if (arguments[i] === undefined) match[i] = undefined;
4451
- }
4662
+ } : {
4663
+ // `Set.prototype.add(value)` method
4664
+ // https://tc39.es/ecma262/#sec-set.prototype.add
4665
+ add: function add(value) {
4666
+ return define(this, value = value === 0 ? 0 : value, value);
4667
+ }
4668
+ });
4669
+ if (descriptors) defineBuiltInAccessor(Prototype, 'size', {
4670
+ configurable: true,
4671
+ get: function () {
4672
+ return getInternalState(this).size;
4673
+ }
4674
+ });
4675
+ return Constructor;
4676
+ },
4677
+ setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
4678
+ var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
4679
+ var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
4680
+ var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
4681
+ // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
4682
+ // https://tc39.es/ecma262/#sec-map.prototype.entries
4683
+ // https://tc39.es/ecma262/#sec-map.prototype.keys
4684
+ // https://tc39.es/ecma262/#sec-map.prototype.values
4685
+ // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
4686
+ // https://tc39.es/ecma262/#sec-set.prototype.entries
4687
+ // https://tc39.es/ecma262/#sec-set.prototype.keys
4688
+ // https://tc39.es/ecma262/#sec-set.prototype.values
4689
+ // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
4690
+ iteratorDefine(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
4691
+ setInternalState$3(this, {
4692
+ type: ITERATOR_NAME,
4693
+ target: iterated,
4694
+ state: getInternalCollectionState(iterated),
4695
+ kind: kind,
4696
+ last: undefined
4452
4697
  });
4453
- }
4454
-
4455
- if (match && groups) {
4456
- match.groups = object = objectCreate(null);
4457
- for (i = 0; i < groups.length; i++) {
4458
- group = groups[i];
4459
- object[group[0]] = match[group[1]];
4698
+ }, function () {
4699
+ var state = getInternalIteratorState(this);
4700
+ var kind = state.kind;
4701
+ var entry = state.last;
4702
+ // revert to the last existing entry
4703
+ while (entry && entry.removed) entry = entry.previous;
4704
+ // get next entry
4705
+ if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
4706
+ // or finish the iteration
4707
+ state.target = undefined;
4708
+ return createIterResultObject(undefined, true);
4460
4709
  }
4461
- }
4462
-
4463
- return match;
4464
- };
4465
- }
4466
-
4467
- var regexpExec = patchedExec;
4468
-
4469
- // `RegExp.prototype.exec` method
4470
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
4471
- _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
4472
- exec: regexpExec
4473
- });
4474
-
4475
- // TODO: Remove from `core-js@4` since it's moved to entry points
4476
-
4710
+ // return step by kind
4711
+ if (kind === 'keys') return createIterResultObject(entry.key, false);
4712
+ if (kind === 'values') return createIterResultObject(entry.value, false);
4713
+ return createIterResultObject([entry.key, entry.value], false);
4714
+ }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
4477
4715
 
4716
+ // `{ Map, Set }.prototype[@@species]` accessors
4717
+ // https://tc39.es/ecma262/#sec-get-map-@@species
4718
+ // https://tc39.es/ecma262/#sec-get-set-@@species
4719
+ setSpecies(CONSTRUCTOR_NAME);
4720
+ }
4721
+ };
4478
4722
 
4723
+ // `Set` constructor
4724
+ // https://tc39.es/ecma262/#sec-set-objects
4725
+ collection('Set', function (init) {
4726
+ return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
4727
+ }, collectionStrong);
4479
4728
 
4729
+ var charAt$3 = stringMultibyte.charAt;
4480
4730
 
4481
4731
 
4482
4732
 
4483
4733
 
4484
- var SPECIES$3 = wellKnownSymbol('species');
4485
- var RegExpPrototype$3 = RegExp.prototype;
4486
4734
 
4487
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
4488
- var SYMBOL = wellKnownSymbol(KEY);
4735
+ var STRING_ITERATOR = 'String Iterator';
4736
+ var setInternalState$2 = internalState.set;
4737
+ var getInternalState = internalState.getterFor(STRING_ITERATOR);
4489
4738
 
4490
- var DELEGATES_TO_SYMBOL = !fails(function () {
4491
- // String methods call symbol-named RegEp methods
4492
- var O = {};
4493
- O[SYMBOL] = function () { return 7; };
4494
- return ''[KEY](O) !== 7;
4739
+ // `String.prototype[@@iterator]` method
4740
+ // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
4741
+ iteratorDefine(String, 'String', function (iterated) {
4742
+ setInternalState$2(this, {
4743
+ type: STRING_ITERATOR,
4744
+ string: toString$2(iterated),
4745
+ index: 0
4495
4746
  });
4747
+ // `%StringIteratorPrototype%.next` method
4748
+ // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
4749
+ }, function next() {
4750
+ var state = getInternalState(this);
4751
+ var string = state.string;
4752
+ var index = state.index;
4753
+ var point;
4754
+ if (index >= string.length) return createIterResultObject(undefined, true);
4755
+ point = charAt$3(string, index);
4756
+ state.index += point.length;
4757
+ return createIterResultObject(point, false);
4758
+ });
4496
4759
 
4497
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
4498
- // Symbol-named RegExp methods call .exec
4499
- var execCalled = false;
4500
- var re = /a/;
4760
+ var ITERATOR$3 = wellKnownSymbol('iterator');
4761
+ var ArrayValues = es_array_iterator.values;
4501
4762
 
4502
- if (KEY === 'split') {
4503
- // We can't use real regex here since it causes deoptimization
4504
- // and serious performance degradation in V8
4505
- // https://github.com/zloirock/core-js/issues/306
4506
- re = {};
4507
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
4508
- // a new one. We need to return the patched regex when creating the new one.
4509
- re.constructor = {};
4510
- re.constructor[SPECIES$3] = function () { return re; };
4511
- re.flags = '';
4512
- re[SYMBOL] = /./[SYMBOL];
4763
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
4764
+ if (CollectionPrototype) {
4765
+ // some Chrome versions have non-configurable methods on DOMTokenList
4766
+ if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
4767
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR$3, ArrayValues);
4768
+ } catch (error) {
4769
+ CollectionPrototype[ITERATOR$3] = ArrayValues;
4770
+ }
4771
+ setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
4772
+ if (domIterables[COLLECTION_NAME]) for (var METHOD_NAME in es_array_iterator) {
4773
+ // some Chrome versions have non-configurable methods on DOMTokenList
4774
+ if (CollectionPrototype[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
4775
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, es_array_iterator[METHOD_NAME]);
4776
+ } catch (error) {
4777
+ CollectionPrototype[METHOD_NAME] = es_array_iterator[METHOD_NAME];
4778
+ }
4513
4779
  }
4514
-
4515
- re.exec = function () {
4516
- execCalled = true;
4517
- return null;
4518
- };
4519
-
4520
- re[SYMBOL]('');
4521
- return !execCalled;
4522
- });
4523
-
4524
- if (
4525
- !DELEGATES_TO_SYMBOL ||
4526
- !DELEGATES_TO_EXEC ||
4527
- FORCED
4528
- ) {
4529
- var uncurriedNativeRegExpMethod = functionUncurryThisClause(/./[SYMBOL]);
4530
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
4531
- var uncurriedNativeMethod = functionUncurryThisClause(nativeMethod);
4532
- var $exec = regexp.exec;
4533
- if ($exec === regexpExec || $exec === RegExpPrototype$3.exec) {
4534
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
4535
- // The native String method already delegates to @@method (this
4536
- // polyfilled function), leasing to infinite recursion.
4537
- // We avoid it by directly calling the native @@method method.
4538
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
4539
- }
4540
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
4541
- }
4542
- return { done: false };
4543
- });
4544
-
4545
- defineBuiltIn(String.prototype, KEY, methods[0]);
4546
- defineBuiltIn(RegExpPrototype$3, SYMBOL, methods[1]);
4547
4780
  }
4548
-
4549
- if (SHAM) createNonEnumerableProperty(RegExpPrototype$3[SYMBOL], 'sham', true);
4550
4781
  };
4551
4782
 
4552
- var SPECIES$2 = wellKnownSymbol('species');
4783
+ for (var COLLECTION_NAME in domIterables) {
4784
+ handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
4785
+ }
4553
4786
 
4554
- // `SpeciesConstructor` abstract operation
4555
- // https://tc39.es/ecma262/#sec-speciesconstructor
4556
- var speciesConstructor = function (O, defaultConstructor) {
4557
- var C = anObject(O).constructor;
4558
- var S;
4559
- return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES$2]) ? defaultConstructor : aConstructor(S);
4560
- };
4787
+ handlePrototype(domTokenListPrototype, 'DOMTokenList');
4561
4788
 
4562
- var charAt$3 = stringMultibyte.charAt;
4789
+ // `Map` constructor
4790
+ // https://tc39.es/ecma262/#sec-map-objects
4791
+ collection('Map', function (init) {
4792
+ return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
4793
+ }, collectionStrong);
4563
4794
 
4564
- // `AdvanceStringIndex` abstract operation
4565
- // https://tc39.es/ecma262/#sec-advancestringindex
4566
- var advanceStringIndex = function (S, index, unicode) {
4567
- return index + (unicode ? charAt$3(S, index).length : 1);
4795
+ // call something on iterator step with safe closing on error
4796
+ var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
4797
+ try {
4798
+ return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
4799
+ } catch (error) {
4800
+ iteratorClose(iterator, 'throw', error);
4801
+ }
4568
4802
  };
4569
4803
 
4570
- var $TypeError$2 = TypeError;
4804
+ var $Array = Array;
4571
4805
 
4572
- // `RegExpExec` abstract operation
4573
- // https://tc39.es/ecma262/#sec-regexpexec
4574
- var regexpExecAbstract = function (R, S) {
4575
- var exec = R.exec;
4576
- if (isCallable(exec)) {
4577
- var result = functionCall(exec, R, S);
4578
- if (result !== null) anObject(result);
4579
- return result;
4806
+ // `Array.from` method implementation
4807
+ // https://tc39.es/ecma262/#sec-array.from
4808
+ var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
4809
+ var O = toObject(arrayLike);
4810
+ var IS_CONSTRUCTOR = isConstructor(this);
4811
+ var argumentsLength = arguments.length;
4812
+ var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
4813
+ var mapping = mapfn !== undefined;
4814
+ if (mapping) mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
4815
+ var iteratorMethod = getIteratorMethod(O);
4816
+ var index = 0;
4817
+ var length, result, step, iterator, next, value;
4818
+ // if the target is not iterable or it's an array with the default iterator - use a simple case
4819
+ if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
4820
+ iterator = getIterator(O, iteratorMethod);
4821
+ next = iterator.next;
4822
+ result = IS_CONSTRUCTOR ? new this() : [];
4823
+ for (;!(step = functionCall(next, iterator)).done; index++) {
4824
+ value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
4825
+ createProperty(result, index, value);
4826
+ }
4827
+ } else {
4828
+ length = lengthOfArrayLike(O);
4829
+ result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
4830
+ for (;length > index; index++) {
4831
+ value = mapping ? mapfn(O[index], index) : O[index];
4832
+ createProperty(result, index, value);
4833
+ }
4580
4834
  }
4581
- if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
4582
- throw new $TypeError$2('RegExp#exec called on incompatible receiver');
4835
+ result.length = index;
4836
+ return result;
4583
4837
  };
4584
4838
 
4585
- var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y;
4586
- var MAX_UINT32 = 0xFFFFFFFF;
4587
- var min = Math.min;
4588
- var $push = [].push;
4589
- var exec$1 = functionUncurryThis(/./.exec);
4590
- var push$2 = functionUncurryThis($push);
4591
- var stringSlice$3 = functionUncurryThis(''.slice);
4592
-
4593
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
4594
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
4595
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
4596
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
4597
- var re = /(?:)/;
4598
- var originalExec = re.exec;
4599
- re.exec = function () { return originalExec.apply(this, arguments); };
4600
- var result = 'ab'.split(re);
4601
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
4839
+ var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
4840
+ // eslint-disable-next-line es/no-array-from -- required for testing
4841
+ Array.from(iterable);
4602
4842
  });
4603
4843
 
4604
- // @@split logic
4605
- fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
4606
- var internalSplit;
4607
- if (
4608
- 'abbc'.split(/(b)*/)[1] === 'c' ||
4609
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
4610
- 'test'.split(/(?:)/, -1).length !== 4 ||
4611
- 'ab'.split(/(?:ab)*/).length !== 2 ||
4612
- '.'.split(/(.?)(.?)/).length !== 4 ||
4613
- // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
4614
- '.'.split(/()()/).length > 1 ||
4615
- ''.split(/.?/).length
4616
- ) {
4617
- // based on es5-shim implementation, need to rework it
4618
- internalSplit = function (separator, limit) {
4619
- var string = toString$2(requireObjectCoercible(this));
4620
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
4621
- if (lim === 0) return [];
4622
- if (separator === undefined) return [string];
4623
- // If `separator` is not a regex, use native split
4624
- if (!isRegexp(separator)) {
4625
- return functionCall(nativeSplit, string, separator, lim);
4626
- }
4627
- var output = [];
4628
- var flags = (separator.ignoreCase ? 'i' : '') +
4629
- (separator.multiline ? 'm' : '') +
4630
- (separator.unicode ? 'u' : '') +
4631
- (separator.sticky ? 'y' : '');
4632
- var lastLastIndex = 0;
4633
- // Make `global` and avoid `lastIndex` issues by working with a copy
4634
- var separatorCopy = new RegExp(separator.source, flags + 'g');
4635
- var match, lastIndex, lastLength;
4636
- while (match = functionCall(regexpExec, separatorCopy, string)) {
4637
- lastIndex = separatorCopy.lastIndex;
4638
- if (lastIndex > lastLastIndex) {
4639
- push$2(output, stringSlice$3(string, lastLastIndex, match.index));
4640
- if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
4641
- lastLength = match[0].length;
4642
- lastLastIndex = lastIndex;
4643
- if (output.length >= lim) break;
4644
- }
4645
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
4646
- }
4647
- if (lastLastIndex === string.length) {
4648
- if (lastLength || !exec$1(separatorCopy, '')) push$2(output, '');
4649
- } else push$2(output, stringSlice$3(string, lastLastIndex));
4650
- return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
4651
- };
4652
- // Chakra, V8
4653
- } else if ('0'.split(undefined, 0).length) {
4654
- internalSplit = function (separator, limit) {
4655
- return separator === undefined && limit === 0 ? [] : functionCall(nativeSplit, this, separator, limit);
4656
- };
4657
- } else internalSplit = nativeSplit;
4658
-
4659
- return [
4660
- // `String.prototype.split` method
4661
- // https://tc39.es/ecma262/#sec-string.prototype.split
4662
- function split(separator, limit) {
4663
- var O = requireObjectCoercible(this);
4664
- var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
4665
- return splitter
4666
- ? functionCall(splitter, separator, O, limit)
4667
- : functionCall(internalSplit, toString$2(O), separator, limit);
4668
- },
4669
- // `RegExp.prototype[@@split]` method
4670
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
4671
- //
4672
- // NOTE: This cannot be properly polyfilled in engines that don't support
4673
- // the 'y' flag.
4674
- function (string, limit) {
4675
- var rx = anObject(this);
4676
- var S = toString$2(string);
4677
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
4844
+ // `Array.from` method
4845
+ // https://tc39.es/ecma262/#sec-array.from
4846
+ _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
4847
+ from: arrayFrom
4848
+ });
4678
4849
 
4679
- if (res.done) return res.value;
4850
+ var stringIndexOf$1 = functionUncurryThis(''.indexOf);
4680
4851
 
4681
- var C = speciesConstructor(rx, RegExp);
4852
+ // `String.prototype.includes` method
4853
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
4854
+ _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
4855
+ includes: function includes(searchString /* , position = 0 */) {
4856
+ return !!~stringIndexOf$1(
4857
+ toString$2(requireObjectCoercible(this)),
4858
+ toString$2(notARegexp(searchString)),
4859
+ arguments.length > 1 ? arguments[1] : undefined
4860
+ );
4861
+ }
4862
+ });
4682
4863
 
4683
- var unicodeMatching = rx.unicode;
4684
- var flags = (rx.ignoreCase ? 'i' : '') +
4685
- (rx.multiline ? 'm' : '') +
4686
- (rx.unicode ? 'u' : '') +
4687
- (UNSUPPORTED_Y$1 ? 'g' : 'y');
4864
+ var $values = objectToArray.values;
4688
4865
 
4689
- // ^(? + rx + ) is needed, in combination with some S slicing, to
4690
- // simulate the 'y' flag.
4691
- var splitter = new C(UNSUPPORTED_Y$1 ? '^(?:' + rx.source + ')' : rx, flags);
4692
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
4693
- if (lim === 0) return [];
4694
- if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
4695
- var p = 0;
4696
- var q = 0;
4697
- var A = [];
4698
- while (q < S.length) {
4699
- splitter.lastIndex = UNSUPPORTED_Y$1 ? 0 : q;
4700
- var z = regexpExecAbstract(splitter, UNSUPPORTED_Y$1 ? stringSlice$3(S, q) : S);
4701
- var e;
4702
- if (
4703
- z === null ||
4704
- (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y$1 ? q : 0)), S.length)) === p
4705
- ) {
4706
- q = advanceStringIndex(S, q, unicodeMatching);
4707
- } else {
4708
- push$2(A, stringSlice$3(S, p, q));
4709
- if (A.length === lim) return A;
4710
- for (var i = 1; i <= z.length - 1; i++) {
4711
- push$2(A, z[i]);
4712
- if (A.length === lim) return A;
4713
- }
4714
- q = p = e;
4715
- }
4716
- }
4717
- push$2(A, stringSlice$3(S, p));
4718
- return A;
4719
- }
4720
- ];
4721
- }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y$1);
4866
+ // `Object.values` method
4867
+ // https://tc39.es/ecma262/#sec-object.values
4868
+ _export({ target: 'Object', stat: true }, {
4869
+ values: function values(O) {
4870
+ return $values(O);
4871
+ }
4872
+ });
4722
4873
 
4723
4874
  var nativeJoin = functionUncurryThis([].join);
4724
4875
 
4725
4876
  var ES3_STRINGS = indexedObject !== Object;
4726
- var FORCED$4 = ES3_STRINGS || !arrayMethodIsStrict('join', ',');
4877
+ var FORCED$3 = ES3_STRINGS || !arrayMethodIsStrict('join', ',');
4727
4878
 
4728
4879
  // `Array.prototype.join` method
4729
4880
  // https://tc39.es/ecma262/#sec-array.prototype.join
4730
- _export({ target: 'Array', proto: true, forced: FORCED$4 }, {
4881
+ _export({ target: 'Array', proto: true, forced: FORCED$3 }, {
4731
4882
  join: function join(separator) {
4732
4883
  return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator);
4733
4884
  }
@@ -4827,45 +4978,15 @@
4827
4978
  // `Number.isNaN` method
4828
4979
  // https://tc39.es/ecma262/#sec-number.isnan
4829
4980
  _export({ target: 'Number', stat: true }, {
4830
- isNaN: function isNaN(number) {
4831
- // eslint-disable-next-line no-self-compare -- NaN check
4832
- return number !== number;
4833
- }
4834
- });
4835
-
4836
- // `thisNumberValue` abstract operation
4837
- // https://tc39.es/ecma262/#sec-thisnumbervalue
4838
- var thisNumberValue = functionUncurryThis(1.0.valueOf);
4839
-
4840
- // a string of all valid unicode whitespaces
4841
- var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
4842
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
4843
-
4844
- var replace$2 = functionUncurryThis(''.replace);
4845
- var ltrim = RegExp('^[' + whitespaces + ']+');
4846
- var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
4847
-
4848
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
4849
- var createMethod = function (TYPE) {
4850
- return function ($this) {
4851
- var string = toString$2(requireObjectCoercible($this));
4852
- if (TYPE & 1) string = replace$2(string, ltrim, '');
4853
- if (TYPE & 2) string = replace$2(string, rtrim, '$1');
4854
- return string;
4855
- };
4856
- };
4857
-
4858
- var stringTrim = {
4859
- // `String.prototype.{ trimLeft, trimStart }` methods
4860
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
4861
- start: createMethod(1),
4862
- // `String.prototype.{ trimRight, trimEnd }` methods
4863
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
4864
- end: createMethod(2),
4865
- // `String.prototype.trim` method
4866
- // https://tc39.es/ecma262/#sec-string.prototype.trim
4867
- trim: createMethod(3)
4868
- };
4981
+ isNaN: function isNaN(number) {
4982
+ // eslint-disable-next-line no-self-compare -- NaN check
4983
+ return number !== number;
4984
+ }
4985
+ });
4986
+
4987
+ // `thisNumberValue` abstract operation
4988
+ // https://tc39.es/ecma262/#sec-thisnumbervalue
4989
+ var thisNumberValue = functionUncurryThis(1.0.valueOf);
4869
4990
 
4870
4991
  var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
4871
4992
  var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
@@ -4929,7 +5050,7 @@
4929
5050
  } return +it;
4930
5051
  };
4931
5052
 
4932
- var FORCED$3 = isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
5053
+ var FORCED$2 = isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
4933
5054
 
4934
5055
  var calledWithNew = function (dummy) {
4935
5056
  // includes check on 1..constructor(foo) case
@@ -4944,9 +5065,9 @@
4944
5065
  };
4945
5066
 
4946
5067
  NumberWrapper.prototype = NumberPrototype;
4947
- if (FORCED$3 && !isPure) NumberPrototype.constructor = NumberWrapper;
5068
+ if (FORCED$2 && !isPure) NumberPrototype.constructor = NumberWrapper;
4948
5069
 
4949
- _export({ global: true, constructor: true, wrap: true, forced: FORCED$3 }, {
5070
+ _export({ global: true, constructor: true, wrap: true, forced: FORCED$2 }, {
4950
5071
  Number: NumberWrapper
4951
5072
  });
4952
5073
 
@@ -4965,7 +5086,7 @@
4965
5086
  }
4966
5087
  }
4967
5088
  };
4968
- if (FORCED$3 || isPure) copyConstructorProperties(path$1[NUMBER], NativeNumber);
5089
+ if (FORCED$2 || isPure) copyConstructorProperties(path$1[NUMBER], NativeNumber);
4969
5090
 
4970
5091
  var trim = stringTrim.trim;
4971
5092
 
@@ -4974,13 +5095,13 @@
4974
5095
  var $parseFloat = global$1.parseFloat;
4975
5096
  var Symbol$1 = global$1.Symbol;
4976
5097
  var ITERATOR$2 = Symbol$1 && Symbol$1.iterator;
4977
- var FORCED$2 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
5098
+ var FORCED$1 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
4978
5099
  // MS Edge 18- broken with boxed symbols
4979
5100
  || (ITERATOR$2 && !fails(function () { $parseFloat(Object(ITERATOR$2)); }));
4980
5101
 
4981
5102
  // `parseFloat` method
4982
5103
  // https://tc39.es/ecma262/#sec-parsefloat-string
4983
- var numberParseFloat = FORCED$2 ? function parseFloat(string) {
5104
+ var numberParseFloat = FORCED$1 ? function parseFloat(string) {
4984
5105
  var trimmedString = trim(toString$2(string));
4985
5106
  var result = $parseFloat(trimmedString);
4986
5107
  return result === 0 && charAt$2(trimmedString, 0) === '-' ? -0 : result;
@@ -4993,29 +5114,6 @@
4993
5114
  parseFloat: numberParseFloat
4994
5115
  });
4995
5116
 
4996
- /* eslint-disable es/no-array-prototype-indexof -- required for testing */
4997
-
4998
-
4999
- var $indexOf = arrayIncludes.indexOf;
5000
-
5001
-
5002
- var nativeIndexOf = functionUncurryThisClause([].indexOf);
5003
-
5004
- var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
5005
- var FORCED$1 = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf');
5006
-
5007
- // `Array.prototype.indexOf` method
5008
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
5009
- _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
5010
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
5011
- var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
5012
- return NEGATIVE_ZERO
5013
- // convert -0 to +0
5014
- ? nativeIndexOf(this, searchElement, fromIndex) || 0
5015
- : $indexOf(this, searchElement, fromIndex);
5016
- }
5017
- });
5018
-
5019
5117
  var PROPER_FUNCTION_NAME = functionName.PROPER;
5020
5118
 
5021
5119
 
@@ -5915,7 +6013,7 @@
5915
6013
  && typeof document == 'object';
5916
6014
 
5917
6015
  promiseNativeConstructor && promiseNativeConstructor.prototype;
5918
- var SPECIES$1 = wellKnownSymbol('species');
6016
+ var SPECIES = wellKnownSymbol('species');
5919
6017
  var SUBCLASSING = false;
5920
6018
  var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable(global$1.PromiseRejectionEvent);
5921
6019
 
@@ -5936,7 +6034,7 @@
5936
6034
  exec(function () { /* empty */ }, function () { /* empty */ });
5937
6035
  };
5938
6036
  var constructor = promise.constructor = {};
5939
- constructor[SPECIES$1] = FakePromise;
6037
+ constructor[SPECIES] = FakePromise;
5940
6038
  SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
5941
6039
  if (!SUBCLASSING) return true;
5942
6040
  // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
@@ -6405,14 +6503,6 @@
6405
6503
  !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
6406
6504
  });
6407
6505
 
6408
- var quarterOfYear = createCommonjsModule(function (module, exports) {
6409
- !function(t,n){module.exports=n();}(commonjsGlobal,(function(){var t="month",n="quarter";return function(e,i){var r=i.prototype;r.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var s=r.add;r.add=function(e,i){return e=Number(e),this.$utils().p(i)===n?this.add(3*e,t):s.bind(this)(e,i)};var u=r.startOf;r.startOf=function(e,i){var r=this.$utils(),s=!!r.u(i)||i;if(r.p(e)===n){var o=this.quarter()-1;return s?this.month(3*o).startOf(t).startOf("day"):this.month(3*o+2).endOf(t).endOf("day")}return u.bind(this)(e,i)};}}));
6410
- });
6411
-
6412
- var en = createCommonjsModule(function (module, exports) {
6413
- !function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")}}));
6414
- });
6415
-
6416
6506
  function _isPlaceholder$1(a) {
6417
6507
  return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
6418
6508
  }
@@ -8954,6 +9044,22 @@
8954
9044
  return f(b) < f(a) ? b : a;
8955
9045
  });
8956
9046
 
9047
+ var quarterOfYear = createCommonjsModule(function (module, exports) {
9048
+ !function(t,n){module.exports=n();}(commonjsGlobal,(function(){var t="month",n="quarter";return function(e,i){var r=i.prototype;r.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var s=r.add;r.add=function(e,i){return e=Number(e),this.$utils().p(i)===n?this.add(3*e,t):s.bind(this)(e,i)};var u=r.startOf;r.startOf=function(e,i){var r=this.$utils(),s=!!r.u(i)||i;if(r.p(e)===n){var o=this.quarter()-1;return s?this.month(3*o).startOf(t).startOf("day"):this.month(3*o+2).endOf(t).endOf("day")}return u.bind(this)(e,i)};}}));
9049
+ });
9050
+
9051
+ var duration = createCommonjsModule(function (module, exports) {
9052
+ !function(t,s){module.exports=s();}(commonjsGlobal,(function(){var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,h=2592e6,a=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d={years:u,months:h,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof p},f=function(t,s,n){return new p(t,n,s.$l)},m=function(t){return s.p(t)+"s"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},g=function(t,s){return t?l(t)?{negative:!0,format:""+y(t)+s}:{negative:!1,format:""+t+s}:{negative:!1,format:""}},p=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*d[m(s)],this);if("number"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if("object"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s];})),this.calMilliseconds(),this;if("string"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*d[n]}),0);},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/h),t%=h,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t;},y.toISOString=function(){var t=g(this.$d.years,"Y"),s=g(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=g(n,"D"),e=g(this.$d.hours,"H"),r=g(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3);var u=g(o,"S"),h=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?"T":"",d=(h?"-":"")+"P"+t.format+s.format+i.format+a+e.format+r.format+u.format;return "P"===d||"-P"===d?"P0D":d},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||"YYYY-MM-DDTHH:mm:ss",i={Y:this.$d.years,YY:s.s(this.$d.years,2,"0"),YYYY:s.s(this.$d.years,4,"0"),M:this.$d.months,MM:s.s(this.$d.months,2,"0"),D:this.$d.days,DD:s.s(this.$d.days,2,"0"),H:this.$d.hours,HH:s.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,"0"),SSS:s.s(this.$d.milliseconds,3,"0")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/d[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return "milliseconds"===n?s%=1e3:s="weeks"===n?$(s/d[n]):this.$d[n],0===s?0:s},y.add=function(t,s,n){var i;return i=s?t*d[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!s)},y.milliseconds=function(){return this.get("milliseconds")},y.asMilliseconds=function(){return this.as("milliseconds")},y.seconds=function(){return this.get("seconds")},y.asSeconds=function(){return this.as("seconds")},y.minutes=function(){return this.get("minutes")},y.asMinutes=function(){return this.as("minutes")},y.hours=function(){return this.get("hours")},y.asHours=function(){return this.as("hours")},y.days=function(){return this.get("days")},y.asDays=function(){return this.as("days")},y.weeks=function(){return this.get("weeks")},y.asWeeks=function(){return this.as("weeks")},y.months=function(){return this.get("months")},y.asMonths=function(){return this.as("months")},y.years=function(){return this.get("years")},y.asYears=function(){return this.as("years")},l}();return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)&&(t=t.asMilliseconds()),r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)&&(t=t.asMilliseconds()),o.bind(this)(t,s)};}}));
9053
+ });
9054
+
9055
+ var isoWeek = createCommonjsModule(function (module, exports) {
9056
+ !function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e="day";return function(t,i,s){var a=function(t){return t.add(4-t.isoWeekday(),e)},d=i.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var i,d,n,o,r=a(this),u=(i=this.isoWeekYear(),d=this.$u,n=(d?s.utc:s)().year(i).startOf("year"),o=4-n.isoWeekday(),n.isoWeekday()>4&&(o+=7),n.add(o,e));return r.diff(u,"week")+1},d.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var n=d.startOf;d.startOf=function(e,t){var i=this.$utils(),s=!!i.u(t)||t;return "isoweek"===i.p(e)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(e,t)};}}));
9057
+ });
9058
+
9059
+ var en = createCommonjsModule(function (module, exports) {
9060
+ !function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")}}));
9061
+ });
9062
+
8957
9063
  createCommonjsModule(function (module, exports) {
8958
9064
  var global = typeof self !== 'undefined' ? self : commonjsGlobal;
8959
9065
  var __self__ = (function () {
@@ -9853,7 +9959,9 @@
9853
9959
  _excluded4 = ["title", "shortTitle"];
9854
9960
  function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9855
9961
  function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9856
- var DEFAULT_GRANULARITY = 'day';
9962
+ dayjs_min.extend(quarterOfYear);
9963
+ dayjs_min.extend(duration);
9964
+ dayjs_min.extend(isoWeek);
9857
9965
  var GRANULARITIES = [{
9858
9966
  name: undefined,
9859
9967
  title: 'w/o grouping'
@@ -9882,6 +9990,200 @@
9882
9990
  name: 'year',
9883
9991
  title: 'Year'
9884
9992
  }];
9993
+ var DEFAULT_GRANULARITY = 'day';
9994
+
9995
+ // When granularity is week, weekStart Value must be 1. However, since the client can change it globally
9996
+ // (https://day.js.org/docs/en/i18n/changing-locale) So the function below has been added.
9997
+ var internalDayjs = function internalDayjs() {
9998
+ return dayjs_min.apply(void 0, arguments).locale(_objectSpread$2(_objectSpread$2({}, en), {}, {
9999
+ weekStart: 1
10000
+ }));
10001
+ };
10002
+ var TIME_SERIES = {
10003
+ day: function day(range) {
10004
+ return range.by('d').map(function (d) {
10005
+ return d.format('YYYY-MM-DDT00:00:00.000');
10006
+ });
10007
+ },
10008
+ month: function month(range) {
10009
+ return range.snapTo('month').by('M').map(function (d) {
10010
+ return d.format('YYYY-MM-01T00:00:00.000');
10011
+ });
10012
+ },
10013
+ year: function year(range) {
10014
+ return range.snapTo('year').by('y').map(function (d) {
10015
+ return d.format('YYYY-01-01T00:00:00.000');
10016
+ });
10017
+ },
10018
+ hour: function hour(range) {
10019
+ return range.by('h').map(function (d) {
10020
+ return d.format('YYYY-MM-DDTHH:00:00.000');
10021
+ });
10022
+ },
10023
+ minute: function minute(range) {
10024
+ return range.by('m').map(function (d) {
10025
+ return d.format('YYYY-MM-DDTHH:mm:00.000');
10026
+ });
10027
+ },
10028
+ second: function second(range) {
10029
+ return range.by('s').map(function (d) {
10030
+ return d.format('YYYY-MM-DDTHH:mm:ss.000');
10031
+ });
10032
+ },
10033
+ week: function week(range) {
10034
+ return range.snapTo('week').by('w').map(function (d) {
10035
+ return d.startOf('week').format('YYYY-MM-DDT00:00:00.000');
10036
+ });
10037
+ },
10038
+ quarter: function quarter(range) {
10039
+ return range.snapTo('quarter').by('quarter').map(function (d) {
10040
+ return d.startOf('quarter').format('YYYY-MM-DDT00:00:00.000');
10041
+ });
10042
+ }
10043
+ };
10044
+ var isPredefinedGranularity = function isPredefinedGranularity(granularity) {
10045
+ return !!TIME_SERIES[granularity];
10046
+ };
10047
+ var DateRegex = /^\d\d\d\d-\d\d-\d\d$/;
10048
+ var LocalDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z?$/;
10049
+ var dayRange = function dayRange(from, to) {
10050
+ return {
10051
+ by: function by(value) {
10052
+ var results = [];
10053
+ var start = internalDayjs(from);
10054
+ var end = internalDayjs(to);
10055
+ while (start.isBefore(end) || start.isSame(end)) {
10056
+ results.push(start);
10057
+ start = start.add(1, value);
10058
+ }
10059
+ return results;
10060
+ },
10061
+ snapTo: function snapTo(value) {
10062
+ return dayRange(internalDayjs(from).startOf(value), internalDayjs(to).endOf(value));
10063
+ },
10064
+ start: internalDayjs(from),
10065
+ end: internalDayjs(to)
10066
+ };
10067
+ };
10068
+
10069
+ /**
10070
+ * Parse PostgreSQL-like interval string into object
10071
+ * E.g. '2 years 15 months 100 weeks 99 hours 15 seconds'
10072
+ * Negative units are also supported
10073
+ * E.g. '-2 months 5 days -10 hours'
10074
+ *
10075
+ * TODO: It's copy/paste of parseSqlInterval from @cubejs-backend/shared [time.ts]
10076
+ * It's not referenced to omit imports of moment.js staff.
10077
+ * Probably one day we should choose one implementation and reuse it in other places.
10078
+ */
10079
+ function parseSqlInterval(intervalStr) {
10080
+ var interval = {};
10081
+ var parts = intervalStr.split(/\s+/);
10082
+ for (var i = 0; i < parts.length; i += 2) {
10083
+ var value = parseInt(parts[i], 10);
10084
+ var unit = parts[i + 1];
10085
+
10086
+ // Remove ending 's' (e.g., 'days' -> 'day')
10087
+ var singularUnit = unit.endsWith('s') ? unit.slice(0, -1) : unit;
10088
+ interval[singularUnit] = value;
10089
+ }
10090
+ return interval;
10091
+ }
10092
+
10093
+ /**
10094
+ * Adds interval to provided date.
10095
+ * TODO: It's copy/paste of addInterval from @cubejs-backend/shared [time.ts]
10096
+ * but operates with dayjs instead of moment.js
10097
+ * @param {dayjs} date
10098
+ * @param interval
10099
+ * @returns {dayjs}
10100
+ */
10101
+ function addInterval(date, interval) {
10102
+ var res = date.clone();
10103
+ Object.entries(interval).forEach(function (_ref) {
10104
+ var _ref2 = _slicedToArray(_ref, 2),
10105
+ key = _ref2[0],
10106
+ value = _ref2[1];
10107
+ res = res.add(value, key);
10108
+ });
10109
+ return res;
10110
+ }
10111
+
10112
+ /**
10113
+ * Adds interval to provided date.
10114
+ * TODO: It's copy/paste of subtractInterval from @cubejs-backend/shared [time.ts]
10115
+ * but operates with dayjs instead of moment.js
10116
+ * @param {dayjs} date
10117
+ * @param interval
10118
+ * @returns {dayjs}
10119
+ */
10120
+ function subtractInterval(date, interval) {
10121
+ var res = date.clone();
10122
+ Object.entries(interval).forEach(function (_ref3) {
10123
+ var _ref4 = _slicedToArray(_ref3, 2),
10124
+ key = _ref4[0],
10125
+ value = _ref4[1];
10126
+ res = res.subtract(value, key);
10127
+ });
10128
+ return res;
10129
+ }
10130
+
10131
+ /**
10132
+ * Returns the closest date prior to date parameter aligned with the origin point
10133
+ * TODO: It's copy/paste of alignToOrigin from @cubejs-backend/shared [time.ts]
10134
+ * but operates with dayjs instead of moment.js
10135
+ */
10136
+ function alignToOrigin(startDate, interval, origin) {
10137
+ var alignedDate = startDate.clone();
10138
+ var intervalOp;
10139
+ var isIntervalNegative = false;
10140
+ var offsetDate = addInterval(origin, interval);
10141
+
10142
+ // The easiest way to check the interval sign
10143
+ if (offsetDate.isBefore(origin)) {
10144
+ isIntervalNegative = true;
10145
+ }
10146
+ offsetDate = origin.clone();
10147
+ if (startDate.isBefore(origin)) {
10148
+ intervalOp = isIntervalNegative ? addInterval : subtractInterval;
10149
+ while (offsetDate.isAfter(startDate)) {
10150
+ offsetDate = intervalOp(offsetDate, interval);
10151
+ }
10152
+ alignedDate = offsetDate;
10153
+ } else {
10154
+ intervalOp = isIntervalNegative ? subtractInterval : addInterval;
10155
+ while (offsetDate.isBefore(startDate)) {
10156
+ alignedDate = offsetDate.clone();
10157
+ offsetDate = intervalOp(offsetDate, interval);
10158
+ }
10159
+ if (offsetDate.isSame(startDate)) {
10160
+ alignedDate = offsetDate;
10161
+ }
10162
+ }
10163
+ return alignedDate;
10164
+ }
10165
+
10166
+ /**
10167
+ * Returns the time series points for the custom interval
10168
+ * TODO: It's almost a copy/paste of timeSeriesFromCustomInterval from
10169
+ * @cubejs-backend/shared [time.ts] but operates with dayjs instead of moment.js
10170
+ */
10171
+ var timeSeriesFromCustomInterval = function timeSeriesFromCustomInterval(from, to, granularity) {
10172
+ var intervalParsed = parseSqlInterval(granularity.interval);
10173
+ var start = internalDayjs(from);
10174
+ var end = internalDayjs(to);
10175
+ var origin = granularity.origin ? internalDayjs(granularity.origin) : internalDayjs().startOf('year');
10176
+ if (granularity.offset) {
10177
+ origin = addInterval(origin, parseSqlInterval(granularity.offset));
10178
+ }
10179
+ var alignedStart = alignToOrigin(start, intervalParsed, origin);
10180
+ var dates = [];
10181
+ while (alignedStart.isBefore(end) || alignedStart.isSame(end)) {
10182
+ dates.push(alignedStart.format('YYYY-MM-DDTHH:mm:ss.000'));
10183
+ alignedStart = addInterval(alignedStart, intervalParsed);
10184
+ }
10185
+ return dates;
10186
+ };
9885
10187
  function areQueriesEqual() {
9886
10188
  var query1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9887
10189
  var query2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -9926,9 +10228,9 @@
9926
10228
  });
9927
10229
  }
9928
10230
  if ((oldQuery.measures || []).length === 0 && (newQuery.measures || []).length > 0 || (oldQuery.measures || []).length === 1 && (newQuery.measures || []).length === 1 && oldQuery.measures[0] !== newQuery.measures[0]) {
9929
- var _ref6 = newQuery.timeDimensions || [],
9930
- _ref7 = _slicedToArray(_ref6, 1),
9931
- td = _ref7[0];
10231
+ var _ref10 = newQuery.timeDimensions || [],
10232
+ _ref11 = _slicedToArray(_ref10, 1),
10233
+ td = _ref11[0];
9932
10234
  var defaultTimeDimension = meta.defaultTimeDimensionNameFor(newQuery.measures[0]);
9933
10235
  newQuery = _objectSpread$2(_objectSpread$2({}, newQuery), {}, {
9934
10236
  timeDimensions: defaultTimeDimension ? [{
@@ -10057,10 +10359,10 @@
10057
10359
  var indexedOrderMembers = indexBy(prop('id'), orderMembers);
10058
10360
  var entries = Array.isArray(order) ? order : Object.entries(order || {});
10059
10361
  var nextOrderMembers = [];
10060
- entries.forEach(function (_ref8) {
10061
- var _ref9 = _slicedToArray(_ref8, 2),
10062
- memberId = _ref9[0],
10063
- currentOrder = _ref9[1];
10362
+ entries.forEach(function (_ref12) {
10363
+ var _ref13 = _slicedToArray(_ref12, 2),
10364
+ memberId = _ref13[0],
10365
+ currentOrder = _ref13[1];
10064
10366
  if (currentOrder !== 'none' && indexedOrderMembers[memberId]) {
10065
10367
  ids.add(memberId);
10066
10368
  nextOrderMembers.push(_objectSpread$2(_objectSpread$2({}, indexedOrderMembers[memberId]), {}, {
@@ -10088,59 +10390,6 @@
10088
10390
  }
10089
10391
  return nonNullValues;
10090
10392
  }
10091
- dayjs_min.extend(quarterOfYear);
10092
-
10093
- // When granularity is week, weekStart Value must be 1. However, since the client can change it globally (https://day.js.org/docs/en/i18n/changing-locale)
10094
- // So the function below has been added.
10095
- var internalDayjs = function internalDayjs() {
10096
- return dayjs_min.apply(void 0, arguments).locale(_objectSpread$2(_objectSpread$2({}, en), {}, {
10097
- weekStart: 1
10098
- }));
10099
- };
10100
- var TIME_SERIES = {
10101
- day: function day(range) {
10102
- return range.by('d').map(function (d) {
10103
- return d.format('YYYY-MM-DDT00:00:00.000');
10104
- });
10105
- },
10106
- month: function month(range) {
10107
- return range.snapTo('month').by('M').map(function (d) {
10108
- return d.format('YYYY-MM-01T00:00:00.000');
10109
- });
10110
- },
10111
- year: function year(range) {
10112
- return range.snapTo('year').by('y').map(function (d) {
10113
- return d.format('YYYY-01-01T00:00:00.000');
10114
- });
10115
- },
10116
- hour: function hour(range) {
10117
- return range.by('h').map(function (d) {
10118
- return d.format('YYYY-MM-DDTHH:00:00.000');
10119
- });
10120
- },
10121
- minute: function minute(range) {
10122
- return range.by('m').map(function (d) {
10123
- return d.format('YYYY-MM-DDTHH:mm:00.000');
10124
- });
10125
- },
10126
- second: function second(range) {
10127
- return range.by('s').map(function (d) {
10128
- return d.format('YYYY-MM-DDTHH:mm:ss.000');
10129
- });
10130
- },
10131
- week: function week(range) {
10132
- return range.snapTo('week').by('w').map(function (d) {
10133
- return d.startOf('week').format('YYYY-MM-DDT00:00:00.000');
10134
- });
10135
- },
10136
- quarter: function quarter(range) {
10137
- return range.snapTo('quarter').by('quarter').map(function (d) {
10138
- return d.startOf('quarter').format('YYYY-MM-DDT00:00:00.000');
10139
- });
10140
- }
10141
- };
10142
- var DateRegex = /^\d\d\d\d-\d\d-\d\d$/;
10143
- var LocalDateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z?$/;
10144
10393
  var groupByToPairs = function groupByToPairs(keyFn) {
10145
10394
  var acc = new Map();
10146
10395
  return function (data) {
@@ -10163,25 +10412,6 @@
10163
10412
  });
10164
10413
  return res;
10165
10414
  };
10166
- var dayRange = function dayRange(from, to) {
10167
- return {
10168
- by: function by(value) {
10169
- var results = [];
10170
- var start = internalDayjs(from);
10171
- var end = internalDayjs(to);
10172
- while (start.isBefore(end) || start.isSame(end)) {
10173
- results.push(start);
10174
- start = start.add(1, value);
10175
- }
10176
- return results;
10177
- },
10178
- snapTo: function snapTo(value) {
10179
- return dayRange(internalDayjs(from).startOf(value), internalDayjs(to).endOf(value));
10180
- },
10181
- start: internalDayjs(from),
10182
- end: internalDayjs(to)
10183
- };
10184
- };
10185
10415
  var QUERY_TYPE = {
10186
10416
  REGULAR_QUERY: 'regularQuery',
10187
10417
  COMPARE_DATE_RANGE_QUERY: 'compareDateRangeQuery',
@@ -10237,13 +10467,13 @@
10237
10467
  _this$query$segments = _this$query.segments,
10238
10468
  segments = _this$query$segments === void 0 ? [] : _this$query$segments;
10239
10469
  var measures = this.loadResponses[0].annotation.measures;
10240
- var _ref10 = values.find(function (_ref12) {
10241
- var _ref13 = _slicedToArray(_ref12, 1),
10242
- member = _ref13[0];
10470
+ var _ref14 = values.find(function (_ref16) {
10471
+ var _ref17 = _slicedToArray(_ref16, 1),
10472
+ member = _ref17[0];
10243
10473
  return member === 'measures';
10244
10474
  }) || [],
10245
- _ref11 = _slicedToArray(_ref10, 2),
10246
- measureName = _ref11[1];
10475
+ _ref15 = _slicedToArray(_ref14, 2),
10476
+ measureName = _ref15[1];
10247
10477
  if (measureName === undefined) {
10248
10478
  var _Object$keys = Object.keys(measures);
10249
10479
  var _Object$keys2 = _slicedToArray(_Object$keys, 1);
@@ -10257,14 +10487,14 @@
10257
10487
  operator: 'measureFilter'
10258
10488
  }].concat(_toConsumableArray(parentFilters));
10259
10489
  var timeDimensions = [];
10260
- values.filter(function (_ref14) {
10261
- var _ref15 = _slicedToArray(_ref14, 1),
10262
- member = _ref15[0];
10490
+ values.filter(function (_ref18) {
10491
+ var _ref19 = _slicedToArray(_ref18, 1),
10492
+ member = _ref19[0];
10263
10493
  return member !== 'measures';
10264
- }).forEach(function (_ref16) {
10265
- var _ref17 = _slicedToArray(_ref16, 2),
10266
- member = _ref17[0],
10267
- value = _ref17[1];
10494
+ }).forEach(function (_ref20) {
10495
+ var _ref21 = _slicedToArray(_ref20, 2),
10496
+ member = _ref21[0],
10497
+ value = _ref21[1];
10268
10498
  var _member$split = member.split('.'),
10269
10499
  _member$split2 = _slicedToArray(_member$split, 3),
10270
10500
  cubeName = _member$split2[0],
@@ -10318,17 +10548,17 @@
10318
10548
  key: "series",
10319
10549
  value: function series(pivotConfig) {
10320
10550
  var _this = this;
10321
- return this.seriesNames(pivotConfig).map(function (_ref18) {
10322
- var title = _ref18.title,
10323
- shortTitle = _ref18.shortTitle,
10324
- key = _ref18.key;
10551
+ return this.seriesNames(pivotConfig).map(function (_ref22) {
10552
+ var title = _ref22.title,
10553
+ shortTitle = _ref22.shortTitle,
10554
+ key = _ref22.key;
10325
10555
  return {
10326
10556
  title: title,
10327
10557
  shortTitle: shortTitle,
10328
10558
  key: key,
10329
- series: _this.chartPivot(pivotConfig).map(function (_ref19) {
10330
- var x = _ref19.x,
10331
- obj = _objectWithoutProperties(_ref19, _excluded2);
10559
+ series: _this.chartPivot(pivotConfig).map(function (_ref23) {
10560
+ var x = _ref23.x,
10561
+ obj = _objectWithoutProperties(_ref23, _excluded2);
10332
10562
  return {
10333
10563
  value: obj[key],
10334
10564
  x: x
@@ -10379,7 +10609,7 @@
10379
10609
  }
10380
10610
  }, {
10381
10611
  key: "timeSeries",
10382
- value: function timeSeries(timeDimension, resultIndex) {
10612
+ value: function timeSeries(timeDimension, resultIndex, annotations) {
10383
10613
  if (!timeDimension.granularity) {
10384
10614
  return null;
10385
10615
  }
@@ -10406,10 +10636,13 @@
10406
10636
  start = _dateRange2[0],
10407
10637
  end = _dateRange2[1];
10408
10638
  var range = dayRange(start, end);
10409
- if (!TIME_SERIES[timeDimension.granularity]) {
10410
- throw new Error("Unsupported time granularity: ".concat(timeDimension.granularity));
10639
+ if (isPredefinedGranularity(timeDimension.granularity)) {
10640
+ return TIME_SERIES[timeDimension.granularity](padToDay ? range.snapTo('d') : range);
10641
+ }
10642
+ if (!annotations["".concat(timeDimension.dimension, ".").concat(timeDimension.granularity)]) {
10643
+ throw new Error("Granularity \"".concat(timeDimension.granularity, "\" not found in time dimension \"").concat(timeDimension.dimension, "\""));
10411
10644
  }
10412
- return TIME_SERIES[timeDimension.granularity](padToDay ? range.snapTo('d') : range);
10645
+ return timeSeriesFromCustomInterval(start, end, annotations["".concat(timeDimension.dimension, ".").concat(timeDimension.granularity)].granularity);
10413
10646
  }
10414
10647
  }, {
10415
10648
  key: "pivot",
@@ -10419,8 +10652,8 @@
10419
10652
  var query = this.loadResponse.pivotQuery;
10420
10653
  var pivotImpl = function pivotImpl() {
10421
10654
  var resultIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
10422
- var groupByXAxis = groupByToPairs(function (_ref20) {
10423
- var xValues = _ref20.xValues;
10655
+ var groupByXAxis = groupByToPairs(function (_ref24) {
10656
+ var xValues = _ref24.xValues;
10424
10657
  return _this2.axisValuesString(xValues);
10425
10658
  });
10426
10659
  var measureValue = function measureValue(row, measure) {
@@ -10432,12 +10665,12 @@
10432
10665
  return ResultSet.timeDimensionMember(td);
10433
10666
  }))) {
10434
10667
  var series = _this2.loadResponses.map(function (loadResponse) {
10435
- return _this2.timeSeries(loadResponse.query.timeDimensions[0], resultIndex);
10668
+ return _this2.timeSeries(loadResponse.query.timeDimensions[0], resultIndex, loadResponse.annotation.timeDimensions);
10436
10669
  });
10437
10670
  if (series[0]) {
10438
10671
  groupByXAxis = function groupByXAxis(rows) {
10439
- var byXValues = groupBy(function (_ref21) {
10440
- var xValues = _ref21.xValues;
10672
+ var byXValues = groupBy(function (_ref25) {
10673
+ var xValues = _ref25.xValues;
10441
10674
  return xValues[0];
10442
10675
  }, rows);
10443
10676
  return series[resultIndex].map(function (d) {
@@ -10458,11 +10691,11 @@
10458
10691
  });
10459
10692
  }), unnest, groupByXAxis)(_this2.timeDimensionBackwardCompatibleData(resultIndex));
10460
10693
  var yValuesMap = {};
10461
- xGrouped.forEach(function (_ref22) {
10462
- var _ref23 = _slicedToArray(_ref22, 2),
10463
- rows = _ref23[1];
10464
- rows.forEach(function (_ref24) {
10465
- var row = _ref24.row;
10694
+ xGrouped.forEach(function (_ref26) {
10695
+ var _ref27 = _slicedToArray(_ref26, 2),
10696
+ rows = _ref27[1];
10697
+ rows.forEach(function (_ref28) {
10698
+ var row = _ref28.row;
10466
10699
  _this2.axisValues(pivotConfig.y, resultIndex)(row).forEach(function (values) {
10467
10700
  if (Object.keys(row).length > 0) {
10468
10701
  yValuesMap[values.join()] = values;
@@ -10474,13 +10707,13 @@
10474
10707
  var measureOnX = Boolean(pivotConfig.x.find(function (d) {
10475
10708
  return d === 'measures';
10476
10709
  }));
10477
- return xGrouped.map(function (_ref25) {
10478
- var _ref26 = _slicedToArray(_ref25, 2),
10479
- rows = _ref26[1];
10710
+ return xGrouped.map(function (_ref29) {
10711
+ var _ref30 = _slicedToArray(_ref29, 2),
10712
+ rows = _ref30[1];
10480
10713
  var xValues = rows[0].xValues;
10481
10714
  var yGrouped = {};
10482
- rows.forEach(function (_ref27) {
10483
- var row = _ref27.row;
10715
+ rows.forEach(function (_ref31) {
10716
+ var row = _ref31.row;
10484
10717
  var arr = _this2.axisValues(pivotConfig.y, resultIndex)(row).map(function (yValues) {
10485
10718
  return {
10486
10719
  yValues: yValues,
@@ -10545,8 +10778,8 @@
10545
10778
  };
10546
10779
  var duplicateMeasures = new Set();
10547
10780
  if (this.queryType === QUERY_TYPE.BLENDING_QUERY) {
10548
- var allMeasures = flatten(this.loadResponses.map(function (_ref28) {
10549
- var query = _ref28.query;
10781
+ var allMeasures = flatten(this.loadResponses.map(function (_ref32) {
10782
+ var query = _ref32.query;
10550
10783
  return query.measures;
10551
10784
  }));
10552
10785
  allMeasures.filter(function (e, i, a) {
@@ -10555,14 +10788,14 @@
10555
10788
  return duplicateMeasures.add(m);
10556
10789
  });
10557
10790
  }
10558
- return this.pivot(pivotConfig).map(function (_ref29) {
10559
- var xValues = _ref29.xValues,
10560
- yValuesArray = _ref29.yValuesArray;
10791
+ return this.pivot(pivotConfig).map(function (_ref33) {
10792
+ var xValues = _ref33.xValues,
10793
+ yValuesArray = _ref33.yValuesArray;
10561
10794
  var yValuesMap = {};
10562
- yValuesArray.forEach(function (_ref30, i) {
10563
- var _ref31 = _slicedToArray(_ref30, 2),
10564
- yValues = _ref31[0],
10565
- m = _ref31[1];
10795
+ yValuesArray.forEach(function (_ref34, i) {
10796
+ var _ref35 = _slicedToArray(_ref34, 2),
10797
+ yValues = _ref35[0],
10798
+ m = _ref35[1];
10566
10799
  yValuesMap[_this3.axisValuesString(aliasSeries(yValues, i, pivotConfig, duplicateMeasures), ',')] = m && validate(m);
10567
10800
  });
10568
10801
  return _objectSpread$2({
@@ -10576,15 +10809,15 @@
10576
10809
  value: function tablePivot(pivotConfig) {
10577
10810
  var normalizedPivotConfig = this.normalizePivotConfig(pivotConfig || {});
10578
10811
  var isMeasuresPresent = normalizedPivotConfig.x.concat(normalizedPivotConfig.y).includes('measures');
10579
- return this.pivot(normalizedPivotConfig).map(function (_ref32) {
10580
- var xValues = _ref32.xValues,
10581
- yValuesArray = _ref32.yValuesArray;
10812
+ return this.pivot(normalizedPivotConfig).map(function (_ref36) {
10813
+ var xValues = _ref36.xValues,
10814
+ yValuesArray = _ref36.yValuesArray;
10582
10815
  return fromPairs$1(normalizedPivotConfig.x.map(function (key, index) {
10583
10816
  return [key, xValues[index]];
10584
- }).concat(isMeasuresPresent ? yValuesArray.map(function (_ref33) {
10585
- var _ref34 = _slicedToArray(_ref33, 2),
10586
- yValues = _ref34[0],
10587
- measure = _ref34[1];
10817
+ }).concat(isMeasuresPresent ? yValuesArray.map(function (_ref37) {
10818
+ var _ref38 = _slicedToArray(_ref37, 2),
10819
+ yValues = _ref38[0],
10820
+ measure = _ref38[1];
10588
10821
  return [yValues.length ? yValues.join() : 'value', measure];
10589
10822
  }) : []));
10590
10823
  });
@@ -10599,12 +10832,12 @@
10599
10832
  }, {});
10600
10833
  var schema = {};
10601
10834
  var extractFields = function extractFields(key) {
10602
- var _ref35 = flatMeta[key] || {},
10603
- title = _ref35.title,
10604
- shortTitle = _ref35.shortTitle,
10605
- type = _ref35.type,
10606
- format = _ref35.format,
10607
- meta = _ref35.meta;
10835
+ var _ref39 = flatMeta[key] || {},
10836
+ title = _ref39.title,
10837
+ shortTitle = _ref39.shortTitle,
10838
+ type = _ref39.type,
10839
+ format = _ref39.format,
10840
+ meta = _ref39.meta;
10608
10841
  return {
10609
10842
  key: key,
10610
10843
  title: title,
@@ -10615,9 +10848,9 @@
10615
10848
  };
10616
10849
  };
10617
10850
  var pivot = this.pivot(normalizedPivotConfig);
10618
- (pivot[0] && pivot[0].yValuesArray || []).forEach(function (_ref36) {
10619
- var _ref37 = _slicedToArray(_ref36, 1),
10620
- yValues = _ref37[0];
10851
+ (pivot[0] && pivot[0].yValuesArray || []).forEach(function (_ref40) {
10852
+ var _ref41 = _slicedToArray(_ref40, 1),
10853
+ yValues = _ref41[0];
10621
10854
  if (yValues.length > 0) {
10622
10855
  var currentItem = schema;
10623
10856
  yValues.forEach(function (value, index) {
@@ -10636,9 +10869,9 @@
10636
10869
  if (Object.keys(item).length === 0) {
10637
10870
  return [];
10638
10871
  }
10639
- return Object.values(item).map(function (_ref38) {
10640
- var key = _ref38.key,
10641
- currentItem = _objectWithoutProperties(_ref38, _excluded3);
10872
+ return Object.values(item).map(function (_ref42) {
10873
+ var key = _ref42.key,
10874
+ currentItem = _objectWithoutProperties(_ref42, _excluded3);
10642
10875
  var children = toColumns(currentItem.children, [].concat(_toConsumableArray(path), [key]));
10643
10876
  var _extractFields = extractFields(currentItem.memberId),
10644
10877
  title = _extractFields.title,
@@ -10717,8 +10950,8 @@
10717
10950
  }));
10718
10951
  var duplicateMeasures = new Set();
10719
10952
  if (this.queryType === QUERY_TYPE.BLENDING_QUERY) {
10720
- var allMeasures = flatten(this.loadResponses.map(function (_ref39) {
10721
- var query = _ref39.query;
10953
+ var allMeasures = flatten(this.loadResponses.map(function (_ref43) {
10954
+ var query = _ref43.query;
10722
10955
  return query.measures;
10723
10956
  }));
10724
10957
  allMeasures.filter(function (e, i, a) {
@@ -10966,43 +11199,6 @@
10966
11199
  };
10967
11200
  }
10968
11201
 
10969
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
10970
-
10971
- var SPECIES = wellKnownSymbol('species');
10972
- var $Array = Array;
10973
- var max = Math.max;
10974
-
10975
- // `Array.prototype.slice` method
10976
- // https://tc39.es/ecma262/#sec-array.prototype.slice
10977
- // fallback for not array-like ES3 strings and DOM objects
10978
- _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
10979
- slice: function slice(start, end) {
10980
- var O = toIndexedObject(this);
10981
- var length = lengthOfArrayLike(O);
10982
- var k = toAbsoluteIndex(start, length);
10983
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
10984
- // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
10985
- var Constructor, result, n;
10986
- if (isArray(O)) {
10987
- Constructor = O.constructor;
10988
- // cross-realm fallback
10989
- if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
10990
- Constructor = undefined;
10991
- } else if (isObject(Constructor)) {
10992
- Constructor = Constructor[SPECIES];
10993
- if (Constructor === null) Constructor = undefined;
10994
- }
10995
- if (Constructor === $Array || Constructor === undefined) {
10996
- return arraySlice(O, k, fin);
10997
- }
10998
- }
10999
- result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
11000
- for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
11001
- result.length = n;
11002
- return result;
11003
- }
11004
- });
11005
-
11006
11202
  function _has(prop, obj) {
11007
11203
  return Object.prototype.hasOwnProperty.call(obj, prop);
11008
11204
  }