@trackunit/i18n-library-translation 0.0.19 → 0.0.20
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/index.js +101 -2790
- package/package.json +2 -2
- package/src/test/config/jest.setup.d.ts +0 -1
package/index.js
CHANGED
|
@@ -8,2718 +8,24 @@ import resourcesToBackend from 'i18next-resources-to-backend';
|
|
|
8
8
|
import { languageKeys } from '@trackunit/iris-app-api';
|
|
9
9
|
import * as Sentry from '@sentry/browser';
|
|
10
10
|
|
|
11
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
12
|
-
|
|
13
|
-
var check = function (it) {
|
|
14
|
-
return it && it.Math == Math && it;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
18
|
-
var global$f =
|
|
19
|
-
// eslint-disable-next-line es/no-global-this -- safe
|
|
20
|
-
check(typeof globalThis == 'object' && globalThis) ||
|
|
21
|
-
check(typeof window == 'object' && window) ||
|
|
22
|
-
// eslint-disable-next-line no-restricted-globals -- safe
|
|
23
|
-
check(typeof self == 'object' && self) ||
|
|
24
|
-
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
25
|
-
// eslint-disable-next-line no-new-func -- fallback
|
|
26
|
-
(function () { return this; })() || Function('return this')();
|
|
27
|
-
|
|
28
|
-
var objectGetOwnPropertyDescriptor = {};
|
|
29
|
-
|
|
30
|
-
var fails$g = function (exec) {
|
|
31
|
-
try {
|
|
32
|
-
return !!exec();
|
|
33
|
-
} catch (error) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
var fails$f = fails$g;
|
|
39
|
-
|
|
40
|
-
// Detect IE8's incomplete defineProperty implementation
|
|
41
|
-
var descriptors = !fails$f(function () {
|
|
42
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
43
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
var fails$e = fails$g;
|
|
47
|
-
|
|
48
|
-
var functionBindNative = !fails$e(function () {
|
|
49
|
-
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
50
|
-
var test = (function () { /* empty */ }).bind();
|
|
51
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
52
|
-
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
var NATIVE_BIND$2 = functionBindNative;
|
|
56
|
-
|
|
57
|
-
var call$d = Function.prototype.call;
|
|
58
|
-
|
|
59
|
-
var functionCall = NATIVE_BIND$2 ? call$d.bind(call$d) : function () {
|
|
60
|
-
return call$d.apply(call$d, arguments);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
var objectPropertyIsEnumerable = {};
|
|
64
|
-
|
|
65
|
-
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
66
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
67
|
-
var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
|
68
|
-
|
|
69
|
-
// Nashorn ~ JDK8 bug
|
|
70
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
71
|
-
|
|
72
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
73
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
74
|
-
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
75
|
-
var descriptor = getOwnPropertyDescriptor$2(this, V);
|
|
76
|
-
return !!descriptor && descriptor.enumerable;
|
|
77
|
-
} : $propertyIsEnumerable;
|
|
78
|
-
|
|
79
|
-
var createPropertyDescriptor$5 = function (bitmap, value) {
|
|
80
|
-
return {
|
|
81
|
-
enumerable: !(bitmap & 1),
|
|
82
|
-
configurable: !(bitmap & 2),
|
|
83
|
-
writable: !(bitmap & 4),
|
|
84
|
-
value: value
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
var NATIVE_BIND$1 = functionBindNative;
|
|
89
|
-
|
|
90
|
-
var FunctionPrototype$1 = Function.prototype;
|
|
91
|
-
var call$c = FunctionPrototype$1.call;
|
|
92
|
-
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$c, call$c);
|
|
93
|
-
|
|
94
|
-
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
95
|
-
return function () {
|
|
96
|
-
return call$c.apply(fn, arguments);
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
var uncurryThis$e = functionUncurryThis;
|
|
101
|
-
|
|
102
|
-
var toString$4 = uncurryThis$e({}.toString);
|
|
103
|
-
var stringSlice$2 = uncurryThis$e(''.slice);
|
|
104
|
-
|
|
105
|
-
var classofRaw$2 = function (it) {
|
|
106
|
-
return stringSlice$2(toString$4(it), 8, -1);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
var uncurryThis$d = functionUncurryThis;
|
|
110
|
-
var fails$d = fails$g;
|
|
111
|
-
var classof$5 = classofRaw$2;
|
|
112
|
-
|
|
113
|
-
var $Object$4 = Object;
|
|
114
|
-
var split$1 = uncurryThis$d(''.split);
|
|
115
|
-
|
|
116
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
117
|
-
var indexedObject = fails$d(function () {
|
|
118
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
119
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
120
|
-
return !$Object$4('z').propertyIsEnumerable(0);
|
|
121
|
-
}) ? function (it) {
|
|
122
|
-
return classof$5(it) == 'String' ? split$1(it, '') : $Object$4(it);
|
|
123
|
-
} : $Object$4;
|
|
124
|
-
|
|
125
|
-
// we can't use just `it == null` since of `document.all` special case
|
|
126
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
127
|
-
var isNullOrUndefined$4 = function (it) {
|
|
128
|
-
return it === null || it === undefined;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
var isNullOrUndefined$3 = isNullOrUndefined$4;
|
|
132
|
-
|
|
133
|
-
var $TypeError$b = TypeError;
|
|
134
|
-
|
|
135
|
-
// `RequireObjectCoercible` abstract operation
|
|
136
|
-
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
137
|
-
var requireObjectCoercible$3 = function (it) {
|
|
138
|
-
if (isNullOrUndefined$3(it)) throw $TypeError$b("Can't call method on " + it);
|
|
139
|
-
return it;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// toObject with fallback for non-array-like ES3 strings
|
|
143
|
-
var IndexedObject$1 = indexedObject;
|
|
144
|
-
var requireObjectCoercible$2 = requireObjectCoercible$3;
|
|
145
|
-
|
|
146
|
-
var toIndexedObject$5 = function (it) {
|
|
147
|
-
return IndexedObject$1(requireObjectCoercible$2(it));
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
var documentAll$2 = typeof document == 'object' && document.all;
|
|
151
|
-
|
|
152
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
153
|
-
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
|
154
|
-
|
|
155
|
-
var documentAll_1 = {
|
|
156
|
-
all: documentAll$2,
|
|
157
|
-
IS_HTMLDDA: IS_HTMLDDA
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
var $documentAll$1 = documentAll_1;
|
|
161
|
-
|
|
162
|
-
var documentAll$1 = $documentAll$1.all;
|
|
163
|
-
|
|
164
|
-
// `IsCallable` abstract operation
|
|
165
|
-
// https://tc39.es/ecma262/#sec-iscallable
|
|
166
|
-
var isCallable$h = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
|
167
|
-
return typeof argument == 'function' || argument === documentAll$1;
|
|
168
|
-
} : function (argument) {
|
|
169
|
-
return typeof argument == 'function';
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
var isCallable$g = isCallable$h;
|
|
173
|
-
var $documentAll = documentAll_1;
|
|
174
|
-
|
|
175
|
-
var documentAll = $documentAll.all;
|
|
176
|
-
|
|
177
|
-
var isObject$7 = $documentAll.IS_HTMLDDA ? function (it) {
|
|
178
|
-
return typeof it == 'object' ? it !== null : isCallable$g(it) || it === documentAll;
|
|
179
|
-
} : function (it) {
|
|
180
|
-
return typeof it == 'object' ? it !== null : isCallable$g(it);
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
var global$e = global$f;
|
|
184
|
-
var isCallable$f = isCallable$h;
|
|
185
|
-
|
|
186
|
-
var aFunction = function (argument) {
|
|
187
|
-
return isCallable$f(argument) ? argument : undefined;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
var getBuiltIn$4 = function (namespace, method) {
|
|
191
|
-
return arguments.length < 2 ? aFunction(global$e[namespace]) : global$e[namespace] && global$e[namespace][method];
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
var uncurryThis$c = functionUncurryThis;
|
|
195
|
-
|
|
196
|
-
var objectIsPrototypeOf = uncurryThis$c({}.isPrototypeOf);
|
|
197
|
-
|
|
198
|
-
var getBuiltIn$3 = getBuiltIn$4;
|
|
199
|
-
|
|
200
|
-
var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
|
|
201
|
-
|
|
202
|
-
var global$d = global$f;
|
|
203
|
-
var userAgent = engineUserAgent;
|
|
204
|
-
|
|
205
|
-
var process = global$d.process;
|
|
206
|
-
var Deno = global$d.Deno;
|
|
207
|
-
var versions = process && process.versions || Deno && Deno.version;
|
|
208
|
-
var v8 = versions && versions.v8;
|
|
209
|
-
var match, version;
|
|
210
|
-
|
|
211
|
-
if (v8) {
|
|
212
|
-
match = v8.split('.');
|
|
213
|
-
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
214
|
-
// but their correct versions are not interesting for us
|
|
215
|
-
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
219
|
-
// so check `userAgent` even if `.v8` exists, but 0
|
|
220
|
-
if (!version && userAgent) {
|
|
221
|
-
match = userAgent.match(/Edge\/(\d+)/);
|
|
222
|
-
if (!match || match[1] >= 74) {
|
|
223
|
-
match = userAgent.match(/Chrome\/(\d+)/);
|
|
224
|
-
if (match) version = +match[1];
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
var engineV8Version = version;
|
|
229
|
-
|
|
230
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
231
|
-
|
|
232
|
-
var V8_VERSION = engineV8Version;
|
|
233
|
-
var fails$c = fails$g;
|
|
234
|
-
|
|
235
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
236
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$c(function () {
|
|
237
|
-
var symbol = Symbol();
|
|
238
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
239
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
240
|
-
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
241
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
242
|
-
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
246
|
-
|
|
247
|
-
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
248
|
-
|
|
249
|
-
var useSymbolAsUid = NATIVE_SYMBOL$1
|
|
250
|
-
&& !Symbol.sham
|
|
251
|
-
&& typeof Symbol.iterator == 'symbol';
|
|
252
|
-
|
|
253
|
-
var getBuiltIn$2 = getBuiltIn$4;
|
|
254
|
-
var isCallable$e = isCallable$h;
|
|
255
|
-
var isPrototypeOf$2 = objectIsPrototypeOf;
|
|
256
|
-
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
257
|
-
|
|
258
|
-
var $Object$3 = Object;
|
|
259
|
-
|
|
260
|
-
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
261
|
-
return typeof it == 'symbol';
|
|
262
|
-
} : function (it) {
|
|
263
|
-
var $Symbol = getBuiltIn$2('Symbol');
|
|
264
|
-
return isCallable$e($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$3(it));
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
var $String$3 = String;
|
|
268
|
-
|
|
269
|
-
var tryToString$3 = function (argument) {
|
|
270
|
-
try {
|
|
271
|
-
return $String$3(argument);
|
|
272
|
-
} catch (error) {
|
|
273
|
-
return 'Object';
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
var isCallable$d = isCallable$h;
|
|
278
|
-
var tryToString$2 = tryToString$3;
|
|
279
|
-
|
|
280
|
-
var $TypeError$a = TypeError;
|
|
281
|
-
|
|
282
|
-
// `Assert: IsCallable(argument) is true`
|
|
283
|
-
var aCallable$3 = function (argument) {
|
|
284
|
-
if (isCallable$d(argument)) return argument;
|
|
285
|
-
throw $TypeError$a(tryToString$2(argument) + ' is not a function');
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
var aCallable$2 = aCallable$3;
|
|
289
|
-
var isNullOrUndefined$2 = isNullOrUndefined$4;
|
|
290
|
-
|
|
291
|
-
// `GetMethod` abstract operation
|
|
292
|
-
// https://tc39.es/ecma262/#sec-getmethod
|
|
293
|
-
var getMethod$4 = function (V, P) {
|
|
294
|
-
var func = V[P];
|
|
295
|
-
return isNullOrUndefined$2(func) ? undefined : aCallable$2(func);
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
var call$b = functionCall;
|
|
299
|
-
var isCallable$c = isCallable$h;
|
|
300
|
-
var isObject$6 = isObject$7;
|
|
301
|
-
|
|
302
|
-
var $TypeError$9 = TypeError;
|
|
303
|
-
|
|
304
|
-
// `OrdinaryToPrimitive` abstract operation
|
|
305
|
-
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
306
|
-
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
307
|
-
var fn, val;
|
|
308
|
-
if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$6(val = call$b(fn, input))) return val;
|
|
309
|
-
if (isCallable$c(fn = input.valueOf) && !isObject$6(val = call$b(fn, input))) return val;
|
|
310
|
-
if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$6(val = call$b(fn, input))) return val;
|
|
311
|
-
throw $TypeError$9("Can't convert object to primitive value");
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
var shared$4 = {exports: {}};
|
|
315
|
-
|
|
316
|
-
var isPure = false;
|
|
317
|
-
|
|
318
|
-
var global$c = global$f;
|
|
319
|
-
|
|
320
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
321
|
-
var defineProperty$5 = Object.defineProperty;
|
|
322
|
-
|
|
323
|
-
var defineGlobalProperty$3 = function (key, value) {
|
|
324
|
-
try {
|
|
325
|
-
defineProperty$5(global$c, key, { value: value, configurable: true, writable: true });
|
|
326
|
-
} catch (error) {
|
|
327
|
-
global$c[key] = value;
|
|
328
|
-
} return value;
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
var global$b = global$f;
|
|
332
|
-
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
333
|
-
|
|
334
|
-
var SHARED = '__core-js_shared__';
|
|
335
|
-
var store$3 = global$b[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
336
|
-
|
|
337
|
-
var sharedStore = store$3;
|
|
338
|
-
|
|
339
|
-
var store$2 = sharedStore;
|
|
340
|
-
|
|
341
|
-
(shared$4.exports = function (key, value) {
|
|
342
|
-
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
343
|
-
})('versions', []).push({
|
|
344
|
-
version: '3.26.1',
|
|
345
|
-
mode: 'global',
|
|
346
|
-
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
347
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
|
|
348
|
-
source: 'https://github.com/zloirock/core-js'
|
|
349
|
-
});
|
|
350
|
-
|
|
351
|
-
var requireObjectCoercible$1 = requireObjectCoercible$3;
|
|
352
|
-
|
|
353
|
-
var $Object$2 = Object;
|
|
354
|
-
|
|
355
|
-
// `ToObject` abstract operation
|
|
356
|
-
// https://tc39.es/ecma262/#sec-toobject
|
|
357
|
-
var toObject$3 = function (argument) {
|
|
358
|
-
return $Object$2(requireObjectCoercible$1(argument));
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
var uncurryThis$b = functionUncurryThis;
|
|
362
|
-
var toObject$2 = toObject$3;
|
|
363
|
-
|
|
364
|
-
var hasOwnProperty = uncurryThis$b({}.hasOwnProperty);
|
|
365
|
-
|
|
366
|
-
// `HasOwnProperty` abstract operation
|
|
367
|
-
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
368
|
-
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
369
|
-
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
370
|
-
return hasOwnProperty(toObject$2(it), key);
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
var uncurryThis$a = functionUncurryThis;
|
|
374
|
-
|
|
375
|
-
var id = 0;
|
|
376
|
-
var postfix = Math.random();
|
|
377
|
-
var toString$3 = uncurryThis$a(1.0.toString);
|
|
378
|
-
|
|
379
|
-
var uid$2 = function (key) {
|
|
380
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
var global$a = global$f;
|
|
384
|
-
var shared$3 = shared$4.exports;
|
|
385
|
-
var hasOwn$9 = hasOwnProperty_1;
|
|
386
|
-
var uid$1 = uid$2;
|
|
387
|
-
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
388
|
-
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
389
|
-
|
|
390
|
-
var WellKnownSymbolsStore = shared$3('wks');
|
|
391
|
-
var Symbol$1 = global$a.Symbol;
|
|
392
|
-
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
393
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
394
|
-
|
|
395
|
-
var wellKnownSymbol$d = function (name) {
|
|
396
|
-
if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
397
|
-
var description = 'Symbol.' + name;
|
|
398
|
-
if (NATIVE_SYMBOL && hasOwn$9(Symbol$1, name)) {
|
|
399
|
-
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
400
|
-
} else if (USE_SYMBOL_AS_UID && symbolFor) {
|
|
401
|
-
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
402
|
-
} else {
|
|
403
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
404
|
-
}
|
|
405
|
-
} return WellKnownSymbolsStore[name];
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
var call$a = functionCall;
|
|
409
|
-
var isObject$5 = isObject$7;
|
|
410
|
-
var isSymbol$1 = isSymbol$2;
|
|
411
|
-
var getMethod$3 = getMethod$4;
|
|
412
|
-
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
413
|
-
var wellKnownSymbol$c = wellKnownSymbol$d;
|
|
414
|
-
|
|
415
|
-
var $TypeError$8 = TypeError;
|
|
416
|
-
var TO_PRIMITIVE = wellKnownSymbol$c('toPrimitive');
|
|
417
|
-
|
|
418
|
-
// `ToPrimitive` abstract operation
|
|
419
|
-
// https://tc39.es/ecma262/#sec-toprimitive
|
|
420
|
-
var toPrimitive$1 = function (input, pref) {
|
|
421
|
-
if (!isObject$5(input) || isSymbol$1(input)) return input;
|
|
422
|
-
var exoticToPrim = getMethod$3(input, TO_PRIMITIVE);
|
|
423
|
-
var result;
|
|
424
|
-
if (exoticToPrim) {
|
|
425
|
-
if (pref === undefined) pref = 'default';
|
|
426
|
-
result = call$a(exoticToPrim, input, pref);
|
|
427
|
-
if (!isObject$5(result) || isSymbol$1(result)) return result;
|
|
428
|
-
throw $TypeError$8("Can't convert object to primitive value");
|
|
429
|
-
}
|
|
430
|
-
if (pref === undefined) pref = 'number';
|
|
431
|
-
return ordinaryToPrimitive(input, pref);
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
var toPrimitive = toPrimitive$1;
|
|
435
|
-
var isSymbol = isSymbol$2;
|
|
436
|
-
|
|
437
|
-
// `ToPropertyKey` abstract operation
|
|
438
|
-
// https://tc39.es/ecma262/#sec-topropertykey
|
|
439
|
-
var toPropertyKey$3 = function (argument) {
|
|
440
|
-
var key = toPrimitive(argument, 'string');
|
|
441
|
-
return isSymbol(key) ? key : key + '';
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
var global$9 = global$f;
|
|
445
|
-
var isObject$4 = isObject$7;
|
|
446
|
-
|
|
447
|
-
var document$1 = global$9.document;
|
|
448
|
-
// typeof document.createElement is 'object' in old IE
|
|
449
|
-
var EXISTS$1 = isObject$4(document$1) && isObject$4(document$1.createElement);
|
|
450
|
-
|
|
451
|
-
var documentCreateElement$2 = function (it) {
|
|
452
|
-
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
var DESCRIPTORS$a = descriptors;
|
|
456
|
-
var fails$b = fails$g;
|
|
457
|
-
var createElement = documentCreateElement$2;
|
|
458
|
-
|
|
459
|
-
// Thanks to IE8 for its funny defineProperty
|
|
460
|
-
var ie8DomDefine = !DESCRIPTORS$a && !fails$b(function () {
|
|
461
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
462
|
-
return Object.defineProperty(createElement('div'), 'a', {
|
|
463
|
-
get: function () { return 7; }
|
|
464
|
-
}).a != 7;
|
|
465
|
-
});
|
|
466
|
-
|
|
467
|
-
var DESCRIPTORS$9 = descriptors;
|
|
468
|
-
var call$9 = functionCall;
|
|
469
|
-
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
470
|
-
var createPropertyDescriptor$4 = createPropertyDescriptor$5;
|
|
471
|
-
var toIndexedObject$4 = toIndexedObject$5;
|
|
472
|
-
var toPropertyKey$2 = toPropertyKey$3;
|
|
473
|
-
var hasOwn$8 = hasOwnProperty_1;
|
|
474
|
-
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
475
|
-
|
|
476
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
477
|
-
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
478
|
-
|
|
479
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
480
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
481
|
-
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$9 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
482
|
-
O = toIndexedObject$4(O);
|
|
483
|
-
P = toPropertyKey$2(P);
|
|
484
|
-
if (IE8_DOM_DEFINE$1) try {
|
|
485
|
-
return $getOwnPropertyDescriptor$1(O, P);
|
|
486
|
-
} catch (error) { /* empty */ }
|
|
487
|
-
if (hasOwn$8(O, P)) return createPropertyDescriptor$4(!call$9(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
var objectDefineProperty = {};
|
|
491
|
-
|
|
492
|
-
var DESCRIPTORS$8 = descriptors;
|
|
493
|
-
var fails$a = fails$g;
|
|
494
|
-
|
|
495
|
-
// V8 ~ Chrome 36-
|
|
496
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
497
|
-
var v8PrototypeDefineBug = DESCRIPTORS$8 && fails$a(function () {
|
|
498
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
499
|
-
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
500
|
-
value: 42,
|
|
501
|
-
writable: false
|
|
502
|
-
}).prototype != 42;
|
|
503
|
-
});
|
|
504
|
-
|
|
505
|
-
var isObject$3 = isObject$7;
|
|
506
|
-
|
|
507
|
-
var $String$2 = String;
|
|
508
|
-
var $TypeError$7 = TypeError;
|
|
509
|
-
|
|
510
|
-
// `Assert: Type(argument) is Object`
|
|
511
|
-
var anObject$c = function (argument) {
|
|
512
|
-
if (isObject$3(argument)) return argument;
|
|
513
|
-
throw $TypeError$7($String$2(argument) + ' is not an object');
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
var DESCRIPTORS$7 = descriptors;
|
|
517
|
-
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
518
|
-
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
519
|
-
var anObject$b = anObject$c;
|
|
520
|
-
var toPropertyKey$1 = toPropertyKey$3;
|
|
521
|
-
|
|
522
|
-
var $TypeError$6 = TypeError;
|
|
523
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
524
|
-
var $defineProperty = Object.defineProperty;
|
|
525
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
526
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
527
|
-
var ENUMERABLE = 'enumerable';
|
|
528
|
-
var CONFIGURABLE$1 = 'configurable';
|
|
529
|
-
var WRITABLE = 'writable';
|
|
530
|
-
|
|
531
|
-
// `Object.defineProperty` method
|
|
532
|
-
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
533
|
-
objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
534
|
-
anObject$b(O);
|
|
535
|
-
P = toPropertyKey$1(P);
|
|
536
|
-
anObject$b(Attributes);
|
|
537
|
-
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
538
|
-
var current = $getOwnPropertyDescriptor(O, P);
|
|
539
|
-
if (current && current[WRITABLE]) {
|
|
540
|
-
O[P] = Attributes.value;
|
|
541
|
-
Attributes = {
|
|
542
|
-
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
543
|
-
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
544
|
-
writable: false
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
} return $defineProperty(O, P, Attributes);
|
|
548
|
-
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
549
|
-
anObject$b(O);
|
|
550
|
-
P = toPropertyKey$1(P);
|
|
551
|
-
anObject$b(Attributes);
|
|
552
|
-
if (IE8_DOM_DEFINE) try {
|
|
553
|
-
return $defineProperty(O, P, Attributes);
|
|
554
|
-
} catch (error) { /* empty */ }
|
|
555
|
-
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$6('Accessors not supported');
|
|
556
|
-
if ('value' in Attributes) O[P] = Attributes.value;
|
|
557
|
-
return O;
|
|
558
|
-
};
|
|
559
|
-
|
|
560
|
-
var DESCRIPTORS$6 = descriptors;
|
|
561
|
-
var definePropertyModule$4 = objectDefineProperty;
|
|
562
|
-
var createPropertyDescriptor$3 = createPropertyDescriptor$5;
|
|
563
|
-
|
|
564
|
-
var createNonEnumerableProperty$5 = DESCRIPTORS$6 ? function (object, key, value) {
|
|
565
|
-
return definePropertyModule$4.f(object, key, createPropertyDescriptor$3(1, value));
|
|
566
|
-
} : function (object, key, value) {
|
|
567
|
-
object[key] = value;
|
|
568
|
-
return object;
|
|
569
|
-
};
|
|
570
|
-
|
|
571
|
-
var makeBuiltIn$2 = {exports: {}};
|
|
572
|
-
|
|
573
|
-
var DESCRIPTORS$5 = descriptors;
|
|
574
|
-
var hasOwn$7 = hasOwnProperty_1;
|
|
575
|
-
|
|
576
|
-
var FunctionPrototype = Function.prototype;
|
|
577
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
578
|
-
var getDescriptor = DESCRIPTORS$5 && Object.getOwnPropertyDescriptor;
|
|
579
|
-
|
|
580
|
-
var EXISTS = hasOwn$7(FunctionPrototype, 'name');
|
|
581
|
-
// additional protection from minified / mangled / dropped function names
|
|
582
|
-
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
583
|
-
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$5 || (DESCRIPTORS$5 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
584
|
-
|
|
585
|
-
var functionName = {
|
|
586
|
-
EXISTS: EXISTS,
|
|
587
|
-
PROPER: PROPER,
|
|
588
|
-
CONFIGURABLE: CONFIGURABLE
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
var uncurryThis$9 = functionUncurryThis;
|
|
592
|
-
var isCallable$b = isCallable$h;
|
|
593
|
-
var store$1 = sharedStore;
|
|
594
|
-
|
|
595
|
-
var functionToString = uncurryThis$9(Function.toString);
|
|
596
|
-
|
|
597
|
-
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
598
|
-
if (!isCallable$b(store$1.inspectSource)) {
|
|
599
|
-
store$1.inspectSource = function (it) {
|
|
600
|
-
return functionToString(it);
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
var inspectSource$1 = store$1.inspectSource;
|
|
605
|
-
|
|
606
|
-
var global$8 = global$f;
|
|
607
|
-
var isCallable$a = isCallable$h;
|
|
608
|
-
|
|
609
|
-
var WeakMap$1 = global$8.WeakMap;
|
|
610
|
-
|
|
611
|
-
var weakMapBasicDetection = isCallable$a(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
612
|
-
|
|
613
|
-
var shared$2 = shared$4.exports;
|
|
614
|
-
var uid = uid$2;
|
|
615
|
-
|
|
616
|
-
var keys = shared$2('keys');
|
|
617
|
-
|
|
618
|
-
var sharedKey$3 = function (key) {
|
|
619
|
-
return keys[key] || (keys[key] = uid(key));
|
|
620
|
-
};
|
|
621
|
-
|
|
622
|
-
var hiddenKeys$4 = {};
|
|
623
|
-
|
|
624
|
-
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
625
|
-
var global$7 = global$f;
|
|
626
|
-
var isObject$2 = isObject$7;
|
|
627
|
-
var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
|
|
628
|
-
var hasOwn$6 = hasOwnProperty_1;
|
|
629
|
-
var shared$1 = sharedStore;
|
|
630
|
-
var sharedKey$2 = sharedKey$3;
|
|
631
|
-
var hiddenKeys$3 = hiddenKeys$4;
|
|
632
|
-
|
|
633
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
634
|
-
var TypeError$2 = global$7.TypeError;
|
|
635
|
-
var WeakMap = global$7.WeakMap;
|
|
636
|
-
var set, get, has;
|
|
637
|
-
|
|
638
|
-
var enforce = function (it) {
|
|
639
|
-
return has(it) ? get(it) : set(it, {});
|
|
640
|
-
};
|
|
641
|
-
|
|
642
|
-
var getterFor = function (TYPE) {
|
|
643
|
-
return function (it) {
|
|
644
|
-
var state;
|
|
645
|
-
if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
|
|
646
|
-
throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
|
|
647
|
-
} return state;
|
|
648
|
-
};
|
|
649
|
-
};
|
|
650
|
-
|
|
651
|
-
if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
652
|
-
var store = shared$1.state || (shared$1.state = new WeakMap());
|
|
653
|
-
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
654
|
-
store.get = store.get;
|
|
655
|
-
store.has = store.has;
|
|
656
|
-
store.set = store.set;
|
|
657
|
-
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
658
|
-
set = function (it, metadata) {
|
|
659
|
-
if (store.has(it)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
|
|
660
|
-
metadata.facade = it;
|
|
661
|
-
store.set(it, metadata);
|
|
662
|
-
return metadata;
|
|
663
|
-
};
|
|
664
|
-
get = function (it) {
|
|
665
|
-
return store.get(it) || {};
|
|
666
|
-
};
|
|
667
|
-
has = function (it) {
|
|
668
|
-
return store.has(it);
|
|
669
|
-
};
|
|
670
|
-
} else {
|
|
671
|
-
var STATE = sharedKey$2('state');
|
|
672
|
-
hiddenKeys$3[STATE] = true;
|
|
673
|
-
set = function (it, metadata) {
|
|
674
|
-
if (hasOwn$6(it, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
|
|
675
|
-
metadata.facade = it;
|
|
676
|
-
createNonEnumerableProperty$4(it, STATE, metadata);
|
|
677
|
-
return metadata;
|
|
678
|
-
};
|
|
679
|
-
get = function (it) {
|
|
680
|
-
return hasOwn$6(it, STATE) ? it[STATE] : {};
|
|
681
|
-
};
|
|
682
|
-
has = function (it) {
|
|
683
|
-
return hasOwn$6(it, STATE);
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
var internalState = {
|
|
688
|
-
set: set,
|
|
689
|
-
get: get,
|
|
690
|
-
has: has,
|
|
691
|
-
enforce: enforce,
|
|
692
|
-
getterFor: getterFor
|
|
693
|
-
};
|
|
694
|
-
|
|
695
|
-
var fails$9 = fails$g;
|
|
696
|
-
var isCallable$9 = isCallable$h;
|
|
697
|
-
var hasOwn$5 = hasOwnProperty_1;
|
|
698
|
-
var DESCRIPTORS$4 = descriptors;
|
|
699
|
-
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
700
|
-
var inspectSource = inspectSource$1;
|
|
701
|
-
var InternalStateModule$2 = internalState;
|
|
702
|
-
|
|
703
|
-
var enforceInternalState = InternalStateModule$2.enforce;
|
|
704
|
-
var getInternalState$2 = InternalStateModule$2.get;
|
|
705
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
706
|
-
var defineProperty$4 = Object.defineProperty;
|
|
707
|
-
|
|
708
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$4 && !fails$9(function () {
|
|
709
|
-
return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
710
|
-
});
|
|
711
|
-
|
|
712
|
-
var TEMPLATE = String(String).split('String');
|
|
713
|
-
|
|
714
|
-
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
715
|
-
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
716
|
-
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
717
|
-
}
|
|
718
|
-
if (options && options.getter) name = 'get ' + name;
|
|
719
|
-
if (options && options.setter) name = 'set ' + name;
|
|
720
|
-
if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
721
|
-
if (DESCRIPTORS$4) defineProperty$4(value, 'name', { value: name, configurable: true });
|
|
722
|
-
else value.name = name;
|
|
723
|
-
}
|
|
724
|
-
if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
|
|
725
|
-
defineProperty$4(value, 'length', { value: options.arity });
|
|
726
|
-
}
|
|
727
|
-
try {
|
|
728
|
-
if (options && hasOwn$5(options, 'constructor') && options.constructor) {
|
|
729
|
-
if (DESCRIPTORS$4) defineProperty$4(value, 'prototype', { writable: false });
|
|
730
|
-
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
731
|
-
} else if (value.prototype) value.prototype = undefined;
|
|
732
|
-
} catch (error) { /* empty */ }
|
|
733
|
-
var state = enforceInternalState(value);
|
|
734
|
-
if (!hasOwn$5(state, 'source')) {
|
|
735
|
-
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
736
|
-
} return value;
|
|
737
|
-
};
|
|
738
|
-
|
|
739
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
740
|
-
// eslint-disable-next-line no-extend-native -- required
|
|
741
|
-
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
742
|
-
return isCallable$9(this) && getInternalState$2(this).source || inspectSource(this);
|
|
743
|
-
}, 'toString');
|
|
744
|
-
|
|
745
|
-
var isCallable$8 = isCallable$h;
|
|
746
|
-
var definePropertyModule$3 = objectDefineProperty;
|
|
747
|
-
var makeBuiltIn = makeBuiltIn$2.exports;
|
|
748
|
-
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
749
|
-
|
|
750
|
-
var defineBuiltIn$6 = function (O, key, value, options) {
|
|
751
|
-
if (!options) options = {};
|
|
752
|
-
var simple = options.enumerable;
|
|
753
|
-
var name = options.name !== undefined ? options.name : key;
|
|
754
|
-
if (isCallable$8(value)) makeBuiltIn(value, name, options);
|
|
755
|
-
if (options.global) {
|
|
756
|
-
if (simple) O[key] = value;
|
|
757
|
-
else defineGlobalProperty$1(key, value);
|
|
758
|
-
} else {
|
|
759
|
-
try {
|
|
760
|
-
if (!options.unsafe) delete O[key];
|
|
761
|
-
else if (O[key]) simple = true;
|
|
762
|
-
} catch (error) { /* empty */ }
|
|
763
|
-
if (simple) O[key] = value;
|
|
764
|
-
else definePropertyModule$3.f(O, key, {
|
|
765
|
-
value: value,
|
|
766
|
-
enumerable: false,
|
|
767
|
-
configurable: !options.nonConfigurable,
|
|
768
|
-
writable: !options.nonWritable
|
|
769
|
-
});
|
|
770
|
-
} return O;
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
var objectGetOwnPropertyNames = {};
|
|
774
|
-
|
|
775
|
-
var ceil = Math.ceil;
|
|
776
|
-
var floor$1 = Math.floor;
|
|
777
|
-
|
|
778
|
-
// `Math.trunc` method
|
|
779
|
-
// https://tc39.es/ecma262/#sec-math.trunc
|
|
780
|
-
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
781
|
-
var mathTrunc = Math.trunc || function trunc(x) {
|
|
782
|
-
var n = +x;
|
|
783
|
-
return (n > 0 ? floor$1 : ceil)(n);
|
|
784
|
-
};
|
|
785
|
-
|
|
786
|
-
var trunc = mathTrunc;
|
|
787
|
-
|
|
788
|
-
// `ToIntegerOrInfinity` abstract operation
|
|
789
|
-
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
790
|
-
var toIntegerOrInfinity$2 = function (argument) {
|
|
791
|
-
var number = +argument;
|
|
792
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
793
|
-
return number !== number || number === 0 ? 0 : trunc(number);
|
|
794
|
-
};
|
|
795
|
-
|
|
796
|
-
var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
|
|
797
|
-
|
|
798
|
-
var max$1 = Math.max;
|
|
799
|
-
var min$1 = Math.min;
|
|
800
|
-
|
|
801
|
-
// Helper for a popular repeating case of the spec:
|
|
802
|
-
// Let integer be ? ToInteger(index).
|
|
803
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
804
|
-
var toAbsoluteIndex$2 = function (index, length) {
|
|
805
|
-
var integer = toIntegerOrInfinity$1(index);
|
|
806
|
-
return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
|
|
807
|
-
};
|
|
808
|
-
|
|
809
|
-
var toIntegerOrInfinity = toIntegerOrInfinity$2;
|
|
810
|
-
|
|
811
|
-
var min = Math.min;
|
|
812
|
-
|
|
813
|
-
// `ToLength` abstract operation
|
|
814
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
815
|
-
var toLength$1 = function (argument) {
|
|
816
|
-
return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
var toLength = toLength$1;
|
|
820
|
-
|
|
821
|
-
// `LengthOfArrayLike` abstract operation
|
|
822
|
-
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
823
|
-
var lengthOfArrayLike$3 = function (obj) {
|
|
824
|
-
return toLength(obj.length);
|
|
825
|
-
};
|
|
826
|
-
|
|
827
|
-
var toIndexedObject$3 = toIndexedObject$5;
|
|
828
|
-
var toAbsoluteIndex$1 = toAbsoluteIndex$2;
|
|
829
|
-
var lengthOfArrayLike$2 = lengthOfArrayLike$3;
|
|
830
|
-
|
|
831
|
-
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
832
|
-
var createMethod = function (IS_INCLUDES) {
|
|
833
|
-
return function ($this, el, fromIndex) {
|
|
834
|
-
var O = toIndexedObject$3($this);
|
|
835
|
-
var length = lengthOfArrayLike$2(O);
|
|
836
|
-
var index = toAbsoluteIndex$1(fromIndex, length);
|
|
837
|
-
var value;
|
|
838
|
-
// Array#includes uses SameValueZero equality algorithm
|
|
839
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
840
|
-
if (IS_INCLUDES && el != el) while (length > index) {
|
|
841
|
-
value = O[index++];
|
|
842
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
843
|
-
if (value != value) return true;
|
|
844
|
-
// Array#indexOf ignores holes, Array#includes - not
|
|
845
|
-
} else for (;length > index; index++) {
|
|
846
|
-
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
847
|
-
} return !IS_INCLUDES && -1;
|
|
848
|
-
};
|
|
849
|
-
};
|
|
850
|
-
|
|
851
|
-
var arrayIncludes = {
|
|
852
|
-
// `Array.prototype.includes` method
|
|
853
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
854
|
-
includes: createMethod(true),
|
|
855
|
-
// `Array.prototype.indexOf` method
|
|
856
|
-
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
857
|
-
indexOf: createMethod(false)
|
|
858
|
-
};
|
|
859
|
-
|
|
860
|
-
var uncurryThis$8 = functionUncurryThis;
|
|
861
|
-
var hasOwn$4 = hasOwnProperty_1;
|
|
862
|
-
var toIndexedObject$2 = toIndexedObject$5;
|
|
863
|
-
var indexOf$1 = arrayIncludes.indexOf;
|
|
864
|
-
var hiddenKeys$2 = hiddenKeys$4;
|
|
865
|
-
|
|
866
|
-
var push$1 = uncurryThis$8([].push);
|
|
867
|
-
|
|
868
|
-
var objectKeysInternal = function (object, names) {
|
|
869
|
-
var O = toIndexedObject$2(object);
|
|
870
|
-
var i = 0;
|
|
871
|
-
var result = [];
|
|
872
|
-
var key;
|
|
873
|
-
for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push$1(result, key);
|
|
874
|
-
// Don't enum bug & hidden keys
|
|
875
|
-
while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
|
|
876
|
-
~indexOf$1(result, key) || push$1(result, key);
|
|
877
|
-
}
|
|
878
|
-
return result;
|
|
879
|
-
};
|
|
880
|
-
|
|
881
|
-
// IE8- don't enum bug keys
|
|
882
|
-
var enumBugKeys$3 = [
|
|
883
|
-
'constructor',
|
|
884
|
-
'hasOwnProperty',
|
|
885
|
-
'isPrototypeOf',
|
|
886
|
-
'propertyIsEnumerable',
|
|
887
|
-
'toLocaleString',
|
|
888
|
-
'toString',
|
|
889
|
-
'valueOf'
|
|
890
|
-
];
|
|
891
|
-
|
|
892
|
-
var internalObjectKeys$1 = objectKeysInternal;
|
|
893
|
-
var enumBugKeys$2 = enumBugKeys$3;
|
|
894
|
-
|
|
895
|
-
var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
896
|
-
|
|
897
|
-
// `Object.getOwnPropertyNames` method
|
|
898
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
899
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
900
|
-
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
901
|
-
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
902
|
-
};
|
|
903
|
-
|
|
904
|
-
var objectGetOwnPropertySymbols = {};
|
|
905
|
-
|
|
906
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
907
|
-
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
908
|
-
|
|
909
|
-
var getBuiltIn$1 = getBuiltIn$4;
|
|
910
|
-
var uncurryThis$7 = functionUncurryThis;
|
|
911
|
-
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
912
|
-
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
913
|
-
var anObject$a = anObject$c;
|
|
914
|
-
|
|
915
|
-
var concat$1 = uncurryThis$7([].concat);
|
|
916
|
-
|
|
917
|
-
// all object keys, includes non-enumerable and symbols
|
|
918
|
-
var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
919
|
-
var keys = getOwnPropertyNamesModule.f(anObject$a(it));
|
|
920
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
921
|
-
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
922
|
-
};
|
|
923
|
-
|
|
924
|
-
var hasOwn$3 = hasOwnProperty_1;
|
|
925
|
-
var ownKeys = ownKeys$1;
|
|
926
|
-
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
927
|
-
var definePropertyModule$2 = objectDefineProperty;
|
|
928
|
-
|
|
929
|
-
var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
930
|
-
var keys = ownKeys(source);
|
|
931
|
-
var defineProperty = definePropertyModule$2.f;
|
|
932
|
-
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
933
|
-
for (var i = 0; i < keys.length; i++) {
|
|
934
|
-
var key = keys[i];
|
|
935
|
-
if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
|
|
936
|
-
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
|
|
941
|
-
var fails$8 = fails$g;
|
|
942
|
-
var isCallable$7 = isCallable$h;
|
|
943
|
-
|
|
944
|
-
var replacement = /#|\.prototype\./;
|
|
945
|
-
|
|
946
|
-
var isForced$1 = function (feature, detection) {
|
|
947
|
-
var value = data[normalize(feature)];
|
|
948
|
-
return value == POLYFILL ? true
|
|
949
|
-
: value == NATIVE ? false
|
|
950
|
-
: isCallable$7(detection) ? fails$8(detection)
|
|
951
|
-
: !!detection;
|
|
952
|
-
};
|
|
953
|
-
|
|
954
|
-
var normalize = isForced$1.normalize = function (string) {
|
|
955
|
-
return String(string).replace(replacement, '.').toLowerCase();
|
|
956
|
-
};
|
|
957
|
-
|
|
958
|
-
var data = isForced$1.data = {};
|
|
959
|
-
var NATIVE = isForced$1.NATIVE = 'N';
|
|
960
|
-
var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
961
|
-
|
|
962
|
-
var isForced_1 = isForced$1;
|
|
963
|
-
|
|
964
|
-
var global$6 = global$f;
|
|
965
|
-
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
966
|
-
var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
|
|
967
|
-
var defineBuiltIn$5 = defineBuiltIn$6;
|
|
968
|
-
var defineGlobalProperty = defineGlobalProperty$3;
|
|
969
|
-
var copyConstructorProperties = copyConstructorProperties$1;
|
|
970
|
-
var isForced = isForced_1;
|
|
971
|
-
|
|
972
|
-
/*
|
|
973
|
-
options.target - name of the target object
|
|
974
|
-
options.global - target is the global object
|
|
975
|
-
options.stat - export as static methods of target
|
|
976
|
-
options.proto - export as prototype methods of target
|
|
977
|
-
options.real - real prototype method for the `pure` version
|
|
978
|
-
options.forced - export even if the native feature is available
|
|
979
|
-
options.bind - bind methods to the target, required for the `pure` version
|
|
980
|
-
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
981
|
-
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
982
|
-
options.sham - add a flag to not completely full polyfills
|
|
983
|
-
options.enumerable - export as enumerable property
|
|
984
|
-
options.dontCallGetSet - prevent calling a getter on target
|
|
985
|
-
options.name - the .name of the function if it does not match the key
|
|
986
|
-
*/
|
|
987
|
-
var _export = function (options, source) {
|
|
988
|
-
var TARGET = options.target;
|
|
989
|
-
var GLOBAL = options.global;
|
|
990
|
-
var STATIC = options.stat;
|
|
991
|
-
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
992
|
-
if (GLOBAL) {
|
|
993
|
-
target = global$6;
|
|
994
|
-
} else if (STATIC) {
|
|
995
|
-
target = global$6[TARGET] || defineGlobalProperty(TARGET, {});
|
|
996
|
-
} else {
|
|
997
|
-
target = (global$6[TARGET] || {}).prototype;
|
|
998
|
-
}
|
|
999
|
-
if (target) for (key in source) {
|
|
1000
|
-
sourceProperty = source[key];
|
|
1001
|
-
if (options.dontCallGetSet) {
|
|
1002
|
-
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
1003
|
-
targetProperty = descriptor && descriptor.value;
|
|
1004
|
-
} else targetProperty = target[key];
|
|
1005
|
-
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
1006
|
-
// contained in target
|
|
1007
|
-
if (!FORCED && targetProperty !== undefined) {
|
|
1008
|
-
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
1009
|
-
copyConstructorProperties(sourceProperty, targetProperty);
|
|
1010
|
-
}
|
|
1011
|
-
// add a flag to not completely full polyfills
|
|
1012
|
-
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1013
|
-
createNonEnumerableProperty$3(sourceProperty, 'sham', true);
|
|
1014
|
-
}
|
|
1015
|
-
defineBuiltIn$5(target, key, sourceProperty, options);
|
|
1016
|
-
}
|
|
1017
|
-
};
|
|
1018
|
-
|
|
1019
|
-
var internalObjectKeys = objectKeysInternal;
|
|
1020
|
-
var enumBugKeys$1 = enumBugKeys$3;
|
|
1021
|
-
|
|
1022
|
-
// `Object.keys` method
|
|
1023
|
-
// https://tc39.es/ecma262/#sec-object.keys
|
|
1024
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1025
|
-
var objectKeys$2 = Object.keys || function keys(O) {
|
|
1026
|
-
return internalObjectKeys(O, enumBugKeys$1);
|
|
1027
|
-
};
|
|
1028
|
-
|
|
1029
|
-
var DESCRIPTORS$3 = descriptors;
|
|
1030
|
-
var uncurryThis$6 = functionUncurryThis;
|
|
1031
|
-
var call$8 = functionCall;
|
|
1032
|
-
var fails$7 = fails$g;
|
|
1033
|
-
var objectKeys$1 = objectKeys$2;
|
|
1034
|
-
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1035
|
-
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
1036
|
-
var toObject$1 = toObject$3;
|
|
1037
|
-
var IndexedObject = indexedObject;
|
|
1038
|
-
|
|
1039
|
-
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1040
|
-
var $assign = Object.assign;
|
|
1041
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1042
|
-
var defineProperty$3 = Object.defineProperty;
|
|
1043
|
-
var concat = uncurryThis$6([].concat);
|
|
1044
|
-
|
|
1045
|
-
// `Object.assign` method
|
|
1046
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
1047
|
-
var objectAssign = !$assign || fails$7(function () {
|
|
1048
|
-
// should have correct order of operations (Edge bug)
|
|
1049
|
-
if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
|
|
1050
|
-
enumerable: true,
|
|
1051
|
-
get: function () {
|
|
1052
|
-
defineProperty$3(this, 'b', {
|
|
1053
|
-
value: 3,
|
|
1054
|
-
enumerable: false
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1057
|
-
}), { b: 2 })).b !== 1) return true;
|
|
1058
|
-
// should work with symbols and should have deterministic property order (V8 bug)
|
|
1059
|
-
var A = {};
|
|
1060
|
-
var B = {};
|
|
1061
|
-
// eslint-disable-next-line es/no-symbol -- safe
|
|
1062
|
-
var symbol = Symbol();
|
|
1063
|
-
var alphabet = 'abcdefghijklmnopqrst';
|
|
1064
|
-
A[symbol] = 7;
|
|
1065
|
-
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
1066
|
-
return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
|
|
1067
|
-
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
1068
|
-
var T = toObject$1(target);
|
|
1069
|
-
var argumentsLength = arguments.length;
|
|
1070
|
-
var index = 1;
|
|
1071
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1072
|
-
var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
1073
|
-
while (argumentsLength > index) {
|
|
1074
|
-
var S = IndexedObject(arguments[index++]);
|
|
1075
|
-
var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
|
|
1076
|
-
var length = keys.length;
|
|
1077
|
-
var j = 0;
|
|
1078
|
-
var key;
|
|
1079
|
-
while (length > j) {
|
|
1080
|
-
key = keys[j++];
|
|
1081
|
-
if (!DESCRIPTORS$3 || call$8(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1082
|
-
}
|
|
1083
|
-
} return T;
|
|
1084
|
-
} : $assign;
|
|
1085
|
-
|
|
1086
|
-
var $$4 = _export;
|
|
1087
|
-
var assign = objectAssign;
|
|
1088
|
-
|
|
1089
|
-
// `Object.assign` method
|
|
1090
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
1091
|
-
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1092
|
-
$$4({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1093
|
-
assign: assign
|
|
1094
|
-
});
|
|
1095
|
-
|
|
1096
|
-
var objectDefineProperties = {};
|
|
1097
|
-
|
|
1098
|
-
var DESCRIPTORS$2 = descriptors;
|
|
1099
|
-
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
1100
|
-
var definePropertyModule$1 = objectDefineProperty;
|
|
1101
|
-
var anObject$9 = anObject$c;
|
|
1102
|
-
var toIndexedObject$1 = toIndexedObject$5;
|
|
1103
|
-
var objectKeys = objectKeys$2;
|
|
1104
|
-
|
|
1105
|
-
// `Object.defineProperties` method
|
|
1106
|
-
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1107
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1108
|
-
objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1109
|
-
anObject$9(O);
|
|
1110
|
-
var props = toIndexedObject$1(Properties);
|
|
1111
|
-
var keys = objectKeys(Properties);
|
|
1112
|
-
var length = keys.length;
|
|
1113
|
-
var index = 0;
|
|
1114
|
-
var key;
|
|
1115
|
-
while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
|
|
1116
|
-
return O;
|
|
1117
|
-
};
|
|
1118
|
-
|
|
1119
|
-
var getBuiltIn = getBuiltIn$4;
|
|
1120
|
-
|
|
1121
|
-
var html$1 = getBuiltIn('document', 'documentElement');
|
|
1122
|
-
|
|
1123
|
-
/* global ActiveXObject -- old IE, WSH */
|
|
1124
|
-
|
|
1125
|
-
var anObject$8 = anObject$c;
|
|
1126
|
-
var definePropertiesModule = objectDefineProperties;
|
|
1127
|
-
var enumBugKeys = enumBugKeys$3;
|
|
1128
|
-
var hiddenKeys = hiddenKeys$4;
|
|
1129
|
-
var html = html$1;
|
|
1130
|
-
var documentCreateElement$1 = documentCreateElement$2;
|
|
1131
|
-
var sharedKey$1 = sharedKey$3;
|
|
1132
|
-
|
|
1133
|
-
var GT = '>';
|
|
1134
|
-
var LT = '<';
|
|
1135
|
-
var PROTOTYPE = 'prototype';
|
|
1136
|
-
var SCRIPT = 'script';
|
|
1137
|
-
var IE_PROTO$1 = sharedKey$1('IE_PROTO');
|
|
1138
|
-
|
|
1139
|
-
var EmptyConstructor = function () { /* empty */ };
|
|
1140
|
-
|
|
1141
|
-
var scriptTag = function (content) {
|
|
1142
|
-
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
1146
|
-
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
1147
|
-
activeXDocument.write(scriptTag(''));
|
|
1148
|
-
activeXDocument.close();
|
|
1149
|
-
var temp = activeXDocument.parentWindow.Object;
|
|
1150
|
-
activeXDocument = null; // avoid memory leak
|
|
1151
|
-
return temp;
|
|
1152
|
-
};
|
|
1153
|
-
|
|
1154
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
1155
|
-
var NullProtoObjectViaIFrame = function () {
|
|
1156
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
1157
|
-
var iframe = documentCreateElement$1('iframe');
|
|
1158
|
-
var JS = 'java' + SCRIPT + ':';
|
|
1159
|
-
var iframeDocument;
|
|
1160
|
-
iframe.style.display = 'none';
|
|
1161
|
-
html.appendChild(iframe);
|
|
1162
|
-
// https://github.com/zloirock/core-js/issues/475
|
|
1163
|
-
iframe.src = String(JS);
|
|
1164
|
-
iframeDocument = iframe.contentWindow.document;
|
|
1165
|
-
iframeDocument.open();
|
|
1166
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
|
1167
|
-
iframeDocument.close();
|
|
1168
|
-
return iframeDocument.F;
|
|
1169
|
-
};
|
|
1170
|
-
|
|
1171
|
-
// Check for document.domain and active x support
|
|
1172
|
-
// No need to use active x approach when document.domain is not set
|
|
1173
|
-
// see https://github.com/es-shims/es5-shim/issues/150
|
|
1174
|
-
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
1175
|
-
// avoid IE GC bug
|
|
1176
|
-
var activeXDocument;
|
|
1177
|
-
var NullProtoObject = function () {
|
|
1178
|
-
try {
|
|
1179
|
-
activeXDocument = new ActiveXObject('htmlfile');
|
|
1180
|
-
} catch (error) { /* ignore */ }
|
|
1181
|
-
NullProtoObject = typeof document != 'undefined'
|
|
1182
|
-
? document.domain && activeXDocument
|
|
1183
|
-
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
1184
|
-
: NullProtoObjectViaIFrame()
|
|
1185
|
-
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
1186
|
-
var length = enumBugKeys.length;
|
|
1187
|
-
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1188
|
-
return NullProtoObject();
|
|
1189
|
-
};
|
|
1190
|
-
|
|
1191
|
-
hiddenKeys[IE_PROTO$1] = true;
|
|
1192
|
-
|
|
1193
|
-
// `Object.create` method
|
|
1194
|
-
// https://tc39.es/ecma262/#sec-object.create
|
|
1195
|
-
// eslint-disable-next-line es/no-object-create -- safe
|
|
1196
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
|
1197
|
-
var result;
|
|
1198
|
-
if (O !== null) {
|
|
1199
|
-
EmptyConstructor[PROTOTYPE] = anObject$8(O);
|
|
1200
|
-
result = new EmptyConstructor();
|
|
1201
|
-
EmptyConstructor[PROTOTYPE] = null;
|
|
1202
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1203
|
-
result[IE_PROTO$1] = O;
|
|
1204
|
-
} else result = NullProtoObject();
|
|
1205
|
-
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
1206
|
-
};
|
|
1207
|
-
|
|
1208
|
-
var wellKnownSymbol$b = wellKnownSymbol$d;
|
|
1209
|
-
var create$3 = objectCreate;
|
|
1210
|
-
var defineProperty$2 = objectDefineProperty.f;
|
|
1211
|
-
|
|
1212
|
-
var UNSCOPABLES = wellKnownSymbol$b('unscopables');
|
|
1213
|
-
var ArrayPrototype$1 = Array.prototype;
|
|
1214
|
-
|
|
1215
|
-
// Array.prototype[@@unscopables]
|
|
1216
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1217
|
-
if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
|
|
1218
|
-
defineProperty$2(ArrayPrototype$1, UNSCOPABLES, {
|
|
1219
|
-
configurable: true,
|
|
1220
|
-
value: create$3(null)
|
|
1221
|
-
});
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
// add a key to Array.prototype[@@unscopables]
|
|
1225
|
-
var addToUnscopables$1 = function (key) {
|
|
1226
|
-
ArrayPrototype$1[UNSCOPABLES][key] = true;
|
|
1227
|
-
};
|
|
1228
|
-
|
|
1229
|
-
var iterators = {};
|
|
1230
|
-
|
|
1231
|
-
var fails$6 = fails$g;
|
|
1232
|
-
|
|
1233
|
-
var correctPrototypeGetter = !fails$6(function () {
|
|
1234
|
-
function F() { /* empty */ }
|
|
1235
|
-
F.prototype.constructor = null;
|
|
1236
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1237
|
-
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1238
|
-
});
|
|
1239
|
-
|
|
1240
|
-
var hasOwn$2 = hasOwnProperty_1;
|
|
1241
|
-
var isCallable$6 = isCallable$h;
|
|
1242
|
-
var toObject = toObject$3;
|
|
1243
|
-
var sharedKey = sharedKey$3;
|
|
1244
|
-
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1245
|
-
|
|
1246
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1247
|
-
var $Object$1 = Object;
|
|
1248
|
-
var ObjectPrototype = $Object$1.prototype;
|
|
1249
|
-
|
|
1250
|
-
// `Object.getPrototypeOf` method
|
|
1251
|
-
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1252
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1253
|
-
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
|
|
1254
|
-
var object = toObject(O);
|
|
1255
|
-
if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
|
|
1256
|
-
var constructor = object.constructor;
|
|
1257
|
-
if (isCallable$6(constructor) && object instanceof constructor) {
|
|
1258
|
-
return constructor.prototype;
|
|
1259
|
-
} return object instanceof $Object$1 ? ObjectPrototype : null;
|
|
1260
|
-
};
|
|
1261
|
-
|
|
1262
|
-
var fails$5 = fails$g;
|
|
1263
|
-
var isCallable$5 = isCallable$h;
|
|
1264
|
-
var isObject$1 = isObject$7;
|
|
1265
|
-
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1266
|
-
var defineBuiltIn$4 = defineBuiltIn$6;
|
|
1267
|
-
var wellKnownSymbol$a = wellKnownSymbol$d;
|
|
1268
|
-
|
|
1269
|
-
var ITERATOR$6 = wellKnownSymbol$a('iterator');
|
|
1270
|
-
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1271
|
-
|
|
1272
|
-
// `%IteratorPrototype%` object
|
|
1273
|
-
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1274
|
-
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1275
|
-
|
|
1276
|
-
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
1277
|
-
if ([].keys) {
|
|
1278
|
-
arrayIterator = [].keys();
|
|
1279
|
-
// Safari 8 has buggy iterators w/o `next`
|
|
1280
|
-
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
|
1281
|
-
else {
|
|
1282
|
-
PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
|
|
1283
|
-
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject$1(IteratorPrototype$2) || fails$5(function () {
|
|
1288
|
-
var test = {};
|
|
1289
|
-
// FF44- legacy iterators case
|
|
1290
|
-
return IteratorPrototype$2[ITERATOR$6].call(test) !== test;
|
|
1291
|
-
});
|
|
1292
|
-
|
|
1293
|
-
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
1294
|
-
|
|
1295
|
-
// `%IteratorPrototype%[@@iterator]()` method
|
|
1296
|
-
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1297
|
-
if (!isCallable$5(IteratorPrototype$2[ITERATOR$6])) {
|
|
1298
|
-
defineBuiltIn$4(IteratorPrototype$2, ITERATOR$6, function () {
|
|
1299
|
-
return this;
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
var iteratorsCore = {
|
|
1304
|
-
IteratorPrototype: IteratorPrototype$2,
|
|
1305
|
-
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
|
1306
|
-
};
|
|
1307
|
-
|
|
1308
|
-
var defineProperty$1 = objectDefineProperty.f;
|
|
1309
|
-
var hasOwn$1 = hasOwnProperty_1;
|
|
1310
|
-
var wellKnownSymbol$9 = wellKnownSymbol$d;
|
|
1311
|
-
|
|
1312
|
-
var TO_STRING_TAG$3 = wellKnownSymbol$9('toStringTag');
|
|
1313
|
-
|
|
1314
|
-
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1315
|
-
if (target && !STATIC) target = target.prototype;
|
|
1316
|
-
if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
|
|
1317
|
-
defineProperty$1(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
|
|
1318
|
-
}
|
|
1319
|
-
};
|
|
1320
|
-
|
|
1321
|
-
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1322
|
-
var create$2 = objectCreate;
|
|
1323
|
-
var createPropertyDescriptor$2 = createPropertyDescriptor$5;
|
|
1324
|
-
var setToStringTag$2 = setToStringTag$3;
|
|
1325
|
-
var Iterators$4 = iterators;
|
|
1326
|
-
|
|
1327
|
-
var returnThis$1 = function () { return this; };
|
|
1328
|
-
|
|
1329
|
-
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1330
|
-
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1331
|
-
IteratorConstructor.prototype = create$2(IteratorPrototype$1, { next: createPropertyDescriptor$2(+!ENUMERABLE_NEXT, next) });
|
|
1332
|
-
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1333
|
-
Iterators$4[TO_STRING_TAG] = returnThis$1;
|
|
1334
|
-
return IteratorConstructor;
|
|
1335
|
-
};
|
|
1336
|
-
|
|
1337
|
-
var isCallable$4 = isCallable$h;
|
|
1338
|
-
|
|
1339
|
-
var $String$1 = String;
|
|
1340
|
-
var $TypeError$5 = TypeError;
|
|
1341
|
-
|
|
1342
|
-
var aPossiblePrototype$1 = function (argument) {
|
|
1343
|
-
if (typeof argument == 'object' || isCallable$4(argument)) return argument;
|
|
1344
|
-
throw $TypeError$5("Can't set " + $String$1(argument) + ' as a prototype');
|
|
1345
|
-
};
|
|
1346
|
-
|
|
1347
|
-
/* eslint-disable no-proto -- safe */
|
|
1348
|
-
|
|
1349
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
1350
|
-
var anObject$7 = anObject$c;
|
|
1351
|
-
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1352
|
-
|
|
1353
|
-
// `Object.setPrototypeOf` method
|
|
1354
|
-
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
1355
|
-
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
1356
|
-
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
1357
|
-
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
1358
|
-
var CORRECT_SETTER = false;
|
|
1359
|
-
var test = {};
|
|
1360
|
-
var setter;
|
|
1361
|
-
try {
|
|
1362
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1363
|
-
setter = uncurryThis$5(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1364
|
-
setter(test, []);
|
|
1365
|
-
CORRECT_SETTER = test instanceof Array;
|
|
1366
|
-
} catch (error) { /* empty */ }
|
|
1367
|
-
return function setPrototypeOf(O, proto) {
|
|
1368
|
-
anObject$7(O);
|
|
1369
|
-
aPossiblePrototype(proto);
|
|
1370
|
-
if (CORRECT_SETTER) setter(O, proto);
|
|
1371
|
-
else O.__proto__ = proto;
|
|
1372
|
-
return O;
|
|
1373
|
-
};
|
|
1374
|
-
}() : undefined);
|
|
1375
|
-
|
|
1376
|
-
var $$3 = _export;
|
|
1377
|
-
var call$7 = functionCall;
|
|
1378
|
-
var FunctionName = functionName;
|
|
1379
|
-
var isCallable$3 = isCallable$h;
|
|
1380
|
-
var createIteratorConstructor$1 = iteratorCreateConstructor;
|
|
1381
|
-
var getPrototypeOf = objectGetPrototypeOf;
|
|
1382
|
-
var setPrototypeOf = objectSetPrototypeOf;
|
|
1383
|
-
var setToStringTag$1 = setToStringTag$3;
|
|
1384
|
-
var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
|
|
1385
|
-
var defineBuiltIn$3 = defineBuiltIn$6;
|
|
1386
|
-
var wellKnownSymbol$8 = wellKnownSymbol$d;
|
|
1387
|
-
var Iterators$3 = iterators;
|
|
1388
|
-
var IteratorsCore = iteratorsCore;
|
|
1389
|
-
|
|
1390
|
-
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
|
1391
|
-
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1392
|
-
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1393
|
-
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1394
|
-
var ITERATOR$5 = wellKnownSymbol$8('iterator');
|
|
1395
|
-
var KEYS = 'keys';
|
|
1396
|
-
var VALUES = 'values';
|
|
1397
|
-
var ENTRIES = 'entries';
|
|
1398
|
-
|
|
1399
|
-
var returnThis = function () { return this; };
|
|
1400
|
-
|
|
1401
|
-
var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
|
1402
|
-
createIteratorConstructor$1(IteratorConstructor, NAME, next);
|
|
1403
|
-
|
|
1404
|
-
var getIterationMethod = function (KIND) {
|
|
1405
|
-
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
|
1406
|
-
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
1407
|
-
switch (KIND) {
|
|
1408
|
-
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
|
1409
|
-
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
|
1410
|
-
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
|
1411
|
-
} return function () { return new IteratorConstructor(this); };
|
|
1412
|
-
};
|
|
1413
|
-
|
|
1414
|
-
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1415
|
-
var INCORRECT_VALUES_NAME = false;
|
|
1416
|
-
var IterablePrototype = Iterable.prototype;
|
|
1417
|
-
var nativeIterator = IterablePrototype[ITERATOR$5]
|
|
1418
|
-
|| IterablePrototype['@@iterator']
|
|
1419
|
-
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
1420
|
-
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
1421
|
-
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
|
1422
|
-
var CurrentIteratorPrototype, methods, KEY;
|
|
1423
|
-
|
|
1424
|
-
// fix native
|
|
1425
|
-
if (anyNativeIterator) {
|
|
1426
|
-
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
|
1427
|
-
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
|
1428
|
-
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1429
|
-
if (setPrototypeOf) {
|
|
1430
|
-
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1431
|
-
} else if (!isCallable$3(CurrentIteratorPrototype[ITERATOR$5])) {
|
|
1432
|
-
defineBuiltIn$3(CurrentIteratorPrototype, ITERATOR$5, returnThis);
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
// Set @@toStringTag to native iterators
|
|
1436
|
-
setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1441
|
-
if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1442
|
-
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1443
|
-
createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
|
|
1444
|
-
} else {
|
|
1445
|
-
INCORRECT_VALUES_NAME = true;
|
|
1446
|
-
defaultIterator = function values() { return call$7(nativeIterator, this); };
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
// export additional methods
|
|
1451
|
-
if (DEFAULT) {
|
|
1452
|
-
methods = {
|
|
1453
|
-
values: getIterationMethod(VALUES),
|
|
1454
|
-
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
|
1455
|
-
entries: getIterationMethod(ENTRIES)
|
|
1456
|
-
};
|
|
1457
|
-
if (FORCED) for (KEY in methods) {
|
|
1458
|
-
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1459
|
-
defineBuiltIn$3(IterablePrototype, KEY, methods[KEY]);
|
|
1460
|
-
}
|
|
1461
|
-
} else $$3({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
// define iterator
|
|
1465
|
-
if (IterablePrototype[ITERATOR$5] !== defaultIterator) {
|
|
1466
|
-
defineBuiltIn$3(IterablePrototype, ITERATOR$5, defaultIterator, { name: DEFAULT });
|
|
1467
|
-
}
|
|
1468
|
-
Iterators$3[NAME] = defaultIterator;
|
|
1469
|
-
|
|
1470
|
-
return methods;
|
|
1471
|
-
};
|
|
1472
|
-
|
|
1473
|
-
// `CreateIterResultObject` abstract operation
|
|
1474
|
-
// https://tc39.es/ecma262/#sec-createiterresultobject
|
|
1475
|
-
var createIterResultObject$1 = function (value, done) {
|
|
1476
|
-
return { value: value, done: done };
|
|
1477
|
-
};
|
|
1478
|
-
|
|
1479
|
-
var toIndexedObject = toIndexedObject$5;
|
|
1480
|
-
var addToUnscopables = addToUnscopables$1;
|
|
1481
|
-
var Iterators$2 = iterators;
|
|
1482
|
-
var InternalStateModule$1 = internalState;
|
|
1483
|
-
var defineProperty = objectDefineProperty.f;
|
|
1484
|
-
var defineIterator = iteratorDefine;
|
|
1485
|
-
var createIterResultObject = createIterResultObject$1;
|
|
1486
|
-
var DESCRIPTORS$1 = descriptors;
|
|
1487
|
-
|
|
1488
|
-
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1489
|
-
var setInternalState$1 = InternalStateModule$1.set;
|
|
1490
|
-
var getInternalState$1 = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
|
|
1491
|
-
|
|
1492
|
-
// `Array.prototype.entries` method
|
|
1493
|
-
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
1494
|
-
// `Array.prototype.keys` method
|
|
1495
|
-
// https://tc39.es/ecma262/#sec-array.prototype.keys
|
|
1496
|
-
// `Array.prototype.values` method
|
|
1497
|
-
// https://tc39.es/ecma262/#sec-array.prototype.values
|
|
1498
|
-
// `Array.prototype[@@iterator]` method
|
|
1499
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
|
1500
|
-
// `CreateArrayIterator` internal method
|
|
1501
|
-
// https://tc39.es/ecma262/#sec-createarrayiterator
|
|
1502
|
-
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
|
1503
|
-
setInternalState$1(this, {
|
|
1504
|
-
type: ARRAY_ITERATOR,
|
|
1505
|
-
target: toIndexedObject(iterated), // target
|
|
1506
|
-
index: 0, // next index
|
|
1507
|
-
kind: kind // kind
|
|
1508
|
-
});
|
|
1509
|
-
// `%ArrayIteratorPrototype%.next` method
|
|
1510
|
-
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1511
|
-
}, function () {
|
|
1512
|
-
var state = getInternalState$1(this);
|
|
1513
|
-
var target = state.target;
|
|
1514
|
-
var kind = state.kind;
|
|
1515
|
-
var index = state.index++;
|
|
1516
|
-
if (!target || index >= target.length) {
|
|
1517
|
-
state.target = undefined;
|
|
1518
|
-
return createIterResultObject(undefined, true);
|
|
1519
|
-
}
|
|
1520
|
-
if (kind == 'keys') return createIterResultObject(index, false);
|
|
1521
|
-
if (kind == 'values') return createIterResultObject(target[index], false);
|
|
1522
|
-
return createIterResultObject([index, target[index]], false);
|
|
1523
|
-
}, 'values');
|
|
1524
|
-
|
|
1525
|
-
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
1526
|
-
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
1527
|
-
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
1528
|
-
var values = Iterators$2.Arguments = Iterators$2.Array;
|
|
1529
|
-
|
|
1530
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1531
|
-
addToUnscopables('keys');
|
|
1532
|
-
addToUnscopables('values');
|
|
1533
|
-
addToUnscopables('entries');
|
|
1534
|
-
|
|
1535
|
-
// V8 ~ Chrome 45- bug
|
|
1536
|
-
if (DESCRIPTORS$1 && values.name !== 'values') try {
|
|
1537
|
-
defineProperty(values, 'name', { value: 'values' });
|
|
1538
|
-
} catch (error) { /* empty */ }
|
|
1539
|
-
|
|
1540
|
-
// iterable DOM collections
|
|
1541
|
-
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
1542
|
-
var domIterables = {
|
|
1543
|
-
CSSRuleList: 0,
|
|
1544
|
-
CSSStyleDeclaration: 0,
|
|
1545
|
-
CSSValueList: 0,
|
|
1546
|
-
ClientRectList: 0,
|
|
1547
|
-
DOMRectList: 0,
|
|
1548
|
-
DOMStringList: 0,
|
|
1549
|
-
DOMTokenList: 1,
|
|
1550
|
-
DataTransferItemList: 0,
|
|
1551
|
-
FileList: 0,
|
|
1552
|
-
HTMLAllCollection: 0,
|
|
1553
|
-
HTMLCollection: 0,
|
|
1554
|
-
HTMLFormElement: 0,
|
|
1555
|
-
HTMLSelectElement: 0,
|
|
1556
|
-
MediaList: 0,
|
|
1557
|
-
MimeTypeArray: 0,
|
|
1558
|
-
NamedNodeMap: 0,
|
|
1559
|
-
NodeList: 1,
|
|
1560
|
-
PaintRequestList: 0,
|
|
1561
|
-
Plugin: 0,
|
|
1562
|
-
PluginArray: 0,
|
|
1563
|
-
SVGLengthList: 0,
|
|
1564
|
-
SVGNumberList: 0,
|
|
1565
|
-
SVGPathSegList: 0,
|
|
1566
|
-
SVGPointList: 0,
|
|
1567
|
-
SVGStringList: 0,
|
|
1568
|
-
SVGTransformList: 0,
|
|
1569
|
-
SourceBufferList: 0,
|
|
1570
|
-
StyleSheetList: 0,
|
|
1571
|
-
TextTrackCueList: 0,
|
|
1572
|
-
TextTrackList: 0,
|
|
1573
|
-
TouchList: 0
|
|
1574
|
-
};
|
|
1575
|
-
|
|
1576
|
-
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
|
|
1577
|
-
var documentCreateElement = documentCreateElement$2;
|
|
1578
|
-
|
|
1579
|
-
var classList = documentCreateElement('span').classList;
|
|
1580
|
-
var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
|
|
1581
|
-
|
|
1582
|
-
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1583
|
-
|
|
1584
|
-
var global$5 = global$f;
|
|
1585
|
-
var DOMIterables = domIterables;
|
|
1586
|
-
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1587
|
-
var ArrayIteratorMethods = es_array_iterator;
|
|
1588
|
-
var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
|
|
1589
|
-
var wellKnownSymbol$7 = wellKnownSymbol$d;
|
|
1590
|
-
|
|
1591
|
-
var ITERATOR$4 = wellKnownSymbol$7('iterator');
|
|
1592
|
-
var TO_STRING_TAG$2 = wellKnownSymbol$7('toStringTag');
|
|
1593
|
-
var ArrayValues = ArrayIteratorMethods.values;
|
|
1594
|
-
|
|
1595
|
-
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
1596
|
-
if (CollectionPrototype) {
|
|
1597
|
-
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1598
|
-
if (CollectionPrototype[ITERATOR$4] !== ArrayValues) try {
|
|
1599
|
-
createNonEnumerableProperty$1(CollectionPrototype, ITERATOR$4, ArrayValues);
|
|
1600
|
-
} catch (error) {
|
|
1601
|
-
CollectionPrototype[ITERATOR$4] = ArrayValues;
|
|
1602
|
-
}
|
|
1603
|
-
if (!CollectionPrototype[TO_STRING_TAG$2]) {
|
|
1604
|
-
createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
|
|
1605
|
-
}
|
|
1606
|
-
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
|
1607
|
-
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1608
|
-
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
|
1609
|
-
createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
|
1610
|
-
} catch (error) {
|
|
1611
|
-
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
|
1612
|
-
}
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
};
|
|
1616
|
-
|
|
1617
|
-
for (var COLLECTION_NAME in DOMIterables) {
|
|
1618
|
-
handlePrototype(global$5[COLLECTION_NAME] && global$5[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
|
-
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1622
|
-
|
|
1623
11
|
/**
|
|
1624
12
|
* Minimal wrapper of i18ns Trans component - only exposing what is currently needed - while ensuring type safety on translation keys.
|
|
1625
13
|
*
|
|
1626
14
|
* @param { NamespaceTransProps } props the props for this namespace
|
|
1627
15
|
* @returns { React.ReactElement } The translated text - with safe interpolation of simple html (<strong><em><b><i> etc.)
|
|
1628
|
-
*/
|
|
1629
|
-
function NamespaceTrans(props) {
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
ns: props.namespace,
|
|
1634
|
-
i18nKey: props.i18nKey,
|
|
1635
|
-
values: props.values,
|
|
1636
|
-
components: props.components
|
|
1637
|
-
}, {
|
|
1638
|
-
children: React.Children
|
|
1639
|
-
}));
|
|
1640
|
-
}
|
|
1641
|
-
|
|
1642
|
-
var wellKnownSymbol$6 = wellKnownSymbol$d;
|
|
1643
|
-
|
|
1644
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$6('toStringTag');
|
|
1645
|
-
var test = {};
|
|
1646
|
-
|
|
1647
|
-
test[TO_STRING_TAG$1] = 'z';
|
|
1648
|
-
|
|
1649
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
1650
|
-
|
|
1651
|
-
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1652
|
-
var isCallable$2 = isCallable$h;
|
|
1653
|
-
var classofRaw$1 = classofRaw$2;
|
|
1654
|
-
var wellKnownSymbol$5 = wellKnownSymbol$d;
|
|
1655
|
-
|
|
1656
|
-
var TO_STRING_TAG = wellKnownSymbol$5('toStringTag');
|
|
1657
|
-
var $Object = Object;
|
|
1658
|
-
|
|
1659
|
-
// ES3 wrong here
|
|
1660
|
-
var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
|
|
1661
|
-
|
|
1662
|
-
// fallback for IE11 Script Access Denied error
|
|
1663
|
-
var tryGet = function (it, key) {
|
|
1664
|
-
try {
|
|
1665
|
-
return it[key];
|
|
1666
|
-
} catch (error) { /* empty */ }
|
|
1667
|
-
};
|
|
1668
|
-
|
|
1669
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
1670
|
-
var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
|
|
1671
|
-
var O, tag, result;
|
|
1672
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1673
|
-
// @@toStringTag case
|
|
1674
|
-
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1675
|
-
// builtinTag case
|
|
1676
|
-
: CORRECT_ARGUMENTS ? classofRaw$1(O)
|
|
1677
|
-
// ES3 arguments fallback
|
|
1678
|
-
: (result = classofRaw$1(O)) == 'Object' && isCallable$2(O.callee) ? 'Arguments' : result;
|
|
1679
|
-
};
|
|
1680
|
-
|
|
1681
|
-
var classof$3 = classof$4;
|
|
1682
|
-
|
|
1683
|
-
var $String = String;
|
|
1684
|
-
|
|
1685
|
-
var toString$2 = function (argument) {
|
|
1686
|
-
if (classof$3(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
1687
|
-
return $String(argument);
|
|
1688
|
-
};
|
|
1689
|
-
|
|
1690
|
-
var anObject$6 = anObject$c;
|
|
1691
|
-
|
|
1692
|
-
// `RegExp.prototype.flags` getter implementation
|
|
1693
|
-
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
1694
|
-
var regexpFlags$1 = function () {
|
|
1695
|
-
var that = anObject$6(this);
|
|
1696
|
-
var result = '';
|
|
1697
|
-
if (that.hasIndices) result += 'd';
|
|
1698
|
-
if (that.global) result += 'g';
|
|
1699
|
-
if (that.ignoreCase) result += 'i';
|
|
1700
|
-
if (that.multiline) result += 'm';
|
|
1701
|
-
if (that.dotAll) result += 's';
|
|
1702
|
-
if (that.unicode) result += 'u';
|
|
1703
|
-
if (that.unicodeSets) result += 'v';
|
|
1704
|
-
if (that.sticky) result += 'y';
|
|
1705
|
-
return result;
|
|
1706
|
-
};
|
|
1707
|
-
|
|
1708
|
-
var fails$4 = fails$g;
|
|
1709
|
-
var global$4 = global$f;
|
|
1710
|
-
|
|
1711
|
-
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
1712
|
-
var $RegExp$2 = global$4.RegExp;
|
|
1713
|
-
|
|
1714
|
-
var UNSUPPORTED_Y$1 = fails$4(function () {
|
|
1715
|
-
var re = $RegExp$2('a', 'y');
|
|
1716
|
-
re.lastIndex = 2;
|
|
1717
|
-
return re.exec('abcd') != null;
|
|
1718
|
-
});
|
|
1719
|
-
|
|
1720
|
-
// UC Browser bug
|
|
1721
|
-
// https://github.com/zloirock/core-js/issues/1008
|
|
1722
|
-
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$4(function () {
|
|
1723
|
-
return !$RegExp$2('a', 'y').sticky;
|
|
1724
|
-
});
|
|
1725
|
-
|
|
1726
|
-
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$4(function () {
|
|
1727
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
1728
|
-
var re = $RegExp$2('^r', 'gy');
|
|
1729
|
-
re.lastIndex = 2;
|
|
1730
|
-
return re.exec('str') != null;
|
|
1731
|
-
});
|
|
1732
|
-
|
|
1733
|
-
var regexpStickyHelpers = {
|
|
1734
|
-
BROKEN_CARET: BROKEN_CARET,
|
|
1735
|
-
MISSED_STICKY: MISSED_STICKY,
|
|
1736
|
-
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
1737
|
-
};
|
|
1738
|
-
|
|
1739
|
-
var fails$3 = fails$g;
|
|
1740
|
-
var global$3 = global$f;
|
|
1741
|
-
|
|
1742
|
-
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
1743
|
-
var $RegExp$1 = global$3.RegExp;
|
|
1744
|
-
|
|
1745
|
-
var regexpUnsupportedDotAll = fails$3(function () {
|
|
1746
|
-
var re = $RegExp$1('.', 's');
|
|
1747
|
-
return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
|
1748
|
-
});
|
|
1749
|
-
|
|
1750
|
-
var fails$2 = fails$g;
|
|
1751
|
-
var global$2 = global$f;
|
|
1752
|
-
|
|
1753
|
-
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
1754
|
-
var $RegExp = global$2.RegExp;
|
|
1755
|
-
|
|
1756
|
-
var regexpUnsupportedNcg = fails$2(function () {
|
|
1757
|
-
var re = $RegExp('(?<a>b)', 'g');
|
|
1758
|
-
return re.exec('b').groups.a !== 'b' ||
|
|
1759
|
-
'b'.replace(re, '$<a>c') !== 'bc';
|
|
1760
|
-
});
|
|
1761
|
-
|
|
1762
|
-
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
1763
|
-
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
1764
|
-
var call$6 = functionCall;
|
|
1765
|
-
var uncurryThis$4 = functionUncurryThis;
|
|
1766
|
-
var toString$1 = toString$2;
|
|
1767
|
-
var regexpFlags = regexpFlags$1;
|
|
1768
|
-
var stickyHelpers = regexpStickyHelpers;
|
|
1769
|
-
var shared = shared$4.exports;
|
|
1770
|
-
var create$1 = objectCreate;
|
|
1771
|
-
var getInternalState = internalState.get;
|
|
1772
|
-
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
|
1773
|
-
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
1774
|
-
|
|
1775
|
-
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
1776
|
-
var nativeExec = RegExp.prototype.exec;
|
|
1777
|
-
var patchedExec = nativeExec;
|
|
1778
|
-
var charAt$1 = uncurryThis$4(''.charAt);
|
|
1779
|
-
var indexOf = uncurryThis$4(''.indexOf);
|
|
1780
|
-
var replace$1 = uncurryThis$4(''.replace);
|
|
1781
|
-
var stringSlice$1 = uncurryThis$4(''.slice);
|
|
1782
|
-
|
|
1783
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
1784
|
-
var re1 = /a/;
|
|
1785
|
-
var re2 = /b*/g;
|
|
1786
|
-
call$6(nativeExec, re1, 'a');
|
|
1787
|
-
call$6(nativeExec, re2, 'a');
|
|
1788
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
1789
|
-
})();
|
|
1790
|
-
|
|
1791
|
-
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
|
1792
|
-
|
|
1793
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
1794
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
1795
|
-
|
|
1796
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
1797
|
-
|
|
1798
|
-
if (PATCH) {
|
|
1799
|
-
patchedExec = function exec(string) {
|
|
1800
|
-
var re = this;
|
|
1801
|
-
var state = getInternalState(re);
|
|
1802
|
-
var str = toString$1(string);
|
|
1803
|
-
var raw = state.raw;
|
|
1804
|
-
var result, reCopy, lastIndex, match, i, object, group;
|
|
1805
|
-
|
|
1806
|
-
if (raw) {
|
|
1807
|
-
raw.lastIndex = re.lastIndex;
|
|
1808
|
-
result = call$6(patchedExec, raw, str);
|
|
1809
|
-
re.lastIndex = raw.lastIndex;
|
|
1810
|
-
return result;
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
var groups = state.groups;
|
|
1814
|
-
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
1815
|
-
var flags = call$6(regexpFlags, re);
|
|
1816
|
-
var source = re.source;
|
|
1817
|
-
var charsAdded = 0;
|
|
1818
|
-
var strCopy = str;
|
|
1819
|
-
|
|
1820
|
-
if (sticky) {
|
|
1821
|
-
flags = replace$1(flags, 'y', '');
|
|
1822
|
-
if (indexOf(flags, 'g') === -1) {
|
|
1823
|
-
flags += 'g';
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
strCopy = stringSlice$1(str, re.lastIndex);
|
|
1827
|
-
// Support anchored sticky behavior.
|
|
1828
|
-
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$1(str, re.lastIndex - 1) !== '\n')) {
|
|
1829
|
-
source = '(?: ' + source + ')';
|
|
1830
|
-
strCopy = ' ' + strCopy;
|
|
1831
|
-
charsAdded++;
|
|
1832
|
-
}
|
|
1833
|
-
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
1834
|
-
// simulate the 'y' flag.
|
|
1835
|
-
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
if (NPCG_INCLUDED) {
|
|
1839
|
-
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
1840
|
-
}
|
|
1841
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
1842
|
-
|
|
1843
|
-
match = call$6(nativeExec, sticky ? reCopy : re, strCopy);
|
|
1844
|
-
|
|
1845
|
-
if (sticky) {
|
|
1846
|
-
if (match) {
|
|
1847
|
-
match.input = stringSlice$1(match.input, charsAdded);
|
|
1848
|
-
match[0] = stringSlice$1(match[0], charsAdded);
|
|
1849
|
-
match.index = re.lastIndex;
|
|
1850
|
-
re.lastIndex += match[0].length;
|
|
1851
|
-
} else re.lastIndex = 0;
|
|
1852
|
-
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
1853
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
1854
|
-
}
|
|
1855
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
1856
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
1857
|
-
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
1858
|
-
call$6(nativeReplace, match[0], reCopy, function () {
|
|
1859
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
|
1860
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
|
1861
|
-
}
|
|
1862
|
-
});
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
if (match && groups) {
|
|
1866
|
-
match.groups = object = create$1(null);
|
|
1867
|
-
for (i = 0; i < groups.length; i++) {
|
|
1868
|
-
group = groups[i];
|
|
1869
|
-
object[group[0]] = match[group[1]];
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
return match;
|
|
1874
|
-
};
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
var regexpExec$2 = patchedExec;
|
|
1878
|
-
|
|
1879
|
-
var $$2 = _export;
|
|
1880
|
-
var exec = regexpExec$2;
|
|
1881
|
-
|
|
1882
|
-
// `RegExp.prototype.exec` method
|
|
1883
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
1884
|
-
$$2({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
|
1885
|
-
exec: exec
|
|
1886
|
-
});
|
|
1887
|
-
|
|
1888
|
-
var classofRaw = classofRaw$2;
|
|
1889
|
-
var uncurryThis$3 = functionUncurryThis;
|
|
1890
|
-
|
|
1891
|
-
var functionUncurryThisClause = function (fn) {
|
|
1892
|
-
// Nashorn bug:
|
|
1893
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
1894
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
1895
|
-
if (classofRaw(fn) === 'Function') return uncurryThis$3(fn);
|
|
1896
|
-
};
|
|
1897
|
-
|
|
1898
|
-
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
1899
|
-
|
|
1900
|
-
var uncurryThis$2 = functionUncurryThisClause;
|
|
1901
|
-
var defineBuiltIn$2 = defineBuiltIn$6;
|
|
1902
|
-
var regexpExec$1 = regexpExec$2;
|
|
1903
|
-
var fails$1 = fails$g;
|
|
1904
|
-
var wellKnownSymbol$4 = wellKnownSymbol$d;
|
|
1905
|
-
var createNonEnumerableProperty = createNonEnumerableProperty$5;
|
|
1906
|
-
|
|
1907
|
-
var SPECIES = wellKnownSymbol$4('species');
|
|
1908
|
-
var RegExpPrototype = RegExp.prototype;
|
|
1909
|
-
|
|
1910
|
-
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
1911
|
-
var SYMBOL = wellKnownSymbol$4(KEY);
|
|
1912
|
-
|
|
1913
|
-
var DELEGATES_TO_SYMBOL = !fails$1(function () {
|
|
1914
|
-
// String methods call symbol-named RegEp methods
|
|
1915
|
-
var O = {};
|
|
1916
|
-
O[SYMBOL] = function () { return 7; };
|
|
1917
|
-
return ''[KEY](O) != 7;
|
|
1918
|
-
});
|
|
1919
|
-
|
|
1920
|
-
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$1(function () {
|
|
1921
|
-
// Symbol-named RegExp methods call .exec
|
|
1922
|
-
var execCalled = false;
|
|
1923
|
-
var re = /a/;
|
|
1924
|
-
|
|
1925
|
-
if (KEY === 'split') {
|
|
1926
|
-
// We can't use real regex here since it causes deoptimization
|
|
1927
|
-
// and serious performance degradation in V8
|
|
1928
|
-
// https://github.com/zloirock/core-js/issues/306
|
|
1929
|
-
re = {};
|
|
1930
|
-
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
|
1931
|
-
// a new one. We need to return the patched regex when creating the new one.
|
|
1932
|
-
re.constructor = {};
|
|
1933
|
-
re.constructor[SPECIES] = function () { return re; };
|
|
1934
|
-
re.flags = '';
|
|
1935
|
-
re[SYMBOL] = /./[SYMBOL];
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
re.exec = function () { execCalled = true; return null; };
|
|
1939
|
-
|
|
1940
|
-
re[SYMBOL]('');
|
|
1941
|
-
return !execCalled;
|
|
1942
|
-
});
|
|
1943
|
-
|
|
1944
|
-
if (
|
|
1945
|
-
!DELEGATES_TO_SYMBOL ||
|
|
1946
|
-
!DELEGATES_TO_EXEC ||
|
|
1947
|
-
FORCED
|
|
1948
|
-
) {
|
|
1949
|
-
var uncurriedNativeRegExpMethod = uncurryThis$2(/./[SYMBOL]);
|
|
1950
|
-
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
1951
|
-
var uncurriedNativeMethod = uncurryThis$2(nativeMethod);
|
|
1952
|
-
var $exec = regexp.exec;
|
|
1953
|
-
if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
|
|
1954
|
-
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
1955
|
-
// The native String method already delegates to @@method (this
|
|
1956
|
-
// polyfilled function), leasing to infinite recursion.
|
|
1957
|
-
// We avoid it by directly calling the native @@method method.
|
|
1958
|
-
return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
|
|
1959
|
-
}
|
|
1960
|
-
return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
|
|
1961
|
-
}
|
|
1962
|
-
return { done: false };
|
|
1963
|
-
});
|
|
1964
|
-
|
|
1965
|
-
defineBuiltIn$2(String.prototype, KEY, methods[0]);
|
|
1966
|
-
defineBuiltIn$2(RegExpPrototype, SYMBOL, methods[1]);
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
|
1970
|
-
};
|
|
1971
|
-
|
|
1972
|
-
// `SameValue` abstract operation
|
|
1973
|
-
// https://tc39.es/ecma262/#sec-samevalue
|
|
1974
|
-
// eslint-disable-next-line es/no-object-is -- safe
|
|
1975
|
-
var sameValue$1 = Object.is || function is(x, y) {
|
|
1976
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
1977
|
-
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
|
1978
|
-
};
|
|
1979
|
-
|
|
1980
|
-
var call$5 = functionCall;
|
|
1981
|
-
var anObject$5 = anObject$c;
|
|
1982
|
-
var isCallable$1 = isCallable$h;
|
|
1983
|
-
var classof$2 = classofRaw$2;
|
|
1984
|
-
var regexpExec = regexpExec$2;
|
|
1985
|
-
|
|
1986
|
-
var $TypeError$4 = TypeError;
|
|
1987
|
-
|
|
1988
|
-
// `RegExpExec` abstract operation
|
|
1989
|
-
// https://tc39.es/ecma262/#sec-regexpexec
|
|
1990
|
-
var regexpExecAbstract = function (R, S) {
|
|
1991
|
-
var exec = R.exec;
|
|
1992
|
-
if (isCallable$1(exec)) {
|
|
1993
|
-
var result = call$5(exec, R, S);
|
|
1994
|
-
if (result !== null) anObject$5(result);
|
|
1995
|
-
return result;
|
|
1996
|
-
}
|
|
1997
|
-
if (classof$2(R) === 'RegExp') return call$5(regexpExec, R, S);
|
|
1998
|
-
throw $TypeError$4('RegExp#exec called on incompatible receiver');
|
|
1999
|
-
};
|
|
2000
|
-
|
|
2001
|
-
var call$4 = functionCall;
|
|
2002
|
-
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
2003
|
-
var anObject$4 = anObject$c;
|
|
2004
|
-
var isNullOrUndefined$1 = isNullOrUndefined$4;
|
|
2005
|
-
var requireObjectCoercible = requireObjectCoercible$3;
|
|
2006
|
-
var sameValue = sameValue$1;
|
|
2007
|
-
var toString = toString$2;
|
|
2008
|
-
var getMethod$2 = getMethod$4;
|
|
2009
|
-
var regExpExec = regexpExecAbstract;
|
|
2010
|
-
|
|
2011
|
-
// @@search logic
|
|
2012
|
-
fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
|
|
2013
|
-
return [
|
|
2014
|
-
// `String.prototype.search` method
|
|
2015
|
-
// https://tc39.es/ecma262/#sec-string.prototype.search
|
|
2016
|
-
function search(regexp) {
|
|
2017
|
-
var O = requireObjectCoercible(this);
|
|
2018
|
-
var searcher = isNullOrUndefined$1(regexp) ? undefined : getMethod$2(regexp, SEARCH);
|
|
2019
|
-
return searcher ? call$4(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
|
|
2020
|
-
},
|
|
2021
|
-
// `RegExp.prototype[@@search]` method
|
|
2022
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@search
|
|
2023
|
-
function (string) {
|
|
2024
|
-
var rx = anObject$4(this);
|
|
2025
|
-
var S = toString(string);
|
|
2026
|
-
var res = maybeCallNative(nativeSearch, rx, S);
|
|
2027
|
-
|
|
2028
|
-
if (res.done) return res.value;
|
|
2029
|
-
|
|
2030
|
-
var previousLastIndex = rx.lastIndex;
|
|
2031
|
-
if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
|
2032
|
-
var result = regExpExec(rx, S);
|
|
2033
|
-
if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
|
2034
|
-
return result === null ? -1 : result.index;
|
|
2035
|
-
}
|
|
2036
|
-
];
|
|
2037
|
-
});
|
|
2038
|
-
|
|
2039
|
-
var fails = fails$g;
|
|
2040
|
-
var wellKnownSymbol$3 = wellKnownSymbol$d;
|
|
2041
|
-
var IS_PURE = isPure;
|
|
2042
|
-
|
|
2043
|
-
var ITERATOR$3 = wellKnownSymbol$3('iterator');
|
|
2044
|
-
|
|
2045
|
-
var urlConstructorDetection = !fails(function () {
|
|
2046
|
-
// eslint-disable-next-line unicorn/relative-url-style -- required for testing
|
|
2047
|
-
var url = new URL('b?a=1&b=2&c=3', 'http://a');
|
|
2048
|
-
var searchParams = url.searchParams;
|
|
2049
|
-
var result = '';
|
|
2050
|
-
url.pathname = 'c%20d';
|
|
2051
|
-
searchParams.forEach(function (value, key) {
|
|
2052
|
-
searchParams['delete']('b');
|
|
2053
|
-
result += key + value;
|
|
2054
|
-
});
|
|
2055
|
-
return (IS_PURE && !url.toJSON)
|
|
2056
|
-
|| !searchParams.sort
|
|
2057
|
-
|| url.href !== 'http://a/c%20d?a=1&c=3'
|
|
2058
|
-
|| searchParams.get('c') !== '3'
|
|
2059
|
-
|| String(new URLSearchParams('?a=1')) !== 'a=1'
|
|
2060
|
-
|| !searchParams[ITERATOR$3]
|
|
2061
|
-
// throws in Edge
|
|
2062
|
-
|| new URL('https://a@b').username !== 'a'
|
|
2063
|
-
|| new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
|
|
2064
|
-
// not punycoded in Edge
|
|
2065
|
-
|| new URL('http://тест').host !== 'xn--e1aybc'
|
|
2066
|
-
// not escaped in Chrome 62-
|
|
2067
|
-
|| new URL('http://a#б').hash !== '#%D0%B1'
|
|
2068
|
-
// fails in Chrome 66-
|
|
2069
|
-
|| result !== 'a1c3'
|
|
2070
|
-
// throws in Safari
|
|
2071
|
-
|| new URL('http://x', undefined).host !== 'x';
|
|
2072
|
-
});
|
|
2073
|
-
|
|
2074
|
-
var defineBuiltIn$1 = defineBuiltIn$6;
|
|
2075
|
-
|
|
2076
|
-
var defineBuiltIns$1 = function (target, src, options) {
|
|
2077
|
-
for (var key in src) defineBuiltIn$1(target, key, src[key], options);
|
|
2078
|
-
return target;
|
|
2079
|
-
};
|
|
2080
|
-
|
|
2081
|
-
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
2082
|
-
|
|
2083
|
-
var $TypeError$3 = TypeError;
|
|
2084
|
-
|
|
2085
|
-
var anInstance$1 = function (it, Prototype) {
|
|
2086
|
-
if (isPrototypeOf$1(Prototype, it)) return it;
|
|
2087
|
-
throw $TypeError$3('Incorrect invocation');
|
|
2088
|
-
};
|
|
2089
|
-
|
|
2090
|
-
var uncurryThis$1 = functionUncurryThisClause;
|
|
2091
|
-
var aCallable$1 = aCallable$3;
|
|
2092
|
-
var NATIVE_BIND = functionBindNative;
|
|
2093
|
-
|
|
2094
|
-
var bind$2 = uncurryThis$1(uncurryThis$1.bind);
|
|
2095
|
-
|
|
2096
|
-
// optional / simple context binding
|
|
2097
|
-
var functionBindContext = function (fn, that) {
|
|
2098
|
-
aCallable$1(fn);
|
|
2099
|
-
return that === undefined ? fn : NATIVE_BIND ? bind$2(fn, that) : function (/* ...args */) {
|
|
2100
|
-
return fn.apply(that, arguments);
|
|
2101
|
-
};
|
|
2102
|
-
};
|
|
2103
|
-
|
|
2104
|
-
var classof$1 = classof$4;
|
|
2105
|
-
var getMethod$1 = getMethod$4;
|
|
2106
|
-
var isNullOrUndefined = isNullOrUndefined$4;
|
|
2107
|
-
var Iterators$1 = iterators;
|
|
2108
|
-
var wellKnownSymbol$2 = wellKnownSymbol$d;
|
|
2109
|
-
|
|
2110
|
-
var ITERATOR$2 = wellKnownSymbol$2('iterator');
|
|
2111
|
-
|
|
2112
|
-
var getIteratorMethod$3 = function (it) {
|
|
2113
|
-
if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$2)
|
|
2114
|
-
|| getMethod$1(it, '@@iterator')
|
|
2115
|
-
|| Iterators$1[classof$1(it)];
|
|
2116
|
-
};
|
|
2117
|
-
|
|
2118
|
-
var call$3 = functionCall;
|
|
2119
|
-
var aCallable = aCallable$3;
|
|
2120
|
-
var anObject$3 = anObject$c;
|
|
2121
|
-
var tryToString$1 = tryToString$3;
|
|
2122
|
-
var getIteratorMethod$2 = getIteratorMethod$3;
|
|
2123
|
-
|
|
2124
|
-
var $TypeError$2 = TypeError;
|
|
2125
|
-
|
|
2126
|
-
var getIterator$2 = function (argument, usingIterator) {
|
|
2127
|
-
var iteratorMethod = arguments.length < 2 ? getIteratorMethod$2(argument) : usingIterator;
|
|
2128
|
-
if (aCallable(iteratorMethod)) return anObject$3(call$3(iteratorMethod, argument));
|
|
2129
|
-
throw $TypeError$2(tryToString$1(argument) + ' is not iterable');
|
|
2130
|
-
};
|
|
2131
|
-
|
|
2132
|
-
var $TypeError$1 = TypeError;
|
|
2133
|
-
|
|
2134
|
-
var validateArgumentsLength$1 = function (passed, required) {
|
|
2135
|
-
if (passed < required) throw $TypeError$1('Not enough arguments');
|
|
2136
|
-
return passed;
|
|
2137
|
-
};
|
|
2138
|
-
|
|
2139
|
-
var toPropertyKey = toPropertyKey$3;
|
|
2140
|
-
var definePropertyModule = objectDefineProperty;
|
|
2141
|
-
var createPropertyDescriptor$1 = createPropertyDescriptor$5;
|
|
2142
|
-
|
|
2143
|
-
var createProperty$2 = function (object, key, value) {
|
|
2144
|
-
var propertyKey = toPropertyKey(key);
|
|
2145
|
-
if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor$1(0, value));
|
|
2146
|
-
else object[propertyKey] = value;
|
|
2147
|
-
};
|
|
2148
|
-
|
|
2149
|
-
var toAbsoluteIndex = toAbsoluteIndex$2;
|
|
2150
|
-
var lengthOfArrayLike$1 = lengthOfArrayLike$3;
|
|
2151
|
-
var createProperty$1 = createProperty$2;
|
|
2152
|
-
|
|
2153
|
-
var $Array = Array;
|
|
2154
|
-
var max = Math.max;
|
|
2155
|
-
|
|
2156
|
-
var arraySliceSimple = function (O, start, end) {
|
|
2157
|
-
var length = lengthOfArrayLike$1(O);
|
|
2158
|
-
var k = toAbsoluteIndex(start, length);
|
|
2159
|
-
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
|
2160
|
-
var result = $Array(max(fin - k, 0));
|
|
2161
|
-
for (var n = 0; k < fin; k++, n++) createProperty$1(result, n, O[k]);
|
|
2162
|
-
result.length = n;
|
|
2163
|
-
return result;
|
|
2164
|
-
};
|
|
2165
|
-
|
|
2166
|
-
var arraySlice = arraySliceSimple;
|
|
2167
|
-
|
|
2168
|
-
var floor = Math.floor;
|
|
2169
|
-
|
|
2170
|
-
var mergeSort = function (array, comparefn) {
|
|
2171
|
-
var length = array.length;
|
|
2172
|
-
var middle = floor(length / 2);
|
|
2173
|
-
return length < 8 ? insertionSort(array, comparefn) : merge(
|
|
2174
|
-
array,
|
|
2175
|
-
mergeSort(arraySlice(array, 0, middle), comparefn),
|
|
2176
|
-
mergeSort(arraySlice(array, middle), comparefn),
|
|
2177
|
-
comparefn
|
|
2178
|
-
);
|
|
2179
|
-
};
|
|
2180
|
-
|
|
2181
|
-
var insertionSort = function (array, comparefn) {
|
|
2182
|
-
var length = array.length;
|
|
2183
|
-
var i = 1;
|
|
2184
|
-
var element, j;
|
|
2185
|
-
|
|
2186
|
-
while (i < length) {
|
|
2187
|
-
j = i;
|
|
2188
|
-
element = array[i];
|
|
2189
|
-
while (j && comparefn(array[j - 1], element) > 0) {
|
|
2190
|
-
array[j] = array[--j];
|
|
2191
|
-
}
|
|
2192
|
-
if (j !== i++) array[j] = element;
|
|
2193
|
-
} return array;
|
|
2194
|
-
};
|
|
2195
|
-
|
|
2196
|
-
var merge = function (array, left, right, comparefn) {
|
|
2197
|
-
var llength = left.length;
|
|
2198
|
-
var rlength = right.length;
|
|
2199
|
-
var lindex = 0;
|
|
2200
|
-
var rindex = 0;
|
|
2201
|
-
|
|
2202
|
-
while (lindex < llength || rindex < rlength) {
|
|
2203
|
-
array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
|
2204
|
-
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
|
2205
|
-
: lindex < llength ? left[lindex++] : right[rindex++];
|
|
2206
|
-
} return array;
|
|
2207
|
-
};
|
|
2208
|
-
|
|
2209
|
-
var arraySort$1 = mergeSort;
|
|
2210
|
-
|
|
2211
|
-
// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
|
|
2212
|
-
|
|
2213
|
-
var $$1 = _export;
|
|
2214
|
-
var global$1 = global$f;
|
|
2215
|
-
var call$2 = functionCall;
|
|
2216
|
-
var uncurryThis = functionUncurryThis;
|
|
2217
|
-
var DESCRIPTORS = descriptors;
|
|
2218
|
-
var USE_NATIVE_URL = urlConstructorDetection;
|
|
2219
|
-
var defineBuiltIn = defineBuiltIn$6;
|
|
2220
|
-
var defineBuiltIns = defineBuiltIns$1;
|
|
2221
|
-
var setToStringTag = setToStringTag$3;
|
|
2222
|
-
var createIteratorConstructor = iteratorCreateConstructor;
|
|
2223
|
-
var InternalStateModule = internalState;
|
|
2224
|
-
var anInstance = anInstance$1;
|
|
2225
|
-
var isCallable = isCallable$h;
|
|
2226
|
-
var hasOwn = hasOwnProperty_1;
|
|
2227
|
-
var bind$1 = functionBindContext;
|
|
2228
|
-
var classof = classof$4;
|
|
2229
|
-
var anObject$2 = anObject$c;
|
|
2230
|
-
var isObject = isObject$7;
|
|
2231
|
-
var $toString = toString$2;
|
|
2232
|
-
var create = objectCreate;
|
|
2233
|
-
var createPropertyDescriptor = createPropertyDescriptor$5;
|
|
2234
|
-
var getIterator$1 = getIterator$2;
|
|
2235
|
-
var getIteratorMethod$1 = getIteratorMethod$3;
|
|
2236
|
-
var validateArgumentsLength = validateArgumentsLength$1;
|
|
2237
|
-
var wellKnownSymbol$1 = wellKnownSymbol$d;
|
|
2238
|
-
var arraySort = arraySort$1;
|
|
2239
|
-
|
|
2240
|
-
var ITERATOR$1 = wellKnownSymbol$1('iterator');
|
|
2241
|
-
var URL_SEARCH_PARAMS = 'URLSearchParams';
|
|
2242
|
-
var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
|
|
2243
|
-
var setInternalState = InternalStateModule.set;
|
|
2244
|
-
var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
|
|
2245
|
-
var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
|
|
2246
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
2247
|
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
2248
|
-
|
|
2249
|
-
// Avoid NodeJS experimental warning
|
|
2250
|
-
var safeGetBuiltIn = function (name) {
|
|
2251
|
-
if (!DESCRIPTORS) return global$1[name];
|
|
2252
|
-
var descriptor = getOwnPropertyDescriptor(global$1, name);
|
|
2253
|
-
return descriptor && descriptor.value;
|
|
2254
|
-
};
|
|
2255
|
-
|
|
2256
|
-
var nativeFetch = safeGetBuiltIn('fetch');
|
|
2257
|
-
var NativeRequest = safeGetBuiltIn('Request');
|
|
2258
|
-
var Headers = safeGetBuiltIn('Headers');
|
|
2259
|
-
var RequestPrototype = NativeRequest && NativeRequest.prototype;
|
|
2260
|
-
var HeadersPrototype = Headers && Headers.prototype;
|
|
2261
|
-
var RegExp$1 = global$1.RegExp;
|
|
2262
|
-
var TypeError$1 = global$1.TypeError;
|
|
2263
|
-
var decodeURIComponent = global$1.decodeURIComponent;
|
|
2264
|
-
var encodeURIComponent = global$1.encodeURIComponent;
|
|
2265
|
-
var charAt = uncurryThis(''.charAt);
|
|
2266
|
-
var join = uncurryThis([].join);
|
|
2267
|
-
var push = uncurryThis([].push);
|
|
2268
|
-
var replace = uncurryThis(''.replace);
|
|
2269
|
-
var shift = uncurryThis([].shift);
|
|
2270
|
-
var splice = uncurryThis([].splice);
|
|
2271
|
-
var split = uncurryThis(''.split);
|
|
2272
|
-
var stringSlice = uncurryThis(''.slice);
|
|
2273
|
-
|
|
2274
|
-
var plus = /\+/g;
|
|
2275
|
-
var sequences = Array(4);
|
|
2276
|
-
|
|
2277
|
-
var percentSequence = function (bytes) {
|
|
2278
|
-
return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp$1('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
|
|
2279
|
-
};
|
|
2280
|
-
|
|
2281
|
-
var percentDecode = function (sequence) {
|
|
2282
|
-
try {
|
|
2283
|
-
return decodeURIComponent(sequence);
|
|
2284
|
-
} catch (error) {
|
|
2285
|
-
return sequence;
|
|
2286
|
-
}
|
|
2287
|
-
};
|
|
2288
|
-
|
|
2289
|
-
var deserialize = function (it) {
|
|
2290
|
-
var result = replace(it, plus, ' ');
|
|
2291
|
-
var bytes = 4;
|
|
2292
|
-
try {
|
|
2293
|
-
return decodeURIComponent(result);
|
|
2294
|
-
} catch (error) {
|
|
2295
|
-
while (bytes) {
|
|
2296
|
-
result = replace(result, percentSequence(bytes--), percentDecode);
|
|
2297
|
-
}
|
|
2298
|
-
return result;
|
|
2299
|
-
}
|
|
2300
|
-
};
|
|
2301
|
-
|
|
2302
|
-
var find = /[!'()~]|%20/g;
|
|
2303
|
-
|
|
2304
|
-
var replacements = {
|
|
2305
|
-
'!': '%21',
|
|
2306
|
-
"'": '%27',
|
|
2307
|
-
'(': '%28',
|
|
2308
|
-
')': '%29',
|
|
2309
|
-
'~': '%7E',
|
|
2310
|
-
'%20': '+'
|
|
2311
|
-
};
|
|
2312
|
-
|
|
2313
|
-
var replacer = function (match) {
|
|
2314
|
-
return replacements[match];
|
|
2315
|
-
};
|
|
2316
|
-
|
|
2317
|
-
var serialize = function (it) {
|
|
2318
|
-
return replace(encodeURIComponent(it), find, replacer);
|
|
2319
|
-
};
|
|
2320
|
-
|
|
2321
|
-
var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
|
|
2322
|
-
setInternalState(this, {
|
|
2323
|
-
type: URL_SEARCH_PARAMS_ITERATOR,
|
|
2324
|
-
iterator: getIterator$1(getInternalParamsState(params).entries),
|
|
2325
|
-
kind: kind
|
|
2326
|
-
});
|
|
2327
|
-
}, 'Iterator', function next() {
|
|
2328
|
-
var state = getInternalIteratorState(this);
|
|
2329
|
-
var kind = state.kind;
|
|
2330
|
-
var step = state.iterator.next();
|
|
2331
|
-
var entry = step.value;
|
|
2332
|
-
if (!step.done) {
|
|
2333
|
-
step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
|
|
2334
|
-
} return step;
|
|
2335
|
-
}, true);
|
|
2336
|
-
|
|
2337
|
-
var URLSearchParamsState = function (init) {
|
|
2338
|
-
this.entries = [];
|
|
2339
|
-
this.url = null;
|
|
2340
|
-
|
|
2341
|
-
if (init !== undefined) {
|
|
2342
|
-
if (isObject(init)) this.parseObject(init);
|
|
2343
|
-
else this.parseQuery(typeof init == 'string' ? charAt(init, 0) === '?' ? stringSlice(init, 1) : init : $toString(init));
|
|
2344
|
-
}
|
|
2345
|
-
};
|
|
2346
|
-
|
|
2347
|
-
URLSearchParamsState.prototype = {
|
|
2348
|
-
type: URL_SEARCH_PARAMS,
|
|
2349
|
-
bindURL: function (url) {
|
|
2350
|
-
this.url = url;
|
|
2351
|
-
this.update();
|
|
2352
|
-
},
|
|
2353
|
-
parseObject: function (object) {
|
|
2354
|
-
var iteratorMethod = getIteratorMethod$1(object);
|
|
2355
|
-
var iterator, next, step, entryIterator, entryNext, first, second;
|
|
2356
|
-
|
|
2357
|
-
if (iteratorMethod) {
|
|
2358
|
-
iterator = getIterator$1(object, iteratorMethod);
|
|
2359
|
-
next = iterator.next;
|
|
2360
|
-
while (!(step = call$2(next, iterator)).done) {
|
|
2361
|
-
entryIterator = getIterator$1(anObject$2(step.value));
|
|
2362
|
-
entryNext = entryIterator.next;
|
|
2363
|
-
if (
|
|
2364
|
-
(first = call$2(entryNext, entryIterator)).done ||
|
|
2365
|
-
(second = call$2(entryNext, entryIterator)).done ||
|
|
2366
|
-
!call$2(entryNext, entryIterator).done
|
|
2367
|
-
) throw TypeError$1('Expected sequence with length 2');
|
|
2368
|
-
push(this.entries, { key: $toString(first.value), value: $toString(second.value) });
|
|
2369
|
-
}
|
|
2370
|
-
} else for (var key in object) if (hasOwn(object, key)) {
|
|
2371
|
-
push(this.entries, { key: key, value: $toString(object[key]) });
|
|
2372
|
-
}
|
|
2373
|
-
},
|
|
2374
|
-
parseQuery: function (query) {
|
|
2375
|
-
if (query) {
|
|
2376
|
-
var attributes = split(query, '&');
|
|
2377
|
-
var index = 0;
|
|
2378
|
-
var attribute, entry;
|
|
2379
|
-
while (index < attributes.length) {
|
|
2380
|
-
attribute = attributes[index++];
|
|
2381
|
-
if (attribute.length) {
|
|
2382
|
-
entry = split(attribute, '=');
|
|
2383
|
-
push(this.entries, {
|
|
2384
|
-
key: deserialize(shift(entry)),
|
|
2385
|
-
value: deserialize(join(entry, '='))
|
|
2386
|
-
});
|
|
2387
|
-
}
|
|
2388
|
-
}
|
|
2389
|
-
}
|
|
2390
|
-
},
|
|
2391
|
-
serialize: function () {
|
|
2392
|
-
var entries = this.entries;
|
|
2393
|
-
var result = [];
|
|
2394
|
-
var index = 0;
|
|
2395
|
-
var entry;
|
|
2396
|
-
while (index < entries.length) {
|
|
2397
|
-
entry = entries[index++];
|
|
2398
|
-
push(result, serialize(entry.key) + '=' + serialize(entry.value));
|
|
2399
|
-
} return join(result, '&');
|
|
2400
|
-
},
|
|
2401
|
-
update: function () {
|
|
2402
|
-
this.entries.length = 0;
|
|
2403
|
-
this.parseQuery(this.url.query);
|
|
2404
|
-
},
|
|
2405
|
-
updateURL: function () {
|
|
2406
|
-
if (this.url) this.url.update();
|
|
2407
|
-
}
|
|
2408
|
-
};
|
|
2409
|
-
|
|
2410
|
-
// `URLSearchParams` constructor
|
|
2411
|
-
// https://url.spec.whatwg.org/#interface-urlsearchparams
|
|
2412
|
-
var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
|
|
2413
|
-
anInstance(this, URLSearchParamsPrototype);
|
|
2414
|
-
var init = arguments.length > 0 ? arguments[0] : undefined;
|
|
2415
|
-
setInternalState(this, new URLSearchParamsState(init));
|
|
2416
|
-
};
|
|
2417
|
-
|
|
2418
|
-
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
|
|
2419
|
-
|
|
2420
|
-
defineBuiltIns(URLSearchParamsPrototype, {
|
|
2421
|
-
// `URLSearchParams.prototype.append` method
|
|
2422
|
-
// https://url.spec.whatwg.org/#dom-urlsearchparams-append
|
|
2423
|
-
append: function append(name, value) {
|
|
2424
|
-
validateArgumentsLength(arguments.length, 2);
|
|
2425
|
-
var state = getInternalParamsState(this);
|
|
2426
|
-
push(state.entries, { key: $toString(name), value: $toString(value) });
|
|
2427
|
-
state.updateURL();
|
|
2428
|
-
},
|
|
2429
|
-
// `URLSearchParams.prototype.delete` method
|
|
2430
|
-
// https://url.spec.whatwg.org/#dom-urlsearchparams-delete
|
|
2431
|
-
'delete': function (name) {
|
|
2432
|
-
validateArgumentsLength(arguments.length, 1);
|
|
2433
|
-
var state = getInternalParamsState(this);
|
|
2434
|
-
var entries = state.entries;
|
|
2435
|
-
var key = $toString(name);
|
|
2436
|
-
var index = 0;
|
|
2437
|
-
while (index < entries.length) {
|
|
2438
|
-
if (entries[index].key === key) splice(entries, index, 1);
|
|
2439
|
-
else index++;
|
|
2440
|
-
}
|
|
2441
|
-
state.updateURL();
|
|
2442
|
-
},
|
|
2443
|
-
// `URLSearchParams.prototype.get` method
|
|
2444
|
-
// https://url.spec.whatwg.org/#dom-urlsearchparams-get
|
|
2445
|
-
get: function get(name) {
|
|
2446
|
-
validateArgumentsLength(arguments.length, 1);
|
|
2447
|
-
var entries = getInternalParamsState(this).entries;
|
|
2448
|
-
var key = $toString(name);
|
|
2449
|
-
var index = 0;
|
|
2450
|
-
for (; index < entries.length; index++) {
|
|
2451
|
-
if (entries[index].key === key) return entries[index].value;
|
|
2452
|
-
}
|
|
2453
|
-
return null;
|
|
2454
|
-
},
|
|
2455
|
-
// `URLSearchParams.prototype.getAll` method
|
|
2456
|
-
// https://url.spec.whatwg.org/#dom-urlsearchparams-getall
|
|
2457
|
-
getAll: function getAll(name) {
|
|
2458
|
-
validateArgumentsLength(arguments.length, 1);
|
|
2459
|
-
var entries = getInternalParamsState(this).entries;
|
|
2460
|
-
var key = $toString(name);
|
|
2461
|
-
var result = [];
|
|
2462
|
-
var index = 0;
|
|
2463
|
-
for (; index < entries.length; index++) {
|
|
2464
|
-
if (entries[index].key === key) push(result, entries[index].value);
|
|
2465
|
-
}
|
|
2466
|
-
return result;
|
|
2467
|
-
},
|
|
2468
|
-
// `URLSearchParams.prototype.has` method
|
|
2469
|
-
// https://url.spec.whatwg.org/#dom-urlsearchparams-has
|
|
2470
|
-
has: function has(name) {
|
|
2471
|
-
validateArgumentsLength(arguments.length, 1);
|
|
2472
|
-
var entries = getInternalParamsState(this).entries;
|
|
2473
|
-
var key = $toString(name);
|
|
2474
|
-
var index = 0;
|
|
2475
|
-
while (index < entries.length) {
|
|
2476
|
-
if (entries[index++].key === key) return true;
|
|
2477
|
-
}
|
|
2478
|
-
return false;
|
|
2479
|
-
},
|
|
2480
|
-
// `URLSearchParams.prototype.set` method
|
|
2481
|
-
// https://url.spec.whatwg.org/#dom-urlsearchparams-set
|
|
2482
|
-
set: function set(name, value) {
|
|
2483
|
-
validateArgumentsLength(arguments.length, 1);
|
|
2484
|
-
var state = getInternalParamsState(this);
|
|
2485
|
-
var entries = state.entries;
|
|
2486
|
-
var found = false;
|
|
2487
|
-
var key = $toString(name);
|
|
2488
|
-
var val = $toString(value);
|
|
2489
|
-
var index = 0;
|
|
2490
|
-
var entry;
|
|
2491
|
-
for (; index < entries.length; index++) {
|
|
2492
|
-
entry = entries[index];
|
|
2493
|
-
if (entry.key === key) {
|
|
2494
|
-
if (found) splice(entries, index--, 1);
|
|
2495
|
-
else {
|
|
2496
|
-
found = true;
|
|
2497
|
-
entry.value = val;
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
}
|
|
2501
|
-
if (!found) push(entries, { key: key, value: val });
|
|
2502
|
-
state.updateURL();
|
|
2503
|
-
},
|
|
2504
|
-
// `URLSearchParams.prototype.sort` method
|
|
2505
|
-
// https://url.spec.whatwg.org/#dom-urlsearchparams-sort
|
|
2506
|
-
sort: function sort() {
|
|
2507
|
-
var state = getInternalParamsState(this);
|
|
2508
|
-
arraySort(state.entries, function (a, b) {
|
|
2509
|
-
return a.key > b.key ? 1 : -1;
|
|
2510
|
-
});
|
|
2511
|
-
state.updateURL();
|
|
2512
|
-
},
|
|
2513
|
-
// `URLSearchParams.prototype.forEach` method
|
|
2514
|
-
forEach: function forEach(callback /* , thisArg */) {
|
|
2515
|
-
var entries = getInternalParamsState(this).entries;
|
|
2516
|
-
var boundFunction = bind$1(callback, arguments.length > 1 ? arguments[1] : undefined);
|
|
2517
|
-
var index = 0;
|
|
2518
|
-
var entry;
|
|
2519
|
-
while (index < entries.length) {
|
|
2520
|
-
entry = entries[index++];
|
|
2521
|
-
boundFunction(entry.value, entry.key, this);
|
|
2522
|
-
}
|
|
2523
|
-
},
|
|
2524
|
-
// `URLSearchParams.prototype.keys` method
|
|
2525
|
-
keys: function keys() {
|
|
2526
|
-
return new URLSearchParamsIterator(this, 'keys');
|
|
2527
|
-
},
|
|
2528
|
-
// `URLSearchParams.prototype.values` method
|
|
2529
|
-
values: function values() {
|
|
2530
|
-
return new URLSearchParamsIterator(this, 'values');
|
|
2531
|
-
},
|
|
2532
|
-
// `URLSearchParams.prototype.entries` method
|
|
2533
|
-
entries: function entries() {
|
|
2534
|
-
return new URLSearchParamsIterator(this, 'entries');
|
|
2535
|
-
}
|
|
2536
|
-
}, { enumerable: true });
|
|
2537
|
-
|
|
2538
|
-
// `URLSearchParams.prototype[@@iterator]` method
|
|
2539
|
-
defineBuiltIn(URLSearchParamsPrototype, ITERATOR$1, URLSearchParamsPrototype.entries, { name: 'entries' });
|
|
2540
|
-
|
|
2541
|
-
// `URLSearchParams.prototype.toString` method
|
|
2542
|
-
// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
|
|
2543
|
-
defineBuiltIn(URLSearchParamsPrototype, 'toString', function toString() {
|
|
2544
|
-
return getInternalParamsState(this).serialize();
|
|
2545
|
-
}, { enumerable: true });
|
|
2546
|
-
|
|
2547
|
-
setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
|
|
2548
|
-
|
|
2549
|
-
$$1({ global: true, constructor: true, forced: !USE_NATIVE_URL }, {
|
|
2550
|
-
URLSearchParams: URLSearchParamsConstructor
|
|
2551
|
-
});
|
|
2552
|
-
|
|
2553
|
-
// Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`
|
|
2554
|
-
if (!USE_NATIVE_URL && isCallable(Headers)) {
|
|
2555
|
-
var headersHas = uncurryThis(HeadersPrototype.has);
|
|
2556
|
-
var headersSet = uncurryThis(HeadersPrototype.set);
|
|
2557
|
-
|
|
2558
|
-
var wrapRequestOptions = function (init) {
|
|
2559
|
-
if (isObject(init)) {
|
|
2560
|
-
var body = init.body;
|
|
2561
|
-
var headers;
|
|
2562
|
-
if (classof(body) === URL_SEARCH_PARAMS) {
|
|
2563
|
-
headers = init.headers ? new Headers(init.headers) : new Headers();
|
|
2564
|
-
if (!headersHas(headers, 'content-type')) {
|
|
2565
|
-
headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
|
2566
|
-
}
|
|
2567
|
-
return create(init, {
|
|
2568
|
-
body: createPropertyDescriptor(0, $toString(body)),
|
|
2569
|
-
headers: createPropertyDescriptor(0, headers)
|
|
2570
|
-
});
|
|
2571
|
-
}
|
|
2572
|
-
} return init;
|
|
2573
|
-
};
|
|
2574
|
-
|
|
2575
|
-
if (isCallable(nativeFetch)) {
|
|
2576
|
-
$$1({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
|
|
2577
|
-
fetch: function fetch(input /* , init */) {
|
|
2578
|
-
return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
|
|
2579
|
-
}
|
|
2580
|
-
});
|
|
2581
|
-
}
|
|
2582
|
-
|
|
2583
|
-
if (isCallable(NativeRequest)) {
|
|
2584
|
-
var RequestConstructor = function Request(input /* , init */) {
|
|
2585
|
-
anInstance(this, RequestPrototype);
|
|
2586
|
-
return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
|
|
2587
|
-
};
|
|
2588
|
-
|
|
2589
|
-
RequestPrototype.constructor = RequestConstructor;
|
|
2590
|
-
RequestConstructor.prototype = RequestPrototype;
|
|
2591
|
-
|
|
2592
|
-
$$1({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
|
|
2593
|
-
Request: RequestConstructor
|
|
2594
|
-
});
|
|
2595
|
-
}
|
|
16
|
+
*/
|
|
17
|
+
function NamespaceTrans(props) {
|
|
18
|
+
// The as string | string[] is in order for TS to not choke on the size of the intersection
|
|
19
|
+
// "Expression produces a union type that is too complex to represent.ts(2590)"
|
|
20
|
+
return (jsx(Trans, Object.assign({ ns: props.namespace, i18nKey: props.i18nKey, values: props.values, components: props.components }, { children: React.Children })));
|
|
2596
21
|
}
|
|
2597
22
|
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
// check on default Array iterator
|
|
2605
|
-
var isArrayIteratorMethod$1 = function (it) {
|
|
2606
|
-
return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
|
2607
|
-
};
|
|
2608
|
-
|
|
2609
|
-
var call$1 = functionCall;
|
|
2610
|
-
var anObject$1 = anObject$c;
|
|
2611
|
-
var getMethod = getMethod$4;
|
|
2612
|
-
|
|
2613
|
-
var iteratorClose$1 = function (iterator, kind, value) {
|
|
2614
|
-
var innerResult, innerError;
|
|
2615
|
-
anObject$1(iterator);
|
|
2616
|
-
try {
|
|
2617
|
-
innerResult = getMethod(iterator, 'return');
|
|
2618
|
-
if (!innerResult) {
|
|
2619
|
-
if (kind === 'throw') throw value;
|
|
2620
|
-
return value;
|
|
2621
|
-
}
|
|
2622
|
-
innerResult = call$1(innerResult, iterator);
|
|
2623
|
-
} catch (error) {
|
|
2624
|
-
innerError = true;
|
|
2625
|
-
innerResult = error;
|
|
2626
|
-
}
|
|
2627
|
-
if (kind === 'throw') throw value;
|
|
2628
|
-
if (innerError) throw innerResult;
|
|
2629
|
-
anObject$1(innerResult);
|
|
2630
|
-
return value;
|
|
2631
|
-
};
|
|
2632
|
-
|
|
2633
|
-
var bind = functionBindContext;
|
|
2634
|
-
var call = functionCall;
|
|
2635
|
-
var anObject = anObject$c;
|
|
2636
|
-
var tryToString = tryToString$3;
|
|
2637
|
-
var isArrayIteratorMethod = isArrayIteratorMethod$1;
|
|
2638
|
-
var lengthOfArrayLike = lengthOfArrayLike$3;
|
|
2639
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
2640
|
-
var getIterator = getIterator$2;
|
|
2641
|
-
var getIteratorMethod = getIteratorMethod$3;
|
|
2642
|
-
var iteratorClose = iteratorClose$1;
|
|
2643
|
-
|
|
2644
|
-
var $TypeError = TypeError;
|
|
2645
|
-
|
|
2646
|
-
var Result = function (stopped, result) {
|
|
2647
|
-
this.stopped = stopped;
|
|
2648
|
-
this.result = result;
|
|
2649
|
-
};
|
|
2650
|
-
|
|
2651
|
-
var ResultPrototype = Result.prototype;
|
|
2652
|
-
|
|
2653
|
-
var iterate$1 = function (iterable, unboundFunction, options) {
|
|
2654
|
-
var that = options && options.that;
|
|
2655
|
-
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
|
2656
|
-
var IS_RECORD = !!(options && options.IS_RECORD);
|
|
2657
|
-
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
|
2658
|
-
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
|
2659
|
-
var fn = bind(unboundFunction, that);
|
|
2660
|
-
var iterator, iterFn, index, length, result, next, step;
|
|
2661
|
-
|
|
2662
|
-
var stop = function (condition) {
|
|
2663
|
-
if (iterator) iteratorClose(iterator, 'normal', condition);
|
|
2664
|
-
return new Result(true, condition);
|
|
2665
|
-
};
|
|
2666
|
-
|
|
2667
|
-
var callFn = function (value) {
|
|
2668
|
-
if (AS_ENTRIES) {
|
|
2669
|
-
anObject(value);
|
|
2670
|
-
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
|
2671
|
-
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
|
2672
|
-
};
|
|
2673
|
-
|
|
2674
|
-
if (IS_RECORD) {
|
|
2675
|
-
iterator = iterable.iterator;
|
|
2676
|
-
} else if (IS_ITERATOR) {
|
|
2677
|
-
iterator = iterable;
|
|
2678
|
-
} else {
|
|
2679
|
-
iterFn = getIteratorMethod(iterable);
|
|
2680
|
-
if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
|
|
2681
|
-
// optimisation for array iterators
|
|
2682
|
-
if (isArrayIteratorMethod(iterFn)) {
|
|
2683
|
-
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
|
2684
|
-
result = callFn(iterable[index]);
|
|
2685
|
-
if (result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
2686
|
-
} return new Result(false);
|
|
2687
|
-
}
|
|
2688
|
-
iterator = getIterator(iterable, iterFn);
|
|
2689
|
-
}
|
|
2690
|
-
|
|
2691
|
-
next = IS_RECORD ? iterable.next : iterator.next;
|
|
2692
|
-
while (!(step = call(next, iterator)).done) {
|
|
2693
|
-
try {
|
|
2694
|
-
result = callFn(step.value);
|
|
2695
|
-
} catch (error) {
|
|
2696
|
-
iteratorClose(iterator, 'throw', error);
|
|
2697
|
-
}
|
|
2698
|
-
if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
|
2699
|
-
} return new Result(false);
|
|
2700
|
-
};
|
|
2701
|
-
|
|
2702
|
-
var $ = _export;
|
|
2703
|
-
var iterate = iterate$1;
|
|
2704
|
-
var createProperty = createProperty$2;
|
|
2705
|
-
|
|
2706
|
-
// `Object.fromEntries` method
|
|
2707
|
-
// https://github.com/tc39/proposal-object-from-entries
|
|
2708
|
-
$({ target: 'Object', stat: true }, {
|
|
2709
|
-
fromEntries: function fromEntries(iterable) {
|
|
2710
|
-
var obj = {};
|
|
2711
|
-
iterate(iterable, function (k, v) {
|
|
2712
|
-
createProperty(obj, k, v);
|
|
2713
|
-
}, { AS_ENTRIES: true });
|
|
2714
|
-
return obj;
|
|
2715
|
-
}
|
|
2716
|
-
});
|
|
2717
|
-
|
|
2718
|
-
const LANG_STORAGE_KEY = "i18nextLng";
|
|
2719
|
-
/** Holds all available TranslationResource by namespace */
|
|
2720
|
-
const availableTranslations = {};
|
|
2721
|
-
/** Holds all available TranslationResource by namespace */
|
|
2722
|
-
let hasBeenInitialized = false;
|
|
23
|
+
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
|
|
24
|
+
const LANG_STORAGE_KEY = "i18nextLng";
|
|
25
|
+
/** Holds all available TranslationResource by namespace */
|
|
26
|
+
const availableTranslations = {};
|
|
27
|
+
/** Holds all available TranslationResource by namespace */
|
|
28
|
+
let hasBeenInitialized = false;
|
|
2723
29
|
/**
|
|
2724
30
|
* Use this function to register your translations before the i18next is initialized.
|
|
2725
31
|
*
|
|
@@ -2730,70 +36,78 @@ let hasBeenInitialized = false;
|
|
|
2730
36
|
* (Running the function in the barrel file ensures the translations are registered before initialization by the app)
|
|
2731
37
|
*
|
|
2732
38
|
* @param resource { TranslationResource<string> } A full translation resource object with lazy loaded translation files, default translations and namespace
|
|
2733
|
-
*/
|
|
2734
|
-
const registerTranslations = resource => {
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
};
|
|
39
|
+
*/
|
|
40
|
+
const registerTranslations = (resource) => {
|
|
41
|
+
// We only register each namespace once
|
|
42
|
+
if (!availableTranslations[resource.ns]) {
|
|
43
|
+
availableTranslations[resource.ns] = resource;
|
|
44
|
+
if (hasBeenInitialized) {
|
|
45
|
+
// If we already initialized but new namespaces was added, we initialize again...
|
|
46
|
+
initializeTranslationsForApp();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
2744
50
|
/**
|
|
2745
51
|
* A function used to initialize i18next with all registered translations.
|
|
2746
52
|
* This function is to be used in Iris App extensions and the manager, after registerTranslations has been called for all libraries.
|
|
2747
53
|
* Pass the apps/extensions TranslationResource to this function for them to be available as well.
|
|
2748
54
|
*
|
|
2749
55
|
* @param initialResource {TranslationResource}
|
|
2750
|
-
*/
|
|
2751
|
-
const initializeTranslationsForApp = () => {
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
56
|
+
*/
|
|
57
|
+
const initializeTranslationsForApp = () => {
|
|
58
|
+
var _a, _b, _c;
|
|
59
|
+
// Get selected language from url or fallback to english
|
|
60
|
+
const queryString = window.location.search;
|
|
61
|
+
const urlParams = new URLSearchParams(queryString);
|
|
62
|
+
const savedLanguage = localStorage.getItem(LANG_STORAGE_KEY);
|
|
63
|
+
const selectedLanguage = (_c = (_b = (_a = urlParams.get("lang")) !== null && _a !== void 0 ? _a : i18next.language) !== null && _b !== void 0 ? _b : savedLanguage) !== null && _c !== void 0 ? _c : "en";
|
|
64
|
+
// Collect default (English) translations for all namespaces
|
|
65
|
+
const defaultTranslations = Object.fromEntries(Object.entries(availableTranslations).map(([namespace, value]) => [namespace, value.default]));
|
|
66
|
+
const init = {
|
|
67
|
+
debug: false,
|
|
68
|
+
lng: selectedLanguage,
|
|
69
|
+
resources: {
|
|
70
|
+
// Default resources includes english translations for all namespaces.
|
|
71
|
+
en: defaultTranslations,
|
|
72
|
+
},
|
|
73
|
+
fallbackLng: "en",
|
|
74
|
+
partialBundledLanguages: true,
|
|
75
|
+
supportedLngs: languageKeys,
|
|
76
|
+
ns: Object.keys(availableTranslations),
|
|
77
|
+
keySeparator: "::",
|
|
78
|
+
interpolation: {
|
|
79
|
+
escapeValue: false,
|
|
80
|
+
},
|
|
81
|
+
react: {
|
|
82
|
+
transSupportBasicHtmlNodes: true,
|
|
83
|
+
transKeepBasicHtmlNodesFor: ["br", "strong", "i"],
|
|
84
|
+
},
|
|
85
|
+
compatibilityJSON: "v3",
|
|
86
|
+
};
|
|
87
|
+
if (!hasBeenInitialized) {
|
|
88
|
+
i18next
|
|
89
|
+
.use(browserLanguageDetector)
|
|
90
|
+
.use(resourcesToBackend((language, namespace, callback) => {
|
|
91
|
+
const resource = availableTranslations[namespace];
|
|
92
|
+
if (resource && resource.languages[language]) {
|
|
93
|
+
resource.languages[language]()
|
|
94
|
+
.then((resources) => callback(null, resources))
|
|
95
|
+
.catch(callback);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
callback({
|
|
99
|
+
name: "FAILED TO LOAD TRANSLATIONS",
|
|
100
|
+
message: `failed while loading: ${namespace} ${language} ${resource}`,
|
|
101
|
+
}, null);
|
|
102
|
+
}
|
|
103
|
+
}))
|
|
104
|
+
.use(initReactI18next)
|
|
105
|
+
.init(init);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
i18next.init(init);
|
|
109
|
+
}
|
|
110
|
+
hasBeenInitialized = true;
|
|
2797
111
|
};
|
|
2798
112
|
|
|
2799
113
|
/**
|
|
@@ -2803,33 +117,30 @@ const initializeTranslationsForApp = () => {
|
|
|
2803
117
|
* @param namespace namespace to get translations from
|
|
2804
118
|
* @param options options to send to i18next
|
|
2805
119
|
* @returns useTranslation with custom t function
|
|
2806
|
-
*/
|
|
2807
|
-
const useNamespaceTranslation = (namespace, options) => {
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
customUseTranslation
|
|
2829
|
-
|
|
2830
|
-
return customUseTranslation;
|
|
2831
|
-
}, [customUseTranslation, customT]);
|
|
2832
|
-
return updatedUseTranslation;
|
|
120
|
+
*/
|
|
121
|
+
const useNamespaceTranslation = (namespace, options) => {
|
|
122
|
+
const customUseTranslation = useTranslation(namespace, options);
|
|
123
|
+
const [t, i18NextInstance] = useTranslation(namespace, options);
|
|
124
|
+
const customT = useCallback(function (key, arg2, arg3) {
|
|
125
|
+
if (key && !i18NextInstance.exists(key, { lng: "en", ns: namespace })) {
|
|
126
|
+
Sentry.captureException(new Error(JSON.stringify({
|
|
127
|
+
info: "A Translation key could not be found!",
|
|
128
|
+
key,
|
|
129
|
+
namespace,
|
|
130
|
+
})));
|
|
131
|
+
}
|
|
132
|
+
if (arguments.length === 3 && typeof arg2 === "string") {
|
|
133
|
+
return t(key, arg2, arg3);
|
|
134
|
+
}
|
|
135
|
+
return t(key, arg2);
|
|
136
|
+
}, [i18NextInstance, namespace, t]);
|
|
137
|
+
// Replace t function with customT
|
|
138
|
+
const updatedUseTranslation = useMemo(() => {
|
|
139
|
+
customUseTranslation[0] = customT;
|
|
140
|
+
customUseTranslation.t = customT;
|
|
141
|
+
return customUseTranslation;
|
|
142
|
+
}, [customUseTranslation, customT]);
|
|
143
|
+
return updatedUseTranslation;
|
|
2833
144
|
};
|
|
2834
145
|
|
|
2835
146
|
export { NamespaceTrans, initializeTranslationsForApp, registerTranslations, useNamespaceTranslation };
|