From 60b61f66ca8ee0f50e0f08b7c9e007bde0c7080e Mon Sep 17 00:00:00 2001 From: pengfeizhou Date: Fri, 19 Feb 2021 17:33:10 +0800 Subject: [PATCH] doric-js:debug source file update --- doric-js/bundle/doric-lib.es5.js | 17 + doric-js/bundle/doric-lib.js | 17 + doric-js/bundle/doric-sandbox.es5.js | 4448 ++++++++++++++------------ doric-js/bundle/doric-sandbox.js | 2 + doric-js/bundle/doric-vm.js | 60 +- doric-js/index.debug.ts | 39 +- doric-js/lib/index.debug.js | 37 +- doric-js/package.json | 4 +- 8 files changed, 2561 insertions(+), 2063 deletions(-) diff --git a/doric-js/bundle/doric-lib.es5.js b/doric-js/bundle/doric-lib.es5.js index 075b0ad0..6f18b65c 100644 --- a/doric-js/bundle/doric-lib.es5.js +++ b/doric-js/bundle/doric-lib.es5.js @@ -665,6 +665,7 @@ function gravity() { return new Gravity; } +exports.LayoutSpec = void 0; (function (LayoutSpec) { /** * Depends on what's been set on width or height. @@ -1300,10 +1301,12 @@ var __values$3 = (undefined && undefined.__values) || function(o) { }; } throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; +exports.RepeatMode = void 0; (function (RepeatMode) { RepeatMode[RepeatMode["RESTART"] = 1] = "RESTART"; RepeatMode[RepeatMode["REVERSE"] = 2] = "REVERSE"; })(exports.RepeatMode || (exports.RepeatMode = {})); +exports.FillMode = void 0; (function (FillMode) { /** * The receiver is removed from the presentation when the animation is completed. @@ -1322,6 +1325,7 @@ var __values$3 = (undefined && undefined.__values) || function(o) { */ FillMode[FillMode["Both"] = 3] = "Both"; })(exports.FillMode || (exports.FillMode = {})); +exports.TimingFunction = void 0; (function (TimingFunction) { /** * The system default timing function. Use this function to ensure that the timing of your animations matches that of most system animations. @@ -1691,6 +1695,7 @@ var Color = /** @class */ (function () { Color.TRANSPARENT = new Color(0); return Color; }()); +exports.GradientOrientation = void 0; (function (GradientOrientation) { /** draw the gradient from the top to the bottom */ GradientOrientation[GradientOrientation["TOP_BOTTOM"] = 0] = "TOP_BOTTOM"; @@ -1732,6 +1737,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, var __metadata$3 = (undefined && undefined.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") { return Reflect.metadata(k, v); } }; +exports.TruncateAt = void 0; (function (TruncateAt) { TruncateAt[TruncateAt["End"] = 0] = "End"; TruncateAt[TruncateAt["Middle"] = 1] = "Middle"; @@ -1832,6 +1838,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, var __metadata$4 = (undefined && undefined.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") { return Reflect.metadata(k, v); } }; +exports.ScaleType = void 0; (function (ScaleType) { ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill"; ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit"; @@ -2398,12 +2405,14 @@ var FlexTypedValue = /** @class */ (function () { FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto); return FlexTypedValue; }()); +exports.FlexDirection = void 0; (function (FlexDirection) { FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN"; FlexDirection[FlexDirection["COLUMN_REVERSE"] = 1] = "COLUMN_REVERSE"; FlexDirection[FlexDirection["ROW"] = 2] = "ROW"; FlexDirection[FlexDirection["ROW_REVERSE"] = 3] = "ROW_REVERSE"; })(exports.FlexDirection || (exports.FlexDirection = {})); +exports.Align = void 0; (function (Align) { Align[Align["AUTO"] = 0] = "AUTO"; Align[Align["FLEX_START"] = 1] = "FLEX_START"; @@ -2414,6 +2423,7 @@ var FlexTypedValue = /** @class */ (function () { Align[Align["SPACE_BETWEEN"] = 6] = "SPACE_BETWEEN"; Align[Align["SPACE_AROUND"] = 7] = "SPACE_AROUND"; })(exports.Align || (exports.Align = {})); +exports.Justify = void 0; (function (Justify) { Justify[Justify["FLEX_START"] = 0] = "FLEX_START"; Justify[Justify["CENTER"] = 1] = "CENTER"; @@ -2422,25 +2432,30 @@ var FlexTypedValue = /** @class */ (function () { Justify[Justify["SPACE_AROUND"] = 4] = "SPACE_AROUND"; Justify[Justify["SPACE_EVENLY"] = 5] = "SPACE_EVENLY"; })(exports.Justify || (exports.Justify = {})); +exports.Direction = void 0; (function (Direction) { Direction[Direction["INHERIT"] = 0] = "INHERIT"; Direction[Direction["LTR"] = 1] = "LTR"; Direction[Direction["RTL"] = 2] = "RTL"; })(exports.Direction || (exports.Direction = {})); +exports.PositionType = void 0; (function (PositionType) { PositionType[PositionType["RELATIVE"] = 0] = "RELATIVE"; PositionType[PositionType["ABSOLUTE"] = 1] = "ABSOLUTE"; })(exports.PositionType || (exports.PositionType = {})); +exports.Wrap = void 0; (function (Wrap) { Wrap[Wrap["NO_WRAP"] = 0] = "NO_WRAP"; Wrap[Wrap["WRAP"] = 1] = "WRAP"; Wrap[Wrap["WRAP_REVERSE"] = 2] = "WRAP_REVERSE"; })(exports.Wrap || (exports.Wrap = {})); +exports.OverFlow = void 0; (function (OverFlow) { OverFlow[OverFlow["VISIBLE"] = 0] = "VISIBLE"; OverFlow[OverFlow["HIDDEN"] = 1] = "HIDDEN"; OverFlow[OverFlow["SCROLL"] = 2] = "SCROLL"; })(exports.OverFlow || (exports.OverFlow = {})); +exports.Display = void 0; (function (Display) { Display[Display["FLEX"] = 0] = "FLEX"; Display[Display["NONE"] = 1] = "NONE"; @@ -2717,6 +2732,7 @@ var Input = /** @class */ (function (_super) { ], Input.prototype, "password", void 0); return Input; }(View)); +exports.InputType = void 0; (function (InputType) { InputType[InputType["Default"] = 0] = "Default"; InputType[InputType["Number"] = 1] = "Number"; @@ -3296,6 +3312,7 @@ function notification(context) { }; } +exports.StatusBarMode = void 0; (function (StatusBarMode) { StatusBarMode[StatusBarMode["LIGHT"] = 0] = "LIGHT"; StatusBarMode[StatusBarMode["DARK"] = 1] = "DARK"; diff --git a/doric-js/bundle/doric-lib.js b/doric-js/bundle/doric-lib.js index 8a2b992d..eeecf9f7 100644 --- a/doric-js/bundle/doric-lib.js +++ b/doric-js/bundle/doric-lib.js @@ -561,6 +561,7 @@ function gravity() { return new Gravity; } +exports.LayoutSpec = void 0; (function (LayoutSpec) { /** * Depends on what's been set on width or height. @@ -981,10 +982,12 @@ __decorate$2([ * See the License for the specific language governing permissions and * limitations under the License. */ +exports.RepeatMode = void 0; (function (RepeatMode) { RepeatMode[RepeatMode["RESTART"] = 1] = "RESTART"; RepeatMode[RepeatMode["REVERSE"] = 2] = "REVERSE"; })(exports.RepeatMode || (exports.RepeatMode = {})); +exports.FillMode = void 0; (function (FillMode) { /** * The receiver is removed from the presentation when the animation is completed. @@ -1003,6 +1006,7 @@ __decorate$2([ */ FillMode[FillMode["Both"] = 3] = "Both"; })(exports.FillMode || (exports.FillMode = {})); +exports.TimingFunction = void 0; (function (TimingFunction) { /** * The system default timing function. Use this function to ensure that the timing of your animations matches that of most system animations. @@ -1282,6 +1286,7 @@ Color.YELLOW = new Color(0xFFFFFF00); Color.CYAN = new Color(0xFF00FFFF); Color.MAGENTA = new Color(0xFFFF00FF); Color.TRANSPARENT = new Color(0); +exports.GradientOrientation = void 0; (function (GradientOrientation) { /** draw the gradient from the top to the bottom */ GradientOrientation[GradientOrientation["TOP_BOTTOM"] = 0] = "TOP_BOTTOM"; @@ -1310,6 +1315,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, var __metadata$3 = (undefined && undefined.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; +exports.TruncateAt = void 0; (function (TruncateAt) { TruncateAt[TruncateAt["End"] = 0] = "End"; TruncateAt[TruncateAt["Middle"] = 1] = "Middle"; @@ -1392,6 +1398,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, var __metadata$4 = (undefined && undefined.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; +exports.ScaleType = void 0; (function (ScaleType) { ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill"; ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit"; @@ -1849,12 +1856,14 @@ class FlexTypedValue { } } FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto); +exports.FlexDirection = void 0; (function (FlexDirection) { FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN"; FlexDirection[FlexDirection["COLUMN_REVERSE"] = 1] = "COLUMN_REVERSE"; FlexDirection[FlexDirection["ROW"] = 2] = "ROW"; FlexDirection[FlexDirection["ROW_REVERSE"] = 3] = "ROW_REVERSE"; })(exports.FlexDirection || (exports.FlexDirection = {})); +exports.Align = void 0; (function (Align) { Align[Align["AUTO"] = 0] = "AUTO"; Align[Align["FLEX_START"] = 1] = "FLEX_START"; @@ -1865,6 +1874,7 @@ FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto); Align[Align["SPACE_BETWEEN"] = 6] = "SPACE_BETWEEN"; Align[Align["SPACE_AROUND"] = 7] = "SPACE_AROUND"; })(exports.Align || (exports.Align = {})); +exports.Justify = void 0; (function (Justify) { Justify[Justify["FLEX_START"] = 0] = "FLEX_START"; Justify[Justify["CENTER"] = 1] = "CENTER"; @@ -1873,25 +1883,30 @@ FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto); Justify[Justify["SPACE_AROUND"] = 4] = "SPACE_AROUND"; Justify[Justify["SPACE_EVENLY"] = 5] = "SPACE_EVENLY"; })(exports.Justify || (exports.Justify = {})); +exports.Direction = void 0; (function (Direction) { Direction[Direction["INHERIT"] = 0] = "INHERIT"; Direction[Direction["LTR"] = 1] = "LTR"; Direction[Direction["RTL"] = 2] = "RTL"; })(exports.Direction || (exports.Direction = {})); +exports.PositionType = void 0; (function (PositionType) { PositionType[PositionType["RELATIVE"] = 0] = "RELATIVE"; PositionType[PositionType["ABSOLUTE"] = 1] = "ABSOLUTE"; })(exports.PositionType || (exports.PositionType = {})); +exports.Wrap = void 0; (function (Wrap) { Wrap[Wrap["NO_WRAP"] = 0] = "NO_WRAP"; Wrap[Wrap["WRAP"] = 1] = "WRAP"; Wrap[Wrap["WRAP_REVERSE"] = 2] = "WRAP_REVERSE"; })(exports.Wrap || (exports.Wrap = {})); +exports.OverFlow = void 0; (function (OverFlow) { OverFlow[OverFlow["VISIBLE"] = 0] = "VISIBLE"; OverFlow[OverFlow["HIDDEN"] = 1] = "HIDDEN"; OverFlow[OverFlow["SCROLL"] = 2] = "SCROLL"; })(exports.OverFlow || (exports.OverFlow = {})); +exports.Display = void 0; (function (Display) { Display[Display["FLEX"] = 0] = "FLEX"; Display[Display["NONE"] = 1] = "NONE"; @@ -2105,6 +2120,7 @@ __decorate$a([ Property, __metadata$a("design:type", Boolean) ], Input.prototype, "password", void 0); +exports.InputType = void 0; (function (InputType) { InputType[InputType["Default"] = 0] = "Default"; InputType[InputType["Number"] = 1] = "Number"; @@ -2560,6 +2576,7 @@ function notification(context) { }; } +exports.StatusBarMode = void 0; (function (StatusBarMode) { StatusBarMode[StatusBarMode["LIGHT"] = 0] = "LIGHT"; StatusBarMode[StatusBarMode["DARK"] = 1] = "DARK"; diff --git a/doric-js/bundle/doric-sandbox.es5.js b/doric-js/bundle/doric-sandbox.es5.js index beff7d39..dabca4dc 100644 --- a/doric-js/bundle/doric-sandbox.es5.js +++ b/doric-js/bundle/doric-sandbox.es5.js @@ -1544,13 +1544,13 @@ var doric = (function (exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global_1 = - // eslint-disable-next-line no-undef + /* global globalThis -- safe */ check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || - // eslint-disable-next-line no-new-func - Function('return this')(); + // eslint-disable-next-line no-new-func -- fallback + (function () { return this; })() || Function('return this')(); var fails = function (exec) { try { @@ -1560,7 +1560,7 @@ var doric = (function (exports) { } }; - // Thank's IE8 for his funny defineProperty + // Detect IE8's incomplete defineProperty implementation var descriptors = !fails(function () { return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); @@ -1572,7 +1572,7 @@ var doric = (function (exports) { var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation - // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable + // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable var f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; @@ -1602,14 +1602,14 @@ var doric = (function (exports) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 - // eslint-disable-next-line no-prototype-builtins + // eslint-disable-next-line no-prototype-builtins -- safe return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classofRaw(it) == 'String' ? split.call(it, '') : Object(it); } : Object; // `RequireObjectCoercible` abstract operation - // https://tc39.github.io/ecma262/#sec-requireobjectcoercible + // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible = function (it) { if (it == undefined) { throw TypeError("Can't call method on " + it); } return it; @@ -1628,7 +1628,7 @@ var doric = (function (exports) { }; // `ToPrimitive` abstract operation - // https://tc39.github.io/ecma262/#sec-toprimitive + // https://tc39.es/ecma262/#sec-toprimitive // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string var toPrimitive = function (input, PREFERRED_STRING) { @@ -1664,7 +1664,7 @@ var doric = (function (exports) { var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor + // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); @@ -1687,7 +1687,7 @@ var doric = (function (exports) { var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method - // https://tc39.github.io/ecma262/#sec-object.defineproperty + // https://tc39.es/ecma262/#sec-object.defineproperty var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); @@ -1745,9 +1745,9 @@ var doric = (function (exports) { (module.exports = function (key, value) { return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.6.5', - mode: 'global', - copyright: '© 2020 Denis Pushkarev (zloirock.ru)' + version: '3.9.0', + mode: 'global', + copyright: '© 2021 Denis Pushkarev (zloirock.ru)' }); }); @@ -1783,11 +1783,12 @@ var doric = (function (exports) { }; if (nativeWeakMap) { - var store$1 = new WeakMap$2(); + var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2()); var wmget = store$1.get; var wmhas = store$1.has; var wmset = store$1.set; set = function (it, metadata) { + metadata.facade = it; wmset.call(store$1, it, metadata); return metadata; }; @@ -1801,6 +1802,7 @@ var doric = (function (exports) { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { + metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; @@ -1829,9 +1831,15 @@ var doric = (function (exports) { var unsafe = options ? !!options.unsafe : false; var simple = options ? !!options.enumerable : false; var noTargetGet = options ? !!options.noTargetGet : false; + var state; if (typeof value == 'function') { - if (typeof key == 'string' && !has(value, 'name')) { createNonEnumerableProperty(value, 'name', key); } - enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); + if (typeof key == 'string' && !has(value, 'name')) { + createNonEnumerableProperty(value, 'name', key); + } + state = enforceInternalState(value); + if (!state.source) { + state.source = TEMPLATE.join(typeof key == 'string' ? key : ''); + } } if (O === global_1) { if (simple) { O[key] = value; } @@ -1865,7 +1873,7 @@ var doric = (function (exports) { var floor = Math.floor; // `ToInteger` abstract operation - // https://tc39.github.io/ecma262/#sec-tointeger + // https://tc39.es/ecma262/#sec-tointeger var toInteger = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; @@ -1873,7 +1881,7 @@ var doric = (function (exports) { var min = Math.min; // `ToLength` abstract operation - // https://tc39.github.io/ecma262/#sec-tolength + // https://tc39.es/ecma262/#sec-tolength var toLength = function (argument) { return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; @@ -1897,10 +1905,10 @@ var doric = (function (exports) { var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el != el) { while (length > index) { value = O[index++]; - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check if (value != value) { return true; } // Array#indexOf ignores holes, Array#includes - not } } else { for (;length > index; index++) { @@ -1911,10 +1919,10 @@ var doric = (function (exports) { var arrayIncludes = { // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes + // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof + // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; @@ -1948,7 +1956,7 @@ var doric = (function (exports) { var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + // https://tc39.es/ecma262/#sec-object.getownpropertynames var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return objectKeysInternal(O, hiddenKeys$1); }; @@ -2056,36 +2064,35 @@ var doric = (function (exports) { var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion - // eslint-disable-next-line no-undef + /* global Symbol -- required for testing */ return !String(Symbol()); }); var useSymbolAsUid = nativeSymbol - // eslint-disable-next-line no-undef + /* global Symbol -- safe */ && !Symbol.sham - // eslint-disable-next-line no-undef && typeof Symbol.iterator == 'symbol'; // `IsArray` abstract operation - // https://tc39.github.io/ecma262/#sec-isarray + // https://tc39.es/ecma262/#sec-isarray var isArray = Array.isArray || function isArray(arg) { return classofRaw(arg) == 'Array'; }; // `ToObject` abstract operation - // https://tc39.github.io/ecma262/#sec-toobject + // https://tc39.es/ecma262/#sec-toobject var toObject = function (argument) { return Object(requireObjectCoercible(argument)); }; // `Object.keys` method - // https://tc39.github.io/ecma262/#sec-object.keys + // https://tc39.es/ecma262/#sec-object.keys var objectKeys = Object.keys || function keys(O) { return objectKeysInternal(O, enumBugKeys); }; // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties + // https://tc39.es/ecma262/#sec-object.defineproperties var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); @@ -2144,7 +2151,7 @@ var doric = (function (exports) { var activeXDocument; var NullProtoObject = function () { try { - /* global ActiveXObject */ + /* global ActiveXObject -- old IE */ activeXDocument = document.domain && new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); @@ -2156,7 +2163,7 @@ var doric = (function (exports) { hiddenKeys[IE_PROTO] = true; // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create + // https://tc39.es/ecma262/#sec-object.create var objectCreate = Object.create || function create(O, Properties) { var result; if (O !== null) { @@ -2265,7 +2272,7 @@ var doric = (function (exports) { var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation - // https://tc39.github.io/ecma262/#sec-arrayspeciescreate + // https://tc39.es/ecma262/#sec-arrayspeciescreate var arraySpeciesCreate = function (originalArray, length) { var C; if (isArray(originalArray)) { @@ -2281,13 +2288,14 @@ var doric = (function (exports) { var push = [].push; - // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation + // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation var createMethod$1 = function (TYPE) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; + var IS_FILTER_OUT = TYPE == 7; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject($this); @@ -2296,7 +2304,7 @@ var doric = (function (exports) { var length = toLength(self.length); var index = 0; var create = specificCreate || arraySpeciesCreate; - var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined; var value, result; for (;length > index; index++) { if (NO_HOLES || index in self) { value = self[index]; @@ -2308,7 +2316,10 @@ var doric = (function (exports) { case 5: return value; // find case 6: return index; // findIndex case 2: push.call(target, value); // filter - } } else if (IS_EVERY) { return false; } // every + } } else { switch (TYPE) { + case 4: return false; // every + case 7: push.call(target, value); // filterOut + } } } } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; @@ -2317,26 +2328,29 @@ var doric = (function (exports) { var arrayIteration = { // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + // https://tc39.es/ecma262/#sec-array.prototype.foreach forEach: createMethod$1(0), // `Array.prototype.map` method - // https://tc39.github.io/ecma262/#sec-array.prototype.map + // https://tc39.es/ecma262/#sec-array.prototype.map map: createMethod$1(1), // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter + // https://tc39.es/ecma262/#sec-array.prototype.filter filter: createMethod$1(2), // `Array.prototype.some` method - // https://tc39.github.io/ecma262/#sec-array.prototype.some + // https://tc39.es/ecma262/#sec-array.prototype.some some: createMethod$1(3), // `Array.prototype.every` method - // https://tc39.github.io/ecma262/#sec-array.prototype.every + // https://tc39.es/ecma262/#sec-array.prototype.every every: createMethod$1(4), // `Array.prototype.find` method - // https://tc39.github.io/ecma262/#sec-array.prototype.find + // https://tc39.es/ecma262/#sec-array.prototype.find find: createMethod$1(5), // `Array.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex - findIndex: createMethod$1(6) + // https://tc39.es/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod$1(6), + // `Array.prototype.filterOut` method + // https://github.com/tc39/proposal-array-filtering + filterOut: createMethod$1(7) }; var $forEach = arrayIteration.forEach; @@ -2464,7 +2478,7 @@ var doric = (function (exports) { }; // `Symbol` constructor - // https://tc39.github.io/ecma262/#sec-symbol-constructor + // https://tc39.es/ecma262/#sec-symbol-constructor if (!nativeSymbol) { $Symbol = function Symbol() { if (this instanceof $Symbol) { throw TypeError('Symbol is not a constructor'); } @@ -2521,7 +2535,7 @@ var doric = (function (exports) { _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, { // `Symbol.for` method - // https://tc39.github.io/ecma262/#sec-symbol.for + // https://tc39.es/ecma262/#sec-symbol.for 'for': function (key) { var string = String(key); if (has(StringToSymbolRegistry, string)) { return StringToSymbolRegistry[string]; } @@ -2531,7 +2545,7 @@ var doric = (function (exports) { return symbol; }, // `Symbol.keyFor` method - // https://tc39.github.io/ecma262/#sec-symbol.keyfor + // https://tc39.es/ecma262/#sec-symbol.keyfor keyFor: function keyFor(sym) { if (!isSymbol(sym)) { throw TypeError(sym + ' is not a symbol'); } if (has(SymbolToStringRegistry, sym)) { return SymbolToStringRegistry[sym]; } @@ -2542,25 +2556,25 @@ var doric = (function (exports) { _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, { // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create + // https://tc39.es/ecma262/#sec-object.create create: $create, // `Object.defineProperty` method - // https://tc39.github.io/ecma262/#sec-object.defineproperty + // https://tc39.es/ecma262/#sec-object.defineproperty defineProperty: $defineProperty, // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties + // https://tc39.es/ecma262/#sec-object.defineproperties defineProperties: $defineProperties, // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors getOwnPropertyDescriptor: $getOwnPropertyDescriptor }); _export({ target: 'Object', stat: true, forced: !nativeSymbol }, { // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + // https://tc39.es/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames, // `Object.getOwnPropertySymbols` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols + // https://tc39.es/ecma262/#sec-object.getownpropertysymbols getOwnPropertySymbols: $getOwnPropertySymbols }); @@ -2573,7 +2587,7 @@ var doric = (function (exports) { }); // `JSON.stringify` method behavior with symbols - // https://tc39.github.io/ecma262/#sec-json.stringify + // https://tc39.es/ecma262/#sec-json.stringify if ($stringify) { var FORCED_JSON_STRINGIFY = !nativeSymbol || fails(function () { var symbol = $Symbol(); @@ -2586,7 +2600,7 @@ var doric = (function (exports) { }); _export({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, { - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars -- required for `.length` stringify: function stringify(it, replacer, space) { var arguments$1 = arguments; @@ -2607,18 +2621,18 @@ var doric = (function (exports) { } // `Symbol.prototype[@@toPrimitive]` method - // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive + // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) { createNonEnumerableProperty($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf); } // `Symbol.prototype[@@toStringTag]` property - // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag + // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag setToStringTag($Symbol, SYMBOL); hiddenKeys[HIDDEN] = true; // `Symbol.asyncIterator` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.asynciterator + // https://tc39.es/ecma262/#sec-symbol.asynciterator defineWellKnownSymbol('asyncIterator'); var defineProperty$2 = objectDefineProperty.f; @@ -2665,63 +2679,1272 @@ var doric = (function (exports) { } // `Symbol.hasInstance` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.hasinstance + // https://tc39.es/ecma262/#sec-symbol.hasinstance defineWellKnownSymbol('hasInstance'); // `Symbol.isConcatSpreadable` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.isconcatspreadable + // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable defineWellKnownSymbol('isConcatSpreadable'); // `Symbol.iterator` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.iterator + // https://tc39.es/ecma262/#sec-symbol.iterator defineWellKnownSymbol('iterator'); // `Symbol.match` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.match + // https://tc39.es/ecma262/#sec-symbol.match defineWellKnownSymbol('match'); // `Symbol.matchAll` well-known symbol + // https://tc39.es/ecma262/#sec-symbol.matchall defineWellKnownSymbol('matchAll'); // `Symbol.replace` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.replace + // https://tc39.es/ecma262/#sec-symbol.replace defineWellKnownSymbol('replace'); // `Symbol.search` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.search + // https://tc39.es/ecma262/#sec-symbol.search defineWellKnownSymbol('search'); // `Symbol.species` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.species + // https://tc39.es/ecma262/#sec-symbol.species defineWellKnownSymbol('species'); // `Symbol.split` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.split + // https://tc39.es/ecma262/#sec-symbol.split defineWellKnownSymbol('split'); // `Symbol.toPrimitive` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.toprimitive + // https://tc39.es/ecma262/#sec-symbol.toprimitive defineWellKnownSymbol('toPrimitive'); // `Symbol.toStringTag` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.tostringtag + // https://tc39.es/ecma262/#sec-symbol.tostringtag defineWellKnownSymbol('toStringTag'); // `Symbol.unscopables` well-known symbol - // https://tc39.github.io/ecma262/#sec-symbol.unscopables + // https://tc39.es/ecma262/#sec-symbol.unscopables defineWellKnownSymbol('unscopables'); + var correctPrototypeGetter = !fails(function () { + function F() { /* empty */ } + F.prototype.constructor = null; + return Object.getPrototypeOf(new F()) !== F.prototype; + }); + + var IE_PROTO$1 = sharedKey('IE_PROTO'); + var ObjectPrototype$1 = Object.prototype; + + // `Object.getPrototypeOf` method + // https://tc39.es/ecma262/#sec-object.getprototypeof + var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) { + O = toObject(O); + if (has(O, IE_PROTO$1)) { return O[IE_PROTO$1]; } + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectPrototype$1 : null; + }; + + var aPossiblePrototype = function (it) { + if (!isObject(it) && it !== null) { + throw TypeError("Can't set " + String(it) + ' as a prototype'); + } return it; + }; + + /* eslint-disable no-proto -- safe */ + + + + // `Object.setPrototypeOf` method + // https://tc39.es/ecma262/#sec-object.setprototypeof + // Works with __proto__ only. Old v8 can't work with null proto objects. + var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { + var CORRECT_SETTER = false; + var test = {}; + var setter; + try { + setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; + setter.call(test, []); + CORRECT_SETTER = test instanceof Array; + } catch (error) { /* empty */ } + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) { setter.call(O, proto); } + else { O.__proto__ = proto; } + return O; + }; + }() : undefined); + + var iterators = {}; + + var ITERATOR = wellKnownSymbol('iterator'); + var ArrayPrototype = Array.prototype; + + // check on default Array iterator + var isArrayIteratorMethod = function (it) { + return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR] === it); + }; + + var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag'); + var test = {}; + + test[TO_STRING_TAG$1] = 'z'; + + var toStringTagSupport = String(test) === '[object z]'; + + var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag'); + // ES3 wrong here + var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; + + // fallback for IE11 Script Access Denied error + var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { /* empty */ } + }; + + // getting tag from ES6+ `Object.prototype.toString` + var classof = toStringTagSupport ? classofRaw : function (it) { + var O, tag, result; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag + // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) + // ES3 arguments fallback + : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; + }; + + var ITERATOR$1 = wellKnownSymbol('iterator'); + + var getIteratorMethod = function (it) { + if (it != undefined) { return it[ITERATOR$1] + || it['@@iterator'] + || iterators[classof(it)]; } + }; + + var iteratorClose = function (iterator) { + var returnMethod = iterator['return']; + if (returnMethod !== undefined) { + return anObject(returnMethod.call(iterator)).value; + } + }; + + var Result = function (stopped, result) { + this.stopped = stopped; + this.result = result; + }; + + var iterate = function (iterable, unboundFunction, options) { + var that = options && options.that; + var AS_ENTRIES = !!(options && options.AS_ENTRIES); + var IS_ITERATOR = !!(options && options.IS_ITERATOR); + var INTERRUPTED = !!(options && options.INTERRUPTED); + var fn = functionBindContext(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED); + var iterator, iterFn, index, length, result, next, step; + + var stop = function (condition) { + if (iterator) { iteratorClose(iterator); } + return new Result(true, condition); + }; + + var callFn = function (value) { + if (AS_ENTRIES) { + anObject(value); + return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); + } return INTERRUPTED ? fn(value, stop) : fn(value); + }; + + if (IS_ITERATOR) { + iterator = iterable; + } else { + iterFn = getIteratorMethod(iterable); + if (typeof iterFn != 'function') { throw TypeError('Target is not iterable'); } + // optimisation for array iterators + if (isArrayIteratorMethod(iterFn)) { + for (index = 0, length = toLength(iterable.length); length > index; index++) { + result = callFn(iterable[index]); + if (result && result instanceof Result) { return result; } + } return new Result(false); + } + iterator = iterFn.call(iterable); + } + + next = iterator.next; + while (!(step = next.call(iterator)).done) { + try { + result = callFn(step.value); + } catch (error) { + iteratorClose(iterator); + throw error; + } + if (typeof result == 'object' && result && result instanceof Result) { return result; } + } return new Result(false); + }; + + var $AggregateError = function AggregateError(errors, message) { + var that = this; + if (!(that instanceof $AggregateError)) { return new $AggregateError(errors, message); } + if (objectSetPrototypeOf) { + // eslint-disable-next-line unicorn/error-message -- expected + that = objectSetPrototypeOf(new Error(undefined), objectGetPrototypeOf(that)); + } + if (message !== undefined) { createNonEnumerableProperty(that, 'message', String(message)); } + var errorsArray = []; + iterate(errors, errorsArray.push, { that: errorsArray }); + createNonEnumerableProperty(that, 'errors', errorsArray); + return that; + }; + + $AggregateError.prototype = objectCreate(Error.prototype, { + constructor: createPropertyDescriptor(5, $AggregateError), + message: createPropertyDescriptor(5, ''), + name: createPropertyDescriptor(5, 'AggregateError') + }); + + // `AggregateError` constructor + // https://tc39.es/ecma262/#sec-aggregate-error-constructor + _export({ global: true }, { + AggregateError: $AggregateError + }); + + // call something on iterator step with safe closing on error + var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (error) { + iteratorClose(iterator); + throw error; + } + }; + + var createProperty = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) { objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value)); } + else { object[propertyKey] = value; } + }; + + // `Array.from` method implementation + // https://tc39.es/ecma262/#sec-array.from + var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var index = 0; + var length, result, step, iterator, next, value; + if (mapping) { mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); } + // if the target is not iterable or it's an array with the default iterator - use a simple case + if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { + iterator = iteratorMethod.call(O); + next = iterator.next; + result = new C(); + for (;!(step = next.call(iterator)).done; index++) { + value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; + createProperty(result, index, value); + } + } else { + length = toLength(O.length); + result = new C(length); + for (;length > index; index++) { + value = mapping ? mapfn(O[index], index) : O[index]; + createProperty(result, index, value); + } + } + result.length = index; + return result; + }; + + var ITERATOR$2 = wellKnownSymbol('iterator'); + var SAFE_CLOSING = false; + + try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { done: !!called++ }; + }, + 'return': function () { + SAFE_CLOSING = true; + } + }; + iteratorWithReturn[ITERATOR$2] = function () { + return this; + }; + // eslint-disable-next-line no-throw-literal -- required for testing + Array.from(iteratorWithReturn, function () { throw 2; }); + } catch (error) { /* empty */ } + + var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) { + if (!SKIP_CLOSING && !SAFE_CLOSING) { return false; } + var ITERATION_SUPPORT = false; + try { + var object = {}; + object[ITERATOR$2] = function () { + return { + next: function () { + return { done: ITERATION_SUPPORT = true }; + } + }; + }; + exec(object); + } catch (error) { /* empty */ } + return ITERATION_SUPPORT; + }; + + var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { + Array.from(iterable); + }); + + // `Array.from` method + // https://tc39.es/ecma262/#sec-array.from + _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { + from: arrayFrom + }); + + // `Array.isArray` method + // https://tc39.es/ecma262/#sec-array.isarray + _export({ target: 'Array', stat: true }, { + isArray: isArray + }); + + var ISNT_GENERIC = fails(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); + }); + + // `Array.of` method + // https://tc39.es/ecma262/#sec-array.of + // WebKit Array.of isn't generic + _export({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { + of: function of(/* ...args */) { + var arguments$1 = arguments; + + var index = 0; + var argumentsLength = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(argumentsLength); + while (argumentsLength > index) { createProperty(result, index, arguments$1[index++]); } + result.length = argumentsLength; + return result; + } + }); + + var engineUserAgent = getBuiltIn('navigator', 'userAgent') || ''; + + var process$1 = global_1.process; + var versions = process$1 && process$1.versions; + var v8 = versions && versions.v8; + var match, version; + + if (v8) { + match = v8.split('.'); + version = match[0] + match[1]; + } else if (engineUserAgent) { + match = engineUserAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = engineUserAgent.match(/Chrome\/(\d+)/); + if (match) { version = match[1]; } + } + } + + var engineV8Version = version && +version; + + var SPECIES$1 = wellKnownSymbol('species'); + + var arrayMethodHasSpeciesSupport = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return engineV8Version >= 51 || !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES$1] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); + }; + + var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); + var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; + var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; + + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/679 + var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () { + var array = []; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat()[0] !== array; + }); + + var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); + + var isConcatSpreadable = function (O) { + if (!isObject(O)) { return false; } + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); + }; + + var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; + + // `Array.prototype.concat` method + // https://tc39.es/ecma262/#sec-array.prototype.concat + // with adding support of @@isConcatSpreadable and @@species + _export({ target: 'Array', proto: true, forced: FORCED }, { + // eslint-disable-next-line no-unused-vars -- required for `.length` + concat: function concat(arg) { + var arguments$1 = arguments; + + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, k, length, len, E; + for (i = -1, length = arguments.length; i < length; i++) { + E = i === -1 ? O : arguments$1[i]; + if (isConcatSpreadable(E)) { + len = toLength(E.length); + if (n + len > MAX_SAFE_INTEGER) { throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); } + for (k = 0; k < len; k++, n++) { if (k in E) { createProperty(A, n, E[k]); } } + } else { + if (n >= MAX_SAFE_INTEGER) { throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); } + createProperty(A, n++, E); + } + } + A.length = n; + return A; + } + }); + + var min$2 = Math.min; + + // `Array.prototype.copyWithin` method implementation + // https://tc39.es/ecma262/#sec-array.prototype.copywithin + var arrayCopyWithin = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = min$2((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) { O[to] = O[from]; } + else { delete O[to]; } + to += inc; + from += inc; + } return O; + }; + + var UNSCOPABLES = wellKnownSymbol('unscopables'); + var ArrayPrototype$1 = Array.prototype; + + // Array.prototype[@@unscopables] + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + if (ArrayPrototype$1[UNSCOPABLES] == undefined) { + objectDefineProperty.f(ArrayPrototype$1, UNSCOPABLES, { + configurable: true, + value: objectCreate(null) + }); + } + + // add a key to Array.prototype[@@unscopables] + var addToUnscopables = function (key) { + ArrayPrototype$1[UNSCOPABLES][key] = true; + }; + + // `Array.prototype.copyWithin` method + // https://tc39.es/ecma262/#sec-array.prototype.copywithin + _export({ target: 'Array', proto: true }, { + copyWithin: arrayCopyWithin + }); + + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('copyWithin'); + + var arrayMethodIsStrict = function (METHOD_NAME, argument) { + var method = [][METHOD_NAME]; + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing + method.call(null, argument || function () { throw 1; }, 1); + }); + }; + + var $every = arrayIteration.every; + + + var STRICT_METHOD = arrayMethodIsStrict('every'); + + // `Array.prototype.every` method + // https://tc39.es/ecma262/#sec-array.prototype.every + _export({ target: 'Array', proto: true, forced: !STRICT_METHOD }, { + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + // `Array.prototype.fill` method implementation + // https://tc39.es/ecma262/#sec-array.prototype.fill + var arrayFill = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); + var end = argumentsLength > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) { O[index++] = value; } + return O; + }; + + // `Array.prototype.fill` method + // https://tc39.es/ecma262/#sec-array.prototype.fill + _export({ target: 'Array', proto: true }, { + fill: arrayFill + }); + + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('fill'); + + var $filter = arrayIteration.filter; + + + var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); + + // `Array.prototype.filter` method + // https://tc39.es/ecma262/#sec-array.prototype.filter + // with adding support of @@species + _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + var $find = arrayIteration.find; + + + var FIND = 'find'; + var SKIPS_HOLES = true; + + // Shouldn't skip holes + if (FIND in []) { Array(1)[FIND](function () { SKIPS_HOLES = false; }); } + + // `Array.prototype.find` method + // https://tc39.es/ecma262/#sec-array.prototype.find + _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables(FIND); + + var $findIndex = arrayIteration.findIndex; + + + var FIND_INDEX = 'findIndex'; + var SKIPS_HOLES$1 = true; + + // Shouldn't skip holes + if (FIND_INDEX in []) { Array(1)[FIND_INDEX](function () { SKIPS_HOLES$1 = false; }); } + + // `Array.prototype.findIndex` method + // https://tc39.es/ecma262/#sec-array.prototype.findindex + _export({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables(FIND_INDEX); + + // `FlattenIntoArray` abstract operation + // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray + var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? functionBindContext(mapper, thisArg, 3) : false; + var element; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + if (depth > 0 && isArray(element)) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1FFFFFFFFFFFFF) { throw TypeError('Exceed the acceptable array length'); } + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; + }; + + var flattenIntoArray_1 = flattenIntoArray; + + // `Array.prototype.flat` method + // https://tc39.es/ecma262/#sec-array.prototype.flat + _export({ target: 'Array', proto: true }, { + flat: function flat(/* depthArg = 1 */) { + var depthArg = arguments.length ? arguments[0] : undefined; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + A.length = flattenIntoArray_1(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } + }); + + // `Array.prototype.flatMap` method + // https://tc39.es/ecma262/#sec-array.prototype.flatmap + _export({ target: 'Array', proto: true }, { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen = toLength(O.length); + var A; + aFunction$1(callbackfn); + A = arraySpeciesCreate(O, 0); + A.length = flattenIntoArray_1(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + return A; + } + }); + + var $forEach$1 = arrayIteration.forEach; + + + var STRICT_METHOD$1 = arrayMethodIsStrict('forEach'); + + // `Array.prototype.forEach` method implementation + // https://tc39.es/ecma262/#sec-array.prototype.foreach + var arrayForEach = !STRICT_METHOD$1 ? function forEach(callbackfn /* , thisArg */) { + return $forEach$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } : [].forEach; + + // `Array.prototype.forEach` method + // https://tc39.es/ecma262/#sec-array.prototype.foreach + _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, { + forEach: arrayForEach + }); + + var $includes = arrayIncludes.includes; + + + // `Array.prototype.includes` method + // https://tc39.es/ecma262/#sec-array.prototype.includes + _export({ target: 'Array', proto: true }, { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('includes'); + + var $indexOf = arrayIncludes.indexOf; + + + var nativeIndexOf = [].indexOf; + + var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; + var STRICT_METHOD$2 = arrayMethodIsStrict('indexOf'); + + // `Array.prototype.indexOf` method + // https://tc39.es/ecma262/#sec-array.prototype.indexof + _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$2 }, { + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? nativeIndexOf.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + var nativeJoin = [].join; + + var ES3_STRINGS = indexedObject != Object; + var STRICT_METHOD$3 = arrayMethodIsStrict('join', ','); + + // `Array.prototype.join` method + // https://tc39.es/ecma262/#sec-array.prototype.join + _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$3 }, { + join: function join(separator) { + return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator); + } + }); + + var min$3 = Math.min; + var nativeLastIndexOf = [].lastIndexOf; + var NEGATIVE_ZERO$1 = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; + var STRICT_METHOD$4 = arrayMethodIsStrict('lastIndexOf'); + var FORCED$1 = NEGATIVE_ZERO$1 || !STRICT_METHOD$4; + + // `Array.prototype.lastIndexOf` method implementation + // https://tc39.es/ecma262/#sec-array.prototype.lastindexof + var arrayLastIndexOf = FORCED$1 ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO$1) { return nativeLastIndexOf.apply(this, arguments) || 0; } + var O = toIndexedObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) { index = min$3(index, toInteger(arguments[1])); } + if (index < 0) { index = length + index; } + for (;index >= 0; index--) { if (index in O && O[index] === searchElement) { return index || 0; } } + return -1; + } : nativeLastIndexOf; + + // `Array.prototype.lastIndexOf` method + // https://tc39.es/ecma262/#sec-array.prototype.lastindexof + _export({ target: 'Array', proto: true, forced: arrayLastIndexOf !== [].lastIndexOf }, { + lastIndexOf: arrayLastIndexOf + }); + + var $map = arrayIteration.map; + + + var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map'); + + // `Array.prototype.map` method + // https://tc39.es/ecma262/#sec-array.prototype.map + // with adding support of @@species + _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + // `Array.prototype.{ reduce, reduceRight }` methods implementation + var createMethod$2 = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + aFunction$1(callbackfn); + var O = toObject(that); + var self = indexedObject(O); + var length = toLength(O.length); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) { while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (IS_RIGHT ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } } + for (;IS_RIGHT ? index >= 0 : length > index; index += i) { if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } } + return memo; + }; + }; + + var arrayReduce = { + // `Array.prototype.reduce` method + // https://tc39.es/ecma262/#sec-array.prototype.reduce + left: createMethod$2(false), + // `Array.prototype.reduceRight` method + // https://tc39.es/ecma262/#sec-array.prototype.reduceright + right: createMethod$2(true) + }; + + var engineIsNode = classofRaw(global_1.process) == 'process'; + + var $reduce = arrayReduce.left; + + + + + var STRICT_METHOD$5 = arrayMethodIsStrict('reduce'); + // Chrome 80-82 has a critical bug + // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 + var CHROME_BUG = !engineIsNode && engineV8Version > 79 && engineV8Version < 83; + + // `Array.prototype.reduce` method + // https://tc39.es/ecma262/#sec-array.prototype.reduce + _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$5 || CHROME_BUG }, { + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + var $reduceRight = arrayReduce.right; + + + + + var STRICT_METHOD$6 = arrayMethodIsStrict('reduceRight'); + // Chrome 80-82 has a critical bug + // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 + var CHROME_BUG$1 = !engineIsNode && engineV8Version > 79 && engineV8Version < 83; + + // `Array.prototype.reduceRight` method + // https://tc39.es/ecma262/#sec-array.prototype.reduceright + _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$6 || CHROME_BUG$1 }, { + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + var nativeReverse = [].reverse; + var test$1 = [1, 2]; + + // `Array.prototype.reverse` method + // https://tc39.es/ecma262/#sec-array.prototype.reverse + // fix for Safari 12.0 bug + // https://bugs.webkit.org/show_bug.cgi?id=188794 + _export({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, { + reverse: function reverse() { + // eslint-disable-next-line no-self-assign -- dirty hack + if (isArray(this)) { this.length = this.length; } + return nativeReverse.call(this); + } + }); + + var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('slice'); + + var SPECIES$2 = wellKnownSymbol('species'); + var nativeSlice = [].slice; + var max$1 = Math.max; + + // `Array.prototype.slice` method + // https://tc39.es/ecma262/#sec-array.prototype.slice + // fallback for not array-like ES3 strings and DOM objects + _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = toLength(O.length); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + var Constructor, result, n; + if (isArray(O)) { + Constructor = O.constructor; + // cross-realm fallback + if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { + Constructor = undefined; + } else if (isObject(Constructor)) { + Constructor = Constructor[SPECIES$2]; + if (Constructor === null) { Constructor = undefined; } + } + if (Constructor === Array || Constructor === undefined) { + return nativeSlice.call(O, k, fin); + } + } + result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0)); + for (n = 0; k < fin; k++, n++) { if (k in O) { createProperty(result, n, O[k]); } } + result.length = n; + return result; + } + }); + + var $some = arrayIteration.some; + + + var STRICT_METHOD$7 = arrayMethodIsStrict('some'); + + // `Array.prototype.some` method + // https://tc39.es/ecma262/#sec-array.prototype.some + _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$7 }, { + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + var test$2 = []; + var nativeSort = test$2.sort; + + // IE8- + var FAILS_ON_UNDEFINED = fails(function () { + test$2.sort(undefined); + }); + // V8 bug + var FAILS_ON_NULL = fails(function () { + test$2.sort(null); + }); + // Old WebKit + var STRICT_METHOD$8 = arrayMethodIsStrict('sort'); + + var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$8; + + // `Array.prototype.sort` method + // https://tc39.es/ecma262/#sec-array.prototype.sort + _export({ target: 'Array', proto: true, forced: FORCED$2 }, { + sort: function sort(comparefn) { + return comparefn === undefined + ? nativeSort.call(toObject(this)) + : nativeSort.call(toObject(this), aFunction$1(comparefn)); + } + }); + + var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport('splice'); + + var max$2 = Math.max; + var min$4 = Math.min; + var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF; + var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; + + // `Array.prototype.splice` method + // https://tc39.es/ecma262/#sec-array.prototype.splice + // with adding support of @@species + _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, { + splice: function splice(start, deleteCount /* , ...items */) { + var arguments$1 = arguments; + + var O = toObject(this); + var len = toLength(O.length); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var insertCount, actualDeleteCount, A, k, from, to; + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min$4(max$2(toInteger(deleteCount), 0), len - actualStart); + } + if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) { + throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); + } + A = arraySpeciesCreate(O, actualDeleteCount); + for (k = 0; k < actualDeleteCount; k++) { + from = actualStart + k; + if (from in O) { createProperty(A, k, O[from]); } + } + A.length = actualDeleteCount; + if (insertCount < actualDeleteCount) { + for (k = actualStart; k < len - actualDeleteCount; k++) { + from = k + actualDeleteCount; + to = k + insertCount; + if (from in O) { O[to] = O[from]; } + else { delete O[to]; } + } + for (k = len; k > len - actualDeleteCount + insertCount; k--) { delete O[k - 1]; } + } else if (insertCount > actualDeleteCount) { + for (k = len - actualDeleteCount; k > actualStart; k--) { + from = k + actualDeleteCount - 1; + to = k + insertCount - 1; + if (from in O) { O[to] = O[from]; } + else { delete O[to]; } + } + } + for (k = 0; k < insertCount; k++) { + O[k + actualStart] = arguments$1[k + 2]; + } + O.length = len - actualDeleteCount + insertCount; + return A; + } + }); + + var SPECIES$3 = wellKnownSymbol('species'); + + var setSpecies = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + var defineProperty = objectDefineProperty.f; + + if (descriptors && Constructor && !Constructor[SPECIES$3]) { + defineProperty(Constructor, SPECIES$3, { + configurable: true, + get: function () { return this; } + }); + } + }; + + // `Array[@@species]` getter + // https://tc39.es/ecma262/#sec-get-array-@@species + setSpecies('Array'); + + // this method was added to unscopables after implementation + // in popular engines, so it's moved to a separate module + + + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('flat'); + + // this method was added to unscopables after implementation + // in popular engines, so it's moved to a separate module + + + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('flatMap'); + + var ITERATOR$3 = wellKnownSymbol('iterator'); + var BUGGY_SAFARI_ITERATORS = false; + + var returnThis = function () { return this; }; + + // `%IteratorPrototype%` object + // https://tc39.es/ecma262/#sec-%iteratorprototype%-object + var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; + + if ([].keys) { + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!('next' in arrayIterator)) { BUGGY_SAFARI_ITERATORS = true; } + else { + PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) { IteratorPrototype = PrototypeOfArrayIteratorPrototype; } + } + } + + var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () { + var test = {}; + // FF44- legacy iterators case + return IteratorPrototype[ITERATOR$3].call(test) !== test; + }); + + if (NEW_ITERATOR_PROTOTYPE) { IteratorPrototype = {}; } + + // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() + if (!has(IteratorPrototype, ITERATOR$3)) { + createNonEnumerableProperty(IteratorPrototype, ITERATOR$3, returnThis); + } + + var iteratorsCore = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS + }; + + var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; + + + + + + var returnThis$1 = function () { return this; }; + + var createIteratorConstructor = function (IteratorConstructor, NAME, next) { + var TO_STRING_TAG = NAME + ' Iterator'; + IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false); + iterators[TO_STRING_TAG] = returnThis$1; + return IteratorConstructor; + }; + + var IteratorPrototype$2 = iteratorsCore.IteratorPrototype; + var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS; + var ITERATOR$4 = wellKnownSymbol('iterator'); + var KEYS = 'keys'; + var VALUES = 'values'; + var ENTRIES = 'entries'; + + var returnThis$2 = function () { return this; }; + + var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); + + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) { return defaultIterator; } + if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) { return IterablePrototype[KIND]; } + switch (KIND) { + case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; + case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; + case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; + } return function () { return new IteratorConstructor(this); }; + }; + + var TO_STRING_TAG = NAME + ' Iterator'; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = IterablePrototype[ITERATOR$4] + || IterablePrototype['@@iterator'] + || DEFAULT && IterablePrototype[DEFAULT]; + var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT); + var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; + var CurrentIteratorPrototype, methods, KEY; + + // fix native + if (anyNativeIterator) { + CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable())); + if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) { + if (objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) { + if (objectSetPrototypeOf) { + objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2); + } else if (typeof CurrentIteratorPrototype[ITERATOR$4] != 'function') { + createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$4, returnThis$2); + } + } + // Set @@toStringTag to native iterators + setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true); + } + } + + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { + INCORRECT_VALUES_NAME = true; + defaultIterator = function values() { return nativeIterator.call(this); }; + } + + // define iterator + if (IterablePrototype[ITERATOR$4] !== defaultIterator) { + createNonEnumerableProperty(IterablePrototype, ITERATOR$4, defaultIterator); + } + iterators[NAME] = defaultIterator; + + // export additional methods + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES) + }; + if (FORCED) { for (KEY in methods) { + if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { + redefine(IterablePrototype, KEY, methods[KEY]); + } + } } else { _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods); } + } + + return methods; + }; + + var ARRAY_ITERATOR = 'Array Iterator'; + var setInternalState$1 = internalState.set; + var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR); + + // `Array.prototype.entries` method + // https://tc39.es/ecma262/#sec-array.prototype.entries + // `Array.prototype.keys` method + // https://tc39.es/ecma262/#sec-array.prototype.keys + // `Array.prototype.values` method + // https://tc39.es/ecma262/#sec-array.prototype.values + // `Array.prototype[@@iterator]` method + // https://tc39.es/ecma262/#sec-array.prototype-@@iterator + // `CreateArrayIterator` internal method + // https://tc39.es/ecma262/#sec-createarrayiterator + var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) { + setInternalState$1(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), // target + index: 0, // next index + kind: kind // kind + }); + // `%ArrayIteratorPrototype%.next` method + // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next + }, function () { + var state = getInternalState$1(this); + var target = state.target; + var kind = state.kind; + var index = state.index++; + if (!target || index >= target.length) { + state.target = undefined; + return { value: undefined, done: true }; + } + if (kind == 'keys') { return { value: index, done: false }; } + if (kind == 'values') { return { value: target[index], done: false }; } + return { value: [index, target[index]], done: false }; + }, 'values'); + + // argumentsList[@@iterator] is %ArrayProto_values% + // https://tc39.es/ecma262/#sec-createunmappedargumentsobject + // https://tc39.es/ecma262/#sec-createmappedargumentsobject + iterators.Arguments = iterators.Array; + + // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables + addToUnscopables('keys'); + addToUnscopables('values'); + addToUnscopables('entries'); + + var slice = [].slice; + var factories = {}; + + var construct = function (C, argsLength, args) { + if (!(argsLength in factories)) { + for (var list = [], i = 0; i < argsLength; i++) { list[i] = 'a[' + i + ']'; } + // eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only + factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); + } return factories[argsLength](C, args); + }; + + // `Function.prototype.bind` method implementation + // https://tc39.es/ecma262/#sec-function.prototype.bind + var functionBind = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction$1(this); + var partArgs = slice.call(arguments, 1); + var boundFunction = function bound(/* args... */) { + var args = partArgs.concat(slice.call(arguments)); + return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); + }; + if (isObject(fn.prototype)) { boundFunction.prototype = fn.prototype; } + return boundFunction; + }; + + // `Function.prototype.bind` method + // https://tc39.es/ecma262/#sec-function.prototype.bind + _export({ target: 'Function', proto: true }, { + bind: functionBind + }); + + var defineProperty$3 = objectDefineProperty.f; + + var FunctionPrototype = Function.prototype; + var FunctionPrototypeToString = FunctionPrototype.toString; + var nameRE = /^\s*function ([^ (]*)/; + var NAME = 'name'; + + // Function instances `.name` property + // https://tc39.es/ecma262/#sec-function-instances-name + if (descriptors && !(NAME in FunctionPrototype)) { + defineProperty$3(FunctionPrototype, NAME, { + configurable: true, + get: function () { + try { + return FunctionPrototypeToString.call(this).match(nameRE)[1]; + } catch (error) { + return ''; + } + } + }); + } + + var HAS_INSTANCE = wellKnownSymbol('hasInstance'); + var FunctionPrototype$1 = Function.prototype; + + // `Function.prototype[@@hasInstance]` method + // https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance + if (!(HAS_INSTANCE in FunctionPrototype$1)) { + objectDefineProperty.f(FunctionPrototype$1, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) { return false; } + if (!isObject(this.prototype)) { return O instanceof this; } + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = objectGetPrototypeOf(O)) { if (this.prototype === O) { return true; } } + return false; + } }); + } + + // `globalThis` object + // https://tc39.es/ecma262/#sec-globalthis + _export({ global: true }, { + globalThis: global_1 + }); + var nativeAssign = Object.assign; - var defineProperty$3 = Object.defineProperty; + var defineProperty$4 = Object.defineProperty; // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign + // https://tc39.es/ecma262/#sec-object.assign var objectAssign = !nativeAssign || fails(function () { // should have correct order of operations (Edge bug) - if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$3({}, 'a', { + if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$4({}, 'a', { enumerable: true, get: function () { - defineProperty$3(this, 'b', { + defineProperty$4(this, 'b', { value: 3, enumerable: false }); @@ -2730,7 +3953,7 @@ var doric = (function (exports) { // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; - // eslint-disable-next-line no-undef + /* global Symbol -- required for testing */ var symbol = Symbol(); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; @@ -2738,7 +3961,7 @@ var doric = (function (exports) { return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; }) ? function assign(target, source) { var arguments$1 = arguments; - // eslint-disable-line no-unused-vars + // eslint-disable-line no-unused-vars -- required for `.length` var T = toObject(target); var argumentsLength = arguments.length; var index = 1; @@ -2758,25 +3981,25 @@ var doric = (function (exports) { } : nativeAssign; // `Object.assign` method - // https://tc39.github.io/ecma262/#sec-object.assign + // https://tc39.es/ecma262/#sec-object.assign _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, { assign: objectAssign }); // `Object.create` method - // https://tc39.github.io/ecma262/#sec-object.create + // https://tc39.es/ecma262/#sec-object.create _export({ target: 'Object', stat: true, sham: !descriptors }, { create: objectCreate }); // `Object.defineProperty` method - // https://tc39.github.io/ecma262/#sec-object.defineproperty + // https://tc39.es/ecma262/#sec-object.defineproperty _export({ target: 'Object', stat: true, forced: !descriptors, sham: !descriptors }, { defineProperty: objectDefineProperty.f }); // `Object.defineProperties` method - // https://tc39.github.io/ecma262/#sec-object.defineproperties + // https://tc39.es/ecma262/#sec-object.defineproperties _export({ target: 'Object', stat: true, forced: !descriptors, sham: !descriptors }, { defineProperties: objectDefineProperties }); @@ -2784,7 +4007,7 @@ var doric = (function (exports) { var propertyIsEnumerable = objectPropertyIsEnumerable.f; // `Object.{ entries, values }` methods implementation - var createMethod$2 = function (TO_ENTRIES) { + var createMethod$3 = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject(it); var keys = objectKeys(O); @@ -2804,17 +4027,17 @@ var doric = (function (exports) { var objectToArray = { // `Object.entries` method - // https://tc39.github.io/ecma262/#sec-object.entries - entries: createMethod$2(true), + // https://tc39.es/ecma262/#sec-object.entries + entries: createMethod$3(true), // `Object.values` method - // https://tc39.github.io/ecma262/#sec-object.values - values: createMethod$2(false) + // https://tc39.es/ecma262/#sec-object.values + values: createMethod$3(false) }; var $entries = objectToArray.entries; // `Object.entries` method - // https://tc39.github.io/ecma262/#sec-object.entries + // https://tc39.es/ecma262/#sec-object.entries _export({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); @@ -2892,126 +4115,21 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES = fails(function () { nativeFreeze(1); }); // `Object.freeze` method - // https://tc39.github.io/ecma262/#sec-object.freeze + // https://tc39.es/ecma262/#sec-object.freeze _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !freezing }, { freeze: function freeze(it) { return nativeFreeze && isObject(it) ? nativeFreeze(onFreeze(it)) : it; } }); - var iterators = {}; - - var ITERATOR = wellKnownSymbol('iterator'); - var ArrayPrototype = Array.prototype; - - // check on default Array iterator - var isArrayIteratorMethod = function (it) { - return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR] === it); - }; - - var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag'); - var test = {}; - - test[TO_STRING_TAG$1] = 'z'; - - var toStringTagSupport = String(test) === '[object z]'; - - var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag'); - // ES3 wrong here - var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; - - // fallback for IE11 Script Access Denied error - var tryGet = function (it, key) { - try { - return it[key]; - } catch (error) { /* empty */ } - }; - - // getting tag from ES6+ `Object.prototype.toString` - var classof = toStringTagSupport ? classofRaw : function (it) { - var O, tag, result; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag - // builtinTag case - : CORRECT_ARGUMENTS ? classofRaw(O) - // ES3 arguments fallback - : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; - }; - - var ITERATOR$1 = wellKnownSymbol('iterator'); - - var getIteratorMethod = function (it) { - if (it != undefined) { return it[ITERATOR$1] - || it['@@iterator'] - || iterators[classof(it)]; } - }; - - // call something on iterator step with safe closing on error - var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) { - try { - return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (error) { - var returnMethod = iterator['return']; - if (returnMethod !== undefined) { anObject(returnMethod.call(iterator)); } - throw error; - } - }; - - var iterate_1 = createCommonjsModule(function (module) { - var Result = function (stopped, result) { - this.stopped = stopped; - this.result = result; - }; - - var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) { - var boundFunction = functionBindContext(fn, that, AS_ENTRIES ? 2 : 1); - var iterator, iterFn, index, length, result, next, step; - - if (IS_ITERATOR) { - iterator = iterable; - } else { - iterFn = getIteratorMethod(iterable); - if (typeof iterFn != 'function') { throw TypeError('Target is not iterable'); } - // optimisation for array iterators - if (isArrayIteratorMethod(iterFn)) { - for (index = 0, length = toLength(iterable.length); length > index; index++) { - result = AS_ENTRIES - ? boundFunction(anObject(step = iterable[index])[0], step[1]) - : boundFunction(iterable[index]); - if (result && result instanceof Result) { return result; } - } return new Result(false); - } - iterator = iterFn.call(iterable); - } - - next = iterator.next; - while (!(step = next.call(iterator)).done) { - result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES); - if (typeof result == 'object' && result && result instanceof Result) { return result; } - } return new Result(false); - }; - - iterate.stop = function (result) { - return new Result(true, result); - }; - }); - - var createProperty = function (object, key, value) { - var propertyKey = toPrimitive(key); - if (propertyKey in object) { objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value)); } - else { object[propertyKey] = value; } - }; - // `Object.fromEntries` method // https://github.com/tc39/proposal-object-from-entries _export({ target: 'Object', stat: true }, { fromEntries: function fromEntries(iterable) { var obj = {}; - iterate_1(iterable, function (k, v) { + iterate(iterable, function (k, v) { createProperty(obj, k, v); - }, undefined, true); + }, { AS_ENTRIES: true }); return obj; } }); @@ -3020,18 +4138,18 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES$1 = fails(function () { nativeGetOwnPropertyDescriptor$2(1); }); - var FORCED = !descriptors || FAILS_ON_PRIMITIVES$1; + var FORCED$3 = !descriptors || FAILS_ON_PRIMITIVES$1; // `Object.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor - _export({ target: 'Object', stat: true, forced: FORCED, sham: !descriptors }, { + // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor + _export({ target: 'Object', stat: true, forced: FORCED$3, sham: !descriptors }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { return nativeGetOwnPropertyDescriptor$2(toIndexedObject(it), key); } }); // `Object.getOwnPropertyDescriptors` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors _export({ target: 'Object', stat: true, sham: !descriptors }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIndexedObject(object); @@ -3053,34 +4171,15 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES$2 = fails(function () { return !Object.getOwnPropertyNames(1); }); // `Object.getOwnPropertyNames` method - // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + // https://tc39.es/ecma262/#sec-object.getownpropertynames _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2 }, { getOwnPropertyNames: nativeGetOwnPropertyNames$2 }); - var correctPrototypeGetter = !fails(function () { - function F() { /* empty */ } - F.prototype.constructor = null; - return Object.getPrototypeOf(new F()) !== F.prototype; - }); - - var IE_PROTO$1 = sharedKey('IE_PROTO'); - var ObjectPrototype$1 = Object.prototype; - - // `Object.getPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.getprototypeof - var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) { - O = toObject(O); - if (has(O, IE_PROTO$1)) { return O[IE_PROTO$1]; } - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } return O instanceof Object ? ObjectPrototype$1 : null; - }; - var FAILS_ON_PRIMITIVES$3 = fails(function () { objectGetPrototypeOf(1); }); // `Object.getPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.getprototypeof + // https://tc39.es/ecma262/#sec-object.getprototypeof _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$3, sham: !correctPrototypeGetter }, { getPrototypeOf: function getPrototypeOf(it) { return objectGetPrototypeOf(toObject(it)); @@ -3088,14 +4187,14 @@ var doric = (function (exports) { }); // `SameValue` abstract operation - // https://tc39.github.io/ecma262/#sec-samevalue + // https://tc39.es/ecma262/#sec-samevalue var sameValue = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; // `Object.is` method - // https://tc39.github.io/ecma262/#sec-object.is + // https://tc39.es/ecma262/#sec-object.is _export({ target: 'Object', stat: true }, { is: sameValue }); @@ -3104,7 +4203,7 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES$4 = fails(function () { nativeIsExtensible(1); }); // `Object.isExtensible` method - // https://tc39.github.io/ecma262/#sec-object.isextensible + // https://tc39.es/ecma262/#sec-object.isextensible _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$4 }, { isExtensible: function isExtensible(it) { return isObject(it) ? nativeIsExtensible ? nativeIsExtensible(it) : true : false; @@ -3115,7 +4214,7 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES$5 = fails(function () { nativeIsFrozen(1); }); // `Object.isFrozen` method - // https://tc39.github.io/ecma262/#sec-object.isfrozen + // https://tc39.es/ecma262/#sec-object.isfrozen _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$5 }, { isFrozen: function isFrozen(it) { return isObject(it) ? nativeIsFrozen ? nativeIsFrozen(it) : false : true; @@ -3126,7 +4225,7 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES$6 = fails(function () { nativeIsSealed(1); }); // `Object.isSealed` method - // https://tc39.github.io/ecma262/#sec-object.issealed + // https://tc39.es/ecma262/#sec-object.issealed _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$6 }, { isSealed: function isSealed(it) { return isObject(it) ? nativeIsSealed ? nativeIsSealed(it) : false : true; @@ -3136,7 +4235,7 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES$7 = fails(function () { objectKeys(1); }); // `Object.keys` method - // https://tc39.github.io/ecma262/#sec-object.keys + // https://tc39.es/ecma262/#sec-object.keys _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$7 }, { keys: function keys(it) { return objectKeys(toObject(it)); @@ -3151,7 +4250,7 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES$8 = fails(function () { nativePreventExtensions(1); }); // `Object.preventExtensions` method - // https://tc39.github.io/ecma262/#sec-object.preventextensions + // https://tc39.es/ecma262/#sec-object.preventextensions _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$8, sham: !freezing }, { preventExtensions: function preventExtensions(it) { return nativePreventExtensions && isObject(it) ? nativePreventExtensions(onFreeze$1(it)) : it; @@ -3166,43 +4265,15 @@ var doric = (function (exports) { var FAILS_ON_PRIMITIVES$9 = fails(function () { nativeSeal(1); }); // `Object.seal` method - // https://tc39.github.io/ecma262/#sec-object.seal + // https://tc39.es/ecma262/#sec-object.seal _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$9, sham: !freezing }, { seal: function seal(it) { return nativeSeal && isObject(it) ? nativeSeal(onFreeze$2(it)) : it; } }); - var aPossiblePrototype = function (it) { - if (!isObject(it) && it !== null) { - throw TypeError("Can't set " + String(it) + ' as a prototype'); - } return it; - }; - // `Object.setPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.setprototypeof - // Works with __proto__ only. Old v8 can't work with null proto objects. - /* eslint-disable no-proto */ - var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { - var CORRECT_SETTER = false; - var test = {}; - var setter; - try { - setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; - setter.call(test, []); - CORRECT_SETTER = test instanceof Array; - } catch (error) { /* empty */ } - return function setPrototypeOf(O, proto) { - anObject(O); - aPossiblePrototype(proto); - if (CORRECT_SETTER) { setter.call(O, proto); } - else { O.__proto__ = proto; } - return O; - }; - }() : undefined); - - // `Object.setPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-object.setprototypeof + // https://tc39.es/ecma262/#sec-object.setprototypeof _export({ target: 'Object', stat: true }, { setPrototypeOf: objectSetPrototypeOf }); @@ -3210,7 +4281,7 @@ var doric = (function (exports) { var $values = objectToArray.values; // `Object.values` method - // https://tc39.github.io/ecma262/#sec-object.values + // https://tc39.es/ecma262/#sec-object.values _export({ target: 'Object', stat: true }, { values: function values(O) { return $values(O); @@ -3218,28 +4289,28 @@ var doric = (function (exports) { }); // `Object.prototype.toString` method implementation - // https://tc39.github.io/ecma262/#sec-object.prototype.tostring + // https://tc39.es/ecma262/#sec-object.prototype.tostring var objectToString = toStringTagSupport ? {}.toString : function toString() { return '[object ' + classof(this) + ']'; }; // `Object.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-object.prototype.tostring + // https://tc39.es/ecma262/#sec-object.prototype.tostring if (!toStringTagSupport) { redefine(Object.prototype, 'toString', objectToString, { unsafe: true }); } // Forced replacement object prototype accessors methods - var objectPrototypeAccessorsForced = !fails(function () { + var objectPrototypeAccessorsForced = !fails(function () { var key = Math.random(); // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call + // eslint-disable-next-line no-undef, no-useless-call -- required for testing __defineSetter__.call(null, key, function () { /* empty */ }); delete global_1[key]; }); // `Object.prototype.__defineGetter__` method - // https://tc39.github.io/ecma262/#sec-object.prototype.__defineGetter__ + // https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__ if (descriptors) { _export({ target: 'Object', proto: true, forced: objectPrototypeAccessorsForced }, { __defineGetter__: function __defineGetter__(P, getter) { @@ -3249,7 +4320,7 @@ var doric = (function (exports) { } // `Object.prototype.__defineSetter__` method - // https://tc39.github.io/ecma262/#sec-object.prototype.__defineSetter__ + // https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__ if (descriptors) { _export({ target: 'Object', proto: true, forced: objectPrototypeAccessorsForced }, { __defineSetter__: function __defineSetter__(P, setter) { @@ -3261,7 +4332,7 @@ var doric = (function (exports) { var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; // `Object.prototype.__lookupGetter__` method - // https://tc39.github.io/ecma262/#sec-object.prototype.__lookupGetter__ + // https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__ if (descriptors) { _export({ target: 'Object', proto: true, forced: objectPrototypeAccessorsForced }, { __lookupGetter__: function __lookupGetter__(P) { @@ -3278,7 +4349,7 @@ var doric = (function (exports) { var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f; // `Object.prototype.__lookupSetter__` method - // https://tc39.github.io/ecma262/#sec-object.prototype.__lookupSetter__ + // https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__ if (descriptors) { _export({ target: 'Object', proto: true, forced: objectPrototypeAccessorsForced }, { __lookupSetter__: function __lookupSetter__(P) { @@ -3292,1049 +4363,6 @@ var doric = (function (exports) { }); } - var slice = [].slice; - var factories = {}; - - var construct = function (C, argsLength, args) { - if (!(argsLength in factories)) { - for (var list = [], i = 0; i < argsLength; i++) { list[i] = 'a[' + i + ']'; } - // eslint-disable-next-line no-new-func - factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); - } return factories[argsLength](C, args); - }; - - // `Function.prototype.bind` method implementation - // https://tc39.github.io/ecma262/#sec-function.prototype.bind - var functionBind = Function.bind || function bind(that /* , ...args */) { - var fn = aFunction$1(this); - var partArgs = slice.call(arguments, 1); - var boundFunction = function bound(/* args... */) { - var args = partArgs.concat(slice.call(arguments)); - return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); - }; - if (isObject(fn.prototype)) { boundFunction.prototype = fn.prototype; } - return boundFunction; - }; - - // `Function.prototype.bind` method - // https://tc39.github.io/ecma262/#sec-function.prototype.bind - _export({ target: 'Function', proto: true }, { - bind: functionBind - }); - - var defineProperty$4 = objectDefineProperty.f; - - var FunctionPrototype = Function.prototype; - var FunctionPrototypeToString = FunctionPrototype.toString; - var nameRE = /^\s*function ([^ (]*)/; - var NAME = 'name'; - - // Function instances `.name` property - // https://tc39.github.io/ecma262/#sec-function-instances-name - if (descriptors && !(NAME in FunctionPrototype)) { - defineProperty$4(FunctionPrototype, NAME, { - configurable: true, - get: function () { - try { - return FunctionPrototypeToString.call(this).match(nameRE)[1]; - } catch (error) { - return ''; - } - } - }); - } - - var HAS_INSTANCE = wellKnownSymbol('hasInstance'); - var FunctionPrototype$1 = Function.prototype; - - // `Function.prototype[@@hasInstance]` method - // https://tc39.github.io/ecma262/#sec-function.prototype-@@hasinstance - if (!(HAS_INSTANCE in FunctionPrototype$1)) { - objectDefineProperty.f(FunctionPrototype$1, HAS_INSTANCE, { value: function (O) { - if (typeof this != 'function' || !isObject(O)) { return false; } - if (!isObject(this.prototype)) { return O instanceof this; } - // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - while (O = objectGetPrototypeOf(O)) { if (this.prototype === O) { return true; } } - return false; - } }); - } - - // `globalThis` object - // https://github.com/tc39/proposal-global - _export({ global: true }, { - globalThis: global_1 - }); - - // `Array.from` method implementation - // https://tc39.github.io/ecma262/#sec-array.from - var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { - var O = toObject(arrayLike); - var C = typeof this == 'function' ? this : Array; - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iteratorMethod = getIteratorMethod(O); - var index = 0; - var length, result, step, iterator, next, value; - if (mapping) { mapfn = functionBindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); } - // if the target is not iterable or it's an array with the default iterator - use a simple case - if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { - iterator = iteratorMethod.call(O); - next = iterator.next; - result = new C(); - for (;!(step = next.call(iterator)).done; index++) { - value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; - createProperty(result, index, value); - } - } else { - length = toLength(O.length); - result = new C(length); - for (;length > index; index++) { - value = mapping ? mapfn(O[index], index) : O[index]; - createProperty(result, index, value); - } - } - result.length = index; - return result; - }; - - var ITERATOR$2 = wellKnownSymbol('iterator'); - var SAFE_CLOSING = false; - - try { - var called = 0; - var iteratorWithReturn = { - next: function () { - return { done: !!called++ }; - }, - 'return': function () { - SAFE_CLOSING = true; - } - }; - iteratorWithReturn[ITERATOR$2] = function () { - return this; - }; - // eslint-disable-next-line no-throw-literal - Array.from(iteratorWithReturn, function () { throw 2; }); - } catch (error) { /* empty */ } - - var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) { return false; } - var ITERATION_SUPPORT = false; - try { - var object = {}; - object[ITERATOR$2] = function () { - return { - next: function () { - return { done: ITERATION_SUPPORT = true }; - } - }; - }; - exec(object); - } catch (error) { /* empty */ } - return ITERATION_SUPPORT; - }; - - var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { - Array.from(iterable); - }); - - // `Array.from` method - // https://tc39.github.io/ecma262/#sec-array.from - _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { - from: arrayFrom - }); - - // `Array.isArray` method - // https://tc39.github.io/ecma262/#sec-array.isarray - _export({ target: 'Array', stat: true }, { - isArray: isArray - }); - - var ISNT_GENERIC = fails(function () { - function F() { /* empty */ } - return !(Array.of.call(F) instanceof F); - }); - - // `Array.of` method - // https://tc39.github.io/ecma262/#sec-array.of - // WebKit Array.of isn't generic - _export({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { - of: function of(/* ...args */) { - var arguments$1 = arguments; - - var index = 0; - var argumentsLength = arguments.length; - var result = new (typeof this == 'function' ? this : Array)(argumentsLength); - while (argumentsLength > index) { createProperty(result, index, arguments$1[index++]); } - result.length = argumentsLength; - return result; - } - }); - - var engineUserAgent = getBuiltIn('navigator', 'userAgent') || ''; - - var process$1 = global_1.process; - var versions = process$1 && process$1.versions; - var v8 = versions && versions.v8; - var match, version; - - if (v8) { - match = v8.split('.'); - version = match[0] + match[1]; - } else if (engineUserAgent) { - match = engineUserAgent.match(/Edge\/(\d+)/); - if (!match || match[1] >= 74) { - match = engineUserAgent.match(/Chrome\/(\d+)/); - if (match) { version = match[1]; } - } - } - - var engineV8Version = version && +version; - - var SPECIES$1 = wellKnownSymbol('species'); - - var arrayMethodHasSpeciesSupport = function (METHOD_NAME) { - // We can't use this feature detection in V8 since it causes - // deoptimization and serious performance degradation - // https://github.com/zloirock/core-js/issues/677 - return engineV8Version >= 51 || !fails(function () { - var array = []; - var constructor = array.constructor = {}; - constructor[SPECIES$1] = function () { - return { foo: 1 }; - }; - return array[METHOD_NAME](Boolean).foo !== 1; - }); - }; - - var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); - var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; - var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; - - // We can't use this feature detection in V8 since it causes - // deoptimization and serious performance degradation - // https://github.com/zloirock/core-js/issues/679 - var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () { - var array = []; - array[IS_CONCAT_SPREADABLE] = false; - return array.concat()[0] !== array; - }); - - var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); - - var isConcatSpreadable = function (O) { - if (!isObject(O)) { return false; } - var spreadable = O[IS_CONCAT_SPREADABLE]; - return spreadable !== undefined ? !!spreadable : isArray(O); - }; - - var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; - - // `Array.prototype.concat` method - // https://tc39.github.io/ecma262/#sec-array.prototype.concat - // with adding support of @@isConcatSpreadable and @@species - _export({ target: 'Array', proto: true, forced: FORCED$1 }, { - concat: function concat(arg) { - var arguments$1 = arguments; - // eslint-disable-line no-unused-vars - var O = toObject(this); - var A = arraySpeciesCreate(O, 0); - var n = 0; - var i, k, length, len, E; - for (i = -1, length = arguments.length; i < length; i++) { - E = i === -1 ? O : arguments$1[i]; - if (isConcatSpreadable(E)) { - len = toLength(E.length); - if (n + len > MAX_SAFE_INTEGER) { throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); } - for (k = 0; k < len; k++, n++) { if (k in E) { createProperty(A, n, E[k]); } } - } else { - if (n >= MAX_SAFE_INTEGER) { throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); } - createProperty(A, n++, E); - } - } - A.length = n; - return A; - } - }); - - var min$2 = Math.min; - - // `Array.prototype.copyWithin` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin - var arrayCopyWithin = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = min$2((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) { O[to] = O[from]; } - else { delete O[to]; } - to += inc; - from += inc; - } return O; - }; - - var UNSCOPABLES = wellKnownSymbol('unscopables'); - var ArrayPrototype$1 = Array.prototype; - - // Array.prototype[@@unscopables] - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - if (ArrayPrototype$1[UNSCOPABLES] == undefined) { - objectDefineProperty.f(ArrayPrototype$1, UNSCOPABLES, { - configurable: true, - value: objectCreate(null) - }); - } - - // add a key to Array.prototype[@@unscopables] - var addToUnscopables = function (key) { - ArrayPrototype$1[UNSCOPABLES][key] = true; - }; - - // `Array.prototype.copyWithin` method - // https://tc39.github.io/ecma262/#sec-array.prototype.copywithin - _export({ target: 'Array', proto: true }, { - copyWithin: arrayCopyWithin - }); - - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('copyWithin'); - - var arrayMethodIsStrict = function (METHOD_NAME, argument) { - var method = [][METHOD_NAME]; - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call,no-throw-literal - method.call(null, argument || function () { throw 1; }, 1); - }); - }; - - var defineProperty$5 = Object.defineProperty; - var cache = {}; - - var thrower = function (it) { throw it; }; - - var arrayMethodUsesToLength = function (METHOD_NAME, options) { - if (has(cache, METHOD_NAME)) { return cache[METHOD_NAME]; } - if (!options) { options = {}; } - var method = [][METHOD_NAME]; - var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false; - var argument0 = has(options, 0) ? options[0] : thrower; - var argument1 = has(options, 1) ? options[1] : undefined; - - return cache[METHOD_NAME] = !!method && !fails(function () { - if (ACCESSORS && !descriptors) { return true; } - var O = { length: -1 }; - - if (ACCESSORS) { defineProperty$5(O, 1, { enumerable: true, get: thrower }); } - else { O[1] = 1; } - - method.call(O, argument0, argument1); - }); - }; - - var $every = arrayIteration.every; - - - - var STRICT_METHOD = arrayMethodIsStrict('every'); - var USES_TO_LENGTH = arrayMethodUsesToLength('every'); - - // `Array.prototype.every` method - // https://tc39.github.io/ecma262/#sec-array.prototype.every - _export({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, { - every: function every(callbackfn /* , thisArg */) { - return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - // `Array.prototype.fill` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.fill - var arrayFill = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var argumentsLength = arguments.length; - var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); - var end = argumentsLength > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) { O[index++] = value; } - return O; - }; - - // `Array.prototype.fill` method - // https://tc39.github.io/ecma262/#sec-array.prototype.fill - _export({ target: 'Array', proto: true }, { - fill: arrayFill - }); - - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('fill'); - - var $filter = arrayIteration.filter; - - - - var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); - // Edge 14- issue - var USES_TO_LENGTH$1 = arrayMethodUsesToLength('filter'); - - // `Array.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-array.prototype.filter - // with adding support of @@species - _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH$1 }, { - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - var $find = arrayIteration.find; - - - - var FIND = 'find'; - var SKIPS_HOLES = true; - - var USES_TO_LENGTH$2 = arrayMethodUsesToLength(FIND); - - // Shouldn't skip holes - if (FIND in []) { Array(1)[FIND](function () { SKIPS_HOLES = false; }); } - - // `Array.prototype.find` method - // https://tc39.github.io/ecma262/#sec-array.prototype.find - _export({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH$2 }, { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables(FIND); - - var $findIndex = arrayIteration.findIndex; - - - - var FIND_INDEX = 'findIndex'; - var SKIPS_HOLES$1 = true; - - var USES_TO_LENGTH$3 = arrayMethodUsesToLength(FIND_INDEX); - - // Shouldn't skip holes - if (FIND_INDEX in []) { Array(1)[FIND_INDEX](function () { SKIPS_HOLES$1 = false; }); } - - // `Array.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-array.prototype.findindex - _export({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 || !USES_TO_LENGTH$3 }, { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables(FIND_INDEX); - - // `FlattenIntoArray` abstract operation - // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray - var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? functionBindContext(mapper, thisArg, 3) : false; - var element; - - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - - if (depth > 0 && isArray(element)) { - targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; - } else { - if (targetIndex >= 0x1FFFFFFFFFFFFF) { throw TypeError('Exceed the acceptable array length'); } - target[targetIndex] = element; - } - - targetIndex++; - } - sourceIndex++; - } - return targetIndex; - }; - - var flattenIntoArray_1 = flattenIntoArray; - - // `Array.prototype.flat` method - // https://github.com/tc39/proposal-flatMap - _export({ target: 'Array', proto: true }, { - flat: function flat(/* depthArg = 1 */) { - var depthArg = arguments.length ? arguments[0] : undefined; - var O = toObject(this); - var sourceLen = toLength(O.length); - var A = arraySpeciesCreate(O, 0); - A.length = flattenIntoArray_1(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); - return A; - } - }); - - // `Array.prototype.flatMap` method - // https://github.com/tc39/proposal-flatMap - _export({ target: 'Array', proto: true }, { - flatMap: function flatMap(callbackfn /* , thisArg */) { - var O = toObject(this); - var sourceLen = toLength(O.length); - var A; - aFunction$1(callbackfn); - A = arraySpeciesCreate(O, 0); - A.length = flattenIntoArray_1(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - return A; - } - }); - - var $forEach$1 = arrayIteration.forEach; - - - - var STRICT_METHOD$1 = arrayMethodIsStrict('forEach'); - var USES_TO_LENGTH$4 = arrayMethodUsesToLength('forEach'); - - // `Array.prototype.forEach` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - var arrayForEach = (!STRICT_METHOD$1 || !USES_TO_LENGTH$4) ? function forEach(callbackfn /* , thisArg */) { - return $forEach$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } : [].forEach; - - // `Array.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-array.prototype.foreach - _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, { - forEach: arrayForEach - }); - - var $includes = arrayIncludes.includes; - - - - var USES_TO_LENGTH$5 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 }); - - // `Array.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-array.prototype.includes - _export({ target: 'Array', proto: true, forced: !USES_TO_LENGTH$5 }, { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('includes'); - - var $indexOf = arrayIncludes.indexOf; - - - - var nativeIndexOf = [].indexOf; - - var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; - var STRICT_METHOD$2 = arrayMethodIsStrict('indexOf'); - var USES_TO_LENGTH$6 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 }); - - // `Array.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.indexof - _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$2 || !USES_TO_LENGTH$6 }, { - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? nativeIndexOf.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - var nativeJoin = [].join; - - var ES3_STRINGS = indexedObject != Object; - var STRICT_METHOD$3 = arrayMethodIsStrict('join', ','); - - // `Array.prototype.join` method - // https://tc39.github.io/ecma262/#sec-array.prototype.join - _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$3 }, { - join: function join(separator) { - return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator); - } - }); - - var min$3 = Math.min; - var nativeLastIndexOf = [].lastIndexOf; - var NEGATIVE_ZERO$1 = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; - var STRICT_METHOD$4 = arrayMethodIsStrict('lastIndexOf'); - // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method - var USES_TO_LENGTH$7 = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 }); - var FORCED$2 = NEGATIVE_ZERO$1 || !STRICT_METHOD$4 || !USES_TO_LENGTH$7; - - // `Array.prototype.lastIndexOf` method implementation - // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof - var arrayLastIndexOf = FORCED$2 ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO$1) { return nativeLastIndexOf.apply(this, arguments) || 0; } - var O = toIndexedObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) { index = min$3(index, toInteger(arguments[1])); } - if (index < 0) { index = length + index; } - for (;index >= 0; index--) { if (index in O && O[index] === searchElement) { return index || 0; } } - return -1; - } : nativeLastIndexOf; - - // `Array.prototype.lastIndexOf` method - // https://tc39.github.io/ecma262/#sec-array.prototype.lastindexof - _export({ target: 'Array', proto: true, forced: arrayLastIndexOf !== [].lastIndexOf }, { - lastIndexOf: arrayLastIndexOf - }); - - var $map = arrayIteration.map; - - - - var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map'); - // FF49- issue - var USES_TO_LENGTH$8 = arrayMethodUsesToLength('map'); - - // `Array.prototype.map` method - // https://tc39.github.io/ecma262/#sec-array.prototype.map - // with adding support of @@species - _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$8 }, { - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - // `Array.prototype.{ reduce, reduceRight }` methods implementation - var createMethod$3 = function (IS_RIGHT) { - return function (that, callbackfn, argumentsLength, memo) { - aFunction$1(callbackfn); - var O = toObject(that); - var self = indexedObject(O); - var length = toLength(O.length); - var index = IS_RIGHT ? length - 1 : 0; - var i = IS_RIGHT ? -1 : 1; - if (argumentsLength < 2) { while (true) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (IS_RIGHT ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } } - for (;IS_RIGHT ? index >= 0 : length > index; index += i) { if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } } - return memo; - }; - }; - - var arrayReduce = { - // `Array.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduce - left: createMethod$3(false), - // `Array.prototype.reduceRight` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright - right: createMethod$3(true) - }; - - var $reduce = arrayReduce.left; - - - - var STRICT_METHOD$5 = arrayMethodIsStrict('reduce'); - var USES_TO_LENGTH$9 = arrayMethodUsesToLength('reduce', { 1: 0 }); - - // `Array.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduce - _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$5 || !USES_TO_LENGTH$9 }, { - reduce: function reduce(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - var $reduceRight = arrayReduce.right; - - - - var STRICT_METHOD$6 = arrayMethodIsStrict('reduceRight'); - // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method - var USES_TO_LENGTH$a = arrayMethodUsesToLength('reduce', { 1: 0 }); - - // `Array.prototype.reduceRight` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright - _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$6 || !USES_TO_LENGTH$a }, { - reduceRight: function reduceRight(callbackfn /* , initialValue */) { - return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - var nativeReverse = [].reverse; - var test$1 = [1, 2]; - - // `Array.prototype.reverse` method - // https://tc39.github.io/ecma262/#sec-array.prototype.reverse - // fix for Safari 12.0 bug - // https://bugs.webkit.org/show_bug.cgi?id=188794 - _export({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, { - reverse: function reverse() { - // eslint-disable-next-line no-self-assign - if (isArray(this)) { this.length = this.length; } - return nativeReverse.call(this); - } - }); - - var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('slice'); - var USES_TO_LENGTH$b = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 }); - - var SPECIES$2 = wellKnownSymbol('species'); - var nativeSlice = [].slice; - var max$1 = Math.max; - - // `Array.prototype.slice` method - // https://tc39.github.io/ecma262/#sec-array.prototype.slice - // fallback for not array-like ES3 strings and DOM objects - _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 || !USES_TO_LENGTH$b }, { - slice: function slice(start, end) { - var O = toIndexedObject(this); - var length = toLength(O.length); - var k = toAbsoluteIndex(start, length); - var fin = toAbsoluteIndex(end === undefined ? length : end, length); - // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible - var Constructor, result, n; - if (isArray(O)) { - Constructor = O.constructor; - // cross-realm fallback - if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { - Constructor = undefined; - } else if (isObject(Constructor)) { - Constructor = Constructor[SPECIES$2]; - if (Constructor === null) { Constructor = undefined; } - } - if (Constructor === Array || Constructor === undefined) { - return nativeSlice.call(O, k, fin); - } - } - result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0)); - for (n = 0; k < fin; k++, n++) { if (k in O) { createProperty(result, n, O[k]); } } - result.length = n; - return result; - } - }); - - var $some = arrayIteration.some; - - - - var STRICT_METHOD$7 = arrayMethodIsStrict('some'); - var USES_TO_LENGTH$c = arrayMethodUsesToLength('some'); - - // `Array.prototype.some` method - // https://tc39.github.io/ecma262/#sec-array.prototype.some - _export({ target: 'Array', proto: true, forced: !STRICT_METHOD$7 || !USES_TO_LENGTH$c }, { - some: function some(callbackfn /* , thisArg */) { - return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } - }); - - var test$2 = []; - var nativeSort = test$2.sort; - - // IE8- - var FAILS_ON_UNDEFINED = fails(function () { - test$2.sort(undefined); - }); - // V8 bug - var FAILS_ON_NULL = fails(function () { - test$2.sort(null); - }); - // Old WebKit - var STRICT_METHOD$8 = arrayMethodIsStrict('sort'); - - var FORCED$3 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$8; - - // `Array.prototype.sort` method - // https://tc39.github.io/ecma262/#sec-array.prototype.sort - _export({ target: 'Array', proto: true, forced: FORCED$3 }, { - sort: function sort(comparefn) { - return comparefn === undefined - ? nativeSort.call(toObject(this)) - : nativeSort.call(toObject(this), aFunction$1(comparefn)); - } - }); - - var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport('splice'); - var USES_TO_LENGTH$d = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 }); - - var max$2 = Math.max; - var min$4 = Math.min; - var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF; - var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; - - // `Array.prototype.splice` method - // https://tc39.github.io/ecma262/#sec-array.prototype.splice - // with adding support of @@species - _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 || !USES_TO_LENGTH$d }, { - splice: function splice(start, deleteCount /* , ...items */) { - var arguments$1 = arguments; - - var O = toObject(this); - var len = toLength(O.length); - var actualStart = toAbsoluteIndex(start, len); - var argumentsLength = arguments.length; - var insertCount, actualDeleteCount, A, k, from, to; - if (argumentsLength === 0) { - insertCount = actualDeleteCount = 0; - } else if (argumentsLength === 1) { - insertCount = 0; - actualDeleteCount = len - actualStart; - } else { - insertCount = argumentsLength - 2; - actualDeleteCount = min$4(max$2(toInteger(deleteCount), 0), len - actualStart); - } - if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) { - throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); - } - A = arraySpeciesCreate(O, actualDeleteCount); - for (k = 0; k < actualDeleteCount; k++) { - from = actualStart + k; - if (from in O) { createProperty(A, k, O[from]); } - } - A.length = actualDeleteCount; - if (insertCount < actualDeleteCount) { - for (k = actualStart; k < len - actualDeleteCount; k++) { - from = k + actualDeleteCount; - to = k + insertCount; - if (from in O) { O[to] = O[from]; } - else { delete O[to]; } - } - for (k = len; k > len - actualDeleteCount + insertCount; k--) { delete O[k - 1]; } - } else if (insertCount > actualDeleteCount) { - for (k = len - actualDeleteCount; k > actualStart; k--) { - from = k + actualDeleteCount - 1; - to = k + insertCount - 1; - if (from in O) { O[to] = O[from]; } - else { delete O[to]; } - } - } - for (k = 0; k < insertCount; k++) { - O[k + actualStart] = arguments$1[k + 2]; - } - O.length = len - actualDeleteCount + insertCount; - return A; - } - }); - - var SPECIES$3 = wellKnownSymbol('species'); - - var setSpecies = function (CONSTRUCTOR_NAME) { - var Constructor = getBuiltIn(CONSTRUCTOR_NAME); - var defineProperty = objectDefineProperty.f; - - if (descriptors && Constructor && !Constructor[SPECIES$3]) { - defineProperty(Constructor, SPECIES$3, { - configurable: true, - get: function () { return this; } - }); - } - }; - - // `Array[@@species]` getter - // https://tc39.github.io/ecma262/#sec-get-array-@@species - setSpecies('Array'); - - // this method was added to unscopables after implementation - // in popular engines, so it's moved to a separate module - - - addToUnscopables('flat'); - - // this method was added to unscopables after implementation - // in popular engines, so it's moved to a separate module - - - addToUnscopables('flatMap'); - - var ITERATOR$3 = wellKnownSymbol('iterator'); - var BUGGY_SAFARI_ITERATORS = false; - - var returnThis = function () { return this; }; - - // `%IteratorPrototype%` object - // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object - var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; - - if ([].keys) { - arrayIterator = [].keys(); - // Safari 8 has buggy iterators w/o `next` - if (!('next' in arrayIterator)) { BUGGY_SAFARI_ITERATORS = true; } - else { - PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)); - if (PrototypeOfArrayIteratorPrototype !== Object.prototype) { IteratorPrototype = PrototypeOfArrayIteratorPrototype; } - } - } - - if (IteratorPrototype == undefined) { IteratorPrototype = {}; } - - // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() - if ( !has(IteratorPrototype, ITERATOR$3)) { - createNonEnumerableProperty(IteratorPrototype, ITERATOR$3, returnThis); - } - - var iteratorsCore = { - IteratorPrototype: IteratorPrototype, - BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS - }; - - var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; - - - - - - var returnThis$1 = function () { return this; }; - - var createIteratorConstructor = function (IteratorConstructor, NAME, next) { - var TO_STRING_TAG = NAME + ' Iterator'; - IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) }); - setToStringTag(IteratorConstructor, TO_STRING_TAG, false); - iterators[TO_STRING_TAG] = returnThis$1; - return IteratorConstructor; - }; - - var IteratorPrototype$2 = iteratorsCore.IteratorPrototype; - var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS; - var ITERATOR$4 = wellKnownSymbol('iterator'); - var KEYS = 'keys'; - var VALUES = 'values'; - var ENTRIES = 'entries'; - - var returnThis$2 = function () { return this; }; - - var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); - - var getIterationMethod = function (KIND) { - if (KIND === DEFAULT && defaultIterator) { return defaultIterator; } - if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) { return IterablePrototype[KIND]; } - switch (KIND) { - case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; - case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; - case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; - } return function () { return new IteratorConstructor(this); }; - }; - - var TO_STRING_TAG = NAME + ' Iterator'; - var INCORRECT_VALUES_NAME = false; - var IterablePrototype = Iterable.prototype; - var nativeIterator = IterablePrototype[ITERATOR$4] - || IterablePrototype['@@iterator'] - || DEFAULT && IterablePrototype[DEFAULT]; - var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT); - var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; - var CurrentIteratorPrototype, methods, KEY; - - // fix native - if (anyNativeIterator) { - CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable())); - if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) { - if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) { - if (objectSetPrototypeOf) { - objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2); - } else if (typeof CurrentIteratorPrototype[ITERATOR$4] != 'function') { - createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$4, returnThis$2); - } - } - // Set @@toStringTag to native iterators - setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true); - } - } - - // fix Array#{values, @@iterator}.name in V8 / FF - if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { - INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { return nativeIterator.call(this); }; - } - - // define iterator - if ( IterablePrototype[ITERATOR$4] !== defaultIterator) { - createNonEnumerableProperty(IterablePrototype, ITERATOR$4, defaultIterator); - } - iterators[NAME] = defaultIterator; - - // export additional methods - if (DEFAULT) { - methods = { - values: getIterationMethod(VALUES), - keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), - entries: getIterationMethod(ENTRIES) - }; - if (FORCED) { for (KEY in methods) { - if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { - redefine(IterablePrototype, KEY, methods[KEY]); - } - } } else { _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods); } - } - - return methods; - }; - - var ARRAY_ITERATOR = 'Array Iterator'; - var setInternalState$1 = internalState.set; - var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR); - - // `Array.prototype.entries` method - // https://tc39.github.io/ecma262/#sec-array.prototype.entries - // `Array.prototype.keys` method - // https://tc39.github.io/ecma262/#sec-array.prototype.keys - // `Array.prototype.values` method - // https://tc39.github.io/ecma262/#sec-array.prototype.values - // `Array.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator - // `CreateArrayIterator` internal method - // https://tc39.github.io/ecma262/#sec-createarrayiterator - var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) { - setInternalState$1(this, { - type: ARRAY_ITERATOR, - target: toIndexedObject(iterated), // target - index: 0, // next index - kind: kind // kind - }); - // `%ArrayIteratorPrototype%.next` method - // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next - }, function () { - var state = getInternalState$1(this); - var target = state.target; - var kind = state.kind; - var index = state.index++; - if (!target || index >= target.length) { - state.target = undefined; - return { value: undefined, done: true }; - } - if (kind == 'keys') { return { value: index, done: false }; } - if (kind == 'values') { return { value: target[index], done: false }; } - return { value: [index, target[index]], done: false }; - }, 'values'); - - // argumentsList[@@iterator] is %ArrayProto_values% - // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject - // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject - iterators.Arguments = iterators.Array; - - // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables - addToUnscopables('keys'); - addToUnscopables('values'); - addToUnscopables('entries'); - var fromCharCode = String.fromCharCode; var nativeFromCodePoint = String.fromCodePoint; @@ -4342,11 +4370,12 @@ var doric = (function (exports) { var INCORRECT_LENGTH = !!nativeFromCodePoint && nativeFromCodePoint.length != 1; // `String.fromCodePoint` method - // https://tc39.github.io/ecma262/#sec-string.fromcodepoint + // https://tc39.es/ecma262/#sec-string.fromcodepoint _export({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, { + // eslint-disable-next-line no-unused-vars -- required for `.length` fromCodePoint: function fromCodePoint(x) { var arguments$1 = arguments; - // eslint-disable-line no-unused-vars + var elements = []; var length = arguments.length; var i = 0; @@ -4363,7 +4392,7 @@ var doric = (function (exports) { }); // `String.raw` method - // https://tc39.github.io/ecma262/#sec-string.raw + // https://tc39.es/ecma262/#sec-string.raw _export({ target: 'String', stat: true }, { raw: function raw(template) { var arguments$1 = arguments; @@ -4398,7 +4427,7 @@ var doric = (function (exports) { var stringMultibyte = { // `String.prototype.codePointAt` method - // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat + // https://tc39.es/ecma262/#sec-string.prototype.codepointat codeAt: createMethod$4(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at @@ -4408,7 +4437,7 @@ var doric = (function (exports) { var codeAt = stringMultibyte.codeAt; // `String.prototype.codePointAt` method - // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat + // https://tc39.es/ecma262/#sec-string.prototype.codepointat _export({ target: 'String', proto: true }, { codePointAt: function codePointAt(pos) { return codeAt(this, pos); @@ -4418,7 +4447,7 @@ var doric = (function (exports) { var MATCH = wellKnownSymbol('match'); // `IsRegExp` abstract operation - // https://tc39.github.io/ecma262/#sec-isregexp + // https://tc39.es/ecma262/#sec-isregexp var isRegexp = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp'); @@ -4436,11 +4465,11 @@ var doric = (function (exports) { var regexp = /./; try { '/./'[METHOD_NAME](regexp); - } catch (e) { + } catch (error1) { try { regexp[MATCH$1] = false; return '/./'[METHOD_NAME](regexp); - } catch (f) { /* empty */ } + } catch (error2) { /* empty */ } } return false; }; @@ -4456,13 +4485,13 @@ var doric = (function (exports) { var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('endsWith'); // https://github.com/zloirock/core-js/pull/702 - var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () { + var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor$4(String.prototype, 'endsWith'); return descriptor && !descriptor.writable; }(); // `String.prototype.endsWith` method - // https://tc39.github.io/ecma262/#sec-string.prototype.endswith + // https://tc39.es/ecma262/#sec-string.prototype.endswith _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = String(requireObjectCoercible(this)); @@ -4478,7 +4507,7 @@ var doric = (function (exports) { }); // `String.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-string.prototype.includes + // https://tc39.es/ecma262/#sec-string.prototype.includes _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, { includes: function includes(searchString /* , position = 0 */) { return !!~String(requireObjectCoercible(this)) @@ -4487,7 +4516,7 @@ var doric = (function (exports) { }); // `RegExp.prototype.flags` getter implementation - // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags + // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags var regexpFlags = function () { var that = anObject(this); var result = ''; @@ -4544,6 +4573,7 @@ var doric = (function (exports) { var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET; // nonparticipating capturing group, copied from es5-shim's String#split patch. + // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1; @@ -4611,6 +4641,8 @@ var doric = (function (exports) { var regexpExec = patchedExec; + // `RegExp.prototype.exec` method + // https://tc39.es/ecma262/#sec-regexp.prototype.exec _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, { exec: regexpExec }); @@ -4656,6 +4688,7 @@ var doric = (function (exports) { // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { + // eslint-disable-next-line regexp/no-empty-group -- required for testing var re = /(?:)/; var originalExec = re.exec; re.exec = function () { return originalExec.apply(this, arguments); }; @@ -4743,13 +4776,13 @@ var doric = (function (exports) { var charAt = stringMultibyte.charAt; // `AdvanceStringIndex` abstract operation - // https://tc39.github.io/ecma262/#sec-advancestringindex + // https://tc39.es/ecma262/#sec-advancestringindex var advanceStringIndex = function (S, index, unicode) { return index + (unicode ? charAt(S, index).length : 1); }; // `RegExpExec` abstract operation - // https://tc39.github.io/ecma262/#sec-regexpexec + // https://tc39.es/ecma262/#sec-regexpexec var regexpExecAbstract = function (R, S) { var exec = R.exec; if (typeof exec === 'function') { @@ -4771,14 +4804,14 @@ var doric = (function (exports) { fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { return [ // `String.prototype.match` method - // https://tc39.github.io/ecma262/#sec-string.prototype.match + // https://tc39.es/ecma262/#sec-string.prototype.match function match(regexp) { var O = requireObjectCoercible(this); var matcher = regexp == undefined ? undefined : regexp[MATCH]; return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); }, // `RegExp.prototype[@@match]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match + // https://tc39.es/ecma262/#sec-regexp.prototype-@@match function (regexp) { var res = maybeCallNative(nativeMatch, regexp, this); if (res.done) { return res.value; } @@ -4807,7 +4840,7 @@ var doric = (function (exports) { var SPECIES$5 = wellKnownSymbol('species'); // `SpeciesConstructor` abstract operation - // https://tc39.github.io/ecma262/#sec-speciesconstructor + // https://tc39.es/ecma262/#sec-speciesconstructor var speciesConstructor = function (O, defaultConstructor) { var C = anObject(O).constructor; var S; @@ -4837,7 +4870,7 @@ var doric = (function (exports) { } return regExpBuiltinExec.call(R, S); }; - // eslint-disable-next-line max-len + // eslint-disable-next-line max-len -- ignore var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, global, fullUnicode) { setInternalState$2(this, { type: REGEXP_STRING_ITERATOR, @@ -4880,7 +4913,7 @@ var doric = (function (exports) { }; // `String.prototype.matchAll` method - // https://github.com/tc39/proposal-string-matchall + // https://tc39.es/ecma262/#sec-string.prototype.matchall _export({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, { matchAll: function matchAll(regexp) { var O = requireObjectCoercible(this); @@ -4900,14 +4933,14 @@ var doric = (function (exports) { } else if (WORKS_WITH_NON_GLOBAL_REGEX) { return nativeMatchAll.apply(O, arguments); } S = String(O); rx = new RegExp(regexp, 'g'); - return rx[MATCH_ALL](S); + return rx[MATCH_ALL](S); } }); - MATCH_ALL in RegExpPrototype || createNonEnumerableProperty(RegExpPrototype, MATCH_ALL, $matchAll); + MATCH_ALL in RegExpPrototype || createNonEnumerableProperty(RegExpPrototype, MATCH_ALL, $matchAll); // `String.prototype.repeat` method implementation - // https://tc39.github.io/ecma262/#sec-string.prototype.repeat + // https://tc39.es/ecma262/#sec-string.prototype.repeat var stringRepeat = ''.repeat || function repeat(count) { var str = String(requireObjectCoercible(this)); var result = ''; @@ -4942,24 +4975,24 @@ var doric = (function (exports) { var stringPad = { // `String.prototype.padStart` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padstart + // https://tc39.es/ecma262/#sec-string.prototype.padstart start: createMethod$5(false), // `String.prototype.padEnd` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padend + // https://tc39.es/ecma262/#sec-string.prototype.padend end: createMethod$5(true) }; // https://github.com/zloirock/core-js/issues/280 - // eslint-disable-next-line unicorn/no-unsafe-regex + // eslint-disable-next-line unicorn/no-unsafe-regex -- safe var stringPadWebkitBug = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(engineUserAgent); var $padEnd = stringPad.end; // `String.prototype.padEnd` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padend + // https://tc39.es/ecma262/#sec-string.prototype.padend _export({ target: 'String', proto: true, forced: stringPadWebkitBug }, { padEnd: function padEnd(maxLength /* , fillString = ' ' */) { return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); @@ -4970,7 +5003,7 @@ var doric = (function (exports) { // `String.prototype.padStart` method - // https://tc39.github.io/ecma262/#sec-string.prototype.padstart + // https://tc39.es/ecma262/#sec-string.prototype.padstart _export({ target: 'String', proto: true, forced: stringPadWebkitBug }, { padStart: function padStart(maxLength /* , fillString = ' ' */) { return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); @@ -4978,17 +5011,53 @@ var doric = (function (exports) { }); // `String.prototype.repeat` method - // https://tc39.github.io/ecma262/#sec-string.prototype.repeat + // https://tc39.es/ecma262/#sec-string.prototype.repeat _export({ target: 'String', proto: true }, { repeat: stringRepeat }); - var max$3 = Math.max; - var min$6 = Math.min; var floor$1 = Math.floor; + var replace = ''.replace; var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; + // https://tc39.es/ecma262/#sec-getsubstitution + var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return replace.call(replacement, symbols, function (match, ch) { + var capture; + switch (ch.charAt(0)) { + case '$': return '$'; + case '&': return matched; + case '`': return str.slice(0, position); + case "'": return str.slice(tailPos); + case '<': + capture = namedCaptures[ch.slice(1, -1)]; + break; + default: // \d\d? + var n = +ch; + if (n === 0) { return match; } + if (n > m) { + var f = floor$1(n / 10); + if (f === 0) { return match; } + if (f <= m) { return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); } + return match; + } + capture = captures[n - 1]; + } + return capture === undefined ? '' : capture; + }); + }; + + var max$3 = Math.max; + var min$6 = Math.min; + var maybeToString = function (it) { return it === undefined ? it : String(it); }; @@ -5001,7 +5070,7 @@ var doric = (function (exports) { return [ // `String.prototype.replace` method - // https://tc39.github.io/ecma262/#sec-string.prototype.replace + // https://tc39.es/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = requireObjectCoercible(this); var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; @@ -5010,7 +5079,7 @@ var doric = (function (exports) { : nativeReplace.call(String(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace + // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function (regexp, replaceValue) { if ( (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) || @@ -5073,54 +5142,20 @@ var doric = (function (exports) { return accumulatedResult + S.slice(nextSourcePosition); } ]; - - // https://tc39.github.io/ecma262/#sec-getsubstitution - function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { - var tailPos = position + matched.length; - var m = captures.length; - var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { - namedCaptures = toObject(namedCaptures); - symbols = SUBSTITUTION_SYMBOLS; - } - return nativeReplace.call(replacement, symbols, function (match, ch) { - var capture; - switch (ch.charAt(0)) { - case '$': return '$'; - case '&': return matched; - case '`': return str.slice(0, position); - case "'": return str.slice(tailPos); - case '<': - capture = namedCaptures[ch.slice(1, -1)]; - break; - default: // \d\d? - var n = +ch; - if (n === 0) { return match; } - if (n > m) { - var f = floor$1(n / 10); - if (f === 0) { return match; } - if (f <= m) { return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); } - return match; - } - capture = captures[n - 1]; - } - return capture === undefined ? '' : capture; - }); - } }); // @@search logic fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) { return [ // `String.prototype.search` method - // https://tc39.github.io/ecma262/#sec-string.prototype.search + // https://tc39.es/ecma262/#sec-string.prototype.search function search(regexp) { var O = requireObjectCoercible(this); var searcher = regexp == undefined ? undefined : regexp[SEARCH]; return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, // `RegExp.prototype[@@search]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search + // https://tc39.es/ecma262/#sec-regexp.prototype-@@search function (regexp) { var res = maybeCallNative(nativeSearch, regexp, this); if (res.done) { return res.value; } @@ -5149,9 +5184,11 @@ var doric = (function (exports) { var internalSplit; if ( 'abbc'.split(/(b)*/)[1] == 'c' || + // eslint-disable-next-line regexp/no-empty-group -- required for testing 'test'.split(/(?:)/, -1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || + // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing '.'.split(/()()/).length > 1 || ''.split(/.?/).length ) { @@ -5199,7 +5236,7 @@ var doric = (function (exports) { return [ // `String.prototype.split` method - // https://tc39.github.io/ecma262/#sec-string.prototype.split + // https://tc39.es/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = requireObjectCoercible(this); var splitter = separator == undefined ? undefined : separator[SPLIT]; @@ -5208,7 +5245,7 @@ var doric = (function (exports) { : internalSplit.call(String(O), separator, limit); }, // `RegExp.prototype[@@split]` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split + // https://tc39.es/ecma262/#sec-regexp.prototype-@@split // // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. @@ -5272,13 +5309,13 @@ var doric = (function (exports) { var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegexpLogic('startsWith'); // https://github.com/zloirock/core-js/pull/702 - var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () { + var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () { var descriptor = getOwnPropertyDescriptor$5(String.prototype, 'startsWith'); return descriptor && !descriptor.writable; }(); // `String.prototype.startsWith` method - // https://tc39.github.io/ecma262/#sec-string.prototype.startswith + // https://tc39.es/ecma262/#sec-string.prototype.startswith _export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, { startsWith: function startsWith(searchString /* , position = 0 */) { var that = String(requireObjectCoercible(this)); @@ -5292,8 +5329,8 @@ var doric = (function (exports) { }); // a string of all valid unicode whitespaces - // eslint-disable-next-line max-len - var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; var whitespace = '[' + whitespaces + ']'; var ltrim = RegExp('^' + whitespace + whitespace + '*'); @@ -5311,13 +5348,13 @@ var doric = (function (exports) { var stringTrim = { // `String.prototype.{ trimLeft, trimStart }` methods - // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart + // https://tc39.es/ecma262/#sec-string.prototype.trimstart start: createMethod$6(1), // `String.prototype.{ trimRight, trimEnd }` methods - // https://tc39.github.io/ecma262/#sec-string.prototype.trimend + // https://tc39.es/ecma262/#sec-string.prototype.trimend end: createMethod$6(2), // `String.prototype.trim` method - // https://tc39.github.io/ecma262/#sec-string.prototype.trim + // https://tc39.es/ecma262/#sec-string.prototype.trim trim: createMethod$6(3) }; @@ -5335,7 +5372,7 @@ var doric = (function (exports) { // `String.prototype.trim` method - // https://tc39.github.io/ecma262/#sec-string.prototype.trim + // https://tc39.es/ecma262/#sec-string.prototype.trim _export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, { trim: function trim() { return $trim(this); @@ -5352,7 +5389,8 @@ var doric = (function (exports) { } : ''.trimStart; // `String.prototype.{ trimStart, trimLeft }` methods - // https://github.com/tc39/ecmascript-string-left-right-trim + // https://tc39.es/ecma262/#sec-string.prototype.trimstart + // https://tc39.es/ecma262/#String.prototype.trimleft _export({ target: 'String', proto: true, forced: FORCED$4 }, { trimStart: trimStart, trimLeft: trimStart @@ -5368,7 +5406,8 @@ var doric = (function (exports) { } : ''.trimEnd; // `String.prototype.{ trimEnd, trimRight }` methods - // https://github.com/tc39/ecmascript-string-left-right-trim + // https://tc39.es/ecma262/#sec-string.prototype.trimend + // https://tc39.es/ecma262/#String.prototype.trimright _export({ target: 'String', proto: true, forced: FORCED$5 }, { trimEnd: trimEnd, trimRight: trimEnd @@ -5383,7 +5422,7 @@ var doric = (function (exports) { var getInternalState$3 = internalState.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator + // https://tc39.es/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState$3(this, { type: STRING_ITERATOR, @@ -5391,7 +5430,7 @@ var doric = (function (exports) { index: 0 }); // `%StringIteratorPrototype%.next` method - // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next + // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState$3(this); var string = state.string; @@ -5406,7 +5445,7 @@ var doric = (function (exports) { var quot = /"/g; // B.2.3.2.1 CreateHTML(string, tag, attribute, value) - // https://tc39.github.io/ecma262/#sec-createhtml + // https://tc39.es/ecma262/#sec-createhtml var createHtml = function (string, tag, attribute, value) { var S = String(requireObjectCoercible(string)); var p1 = '<' + tag; @@ -5424,7 +5463,7 @@ var doric = (function (exports) { }; // `String.prototype.anchor` method - // https://tc39.github.io/ecma262/#sec-string.prototype.anchor + // https://tc39.es/ecma262/#sec-string.prototype.anchor _export({ target: 'String', proto: true, forced: stringHtmlForced('anchor') }, { anchor: function anchor(name) { return createHtml(this, 'a', 'name', name); @@ -5432,7 +5471,7 @@ var doric = (function (exports) { }); // `String.prototype.big` method - // https://tc39.github.io/ecma262/#sec-string.prototype.big + // https://tc39.es/ecma262/#sec-string.prototype.big _export({ target: 'String', proto: true, forced: stringHtmlForced('big') }, { big: function big() { return createHtml(this, 'big', '', ''); @@ -5440,7 +5479,7 @@ var doric = (function (exports) { }); // `String.prototype.blink` method - // https://tc39.github.io/ecma262/#sec-string.prototype.blink + // https://tc39.es/ecma262/#sec-string.prototype.blink _export({ target: 'String', proto: true, forced: stringHtmlForced('blink') }, { blink: function blink() { return createHtml(this, 'blink', '', ''); @@ -5448,7 +5487,7 @@ var doric = (function (exports) { }); // `String.prototype.bold` method - // https://tc39.github.io/ecma262/#sec-string.prototype.bold + // https://tc39.es/ecma262/#sec-string.prototype.bold _export({ target: 'String', proto: true, forced: stringHtmlForced('bold') }, { bold: function bold() { return createHtml(this, 'b', '', ''); @@ -5456,7 +5495,7 @@ var doric = (function (exports) { }); // `String.prototype.fixed` method - // https://tc39.github.io/ecma262/#sec-string.prototype.fixed + // https://tc39.es/ecma262/#sec-string.prototype.fixed _export({ target: 'String', proto: true, forced: stringHtmlForced('fixed') }, { fixed: function fixed() { return createHtml(this, 'tt', '', ''); @@ -5464,7 +5503,7 @@ var doric = (function (exports) { }); // `String.prototype.fontcolor` method - // https://tc39.github.io/ecma262/#sec-string.prototype.fontcolor + // https://tc39.es/ecma262/#sec-string.prototype.fontcolor _export({ target: 'String', proto: true, forced: stringHtmlForced('fontcolor') }, { fontcolor: function fontcolor(color) { return createHtml(this, 'font', 'color', color); @@ -5472,7 +5511,7 @@ var doric = (function (exports) { }); // `String.prototype.fontsize` method - // https://tc39.github.io/ecma262/#sec-string.prototype.fontsize + // https://tc39.es/ecma262/#sec-string.prototype.fontsize _export({ target: 'String', proto: true, forced: stringHtmlForced('fontsize') }, { fontsize: function fontsize(size) { return createHtml(this, 'font', 'size', size); @@ -5480,7 +5519,7 @@ var doric = (function (exports) { }); // `String.prototype.italics` method - // https://tc39.github.io/ecma262/#sec-string.prototype.italics + // https://tc39.es/ecma262/#sec-string.prototype.italics _export({ target: 'String', proto: true, forced: stringHtmlForced('italics') }, { italics: function italics() { return createHtml(this, 'i', '', ''); @@ -5488,7 +5527,7 @@ var doric = (function (exports) { }); // `String.prototype.link` method - // https://tc39.github.io/ecma262/#sec-string.prototype.link + // https://tc39.es/ecma262/#sec-string.prototype.link _export({ target: 'String', proto: true, forced: stringHtmlForced('link') }, { link: function link(url) { return createHtml(this, 'a', 'href', url); @@ -5496,7 +5535,7 @@ var doric = (function (exports) { }); // `String.prototype.small` method - // https://tc39.github.io/ecma262/#sec-string.prototype.small + // https://tc39.es/ecma262/#sec-string.prototype.small _export({ target: 'String', proto: true, forced: stringHtmlForced('small') }, { small: function small() { return createHtml(this, 'small', '', ''); @@ -5504,7 +5543,7 @@ var doric = (function (exports) { }); // `String.prototype.strike` method - // https://tc39.github.io/ecma262/#sec-string.prototype.strike + // https://tc39.es/ecma262/#sec-string.prototype.strike _export({ target: 'String', proto: true, forced: stringHtmlForced('strike') }, { strike: function strike() { return createHtml(this, 'strike', '', ''); @@ -5512,7 +5551,7 @@ var doric = (function (exports) { }); // `String.prototype.sub` method - // https://tc39.github.io/ecma262/#sec-string.prototype.sub + // https://tc39.es/ecma262/#sec-string.prototype.sub _export({ target: 'String', proto: true, forced: stringHtmlForced('sub') }, { sub: function sub() { return createHtml(this, 'sub', '', ''); @@ -5520,13 +5559,70 @@ var doric = (function (exports) { }); // `String.prototype.sup` method - // https://tc39.github.io/ecma262/#sec-string.prototype.sup + // https://tc39.es/ecma262/#sec-string.prototype.sup _export({ target: 'String', proto: true, forced: stringHtmlForced('sup') }, { sup: function sup() { return createHtml(this, 'sup', '', ''); } }); + var REPLACE$1 = wellKnownSymbol('replace'); + var RegExpPrototype$1 = RegExp.prototype; + var max$4 = Math.max; + + var stringIndexOf = function (string, searchValue, fromIndex) { + if (fromIndex > string.length) { return -1; } + if (searchValue === '') { return fromIndex; } + return string.indexOf(searchValue, fromIndex); + }; + + // `String.prototype.replaceAll` method + // https://tc39.es/ecma262/#sec-string.prototype.replaceall + _export({ target: 'String', proto: true }, { + replaceAll: function replaceAll(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement; + var position = 0; + var endOfLastMatch = 0; + var result = ''; + if (searchValue != null) { + IS_REG_EXP = isRegexp(searchValue); + if (IS_REG_EXP) { + flags = String(requireObjectCoercible('flags' in RegExpPrototype$1 + ? searchValue.flags + : regexpFlags.call(searchValue) + )); + if (!~flags.indexOf('g')) { throw TypeError('`.replaceAll` does not allow non-global regexes'); } + } + replacer = searchValue[REPLACE$1]; + if (replacer !== undefined) { + return replacer.call(searchValue, O, replaceValue); + } + } + string = String(O); + searchString = String(searchValue); + functionalReplace = typeof replaceValue === 'function'; + if (!functionalReplace) { replaceValue = String(replaceValue); } + searchLength = searchString.length; + advanceBy = max$4(1, searchLength); + position = stringIndexOf(string, searchString, 0); + while (position !== -1) { + if (functionalReplace) { + replacement = String(replaceValue(searchString, position, string)); + } else { + replacement = getSubstitution(searchString, string, position, [], undefined, replaceValue); + } + result += string.slice(endOfLastMatch, position) + replacement; + endOfLastMatch = position + searchLength; + position = stringIndexOf(string, searchString, position + advanceBy); + } + if (endOfLastMatch < string.length) { + result += string.slice(endOfLastMatch); + } + return result; + } + }); + // makes subclassing work correct for wrapped built-ins var inheritIfRequired = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; @@ -5542,7 +5638,7 @@ var doric = (function (exports) { return $this; }; - var defineProperty$6 = objectDefineProperty.f; + var defineProperty$5 = objectDefineProperty.f; var getOwnPropertyNames = objectGetOwnPropertyNames.f; @@ -5555,7 +5651,7 @@ var doric = (function (exports) { var MATCH$2 = wellKnownSymbol('match'); var NativeRegExp = global_1.RegExp; - var RegExpPrototype$1 = NativeRegExp.prototype; + var RegExpPrototype$2 = NativeRegExp.prototype; var re1 = /a/g; var re2 = /a/g; @@ -5571,7 +5667,7 @@ var doric = (function (exports) { }))); // `RegExp` constructor - // https://tc39.github.io/ecma262/#sec-regexp-constructor + // https://tc39.es/ecma262/#sec-regexp-constructor if (FORCED$6) { var RegExpWrapper = function RegExp(pattern, flags) { var thisIsRegExp = this instanceof RegExpWrapper; @@ -5597,7 +5693,7 @@ var doric = (function (exports) { var result = inheritIfRequired( CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags), - thisIsRegExp ? this : RegExpPrototype$1, + thisIsRegExp ? this : RegExpPrototype$2, RegExpWrapper ); @@ -5606,7 +5702,7 @@ var doric = (function (exports) { return result; }; var proxy = function (key) { - key in RegExpWrapper || defineProperty$6(RegExpWrapper, key, { + key in RegExpWrapper || defineProperty$5(RegExpWrapper, key, { configurable: true, get: function () { return NativeRegExp[key]; }, set: function (it) { NativeRegExp[key] = it; } @@ -5615,18 +5711,18 @@ var doric = (function (exports) { var keys$1 = getOwnPropertyNames(NativeRegExp); var index = 0; while (keys$1.length > index) { proxy(keys$1[index++]); } - RegExpPrototype$1.constructor = RegExpWrapper; - RegExpWrapper.prototype = RegExpPrototype$1; + RegExpPrototype$2.constructor = RegExpWrapper; + RegExpWrapper.prototype = RegExpPrototype$2; redefine(global_1, 'RegExp', RegExpWrapper); } - // https://tc39.github.io/ecma262/#sec-get-regexp-@@species + // https://tc39.es/ecma262/#sec-get-regexp-@@species setSpecies('RegExp'); var UNSUPPORTED_Y$3 = regexpStickyHelpers.UNSUPPORTED_Y; // `RegExp.prototype.flags` getter - // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags + // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags if (descriptors && (/./g.flags != 'g' || UNSUPPORTED_Y$3)) { objectDefineProperty.f(RegExp.prototype, 'flags', { configurable: true, @@ -5635,16 +5731,17 @@ var doric = (function (exports) { } var UNSUPPORTED_Y$4 = regexpStickyHelpers.UNSUPPORTED_Y; - var defineProperty$7 = objectDefineProperty.f; + var defineProperty$6 = objectDefineProperty.f; var getInternalState$4 = internalState.get; - var RegExpPrototype$2 = RegExp.prototype; + var RegExpPrototype$3 = RegExp.prototype; // `RegExp.prototype.sticky` getter + // https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky if (descriptors && UNSUPPORTED_Y$4) { - defineProperty$7(RegExp.prototype, 'sticky', { + defineProperty$6(RegExp.prototype, 'sticky', { configurable: true, get: function () { - if (this === RegExpPrototype$2) { return undefined; } + if (this === RegExpPrototype$3) { return undefined; } // We can't use InternalStateModule.getterFor because // we don't add metadata for regexps created by a literal. if (this instanceof RegExp) { @@ -5672,6 +5769,8 @@ var doric = (function (exports) { var nativeTest = /./.test; + // `RegExp.prototype.test` method + // https://tc39.es/ecma262/#sec-regexp.prototype.test _export({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, { test: function (str) { if (typeof this.exec !== 'function') { @@ -5686,21 +5785,21 @@ var doric = (function (exports) { }); var TO_STRING = 'toString'; - var RegExpPrototype$3 = RegExp.prototype; - var nativeToString = RegExpPrototype$3[TO_STRING]; + var RegExpPrototype$4 = RegExp.prototype; + var nativeToString = RegExpPrototype$4[TO_STRING]; var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = nativeToString.name != TO_STRING; // `RegExp.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring + // https://tc39.es/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { redefine(RegExp.prototype, TO_STRING, function toString() { var R = anObject(this); var p = String(R.source); var rf = R.flags; - var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$3) ? regexpFlags.call(R) : rf); + var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$4) ? regexpFlags.call(R) : rf); return '/' + p + '/' + f; }, { unsafe: true }); } @@ -5713,14 +5812,14 @@ var doric = (function (exports) { var FORCED$7 = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22; // `parseInt` method - // https://tc39.github.io/ecma262/#sec-parseint-string-radix + // https://tc39.es/ecma262/#sec-parseint-string-radix var numberParseInt = FORCED$7 ? function parseInt(string, radix) { var S = trim(String(string)); return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10)); } : $parseInt; // `parseInt` method - // https://tc39.github.io/ecma262/#sec-parseint-string-radix + // https://tc39.es/ecma262/#sec-parseint-string-radix _export({ global: true, forced: parseInt != numberParseInt }, { parseInt: numberParseInt }); @@ -5732,7 +5831,7 @@ var doric = (function (exports) { var FORCED$8 = 1 / $parseFloat(whitespaces + '-0') !== -Infinity; // `parseFloat` method - // https://tc39.github.io/ecma262/#sec-parsefloat-string + // https://tc39.es/ecma262/#sec-parsefloat-string var numberParseFloat = FORCED$8 ? function parseFloat(string) { var trimmedString = trim$1(String(string)); var result = $parseFloat(trimmedString); @@ -5740,14 +5839,14 @@ var doric = (function (exports) { } : $parseFloat; // `parseFloat` method - // https://tc39.github.io/ecma262/#sec-parsefloat-string + // https://tc39.es/ecma262/#sec-parsefloat-string _export({ global: true, forced: parseFloat != numberParseFloat }, { parseFloat: numberParseFloat }); var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f; - var defineProperty$8 = objectDefineProperty.f; + var defineProperty$7 = objectDefineProperty.f; var trim$2 = stringTrim.trim; var NUMBER = 'Number'; @@ -5758,7 +5857,7 @@ var doric = (function (exports) { var BROKEN_CLASSOF = classofRaw(objectCreate(NumberPrototype)) == NUMBER; // `ToNumber` abstract operation - // https://tc39.github.io/ecma262/#sec-tonumber + // https://tc39.es/ecma262/#sec-tonumber var toNumber = function (argument) { var it = toPrimitive(argument, false); var first, third, radix, maxCode, digits, length, index, code; @@ -5787,7 +5886,7 @@ var doric = (function (exports) { }; // `Number` constructor - // https://tc39.github.io/ecma262/#sec-number-constructor + // https://tc39.es/ecma262/#sec-number-constructor if (isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { var NumberWrapper = function Number(value) { var it = arguments.length < 1 ? 0 : value; @@ -5802,10 +5901,12 @@ var doric = (function (exports) { 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES2015 (in case, if modules with ES2015 Number statics required before): 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + - 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' + + // ESNext + 'fromString,range' ).split(','), j = 0, key; keys$2.length > j; j++) { if (has(NativeNumber, key = keys$2[j]) && !has(NumberWrapper, key)) { - defineProperty$8(NumberWrapper, key, getOwnPropertyDescriptor$6(NativeNumber, key)); + defineProperty$7(NumberWrapper, key, getOwnPropertyDescriptor$6(NativeNumber, key)); } } NumberWrapper.prototype = NumberPrototype; @@ -5814,7 +5915,7 @@ var doric = (function (exports) { } // `Number.EPSILON` constant - // https://tc39.github.io/ecma262/#sec-number.epsilon + // https://tc39.es/ecma262/#sec-number.epsilon _export({ target: 'Number', stat: true }, { EPSILON: Math.pow(2, -52) }); @@ -5822,34 +5923,34 @@ var doric = (function (exports) { var globalIsFinite = global_1.isFinite; // `Number.isFinite` method - // https://tc39.github.io/ecma262/#sec-number.isfinite + // https://tc39.es/ecma262/#sec-number.isfinite var numberIsFinite = Number.isFinite || function isFinite(it) { return typeof it == 'number' && globalIsFinite(it); }; // `Number.isFinite` method - // https://tc39.github.io/ecma262/#sec-number.isfinite + // https://tc39.es/ecma262/#sec-number.isfinite _export({ target: 'Number', stat: true }, { isFinite: numberIsFinite }); var floor$2 = Math.floor; // `Number.isInteger` method implementation - // https://tc39.github.io/ecma262/#sec-number.isinteger + // https://tc39.es/ecma262/#sec-number.isinteger var isInteger = function isInteger(it) { return !isObject(it) && isFinite(it) && floor$2(it) === it; }; // `Number.isInteger` method - // https://tc39.github.io/ecma262/#sec-number.isinteger + // https://tc39.es/ecma262/#sec-number.isinteger _export({ target: 'Number', stat: true }, { isInteger: isInteger }); // `Number.isNaN` method - // https://tc39.github.io/ecma262/#sec-number.isnan + // https://tc39.es/ecma262/#sec-number.isnan _export({ target: 'Number', stat: true }, { isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check return number != number; } }); @@ -5857,7 +5958,7 @@ var doric = (function (exports) { var abs = Math.abs; // `Number.isSafeInteger` method - // https://tc39.github.io/ecma262/#sec-number.issafeinteger + // https://tc39.es/ecma262/#sec-number.issafeinteger _export({ target: 'Number', stat: true }, { isSafeInteger: function isSafeInteger(number) { return isInteger(number) && abs(number) <= 0x1FFFFFFFFFFFFF; @@ -5865,31 +5966,31 @@ var doric = (function (exports) { }); // `Number.MAX_SAFE_INTEGER` constant - // https://tc39.github.io/ecma262/#sec-number.max_safe_integer + // https://tc39.es/ecma262/#sec-number.max_safe_integer _export({ target: 'Number', stat: true }, { MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF }); // `Number.MIN_SAFE_INTEGER` constant - // https://tc39.github.io/ecma262/#sec-number.min_safe_integer + // https://tc39.es/ecma262/#sec-number.min_safe_integer _export({ target: 'Number', stat: true }, { MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF }); // `Number.parseFloat` method - // https://tc39.github.io/ecma262/#sec-number.parseFloat + // https://tc39.es/ecma262/#sec-number.parseFloat _export({ target: 'Number', stat: true, forced: Number.parseFloat != numberParseFloat }, { parseFloat: numberParseFloat }); // `Number.parseInt` method - // https://tc39.github.io/ecma262/#sec-number.parseint + // https://tc39.es/ecma262/#sec-number.parseint _export({ target: 'Number', stat: true, forced: Number.parseInt != numberParseInt }, { parseInt: numberParseInt }); // `thisNumberValue` abstract operation - // https://tc39.github.io/ecma262/#sec-thisnumbervalue + // https://tc39.es/ecma262/#sec-thisnumbervalue var thisNumberValue = function (value) { if (typeof value != 'number' && classofRaw(value) != 'Number') { throw TypeError('Incorrect invocation'); @@ -5917,6 +6018,37 @@ var doric = (function (exports) { } return n; }; + var multiply = function (data, n, c) { + var index = -1; + var c2 = c; + while (++index < 6) { + c2 += n * data[index]; + data[index] = c2 % 1e7; + c2 = floor$3(c2 / 1e7); + } + }; + + var divide = function (data, n) { + var index = 6; + var c = 0; + while (--index >= 0) { + c += data[index]; + data[index] = floor$3(c / n); + c = (c % n) * 1e7; + } + }; + + var dataToString = function (data) { + var index = 6; + var s = ''; + while (--index >= 0) { + if (s !== '' || index === 0 || data[index] !== 0) { + var t = String(data[index]); + s = s === '' ? t : s + stringRepeat.call('0', 7 - t.length) + t; + } + } return s; + }; + var FORCED$9 = nativeToFixed && ( 0.00008.toFixed(3) !== '0.000' || 0.9.toFixed(0) !== '1' || @@ -5928,9 +6060,8 @@ var doric = (function (exports) { }); // `Number.prototype.toFixed` method - // https://tc39.github.io/ecma262/#sec-number.prototype.tofixed + // https://tc39.es/ecma262/#sec-number.prototype.tofixed _export({ target: 'Number', proto: true, forced: FORCED$9 }, { - // eslint-disable-next-line max-statements toFixed: function toFixed(fractionDigits) { var number = thisNumberValue(this); var fractDigits = toInteger(fractionDigits); @@ -5939,39 +6070,8 @@ var doric = (function (exports) { var result = '0'; var e, z, j, k; - var multiply = function (n, c) { - var index = -1; - var c2 = c; - while (++index < 6) { - c2 += n * data[index]; - data[index] = c2 % 1e7; - c2 = floor$3(c2 / 1e7); - } - }; - - var divide = function (n) { - var index = 6; - var c = 0; - while (--index >= 0) { - c += data[index]; - data[index] = floor$3(c / n); - c = (c % n) * 1e7; - } - }; - - var dataToString = function () { - var index = 6; - var s = ''; - while (--index >= 0) { - if (s !== '' || index === 0 || data[index] !== 0) { - var t = String(data[index]); - s = s === '' ? t : s + stringRepeat.call('0', 7 - t.length) + t; - } - } return s; - }; - if (fractDigits < 0 || fractDigits > 20) { throw RangeError('Incorrect fraction digits'); } - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check if (number != number) { return 'NaN'; } if (number <= -1e21 || number >= 1e21) { return String(number); } if (number < 0) { @@ -5984,26 +6084,26 @@ var doric = (function (exports) { z *= 0x10000000000000; e = 52 - e; if (e > 0) { - multiply(0, z); + multiply(data, 0, z); j = fractDigits; while (j >= 7) { - multiply(1e7, 0); + multiply(data, 1e7, 0); j -= 7; } - multiply(pow(10, j, 1), 0); + multiply(data, pow(10, j, 1), 0); j = e - 1; while (j >= 23) { - divide(1 << 23); + divide(data, 1 << 23); j -= 23; } - divide(1 << j); - multiply(1, 1); - divide(2); - result = dataToString(); + divide(data, 1 << j); + multiply(data, 1, 1); + divide(data, 2); + result = dataToString(data); } else { - multiply(0, z); - multiply(1 << -e, 0); - result = dataToString() + stringRepeat.call('0', fractDigits); + multiply(data, 0, z); + multiply(data, 1 << -e, 0); + result = dataToString(data) + stringRepeat.call('0', fractDigits); } } if (fractDigits > 0) { @@ -6028,7 +6128,7 @@ var doric = (function (exports) { }); // `Number.prototype.toPrecision` method - // https://tc39.github.io/ecma262/#sec-number.prototype.toprecision + // https://tc39.es/ecma262/#sec-number.prototype.toprecision _export({ target: 'Number', proto: true, forced: FORCED$a }, { toPrecision: function toPrecision(precision) { return precision === undefined @@ -6040,7 +6140,7 @@ var doric = (function (exports) { var log$1 = Math.log; // `Math.log1p` method implementation - // https://tc39.github.io/ecma262/#sec-math.log1p + // https://tc39.es/ecma262/#sec-math.log1p var mathLog1p = Math.log1p || function log1p(x) { return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log$1(1 + x); }; @@ -6057,7 +6157,7 @@ var doric = (function (exports) { || nativeAcosh(Infinity) != Infinity; // `Math.acosh` method - // https://tc39.github.io/ecma262/#sec-math.acosh + // https://tc39.es/ecma262/#sec-math.acosh _export({ target: 'Math', stat: true, forced: FORCED$b }, { acosh: function acosh(x) { return (x = +x) < 1 ? NaN : x > 94906265.62425156 @@ -6075,7 +6175,7 @@ var doric = (function (exports) { } // `Math.asinh` method - // https://tc39.github.io/ecma262/#sec-math.asinh + // https://tc39.es/ecma262/#sec-math.asinh // Tor Browser bug: Math.asinh(0) -> -0 _export({ target: 'Math', stat: true, forced: !(nativeAsinh && 1 / nativeAsinh(0) > 0) }, { asinh: asinh @@ -6085,7 +6185,7 @@ var doric = (function (exports) { var log$4 = Math.log; // `Math.atanh` method - // https://tc39.github.io/ecma262/#sec-math.atanh + // https://tc39.es/ecma262/#sec-math.atanh // Tor Browser bug: Math.atanh(-0) -> 0 _export({ target: 'Math', stat: true, forced: !(nativeAtanh && 1 / nativeAtanh(-0) < 0) }, { atanh: function atanh(x) { @@ -6094,9 +6194,9 @@ var doric = (function (exports) { }); // `Math.sign` method implementation - // https://tc39.github.io/ecma262/#sec-math.sign + // https://tc39.es/ecma262/#sec-math.sign var mathSign = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; @@ -6104,7 +6204,7 @@ var doric = (function (exports) { var pow$1 = Math.pow; // `Math.cbrt` method - // https://tc39.github.io/ecma262/#sec-math.cbrt + // https://tc39.es/ecma262/#sec-math.cbrt _export({ target: 'Math', stat: true }, { cbrt: function cbrt(x) { return mathSign(x = +x) * pow$1(abs$1(x), 1 / 3); @@ -6116,7 +6216,7 @@ var doric = (function (exports) { var LOG2E = Math.LOG2E; // `Math.clz32` method - // https://tc39.github.io/ecma262/#sec-math.clz32 + // https://tc39.es/ecma262/#sec-math.clz32 _export({ target: 'Math', stat: true }, { clz32: function clz32(x) { return (x >>>= 0) ? 31 - floor$4(log$5(x + 0.5) * LOG2E) : 32; @@ -6127,7 +6227,7 @@ var doric = (function (exports) { var exp = Math.exp; // `Math.expm1` method implementation - // https://tc39.github.io/ecma262/#sec-math.expm1 + // https://tc39.es/ecma262/#sec-math.expm1 var mathExpm1 = (!nativeExpm1 // Old FF bug || nativeExpm1(10) > 22025.465794806719 || nativeExpm1(10) < 22025.4657948067165168 @@ -6142,7 +6242,7 @@ var doric = (function (exports) { var E = Math.E; // `Math.cosh` method - // https://tc39.github.io/ecma262/#sec-math.cosh + // https://tc39.es/ecma262/#sec-math.cosh _export({ target: 'Math', stat: true, forced: !nativeCosh || nativeCosh(710) === Infinity }, { cosh: function cosh(x) { var t = mathExpm1(abs$2(x) - 1) + 1; @@ -6151,7 +6251,7 @@ var doric = (function (exports) { }); // `Math.expm1` method - // https://tc39.github.io/ecma262/#sec-math.expm1 + // https://tc39.es/ecma262/#sec-math.expm1 _export({ target: 'Math', stat: true, forced: mathExpm1 != Math.expm1 }, { expm1: mathExpm1 }); var abs$3 = Math.abs; @@ -6166,7 +6266,7 @@ var doric = (function (exports) { }; // `Math.fround` method implementation - // https://tc39.github.io/ecma262/#sec-math.fround + // https://tc39.es/ecma262/#sec-math.fround var mathFround = Math.fround || function fround(x) { var $abs = abs$3(x); var $sign = mathSign(x); @@ -6174,13 +6274,13 @@ var doric = (function (exports) { if ($abs < MIN32) { return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; } a = (1 + EPSILON32 / EPSILON) * $abs; result = a - (a - $abs); - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check if (result > MAX32 || result != result) { return $sign * Infinity; } return $sign * result; }; // `Math.fround` method - // https://tc39.github.io/ecma262/#sec-math.fround + // https://tc39.es/ecma262/#sec-math.fround _export({ target: 'Math', stat: true }, { fround: mathFround }); var $hypot = Math.hypot; @@ -6192,11 +6292,12 @@ var doric = (function (exports) { var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity; // `Math.hypot` method - // https://tc39.github.io/ecma262/#sec-math.hypot + // https://tc39.es/ecma262/#sec-math.hypot _export({ target: 'Math', stat: true, forced: BUGGY }, { + // eslint-disable-next-line no-unused-vars -- required for `.length` hypot: function hypot(value1, value2) { var arguments$1 = arguments; - // eslint-disable-line no-unused-vars + var sum = 0; var i = 0; var aLen = arguments.length; @@ -6224,7 +6325,7 @@ var doric = (function (exports) { }); // `Math.imul` method - // https://tc39.github.io/ecma262/#sec-math.imul + // https://tc39.es/ecma262/#sec-math.imul // some WebKit versions fails with big numbers, some has wrong arity _export({ target: 'Math', stat: true, forced: FORCED$c }, { imul: function imul(x, y) { @@ -6241,7 +6342,7 @@ var doric = (function (exports) { var LOG10E = Math.LOG10E; // `Math.log10` method - // https://tc39.github.io/ecma262/#sec-math.log10 + // https://tc39.es/ecma262/#sec-math.log10 _export({ target: 'Math', stat: true }, { log10: function log10(x) { return log$6(x) * LOG10E; @@ -6249,14 +6350,14 @@ var doric = (function (exports) { }); // `Math.log1p` method - // https://tc39.github.io/ecma262/#sec-math.log1p + // https://tc39.es/ecma262/#sec-math.log1p _export({ target: 'Math', stat: true }, { log1p: mathLog1p }); var log$7 = Math.log; var LN2$1 = Math.LN2; // `Math.log2` method - // https://tc39.github.io/ecma262/#sec-math.log2 + // https://tc39.es/ecma262/#sec-math.log2 _export({ target: 'Math', stat: true }, { log2: function log2(x) { return log$7(x) / LN2$1; @@ -6264,7 +6365,7 @@ var doric = (function (exports) { }); // `Math.sign` method - // https://tc39.github.io/ecma262/#sec-math.sign + // https://tc39.es/ecma262/#sec-math.sign _export({ target: 'Math', stat: true }, { sign: mathSign }); @@ -6278,7 +6379,7 @@ var doric = (function (exports) { }); // `Math.sinh` method - // https://tc39.github.io/ecma262/#sec-math.sinh + // https://tc39.es/ecma262/#sec-math.sinh // V8 near Chromium 38 has a problem with very small numbers _export({ target: 'Math', stat: true, forced: FORCED$d }, { sinh: function sinh(x) { @@ -6289,7 +6390,7 @@ var doric = (function (exports) { var exp$2 = Math.exp; // `Math.tanh` method - // https://tc39.github.io/ecma262/#sec-math.tanh + // https://tc39.es/ecma262/#sec-math.tanh _export({ target: 'Math', stat: true }, { tanh: function tanh(x) { var a = mathExpm1(x = +x); @@ -6299,14 +6400,14 @@ var doric = (function (exports) { }); // Math[@@toStringTag] property - // https://tc39.github.io/ecma262/#sec-math-@@tostringtag + // https://tc39.es/ecma262/#sec-math-@@tostringtag setToStringTag(Math, 'Math', true); var ceil$2 = Math.ceil; var floor$5 = Math.floor; // `Math.trunc` method - // https://tc39.github.io/ecma262/#sec-math.trunc + // https://tc39.es/ecma262/#sec-math.trunc _export({ target: 'Math', stat: true }, { trunc: function trunc(it) { return (it > 0 ? floor$5 : ceil$2)(it); @@ -6314,7 +6415,7 @@ var doric = (function (exports) { }); // `Date.now` method - // https://tc39.github.io/ecma262/#sec-date.now + // https://tc39.es/ecma262/#sec-date.now _export({ target: 'Date', stat: true }, { now: function now() { return new Date().getTime(); @@ -6327,9 +6428,9 @@ var doric = (function (exports) { }); // `Date.prototype.toJSON` method - // https://tc39.github.io/ecma262/#sec-date.prototype.tojson + // https://tc39.es/ecma262/#sec-date.prototype.tojson _export({ target: 'Date', proto: true, forced: FORCED$e }, { - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars -- required for `.length` toJSON: function toJSON(key) { var O = toObject(this); var pv = toPrimitive(O); @@ -6345,7 +6446,7 @@ var doric = (function (exports) { var nativeDateToISOString = DatePrototype.toISOString; // `Date.prototype.toISOString` method implementation - // https://tc39.github.io/ecma262/#sec-date.prototype.toisostring + // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit fails here: var dateToIsoString = (fails(function () { return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; @@ -6368,7 +6469,7 @@ var doric = (function (exports) { } : nativeDateToISOString; // `Date.prototype.toISOString` method - // https://tc39.github.io/ecma262/#sec-date.prototype.toisostring + // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit has a broken implementations _export({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== dateToIsoString }, { toISOString: dateToIsoString @@ -6381,11 +6482,11 @@ var doric = (function (exports) { var getTime$1 = DatePrototype$1.getTime; // `Date.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-date.prototype.tostring + // https://tc39.es/ecma262/#sec-date.prototype.tostring if (new Date(NaN) + '' != INVALID_DATE) { redefine(DatePrototype$1, TO_STRING$1, function toString() { var value = getTime$1.call(this); - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check return value === value ? nativeDateToString.call(this) : INVALID_DATE; }); } @@ -6400,7 +6501,7 @@ var doric = (function (exports) { var DatePrototype$2 = Date.prototype; // `Date.prototype[@@toPrimitive]` method - // https://tc39.github.io/ecma262/#sec-date.prototype-@@toprimitive + // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive if (!(TO_PRIMITIVE$1 in DatePrototype$2)) { createNonEnumerableProperty(DatePrototype$2, TO_PRIMITIVE$1, dateToPrimitive); } @@ -6424,9 +6525,11 @@ var doric = (function (exports) { }); if ($stringify$1) { + // `JSON.stringify` method + // https://tc39.es/ecma262/#sec-json.stringify // https://github.com/tc39/proposal-well-formed-stringify _export({ target: 'JSON', stat: true, forced: FORCED$f }, { - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars -- required for `.length` stringify: function stringify(it, replacer, space) { var result = $stringify$1.apply(null, arguments); return typeof result == 'string' ? result.replace(re, fix) : result; @@ -6435,7 +6538,7 @@ var doric = (function (exports) { } // JSON[@@toStringTag] property - // https://tc39.github.io/ecma262/#sec-json-@@tostringtag + // https://tc39.es/ecma262/#sec-json-@@tostringtag setToStringTag(global_1.JSON, 'JSON', true); var nativePromiseConstructor = global_1.Promise; @@ -6465,7 +6568,7 @@ var doric = (function (exports) { var defer, channel, port; var run = function (id) { - // eslint-disable-next-line no-prototype-builtins + // eslint-disable-next-line no-prototype-builtins -- safe if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; @@ -6497,7 +6600,7 @@ var doric = (function (exports) { var i = 1; while (arguments.length > i) { args.push(arguments$1[i++]); } queue[++counter] = function () { - // eslint-disable-next-line no-new-func + // eslint-disable-next-line no-new-func -- spec requirement (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args); }; defer(counter); @@ -6507,7 +6610,7 @@ var doric = (function (exports) { delete queue[id]; }; // Node.js 0.8- - if (classofRaw(process$2) == 'process') { + if (engineIsNode) { defer = function (id) { process$2.nextTick(runner(id)); }; @@ -6529,8 +6632,8 @@ var doric = (function (exports) { global_1.addEventListener && typeof postMessage == 'function' && !global_1.importScripts && - !fails(post) && - location.protocol !== 'file:' + location && location.protocol !== 'file:' && + !fails(post) ) { defer = post; global_1.addEventListener('message', listener, false); @@ -6555,15 +6658,18 @@ var doric = (function (exports) { clear: clear }; - var getOwnPropertyDescriptor$7 = objectGetOwnPropertyDescriptor.f; + var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent); + var getOwnPropertyDescriptor$7 = objectGetOwnPropertyDescriptor.f; var macrotask = task.set; + + var MutationObserver = global_1.MutationObserver || global_1.WebKitMutationObserver; + var document$2 = global_1.document; var process$3 = global_1.process; var Promise$1 = global_1.Promise; - var IS_NODE = classofRaw(process$3) == 'process'; // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` var queueMicrotaskDescriptor = getOwnPropertyDescriptor$7(global_1, 'queueMicrotask'); var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; @@ -6574,7 +6680,7 @@ var doric = (function (exports) { if (!queueMicrotask) { flush = function () { var parent, fn; - if (IS_NODE && (parent = process$3.domain)) { parent.exit(); } + if (engineIsNode && (parent = process$3.domain)) { parent.exit(); } while (head) { fn = head.fn; head = head.next; @@ -6589,15 +6695,11 @@ var doric = (function (exports) { if (parent) { parent.enter(); } }; - // Node.js - if (IS_NODE) { - notify = function () { - process$3.nextTick(flush); - }; // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 - } else if (MutationObserver && !engineIsIos) { + // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898 + if (!engineIsIos && !engineIsNode && !engineIsWebosWebkit && MutationObserver && document$2) { toggle = true; - node = document.createTextNode(''); + node = document$2.createTextNode(''); new MutationObserver(flush).observe(node, { characterData: true }); notify = function () { node.data = toggle = !toggle; @@ -6610,6 +6712,11 @@ var doric = (function (exports) { notify = function () { then.call(promise, flush); }; + // Node.js without promises + } else if (engineIsNode) { + notify = function () { + process$3.nextTick(flush); + }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel @@ -6688,6 +6795,7 @@ var doric = (function (exports) { + var SPECIES$6 = wellKnownSymbol('species'); var PROMISE = 'Promise'; var getInternalState$5 = internalState.get; @@ -6695,13 +6803,13 @@ var doric = (function (exports) { var getInternalPromiseState = internalState.getterFor(PROMISE); var PromiseConstructor = nativePromiseConstructor; var TypeError$1 = global_1.TypeError; - var document$2 = global_1.document; + var document$3 = global_1.document; var process$4 = global_1.process; var $fetch = getBuiltIn('fetch'); var newPromiseCapability$1 = newPromiseCapability.f; var newGenericPromiseCapability = newPromiseCapability$1; - var IS_NODE$1 = classofRaw(process$4) == 'process'; - var DISPATCH_EVENT = !!(document$2 && document$2.createEvent && global_1.dispatchEvent); + var DISPATCH_EVENT = !!(document$3 && document$3.createEvent && global_1.dispatchEvent); + var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function'; var UNHANDLED_REJECTION = 'unhandledrejection'; var REJECTION_HANDLED = 'rejectionhandled'; var PENDING = 0; @@ -6719,7 +6827,7 @@ var doric = (function (exports) { // We can't detect it synchronously, so just check versions if (engineV8Version === 66) { return true; } // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test - if (!IS_NODE$1 && typeof PromiseRejectionEvent != 'function') { return true; } + if (!engineIsNode && !NATIVE_REJECTION_EVENT) { return true; } } // We can't use @@species feature detection in V8 since it causes // deoptimization and performance degradation @@ -6745,7 +6853,7 @@ var doric = (function (exports) { return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; - var notify$1 = function (promise, state, isReject) { + var notify$1 = function (state, isReject) { if (state.notified) { return; } state.notified = true; var chain = state.reactions; @@ -6764,7 +6872,7 @@ var doric = (function (exports) { try { if (handler) { if (!ok) { - if (state.rejection === UNHANDLED) { onHandleUnhandled(promise, state); } + if (state.rejection === UNHANDLED) { onHandleUnhandled(state); } state.rejection = HANDLED; } if (handler === true) { result = value; } @@ -6789,36 +6897,37 @@ var doric = (function (exports) { } state.reactions = []; state.notified = false; - if (isReject && !state.rejection) { onUnhandled(promise, state); } + if (isReject && !state.rejection) { onUnhandled(state); } }); }; var dispatchEvent = function (name, promise, reason) { var event, handler; if (DISPATCH_EVENT) { - event = document$2.createEvent('Event'); + event = document$3.createEvent('Event'); event.promise = promise; event.reason = reason; event.initEvent(name, false, true); global_1.dispatchEvent(event); } else { event = { promise: promise, reason: reason }; } - if (handler = global_1['on' + name]) { handler(event); } + if (!NATIVE_REJECTION_EVENT && (handler = global_1['on' + name])) { handler(event); } else if (name === UNHANDLED_REJECTION) { hostReportErrors('Unhandled promise rejection', reason); } }; - var onUnhandled = function (promise, state) { + var onUnhandled = function (state) { task$1.call(global_1, function () { + var promise = state.facade; var value = state.value; var IS_UNHANDLED = isUnhandled(state); var result; if (IS_UNHANDLED) { result = perform(function () { - if (IS_NODE$1) { + if (engineIsNode) { process$4.emit('unhandledRejection', value, promise); } else { dispatchEvent(UNHANDLED_REJECTION, promise, value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED; + state.rejection = engineIsNode || isUnhandled(state) ? UNHANDLED : HANDLED; if (result.error) { throw result.value; } } }); @@ -6828,55 +6937,56 @@ var doric = (function (exports) { return state.rejection !== HANDLED && !state.parent; }; - var onHandleUnhandled = function (promise, state) { + var onHandleUnhandled = function (state) { task$1.call(global_1, function () { - if (IS_NODE$1) { + var promise = state.facade; + if (engineIsNode) { process$4.emit('rejectionHandled', promise); } else { dispatchEvent(REJECTION_HANDLED, promise, state.value); } }); }; - var bind = function (fn, promise, state, unwrap) { + var bind = function (fn, state, unwrap) { return function (value) { - fn(promise, state, value, unwrap); + fn(state, value, unwrap); }; }; - var internalReject = function (promise, state, value, unwrap) { + var internalReject = function (state, value, unwrap) { if (state.done) { return; } state.done = true; if (unwrap) { state = unwrap; } state.value = value; state.state = REJECTED; - notify$1(promise, state, true); + notify$1(state, true); }; - var internalResolve = function (promise, state, value, unwrap) { + var internalResolve = function (state, value, unwrap) { if (state.done) { return; } state.done = true; if (unwrap) { state = unwrap; } try { - if (promise === value) { throw TypeError$1("Promise can't be resolved itself"); } + if (state.facade === value) { throw TypeError$1("Promise can't be resolved itself"); } var then = isThenable(value); if (then) { microtask(function () { var wrapper = { done: false }; try { then.call(value, - bind(internalResolve, promise, wrapper, state), - bind(internalReject, promise, wrapper, state) + bind(internalResolve, wrapper, state), + bind(internalReject, wrapper, state) ); } catch (error) { - internalReject(promise, wrapper, error, state); + internalReject(wrapper, error, state); } }); } else { state.value = value; state.state = FULFILLED; - notify$1(promise, state, false); + notify$1(state, false); } } catch (error) { - internalReject(promise, { done: false }, error, state); + internalReject({ done: false }, error, state); } }; @@ -6889,12 +6999,12 @@ var doric = (function (exports) { Internal.call(this); var state = getInternalState$5(this); try { - executor(bind(internalResolve, this, state), bind(internalReject, this, state)); + executor(bind(internalResolve, state), bind(internalReject, state)); } catch (error) { - internalReject(this, state, error); + internalReject(state, error); } }; - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars -- required for `.length` Internal = function Promise(executor) { setInternalState$5(this, { type: PROMISE, @@ -6909,20 +7019,20 @@ var doric = (function (exports) { }; Internal.prototype = redefineAll(PromiseConstructor.prototype, { // `Promise.prototype.then` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.then + // https://tc39.es/ecma262/#sec-promise.prototype.then then: function then(onFulfilled, onRejected) { var state = getInternalPromiseState(this); var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = IS_NODE$1 ? process$4.domain : undefined; + reaction.domain = engineIsNode ? process$4.domain : undefined; state.parent = true; state.reactions.push(reaction); - if (state.state != PENDING) { notify$1(this, state, false); } + if (state.state != PENDING) { notify$1(state, false); } return reaction.promise; }, // `Promise.prototype.catch` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.catch + // https://tc39.es/ecma262/#sec-promise.prototype.catch 'catch': function (onRejected) { return this.then(undefined, onRejected); } @@ -6931,8 +7041,8 @@ var doric = (function (exports) { var promise = new Internal(); var state = getInternalState$5(promise); this.promise = promise; - this.resolve = bind(internalResolve, promise, state); - this.reject = bind(internalReject, promise, state); + this.resolve = bind(internalResolve, state); + this.reject = bind(internalReject, state); }; newPromiseCapability.f = newPromiseCapability$1 = function (C) { return C === PromiseConstructor || C === PromiseWrapper @@ -6940,7 +7050,7 @@ var doric = (function (exports) { : newGenericPromiseCapability(C); }; - if ( typeof nativePromiseConstructor == 'function') { + if (typeof nativePromiseConstructor == 'function') { nativeThen = nativePromiseConstructor.prototype.then; // wrap native Promise#then for native async functions @@ -6954,7 +7064,7 @@ var doric = (function (exports) { // wrap fetch result if (typeof $fetch == 'function') { _export({ global: true, enumerable: true, forced: true }, { - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars -- required for `.length` fetch: function fetch(input /* , init */) { return promiseResolve(PromiseConstructor, $fetch.apply(global_1, arguments)); } @@ -6974,7 +7084,7 @@ var doric = (function (exports) { // statics _export({ target: PROMISE, stat: true, forced: FORCED$g }, { // `Promise.reject` method - // https://tc39.github.io/ecma262/#sec-promise.reject + // https://tc39.es/ecma262/#sec-promise.reject reject: function reject(r) { var capability = newPromiseCapability$1(this); capability.reject.call(undefined, r); @@ -6982,17 +7092,17 @@ var doric = (function (exports) { } }); - _export({ target: PROMISE, stat: true, forced: FORCED$g }, { + _export({ target: PROMISE, stat: true, forced: FORCED$g }, { // `Promise.resolve` method - // https://tc39.github.io/ecma262/#sec-promise.resolve + // https://tc39.es/ecma262/#sec-promise.resolve resolve: function resolve(x) { - return promiseResolve( this, x); + return promiseResolve(this, x); } }); _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, { // `Promise.all` method - // https://tc39.github.io/ecma262/#sec-promise.all + // https://tc39.es/ecma262/#sec-promise.all all: function all(iterable) { var C = this; var capability = newPromiseCapability$1(C); @@ -7003,7 +7113,7 @@ var doric = (function (exports) { var values = []; var counter = 0; var remaining = 1; - iterate_1(iterable, function (promise) { + iterate(iterable, function (promise) { var index = counter++; var alreadyCalled = false; values.push(undefined); @@ -7021,14 +7131,14 @@ var doric = (function (exports) { return capability.promise; }, // `Promise.race` method - // https://tc39.github.io/ecma262/#sec-promise.race + // https://tc39.es/ecma262/#sec-promise.race race: function race(iterable) { var C = this; var capability = newPromiseCapability$1(C); var reject = capability.reject; var result = perform(function () { var $promiseResolve = aFunction$1(C.resolve); - iterate_1(iterable, function (promise) { + iterate(iterable, function (promise) { $promiseResolve.call(C, promise).then(capability.resolve, reject); }); }); @@ -7038,7 +7148,7 @@ var doric = (function (exports) { }); // `Promise.allSettled` method - // https://github.com/tc39/proposal-promise-allSettled + // https://tc39.es/ecma262/#sec-promise.allsettled _export({ target: 'Promise', stat: true }, { allSettled: function allSettled(iterable) { var C = this; @@ -7050,7 +7160,7 @@ var doric = (function (exports) { var values = []; var counter = 0; var remaining = 1; - iterate_1(iterable, function (promise) { + iterate(iterable, function (promise) { var index = counter++; var alreadyCalled = false; values.push(undefined); @@ -7060,10 +7170,10 @@ var doric = (function (exports) { alreadyCalled = true; values[index] = { status: 'fulfilled', value: value }; --remaining || resolve(values); - }, function (e) { + }, function (error) { if (alreadyCalled) { return; } alreadyCalled = true; - values[index] = { status: 'rejected', reason: e }; + values[index] = { status: 'rejected', reason: error }; --remaining || resolve(values); }); }); @@ -7074,13 +7184,52 @@ var doric = (function (exports) { } }); + var PROMISE_ANY_ERROR = 'No one promise resolved'; + + // `Promise.any` method + // https://tc39.es/ecma262/#sec-promise.any + _export({ target: 'Promise', stat: true }, { + any: function any(iterable) { + var C = this; + var capability = newPromiseCapability.f(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var promiseResolve = aFunction$1(C.resolve); + var errors = []; + var counter = 0; + var remaining = 1; + var alreadyResolved = false; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyRejected = false; + errors.push(undefined); + remaining++; + promiseResolve.call(C, promise).then(function (value) { + if (alreadyRejected || alreadyResolved) { return; } + alreadyResolved = true; + resolve(value); + }, function (error) { + if (alreadyRejected || alreadyResolved) { return; } + alreadyRejected = true; + errors[index] = error; + --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR)); + }); + }); + --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR)); + }); + if (result.error) { reject(result.value); } + return capability.promise; + } + }); + // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829 var NON_GENERIC = !!nativePromiseConstructor && fails(function () { nativePromiseConstructor.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ }); }); // `Promise.prototype.finally` method - // https://tc39.github.io/ecma262/#sec-promise.prototype.finally + // https://tc39.es/ecma262/#sec-promise.prototype.finally _export({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { 'finally': function (onFinally) { var C = speciesConstructor(this, getBuiltIn('Promise')); @@ -7097,7 +7246,7 @@ var doric = (function (exports) { }); // patch native Promise.prototype for native async functions - if ( typeof nativePromiseConstructor == 'function' && !nativePromiseConstructor.prototype['finally']) { + if (typeof nativePromiseConstructor == 'function' && !nativePromiseConstructor.prototype['finally']) { redefine(nativePromiseConstructor.prototype, 'finally', getBuiltIn('Promise').prototype['finally']); } @@ -7129,10 +7278,14 @@ var doric = (function (exports) { ); }; - // eslint-disable-next-line max-len - if (isForced_1(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { - new NativeConstructor().entries().next(); - })))) { + var REPLACE = isForced_1( + CONSTRUCTOR_NAME, + typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { + new NativeConstructor().entries().next(); + })) + ); + + if (REPLACE) { // create collection constructor Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); internalMetadata.REQUIRED = true; @@ -7143,7 +7296,7 @@ var doric = (function (exports) { // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); // most early implementations doesn't supports iterables, most modern - not close it correctly - // eslint-disable-next-line no-new + // eslint-disable-next-line no-new -- required for testing var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); // for early implementations -0 and +0 not the same var BUGGY_ZERO = !IS_WEAK && fails(function () { @@ -7158,7 +7311,7 @@ var doric = (function (exports) { Constructor = wrapper(function (dummy, iterable) { anInstance(dummy, Constructor, CONSTRUCTOR_NAME); var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); - if (iterable != undefined) { iterate_1(iterable, that[ADDER], that, IS_MAP); } + if (iterable != undefined) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } return that; }); Constructor.prototype = NativePrototype; @@ -7187,7 +7340,7 @@ var doric = (function (exports) { return Constructor; }; - var defineProperty$9 = objectDefineProperty.f; + var defineProperty$8 = objectDefineProperty.f; @@ -7214,7 +7367,7 @@ var doric = (function (exports) { size: 0 }); if (!descriptors) { that.size = 0; } - if (iterable != undefined) { iterate_1(iterable, that[ADDER], that, IS_MAP); } + if (iterable != undefined) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } }); var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); @@ -7329,7 +7482,7 @@ var doric = (function (exports) { return define(this, value = value === 0 ? 0 : value, value); } }); - if (descriptors) { defineProperty$9(C.prototype, 'size', { + if (descriptors) { defineProperty$8(C.prototype, 'size', { get: function () { return getInternalState(this).size; } @@ -7374,13 +7527,13 @@ var doric = (function (exports) { }; // `Map` constructor - // https://tc39.github.io/ecma262/#sec-map-objects + // https://tc39.es/ecma262/#sec-map-objects var es_map = collection('Map', function (init) { return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); // `Set` constructor - // https://tc39.github.io/ecma262/#sec-set-objects + // https://tc39.es/ecma262/#sec-set-objects var es_set = collection('Set', function (init) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); @@ -7446,7 +7599,7 @@ var doric = (function (exports) { id: id$1++, frozen: undefined }); - if (iterable != undefined) { iterate_1(iterable, that[ADDER], that, IS_MAP); } + if (iterable != undefined) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } }); var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME); @@ -7526,7 +7679,7 @@ var doric = (function (exports) { }; // `WeakMap` constructor - // https://tc39.github.io/ecma262/#sec-weakmap-constructor + // https://tc39.es/ecma262/#sec-weakmap-constructor var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak); // IE11 WeakMap frozen keys fix @@ -7575,7 +7728,7 @@ var doric = (function (exports) { }); // `WeakSet` constructor - // https://tc39.github.io/ecma262/#sec-weakset-constructor + // https://tc39.es/ecma262/#sec-weakset-constructor collection('WeakSet', function (init) { return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionWeak); @@ -7583,7 +7736,7 @@ var doric = (function (exports) { var arrayBufferNative = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined'; // `ToIndex` abstract operation - // https://tc39.github.io/ecma262/#sec-toindex + // https://tc39.es/ecma262/#sec-toindex var toIndex = function (it) { if (it === undefined) { return 0; } var number = toInteger(it); @@ -7593,8 +7746,6 @@ var doric = (function (exports) { }; // IEEE754 conversions based on https://github.com/feross/ieee754 - // eslint-disable-next-line no-shadow-restricted-names - var Infinity$1 = 1 / 0; var abs$7 = Math.abs; var pow$3 = Math.pow; var floor$6 = Math.floor; @@ -7611,9 +7762,9 @@ var doric = (function (exports) { var index = 0; var exponent, mantissa, c; number = abs$7(number); - // eslint-disable-next-line no-self-compare - if (number != number || number === Infinity$1) { - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check + if (number != number || number === Infinity) { + // eslint-disable-next-line no-self-compare -- NaN check mantissa = number != number ? 1 : 0; exponent = eMax; } else { @@ -7669,7 +7820,7 @@ var doric = (function (exports) { if (exponent === 0) { exponent = 1 - eBias; } else if (exponent === eMax) { - return mantissa ? NaN : sign ? -Infinity$1 : Infinity$1; + return mantissa ? NaN : sign ? -Infinity : Infinity; } else { mantissa = mantissa + pow$3(2, mantissaLength); exponent = exponent - eBias; @@ -7682,7 +7833,7 @@ var doric = (function (exports) { }; var getOwnPropertyNames$2 = objectGetOwnPropertyNames.f; - var defineProperty$a = objectDefineProperty.f; + var defineProperty$9 = objectDefineProperty.f; @@ -7729,7 +7880,7 @@ var doric = (function (exports) { }; var addGetter = function (Constructor, key) { - defineProperty$a(Constructor[PROTOTYPE$2], key, { get: function () { return getInternalState$6(this)[key]; } }); + defineProperty$9(Constructor[PROTOTYPE$2], key, { get: function () { return getInternalState$6(this)[key]; } }); }; var get$1 = function (view, count, index, isLittleEndian) { @@ -7843,16 +7994,18 @@ var doric = (function (exports) { } }); } else { + /* eslint-disable no-new -- required for testing */ if (!fails(function () { NativeArrayBuffer(1); }) || !fails(function () { - new NativeArrayBuffer(-1); // eslint-disable-line no-new + new NativeArrayBuffer(-1); }) || fails(function () { - new NativeArrayBuffer(); // eslint-disable-line no-new - new NativeArrayBuffer(1.5); // eslint-disable-line no-new - new NativeArrayBuffer(NaN); // eslint-disable-line no-new + new NativeArrayBuffer(); + new NativeArrayBuffer(1.5); + new NativeArrayBuffer(NaN); return NativeArrayBuffer.name != ARRAY_BUFFER; })) { + /* eslint-enable no-new -- required for testing */ $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, $ArrayBuffer); return new NativeArrayBuffer(toIndex(length)); @@ -7899,14 +8052,14 @@ var doric = (function (exports) { var NativeArrayBuffer$1 = global_1[ARRAY_BUFFER$1]; // `ArrayBuffer` constructor - // https://tc39.github.io/ecma262/#sec-arraybuffer-constructor + // https://tc39.es/ecma262/#sec-arraybuffer-constructor _export({ global: true, forced: NativeArrayBuffer$1 !== ArrayBuffer$1 }, { ArrayBuffer: ArrayBuffer$1 }); setSpecies(ARRAY_BUFFER$1); - var defineProperty$b = objectDefineProperty.f; + var defineProperty$a = objectDefineProperty.f; @@ -7940,13 +8093,24 @@ var doric = (function (exports) { Float64Array: 8 }; + var BigIntArrayConstructorsList = { + BigInt64Array: 8, + BigUint64Array: 8 + }; + var isView = function isView(it) { + if (!isObject(it)) { return false; } var klass = classof(it); - return klass === 'DataView' || has(TypedArrayConstructorsList, klass); + return klass === 'DataView' + || has(TypedArrayConstructorsList, klass) + || has(BigIntArrayConstructorsList, klass); }; var isTypedArray = function (it) { - return isObject(it) && has(TypedArrayConstructorsList, classof(it)); + if (!isObject(it)) { return false; } + var klass = classof(it); + return has(TypedArrayConstructorsList, klass) + || has(BigIntArrayConstructorsList, klass); }; var aTypedArray = function (it) { @@ -8010,7 +8174,7 @@ var doric = (function (exports) { // WebKit bug - typed arrays constructors prototype is Object.prototype if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) { - // eslint-disable-next-line no-shadow + // eslint-disable-next-line no-shadow -- safe TypedArray = function TypedArray() { throw TypeError('Incorrect invocation'); }; @@ -8033,7 +8197,7 @@ var doric = (function (exports) { if (descriptors && !has(TypedArrayPrototype, TO_STRING_TAG$3)) { TYPED_ARRAY_TAG_REQIRED = true; - defineProperty$b(TypedArrayPrototype, TO_STRING_TAG$3, { get: function () { + defineProperty$a(TypedArrayPrototype, TO_STRING_TAG$3, { get: function () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); for (NAME$1 in TypedArrayConstructorsList) { if (global_1[NAME$1]) { @@ -8057,7 +8221,7 @@ var doric = (function (exports) { var NATIVE_ARRAY_BUFFER_VIEWS$1 = arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; // `ArrayBuffer.isView` method - // https://tc39.github.io/ecma262/#sec-arraybuffer.isview + // https://tc39.es/ecma262/#sec-arraybuffer.isview _export({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS$1 }, { isView: arrayBufferViewCore.isView }); @@ -8071,7 +8235,7 @@ var doric = (function (exports) { }); // `ArrayBuffer.prototype.slice` method - // https://tc39.github.io/ecma262/#sec-arraybuffer.prototype.slice + // https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice _export({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { slice: function slice(start, end) { if (nativeArrayBufferSlice !== undefined && end === undefined) { @@ -8091,12 +8255,12 @@ var doric = (function (exports) { }); // `DataView` constructor - // https://tc39.github.io/ecma262/#sec-dataview-constructor + // https://tc39.es/ecma262/#sec-dataview-constructor _export({ global: true, forced: !arrayBufferNative }, { DataView: arrayBuffer.DataView }); - /* eslint-disable no-new */ + /* eslint-disable no-new -- required for testing */ @@ -8392,7 +8556,7 @@ var doric = (function (exports) { }); // `Int8Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Int8', function (init) { return function Int8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8400,7 +8564,7 @@ var doric = (function (exports) { }); // `Uint8Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Uint8', function (init) { return function Uint8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8408,7 +8572,7 @@ var doric = (function (exports) { }); // `Uint8ClampedArray` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Uint8', function (init) { return function Uint8ClampedArray(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8416,7 +8580,7 @@ var doric = (function (exports) { }, true); // `Int16Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Int16', function (init) { return function Int16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8424,7 +8588,7 @@ var doric = (function (exports) { }); // `Uint16Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Uint16', function (init) { return function Uint16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8432,7 +8596,7 @@ var doric = (function (exports) { }); // `Int32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Int32', function (init) { return function Int32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8440,7 +8604,7 @@ var doric = (function (exports) { }); // `Uint32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Uint32', function (init) { return function Uint32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8448,7 +8612,7 @@ var doric = (function (exports) { }); // `Float32Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Float32', function (init) { return function Float32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8456,7 +8620,7 @@ var doric = (function (exports) { }); // `Float64Array` constructor - // https://tc39.github.io/ecma262/#sec-typedarray-objects + // https://tc39.es/ecma262/#sec-typedarray-objects typedArrayConstructor('Float64', function (init) { return function Float64Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -8467,14 +8631,14 @@ var doric = (function (exports) { // `%TypedArray%.from` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.from + // https://tc39.es/ecma262/#sec-%typedarray%.from exportTypedArrayStaticMethod$1('from', typedArrayFrom, typedArrayConstructorsRequireWrappers); var aTypedArrayConstructor$2 = arrayBufferViewCore.aTypedArrayConstructor; var exportTypedArrayStaticMethod$2 = arrayBufferViewCore.exportTypedArrayStaticMethod; // `%TypedArray%.of` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.of + // https://tc39.es/ecma262/#sec-%typedarray%.of exportTypedArrayStaticMethod$2('of', function of(/* ...items */) { var arguments$1 = arguments; @@ -8489,7 +8653,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.copyWithin` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.copywithin + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin exportTypedArrayMethod$1('copyWithin', function copyWithin(target, start /* , end */) { return arrayCopyWithin.call(aTypedArray$1(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }); @@ -8500,7 +8664,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$2 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.every` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.every exportTypedArrayMethod$2('every', function every(callbackfn /* , thisArg */) { return $every$1(aTypedArray$2(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8509,29 +8673,35 @@ var doric = (function (exports) { var exportTypedArrayMethod$3 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.fill` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.fill - // eslint-disable-next-line no-unused-vars + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill + // eslint-disable-next-line no-unused-vars -- required for `.length` exportTypedArrayMethod$3('fill', function fill(value /* , start, end */) { return arrayFill.apply(aTypedArray$3(this), arguments); }); - var $filter$1 = arrayIteration.filter; - - - var aTypedArray$4 = arrayBufferViewCore.aTypedArray; var aTypedArrayConstructor$3 = arrayBufferViewCore.aTypedArrayConstructor; - var exportTypedArrayMethod$4 = arrayBufferViewCore.exportTypedArrayMethod; - // `%TypedArray%.prototype.filter` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter - exportTypedArrayMethod$4('filter', function filter(callbackfn /* , thisArg */) { - var list = $filter$1(aTypedArray$4(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - var C = speciesConstructor(this, this.constructor); + + var typedArrayFromSpeciesAndList = function (instance, list) { + var C = speciesConstructor(instance, instance.constructor); var index = 0; var length = list.length; var result = new (aTypedArrayConstructor$3(C))(length); while (length > index) { result[index] = list[index++]; } return result; + }; + + var $filter$1 = arrayIteration.filter; + + + var aTypedArray$4 = arrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod$4 = arrayBufferViewCore.exportTypedArrayMethod; + + // `%TypedArray%.prototype.filter` method + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter + exportTypedArrayMethod$4('filter', function filter(callbackfn /* , thisArg */) { + var list = $filter$1(aTypedArray$4(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + return typedArrayFromSpeciesAndList(this, list); }); var $find$1 = arrayIteration.find; @@ -8540,7 +8710,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$5 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.find` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.find exportTypedArrayMethod$5('find', function find(predicate /* , thisArg */) { return $find$1(aTypedArray$5(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8551,7 +8721,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$6 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.findIndex` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findindex + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex exportTypedArrayMethod$6('findIndex', function findIndex(predicate /* , thisArg */) { return $findIndex$1(aTypedArray$6(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8562,7 +8732,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$7 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.forEach` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.foreach + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach exportTypedArrayMethod$7('forEach', function forEach(callbackfn /* , thisArg */) { $forEach$2(aTypedArray$7(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8573,7 +8743,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$8 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.includes` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.includes + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes exportTypedArrayMethod$8('includes', function includes(searchElement /* , fromIndex */) { return $includes$1(aTypedArray$8(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8584,7 +8754,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$9 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.indexOf` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.indexof + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof exportTypedArrayMethod$9('indexOf', function indexOf(searchElement /* , fromIndex */) { return $indexOf$1(aTypedArray$9(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8606,20 +8776,20 @@ var doric = (function (exports) { }; // `%TypedArray%.prototype.entries` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.entries + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries exportTypedArrayMethod$a('entries', function entries() { return arrayEntries.call(aTypedArray$a(this)); }); // `%TypedArray%.prototype.keys` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.keys + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys exportTypedArrayMethod$a('keys', function keys() { return arrayKeys.call(aTypedArray$a(this)); }); // `%TypedArray%.prototype.values` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.values + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.values exportTypedArrayMethod$a('values', typedArrayValues, !CORRECT_ITER_NAME); // `%TypedArray%.prototype[@@iterator]` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype-@@iterator + // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator exportTypedArrayMethod$a(ITERATOR$5, typedArrayValues, !CORRECT_ITER_NAME); var aTypedArray$b = arrayBufferViewCore.aTypedArray; @@ -8627,8 +8797,8 @@ var doric = (function (exports) { var $join = [].join; // `%TypedArray%.prototype.join` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join - // eslint-disable-next-line no-unused-vars + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.join + // eslint-disable-next-line no-unused-vars -- required for `.length` exportTypedArrayMethod$b('join', function join(separator) { return $join.apply(aTypedArray$b(this), arguments); }); @@ -8637,8 +8807,8 @@ var doric = (function (exports) { var exportTypedArrayMethod$c = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.lastIndexOf` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.lastindexof - // eslint-disable-next-line no-unused-vars + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof + // eslint-disable-next-line no-unused-vars -- required for `.length` exportTypedArrayMethod$c('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { return arrayLastIndexOf.apply(aTypedArray$c(this), arguments); }); @@ -8651,7 +8821,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$d = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.map` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.map + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.map exportTypedArrayMethod$d('map', function map(mapfn /* , thisArg */) { return $map$1(aTypedArray$d(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { return new (aTypedArrayConstructor$4(speciesConstructor(O, O.constructor)))(length); @@ -8664,7 +8834,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$e = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.reduce` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce exportTypedArrayMethod$e('reduce', function reduce(callbackfn /* , initialValue */) { return $reduce$1(aTypedArray$e(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8675,7 +8845,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$f = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.reduceRicht` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright exportTypedArrayMethod$f('reduceRight', function reduceRight(callbackfn /* , initialValue */) { return $reduceRight$1(aTypedArray$f(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8685,7 +8855,7 @@ var doric = (function (exports) { var floor$7 = Math.floor; // `%TypedArray%.prototype.reverse` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reverse + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse exportTypedArrayMethod$g('reverse', function reverse() { var that = this; var length = aTypedArray$g(that).length; @@ -8703,12 +8873,12 @@ var doric = (function (exports) { var exportTypedArrayMethod$h = arrayBufferViewCore.exportTypedArrayMethod; var FORCED$h = fails(function () { - // eslint-disable-next-line no-undef + /* global Int8Array -- safe */ new Int8Array(1).set({}); }); // `%TypedArray%.prototype.set` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.set + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set exportTypedArrayMethod$h('set', function set(arrayLike /* , offset */) { aTypedArray$h(this); var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); @@ -8726,12 +8896,12 @@ var doric = (function (exports) { var $slice = [].slice; var FORCED$i = fails(function () { - // eslint-disable-next-line no-undef + /* global Int8Array -- safe */ new Int8Array(1).slice(); }); // `%TypedArray%.prototype.slice` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice exportTypedArrayMethod$i('slice', function slice(start, end) { var list = $slice.call(aTypedArray$i(this), start, end); var C = speciesConstructor(this, this.constructor); @@ -8748,7 +8918,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$j = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.some` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.some exportTypedArrayMethod$j('some', function some(callbackfn /* , thisArg */) { return $some$1(aTypedArray$j(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); @@ -8758,7 +8928,7 @@ var doric = (function (exports) { var $sort = [].sort; // `%TypedArray%.prototype.sort` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort exportTypedArrayMethod$k('sort', function sort(comparefn) { return $sort.call(aTypedArray$k(this), comparefn); }); @@ -8767,7 +8937,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$l = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.subarray` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.subarray + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray exportTypedArrayMethod$l('subarray', function subarray(begin, end) { var O = aTypedArray$l(this); var length = O.length; @@ -8797,7 +8967,7 @@ var doric = (function (exports) { }); // `%TypedArray%.prototype.toLocaleString` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring exportTypedArrayMethod$m('toLocaleString', function toLocaleString() { return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice$1.call(aTypedArray$m(this)) : aTypedArray$m(this), arguments); }, FORCED$j); @@ -8820,7 +8990,7 @@ var doric = (function (exports) { var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; // `%TypedArray%.prototype.toString` method - // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tostring + // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring exportTypedArrayMethod$n('toString', arrayToString, IS_NOT_ARRAY_METHOD); var nativeApply = getBuiltIn('Reflect', 'apply'); @@ -8832,7 +9002,7 @@ var doric = (function (exports) { }); // `Reflect.apply` method - // https://tc39.github.io/ecma262/#sec-reflect.apply + // https://tc39.es/ecma262/#sec-reflect.apply _export({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, { apply: function apply(target, thisArgument, argumentsList) { aFunction$1(target); @@ -8846,7 +9016,7 @@ var doric = (function (exports) { var nativeConstruct = getBuiltIn('Reflect', 'construct'); // `Reflect.construct` method - // https://tc39.github.io/ecma262/#sec-reflect.construct + // https://tc39.es/ecma262/#sec-reflect.construct // MS Edge supports only 2 arguments and argumentsList argument is optional // FF Nightly sets third argument as `new.target`, but does not create `this` from it var NEW_TARGET_BUG = fails(function () { @@ -8888,12 +9058,12 @@ var doric = (function (exports) { // MS Edge has broken Reflect.defineProperty - throwing instead of returning false var ERROR_INSTEAD_OF_FALSE = fails(function () { - // eslint-disable-next-line no-undef + /* global Reflect -- required for testing */ Reflect.defineProperty(objectDefineProperty.f({}, 1, { value: 1 }), 1, { value: 2 }); }); // `Reflect.defineProperty` method - // https://tc39.github.io/ecma262/#sec-reflect.defineproperty + // https://tc39.es/ecma262/#sec-reflect.defineproperty _export({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !descriptors }, { defineProperty: function defineProperty(target, propertyKey, attributes) { anObject(target); @@ -8911,7 +9081,7 @@ var doric = (function (exports) { var getOwnPropertyDescriptor$8 = objectGetOwnPropertyDescriptor.f; // `Reflect.deleteProperty` method - // https://tc39.github.io/ecma262/#sec-reflect.deleteproperty + // https://tc39.es/ecma262/#sec-reflect.deleteproperty _export({ target: 'Reflect', stat: true }, { deleteProperty: function deleteProperty(target, propertyKey) { var descriptor = getOwnPropertyDescriptor$8(anObject(target), propertyKey); @@ -8920,7 +9090,7 @@ var doric = (function (exports) { }); // `Reflect.get` method - // https://tc39.github.io/ecma262/#sec-reflect.get + // https://tc39.es/ecma262/#sec-reflect.get function get$2(target, propertyKey /* , receiver */) { var receiver = arguments.length < 3 ? target : arguments[2]; var descriptor, prototype; @@ -8938,7 +9108,7 @@ var doric = (function (exports) { }); // `Reflect.getOwnPropertyDescriptor` method - // https://tc39.github.io/ecma262/#sec-reflect.getownpropertydescriptor + // https://tc39.es/ecma262/#sec-reflect.getownpropertydescriptor _export({ target: 'Reflect', stat: true, sham: !descriptors }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { return objectGetOwnPropertyDescriptor.f(anObject(target), propertyKey); @@ -8946,7 +9116,7 @@ var doric = (function (exports) { }); // `Reflect.getPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-reflect.getprototypeof + // https://tc39.es/ecma262/#sec-reflect.getprototypeof _export({ target: 'Reflect', stat: true, sham: !correctPrototypeGetter }, { getPrototypeOf: function getPrototypeOf(target) { return objectGetPrototypeOf(anObject(target)); @@ -8954,7 +9124,7 @@ var doric = (function (exports) { }); // `Reflect.has` method - // https://tc39.github.io/ecma262/#sec-reflect.has + // https://tc39.es/ecma262/#sec-reflect.has _export({ target: 'Reflect', stat: true }, { has: function has(target, propertyKey) { return propertyKey in target; @@ -8964,7 +9134,7 @@ var doric = (function (exports) { var objectIsExtensible = Object.isExtensible; // `Reflect.isExtensible` method - // https://tc39.github.io/ecma262/#sec-reflect.isextensible + // https://tc39.es/ecma262/#sec-reflect.isextensible _export({ target: 'Reflect', stat: true }, { isExtensible: function isExtensible(target) { anObject(target); @@ -8973,13 +9143,13 @@ var doric = (function (exports) { }); // `Reflect.ownKeys` method - // https://tc39.github.io/ecma262/#sec-reflect.ownkeys + // https://tc39.es/ecma262/#sec-reflect.ownkeys _export({ target: 'Reflect', stat: true }, { ownKeys: ownKeys }); // `Reflect.preventExtensions` method - // https://tc39.github.io/ecma262/#sec-reflect.preventextensions + // https://tc39.es/ecma262/#sec-reflect.preventextensions _export({ target: 'Reflect', stat: true, sham: !freezing }, { preventExtensions: function preventExtensions(target) { anObject(target); @@ -8994,7 +9164,7 @@ var doric = (function (exports) { }); // `Reflect.set` method - // https://tc39.github.io/ecma262/#sec-reflect.set + // https://tc39.es/ecma262/#sec-reflect.set function set$3(target, propertyKey, V /* , receiver */) { var receiver = arguments.length < 4 ? target : arguments[3]; var ownDescriptor = objectGetOwnPropertyDescriptor.f(anObject(target), propertyKey); @@ -9020,9 +9190,10 @@ var doric = (function (exports) { // MS Edge 17-18 Reflect.set allows setting the property to object // with non-writable property on the prototype var MS_EDGE_BUG = fails(function () { - var object = objectDefineProperty.f({}, 'a', { configurable: true }); - // eslint-disable-next-line no-undef - return Reflect.set(objectGetPrototypeOf(object), 'a', 1, object) !== false; + var Constructor = function () { /* empty */ }; + var object = objectDefineProperty.f(new Constructor(), 'a', { configurable: true }); + /* global Reflect -- required for testing */ + return Reflect.set(Constructor.prototype, 'a', 1, object) !== false; }); _export({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, { @@ -9030,7 +9201,7 @@ var doric = (function (exports) { }); // `Reflect.setPrototypeOf` method - // https://tc39.github.io/ecma262/#sec-reflect.setprototypeof + // https://tc39.es/ecma262/#sec-reflect.setprototypeof if (objectSetPrototypeOf) { _export({ target: 'Reflect', stat: true }, { setPrototypeOf: function setPrototypeOf(target, proto) { anObject(target); @@ -9044,6 +9215,12 @@ var doric = (function (exports) { } }); } + _export({ global: true }, { Reflect: {} }); + + // Reflect[@@toStringTag] property + // https://tc39.es/ecma262/#sec-reflect-@@tostringtag + setToStringTag(global_1.Reflect, 'Reflect', true); + // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` @@ -9162,7 +9339,7 @@ var doric = (function (exports) { var from = function (iter) { var result = []; - iterate_1(iter, result.push, result); + iterate(iter, result.push, { that: result }); return result; }; @@ -9311,9 +9488,14 @@ var doric = (function (exports) { var charAt$2 = stringMultibyte.charAt; + + var FORCED$l = fails(function () { + return '𠮷'.at(0) !== '𠮷'; + }); + // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at - _export({ target: 'String', proto: true }, { + _export({ target: 'String', proto: true, forced: FORCED$l }, { at: function at(pos) { return charAt$2(this, pos); } @@ -9424,7 +9606,7 @@ var doric = (function (exports) { * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. */ - // eslint-disable-next-line max-statements + // eslint-disable-next-line max-statements -- TODO var encode = function (input) { var output = []; @@ -9585,7 +9767,7 @@ var doric = (function (exports) { var find$1 = /[!'()~]|%20/g; - var replace = { + var replace$1 = { '!': '%21', "'": '%27', '(': '%28', @@ -9595,7 +9777,7 @@ var doric = (function (exports) { }; var replacer = function (match) { - return replace[match]; + return replace$1[match]; }; var serialize = function (it) { @@ -9687,7 +9869,7 @@ var doric = (function (exports) { var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; redefineAll(URLSearchParamsPrototype, { - // `URLSearchParams.prototype.appent` method + // `URLSearchParams.prototype.append` method // https://url.spec.whatwg.org/#dom-urlsearchparams-append append: function append(name, value) { validateArgumentsLength(arguments.length, 2); @@ -9909,14 +10091,12 @@ var doric = (function (exports) { var OCT = /^[0-7]+$/; var DEC = /^\d+$/; var HEX = /^[\dA-Fa-f]+$/; - // eslint-disable-next-line no-control-regex - var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/; - // eslint-disable-next-line no-control-regex - var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/; - // eslint-disable-next-line no-control-regex + /* eslint-disable no-control-regex -- safe */ + var FORBIDDEN_HOST_CODE_POINT = /[\u0000\t\u000A\u000D #%/:?@[\\]]/; + var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\t\u000A\u000D #/:?@[\\]]/; var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; - // eslint-disable-next-line no-control-regex - var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g; + var TAB_AND_NEW_LINE = /[\t\u000A\u000D]/g; + /* eslint-enable no-control-regex -- safe */ var EOF; var parseHost = function (url, input) { @@ -9982,7 +10162,7 @@ var doric = (function (exports) { return ipv4; }; - // eslint-disable-next-line max-statements + // eslint-disable-next-line max-statements -- TODO var parseIPv6 = function (input) { var address = [0, 0, 0, 0, 0, 0, 0, 0]; var pieceIndex = 0; @@ -10204,7 +10384,7 @@ var doric = (function (exports) { var QUERY = {}; var FRAGMENT = {}; - // eslint-disable-next-line max-statements + // eslint-disable-next-line max-statements -- TODO var parseURL = function (url, input, stateOverride, base) { var state = stateOverride || SCHEME_START; var pointer = 0; @@ -10860,13 +11040,13 @@ var doric = (function (exports) { var nativeRevokeObjectURL = NativeURL.revokeObjectURL; // `URL.createObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars -- required for `.length` if (nativeCreateObjectURL) { redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { return nativeCreateObjectURL.apply(NativeURL, arguments); }); } // `URL.revokeObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars -- required for `.length` if (nativeRevokeObjectURL) { redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { return nativeRevokeObjectURL.apply(NativeURL, arguments); }); } @@ -10886,12 +11066,116 @@ var doric = (function (exports) { } }); - var defineProperty$c = objectDefineProperty.f; + var $filterOut = arrayIteration.filterOut; + + + // `Array.prototype.filterOut` method + // https://github.com/tc39/proposal-array-filtering + _export({ target: 'Array', proto: true }, { + filterOut: function filterOut(callbackfn /* , thisArg */) { + return $filterOut(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + addToUnscopables('filterOut'); + + var $filterOut$1 = arrayIteration.filterOut; + + + var aTypedArray$n = arrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod$o = arrayBufferViewCore.exportTypedArrayMethod; + + // `%TypedArray%.prototype.filterOut` method + // https://github.com/tc39/proposal-array-filtering + exportTypedArrayMethod$o('filterOut', function filterOut(callbackfn /* , thisArg */) { + var list = $filterOut$1(aTypedArray$n(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + return typedArrayFromSpeciesAndList(this, list); + }); + + // `Array.prototype.{ findLast, findLastIndex }` methods implementation + var createMethod$7 = function (TYPE) { + var IS_FIND_INDEX = TYPE == 6; + return function ($this, callbackfn, that) { + var O = toObject($this); + var self = indexedObject(O); + var boundFunction = functionBindContext(callbackfn, that, 3); + var index = toLength(self.length); + var value, result; + while (index-- > 0) { + value = self[index]; + result = boundFunction(value, index, O); + if (result) { switch (TYPE) { + case 5: return value; // find + case 6: return index; // findIndex + } } + } + return IS_FIND_INDEX ? -1 : undefined; + }; + }; + + var arrayIterationFromLast = { + // `Array.prototype.findLast` method + // https://github.com/tc39/proposal-array-find-from-last + findLast: createMethod$7(5), + // `Array.prototype.findLastIndex` method + // https://github.com/tc39/proposal-array-find-from-last + findLastIndex: createMethod$7(6) + }; + + var $findLast = arrayIterationFromLast.findLast; + + + // `Array.prototype.findLast` method + // https://github.com/tc39/proposal-array-find-from-last + _export({ target: 'Array', proto: true }, { + findLast: function findLast(callbackfn /* , that = undefined */) { + return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + addToUnscopables('findLast'); + + var $findLastIndex = arrayIterationFromLast.findLastIndex; + + + // `Array.prototype.findLastIndex` method + // https://github.com/tc39/proposal-array-find-from-last + _export({ target: 'Array', proto: true }, { + findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) { + return $findLastIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } + }); + + addToUnscopables('findLastIndex'); + + var $findLast$1 = arrayIterationFromLast.findLast; + + var aTypedArray$o = arrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod$p = arrayBufferViewCore.exportTypedArrayMethod; + + // `%TypedArray%.prototype.findLast` method + // https://github.com/tc39/proposal-array-find-from-last + exportTypedArrayMethod$p('findLast', function findLast(predicate /* , thisArg */) { + return $findLast$1(aTypedArray$o(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }); + + var $findLastIndex$1 = arrayIterationFromLast.findLastIndex; + + var aTypedArray$p = arrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod$q = arrayBufferViewCore.exportTypedArrayMethod; + + // `%TypedArray%.prototype.findLastIndex` method + // https://github.com/tc39/proposal-array-find-from-last + exportTypedArrayMethod$q('findLastIndex', function findLastIndex(predicate /* , thisArg */) { + return $findLastIndex$1(aTypedArray$p(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }); + + var defineProperty$b = objectDefineProperty.f; // `Array.prototype.lastIndex` getter // https://github.com/keithamus/proposal-array-last if (descriptors && !('lastIndex' in [])) { - defineProperty$c(Array.prototype, 'lastIndex', { + defineProperty$b(Array.prototype, 'lastIndex', { configurable: true, get: function lastIndex() { var O = toObject(this); @@ -10903,12 +11187,12 @@ var doric = (function (exports) { addToUnscopables('lastIndex'); } - var defineProperty$d = objectDefineProperty.f; + var defineProperty$c = objectDefineProperty.f; // `Array.prototype.lastIndex` accessor // https://github.com/keithamus/proposal-array-last if (descriptors && !('lastItem' in [])) { - defineProperty$d(Array.prototype, 'lastItem', { + defineProperty$c(Array.prototype, 'lastItem', { configurable: true, get: function lastItem() { var O = toObject(this); @@ -10925,6 +11209,50 @@ var doric = (function (exports) { addToUnscopables('lastItem'); } + var push$1 = [].push; + + // `Array.prototype.uniqueBy` method + // https://github.com/tc39/proposal-array-unique + var arrayUniqueBy = function uniqueBy(resolver) { + var that = toObject(this); + var length = toLength(that.length); + var result = arraySpeciesCreate(that, 0); + var Map = getBuiltIn('Map'); + var map = new Map(); + var resolverFunction, index, item, key; + if (typeof resolver == 'function') { resolverFunction = resolver; } + else if (resolver == null) { resolverFunction = function (value) { + return value; + }; } + else { throw new TypeError('Incorrect resolver!'); } + for (index = 0; index < length; index++) { + item = that[index]; + key = resolverFunction(item); + if (!map.has(key)) { map.set(key, item); } + } + map.forEach(function (value) { + push$1.call(result, value); + }); + return result; + }; + + // `Array.prototype.uniqueBy` method + // https://github.com/tc39/proposal-array-unique + _export({ target: 'Array', proto: true }, { + uniqueBy: arrayUniqueBy + }); + + addToUnscopables('uniqueBy'); + + var aTypedArray$q = arrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod$r = arrayBufferViewCore.exportTypedArrayMethod; + + // `%TypedArray%.prototype.uniqueBy` method + // https://github.com/tc39/proposal-array-unique + exportTypedArrayMethod$r('uniqueBy', function uniqueBy(resolver) { + return typedArrayFromSpeciesAndList(this, arrayUniqueBy.call(aTypedArray$q(this), resolver)); + }); + // `Map.groupBy` method // https://github.com/tc39/proposal-collection-methods _export({ target: 'Map', stat: true }, { @@ -10934,7 +11262,7 @@ var doric = (function (exports) { var has = aFunction$1(newMap.has); var get = aFunction$1(newMap.get); var set = aFunction$1(newMap.set); - iterate_1(iterable, function (element) { + iterate(iterable, function (element) { var derivedKey = keyDerivative(element); if (!has.call(newMap, derivedKey)) { set.call(newMap, derivedKey, [element]); } else { get.call(newMap, derivedKey).push(element); } @@ -10950,7 +11278,7 @@ var doric = (function (exports) { var newMap = new this(); aFunction$1(keyDerivative); var setter = aFunction$1(newMap.set); - iterate_1(iterable, function (element) { + iterate(iterable, function (element) { setter.call(newMap, keyDerivative(element), element); }); return newMap; @@ -10980,8 +11308,8 @@ var doric = (function (exports) { } }); - var getMapIterator = function (it) { - // eslint-disable-next-line no-undef + var getMapIterator = function (it) { + // eslint-disable-next-line no-undef -- safe return Map.prototype.entries.call(it); }; @@ -10992,9 +11320,9 @@ var doric = (function (exports) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - return !iterate_1(iterator, function (key, value) { - if (!boundFunction(value, key, map)) { return iterate_1.stop(); } - }, undefined, true, true).stopped; + return !iterate(iterator, function (key, value, stop) { + if (!boundFunction(value, key, map)) { return stop(); } + }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); @@ -11007,9 +11335,9 @@ var doric = (function (exports) { var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); var setter = aFunction$1(newMap.set); - iterate_1(iterator, function (key, value) { + iterate(iterator, function (key, value) { if (boundFunction(value, key, map)) { setter.call(newMap, key, value); } - }, undefined, true, true); + }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); @@ -11021,9 +11349,9 @@ var doric = (function (exports) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - return iterate_1(iterator, function (key, value) { - if (boundFunction(value, key, map)) { return iterate_1.stop(value); } - }, undefined, true, true).result; + return iterate(iterator, function (key, value, stop) { + if (boundFunction(value, key, map)) { return stop(value); } + }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); @@ -11034,16 +11362,16 @@ var doric = (function (exports) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - return iterate_1(iterator, function (key, value) { - if (boundFunction(value, key, map)) { return iterate_1.stop(key); } - }, undefined, true, true).result; + return iterate(iterator, function (key, value, stop) { + if (boundFunction(value, key, map)) { return stop(key); } + }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); // `SameValueZero` abstract operation - // https://tc39.github.io/ecma262/#sec-samevaluezero + // https://tc39.es/ecma262/#sec-samevaluezero var sameValueZero = function (x, y) { - // eslint-disable-next-line no-self-compare + // eslint-disable-next-line no-self-compare -- NaN check return x === y || x != x && y != y; }; @@ -11051,9 +11379,9 @@ var doric = (function (exports) { // https://github.com/tc39/proposal-collection-methods _export({ target: 'Map', proto: true, real: true, forced: isPure }, { includes: function includes(searchElement) { - return iterate_1(getMapIterator(anObject(this)), function (key, value) { - if (sameValueZero(value, searchElement)) { return iterate_1.stop(); } - }, undefined, true, true).stopped; + return iterate(getMapIterator(anObject(this)), function (key, value, stop) { + if (sameValueZero(value, searchElement)) { return stop(); } + }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); @@ -11061,9 +11389,9 @@ var doric = (function (exports) { // https://github.com/tc39/proposal-collection-methods _export({ target: 'Map', proto: true, real: true, forced: isPure }, { keyOf: function keyOf(searchElement) { - return iterate_1(getMapIterator(anObject(this)), function (key, value) { - if (value === searchElement) { return iterate_1.stop(key); } - }, undefined, true, true).result; + return iterate(getMapIterator(anObject(this)), function (key, value, stop) { + if (value === searchElement) { return stop(key); } + }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); @@ -11076,9 +11404,9 @@ var doric = (function (exports) { var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); var setter = aFunction$1(newMap.set); - iterate_1(iterator, function (key, value) { + iterate(iterator, function (key, value) { setter.call(newMap, boundFunction(value, key, map), value); - }, undefined, true, true); + }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); @@ -11092,9 +11420,9 @@ var doric = (function (exports) { var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newMap = new (speciesConstructor(map, getBuiltIn('Map')))(); var setter = aFunction$1(newMap.set); - iterate_1(iterator, function (key, value) { + iterate(iterator, function (key, value) { setter.call(newMap, key, boundFunction(value, key, map)); - }, undefined, true, true); + }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); @@ -11102,7 +11430,7 @@ var doric = (function (exports) { // `Map.prototype.merge` method // https://github.com/tc39/proposal-collection-methods _export({ target: 'Map', proto: true, real: true, forced: isPure }, { - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line no-unused-vars -- required for `.length` merge: function merge(iterable /* ...iterbles */) { var arguments$1 = arguments; @@ -11110,7 +11438,7 @@ var doric = (function (exports) { var setter = aFunction$1(map.set); var i = 0; while (i < arguments.length) { - iterate_1(arguments$1[i++], setter, map, true); + iterate(arguments$1[i++], setter, { that: map, AS_ENTRIES: true }); } return map; } @@ -11125,14 +11453,14 @@ var doric = (function (exports) { var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aFunction$1(callbackfn); - iterate_1(iterator, function (key, value) { + iterate(iterator, function (key, value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, key, map); } - }, undefined, true, true); + }, { AS_ENTRIES: true, IS_ITERATOR: true }); if (noInitial) { throw TypeError('Reduce of empty map with no initial value'); } return accumulator; } @@ -11145,9 +11473,9 @@ var doric = (function (exports) { var map = anObject(this); var iterator = getMapIterator(map); var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - return iterate_1(iterator, function (key, value) { - if (boundFunction(value, key, map)) { return iterate_1.stop(); } - }, undefined, true, true).stopped; + return iterate(iterator, function (key, value, stop) { + if (boundFunction(value, key, map)) { return stop(); } + }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); @@ -11196,8 +11524,8 @@ var doric = (function (exports) { } }); - var getSetIterator = function (it) { - // eslint-disable-next-line no-undef + var getSetIterator = function (it) { + // eslint-disable-next-line no-undef -- safe return Set.prototype.values.call(it); }; @@ -11208,9 +11536,9 @@ var doric = (function (exports) { var set = anObject(this); var iterator = getSetIterator(set); var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - return !iterate_1(iterator, function (value) { - if (!boundFunction(value, value, set)) { return iterate_1.stop(); } - }, undefined, false, true).stopped; + return !iterate(iterator, function (value, stop) { + if (!boundFunction(value, value, set)) { return stop(); } + }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); @@ -11223,9 +11551,9 @@ var doric = (function (exports) { var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); var adder = aFunction$1(newSet.add); - iterate_1(iterator, function (value) { + iterate(iterator, function (value) { if (boundFunction(value, value, set)) { adder.call(newSet, value); } - }, undefined, false, true); + }, { IS_ITERATOR: true }); return newSet; } }); @@ -11237,9 +11565,9 @@ var doric = (function (exports) { var set = anObject(this); var iterator = getSetIterator(set); var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - return iterate_1(iterator, function (value) { - if (boundFunction(value, value, set)) { return iterate_1.stop(value); } - }, undefined, false, true).result; + return iterate(iterator, function (value, stop) { + if (boundFunction(value, value, set)) { return stop(value); } + }, { IS_ITERATOR: true, INTERRUPTED: true }).result; } }); @@ -11251,7 +11579,7 @@ var doric = (function (exports) { var iterator = getSetIterator(set); var sep = separator === undefined ? ',' : String(separator); var result = []; - iterate_1(iterator, result.push, result, false, true); + iterate(iterator, result.push, { that: result, IS_ITERATOR: true }); return result.join(sep); } }); @@ -11265,9 +11593,9 @@ var doric = (function (exports) { var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); var adder = aFunction$1(newSet.add); - iterate_1(iterator, function (value) { + iterate(iterator, function (value) { adder.call(newSet, boundFunction(value, value, set)); - }, undefined, false, true); + }, { IS_ITERATOR: true }); return newSet; } }); @@ -11281,14 +11609,14 @@ var doric = (function (exports) { var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aFunction$1(callbackfn); - iterate_1(iterator, function (value) { + iterate(iterator, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, value, set); } - }, undefined, false, true); + }, { IS_ITERATOR: true }); if (noInitial) { throw TypeError('Reduce of empty set with no initial value'); } return accumulator; } @@ -11301,9 +11629,9 @@ var doric = (function (exports) { var set = anObject(this); var iterator = getSetIterator(set); var boundFunction = functionBindContext(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); - return iterate_1(iterator, function (value) { - if (boundFunction(value, value, set)) { return iterate_1.stop(); } - }, undefined, false, true).stopped; + return iterate(iterator, function (value, stop) { + if (boundFunction(value, value, set)) { return stop(); } + }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); @@ -11339,22 +11667,22 @@ var doric = (function (exports) { var collectionFrom = function from(source /* , mapFn, thisArg */) { var length = arguments.length; var mapFn = length > 1 ? arguments[1] : undefined; - var mapping, A, n, boundFunction; + var mapping, array, n, boundFunction; aFunction$1(this); mapping = mapFn !== undefined; if (mapping) { aFunction$1(mapFn); } if (source == undefined) { return new this(); } - A = []; + array = []; if (mapping) { n = 0; boundFunction = functionBindContext(mapFn, length > 2 ? arguments[2] : undefined, 2); - iterate_1(source, function (nextItem) { - A.push(boundFunction(nextItem, n++)); + iterate(source, function (nextItem) { + array.push(boundFunction(nextItem, n++)); }); } else { - iterate_1(source, A.push, A); + iterate(source, array.push, { that: array }); } - return new this(A); + return new this(array); }; // `Map.from` method @@ -11482,13 +11810,13 @@ var doric = (function (exports) { }); var min$9 = Math.min; - var max$4 = Math.max; + var max$5 = Math.max; // `Math.clamp` method // https://rwaldron.github.io/proposal-math-extensions/ _export({ target: 'Math', stat: true }, { clamp: function clamp(x, lower, upper) { - return min$9(upper, max$4(lower, x)); + return min$9(upper, max$5(lower, x)); } }); @@ -11513,13 +11841,13 @@ var doric = (function (exports) { var mathScale = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { if ( arguments.length === 0 - /* eslint-disable no-self-compare */ + /* eslint-disable no-self-compare -- NaN check */ || x != x || inLow != inLow || inHigh != inHigh || outLow != outLow || outHigh != outHigh - /* eslint-enable no-self-compare */ + /* eslint-enable no-self-compare -- NaN check */ ) { return NaN; } if (x === Infinity || x === -Infinity) { return x; } return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; @@ -11589,13 +11917,128 @@ var doric = (function (exports) { } }); - var OBJECT_ITERATOR = 'Object Iterator'; + var INCORRECT_RANGE = 'Incorrect Number.range arguments'; + var RANGE_ITERATOR = 'RangeIterator'; + var setInternalState$b = internalState.set; - var getInternalState$7 = internalState.getterFor(OBJECT_ITERATOR); + var getInternalState$7 = internalState.getterFor(RANGE_ITERATOR); + + var $RangeIterator = createIteratorConstructor(function RangeIterator(start, end, option, type, zero, one) { + if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) { + throw new TypeError(INCORRECT_RANGE); + } + if (start === Infinity || start === -Infinity) { + throw new RangeError(INCORRECT_RANGE); + } + var ifIncrease = end > start; + var inclusiveEnd = false; + var step; + if (option === undefined) { + step = undefined; + } else if (isObject(option)) { + step = option.step; + inclusiveEnd = !!option.inclusive; + } else if (typeof option == type) { + step = option; + } else { + throw new TypeError(INCORRECT_RANGE); + } + if (step == null) { + step = ifIncrease ? one : -one; + } + if (typeof step != type) { + throw new TypeError(INCORRECT_RANGE); + } + if (step === Infinity || step === -Infinity || (step === zero && start !== end)) { + throw new RangeError(INCORRECT_RANGE); + } + // eslint-disable-next-line no-self-compare -- NaN check + var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero); + setInternalState$b(this, { + type: RANGE_ITERATOR, + start: start, + end: end, + step: step, + inclusiveEnd: inclusiveEnd, + hitsEnd: hitsEnd, + currentCount: zero, + zero: zero + }); + if (!descriptors) { + this.start = start; + this.end = end; + this.step = step; + this.inclusive = inclusiveEnd; + } + }, RANGE_ITERATOR, function next() { + var state = getInternalState$7(this); + if (state.hitsEnd) { return { value: undefined, done: true }; } + var start = state.start; + var end = state.end; + var step = state.step; + var currentYieldingValue = start + (step * state.currentCount++); + if (currentYieldingValue === end) { state.hitsEnd = true; } + var inclusiveEnd = state.inclusiveEnd; + var endCondition; + if (end > start) { + endCondition = inclusiveEnd ? currentYieldingValue > end : currentYieldingValue >= end; + } else { + endCondition = inclusiveEnd ? end > currentYieldingValue : end >= currentYieldingValue; + } + if (endCondition) { + return { value: undefined, done: state.hitsEnd = true }; + } return { value: currentYieldingValue, done: false }; + }); + + var getter = function (fn) { + return { get: fn, set: function () { /* empty */ }, configurable: true, enumerable: false }; + }; + + if (descriptors) { + objectDefineProperties($RangeIterator.prototype, { + start: getter(function () { + return getInternalState$7(this).start; + }), + end: getter(function () { + return getInternalState$7(this).end; + }), + inclusive: getter(function () { + return getInternalState$7(this).inclusiveEnd; + }), + step: getter(function () { + return getInternalState$7(this).step; + }) + }); + } + + var rangeIterator = $RangeIterator; + + // `BigInt.range` method + // https://github.com/tc39/proposal-Number.range + if (typeof BigInt == 'function') { + _export({ target: 'BigInt', stat: true }, { + range: function range(start, end, option) { + /* global BigInt -- safe */ + return new rangeIterator(start, end, option, 'bigint', BigInt(0), BigInt(1)); + } + }); + } + + // `Number.range` method + // https://github.com/tc39/proposal-Number.range + _export({ target: 'Number', stat: true }, { + range: function range(start, end, option) { + return new rangeIterator(start, end, option, 'number', 0, 1); + } + }); + + var OBJECT_ITERATOR = 'Object Iterator'; + var setInternalState$c = internalState.set; + var getInternalState$8 = internalState.getterFor(OBJECT_ITERATOR); var objectIterator = createIteratorConstructor(function ObjectIterator(source, mode) { var object = toObject(source); - setInternalState$b(this, { + setInternalState$c(this, { type: OBJECT_ITERATOR, mode: mode, object: object, @@ -11603,7 +12046,7 @@ var doric = (function (exports) { index: 0 }); }, 'Object', function next() { - var state = getInternalState$7(this); + var state = getInternalState$8(this); var keys = state.keys; while (true) { if (keys === null || state.index >= keys.length) { @@ -11652,7 +12095,7 @@ var doric = (function (exports) { - var defineProperty$e = objectDefineProperty.f; + var defineProperty$d = objectDefineProperty.f; @@ -11662,8 +12105,8 @@ var doric = (function (exports) { var OBSERVABLE = wellKnownSymbol('observable'); - var getInternalState$8 = internalState.get; - var setInternalState$c = internalState.set; + var getInternalState$9 = internalState.get; + var setInternalState$d = internalState.set; var getMethod = function (fn) { return fn == null ? undefined : aFunction$1(fn); @@ -11694,7 +12137,7 @@ var doric = (function (exports) { }; var Subscription = function (observer, subscriber) { - var subscriptionState = setInternalState$c(this, { + var subscriptionState = setInternalState$d(this, { cleanup: undefined, observer: anObject(observer), subscriptionObserver: undefined @@ -11722,7 +12165,7 @@ var doric = (function (exports) { Subscription.prototype = redefineAll({}, { unsubscribe: function unsubscribe() { - var subscriptionState = getInternalState$8(this); + var subscriptionState = getInternalState$9(this); if (!subscriptionClosed(subscriptionState)) { close(this, subscriptionState); cleanupSubscription(subscriptionState); @@ -11730,21 +12173,21 @@ var doric = (function (exports) { } }); - if (descriptors) { defineProperty$e(Subscription.prototype, 'closed', { + if (descriptors) { defineProperty$d(Subscription.prototype, 'closed', { configurable: true, get: function () { - return subscriptionClosed(getInternalState$8(this)); + return subscriptionClosed(getInternalState$9(this)); } }); } var SubscriptionObserver = function (subscription) { - setInternalState$c(this, { subscription: subscription }); + setInternalState$d(this, { subscription: subscription }); if (!descriptors) { this.closed = false; } }; SubscriptionObserver.prototype = redefineAll({}, { next: function next(value) { - var subscriptionState = getInternalState$8(getInternalState$8(this).subscription); + var subscriptionState = getInternalState$9(getInternalState$9(this).subscription); if (!subscriptionClosed(subscriptionState)) { var observer = subscriptionState.observer; try { @@ -11756,8 +12199,8 @@ var doric = (function (exports) { } }, error: function error(value) { - var subscription = getInternalState$8(this).subscription; - var subscriptionState = getInternalState$8(subscription); + var subscription = getInternalState$9(this).subscription; + var subscriptionState = getInternalState$9(subscription); if (!subscriptionClosed(subscriptionState)) { var observer = subscriptionState.observer; close(subscription, subscriptionState); @@ -11771,8 +12214,8 @@ var doric = (function (exports) { } }, complete: function complete() { - var subscription = getInternalState$8(this).subscription; - var subscriptionState = getInternalState$8(subscription); + var subscription = getInternalState$9(this).subscription; + var subscriptionState = getInternalState$9(subscription); if (!subscriptionClosed(subscriptionState)) { var observer = subscriptionState.observer; close(subscription, subscriptionState); @@ -11786,16 +12229,16 @@ var doric = (function (exports) { } }); - if (descriptors) { defineProperty$e(SubscriptionObserver.prototype, 'closed', { + if (descriptors) { defineProperty$d(SubscriptionObserver.prototype, 'closed', { configurable: true, get: function () { - return subscriptionClosed(getInternalState$8(getInternalState$8(this).subscription)); + return subscriptionClosed(getInternalState$9(getInternalState$9(this).subscription)); } }); } var $Observable = function Observable(subscriber) { anInstance(this, $Observable, 'Observable'); - setInternalState$c(this, { subscriber: aFunction$1(subscriber) }); + setInternalState$d(this, { subscriber: aFunction$1(subscriber) }); }; redefineAll($Observable.prototype, { @@ -11805,7 +12248,7 @@ var doric = (function (exports) { next: observer, error: length > 1 ? arguments[1] : undefined, complete: length > 2 ? arguments[2] : undefined - } : isObject(observer) ? observer : {}, getInternalState$8(this).subscriber); + } : isObject(observer) ? observer : {}, getInternalState$9(this).subscriber); } }); @@ -11821,10 +12264,10 @@ var doric = (function (exports) { } var iterator = getIterator(x); return new C(function (observer) { - iterate_1(iterator, function (it) { + iterate(iterator, function (it, stop) { observer.next(it); - if (observer.closed) { return iterate_1.stop(); } - }, undefined, false, true); + if (observer.closed) { return stop(); } + }, { IS_ITERATOR: true, INTERRUPTED: true }); observer.complete(); }); }, @@ -11874,17 +12317,17 @@ var doric = (function (exports) { var SEEDED_RANDOM = 'Seeded Random'; var SEEDED_RANDOM_GENERATOR = SEEDED_RANDOM + ' Generator'; - var setInternalState$d = internalState.set; - var getInternalState$9 = internalState.getterFor(SEEDED_RANDOM_GENERATOR); + var setInternalState$e = internalState.set; + var getInternalState$a = internalState.getterFor(SEEDED_RANDOM_GENERATOR); var SEED_TYPE_ERROR = 'Math.seededPRNG() argument should have a "seed" field with a finite value.'; var $SeededRandomGenerator = createIteratorConstructor(function SeededRandomGenerator(seed) { - setInternalState$d(this, { + setInternalState$e(this, { type: SEEDED_RANDOM_GENERATOR, seed: seed % 2147483647 }); }, SEEDED_RANDOM, function next() { - var state = getInternalState$9(this); + var state = getInternalState$a(this); var seed = state.seed = (state.seed * 1103515245 + 12345) % 2147483647; return { value: (seed & 1073741823) / 1073741823, done: false }; }); @@ -11903,18 +12346,18 @@ var doric = (function (exports) { var codeAt$2 = stringMultibyte.codeAt; var charAt$3 = stringMultibyte.charAt; var STRING_ITERATOR$1 = 'String Iterator'; - var setInternalState$e = internalState.set; - var getInternalState$a = internalState.getterFor(STRING_ITERATOR$1); + var setInternalState$f = internalState.set; + var getInternalState$b = internalState.getterFor(STRING_ITERATOR$1); // TODO: unify with String#@@iterator var $StringIterator = createIteratorConstructor(function StringIterator(string) { - setInternalState$e(this, { + setInternalState$f(this, { type: STRING_ITERATOR$1, string: string, index: 0 }); }, 'String', function next() { - var state = getInternalState$a(this); + var state = getInternalState$b(this); var string = state.string; var index = state.index; var point; @@ -11971,7 +12414,7 @@ var doric = (function (exports) { AsyncIteratorPrototype = AsyncIterator.prototype; } else if (sharedStore[USE_FUNCTION_CONSTRUCTOR] || global_1[USE_FUNCTION_CONSTRUCTOR]) { try { - // eslint-disable-next-line no-new-func + // eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax prototype = objectGetPrototypeOf(objectGetPrototypeOf(objectGetPrototypeOf(Function('return async function*(){}()')()))); if (objectGetPrototypeOf(prototype) === Object.prototype) { AsyncIteratorPrototype = prototype; } } catch (error) { /* empty */ } @@ -12019,13 +12462,13 @@ var doric = (function (exports) { var Promise$2 = getBuiltIn('Promise'); - var setInternalState$f = internalState.set; - var getInternalState$b = internalState.get; + var setInternalState$g = internalState.set; + var getInternalState$c = internalState.get; var TO_STRING_TAG$5 = wellKnownSymbol('toStringTag'); var $return = function (value) { - var iterator = getInternalState$b(this).iterator; + var iterator = getInternalState$c(this).iterator; var $$return = iterator['return']; return $$return === undefined ? Promise$2.resolve({ done: true, value: value }) @@ -12033,7 +12476,7 @@ var doric = (function (exports) { }; var $throw = function (value) { - var iterator = getInternalState$b(this).iterator; + var iterator = getInternalState$c(this).iterator; var $$throw = iterator['throw']; return $$throw === undefined ? Promise$2.reject(value) @@ -12044,12 +12487,12 @@ var doric = (function (exports) { var AsyncIteratorProxy = function AsyncIterator(state) { state.next = aFunction$1(state.iterator.next); state.done = false; - setInternalState$f(this, state); + setInternalState$g(this, state); }; AsyncIteratorProxy.prototype = redefineAll(objectCreate(path.AsyncIterator.prototype), { next: function next(arg) { - var state = getInternalState$b(this); + var state = getInternalState$c(this); if (state.done) { return Promise$2.resolve({ done: true, value: undefined }); } try { return Promise$2.resolve(anObject(nextHandler.call(state, arg, Promise$2))); @@ -12142,9 +12585,9 @@ var doric = (function (exports) { var Promise$3 = getBuiltIn('Promise'); - var push$1 = [].push; + var push$2 = [].push; - var createMethod$7 = function (TYPE) { + var createMethod$8 = function (TYPE) { var IS_TO_ARRAY = TYPE == 0; var IS_FOR_EACH = TYPE == 1; var IS_EVERY = TYPE == 2; @@ -12156,6 +12599,25 @@ var doric = (function (exports) { if (!IS_TO_ARRAY) { aFunction$1(fn); } return new Promise$3(function (resolve, reject) { + var closeIteration = function (method, argument) { + try { + var returnMethod = iterator['return']; + if (returnMethod !== undefined) { + return Promise$3.resolve(returnMethod.call(iterator)).then(function () { + method(argument); + }, function (error) { + reject(error); + }); + } + } catch (error2) { + return reject(error2); + } method(argument); + }; + + var onError = function (error) { + closeIteration(reject, error); + }; + var loop = function () { try { Promise$3.resolve(anObject(next.call(iterator))).then(function (step) { @@ -12165,23 +12627,23 @@ var doric = (function (exports) { } else { var value = step.value; if (IS_TO_ARRAY) { - push$1.call(array, value); + push$2.call(array, value); loop(); } else { Promise$3.resolve(fn(value)).then(function (result) { if (IS_FOR_EACH) { loop(); } else if (IS_EVERY) { - result ? loop() : resolve(false); + result ? loop() : closeIteration(resolve, false); } else { - result ? resolve(IS_SOME || value) : loop(); + result ? closeIteration(resolve, IS_SOME || value) : loop(); } - }, reject); + }, onError); } } - } catch (err) { reject(err); } - }, reject); - } catch (error) { reject(error); } + } catch (error) { onError(error); } + }, onError); + } catch (error2) { onError(error2); } }; loop(); @@ -12190,11 +12652,11 @@ var doric = (function (exports) { }; var asyncIteratorIteration = { - toArray: createMethod$7(0), - forEach: createMethod$7(1), - every: createMethod$7(2), - some: createMethod$7(3), - find: createMethod$7(4) + toArray: createMethod$8(0), + forEach: createMethod$8(1), + every: createMethod$8(2), + some: createMethod$8(3), + find: createMethod$8(4) }; // https://github.com/tc39/proposal-iterator-helpers @@ -12466,11 +12928,20 @@ var doric = (function (exports) { - var AsyncIteratorProxy$6 = asyncIteratorCreateProxy(function (arg) { + var AsyncIteratorProxy$6 = asyncIteratorCreateProxy(function (arg, Promise) { + var iterator = this.iterator; + var returnMethod, result; if (!this.remaining--) { + result = { done: true, value: undefined }; this.done = true; - return { done: true, value: undefined }; - } return this.next.call(this.iterator, arg); + returnMethod = iterator['return']; + if (returnMethod !== undefined) { + return Promise.resolve(returnMethod.call(iterator)).then(function () { + return result; + }); + } + return result; + } return this.next.call(iterator, arg); }); _export({ target: 'AsyncIterator', proto: true, real: true }, { @@ -12503,13 +12974,13 @@ var doric = (function (exports) { var IteratorPrototype$3 = iteratorsCore.IteratorPrototype; - var ITERATOR$8 = wellKnownSymbol('iterator'); + wellKnownSymbol('iterator'); var TO_STRING_TAG$6 = wellKnownSymbol('toStringTag'); var NativeIterator = global_1.Iterator; // FF56- have non-standard global helper `Iterator` - var FORCED$l = typeof NativeIterator != 'function' + var FORCED$m = typeof NativeIterator != 'function' || NativeIterator.prototype !== IteratorPrototype$3 // FF44- non-standard `Iterator` passes previous tests || !fails(function () { NativeIterator({}); }); @@ -12522,29 +12993,29 @@ var doric = (function (exports) { createNonEnumerableProperty(IteratorPrototype$3, TO_STRING_TAG$6, 'Iterator'); } - if (FORCED$l || !has(IteratorPrototype$3, 'constructor') || IteratorPrototype$3.constructor === Object) { + if (FORCED$m || !has(IteratorPrototype$3, 'constructor') || IteratorPrototype$3.constructor === Object) { createNonEnumerableProperty(IteratorPrototype$3, 'constructor', IteratorConstructor); } IteratorConstructor.prototype = IteratorPrototype$3; - _export({ global: true, forced: FORCED$l }, { + _export({ global: true, forced: FORCED$m }, { Iterator: IteratorConstructor }); - var setInternalState$g = internalState.set; - var getInternalState$c = internalState.get; + var setInternalState$h = internalState.set; + var getInternalState$d = internalState.get; var TO_STRING_TAG$7 = wellKnownSymbol('toStringTag'); var $return$1 = function (value) { - var iterator = getInternalState$c(this).iterator; + var iterator = getInternalState$d(this).iterator; var $$return = iterator['return']; return $$return === undefined ? { done: true, value: value } : anObject($$return.call(iterator, value)); }; var $throw$1 = function (value) { - var iterator = getInternalState$c(this).iterator; + var iterator = getInternalState$d(this).iterator; var $$throw = iterator['throw']; if ($$throw === undefined) { throw value; } return $$throw.call(iterator, value); @@ -12554,12 +13025,12 @@ var doric = (function (exports) { var IteratorProxy = function Iterator(state) { state.next = aFunction$1(state.iterator.next); state.done = false; - setInternalState$g(this, state); + setInternalState$h(this, state); }; IteratorProxy.prototype = redefineAll(objectCreate(path.Iterator.prototype), { next: function next() { - var state = getInternalState$c(this); + var state = getInternalState$d(this); var result = state.done ? undefined : nextHandler.apply(state, arguments); return { done: state.done, value: result }; }, @@ -12634,9 +13105,9 @@ var doric = (function (exports) { every: function every(fn) { anObject(this); aFunction$1(fn); - return !iterate_1(this, function (value) { - if (!fn(value)) { return iterate_1.stop(); } - }, undefined, false, true).stopped; + return !iterate(this, function (value, stop) { + if (!fn(value)) { return stop(); } + }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); @@ -12680,9 +13151,9 @@ var doric = (function (exports) { find: function find(fn) { anObject(this); aFunction$1(fn); - return iterate_1(this, function (value) { - if (fn(value)) { return iterate_1.stop(value); } - }, undefined, false, true).result; + return iterate(this, function (value, stop) { + if (fn(value)) { return stop(value); } + }, { IS_ITERATOR: true, INTERRUPTED: true }).result; } }); @@ -12696,28 +13167,34 @@ var doric = (function (exports) { var IteratorProxy$3 = iteratorCreateProxy(function (arg) { var iterator = this.iterator; + var mapper = this.mapper; var result, mapped, iteratorMethod, innerIterator; while (true) { - if (innerIterator = this.innerIterator) { - result = anObject(this.innerNext.call(innerIterator)); - if (!result.done) { return result.value; } - this.innerIterator = this.innerNext = null; + try { + if (innerIterator = this.innerIterator) { + result = anObject(this.innerNext.call(innerIterator)); + if (!result.done) { return result.value; } + this.innerIterator = this.innerNext = null; + } + + result = anObject(this.next.call(iterator, arg)); + + if (this.done = !!result.done) { return; } + + mapped = mapper(result.value); + iteratorMethod = getIteratorMethod(mapped); + + if (iteratorMethod === undefined) { + throw TypeError('.flatMap callback should return an iterable object'); + } + + this.innerIterator = innerIterator = anObject(iteratorMethod.call(mapped)); + this.innerNext = aFunction$1(innerIterator.next); + } catch (error) { + iteratorClose(iterator); + throw error; } - - result = anObject(this.next.call(iterator, arg)); - - if (this.done = !!result.done) { return; } - - mapped = callWithSafeIterationClosing(iterator, this.mapper, result.value); - iteratorMethod = getIteratorMethod(mapped); - - if (iteratorMethod === undefined) { - throw TypeError('.flatMap callback should return an iterable object'); - } - - this.innerIterator = innerIterator = anObject(iteratorMethod.call(mapped)); - this.innerNext = aFunction$1(innerIterator.next); } }); @@ -12739,7 +13216,7 @@ var doric = (function (exports) { _export({ target: 'Iterator', proto: true, real: true }, { forEach: function forEach(fn) { - iterate_1(anObject(this), fn, undefined, false, true); + iterate(anObject(this), fn, { IS_ITERATOR: true }); } }); @@ -12811,14 +13288,14 @@ var doric = (function (exports) { aFunction$1(reducer); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; - iterate_1(this, function (value) { + iterate(this, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = reducer(accumulator, value); } - }, undefined, false, true); + }, { IS_ITERATOR: true }); if (noInitial) { throw TypeError('Reduce of empty iterator with no initial value'); } return accumulator; } @@ -12834,9 +13311,9 @@ var doric = (function (exports) { some: function some(fn) { anObject(this); aFunction$1(fn); - return iterate_1(this, function (value) { - if (fn(value)) { return iterate_1.stop(); } - }, undefined, false, true).stopped; + return iterate(this, function (value, stop) { + if (fn(value)) { return stop(); } + }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); @@ -12846,12 +13323,14 @@ var doric = (function (exports) { + var IteratorProxy$6 = iteratorCreateProxy(function (arg) { + var iterator = this.iterator; if (!this.remaining--) { this.done = true; - return; + return iteratorClose(iterator); } - var result = anObject(this.next.call(this.iterator, arg)); + var result = anObject(this.next.call(iterator, arg)); var done = this.done = !!result.done; if (!done) { return result.value; } }); @@ -12870,16 +13349,33 @@ var doric = (function (exports) { - var push$2 = [].push; + var push$3 = [].push; _export({ target: 'Iterator', proto: true, real: true }, { toArray: function toArray() { var result = []; - iterate_1(anObject(this), push$2, result, false, true); + iterate(anObject(this), push$3, { that: result, IS_ITERATOR: true }); return result; } }); + // `Map.prototype.emplace` method + // https://github.com/thumbsupep/proposal-upsert + var mapEmplace = function emplace(key, handler) { + var map = anObject(this); + var value = (map.has(key) && 'update' in handler) + ? handler.update(map.get(key), key, map) + : handler.insert(key, map); + map.set(key, value); + return value; + }; + + // `Map.prototype.emplace` method + // https://github.com/thumbsupep/proposal-upsert + _export({ target: 'Map', proto: true, real: true, forced: isPure }, { + emplace: mapEmplace + }); + // `Map.prototype.upsert` method // https://github.com/thumbsupep/proposal-upsert var mapUpsert = function upsert(key, updateFn /* , insertFn */) { @@ -12906,20 +13402,36 @@ var doric = (function (exports) { - // `Map.prototype.updateOrInsert` method (replaced by `Map.prototype.upsert`) + // `Map.prototype.updateOrInsert` method (replaced by `Map.prototype.emplace`) // https://github.com/thumbsupep/proposal-upsert _export({ target: 'Map', proto: true, real: true, forced: isPure }, { updateOrInsert: mapUpsert }); - // `Map.prototype.upsert` method + // TODO: remove from `core-js@4` + + + + + // `Map.prototype.upsert` method (replaced by `Map.prototype.emplace`) // https://github.com/thumbsupep/proposal-upsert _export({ target: 'Map', proto: true, real: true, forced: isPure }, { upsert: mapUpsert }); - // `WeakMap.prototype.upsert` method - // https://github.com/thumbsupep/proposal-upsert + // `WeakMap.prototype.emplace` method + // https://github.com/tc39/proposal-upsert + _export({ target: 'WeakMap', proto: true, real: true, forced: isPure }, { + emplace: mapEmplace + }); + + // TODO: remove from `core-js@4` + + + + + // `WeakMap.prototype.upsert` method (replaced by `WeakMap.prototype.emplace`) + // https://github.com/tc39/proposal-upsert _export({ target: 'WeakMap', proto: true, real: true, forced: isPure }, { upsert: mapUpsert }); @@ -12931,7 +13443,7 @@ var doric = (function (exports) { var set = anObject(this); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); var remover = aFunction$1(newSet['delete']); - iterate_1(iterable, function (value) { + iterate(iterable, function (value) { remover.call(newSet, value); }); return newSet; @@ -12946,7 +13458,7 @@ var doric = (function (exports) { var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(); var hasCheck = aFunction$1(set.has); var adder = aFunction$1(newSet.add); - iterate_1(iterable, function (value) { + iterate(iterable, function (value) { if (hasCheck.call(set, value)) { adder.call(newSet, value); } }); return newSet; @@ -12959,9 +13471,9 @@ var doric = (function (exports) { isDisjointFrom: function isDisjointFrom(iterable) { var set = anObject(this); var hasCheck = aFunction$1(set.has); - return !iterate_1(iterable, function (value) { - if (hasCheck.call(set, value) === true) { return iterate_1.stop(); } - }).stopped; + return !iterate(iterable, function (value, stop) { + if (hasCheck.call(set, value) === true) { return stop(); } + }, { INTERRUPTED: true }).stopped; } }); @@ -12976,9 +13488,9 @@ var doric = (function (exports) { otherSet = new (getBuiltIn('Set'))(iterable); hasCheck = aFunction$1(otherSet.has); } - return !iterate_1(iterator, function (value) { - if (hasCheck.call(otherSet, value) === false) { return iterate_1.stop(); } - }, undefined, false, true).stopped; + return !iterate(iterator, function (value, stop) { + if (hasCheck.call(otherSet, value) === false) { return stop(); } + }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); @@ -12988,9 +13500,9 @@ var doric = (function (exports) { isSupersetOf: function isSupersetOf(iterable) { var set = anObject(this); var hasCheck = aFunction$1(set.has); - return !iterate_1(iterable, function (value) { - if (hasCheck.call(set, value) === false) { return iterate_1.stop(); } - }).stopped; + return !iterate(iterable, function (value, stop) { + if (hasCheck.call(set, value) === false) { return stop(); } + }, { INTERRUPTED: true }).stopped; } }); @@ -13000,7 +13512,7 @@ var doric = (function (exports) { union: function union(iterable) { var set = anObject(this); var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); - iterate_1(iterable, aFunction$1(newSet.add), newSet); + iterate(iterable, aFunction$1(newSet.add), { that: newSet }); return newSet; } }); @@ -13013,7 +13525,7 @@ var doric = (function (exports) { var newSet = new (speciesConstructor(set, getBuiltIn('Set')))(set); var remover = aFunction$1(newSet['delete']); var adder = aFunction$1(newSet.add); - iterate_1(iterable, function (value) { + iterate(iterable, function (value) { remover.call(newSet, value) || adder.call(newSet, value); }); return newSet; @@ -13028,118 +13540,31 @@ var doric = (function (exports) { // https://github.com/tc39/proposal-using-statement defineWellKnownSymbol('dispose'); - var setInternalState$h = internalState.set; - var getInternalAggregateErrorState = internalState.getterFor('AggregateError'); - - var $AggregateError = function AggregateError(errors, message) { - var that = this; - if (!(that instanceof $AggregateError)) { return new $AggregateError(errors, message); } - if (objectSetPrototypeOf) { - that = objectSetPrototypeOf(new Error(message), objectGetPrototypeOf(that)); - } - var errorsArray = []; - iterate_1(errors, errorsArray.push, errorsArray); - if (descriptors) { setInternalState$h(that, { errors: errorsArray, type: 'AggregateError' }); } - else { that.errors = errorsArray; } - if (message !== undefined) { createNonEnumerableProperty(that, 'message', String(message)); } - return that; - }; - - $AggregateError.prototype = objectCreate(Error.prototype, { - constructor: createPropertyDescriptor(5, $AggregateError), - message: createPropertyDescriptor(5, ''), - name: createPropertyDescriptor(5, 'AggregateError') - }); - - if (descriptors) { objectDefineProperty.f($AggregateError.prototype, 'errors', { - get: function () { - return getInternalAggregateErrorState(this).errors; - }, - configurable: true - }); } - - _export({ global: true }, { - AggregateError: $AggregateError - }); - - var PROMISE_ANY_ERROR = 'No one promise resolved'; - - // `Promise.any` method - // https://github.com/tc39/proposal-promise-any - _export({ target: 'Promise', stat: true }, { - any: function any(iterable) { - var C = this; - var capability = newPromiseCapability.f(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var promiseResolve = aFunction$1(C.resolve); - var errors = []; - var counter = 0; - var remaining = 1; - var alreadyResolved = false; - iterate_1(iterable, function (promise) { - var index = counter++; - var alreadyRejected = false; - errors.push(undefined); - remaining++; - promiseResolve.call(C, promise).then(function (value) { - if (alreadyRejected || alreadyResolved) { return; } - alreadyResolved = true; - resolve(value); - }, function (e) { - if (alreadyRejected || alreadyResolved) { return; } - alreadyRejected = true; - errors[index] = e; - --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR)); - }); - }); - --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR)); - }); - if (result.error) { reject(result.value); } - return capability.promise; + // `Array.prototype.at` method + // https://github.com/tc39/proposal-relative-indexing-method + _export({ target: 'Array', proto: true }, { + at: function at(index) { + var O = toObject(this); + var len = toLength(O.length); + var relativeIndex = toInteger(index); + var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; + return (k < 0 || k >= len) ? undefined : O[k]; } }); - var REPLACE$1 = wellKnownSymbol('replace'); - var RegExpPrototype$4 = RegExp.prototype; + addToUnscopables('at'); - // `String.prototype.replaceAll` method - // https://github.com/tc39/proposal-string-replace-all - _export({ target: 'String', proto: true }, { - replaceAll: function replaceAll(searchValue, replaceValue) { - var O = requireObjectCoercible(this); - var IS_REG_EXP, flags, replacer, string, searchString, template, result, position, index; - if (searchValue != null) { - IS_REG_EXP = isRegexp(searchValue); - if (IS_REG_EXP) { - flags = String(requireObjectCoercible('flags' in RegExpPrototype$4 - ? searchValue.flags - : regexpFlags.call(searchValue) - )); - if (!~flags.indexOf('g')) { throw TypeError('`.replaceAll` does not allow non-global regexes'); } - } - replacer = searchValue[REPLACE$1]; - if (replacer !== undefined) { - return replacer.call(searchValue, O, replaceValue); - } - } - string = String(O); - searchString = String(searchValue); - if (searchString === '') { return replaceAll.call(string, /(?:)/g, replaceValue); } - template = string.split(searchString); - if (typeof replaceValue !== 'function') { - return template.join(String(replaceValue)); - } - result = template[0]; - position = result.length; - for (index = 1; index < template.length; index++) { - result += String(replaceValue(searchString, position, string)); - position += searchString.length + template[index].length; - result += template[index]; - } - return result; - } + var aTypedArray$r = arrayBufferViewCore.aTypedArray; + var exportTypedArrayMethod$s = arrayBufferViewCore.exportTypedArrayMethod; + + // `%TypedArray%.prototype.at` method + // https://github.com/tc39/proposal-relative-indexing-method + exportTypedArrayMethod$s('at', function at(index) { + var O = aTypedArray$r(this); + var len = toLength(O.length); + var relativeIndex = toInteger(index); + var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; + return (k < 0 || k >= len) ? undefined : O[k]; }); // TODO: remove from `core-js@4` @@ -13194,7 +13619,7 @@ var doric = (function (exports) { } } } - var ITERATOR$9 = wellKnownSymbol('iterator'); + var ITERATOR$8 = wellKnownSymbol('iterator'); var TO_STRING_TAG$8 = wellKnownSymbol('toStringTag'); var ArrayValues = es_array_iterator.values; @@ -13203,10 +13628,10 @@ var doric = (function (exports) { var CollectionPrototype$1 = Collection$1 && Collection$1.prototype; if (CollectionPrototype$1) { // some Chrome versions have non-configurable methods on DOMTokenList - if (CollectionPrototype$1[ITERATOR$9] !== ArrayValues) { try { - createNonEnumerableProperty(CollectionPrototype$1, ITERATOR$9, ArrayValues); + if (CollectionPrototype$1[ITERATOR$8] !== ArrayValues) { try { + createNonEnumerableProperty(CollectionPrototype$1, ITERATOR$8, ArrayValues); } catch (error) { - CollectionPrototype$1[ITERATOR$9] = ArrayValues; + CollectionPrototype$1[ITERATOR$8] = ArrayValues; } } if (!CollectionPrototype$1[TO_STRING_TAG$8]) { createNonEnumerableProperty(CollectionPrototype$1, TO_STRING_TAG$8, COLLECTION_NAME$1); @@ -13222,10 +13647,10 @@ var doric = (function (exports) { } } - var FORCED$m = !global_1.setImmediate || !global_1.clearImmediate; + var FORCED$n = !global_1.setImmediate || !global_1.clearImmediate; // http://w3c.github.io/setImmediate/ - _export({ global: true, bind: true, enumerable: true, forced: FORCED$m }, { + _export({ global: true, bind: true, enumerable: true, forced: FORCED$n }, { // `setImmediate` method // http://w3c.github.io/setImmediate/#si-setImmediate setImmediate: task.set, @@ -13235,13 +13660,12 @@ var doric = (function (exports) { }); var process$5 = global_1.process; - var isNode = classofRaw(process$5) == 'process'; // `queueMicrotask` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask _export({ global: true, enumerable: true, noTargetGet: true }, { queueMicrotask: function queueMicrotask(fn) { - var domain = isNode && process$5.domain; + var domain = engineIsNode && process$5.domain; microtask(domain ? domain.bind(fn) : fn); } }); @@ -13254,7 +13678,7 @@ var doric = (function (exports) { var boundArgs = arguments.length > 2; var args = boundArgs ? slice$1.call(arguments, 2) : undefined; return scheduler(boundArgs ? function () { - // eslint-disable-next-line no-new-func + // eslint-disable-next-line no-new-func -- spec requirement (typeof handler == 'function' ? handler : Function(handler)).apply(this, args); } : handler, timeout); }; @@ -13343,6 +13767,8 @@ var doric = (function (exports) { exports.jsRegisterModule = jsRegisterModule; exports.jsReleaseContext = jsReleaseContext; + Object.defineProperty(exports, '__esModule', { value: true }); + return exports; }({})); diff --git a/doric-js/bundle/doric-sandbox.js b/doric-js/bundle/doric-sandbox.js index 182a9265..11175290 100644 --- a/doric-js/bundle/doric-sandbox.js +++ b/doric-js/bundle/doric-sandbox.js @@ -1535,6 +1535,8 @@ var doric = (function (exports) { exports.jsRegisterModule = jsRegisterModule; exports.jsReleaseContext = jsReleaseContext; + Object.defineProperty(exports, '__esModule', { value: true }); + return exports; }({})); diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index 8b9ea3d1..ccf7cd65 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -3,6 +3,14 @@ Object.defineProperty(exports, '__esModule', { value: true }); var WebSocket = require('ws'); +var fs = require('fs'); +var path = require('path'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var WebSocket__default = /*#__PURE__*/_interopDefaultLegacy(WebSocket); +var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs); +var path__default = /*#__PURE__*/_interopDefaultLegacy(path); /* * Copyright [2019] [Doric.Pub] @@ -2050,6 +2058,7 @@ function gravity() { return new Gravity; } +exports.LayoutSpec = void 0; (function (LayoutSpec) { /** * Depends on what's been set on width or height. @@ -2470,10 +2479,12 @@ __decorate$2([ * See the License for the specific language governing permissions and * limitations under the License. */ +exports.RepeatMode = void 0; (function (RepeatMode) { RepeatMode[RepeatMode["RESTART"] = 1] = "RESTART"; RepeatMode[RepeatMode["REVERSE"] = 2] = "REVERSE"; })(exports.RepeatMode || (exports.RepeatMode = {})); +exports.FillMode = void 0; (function (FillMode) { /** * The receiver is removed from the presentation when the animation is completed. @@ -2492,6 +2503,7 @@ __decorate$2([ */ FillMode[FillMode["Both"] = 3] = "Both"; })(exports.FillMode || (exports.FillMode = {})); +exports.TimingFunction = void 0; (function (TimingFunction) { /** * The system default timing function. Use this function to ensure that the timing of your animations matches that of most system animations. @@ -2771,6 +2783,7 @@ Color.YELLOW = new Color(0xFFFFFF00); Color.CYAN = new Color(0xFF00FFFF); Color.MAGENTA = new Color(0xFFFF00FF); Color.TRANSPARENT = new Color(0); +exports.GradientOrientation = void 0; (function (GradientOrientation) { /** draw the gradient from the top to the bottom */ GradientOrientation[GradientOrientation["TOP_BOTTOM"] = 0] = "TOP_BOTTOM"; @@ -2799,6 +2812,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, var __metadata$3 = (undefined && undefined.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; +exports.TruncateAt = void 0; (function (TruncateAt) { TruncateAt[TruncateAt["End"] = 0] = "End"; TruncateAt[TruncateAt["Middle"] = 1] = "Middle"; @@ -2881,6 +2895,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, var __metadata$4 = (undefined && undefined.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; +exports.ScaleType = void 0; (function (ScaleType) { ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill"; ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit"; @@ -3338,12 +3353,14 @@ class FlexTypedValue { } } FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto); +exports.FlexDirection = void 0; (function (FlexDirection) { FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN"; FlexDirection[FlexDirection["COLUMN_REVERSE"] = 1] = "COLUMN_REVERSE"; FlexDirection[FlexDirection["ROW"] = 2] = "ROW"; FlexDirection[FlexDirection["ROW_REVERSE"] = 3] = "ROW_REVERSE"; })(exports.FlexDirection || (exports.FlexDirection = {})); +exports.Align = void 0; (function (Align) { Align[Align["AUTO"] = 0] = "AUTO"; Align[Align["FLEX_START"] = 1] = "FLEX_START"; @@ -3354,6 +3371,7 @@ FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto); Align[Align["SPACE_BETWEEN"] = 6] = "SPACE_BETWEEN"; Align[Align["SPACE_AROUND"] = 7] = "SPACE_AROUND"; })(exports.Align || (exports.Align = {})); +exports.Justify = void 0; (function (Justify) { Justify[Justify["FLEX_START"] = 0] = "FLEX_START"; Justify[Justify["CENTER"] = 1] = "CENTER"; @@ -3362,25 +3380,30 @@ FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto); Justify[Justify["SPACE_AROUND"] = 4] = "SPACE_AROUND"; Justify[Justify["SPACE_EVENLY"] = 5] = "SPACE_EVENLY"; })(exports.Justify || (exports.Justify = {})); +exports.Direction = void 0; (function (Direction) { Direction[Direction["INHERIT"] = 0] = "INHERIT"; Direction[Direction["LTR"] = 1] = "LTR"; Direction[Direction["RTL"] = 2] = "RTL"; })(exports.Direction || (exports.Direction = {})); +exports.PositionType = void 0; (function (PositionType) { PositionType[PositionType["RELATIVE"] = 0] = "RELATIVE"; PositionType[PositionType["ABSOLUTE"] = 1] = "ABSOLUTE"; })(exports.PositionType || (exports.PositionType = {})); +exports.Wrap = void 0; (function (Wrap) { Wrap[Wrap["NO_WRAP"] = 0] = "NO_WRAP"; Wrap[Wrap["WRAP"] = 1] = "WRAP"; Wrap[Wrap["WRAP_REVERSE"] = 2] = "WRAP_REVERSE"; })(exports.Wrap || (exports.Wrap = {})); +exports.OverFlow = void 0; (function (OverFlow) { OverFlow[OverFlow["VISIBLE"] = 0] = "VISIBLE"; OverFlow[OverFlow["HIDDEN"] = 1] = "HIDDEN"; OverFlow[OverFlow["SCROLL"] = 2] = "SCROLL"; })(exports.OverFlow || (exports.OverFlow = {})); +exports.Display = void 0; (function (Display) { Display[Display["FLEX"] = 0] = "FLEX"; Display[Display["NONE"] = 1] = "NONE"; @@ -3594,6 +3617,7 @@ __decorate$a([ Property, __metadata$a("design:type", Boolean) ], Input.prototype, "password", void 0); +exports.InputType = void 0; (function (InputType) { InputType[InputType["Default"] = 0] = "Default"; InputType[InputType["Number"] = 1] = "Number"; @@ -4049,6 +4073,7 @@ function notification(context) { }; } +exports.StatusBarMode = void 0; (function (StatusBarMode) { StatusBarMode[StatusBarMode["LIGHT"] = 0] = "LIGHT"; StatusBarMode[StatusBarMode["DARK"] = 1] = "DARK"; @@ -4208,10 +4233,8 @@ class VMPanel extends Panel { * See the License for the specific language governing permissions and * limitations under the License. */ -const WebSocketClient = require('ws'); -const fs = require('fs'); -let context = process.cwd() + '/build/context'; -const contextId = fs.readFileSync(context, { encoding: 'utf8' }); +const contextFile = path__default['default'].resolve(process.cwd(), 'build', 'context'); +const contextId = fs__default['default'].readFileSync(contextFile, { encoding: 'utf8' }); console.log("debugging context id: " + contextId); let global$2 = new Function('return this')(); global$2.setTimeout = global$2.doricSetTimeout; @@ -4221,19 +4244,8 @@ global$2.clearInterval = global$2.doricClearInterval; global$2.doric = doric; global$2.context = jsObtainContext(contextId); global$2.Entry = jsObtainEntry(contextId); -// dev kit client -const devClient = new WebSocketClient('ws://localhost:7777'); -devClient.on('open', function open() { - console.log('dev kit connected on 7777'); -}); -devClient.on('message', function incoming(data) { - console.log(data); -}); -devClient.on('error', function incoming(error) { - console.log(error); -}); // debug server -const debugServer = new WebSocket.Server({ port: 2080 }); +const debugServer = new WebSocket__default['default'].Server({ port: 2080 }); debugServer.on('connection', function connection(ws) { console.log('connected'); ws.on('message', function incoming(message) { @@ -4327,6 +4339,22 @@ global$2.sendToNative = () => { }; global$2.receiveFromNative = () => { }; +global$2.nativeLog = (type, msg) => { + switch (type) { + case "w": { + console.warn(msg); + break; + } + case "e": { + console.error(msg); + break; + } + default: { + console.log(msg); + break; + } + } +}; exports.AnimationSet = AnimationSet; exports.BOTTOM = BOTTOM; diff --git a/doric-js/index.debug.ts b/doric-js/index.debug.ts index 261e48a9..18711f38 100644 --- a/doric-js/index.debug.ts +++ b/doric-js/index.debug.ts @@ -14,12 +14,11 @@ * limitations under the License. */ import * as doric from './src/runtime/sandbox' -import * as WebSocket from 'ws' - -const WebSocketClient = require('ws') -const fs = require('fs') -let context = process.cwd() + '/build/context' -const contextId = fs.readFileSync(context, { encoding: 'utf8' }) +import WebSocket from "ws" +import fs from "fs" +import path from 'path' +const contextFile = path.resolve(process.cwd(), 'build', 'context'); +const contextId = fs.readFileSync(contextFile, { encoding: 'utf8' }) console.log("debugging context id: " + contextId) let global = new Function('return this')() @@ -32,18 +31,6 @@ global.doric = doric global.context = doric.jsObtainContext(contextId) global.Entry = doric.jsObtainEntry(contextId) -// dev kit client -const devClient = new WebSocketClient('ws://localhost:7777') -devClient.on('open', function open() { - console.log('dev kit connected on 7777') -}) -devClient.on('message', function incoming(data: any) { - console.log(data) -}) -devClient.on('error', function incoming(error: any) { - console.log(error) -}) - // debug server const debugServer = new WebSocket.Server({ port: 2080 }) debugServer.on('connection', function connection(ws) { @@ -137,5 +124,21 @@ global.sendToNative = () => { global.receiveFromNative = () => { } +global.nativeLog = (type: string, msg: string) => { + switch (type) { + case "w": { + console.warn(msg); + break; + } + case "e": { + console.error(msg); + break; + } + default: { + console.log(msg); + break; + } + } +} export * from './index' \ No newline at end of file diff --git a/doric-js/lib/index.debug.js b/doric-js/lib/index.debug.js index 567f0700..1199d84a 100644 --- a/doric-js/lib/index.debug.js +++ b/doric-js/lib/index.debug.js @@ -14,11 +14,11 @@ * limitations under the License. */ import * as doric from './src/runtime/sandbox'; -import * as WebSocket from 'ws'; -const WebSocketClient = require('ws'); -const fs = require('fs'); -let context = process.cwd() + '/build/context'; -const contextId = fs.readFileSync(context, { encoding: 'utf8' }); +import WebSocket from "ws"; +import fs from "fs"; +import path from 'path'; +const contextFile = path.resolve(process.cwd(), 'build', 'context'); +const contextId = fs.readFileSync(contextFile, { encoding: 'utf8' }); console.log("debugging context id: " + contextId); let global = new Function('return this')(); global.setTimeout = global.doricSetTimeout; @@ -28,17 +28,6 @@ global.clearInterval = global.doricClearInterval; global.doric = doric; global.context = doric.jsObtainContext(contextId); global.Entry = doric.jsObtainEntry(contextId); -// dev kit client -const devClient = new WebSocketClient('ws://localhost:7777'); -devClient.on('open', function open() { - console.log('dev kit connected on 7777'); -}); -devClient.on('message', function incoming(data) { - console.log(data); -}); -devClient.on('error', function incoming(error) { - console.log(error); -}); // debug server const debugServer = new WebSocket.Server({ port: 2080 }); debugServer.on('connection', function connection(ws) { @@ -134,4 +123,20 @@ global.sendToNative = () => { }; global.receiveFromNative = () => { }; +global.nativeLog = (type, msg) => { + switch (type) { + case "w": { + console.warn(msg); + break; + } + case "e": { + console.error(msg); + break; + } + default: { + console.log(msg); + break; + } + } +}; export * from './index'; diff --git a/doric-js/package.json b/doric-js/package.json index 076d4eae..e13c4acb 100644 --- a/doric-js/package.json +++ b/doric-js/package.json @@ -24,13 +24,13 @@ "dependencies": { "@types/ws": "^7.2.6", "core-js": "^3.6.5", - "dts-bundle": "^0.7.3", "proxy-polyfill": "^0.3.2", "reflect-metadata": "^0.1.13", "rollup": "^2.23.0", "tslib": "^2.0.0", "typescript": "^3.9.7", - "ws": "^7.3.1" + "ws": "^7.3.1", + "dts-bundle": "^0.7.3" }, "publishConfig": { "registry": "https://registry.npmjs.org"