@sebgroup/green-react 1.0.0-beta.10 → 1.0.0-beta.13

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.umd.js CHANGED
@@ -1,2197 +1,2771 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@sebgroup/extract')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@sebgroup/extract'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.jsxRuntime, global.React, global.extract));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@sebgroup/extract')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@sebgroup/extract'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.React = {}, global.jsxRuntime, global.React, global.extract));
5
5
  })(this, (function (exports, jsxRuntime, React, extract) { 'use strict';
6
6
 
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
9
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
+
11
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
10
12
 
11
- /*! *****************************************************************************
12
- Copyright (c) Microsoft Corporation.
13
-
14
- Permission to use, copy, modify, and/or distribute this software for any
15
- purpose with or without fee is hereby granted.
13
+ var check = function (it) {
14
+ return it && it.Math == Math && it;
15
+ };
16
+
17
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
18
+ var global$r =
19
+ // eslint-disable-next-line es-x/no-global-this -- safe
20
+ check(typeof globalThis == 'object' && globalThis) ||
21
+ check(typeof window == 'object' && window) ||
22
+ // eslint-disable-next-line no-restricted-globals -- safe
23
+ check(typeof self == 'object' && self) ||
24
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
25
+ // eslint-disable-next-line no-new-func -- fallback
26
+ (function () { return this; })() || Function('return this')();
27
+
28
+ var objectGetOwnPropertyDescriptor = {};
29
+
30
+ var fails$a = function (exec) {
31
+ try {
32
+ return !!exec();
33
+ } catch (error) {
34
+ return true;
35
+ }
36
+ };
37
+
38
+ var fails$9 = fails$a;
39
+
40
+ // Detect IE8's incomplete defineProperty implementation
41
+ var descriptors = !fails$9(function () {
42
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
43
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
44
+ });
45
+
46
+ var fails$8 = fails$a;
47
+
48
+ var functionBindNative = !fails$8(function () {
49
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
50
+ var test = (function () { /* empty */ }).bind();
51
+ // eslint-disable-next-line no-prototype-builtins -- safe
52
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
53
+ });
54
+
55
+ var NATIVE_BIND$1 = functionBindNative;
56
+
57
+ var call$6 = Function.prototype.call;
58
+
59
+ var functionCall = NATIVE_BIND$1 ? call$6.bind(call$6) : function () {
60
+ return call$6.apply(call$6, arguments);
61
+ };
62
+
63
+ var objectPropertyIsEnumerable = {};
64
+
65
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
66
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
67
+ var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
68
+
69
+ // Nashorn ~ JDK8 bug
70
+ var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
71
+
72
+ // `Object.prototype.propertyIsEnumerable` method implementation
73
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
74
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
75
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
76
+ return !!descriptor && descriptor.enumerable;
77
+ } : $propertyIsEnumerable;
78
+
79
+ var createPropertyDescriptor$3 = function (bitmap, value) {
80
+ return {
81
+ enumerable: !(bitmap & 1),
82
+ configurable: !(bitmap & 2),
83
+ writable: !(bitmap & 4),
84
+ value: value
85
+ };
86
+ };
87
+
88
+ var NATIVE_BIND = functionBindNative;
89
+
90
+ var FunctionPrototype$1 = Function.prototype;
91
+ var bind = FunctionPrototype$1.bind;
92
+ var call$5 = FunctionPrototype$1.call;
93
+ var uncurryThis$c = NATIVE_BIND && bind.bind(call$5, call$5);
94
+
95
+ var functionUncurryThis = NATIVE_BIND ? function (fn) {
96
+ return fn && uncurryThis$c(fn);
97
+ } : function (fn) {
98
+ return fn && function () {
99
+ return call$5.apply(fn, arguments);
100
+ };
101
+ };
102
+
103
+ var uncurryThis$b = functionUncurryThis;
104
+
105
+ var toString$3 = uncurryThis$b({}.toString);
106
+ var stringSlice$1 = uncurryThis$b(''.slice);
107
+
108
+ var classofRaw$1 = function (it) {
109
+ return stringSlice$1(toString$3(it), 8, -1);
110
+ };
111
+
112
+ var global$q = global$r;
113
+ var uncurryThis$a = functionUncurryThis;
114
+ var fails$7 = fails$a;
115
+ var classof$2 = classofRaw$1;
116
+
117
+ var Object$5 = global$q.Object;
118
+ var split = uncurryThis$a(''.split);
119
+
120
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
121
+ var indexedObject = fails$7(function () {
122
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
123
+ // eslint-disable-next-line no-prototype-builtins -- safe
124
+ return !Object$5('z').propertyIsEnumerable(0);
125
+ }) ? function (it) {
126
+ return classof$2(it) == 'String' ? split(it, '') : Object$5(it);
127
+ } : Object$5;
128
+
129
+ var global$p = global$r;
130
+
131
+ var TypeError$8 = global$p.TypeError;
132
+
133
+ // `RequireObjectCoercible` abstract operation
134
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
135
+ var requireObjectCoercible$2 = function (it) {
136
+ if (it == undefined) throw TypeError$8("Can't call method on " + it);
137
+ return it;
138
+ };
139
+
140
+ // toObject with fallback for non-array-like ES3 strings
141
+ var IndexedObject$1 = indexedObject;
142
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
143
+
144
+ var toIndexedObject$5 = function (it) {
145
+ return IndexedObject$1(requireObjectCoercible$1(it));
146
+ };
147
+
148
+ // `IsCallable` abstract operation
149
+ // https://tc39.es/ecma262/#sec-iscallable
150
+ var isCallable$f = function (argument) {
151
+ return typeof argument == 'function';
152
+ };
153
+
154
+ var isCallable$e = isCallable$f;
155
+
156
+ var isObject$5 = function (it) {
157
+ return typeof it == 'object' ? it !== null : isCallable$e(it);
158
+ };
159
+
160
+ var global$o = global$r;
161
+ var isCallable$d = isCallable$f;
162
+
163
+ var aFunction = function (argument) {
164
+ return isCallable$d(argument) ? argument : undefined;
165
+ };
166
+
167
+ var getBuiltIn$4 = function (namespace, method) {
168
+ return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
169
+ };
170
+
171
+ var uncurryThis$9 = functionUncurryThis;
172
+
173
+ var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
174
+
175
+ var getBuiltIn$3 = getBuiltIn$4;
176
+
177
+ var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
178
+
179
+ var global$n = global$r;
180
+ var userAgent = engineUserAgent;
181
+
182
+ var process = global$n.process;
183
+ var Deno = global$n.Deno;
184
+ var versions = process && process.versions || Deno && Deno.version;
185
+ var v8 = versions && versions.v8;
186
+ var match, version;
187
+
188
+ if (v8) {
189
+ match = v8.split('.');
190
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
191
+ // but their correct versions are not interesting for us
192
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
193
+ }
194
+
195
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
196
+ // so check `userAgent` even if `.v8` exists, but 0
197
+ if (!version && userAgent) {
198
+ match = userAgent.match(/Edge\/(\d+)/);
199
+ if (!match || match[1] >= 74) {
200
+ match = userAgent.match(/Chrome\/(\d+)/);
201
+ if (match) version = +match[1];
202
+ }
203
+ }
204
+
205
+ var engineV8Version = version;
206
+
207
+ /* eslint-disable es-x/no-symbol -- required for testing */
208
+
209
+ var V8_VERSION = engineV8Version;
210
+ var fails$6 = fails$a;
211
+
212
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
213
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$6(function () {
214
+ var symbol = Symbol();
215
+ // Chrome 38 Symbol has incorrect toString conversion
216
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
217
+ return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
218
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
219
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
220
+ });
221
+
222
+ /* eslint-disable es-x/no-symbol -- required for testing */
223
+
224
+ var NATIVE_SYMBOL$2 = nativeSymbol;
225
+
226
+ var useSymbolAsUid = NATIVE_SYMBOL$2
227
+ && !Symbol.sham
228
+ && typeof Symbol.iterator == 'symbol';
229
+
230
+ var global$m = global$r;
231
+ var getBuiltIn$2 = getBuiltIn$4;
232
+ var isCallable$c = isCallable$f;
233
+ var isPrototypeOf$1 = objectIsPrototypeOf;
234
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
235
+
236
+ var Object$4 = global$m.Object;
237
+
238
+ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
239
+ return typeof it == 'symbol';
240
+ } : function (it) {
241
+ var $Symbol = getBuiltIn$2('Symbol');
242
+ return isCallable$c($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$4(it));
243
+ };
244
+
245
+ var global$l = global$r;
246
+
247
+ var String$4 = global$l.String;
248
+
249
+ var tryToString$1 = function (argument) {
250
+ try {
251
+ return String$4(argument);
252
+ } catch (error) {
253
+ return 'Object';
254
+ }
255
+ };
256
+
257
+ var global$k = global$r;
258
+ var isCallable$b = isCallable$f;
259
+ var tryToString = tryToString$1;
260
+
261
+ var TypeError$7 = global$k.TypeError;
262
+
263
+ // `Assert: IsCallable(argument) is true`
264
+ var aCallable$1 = function (argument) {
265
+ if (isCallable$b(argument)) return argument;
266
+ throw TypeError$7(tryToString(argument) + ' is not a function');
267
+ };
268
+
269
+ var aCallable = aCallable$1;
270
+
271
+ // `GetMethod` abstract operation
272
+ // https://tc39.es/ecma262/#sec-getmethod
273
+ var getMethod$1 = function (V, P) {
274
+ var func = V[P];
275
+ return func == null ? undefined : aCallable(func);
276
+ };
277
+
278
+ var global$j = global$r;
279
+ var call$4 = functionCall;
280
+ var isCallable$a = isCallable$f;
281
+ var isObject$4 = isObject$5;
282
+
283
+ var TypeError$6 = global$j.TypeError;
284
+
285
+ // `OrdinaryToPrimitive` abstract operation
286
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
287
+ var ordinaryToPrimitive$1 = function (input, pref) {
288
+ var fn, val;
289
+ if (pref === 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
290
+ if (isCallable$a(fn = input.valueOf) && !isObject$4(val = call$4(fn, input))) return val;
291
+ if (pref !== 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
292
+ throw TypeError$6("Can't convert object to primitive value");
293
+ };
294
+
295
+ var shared$3 = {exports: {}};
296
+
297
+ var global$i = global$r;
298
+
299
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
300
+ var defineProperty$4 = Object.defineProperty;
301
+
302
+ var setGlobal$3 = function (key, value) {
303
+ try {
304
+ defineProperty$4(global$i, key, { value: value, configurable: true, writable: true });
305
+ } catch (error) {
306
+ global$i[key] = value;
307
+ } return value;
308
+ };
309
+
310
+ var global$h = global$r;
311
+ var setGlobal$2 = setGlobal$3;
312
+
313
+ var SHARED = '__core-js_shared__';
314
+ var store$3 = global$h[SHARED] || setGlobal$2(SHARED, {});
315
+
316
+ var sharedStore = store$3;
317
+
318
+ var store$2 = sharedStore;
319
+
320
+ (shared$3.exports = function (key, value) {
321
+ return store$2[key] || (store$2[key] = value !== undefined ? value : {});
322
+ })('versions', []).push({
323
+ version: '3.22.2',
324
+ mode: 'global',
325
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
326
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.2/LICENSE',
327
+ source: 'https://github.com/zloirock/core-js'
328
+ });
329
+
330
+ var global$g = global$r;
331
+ var requireObjectCoercible = requireObjectCoercible$2;
332
+
333
+ var Object$3 = global$g.Object;
334
+
335
+ // `ToObject` abstract operation
336
+ // https://tc39.es/ecma262/#sec-toobject
337
+ var toObject$3 = function (argument) {
338
+ return Object$3(requireObjectCoercible(argument));
339
+ };
340
+
341
+ var uncurryThis$8 = functionUncurryThis;
342
+ var toObject$2 = toObject$3;
343
+
344
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
345
+
346
+ // `HasOwnProperty` abstract operation
347
+ // https://tc39.es/ecma262/#sec-hasownproperty
348
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
349
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
350
+ return hasOwnProperty(toObject$2(it), key);
351
+ };
352
+
353
+ var uncurryThis$7 = functionUncurryThis;
354
+
355
+ var id = 0;
356
+ var postfix = Math.random();
357
+ var toString$2 = uncurryThis$7(1.0.toString);
358
+
359
+ var uid$2 = function (key) {
360
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
361
+ };
362
+
363
+ var global$f = global$r;
364
+ var shared$2 = shared$3.exports;
365
+ var hasOwn$9 = hasOwnProperty_1;
366
+ var uid$1 = uid$2;
367
+ var NATIVE_SYMBOL$1 = nativeSymbol;
368
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
369
+
370
+ var WellKnownSymbolsStore = shared$2('wks');
371
+ var Symbol$1 = global$f.Symbol;
372
+ var symbolFor = Symbol$1 && Symbol$1['for'];
373
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
374
+
375
+ var wellKnownSymbol$8 = function (name) {
376
+ if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
377
+ var description = 'Symbol.' + name;
378
+ if (NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)) {
379
+ WellKnownSymbolsStore[name] = Symbol$1[name];
380
+ } else if (USE_SYMBOL_AS_UID && symbolFor) {
381
+ WellKnownSymbolsStore[name] = symbolFor(description);
382
+ } else {
383
+ WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
384
+ }
385
+ } return WellKnownSymbolsStore[name];
386
+ };
387
+
388
+ var global$e = global$r;
389
+ var call$3 = functionCall;
390
+ var isObject$3 = isObject$5;
391
+ var isSymbol$1 = isSymbol$2;
392
+ var getMethod = getMethod$1;
393
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
394
+ var wellKnownSymbol$7 = wellKnownSymbol$8;
395
+
396
+ var TypeError$5 = global$e.TypeError;
397
+ var TO_PRIMITIVE = wellKnownSymbol$7('toPrimitive');
398
+
399
+ // `ToPrimitive` abstract operation
400
+ // https://tc39.es/ecma262/#sec-toprimitive
401
+ var toPrimitive$1 = function (input, pref) {
402
+ if (!isObject$3(input) || isSymbol$1(input)) return input;
403
+ var exoticToPrim = getMethod(input, TO_PRIMITIVE);
404
+ var result;
405
+ if (exoticToPrim) {
406
+ if (pref === undefined) pref = 'default';
407
+ result = call$3(exoticToPrim, input, pref);
408
+ if (!isObject$3(result) || isSymbol$1(result)) return result;
409
+ throw TypeError$5("Can't convert object to primitive value");
410
+ }
411
+ if (pref === undefined) pref = 'number';
412
+ return ordinaryToPrimitive(input, pref);
413
+ };
414
+
415
+ var toPrimitive = toPrimitive$1;
416
+ var isSymbol = isSymbol$2;
417
+
418
+ // `ToPropertyKey` abstract operation
419
+ // https://tc39.es/ecma262/#sec-topropertykey
420
+ var toPropertyKey$2 = function (argument) {
421
+ var key = toPrimitive(argument, 'string');
422
+ return isSymbol(key) ? key : key + '';
423
+ };
424
+
425
+ var global$d = global$r;
426
+ var isObject$2 = isObject$5;
427
+
428
+ var document$1 = global$d.document;
429
+ // typeof document.createElement is 'object' in old IE
430
+ var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
431
+
432
+ var documentCreateElement$2 = function (it) {
433
+ return EXISTS$1 ? document$1.createElement(it) : {};
434
+ };
435
+
436
+ var DESCRIPTORS$9 = descriptors;
437
+ var fails$5 = fails$a;
438
+ var createElement = documentCreateElement$2;
439
+
440
+ // Thanks to IE8 for its funny defineProperty
441
+ var ie8DomDefine = !DESCRIPTORS$9 && !fails$5(function () {
442
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
443
+ return Object.defineProperty(createElement('div'), 'a', {
444
+ get: function () { return 7; }
445
+ }).a != 7;
446
+ });
447
+
448
+ var DESCRIPTORS$8 = descriptors;
449
+ var call$2 = functionCall;
450
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
451
+ var createPropertyDescriptor$2 = createPropertyDescriptor$3;
452
+ var toIndexedObject$4 = toIndexedObject$5;
453
+ var toPropertyKey$1 = toPropertyKey$2;
454
+ var hasOwn$8 = hasOwnProperty_1;
455
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
456
+
457
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
458
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
459
+
460
+ // `Object.getOwnPropertyDescriptor` method
461
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
462
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
463
+ O = toIndexedObject$4(O);
464
+ P = toPropertyKey$1(P);
465
+ if (IE8_DOM_DEFINE$1) try {
466
+ return $getOwnPropertyDescriptor$1(O, P);
467
+ } catch (error) { /* empty */ }
468
+ if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
469
+ };
470
+
471
+ var objectDefineProperty = {};
472
+
473
+ var DESCRIPTORS$7 = descriptors;
474
+ var fails$4 = fails$a;
475
+
476
+ // V8 ~ Chrome 36-
477
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
478
+ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$4(function () {
479
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
480
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
481
+ value: 42,
482
+ writable: false
483
+ }).prototype != 42;
484
+ });
485
+
486
+ var global$c = global$r;
487
+ var isObject$1 = isObject$5;
488
+
489
+ var String$3 = global$c.String;
490
+ var TypeError$4 = global$c.TypeError;
491
+
492
+ // `Assert: Type(argument) is Object`
493
+ var anObject$5 = function (argument) {
494
+ if (isObject$1(argument)) return argument;
495
+ throw TypeError$4(String$3(argument) + ' is not an object');
496
+ };
497
+
498
+ var global$b = global$r;
499
+ var DESCRIPTORS$6 = descriptors;
500
+ var IE8_DOM_DEFINE = ie8DomDefine;
501
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
502
+ var anObject$4 = anObject$5;
503
+ var toPropertyKey = toPropertyKey$2;
504
+
505
+ var TypeError$3 = global$b.TypeError;
506
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
507
+ var $defineProperty = Object.defineProperty;
508
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
509
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
510
+ var ENUMERABLE = 'enumerable';
511
+ var CONFIGURABLE$1 = 'configurable';
512
+ var WRITABLE = 'writable';
513
+
514
+ // `Object.defineProperty` method
515
+ // https://tc39.es/ecma262/#sec-object.defineproperty
516
+ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
517
+ anObject$4(O);
518
+ P = toPropertyKey(P);
519
+ anObject$4(Attributes);
520
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
521
+ var current = $getOwnPropertyDescriptor(O, P);
522
+ if (current && current[WRITABLE]) {
523
+ O[P] = Attributes.value;
524
+ Attributes = {
525
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
526
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
527
+ writable: false
528
+ };
529
+ }
530
+ } return $defineProperty(O, P, Attributes);
531
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
532
+ anObject$4(O);
533
+ P = toPropertyKey(P);
534
+ anObject$4(Attributes);
535
+ if (IE8_DOM_DEFINE) try {
536
+ return $defineProperty(O, P, Attributes);
537
+ } catch (error) { /* empty */ }
538
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError$3('Accessors not supported');
539
+ if ('value' in Attributes) O[P] = Attributes.value;
540
+ return O;
541
+ };
542
+
543
+ var DESCRIPTORS$5 = descriptors;
544
+ var definePropertyModule$3 = objectDefineProperty;
545
+ var createPropertyDescriptor$1 = createPropertyDescriptor$3;
546
+
547
+ var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
548
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
549
+ } : function (object, key, value) {
550
+ object[key] = value;
551
+ return object;
552
+ };
553
+
554
+ var redefine$3 = {exports: {}};
555
+
556
+ var uncurryThis$6 = functionUncurryThis;
557
+ var isCallable$9 = isCallable$f;
558
+ var store$1 = sharedStore;
559
+
560
+ var functionToString = uncurryThis$6(Function.toString);
561
+
562
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
563
+ if (!isCallable$9(store$1.inspectSource)) {
564
+ store$1.inspectSource = function (it) {
565
+ return functionToString(it);
566
+ };
567
+ }
568
+
569
+ var inspectSource$2 = store$1.inspectSource;
570
+
571
+ var global$a = global$r;
572
+ var isCallable$8 = isCallable$f;
573
+ var inspectSource$1 = inspectSource$2;
574
+
575
+ var WeakMap$1 = global$a.WeakMap;
576
+
577
+ var nativeWeakMap = isCallable$8(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
578
+
579
+ var shared$1 = shared$3.exports;
580
+ var uid = uid$2;
581
+
582
+ var keys = shared$1('keys');
583
+
584
+ var sharedKey$3 = function (key) {
585
+ return keys[key] || (keys[key] = uid(key));
586
+ };
587
+
588
+ var hiddenKeys$4 = {};
589
+
590
+ var NATIVE_WEAK_MAP = nativeWeakMap;
591
+ var global$9 = global$r;
592
+ var uncurryThis$5 = functionUncurryThis;
593
+ var isObject = isObject$5;
594
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
595
+ var hasOwn$7 = hasOwnProperty_1;
596
+ var shared = sharedStore;
597
+ var sharedKey$2 = sharedKey$3;
598
+ var hiddenKeys$3 = hiddenKeys$4;
599
+
600
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
601
+ var TypeError$2 = global$9.TypeError;
602
+ var WeakMap = global$9.WeakMap;
603
+ var set, get, has;
604
+
605
+ var enforce = function (it) {
606
+ return has(it) ? get(it) : set(it, {});
607
+ };
608
+
609
+ var getterFor = function (TYPE) {
610
+ return function (it) {
611
+ var state;
612
+ if (!isObject(it) || (state = get(it)).type !== TYPE) {
613
+ throw TypeError$2('Incompatible receiver, ' + TYPE + ' required');
614
+ } return state;
615
+ };
616
+ };
617
+
618
+ if (NATIVE_WEAK_MAP || shared.state) {
619
+ var store = shared.state || (shared.state = new WeakMap());
620
+ var wmget = uncurryThis$5(store.get);
621
+ var wmhas = uncurryThis$5(store.has);
622
+ var wmset = uncurryThis$5(store.set);
623
+ set = function (it, metadata) {
624
+ if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
625
+ metadata.facade = it;
626
+ wmset(store, it, metadata);
627
+ return metadata;
628
+ };
629
+ get = function (it) {
630
+ return wmget(store, it) || {};
631
+ };
632
+ has = function (it) {
633
+ return wmhas(store, it);
634
+ };
635
+ } else {
636
+ var STATE = sharedKey$2('state');
637
+ hiddenKeys$3[STATE] = true;
638
+ set = function (it, metadata) {
639
+ if (hasOwn$7(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
640
+ metadata.facade = it;
641
+ createNonEnumerableProperty$4(it, STATE, metadata);
642
+ return metadata;
643
+ };
644
+ get = function (it) {
645
+ return hasOwn$7(it, STATE) ? it[STATE] : {};
646
+ };
647
+ has = function (it) {
648
+ return hasOwn$7(it, STATE);
649
+ };
650
+ }
651
+
652
+ var internalState = {
653
+ set: set,
654
+ get: get,
655
+ has: has,
656
+ enforce: enforce,
657
+ getterFor: getterFor
658
+ };
659
+
660
+ var DESCRIPTORS$4 = descriptors;
661
+ var hasOwn$6 = hasOwnProperty_1;
662
+
663
+ var FunctionPrototype = Function.prototype;
664
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
665
+ var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
666
+
667
+ var EXISTS = hasOwn$6(FunctionPrototype, 'name');
668
+ // additional protection from minified / mangled / dropped function names
669
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
670
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
671
+
672
+ var functionName = {
673
+ EXISTS: EXISTS,
674
+ PROPER: PROPER,
675
+ CONFIGURABLE: CONFIGURABLE
676
+ };
677
+
678
+ var global$8 = global$r;
679
+ var isCallable$7 = isCallable$f;
680
+ var hasOwn$5 = hasOwnProperty_1;
681
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
682
+ var setGlobal$1 = setGlobal$3;
683
+ var inspectSource = inspectSource$2;
684
+ var InternalStateModule$1 = internalState;
685
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
686
+
687
+ var getInternalState$1 = InternalStateModule$1.get;
688
+ var enforceInternalState = InternalStateModule$1.enforce;
689
+ var TEMPLATE = String(String).split('String');
690
+
691
+ (redefine$3.exports = function (O, key, value, options) {
692
+ var unsafe = options ? !!options.unsafe : false;
693
+ var simple = options ? !!options.enumerable : false;
694
+ var noTargetGet = options ? !!options.noTargetGet : false;
695
+ var name = options && options.name !== undefined ? options.name : key;
696
+ var state;
697
+ if (isCallable$7(value)) {
698
+ if (String(name).slice(0, 7) === 'Symbol(') {
699
+ name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
700
+ }
701
+ if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
702
+ createNonEnumerableProperty$3(value, 'name', name);
703
+ }
704
+ state = enforceInternalState(value);
705
+ if (!state.source) {
706
+ state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
707
+ }
708
+ }
709
+ if (O === global$8) {
710
+ if (simple) O[key] = value;
711
+ else setGlobal$1(key, value);
712
+ return;
713
+ } else if (!unsafe) {
714
+ delete O[key];
715
+ } else if (!noTargetGet && O[key]) {
716
+ simple = true;
717
+ }
718
+ if (simple) O[key] = value;
719
+ else createNonEnumerableProperty$3(O, key, value);
720
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
721
+ })(Function.prototype, 'toString', function toString() {
722
+ return isCallable$7(this) && getInternalState$1(this).source || inspectSource(this);
723
+ });
724
+
725
+ var objectGetOwnPropertyNames = {};
726
+
727
+ var ceil = Math.ceil;
728
+ var floor = Math.floor;
729
+
730
+ // `ToIntegerOrInfinity` abstract operation
731
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
732
+ var toIntegerOrInfinity$2 = function (argument) {
733
+ var number = +argument;
734
+ // eslint-disable-next-line no-self-compare -- safe
735
+ return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
736
+ };
737
+
738
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
739
+
740
+ var max = Math.max;
741
+ var min$1 = Math.min;
742
+
743
+ // Helper for a popular repeating case of the spec:
744
+ // Let integer be ? ToInteger(index).
745
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
746
+ var toAbsoluteIndex$1 = function (index, length) {
747
+ var integer = toIntegerOrInfinity$1(index);
748
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
749
+ };
750
+
751
+ var toIntegerOrInfinity = toIntegerOrInfinity$2;
752
+
753
+ var min = Math.min;
754
+
755
+ // `ToLength` abstract operation
756
+ // https://tc39.es/ecma262/#sec-tolength
757
+ var toLength$1 = function (argument) {
758
+ return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
759
+ };
760
+
761
+ var toLength = toLength$1;
762
+
763
+ // `LengthOfArrayLike` abstract operation
764
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
765
+ var lengthOfArrayLike$1 = function (obj) {
766
+ return toLength(obj.length);
767
+ };
768
+
769
+ var toIndexedObject$3 = toIndexedObject$5;
770
+ var toAbsoluteIndex = toAbsoluteIndex$1;
771
+ var lengthOfArrayLike = lengthOfArrayLike$1;
772
+
773
+ // `Array.prototype.{ indexOf, includes }` methods implementation
774
+ var createMethod = function (IS_INCLUDES) {
775
+ return function ($this, el, fromIndex) {
776
+ var O = toIndexedObject$3($this);
777
+ var length = lengthOfArrayLike(O);
778
+ var index = toAbsoluteIndex(fromIndex, length);
779
+ var value;
780
+ // Array#includes uses SameValueZero equality algorithm
781
+ // eslint-disable-next-line no-self-compare -- NaN check
782
+ if (IS_INCLUDES && el != el) while (length > index) {
783
+ value = O[index++];
784
+ // eslint-disable-next-line no-self-compare -- NaN check
785
+ if (value != value) return true;
786
+ // Array#indexOf ignores holes, Array#includes - not
787
+ } else for (;length > index; index++) {
788
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
789
+ } return !IS_INCLUDES && -1;
790
+ };
791
+ };
792
+
793
+ var arrayIncludes = {
794
+ // `Array.prototype.includes` method
795
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
796
+ includes: createMethod(true),
797
+ // `Array.prototype.indexOf` method
798
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
799
+ indexOf: createMethod(false)
800
+ };
801
+
802
+ var uncurryThis$4 = functionUncurryThis;
803
+ var hasOwn$4 = hasOwnProperty_1;
804
+ var toIndexedObject$2 = toIndexedObject$5;
805
+ var indexOf = arrayIncludes.indexOf;
806
+ var hiddenKeys$2 = hiddenKeys$4;
807
+
808
+ var push = uncurryThis$4([].push);
809
+
810
+ var objectKeysInternal = function (object, names) {
811
+ var O = toIndexedObject$2(object);
812
+ var i = 0;
813
+ var result = [];
814
+ var key;
815
+ for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
816
+ // Don't enum bug & hidden keys
817
+ while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
818
+ ~indexOf(result, key) || push(result, key);
819
+ }
820
+ return result;
821
+ };
822
+
823
+ // IE8- don't enum bug keys
824
+ var enumBugKeys$3 = [
825
+ 'constructor',
826
+ 'hasOwnProperty',
827
+ 'isPrototypeOf',
828
+ 'propertyIsEnumerable',
829
+ 'toLocaleString',
830
+ 'toString',
831
+ 'valueOf'
832
+ ];
833
+
834
+ var internalObjectKeys$1 = objectKeysInternal;
835
+ var enumBugKeys$2 = enumBugKeys$3;
836
+
837
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
838
+
839
+ // `Object.getOwnPropertyNames` method
840
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
841
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
842
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
843
+ return internalObjectKeys$1(O, hiddenKeys$1);
844
+ };
845
+
846
+ var objectGetOwnPropertySymbols = {};
847
+
848
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
849
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
850
+
851
+ var getBuiltIn$1 = getBuiltIn$4;
852
+ var uncurryThis$3 = functionUncurryThis;
853
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
854
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
855
+ var anObject$3 = anObject$5;
856
+
857
+ var concat$1 = uncurryThis$3([].concat);
858
+
859
+ // all object keys, includes non-enumerable and symbols
860
+ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
861
+ var keys = getOwnPropertyNamesModule.f(anObject$3(it));
862
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
863
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
864
+ };
865
+
866
+ var hasOwn$3 = hasOwnProperty_1;
867
+ var ownKeys = ownKeys$1;
868
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
869
+ var definePropertyModule$2 = objectDefineProperty;
870
+
871
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
872
+ var keys = ownKeys(source);
873
+ var defineProperty = definePropertyModule$2.f;
874
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
875
+ for (var i = 0; i < keys.length; i++) {
876
+ var key = keys[i];
877
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
878
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
879
+ }
880
+ }
881
+ };
882
+
883
+ var fails$3 = fails$a;
884
+ var isCallable$6 = isCallable$f;
885
+
886
+ var replacement = /#|\.prototype\./;
887
+
888
+ var isForced$1 = function (feature, detection) {
889
+ var value = data[normalize(feature)];
890
+ return value == POLYFILL ? true
891
+ : value == NATIVE ? false
892
+ : isCallable$6(detection) ? fails$3(detection)
893
+ : !!detection;
894
+ };
895
+
896
+ var normalize = isForced$1.normalize = function (string) {
897
+ return String(string).replace(replacement, '.').toLowerCase();
898
+ };
899
+
900
+ var data = isForced$1.data = {};
901
+ var NATIVE = isForced$1.NATIVE = 'N';
902
+ var POLYFILL = isForced$1.POLYFILL = 'P';
903
+
904
+ var isForced_1 = isForced$1;
905
+
906
+ var global$7 = global$r;
907
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
908
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
909
+ var redefine$2 = redefine$3.exports;
910
+ var setGlobal = setGlobal$3;
911
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
912
+ var isForced = isForced_1;
913
+
914
+ /*
915
+ options.target - name of the target object
916
+ options.global - target is the global object
917
+ options.stat - export as static methods of target
918
+ options.proto - export as prototype methods of target
919
+ options.real - real prototype method for the `pure` version
920
+ options.forced - export even if the native feature is available
921
+ options.bind - bind methods to the target, required for the `pure` version
922
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
923
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
924
+ options.sham - add a flag to not completely full polyfills
925
+ options.enumerable - export as enumerable property
926
+ options.noTargetGet - prevent calling a getter on target
927
+ options.name - the .name of the function if it does not match the key
928
+ */
929
+ var _export = function (options, source) {
930
+ var TARGET = options.target;
931
+ var GLOBAL = options.global;
932
+ var STATIC = options.stat;
933
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
934
+ if (GLOBAL) {
935
+ target = global$7;
936
+ } else if (STATIC) {
937
+ target = global$7[TARGET] || setGlobal(TARGET, {});
938
+ } else {
939
+ target = (global$7[TARGET] || {}).prototype;
940
+ }
941
+ if (target) for (key in source) {
942
+ sourceProperty = source[key];
943
+ if (options.noTargetGet) {
944
+ descriptor = getOwnPropertyDescriptor(target, key);
945
+ targetProperty = descriptor && descriptor.value;
946
+ } else targetProperty = target[key];
947
+ FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
948
+ // contained in target
949
+ if (!FORCED && targetProperty !== undefined) {
950
+ if (typeof sourceProperty == typeof targetProperty) continue;
951
+ copyConstructorProperties$1(sourceProperty, targetProperty);
952
+ }
953
+ // add a flag to not completely full polyfills
954
+ if (options.sham || (targetProperty && targetProperty.sham)) {
955
+ createNonEnumerableProperty$2(sourceProperty, 'sham', true);
956
+ }
957
+ // extend global
958
+ redefine$2(target, key, sourceProperty, options);
959
+ }
960
+ };
961
+
962
+ var internalObjectKeys = objectKeysInternal;
963
+ var enumBugKeys$1 = enumBugKeys$3;
964
+
965
+ // `Object.keys` method
966
+ // https://tc39.es/ecma262/#sec-object.keys
967
+ // eslint-disable-next-line es-x/no-object-keys -- safe
968
+ var objectKeys$2 = Object.keys || function keys(O) {
969
+ return internalObjectKeys(O, enumBugKeys$1);
970
+ };
971
+
972
+ var DESCRIPTORS$3 = descriptors;
973
+ var uncurryThis$2 = functionUncurryThis;
974
+ var call$1 = functionCall;
975
+ var fails$2 = fails$a;
976
+ var objectKeys$1 = objectKeys$2;
977
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
978
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
979
+ var toObject$1 = toObject$3;
980
+ var IndexedObject = indexedObject;
981
+
982
+ // eslint-disable-next-line es-x/no-object-assign -- safe
983
+ var $assign = Object.assign;
984
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
985
+ var defineProperty$3 = Object.defineProperty;
986
+ var concat = uncurryThis$2([].concat);
987
+
988
+ // `Object.assign` method
989
+ // https://tc39.es/ecma262/#sec-object.assign
990
+ var objectAssign = !$assign || fails$2(function () {
991
+ // should have correct order of operations (Edge bug)
992
+ if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
993
+ enumerable: true,
994
+ get: function () {
995
+ defineProperty$3(this, 'b', {
996
+ value: 3,
997
+ enumerable: false
998
+ });
999
+ }
1000
+ }), { b: 2 })).b !== 1) return true;
1001
+ // should work with symbols and should have deterministic property order (V8 bug)
1002
+ var A = {};
1003
+ var B = {};
1004
+ // eslint-disable-next-line es-x/no-symbol -- safe
1005
+ var symbol = Symbol();
1006
+ var alphabet = 'abcdefghijklmnopqrst';
1007
+ A[symbol] = 7;
1008
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1009
+ return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
1010
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1011
+ var T = toObject$1(target);
1012
+ var argumentsLength = arguments.length;
1013
+ var index = 1;
1014
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1015
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1016
+ while (argumentsLength > index) {
1017
+ var S = IndexedObject(arguments[index++]);
1018
+ var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1019
+ var length = keys.length;
1020
+ var j = 0;
1021
+ var key;
1022
+ while (length > j) {
1023
+ key = keys[j++];
1024
+ if (!DESCRIPTORS$3 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1025
+ }
1026
+ } return T;
1027
+ } : $assign;
1028
+
1029
+ var $$2 = _export;
1030
+ var assign = objectAssign;
1031
+
1032
+ // `Object.assign` method
1033
+ // https://tc39.es/ecma262/#sec-object.assign
1034
+ // eslint-disable-next-line es-x/no-object-assign -- required for testing
1035
+ $$2({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
1036
+ assign: assign
1037
+ });
1038
+
1039
+ /******************************************************************************
1040
+ Copyright (c) Microsoft Corporation.
16
1041
 
17
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
- PERFORMANCE OF THIS SOFTWARE.
24
- ***************************************************************************** */
1042
+ Permission to use, copy, modify, and/or distribute this software for any
1043
+ purpose with or without fee is hereby granted.
25
1044
 
26
- var __assign = function() {
27
- __assign = Object.assign || function __assign(t) {
28
- for (var s, i = 1, n = arguments.length; i < n; i++) {
29
- s = arguments[i];
30
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
31
- }
32
- return t;
33
- };
34
- return __assign.apply(this, arguments);
35
- };
1045
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1046
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1047
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1048
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1049
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1050
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1051
+ PERFORMANCE OF THIS SOFTWARE.
1052
+ ***************************************************************************** */
36
1053
 
37
- function __rest(s, e) {
38
- var t = {};
39
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
40
- t[p] = s[p];
41
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
42
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
43
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
44
- t[p[i]] = s[p[i]];
45
- }
46
- return t;
47
- }
48
-
49
- function Button(_a) {
50
- var children = _a.children,
51
- variant = _a.variant,
52
- onClick = _a.onClick,
53
- _b = _a.active,
54
- active = _b === void 0 ? false : _b,
55
- _c = _a.type,
56
- type = _c === void 0 ? 'button' : _c;
57
- var props = {
58
- type: type
59
- };
60
- var classNames = [];
61
- if (variant) classNames.push(variant);
62
- if (active) classNames.push('active');
63
- if (classNames.length) props.className = classNames.join(' ');
64
- if (onClick) props.onClick = onClick;
65
- return jsxRuntime.jsx("button", __assign({}, props, {
66
- children: children
67
- }), void 0);
68
- }
69
-
70
- var ModalHeader = function ModalHeader(_a) {
71
- var _b = _a.header,
72
- header = _b === void 0 ? '' : _b,
73
- onClose = _a.onClose;
74
-
75
- var handleClose = function handleClose(event) {
76
- if (onClose) onClose(event);
77
- };
78
-
79
- return jsxRuntime.jsxs("div", __assign({
80
- className: "header"
81
- }, {
82
- children: [jsxRuntime.jsx("h3", {
83
- children: header
84
- }, void 0), jsxRuntime.jsx("button", __assign({
85
- className: "close",
86
- onClick: handleClose
87
- }, {
88
- children: jsxRuntime.jsx("span", __assign({
89
- className: "sr-only"
90
- }, {
91
- children: "Close"
92
- }), void 0)
93
- }), void 0)]
94
- }), void 0);
95
- };
96
-
97
- var ModalBody = function ModalBody(_a) {
98
- var children = _a.children;
99
- return jsxRuntime.jsx("div", __assign({
100
- className: "body"
101
- }, {
102
- children: children
103
- }), void 0);
104
- };
105
-
106
- var ModalFooter = function ModalFooter(_a) {
107
- var confirm = _a.confirm,
108
- dismiss = _a.dismiss,
109
- onClose = _a.onClose,
110
- onConfirm = _a.onConfirm,
111
- onDismiss = _a.onDismiss;
112
-
113
- var handleConfirm = function handleConfirm(event) {
114
- if (onConfirm) onConfirm(event);
115
- if (onClose) onClose(event);
116
- };
117
-
118
- var handleDismiss = function handleDismiss(event) {
119
- if (onDismiss) onDismiss(event);
120
- if (onClose) onClose(event);
121
- };
122
-
123
- return jsxRuntime.jsxs("div", __assign({
124
- className: "footer"
125
- }, {
126
- children: [dismiss && jsxRuntime.jsx(Button, __assign({
127
- variant: "secondary",
128
- onClick: handleDismiss
129
- }, {
130
- children: dismiss
131
- }), void 0), confirm && jsxRuntime.jsx(Button, __assign({
132
- variant: "primary",
133
- onClick: handleConfirm
134
- }, {
135
- children: confirm
136
- }), void 0)]
137
- }), void 0);
138
- };
139
-
140
- var Modal = function Modal(_a) {
141
- var _b = _a.type,
142
- type = _b === void 0 ? 'default' : _b,
143
- isOpen = _a.isOpen,
144
- props = __rest(_a, ["type", "isOpen"]);
145
-
146
- var modalContent = function modalContent() {
147
- switch (type) {
148
- case 'slideout':
149
- {
150
- return jsxRuntime.jsxs("aside", __assign({
151
- role: "dialog"
152
- }, {
153
- children: [jsxRuntime.jsx(ModalHeader, __assign({}, props), void 0), jsxRuntime.jsx(ModalBody, __assign({}, props), void 0), jsxRuntime.jsx(ModalFooter, __assign({}, props), void 0)]
154
- }), void 0);
155
- }
156
-
157
- case 'takeover':
158
- {
159
- return jsxRuntime.jsxs("main", __assign({
160
- role: "dialog"
161
- }, {
162
- children: [jsxRuntime.jsx(ModalHeader, __assign({}, props), void 0), jsxRuntime.jsx(ModalBody, __assign({}, props), void 0), jsxRuntime.jsx(ModalFooter, __assign({}, props), void 0)]
163
- }), void 0);
164
- }
165
-
166
- default:
167
- {
168
- return jsxRuntime.jsxs("section", __assign({
169
- role: "dialog"
170
- }, {
171
- children: [jsxRuntime.jsx(ModalHeader, __assign({}, props), void 0), jsxRuntime.jsx(ModalBody, __assign({}, props), void 0), jsxRuntime.jsx(ModalFooter, __assign({}, props), void 0)]
172
- }), void 0);
173
- }
174
- }
175
- };
176
-
177
- return isOpen ? modalContent() : null;
178
- };
179
-
180
- var Flexbox = function Flexbox(_a) {
181
- var alignContent = _a.alignContent,
182
- alignItems = _a.alignItems,
183
- alignSelf = _a.alignSelf,
184
- children = _a.children,
185
- justifyContent = _a.justifyContent,
186
- flexDirection = _a.flexDirection,
187
- flexWrap = _a.flexWrap,
188
- className = _a.className,
189
- props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
190
-
191
- var _b = React.useState(['d-flex']),
192
- classes = _b[0],
193
- setClasses = _b[1];
194
-
195
- var _c = React.useState('d-flex'),
196
- flexClassName = _c[0],
197
- setFlexClassName = _c[1]; // // update className when classes change
198
-
199
-
200
- React.useLayoutEffect(function () {
201
- var newClassName = classes.join(' ');
202
- if (newClassName !== flexClassName) setFlexClassName(newClassName);
203
- }, [classes, flexClassName]); // // update classes when props change
204
-
205
- React.useLayoutEffect(function () {
206
- var newClasses = ['d-flex'];
207
- alignItems && newClasses.push("align-items-".concat(alignItems));
208
- alignContent && newClasses.push("align-content-".concat(alignContent));
209
- alignSelf && newClasses.push("align-self-".concat(alignSelf));
210
- justifyContent && newClasses.push("justify-content-".concat(justifyContent));
211
- flexDirection && newClasses.push("flex-".concat(flexDirection));
212
- flexWrap && newClasses.push("flex-".concat(flexWrap));
213
- className && newClasses.push(className);
214
- setClasses(newClasses);
215
- }, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
216
- return jsxRuntime.jsx("div", __assign({
217
- className: flexClassName
218
- }, props, {
219
- children: children
220
- }), void 0);
221
- };
222
-
223
- function Card(_a) {
224
- var children = _a.children,
225
- header = _a.header,
226
- footer = _a.footer;
227
- return jsxRuntime.jsxs("section", __assign({
228
- className: "card"
229
- }, {
230
- children: [jsxRuntime.jsx("header", {
231
- children: header
232
- }, void 0), jsxRuntime.jsx("p", {
233
- children: children
234
- }, void 0), jsxRuntime.jsx("footer", {
235
- children: footer
236
- }, void 0)]
237
- }), void 0);
238
- }
239
-
240
- function Alert(_a) {
241
- var type = _a.type,
242
- header = _a.header,
243
- footer = _a.footer,
244
- children = _a.children,
245
- closeText = _a.closeText,
246
- _b = _a.isCloseable,
247
- isCloseable = _b === void 0 ? true : _b;
248
-
249
- var _c = React.useState(),
250
- closeButton = _c[0],
251
- setCloseButton = _c[1];
252
-
253
- React.useEffect(function () {
254
- if (!isCloseable) {
255
- setCloseButton(null);
256
- } else {
257
- if (closeText) setCloseButton(jsxRuntime.jsx(Button, __assign({
258
- variant: "ghost"
259
- }, {
260
- children: jsxRuntime.jsx("span", __assign({
261
- className: "sr-only"
262
- }, {
263
- children: closeText
264
- }), void 0)
265
- }), void 0));else setCloseButton(jsxRuntime.jsx("button", {
266
- className: "close"
267
- }, void 0));
268
- }
269
- }, [isCloseable, closeText]);
270
- return jsxRuntime.jsxs("div", __assign({
271
- role: "alert",
272
- className: type
273
- }, {
274
- children: [header && jsxRuntime.jsxs("header", {
275
- children: [/*#__PURE__*/React__default["default"].isValidElement(header) ? header : jsxRuntime.jsx("h3", {
276
- children: header
277
- }, void 0), closeButton]
278
- }, void 0), jsxRuntime.jsx("p", {
279
- children: children
280
- }, void 0), footer && jsxRuntime.jsx("footer", {
281
- children: footer
282
- }, void 0)]
283
- }), void 0);
284
- }
285
-
286
- var ButtonGroup = function ButtonGroup(_a) {
287
- var children = _a.children,
288
- selectedIndex = _a.selectedIndex,
289
- variant = _a.variant;
290
-
291
- var _b = React.useState(selectedIndex),
292
- selected = _b[0],
293
- setSelected = _b[1];
294
-
295
- var _c = React.useState([]),
296
- buttons = _c[0],
297
- setButtons = _c[1];
298
-
299
- React.useEffect(function () {
300
- var buttonProps = (children instanceof Array ? children : [children]).filter(function (b) {
301
- return b && b.props;
302
- }).map(function (b, ix) {
303
- var bp = b.props;
304
-
305
- var props = __assign(__assign({}, bp), {
306
- variant: variant,
307
- key: bp.key || "btn_".concat(ix),
308
- active: ix === selected,
309
- onClick: function (e) {
310
- setSelected(ix);
311
- if (bp.onClick) bp.onClick(e);
312
- }
313
- });
314
-
315
- return props;
316
- });
317
- setButtons(buttonProps);
318
- }, [children, selected, variant]);
319
- return jsxRuntime.jsx(Group, {
320
- children: buttons.map(function (props) {
321
- return jsxRuntime.jsx(Button, __assign({}, props), props.key);
322
- })
323
- }, void 0);
324
- };
325
-
326
- var validateInputValue = function validateInputValue(target, rules, setError) {
327
- var errorMessage = validateInputValueErrors(rules, target);
328
- errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
329
- return errorMessage;
330
- };
331
-
332
- var validateInputValueErrors = function validateInputValueErrors(rules, target) {
333
- var value = target.value;
334
-
335
- if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
336
- return rules === null || rules === void 0 ? void 0 : rules.custom();
337
- }
338
-
339
- return validateTextInputValues(value, rules);
340
- };
341
-
342
- var setErrorInsert = function setErrorInsert(setError, name) {
343
- setError(function (errors) {
344
- var _a;
345
-
346
- return __assign(__assign({}, errors), (_a = {}, _a[name] = true, _a));
347
- });
348
- };
349
-
350
- var setErrorRemove = function setErrorRemove(setError, name) {
351
- setError(function (errors) {
352
- var newError = __assign({}, errors);
353
-
354
- delete newError[name];
355
- return newError;
356
- });
357
- };
358
-
359
- var validateTextInputValues = function validateTextInputValues(value, rules) {
360
- switch (rules === null || rules === void 0 ? void 0 : rules.type) {
361
- case 'Required':
362
- {
363
- return value === '' || value === undefined || value === null ? 'error' : null;
364
- }
365
-
366
- default:
367
- {
368
- return;
369
- }
370
- }
371
- };
372
-
373
- var FormContext = /*#__PURE__*/React__default["default"].createContext({});
374
- var useFormContext = function useFormContext() {
375
- return React__default["default"].useContext(FormContext);
376
- };
377
- var FormProvider = function FormProvider(_a) {
378
- var children = _a.children,
379
- _b = _a.direction,
380
- direction = _b === void 0 ? 'vertical' : _b,
381
- _c = _a.formSize,
382
- formSize = _c === void 0 ? 'md' : _c;
383
- _a.onSubmit;
384
- var onFormSubmit = _a.onFormSubmit,
385
- props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
386
-
387
- var _d = React__default["default"].useState(),
388
- values = _d[0],
389
- setValues = _d[1];
390
-
391
- var _e = React__default["default"].useState(),
392
- errors = _e[0],
393
- setErrors = _e[1];
394
-
395
- var _f = React__default["default"].useState({}),
396
- fields = _f[0],
397
- setFields = _f[1];
398
-
399
- var formSubmit = function formSubmit(event) {
400
- var hasError = false;
401
- event.preventDefault();
402
- Object.keys(fields).forEach(function (key) {
403
- var errorMessage = validateInputValue({
404
- name: key,
405
- value: values === null || values === void 0 ? void 0 : values[key]
406
- }, fields[key], setErrors);
407
- hasError = hasError || !!errorMessage;
408
- });
409
-
410
- if (!hasError) {
411
- onFormSubmit && onFormSubmit(values);
412
- }
413
- };
414
-
415
- var resetForm = function resetForm() {
416
- setValues({});
417
- setErrors({});
418
- };
419
-
420
- return jsxRuntime.jsx(FormContext.Provider, __assign({
421
- value: {
422
- setValues: setValues,
423
- setErrors: setErrors,
424
- setFields: setFields,
425
- errors: errors,
426
- values: values
427
- }
428
- }, {
429
- children: jsxRuntime.jsx("form", __assign({
430
- className: [direction, "size-".concat(formSize)].join(' '),
431
- onSubmit: formSubmit
432
- }, props, {
433
- onReset: resetForm
434
- }, {
435
- children: children
436
- }), void 0)
437
- }), void 0);
438
- };
439
-
440
- var Form = function Form(props) {
441
- return jsxRuntime.jsx(FormProvider, __assign({}, props), void 0);
442
- };
443
-
444
- var FormItems = function FormItems(_a) {
445
- var children = _a.children,
446
- validate = _a.validate,
447
- name = _a.name;
448
-
449
- var _b = useFormContext(),
450
- setValues = _b.setValues,
451
- setErrors = _b.setErrors,
452
- setFields = _b.setFields,
453
- errors = _b.errors;
454
-
455
- React__default["default"].useEffect(function () {
456
- setFields(function (fields) {
457
- var _a;
458
-
459
- return __assign(__assign({}, fields), (_a = {}, _a[name] = validate === null || validate === void 0 ? void 0 : validate.rules, _a));
460
- });
461
-
462
- var removeValues = function removeValues(values) {
463
- var newValues = __assign({}, values);
464
-
465
- delete newValues[name];
466
- return newValues;
467
- };
468
-
469
- return function () {
470
- setFields(function (fields) {
471
- return removeValues(fields);
472
- });
473
- setValues(function (values) {
474
- return removeValues(values);
475
- });
476
- setErrors(function (errors) {
477
- return removeValues(errors);
478
- });
479
- };
480
- }, []);
481
-
482
- var onChange = function onChange(event) {
483
- var _a = event.target,
484
- value = _a.value,
485
- name = _a.name,
486
- type = _a.type,
487
- checked = _a.checked;
488
- var inputValue;
489
-
490
- if (type === 'checkbox') {
491
- inputValue = checked ? value : null;
492
- checked ? setValues(function (values) {
493
- var _a;
494
-
495
- return __assign(__assign({}, values), (_a = {}, _a[name] = value, _a));
496
- }) : setValues(function (values) {
497
- var _a;
498
-
499
- return __assign(__assign({}, values), (_a = {}, _a[name] = null, _a));
500
- });
501
- } else {
502
- inputValue = value;
503
- setValues(function (values) {
504
- var _a;
505
-
506
- return __assign(__assign({}, values), (_a = {}, _a[name] = value, _a));
507
- });
508
- }
509
-
510
- validateInputValue({
511
- value: inputValue,
512
- name: name,
513
- type: type,
514
- checked: checked
515
- }, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
516
- };
517
-
518
- return /*#__PURE__*/React__default["default"].cloneElement(children, {
519
- validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
520
- name: name,
521
- onChange: onChange
522
- });
523
- };
524
-
525
- function Group(_a) {
526
- var children = _a.children,
527
- error = _a.error,
528
- _b = _a.groupBorder,
529
- groupBorder = _b === void 0 ? false : _b;
530
- var groupClassName = "group ".concat(groupBorder ? 'group-border' : '', " ").concat(error ? 'is-invalid' : '');
531
- var errorMessage = error ? error.message || error : '';
532
- return jsxRuntime.jsxs("div", __assign({
533
- className: "form-group"
534
- }, {
535
- children: [jsxRuntime.jsx("div", __assign({
536
- className: groupClassName
537
- }, {
538
- children: children
539
- }), void 0), error && jsxRuntime.jsx("span", __assign({
540
- className: "form-info"
541
- }, {
542
- children: errorMessage
543
- }), void 0)]
544
- }), void 0);
545
- }
546
-
547
- var useInput = function useInput(props, onChanges, onChangeInput) {
548
- var id = React.useMemo(function () {
549
- return props.id || extract.randomId();
550
- }, [props.id]);
551
- var ref = React.useRef(null);
552
-
553
- var _a = React.useState(props.value ? props.value : ''),
554
- value = _a[0],
555
- setValue = _a[1];
556
-
557
- var _b = React.useState(props.checked ? props.checked : false),
558
- checked = _b[0],
559
- setChecked = _b[1];
560
-
561
- React.useEffect(function () {
562
- if (ref.current && ref.current.form) {
563
- var resetListener_1 = function resetListener_1() {
564
- setValue(props.value ? props.value : '');
565
- setChecked(props.checked ? props.checked : false);
566
- };
567
-
568
- var form_1 = ref.current.form;
569
- form_1.addEventListener('reset', resetListener_1);
570
- return function () {
571
- return form_1.removeEventListener('reset', resetListener_1);
572
- };
573
- } else {
574
- // eslint-disable-next-line @typescript-eslint/no-empty-function
575
- return function () {};
576
- }
577
- }, [props]);
578
-
579
- var onChange = function onChange(event) {
580
- setValue(event.target.value);
581
- setChecked(event.currentTarget.checked);
582
- onChanges && onChanges(event);
583
- onChangeInput && onChangeInput(event.target.value);
584
- };
585
-
586
- return __assign(__assign({}, props), {
587
- id: id,
588
- ref: ref,
589
- value: value,
590
- checked: checked,
591
- onChange: onChange
592
- });
593
- };
594
-
595
- var RenderInput = function RenderInput(type, props, onChange, onChangeInput, label, info, validator) {
596
- var _a = useInput(props, onChange, onChangeInput),
597
- value = _a.value,
598
- inputProps = __rest(_a, ["value"]);
599
-
600
- var propsWithDescription = info ? __assign(__assign({}, inputProps), {
601
- 'aria-describedby': "".concat(inputProps.id, "_info")
602
- }) : inputProps; // Render naked
603
-
604
- if (!label && !info) return jsxRuntime.jsx("input", __assign({
605
- type: type,
606
- value: value
607
- }, propsWithDescription), void 0);
608
- return jsxRuntime.jsxs("div", __assign({
609
- className: "form-group"
610
- }, {
611
- children: [label && jsxRuntime.jsx("label", __assign({
612
- htmlFor: inputProps.id
613
- }, {
614
- children: label
615
- }), void 0), info && jsxRuntime.jsx("span", __assign({
616
- className: "form-info",
617
- id: "".concat(inputProps.id, "_info")
618
- }, {
619
- children: info
620
- }), void 0), jsxRuntime.jsx("input", __assign({
621
- type: type,
622
- value: value
623
- }, propsWithDescription, {
624
- className: validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
625
- }), void 0), validator && jsxRuntime.jsx("span", __assign({
626
- className: "form-info"
627
- }, {
628
- children: validator.message
629
- }), void 0)]
630
- }), void 0);
631
- };
632
- var TextInput = function TextInput(_a) {
633
- var label = _a.label,
634
- info = _a.info,
635
- onChange = _a.onChange,
636
- onChangeInput = _a.onChangeInput,
637
- validator = _a.validator,
638
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
639
-
640
- return RenderInput('text', props, onChange, onChangeInput, label, info, validator);
641
- };
642
- var EmailInput = function EmailInput(_a) {
643
- var label = _a.label,
644
- info = _a.info,
645
- onChange = _a.onChange,
646
- onChangeInput = _a.onChangeInput,
647
- validator = _a.validator,
648
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
649
-
650
- return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
651
- };
652
- var NumberInput = function NumberInput(_a) {
653
- var label = _a.label,
654
- info = _a.info,
655
- onChange = _a.onChange,
656
- onChangeInput = _a.onChangeInput,
657
- validator = _a.validator,
658
- props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
659
-
660
- return RenderInput('number', props, onChange, onChangeInput, label, info, validator);
661
- };
662
- var Checkbox = function Checkbox(_a) {
663
- var label = _a.label,
664
- onChange = _a.onChange,
665
- validator = _a.validator,
666
- props = __rest(_a, ["label", "onChange", "validator"]);
667
-
668
- var inputProps = useInput(props, onChange);
669
- var validatorClassName = extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
670
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
671
- children: [jsxRuntime.jsxs("label", __assign({
672
- htmlFor: inputProps.id,
673
- className: "form-control ".concat(validatorClassName)
674
- }, {
675
- children: [label, jsxRuntime.jsx("input", __assign({
676
- type: "checkbox"
677
- }, inputProps), void 0), jsxRuntime.jsx("span", {}, void 0), jsxRuntime.jsx("i", {}, void 0)]
678
- }), void 0), validator && jsxRuntime.jsx("span", __assign({
679
- className: "form-info"
680
- }, {
681
- children: validator.message
682
- }), void 0)]
683
- }, void 0);
684
- };
685
- var RadioButton = /*#__PURE__*/React__default["default"].forwardRef(function (_a, ref) {
686
- var label = _a.label,
687
- validator = _a.validator,
688
- props = __rest(_a, ["label", "validator"]);
689
-
690
- var id = useInput(props).id;
691
- return jsxRuntime.jsxs("label", __assign({
692
- htmlFor: id,
693
- className: "form-control"
694
- }, {
695
- children: [jsxRuntime.jsx("input", __assign({
696
- id: id,
697
- type: "radio"
698
- }, props, {
699
- className: validator,
700
- ref: ref
701
- }), void 0), jsxRuntime.jsx("span", {
702
- children: label
703
- }, void 0), jsxRuntime.jsx("i", {}, void 0)]
704
- }), void 0);
705
- });
706
-
707
- var Text = function Text(_a) {
708
- var children = _a.children;
709
- return jsxRuntime.jsx("span", __assign({
710
- className: "form-text"
711
- }, {
712
- children: children
713
- }), void 0);
714
- };
715
-
716
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
717
-
718
- var check = function (it) {
719
- return it && it.Math == Math && it;
720
- };
721
-
722
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
723
- var global$o =
724
- // eslint-disable-next-line es/no-global-this -- safe
725
- check(typeof globalThis == 'object' && globalThis) ||
726
- check(typeof window == 'object' && window) ||
727
- // eslint-disable-next-line no-restricted-globals -- safe
728
- check(typeof self == 'object' && self) ||
729
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
730
- // eslint-disable-next-line no-new-func -- fallback
731
- (function () { return this; })() || Function('return this')();
732
-
733
- var objectGetOwnPropertyDescriptor = {};
734
-
735
- var fails$7 = function (exec) {
736
- try {
737
- return !!exec();
738
- } catch (error) {
739
- return true;
740
- }
741
- };
742
-
743
- var fails$6 = fails$7;
744
-
745
- // Detect IE8's incomplete defineProperty implementation
746
- var descriptors = !fails$6(function () {
747
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
748
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
749
- });
750
-
751
- var fails$5 = fails$7;
752
-
753
- var functionBindNative = !fails$5(function () {
754
- var test = (function () { /* empty */ }).bind();
755
- // eslint-disable-next-line no-prototype-builtins -- safe
756
- return typeof test != 'function' || test.hasOwnProperty('prototype');
757
- });
758
-
759
- var NATIVE_BIND$1 = functionBindNative;
760
-
761
- var call$4 = Function.prototype.call;
762
-
763
- var functionCall = NATIVE_BIND$1 ? call$4.bind(call$4) : function () {
764
- return call$4.apply(call$4, arguments);
765
- };
766
-
767
- var objectPropertyIsEnumerable = {};
768
-
769
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
770
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
771
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
772
-
773
- // Nashorn ~ JDK8 bug
774
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
775
-
776
- // `Object.prototype.propertyIsEnumerable` method implementation
777
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
778
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
779
- var descriptor = getOwnPropertyDescriptor$1(this, V);
780
- return !!descriptor && descriptor.enumerable;
781
- } : $propertyIsEnumerable;
782
-
783
- var createPropertyDescriptor$2 = function (bitmap, value) {
784
- return {
785
- enumerable: !(bitmap & 1),
786
- configurable: !(bitmap & 2),
787
- writable: !(bitmap & 4),
788
- value: value
789
- };
790
- };
791
-
792
- var NATIVE_BIND = functionBindNative;
793
-
794
- var FunctionPrototype$1 = Function.prototype;
795
- var bind = FunctionPrototype$1.bind;
796
- var call$3 = FunctionPrototype$1.call;
797
- var uncurryThis$a = NATIVE_BIND && bind.bind(call$3, call$3);
798
-
799
- var functionUncurryThis = NATIVE_BIND ? function (fn) {
800
- return fn && uncurryThis$a(fn);
801
- } : function (fn) {
802
- return fn && function () {
803
- return call$3.apply(fn, arguments);
804
- };
805
- };
806
-
807
- var uncurryThis$9 = functionUncurryThis;
808
-
809
- var toString$3 = uncurryThis$9({}.toString);
810
- var stringSlice$1 = uncurryThis$9(''.slice);
811
-
812
- var classofRaw$1 = function (it) {
813
- return stringSlice$1(toString$3(it), 8, -1);
814
- };
815
-
816
- var global$n = global$o;
817
- var uncurryThis$8 = functionUncurryThis;
818
- var fails$4 = fails$7;
819
- var classof$2 = classofRaw$1;
820
-
821
- var Object$4 = global$n.Object;
822
- var split = uncurryThis$8(''.split);
823
-
824
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
825
- var indexedObject = fails$4(function () {
826
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
827
- // eslint-disable-next-line no-prototype-builtins -- safe
828
- return !Object$4('z').propertyIsEnumerable(0);
829
- }) ? function (it) {
830
- return classof$2(it) == 'String' ? split(it, '') : Object$4(it);
831
- } : Object$4;
832
-
833
- var global$m = global$o;
834
-
835
- var TypeError$7 = global$m.TypeError;
836
-
837
- // `RequireObjectCoercible` abstract operation
838
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
839
- var requireObjectCoercible$2 = function (it) {
840
- if (it == undefined) throw TypeError$7("Can't call method on " + it);
841
- return it;
842
- };
843
-
844
- // toObject with fallback for non-array-like ES3 strings
845
- var IndexedObject = indexedObject;
846
- var requireObjectCoercible$1 = requireObjectCoercible$2;
847
-
848
- var toIndexedObject$3 = function (it) {
849
- return IndexedObject(requireObjectCoercible$1(it));
850
- };
851
-
852
- // `IsCallable` abstract operation
853
- // https://tc39.es/ecma262/#sec-iscallable
854
- var isCallable$b = function (argument) {
855
- return typeof argument == 'function';
856
- };
857
-
858
- var isCallable$a = isCallable$b;
859
-
860
- var isObject$5 = function (it) {
861
- return typeof it == 'object' ? it !== null : isCallable$a(it);
862
- };
863
-
864
- var global$l = global$o;
865
- var isCallable$9 = isCallable$b;
866
-
867
- var aFunction = function (argument) {
868
- return isCallable$9(argument) ? argument : undefined;
869
- };
870
-
871
- var getBuiltIn$3 = function (namespace, method) {
872
- return arguments.length < 2 ? aFunction(global$l[namespace]) : global$l[namespace] && global$l[namespace][method];
873
- };
874
-
875
- var uncurryThis$7 = functionUncurryThis;
876
-
877
- var objectIsPrototypeOf = uncurryThis$7({}.isPrototypeOf);
878
-
879
- var getBuiltIn$2 = getBuiltIn$3;
880
-
881
- var engineUserAgent = getBuiltIn$2('navigator', 'userAgent') || '';
882
-
883
- var global$k = global$o;
884
- var userAgent = engineUserAgent;
885
-
886
- var process = global$k.process;
887
- var Deno = global$k.Deno;
888
- var versions = process && process.versions || Deno && Deno.version;
889
- var v8 = versions && versions.v8;
890
- var match, version;
891
-
892
- if (v8) {
893
- match = v8.split('.');
894
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
895
- // but their correct versions are not interesting for us
896
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
897
- }
898
-
899
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
900
- // so check `userAgent` even if `.v8` exists, but 0
901
- if (!version && userAgent) {
902
- match = userAgent.match(/Edge\/(\d+)/);
903
- if (!match || match[1] >= 74) {
904
- match = userAgent.match(/Chrome\/(\d+)/);
905
- if (match) version = +match[1];
906
- }
907
- }
908
-
909
- var engineV8Version = version;
910
-
911
- /* eslint-disable es/no-symbol -- required for testing */
912
-
913
- var V8_VERSION = engineV8Version;
914
- var fails$3 = fails$7;
915
-
916
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
917
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$3(function () {
918
- var symbol = Symbol();
919
- // Chrome 38 Symbol has incorrect toString conversion
920
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
921
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
922
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
923
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
924
- });
925
-
926
- /* eslint-disable es/no-symbol -- required for testing */
927
-
928
- var NATIVE_SYMBOL$2 = nativeSymbol;
929
-
930
- var useSymbolAsUid = NATIVE_SYMBOL$2
931
- && !Symbol.sham
932
- && typeof Symbol.iterator == 'symbol';
933
-
934
- var global$j = global$o;
935
- var getBuiltIn$1 = getBuiltIn$3;
936
- var isCallable$8 = isCallable$b;
937
- var isPrototypeOf$1 = objectIsPrototypeOf;
938
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
939
-
940
- var Object$3 = global$j.Object;
941
-
942
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
943
- return typeof it == 'symbol';
944
- } : function (it) {
945
- var $Symbol = getBuiltIn$1('Symbol');
946
- return isCallable$8($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$3(it));
947
- };
948
-
949
- var global$i = global$o;
950
-
951
- var String$3 = global$i.String;
952
-
953
- var tryToString$1 = function (argument) {
954
- try {
955
- return String$3(argument);
956
- } catch (error) {
957
- return 'Object';
958
- }
959
- };
960
-
961
- var global$h = global$o;
962
- var isCallable$7 = isCallable$b;
963
- var tryToString = tryToString$1;
964
-
965
- var TypeError$6 = global$h.TypeError;
966
-
967
- // `Assert: IsCallable(argument) is true`
968
- var aCallable$1 = function (argument) {
969
- if (isCallable$7(argument)) return argument;
970
- throw TypeError$6(tryToString(argument) + ' is not a function');
971
- };
972
-
973
- var aCallable = aCallable$1;
974
-
975
- // `GetMethod` abstract operation
976
- // https://tc39.es/ecma262/#sec-getmethod
977
- var getMethod$1 = function (V, P) {
978
- var func = V[P];
979
- return func == null ? undefined : aCallable(func);
980
- };
981
-
982
- var global$g = global$o;
983
- var call$2 = functionCall;
984
- var isCallable$6 = isCallable$b;
985
- var isObject$4 = isObject$5;
986
-
987
- var TypeError$5 = global$g.TypeError;
988
-
989
- // `OrdinaryToPrimitive` abstract operation
990
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
991
- var ordinaryToPrimitive$1 = function (input, pref) {
992
- var fn, val;
993
- if (pref === 'string' && isCallable$6(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
994
- if (isCallable$6(fn = input.valueOf) && !isObject$4(val = call$2(fn, input))) return val;
995
- if (pref !== 'string' && isCallable$6(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
996
- throw TypeError$5("Can't convert object to primitive value");
997
- };
998
-
999
- var shared$3 = {exports: {}};
1000
-
1001
- var global$f = global$o;
1002
-
1003
- // eslint-disable-next-line es/no-object-defineproperty -- safe
1004
- var defineProperty$1 = Object.defineProperty;
1005
-
1006
- var setGlobal$3 = function (key, value) {
1007
- try {
1008
- defineProperty$1(global$f, key, { value: value, configurable: true, writable: true });
1009
- } catch (error) {
1010
- global$f[key] = value;
1011
- } return value;
1012
- };
1013
-
1014
- var global$e = global$o;
1015
- var setGlobal$2 = setGlobal$3;
1016
-
1017
- var SHARED = '__core-js_shared__';
1018
- var store$3 = global$e[SHARED] || setGlobal$2(SHARED, {});
1019
-
1020
- var sharedStore = store$3;
1021
-
1022
- var store$2 = sharedStore;
1023
-
1024
- (shared$3.exports = function (key, value) {
1025
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
1026
- })('versions', []).push({
1027
- version: '3.21.1',
1028
- mode: 'global',
1029
- copyright: 2014-2022 Denis Pushkarev (zloirock.ru)',
1030
- license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
1031
- source: 'https://github.com/zloirock/core-js'
1032
- });
1033
-
1034
- var global$d = global$o;
1035
- var requireObjectCoercible = requireObjectCoercible$2;
1036
-
1037
- var Object$2 = global$d.Object;
1038
-
1039
- // `ToObject` abstract operation
1040
- // https://tc39.es/ecma262/#sec-toobject
1041
- var toObject$1 = function (argument) {
1042
- return Object$2(requireObjectCoercible(argument));
1043
- };
1044
-
1045
- var uncurryThis$6 = functionUncurryThis;
1046
- var toObject = toObject$1;
1047
-
1048
- var hasOwnProperty = uncurryThis$6({}.hasOwnProperty);
1049
-
1050
- // `HasOwnProperty` abstract operation
1051
- // https://tc39.es/ecma262/#sec-hasownproperty
1052
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
1053
- return hasOwnProperty(toObject(it), key);
1054
- };
1055
-
1056
- var uncurryThis$5 = functionUncurryThis;
1057
-
1058
- var id = 0;
1059
- var postfix = Math.random();
1060
- var toString$2 = uncurryThis$5(1.0.toString);
1061
-
1062
- var uid$2 = function (key) {
1063
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
1064
- };
1065
-
1066
- var global$c = global$o;
1067
- var shared$2 = shared$3.exports;
1068
- var hasOwn$7 = hasOwnProperty_1;
1069
- var uid$1 = uid$2;
1070
- var NATIVE_SYMBOL$1 = nativeSymbol;
1071
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
1072
-
1073
- var WellKnownSymbolsStore = shared$2('wks');
1074
- var Symbol$1 = global$c.Symbol;
1075
- var symbolFor = Symbol$1 && Symbol$1['for'];
1076
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
1077
-
1078
- var wellKnownSymbol$3 = function (name) {
1079
- if (!hasOwn$7(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
1080
- var description = 'Symbol.' + name;
1081
- if (NATIVE_SYMBOL$1 && hasOwn$7(Symbol$1, name)) {
1082
- WellKnownSymbolsStore[name] = Symbol$1[name];
1083
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
1084
- WellKnownSymbolsStore[name] = symbolFor(description);
1085
- } else {
1086
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
1087
- }
1088
- } return WellKnownSymbolsStore[name];
1089
- };
1090
-
1091
- var global$b = global$o;
1092
- var call$1 = functionCall;
1093
- var isObject$3 = isObject$5;
1094
- var isSymbol$1 = isSymbol$2;
1095
- var getMethod = getMethod$1;
1096
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
1097
- var wellKnownSymbol$2 = wellKnownSymbol$3;
1098
-
1099
- var TypeError$4 = global$b.TypeError;
1100
- var TO_PRIMITIVE = wellKnownSymbol$2('toPrimitive');
1101
-
1102
- // `ToPrimitive` abstract operation
1103
- // https://tc39.es/ecma262/#sec-toprimitive
1104
- var toPrimitive$1 = function (input, pref) {
1105
- if (!isObject$3(input) || isSymbol$1(input)) return input;
1106
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
1107
- var result;
1108
- if (exoticToPrim) {
1109
- if (pref === undefined) pref = 'default';
1110
- result = call$1(exoticToPrim, input, pref);
1111
- if (!isObject$3(result) || isSymbol$1(result)) return result;
1112
- throw TypeError$4("Can't convert object to primitive value");
1113
- }
1114
- if (pref === undefined) pref = 'number';
1115
- return ordinaryToPrimitive(input, pref);
1116
- };
1117
-
1118
- var toPrimitive = toPrimitive$1;
1119
- var isSymbol = isSymbol$2;
1120
-
1121
- // `ToPropertyKey` abstract operation
1122
- // https://tc39.es/ecma262/#sec-topropertykey
1123
- var toPropertyKey$2 = function (argument) {
1124
- var key = toPrimitive(argument, 'string');
1125
- return isSymbol(key) ? key : key + '';
1126
- };
1127
-
1128
- var global$a = global$o;
1129
- var isObject$2 = isObject$5;
1130
-
1131
- var document = global$a.document;
1132
- // typeof document.createElement is 'object' in old IE
1133
- var EXISTS$1 = isObject$2(document) && isObject$2(document.createElement);
1134
-
1135
- var documentCreateElement = function (it) {
1136
- return EXISTS$1 ? document.createElement(it) : {};
1137
- };
1138
-
1139
- var DESCRIPTORS$6 = descriptors;
1140
- var fails$2 = fails$7;
1141
- var createElement = documentCreateElement;
1142
-
1143
- // Thanks to IE8 for its funny defineProperty
1144
- var ie8DomDefine = !DESCRIPTORS$6 && !fails$2(function () {
1145
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1146
- return Object.defineProperty(createElement('div'), 'a', {
1147
- get: function () { return 7; }
1148
- }).a != 7;
1149
- });
1150
-
1151
- var DESCRIPTORS$5 = descriptors;
1152
- var call = functionCall;
1153
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1154
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
1155
- var toIndexedObject$2 = toIndexedObject$3;
1156
- var toPropertyKey$1 = toPropertyKey$2;
1157
- var hasOwn$6 = hasOwnProperty_1;
1158
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
1159
-
1160
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1161
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
1162
-
1163
- // `Object.getOwnPropertyDescriptor` method
1164
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
1165
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
1166
- O = toIndexedObject$2(O);
1167
- P = toPropertyKey$1(P);
1168
- if (IE8_DOM_DEFINE$1) try {
1169
- return $getOwnPropertyDescriptor$1(O, P);
1170
- } catch (error) { /* empty */ }
1171
- if (hasOwn$6(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
1172
- };
1173
-
1174
- var objectDefineProperty = {};
1175
-
1176
- var DESCRIPTORS$4 = descriptors;
1177
- var fails$1 = fails$7;
1178
-
1179
- // V8 ~ Chrome 36-
1180
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
1181
- var v8PrototypeDefineBug = DESCRIPTORS$4 && fails$1(function () {
1182
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1183
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
1184
- value: 42,
1185
- writable: false
1186
- }).prototype != 42;
1187
- });
1188
-
1189
- var global$9 = global$o;
1190
- var isObject$1 = isObject$5;
1191
-
1192
- var String$2 = global$9.String;
1193
- var TypeError$3 = global$9.TypeError;
1194
-
1195
- // `Assert: Type(argument) is Object`
1196
- var anObject$2 = function (argument) {
1197
- if (isObject$1(argument)) return argument;
1198
- throw TypeError$3(String$2(argument) + ' is not an object');
1199
- };
1200
-
1201
- var global$8 = global$o;
1202
- var DESCRIPTORS$3 = descriptors;
1203
- var IE8_DOM_DEFINE = ie8DomDefine;
1204
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1205
- var anObject$1 = anObject$2;
1206
- var toPropertyKey = toPropertyKey$2;
1207
-
1208
- var TypeError$2 = global$8.TypeError;
1209
- // eslint-disable-next-line es/no-object-defineproperty -- safe
1210
- var $defineProperty = Object.defineProperty;
1211
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1212
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1213
- var ENUMERABLE = 'enumerable';
1214
- var CONFIGURABLE$1 = 'configurable';
1215
- var WRITABLE = 'writable';
1216
-
1217
- // `Object.defineProperty` method
1218
- // https://tc39.es/ecma262/#sec-object.defineproperty
1219
- objectDefineProperty.f = DESCRIPTORS$3 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
1220
- anObject$1(O);
1221
- P = toPropertyKey(P);
1222
- anObject$1(Attributes);
1223
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
1224
- var current = $getOwnPropertyDescriptor(O, P);
1225
- if (current && current[WRITABLE]) {
1226
- O[P] = Attributes.value;
1227
- Attributes = {
1228
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
1229
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
1230
- writable: false
1231
- };
1232
- }
1233
- } return $defineProperty(O, P, Attributes);
1234
- } : $defineProperty : function defineProperty(O, P, Attributes) {
1235
- anObject$1(O);
1236
- P = toPropertyKey(P);
1237
- anObject$1(Attributes);
1238
- if (IE8_DOM_DEFINE) try {
1239
- return $defineProperty(O, P, Attributes);
1240
- } catch (error) { /* empty */ }
1241
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$2('Accessors not supported');
1242
- if ('value' in Attributes) O[P] = Attributes.value;
1243
- return O;
1244
- };
1245
-
1246
- var DESCRIPTORS$2 = descriptors;
1247
- var definePropertyModule$1 = objectDefineProperty;
1248
- var createPropertyDescriptor = createPropertyDescriptor$2;
1249
-
1250
- var createNonEnumerableProperty$3 = DESCRIPTORS$2 ? function (object, key, value) {
1251
- return definePropertyModule$1.f(object, key, createPropertyDescriptor(1, value));
1252
- } : function (object, key, value) {
1253
- object[key] = value;
1254
- return object;
1255
- };
1256
-
1257
- var redefine$1 = {exports: {}};
1258
-
1259
- var uncurryThis$4 = functionUncurryThis;
1260
- var isCallable$5 = isCallable$b;
1261
- var store$1 = sharedStore;
1262
-
1263
- var functionToString = uncurryThis$4(Function.toString);
1264
-
1265
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
1266
- if (!isCallable$5(store$1.inspectSource)) {
1267
- store$1.inspectSource = function (it) {
1268
- return functionToString(it);
1269
- };
1270
- }
1271
-
1272
- var inspectSource$2 = store$1.inspectSource;
1273
-
1274
- var global$7 = global$o;
1275
- var isCallable$4 = isCallable$b;
1276
- var inspectSource$1 = inspectSource$2;
1277
-
1278
- var WeakMap$1 = global$7.WeakMap;
1279
-
1280
- var nativeWeakMap = isCallable$4(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
1281
-
1282
- var shared$1 = shared$3.exports;
1283
- var uid = uid$2;
1284
-
1285
- var keys = shared$1('keys');
1286
-
1287
- var sharedKey$1 = function (key) {
1288
- return keys[key] || (keys[key] = uid(key));
1289
- };
1290
-
1291
- var hiddenKeys$3 = {};
1292
-
1293
- var NATIVE_WEAK_MAP = nativeWeakMap;
1294
- var global$6 = global$o;
1295
- var uncurryThis$3 = functionUncurryThis;
1296
- var isObject = isObject$5;
1297
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
1298
- var hasOwn$5 = hasOwnProperty_1;
1299
- var shared = sharedStore;
1300
- var sharedKey = sharedKey$1;
1301
- var hiddenKeys$2 = hiddenKeys$3;
1302
-
1303
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1304
- var TypeError$1 = global$6.TypeError;
1305
- var WeakMap = global$6.WeakMap;
1306
- var set, get, has;
1307
-
1308
- var enforce = function (it) {
1309
- return has(it) ? get(it) : set(it, {});
1310
- };
1311
-
1312
- var getterFor = function (TYPE) {
1313
- return function (it) {
1314
- var state;
1315
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
1316
- throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
1317
- } return state;
1318
- };
1319
- };
1320
-
1321
- if (NATIVE_WEAK_MAP || shared.state) {
1322
- var store = shared.state || (shared.state = new WeakMap());
1323
- var wmget = uncurryThis$3(store.get);
1324
- var wmhas = uncurryThis$3(store.has);
1325
- var wmset = uncurryThis$3(store.set);
1326
- set = function (it, metadata) {
1327
- if (wmhas(store, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
1328
- metadata.facade = it;
1329
- wmset(store, it, metadata);
1330
- return metadata;
1331
- };
1332
- get = function (it) {
1333
- return wmget(store, it) || {};
1334
- };
1335
- has = function (it) {
1336
- return wmhas(store, it);
1337
- };
1338
- } else {
1339
- var STATE = sharedKey('state');
1340
- hiddenKeys$2[STATE] = true;
1341
- set = function (it, metadata) {
1342
- if (hasOwn$5(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
1343
- metadata.facade = it;
1344
- createNonEnumerableProperty$2(it, STATE, metadata);
1345
- return metadata;
1346
- };
1347
- get = function (it) {
1348
- return hasOwn$5(it, STATE) ? it[STATE] : {};
1349
- };
1350
- has = function (it) {
1351
- return hasOwn$5(it, STATE);
1352
- };
1353
- }
1354
-
1355
- var internalState = {
1356
- set: set,
1357
- get: get,
1358
- has: has,
1359
- enforce: enforce,
1360
- getterFor: getterFor
1361
- };
1362
-
1363
- var DESCRIPTORS$1 = descriptors;
1364
- var hasOwn$4 = hasOwnProperty_1;
1365
-
1366
- var FunctionPrototype = Function.prototype;
1367
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1368
- var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor;
1369
-
1370
- var EXISTS = hasOwn$4(FunctionPrototype, 'name');
1371
- // additional protection from minified / mangled / dropped function names
1372
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
1373
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$1 || (DESCRIPTORS$1 && getDescriptor(FunctionPrototype, 'name').configurable));
1374
-
1375
- var functionName = {
1376
- EXISTS: EXISTS,
1377
- PROPER: PROPER,
1378
- CONFIGURABLE: CONFIGURABLE
1379
- };
1380
-
1381
- var global$5 = global$o;
1382
- var isCallable$3 = isCallable$b;
1383
- var hasOwn$3 = hasOwnProperty_1;
1384
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
1385
- var setGlobal$1 = setGlobal$3;
1386
- var inspectSource = inspectSource$2;
1387
- var InternalStateModule = internalState;
1388
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
1389
-
1390
- var getInternalState = InternalStateModule.get;
1391
- var enforceInternalState = InternalStateModule.enforce;
1392
- var TEMPLATE = String(String).split('String');
1393
-
1394
- (redefine$1.exports = function (O, key, value, options) {
1395
- var unsafe = options ? !!options.unsafe : false;
1396
- var simple = options ? !!options.enumerable : false;
1397
- var noTargetGet = options ? !!options.noTargetGet : false;
1398
- var name = options && options.name !== undefined ? options.name : key;
1399
- var state;
1400
- if (isCallable$3(value)) {
1401
- if (String(name).slice(0, 7) === 'Symbol(') {
1402
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
1403
- }
1404
- if (!hasOwn$3(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
1405
- createNonEnumerableProperty$1(value, 'name', name);
1406
- }
1407
- state = enforceInternalState(value);
1408
- if (!state.source) {
1409
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
1410
- }
1411
- }
1412
- if (O === global$5) {
1413
- if (simple) O[key] = value;
1414
- else setGlobal$1(key, value);
1415
- return;
1416
- } else if (!unsafe) {
1417
- delete O[key];
1418
- } else if (!noTargetGet && O[key]) {
1419
- simple = true;
1420
- }
1421
- if (simple) O[key] = value;
1422
- else createNonEnumerableProperty$1(O, key, value);
1423
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
1424
- })(Function.prototype, 'toString', function toString() {
1425
- return isCallable$3(this) && getInternalState(this).source || inspectSource(this);
1426
- });
1427
-
1428
- var objectGetOwnPropertyNames = {};
1429
-
1430
- var ceil = Math.ceil;
1431
- var floor = Math.floor;
1432
-
1433
- // `ToIntegerOrInfinity` abstract operation
1434
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
1435
- var toIntegerOrInfinity$2 = function (argument) {
1436
- var number = +argument;
1437
- // eslint-disable-next-line no-self-compare -- safe
1438
- return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
1439
- };
1440
-
1441
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
1442
-
1443
- var max = Math.max;
1444
- var min$1 = Math.min;
1445
-
1446
- // Helper for a popular repeating case of the spec:
1447
- // Let integer be ? ToInteger(index).
1448
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
1449
- var toAbsoluteIndex$1 = function (index, length) {
1450
- var integer = toIntegerOrInfinity$1(index);
1451
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
1452
- };
1453
-
1454
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
1455
-
1456
- var min = Math.min;
1457
-
1458
- // `ToLength` abstract operation
1459
- // https://tc39.es/ecma262/#sec-tolength
1460
- var toLength$1 = function (argument) {
1461
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
1462
- };
1463
-
1464
- var toLength = toLength$1;
1465
-
1466
- // `LengthOfArrayLike` abstract operation
1467
- // https://tc39.es/ecma262/#sec-lengthofarraylike
1468
- var lengthOfArrayLike$1 = function (obj) {
1469
- return toLength(obj.length);
1470
- };
1471
-
1472
- var toIndexedObject$1 = toIndexedObject$3;
1473
- var toAbsoluteIndex = toAbsoluteIndex$1;
1474
- var lengthOfArrayLike = lengthOfArrayLike$1;
1475
-
1476
- // `Array.prototype.{ indexOf, includes }` methods implementation
1477
- var createMethod = function (IS_INCLUDES) {
1478
- return function ($this, el, fromIndex) {
1479
- var O = toIndexedObject$1($this);
1480
- var length = lengthOfArrayLike(O);
1481
- var index = toAbsoluteIndex(fromIndex, length);
1482
- var value;
1483
- // Array#includes uses SameValueZero equality algorithm
1484
- // eslint-disable-next-line no-self-compare -- NaN check
1485
- if (IS_INCLUDES && el != el) while (length > index) {
1486
- value = O[index++];
1487
- // eslint-disable-next-line no-self-compare -- NaN check
1488
- if (value != value) return true;
1489
- // Array#indexOf ignores holes, Array#includes - not
1490
- } else for (;length > index; index++) {
1491
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
1492
- } return !IS_INCLUDES && -1;
1493
- };
1494
- };
1495
-
1496
- var arrayIncludes = {
1497
- // `Array.prototype.includes` method
1498
- // https://tc39.es/ecma262/#sec-array.prototype.includes
1499
- includes: createMethod(true),
1500
- // `Array.prototype.indexOf` method
1501
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
1502
- indexOf: createMethod(false)
1503
- };
1504
-
1505
- var uncurryThis$2 = functionUncurryThis;
1506
- var hasOwn$2 = hasOwnProperty_1;
1507
- var toIndexedObject = toIndexedObject$3;
1508
- var indexOf = arrayIncludes.indexOf;
1509
- var hiddenKeys$1 = hiddenKeys$3;
1510
-
1511
- var push = uncurryThis$2([].push);
1512
-
1513
- var objectKeysInternal = function (object, names) {
1514
- var O = toIndexedObject(object);
1515
- var i = 0;
1516
- var result = [];
1517
- var key;
1518
- for (key in O) !hasOwn$2(hiddenKeys$1, key) && hasOwn$2(O, key) && push(result, key);
1519
- // Don't enum bug & hidden keys
1520
- while (names.length > i) if (hasOwn$2(O, key = names[i++])) {
1521
- ~indexOf(result, key) || push(result, key);
1522
- }
1523
- return result;
1524
- };
1525
-
1526
- // IE8- don't enum bug keys
1527
- var enumBugKeys$1 = [
1528
- 'constructor',
1529
- 'hasOwnProperty',
1530
- 'isPrototypeOf',
1531
- 'propertyIsEnumerable',
1532
- 'toLocaleString',
1533
- 'toString',
1534
- 'valueOf'
1535
- ];
1536
-
1537
- var internalObjectKeys = objectKeysInternal;
1538
- var enumBugKeys = enumBugKeys$1;
1539
-
1540
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
1541
-
1542
- // `Object.getOwnPropertyNames` method
1543
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
1544
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1545
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1546
- return internalObjectKeys(O, hiddenKeys);
1547
- };
1548
-
1549
- var objectGetOwnPropertySymbols = {};
1550
-
1551
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1552
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1553
-
1554
- var getBuiltIn = getBuiltIn$3;
1555
- var uncurryThis$1 = functionUncurryThis;
1556
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1557
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1558
- var anObject = anObject$2;
1559
-
1560
- var concat = uncurryThis$1([].concat);
1561
-
1562
- // all object keys, includes non-enumerable and symbols
1563
- var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
1564
- var keys = getOwnPropertyNamesModule.f(anObject(it));
1565
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1566
- return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
1567
- };
1568
-
1569
- var hasOwn$1 = hasOwnProperty_1;
1570
- var ownKeys = ownKeys$1;
1571
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1572
- var definePropertyModule = objectDefineProperty;
1573
-
1574
- var copyConstructorProperties$2 = function (target, source, exceptions) {
1575
- var keys = ownKeys(source);
1576
- var defineProperty = definePropertyModule.f;
1577
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1578
- for (var i = 0; i < keys.length; i++) {
1579
- var key = keys[i];
1580
- if (!hasOwn$1(target, key) && !(exceptions && hasOwn$1(exceptions, key))) {
1581
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1582
- }
1583
- }
1584
- };
1585
-
1586
- var fails = fails$7;
1587
- var isCallable$2 = isCallable$b;
1588
-
1589
- var replacement = /#|\.prototype\./;
1590
-
1591
- var isForced$1 = function (feature, detection) {
1592
- var value = data[normalize(feature)];
1593
- return value == POLYFILL ? true
1594
- : value == NATIVE ? false
1595
- : isCallable$2(detection) ? fails(detection)
1596
- : !!detection;
1597
- };
1598
-
1599
- var normalize = isForced$1.normalize = function (string) {
1600
- return String(string).replace(replacement, '.').toLowerCase();
1601
- };
1602
-
1603
- var data = isForced$1.data = {};
1604
- var NATIVE = isForced$1.NATIVE = 'N';
1605
- var POLYFILL = isForced$1.POLYFILL = 'P';
1606
-
1607
- var isForced_1 = isForced$1;
1608
-
1609
- var global$4 = global$o;
1610
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1611
- var createNonEnumerableProperty = createNonEnumerableProperty$3;
1612
- var redefine = redefine$1.exports;
1613
- var setGlobal = setGlobal$3;
1614
- var copyConstructorProperties$1 = copyConstructorProperties$2;
1615
- var isForced = isForced_1;
1616
-
1617
- /*
1618
- options.target - name of the target object
1619
- options.global - target is the global object
1620
- options.stat - export as static methods of target
1621
- options.proto - export as prototype methods of target
1622
- options.real - real prototype method for the `pure` version
1623
- options.forced - export even if the native feature is available
1624
- options.bind - bind methods to the target, required for the `pure` version
1625
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1626
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
1627
- options.sham - add a flag to not completely full polyfills
1628
- options.enumerable - export as enumerable property
1629
- options.noTargetGet - prevent calling a getter on target
1630
- options.name - the .name of the function if it does not match the key
1631
- */
1632
- var _export = function (options, source) {
1633
- var TARGET = options.target;
1634
- var GLOBAL = options.global;
1635
- var STATIC = options.stat;
1636
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1637
- if (GLOBAL) {
1638
- target = global$4;
1639
- } else if (STATIC) {
1640
- target = global$4[TARGET] || setGlobal(TARGET, {});
1641
- } else {
1642
- target = (global$4[TARGET] || {}).prototype;
1643
- }
1644
- if (target) for (key in source) {
1645
- sourceProperty = source[key];
1646
- if (options.noTargetGet) {
1647
- descriptor = getOwnPropertyDescriptor(target, key);
1648
- targetProperty = descriptor && descriptor.value;
1649
- } else targetProperty = target[key];
1650
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1651
- // contained in target
1652
- if (!FORCED && targetProperty !== undefined) {
1653
- if (typeof sourceProperty == typeof targetProperty) continue;
1654
- copyConstructorProperties$1(sourceProperty, targetProperty);
1655
- }
1656
- // add a flag to not completely full polyfills
1657
- if (options.sham || (targetProperty && targetProperty.sham)) {
1658
- createNonEnumerableProperty(sourceProperty, 'sham', true);
1659
- }
1660
- // extend global
1661
- redefine(target, key, sourceProperty, options);
1662
- }
1663
- };
1664
-
1665
- var wellKnownSymbol$1 = wellKnownSymbol$3;
1666
-
1667
- var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
1668
- var test = {};
1669
-
1670
- test[TO_STRING_TAG$1] = 'z';
1671
-
1672
- var toStringTagSupport = String(test) === '[object z]';
1673
-
1674
- var global$3 = global$o;
1675
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1676
- var isCallable$1 = isCallable$b;
1677
- var classofRaw = classofRaw$1;
1678
- var wellKnownSymbol = wellKnownSymbol$3;
1679
-
1680
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1681
- var Object$1 = global$3.Object;
1682
-
1683
- // ES3 wrong here
1684
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1685
-
1686
- // fallback for IE11 Script Access Denied error
1687
- var tryGet = function (it, key) {
1688
- try {
1689
- return it[key];
1690
- } catch (error) { /* empty */ }
1691
- };
1692
-
1693
- // getting tag from ES6+ `Object.prototype.toString`
1694
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1695
- var O, tag, result;
1696
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1697
- // @@toStringTag case
1698
- : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
1699
- // builtinTag case
1700
- : CORRECT_ARGUMENTS ? classofRaw(O)
1701
- // ES3 arguments fallback
1702
- : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
1703
- };
1704
-
1705
- var global$2 = global$o;
1706
- var classof = classof$1;
1707
-
1708
- var String$1 = global$2.String;
1709
-
1710
- var toString$1 = function (argument) {
1711
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1712
- return String$1(argument);
1713
- };
1714
-
1715
- var $ = _export;
1716
- var DESCRIPTORS = descriptors;
1717
- var global$1 = global$o;
1718
- var uncurryThis = functionUncurryThis;
1719
- var hasOwn = hasOwnProperty_1;
1720
- var isCallable = isCallable$b;
1721
- var isPrototypeOf = objectIsPrototypeOf;
1722
- var toString = toString$1;
1723
- var defineProperty = objectDefineProperty.f;
1724
- var copyConstructorProperties = copyConstructorProperties$2;
1725
-
1726
- var NativeSymbol = global$1.Symbol;
1727
- var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
1728
-
1729
- if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
1730
- // Safari 12 bug
1731
- NativeSymbol().description !== undefined
1732
- )) {
1733
- var EmptyStringDescriptionStore = {};
1734
- // wrap Symbol constructor for correct work with undefined description
1735
- var SymbolWrapper = function Symbol() {
1736
- var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
1737
- var result = isPrototypeOf(SymbolPrototype, this)
1738
- ? new NativeSymbol(description)
1739
- // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
1740
- : description === undefined ? NativeSymbol() : NativeSymbol(description);
1741
- if (description === '') EmptyStringDescriptionStore[result] = true;
1742
- return result;
1743
- };
1744
-
1745
- copyConstructorProperties(SymbolWrapper, NativeSymbol);
1746
- SymbolWrapper.prototype = SymbolPrototype;
1747
- SymbolPrototype.constructor = SymbolWrapper;
1748
-
1749
- var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
1750
- var symbolToString = uncurryThis(SymbolPrototype.toString);
1751
- var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
1752
- var regexp = /^Symbol\((.*)\)[^)]+$/;
1753
- var replace = uncurryThis(''.replace);
1754
- var stringSlice = uncurryThis(''.slice);
1755
-
1756
- defineProperty(SymbolPrototype, 'description', {
1757
- configurable: true,
1758
- get: function description() {
1759
- var symbol = symbolValueOf(this);
1760
- var string = symbolToString(symbol);
1761
- if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
1762
- var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
1763
- return desc === '' ? undefined : desc;
1764
- }
1765
- });
1766
-
1767
- $({ global: true, forced: true }, {
1768
- Symbol: SymbolWrapper
1769
- });
1770
- }
1771
-
1772
- var RadioGroup = function RadioGroup(_a) {
1773
- var description = _a.description,
1774
- title = _a.title,
1775
- validator = _a.validator,
1776
- onChangeRadio = _a.onChangeRadio,
1777
- onChange = _a.onChange,
1778
- name = _a.name,
1779
- children = _a.children;
1780
-
1781
- var _b = React__default["default"].useState(),
1782
- checked = _b[0],
1783
- setChecked = _b[1];
1784
-
1785
- var validatorClassName = extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
1786
-
1787
- var onChanges = function onChanges(event) {
1788
- setChecked(event.target.value);
1789
- onChangeRadio && onChangeRadio(event.target.value);
1790
- onChange && onChange(event);
1791
- };
1792
-
1793
- var radioBtnRef = React__default["default"].useRef(null);
1794
- React__default["default"].useEffect(function () {
1795
- var _a;
1796
-
1797
- if (radioBtnRef && radioBtnRef.current) {
1798
- var form_1 = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
1799
-
1800
- var resetListner_1 = function resetListner_1() {
1801
- setChecked(undefined);
1802
- };
1803
-
1804
- form_1 === null || form_1 === void 0 ? void 0 : form_1.addEventListener('reset', resetListner_1);
1805
- return function () {
1806
- return form_1 === null || form_1 === void 0 ? void 0 : form_1.removeEventListener('reset', resetListner_1);
1807
- };
1808
- } else {
1809
- // eslint-disable-next-line @typescript-eslint/no-empty-function
1810
- return function () {};
1811
- }
1812
- }, []);
1813
- return jsxRuntime.jsxs("div", __assign({
1814
- className: "form-group"
1815
- }, {
1816
- children: [jsxRuntime.jsxs("fieldset", __assign({
1817
- className: validatorClassName
1818
- }, {
1819
- children: [jsxRuntime.jsx("legend", {
1820
- children: title
1821
- }, void 0), jsxRuntime.jsx("span", __assign({
1822
- className: "form-info"
1823
- }, {
1824
- children: description
1825
- }), void 0), React__default["default"].Children.map(children, function (Child) {
1826
- return /*#__PURE__*/React__default["default"].isValidElement(Child) ? /*#__PURE__*/React__default["default"].cloneElement(Child, {
1827
- validator: validatorClassName,
1828
- onChange: onChanges,
1829
- checked: checked === Child.props.value,
1830
- name: name,
1831
- ref: radioBtnRef
1832
- }) : Child;
1833
- })]
1834
- }), void 0), (validator === null || validator === void 0 ? void 0 : validator.message) && jsxRuntime.jsx("span", __assign({
1835
- className: "form-info"
1836
- }, {
1837
- children: validator === null || validator === void 0 ? void 0 : validator.message
1838
- }), void 0)]
1839
- }), void 0);
1840
- };
1841
-
1842
- var ListItem = function ListItem(_a) {
1843
- var listType = _a.listType,
1844
- tableRowData = _a.tableRowData,
1845
- children = _a.children,
1846
- props = __rest(_a, ["listType", "tableRowData", "children"]);
1847
-
1848
- if (listType === 'table') {
1849
- return jsxRuntime.jsx("dl", {
1850
- children: jsxRuntime.jsxs("div", {
1851
- children: [jsxRuntime.jsx("dt", {
1852
- children: tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.title
1853
- }, void 0), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.definition.map(function (item, index) {
1854
- return jsxRuntime.jsx("dd", {
1855
- children: item
1856
- }, index);
1857
- })]
1858
- }, void 0)
1859
- }, void 0);
1860
- } else {
1861
- return jsxRuntime.jsx("li", __assign({}, props, {
1862
- children: children
1863
- }), void 0);
1864
- }
1865
- };
1866
-
1867
- var List = function List(_a) {
1868
- var listType = _a.listType,
1869
- tableCaption = _a.tableCaption,
1870
- tableData = _a.tableData,
1871
- children = _a.children,
1872
- props = __rest(_a, ["listType", "tableCaption", "tableData", "children"]);
1873
-
1874
- if (listType === 'ordered') {
1875
- return jsxRuntime.jsx("ol", __assign({}, props, {
1876
- children: children === null || children === void 0 ? void 0 : children.map(function (child, index) {
1877
- return jsxRuntime.jsx(ListItem, {
1878
- children: child
1879
- }, index);
1880
- })
1881
- }), void 0);
1882
- } else if (listType !== 'table') {
1883
- return jsxRuntime.jsx("ul", __assign({}, props, {
1884
- className: listType
1885
- }, {
1886
- children: children === null || children === void 0 ? void 0 : children.map(function (child, index) {
1887
- return jsxRuntime.jsx(ListItem, {
1888
- children: child
1889
- }, index);
1890
- })
1891
- }), void 0);
1892
- } else {
1893
- return jsxRuntime.jsxs("figure", {
1894
- children: [jsxRuntime.jsx("figcaption", __assign({
1895
- className: "table-list-caption"
1896
- }, {
1897
- children: tableCaption
1898
- }), void 0), jsxRuntime.jsx("dl", {
1899
- children: tableData === null || tableData === void 0 ? void 0 : tableData.map(function (data, index) {
1900
- return jsxRuntime.jsx(ListItem, {
1901
- listType: listType,
1902
- tableRowData: data
1903
- }, index);
1904
- })
1905
- }, void 0)]
1906
- }, void 0);
1907
- }
1908
- };
1909
-
1910
- var Link = function Link(_a) {
1911
- var button = _a.button,
1912
- children = _a.children,
1913
- props = __rest(_a, ["button", "children"]);
1914
-
1915
- var _b = React.useState({}),
1916
- anchorProps = _b[0],
1917
- setAnchorProps = _b[1];
1918
-
1919
- React.useEffect(function () {
1920
- var className = button ? typeof button === 'string' ? "button ".concat(button) : 'button' : undefined;
1921
-
1922
- var newProps = __assign({
1923
- role: button ? 'button' : undefined,
1924
- className: className
1925
- }, props);
1926
-
1927
- setAnchorProps(newProps);
1928
- }, [button]);
1929
- return jsxRuntime.jsx("a", __assign({}, anchorProps, {
1930
- children: children
1931
- }), void 0);
1932
- };
1933
-
1934
- var Navbar = function Navbar(_a) {
1935
- var children = _a.children,
1936
- variant = _a.variant,
1937
- title = _a.title,
1938
- titleLink = _a.titleLink,
1939
- _b = _a.brandLink,
1940
- brandLink = _b === void 0 ? 'https://www.seb.se' : _b,
1941
- _c = _a.brandAriaLabel,
1942
- brandAriaLabel = _c === void 0 ? 'Open seb.se in new tab' : _c;
1943
-
1944
- var _d = React.useState({}),
1945
- props = _d[0],
1946
- setProps = _d[1];
1947
-
1948
- React.useEffect(function () {
1949
- var classNames = [];
1950
- if (variant) classNames.push(variant);
1951
- setProps(__assign(__assign({}, props), {
1952
- className: classNames.join(' ')
1953
- })); // eslint-disable-next-line react-hooks/exhaustive-deps
1954
- }, [variant]);
1955
- return jsxRuntime.jsxs("nav", __assign({
1956
- role: "navigation"
1957
- }, props, {
1958
- children: [jsxRuntime.jsx(Link, {
1959
- "aria-label": brandAriaLabel,
1960
- href: brandLink,
1961
- target: "_blank",
1962
- className: "brand"
1963
- }, void 0), jsxRuntime.jsx("div", __assign({
1964
- className: "container-fluid"
1965
- }, {
1966
- children: jsxRuntime.jsxs("div", __assign({
1967
- className: "row justify-content-between align-items-center"
1968
- }, {
1969
- children: [jsxRuntime.jsx("div", __assign({
1970
- className: "col-auto"
1971
- }, {
1972
- children: titleLink ? jsxRuntime.jsx(Link, __assign({
1973
- className: "mx-4",
1974
- href: titleLink
1975
- }, {
1976
- children: jsxRuntime.jsx("h1", {
1977
- children: title
1978
- }, void 0)
1979
- }), void 0) : jsxRuntime.jsx("h1", {
1980
- children: title
1981
- }, void 0)
1982
- }), void 0), jsxRuntime.jsx("div", __assign({
1983
- className: "col-auto"
1984
- }, {
1985
- children: jsxRuntime.jsx("div", __assign({
1986
- className: "group size-sm"
1987
- }, {
1988
- children: children
1989
- }), void 0)
1990
- }), void 0)]
1991
- }), void 0)
1992
- }), void 0)]
1993
- }), void 0);
1994
- };
1995
-
1996
- function Badge(_a) {
1997
- var title = _a.title,
1998
- badgeType = _a.badgeType,
1999
- isCloseable = _a.isCloseable,
2000
- closeText = _a.closeText,
2001
- props = __rest(_a, ["title", "badgeType", "isCloseable", "closeText"]);
2002
-
2003
- return jsxRuntime.jsxs("span", __assign({}, props, {
2004
- className: "badge ".concat(badgeType)
2005
- }, {
2006
- children: [jsxRuntime.jsx("strong", {
2007
- children: title
2008
- }, void 0), isCloseable && jsxRuntime.jsx("button", __assign({
2009
- className: "close"
2010
- }, {
2011
- children: jsxRuntime.jsx("span", __assign({
2012
- className: "sr-only"
2013
- }, {
2014
- children: closeText
2015
- }), void 0)
2016
- }), void 0)]
2017
- }), void 0);
2018
- }
2019
-
2020
- var useDropdown = function useDropdown(_a) {
2021
- var id = _a.id,
2022
- text = _a.text,
2023
- options = _a.options,
2024
- loop = _a.loop,
2025
- togglerRef = _a.togglerRef,
2026
- listboxRef = _a.listboxRef;
2027
-
2028
- var _b = React.useState(),
2029
- handler = _b[0],
2030
- setHandler = _b[1];
2031
-
2032
- var _c = React.useState(),
2033
- dropdown = _c[0],
2034
- setDropdown = _c[1];
2035
-
2036
- var _d = React.useState({}),
2037
- togglerProps = _d[0],
2038
- setTogglerProps = _d[1];
2039
-
2040
- var _e = React.useState({}),
2041
- listboxProps = _e[0],
2042
- setListboxProps = _e[1];
2043
-
2044
- var _f = React.useState([]),
2045
- listItems = _f[0],
2046
- setListItems = _f[1]; // When dropdown data changes
2047
-
2048
-
2049
- React.useEffect(function () {
2050
- var _a, _b;
2051
-
2052
- if (!dropdown) return;
2053
- var _c = dropdown.elements,
2054
- toggler = _c.toggler,
2055
- listbox = _c.listbox;
2056
-
2057
- var newToggleProps = __assign(__assign({}, toggler === null || toggler === void 0 ? void 0 : toggler.attributes), {
2058
- className: (_a = toggler === null || toggler === void 0 ? void 0 : toggler.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2059
- children: dropdown.text,
2060
- onClick: function () {
2061
- return handler === null || handler === void 0 ? void 0 : handler.toggle();
2062
- }
2063
- });
2064
-
2065
- setTogglerProps(newToggleProps);
2066
-
2067
- var newListboxProps = __assign(__assign({}, listbox === null || listbox === void 0 ? void 0 : listbox.attributes), {
2068
- className: (_b = listbox === null || listbox === void 0 ? void 0 : listbox.classes) === null || _b === void 0 ? void 0 : _b.join(' ')
2069
- });
2070
-
2071
- setListboxProps(newListboxProps);
2072
- var newListItems = dropdown.options.map(function (o) {
2073
- var _a;
2074
-
2075
- return __assign(__assign({}, o.attributes), {
2076
- className: (_a = o.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2077
- children: o.key,
2078
- onClick: function () {
2079
- return handler === null || handler === void 0 ? void 0 : handler.select(o);
2080
- }
2081
- });
2082
- });
2083
- setListItems(newListItems); // eslint-disable-next-line react-hooks/exhaustive-deps
2084
- }, [dropdown]); // When dropdown properties change
2085
-
2086
- React.useEffect(function () {
2087
- if (!dropdown) return;
2088
- handler === null || handler === void 0 ? void 0 : handler.update({
2089
- id: id,
2090
- text: text,
2091
- options: options,
2092
- loop: loop
2093
- }); // eslint-disable-next-line react-hooks/exhaustive-deps
2094
- }, [id, text, options, loop]); // Create dropdown handler
2095
-
2096
- React.useEffect(function () {
2097
- if (!handler && togglerRef.current && listboxRef.current) {
2098
- setHandler(extract.createDropdown({
2099
- id: id,
2100
- text: text,
2101
- options: options,
2102
- loop: loop
2103
- }, togglerRef.current, listboxRef.current, setDropdown));
2104
- }
2105
-
2106
- return function () {
2107
- return handler === null || handler === void 0 ? void 0 : handler.destroy();
2108
- }; // eslint-disable-next-line react-hooks/exhaustive-deps
2109
- }, [togglerRef, listboxRef]);
2110
- return {
2111
- dropdown: handler,
2112
- togglerProps: togglerProps,
2113
- listboxProps: listboxProps,
2114
- listItems: listItems
2115
- };
2116
- };
2117
-
2118
- var Dropdown = function Dropdown(_a) {
2119
- var id = _a.id,
2120
- options = _a.options,
2121
- loop = _a.loop,
2122
- children = _a.children;
2123
- var togglerRef = React.useRef(null);
2124
- var listboxRef = React.useRef(null);
2125
-
2126
- var _b = useDropdown({
2127
- id: id,
2128
- options: options,
2129
- loop: loop,
2130
- togglerRef: togglerRef,
2131
- listboxRef: listboxRef,
2132
- text: children
2133
- }),
2134
- dropdown = _b.dropdown,
2135
- listboxProps = _b.listboxProps,
2136
- togglerProps = _b.togglerProps,
2137
- listItems = _b.listItems;
2138
-
2139
- return jsxRuntime.jsxs("div", {
2140
- children: [jsxRuntime.jsx("button", __assign({
2141
- type: "button"
2142
- }, togglerProps, {
2143
- ref: togglerRef
2144
- }, {
2145
- children: jsxRuntime.jsx("span", {
2146
- children: togglerProps.children
2147
- }, void 0)
2148
- }), void 0), jsxRuntime.jsxs("div", __assign({}, listboxProps, {
2149
- ref: listboxRef
2150
- }, {
2151
- children: [jsxRuntime.jsx("button", __assign({
2152
- type: "button",
2153
- className: "close m-4 m-sm-2 d-block d-sm-none",
2154
- onClick: dropdown === null || dropdown === void 0 ? void 0 : dropdown.close
2155
- }, {
2156
- children: jsxRuntime.jsx("span", __assign({
2157
- className: "sr-only"
2158
- }, {
2159
- children: "Close"
2160
- }), void 0)
2161
- }), void 0), jsxRuntime.jsx("ul", __assign({
2162
- role: "listbox"
2163
- }, {
2164
- children: listItems.map(function (liProps) {
2165
- return jsxRuntime.jsx("li", __assign({}, liProps), liProps.id);
2166
- })
2167
- }), void 0)]
2168
- }), void 0)]
2169
- }, void 0);
2170
- };
2171
-
2172
- exports.Alert = Alert;
2173
- exports.Badge = Badge;
2174
- exports.Button = Button;
2175
- exports.ButtonGroup = ButtonGroup;
2176
- exports.Card = Card;
2177
- exports.Checkbox = Checkbox;
2178
- exports.Dropdown = Dropdown;
2179
- exports.EmailInput = EmailInput;
2180
- exports.Flexbox = Flexbox;
2181
- exports.Form = Form;
2182
- exports.FormItems = FormItems;
2183
- exports.Group = Group;
2184
- exports.Link = Link;
2185
- exports.List = List;
2186
- exports.Modal = Modal;
2187
- exports.Navbar = Navbar;
2188
- exports.NumberInput = NumberInput;
2189
- exports.RadioButton = RadioButton;
2190
- exports.RadioGroup = RadioGroup;
2191
- exports.RenderInput = RenderInput;
2192
- exports.Text = Text;
2193
- exports.TextInput = TextInput;
2194
-
2195
- Object.defineProperty(exports, '__esModule', { value: true });
1054
+ function __rest(s, e) {
1055
+ var t = {};
1056
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1057
+ t[p] = s[p];
1058
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1059
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1060
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1061
+ t[p[i]] = s[p[i]];
1062
+ }
1063
+ return t;
1064
+ }
1065
+
1066
+ function Button({
1067
+ children,
1068
+ variant,
1069
+ onClick,
1070
+ active = false,
1071
+ type = 'button'
1072
+ }) {
1073
+ const props = {
1074
+ type
1075
+ };
1076
+ const classNames = [];
1077
+ if (variant) classNames.push(variant);
1078
+ if (active) classNames.push('active');
1079
+ if (classNames.length) props.className = classNames.join(' ');
1080
+ if (onClick) props.onClick = onClick;
1081
+ return jsxRuntime.jsx("button", Object.assign({}, props, {
1082
+ children: children
1083
+ }));
1084
+ }
1085
+
1086
+ const ModalHeader = ({
1087
+ header: _header = '',
1088
+ onClose
1089
+ }) => {
1090
+ const handleClose = event => {
1091
+ if (onClose) onClose(event);
1092
+ };
1093
+
1094
+ return jsxRuntime.jsxs("div", Object.assign({
1095
+ className: "header"
1096
+ }, {
1097
+ children: [jsxRuntime.jsx("h3", {
1098
+ children: _header
1099
+ }), jsxRuntime.jsx("button", Object.assign({
1100
+ className: "close",
1101
+ onClick: handleClose
1102
+ }, {
1103
+ children: jsxRuntime.jsx("span", Object.assign({
1104
+ className: "sr-only"
1105
+ }, {
1106
+ children: "Close"
1107
+ }))
1108
+ }))]
1109
+ }));
1110
+ };
1111
+
1112
+ const ModalBody = ({
1113
+ children
1114
+ }) => {
1115
+ return jsxRuntime.jsx("div", Object.assign({
1116
+ className: "body"
1117
+ }, {
1118
+ children: children
1119
+ }));
1120
+ };
1121
+
1122
+ const ModalFooter = ({
1123
+ confirm,
1124
+ dismiss,
1125
+ onClose,
1126
+ onConfirm,
1127
+ onDismiss
1128
+ }) => {
1129
+ const handleConfirm = event => {
1130
+ if (onConfirm) onConfirm(event);
1131
+ if (onClose) onClose(event);
1132
+ };
1133
+
1134
+ const handleDismiss = event => {
1135
+ if (onDismiss) onDismiss(event);
1136
+ if (onClose) onClose(event);
1137
+ };
1138
+
1139
+ return jsxRuntime.jsxs("div", Object.assign({
1140
+ className: "footer"
1141
+ }, {
1142
+ children: [dismiss && jsxRuntime.jsx(Button, Object.assign({
1143
+ variant: "secondary",
1144
+ onClick: handleDismiss
1145
+ }, {
1146
+ children: dismiss
1147
+ })), confirm && jsxRuntime.jsx(Button, Object.assign({
1148
+ variant: "primary",
1149
+ onClick: handleConfirm
1150
+ }, {
1151
+ children: confirm
1152
+ }))]
1153
+ }));
1154
+ };
1155
+
1156
+ const Modal = _a => {
1157
+ var {
1158
+ type = 'default',
1159
+ isOpen
1160
+ } = _a,
1161
+ props = __rest(_a, ["type", "isOpen"]);
1162
+
1163
+ const modalContent = () => {
1164
+ switch (type) {
1165
+ case 'slideout':
1166
+ {
1167
+ return jsxRuntime.jsxs("aside", Object.assign({
1168
+ role: "dialog"
1169
+ }, {
1170
+ children: [jsxRuntime.jsx(ModalHeader, Object.assign({}, props)), jsxRuntime.jsx(ModalBody, Object.assign({}, props)), jsxRuntime.jsx(ModalFooter, Object.assign({}, props))]
1171
+ }));
1172
+ }
1173
+
1174
+ case 'takeover':
1175
+ {
1176
+ return jsxRuntime.jsxs("main", Object.assign({
1177
+ role: "dialog"
1178
+ }, {
1179
+ children: [jsxRuntime.jsx(ModalHeader, Object.assign({}, props)), jsxRuntime.jsx(ModalBody, Object.assign({}, props)), jsxRuntime.jsx(ModalFooter, Object.assign({}, props))]
1180
+ }));
1181
+ }
1182
+
1183
+ default:
1184
+ {
1185
+ return jsxRuntime.jsxs("section", Object.assign({
1186
+ role: "dialog"
1187
+ }, {
1188
+ children: [jsxRuntime.jsx(ModalHeader, Object.assign({}, props)), jsxRuntime.jsx(ModalBody, Object.assign({}, props)), jsxRuntime.jsx(ModalFooter, Object.assign({}, props))]
1189
+ }));
1190
+ }
1191
+ }
1192
+ };
1193
+
1194
+ return isOpen ? modalContent() : null;
1195
+ };
1196
+
1197
+ var objectDefineProperties = {};
1198
+
1199
+ var DESCRIPTORS$2 = descriptors;
1200
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1201
+ var definePropertyModule$1 = objectDefineProperty;
1202
+ var anObject$2 = anObject$5;
1203
+ var toIndexedObject$1 = toIndexedObject$5;
1204
+ var objectKeys = objectKeys$2;
1205
+
1206
+ // `Object.defineProperties` method
1207
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1208
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
1209
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1210
+ anObject$2(O);
1211
+ var props = toIndexedObject$1(Properties);
1212
+ var keys = objectKeys(Properties);
1213
+ var length = keys.length;
1214
+ var index = 0;
1215
+ var key;
1216
+ while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
1217
+ return O;
1218
+ };
1219
+
1220
+ var getBuiltIn = getBuiltIn$4;
1221
+
1222
+ var html$1 = getBuiltIn('document', 'documentElement');
1223
+
1224
+ /* global ActiveXObject -- old IE, WSH */
1225
+
1226
+ var anObject$1 = anObject$5;
1227
+ var definePropertiesModule = objectDefineProperties;
1228
+ var enumBugKeys = enumBugKeys$3;
1229
+ var hiddenKeys = hiddenKeys$4;
1230
+ var html = html$1;
1231
+ var documentCreateElement$1 = documentCreateElement$2;
1232
+ var sharedKey$1 = sharedKey$3;
1233
+
1234
+ var GT = '>';
1235
+ var LT = '<';
1236
+ var PROTOTYPE = 'prototype';
1237
+ var SCRIPT = 'script';
1238
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1239
+
1240
+ var EmptyConstructor = function () { /* empty */ };
1241
+
1242
+ var scriptTag = function (content) {
1243
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1244
+ };
1245
+
1246
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1247
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1248
+ activeXDocument.write(scriptTag(''));
1249
+ activeXDocument.close();
1250
+ var temp = activeXDocument.parentWindow.Object;
1251
+ activeXDocument = null; // avoid memory leak
1252
+ return temp;
1253
+ };
1254
+
1255
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1256
+ var NullProtoObjectViaIFrame = function () {
1257
+ // Thrash, waste and sodomy: IE GC bug
1258
+ var iframe = documentCreateElement$1('iframe');
1259
+ var JS = 'java' + SCRIPT + ':';
1260
+ var iframeDocument;
1261
+ iframe.style.display = 'none';
1262
+ html.appendChild(iframe);
1263
+ // https://github.com/zloirock/core-js/issues/475
1264
+ iframe.src = String(JS);
1265
+ iframeDocument = iframe.contentWindow.document;
1266
+ iframeDocument.open();
1267
+ iframeDocument.write(scriptTag('document.F=Object'));
1268
+ iframeDocument.close();
1269
+ return iframeDocument.F;
1270
+ };
1271
+
1272
+ // Check for document.domain and active x support
1273
+ // No need to use active x approach when document.domain is not set
1274
+ // see https://github.com/es-shims/es5-shim/issues/150
1275
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1276
+ // avoid IE GC bug
1277
+ var activeXDocument;
1278
+ var NullProtoObject = function () {
1279
+ try {
1280
+ activeXDocument = new ActiveXObject('htmlfile');
1281
+ } catch (error) { /* ignore */ }
1282
+ NullProtoObject = typeof document != 'undefined'
1283
+ ? document.domain && activeXDocument
1284
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1285
+ : NullProtoObjectViaIFrame()
1286
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1287
+ var length = enumBugKeys.length;
1288
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1289
+ return NullProtoObject();
1290
+ };
1291
+
1292
+ hiddenKeys[IE_PROTO$1] = true;
1293
+
1294
+ // `Object.create` method
1295
+ // https://tc39.es/ecma262/#sec-object.create
1296
+ // eslint-disable-next-line es-x/no-object-create -- safe
1297
+ var objectCreate = Object.create || function create(O, Properties) {
1298
+ var result;
1299
+ if (O !== null) {
1300
+ EmptyConstructor[PROTOTYPE] = anObject$1(O);
1301
+ result = new EmptyConstructor();
1302
+ EmptyConstructor[PROTOTYPE] = null;
1303
+ // add "__proto__" for Object.getPrototypeOf polyfill
1304
+ result[IE_PROTO$1] = O;
1305
+ } else result = NullProtoObject();
1306
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1307
+ };
1308
+
1309
+ var wellKnownSymbol$6 = wellKnownSymbol$8;
1310
+ var create$1 = objectCreate;
1311
+ var definePropertyModule = objectDefineProperty;
1312
+
1313
+ var UNSCOPABLES = wellKnownSymbol$6('unscopables');
1314
+ var ArrayPrototype = Array.prototype;
1315
+
1316
+ // Array.prototype[@@unscopables]
1317
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1318
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
1319
+ definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
1320
+ configurable: true,
1321
+ value: create$1(null)
1322
+ });
1323
+ }
1324
+
1325
+ // add a key to Array.prototype[@@unscopables]
1326
+ var addToUnscopables$1 = function (key) {
1327
+ ArrayPrototype[UNSCOPABLES][key] = true;
1328
+ };
1329
+
1330
+ var iterators = {};
1331
+
1332
+ var fails$1 = fails$a;
1333
+
1334
+ var correctPrototypeGetter = !fails$1(function () {
1335
+ function F() { /* empty */ }
1336
+ F.prototype.constructor = null;
1337
+ // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
1338
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1339
+ });
1340
+
1341
+ var global$6 = global$r;
1342
+ var hasOwn$2 = hasOwnProperty_1;
1343
+ var isCallable$5 = isCallable$f;
1344
+ var toObject = toObject$3;
1345
+ var sharedKey = sharedKey$3;
1346
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1347
+
1348
+ var IE_PROTO = sharedKey('IE_PROTO');
1349
+ var Object$2 = global$6.Object;
1350
+ var ObjectPrototype = Object$2.prototype;
1351
+
1352
+ // `Object.getPrototypeOf` method
1353
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1354
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$2.getPrototypeOf : function (O) {
1355
+ var object = toObject(O);
1356
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1357
+ var constructor = object.constructor;
1358
+ if (isCallable$5(constructor) && object instanceof constructor) {
1359
+ return constructor.prototype;
1360
+ } return object instanceof Object$2 ? ObjectPrototype : null;
1361
+ };
1362
+
1363
+ var fails = fails$a;
1364
+ var isCallable$4 = isCallable$f;
1365
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1366
+ var redefine$1 = redefine$3.exports;
1367
+ var wellKnownSymbol$5 = wellKnownSymbol$8;
1368
+
1369
+ var ITERATOR$2 = wellKnownSymbol$5('iterator');
1370
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1371
+
1372
+ // `%IteratorPrototype%` object
1373
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1374
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1375
+
1376
+ /* eslint-disable es-x/no-array-prototype-keys -- safe */
1377
+ if ([].keys) {
1378
+ arrayIterator = [].keys();
1379
+ // Safari 8 has buggy iterators w/o `next`
1380
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1381
+ else {
1382
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1383
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1384
+ }
1385
+ }
1386
+
1387
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails(function () {
1388
+ var test = {};
1389
+ // FF44- legacy iterators case
1390
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1391
+ });
1392
+
1393
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1394
+
1395
+ // `%IteratorPrototype%[@@iterator]()` method
1396
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1397
+ if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
1398
+ redefine$1(IteratorPrototype$2, ITERATOR$2, function () {
1399
+ return this;
1400
+ });
1401
+ }
1402
+
1403
+ var iteratorsCore = {
1404
+ IteratorPrototype: IteratorPrototype$2,
1405
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1406
+ };
1407
+
1408
+ var defineProperty$2 = objectDefineProperty.f;
1409
+ var hasOwn$1 = hasOwnProperty_1;
1410
+ var wellKnownSymbol$4 = wellKnownSymbol$8;
1411
+
1412
+ var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1413
+
1414
+ var setToStringTag$2 = function (target, TAG, STATIC) {
1415
+ if (target && !STATIC) target = target.prototype;
1416
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1417
+ defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1418
+ }
1419
+ };
1420
+
1421
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1422
+ var create = objectCreate;
1423
+ var createPropertyDescriptor = createPropertyDescriptor$3;
1424
+ var setToStringTag$1 = setToStringTag$2;
1425
+ var Iterators$2 = iterators;
1426
+
1427
+ var returnThis$1 = function () { return this; };
1428
+
1429
+ var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1430
+ var TO_STRING_TAG = NAME + ' Iterator';
1431
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1432
+ setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
1433
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
1434
+ return IteratorConstructor;
1435
+ };
1436
+
1437
+ var global$5 = global$r;
1438
+ var isCallable$3 = isCallable$f;
1439
+
1440
+ var String$2 = global$5.String;
1441
+ var TypeError$1 = global$5.TypeError;
1442
+
1443
+ var aPossiblePrototype$1 = function (argument) {
1444
+ if (typeof argument == 'object' || isCallable$3(argument)) return argument;
1445
+ throw TypeError$1("Can't set " + String$2(argument) + ' as a prototype');
1446
+ };
1447
+
1448
+ /* eslint-disable no-proto -- safe */
1449
+
1450
+ var uncurryThis$1 = functionUncurryThis;
1451
+ var anObject = anObject$5;
1452
+ var aPossiblePrototype = aPossiblePrototype$1;
1453
+
1454
+ // `Object.setPrototypeOf` method
1455
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1456
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1457
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
1458
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1459
+ var CORRECT_SETTER = false;
1460
+ var test = {};
1461
+ var setter;
1462
+ try {
1463
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1464
+ setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1465
+ setter(test, []);
1466
+ CORRECT_SETTER = test instanceof Array;
1467
+ } catch (error) { /* empty */ }
1468
+ return function setPrototypeOf(O, proto) {
1469
+ anObject(O);
1470
+ aPossiblePrototype(proto);
1471
+ if (CORRECT_SETTER) setter(O, proto);
1472
+ else O.__proto__ = proto;
1473
+ return O;
1474
+ };
1475
+ }() : undefined);
1476
+
1477
+ var $$1 = _export;
1478
+ var call = functionCall;
1479
+ var FunctionName = functionName;
1480
+ var isCallable$2 = isCallable$f;
1481
+ var createIteratorConstructor = createIteratorConstructor$1;
1482
+ var getPrototypeOf = objectGetPrototypeOf;
1483
+ var setPrototypeOf = objectSetPrototypeOf;
1484
+ var setToStringTag = setToStringTag$2;
1485
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1486
+ var redefine = redefine$3.exports;
1487
+ var wellKnownSymbol$3 = wellKnownSymbol$8;
1488
+ var Iterators$1 = iterators;
1489
+ var IteratorsCore = iteratorsCore;
1490
+
1491
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1492
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1493
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1494
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1495
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
1496
+ var KEYS = 'keys';
1497
+ var VALUES = 'values';
1498
+ var ENTRIES = 'entries';
1499
+
1500
+ var returnThis = function () { return this; };
1501
+
1502
+ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1503
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1504
+
1505
+ var getIterationMethod = function (KIND) {
1506
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1507
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
1508
+ switch (KIND) {
1509
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1510
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1511
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1512
+ } return function () { return new IteratorConstructor(this); };
1513
+ };
1514
+
1515
+ var TO_STRING_TAG = NAME + ' Iterator';
1516
+ var INCORRECT_VALUES_NAME = false;
1517
+ var IterablePrototype = Iterable.prototype;
1518
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1519
+ || IterablePrototype['@@iterator']
1520
+ || DEFAULT && IterablePrototype[DEFAULT];
1521
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1522
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1523
+ var CurrentIteratorPrototype, methods, KEY;
1524
+
1525
+ // fix native
1526
+ if (anyNativeIterator) {
1527
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1528
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1529
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1530
+ if (setPrototypeOf) {
1531
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1532
+ } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1533
+ redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1534
+ }
1535
+ }
1536
+ // Set @@toStringTag to native iterators
1537
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1538
+ }
1539
+ }
1540
+
1541
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1542
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1543
+ if (CONFIGURABLE_FUNCTION_NAME) {
1544
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
1545
+ } else {
1546
+ INCORRECT_VALUES_NAME = true;
1547
+ defaultIterator = function values() { return call(nativeIterator, this); };
1548
+ }
1549
+ }
1550
+
1551
+ // export additional methods
1552
+ if (DEFAULT) {
1553
+ methods = {
1554
+ values: getIterationMethod(VALUES),
1555
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1556
+ entries: getIterationMethod(ENTRIES)
1557
+ };
1558
+ if (FORCED) for (KEY in methods) {
1559
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1560
+ redefine(IterablePrototype, KEY, methods[KEY]);
1561
+ }
1562
+ } else $$1({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1563
+ }
1564
+
1565
+ // define iterator
1566
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1567
+ redefine(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1568
+ }
1569
+ Iterators$1[NAME] = defaultIterator;
1570
+
1571
+ return methods;
1572
+ };
1573
+
1574
+ var toIndexedObject = toIndexedObject$5;
1575
+ var addToUnscopables = addToUnscopables$1;
1576
+ var Iterators = iterators;
1577
+ var InternalStateModule = internalState;
1578
+ var defineProperty$1 = objectDefineProperty.f;
1579
+ var defineIterator = defineIterator$1;
1580
+ var DESCRIPTORS$1 = descriptors;
1581
+
1582
+ var ARRAY_ITERATOR = 'Array Iterator';
1583
+ var setInternalState = InternalStateModule.set;
1584
+ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
1585
+
1586
+ // `Array.prototype.entries` method
1587
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1588
+ // `Array.prototype.keys` method
1589
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1590
+ // `Array.prototype.values` method
1591
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1592
+ // `Array.prototype[@@iterator]` method
1593
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1594
+ // `CreateArrayIterator` internal method
1595
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1596
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1597
+ setInternalState(this, {
1598
+ type: ARRAY_ITERATOR,
1599
+ target: toIndexedObject(iterated), // target
1600
+ index: 0, // next index
1601
+ kind: kind // kind
1602
+ });
1603
+ // `%ArrayIteratorPrototype%.next` method
1604
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1605
+ }, function () {
1606
+ var state = getInternalState(this);
1607
+ var target = state.target;
1608
+ var kind = state.kind;
1609
+ var index = state.index++;
1610
+ if (!target || index >= target.length) {
1611
+ state.target = undefined;
1612
+ return { value: undefined, done: true };
1613
+ }
1614
+ if (kind == 'keys') return { value: index, done: false };
1615
+ if (kind == 'values') return { value: target[index], done: false };
1616
+ return { value: [index, target[index]], done: false };
1617
+ }, 'values');
1618
+
1619
+ // argumentsList[@@iterator] is %ArrayProto_values%
1620
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1621
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1622
+ var values = Iterators.Arguments = Iterators.Array;
1623
+
1624
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1625
+ addToUnscopables('keys');
1626
+ addToUnscopables('values');
1627
+ addToUnscopables('entries');
1628
+
1629
+ // V8 ~ Chrome 45- bug
1630
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1631
+ defineProperty$1(values, 'name', { value: 'values' });
1632
+ } catch (error) { /* empty */ }
1633
+
1634
+ // iterable DOM collections
1635
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1636
+ var domIterables = {
1637
+ CSSRuleList: 0,
1638
+ CSSStyleDeclaration: 0,
1639
+ CSSValueList: 0,
1640
+ ClientRectList: 0,
1641
+ DOMRectList: 0,
1642
+ DOMStringList: 0,
1643
+ DOMTokenList: 1,
1644
+ DataTransferItemList: 0,
1645
+ FileList: 0,
1646
+ HTMLAllCollection: 0,
1647
+ HTMLCollection: 0,
1648
+ HTMLFormElement: 0,
1649
+ HTMLSelectElement: 0,
1650
+ MediaList: 0,
1651
+ MimeTypeArray: 0,
1652
+ NamedNodeMap: 0,
1653
+ NodeList: 1,
1654
+ PaintRequestList: 0,
1655
+ Plugin: 0,
1656
+ PluginArray: 0,
1657
+ SVGLengthList: 0,
1658
+ SVGNumberList: 0,
1659
+ SVGPathSegList: 0,
1660
+ SVGPointList: 0,
1661
+ SVGStringList: 0,
1662
+ SVGTransformList: 0,
1663
+ SourceBufferList: 0,
1664
+ StyleSheetList: 0,
1665
+ TextTrackCueList: 0,
1666
+ TextTrackList: 0,
1667
+ TouchList: 0
1668
+ };
1669
+
1670
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1671
+ var documentCreateElement = documentCreateElement$2;
1672
+
1673
+ var classList = documentCreateElement('span').classList;
1674
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1675
+
1676
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1677
+
1678
+ var global$4 = global$r;
1679
+ var DOMIterables = domIterables;
1680
+ var DOMTokenListPrototype = domTokenListPrototype;
1681
+ var ArrayIteratorMethods = es_array_iterator;
1682
+ var createNonEnumerableProperty = createNonEnumerableProperty$5;
1683
+ var wellKnownSymbol$2 = wellKnownSymbol$8;
1684
+
1685
+ var ITERATOR = wellKnownSymbol$2('iterator');
1686
+ var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1687
+ var ArrayValues = ArrayIteratorMethods.values;
1688
+
1689
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1690
+ if (CollectionPrototype) {
1691
+ // some Chrome versions have non-configurable methods on DOMTokenList
1692
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1693
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1694
+ } catch (error) {
1695
+ CollectionPrototype[ITERATOR] = ArrayValues;
1696
+ }
1697
+ if (!CollectionPrototype[TO_STRING_TAG$2]) {
1698
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
1699
+ }
1700
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1701
+ // some Chrome versions have non-configurable methods on DOMTokenList
1702
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1703
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1704
+ } catch (error) {
1705
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1706
+ }
1707
+ }
1708
+ }
1709
+ };
1710
+
1711
+ for (var COLLECTION_NAME in DOMIterables) {
1712
+ handlePrototype(global$4[COLLECTION_NAME] && global$4[COLLECTION_NAME].prototype, COLLECTION_NAME);
1713
+ }
1714
+
1715
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1716
+
1717
+ const Flexbox = _a => {
1718
+ var {
1719
+ alignContent,
1720
+ alignItems,
1721
+ alignSelf,
1722
+ children,
1723
+ justifyContent,
1724
+ flexDirection,
1725
+ flexWrap,
1726
+ className
1727
+ } = _a,
1728
+ props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
1729
+
1730
+ const [classes, setClasses] = React.useState(['d-flex']);
1731
+ const [flexClassName, setFlexClassName] = React.useState('d-flex'); // // update className when classes change
1732
+
1733
+ React.useLayoutEffect(() => {
1734
+ const newClassName = classes.join(' ');
1735
+ if (newClassName !== flexClassName) setFlexClassName(newClassName);
1736
+ }, [classes, flexClassName]); // // update classes when props change
1737
+
1738
+ React.useLayoutEffect(() => {
1739
+ const newClasses = ['d-flex'];
1740
+ alignItems && newClasses.push(`align-items-${alignItems}`);
1741
+ alignContent && newClasses.push(`align-content-${alignContent}`);
1742
+ alignSelf && newClasses.push(`align-self-${alignSelf}`);
1743
+ justifyContent && newClasses.push(`justify-content-${justifyContent}`);
1744
+ flexDirection && newClasses.push(`flex-${flexDirection}`);
1745
+ flexWrap && newClasses.push(`flex-${flexWrap}`);
1746
+ className && newClasses.push(className);
1747
+ setClasses(newClasses);
1748
+ }, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
1749
+ return jsxRuntime.jsx("div", Object.assign({
1750
+ className: flexClassName
1751
+ }, props, {
1752
+ children: children
1753
+ }));
1754
+ };
1755
+
1756
+ function Card({
1757
+ children,
1758
+ header,
1759
+ footer
1760
+ }) {
1761
+ return jsxRuntime.jsxs("section", Object.assign({
1762
+ className: "card"
1763
+ }, {
1764
+ children: [jsxRuntime.jsx("header", {
1765
+ children: header
1766
+ }), jsxRuntime.jsx("p", {
1767
+ children: children
1768
+ }), jsxRuntime.jsx("footer", {
1769
+ children: footer
1770
+ })]
1771
+ }));
1772
+ }
1773
+
1774
+ function Alert({
1775
+ type,
1776
+ header,
1777
+ footer,
1778
+ children,
1779
+ closeText,
1780
+ isCloseable = true
1781
+ }) {
1782
+ const [closeButton, setCloseButton] = React.useState();
1783
+ React.useEffect(() => {
1784
+ if (!isCloseable) {
1785
+ setCloseButton(null);
1786
+ } else {
1787
+ if (closeText) setCloseButton(jsxRuntime.jsx(Button, Object.assign({
1788
+ variant: "ghost"
1789
+ }, {
1790
+ children: jsxRuntime.jsx("span", Object.assign({
1791
+ className: "sr-only"
1792
+ }, {
1793
+ children: closeText
1794
+ }))
1795
+ })));else setCloseButton(jsxRuntime.jsx("button", {
1796
+ className: "close"
1797
+ }));
1798
+ }
1799
+ }, [isCloseable, closeText]);
1800
+ return jsxRuntime.jsxs("div", Object.assign({
1801
+ role: "alert",
1802
+ className: type
1803
+ }, {
1804
+ children: [header && jsxRuntime.jsxs("header", {
1805
+ children: [/*#__PURE__*/React__default["default"].isValidElement(header) ? header : jsxRuntime.jsx("h3", {
1806
+ children: header
1807
+ }), closeButton]
1808
+ }), jsxRuntime.jsx("p", {
1809
+ children: children
1810
+ }), footer && jsxRuntime.jsx("footer", {
1811
+ children: footer
1812
+ })]
1813
+ }));
1814
+ }
1815
+
1816
+ const ButtonGroup = ({
1817
+ children,
1818
+ selectedIndex,
1819
+ variant
1820
+ }) => {
1821
+ const [selected, setSelected] = React.useState(selectedIndex);
1822
+ const [buttons, setButtons] = React.useState([]);
1823
+ React.useEffect(() => {
1824
+ const buttonProps = (children instanceof Array ? children : [children]).filter(b => b && b.props).map((b, ix) => {
1825
+ const bp = b.props;
1826
+ const props = Object.assign(Object.assign({}, bp), {
1827
+ variant,
1828
+ key: bp.key || `btn_${ix}`,
1829
+ active: ix === selected,
1830
+ onClick: e => {
1831
+ setSelected(ix);
1832
+ if (bp.onClick) bp.onClick(e);
1833
+ }
1834
+ });
1835
+ return props;
1836
+ });
1837
+ setButtons(buttonProps);
1838
+ }, [children, selected, variant]);
1839
+ return jsxRuntime.jsx(Group, {
1840
+ children: buttons.map(props => jsxRuntime.jsx(Button, Object.assign({}, props), props.key))
1841
+ });
1842
+ };
1843
+
1844
+ const validateInputValue = (target, rules, setError) => {
1845
+ const errorMessage = validateInputValueErrors(rules, target);
1846
+ errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
1847
+ return errorMessage;
1848
+ };
1849
+
1850
+ const validateInputValueErrors = (rules, target) => {
1851
+ const {
1852
+ value
1853
+ } = target;
1854
+
1855
+ if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
1856
+ return rules === null || rules === void 0 ? void 0 : rules.custom();
1857
+ }
1858
+
1859
+ return validateTextInputValues(value, rules);
1860
+ };
1861
+
1862
+ const setErrorInsert = (setError, name) => {
1863
+ setError(errors => {
1864
+ return Object.assign(Object.assign({}, errors), {
1865
+ [name]: true
1866
+ });
1867
+ });
1868
+ };
1869
+
1870
+ const setErrorRemove = (setError, name) => {
1871
+ setError(errors => {
1872
+ const newError = Object.assign({}, errors);
1873
+ delete newError[name];
1874
+ return newError;
1875
+ });
1876
+ };
1877
+
1878
+ const validateTextInputValues = (value, rules) => {
1879
+ switch (rules === null || rules === void 0 ? void 0 : rules.type) {
1880
+ case 'Required':
1881
+ {
1882
+ return value === '' || value === undefined || value === null ? 'error' : null;
1883
+ }
1884
+
1885
+ default:
1886
+ {
1887
+ return;
1888
+ }
1889
+ }
1890
+ };
1891
+
1892
+ const FormContext = /*#__PURE__*/React__default["default"].createContext({});
1893
+ const useFormContext = () => {
1894
+ return React__default["default"].useContext(FormContext);
1895
+ };
1896
+ const FormProvider = _a => {
1897
+ var {
1898
+ children,
1899
+ direction = 'vertical',
1900
+ formSize = 'md',
1901
+ onSubmit,
1902
+ onFormSubmit
1903
+ } = _a,
1904
+ props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
1905
+
1906
+ const [values, setValues] = React__default["default"].useState();
1907
+ const [errors, setErrors] = React__default["default"].useState();
1908
+ const [fields, setFields] = React__default["default"].useState({});
1909
+
1910
+ const formSubmit = event => {
1911
+ let hasError = false;
1912
+ event.preventDefault();
1913
+ Object.keys(fields).forEach(key => {
1914
+ const errorMessage = validateInputValue({
1915
+ name: key,
1916
+ value: values === null || values === void 0 ? void 0 : values[key]
1917
+ }, fields[key], setErrors);
1918
+ hasError = hasError || !!errorMessage;
1919
+ });
1920
+
1921
+ if (!hasError) {
1922
+ onFormSubmit && onFormSubmit(values);
1923
+ }
1924
+ };
1925
+
1926
+ const resetForm = () => {
1927
+ setValues({});
1928
+ setErrors({});
1929
+ };
1930
+
1931
+ return jsxRuntime.jsx(FormContext.Provider, Object.assign({
1932
+ value: {
1933
+ setValues,
1934
+ setErrors,
1935
+ setFields,
1936
+ errors,
1937
+ values
1938
+ }
1939
+ }, {
1940
+ children: jsxRuntime.jsx("form", Object.assign({
1941
+ className: [direction, `size-${formSize}`].join(' '),
1942
+ onSubmit: formSubmit
1943
+ }, props, {
1944
+ onReset: resetForm
1945
+ }, {
1946
+ children: children
1947
+ }))
1948
+ }));
1949
+ };
1950
+
1951
+ const Form = props => {
1952
+ return jsxRuntime.jsx(FormProvider, Object.assign({}, props));
1953
+ };
1954
+
1955
+ const FormItems = ({
1956
+ children,
1957
+ validate,
1958
+ name
1959
+ }) => {
1960
+ const {
1961
+ setValues,
1962
+ setErrors,
1963
+ setFields,
1964
+ errors
1965
+ } = useFormContext();
1966
+ React__default["default"].useEffect(() => {
1967
+ setFields(fields => Object.assign(Object.assign({}, fields), {
1968
+ [name]: validate === null || validate === void 0 ? void 0 : validate.rules
1969
+ }));
1970
+
1971
+ const removeValues = values => {
1972
+ const newValues = Object.assign({}, values);
1973
+ delete newValues[name];
1974
+ return newValues;
1975
+ };
1976
+
1977
+ return () => {
1978
+ setFields(fields => removeValues(fields));
1979
+ setValues(values => removeValues(values));
1980
+ setErrors(errors => removeValues(errors));
1981
+ };
1982
+ }, []);
1983
+
1984
+ const onChange = event => {
1985
+ const {
1986
+ value,
1987
+ name,
1988
+ type,
1989
+ checked
1990
+ } = event.target;
1991
+ let inputValue;
1992
+
1993
+ if (type === 'checkbox') {
1994
+ inputValue = checked ? value : null;
1995
+ checked ? setValues(values => Object.assign(Object.assign({}, values), {
1996
+ [name]: value
1997
+ })) : setValues(values => Object.assign(Object.assign({}, values), {
1998
+ [name]: null
1999
+ }));
2000
+ } else {
2001
+ inputValue = value;
2002
+ setValues(values => Object.assign(Object.assign({}, values), {
2003
+ [name]: value
2004
+ }));
2005
+ }
2006
+
2007
+ validateInputValue({
2008
+ value: inputValue,
2009
+ name,
2010
+ type,
2011
+ checked
2012
+ }, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
2013
+ };
2014
+
2015
+ return /*#__PURE__*/React__default["default"].cloneElement(children, {
2016
+ validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
2017
+ name,
2018
+ onChange
2019
+ });
2020
+ };
2021
+
2022
+ function Group({
2023
+ children,
2024
+ error,
2025
+ groupBorder = false
2026
+ }) {
2027
+ const groupClassName = `group ${groupBorder ? 'group-border' : ''} ${error ? 'is-invalid' : ''}`;
2028
+ const errorMessage = error ? error.message || error : '';
2029
+ return jsxRuntime.jsxs("div", Object.assign({
2030
+ className: "form-group"
2031
+ }, {
2032
+ children: [jsxRuntime.jsx("div", Object.assign({
2033
+ className: groupClassName
2034
+ }, {
2035
+ children: children
2036
+ })), error && jsxRuntime.jsx("span", Object.assign({
2037
+ className: "form-info"
2038
+ }, {
2039
+ children: errorMessage
2040
+ }))]
2041
+ }));
2042
+ }
2043
+
2044
+ const useInput = (props, onChanges, onChangeInput) => {
2045
+ const id = React.useMemo(() => props.id || extract.randomId(), [props.id]);
2046
+ const ref = React.useRef(null);
2047
+ const [value, setValue] = React.useState(props.value ? props.value : '');
2048
+ const [checked, setChecked] = React.useState(props.checked ? props.checked : false);
2049
+ React.useEffect(() => {
2050
+ if (ref.current && ref.current.form) {
2051
+ const resetListener = () => {
2052
+ setValue(props.value ? props.value : '');
2053
+ setChecked(props.checked ? props.checked : false);
2054
+ };
2055
+
2056
+ const form = ref.current.form;
2057
+ form.addEventListener('reset', resetListener);
2058
+ return () => form.removeEventListener('reset', resetListener);
2059
+ } else {
2060
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2061
+ return () => {};
2062
+ }
2063
+ }, [props]);
2064
+
2065
+ const onChange = event => {
2066
+ setValue(event.target.value);
2067
+ setChecked(event.currentTarget.checked);
2068
+ onChanges && onChanges(event);
2069
+ onChangeInput && onChangeInput(event.target.value);
2070
+ };
2071
+
2072
+ return Object.assign(Object.assign({}, props), {
2073
+ id,
2074
+ ref,
2075
+ value,
2076
+ checked,
2077
+ onChange
2078
+ });
2079
+ };
2080
+
2081
+ const RenderInput = (type, props, onChange, onChangeInput, label, info, validator) => {
2082
+ const _a = useInput(props, onChange, onChangeInput),
2083
+ {
2084
+ value
2085
+ } = _a,
2086
+ inputProps = __rest(_a, ["value"]);
2087
+
2088
+ const propsWithDescription = info ? Object.assign(Object.assign({}, inputProps), {
2089
+ 'aria-describedby': `${inputProps.id}_info`
2090
+ }) : inputProps; // Render naked
2091
+
2092
+ if (!label && !info) return jsxRuntime.jsx("input", Object.assign({
2093
+ type: type,
2094
+ value: value
2095
+ }, propsWithDescription));
2096
+ return jsxRuntime.jsxs("div", Object.assign({
2097
+ className: "form-group"
2098
+ }, {
2099
+ children: [label && jsxRuntime.jsx("label", Object.assign({
2100
+ htmlFor: inputProps.id
2101
+ }, {
2102
+ children: label
2103
+ })), info && jsxRuntime.jsx("span", Object.assign({
2104
+ className: "form-info",
2105
+ id: `${inputProps.id}_info`
2106
+ }, {
2107
+ children: info
2108
+ })), jsxRuntime.jsx("input", Object.assign({
2109
+ type: type,
2110
+ value: value
2111
+ }, propsWithDescription, {
2112
+ className: validator && extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
2113
+ })), validator && jsxRuntime.jsx("span", Object.assign({
2114
+ className: "form-info"
2115
+ }, {
2116
+ children: validator.message
2117
+ }))]
2118
+ }));
2119
+ };
2120
+ const TextInput = _a => {
2121
+ var {
2122
+ label,
2123
+ info,
2124
+ onChange,
2125
+ onChangeInput,
2126
+ validator
2127
+ } = _a,
2128
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
2129
+
2130
+ return RenderInput('text', props, onChange, onChangeInput, label, info, validator);
2131
+ };
2132
+ const EmailInput = _a => {
2133
+ var {
2134
+ label,
2135
+ info,
2136
+ onChange,
2137
+ onChangeInput,
2138
+ validator
2139
+ } = _a,
2140
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
2141
+
2142
+ return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
2143
+ };
2144
+ const NumberInput = _a => {
2145
+ var {
2146
+ label,
2147
+ info,
2148
+ onChange,
2149
+ onChangeInput,
2150
+ validator
2151
+ } = _a,
2152
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
2153
+
2154
+ return RenderInput('number', props, onChange, onChangeInput, label, info, validator);
2155
+ };
2156
+ const Checkbox = _a => {
2157
+ var {
2158
+ label,
2159
+ onChange,
2160
+ validator
2161
+ } = _a,
2162
+ props = __rest(_a, ["label", "onChange", "validator"]);
2163
+
2164
+ const inputProps = useInput(props, onChange);
2165
+ const validatorClassName = extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2166
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
2167
+ children: [jsxRuntime.jsxs("label", Object.assign({
2168
+ htmlFor: inputProps.id,
2169
+ className: `form-control ${validatorClassName}`
2170
+ }, {
2171
+ children: [label, jsxRuntime.jsx("input", Object.assign({
2172
+ type: "checkbox"
2173
+ }, inputProps)), jsxRuntime.jsx("span", {}), jsxRuntime.jsx("i", {})]
2174
+ })), validator && jsxRuntime.jsx("span", Object.assign({
2175
+ className: "form-info"
2176
+ }, {
2177
+ children: validator.message
2178
+ }))]
2179
+ });
2180
+ };
2181
+ const RadioButton = /*#__PURE__*/React__default["default"].forwardRef((_a, ref) => {
2182
+ var {
2183
+ label,
2184
+ validator
2185
+ } = _a,
2186
+ props = __rest(_a, ["label", "validator"]);
2187
+
2188
+ const {
2189
+ id
2190
+ } = useInput(props);
2191
+ return jsxRuntime.jsxs("label", Object.assign({
2192
+ htmlFor: id,
2193
+ className: "form-control"
2194
+ }, {
2195
+ children: [jsxRuntime.jsx("input", Object.assign({
2196
+ id: id,
2197
+ type: "radio"
2198
+ }, props, {
2199
+ className: validator,
2200
+ ref: ref
2201
+ })), jsxRuntime.jsx("span", {
2202
+ children: label
2203
+ }), jsxRuntime.jsx("i", {})]
2204
+ }));
2205
+ });
2206
+
2207
+ const Text = ({
2208
+ children
2209
+ }) => jsxRuntime.jsx("span", Object.assign({
2210
+ className: "form-text"
2211
+ }, {
2212
+ children: children
2213
+ }));
2214
+
2215
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
2216
+
2217
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
2218
+ var test = {};
2219
+
2220
+ test[TO_STRING_TAG$1] = 'z';
2221
+
2222
+ var toStringTagSupport = String(test) === '[object z]';
2223
+
2224
+ var global$3 = global$r;
2225
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2226
+ var isCallable$1 = isCallable$f;
2227
+ var classofRaw = classofRaw$1;
2228
+ var wellKnownSymbol = wellKnownSymbol$8;
2229
+
2230
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2231
+ var Object$1 = global$3.Object;
2232
+
2233
+ // ES3 wrong here
2234
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2235
+
2236
+ // fallback for IE11 Script Access Denied error
2237
+ var tryGet = function (it, key) {
2238
+ try {
2239
+ return it[key];
2240
+ } catch (error) { /* empty */ }
2241
+ };
2242
+
2243
+ // getting tag from ES6+ `Object.prototype.toString`
2244
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2245
+ var O, tag, result;
2246
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
2247
+ // @@toStringTag case
2248
+ : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
2249
+ // builtinTag case
2250
+ : CORRECT_ARGUMENTS ? classofRaw(O)
2251
+ // ES3 arguments fallback
2252
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
2253
+ };
2254
+
2255
+ var global$2 = global$r;
2256
+ var classof = classof$1;
2257
+
2258
+ var String$1 = global$2.String;
2259
+
2260
+ var toString$1 = function (argument) {
2261
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
2262
+ return String$1(argument);
2263
+ };
2264
+
2265
+ var $ = _export;
2266
+ var DESCRIPTORS = descriptors;
2267
+ var global$1 = global$r;
2268
+ var uncurryThis = functionUncurryThis;
2269
+ var hasOwn = hasOwnProperty_1;
2270
+ var isCallable = isCallable$f;
2271
+ var isPrototypeOf = objectIsPrototypeOf;
2272
+ var toString = toString$1;
2273
+ var defineProperty = objectDefineProperty.f;
2274
+ var copyConstructorProperties = copyConstructorProperties$2;
2275
+
2276
+ var NativeSymbol = global$1.Symbol;
2277
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
2278
+
2279
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
2280
+ // Safari 12 bug
2281
+ NativeSymbol().description !== undefined
2282
+ )) {
2283
+ var EmptyStringDescriptionStore = {};
2284
+ // wrap Symbol constructor for correct work with undefined description
2285
+ var SymbolWrapper = function Symbol() {
2286
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
2287
+ var result = isPrototypeOf(SymbolPrototype, this)
2288
+ ? new NativeSymbol(description)
2289
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
2290
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
2291
+ if (description === '') EmptyStringDescriptionStore[result] = true;
2292
+ return result;
2293
+ };
2294
+
2295
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
2296
+ SymbolWrapper.prototype = SymbolPrototype;
2297
+ SymbolPrototype.constructor = SymbolWrapper;
2298
+
2299
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
2300
+ var symbolToString = uncurryThis(SymbolPrototype.toString);
2301
+ var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
2302
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
2303
+ var replace = uncurryThis(''.replace);
2304
+ var stringSlice = uncurryThis(''.slice);
2305
+
2306
+ defineProperty(SymbolPrototype, 'description', {
2307
+ configurable: true,
2308
+ get: function description() {
2309
+ var symbol = symbolValueOf(this);
2310
+ var string = symbolToString(symbol);
2311
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
2312
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
2313
+ return desc === '' ? undefined : desc;
2314
+ }
2315
+ });
2316
+
2317
+ $({ global: true, forced: true }, {
2318
+ Symbol: SymbolWrapper
2319
+ });
2320
+ }
2321
+
2322
+ const RadioGroup = ({
2323
+ description,
2324
+ title,
2325
+ validator,
2326
+ onChangeRadio,
2327
+ onChange,
2328
+ name,
2329
+ children
2330
+ }) => {
2331
+ const [checked, setChecked] = React__default["default"].useState();
2332
+ const validatorClassName = extract.validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2333
+
2334
+ const onChanges = event => {
2335
+ setChecked(event.target.value);
2336
+ onChangeRadio && onChangeRadio(event.target.value);
2337
+ onChange && onChange(event);
2338
+ };
2339
+
2340
+ const radioBtnRef = React__default["default"].useRef(null);
2341
+ React__default["default"].useEffect(() => {
2342
+ var _a;
2343
+
2344
+ if (radioBtnRef && radioBtnRef.current) {
2345
+ const form = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
2346
+
2347
+ const resetListner = () => {
2348
+ setChecked(undefined);
2349
+ };
2350
+
2351
+ form === null || form === void 0 ? void 0 : form.addEventListener('reset', resetListner);
2352
+ return () => form === null || form === void 0 ? void 0 : form.removeEventListener('reset', resetListner);
2353
+ } else {
2354
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2355
+ return () => {};
2356
+ }
2357
+ }, []);
2358
+ return jsxRuntime.jsxs("div", Object.assign({
2359
+ className: "form-group"
2360
+ }, {
2361
+ children: [jsxRuntime.jsxs("fieldset", Object.assign({
2362
+ className: validatorClassName
2363
+ }, {
2364
+ children: [jsxRuntime.jsx("legend", {
2365
+ children: title
2366
+ }), jsxRuntime.jsx("span", Object.assign({
2367
+ className: "form-info"
2368
+ }, {
2369
+ children: description
2370
+ })), React__default["default"].Children.map(children, Child => {
2371
+ return /*#__PURE__*/React__default["default"].isValidElement(Child) ? /*#__PURE__*/React__default["default"].cloneElement(Child, {
2372
+ validator: validatorClassName,
2373
+ onChange: onChanges,
2374
+ checked: checked === Child.props.value,
2375
+ name,
2376
+ ref: radioBtnRef
2377
+ }) : Child;
2378
+ })]
2379
+ })), (validator === null || validator === void 0 ? void 0 : validator.message) && jsxRuntime.jsx("span", Object.assign({
2380
+ className: "form-info"
2381
+ }, {
2382
+ children: validator === null || validator === void 0 ? void 0 : validator.message
2383
+ }))]
2384
+ }));
2385
+ };
2386
+
2387
+ const ListItem = _a => {
2388
+ var {
2389
+ listType,
2390
+ tableRowData,
2391
+ children
2392
+ } = _a,
2393
+ props = __rest(_a, ["listType", "tableRowData", "children"]);
2394
+
2395
+ if (listType === 'table') {
2396
+ return jsxRuntime.jsx("dl", {
2397
+ children: jsxRuntime.jsxs("div", {
2398
+ children: [jsxRuntime.jsx("dt", {
2399
+ children: tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.title
2400
+ }), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.definition.map((item, index) => jsxRuntime.jsx("dd", {
2401
+ children: item
2402
+ }, index))]
2403
+ })
2404
+ });
2405
+ } else {
2406
+ return jsxRuntime.jsx("li", Object.assign({}, props, {
2407
+ children: children
2408
+ }));
2409
+ }
2410
+ };
2411
+
2412
+ const List = _a => {
2413
+ var {
2414
+ listType,
2415
+ tableCaption,
2416
+ tableData,
2417
+ children
2418
+ } = _a,
2419
+ props = __rest(_a, ["listType", "tableCaption", "tableData", "children"]);
2420
+
2421
+ if (listType === 'ordered') {
2422
+ return jsxRuntime.jsx("ol", Object.assign({}, props, {
2423
+ children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsxRuntime.jsx(ListItem, {
2424
+ children: child
2425
+ }, index))
2426
+ }));
2427
+ } else if (listType !== 'table') {
2428
+ return jsxRuntime.jsx("ul", Object.assign({}, props, {
2429
+ className: listType
2430
+ }, {
2431
+ children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsxRuntime.jsx(ListItem, {
2432
+ children: child
2433
+ }, index))
2434
+ }));
2435
+ } else {
2436
+ return jsxRuntime.jsxs("figure", {
2437
+ children: [jsxRuntime.jsx("figcaption", Object.assign({
2438
+ className: "table-list-caption"
2439
+ }, {
2440
+ children: tableCaption
2441
+ })), jsxRuntime.jsx("dl", {
2442
+ children: tableData === null || tableData === void 0 ? void 0 : tableData.map((data, index) => jsxRuntime.jsx(ListItem, {
2443
+ listType: listType,
2444
+ tableRowData: data
2445
+ }, index))
2446
+ })]
2447
+ });
2448
+ }
2449
+ };
2450
+
2451
+ const Link = _a => {
2452
+ var {
2453
+ button,
2454
+ children
2455
+ } = _a,
2456
+ props = __rest(_a, ["button", "children"]);
2457
+
2458
+ const [anchorProps, setAnchorProps] = React.useState({});
2459
+ React.useEffect(() => {
2460
+ const className = button ? typeof button === 'string' ? `button ${button}` : 'button' : undefined;
2461
+ const newProps = Object.assign({
2462
+ role: button ? 'button' : undefined,
2463
+ className: className
2464
+ }, props);
2465
+ setAnchorProps(newProps);
2466
+ }, [button]);
2467
+ return jsxRuntime.jsx("a", Object.assign({}, anchorProps, {
2468
+ children: children
2469
+ }));
2470
+ };
2471
+
2472
+ const Navbar = ({
2473
+ children,
2474
+ variant,
2475
+ title,
2476
+ titleLink,
2477
+ brandLink: _brandLink = 'https://www.seb.se',
2478
+ brandAriaLabel: _brandAriaLabel = 'Open seb.se in new tab'
2479
+ }) => {
2480
+ const [props, setProps] = React.useState({});
2481
+ React.useEffect(() => {
2482
+ const classNames = [];
2483
+ if (variant) classNames.push(variant);
2484
+ setProps(Object.assign(Object.assign({}, props), {
2485
+ className: classNames.join(' ')
2486
+ })); // eslint-disable-next-line react-hooks/exhaustive-deps
2487
+ }, [variant]);
2488
+ return jsxRuntime.jsxs("nav", Object.assign({
2489
+ role: "navigation"
2490
+ }, props, {
2491
+ children: [jsxRuntime.jsx(Link, {
2492
+ "aria-label": _brandAriaLabel,
2493
+ href: _brandLink,
2494
+ target: "_blank",
2495
+ className: "brand"
2496
+ }), jsxRuntime.jsx("div", Object.assign({
2497
+ className: "container-fluid"
2498
+ }, {
2499
+ children: jsxRuntime.jsxs("div", Object.assign({
2500
+ className: "row justify-content-between align-items-center"
2501
+ }, {
2502
+ children: [jsxRuntime.jsx("div", Object.assign({
2503
+ className: "col-auto"
2504
+ }, {
2505
+ children: titleLink ? jsxRuntime.jsx(Link, Object.assign({
2506
+ className: "mx-4",
2507
+ href: titleLink
2508
+ }, {
2509
+ children: jsxRuntime.jsx("h1", {
2510
+ children: title
2511
+ })
2512
+ })) : jsxRuntime.jsx("h1", {
2513
+ children: title
2514
+ })
2515
+ })), jsxRuntime.jsx("div", Object.assign({
2516
+ className: "col-auto"
2517
+ }, {
2518
+ children: jsxRuntime.jsx("div", Object.assign({
2519
+ className: "group size-sm"
2520
+ }, {
2521
+ children: children
2522
+ }))
2523
+ }))]
2524
+ }))
2525
+ }))]
2526
+ }));
2527
+ };
2528
+
2529
+ function Badge(_a) {
2530
+ var {
2531
+ children,
2532
+ badgeType,
2533
+ isCloseable,
2534
+ closeText
2535
+ } = _a,
2536
+ props = __rest(_a, ["children", "badgeType", "isCloseable", "closeText"]);
2537
+
2538
+ const [isClosed, setIsClosed] = React__default["default"].useState(false);
2539
+ return !isClosed ? jsxRuntime.jsxs("span", Object.assign({}, props, {
2540
+ className: `badge ${badgeType}`
2541
+ }, {
2542
+ children: [jsxRuntime.jsx("strong", {
2543
+ children: children
2544
+ }), isCloseable && jsxRuntime.jsx("button", Object.assign({
2545
+ type: "button",
2546
+ className: "close",
2547
+ onClick: () => setIsClosed(true)
2548
+ }, {
2549
+ children: closeText
2550
+ }))]
2551
+ })) : null;
2552
+ }
2553
+
2554
+ const useDropdown = ({
2555
+ id,
2556
+ texts,
2557
+ options,
2558
+ loop,
2559
+ multiSelect,
2560
+ selectValue,
2561
+ useValue,
2562
+ display,
2563
+ togglerRef,
2564
+ listboxRef
2565
+ }) => {
2566
+ const [handler, setHandler] = React.useState();
2567
+ const [dropdown, setDropdown] = React.useState();
2568
+ const [togglerProps, setTogglerProps] = React.useState({});
2569
+ const [listboxProps, setListboxProps] = React.useState({});
2570
+ const [listItems, setListItems] = React.useState([]);
2571
+ const [multiSelectProps, setMultiSelectProps] = React.useState({}); // When dropdown data changes
2572
+
2573
+ React.useEffect(() => {
2574
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2575
+
2576
+ if (!dropdown) return;
2577
+ const {
2578
+ elements: {
2579
+ toggler,
2580
+ listbox
2581
+ }
2582
+ } = dropdown;
2583
+ const newToggleProps = Object.assign(Object.assign({}, toggler === null || toggler === void 0 ? void 0 : toggler.attributes), {
2584
+ className: (_a = toggler === null || toggler === void 0 ? void 0 : toggler.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2585
+ children: ((_b = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _b === void 0 ? void 0 : _b.select) || ((_c = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _c === void 0 ? void 0 : _c.placeholder),
2586
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.toggle()
2587
+ });
2588
+ setTogglerProps(newToggleProps);
2589
+ const newListboxProps = Object.assign(Object.assign({}, listbox === null || listbox === void 0 ? void 0 : listbox.attributes), {
2590
+ className: (_d = listbox === null || listbox === void 0 ? void 0 : listbox.classes) === null || _d === void 0 ? void 0 : _d.join(' ')
2591
+ });
2592
+ setListboxProps(newListboxProps);
2593
+
2594
+ if (!dropdown.isMultiSelect) {
2595
+ const newListItems = dropdown.options.map(o => {
2596
+ var _a;
2597
+
2598
+ return Object.assign(Object.assign({}, o.attributes), {
2599
+ className: (_a = o.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2600
+ children: o[dropdown.display],
2601
+ selected: o.selected,
2602
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.select(o)
2603
+ });
2604
+ });
2605
+ setListItems(newListItems);
2606
+ } else {
2607
+ const checkboxes = dropdown.options.map(o => ({
2608
+ labelProps: Object.assign(Object.assign({}, o.attributes), {
2609
+ className: ['form-control', ...o.classes].join(' ')
2610
+ }),
2611
+ inputProps: {
2612
+ defaultChecked: o.selected,
2613
+ type: 'checkbox',
2614
+ onChange: () => handler === null || handler === void 0 ? void 0 : handler.select(o, false)
2615
+ },
2616
+ spanProps: {
2617
+ children: o[dropdown.display]
2618
+ }
2619
+ }));
2620
+ const newMultiselect = {
2621
+ fieldsetProps: {
2622
+ 'aria-describedby': (_g = (_f = (_e = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _e === void 0 ? void 0 : _e.fieldset) === null || _f === void 0 ? void 0 : _f.attributes) === null || _g === void 0 ? void 0 : _g.id,
2623
+ 'aria-multiselectable': true,
2624
+ role: 'listbox',
2625
+ tabIndex: -1
2626
+ },
2627
+ legendProps: {
2628
+ className: 'sr-only',
2629
+ id: (_k = (_j = (_h = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _h === void 0 ? void 0 : _h.fieldset) === null || _j === void 0 ? void 0 : _j.attributes) === null || _k === void 0 ? void 0 : _k.id,
2630
+ children: dropdown.texts.optionsDescription
2631
+ },
2632
+ checkboxes
2633
+ };
2634
+ setMultiSelectProps(newMultiselect);
2635
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
2636
+
2637
+ }, [dropdown]); // When dropdown properties change
2638
+
2639
+ React.useEffect(() => {
2640
+ if (!dropdown) return;
2641
+ handler === null || handler === void 0 ? void 0 : handler.update({
2642
+ id,
2643
+ texts,
2644
+ options,
2645
+ loop,
2646
+ multiSelect
2647
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
2648
+ }, [id, texts, options, loop, multiSelect, selectValue, useValue, display]); // Create dropdown handler
2649
+
2650
+ React.useEffect(() => {
2651
+ if (!handler && togglerRef.current && listboxRef.current) {
2652
+ setHandler(extract.createDropdown({
2653
+ id,
2654
+ texts,
2655
+ options,
2656
+ loop,
2657
+ multiSelect,
2658
+ selectValue,
2659
+ useValue,
2660
+ display
2661
+ }, togglerRef.current, listboxRef.current, listboxRef.current, dd => setDropdown(dd)));
2662
+ }
2663
+
2664
+ return () => handler === null || handler === void 0 ? void 0 : handler.destroy(); // eslint-disable-next-line react-hooks/exhaustive-deps
2665
+ }, [togglerRef, listboxRef]);
2666
+ return {
2667
+ dropdown: handler,
2668
+ togglerProps,
2669
+ listboxProps,
2670
+ listItems,
2671
+ multiSelectProps
2672
+ };
2673
+ };
2674
+
2675
+ const Dropdown = ({
2676
+ id,
2677
+ options,
2678
+ loop,
2679
+ multiSelect,
2680
+ selectValue,
2681
+ useValue,
2682
+ display,
2683
+ texts
2684
+ }) => {
2685
+ var _a;
2686
+
2687
+ const togglerRef = React.useRef(null);
2688
+ const listboxRef = React.useRef(null);
2689
+ const {
2690
+ dropdown,
2691
+ listboxProps,
2692
+ togglerProps,
2693
+ listItems,
2694
+ multiSelectProps
2695
+ } = useDropdown({
2696
+ id,
2697
+ options,
2698
+ loop,
2699
+ multiSelect,
2700
+ selectValue,
2701
+ useValue,
2702
+ display,
2703
+ togglerRef,
2704
+ listboxRef,
2705
+ texts
2706
+ });
2707
+ return jsxRuntime.jsxs("div", {
2708
+ children: [jsxRuntime.jsx("button", Object.assign({
2709
+ type: "button"
2710
+ }, togglerProps, {
2711
+ ref: togglerRef
2712
+ }, {
2713
+ children: jsxRuntime.jsx("span", {
2714
+ children: togglerProps.children
2715
+ })
2716
+ })), jsxRuntime.jsxs("div", Object.assign({}, listboxProps, {
2717
+ ref: listboxRef
2718
+ }, {
2719
+ children: [jsxRuntime.jsx("button", Object.assign({
2720
+ type: "button",
2721
+ className: "close m-4 m-sm-2 d-block d-sm-none",
2722
+ onClick: dropdown === null || dropdown === void 0 ? void 0 : dropdown.close
2723
+ }, {
2724
+ children: jsxRuntime.jsx("span", Object.assign({
2725
+ className: "sr-only"
2726
+ }, {
2727
+ children: dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.texts.close
2728
+ }))
2729
+ })), (dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.isMultiSelect) ? jsxRuntime.jsx("div", Object.assign({
2730
+ className: "sg-fieldset-container"
2731
+ }, {
2732
+ children: jsxRuntime.jsxs("fieldset", Object.assign({}, multiSelectProps.fieldsetProps, {
2733
+ children: [jsxRuntime.jsx("legend", Object.assign({}, multiSelectProps.legendProps)), (_a = multiSelectProps.checkboxes) === null || _a === void 0 ? void 0 : _a.map(checkboxItem => jsxRuntime.jsxs("label", Object.assign({}, checkboxItem.labelProps, {
2734
+ children: [jsxRuntime.jsx("input", Object.assign({}, checkboxItem.inputProps)), jsxRuntime.jsx("span", Object.assign({}, checkboxItem.spanProps)), jsxRuntime.jsx("i", {})]
2735
+ }), checkboxItem.labelProps.id))]
2736
+ }))
2737
+ })) : jsxRuntime.jsx("ul", Object.assign({
2738
+ role: "listbox"
2739
+ }, {
2740
+ children: listItems.map(liProps => jsxRuntime.jsx("li", Object.assign({}, liProps), liProps.id))
2741
+ }))]
2742
+ }))]
2743
+ });
2744
+ };
2745
+
2746
+ exports.Alert = Alert;
2747
+ exports.Badge = Badge;
2748
+ exports.Button = Button;
2749
+ exports.ButtonGroup = ButtonGroup;
2750
+ exports.Card = Card;
2751
+ exports.Checkbox = Checkbox;
2752
+ exports.Dropdown = Dropdown;
2753
+ exports.EmailInput = EmailInput;
2754
+ exports.Flexbox = Flexbox;
2755
+ exports.Form = Form;
2756
+ exports.FormItems = FormItems;
2757
+ exports.Group = Group;
2758
+ exports.Link = Link;
2759
+ exports.List = List;
2760
+ exports.Modal = Modal;
2761
+ exports.Navbar = Navbar;
2762
+ exports.NumberInput = NumberInput;
2763
+ exports.RadioButton = RadioButton;
2764
+ exports.RadioGroup = RadioGroup;
2765
+ exports.RenderInput = RenderInput;
2766
+ exports.Text = Text;
2767
+ exports.TextInput = TextInput;
2768
+
2769
+ Object.defineProperty(exports, '__esModule', { value: true });
2196
2770
 
2197
2771
  }));