@opengeoweb/form-fields 9.32.1 → 9.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js
CHANGED
|
@@ -3,8 +3,8 @@ import { FormControl, FormHelperText, InputLabel, Select, RadioGroup, TextField,
|
|
|
3
3
|
import { useFormContext, useController, useForm, FormProvider } from 'react-hook-form';
|
|
4
4
|
import { isEqual } from 'lodash';
|
|
5
5
|
import { dateUtils } from '@opengeoweb/shared';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
import 'i18next';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { DateTimePicker } from '@mui/x-date-pickers';
|
|
10
10
|
import { CalendarToday } from '@opengeoweb/theme';
|
|
@@ -92,2049 +92,27 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
92
92
|
return t;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var objectGetOwnPropertyDescriptor = {};
|
|
114
|
-
|
|
115
|
-
var fails$l = function (exec) {
|
|
116
|
-
try {
|
|
117
|
-
return !!exec();
|
|
118
|
-
} catch (error) {
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
var fails$k = fails$l;
|
|
124
|
-
|
|
125
|
-
// Detect IE8's incomplete defineProperty implementation
|
|
126
|
-
var descriptors = !fails$k(function () {
|
|
127
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
128
|
-
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
var fails$j = fails$l;
|
|
132
|
-
|
|
133
|
-
var functionBindNative = !fails$j(function () {
|
|
134
|
-
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
135
|
-
var test = (function () { /* empty */ }).bind();
|
|
136
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
137
|
-
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
var NATIVE_BIND$1 = functionBindNative;
|
|
141
|
-
|
|
142
|
-
var call$c = Function.prototype.call;
|
|
143
|
-
|
|
144
|
-
var functionCall = NATIVE_BIND$1 ? call$c.bind(call$c) : function () {
|
|
145
|
-
return call$c.apply(call$c, arguments);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
var objectPropertyIsEnumerable = {};
|
|
149
|
-
|
|
150
|
-
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
151
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
152
|
-
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
153
|
-
|
|
154
|
-
// Nashorn ~ JDK8 bug
|
|
155
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
156
|
-
|
|
157
|
-
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
158
|
-
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
159
|
-
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
160
|
-
var descriptor = getOwnPropertyDescriptor$1(this, V);
|
|
161
|
-
return !!descriptor && descriptor.enumerable;
|
|
162
|
-
} : $propertyIsEnumerable;
|
|
163
|
-
|
|
164
|
-
var createPropertyDescriptor$3 = function (bitmap, value) {
|
|
165
|
-
return {
|
|
166
|
-
enumerable: !(bitmap & 1),
|
|
167
|
-
configurable: !(bitmap & 2),
|
|
168
|
-
writable: !(bitmap & 4),
|
|
169
|
-
value: value
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
var NATIVE_BIND = functionBindNative;
|
|
174
|
-
|
|
175
|
-
var FunctionPrototype$1 = Function.prototype;
|
|
176
|
-
var call$b = FunctionPrototype$1.call;
|
|
177
|
-
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$b, call$b);
|
|
178
|
-
|
|
179
|
-
var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
|
|
180
|
-
return function () {
|
|
181
|
-
return call$b.apply(fn, arguments);
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
var uncurryThis$g = functionUncurryThis;
|
|
186
|
-
|
|
187
|
-
var toString$a = uncurryThis$g({}.toString);
|
|
188
|
-
var stringSlice$3 = uncurryThis$g(''.slice);
|
|
189
|
-
|
|
190
|
-
var classofRaw$1 = function (it) {
|
|
191
|
-
return stringSlice$3(toString$a(it), 8, -1);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
var uncurryThis$f = functionUncurryThis;
|
|
195
|
-
var fails$i = fails$l;
|
|
196
|
-
var classof$5 = classofRaw$1;
|
|
197
|
-
|
|
198
|
-
var $Object$4 = Object;
|
|
199
|
-
var split = uncurryThis$f(''.split);
|
|
200
|
-
|
|
201
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
202
|
-
var indexedObject = fails$i(function () {
|
|
203
|
-
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
204
|
-
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
205
|
-
return !$Object$4('z').propertyIsEnumerable(0);
|
|
206
|
-
}) ? function (it) {
|
|
207
|
-
return classof$5(it) === 'String' ? split(it, '') : $Object$4(it);
|
|
208
|
-
} : $Object$4;
|
|
209
|
-
|
|
210
|
-
// we can't use just `it == null` since of `document.all` special case
|
|
211
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
212
|
-
var isNullOrUndefined$3 = function (it) {
|
|
213
|
-
return it === null || it === undefined;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
var isNullOrUndefined$2 = isNullOrUndefined$3;
|
|
217
|
-
|
|
218
|
-
var $TypeError$9 = TypeError;
|
|
219
|
-
|
|
220
|
-
// `RequireObjectCoercible` abstract operation
|
|
221
|
-
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
222
|
-
var requireObjectCoercible$7 = function (it) {
|
|
223
|
-
if (isNullOrUndefined$2(it)) throw new $TypeError$9("Can't call method on " + it);
|
|
224
|
-
return it;
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
// toObject with fallback for non-array-like ES3 strings
|
|
228
|
-
var IndexedObject$2 = indexedObject;
|
|
229
|
-
var requireObjectCoercible$6 = requireObjectCoercible$7;
|
|
230
|
-
|
|
231
|
-
var toIndexedObject$5 = function (it) {
|
|
232
|
-
return IndexedObject$2(requireObjectCoercible$6(it));
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
236
|
-
var documentAll = typeof document == 'object' && document.all;
|
|
237
|
-
|
|
238
|
-
// `IsCallable` abstract operation
|
|
239
|
-
// https://tc39.es/ecma262/#sec-iscallable
|
|
240
|
-
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
241
|
-
var isCallable$g = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
242
|
-
return typeof argument == 'function' || argument === documentAll;
|
|
243
|
-
} : function (argument) {
|
|
244
|
-
return typeof argument == 'function';
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
var isCallable$f = isCallable$g;
|
|
248
|
-
|
|
249
|
-
var isObject$9 = function (it) {
|
|
250
|
-
return typeof it == 'object' ? it !== null : isCallable$f(it);
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
var globalThis$i = globalThis_1;
|
|
254
|
-
var isCallable$e = isCallable$g;
|
|
255
|
-
|
|
256
|
-
var aFunction = function (argument) {
|
|
257
|
-
return isCallable$e(argument) ? argument : undefined;
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
var getBuiltIn$3 = function (namespace, method) {
|
|
261
|
-
return arguments.length < 2 ? aFunction(globalThis$i[namespace]) : globalThis$i[namespace] && globalThis$i[namespace][method];
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
var uncurryThis$e = functionUncurryThis;
|
|
265
|
-
|
|
266
|
-
var objectIsPrototypeOf = uncurryThis$e({}.isPrototypeOf);
|
|
267
|
-
|
|
268
|
-
var globalThis$h = globalThis_1;
|
|
269
|
-
|
|
270
|
-
var navigator = globalThis$h.navigator;
|
|
271
|
-
var userAgent$2 = navigator && navigator.userAgent;
|
|
272
|
-
|
|
273
|
-
var environmentUserAgent = userAgent$2 ? String(userAgent$2) : '';
|
|
274
|
-
|
|
275
|
-
var globalThis$g = globalThis_1;
|
|
276
|
-
var userAgent$1 = environmentUserAgent;
|
|
277
|
-
|
|
278
|
-
var process = globalThis$g.process;
|
|
279
|
-
var Deno$1 = globalThis$g.Deno;
|
|
280
|
-
var versions = process && process.versions || Deno$1 && Deno$1.version;
|
|
281
|
-
var v8 = versions && versions.v8;
|
|
282
|
-
var match, version;
|
|
283
|
-
|
|
284
|
-
if (v8) {
|
|
285
|
-
match = v8.split('.');
|
|
286
|
-
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
287
|
-
// but their correct versions are not interesting for us
|
|
288
|
-
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
292
|
-
// so check `userAgent` even if `.v8` exists, but 0
|
|
293
|
-
if (!version && userAgent$1) {
|
|
294
|
-
match = userAgent$1.match(/Edge\/(\d+)/);
|
|
295
|
-
if (!match || match[1] >= 74) {
|
|
296
|
-
match = userAgent$1.match(/Chrome\/(\d+)/);
|
|
297
|
-
if (match) version = +match[1];
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
var environmentV8Version = version;
|
|
302
|
-
|
|
303
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
304
|
-
var V8_VERSION = environmentV8Version;
|
|
305
|
-
var fails$h = fails$l;
|
|
306
|
-
var globalThis$f = globalThis_1;
|
|
307
|
-
|
|
308
|
-
var $String$5 = globalThis$f.String;
|
|
309
|
-
|
|
310
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
311
|
-
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$h(function () {
|
|
312
|
-
var symbol = Symbol('symbol detection');
|
|
313
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
|
314
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
315
|
-
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
316
|
-
// of course, fail.
|
|
317
|
-
return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
318
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
319
|
-
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
|
323
|
-
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
324
|
-
|
|
325
|
-
var useSymbolAsUid = NATIVE_SYMBOL$1 &&
|
|
326
|
-
!Symbol.sham &&
|
|
327
|
-
typeof Symbol.iterator == 'symbol';
|
|
328
|
-
|
|
329
|
-
var getBuiltIn$2 = getBuiltIn$3;
|
|
330
|
-
var isCallable$d = isCallable$g;
|
|
331
|
-
var isPrototypeOf$1 = objectIsPrototypeOf;
|
|
332
|
-
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
333
|
-
|
|
334
|
-
var $Object$3 = Object;
|
|
335
|
-
|
|
336
|
-
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
|
337
|
-
return typeof it == 'symbol';
|
|
338
|
-
} : function (it) {
|
|
339
|
-
var $Symbol = getBuiltIn$2('Symbol');
|
|
340
|
-
return isCallable$d($Symbol) && isPrototypeOf$1($Symbol.prototype, $Object$3(it));
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
var $String$4 = String;
|
|
344
|
-
|
|
345
|
-
var tryToString$1 = function (argument) {
|
|
346
|
-
try {
|
|
347
|
-
return $String$4(argument);
|
|
348
|
-
} catch (error) {
|
|
349
|
-
return 'Object';
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
var isCallable$c = isCallable$g;
|
|
354
|
-
var tryToString = tryToString$1;
|
|
355
|
-
|
|
356
|
-
var $TypeError$8 = TypeError;
|
|
357
|
-
|
|
358
|
-
// `Assert: IsCallable(argument) is true`
|
|
359
|
-
var aCallable$3 = function (argument) {
|
|
360
|
-
if (isCallable$c(argument)) return argument;
|
|
361
|
-
throw new $TypeError$8(tryToString(argument) + ' is not a function');
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
var aCallable$2 = aCallable$3;
|
|
365
|
-
var isNullOrUndefined$1 = isNullOrUndefined$3;
|
|
366
|
-
|
|
367
|
-
// `GetMethod` abstract operation
|
|
368
|
-
// https://tc39.es/ecma262/#sec-getmethod
|
|
369
|
-
var getMethod$2 = function (V, P) {
|
|
370
|
-
var func = V[P];
|
|
371
|
-
return isNullOrUndefined$1(func) ? undefined : aCallable$2(func);
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
var call$a = functionCall;
|
|
375
|
-
var isCallable$b = isCallable$g;
|
|
376
|
-
var isObject$8 = isObject$9;
|
|
377
|
-
|
|
378
|
-
var $TypeError$7 = TypeError;
|
|
379
|
-
|
|
380
|
-
// `OrdinaryToPrimitive` abstract operation
|
|
381
|
-
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
382
|
-
var ordinaryToPrimitive$1 = function (input, pref) {
|
|
383
|
-
var fn, val;
|
|
384
|
-
if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$8(val = call$a(fn, input))) return val;
|
|
385
|
-
if (isCallable$b(fn = input.valueOf) && !isObject$8(val = call$a(fn, input))) return val;
|
|
386
|
-
if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$8(val = call$a(fn, input))) return val;
|
|
387
|
-
throw new $TypeError$7("Can't convert object to primitive value");
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
var sharedStore = {exports: {}};
|
|
391
|
-
|
|
392
|
-
var globalThis$e = globalThis_1;
|
|
393
|
-
|
|
394
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
395
|
-
var defineProperty$5 = Object.defineProperty;
|
|
396
|
-
|
|
397
|
-
var defineGlobalProperty$3 = function (key, value) {
|
|
398
|
-
try {
|
|
399
|
-
defineProperty$5(globalThis$e, key, { value: value, configurable: true, writable: true });
|
|
400
|
-
} catch (error) {
|
|
401
|
-
globalThis$e[key] = value;
|
|
402
|
-
} return value;
|
|
403
|
-
};
|
|
404
|
-
|
|
405
|
-
var globalThis$d = globalThis_1;
|
|
406
|
-
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
407
|
-
|
|
408
|
-
var SHARED = '__core-js_shared__';
|
|
409
|
-
var store$3 = sharedStore.exports = globalThis$d[SHARED] || defineGlobalProperty$2(SHARED, {});
|
|
410
|
-
|
|
411
|
-
(store$3.versions || (store$3.versions = [])).push({
|
|
412
|
-
version: '3.39.0',
|
|
413
|
-
mode: 'global',
|
|
414
|
-
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
415
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE',
|
|
416
|
-
source: 'https://github.com/zloirock/core-js'
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
var sharedStoreExports = sharedStore.exports;
|
|
420
|
-
|
|
421
|
-
var store$2 = sharedStoreExports;
|
|
422
|
-
|
|
423
|
-
var shared$4 = function (key, value) {
|
|
424
|
-
return store$2[key] || (store$2[key] = value || {});
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
var requireObjectCoercible$5 = requireObjectCoercible$7;
|
|
428
|
-
|
|
429
|
-
var $Object$2 = Object;
|
|
430
|
-
|
|
431
|
-
// `ToObject` abstract operation
|
|
432
|
-
// https://tc39.es/ecma262/#sec-toobject
|
|
433
|
-
var toObject$4 = function (argument) {
|
|
434
|
-
return $Object$2(requireObjectCoercible$5(argument));
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
var uncurryThis$d = functionUncurryThis;
|
|
438
|
-
var toObject$3 = toObject$4;
|
|
439
|
-
|
|
440
|
-
var hasOwnProperty = uncurryThis$d({}.hasOwnProperty);
|
|
441
|
-
|
|
442
|
-
// `HasOwnProperty` abstract operation
|
|
443
|
-
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
444
|
-
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
445
|
-
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
446
|
-
return hasOwnProperty(toObject$3(it), key);
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
var uncurryThis$c = functionUncurryThis;
|
|
450
|
-
|
|
451
|
-
var id = 0;
|
|
452
|
-
var postfix = Math.random();
|
|
453
|
-
var toString$9 = uncurryThis$c(1.0.toString);
|
|
454
|
-
|
|
455
|
-
var uid$2 = function (key) {
|
|
456
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$9(++id + postfix, 36);
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
var globalThis$c = globalThis_1;
|
|
460
|
-
var shared$3 = shared$4;
|
|
461
|
-
var hasOwn$9 = hasOwnProperty_1;
|
|
462
|
-
var uid$1 = uid$2;
|
|
463
|
-
var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
464
|
-
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
465
|
-
|
|
466
|
-
var Symbol$3 = globalThis$c.Symbol;
|
|
467
|
-
var WellKnownSymbolsStore = shared$3('wks');
|
|
468
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
|
|
469
|
-
|
|
470
|
-
var wellKnownSymbol$b = function (name) {
|
|
471
|
-
if (!hasOwn$9(WellKnownSymbolsStore, name)) {
|
|
472
|
-
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$9(Symbol$3, name)
|
|
473
|
-
? Symbol$3[name]
|
|
474
|
-
: createWellKnownSymbol('Symbol.' + name);
|
|
475
|
-
} return WellKnownSymbolsStore[name];
|
|
476
|
-
};
|
|
477
|
-
|
|
478
|
-
var call$9 = functionCall;
|
|
479
|
-
var isObject$7 = isObject$9;
|
|
480
|
-
var isSymbol$1 = isSymbol$2;
|
|
481
|
-
var getMethod$1 = getMethod$2;
|
|
482
|
-
var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
|
483
|
-
var wellKnownSymbol$a = wellKnownSymbol$b;
|
|
484
|
-
|
|
485
|
-
var $TypeError$6 = TypeError;
|
|
486
|
-
var TO_PRIMITIVE = wellKnownSymbol$a('toPrimitive');
|
|
487
|
-
|
|
488
|
-
// `ToPrimitive` abstract operation
|
|
489
|
-
// https://tc39.es/ecma262/#sec-toprimitive
|
|
490
|
-
var toPrimitive$1 = function (input, pref) {
|
|
491
|
-
if (!isObject$7(input) || isSymbol$1(input)) return input;
|
|
492
|
-
var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
|
|
493
|
-
var result;
|
|
494
|
-
if (exoticToPrim) {
|
|
495
|
-
if (pref === undefined) pref = 'default';
|
|
496
|
-
result = call$9(exoticToPrim, input, pref);
|
|
497
|
-
if (!isObject$7(result) || isSymbol$1(result)) return result;
|
|
498
|
-
throw new $TypeError$6("Can't convert object to primitive value");
|
|
499
|
-
}
|
|
500
|
-
if (pref === undefined) pref = 'number';
|
|
501
|
-
return ordinaryToPrimitive(input, pref);
|
|
502
|
-
};
|
|
503
|
-
|
|
504
|
-
var toPrimitive = toPrimitive$1;
|
|
505
|
-
var isSymbol = isSymbol$2;
|
|
506
|
-
|
|
507
|
-
// `ToPropertyKey` abstract operation
|
|
508
|
-
// https://tc39.es/ecma262/#sec-topropertykey
|
|
509
|
-
var toPropertyKey$2 = function (argument) {
|
|
510
|
-
var key = toPrimitive(argument, 'string');
|
|
511
|
-
return isSymbol(key) ? key : key + '';
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
var globalThis$b = globalThis_1;
|
|
515
|
-
var isObject$6 = isObject$9;
|
|
516
|
-
|
|
517
|
-
var document$1 = globalThis$b.document;
|
|
518
|
-
// typeof document.createElement is 'object' in old IE
|
|
519
|
-
var EXISTS$1 = isObject$6(document$1) && isObject$6(document$1.createElement);
|
|
520
|
-
|
|
521
|
-
var documentCreateElement$2 = function (it) {
|
|
522
|
-
return EXISTS$1 ? document$1.createElement(it) : {};
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
var DESCRIPTORS$9 = descriptors;
|
|
526
|
-
var fails$g = fails$l;
|
|
527
|
-
var createElement = documentCreateElement$2;
|
|
528
|
-
|
|
529
|
-
// Thanks to IE8 for its funny defineProperty
|
|
530
|
-
var ie8DomDefine = !DESCRIPTORS$9 && !fails$g(function () {
|
|
531
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
532
|
-
return Object.defineProperty(createElement('div'), 'a', {
|
|
533
|
-
get: function () { return 7; }
|
|
534
|
-
}).a !== 7;
|
|
535
|
-
});
|
|
536
|
-
|
|
537
|
-
var DESCRIPTORS$8 = descriptors;
|
|
538
|
-
var call$8 = functionCall;
|
|
539
|
-
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
|
540
|
-
var createPropertyDescriptor$2 = createPropertyDescriptor$3;
|
|
541
|
-
var toIndexedObject$4 = toIndexedObject$5;
|
|
542
|
-
var toPropertyKey$1 = toPropertyKey$2;
|
|
543
|
-
var hasOwn$8 = hasOwnProperty_1;
|
|
544
|
-
var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
|
545
|
-
|
|
546
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
547
|
-
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
548
|
-
|
|
549
|
-
// `Object.getOwnPropertyDescriptor` method
|
|
550
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
551
|
-
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
|
|
552
|
-
O = toIndexedObject$4(O);
|
|
553
|
-
P = toPropertyKey$1(P);
|
|
554
|
-
if (IE8_DOM_DEFINE$1) try {
|
|
555
|
-
return $getOwnPropertyDescriptor$1(O, P);
|
|
556
|
-
} catch (error) { /* empty */ }
|
|
557
|
-
if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$8(propertyIsEnumerableModule$1.f, O, P), O[P]);
|
|
558
|
-
};
|
|
559
|
-
|
|
560
|
-
var objectDefineProperty = {};
|
|
561
|
-
|
|
562
|
-
var DESCRIPTORS$7 = descriptors;
|
|
563
|
-
var fails$f = fails$l;
|
|
564
|
-
|
|
565
|
-
// V8 ~ Chrome 36-
|
|
566
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
567
|
-
var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$f(function () {
|
|
568
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
569
|
-
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
570
|
-
value: 42,
|
|
571
|
-
writable: false
|
|
572
|
-
}).prototype !== 42;
|
|
573
|
-
});
|
|
574
|
-
|
|
575
|
-
var isObject$5 = isObject$9;
|
|
576
|
-
|
|
577
|
-
var $String$3 = String;
|
|
578
|
-
var $TypeError$5 = TypeError;
|
|
579
|
-
|
|
580
|
-
// `Assert: Type(argument) is Object`
|
|
581
|
-
var anObject$9 = function (argument) {
|
|
582
|
-
if (isObject$5(argument)) return argument;
|
|
583
|
-
throw new $TypeError$5($String$3(argument) + ' is not an object');
|
|
584
|
-
};
|
|
585
|
-
|
|
586
|
-
var DESCRIPTORS$6 = descriptors;
|
|
587
|
-
var IE8_DOM_DEFINE = ie8DomDefine;
|
|
588
|
-
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
|
589
|
-
var anObject$8 = anObject$9;
|
|
590
|
-
var toPropertyKey = toPropertyKey$2;
|
|
591
|
-
|
|
592
|
-
var $TypeError$4 = TypeError;
|
|
593
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
594
|
-
var $defineProperty = Object.defineProperty;
|
|
595
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
596
|
-
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
597
|
-
var ENUMERABLE = 'enumerable';
|
|
598
|
-
var CONFIGURABLE$1 = 'configurable';
|
|
599
|
-
var WRITABLE = 'writable';
|
|
600
|
-
|
|
601
|
-
// `Object.defineProperty` method
|
|
602
|
-
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
603
|
-
objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
|
604
|
-
anObject$8(O);
|
|
605
|
-
P = toPropertyKey(P);
|
|
606
|
-
anObject$8(Attributes);
|
|
607
|
-
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
608
|
-
var current = $getOwnPropertyDescriptor(O, P);
|
|
609
|
-
if (current && current[WRITABLE]) {
|
|
610
|
-
O[P] = Attributes.value;
|
|
611
|
-
Attributes = {
|
|
612
|
-
configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
|
613
|
-
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
614
|
-
writable: false
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
|
-
} return $defineProperty(O, P, Attributes);
|
|
618
|
-
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
619
|
-
anObject$8(O);
|
|
620
|
-
P = toPropertyKey(P);
|
|
621
|
-
anObject$8(Attributes);
|
|
622
|
-
if (IE8_DOM_DEFINE) try {
|
|
623
|
-
return $defineProperty(O, P, Attributes);
|
|
624
|
-
} catch (error) { /* empty */ }
|
|
625
|
-
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$4('Accessors not supported');
|
|
626
|
-
if ('value' in Attributes) O[P] = Attributes.value;
|
|
627
|
-
return O;
|
|
628
|
-
};
|
|
629
|
-
|
|
630
|
-
var DESCRIPTORS$5 = descriptors;
|
|
631
|
-
var definePropertyModule$3 = objectDefineProperty;
|
|
632
|
-
var createPropertyDescriptor$1 = createPropertyDescriptor$3;
|
|
633
|
-
|
|
634
|
-
var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
|
|
635
|
-
return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
|
|
636
|
-
} : function (object, key, value) {
|
|
637
|
-
object[key] = value;
|
|
638
|
-
return object;
|
|
639
|
-
};
|
|
640
|
-
|
|
641
|
-
var makeBuiltIn$2 = {exports: {}};
|
|
642
|
-
|
|
643
|
-
var DESCRIPTORS$4 = descriptors;
|
|
644
|
-
var hasOwn$7 = hasOwnProperty_1;
|
|
645
|
-
|
|
646
|
-
var FunctionPrototype = Function.prototype;
|
|
647
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
648
|
-
var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
|
|
649
|
-
|
|
650
|
-
var EXISTS = hasOwn$7(FunctionPrototype, 'name');
|
|
651
|
-
// additional protection from minified / mangled / dropped function names
|
|
652
|
-
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
653
|
-
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
654
|
-
|
|
655
|
-
var functionName = {
|
|
656
|
-
EXISTS: EXISTS,
|
|
657
|
-
PROPER: PROPER,
|
|
658
|
-
CONFIGURABLE: CONFIGURABLE
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
var uncurryThis$b = functionUncurryThis;
|
|
662
|
-
var isCallable$a = isCallable$g;
|
|
663
|
-
var store$1 = sharedStoreExports;
|
|
664
|
-
|
|
665
|
-
var functionToString = uncurryThis$b(Function.toString);
|
|
666
|
-
|
|
667
|
-
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
668
|
-
if (!isCallable$a(store$1.inspectSource)) {
|
|
669
|
-
store$1.inspectSource = function (it) {
|
|
670
|
-
return functionToString(it);
|
|
671
|
-
};
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
var inspectSource$1 = store$1.inspectSource;
|
|
675
|
-
|
|
676
|
-
var globalThis$a = globalThis_1;
|
|
677
|
-
var isCallable$9 = isCallable$g;
|
|
678
|
-
|
|
679
|
-
var WeakMap$1 = globalThis$a.WeakMap;
|
|
680
|
-
|
|
681
|
-
var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
682
|
-
|
|
683
|
-
var shared$2 = shared$4;
|
|
684
|
-
var uid = uid$2;
|
|
685
|
-
|
|
686
|
-
var keys = shared$2('keys');
|
|
687
|
-
|
|
688
|
-
var sharedKey$3 = function (key) {
|
|
689
|
-
return keys[key] || (keys[key] = uid(key));
|
|
690
|
-
};
|
|
691
|
-
|
|
692
|
-
var hiddenKeys$4 = {};
|
|
693
|
-
|
|
694
|
-
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
695
|
-
var globalThis$9 = globalThis_1;
|
|
696
|
-
var isObject$4 = isObject$9;
|
|
697
|
-
var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
|
|
698
|
-
var hasOwn$6 = hasOwnProperty_1;
|
|
699
|
-
var shared$1 = sharedStoreExports;
|
|
700
|
-
var sharedKey$2 = sharedKey$3;
|
|
701
|
-
var hiddenKeys$3 = hiddenKeys$4;
|
|
702
|
-
|
|
703
|
-
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
704
|
-
var TypeError$1 = globalThis$9.TypeError;
|
|
705
|
-
var WeakMap = globalThis$9.WeakMap;
|
|
706
|
-
var set, get, has;
|
|
707
|
-
|
|
708
|
-
var enforce = function (it) {
|
|
709
|
-
return has(it) ? get(it) : set(it, {});
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
var getterFor = function (TYPE) {
|
|
713
|
-
return function (it) {
|
|
714
|
-
var state;
|
|
715
|
-
if (!isObject$4(it) || (state = get(it)).type !== TYPE) {
|
|
716
|
-
throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
|
|
717
|
-
} return state;
|
|
718
|
-
};
|
|
719
|
-
};
|
|
720
|
-
|
|
721
|
-
if (NATIVE_WEAK_MAP || shared$1.state) {
|
|
722
|
-
var store = shared$1.state || (shared$1.state = new WeakMap());
|
|
723
|
-
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
724
|
-
store.get = store.get;
|
|
725
|
-
store.has = store.has;
|
|
726
|
-
store.set = store.set;
|
|
727
|
-
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
728
|
-
set = function (it, metadata) {
|
|
729
|
-
if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
730
|
-
metadata.facade = it;
|
|
731
|
-
store.set(it, metadata);
|
|
732
|
-
return metadata;
|
|
733
|
-
};
|
|
734
|
-
get = function (it) {
|
|
735
|
-
return store.get(it) || {};
|
|
736
|
-
};
|
|
737
|
-
has = function (it) {
|
|
738
|
-
return store.has(it);
|
|
739
|
-
};
|
|
740
|
-
} else {
|
|
741
|
-
var STATE = sharedKey$2('state');
|
|
742
|
-
hiddenKeys$3[STATE] = true;
|
|
743
|
-
set = function (it, metadata) {
|
|
744
|
-
if (hasOwn$6(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
|
|
745
|
-
metadata.facade = it;
|
|
746
|
-
createNonEnumerableProperty$4(it, STATE, metadata);
|
|
747
|
-
return metadata;
|
|
748
|
-
};
|
|
749
|
-
get = function (it) {
|
|
750
|
-
return hasOwn$6(it, STATE) ? it[STATE] : {};
|
|
751
|
-
};
|
|
752
|
-
has = function (it) {
|
|
753
|
-
return hasOwn$6(it, STATE);
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
var internalState = {
|
|
758
|
-
set: set,
|
|
759
|
-
get: get,
|
|
760
|
-
has: has,
|
|
761
|
-
enforce: enforce,
|
|
762
|
-
getterFor: getterFor
|
|
763
|
-
};
|
|
764
|
-
|
|
765
|
-
var uncurryThis$a = functionUncurryThis;
|
|
766
|
-
var fails$e = fails$l;
|
|
767
|
-
var isCallable$8 = isCallable$g;
|
|
768
|
-
var hasOwn$5 = hasOwnProperty_1;
|
|
769
|
-
var DESCRIPTORS$3 = descriptors;
|
|
770
|
-
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
|
|
771
|
-
var inspectSource = inspectSource$1;
|
|
772
|
-
var InternalStateModule$1 = internalState;
|
|
773
|
-
|
|
774
|
-
var enforceInternalState = InternalStateModule$1.enforce;
|
|
775
|
-
var getInternalState$2 = InternalStateModule$1.get;
|
|
776
|
-
var $String$2 = String;
|
|
777
|
-
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
778
|
-
var defineProperty$4 = Object.defineProperty;
|
|
779
|
-
var stringSlice$2 = uncurryThis$a(''.slice);
|
|
780
|
-
var replace$2 = uncurryThis$a(''.replace);
|
|
781
|
-
var join = uncurryThis$a([].join);
|
|
782
|
-
|
|
783
|
-
var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$e(function () {
|
|
784
|
-
return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
785
|
-
});
|
|
786
|
-
|
|
787
|
-
var TEMPLATE = String(String).split('String');
|
|
788
|
-
|
|
789
|
-
var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
|
|
790
|
-
if (stringSlice$2($String$2(name), 0, 7) === 'Symbol(') {
|
|
791
|
-
name = '[' + replace$2($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
792
|
-
}
|
|
793
|
-
if (options && options.getter) name = 'get ' + name;
|
|
794
|
-
if (options && options.setter) name = 'set ' + name;
|
|
795
|
-
if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
|
|
796
|
-
if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
|
|
797
|
-
else value.name = name;
|
|
798
|
-
}
|
|
799
|
-
if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
|
|
800
|
-
defineProperty$4(value, 'length', { value: options.arity });
|
|
801
|
-
}
|
|
802
|
-
try {
|
|
803
|
-
if (options && hasOwn$5(options, 'constructor') && options.constructor) {
|
|
804
|
-
if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
|
|
805
|
-
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
806
|
-
} else if (value.prototype) value.prototype = undefined;
|
|
807
|
-
} catch (error) { /* empty */ }
|
|
808
|
-
var state = enforceInternalState(value);
|
|
809
|
-
if (!hasOwn$5(state, 'source')) {
|
|
810
|
-
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
811
|
-
} return value;
|
|
812
|
-
};
|
|
813
|
-
|
|
814
|
-
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
815
|
-
// eslint-disable-next-line no-extend-native -- required
|
|
816
|
-
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
817
|
-
return isCallable$8(this) && getInternalState$2(this).source || inspectSource(this);
|
|
818
|
-
}, 'toString');
|
|
819
|
-
|
|
820
|
-
var makeBuiltInExports = makeBuiltIn$2.exports;
|
|
821
|
-
|
|
822
|
-
var isCallable$7 = isCallable$g;
|
|
823
|
-
var definePropertyModule$2 = objectDefineProperty;
|
|
824
|
-
var makeBuiltIn = makeBuiltInExports;
|
|
825
|
-
var defineGlobalProperty$1 = defineGlobalProperty$3;
|
|
826
|
-
|
|
827
|
-
var defineBuiltIn$5 = function (O, key, value, options) {
|
|
828
|
-
if (!options) options = {};
|
|
829
|
-
var simple = options.enumerable;
|
|
830
|
-
var name = options.name !== undefined ? options.name : key;
|
|
831
|
-
if (isCallable$7(value)) makeBuiltIn(value, name, options);
|
|
832
|
-
if (options.global) {
|
|
833
|
-
if (simple) O[key] = value;
|
|
834
|
-
else defineGlobalProperty$1(key, value);
|
|
835
|
-
} else {
|
|
836
|
-
try {
|
|
837
|
-
if (!options.unsafe) delete O[key];
|
|
838
|
-
else if (O[key]) simple = true;
|
|
839
|
-
} catch (error) { /* empty */ }
|
|
840
|
-
if (simple) O[key] = value;
|
|
841
|
-
else definePropertyModule$2.f(O, key, {
|
|
842
|
-
value: value,
|
|
843
|
-
enumerable: false,
|
|
844
|
-
configurable: !options.nonConfigurable,
|
|
845
|
-
writable: !options.nonWritable
|
|
846
|
-
});
|
|
847
|
-
} return O;
|
|
848
|
-
};
|
|
849
|
-
|
|
850
|
-
var objectGetOwnPropertyNames = {};
|
|
851
|
-
|
|
852
|
-
var ceil = Math.ceil;
|
|
853
|
-
var floor = Math.floor;
|
|
854
|
-
|
|
855
|
-
// `Math.trunc` method
|
|
856
|
-
// https://tc39.es/ecma262/#sec-math.trunc
|
|
857
|
-
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
858
|
-
var mathTrunc = Math.trunc || function trunc(x) {
|
|
859
|
-
var n = +x;
|
|
860
|
-
return (n > 0 ? floor : ceil)(n);
|
|
861
|
-
};
|
|
862
|
-
|
|
863
|
-
var trunc = mathTrunc;
|
|
864
|
-
|
|
865
|
-
// `ToIntegerOrInfinity` abstract operation
|
|
866
|
-
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
867
|
-
var toIntegerOrInfinity$3 = function (argument) {
|
|
868
|
-
var number = +argument;
|
|
869
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
870
|
-
return number !== number || number === 0 ? 0 : trunc(number);
|
|
871
|
-
};
|
|
872
|
-
|
|
873
|
-
var toIntegerOrInfinity$2 = toIntegerOrInfinity$3;
|
|
874
|
-
|
|
875
|
-
var max = Math.max;
|
|
876
|
-
var min$1 = Math.min;
|
|
877
|
-
|
|
878
|
-
// Helper for a popular repeating case of the spec:
|
|
879
|
-
// Let integer be ? ToInteger(index).
|
|
880
|
-
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
881
|
-
var toAbsoluteIndex$1 = function (index, length) {
|
|
882
|
-
var integer = toIntegerOrInfinity$2(index);
|
|
883
|
-
return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
|
884
|
-
};
|
|
885
|
-
|
|
886
|
-
var toIntegerOrInfinity$1 = toIntegerOrInfinity$3;
|
|
887
|
-
|
|
888
|
-
var min = Math.min;
|
|
889
|
-
|
|
890
|
-
// `ToLength` abstract operation
|
|
891
|
-
// https://tc39.es/ecma262/#sec-tolength
|
|
892
|
-
var toLength$2 = function (argument) {
|
|
893
|
-
var len = toIntegerOrInfinity$1(argument);
|
|
894
|
-
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
895
|
-
};
|
|
896
|
-
|
|
897
|
-
var toLength$1 = toLength$2;
|
|
898
|
-
|
|
899
|
-
// `LengthOfArrayLike` abstract operation
|
|
900
|
-
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
901
|
-
var lengthOfArrayLike$2 = function (obj) {
|
|
902
|
-
return toLength$1(obj.length);
|
|
903
|
-
};
|
|
904
|
-
|
|
905
|
-
var toIndexedObject$3 = toIndexedObject$5;
|
|
906
|
-
var toAbsoluteIndex = toAbsoluteIndex$1;
|
|
907
|
-
var lengthOfArrayLike$1 = lengthOfArrayLike$2;
|
|
908
|
-
|
|
909
|
-
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
910
|
-
var createMethod$3 = function (IS_INCLUDES) {
|
|
911
|
-
return function ($this, el, fromIndex) {
|
|
912
|
-
var O = toIndexedObject$3($this);
|
|
913
|
-
var length = lengthOfArrayLike$1(O);
|
|
914
|
-
if (length === 0) return !IS_INCLUDES && -1;
|
|
915
|
-
var index = toAbsoluteIndex(fromIndex, length);
|
|
916
|
-
var value;
|
|
917
|
-
// Array#includes uses SameValueZero equality algorithm
|
|
918
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
919
|
-
if (IS_INCLUDES && el !== el) while (length > index) {
|
|
920
|
-
value = O[index++];
|
|
921
|
-
// eslint-disable-next-line no-self-compare -- NaN check
|
|
922
|
-
if (value !== value) return true;
|
|
923
|
-
// Array#indexOf ignores holes, Array#includes - not
|
|
924
|
-
} else for (;length > index; index++) {
|
|
925
|
-
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
926
|
-
} return !IS_INCLUDES && -1;
|
|
927
|
-
};
|
|
928
|
-
};
|
|
929
|
-
|
|
930
|
-
var arrayIncludes = {
|
|
931
|
-
// `Array.prototype.includes` method
|
|
932
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
933
|
-
includes: createMethod$3(true),
|
|
934
|
-
// `Array.prototype.indexOf` method
|
|
935
|
-
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
936
|
-
indexOf: createMethod$3(false)
|
|
937
|
-
};
|
|
938
|
-
|
|
939
|
-
var uncurryThis$9 = functionUncurryThis;
|
|
940
|
-
var hasOwn$4 = hasOwnProperty_1;
|
|
941
|
-
var toIndexedObject$2 = toIndexedObject$5;
|
|
942
|
-
var indexOf$1 = arrayIncludes.indexOf;
|
|
943
|
-
var hiddenKeys$2 = hiddenKeys$4;
|
|
944
|
-
|
|
945
|
-
var push = uncurryThis$9([].push);
|
|
946
|
-
|
|
947
|
-
var objectKeysInternal = function (object, names) {
|
|
948
|
-
var O = toIndexedObject$2(object);
|
|
949
|
-
var i = 0;
|
|
950
|
-
var result = [];
|
|
951
|
-
var key;
|
|
952
|
-
for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
|
|
953
|
-
// Don't enum bug & hidden keys
|
|
954
|
-
while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
|
|
955
|
-
~indexOf$1(result, key) || push(result, key);
|
|
956
|
-
}
|
|
957
|
-
return result;
|
|
958
|
-
};
|
|
959
|
-
|
|
960
|
-
// IE8- don't enum bug keys
|
|
961
|
-
var enumBugKeys$3 = [
|
|
962
|
-
'constructor',
|
|
963
|
-
'hasOwnProperty',
|
|
964
|
-
'isPrototypeOf',
|
|
965
|
-
'propertyIsEnumerable',
|
|
966
|
-
'toLocaleString',
|
|
967
|
-
'toString',
|
|
968
|
-
'valueOf'
|
|
969
|
-
];
|
|
970
|
-
|
|
971
|
-
var internalObjectKeys$1 = objectKeysInternal;
|
|
972
|
-
var enumBugKeys$2 = enumBugKeys$3;
|
|
973
|
-
|
|
974
|
-
var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
|
|
975
|
-
|
|
976
|
-
// `Object.getOwnPropertyNames` method
|
|
977
|
-
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
978
|
-
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
979
|
-
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
980
|
-
return internalObjectKeys$1(O, hiddenKeys$1);
|
|
981
|
-
};
|
|
982
|
-
|
|
983
|
-
var objectGetOwnPropertySymbols = {};
|
|
984
|
-
|
|
985
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
986
|
-
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
987
|
-
|
|
988
|
-
var getBuiltIn$1 = getBuiltIn$3;
|
|
989
|
-
var uncurryThis$8 = functionUncurryThis;
|
|
990
|
-
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
991
|
-
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
992
|
-
var anObject$7 = anObject$9;
|
|
993
|
-
|
|
994
|
-
var concat$1 = uncurryThis$8([].concat);
|
|
995
|
-
|
|
996
|
-
// all object keys, includes non-enumerable and symbols
|
|
997
|
-
var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
998
|
-
var keys = getOwnPropertyNamesModule.f(anObject$7(it));
|
|
999
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
|
1000
|
-
return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
|
-
var hasOwn$3 = hasOwnProperty_1;
|
|
1004
|
-
var ownKeys = ownKeys$1;
|
|
1005
|
-
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
|
1006
|
-
var definePropertyModule$1 = objectDefineProperty;
|
|
1007
|
-
|
|
1008
|
-
var copyConstructorProperties$1 = function (target, source, exceptions) {
|
|
1009
|
-
var keys = ownKeys(source);
|
|
1010
|
-
var defineProperty = definePropertyModule$1.f;
|
|
1011
|
-
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
1012
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1013
|
-
var key = keys[i];
|
|
1014
|
-
if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
|
|
1015
|
-
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
};
|
|
1019
|
-
|
|
1020
|
-
var fails$d = fails$l;
|
|
1021
|
-
var isCallable$6 = isCallable$g;
|
|
1022
|
-
|
|
1023
|
-
var replacement = /#|\.prototype\./;
|
|
1024
|
-
|
|
1025
|
-
var isForced$1 = function (feature, detection) {
|
|
1026
|
-
var value = data[normalize(feature)];
|
|
1027
|
-
return value === POLYFILL ? true
|
|
1028
|
-
: value === NATIVE ? false
|
|
1029
|
-
: isCallable$6(detection) ? fails$d(detection)
|
|
1030
|
-
: !!detection;
|
|
1031
|
-
};
|
|
1032
|
-
|
|
1033
|
-
var normalize = isForced$1.normalize = function (string) {
|
|
1034
|
-
return String(string).replace(replacement, '.').toLowerCase();
|
|
1035
|
-
};
|
|
1036
|
-
|
|
1037
|
-
var data = isForced$1.data = {};
|
|
1038
|
-
var NATIVE = isForced$1.NATIVE = 'N';
|
|
1039
|
-
var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
1040
|
-
|
|
1041
|
-
var isForced_1 = isForced$1;
|
|
1042
|
-
|
|
1043
|
-
var globalThis$8 = globalThis_1;
|
|
1044
|
-
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1045
|
-
var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
|
|
1046
|
-
var defineBuiltIn$4 = defineBuiltIn$5;
|
|
1047
|
-
var defineGlobalProperty = defineGlobalProperty$3;
|
|
1048
|
-
var copyConstructorProperties = copyConstructorProperties$1;
|
|
1049
|
-
var isForced = isForced_1;
|
|
1050
|
-
|
|
1051
|
-
/*
|
|
1052
|
-
options.target - name of the target object
|
|
1053
|
-
options.global - target is the global object
|
|
1054
|
-
options.stat - export as static methods of target
|
|
1055
|
-
options.proto - export as prototype methods of target
|
|
1056
|
-
options.real - real prototype method for the `pure` version
|
|
1057
|
-
options.forced - export even if the native feature is available
|
|
1058
|
-
options.bind - bind methods to the target, required for the `pure` version
|
|
1059
|
-
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
1060
|
-
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
1061
|
-
options.sham - add a flag to not completely full polyfills
|
|
1062
|
-
options.enumerable - export as enumerable property
|
|
1063
|
-
options.dontCallGetSet - prevent calling a getter on target
|
|
1064
|
-
options.name - the .name of the function if it does not match the key
|
|
1065
|
-
*/
|
|
1066
|
-
var _export = function (options, source) {
|
|
1067
|
-
var TARGET = options.target;
|
|
1068
|
-
var GLOBAL = options.global;
|
|
1069
|
-
var STATIC = options.stat;
|
|
1070
|
-
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1071
|
-
if (GLOBAL) {
|
|
1072
|
-
target = globalThis$8;
|
|
1073
|
-
} else if (STATIC) {
|
|
1074
|
-
target = globalThis$8[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1075
|
-
} else {
|
|
1076
|
-
target = globalThis$8[TARGET] && globalThis$8[TARGET].prototype;
|
|
1077
|
-
}
|
|
1078
|
-
if (target) for (key in source) {
|
|
1079
|
-
sourceProperty = source[key];
|
|
1080
|
-
if (options.dontCallGetSet) {
|
|
1081
|
-
descriptor = getOwnPropertyDescriptor(target, key);
|
|
1082
|
-
targetProperty = descriptor && descriptor.value;
|
|
1083
|
-
} else targetProperty = target[key];
|
|
1084
|
-
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
1085
|
-
// contained in target
|
|
1086
|
-
if (!FORCED && targetProperty !== undefined) {
|
|
1087
|
-
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
1088
|
-
copyConstructorProperties(sourceProperty, targetProperty);
|
|
1089
|
-
}
|
|
1090
|
-
// add a flag to not completely full polyfills
|
|
1091
|
-
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1092
|
-
createNonEnumerableProperty$3(sourceProperty, 'sham', true);
|
|
1093
|
-
}
|
|
1094
|
-
defineBuiltIn$4(target, key, sourceProperty, options);
|
|
1095
|
-
}
|
|
1096
|
-
};
|
|
1097
|
-
|
|
1098
|
-
var internalObjectKeys = objectKeysInternal;
|
|
1099
|
-
var enumBugKeys$1 = enumBugKeys$3;
|
|
1100
|
-
|
|
1101
|
-
// `Object.keys` method
|
|
1102
|
-
// https://tc39.es/ecma262/#sec-object.keys
|
|
1103
|
-
// eslint-disable-next-line es/no-object-keys -- safe
|
|
1104
|
-
var objectKeys$2 = Object.keys || function keys(O) {
|
|
1105
|
-
return internalObjectKeys(O, enumBugKeys$1);
|
|
1106
|
-
};
|
|
1107
|
-
|
|
1108
|
-
var DESCRIPTORS$2 = descriptors;
|
|
1109
|
-
var uncurryThis$7 = functionUncurryThis;
|
|
1110
|
-
var call$7 = functionCall;
|
|
1111
|
-
var fails$c = fails$l;
|
|
1112
|
-
var objectKeys$1 = objectKeys$2;
|
|
1113
|
-
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
|
1114
|
-
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
|
1115
|
-
var toObject$2 = toObject$4;
|
|
1116
|
-
var IndexedObject$1 = indexedObject;
|
|
1117
|
-
|
|
1118
|
-
// eslint-disable-next-line es/no-object-assign -- safe
|
|
1119
|
-
var $assign = Object.assign;
|
|
1120
|
-
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1121
|
-
var defineProperty$3 = Object.defineProperty;
|
|
1122
|
-
var concat = uncurryThis$7([].concat);
|
|
1123
|
-
|
|
1124
|
-
// `Object.assign` method
|
|
1125
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
1126
|
-
var objectAssign = !$assign || fails$c(function () {
|
|
1127
|
-
// should have correct order of operations (Edge bug)
|
|
1128
|
-
if (DESCRIPTORS$2 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
|
|
1129
|
-
enumerable: true,
|
|
1130
|
-
get: function () {
|
|
1131
|
-
defineProperty$3(this, 'b', {
|
|
1132
|
-
value: 3,
|
|
1133
|
-
enumerable: false
|
|
1134
|
-
});
|
|
1135
|
-
}
|
|
1136
|
-
}), { b: 2 })).b !== 1) return true;
|
|
1137
|
-
// should work with symbols and should have deterministic property order (V8 bug)
|
|
1138
|
-
var A = {};
|
|
1139
|
-
var B = {};
|
|
1140
|
-
// eslint-disable-next-line es/no-symbol -- safe
|
|
1141
|
-
var symbol = Symbol('assign detection');
|
|
1142
|
-
var alphabet = 'abcdefghijklmnopqrst';
|
|
1143
|
-
A[symbol] = 7;
|
|
1144
|
-
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
|
1145
|
-
return $assign({}, A)[symbol] !== 7 || objectKeys$1($assign({}, B)).join('') !== alphabet;
|
|
1146
|
-
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
|
|
1147
|
-
var T = toObject$2(target);
|
|
1148
|
-
var argumentsLength = arguments.length;
|
|
1149
|
-
var index = 1;
|
|
1150
|
-
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1151
|
-
var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
|
1152
|
-
while (argumentsLength > index) {
|
|
1153
|
-
var S = IndexedObject$1(arguments[index++]);
|
|
1154
|
-
var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
|
|
1155
|
-
var length = keys.length;
|
|
1156
|
-
var j = 0;
|
|
1157
|
-
var key;
|
|
1158
|
-
while (length > j) {
|
|
1159
|
-
key = keys[j++];
|
|
1160
|
-
if (!DESCRIPTORS$2 || call$7(propertyIsEnumerable, S, key)) T[key] = S[key];
|
|
1161
|
-
}
|
|
1162
|
-
} return T;
|
|
1163
|
-
} : $assign;
|
|
1164
|
-
|
|
1165
|
-
var $$9 = _export;
|
|
1166
|
-
var assign = objectAssign;
|
|
1167
|
-
|
|
1168
|
-
// `Object.assign` method
|
|
1169
|
-
// https://tc39.es/ecma262/#sec-object.assign
|
|
1170
|
-
// eslint-disable-next-line es/no-object-assign -- required for testing
|
|
1171
|
-
$$9({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
|
|
1172
|
-
assign: assign
|
|
1173
|
-
});
|
|
1174
|
-
|
|
1175
|
-
var objectDefineProperties = {};
|
|
1176
|
-
|
|
1177
|
-
var DESCRIPTORS$1 = descriptors;
|
|
1178
|
-
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
|
1179
|
-
var definePropertyModule = objectDefineProperty;
|
|
1180
|
-
var anObject$6 = anObject$9;
|
|
1181
|
-
var toIndexedObject$1 = toIndexedObject$5;
|
|
1182
|
-
var objectKeys = objectKeys$2;
|
|
1183
|
-
|
|
1184
|
-
// `Object.defineProperties` method
|
|
1185
|
-
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
1186
|
-
// eslint-disable-next-line es/no-object-defineproperties -- safe
|
|
1187
|
-
objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
1188
|
-
anObject$6(O);
|
|
1189
|
-
var props = toIndexedObject$1(Properties);
|
|
1190
|
-
var keys = objectKeys(Properties);
|
|
1191
|
-
var length = keys.length;
|
|
1192
|
-
var index = 0;
|
|
1193
|
-
var key;
|
|
1194
|
-
while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
|
1195
|
-
return O;
|
|
1196
|
-
};
|
|
1197
|
-
|
|
1198
|
-
var getBuiltIn = getBuiltIn$3;
|
|
1199
|
-
|
|
1200
|
-
var html$1 = getBuiltIn('document', 'documentElement');
|
|
1201
|
-
|
|
1202
|
-
/* global ActiveXObject -- old IE, WSH */
|
|
1203
|
-
var anObject$5 = anObject$9;
|
|
1204
|
-
var definePropertiesModule = objectDefineProperties;
|
|
1205
|
-
var enumBugKeys = enumBugKeys$3;
|
|
1206
|
-
var hiddenKeys = hiddenKeys$4;
|
|
1207
|
-
var html = html$1;
|
|
1208
|
-
var documentCreateElement$1 = documentCreateElement$2;
|
|
1209
|
-
var sharedKey$1 = sharedKey$3;
|
|
1210
|
-
|
|
1211
|
-
var GT = '>';
|
|
1212
|
-
var LT = '<';
|
|
1213
|
-
var PROTOTYPE = 'prototype';
|
|
1214
|
-
var SCRIPT = 'script';
|
|
1215
|
-
var IE_PROTO$1 = sharedKey$1('IE_PROTO');
|
|
1216
|
-
|
|
1217
|
-
var EmptyConstructor = function () { /* empty */ };
|
|
1218
|
-
|
|
1219
|
-
var scriptTag = function (content) {
|
|
1220
|
-
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
1221
|
-
};
|
|
1222
|
-
|
|
1223
|
-
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
1224
|
-
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
1225
|
-
activeXDocument.write(scriptTag(''));
|
|
1226
|
-
activeXDocument.close();
|
|
1227
|
-
var temp = activeXDocument.parentWindow.Object;
|
|
1228
|
-
// eslint-disable-next-line no-useless-assignment -- avoid memory leak
|
|
1229
|
-
activeXDocument = null;
|
|
1230
|
-
return temp;
|
|
1231
|
-
};
|
|
1232
|
-
|
|
1233
|
-
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
1234
|
-
var NullProtoObjectViaIFrame = function () {
|
|
1235
|
-
// Thrash, waste and sodomy: IE GC bug
|
|
1236
|
-
var iframe = documentCreateElement$1('iframe');
|
|
1237
|
-
var JS = 'java' + SCRIPT + ':';
|
|
1238
|
-
var iframeDocument;
|
|
1239
|
-
iframe.style.display = 'none';
|
|
1240
|
-
html.appendChild(iframe);
|
|
1241
|
-
// https://github.com/zloirock/core-js/issues/475
|
|
1242
|
-
iframe.src = String(JS);
|
|
1243
|
-
iframeDocument = iframe.contentWindow.document;
|
|
1244
|
-
iframeDocument.open();
|
|
1245
|
-
iframeDocument.write(scriptTag('document.F=Object'));
|
|
1246
|
-
iframeDocument.close();
|
|
1247
|
-
return iframeDocument.F;
|
|
1248
|
-
};
|
|
1249
|
-
|
|
1250
|
-
// Check for document.domain and active x support
|
|
1251
|
-
// No need to use active x approach when document.domain is not set
|
|
1252
|
-
// see https://github.com/es-shims/es5-shim/issues/150
|
|
1253
|
-
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
1254
|
-
// avoid IE GC bug
|
|
1255
|
-
var activeXDocument;
|
|
1256
|
-
var NullProtoObject = function () {
|
|
1257
|
-
try {
|
|
1258
|
-
activeXDocument = new ActiveXObject('htmlfile');
|
|
1259
|
-
} catch (error) { /* ignore */ }
|
|
1260
|
-
NullProtoObject = typeof document != 'undefined'
|
|
1261
|
-
? document.domain && activeXDocument
|
|
1262
|
-
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
1263
|
-
: NullProtoObjectViaIFrame()
|
|
1264
|
-
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
1265
|
-
var length = enumBugKeys.length;
|
|
1266
|
-
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
1267
|
-
return NullProtoObject();
|
|
1268
|
-
};
|
|
1269
|
-
|
|
1270
|
-
hiddenKeys[IE_PROTO$1] = true;
|
|
1271
|
-
|
|
1272
|
-
// `Object.create` method
|
|
1273
|
-
// https://tc39.es/ecma262/#sec-object.create
|
|
1274
|
-
// eslint-disable-next-line es/no-object-create -- safe
|
|
1275
|
-
var objectCreate = Object.create || function create(O, Properties) {
|
|
1276
|
-
var result;
|
|
1277
|
-
if (O !== null) {
|
|
1278
|
-
EmptyConstructor[PROTOTYPE] = anObject$5(O);
|
|
1279
|
-
result = new EmptyConstructor();
|
|
1280
|
-
EmptyConstructor[PROTOTYPE] = null;
|
|
1281
|
-
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
1282
|
-
result[IE_PROTO$1] = O;
|
|
1283
|
-
} else result = NullProtoObject();
|
|
1284
|
-
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
|
1285
|
-
};
|
|
1286
|
-
|
|
1287
|
-
var wellKnownSymbol$9 = wellKnownSymbol$b;
|
|
1288
|
-
var create$2 = objectCreate;
|
|
1289
|
-
var defineProperty$2 = objectDefineProperty.f;
|
|
1290
|
-
|
|
1291
|
-
var UNSCOPABLES = wellKnownSymbol$9('unscopables');
|
|
1292
|
-
var ArrayPrototype = Array.prototype;
|
|
1293
|
-
|
|
1294
|
-
// Array.prototype[@@unscopables]
|
|
1295
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1296
|
-
if (ArrayPrototype[UNSCOPABLES] === undefined) {
|
|
1297
|
-
defineProperty$2(ArrayPrototype, UNSCOPABLES, {
|
|
1298
|
-
configurable: true,
|
|
1299
|
-
value: create$2(null)
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
// add a key to Array.prototype[@@unscopables]
|
|
1304
|
-
var addToUnscopables$2 = function (key) {
|
|
1305
|
-
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
1306
|
-
};
|
|
1307
|
-
|
|
1308
|
-
var iterators = {};
|
|
1309
|
-
|
|
1310
|
-
var fails$b = fails$l;
|
|
1311
|
-
|
|
1312
|
-
var correctPrototypeGetter = !fails$b(function () {
|
|
1313
|
-
function F() { /* empty */ }
|
|
1314
|
-
F.prototype.constructor = null;
|
|
1315
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
|
1316
|
-
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
1317
|
-
});
|
|
1318
|
-
|
|
1319
|
-
var hasOwn$2 = hasOwnProperty_1;
|
|
1320
|
-
var isCallable$5 = isCallable$g;
|
|
1321
|
-
var toObject$1 = toObject$4;
|
|
1322
|
-
var sharedKey = sharedKey$3;
|
|
1323
|
-
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
|
1324
|
-
|
|
1325
|
-
var IE_PROTO = sharedKey('IE_PROTO');
|
|
1326
|
-
var $Object$1 = Object;
|
|
1327
|
-
var ObjectPrototype = $Object$1.prototype;
|
|
1328
|
-
|
|
1329
|
-
// `Object.getPrototypeOf` method
|
|
1330
|
-
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
1331
|
-
// eslint-disable-next-line es/no-object-getprototypeof -- safe
|
|
1332
|
-
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
|
|
1333
|
-
var object = toObject$1(O);
|
|
1334
|
-
if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
|
|
1335
|
-
var constructor = object.constructor;
|
|
1336
|
-
if (isCallable$5(constructor) && object instanceof constructor) {
|
|
1337
|
-
return constructor.prototype;
|
|
1338
|
-
} return object instanceof $Object$1 ? ObjectPrototype : null;
|
|
1339
|
-
};
|
|
1340
|
-
|
|
1341
|
-
var fails$a = fails$l;
|
|
1342
|
-
var isCallable$4 = isCallable$g;
|
|
1343
|
-
var isObject$3 = isObject$9;
|
|
1344
|
-
var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
1345
|
-
var defineBuiltIn$3 = defineBuiltIn$5;
|
|
1346
|
-
var wellKnownSymbol$8 = wellKnownSymbol$b;
|
|
1347
|
-
|
|
1348
|
-
var ITERATOR$4 = wellKnownSymbol$8('iterator');
|
|
1349
|
-
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1350
|
-
|
|
1351
|
-
// `%IteratorPrototype%` object
|
|
1352
|
-
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
1353
|
-
var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
1354
|
-
|
|
1355
|
-
/* eslint-disable es/no-array-prototype-keys -- safe */
|
|
1356
|
-
if ([].keys) {
|
|
1357
|
-
arrayIterator = [].keys();
|
|
1358
|
-
// Safari 8 has buggy iterators w/o `next`
|
|
1359
|
-
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
|
1360
|
-
else {
|
|
1361
|
-
PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
|
|
1362
|
-
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
var NEW_ITERATOR_PROTOTYPE = !isObject$3(IteratorPrototype$2) || fails$a(function () {
|
|
1367
|
-
var test = {};
|
|
1368
|
-
// FF44- legacy iterators case
|
|
1369
|
-
return IteratorPrototype$2[ITERATOR$4].call(test) !== test;
|
|
1370
|
-
});
|
|
1371
|
-
|
|
1372
|
-
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
1373
|
-
|
|
1374
|
-
// `%IteratorPrototype%[@@iterator]()` method
|
|
1375
|
-
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1376
|
-
if (!isCallable$4(IteratorPrototype$2[ITERATOR$4])) {
|
|
1377
|
-
defineBuiltIn$3(IteratorPrototype$2, ITERATOR$4, function () {
|
|
1378
|
-
return this;
|
|
1379
|
-
});
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
var iteratorsCore = {
|
|
1383
|
-
IteratorPrototype: IteratorPrototype$2,
|
|
1384
|
-
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
|
1385
|
-
};
|
|
1386
|
-
|
|
1387
|
-
var defineProperty$1 = objectDefineProperty.f;
|
|
1388
|
-
var hasOwn$1 = hasOwnProperty_1;
|
|
1389
|
-
var wellKnownSymbol$7 = wellKnownSymbol$b;
|
|
1390
|
-
|
|
1391
|
-
var TO_STRING_TAG$2 = wellKnownSymbol$7('toStringTag');
|
|
1392
|
-
|
|
1393
|
-
var setToStringTag$3 = function (target, TAG, STATIC) {
|
|
1394
|
-
if (target && !STATIC) target = target.prototype;
|
|
1395
|
-
if (target && !hasOwn$1(target, TO_STRING_TAG$2)) {
|
|
1396
|
-
defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
|
1397
|
-
}
|
|
1398
|
-
};
|
|
1399
|
-
|
|
1400
|
-
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
|
1401
|
-
var create$1 = objectCreate;
|
|
1402
|
-
var createPropertyDescriptor = createPropertyDescriptor$3;
|
|
1403
|
-
var setToStringTag$2 = setToStringTag$3;
|
|
1404
|
-
var Iterators$2 = iterators;
|
|
1405
|
-
|
|
1406
|
-
var returnThis$1 = function () { return this; };
|
|
1407
|
-
|
|
1408
|
-
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
|
1409
|
-
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1410
|
-
IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
|
|
1411
|
-
setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
|
|
1412
|
-
Iterators$2[TO_STRING_TAG] = returnThis$1;
|
|
1413
|
-
return IteratorConstructor;
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
|
-
var uncurryThis$6 = functionUncurryThis;
|
|
1417
|
-
var aCallable$1 = aCallable$3;
|
|
1418
|
-
|
|
1419
|
-
var functionUncurryThisAccessor = function (object, key, method) {
|
|
1420
|
-
try {
|
|
1421
|
-
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1422
|
-
return uncurryThis$6(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
1423
|
-
} catch (error) { /* empty */ }
|
|
1424
|
-
};
|
|
1425
|
-
|
|
1426
|
-
var isObject$2 = isObject$9;
|
|
1427
|
-
|
|
1428
|
-
var isPossiblePrototype$1 = function (argument) {
|
|
1429
|
-
return isObject$2(argument) || argument === null;
|
|
1430
|
-
};
|
|
1431
|
-
|
|
1432
|
-
var isPossiblePrototype = isPossiblePrototype$1;
|
|
1433
|
-
|
|
1434
|
-
var $String$1 = String;
|
|
1435
|
-
var $TypeError$3 = TypeError;
|
|
1436
|
-
|
|
1437
|
-
var aPossiblePrototype$1 = function (argument) {
|
|
1438
|
-
if (isPossiblePrototype(argument)) return argument;
|
|
1439
|
-
throw new $TypeError$3("Can't set " + $String$1(argument) + ' as a prototype');
|
|
1440
|
-
};
|
|
1441
|
-
|
|
1442
|
-
/* eslint-disable no-proto -- safe */
|
|
1443
|
-
var uncurryThisAccessor = functionUncurryThisAccessor;
|
|
1444
|
-
var isObject$1 = isObject$9;
|
|
1445
|
-
var requireObjectCoercible$4 = requireObjectCoercible$7;
|
|
1446
|
-
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1447
|
-
|
|
1448
|
-
// `Object.setPrototypeOf` method
|
|
1449
|
-
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
1450
|
-
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
1451
|
-
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
1452
|
-
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
1453
|
-
var CORRECT_SETTER = false;
|
|
1454
|
-
var test = {};
|
|
1455
|
-
var setter;
|
|
1456
|
-
try {
|
|
1457
|
-
setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
|
|
1458
|
-
setter(test, []);
|
|
1459
|
-
CORRECT_SETTER = test instanceof Array;
|
|
1460
|
-
} catch (error) { /* empty */ }
|
|
1461
|
-
return function setPrototypeOf(O, proto) {
|
|
1462
|
-
requireObjectCoercible$4(O);
|
|
1463
|
-
aPossiblePrototype(proto);
|
|
1464
|
-
if (!isObject$1(O)) return O;
|
|
1465
|
-
if (CORRECT_SETTER) setter(O, proto);
|
|
1466
|
-
else O.__proto__ = proto;
|
|
1467
|
-
return O;
|
|
1468
|
-
};
|
|
1469
|
-
}() : undefined);
|
|
1470
|
-
|
|
1471
|
-
var $$8 = _export;
|
|
1472
|
-
var call$6 = functionCall;
|
|
1473
|
-
var FunctionName = functionName;
|
|
1474
|
-
var isCallable$3 = isCallable$g;
|
|
1475
|
-
var createIteratorConstructor = iteratorCreateConstructor;
|
|
1476
|
-
var getPrototypeOf = objectGetPrototypeOf;
|
|
1477
|
-
var setPrototypeOf = objectSetPrototypeOf;
|
|
1478
|
-
var setToStringTag$1 = setToStringTag$3;
|
|
1479
|
-
var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
|
|
1480
|
-
var defineBuiltIn$2 = defineBuiltIn$5;
|
|
1481
|
-
var wellKnownSymbol$6 = wellKnownSymbol$b;
|
|
1482
|
-
var Iterators$1 = iterators;
|
|
1483
|
-
var IteratorsCore = iteratorsCore;
|
|
1484
|
-
|
|
1485
|
-
var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
|
|
1486
|
-
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1487
|
-
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1488
|
-
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1489
|
-
var ITERATOR$3 = wellKnownSymbol$6('iterator');
|
|
1490
|
-
var KEYS = 'keys';
|
|
1491
|
-
var VALUES = 'values';
|
|
1492
|
-
var ENTRIES = 'entries';
|
|
1493
|
-
|
|
1494
|
-
var returnThis = function () { return this; };
|
|
1495
|
-
|
|
1496
|
-
var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
|
1497
|
-
createIteratorConstructor(IteratorConstructor, NAME, next);
|
|
1498
|
-
|
|
1499
|
-
var getIterationMethod = function (KIND) {
|
|
1500
|
-
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
|
1501
|
-
if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
|
|
1502
|
-
|
|
1503
|
-
switch (KIND) {
|
|
1504
|
-
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
|
1505
|
-
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
|
1506
|
-
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
return function () { return new IteratorConstructor(this); };
|
|
1510
|
-
};
|
|
1511
|
-
|
|
1512
|
-
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1513
|
-
var INCORRECT_VALUES_NAME = false;
|
|
1514
|
-
var IterablePrototype = Iterable.prototype;
|
|
1515
|
-
var nativeIterator = IterablePrototype[ITERATOR$3]
|
|
1516
|
-
|| IterablePrototype['@@iterator']
|
|
1517
|
-
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
1518
|
-
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
1519
|
-
var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
|
1520
|
-
var CurrentIteratorPrototype, methods, KEY;
|
|
1521
|
-
|
|
1522
|
-
// fix native
|
|
1523
|
-
if (anyNativeIterator) {
|
|
1524
|
-
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
|
1525
|
-
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
|
1526
|
-
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1527
|
-
if (setPrototypeOf) {
|
|
1528
|
-
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
1529
|
-
} else if (!isCallable$3(CurrentIteratorPrototype[ITERATOR$3])) {
|
|
1530
|
-
defineBuiltIn$2(CurrentIteratorPrototype, ITERATOR$3, returnThis);
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
// Set @@toStringTag to native iterators
|
|
1534
|
-
setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1539
|
-
if (PROPER_FUNCTION_NAME$2 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1540
|
-
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1541
|
-
createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
|
|
1542
|
-
} else {
|
|
1543
|
-
INCORRECT_VALUES_NAME = true;
|
|
1544
|
-
defaultIterator = function values() { return call$6(nativeIterator, this); };
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
// export additional methods
|
|
1549
|
-
if (DEFAULT) {
|
|
1550
|
-
methods = {
|
|
1551
|
-
values: getIterationMethod(VALUES),
|
|
1552
|
-
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
|
1553
|
-
entries: getIterationMethod(ENTRIES)
|
|
1554
|
-
};
|
|
1555
|
-
if (FORCED) for (KEY in methods) {
|
|
1556
|
-
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
|
1557
|
-
defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
|
|
1558
|
-
}
|
|
1559
|
-
} else $$8({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
// define iterator
|
|
1563
|
-
if (IterablePrototype[ITERATOR$3] !== defaultIterator) {
|
|
1564
|
-
defineBuiltIn$2(IterablePrototype, ITERATOR$3, defaultIterator, { name: DEFAULT });
|
|
1565
|
-
}
|
|
1566
|
-
Iterators$1[NAME] = defaultIterator;
|
|
1567
|
-
|
|
1568
|
-
return methods;
|
|
1569
|
-
};
|
|
1570
|
-
|
|
1571
|
-
// `CreateIterResultObject` abstract operation
|
|
1572
|
-
// https://tc39.es/ecma262/#sec-createiterresultobject
|
|
1573
|
-
var createIterResultObject$1 = function (value, done) {
|
|
1574
|
-
return { value: value, done: done };
|
|
1575
|
-
};
|
|
1576
|
-
|
|
1577
|
-
var toIndexedObject = toIndexedObject$5;
|
|
1578
|
-
var addToUnscopables$1 = addToUnscopables$2;
|
|
1579
|
-
var Iterators = iterators;
|
|
1580
|
-
var InternalStateModule = internalState;
|
|
1581
|
-
var defineProperty = objectDefineProperty.f;
|
|
1582
|
-
var defineIterator = iteratorDefine;
|
|
1583
|
-
var createIterResultObject = createIterResultObject$1;
|
|
1584
|
-
var DESCRIPTORS = descriptors;
|
|
1585
|
-
|
|
1586
|
-
var ARRAY_ITERATOR = 'Array Iterator';
|
|
1587
|
-
var setInternalState = InternalStateModule.set;
|
|
1588
|
-
var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
|
1589
|
-
|
|
1590
|
-
// `Array.prototype.entries` method
|
|
1591
|
-
// https://tc39.es/ecma262/#sec-array.prototype.entries
|
|
1592
|
-
// `Array.prototype.keys` method
|
|
1593
|
-
// https://tc39.es/ecma262/#sec-array.prototype.keys
|
|
1594
|
-
// `Array.prototype.values` method
|
|
1595
|
-
// https://tc39.es/ecma262/#sec-array.prototype.values
|
|
1596
|
-
// `Array.prototype[@@iterator]` method
|
|
1597
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
|
1598
|
-
// `CreateArrayIterator` internal method
|
|
1599
|
-
// https://tc39.es/ecma262/#sec-createarrayiterator
|
|
1600
|
-
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
|
1601
|
-
setInternalState(this, {
|
|
1602
|
-
type: ARRAY_ITERATOR,
|
|
1603
|
-
target: toIndexedObject(iterated), // target
|
|
1604
|
-
index: 0, // next index
|
|
1605
|
-
kind: kind // kind
|
|
1606
|
-
});
|
|
1607
|
-
// `%ArrayIteratorPrototype%.next` method
|
|
1608
|
-
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
|
1609
|
-
}, function () {
|
|
1610
|
-
var state = getInternalState$1(this);
|
|
1611
|
-
var target = state.target;
|
|
1612
|
-
var index = state.index++;
|
|
1613
|
-
if (!target || index >= target.length) {
|
|
1614
|
-
state.target = null;
|
|
1615
|
-
return createIterResultObject(undefined, true);
|
|
1616
|
-
}
|
|
1617
|
-
switch (state.kind) {
|
|
1618
|
-
case 'keys': return createIterResultObject(index, false);
|
|
1619
|
-
case 'values': return createIterResultObject(target[index], false);
|
|
1620
|
-
} return createIterResultObject([index, target[index]], false);
|
|
1621
|
-
}, 'values');
|
|
1622
|
-
|
|
1623
|
-
// argumentsList[@@iterator] is %ArrayProto_values%
|
|
1624
|
-
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
|
1625
|
-
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
|
1626
|
-
var values = Iterators.Arguments = Iterators.Array;
|
|
1627
|
-
|
|
1628
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
1629
|
-
addToUnscopables$1('keys');
|
|
1630
|
-
addToUnscopables$1('values');
|
|
1631
|
-
addToUnscopables$1('entries');
|
|
1632
|
-
|
|
1633
|
-
// V8 ~ Chrome 45- bug
|
|
1634
|
-
if (DESCRIPTORS && values.name !== 'values') try {
|
|
1635
|
-
defineProperty(values, 'name', { value: 'values' });
|
|
1636
|
-
} catch (error) { /* empty */ }
|
|
1637
|
-
|
|
1638
|
-
var wellKnownSymbol$5 = wellKnownSymbol$b;
|
|
1639
|
-
|
|
1640
|
-
var TO_STRING_TAG$1 = wellKnownSymbol$5('toStringTag');
|
|
1641
|
-
var test = {};
|
|
1642
|
-
|
|
1643
|
-
test[TO_STRING_TAG$1] = 'z';
|
|
1644
|
-
|
|
1645
|
-
var toStringTagSupport = String(test) === '[object z]';
|
|
1646
|
-
|
|
1647
|
-
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1648
|
-
var isCallable$2 = isCallable$g;
|
|
1649
|
-
var classofRaw = classofRaw$1;
|
|
1650
|
-
var wellKnownSymbol$4 = wellKnownSymbol$b;
|
|
1651
|
-
|
|
1652
|
-
var TO_STRING_TAG = wellKnownSymbol$4('toStringTag');
|
|
1653
|
-
var $Object = Object;
|
|
1654
|
-
|
|
1655
|
-
// ES3 wrong here
|
|
1656
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
|
1657
|
-
|
|
1658
|
-
// fallback for IE11 Script Access Denied error
|
|
1659
|
-
var tryGet = function (it, key) {
|
|
1660
|
-
try {
|
|
1661
|
-
return it[key];
|
|
1662
|
-
} catch (error) { /* empty */ }
|
|
1663
|
-
};
|
|
1664
|
-
|
|
1665
|
-
// getting tag from ES6+ `Object.prototype.toString`
|
|
1666
|
-
var classof$4 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
1667
|
-
var O, tag, result;
|
|
1668
|
-
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1669
|
-
// @@toStringTag case
|
|
1670
|
-
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1671
|
-
// builtinTag case
|
|
1672
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1673
|
-
// ES3 arguments fallback
|
|
1674
|
-
: (result = classofRaw(O)) === 'Object' && isCallable$2(O.callee) ? 'Arguments' : result;
|
|
1675
|
-
};
|
|
1676
|
-
|
|
1677
|
-
var classof$3 = classof$4;
|
|
1678
|
-
|
|
1679
|
-
var $String = String;
|
|
1680
|
-
|
|
1681
|
-
var toString$8 = function (argument) {
|
|
1682
|
-
if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
1683
|
-
return $String(argument);
|
|
1684
|
-
};
|
|
1685
|
-
|
|
1686
|
-
// a string of all valid unicode whitespaces
|
|
1687
|
-
var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
1688
|
-
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
1689
|
-
|
|
1690
|
-
var uncurryThis$5 = functionUncurryThis;
|
|
1691
|
-
var requireObjectCoercible$3 = requireObjectCoercible$7;
|
|
1692
|
-
var toString$7 = toString$8;
|
|
1693
|
-
var whitespaces$3 = whitespaces$4;
|
|
1694
|
-
|
|
1695
|
-
var replace$1 = uncurryThis$5(''.replace);
|
|
1696
|
-
var ltrim = RegExp('^[' + whitespaces$3 + ']+');
|
|
1697
|
-
var rtrim = RegExp('(^|[^' + whitespaces$3 + '])[' + whitespaces$3 + ']+$');
|
|
1698
|
-
|
|
1699
|
-
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
1700
|
-
var createMethod$2 = function (TYPE) {
|
|
1701
|
-
return function ($this) {
|
|
1702
|
-
var string = toString$7(requireObjectCoercible$3($this));
|
|
1703
|
-
if (TYPE & 1) string = replace$1(string, ltrim, '');
|
|
1704
|
-
if (TYPE & 2) string = replace$1(string, rtrim, '$1');
|
|
1705
|
-
return string;
|
|
1706
|
-
};
|
|
1707
|
-
};
|
|
1708
|
-
|
|
1709
|
-
var stringTrim = {
|
|
1710
|
-
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
1711
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
1712
|
-
start: createMethod$2(1),
|
|
1713
|
-
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
1714
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
1715
|
-
end: createMethod$2(2),
|
|
1716
|
-
// `String.prototype.trim` method
|
|
1717
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
1718
|
-
trim: createMethod$2(3)
|
|
1719
|
-
};
|
|
1720
|
-
|
|
1721
|
-
var globalThis$7 = globalThis_1;
|
|
1722
|
-
var fails$9 = fails$l;
|
|
1723
|
-
var uncurryThis$4 = functionUncurryThis;
|
|
1724
|
-
var toString$6 = toString$8;
|
|
1725
|
-
var trim$1 = stringTrim.trim;
|
|
1726
|
-
var whitespaces$2 = whitespaces$4;
|
|
1727
|
-
|
|
1728
|
-
var charAt$3 = uncurryThis$4(''.charAt);
|
|
1729
|
-
var $parseFloat$1 = globalThis$7.parseFloat;
|
|
1730
|
-
var Symbol$2 = globalThis$7.Symbol;
|
|
1731
|
-
var ITERATOR$2 = Symbol$2 && Symbol$2.iterator;
|
|
1732
|
-
var FORCED$2 = 1 / $parseFloat$1(whitespaces$2 + '-0') !== -Infinity
|
|
1733
|
-
// MS Edge 18- broken with boxed symbols
|
|
1734
|
-
|| (ITERATOR$2 && !fails$9(function () { $parseFloat$1(Object(ITERATOR$2)); }));
|
|
1735
|
-
|
|
1736
|
-
// `parseFloat` method
|
|
1737
|
-
// https://tc39.es/ecma262/#sec-parsefloat-string
|
|
1738
|
-
var numberParseFloat = FORCED$2 ? function parseFloat(string) {
|
|
1739
|
-
var trimmedString = trim$1(toString$6(string));
|
|
1740
|
-
var result = $parseFloat$1(trimmedString);
|
|
1741
|
-
return result === 0 && charAt$3(trimmedString, 0) === '-' ? -0 : result;
|
|
1742
|
-
} : $parseFloat$1;
|
|
1743
|
-
|
|
1744
|
-
var $$7 = _export;
|
|
1745
|
-
var $parseFloat = numberParseFloat;
|
|
1746
|
-
|
|
1747
|
-
// `parseFloat` method
|
|
1748
|
-
// https://tc39.es/ecma262/#sec-parsefloat-string
|
|
1749
|
-
$$7({ global: true, forced: parseFloat !== $parseFloat }, {
|
|
1750
|
-
parseFloat: $parseFloat
|
|
1751
|
-
});
|
|
1752
|
-
|
|
1753
|
-
var anObject$4 = anObject$9;
|
|
1754
|
-
|
|
1755
|
-
// `RegExp.prototype.flags` getter implementation
|
|
1756
|
-
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
1757
|
-
var regexpFlags$1 = function () {
|
|
1758
|
-
var that = anObject$4(this);
|
|
1759
|
-
var result = '';
|
|
1760
|
-
if (that.hasIndices) result += 'd';
|
|
1761
|
-
if (that.global) result += 'g';
|
|
1762
|
-
if (that.ignoreCase) result += 'i';
|
|
1763
|
-
if (that.multiline) result += 'm';
|
|
1764
|
-
if (that.dotAll) result += 's';
|
|
1765
|
-
if (that.unicode) result += 'u';
|
|
1766
|
-
if (that.unicodeSets) result += 'v';
|
|
1767
|
-
if (that.sticky) result += 'y';
|
|
1768
|
-
return result;
|
|
1769
|
-
};
|
|
1770
|
-
|
|
1771
|
-
var fails$8 = fails$l;
|
|
1772
|
-
var globalThis$6 = globalThis_1;
|
|
1773
|
-
|
|
1774
|
-
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
1775
|
-
var $RegExp$2 = globalThis$6.RegExp;
|
|
1776
|
-
|
|
1777
|
-
var UNSUPPORTED_Y$1 = fails$8(function () {
|
|
1778
|
-
var re = $RegExp$2('a', 'y');
|
|
1779
|
-
re.lastIndex = 2;
|
|
1780
|
-
return re.exec('abcd') !== null;
|
|
1781
|
-
});
|
|
1782
|
-
|
|
1783
|
-
// UC Browser bug
|
|
1784
|
-
// https://github.com/zloirock/core-js/issues/1008
|
|
1785
|
-
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$8(function () {
|
|
1786
|
-
return !$RegExp$2('a', 'y').sticky;
|
|
1787
|
-
});
|
|
1788
|
-
|
|
1789
|
-
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$8(function () {
|
|
1790
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
1791
|
-
var re = $RegExp$2('^r', 'gy');
|
|
1792
|
-
re.lastIndex = 2;
|
|
1793
|
-
return re.exec('str') !== null;
|
|
1794
|
-
});
|
|
1795
|
-
|
|
1796
|
-
var regexpStickyHelpers = {
|
|
1797
|
-
BROKEN_CARET: BROKEN_CARET,
|
|
1798
|
-
MISSED_STICKY: MISSED_STICKY,
|
|
1799
|
-
UNSUPPORTED_Y: UNSUPPORTED_Y$1
|
|
1800
|
-
};
|
|
1801
|
-
|
|
1802
|
-
var fails$7 = fails$l;
|
|
1803
|
-
var globalThis$5 = globalThis_1;
|
|
1804
|
-
|
|
1805
|
-
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
1806
|
-
var $RegExp$1 = globalThis$5.RegExp;
|
|
1807
|
-
|
|
1808
|
-
var regexpUnsupportedDotAll = fails$7(function () {
|
|
1809
|
-
var re = $RegExp$1('.', 's');
|
|
1810
|
-
return !(re.dotAll && re.test('\n') && re.flags === 's');
|
|
1811
|
-
});
|
|
1812
|
-
|
|
1813
|
-
var fails$6 = fails$l;
|
|
1814
|
-
var globalThis$4 = globalThis_1;
|
|
1815
|
-
|
|
1816
|
-
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
1817
|
-
var $RegExp = globalThis$4.RegExp;
|
|
1818
|
-
|
|
1819
|
-
var regexpUnsupportedNcg = fails$6(function () {
|
|
1820
|
-
var re = $RegExp('(?<a>b)', 'g');
|
|
1821
|
-
return re.exec('b').groups.a !== 'b' ||
|
|
1822
|
-
'b'.replace(re, '$<a>c') !== 'bc';
|
|
1823
|
-
});
|
|
1824
|
-
|
|
1825
|
-
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
1826
|
-
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
1827
|
-
var call$5 = functionCall;
|
|
1828
|
-
var uncurryThis$3 = functionUncurryThis;
|
|
1829
|
-
var toString$5 = toString$8;
|
|
1830
|
-
var regexpFlags = regexpFlags$1;
|
|
1831
|
-
var stickyHelpers = regexpStickyHelpers;
|
|
1832
|
-
var shared = shared$4;
|
|
1833
|
-
var create = objectCreate;
|
|
1834
|
-
var getInternalState = internalState.get;
|
|
1835
|
-
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
|
|
1836
|
-
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
1837
|
-
|
|
1838
|
-
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
1839
|
-
var nativeExec = RegExp.prototype.exec;
|
|
1840
|
-
var patchedExec = nativeExec;
|
|
1841
|
-
var charAt$2 = uncurryThis$3(''.charAt);
|
|
1842
|
-
var indexOf = uncurryThis$3(''.indexOf);
|
|
1843
|
-
var replace = uncurryThis$3(''.replace);
|
|
1844
|
-
var stringSlice$1 = uncurryThis$3(''.slice);
|
|
1845
|
-
|
|
1846
|
-
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
1847
|
-
var re1 = /a/;
|
|
1848
|
-
var re2 = /b*/g;
|
|
1849
|
-
call$5(nativeExec, re1, 'a');
|
|
1850
|
-
call$5(nativeExec, re2, 'a');
|
|
1851
|
-
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
1852
|
-
})();
|
|
1853
|
-
|
|
1854
|
-
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
|
|
1855
|
-
|
|
1856
|
-
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
1857
|
-
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
1858
|
-
|
|
1859
|
-
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
|
1860
|
-
|
|
1861
|
-
if (PATCH) {
|
|
1862
|
-
patchedExec = function exec(string) {
|
|
1863
|
-
var re = this;
|
|
1864
|
-
var state = getInternalState(re);
|
|
1865
|
-
var str = toString$5(string);
|
|
1866
|
-
var raw = state.raw;
|
|
1867
|
-
var result, reCopy, lastIndex, match, i, object, group;
|
|
1868
|
-
|
|
1869
|
-
if (raw) {
|
|
1870
|
-
raw.lastIndex = re.lastIndex;
|
|
1871
|
-
result = call$5(patchedExec, raw, str);
|
|
1872
|
-
re.lastIndex = raw.lastIndex;
|
|
1873
|
-
return result;
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
var groups = state.groups;
|
|
1877
|
-
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
1878
|
-
var flags = call$5(regexpFlags, re);
|
|
1879
|
-
var source = re.source;
|
|
1880
|
-
var charsAdded = 0;
|
|
1881
|
-
var strCopy = str;
|
|
1882
|
-
|
|
1883
|
-
if (sticky) {
|
|
1884
|
-
flags = replace(flags, 'y', '');
|
|
1885
|
-
if (indexOf(flags, 'g') === -1) {
|
|
1886
|
-
flags += 'g';
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
strCopy = stringSlice$1(str, re.lastIndex);
|
|
1890
|
-
// Support anchored sticky behavior.
|
|
1891
|
-
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$2(str, re.lastIndex - 1) !== '\n')) {
|
|
1892
|
-
source = '(?: ' + source + ')';
|
|
1893
|
-
strCopy = ' ' + strCopy;
|
|
1894
|
-
charsAdded++;
|
|
1895
|
-
}
|
|
1896
|
-
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
1897
|
-
// simulate the 'y' flag.
|
|
1898
|
-
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
if (NPCG_INCLUDED) {
|
|
1902
|
-
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
1903
|
-
}
|
|
1904
|
-
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
1905
|
-
|
|
1906
|
-
match = call$5(nativeExec, sticky ? reCopy : re, strCopy);
|
|
1907
|
-
|
|
1908
|
-
if (sticky) {
|
|
1909
|
-
if (match) {
|
|
1910
|
-
match.input = stringSlice$1(match.input, charsAdded);
|
|
1911
|
-
match[0] = stringSlice$1(match[0], charsAdded);
|
|
1912
|
-
match.index = re.lastIndex;
|
|
1913
|
-
re.lastIndex += match[0].length;
|
|
1914
|
-
} else re.lastIndex = 0;
|
|
1915
|
-
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
1916
|
-
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
1917
|
-
}
|
|
1918
|
-
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
1919
|
-
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
1920
|
-
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
|
|
1921
|
-
call$5(nativeReplace, match[0], reCopy, function () {
|
|
1922
|
-
for (i = 1; i < arguments.length - 2; i++) {
|
|
1923
|
-
if (arguments[i] === undefined) match[i] = undefined;
|
|
1924
|
-
}
|
|
1925
|
-
});
|
|
1926
|
-
}
|
|
1927
|
-
|
|
1928
|
-
if (match && groups) {
|
|
1929
|
-
match.groups = object = create(null);
|
|
1930
|
-
for (i = 0; i < groups.length; i++) {
|
|
1931
|
-
group = groups[i];
|
|
1932
|
-
object[group[0]] = match[group[1]];
|
|
1933
|
-
}
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1936
|
-
return match;
|
|
1937
|
-
};
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
|
-
var regexpExec$2 = patchedExec;
|
|
1941
|
-
|
|
1942
|
-
var $$6 = _export;
|
|
1943
|
-
var exec$1 = regexpExec$2;
|
|
1944
|
-
|
|
1945
|
-
// `RegExp.prototype.exec` method
|
|
1946
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
1947
|
-
$$6({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
|
|
1948
|
-
exec: exec$1
|
|
1949
|
-
});
|
|
1950
|
-
|
|
1951
|
-
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
1952
|
-
|
|
1953
|
-
var $$5 = _export;
|
|
1954
|
-
var call$4 = functionCall;
|
|
1955
|
-
var isCallable$1 = isCallable$g;
|
|
1956
|
-
var anObject$3 = anObject$9;
|
|
1957
|
-
var toString$4 = toString$8;
|
|
1958
|
-
|
|
1959
|
-
var DELEGATES_TO_EXEC = function () {
|
|
1960
|
-
var execCalled = false;
|
|
1961
|
-
var re = /[ac]/;
|
|
1962
|
-
re.exec = function () {
|
|
1963
|
-
execCalled = true;
|
|
1964
|
-
return /./.exec.apply(this, arguments);
|
|
1965
|
-
};
|
|
1966
|
-
return re.test('abc') === true && execCalled;
|
|
1967
|
-
}();
|
|
1968
|
-
|
|
1969
|
-
var nativeTest = /./.test;
|
|
1970
|
-
|
|
1971
|
-
// `RegExp.prototype.test` method
|
|
1972
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.test
|
|
1973
|
-
$$5({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
|
|
1974
|
-
test: function (S) {
|
|
1975
|
-
var R = anObject$3(this);
|
|
1976
|
-
var string = toString$4(S);
|
|
1977
|
-
var exec = R.exec;
|
|
1978
|
-
if (!isCallable$1(exec)) return call$4(nativeTest, R, string);
|
|
1979
|
-
var result = call$4(exec, R, string);
|
|
1980
|
-
if (result === null) return false;
|
|
1981
|
-
anObject$3(result);
|
|
1982
|
-
return true;
|
|
1983
|
-
}
|
|
1984
|
-
});
|
|
1985
|
-
|
|
1986
|
-
var call$3 = functionCall;
|
|
1987
|
-
var hasOwn = hasOwnProperty_1;
|
|
1988
|
-
var isPrototypeOf = objectIsPrototypeOf;
|
|
1989
|
-
var regExpFlags = regexpFlags$1;
|
|
1990
|
-
|
|
1991
|
-
var RegExpPrototype$2 = RegExp.prototype;
|
|
1992
|
-
|
|
1993
|
-
var regexpGetFlags = function (R) {
|
|
1994
|
-
var flags = R.flags;
|
|
1995
|
-
return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$2, R)
|
|
1996
|
-
? call$3(regExpFlags, R) : flags;
|
|
1997
|
-
};
|
|
1998
|
-
|
|
1999
|
-
var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
|
|
2000
|
-
var defineBuiltIn$1 = defineBuiltIn$5;
|
|
2001
|
-
var anObject$2 = anObject$9;
|
|
2002
|
-
var $toString = toString$8;
|
|
2003
|
-
var fails$5 = fails$l;
|
|
2004
|
-
var getRegExpFlags = regexpGetFlags;
|
|
2005
|
-
|
|
2006
|
-
var TO_STRING = 'toString';
|
|
2007
|
-
var RegExpPrototype$1 = RegExp.prototype;
|
|
2008
|
-
var nativeToString = RegExpPrototype$1[TO_STRING];
|
|
2009
|
-
|
|
2010
|
-
var NOT_GENERIC = fails$5(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
|
|
2011
|
-
// FF44- RegExp#toString has a wrong name
|
|
2012
|
-
var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name !== TO_STRING;
|
|
2013
|
-
|
|
2014
|
-
// `RegExp.prototype.toString` method
|
|
2015
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
2016
|
-
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
2017
|
-
defineBuiltIn$1(RegExpPrototype$1, TO_STRING, function toString() {
|
|
2018
|
-
var R = anObject$2(this);
|
|
2019
|
-
var pattern = $toString(R.source);
|
|
2020
|
-
var flags = $toString(getRegExpFlags(R));
|
|
2021
|
-
return '/' + pattern + '/' + flags;
|
|
2022
|
-
}, { unsafe: true });
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
2026
|
-
var fails$4 = fails$l;
|
|
2027
|
-
var whitespaces$1 = whitespaces$4;
|
|
2028
|
-
|
|
2029
|
-
var non = '\u200B\u0085\u180E';
|
|
2030
|
-
|
|
2031
|
-
// check that a method works with the correct list
|
|
2032
|
-
// of whitespaces and has a correct name
|
|
2033
|
-
var stringTrimForced = function (METHOD_NAME) {
|
|
2034
|
-
return fails$4(function () {
|
|
2035
|
-
return !!whitespaces$1[METHOD_NAME]()
|
|
2036
|
-
|| non[METHOD_NAME]() !== non
|
|
2037
|
-
|| (PROPER_FUNCTION_NAME && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
|
|
2038
|
-
});
|
|
2039
|
-
};
|
|
2040
|
-
|
|
2041
|
-
var $$4 = _export;
|
|
2042
|
-
var $trim = stringTrim.trim;
|
|
2043
|
-
var forcedStringTrimMethod = stringTrimForced;
|
|
2044
|
-
|
|
2045
|
-
// `String.prototype.trim` method
|
|
2046
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
2047
|
-
$$4({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
|
2048
|
-
trim: function trim() {
|
|
2049
|
-
return $trim(this);
|
|
2050
|
-
}
|
|
2051
|
-
});
|
|
2052
|
-
|
|
2053
|
-
// iterable DOM collections
|
|
2054
|
-
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
|
2055
|
-
var domIterables = {
|
|
2056
|
-
CSSRuleList: 0,
|
|
2057
|
-
CSSStyleDeclaration: 0,
|
|
2058
|
-
CSSValueList: 0,
|
|
2059
|
-
ClientRectList: 0,
|
|
2060
|
-
DOMRectList: 0,
|
|
2061
|
-
DOMStringList: 0,
|
|
2062
|
-
DOMTokenList: 1,
|
|
2063
|
-
DataTransferItemList: 0,
|
|
2064
|
-
FileList: 0,
|
|
2065
|
-
HTMLAllCollection: 0,
|
|
2066
|
-
HTMLCollection: 0,
|
|
2067
|
-
HTMLFormElement: 0,
|
|
2068
|
-
HTMLSelectElement: 0,
|
|
2069
|
-
MediaList: 0,
|
|
2070
|
-
MimeTypeArray: 0,
|
|
2071
|
-
NamedNodeMap: 0,
|
|
2072
|
-
NodeList: 1,
|
|
2073
|
-
PaintRequestList: 0,
|
|
2074
|
-
Plugin: 0,
|
|
2075
|
-
PluginArray: 0,
|
|
2076
|
-
SVGLengthList: 0,
|
|
2077
|
-
SVGNumberList: 0,
|
|
2078
|
-
SVGPathSegList: 0,
|
|
2079
|
-
SVGPointList: 0,
|
|
2080
|
-
SVGStringList: 0,
|
|
2081
|
-
SVGTransformList: 0,
|
|
2082
|
-
SourceBufferList: 0,
|
|
2083
|
-
StyleSheetList: 0,
|
|
2084
|
-
TextTrackCueList: 0,
|
|
2085
|
-
TextTrackList: 0,
|
|
2086
|
-
TouchList: 0
|
|
2087
|
-
};
|
|
2088
|
-
|
|
2089
|
-
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
|
|
2090
|
-
var documentCreateElement = documentCreateElement$2;
|
|
2091
|
-
|
|
2092
|
-
var classList = documentCreateElement('span').classList;
|
|
2093
|
-
var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
|
|
2094
|
-
|
|
2095
|
-
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
2096
|
-
|
|
2097
|
-
var globalThis$3 = globalThis_1;
|
|
2098
|
-
var DOMIterables = domIterables;
|
|
2099
|
-
var DOMTokenListPrototype = domTokenListPrototype;
|
|
2100
|
-
var ArrayIteratorMethods = es_array_iterator;
|
|
2101
|
-
var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
|
|
2102
|
-
var setToStringTag = setToStringTag$3;
|
|
2103
|
-
var wellKnownSymbol$3 = wellKnownSymbol$b;
|
|
2104
|
-
|
|
2105
|
-
var ITERATOR$1 = wellKnownSymbol$3('iterator');
|
|
2106
|
-
var ArrayValues = ArrayIteratorMethods.values;
|
|
2107
|
-
|
|
2108
|
-
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
2109
|
-
if (CollectionPrototype) {
|
|
2110
|
-
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
2111
|
-
if (CollectionPrototype[ITERATOR$1] !== ArrayValues) try {
|
|
2112
|
-
createNonEnumerableProperty$1(CollectionPrototype, ITERATOR$1, ArrayValues);
|
|
2113
|
-
} catch (error) {
|
|
2114
|
-
CollectionPrototype[ITERATOR$1] = ArrayValues;
|
|
2115
|
-
}
|
|
2116
|
-
setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
|
|
2117
|
-
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
|
2118
|
-
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
2119
|
-
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
|
2120
|
-
createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
|
2121
|
-
} catch (error) {
|
|
2122
|
-
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
};
|
|
2127
|
-
|
|
2128
|
-
for (var COLLECTION_NAME in DOMIterables) {
|
|
2129
|
-
handlePrototype(globalThis$3[COLLECTION_NAME] && globalThis$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
2133
|
-
|
|
2134
|
-
const defaultProps = {
|
|
95
|
+
/* *
|
|
96
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
97
|
+
* you may not use this file except in compliance with the License.
|
|
98
|
+
* You may obtain a copy of the License at
|
|
99
|
+
*
|
|
100
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
*
|
|
102
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
103
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
104
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
105
|
+
* See the License for the specific language governing permissions and
|
|
106
|
+
* limitations under the License.
|
|
107
|
+
*
|
|
108
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
109
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
110
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
111
|
+
* */
|
|
112
|
+
var defaultProps = {
|
|
2135
113
|
shouldUnregister: false
|
|
2136
114
|
};
|
|
2137
|
-
|
|
115
|
+
var errorMessages = {
|
|
2138
116
|
required: 'form-fields-error-required',
|
|
2139
117
|
isValidDate: 'form-fields-error-date-valid',
|
|
2140
118
|
isAfter: 'form-fields-error-date-after',
|
|
@@ -2150,55 +128,61 @@ const errorMessages = {
|
|
|
2150
128
|
isInteger: 'form-fields-error-integer',
|
|
2151
129
|
isNumeric: 'form-fields-error-numeric'
|
|
2152
130
|
};
|
|
2153
|
-
|
|
131
|
+
var regexMaxTwoDecimals = /^\s*-?\d+(\.\d{1,2})?\s*$/;
|
|
2154
132
|
// validations
|
|
2155
|
-
|
|
133
|
+
var isEmpty = function isEmpty(value) {
|
|
2156
134
|
if (typeof value === 'string' && !value.trim().length || value === null || value === undefined) {
|
|
2157
135
|
return true;
|
|
2158
136
|
}
|
|
2159
137
|
return false;
|
|
2160
138
|
};
|
|
2161
|
-
|
|
139
|
+
var isXHoursBefore = function isXHoursBefore(ownDate, otherDate, hours) {
|
|
140
|
+
if (hours === void 0) {
|
|
141
|
+
hours = 4;
|
|
142
|
+
}
|
|
2162
143
|
if (isEmpty(ownDate) || isEmpty(otherDate)) {
|
|
2163
144
|
return true;
|
|
2164
145
|
}
|
|
2165
|
-
|
|
146
|
+
var duration = dateUtils.differenceInHours(dateUtils.utc(otherDate), dateUtils.utc(ownDate), 'ceil');
|
|
2166
147
|
return duration <= hours;
|
|
2167
148
|
};
|
|
2168
|
-
|
|
149
|
+
var isXHoursAfter = function isXHoursAfter(ownDate, otherDate, hours) {
|
|
150
|
+
if (hours === void 0) {
|
|
151
|
+
hours = 4;
|
|
152
|
+
}
|
|
2169
153
|
if (isEmpty(ownDate) || isEmpty(otherDate)) {
|
|
2170
154
|
return true;
|
|
2171
155
|
}
|
|
2172
|
-
|
|
156
|
+
var duration = dateUtils.differenceInHours(dateUtils.utc(ownDate), dateUtils.utc(otherDate), 'ceil');
|
|
2173
157
|
return duration <= hours;
|
|
2174
158
|
};
|
|
2175
|
-
|
|
159
|
+
var isLatitude = function isLatitude(lat) {
|
|
2176
160
|
if (!lat) {
|
|
2177
161
|
return true;
|
|
2178
162
|
}
|
|
2179
163
|
return isFinite(lat) && Math.abs(lat) <= 90 && regexMaxTwoDecimals.test(lat.toString());
|
|
2180
164
|
};
|
|
2181
|
-
|
|
165
|
+
var isLongitude = function isLongitude(lng) {
|
|
2182
166
|
if (!lng) {
|
|
2183
167
|
return true;
|
|
2184
168
|
}
|
|
2185
169
|
return isFinite(lng) && Math.abs(lng) <= 180 && lng >= -180 && regexMaxTwoDecimals.test(lng.toString());
|
|
2186
170
|
};
|
|
2187
171
|
// Pass null if no maxValue
|
|
2188
|
-
|
|
172
|
+
var isValidMax = function isValidMax(value, maxValue) {
|
|
2189
173
|
if (isEmpty(value) || maxValue === null) {
|
|
2190
174
|
return true;
|
|
2191
175
|
}
|
|
2192
176
|
return !(value > maxValue);
|
|
2193
177
|
};
|
|
2194
178
|
// Pass null if no minValue
|
|
2195
|
-
|
|
179
|
+
var isValidMin = function isValidMin(value, minValue) {
|
|
2196
180
|
if (isEmpty(value) || minValue === null) {
|
|
2197
181
|
return true;
|
|
2198
182
|
}
|
|
2199
183
|
return !(value < minValue);
|
|
2200
184
|
};
|
|
2201
|
-
|
|
185
|
+
var hasValidGeometry = function hasValidGeometry(geojson) {
|
|
2202
186
|
if (!geojson || !geojson.features || !geojson.features.length || !geojson.features[0].geometry ||
|
|
2203
187
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2204
188
|
// @ts-ignore
|
|
@@ -2207,17 +191,16 @@ const hasValidGeometry = geojson => {
|
|
|
2207
191
|
}
|
|
2208
192
|
return true;
|
|
2209
193
|
};
|
|
2210
|
-
|
|
2211
|
-
|
|
194
|
+
var isValidGeoJsonCoordinates = function isValidGeoJsonCoordinates(geojson) {
|
|
195
|
+
var hasGeometry = hasValidGeometry(geojson);
|
|
2212
196
|
if (!hasGeometry) {
|
|
2213
197
|
return false;
|
|
2214
198
|
}
|
|
2215
199
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2216
200
|
// @ts-ignore
|
|
2217
|
-
|
|
2218
|
-
coordinates,
|
|
2219
|
-
type
|
|
2220
|
-
} = geojson.features[0].geometry;
|
|
201
|
+
var _geojson$features$0$g = geojson.features[0].geometry,
|
|
202
|
+
coordinates = _geojson$features$0$g.coordinates,
|
|
203
|
+
type = _geojson$features$0$g.type;
|
|
2221
204
|
// For type POINT coordinates is an array of 2
|
|
2222
205
|
if (coordinates.length === 2 && type === 'Point') {
|
|
2223
206
|
return true;
|
|
@@ -2228,24 +211,23 @@ const isValidGeoJsonCoordinates = geojson => {
|
|
|
2228
211
|
}
|
|
2229
212
|
return false;
|
|
2230
213
|
};
|
|
2231
|
-
|
|
2232
|
-
|
|
214
|
+
var isMaximumOneDrawing = function isMaximumOneDrawing(geojson) {
|
|
215
|
+
var hasGeometry = hasValidGeometry(geojson);
|
|
2233
216
|
if (!hasGeometry) {
|
|
2234
217
|
return true; // no need to check further when there is no drawing yet
|
|
2235
218
|
}
|
|
2236
219
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2237
220
|
// @ts-ignore
|
|
2238
|
-
|
|
2239
|
-
coordinates,
|
|
2240
|
-
type
|
|
2241
|
-
} = geojson.features[0].geometry;
|
|
221
|
+
var _geojson$features$0$g2 = geojson.features[0].geometry,
|
|
222
|
+
coordinates = _geojson$features$0$g2.coordinates,
|
|
223
|
+
type = _geojson$features$0$g2.type;
|
|
2242
224
|
// For type POLYGON only one array of coordinates is allowed
|
|
2243
225
|
if (type === 'Polygon' && coordinates.length > 1) {
|
|
2244
226
|
return false;
|
|
2245
227
|
}
|
|
2246
228
|
return true;
|
|
2247
229
|
};
|
|
2248
|
-
|
|
230
|
+
var hasIntersectionWithFIR = function hasIntersectionWithFIR(geojson, intersection) {
|
|
2249
231
|
if (!hasValidGeometry(geojson) ||
|
|
2250
232
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2251
233
|
// @ts-ignore
|
|
@@ -2254,10 +236,9 @@ const hasIntersectionWithFIR = (geojson, intersection) => {
|
|
|
2254
236
|
}
|
|
2255
237
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2256
238
|
// @ts-ignore
|
|
2257
|
-
|
|
2258
|
-
coordinates,
|
|
2259
|
-
type
|
|
2260
|
-
} = intersection.features[0].geometry;
|
|
239
|
+
var _intersection$feature = intersection.features[0].geometry,
|
|
240
|
+
coordinates = _intersection$feature.coordinates,
|
|
241
|
+
type = _intersection$feature.type;
|
|
2261
242
|
if (type === 'Point' && coordinates.length === 0) {
|
|
2262
243
|
return false;
|
|
2263
244
|
}
|
|
@@ -2266,47 +247,55 @@ const hasIntersectionWithFIR = (geojson, intersection) => {
|
|
|
2266
247
|
}
|
|
2267
248
|
return true;
|
|
2268
249
|
};
|
|
2269
|
-
|
|
2270
|
-
|
|
250
|
+
var hasMulitpleIntersections = function hasMulitpleIntersections(geojson) {
|
|
251
|
+
var hasGeometry = hasValidGeometry(geojson);
|
|
2271
252
|
if (!hasGeometry) {
|
|
2272
253
|
return false;
|
|
2273
254
|
}
|
|
2274
255
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2275
256
|
// @ts-ignore
|
|
2276
|
-
|
|
2277
|
-
coordinates,
|
|
2278
|
-
type
|
|
2279
|
-
} = geojson.features[0].geometry;
|
|
257
|
+
var _geojson$features$0$g3 = geojson.features[0].geometry,
|
|
258
|
+
coordinates = _geojson$features$0$g3.coordinates,
|
|
259
|
+
type = _geojson$features$0$g3.type;
|
|
2280
260
|
if (type === 'MultiPolygon' || coordinates.length > 1 && type !== 'Point') {
|
|
2281
261
|
return true;
|
|
2282
262
|
}
|
|
2283
263
|
return false;
|
|
2284
264
|
};
|
|
2285
|
-
|
|
2286
|
-
var _geojson$features$, _intersection$
|
|
2287
|
-
if (!(geojson != null && geojson.features) || !((_geojson$features$ = geojson.features[0]) != null && _geojson$features$.geometry) || !(intersection != null && intersection.features) || !((_intersection$
|
|
265
|
+
var countIntersectionPoints = function countIntersectionPoints(geojson, intersection) {
|
|
266
|
+
var _geojson$features$, _intersection$feature2;
|
|
267
|
+
if (!(geojson != null && geojson.features) || !((_geojson$features$ = geojson.features[0]) != null && _geojson$features$.geometry) || !(intersection != null && intersection.features) || !((_intersection$feature2 = intersection.features[0]) != null && _intersection$feature2.geometry)) {
|
|
2288
268
|
return 0;
|
|
2289
269
|
}
|
|
2290
|
-
|
|
2291
|
-
|
|
270
|
+
var geojsonGeometry = geojson.features[0].geometry;
|
|
271
|
+
var intersectionGeometry = intersection.features[0].geometry;
|
|
2292
272
|
if (geojsonGeometry.type !== 'Polygon' || intersectionGeometry.type !== 'Polygon') {
|
|
2293
273
|
return 0;
|
|
2294
274
|
}
|
|
2295
|
-
|
|
2296
|
-
|
|
275
|
+
var geojsonCoordinates = geojsonGeometry.coordinates[0];
|
|
276
|
+
var intersectionCoordinates = intersectionGeometry.coordinates[0];
|
|
2297
277
|
// If both arrays are empty, return 0
|
|
2298
278
|
if (!geojsonCoordinates && !intersectionCoordinates) {
|
|
2299
279
|
return 0;
|
|
2300
280
|
}
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
return
|
|
281
|
+
var intersectionPoints = intersectionCoordinates.map(function (point) {
|
|
282
|
+
return [point[0], point[1]];
|
|
283
|
+
});
|
|
284
|
+
var uniqueIntersectionPoints = intersectionPoints.filter(function (point, index, self) {
|
|
285
|
+
return index === self.findIndex(function (p) {
|
|
286
|
+
return p[0] === point[0] && p[1] === point[1];
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
var collisionPoints = uniqueIntersectionPoints.filter(function (point) {
|
|
290
|
+
var x = point[0],
|
|
291
|
+
y = point[1];
|
|
292
|
+
return !geojsonCoordinates.some(function (originalPoint) {
|
|
293
|
+
return originalPoint[0] === x && originalPoint[1] === y;
|
|
294
|
+
});
|
|
2306
295
|
});
|
|
2307
296
|
return collisionPoints.length;
|
|
2308
297
|
};
|
|
2309
|
-
|
|
298
|
+
var isGeometryDirty = function isGeometryDirty(geoJSON, formGeoJSON) {
|
|
2310
299
|
if (geoJSON === (undefined) || formGeoJSON === (undefined) || !hasValidGeometry(geoJSON) || !hasValidGeometry(formGeoJSON)) {
|
|
2311
300
|
return false;
|
|
2312
301
|
}
|
|
@@ -2318,13 +307,13 @@ const isGeometryDirty = (geoJSON, formGeoJSON) => {
|
|
|
2318
307
|
// @ts-ignore
|
|
2319
308
|
formGeoJSON.features[0].geometry.coordinates);
|
|
2320
309
|
};
|
|
2321
|
-
|
|
310
|
+
var isInteger = function isInteger(value) {
|
|
2322
311
|
if (isEmpty(value)) {
|
|
2323
312
|
return true;
|
|
2324
313
|
}
|
|
2325
314
|
return Number.isInteger(value);
|
|
2326
315
|
};
|
|
2327
|
-
|
|
316
|
+
var isNonOrBothCoordinates = function isNonOrBothCoordinates(coordinate, otherCoordinate) {
|
|
2328
317
|
if (typeof coordinate === 'number' && typeof otherCoordinate === 'number' || coordinate === null && otherCoordinate === null || coordinate === undefined && otherCoordinate === undefined) {
|
|
2329
318
|
return true;
|
|
2330
319
|
}
|
|
@@ -2334,33 +323,31 @@ const isNonOrBothCoordinates = (coordinate, otherCoordinate) => {
|
|
|
2334
323
|
return false;
|
|
2335
324
|
};
|
|
2336
325
|
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
const _excluded$6 = ["children", "errors", "isReadOnly", "sx", "className", "size"];
|
|
2363
|
-
const radioCheckboxStyle = {
|
|
326
|
+
/* *
|
|
327
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
328
|
+
* you may not use this file except in compliance with the License.
|
|
329
|
+
* You may obtain a copy of the License at
|
|
330
|
+
*
|
|
331
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
332
|
+
*
|
|
333
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
334
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
335
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
336
|
+
* See the License for the specific language governing permissions and
|
|
337
|
+
* limitations under the License.
|
|
338
|
+
*
|
|
339
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
340
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
341
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
342
|
+
* */
|
|
343
|
+
var FORM_FIELDS_NAMESPACE = 'form-fields';
|
|
344
|
+
var ns = [FORM_FIELDS_NAMESPACE];
|
|
345
|
+
var useFormFieldsTranslation = function useFormFieldsTranslation() {
|
|
346
|
+
return useTranslation(ns);
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
var _excluded$6 = ["children", "errors", "isReadOnly", "sx", "className", "size"];
|
|
350
|
+
var radioCheckboxStyle = {
|
|
2364
351
|
// hides unchecked values
|
|
2365
352
|
display: 'none',
|
|
2366
353
|
'&+.MuiFormControlLabel-label': {
|
|
@@ -2380,7 +367,7 @@ const radioCheckboxStyle = {
|
|
|
2380
367
|
color: 'geowebColors.typographyAndIcons.iconLinkActive'
|
|
2381
368
|
}
|
|
2382
369
|
};
|
|
2383
|
-
|
|
370
|
+
var getErrorMessage = function getErrorMessage(t, errors) {
|
|
2384
371
|
if (errors && errors.message && typeof errors.message === 'string') {
|
|
2385
372
|
return t(errors.message);
|
|
2386
373
|
}
|
|
@@ -2389,23 +376,23 @@ const getErrorMessage = (t, errors) => {
|
|
|
2389
376
|
}
|
|
2390
377
|
return '';
|
|
2391
378
|
};
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
379
|
+
var ReactHookFormFormControl = function ReactHookFormFormControl(_ref) {
|
|
380
|
+
var children = _ref.children,
|
|
381
|
+
errors = _ref.errors,
|
|
382
|
+
isReadOnly = _ref.isReadOnly,
|
|
383
|
+
_ref$sx = _ref.sx,
|
|
384
|
+
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
385
|
+
_ref$className = _ref.className,
|
|
386
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
387
|
+
_ref$size = _ref.size,
|
|
388
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
2401
389
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
2402
|
-
|
|
2403
|
-
t
|
|
2404
|
-
} = useFormFieldsTranslation();
|
|
390
|
+
var _useFormFieldsTransla = useFormFieldsTranslation(),
|
|
391
|
+
t = _useFormFieldsTransla.t;
|
|
2405
392
|
return jsxs(FormControl, Object.assign({
|
|
2406
393
|
fullWidth: true,
|
|
2407
394
|
error: !!errors,
|
|
2408
|
-
className:
|
|
395
|
+
className: (isReadOnly ? 'is-read-only' : '') + " " + className,
|
|
2409
396
|
size: size,
|
|
2410
397
|
sx: Object.assign({}, isReadOnly && {
|
|
2411
398
|
// Radio input
|
|
@@ -2436,151 +423,51 @@ const ReactHookFormFormControl = _ref => {
|
|
|
2436
423
|
}));
|
|
2437
424
|
};
|
|
2438
425
|
|
|
2439
|
-
var aCallable = aCallable$3;
|
|
2440
|
-
var toObject = toObject$4;
|
|
2441
|
-
var IndexedObject = indexedObject;
|
|
2442
|
-
var lengthOfArrayLike = lengthOfArrayLike$2;
|
|
2443
|
-
|
|
2444
|
-
var $TypeError$2 = TypeError;
|
|
2445
|
-
|
|
2446
|
-
var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
|
|
2447
|
-
|
|
2448
|
-
// `Array.prototype.{ reduce, reduceRight }` methods implementation
|
|
2449
|
-
var createMethod$1 = function (IS_RIGHT) {
|
|
2450
|
-
return function (that, callbackfn, argumentsLength, memo) {
|
|
2451
|
-
var O = toObject(that);
|
|
2452
|
-
var self = IndexedObject(O);
|
|
2453
|
-
var length = lengthOfArrayLike(O);
|
|
2454
|
-
aCallable(callbackfn);
|
|
2455
|
-
if (length === 0 && argumentsLength < 2) throw new $TypeError$2(REDUCE_EMPTY);
|
|
2456
|
-
var index = IS_RIGHT ? length - 1 : 0;
|
|
2457
|
-
var i = IS_RIGHT ? -1 : 1;
|
|
2458
|
-
if (argumentsLength < 2) while (true) {
|
|
2459
|
-
if (index in self) {
|
|
2460
|
-
memo = self[index];
|
|
2461
|
-
index += i;
|
|
2462
|
-
break;
|
|
2463
|
-
}
|
|
2464
|
-
index += i;
|
|
2465
|
-
if (IS_RIGHT ? index < 0 : length <= index) {
|
|
2466
|
-
throw new $TypeError$2(REDUCE_EMPTY);
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2469
|
-
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
|
2470
|
-
memo = callbackfn(memo, self[index], index, O);
|
|
2471
|
-
}
|
|
2472
|
-
return memo;
|
|
2473
|
-
};
|
|
2474
|
-
};
|
|
2475
|
-
|
|
2476
|
-
var arrayReduce = {
|
|
2477
|
-
// `Array.prototype.reduce` method
|
|
2478
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
2479
|
-
left: createMethod$1(false),
|
|
2480
|
-
// `Array.prototype.reduceRight` method
|
|
2481
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduceright
|
|
2482
|
-
right: createMethod$1(true)
|
|
2483
|
-
};
|
|
2484
|
-
|
|
2485
|
-
var fails$3 = fails$l;
|
|
2486
|
-
|
|
2487
|
-
var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
|
|
2488
|
-
var method = [][METHOD_NAME];
|
|
2489
|
-
return !!method && fails$3(function () {
|
|
2490
|
-
// eslint-disable-next-line no-useless-call -- required for testing
|
|
2491
|
-
method.call(null, argument || function () { return 1; }, 1);
|
|
2492
|
-
});
|
|
2493
|
-
};
|
|
2494
|
-
|
|
2495
|
-
/* global Bun, Deno -- detection */
|
|
2496
|
-
var globalThis$2 = globalThis_1;
|
|
2497
|
-
var userAgent = environmentUserAgent;
|
|
2498
|
-
var classof$2 = classofRaw$1;
|
|
2499
|
-
|
|
2500
|
-
var userAgentStartsWith = function (string) {
|
|
2501
|
-
return userAgent.slice(0, string.length) === string;
|
|
2502
|
-
};
|
|
2503
|
-
|
|
2504
|
-
var environment = (function () {
|
|
2505
|
-
if (userAgentStartsWith('Bun/')) return 'BUN';
|
|
2506
|
-
if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
|
|
2507
|
-
if (userAgentStartsWith('Deno/')) return 'DENO';
|
|
2508
|
-
if (userAgentStartsWith('Node.js/')) return 'NODE';
|
|
2509
|
-
if (globalThis$2.Bun && typeof Bun.version == 'string') return 'BUN';
|
|
2510
|
-
if (globalThis$2.Deno && typeof Deno.version == 'object') return 'DENO';
|
|
2511
|
-
if (classof$2(globalThis$2.process) === 'process') return 'NODE';
|
|
2512
|
-
if (globalThis$2.window && globalThis$2.document) return 'BROWSER';
|
|
2513
|
-
return 'REST';
|
|
2514
|
-
})();
|
|
2515
|
-
|
|
2516
|
-
var ENVIRONMENT = environment;
|
|
2517
|
-
|
|
2518
|
-
var environmentIsNode = ENVIRONMENT === 'NODE';
|
|
2519
|
-
|
|
2520
|
-
var $$3 = _export;
|
|
2521
|
-
var $reduce = arrayReduce.left;
|
|
2522
|
-
var arrayMethodIsStrict = arrayMethodIsStrict$1;
|
|
2523
|
-
var CHROME_VERSION = environmentV8Version;
|
|
2524
|
-
var IS_NODE = environmentIsNode;
|
|
2525
|
-
|
|
2526
|
-
// Chrome 80-82 has a critical bug
|
|
2527
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
|
2528
|
-
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
|
2529
|
-
var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict('reduce');
|
|
2530
|
-
|
|
2531
|
-
// `Array.prototype.reduce` method
|
|
2532
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
2533
|
-
$$3({ target: 'Array', proto: true, forced: FORCED$1 }, {
|
|
2534
|
-
reduce: function reduce(callbackfn /* , initialValue */) {
|
|
2535
|
-
var length = arguments.length;
|
|
2536
|
-
return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
|
2537
|
-
}
|
|
2538
|
-
});
|
|
2539
|
-
|
|
2540
426
|
function getDeepProperty(p, o) {
|
|
2541
|
-
return p.reduce((xs, x)
|
|
427
|
+
return p.reduce(function (xs, x) {
|
|
428
|
+
if (xs && typeof xs === 'object' && x in xs) {
|
|
429
|
+
return xs[x];
|
|
430
|
+
}
|
|
431
|
+
return null;
|
|
432
|
+
}, o);
|
|
2542
433
|
}
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
return getDeepProperty(nameAsArray, errors);
|
|
2546
|
-
};
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
434
|
+
var getErrors = function getErrors(name, errors) {
|
|
435
|
+
var nameAsArray = name.split('.');
|
|
436
|
+
return getDeepProperty(nameAsArray, errors) || undefined;
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
var _excluded$5 = ["name", "label", "defaultValue", "children", "rules", "onChange", "disabled", "className", "sx", "isReadOnly", "size"];
|
|
440
|
+
var ReactHookFormSelect = function ReactHookFormSelect(_ref) {
|
|
441
|
+
var name = _ref.name,
|
|
442
|
+
label = _ref.label,
|
|
443
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
444
|
+
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
445
|
+
children = _ref.children,
|
|
446
|
+
rules = _ref.rules,
|
|
447
|
+
_ref$onChange = _ref.onChange,
|
|
448
|
+
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
449
|
+
disabled = _ref.disabled,
|
|
450
|
+
className = _ref.className,
|
|
451
|
+
sx = _ref.sx,
|
|
452
|
+
isReadOnly = _ref.isReadOnly,
|
|
453
|
+
_ref$size = _ref.size,
|
|
454
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
2563
455
|
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
control
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
control,
|
|
2580
|
-
rules,
|
|
2581
|
-
defaultValue
|
|
2582
|
-
}, defaultProps));
|
|
2583
|
-
const errors = getErrors(name, formErrors);
|
|
456
|
+
var labelId = name + "-label";
|
|
457
|
+
var _useFormContext = useFormContext(),
|
|
458
|
+
control = _useFormContext.control;
|
|
459
|
+
var _useController = useController(Object.assign({
|
|
460
|
+
name: name,
|
|
461
|
+
control: control,
|
|
462
|
+
rules: rules,
|
|
463
|
+
defaultValue: defaultValue
|
|
464
|
+
}, defaultProps)),
|
|
465
|
+
_useController$field = _useController.field,
|
|
466
|
+
onChangeField = _useController$field.onChange,
|
|
467
|
+
value = _useController$field.value,
|
|
468
|
+
ref = _useController$field.ref,
|
|
469
|
+
formErrors = _useController.formState.errors;
|
|
470
|
+
var errors = getErrors(name, formErrors);
|
|
2584
471
|
return jsxs(ReactHookFormFormControl, {
|
|
2585
472
|
className: className,
|
|
2586
473
|
sx: sx,
|
|
@@ -2597,10 +484,10 @@ const ReactHookFormSelect = _ref => {
|
|
|
2597
484
|
label: label,
|
|
2598
485
|
inputRef: ref,
|
|
2599
486
|
name: name,
|
|
2600
|
-
onChange: changeEvent
|
|
487
|
+
onChange: function onChange(changeEvent, child) {
|
|
2601
488
|
onChangeField(changeEvent.target.value);
|
|
2602
489
|
// default props
|
|
2603
|
-
|
|
490
|
+
_onChange(changeEvent, child);
|
|
2604
491
|
},
|
|
2605
492
|
value: value || '',
|
|
2606
493
|
variant: "filled"
|
|
@@ -2610,45 +497,41 @@ const ReactHookFormSelect = _ref => {
|
|
|
2610
497
|
});
|
|
2611
498
|
};
|
|
2612
499
|
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
500
|
+
var _excluded$4 = ["name", "label", "defaultValue", "children", "rules", "disabled", "onChange", "isReadOnly"];
|
|
501
|
+
var ReactHookFormRadioGroup = function ReactHookFormRadioGroup(_ref) {
|
|
502
|
+
var name = _ref.name,
|
|
503
|
+
label = _ref.label,
|
|
504
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
505
|
+
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
506
|
+
children = _ref.children,
|
|
507
|
+
rules = _ref.rules,
|
|
508
|
+
_ref$disabled = _ref.disabled,
|
|
509
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
510
|
+
_ref$onChange = _ref.onChange,
|
|
511
|
+
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
512
|
+
isReadOnly = _ref.isReadOnly,
|
|
2625
513
|
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
control
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
rules,
|
|
2643
|
-
defaultValue
|
|
2644
|
-
}, defaultProps));
|
|
2645
|
-
const errors = getErrors(name, formErrors);
|
|
2646
|
-
React.useEffect(() => {
|
|
514
|
+
var labelId = name + "-label";
|
|
515
|
+
var _useFormContext = useFormContext(),
|
|
516
|
+
control = _useFormContext.control;
|
|
517
|
+
var _useController = useController(Object.assign({
|
|
518
|
+
name: name,
|
|
519
|
+
control: control,
|
|
520
|
+
rules: rules,
|
|
521
|
+
defaultValue: defaultValue
|
|
522
|
+
}, defaultProps)),
|
|
523
|
+
_useController$field = _useController.field,
|
|
524
|
+
onChangeField = _useController$field.onChange,
|
|
525
|
+
value = _useController$field.value,
|
|
526
|
+
ref = _useController$field.ref,
|
|
527
|
+
formErrors = _useController.formState.errors;
|
|
528
|
+
var errors = getErrors(name, formErrors);
|
|
529
|
+
React.useEffect(function () {
|
|
2647
530
|
if (errors) {
|
|
2648
|
-
|
|
531
|
+
var firstError = Object.keys(formErrors)[0];
|
|
2649
532
|
if (firstError === name) {
|
|
2650
533
|
// if first error in form is same, focus on that input
|
|
2651
|
-
|
|
534
|
+
var inputNode = document.querySelector("[name=\"" + name + "\"]");
|
|
2652
535
|
if (inputNode !== null) {
|
|
2653
536
|
inputNode.focus();
|
|
2654
537
|
}
|
|
@@ -2664,9 +547,9 @@ const ReactHookFormRadioGroup = _ref => {
|
|
|
2664
547
|
children: label
|
|
2665
548
|
}), jsx(RadioGroup, Object.assign({
|
|
2666
549
|
value: value,
|
|
2667
|
-
onChange: changeEvent
|
|
550
|
+
onChange: function onChange(changeEvent) {
|
|
2668
551
|
onChangeField(changeEvent.target.value);
|
|
2669
|
-
|
|
552
|
+
_onChange(changeEvent, changeEvent.target.value);
|
|
2670
553
|
},
|
|
2671
554
|
ref: ref,
|
|
2672
555
|
name: name
|
|
@@ -2676,45 +559,43 @@ const ReactHookFormRadioGroup = _ref => {
|
|
|
2676
559
|
});
|
|
2677
560
|
};
|
|
2678
561
|
|
|
2679
|
-
|
|
2680
|
-
|
|
562
|
+
var _excluded$3 = ["name", "label", "defaultValue", "rules", "disabled", "upperCase", "helperText", "className", "sx", "onChange", "isReadOnly", "inputSlotProps"];
|
|
563
|
+
var convertTextInputValue = function convertTextInputValue(value, inCapitals) {
|
|
2681
564
|
return inCapitals ? value.toUpperCase() : value;
|
|
2682
565
|
};
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
566
|
+
var ReactHookFormTextField = function ReactHookFormTextField(_ref) {
|
|
567
|
+
var name = _ref.name,
|
|
568
|
+
label = _ref.label,
|
|
569
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
570
|
+
defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
|
|
571
|
+
rules = _ref.rules,
|
|
572
|
+
_ref$disabled = _ref.disabled,
|
|
573
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
574
|
+
_ref$upperCase = _ref.upperCase,
|
|
575
|
+
upperCase = _ref$upperCase === void 0 ? false : _ref$upperCase,
|
|
576
|
+
_ref$helperText = _ref.helperText,
|
|
577
|
+
helperText = _ref$helperText === void 0 ? '' : _ref$helperText,
|
|
578
|
+
className = _ref.className,
|
|
579
|
+
sx = _ref.sx,
|
|
580
|
+
_ref$onChange = _ref.onChange,
|
|
581
|
+
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
582
|
+
isReadOnly = _ref.isReadOnly,
|
|
583
|
+
inputSlotProps = _ref.inputSlotProps,
|
|
2698
584
|
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
2699
|
-
|
|
2700
|
-
control
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
control,
|
|
2714
|
-
rules,
|
|
2715
|
-
defaultValue
|
|
2716
|
-
}, defaultProps));
|
|
2717
|
-
const errors = getErrors(name, formErrors);
|
|
585
|
+
var _useFormContext = useFormContext(),
|
|
586
|
+
control = _useFormContext.control;
|
|
587
|
+
var _useController = useController(Object.assign({
|
|
588
|
+
name: name,
|
|
589
|
+
control: control,
|
|
590
|
+
rules: rules,
|
|
591
|
+
defaultValue: defaultValue
|
|
592
|
+
}, defaultProps)),
|
|
593
|
+
_useController$field = _useController.field,
|
|
594
|
+
onChangeField = _useController$field.onChange,
|
|
595
|
+
value = _useController$field.value,
|
|
596
|
+
ref = _useController$field.ref,
|
|
597
|
+
formErrors = _useController.formState.errors;
|
|
598
|
+
var errors = getErrors(name, formErrors);
|
|
2718
599
|
return jsx(ReactHookFormFormControl, {
|
|
2719
600
|
className: className,
|
|
2720
601
|
sx: sx,
|
|
@@ -2729,13 +610,11 @@ const ReactHookFormTextField = _ref => {
|
|
|
2729
610
|
variant: "filled",
|
|
2730
611
|
type: "text",
|
|
2731
612
|
name: name,
|
|
2732
|
-
onChange: evt
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
} = evt.target;
|
|
2736
|
-
const convertedValue = convertTextInputValue(value, upperCase);
|
|
613
|
+
onChange: function onChange(evt) {
|
|
614
|
+
var value = evt.target.value;
|
|
615
|
+
var convertedValue = convertTextInputValue(value, upperCase);
|
|
2737
616
|
onChangeField(convertedValue);
|
|
2738
|
-
|
|
617
|
+
_onChange(null);
|
|
2739
618
|
},
|
|
2740
619
|
disabled: disabled,
|
|
2741
620
|
inputRef: ref
|
|
@@ -2749,364 +628,62 @@ const ReactHookFormTextField = _ref => {
|
|
|
2749
628
|
});
|
|
2750
629
|
};
|
|
2751
630
|
|
|
2752
|
-
var
|
|
2753
|
-
var
|
|
2754
|
-
var fails$2 = fails$l;
|
|
2755
|
-
var addToUnscopables = addToUnscopables$2;
|
|
2756
|
-
|
|
2757
|
-
// FF99+ bug
|
|
2758
|
-
var BROKEN_ON_SPARSE = fails$2(function () {
|
|
2759
|
-
// eslint-disable-next-line es/no-array-prototype-includes -- detection
|
|
2760
|
-
return !Array(1).includes();
|
|
2761
|
-
});
|
|
2762
|
-
|
|
2763
|
-
// `Array.prototype.includes` method
|
|
2764
|
-
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
2765
|
-
$$2({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
|
2766
|
-
includes: function includes(el /* , fromIndex = 0 */) {
|
|
2767
|
-
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
|
2768
|
-
}
|
|
2769
|
-
});
|
|
2770
|
-
|
|
2771
|
-
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
2772
|
-
addToUnscopables('includes');
|
|
2773
|
-
|
|
2774
|
-
var globalThis$1 = globalThis_1;
|
|
2775
|
-
var fails$1 = fails$l;
|
|
2776
|
-
var uncurryThis$2 = functionUncurryThis;
|
|
2777
|
-
var toString$3 = toString$8;
|
|
2778
|
-
var trim = stringTrim.trim;
|
|
2779
|
-
var whitespaces = whitespaces$4;
|
|
2780
|
-
|
|
2781
|
-
var $parseInt$1 = globalThis$1.parseInt;
|
|
2782
|
-
var Symbol$1 = globalThis$1.Symbol;
|
|
2783
|
-
var ITERATOR = Symbol$1 && Symbol$1.iterator;
|
|
2784
|
-
var hex = /^[+-]?0x/i;
|
|
2785
|
-
var exec = uncurryThis$2(hex.exec);
|
|
2786
|
-
var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
|
|
2787
|
-
// MS Edge 18- broken with boxed symbols
|
|
2788
|
-
|| (ITERATOR && !fails$1(function () { $parseInt$1(Object(ITERATOR)); }));
|
|
2789
|
-
|
|
2790
|
-
// `parseInt` method
|
|
2791
|
-
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
2792
|
-
var numberParseInt = FORCED ? function parseInt(string, radix) {
|
|
2793
|
-
var S = trim(toString$3(string));
|
|
2794
|
-
return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
|
|
2795
|
-
} : $parseInt$1;
|
|
2796
|
-
|
|
2797
|
-
var $$1 = _export;
|
|
2798
|
-
var $parseInt = numberParseInt;
|
|
2799
|
-
|
|
2800
|
-
// `parseInt` method
|
|
2801
|
-
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
2802
|
-
$$1({ global: true, forced: parseInt !== $parseInt }, {
|
|
2803
|
-
parseInt: $parseInt
|
|
2804
|
-
});
|
|
2805
|
-
|
|
2806
|
-
var isObject = isObject$9;
|
|
2807
|
-
var classof$1 = classofRaw$1;
|
|
2808
|
-
var wellKnownSymbol$2 = wellKnownSymbol$b;
|
|
2809
|
-
|
|
2810
|
-
var MATCH$1 = wellKnownSymbol$2('match');
|
|
2811
|
-
|
|
2812
|
-
// `IsRegExp` abstract operation
|
|
2813
|
-
// https://tc39.es/ecma262/#sec-isregexp
|
|
2814
|
-
var isRegexp = function (it) {
|
|
2815
|
-
var isRegExp;
|
|
2816
|
-
return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$1(it) === 'RegExp');
|
|
2817
|
-
};
|
|
2818
|
-
|
|
2819
|
-
var isRegExp = isRegexp;
|
|
2820
|
-
|
|
2821
|
-
var $TypeError$1 = TypeError;
|
|
2822
|
-
|
|
2823
|
-
var notARegexp = function (it) {
|
|
2824
|
-
if (isRegExp(it)) {
|
|
2825
|
-
throw new $TypeError$1("The method doesn't accept regular expressions");
|
|
2826
|
-
} return it;
|
|
2827
|
-
};
|
|
2828
|
-
|
|
2829
|
-
var wellKnownSymbol$1 = wellKnownSymbol$b;
|
|
2830
|
-
|
|
2831
|
-
var MATCH = wellKnownSymbol$1('match');
|
|
2832
|
-
|
|
2833
|
-
var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
2834
|
-
var regexp = /./;
|
|
2835
|
-
try {
|
|
2836
|
-
'/./'[METHOD_NAME](regexp);
|
|
2837
|
-
} catch (error1) {
|
|
2838
|
-
try {
|
|
2839
|
-
regexp[MATCH] = false;
|
|
2840
|
-
return '/./'[METHOD_NAME](regexp);
|
|
2841
|
-
} catch (error2) { /* empty */ }
|
|
2842
|
-
} return false;
|
|
2843
|
-
};
|
|
2844
|
-
|
|
2845
|
-
var $ = _export;
|
|
2846
|
-
var uncurryThis$1 = functionUncurryThis;
|
|
2847
|
-
var notARegExp = notARegexp;
|
|
2848
|
-
var requireObjectCoercible$2 = requireObjectCoercible$7;
|
|
2849
|
-
var toString$2 = toString$8;
|
|
2850
|
-
var correctIsRegExpLogic = correctIsRegexpLogic;
|
|
2851
|
-
|
|
2852
|
-
var stringIndexOf = uncurryThis$1(''.indexOf);
|
|
2853
|
-
|
|
2854
|
-
// `String.prototype.includes` method
|
|
2855
|
-
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
2856
|
-
$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
|
2857
|
-
includes: function includes(searchString /* , position = 0 */) {
|
|
2858
|
-
return !!~stringIndexOf(
|
|
2859
|
-
toString$2(requireObjectCoercible$2(this)),
|
|
2860
|
-
toString$2(notARegExp(searchString)),
|
|
2861
|
-
arguments.length > 1 ? arguments[1] : undefined
|
|
2862
|
-
);
|
|
2863
|
-
}
|
|
2864
|
-
});
|
|
2865
|
-
|
|
2866
|
-
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
2867
|
-
|
|
2868
|
-
var call$2 = functionCall;
|
|
2869
|
-
var defineBuiltIn = defineBuiltIn$5;
|
|
2870
|
-
var regexpExec$1 = regexpExec$2;
|
|
2871
|
-
var fails = fails$l;
|
|
2872
|
-
var wellKnownSymbol = wellKnownSymbol$b;
|
|
2873
|
-
var createNonEnumerableProperty = createNonEnumerableProperty$5;
|
|
2874
|
-
|
|
2875
|
-
var SPECIES = wellKnownSymbol('species');
|
|
2876
|
-
var RegExpPrototype = RegExp.prototype;
|
|
2877
|
-
|
|
2878
|
-
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
2879
|
-
var SYMBOL = wellKnownSymbol(KEY);
|
|
2880
|
-
|
|
2881
|
-
var DELEGATES_TO_SYMBOL = !fails(function () {
|
|
2882
|
-
// String methods call symbol-named RegExp methods
|
|
2883
|
-
var O = {};
|
|
2884
|
-
O[SYMBOL] = function () { return 7; };
|
|
2885
|
-
return ''[KEY](O) !== 7;
|
|
2886
|
-
});
|
|
2887
|
-
|
|
2888
|
-
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
|
2889
|
-
// Symbol-named RegExp methods call .exec
|
|
2890
|
-
var execCalled = false;
|
|
2891
|
-
var re = /a/;
|
|
2892
|
-
|
|
2893
|
-
if (KEY === 'split') {
|
|
2894
|
-
// We can't use real regex here since it causes deoptimization
|
|
2895
|
-
// and serious performance degradation in V8
|
|
2896
|
-
// https://github.com/zloirock/core-js/issues/306
|
|
2897
|
-
re = {};
|
|
2898
|
-
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
|
2899
|
-
// a new one. We need to return the patched regex when creating the new one.
|
|
2900
|
-
re.constructor = {};
|
|
2901
|
-
re.constructor[SPECIES] = function () { return re; };
|
|
2902
|
-
re.flags = '';
|
|
2903
|
-
re[SYMBOL] = /./[SYMBOL];
|
|
2904
|
-
}
|
|
2905
|
-
|
|
2906
|
-
re.exec = function () {
|
|
2907
|
-
execCalled = true;
|
|
2908
|
-
return null;
|
|
2909
|
-
};
|
|
2910
|
-
|
|
2911
|
-
re[SYMBOL]('');
|
|
2912
|
-
return !execCalled;
|
|
2913
|
-
});
|
|
2914
|
-
|
|
2915
|
-
if (
|
|
2916
|
-
!DELEGATES_TO_SYMBOL ||
|
|
2917
|
-
!DELEGATES_TO_EXEC ||
|
|
2918
|
-
FORCED
|
|
2919
|
-
) {
|
|
2920
|
-
var nativeRegExpMethod = /./[SYMBOL];
|
|
2921
|
-
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
2922
|
-
var $exec = regexp.exec;
|
|
2923
|
-
if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
|
|
2924
|
-
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
2925
|
-
// The native String method already delegates to @@method (this
|
|
2926
|
-
// polyfilled function), leasing to infinite recursion.
|
|
2927
|
-
// We avoid it by directly calling the native @@method method.
|
|
2928
|
-
return { done: true, value: call$2(nativeRegExpMethod, regexp, str, arg2) };
|
|
2929
|
-
}
|
|
2930
|
-
return { done: true, value: call$2(nativeMethod, str, regexp, arg2) };
|
|
2931
|
-
}
|
|
2932
|
-
return { done: false };
|
|
2933
|
-
});
|
|
2934
|
-
|
|
2935
|
-
defineBuiltIn(String.prototype, KEY, methods[0]);
|
|
2936
|
-
defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
|
|
2937
|
-
}
|
|
2938
|
-
|
|
2939
|
-
if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
|
2940
|
-
};
|
|
2941
|
-
|
|
2942
|
-
var uncurryThis = functionUncurryThis;
|
|
2943
|
-
var toIntegerOrInfinity = toIntegerOrInfinity$3;
|
|
2944
|
-
var toString$1 = toString$8;
|
|
2945
|
-
var requireObjectCoercible$1 = requireObjectCoercible$7;
|
|
2946
|
-
|
|
2947
|
-
var charAt$1 = uncurryThis(''.charAt);
|
|
2948
|
-
var charCodeAt = uncurryThis(''.charCodeAt);
|
|
2949
|
-
var stringSlice = uncurryThis(''.slice);
|
|
2950
|
-
|
|
2951
|
-
var createMethod = function (CONVERT_TO_STRING) {
|
|
2952
|
-
return function ($this, pos) {
|
|
2953
|
-
var S = toString$1(requireObjectCoercible$1($this));
|
|
2954
|
-
var position = toIntegerOrInfinity(pos);
|
|
2955
|
-
var size = S.length;
|
|
2956
|
-
var first, second;
|
|
2957
|
-
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
2958
|
-
first = charCodeAt(S, position);
|
|
2959
|
-
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
2960
|
-
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
|
2961
|
-
? CONVERT_TO_STRING
|
|
2962
|
-
? charAt$1(S, position)
|
|
2963
|
-
: first
|
|
2964
|
-
: CONVERT_TO_STRING
|
|
2965
|
-
? stringSlice(S, position, position + 2)
|
|
2966
|
-
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
2967
|
-
};
|
|
2968
|
-
};
|
|
2969
|
-
|
|
2970
|
-
var stringMultibyte = {
|
|
2971
|
-
// `String.prototype.codePointAt` method
|
|
2972
|
-
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
2973
|
-
codeAt: createMethod(false),
|
|
2974
|
-
// `String.prototype.at` method
|
|
2975
|
-
// https://github.com/mathiasbynens/String.prototype.at
|
|
2976
|
-
charAt: createMethod(true)
|
|
2977
|
-
};
|
|
2978
|
-
|
|
2979
|
-
var charAt = stringMultibyte.charAt;
|
|
2980
|
-
|
|
2981
|
-
// `AdvanceStringIndex` abstract operation
|
|
2982
|
-
// https://tc39.es/ecma262/#sec-advancestringindex
|
|
2983
|
-
var advanceStringIndex$1 = function (S, index, unicode) {
|
|
2984
|
-
return index + (unicode ? charAt(S, index).length : 1);
|
|
2985
|
-
};
|
|
2986
|
-
|
|
2987
|
-
var call$1 = functionCall;
|
|
2988
|
-
var anObject$1 = anObject$9;
|
|
2989
|
-
var isCallable = isCallable$g;
|
|
2990
|
-
var classof = classofRaw$1;
|
|
2991
|
-
var regexpExec = regexpExec$2;
|
|
2992
|
-
|
|
2993
|
-
var $TypeError = TypeError;
|
|
2994
|
-
|
|
2995
|
-
// `RegExpExec` abstract operation
|
|
2996
|
-
// https://tc39.es/ecma262/#sec-regexpexec
|
|
2997
|
-
var regexpExecAbstract = function (R, S) {
|
|
2998
|
-
var exec = R.exec;
|
|
2999
|
-
if (isCallable(exec)) {
|
|
3000
|
-
var result = call$1(exec, R, S);
|
|
3001
|
-
if (result !== null) anObject$1(result);
|
|
3002
|
-
return result;
|
|
3003
|
-
}
|
|
3004
|
-
if (classof(R) === 'RegExp') return call$1(regexpExec, R, S);
|
|
3005
|
-
throw new $TypeError('RegExp#exec called on incompatible receiver');
|
|
3006
|
-
};
|
|
3007
|
-
|
|
3008
|
-
var call = functionCall;
|
|
3009
|
-
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
3010
|
-
var anObject = anObject$9;
|
|
3011
|
-
var isNullOrUndefined = isNullOrUndefined$3;
|
|
3012
|
-
var toLength = toLength$2;
|
|
3013
|
-
var toString = toString$8;
|
|
3014
|
-
var requireObjectCoercible = requireObjectCoercible$7;
|
|
3015
|
-
var getMethod = getMethod$2;
|
|
3016
|
-
var advanceStringIndex = advanceStringIndex$1;
|
|
3017
|
-
var regExpExec = regexpExecAbstract;
|
|
3018
|
-
|
|
3019
|
-
// @@match logic
|
|
3020
|
-
fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
|
|
3021
|
-
return [
|
|
3022
|
-
// `String.prototype.match` method
|
|
3023
|
-
// https://tc39.es/ecma262/#sec-string.prototype.match
|
|
3024
|
-
function match(regexp) {
|
|
3025
|
-
var O = requireObjectCoercible(this);
|
|
3026
|
-
var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
|
|
3027
|
-
return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
|
|
3028
|
-
},
|
|
3029
|
-
// `RegExp.prototype[@@match]` method
|
|
3030
|
-
// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
|
|
3031
|
-
function (string) {
|
|
3032
|
-
var rx = anObject(this);
|
|
3033
|
-
var S = toString(string);
|
|
3034
|
-
var res = maybeCallNative(nativeMatch, rx, S);
|
|
3035
|
-
|
|
3036
|
-
if (res.done) return res.value;
|
|
3037
|
-
|
|
3038
|
-
if (!rx.global) return regExpExec(rx, S);
|
|
3039
|
-
|
|
3040
|
-
var fullUnicode = rx.unicode;
|
|
3041
|
-
rx.lastIndex = 0;
|
|
3042
|
-
var A = [];
|
|
3043
|
-
var n = 0;
|
|
3044
|
-
var result;
|
|
3045
|
-
while ((result = regExpExec(rx, S)) !== null) {
|
|
3046
|
-
var matchStr = toString(result[0]);
|
|
3047
|
-
A[n] = matchStr;
|
|
3048
|
-
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
3049
|
-
n++;
|
|
3050
|
-
}
|
|
3051
|
-
return n === 0 ? null : A;
|
|
3052
|
-
}
|
|
3053
|
-
];
|
|
3054
|
-
});
|
|
3055
|
-
|
|
3056
|
-
const _excluded$2 = ["name", "label", "defaultValue", "rules", "disabled", "inputMode", "helperText", "className", "size", "sx", "onChange", "isReadOnly"];
|
|
3057
|
-
const convertNumericInputValue = (value, inputMode) => {
|
|
631
|
+
var _excluded$2 = ["name", "label", "defaultValue", "rules", "disabled", "inputMode", "helperText", "className", "size", "sx", "onChange", "isReadOnly"];
|
|
632
|
+
var convertNumericInputValue = function convertNumericInputValue(value, inputMode) {
|
|
3058
633
|
if (value !== '' && !isNaN(parseFloat(value))) {
|
|
3059
634
|
return inputMode === 'numeric' ? parseInt(value, 10) : parseFloat(value);
|
|
3060
635
|
}
|
|
3061
636
|
return null;
|
|
3062
637
|
};
|
|
3063
|
-
|
|
3064
|
-
|
|
638
|
+
var getAllowedKeys = function getAllowedKeys(inputMode) {
|
|
639
|
+
if (inputMode === void 0) {
|
|
640
|
+
inputMode = 'numeric';
|
|
641
|
+
}
|
|
642
|
+
var allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', 'Backspace', 'ArrowRight', 'ArrowLeft', 'Tab', 'Home', 'End', 'PageDown', 'PageUp', 'Delete'].concat(inputMode === 'decimal' ? ['.'] : []);
|
|
3065
643
|
return allowedKeys;
|
|
3066
644
|
};
|
|
3067
|
-
|
|
645
|
+
var ReactHookFormNumberField = function ReactHookFormNumberField(_ref) {
|
|
3068
646
|
var _otherProps$slotProps;
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
647
|
+
var name = _ref.name,
|
|
648
|
+
label = _ref.label,
|
|
649
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
650
|
+
defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue,
|
|
651
|
+
rules = _ref.rules,
|
|
652
|
+
_ref$disabled = _ref.disabled,
|
|
653
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
654
|
+
_ref$inputMode = _ref.inputMode,
|
|
655
|
+
inputMode = _ref$inputMode === void 0 ? 'numeric' : _ref$inputMode,
|
|
656
|
+
_ref$helperText = _ref.helperText,
|
|
657
|
+
helperText = _ref$helperText === void 0 ? '' : _ref$helperText,
|
|
658
|
+
className = _ref.className,
|
|
659
|
+
_ref$size = _ref.size,
|
|
660
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
661
|
+
sx = _ref.sx,
|
|
662
|
+
_ref$onChange = _ref.onChange,
|
|
663
|
+
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
664
|
+
isReadOnly = _ref.isReadOnly,
|
|
3083
665
|
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
3084
|
-
|
|
3085
|
-
control
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
const clipboardText = event.clipboardData.getData('text/plain');
|
|
3106
|
-
const inputElement = event.target;
|
|
3107
|
-
const before = inputElement.value.slice(0, inputElement.selectionStart);
|
|
3108
|
-
const after = inputElement.value.slice(inputElement.selectionEnd);
|
|
3109
|
-
const newValue = before + clipboardText + after;
|
|
666
|
+
var _useFormContext = useFormContext(),
|
|
667
|
+
control = _useFormContext.control;
|
|
668
|
+
var _useController = useController(Object.assign({
|
|
669
|
+
name: name,
|
|
670
|
+
control: control,
|
|
671
|
+
rules: rules,
|
|
672
|
+
defaultValue: defaultValue
|
|
673
|
+
}, defaultProps)),
|
|
674
|
+
_useController$field = _useController.field,
|
|
675
|
+
onChangeField = _useController$field.onChange,
|
|
676
|
+
value = _useController$field.value,
|
|
677
|
+
ref = _useController$field.ref,
|
|
678
|
+
formErrors = _useController.formState.errors;
|
|
679
|
+
var errors = getErrors(name, formErrors);
|
|
680
|
+
var allowedKeyes = getAllowedKeys(inputMode);
|
|
681
|
+
var onPaste = function onPaste(event) {
|
|
682
|
+
var clipboardText = event.clipboardData.getData('text/plain');
|
|
683
|
+
var inputElement = event.target;
|
|
684
|
+
var before = inputElement.value.slice(0, inputElement.selectionStart);
|
|
685
|
+
var after = inputElement.value.slice(inputElement.selectionEnd);
|
|
686
|
+
var newValue = before + clipboardText + after;
|
|
3110
687
|
// eslint-disable-next-line no-useless-escape
|
|
3111
688
|
if (inputMode === 'numeric' && !newValue.match(/^\-?[0-9]+$/)) {
|
|
3112
689
|
event.preventDefault();
|
|
@@ -3116,8 +693,8 @@ const ReactHookFormNumberField = _ref => {
|
|
|
3116
693
|
event.preventDefault();
|
|
3117
694
|
}
|
|
3118
695
|
};
|
|
3119
|
-
|
|
3120
|
-
|
|
696
|
+
var onKeyDown = function onKeyDown(event) {
|
|
697
|
+
var isMac = window.navigator.userAgent.includes(' Mac ');
|
|
3121
698
|
if (isMac && event.metaKey || !isMac && event.ctrlKey) {
|
|
3122
699
|
if (['c', 'v', 'x'].includes(event.key.toLowerCase())) {
|
|
3123
700
|
return;
|
|
@@ -3131,7 +708,9 @@ const ReactHookFormNumberField = _ref => {
|
|
|
3131
708
|
event.preventDefault();
|
|
3132
709
|
}
|
|
3133
710
|
};
|
|
3134
|
-
|
|
711
|
+
var _React$useState = React.useState(value === null || isNaN(value) ? '' : value),
|
|
712
|
+
displayValue = _React$useState[0],
|
|
713
|
+
setDisplayValue = _React$useState[1];
|
|
3135
714
|
return jsx(ReactHookFormFormControl, {
|
|
3136
715
|
className: className,
|
|
3137
716
|
sx: sx,
|
|
@@ -3148,13 +727,11 @@ const ReactHookFormNumberField = _ref => {
|
|
|
3148
727
|
type: "text",
|
|
3149
728
|
name: name,
|
|
3150
729
|
size: size,
|
|
3151
|
-
onChange: evt
|
|
3152
|
-
|
|
3153
|
-
value
|
|
3154
|
-
} = evt.target;
|
|
730
|
+
onChange: function onChange(evt) {
|
|
731
|
+
var value = evt.target.value;
|
|
3155
732
|
setDisplayValue(value);
|
|
3156
733
|
onChangeField(convertNumericInputValue(value, inputMode));
|
|
3157
|
-
|
|
734
|
+
_onChange(null);
|
|
3158
735
|
},
|
|
3159
736
|
onKeyDown: onKeyDown,
|
|
3160
737
|
disabled: disabled,
|
|
@@ -3164,35 +741,43 @@ const ReactHookFormNumberField = _ref => {
|
|
|
3164
741
|
input: Object.assign({}, isReadOnly && {
|
|
3165
742
|
readOnly: true
|
|
3166
743
|
}, {
|
|
3167
|
-
onPaste
|
|
744
|
+
onPaste: onPaste
|
|
3168
745
|
}),
|
|
3169
746
|
htmlInput: Object.assign({}, (_otherProps$slotProps = otherProps.slotProps) == null ? void 0 : _otherProps$slotProps.htmlInput, {
|
|
3170
|
-
inputMode
|
|
747
|
+
inputMode: inputMode
|
|
3171
748
|
})
|
|
3172
749
|
})
|
|
3173
750
|
}))
|
|
3174
751
|
});
|
|
3175
752
|
};
|
|
3176
753
|
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
754
|
+
var _excluded$1 = ["name", "rules", "disabled", "label", "format", "openTo", "defaultNullValue", "helperText", "onChange", "className", "sx", "isReadOnly", "inputAdornment", "shouldHideUTC", "disablePast", "disableFuture"];
|
|
755
|
+
var OpenPicker = function OpenPicker() {
|
|
756
|
+
return jsx(CalendarToday, {});
|
|
757
|
+
};
|
|
758
|
+
var getTimezoneOffset = function getTimezoneOffset(value) {
|
|
759
|
+
return value.getTimezoneOffset() * 60000;
|
|
760
|
+
};
|
|
761
|
+
var makeLocalAppearUTC = function makeLocalAppearUTC(value) {
|
|
762
|
+
return new Date(value.getTime() + getTimezoneOffset(value));
|
|
763
|
+
};
|
|
764
|
+
var localToUTC = function localToUTC(dateTime) {
|
|
765
|
+
return new Date(dateTime.getTime() - getTimezoneOffset(dateTime));
|
|
766
|
+
};
|
|
3182
767
|
/**
|
|
3183
768
|
* Should return an isostring in the form "YYYY-MM-DDThh:mm:ssZ";
|
|
3184
769
|
* The milli seconds section should not be included, strictly YYYY-MM-DDThh:mm:ssZ is important
|
|
3185
770
|
* @param value input Date
|
|
3186
771
|
* @returns iso string in YYYY-MM-DDThh:mm:ssZ format.
|
|
3187
772
|
*/
|
|
3188
|
-
|
|
773
|
+
var getFormattedValueForDatePicker = function getFormattedValueForDatePicker(value) {
|
|
3189
774
|
var _dateUtils$dateToStri;
|
|
3190
775
|
return (_dateUtils$dateToStri = dateUtils.dateToString(value, "yyyy-MM-dd'T'HH:mm:ss'Z'", true)) != null ? _dateUtils$dateToStri : null;
|
|
3191
776
|
};
|
|
3192
|
-
|
|
777
|
+
var getDateValue = function getDateValue(value) {
|
|
3193
778
|
if (value) {
|
|
3194
779
|
var _ref, _dateUtils$stringToDa;
|
|
3195
|
-
|
|
780
|
+
var dateValue = (_ref = (_dateUtils$stringToDa = dateUtils.stringToDate(value, 'yyyy/MM/dd HH:mm', false)) != null ? _dateUtils$stringToDa : dateUtils.isoStringToDate(value, false)) != null ? _ref : null;
|
|
3196
781
|
if (dateValue) {
|
|
3197
782
|
return makeLocalAppearUTC(dateValue);
|
|
3198
783
|
}
|
|
@@ -3200,50 +785,49 @@ const getDateValue = value => {
|
|
|
3200
785
|
}
|
|
3201
786
|
return null;
|
|
3202
787
|
};
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
788
|
+
var ReactHookKeyboardDateTimePicker = function ReactHookKeyboardDateTimePicker(_ref2) {
|
|
789
|
+
var name = _ref2.name,
|
|
790
|
+
rules = _ref2.rules,
|
|
791
|
+
disabled = _ref2.disabled,
|
|
792
|
+
_ref2$label = _ref2.label,
|
|
793
|
+
label = _ref2$label === void 0 ? 'Select date and time' : _ref2$label,
|
|
794
|
+
_ref2$format = _ref2.format,
|
|
795
|
+
format = _ref2$format === void 0 ? dateUtils.DATE_FORMAT_DATEPICKER : _ref2$format,
|
|
796
|
+
_ref2$openTo = _ref2.openTo,
|
|
797
|
+
openTo = _ref2$openTo === void 0 ? 'hours' : _ref2$openTo,
|
|
798
|
+
_ref2$defaultNullValu = _ref2.defaultNullValue,
|
|
799
|
+
defaultNullValue = _ref2$defaultNullValu === void 0 ? null : _ref2$defaultNullValu,
|
|
800
|
+
_ref2$helperText = _ref2.helperText,
|
|
801
|
+
helperText = _ref2$helperText === void 0 ? '' : _ref2$helperText,
|
|
802
|
+
_ref2$onChange = _ref2.onChange,
|
|
803
|
+
_onChange = _ref2$onChange === void 0 ? function () {} : _ref2$onChange,
|
|
804
|
+
className = _ref2.className,
|
|
805
|
+
sx = _ref2.sx,
|
|
806
|
+
isReadOnly = _ref2.isReadOnly,
|
|
807
|
+
inputAdornment = _ref2.inputAdornment,
|
|
808
|
+
shouldHideUTC = _ref2.shouldHideUTC,
|
|
809
|
+
disablePast = _ref2.disablePast,
|
|
810
|
+
disableFuture = _ref2.disableFuture,
|
|
3222
811
|
otherProps = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
|
|
3223
|
-
|
|
3224
|
-
control
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
control,
|
|
3238
|
-
rules,
|
|
3239
|
-
defaultValue: defaultNullValue
|
|
3240
|
-
}, defaultProps));
|
|
3241
|
-
const errors = getErrors(name, formErrors);
|
|
812
|
+
var _useFormContext = useFormContext(),
|
|
813
|
+
control = _useFormContext.control;
|
|
814
|
+
var _useController = useController(Object.assign({
|
|
815
|
+
name: name,
|
|
816
|
+
control: control,
|
|
817
|
+
rules: rules,
|
|
818
|
+
defaultValue: defaultNullValue
|
|
819
|
+
}, defaultProps)),
|
|
820
|
+
_useController$field = _useController.field,
|
|
821
|
+
onChangeField = _useController$field.onChange,
|
|
822
|
+
value = _useController$field.value,
|
|
823
|
+
ref = _useController$field.ref,
|
|
824
|
+
formErrors = _useController.formState.errors;
|
|
825
|
+
var errors = getErrors(name, formErrors);
|
|
3242
826
|
// Ensure value is a Date object
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
827
|
+
var dateValue = getDateValue(value);
|
|
828
|
+
var now = makeLocalAppearUTC(dateUtils.utc());
|
|
829
|
+
var minDateTime = disablePast ? now : null;
|
|
830
|
+
var maxDateTime = disableFuture ? now : null;
|
|
3247
831
|
return jsx(ReactHookFormFormControl, {
|
|
3248
832
|
disabled: disabled,
|
|
3249
833
|
errors: errors,
|
|
@@ -3258,23 +842,23 @@ const ReactHookKeyboardDateTimePicker = _ref2 => {
|
|
|
3258
842
|
value: dateValue,
|
|
3259
843
|
openTo: openTo,
|
|
3260
844
|
disabled: disabled,
|
|
3261
|
-
onChange: value
|
|
845
|
+
onChange: function onChange(value) {
|
|
3262
846
|
if (!value) {
|
|
3263
|
-
|
|
847
|
+
_onChange(null);
|
|
3264
848
|
onChangeField(null);
|
|
3265
849
|
return;
|
|
3266
850
|
}
|
|
3267
|
-
|
|
851
|
+
var formattedDate = getFormattedValueForDatePicker(localToUTC(value));
|
|
3268
852
|
onChangeField(formattedDate);
|
|
3269
|
-
|
|
853
|
+
_onChange(formattedDate);
|
|
3270
854
|
},
|
|
3271
855
|
inputRef: ref,
|
|
3272
856
|
slotProps: {
|
|
3273
857
|
textField: Object.assign({
|
|
3274
858
|
variant: 'filled',
|
|
3275
|
-
helperText,
|
|
859
|
+
helperText: helperText,
|
|
3276
860
|
error: !!errors,
|
|
3277
|
-
name,
|
|
861
|
+
name: name,
|
|
3278
862
|
placeholder: disabled ? '' : format.toLowerCase(),
|
|
3279
863
|
InputProps: Object.assign({}, !shouldHideUTC && {
|
|
3280
864
|
endAdornment: jsx(InputAdornment, {
|
|
@@ -3313,15 +897,15 @@ const ReactHookKeyboardDateTimePicker = _ref2 => {
|
|
|
3313
897
|
});
|
|
3314
898
|
};
|
|
3315
899
|
|
|
3316
|
-
|
|
900
|
+
var defaultFormOptions = {
|
|
3317
901
|
mode: 'onChange',
|
|
3318
902
|
reValidateMode: 'onChange'
|
|
3319
903
|
};
|
|
3320
|
-
|
|
3321
|
-
children,
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
904
|
+
var ReactHookFormProvider = function ReactHookFormProvider(_ref) {
|
|
905
|
+
var children = _ref.children,
|
|
906
|
+
_ref$options = _ref.options,
|
|
907
|
+
options = _ref$options === void 0 ? defaultFormOptions : _ref$options;
|
|
908
|
+
var formMethods = useForm(options);
|
|
3325
909
|
// added this ignore as the build is failing otherwise on: Type instantiation is excessively deep and possibly infinite.
|
|
3326
910
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3327
911
|
// @ts-ignore
|
|
@@ -3329,73 +913,80 @@ const ReactHookFormProvider = ({
|
|
|
3329
913
|
children: children
|
|
3330
914
|
}));
|
|
3331
915
|
};
|
|
3332
|
-
|
|
3333
|
-
children,
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
})
|
|
916
|
+
var ReactHookFormProviderWrapper = function ReactHookFormProviderWrapper(_ref2) {
|
|
917
|
+
var children = _ref2.children,
|
|
918
|
+
_ref2$options = _ref2.options,
|
|
919
|
+
options = _ref2$options === void 0 ? defaultFormOptions : _ref2$options;
|
|
920
|
+
return jsx(LocalizationProvider, {
|
|
921
|
+
dateAdapter: AdapterDateFns,
|
|
922
|
+
children: jsx(ReactHookFormProvider, {
|
|
923
|
+
options: options,
|
|
924
|
+
children: children
|
|
925
|
+
})
|
|
926
|
+
});
|
|
927
|
+
};
|
|
3342
928
|
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
} = _ref,
|
|
929
|
+
var _excluded = ["name", "defaultValue", "rules"];
|
|
930
|
+
var ReactHookFormHiddenInput = function ReactHookFormHiddenInput(_ref) {
|
|
931
|
+
var name = _ref.name,
|
|
932
|
+
_ref$defaultValue = _ref.defaultValue,
|
|
933
|
+
defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue,
|
|
934
|
+
rules = _ref.rules,
|
|
3350
935
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
3351
|
-
|
|
3352
|
-
control
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
defaultValue
|
|
3361
|
-
}, defaultProps));
|
|
936
|
+
var _useFormContext = useFormContext(),
|
|
937
|
+
control = _useFormContext.control;
|
|
938
|
+
var _useController = useController(Object.assign({
|
|
939
|
+
name: name,
|
|
940
|
+
control: control,
|
|
941
|
+
rules: rules,
|
|
942
|
+
defaultValue: defaultValue
|
|
943
|
+
}, defaultProps)),
|
|
944
|
+
field = _useController.field;
|
|
3362
945
|
return field.value !== null ? jsx("input", Object.assign({}, field, {
|
|
3363
946
|
type: "hidden"
|
|
3364
947
|
}, props)) : null;
|
|
3365
948
|
};
|
|
3366
949
|
|
|
3367
950
|
// hidden input helpers, should not be part of send formdata
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
951
|
+
var HIDDEN_INPUT_HELPER_IS_DRAFT = 'IS_DRAFT';
|
|
952
|
+
var useDraftFormHelpers = function useDraftFormHelpers(isDefaultDraft) {
|
|
953
|
+
if (isDefaultDraft === void 0) {
|
|
954
|
+
isDefaultDraft = false;
|
|
955
|
+
}
|
|
956
|
+
var _useFormContext = useFormContext(),
|
|
957
|
+
getValues = _useFormContext.getValues,
|
|
958
|
+
setValue = _useFormContext.setValue,
|
|
959
|
+
register = _useFormContext.register;
|
|
960
|
+
React.useEffect(function () {
|
|
3376
961
|
setValue(HIDDEN_INPUT_HELPER_IS_DRAFT, isDefaultDraft, {
|
|
3377
962
|
shouldDirty: false
|
|
3378
963
|
});
|
|
3379
964
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3380
965
|
}, []);
|
|
3381
|
-
|
|
3382
|
-
|
|
966
|
+
var isDraft = function isDraft() {
|
|
967
|
+
return getValues(HIDDEN_INPUT_HELPER_IS_DRAFT) === true;
|
|
968
|
+
};
|
|
969
|
+
var isRequired = function isRequired(value) {
|
|
3383
970
|
if (!isDraft() && isEmpty(value)) {
|
|
3384
971
|
return errorMessages.required;
|
|
3385
972
|
}
|
|
3386
973
|
return true;
|
|
3387
974
|
};
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
975
|
+
var toggleIsDraft = function toggleIsDraft(isDraft) {
|
|
976
|
+
return setValue(HIDDEN_INPUT_HELPER_IS_DRAFT, isDraft, {
|
|
977
|
+
shouldDirty: false
|
|
978
|
+
});
|
|
979
|
+
};
|
|
980
|
+
var DraftFieldHelper = function DraftFieldHelper() {
|
|
981
|
+
return jsx("input", Object.assign({}, register(HIDDEN_INPUT_HELPER_IS_DRAFT), {
|
|
982
|
+
type: "hidden"
|
|
983
|
+
}));
|
|
984
|
+
};
|
|
3394
985
|
return {
|
|
3395
|
-
isRequired,
|
|
3396
|
-
toggleIsDraft,
|
|
3397
|
-
isDraft,
|
|
3398
|
-
DraftFieldHelper
|
|
986
|
+
isRequired: isRequired,
|
|
987
|
+
toggleIsDraft: toggleIsDraft,
|
|
988
|
+
isDraft: isDraft,
|
|
989
|
+
DraftFieldHelper: DraftFieldHelper
|
|
3399
990
|
};
|
|
3400
991
|
};
|
|
3401
992
|
|