@sito/dashboard-app 0.0.40 → 0.0.41
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/dist/dashboard-app.cjs +1 -1
- package/dist/dashboard-app.js +644 -638
- package/dist/hooks/actions/PrefabActions.stories.d.ts +12 -0
- package/dist/main.css +1 -1
- package/package.json +1 -1
package/dist/dashboard-app.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var me = (e, t, s) =>
|
|
1
|
+
var Cs = Object.defineProperty;
|
|
2
|
+
var Es = (e, t, s) => t in e ? Cs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var me = (e, t, s) => Es(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
4
|
import "./main.css";
|
|
5
|
-
import { IconButton as
|
|
5
|
+
import { IconButton as Ns, useTranslation as D, Dropdown as ks, State as As, inputStateClassName as xs, labelStateClassName as Ts, helperTextStateClassName as $s, Button as _e, Loading as xe, TextInput as Fs, FileInput as Ls, useTableOptions as Ds, Badge as Vs } from "@sito/dashboard";
|
|
6
6
|
export * from "@sito/dashboard";
|
|
7
7
|
import { Button as Bn } from "@sito/dashboard";
|
|
8
|
-
import { jsxs as
|
|
8
|
+
import { jsxs as x, jsx as h, Fragment as Ve } from "react/jsx-runtime";
|
|
9
9
|
import { FontAwesomeIcon as ce } from "@fortawesome/react-fontawesome";
|
|
10
|
-
import ie, { useCallback as
|
|
11
|
-
import { faTrash as
|
|
12
|
-
import { createPortal as
|
|
13
|
-
import { QueryClient as
|
|
14
|
-
import { faSadTear as
|
|
15
|
-
function
|
|
10
|
+
import ie, { useCallback as V, useRef as Ie, useReducer as Ut, createContext as Pe, useContext as Oe, useState as J, useMemo as Ae, useEffect as le, forwardRef as qt, useLayoutEffect as Is } from "react";
|
|
11
|
+
import { faTrash as Ps, faRotateLeft as Ht, faPencil as Os, faCircleNotch as Bt, faCloudArrowDown as Ms, faCloudUpload as Rs, faArrowUp as Us, faEllipsisV as qs, faEyeSlash as Hs, faEye as Bs, faClose as Qt, faArrowLeft as Qs, faAdd as St, faFilter as Ks, faBars as js, faSearch as Ws, faCircleCheck as Gs, faWarning as Js } from "@fortawesome/free-solid-svg-icons";
|
|
12
|
+
import { createPortal as Kt } from "react-dom";
|
|
13
|
+
import { QueryClient as zs, QueryClientProvider as Ys, useMutation as Me, useQuery as Xs } from "@tanstack/react-query";
|
|
14
|
+
import { faSadTear as Zs } from "@fortawesome/free-regular-svg-icons";
|
|
15
|
+
function jt(e) {
|
|
16
16
|
const {
|
|
17
17
|
id: t,
|
|
18
18
|
icon: s,
|
|
@@ -25,7 +25,7 @@ function Kt(e) {
|
|
|
25
25
|
showTooltips: m = !0,
|
|
26
26
|
className: y = ""
|
|
27
27
|
} = e;
|
|
28
|
-
return a ? null : /* @__PURE__ */
|
|
28
|
+
return a ? null : /* @__PURE__ */ x(
|
|
29
29
|
"button",
|
|
30
30
|
{
|
|
31
31
|
id: t,
|
|
@@ -44,7 +44,7 @@ function Kt(e) {
|
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Wt(e) {
|
|
48
48
|
const {
|
|
49
49
|
actions: t = [],
|
|
50
50
|
className: s = "",
|
|
@@ -58,7 +58,7 @@ function jt(e) {
|
|
|
58
58
|
{
|
|
59
59
|
className: `actions-container-item ${n}`,
|
|
60
60
|
children: /* @__PURE__ */ h(
|
|
61
|
-
|
|
61
|
+
jt,
|
|
62
62
|
{
|
|
63
63
|
showTooltips: r,
|
|
64
64
|
showText: a,
|
|
@@ -70,9 +70,9 @@ function jt(e) {
|
|
|
70
70
|
c.id
|
|
71
71
|
)) });
|
|
72
72
|
}
|
|
73
|
-
const pe = ({ icon: e, ...t }) => /* @__PURE__ */ h(
|
|
73
|
+
const pe = ({ icon: e, ...t }) => /* @__PURE__ */ h(Ns, { icon: /* @__PURE__ */ h(ce, { icon: e }), ...t });
|
|
74
74
|
var st, Ct;
|
|
75
|
-
function
|
|
75
|
+
function er() {
|
|
76
76
|
if (Ct) return st;
|
|
77
77
|
Ct = 1;
|
|
78
78
|
const e = (c, l = "local", m = void 0) => {
|
|
@@ -126,10 +126,10 @@ function Zs() {
|
|
|
126
126
|
validation: e
|
|
127
127
|
}, st;
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
const { t: e, language: t } =
|
|
132
|
-
return { timeAge:
|
|
129
|
+
var tr = er();
|
|
130
|
+
function on() {
|
|
131
|
+
const { t: e, language: t } = D();
|
|
132
|
+
return { timeAge: V(
|
|
133
133
|
(n) => {
|
|
134
134
|
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"), g = e("_accessibility:labels.minutes"), f = e("_accessibility:labels.hour"), p = e("_accessibility:labels.hours"), _ = e("_accessibility:labels.yesterday"), C = e("_accessibility:labels.justNow");
|
|
135
135
|
return r < 1e3 * 60 ? C : a < 60 ? `${l ? m : ""} ${a} ${a === 1 ? y : g} ${l ? "" : m}` : c < 24 ? `${l ? m : ""} ${c} ${c === 1 ? f : p} ${l ? "" : m}` : c < 48 ? _ : n.toLocaleDateString(navigator.language || "es-ES", {
|
|
@@ -141,7 +141,7 @@ function an() {
|
|
|
141
141
|
[e, t]
|
|
142
142
|
) };
|
|
143
143
|
}
|
|
144
|
-
var
|
|
144
|
+
var z = /* @__PURE__ */ ((e) => (e[e.success = 0] = "success", e[e.error = 1] = "error", e[e.warning = 2] = "warning", e[e.info = 3] = "info", e))(z || {}), te = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.PATCH = "PATCH", e.DELETE = "DELETE", e))(te || {});
|
|
145
145
|
async function Te(e, t = "GET", s, n) {
|
|
146
146
|
const i = {
|
|
147
147
|
...s ? { "Content-Type": "application/json" } : {},
|
|
@@ -186,7 +186,7 @@ async function Te(e, t = "GET", s, n) {
|
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function sr(e, t) {
|
|
190
190
|
if (t) {
|
|
191
191
|
const s = Object.entries(t).filter(([, n]) => n != null).map(
|
|
192
192
|
([n, i]) => `${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`
|
|
@@ -195,7 +195,7 @@ function tr(e, t) {
|
|
|
195
195
|
}
|
|
196
196
|
return e;
|
|
197
197
|
}
|
|
198
|
-
const
|
|
198
|
+
const Gt = (e, t, s) => {
|
|
199
199
|
const n = [];
|
|
200
200
|
if (t) {
|
|
201
201
|
const { sortingBy: i, sortingOrder: r, currentPage: a, pageSize: c } = t;
|
|
@@ -222,7 +222,7 @@ const Wt = (e, t, s) => {
|
|
|
222
222
|
}
|
|
223
223
|
return n.length ? `${e}?${n.join("&")}` : e;
|
|
224
224
|
};
|
|
225
|
-
class
|
|
225
|
+
class Jt {
|
|
226
226
|
/**
|
|
227
227
|
* @param baseUrl the base url of the server
|
|
228
228
|
* @param userKey the local storage user key
|
|
@@ -238,7 +238,7 @@ class Gt {
|
|
|
238
238
|
}
|
|
239
239
|
defaultTokenAcquirer(t) {
|
|
240
240
|
if (t) return { credentials: "include" };
|
|
241
|
-
const s =
|
|
241
|
+
const s = zt(this.userKey);
|
|
242
242
|
if (s && s.length)
|
|
243
243
|
return { Authorization: `Bearer ${s}` };
|
|
244
244
|
}
|
|
@@ -266,7 +266,7 @@ class Gt {
|
|
|
266
266
|
* @returns Result list
|
|
267
267
|
*/
|
|
268
268
|
async get(t, s, n) {
|
|
269
|
-
const i =
|
|
269
|
+
const i = Gt(t, s, n), r = this.secured ? this.tokenAcquirer() : void 0, { data: a, error: c } = await Te(
|
|
270
270
|
`${this.baseUrl}${i}`,
|
|
271
271
|
te.GET,
|
|
272
272
|
null,
|
|
@@ -335,10 +335,10 @@ class Gt {
|
|
|
335
335
|
return r;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
class
|
|
338
|
+
class rr {
|
|
339
339
|
constructor(t, s = "user") {
|
|
340
340
|
me(this, "api");
|
|
341
|
-
this.api = new
|
|
341
|
+
this.api = new Jt(t, s, !1);
|
|
342
342
|
}
|
|
343
343
|
async login(t) {
|
|
344
344
|
const s = "auth/sign-in", n = t;
|
|
@@ -364,10 +364,10 @@ class sr {
|
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
class
|
|
367
|
+
class cn {
|
|
368
368
|
constructor(t, s) {
|
|
369
369
|
me(this, "auth");
|
|
370
|
-
this.auth = new
|
|
370
|
+
this.auth = new rr(t, s);
|
|
371
371
|
}
|
|
372
372
|
/**
|
|
373
373
|
* @returns auth
|
|
@@ -376,7 +376,7 @@ class on {
|
|
|
376
376
|
return this.auth;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
class
|
|
379
|
+
class ln {
|
|
380
380
|
/**
|
|
381
381
|
*
|
|
382
382
|
* @param table
|
|
@@ -386,7 +386,7 @@ class cn {
|
|
|
386
386
|
me(this, "table");
|
|
387
387
|
me(this, "secured");
|
|
388
388
|
me(this, "api");
|
|
389
|
-
this.table = t, this.secured = i, this.api = new
|
|
389
|
+
this.table = t, this.secured = i, this.api = new Jt(s, n, i);
|
|
390
390
|
}
|
|
391
391
|
/**
|
|
392
392
|
*
|
|
@@ -434,7 +434,7 @@ class cn {
|
|
|
434
434
|
* @returns - List of elements
|
|
435
435
|
*/
|
|
436
436
|
async export(t) {
|
|
437
|
-
const s =
|
|
437
|
+
const s = Gt(
|
|
438
438
|
`${this.table}/export`,
|
|
439
439
|
void 0,
|
|
440
440
|
t
|
|
@@ -460,7 +460,7 @@ class cn {
|
|
|
460
460
|
*/
|
|
461
461
|
async commonGet(t) {
|
|
462
462
|
return await this.api.doQuery(
|
|
463
|
-
|
|
463
|
+
sr(`${this.table}/common`, t),
|
|
464
464
|
te.GET
|
|
465
465
|
);
|
|
466
466
|
}
|
|
@@ -479,13 +479,13 @@ class cn {
|
|
|
479
479
|
return await this.api.patch(`${this.table}/restore`, t);
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function un(e) {
|
|
483
483
|
return Object.keys(e).filter((t) => isNaN(Number(t))).map((t) => ({
|
|
484
484
|
key: t,
|
|
485
485
|
value: e[t]
|
|
486
486
|
}));
|
|
487
487
|
}
|
|
488
|
-
const
|
|
488
|
+
const zt = (e, t = "") => {
|
|
489
489
|
const s = localStorage.getItem(e) ?? void 0;
|
|
490
490
|
if (s && t.length)
|
|
491
491
|
switch (t) {
|
|
@@ -525,15 +525,15 @@ function kt(e) {
|
|
|
525
525
|
s
|
|
526
526
|
);
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function nr(e) {
|
|
529
529
|
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");
|
|
530
530
|
return `${s}/${n}/${i} ${r}:${a}`;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function dn(e) {
|
|
533
533
|
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");
|
|
534
534
|
return `${s}-${n}-${i}T${r}:${a}`;
|
|
535
535
|
}
|
|
536
|
-
const
|
|
536
|
+
const ir = () => {
|
|
537
537
|
var s;
|
|
538
538
|
const e = navigator, t = ((s = e == null ? void 0 : e.userAgentData) == null ? void 0 : s.platform) || (e == null ? void 0 : e.platform) || "";
|
|
539
539
|
return /Mac|iPhone|iPod|iPad/i.test(t);
|
|
@@ -550,12 +550,12 @@ function Je(e) {
|
|
|
550
550
|
const t = e;
|
|
551
551
|
return typeof (t == null ? void 0 : t.status) == "number" && typeof (t == null ? void 0 : t.message) == "string";
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function fn(e, t) {
|
|
554
554
|
return e != null && e.errors ? e.errors.map(([s, n]) => t(s, n)) : [];
|
|
555
555
|
}
|
|
556
|
-
const
|
|
557
|
-
function
|
|
558
|
-
const { children: t } = e, s = Ie(0), [n, i] =
|
|
556
|
+
const Yt = Pe({});
|
|
557
|
+
function mn(e) {
|
|
558
|
+
const { children: t } = e, s = Ie(0), [n, i] = Ut(
|
|
559
559
|
(g, f) => {
|
|
560
560
|
const { type: p, items: _, id: C } = f;
|
|
561
561
|
switch (p) {
|
|
@@ -570,13 +570,13 @@ function fn(e) {
|
|
|
570
570
|
() => []
|
|
571
571
|
), r = (g) => g.map((f) => ({ ...f, id: s.current++ })), a = (g) => i({
|
|
572
572
|
type: "set",
|
|
573
|
-
items: r([{ ...g, type:
|
|
573
|
+
items: r([{ ...g, type: z.error }])
|
|
574
574
|
}), c = (g) => i({ type: "set", items: r([{ ...g }]) }), l = (g) => i({ type: "set", items: r(g) }), m = (g) => i({
|
|
575
575
|
type: "set",
|
|
576
|
-
items: r([{ ...g, type:
|
|
576
|
+
items: r([{ ...g, type: z.success }])
|
|
577
577
|
}), y = (g) => i({ type: "remove", id: g });
|
|
578
578
|
return /* @__PURE__ */ h(
|
|
579
|
-
|
|
579
|
+
Yt.Provider,
|
|
580
580
|
{
|
|
581
581
|
value: {
|
|
582
582
|
notification: n,
|
|
@@ -591,11 +591,11 @@ function fn(e) {
|
|
|
591
591
|
);
|
|
592
592
|
}
|
|
593
593
|
const Ne = () => {
|
|
594
|
-
const e = Oe(
|
|
594
|
+
const e = Oe(Yt);
|
|
595
595
|
if (e === void 0)
|
|
596
596
|
throw new Error("NotificationContext must be used within a Provider");
|
|
597
597
|
return e;
|
|
598
|
-
}, be = new
|
|
598
|
+
}, be = new zs({
|
|
599
599
|
defaultOptions: {
|
|
600
600
|
queries: {
|
|
601
601
|
refetchInterval: !1,
|
|
@@ -607,31 +607,31 @@ const Ne = () => {
|
|
|
607
607
|
// default: true
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
}),
|
|
610
|
+
}), Xt = Pe(
|
|
611
611
|
void 0
|
|
612
|
-
),
|
|
612
|
+
), hn = (e) => {
|
|
613
613
|
const { children: t, manager: s } = e;
|
|
614
|
-
return /* @__PURE__ */ h(
|
|
615
|
-
},
|
|
616
|
-
const e = Oe(
|
|
614
|
+
return /* @__PURE__ */ h(Xt.Provider, { value: { client: s }, children: /* @__PURE__ */ h(Ys, { client: be, children: t }) });
|
|
615
|
+
}, ar = () => {
|
|
616
|
+
const e = Oe(Xt);
|
|
617
617
|
if (!e)
|
|
618
618
|
throw new Error("managerContext must be used within a Provider");
|
|
619
619
|
return e.client;
|
|
620
|
-
},
|
|
620
|
+
}, Zt = Pe(
|
|
621
621
|
void 0
|
|
622
|
-
),
|
|
623
|
-
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i =
|
|
622
|
+
), yn = (e) => {
|
|
623
|
+
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = ar(), [r, a] = J({}), c = V(() => !!zt(s, "boolean") && r.token === void 0, [r.token, s]), l = V((p) => {
|
|
624
624
|
Et(s, p);
|
|
625
|
-
}, [s]), m =
|
|
625
|
+
}, [s]), m = V((p) => {
|
|
626
626
|
p && (a(p), Nt(s), Et(n, p.token));
|
|
627
|
-
}, [s, n]), y =
|
|
627
|
+
}, [s, n]), y = V(async () => {
|
|
628
628
|
try {
|
|
629
629
|
await i.Auth.logout();
|
|
630
630
|
} catch (p) {
|
|
631
631
|
console.error(p);
|
|
632
632
|
}
|
|
633
633
|
a({}), Nt(n);
|
|
634
|
-
}, [i.Auth, n]), g =
|
|
634
|
+
}, [i.Auth, n]), g = V(async () => {
|
|
635
635
|
try {
|
|
636
636
|
const p = await i.Auth.getSession();
|
|
637
637
|
m(p);
|
|
@@ -646,42 +646,42 @@ const Ne = () => {
|
|
|
646
646
|
isInGuestMode: c,
|
|
647
647
|
setGuestMode: l
|
|
648
648
|
};
|
|
649
|
-
return /* @__PURE__ */ h(
|
|
650
|
-
},
|
|
651
|
-
const e = Oe(
|
|
649
|
+
return /* @__PURE__ */ h(Zt.Provider, { value: f, children: t });
|
|
650
|
+
}, es = () => {
|
|
651
|
+
const e = Oe(Zt);
|
|
652
652
|
if (!e)
|
|
653
653
|
throw new Error("authContext must be used within a Provider");
|
|
654
654
|
return e;
|
|
655
|
-
},
|
|
655
|
+
}, ts = Pe({}), gn = (e) => {
|
|
656
656
|
const { children: t, location: s, navigate: n, linkComponent: i, searchComponent: r } = e;
|
|
657
657
|
return /* @__PURE__ */ h(
|
|
658
|
-
|
|
658
|
+
ts.Provider,
|
|
659
659
|
{
|
|
660
660
|
value: { location: s, navigate: n, linkComponent: i, searchComponent: r },
|
|
661
661
|
children: t
|
|
662
662
|
}
|
|
663
663
|
);
|
|
664
664
|
}, Re = () => {
|
|
665
|
-
const e = Oe(
|
|
665
|
+
const e = Oe(ts);
|
|
666
666
|
if (e === void 0 || Object.keys(e).length === 0)
|
|
667
667
|
throw new Error(
|
|
668
668
|
"Config provider has not been set. This step is required and cannot be skipped."
|
|
669
669
|
);
|
|
670
670
|
return e;
|
|
671
|
-
},
|
|
672
|
-
const { children: t } = e, [s, n] =
|
|
671
|
+
}, ss = Pe({}), pn = (e) => {
|
|
672
|
+
const { children: t } = e, [s, n] = J({}), i = V(
|
|
673
673
|
(l, m) => n((y) => ({
|
|
674
674
|
...y,
|
|
675
675
|
[l]: [...y[l] ?? [], m]
|
|
676
676
|
})),
|
|
677
677
|
[]
|
|
678
|
-
), r =
|
|
678
|
+
), r = V(
|
|
679
679
|
(l, m) => n((y) => ({
|
|
680
680
|
...y,
|
|
681
681
|
[l]: (y[l] ?? []).filter((g, f) => f !== m)
|
|
682
682
|
})),
|
|
683
683
|
[]
|
|
684
|
-
), a =
|
|
684
|
+
), a = V((l) => {
|
|
685
685
|
n(l ? (m) => ({
|
|
686
686
|
...m,
|
|
687
687
|
[l]: []
|
|
@@ -695,11 +695,11 @@ const Ne = () => {
|
|
|
695
695
|
}),
|
|
696
696
|
[s, a, r, i]
|
|
697
697
|
);
|
|
698
|
-
return /* @__PURE__ */ h(
|
|
699
|
-
},
|
|
700
|
-
|
|
701
|
-
),
|
|
702
|
-
const { showSuccessNotification: t } = Ne(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [a, c] =
|
|
698
|
+
return /* @__PURE__ */ h(ss.Provider, { value: c, children: t });
|
|
699
|
+
}, or = () => Oe(
|
|
700
|
+
ss
|
|
701
|
+
), rs = (e) => {
|
|
702
|
+
const { showSuccessNotification: t } = Ne(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [a, c] = J([]), { open: l, handleClose: m, handleOpen: y } = fs(), g = () => {
|
|
703
703
|
m(), c([]);
|
|
704
704
|
}, f = async (_) => {
|
|
705
705
|
c(_), y();
|
|
@@ -719,18 +719,18 @@ const Ne = () => {
|
|
|
719
719
|
return { open: l, onClick: f, close: g, dialogFn: p, isLoading: p.isPending };
|
|
720
720
|
};
|
|
721
721
|
var Ue = (e) => e.type === "checkbox", Ee = (e) => e instanceof Date, Z = (e) => e == null;
|
|
722
|
-
const
|
|
723
|
-
var
|
|
722
|
+
const ns = (e) => typeof e == "object";
|
|
723
|
+
var Q = (e) => !Z(e) && !Array.isArray(e) && ns(e) && !Ee(e), cr = (e) => Q(e) && e.target ? Ue(e.target) ? e.target.checked : e.target.value : e, lr = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ur = (e, t) => e.has(lr(t)), dr = (e) => {
|
|
724
724
|
const t = e.constructor && e.constructor.prototype;
|
|
725
|
-
return
|
|
725
|
+
return Q(t) && t.hasOwnProperty("isPrototypeOf");
|
|
726
726
|
}, at = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
727
727
|
function G(e) {
|
|
728
728
|
let t;
|
|
729
729
|
const s = Array.isArray(e), n = typeof FileList < "u" ? e instanceof FileList : !1;
|
|
730
730
|
if (e instanceof Date)
|
|
731
731
|
t = new Date(e);
|
|
732
|
-
else if (!(at && (e instanceof Blob || n)) && (s ||
|
|
733
|
-
if (t = s ? [] : {}, !s && !
|
|
732
|
+
else if (!(at && (e instanceof Blob || n)) && (s || Q(e)))
|
|
733
|
+
if (t = s ? [] : {}, !s && !dr(e))
|
|
734
734
|
t = e;
|
|
735
735
|
else
|
|
736
736
|
for (const i in e)
|
|
@@ -739,11 +739,11 @@ function G(e) {
|
|
|
739
739
|
return e;
|
|
740
740
|
return t;
|
|
741
741
|
}
|
|
742
|
-
var ze = (e) => /^\w*$/.test(e),
|
|
743
|
-
if (!t || !
|
|
742
|
+
var ze = (e) => /^\w*$/.test(e), j = (e) => e === void 0, ot = (e) => Array.isArray(e) ? e.filter(Boolean) : [], ct = (e) => ot(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, t, s) => {
|
|
743
|
+
if (!t || !Q(e))
|
|
744
744
|
return s;
|
|
745
745
|
const n = (ze(t) ? [t] : ct(t)).reduce((i, r) => Z(i) ? i : i[r], e);
|
|
746
|
-
return
|
|
746
|
+
return j(n) || n === e ? j(e[t]) ? s : e[t] : n;
|
|
747
747
|
}, he = (e) => typeof e == "boolean", q = (e, t, s) => {
|
|
748
748
|
let n = -1;
|
|
749
749
|
const i = ze(t) ? [t] : ct(t), r = i.length, a = r - 1;
|
|
@@ -752,7 +752,7 @@ var ze = (e) => /^\w*$/.test(e), K = (e) => e === void 0, ot = (e) => Array.isAr
|
|
|
752
752
|
let l = s;
|
|
753
753
|
if (n !== a) {
|
|
754
754
|
const m = e[c];
|
|
755
|
-
l =
|
|
755
|
+
l = Q(m) || Array.isArray(m) ? m : isNaN(+i[n + 1]) ? {} : [];
|
|
756
756
|
}
|
|
757
757
|
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
758
758
|
return;
|
|
@@ -776,9 +776,9 @@ const At = {
|
|
|
776
776
|
pattern: "pattern",
|
|
777
777
|
required: "required",
|
|
778
778
|
validate: "validate"
|
|
779
|
-
},
|
|
780
|
-
|
|
781
|
-
var
|
|
779
|
+
}, fr = ie.createContext(null);
|
|
780
|
+
fr.displayName = "HookFormContext";
|
|
781
|
+
var mr = (e, t, s, n = !0) => {
|
|
782
782
|
const i = {
|
|
783
783
|
defaultValues: t._defaultValues
|
|
784
784
|
};
|
|
@@ -791,8 +791,8 @@ var fr = (e, t, s, n = !0) => {
|
|
|
791
791
|
});
|
|
792
792
|
return i;
|
|
793
793
|
};
|
|
794
|
-
const
|
|
795
|
-
var ye = (e) => typeof e == "string",
|
|
794
|
+
const hr = typeof window < "u" ? ie.useLayoutEffect : ie.useEffect;
|
|
795
|
+
var ye = (e) => typeof e == "string", yr = (e, t, s, n, i) => ye(e) ? (n && t.watch.add(e), S(s, e, i)) : Array.isArray(e) ? e.map((r) => (n && t.watch.add(r), S(s, r))) : (n && (t.watchAll = !0), s), it = (e) => Z(e) || !ns(e);
|
|
796
796
|
function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
|
|
797
797
|
if (it(e) || it(t))
|
|
798
798
|
return e === t;
|
|
@@ -810,13 +810,13 @@ function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
|
|
|
810
810
|
return !1;
|
|
811
811
|
if (r !== "ref") {
|
|
812
812
|
const c = t[r];
|
|
813
|
-
if (Ee(a) && Ee(c) ||
|
|
813
|
+
if (Ee(a) && Ee(c) || Q(a) && Q(c) || Array.isArray(a) && Array.isArray(c) ? !ve(a, c, s) : a !== c)
|
|
814
814
|
return !1;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
return !0;
|
|
818
818
|
}
|
|
819
|
-
var
|
|
819
|
+
var gr = (e, t, s, n, i) => t ? {
|
|
820
820
|
...s[e],
|
|
821
821
|
types: {
|
|
822
822
|
...s[e] && s[e].types ? s[e].types : {},
|
|
@@ -841,30 +841,30 @@ var yr = (e, t, s, n, i) => t ? {
|
|
|
841
841
|
e = [];
|
|
842
842
|
}
|
|
843
843
|
};
|
|
844
|
-
}, ee = (e) =>
|
|
844
|
+
}, ee = (e) => Q(e) && !Object.keys(e).length, lt = (e) => e.type === "file", fe = (e) => typeof e == "function", Ke = (e) => {
|
|
845
845
|
if (!at)
|
|
846
846
|
return !1;
|
|
847
847
|
const t = e ? e.ownerDocument : 0;
|
|
848
848
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
849
|
-
},
|
|
850
|
-
function
|
|
849
|
+
}, is = (e) => e.type === "select-multiple", ut = (e) => e.type === "radio", pr = (e) => ut(e) || Ue(e), rt = (e) => Ke(e) && e.isConnected;
|
|
850
|
+
function br(e, t) {
|
|
851
851
|
const s = t.slice(0, -1).length;
|
|
852
852
|
let n = 0;
|
|
853
853
|
for (; n < s; )
|
|
854
|
-
e =
|
|
854
|
+
e = j(e) ? n++ : e[t[n++]];
|
|
855
855
|
return e;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function wr(e) {
|
|
858
858
|
for (const t in e)
|
|
859
|
-
if (e.hasOwnProperty(t) && !
|
|
859
|
+
if (e.hasOwnProperty(t) && !j(e[t]))
|
|
860
860
|
return !1;
|
|
861
861
|
return !0;
|
|
862
862
|
}
|
|
863
|
-
function
|
|
864
|
-
const s = Array.isArray(t) ? t : ze(t) ? [t] : ct(t), n = s.length === 1 ? e :
|
|
865
|
-
return n && delete n[r], i !== 0 && (
|
|
863
|
+
function K(e, t) {
|
|
864
|
+
const s = Array.isArray(t) ? t : ze(t) ? [t] : ct(t), n = s.length === 1 ? e : br(e, s), i = s.length - 1, r = s[i];
|
|
865
|
+
return n && delete n[r], i !== 0 && (Q(n) && ee(n) || Array.isArray(n) && wr(n)) && K(e, s.slice(0, -1)), e;
|
|
866
866
|
}
|
|
867
|
-
var
|
|
867
|
+
var as = (e) => {
|
|
868
868
|
for (const t in e)
|
|
869
869
|
if (fe(e[t]))
|
|
870
870
|
return !0;
|
|
@@ -872,24 +872,24 @@ var is = (e) => {
|
|
|
872
872
|
};
|
|
873
873
|
function je(e, t = {}) {
|
|
874
874
|
const s = Array.isArray(e);
|
|
875
|
-
if (
|
|
875
|
+
if (Q(e) || s)
|
|
876
876
|
for (const n in e)
|
|
877
|
-
Array.isArray(e[n]) ||
|
|
877
|
+
Array.isArray(e[n]) || Q(e[n]) && !as(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, je(e[n], t[n])) : Z(e[n]) || (t[n] = !0);
|
|
878
878
|
return t;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function os(e, t, s) {
|
|
881
881
|
const n = Array.isArray(e);
|
|
882
|
-
if (
|
|
882
|
+
if (Q(e) || n)
|
|
883
883
|
for (const i in e)
|
|
884
|
-
Array.isArray(e[i]) ||
|
|
884
|
+
Array.isArray(e[i]) || Q(e[i]) && !as(e[i]) ? j(t) || it(s[i]) ? s[i] = Array.isArray(e[i]) ? je(e[i], []) : { ...je(e[i]) } : os(e[i], Z(t) ? {} : t[i], s[i]) : s[i] = !ve(e[i], t[i]);
|
|
885
885
|
return s;
|
|
886
886
|
}
|
|
887
|
-
var
|
|
887
|
+
var $e = (e, t) => os(e, t, je(t));
|
|
888
888
|
const Tt = {
|
|
889
889
|
value: !1,
|
|
890
890
|
isValid: !1
|
|
891
|
-
},
|
|
892
|
-
var
|
|
891
|
+
}, $t = { value: !0, isValid: !0 };
|
|
892
|
+
var cs = (e) => {
|
|
893
893
|
if (Array.isArray(e)) {
|
|
894
894
|
if (e.length > 1) {
|
|
895
895
|
const t = e.filter((s) => s && s.checked && !s.disabled).map((s) => s.value);
|
|
@@ -897,24 +897,24 @@ var os = (e) => {
|
|
|
897
897
|
}
|
|
898
898
|
return e[0].checked && !e[0].disabled ? (
|
|
899
899
|
// @ts-expect-error expected to work in the browser
|
|
900
|
-
e[0].attributes && !
|
|
900
|
+
e[0].attributes && !j(e[0].attributes.value) ? j(e[0].value) || e[0].value === "" ? $t : { value: e[0].value, isValid: !0 } : $t
|
|
901
901
|
) : Tt;
|
|
902
902
|
}
|
|
903
903
|
return Tt;
|
|
904
|
-
},
|
|
905
|
-
const
|
|
904
|
+
}, ls = (e, { valueAsNumber: t, valueAsDate: s, setValueAs: n }) => j(e) ? e : t ? e === "" ? NaN : e && +e : s && ye(e) ? new Date(e) : n ? n(e) : e;
|
|
905
|
+
const Ft = {
|
|
906
906
|
isValid: !1,
|
|
907
907
|
value: null
|
|
908
908
|
};
|
|
909
|
-
var
|
|
909
|
+
var us = (e) => Array.isArray(e) ? e.reduce((t, s) => s && s.checked && !s.disabled ? {
|
|
910
910
|
isValid: !0,
|
|
911
911
|
value: s.value
|
|
912
|
-
} : t,
|
|
912
|
+
} : t, Ft) : Ft;
|
|
913
913
|
function Lt(e) {
|
|
914
914
|
const t = e.ref;
|
|
915
|
-
return lt(t) ? t.files : ut(t) ?
|
|
915
|
+
return lt(t) ? t.files : ut(t) ? us(e.refs).value : is(t) ? [...t.selectedOptions].map(({ value: s }) => s) : Ue(t) ? cs(e.refs).value : ls(j(t.value) ? e.ref.value : t.value, e);
|
|
916
916
|
}
|
|
917
|
-
var
|
|
917
|
+
var vr = (e, t, s, n) => {
|
|
918
918
|
const i = {};
|
|
919
919
|
for (const r of e) {
|
|
920
920
|
const a = S(t, r);
|
|
@@ -926,7 +926,7 @@ var wr = (e, t, s, n) => {
|
|
|
926
926
|
fields: i,
|
|
927
927
|
shouldUseNativeValidation: n
|
|
928
928
|
};
|
|
929
|
-
}, We = (e) => e instanceof RegExp,
|
|
929
|
+
}, We = (e) => e instanceof RegExp, Fe = (e) => j(e) ? e : We(e) ? e.source : Q(e) ? We(e.value) ? e.value.source : e.value : e, Dt = (e) => ({
|
|
930
930
|
isOnSubmit: !e || e === de.onSubmit,
|
|
931
931
|
isOnBlur: e === de.onBlur,
|
|
932
932
|
isOnChange: e === de.onChange,
|
|
@@ -934,7 +934,7 @@ var wr = (e, t, s, n) => {
|
|
|
934
934
|
isOnTouch: e === de.onTouched
|
|
935
935
|
});
|
|
936
936
|
const Vt = "AsyncFunction";
|
|
937
|
-
var
|
|
937
|
+
var _r = (e) => !!e && !!e.validate && !!(fe(e.validate) && e.validate.constructor.name === Vt || Q(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Vt)), Sr = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), It = (e, t, s) => !s && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
938
938
|
const De = (e, t, s, n) => {
|
|
939
939
|
for (const i of s || Object.keys(e)) {
|
|
940
940
|
const r = S(e, i);
|
|
@@ -947,7 +947,7 @@ const De = (e, t, s, n) => {
|
|
|
947
947
|
return !0;
|
|
948
948
|
if (De(c, t))
|
|
949
949
|
break;
|
|
950
|
-
} else if (
|
|
950
|
+
} else if (Q(c) && De(c, t))
|
|
951
951
|
break;
|
|
952
952
|
}
|
|
953
953
|
}
|
|
@@ -980,11 +980,11 @@ function Pt(e, t, s) {
|
|
|
980
980
|
name: s
|
|
981
981
|
};
|
|
982
982
|
}
|
|
983
|
-
var
|
|
983
|
+
var Cr = (e, t, s, n) => {
|
|
984
984
|
s(e);
|
|
985
985
|
const { name: i, ...r } = e;
|
|
986
986
|
return ee(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((a) => t[a] === (!n || de.all));
|
|
987
|
-
},
|
|
987
|
+
}, Er = (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, kr = (e, t) => !ot(S(e, t)).length && K(e, t), Ar = (e, t, s) => {
|
|
988
988
|
const n = Le(S(e, s));
|
|
989
989
|
return q(n, "root", t[s]), q(e, s, n), e;
|
|
990
990
|
}, Qe = (e) => ye(e);
|
|
@@ -996,98 +996,98 @@ function Ot(e, t, s = "validate") {
|
|
|
996
996
|
ref: t
|
|
997
997
|
};
|
|
998
998
|
}
|
|
999
|
-
var ke = (e) =>
|
|
999
|
+
var ke = (e) => Q(e) && !We(e) ? e : {
|
|
1000
1000
|
value: e,
|
|
1001
1001
|
message: ""
|
|
1002
1002
|
}, Mt = async (e, t, s, n, i, r) => {
|
|
1003
|
-
const { ref: a, refs: c, required: l, maxLength: m, minLength: y, min: g, max: f, pattern: p, validate: _, name: C, valueAsNumber: N, mount:
|
|
1004
|
-
if (!
|
|
1003
|
+
const { ref: a, refs: c, required: l, maxLength: m, minLength: y, min: g, max: f, pattern: p, validate: _, name: C, valueAsNumber: N, mount: B } = e._f, k = S(s, C);
|
|
1004
|
+
if (!B || t.has(C))
|
|
1005
1005
|
return {};
|
|
1006
|
-
const
|
|
1007
|
-
i &&
|
|
1008
|
-
},
|
|
1009
|
-
const R =
|
|
1010
|
-
|
|
1011
|
-
type:
|
|
1006
|
+
const F = c ? c[0] : a, T = ($) => {
|
|
1007
|
+
i && F.reportValidity && (F.setCustomValidity(he($) ? "" : $ || ""), F.reportValidity());
|
|
1008
|
+
}, A = {}, I = ut(a), M = Ue(a), se = I || M, P = (N || lt(a)) && j(a.value) && j(k) || Ke(a) && a.value === "" || k === "" || Array.isArray(k) && !k.length, re = gr.bind(null, C, n, A), ae = ($, L, H, W = ge.maxLength, Y = ge.minLength) => {
|
|
1009
|
+
const R = $ ? L : H;
|
|
1010
|
+
A[C] = {
|
|
1011
|
+
type: $ ? W : Y,
|
|
1012
1012
|
message: R,
|
|
1013
1013
|
ref: a,
|
|
1014
|
-
...re(
|
|
1014
|
+
...re($ ? W : Y, R)
|
|
1015
1015
|
};
|
|
1016
1016
|
};
|
|
1017
|
-
if (r ? !Array.isArray(k) || !k.length : l && (!se && (
|
|
1018
|
-
const { value:
|
|
1019
|
-
if (
|
|
1017
|
+
if (r ? !Array.isArray(k) || !k.length : l && (!se && (P || Z(k)) || he(k) && !k || M && !cs(c).isValid || I && !us(c).isValid)) {
|
|
1018
|
+
const { value: $, message: L } = Qe(l) ? { value: !!l, message: l } : ke(l);
|
|
1019
|
+
if ($ && (A[C] = {
|
|
1020
1020
|
type: ge.required,
|
|
1021
|
-
message:
|
|
1022
|
-
ref:
|
|
1023
|
-
...re(ge.required,
|
|
1021
|
+
message: L,
|
|
1022
|
+
ref: F,
|
|
1023
|
+
...re(ge.required, L)
|
|
1024
1024
|
}, !n))
|
|
1025
|
-
return
|
|
1025
|
+
return T(L), A;
|
|
1026
1026
|
}
|
|
1027
|
-
if (!
|
|
1028
|
-
let
|
|
1029
|
-
const
|
|
1027
|
+
if (!P && (!Z(g) || !Z(f))) {
|
|
1028
|
+
let $, L;
|
|
1029
|
+
const H = ke(f), W = ke(g);
|
|
1030
1030
|
if (!Z(k) && !isNaN(k)) {
|
|
1031
|
-
const
|
|
1032
|
-
Z(
|
|
1031
|
+
const Y = a.valueAsNumber || k && +k;
|
|
1032
|
+
Z(H.value) || ($ = Y > H.value), Z(W.value) || (L = Y < W.value);
|
|
1033
1033
|
} else {
|
|
1034
|
-
const
|
|
1035
|
-
ye(
|
|
1034
|
+
const Y = a.valueAsDate || new Date(k), R = (ue) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ue), X = a.type == "time", ne = a.type == "week";
|
|
1035
|
+
ye(H.value) && k && ($ = X ? R(k) > R(H.value) : ne ? k > H.value : Y > new Date(H.value)), ye(W.value) && k && (L = X ? R(k) < R(W.value) : ne ? k < W.value : Y < new Date(W.value));
|
|
1036
1036
|
}
|
|
1037
|
-
if ((
|
|
1038
|
-
return
|
|
1037
|
+
if (($ || L) && (ae(!!$, H.message, W.message, ge.max, ge.min), !n))
|
|
1038
|
+
return T(A[C].message), A;
|
|
1039
1039
|
}
|
|
1040
|
-
if ((m || y) && !
|
|
1041
|
-
const
|
|
1042
|
-
if ((
|
|
1043
|
-
return
|
|
1040
|
+
if ((m || y) && !P && (ye(k) || r && Array.isArray(k))) {
|
|
1041
|
+
const $ = ke(m), L = ke(y), H = !Z($.value) && k.length > +$.value, W = !Z(L.value) && k.length < +L.value;
|
|
1042
|
+
if ((H || W) && (ae(H, $.message, L.message), !n))
|
|
1043
|
+
return T(A[C].message), A;
|
|
1044
1044
|
}
|
|
1045
|
-
if (p && !
|
|
1046
|
-
const { value:
|
|
1047
|
-
if (We(
|
|
1045
|
+
if (p && !P && ye(k)) {
|
|
1046
|
+
const { value: $, message: L } = ke(p);
|
|
1047
|
+
if (We($) && !k.match($) && (A[C] = {
|
|
1048
1048
|
type: ge.pattern,
|
|
1049
|
-
message:
|
|
1049
|
+
message: L,
|
|
1050
1050
|
ref: a,
|
|
1051
|
-
...re(ge.pattern,
|
|
1051
|
+
...re(ge.pattern, L)
|
|
1052
1052
|
}, !n))
|
|
1053
|
-
return
|
|
1053
|
+
return T(L), A;
|
|
1054
1054
|
}
|
|
1055
1055
|
if (_) {
|
|
1056
1056
|
if (fe(_)) {
|
|
1057
|
-
const
|
|
1058
|
-
if (
|
|
1059
|
-
|
|
1060
|
-
...re(ge.validate,
|
|
1057
|
+
const $ = await _(k, s), L = Ot($, F);
|
|
1058
|
+
if (L && (A[C] = {
|
|
1059
|
+
...L,
|
|
1060
|
+
...re(ge.validate, L.message)
|
|
1061
1061
|
}, !n))
|
|
1062
|
-
return
|
|
1063
|
-
} else if (
|
|
1064
|
-
let
|
|
1065
|
-
for (const
|
|
1066
|
-
if (!ee(
|
|
1062
|
+
return T(L.message), A;
|
|
1063
|
+
} else if (Q(_)) {
|
|
1064
|
+
let $ = {};
|
|
1065
|
+
for (const L in _) {
|
|
1066
|
+
if (!ee($) && !n)
|
|
1067
1067
|
break;
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1070
|
-
...
|
|
1071
|
-
...re(
|
|
1072
|
-
},
|
|
1068
|
+
const H = Ot(await _[L](k, s), F, L);
|
|
1069
|
+
H && ($ = {
|
|
1070
|
+
...H,
|
|
1071
|
+
...re(L, H.message)
|
|
1072
|
+
}, T(H.message), n && (A[C] = $));
|
|
1073
1073
|
}
|
|
1074
|
-
if (!ee(
|
|
1075
|
-
ref:
|
|
1076
|
-
|
|
1074
|
+
if (!ee($) && (A[C] = {
|
|
1075
|
+
ref: F,
|
|
1076
|
+
...$
|
|
1077
1077
|
}, !n))
|
|
1078
|
-
return
|
|
1078
|
+
return A;
|
|
1079
1079
|
}
|
|
1080
1080
|
}
|
|
1081
|
-
return
|
|
1081
|
+
return T(!0), A;
|
|
1082
1082
|
};
|
|
1083
|
-
const
|
|
1083
|
+
const xr = {
|
|
1084
1084
|
mode: de.onSubmit,
|
|
1085
1085
|
reValidateMode: de.onChange,
|
|
1086
1086
|
shouldFocusError: !0
|
|
1087
1087
|
};
|
|
1088
|
-
function
|
|
1088
|
+
function Tr(e = {}) {
|
|
1089
1089
|
let t = {
|
|
1090
|
-
...
|
|
1090
|
+
...xr,
|
|
1091
1091
|
...e
|
|
1092
1092
|
}, s = {
|
|
1093
1093
|
submitCount: 0,
|
|
@@ -1104,7 +1104,7 @@ function xr(e = {}) {
|
|
|
1104
1104
|
validatingFields: {},
|
|
1105
1105
|
errors: t.errors || {},
|
|
1106
1106
|
disabled: t.disabled || !1
|
|
1107
|
-
}, n = {}, i =
|
|
1107
|
+
}, n = {}, i = Q(t.defaultValues) || Q(t.values) ? G(t.defaultValues || t.values) || {} : {}, r = t.shouldUnregister ? {} : G(i), a = {
|
|
1108
1108
|
action: !1,
|
|
1109
1109
|
mount: !1,
|
|
1110
1110
|
watch: !1
|
|
@@ -1134,19 +1134,19 @@ function xr(e = {}) {
|
|
|
1134
1134
|
clearTimeout(m), m = setTimeout(o, u);
|
|
1135
1135
|
}, C = async (o) => {
|
|
1136
1136
|
if (!t.disabled && (y.isValid || g.isValid || o)) {
|
|
1137
|
-
const u = t.resolver ? ee((await
|
|
1137
|
+
const u = t.resolver ? ee((await M()).errors) : await P(n, !0);
|
|
1138
1138
|
u !== s.isValid && f.state.next({
|
|
1139
1139
|
isValid: u
|
|
1140
1140
|
});
|
|
1141
1141
|
}
|
|
1142
1142
|
}, N = (o, u) => {
|
|
1143
1143
|
!t.disabled && (y.isValidating || y.validatingFields || g.isValidating || g.validatingFields) && ((o || Array.from(c.mount)).forEach((d) => {
|
|
1144
|
-
d && (u ? q(s.validatingFields, d, u) :
|
|
1144
|
+
d && (u ? q(s.validatingFields, d, u) : K(s.validatingFields, d));
|
|
1145
1145
|
}), f.state.next({
|
|
1146
1146
|
validatingFields: s.validatingFields,
|
|
1147
1147
|
isValidating: !ee(s.validatingFields)
|
|
1148
1148
|
}));
|
|
1149
|
-
},
|
|
1149
|
+
}, B = (o, u = [], d, v, w = !0, b = !0) => {
|
|
1150
1150
|
if (v && d && !t.disabled) {
|
|
1151
1151
|
if (a.action = !0, b && Array.isArray(S(n, o))) {
|
|
1152
1152
|
const E = d(S(n, o), v.argA, v.argB);
|
|
@@ -1154,13 +1154,13 @@ function xr(e = {}) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
if (b && Array.isArray(S(s.errors, o))) {
|
|
1156
1156
|
const E = d(S(s.errors, o), v.argA, v.argB);
|
|
1157
|
-
w && q(s.errors, o, E),
|
|
1157
|
+
w && q(s.errors, o, E), kr(s.errors, o);
|
|
1158
1158
|
}
|
|
1159
1159
|
if ((y.touchedFields || g.touchedFields) && b && Array.isArray(S(s.touchedFields, o))) {
|
|
1160
1160
|
const E = d(S(s.touchedFields, o), v.argA, v.argB);
|
|
1161
1161
|
w && q(s.touchedFields, o, E);
|
|
1162
1162
|
}
|
|
1163
|
-
(y.dirtyFields || g.dirtyFields) && (s.dirtyFields =
|
|
1163
|
+
(y.dirtyFields || g.dirtyFields) && (s.dirtyFields = $e(i, r)), f.state.next({
|
|
1164
1164
|
name: o,
|
|
1165
1165
|
isDirty: ae(o, u),
|
|
1166
1166
|
dirtyFields: s.dirtyFields,
|
|
@@ -1173,38 +1173,38 @@ function xr(e = {}) {
|
|
|
1173
1173
|
q(s.errors, o, u), f.state.next({
|
|
1174
1174
|
errors: s.errors
|
|
1175
1175
|
});
|
|
1176
|
-
},
|
|
1176
|
+
}, F = (o) => {
|
|
1177
1177
|
s.errors = o, f.state.next({
|
|
1178
1178
|
errors: s.errors,
|
|
1179
1179
|
isValid: !1
|
|
1180
1180
|
});
|
|
1181
|
-
},
|
|
1181
|
+
}, T = (o, u, d, v) => {
|
|
1182
1182
|
const w = S(n, o);
|
|
1183
1183
|
if (w) {
|
|
1184
|
-
const b = S(r, o,
|
|
1185
|
-
|
|
1184
|
+
const b = S(r, o, j(d) ? S(i, o) : d);
|
|
1185
|
+
j(b) || v && v.defaultChecked || u ? q(r, o, u ? b : Lt(w._f)) : H(o, b), a.mount && C();
|
|
1186
1186
|
}
|
|
1187
|
-
},
|
|
1187
|
+
}, A = (o, u, d, v, w) => {
|
|
1188
1188
|
let b = !1, E = !1;
|
|
1189
|
-
const
|
|
1189
|
+
const O = {
|
|
1190
1190
|
name: o
|
|
1191
1191
|
};
|
|
1192
1192
|
if (!t.disabled) {
|
|
1193
1193
|
if (!d || v) {
|
|
1194
|
-
(y.isDirty || g.isDirty) && (E = s.isDirty, s.isDirty =
|
|
1194
|
+
(y.isDirty || g.isDirty) && (E = s.isDirty, s.isDirty = O.isDirty = ae(), b = E !== O.isDirty);
|
|
1195
1195
|
const U = ve(S(i, o), u);
|
|
1196
|
-
E = !!S(s.dirtyFields, o), U ?
|
|
1196
|
+
E = !!S(s.dirtyFields, o), U ? K(s.dirtyFields, o) : q(s.dirtyFields, o, !0), O.dirtyFields = s.dirtyFields, b = b || (y.dirtyFields || g.dirtyFields) && E !== !U;
|
|
1197
1197
|
}
|
|
1198
1198
|
if (d) {
|
|
1199
1199
|
const U = S(s.touchedFields, o);
|
|
1200
|
-
U || (q(s.touchedFields, o, d),
|
|
1200
|
+
U || (q(s.touchedFields, o, d), O.touchedFields = s.touchedFields, b = b || (y.touchedFields || g.touchedFields) && U !== d);
|
|
1201
1201
|
}
|
|
1202
|
-
b && w && f.state.next(
|
|
1202
|
+
b && w && f.state.next(O);
|
|
1203
1203
|
}
|
|
1204
|
-
return b ?
|
|
1205
|
-
},
|
|
1204
|
+
return b ? O : {};
|
|
1205
|
+
}, I = (o, u, d, v) => {
|
|
1206
1206
|
const w = S(s.errors, o), b = (y.isValid || g.isValid) && he(u) && s.isValid !== u;
|
|
1207
|
-
if (t.delayError && d ? (l = _(() => k(o, d)), l(t.delayError)) : (clearTimeout(m), l = null, d ? q(s.errors, o, d) :
|
|
1207
|
+
if (t.delayError && d ? (l = _(() => k(o, d)), l(t.delayError)) : (clearTimeout(m), l = null, d ? q(s.errors, o, d) : K(s.errors, o)), (d ? !ve(w, d) : w) || !ee(v) || b) {
|
|
1208
1208
|
const E = {
|
|
1209
1209
|
...v,
|
|
1210
1210
|
...b && he(u) ? { isValid: u } : {},
|
|
@@ -1216,21 +1216,21 @@ function xr(e = {}) {
|
|
|
1216
1216
|
...E
|
|
1217
1217
|
}, f.state.next(E);
|
|
1218
1218
|
}
|
|
1219
|
-
},
|
|
1219
|
+
}, M = async (o) => {
|
|
1220
1220
|
N(o, !0);
|
|
1221
|
-
const u = await t.resolver(r, t.context,
|
|
1221
|
+
const u = await t.resolver(r, t.context, vr(o || c.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
1222
1222
|
return N(o), u;
|
|
1223
1223
|
}, se = async (o) => {
|
|
1224
|
-
const { errors: u } = await
|
|
1224
|
+
const { errors: u } = await M(o);
|
|
1225
1225
|
if (o)
|
|
1226
1226
|
for (const d of o) {
|
|
1227
1227
|
const v = S(u, d);
|
|
1228
|
-
v ? q(s.errors, d, v) :
|
|
1228
|
+
v ? q(s.errors, d, v) : K(s.errors, d);
|
|
1229
1229
|
}
|
|
1230
1230
|
else
|
|
1231
1231
|
s.errors = u;
|
|
1232
1232
|
return u;
|
|
1233
|
-
},
|
|
1233
|
+
}, P = async (o, u, d = {
|
|
1234
1234
|
valid: !0
|
|
1235
1235
|
}) => {
|
|
1236
1236
|
for (const v in o) {
|
|
@@ -1238,14 +1238,14 @@ function xr(e = {}) {
|
|
|
1238
1238
|
if (w) {
|
|
1239
1239
|
const { _f: b, ...E } = w;
|
|
1240
1240
|
if (b) {
|
|
1241
|
-
const
|
|
1241
|
+
const O = c.array.has(b.name), U = w._f && _r(w._f);
|
|
1242
1242
|
U && y.validatingFields && N([v], !0);
|
|
1243
|
-
const oe = await Mt(w, c.disabled, r, p, t.shouldUseNativeValidation && !u,
|
|
1243
|
+
const oe = await Mt(w, c.disabled, r, p, t.shouldUseNativeValidation && !u, O);
|
|
1244
1244
|
if (U && y.validatingFields && N([v]), oe[b.name] && (d.valid = !1, u))
|
|
1245
1245
|
break;
|
|
1246
|
-
!u && (S(oe, b.name) ?
|
|
1246
|
+
!u && (S(oe, b.name) ? O ? Ar(s.errors, oe, b.name) : q(s.errors, b.name, oe[b.name]) : K(s.errors, b.name));
|
|
1247
1247
|
}
|
|
1248
|
-
!ee(E) && await
|
|
1248
|
+
!ee(E) && await P(E, u, d);
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
1251
|
return d.valid;
|
|
@@ -1255,38 +1255,38 @@ function xr(e = {}) {
|
|
|
1255
1255
|
u && (u._f.refs ? u._f.refs.every((d) => !rt(d)) : !rt(u._f.ref)) && Ye(o);
|
|
1256
1256
|
}
|
|
1257
1257
|
c.unMount = /* @__PURE__ */ new Set();
|
|
1258
|
-
}, ae = (o, u) => !t.disabled && (o && u && q(r, o, u), !ve(ue(), i)),
|
|
1259
|
-
...a.mount ? r :
|
|
1260
|
-
}, d, u),
|
|
1258
|
+
}, ae = (o, u) => !t.disabled && (o && u && q(r, o, u), !ve(ue(), i)), $ = (o, u, d) => yr(o, c, {
|
|
1259
|
+
...a.mount ? r : j(u) ? i : ye(o) ? { [o]: u } : u
|
|
1260
|
+
}, d, u), L = (o) => ot(S(a.mount ? r : i, o, t.shouldUnregister ? S(i, o, []) : [])), H = (o, u, d = {}) => {
|
|
1261
1261
|
const v = S(n, o);
|
|
1262
1262
|
let w = u;
|
|
1263
1263
|
if (v) {
|
|
1264
1264
|
const b = v._f;
|
|
1265
|
-
b && (!b.disabled && q(r, o,
|
|
1266
|
-
(!E.defaultChecked || !E.disabled) && (Array.isArray(w) ? E.checked = !!w.find((
|
|
1265
|
+
b && (!b.disabled && q(r, o, ls(u, b)), w = Ke(b.ref) && Z(u) ? "" : u, is(b.ref) ? [...b.ref.options].forEach((E) => E.selected = w.includes(E.value)) : b.refs ? Ue(b.ref) ? b.refs.forEach((E) => {
|
|
1266
|
+
(!E.defaultChecked || !E.disabled) && (Array.isArray(w) ? E.checked = !!w.find((O) => O === E.value) : E.checked = w === E.value || !!w);
|
|
1267
1267
|
}) : b.refs.forEach((E) => E.checked = E.value === w) : lt(b.ref) ? b.ref.value = "" : (b.ref.value = w, b.ref.type || f.state.next({
|
|
1268
1268
|
name: o,
|
|
1269
1269
|
values: G(r)
|
|
1270
1270
|
})));
|
|
1271
1271
|
}
|
|
1272
|
-
(d.shouldDirty || d.shouldTouch) &&
|
|
1272
|
+
(d.shouldDirty || d.shouldTouch) && A(o, w, d.shouldTouch, d.shouldDirty, !0), d.shouldValidate && ne(o);
|
|
1273
1273
|
}, W = (o, u, d) => {
|
|
1274
1274
|
for (const v in u) {
|
|
1275
1275
|
if (!u.hasOwnProperty(v))
|
|
1276
1276
|
return;
|
|
1277
1277
|
const w = u[v], b = o + "." + v, E = S(n, b);
|
|
1278
|
-
(c.array.has(o) ||
|
|
1278
|
+
(c.array.has(o) || Q(w) || E && !E._f) && !Ee(w) ? W(b, w, d) : H(b, w, d);
|
|
1279
1279
|
}
|
|
1280
|
-
},
|
|
1280
|
+
}, Y = (o, u, d = {}) => {
|
|
1281
1281
|
const v = S(n, o), w = c.array.has(o), b = G(u);
|
|
1282
1282
|
q(r, o, b), w ? (f.array.next({
|
|
1283
1283
|
name: o,
|
|
1284
1284
|
values: G(r)
|
|
1285
1285
|
}), (y.isDirty || y.dirtyFields || g.isDirty || g.dirtyFields) && d.shouldDirty && f.state.next({
|
|
1286
1286
|
name: o,
|
|
1287
|
-
dirtyFields:
|
|
1287
|
+
dirtyFields: $e(i, r),
|
|
1288
1288
|
isDirty: ae(o, b)
|
|
1289
|
-
})) : v && !v._f && !Z(b) ? W(o, b, d) :
|
|
1289
|
+
})) : v && !v._f && !Z(b) ? W(o, b, d) : H(o, b, d), It(o, c) && f.state.next({ ...s, name: o }), f.state.next({
|
|
1290
1290
|
name: a.mount ? o : void 0,
|
|
1291
1291
|
values: G(r)
|
|
1292
1292
|
});
|
|
@@ -1296,27 +1296,27 @@ function xr(e = {}) {
|
|
|
1296
1296
|
let d = u.name, v = !0;
|
|
1297
1297
|
const w = S(n, d), b = (U) => {
|
|
1298
1298
|
v = Number.isNaN(U) || Ee(U) && isNaN(U.getTime()) || ve(U, S(r, d, U));
|
|
1299
|
-
}, E = Dt(t.mode),
|
|
1299
|
+
}, E = Dt(t.mode), O = Dt(t.reValidateMode);
|
|
1300
1300
|
if (w) {
|
|
1301
1301
|
let U, oe;
|
|
1302
|
-
const
|
|
1303
|
-
q(r, d,
|
|
1304
|
-
const tt =
|
|
1302
|
+
const He = u.type ? Lt(w._f) : cr(o), we = o.type === At.BLUR || o.type === At.FOCUS_OUT, vs = !Sr(w._f) && !t.resolver && !S(s.errors, d) && !w._f.deps || Nr(we, S(s.touchedFields, d), s.isSubmitted, O, E), et = It(d, c, we);
|
|
1303
|
+
q(r, d, He), we ? (w._f.onBlur && w._f.onBlur(o), l && l(0)) : w._f.onChange && w._f.onChange(o);
|
|
1304
|
+
const tt = A(d, He, we), _s = !ee(tt) || et;
|
|
1305
1305
|
if (!we && f.state.next({
|
|
1306
1306
|
name: d,
|
|
1307
1307
|
type: o.type,
|
|
1308
1308
|
values: G(r)
|
|
1309
|
-
}),
|
|
1310
|
-
return (y.isValid || g.isValid) && (t.mode === "onBlur" ? we && C() : we || C()),
|
|
1309
|
+
}), vs)
|
|
1310
|
+
return (y.isValid || g.isValid) && (t.mode === "onBlur" ? we && C() : we || C()), _s && f.state.next({ name: d, ...et ? {} : tt });
|
|
1311
1311
|
if (!we && et && f.state.next({ ...s }), t.resolver) {
|
|
1312
|
-
const { errors: vt } = await
|
|
1313
|
-
if (b(
|
|
1314
|
-
const
|
|
1312
|
+
const { errors: vt } = await M([d]);
|
|
1313
|
+
if (b(He), v) {
|
|
1314
|
+
const Ss = Pt(s.errors, n, d), _t = Pt(vt, n, Ss.name || d);
|
|
1315
1315
|
U = _t.error, d = _t.name, oe = ee(vt);
|
|
1316
1316
|
}
|
|
1317
1317
|
} else
|
|
1318
|
-
N([d], !0), U = (await Mt(w, c.disabled, r, p, t.shouldUseNativeValidation))[d], N([d]), b(
|
|
1319
|
-
v && (w._f.deps && ne(w._f.deps),
|
|
1318
|
+
N([d], !0), U = (await Mt(w, c.disabled, r, p, t.shouldUseNativeValidation))[d], N([d]), b(He), v && (U ? oe = !1 : (y.isValid || g.isValid) && (oe = await P(n, !0)));
|
|
1319
|
+
v && (w._f.deps && ne(w._f.deps), I(d, oe, U, tt));
|
|
1320
1320
|
}
|
|
1321
1321
|
}, X = (o, u) => {
|
|
1322
1322
|
if (S(s.errors, u) && o.focus)
|
|
@@ -1325,12 +1325,12 @@ function xr(e = {}) {
|
|
|
1325
1325
|
let d, v;
|
|
1326
1326
|
const w = Le(o);
|
|
1327
1327
|
if (t.resolver) {
|
|
1328
|
-
const b = await se(
|
|
1328
|
+
const b = await se(j(o) ? o : w);
|
|
1329
1329
|
d = ee(b), v = o ? !w.some((E) => S(b, E)) : d;
|
|
1330
1330
|
} else o ? (v = (await Promise.all(w.map(async (b) => {
|
|
1331
1331
|
const E = S(n, b);
|
|
1332
|
-
return await
|
|
1333
|
-
}))).every(Boolean), !(!v && !s.isValid) && C()) : v = d = await
|
|
1332
|
+
return await P(E && E._f ? { [b]: E } : E);
|
|
1333
|
+
}))).every(Boolean), !(!v && !s.isValid) && C()) : v = d = await P(n);
|
|
1334
1334
|
return f.state.next({
|
|
1335
1335
|
...!ye(o) || (y.isValid || g.isValid) && d !== s.isValid ? {} : { name: o },
|
|
1336
1336
|
...t.resolver || !o ? { isValid: d } : {},
|
|
@@ -1340,7 +1340,7 @@ function xr(e = {}) {
|
|
|
1340
1340
|
const u = {
|
|
1341
1341
|
...a.mount ? r : i
|
|
1342
1342
|
};
|
|
1343
|
-
return
|
|
1343
|
+
return j(o) ? u : ye(o) ? S(u, o) : o.map((d) => S(u, d));
|
|
1344
1344
|
}, qe = (o, u) => ({
|
|
1345
1345
|
invalid: !!S((u || s).errors, o),
|
|
1346
1346
|
isDirty: !!S((u || s).dirtyFields, o),
|
|
@@ -1348,11 +1348,11 @@ function xr(e = {}) {
|
|
|
1348
1348
|
isValidating: !!S(s.validatingFields, o),
|
|
1349
1349
|
isTouched: !!S((u || s).touchedFields, o)
|
|
1350
1350
|
}), Ce = (o) => {
|
|
1351
|
-
o && Le(o).forEach((u) =>
|
|
1351
|
+
o && Le(o).forEach((u) => K(s.errors, u)), f.state.next({
|
|
1352
1352
|
errors: o ? s.errors : {}
|
|
1353
1353
|
});
|
|
1354
1354
|
}, mt = (o, u, d) => {
|
|
1355
|
-
const v = (S(n, o, { _f: {} })._f || {}).ref, w = S(s.errors, o) || {}, { ref: b, message: E, type:
|
|
1355
|
+
const v = (S(n, o, { _f: {} })._f || {}).ref, w = S(s.errors, o) || {}, { ref: b, message: E, type: O, ...U } = w;
|
|
1356
1356
|
q(s.errors, o, {
|
|
1357
1357
|
...U,
|
|
1358
1358
|
...u,
|
|
@@ -1362,18 +1362,18 @@ function xr(e = {}) {
|
|
|
1362
1362
|
errors: s.errors,
|
|
1363
1363
|
isValid: !1
|
|
1364
1364
|
}), d && d.shouldFocus && v && v.focus && v.focus();
|
|
1365
|
-
},
|
|
1366
|
-
next: (d) => "values" in d && o(
|
|
1367
|
-
}) :
|
|
1365
|
+
}, hs = (o, u) => fe(o) ? f.state.subscribe({
|
|
1366
|
+
next: (d) => "values" in d && o($(void 0, u), d)
|
|
1367
|
+
}) : $(o, u, !0), ht = (o) => f.state.subscribe({
|
|
1368
1368
|
next: (u) => {
|
|
1369
|
-
|
|
1369
|
+
Er(o.name, u.name, o.exact) && Cr(u, o.formState || y, ws, o.reRenderRoot) && o.callback({
|
|
1370
1370
|
values: { ...r },
|
|
1371
1371
|
...s,
|
|
1372
1372
|
...u,
|
|
1373
1373
|
defaultValues: i
|
|
1374
1374
|
});
|
|
1375
1375
|
}
|
|
1376
|
-
}).unsubscribe,
|
|
1376
|
+
}).unsubscribe, ys = (o) => (a.mount = !0, g = {
|
|
1377
1377
|
...g,
|
|
1378
1378
|
...o.formState
|
|
1379
1379
|
}, ht({
|
|
@@ -1381,7 +1381,7 @@ function xr(e = {}) {
|
|
|
1381
1381
|
formState: g
|
|
1382
1382
|
})), Ye = (o, u = {}) => {
|
|
1383
1383
|
for (const d of o ? Le(o) : c.mount)
|
|
1384
|
-
c.mount.delete(d), c.array.delete(d), u.keepValue || (
|
|
1384
|
+
c.mount.delete(d), c.array.delete(d), u.keepValue || (K(n, d), K(r, d)), !u.keepError && K(s.errors, d), !u.keepDirty && K(s.dirtyFields, d), !u.keepTouched && K(s.touchedFields, d), !u.keepIsValidating && K(s.validatingFields, d), !t.shouldUnregister && !u.keepDefaultValue && K(i, d);
|
|
1385
1385
|
f.state.next({
|
|
1386
1386
|
values: G(r)
|
|
1387
1387
|
}), f.state.next({
|
|
@@ -1404,15 +1404,15 @@ function xr(e = {}) {
|
|
|
1404
1404
|
}), c.mount.add(o), d ? yt({
|
|
1405
1405
|
disabled: he(u.disabled) ? u.disabled : t.disabled,
|
|
1406
1406
|
name: o
|
|
1407
|
-
}) :
|
|
1407
|
+
}) : T(o, !0, u.value), {
|
|
1408
1408
|
...v ? { disabled: u.disabled || t.disabled } : {},
|
|
1409
1409
|
...t.progressive ? {
|
|
1410
1410
|
required: !!u.required,
|
|
1411
|
-
min:
|
|
1412
|
-
max:
|
|
1413
|
-
minLength:
|
|
1414
|
-
maxLength:
|
|
1415
|
-
pattern:
|
|
1411
|
+
min: Fe(u.min),
|
|
1412
|
+
max: Fe(u.max),
|
|
1413
|
+
minLength: Fe(u.minLength),
|
|
1414
|
+
maxLength: Fe(u.maxLength),
|
|
1415
|
+
pattern: Fe(u.pattern)
|
|
1416
1416
|
} : {},
|
|
1417
1417
|
name: o,
|
|
1418
1418
|
onChange: R,
|
|
@@ -1420,27 +1420,27 @@ function xr(e = {}) {
|
|
|
1420
1420
|
ref: (w) => {
|
|
1421
1421
|
if (w) {
|
|
1422
1422
|
Xe(o, u), d = S(n, o);
|
|
1423
|
-
const b =
|
|
1424
|
-
if (E ?
|
|
1423
|
+
const b = j(w.value) && w.querySelectorAll && w.querySelectorAll("input,select,textarea")[0] || w, E = pr(b), O = d._f.refs || [];
|
|
1424
|
+
if (E ? O.find((U) => U === b) : b === d._f.ref)
|
|
1425
1425
|
return;
|
|
1426
1426
|
q(n, o, {
|
|
1427
1427
|
_f: {
|
|
1428
1428
|
...d._f,
|
|
1429
1429
|
...E ? {
|
|
1430
1430
|
refs: [
|
|
1431
|
-
...
|
|
1431
|
+
...O.filter(rt),
|
|
1432
1432
|
b,
|
|
1433
1433
|
...Array.isArray(S(i, o)) ? [{}] : []
|
|
1434
1434
|
],
|
|
1435
1435
|
ref: { type: b.type, name: o }
|
|
1436
1436
|
} : { ref: b }
|
|
1437
1437
|
}
|
|
1438
|
-
}),
|
|
1438
|
+
}), T(o, !1, void 0, b);
|
|
1439
1439
|
} else
|
|
1440
|
-
d = S(n, o, {}), d._f && (d._f.mount = !1), (t.shouldUnregister || u.shouldUnregister) && !(
|
|
1440
|
+
d = S(n, o, {}), d._f && (d._f.mount = !1), (t.shouldUnregister || u.shouldUnregister) && !(ur(c.array, o) && a.action) && c.unMount.add(o);
|
|
1441
1441
|
}
|
|
1442
1442
|
};
|
|
1443
|
-
}, Ze = () => t.shouldFocusError && De(n, X, c.mount),
|
|
1443
|
+
}, Ze = () => t.shouldFocusError && De(n, X, c.mount), gs = (o) => {
|
|
1444
1444
|
he(o) && (f.state.next({ disabled: o }), De(n, (u, d) => {
|
|
1445
1445
|
const v = S(n, d);
|
|
1446
1446
|
v && (u.disabled = v._f.disabled || o, Array.isArray(v._f.refs) && v._f.refs.forEach((w) => {
|
|
@@ -1454,14 +1454,14 @@ function xr(e = {}) {
|
|
|
1454
1454
|
if (f.state.next({
|
|
1455
1455
|
isSubmitting: !0
|
|
1456
1456
|
}), t.resolver) {
|
|
1457
|
-
const { errors: b, values: E } = await
|
|
1457
|
+
const { errors: b, values: E } = await M();
|
|
1458
1458
|
s.errors = b, w = G(E);
|
|
1459
1459
|
} else
|
|
1460
|
-
await
|
|
1460
|
+
await P(n);
|
|
1461
1461
|
if (c.disabled.size)
|
|
1462
1462
|
for (const b of c.disabled)
|
|
1463
|
-
|
|
1464
|
-
if (
|
|
1463
|
+
K(w, b);
|
|
1464
|
+
if (K(s.errors, "root"), ee(s.errors)) {
|
|
1465
1465
|
f.state.next({
|
|
1466
1466
|
errors: {}
|
|
1467
1467
|
});
|
|
@@ -1480,24 +1480,24 @@ function xr(e = {}) {
|
|
|
1480
1480
|
errors: s.errors
|
|
1481
1481
|
}), v)
|
|
1482
1482
|
throw v;
|
|
1483
|
-
},
|
|
1484
|
-
S(n, o) && (
|
|
1483
|
+
}, ps = (o, u = {}) => {
|
|
1484
|
+
S(n, o) && (j(u.defaultValue) ? Y(o, G(S(i, o))) : (Y(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()), f.state.next({ ...s }));
|
|
1485
1485
|
}, pt = (o, u = {}) => {
|
|
1486
1486
|
const d = o ? G(o) : i, v = G(d), w = ee(o), b = w ? i : v;
|
|
1487
1487
|
if (u.keepDefaultValues || (i = d), !u.keepValues) {
|
|
1488
1488
|
if (u.keepDirtyValues) {
|
|
1489
1489
|
const E = /* @__PURE__ */ new Set([
|
|
1490
1490
|
...c.mount,
|
|
1491
|
-
...Object.keys(
|
|
1491
|
+
...Object.keys($e(i, r))
|
|
1492
1492
|
]);
|
|
1493
|
-
for (const
|
|
1494
|
-
S(s.dirtyFields,
|
|
1493
|
+
for (const O of Array.from(E))
|
|
1494
|
+
S(s.dirtyFields, O) ? q(b, O, S(r, O)) : Y(O, S(b, O));
|
|
1495
1495
|
} else {
|
|
1496
|
-
if (at &&
|
|
1496
|
+
if (at && j(o))
|
|
1497
1497
|
for (const E of c.mount) {
|
|
1498
|
-
const
|
|
1499
|
-
if (
|
|
1500
|
-
const U = Array.isArray(
|
|
1498
|
+
const O = S(n, E);
|
|
1499
|
+
if (O && O._f) {
|
|
1500
|
+
const U = Array.isArray(O._f.refs) ? O._f.refs[0] : O._f.ref;
|
|
1501
1501
|
if (Ke(U)) {
|
|
1502
1502
|
const oe = U.closest("form");
|
|
1503
1503
|
if (oe) {
|
|
@@ -1509,7 +1509,7 @@ function xr(e = {}) {
|
|
|
1509
1509
|
}
|
|
1510
1510
|
if (u.keepFieldsRef)
|
|
1511
1511
|
for (const E of c.mount)
|
|
1512
|
-
|
|
1512
|
+
Y(E, S(b, E));
|
|
1513
1513
|
else
|
|
1514
1514
|
n = {};
|
|
1515
1515
|
}
|
|
@@ -1531,19 +1531,19 @@ function xr(e = {}) {
|
|
|
1531
1531
|
submitCount: u.keepSubmitCount ? s.submitCount : 0,
|
|
1532
1532
|
isDirty: w ? !1 : u.keepDirty ? s.isDirty : !!(u.keepDefaultValues && !ve(o, i)),
|
|
1533
1533
|
isSubmitted: u.keepIsSubmitted ? s.isSubmitted : !1,
|
|
1534
|
-
dirtyFields: w ? {} : u.keepDirtyValues ? u.keepDefaultValues && r ?
|
|
1534
|
+
dirtyFields: w ? {} : u.keepDirtyValues ? u.keepDefaultValues && r ? $e(i, r) : s.dirtyFields : u.keepDefaultValues && o ? $e(i, o) : u.keepDirty ? s.dirtyFields : {},
|
|
1535
1535
|
touchedFields: u.keepTouched ? s.touchedFields : {},
|
|
1536
1536
|
errors: u.keepErrors ? s.errors : {},
|
|
1537
1537
|
isSubmitSuccessful: u.keepIsSubmitSuccessful ? s.isSubmitSuccessful : !1,
|
|
1538
1538
|
isSubmitting: !1
|
|
1539
1539
|
});
|
|
1540
|
-
}, bt = (o, u) => pt(fe(o) ? o(r) : o, u),
|
|
1540
|
+
}, bt = (o, u) => pt(fe(o) ? o(r) : o, u), bs = (o, u = {}) => {
|
|
1541
1541
|
const d = S(n, o), v = d && d._f;
|
|
1542
1542
|
if (v) {
|
|
1543
1543
|
const w = v.refs ? v.refs[0] : v.ref;
|
|
1544
1544
|
w.focus && (w.focus(), u.shouldSelect && fe(w.select) && w.select());
|
|
1545
1545
|
}
|
|
1546
|
-
},
|
|
1546
|
+
}, ws = (o) => {
|
|
1547
1547
|
s = {
|
|
1548
1548
|
...s,
|
|
1549
1549
|
...o
|
|
@@ -1556,15 +1556,15 @@ function xr(e = {}) {
|
|
|
1556
1556
|
handleSubmit: gt,
|
|
1557
1557
|
setError: mt,
|
|
1558
1558
|
_subscribe: ht,
|
|
1559
|
-
_runSchema:
|
|
1559
|
+
_runSchema: M,
|
|
1560
1560
|
_focusError: Ze,
|
|
1561
|
-
_getWatch:
|
|
1561
|
+
_getWatch: $,
|
|
1562
1562
|
_getDirty: ae,
|
|
1563
1563
|
_setValid: C,
|
|
1564
|
-
_setFieldArray:
|
|
1564
|
+
_setFieldArray: B,
|
|
1565
1565
|
_setDisabledField: yt,
|
|
1566
|
-
_setErrors:
|
|
1567
|
-
_getFieldArray:
|
|
1566
|
+
_setErrors: F,
|
|
1567
|
+
_getFieldArray: L,
|
|
1568
1568
|
_reset: pt,
|
|
1569
1569
|
_resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((o) => {
|
|
1570
1570
|
bt(o, t.resetOptions), f.state.next({
|
|
@@ -1572,7 +1572,7 @@ function xr(e = {}) {
|
|
|
1572
1572
|
});
|
|
1573
1573
|
}),
|
|
1574
1574
|
_removeUnmounted: re,
|
|
1575
|
-
_disableForm:
|
|
1575
|
+
_disableForm: gs,
|
|
1576
1576
|
_subjects: f,
|
|
1577
1577
|
_proxyFormState: y,
|
|
1578
1578
|
get _fields() {
|
|
@@ -1609,19 +1609,19 @@ function xr(e = {}) {
|
|
|
1609
1609
|
};
|
|
1610
1610
|
}
|
|
1611
1611
|
},
|
|
1612
|
-
subscribe:
|
|
1612
|
+
subscribe: ys,
|
|
1613
1613
|
trigger: ne,
|
|
1614
1614
|
register: Xe,
|
|
1615
1615
|
handleSubmit: gt,
|
|
1616
|
-
watch:
|
|
1617
|
-
setValue:
|
|
1616
|
+
watch: hs,
|
|
1617
|
+
setValue: Y,
|
|
1618
1618
|
getValues: ue,
|
|
1619
1619
|
reset: bt,
|
|
1620
|
-
resetField:
|
|
1620
|
+
resetField: ps,
|
|
1621
1621
|
clearErrors: Ce,
|
|
1622
1622
|
unregister: Ye,
|
|
1623
1623
|
setError: mt,
|
|
1624
|
-
setFocus:
|
|
1624
|
+
setFocus: bs,
|
|
1625
1625
|
getFieldState: qe
|
|
1626
1626
|
};
|
|
1627
1627
|
return {
|
|
@@ -1629,7 +1629,7 @@ function xr(e = {}) {
|
|
|
1629
1629
|
formControl: wt
|
|
1630
1630
|
};
|
|
1631
1631
|
}
|
|
1632
|
-
function
|
|
1632
|
+
function ds(e = {}) {
|
|
1633
1633
|
const t = ie.useRef(void 0), s = ie.useRef(void 0), [n, i] = ie.useState({
|
|
1634
1634
|
isDirty: !1,
|
|
1635
1635
|
isValidating: !1,
|
|
@@ -1654,14 +1654,14 @@ function us(e = {}) {
|
|
|
1654
1654
|
formState: n
|
|
1655
1655
|
}, e.defaultValues && !fe(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
1656
1656
|
else {
|
|
1657
|
-
const { formControl: a, ...c } =
|
|
1657
|
+
const { formControl: a, ...c } = Tr(e);
|
|
1658
1658
|
t.current = {
|
|
1659
1659
|
...c,
|
|
1660
1660
|
formState: n
|
|
1661
1661
|
};
|
|
1662
1662
|
}
|
|
1663
1663
|
const r = t.current.control;
|
|
1664
|
-
return r._options = e,
|
|
1664
|
+
return r._options = e, hr(() => {
|
|
1665
1665
|
const a = r._subscribe({
|
|
1666
1666
|
formState: r._proxyFormState,
|
|
1667
1667
|
callback: () => i({ ...r._formState }),
|
|
@@ -1693,10 +1693,10 @@ function us(e = {}) {
|
|
|
1693
1693
|
}), s.current = e.values, i((a) => ({ ...a }))) : r._resetDefaultValues();
|
|
1694
1694
|
}, [r, e.values]), ie.useEffect(() => {
|
|
1695
1695
|
r._state.mount || (r._setValid(), r._state.mount = !0), r._state.watch && (r._state.watch = !1, r._subjects.state.next({ ...r._formState })), r._removeUnmounted();
|
|
1696
|
-
}), t.current.formState =
|
|
1696
|
+
}), t.current.formState = mr(n, r), t.current;
|
|
1697
1697
|
}
|
|
1698
|
-
const
|
|
1699
|
-
const { t } =
|
|
1698
|
+
const bn = (e) => {
|
|
1699
|
+
const { t } = D(), { showStackNotifications: s, showSuccessNotification: n } = Ne(), {
|
|
1700
1700
|
defaultValues: i,
|
|
1701
1701
|
mutationFn: r,
|
|
1702
1702
|
formToDto: a,
|
|
@@ -1704,50 +1704,50 @@ const pn = (e) => {
|
|
|
1704
1704
|
onSuccess: l,
|
|
1705
1705
|
queryKey: m,
|
|
1706
1706
|
onSuccessMessage: y
|
|
1707
|
-
} = e, { control: g, handleSubmit: f, reset: p, setError: _, getValues: C, setValue: N } =
|
|
1707
|
+
} = e, { control: g, handleSubmit: f, reset: p, setError: _, getValues: C, setValue: N } = ds({
|
|
1708
1708
|
defaultValues: i
|
|
1709
|
-
}),
|
|
1710
|
-
(
|
|
1711
|
-
const
|
|
1712
|
-
return
|
|
1713
|
-
const
|
|
1714
|
-
(
|
|
1715
|
-
}),
|
|
1709
|
+
}), B = V(
|
|
1710
|
+
(T) => {
|
|
1711
|
+
const A = T == null ? void 0 : T.errors, I = [];
|
|
1712
|
+
return A && A.forEach(([M, se]) => {
|
|
1713
|
+
const P = document.querySelector(`[name="${M}"]`);
|
|
1714
|
+
(P instanceof HTMLInputElement || P instanceof HTMLTextAreaElement || P instanceof HTMLSelectElement) && (P.focus(), P.classList.add("error"), I.push(t(`_entities:${m}.${M}.${se}`)));
|
|
1715
|
+
}), I;
|
|
1716
1716
|
},
|
|
1717
1717
|
[t, m]
|
|
1718
|
-
), k =
|
|
1719
|
-
document.querySelectorAll("input, textarea, select").forEach((
|
|
1720
|
-
|
|
1718
|
+
), k = V(() => {
|
|
1719
|
+
document.querySelectorAll("input, textarea, select").forEach((A) => {
|
|
1720
|
+
A.classList.remove("error");
|
|
1721
1721
|
});
|
|
1722
|
-
}, []),
|
|
1722
|
+
}, []), F = Me(
|
|
1723
1723
|
{
|
|
1724
1724
|
mutationFn: r,
|
|
1725
|
-
onError: (
|
|
1726
|
-
console.error(
|
|
1727
|
-
const
|
|
1728
|
-
if (c) c(
|
|
1729
|
-
else if (Ge(
|
|
1730
|
-
const
|
|
1725
|
+
onError: (T) => {
|
|
1726
|
+
console.error(T);
|
|
1727
|
+
const A = T;
|
|
1728
|
+
if (c) c(T);
|
|
1729
|
+
else if (Ge(A)) {
|
|
1730
|
+
const I = B(A);
|
|
1731
1731
|
s(
|
|
1732
|
-
|
|
1733
|
-
(
|
|
1734
|
-
message:
|
|
1735
|
-
type:
|
|
1732
|
+
I.map(
|
|
1733
|
+
(M) => ({
|
|
1734
|
+
message: M,
|
|
1735
|
+
type: z.error
|
|
1736
1736
|
})
|
|
1737
1737
|
)
|
|
1738
1738
|
);
|
|
1739
|
-
} else if (Je(
|
|
1740
|
-
const
|
|
1739
|
+
} else if (Je(A)) {
|
|
1740
|
+
const I = A.message || t("_accessibility:errors.500"), M = t(`_accessibility:errors.${A.status}`);
|
|
1741
1741
|
s([
|
|
1742
1742
|
{
|
|
1743
|
-
message:
|
|
1744
|
-
type:
|
|
1743
|
+
message: M || I,
|
|
1744
|
+
type: z.error
|
|
1745
1745
|
}
|
|
1746
1746
|
]);
|
|
1747
1747
|
}
|
|
1748
1748
|
},
|
|
1749
|
-
onSuccess: async (
|
|
1750
|
-
be && await be.invalidateQueries({ queryKey: m }), l && l(
|
|
1749
|
+
onSuccess: async (T) => {
|
|
1750
|
+
be && await be.invalidateQueries({ queryKey: m }), l && l(T), y && n({
|
|
1751
1751
|
message: y
|
|
1752
1752
|
});
|
|
1753
1753
|
}
|
|
@@ -1758,24 +1758,24 @@ const pn = (e) => {
|
|
|
1758
1758
|
getValues: C,
|
|
1759
1759
|
setValue: N,
|
|
1760
1760
|
handleSubmit: f,
|
|
1761
|
-
onSubmit: (
|
|
1762
|
-
k(),
|
|
1763
|
-
a ? a(
|
|
1761
|
+
onSubmit: (T) => {
|
|
1762
|
+
k(), F.mutate(
|
|
1763
|
+
a ? a(T) : T
|
|
1764
1764
|
);
|
|
1765
1765
|
},
|
|
1766
1766
|
reset: p,
|
|
1767
1767
|
setError: _,
|
|
1768
|
-
isLoading:
|
|
1768
|
+
isLoading: F.isPending
|
|
1769
1769
|
};
|
|
1770
|
-
},
|
|
1771
|
-
const { t } =
|
|
1770
|
+
}, $r = (e) => {
|
|
1771
|
+
const { t } = D(), { onClick: s, hidden: n = !1, disabled: i = !1 } = e;
|
|
1772
1772
|
return {
|
|
1773
|
-
action:
|
|
1773
|
+
action: V(
|
|
1774
1774
|
(a) => ({
|
|
1775
1775
|
id: Se.Delete,
|
|
1776
1776
|
hidden: !!a.deletedAt || n,
|
|
1777
1777
|
disabled: !!a.deletedAt || i,
|
|
1778
|
-
icon: /* @__PURE__ */ h(ce, { className: "text-error", icon:
|
|
1778
|
+
icon: /* @__PURE__ */ h(ce, { className: "text-bg-error", icon: Ps }),
|
|
1779
1779
|
tooltip: t("_pages:common.actions.delete.text"),
|
|
1780
1780
|
onClick: () => s([a == null ? void 0 : a.id]),
|
|
1781
1781
|
onMultipleClick: (c) => s(c.map((l) => l.id)),
|
|
@@ -1785,14 +1785,14 @@ const pn = (e) => {
|
|
|
1785
1785
|
)
|
|
1786
1786
|
};
|
|
1787
1787
|
}, Fr = (e) => {
|
|
1788
|
-
const { t } =
|
|
1788
|
+
const { t } = D(), { onClick: s, hidden: n = !1 } = e;
|
|
1789
1789
|
return {
|
|
1790
|
-
action:
|
|
1790
|
+
action: V(
|
|
1791
1791
|
(r) => ({
|
|
1792
1792
|
id: Se.Restore,
|
|
1793
1793
|
hidden: !r.deletedAt || n,
|
|
1794
1794
|
disabled: !r.deletedAt,
|
|
1795
|
-
icon: /* @__PURE__ */ h(ce, { className: "text-error", icon:
|
|
1795
|
+
icon: /* @__PURE__ */ h(ce, { className: "text-bg-error", icon: Ht }),
|
|
1796
1796
|
tooltip: t("_pages:common.actions.restore.text"),
|
|
1797
1797
|
onClick: () => s([r == null ? void 0 : r.id]),
|
|
1798
1798
|
onMultipleClick: (a) => s(a.map((c) => c.id)),
|
|
@@ -1801,15 +1801,15 @@ const pn = (e) => {
|
|
|
1801
1801
|
[n, s, t]
|
|
1802
1802
|
)
|
|
1803
1803
|
};
|
|
1804
|
-
},
|
|
1805
|
-
const { t } =
|
|
1804
|
+
}, wn = (e) => {
|
|
1805
|
+
const { t } = D(), { onClick: s, hidden: n = !1 } = e;
|
|
1806
1806
|
return {
|
|
1807
|
-
action:
|
|
1807
|
+
action: V(
|
|
1808
1808
|
(r) => ({
|
|
1809
1809
|
id: Se.Edit,
|
|
1810
1810
|
hidden: !!r.deletedAt || n,
|
|
1811
1811
|
disabled: !!r.deletedAt,
|
|
1812
|
-
icon: /* @__PURE__ */ h(ce, { className: "primary", icon:
|
|
1812
|
+
icon: /* @__PURE__ */ h(ce, { className: "primary", icon: Os }),
|
|
1813
1813
|
tooltip: t("_pages:common.actions.edit.text"),
|
|
1814
1814
|
onClick: () => s(r == null ? void 0 : r.id)
|
|
1815
1815
|
}),
|
|
@@ -1818,15 +1818,15 @@ const pn = (e) => {
|
|
|
1818
1818
|
};
|
|
1819
1819
|
};
|
|
1820
1820
|
var Se = /* @__PURE__ */ ((e) => (e.Add = "add", e.Edit = "edit", e.Delete = "delete", e.Restore = "restore", e.Refresh = "refresh", e.Export = "export", e.Import = "import", e))(Se || {});
|
|
1821
|
-
const
|
|
1822
|
-
const { t } =
|
|
1821
|
+
const Lr = (e) => {
|
|
1822
|
+
const { t } = D(), {
|
|
1823
1823
|
onClick: s,
|
|
1824
1824
|
hidden: n = !1,
|
|
1825
1825
|
disabled: i = !1,
|
|
1826
1826
|
isLoading: r = !1
|
|
1827
1827
|
} = e;
|
|
1828
1828
|
return {
|
|
1829
|
-
action:
|
|
1829
|
+
action: V(
|
|
1830
1830
|
() => ({
|
|
1831
1831
|
id: Se.Export,
|
|
1832
1832
|
hidden: n,
|
|
@@ -1835,7 +1835,7 @@ const $r = (e) => {
|
|
|
1835
1835
|
ce,
|
|
1836
1836
|
{
|
|
1837
1837
|
className: `${r ? "rotate" : ""}`,
|
|
1838
|
-
icon: r ? Bt :
|
|
1838
|
+
icon: r ? Bt : Ms
|
|
1839
1839
|
}
|
|
1840
1840
|
),
|
|
1841
1841
|
tooltip: t("_pages:common.actions.export.text"),
|
|
@@ -1844,15 +1844,15 @@ const $r = (e) => {
|
|
|
1844
1844
|
[i, n, r, s, t]
|
|
1845
1845
|
)
|
|
1846
1846
|
};
|
|
1847
|
-
},
|
|
1848
|
-
const { t } =
|
|
1847
|
+
}, Dr = (e) => {
|
|
1848
|
+
const { t } = D(), {
|
|
1849
1849
|
onClick: s,
|
|
1850
1850
|
hidden: n = !1,
|
|
1851
1851
|
disabled: i = !1,
|
|
1852
1852
|
isLoading: r = !1
|
|
1853
1853
|
} = e;
|
|
1854
1854
|
return {
|
|
1855
|
-
action:
|
|
1855
|
+
action: V(
|
|
1856
1856
|
() => ({
|
|
1857
1857
|
id: Se.Import,
|
|
1858
1858
|
hidden: n,
|
|
@@ -1861,7 +1861,7 @@ const $r = (e) => {
|
|
|
1861
1861
|
ce,
|
|
1862
1862
|
{
|
|
1863
1863
|
className: `${r ? "rotate" : ""}`,
|
|
1864
|
-
icon: r ? Bt :
|
|
1864
|
+
icon: r ? Bt : Rs
|
|
1865
1865
|
}
|
|
1866
1866
|
),
|
|
1867
1867
|
tooltip: t("_pages:common.actions.import.text"),
|
|
@@ -1870,8 +1870,8 @@ const $r = (e) => {
|
|
|
1870
1870
|
[i, n, r, s, t]
|
|
1871
1871
|
)
|
|
1872
1872
|
};
|
|
1873
|
-
},
|
|
1874
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } =
|
|
1873
|
+
}, vn = (e) => {
|
|
1874
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } = D(), { open: a, onClick: c, close: l, dialogFn: m, isLoading: y } = rs({
|
|
1875
1875
|
onSuccessMessage: r("_pages:common.actions.delete.successMessage"),
|
|
1876
1876
|
onError: (f) => {
|
|
1877
1877
|
const p = f;
|
|
@@ -1880,7 +1880,7 @@ const $r = (e) => {
|
|
|
1880
1880
|
p.errors.map(
|
|
1881
1881
|
([_, C]) => ({
|
|
1882
1882
|
message: r(`_pages:${_}.errors.${C}`),
|
|
1883
|
-
type:
|
|
1883
|
+
type: z.error
|
|
1884
1884
|
})
|
|
1885
1885
|
)
|
|
1886
1886
|
);
|
|
@@ -1889,7 +1889,7 @@ const $r = (e) => {
|
|
|
1889
1889
|
i([
|
|
1890
1890
|
{
|
|
1891
1891
|
message: C || _,
|
|
1892
|
-
type:
|
|
1892
|
+
type: z.error
|
|
1893
1893
|
}
|
|
1894
1894
|
]);
|
|
1895
1895
|
}
|
|
@@ -1898,7 +1898,7 @@ const $r = (e) => {
|
|
|
1898
1898
|
await be.invalidateQueries({ queryKey: t }), s && s(f);
|
|
1899
1899
|
},
|
|
1900
1900
|
...n
|
|
1901
|
-
}), { action: g } =
|
|
1901
|
+
}), { action: g } = $r({ onClick: c });
|
|
1902
1902
|
return {
|
|
1903
1903
|
onClick: c,
|
|
1904
1904
|
title: r("_pages:common.actions.delete.dialog.title"),
|
|
@@ -1908,11 +1908,11 @@ const $r = (e) => {
|
|
|
1908
1908
|
handleClose: l,
|
|
1909
1909
|
action: g
|
|
1910
1910
|
};
|
|
1911
|
-
},
|
|
1912
|
-
const [e, t] =
|
|
1911
|
+
}, fs = () => {
|
|
1912
|
+
const [e, t] = J(!1);
|
|
1913
1913
|
return { open: e, setOpen: t, handleClose: () => t(!1), handleOpen: () => t(!0) };
|
|
1914
|
-
},
|
|
1915
|
-
const { t } =
|
|
1914
|
+
}, _n = (e) => {
|
|
1915
|
+
const { t } = D(), {
|
|
1916
1916
|
showErrorNotification: s,
|
|
1917
1917
|
showStackNotifications: n,
|
|
1918
1918
|
showSuccessNotification: i
|
|
@@ -1927,17 +1927,17 @@ const $r = (e) => {
|
|
|
1927
1927
|
queryKey: f,
|
|
1928
1928
|
onSuccessMessage: p,
|
|
1929
1929
|
title: _
|
|
1930
|
-
} = e, [C, N] =
|
|
1930
|
+
} = e, [C, N] = J(0), { open: B, handleClose: k, handleOpen: F } = fs(), { control: T, handleSubmit: A, reset: I, setError: M, getValues: se, setValue: P } = ds({
|
|
1931
1931
|
defaultValues: r
|
|
1932
|
-
}), { data: re, isLoading: ae } =
|
|
1932
|
+
}), { data: re, isLoading: ae } = Xs({
|
|
1933
1933
|
queryFn: () => a == null ? void 0 : a(C),
|
|
1934
1934
|
queryKey: [...f, C],
|
|
1935
1935
|
enabled: !!a && !!f && !!C
|
|
1936
1936
|
});
|
|
1937
1937
|
le(() => {
|
|
1938
|
-
re && m &&
|
|
1938
|
+
re && m && I({ ...m(re) });
|
|
1939
1939
|
}, [re]);
|
|
1940
|
-
const
|
|
1940
|
+
const $ = V(
|
|
1941
1941
|
(R) => {
|
|
1942
1942
|
const X = R == null ? void 0 : R.errors, ne = [];
|
|
1943
1943
|
return X && X.forEach(([ue, qe]) => {
|
|
@@ -1946,30 +1946,30 @@ const $r = (e) => {
|
|
|
1946
1946
|
}), ne;
|
|
1947
1947
|
},
|
|
1948
1948
|
[t, f]
|
|
1949
|
-
),
|
|
1949
|
+
), L = V(() => {
|
|
1950
1950
|
document.querySelectorAll("input, textarea, select").forEach((X) => {
|
|
1951
1951
|
X.classList.remove("error");
|
|
1952
1952
|
});
|
|
1953
|
-
}, []),
|
|
1953
|
+
}, []), H = V(
|
|
1954
1954
|
(R) => {
|
|
1955
|
-
N(R ?? 0),
|
|
1955
|
+
N(R ?? 0), F();
|
|
1956
1956
|
},
|
|
1957
|
-
[
|
|
1958
|
-
), W =
|
|
1959
|
-
|
|
1960
|
-
}, [
|
|
1957
|
+
[F]
|
|
1958
|
+
), W = V(() => {
|
|
1959
|
+
L(), k(), I();
|
|
1960
|
+
}, [I, L, k]), Y = Me({
|
|
1961
1961
|
mutationFn: c,
|
|
1962
1962
|
onError: (R) => {
|
|
1963
1963
|
if (console.error(R), y) y(R);
|
|
1964
1964
|
else {
|
|
1965
1965
|
const X = R;
|
|
1966
1966
|
if (Ge(X)) {
|
|
1967
|
-
const ne =
|
|
1967
|
+
const ne = $(X);
|
|
1968
1968
|
n(
|
|
1969
1969
|
ne.map(
|
|
1970
1970
|
(ue) => ({
|
|
1971
1971
|
message: ue,
|
|
1972
|
-
type:
|
|
1972
|
+
type: z.error
|
|
1973
1973
|
})
|
|
1974
1974
|
)
|
|
1975
1975
|
);
|
|
@@ -1987,23 +1987,23 @@ const $r = (e) => {
|
|
|
1987
1987
|
}
|
|
1988
1988
|
});
|
|
1989
1989
|
return {
|
|
1990
|
-
open:
|
|
1991
|
-
openDialog:
|
|
1990
|
+
open: B,
|
|
1991
|
+
openDialog: H,
|
|
1992
1992
|
handleClose: W,
|
|
1993
|
-
control:
|
|
1993
|
+
control: T,
|
|
1994
1994
|
getValues: se,
|
|
1995
|
-
setValue:
|
|
1996
|
-
handleSubmit:
|
|
1997
|
-
onSubmit: (R) =>
|
|
1995
|
+
setValue: P,
|
|
1996
|
+
handleSubmit: A,
|
|
1997
|
+
onSubmit: (R) => Y.mutate(
|
|
1998
1998
|
l ? l(R) : R
|
|
1999
1999
|
),
|
|
2000
|
-
reset:
|
|
2001
|
-
setError:
|
|
2000
|
+
reset: I,
|
|
2001
|
+
setError: M,
|
|
2002
2002
|
title: _,
|
|
2003
|
-
isLoading: ae ||
|
|
2003
|
+
isLoading: ae || Y.isPending
|
|
2004
2004
|
};
|
|
2005
|
-
},
|
|
2006
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } =
|
|
2005
|
+
}, Sn = (e) => {
|
|
2006
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } = D(), { open: a, onClick: c, close: l, dialogFn: m, isLoading: y } = rs({
|
|
2007
2007
|
onSuccessMessage: r("_pages:common.actions.restore.successMessage"),
|
|
2008
2008
|
onError: (f) => {
|
|
2009
2009
|
const p = f;
|
|
@@ -2012,7 +2012,7 @@ const $r = (e) => {
|
|
|
2012
2012
|
p.errors.map(
|
|
2013
2013
|
([_, C]) => ({
|
|
2014
2014
|
message: r(`_pages:${_}.errors.${C}`),
|
|
2015
|
-
type:
|
|
2015
|
+
type: z.error
|
|
2016
2016
|
})
|
|
2017
2017
|
)
|
|
2018
2018
|
);
|
|
@@ -2021,7 +2021,7 @@ const $r = (e) => {
|
|
|
2021
2021
|
i([
|
|
2022
2022
|
{
|
|
2023
2023
|
message: C || _,
|
|
2024
|
-
type:
|
|
2024
|
+
type: z.error
|
|
2025
2025
|
}
|
|
2026
2026
|
]);
|
|
2027
2027
|
}
|
|
@@ -2041,8 +2041,8 @@ const $r = (e) => {
|
|
|
2041
2041
|
action: g
|
|
2042
2042
|
};
|
|
2043
2043
|
};
|
|
2044
|
-
function
|
|
2045
|
-
const { t } =
|
|
2044
|
+
function Cn(e) {
|
|
2045
|
+
const { t } = D(), { queryKey: s, mutationFn: n, entity: i, fileProcessor: r, onError: a } = e, [c, l] = J(!1), [m, y] = J(null), [g, f] = J(!1), p = Me({
|
|
2046
2046
|
mutationFn: n,
|
|
2047
2047
|
onError: (C) => {
|
|
2048
2048
|
console.error(C), a == null || a(C);
|
|
@@ -2050,7 +2050,7 @@ function Sn(e) {
|
|
|
2050
2050
|
onSuccess: async () => {
|
|
2051
2051
|
be && await be.invalidateQueries({ queryKey: s });
|
|
2052
2052
|
}
|
|
2053
|
-
}), { action: _ } =
|
|
2053
|
+
}), { action: _ } = Dr({
|
|
2054
2054
|
onClick: () => l(!0)
|
|
2055
2055
|
});
|
|
2056
2056
|
return {
|
|
@@ -2079,8 +2079,8 @@ function Sn(e) {
|
|
|
2079
2079
|
action: _
|
|
2080
2080
|
};
|
|
2081
2081
|
}
|
|
2082
|
-
const
|
|
2083
|
-
const { showSuccessNotification: t } = Ne(), { t: s } =
|
|
2082
|
+
const En = (e) => {
|
|
2083
|
+
const { showSuccessNotification: t } = Ne(), { t: s } = D(), {
|
|
2084
2084
|
entity: n,
|
|
2085
2085
|
mutationFn: i,
|
|
2086
2086
|
onError: r,
|
|
@@ -2097,9 +2097,9 @@ const Cn = (e) => {
|
|
|
2097
2097
|
message: c
|
|
2098
2098
|
});
|
|
2099
2099
|
}
|
|
2100
|
-
}), m =
|
|
2100
|
+
}), m = V(() => {
|
|
2101
2101
|
l.mutate();
|
|
2102
|
-
}, [l]), { action: y } =
|
|
2102
|
+
}, [l]), { action: y } = Lr({
|
|
2103
2103
|
onClick: m,
|
|
2104
2104
|
isLoading: l.isPending
|
|
2105
2105
|
});
|
|
@@ -2107,8 +2107,8 @@ const Cn = (e) => {
|
|
|
2107
2107
|
action: y
|
|
2108
2108
|
};
|
|
2109
2109
|
};
|
|
2110
|
-
function
|
|
2111
|
-
const [t, s] =
|
|
2110
|
+
function Vr(e) {
|
|
2111
|
+
const [t, s] = J(!1), n = V(() => {
|
|
2112
2112
|
const i = window.scrollY > e;
|
|
2113
2113
|
s(i);
|
|
2114
2114
|
}, [e]);
|
|
@@ -2116,27 +2116,27 @@ function Dr(e) {
|
|
|
2116
2116
|
window.removeEventListener("scroll", n);
|
|
2117
2117
|
}), [n]), t;
|
|
2118
2118
|
}
|
|
2119
|
-
const
|
|
2120
|
-
const { t: e } =
|
|
2119
|
+
const Nn = () => {
|
|
2120
|
+
const { t: e } = D(), t = Vr(200);
|
|
2121
2121
|
return /* @__PURE__ */ h(
|
|
2122
2122
|
pe,
|
|
2123
2123
|
{
|
|
2124
2124
|
variant: "submit",
|
|
2125
2125
|
color: "primary",
|
|
2126
|
-
icon:
|
|
2126
|
+
icon: Us,
|
|
2127
2127
|
"data-tooltip-id": "tooltip",
|
|
2128
|
-
onClick: () =>
|
|
2128
|
+
onClick: () => tr.scrollTo(0, 0),
|
|
2129
2129
|
className: `to-top ${t ? "show" : "hide"}`,
|
|
2130
2130
|
"data-tooltip-content": e("_accessibility:buttons.toTop")
|
|
2131
2131
|
}
|
|
2132
2132
|
);
|
|
2133
|
-
},
|
|
2134
|
-
const { actions: t = [], className: s = "" } = e, { t: n } =
|
|
2135
|
-
return /* @__PURE__ */
|
|
2133
|
+
}, Ir = (e) => {
|
|
2134
|
+
const { actions: t = [], className: s = "" } = e, { t: n } = D(), [i, r] = J(!1), [a, c] = J(null);
|
|
2135
|
+
return /* @__PURE__ */ x("div", { className: `actions-dropdown ${s}`, children: [
|
|
2136
2136
|
/* @__PURE__ */ h(
|
|
2137
2137
|
pe,
|
|
2138
2138
|
{
|
|
2139
|
-
icon:
|
|
2139
|
+
icon: qs,
|
|
2140
2140
|
onClick: (l) => {
|
|
2141
2141
|
c(l.currentTarget), r((m) => !m);
|
|
2142
2142
|
},
|
|
@@ -2146,13 +2146,13 @@ const En = () => {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
),
|
|
2148
2148
|
/* @__PURE__ */ h(
|
|
2149
|
-
|
|
2149
|
+
ks,
|
|
2150
2150
|
{
|
|
2151
2151
|
open: i,
|
|
2152
2152
|
onClose: () => r(!1),
|
|
2153
2153
|
anchorEl: a,
|
|
2154
2154
|
children: /* @__PURE__ */ h(
|
|
2155
|
-
|
|
2155
|
+
Wt,
|
|
2156
2156
|
{
|
|
2157
2157
|
showActionTexts: !0,
|
|
2158
2158
|
actions: t,
|
|
@@ -2165,59 +2165,65 @@ const En = () => {
|
|
|
2165
2165
|
}
|
|
2166
2166
|
)
|
|
2167
2167
|
] });
|
|
2168
|
-
},
|
|
2168
|
+
}, Rt = (e) => e == null ? !1 : `${e}`.length > 0, kn = qt(function(e, t) {
|
|
2169
2169
|
const {
|
|
2170
2170
|
value: s,
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2171
|
+
defaultValue: n,
|
|
2172
|
+
onChange: i,
|
|
2173
|
+
state: r = As.default,
|
|
2174
|
+
name: a = "",
|
|
2175
|
+
id: c = "",
|
|
2176
|
+
label: l = "",
|
|
2177
|
+
disabled: m = !1,
|
|
2178
|
+
required: y = !1,
|
|
2179
|
+
containerClassName: g = "",
|
|
2180
|
+
inputClassName: f = "",
|
|
2181
|
+
labelClassName: p = "",
|
|
2182
|
+
helperText: _ = "",
|
|
2183
|
+
helperTextClassName: C = "",
|
|
2184
|
+
...N
|
|
2185
|
+
} = e, B = s !== void 0, [k, F] = J(
|
|
2186
|
+
() => Rt(n)
|
|
2187
|
+
), T = B ? Rt(s) : k, A = (I) => {
|
|
2188
|
+
B || F(I.currentTarget.value.length > 0), i == null || i(I);
|
|
2189
|
+
};
|
|
2190
|
+
return /* @__PURE__ */ x("div", { className: `form-paragraph-container group ${g}`, children: [
|
|
2186
2191
|
/* @__PURE__ */ h(
|
|
2187
2192
|
"textarea",
|
|
2188
2193
|
{
|
|
2189
2194
|
ref: t,
|
|
2190
|
-
name:
|
|
2191
|
-
id:
|
|
2192
|
-
className: `text-input text-area form-paragraph-textarea peer ${
|
|
2193
|
-
required:
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2195
|
+
name: a,
|
|
2196
|
+
id: c,
|
|
2197
|
+
className: `text-input text-area form-paragraph-textarea peer ${xs(r)} ${T ? "has-value" : ""} ${N.placeholder ? "has-placeholder" : ""} ${f}`,
|
|
2198
|
+
required: y,
|
|
2199
|
+
defaultValue: n,
|
|
2200
|
+
...B ? { value: s } : {},
|
|
2201
|
+
onChange: A,
|
|
2202
|
+
disabled: m,
|
|
2203
|
+
...N
|
|
2198
2204
|
}
|
|
2199
2205
|
),
|
|
2200
|
-
/* @__PURE__ */
|
|
2206
|
+
/* @__PURE__ */ x(
|
|
2201
2207
|
"label",
|
|
2202
2208
|
{
|
|
2203
|
-
htmlFor:
|
|
2204
|
-
className: `text-input-label ${
|
|
2209
|
+
htmlFor: c,
|
|
2210
|
+
className: `text-input-label ${Ts(r)} ${p}`,
|
|
2205
2211
|
children: [
|
|
2206
|
-
|
|
2207
|
-
|
|
2212
|
+
l,
|
|
2213
|
+
y ? " *" : ""
|
|
2208
2214
|
]
|
|
2209
2215
|
}
|
|
2210
2216
|
),
|
|
2211
|
-
!!
|
|
2217
|
+
!!_ && /* @__PURE__ */ h(
|
|
2212
2218
|
"p",
|
|
2213
2219
|
{
|
|
2214
|
-
className: `text-input-helper-text ${
|
|
2215
|
-
children:
|
|
2220
|
+
className: `text-input-helper-text ${$s(r)} ${C}`,
|
|
2221
|
+
children: _
|
|
2216
2222
|
}
|
|
2217
2223
|
)
|
|
2218
2224
|
] });
|
|
2219
|
-
}),
|
|
2220
|
-
const { t } =
|
|
2225
|
+
}), An = (e) => {
|
|
2226
|
+
const { t } = D(), {
|
|
2221
2227
|
children: s,
|
|
2222
2228
|
handleSubmit: n,
|
|
2223
2229
|
onSubmit: i,
|
|
@@ -2225,10 +2231,10 @@ const En = () => {
|
|
|
2225
2231
|
buttonEnd: a = !0,
|
|
2226
2232
|
reset: c
|
|
2227
2233
|
} = e;
|
|
2228
|
-
return /* @__PURE__ */
|
|
2234
|
+
return /* @__PURE__ */ x("form", { className: "form-container", onSubmit: n(i), children: [
|
|
2229
2235
|
s,
|
|
2230
|
-
/* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ x("div", { className: `form-actions ${a ? "end" : ""}`, children: [
|
|
2237
|
+
/* @__PURE__ */ x(
|
|
2232
2238
|
_e,
|
|
2233
2239
|
{
|
|
2234
2240
|
type: "submit",
|
|
@@ -2256,8 +2262,8 @@ const En = () => {
|
|
|
2256
2262
|
)
|
|
2257
2263
|
] })
|
|
2258
2264
|
] });
|
|
2259
|
-
},
|
|
2260
|
-
const { t: s } =
|
|
2265
|
+
}, xn = qt(function(e, t) {
|
|
2266
|
+
const { t: s } = D(), [n, i] = J(!1);
|
|
2261
2267
|
return /* @__PURE__ */ h(Fs, { ...e, type: n ? "text" : "password", ref: t, children: /* @__PURE__ */ h(
|
|
2262
2268
|
pe,
|
|
2263
2269
|
{
|
|
@@ -2268,11 +2274,11 @@ const En = () => {
|
|
|
2268
2274
|
),
|
|
2269
2275
|
className: "password-icon",
|
|
2270
2276
|
onClick: () => i(!n),
|
|
2271
|
-
icon: n ?
|
|
2277
|
+
icon: n ? Hs : Bs
|
|
2272
2278
|
}
|
|
2273
2279
|
) });
|
|
2274
2280
|
}), dt = (e) => {
|
|
2275
|
-
const { t } =
|
|
2281
|
+
const { t } = D(), {
|
|
2276
2282
|
title: s,
|
|
2277
2283
|
children: n,
|
|
2278
2284
|
handleClose: i,
|
|
@@ -2280,7 +2286,7 @@ const En = () => {
|
|
|
2280
2286
|
containerClassName: a = "",
|
|
2281
2287
|
className: c = "",
|
|
2282
2288
|
animationClass: l = "appear"
|
|
2283
|
-
} = e, m =
|
|
2289
|
+
} = e, m = V(
|
|
2284
2290
|
(g) => {
|
|
2285
2291
|
g.key === "Escape" && r && i();
|
|
2286
2292
|
},
|
|
@@ -2289,7 +2295,7 @@ const En = () => {
|
|
|
2289
2295
|
le(() => (window.addEventListener("keydown", m), () => {
|
|
2290
2296
|
window.removeEventListener("keydown", m);
|
|
2291
2297
|
}), [m]);
|
|
2292
|
-
const y =
|
|
2298
|
+
const y = V(
|
|
2293
2299
|
(g) => {
|
|
2294
2300
|
g.target === g.currentTarget && i();
|
|
2295
2301
|
},
|
|
@@ -2302,7 +2308,7 @@ const En = () => {
|
|
|
2302
2308
|
return g(r), () => {
|
|
2303
2309
|
g(!1);
|
|
2304
2310
|
};
|
|
2305
|
-
}, [r]),
|
|
2311
|
+
}, [r]), Kt(
|
|
2306
2312
|
/* @__PURE__ */ h(
|
|
2307
2313
|
"div",
|
|
2308
2314
|
{
|
|
@@ -2310,17 +2316,17 @@ const En = () => {
|
|
|
2310
2316
|
"aria-hidden": !r,
|
|
2311
2317
|
onClick: y,
|
|
2312
2318
|
className: `dialog-backdrop animated ${r ? `opened ${l}` : "closed"} ${a}`,
|
|
2313
|
-
children: /* @__PURE__ */
|
|
2319
|
+
children: /* @__PURE__ */ x(
|
|
2314
2320
|
"div",
|
|
2315
2321
|
{
|
|
2316
2322
|
className: `dialog elevated animated ${r ? `opened ${l}` : "closed"} ${c}`,
|
|
2317
2323
|
children: [
|
|
2318
|
-
/* @__PURE__ */
|
|
2324
|
+
/* @__PURE__ */ x("div", { className: "dialog-header", children: [
|
|
2319
2325
|
/* @__PURE__ */ h("h3", { className: "dialog-title", children: s }),
|
|
2320
2326
|
/* @__PURE__ */ h(
|
|
2321
2327
|
pe,
|
|
2322
2328
|
{
|
|
2323
|
-
icon:
|
|
2329
|
+
icon: Qt,
|
|
2324
2330
|
disabled: !r,
|
|
2325
2331
|
"aria-disabled": !r,
|
|
2326
2332
|
onClick: i,
|
|
@@ -2355,12 +2361,12 @@ const En = () => {
|
|
|
2355
2361
|
cancelName: p,
|
|
2356
2362
|
cancelAriaLabel: _
|
|
2357
2363
|
} = e;
|
|
2358
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ x(
|
|
2359
2365
|
"div",
|
|
2360
2366
|
{
|
|
2361
2367
|
className: `dialog-actions ${y ? "end" : ""} ${l}`,
|
|
2362
2368
|
children: [
|
|
2363
|
-
/* @__PURE__ */
|
|
2369
|
+
/* @__PURE__ */ x(
|
|
2364
2370
|
_e,
|
|
2365
2371
|
{
|
|
2366
2372
|
type: c,
|
|
@@ -2392,8 +2398,8 @@ const En = () => {
|
|
|
2392
2398
|
]
|
|
2393
2399
|
}
|
|
2394
2400
|
);
|
|
2395
|
-
},
|
|
2396
|
-
const { t } =
|
|
2401
|
+
}, Tn = (e) => {
|
|
2402
|
+
const { t } = D(), {
|
|
2397
2403
|
children: s,
|
|
2398
2404
|
handleSubmit: n,
|
|
2399
2405
|
onSubmit: i,
|
|
@@ -2402,7 +2408,7 @@ const En = () => {
|
|
|
2402
2408
|
buttonEnd: c = !0,
|
|
2403
2409
|
...l
|
|
2404
2410
|
} = e;
|
|
2405
|
-
return /* @__PURE__ */ h(dt, { ...l, handleClose: r, children: /* @__PURE__ */
|
|
2411
|
+
return /* @__PURE__ */ h(dt, { ...l, handleClose: r, children: /* @__PURE__ */ x("form", { onSubmit: n(i), children: [
|
|
2406
2412
|
/* @__PURE__ */ h("div", { className: "form-container", children: s }),
|
|
2407
2413
|
/* @__PURE__ */ h(
|
|
2408
2414
|
ft,
|
|
@@ -2422,15 +2428,15 @@ const En = () => {
|
|
|
2422
2428
|
}
|
|
2423
2429
|
)
|
|
2424
2430
|
] }) });
|
|
2425
|
-
},
|
|
2426
|
-
const { t } =
|
|
2431
|
+
}, $n = (e) => {
|
|
2432
|
+
const { t } = D(), {
|
|
2427
2433
|
children: s,
|
|
2428
2434
|
handleSubmit: n,
|
|
2429
2435
|
handleClose: i,
|
|
2430
2436
|
isLoading: r = !1,
|
|
2431
2437
|
...a
|
|
2432
2438
|
} = e;
|
|
2433
|
-
return /* @__PURE__ */
|
|
2439
|
+
return /* @__PURE__ */ x(dt, { ...a, handleClose: i, children: [
|
|
2434
2440
|
s,
|
|
2435
2441
|
/* @__PURE__ */ h(
|
|
2436
2442
|
ft,
|
|
@@ -2451,26 +2457,26 @@ const En = () => {
|
|
|
2451
2457
|
)
|
|
2452
2458
|
] });
|
|
2453
2459
|
};
|
|
2454
|
-
function
|
|
2455
|
-
const { message: t, className: s = "" } = e, { t: n } =
|
|
2460
|
+
function Pr(e) {
|
|
2461
|
+
const { message: t, className: s = "" } = e, { t: n } = D();
|
|
2456
2462
|
return /* @__PURE__ */ h("p", { className: `import-error-message ${s}`, children: t ?? n("_messages:errors.parseFile", {
|
|
2457
2463
|
defaultValue: "Failed to process file"
|
|
2458
2464
|
}) });
|
|
2459
2465
|
}
|
|
2460
|
-
function
|
|
2461
|
-
const { message: t, className: s = "" } = e, { t: n } =
|
|
2462
|
-
return /* @__PURE__ */
|
|
2466
|
+
function Or(e) {
|
|
2467
|
+
const { message: t, className: s = "" } = e, { t: n } = D();
|
|
2468
|
+
return /* @__PURE__ */ x("div", { className: `import-loading ${s}`, children: [
|
|
2463
2469
|
/* @__PURE__ */ h(xe, { loaderClass: "w-5 h-5", className: "!w-auto" }),
|
|
2464
2470
|
/* @__PURE__ */ h("span", { children: t ?? n("_messages:loading.processingFile", {
|
|
2465
2471
|
defaultValue: "Processing file..."
|
|
2466
2472
|
}) })
|
|
2467
2473
|
] });
|
|
2468
2474
|
}
|
|
2469
|
-
function
|
|
2470
|
-
const { items: t, max: s = 5, className: n = "" } = e, { t: i } =
|
|
2475
|
+
function Mr(e) {
|
|
2476
|
+
const { items: t, max: s = 5, className: n = "" } = e, { t: i } = D();
|
|
2471
2477
|
if (!t || t.length === 0) return null;
|
|
2472
2478
|
const r = t.slice(0, s);
|
|
2473
|
-
return /* @__PURE__ */
|
|
2479
|
+
return /* @__PURE__ */ x("div", { className: `import-preview ${n}`, children: [
|
|
2474
2480
|
/* @__PURE__ */ h("p", { className: "import-preview-count", children: i("_pages:common.actions.import.previewCount", {
|
|
2475
2481
|
count: t.length,
|
|
2476
2482
|
defaultValue: `Preview: ${t.length} items`
|
|
@@ -2478,7 +2484,7 @@ function Or(e) {
|
|
|
2478
2484
|
/* @__PURE__ */ h("pre", { className: "import-preview-content", children: JSON.stringify(r, null, 2) })
|
|
2479
2485
|
] });
|
|
2480
2486
|
}
|
|
2481
|
-
const
|
|
2487
|
+
const ms = () => ({
|
|
2482
2488
|
file: null,
|
|
2483
2489
|
previewItems: null,
|
|
2484
2490
|
parseError: null,
|
|
@@ -2486,7 +2492,7 @@ const fs = () => ({
|
|
|
2486
2492
|
overrideExisting: !1,
|
|
2487
2493
|
inputKey: 0
|
|
2488
2494
|
});
|
|
2489
|
-
function
|
|
2495
|
+
function Rr(e, t) {
|
|
2490
2496
|
switch (t.type) {
|
|
2491
2497
|
case "SET_FILE":
|
|
2492
2498
|
return { ...e, file: t.file, previewItems: null, parseError: null, processing: !1 };
|
|
@@ -2499,11 +2505,11 @@ function Mr(e, t) {
|
|
|
2499
2505
|
case "SET_OVERRIDE":
|
|
2500
2506
|
return { ...e, overrideExisting: t.value };
|
|
2501
2507
|
case "RESET":
|
|
2502
|
-
return { ...
|
|
2508
|
+
return { ...ms(), inputKey: e.inputKey + 1 };
|
|
2503
2509
|
}
|
|
2504
2510
|
}
|
|
2505
2511
|
const Fn = (e) => {
|
|
2506
|
-
const { t } =
|
|
2512
|
+
const { t } = D(), {
|
|
2507
2513
|
children: s,
|
|
2508
2514
|
handleSubmit: n,
|
|
2509
2515
|
handleClose: i,
|
|
@@ -2513,58 +2519,58 @@ const Fn = (e) => {
|
|
|
2513
2519
|
onOverrideChange: l,
|
|
2514
2520
|
open: m,
|
|
2515
2521
|
...y
|
|
2516
|
-
} = e, [g, f] =
|
|
2522
|
+
} = e, [g, f] = Ut(Rr, ms()), { file: p, previewItems: _, parseError: C, processing: N, overrideExisting: B, inputKey: k } = g, F = Ie(c), T = Ie(a);
|
|
2517
2523
|
le(() => {
|
|
2518
|
-
|
|
2524
|
+
F.current = c;
|
|
2519
2525
|
}, [c]), le(() => {
|
|
2520
|
-
|
|
2526
|
+
T.current = a;
|
|
2521
2527
|
}, [a]), le(() => {
|
|
2522
2528
|
m || f({ type: "RESET" });
|
|
2523
2529
|
}, [m]);
|
|
2524
|
-
const
|
|
2530
|
+
const A = V(async (I, M) => {
|
|
2525
2531
|
var se;
|
|
2526
|
-
if (
|
|
2532
|
+
if (T.current) {
|
|
2527
2533
|
f({ type: "START_PROCESSING" });
|
|
2528
2534
|
try {
|
|
2529
|
-
const
|
|
2530
|
-
f({ type: "SET_PREVIEW", items:
|
|
2531
|
-
} catch (
|
|
2532
|
-
console.error(
|
|
2533
|
-
const re =
|
|
2535
|
+
const P = await T.current(I, { override: M });
|
|
2536
|
+
f({ type: "SET_PREVIEW", items: P ?? [] }), (se = F.current) == null || se.call(F, P ?? []);
|
|
2537
|
+
} catch (P) {
|
|
2538
|
+
console.error(P);
|
|
2539
|
+
const re = P instanceof Error ? P.message : "Failed to parse file";
|
|
2534
2540
|
f({ type: "SET_ERROR", message: re });
|
|
2535
2541
|
}
|
|
2536
2542
|
}
|
|
2537
2543
|
}, []);
|
|
2538
|
-
return /* @__PURE__ */
|
|
2544
|
+
return /* @__PURE__ */ x(dt, { ...y, open: m, handleClose: i, children: [
|
|
2539
2545
|
/* @__PURE__ */ h(
|
|
2540
|
-
|
|
2546
|
+
Ls,
|
|
2541
2547
|
{
|
|
2542
2548
|
onClear: () => {
|
|
2543
|
-
var
|
|
2544
|
-
f({ type: "SET_FILE", file: null }), (
|
|
2549
|
+
var I;
|
|
2550
|
+
f({ type: "SET_FILE", file: null }), (I = F.current) == null || I.call(F, []);
|
|
2545
2551
|
},
|
|
2546
|
-
onChange: (
|
|
2547
|
-
var se,
|
|
2548
|
-
const
|
|
2549
|
-
if (!
|
|
2550
|
-
f({ type: "SET_FILE", file: null }), (
|
|
2552
|
+
onChange: (I) => {
|
|
2553
|
+
var se, P;
|
|
2554
|
+
const M = (se = I.target.files) == null ? void 0 : se[0];
|
|
2555
|
+
if (!M) {
|
|
2556
|
+
f({ type: "SET_FILE", file: null }), (P = F.current) == null || P.call(F, []);
|
|
2551
2557
|
return;
|
|
2552
2558
|
}
|
|
2553
|
-
f({ type: "SET_FILE", file:
|
|
2559
|
+
f({ type: "SET_FILE", file: M }), A(M, B);
|
|
2554
2560
|
},
|
|
2555
2561
|
label: t("_accessibility:labels.file")
|
|
2556
2562
|
},
|
|
2557
2563
|
k
|
|
2558
2564
|
),
|
|
2559
|
-
/* @__PURE__ */
|
|
2565
|
+
/* @__PURE__ */ x("label", { className: "import-override-label", children: [
|
|
2560
2566
|
/* @__PURE__ */ h(
|
|
2561
2567
|
"input",
|
|
2562
2568
|
{
|
|
2563
2569
|
type: "checkbox",
|
|
2564
|
-
checked:
|
|
2565
|
-
onChange: (
|
|
2566
|
-
const
|
|
2567
|
-
f({ type: "SET_OVERRIDE", value:
|
|
2570
|
+
checked: B,
|
|
2571
|
+
onChange: (I) => {
|
|
2572
|
+
const M = I.target.checked;
|
|
2573
|
+
f({ type: "SET_OVERRIDE", value: M }), l == null || l(M), p && A(p, M);
|
|
2568
2574
|
}
|
|
2569
2575
|
}
|
|
2570
2576
|
),
|
|
@@ -2572,9 +2578,9 @@ const Fn = (e) => {
|
|
|
2572
2578
|
defaultValue: "Override existing items"
|
|
2573
2579
|
}) })
|
|
2574
2580
|
] }),
|
|
2575
|
-
/* @__PURE__ */ h(
|
|
2576
|
-
N && /* @__PURE__ */ h(
|
|
2577
|
-
!!_ && _.length > 0 && /* @__PURE__ */ h(
|
|
2581
|
+
/* @__PURE__ */ h(Pr, { message: C }),
|
|
2582
|
+
N && /* @__PURE__ */ h(Or, {}),
|
|
2583
|
+
!!_ && _.length > 0 && /* @__PURE__ */ h(Mr, { items: _ }),
|
|
2578
2584
|
s,
|
|
2579
2585
|
/* @__PURE__ */ h(
|
|
2580
2586
|
ft,
|
|
@@ -2596,11 +2602,11 @@ const Fn = (e) => {
|
|
|
2596
2602
|
)
|
|
2597
2603
|
] });
|
|
2598
2604
|
};
|
|
2599
|
-
function
|
|
2600
|
-
const { t } =
|
|
2601
|
-
const
|
|
2602
|
-
return
|
|
2603
|
-
}), [a == null ? void 0 : a.email, i]), f =
|
|
2605
|
+
function Ln(e) {
|
|
2606
|
+
const { t } = D(), { open: s, onClose: n, menuMap: i, logo: r } = e, { account: a } = es(), { dynamicItems: c } = or(), { linkComponent: l, location: m } = Re(), y = l, g = Ae(() => i.filter((N) => {
|
|
2607
|
+
const B = N.auth, k = !!(a != null && a.email);
|
|
2608
|
+
return B == null || B && k || !B && !k;
|
|
2609
|
+
}), [a == null ? void 0 : a.email, i]), f = V(
|
|
2604
2610
|
(N) => {
|
|
2605
2611
|
N.key === "Escape" && s && n();
|
|
2606
2612
|
},
|
|
@@ -2609,10 +2615,10 @@ function $n(e) {
|
|
|
2609
2615
|
le(() => (document.addEventListener("keydown", f), () => {
|
|
2610
2616
|
document.removeEventListener("keydown", f);
|
|
2611
2617
|
}), [f]);
|
|
2612
|
-
const p =
|
|
2613
|
-
(N,
|
|
2618
|
+
const p = V(
|
|
2619
|
+
(N, B) => B ? N === `${m.pathname}${m.search}` : N === m.pathname,
|
|
2614
2620
|
[m.pathname, m.search]
|
|
2615
|
-
), _ =
|
|
2621
|
+
), _ = V(
|
|
2616
2622
|
(N) => /* @__PURE__ */ h(
|
|
2617
2623
|
"li",
|
|
2618
2624
|
{
|
|
@@ -2633,13 +2639,13 @@ function $n(e) {
|
|
|
2633
2639
|
N.id
|
|
2634
2640
|
),
|
|
2635
2641
|
[y, s, t, p]
|
|
2636
|
-
), C = Ae(() => g.map((N,
|
|
2637
|
-
const k = N.page ?? String(
|
|
2642
|
+
), C = Ae(() => g.map((N, B) => {
|
|
2643
|
+
const k = N.page ?? String(B), F = `drawer-list-item ${p(N.path) ? "active" : ""} animated`;
|
|
2638
2644
|
if (N.type === "divider")
|
|
2639
|
-
return /* @__PURE__ */ h("li", { className:
|
|
2640
|
-
const
|
|
2641
|
-
return /* @__PURE__ */
|
|
2642
|
-
/* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ h("li", { className: F, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, k);
|
|
2646
|
+
const T = N.children ?? (N.page && c ? c[N.page] : null);
|
|
2647
|
+
return /* @__PURE__ */ x("li", { className: F, children: [
|
|
2648
|
+
/* @__PURE__ */ x(
|
|
2643
2649
|
y,
|
|
2644
2650
|
{
|
|
2645
2651
|
tabIndex: s ? 0 : -1,
|
|
@@ -2654,7 +2660,7 @@ function $n(e) {
|
|
|
2654
2660
|
]
|
|
2655
2661
|
}
|
|
2656
2662
|
),
|
|
2657
|
-
|
|
2663
|
+
T && /* @__PURE__ */ h("ul", { className: "drawer-children-list", children: T.map(_) })
|
|
2658
2664
|
] }, k);
|
|
2659
2665
|
}), [y, c, p, s, g, _, t]);
|
|
2660
2666
|
return /* @__PURE__ */ h(
|
|
@@ -2664,8 +2670,8 @@ function $n(e) {
|
|
|
2664
2670
|
"aria-disabled": !s,
|
|
2665
2671
|
className: `${s ? "opened" : "closed"} drawer-backdrop`,
|
|
2666
2672
|
onClick: () => n(),
|
|
2667
|
-
children: /* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */
|
|
2673
|
+
children: /* @__PURE__ */ x("aside", { className: `${s ? "opened" : "closed"} drawer animated`, children: [
|
|
2674
|
+
/* @__PURE__ */ x("div", { className: "drawer-header-container", children: [
|
|
2669
2675
|
r,
|
|
2670
2676
|
/* @__PURE__ */ h("h2", { className: "drawer-header poppins", children: t("_pages:home.appName") })
|
|
2671
2677
|
] }),
|
|
@@ -2674,22 +2680,22 @@ function $n(e) {
|
|
|
2674
2680
|
}
|
|
2675
2681
|
);
|
|
2676
2682
|
}
|
|
2677
|
-
function
|
|
2678
|
-
const { error: t, resetErrorBoundary: s } = e, { t: n } =
|
|
2679
|
-
return /* @__PURE__ */
|
|
2680
|
-
/* @__PURE__ */ h(ce, { icon:
|
|
2683
|
+
function Dn(e) {
|
|
2684
|
+
const { error: t, resetErrorBoundary: s } = e, { t: n } = D();
|
|
2685
|
+
return /* @__PURE__ */ x("div", { className: "error-container", children: [
|
|
2686
|
+
/* @__PURE__ */ h(ce, { icon: Zs, className: "error-icon" }),
|
|
2681
2687
|
/* @__PURE__ */ h("p", { className: "error-message", children: (t == null ? void 0 : t.message) ?? n("_accessibility:errors.unknownError") }),
|
|
2682
2688
|
s && /* @__PURE__ */ h("button", { className: "error-retry", onClick: s, children: n("_accessibility:actions.retry", { defaultValue: "Retry" }) })
|
|
2683
2689
|
] });
|
|
2684
2690
|
}
|
|
2685
|
-
const
|
|
2686
|
-
const { showBackButton: t, title: s, actions: n } = e, { t: i } =
|
|
2687
|
-
return /* @__PURE__ */
|
|
2688
|
-
/* @__PURE__ */
|
|
2691
|
+
const Ur = (e) => {
|
|
2692
|
+
const { showBackButton: t, title: s, actions: n } = e, { t: i } = D(), { navigate: r } = Re();
|
|
2693
|
+
return /* @__PURE__ */ x("div", { className: "page-header", children: [
|
|
2694
|
+
/* @__PURE__ */ x("div", { className: "page-header-left", children: [
|
|
2689
2695
|
t && /* @__PURE__ */ h(
|
|
2690
2696
|
pe,
|
|
2691
2697
|
{
|
|
2692
|
-
icon:
|
|
2698
|
+
icon: Qs,
|
|
2693
2699
|
onClick: () => r(-1),
|
|
2694
2700
|
name: i("_accessibility:buttons.back"),
|
|
2695
2701
|
"data-tooltip-id": "tooltip",
|
|
@@ -2698,12 +2704,12 @@ const Rr = (e) => {
|
|
|
2698
2704
|
),
|
|
2699
2705
|
/* @__PURE__ */ h("h2", { className: "page-header-title", children: s })
|
|
2700
2706
|
] }),
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */ h(
|
|
2703
|
-
/* @__PURE__ */ h(
|
|
2707
|
+
/* @__PURE__ */ x("div", { children: [
|
|
2708
|
+
/* @__PURE__ */ h(Wt, { className: "page-header-actions-desktop", actions: n ?? [] }),
|
|
2709
|
+
/* @__PURE__ */ h(Ir, { className: "page-header-actions-mobile", actions: n ?? [] })
|
|
2704
2710
|
] })
|
|
2705
2711
|
] });
|
|
2706
|
-
},
|
|
2712
|
+
}, Vn = (e) => {
|
|
2707
2713
|
const {
|
|
2708
2714
|
title: t,
|
|
2709
2715
|
children: s,
|
|
@@ -2714,13 +2720,13 @@ const Rr = (e) => {
|
|
|
2714
2720
|
isLoading: c = !1,
|
|
2715
2721
|
isAnimated: l = !0,
|
|
2716
2722
|
showBackButton: m = !1
|
|
2717
|
-
} = e, { t: y } =
|
|
2723
|
+
} = e, { t: y } = D(), { countOfFilters: g } = Ds(), f = Ae(() => {
|
|
2718
2724
|
const p = Array.isArray(r) ? [...r] : [];
|
|
2719
2725
|
if (a) {
|
|
2720
2726
|
const _ = {
|
|
2721
2727
|
id: Se.Refresh,
|
|
2722
2728
|
onClick: () => be.invalidateQueries({ queryKey: a }),
|
|
2723
|
-
icon: /* @__PURE__ */ h(ce, { icon:
|
|
2729
|
+
icon: /* @__PURE__ */ h(ce, { icon: Ht }),
|
|
2724
2730
|
tooltip: y("_pages:common.actions.refresh.text")
|
|
2725
2731
|
};
|
|
2726
2732
|
p.unshift(_);
|
|
@@ -2737,9 +2743,9 @@ const Rr = (e) => {
|
|
|
2737
2743
|
const _ = {
|
|
2738
2744
|
...i,
|
|
2739
2745
|
id: "filter",
|
|
2740
|
-
icon: /* @__PURE__ */ h(ce, { icon:
|
|
2746
|
+
icon: /* @__PURE__ */ h(ce, { icon: Ks }),
|
|
2741
2747
|
children: /* @__PURE__ */ h(
|
|
2742
|
-
|
|
2748
|
+
Vs,
|
|
2743
2749
|
{
|
|
2744
2750
|
className: `${g > 0 ? "show" : "hide"} `,
|
|
2745
2751
|
count: g
|
|
@@ -2750,9 +2756,9 @@ const Rr = (e) => {
|
|
|
2750
2756
|
}
|
|
2751
2757
|
return p;
|
|
2752
2758
|
}, [r, n, g, i, a, y]);
|
|
2753
|
-
return /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ x("main", { className: "page-main", children: [
|
|
2754
2760
|
/* @__PURE__ */ h(
|
|
2755
|
-
|
|
2761
|
+
Ur,
|
|
2756
2762
|
{
|
|
2757
2763
|
showBackButton: m,
|
|
2758
2764
|
actions: f,
|
|
@@ -2774,8 +2780,8 @@ const Rr = (e) => {
|
|
|
2774
2780
|
}
|
|
2775
2781
|
)
|
|
2776
2782
|
] });
|
|
2777
|
-
},
|
|
2778
|
-
const { t } =
|
|
2783
|
+
}, In = (e) => {
|
|
2784
|
+
const { t } = D(), {
|
|
2779
2785
|
className: s = "",
|
|
2780
2786
|
itemClassName: n = "",
|
|
2781
2787
|
loading: i = !1,
|
|
@@ -2784,13 +2790,13 @@ const Rr = (e) => {
|
|
|
2784
2790
|
renderComponent: c,
|
|
2785
2791
|
data: l = []
|
|
2786
2792
|
} = e;
|
|
2787
|
-
return i ? /* @__PURE__ */ h(xe, {}) : /* @__PURE__ */ h(Ve, { children: l != null && l.length ? /* @__PURE__ */ h("ul", { className: `pretty-grid-main ${s}`, children: l == null ? void 0 : l.map((m) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${n}`, children: c(m) }, m.id)) }) : /* @__PURE__ */ h(Ve, { children: r || /* @__PURE__ */ h(
|
|
2788
|
-
},
|
|
2789
|
-
const [e, t] =
|
|
2793
|
+
return i ? /* @__PURE__ */ h(xe, {}) : /* @__PURE__ */ h(Ve, { children: l != null && l.length ? /* @__PURE__ */ h("ul", { className: `pretty-grid-main ${s}`, children: l == null ? void 0 : l.map((m) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${n}`, children: c(m) }, m.id)) }) : /* @__PURE__ */ h(Ve, { children: r || /* @__PURE__ */ h(Gr, { message: a }) }) });
|
|
2794
|
+
}, qr = () => {
|
|
2795
|
+
const [e, t] = J(kt());
|
|
2790
2796
|
return le(() => {
|
|
2791
2797
|
const s = window.matchMedia("(min-width: 768px)"), n = () => {
|
|
2792
2798
|
t(
|
|
2793
|
-
s.matches ? kt() :
|
|
2799
|
+
s.matches ? kt() : nr()
|
|
2794
2800
|
);
|
|
2795
2801
|
}, i = setInterval(n, 1e3);
|
|
2796
2802
|
return s.addEventListener("change", n), () => {
|
|
@@ -2798,29 +2804,29 @@ const Rr = (e) => {
|
|
|
2798
2804
|
};
|
|
2799
2805
|
}, []), /* @__PURE__ */ h("p", { className: "clock", children: e });
|
|
2800
2806
|
};
|
|
2801
|
-
function
|
|
2802
|
-
const { t } =
|
|
2807
|
+
function Pn(e) {
|
|
2808
|
+
const { t } = D(), {
|
|
2803
2809
|
openDrawer: s,
|
|
2804
2810
|
showClock: n = !0,
|
|
2805
2811
|
showSearch: i = !0,
|
|
2806
2812
|
menuButtonProps: r
|
|
2807
|
-
} = e, { searchComponent: a, location: c } = Re(), [l, m] =
|
|
2808
|
-
(
|
|
2813
|
+
} = e, { searchComponent: a, location: c } = Re(), [l, m] = J(!1), y = V((f) => {
|
|
2814
|
+
(ir() ? f.metaKey : f.ctrlKey) && f.shiftKey && f.key.toLowerCase() === "f" && (m(!0), f.preventDefault());
|
|
2809
2815
|
}, []);
|
|
2810
2816
|
le(() => (window.addEventListener("keydown", y), () => {
|
|
2811
2817
|
window.removeEventListener("keydown", y);
|
|
2812
2818
|
}), [y]);
|
|
2813
2819
|
const g = a;
|
|
2814
|
-
return /* @__PURE__ */
|
|
2820
|
+
return /* @__PURE__ */ x(Ve, { children: [
|
|
2815
2821
|
c.pathname !== "/" && !!g && /* @__PURE__ */ h(g, { open: l, onClose: () => m(!1) }),
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
2822
|
+
/* @__PURE__ */ x("header", { id: "header", className: "header", children: [
|
|
2823
|
+
/* @__PURE__ */ x("div", { className: "navbar-left", children: [
|
|
2818
2824
|
/* @__PURE__ */ h(
|
|
2819
2825
|
pe,
|
|
2820
2826
|
{
|
|
2821
2827
|
...r,
|
|
2822
2828
|
type: (r == null ? void 0 : r.type) ?? "button",
|
|
2823
|
-
icon: (r == null ? void 0 : r.icon) ??
|
|
2829
|
+
icon: (r == null ? void 0 : r.icon) ?? js,
|
|
2824
2830
|
onClick: (f) => {
|
|
2825
2831
|
var p;
|
|
2826
2832
|
(p = r == null ? void 0 : r.onClick) == null || p.call(r, f), s();
|
|
@@ -2832,64 +2838,64 @@ function In(e) {
|
|
|
2832
2838
|
),
|
|
2833
2839
|
/* @__PURE__ */ h("h1", { className: "poppins navbar-title", children: t("_pages:home.appName") })
|
|
2834
2840
|
] }),
|
|
2835
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ x("div", { className: "navbar-right", children: [
|
|
2836
2842
|
i && /* @__PURE__ */ h(
|
|
2837
2843
|
pe,
|
|
2838
2844
|
{
|
|
2839
|
-
icon:
|
|
2845
|
+
icon: Ws,
|
|
2840
2846
|
className: "navbar-search-btn",
|
|
2841
2847
|
onClick: () => m(!0)
|
|
2842
2848
|
}
|
|
2843
2849
|
),
|
|
2844
|
-
n && /* @__PURE__ */ h(
|
|
2850
|
+
n && /* @__PURE__ */ h(qr, {})
|
|
2845
2851
|
] })
|
|
2846
2852
|
] })
|
|
2847
2853
|
] });
|
|
2848
2854
|
}
|
|
2849
|
-
const
|
|
2855
|
+
const Be = 300, Hr = (e) => e ?? z.error, Br = (e) => {
|
|
2850
2856
|
switch (e) {
|
|
2851
|
-
case
|
|
2852
|
-
return
|
|
2857
|
+
case z.error:
|
|
2858
|
+
return Js;
|
|
2853
2859
|
default:
|
|
2854
|
-
return
|
|
2860
|
+
return Gs;
|
|
2855
2861
|
}
|
|
2856
2862
|
}, nt = (e) => {
|
|
2857
2863
|
switch (e) {
|
|
2858
|
-
case
|
|
2864
|
+
case z.success:
|
|
2859
2865
|
return "!text-success";
|
|
2860
|
-
case
|
|
2866
|
+
case z.error:
|
|
2861
2867
|
return "!text-error";
|
|
2862
|
-
case
|
|
2868
|
+
case z.warning:
|
|
2863
2869
|
return "!text-warning";
|
|
2864
2870
|
default:
|
|
2865
2871
|
return "!text-info";
|
|
2866
2872
|
}
|
|
2867
|
-
},
|
|
2873
|
+
}, Qr = (e) => {
|
|
2868
2874
|
switch (e) {
|
|
2869
|
-
case
|
|
2875
|
+
case z.success:
|
|
2870
2876
|
return "bg-bg-success";
|
|
2871
|
-
case
|
|
2877
|
+
case z.error:
|
|
2872
2878
|
return "bg-bg-error";
|
|
2873
|
-
case
|
|
2879
|
+
case z.warning:
|
|
2874
2880
|
return "bg-bg-warning";
|
|
2875
2881
|
default:
|
|
2876
2882
|
return "bg-bg-info";
|
|
2877
2883
|
}
|
|
2878
2884
|
};
|
|
2879
|
-
function
|
|
2880
|
-
const { t: e } =
|
|
2881
|
-
|
|
2885
|
+
function On() {
|
|
2886
|
+
const { t: e } = D(), { notification: t, removeNotification: s } = Ne(), [n, i] = J([]), r = Ie(n);
|
|
2887
|
+
Is(() => {
|
|
2882
2888
|
r.current = n;
|
|
2883
2889
|
});
|
|
2884
|
-
const a = Ie(null), c =
|
|
2890
|
+
const a = Ie(null), c = V(
|
|
2885
2891
|
(l) => {
|
|
2886
2892
|
i(
|
|
2887
2893
|
(m) => l !== void 0 ? m.map((y) => y.id === l ? { ...y, closing: !0 } : y) : m.map((y) => ({ ...y, closing: !0 }))
|
|
2888
2894
|
), l !== void 0 ? setTimeout(() => {
|
|
2889
2895
|
s(l), i((m) => m.filter((y) => y.id !== l));
|
|
2890
|
-
},
|
|
2896
|
+
}, Be) : (a.current && clearTimeout(a.current), a.current = setTimeout(() => {
|
|
2891
2897
|
s(), i([]), a.current = null;
|
|
2892
|
-
},
|
|
2898
|
+
}, Be));
|
|
2893
2899
|
},
|
|
2894
2900
|
[s]
|
|
2895
2901
|
);
|
|
@@ -2903,7 +2909,7 @@ function Pn() {
|
|
|
2903
2909
|
i((p) => p.map((_) => ({ ..._, closing: !0 }))), l = null;
|
|
2904
2910
|
}, 0), a.current = setTimeout(() => {
|
|
2905
2911
|
i([]), a.current = null;
|
|
2906
|
-
},
|
|
2912
|
+
}, Be), m);
|
|
2907
2913
|
const y = new Set(r.current.map((p) => p.id));
|
|
2908
2914
|
if (!t.some(
|
|
2909
2915
|
(p) => p.id !== void 0 && !y.has(p.id)
|
|
@@ -2924,7 +2930,7 @@ function Pn() {
|
|
|
2924
2930
|
const f = [...t];
|
|
2925
2931
|
return a.current = setTimeout(() => {
|
|
2926
2932
|
i(f.map((p) => ({ ...p, closing: !1 }))), a.current = null;
|
|
2927
|
-
},
|
|
2933
|
+
}, Be), m;
|
|
2928
2934
|
}, [t]), le(() => {
|
|
2929
2935
|
if (!n.length) return;
|
|
2930
2936
|
let l;
|
|
@@ -2936,16 +2942,16 @@ function Pn() {
|
|
|
2936
2942
|
return window.addEventListener("keydown", y), () => {
|
|
2937
2943
|
window.clearTimeout(m), l && window.removeEventListener("click", l), window.removeEventListener("keydown", y);
|
|
2938
2944
|
};
|
|
2939
|
-
}, [n.length, c]),
|
|
2945
|
+
}, [n.length, c]), Kt(
|
|
2940
2946
|
/* @__PURE__ */ h("div", { className: `notification-portal ${n.length ? "active" : ""}`, children: n.map(({ id: l, type: m, message: y, closing: g }) => {
|
|
2941
|
-
const f =
|
|
2942
|
-
return /* @__PURE__ */
|
|
2947
|
+
const f = Hr(m);
|
|
2948
|
+
return /* @__PURE__ */ x(
|
|
2943
2949
|
"div",
|
|
2944
2950
|
{
|
|
2945
|
-
className: `notification ${g ? "closing" : ""} ${
|
|
2951
|
+
className: `notification ${g ? "closing" : ""} ${Qr(f)}`,
|
|
2946
2952
|
onClick: (p) => p.stopPropagation(),
|
|
2947
2953
|
children: [
|
|
2948
|
-
/* @__PURE__ */
|
|
2954
|
+
/* @__PURE__ */ x("div", { className: "notification-body", children: [
|
|
2949
2955
|
/* @__PURE__ */ h(
|
|
2950
2956
|
ce,
|
|
2951
2957
|
{
|
|
@@ -2959,7 +2965,7 @@ function Pn() {
|
|
|
2959
2965
|
pe,
|
|
2960
2966
|
{
|
|
2961
2967
|
type: "button",
|
|
2962
|
-
icon:
|
|
2968
|
+
icon: Qt,
|
|
2963
2969
|
color: "error",
|
|
2964
2970
|
className: "notification-close group",
|
|
2965
2971
|
onClick: (p) => {
|
|
@@ -2978,11 +2984,11 @@ function Pn() {
|
|
|
2978
2984
|
document.body
|
|
2979
2985
|
);
|
|
2980
2986
|
}
|
|
2981
|
-
function
|
|
2987
|
+
function Mn(e) {
|
|
2982
2988
|
const { className: t, ...s } = e;
|
|
2983
2989
|
return /* @__PURE__ */ h("div", { className: "splash-screen", children: /* @__PURE__ */ h(xe, { className: `blur-appear ${t ? ` ${t}` : ""}`, ...s }) });
|
|
2984
2990
|
}
|
|
2985
|
-
const
|
|
2991
|
+
const Kr = (e) => {
|
|
2986
2992
|
const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent: a } = Re();
|
|
2987
2993
|
return /* @__PURE__ */ h(
|
|
2988
2994
|
a,
|
|
@@ -2993,21 +2999,21 @@ const Qr = (e) => {
|
|
|
2993
2999
|
children: i
|
|
2994
3000
|
}
|
|
2995
3001
|
);
|
|
2996
|
-
},
|
|
3002
|
+
}, jr = (e) => {
|
|
2997
3003
|
var l;
|
|
2998
3004
|
const {
|
|
2999
3005
|
tabs: t = [],
|
|
3000
3006
|
defaultTab: s,
|
|
3001
3007
|
className: n = "",
|
|
3002
3008
|
tabsContainerClassName: i = ""
|
|
3003
|
-
} = e, [r, a] =
|
|
3004
|
-
return /* @__PURE__ */
|
|
3009
|
+
} = e, [r, a] = J(s ?? ((l = t[0]) == null ? void 0 : l.id)), c = Ae(() => t.find((m) => m.id === r), [t, r]);
|
|
3010
|
+
return /* @__PURE__ */ x("div", { className: `tabs-layout-main ${n}`, children: [
|
|
3005
3011
|
/* @__PURE__ */ h(
|
|
3006
3012
|
"ul",
|
|
3007
3013
|
{
|
|
3008
3014
|
className: `horizontal tabs tabs-container ${i}`,
|
|
3009
3015
|
children: t.map(({ id: m, to: y, label: g }) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
|
|
3010
|
-
|
|
3016
|
+
Kr,
|
|
3011
3017
|
{
|
|
3012
3018
|
onClick: () => a(m),
|
|
3013
3019
|
id: m,
|
|
@@ -3021,19 +3027,19 @@ const Qr = (e) => {
|
|
|
3021
3027
|
),
|
|
3022
3028
|
c == null ? void 0 : c.content
|
|
3023
3029
|
] });
|
|
3024
|
-
},
|
|
3030
|
+
}, Wr = (e) => {
|
|
3025
3031
|
const {
|
|
3026
3032
|
translation: t,
|
|
3027
3033
|
onClickNext: s,
|
|
3028
3034
|
image: n = "",
|
|
3029
3035
|
alt: i = "",
|
|
3030
3036
|
final: r = !1
|
|
3031
|
-
} = e, { setGuestMode: a } =
|
|
3032
|
-
return /* @__PURE__ */
|
|
3037
|
+
} = e, { setGuestMode: a } = es(), { navigate: c } = Re(), { t: l } = D();
|
|
3038
|
+
return /* @__PURE__ */ x("div", { className: "big-appear step-container", children: [
|
|
3033
3039
|
n && /* @__PURE__ */ h("img", { src: n, alt: i }),
|
|
3034
3040
|
/* @__PURE__ */ h("h2", { className: "step-title", children: l(`_pages:onboarding.${t}.title`) }),
|
|
3035
3041
|
/* @__PURE__ */ h("p", { className: "step-body", children: l(`_pages:onboarding.${t}.body`) }),
|
|
3036
|
-
/* @__PURE__ */ h("div", { className: "step-actions", children: r ? /* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ h("div", { className: "step-actions", children: r ? /* @__PURE__ */ x(Ve, { children: [
|
|
3037
3043
|
/* @__PURE__ */ h(
|
|
3038
3044
|
_e,
|
|
3039
3045
|
{
|
|
@@ -3058,7 +3064,7 @@ const Qr = (e) => {
|
|
|
3058
3064
|
children: l("_accessibility:buttons.signIn")
|
|
3059
3065
|
}
|
|
3060
3066
|
)
|
|
3061
|
-
] }) : /* @__PURE__ */
|
|
3067
|
+
] }) : /* @__PURE__ */ x(Ve, { children: [
|
|
3062
3068
|
/* @__PURE__ */ h(
|
|
3063
3069
|
_e,
|
|
3064
3070
|
{
|
|
@@ -3083,12 +3089,12 @@ const Qr = (e) => {
|
|
|
3083
3089
|
)
|
|
3084
3090
|
] }) })
|
|
3085
3091
|
] });
|
|
3086
|
-
},
|
|
3087
|
-
const { steps: t } = e, [s, n] =
|
|
3092
|
+
}, Rn = (e) => {
|
|
3093
|
+
const { steps: t } = e, [s, n] = J(1), i = Ae(() => t.map((r, a) => ({
|
|
3088
3094
|
id: a + 1,
|
|
3089
3095
|
label: "",
|
|
3090
3096
|
content: /* @__PURE__ */ h(
|
|
3091
|
-
|
|
3097
|
+
Wr,
|
|
3092
3098
|
{
|
|
3093
3099
|
translation: r,
|
|
3094
3100
|
final: a === t.length - 1,
|
|
@@ -3096,94 +3102,94 @@ const Qr = (e) => {
|
|
|
3096
3102
|
}
|
|
3097
3103
|
)
|
|
3098
3104
|
})), [t]);
|
|
3099
|
-
return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(
|
|
3100
|
-
},
|
|
3105
|
+
return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(jr, { defaultTab: s, tabs: i }) });
|
|
3106
|
+
}, Gr = (e) => {
|
|
3101
3107
|
const {
|
|
3102
3108
|
message: t,
|
|
3103
3109
|
messageProps: s = { className: "empty-message" },
|
|
3104
3110
|
action: n,
|
|
3105
3111
|
iconProps: i
|
|
3106
3112
|
} = e;
|
|
3107
|
-
return /* @__PURE__ */
|
|
3113
|
+
return /* @__PURE__ */ x("div", { className: "empty-container", children: [
|
|
3108
3114
|
i && /* @__PURE__ */ h(ce, { ...i }),
|
|
3109
3115
|
/* @__PURE__ */ h("p", { ...s, children: t }),
|
|
3110
|
-
n && /* @__PURE__ */ h(
|
|
3116
|
+
n && /* @__PURE__ */ h(jt, { showTooltips: !1, showText: !0, ...n })
|
|
3111
3117
|
] });
|
|
3112
3118
|
};
|
|
3113
3119
|
export {
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3120
|
+
Jt as APIClient,
|
|
3121
|
+
jt as Action,
|
|
3122
|
+
Wt as Actions,
|
|
3123
|
+
Ir as ActionsDropdown,
|
|
3118
3124
|
pe as AppIconButton,
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3125
|
+
rr as AuthClient,
|
|
3126
|
+
yn as AuthProvider,
|
|
3127
|
+
ln as BaseClient,
|
|
3122
3128
|
Bn as Button,
|
|
3123
|
-
|
|
3124
|
-
|
|
3129
|
+
gn as ConfigProvider,
|
|
3130
|
+
$n as ConfirmationDialog,
|
|
3125
3131
|
dt as Dialog,
|
|
3126
3132
|
ft as DialogActions,
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3133
|
+
Ln as Drawer,
|
|
3134
|
+
ss as DrawerMenuContext,
|
|
3135
|
+
pn as DrawerMenuProvider,
|
|
3136
|
+
Gr as Empty,
|
|
3137
|
+
Dn as Error,
|
|
3138
|
+
An as FormContainer,
|
|
3139
|
+
Tn as FormDialog,
|
|
3134
3140
|
Se as GlobalActions,
|
|
3135
|
-
|
|
3141
|
+
cn as IManager,
|
|
3136
3142
|
pe as IconButton,
|
|
3137
3143
|
Fn as ImportDialog,
|
|
3138
|
-
|
|
3144
|
+
hn as ManagerProvider,
|
|
3139
3145
|
te as Methods,
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3146
|
+
Pn as Navbar,
|
|
3147
|
+
On as Notification,
|
|
3148
|
+
z as NotificationEnumType,
|
|
3149
|
+
mn as NotificationProvider,
|
|
3150
|
+
Rn as Onboarding,
|
|
3151
|
+
Vn as Page,
|
|
3152
|
+
kn as ParagraphInput,
|
|
3153
|
+
xn as PasswordInput,
|
|
3154
|
+
In as PrettyGrid,
|
|
3155
|
+
Mn as SplashScreen,
|
|
3156
|
+
Wr as Step,
|
|
3157
|
+
Kr as Tab,
|
|
3158
|
+
jr as TabsLayout,
|
|
3159
|
+
Nn as ToTop,
|
|
3160
|
+
sr as buildQueryUrl,
|
|
3161
|
+
un as enumToKeyValueArray,
|
|
3162
|
+
dn as formatForDatetimeLocal,
|
|
3163
|
+
zt as fromLocal,
|
|
3158
3164
|
kt as getFormattedDateTime,
|
|
3159
|
-
|
|
3165
|
+
nr as getShortFormattedDateTime,
|
|
3160
3166
|
Je as isHttpError,
|
|
3161
|
-
|
|
3167
|
+
ir as isMac,
|
|
3162
3168
|
Ge as isValidationError,
|
|
3163
3169
|
Te as makeRequest,
|
|
3164
|
-
|
|
3165
|
-
|
|
3170
|
+
fn as mapValidationErrors,
|
|
3171
|
+
Gt as parseQueries,
|
|
3166
3172
|
be as queryClient,
|
|
3167
3173
|
Nt as removeFromLocal,
|
|
3168
3174
|
Et as toLocal,
|
|
3169
|
-
|
|
3175
|
+
es as useAuth,
|
|
3170
3176
|
Re as useConfig,
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3177
|
+
rs as useConfirmationForm,
|
|
3178
|
+
$r as useDeleteAction,
|
|
3179
|
+
vn as useDeleteDialog,
|
|
3180
|
+
fs as useDialog,
|
|
3181
|
+
or as useDrawerMenu,
|
|
3182
|
+
wn as useEditAction,
|
|
3183
|
+
Lr as useExportAction,
|
|
3184
|
+
En as useExportActionMutate,
|
|
3185
|
+
_n as useFormDialog,
|
|
3186
|
+
Dr as useImportAction,
|
|
3187
|
+
Cn as useImportDialog,
|
|
3188
|
+
ar as useManager,
|
|
3183
3189
|
Ne as useNotification,
|
|
3184
|
-
|
|
3190
|
+
bn as usePostForm,
|
|
3185
3191
|
Fr as useRestoreAction,
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3192
|
+
Sn as useRestoreDialog,
|
|
3193
|
+
Vr as useScrollTrigger,
|
|
3194
|
+
on as useTimeAge
|
|
3189
3195
|
};
|