@sito/dashboard-app 0.0.42 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/dashboard-app.cjs +1 -1
- package/dist/dashboard-app.js +663 -634
- package/dist/hooks/actions/types.d.ts +6 -2
- package/package.json +1 -1
package/dist/dashboard-app.js
CHANGED
|
@@ -18,13 +18,13 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
18
18
|
defaultValue: n,
|
|
19
19
|
onChange: i,
|
|
20
20
|
state: r = Cs.default,
|
|
21
|
-
name:
|
|
21
|
+
name: a = "",
|
|
22
22
|
id: c = "",
|
|
23
|
-
label:
|
|
23
|
+
label: l = "",
|
|
24
24
|
disabled: m = !1,
|
|
25
|
-
required:
|
|
26
|
-
containerClassName:
|
|
27
|
-
inputClassName:
|
|
25
|
+
required: y = !1,
|
|
26
|
+
containerClassName: h = "",
|
|
27
|
+
inputClassName: d = "",
|
|
28
28
|
labelClassName: p = "",
|
|
29
29
|
helperText: _ = "",
|
|
30
30
|
helperTextClassName: C = "",
|
|
@@ -34,15 +34,15 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
34
34
|
), x = B ? Ct(s) : N, A = (I) => {
|
|
35
35
|
B || $(I.currentTarget.value.length > 0), i == null || i(I);
|
|
36
36
|
};
|
|
37
|
-
return /* @__PURE__ */ T("div", { className: `form-paragraph-container group ${
|
|
37
|
+
return /* @__PURE__ */ T("div", { className: `form-paragraph-container group ${h}`, children: [
|
|
38
38
|
/* @__PURE__ */ g(
|
|
39
39
|
"textarea",
|
|
40
40
|
{
|
|
41
41
|
ref: t,
|
|
42
|
-
name:
|
|
42
|
+
name: a,
|
|
43
43
|
id: c,
|
|
44
|
-
className: `text-input text-area form-paragraph-textarea peer ${Es(r)} ${x ? "has-value" : ""} ${k.placeholder ? "has-placeholder" : ""} ${
|
|
45
|
-
required:
|
|
44
|
+
className: `text-input text-area form-paragraph-textarea peer ${Es(r)} ${x ? "has-value" : ""} ${k.placeholder ? "has-placeholder" : ""} ${d}`,
|
|
45
|
+
required: y,
|
|
46
46
|
defaultValue: n,
|
|
47
47
|
...B ? { value: s } : {},
|
|
48
48
|
onChange: A,
|
|
@@ -56,8 +56,8 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
56
56
|
htmlFor: c,
|
|
57
57
|
className: `text-input-label ${ks(r)} ${p}`,
|
|
58
58
|
children: [
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
l,
|
|
60
|
+
y ? " *" : ""
|
|
61
61
|
]
|
|
62
62
|
}
|
|
63
63
|
),
|
|
@@ -75,12 +75,12 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
75
75
|
handleSubmit: n,
|
|
76
76
|
onSubmit: i,
|
|
77
77
|
isLoading: r = !1,
|
|
78
|
-
buttonEnd:
|
|
78
|
+
buttonEnd: a = !0,
|
|
79
79
|
reset: c
|
|
80
80
|
} = e;
|
|
81
81
|
return /* @__PURE__ */ T("form", { className: "form-container", onSubmit: n(i), children: [
|
|
82
82
|
s,
|
|
83
|
-
/* @__PURE__ */ T("div", { className: `form-actions ${
|
|
83
|
+
/* @__PURE__ */ T("div", { className: `form-actions ${a ? "end" : ""}`, children: [
|
|
84
84
|
/* @__PURE__ */ T(
|
|
85
85
|
we,
|
|
86
86
|
{
|
|
@@ -130,30 +130,30 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
130
130
|
children: n,
|
|
131
131
|
handleClose: i,
|
|
132
132
|
open: r = !1,
|
|
133
|
-
containerClassName:
|
|
133
|
+
containerClassName: a = "",
|
|
134
134
|
className: c = "",
|
|
135
|
-
animationClass:
|
|
135
|
+
animationClass: l = "appear"
|
|
136
136
|
} = e, m = D(
|
|
137
|
-
(
|
|
138
|
-
|
|
137
|
+
(h) => {
|
|
138
|
+
h.key === "Escape" && r && i();
|
|
139
139
|
},
|
|
140
140
|
[r, i]
|
|
141
141
|
);
|
|
142
142
|
le(() => (window.addEventListener("keydown", m), () => {
|
|
143
143
|
window.removeEventListener("keydown", m);
|
|
144
144
|
}), [m]);
|
|
145
|
-
const
|
|
146
|
-
(
|
|
147
|
-
|
|
145
|
+
const y = D(
|
|
146
|
+
(h) => {
|
|
147
|
+
h.target === h.currentTarget && i();
|
|
148
148
|
},
|
|
149
149
|
[i]
|
|
150
150
|
);
|
|
151
151
|
return le(() => {
|
|
152
|
-
const
|
|
153
|
-
|
|
152
|
+
const h = (d) => {
|
|
153
|
+
d ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
|
|
154
154
|
};
|
|
155
|
-
return
|
|
156
|
-
|
|
155
|
+
return h(r), () => {
|
|
156
|
+
h(!1);
|
|
157
157
|
};
|
|
158
158
|
}, [r]), Kt(
|
|
159
159
|
/* @__PURE__ */ g(
|
|
@@ -161,12 +161,12 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
161
161
|
{
|
|
162
162
|
"aria-label": t("_accessibility:ariaLabels.closeDialog"),
|
|
163
163
|
"aria-hidden": !r,
|
|
164
|
-
onClick:
|
|
165
|
-
className: `dialog-backdrop animated ${r ? `opened ${
|
|
164
|
+
onClick: y,
|
|
165
|
+
className: `dialog-backdrop animated ${r ? `opened ${l}` : "closed"} ${a}`,
|
|
166
166
|
children: /* @__PURE__ */ T(
|
|
167
167
|
"div",
|
|
168
168
|
{
|
|
169
|
-
className: `dialog elevated animated ${r ? `opened ${
|
|
169
|
+
className: `dialog elevated animated ${r ? `opened ${l}` : "closed"} ${c}`,
|
|
170
170
|
children: [
|
|
171
171
|
/* @__PURE__ */ T("div", { className: "dialog-header", children: [
|
|
172
172
|
/* @__PURE__ */ g("h3", { className: "dialog-title", children: s }),
|
|
@@ -198,20 +198,20 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
198
198
|
onPrimaryClick: n,
|
|
199
199
|
onCancel: i,
|
|
200
200
|
isLoading: r = !1,
|
|
201
|
-
disabled:
|
|
201
|
+
disabled: a = !1,
|
|
202
202
|
primaryType: c = "submit",
|
|
203
|
-
containerClassName:
|
|
203
|
+
containerClassName: l = "",
|
|
204
204
|
primaryClassName: m = "",
|
|
205
|
-
alignEnd:
|
|
206
|
-
primaryName:
|
|
207
|
-
primaryAriaLabel:
|
|
205
|
+
alignEnd: y = !1,
|
|
206
|
+
primaryName: h,
|
|
207
|
+
primaryAriaLabel: d,
|
|
208
208
|
cancelName: p,
|
|
209
209
|
cancelAriaLabel: _
|
|
210
210
|
} = e;
|
|
211
211
|
return /* @__PURE__ */ T(
|
|
212
212
|
"div",
|
|
213
213
|
{
|
|
214
|
-
className: `dialog-actions ${
|
|
214
|
+
className: `dialog-actions ${y ? "end" : ""} ${l}`,
|
|
215
215
|
children: [
|
|
216
216
|
/* @__PURE__ */ T(
|
|
217
217
|
we,
|
|
@@ -220,10 +220,10 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
220
220
|
color: "primary",
|
|
221
221
|
variant: "submit",
|
|
222
222
|
className: m,
|
|
223
|
-
disabled:
|
|
223
|
+
disabled: a,
|
|
224
224
|
onClick: n,
|
|
225
|
-
name:
|
|
226
|
-
"aria-label":
|
|
225
|
+
name: h,
|
|
226
|
+
"aria-label": d,
|
|
227
227
|
children: [
|
|
228
228
|
r ? /* @__PURE__ */ g(xe, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
|
|
229
229
|
t
|
|
@@ -235,7 +235,7 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
235
235
|
{
|
|
236
236
|
type: "button",
|
|
237
237
|
variant: "outlined",
|
|
238
|
-
disabled:
|
|
238
|
+
disabled: a,
|
|
239
239
|
onClick: i,
|
|
240
240
|
name: p,
|
|
241
241
|
"aria-label": _,
|
|
@@ -251,11 +251,11 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
251
251
|
handleSubmit: n,
|
|
252
252
|
onSubmit: i,
|
|
253
253
|
handleClose: r,
|
|
254
|
-
isLoading:
|
|
254
|
+
isLoading: a = !1,
|
|
255
255
|
buttonEnd: c = !0,
|
|
256
|
-
...
|
|
256
|
+
...l
|
|
257
257
|
} = e;
|
|
258
|
-
return /* @__PURE__ */ g(at, { ...
|
|
258
|
+
return /* @__PURE__ */ g(at, { ...l, handleClose: r, children: /* @__PURE__ */ T("form", { onSubmit: n(i), children: [
|
|
259
259
|
/* @__PURE__ */ g("div", { className: "form-container", children: s }),
|
|
260
260
|
/* @__PURE__ */ g(
|
|
261
261
|
ot,
|
|
@@ -264,8 +264,8 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
264
264
|
primaryText: t("_accessibility:buttons.submit"),
|
|
265
265
|
cancelText: t("_accessibility:buttons.cancel"),
|
|
266
266
|
onCancel: r,
|
|
267
|
-
isLoading:
|
|
268
|
-
disabled:
|
|
267
|
+
isLoading: a,
|
|
268
|
+
disabled: a,
|
|
269
269
|
primaryClassName: "dialog-form-primary",
|
|
270
270
|
alignEnd: c,
|
|
271
271
|
primaryName: t("_accessibility:buttons.submit"),
|
|
@@ -281,9 +281,9 @@ const Ct = (e) => e == null ? !1 : `${e}`.length > 0, nn = Ut(function(e, t) {
|
|
|
281
281
|
handleSubmit: n,
|
|
282
282
|
handleClose: i,
|
|
283
283
|
isLoading: r = !1,
|
|
284
|
-
...
|
|
284
|
+
...a
|
|
285
285
|
} = e;
|
|
286
|
-
return /* @__PURE__ */ T(at, { ...
|
|
286
|
+
return /* @__PURE__ */ T(at, { ...a, handleClose: i, children: [
|
|
287
287
|
s,
|
|
288
288
|
/* @__PURE__ */ g(
|
|
289
289
|
ot,
|
|
@@ -361,49 +361,49 @@ const un = (e) => {
|
|
|
361
361
|
handleSubmit: n,
|
|
362
362
|
handleClose: i,
|
|
363
363
|
isLoading: r = !1,
|
|
364
|
-
fileProcessor:
|
|
364
|
+
fileProcessor: a,
|
|
365
365
|
onFileProcessed: c,
|
|
366
|
-
onOverrideChange:
|
|
366
|
+
onOverrideChange: l,
|
|
367
367
|
open: m,
|
|
368
|
-
...
|
|
369
|
-
} = e, [
|
|
368
|
+
...y
|
|
369
|
+
} = e, [h, d] = qt(sr, jt()), { file: p, previewItems: _, parseError: C, processing: k, overrideExisting: B, inputKey: N } = h, $ = Ie(c), x = Ie(a);
|
|
370
370
|
le(() => {
|
|
371
371
|
$.current = c;
|
|
372
372
|
}, [c]), le(() => {
|
|
373
|
-
x.current =
|
|
374
|
-
}, [
|
|
375
|
-
m ||
|
|
373
|
+
x.current = a;
|
|
374
|
+
}, [a]), le(() => {
|
|
375
|
+
m || d({ type: "RESET" });
|
|
376
376
|
}, [m]);
|
|
377
377
|
const A = D(async (I, M) => {
|
|
378
378
|
var se;
|
|
379
379
|
if (x.current) {
|
|
380
|
-
|
|
380
|
+
d({ type: "START_PROCESSING" });
|
|
381
381
|
try {
|
|
382
382
|
const P = await x.current(I, { override: M });
|
|
383
|
-
|
|
383
|
+
d({ type: "SET_PREVIEW", items: P ?? [] }), (se = $.current) == null || se.call($, P ?? []);
|
|
384
384
|
} catch (P) {
|
|
385
385
|
console.error(P);
|
|
386
386
|
const re = P instanceof Error ? P.message : "Failed to parse file";
|
|
387
|
-
|
|
387
|
+
d({ type: "SET_ERROR", message: re });
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
}, []);
|
|
391
|
-
return /* @__PURE__ */ T(at, { ...
|
|
391
|
+
return /* @__PURE__ */ T(at, { ...y, open: m, handleClose: i, children: [
|
|
392
392
|
/* @__PURE__ */ g(
|
|
393
393
|
xs,
|
|
394
394
|
{
|
|
395
395
|
onClear: () => {
|
|
396
396
|
var I;
|
|
397
|
-
|
|
397
|
+
d({ type: "SET_FILE", file: null }), (I = $.current) == null || I.call($, []);
|
|
398
398
|
},
|
|
399
399
|
onChange: (I) => {
|
|
400
400
|
var se, P;
|
|
401
401
|
const M = (se = I.target.files) == null ? void 0 : se[0];
|
|
402
402
|
if (!M) {
|
|
403
|
-
|
|
403
|
+
d({ type: "SET_FILE", file: null }), (P = $.current) == null || P.call($, []);
|
|
404
404
|
return;
|
|
405
405
|
}
|
|
406
|
-
|
|
406
|
+
d({ type: "SET_FILE", file: M }), A(M, B);
|
|
407
407
|
},
|
|
408
408
|
label: t("_accessibility:labels.file")
|
|
409
409
|
},
|
|
@@ -417,7 +417,7 @@ const un = (e) => {
|
|
|
417
417
|
checked: B,
|
|
418
418
|
onChange: (I) => {
|
|
419
419
|
const M = I.target.checked;
|
|
420
|
-
|
|
420
|
+
d({ type: "SET_OVERRIDE", value: M }), l == null || l(M), p && A(p, M);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
),
|
|
@@ -435,7 +435,7 @@ const un = (e) => {
|
|
|
435
435
|
primaryText: t("_accessibility:buttons.ok"),
|
|
436
436
|
cancelText: t("_accessibility:buttons.cancel"),
|
|
437
437
|
onPrimaryClick: () => {
|
|
438
|
-
(!
|
|
438
|
+
(!a || !!_ && _.length > 0) && n();
|
|
439
439
|
},
|
|
440
440
|
onCancel: i,
|
|
441
441
|
isLoading: r,
|
|
@@ -460,21 +460,21 @@ async function Te(e, t = "GET", s, n) {
|
|
|
460
460
|
method: t,
|
|
461
461
|
headers: i,
|
|
462
462
|
...s ? { body: JSON.stringify(s) } : {}
|
|
463
|
-
}),
|
|
463
|
+
}), a = await r.text();
|
|
464
464
|
let c = null;
|
|
465
465
|
try {
|
|
466
|
-
c =
|
|
466
|
+
c = a ? JSON.parse(a) : null;
|
|
467
467
|
} catch {
|
|
468
468
|
c = null;
|
|
469
469
|
}
|
|
470
470
|
if (!r.ok) {
|
|
471
|
-
const
|
|
471
|
+
const l = typeof c == "object" && c !== null ? c.message ?? c.error ?? a : a || r.statusText;
|
|
472
472
|
return {
|
|
473
473
|
data: null,
|
|
474
474
|
status: r.status,
|
|
475
475
|
error: {
|
|
476
476
|
status: r.status,
|
|
477
|
-
message:
|
|
477
|
+
message: l || "Unknown error occurred"
|
|
478
478
|
}
|
|
479
479
|
};
|
|
480
480
|
}
|
|
@@ -506,25 +506,25 @@ function rr(e, t) {
|
|
|
506
506
|
const Wt = (e, t, s) => {
|
|
507
507
|
const n = [];
|
|
508
508
|
if (t) {
|
|
509
|
-
const { sortingBy: i, sortingOrder: r, currentPage:
|
|
509
|
+
const { sortingBy: i, sortingOrder: r, currentPage: a, pageSize: c } = t;
|
|
510
510
|
n.push(
|
|
511
511
|
`sort=${String(i)}`,
|
|
512
512
|
`order=${r}`,
|
|
513
|
-
`page=${
|
|
513
|
+
`page=${a}`,
|
|
514
514
|
`pageSize=${c}`
|
|
515
515
|
);
|
|
516
516
|
}
|
|
517
517
|
if (s) {
|
|
518
518
|
const i = Object.entries(s).filter(
|
|
519
519
|
([, r]) => r != null && r !== ""
|
|
520
|
-
).flatMap(([r,
|
|
521
|
-
if (Array.isArray(
|
|
522
|
-
return
|
|
523
|
-
if (typeof
|
|
520
|
+
).flatMap(([r, a]) => {
|
|
521
|
+
if (Array.isArray(a))
|
|
522
|
+
return a.map((c) => `${r}==${encodeURIComponent((c == null ? void 0 : c.id) ?? c)}`);
|
|
523
|
+
if (typeof a == "object" && a !== null && "start" in a && "end" in a) {
|
|
524
524
|
const c = [];
|
|
525
|
-
return
|
|
525
|
+
return a.start != null && a.start !== "" && c.push(`${r}>=${encodeURIComponent(a.start)}`), a.end != null && a.end !== "" && c.push(`${r}<=${encodeURIComponent(a.end)}`), c;
|
|
526
526
|
}
|
|
527
|
-
return typeof
|
|
527
|
+
return typeof a == "object" && a !== null ? `${r}==${encodeURIComponent(a.id ?? "")}` : `${r}==${encodeURIComponent(a)}`;
|
|
528
528
|
});
|
|
529
529
|
i.length > 0 && n.push(`filters=${i.join(",")}`);
|
|
530
530
|
}
|
|
@@ -551,7 +551,7 @@ class Gt {
|
|
|
551
551
|
return { Authorization: `Bearer ${s}` };
|
|
552
552
|
}
|
|
553
553
|
async doQuery(t, s = te.GET, n, i) {
|
|
554
|
-
const r = this.secured ? this.tokenAcquirer() : {}, { data:
|
|
554
|
+
const r = this.secured ? this.tokenAcquirer() : {}, { data: a, status: c, error: l } = await Te(
|
|
555
555
|
`${this.baseUrl}${t}`,
|
|
556
556
|
s,
|
|
557
557
|
n,
|
|
@@ -560,12 +560,12 @@ class Gt {
|
|
|
560
560
|
...i ?? {}
|
|
561
561
|
}
|
|
562
562
|
);
|
|
563
|
-
if (
|
|
564
|
-
throw
|
|
563
|
+
if (l || c < 200 || c >= 300)
|
|
564
|
+
throw l ?? {
|
|
565
565
|
status: c,
|
|
566
566
|
message: String(c)
|
|
567
567
|
};
|
|
568
|
-
return
|
|
568
|
+
return a;
|
|
569
569
|
}
|
|
570
570
|
/**
|
|
571
571
|
* @description Get all objects
|
|
@@ -574,14 +574,14 @@ class Gt {
|
|
|
574
574
|
* @returns Result list
|
|
575
575
|
*/
|
|
576
576
|
async get(t, s, n) {
|
|
577
|
-
const i = Wt(t, s, n), r = this.secured ? this.tokenAcquirer() : void 0, { data:
|
|
577
|
+
const i = Wt(t, s, n), r = this.secured ? this.tokenAcquirer() : void 0, { data: a, error: c } = await Te(
|
|
578
578
|
`${this.baseUrl}${i}`,
|
|
579
579
|
te.GET,
|
|
580
580
|
null,
|
|
581
581
|
r
|
|
582
582
|
);
|
|
583
583
|
if (c) throw c;
|
|
584
|
-
return
|
|
584
|
+
return a;
|
|
585
585
|
}
|
|
586
586
|
/**
|
|
587
587
|
* @description Get entity by id
|
|
@@ -590,7 +590,7 @@ class Gt {
|
|
|
590
590
|
* @returns updated entity
|
|
591
591
|
*/
|
|
592
592
|
async patch(t, s) {
|
|
593
|
-
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status:
|
|
593
|
+
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
|
|
594
594
|
`${this.baseUrl}${t}`,
|
|
595
595
|
te.PATCH,
|
|
596
596
|
s,
|
|
@@ -598,7 +598,7 @@ class Gt {
|
|
|
598
598
|
);
|
|
599
599
|
if (i || !r)
|
|
600
600
|
throw i ?? {
|
|
601
|
-
status:
|
|
601
|
+
status: a,
|
|
602
602
|
message: "Unknown error"
|
|
603
603
|
};
|
|
604
604
|
return r;
|
|
@@ -609,7 +609,7 @@ class Gt {
|
|
|
609
609
|
* @returns delete result
|
|
610
610
|
*/
|
|
611
611
|
async delete(t, s) {
|
|
612
|
-
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status:
|
|
612
|
+
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
|
|
613
613
|
`${this.baseUrl}${t}`,
|
|
614
614
|
te.DELETE,
|
|
615
615
|
s,
|
|
@@ -617,7 +617,7 @@ class Gt {
|
|
|
617
617
|
);
|
|
618
618
|
if (i || !r)
|
|
619
619
|
throw i ?? {
|
|
620
|
-
status:
|
|
620
|
+
status: a,
|
|
621
621
|
message: "Unknown error"
|
|
622
622
|
};
|
|
623
623
|
return r;
|
|
@@ -629,7 +629,7 @@ class Gt {
|
|
|
629
629
|
* @returns inserted item
|
|
630
630
|
*/
|
|
631
631
|
async post(t, s) {
|
|
632
|
-
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status:
|
|
632
|
+
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
|
|
633
633
|
`${this.baseUrl}${t}`,
|
|
634
634
|
te.POST,
|
|
635
635
|
s,
|
|
@@ -637,7 +637,7 @@ class Gt {
|
|
|
637
637
|
);
|
|
638
638
|
if (i || !r)
|
|
639
639
|
throw i ?? {
|
|
640
|
-
status:
|
|
640
|
+
status: a,
|
|
641
641
|
message: "Unknown error"
|
|
642
642
|
};
|
|
643
643
|
return r;
|
|
@@ -834,12 +834,12 @@ function Nt(e) {
|
|
|
834
834
|
);
|
|
835
835
|
}
|
|
836
836
|
function ir(e) {
|
|
837
|
-
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getFullYear()).slice(-2), r = String(t.getHours()).padStart(2, "0"),
|
|
838
|
-
return `${s}/${n}/${i} ${r}:${
|
|
837
|
+
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getFullYear()).slice(-2), r = String(t.getHours()).padStart(2, "0"), a = String(t.getMinutes()).padStart(2, "0");
|
|
838
|
+
return `${s}/${n}/${i} ${r}:${a}`;
|
|
839
839
|
}
|
|
840
840
|
function hn(e) {
|
|
841
|
-
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), r = String(t.getHours()).padStart(2, "0"),
|
|
842
|
-
return `${s}-${n}-${i}T${r}:${
|
|
841
|
+
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), r = String(t.getHours()).padStart(2, "0"), a = String(t.getMinutes()).padStart(2, "0");
|
|
842
|
+
return `${s}-${n}-${i}T${r}:${a}`;
|
|
843
843
|
}
|
|
844
844
|
const ar = () => {
|
|
845
845
|
var s;
|
|
@@ -864,35 +864,35 @@ function yn(e, t) {
|
|
|
864
864
|
const zt = Pe({});
|
|
865
865
|
function gn(e) {
|
|
866
866
|
const { children: t } = e, s = Ie(0), [n, i] = qt(
|
|
867
|
-
(
|
|
868
|
-
const { type: p, items: _, id: C } =
|
|
867
|
+
(h, d) => {
|
|
868
|
+
const { type: p, items: _, id: C } = d;
|
|
869
869
|
switch (p) {
|
|
870
870
|
case "set":
|
|
871
871
|
return _ ?? [];
|
|
872
872
|
case "remove":
|
|
873
|
-
return C !== void 0 ?
|
|
873
|
+
return C !== void 0 ? h.filter((k) => k.id !== C) : [];
|
|
874
874
|
}
|
|
875
|
-
return
|
|
875
|
+
return h;
|
|
876
876
|
},
|
|
877
877
|
[],
|
|
878
878
|
() => []
|
|
879
|
-
), r = (
|
|
879
|
+
), r = (h) => h.map((d) => ({ ...d, id: s.current++ })), a = (h) => i({
|
|
880
880
|
type: "set",
|
|
881
|
-
items: r([{ ...
|
|
882
|
-
}), c = (
|
|
881
|
+
items: r([{ ...h, type: J.error }])
|
|
882
|
+
}), c = (h) => i({ type: "set", items: r([{ ...h }]) }), l = (h) => i({ type: "set", items: r(h) }), m = (h) => i({
|
|
883
883
|
type: "set",
|
|
884
|
-
items: r([{ ...
|
|
885
|
-
}),
|
|
884
|
+
items: r([{ ...h, type: J.success }])
|
|
885
|
+
}), y = (h) => i({ type: "remove", id: h });
|
|
886
886
|
return /* @__PURE__ */ g(
|
|
887
887
|
zt.Provider,
|
|
888
888
|
{
|
|
889
889
|
value: {
|
|
890
890
|
notification: n,
|
|
891
|
-
removeNotification:
|
|
892
|
-
showErrorNotification:
|
|
891
|
+
removeNotification: y,
|
|
892
|
+
showErrorNotification: a,
|
|
893
893
|
showNotification: c,
|
|
894
894
|
showSuccessNotification: m,
|
|
895
|
-
showStackNotifications:
|
|
895
|
+
showStackNotifications: l
|
|
896
896
|
},
|
|
897
897
|
children: t
|
|
898
898
|
}
|
|
@@ -928,33 +928,33 @@ const ke = () => {
|
|
|
928
928
|
}, Xt = Pe(
|
|
929
929
|
void 0
|
|
930
930
|
), bn = (e) => {
|
|
931
|
-
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = or(), [r,
|
|
931
|
+
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = or(), [r, a] = X({}), c = D(() => !!Jt(s, "boolean") && r.token === void 0, [r.token, s]), l = D((p) => {
|
|
932
932
|
Et(s, p);
|
|
933
933
|
}, [s]), m = D((p) => {
|
|
934
|
-
p && (
|
|
935
|
-
}, [s, n]),
|
|
934
|
+
p && (a(p), kt(s), Et(n, p.token));
|
|
935
|
+
}, [s, n]), y = D(async () => {
|
|
936
936
|
try {
|
|
937
937
|
await i.Auth.logout();
|
|
938
938
|
} catch (p) {
|
|
939
939
|
console.error(p);
|
|
940
940
|
}
|
|
941
|
-
|
|
942
|
-
}, [i.Auth, n]),
|
|
941
|
+
a({}), kt(n);
|
|
942
|
+
}, [i.Auth, n]), h = D(async () => {
|
|
943
943
|
try {
|
|
944
944
|
const p = await i.Auth.getSession();
|
|
945
945
|
m(p);
|
|
946
946
|
} catch (p) {
|
|
947
|
-
console.error(p),
|
|
947
|
+
console.error(p), y();
|
|
948
948
|
}
|
|
949
|
-
}, [m,
|
|
949
|
+
}, [m, y, i.Auth]), d = {
|
|
950
950
|
account: r,
|
|
951
951
|
logUser: m,
|
|
952
|
-
logoutUser:
|
|
953
|
-
logUserFromLocal:
|
|
952
|
+
logoutUser: y,
|
|
953
|
+
logUserFromLocal: h,
|
|
954
954
|
isInGuestMode: c,
|
|
955
|
-
setGuestMode:
|
|
955
|
+
setGuestMode: l
|
|
956
956
|
};
|
|
957
|
-
return /* @__PURE__ */ g(Xt.Provider, { value:
|
|
957
|
+
return /* @__PURE__ */ g(Xt.Provider, { value: d, children: t });
|
|
958
958
|
}, Zt = () => {
|
|
959
959
|
const e = Oe(Xt);
|
|
960
960
|
if (!e)
|
|
@@ -978,48 +978,48 @@ const ke = () => {
|
|
|
978
978
|
return e;
|
|
979
979
|
}, ts = Pe({}), wn = (e) => {
|
|
980
980
|
const { children: t } = e, [s, n] = X({}), i = D(
|
|
981
|
-
(
|
|
982
|
-
...
|
|
983
|
-
[
|
|
981
|
+
(l, m) => n((y) => ({
|
|
982
|
+
...y,
|
|
983
|
+
[l]: [...y[l] ?? [], m]
|
|
984
984
|
})),
|
|
985
985
|
[]
|
|
986
986
|
), r = D(
|
|
987
|
-
(
|
|
988
|
-
...
|
|
989
|
-
[
|
|
987
|
+
(l, m) => n((y) => ({
|
|
988
|
+
...y,
|
|
989
|
+
[l]: (y[l] ?? []).filter((h, d) => d !== m)
|
|
990
990
|
})),
|
|
991
991
|
[]
|
|
992
|
-
),
|
|
993
|
-
n(
|
|
992
|
+
), a = D((l) => {
|
|
993
|
+
n(l ? (m) => ({
|
|
994
994
|
...m,
|
|
995
|
-
[
|
|
995
|
+
[l]: []
|
|
996
996
|
}) : {});
|
|
997
997
|
}, []), c = Ae(
|
|
998
998
|
() => ({
|
|
999
999
|
dynamicItems: s,
|
|
1000
1000
|
addChildItem: i,
|
|
1001
1001
|
removeChildItem: r,
|
|
1002
|
-
clearDynamicItems:
|
|
1002
|
+
clearDynamicItems: a
|
|
1003
1003
|
}),
|
|
1004
|
-
[s,
|
|
1004
|
+
[s, a, r, i]
|
|
1005
1005
|
);
|
|
1006
1006
|
return /* @__PURE__ */ g(ts.Provider, { value: c, children: t });
|
|
1007
1007
|
}, cr = () => Oe(
|
|
1008
1008
|
ts
|
|
1009
1009
|
);
|
|
1010
1010
|
function _n(e) {
|
|
1011
|
-
const { t } = V(), { open: s, onClose: n, menuMap: i, logo: r } = e, { account:
|
|
1012
|
-
const B = k.auth, N = !!(
|
|
1011
|
+
const { t } = V(), { open: s, onClose: n, menuMap: i, logo: r } = e, { account: a } = Zt(), { dynamicItems: c } = cr(), { linkComponent: l, location: m } = Re(), y = l, h = Ae(() => i.filter((k) => {
|
|
1012
|
+
const B = k.auth, N = !!(a != null && a.email);
|
|
1013
1013
|
return B == null || B && N || !B && !N;
|
|
1014
|
-
}), [
|
|
1014
|
+
}), [a == null ? void 0 : a.email, i]), d = D(
|
|
1015
1015
|
(k) => {
|
|
1016
1016
|
k.key === "Escape" && s && n();
|
|
1017
1017
|
},
|
|
1018
1018
|
[n, s]
|
|
1019
1019
|
);
|
|
1020
|
-
le(() => (document.addEventListener("keydown",
|
|
1021
|
-
document.removeEventListener("keydown",
|
|
1022
|
-
}), [
|
|
1020
|
+
le(() => (document.addEventListener("keydown", d), () => {
|
|
1021
|
+
document.removeEventListener("keydown", d);
|
|
1022
|
+
}), [d]);
|
|
1023
1023
|
const p = D(
|
|
1024
1024
|
(k, B) => B ? k === `${m.pathname}${m.search}` : k === m.pathname,
|
|
1025
1025
|
[m.pathname, m.search]
|
|
@@ -1029,7 +1029,7 @@ function _n(e) {
|
|
|
1029
1029
|
{
|
|
1030
1030
|
className: `drawer-list-item-child ${p(k.path, !0) ? "active" : ""} animated`,
|
|
1031
1031
|
children: k.path ? /* @__PURE__ */ g(
|
|
1032
|
-
|
|
1032
|
+
y,
|
|
1033
1033
|
{
|
|
1034
1034
|
tabIndex: s ? 0 : -1,
|
|
1035
1035
|
to: k.path ?? "/",
|
|
@@ -1043,15 +1043,15 @@ function _n(e) {
|
|
|
1043
1043
|
},
|
|
1044
1044
|
k.id
|
|
1045
1045
|
),
|
|
1046
|
-
[
|
|
1047
|
-
), C = Ae(() =>
|
|
1046
|
+
[y, s, t, p]
|
|
1047
|
+
), C = Ae(() => h.map((k, B) => {
|
|
1048
1048
|
const N = k.page ?? String(B), $ = `drawer-list-item ${p(k.path) ? "active" : ""} animated`;
|
|
1049
1049
|
if (k.type === "divider")
|
|
1050
1050
|
return /* @__PURE__ */ g("li", { className: $, children: /* @__PURE__ */ g("hr", { className: "drawer-divider" }) }, N);
|
|
1051
1051
|
const x = k.children ?? (k.page && c ? c[k.page] : null);
|
|
1052
1052
|
return /* @__PURE__ */ T("li", { className: $, children: [
|
|
1053
1053
|
/* @__PURE__ */ T(
|
|
1054
|
-
|
|
1054
|
+
y,
|
|
1055
1055
|
{
|
|
1056
1056
|
tabIndex: s ? 0 : -1,
|
|
1057
1057
|
to: k.path ?? "/",
|
|
@@ -1067,7 +1067,7 @@ function _n(e) {
|
|
|
1067
1067
|
),
|
|
1068
1068
|
x && /* @__PURE__ */ g("ul", { className: "drawer-children-list", children: x.map(_) })
|
|
1069
1069
|
] }, N);
|
|
1070
|
-
}), [
|
|
1070
|
+
}), [y, c, p, s, h, _, t]);
|
|
1071
1071
|
return /* @__PURE__ */ g(
|
|
1072
1072
|
"div",
|
|
1073
1073
|
{
|
|
@@ -1097,8 +1097,8 @@ function Cn() {
|
|
|
1097
1097
|
const { t: e, language: t } = V();
|
|
1098
1098
|
return { timeAge: D(
|
|
1099
1099
|
(n) => {
|
|
1100
|
-
const r = /* @__PURE__ */ new Date() - n,
|
|
1101
|
-
return r < 1e3 * 60 ? C :
|
|
1100
|
+
const r = /* @__PURE__ */ new Date() - n, a = Math.floor(r / (1e3 * 60)), c = Math.floor(a / 60), l = t === "es", m = e("_accessibility:labels.ago"), y = e("_accessibility:labels.minute"), h = e("_accessibility:labels.minutes"), d = e("_accessibility:labels.hour"), p = e("_accessibility:labels.hours"), _ = e("_accessibility:labels.yesterday"), C = e("_accessibility:labels.justNow");
|
|
1101
|
+
return r < 1e3 * 60 ? C : a < 60 ? `${l ? m : ""} ${a} ${a === 1 ? y : h} ${l ? "" : m}` : c < 24 ? `${l ? m : ""} ${c} ${c === 1 ? d : p} ${l ? "" : m}` : c < 48 ? _ : n.toLocaleDateString(navigator.language || "es-ES", {
|
|
1102
1102
|
day: "2-digit",
|
|
1103
1103
|
month: "2-digit",
|
|
1104
1104
|
year: "numeric"
|
|
@@ -1108,24 +1108,24 @@ function Cn() {
|
|
|
1108
1108
|
) };
|
|
1109
1109
|
}
|
|
1110
1110
|
const ss = (e) => {
|
|
1111
|
-
const { showSuccessNotification: t } = ke(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [
|
|
1111
|
+
const { showSuccessNotification: t } = ke(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [a, c] = X([]), { open: l, handleClose: m, handleOpen: y } = ds(), h = () => {
|
|
1112
1112
|
m(), c([]);
|
|
1113
|
-
},
|
|
1114
|
-
c(_),
|
|
1113
|
+
}, d = async (_) => {
|
|
1114
|
+
c(_), y();
|
|
1115
1115
|
}, p = Me({
|
|
1116
1116
|
mutationFn: () => s(
|
|
1117
|
-
Array.isArray(
|
|
1117
|
+
Array.isArray(a) ? a : [a]
|
|
1118
1118
|
),
|
|
1119
1119
|
onError: (_) => {
|
|
1120
|
-
console.error(_), n && n(_),
|
|
1120
|
+
console.error(_), n && n(_), h();
|
|
1121
1121
|
},
|
|
1122
1122
|
onSuccess: async (_) => {
|
|
1123
1123
|
i && i(_), t({
|
|
1124
1124
|
message: r
|
|
1125
|
-
}),
|
|
1125
|
+
}), h();
|
|
1126
1126
|
}
|
|
1127
1127
|
});
|
|
1128
|
-
return { open:
|
|
1128
|
+
return { open: l, onClick: d, close: h, dialogFn: p, isLoading: p.isPending };
|
|
1129
1129
|
};
|
|
1130
1130
|
var Ue = (e) => e.type === "checkbox", Ee = (e) => e instanceof Date, Z = (e) => e == null;
|
|
1131
1131
|
const rs = (e) => typeof e == "object";
|
|
@@ -1155,17 +1155,17 @@ var ze = (e) => /^\w*$/.test(e), j = (e) => e === void 0, lt = (e) => Array.isAr
|
|
|
1155
1155
|
return j(n) || n === e ? j(e[t]) ? s : e[t] : n;
|
|
1156
1156
|
}, he = (e) => typeof e == "boolean", q = (e, t, s) => {
|
|
1157
1157
|
let n = -1;
|
|
1158
|
-
const i = ze(t) ? [t] : ut(t), r = i.length,
|
|
1158
|
+
const i = ze(t) ? [t] : ut(t), r = i.length, a = r - 1;
|
|
1159
1159
|
for (; ++n < r; ) {
|
|
1160
1160
|
const c = i[n];
|
|
1161
|
-
let
|
|
1162
|
-
if (n !==
|
|
1161
|
+
let l = s;
|
|
1162
|
+
if (n !== a) {
|
|
1163
1163
|
const m = e[c];
|
|
1164
|
-
|
|
1164
|
+
l = Q(m) || Array.isArray(m) ? m : isNaN(+i[n + 1]) ? {} : [];
|
|
1165
1165
|
}
|
|
1166
1166
|
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
1167
1167
|
return;
|
|
1168
|
-
e[c] =
|
|
1168
|
+
e[c] = l, e = e[c];
|
|
1169
1169
|
}
|
|
1170
1170
|
};
|
|
1171
1171
|
const At = {
|
|
@@ -1194,8 +1194,8 @@ var hr = (e, t, s, n = !0) => {
|
|
|
1194
1194
|
for (const r in e)
|
|
1195
1195
|
Object.defineProperty(i, r, {
|
|
1196
1196
|
get: () => {
|
|
1197
|
-
const
|
|
1198
|
-
return t._proxyFormState[
|
|
1197
|
+
const a = r;
|
|
1198
|
+
return t._proxyFormState[a] !== de.all && (t._proxyFormState[a] = !n || de.all), e[a];
|
|
1199
1199
|
}
|
|
1200
1200
|
});
|
|
1201
1201
|
return i;
|
|
@@ -1214,12 +1214,12 @@ function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
|
|
|
1214
1214
|
return !0;
|
|
1215
1215
|
s.add(e), s.add(t);
|
|
1216
1216
|
for (const r of n) {
|
|
1217
|
-
const
|
|
1217
|
+
const a = e[r];
|
|
1218
1218
|
if (!i.includes(r))
|
|
1219
1219
|
return !1;
|
|
1220
1220
|
if (r !== "ref") {
|
|
1221
1221
|
const c = t[r];
|
|
1222
|
-
if (Ee(
|
|
1222
|
+
if (Ee(a) && Ee(c) || Q(a) && Q(c) || Array.isArray(a) && Array.isArray(c) ? !ve(a, c, s) : a !== c)
|
|
1223
1223
|
return !1;
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
@@ -1326,8 +1326,8 @@ function Lt(e) {
|
|
|
1326
1326
|
var _r = (e, t, s, n) => {
|
|
1327
1327
|
const i = {};
|
|
1328
1328
|
for (const r of e) {
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1329
|
+
const a = S(t, r);
|
|
1330
|
+
a && q(i, r, a._f);
|
|
1331
1331
|
}
|
|
1332
1332
|
return {
|
|
1333
1333
|
criteriaMode: s,
|
|
@@ -1348,11 +1348,11 @@ const De = (e, t, s, n) => {
|
|
|
1348
1348
|
for (const i of s || Object.keys(e)) {
|
|
1349
1349
|
const r = S(e, i);
|
|
1350
1350
|
if (r) {
|
|
1351
|
-
const { _f:
|
|
1352
|
-
if (
|
|
1353
|
-
if (
|
|
1351
|
+
const { _f: a, ...c } = r;
|
|
1352
|
+
if (a) {
|
|
1353
|
+
if (a.refs && a.refs[0] && t(a.refs[0], i) && !n)
|
|
1354
1354
|
return !0;
|
|
1355
|
-
if (
|
|
1355
|
+
if (a.ref && t(a.ref, a.name) && !n)
|
|
1356
1356
|
return !0;
|
|
1357
1357
|
if (De(c, t))
|
|
1358
1358
|
break;
|
|
@@ -1370,8 +1370,8 @@ function Pt(e, t, s) {
|
|
|
1370
1370
|
};
|
|
1371
1371
|
const i = s.split(".");
|
|
1372
1372
|
for (; i.length; ) {
|
|
1373
|
-
const r = i.join("."),
|
|
1374
|
-
if (
|
|
1373
|
+
const r = i.join("."), a = S(t, r), c = S(e, r);
|
|
1374
|
+
if (a && !Array.isArray(a) && s !== r)
|
|
1375
1375
|
return { name: s };
|
|
1376
1376
|
if (c && c.type)
|
|
1377
1377
|
return {
|
|
@@ -1392,7 +1392,7 @@ function Pt(e, t, s) {
|
|
|
1392
1392
|
var Er = (e, t, s, n) => {
|
|
1393
1393
|
s(e);
|
|
1394
1394
|
const { name: i, ...r } = e;
|
|
1395
|
-
return ee(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((
|
|
1395
|
+
return ee(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((a) => t[a] === (!n || de.all));
|
|
1396
1396
|
}, kr = (e, t, s) => !e || !t || e === t || Le(e).some((n) => n && (s ? n === t : n.startsWith(t) || t.startsWith(n))), Nr = (e, t, s, n, i) => i.isOnAll ? !1 : !s && i.isOnTouch ? !(t || e) : (s ? n.isOnBlur : i.isOnBlur) ? !e : (s ? n.isOnChange : i.isOnChange) ? e : !0, Ar = (e, t) => !lt(S(e, t)).length && K(e, t), xr = (e, t, s) => {
|
|
1397
1397
|
const n = Le(S(e, s));
|
|
1398
1398
|
return q(n, "root", t[s]), q(e, s, n), e;
|
|
@@ -1409,22 +1409,22 @@ var Ne = (e) => Q(e) && !We(e) ? e : {
|
|
|
1409
1409
|
value: e,
|
|
1410
1410
|
message: ""
|
|
1411
1411
|
}, Mt = async (e, t, s, n, i, r) => {
|
|
1412
|
-
const { ref:
|
|
1412
|
+
const { ref: a, refs: c, required: l, maxLength: m, minLength: y, min: h, max: d, pattern: p, validate: _, name: C, valueAsNumber: k, mount: B } = e._f, N = S(s, C);
|
|
1413
1413
|
if (!B || t.has(C))
|
|
1414
1414
|
return {};
|
|
1415
|
-
const $ = c ? c[0] :
|
|
1415
|
+
const $ = c ? c[0] : a, x = (F) => {
|
|
1416
1416
|
i && $.reportValidity && ($.setCustomValidity(he(F) ? "" : F || ""), $.reportValidity());
|
|
1417
|
-
}, A = {}, I = ft(
|
|
1417
|
+
}, A = {}, I = ft(a), M = Ue(a), se = I || M, P = (k || dt(a)) && j(a.value) && j(N) || Ke(a) && a.value === "" || N === "" || Array.isArray(N) && !N.length, re = pr.bind(null, C, n, A), ae = (F, L, H, W = ge.maxLength, z = ge.minLength) => {
|
|
1418
1418
|
const R = F ? L : H;
|
|
1419
1419
|
A[C] = {
|
|
1420
1420
|
type: F ? W : z,
|
|
1421
1421
|
message: R,
|
|
1422
|
-
ref:
|
|
1422
|
+
ref: a,
|
|
1423
1423
|
...re(F ? W : z, R)
|
|
1424
1424
|
};
|
|
1425
1425
|
};
|
|
1426
|
-
if (r ? !Array.isArray(N) || !N.length :
|
|
1427
|
-
const { value: F, message: L } = Qe(
|
|
1426
|
+
if (r ? !Array.isArray(N) || !N.length : l && (!se && (P || Z(N)) || he(N) && !N || M && !os(c).isValid || I && !ls(c).isValid)) {
|
|
1427
|
+
const { value: F, message: L } = Qe(l) ? { value: !!l, message: l } : Ne(l);
|
|
1428
1428
|
if (F && (A[C] = {
|
|
1429
1429
|
type: ge.required,
|
|
1430
1430
|
message: L,
|
|
@@ -1433,21 +1433,21 @@ var Ne = (e) => Q(e) && !We(e) ? e : {
|
|
|
1433
1433
|
}, !n))
|
|
1434
1434
|
return x(L), A;
|
|
1435
1435
|
}
|
|
1436
|
-
if (!P && (!Z(
|
|
1436
|
+
if (!P && (!Z(h) || !Z(d))) {
|
|
1437
1437
|
let F, L;
|
|
1438
|
-
const H = Ne(
|
|
1438
|
+
const H = Ne(d), W = Ne(h);
|
|
1439
1439
|
if (!Z(N) && !isNaN(N)) {
|
|
1440
|
-
const z =
|
|
1440
|
+
const z = a.valueAsNumber || N && +N;
|
|
1441
1441
|
Z(H.value) || (F = z > H.value), Z(W.value) || (L = z < W.value);
|
|
1442
1442
|
} else {
|
|
1443
|
-
const z =
|
|
1443
|
+
const z = a.valueAsDate || new Date(N), R = (ue) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ue), Y = a.type == "time", ne = a.type == "week";
|
|
1444
1444
|
ye(H.value) && N && (F = Y ? R(N) > R(H.value) : ne ? N > H.value : z > new Date(H.value)), ye(W.value) && N && (L = Y ? R(N) < R(W.value) : ne ? N < W.value : z < new Date(W.value));
|
|
1445
1445
|
}
|
|
1446
1446
|
if ((F || L) && (ae(!!F, H.message, W.message, ge.max, ge.min), !n))
|
|
1447
1447
|
return x(A[C].message), A;
|
|
1448
1448
|
}
|
|
1449
|
-
if ((m ||
|
|
1450
|
-
const F = Ne(m), L = Ne(
|
|
1449
|
+
if ((m || y) && !P && (ye(N) || r && Array.isArray(N))) {
|
|
1450
|
+
const F = Ne(m), L = Ne(y), H = !Z(F.value) && N.length > +F.value, W = !Z(L.value) && N.length < +L.value;
|
|
1451
1451
|
if ((H || W) && (ae(H, F.message, L.message), !n))
|
|
1452
1452
|
return x(A[C].message), A;
|
|
1453
1453
|
}
|
|
@@ -1456,7 +1456,7 @@ var Ne = (e) => Q(e) && !We(e) ? e : {
|
|
|
1456
1456
|
if (We(F) && !N.match(F) && (A[C] = {
|
|
1457
1457
|
type: ge.pattern,
|
|
1458
1458
|
message: L,
|
|
1459
|
-
ref:
|
|
1459
|
+
ref: a,
|
|
1460
1460
|
...re(ge.pattern, L)
|
|
1461
1461
|
}, !n))
|
|
1462
1462
|
return x(L), A;
|
|
@@ -1513,7 +1513,7 @@ function Fr(e = {}) {
|
|
|
1513
1513
|
validatingFields: {},
|
|
1514
1514
|
errors: t.errors || {},
|
|
1515
1515
|
disabled: t.disabled || !1
|
|
1516
|
-
}, n = {}, i = Q(t.defaultValues) || Q(t.values) ? G(t.defaultValues || t.values) || {} : {}, r = t.shouldUnregister ? {} : G(i),
|
|
1516
|
+
}, n = {}, i = Q(t.defaultValues) || Q(t.values) ? G(t.defaultValues || t.values) || {} : {}, r = t.shouldUnregister ? {} : G(i), a = {
|
|
1517
1517
|
action: !1,
|
|
1518
1518
|
mount: !1,
|
|
1519
1519
|
watch: !1
|
|
@@ -1523,8 +1523,8 @@ function Fr(e = {}) {
|
|
|
1523
1523
|
unMount: /* @__PURE__ */ new Set(),
|
|
1524
1524
|
array: /* @__PURE__ */ new Set(),
|
|
1525
1525
|
watch: /* @__PURE__ */ new Set()
|
|
1526
|
-
},
|
|
1527
|
-
const
|
|
1526
|
+
}, l, m = 0;
|
|
1527
|
+
const y = {
|
|
1528
1528
|
isDirty: !1,
|
|
1529
1529
|
dirtyFields: !1,
|
|
1530
1530
|
validatingFields: !1,
|
|
@@ -1533,334 +1533,334 @@ function Fr(e = {}) {
|
|
|
1533
1533
|
isValid: !1,
|
|
1534
1534
|
errors: !1
|
|
1535
1535
|
};
|
|
1536
|
-
let
|
|
1537
|
-
...
|
|
1536
|
+
let h = {
|
|
1537
|
+
...y
|
|
1538
1538
|
};
|
|
1539
|
-
const
|
|
1539
|
+
const d = {
|
|
1540
1540
|
array: xt(),
|
|
1541
1541
|
state: xt()
|
|
1542
|
-
}, p = t.criteriaMode === de.all, _ = (
|
|
1543
|
-
clearTimeout(m), m = setTimeout(
|
|
1544
|
-
}, C = async (
|
|
1545
|
-
if (!t.disabled && (
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1548
|
-
isValid:
|
|
1542
|
+
}, p = t.criteriaMode === de.all, _ = (o) => (u) => {
|
|
1543
|
+
clearTimeout(m), m = setTimeout(o, u);
|
|
1544
|
+
}, C = async (o) => {
|
|
1545
|
+
if (!t.disabled && (y.isValid || h.isValid || o)) {
|
|
1546
|
+
const u = t.resolver ? ee((await M()).errors) : await P(n, !0);
|
|
1547
|
+
u !== s.isValid && d.state.next({
|
|
1548
|
+
isValid: u
|
|
1549
1549
|
});
|
|
1550
1550
|
}
|
|
1551
|
-
}, k = (
|
|
1552
|
-
!t.disabled && (
|
|
1553
|
-
|
|
1554
|
-
}),
|
|
1551
|
+
}, k = (o, u) => {
|
|
1552
|
+
!t.disabled && (y.isValidating || y.validatingFields || h.isValidating || h.validatingFields) && ((o || Array.from(c.mount)).forEach((f) => {
|
|
1553
|
+
f && (u ? q(s.validatingFields, f, u) : K(s.validatingFields, f));
|
|
1554
|
+
}), d.state.next({
|
|
1555
1555
|
validatingFields: s.validatingFields,
|
|
1556
1556
|
isValidating: !ee(s.validatingFields)
|
|
1557
1557
|
}));
|
|
1558
|
-
}, B = (
|
|
1559
|
-
if (w &&
|
|
1560
|
-
if (
|
|
1561
|
-
const E =
|
|
1562
|
-
v && q(n,
|
|
1558
|
+
}, B = (o, u = [], f, w, v = !0, b = !0) => {
|
|
1559
|
+
if (w && f && !t.disabled) {
|
|
1560
|
+
if (a.action = !0, b && Array.isArray(S(n, o))) {
|
|
1561
|
+
const E = f(S(n, o), w.argA, w.argB);
|
|
1562
|
+
v && q(n, o, E);
|
|
1563
1563
|
}
|
|
1564
|
-
if (b && Array.isArray(S(s.errors,
|
|
1565
|
-
const E =
|
|
1566
|
-
v && q(s.errors,
|
|
1564
|
+
if (b && Array.isArray(S(s.errors, o))) {
|
|
1565
|
+
const E = f(S(s.errors, o), w.argA, w.argB);
|
|
1566
|
+
v && q(s.errors, o, E), Ar(s.errors, o);
|
|
1567
1567
|
}
|
|
1568
|
-
if ((
|
|
1569
|
-
const E =
|
|
1570
|
-
v && q(s.touchedFields,
|
|
1568
|
+
if ((y.touchedFields || h.touchedFields) && b && Array.isArray(S(s.touchedFields, o))) {
|
|
1569
|
+
const E = f(S(s.touchedFields, o), w.argA, w.argB);
|
|
1570
|
+
v && q(s.touchedFields, o, E);
|
|
1571
1571
|
}
|
|
1572
|
-
(
|
|
1573
|
-
name:
|
|
1574
|
-
isDirty: ae(
|
|
1572
|
+
(y.dirtyFields || h.dirtyFields) && (s.dirtyFields = Fe(i, r)), d.state.next({
|
|
1573
|
+
name: o,
|
|
1574
|
+
isDirty: ae(o, u),
|
|
1575
1575
|
dirtyFields: s.dirtyFields,
|
|
1576
1576
|
errors: s.errors,
|
|
1577
1577
|
isValid: s.isValid
|
|
1578
1578
|
});
|
|
1579
1579
|
} else
|
|
1580
|
-
q(r,
|
|
1581
|
-
}, N = (
|
|
1582
|
-
q(s.errors,
|
|
1580
|
+
q(r, o, u);
|
|
1581
|
+
}, N = (o, u) => {
|
|
1582
|
+
q(s.errors, o, u), d.state.next({
|
|
1583
1583
|
errors: s.errors
|
|
1584
1584
|
});
|
|
1585
|
-
}, $ = (
|
|
1586
|
-
s.errors =
|
|
1585
|
+
}, $ = (o) => {
|
|
1586
|
+
s.errors = o, d.state.next({
|
|
1587
1587
|
errors: s.errors,
|
|
1588
1588
|
isValid: !1
|
|
1589
1589
|
});
|
|
1590
|
-
}, x = (
|
|
1591
|
-
const v = S(n,
|
|
1590
|
+
}, x = (o, u, f, w) => {
|
|
1591
|
+
const v = S(n, o);
|
|
1592
1592
|
if (v) {
|
|
1593
|
-
const b = S(r,
|
|
1594
|
-
j(b) || w && w.defaultChecked ||
|
|
1593
|
+
const b = S(r, o, j(f) ? S(i, o) : f);
|
|
1594
|
+
j(b) || w && w.defaultChecked || u ? q(r, o, u ? b : Lt(v._f)) : H(o, b), a.mount && C();
|
|
1595
1595
|
}
|
|
1596
|
-
}, A = (
|
|
1596
|
+
}, A = (o, u, f, w, v) => {
|
|
1597
1597
|
let b = !1, E = !1;
|
|
1598
1598
|
const O = {
|
|
1599
|
-
name:
|
|
1599
|
+
name: o
|
|
1600
1600
|
};
|
|
1601
1601
|
if (!t.disabled) {
|
|
1602
|
-
if (!
|
|
1603
|
-
(
|
|
1604
|
-
const U = ve(S(i,
|
|
1605
|
-
E = !!S(s.dirtyFields,
|
|
1602
|
+
if (!f || w) {
|
|
1603
|
+
(y.isDirty || h.isDirty) && (E = s.isDirty, s.isDirty = O.isDirty = ae(), b = E !== O.isDirty);
|
|
1604
|
+
const U = ve(S(i, o), u);
|
|
1605
|
+
E = !!S(s.dirtyFields, o), U ? K(s.dirtyFields, o) : q(s.dirtyFields, o, !0), O.dirtyFields = s.dirtyFields, b = b || (y.dirtyFields || h.dirtyFields) && E !== !U;
|
|
1606
1606
|
}
|
|
1607
|
-
if (
|
|
1608
|
-
const U = S(s.touchedFields,
|
|
1609
|
-
U || (q(s.touchedFields,
|
|
1607
|
+
if (f) {
|
|
1608
|
+
const U = S(s.touchedFields, o);
|
|
1609
|
+
U || (q(s.touchedFields, o, f), O.touchedFields = s.touchedFields, b = b || (y.touchedFields || h.touchedFields) && U !== f);
|
|
1610
1610
|
}
|
|
1611
|
-
b && v &&
|
|
1611
|
+
b && v && d.state.next(O);
|
|
1612
1612
|
}
|
|
1613
1613
|
return b ? O : {};
|
|
1614
|
-
}, I = (
|
|
1615
|
-
const v = S(s.errors,
|
|
1616
|
-
if (t.delayError &&
|
|
1614
|
+
}, I = (o, u, f, w) => {
|
|
1615
|
+
const v = S(s.errors, o), b = (y.isValid || h.isValid) && he(u) && s.isValid !== u;
|
|
1616
|
+
if (t.delayError && f ? (l = _(() => N(o, f)), l(t.delayError)) : (clearTimeout(m), l = null, f ? q(s.errors, o, f) : K(s.errors, o)), (f ? !ve(v, f) : v) || !ee(w) || b) {
|
|
1617
1617
|
const E = {
|
|
1618
1618
|
...w,
|
|
1619
|
-
...b && he(
|
|
1619
|
+
...b && he(u) ? { isValid: u } : {},
|
|
1620
1620
|
errors: s.errors,
|
|
1621
|
-
name:
|
|
1621
|
+
name: o
|
|
1622
1622
|
};
|
|
1623
1623
|
s = {
|
|
1624
1624
|
...s,
|
|
1625
1625
|
...E
|
|
1626
|
-
},
|
|
1626
|
+
}, d.state.next(E);
|
|
1627
1627
|
}
|
|
1628
|
-
}, M = async (
|
|
1629
|
-
k(
|
|
1630
|
-
const
|
|
1631
|
-
return k(
|
|
1632
|
-
}, se = async (
|
|
1633
|
-
const { errors:
|
|
1634
|
-
if (
|
|
1635
|
-
for (const
|
|
1636
|
-
const w = S(
|
|
1637
|
-
w ? q(s.errors,
|
|
1628
|
+
}, M = async (o) => {
|
|
1629
|
+
k(o, !0);
|
|
1630
|
+
const u = await t.resolver(r, t.context, _r(o || c.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
1631
|
+
return k(o), u;
|
|
1632
|
+
}, se = async (o) => {
|
|
1633
|
+
const { errors: u } = await M(o);
|
|
1634
|
+
if (o)
|
|
1635
|
+
for (const f of o) {
|
|
1636
|
+
const w = S(u, f);
|
|
1637
|
+
w ? q(s.errors, f, w) : K(s.errors, f);
|
|
1638
1638
|
}
|
|
1639
1639
|
else
|
|
1640
|
-
s.errors =
|
|
1641
|
-
return
|
|
1642
|
-
}, P = async (
|
|
1640
|
+
s.errors = u;
|
|
1641
|
+
return u;
|
|
1642
|
+
}, P = async (o, u, f = {
|
|
1643
1643
|
valid: !0
|
|
1644
1644
|
}) => {
|
|
1645
|
-
for (const w in
|
|
1646
|
-
const v =
|
|
1645
|
+
for (const w in o) {
|
|
1646
|
+
const v = o[w];
|
|
1647
1647
|
if (v) {
|
|
1648
1648
|
const { _f: b, ...E } = v;
|
|
1649
1649
|
if (b) {
|
|
1650
1650
|
const O = c.array.has(b.name), U = v._f && Sr(v._f);
|
|
1651
|
-
U &&
|
|
1652
|
-
const oe = await Mt(v, c.disabled, r, p, t.shouldUseNativeValidation && !
|
|
1653
|
-
if (U &&
|
|
1651
|
+
U && y.validatingFields && k([w], !0);
|
|
1652
|
+
const oe = await Mt(v, c.disabled, r, p, t.shouldUseNativeValidation && !u, O);
|
|
1653
|
+
if (U && y.validatingFields && k([w]), oe[b.name] && (f.valid = !1, u))
|
|
1654
1654
|
break;
|
|
1655
|
-
!
|
|
1655
|
+
!u && (S(oe, b.name) ? O ? xr(s.errors, oe, b.name) : q(s.errors, b.name, oe[b.name]) : K(s.errors, b.name));
|
|
1656
1656
|
}
|
|
1657
|
-
!ee(E) && await P(E,
|
|
1657
|
+
!ee(E) && await P(E, u, f);
|
|
1658
1658
|
}
|
|
1659
1659
|
}
|
|
1660
|
-
return
|
|
1660
|
+
return f.valid;
|
|
1661
1661
|
}, re = () => {
|
|
1662
|
-
for (const
|
|
1663
|
-
const
|
|
1664
|
-
|
|
1662
|
+
for (const o of c.unMount) {
|
|
1663
|
+
const u = S(n, o);
|
|
1664
|
+
u && (u._f.refs ? u._f.refs.every((f) => !st(f)) : !st(u._f.ref)) && Ye(o);
|
|
1665
1665
|
}
|
|
1666
1666
|
c.unMount = /* @__PURE__ */ new Set();
|
|
1667
|
-
}, ae = (
|
|
1668
|
-
...
|
|
1669
|
-
},
|
|
1670
|
-
const w = S(n,
|
|
1671
|
-
let v =
|
|
1667
|
+
}, ae = (o, u) => !t.disabled && (o && u && q(r, o, u), !ve(ue(), i)), F = (o, u, f) => gr(o, c, {
|
|
1668
|
+
...a.mount ? r : j(u) ? i : ye(o) ? { [o]: u } : u
|
|
1669
|
+
}, f, u), L = (o) => lt(S(a.mount ? r : i, o, t.shouldUnregister ? S(i, o, []) : [])), H = (o, u, f = {}) => {
|
|
1670
|
+
const w = S(n, o);
|
|
1671
|
+
let v = u;
|
|
1672
1672
|
if (w) {
|
|
1673
1673
|
const b = w._f;
|
|
1674
|
-
b && (!b.disabled && q(r,
|
|
1674
|
+
b && (!b.disabled && q(r, o, cs(u, b)), v = Ke(b.ref) && Z(u) ? "" : u, ns(b.ref) ? [...b.ref.options].forEach((E) => E.selected = v.includes(E.value)) : b.refs ? Ue(b.ref) ? b.refs.forEach((E) => {
|
|
1675
1675
|
(!E.defaultChecked || !E.disabled) && (Array.isArray(v) ? E.checked = !!v.find((O) => O === E.value) : E.checked = v === E.value || !!v);
|
|
1676
|
-
}) : b.refs.forEach((E) => E.checked = E.value === v) : dt(b.ref) ? b.ref.value = "" : (b.ref.value = v, b.ref.type ||
|
|
1677
|
-
name:
|
|
1676
|
+
}) : b.refs.forEach((E) => E.checked = E.value === v) : dt(b.ref) ? b.ref.value = "" : (b.ref.value = v, b.ref.type || d.state.next({
|
|
1677
|
+
name: o,
|
|
1678
1678
|
values: G(r)
|
|
1679
1679
|
})));
|
|
1680
1680
|
}
|
|
1681
|
-
(
|
|
1682
|
-
}, W = (
|
|
1683
|
-
for (const w in
|
|
1684
|
-
if (!
|
|
1681
|
+
(f.shouldDirty || f.shouldTouch) && A(o, v, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && ne(o);
|
|
1682
|
+
}, W = (o, u, f) => {
|
|
1683
|
+
for (const w in u) {
|
|
1684
|
+
if (!u.hasOwnProperty(w))
|
|
1685
1685
|
return;
|
|
1686
|
-
const v =
|
|
1687
|
-
(c.array.has(
|
|
1686
|
+
const v = u[w], b = o + "." + w, E = S(n, b);
|
|
1687
|
+
(c.array.has(o) || Q(v) || E && !E._f) && !Ee(v) ? W(b, v, f) : H(b, v, f);
|
|
1688
1688
|
}
|
|
1689
|
-
}, z = (
|
|
1690
|
-
const w = S(n,
|
|
1691
|
-
q(r,
|
|
1692
|
-
name:
|
|
1689
|
+
}, z = (o, u, f = {}) => {
|
|
1690
|
+
const w = S(n, o), v = c.array.has(o), b = G(u);
|
|
1691
|
+
q(r, o, b), v ? (d.array.next({
|
|
1692
|
+
name: o,
|
|
1693
1693
|
values: G(r)
|
|
1694
|
-
}), (
|
|
1695
|
-
name:
|
|
1694
|
+
}), (y.isDirty || y.dirtyFields || h.isDirty || h.dirtyFields) && f.shouldDirty && d.state.next({
|
|
1695
|
+
name: o,
|
|
1696
1696
|
dirtyFields: Fe(i, r),
|
|
1697
|
-
isDirty: ae(
|
|
1698
|
-
})) : w && !w._f && !Z(b) ? W(
|
|
1699
|
-
name:
|
|
1697
|
+
isDirty: ae(o, b)
|
|
1698
|
+
})) : w && !w._f && !Z(b) ? W(o, b, f) : H(o, b, f), It(o, c) && d.state.next({ ...s, name: o }), d.state.next({
|
|
1699
|
+
name: a.mount ? o : void 0,
|
|
1700
1700
|
values: G(r)
|
|
1701
1701
|
});
|
|
1702
|
-
}, R = async (
|
|
1703
|
-
|
|
1704
|
-
const
|
|
1705
|
-
let
|
|
1706
|
-
const v = S(n,
|
|
1707
|
-
w = Number.isNaN(U) || Ee(U) && isNaN(U.getTime()) || ve(U, S(r,
|
|
1702
|
+
}, R = async (o) => {
|
|
1703
|
+
a.mount = !0;
|
|
1704
|
+
const u = o.target;
|
|
1705
|
+
let f = u.name, w = !0;
|
|
1706
|
+
const v = S(n, f), b = (U) => {
|
|
1707
|
+
w = Number.isNaN(U) || Ee(U) && isNaN(U.getTime()) || ve(U, S(r, f, U));
|
|
1708
1708
|
}, E = Dt(t.mode), O = Dt(t.reValidateMode);
|
|
1709
1709
|
if (v) {
|
|
1710
1710
|
let U, oe;
|
|
1711
|
-
const He =
|
|
1712
|
-
q(r,
|
|
1713
|
-
const tt = A(
|
|
1714
|
-
if (!be &&
|
|
1715
|
-
name:
|
|
1716
|
-
type:
|
|
1711
|
+
const He = u.type ? Lt(v._f) : lr(o), be = o.type === At.BLUR || o.type === At.FOCUS_OUT, bs = !Cr(v._f) && !t.resolver && !S(s.errors, f) && !v._f.deps || Nr(be, S(s.touchedFields, f), s.isSubmitted, O, E), et = It(f, c, be);
|
|
1712
|
+
q(r, f, He), be ? (v._f.onBlur && v._f.onBlur(o), l && l(0)) : v._f.onChange && v._f.onChange(o);
|
|
1713
|
+
const tt = A(f, He, be), vs = !ee(tt) || et;
|
|
1714
|
+
if (!be && d.state.next({
|
|
1715
|
+
name: f,
|
|
1716
|
+
type: o.type,
|
|
1717
1717
|
values: G(r)
|
|
1718
1718
|
}), bs)
|
|
1719
|
-
return (
|
|
1720
|
-
if (!be && et &&
|
|
1721
|
-
const { errors: wt } = await M([
|
|
1719
|
+
return (y.isValid || h.isValid) && (t.mode === "onBlur" ? be && C() : be || C()), vs && d.state.next({ name: f, ...et ? {} : tt });
|
|
1720
|
+
if (!be && et && d.state.next({ ...s }), t.resolver) {
|
|
1721
|
+
const { errors: wt } = await M([f]);
|
|
1722
1722
|
if (b(He), w) {
|
|
1723
|
-
const ws = Pt(s.errors, n,
|
|
1724
|
-
U = _t.error,
|
|
1723
|
+
const ws = Pt(s.errors, n, f), _t = Pt(wt, n, ws.name || f);
|
|
1724
|
+
U = _t.error, f = _t.name, oe = ee(wt);
|
|
1725
1725
|
}
|
|
1726
1726
|
} else
|
|
1727
|
-
k([
|
|
1728
|
-
w && (v._f.deps && ne(v._f.deps), I(
|
|
1727
|
+
k([f], !0), U = (await Mt(v, c.disabled, r, p, t.shouldUseNativeValidation))[f], k([f]), b(He), w && (U ? oe = !1 : (y.isValid || h.isValid) && (oe = await P(n, !0)));
|
|
1728
|
+
w && (v._f.deps && ne(v._f.deps), I(f, oe, U, tt));
|
|
1729
1729
|
}
|
|
1730
|
-
}, Y = (
|
|
1731
|
-
if (S(s.errors,
|
|
1732
|
-
return
|
|
1733
|
-
}, ne = async (
|
|
1734
|
-
let
|
|
1735
|
-
const v = Le(
|
|
1730
|
+
}, Y = (o, u) => {
|
|
1731
|
+
if (S(s.errors, u) && o.focus)
|
|
1732
|
+
return o.focus(), 1;
|
|
1733
|
+
}, ne = async (o, u = {}) => {
|
|
1734
|
+
let f, w;
|
|
1735
|
+
const v = Le(o);
|
|
1736
1736
|
if (t.resolver) {
|
|
1737
|
-
const b = await se(j(
|
|
1738
|
-
|
|
1739
|
-
} else
|
|
1737
|
+
const b = await se(j(o) ? o : v);
|
|
1738
|
+
f = ee(b), w = o ? !v.some((E) => S(b, E)) : f;
|
|
1739
|
+
} else o ? (w = (await Promise.all(v.map(async (b) => {
|
|
1740
1740
|
const E = S(n, b);
|
|
1741
1741
|
return await P(E && E._f ? { [b]: E } : E);
|
|
1742
|
-
}))).every(Boolean), !(!w && !s.isValid) && C()) : w =
|
|
1743
|
-
return
|
|
1744
|
-
...!ye(
|
|
1745
|
-
...t.resolver || !
|
|
1742
|
+
}))).every(Boolean), !(!w && !s.isValid) && C()) : w = f = await P(n);
|
|
1743
|
+
return d.state.next({
|
|
1744
|
+
...!ye(o) || (y.isValid || h.isValid) && f !== s.isValid ? {} : { name: o },
|
|
1745
|
+
...t.resolver || !o ? { isValid: f } : {},
|
|
1746
1746
|
errors: s.errors
|
|
1747
|
-
}),
|
|
1748
|
-
}, ue = (
|
|
1749
|
-
const
|
|
1750
|
-
...
|
|
1747
|
+
}), u.shouldFocus && !w && De(n, Y, o ? v : c.mount), w;
|
|
1748
|
+
}, ue = (o) => {
|
|
1749
|
+
const u = {
|
|
1750
|
+
...a.mount ? r : i
|
|
1751
1751
|
};
|
|
1752
|
-
return j(
|
|
1753
|
-
}, qe = (
|
|
1754
|
-
invalid: !!S((
|
|
1755
|
-
isDirty: !!S((
|
|
1756
|
-
error: S((
|
|
1757
|
-
isValidating: !!S(s.validatingFields,
|
|
1758
|
-
isTouched: !!S((
|
|
1759
|
-
}), Ce = (
|
|
1760
|
-
|
|
1761
|
-
errors:
|
|
1752
|
+
return j(o) ? u : ye(o) ? S(u, o) : o.map((f) => S(u, f));
|
|
1753
|
+
}, qe = (o, u) => ({
|
|
1754
|
+
invalid: !!S((u || s).errors, o),
|
|
1755
|
+
isDirty: !!S((u || s).dirtyFields, o),
|
|
1756
|
+
error: S((u || s).errors, o),
|
|
1757
|
+
isValidating: !!S(s.validatingFields, o),
|
|
1758
|
+
isTouched: !!S((u || s).touchedFields, o)
|
|
1759
|
+
}), Ce = (o) => {
|
|
1760
|
+
o && Le(o).forEach((u) => K(s.errors, u)), d.state.next({
|
|
1761
|
+
errors: o ? s.errors : {}
|
|
1762
1762
|
});
|
|
1763
|
-
}, mt = (
|
|
1764
|
-
const w = (S(n,
|
|
1765
|
-
q(s.errors,
|
|
1763
|
+
}, mt = (o, u, f) => {
|
|
1764
|
+
const w = (S(n, o, { _f: {} })._f || {}).ref, v = S(s.errors, o) || {}, { ref: b, message: E, type: O, ...U } = v;
|
|
1765
|
+
q(s.errors, o, {
|
|
1766
1766
|
...U,
|
|
1767
|
-
...
|
|
1767
|
+
...u,
|
|
1768
1768
|
ref: w
|
|
1769
|
-
}),
|
|
1770
|
-
name:
|
|
1769
|
+
}), d.state.next({
|
|
1770
|
+
name: o,
|
|
1771
1771
|
errors: s.errors,
|
|
1772
1772
|
isValid: !1
|
|
1773
|
-
}),
|
|
1774
|
-
}, fs = (
|
|
1775
|
-
next: (
|
|
1776
|
-
}) : F(
|
|
1777
|
-
next: (
|
|
1778
|
-
kr(
|
|
1773
|
+
}), f && f.shouldFocus && w && w.focus && w.focus();
|
|
1774
|
+
}, fs = (o, u) => fe(o) ? d.state.subscribe({
|
|
1775
|
+
next: (f) => "values" in f && o(F(void 0, u), f)
|
|
1776
|
+
}) : F(o, u, !0), ht = (o) => d.state.subscribe({
|
|
1777
|
+
next: (u) => {
|
|
1778
|
+
kr(o.name, u.name, o.exact) && Er(u, o.formState || y, ps, o.reRenderRoot) && o.callback({
|
|
1779
1779
|
values: { ...r },
|
|
1780
1780
|
...s,
|
|
1781
|
-
...
|
|
1781
|
+
...u,
|
|
1782
1782
|
defaultValues: i
|
|
1783
1783
|
});
|
|
1784
1784
|
}
|
|
1785
|
-
}).unsubscribe, ms = (
|
|
1786
|
-
...
|
|
1787
|
-
...
|
|
1785
|
+
}).unsubscribe, ms = (o) => (a.mount = !0, h = {
|
|
1786
|
+
...h,
|
|
1787
|
+
...o.formState
|
|
1788
1788
|
}, ht({
|
|
1789
|
-
...
|
|
1790
|
-
formState:
|
|
1791
|
-
})), Ye = (
|
|
1792
|
-
for (const
|
|
1793
|
-
c.mount.delete(
|
|
1794
|
-
|
|
1789
|
+
...o,
|
|
1790
|
+
formState: h
|
|
1791
|
+
})), Ye = (o, u = {}) => {
|
|
1792
|
+
for (const f of o ? Le(o) : c.mount)
|
|
1793
|
+
c.mount.delete(f), c.array.delete(f), u.keepValue || (K(n, f), K(r, f)), !u.keepError && K(s.errors, f), !u.keepDirty && K(s.dirtyFields, f), !u.keepTouched && K(s.touchedFields, f), !u.keepIsValidating && K(s.validatingFields, f), !t.shouldUnregister && !u.keepDefaultValue && K(i, f);
|
|
1794
|
+
d.state.next({
|
|
1795
1795
|
values: G(r)
|
|
1796
|
-
}),
|
|
1796
|
+
}), d.state.next({
|
|
1797
1797
|
...s,
|
|
1798
|
-
...
|
|
1799
|
-
}), !
|
|
1800
|
-
}, yt = ({ disabled:
|
|
1801
|
-
(he(
|
|
1802
|
-
}, Xe = (
|
|
1803
|
-
let
|
|
1804
|
-
const w = he(
|
|
1805
|
-
return q(n,
|
|
1806
|
-
...
|
|
1798
|
+
...u.keepDirty ? { isDirty: ae() } : {}
|
|
1799
|
+
}), !u.keepIsValid && C();
|
|
1800
|
+
}, yt = ({ disabled: o, name: u }) => {
|
|
1801
|
+
(he(o) && a.mount || o || c.disabled.has(u)) && (o ? c.disabled.add(u) : c.disabled.delete(u));
|
|
1802
|
+
}, Xe = (o, u = {}) => {
|
|
1803
|
+
let f = S(n, o);
|
|
1804
|
+
const w = he(u.disabled) || he(t.disabled);
|
|
1805
|
+
return q(n, o, {
|
|
1806
|
+
...f || {},
|
|
1807
1807
|
_f: {
|
|
1808
|
-
...
|
|
1809
|
-
name:
|
|
1808
|
+
...f && f._f ? f._f : { ref: { name: o } },
|
|
1809
|
+
name: o,
|
|
1810
1810
|
mount: !0,
|
|
1811
|
-
...
|
|
1811
|
+
...u
|
|
1812
1812
|
}
|
|
1813
|
-
}), c.mount.add(
|
|
1814
|
-
disabled: he(
|
|
1815
|
-
name:
|
|
1816
|
-
}) : x(
|
|
1817
|
-
...w ? { disabled:
|
|
1813
|
+
}), c.mount.add(o), f ? yt({
|
|
1814
|
+
disabled: he(u.disabled) ? u.disabled : t.disabled,
|
|
1815
|
+
name: o
|
|
1816
|
+
}) : x(o, !0, u.value), {
|
|
1817
|
+
...w ? { disabled: u.disabled || t.disabled } : {},
|
|
1818
1818
|
...t.progressive ? {
|
|
1819
|
-
required: !!
|
|
1820
|
-
min: $e(
|
|
1821
|
-
max: $e(
|
|
1822
|
-
minLength: $e(
|
|
1823
|
-
maxLength: $e(
|
|
1824
|
-
pattern: $e(
|
|
1819
|
+
required: !!u.required,
|
|
1820
|
+
min: $e(u.min),
|
|
1821
|
+
max: $e(u.max),
|
|
1822
|
+
minLength: $e(u.minLength),
|
|
1823
|
+
maxLength: $e(u.maxLength),
|
|
1824
|
+
pattern: $e(u.pattern)
|
|
1825
1825
|
} : {},
|
|
1826
|
-
name:
|
|
1826
|
+
name: o,
|
|
1827
1827
|
onChange: R,
|
|
1828
1828
|
onBlur: R,
|
|
1829
1829
|
ref: (v) => {
|
|
1830
1830
|
if (v) {
|
|
1831
|
-
Xe(
|
|
1832
|
-
const b = j(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, E = br(b), O =
|
|
1833
|
-
if (E ? O.find((U) => U === b) : b ===
|
|
1831
|
+
Xe(o, u), f = S(n, o);
|
|
1832
|
+
const b = j(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, E = br(b), O = f._f.refs || [];
|
|
1833
|
+
if (E ? O.find((U) => U === b) : b === f._f.ref)
|
|
1834
1834
|
return;
|
|
1835
|
-
q(n,
|
|
1835
|
+
q(n, o, {
|
|
1836
1836
|
_f: {
|
|
1837
|
-
...
|
|
1837
|
+
...f._f,
|
|
1838
1838
|
...E ? {
|
|
1839
1839
|
refs: [
|
|
1840
1840
|
...O.filter(st),
|
|
1841
1841
|
b,
|
|
1842
|
-
...Array.isArray(S(i,
|
|
1842
|
+
...Array.isArray(S(i, o)) ? [{}] : []
|
|
1843
1843
|
],
|
|
1844
|
-
ref: { type: b.type, name:
|
|
1844
|
+
ref: { type: b.type, name: o }
|
|
1845
1845
|
} : { ref: b }
|
|
1846
1846
|
}
|
|
1847
|
-
}), x(
|
|
1847
|
+
}), x(o, !1, void 0, b);
|
|
1848
1848
|
} else
|
|
1849
|
-
|
|
1849
|
+
f = S(n, o, {}), f._f && (f._f.mount = !1), (t.shouldUnregister || u.shouldUnregister) && !(dr(c.array, o) && a.action) && c.unMount.add(o);
|
|
1850
1850
|
}
|
|
1851
1851
|
};
|
|
1852
|
-
}, Ze = () => t.shouldFocusError && De(n, Y, c.mount), hs = (
|
|
1853
|
-
he(
|
|
1854
|
-
const w = S(n,
|
|
1855
|
-
w && (
|
|
1856
|
-
v.disabled = w._f.disabled ||
|
|
1852
|
+
}, Ze = () => t.shouldFocusError && De(n, Y, c.mount), hs = (o) => {
|
|
1853
|
+
he(o) && (d.state.next({ disabled: o }), De(n, (u, f) => {
|
|
1854
|
+
const w = S(n, f);
|
|
1855
|
+
w && (u.disabled = w._f.disabled || o, Array.isArray(w._f.refs) && w._f.refs.forEach((v) => {
|
|
1856
|
+
v.disabled = w._f.disabled || o;
|
|
1857
1857
|
}));
|
|
1858
1858
|
}, 0, !1));
|
|
1859
|
-
}, gt = (
|
|
1859
|
+
}, gt = (o, u) => async (f) => {
|
|
1860
1860
|
let w;
|
|
1861
|
-
|
|
1861
|
+
f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
|
|
1862
1862
|
let v = G(r);
|
|
1863
|
-
if (
|
|
1863
|
+
if (d.state.next({
|
|
1864
1864
|
isSubmitting: !0
|
|
1865
1865
|
}), t.resolver) {
|
|
1866
1866
|
const { errors: b, values: E } = await M();
|
|
@@ -1871,17 +1871,17 @@ function Fr(e = {}) {
|
|
|
1871
1871
|
for (const b of c.disabled)
|
|
1872
1872
|
K(v, b);
|
|
1873
1873
|
if (K(s.errors, "root"), ee(s.errors)) {
|
|
1874
|
-
|
|
1874
|
+
d.state.next({
|
|
1875
1875
|
errors: {}
|
|
1876
1876
|
});
|
|
1877
1877
|
try {
|
|
1878
|
-
await
|
|
1878
|
+
await o(v, f);
|
|
1879
1879
|
} catch (b) {
|
|
1880
1880
|
w = b;
|
|
1881
1881
|
}
|
|
1882
1882
|
} else
|
|
1883
|
-
|
|
1884
|
-
if (
|
|
1883
|
+
u && await u({ ...s.errors }, f), Ze(), setTimeout(Ze);
|
|
1884
|
+
if (d.state.next({
|
|
1885
1885
|
isSubmitted: !0,
|
|
1886
1886
|
isSubmitting: !1,
|
|
1887
1887
|
isSubmitSuccessful: ee(s.errors) && !w,
|
|
@@ -1889,12 +1889,12 @@ function Fr(e = {}) {
|
|
|
1889
1889
|
errors: s.errors
|
|
1890
1890
|
}), w)
|
|
1891
1891
|
throw w;
|
|
1892
|
-
}, ys = (
|
|
1893
|
-
S(n,
|
|
1894
|
-
}, pt = (
|
|
1895
|
-
const
|
|
1896
|
-
if (
|
|
1897
|
-
if (
|
|
1892
|
+
}, ys = (o, u = {}) => {
|
|
1893
|
+
S(n, o) && (j(u.defaultValue) ? z(o, G(S(i, o))) : (z(o, u.defaultValue), q(i, o, G(u.defaultValue))), u.keepTouched || K(s.touchedFields, o), u.keepDirty || (K(s.dirtyFields, o), s.isDirty = u.defaultValue ? ae(o, G(S(i, o))) : ae()), u.keepError || (K(s.errors, o), y.isValid && C()), d.state.next({ ...s }));
|
|
1894
|
+
}, pt = (o, u = {}) => {
|
|
1895
|
+
const f = o ? G(o) : i, w = G(f), v = ee(o), b = v ? i : w;
|
|
1896
|
+
if (u.keepDefaultValues || (i = f), !u.keepValues) {
|
|
1897
|
+
if (u.keepDirtyValues) {
|
|
1898
1898
|
const E = /* @__PURE__ */ new Set([
|
|
1899
1899
|
...c.mount,
|
|
1900
1900
|
...Object.keys(Fe(i, r))
|
|
@@ -1902,7 +1902,7 @@ function Fr(e = {}) {
|
|
|
1902
1902
|
for (const O of Array.from(E))
|
|
1903
1903
|
S(s.dirtyFields, O) ? q(b, O, S(r, O)) : z(O, S(b, O));
|
|
1904
1904
|
} else {
|
|
1905
|
-
if (ct && j(
|
|
1905
|
+
if (ct && j(o))
|
|
1906
1906
|
for (const E of c.mount) {
|
|
1907
1907
|
const O = S(n, E);
|
|
1908
1908
|
if (O && O._f) {
|
|
@@ -1916,46 +1916,46 @@ function Fr(e = {}) {
|
|
|
1916
1916
|
}
|
|
1917
1917
|
}
|
|
1918
1918
|
}
|
|
1919
|
-
if (
|
|
1919
|
+
if (u.keepFieldsRef)
|
|
1920
1920
|
for (const E of c.mount)
|
|
1921
1921
|
z(E, S(b, E));
|
|
1922
1922
|
else
|
|
1923
1923
|
n = {};
|
|
1924
1924
|
}
|
|
1925
|
-
r = t.shouldUnregister ?
|
|
1925
|
+
r = t.shouldUnregister ? u.keepDefaultValues ? G(i) : {} : G(b), d.array.next({
|
|
1926
1926
|
values: { ...b }
|
|
1927
|
-
}),
|
|
1927
|
+
}), d.state.next({
|
|
1928
1928
|
values: { ...b }
|
|
1929
1929
|
});
|
|
1930
1930
|
}
|
|
1931
1931
|
c = {
|
|
1932
|
-
mount:
|
|
1932
|
+
mount: u.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
|
|
1933
1933
|
unMount: /* @__PURE__ */ new Set(),
|
|
1934
1934
|
array: /* @__PURE__ */ new Set(),
|
|
1935
1935
|
disabled: /* @__PURE__ */ new Set(),
|
|
1936
1936
|
watch: /* @__PURE__ */ new Set(),
|
|
1937
1937
|
watchAll: !1,
|
|
1938
1938
|
focus: ""
|
|
1939
|
-
},
|
|
1940
|
-
submitCount:
|
|
1941
|
-
isDirty: v ? !1 :
|
|
1942
|
-
isSubmitted:
|
|
1943
|
-
dirtyFields: v ? {} :
|
|
1944
|
-
touchedFields:
|
|
1945
|
-
errors:
|
|
1946
|
-
isSubmitSuccessful:
|
|
1939
|
+
}, a.mount = !y.isValid || !!u.keepIsValid || !!u.keepDirtyValues, a.watch = !!t.shouldUnregister, d.state.next({
|
|
1940
|
+
submitCount: u.keepSubmitCount ? s.submitCount : 0,
|
|
1941
|
+
isDirty: v ? !1 : u.keepDirty ? s.isDirty : !!(u.keepDefaultValues && !ve(o, i)),
|
|
1942
|
+
isSubmitted: u.keepIsSubmitted ? s.isSubmitted : !1,
|
|
1943
|
+
dirtyFields: v ? {} : u.keepDirtyValues ? u.keepDefaultValues && r ? Fe(i, r) : s.dirtyFields : u.keepDefaultValues && o ? Fe(i, o) : u.keepDirty ? s.dirtyFields : {},
|
|
1944
|
+
touchedFields: u.keepTouched ? s.touchedFields : {},
|
|
1945
|
+
errors: u.keepErrors ? s.errors : {},
|
|
1946
|
+
isSubmitSuccessful: u.keepIsSubmitSuccessful ? s.isSubmitSuccessful : !1,
|
|
1947
1947
|
isSubmitting: !1
|
|
1948
1948
|
});
|
|
1949
|
-
}, bt = (
|
|
1950
|
-
const
|
|
1949
|
+
}, bt = (o, u) => pt(fe(o) ? o(r) : o, u), gs = (o, u = {}) => {
|
|
1950
|
+
const f = S(n, o), w = f && f._f;
|
|
1951
1951
|
if (w) {
|
|
1952
1952
|
const v = w.refs ? w.refs[0] : w.ref;
|
|
1953
|
-
v.focus && (v.focus(),
|
|
1953
|
+
v.focus && (v.focus(), u.shouldSelect && fe(v.select) && v.select());
|
|
1954
1954
|
}
|
|
1955
|
-
}, ps = (
|
|
1955
|
+
}, ps = (o) => {
|
|
1956
1956
|
s = {
|
|
1957
1957
|
...s,
|
|
1958
|
-
...
|
|
1958
|
+
...o
|
|
1959
1959
|
};
|
|
1960
1960
|
}, vt = {
|
|
1961
1961
|
control: {
|
|
@@ -1975,15 +1975,15 @@ function Fr(e = {}) {
|
|
|
1975
1975
|
_setErrors: $,
|
|
1976
1976
|
_getFieldArray: L,
|
|
1977
1977
|
_reset: pt,
|
|
1978
|
-
_resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((
|
|
1979
|
-
bt(
|
|
1978
|
+
_resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((o) => {
|
|
1979
|
+
bt(o, t.resetOptions), d.state.next({
|
|
1980
1980
|
isLoading: !1
|
|
1981
1981
|
});
|
|
1982
1982
|
}),
|
|
1983
1983
|
_removeUnmounted: re,
|
|
1984
1984
|
_disableForm: hs,
|
|
1985
|
-
_subjects:
|
|
1986
|
-
_proxyFormState:
|
|
1985
|
+
_subjects: d,
|
|
1986
|
+
_proxyFormState: y,
|
|
1987
1987
|
get _fields() {
|
|
1988
1988
|
return n;
|
|
1989
1989
|
},
|
|
@@ -1991,10 +1991,10 @@ function Fr(e = {}) {
|
|
|
1991
1991
|
return r;
|
|
1992
1992
|
},
|
|
1993
1993
|
get _state() {
|
|
1994
|
-
return
|
|
1994
|
+
return a;
|
|
1995
1995
|
},
|
|
1996
|
-
set _state(
|
|
1997
|
-
|
|
1996
|
+
set _state(o) {
|
|
1997
|
+
a = o;
|
|
1998
1998
|
},
|
|
1999
1999
|
get _defaultValues() {
|
|
2000
2000
|
return i;
|
|
@@ -2002,8 +2002,8 @@ function Fr(e = {}) {
|
|
|
2002
2002
|
get _names() {
|
|
2003
2003
|
return c;
|
|
2004
2004
|
},
|
|
2005
|
-
set _names(
|
|
2006
|
-
c =
|
|
2005
|
+
set _names(o) {
|
|
2006
|
+
c = o;
|
|
2007
2007
|
},
|
|
2008
2008
|
get _formState() {
|
|
2009
2009
|
return s;
|
|
@@ -2011,10 +2011,10 @@ function Fr(e = {}) {
|
|
|
2011
2011
|
get _options() {
|
|
2012
2012
|
return t;
|
|
2013
2013
|
},
|
|
2014
|
-
set _options(
|
|
2014
|
+
set _options(o) {
|
|
2015
2015
|
t = {
|
|
2016
2016
|
...t,
|
|
2017
|
-
...
|
|
2017
|
+
...o
|
|
2018
2018
|
};
|
|
2019
2019
|
}
|
|
2020
2020
|
},
|
|
@@ -2063,7 +2063,7 @@ function us(e = {}) {
|
|
|
2063
2063
|
formState: n
|
|
2064
2064
|
}, e.defaultValues && !fe(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
2065
2065
|
else {
|
|
2066
|
-
const { formControl:
|
|
2066
|
+
const { formControl: a, ...c } = Fr(e);
|
|
2067
2067
|
t.current = {
|
|
2068
2068
|
...c,
|
|
2069
2069
|
formState: n
|
|
@@ -2071,7 +2071,7 @@ function us(e = {}) {
|
|
|
2071
2071
|
}
|
|
2072
2072
|
const r = t.current.control;
|
|
2073
2073
|
return r._options = e, yr(() => {
|
|
2074
|
-
const
|
|
2074
|
+
const a = r._subscribe({
|
|
2075
2075
|
formState: r._proxyFormState,
|
|
2076
2076
|
callback: () => i({ ...r._formState }),
|
|
2077
2077
|
reRenderRoot: !0
|
|
@@ -2079,7 +2079,7 @@ function us(e = {}) {
|
|
|
2079
2079
|
return i((c) => ({
|
|
2080
2080
|
...c,
|
|
2081
2081
|
isReady: !0
|
|
2082
|
-
})), r._formState.isReady = !0,
|
|
2082
|
+
})), r._formState.isReady = !0, a;
|
|
2083
2083
|
}, [r]), ie.useEffect(() => r._disableForm(e.disabled), [r, e.disabled]), ie.useEffect(() => {
|
|
2084
2084
|
e.mode && (r._options.mode = e.mode), e.reValidateMode && (r._options.reValidateMode = e.reValidateMode);
|
|
2085
2085
|
}, [r, e.mode, e.reValidateMode]), ie.useEffect(() => {
|
|
@@ -2090,16 +2090,16 @@ function us(e = {}) {
|
|
|
2090
2090
|
});
|
|
2091
2091
|
}, [r, e.shouldUnregister]), ie.useEffect(() => {
|
|
2092
2092
|
if (r._proxyFormState.isDirty) {
|
|
2093
|
-
const
|
|
2094
|
-
|
|
2095
|
-
isDirty:
|
|
2093
|
+
const a = r._getDirty();
|
|
2094
|
+
a !== n.isDirty && r._subjects.state.next({
|
|
2095
|
+
isDirty: a
|
|
2096
2096
|
});
|
|
2097
2097
|
}
|
|
2098
2098
|
}, [r, n.isDirty]), ie.useEffect(() => {
|
|
2099
2099
|
e.values && !ve(e.values, s.current) ? (r._reset(e.values, {
|
|
2100
2100
|
keepFieldsRef: !0,
|
|
2101
2101
|
...r._options.resetOptions
|
|
2102
|
-
}), s.current = e.values, i((
|
|
2102
|
+
}), s.current = e.values, i((a) => ({ ...a }))) : r._resetDefaultValues();
|
|
2103
2103
|
}, [r, e.values]), ie.useEffect(() => {
|
|
2104
2104
|
r._state.mount || (r._setValid(), r._state.mount = !0), r._state.watch && (r._state.watch = !1, r._subjects.state.next({ ...r._formState })), r._removeUnmounted();
|
|
2105
2105
|
}), t.current.formState = hr(n, r), t.current;
|
|
@@ -2108,12 +2108,12 @@ const En = (e) => {
|
|
|
2108
2108
|
const { t } = V(), { showStackNotifications: s, showSuccessNotification: n } = ke(), {
|
|
2109
2109
|
defaultValues: i,
|
|
2110
2110
|
mutationFn: r,
|
|
2111
|
-
formToDto:
|
|
2111
|
+
formToDto: a,
|
|
2112
2112
|
onError: c,
|
|
2113
|
-
onSuccess:
|
|
2113
|
+
onSuccess: l,
|
|
2114
2114
|
queryKey: m,
|
|
2115
|
-
onSuccessMessage:
|
|
2116
|
-
} = e, { control:
|
|
2115
|
+
onSuccessMessage: y
|
|
2116
|
+
} = e, { control: h, handleSubmit: d, reset: p, setError: _, getValues: C, setValue: k } = us({
|
|
2117
2117
|
defaultValues: i
|
|
2118
2118
|
}), B = D(
|
|
2119
2119
|
(x) => {
|
|
@@ -2156,20 +2156,20 @@ const En = (e) => {
|
|
|
2156
2156
|
}
|
|
2157
2157
|
},
|
|
2158
2158
|
onSuccess: async (x) => {
|
|
2159
|
-
pe && await pe.invalidateQueries({ queryKey: m }),
|
|
2160
|
-
message:
|
|
2159
|
+
pe && await pe.invalidateQueries({ queryKey: m }), l && l(x), y && n({
|
|
2160
|
+
message: y
|
|
2161
2161
|
});
|
|
2162
2162
|
}
|
|
2163
2163
|
}
|
|
2164
2164
|
);
|
|
2165
2165
|
return {
|
|
2166
|
-
control:
|
|
2166
|
+
control: h,
|
|
2167
2167
|
getValues: C,
|
|
2168
2168
|
setValue: k,
|
|
2169
|
-
handleSubmit:
|
|
2169
|
+
handleSubmit: d,
|
|
2170
2170
|
onSubmit: (x) => {
|
|
2171
2171
|
N(), $.mutate(
|
|
2172
|
-
|
|
2172
|
+
a ? a(x) : x
|
|
2173
2173
|
);
|
|
2174
2174
|
},
|
|
2175
2175
|
reset: p,
|
|
@@ -2177,52 +2177,81 @@ const En = (e) => {
|
|
|
2177
2177
|
isLoading: $.isPending
|
|
2178
2178
|
};
|
|
2179
2179
|
}, $r = (e) => {
|
|
2180
|
-
const { t } = V(), {
|
|
2180
|
+
const { t } = V(), {
|
|
2181
|
+
onClick: s,
|
|
2182
|
+
icon: n = Ms,
|
|
2183
|
+
sticky: i = !0,
|
|
2184
|
+
hidden: r = !1,
|
|
2185
|
+
multiple: a = !0,
|
|
2186
|
+
disabled: c = !1,
|
|
2187
|
+
id: l = _e.Delete,
|
|
2188
|
+
tooltip: m = t("_pages:common.actions.delete.text")
|
|
2189
|
+
} = e;
|
|
2181
2190
|
return {
|
|
2182
2191
|
action: D(
|
|
2183
|
-
(
|
|
2184
|
-
id:
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
+
(h) => ({
|
|
2193
|
+
id: l,
|
|
2194
|
+
sticky: i,
|
|
2195
|
+
tooltip: m,
|
|
2196
|
+
multiple: a,
|
|
2197
|
+
onClick: () => s([h == null ? void 0 : h.id]),
|
|
2198
|
+
hidden: !!h.deletedAt || r,
|
|
2199
|
+
disabled: !!h.deletedAt || c,
|
|
2200
|
+
icon: /* @__PURE__ */ g(ce, { className: "text-bg-error", icon: n }),
|
|
2201
|
+
onMultipleClick: (d) => s(d.map((p) => p.id))
|
|
2192
2202
|
}),
|
|
2193
|
-
[
|
|
2203
|
+
[c, r, n, l, a, s, i, m]
|
|
2194
2204
|
)
|
|
2195
2205
|
};
|
|
2196
2206
|
}, Lr = (e) => {
|
|
2197
|
-
const { t } = V(), {
|
|
2207
|
+
const { t } = V(), {
|
|
2208
|
+
onClick: s,
|
|
2209
|
+
sticky: n = !0,
|
|
2210
|
+
hidden: i = !1,
|
|
2211
|
+
disabled: r = !1,
|
|
2212
|
+
multiple: a = !1,
|
|
2213
|
+
icon: c = Bt,
|
|
2214
|
+
id: l = _e.Restore,
|
|
2215
|
+
tooltip: m = t("_pages:common.actions.restore.text")
|
|
2216
|
+
} = e;
|
|
2198
2217
|
return {
|
|
2199
2218
|
action: D(
|
|
2200
|
-
(
|
|
2201
|
-
id:
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2219
|
+
(h) => ({
|
|
2220
|
+
id: l,
|
|
2221
|
+
sticky: n,
|
|
2222
|
+
tooltip: m,
|
|
2223
|
+
multiple: a,
|
|
2224
|
+
onClick: () => s([h == null ? void 0 : h.id]),
|
|
2225
|
+
hidden: !h.deletedAt || i,
|
|
2226
|
+
disabled: !h.deletedAt || r,
|
|
2227
|
+
icon: /* @__PURE__ */ g(ce, { className: "text-bg-error", icon: c }),
|
|
2228
|
+
onMultipleClick: (d) => s(d.map((p) => p.id))
|
|
2209
2229
|
}),
|
|
2210
|
-
[
|
|
2230
|
+
[r, i, c, l, a, s, n, m]
|
|
2211
2231
|
)
|
|
2212
2232
|
};
|
|
2213
2233
|
}, kn = (e) => {
|
|
2214
|
-
const { t } = V(), {
|
|
2234
|
+
const { t } = V(), {
|
|
2235
|
+
onClick: s,
|
|
2236
|
+
hidden: n = !1,
|
|
2237
|
+
sticky: i = !0,
|
|
2238
|
+
disabled: r = !1,
|
|
2239
|
+
id: a = _e.Edit,
|
|
2240
|
+
icon: c = Rs,
|
|
2241
|
+
tooltip: l = t("_pages:common.actions.edit.text")
|
|
2242
|
+
} = e;
|
|
2215
2243
|
return {
|
|
2216
2244
|
action: D(
|
|
2217
|
-
(
|
|
2218
|
-
id:
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2245
|
+
(y) => ({
|
|
2246
|
+
id: a,
|
|
2247
|
+
sticky: i,
|
|
2248
|
+
tooltip: l,
|
|
2249
|
+
onClick: () => s(y == null ? void 0 : y.id),
|
|
2250
|
+
hidden: !!y.deletedAt || n,
|
|
2251
|
+
disabled: !!y.deletedAt || r,
|
|
2252
|
+
icon: /* @__PURE__ */ g(ce, { className: "primary", icon: c })
|
|
2224
2253
|
}),
|
|
2225
|
-
[n, s,
|
|
2254
|
+
[r, n, c, a, s, i, l]
|
|
2226
2255
|
)
|
|
2227
2256
|
};
|
|
2228
2257
|
};
|
|
@@ -2280,10 +2309,10 @@ const Dr = (e) => {
|
|
|
2280
2309
|
)
|
|
2281
2310
|
};
|
|
2282
2311
|
}, Nn = (e) => {
|
|
2283
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = ke(), { t: r } = V(), { open:
|
|
2312
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = ke(), { t: r } = V(), { open: a, onClick: c, close: l, dialogFn: m, isLoading: y } = ss({
|
|
2284
2313
|
onSuccessMessage: r("_pages:common.actions.delete.successMessage"),
|
|
2285
|
-
onError: (
|
|
2286
|
-
const p =
|
|
2314
|
+
onError: (d) => {
|
|
2315
|
+
const p = d;
|
|
2287
2316
|
if (Ge(p))
|
|
2288
2317
|
i(
|
|
2289
2318
|
p.errors.map(
|
|
@@ -2303,19 +2332,19 @@ const Dr = (e) => {
|
|
|
2303
2332
|
]);
|
|
2304
2333
|
}
|
|
2305
2334
|
},
|
|
2306
|
-
onSuccess: async (
|
|
2307
|
-
await pe.invalidateQueries({ queryKey: t }), s && s(
|
|
2335
|
+
onSuccess: async (d) => {
|
|
2336
|
+
await pe.invalidateQueries({ queryKey: t }), s && s(d);
|
|
2308
2337
|
},
|
|
2309
2338
|
...n
|
|
2310
|
-
}), { action:
|
|
2339
|
+
}), { action: h } = $r({ onClick: c });
|
|
2311
2340
|
return {
|
|
2312
2341
|
onClick: c,
|
|
2313
2342
|
title: r("_pages:common.actions.delete.dialog.title"),
|
|
2314
|
-
open:
|
|
2315
|
-
isLoading:
|
|
2343
|
+
open: a,
|
|
2344
|
+
isLoading: y,
|
|
2316
2345
|
handleSubmit: () => m.mutate(),
|
|
2317
|
-
handleClose:
|
|
2318
|
-
action:
|
|
2346
|
+
handleClose: l,
|
|
2347
|
+
action: h
|
|
2319
2348
|
};
|
|
2320
2349
|
}, ds = () => {
|
|
2321
2350
|
const [e, t] = X(!1);
|
|
@@ -2327,21 +2356,21 @@ const Dr = (e) => {
|
|
|
2327
2356
|
showSuccessNotification: i
|
|
2328
2357
|
} = ke(), {
|
|
2329
2358
|
defaultValues: r,
|
|
2330
|
-
getFunction:
|
|
2359
|
+
getFunction: a,
|
|
2331
2360
|
mutationFn: c,
|
|
2332
|
-
formToDto:
|
|
2361
|
+
formToDto: l,
|
|
2333
2362
|
dtoToForm: m,
|
|
2334
|
-
onError:
|
|
2335
|
-
onSuccess:
|
|
2336
|
-
queryKey:
|
|
2363
|
+
onError: y,
|
|
2364
|
+
onSuccess: h,
|
|
2365
|
+
queryKey: d,
|
|
2337
2366
|
onSuccessMessage: p,
|
|
2338
2367
|
title: _
|
|
2339
2368
|
} = e, [C, k] = X(0), { open: B, handleClose: N, handleOpen: $ } = ds(), { control: x, handleSubmit: A, reset: I, setError: M, getValues: se, setValue: P } = us({
|
|
2340
2369
|
defaultValues: r
|
|
2341
2370
|
}), { data: re, isLoading: ae } = Ys({
|
|
2342
|
-
queryFn: () =>
|
|
2343
|
-
queryKey: [...
|
|
2344
|
-
enabled: !!
|
|
2371
|
+
queryFn: () => a == null ? void 0 : a(C),
|
|
2372
|
+
queryKey: [...d, C],
|
|
2373
|
+
enabled: !!a && !!d && !!C
|
|
2345
2374
|
});
|
|
2346
2375
|
le(() => {
|
|
2347
2376
|
re && m && I({ ...m(re) });
|
|
@@ -2351,10 +2380,10 @@ const Dr = (e) => {
|
|
|
2351
2380
|
const Y = R == null ? void 0 : R.errors, ne = [];
|
|
2352
2381
|
return Y && Y.forEach(([ue, qe]) => {
|
|
2353
2382
|
const Ce = document.querySelector(`[name="${ue}"]`);
|
|
2354
|
-
(Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ne.push(t(`_entities:${
|
|
2383
|
+
(Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ne.push(t(`_entities:${d}.${ue}.${qe}`)));
|
|
2355
2384
|
}), ne;
|
|
2356
2385
|
},
|
|
2357
|
-
[t,
|
|
2386
|
+
[t, d]
|
|
2358
2387
|
), L = D(() => {
|
|
2359
2388
|
document.querySelectorAll("input, textarea, select").forEach((Y) => {
|
|
2360
2389
|
Y.classList.remove("error");
|
|
@@ -2369,7 +2398,7 @@ const Dr = (e) => {
|
|
|
2369
2398
|
}, [I, L, N]), z = Me({
|
|
2370
2399
|
mutationFn: c,
|
|
2371
2400
|
onError: (R) => {
|
|
2372
|
-
if (console.error(R),
|
|
2401
|
+
if (console.error(R), y) y(R);
|
|
2373
2402
|
else {
|
|
2374
2403
|
const Y = R;
|
|
2375
2404
|
if (Ge(Y)) {
|
|
@@ -2390,7 +2419,7 @@ const Dr = (e) => {
|
|
|
2390
2419
|
}
|
|
2391
2420
|
},
|
|
2392
2421
|
onSuccess: async (R) => {
|
|
2393
|
-
await pe.invalidateQueries({ queryKey:
|
|
2422
|
+
await pe.invalidateQueries({ queryKey: d }), h && h(R), i({
|
|
2394
2423
|
message: p
|
|
2395
2424
|
}), W();
|
|
2396
2425
|
}
|
|
@@ -2404,7 +2433,7 @@ const Dr = (e) => {
|
|
|
2404
2433
|
setValue: P,
|
|
2405
2434
|
handleSubmit: A,
|
|
2406
2435
|
onSubmit: (R) => z.mutate(
|
|
2407
|
-
|
|
2436
|
+
l ? l(R) : R
|
|
2408
2437
|
),
|
|
2409
2438
|
reset: I,
|
|
2410
2439
|
setError: M,
|
|
@@ -2412,10 +2441,10 @@ const Dr = (e) => {
|
|
|
2412
2441
|
isLoading: ae || z.isPending
|
|
2413
2442
|
};
|
|
2414
2443
|
}, xn = (e) => {
|
|
2415
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = ke(), { t: r } = V(), { open:
|
|
2444
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = ke(), { t: r } = V(), { open: a, onClick: c, close: l, dialogFn: m, isLoading: y } = ss({
|
|
2416
2445
|
onSuccessMessage: r("_pages:common.actions.restore.successMessage"),
|
|
2417
|
-
onError: (
|
|
2418
|
-
const p =
|
|
2446
|
+
onError: (d) => {
|
|
2447
|
+
const p = d;
|
|
2419
2448
|
if (Ge(p))
|
|
2420
2449
|
i(
|
|
2421
2450
|
p.errors.map(
|
|
@@ -2435,32 +2464,32 @@ const Dr = (e) => {
|
|
|
2435
2464
|
]);
|
|
2436
2465
|
}
|
|
2437
2466
|
},
|
|
2438
|
-
onSuccess: async (
|
|
2439
|
-
await pe.invalidateQueries({ queryKey: t }), s && s(
|
|
2467
|
+
onSuccess: async (d) => {
|
|
2468
|
+
await pe.invalidateQueries({ queryKey: t }), s && s(d);
|
|
2440
2469
|
},
|
|
2441
2470
|
...n
|
|
2442
|
-
}), { action:
|
|
2471
|
+
}), { action: h } = Lr({ onClick: c });
|
|
2443
2472
|
return {
|
|
2444
2473
|
onClick: c,
|
|
2445
2474
|
title: r("_pages:common.actions.restore.dialog.title"),
|
|
2446
|
-
open:
|
|
2447
|
-
isLoading:
|
|
2475
|
+
open: a,
|
|
2476
|
+
isLoading: y,
|
|
2448
2477
|
handleSubmit: () => m.mutate(),
|
|
2449
|
-
handleClose:
|
|
2450
|
-
action:
|
|
2478
|
+
handleClose: l,
|
|
2479
|
+
action: h
|
|
2451
2480
|
};
|
|
2452
2481
|
};
|
|
2453
2482
|
function Tn(e) {
|
|
2454
|
-
const { t } = V(), { queryKey: s, mutationFn: n, entity: i, fileProcessor: r, onError:
|
|
2483
|
+
const { t } = V(), { queryKey: s, mutationFn: n, entity: i, fileProcessor: r, onError: a } = e, [c, l] = X(!1), [m, y] = X(null), [h, d] = X(!1), p = Me({
|
|
2455
2484
|
mutationFn: n,
|
|
2456
2485
|
onError: (C) => {
|
|
2457
|
-
console.error(C),
|
|
2486
|
+
console.error(C), a == null || a(C);
|
|
2458
2487
|
},
|
|
2459
2488
|
onSuccess: async () => {
|
|
2460
2489
|
pe && await pe.invalidateQueries({ queryKey: s });
|
|
2461
2490
|
}
|
|
2462
2491
|
}), { action: _ } = Vr({
|
|
2463
|
-
onClick: () =>
|
|
2492
|
+
onClick: () => l(!0)
|
|
2464
2493
|
});
|
|
2465
2494
|
return {
|
|
2466
2495
|
handleSubmit: async () => {
|
|
@@ -2468,22 +2497,22 @@ function Tn(e) {
|
|
|
2468
2497
|
try {
|
|
2469
2498
|
await p.mutateAsync({
|
|
2470
2499
|
items: m,
|
|
2471
|
-
override:
|
|
2472
|
-
}),
|
|
2500
|
+
override: h
|
|
2501
|
+
}), l(!1), y(null), d(!1);
|
|
2473
2502
|
} catch (C) {
|
|
2474
2503
|
console.error(C);
|
|
2475
2504
|
}
|
|
2476
2505
|
},
|
|
2477
2506
|
isLoading: p.isPending,
|
|
2478
2507
|
fileProcessor: r,
|
|
2479
|
-
onFileProcessed: (C) =>
|
|
2480
|
-
onOverrideChange: (C) =>
|
|
2508
|
+
onFileProcessed: (C) => y(C),
|
|
2509
|
+
onOverrideChange: (C) => d(C),
|
|
2481
2510
|
open: c,
|
|
2482
2511
|
title: t("_pages:common.actions.import.dialog.title", {
|
|
2483
2512
|
entity: t(`_pages:${i}.title`)
|
|
2484
2513
|
}),
|
|
2485
2514
|
handleClose: () => {
|
|
2486
|
-
|
|
2515
|
+
l(!1), y(null);
|
|
2487
2516
|
},
|
|
2488
2517
|
action: _
|
|
2489
2518
|
};
|
|
@@ -2493,27 +2522,27 @@ const Fn = (e) => {
|
|
|
2493
2522
|
entity: n,
|
|
2494
2523
|
mutationFn: i,
|
|
2495
2524
|
onError: r,
|
|
2496
|
-
onSuccess:
|
|
2525
|
+
onSuccess: a,
|
|
2497
2526
|
onSuccessMessage: c = s("_pages:common.actions.export.successMessage")
|
|
2498
|
-
} = e,
|
|
2527
|
+
} = e, l = Me({
|
|
2499
2528
|
mutationFn: () => i(),
|
|
2500
|
-
onError: (
|
|
2501
|
-
console.error(
|
|
2529
|
+
onError: (h) => {
|
|
2530
|
+
console.error(h), r && r(h);
|
|
2502
2531
|
},
|
|
2503
|
-
onSuccess: async (
|
|
2504
|
-
const
|
|
2505
|
-
C.href = _, C.download = `${n}.json`, C.click(), URL.revokeObjectURL(_),
|
|
2532
|
+
onSuccess: async (h) => {
|
|
2533
|
+
const d = JSON.stringify(h, null, 2), p = new Blob([d], { type: "application/json" }), _ = URL.createObjectURL(p), C = document.createElement("a");
|
|
2534
|
+
C.href = _, C.download = `${n}.json`, C.click(), URL.revokeObjectURL(_), a && a(h), t({
|
|
2506
2535
|
message: c
|
|
2507
2536
|
});
|
|
2508
2537
|
}
|
|
2509
2538
|
}), m = D(() => {
|
|
2510
|
-
|
|
2511
|
-
}, [
|
|
2539
|
+
l.mutate();
|
|
2540
|
+
}, [l]), { action: y } = Dr({
|
|
2512
2541
|
onClick: m,
|
|
2513
|
-
isLoading:
|
|
2542
|
+
isLoading: l.isPending
|
|
2514
2543
|
});
|
|
2515
2544
|
return {
|
|
2516
|
-
action:
|
|
2545
|
+
action: y
|
|
2517
2546
|
};
|
|
2518
2547
|
};
|
|
2519
2548
|
function Ir(e) {
|
|
@@ -2553,18 +2582,18 @@ const Pr = (e) => {
|
|
|
2553
2582
|
addOptions: n,
|
|
2554
2583
|
filterOptions: i,
|
|
2555
2584
|
actions: r,
|
|
2556
|
-
queryKey:
|
|
2585
|
+
queryKey: a,
|
|
2557
2586
|
isLoading: c = !1,
|
|
2558
|
-
isAnimated:
|
|
2587
|
+
isAnimated: l = !0,
|
|
2559
2588
|
showBackButton: m = !1
|
|
2560
|
-
} = e, { t:
|
|
2589
|
+
} = e, { t: y } = V(), { countOfFilters: h } = $s(), d = Ae(() => {
|
|
2561
2590
|
const p = Array.isArray(r) ? [...r] : [];
|
|
2562
|
-
if (
|
|
2591
|
+
if (a) {
|
|
2563
2592
|
const _ = {
|
|
2564
2593
|
id: _e.Refresh,
|
|
2565
|
-
onClick: () => pe.invalidateQueries({ queryKey:
|
|
2594
|
+
onClick: () => pe.invalidateQueries({ queryKey: a }),
|
|
2566
2595
|
icon: /* @__PURE__ */ g(ce, { icon: Bt }),
|
|
2567
|
-
tooltip:
|
|
2596
|
+
tooltip: y("_pages:common.actions.refresh.text")
|
|
2568
2597
|
};
|
|
2569
2598
|
p.unshift(_);
|
|
2570
2599
|
}
|
|
@@ -2584,25 +2613,25 @@ const Pr = (e) => {
|
|
|
2584
2613
|
children: /* @__PURE__ */ g(
|
|
2585
2614
|
Ls,
|
|
2586
2615
|
{
|
|
2587
|
-
className: `${
|
|
2588
|
-
count:
|
|
2616
|
+
className: `${h > 0 ? "show" : "hide"} `,
|
|
2617
|
+
count: h
|
|
2589
2618
|
}
|
|
2590
2619
|
)
|
|
2591
2620
|
};
|
|
2592
2621
|
p.push(_);
|
|
2593
2622
|
}
|
|
2594
2623
|
return p;
|
|
2595
|
-
}, [r, n,
|
|
2624
|
+
}, [r, n, h, i, a, y]);
|
|
2596
2625
|
return /* @__PURE__ */ T("main", { className: "page-main", children: [
|
|
2597
2626
|
/* @__PURE__ */ g(
|
|
2598
2627
|
Pr,
|
|
2599
2628
|
{
|
|
2600
2629
|
showBackButton: m,
|
|
2601
|
-
actions:
|
|
2630
|
+
actions: d,
|
|
2602
2631
|
title: t
|
|
2603
2632
|
}
|
|
2604
2633
|
),
|
|
2605
|
-
/* @__PURE__ */ g("div", { className: `page-main-content ${
|
|
2634
|
+
/* @__PURE__ */ g("div", { className: `page-main-content ${l ? "appear" : ""}`, children: c ? /* @__PURE__ */ g(xe, { className: "page-loading" }) : s }),
|
|
2606
2635
|
n && /* @__PURE__ */ g(
|
|
2607
2636
|
Se,
|
|
2608
2637
|
{
|
|
@@ -2623,11 +2652,11 @@ const Pr = (e) => {
|
|
|
2623
2652
|
itemClassName: n = "",
|
|
2624
2653
|
loading: i = !1,
|
|
2625
2654
|
emptyComponent: r = null,
|
|
2626
|
-
emptyMessage:
|
|
2655
|
+
emptyMessage: a = t("_accessibility:messages.empty"),
|
|
2627
2656
|
renderComponent: c,
|
|
2628
|
-
data:
|
|
2657
|
+
data: l = []
|
|
2629
2658
|
} = e;
|
|
2630
|
-
return i ? /* @__PURE__ */ g(xe, {}) : /* @__PURE__ */ g(Ve, { children:
|
|
2659
|
+
return i ? /* @__PURE__ */ g(xe, {}) : /* @__PURE__ */ g(Ve, { children: l != null && l.length ? /* @__PURE__ */ g("ul", { className: `pretty-grid-main ${s}`, children: l == null ? void 0 : l.map((m) => /* @__PURE__ */ g("li", { className: `pretty-grid-item ${n}`, children: c(m) }, m.id)) }) : /* @__PURE__ */ g(Ve, { children: r || /* @__PURE__ */ g(jr, { message: a }) }) });
|
|
2631
2660
|
}, Or = () => {
|
|
2632
2661
|
const [e, t] = X(Nt());
|
|
2633
2662
|
return le(() => {
|
|
@@ -2647,15 +2676,15 @@ function Dn(e) {
|
|
|
2647
2676
|
showClock: n = !0,
|
|
2648
2677
|
showSearch: i = !0,
|
|
2649
2678
|
menuButtonProps: r
|
|
2650
|
-
} = e, { searchComponent:
|
|
2651
|
-
(ar() ?
|
|
2679
|
+
} = e, { searchComponent: a, location: c } = Re(), [l, m] = X(!1), y = D((d) => {
|
|
2680
|
+
(ar() ? d.metaKey : d.ctrlKey) && d.shiftKey && d.key.toLowerCase() === "f" && (m(!0), d.preventDefault());
|
|
2652
2681
|
}, []);
|
|
2653
|
-
le(() => (window.addEventListener("keydown",
|
|
2654
|
-
window.removeEventListener("keydown",
|
|
2655
|
-
}), [
|
|
2656
|
-
const
|
|
2682
|
+
le(() => (window.addEventListener("keydown", y), () => {
|
|
2683
|
+
window.removeEventListener("keydown", y);
|
|
2684
|
+
}), [y]);
|
|
2685
|
+
const h = a;
|
|
2657
2686
|
return /* @__PURE__ */ T(Ve, { children: [
|
|
2658
|
-
c.pathname !== "/" && !!
|
|
2687
|
+
c.pathname !== "/" && !!h && /* @__PURE__ */ g(h, { open: l, onClose: () => m(!1) }),
|
|
2659
2688
|
/* @__PURE__ */ T("header", { id: "header", className: "header", children: [
|
|
2660
2689
|
/* @__PURE__ */ T("div", { className: "navbar-left", children: [
|
|
2661
2690
|
/* @__PURE__ */ g(
|
|
@@ -2664,9 +2693,9 @@ function Dn(e) {
|
|
|
2664
2693
|
...r,
|
|
2665
2694
|
type: (r == null ? void 0 : r.type) ?? "button",
|
|
2666
2695
|
icon: (r == null ? void 0 : r.icon) ?? Qs,
|
|
2667
|
-
onClick: (
|
|
2696
|
+
onClick: (d) => {
|
|
2668
2697
|
var p;
|
|
2669
|
-
(p = r == null ? void 0 : r.onClick) == null || p.call(r,
|
|
2698
|
+
(p = r == null ? void 0 : r.onClick) == null || p.call(r, d), s();
|
|
2670
2699
|
},
|
|
2671
2700
|
name: (r == null ? void 0 : r.name) ?? t("_accessibility:buttons.openMenu"),
|
|
2672
2701
|
"aria-label": (r == null ? void 0 : r["aria-label"]) ?? t("_accessibility:ariaLabels.openMenu"),
|
|
@@ -2694,44 +2723,44 @@ var rt, Rt;
|
|
|
2694
2723
|
function Mr() {
|
|
2695
2724
|
if (Rt) return rt;
|
|
2696
2725
|
Rt = 1;
|
|
2697
|
-
const e = (c,
|
|
2698
|
-
if (
|
|
2726
|
+
const e = (c, l = "local", m = void 0) => {
|
|
2727
|
+
if (l === "local") {
|
|
2699
2728
|
if (localStorage.getItem(c) !== void 0 && localStorage.getItem(c) !== "undefined" && localStorage.getItem(c) !== null)
|
|
2700
2729
|
return m === void 0 || m !== void 0 && localStorage.getItem(c) === m;
|
|
2701
|
-
} else if (
|
|
2730
|
+
} else if (l === "session" && sessionStorage.getItem(c) !== void 0 && sessionStorage.getItem(c) !== "undefined" && sessionStorage.getItem(c) !== null)
|
|
2702
2731
|
return m === void 0 || m !== void 0 && sessionStorage.getItem(c) === m;
|
|
2703
2732
|
return !1;
|
|
2704
2733
|
}, t = (c) => {
|
|
2705
|
-
const
|
|
2706
|
-
return c.substring(1).split("&").forEach((
|
|
2707
|
-
const [
|
|
2708
|
-
|
|
2709
|
-
}),
|
|
2734
|
+
const l = {};
|
|
2735
|
+
return c.substring(1).split("&").forEach((y) => {
|
|
2736
|
+
const [h, d] = y.split("=");
|
|
2737
|
+
l[h] = d;
|
|
2738
|
+
}), l;
|
|
2710
2739
|
}, s = (c = "") => {
|
|
2711
2740
|
if (r(c) && c.length) return r(c);
|
|
2712
2741
|
{
|
|
2713
|
-
let
|
|
2714
|
-
if (
|
|
2715
|
-
return c.length && i(c, 730,
|
|
2742
|
+
let l = navigator.language || navigator.userLanguage;
|
|
2743
|
+
if (l.indexOf("en") < 0 && l.indexOf("es") < 0 && (l = "en-US"), l = l.split("-")[0], l)
|
|
2744
|
+
return c.length && i(c, 730, l), l;
|
|
2716
2745
|
}
|
|
2717
2746
|
return "en";
|
|
2718
|
-
}, n = (c = 0,
|
|
2747
|
+
}, n = (c = 0, l = 0, m = window, y = "smooth") => m.scroll({
|
|
2719
2748
|
top: c,
|
|
2720
|
-
left:
|
|
2721
|
-
behavior:
|
|
2722
|
-
}), i = (c,
|
|
2723
|
-
var
|
|
2724
|
-
|
|
2725
|
-
const p = "; expires=" +
|
|
2726
|
-
document.cookie = `${c}=${m || ""}${p};path=${
|
|
2749
|
+
left: l,
|
|
2750
|
+
behavior: y
|
|
2751
|
+
}), i = (c, l, m, y = "/", h = "Lax") => {
|
|
2752
|
+
var d = /* @__PURE__ */ new Date();
|
|
2753
|
+
d.setTime(d.getTime() + l * 24 * 60 * 60 * 1e3);
|
|
2754
|
+
const p = "; expires=" + d.toUTCString();
|
|
2755
|
+
document.cookie = `${c}=${m || ""}${p};path=${y};SameSite=${h}`;
|
|
2727
2756
|
}, r = (c) => {
|
|
2728
|
-
const
|
|
2729
|
-
for (let
|
|
2730
|
-
let
|
|
2731
|
-
for (;
|
|
2732
|
-
|
|
2733
|
-
if (
|
|
2734
|
-
return
|
|
2757
|
+
const l = `${c}=`, y = decodeURIComponent(document.cookie).split(";");
|
|
2758
|
+
for (let h = 0; h < y.length; h += 1) {
|
|
2759
|
+
let d = y[h];
|
|
2760
|
+
for (; d.charAt(0) === " "; )
|
|
2761
|
+
d = d.substring(1);
|
|
2762
|
+
if (d.indexOf(l) === 0)
|
|
2763
|
+
return d.substring(l.length, d.length);
|
|
2735
2764
|
}
|
|
2736
2765
|
return "";
|
|
2737
2766
|
};
|
|
@@ -2795,79 +2824,79 @@ function In() {
|
|
|
2795
2824
|
Is(() => {
|
|
2796
2825
|
r.current = n;
|
|
2797
2826
|
});
|
|
2798
|
-
const
|
|
2799
|
-
(
|
|
2827
|
+
const a = Ie(null), c = D(
|
|
2828
|
+
(l) => {
|
|
2800
2829
|
i(
|
|
2801
|
-
(m) =>
|
|
2802
|
-
),
|
|
2803
|
-
s(
|
|
2804
|
-
}, Be) : (
|
|
2805
|
-
s(), i([]),
|
|
2830
|
+
(m) => l !== void 0 ? m.map((y) => y.id === l ? { ...y, closing: !0 } : y) : m.map((y) => ({ ...y, closing: !0 }))
|
|
2831
|
+
), l !== void 0 ? setTimeout(() => {
|
|
2832
|
+
s(l), i((m) => m.filter((y) => y.id !== l));
|
|
2833
|
+
}, Be) : (a.current && clearTimeout(a.current), a.current = setTimeout(() => {
|
|
2834
|
+
s(), i([]), a.current = null;
|
|
2806
2835
|
}, Be));
|
|
2807
2836
|
},
|
|
2808
2837
|
[s]
|
|
2809
2838
|
);
|
|
2810
2839
|
return le(() => {
|
|
2811
|
-
let
|
|
2840
|
+
let l = null;
|
|
2812
2841
|
const m = () => {
|
|
2813
|
-
|
|
2842
|
+
l && clearTimeout(l), a.current && (clearTimeout(a.current), a.current = null);
|
|
2814
2843
|
};
|
|
2815
2844
|
if (t.length === 0)
|
|
2816
|
-
return r.current.length === 0 ? void 0 : (
|
|
2817
|
-
i((p) => p.map((_) => ({ ..._, closing: !0 }))),
|
|
2818
|
-
}, 0),
|
|
2819
|
-
i([]),
|
|
2845
|
+
return r.current.length === 0 ? void 0 : (a.current && clearTimeout(a.current), l = setTimeout(() => {
|
|
2846
|
+
i((p) => p.map((_) => ({ ..._, closing: !0 }))), l = null;
|
|
2847
|
+
}, 0), a.current = setTimeout(() => {
|
|
2848
|
+
i([]), a.current = null;
|
|
2820
2849
|
}, Be), m);
|
|
2821
|
-
const
|
|
2850
|
+
const y = new Set(r.current.map((p) => p.id));
|
|
2822
2851
|
if (!t.some(
|
|
2823
|
-
(p) => p.id !== void 0 && !
|
|
2852
|
+
(p) => p.id !== void 0 && !y.has(p.id)
|
|
2824
2853
|
)) return;
|
|
2825
2854
|
if (r.current.length === 0) {
|
|
2826
2855
|
const p = [...t];
|
|
2827
|
-
return
|
|
2828
|
-
i(p.map((_) => ({ ..._, closing: !1 }))),
|
|
2856
|
+
return l = setTimeout(() => {
|
|
2857
|
+
i(p.map((_) => ({ ..._, closing: !1 }))), l = null;
|
|
2829
2858
|
}, 0), () => {
|
|
2830
|
-
|
|
2859
|
+
l && clearTimeout(l);
|
|
2831
2860
|
};
|
|
2832
2861
|
}
|
|
2833
|
-
|
|
2862
|
+
a.current && clearTimeout(a.current), l = setTimeout(() => {
|
|
2834
2863
|
i(
|
|
2835
2864
|
(p) => p.every((_) => _.closing) ? p : p.map((_) => ({ ..._, closing: !0 }))
|
|
2836
|
-
),
|
|
2865
|
+
), l = null;
|
|
2837
2866
|
}, 0);
|
|
2838
|
-
const
|
|
2839
|
-
return
|
|
2840
|
-
i(
|
|
2867
|
+
const d = [...t];
|
|
2868
|
+
return a.current = setTimeout(() => {
|
|
2869
|
+
i(d.map((p) => ({ ...p, closing: !1 }))), a.current = null;
|
|
2841
2870
|
}, Be), m;
|
|
2842
2871
|
}, [t]), le(() => {
|
|
2843
2872
|
if (!n.length) return;
|
|
2844
|
-
let
|
|
2873
|
+
let l;
|
|
2845
2874
|
const m = window.setTimeout(() => {
|
|
2846
|
-
|
|
2847
|
-
}, 0),
|
|
2848
|
-
|
|
2875
|
+
l = () => c(), window.addEventListener("click", l);
|
|
2876
|
+
}, 0), y = (h) => {
|
|
2877
|
+
h.key === "Escape" && c();
|
|
2849
2878
|
};
|
|
2850
|
-
return window.addEventListener("keydown",
|
|
2851
|
-
window.clearTimeout(m),
|
|
2879
|
+
return window.addEventListener("keydown", y), () => {
|
|
2880
|
+
window.clearTimeout(m), l && window.removeEventListener("click", l), window.removeEventListener("keydown", y);
|
|
2852
2881
|
};
|
|
2853
2882
|
}, [n.length, c]), Kt(
|
|
2854
|
-
/* @__PURE__ */ g("div", { className: `notification-portal ${n.length ? "active" : ""}`, children: n.map(({ id:
|
|
2855
|
-
const
|
|
2883
|
+
/* @__PURE__ */ g("div", { className: `notification-portal ${n.length ? "active" : ""}`, children: n.map(({ id: l, type: m, message: y, closing: h }) => {
|
|
2884
|
+
const d = Ur(m);
|
|
2856
2885
|
return /* @__PURE__ */ T(
|
|
2857
2886
|
"div",
|
|
2858
2887
|
{
|
|
2859
|
-
className: `notification ${
|
|
2888
|
+
className: `notification ${h ? "closing" : ""} ${Hr(d)}`,
|
|
2860
2889
|
onClick: (p) => p.stopPropagation(),
|
|
2861
2890
|
children: [
|
|
2862
2891
|
/* @__PURE__ */ T("div", { className: "notification-body", children: [
|
|
2863
2892
|
/* @__PURE__ */ g(
|
|
2864
2893
|
ce,
|
|
2865
2894
|
{
|
|
2866
|
-
icon: qr(
|
|
2867
|
-
className: `notification-icon ${nt(
|
|
2895
|
+
icon: qr(d),
|
|
2896
|
+
className: `notification-icon ${nt(d)}`
|
|
2868
2897
|
}
|
|
2869
2898
|
),
|
|
2870
|
-
/* @__PURE__ */ g("p", { className: `notification-text ${nt(
|
|
2899
|
+
/* @__PURE__ */ g("p", { className: `notification-text ${nt(d)}`, children: y })
|
|
2871
2900
|
] }),
|
|
2872
2901
|
/* @__PURE__ */ g(
|
|
2873
2902
|
Se,
|
|
@@ -2877,16 +2906,16 @@ function In() {
|
|
|
2877
2906
|
color: "error",
|
|
2878
2907
|
className: "notification-close group",
|
|
2879
2908
|
onClick: (p) => {
|
|
2880
|
-
p.stopPropagation(),
|
|
2909
|
+
p.stopPropagation(), l !== void 0 && c(l);
|
|
2881
2910
|
},
|
|
2882
|
-
iconClassName: `${nt(
|
|
2911
|
+
iconClassName: `${nt(d)} notification-close-icon`,
|
|
2883
2912
|
name: e("_accessibility:buttons.closeNotification"),
|
|
2884
2913
|
"aria-label": e("_accessibility:ariaLabels.closeNotification")
|
|
2885
2914
|
}
|
|
2886
2915
|
)
|
|
2887
2916
|
]
|
|
2888
2917
|
},
|
|
2889
|
-
|
|
2918
|
+
l
|
|
2890
2919
|
);
|
|
2891
2920
|
}) }),
|
|
2892
2921
|
document.body
|
|
@@ -2897,9 +2926,9 @@ function Pn(e) {
|
|
|
2897
2926
|
return /* @__PURE__ */ g("div", { className: "splash-screen", children: /* @__PURE__ */ g(xe, { className: `blur-appear ${t ? ` ${t}` : ""}`, ...s }) });
|
|
2898
2927
|
}
|
|
2899
2928
|
const Br = (e) => {
|
|
2900
|
-
const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent:
|
|
2929
|
+
const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent: a } = Re();
|
|
2901
2930
|
return /* @__PURE__ */ g(
|
|
2902
|
-
|
|
2931
|
+
a,
|
|
2903
2932
|
{
|
|
2904
2933
|
to: r ?? `#${t}`,
|
|
2905
2934
|
onClick: () => n(),
|
|
@@ -2908,27 +2937,27 @@ const Br = (e) => {
|
|
|
2908
2937
|
}
|
|
2909
2938
|
);
|
|
2910
2939
|
}, Qr = (e) => {
|
|
2911
|
-
var
|
|
2940
|
+
var l;
|
|
2912
2941
|
const {
|
|
2913
2942
|
tabs: t = [],
|
|
2914
2943
|
defaultTab: s,
|
|
2915
2944
|
className: n = "",
|
|
2916
2945
|
tabsContainerClassName: i = ""
|
|
2917
|
-
} = e, [r,
|
|
2946
|
+
} = e, [r, a] = X(s ?? ((l = t[0]) == null ? void 0 : l.id)), c = Ae(() => t.find((m) => m.id === r), [t, r]);
|
|
2918
2947
|
return /* @__PURE__ */ T("div", { className: `tabs-layout-main ${n}`, children: [
|
|
2919
2948
|
/* @__PURE__ */ g(
|
|
2920
2949
|
"ul",
|
|
2921
2950
|
{
|
|
2922
2951
|
className: `horizontal tabs tabs-container ${i}`,
|
|
2923
|
-
children: t.map(({ id: m, to:
|
|
2952
|
+
children: t.map(({ id: m, to: y, label: h }) => /* @__PURE__ */ g("li", { children: /* @__PURE__ */ g(
|
|
2924
2953
|
Br,
|
|
2925
2954
|
{
|
|
2926
|
-
onClick: () =>
|
|
2955
|
+
onClick: () => a(m),
|
|
2927
2956
|
id: m,
|
|
2928
|
-
to:
|
|
2957
|
+
to: y ?? "",
|
|
2929
2958
|
siblings: t.length > 1,
|
|
2930
2959
|
active: r === m,
|
|
2931
|
-
children:
|
|
2960
|
+
children: h
|
|
2932
2961
|
}
|
|
2933
2962
|
) }, m))
|
|
2934
2963
|
}
|
|
@@ -2942,11 +2971,11 @@ const Br = (e) => {
|
|
|
2942
2971
|
image: n = "",
|
|
2943
2972
|
alt: i = "",
|
|
2944
2973
|
final: r = !1
|
|
2945
|
-
} = e, { setGuestMode:
|
|
2974
|
+
} = e, { setGuestMode: a } = Zt(), { navigate: c } = Re(), { t: l } = V();
|
|
2946
2975
|
return /* @__PURE__ */ T("div", { className: "big-appear step-container", children: [
|
|
2947
2976
|
n && /* @__PURE__ */ g("img", { src: n, alt: i }),
|
|
2948
|
-
/* @__PURE__ */ g("h2", { className: "step-title", children:
|
|
2949
|
-
/* @__PURE__ */ g("p", { className: "step-body", children:
|
|
2977
|
+
/* @__PURE__ */ g("h2", { className: "step-title", children: l(`_pages:onboarding.${t}.title`) }),
|
|
2978
|
+
/* @__PURE__ */ g("p", { className: "step-body", children: l(`_pages:onboarding.${t}.body`) }),
|
|
2950
2979
|
/* @__PURE__ */ g("div", { className: "step-actions", children: r ? /* @__PURE__ */ T(Ve, { children: [
|
|
2951
2980
|
/* @__PURE__ */ g(
|
|
2952
2981
|
we,
|
|
@@ -2955,10 +2984,10 @@ const Br = (e) => {
|
|
|
2955
2984
|
className: "step-button",
|
|
2956
2985
|
variant: "outlined",
|
|
2957
2986
|
onClick: () => {
|
|
2958
|
-
|
|
2987
|
+
a(!0), c("/");
|
|
2959
2988
|
},
|
|
2960
|
-
"aria-label":
|
|
2961
|
-
children:
|
|
2989
|
+
"aria-label": l("_accessibility:ariaLabels.start"),
|
|
2990
|
+
children: l("_accessibility:buttons.startAsGuest")
|
|
2962
2991
|
}
|
|
2963
2992
|
),
|
|
2964
2993
|
/* @__PURE__ */ g(
|
|
@@ -2967,9 +2996,9 @@ const Br = (e) => {
|
|
|
2967
2996
|
color: "primary",
|
|
2968
2997
|
variant: "submit",
|
|
2969
2998
|
className: "step-button",
|
|
2970
|
-
"aria-label":
|
|
2999
|
+
"aria-label": l("_accessibility:ariaLabels.start"),
|
|
2971
3000
|
onClick: () => c("/auth/sign-in"),
|
|
2972
|
-
children:
|
|
3001
|
+
children: l("_accessibility:buttons.signIn")
|
|
2973
3002
|
}
|
|
2974
3003
|
)
|
|
2975
3004
|
] }) : /* @__PURE__ */ T(Ve, { children: [
|
|
@@ -2980,8 +3009,8 @@ const Br = (e) => {
|
|
|
2980
3009
|
className: "step-button",
|
|
2981
3010
|
variant: "outlined",
|
|
2982
3011
|
onClick: () => c("/auth/sign-in"),
|
|
2983
|
-
"aria-label":
|
|
2984
|
-
children:
|
|
3012
|
+
"aria-label": l("_accessibility:ariaLabels.skip"),
|
|
3013
|
+
children: l("_accessibility:buttons.skip")
|
|
2985
3014
|
}
|
|
2986
3015
|
),
|
|
2987
3016
|
/* @__PURE__ */ g(
|
|
@@ -2991,21 +3020,21 @@ const Br = (e) => {
|
|
|
2991
3020
|
className: "step-button",
|
|
2992
3021
|
variant: "outlined",
|
|
2993
3022
|
onClick: () => s(),
|
|
2994
|
-
"aria-label":
|
|
2995
|
-
children:
|
|
3023
|
+
"aria-label": l("_accessibility:ariaLabels.next"),
|
|
3024
|
+
children: l("_accessibility:buttons.next")
|
|
2996
3025
|
}
|
|
2997
3026
|
)
|
|
2998
3027
|
] }) })
|
|
2999
3028
|
] });
|
|
3000
3029
|
}, On = (e) => {
|
|
3001
|
-
const { steps: t } = e, [s, n] = X(1), i = Ae(() => t.map((r,
|
|
3002
|
-
id:
|
|
3030
|
+
const { steps: t } = e, [s, n] = X(1), i = Ae(() => t.map((r, a) => ({
|
|
3031
|
+
id: a + 1,
|
|
3003
3032
|
label: "",
|
|
3004
3033
|
content: /* @__PURE__ */ g(
|
|
3005
3034
|
Kr,
|
|
3006
3035
|
{
|
|
3007
3036
|
translation: r,
|
|
3008
|
-
final:
|
|
3037
|
+
final: a === t.length - 1,
|
|
3009
3038
|
onClickNext: () => n((c) => c + 1)
|
|
3010
3039
|
}
|
|
3011
3040
|
)
|