@pnkx-lib/ui 1.1.4 → 1.1.6

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.
@@ -1,2761 +0,0 @@
1
- import * as Oe from "react";
2
- import k, { createContext as Rn, useContext as Tn, useEffect as On } from "react";
3
- import { Typography as An } from "antd";
4
- var Wi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
- function Fn(e) {
6
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
- }
8
- var ct = { exports: {} }, Xe = {};
9
- /**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */
18
- var yr;
19
- function kn() {
20
- if (yr) return Xe;
21
- yr = 1;
22
- var e = k, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
23
- function l(c, h, _) {
24
- var m, C = {}, S = null, G = null;
25
- _ !== void 0 && (S = "" + _), h.key !== void 0 && (S = "" + h.key), h.ref !== void 0 && (G = h.ref);
26
- for (m in h) n.call(h, m) && !o.hasOwnProperty(m) && (C[m] = h[m]);
27
- if (c && c.defaultProps) for (m in h = c.defaultProps, h) C[m] === void 0 && (C[m] = h[m]);
28
- return { $$typeof: t, type: c, key: S, ref: G, props: C, _owner: i.current };
29
- }
30
- return Xe.Fragment = r, Xe.jsx = l, Xe.jsxs = l, Xe;
31
- }
32
- var Qe = {};
33
- /**
34
- * @license React
35
- * react-jsx-runtime.development.js
36
- *
37
- * Copyright (c) Facebook, Inc. and its affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */
42
- var vr;
43
- function Vn() {
44
- return vr || (vr = 1, process.env.NODE_ENV !== "production" && function() {
45
- var e = k, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), c = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), G = Symbol.for("react.offscreen"), X = Symbol.iterator, N = "@@iterator";
46
- function Q(s) {
47
- if (s === null || typeof s != "object")
48
- return null;
49
- var d = X && s[X] || s[N];
50
- return typeof d == "function" ? d : null;
51
- }
52
- var M = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
53
- function x(s) {
54
- {
55
- for (var d = arguments.length, p = new Array(d > 1 ? d - 1 : 0), E = 1; E < d; E++)
56
- p[E - 1] = arguments[E];
57
- Z("error", s, p);
58
- }
59
- }
60
- function Z(s, d, p) {
61
- {
62
- var E = M.ReactDebugCurrentFrame, V = E.getStackAddendum();
63
- V !== "" && (d += "%s", p = p.concat([V]));
64
- var D = p.map(function(A) {
65
- return String(A);
66
- });
67
- D.unshift("Warning: " + d), Function.prototype.apply.call(console[s], console, D);
68
- }
69
- }
70
- var K = !1, H = !1, xe = !1, Ce = !1, He = !1, ae;
71
- ae = Symbol.for("react.module.reference");
72
- function ve(s) {
73
- return !!(typeof s == "string" || typeof s == "function" || s === n || s === o || He || s === i || s === _ || s === m || Ce || s === G || K || H || xe || typeof s == "object" && s !== null && (s.$$typeof === S || s.$$typeof === C || s.$$typeof === l || s.$$typeof === c || s.$$typeof === h || // This needs to include all possible module reference object
74
- // types supported by any Flight configuration anywhere since
75
- // we don't know which Flight build this will end up being used
76
- // with.
77
- s.$$typeof === ae || s.getModuleId !== void 0));
78
- }
79
- function fe(s, d, p) {
80
- var E = s.displayName;
81
- if (E)
82
- return E;
83
- var V = d.displayName || d.name || "";
84
- return V !== "" ? p + "(" + V + ")" : p;
85
- }
86
- function F(s) {
87
- return s.displayName || "Context";
88
- }
89
- function R(s) {
90
- if (s == null)
91
- return null;
92
- if (typeof s.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof s == "function")
93
- return s.displayName || s.name || null;
94
- if (typeof s == "string")
95
- return s;
96
- switch (s) {
97
- case n:
98
- return "Fragment";
99
- case r:
100
- return "Portal";
101
- case o:
102
- return "Profiler";
103
- case i:
104
- return "StrictMode";
105
- case _:
106
- return "Suspense";
107
- case m:
108
- return "SuspenseList";
109
- }
110
- if (typeof s == "object")
111
- switch (s.$$typeof) {
112
- case c:
113
- var d = s;
114
- return F(d) + ".Consumer";
115
- case l:
116
- var p = s;
117
- return F(p._context) + ".Provider";
118
- case h:
119
- return fe(s, s.render, "ForwardRef");
120
- case C:
121
- var E = s.displayName || null;
122
- return E !== null ? E : R(s.type) || "Memo";
123
- case S: {
124
- var V = s, D = V._payload, A = V._init;
125
- try {
126
- return R(A(D));
127
- } catch {
128
- return null;
129
- }
130
- }
131
- }
132
- return null;
133
- }
134
- var P = Object.assign, $ = 0, ee, oe, ce, me, Se, ke, $e;
135
- function We() {
136
- }
137
- We.__reactDisabledLog = !0;
138
- function Ct() {
139
- {
140
- if ($ === 0) {
141
- ee = console.log, oe = console.info, ce = console.warn, me = console.error, Se = console.group, ke = console.groupCollapsed, $e = console.groupEnd;
142
- var s = {
143
- configurable: !0,
144
- enumerable: !0,
145
- value: We,
146
- writable: !0
147
- };
148
- Object.defineProperties(console, {
149
- info: s,
150
- log: s,
151
- warn: s,
152
- error: s,
153
- group: s,
154
- groupCollapsed: s,
155
- groupEnd: s
156
- });
157
- }
158
- $++;
159
- }
160
- }
161
- function at() {
162
- {
163
- if ($--, $ === 0) {
164
- var s = {
165
- configurable: !0,
166
- enumerable: !0,
167
- writable: !0
168
- };
169
- Object.defineProperties(console, {
170
- log: P({}, s, {
171
- value: ee
172
- }),
173
- info: P({}, s, {
174
- value: oe
175
- }),
176
- warn: P({}, s, {
177
- value: ce
178
- }),
179
- error: P({}, s, {
180
- value: me
181
- }),
182
- group: P({}, s, {
183
- value: Se
184
- }),
185
- groupCollapsed: P({}, s, {
186
- value: ke
187
- }),
188
- groupEnd: P({}, s, {
189
- value: $e
190
- })
191
- });
192
- }
193
- $ < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
194
- }
195
- }
196
- var qe = M.ReactCurrentDispatcher, Ve;
197
- function Pe(s, d, p) {
198
- {
199
- if (Ve === void 0)
200
- try {
201
- throw Error();
202
- } catch (V) {
203
- var E = V.stack.trim().match(/\n( *(at )?)/);
204
- Ve = E && E[1] || "";
205
- }
206
- return `
207
- ` + Ve + s;
208
- }
209
- }
210
- var Ee = !1, Re;
211
- {
212
- var Ye = typeof WeakMap == "function" ? WeakMap : Map;
213
- Re = new Ye();
214
- }
215
- function ze(s, d) {
216
- if (!s || Ee)
217
- return "";
218
- {
219
- var p = Re.get(s);
220
- if (p !== void 0)
221
- return p;
222
- }
223
- var E;
224
- Ee = !0;
225
- var V = Error.prepareStackTrace;
226
- Error.prepareStackTrace = void 0;
227
- var D;
228
- D = qe.current, qe.current = null, Ct();
229
- try {
230
- if (d) {
231
- var A = function() {
232
- throw Error();
233
- };
234
- if (Object.defineProperty(A.prototype, "props", {
235
- set: function() {
236
- throw Error();
237
- }
238
- }), typeof Reflect == "object" && Reflect.construct) {
239
- try {
240
- Reflect.construct(A, []);
241
- } catch (se) {
242
- E = se;
243
- }
244
- Reflect.construct(s, [], A);
245
- } else {
246
- try {
247
- A.call();
248
- } catch (se) {
249
- E = se;
250
- }
251
- s.call(A.prototype);
252
- }
253
- } else {
254
- try {
255
- throw Error();
256
- } catch (se) {
257
- E = se;
258
- }
259
- s();
260
- }
261
- } catch (se) {
262
- if (se && E && typeof se.stack == "string") {
263
- for (var T = se.stack.split(`
264
- `), te = E.stack.split(`
265
- `), L = T.length - 1, W = te.length - 1; L >= 1 && W >= 0 && T[L] !== te[W]; )
266
- W--;
267
- for (; L >= 1 && W >= 0; L--, W--)
268
- if (T[L] !== te[W]) {
269
- if (L !== 1 || W !== 1)
270
- do
271
- if (L--, W--, W < 0 || T[L] !== te[W]) {
272
- var le = `
273
- ` + T[L].replace(" at new ", " at ");
274
- return s.displayName && le.includes("<anonymous>") && (le = le.replace("<anonymous>", s.displayName)), typeof s == "function" && Re.set(s, le), le;
275
- }
276
- while (L >= 1 && W >= 0);
277
- break;
278
- }
279
- }
280
- } finally {
281
- Ee = !1, qe.current = D, at(), Error.prepareStackTrace = V;
282
- }
283
- var Ie = s ? s.displayName || s.name : "", Te = Ie ? Pe(Ie) : "";
284
- return typeof s == "function" && Re.set(s, Te), Te;
285
- }
286
- function St(s, d, p) {
287
- return ze(s, !1);
288
- }
289
- function ot(s) {
290
- var d = s.prototype;
291
- return !!(d && d.isReactComponent);
292
- }
293
- function De(s, d, p) {
294
- if (s == null)
295
- return "";
296
- if (typeof s == "function")
297
- return ze(s, ot(s));
298
- if (typeof s == "string")
299
- return Pe(s);
300
- switch (s) {
301
- case _:
302
- return Pe("Suspense");
303
- case m:
304
- return Pe("SuspenseList");
305
- }
306
- if (typeof s == "object")
307
- switch (s.$$typeof) {
308
- case h:
309
- return St(s.render);
310
- case C:
311
- return De(s.type, d, p);
312
- case S: {
313
- var E = s, V = E._payload, D = E._init;
314
- try {
315
- return De(D(V), d, p);
316
- } catch {
317
- }
318
- }
319
- }
320
- return "";
321
- }
322
- var pe = Object.prototype.hasOwnProperty, Ke = {}, ut = M.ReactDebugCurrentFrame;
323
- function je(s) {
324
- if (s) {
325
- var d = s._owner, p = De(s.type, s._source, d ? d.type : null);
326
- ut.setExtraStackFrame(p);
327
- } else
328
- ut.setExtraStackFrame(null);
329
- }
330
- function or(s, d, p, E, V) {
331
- {
332
- var D = Function.call.bind(pe);
333
- for (var A in s)
334
- if (D(s, A)) {
335
- var T = void 0;
336
- try {
337
- if (typeof s[A] != "function") {
338
- var te = Error((E || "React class") + ": " + p + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
339
- throw te.name = "Invariant Violation", te;
340
- }
341
- T = s[A](d, A, E, p, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
342
- } catch (L) {
343
- T = L;
344
- }
345
- T && !(T instanceof Error) && (je(V), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", E || "React class", p, A, typeof T), je(null)), T instanceof Error && !(T.message in Ke) && (Ke[T.message] = !0, je(V), x("Failed %s type: %s", p, T.message), je(null));
346
- }
347
- }
348
- }
349
- var lt = Array.isArray;
350
- function a(s) {
351
- return lt(s);
352
- }
353
- function u(s) {
354
- {
355
- var d = typeof Symbol == "function" && Symbol.toStringTag, p = d && s[Symbol.toStringTag] || s.constructor.name || "Object";
356
- return p;
357
- }
358
- }
359
- function f(s) {
360
- try {
361
- return b(s), !1;
362
- } catch {
363
- return !0;
364
- }
365
- }
366
- function b(s) {
367
- return "" + s;
368
- }
369
- function y(s) {
370
- if (f(s))
371
- return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", u(s)), b(s);
372
- }
373
- var g = M.ReactCurrentOwner, w = {
374
- key: !0,
375
- ref: !0,
376
- __self: !0,
377
- __source: !0
378
- }, O, I;
379
- function Y(s) {
380
- if (pe.call(s, "ref")) {
381
- var d = Object.getOwnPropertyDescriptor(s, "ref").get;
382
- if (d && d.isReactWarning)
383
- return !1;
384
- }
385
- return s.ref !== void 0;
386
- }
387
- function Et(s) {
388
- if (pe.call(s, "key")) {
389
- var d = Object.getOwnPropertyDescriptor(s, "key").get;
390
- if (d && d.isReactWarning)
391
- return !1;
392
- }
393
- return s.key !== void 0;
394
- }
395
- function Je(s, d) {
396
- typeof s.ref == "string" && g.current;
397
- }
398
- function Ge(s, d) {
399
- {
400
- var p = function() {
401
- O || (O = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", d));
402
- };
403
- p.isReactWarning = !0, Object.defineProperty(s, "key", {
404
- get: p,
405
- configurable: !0
406
- });
407
- }
408
- }
409
- function Rt(s, d) {
410
- {
411
- var p = function() {
412
- I || (I = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", d));
413
- };
414
- p.isReactWarning = !0, Object.defineProperty(s, "ref", {
415
- get: p,
416
- configurable: !0
417
- });
418
- }
419
- }
420
- var ft = function(s, d, p, E, V, D, A) {
421
- var T = {
422
- // This tag allows us to uniquely identify this as a React Element
423
- $$typeof: t,
424
- // Built-in properties that belong on the element
425
- type: s,
426
- key: d,
427
- ref: p,
428
- props: A,
429
- // Record the component responsible for creating this element.
430
- _owner: D
431
- };
432
- return T._store = {}, Object.defineProperty(T._store, "validated", {
433
- configurable: !1,
434
- enumerable: !1,
435
- writable: !0,
436
- value: !1
437
- }), Object.defineProperty(T, "_self", {
438
- configurable: !1,
439
- enumerable: !1,
440
- writable: !1,
441
- value: E
442
- }), Object.defineProperty(T, "_source", {
443
- configurable: !1,
444
- enumerable: !1,
445
- writable: !1,
446
- value: V
447
- }), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
448
- };
449
- function Tt(s, d, p, E, V) {
450
- {
451
- var D, A = {}, T = null, te = null;
452
- p !== void 0 && (y(p), T = "" + p), Et(d) && (y(d.key), T = "" + d.key), Y(d) && (te = d.ref, Je(d, V));
453
- for (D in d)
454
- pe.call(d, D) && !w.hasOwnProperty(D) && (A[D] = d[D]);
455
- if (s && s.defaultProps) {
456
- var L = s.defaultProps;
457
- for (D in L)
458
- A[D] === void 0 && (A[D] = L[D]);
459
- }
460
- if (T || te) {
461
- var W = typeof s == "function" ? s.displayName || s.name || "Unknown" : s;
462
- T && Ge(A, W), te && Rt(A, W);
463
- }
464
- return ft(s, T, te, V, E, g.current, A);
465
- }
466
- }
467
- var Me = M.ReactCurrentOwner, ur = M.ReactDebugCurrentFrame;
468
- function Ne(s) {
469
- if (s) {
470
- var d = s._owner, p = De(s.type, s._source, d ? d.type : null);
471
- ur.setExtraStackFrame(p);
472
- } else
473
- ur.setExtraStackFrame(null);
474
- }
475
- var Ot;
476
- Ot = !1;
477
- function At(s) {
478
- return typeof s == "object" && s !== null && s.$$typeof === t;
479
- }
480
- function lr() {
481
- {
482
- if (Me.current) {
483
- var s = R(Me.current.type);
484
- if (s)
485
- return `
486
-
487
- Check the render method of \`` + s + "`.";
488
- }
489
- return "";
490
- }
491
- }
492
- function vn(s) {
493
- return "";
494
- }
495
- var fr = {};
496
- function bn(s) {
497
- {
498
- var d = lr();
499
- if (!d) {
500
- var p = typeof s == "string" ? s : s.displayName || s.name;
501
- p && (d = `
502
-
503
- Check the top-level render call using <` + p + ">.");
504
- }
505
- return d;
506
- }
507
- }
508
- function cr(s, d) {
509
- {
510
- if (!s._store || s._store.validated || s.key != null)
511
- return;
512
- s._store.validated = !0;
513
- var p = bn(d);
514
- if (fr[p])
515
- return;
516
- fr[p] = !0;
517
- var E = "";
518
- s && s._owner && s._owner !== Me.current && (E = " It was passed a child from " + R(s._owner.type) + "."), Ne(s), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', p, E), Ne(null);
519
- }
520
- }
521
- function dr(s, d) {
522
- {
523
- if (typeof s != "object")
524
- return;
525
- if (a(s))
526
- for (var p = 0; p < s.length; p++) {
527
- var E = s[p];
528
- At(E) && cr(E, d);
529
- }
530
- else if (At(s))
531
- s._store && (s._store.validated = !0);
532
- else if (s) {
533
- var V = Q(s);
534
- if (typeof V == "function" && V !== s.entries)
535
- for (var D = V.call(s), A; !(A = D.next()).done; )
536
- At(A.value) && cr(A.value, d);
537
- }
538
- }
539
- }
540
- function mn(s) {
541
- {
542
- var d = s.type;
543
- if (d == null || typeof d == "string")
544
- return;
545
- var p;
546
- if (typeof d == "function")
547
- p = d.propTypes;
548
- else if (typeof d == "object" && (d.$$typeof === h || // Note: Memo only checks outer props here.
549
- // Inner props are checked in the reconciler.
550
- d.$$typeof === C))
551
- p = d.propTypes;
552
- else
553
- return;
554
- if (p) {
555
- var E = R(d);
556
- or(p, s.props, "prop", E, s);
557
- } else if (d.PropTypes !== void 0 && !Ot) {
558
- Ot = !0;
559
- var V = R(d);
560
- x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", V || "Unknown");
561
- }
562
- typeof d.getDefaultProps == "function" && !d.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
563
- }
564
- }
565
- function pn(s) {
566
- {
567
- for (var d = Object.keys(s.props), p = 0; p < d.length; p++) {
568
- var E = d[p];
569
- if (E !== "children" && E !== "key") {
570
- Ne(s), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), Ne(null);
571
- break;
572
- }
573
- }
574
- s.ref !== null && (Ne(s), x("Invalid attribute `ref` supplied to `React.Fragment`."), Ne(null));
575
- }
576
- }
577
- var hr = {};
578
- function gr(s, d, p, E, V, D) {
579
- {
580
- var A = ve(s);
581
- if (!A) {
582
- var T = "";
583
- (s === void 0 || typeof s == "object" && s !== null && Object.keys(s).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
584
- var te = vn();
585
- te ? T += te : T += lr();
586
- var L;
587
- s === null ? L = "null" : a(s) ? L = "array" : s !== void 0 && s.$$typeof === t ? (L = "<" + (R(s.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : L = typeof s, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", L, T);
588
- }
589
- var W = Tt(s, d, p, V, D);
590
- if (W == null)
591
- return W;
592
- if (A) {
593
- var le = d.children;
594
- if (le !== void 0)
595
- if (E)
596
- if (a(le)) {
597
- for (var Ie = 0; Ie < le.length; Ie++)
598
- dr(le[Ie], s);
599
- Object.freeze && Object.freeze(le);
600
- } else
601
- x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
602
- else
603
- dr(le, s);
604
- }
605
- if (pe.call(d, "key")) {
606
- var Te = R(s), se = Object.keys(d).filter(function(En) {
607
- return En !== "key";
608
- }), Ft = se.length > 0 ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}";
609
- if (!hr[Te + Ft]) {
610
- var Sn = se.length > 0 ? "{" + se.join(": ..., ") + ": ...}" : "{}";
611
- x(`A props object containing a "key" prop is being spread into JSX:
612
- let props = %s;
613
- <%s {...props} />
614
- React keys must be passed directly to JSX without using spread:
615
- let props = %s;
616
- <%s key={someKey} {...props} />`, Ft, Te, Sn, Te), hr[Te + Ft] = !0;
617
- }
618
- }
619
- return s === n ? pn(W) : mn(W), W;
620
- }
621
- }
622
- function _n(s, d, p) {
623
- return gr(s, d, p, !0);
624
- }
625
- function wn(s, d, p) {
626
- return gr(s, d, p, !1);
627
- }
628
- var xn = wn, Cn = _n;
629
- Qe.Fragment = n, Qe.jsx = xn, Qe.jsxs = Cn;
630
- }()), Qe;
631
- }
632
- var br;
633
- function Pn() {
634
- return br || (br = 1, process.env.NODE_ENV === "production" ? ct.exports = kn() : ct.exports = Vn()), ct.exports;
635
- }
636
- var Fe = Pn();
637
- const qi = k.memo(
638
- ({ errorMessage: e, isTouched: t, isSubmitted: r }) => !(t || r) || !e ? null : /* @__PURE__ */ Fe.jsx("div", { className: "ml-2 text-red-600", children: e })
639
- ), { Title: Dn, Paragraph: jn, Text: Mn } = An, Nn = {
640
- Title: (e) => /* @__PURE__ */ Fe.jsx(Dn, { ...e }),
641
- Paragraph: (e) => /* @__PURE__ */ Fe.jsx(jn, { ...e }),
642
- Text: (e) => /* @__PURE__ */ Fe.jsx(Mn, { ...e })
643
- }, Yi = ({ label: e, required: t }) => {
644
- //! State
645
- //! Function
646
- //! Render
647
- return /* @__PURE__ */ Fe.jsxs("div", { className: "flex gap-1 mb-2 items-baseline", children: [
648
- /* @__PURE__ */ Fe.jsx(Nn.Text, { children: e }),
649
- t && /* @__PURE__ */ Fe.jsx("span", { className: "text-red-600 h-0", children: "*" })
650
- ] });
651
- };
652
- var st = (e) => e.type === "checkbox", Ae = (e) => e instanceof Date, ie = (e) => e == null;
653
- const Hr = (e) => typeof e == "object";
654
- var B = (e) => !ie(e) && !Array.isArray(e) && Hr(e) && !Ae(e), $r = (e) => B(e) && e.target ? st(e.target) ? e.target.checked : e.target.value : e, In = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Wr = (e, t) => e.has(In(t)), Ln = (e) => {
655
- const t = e.constructor && e.constructor.prototype;
656
- return B(t) && t.hasOwnProperty("isPrototypeOf");
657
- }, Qt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
658
- function J(e) {
659
- let t;
660
- const r = Array.isArray(e), n = typeof FileList < "u" ? e instanceof FileList : !1;
661
- if (e instanceof Date)
662
- t = new Date(e);
663
- else if (e instanceof Set)
664
- t = new Set(e);
665
- else if (!(Qt && (e instanceof Blob || n)) && (r || B(e)))
666
- if (t = r ? [] : {}, !r && !Ln(e))
667
- t = e;
668
- else
669
- for (const i in e)
670
- e.hasOwnProperty(i) && (t[i] = J(e[i]));
671
- else
672
- return e;
673
- return t;
674
- }
675
- var _t = (e) => Array.isArray(e) ? e.filter(Boolean) : [], U = (e) => e === void 0, v = (e, t, r) => {
676
- if (!t || !B(e))
677
- return r;
678
- const n = _t(t.split(/[,[\].]+?/)).reduce((i, o) => ie(i) ? i : i[o], e);
679
- return U(n) || n === e ? U(e[t]) ? r : e[t] : n;
680
- }, ue = (e) => typeof e == "boolean", Zt = (e) => /^\w*$/.test(e), qr = (e) => _t(e.replace(/["|']|\]/g, "").split(/\.|\[/)), j = (e, t, r) => {
681
- let n = -1;
682
- const i = Zt(t) ? [t] : qr(t), o = i.length, l = o - 1;
683
- for (; ++n < o; ) {
684
- const c = i[n];
685
- let h = r;
686
- if (n !== l) {
687
- const _ = e[c];
688
- h = B(_) || Array.isArray(_) ? _ : isNaN(+i[n + 1]) ? {} : [];
689
- }
690
- if (c === "__proto__" || c === "constructor" || c === "prototype")
691
- return;
692
- e[c] = h, e = e[c];
693
- }
694
- };
695
- const gt = {
696
- BLUR: "blur",
697
- FOCUS_OUT: "focusout",
698
- CHANGE: "change"
699
- }, de = {
700
- onBlur: "onBlur",
701
- onChange: "onChange",
702
- onSubmit: "onSubmit",
703
- onTouched: "onTouched",
704
- all: "all"
705
- }, be = {
706
- max: "max",
707
- min: "min",
708
- maxLength: "maxLength",
709
- minLength: "minLength",
710
- pattern: "pattern",
711
- required: "required",
712
- validate: "validate"
713
- }, Un = k.createContext(null), er = () => k.useContext(Un);
714
- var Yr = (e, t, r, n = !0) => {
715
- const i = {
716
- defaultValues: t._defaultValues
717
- };
718
- for (const o in e)
719
- Object.defineProperty(i, o, {
720
- get: () => {
721
- const l = o;
722
- return t._proxyFormState[l] !== de.all && (t._proxyFormState[l] = !n || de.all), r && (r[l] = !0), e[l];
723
- }
724
- });
725
- return i;
726
- };
727
- const tr = typeof window < "u" ? Oe.useLayoutEffect : Oe.useEffect;
728
- function Bn(e) {
729
- const t = er(), { control: r = t.control, disabled: n, name: i, exact: o } = e || {}, [l, c] = k.useState(r._formState), h = k.useRef({
730
- isDirty: !1,
731
- isLoading: !1,
732
- dirtyFields: !1,
733
- touchedFields: !1,
734
- validatingFields: !1,
735
- isValidating: !1,
736
- isValid: !1,
737
- errors: !1
738
- });
739
- return tr(() => r._subscribe({
740
- name: i,
741
- formState: h.current,
742
- exact: o,
743
- callback: (_) => {
744
- !n && c({
745
- ...r._formState,
746
- ..._
747
- });
748
- }
749
- }), [i, n, o]), k.useEffect(() => {
750
- h.current.isValid && r._setValid(!0);
751
- }, [r]), k.useMemo(() => Yr(l, r, h.current, !1), [l, r]);
752
- }
753
- var ge = (e) => typeof e == "string", zr = (e, t, r, n, i) => ge(e) ? (n && t.watch.add(e), v(r, e, i)) : Array.isArray(e) ? e.map((o) => (n && t.watch.add(o), v(r, o))) : (n && (t.watchAll = !0), r);
754
- function Hn(e) {
755
- const t = er(), { control: r = t.control, name: n, defaultValue: i, disabled: o, exact: l } = e || {}, c = k.useRef(i), [h, _] = k.useState(r._getWatch(n, c.current));
756
- return tr(() => r._subscribe({
757
- name: n,
758
- formState: {
759
- values: !0
760
- },
761
- exact: l,
762
- callback: (m) => !o && _(zr(n, r._names, m.values || r._formValues, !1, c.current))
763
- }), [n, r, o, l]), k.useEffect(() => r._removeUnmounted()), h;
764
- }
765
- function $n(e) {
766
- const t = er(), { name: r, disabled: n, control: i = t.control, shouldUnregister: o } = e, l = Wr(i._names.array, r), c = Hn({
767
- control: i,
768
- name: r,
769
- defaultValue: v(i._formValues, r, v(i._defaultValues, r, e.defaultValue)),
770
- exact: !0
771
- }), h = Bn({
772
- control: i,
773
- name: r,
774
- exact: !0
775
- }), _ = k.useRef(e), m = k.useRef(i.register(r, {
776
- ...e.rules,
777
- value: c,
778
- ...ue(e.disabled) ? { disabled: e.disabled } : {}
779
- })), C = k.useMemo(() => Object.defineProperties({}, {
780
- invalid: {
781
- enumerable: !0,
782
- get: () => !!v(h.errors, r)
783
- },
784
- isDirty: {
785
- enumerable: !0,
786
- get: () => !!v(h.dirtyFields, r)
787
- },
788
- isTouched: {
789
- enumerable: !0,
790
- get: () => !!v(h.touchedFields, r)
791
- },
792
- isValidating: {
793
- enumerable: !0,
794
- get: () => !!v(h.validatingFields, r)
795
- },
796
- error: {
797
- enumerable: !0,
798
- get: () => v(h.errors, r)
799
- }
800
- }), [h, r]), S = k.useCallback((Q) => m.current.onChange({
801
- target: {
802
- value: $r(Q),
803
- name: r
804
- },
805
- type: gt.CHANGE
806
- }), [r]), G = k.useCallback(() => m.current.onBlur({
807
- target: {
808
- value: v(i._formValues, r),
809
- name: r
810
- },
811
- type: gt.BLUR
812
- }), [r, i._formValues]), X = k.useCallback((Q) => {
813
- const M = v(i._fields, r);
814
- M && Q && (M._f.ref = Q);
815
- }, [i._fields, r]), N = k.useMemo(() => ({
816
- name: r,
817
- value: c,
818
- ...ue(n) || h.disabled ? { disabled: h.disabled || n } : {},
819
- onChange: S,
820
- onBlur: G,
821
- ref: X
822
- }), [r, n, h.disabled, S, G, X, c]);
823
- return k.useEffect(() => {
824
- const Q = i._options.shouldUnregister || o;
825
- i.register(r, {
826
- ..._.current.rules,
827
- ...ue(_.current.disabled) ? { disabled: _.current.disabled } : {}
828
- });
829
- const M = (x, Z) => {
830
- const K = v(i._fields, x);
831
- K && K._f && (K._f.mount = Z);
832
- };
833
- if (M(r, !0), Q) {
834
- const x = J(v(i._options.defaultValues, r));
835
- j(i._defaultValues, r, x), U(v(i._formValues, r)) && j(i._formValues, r, x);
836
- }
837
- return !l && i.register(r), () => {
838
- (l ? Q && !i._state.action : Q) ? i.unregister(r) : M(r, !1);
839
- };
840
- }, [r, i, l, o]), k.useEffect(() => {
841
- i._setDisabledField({
842
- disabled: n,
843
- name: r
844
- });
845
- }, [n, r, i]), k.useMemo(() => ({
846
- field: N,
847
- formState: h,
848
- fieldState: C
849
- }), [N, h, C]);
850
- }
851
- const zi = (e) => e.render($n(e));
852
- var Wn = (e, t, r, n, i) => t ? {
853
- ...r[e],
854
- types: {
855
- ...r[e] && r[e].types ? r[e].types : {},
856
- [n]: i || !0
857
- }
858
- } : {}, rt = (e) => Array.isArray(e) ? e : [e], mr = () => {
859
- let e = [];
860
- return {
861
- get observers() {
862
- return e;
863
- },
864
- next: (i) => {
865
- for (const o of e)
866
- o.next && o.next(i);
867
- },
868
- subscribe: (i) => (e.push(i), {
869
- unsubscribe: () => {
870
- e = e.filter((o) => o !== i);
871
- }
872
- }),
873
- unsubscribe: () => {
874
- e = [];
875
- }
876
- };
877
- }, Dt = (e) => ie(e) || !Hr(e);
878
- function _e(e, t) {
879
- if (Dt(e) || Dt(t))
880
- return e === t;
881
- if (Ae(e) && Ae(t))
882
- return e.getTime() === t.getTime();
883
- const r = Object.keys(e), n = Object.keys(t);
884
- if (r.length !== n.length)
885
- return !1;
886
- for (const i of r) {
887
- const o = e[i];
888
- if (!n.includes(i))
889
- return !1;
890
- if (i !== "ref") {
891
- const l = t[i];
892
- if (Ae(o) && Ae(l) || B(o) && B(l) || Array.isArray(o) && Array.isArray(l) ? !_e(o, l) : o !== l)
893
- return !1;
894
- }
895
- }
896
- return !0;
897
- }
898
- var ne = (e) => B(e) && !Object.keys(e).length, rr = (e) => e.type === "file", he = (e) => typeof e == "function", yt = (e) => {
899
- if (!Qt)
900
- return !1;
901
- const t = e ? e.ownerDocument : 0;
902
- return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
903
- }, Kr = (e) => e.type === "select-multiple", nr = (e) => e.type === "radio", qn = (e) => nr(e) || st(e), kt = (e) => yt(e) && e.isConnected;
904
- function Yn(e, t) {
905
- const r = t.slice(0, -1).length;
906
- let n = 0;
907
- for (; n < r; )
908
- e = U(e) ? n++ : e[t[n++]];
909
- return e;
910
- }
911
- function zn(e) {
912
- for (const t in e)
913
- if (e.hasOwnProperty(t) && !U(e[t]))
914
- return !1;
915
- return !0;
916
- }
917
- function q(e, t) {
918
- const r = Array.isArray(t) ? t : Zt(t) ? [t] : qr(t), n = r.length === 1 ? e : Yn(e, r), i = r.length - 1, o = r[i];
919
- return n && delete n[o], i !== 0 && (B(n) && ne(n) || Array.isArray(n) && zn(n)) && q(e, r.slice(0, -1)), e;
920
- }
921
- var Jr = (e) => {
922
- for (const t in e)
923
- if (he(e[t]))
924
- return !0;
925
- return !1;
926
- };
927
- function vt(e, t = {}) {
928
- const r = Array.isArray(e);
929
- if (B(e) || r)
930
- for (const n in e)
931
- Array.isArray(e[n]) || B(e[n]) && !Jr(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, vt(e[n], t[n])) : ie(e[n]) || (t[n] = !0);
932
- return t;
933
- }
934
- function Gr(e, t, r) {
935
- const n = Array.isArray(e);
936
- if (B(e) || n)
937
- for (const i in e)
938
- Array.isArray(e[i]) || B(e[i]) && !Jr(e[i]) ? U(t) || Dt(r[i]) ? r[i] = Array.isArray(e[i]) ? vt(e[i], []) : { ...vt(e[i]) } : Gr(e[i], ie(t) ? {} : t[i], r[i]) : r[i] = !_e(e[i], t[i]);
939
- return r;
940
- }
941
- var Ze = (e, t) => Gr(e, t, vt(t));
942
- const pr = {
943
- value: !1,
944
- isValid: !1
945
- }, _r = { value: !0, isValid: !0 };
946
- var Xr = (e) => {
947
- if (Array.isArray(e)) {
948
- if (e.length > 1) {
949
- const t = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
950
- return { value: t, isValid: !!t.length };
951
- }
952
- return e[0].checked && !e[0].disabled ? (
953
- // @ts-expect-error expected to work in the browser
954
- e[0].attributes && !U(e[0].attributes.value) ? U(e[0].value) || e[0].value === "" ? _r : { value: e[0].value, isValid: !0 } : _r
955
- ) : pr;
956
- }
957
- return pr;
958
- }, Qr = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) => U(e) ? e : t ? e === "" ? NaN : e && +e : r && ge(e) ? new Date(e) : n ? n(e) : e;
959
- const wr = {
960
- isValid: !1,
961
- value: null
962
- };
963
- var Zr = (e) => Array.isArray(e) ? e.reduce((t, r) => r && r.checked && !r.disabled ? {
964
- isValid: !0,
965
- value: r.value
966
- } : t, wr) : wr;
967
- function xr(e) {
968
- const t = e.ref;
969
- return rr(t) ? t.files : nr(t) ? Zr(e.refs).value : Kr(t) ? [...t.selectedOptions].map(({ value: r }) => r) : st(t) ? Xr(e.refs).value : Qr(U(t.value) ? e.ref.value : t.value, e);
970
- }
971
- var Kn = (e, t, r, n) => {
972
- const i = {};
973
- for (const o of e) {
974
- const l = v(t, o);
975
- l && j(i, o, l._f);
976
- }
977
- return {
978
- criteriaMode: r,
979
- names: [...e],
980
- fields: i,
981
- shouldUseNativeValidation: n
982
- };
983
- }, bt = (e) => e instanceof RegExp, et = (e) => U(e) ? e : bt(e) ? e.source : B(e) ? bt(e.value) ? e.value.source : e.value : e, Cr = (e) => ({
984
- isOnSubmit: !e || e === de.onSubmit,
985
- isOnBlur: e === de.onBlur,
986
- isOnChange: e === de.onChange,
987
- isOnAll: e === de.all,
988
- isOnTouch: e === de.onTouched
989
- });
990
- const Sr = "AsyncFunction";
991
- var Jn = (e) => !!e && !!e.validate && !!(he(e.validate) && e.validate.constructor.name === Sr || B(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Sr)), Gn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Er = (e, t, r) => !r && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
992
- const nt = (e, t, r, n) => {
993
- for (const i of r || Object.keys(e)) {
994
- const o = v(e, i);
995
- if (o) {
996
- const { _f: l, ...c } = o;
997
- if (l) {
998
- if (l.refs && l.refs[0] && t(l.refs[0], i) && !n)
999
- return !0;
1000
- if (l.ref && t(l.ref, l.name) && !n)
1001
- return !0;
1002
- if (nt(c, t))
1003
- break;
1004
- } else if (B(c) && nt(c, t))
1005
- break;
1006
- }
1007
- }
1008
- };
1009
- function Rr(e, t, r) {
1010
- const n = v(e, r);
1011
- if (n || Zt(r))
1012
- return {
1013
- error: n,
1014
- name: r
1015
- };
1016
- const i = r.split(".");
1017
- for (; i.length; ) {
1018
- const o = i.join("."), l = v(t, o), c = v(e, o);
1019
- if (l && !Array.isArray(l) && r !== o)
1020
- return { name: r };
1021
- if (c && c.type)
1022
- return {
1023
- name: o,
1024
- error: c
1025
- };
1026
- i.pop();
1027
- }
1028
- return {
1029
- name: r
1030
- };
1031
- }
1032
- var Xn = (e, t, r, n) => {
1033
- r(e);
1034
- const { name: i, ...o } = e;
1035
- return ne(o) || Object.keys(o).length >= Object.keys(t).length || Object.keys(o).find((l) => t[l] === (!n || de.all));
1036
- }, Qn = (e, t, r) => !e || !t || e === t || rt(e).some((n) => n && (r ? n === t : n.startsWith(t) || t.startsWith(n))), Zn = (e, t, r, n, i) => i.isOnAll ? !1 : !r && i.isOnTouch ? !(t || e) : (r ? n.isOnBlur : i.isOnBlur) ? !e : (r ? n.isOnChange : i.isOnChange) ? e : !0, ei = (e, t) => !_t(v(e, t)).length && q(e, t), ti = (e, t, r) => {
1037
- const n = rt(v(e, r));
1038
- return j(n, "root", t[r]), j(e, r, n), e;
1039
- }, ht = (e) => ge(e);
1040
- function Tr(e, t, r = "validate") {
1041
- if (ht(e) || Array.isArray(e) && e.every(ht) || ue(e) && !e)
1042
- return {
1043
- type: r,
1044
- message: ht(e) ? e : "",
1045
- ref: t
1046
- };
1047
- }
1048
- var Le = (e) => B(e) && !bt(e) ? e : {
1049
- value: e,
1050
- message: ""
1051
- }, Or = async (e, t, r, n, i, o) => {
1052
- const { ref: l, refs: c, required: h, maxLength: _, minLength: m, min: C, max: S, pattern: G, validate: X, name: N, valueAsNumber: Q, mount: M } = e._f, x = v(r, N);
1053
- if (!M || t.has(N))
1054
- return {};
1055
- const Z = c ? c[0] : l, K = (F) => {
1056
- i && Z.reportValidity && (Z.setCustomValidity(ue(F) ? "" : F || ""), Z.reportValidity());
1057
- }, H = {}, xe = nr(l), Ce = st(l), He = xe || Ce, ae = (Q || rr(l)) && U(l.value) && U(x) || yt(l) && l.value === "" || x === "" || Array.isArray(x) && !x.length, ve = Wn.bind(null, N, n, H), fe = (F, R, P, $ = be.maxLength, ee = be.minLength) => {
1058
- const oe = F ? R : P;
1059
- H[N] = {
1060
- type: F ? $ : ee,
1061
- message: oe,
1062
- ref: l,
1063
- ...ve(F ? $ : ee, oe)
1064
- };
1065
- };
1066
- if (o ? !Array.isArray(x) || !x.length : h && (!He && (ae || ie(x)) || ue(x) && !x || Ce && !Xr(c).isValid || xe && !Zr(c).isValid)) {
1067
- const { value: F, message: R } = ht(h) ? { value: !!h, message: h } : Le(h);
1068
- if (F && (H[N] = {
1069
- type: be.required,
1070
- message: R,
1071
- ref: Z,
1072
- ...ve(be.required, R)
1073
- }, !n))
1074
- return K(R), H;
1075
- }
1076
- if (!ae && (!ie(C) || !ie(S))) {
1077
- let F, R;
1078
- const P = Le(S), $ = Le(C);
1079
- if (!ie(x) && !isNaN(x)) {
1080
- const ee = l.valueAsNumber || x && +x;
1081
- ie(P.value) || (F = ee > P.value), ie($.value) || (R = ee < $.value);
1082
- } else {
1083
- const ee = l.valueAsDate || new Date(x), oe = (Se) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Se), ce = l.type == "time", me = l.type == "week";
1084
- ge(P.value) && x && (F = ce ? oe(x) > oe(P.value) : me ? x > P.value : ee > new Date(P.value)), ge($.value) && x && (R = ce ? oe(x) < oe($.value) : me ? x < $.value : ee < new Date($.value));
1085
- }
1086
- if ((F || R) && (fe(!!F, P.message, $.message, be.max, be.min), !n))
1087
- return K(H[N].message), H;
1088
- }
1089
- if ((_ || m) && !ae && (ge(x) || o && Array.isArray(x))) {
1090
- const F = Le(_), R = Le(m), P = !ie(F.value) && x.length > +F.value, $ = !ie(R.value) && x.length < +R.value;
1091
- if ((P || $) && (fe(P, F.message, R.message), !n))
1092
- return K(H[N].message), H;
1093
- }
1094
- if (G && !ae && ge(x)) {
1095
- const { value: F, message: R } = Le(G);
1096
- if (bt(F) && !x.match(F) && (H[N] = {
1097
- type: be.pattern,
1098
- message: R,
1099
- ref: l,
1100
- ...ve(be.pattern, R)
1101
- }, !n))
1102
- return K(R), H;
1103
- }
1104
- if (X) {
1105
- if (he(X)) {
1106
- const F = await X(x, r), R = Tr(F, Z);
1107
- if (R && (H[N] = {
1108
- ...R,
1109
- ...ve(be.validate, R.message)
1110
- }, !n))
1111
- return K(R.message), H;
1112
- } else if (B(X)) {
1113
- let F = {};
1114
- for (const R in X) {
1115
- if (!ne(F) && !n)
1116
- break;
1117
- const P = Tr(await X[R](x, r), Z, R);
1118
- P && (F = {
1119
- ...P,
1120
- ...ve(R, P.message)
1121
- }, K(P.message), n && (H[N] = F));
1122
- }
1123
- if (!ne(F) && (H[N] = {
1124
- ref: Z,
1125
- ...F
1126
- }, !n))
1127
- return H;
1128
- }
1129
- }
1130
- return K(!0), H;
1131
- };
1132
- const ri = {
1133
- mode: de.onSubmit,
1134
- reValidateMode: de.onChange,
1135
- shouldFocusError: !0
1136
- };
1137
- function ni(e = {}) {
1138
- let t = {
1139
- ...ri,
1140
- ...e
1141
- }, r = {
1142
- submitCount: 0,
1143
- isDirty: !1,
1144
- isReady: !1,
1145
- isLoading: he(t.defaultValues),
1146
- isValidating: !1,
1147
- isSubmitted: !1,
1148
- isSubmitting: !1,
1149
- isSubmitSuccessful: !1,
1150
- isValid: !1,
1151
- touchedFields: {},
1152
- dirtyFields: {},
1153
- validatingFields: {},
1154
- errors: t.errors || {},
1155
- disabled: t.disabled || !1
1156
- };
1157
- const n = {};
1158
- let i = B(t.defaultValues) || B(t.values) ? J(t.defaultValues || t.values) || {} : {}, o = t.shouldUnregister ? {} : J(i), l = {
1159
- action: !1,
1160
- mount: !1,
1161
- watch: !1
1162
- }, c = {
1163
- mount: /* @__PURE__ */ new Set(),
1164
- disabled: /* @__PURE__ */ new Set(),
1165
- unMount: /* @__PURE__ */ new Set(),
1166
- array: /* @__PURE__ */ new Set(),
1167
- watch: /* @__PURE__ */ new Set()
1168
- }, h, _ = 0;
1169
- const m = {
1170
- isDirty: !1,
1171
- dirtyFields: !1,
1172
- validatingFields: !1,
1173
- touchedFields: !1,
1174
- isValidating: !1,
1175
- isValid: !1,
1176
- errors: !1
1177
- };
1178
- let C = {
1179
- ...m
1180
- };
1181
- const S = {
1182
- array: mr(),
1183
- state: mr()
1184
- }, G = Cr(t.mode), X = Cr(t.reValidateMode), N = t.criteriaMode === de.all, Q = (a) => (u) => {
1185
- clearTimeout(_), _ = setTimeout(a, u);
1186
- }, M = async (a) => {
1187
- if (!t.disabled && (m.isValid || C.isValid || a)) {
1188
- const u = t.resolver ? ne((await ae()).errors) : await fe(n, !0);
1189
- u !== r.isValid && S.state.next({
1190
- isValid: u
1191
- });
1192
- }
1193
- }, x = (a, u) => {
1194
- !t.disabled && (m.isValidating || m.validatingFields || C.isValidating || C.validatingFields) && ((a || Array.from(c.mount)).forEach((f) => {
1195
- f && (u ? j(r.validatingFields, f, u) : q(r.validatingFields, f));
1196
- }), S.state.next({
1197
- validatingFields: r.validatingFields,
1198
- isValidating: !ne(r.validatingFields)
1199
- }));
1200
- }, Z = (a, u = [], f, b, y = !0, g = !0) => {
1201
- if (b && f && !t.disabled) {
1202
- if (l.action = !0, g && Array.isArray(v(n, a))) {
1203
- const w = f(v(n, a), b.argA, b.argB);
1204
- y && j(n, a, w);
1205
- }
1206
- if (g && Array.isArray(v(r.errors, a))) {
1207
- const w = f(v(r.errors, a), b.argA, b.argB);
1208
- y && j(r.errors, a, w), ei(r.errors, a);
1209
- }
1210
- if ((m.touchedFields || C.touchedFields) && g && Array.isArray(v(r.touchedFields, a))) {
1211
- const w = f(v(r.touchedFields, a), b.argA, b.argB);
1212
- y && j(r.touchedFields, a, w);
1213
- }
1214
- (m.dirtyFields || C.dirtyFields) && (r.dirtyFields = Ze(i, o)), S.state.next({
1215
- name: a,
1216
- isDirty: R(a, u),
1217
- dirtyFields: r.dirtyFields,
1218
- errors: r.errors,
1219
- isValid: r.isValid
1220
- });
1221
- } else
1222
- j(o, a, u);
1223
- }, K = (a, u) => {
1224
- j(r.errors, a, u), S.state.next({
1225
- errors: r.errors
1226
- });
1227
- }, H = (a) => {
1228
- r.errors = a, S.state.next({
1229
- errors: r.errors,
1230
- isValid: !1
1231
- });
1232
- }, xe = (a, u, f, b) => {
1233
- const y = v(n, a);
1234
- if (y) {
1235
- const g = v(o, a, U(f) ? v(i, a) : f);
1236
- U(g) || b && b.defaultChecked || u ? j(o, a, u ? g : xr(y._f)) : ee(a, g), l.mount && M();
1237
- }
1238
- }, Ce = (a, u, f, b, y) => {
1239
- let g = !1, w = !1;
1240
- const O = {
1241
- name: a
1242
- };
1243
- if (!t.disabled) {
1244
- if (!f || b) {
1245
- (m.isDirty || C.isDirty) && (w = r.isDirty, r.isDirty = O.isDirty = R(), g = w !== O.isDirty);
1246
- const I = _e(v(i, a), u);
1247
- w = !!v(r.dirtyFields, a), I ? q(r.dirtyFields, a) : j(r.dirtyFields, a, !0), O.dirtyFields = r.dirtyFields, g = g || (m.dirtyFields || C.dirtyFields) && w !== !I;
1248
- }
1249
- if (f) {
1250
- const I = v(r.touchedFields, a);
1251
- I || (j(r.touchedFields, a, f), O.touchedFields = r.touchedFields, g = g || (m.touchedFields || C.touchedFields) && I !== f);
1252
- }
1253
- g && y && S.state.next(O);
1254
- }
1255
- return g ? O : {};
1256
- }, He = (a, u, f, b) => {
1257
- const y = v(r.errors, a), g = (m.isValid || C.isValid) && ue(u) && r.isValid !== u;
1258
- if (t.delayError && f ? (h = Q(() => K(a, f)), h(t.delayError)) : (clearTimeout(_), h = null, f ? j(r.errors, a, f) : q(r.errors, a)), (f ? !_e(y, f) : y) || !ne(b) || g) {
1259
- const w = {
1260
- ...b,
1261
- ...g && ue(u) ? { isValid: u } : {},
1262
- errors: r.errors,
1263
- name: a
1264
- };
1265
- r = {
1266
- ...r,
1267
- ...w
1268
- }, S.state.next(w);
1269
- }
1270
- }, ae = async (a) => {
1271
- x(a, !0);
1272
- const u = await t.resolver(o, t.context, Kn(a || c.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
1273
- return x(a), u;
1274
- }, ve = async (a) => {
1275
- const { errors: u } = await ae(a);
1276
- if (a)
1277
- for (const f of a) {
1278
- const b = v(u, f);
1279
- b ? j(r.errors, f, b) : q(r.errors, f);
1280
- }
1281
- else
1282
- r.errors = u;
1283
- return u;
1284
- }, fe = async (a, u, f = {
1285
- valid: !0
1286
- }) => {
1287
- for (const b in a) {
1288
- const y = a[b];
1289
- if (y) {
1290
- const { _f: g, ...w } = y;
1291
- if (g) {
1292
- const O = c.array.has(g.name), I = y._f && Jn(y._f);
1293
- I && m.validatingFields && x([b], !0);
1294
- const Y = await Or(y, c.disabled, o, N, t.shouldUseNativeValidation && !u, O);
1295
- if (I && m.validatingFields && x([b]), Y[g.name] && (f.valid = !1, u))
1296
- break;
1297
- !u && (v(Y, g.name) ? O ? ti(r.errors, Y, g.name) : j(r.errors, g.name, Y[g.name]) : q(r.errors, g.name));
1298
- }
1299
- !ne(w) && await fe(w, u, f);
1300
- }
1301
- }
1302
- return f.valid;
1303
- }, F = () => {
1304
- for (const a of c.unMount) {
1305
- const u = v(n, a);
1306
- u && (u._f.refs ? u._f.refs.every((f) => !kt(f)) : !kt(u._f.ref)) && Ee(a);
1307
- }
1308
- c.unMount = /* @__PURE__ */ new Set();
1309
- }, R = (a, u) => !t.disabled && (a && u && j(o, a, u), !_e($e(), i)), P = (a, u, f) => zr(a, c, {
1310
- ...l.mount ? o : U(u) ? i : ge(a) ? { [a]: u } : u
1311
- }, f, u), $ = (a) => _t(v(l.mount ? o : i, a, t.shouldUnregister ? v(i, a, []) : [])), ee = (a, u, f = {}) => {
1312
- const b = v(n, a);
1313
- let y = u;
1314
- if (b) {
1315
- const g = b._f;
1316
- g && (!g.disabled && j(o, a, Qr(u, g)), y = yt(g.ref) && ie(u) ? "" : u, Kr(g.ref) ? [...g.ref.options].forEach((w) => w.selected = y.includes(w.value)) : g.refs ? st(g.ref) ? g.refs.length > 1 ? g.refs.forEach((w) => (!w.defaultChecked || !w.disabled) && (w.checked = Array.isArray(y) ? !!y.find((O) => O === w.value) : y === w.value)) : g.refs[0] && (g.refs[0].checked = !!y) : g.refs.forEach((w) => w.checked = w.value === y) : rr(g.ref) ? g.ref.value = "" : (g.ref.value = y, g.ref.type || S.state.next({
1317
- name: a,
1318
- values: J(o)
1319
- })));
1320
- }
1321
- (f.shouldDirty || f.shouldTouch) && Ce(a, y, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && ke(a);
1322
- }, oe = (a, u, f) => {
1323
- for (const b in u) {
1324
- const y = u[b], g = `${a}.${b}`, w = v(n, g);
1325
- (c.array.has(a) || B(y) || w && !w._f) && !Ae(y) ? oe(g, y, f) : ee(g, y, f);
1326
- }
1327
- }, ce = (a, u, f = {}) => {
1328
- const b = v(n, a), y = c.array.has(a), g = J(u);
1329
- j(o, a, g), y ? (S.array.next({
1330
- name: a,
1331
- values: J(o)
1332
- }), (m.isDirty || m.dirtyFields || C.isDirty || C.dirtyFields) && f.shouldDirty && S.state.next({
1333
- name: a,
1334
- dirtyFields: Ze(i, o),
1335
- isDirty: R(a, g)
1336
- })) : b && !b._f && !ie(g) ? oe(a, g, f) : ee(a, g, f), Er(a, c) && S.state.next({ ...r }), S.state.next({
1337
- name: l.mount ? a : void 0,
1338
- values: J(o)
1339
- });
1340
- }, me = async (a) => {
1341
- l.mount = !0;
1342
- const u = a.target;
1343
- let f = u.name, b = !0;
1344
- const y = v(n, f), g = (w) => {
1345
- b = Number.isNaN(w) || Ae(w) && isNaN(w.getTime()) || _e(w, v(o, f, w));
1346
- };
1347
- if (y) {
1348
- let w, O;
1349
- const I = u.type ? xr(y._f) : $r(a), Y = a.type === gt.BLUR || a.type === gt.FOCUS_OUT, Et = !Gn(y._f) && !t.resolver && !v(r.errors, f) && !y._f.deps || Zn(Y, v(r.touchedFields, f), r.isSubmitted, X, G), Je = Er(f, c, Y);
1350
- j(o, f, I), Y ? (y._f.onBlur && y._f.onBlur(a), h && h(0)) : y._f.onChange && y._f.onChange(a);
1351
- const Ge = Ce(f, I, Y), Rt = !ne(Ge) || Je;
1352
- if (!Y && S.state.next({
1353
- name: f,
1354
- type: a.type,
1355
- values: J(o)
1356
- }), Et)
1357
- return (m.isValid || C.isValid) && (t.mode === "onBlur" ? Y && M() : Y || M()), Rt && S.state.next({ name: f, ...Je ? {} : Ge });
1358
- if (!Y && Je && S.state.next({ ...r }), t.resolver) {
1359
- const { errors: ft } = await ae([f]);
1360
- if (g(I), b) {
1361
- const Tt = Rr(r.errors, n, f), Me = Rr(ft, n, Tt.name || f);
1362
- w = Me.error, f = Me.name, O = ne(ft);
1363
- }
1364
- } else
1365
- x([f], !0), w = (await Or(y, c.disabled, o, N, t.shouldUseNativeValidation))[f], x([f]), g(I), b && (w ? O = !1 : (m.isValid || C.isValid) && (O = await fe(n, !0)));
1366
- b && (y._f.deps && ke(y._f.deps), He(f, O, w, Ge));
1367
- }
1368
- }, Se = (a, u) => {
1369
- if (v(r.errors, u) && a.focus)
1370
- return a.focus(), 1;
1371
- }, ke = async (a, u = {}) => {
1372
- let f, b;
1373
- const y = rt(a);
1374
- if (t.resolver) {
1375
- const g = await ve(U(a) ? a : y);
1376
- f = ne(g), b = a ? !y.some((w) => v(g, w)) : f;
1377
- } else a ? (b = (await Promise.all(y.map(async (g) => {
1378
- const w = v(n, g);
1379
- return await fe(w && w._f ? { [g]: w } : w);
1380
- }))).every(Boolean), !(!b && !r.isValid) && M()) : b = f = await fe(n);
1381
- return S.state.next({
1382
- ...!ge(a) || (m.isValid || C.isValid) && f !== r.isValid ? {} : { name: a },
1383
- ...t.resolver || !a ? { isValid: f } : {},
1384
- errors: r.errors
1385
- }), u.shouldFocus && !b && nt(n, Se, a ? y : c.mount), b;
1386
- }, $e = (a) => {
1387
- const u = {
1388
- ...l.mount ? o : i
1389
- };
1390
- return U(a) ? u : ge(a) ? v(u, a) : a.map((f) => v(u, f));
1391
- }, We = (a, u) => ({
1392
- invalid: !!v((u || r).errors, a),
1393
- isDirty: !!v((u || r).dirtyFields, a),
1394
- error: v((u || r).errors, a),
1395
- isValidating: !!v(r.validatingFields, a),
1396
- isTouched: !!v((u || r).touchedFields, a)
1397
- }), Ct = (a) => {
1398
- a && rt(a).forEach((u) => q(r.errors, u)), S.state.next({
1399
- errors: a ? r.errors : {}
1400
- });
1401
- }, at = (a, u, f) => {
1402
- const b = (v(n, a, { _f: {} })._f || {}).ref, y = v(r.errors, a) || {}, { ref: g, message: w, type: O, ...I } = y;
1403
- j(r.errors, a, {
1404
- ...I,
1405
- ...u,
1406
- ref: b
1407
- }), S.state.next({
1408
- name: a,
1409
- errors: r.errors,
1410
- isValid: !1
1411
- }), f && f.shouldFocus && b && b.focus && b.focus();
1412
- }, qe = (a, u) => he(a) ? S.state.subscribe({
1413
- next: (f) => a(P(void 0, u), f)
1414
- }) : P(a, u, !0), Ve = (a) => S.state.subscribe({
1415
- next: (u) => {
1416
- Qn(a.name, u.name, a.exact) && Xn(u, a.formState || m, je, a.reRenderRoot) && a.callback({
1417
- values: { ...o },
1418
- ...r,
1419
- ...u
1420
- });
1421
- }
1422
- }).unsubscribe, Pe = (a) => (l.mount = !0, C = {
1423
- ...C,
1424
- ...a.formState
1425
- }, Ve({
1426
- ...a,
1427
- formState: C
1428
- })), Ee = (a, u = {}) => {
1429
- for (const f of a ? rt(a) : c.mount)
1430
- c.mount.delete(f), c.array.delete(f), u.keepValue || (q(n, f), q(o, f)), !u.keepError && q(r.errors, f), !u.keepDirty && q(r.dirtyFields, f), !u.keepTouched && q(r.touchedFields, f), !u.keepIsValidating && q(r.validatingFields, f), !t.shouldUnregister && !u.keepDefaultValue && q(i, f);
1431
- S.state.next({
1432
- values: J(o)
1433
- }), S.state.next({
1434
- ...r,
1435
- ...u.keepDirty ? { isDirty: R() } : {}
1436
- }), !u.keepIsValid && M();
1437
- }, Re = ({ disabled: a, name: u }) => {
1438
- (ue(a) && l.mount || a || c.disabled.has(u)) && (a ? c.disabled.add(u) : c.disabled.delete(u));
1439
- }, Ye = (a, u = {}) => {
1440
- let f = v(n, a);
1441
- const b = ue(u.disabled) || ue(t.disabled);
1442
- return j(n, a, {
1443
- ...f || {},
1444
- _f: {
1445
- ...f && f._f ? f._f : { ref: { name: a } },
1446
- name: a,
1447
- mount: !0,
1448
- ...u
1449
- }
1450
- }), c.mount.add(a), f ? Re({
1451
- disabled: ue(u.disabled) ? u.disabled : t.disabled,
1452
- name: a
1453
- }) : xe(a, !0, u.value), {
1454
- ...b ? { disabled: u.disabled || t.disabled } : {},
1455
- ...t.progressive ? {
1456
- required: !!u.required,
1457
- min: et(u.min),
1458
- max: et(u.max),
1459
- minLength: et(u.minLength),
1460
- maxLength: et(u.maxLength),
1461
- pattern: et(u.pattern)
1462
- } : {},
1463
- name: a,
1464
- onChange: me,
1465
- onBlur: me,
1466
- ref: (y) => {
1467
- if (y) {
1468
- Ye(a, u), f = v(n, a);
1469
- const g = U(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, w = qn(g), O = f._f.refs || [];
1470
- if (w ? O.find((I) => I === g) : g === f._f.ref)
1471
- return;
1472
- j(n, a, {
1473
- _f: {
1474
- ...f._f,
1475
- ...w ? {
1476
- refs: [
1477
- ...O.filter(kt),
1478
- g,
1479
- ...Array.isArray(v(i, a)) ? [{}] : []
1480
- ],
1481
- ref: { type: g.type, name: a }
1482
- } : { ref: g }
1483
- }
1484
- }), xe(a, !1, void 0, g);
1485
- } else
1486
- f = v(n, a, {}), f._f && (f._f.mount = !1), (t.shouldUnregister || u.shouldUnregister) && !(Wr(c.array, a) && l.action) && c.unMount.add(a);
1487
- }
1488
- };
1489
- }, ze = () => t.shouldFocusError && nt(n, Se, c.mount), St = (a) => {
1490
- ue(a) && (S.state.next({ disabled: a }), nt(n, (u, f) => {
1491
- const b = v(n, f);
1492
- b && (u.disabled = b._f.disabled || a, Array.isArray(b._f.refs) && b._f.refs.forEach((y) => {
1493
- y.disabled = b._f.disabled || a;
1494
- }));
1495
- }, 0, !1));
1496
- }, ot = (a, u) => async (f) => {
1497
- let b;
1498
- f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
1499
- let y = J(o);
1500
- if (S.state.next({
1501
- isSubmitting: !0
1502
- }), t.resolver) {
1503
- const { errors: g, values: w } = await ae();
1504
- r.errors = g, y = w;
1505
- } else
1506
- await fe(n);
1507
- if (c.disabled.size)
1508
- for (const g of c.disabled)
1509
- j(y, g, void 0);
1510
- if (q(r.errors, "root"), ne(r.errors)) {
1511
- S.state.next({
1512
- errors: {}
1513
- });
1514
- try {
1515
- await a(y, f);
1516
- } catch (g) {
1517
- b = g;
1518
- }
1519
- } else
1520
- u && await u({ ...r.errors }, f), ze(), setTimeout(ze);
1521
- if (S.state.next({
1522
- isSubmitted: !0,
1523
- isSubmitting: !1,
1524
- isSubmitSuccessful: ne(r.errors) && !b,
1525
- submitCount: r.submitCount + 1,
1526
- errors: r.errors
1527
- }), b)
1528
- throw b;
1529
- }, De = (a, u = {}) => {
1530
- v(n, a) && (U(u.defaultValue) ? ce(a, J(v(i, a))) : (ce(a, u.defaultValue), j(i, a, J(u.defaultValue))), u.keepTouched || q(r.touchedFields, a), u.keepDirty || (q(r.dirtyFields, a), r.isDirty = u.defaultValue ? R(a, J(v(i, a))) : R()), u.keepError || (q(r.errors, a), m.isValid && M()), S.state.next({ ...r }));
1531
- }, pe = (a, u = {}) => {
1532
- const f = a ? J(a) : i, b = J(f), y = ne(a), g = y ? i : b;
1533
- if (u.keepDefaultValues || (i = f), !u.keepValues) {
1534
- if (u.keepDirtyValues) {
1535
- const w = /* @__PURE__ */ new Set([
1536
- ...c.mount,
1537
- ...Object.keys(Ze(i, o))
1538
- ]);
1539
- for (const O of Array.from(w))
1540
- v(r.dirtyFields, O) ? j(g, O, v(o, O)) : ce(O, v(g, O));
1541
- } else {
1542
- if (Qt && U(a))
1543
- for (const w of c.mount) {
1544
- const O = v(n, w);
1545
- if (O && O._f) {
1546
- const I = Array.isArray(O._f.refs) ? O._f.refs[0] : O._f.ref;
1547
- if (yt(I)) {
1548
- const Y = I.closest("form");
1549
- if (Y) {
1550
- Y.reset();
1551
- break;
1552
- }
1553
- }
1554
- }
1555
- }
1556
- for (const w of c.mount)
1557
- ce(w, v(g, w));
1558
- }
1559
- o = J(g), S.array.next({
1560
- values: { ...g }
1561
- }), S.state.next({
1562
- values: { ...g }
1563
- });
1564
- }
1565
- c = {
1566
- mount: u.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
1567
- unMount: /* @__PURE__ */ new Set(),
1568
- array: /* @__PURE__ */ new Set(),
1569
- disabled: /* @__PURE__ */ new Set(),
1570
- watch: /* @__PURE__ */ new Set(),
1571
- watchAll: !1,
1572
- focus: ""
1573
- }, l.mount = !m.isValid || !!u.keepIsValid || !!u.keepDirtyValues, l.watch = !!t.shouldUnregister, S.state.next({
1574
- submitCount: u.keepSubmitCount ? r.submitCount : 0,
1575
- isDirty: y ? !1 : u.keepDirty ? r.isDirty : !!(u.keepDefaultValues && !_e(a, i)),
1576
- isSubmitted: u.keepIsSubmitted ? r.isSubmitted : !1,
1577
- dirtyFields: y ? {} : u.keepDirtyValues ? u.keepDefaultValues && o ? Ze(i, o) : r.dirtyFields : u.keepDefaultValues && a ? Ze(i, a) : u.keepDirty ? r.dirtyFields : {},
1578
- touchedFields: u.keepTouched ? r.touchedFields : {},
1579
- errors: u.keepErrors ? r.errors : {},
1580
- isSubmitSuccessful: u.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
1581
- isSubmitting: !1
1582
- });
1583
- }, Ke = (a, u) => pe(he(a) ? a(o) : a, u), ut = (a, u = {}) => {
1584
- const f = v(n, a), b = f && f._f;
1585
- if (b) {
1586
- const y = b.refs ? b.refs[0] : b.ref;
1587
- y.focus && (y.focus(), u.shouldSelect && he(y.select) && y.select());
1588
- }
1589
- }, je = (a) => {
1590
- r = {
1591
- ...r,
1592
- ...a
1593
- };
1594
- }, lt = {
1595
- control: {
1596
- register: Ye,
1597
- unregister: Ee,
1598
- getFieldState: We,
1599
- handleSubmit: ot,
1600
- setError: at,
1601
- _subscribe: Ve,
1602
- _runSchema: ae,
1603
- _getWatch: P,
1604
- _getDirty: R,
1605
- _setValid: M,
1606
- _setFieldArray: Z,
1607
- _setDisabledField: Re,
1608
- _setErrors: H,
1609
- _getFieldArray: $,
1610
- _reset: pe,
1611
- _resetDefaultValues: () => he(t.defaultValues) && t.defaultValues().then((a) => {
1612
- Ke(a, t.resetOptions), S.state.next({
1613
- isLoading: !1
1614
- });
1615
- }),
1616
- _removeUnmounted: F,
1617
- _disableForm: St,
1618
- _subjects: S,
1619
- _proxyFormState: m,
1620
- get _fields() {
1621
- return n;
1622
- },
1623
- get _formValues() {
1624
- return o;
1625
- },
1626
- get _state() {
1627
- return l;
1628
- },
1629
- set _state(a) {
1630
- l = a;
1631
- },
1632
- get _defaultValues() {
1633
- return i;
1634
- },
1635
- get _names() {
1636
- return c;
1637
- },
1638
- set _names(a) {
1639
- c = a;
1640
- },
1641
- get _formState() {
1642
- return r;
1643
- },
1644
- get _options() {
1645
- return t;
1646
- },
1647
- set _options(a) {
1648
- t = {
1649
- ...t,
1650
- ...a
1651
- };
1652
- }
1653
- },
1654
- subscribe: Pe,
1655
- trigger: ke,
1656
- register: Ye,
1657
- handleSubmit: ot,
1658
- watch: qe,
1659
- setValue: ce,
1660
- getValues: $e,
1661
- reset: Ke,
1662
- resetField: De,
1663
- clearErrors: Ct,
1664
- unregister: Ee,
1665
- setError: at,
1666
- setFocus: ut,
1667
- getFieldState: We
1668
- };
1669
- return {
1670
- ...lt,
1671
- formControl: lt
1672
- };
1673
- }
1674
- function Ki(e = {}) {
1675
- const t = k.useRef(void 0), r = k.useRef(void 0), [n, i] = k.useState({
1676
- isDirty: !1,
1677
- isValidating: !1,
1678
- isLoading: he(e.defaultValues),
1679
- isSubmitted: !1,
1680
- isSubmitting: !1,
1681
- isSubmitSuccessful: !1,
1682
- isValid: !1,
1683
- submitCount: 0,
1684
- dirtyFields: {},
1685
- touchedFields: {},
1686
- validatingFields: {},
1687
- errors: e.errors || {},
1688
- disabled: e.disabled || !1,
1689
- isReady: !1,
1690
- defaultValues: he(e.defaultValues) ? void 0 : e.defaultValues
1691
- });
1692
- t.current || (t.current = {
1693
- ...e.formControl ? e.formControl : ni(e),
1694
- formState: n
1695
- }, e.formControl && e.defaultValues && !he(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions));
1696
- const o = t.current.control;
1697
- return o._options = e, tr(() => {
1698
- const l = o._subscribe({
1699
- formState: o._proxyFormState,
1700
- callback: () => i({ ...o._formState }),
1701
- reRenderRoot: !0
1702
- });
1703
- return i((c) => ({
1704
- ...c,
1705
- isReady: !0
1706
- })), o._formState.isReady = !0, l;
1707
- }, [o]), k.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), k.useEffect(() => {
1708
- e.mode && (o._options.mode = e.mode), e.reValidateMode && (o._options.reValidateMode = e.reValidateMode), e.errors && !ne(e.errors) && o._setErrors(e.errors);
1709
- }, [o, e.errors, e.mode, e.reValidateMode]), k.useEffect(() => {
1710
- e.shouldUnregister && o._subjects.state.next({
1711
- values: o._getWatch()
1712
- });
1713
- }, [o, e.shouldUnregister]), k.useEffect(() => {
1714
- if (o._proxyFormState.isDirty) {
1715
- const l = o._getDirty();
1716
- l !== n.isDirty && o._subjects.state.next({
1717
- isDirty: l
1718
- });
1719
- }
1720
- }, [o, n.isDirty]), k.useEffect(() => {
1721
- e.values && !_e(e.values, r.current) ? (o._reset(e.values, o._options.resetOptions), r.current = e.values, i((l) => ({ ...l }))) : o._resetDefaultValues();
1722
- }, [o, e.values]), k.useEffect(() => {
1723
- o._state.mount || (o._setValid(), o._state.mount = !0), o._state.watch && (o._state.watch = !1, o._subjects.state.next({ ...o._formState })), o._removeUnmounted();
1724
- }), t.current.formState = Yr(n, o), t.current;
1725
- }
1726
- var en = /* @__PURE__ */ Rn({});
1727
- function jt() {
1728
- return jt = Object.assign ? Object.assign.bind() : function(e) {
1729
- for (var t = 1; t < arguments.length; t++) {
1730
- var r = arguments[t];
1731
- for (var n in r) ({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
1732
- }
1733
- return e;
1734
- }, jt.apply(null, arguments);
1735
- }
1736
- function ii(e) {
1737
- if (Array.isArray(e)) return e;
1738
- }
1739
- function si(e, t) {
1740
- var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1741
- if (r != null) {
1742
- var n, i, o, l, c = [], h = !0, _ = !1;
1743
- try {
1744
- if (o = (r = r.call(e)).next, t === 0) {
1745
- if (Object(r) !== r) return;
1746
- h = !1;
1747
- } else for (; !(h = (n = o.call(r)).done) && (c.push(n.value), c.length !== t); h = !0) ;
1748
- } catch (m) {
1749
- _ = !0, i = m;
1750
- } finally {
1751
- try {
1752
- if (!h && r.return != null && (l = r.return(), Object(l) !== l)) return;
1753
- } finally {
1754
- if (_) throw i;
1755
- }
1756
- }
1757
- return c;
1758
- }
1759
- }
1760
- function Ar(e, t) {
1761
- (t == null || t > e.length) && (t = e.length);
1762
- for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
1763
- return n;
1764
- }
1765
- function ai(e, t) {
1766
- if (e) {
1767
- if (typeof e == "string") return Ar(e, t);
1768
- var r = {}.toString.call(e).slice(8, -1);
1769
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ar(e, t) : void 0;
1770
- }
1771
- }
1772
- function oi() {
1773
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1774
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1775
- }
1776
- function tn(e, t) {
1777
- return ii(e) || si(e, t) || ai(e, t) || oi();
1778
- }
1779
- function we(e) {
1780
- "@babel/helpers - typeof";
1781
- return we = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
1782
- return typeof t;
1783
- } : function(t) {
1784
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
1785
- }, we(e);
1786
- }
1787
- function ui(e, t) {
1788
- if (we(e) != "object" || !e) return e;
1789
- var r = e[Symbol.toPrimitive];
1790
- if (r !== void 0) {
1791
- var n = r.call(e, t);
1792
- if (we(n) != "object") return n;
1793
- throw new TypeError("@@toPrimitive must return a primitive value.");
1794
- }
1795
- return (t === "string" ? String : Number)(e);
1796
- }
1797
- function rn(e) {
1798
- var t = ui(e, "string");
1799
- return we(t) == "symbol" ? t : t + "";
1800
- }
1801
- function re(e, t, r) {
1802
- return (t = rn(t)) in e ? Object.defineProperty(e, t, {
1803
- value: r,
1804
- enumerable: !0,
1805
- configurable: !0,
1806
- writable: !0
1807
- }) : e[t] = r, e;
1808
- }
1809
- function li(e, t) {
1810
- if (e == null) return {};
1811
- var r = {};
1812
- for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
1813
- if (t.indexOf(n) !== -1) continue;
1814
- r[n] = e[n];
1815
- }
1816
- return r;
1817
- }
1818
- function nn(e, t) {
1819
- if (e == null) return {};
1820
- var r, n, i = li(e, t);
1821
- if (Object.getOwnPropertySymbols) {
1822
- var o = Object.getOwnPropertySymbols(e);
1823
- for (n = 0; n < o.length; n++) r = o[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (i[r] = e[r]);
1824
- }
1825
- return i;
1826
- }
1827
- var Vt = { exports: {} };
1828
- /*!
1829
- Copyright (c) 2018 Jed Watson.
1830
- Licensed under the MIT License (MIT), see
1831
- http://jedwatson.github.io/classnames
1832
- */
1833
- var Fr;
1834
- function fi() {
1835
- return Fr || (Fr = 1, function(e) {
1836
- (function() {
1837
- var t = {}.hasOwnProperty;
1838
- function r() {
1839
- for (var o = "", l = 0; l < arguments.length; l++) {
1840
- var c = arguments[l];
1841
- c && (o = i(o, n(c)));
1842
- }
1843
- return o;
1844
- }
1845
- function n(o) {
1846
- if (typeof o == "string" || typeof o == "number")
1847
- return o;
1848
- if (typeof o != "object")
1849
- return "";
1850
- if (Array.isArray(o))
1851
- return r.apply(null, o);
1852
- if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
1853
- return o.toString();
1854
- var l = "";
1855
- for (var c in o)
1856
- t.call(o, c) && o[c] && (l = i(l, c));
1857
- return l;
1858
- }
1859
- function i(o, l) {
1860
- return l ? o ? o + " " + l : o + l : o;
1861
- }
1862
- e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
1863
- })();
1864
- }(Vt)), Vt.exports;
1865
- }
1866
- var ci = fi();
1867
- const di = /* @__PURE__ */ Fn(ci), z = Math.round;
1868
- function Pt(e, t) {
1869
- const r = e.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [], n = r.map((i) => parseFloat(i));
1870
- for (let i = 0; i < 3; i += 1)
1871
- n[i] = t(n[i] || 0, r[i] || "", i);
1872
- return r[3] ? n[3] = r[3].includes("%") ? n[3] / 100 : n[3] : n[3] = 1, n;
1873
- }
1874
- const kr = (e, t, r) => r === 0 ? e : e / 100;
1875
- function tt(e, t) {
1876
- const r = t || 255;
1877
- return e > r ? r : e < 0 ? 0 : e;
1878
- }
1879
- class Ue {
1880
- constructor(t) {
1881
- re(this, "isValid", !0), re(this, "r", 0), re(this, "g", 0), re(this, "b", 0), re(this, "a", 1), re(this, "_h", void 0), re(this, "_s", void 0), re(this, "_l", void 0), re(this, "_v", void 0), re(this, "_max", void 0), re(this, "_min", void 0), re(this, "_brightness", void 0);
1882
- function r(n) {
1883
- return n[0] in t && n[1] in t && n[2] in t;
1884
- }
1885
- if (t) if (typeof t == "string") {
1886
- let i = function(o) {
1887
- return n.startsWith(o);
1888
- };
1889
- const n = t.trim();
1890
- /^#?[A-F\d]{3,8}$/i.test(n) ? this.fromHexString(n) : i("rgb") ? this.fromRgbString(n) : i("hsl") ? this.fromHslString(n) : (i("hsv") || i("hsb")) && this.fromHsvString(n);
1891
- } else if (t instanceof Ue)
1892
- this.r = t.r, this.g = t.g, this.b = t.b, this.a = t.a, this._h = t._h, this._s = t._s, this._l = t._l, this._v = t._v;
1893
- else if (r("rgb"))
1894
- this.r = tt(t.r), this.g = tt(t.g), this.b = tt(t.b), this.a = typeof t.a == "number" ? tt(t.a, 1) : 1;
1895
- else if (r("hsl"))
1896
- this.fromHsl(t);
1897
- else if (r("hsv"))
1898
- this.fromHsv(t);
1899
- else
1900
- throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(t));
1901
- }
1902
- // ======================= Setter =======================
1903
- setR(t) {
1904
- return this._sc("r", t);
1905
- }
1906
- setG(t) {
1907
- return this._sc("g", t);
1908
- }
1909
- setB(t) {
1910
- return this._sc("b", t);
1911
- }
1912
- setA(t) {
1913
- return this._sc("a", t, 1);
1914
- }
1915
- setHue(t) {
1916
- const r = this.toHsv();
1917
- return r.h = t, this._c(r);
1918
- }
1919
- // ======================= Getter =======================
1920
- /**
1921
- * Returns the perceived luminance of a color, from 0-1.
1922
- * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
1923
- */
1924
- getLuminance() {
1925
- function t(o) {
1926
- const l = o / 255;
1927
- return l <= 0.03928 ? l / 12.92 : Math.pow((l + 0.055) / 1.055, 2.4);
1928
- }
1929
- const r = t(this.r), n = t(this.g), i = t(this.b);
1930
- return 0.2126 * r + 0.7152 * n + 0.0722 * i;
1931
- }
1932
- getHue() {
1933
- if (typeof this._h > "u") {
1934
- const t = this.getMax() - this.getMin();
1935
- t === 0 ? this._h = 0 : this._h = z(60 * (this.r === this.getMax() ? (this.g - this.b) / t + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / t + 2 : (this.r - this.g) / t + 4));
1936
- }
1937
- return this._h;
1938
- }
1939
- getSaturation() {
1940
- if (typeof this._s > "u") {
1941
- const t = this.getMax() - this.getMin();
1942
- t === 0 ? this._s = 0 : this._s = t / this.getMax();
1943
- }
1944
- return this._s;
1945
- }
1946
- getLightness() {
1947
- return typeof this._l > "u" && (this._l = (this.getMax() + this.getMin()) / 510), this._l;
1948
- }
1949
- getValue() {
1950
- return typeof this._v > "u" && (this._v = this.getMax() / 255), this._v;
1951
- }
1952
- /**
1953
- * Returns the perceived brightness of the color, from 0-255.
1954
- * Note: this is not the b of HSB
1955
- * @see http://www.w3.org/TR/AERT#color-contrast
1956
- */
1957
- getBrightness() {
1958
- return typeof this._brightness > "u" && (this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3), this._brightness;
1959
- }
1960
- // ======================== Func ========================
1961
- darken(t = 10) {
1962
- const r = this.getHue(), n = this.getSaturation();
1963
- let i = this.getLightness() - t / 100;
1964
- return i < 0 && (i = 0), this._c({
1965
- h: r,
1966
- s: n,
1967
- l: i,
1968
- a: this.a
1969
- });
1970
- }
1971
- lighten(t = 10) {
1972
- const r = this.getHue(), n = this.getSaturation();
1973
- let i = this.getLightness() + t / 100;
1974
- return i > 1 && (i = 1), this._c({
1975
- h: r,
1976
- s: n,
1977
- l: i,
1978
- a: this.a
1979
- });
1980
- }
1981
- /**
1982
- * Mix the current color a given amount with another color, from 0 to 100.
1983
- * 0 means no mixing (return current color).
1984
- */
1985
- mix(t, r = 50) {
1986
- const n = this._c(t), i = r / 100, o = (c) => (n[c] - this[c]) * i + this[c], l = {
1987
- r: z(o("r")),
1988
- g: z(o("g")),
1989
- b: z(o("b")),
1990
- a: z(o("a") * 100) / 100
1991
- };
1992
- return this._c(l);
1993
- }
1994
- /**
1995
- * Mix the color with pure white, from 0 to 100.
1996
- * Providing 0 will do nothing, providing 100 will always return white.
1997
- */
1998
- tint(t = 10) {
1999
- return this.mix({
2000
- r: 255,
2001
- g: 255,
2002
- b: 255,
2003
- a: 1
2004
- }, t);
2005
- }
2006
- /**
2007
- * Mix the color with pure black, from 0 to 100.
2008
- * Providing 0 will do nothing, providing 100 will always return black.
2009
- */
2010
- shade(t = 10) {
2011
- return this.mix({
2012
- r: 0,
2013
- g: 0,
2014
- b: 0,
2015
- a: 1
2016
- }, t);
2017
- }
2018
- onBackground(t) {
2019
- const r = this._c(t), n = this.a + r.a * (1 - this.a), i = (o) => z((this[o] * this.a + r[o] * r.a * (1 - this.a)) / n);
2020
- return this._c({
2021
- r: i("r"),
2022
- g: i("g"),
2023
- b: i("b"),
2024
- a: n
2025
- });
2026
- }
2027
- // ======================= Status =======================
2028
- isDark() {
2029
- return this.getBrightness() < 128;
2030
- }
2031
- isLight() {
2032
- return this.getBrightness() >= 128;
2033
- }
2034
- // ======================== MISC ========================
2035
- equals(t) {
2036
- return this.r === t.r && this.g === t.g && this.b === t.b && this.a === t.a;
2037
- }
2038
- clone() {
2039
- return this._c(this);
2040
- }
2041
- // ======================= Format =======================
2042
- toHexString() {
2043
- let t = "#";
2044
- const r = (this.r || 0).toString(16);
2045
- t += r.length === 2 ? r : "0" + r;
2046
- const n = (this.g || 0).toString(16);
2047
- t += n.length === 2 ? n : "0" + n;
2048
- const i = (this.b || 0).toString(16);
2049
- if (t += i.length === 2 ? i : "0" + i, typeof this.a == "number" && this.a >= 0 && this.a < 1) {
2050
- const o = z(this.a * 255).toString(16);
2051
- t += o.length === 2 ? o : "0" + o;
2052
- }
2053
- return t;
2054
- }
2055
- /** CSS support color pattern */
2056
- toHsl() {
2057
- return {
2058
- h: this.getHue(),
2059
- s: this.getSaturation(),
2060
- l: this.getLightness(),
2061
- a: this.a
2062
- };
2063
- }
2064
- /** CSS support color pattern */
2065
- toHslString() {
2066
- const t = this.getHue(), r = z(this.getSaturation() * 100), n = z(this.getLightness() * 100);
2067
- return this.a !== 1 ? `hsla(${t},${r}%,${n}%,${this.a})` : `hsl(${t},${r}%,${n}%)`;
2068
- }
2069
- /** Same as toHsb */
2070
- toHsv() {
2071
- return {
2072
- h: this.getHue(),
2073
- s: this.getSaturation(),
2074
- v: this.getValue(),
2075
- a: this.a
2076
- };
2077
- }
2078
- toRgb() {
2079
- return {
2080
- r: this.r,
2081
- g: this.g,
2082
- b: this.b,
2083
- a: this.a
2084
- };
2085
- }
2086
- toRgbString() {
2087
- return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
2088
- }
2089
- toString() {
2090
- return this.toRgbString();
2091
- }
2092
- // ====================== Privates ======================
2093
- /** Return a new FastColor object with one channel changed */
2094
- _sc(t, r, n) {
2095
- const i = this.clone();
2096
- return i[t] = tt(r, n), i;
2097
- }
2098
- _c(t) {
2099
- return new this.constructor(t);
2100
- }
2101
- getMax() {
2102
- return typeof this._max > "u" && (this._max = Math.max(this.r, this.g, this.b)), this._max;
2103
- }
2104
- getMin() {
2105
- return typeof this._min > "u" && (this._min = Math.min(this.r, this.g, this.b)), this._min;
2106
- }
2107
- fromHexString(t) {
2108
- const r = t.replace("#", "");
2109
- function n(i, o) {
2110
- return parseInt(r[i] + r[o || i], 16);
2111
- }
2112
- r.length < 6 ? (this.r = n(0), this.g = n(1), this.b = n(2), this.a = r[3] ? n(3) / 255 : 1) : (this.r = n(0, 1), this.g = n(2, 3), this.b = n(4, 5), this.a = r[6] ? n(6, 7) / 255 : 1);
2113
- }
2114
- fromHsl({
2115
- h: t,
2116
- s: r,
2117
- l: n,
2118
- a: i
2119
- }) {
2120
- if (this._h = t % 360, this._s = r, this._l = n, this.a = typeof i == "number" ? i : 1, r <= 0) {
2121
- const S = z(n * 255);
2122
- this.r = S, this.g = S, this.b = S;
2123
- }
2124
- let o = 0, l = 0, c = 0;
2125
- const h = t / 60, _ = (1 - Math.abs(2 * n - 1)) * r, m = _ * (1 - Math.abs(h % 2 - 1));
2126
- h >= 0 && h < 1 ? (o = _, l = m) : h >= 1 && h < 2 ? (o = m, l = _) : h >= 2 && h < 3 ? (l = _, c = m) : h >= 3 && h < 4 ? (l = m, c = _) : h >= 4 && h < 5 ? (o = m, c = _) : h >= 5 && h < 6 && (o = _, c = m);
2127
- const C = n - _ / 2;
2128
- this.r = z((o + C) * 255), this.g = z((l + C) * 255), this.b = z((c + C) * 255);
2129
- }
2130
- fromHsv({
2131
- h: t,
2132
- s: r,
2133
- v: n,
2134
- a: i
2135
- }) {
2136
- this._h = t % 360, this._s = r, this._v = n, this.a = typeof i == "number" ? i : 1;
2137
- const o = z(n * 255);
2138
- if (this.r = o, this.g = o, this.b = o, r <= 0)
2139
- return;
2140
- const l = t / 60, c = Math.floor(l), h = l - c, _ = z(n * (1 - r) * 255), m = z(n * (1 - r * h) * 255), C = z(n * (1 - r * (1 - h)) * 255);
2141
- switch (c) {
2142
- case 0:
2143
- this.g = C, this.b = _;
2144
- break;
2145
- case 1:
2146
- this.r = m, this.b = _;
2147
- break;
2148
- case 2:
2149
- this.r = _, this.b = C;
2150
- break;
2151
- case 3:
2152
- this.r = _, this.g = m;
2153
- break;
2154
- case 4:
2155
- this.r = C, this.g = _;
2156
- break;
2157
- case 5:
2158
- default:
2159
- this.g = _, this.b = m;
2160
- break;
2161
- }
2162
- }
2163
- fromHsvString(t) {
2164
- const r = Pt(t, kr);
2165
- this.fromHsv({
2166
- h: r[0],
2167
- s: r[1],
2168
- v: r[2],
2169
- a: r[3]
2170
- });
2171
- }
2172
- fromHslString(t) {
2173
- const r = Pt(t, kr);
2174
- this.fromHsl({
2175
- h: r[0],
2176
- s: r[1],
2177
- l: r[2],
2178
- a: r[3]
2179
- });
2180
- }
2181
- fromRgbString(t) {
2182
- const r = Pt(t, (n, i) => (
2183
- // Convert percentage to number. e.g. 50% -> 128
2184
- i.includes("%") ? z(n / 100 * 255) : n
2185
- ));
2186
- this.r = r[0], this.g = r[1], this.b = r[2], this.a = r[3];
2187
- }
2188
- }
2189
- var dt = 2, Vr = 0.16, hi = 0.05, gi = 0.05, yi = 0.15, sn = 5, an = 4, vi = [{
2190
- index: 7,
2191
- amount: 15
2192
- }, {
2193
- index: 6,
2194
- amount: 25
2195
- }, {
2196
- index: 5,
2197
- amount: 30
2198
- }, {
2199
- index: 5,
2200
- amount: 45
2201
- }, {
2202
- index: 5,
2203
- amount: 65
2204
- }, {
2205
- index: 5,
2206
- amount: 85
2207
- }, {
2208
- index: 4,
2209
- amount: 90
2210
- }, {
2211
- index: 3,
2212
- amount: 95
2213
- }, {
2214
- index: 2,
2215
- amount: 97
2216
- }, {
2217
- index: 1,
2218
- amount: 98
2219
- }];
2220
- function Pr(e, t, r) {
2221
- var n;
2222
- return Math.round(e.h) >= 60 && Math.round(e.h) <= 240 ? n = r ? Math.round(e.h) - dt * t : Math.round(e.h) + dt * t : n = r ? Math.round(e.h) + dt * t : Math.round(e.h) - dt * t, n < 0 ? n += 360 : n >= 360 && (n -= 360), n;
2223
- }
2224
- function Dr(e, t, r) {
2225
- if (e.h === 0 && e.s === 0)
2226
- return e.s;
2227
- var n;
2228
- return r ? n = e.s - Vr * t : t === an ? n = e.s + Vr : n = e.s + hi * t, n > 1 && (n = 1), r && t === sn && n > 0.1 && (n = 0.1), n < 0.06 && (n = 0.06), Math.round(n * 100) / 100;
2229
- }
2230
- function jr(e, t, r) {
2231
- var n;
2232
- return r ? n = e.v + gi * t : n = e.v - yi * t, n = Math.max(0, Math.min(1, n)), Math.round(n * 100) / 100;
2233
- }
2234
- function bi(e) {
2235
- for (var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = [], n = new Ue(e), i = n.toHsv(), o = sn; o > 0; o -= 1) {
2236
- var l = new Ue({
2237
- h: Pr(i, o, !0),
2238
- s: Dr(i, o, !0),
2239
- v: jr(i, o, !0)
2240
- });
2241
- r.push(l);
2242
- }
2243
- r.push(n);
2244
- for (var c = 1; c <= an; c += 1) {
2245
- var h = new Ue({
2246
- h: Pr(i, c),
2247
- s: Dr(i, c),
2248
- v: jr(i, c)
2249
- });
2250
- r.push(h);
2251
- }
2252
- return t.theme === "dark" ? vi.map(function(_) {
2253
- var m = _.index, C = _.amount;
2254
- return new Ue(t.backgroundColor || "#141414").mix(r[m], C).toHexString();
2255
- }) : r.map(function(_) {
2256
- return _.toHexString();
2257
- });
2258
- }
2259
- var Ji = {
2260
- red: "#F5222D",
2261
- volcano: "#FA541C",
2262
- orange: "#FA8C16",
2263
- gold: "#FAAD14",
2264
- yellow: "#FADB14",
2265
- lime: "#A0D911",
2266
- green: "#52C41A",
2267
- cyan: "#13C2C2",
2268
- blue: "#1677FF",
2269
- geekblue: "#2F54EB",
2270
- purple: "#722ED1",
2271
- magenta: "#EB2F96",
2272
- grey: "#666666"
2273
- }, Mt = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
2274
- Mt.primary = Mt[5];
2275
- var Nt = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
2276
- Nt.primary = Nt[5];
2277
- var It = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
2278
- It.primary = It[5];
2279
- var Lt = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
2280
- Lt.primary = Lt[5];
2281
- var Ut = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
2282
- Ut.primary = Ut[5];
2283
- var Bt = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
2284
- Bt.primary = Bt[5];
2285
- var Ht = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
2286
- Ht.primary = Ht[5];
2287
- var $t = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
2288
- $t.primary = $t[5];
2289
- var mt = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
2290
- mt.primary = mt[5];
2291
- var Wt = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
2292
- Wt.primary = Wt[5];
2293
- var qt = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
2294
- qt.primary = qt[5];
2295
- var Yt = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
2296
- Yt.primary = Yt[5];
2297
- var zt = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
2298
- zt.primary = zt[5];
2299
- var Gi = {
2300
- red: Mt,
2301
- volcano: Nt,
2302
- orange: It,
2303
- gold: Lt,
2304
- yellow: Ut,
2305
- lime: Bt,
2306
- green: Ht,
2307
- cyan: $t,
2308
- blue: mt,
2309
- geekblue: Wt,
2310
- purple: qt,
2311
- magenta: Yt,
2312
- grey: zt
2313
- };
2314
- function Mr(e, t) {
2315
- var r = Object.keys(e);
2316
- if (Object.getOwnPropertySymbols) {
2317
- var n = Object.getOwnPropertySymbols(e);
2318
- t && (n = n.filter(function(i) {
2319
- return Object.getOwnPropertyDescriptor(e, i).enumerable;
2320
- })), r.push.apply(r, n);
2321
- }
2322
- return r;
2323
- }
2324
- function ye(e) {
2325
- for (var t = 1; t < arguments.length; t++) {
2326
- var r = arguments[t] != null ? arguments[t] : {};
2327
- t % 2 ? Mr(Object(r), !0).forEach(function(n) {
2328
- re(e, n, r[n]);
2329
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Mr(Object(r)).forEach(function(n) {
2330
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
2331
- });
2332
- }
2333
- return e;
2334
- }
2335
- function mi() {
2336
- return !!(typeof window < "u" && window.document && window.document.createElement);
2337
- }
2338
- function pi(e, t) {
2339
- if (!e)
2340
- return !1;
2341
- if (e.contains)
2342
- return e.contains(t);
2343
- for (var r = t; r; ) {
2344
- if (r === e)
2345
- return !0;
2346
- r = r.parentNode;
2347
- }
2348
- return !1;
2349
- }
2350
- var Nr = "data-rc-order", Ir = "data-rc-priority", _i = "rc-util-key", Kt = /* @__PURE__ */ new Map();
2351
- function on() {
2352
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mark;
2353
- return t ? t.startsWith("data-") ? t : "data-".concat(t) : _i;
2354
- }
2355
- function wt(e) {
2356
- if (e.attachTo)
2357
- return e.attachTo;
2358
- var t = document.querySelector("head");
2359
- return t || document.body;
2360
- }
2361
- function wi(e) {
2362
- return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
2363
- }
2364
- function ir(e) {
2365
- return Array.from((Kt.get(e) || e).children).filter(function(t) {
2366
- return t.tagName === "STYLE";
2367
- });
2368
- }
2369
- function un(e) {
2370
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2371
- if (!mi())
2372
- return null;
2373
- var r = t.csp, n = t.prepend, i = t.priority, o = i === void 0 ? 0 : i, l = wi(n), c = l === "prependQueue", h = document.createElement("style");
2374
- h.setAttribute(Nr, l), c && o && h.setAttribute(Ir, "".concat(o)), r != null && r.nonce && (h.nonce = r == null ? void 0 : r.nonce), h.innerHTML = e;
2375
- var _ = wt(t), m = _.firstChild;
2376
- if (n) {
2377
- if (c) {
2378
- var C = (t.styles || ir(_)).filter(function(S) {
2379
- if (!["prepend", "prependQueue"].includes(S.getAttribute(Nr)))
2380
- return !1;
2381
- var G = Number(S.getAttribute(Ir) || 0);
2382
- return o >= G;
2383
- });
2384
- if (C.length)
2385
- return _.insertBefore(h, C[C.length - 1].nextSibling), h;
2386
- }
2387
- _.insertBefore(h, m);
2388
- } else
2389
- _.appendChild(h);
2390
- return h;
2391
- }
2392
- function ln(e) {
2393
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = wt(t);
2394
- return (t.styles || ir(r)).find(function(n) {
2395
- return n.getAttribute(on(t)) === e;
2396
- });
2397
- }
2398
- function Xi(e) {
2399
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = ln(e, t);
2400
- if (r) {
2401
- var n = wt(t);
2402
- n.removeChild(r);
2403
- }
2404
- }
2405
- function xi(e, t) {
2406
- var r = Kt.get(e);
2407
- if (!r || !pi(document, r)) {
2408
- var n = un("", t), i = n.parentNode;
2409
- Kt.set(e, i), e.removeChild(n);
2410
- }
2411
- }
2412
- function Ci(e, t) {
2413
- var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = wt(r), i = ir(n), o = ye(ye({}, r), {}, {
2414
- styles: i
2415
- });
2416
- xi(n, o);
2417
- var l = ln(t, o);
2418
- if (l) {
2419
- var c, h;
2420
- if ((c = o.csp) !== null && c !== void 0 && c.nonce && l.nonce !== ((h = o.csp) === null || h === void 0 ? void 0 : h.nonce)) {
2421
- var _;
2422
- l.nonce = (_ = o.csp) === null || _ === void 0 ? void 0 : _.nonce;
2423
- }
2424
- return l.innerHTML !== e && (l.innerHTML = e), l;
2425
- }
2426
- var m = un(e, o);
2427
- return m.setAttribute(on(o), t), m;
2428
- }
2429
- function fn(e) {
2430
- var t;
2431
- return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
2432
- }
2433
- function Si(e) {
2434
- return fn(e) instanceof ShadowRoot;
2435
- }
2436
- function Ei(e) {
2437
- return Si(e) ? fn(e) : null;
2438
- }
2439
- var Jt = {}, sr = [], Ri = function(t) {
2440
- sr.push(t);
2441
- };
2442
- function Ti(e, t) {
2443
- if (process.env.NODE_ENV !== "production" && !e && console !== void 0) {
2444
- var r = sr.reduce(function(n, i) {
2445
- return i(n ?? "", "warning");
2446
- }, t);
2447
- r && console.error("Warning: ".concat(r));
2448
- }
2449
- }
2450
- function Oi(e, t) {
2451
- if (process.env.NODE_ENV !== "production" && !e && console !== void 0) {
2452
- var r = sr.reduce(function(n, i) {
2453
- return i(n ?? "", "note");
2454
- }, t);
2455
- r && console.warn("Note: ".concat(r));
2456
- }
2457
- }
2458
- function Ai() {
2459
- Jt = {};
2460
- }
2461
- function cn(e, t, r) {
2462
- !t && !Jt[r] && (e(!1, r), Jt[r] = !0);
2463
- }
2464
- function xt(e, t) {
2465
- cn(Ti, e, t);
2466
- }
2467
- function Fi(e, t) {
2468
- cn(Oi, e, t);
2469
- }
2470
- xt.preMessage = Ri;
2471
- xt.resetWarned = Ai;
2472
- xt.noteOnce = Fi;
2473
- function ki(e) {
2474
- return e.replace(/-(.)/g, function(t, r) {
2475
- return r.toUpperCase();
2476
- });
2477
- }
2478
- function Vi(e, t) {
2479
- xt(e, "[@ant-design/icons] ".concat(t));
2480
- }
2481
- function Lr(e) {
2482
- return we(e) === "object" && typeof e.name == "string" && typeof e.theme == "string" && (we(e.icon) === "object" || typeof e.icon == "function");
2483
- }
2484
- function Ur() {
2485
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2486
- return Object.keys(e).reduce(function(t, r) {
2487
- var n = e[r];
2488
- switch (r) {
2489
- case "class":
2490
- t.className = n, delete t.class;
2491
- break;
2492
- default:
2493
- delete t[r], t[ki(r)] = n;
2494
- }
2495
- return t;
2496
- }, {});
2497
- }
2498
- function Gt(e, t, r) {
2499
- return r ? /* @__PURE__ */ k.createElement(e.tag, ye(ye({
2500
- key: t
2501
- }, Ur(e.attrs)), r), (e.children || []).map(function(n, i) {
2502
- return Gt(n, "".concat(t, "-").concat(e.tag, "-").concat(i));
2503
- })) : /* @__PURE__ */ k.createElement(e.tag, ye({
2504
- key: t
2505
- }, Ur(e.attrs)), (e.children || []).map(function(n, i) {
2506
- return Gt(n, "".concat(t, "-").concat(e.tag, "-").concat(i));
2507
- }));
2508
- }
2509
- function dn(e) {
2510
- return bi(e)[0];
2511
- }
2512
- function hn(e) {
2513
- return e ? Array.isArray(e) ? e : [e] : [];
2514
- }
2515
- var Pi = `
2516
- .anticon {
2517
- display: inline-flex;
2518
- align-items: center;
2519
- color: inherit;
2520
- font-style: normal;
2521
- line-height: 0;
2522
- text-align: center;
2523
- text-transform: none;
2524
- vertical-align: -0.125em;
2525
- text-rendering: optimizeLegibility;
2526
- -webkit-font-smoothing: antialiased;
2527
- -moz-osx-font-smoothing: grayscale;
2528
- }
2529
-
2530
- .anticon > * {
2531
- line-height: 1;
2532
- }
2533
-
2534
- .anticon svg {
2535
- display: inline-block;
2536
- }
2537
-
2538
- .anticon::before {
2539
- display: none;
2540
- }
2541
-
2542
- .anticon .anticon-icon {
2543
- display: block;
2544
- }
2545
-
2546
- .anticon[tabindex] {
2547
- cursor: pointer;
2548
- }
2549
-
2550
- .anticon-spin::before,
2551
- .anticon-spin {
2552
- display: inline-block;
2553
- -webkit-animation: loadingCircle 1s infinite linear;
2554
- animation: loadingCircle 1s infinite linear;
2555
- }
2556
-
2557
- @-webkit-keyframes loadingCircle {
2558
- 100% {
2559
- -webkit-transform: rotate(360deg);
2560
- transform: rotate(360deg);
2561
- }
2562
- }
2563
-
2564
- @keyframes loadingCircle {
2565
- 100% {
2566
- -webkit-transform: rotate(360deg);
2567
- transform: rotate(360deg);
2568
- }
2569
- }
2570
- `, Di = function(t) {
2571
- var r = Tn(en), n = r.csp, i = r.prefixCls, o = r.layer, l = Pi;
2572
- i && (l = l.replace(/anticon/g, i)), o && (l = "@layer ".concat(o, ` {
2573
- `).concat(l, `
2574
- }`)), On(function() {
2575
- var c = t.current, h = Ei(c);
2576
- Ci(l, "@ant-design-icons", {
2577
- prepend: !o,
2578
- csp: n,
2579
- attachTo: h
2580
- });
2581
- }, []);
2582
- }, ji = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"], it = {
2583
- primaryColor: "#333",
2584
- secondaryColor: "#E6E6E6",
2585
- calculated: !1
2586
- };
2587
- function Mi(e) {
2588
- var t = e.primaryColor, r = e.secondaryColor;
2589
- it.primaryColor = t, it.secondaryColor = r || dn(t), it.calculated = !!r;
2590
- }
2591
- function Ni() {
2592
- return ye({}, it);
2593
- }
2594
- var Be = function(t) {
2595
- var r = t.icon, n = t.className, i = t.onClick, o = t.style, l = t.primaryColor, c = t.secondaryColor, h = nn(t, ji), _ = Oe.useRef(), m = it;
2596
- if (l && (m = {
2597
- primaryColor: l,
2598
- secondaryColor: c || dn(l)
2599
- }), Di(_), Vi(Lr(r), "icon should be icon definiton, but got ".concat(r)), !Lr(r))
2600
- return null;
2601
- var C = r;
2602
- return C && typeof C.icon == "function" && (C = ye(ye({}, C), {}, {
2603
- icon: C.icon(m.primaryColor, m.secondaryColor)
2604
- })), Gt(C.icon, "svg-".concat(C.name), ye(ye({
2605
- className: n,
2606
- onClick: i,
2607
- style: o,
2608
- "data-icon": C.name,
2609
- width: "1em",
2610
- height: "1em",
2611
- fill: "currentColor",
2612
- "aria-hidden": "true"
2613
- }, h), {}, {
2614
- ref: _
2615
- }));
2616
- };
2617
- Be.displayName = "IconReact";
2618
- Be.getTwoToneColors = Ni;
2619
- Be.setTwoToneColors = Mi;
2620
- function gn(e) {
2621
- var t = hn(e), r = tn(t, 2), n = r[0], i = r[1];
2622
- return Be.setTwoToneColors({
2623
- primaryColor: n,
2624
- secondaryColor: i
2625
- });
2626
- }
2627
- function Ii() {
2628
- var e = Be.getTwoToneColors();
2629
- return e.calculated ? [e.primaryColor, e.secondaryColor] : e.primaryColor;
2630
- }
2631
- var Li = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
2632
- gn(mt.primary);
2633
- var ar = /* @__PURE__ */ Oe.forwardRef(function(e, t) {
2634
- var r = e.className, n = e.icon, i = e.spin, o = e.rotate, l = e.tabIndex, c = e.onClick, h = e.twoToneColor, _ = nn(e, Li), m = Oe.useContext(en), C = m.prefixCls, S = C === void 0 ? "anticon" : C, G = m.rootClassName, X = di(G, S, re(re({}, "".concat(S, "-").concat(n.name), !!n.name), "".concat(S, "-spin"), !!i || n.name === "loading"), r), N = l;
2635
- N === void 0 && c && (N = -1);
2636
- var Q = o ? {
2637
- msTransform: "rotate(".concat(o, "deg)"),
2638
- transform: "rotate(".concat(o, "deg)")
2639
- } : void 0, M = hn(h), x = tn(M, 2), Z = x[0], K = x[1];
2640
- return /* @__PURE__ */ Oe.createElement("span", jt({
2641
- role: "img",
2642
- "aria-label": n.name
2643
- }, _, {
2644
- ref: t,
2645
- tabIndex: N,
2646
- onClick: c,
2647
- className: X
2648
- }), /* @__PURE__ */ Oe.createElement(Be, {
2649
- icon: n,
2650
- primaryColor: Z,
2651
- secondaryColor: K,
2652
- style: Q
2653
- }));
2654
- });
2655
- ar.displayName = "AntdIcon";
2656
- ar.getTwoToneColor = Ii;
2657
- ar.setTwoToneColor = gn;
2658
- function Qi(e, t) {
2659
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
2660
- }
2661
- function Br(e, t) {
2662
- for (var r = 0; r < t.length; r++) {
2663
- var n = t[r];
2664
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, rn(n.key), n);
2665
- }
2666
- }
2667
- function Zi(e, t, r) {
2668
- return t && Br(e.prototype, t), r && Br(e, r), Object.defineProperty(e, "prototype", {
2669
- writable: !1
2670
- }), e;
2671
- }
2672
- function Ui(e) {
2673
- if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2674
- return e;
2675
- }
2676
- function Xt(e, t) {
2677
- return Xt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, n) {
2678
- return r.__proto__ = n, r;
2679
- }, Xt(e, t);
2680
- }
2681
- function es(e, t) {
2682
- if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
2683
- e.prototype = Object.create(t && t.prototype, {
2684
- constructor: {
2685
- value: e,
2686
- writable: !0,
2687
- configurable: !0
2688
- }
2689
- }), Object.defineProperty(e, "prototype", {
2690
- writable: !1
2691
- }), t && Xt(e, t);
2692
- }
2693
- function pt(e) {
2694
- return pt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
2695
- return t.__proto__ || Object.getPrototypeOf(t);
2696
- }, pt(e);
2697
- }
2698
- function yn() {
2699
- try {
2700
- var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
2701
- }));
2702
- } catch {
2703
- }
2704
- return (yn = function() {
2705
- return !!e;
2706
- })();
2707
- }
2708
- function Bi(e, t) {
2709
- if (t && (we(t) == "object" || typeof t == "function")) return t;
2710
- if (t !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
2711
- return Ui(e);
2712
- }
2713
- function ts(e) {
2714
- var t = yn();
2715
- return function() {
2716
- var r, n = pt(e);
2717
- if (t) {
2718
- var i = pt(this).constructor;
2719
- r = Reflect.construct(n, arguments, i);
2720
- } else r = n.apply(this, arguments);
2721
- return Bi(this, r);
2722
- };
2723
- }
2724
- export {
2725
- en as A,
2726
- Wi as B,
2727
- Fn as C,
2728
- zi as D,
2729
- qi as E,
2730
- Ue as F,
2731
- ar as I,
2732
- Yi as L,
2733
- Nn as T,
2734
- jt as _,
2735
- we as a,
2736
- Ar as b,
2737
- di as c,
2738
- ai as d,
2739
- Zi as e,
2740
- Qi as f,
2741
- re as g,
2742
- tn as h,
2743
- Ti as i,
2744
- Fe as j,
2745
- mi as k,
2746
- ye as l,
2747
- Ci as m,
2748
- ii as n,
2749
- oi as o,
2750
- Ai as p,
2751
- bi as q,
2752
- Xi as r,
2753
- Ji as s,
2754
- Gi as t,
2755
- Ki as u,
2756
- es as v,
2757
- xt as w,
2758
- ts as x,
2759
- Ui as y,
2760
- nn as z
2761
- };