@bolttech/form-engine 0.14.3 → 3.0.0-beta.10

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.
Files changed (79) hide show
  1. package/README.md +2 -1628
  2. package/index.esm.d.ts +1 -0
  3. package/index.esm.js +1942 -0
  4. package/package.json +8 -33
  5. package/src/components/AsFormField/AsFormField.d.ts +4 -0
  6. package/src/components/FieldWrapper/FieldWrapper.d.ts +4 -0
  7. package/src/components/Form/Form.d.ts +4 -0
  8. package/src/components/index.d.ts +2 -0
  9. package/src/context/FormGroupContext.d.ts +27 -0
  10. package/src/generators/formBuilder.d.ts +11 -0
  11. package/src/index.d.ts +3 -3
  12. package/src/types/index.d.ts +47 -0
  13. package/CHANGELOG.md +0 -529
  14. package/asFormField-3108e669.js +0 -2
  15. package/asFormField-3108e669.js.map +0 -1
  16. package/index.js +0 -2
  17. package/index.js.map +0 -1
  18. package/react.js +0 -2
  19. package/react.js.map +0 -1
  20. package/src/adapters/react/Field.d.ts +0 -4
  21. package/src/adapters/react/Form.d.ts +0 -5
  22. package/src/adapters/react/Submit.d.ts +0 -3
  23. package/src/adapters/react/asFormField.d.ts +0 -4
  24. package/src/adapters/react/context.d.ts +0 -5
  25. package/src/adapters/react/index.d.ts +0 -7
  26. package/src/adapters/react/types.d.ts +0 -326
  27. package/src/adapters/react/useForceUpdate.d.ts +0 -3
  28. package/src/adapters/react/useForm.d.ts +0 -12
  29. package/src/adapters/react/useFormGroup.d.ts +0 -3
  30. package/src/core/apis/formatters.d.ts +0 -16
  31. package/src/core/apis/index.d.ts +0 -4
  32. package/src/core/apis/masks.d.ts +0 -3
  33. package/src/core/apis/validations.d.ts +0 -11
  34. package/src/core/apis/varOps.d.ts +0 -4
  35. package/src/core/constants/events.d.ts +0 -32
  36. package/src/core/constants/index.d.ts +0 -5
  37. package/src/core/constants/observer.d.ts +0 -7
  38. package/src/core/events/ObserverError.d.ts +0 -7
  39. package/src/core/events/events.types.d.ts +0 -27
  40. package/src/core/events/index.d.ts +0 -2
  41. package/src/core/handlers/common/templating.d.ts +0 -2
  42. package/src/core/handlers/field/api.d.ts +0 -4
  43. package/src/core/handlers/field/blur.d.ts +0 -2
  44. package/src/core/handlers/field/change.d.ts +0 -2
  45. package/src/core/handlers/field/clearFields.d.ts +0 -4
  46. package/src/core/handlers/field/data.d.ts +0 -3
  47. package/src/core/handlers/field/filter.d.ts +0 -2
  48. package/src/core/handlers/field/focus.d.ts +0 -2
  49. package/src/core/handlers/field/formatters.d.ts +0 -4
  50. package/src/core/handlers/field/htmlEventParser.d.ts +0 -6
  51. package/src/core/handlers/field/keydown.d.ts +0 -2
  52. package/src/core/handlers/field/keyup.d.ts +0 -2
  53. package/src/core/handlers/field/masks.d.ts +0 -4
  54. package/src/core/handlers/field/mount.d.ts +0 -2
  55. package/src/core/handlers/field/validations.d.ts +0 -4
  56. package/src/core/handlers/field/visibilityConditions.d.ts +0 -4
  57. package/src/core/handlers/flows.d.ts +0 -47
  58. package/src/core/handlers/form/bindFields.d.ts +0 -3
  59. package/src/core/handlers/form/hooks.d.ts +0 -3
  60. package/src/core/handlers/form/steps.d.ts +0 -2
  61. package/src/core/handlers/form/templating.d.ts +0 -2
  62. package/src/core/handlers/form/validate.d.ts +0 -2
  63. package/src/core/handlers/form/visibilityConditions.d.ts +0 -4
  64. package/src/core/index.d.ts +0 -3
  65. package/src/core/managers/Base.d.ts +0 -19
  66. package/src/core/managers/Factory.d.ts +0 -52
  67. package/src/core/managers/Field.d.ts +0 -33
  68. package/src/core/managers/Form.d.ts +0 -28
  69. package/src/core/managers/Scope.d.ts +0 -12
  70. package/src/core/managers/index.d.ts +0 -1
  71. package/src/core/types/index.d.ts +0 -937
  72. package/src/core/utils/common.d.ts +0 -9
  73. package/src/core/utils/credit-card.d.ts +0 -16
  74. package/src/core/utils/index.d.ts +0 -6
  75. package/src/core/utils/object.d.ts +0 -27
  76. package/src/core/utils/string.d.ts +0 -3
  77. package/src/core/utils/value.d.ts +0 -2
  78. package/types.js +0 -2
  79. package/types.js.map +0 -1
package/index.esm.js ADDED
@@ -0,0 +1,1942 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import { FormGroup, FormCore } from '@bolttech/form-engine-core';
3
+ import { createContext, useRef, useContext, useState, useEffect, useCallback, useMemo, Children, Suspense } from 'react';
4
+
5
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
+
7
+ var fails$b = function (exec) {
8
+ try {
9
+ return !!exec();
10
+ } catch (error) {
11
+ return true;
12
+ }
13
+ };
14
+
15
+ var fails$a = fails$b;
16
+
17
+ var functionBindNative = !fails$a(function () {
18
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
19
+ var test = (function () { /* empty */ }).bind();
20
+ // eslint-disable-next-line no-prototype-builtins -- safe
21
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
22
+ });
23
+
24
+ var NATIVE_BIND$1 = functionBindNative;
25
+
26
+ var FunctionPrototype$1 = Function.prototype;
27
+ var call$6 = FunctionPrototype$1.call;
28
+ var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$6, call$6);
29
+
30
+ var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
31
+ return function () {
32
+ return call$6.apply(fn, arguments);
33
+ };
34
+ };
35
+
36
+ var uncurryThis$a = functionUncurryThis;
37
+
38
+ var toString$1 = uncurryThis$a({}.toString);
39
+ var stringSlice$1 = uncurryThis$a(''.slice);
40
+
41
+ var classofRaw = function (it) {
42
+ return stringSlice$1(toString$1(it), 8, -1);
43
+ };
44
+
45
+ var uncurryThis$9 = functionUncurryThis;
46
+ var fails$9 = fails$b;
47
+ var classof = classofRaw;
48
+
49
+ var $Object$3 = Object;
50
+ var split = uncurryThis$9(''.split);
51
+
52
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
53
+ var indexedObject = fails$9(function () {
54
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
55
+ // eslint-disable-next-line no-prototype-builtins -- safe
56
+ return !$Object$3('z').propertyIsEnumerable(0);
57
+ }) ? function (it) {
58
+ return classof(it) === 'String' ? split(it, '') : $Object$3(it);
59
+ } : $Object$3;
60
+
61
+ // we can't use just `it == null` since of `document.all` special case
62
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
63
+ var isNullOrUndefined$2 = function (it) {
64
+ return it === null || it === undefined;
65
+ };
66
+
67
+ var isNullOrUndefined$1 = isNullOrUndefined$2;
68
+
69
+ var $TypeError$6 = TypeError;
70
+
71
+ // `RequireObjectCoercible` abstract operation
72
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
73
+ var requireObjectCoercible$3 = function (it) {
74
+ if (isNullOrUndefined$1(it)) throw new $TypeError$6("Can't call method on " + it);
75
+ return it;
76
+ };
77
+
78
+ // toObject with fallback for non-array-like ES3 strings
79
+ var IndexedObject$1 = indexedObject;
80
+ var requireObjectCoercible$2 = requireObjectCoercible$3;
81
+
82
+ var toIndexedObject$5 = function (it) {
83
+ return IndexedObject$1(requireObjectCoercible$2(it));
84
+ };
85
+
86
+ var check = function (it) {
87
+ return it && it.Math === Math && it;
88
+ };
89
+
90
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
91
+ var global$b =
92
+ // eslint-disable-next-line es/no-global-this -- safe
93
+ check(typeof globalThis == 'object' && globalThis) ||
94
+ check(typeof window == 'object' && window) ||
95
+ // eslint-disable-next-line no-restricted-globals -- safe
96
+ check(typeof self == 'object' && self) ||
97
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
98
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
99
+ // eslint-disable-next-line no-new-func -- fallback
100
+ (function () { return this; })() || Function('return this')();
101
+
102
+ var sharedStore = {exports: {}};
103
+
104
+ var global$a = global$b;
105
+
106
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
107
+ var defineProperty$5 = Object.defineProperty;
108
+
109
+ var defineGlobalProperty$3 = function (key, value) {
110
+ try {
111
+ defineProperty$5(global$a, key, { value: value, configurable: true, writable: true });
112
+ } catch (error) {
113
+ global$a[key] = value;
114
+ } return value;
115
+ };
116
+
117
+ var globalThis$1 = global$b;
118
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
119
+
120
+ var SHARED = '__core-js_shared__';
121
+ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
122
+
123
+ (store$3.versions || (store$3.versions = [])).push({
124
+ version: '3.37.1',
125
+ mode: 'global',
126
+ copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
127
+ license: 'https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE',
128
+ source: 'https://github.com/zloirock/core-js'
129
+ });
130
+
131
+ var store$2 = sharedStore.exports;
132
+
133
+ var shared$3 = function (key, value) {
134
+ return store$2[key] || (store$2[key] = value || {});
135
+ };
136
+
137
+ var requireObjectCoercible$1 = requireObjectCoercible$3;
138
+
139
+ var $Object$2 = Object;
140
+
141
+ // `ToObject` abstract operation
142
+ // https://tc39.es/ecma262/#sec-toobject
143
+ var toObject$3 = function (argument) {
144
+ return $Object$2(requireObjectCoercible$1(argument));
145
+ };
146
+
147
+ var uncurryThis$8 = functionUncurryThis;
148
+ var toObject$2 = toObject$3;
149
+
150
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
151
+
152
+ // `HasOwnProperty` abstract operation
153
+ // https://tc39.es/ecma262/#sec-hasownproperty
154
+ // eslint-disable-next-line es/no-object-hasown -- safe
155
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
156
+ return hasOwnProperty(toObject$2(it), key);
157
+ };
158
+
159
+ var uncurryThis$7 = functionUncurryThis;
160
+
161
+ var id = 0;
162
+ var postfix = Math.random();
163
+ var toString = uncurryThis$7(1.0.toString);
164
+
165
+ var uid$2 = function (key) {
166
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
167
+ };
168
+
169
+ var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
170
+
171
+ var global$9 = global$b;
172
+ var userAgent = engineUserAgent;
173
+
174
+ var process = global$9.process;
175
+ var Deno = global$9.Deno;
176
+ var versions = process && process.versions || Deno && Deno.version;
177
+ var v8 = versions && versions.v8;
178
+ var match, version;
179
+
180
+ if (v8) {
181
+ match = v8.split('.');
182
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
183
+ // but their correct versions are not interesting for us
184
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
185
+ }
186
+
187
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
188
+ // so check `userAgent` even if `.v8` exists, but 0
189
+ if (!version && userAgent) {
190
+ match = userAgent.match(/Edge\/(\d+)/);
191
+ if (!match || match[1] >= 74) {
192
+ match = userAgent.match(/Chrome\/(\d+)/);
193
+ if (match) version = +match[1];
194
+ }
195
+ }
196
+
197
+ var engineV8Version = version;
198
+
199
+ /* eslint-disable es/no-symbol -- required for testing */
200
+ var V8_VERSION = engineV8Version;
201
+ var fails$8 = fails$b;
202
+ var global$8 = global$b;
203
+
204
+ var $String$4 = global$8.String;
205
+
206
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
207
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$8(function () {
208
+ var symbol = Symbol('symbol detection');
209
+ // Chrome 38 Symbol has incorrect toString conversion
210
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
211
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
212
+ // of course, fail.
213
+ return !$String$4(symbol) || !(Object(symbol) instanceof Symbol) ||
214
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
215
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
216
+ });
217
+
218
+ /* eslint-disable es/no-symbol -- required for testing */
219
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
220
+
221
+ var useSymbolAsUid = NATIVE_SYMBOL$1
222
+ && !Symbol.sham
223
+ && typeof Symbol.iterator == 'symbol';
224
+
225
+ var global$7 = global$b;
226
+ var shared$2 = shared$3;
227
+ var hasOwn$8 = hasOwnProperty_1;
228
+ var uid$1 = uid$2;
229
+ var NATIVE_SYMBOL = symbolConstructorDetection;
230
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
231
+
232
+ var Symbol$1 = global$7.Symbol;
233
+ var WellKnownSymbolsStore = shared$2('wks');
234
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID$1 ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
235
+
236
+ var wellKnownSymbol$6 = function (name) {
237
+ if (!hasOwn$8(WellKnownSymbolsStore, name)) {
238
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)
239
+ ? Symbol$1[name]
240
+ : createWellKnownSymbol('Symbol.' + name);
241
+ } return WellKnownSymbolsStore[name];
242
+ };
243
+
244
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
245
+ var documentAll = typeof document == 'object' && document.all;
246
+
247
+ // `IsCallable` abstract operation
248
+ // https://tc39.es/ecma262/#sec-iscallable
249
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
250
+ var isCallable$d = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
251
+ return typeof argument == 'function' || argument === documentAll;
252
+ } : function (argument) {
253
+ return typeof argument == 'function';
254
+ };
255
+
256
+ var isCallable$c = isCallable$d;
257
+
258
+ var isObject$8 = function (it) {
259
+ return typeof it == 'object' ? it !== null : isCallable$c(it);
260
+ };
261
+
262
+ var isObject$7 = isObject$8;
263
+
264
+ var $String$3 = String;
265
+ var $TypeError$5 = TypeError;
266
+
267
+ // `Assert: Type(argument) is Object`
268
+ var anObject$4 = function (argument) {
269
+ if (isObject$7(argument)) return argument;
270
+ throw new $TypeError$5($String$3(argument) + ' is not an object');
271
+ };
272
+
273
+ var objectDefineProperties = {};
274
+
275
+ var fails$7 = fails$b;
276
+
277
+ // Detect IE8's incomplete defineProperty implementation
278
+ var descriptors = !fails$7(function () {
279
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
280
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
281
+ });
282
+
283
+ var DESCRIPTORS$9 = descriptors;
284
+ var fails$6 = fails$b;
285
+
286
+ // V8 ~ Chrome 36-
287
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
288
+ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$6(function () {
289
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
290
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
291
+ value: 42,
292
+ writable: false
293
+ }).prototype !== 42;
294
+ });
295
+
296
+ var objectDefineProperty = {};
297
+
298
+ var global$6 = global$b;
299
+ var isObject$6 = isObject$8;
300
+
301
+ var document$1 = global$6.document;
302
+ // typeof document.createElement is 'object' in old IE
303
+ var EXISTS$1 = isObject$6(document$1) && isObject$6(document$1.createElement);
304
+
305
+ var documentCreateElement$2 = function (it) {
306
+ return EXISTS$1 ? document$1.createElement(it) : {};
307
+ };
308
+
309
+ var DESCRIPTORS$8 = descriptors;
310
+ var fails$5 = fails$b;
311
+ var createElement = documentCreateElement$2;
312
+
313
+ // Thanks to IE8 for its funny defineProperty
314
+ var ie8DomDefine = !DESCRIPTORS$8 && !fails$5(function () {
315
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
316
+ return Object.defineProperty(createElement('div'), 'a', {
317
+ get: function () { return 7; }
318
+ }).a !== 7;
319
+ });
320
+
321
+ var NATIVE_BIND = functionBindNative;
322
+
323
+ var call$5 = Function.prototype.call;
324
+
325
+ var functionCall = NATIVE_BIND ? call$5.bind(call$5) : function () {
326
+ return call$5.apply(call$5, arguments);
327
+ };
328
+
329
+ var global$5 = global$b;
330
+ var isCallable$b = isCallable$d;
331
+
332
+ var aFunction = function (argument) {
333
+ return isCallable$b(argument) ? argument : undefined;
334
+ };
335
+
336
+ var getBuiltIn$3 = function (namespace, method) {
337
+ return arguments.length < 2 ? aFunction(global$5[namespace]) : global$5[namespace] && global$5[namespace][method];
338
+ };
339
+
340
+ var uncurryThis$6 = functionUncurryThis;
341
+
342
+ var objectIsPrototypeOf = uncurryThis$6({}.isPrototypeOf);
343
+
344
+ var getBuiltIn$2 = getBuiltIn$3;
345
+ var isCallable$a = isCallable$d;
346
+ var isPrototypeOf = objectIsPrototypeOf;
347
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
348
+
349
+ var $Object$1 = Object;
350
+
351
+ var isSymbol$2 = USE_SYMBOL_AS_UID ? function (it) {
352
+ return typeof it == 'symbol';
353
+ } : function (it) {
354
+ var $Symbol = getBuiltIn$2('Symbol');
355
+ return isCallable$a($Symbol) && isPrototypeOf($Symbol.prototype, $Object$1(it));
356
+ };
357
+
358
+ var $String$2 = String;
359
+
360
+ var tryToString$1 = function (argument) {
361
+ try {
362
+ return $String$2(argument);
363
+ } catch (error) {
364
+ return 'Object';
365
+ }
366
+ };
367
+
368
+ var isCallable$9 = isCallable$d;
369
+ var tryToString = tryToString$1;
370
+
371
+ var $TypeError$4 = TypeError;
372
+
373
+ // `Assert: IsCallable(argument) is true`
374
+ var aCallable$2 = function (argument) {
375
+ if (isCallable$9(argument)) return argument;
376
+ throw new $TypeError$4(tryToString(argument) + ' is not a function');
377
+ };
378
+
379
+ var aCallable$1 = aCallable$2;
380
+ var isNullOrUndefined = isNullOrUndefined$2;
381
+
382
+ // `GetMethod` abstract operation
383
+ // https://tc39.es/ecma262/#sec-getmethod
384
+ var getMethod$1 = function (V, P) {
385
+ var func = V[P];
386
+ return isNullOrUndefined(func) ? undefined : aCallable$1(func);
387
+ };
388
+
389
+ var call$4 = functionCall;
390
+ var isCallable$8 = isCallable$d;
391
+ var isObject$5 = isObject$8;
392
+
393
+ var $TypeError$3 = TypeError;
394
+
395
+ // `OrdinaryToPrimitive` abstract operation
396
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
397
+ var ordinaryToPrimitive$1 = function (input, pref) {
398
+ var fn, val;
399
+ if (pref === 'string' && isCallable$8(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
400
+ if (isCallable$8(fn = input.valueOf) && !isObject$5(val = call$4(fn, input))) return val;
401
+ if (pref !== 'string' && isCallable$8(fn = input.toString) && !isObject$5(val = call$4(fn, input))) return val;
402
+ throw new $TypeError$3("Can't convert object to primitive value");
403
+ };
404
+
405
+ var call$3 = functionCall;
406
+ var isObject$4 = isObject$8;
407
+ var isSymbol$1 = isSymbol$2;
408
+ var getMethod = getMethod$1;
409
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
410
+ var wellKnownSymbol$5 = wellKnownSymbol$6;
411
+
412
+ var $TypeError$2 = TypeError;
413
+ var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
414
+
415
+ // `ToPrimitive` abstract operation
416
+ // https://tc39.es/ecma262/#sec-toprimitive
417
+ var toPrimitive$1 = function (input, pref) {
418
+ if (!isObject$4(input) || isSymbol$1(input)) return input;
419
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
420
+ var result;
421
+ if (exoticToPrim) {
422
+ if (pref === undefined) pref = 'default';
423
+ result = call$3(exoticToPrim, input, pref);
424
+ if (!isObject$4(result) || isSymbol$1(result)) return result;
425
+ throw new $TypeError$2("Can't convert object to primitive value");
426
+ }
427
+ if (pref === undefined) pref = 'number';
428
+ return ordinaryToPrimitive(input, pref);
429
+ };
430
+
431
+ var toPrimitive = toPrimitive$1;
432
+ var isSymbol = isSymbol$2;
433
+
434
+ // `ToPropertyKey` abstract operation
435
+ // https://tc39.es/ecma262/#sec-topropertykey
436
+ var toPropertyKey$2 = function (argument) {
437
+ var key = toPrimitive(argument, 'string');
438
+ return isSymbol(key) ? key : key + '';
439
+ };
440
+
441
+ var DESCRIPTORS$7 = descriptors;
442
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
443
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
444
+ var anObject$3 = anObject$4;
445
+ var toPropertyKey$1 = toPropertyKey$2;
446
+
447
+ var $TypeError$1 = TypeError;
448
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
449
+ var $defineProperty = Object.defineProperty;
450
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
451
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
452
+ var ENUMERABLE = 'enumerable';
453
+ var CONFIGURABLE$1 = 'configurable';
454
+ var WRITABLE = 'writable';
455
+
456
+ // `Object.defineProperty` method
457
+ // https://tc39.es/ecma262/#sec-object.defineproperty
458
+ objectDefineProperty.f = DESCRIPTORS$7 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
459
+ anObject$3(O);
460
+ P = toPropertyKey$1(P);
461
+ anObject$3(Attributes);
462
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
463
+ var current = $getOwnPropertyDescriptor$1(O, P);
464
+ if (current && current[WRITABLE]) {
465
+ O[P] = Attributes.value;
466
+ Attributes = {
467
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
468
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
469
+ writable: false
470
+ };
471
+ }
472
+ } return $defineProperty(O, P, Attributes);
473
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
474
+ anObject$3(O);
475
+ P = toPropertyKey$1(P);
476
+ anObject$3(Attributes);
477
+ if (IE8_DOM_DEFINE$1) try {
478
+ return $defineProperty(O, P, Attributes);
479
+ } catch (error) { /* empty */ }
480
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$1('Accessors not supported');
481
+ if ('value' in Attributes) O[P] = Attributes.value;
482
+ return O;
483
+ };
484
+
485
+ var ceil = Math.ceil;
486
+ var floor = Math.floor;
487
+
488
+ // `Math.trunc` method
489
+ // https://tc39.es/ecma262/#sec-math.trunc
490
+ // eslint-disable-next-line es/no-math-trunc -- safe
491
+ var mathTrunc = Math.trunc || function trunc(x) {
492
+ var n = +x;
493
+ return (n > 0 ? floor : ceil)(n);
494
+ };
495
+
496
+ var trunc = mathTrunc;
497
+
498
+ // `ToIntegerOrInfinity` abstract operation
499
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
500
+ var toIntegerOrInfinity$2 = function (argument) {
501
+ var number = +argument;
502
+ // eslint-disable-next-line no-self-compare -- NaN check
503
+ return number !== number || number === 0 ? 0 : trunc(number);
504
+ };
505
+
506
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
507
+
508
+ var max = Math.max;
509
+ var min$1 = Math.min;
510
+
511
+ // Helper for a popular repeating case of the spec:
512
+ // Let integer be ? ToInteger(index).
513
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
514
+ var toAbsoluteIndex$1 = function (index, length) {
515
+ var integer = toIntegerOrInfinity$1(index);
516
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
517
+ };
518
+
519
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
520
+
521
+ var min = Math.min;
522
+
523
+ // `ToLength` abstract operation
524
+ // https://tc39.es/ecma262/#sec-tolength
525
+ var toLength$1 = function (argument) {
526
+ var len = toIntegerOrInfinity(argument);
527
+ return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
528
+ };
529
+
530
+ var toLength = toLength$1;
531
+
532
+ // `LengthOfArrayLike` abstract operation
533
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
534
+ var lengthOfArrayLike$1 = function (obj) {
535
+ return toLength(obj.length);
536
+ };
537
+
538
+ var toIndexedObject$4 = toIndexedObject$5;
539
+ var toAbsoluteIndex = toAbsoluteIndex$1;
540
+ var lengthOfArrayLike = lengthOfArrayLike$1;
541
+
542
+ // `Array.prototype.{ indexOf, includes }` methods implementation
543
+ var createMethod = function (IS_INCLUDES) {
544
+ return function ($this, el, fromIndex) {
545
+ var O = toIndexedObject$4($this);
546
+ var length = lengthOfArrayLike(O);
547
+ if (length === 0) return !IS_INCLUDES && -1;
548
+ var index = toAbsoluteIndex(fromIndex, length);
549
+ var value;
550
+ // Array#includes uses SameValueZero equality algorithm
551
+ // eslint-disable-next-line no-self-compare -- NaN check
552
+ if (IS_INCLUDES && el !== el) while (length > index) {
553
+ value = O[index++];
554
+ // eslint-disable-next-line no-self-compare -- NaN check
555
+ if (value !== value) return true;
556
+ // Array#indexOf ignores holes, Array#includes - not
557
+ } else for (;length > index; index++) {
558
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
559
+ } return !IS_INCLUDES && -1;
560
+ };
561
+ };
562
+
563
+ var arrayIncludes = {
564
+ // `Array.prototype.includes` method
565
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
566
+ includes: createMethod(true),
567
+ // `Array.prototype.indexOf` method
568
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
569
+ indexOf: createMethod(false)
570
+ };
571
+
572
+ var hiddenKeys$4 = {};
573
+
574
+ var uncurryThis$5 = functionUncurryThis;
575
+ var hasOwn$7 = hasOwnProperty_1;
576
+ var toIndexedObject$3 = toIndexedObject$5;
577
+ var indexOf = arrayIncludes.indexOf;
578
+ var hiddenKeys$3 = hiddenKeys$4;
579
+
580
+ var push = uncurryThis$5([].push);
581
+
582
+ var objectKeysInternal = function (object, names) {
583
+ var O = toIndexedObject$3(object);
584
+ var i = 0;
585
+ var result = [];
586
+ var key;
587
+ for (key in O) !hasOwn$7(hiddenKeys$3, key) && hasOwn$7(O, key) && push(result, key);
588
+ // Don't enum bug & hidden keys
589
+ while (names.length > i) if (hasOwn$7(O, key = names[i++])) {
590
+ ~indexOf(result, key) || push(result, key);
591
+ }
592
+ return result;
593
+ };
594
+
595
+ // IE8- don't enum bug keys
596
+ var enumBugKeys$3 = [
597
+ 'constructor',
598
+ 'hasOwnProperty',
599
+ 'isPrototypeOf',
600
+ 'propertyIsEnumerable',
601
+ 'toLocaleString',
602
+ 'toString',
603
+ 'valueOf'
604
+ ];
605
+
606
+ var internalObjectKeys$1 = objectKeysInternal;
607
+ var enumBugKeys$2 = enumBugKeys$3;
608
+
609
+ // `Object.keys` method
610
+ // https://tc39.es/ecma262/#sec-object.keys
611
+ // eslint-disable-next-line es/no-object-keys -- safe
612
+ var objectKeys$2 = Object.keys || function keys(O) {
613
+ return internalObjectKeys$1(O, enumBugKeys$2);
614
+ };
615
+
616
+ var DESCRIPTORS$6 = descriptors;
617
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
618
+ var definePropertyModule$3 = objectDefineProperty;
619
+ var anObject$2 = anObject$4;
620
+ var toIndexedObject$2 = toIndexedObject$5;
621
+ var objectKeys$1 = objectKeys$2;
622
+
623
+ // `Object.defineProperties` method
624
+ // https://tc39.es/ecma262/#sec-object.defineproperties
625
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
626
+ objectDefineProperties.f = DESCRIPTORS$6 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
627
+ anObject$2(O);
628
+ var props = toIndexedObject$2(Properties);
629
+ var keys = objectKeys$1(Properties);
630
+ var length = keys.length;
631
+ var index = 0;
632
+ var key;
633
+ while (length > index) definePropertyModule$3.f(O, key = keys[index++], props[key]);
634
+ return O;
635
+ };
636
+
637
+ var getBuiltIn$1 = getBuiltIn$3;
638
+
639
+ var html$1 = getBuiltIn$1('document', 'documentElement');
640
+
641
+ var shared$1 = shared$3;
642
+ var uid = uid$2;
643
+
644
+ var keys = shared$1('keys');
645
+
646
+ var sharedKey$3 = function (key) {
647
+ return keys[key] || (keys[key] = uid(key));
648
+ };
649
+
650
+ /* global ActiveXObject -- old IE, WSH */
651
+ var anObject$1 = anObject$4;
652
+ var definePropertiesModule = objectDefineProperties;
653
+ var enumBugKeys$1 = enumBugKeys$3;
654
+ var hiddenKeys$2 = hiddenKeys$4;
655
+ var html = html$1;
656
+ var documentCreateElement$1 = documentCreateElement$2;
657
+ var sharedKey$2 = sharedKey$3;
658
+
659
+ var GT = '>';
660
+ var LT = '<';
661
+ var PROTOTYPE = 'prototype';
662
+ var SCRIPT = 'script';
663
+ var IE_PROTO$1 = sharedKey$2('IE_PROTO');
664
+
665
+ var EmptyConstructor = function () { /* empty */ };
666
+
667
+ var scriptTag = function (content) {
668
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
669
+ };
670
+
671
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
672
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
673
+ activeXDocument.write(scriptTag(''));
674
+ activeXDocument.close();
675
+ var temp = activeXDocument.parentWindow.Object;
676
+ activeXDocument = null; // avoid memory leak
677
+ return temp;
678
+ };
679
+
680
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
681
+ var NullProtoObjectViaIFrame = function () {
682
+ // Thrash, waste and sodomy: IE GC bug
683
+ var iframe = documentCreateElement$1('iframe');
684
+ var JS = 'java' + SCRIPT + ':';
685
+ var iframeDocument;
686
+ iframe.style.display = 'none';
687
+ html.appendChild(iframe);
688
+ // https://github.com/zloirock/core-js/issues/475
689
+ iframe.src = String(JS);
690
+ iframeDocument = iframe.contentWindow.document;
691
+ iframeDocument.open();
692
+ iframeDocument.write(scriptTag('document.F=Object'));
693
+ iframeDocument.close();
694
+ return iframeDocument.F;
695
+ };
696
+
697
+ // Check for document.domain and active x support
698
+ // No need to use active x approach when document.domain is not set
699
+ // see https://github.com/es-shims/es5-shim/issues/150
700
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
701
+ // avoid IE GC bug
702
+ var activeXDocument;
703
+ var NullProtoObject = function () {
704
+ try {
705
+ activeXDocument = new ActiveXObject('htmlfile');
706
+ } catch (error) { /* ignore */ }
707
+ NullProtoObject = typeof document != 'undefined'
708
+ ? document.domain && activeXDocument
709
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
710
+ : NullProtoObjectViaIFrame()
711
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
712
+ var length = enumBugKeys$1.length;
713
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys$1[length]];
714
+ return NullProtoObject();
715
+ };
716
+
717
+ hiddenKeys$2[IE_PROTO$1] = true;
718
+
719
+ // `Object.create` method
720
+ // https://tc39.es/ecma262/#sec-object.create
721
+ // eslint-disable-next-line es/no-object-create -- safe
722
+ var objectCreate = Object.create || function create(O, Properties) {
723
+ var result;
724
+ if (O !== null) {
725
+ EmptyConstructor[PROTOTYPE] = anObject$1(O);
726
+ result = new EmptyConstructor();
727
+ EmptyConstructor[PROTOTYPE] = null;
728
+ // add "__proto__" for Object.getPrototypeOf polyfill
729
+ result[IE_PROTO$1] = O;
730
+ } else result = NullProtoObject();
731
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
732
+ };
733
+
734
+ var wellKnownSymbol$4 = wellKnownSymbol$6;
735
+ var create$1 = objectCreate;
736
+ var defineProperty$4 = objectDefineProperty.f;
737
+
738
+ var UNSCOPABLES = wellKnownSymbol$4('unscopables');
739
+ var ArrayPrototype = Array.prototype;
740
+
741
+ // Array.prototype[@@unscopables]
742
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
743
+ if (ArrayPrototype[UNSCOPABLES] === undefined) {
744
+ defineProperty$4(ArrayPrototype, UNSCOPABLES, {
745
+ configurable: true,
746
+ value: create$1(null)
747
+ });
748
+ }
749
+
750
+ // add a key to Array.prototype[@@unscopables]
751
+ var addToUnscopables$1 = function (key) {
752
+ ArrayPrototype[UNSCOPABLES][key] = true;
753
+ };
754
+
755
+ var iterators = {};
756
+
757
+ var global$4 = global$b;
758
+ var isCallable$7 = isCallable$d;
759
+
760
+ var WeakMap$1 = global$4.WeakMap;
761
+
762
+ var weakMapBasicDetection = isCallable$7(WeakMap$1) && /native code/.test(String(WeakMap$1));
763
+
764
+ var createPropertyDescriptor$3 = function (bitmap, value) {
765
+ return {
766
+ enumerable: !(bitmap & 1),
767
+ configurable: !(bitmap & 2),
768
+ writable: !(bitmap & 4),
769
+ value: value
770
+ };
771
+ };
772
+
773
+ var DESCRIPTORS$5 = descriptors;
774
+ var definePropertyModule$2 = objectDefineProperty;
775
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
776
+
777
+ var createNonEnumerableProperty$4 = DESCRIPTORS$5 ? function (object, key, value) {
778
+ return definePropertyModule$2.f(object, key, createPropertyDescriptor$2(1, value));
779
+ } : function (object, key, value) {
780
+ object[key] = value;
781
+ return object;
782
+ };
783
+
784
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
785
+ var global$3 = global$b;
786
+ var isObject$3 = isObject$8;
787
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
788
+ var hasOwn$6 = hasOwnProperty_1;
789
+ var shared = sharedStore.exports;
790
+ var sharedKey$1 = sharedKey$3;
791
+ var hiddenKeys$1 = hiddenKeys$4;
792
+
793
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
794
+ var TypeError$1 = global$3.TypeError;
795
+ var WeakMap = global$3.WeakMap;
796
+ var set, get, has;
797
+
798
+ var enforce = function (it) {
799
+ return has(it) ? get(it) : set(it, {});
800
+ };
801
+
802
+ var getterFor = function (TYPE) {
803
+ return function (it) {
804
+ var state;
805
+ if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
806
+ throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
807
+ } return state;
808
+ };
809
+ };
810
+
811
+ if (NATIVE_WEAK_MAP || shared.state) {
812
+ var store$1 = shared.state || (shared.state = new WeakMap());
813
+ /* eslint-disable no-self-assign -- prototype methods protection */
814
+ store$1.get = store$1.get;
815
+ store$1.has = store$1.has;
816
+ store$1.set = store$1.set;
817
+ /* eslint-enable no-self-assign -- prototype methods protection */
818
+ set = function (it, metadata) {
819
+ if (store$1.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
820
+ metadata.facade = it;
821
+ store$1.set(it, metadata);
822
+ return metadata;
823
+ };
824
+ get = function (it) {
825
+ return store$1.get(it) || {};
826
+ };
827
+ has = function (it) {
828
+ return store$1.has(it);
829
+ };
830
+ } else {
831
+ var STATE = sharedKey$1('state');
832
+ hiddenKeys$1[STATE] = true;
833
+ set = function (it, metadata) {
834
+ if (hasOwn$6(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
835
+ metadata.facade = it;
836
+ createNonEnumerableProperty$3(it, STATE, metadata);
837
+ return metadata;
838
+ };
839
+ get = function (it) {
840
+ return hasOwn$6(it, STATE) ? it[STATE] : {};
841
+ };
842
+ has = function (it) {
843
+ return hasOwn$6(it, STATE);
844
+ };
845
+ }
846
+
847
+ var internalState = {
848
+ set: set,
849
+ get: get,
850
+ has: has,
851
+ enforce: enforce,
852
+ getterFor: getterFor
853
+ };
854
+
855
+ var objectGetOwnPropertyDescriptor = {};
856
+
857
+ var objectPropertyIsEnumerable = {};
858
+
859
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
860
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
861
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
862
+
863
+ // Nashorn ~ JDK8 bug
864
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
865
+
866
+ // `Object.prototype.propertyIsEnumerable` method implementation
867
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
868
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
869
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
870
+ return !!descriptor && descriptor.enumerable;
871
+ } : $propertyIsEnumerable;
872
+
873
+ var DESCRIPTORS$4 = descriptors;
874
+ var call$2 = functionCall;
875
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
876
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
877
+ var toIndexedObject$1 = toIndexedObject$5;
878
+ var toPropertyKey = toPropertyKey$2;
879
+ var hasOwn$5 = hasOwnProperty_1;
880
+ var IE8_DOM_DEFINE = ie8DomDefine;
881
+
882
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
883
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
884
+
885
+ // `Object.getOwnPropertyDescriptor` method
886
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
887
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$4 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
888
+ O = toIndexedObject$1(O);
889
+ P = toPropertyKey(P);
890
+ if (IE8_DOM_DEFINE) try {
891
+ return $getOwnPropertyDescriptor(O, P);
892
+ } catch (error) { /* empty */ }
893
+ if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
894
+ };
895
+
896
+ var makeBuiltIn$2 = {exports: {}};
897
+
898
+ var DESCRIPTORS$3 = descriptors;
899
+ var hasOwn$4 = hasOwnProperty_1;
900
+
901
+ var FunctionPrototype = Function.prototype;
902
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
903
+ var getDescriptor = DESCRIPTORS$3 && Object.getOwnPropertyDescriptor;
904
+
905
+ var EXISTS = hasOwn$4(FunctionPrototype, 'name');
906
+ // additional protection from minified / mangled / dropped function names
907
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
908
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$3 || (DESCRIPTORS$3 && getDescriptor(FunctionPrototype, 'name').configurable));
909
+
910
+ var functionName = {
911
+ EXISTS: EXISTS,
912
+ PROPER: PROPER,
913
+ CONFIGURABLE: CONFIGURABLE
914
+ };
915
+
916
+ var uncurryThis$4 = functionUncurryThis;
917
+ var isCallable$6 = isCallable$d;
918
+ var store = sharedStore.exports;
919
+
920
+ var functionToString = uncurryThis$4(Function.toString);
921
+
922
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
923
+ if (!isCallable$6(store.inspectSource)) {
924
+ store.inspectSource = function (it) {
925
+ return functionToString(it);
926
+ };
927
+ }
928
+
929
+ var inspectSource$1 = store.inspectSource;
930
+
931
+ var uncurryThis$3 = functionUncurryThis;
932
+ var fails$4 = fails$b;
933
+ var isCallable$5 = isCallable$d;
934
+ var hasOwn$3 = hasOwnProperty_1;
935
+ var DESCRIPTORS$2 = descriptors;
936
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
937
+ var inspectSource = inspectSource$1;
938
+ var InternalStateModule$1 = internalState;
939
+
940
+ var enforceInternalState = InternalStateModule$1.enforce;
941
+ var getInternalState$1 = InternalStateModule$1.get;
942
+ var $String$1 = String;
943
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
944
+ var defineProperty$3 = Object.defineProperty;
945
+ var stringSlice = uncurryThis$3(''.slice);
946
+ var replace = uncurryThis$3(''.replace);
947
+ var join = uncurryThis$3([].join);
948
+
949
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$2 && !fails$4(function () {
950
+ return defineProperty$3(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
951
+ });
952
+
953
+ var TEMPLATE = String(String).split('String');
954
+
955
+ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
956
+ if (stringSlice($String$1(name), 0, 7) === 'Symbol(') {
957
+ name = '[' + replace($String$1(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
958
+ }
959
+ if (options && options.getter) name = 'get ' + name;
960
+ if (options && options.setter) name = 'set ' + name;
961
+ if (!hasOwn$3(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
962
+ if (DESCRIPTORS$2) defineProperty$3(value, 'name', { value: name, configurable: true });
963
+ else value.name = name;
964
+ }
965
+ if (CONFIGURABLE_LENGTH && options && hasOwn$3(options, 'arity') && value.length !== options.arity) {
966
+ defineProperty$3(value, 'length', { value: options.arity });
967
+ }
968
+ try {
969
+ if (options && hasOwn$3(options, 'constructor') && options.constructor) {
970
+ if (DESCRIPTORS$2) defineProperty$3(value, 'prototype', { writable: false });
971
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
972
+ } else if (value.prototype) value.prototype = undefined;
973
+ } catch (error) { /* empty */ }
974
+ var state = enforceInternalState(value);
975
+ if (!hasOwn$3(state, 'source')) {
976
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
977
+ } return value;
978
+ };
979
+
980
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
981
+ // eslint-disable-next-line no-extend-native -- required
982
+ Function.prototype.toString = makeBuiltIn$1(function toString() {
983
+ return isCallable$5(this) && getInternalState$1(this).source || inspectSource(this);
984
+ }, 'toString');
985
+
986
+ var isCallable$4 = isCallable$d;
987
+ var definePropertyModule$1 = objectDefineProperty;
988
+ var makeBuiltIn = makeBuiltIn$2.exports;
989
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
990
+
991
+ var defineBuiltIn$3 = function (O, key, value, options) {
992
+ if (!options) options = {};
993
+ var simple = options.enumerable;
994
+ var name = options.name !== undefined ? options.name : key;
995
+ if (isCallable$4(value)) makeBuiltIn(value, name, options);
996
+ if (options.global) {
997
+ if (simple) O[key] = value;
998
+ else defineGlobalProperty$1(key, value);
999
+ } else {
1000
+ try {
1001
+ if (!options.unsafe) delete O[key];
1002
+ else if (O[key]) simple = true;
1003
+ } catch (error) { /* empty */ }
1004
+ if (simple) O[key] = value;
1005
+ else definePropertyModule$1.f(O, key, {
1006
+ value: value,
1007
+ enumerable: false,
1008
+ configurable: !options.nonConfigurable,
1009
+ writable: !options.nonWritable
1010
+ });
1011
+ } return O;
1012
+ };
1013
+
1014
+ var objectGetOwnPropertyNames = {};
1015
+
1016
+ var internalObjectKeys = objectKeysInternal;
1017
+ var enumBugKeys = enumBugKeys$3;
1018
+
1019
+ var hiddenKeys = enumBugKeys.concat('length', 'prototype');
1020
+
1021
+ // `Object.getOwnPropertyNames` method
1022
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
1023
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1024
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1025
+ return internalObjectKeys(O, hiddenKeys);
1026
+ };
1027
+
1028
+ var objectGetOwnPropertySymbols = {};
1029
+
1030
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1031
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1032
+
1033
+ var getBuiltIn = getBuiltIn$3;
1034
+ var uncurryThis$2 = functionUncurryThis;
1035
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1036
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
1037
+ var anObject = anObject$4;
1038
+
1039
+ var concat$1 = uncurryThis$2([].concat);
1040
+
1041
+ // all object keys, includes non-enumerable and symbols
1042
+ var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
1043
+ var keys = getOwnPropertyNamesModule.f(anObject(it));
1044
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1045
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
1046
+ };
1047
+
1048
+ var hasOwn$2 = hasOwnProperty_1;
1049
+ var ownKeys = ownKeys$1;
1050
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1051
+ var definePropertyModule = objectDefineProperty;
1052
+
1053
+ var copyConstructorProperties$1 = function (target, source, exceptions) {
1054
+ var keys = ownKeys(source);
1055
+ var defineProperty = definePropertyModule.f;
1056
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1057
+ for (var i = 0; i < keys.length; i++) {
1058
+ var key = keys[i];
1059
+ if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
1060
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1061
+ }
1062
+ }
1063
+ };
1064
+
1065
+ var fails$3 = fails$b;
1066
+ var isCallable$3 = isCallable$d;
1067
+
1068
+ var replacement = /#|\.prototype\./;
1069
+
1070
+ var isForced$1 = function (feature, detection) {
1071
+ var value = data[normalize(feature)];
1072
+ return value === POLYFILL ? true
1073
+ : value === NATIVE ? false
1074
+ : isCallable$3(detection) ? fails$3(detection)
1075
+ : !!detection;
1076
+ };
1077
+
1078
+ var normalize = isForced$1.normalize = function (string) {
1079
+ return String(string).replace(replacement, '.').toLowerCase();
1080
+ };
1081
+
1082
+ var data = isForced$1.data = {};
1083
+ var NATIVE = isForced$1.NATIVE = 'N';
1084
+ var POLYFILL = isForced$1.POLYFILL = 'P';
1085
+
1086
+ var isForced_1 = isForced$1;
1087
+
1088
+ var global$2 = global$b;
1089
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1090
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
1091
+ var defineBuiltIn$2 = defineBuiltIn$3;
1092
+ var defineGlobalProperty = defineGlobalProperty$3;
1093
+ var copyConstructorProperties = copyConstructorProperties$1;
1094
+ var isForced = isForced_1;
1095
+
1096
+ /*
1097
+ options.target - name of the target object
1098
+ options.global - target is the global object
1099
+ options.stat - export as static methods of target
1100
+ options.proto - export as prototype methods of target
1101
+ options.real - real prototype method for the `pure` version
1102
+ options.forced - export even if the native feature is available
1103
+ options.bind - bind methods to the target, required for the `pure` version
1104
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1105
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
1106
+ options.sham - add a flag to not completely full polyfills
1107
+ options.enumerable - export as enumerable property
1108
+ options.dontCallGetSet - prevent calling a getter on target
1109
+ options.name - the .name of the function if it does not match the key
1110
+ */
1111
+ var _export = function (options, source) {
1112
+ var TARGET = options.target;
1113
+ var GLOBAL = options.global;
1114
+ var STATIC = options.stat;
1115
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1116
+ if (GLOBAL) {
1117
+ target = global$2;
1118
+ } else if (STATIC) {
1119
+ target = global$2[TARGET] || defineGlobalProperty(TARGET, {});
1120
+ } else {
1121
+ target = global$2[TARGET] && global$2[TARGET].prototype;
1122
+ }
1123
+ if (target) for (key in source) {
1124
+ sourceProperty = source[key];
1125
+ if (options.dontCallGetSet) {
1126
+ descriptor = getOwnPropertyDescriptor(target, key);
1127
+ targetProperty = descriptor && descriptor.value;
1128
+ } else targetProperty = target[key];
1129
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1130
+ // contained in target
1131
+ if (!FORCED && targetProperty !== undefined) {
1132
+ if (typeof sourceProperty == typeof targetProperty) continue;
1133
+ copyConstructorProperties(sourceProperty, targetProperty);
1134
+ }
1135
+ // add a flag to not completely full polyfills
1136
+ if (options.sham || (targetProperty && targetProperty.sham)) {
1137
+ createNonEnumerableProperty$2(sourceProperty, 'sham', true);
1138
+ }
1139
+ defineBuiltIn$2(target, key, sourceProperty, options);
1140
+ }
1141
+ };
1142
+
1143
+ var fails$2 = fails$b;
1144
+
1145
+ var correctPrototypeGetter = !fails$2(function () {
1146
+ function F() { /* empty */ }
1147
+ F.prototype.constructor = null;
1148
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1149
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1150
+ });
1151
+
1152
+ var hasOwn$1 = hasOwnProperty_1;
1153
+ var isCallable$2 = isCallable$d;
1154
+ var toObject$1 = toObject$3;
1155
+ var sharedKey = sharedKey$3;
1156
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1157
+
1158
+ var IE_PROTO = sharedKey('IE_PROTO');
1159
+ var $Object = Object;
1160
+ var ObjectPrototype = $Object.prototype;
1161
+
1162
+ // `Object.getPrototypeOf` method
1163
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1164
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1165
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1166
+ var object = toObject$1(O);
1167
+ if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1168
+ var constructor = object.constructor;
1169
+ if (isCallable$2(constructor) && object instanceof constructor) {
1170
+ return constructor.prototype;
1171
+ } return object instanceof $Object ? ObjectPrototype : null;
1172
+ };
1173
+
1174
+ var fails$1 = fails$b;
1175
+ var isCallable$1 = isCallable$d;
1176
+ var isObject$2 = isObject$8;
1177
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1178
+ var defineBuiltIn$1 = defineBuiltIn$3;
1179
+ var wellKnownSymbol$3 = wellKnownSymbol$6;
1180
+
1181
+ var ITERATOR$2 = wellKnownSymbol$3('iterator');
1182
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1183
+
1184
+ // `%IteratorPrototype%` object
1185
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1186
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1187
+
1188
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1189
+ if ([].keys) {
1190
+ arrayIterator = [].keys();
1191
+ // Safari 8 has buggy iterators w/o `next`
1192
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1193
+ else {
1194
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1195
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1196
+ }
1197
+ }
1198
+
1199
+ var NEW_ITERATOR_PROTOTYPE = !isObject$2(IteratorPrototype$2) || fails$1(function () {
1200
+ var test = {};
1201
+ // FF44- legacy iterators case
1202
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1203
+ });
1204
+
1205
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1206
+
1207
+ // `%IteratorPrototype%[@@iterator]()` method
1208
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1209
+ if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
1210
+ defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
1211
+ return this;
1212
+ });
1213
+ }
1214
+
1215
+ var iteratorsCore = {
1216
+ IteratorPrototype: IteratorPrototype$2,
1217
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1218
+ };
1219
+
1220
+ var defineProperty$2 = objectDefineProperty.f;
1221
+ var hasOwn = hasOwnProperty_1;
1222
+ var wellKnownSymbol$2 = wellKnownSymbol$6;
1223
+
1224
+ var TO_STRING_TAG = wellKnownSymbol$2('toStringTag');
1225
+
1226
+ var setToStringTag$3 = function (target, TAG, STATIC) {
1227
+ if (target && !STATIC) target = target.prototype;
1228
+ if (target && !hasOwn(target, TO_STRING_TAG)) {
1229
+ defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
1230
+ }
1231
+ };
1232
+
1233
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1234
+ var create = objectCreate;
1235
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1236
+ var setToStringTag$2 = setToStringTag$3;
1237
+ var Iterators$2 = iterators;
1238
+
1239
+ var returnThis$1 = function () { return this; };
1240
+
1241
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1242
+ var TO_STRING_TAG = NAME + ' Iterator';
1243
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1244
+ setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1245
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
1246
+ return IteratorConstructor;
1247
+ };
1248
+
1249
+ var uncurryThis$1 = functionUncurryThis;
1250
+ var aCallable = aCallable$2;
1251
+
1252
+ var functionUncurryThisAccessor = function (object, key, method) {
1253
+ try {
1254
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1255
+ return uncurryThis$1(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
1256
+ } catch (error) { /* empty */ }
1257
+ };
1258
+
1259
+ var isObject$1 = isObject$8;
1260
+
1261
+ var isPossiblePrototype$1 = function (argument) {
1262
+ return isObject$1(argument) || argument === null;
1263
+ };
1264
+
1265
+ var isPossiblePrototype = isPossiblePrototype$1;
1266
+
1267
+ var $String = String;
1268
+ var $TypeError = TypeError;
1269
+
1270
+ var aPossiblePrototype$1 = function (argument) {
1271
+ if (isPossiblePrototype(argument)) return argument;
1272
+ throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
1273
+ };
1274
+
1275
+ /* eslint-disable no-proto -- safe */
1276
+ var uncurryThisAccessor = functionUncurryThisAccessor;
1277
+ var isObject = isObject$8;
1278
+ var requireObjectCoercible = requireObjectCoercible$3;
1279
+ var aPossiblePrototype = aPossiblePrototype$1;
1280
+
1281
+ // `Object.setPrototypeOf` method
1282
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1283
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1284
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1285
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1286
+ var CORRECT_SETTER = false;
1287
+ var test = {};
1288
+ var setter;
1289
+ try {
1290
+ setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1291
+ setter(test, []);
1292
+ CORRECT_SETTER = test instanceof Array;
1293
+ } catch (error) { /* empty */ }
1294
+ return function setPrototypeOf(O, proto) {
1295
+ requireObjectCoercible(O);
1296
+ aPossiblePrototype(proto);
1297
+ if (!isObject(O)) return O;
1298
+ if (CORRECT_SETTER) setter(O, proto);
1299
+ else O.__proto__ = proto;
1300
+ return O;
1301
+ };
1302
+ }() : undefined);
1303
+
1304
+ var $$1 = _export;
1305
+ var call$1 = functionCall;
1306
+ var FunctionName = functionName;
1307
+ var isCallable = isCallable$d;
1308
+ var createIteratorConstructor = iteratorCreateConstructor;
1309
+ var getPrototypeOf = objectGetPrototypeOf;
1310
+ var setPrototypeOf = objectSetPrototypeOf;
1311
+ var setToStringTag$1 = setToStringTag$3;
1312
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
1313
+ var defineBuiltIn = defineBuiltIn$3;
1314
+ var wellKnownSymbol$1 = wellKnownSymbol$6;
1315
+ var Iterators$1 = iterators;
1316
+ var IteratorsCore = iteratorsCore;
1317
+
1318
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1319
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1320
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1321
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1322
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
1323
+ var KEYS = 'keys';
1324
+ var VALUES = 'values';
1325
+ var ENTRIES = 'entries';
1326
+
1327
+ var returnThis = function () { return this; };
1328
+
1329
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1330
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1331
+
1332
+ var getIterationMethod = function (KIND) {
1333
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1334
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1335
+
1336
+ switch (KIND) {
1337
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1338
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1339
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1340
+ }
1341
+
1342
+ return function () { return new IteratorConstructor(this); };
1343
+ };
1344
+
1345
+ var TO_STRING_TAG = NAME + ' Iterator';
1346
+ var INCORRECT_VALUES_NAME = false;
1347
+ var IterablePrototype = Iterable.prototype;
1348
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1349
+ || IterablePrototype['@@iterator']
1350
+ || DEFAULT && IterablePrototype[DEFAULT];
1351
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1352
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1353
+ var CurrentIteratorPrototype, methods, KEY;
1354
+
1355
+ // fix native
1356
+ if (anyNativeIterator) {
1357
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1358
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1359
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1360
+ if (setPrototypeOf) {
1361
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1362
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
1363
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1364
+ }
1365
+ }
1366
+ // Set @@toStringTag to native iterators
1367
+ setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1368
+ }
1369
+ }
1370
+
1371
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1372
+ if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1373
+ if (CONFIGURABLE_FUNCTION_NAME) {
1374
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1375
+ } else {
1376
+ INCORRECT_VALUES_NAME = true;
1377
+ defaultIterator = function values() { return call$1(nativeIterator, this); };
1378
+ }
1379
+ }
1380
+
1381
+ // export additional methods
1382
+ if (DEFAULT) {
1383
+ methods = {
1384
+ values: getIterationMethod(VALUES),
1385
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1386
+ entries: getIterationMethod(ENTRIES)
1387
+ };
1388
+ if (FORCED) for (KEY in methods) {
1389
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1390
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
1391
+ }
1392
+ } else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1393
+ }
1394
+
1395
+ // define iterator
1396
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1397
+ defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1398
+ }
1399
+ Iterators$1[NAME] = defaultIterator;
1400
+
1401
+ return methods;
1402
+ };
1403
+
1404
+ // `CreateIterResultObject` abstract operation
1405
+ // https://tc39.es/ecma262/#sec-createiterresultobject
1406
+ var createIterResultObject$1 = function (value, done) {
1407
+ return { value: value, done: done };
1408
+ };
1409
+
1410
+ var toIndexedObject = toIndexedObject$5;
1411
+ var addToUnscopables = addToUnscopables$1;
1412
+ var Iterators = iterators;
1413
+ var InternalStateModule = internalState;
1414
+ var defineProperty$1 = objectDefineProperty.f;
1415
+ var defineIterator = iteratorDefine;
1416
+ var createIterResultObject = createIterResultObject$1;
1417
+ var DESCRIPTORS$1 = descriptors;
1418
+
1419
+ var ARRAY_ITERATOR = 'Array Iterator';
1420
+ var setInternalState = InternalStateModule.set;
1421
+ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
1422
+
1423
+ // `Array.prototype.entries` method
1424
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1425
+ // `Array.prototype.keys` method
1426
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1427
+ // `Array.prototype.values` method
1428
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1429
+ // `Array.prototype[@@iterator]` method
1430
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1431
+ // `CreateArrayIterator` internal method
1432
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1433
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1434
+ setInternalState(this, {
1435
+ type: ARRAY_ITERATOR,
1436
+ target: toIndexedObject(iterated), // target
1437
+ index: 0, // next index
1438
+ kind: kind // kind
1439
+ });
1440
+ // `%ArrayIteratorPrototype%.next` method
1441
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1442
+ }, function () {
1443
+ var state = getInternalState(this);
1444
+ var target = state.target;
1445
+ var index = state.index++;
1446
+ if (!target || index >= target.length) {
1447
+ state.target = undefined;
1448
+ return createIterResultObject(undefined, true);
1449
+ }
1450
+ switch (state.kind) {
1451
+ case 'keys': return createIterResultObject(index, false);
1452
+ case 'values': return createIterResultObject(target[index], false);
1453
+ } return createIterResultObject([index, target[index]], false);
1454
+ }, 'values');
1455
+
1456
+ // argumentsList[@@iterator] is %ArrayProto_values%
1457
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1458
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1459
+ var values = Iterators.Arguments = Iterators.Array;
1460
+
1461
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1462
+ addToUnscopables('keys');
1463
+ addToUnscopables('values');
1464
+ addToUnscopables('entries');
1465
+
1466
+ // V8 ~ Chrome 45- bug
1467
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1468
+ defineProperty$1(values, 'name', { value: 'values' });
1469
+ } catch (error) { /* empty */ }
1470
+
1471
+ // iterable DOM collections
1472
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1473
+ var domIterables = {
1474
+ CSSRuleList: 0,
1475
+ CSSStyleDeclaration: 0,
1476
+ CSSValueList: 0,
1477
+ ClientRectList: 0,
1478
+ DOMRectList: 0,
1479
+ DOMStringList: 0,
1480
+ DOMTokenList: 1,
1481
+ DataTransferItemList: 0,
1482
+ FileList: 0,
1483
+ HTMLAllCollection: 0,
1484
+ HTMLCollection: 0,
1485
+ HTMLFormElement: 0,
1486
+ HTMLSelectElement: 0,
1487
+ MediaList: 0,
1488
+ MimeTypeArray: 0,
1489
+ NamedNodeMap: 0,
1490
+ NodeList: 1,
1491
+ PaintRequestList: 0,
1492
+ Plugin: 0,
1493
+ PluginArray: 0,
1494
+ SVGLengthList: 0,
1495
+ SVGNumberList: 0,
1496
+ SVGPathSegList: 0,
1497
+ SVGPointList: 0,
1498
+ SVGStringList: 0,
1499
+ SVGTransformList: 0,
1500
+ SourceBufferList: 0,
1501
+ StyleSheetList: 0,
1502
+ TextTrackCueList: 0,
1503
+ TextTrackList: 0,
1504
+ TouchList: 0
1505
+ };
1506
+
1507
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1508
+ var documentCreateElement = documentCreateElement$2;
1509
+
1510
+ var classList = documentCreateElement('span').classList;
1511
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1512
+
1513
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1514
+
1515
+ var global$1 = global$b;
1516
+ var DOMIterables = domIterables;
1517
+ var DOMTokenListPrototype = domTokenListPrototype;
1518
+ var ArrayIteratorMethods = es_array_iterator;
1519
+ var createNonEnumerableProperty = createNonEnumerableProperty$4;
1520
+ var setToStringTag = setToStringTag$3;
1521
+ var wellKnownSymbol = wellKnownSymbol$6;
1522
+
1523
+ var ITERATOR = wellKnownSymbol('iterator');
1524
+ var ArrayValues = ArrayIteratorMethods.values;
1525
+
1526
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1527
+ if (CollectionPrototype) {
1528
+ // some Chrome versions have non-configurable methods on DOMTokenList
1529
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1530
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1531
+ } catch (error) {
1532
+ CollectionPrototype[ITERATOR] = ArrayValues;
1533
+ }
1534
+ setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
1535
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1536
+ // some Chrome versions have non-configurable methods on DOMTokenList
1537
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1538
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1539
+ } catch (error) {
1540
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1541
+ }
1542
+ }
1543
+ }
1544
+ };
1545
+
1546
+ for (var COLLECTION_NAME in DOMIterables) {
1547
+ handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
1548
+ }
1549
+
1550
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1551
+
1552
+ var DESCRIPTORS = descriptors;
1553
+ var uncurryThis = functionUncurryThis;
1554
+ var call = functionCall;
1555
+ var fails = fails$b;
1556
+ var objectKeys = objectKeys$2;
1557
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1558
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1559
+ var toObject = toObject$3;
1560
+ var IndexedObject = indexedObject;
1561
+
1562
+ // eslint-disable-next-line es/no-object-assign -- safe
1563
+ var $assign = Object.assign;
1564
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1565
+ var defineProperty = Object.defineProperty;
1566
+ var concat = uncurryThis([].concat);
1567
+
1568
+ // `Object.assign` method
1569
+ // https://tc39.es/ecma262/#sec-object.assign
1570
+ var objectAssign = !$assign || fails(function () {
1571
+ // should have correct order of operations (Edge bug)
1572
+ if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
1573
+ enumerable: true,
1574
+ get: function () {
1575
+ defineProperty(this, 'b', {
1576
+ value: 3,
1577
+ enumerable: false
1578
+ });
1579
+ }
1580
+ }), { b: 2 })).b !== 1) return true;
1581
+ // should work with symbols and should have deterministic property order (V8 bug)
1582
+ var A = {};
1583
+ var B = {};
1584
+ // eslint-disable-next-line es/no-symbol -- safe
1585
+ var symbol = Symbol('assign detection');
1586
+ var alphabet = 'abcdefghijklmnopqrst';
1587
+ A[symbol] = 7;
1588
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1589
+ return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
1590
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1591
+ var T = toObject(target);
1592
+ var argumentsLength = arguments.length;
1593
+ var index = 1;
1594
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1595
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1596
+ while (argumentsLength > index) {
1597
+ var S = IndexedObject(arguments[index++]);
1598
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1599
+ var length = keys.length;
1600
+ var j = 0;
1601
+ var key;
1602
+ while (length > j) {
1603
+ key = keys[j++];
1604
+ if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
1605
+ }
1606
+ } return T;
1607
+ } : $assign;
1608
+
1609
+ var $ = _export;
1610
+ var assign = objectAssign;
1611
+
1612
+ // `Object.assign` method
1613
+ // https://tc39.es/ecma262/#sec-object.assign
1614
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1615
+ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1616
+ assign: assign
1617
+ });
1618
+
1619
+ let context;
1620
+ const FormGroupContext = /*#__PURE__*/createContext({});
1621
+ const FormGroupContextProvider = ({
1622
+ children,
1623
+ mappers,
1624
+ debugMode: _debugMode = false
1625
+ }) => {
1626
+ const formGroupInstance = useRef(new FormGroup());
1627
+ const addForm = ({
1628
+ key,
1629
+ formInstance
1630
+ }) => {
1631
+ formGroupInstance.current.addForm({
1632
+ key,
1633
+ formInstance
1634
+ });
1635
+ };
1636
+ const removeForm = ({
1637
+ key
1638
+ }) => {
1639
+ formGroupInstance.current.removeForm({
1640
+ key
1641
+ });
1642
+ };
1643
+ const getForm = ({
1644
+ key
1645
+ }) => formGroupInstance.current.getForm({
1646
+ key
1647
+ });
1648
+ const printFormGroupInstance = () => {
1649
+ console.log(formGroupInstance.current.printFormGroupInstance());
1650
+ };
1651
+ const submitMultipleFormsByIndex = indexes => {
1652
+ return formGroupInstance.current.submitMultipleFormsByIndex(indexes);
1653
+ };
1654
+ const contextValue = {
1655
+ addForm,
1656
+ getForm,
1657
+ removeForm,
1658
+ mappers,
1659
+ formGroupInstance: formGroupInstance.current,
1660
+ printFormGroupInstance,
1661
+ submitMultipleFormsByIndex,
1662
+ debugMode: _debugMode
1663
+ };
1664
+ return jsxs(FormGroupContext.Provider, {
1665
+ value: contextValue,
1666
+ children: [_debugMode && jsxs(Fragment, {
1667
+ children: [jsx("button", {
1668
+ onClick: () => console.log(formGroupInstance),
1669
+ children: "printGroupInstance"
1670
+ }), jsx("br", {}), jsx("hr", {})]
1671
+ }), children]
1672
+ });
1673
+ };
1674
+ const useFormGroupContext = () => {
1675
+ context = useContext(FormGroupContext);
1676
+ if (typeof context === 'undefined') {
1677
+ throw new Error(`useFormContext must be used within a FormContextProvider`);
1678
+ }
1679
+ return context;
1680
+ };
1681
+
1682
+ const FieldWrapper = ({
1683
+ index,
1684
+ Component,
1685
+ formKey,
1686
+ children,
1687
+ events
1688
+ }) => {
1689
+ var _a;
1690
+ const {
1691
+ formGroupInstance,
1692
+ debugMode
1693
+ } = useFormGroupContext();
1694
+ const fieldInstance = ((_a = formGroupInstance.getForm({
1695
+ key: formKey
1696
+ })) === null || _a === void 0 ? void 0 : _a.getField({
1697
+ key: index
1698
+ })) || {};
1699
+ const [valueState, setValueState] = useState(fieldInstance.stateValue);
1700
+ const [state, setState] = useState({
1701
+ visibility: fieldInstance.visibility,
1702
+ props: fieldInstance.props,
1703
+ apiResponse: fieldInstance.api
1704
+ });
1705
+ useEffect(() => {
1706
+ fieldInstance.mountField({
1707
+ valueSubscription: value => {
1708
+ setValueState(value);
1709
+ },
1710
+ propsSubscription: ({
1711
+ errors,
1712
+ visibility,
1713
+ apiResponse,
1714
+ props
1715
+ }) => {
1716
+ setState(prev => Object.assign(Object.assign({}, prev), {
1717
+ errors,
1718
+ visibility,
1719
+ apiResponse,
1720
+ props
1721
+ }));
1722
+ }
1723
+ });
1724
+ return () => {
1725
+ fieldInstance.destroyField();
1726
+ };
1727
+ }, []);
1728
+ const handleChange = useCallback(event => {
1729
+ fieldInstance.emitValue({
1730
+ value: event,
1731
+ event: 'ON_FIELD_CHANGE'
1732
+ });
1733
+ }, []);
1734
+ const handleEvent = useCallback(event => {
1735
+ fieldInstance.emitEvents({
1736
+ event
1737
+ });
1738
+ }, []);
1739
+ const mapProps = useMemo(() => {
1740
+ const props = {};
1741
+ if (events === null || events === void 0 ? void 0 : events.onBlur) props[events.onBlur] = () => handleEvent('ON_FIELD_BLUR');
1742
+ if (events === null || events === void 0 ? void 0 : events.getValue) props[events.getValue] = handleChange;
1743
+ if (events === null || events === void 0 ? void 0 : events.onFocus) props[events.onFocus] = () => handleEvent('ON_FIELD_FOCUS');
1744
+ if (events === null || events === void 0 ? void 0 : events.onClick) props[events.onClick] = () => handleEvent('ON_FIELD_CLICK');
1745
+ if (events === null || events === void 0 ? void 0 : events.onKeyUp) props[events.onKeyUp] = () => handleEvent('ON_FIELD_KEYUP');
1746
+ if (events === null || events === void 0 ? void 0 : events.onKeyDown) props[events.onKeyDown] = () => handleEvent('ON_FIELD_KEYDOWN');
1747
+ return props;
1748
+ }, []);
1749
+ const mapValue = useMemo(() => (events === null || events === void 0 ? void 0 : events.setValue) ? {
1750
+ [events.setValue]: valueState
1751
+ } : {}, [valueState]);
1752
+ return (state === null || state === void 0 ? void 0 : state.visibility) ? jsxs(Fragment, {
1753
+ children: [debugMode && jsxs(Fragment, {
1754
+ children: [jsx("b", {
1755
+ style: {
1756
+ padding: '0px',
1757
+ margin: '0px'
1758
+ },
1759
+ children: index
1760
+ }), jsx("br", {}), jsx("hr", {})]
1761
+ }), jsx(Component, Object.assign({}, state === null || state === void 0 ? void 0 : state.props, mapProps, mapValue, {
1762
+ children: children && children
1763
+ }))]
1764
+ }) : jsx(Fragment, {});
1765
+ };
1766
+
1767
+ const BuildTree = ({
1768
+ fields,
1769
+ prevPath,
1770
+ formKey
1771
+ }) => {
1772
+ return Array.from(fields).filter(([, value]) => {
1773
+ return value.path === prevPath;
1774
+ }).map(([, value]) => {
1775
+ var _a;
1776
+ const fieldName = value.name;
1777
+ const mapper = (_a = fields.get(fieldName)) === null || _a === void 0 ? void 0 : _a.mapper;
1778
+ const children = BuildTree({
1779
+ fields,
1780
+ prevPath: `${prevPath ? `${prevPath}.` : ``}${value.name}`,
1781
+ formKey
1782
+ });
1783
+ const lenght = Children.count(children);
1784
+ return mapper && mapper.asynccomponent ? jsx(Suspense, {
1785
+ children: jsx(FieldWrapper, {
1786
+ Component: mapper.asynccomponent,
1787
+ index: fieldName,
1788
+ events: mapper.events,
1789
+ formKey: formKey,
1790
+ children: lenght > 0 ? children : null
1791
+ })
1792
+ }, fieldName) : mapper && mapper.component ? jsx(FieldWrapper, {
1793
+ Component: mapper.component,
1794
+ index: fieldName,
1795
+ events: mapper.events,
1796
+ formKey: formKey,
1797
+ children: lenght > 0 ? children : null
1798
+ }, fieldName) : jsx("div", {
1799
+ children: `failed to render field: ${fieldName} on tree, check mappers.. :(`
1800
+ });
1801
+ });
1802
+ };
1803
+ const BuildAsFormFieldTree = ({
1804
+ children
1805
+ }) => {
1806
+ return Children.map(children, (child, index) => {
1807
+ var _a, _b;
1808
+ if (!((_a = child === null || child === void 0 ? void 0 : child.type) === null || _a === void 0 ? void 0 : _a.name) || child.type.name !== 'AsFormField') {
1809
+ throw new Error('only use AsFormField inside the Form component');
1810
+ // console.log(child.type.name);
1811
+ }
1812
+ const struct = Object.assign({}, child.props);
1813
+ delete struct.children;
1814
+ const childElements = BuildAsFormFieldTree({
1815
+ children: (_b = child.props) === null || _b === void 0 ? void 0 : _b.children
1816
+ });
1817
+ return Object.assign(Object.assign({}, struct), childElements && {
1818
+ children: childElements
1819
+ });
1820
+ });
1821
+ };
1822
+
1823
+ const Form = ({
1824
+ schema,
1825
+ index,
1826
+ initialValues,
1827
+ iVars,
1828
+ action,
1829
+ method,
1830
+ onSubmit,
1831
+ onData,
1832
+ children
1833
+ }) => {
1834
+ const {
1835
+ addForm,
1836
+ removeForm,
1837
+ getForm,
1838
+ mappers,
1839
+ debugMode
1840
+ } = useFormGroupContext();
1841
+ const [tree, setTree] = useState();
1842
+ const schemaIndex = useMemo(() => index || (schema === null || schema === void 0 ? void 0 : schema.index) || 'defaultChange', [index, schema]);
1843
+ useEffect(() => {
1844
+ if (schemaIndex === 'defaultChange') {
1845
+ console.warn('please, add an unique id to the form, otherwise multiple forms will break');
1846
+ }
1847
+ const formInstance = new FormCore({
1848
+ schema,
1849
+ initialValues: initialValues || (schema === null || schema === void 0 ? void 0 : schema.initialValues),
1850
+ action: action || (schema === null || schema === void 0 ? void 0 : schema.action),
1851
+ method: method || (schema === null || schema === void 0 ? void 0 : schema.method),
1852
+ index: schemaIndex,
1853
+ onSubmit,
1854
+ onData,
1855
+ mappers
1856
+ });
1857
+ addForm({
1858
+ key: schemaIndex,
1859
+ formInstance
1860
+ });
1861
+ /*
1862
+ @TODO check if form instance is killed each time it is unmounted
1863
+ the management of multiple forms needs to be planned
1864
+ */
1865
+ return () => removeForm({
1866
+ key: index
1867
+ });
1868
+ }, []);
1869
+ useEffect(() => {
1870
+ var _a;
1871
+ const schema = BuildAsFormFieldTree({
1872
+ children
1873
+ });
1874
+ schema && getForm({
1875
+ key: index
1876
+ }).refreshFields(schema);
1877
+ const fields = (_a = getForm({
1878
+ key: index
1879
+ })) === null || _a === void 0 ? void 0 : _a.fields;
1880
+ if (fields) {
1881
+ const buildTree = BuildTree({
1882
+ fields,
1883
+ formKey: index
1884
+ });
1885
+ setTree(buildTree);
1886
+ }
1887
+ }, [children]);
1888
+ useEffect(() => {
1889
+ if (iVars) getForm({
1890
+ key: index
1891
+ }).iVars = iVars;
1892
+ }, [iVars]);
1893
+ /*
1894
+ @TODO move this logic inside form-core, add action and method onto form element,
1895
+ might need a ref of the form to collect all the form parameters when there is a
1896
+ normal form submition with redirect
1897
+ */
1898
+ const handleSubmit = event => {
1899
+ const formElement = getForm({
1900
+ key: schemaIndex
1901
+ });
1902
+ if (!(formElement === null || formElement === void 0 ? void 0 : formElement.action) && event) {
1903
+ event.preventDefault();
1904
+ }
1905
+ formElement === null || formElement === void 0 ? void 0 : formElement.submit();
1906
+ };
1907
+ return jsxs(Fragment, {
1908
+ children: [debugMode && jsxs(Fragment, {
1909
+ children: [jsx("b", {
1910
+ style: {
1911
+ padding: '0px',
1912
+ margin: '0px'
1913
+ },
1914
+ children: `form index: ${schemaIndex}`
1915
+ }), jsx("button", {
1916
+ onClick: () => console.log(getForm({
1917
+ key: schemaIndex
1918
+ })),
1919
+ children: "print form instance"
1920
+ }), jsx("button", {
1921
+ onClick: () => {
1922
+ var _a;
1923
+ return (_a = getForm({
1924
+ key: schemaIndex
1925
+ })) === null || _a === void 0 ? void 0 : _a.printValues();
1926
+ },
1927
+ children: "print values"
1928
+ }), jsx("br", {}), jsx("hr", {})]
1929
+ }), jsx("form", {
1930
+ onSubmit: handleSubmit,
1931
+ children: tree && tree
1932
+ })]
1933
+ });
1934
+ };
1935
+
1936
+ const AsFormField = props => {
1937
+ return jsx(Fragment, {
1938
+ children: props.children
1939
+ });
1940
+ };
1941
+
1942
+ export { AsFormField, Form, FormGroupContext, FormGroupContextProvider, useFormGroupContext };