@mnykj/wangeditoroptimize-list-module 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/css/style.css +0 -0
- package/dist/index.esm.js +3205 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/list-module/src/constants/svg.d.ts +11 -0
- package/dist/list-module/src/index.d.ts +8 -0
- package/dist/list-module/src/locale/en.d.ts +11 -0
- package/dist/list-module/src/locale/index.d.ts +5 -0
- package/dist/list-module/src/locale/zh-CN.d.ts +11 -0
- package/dist/list-module/src/module/custom-types.d.ts +11 -0
- package/dist/list-module/src/module/elem-to-html.d.ts +15 -0
- package/dist/list-module/src/module/index.d.ts +7 -0
- package/dist/list-module/src/module/menu/BaseMenu.d.ts +18 -0
- package/dist/list-module/src/module/menu/BulletedListMenu.d.ts +11 -0
- package/dist/list-module/src/module/menu/NumberedListMenu.d.ts +11 -0
- package/dist/list-module/src/module/menu/index.d.ts +14 -0
- package/dist/list-module/src/module/parse-elem-html.d.ts +19 -0
- package/dist/list-module/src/module/plugin.d.ts +7 -0
- package/dist/list-module/src/module/render-elem.d.ts +13 -0
- package/dist/list-module/src/utils/dom.d.ts +19 -0
- package/dist/list-module/src/utils/maps.d.ts +6 -0
- package/package.json +49 -0
|
@@ -0,0 +1,3205 @@
|
|
|
1
|
+
import { i18nAddResources, DomEditor, t } from '@mnykj/wangeditoroptimize-core';
|
|
2
|
+
import { Path, Editor, Text, Range, Transforms } from 'slate';
|
|
3
|
+
import { jsx } from 'snabbdom';
|
|
4
|
+
import $, { append, attr, parent } from 'dom7';
|
|
5
|
+
|
|
6
|
+
var enResources = {
|
|
7
|
+
listModule: {
|
|
8
|
+
unOrderedList: 'Unordered list',
|
|
9
|
+
orderedList: 'Ordered list'
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
var zhResources = {
|
|
14
|
+
listModule: {
|
|
15
|
+
unOrderedList: '无序列表',
|
|
16
|
+
orderedList: '有序列表'
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
i18nAddResources('en', enResources);
|
|
21
|
+
i18nAddResources('zh-CN', zhResources);
|
|
22
|
+
|
|
23
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
24
|
+
|
|
25
|
+
function createCommonjsModule(fn) {
|
|
26
|
+
var module = { exports: {} };
|
|
27
|
+
return fn(module, module.exports), module.exports;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var check = function (it) {
|
|
31
|
+
return it && it.Math == Math && it;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
35
|
+
var global$1 =
|
|
36
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
37
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
38
|
+
check(typeof window == 'object' && window) ||
|
|
39
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
40
|
+
check(typeof self == 'object' && self) ||
|
|
41
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
42
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
43
|
+
(function () { return this; })() || Function('return this')();
|
|
44
|
+
|
|
45
|
+
var FunctionPrototype$2 = Function.prototype;
|
|
46
|
+
var bind$2 = FunctionPrototype$2.bind;
|
|
47
|
+
var call$2 = FunctionPrototype$2.call;
|
|
48
|
+
var callBind = bind$2 && bind$2.bind(call$2);
|
|
49
|
+
|
|
50
|
+
var functionUncurryThis = bind$2 ? function (fn) {
|
|
51
|
+
return fn && callBind(call$2, fn);
|
|
52
|
+
} : function (fn) {
|
|
53
|
+
return fn && function () {
|
|
54
|
+
return call$2.apply(fn, arguments);
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var fails = function (exec) {
|
|
59
|
+
try {
|
|
60
|
+
return !!exec();
|
|
61
|
+
} catch (error) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var toString$2 = functionUncurryThis({}.toString);
|
|
67
|
+
var stringSlice$4 = functionUncurryThis(''.slice);
|
|
68
|
+
|
|
69
|
+
var classofRaw = function (it) {
|
|
70
|
+
return stringSlice$4(toString$2(it), 8, -1);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var Object$5 = global$1.Object;
|
|
74
|
+
var split = functionUncurryThis(''.split);
|
|
75
|
+
|
|
76
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
77
|
+
var indexedObject = fails(function () {
|
|
78
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
79
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
80
|
+
return !Object$5('z').propertyIsEnumerable(0);
|
|
81
|
+
}) ? function (it) {
|
|
82
|
+
return classofRaw(it) == 'String' ? split(it, '') : Object$5(it);
|
|
83
|
+
} : Object$5;
|
|
84
|
+
|
|
85
|
+
var TypeError$d = global$1.TypeError;
|
|
86
|
+
|
|
87
|
+
// `RequireObjectCoercible` abstract operation
|
|
88
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
89
|
+
var requireObjectCoercible = function (it) {
|
|
90
|
+
if (it == undefined) throw TypeError$d("Can't call method on " + it);
|
|
91
|
+
return it;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
var toIndexedObject = function (it) {
|
|
99
|
+
return indexedObject(requireObjectCoercible(it));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
103
|
+
var defineProperty$1 = Object.defineProperty;
|
|
104
|
+
|
|
105
|
+
var setGlobal = function (key, value) {
|
|
106
|
+
try {
|
|
107
|
+
defineProperty$1(global$1, key, { value: value, configurable: true, writable: true });
|
|
108
|
+
} catch (error) {
|
|
109
|
+
global$1[key] = value;
|
|
110
|
+
} return value;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var SHARED = '__core-js_shared__';
|
|
114
|
+
var store$1 = global$1[SHARED] || setGlobal(SHARED, {});
|
|
115
|
+
|
|
116
|
+
var sharedStore = store$1;
|
|
117
|
+
|
|
118
|
+
var shared = createCommonjsModule(function (module) {
|
|
119
|
+
(module.exports = function (key, value) {
|
|
120
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
121
|
+
})('versions', []).push({
|
|
122
|
+
version: '3.19.3',
|
|
123
|
+
mode: 'global',
|
|
124
|
+
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
var Object$4 = global$1.Object;
|
|
129
|
+
|
|
130
|
+
// `ToObject` abstract operation
|
|
131
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
132
|
+
var toObject = function (argument) {
|
|
133
|
+
return Object$4(requireObjectCoercible(argument));
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
137
|
+
|
|
138
|
+
// `HasOwnProperty` abstract operation
|
|
139
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
140
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
141
|
+
return hasOwnProperty(toObject(it), key);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
var id$1 = 0;
|
|
145
|
+
var postfix = Math.random();
|
|
146
|
+
var toString$1 = functionUncurryThis(1.0.toString);
|
|
147
|
+
|
|
148
|
+
var uid = function (key) {
|
|
149
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id$1 + postfix, 36);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// `IsCallable` abstract operation
|
|
153
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
154
|
+
var isCallable = function (argument) {
|
|
155
|
+
return typeof argument == 'function';
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var aFunction = function (argument) {
|
|
159
|
+
return isCallable(argument) ? argument : undefined;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
var getBuiltIn = function (namespace, method) {
|
|
163
|
+
return arguments.length < 2 ? aFunction(global$1[namespace]) : global$1[namespace] && global$1[namespace][method];
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
167
|
+
|
|
168
|
+
var process = global$1.process;
|
|
169
|
+
var Deno = global$1.Deno;
|
|
170
|
+
var versions = process && process.versions || Deno && Deno.version;
|
|
171
|
+
var v8 = versions && versions.v8;
|
|
172
|
+
var match, version;
|
|
173
|
+
|
|
174
|
+
if (v8) {
|
|
175
|
+
match = v8.split('.');
|
|
176
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
177
|
+
// but their correct versions are not interesting for us
|
|
178
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
182
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
183
|
+
if (!version && engineUserAgent) {
|
|
184
|
+
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
185
|
+
if (!match || match[1] >= 74) {
|
|
186
|
+
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
187
|
+
if (match) version = +match[1];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
var engineV8Version = version;
|
|
192
|
+
|
|
193
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
194
|
+
|
|
195
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
196
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
197
|
+
var symbol = Symbol();
|
|
198
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
199
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
200
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
201
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
202
|
+
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
206
|
+
|
|
207
|
+
var useSymbolAsUid = nativeSymbol
|
|
208
|
+
&& !Symbol.sham
|
|
209
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
210
|
+
|
|
211
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
212
|
+
var Symbol$1 = global$1.Symbol;
|
|
213
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
214
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
215
|
+
|
|
216
|
+
var wellKnownSymbol = function (name) {
|
|
217
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
218
|
+
var description = 'Symbol.' + name;
|
|
219
|
+
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
220
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
221
|
+
} else if (useSymbolAsUid && symbolFor) {
|
|
222
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
223
|
+
} else {
|
|
224
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
225
|
+
}
|
|
226
|
+
} return WellKnownSymbolsStore[name];
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
var isObject = function (it) {
|
|
230
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
var String$4 = global$1.String;
|
|
234
|
+
var TypeError$c = global$1.TypeError;
|
|
235
|
+
|
|
236
|
+
// `Assert: Type(argument) is Object`
|
|
237
|
+
var anObject = function (argument) {
|
|
238
|
+
if (isObject(argument)) return argument;
|
|
239
|
+
throw TypeError$c(String$4(argument) + ' is not an object');
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
243
|
+
var descriptors = !fails(function () {
|
|
244
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
245
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
var document$1 = global$1.document;
|
|
249
|
+
// typeof document.createElement is 'object' in old IE
|
|
250
|
+
var EXISTS$1 = isObject(document$1) && isObject(document$1.createElement);
|
|
251
|
+
|
|
252
|
+
var documentCreateElement = function (it) {
|
|
253
|
+
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
// Thank's IE8 for his funny defineProperty
|
|
257
|
+
var ie8DomDefine = !descriptors && !fails(function () {
|
|
258
|
+
// eslint-disable-next-line es/no-object-defineproperty -- requied for testing
|
|
259
|
+
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
260
|
+
get: function () { return 7; }
|
|
261
|
+
}).a != 7;
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
var call$1 = Function.prototype.call;
|
|
265
|
+
|
|
266
|
+
var functionCall = call$1.bind ? call$1.bind(call$1) : function () {
|
|
267
|
+
return call$1.apply(call$1, arguments);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
271
|
+
|
|
272
|
+
var Object$3 = global$1.Object;
|
|
273
|
+
|
|
274
|
+
var isSymbol = useSymbolAsUid ? function (it) {
|
|
275
|
+
return typeof it == 'symbol';
|
|
276
|
+
} : function (it) {
|
|
277
|
+
var $Symbol = getBuiltIn('Symbol');
|
|
278
|
+
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$3(it));
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
var String$3 = global$1.String;
|
|
282
|
+
|
|
283
|
+
var tryToString = function (argument) {
|
|
284
|
+
try {
|
|
285
|
+
return String$3(argument);
|
|
286
|
+
} catch (error) {
|
|
287
|
+
return 'Object';
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
var TypeError$b = global$1.TypeError;
|
|
292
|
+
|
|
293
|
+
// `Assert: IsCallable(argument) is true`
|
|
294
|
+
var aCallable = function (argument) {
|
|
295
|
+
if (isCallable(argument)) return argument;
|
|
296
|
+
throw TypeError$b(tryToString(argument) + ' is not a function');
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
// `GetMethod` abstract operation
|
|
300
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
301
|
+
var getMethod = function (V, P) {
|
|
302
|
+
var func = V[P];
|
|
303
|
+
return func == null ? undefined : aCallable(func);
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
var TypeError$a = global$1.TypeError;
|
|
307
|
+
|
|
308
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
309
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
310
|
+
var ordinaryToPrimitive = function (input, pref) {
|
|
311
|
+
var fn, val;
|
|
312
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
313
|
+
if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
|
|
314
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
315
|
+
throw TypeError$a("Can't convert object to primitive value");
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
var TypeError$9 = global$1.TypeError;
|
|
319
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
320
|
+
|
|
321
|
+
// `ToPrimitive` abstract operation
|
|
322
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
323
|
+
var toPrimitive = function (input, pref) {
|
|
324
|
+
if (!isObject(input) || isSymbol(input)) return input;
|
|
325
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
326
|
+
var result;
|
|
327
|
+
if (exoticToPrim) {
|
|
328
|
+
if (pref === undefined) pref = 'default';
|
|
329
|
+
result = functionCall(exoticToPrim, input, pref);
|
|
330
|
+
if (!isObject(result) || isSymbol(result)) return result;
|
|
331
|
+
throw TypeError$9("Can't convert object to primitive value");
|
|
332
|
+
}
|
|
333
|
+
if (pref === undefined) pref = 'number';
|
|
334
|
+
return ordinaryToPrimitive(input, pref);
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
// `ToPropertyKey` abstract operation
|
|
338
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
339
|
+
var toPropertyKey = function (argument) {
|
|
340
|
+
var key = toPrimitive(argument, 'string');
|
|
341
|
+
return isSymbol(key) ? key : key + '';
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
var TypeError$8 = global$1.TypeError;
|
|
345
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
346
|
+
var $defineProperty = Object.defineProperty;
|
|
347
|
+
|
|
348
|
+
// `Object.defineProperty` method
|
|
349
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
350
|
+
var f$5 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
|
|
351
|
+
anObject(O);
|
|
352
|
+
P = toPropertyKey(P);
|
|
353
|
+
anObject(Attributes);
|
|
354
|
+
if (ie8DomDefine) try {
|
|
355
|
+
return $defineProperty(O, P, Attributes);
|
|
356
|
+
} catch (error) { /* empty */ }
|
|
357
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError$8('Accessors not supported');
|
|
358
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
359
|
+
return O;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
var objectDefineProperty = {
|
|
363
|
+
f: f$5
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
var ceil = Math.ceil;
|
|
367
|
+
var floor$1 = Math.floor;
|
|
368
|
+
|
|
369
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
370
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
371
|
+
var toIntegerOrInfinity = function (argument) {
|
|
372
|
+
var number = +argument;
|
|
373
|
+
// eslint-disable-next-line no-self-compare -- safe
|
|
374
|
+
return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
var max$2 = Math.max;
|
|
378
|
+
var min$2 = Math.min;
|
|
379
|
+
|
|
380
|
+
// Helper for a popular repeating case of the spec:
|
|
381
|
+
// Let integer be ? ToInteger(index).
|
|
382
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
383
|
+
var toAbsoluteIndex = function (index, length) {
|
|
384
|
+
var integer = toIntegerOrInfinity(index);
|
|
385
|
+
return integer < 0 ? max$2(integer + length, 0) : min$2(integer, length);
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
var min$1 = Math.min;
|
|
389
|
+
|
|
390
|
+
// `ToLength` abstract operation
|
|
391
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
392
|
+
var toLength = function (argument) {
|
|
393
|
+
return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
// `LengthOfArrayLike` abstract operation
|
|
397
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
398
|
+
var lengthOfArrayLike = function (obj) {
|
|
399
|
+
return toLength(obj.length);
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
403
|
+
var createMethod$2 = function (IS_INCLUDES) {
|
|
404
|
+
return function ($this, el, fromIndex) {
|
|
405
|
+
var O = toIndexedObject($this);
|
|
406
|
+
var length = lengthOfArrayLike(O);
|
|
407
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
408
|
+
var value;
|
|
409
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
410
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
411
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
412
|
+
value = O[index++];
|
|
413
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
414
|
+
if (value != value) return true;
|
|
415
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
416
|
+
} else for (;length > index; index++) {
|
|
417
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
418
|
+
} return !IS_INCLUDES && -1;
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
var arrayIncludes = {
|
|
423
|
+
// `Array.prototype.includes` method
|
|
424
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
425
|
+
includes: createMethod$2(true),
|
|
426
|
+
// `Array.prototype.indexOf` method
|
|
427
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
428
|
+
indexOf: createMethod$2(false)
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
var hiddenKeys$1 = {};
|
|
432
|
+
|
|
433
|
+
var indexOf$1 = arrayIncludes.indexOf;
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
var push$2 = functionUncurryThis([].push);
|
|
437
|
+
|
|
438
|
+
var objectKeysInternal = function (object, names) {
|
|
439
|
+
var O = toIndexedObject(object);
|
|
440
|
+
var i = 0;
|
|
441
|
+
var result = [];
|
|
442
|
+
var key;
|
|
443
|
+
for (key in O) !hasOwnProperty_1(hiddenKeys$1, key) && hasOwnProperty_1(O, key) && push$2(result, key);
|
|
444
|
+
// Don't enum bug & hidden keys
|
|
445
|
+
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
446
|
+
~indexOf$1(result, key) || push$2(result, key);
|
|
447
|
+
}
|
|
448
|
+
return result;
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
// IE8- don't enum bug keys
|
|
452
|
+
var enumBugKeys = [
|
|
453
|
+
'constructor',
|
|
454
|
+
'hasOwnProperty',
|
|
455
|
+
'isPrototypeOf',
|
|
456
|
+
'propertyIsEnumerable',
|
|
457
|
+
'toLocaleString',
|
|
458
|
+
'toString',
|
|
459
|
+
'valueOf'
|
|
460
|
+
];
|
|
461
|
+
|
|
462
|
+
// `Object.keys` method
|
|
463
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
464
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
465
|
+
var objectKeys = Object.keys || function keys(O) {
|
|
466
|
+
return objectKeysInternal(O, enumBugKeys);
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
// `Object.defineProperties` method
|
|
470
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
471
|
+
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
472
|
+
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
473
|
+
anObject(O);
|
|
474
|
+
var props = toIndexedObject(Properties);
|
|
475
|
+
var keys = objectKeys(Properties);
|
|
476
|
+
var length = keys.length;
|
|
477
|
+
var index = 0;
|
|
478
|
+
var key;
|
|
479
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
480
|
+
return O;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
var html = getBuiltIn('document', 'documentElement');
|
|
484
|
+
|
|
485
|
+
var keys = shared('keys');
|
|
486
|
+
|
|
487
|
+
var sharedKey = function (key) {
|
|
488
|
+
return keys[key] || (keys[key] = uid(key));
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
492
|
+
|
|
493
|
+
var GT = '>';
|
|
494
|
+
var LT = '<';
|
|
495
|
+
var PROTOTYPE = 'prototype';
|
|
496
|
+
var SCRIPT = 'script';
|
|
497
|
+
var IE_PROTO$1 = sharedKey('IE_PROTO');
|
|
498
|
+
|
|
499
|
+
var EmptyConstructor = function () { /* empty */ };
|
|
500
|
+
|
|
501
|
+
var scriptTag = function (content) {
|
|
502
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
506
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
507
|
+
activeXDocument.write(scriptTag(''));
|
|
508
|
+
activeXDocument.close();
|
|
509
|
+
var temp = activeXDocument.parentWindow.Object;
|
|
510
|
+
activeXDocument = null; // avoid memory leak
|
|
511
|
+
return temp;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
515
|
+
var NullProtoObjectViaIFrame = function () {
|
|
516
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
517
|
+
var iframe = documentCreateElement('iframe');
|
|
518
|
+
var JS = 'java' + SCRIPT + ':';
|
|
519
|
+
var iframeDocument;
|
|
520
|
+
iframe.style.display = 'none';
|
|
521
|
+
html.appendChild(iframe);
|
|
522
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
523
|
+
iframe.src = String(JS);
|
|
524
|
+
iframeDocument = iframe.contentWindow.document;
|
|
525
|
+
iframeDocument.open();
|
|
526
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
527
|
+
iframeDocument.close();
|
|
528
|
+
return iframeDocument.F;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
// Check for document.domain and active x support
|
|
532
|
+
// No need to use active x approach when document.domain is not set
|
|
533
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
|
534
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
535
|
+
// avoid IE GC bug
|
|
536
|
+
var activeXDocument;
|
|
537
|
+
var NullProtoObject = function () {
|
|
538
|
+
try {
|
|
539
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
540
|
+
} catch (error) { /* ignore */ }
|
|
541
|
+
NullProtoObject = typeof document != 'undefined'
|
|
542
|
+
? document.domain && activeXDocument
|
|
543
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
544
|
+
: NullProtoObjectViaIFrame()
|
|
545
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
546
|
+
var length = enumBugKeys.length;
|
|
547
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
548
|
+
return NullProtoObject();
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
hiddenKeys$1[IE_PROTO$1] = true;
|
|
552
|
+
|
|
553
|
+
// `Object.create` method
|
|
554
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
555
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
|
556
|
+
var result;
|
|
557
|
+
if (O !== null) {
|
|
558
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
559
|
+
result = new EmptyConstructor();
|
|
560
|
+
EmptyConstructor[PROTOTYPE] = null;
|
|
561
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
562
|
+
result[IE_PROTO$1] = O;
|
|
563
|
+
} else result = NullProtoObject();
|
|
564
|
+
return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
568
|
+
var ArrayPrototype$1 = Array.prototype;
|
|
569
|
+
|
|
570
|
+
// Array.prototype[@@unscopables]
|
|
571
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
572
|
+
if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
|
|
573
|
+
objectDefineProperty.f(ArrayPrototype$1, UNSCOPABLES, {
|
|
574
|
+
configurable: true,
|
|
575
|
+
value: objectCreate(null)
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
// add a key to Array.prototype[@@unscopables]
|
|
580
|
+
var addToUnscopables = function (key) {
|
|
581
|
+
ArrayPrototype$1[UNSCOPABLES][key] = true;
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
var iterators = {};
|
|
585
|
+
|
|
586
|
+
var functionToString = functionUncurryThis(Function.toString);
|
|
587
|
+
|
|
588
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
589
|
+
if (!isCallable(sharedStore.inspectSource)) {
|
|
590
|
+
sharedStore.inspectSource = function (it) {
|
|
591
|
+
return functionToString(it);
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
var inspectSource = sharedStore.inspectSource;
|
|
596
|
+
|
|
597
|
+
var WeakMap$2 = global$1.WeakMap;
|
|
598
|
+
|
|
599
|
+
var nativeWeakMap = isCallable(WeakMap$2) && /native code/.test(inspectSource(WeakMap$2));
|
|
600
|
+
|
|
601
|
+
var createPropertyDescriptor = function (bitmap, value) {
|
|
602
|
+
return {
|
|
603
|
+
enumerable: !(bitmap & 1),
|
|
604
|
+
configurable: !(bitmap & 2),
|
|
605
|
+
writable: !(bitmap & 4),
|
|
606
|
+
value: value
|
|
607
|
+
};
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
611
|
+
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
|
612
|
+
} : function (object, key, value) {
|
|
613
|
+
object[key] = value;
|
|
614
|
+
return object;
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
618
|
+
var TypeError$7 = global$1.TypeError;
|
|
619
|
+
var WeakMap$1 = global$1.WeakMap;
|
|
620
|
+
var set, get, has;
|
|
621
|
+
|
|
622
|
+
var enforce = function (it) {
|
|
623
|
+
return has(it) ? get(it) : set(it, {});
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
var getterFor = function (TYPE) {
|
|
627
|
+
return function (it) {
|
|
628
|
+
var state;
|
|
629
|
+
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
630
|
+
throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
|
|
631
|
+
} return state;
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
if (nativeWeakMap || sharedStore.state) {
|
|
636
|
+
var store = sharedStore.state || (sharedStore.state = new WeakMap$1());
|
|
637
|
+
var wmget = functionUncurryThis(store.get);
|
|
638
|
+
var wmhas = functionUncurryThis(store.has);
|
|
639
|
+
var wmset = functionUncurryThis(store.set);
|
|
640
|
+
set = function (it, metadata) {
|
|
641
|
+
if (wmhas(store, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
642
|
+
metadata.facade = it;
|
|
643
|
+
wmset(store, it, metadata);
|
|
644
|
+
return metadata;
|
|
645
|
+
};
|
|
646
|
+
get = function (it) {
|
|
647
|
+
return wmget(store, it) || {};
|
|
648
|
+
};
|
|
649
|
+
has = function (it) {
|
|
650
|
+
return wmhas(store, it);
|
|
651
|
+
};
|
|
652
|
+
} else {
|
|
653
|
+
var STATE = sharedKey('state');
|
|
654
|
+
hiddenKeys$1[STATE] = true;
|
|
655
|
+
set = function (it, metadata) {
|
|
656
|
+
if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
657
|
+
metadata.facade = it;
|
|
658
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
|
659
|
+
return metadata;
|
|
660
|
+
};
|
|
661
|
+
get = function (it) {
|
|
662
|
+
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
|
|
663
|
+
};
|
|
664
|
+
has = function (it) {
|
|
665
|
+
return hasOwnProperty_1(it, STATE);
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
var internalState = {
|
|
670
|
+
set: set,
|
|
671
|
+
get: get,
|
|
672
|
+
has: has,
|
|
673
|
+
enforce: enforce,
|
|
674
|
+
getterFor: getterFor
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
678
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
679
|
+
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
680
|
+
|
|
681
|
+
// Nashorn ~ JDK8 bug
|
|
682
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
683
|
+
|
|
684
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
685
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
686
|
+
var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
687
|
+
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
688
|
+
return !!descriptor && descriptor.enumerable;
|
|
689
|
+
} : $propertyIsEnumerable;
|
|
690
|
+
|
|
691
|
+
var objectPropertyIsEnumerable = {
|
|
692
|
+
f: f$4
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
696
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
697
|
+
|
|
698
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
699
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
700
|
+
var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
701
|
+
O = toIndexedObject(O);
|
|
702
|
+
P = toPropertyKey(P);
|
|
703
|
+
if (ie8DomDefine) try {
|
|
704
|
+
return $getOwnPropertyDescriptor(O, P);
|
|
705
|
+
} catch (error) { /* empty */ }
|
|
706
|
+
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
var objectGetOwnPropertyDescriptor = {
|
|
710
|
+
f: f$3
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
714
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
715
|
+
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
716
|
+
|
|
717
|
+
var EXISTS = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
718
|
+
// additional protection from minified / mangled / dropped function names
|
|
719
|
+
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
720
|
+
var CONFIGURABLE = EXISTS && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
721
|
+
|
|
722
|
+
var functionName = {
|
|
723
|
+
EXISTS: EXISTS,
|
|
724
|
+
PROPER: PROPER,
|
|
725
|
+
CONFIGURABLE: CONFIGURABLE
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
var redefine = createCommonjsModule(function (module) {
|
|
729
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
730
|
+
|
|
731
|
+
var getInternalState = internalState.get;
|
|
732
|
+
var enforceInternalState = internalState.enforce;
|
|
733
|
+
var TEMPLATE = String(String).split('String');
|
|
734
|
+
|
|
735
|
+
(module.exports = function (O, key, value, options) {
|
|
736
|
+
var unsafe = options ? !!options.unsafe : false;
|
|
737
|
+
var simple = options ? !!options.enumerable : false;
|
|
738
|
+
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
739
|
+
var name = options && options.name !== undefined ? options.name : key;
|
|
740
|
+
var state;
|
|
741
|
+
if (isCallable(value)) {
|
|
742
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
743
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
744
|
+
}
|
|
745
|
+
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
746
|
+
createNonEnumerableProperty(value, 'name', name);
|
|
747
|
+
}
|
|
748
|
+
state = enforceInternalState(value);
|
|
749
|
+
if (!state.source) {
|
|
750
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
if (O === global$1) {
|
|
754
|
+
if (simple) O[key] = value;
|
|
755
|
+
else setGlobal(key, value);
|
|
756
|
+
return;
|
|
757
|
+
} else if (!unsafe) {
|
|
758
|
+
delete O[key];
|
|
759
|
+
} else if (!noTargetGet && O[key]) {
|
|
760
|
+
simple = true;
|
|
761
|
+
}
|
|
762
|
+
if (simple) O[key] = value;
|
|
763
|
+
else createNonEnumerableProperty(O, key, value);
|
|
764
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
765
|
+
})(Function.prototype, 'toString', function toString() {
|
|
766
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
767
|
+
});
|
|
768
|
+
});
|
|
769
|
+
|
|
770
|
+
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
771
|
+
|
|
772
|
+
// `Object.getOwnPropertyNames` method
|
|
773
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
774
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
775
|
+
var f$2 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
776
|
+
return objectKeysInternal(O, hiddenKeys);
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
var objectGetOwnPropertyNames = {
|
|
780
|
+
f: f$2
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
784
|
+
var f$1 = Object.getOwnPropertySymbols;
|
|
785
|
+
|
|
786
|
+
var objectGetOwnPropertySymbols = {
|
|
787
|
+
f: f$1
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
var concat$1 = functionUncurryThis([].concat);
|
|
791
|
+
|
|
792
|
+
// all object keys, includes non-enumerable and symbols
|
|
793
|
+
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
794
|
+
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
795
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
796
|
+
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
var copyConstructorProperties = function (target, source) {
|
|
800
|
+
var keys = ownKeys(source);
|
|
801
|
+
var defineProperty = objectDefineProperty.f;
|
|
802
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
803
|
+
for (var i = 0; i < keys.length; i++) {
|
|
804
|
+
var key = keys[i];
|
|
805
|
+
if (!hasOwnProperty_1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
806
|
+
}
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
var replacement = /#|\.prototype\./;
|
|
810
|
+
|
|
811
|
+
var isForced = function (feature, detection) {
|
|
812
|
+
var value = data[normalize(feature)];
|
|
813
|
+
return value == POLYFILL ? true
|
|
814
|
+
: value == NATIVE ? false
|
|
815
|
+
: isCallable(detection) ? fails(detection)
|
|
816
|
+
: !!detection;
|
|
817
|
+
};
|
|
818
|
+
|
|
819
|
+
var normalize = isForced.normalize = function (string) {
|
|
820
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
var data = isForced.data = {};
|
|
824
|
+
var NATIVE = isForced.NATIVE = 'N';
|
|
825
|
+
var POLYFILL = isForced.POLYFILL = 'P';
|
|
826
|
+
|
|
827
|
+
var isForced_1 = isForced;
|
|
828
|
+
|
|
829
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
/*
|
|
837
|
+
options.target - name of the target object
|
|
838
|
+
options.global - target is the global object
|
|
839
|
+
options.stat - export as static methods of target
|
|
840
|
+
options.proto - export as prototype methods of target
|
|
841
|
+
options.real - real prototype method for the `pure` version
|
|
842
|
+
options.forced - export even if the native feature is available
|
|
843
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
844
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
845
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
846
|
+
options.sham - add a flag to not completely full polyfills
|
|
847
|
+
options.enumerable - export as enumerable property
|
|
848
|
+
options.noTargetGet - prevent calling a getter on target
|
|
849
|
+
options.name - the .name of the function if it does not match the key
|
|
850
|
+
*/
|
|
851
|
+
var _export = function (options, source) {
|
|
852
|
+
var TARGET = options.target;
|
|
853
|
+
var GLOBAL = options.global;
|
|
854
|
+
var STATIC = options.stat;
|
|
855
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
856
|
+
if (GLOBAL) {
|
|
857
|
+
target = global$1;
|
|
858
|
+
} else if (STATIC) {
|
|
859
|
+
target = global$1[TARGET] || setGlobal(TARGET, {});
|
|
860
|
+
} else {
|
|
861
|
+
target = (global$1[TARGET] || {}).prototype;
|
|
862
|
+
}
|
|
863
|
+
if (target) for (key in source) {
|
|
864
|
+
sourceProperty = source[key];
|
|
865
|
+
if (options.noTargetGet) {
|
|
866
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
|
867
|
+
targetProperty = descriptor && descriptor.value;
|
|
868
|
+
} else targetProperty = target[key];
|
|
869
|
+
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
870
|
+
// contained in target
|
|
871
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
872
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
873
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
|
874
|
+
}
|
|
875
|
+
// add a flag to not completely full polyfills
|
|
876
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
877
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
878
|
+
}
|
|
879
|
+
// extend global
|
|
880
|
+
redefine(target, key, sourceProperty, options);
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
var correctPrototypeGetter = !fails(function () {
|
|
885
|
+
function F() { /* empty */ }
|
|
886
|
+
F.prototype.constructor = null;
|
|
887
|
+
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
888
|
+
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
889
|
+
});
|
|
890
|
+
|
|
891
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
892
|
+
var Object$2 = global$1.Object;
|
|
893
|
+
var ObjectPrototype = Object$2.prototype;
|
|
894
|
+
|
|
895
|
+
// `Object.getPrototypeOf` method
|
|
896
|
+
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
897
|
+
var objectGetPrototypeOf = correctPrototypeGetter ? Object$2.getPrototypeOf : function (O) {
|
|
898
|
+
var object = toObject(O);
|
|
899
|
+
if (hasOwnProperty_1(object, IE_PROTO)) return object[IE_PROTO];
|
|
900
|
+
var constructor = object.constructor;
|
|
901
|
+
if (isCallable(constructor) && object instanceof constructor) {
|
|
902
|
+
return constructor.prototype;
|
|
903
|
+
} return object instanceof Object$2 ? ObjectPrototype : null;
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
var ITERATOR$5 = wellKnownSymbol('iterator');
|
|
907
|
+
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
908
|
+
|
|
909
|
+
// `%IteratorPrototype%` object
|
|
910
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
911
|
+
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
912
|
+
|
|
913
|
+
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
914
|
+
if ([].keys) {
|
|
915
|
+
arrayIterator = [].keys();
|
|
916
|
+
// Safari 8 has buggy iterators w/o `next`
|
|
917
|
+
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
|
918
|
+
else {
|
|
919
|
+
PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
|
|
920
|
+
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails(function () {
|
|
925
|
+
var test = {};
|
|
926
|
+
// FF44- legacy iterators case
|
|
927
|
+
return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
931
|
+
|
|
932
|
+
// `%IteratorPrototype%[@@iterator]()` method
|
|
933
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
934
|
+
if (!isCallable(IteratorPrototype$2[ITERATOR$5])) {
|
|
935
|
+
redefine(IteratorPrototype$2, ITERATOR$5, function () {
|
|
936
|
+
return this;
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
var iteratorsCore = {
|
|
941
|
+
IteratorPrototype: IteratorPrototype$2,
|
|
942
|
+
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
var defineProperty = objectDefineProperty.f;
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
|
|
950
|
+
|
|
951
|
+
var setToStringTag = function (it, TAG, STATIC) {
|
|
952
|
+
if (it && !hasOwnProperty_1(it = STATIC ? it : it.prototype, TO_STRING_TAG$3)) {
|
|
953
|
+
defineProperty(it, TO_STRING_TAG$3, { configurable: true, value: TAG });
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
var returnThis$1 = function () { return this; };
|
|
964
|
+
|
|
965
|
+
var createIteratorConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
966
|
+
var TO_STRING_TAG = NAME + ' Iterator';
|
|
967
|
+
IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
968
|
+
setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
|
|
969
|
+
iterators[TO_STRING_TAG] = returnThis$1;
|
|
970
|
+
return IteratorConstructor;
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
var String$2 = global$1.String;
|
|
974
|
+
var TypeError$6 = global$1.TypeError;
|
|
975
|
+
|
|
976
|
+
var aPossiblePrototype = function (argument) {
|
|
977
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
978
|
+
throw TypeError$6("Can't set " + String$2(argument) + ' as a prototype');
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
/* eslint-disable no-proto -- safe */
|
|
982
|
+
|
|
983
|
+
// `Object.setPrototypeOf` method
|
|
984
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
985
|
+
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
986
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
987
|
+
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
988
|
+
var CORRECT_SETTER = false;
|
|
989
|
+
var test = {};
|
|
990
|
+
var setter;
|
|
991
|
+
try {
|
|
992
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
993
|
+
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
994
|
+
setter(test, []);
|
|
995
|
+
CORRECT_SETTER = test instanceof Array;
|
|
996
|
+
} catch (error) { /* empty */ }
|
|
997
|
+
return function setPrototypeOf(O, proto) {
|
|
998
|
+
anObject(O);
|
|
999
|
+
aPossiblePrototype(proto);
|
|
1000
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
1001
|
+
else O.__proto__ = proto;
|
|
1002
|
+
return O;
|
|
1003
|
+
};
|
|
1004
|
+
}() : undefined);
|
|
1005
|
+
|
|
1006
|
+
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
1007
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
1008
|
+
var IteratorPrototype = iteratorsCore.IteratorPrototype;
|
|
1009
|
+
var BUGGY_SAFARI_ITERATORS = iteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1010
|
+
var ITERATOR$4 = wellKnownSymbol('iterator');
|
|
1011
|
+
var KEYS = 'keys';
|
|
1012
|
+
var VALUES = 'values';
|
|
1013
|
+
var ENTRIES = 'entries';
|
|
1014
|
+
|
|
1015
|
+
var returnThis = function () { return this; };
|
|
1016
|
+
|
|
1017
|
+
var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
|
1018
|
+
createIteratorConstructor(IteratorConstructor, NAME, next);
|
|
1019
|
+
|
|
1020
|
+
var getIterationMethod = function (KIND) {
|
|
1021
|
+
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
|
1022
|
+
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
1023
|
+
switch (KIND) {
|
|
1024
|
+
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
|
1025
|
+
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
|
1026
|
+
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
|
1027
|
+
} return function () { return new IteratorConstructor(this); };
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1031
|
+
var INCORRECT_VALUES_NAME = false;
|
|
1032
|
+
var IterablePrototype = Iterable.prototype;
|
|
1033
|
+
var nativeIterator = IterablePrototype[ITERATOR$4]
|
|
1034
|
+
|| IterablePrototype['@@iterator']
|
|
1035
|
+
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
1036
|
+
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
1037
|
+
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
|
1038
|
+
var CurrentIteratorPrototype, methods, KEY;
|
|
1039
|
+
|
|
1040
|
+
// fix native
|
|
1041
|
+
if (anyNativeIterator) {
|
|
1042
|
+
CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
|
|
1043
|
+
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
|
1044
|
+
if (objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1045
|
+
if (objectSetPrototypeOf) {
|
|
1046
|
+
objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1047
|
+
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$4])) {
|
|
1048
|
+
redefine(CurrentIteratorPrototype, ITERATOR$4, returnThis);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
// Set @@toStringTag to native iterators
|
|
1052
|
+
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1057
|
+
if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1058
|
+
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1059
|
+
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
|
1060
|
+
} else {
|
|
1061
|
+
INCORRECT_VALUES_NAME = true;
|
|
1062
|
+
defaultIterator = function values() { return functionCall(nativeIterator, this); };
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// export additional methods
|
|
1067
|
+
if (DEFAULT) {
|
|
1068
|
+
methods = {
|
|
1069
|
+
values: getIterationMethod(VALUES),
|
|
1070
|
+
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
|
1071
|
+
entries: getIterationMethod(ENTRIES)
|
|
1072
|
+
};
|
|
1073
|
+
if (FORCED) for (KEY in methods) {
|
|
1074
|
+
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1075
|
+
redefine(IterablePrototype, KEY, methods[KEY]);
|
|
1076
|
+
}
|
|
1077
|
+
} else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// define iterator
|
|
1081
|
+
if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
|
|
1082
|
+
redefine(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
|
|
1083
|
+
}
|
|
1084
|
+
iterators[NAME] = defaultIterator;
|
|
1085
|
+
|
|
1086
|
+
return methods;
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1090
|
+
var setInternalState$2 = internalState.set;
|
|
1091
|
+
var getInternalState$2 = internalState.getterFor(ARRAY_ITERATOR);
|
|
1092
|
+
|
|
1093
|
+
// `Array.prototype.entries` method
|
|
1094
|
+
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
1095
|
+
// `Array.prototype.keys` method
|
|
1096
|
+
// https://tc39.es/ecma262/#sec-array.prototype.keys
|
|
1097
|
+
// `Array.prototype.values` method
|
|
1098
|
+
// https://tc39.es/ecma262/#sec-array.prototype.values
|
|
1099
|
+
// `Array.prototype[@@iterator]` method
|
|
1100
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
|
1101
|
+
// `CreateArrayIterator` internal method
|
|
1102
|
+
// https://tc39.es/ecma262/#sec-createarrayiterator
|
|
1103
|
+
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
|
1104
|
+
setInternalState$2(this, {
|
|
1105
|
+
type: ARRAY_ITERATOR,
|
|
1106
|
+
target: toIndexedObject(iterated), // target
|
|
1107
|
+
index: 0, // next index
|
|
1108
|
+
kind: kind // kind
|
|
1109
|
+
});
|
|
1110
|
+
// `%ArrayIteratorPrototype%.next` method
|
|
1111
|
+
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1112
|
+
}, function () {
|
|
1113
|
+
var state = getInternalState$2(this);
|
|
1114
|
+
var target = state.target;
|
|
1115
|
+
var kind = state.kind;
|
|
1116
|
+
var index = state.index++;
|
|
1117
|
+
if (!target || index >= target.length) {
|
|
1118
|
+
state.target = undefined;
|
|
1119
|
+
return { value: undefined, done: true };
|
|
1120
|
+
}
|
|
1121
|
+
if (kind == 'keys') return { value: index, done: false };
|
|
1122
|
+
if (kind == 'values') return { value: target[index], done: false };
|
|
1123
|
+
return { value: [index, target[index]], done: false };
|
|
1124
|
+
}, 'values');
|
|
1125
|
+
|
|
1126
|
+
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
1127
|
+
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
1128
|
+
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
1129
|
+
iterators.Arguments = iterators.Array;
|
|
1130
|
+
|
|
1131
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1132
|
+
addToUnscopables('keys');
|
|
1133
|
+
addToUnscopables('values');
|
|
1134
|
+
addToUnscopables('entries');
|
|
1135
|
+
|
|
1136
|
+
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
1137
|
+
var test = {};
|
|
1138
|
+
|
|
1139
|
+
test[TO_STRING_TAG$2] = 'z';
|
|
1140
|
+
|
|
1141
|
+
var toStringTagSupport = String(test) === '[object z]';
|
|
1142
|
+
|
|
1143
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
1144
|
+
var Object$1 = global$1.Object;
|
|
1145
|
+
|
|
1146
|
+
// ES3 wrong here
|
|
1147
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
1148
|
+
|
|
1149
|
+
// fallback for IE11 Script Access Denied error
|
|
1150
|
+
var tryGet = function (it, key) {
|
|
1151
|
+
try {
|
|
1152
|
+
return it[key];
|
|
1153
|
+
} catch (error) { /* empty */ }
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
1157
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
1158
|
+
var O, tag, result;
|
|
1159
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1160
|
+
// @@toStringTag case
|
|
1161
|
+
: typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
1162
|
+
// builtinTag case
|
|
1163
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1164
|
+
// ES3 arguments fallback
|
|
1165
|
+
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
// `Object.prototype.toString` method implementation
|
|
1169
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1170
|
+
var objectToString = toStringTagSupport ? {}.toString : function toString() {
|
|
1171
|
+
return '[object ' + classof(this) + ']';
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
// `Object.prototype.toString` method
|
|
1175
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
1176
|
+
if (!toStringTagSupport) {
|
|
1177
|
+
redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
var String$1 = global$1.String;
|
|
1181
|
+
|
|
1182
|
+
var toString = function (argument) {
|
|
1183
|
+
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
1184
|
+
return String$1(argument);
|
|
1185
|
+
};
|
|
1186
|
+
|
|
1187
|
+
var charAt$4 = functionUncurryThis(''.charAt);
|
|
1188
|
+
var charCodeAt = functionUncurryThis(''.charCodeAt);
|
|
1189
|
+
var stringSlice$3 = functionUncurryThis(''.slice);
|
|
1190
|
+
|
|
1191
|
+
var createMethod$1 = function (CONVERT_TO_STRING) {
|
|
1192
|
+
return function ($this, pos) {
|
|
1193
|
+
var S = toString(requireObjectCoercible($this));
|
|
1194
|
+
var position = toIntegerOrInfinity(pos);
|
|
1195
|
+
var size = S.length;
|
|
1196
|
+
var first, second;
|
|
1197
|
+
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
1198
|
+
first = charCodeAt(S, position);
|
|
1199
|
+
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
1200
|
+
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
|
1201
|
+
? CONVERT_TO_STRING
|
|
1202
|
+
? charAt$4(S, position)
|
|
1203
|
+
: first
|
|
1204
|
+
: CONVERT_TO_STRING
|
|
1205
|
+
? stringSlice$3(S, position, position + 2)
|
|
1206
|
+
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
1207
|
+
};
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
var stringMultibyte = {
|
|
1211
|
+
// `String.prototype.codePointAt` method
|
|
1212
|
+
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
1213
|
+
codeAt: createMethod$1(false),
|
|
1214
|
+
// `String.prototype.at` method
|
|
1215
|
+
// https://github.com/mathiasbynens/String.prototype.at
|
|
1216
|
+
charAt: createMethod$1(true)
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
var charAt$3 = stringMultibyte.charAt;
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
var STRING_ITERATOR = 'String Iterator';
|
|
1225
|
+
var setInternalState$1 = internalState.set;
|
|
1226
|
+
var getInternalState$1 = internalState.getterFor(STRING_ITERATOR);
|
|
1227
|
+
|
|
1228
|
+
// `String.prototype[@@iterator]` method
|
|
1229
|
+
// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
|
|
1230
|
+
defineIterator(String, 'String', function (iterated) {
|
|
1231
|
+
setInternalState$1(this, {
|
|
1232
|
+
type: STRING_ITERATOR,
|
|
1233
|
+
string: toString(iterated),
|
|
1234
|
+
index: 0
|
|
1235
|
+
});
|
|
1236
|
+
// `%StringIteratorPrototype%.next` method
|
|
1237
|
+
// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
|
|
1238
|
+
}, function next() {
|
|
1239
|
+
var state = getInternalState$1(this);
|
|
1240
|
+
var string = state.string;
|
|
1241
|
+
var index = state.index;
|
|
1242
|
+
var point;
|
|
1243
|
+
if (index >= string.length) return { value: undefined, done: true };
|
|
1244
|
+
point = charAt$3(string, index);
|
|
1245
|
+
state.index += point.length;
|
|
1246
|
+
return { value: point, done: false };
|
|
1247
|
+
});
|
|
1248
|
+
|
|
1249
|
+
var redefineAll = function (target, src, options) {
|
|
1250
|
+
for (var key in src) redefine(target, key, src[key], options);
|
|
1251
|
+
return target;
|
|
1252
|
+
};
|
|
1253
|
+
|
|
1254
|
+
var createProperty = function (object, key, value) {
|
|
1255
|
+
var propertyKey = toPropertyKey(key);
|
|
1256
|
+
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
|
1257
|
+
else object[propertyKey] = value;
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
var Array$2 = global$1.Array;
|
|
1261
|
+
var max$1 = Math.max;
|
|
1262
|
+
|
|
1263
|
+
var arraySliceSimple = function (O, start, end) {
|
|
1264
|
+
var length = lengthOfArrayLike(O);
|
|
1265
|
+
var k = toAbsoluteIndex(start, length);
|
|
1266
|
+
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
1267
|
+
var result = Array$2(max$1(fin - k, 0));
|
|
1268
|
+
for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
|
|
1269
|
+
result.length = n;
|
|
1270
|
+
return result;
|
|
1271
|
+
};
|
|
1272
|
+
|
|
1273
|
+
/* eslint-disable es/no-object-getownpropertynames -- safe */
|
|
1274
|
+
|
|
1275
|
+
var $getOwnPropertyNames = objectGetOwnPropertyNames.f;
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
|
1279
|
+
? Object.getOwnPropertyNames(window) : [];
|
|
1280
|
+
|
|
1281
|
+
var getWindowNames = function (it) {
|
|
1282
|
+
try {
|
|
1283
|
+
return $getOwnPropertyNames(it);
|
|
1284
|
+
} catch (error) {
|
|
1285
|
+
return arraySliceSimple(windowNames);
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
|
|
1289
|
+
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
|
|
1290
|
+
var f = function getOwnPropertyNames(it) {
|
|
1291
|
+
return windowNames && classofRaw(it) == 'Window'
|
|
1292
|
+
? getWindowNames(it)
|
|
1293
|
+
: $getOwnPropertyNames(toIndexedObject(it));
|
|
1294
|
+
};
|
|
1295
|
+
|
|
1296
|
+
var objectGetOwnPropertyNamesExternal = {
|
|
1297
|
+
f: f
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
var arrayBufferNonExtensible = fails(function () {
|
|
1304
|
+
if (typeof ArrayBuffer == 'function') {
|
|
1305
|
+
var buffer = new ArrayBuffer(8);
|
|
1306
|
+
// eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
|
|
1307
|
+
if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
|
1308
|
+
}
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
// eslint-disable-next-line es/no-object-isextensible -- safe
|
|
1312
|
+
var $isExtensible = Object.isExtensible;
|
|
1313
|
+
var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
|
|
1314
|
+
|
|
1315
|
+
// `Object.isExtensible` method
|
|
1316
|
+
// https://tc39.es/ecma262/#sec-object.isextensible
|
|
1317
|
+
var objectIsExtensible = (FAILS_ON_PRIMITIVES || arrayBufferNonExtensible) ? function isExtensible(it) {
|
|
1318
|
+
if (!isObject(it)) return false;
|
|
1319
|
+
if (arrayBufferNonExtensible && classofRaw(it) == 'ArrayBuffer') return false;
|
|
1320
|
+
return $isExtensible ? $isExtensible(it) : true;
|
|
1321
|
+
} : $isExtensible;
|
|
1322
|
+
|
|
1323
|
+
var freezing = !fails(function () {
|
|
1324
|
+
// eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
|
|
1325
|
+
return Object.isExtensible(Object.preventExtensions({}));
|
|
1326
|
+
});
|
|
1327
|
+
|
|
1328
|
+
var internalMetadata = createCommonjsModule(function (module) {
|
|
1329
|
+
var defineProperty = objectDefineProperty.f;
|
|
1330
|
+
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
var REQUIRED = false;
|
|
1337
|
+
var METADATA = uid('meta');
|
|
1338
|
+
var id = 0;
|
|
1339
|
+
|
|
1340
|
+
var setMetadata = function (it) {
|
|
1341
|
+
defineProperty(it, METADATA, { value: {
|
|
1342
|
+
objectID: 'O' + id++, // object ID
|
|
1343
|
+
weakData: {} // weak collections IDs
|
|
1344
|
+
} });
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
var fastKey = function (it, create) {
|
|
1348
|
+
// return a primitive with prefix
|
|
1349
|
+
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
|
1350
|
+
if (!hasOwnProperty_1(it, METADATA)) {
|
|
1351
|
+
// can't set metadata to uncaught frozen object
|
|
1352
|
+
if (!objectIsExtensible(it)) return 'F';
|
|
1353
|
+
// not necessary to add metadata
|
|
1354
|
+
if (!create) return 'E';
|
|
1355
|
+
// add missing metadata
|
|
1356
|
+
setMetadata(it);
|
|
1357
|
+
// return object ID
|
|
1358
|
+
} return it[METADATA].objectID;
|
|
1359
|
+
};
|
|
1360
|
+
|
|
1361
|
+
var getWeakData = function (it, create) {
|
|
1362
|
+
if (!hasOwnProperty_1(it, METADATA)) {
|
|
1363
|
+
// can't set metadata to uncaught frozen object
|
|
1364
|
+
if (!objectIsExtensible(it)) return true;
|
|
1365
|
+
// not necessary to add metadata
|
|
1366
|
+
if (!create) return false;
|
|
1367
|
+
// add missing metadata
|
|
1368
|
+
setMetadata(it);
|
|
1369
|
+
// return the store of weak collections IDs
|
|
1370
|
+
} return it[METADATA].weakData;
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1373
|
+
// add metadata on freeze-family methods calling
|
|
1374
|
+
var onFreeze = function (it) {
|
|
1375
|
+
if (freezing && REQUIRED && objectIsExtensible(it) && !hasOwnProperty_1(it, METADATA)) setMetadata(it);
|
|
1376
|
+
return it;
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
var enable = function () {
|
|
1380
|
+
meta.enable = function () { /* empty */ };
|
|
1381
|
+
REQUIRED = true;
|
|
1382
|
+
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
|
|
1383
|
+
var splice = functionUncurryThis([].splice);
|
|
1384
|
+
var test = {};
|
|
1385
|
+
test[METADATA] = 1;
|
|
1386
|
+
|
|
1387
|
+
// prevent exposing of metadata key
|
|
1388
|
+
if (getOwnPropertyNames(test).length) {
|
|
1389
|
+
objectGetOwnPropertyNames.f = function (it) {
|
|
1390
|
+
var result = getOwnPropertyNames(it);
|
|
1391
|
+
for (var i = 0, length = result.length; i < length; i++) {
|
|
1392
|
+
if (result[i] === METADATA) {
|
|
1393
|
+
splice(result, i, 1);
|
|
1394
|
+
break;
|
|
1395
|
+
}
|
|
1396
|
+
} return result;
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
_export({ target: 'Object', stat: true, forced: true }, {
|
|
1400
|
+
getOwnPropertyNames: objectGetOwnPropertyNamesExternal.f
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1404
|
+
|
|
1405
|
+
var meta = module.exports = {
|
|
1406
|
+
enable: enable,
|
|
1407
|
+
fastKey: fastKey,
|
|
1408
|
+
getWeakData: getWeakData,
|
|
1409
|
+
onFreeze: onFreeze
|
|
1410
|
+
};
|
|
1411
|
+
|
|
1412
|
+
hiddenKeys$1[METADATA] = true;
|
|
1413
|
+
});
|
|
1414
|
+
|
|
1415
|
+
var bind$1 = functionUncurryThis(functionUncurryThis.bind);
|
|
1416
|
+
|
|
1417
|
+
// optional / simple context binding
|
|
1418
|
+
var functionBindContext = function (fn, that) {
|
|
1419
|
+
aCallable(fn);
|
|
1420
|
+
return that === undefined ? fn : bind$1 ? bind$1(fn, that) : function (/* ...args */) {
|
|
1421
|
+
return fn.apply(that, arguments);
|
|
1422
|
+
};
|
|
1423
|
+
};
|
|
1424
|
+
|
|
1425
|
+
var ITERATOR$3 = wellKnownSymbol('iterator');
|
|
1426
|
+
var ArrayPrototype = Array.prototype;
|
|
1427
|
+
|
|
1428
|
+
// check on default Array iterator
|
|
1429
|
+
var isArrayIteratorMethod = function (it) {
|
|
1430
|
+
return it !== undefined && (iterators.Array === it || ArrayPrototype[ITERATOR$3] === it);
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1433
|
+
var ITERATOR$2 = wellKnownSymbol('iterator');
|
|
1434
|
+
|
|
1435
|
+
var getIteratorMethod = function (it) {
|
|
1436
|
+
if (it != undefined) return getMethod(it, ITERATOR$2)
|
|
1437
|
+
|| getMethod(it, '@@iterator')
|
|
1438
|
+
|| iterators[classof(it)];
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1441
|
+
var TypeError$5 = global$1.TypeError;
|
|
1442
|
+
|
|
1443
|
+
var getIterator = function (argument, usingIterator) {
|
|
1444
|
+
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
|
1445
|
+
if (aCallable(iteratorMethod)) return anObject(functionCall(iteratorMethod, argument));
|
|
1446
|
+
throw TypeError$5(tryToString(argument) + ' is not iterable');
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
var iteratorClose = function (iterator, kind, value) {
|
|
1450
|
+
var innerResult, innerError;
|
|
1451
|
+
anObject(iterator);
|
|
1452
|
+
try {
|
|
1453
|
+
innerResult = getMethod(iterator, 'return');
|
|
1454
|
+
if (!innerResult) {
|
|
1455
|
+
if (kind === 'throw') throw value;
|
|
1456
|
+
return value;
|
|
1457
|
+
}
|
|
1458
|
+
innerResult = functionCall(innerResult, iterator);
|
|
1459
|
+
} catch (error) {
|
|
1460
|
+
innerError = true;
|
|
1461
|
+
innerResult = error;
|
|
1462
|
+
}
|
|
1463
|
+
if (kind === 'throw') throw value;
|
|
1464
|
+
if (innerError) throw innerResult;
|
|
1465
|
+
anObject(innerResult);
|
|
1466
|
+
return value;
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
var TypeError$4 = global$1.TypeError;
|
|
1470
|
+
|
|
1471
|
+
var Result = function (stopped, result) {
|
|
1472
|
+
this.stopped = stopped;
|
|
1473
|
+
this.result = result;
|
|
1474
|
+
};
|
|
1475
|
+
|
|
1476
|
+
var ResultPrototype = Result.prototype;
|
|
1477
|
+
|
|
1478
|
+
var iterate = function (iterable, unboundFunction, options) {
|
|
1479
|
+
var that = options && options.that;
|
|
1480
|
+
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
1481
|
+
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
1482
|
+
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
1483
|
+
var fn = functionBindContext(unboundFunction, that);
|
|
1484
|
+
var iterator, iterFn, index, length, result, next, step;
|
|
1485
|
+
|
|
1486
|
+
var stop = function (condition) {
|
|
1487
|
+
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
1488
|
+
return new Result(true, condition);
|
|
1489
|
+
};
|
|
1490
|
+
|
|
1491
|
+
var callFn = function (value) {
|
|
1492
|
+
if (AS_ENTRIES) {
|
|
1493
|
+
anObject(value);
|
|
1494
|
+
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
1495
|
+
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
1496
|
+
};
|
|
1497
|
+
|
|
1498
|
+
if (IS_ITERATOR) {
|
|
1499
|
+
iterator = iterable;
|
|
1500
|
+
} else {
|
|
1501
|
+
iterFn = getIteratorMethod(iterable);
|
|
1502
|
+
if (!iterFn) throw TypeError$4(tryToString(iterable) + ' is not iterable');
|
|
1503
|
+
// optimisation for array iterators
|
|
1504
|
+
if (isArrayIteratorMethod(iterFn)) {
|
|
1505
|
+
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
1506
|
+
result = callFn(iterable[index]);
|
|
1507
|
+
if (result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
1508
|
+
} return new Result(false);
|
|
1509
|
+
}
|
|
1510
|
+
iterator = getIterator(iterable, iterFn);
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
next = iterator.next;
|
|
1514
|
+
while (!(step = functionCall(next, iterator)).done) {
|
|
1515
|
+
try {
|
|
1516
|
+
result = callFn(step.value);
|
|
1517
|
+
} catch (error) {
|
|
1518
|
+
iteratorClose(iterator, 'throw', error);
|
|
1519
|
+
}
|
|
1520
|
+
if (typeof result == 'object' && result && objectIsPrototypeOf(ResultPrototype, result)) return result;
|
|
1521
|
+
} return new Result(false);
|
|
1522
|
+
};
|
|
1523
|
+
|
|
1524
|
+
var TypeError$3 = global$1.TypeError;
|
|
1525
|
+
|
|
1526
|
+
var anInstance = function (it, Prototype) {
|
|
1527
|
+
if (objectIsPrototypeOf(Prototype, it)) return it;
|
|
1528
|
+
throw TypeError$3('Incorrect invocation');
|
|
1529
|
+
};
|
|
1530
|
+
|
|
1531
|
+
var ITERATOR$1 = wellKnownSymbol('iterator');
|
|
1532
|
+
var SAFE_CLOSING = false;
|
|
1533
|
+
|
|
1534
|
+
try {
|
|
1535
|
+
var called = 0;
|
|
1536
|
+
var iteratorWithReturn = {
|
|
1537
|
+
next: function () {
|
|
1538
|
+
return { done: !!called++ };
|
|
1539
|
+
},
|
|
1540
|
+
'return': function () {
|
|
1541
|
+
SAFE_CLOSING = true;
|
|
1542
|
+
}
|
|
1543
|
+
};
|
|
1544
|
+
iteratorWithReturn[ITERATOR$1] = function () {
|
|
1545
|
+
return this;
|
|
1546
|
+
};
|
|
1547
|
+
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
|
|
1548
|
+
Array.from(iteratorWithReturn, function () { throw 2; });
|
|
1549
|
+
} catch (error) { /* empty */ }
|
|
1550
|
+
|
|
1551
|
+
var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
|
|
1552
|
+
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
|
1553
|
+
var ITERATION_SUPPORT = false;
|
|
1554
|
+
try {
|
|
1555
|
+
var object = {};
|
|
1556
|
+
object[ITERATOR$1] = function () {
|
|
1557
|
+
return {
|
|
1558
|
+
next: function () {
|
|
1559
|
+
return { done: ITERATION_SUPPORT = true };
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
};
|
|
1563
|
+
exec(object);
|
|
1564
|
+
} catch (error) { /* empty */ }
|
|
1565
|
+
return ITERATION_SUPPORT;
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1568
|
+
// makes subclassing work correct for wrapped built-ins
|
|
1569
|
+
var inheritIfRequired = function ($this, dummy, Wrapper) {
|
|
1570
|
+
var NewTarget, NewTargetPrototype;
|
|
1571
|
+
if (
|
|
1572
|
+
// it can work only with native `setPrototypeOf`
|
|
1573
|
+
objectSetPrototypeOf &&
|
|
1574
|
+
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
|
|
1575
|
+
isCallable(NewTarget = dummy.constructor) &&
|
|
1576
|
+
NewTarget !== Wrapper &&
|
|
1577
|
+
isObject(NewTargetPrototype = NewTarget.prototype) &&
|
|
1578
|
+
NewTargetPrototype !== Wrapper.prototype
|
|
1579
|
+
) objectSetPrototypeOf($this, NewTargetPrototype);
|
|
1580
|
+
return $this;
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
|
|
1584
|
+
var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
|
1585
|
+
var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
|
1586
|
+
var ADDER = IS_MAP ? 'set' : 'add';
|
|
1587
|
+
var NativeConstructor = global$1[CONSTRUCTOR_NAME];
|
|
1588
|
+
var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
|
1589
|
+
var Constructor = NativeConstructor;
|
|
1590
|
+
var exported = {};
|
|
1591
|
+
|
|
1592
|
+
var fixMethod = function (KEY) {
|
|
1593
|
+
var uncurriedNativeMethod = functionUncurryThis(NativePrototype[KEY]);
|
|
1594
|
+
redefine(NativePrototype, KEY,
|
|
1595
|
+
KEY == 'add' ? function add(value) {
|
|
1596
|
+
uncurriedNativeMethod(this, value === 0 ? 0 : value);
|
|
1597
|
+
return this;
|
|
1598
|
+
} : KEY == 'delete' ? function (key) {
|
|
1599
|
+
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
1600
|
+
} : KEY == 'get' ? function get(key) {
|
|
1601
|
+
return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
1602
|
+
} : KEY == 'has' ? function has(key) {
|
|
1603
|
+
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
|
1604
|
+
} : function set(key, value) {
|
|
1605
|
+
uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
|
|
1606
|
+
return this;
|
|
1607
|
+
}
|
|
1608
|
+
);
|
|
1609
|
+
};
|
|
1610
|
+
|
|
1611
|
+
var REPLACE = isForced_1(
|
|
1612
|
+
CONSTRUCTOR_NAME,
|
|
1613
|
+
!isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
|
|
1614
|
+
new NativeConstructor().entries().next();
|
|
1615
|
+
}))
|
|
1616
|
+
);
|
|
1617
|
+
|
|
1618
|
+
if (REPLACE) {
|
|
1619
|
+
// create collection constructor
|
|
1620
|
+
Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
|
1621
|
+
internalMetadata.enable();
|
|
1622
|
+
} else if (isForced_1(CONSTRUCTOR_NAME, true)) {
|
|
1623
|
+
var instance = new Constructor();
|
|
1624
|
+
// early implementations not supports chaining
|
|
1625
|
+
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
|
|
1626
|
+
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
|
|
1627
|
+
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
|
|
1628
|
+
// most early implementations doesn't supports iterables, most modern - not close it correctly
|
|
1629
|
+
// eslint-disable-next-line no-new -- required for testing
|
|
1630
|
+
var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
|
|
1631
|
+
// for early implementations -0 and +0 not the same
|
|
1632
|
+
var BUGGY_ZERO = !IS_WEAK && fails(function () {
|
|
1633
|
+
// V8 ~ Chromium 42- fails only with 5+ elements
|
|
1634
|
+
var $instance = new NativeConstructor();
|
|
1635
|
+
var index = 5;
|
|
1636
|
+
while (index--) $instance[ADDER](index, index);
|
|
1637
|
+
return !$instance.has(-0);
|
|
1638
|
+
});
|
|
1639
|
+
|
|
1640
|
+
if (!ACCEPT_ITERABLES) {
|
|
1641
|
+
Constructor = wrapper(function (dummy, iterable) {
|
|
1642
|
+
anInstance(dummy, NativePrototype);
|
|
1643
|
+
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
|
1644
|
+
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
|
1645
|
+
return that;
|
|
1646
|
+
});
|
|
1647
|
+
Constructor.prototype = NativePrototype;
|
|
1648
|
+
NativePrototype.constructor = Constructor;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
|
|
1652
|
+
fixMethod('delete');
|
|
1653
|
+
fixMethod('has');
|
|
1654
|
+
IS_MAP && fixMethod('get');
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
|
|
1658
|
+
|
|
1659
|
+
// weak collections should not contains .clear method
|
|
1660
|
+
if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
exported[CONSTRUCTOR_NAME] = Constructor;
|
|
1664
|
+
_export({ global: true, forced: Constructor != NativeConstructor }, exported);
|
|
1665
|
+
|
|
1666
|
+
setToStringTag(Constructor, CONSTRUCTOR_NAME);
|
|
1667
|
+
|
|
1668
|
+
if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
|
1669
|
+
|
|
1670
|
+
return Constructor;
|
|
1671
|
+
};
|
|
1672
|
+
|
|
1673
|
+
// `IsArray` abstract operation
|
|
1674
|
+
// https://tc39.es/ecma262/#sec-isarray
|
|
1675
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
1676
|
+
var isArray = Array.isArray || function isArray(argument) {
|
|
1677
|
+
return classofRaw(argument) == 'Array';
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
var noop = function () { /* empty */ };
|
|
1681
|
+
var empty = [];
|
|
1682
|
+
var construct = getBuiltIn('Reflect', 'construct');
|
|
1683
|
+
var constructorRegExp = /^\s*(?:class|function)\b/;
|
|
1684
|
+
var exec = functionUncurryThis(constructorRegExp.exec);
|
|
1685
|
+
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
|
1686
|
+
|
|
1687
|
+
var isConstructorModern = function (argument) {
|
|
1688
|
+
if (!isCallable(argument)) return false;
|
|
1689
|
+
try {
|
|
1690
|
+
construct(noop, empty, argument);
|
|
1691
|
+
return true;
|
|
1692
|
+
} catch (error) {
|
|
1693
|
+
return false;
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
|
|
1697
|
+
var isConstructorLegacy = function (argument) {
|
|
1698
|
+
if (!isCallable(argument)) return false;
|
|
1699
|
+
switch (classof(argument)) {
|
|
1700
|
+
case 'AsyncFunction':
|
|
1701
|
+
case 'GeneratorFunction':
|
|
1702
|
+
case 'AsyncGeneratorFunction': return false;
|
|
1703
|
+
// we can't check .prototype since constructors produced by .bind haven't it
|
|
1704
|
+
} return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1707
|
+
// `IsConstructor` abstract operation
|
|
1708
|
+
// https://tc39.es/ecma262/#sec-isconstructor
|
|
1709
|
+
var isConstructor = !construct || fails(function () {
|
|
1710
|
+
var called;
|
|
1711
|
+
return isConstructorModern(isConstructorModern.call)
|
|
1712
|
+
|| !isConstructorModern(Object)
|
|
1713
|
+
|| !isConstructorModern(function () { called = true; })
|
|
1714
|
+
|| called;
|
|
1715
|
+
}) ? isConstructorLegacy : isConstructorModern;
|
|
1716
|
+
|
|
1717
|
+
var SPECIES$2 = wellKnownSymbol('species');
|
|
1718
|
+
var Array$1 = global$1.Array;
|
|
1719
|
+
|
|
1720
|
+
// a part of `ArraySpeciesCreate` abstract operation
|
|
1721
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
1722
|
+
var arraySpeciesConstructor = function (originalArray) {
|
|
1723
|
+
var C;
|
|
1724
|
+
if (isArray(originalArray)) {
|
|
1725
|
+
C = originalArray.constructor;
|
|
1726
|
+
// cross-realm fallback
|
|
1727
|
+
if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
|
|
1728
|
+
else if (isObject(C)) {
|
|
1729
|
+
C = C[SPECIES$2];
|
|
1730
|
+
if (C === null) C = undefined;
|
|
1731
|
+
}
|
|
1732
|
+
} return C === undefined ? Array$1 : C;
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
// `ArraySpeciesCreate` abstract operation
|
|
1736
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
1737
|
+
var arraySpeciesCreate = function (originalArray, length) {
|
|
1738
|
+
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
var push$1 = functionUncurryThis([].push);
|
|
1742
|
+
|
|
1743
|
+
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
|
1744
|
+
var createMethod = function (TYPE) {
|
|
1745
|
+
var IS_MAP = TYPE == 1;
|
|
1746
|
+
var IS_FILTER = TYPE == 2;
|
|
1747
|
+
var IS_SOME = TYPE == 3;
|
|
1748
|
+
var IS_EVERY = TYPE == 4;
|
|
1749
|
+
var IS_FIND_INDEX = TYPE == 6;
|
|
1750
|
+
var IS_FILTER_REJECT = TYPE == 7;
|
|
1751
|
+
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
|
1752
|
+
return function ($this, callbackfn, that, specificCreate) {
|
|
1753
|
+
var O = toObject($this);
|
|
1754
|
+
var self = indexedObject(O);
|
|
1755
|
+
var boundFunction = functionBindContext(callbackfn, that);
|
|
1756
|
+
var length = lengthOfArrayLike(self);
|
|
1757
|
+
var index = 0;
|
|
1758
|
+
var create = specificCreate || arraySpeciesCreate;
|
|
1759
|
+
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
|
1760
|
+
var value, result;
|
|
1761
|
+
for (;length > index; index++) if (NO_HOLES || index in self) {
|
|
1762
|
+
value = self[index];
|
|
1763
|
+
result = boundFunction(value, index, O);
|
|
1764
|
+
if (TYPE) {
|
|
1765
|
+
if (IS_MAP) target[index] = result; // map
|
|
1766
|
+
else if (result) switch (TYPE) {
|
|
1767
|
+
case 3: return true; // some
|
|
1768
|
+
case 5: return value; // find
|
|
1769
|
+
case 6: return index; // findIndex
|
|
1770
|
+
case 2: push$1(target, value); // filter
|
|
1771
|
+
} else switch (TYPE) {
|
|
1772
|
+
case 4: return false; // every
|
|
1773
|
+
case 7: push$1(target, value); // filterReject
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
|
1778
|
+
};
|
|
1779
|
+
};
|
|
1780
|
+
|
|
1781
|
+
var arrayIteration = {
|
|
1782
|
+
// `Array.prototype.forEach` method
|
|
1783
|
+
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
1784
|
+
forEach: createMethod(0),
|
|
1785
|
+
// `Array.prototype.map` method
|
|
1786
|
+
// https://tc39.es/ecma262/#sec-array.prototype.map
|
|
1787
|
+
map: createMethod(1),
|
|
1788
|
+
// `Array.prototype.filter` method
|
|
1789
|
+
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
1790
|
+
filter: createMethod(2),
|
|
1791
|
+
// `Array.prototype.some` method
|
|
1792
|
+
// https://tc39.es/ecma262/#sec-array.prototype.some
|
|
1793
|
+
some: createMethod(3),
|
|
1794
|
+
// `Array.prototype.every` method
|
|
1795
|
+
// https://tc39.es/ecma262/#sec-array.prototype.every
|
|
1796
|
+
every: createMethod(4),
|
|
1797
|
+
// `Array.prototype.find` method
|
|
1798
|
+
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
1799
|
+
find: createMethod(5),
|
|
1800
|
+
// `Array.prototype.findIndex` method
|
|
1801
|
+
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
|
|
1802
|
+
findIndex: createMethod(6),
|
|
1803
|
+
// `Array.prototype.filterReject` method
|
|
1804
|
+
// https://github.com/tc39/proposal-array-filtering
|
|
1805
|
+
filterReject: createMethod(7)
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
var getWeakData = internalMetadata.getWeakData;
|
|
1809
|
+
|
|
1810
|
+
|
|
1811
|
+
|
|
1812
|
+
|
|
1813
|
+
|
|
1814
|
+
|
|
1815
|
+
|
|
1816
|
+
|
|
1817
|
+
var setInternalState = internalState.set;
|
|
1818
|
+
var internalStateGetterFor = internalState.getterFor;
|
|
1819
|
+
var find = arrayIteration.find;
|
|
1820
|
+
var findIndex = arrayIteration.findIndex;
|
|
1821
|
+
var splice = functionUncurryThis([].splice);
|
|
1822
|
+
var id = 0;
|
|
1823
|
+
|
|
1824
|
+
// fallback for uncaught frozen keys
|
|
1825
|
+
var uncaughtFrozenStore = function (store) {
|
|
1826
|
+
return store.frozen || (store.frozen = new UncaughtFrozenStore());
|
|
1827
|
+
};
|
|
1828
|
+
|
|
1829
|
+
var UncaughtFrozenStore = function () {
|
|
1830
|
+
this.entries = [];
|
|
1831
|
+
};
|
|
1832
|
+
|
|
1833
|
+
var findUncaughtFrozen = function (store, key) {
|
|
1834
|
+
return find(store.entries, function (it) {
|
|
1835
|
+
return it[0] === key;
|
|
1836
|
+
});
|
|
1837
|
+
};
|
|
1838
|
+
|
|
1839
|
+
UncaughtFrozenStore.prototype = {
|
|
1840
|
+
get: function (key) {
|
|
1841
|
+
var entry = findUncaughtFrozen(this, key);
|
|
1842
|
+
if (entry) return entry[1];
|
|
1843
|
+
},
|
|
1844
|
+
has: function (key) {
|
|
1845
|
+
return !!findUncaughtFrozen(this, key);
|
|
1846
|
+
},
|
|
1847
|
+
set: function (key, value) {
|
|
1848
|
+
var entry = findUncaughtFrozen(this, key);
|
|
1849
|
+
if (entry) entry[1] = value;
|
|
1850
|
+
else this.entries.push([key, value]);
|
|
1851
|
+
},
|
|
1852
|
+
'delete': function (key) {
|
|
1853
|
+
var index = findIndex(this.entries, function (it) {
|
|
1854
|
+
return it[0] === key;
|
|
1855
|
+
});
|
|
1856
|
+
if (~index) splice(this.entries, index, 1);
|
|
1857
|
+
return !!~index;
|
|
1858
|
+
}
|
|
1859
|
+
};
|
|
1860
|
+
|
|
1861
|
+
var collectionWeak = {
|
|
1862
|
+
getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
|
1863
|
+
var Constructor = wrapper(function (that, iterable) {
|
|
1864
|
+
anInstance(that, Prototype);
|
|
1865
|
+
setInternalState(that, {
|
|
1866
|
+
type: CONSTRUCTOR_NAME,
|
|
1867
|
+
id: id++,
|
|
1868
|
+
frozen: undefined
|
|
1869
|
+
});
|
|
1870
|
+
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
|
1871
|
+
});
|
|
1872
|
+
|
|
1873
|
+
var Prototype = Constructor.prototype;
|
|
1874
|
+
|
|
1875
|
+
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
|
1876
|
+
|
|
1877
|
+
var define = function (that, key, value) {
|
|
1878
|
+
var state = getInternalState(that);
|
|
1879
|
+
var data = getWeakData(anObject(key), true);
|
|
1880
|
+
if (data === true) uncaughtFrozenStore(state).set(key, value);
|
|
1881
|
+
else data[state.id] = value;
|
|
1882
|
+
return that;
|
|
1883
|
+
};
|
|
1884
|
+
|
|
1885
|
+
redefineAll(Prototype, {
|
|
1886
|
+
// `{ WeakMap, WeakSet }.prototype.delete(key)` methods
|
|
1887
|
+
// https://tc39.es/ecma262/#sec-weakmap.prototype.delete
|
|
1888
|
+
// https://tc39.es/ecma262/#sec-weakset.prototype.delete
|
|
1889
|
+
'delete': function (key) {
|
|
1890
|
+
var state = getInternalState(this);
|
|
1891
|
+
if (!isObject(key)) return false;
|
|
1892
|
+
var data = getWeakData(key);
|
|
1893
|
+
if (data === true) return uncaughtFrozenStore(state)['delete'](key);
|
|
1894
|
+
return data && hasOwnProperty_1(data, state.id) && delete data[state.id];
|
|
1895
|
+
},
|
|
1896
|
+
// `{ WeakMap, WeakSet }.prototype.has(key)` methods
|
|
1897
|
+
// https://tc39.es/ecma262/#sec-weakmap.prototype.has
|
|
1898
|
+
// https://tc39.es/ecma262/#sec-weakset.prototype.has
|
|
1899
|
+
has: function has(key) {
|
|
1900
|
+
var state = getInternalState(this);
|
|
1901
|
+
if (!isObject(key)) return false;
|
|
1902
|
+
var data = getWeakData(key);
|
|
1903
|
+
if (data === true) return uncaughtFrozenStore(state).has(key);
|
|
1904
|
+
return data && hasOwnProperty_1(data, state.id);
|
|
1905
|
+
}
|
|
1906
|
+
});
|
|
1907
|
+
|
|
1908
|
+
redefineAll(Prototype, IS_MAP ? {
|
|
1909
|
+
// `WeakMap.prototype.get(key)` method
|
|
1910
|
+
// https://tc39.es/ecma262/#sec-weakmap.prototype.get
|
|
1911
|
+
get: function get(key) {
|
|
1912
|
+
var state = getInternalState(this);
|
|
1913
|
+
if (isObject(key)) {
|
|
1914
|
+
var data = getWeakData(key);
|
|
1915
|
+
if (data === true) return uncaughtFrozenStore(state).get(key);
|
|
1916
|
+
return data ? data[state.id] : undefined;
|
|
1917
|
+
}
|
|
1918
|
+
},
|
|
1919
|
+
// `WeakMap.prototype.set(key, value)` method
|
|
1920
|
+
// https://tc39.es/ecma262/#sec-weakmap.prototype.set
|
|
1921
|
+
set: function set(key, value) {
|
|
1922
|
+
return define(this, key, value);
|
|
1923
|
+
}
|
|
1924
|
+
} : {
|
|
1925
|
+
// `WeakSet.prototype.add(value)` method
|
|
1926
|
+
// https://tc39.es/ecma262/#sec-weakset.prototype.add
|
|
1927
|
+
add: function add(value) {
|
|
1928
|
+
return define(this, value, true);
|
|
1929
|
+
}
|
|
1930
|
+
});
|
|
1931
|
+
|
|
1932
|
+
return Constructor;
|
|
1933
|
+
}
|
|
1934
|
+
};
|
|
1935
|
+
|
|
1936
|
+
var enforceIternalState = internalState.enforce;
|
|
1937
|
+
|
|
1938
|
+
|
|
1939
|
+
var IS_IE11 = !global$1.ActiveXObject && 'ActiveXObject' in global$1;
|
|
1940
|
+
var InternalWeakMap;
|
|
1941
|
+
|
|
1942
|
+
var wrapper = function (init) {
|
|
1943
|
+
return function WeakMap() {
|
|
1944
|
+
return init(this, arguments.length ? arguments[0] : undefined);
|
|
1945
|
+
};
|
|
1946
|
+
};
|
|
1947
|
+
|
|
1948
|
+
// `WeakMap` constructor
|
|
1949
|
+
// https://tc39.es/ecma262/#sec-weakmap-constructor
|
|
1950
|
+
var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
|
|
1951
|
+
|
|
1952
|
+
// IE11 WeakMap frozen keys fix
|
|
1953
|
+
// We can't use feature detection because it crash some old IE builds
|
|
1954
|
+
// https://github.com/zloirock/core-js/issues/485
|
|
1955
|
+
if (nativeWeakMap && IS_IE11) {
|
|
1956
|
+
InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
|
|
1957
|
+
internalMetadata.enable();
|
|
1958
|
+
var WeakMapPrototype = $WeakMap.prototype;
|
|
1959
|
+
var nativeDelete = functionUncurryThis(WeakMapPrototype['delete']);
|
|
1960
|
+
var nativeHas = functionUncurryThis(WeakMapPrototype.has);
|
|
1961
|
+
var nativeGet = functionUncurryThis(WeakMapPrototype.get);
|
|
1962
|
+
var nativeSet = functionUncurryThis(WeakMapPrototype.set);
|
|
1963
|
+
redefineAll(WeakMapPrototype, {
|
|
1964
|
+
'delete': function (key) {
|
|
1965
|
+
if (isObject(key) && !objectIsExtensible(key)) {
|
|
1966
|
+
var state = enforceIternalState(this);
|
|
1967
|
+
if (!state.frozen) state.frozen = new InternalWeakMap();
|
|
1968
|
+
return nativeDelete(this, key) || state.frozen['delete'](key);
|
|
1969
|
+
} return nativeDelete(this, key);
|
|
1970
|
+
},
|
|
1971
|
+
has: function has(key) {
|
|
1972
|
+
if (isObject(key) && !objectIsExtensible(key)) {
|
|
1973
|
+
var state = enforceIternalState(this);
|
|
1974
|
+
if (!state.frozen) state.frozen = new InternalWeakMap();
|
|
1975
|
+
return nativeHas(this, key) || state.frozen.has(key);
|
|
1976
|
+
} return nativeHas(this, key);
|
|
1977
|
+
},
|
|
1978
|
+
get: function get(key) {
|
|
1979
|
+
if (isObject(key) && !objectIsExtensible(key)) {
|
|
1980
|
+
var state = enforceIternalState(this);
|
|
1981
|
+
if (!state.frozen) state.frozen = new InternalWeakMap();
|
|
1982
|
+
return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
|
|
1983
|
+
} return nativeGet(this, key);
|
|
1984
|
+
},
|
|
1985
|
+
set: function set(key, value) {
|
|
1986
|
+
if (isObject(key) && !objectIsExtensible(key)) {
|
|
1987
|
+
var state = enforceIternalState(this);
|
|
1988
|
+
if (!state.frozen) state.frozen = new InternalWeakMap();
|
|
1989
|
+
nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
|
|
1990
|
+
} else nativeSet(this, key, value);
|
|
1991
|
+
return this;
|
|
1992
|
+
}
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
// iterable DOM collections
|
|
1997
|
+
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
1998
|
+
var domIterables = {
|
|
1999
|
+
CSSRuleList: 0,
|
|
2000
|
+
CSSStyleDeclaration: 0,
|
|
2001
|
+
CSSValueList: 0,
|
|
2002
|
+
ClientRectList: 0,
|
|
2003
|
+
DOMRectList: 0,
|
|
2004
|
+
DOMStringList: 0,
|
|
2005
|
+
DOMTokenList: 1,
|
|
2006
|
+
DataTransferItemList: 0,
|
|
2007
|
+
FileList: 0,
|
|
2008
|
+
HTMLAllCollection: 0,
|
|
2009
|
+
HTMLCollection: 0,
|
|
2010
|
+
HTMLFormElement: 0,
|
|
2011
|
+
HTMLSelectElement: 0,
|
|
2012
|
+
MediaList: 0,
|
|
2013
|
+
MimeTypeArray: 0,
|
|
2014
|
+
NamedNodeMap: 0,
|
|
2015
|
+
NodeList: 1,
|
|
2016
|
+
PaintRequestList: 0,
|
|
2017
|
+
Plugin: 0,
|
|
2018
|
+
PluginArray: 0,
|
|
2019
|
+
SVGLengthList: 0,
|
|
2020
|
+
SVGNumberList: 0,
|
|
2021
|
+
SVGPathSegList: 0,
|
|
2022
|
+
SVGPointList: 0,
|
|
2023
|
+
SVGStringList: 0,
|
|
2024
|
+
SVGTransformList: 0,
|
|
2025
|
+
SourceBufferList: 0,
|
|
2026
|
+
StyleSheetList: 0,
|
|
2027
|
+
TextTrackCueList: 0,
|
|
2028
|
+
TextTrackList: 0,
|
|
2029
|
+
TouchList: 0
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
var classList = documentCreateElement('span').classList;
|
|
2036
|
+
var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
|
|
2037
|
+
|
|
2038
|
+
var domTokenListPrototype = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
|
|
2039
|
+
|
|
2040
|
+
var ITERATOR = wellKnownSymbol('iterator');
|
|
2041
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
2042
|
+
var ArrayValues = es_array_iterator.values;
|
|
2043
|
+
|
|
2044
|
+
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
2045
|
+
if (CollectionPrototype) {
|
|
2046
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
2047
|
+
if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
|
2048
|
+
createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
|
|
2049
|
+
} catch (error) {
|
|
2050
|
+
CollectionPrototype[ITERATOR] = ArrayValues;
|
|
2051
|
+
}
|
|
2052
|
+
if (!CollectionPrototype[TO_STRING_TAG]) {
|
|
2053
|
+
createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
|
2054
|
+
}
|
|
2055
|
+
if (domIterables[COLLECTION_NAME]) for (var METHOD_NAME in es_array_iterator) {
|
|
2056
|
+
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
2057
|
+
if (CollectionPrototype[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
|
|
2058
|
+
createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, es_array_iterator[METHOD_NAME]);
|
|
2059
|
+
} catch (error) {
|
|
2060
|
+
CollectionPrototype[METHOD_NAME] = es_array_iterator[METHOD_NAME];
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
};
|
|
2065
|
+
|
|
2066
|
+
for (var COLLECTION_NAME in domIterables) {
|
|
2067
|
+
handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
handlePrototype(domTokenListPrototype, 'DOMTokenList');
|
|
2071
|
+
|
|
2072
|
+
var ELEM_TO_EDITOR = new WeakMap();
|
|
2073
|
+
|
|
2074
|
+
function genPreSymbol(level) {
|
|
2075
|
+
if (level === void 0) {
|
|
2076
|
+
level = 0;
|
|
2077
|
+
}
|
|
2078
|
+
var s = '';
|
|
2079
|
+
switch (level) {
|
|
2080
|
+
case 0:
|
|
2081
|
+
s = '•';
|
|
2082
|
+
break;
|
|
2083
|
+
case 1:
|
|
2084
|
+
s = '◦';
|
|
2085
|
+
break;
|
|
2086
|
+
case 2:
|
|
2087
|
+
s = '▪';
|
|
2088
|
+
break;
|
|
2089
|
+
default:
|
|
2090
|
+
s = '▪';
|
|
2091
|
+
}
|
|
2092
|
+
return s;
|
|
2093
|
+
}
|
|
2094
|
+
function getOrderedItemNumber(editor, elem) {
|
|
2095
|
+
var _a = elem,
|
|
2096
|
+
type = _a.type,
|
|
2097
|
+
_b = _a.level,
|
|
2098
|
+
level = _b === void 0 ? 0 : _b,
|
|
2099
|
+
_c = _a.ordered,
|
|
2100
|
+
ordered = _c === void 0 ? false : _c;
|
|
2101
|
+
if (!ordered) {
|
|
2102
|
+
return -1;
|
|
2103
|
+
}
|
|
2104
|
+
var num = 1;
|
|
2105
|
+
var curElem = elem;
|
|
2106
|
+
var curPath = DomEditor.findPath(editor, curElem);
|
|
2107
|
+
if (curPath[0] === 0) return 1;
|
|
2108
|
+
while (curPath[0] > 0) {
|
|
2109
|
+
var prevPath = Path.previous(curPath);
|
|
2110
|
+
var prevEntry = Editor.node(editor, prevPath);
|
|
2111
|
+
if (prevEntry == null) break;
|
|
2112
|
+
var prevElem = prevEntry[0];
|
|
2113
|
+
var _d = prevElem.level,
|
|
2114
|
+
prevLevel = _d === void 0 ? 0 : _d,
|
|
2115
|
+
prevType = prevElem.type,
|
|
2116
|
+
prevOrdered = prevElem.ordered;
|
|
2117
|
+
if (prevType !== type) break;
|
|
2118
|
+
if (prevLevel < level) break;
|
|
2119
|
+
if (prevLevel === level) {
|
|
2120
|
+
if (prevOrdered !== ordered) break;
|
|
2121
|
+
else num++;
|
|
2122
|
+
}
|
|
2123
|
+
curElem = prevElem;
|
|
2124
|
+
curPath = prevPath;
|
|
2125
|
+
}
|
|
2126
|
+
return num;
|
|
2127
|
+
}
|
|
2128
|
+
function getListItemColor(elem) {
|
|
2129
|
+
var children = elem.children || [];
|
|
2130
|
+
var length = children.length;
|
|
2131
|
+
if (length === 0) return '';
|
|
2132
|
+
var firstTextNode;
|
|
2133
|
+
for (var i = 0; i < length; i++) {
|
|
2134
|
+
if (firstTextNode) break;
|
|
2135
|
+
var child = children[i];
|
|
2136
|
+
if (Text.isText(child)) firstTextNode = child;
|
|
2137
|
+
}
|
|
2138
|
+
if (firstTextNode == null) return '';
|
|
2139
|
+
return firstTextNode['color'] || '';
|
|
2140
|
+
}
|
|
2141
|
+
function renderListElem(elemNode, children, editor) {
|
|
2142
|
+
ELEM_TO_EDITOR.set(elemNode, editor);
|
|
2143
|
+
var _a = elemNode,
|
|
2144
|
+
_b = _a.level,
|
|
2145
|
+
level = _b === void 0 ? 0 : _b,
|
|
2146
|
+
_c = _a.ordered,
|
|
2147
|
+
ordered = _c === void 0 ? false : _c;
|
|
2148
|
+
var listStyle = {
|
|
2149
|
+
margin: "5px 0 5px " + level * 20 + "px"
|
|
2150
|
+
};
|
|
2151
|
+
var prefix = '';
|
|
2152
|
+
if (ordered) {
|
|
2153
|
+
var orderedNumber = getOrderedItemNumber(editor, elemNode);
|
|
2154
|
+
prefix = orderedNumber + ".";
|
|
2155
|
+
} else {
|
|
2156
|
+
prefix = genPreSymbol(level);
|
|
2157
|
+
}
|
|
2158
|
+
var prefixColor = getListItemColor(elemNode);
|
|
2159
|
+
var vnode = jsx("div", {
|
|
2160
|
+
style: listStyle
|
|
2161
|
+
}, jsx("span", {
|
|
2162
|
+
contentEditable: false,
|
|
2163
|
+
style: {
|
|
2164
|
+
marginRight: '0.5em',
|
|
2165
|
+
color: prefixColor
|
|
2166
|
+
},
|
|
2167
|
+
"data-w-e-reserve": true
|
|
2168
|
+
}, prefix), jsx("span", null, children));
|
|
2169
|
+
return vnode;
|
|
2170
|
+
}
|
|
2171
|
+
var renderListItemConf = {
|
|
2172
|
+
type: 'list-item',
|
|
2173
|
+
renderElem: renderListElem
|
|
2174
|
+
};
|
|
2175
|
+
|
|
2176
|
+
/******************************************************************************
|
|
2177
|
+
Copyright (c) Microsoft Corporation.
|
|
2178
|
+
|
|
2179
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
2180
|
+
purpose with or without fee is hereby granted.
|
|
2181
|
+
|
|
2182
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2183
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2184
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2185
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2186
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2187
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2188
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
2189
|
+
***************************************************************************** */
|
|
2190
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
2191
|
+
|
|
2192
|
+
var extendStatics = function(d, b) {
|
|
2193
|
+
extendStatics = Object.setPrototypeOf ||
|
|
2194
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
2195
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
2196
|
+
return extendStatics(d, b);
|
|
2197
|
+
};
|
|
2198
|
+
|
|
2199
|
+
function __extends(d, b) {
|
|
2200
|
+
if (typeof b !== "function" && b !== null)
|
|
2201
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2202
|
+
extendStatics(d, b);
|
|
2203
|
+
function __() { this.constructor = d; }
|
|
2204
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
function __values(o) {
|
|
2208
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
2209
|
+
if (m) return m.call(o);
|
|
2210
|
+
if (o && typeof o.length === "number") return {
|
|
2211
|
+
next: function () {
|
|
2212
|
+
if (o && i >= o.length) o = void 0;
|
|
2213
|
+
return { value: o && o[i++], done: !o };
|
|
2214
|
+
}
|
|
2215
|
+
};
|
|
2216
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
function __read(o, n) {
|
|
2220
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
2221
|
+
if (!m) return o;
|
|
2222
|
+
var i = m.call(o), r, ar = [], e;
|
|
2223
|
+
try {
|
|
2224
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
2225
|
+
}
|
|
2226
|
+
catch (error) { e = { error: error }; }
|
|
2227
|
+
finally {
|
|
2228
|
+
try {
|
|
2229
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
2230
|
+
}
|
|
2231
|
+
finally { if (e) throw e.error; }
|
|
2232
|
+
}
|
|
2233
|
+
return ar;
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2237
|
+
var e = new Error(message);
|
|
2238
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2239
|
+
};
|
|
2240
|
+
|
|
2241
|
+
function getTopSelectedElemsBySelection(editor) {
|
|
2242
|
+
return Editor.nodes(editor, {
|
|
2243
|
+
at: editor.selection || undefined,
|
|
2244
|
+
match: function match(n) {
|
|
2245
|
+
return DomEditor.findPath(editor, n).length === 1;
|
|
2246
|
+
}
|
|
2247
|
+
});
|
|
2248
|
+
}
|
|
2249
|
+
function withList(editor) {
|
|
2250
|
+
var deleteBackward = editor.deleteBackward,
|
|
2251
|
+
handleTab = editor.handleTab,
|
|
2252
|
+
normalizeNode = editor.normalizeNode;
|
|
2253
|
+
var newEditor = editor;
|
|
2254
|
+
newEditor.deleteBackward = function (unit) {
|
|
2255
|
+
var selection = newEditor.selection;
|
|
2256
|
+
if (selection == null) {
|
|
2257
|
+
deleteBackward(unit);
|
|
2258
|
+
return;
|
|
2259
|
+
}
|
|
2260
|
+
if (Range.isExpanded(selection)) {
|
|
2261
|
+
deleteBackward(unit);
|
|
2262
|
+
return;
|
|
2263
|
+
}
|
|
2264
|
+
var listItemElem = DomEditor.getSelectedNodeByType(newEditor, 'list-item');
|
|
2265
|
+
if (listItemElem == null) {
|
|
2266
|
+
deleteBackward(unit);
|
|
2267
|
+
return;
|
|
2268
|
+
}
|
|
2269
|
+
if (selection.focus.offset === 0) {
|
|
2270
|
+
var _a = listItemElem.level,
|
|
2271
|
+
level = _a === void 0 ? 0 : _a;
|
|
2272
|
+
if (level > 0) {
|
|
2273
|
+
Transforms.setNodes(newEditor, {
|
|
2274
|
+
level: level - 1
|
|
2275
|
+
});
|
|
2276
|
+
} else {
|
|
2277
|
+
Transforms.setNodes(newEditor, {
|
|
2278
|
+
type: 'paragraph',
|
|
2279
|
+
ordered: undefined,
|
|
2280
|
+
level: undefined
|
|
2281
|
+
});
|
|
2282
|
+
}
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
deleteBackward(unit);
|
|
2286
|
+
};
|
|
2287
|
+
newEditor.handleTab = function () {
|
|
2288
|
+
var e_1, _a, e_2, _b;
|
|
2289
|
+
var selection = newEditor.selection;
|
|
2290
|
+
if (selection == null) {
|
|
2291
|
+
handleTab();
|
|
2292
|
+
return;
|
|
2293
|
+
}
|
|
2294
|
+
if (Range.isCollapsed(selection)) {
|
|
2295
|
+
var listItemElem = DomEditor.getSelectedNodeByType(newEditor, 'list-item');
|
|
2296
|
+
if (listItemElem == null) {
|
|
2297
|
+
handleTab();
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
if (selection.focus.offset === 0) {
|
|
2301
|
+
var _c = listItemElem.level,
|
|
2302
|
+
level = _c === void 0 ? 0 : _c;
|
|
2303
|
+
Transforms.setNodes(newEditor, {
|
|
2304
|
+
level: level + 1
|
|
2305
|
+
});
|
|
2306
|
+
return;
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
if (Range.isExpanded(selection)) {
|
|
2310
|
+
var listItemNum = 0;
|
|
2311
|
+
var hasOtherElem = false;
|
|
2312
|
+
try {
|
|
2313
|
+
for (var _d = __values(getTopSelectedElemsBySelection(newEditor)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
2314
|
+
var entry = _e.value;
|
|
2315
|
+
var _f = __read(entry, 1),
|
|
2316
|
+
elem = _f[0];
|
|
2317
|
+
var type = DomEditor.getNodeType(elem);
|
|
2318
|
+
if (type === 'list-item') listItemNum++;else hasOtherElem = true;
|
|
2319
|
+
}
|
|
2320
|
+
} catch (e_1_1) {
|
|
2321
|
+
e_1 = {
|
|
2322
|
+
error: e_1_1
|
|
2323
|
+
};
|
|
2324
|
+
} finally {
|
|
2325
|
+
try {
|
|
2326
|
+
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
2327
|
+
} finally {
|
|
2328
|
+
if (e_1) throw e_1.error;
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
if (hasOtherElem || listItemNum <= 1) {
|
|
2332
|
+
handleTab();
|
|
2333
|
+
return;
|
|
2334
|
+
}
|
|
2335
|
+
try {
|
|
2336
|
+
for (var _g = __values(getTopSelectedElemsBySelection(newEditor)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
2337
|
+
var entry = _h.value;
|
|
2338
|
+
var _j = __read(entry, 2),
|
|
2339
|
+
elem = _j[0],
|
|
2340
|
+
path = _j[1];
|
|
2341
|
+
var _k = elem.level,
|
|
2342
|
+
level = _k === void 0 ? 0 : _k;
|
|
2343
|
+
Transforms.setNodes(newEditor, {
|
|
2344
|
+
level: level + 1
|
|
2345
|
+
}, {
|
|
2346
|
+
at: path
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
} catch (e_2_1) {
|
|
2350
|
+
e_2 = {
|
|
2351
|
+
error: e_2_1
|
|
2352
|
+
};
|
|
2353
|
+
} finally {
|
|
2354
|
+
try {
|
|
2355
|
+
if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
|
|
2356
|
+
} finally {
|
|
2357
|
+
if (e_2) throw e_2.error;
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
return;
|
|
2361
|
+
}
|
|
2362
|
+
handleTab();
|
|
2363
|
+
};
|
|
2364
|
+
newEditor.normalizeNode = function (_a) {
|
|
2365
|
+
var _b = __read(_a, 2),
|
|
2366
|
+
node = _b[0],
|
|
2367
|
+
path = _b[1];
|
|
2368
|
+
var type = DomEditor.getNodeType(node);
|
|
2369
|
+
if (type === 'bulleted-list' || type === 'numbered-list') {
|
|
2370
|
+
Transforms.unwrapNodes(newEditor, {
|
|
2371
|
+
at: path
|
|
2372
|
+
});
|
|
2373
|
+
}
|
|
2374
|
+
return normalizeNode([node, path]);
|
|
2375
|
+
};
|
|
2376
|
+
return newEditor;
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
var $includes = arrayIncludes.includes;
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
// `Array.prototype.includes` method
|
|
2383
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
2384
|
+
_export({ target: 'Array', proto: true }, {
|
|
2385
|
+
includes: function includes(el /* , fromIndex = 0 */) {
|
|
2386
|
+
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
2387
|
+
}
|
|
2388
|
+
});
|
|
2389
|
+
|
|
2390
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
2391
|
+
addToUnscopables('includes');
|
|
2392
|
+
|
|
2393
|
+
// `RegExp.prototype.flags` getter implementation
|
|
2394
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
2395
|
+
var regexpFlags = function () {
|
|
2396
|
+
var that = anObject(this);
|
|
2397
|
+
var result = '';
|
|
2398
|
+
if (that.global) result += 'g';
|
|
2399
|
+
if (that.ignoreCase) result += 'i';
|
|
2400
|
+
if (that.multiline) result += 'm';
|
|
2401
|
+
if (that.dotAll) result += 's';
|
|
2402
|
+
if (that.unicode) result += 'u';
|
|
2403
|
+
if (that.sticky) result += 'y';
|
|
2404
|
+
return result;
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2407
|
+
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
2408
|
+
var $RegExp$2 = global$1.RegExp;
|
|
2409
|
+
|
|
2410
|
+
var UNSUPPORTED_Y$1 = fails(function () {
|
|
2411
|
+
var re = $RegExp$2('a', 'y');
|
|
2412
|
+
re.lastIndex = 2;
|
|
2413
|
+
return re.exec('abcd') != null;
|
|
2414
|
+
});
|
|
2415
|
+
|
|
2416
|
+
// UC Browser bug
|
|
2417
|
+
// https://github.com/zloirock/core-js/issues/1008
|
|
2418
|
+
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails(function () {
|
|
2419
|
+
return !$RegExp$2('a', 'y').sticky;
|
|
2420
|
+
});
|
|
2421
|
+
|
|
2422
|
+
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails(function () {
|
|
2423
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
2424
|
+
var re = $RegExp$2('^r', 'gy');
|
|
2425
|
+
re.lastIndex = 2;
|
|
2426
|
+
return re.exec('str') != null;
|
|
2427
|
+
});
|
|
2428
|
+
|
|
2429
|
+
var regexpStickyHelpers = {
|
|
2430
|
+
BROKEN_CARET: BROKEN_CARET,
|
|
2431
|
+
MISSED_STICKY: MISSED_STICKY,
|
|
2432
|
+
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
2433
|
+
};
|
|
2434
|
+
|
|
2435
|
+
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
2436
|
+
var $RegExp$1 = global$1.RegExp;
|
|
2437
|
+
|
|
2438
|
+
var regexpUnsupportedDotAll = fails(function () {
|
|
2439
|
+
var re = $RegExp$1('.', 's');
|
|
2440
|
+
return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
|
2441
|
+
});
|
|
2442
|
+
|
|
2443
|
+
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
2444
|
+
var $RegExp = global$1.RegExp;
|
|
2445
|
+
|
|
2446
|
+
var regexpUnsupportedNcg = fails(function () {
|
|
2447
|
+
var re = $RegExp('(?<a>b)', 'g');
|
|
2448
|
+
return re.exec('b').groups.a !== 'b' ||
|
|
2449
|
+
'b'.replace(re, '$<a>c') !== 'bc';
|
|
2450
|
+
});
|
|
2451
|
+
|
|
2452
|
+
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
2453
|
+
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
2454
|
+
|
|
2455
|
+
|
|
2456
|
+
|
|
2457
|
+
|
|
2458
|
+
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
var getInternalState = internalState.get;
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
|
|
2465
|
+
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
2466
|
+
var nativeExec = RegExp.prototype.exec;
|
|
2467
|
+
var patchedExec = nativeExec;
|
|
2468
|
+
var charAt$2 = functionUncurryThis(''.charAt);
|
|
2469
|
+
var indexOf = functionUncurryThis(''.indexOf);
|
|
2470
|
+
var replace$1 = functionUncurryThis(''.replace);
|
|
2471
|
+
var stringSlice$2 = functionUncurryThis(''.slice);
|
|
2472
|
+
|
|
2473
|
+
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
2474
|
+
var re1 = /a/;
|
|
2475
|
+
var re2 = /b*/g;
|
|
2476
|
+
functionCall(nativeExec, re1, 'a');
|
|
2477
|
+
functionCall(nativeExec, re2, 'a');
|
|
2478
|
+
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
2479
|
+
})();
|
|
2480
|
+
|
|
2481
|
+
var UNSUPPORTED_Y = regexpStickyHelpers.BROKEN_CARET;
|
|
2482
|
+
|
|
2483
|
+
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
2484
|
+
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
2485
|
+
|
|
2486
|
+
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || regexpUnsupportedDotAll || regexpUnsupportedNcg;
|
|
2487
|
+
|
|
2488
|
+
if (PATCH) {
|
|
2489
|
+
patchedExec = function exec(string) {
|
|
2490
|
+
var re = this;
|
|
2491
|
+
var state = getInternalState(re);
|
|
2492
|
+
var str = toString(string);
|
|
2493
|
+
var raw = state.raw;
|
|
2494
|
+
var result, reCopy, lastIndex, match, i, object, group;
|
|
2495
|
+
|
|
2496
|
+
if (raw) {
|
|
2497
|
+
raw.lastIndex = re.lastIndex;
|
|
2498
|
+
result = functionCall(patchedExec, raw, str);
|
|
2499
|
+
re.lastIndex = raw.lastIndex;
|
|
2500
|
+
return result;
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2503
|
+
var groups = state.groups;
|
|
2504
|
+
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
2505
|
+
var flags = functionCall(regexpFlags, re);
|
|
2506
|
+
var source = re.source;
|
|
2507
|
+
var charsAdded = 0;
|
|
2508
|
+
var strCopy = str;
|
|
2509
|
+
|
|
2510
|
+
if (sticky) {
|
|
2511
|
+
flags = replace$1(flags, 'y', '');
|
|
2512
|
+
if (indexOf(flags, 'g') === -1) {
|
|
2513
|
+
flags += 'g';
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
strCopy = stringSlice$2(str, re.lastIndex);
|
|
2517
|
+
// Support anchored sticky behavior.
|
|
2518
|
+
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$2(str, re.lastIndex - 1) !== '\n')) {
|
|
2519
|
+
source = '(?: ' + source + ')';
|
|
2520
|
+
strCopy = ' ' + strCopy;
|
|
2521
|
+
charsAdded++;
|
|
2522
|
+
}
|
|
2523
|
+
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
2524
|
+
// simulate the 'y' flag.
|
|
2525
|
+
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
if (NPCG_INCLUDED) {
|
|
2529
|
+
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
2530
|
+
}
|
|
2531
|
+
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
2532
|
+
|
|
2533
|
+
match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
|
|
2534
|
+
|
|
2535
|
+
if (sticky) {
|
|
2536
|
+
if (match) {
|
|
2537
|
+
match.input = stringSlice$2(match.input, charsAdded);
|
|
2538
|
+
match[0] = stringSlice$2(match[0], charsAdded);
|
|
2539
|
+
match.index = re.lastIndex;
|
|
2540
|
+
re.lastIndex += match[0].length;
|
|
2541
|
+
} else re.lastIndex = 0;
|
|
2542
|
+
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
2543
|
+
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
2544
|
+
}
|
|
2545
|
+
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
2546
|
+
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
2547
|
+
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
|
2548
|
+
functionCall(nativeReplace, match[0], reCopy, function () {
|
|
2549
|
+
for (i = 1; i < arguments.length - 2; i++) {
|
|
2550
|
+
if (arguments[i] === undefined) match[i] = undefined;
|
|
2551
|
+
}
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
if (match && groups) {
|
|
2556
|
+
match.groups = object = objectCreate(null);
|
|
2557
|
+
for (i = 0; i < groups.length; i++) {
|
|
2558
|
+
group = groups[i];
|
|
2559
|
+
object[group[0]] = match[group[1]];
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
return match;
|
|
2564
|
+
};
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
var regexpExec = patchedExec;
|
|
2568
|
+
|
|
2569
|
+
// `RegExp.prototype.exec` method
|
|
2570
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
2571
|
+
_export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
|
2572
|
+
exec: regexpExec
|
|
2573
|
+
});
|
|
2574
|
+
|
|
2575
|
+
var BaseMenu =
|
|
2576
|
+
function () {
|
|
2577
|
+
function BaseMenu() {
|
|
2578
|
+
this.type = 'list-item';
|
|
2579
|
+
this.tag = 'button';
|
|
2580
|
+
}
|
|
2581
|
+
BaseMenu.prototype.getListNode = function (editor) {
|
|
2582
|
+
var type = this.type;
|
|
2583
|
+
return DomEditor.getSelectedNodeByType(editor, type);
|
|
2584
|
+
};
|
|
2585
|
+
BaseMenu.prototype.getValue = function (editor) {
|
|
2586
|
+
return '';
|
|
2587
|
+
};
|
|
2588
|
+
BaseMenu.prototype.isActive = function (editor) {
|
|
2589
|
+
var node = this.getListNode(editor);
|
|
2590
|
+
if (node == null) return false;
|
|
2591
|
+
var _a = node.ordered,
|
|
2592
|
+
ordered = _a === void 0 ? false : _a;
|
|
2593
|
+
return ordered === this.ordered;
|
|
2594
|
+
};
|
|
2595
|
+
BaseMenu.prototype.isDisabled = function (editor) {
|
|
2596
|
+
if (editor.selection == null) return true;
|
|
2597
|
+
var selectedElems = DomEditor.getSelectedElems(editor);
|
|
2598
|
+
var notMatch = selectedElems.some(function (elem) {
|
|
2599
|
+
if (Editor.isVoid(editor, elem) && Editor.isBlock(editor, elem)) return true;
|
|
2600
|
+
var type = elem.type;
|
|
2601
|
+
if (['pre', 'code', 'table'].includes(type)) return true;
|
|
2602
|
+
});
|
|
2603
|
+
if (notMatch) return true;
|
|
2604
|
+
return false;
|
|
2605
|
+
};
|
|
2606
|
+
BaseMenu.prototype.exec = function (editor, value) {
|
|
2607
|
+
var active = this.isActive(editor);
|
|
2608
|
+
if (active) {
|
|
2609
|
+
Transforms.setNodes(editor, {
|
|
2610
|
+
type: 'paragraph',
|
|
2611
|
+
ordered: undefined,
|
|
2612
|
+
level: undefined
|
|
2613
|
+
});
|
|
2614
|
+
} else {
|
|
2615
|
+
Transforms.setNodes(editor, {
|
|
2616
|
+
type: 'list-item',
|
|
2617
|
+
ordered: this.ordered,
|
|
2618
|
+
indent: undefined
|
|
2619
|
+
});
|
|
2620
|
+
}
|
|
2621
|
+
};
|
|
2622
|
+
return BaseMenu;
|
|
2623
|
+
}();
|
|
2624
|
+
|
|
2625
|
+
var BULLETED_LIST_SVG = '<svg viewBox="0 0 1024 1024"><path d="M384 64h640v128H384V64z m0 384h640v128H384v-128z m0 384h640v128H384v-128zM0 128a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z"></path></svg>';
|
|
2626
|
+
var NUMBERED_LIST_SVG = '<svg viewBox="0 0 1024 1024"><path d="M384 832h640v128H384z m0-384h640v128H384z m0-384h640v128H384zM192 0v256H128V64H64V0zM128 526.016v50.016h128v64H64v-146.016l128-60V384H64v-64h192v146.016zM256 704v320H64v-64h128v-64H64v-64h128v-64H64v-64z"></path></svg>';
|
|
2627
|
+
|
|
2628
|
+
var BulletedListMenu =
|
|
2629
|
+
function (_super) {
|
|
2630
|
+
__extends(BulletedListMenu, _super);
|
|
2631
|
+
function BulletedListMenu() {
|
|
2632
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
2633
|
+
_this.ordered = false;
|
|
2634
|
+
_this.title = t('listModule.unOrderedList');
|
|
2635
|
+
_this.iconSvg = BULLETED_LIST_SVG;
|
|
2636
|
+
return _this;
|
|
2637
|
+
}
|
|
2638
|
+
return BulletedListMenu;
|
|
2639
|
+
}(BaseMenu);
|
|
2640
|
+
|
|
2641
|
+
var NumberedListMenu =
|
|
2642
|
+
function (_super) {
|
|
2643
|
+
__extends(NumberedListMenu, _super);
|
|
2644
|
+
function NumberedListMenu() {
|
|
2645
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
2646
|
+
_this.ordered = true;
|
|
2647
|
+
_this.title = t('listModule.orderedList');
|
|
2648
|
+
_this.iconSvg = NUMBERED_LIST_SVG;
|
|
2649
|
+
return _this;
|
|
2650
|
+
}
|
|
2651
|
+
return NumberedListMenu;
|
|
2652
|
+
}(BaseMenu);
|
|
2653
|
+
|
|
2654
|
+
var bulletedListMenuConf = {
|
|
2655
|
+
key: 'bulletedList',
|
|
2656
|
+
factory: function factory() {
|
|
2657
|
+
return new BulletedListMenu();
|
|
2658
|
+
}
|
|
2659
|
+
};
|
|
2660
|
+
var numberedListMenuConf = {
|
|
2661
|
+
key: 'numberedList',
|
|
2662
|
+
factory: function factory() {
|
|
2663
|
+
return new NumberedListMenu();
|
|
2664
|
+
}
|
|
2665
|
+
};
|
|
2666
|
+
|
|
2667
|
+
function getStartContainerTagNumber(elem) {
|
|
2668
|
+
var editor = ELEM_TO_EDITOR.get(elem);
|
|
2669
|
+
if (editor == null) return 0;
|
|
2670
|
+
var _a = elem,
|
|
2671
|
+
type = _a.type,
|
|
2672
|
+
_b = _a.ordered,
|
|
2673
|
+
ordered = _b === void 0 ? false : _b,
|
|
2674
|
+
_c = _a.level,
|
|
2675
|
+
level = _c === void 0 ? 0 : _c;
|
|
2676
|
+
var path = DomEditor.findPath(editor, elem);
|
|
2677
|
+
if (path[0] === 0) {
|
|
2678
|
+
return level + 1;
|
|
2679
|
+
}
|
|
2680
|
+
var prevPath = Path.previous(path);
|
|
2681
|
+
var prevEntry = Editor.node(editor, prevPath);
|
|
2682
|
+
if (!prevEntry) return 0;
|
|
2683
|
+
var _d = __read(prevEntry, 1),
|
|
2684
|
+
prevElem = _d[0];
|
|
2685
|
+
var prevType = DomEditor.getNodeType(prevElem);
|
|
2686
|
+
if (prevType !== type) {
|
|
2687
|
+
return level + 1;
|
|
2688
|
+
}
|
|
2689
|
+
var _e = prevElem,
|
|
2690
|
+
_f = _e.ordered,
|
|
2691
|
+
prevOrdered = _f === void 0 ? false : _f,
|
|
2692
|
+
_g = _e.level,
|
|
2693
|
+
prevLevel = _g === void 0 ? 0 : _g;
|
|
2694
|
+
if (prevLevel < level) {
|
|
2695
|
+
return level - prevLevel;
|
|
2696
|
+
}
|
|
2697
|
+
if (prevLevel > level) {
|
|
2698
|
+
return 0;
|
|
2699
|
+
}
|
|
2700
|
+
if (prevLevel === level) {
|
|
2701
|
+
if (prevOrdered === ordered) {
|
|
2702
|
+
return 0;
|
|
2703
|
+
} else {
|
|
2704
|
+
return 1;
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
return 0;
|
|
2708
|
+
}
|
|
2709
|
+
function getEndContainerTagNumber(elem) {
|
|
2710
|
+
var editor = ELEM_TO_EDITOR.get(elem);
|
|
2711
|
+
if (editor == null) return 0;
|
|
2712
|
+
var _a = elem,
|
|
2713
|
+
type = _a.type,
|
|
2714
|
+
_b = _a.ordered,
|
|
2715
|
+
ordered = _b === void 0 ? false : _b,
|
|
2716
|
+
_c = _a.level,
|
|
2717
|
+
level = _c === void 0 ? 0 : _c;
|
|
2718
|
+
var path = DomEditor.findPath(editor, elem);
|
|
2719
|
+
if (path[0] === editor.children.length - 1) {
|
|
2720
|
+
return level + 1;
|
|
2721
|
+
}
|
|
2722
|
+
var nextPath = Path.next(path);
|
|
2723
|
+
var nextEntry = Editor.node(editor, nextPath);
|
|
2724
|
+
if (!nextEntry) return 0;
|
|
2725
|
+
var _d = __read(nextEntry, 1),
|
|
2726
|
+
nextElem = _d[0];
|
|
2727
|
+
var nextType = DomEditor.getNodeType(nextElem);
|
|
2728
|
+
if (nextType !== type) {
|
|
2729
|
+
return level + 1;
|
|
2730
|
+
}
|
|
2731
|
+
var _e = nextElem,
|
|
2732
|
+
_f = _e.ordered,
|
|
2733
|
+
nextOrdered = _f === void 0 ? false : _f,
|
|
2734
|
+
_g = _e.level,
|
|
2735
|
+
nextLevel = _g === void 0 ? 0 : _g;
|
|
2736
|
+
if (nextLevel < level) {
|
|
2737
|
+
return level - nextLevel;
|
|
2738
|
+
}
|
|
2739
|
+
if (nextLevel > level) {
|
|
2740
|
+
return 0;
|
|
2741
|
+
}
|
|
2742
|
+
if (nextLevel === level) {
|
|
2743
|
+
if (nextOrdered === ordered) {
|
|
2744
|
+
return 0;
|
|
2745
|
+
} else {
|
|
2746
|
+
return 1;
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
return 0;
|
|
2750
|
+
}
|
|
2751
|
+
var CONTAINER_TAG_STACK = [];
|
|
2752
|
+
function elemToHtml(elem, childrenHtml) {
|
|
2753
|
+
var startContainerStr = '';
|
|
2754
|
+
var endContainerStr = '';
|
|
2755
|
+
var _a = elem.ordered,
|
|
2756
|
+
ordered = _a === void 0 ? false : _a;
|
|
2757
|
+
var containerTag = ordered ? 'ol' : 'ul';
|
|
2758
|
+
var startContainerTagNumber = getStartContainerTagNumber(elem);
|
|
2759
|
+
if (startContainerTagNumber > 0) {
|
|
2760
|
+
for (var i = 0; i < startContainerTagNumber; i++) {
|
|
2761
|
+
startContainerStr += "<" + containerTag + ">";
|
|
2762
|
+
CONTAINER_TAG_STACK.push(containerTag);
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
var endContainerTagNumber = getEndContainerTagNumber(elem);
|
|
2766
|
+
if (endContainerTagNumber > 0) {
|
|
2767
|
+
for (var i = 0; i < endContainerTagNumber; i++) {
|
|
2768
|
+
var tag = CONTAINER_TAG_STACK.pop();
|
|
2769
|
+
endContainerStr += "</" + tag + ">";
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
return {
|
|
2773
|
+
html: "<li>" + childrenHtml + "</li>",
|
|
2774
|
+
prefix: startContainerStr,
|
|
2775
|
+
suffix: endContainerStr
|
|
2776
|
+
};
|
|
2777
|
+
}
|
|
2778
|
+
var listItemToHtmlConf = {
|
|
2779
|
+
type: 'list-item',
|
|
2780
|
+
elemToHtml: elemToHtml
|
|
2781
|
+
};
|
|
2782
|
+
|
|
2783
|
+
var SPECIES$1 = wellKnownSymbol('species');
|
|
2784
|
+
|
|
2785
|
+
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
|
2786
|
+
// We can't use this feature detection in V8 since it causes
|
|
2787
|
+
// deoptimization and serious performance degradation
|
|
2788
|
+
// https://github.com/zloirock/core-js/issues/677
|
|
2789
|
+
return engineV8Version >= 51 || !fails(function () {
|
|
2790
|
+
var array = [];
|
|
2791
|
+
var constructor = array.constructor = {};
|
|
2792
|
+
constructor[SPECIES$1] = function () {
|
|
2793
|
+
return { foo: 1 };
|
|
2794
|
+
};
|
|
2795
|
+
return array[METHOD_NAME](Boolean).foo !== 1;
|
|
2796
|
+
});
|
|
2797
|
+
};
|
|
2798
|
+
|
|
2799
|
+
var $filter = arrayIteration.filter;
|
|
2800
|
+
|
|
2801
|
+
|
|
2802
|
+
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
|
2803
|
+
|
|
2804
|
+
// `Array.prototype.filter` method
|
|
2805
|
+
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
2806
|
+
// with adding support of @@species
|
|
2807
|
+
_export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
|
2808
|
+
filter: function filter(callbackfn /* , thisArg */) {
|
|
2809
|
+
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
2810
|
+
}
|
|
2811
|
+
});
|
|
2812
|
+
|
|
2813
|
+
var FunctionPrototype = Function.prototype;
|
|
2814
|
+
var apply = FunctionPrototype.apply;
|
|
2815
|
+
var bind = FunctionPrototype.bind;
|
|
2816
|
+
var call = FunctionPrototype.call;
|
|
2817
|
+
|
|
2818
|
+
// eslint-disable-next-line es/no-reflect -- safe
|
|
2819
|
+
var functionApply = typeof Reflect == 'object' && Reflect.apply || (bind ? call.bind(apply) : function () {
|
|
2820
|
+
return call.apply(apply, arguments);
|
|
2821
|
+
});
|
|
2822
|
+
|
|
2823
|
+
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
2824
|
+
|
|
2825
|
+
|
|
2826
|
+
|
|
2827
|
+
|
|
2828
|
+
|
|
2829
|
+
|
|
2830
|
+
|
|
2831
|
+
|
|
2832
|
+
var SPECIES = wellKnownSymbol('species');
|
|
2833
|
+
var RegExpPrototype = RegExp.prototype;
|
|
2834
|
+
|
|
2835
|
+
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
2836
|
+
var SYMBOL = wellKnownSymbol(KEY);
|
|
2837
|
+
|
|
2838
|
+
var DELEGATES_TO_SYMBOL = !fails(function () {
|
|
2839
|
+
// String methods call symbol-named RegEp methods
|
|
2840
|
+
var O = {};
|
|
2841
|
+
O[SYMBOL] = function () { return 7; };
|
|
2842
|
+
return ''[KEY](O) != 7;
|
|
2843
|
+
});
|
|
2844
|
+
|
|
2845
|
+
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
|
2846
|
+
// Symbol-named RegExp methods call .exec
|
|
2847
|
+
var execCalled = false;
|
|
2848
|
+
var re = /a/;
|
|
2849
|
+
|
|
2850
|
+
if (KEY === 'split') {
|
|
2851
|
+
// We can't use real regex here since it causes deoptimization
|
|
2852
|
+
// and serious performance degradation in V8
|
|
2853
|
+
// https://github.com/zloirock/core-js/issues/306
|
|
2854
|
+
re = {};
|
|
2855
|
+
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
|
2856
|
+
// a new one. We need to return the patched regex when creating the new one.
|
|
2857
|
+
re.constructor = {};
|
|
2858
|
+
re.constructor[SPECIES] = function () { return re; };
|
|
2859
|
+
re.flags = '';
|
|
2860
|
+
re[SYMBOL] = /./[SYMBOL];
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
re.exec = function () { execCalled = true; return null; };
|
|
2864
|
+
|
|
2865
|
+
re[SYMBOL]('');
|
|
2866
|
+
return !execCalled;
|
|
2867
|
+
});
|
|
2868
|
+
|
|
2869
|
+
if (
|
|
2870
|
+
!DELEGATES_TO_SYMBOL ||
|
|
2871
|
+
!DELEGATES_TO_EXEC ||
|
|
2872
|
+
FORCED
|
|
2873
|
+
) {
|
|
2874
|
+
var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]);
|
|
2875
|
+
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
2876
|
+
var uncurriedNativeMethod = functionUncurryThis(nativeMethod);
|
|
2877
|
+
var $exec = regexp.exec;
|
|
2878
|
+
if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
|
|
2879
|
+
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
2880
|
+
// The native String method already delegates to @@method (this
|
|
2881
|
+
// polyfilled function), leasing to infinite recursion.
|
|
2882
|
+
// We avoid it by directly calling the native @@method method.
|
|
2883
|
+
return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
|
|
2884
|
+
}
|
|
2885
|
+
return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
|
|
2886
|
+
}
|
|
2887
|
+
return { done: false };
|
|
2888
|
+
});
|
|
2889
|
+
|
|
2890
|
+
redefine(String.prototype, KEY, methods[0]);
|
|
2891
|
+
redefine(RegExpPrototype, SYMBOL, methods[1]);
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
|
2895
|
+
};
|
|
2896
|
+
|
|
2897
|
+
var charAt$1 = stringMultibyte.charAt;
|
|
2898
|
+
|
|
2899
|
+
// `AdvanceStringIndex` abstract operation
|
|
2900
|
+
// https://tc39.es/ecma262/#sec-advancestringindex
|
|
2901
|
+
var advanceStringIndex = function (S, index, unicode) {
|
|
2902
|
+
return index + (unicode ? charAt$1(S, index).length : 1);
|
|
2903
|
+
};
|
|
2904
|
+
|
|
2905
|
+
var floor = Math.floor;
|
|
2906
|
+
var charAt = functionUncurryThis(''.charAt);
|
|
2907
|
+
var replace = functionUncurryThis(''.replace);
|
|
2908
|
+
var stringSlice$1 = functionUncurryThis(''.slice);
|
|
2909
|
+
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
2910
|
+
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
2911
|
+
|
|
2912
|
+
// `GetSubstitution` abstract operation
|
|
2913
|
+
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
2914
|
+
var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {
|
|
2915
|
+
var tailPos = position + matched.length;
|
|
2916
|
+
var m = captures.length;
|
|
2917
|
+
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
2918
|
+
if (namedCaptures !== undefined) {
|
|
2919
|
+
namedCaptures = toObject(namedCaptures);
|
|
2920
|
+
symbols = SUBSTITUTION_SYMBOLS;
|
|
2921
|
+
}
|
|
2922
|
+
return replace(replacement, symbols, function (match, ch) {
|
|
2923
|
+
var capture;
|
|
2924
|
+
switch (charAt(ch, 0)) {
|
|
2925
|
+
case '$': return '$';
|
|
2926
|
+
case '&': return matched;
|
|
2927
|
+
case '`': return stringSlice$1(str, 0, position);
|
|
2928
|
+
case "'": return stringSlice$1(str, tailPos);
|
|
2929
|
+
case '<':
|
|
2930
|
+
capture = namedCaptures[stringSlice$1(ch, 1, -1)];
|
|
2931
|
+
break;
|
|
2932
|
+
default: // \d\d?
|
|
2933
|
+
var n = +ch;
|
|
2934
|
+
if (n === 0) return match;
|
|
2935
|
+
if (n > m) {
|
|
2936
|
+
var f = floor(n / 10);
|
|
2937
|
+
if (f === 0) return match;
|
|
2938
|
+
if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
|
|
2939
|
+
return match;
|
|
2940
|
+
}
|
|
2941
|
+
capture = captures[n - 1];
|
|
2942
|
+
}
|
|
2943
|
+
return capture === undefined ? '' : capture;
|
|
2944
|
+
});
|
|
2945
|
+
};
|
|
2946
|
+
|
|
2947
|
+
var TypeError$2 = global$1.TypeError;
|
|
2948
|
+
|
|
2949
|
+
// `RegExpExec` abstract operation
|
|
2950
|
+
// https://tc39.es/ecma262/#sec-regexpexec
|
|
2951
|
+
var regexpExecAbstract = function (R, S) {
|
|
2952
|
+
var exec = R.exec;
|
|
2953
|
+
if (isCallable(exec)) {
|
|
2954
|
+
var result = functionCall(exec, R, S);
|
|
2955
|
+
if (result !== null) anObject(result);
|
|
2956
|
+
return result;
|
|
2957
|
+
}
|
|
2958
|
+
if (classofRaw(R) === 'RegExp') return functionCall(regexpExec, R, S);
|
|
2959
|
+
throw TypeError$2('RegExp#exec called on incompatible receiver');
|
|
2960
|
+
};
|
|
2961
|
+
|
|
2962
|
+
var REPLACE = wellKnownSymbol('replace');
|
|
2963
|
+
var max = Math.max;
|
|
2964
|
+
var min = Math.min;
|
|
2965
|
+
var concat = functionUncurryThis([].concat);
|
|
2966
|
+
var push = functionUncurryThis([].push);
|
|
2967
|
+
var stringIndexOf = functionUncurryThis(''.indexOf);
|
|
2968
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
2969
|
+
|
|
2970
|
+
var maybeToString = function (it) {
|
|
2971
|
+
return it === undefined ? it : String(it);
|
|
2972
|
+
};
|
|
2973
|
+
|
|
2974
|
+
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
2975
|
+
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
2976
|
+
var REPLACE_KEEPS_$0 = (function () {
|
|
2977
|
+
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
|
2978
|
+
return 'a'.replace(/./, '$0') === '$0';
|
|
2979
|
+
})();
|
|
2980
|
+
|
|
2981
|
+
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
2982
|
+
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
2983
|
+
if (/./[REPLACE]) {
|
|
2984
|
+
return /./[REPLACE]('a', '$0') === '';
|
|
2985
|
+
}
|
|
2986
|
+
return false;
|
|
2987
|
+
})();
|
|
2988
|
+
|
|
2989
|
+
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
|
2990
|
+
var re = /./;
|
|
2991
|
+
re.exec = function () {
|
|
2992
|
+
var result = [];
|
|
2993
|
+
result.groups = { a: '7' };
|
|
2994
|
+
return result;
|
|
2995
|
+
};
|
|
2996
|
+
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
|
|
2997
|
+
return ''.replace(re, '$<a>') !== '7';
|
|
2998
|
+
});
|
|
2999
|
+
|
|
3000
|
+
// @@replace logic
|
|
3001
|
+
fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
|
|
3002
|
+
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
|
3003
|
+
|
|
3004
|
+
return [
|
|
3005
|
+
// `String.prototype.replace` method
|
|
3006
|
+
// https://tc39.es/ecma262/#sec-string.prototype.replace
|
|
3007
|
+
function replace(searchValue, replaceValue) {
|
|
3008
|
+
var O = requireObjectCoercible(this);
|
|
3009
|
+
var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
|
|
3010
|
+
return replacer
|
|
3011
|
+
? functionCall(replacer, searchValue, O, replaceValue)
|
|
3012
|
+
: functionCall(nativeReplace, toString(O), searchValue, replaceValue);
|
|
3013
|
+
},
|
|
3014
|
+
// `RegExp.prototype[@@replace]` method
|
|
3015
|
+
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
|
|
3016
|
+
function (string, replaceValue) {
|
|
3017
|
+
var rx = anObject(this);
|
|
3018
|
+
var S = toString(string);
|
|
3019
|
+
|
|
3020
|
+
if (
|
|
3021
|
+
typeof replaceValue == 'string' &&
|
|
3022
|
+
stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
|
3023
|
+
stringIndexOf(replaceValue, '$<') === -1
|
|
3024
|
+
) {
|
|
3025
|
+
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
|
3026
|
+
if (res.done) return res.value;
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3029
|
+
var functionalReplace = isCallable(replaceValue);
|
|
3030
|
+
if (!functionalReplace) replaceValue = toString(replaceValue);
|
|
3031
|
+
|
|
3032
|
+
var global = rx.global;
|
|
3033
|
+
if (global) {
|
|
3034
|
+
var fullUnicode = rx.unicode;
|
|
3035
|
+
rx.lastIndex = 0;
|
|
3036
|
+
}
|
|
3037
|
+
var results = [];
|
|
3038
|
+
while (true) {
|
|
3039
|
+
var result = regexpExecAbstract(rx, S);
|
|
3040
|
+
if (result === null) break;
|
|
3041
|
+
|
|
3042
|
+
push(results, result);
|
|
3043
|
+
if (!global) break;
|
|
3044
|
+
|
|
3045
|
+
var matchStr = toString(result[0]);
|
|
3046
|
+
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
var accumulatedResult = '';
|
|
3050
|
+
var nextSourcePosition = 0;
|
|
3051
|
+
for (var i = 0; i < results.length; i++) {
|
|
3052
|
+
result = results[i];
|
|
3053
|
+
|
|
3054
|
+
var matched = toString(result[0]);
|
|
3055
|
+
var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
|
|
3056
|
+
var captures = [];
|
|
3057
|
+
// NOTE: This is equivalent to
|
|
3058
|
+
// captures = result.slice(1).map(maybeToString)
|
|
3059
|
+
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
|
|
3060
|
+
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
|
|
3061
|
+
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
|
|
3062
|
+
for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
|
|
3063
|
+
var namedCaptures = result.groups;
|
|
3064
|
+
if (functionalReplace) {
|
|
3065
|
+
var replacerArgs = concat([matched], captures, position, S);
|
|
3066
|
+
if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
|
|
3067
|
+
var replacement = toString(functionApply(replaceValue, undefined, replacerArgs));
|
|
3068
|
+
} else {
|
|
3069
|
+
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
3070
|
+
}
|
|
3071
|
+
if (position >= nextSourcePosition) {
|
|
3072
|
+
accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
|
|
3073
|
+
nextSourcePosition = position + matched.length;
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
return accumulatedResult + stringSlice(S, nextSourcePosition);
|
|
3077
|
+
}
|
|
3078
|
+
];
|
|
3079
|
+
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
3080
|
+
|
|
3081
|
+
var TypeError$1 = global$1.TypeError;
|
|
3082
|
+
|
|
3083
|
+
// `FlattenIntoArray` abstract operation
|
|
3084
|
+
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
|
|
3085
|
+
var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
|
|
3086
|
+
var targetIndex = start;
|
|
3087
|
+
var sourceIndex = 0;
|
|
3088
|
+
var mapFn = mapper ? functionBindContext(mapper, thisArg) : false;
|
|
3089
|
+
var element, elementLen;
|
|
3090
|
+
|
|
3091
|
+
while (sourceIndex < sourceLen) {
|
|
3092
|
+
if (sourceIndex in source) {
|
|
3093
|
+
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
|
|
3094
|
+
|
|
3095
|
+
if (depth > 0 && isArray(element)) {
|
|
3096
|
+
elementLen = lengthOfArrayLike(element);
|
|
3097
|
+
targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
|
|
3098
|
+
} else {
|
|
3099
|
+
if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError$1('Exceed the acceptable array length');
|
|
3100
|
+
target[targetIndex] = element;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
targetIndex++;
|
|
3104
|
+
}
|
|
3105
|
+
sourceIndex++;
|
|
3106
|
+
}
|
|
3107
|
+
return targetIndex;
|
|
3108
|
+
};
|
|
3109
|
+
|
|
3110
|
+
var flattenIntoArray_1 = flattenIntoArray;
|
|
3111
|
+
|
|
3112
|
+
// `Array.prototype.flat` method
|
|
3113
|
+
// https://tc39.es/ecma262/#sec-array.prototype.flat
|
|
3114
|
+
_export({ target: 'Array', proto: true }, {
|
|
3115
|
+
flat: function flat(/* depthArg = 1 */) {
|
|
3116
|
+
var depthArg = arguments.length ? arguments[0] : undefined;
|
|
3117
|
+
var O = toObject(this);
|
|
3118
|
+
var sourceLen = lengthOfArrayLike(O);
|
|
3119
|
+
var A = arraySpeciesCreate(O, 0);
|
|
3120
|
+
A.length = flattenIntoArray_1(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));
|
|
3121
|
+
return A;
|
|
3122
|
+
}
|
|
3123
|
+
});
|
|
3124
|
+
|
|
3125
|
+
// this method was added to unscopables after implementation
|
|
3126
|
+
// in popular engines, so it's moved to a separate module
|
|
3127
|
+
|
|
3128
|
+
|
|
3129
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
3130
|
+
addToUnscopables('flat');
|
|
3131
|
+
|
|
3132
|
+
// `globalThis` object
|
|
3133
|
+
// https://tc39.es/ecma262/#sec-globalthis
|
|
3134
|
+
_export({ global: true }, {
|
|
3135
|
+
globalThis: global$1
|
|
3136
|
+
});
|
|
3137
|
+
|
|
3138
|
+
if (append) $.fn.append = append;
|
|
3139
|
+
if (attr) $.fn.attr = attr;
|
|
3140
|
+
if (parent) $.fn.parent = parent;
|
|
3141
|
+
function getTagName($elem) {
|
|
3142
|
+
if ($elem.length) return $elem[0].tagName.toLowerCase();
|
|
3143
|
+
return '';
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
function getOrdered($elem) {
|
|
3147
|
+
var $list = $elem.parent();
|
|
3148
|
+
var listTagName = getTagName($list);
|
|
3149
|
+
if (listTagName === 'ol') return true;
|
|
3150
|
+
return false;
|
|
3151
|
+
}
|
|
3152
|
+
function getLevel($elem) {
|
|
3153
|
+
var level = 0;
|
|
3154
|
+
var $cur = $elem.parent();
|
|
3155
|
+
var tagName = getTagName($cur);
|
|
3156
|
+
while (tagName === 'ul' || tagName === 'ol') {
|
|
3157
|
+
$cur = $cur.parent();
|
|
3158
|
+
tagName = getTagName($cur);
|
|
3159
|
+
level++;
|
|
3160
|
+
}
|
|
3161
|
+
return level - 1;
|
|
3162
|
+
}
|
|
3163
|
+
function parseItemHtml(elem, children, editor) {
|
|
3164
|
+
var $elem = $(elem);
|
|
3165
|
+
children = children.filter(function (child) {
|
|
3166
|
+
if (Text.isText(child)) return true;
|
|
3167
|
+
if (editor.isInline(child)) return true;
|
|
3168
|
+
return false;
|
|
3169
|
+
});
|
|
3170
|
+
if (children.length === 0) {
|
|
3171
|
+
children = [{
|
|
3172
|
+
text: $elem.text().replace(/\s+/gm, ' ')
|
|
3173
|
+
}];
|
|
3174
|
+
}
|
|
3175
|
+
var ordered = getOrdered($elem);
|
|
3176
|
+
var level = getLevel($elem);
|
|
3177
|
+
return {
|
|
3178
|
+
type: 'list-item',
|
|
3179
|
+
ordered: ordered,
|
|
3180
|
+
level: level,
|
|
3181
|
+
children: children
|
|
3182
|
+
};
|
|
3183
|
+
}
|
|
3184
|
+
var parseItemHtmlConf = {
|
|
3185
|
+
selector: 'li:not([data-w-e-type])',
|
|
3186
|
+
parseElemHtml: parseItemHtml
|
|
3187
|
+
};
|
|
3188
|
+
function parseListHtml(elem, children, editor) {
|
|
3189
|
+
return children.flat(Infinity);
|
|
3190
|
+
}
|
|
3191
|
+
var parseListHtmlConf = {
|
|
3192
|
+
selector: 'ul:not([data-w-e-type]),ol:not([data-w-e-type])',
|
|
3193
|
+
parseElemHtml: parseListHtml
|
|
3194
|
+
};
|
|
3195
|
+
|
|
3196
|
+
var list = {
|
|
3197
|
+
renderElems: [renderListItemConf],
|
|
3198
|
+
editorPlugin: withList,
|
|
3199
|
+
menus: [bulletedListMenuConf, numberedListMenuConf],
|
|
3200
|
+
elemsToHtml: [listItemToHtmlConf],
|
|
3201
|
+
parseElemsHtml: [parseListHtmlConf, parseItemHtmlConf]
|
|
3202
|
+
};
|
|
3203
|
+
|
|
3204
|
+
export { list as default };
|
|
3205
|
+
//# sourceMappingURL=index.esm.js.map
|