@sito/dashboard-app 0.0.23 → 0.0.25
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 +692 -693
- package/dist/main.css +1 -1
- package/package.json +3 -3
package/dist/dashboard-app.js
CHANGED
|
@@ -2,10 +2,10 @@ var bs = Object.defineProperty;
|
|
|
2
2
|
var ps = (e, t, s) => t in e ? bs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
3
|
var me = (e, t, s) => ps(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
4
|
import "./main.css";
|
|
5
|
-
import { useTranslation as
|
|
5
|
+
import { useTranslation as T, State as ws, inputStateClassName as vs, labelStateClassName as xs, helperTextStateClassName as _s, Loading as De, TextInput as Cs, FileInput as Ss, useTableOptions as ks, Badge as Ns } from "@sito/dashboard";
|
|
6
6
|
export * from "@sito/dashboard";
|
|
7
7
|
import { jsxs as A, jsx as m, Fragment as Le } from "react/jsx-runtime";
|
|
8
|
-
import ie, { useRef as
|
|
8
|
+
import ie, { useRef as Re, useCallback as F, useEffect as Z, useReducer as As, createContext as He, useContext as Qe, useState as H, forwardRef as It, useMemo as Ve } from "react";
|
|
9
9
|
import { faTrash as Es, faRotateLeft as Mt, faPencil as $s, faCircleNotch as Ut, faCloudArrowDown as Fs, faCloudUpload as Ts, faArrowUp as Ls, faEllipsisV as Ds, faEyeSlash as Vs, faEye as Ps, faClose as Rt, faArrowLeft as Os, faAdd as vt, faFilter as Is, faBars as Ms, faSearch as Us, faCircleCheck as Rs, faWarning as qs } from "@fortawesome/free-solid-svg-icons";
|
|
10
10
|
import { FontAwesomeIcon as ce } from "@fortawesome/react-fontawesome";
|
|
11
11
|
import { createPortal as qt } from "react-dom";
|
|
@@ -20,7 +20,7 @@ function Bt(e) {
|
|
|
20
20
|
onClick: i,
|
|
21
21
|
children: r,
|
|
22
22
|
hidden: c = !1,
|
|
23
|
-
disabled:
|
|
23
|
+
disabled: a = !1,
|
|
24
24
|
showText: d = !1,
|
|
25
25
|
showTooltips: h = !0
|
|
26
26
|
} = e;
|
|
@@ -29,9 +29,9 @@ function Bt(e) {
|
|
|
29
29
|
{
|
|
30
30
|
id: t,
|
|
31
31
|
className: `action ${d ? "text-action" : "icon-action"}`,
|
|
32
|
-
disabled:
|
|
32
|
+
disabled: a,
|
|
33
33
|
onClick: () => i(),
|
|
34
|
-
"aria-disabled":
|
|
34
|
+
"aria-disabled": a,
|
|
35
35
|
"data-tooltip-id": "tooltip",
|
|
36
36
|
"data-tooltip-content": h ? n : "",
|
|
37
37
|
children: [
|
|
@@ -61,23 +61,23 @@ function jt(e) {
|
|
|
61
61
|
) }, r.id)) });
|
|
62
62
|
}
|
|
63
63
|
const Ws = (e) => {
|
|
64
|
-
const { children: t, open: s, onClose: n } = e, i =
|
|
65
|
-
(
|
|
64
|
+
const { children: t, open: s, onClose: n } = e, i = Re(null), r = F(
|
|
65
|
+
(a) => {
|
|
66
66
|
const d = i.current;
|
|
67
|
-
!s || !d || d.contains(
|
|
67
|
+
!s || !d || d.contains(a.target) || n();
|
|
68
68
|
},
|
|
69
69
|
[s, n]
|
|
70
|
-
), c =
|
|
71
|
-
(
|
|
72
|
-
s &&
|
|
70
|
+
), c = F(
|
|
71
|
+
(a) => {
|
|
72
|
+
s && a.key === "Escape" && n();
|
|
73
73
|
},
|
|
74
74
|
[s, n]
|
|
75
75
|
);
|
|
76
|
-
return
|
|
76
|
+
return Z(() => {
|
|
77
77
|
if (s)
|
|
78
78
|
return setTimeout(() => {
|
|
79
|
-
var
|
|
80
|
-
return (
|
|
79
|
+
var a;
|
|
80
|
+
return (a = i.current) == null ? void 0 : a.focus();
|
|
81
81
|
}, 0), document.addEventListener("mousedown", r), document.addEventListener("keydown", c), () => {
|
|
82
82
|
document.removeEventListener("mousedown", r), document.removeEventListener("keydown", c);
|
|
83
83
|
};
|
|
@@ -89,7 +89,7 @@ const Ws = (e) => {
|
|
|
89
89
|
"aria-hidden": !s,
|
|
90
90
|
tabIndex: -1,
|
|
91
91
|
className: `dropdown-main ${s ? "opened" : "closed"}`,
|
|
92
|
-
onClick: (
|
|
92
|
+
onClick: (a) => a.stopPropagation(),
|
|
93
93
|
children: t
|
|
94
94
|
}
|
|
95
95
|
);
|
|
@@ -101,7 +101,7 @@ const Ws = (e) => {
|
|
|
101
101
|
className: i = "",
|
|
102
102
|
variant: r = "text",
|
|
103
103
|
color: c = "default",
|
|
104
|
-
iconClassName:
|
|
104
|
+
iconClassName: a = "",
|
|
105
105
|
...d
|
|
106
106
|
} = e;
|
|
107
107
|
return /* @__PURE__ */ A(
|
|
@@ -111,7 +111,7 @@ const Ws = (e) => {
|
|
|
111
111
|
className: `icon-button ${i} ${r} ${c}`,
|
|
112
112
|
...d,
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */ m(ce, { icon: s, className: `!w-auto ${
|
|
114
|
+
/* @__PURE__ */ m(ce, { icon: s, className: `!w-auto ${a}` }),
|
|
115
115
|
t
|
|
116
116
|
]
|
|
117
117
|
}
|
|
@@ -127,42 +127,42 @@ const Ws = (e) => {
|
|
|
127
127
|
} = e;
|
|
128
128
|
return /* @__PURE__ */ m("button", { type: s, className: `button ${n} ${i} ${r}`, ...c, children: t });
|
|
129
129
|
};
|
|
130
|
-
var
|
|
130
|
+
var tt, xt;
|
|
131
131
|
function zs() {
|
|
132
|
-
if (xt) return
|
|
132
|
+
if (xt) return tt;
|
|
133
133
|
xt = 1;
|
|
134
|
-
const e = (
|
|
134
|
+
const e = (a, d = "local", h = void 0) => {
|
|
135
135
|
if (d === "local") {
|
|
136
|
-
if (localStorage.getItem(
|
|
137
|
-
return h === void 0 || h !== void 0 && localStorage.getItem(
|
|
138
|
-
} else if (d === "session" && sessionStorage.getItem(
|
|
139
|
-
return h === void 0 || h !== void 0 && sessionStorage.getItem(
|
|
136
|
+
if (localStorage.getItem(a) !== void 0 && localStorage.getItem(a) !== "undefined" && localStorage.getItem(a) !== null)
|
|
137
|
+
return h === void 0 || h !== void 0 && localStorage.getItem(a) === h;
|
|
138
|
+
} else if (d === "session" && sessionStorage.getItem(a) !== void 0 && sessionStorage.getItem(a) !== "undefined" && sessionStorage.getItem(a) !== null)
|
|
139
|
+
return h === void 0 || h !== void 0 && sessionStorage.getItem(a) === h;
|
|
140
140
|
return !1;
|
|
141
|
-
}, t = (
|
|
141
|
+
}, t = (a) => {
|
|
142
142
|
const d = {};
|
|
143
|
-
return
|
|
143
|
+
return a.substring(1).split("&").forEach((g) => {
|
|
144
144
|
const [y, f] = g.split("=");
|
|
145
145
|
d[y] = f;
|
|
146
146
|
}), d;
|
|
147
|
-
}, s = (
|
|
148
|
-
if (r(
|
|
147
|
+
}, s = (a = "") => {
|
|
148
|
+
if (r(a) && a.length) return r(a);
|
|
149
149
|
{
|
|
150
150
|
let d = navigator.language || navigator.userLanguage;
|
|
151
151
|
if (d.indexOf("en") < 0 && d.indexOf("es") < 0 && (d = "en-US"), d = d.split("-")[0], d)
|
|
152
|
-
return
|
|
152
|
+
return a.length && i(a, 730, d), d;
|
|
153
153
|
}
|
|
154
154
|
return "en";
|
|
155
|
-
}, n = (
|
|
156
|
-
top:
|
|
155
|
+
}, n = (a = 0, d = 0, h = window, g = "smooth") => h.scroll({
|
|
156
|
+
top: a,
|
|
157
157
|
left: d,
|
|
158
158
|
behavior: g
|
|
159
|
-
}), i = (
|
|
159
|
+
}), i = (a, d, h, g = "/", y = "Lax") => {
|
|
160
160
|
var f = /* @__PURE__ */ new Date();
|
|
161
161
|
f.setTime(f.getTime() + d * 24 * 60 * 60 * 1e3);
|
|
162
162
|
const w = "; expires=" + f.toUTCString();
|
|
163
|
-
document.cookie = `${
|
|
164
|
-
}, r = (
|
|
165
|
-
const d = `${
|
|
163
|
+
document.cookie = `${a}=${h || ""}${w};path=${g};SameSite=${y}`;
|
|
164
|
+
}, r = (a) => {
|
|
165
|
+
const d = `${a}=`, g = decodeURIComponent(document.cookie).split(";");
|
|
166
166
|
for (let y = 0; y < g.length; y += 1) {
|
|
167
167
|
let f = g[y];
|
|
168
168
|
for (; f.charAt(0) === " "; )
|
|
@@ -172,23 +172,23 @@ function zs() {
|
|
|
172
172
|
}
|
|
173
173
|
return "";
|
|
174
174
|
};
|
|
175
|
-
return
|
|
175
|
+
return tt = {
|
|
176
176
|
getCookie: r,
|
|
177
177
|
createCookie: i,
|
|
178
|
-
deleteCookie: (
|
|
178
|
+
deleteCookie: (a) => document.cookie = `${a}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
|
|
179
179
|
getUserLanguage: s,
|
|
180
180
|
scrollTo: n,
|
|
181
181
|
parseQueries: t,
|
|
182
182
|
validation: e
|
|
183
|
-
},
|
|
183
|
+
}, tt;
|
|
184
184
|
}
|
|
185
185
|
var Gs = zs();
|
|
186
186
|
function Gr() {
|
|
187
|
-
const { t: e, language: t } =
|
|
188
|
-
return { timeAge:
|
|
187
|
+
const { t: e, language: t } = T();
|
|
188
|
+
return { timeAge: F(
|
|
189
189
|
(n) => {
|
|
190
|
-
const r = /* @__PURE__ */ new Date() - n, c = Math.floor(r / (1e3 * 60)),
|
|
191
|
-
return r < 1e3 * 60 ? x : c < 60 ? `${d ? h : ""} ${c} ${c === 1 ? g : y} ${d ? "" : h}` :
|
|
190
|
+
const r = /* @__PURE__ */ new Date() - n, c = Math.floor(r / (1e3 * 60)), a = Math.floor(c / 60), d = t === "es", h = e("_accessibility:labels.ago"), g = e("_accessibility:labels.minute"), y = e("_accessibility:labels.minutes"), f = e("_accessibility:labels.hour"), w = e("_accessibility:labels.hours"), C = e("_accessibility:labels.yesterday"), x = e("_accessibility:labels.justNow");
|
|
191
|
+
return r < 1e3 * 60 ? x : c < 60 ? `${d ? h : ""} ${c} ${c === 1 ? g : y} ${d ? "" : h}` : a < 24 ? `${d ? h : ""} ${a} ${a === 1 ? f : w} ${d ? "" : h}` : a < 48 ? C : n.toLocaleDateString(navigator.language || "es-ES", {
|
|
192
192
|
day: "2-digit",
|
|
193
193
|
month: "2-digit",
|
|
194
194
|
year: "numeric"
|
|
@@ -197,7 +197,7 @@ function Gr() {
|
|
|
197
197
|
[e, t]
|
|
198
198
|
) };
|
|
199
199
|
}
|
|
200
|
-
var
|
|
200
|
+
var j = /* @__PURE__ */ ((e) => (e[e.success = 0] = "success", e[e.error = 1] = "error", e[e.warning = 2] = "warning", e[e.info = 3] = "info", e))(j || {}), re = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.PATCH = "PATCH", e.DELETE = "DELETE", e))(re || {});
|
|
201
201
|
async function Ae(e, t = "GET", s, n) {
|
|
202
202
|
const i = {
|
|
203
203
|
...s ? { "Content-Type": "application/json" } : {},
|
|
@@ -209,14 +209,14 @@ async function Ae(e, t = "GET", s, n) {
|
|
|
209
209
|
headers: i,
|
|
210
210
|
...s ? { body: JSON.stringify(s) } : {}
|
|
211
211
|
}), c = await r.text();
|
|
212
|
-
let
|
|
212
|
+
let a = null;
|
|
213
213
|
try {
|
|
214
|
-
|
|
214
|
+
a = c ? JSON.parse(c) : null;
|
|
215
215
|
} catch {
|
|
216
|
-
|
|
216
|
+
a = null;
|
|
217
217
|
}
|
|
218
218
|
if (!r.ok) {
|
|
219
|
-
const d = typeof
|
|
219
|
+
const d = typeof a == "object" && a !== null ? a.message ?? a.error ?? c : c || r.statusText;
|
|
220
220
|
return {
|
|
221
221
|
data: null,
|
|
222
222
|
status: r.status,
|
|
@@ -227,7 +227,7 @@ async function Ae(e, t = "GET", s, n) {
|
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
229
|
return {
|
|
230
|
-
data: r.status !== 204 &&
|
|
230
|
+
data: r.status !== 204 && a !== null ? a : null,
|
|
231
231
|
status: r.status,
|
|
232
232
|
error: null
|
|
233
233
|
};
|
|
@@ -254,12 +254,12 @@ function Js(e, t) {
|
|
|
254
254
|
const Ht = (e, t, s) => {
|
|
255
255
|
const n = [];
|
|
256
256
|
if (t) {
|
|
257
|
-
const { sortingBy: i, sortingOrder: r, currentPage: c, pageSize:
|
|
257
|
+
const { sortingBy: i, sortingOrder: r, currentPage: c, pageSize: a } = t;
|
|
258
258
|
n.push(
|
|
259
259
|
`sort=${String(i)}`,
|
|
260
260
|
`order=${r}`,
|
|
261
261
|
`page=${c}`,
|
|
262
|
-
`pageSize=${
|
|
262
|
+
`pageSize=${a}`
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
265
|
if (s) {
|
|
@@ -267,10 +267,10 @@ const Ht = (e, t, s) => {
|
|
|
267
267
|
([, r]) => r != null && r !== ""
|
|
268
268
|
).flatMap(([r, c]) => {
|
|
269
269
|
if (Array.isArray(c))
|
|
270
|
-
return c.map((
|
|
270
|
+
return c.map((a) => `${r}==${encodeURIComponent((a == null ? void 0 : a.id) ?? a)}`);
|
|
271
271
|
if (typeof c == "object" && c !== null && "start" in c && "end" in c) {
|
|
272
|
-
const
|
|
273
|
-
return c.start != null && c.start !== "" &&
|
|
272
|
+
const a = [];
|
|
273
|
+
return c.start != null && c.start !== "" && a.push(`${r}>=${encodeURIComponent(c.start)}`), c.end != null && c.end !== "" && a.push(`${r}<=${encodeURIComponent(c.end)}`), a;
|
|
274
274
|
}
|
|
275
275
|
return typeof c == "object" && c !== null ? `${r}==${encodeURIComponent(c.id ?? "")}` : `${r}==${encodeURIComponent(c)}`;
|
|
276
276
|
});
|
|
@@ -299,7 +299,7 @@ class Qt {
|
|
|
299
299
|
return { Authorization: `Bearer ${s}` };
|
|
300
300
|
}
|
|
301
301
|
async doQuery(t, s = re.GET, n, i) {
|
|
302
|
-
const r = this.secured ? this.defaultTokenAcquirer() : {}, { data: c, status:
|
|
302
|
+
const r = this.secured ? this.defaultTokenAcquirer() : {}, { data: c, status: a, error: d } = await Ae(
|
|
303
303
|
`${this.baseUrl}${t}`,
|
|
304
304
|
s,
|
|
305
305
|
n,
|
|
@@ -308,10 +308,10 @@ class Qt {
|
|
|
308
308
|
...i ?? {}
|
|
309
309
|
}
|
|
310
310
|
);
|
|
311
|
-
if (d ||
|
|
311
|
+
if (d || a < 200 || a >= 300)
|
|
312
312
|
throw d ?? {
|
|
313
|
-
status:
|
|
314
|
-
message: String(
|
|
313
|
+
status: a,
|
|
314
|
+
message: String(a)
|
|
315
315
|
};
|
|
316
316
|
return c;
|
|
317
317
|
}
|
|
@@ -322,13 +322,13 @@ class Qt {
|
|
|
322
322
|
* @returns Result list
|
|
323
323
|
*/
|
|
324
324
|
async get(t, s, n) {
|
|
325
|
-
const i = Ht(t, s, n), r = this.secured ? this.defaultTokenAcquirer() : void 0, { data: c, error:
|
|
325
|
+
const i = Ht(t, s, n), r = this.secured ? this.defaultTokenAcquirer() : void 0, { data: c, error: a } = await Ae(
|
|
326
326
|
`${this.baseUrl}${i}`,
|
|
327
327
|
re.GET,
|
|
328
328
|
null,
|
|
329
329
|
r
|
|
330
330
|
);
|
|
331
|
-
if (
|
|
331
|
+
if (a) throw a;
|
|
332
332
|
return c;
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
@@ -590,14 +590,14 @@ const Xs = () => {
|
|
|
590
590
|
const e = navigator, t = ((s = e == null ? void 0 : e.userAgentData) == null ? void 0 : s.platform) || (e == null ? void 0 : e.platform) || "";
|
|
591
591
|
return /Mac|iPhone|iPod|iPad/i.test(t);
|
|
592
592
|
};
|
|
593
|
-
function
|
|
593
|
+
function Ke(e) {
|
|
594
594
|
if (!e || typeof e != "object") return !1;
|
|
595
595
|
const t = e;
|
|
596
596
|
return Array.isArray(t.errors) && t.errors.every(
|
|
597
597
|
(s) => Array.isArray(s) && s.length === 2 && typeof s[0] == "string"
|
|
598
598
|
);
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function We(e) {
|
|
601
601
|
if (!e || typeof e != "object") return !1;
|
|
602
602
|
const t = e;
|
|
603
603
|
return typeof (t == null ? void 0 : t.status) == "number" && typeof (t == null ? void 0 : t.message) == "string";
|
|
@@ -605,7 +605,7 @@ function Ke(e) {
|
|
|
605
605
|
function en(e, t) {
|
|
606
606
|
return e != null && e.errors ? e.errors.map(([s, n]) => t(s, n)) : [];
|
|
607
607
|
}
|
|
608
|
-
const Wt =
|
|
608
|
+
const Wt = He({});
|
|
609
609
|
function tn(e) {
|
|
610
610
|
const { children: t } = e, [s, n] = As(
|
|
611
611
|
(h, g) => {
|
|
@@ -625,13 +625,13 @@ function tn(e) {
|
|
|
625
625
|
() => []
|
|
626
626
|
), i = (h) => n({
|
|
627
627
|
type: "set",
|
|
628
|
-
items: [{ ...h, type:
|
|
628
|
+
items: [{ ...h, type: j.error }]
|
|
629
629
|
}), r = (h) => n({
|
|
630
630
|
type: "set",
|
|
631
631
|
items: [{ ...h }]
|
|
632
|
-
}), c = (h) => n({ type: "set", items: h }),
|
|
632
|
+
}), c = (h) => n({ type: "set", items: h }), a = (h) => n({
|
|
633
633
|
type: "set",
|
|
634
|
-
items: [{ ...h, type:
|
|
634
|
+
items: [{ ...h, type: j.success }]
|
|
635
635
|
}), d = (h) => n({ type: "remove", index: h });
|
|
636
636
|
return /* @__PURE__ */ m(
|
|
637
637
|
Wt.Provider,
|
|
@@ -641,7 +641,7 @@ function tn(e) {
|
|
|
641
641
|
removeNotification: d,
|
|
642
642
|
showErrorNotification: i,
|
|
643
643
|
showNotification: r,
|
|
644
|
-
showSuccessNotification:
|
|
644
|
+
showSuccessNotification: a,
|
|
645
645
|
showStackNotifications: c
|
|
646
646
|
},
|
|
647
647
|
children: t
|
|
@@ -649,7 +649,7 @@ function tn(e) {
|
|
|
649
649
|
);
|
|
650
650
|
}
|
|
651
651
|
const ke = () => {
|
|
652
|
-
const e =
|
|
652
|
+
const e = Qe(Wt);
|
|
653
653
|
if (e === void 0)
|
|
654
654
|
throw new Error("NotificationContext must be used within a Provider");
|
|
655
655
|
return e;
|
|
@@ -665,27 +665,27 @@ const ke = () => {
|
|
|
665
665
|
// default: true
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
}), zt =
|
|
668
|
+
}), zt = He({}), sn = (e) => {
|
|
669
669
|
const { children: t, manager: s } = e;
|
|
670
670
|
return /* @__PURE__ */ m(zt.Provider, { value: { client: s }, children: /* @__PURE__ */ m(Hs, { client: pe, children: t }) });
|
|
671
671
|
}, Zs = () => {
|
|
672
|
-
const e =
|
|
672
|
+
const e = Qe(zt);
|
|
673
673
|
if (e === void 0)
|
|
674
674
|
throw new Error("managerContext must be used within a Provider");
|
|
675
675
|
return e.client;
|
|
676
|
-
}, Gt =
|
|
677
|
-
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = Zs(), [r, c] =
|
|
676
|
+
}, Gt = He({}), rn = (e) => {
|
|
677
|
+
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = Zs(), [r, c] = H({}), a = F(() => !!Kt(s, "boolean") && r.token === void 0, [r.token]), d = F((w) => {
|
|
678
678
|
_t(s, w);
|
|
679
|
-
}, []), h =
|
|
679
|
+
}, []), h = F((w) => {
|
|
680
680
|
w && (c(w), Ct(s), _t(n, w.token));
|
|
681
|
-
}, []), g =
|
|
681
|
+
}, []), g = F(async () => {
|
|
682
682
|
try {
|
|
683
683
|
await i.Auth.logout();
|
|
684
684
|
} catch (w) {
|
|
685
685
|
console.error(w);
|
|
686
686
|
}
|
|
687
687
|
c({}), Ct(n);
|
|
688
|
-
}, [i.Auth]), y =
|
|
688
|
+
}, [i.Auth]), y = F(async () => {
|
|
689
689
|
try {
|
|
690
690
|
const w = await i.Auth.getSession();
|
|
691
691
|
h(w);
|
|
@@ -697,16 +697,16 @@ const ke = () => {
|
|
|
697
697
|
logUser: h,
|
|
698
698
|
logoutUser: g,
|
|
699
699
|
logUserFromLocal: y,
|
|
700
|
-
isInGuestMode:
|
|
700
|
+
isInGuestMode: a,
|
|
701
701
|
setGuestMode: d
|
|
702
702
|
};
|
|
703
703
|
return /* @__PURE__ */ m(Gt.Provider, { value: f, children: t });
|
|
704
704
|
}, Jt = () => {
|
|
705
|
-
const e =
|
|
705
|
+
const e = Qe(Gt);
|
|
706
706
|
if (e === void 0)
|
|
707
707
|
throw new Error("authContext must be used within a Provider");
|
|
708
708
|
return e;
|
|
709
|
-
}, Yt =
|
|
709
|
+
}, Yt = He({}), nn = (e) => {
|
|
710
710
|
const { children: t, location: s, navigate: n, linkComponent: i, searchComponent: r } = e;
|
|
711
711
|
return /* @__PURE__ */ m(
|
|
712
712
|
Yt.Provider,
|
|
@@ -715,18 +715,18 @@ const ke = () => {
|
|
|
715
715
|
children: t
|
|
716
716
|
}
|
|
717
717
|
);
|
|
718
|
-
},
|
|
719
|
-
const e =
|
|
718
|
+
}, ze = () => {
|
|
719
|
+
const e = Qe(Yt);
|
|
720
720
|
if (e === void 0 || Object.keys(e).length === 0)
|
|
721
721
|
throw new Error(
|
|
722
722
|
"Config provider has not been set. This step is required and cannot be skipped."
|
|
723
723
|
);
|
|
724
724
|
return e;
|
|
725
725
|
}, Xt = (e) => {
|
|
726
|
-
const { showSuccessNotification: t } = ke(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [c,
|
|
727
|
-
h(),
|
|
726
|
+
const { showSuccessNotification: t } = ke(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [c, a] = H([]), { open: d, handleClose: h, handleOpen: g } = os(), y = () => {
|
|
727
|
+
h(), a([]);
|
|
728
728
|
}, f = async (C) => {
|
|
729
|
-
|
|
729
|
+
a(C), g();
|
|
730
730
|
}, w = Pe({
|
|
731
731
|
mutationFn: () => s(
|
|
732
732
|
Array.isArray(c) ? c : [c]
|
|
@@ -744,49 +744,49 @@ const ke = () => {
|
|
|
744
744
|
};
|
|
745
745
|
var Oe = (e) => e.type === "checkbox", Se = (e) => e instanceof Date, te = (e) => e == null;
|
|
746
746
|
const Zt = (e) => typeof e == "object";
|
|
747
|
-
var
|
|
747
|
+
var Q = (e) => !te(e) && !Array.isArray(e) && Zt(e) && !Se(e), er = (e) => Q(e) && e.target ? Oe(e.target) ? e.target.checked : e.target.value : e, tr = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, sr = (e, t) => e.has(tr(t)), rr = (e) => {
|
|
748
748
|
const t = e.constructor && e.constructor.prototype;
|
|
749
|
-
return
|
|
749
|
+
return Q(t) && t.hasOwnProperty("isPrototypeOf");
|
|
750
750
|
}, nt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
751
|
-
function
|
|
751
|
+
function Y(e) {
|
|
752
752
|
let t;
|
|
753
753
|
const s = Array.isArray(e), n = typeof FileList < "u" ? e instanceof FileList : !1;
|
|
754
754
|
if (e instanceof Date)
|
|
755
755
|
t = new Date(e);
|
|
756
|
-
else if (!(nt && (e instanceof Blob || n)) && (s ||
|
|
756
|
+
else if (!(nt && (e instanceof Blob || n)) && (s || Q(e)))
|
|
757
757
|
if (t = s ? [] : {}, !s && !rr(e))
|
|
758
758
|
t = e;
|
|
759
759
|
else
|
|
760
760
|
for (const i in e)
|
|
761
|
-
e.hasOwnProperty(i) && (t[i] =
|
|
761
|
+
e.hasOwnProperty(i) && (t[i] = Y(e[i]));
|
|
762
762
|
else
|
|
763
763
|
return e;
|
|
764
764
|
return t;
|
|
765
765
|
}
|
|
766
|
-
var
|
|
767
|
-
if (!t || !
|
|
766
|
+
var Ge = (e) => /^\w*$/.test(e), W = (e) => e === void 0, it = (e) => Array.isArray(e) ? e.filter(Boolean) : [], at = (e) => it(e.replace(/["|']|\]/g, "").split(/\.|\[/)), _ = (e, t, s) => {
|
|
767
|
+
if (!t || !Q(e))
|
|
768
768
|
return s;
|
|
769
|
-
const n = (
|
|
770
|
-
return
|
|
769
|
+
const n = (Ge(t) ? [t] : at(t)).reduce((i, r) => te(i) ? i : i[r], e);
|
|
770
|
+
return W(n) || n === e ? W(e[t]) ? s : e[t] : n;
|
|
771
771
|
}, he = (e) => typeof e == "boolean", U = (e, t, s) => {
|
|
772
772
|
let n = -1;
|
|
773
|
-
const i =
|
|
773
|
+
const i = Ge(t) ? [t] : at(t), r = i.length, c = r - 1;
|
|
774
774
|
for (; ++n < r; ) {
|
|
775
|
-
const
|
|
775
|
+
const a = i[n];
|
|
776
776
|
let d = s;
|
|
777
777
|
if (n !== c) {
|
|
778
|
-
const h = e[
|
|
779
|
-
d =
|
|
778
|
+
const h = e[a];
|
|
779
|
+
d = Q(h) || Array.isArray(h) ? h : isNaN(+i[n + 1]) ? {} : [];
|
|
780
780
|
}
|
|
781
|
-
if (
|
|
781
|
+
if (a === "__proto__" || a === "constructor" || a === "prototype")
|
|
782
782
|
return;
|
|
783
|
-
e[
|
|
783
|
+
e[a] = d, e = e[a];
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
786
|
const kt = {
|
|
787
787
|
BLUR: "blur",
|
|
788
788
|
FOCUS_OUT: "focusout"
|
|
789
|
-
},
|
|
789
|
+
}, de = {
|
|
790
790
|
onBlur: "onBlur",
|
|
791
791
|
onChange: "onChange",
|
|
792
792
|
onSubmit: "onSubmit",
|
|
@@ -810,15 +810,15 @@ var ir = (e, t, s, n = !0) => {
|
|
|
810
810
|
Object.defineProperty(i, r, {
|
|
811
811
|
get: () => {
|
|
812
812
|
const c = r;
|
|
813
|
-
return t._proxyFormState[c] !==
|
|
813
|
+
return t._proxyFormState[c] !== de.all && (t._proxyFormState[c] = !n || de.all), e[c];
|
|
814
814
|
}
|
|
815
815
|
});
|
|
816
816
|
return i;
|
|
817
817
|
};
|
|
818
|
-
const
|
|
819
|
-
var ye = (e) => typeof e == "string",
|
|
818
|
+
const ar = typeof window < "u" ? ie.useLayoutEffect : ie.useEffect;
|
|
819
|
+
var ye = (e) => typeof e == "string", or = (e, t, s, n, i) => ye(e) ? (n && t.watch.add(e), _(s, e, i)) : Array.isArray(e) ? e.map((r) => (n && t.watch.add(r), _(s, r))) : (n && (t.watchAll = !0), s), rt = (e) => te(e) || !Zt(e);
|
|
820
820
|
function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
|
|
821
|
-
if (
|
|
821
|
+
if (rt(e) || rt(t))
|
|
822
822
|
return e === t;
|
|
823
823
|
if (Se(e) && Se(t))
|
|
824
824
|
return e.getTime() === t.getTime();
|
|
@@ -833,8 +833,8 @@ function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
|
|
|
833
833
|
if (!i.includes(r))
|
|
834
834
|
return !1;
|
|
835
835
|
if (r !== "ref") {
|
|
836
|
-
const
|
|
837
|
-
if (Se(c) && Se(
|
|
836
|
+
const a = t[r];
|
|
837
|
+
if (Se(c) && Se(a) || Q(c) && Q(a) || Array.isArray(c) && Array.isArray(a) ? !ve(c, a, s) : c !== a)
|
|
838
838
|
return !1;
|
|
839
839
|
}
|
|
840
840
|
}
|
|
@@ -865,50 +865,50 @@ var cr = (e, t, s, n, i) => t ? {
|
|
|
865
865
|
e = [];
|
|
866
866
|
}
|
|
867
867
|
};
|
|
868
|
-
}, se = (e) =>
|
|
868
|
+
}, se = (e) => Q(e) && !Object.keys(e).length, ot = (e) => e.type === "file", fe = (e) => typeof e == "function", qe = (e) => {
|
|
869
869
|
if (!nt)
|
|
870
870
|
return !1;
|
|
871
871
|
const t = e ? e.ownerDocument : 0;
|
|
872
872
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
873
|
-
}, es = (e) => e.type === "select-multiple", ct = (e) => e.type === "radio", lr = (e) => ct(e) || Oe(e),
|
|
873
|
+
}, es = (e) => e.type === "select-multiple", ct = (e) => e.type === "radio", lr = (e) => ct(e) || Oe(e), st = (e) => qe(e) && e.isConnected;
|
|
874
874
|
function ur(e, t) {
|
|
875
875
|
const s = t.slice(0, -1).length;
|
|
876
876
|
let n = 0;
|
|
877
877
|
for (; n < s; )
|
|
878
|
-
e =
|
|
878
|
+
e = W(e) ? n++ : e[t[n++]];
|
|
879
879
|
return e;
|
|
880
880
|
}
|
|
881
881
|
function dr(e) {
|
|
882
882
|
for (const t in e)
|
|
883
|
-
if (e.hasOwnProperty(t) && !
|
|
883
|
+
if (e.hasOwnProperty(t) && !W(e[t]))
|
|
884
884
|
return !1;
|
|
885
885
|
return !0;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
888
|
-
const s = Array.isArray(t) ? t :
|
|
889
|
-
return n && delete n[r], i !== 0 && (
|
|
887
|
+
function K(e, t) {
|
|
888
|
+
const s = Array.isArray(t) ? t : Ge(t) ? [t] : at(t), n = s.length === 1 ? e : ur(e, s), i = s.length - 1, r = s[i];
|
|
889
|
+
return n && delete n[r], i !== 0 && (Q(n) && se(n) || Array.isArray(n) && dr(n)) && K(e, s.slice(0, -1)), e;
|
|
890
890
|
}
|
|
891
891
|
var ts = (e) => {
|
|
892
892
|
for (const t in e)
|
|
893
|
-
if (
|
|
893
|
+
if (fe(e[t]))
|
|
894
894
|
return !0;
|
|
895
895
|
return !1;
|
|
896
896
|
};
|
|
897
|
-
function
|
|
897
|
+
function Be(e, t = {}) {
|
|
898
898
|
const s = Array.isArray(e);
|
|
899
|
-
if (
|
|
899
|
+
if (Q(e) || s)
|
|
900
900
|
for (const n in e)
|
|
901
|
-
Array.isArray(e[n]) ||
|
|
901
|
+
Array.isArray(e[n]) || Q(e[n]) && !ts(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Be(e[n], t[n])) : te(e[n]) || (t[n] = !0);
|
|
902
902
|
return t;
|
|
903
903
|
}
|
|
904
904
|
function ss(e, t, s) {
|
|
905
905
|
const n = Array.isArray(e);
|
|
906
|
-
if (
|
|
906
|
+
if (Q(e) || n)
|
|
907
907
|
for (const i in e)
|
|
908
|
-
Array.isArray(e[i]) ||
|
|
908
|
+
Array.isArray(e[i]) || Q(e[i]) && !ts(e[i]) ? W(t) || rt(s[i]) ? s[i] = Array.isArray(e[i]) ? Be(e[i], []) : { ...Be(e[i]) } : ss(e[i], te(t) ? {} : t[i], s[i]) : s[i] = !ve(e[i], t[i]);
|
|
909
909
|
return s;
|
|
910
910
|
}
|
|
911
|
-
var Ee = (e, t) => ss(e, t,
|
|
911
|
+
var Ee = (e, t) => ss(e, t, Be(t));
|
|
912
912
|
const At = {
|
|
913
913
|
value: !1,
|
|
914
914
|
isValid: !1
|
|
@@ -921,11 +921,11 @@ var rs = (e) => {
|
|
|
921
921
|
}
|
|
922
922
|
return e[0].checked && !e[0].disabled ? (
|
|
923
923
|
// @ts-expect-error expected to work in the browser
|
|
924
|
-
e[0].attributes && !
|
|
924
|
+
e[0].attributes && !W(e[0].attributes.value) ? W(e[0].value) || e[0].value === "" ? Et : { value: e[0].value, isValid: !0 } : Et
|
|
925
925
|
) : At;
|
|
926
926
|
}
|
|
927
927
|
return At;
|
|
928
|
-
}, ns = (e, { valueAsNumber: t, valueAsDate: s, setValueAs: n }) =>
|
|
928
|
+
}, ns = (e, { valueAsNumber: t, valueAsDate: s, setValueAs: n }) => W(e) ? e : t ? e === "" ? NaN : e && +e : s && ye(e) ? new Date(e) : n ? n(e) : e;
|
|
929
929
|
const $t = {
|
|
930
930
|
isValid: !1,
|
|
931
931
|
value: null
|
|
@@ -936,7 +936,7 @@ var is = (e) => Array.isArray(e) ? e.reduce((t, s) => s && s.checked && !s.disab
|
|
|
936
936
|
} : t, $t) : $t;
|
|
937
937
|
function Ft(e) {
|
|
938
938
|
const t = e.ref;
|
|
939
|
-
return
|
|
939
|
+
return ot(t) ? t.files : ct(t) ? is(e.refs).value : es(t) ? [...t.selectedOptions].map(({ value: s }) => s) : Oe(t) ? rs(e.refs).value : ns(W(t.value) ? e.ref.value : t.value, e);
|
|
940
940
|
}
|
|
941
941
|
var fr = (e, t, s, n) => {
|
|
942
942
|
const i = {};
|
|
@@ -950,53 +950,53 @@ var fr = (e, t, s, n) => {
|
|
|
950
950
|
fields: i,
|
|
951
951
|
shouldUseNativeValidation: n
|
|
952
952
|
};
|
|
953
|
-
},
|
|
954
|
-
isOnSubmit: !e || e ===
|
|
955
|
-
isOnBlur: e ===
|
|
956
|
-
isOnChange: e ===
|
|
957
|
-
isOnAll: e ===
|
|
958
|
-
isOnTouch: e ===
|
|
953
|
+
}, je = (e) => e instanceof RegExp, $e = (e) => W(e) ? e : je(e) ? e.source : Q(e) ? je(e.value) ? e.value.source : e.value : e, Tt = (e) => ({
|
|
954
|
+
isOnSubmit: !e || e === de.onSubmit,
|
|
955
|
+
isOnBlur: e === de.onBlur,
|
|
956
|
+
isOnChange: e === de.onChange,
|
|
957
|
+
isOnAll: e === de.all,
|
|
958
|
+
isOnTouch: e === de.onTouched
|
|
959
959
|
});
|
|
960
960
|
const Lt = "AsyncFunction";
|
|
961
|
-
var mr = (e) => !!e && !!e.validate && !!(
|
|
961
|
+
var mr = (e) => !!e && !!e.validate && !!(fe(e.validate) && e.validate.constructor.name === Lt || Q(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Lt)), hr = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Dt = (e, t, s) => !s && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
962
962
|
const Te = (e, t, s, n) => {
|
|
963
963
|
for (const i of s || Object.keys(e)) {
|
|
964
964
|
const r = _(e, i);
|
|
965
965
|
if (r) {
|
|
966
|
-
const { _f: c, ...
|
|
966
|
+
const { _f: c, ...a } = r;
|
|
967
967
|
if (c) {
|
|
968
968
|
if (c.refs && c.refs[0] && t(c.refs[0], i) && !n)
|
|
969
969
|
return !0;
|
|
970
970
|
if (c.ref && t(c.ref, c.name) && !n)
|
|
971
971
|
return !0;
|
|
972
|
-
if (Te(
|
|
972
|
+
if (Te(a, t))
|
|
973
973
|
break;
|
|
974
|
-
} else if (
|
|
974
|
+
} else if (Q(a) && Te(a, t))
|
|
975
975
|
break;
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
};
|
|
979
979
|
function Vt(e, t, s) {
|
|
980
980
|
const n = _(e, s);
|
|
981
|
-
if (n ||
|
|
981
|
+
if (n || Ge(s))
|
|
982
982
|
return {
|
|
983
983
|
error: n,
|
|
984
984
|
name: s
|
|
985
985
|
};
|
|
986
986
|
const i = s.split(".");
|
|
987
987
|
for (; i.length; ) {
|
|
988
|
-
const r = i.join("."), c = _(t, r),
|
|
988
|
+
const r = i.join("."), c = _(t, r), a = _(e, r);
|
|
989
989
|
if (c && !Array.isArray(c) && s !== r)
|
|
990
990
|
return { name: s };
|
|
991
|
-
if (
|
|
991
|
+
if (a && a.type)
|
|
992
992
|
return {
|
|
993
993
|
name: r,
|
|
994
|
-
error:
|
|
994
|
+
error: a
|
|
995
995
|
};
|
|
996
|
-
if (
|
|
996
|
+
if (a && a.root && a.root.type)
|
|
997
997
|
return {
|
|
998
998
|
name: `${r}.root`,
|
|
999
|
-
error:
|
|
999
|
+
error: a.root
|
|
1000
1000
|
};
|
|
1001
1001
|
i.pop();
|
|
1002
1002
|
}
|
|
@@ -1007,8 +1007,8 @@ function Vt(e, t, s) {
|
|
|
1007
1007
|
var yr = (e, t, s, n) => {
|
|
1008
1008
|
s(e);
|
|
1009
1009
|
const { name: i, ...r } = e;
|
|
1010
|
-
return se(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((c) => t[c] === (!n ||
|
|
1011
|
-
}, gr = (e, t, s) => !e || !t || e === t || Fe(e).some((n) => n && (s ? n === t : n.startsWith(t) || t.startsWith(n))), br = (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, pr = (e, t) => !it(_(e, t)).length &&
|
|
1010
|
+
return se(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((c) => t[c] === (!n || de.all));
|
|
1011
|
+
}, gr = (e, t, s) => !e || !t || e === t || Fe(e).some((n) => n && (s ? n === t : n.startsWith(t) || t.startsWith(n))), br = (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, pr = (e, t) => !it(_(e, t)).length && K(e, t), wr = (e, t, s) => {
|
|
1012
1012
|
const n = Fe(_(e, s));
|
|
1013
1013
|
return U(n, "root", t[s]), U(e, s, n), e;
|
|
1014
1014
|
}, Ue = (e) => ye(e);
|
|
@@ -1020,93 +1020,93 @@ function Pt(e, t, s = "validate") {
|
|
|
1020
1020
|
ref: t
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
1023
|
-
var Ne = (e) =>
|
|
1023
|
+
var Ne = (e) => Q(e) && !je(e) ? e : {
|
|
1024
1024
|
value: e,
|
|
1025
1025
|
message: ""
|
|
1026
1026
|
}, Ot = async (e, t, s, n, i, r) => {
|
|
1027
|
-
const { ref: c, refs:
|
|
1028
|
-
if (!
|
|
1027
|
+
const { ref: c, refs: a, required: d, maxLength: h, minLength: g, min: y, max: f, pattern: w, validate: C, name: x, valueAsNumber: q, mount: ae } = e._f, k = _(s, x);
|
|
1028
|
+
if (!ae || t.has(x))
|
|
1029
1029
|
return {};
|
|
1030
|
-
const
|
|
1031
|
-
i &&
|
|
1032
|
-
},
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1035
|
-
type: N ?
|
|
1036
|
-
message:
|
|
1030
|
+
const z = a ? a[0] : c, D = (N) => {
|
|
1031
|
+
i && z.reportValidity && (z.setCustomValidity(he(N) ? "" : N || ""), z.reportValidity());
|
|
1032
|
+
}, $ = {}, G = ct(c), V = Oe(c), le = G || V, B = (q || ot(c)) && W(c.value) && W(k) || qe(c) && c.value === "" || k === "" || Array.isArray(k) && !k.length, M = cr.bind(null, x, n, $), I = (N, E, R, J = ge.maxLength, X = ge.minLength) => {
|
|
1033
|
+
const P = N ? E : R;
|
|
1034
|
+
$[x] = {
|
|
1035
|
+
type: N ? J : X,
|
|
1036
|
+
message: P,
|
|
1037
1037
|
ref: c,
|
|
1038
|
-
...M(N ?
|
|
1038
|
+
...M(N ? J : X, P)
|
|
1039
1039
|
};
|
|
1040
1040
|
};
|
|
1041
|
-
if (r ? !Array.isArray(k) || !k.length : d && (!
|
|
1042
|
-
const { value: N, message:
|
|
1043
|
-
if (N && (
|
|
1041
|
+
if (r ? !Array.isArray(k) || !k.length : d && (!le && (B || te(k)) || he(k) && !k || V && !rs(a).isValid || G && !is(a).isValid)) {
|
|
1042
|
+
const { value: N, message: E } = Ue(d) ? { value: !!d, message: d } : Ne(d);
|
|
1043
|
+
if (N && ($[x] = {
|
|
1044
1044
|
type: ge.required,
|
|
1045
|
-
message:
|
|
1046
|
-
ref:
|
|
1047
|
-
...M(ge.required,
|
|
1045
|
+
message: E,
|
|
1046
|
+
ref: z,
|
|
1047
|
+
...M(ge.required, E)
|
|
1048
1048
|
}, !n))
|
|
1049
|
-
return
|
|
1049
|
+
return D(E), $;
|
|
1050
1050
|
}
|
|
1051
|
-
if (
|
|
1052
|
-
let N,
|
|
1053
|
-
const
|
|
1051
|
+
if (!B && (!te(y) || !te(f))) {
|
|
1052
|
+
let N, E;
|
|
1053
|
+
const R = Ne(f), J = Ne(y);
|
|
1054
1054
|
if (!te(k) && !isNaN(k)) {
|
|
1055
1055
|
const X = c.valueAsNumber || k && +k;
|
|
1056
|
-
te(
|
|
1056
|
+
te(R.value) || (N = X > R.value), te(J.value) || (E = X < J.value);
|
|
1057
1057
|
} else {
|
|
1058
|
-
const X = c.valueAsDate || new Date(k),
|
|
1059
|
-
ye(
|
|
1058
|
+
const X = c.valueAsDate || new Date(k), P = (ue) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ue), ee = c.type == "time", ne = c.type == "week";
|
|
1059
|
+
ye(R.value) && k && (N = ee ? P(k) > P(R.value) : ne ? k > R.value : X > new Date(R.value)), ye(J.value) && k && (E = ee ? P(k) < P(J.value) : ne ? k < J.value : X < new Date(J.value));
|
|
1060
1060
|
}
|
|
1061
|
-
if ((N ||
|
|
1062
|
-
return
|
|
1061
|
+
if ((N || E) && (I(!!N, R.message, J.message, ge.max, ge.min), !n))
|
|
1062
|
+
return D($[x].message), $;
|
|
1063
1063
|
}
|
|
1064
|
-
if ((h || g) &&
|
|
1065
|
-
const N = Ne(h),
|
|
1066
|
-
if ((
|
|
1067
|
-
return
|
|
1064
|
+
if ((h || g) && !B && (ye(k) || r && Array.isArray(k))) {
|
|
1065
|
+
const N = Ne(h), E = Ne(g), R = !te(N.value) && k.length > +N.value, J = !te(E.value) && k.length < +E.value;
|
|
1066
|
+
if ((R || J) && (I(R, N.message, E.message), !n))
|
|
1067
|
+
return D($[x].message), $;
|
|
1068
1068
|
}
|
|
1069
|
-
if (w &&
|
|
1070
|
-
const { value: N, message:
|
|
1071
|
-
if (
|
|
1069
|
+
if (w && !B && ye(k)) {
|
|
1070
|
+
const { value: N, message: E } = Ne(w);
|
|
1071
|
+
if (je(N) && !k.match(N) && ($[x] = {
|
|
1072
1072
|
type: ge.pattern,
|
|
1073
|
-
message:
|
|
1073
|
+
message: E,
|
|
1074
1074
|
ref: c,
|
|
1075
|
-
...M(ge.pattern,
|
|
1075
|
+
...M(ge.pattern, E)
|
|
1076
1076
|
}, !n))
|
|
1077
|
-
return
|
|
1077
|
+
return D(E), $;
|
|
1078
1078
|
}
|
|
1079
1079
|
if (C) {
|
|
1080
|
-
if (
|
|
1081
|
-
const N = await C(k, s),
|
|
1082
|
-
if (
|
|
1083
|
-
...
|
|
1084
|
-
...M(ge.validate,
|
|
1080
|
+
if (fe(C)) {
|
|
1081
|
+
const N = await C(k, s), E = Pt(N, z);
|
|
1082
|
+
if (E && ($[x] = {
|
|
1083
|
+
...E,
|
|
1084
|
+
...M(ge.validate, E.message)
|
|
1085
1085
|
}, !n))
|
|
1086
|
-
return
|
|
1087
|
-
} else if (
|
|
1086
|
+
return D(E.message), $;
|
|
1087
|
+
} else if (Q(C)) {
|
|
1088
1088
|
let N = {};
|
|
1089
|
-
for (const
|
|
1089
|
+
for (const E in C) {
|
|
1090
1090
|
if (!se(N) && !n)
|
|
1091
1091
|
break;
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
...
|
|
1095
|
-
...M(
|
|
1096
|
-
},
|
|
1092
|
+
const R = Pt(await C[E](k, s), z, E);
|
|
1093
|
+
R && (N = {
|
|
1094
|
+
...R,
|
|
1095
|
+
...M(E, R.message)
|
|
1096
|
+
}, D(R.message), n && ($[x] = N));
|
|
1097
1097
|
}
|
|
1098
|
-
if (!se(N) && (
|
|
1099
|
-
ref:
|
|
1098
|
+
if (!se(N) && ($[x] = {
|
|
1099
|
+
ref: z,
|
|
1100
1100
|
...N
|
|
1101
1101
|
}, !n))
|
|
1102
|
-
return
|
|
1102
|
+
return $;
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
|
-
return
|
|
1105
|
+
return D(!0), $;
|
|
1106
1106
|
};
|
|
1107
1107
|
const vr = {
|
|
1108
|
-
mode:
|
|
1109
|
-
reValidateMode:
|
|
1108
|
+
mode: de.onSubmit,
|
|
1109
|
+
reValidateMode: de.onChange,
|
|
1110
1110
|
shouldFocusError: !0
|
|
1111
1111
|
};
|
|
1112
1112
|
function xr(e = {}) {
|
|
@@ -1117,7 +1117,7 @@ function xr(e = {}) {
|
|
|
1117
1117
|
submitCount: 0,
|
|
1118
1118
|
isDirty: !1,
|
|
1119
1119
|
isReady: !1,
|
|
1120
|
-
isLoading:
|
|
1120
|
+
isLoading: fe(t.defaultValues),
|
|
1121
1121
|
isValidating: !1,
|
|
1122
1122
|
isSubmitted: !1,
|
|
1123
1123
|
isSubmitting: !1,
|
|
@@ -1128,11 +1128,11 @@ function xr(e = {}) {
|
|
|
1128
1128
|
validatingFields: {},
|
|
1129
1129
|
errors: t.errors || {},
|
|
1130
1130
|
disabled: t.disabled || !1
|
|
1131
|
-
}, n = {}, i =
|
|
1131
|
+
}, n = {}, i = Q(t.defaultValues) || Q(t.values) ? Y(t.defaultValues || t.values) || {} : {}, r = t.shouldUnregister ? {} : Y(i), c = {
|
|
1132
1132
|
action: !1,
|
|
1133
1133
|
mount: !1,
|
|
1134
1134
|
watch: !1
|
|
1135
|
-
},
|
|
1135
|
+
}, a = {
|
|
1136
1136
|
mount: /* @__PURE__ */ new Set(),
|
|
1137
1137
|
disabled: /* @__PURE__ */ new Set(),
|
|
1138
1138
|
unMount: /* @__PURE__ */ new Set(),
|
|
@@ -1154,281 +1154,281 @@ function xr(e = {}) {
|
|
|
1154
1154
|
const f = {
|
|
1155
1155
|
array: Nt(),
|
|
1156
1156
|
state: Nt()
|
|
1157
|
-
}, w = t.criteriaMode ===
|
|
1158
|
-
clearTimeout(h), h = setTimeout(
|
|
1159
|
-
}, x = async (
|
|
1160
|
-
if (!t.disabled && (g.isValid || y.isValid ||
|
|
1161
|
-
const l = t.resolver ? se((await
|
|
1157
|
+
}, w = t.criteriaMode === de.all, C = (o) => (l) => {
|
|
1158
|
+
clearTimeout(h), h = setTimeout(o, l);
|
|
1159
|
+
}, x = async (o) => {
|
|
1160
|
+
if (!t.disabled && (g.isValid || y.isValid || o)) {
|
|
1161
|
+
const l = t.resolver ? se((await V()).errors) : await B(n, !0);
|
|
1162
1162
|
l !== s.isValid && f.state.next({
|
|
1163
1163
|
isValid: l
|
|
1164
1164
|
});
|
|
1165
1165
|
}
|
|
1166
|
-
},
|
|
1167
|
-
!t.disabled && (g.isValidating || g.validatingFields || y.isValidating || y.validatingFields) && ((
|
|
1168
|
-
u && (l ? U(s.validatingFields, u, l) :
|
|
1166
|
+
}, q = (o, l) => {
|
|
1167
|
+
!t.disabled && (g.isValidating || g.validatingFields || y.isValidating || y.validatingFields) && ((o || Array.from(a.mount)).forEach((u) => {
|
|
1168
|
+
u && (l ? U(s.validatingFields, u, l) : K(s.validatingFields, u));
|
|
1169
1169
|
}), f.state.next({
|
|
1170
1170
|
validatingFields: s.validatingFields,
|
|
1171
1171
|
isValidating: !se(s.validatingFields)
|
|
1172
1172
|
}));
|
|
1173
|
-
},
|
|
1173
|
+
}, ae = (o, l = [], u, v, p = !0, b = !0) => {
|
|
1174
1174
|
if (v && u && !t.disabled) {
|
|
1175
|
-
if (c.action = !0, b && Array.isArray(_(n,
|
|
1176
|
-
const S = u(_(n,
|
|
1177
|
-
p && U(n,
|
|
1175
|
+
if (c.action = !0, b && Array.isArray(_(n, o))) {
|
|
1176
|
+
const S = u(_(n, o), v.argA, v.argB);
|
|
1177
|
+
p && U(n, o, S);
|
|
1178
1178
|
}
|
|
1179
|
-
if (b && Array.isArray(_(s.errors,
|
|
1180
|
-
const S = u(_(s.errors,
|
|
1181
|
-
p && U(s.errors,
|
|
1179
|
+
if (b && Array.isArray(_(s.errors, o))) {
|
|
1180
|
+
const S = u(_(s.errors, o), v.argA, v.argB);
|
|
1181
|
+
p && U(s.errors, o, S), pr(s.errors, o);
|
|
1182
1182
|
}
|
|
1183
|
-
if ((g.touchedFields || y.touchedFields) && b && Array.isArray(_(s.touchedFields,
|
|
1184
|
-
const S = u(_(s.touchedFields,
|
|
1185
|
-
p && U(s.touchedFields,
|
|
1183
|
+
if ((g.touchedFields || y.touchedFields) && b && Array.isArray(_(s.touchedFields, o))) {
|
|
1184
|
+
const S = u(_(s.touchedFields, o), v.argA, v.argB);
|
|
1185
|
+
p && U(s.touchedFields, o, S);
|
|
1186
1186
|
}
|
|
1187
1187
|
(g.dirtyFields || y.dirtyFields) && (s.dirtyFields = Ee(i, r)), f.state.next({
|
|
1188
|
-
name:
|
|
1189
|
-
isDirty:
|
|
1188
|
+
name: o,
|
|
1189
|
+
isDirty: I(o, l),
|
|
1190
1190
|
dirtyFields: s.dirtyFields,
|
|
1191
1191
|
errors: s.errors,
|
|
1192
1192
|
isValid: s.isValid
|
|
1193
1193
|
});
|
|
1194
1194
|
} else
|
|
1195
|
-
U(r,
|
|
1196
|
-
}, k = (
|
|
1197
|
-
U(s.errors,
|
|
1195
|
+
U(r, o, l);
|
|
1196
|
+
}, k = (o, l) => {
|
|
1197
|
+
U(s.errors, o, l), f.state.next({
|
|
1198
1198
|
errors: s.errors
|
|
1199
1199
|
});
|
|
1200
|
-
},
|
|
1201
|
-
s.errors =
|
|
1200
|
+
}, z = (o) => {
|
|
1201
|
+
s.errors = o, f.state.next({
|
|
1202
1202
|
errors: s.errors,
|
|
1203
1203
|
isValid: !1
|
|
1204
1204
|
});
|
|
1205
|
-
},
|
|
1206
|
-
const p = _(n,
|
|
1205
|
+
}, D = (o, l, u, v) => {
|
|
1206
|
+
const p = _(n, o);
|
|
1207
1207
|
if (p) {
|
|
1208
|
-
const b = _(r,
|
|
1209
|
-
|
|
1208
|
+
const b = _(r, o, W(u) ? _(i, o) : u);
|
|
1209
|
+
W(b) || v && v.defaultChecked || l ? U(r, o, l ? b : Ft(p._f)) : R(o, b), c.mount && x();
|
|
1210
1210
|
}
|
|
1211
|
-
},
|
|
1211
|
+
}, $ = (o, l, u, v, p) => {
|
|
1212
1212
|
let b = !1, S = !1;
|
|
1213
|
-
const
|
|
1214
|
-
name:
|
|
1213
|
+
const L = {
|
|
1214
|
+
name: o
|
|
1215
1215
|
};
|
|
1216
1216
|
if (!t.disabled) {
|
|
1217
1217
|
if (!u || v) {
|
|
1218
|
-
(g.isDirty || y.isDirty) && (S = s.isDirty, s.isDirty =
|
|
1219
|
-
const
|
|
1220
|
-
S = !!_(s.dirtyFields,
|
|
1218
|
+
(g.isDirty || y.isDirty) && (S = s.isDirty, s.isDirty = L.isDirty = I(), b = S !== L.isDirty);
|
|
1219
|
+
const O = ve(_(i, o), l);
|
|
1220
|
+
S = !!_(s.dirtyFields, o), O ? K(s.dirtyFields, o) : U(s.dirtyFields, o, !0), L.dirtyFields = s.dirtyFields, b = b || (g.dirtyFields || y.dirtyFields) && S !== !O;
|
|
1221
1221
|
}
|
|
1222
1222
|
if (u) {
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1223
|
+
const O = _(s.touchedFields, o);
|
|
1224
|
+
O || (U(s.touchedFields, o, u), L.touchedFields = s.touchedFields, b = b || (g.touchedFields || y.touchedFields) && O !== u);
|
|
1225
1225
|
}
|
|
1226
|
-
b && p && f.state.next(
|
|
1226
|
+
b && p && f.state.next(L);
|
|
1227
1227
|
}
|
|
1228
|
-
return b ?
|
|
1229
|
-
},
|
|
1230
|
-
const p = _(s.errors,
|
|
1231
|
-
if (t.delayError && u ? (d = C(() => k(
|
|
1228
|
+
return b ? L : {};
|
|
1229
|
+
}, G = (o, l, u, v) => {
|
|
1230
|
+
const p = _(s.errors, o), b = (g.isValid || y.isValid) && he(l) && s.isValid !== l;
|
|
1231
|
+
if (t.delayError && u ? (d = C(() => k(o, u)), d(t.delayError)) : (clearTimeout(h), d = null, u ? U(s.errors, o, u) : K(s.errors, o)), (u ? !ve(p, u) : p) || !se(v) || b) {
|
|
1232
1232
|
const S = {
|
|
1233
1233
|
...v,
|
|
1234
1234
|
...b && he(l) ? { isValid: l } : {},
|
|
1235
1235
|
errors: s.errors,
|
|
1236
|
-
name:
|
|
1236
|
+
name: o
|
|
1237
1237
|
};
|
|
1238
1238
|
s = {
|
|
1239
1239
|
...s,
|
|
1240
1240
|
...S
|
|
1241
1241
|
}, f.state.next(S);
|
|
1242
1242
|
}
|
|
1243
|
-
},
|
|
1244
|
-
|
|
1245
|
-
const l = await t.resolver(r, t.context, fr(
|
|
1246
|
-
return
|
|
1247
|
-
},
|
|
1248
|
-
const { errors: l } = await
|
|
1249
|
-
if (
|
|
1250
|
-
for (const u of
|
|
1243
|
+
}, V = async (o) => {
|
|
1244
|
+
q(o, !0);
|
|
1245
|
+
const l = await t.resolver(r, t.context, fr(o || a.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
1246
|
+
return q(o), l;
|
|
1247
|
+
}, le = async (o) => {
|
|
1248
|
+
const { errors: l } = await V(o);
|
|
1249
|
+
if (o)
|
|
1250
|
+
for (const u of o) {
|
|
1251
1251
|
const v = _(l, u);
|
|
1252
|
-
v ? U(s.errors, u, v) :
|
|
1252
|
+
v ? U(s.errors, u, v) : K(s.errors, u);
|
|
1253
1253
|
}
|
|
1254
1254
|
else
|
|
1255
1255
|
s.errors = l;
|
|
1256
1256
|
return l;
|
|
1257
|
-
},
|
|
1257
|
+
}, B = async (o, l, u = {
|
|
1258
1258
|
valid: !0
|
|
1259
1259
|
}) => {
|
|
1260
|
-
for (const v in
|
|
1261
|
-
const p =
|
|
1260
|
+
for (const v in o) {
|
|
1261
|
+
const p = o[v];
|
|
1262
1262
|
if (p) {
|
|
1263
1263
|
const { _f: b, ...S } = p;
|
|
1264
1264
|
if (b) {
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1267
|
-
const
|
|
1268
|
-
if (
|
|
1265
|
+
const L = a.array.has(b.name), O = p._f && mr(p._f);
|
|
1266
|
+
O && g.validatingFields && q([v], !0);
|
|
1267
|
+
const oe = await Ot(p, a.disabled, r, w, t.shouldUseNativeValidation && !l, L);
|
|
1268
|
+
if (O && g.validatingFields && q([v]), oe[b.name] && (u.valid = !1, l))
|
|
1269
1269
|
break;
|
|
1270
|
-
!l && (_(
|
|
1270
|
+
!l && (_(oe, b.name) ? L ? wr(s.errors, oe, b.name) : U(s.errors, b.name, oe[b.name]) : K(s.errors, b.name));
|
|
1271
1271
|
}
|
|
1272
|
-
!se(S) && await
|
|
1272
|
+
!se(S) && await B(S, l, u);
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
1275
|
return u.valid;
|
|
1276
1276
|
}, M = () => {
|
|
1277
|
-
for (const
|
|
1278
|
-
const l = _(n,
|
|
1279
|
-
l && (l._f.refs ? l._f.refs.every((u) => !
|
|
1277
|
+
for (const o of a.unMount) {
|
|
1278
|
+
const l = _(n, o);
|
|
1279
|
+
l && (l._f.refs ? l._f.refs.every((u) => !st(u)) : !st(l._f.ref)) && Je(o);
|
|
1280
1280
|
}
|
|
1281
|
-
|
|
1282
|
-
},
|
|
1283
|
-
...c.mount ? r :
|
|
1284
|
-
}, u, l),
|
|
1285
|
-
const v = _(n,
|
|
1281
|
+
a.unMount = /* @__PURE__ */ new Set();
|
|
1282
|
+
}, I = (o, l) => !t.disabled && (o && l && U(r, o, l), !ve(ue(), i)), N = (o, l, u) => or(o, a, {
|
|
1283
|
+
...c.mount ? r : W(l) ? i : ye(o) ? { [o]: l } : l
|
|
1284
|
+
}, u, l), E = (o) => it(_(c.mount ? r : i, o, t.shouldUnregister ? _(i, o, []) : [])), R = (o, l, u = {}) => {
|
|
1285
|
+
const v = _(n, o);
|
|
1286
1286
|
let p = l;
|
|
1287
1287
|
if (v) {
|
|
1288
1288
|
const b = v._f;
|
|
1289
|
-
b && (!b.disabled && U(r,
|
|
1290
|
-
(!S.defaultChecked || !S.disabled) && (Array.isArray(p) ? S.checked = !!p.find((
|
|
1291
|
-
}) : b.refs.forEach((S) => S.checked = S.value === p) :
|
|
1292
|
-
name:
|
|
1293
|
-
values:
|
|
1289
|
+
b && (!b.disabled && U(r, o, ns(l, b)), p = qe(b.ref) && te(l) ? "" : l, es(b.ref) ? [...b.ref.options].forEach((S) => S.selected = p.includes(S.value)) : b.refs ? Oe(b.ref) ? b.refs.forEach((S) => {
|
|
1290
|
+
(!S.defaultChecked || !S.disabled) && (Array.isArray(p) ? S.checked = !!p.find((L) => L === S.value) : S.checked = p === S.value || !!p);
|
|
1291
|
+
}) : b.refs.forEach((S) => S.checked = S.value === p) : ot(b.ref) ? b.ref.value = "" : (b.ref.value = p, b.ref.type || f.state.next({
|
|
1292
|
+
name: o,
|
|
1293
|
+
values: Y(r)
|
|
1294
1294
|
})));
|
|
1295
1295
|
}
|
|
1296
|
-
(u.shouldDirty || u.shouldTouch) &&
|
|
1297
|
-
},
|
|
1296
|
+
(u.shouldDirty || u.shouldTouch) && $(o, p, u.shouldTouch, u.shouldDirty, !0), u.shouldValidate && ne(o);
|
|
1297
|
+
}, J = (o, l, u) => {
|
|
1298
1298
|
for (const v in l) {
|
|
1299
1299
|
if (!l.hasOwnProperty(v))
|
|
1300
1300
|
return;
|
|
1301
|
-
const p = l[v], b =
|
|
1302
|
-
(
|
|
1301
|
+
const p = l[v], b = o + "." + v, S = _(n, b);
|
|
1302
|
+
(a.array.has(o) || Q(p) || S && !S._f) && !Se(p) ? J(b, p, u) : R(b, p, u);
|
|
1303
1303
|
}
|
|
1304
|
-
}, X = (
|
|
1305
|
-
const v = _(n,
|
|
1306
|
-
U(r,
|
|
1307
|
-
name:
|
|
1308
|
-
values:
|
|
1304
|
+
}, X = (o, l, u = {}) => {
|
|
1305
|
+
const v = _(n, o), p = a.array.has(o), b = Y(l);
|
|
1306
|
+
U(r, o, b), p ? (f.array.next({
|
|
1307
|
+
name: o,
|
|
1308
|
+
values: Y(r)
|
|
1309
1309
|
}), (g.isDirty || g.dirtyFields || y.isDirty || y.dirtyFields) && u.shouldDirty && f.state.next({
|
|
1310
|
-
name:
|
|
1310
|
+
name: o,
|
|
1311
1311
|
dirtyFields: Ee(i, r),
|
|
1312
|
-
isDirty:
|
|
1313
|
-
})) : v && !v._f && !te(b) ?
|
|
1314
|
-
name: c.mount ?
|
|
1315
|
-
values:
|
|
1312
|
+
isDirty: I(o, b)
|
|
1313
|
+
})) : v && !v._f && !te(b) ? J(o, b, u) : R(o, b, u), Dt(o, a) && f.state.next({ ...s, name: o }), f.state.next({
|
|
1314
|
+
name: c.mount ? o : void 0,
|
|
1315
|
+
values: Y(r)
|
|
1316
1316
|
});
|
|
1317
|
-
},
|
|
1317
|
+
}, P = async (o) => {
|
|
1318
1318
|
c.mount = !0;
|
|
1319
|
-
const l =
|
|
1319
|
+
const l = o.target;
|
|
1320
1320
|
let u = l.name, v = !0;
|
|
1321
|
-
const p = _(n, u), b = (
|
|
1322
|
-
v = Number.isNaN(
|
|
1323
|
-
}, S = Tt(t.mode),
|
|
1321
|
+
const p = _(n, u), b = (O) => {
|
|
1322
|
+
v = Number.isNaN(O) || Se(O) && isNaN(O.getTime()) || ve(O, _(r, u, O));
|
|
1323
|
+
}, S = Tt(t.mode), L = Tt(t.reValidateMode);
|
|
1324
1324
|
if (p) {
|
|
1325
|
-
let
|
|
1326
|
-
const Me = l.type ? Ft(p._f) : er(
|
|
1327
|
-
U(r, u, Me), we ? (p._f.onBlur && p._f.onBlur(
|
|
1328
|
-
const
|
|
1325
|
+
let O, oe;
|
|
1326
|
+
const Me = l.type ? Ft(p._f) : er(o), we = o.type === kt.BLUR || o.type === kt.FOCUS_OUT, hs = !hr(p._f) && !t.resolver && !_(s.errors, u) && !p._f.deps || br(we, _(s.touchedFields, u), s.isSubmitted, L, S), Ze = Dt(u, a, we);
|
|
1327
|
+
U(r, u, Me), we ? (p._f.onBlur && p._f.onBlur(o), d && d(0)) : p._f.onChange && p._f.onChange(o);
|
|
1328
|
+
const et = $(u, Me, we), ys = !se(et) || Ze;
|
|
1329
1329
|
if (!we && f.state.next({
|
|
1330
1330
|
name: u,
|
|
1331
|
-
type:
|
|
1332
|
-
values:
|
|
1331
|
+
type: o.type,
|
|
1332
|
+
values: Y(r)
|
|
1333
1333
|
}), hs)
|
|
1334
|
-
return (g.isValid || y.isValid) && (t.mode === "onBlur" ? we && x() : we || x()), ys && f.state.next({ name: u, ...
|
|
1335
|
-
if (!we &&
|
|
1336
|
-
const { errors: pt } = await
|
|
1334
|
+
return (g.isValid || y.isValid) && (t.mode === "onBlur" ? we && x() : we || x()), ys && f.state.next({ name: u, ...Ze ? {} : et });
|
|
1335
|
+
if (!we && Ze && f.state.next({ ...s }), t.resolver) {
|
|
1336
|
+
const { errors: pt } = await V([u]);
|
|
1337
1337
|
if (b(Me), v) {
|
|
1338
1338
|
const gs = Vt(s.errors, n, u), wt = Vt(pt, n, gs.name || u);
|
|
1339
|
-
|
|
1339
|
+
O = wt.error, u = wt.name, oe = se(pt);
|
|
1340
1340
|
}
|
|
1341
1341
|
} else
|
|
1342
|
-
|
|
1343
|
-
v && (p._f.deps && ne(p._f.deps),
|
|
1342
|
+
q([u], !0), O = (await Ot(p, a.disabled, r, w, t.shouldUseNativeValidation))[u], q([u]), b(Me), v && (O ? oe = !1 : (g.isValid || y.isValid) && (oe = await B(n, !0)));
|
|
1343
|
+
v && (p._f.deps && ne(p._f.deps), G(u, oe, O, et));
|
|
1344
1344
|
}
|
|
1345
|
-
},
|
|
1346
|
-
if (_(s.errors, l) &&
|
|
1347
|
-
return
|
|
1348
|
-
}, ne = async (
|
|
1345
|
+
}, ee = (o, l) => {
|
|
1346
|
+
if (_(s.errors, l) && o.focus)
|
|
1347
|
+
return o.focus(), 1;
|
|
1348
|
+
}, ne = async (o, l = {}) => {
|
|
1349
1349
|
let u, v;
|
|
1350
|
-
const p = Fe(
|
|
1350
|
+
const p = Fe(o);
|
|
1351
1351
|
if (t.resolver) {
|
|
1352
|
-
const b = await
|
|
1353
|
-
u = se(b), v =
|
|
1354
|
-
} else
|
|
1352
|
+
const b = await le(W(o) ? o : p);
|
|
1353
|
+
u = se(b), v = o ? !p.some((S) => _(b, S)) : u;
|
|
1354
|
+
} else o ? (v = (await Promise.all(p.map(async (b) => {
|
|
1355
1355
|
const S = _(n, b);
|
|
1356
|
-
return await
|
|
1357
|
-
}))).every(Boolean), !(!v && !s.isValid) && x()) : v = u = await
|
|
1356
|
+
return await B(S && S._f ? { [b]: S } : S);
|
|
1357
|
+
}))).every(Boolean), !(!v && !s.isValid) && x()) : v = u = await B(n);
|
|
1358
1358
|
return f.state.next({
|
|
1359
|
-
...!ye(
|
|
1360
|
-
...t.resolver || !
|
|
1359
|
+
...!ye(o) || (g.isValid || y.isValid) && u !== s.isValid ? {} : { name: o },
|
|
1360
|
+
...t.resolver || !o ? { isValid: u } : {},
|
|
1361
1361
|
errors: s.errors
|
|
1362
|
-
}), l.shouldFocus && !v && Te(n,
|
|
1363
|
-
},
|
|
1362
|
+
}), l.shouldFocus && !v && Te(n, ee, o ? p : a.mount), v;
|
|
1363
|
+
}, ue = (o) => {
|
|
1364
1364
|
const l = {
|
|
1365
1365
|
...c.mount ? r : i
|
|
1366
1366
|
};
|
|
1367
|
-
return
|
|
1368
|
-
}, Ie = (
|
|
1369
|
-
invalid: !!_((l || s).errors,
|
|
1370
|
-
isDirty: !!_((l || s).dirtyFields,
|
|
1371
|
-
error: _((l || s).errors,
|
|
1372
|
-
isValidating: !!_(s.validatingFields,
|
|
1373
|
-
isTouched: !!_((l || s).touchedFields,
|
|
1374
|
-
}), Ce = (
|
|
1375
|
-
|
|
1376
|
-
errors:
|
|
1367
|
+
return W(o) ? l : ye(o) ? _(l, o) : o.map((u) => _(l, u));
|
|
1368
|
+
}, Ie = (o, l) => ({
|
|
1369
|
+
invalid: !!_((l || s).errors, o),
|
|
1370
|
+
isDirty: !!_((l || s).dirtyFields, o),
|
|
1371
|
+
error: _((l || s).errors, o),
|
|
1372
|
+
isValidating: !!_(s.validatingFields, o),
|
|
1373
|
+
isTouched: !!_((l || s).touchedFields, o)
|
|
1374
|
+
}), Ce = (o) => {
|
|
1375
|
+
o && Fe(o).forEach((l) => K(s.errors, l)), f.state.next({
|
|
1376
|
+
errors: o ? s.errors : {}
|
|
1377
1377
|
});
|
|
1378
|
-
}, dt = (
|
|
1379
|
-
const v = (_(n,
|
|
1380
|
-
U(s.errors,
|
|
1381
|
-
...
|
|
1378
|
+
}, dt = (o, l, u) => {
|
|
1379
|
+
const v = (_(n, o, { _f: {} })._f || {}).ref, p = _(s.errors, o) || {}, { ref: b, message: S, type: L, ...O } = p;
|
|
1380
|
+
U(s.errors, o, {
|
|
1381
|
+
...O,
|
|
1382
1382
|
...l,
|
|
1383
1383
|
ref: v
|
|
1384
1384
|
}), f.state.next({
|
|
1385
|
-
name:
|
|
1385
|
+
name: o,
|
|
1386
1386
|
errors: s.errors,
|
|
1387
1387
|
isValid: !1
|
|
1388
1388
|
}), u && u.shouldFocus && v && v.focus && v.focus();
|
|
1389
|
-
}, cs = (
|
|
1390
|
-
next: (u) => "values" in u &&
|
|
1391
|
-
}) : N(
|
|
1389
|
+
}, cs = (o, l) => fe(o) ? f.state.subscribe({
|
|
1390
|
+
next: (u) => "values" in u && o(N(void 0, l), u)
|
|
1391
|
+
}) : N(o, l, !0), ft = (o) => f.state.subscribe({
|
|
1392
1392
|
next: (l) => {
|
|
1393
|
-
gr(
|
|
1393
|
+
gr(o.name, l.name, o.exact) && yr(l, o.formState || g, ms, o.reRenderRoot) && o.callback({
|
|
1394
1394
|
values: { ...r },
|
|
1395
1395
|
...s,
|
|
1396
1396
|
...l,
|
|
1397
1397
|
defaultValues: i
|
|
1398
1398
|
});
|
|
1399
1399
|
}
|
|
1400
|
-
}).unsubscribe, ls = (
|
|
1400
|
+
}).unsubscribe, ls = (o) => (c.mount = !0, y = {
|
|
1401
1401
|
...y,
|
|
1402
|
-
...
|
|
1402
|
+
...o.formState
|
|
1403
1403
|
}, ft({
|
|
1404
|
-
...
|
|
1404
|
+
...o,
|
|
1405
1405
|
formState: y
|
|
1406
|
-
})),
|
|
1407
|
-
for (const u of
|
|
1408
|
-
|
|
1406
|
+
})), Je = (o, l = {}) => {
|
|
1407
|
+
for (const u of o ? Fe(o) : a.mount)
|
|
1408
|
+
a.mount.delete(u), a.array.delete(u), l.keepValue || (K(n, u), K(r, u)), !l.keepError && K(s.errors, u), !l.keepDirty && K(s.dirtyFields, u), !l.keepTouched && K(s.touchedFields, u), !l.keepIsValidating && K(s.validatingFields, u), !t.shouldUnregister && !l.keepDefaultValue && K(i, u);
|
|
1409
1409
|
f.state.next({
|
|
1410
|
-
values:
|
|
1410
|
+
values: Y(r)
|
|
1411
1411
|
}), f.state.next({
|
|
1412
1412
|
...s,
|
|
1413
|
-
...l.keepDirty ? { isDirty:
|
|
1413
|
+
...l.keepDirty ? { isDirty: I() } : {}
|
|
1414
1414
|
}), !l.keepIsValid && x();
|
|
1415
|
-
}, mt = ({ disabled:
|
|
1416
|
-
(he(
|
|
1417
|
-
},
|
|
1418
|
-
let u = _(n,
|
|
1415
|
+
}, mt = ({ disabled: o, name: l }) => {
|
|
1416
|
+
(he(o) && c.mount || o || a.disabled.has(l)) && (o ? a.disabled.add(l) : a.disabled.delete(l));
|
|
1417
|
+
}, Ye = (o, l = {}) => {
|
|
1418
|
+
let u = _(n, o);
|
|
1419
1419
|
const v = he(l.disabled) || he(t.disabled);
|
|
1420
|
-
return U(n,
|
|
1420
|
+
return U(n, o, {
|
|
1421
1421
|
...u || {},
|
|
1422
1422
|
_f: {
|
|
1423
|
-
...u && u._f ? u._f : { ref: { name:
|
|
1424
|
-
name:
|
|
1423
|
+
...u && u._f ? u._f : { ref: { name: o } },
|
|
1424
|
+
name: o,
|
|
1425
1425
|
mount: !0,
|
|
1426
1426
|
...l
|
|
1427
1427
|
}
|
|
1428
|
-
}),
|
|
1428
|
+
}), a.mount.add(o), u ? mt({
|
|
1429
1429
|
disabled: he(l.disabled) ? l.disabled : t.disabled,
|
|
1430
|
-
name:
|
|
1431
|
-
}) :
|
|
1430
|
+
name: o
|
|
1431
|
+
}) : D(o, !0, l.value), {
|
|
1432
1432
|
...v ? { disabled: l.disabled || t.disabled } : {},
|
|
1433
1433
|
...t.progressive ? {
|
|
1434
1434
|
required: !!l.required,
|
|
@@ -1438,64 +1438,64 @@ function xr(e = {}) {
|
|
|
1438
1438
|
maxLength: $e(l.maxLength),
|
|
1439
1439
|
pattern: $e(l.pattern)
|
|
1440
1440
|
} : {},
|
|
1441
|
-
name:
|
|
1442
|
-
onChange:
|
|
1443
|
-
onBlur:
|
|
1441
|
+
name: o,
|
|
1442
|
+
onChange: P,
|
|
1443
|
+
onBlur: P,
|
|
1444
1444
|
ref: (p) => {
|
|
1445
1445
|
if (p) {
|
|
1446
|
-
|
|
1447
|
-
const b =
|
|
1448
|
-
if (S ?
|
|
1446
|
+
Ye(o, l), u = _(n, o);
|
|
1447
|
+
const b = W(p.value) && p.querySelectorAll && p.querySelectorAll("input,select,textarea")[0] || p, S = lr(b), L = u._f.refs || [];
|
|
1448
|
+
if (S ? L.find((O) => O === b) : b === u._f.ref)
|
|
1449
1449
|
return;
|
|
1450
|
-
U(n,
|
|
1450
|
+
U(n, o, {
|
|
1451
1451
|
_f: {
|
|
1452
1452
|
...u._f,
|
|
1453
1453
|
...S ? {
|
|
1454
1454
|
refs: [
|
|
1455
|
-
...
|
|
1455
|
+
...L.filter(st),
|
|
1456
1456
|
b,
|
|
1457
|
-
...Array.isArray(_(i,
|
|
1457
|
+
...Array.isArray(_(i, o)) ? [{}] : []
|
|
1458
1458
|
],
|
|
1459
|
-
ref: { type: b.type, name:
|
|
1459
|
+
ref: { type: b.type, name: o }
|
|
1460
1460
|
} : { ref: b }
|
|
1461
1461
|
}
|
|
1462
|
-
}),
|
|
1462
|
+
}), D(o, !1, void 0, b);
|
|
1463
1463
|
} else
|
|
1464
|
-
u = _(n,
|
|
1464
|
+
u = _(n, o, {}), u._f && (u._f.mount = !1), (t.shouldUnregister || l.shouldUnregister) && !(sr(a.array, o) && c.action) && a.unMount.add(o);
|
|
1465
1465
|
}
|
|
1466
1466
|
};
|
|
1467
|
-
},
|
|
1468
|
-
he(
|
|
1467
|
+
}, Xe = () => t.shouldFocusError && Te(n, ee, a.mount), us = (o) => {
|
|
1468
|
+
he(o) && (f.state.next({ disabled: o }), Te(n, (l, u) => {
|
|
1469
1469
|
const v = _(n, u);
|
|
1470
|
-
v && (l.disabled = v._f.disabled ||
|
|
1471
|
-
p.disabled = v._f.disabled ||
|
|
1470
|
+
v && (l.disabled = v._f.disabled || o, Array.isArray(v._f.refs) && v._f.refs.forEach((p) => {
|
|
1471
|
+
p.disabled = v._f.disabled || o;
|
|
1472
1472
|
}));
|
|
1473
1473
|
}, 0, !1));
|
|
1474
|
-
}, ht = (
|
|
1474
|
+
}, ht = (o, l) => async (u) => {
|
|
1475
1475
|
let v;
|
|
1476
1476
|
u && (u.preventDefault && u.preventDefault(), u.persist && u.persist());
|
|
1477
|
-
let p =
|
|
1477
|
+
let p = Y(r);
|
|
1478
1478
|
if (f.state.next({
|
|
1479
1479
|
isSubmitting: !0
|
|
1480
1480
|
}), t.resolver) {
|
|
1481
|
-
const { errors: b, values: S } = await
|
|
1482
|
-
s.errors = b, p =
|
|
1481
|
+
const { errors: b, values: S } = await V();
|
|
1482
|
+
s.errors = b, p = Y(S);
|
|
1483
1483
|
} else
|
|
1484
|
-
await
|
|
1485
|
-
if (
|
|
1486
|
-
for (const b of
|
|
1487
|
-
|
|
1488
|
-
if (
|
|
1484
|
+
await B(n);
|
|
1485
|
+
if (a.disabled.size)
|
|
1486
|
+
for (const b of a.disabled)
|
|
1487
|
+
K(p, b);
|
|
1488
|
+
if (K(s.errors, "root"), se(s.errors)) {
|
|
1489
1489
|
f.state.next({
|
|
1490
1490
|
errors: {}
|
|
1491
1491
|
});
|
|
1492
1492
|
try {
|
|
1493
|
-
await
|
|
1493
|
+
await o(p, u);
|
|
1494
1494
|
} catch (b) {
|
|
1495
1495
|
v = b;
|
|
1496
1496
|
}
|
|
1497
1497
|
} else
|
|
1498
|
-
l && await l({ ...s.errors }, u),
|
|
1498
|
+
l && await l({ ...s.errors }, u), Xe(), setTimeout(Xe);
|
|
1499
1499
|
if (f.state.next({
|
|
1500
1500
|
isSubmitted: !0,
|
|
1501
1501
|
isSubmitting: !1,
|
|
@@ -1504,47 +1504,47 @@ function xr(e = {}) {
|
|
|
1504
1504
|
errors: s.errors
|
|
1505
1505
|
}), v)
|
|
1506
1506
|
throw v;
|
|
1507
|
-
}, ds = (
|
|
1508
|
-
_(n,
|
|
1509
|
-
}, yt = (
|
|
1510
|
-
const u =
|
|
1507
|
+
}, ds = (o, l = {}) => {
|
|
1508
|
+
_(n, o) && (W(l.defaultValue) ? X(o, Y(_(i, o))) : (X(o, l.defaultValue), U(i, o, Y(l.defaultValue))), l.keepTouched || K(s.touchedFields, o), l.keepDirty || (K(s.dirtyFields, o), s.isDirty = l.defaultValue ? I(o, Y(_(i, o))) : I()), l.keepError || (K(s.errors, o), g.isValid && x()), f.state.next({ ...s }));
|
|
1509
|
+
}, yt = (o, l = {}) => {
|
|
1510
|
+
const u = o ? Y(o) : i, v = Y(u), p = se(o), b = p ? i : v;
|
|
1511
1511
|
if (l.keepDefaultValues || (i = u), !l.keepValues) {
|
|
1512
1512
|
if (l.keepDirtyValues) {
|
|
1513
1513
|
const S = /* @__PURE__ */ new Set([
|
|
1514
|
-
...
|
|
1514
|
+
...a.mount,
|
|
1515
1515
|
...Object.keys(Ee(i, r))
|
|
1516
1516
|
]);
|
|
1517
|
-
for (const
|
|
1518
|
-
_(s.dirtyFields,
|
|
1517
|
+
for (const L of Array.from(S))
|
|
1518
|
+
_(s.dirtyFields, L) ? U(b, L, _(r, L)) : X(L, _(b, L));
|
|
1519
1519
|
} else {
|
|
1520
|
-
if (nt &&
|
|
1521
|
-
for (const S of
|
|
1522
|
-
const
|
|
1523
|
-
if (
|
|
1524
|
-
const
|
|
1525
|
-
if (
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1528
|
-
|
|
1520
|
+
if (nt && W(o))
|
|
1521
|
+
for (const S of a.mount) {
|
|
1522
|
+
const L = _(n, S);
|
|
1523
|
+
if (L && L._f) {
|
|
1524
|
+
const O = Array.isArray(L._f.refs) ? L._f.refs[0] : L._f.ref;
|
|
1525
|
+
if (qe(O)) {
|
|
1526
|
+
const oe = O.closest("form");
|
|
1527
|
+
if (oe) {
|
|
1528
|
+
oe.reset();
|
|
1529
1529
|
break;
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
1534
1534
|
if (l.keepFieldsRef)
|
|
1535
|
-
for (const S of
|
|
1535
|
+
for (const S of a.mount)
|
|
1536
1536
|
X(S, _(b, S));
|
|
1537
1537
|
else
|
|
1538
1538
|
n = {};
|
|
1539
1539
|
}
|
|
1540
|
-
r = t.shouldUnregister ? l.keepDefaultValues ?
|
|
1540
|
+
r = t.shouldUnregister ? l.keepDefaultValues ? Y(i) : {} : Y(b), f.array.next({
|
|
1541
1541
|
values: { ...b }
|
|
1542
1542
|
}), f.state.next({
|
|
1543
1543
|
values: { ...b }
|
|
1544
1544
|
});
|
|
1545
1545
|
}
|
|
1546
|
-
|
|
1547
|
-
mount: l.keepDirtyValues ?
|
|
1546
|
+
a = {
|
|
1547
|
+
mount: l.keepDirtyValues ? a.mount : /* @__PURE__ */ new Set(),
|
|
1548
1548
|
unMount: /* @__PURE__ */ new Set(),
|
|
1549
1549
|
array: /* @__PURE__ */ new Set(),
|
|
1550
1550
|
disabled: /* @__PURE__ */ new Set(),
|
|
@@ -1553,45 +1553,45 @@ function xr(e = {}) {
|
|
|
1553
1553
|
focus: ""
|
|
1554
1554
|
}, c.mount = !g.isValid || !!l.keepIsValid || !!l.keepDirtyValues, c.watch = !!t.shouldUnregister, f.state.next({
|
|
1555
1555
|
submitCount: l.keepSubmitCount ? s.submitCount : 0,
|
|
1556
|
-
isDirty: p ? !1 : l.keepDirty ? s.isDirty : !!(l.keepDefaultValues && !ve(
|
|
1556
|
+
isDirty: p ? !1 : l.keepDirty ? s.isDirty : !!(l.keepDefaultValues && !ve(o, i)),
|
|
1557
1557
|
isSubmitted: l.keepIsSubmitted ? s.isSubmitted : !1,
|
|
1558
|
-
dirtyFields: p ? {} : l.keepDirtyValues ? l.keepDefaultValues && r ? Ee(i, r) : s.dirtyFields : l.keepDefaultValues &&
|
|
1558
|
+
dirtyFields: p ? {} : l.keepDirtyValues ? l.keepDefaultValues && r ? Ee(i, r) : s.dirtyFields : l.keepDefaultValues && o ? Ee(i, o) : l.keepDirty ? s.dirtyFields : {},
|
|
1559
1559
|
touchedFields: l.keepTouched ? s.touchedFields : {},
|
|
1560
1560
|
errors: l.keepErrors ? s.errors : {},
|
|
1561
1561
|
isSubmitSuccessful: l.keepIsSubmitSuccessful ? s.isSubmitSuccessful : !1,
|
|
1562
1562
|
isSubmitting: !1
|
|
1563
1563
|
});
|
|
1564
|
-
}, gt = (
|
|
1565
|
-
const u = _(n,
|
|
1564
|
+
}, gt = (o, l) => yt(fe(o) ? o(r) : o, l), fs = (o, l = {}) => {
|
|
1565
|
+
const u = _(n, o), v = u && u._f;
|
|
1566
1566
|
if (v) {
|
|
1567
1567
|
const p = v.refs ? v.refs[0] : v.ref;
|
|
1568
|
-
p.focus && (p.focus(), l.shouldSelect &&
|
|
1568
|
+
p.focus && (p.focus(), l.shouldSelect && fe(p.select) && p.select());
|
|
1569
1569
|
}
|
|
1570
|
-
}, ms = (
|
|
1570
|
+
}, ms = (o) => {
|
|
1571
1571
|
s = {
|
|
1572
1572
|
...s,
|
|
1573
|
-
...
|
|
1573
|
+
...o
|
|
1574
1574
|
};
|
|
1575
1575
|
}, bt = {
|
|
1576
1576
|
control: {
|
|
1577
|
-
register:
|
|
1578
|
-
unregister:
|
|
1577
|
+
register: Ye,
|
|
1578
|
+
unregister: Je,
|
|
1579
1579
|
getFieldState: Ie,
|
|
1580
1580
|
handleSubmit: ht,
|
|
1581
1581
|
setError: dt,
|
|
1582
1582
|
_subscribe: ft,
|
|
1583
|
-
_runSchema:
|
|
1584
|
-
_focusError:
|
|
1583
|
+
_runSchema: V,
|
|
1584
|
+
_focusError: Xe,
|
|
1585
1585
|
_getWatch: N,
|
|
1586
|
-
_getDirty:
|
|
1586
|
+
_getDirty: I,
|
|
1587
1587
|
_setValid: x,
|
|
1588
|
-
_setFieldArray:
|
|
1588
|
+
_setFieldArray: ae,
|
|
1589
1589
|
_setDisabledField: mt,
|
|
1590
|
-
_setErrors:
|
|
1591
|
-
_getFieldArray:
|
|
1590
|
+
_setErrors: z,
|
|
1591
|
+
_getFieldArray: E,
|
|
1592
1592
|
_reset: yt,
|
|
1593
|
-
_resetDefaultValues: () =>
|
|
1594
|
-
gt(
|
|
1593
|
+
_resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((o) => {
|
|
1594
|
+
gt(o, t.resetOptions), f.state.next({
|
|
1595
1595
|
isLoading: !1
|
|
1596
1596
|
});
|
|
1597
1597
|
}),
|
|
@@ -1608,17 +1608,17 @@ function xr(e = {}) {
|
|
|
1608
1608
|
get _state() {
|
|
1609
1609
|
return c;
|
|
1610
1610
|
},
|
|
1611
|
-
set _state(
|
|
1612
|
-
c =
|
|
1611
|
+
set _state(o) {
|
|
1612
|
+
c = o;
|
|
1613
1613
|
},
|
|
1614
1614
|
get _defaultValues() {
|
|
1615
1615
|
return i;
|
|
1616
1616
|
},
|
|
1617
1617
|
get _names() {
|
|
1618
|
-
return
|
|
1618
|
+
return a;
|
|
1619
1619
|
},
|
|
1620
|
-
set _names(
|
|
1621
|
-
|
|
1620
|
+
set _names(o) {
|
|
1621
|
+
a = o;
|
|
1622
1622
|
},
|
|
1623
1623
|
get _formState() {
|
|
1624
1624
|
return s;
|
|
@@ -1626,24 +1626,24 @@ function xr(e = {}) {
|
|
|
1626
1626
|
get _options() {
|
|
1627
1627
|
return t;
|
|
1628
1628
|
},
|
|
1629
|
-
set _options(
|
|
1629
|
+
set _options(o) {
|
|
1630
1630
|
t = {
|
|
1631
1631
|
...t,
|
|
1632
|
-
...
|
|
1632
|
+
...o
|
|
1633
1633
|
};
|
|
1634
1634
|
}
|
|
1635
1635
|
},
|
|
1636
1636
|
subscribe: ls,
|
|
1637
1637
|
trigger: ne,
|
|
1638
|
-
register:
|
|
1638
|
+
register: Ye,
|
|
1639
1639
|
handleSubmit: ht,
|
|
1640
1640
|
watch: cs,
|
|
1641
1641
|
setValue: X,
|
|
1642
|
-
getValues:
|
|
1642
|
+
getValues: ue,
|
|
1643
1643
|
reset: gt,
|
|
1644
1644
|
resetField: ds,
|
|
1645
1645
|
clearErrors: Ce,
|
|
1646
|
-
unregister:
|
|
1646
|
+
unregister: Je,
|
|
1647
1647
|
setError: dt,
|
|
1648
1648
|
setFocus: fs,
|
|
1649
1649
|
getFieldState: Ie
|
|
@@ -1653,11 +1653,11 @@ function xr(e = {}) {
|
|
|
1653
1653
|
formControl: bt
|
|
1654
1654
|
};
|
|
1655
1655
|
}
|
|
1656
|
-
function
|
|
1656
|
+
function as(e = {}) {
|
|
1657
1657
|
const t = ie.useRef(void 0), s = ie.useRef(void 0), [n, i] = ie.useState({
|
|
1658
1658
|
isDirty: !1,
|
|
1659
1659
|
isValidating: !1,
|
|
1660
|
-
isLoading:
|
|
1660
|
+
isLoading: fe(e.defaultValues),
|
|
1661
1661
|
isSubmitted: !1,
|
|
1662
1662
|
isSubmitting: !1,
|
|
1663
1663
|
isSubmitSuccessful: !1,
|
|
@@ -1669,30 +1669,30 @@ function os(e = {}) {
|
|
|
1669
1669
|
errors: e.errors || {},
|
|
1670
1670
|
disabled: e.disabled || !1,
|
|
1671
1671
|
isReady: !1,
|
|
1672
|
-
defaultValues:
|
|
1672
|
+
defaultValues: fe(e.defaultValues) ? void 0 : e.defaultValues
|
|
1673
1673
|
});
|
|
1674
1674
|
if (!t.current)
|
|
1675
1675
|
if (e.formControl)
|
|
1676
1676
|
t.current = {
|
|
1677
1677
|
...e.formControl,
|
|
1678
1678
|
formState: n
|
|
1679
|
-
}, e.defaultValues && !
|
|
1679
|
+
}, e.defaultValues && !fe(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
1680
1680
|
else {
|
|
1681
|
-
const { formControl: c, ...
|
|
1681
|
+
const { formControl: c, ...a } = xr(e);
|
|
1682
1682
|
t.current = {
|
|
1683
|
-
...
|
|
1683
|
+
...a,
|
|
1684
1684
|
formState: n
|
|
1685
1685
|
};
|
|
1686
1686
|
}
|
|
1687
1687
|
const r = t.current.control;
|
|
1688
|
-
return r._options = e,
|
|
1688
|
+
return r._options = e, ar(() => {
|
|
1689
1689
|
const c = r._subscribe({
|
|
1690
1690
|
formState: r._proxyFormState,
|
|
1691
1691
|
callback: () => i({ ...r._formState }),
|
|
1692
1692
|
reRenderRoot: !0
|
|
1693
1693
|
});
|
|
1694
|
-
return i((
|
|
1695
|
-
...
|
|
1694
|
+
return i((a) => ({
|
|
1695
|
+
...a,
|
|
1696
1696
|
isReady: !0
|
|
1697
1697
|
})), r._formState.isReady = !0, c;
|
|
1698
1698
|
}, [r]), ie.useEffect(() => r._disableForm(e.disabled), [r, e.disabled]), ie.useEffect(() => {
|
|
@@ -1719,59 +1719,59 @@ function os(e = {}) {
|
|
|
1719
1719
|
r._state.mount || (r._setValid(), r._state.mount = !0), r._state.watch && (r._state.watch = !1, r._subjects.state.next({ ...r._formState })), r._removeUnmounted();
|
|
1720
1720
|
}), t.current.formState = ir(n, r), t.current;
|
|
1721
1721
|
}
|
|
1722
|
-
const
|
|
1723
|
-
const { t } =
|
|
1722
|
+
const an = (e) => {
|
|
1723
|
+
const { t } = T(), { showStackNotifications: s, showSuccessNotification: n } = ke(), {
|
|
1724
1724
|
defaultValues: i,
|
|
1725
1725
|
mutationFn: r,
|
|
1726
1726
|
formToDto: c,
|
|
1727
|
-
onError:
|
|
1727
|
+
onError: a,
|
|
1728
1728
|
onSuccess: d,
|
|
1729
1729
|
queryKey: h,
|
|
1730
1730
|
onSuccessMessage: g
|
|
1731
|
-
} = e, { control: y, handleSubmit: f, reset: w, setError: C, getValues: x, setValue:
|
|
1731
|
+
} = e, { control: y, handleSubmit: f, reset: w, setError: C, getValues: x, setValue: q } = as({
|
|
1732
1732
|
defaultValues: i
|
|
1733
|
-
}),
|
|
1734
|
-
(
|
|
1735
|
-
const
|
|
1736
|
-
return
|
|
1737
|
-
const
|
|
1738
|
-
(
|
|
1739
|
-
}),
|
|
1733
|
+
}), ae = F(
|
|
1734
|
+
(D) => {
|
|
1735
|
+
const $ = D == null ? void 0 : D.errors, G = [];
|
|
1736
|
+
return $ && $.forEach(([V, le]) => {
|
|
1737
|
+
const B = document.querySelector(`[name="${V}"]`);
|
|
1738
|
+
(B instanceof HTMLInputElement || B instanceof HTMLTextAreaElement || B instanceof HTMLSelectElement) && (B.focus(), B.classList.add("error"), G.push(t(`_entities:${h}.${V}.${le}`)));
|
|
1739
|
+
}), G;
|
|
1740
1740
|
},
|
|
1741
1741
|
[t, h]
|
|
1742
|
-
), k =
|
|
1743
|
-
document.querySelectorAll("input, textarea, select").forEach((
|
|
1744
|
-
|
|
1742
|
+
), k = F(() => {
|
|
1743
|
+
document.querySelectorAll("input, textarea, select").forEach(($) => {
|
|
1744
|
+
$.classList.remove("error");
|
|
1745
1745
|
});
|
|
1746
|
-
}, []),
|
|
1746
|
+
}, []), z = Pe(
|
|
1747
1747
|
{
|
|
1748
1748
|
mutationFn: r,
|
|
1749
|
-
onError: (
|
|
1750
|
-
console.error(
|
|
1751
|
-
const
|
|
1752
|
-
if (
|
|
1753
|
-
else if (
|
|
1754
|
-
const
|
|
1749
|
+
onError: (D) => {
|
|
1750
|
+
console.error(D);
|
|
1751
|
+
const $ = D;
|
|
1752
|
+
if (a) a(D);
|
|
1753
|
+
else if (Ke($)) {
|
|
1754
|
+
const G = ae($);
|
|
1755
1755
|
s(
|
|
1756
|
-
|
|
1757
|
-
(
|
|
1758
|
-
message:
|
|
1759
|
-
type:
|
|
1756
|
+
G.map(
|
|
1757
|
+
(V) => ({
|
|
1758
|
+
message: V,
|
|
1759
|
+
type: j.error
|
|
1760
1760
|
})
|
|
1761
1761
|
)
|
|
1762
1762
|
);
|
|
1763
|
-
} else if (
|
|
1764
|
-
const
|
|
1763
|
+
} else if (We($)) {
|
|
1764
|
+
const G = $.message || t("_accessibility:errors.500"), V = t(`_accessibility:errors.${$.status}`);
|
|
1765
1765
|
s([
|
|
1766
1766
|
{
|
|
1767
|
-
message:
|
|
1768
|
-
type:
|
|
1767
|
+
message: V || G,
|
|
1768
|
+
type: j.error
|
|
1769
1769
|
}
|
|
1770
1770
|
]);
|
|
1771
1771
|
}
|
|
1772
1772
|
},
|
|
1773
|
-
onSuccess: async (
|
|
1774
|
-
pe && await pe.invalidateQueries({ queryKey: h }), d && d(
|
|
1773
|
+
onSuccess: async (D) => {
|
|
1774
|
+
pe && await pe.invalidateQueries({ queryKey: h }), d && d(D), g && n({
|
|
1775
1775
|
message: g
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
@@ -1780,21 +1780,21 @@ const on = (e) => {
|
|
|
1780
1780
|
return {
|
|
1781
1781
|
control: y,
|
|
1782
1782
|
getValues: x,
|
|
1783
|
-
setValue:
|
|
1783
|
+
setValue: q,
|
|
1784
1784
|
handleSubmit: f,
|
|
1785
|
-
onSubmit: (
|
|
1786
|
-
c ? c(
|
|
1785
|
+
onSubmit: (D) => z.mutate(
|
|
1786
|
+
c ? c(D) : D
|
|
1787
1787
|
),
|
|
1788
1788
|
reset: w,
|
|
1789
1789
|
setError: C,
|
|
1790
|
-
parseFormError:
|
|
1790
|
+
parseFormError: ae,
|
|
1791
1791
|
releaseFormError: k,
|
|
1792
|
-
isLoading:
|
|
1792
|
+
isLoading: z.isPending
|
|
1793
1793
|
};
|
|
1794
1794
|
}, _r = (e) => {
|
|
1795
|
-
const { t } =
|
|
1795
|
+
const { t } = T(), { onClick: s, hidden: n = !1, disabled: i = !1 } = e;
|
|
1796
1796
|
return {
|
|
1797
|
-
action:
|
|
1797
|
+
action: F(
|
|
1798
1798
|
(c) => ({
|
|
1799
1799
|
id: _e.Delete,
|
|
1800
1800
|
hidden: !!c.deletedAt || n,
|
|
@@ -1807,9 +1807,9 @@ const on = (e) => {
|
|
|
1807
1807
|
)
|
|
1808
1808
|
};
|
|
1809
1809
|
}, Cr = (e) => {
|
|
1810
|
-
const { t } =
|
|
1810
|
+
const { t } = T(), { onClick: s, hidden: n = !1 } = e;
|
|
1811
1811
|
return {
|
|
1812
|
-
action:
|
|
1812
|
+
action: F(
|
|
1813
1813
|
(r) => ({
|
|
1814
1814
|
id: _e.Restore,
|
|
1815
1815
|
hidden: !r.deletedAt || n,
|
|
@@ -1821,10 +1821,10 @@ const on = (e) => {
|
|
|
1821
1821
|
[n, s, t]
|
|
1822
1822
|
)
|
|
1823
1823
|
};
|
|
1824
|
-
},
|
|
1825
|
-
const { t } =
|
|
1824
|
+
}, on = (e) => {
|
|
1825
|
+
const { t } = T(), { onClick: s, hidden: n = !1 } = e;
|
|
1826
1826
|
return {
|
|
1827
|
-
action:
|
|
1827
|
+
action: F(
|
|
1828
1828
|
(r) => ({
|
|
1829
1829
|
id: _e.Edit,
|
|
1830
1830
|
hidden: !!r.deletedAt || n,
|
|
@@ -1839,14 +1839,14 @@ const on = (e) => {
|
|
|
1839
1839
|
};
|
|
1840
1840
|
var _e = /* @__PURE__ */ ((e) => (e.Add = "add", e.Edit = "edit", e.Delete = "delete", e.Restore = "restore", e.Refresh = "refresh", e.Export = "export", e.Import = "import", e))(_e || {});
|
|
1841
1841
|
const Sr = (e) => {
|
|
1842
|
-
const { t } =
|
|
1842
|
+
const { t } = T(), {
|
|
1843
1843
|
onClick: s,
|
|
1844
1844
|
hidden: n = !1,
|
|
1845
1845
|
disabled: i = !1,
|
|
1846
1846
|
isLoading: r = !1
|
|
1847
1847
|
} = e;
|
|
1848
1848
|
return {
|
|
1849
|
-
action:
|
|
1849
|
+
action: F(
|
|
1850
1850
|
() => ({
|
|
1851
1851
|
id: _e.Export,
|
|
1852
1852
|
hidden: n,
|
|
@@ -1865,14 +1865,14 @@ const Sr = (e) => {
|
|
|
1865
1865
|
)
|
|
1866
1866
|
};
|
|
1867
1867
|
}, kr = (e) => {
|
|
1868
|
-
const { t } =
|
|
1868
|
+
const { t } = T(), {
|
|
1869
1869
|
onClick: s,
|
|
1870
1870
|
hidden: n = !1,
|
|
1871
1871
|
disabled: i = !1,
|
|
1872
1872
|
isLoading: r = !1
|
|
1873
1873
|
} = e;
|
|
1874
1874
|
return {
|
|
1875
|
-
action:
|
|
1875
|
+
action: F(
|
|
1876
1876
|
() => ({
|
|
1877
1877
|
id: _e.Import,
|
|
1878
1878
|
hidden: n,
|
|
@@ -1891,25 +1891,25 @@ const Sr = (e) => {
|
|
|
1891
1891
|
)
|
|
1892
1892
|
};
|
|
1893
1893
|
}, cn = (e) => {
|
|
1894
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = ke(), { t: r } =
|
|
1894
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = ke(), { t: r } = T(), { open: c, onClick: a, close: d, dialogFn: h, isLoading: g } = Xt({
|
|
1895
1895
|
onSuccessMessage: r("_pages:common.actions.delete.successMessage"),
|
|
1896
1896
|
onError: (f) => {
|
|
1897
1897
|
const w = f;
|
|
1898
|
-
if (
|
|
1898
|
+
if (Ke(w))
|
|
1899
1899
|
i(
|
|
1900
1900
|
w.errors.map(
|
|
1901
1901
|
([C, x]) => ({
|
|
1902
1902
|
message: r(`_pages:${C}.errors.${x}`),
|
|
1903
|
-
type:
|
|
1903
|
+
type: j.error
|
|
1904
1904
|
})
|
|
1905
1905
|
)
|
|
1906
1906
|
);
|
|
1907
|
-
else if (
|
|
1907
|
+
else if (We(w)) {
|
|
1908
1908
|
const C = w.message || r("_accessibility:errors.500"), x = r(`_accessibility:errors.${w.status}`);
|
|
1909
1909
|
i([
|
|
1910
1910
|
{
|
|
1911
1911
|
message: x || C,
|
|
1912
|
-
type:
|
|
1912
|
+
type: j.error
|
|
1913
1913
|
}
|
|
1914
1914
|
]);
|
|
1915
1915
|
}
|
|
@@ -1918,9 +1918,9 @@ const Sr = (e) => {
|
|
|
1918
1918
|
await pe.invalidateQueries({ queryKey: t }), s && s(f);
|
|
1919
1919
|
},
|
|
1920
1920
|
...n
|
|
1921
|
-
}), { action: y } = _r({ onClick:
|
|
1921
|
+
}), { action: y } = _r({ onClick: a });
|
|
1922
1922
|
return {
|
|
1923
|
-
onClick:
|
|
1923
|
+
onClick: a,
|
|
1924
1924
|
title: r("_pages:common.actions.delete.dialog.title"),
|
|
1925
1925
|
open: c,
|
|
1926
1926
|
isLoading: g,
|
|
@@ -1928,18 +1928,18 @@ const Sr = (e) => {
|
|
|
1928
1928
|
handleClose: d,
|
|
1929
1929
|
action: y
|
|
1930
1930
|
};
|
|
1931
|
-
},
|
|
1932
|
-
const [e, t] =
|
|
1931
|
+
}, os = () => {
|
|
1932
|
+
const [e, t] = H(!1);
|
|
1933
1933
|
return { open: e, setOpen: t, handleClose: () => t(!1), handleOpen: () => t(!0) };
|
|
1934
1934
|
}, ln = (e) => {
|
|
1935
|
-
const { t } =
|
|
1935
|
+
const { t } = T(), {
|
|
1936
1936
|
showErrorNotification: s,
|
|
1937
1937
|
showStackNotifications: n,
|
|
1938
1938
|
showSuccessNotification: i
|
|
1939
1939
|
} = ke(), {
|
|
1940
1940
|
defaultValues: r,
|
|
1941
1941
|
getFunction: c,
|
|
1942
|
-
mutationFn:
|
|
1942
|
+
mutationFn: a,
|
|
1943
1943
|
formToDto: d,
|
|
1944
1944
|
dtoToForm: h,
|
|
1945
1945
|
onError: g,
|
|
@@ -1947,103 +1947,103 @@ const Sr = (e) => {
|
|
|
1947
1947
|
queryKey: f,
|
|
1948
1948
|
onSuccessMessage: w,
|
|
1949
1949
|
title: C
|
|
1950
|
-
} = e, [x,
|
|
1950
|
+
} = e, [x, q] = H(0), { open: ae, handleClose: k, handleOpen: z } = os(), { control: D, handleSubmit: $, reset: G, setError: V, getValues: le, setValue: B } = as({
|
|
1951
1951
|
defaultValues: r
|
|
1952
|
-
}), { data: M, isLoading:
|
|
1952
|
+
}), { data: M, isLoading: I } = Qs({
|
|
1953
1953
|
queryFn: () => c == null ? void 0 : c(x),
|
|
1954
1954
|
queryKey: [...f, x],
|
|
1955
1955
|
enabled: !!c && !!f && !!x
|
|
1956
1956
|
});
|
|
1957
|
-
|
|
1958
|
-
M && h &&
|
|
1957
|
+
Z(() => {
|
|
1958
|
+
M && h && G({ ...h(M) });
|
|
1959
1959
|
}, [M]);
|
|
1960
|
-
const N =
|
|
1961
|
-
(
|
|
1962
|
-
const
|
|
1963
|
-
return
|
|
1964
|
-
const Ce = document.querySelector(`[name="${
|
|
1965
|
-
(Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ne.push(t(`_entities:${f}.${
|
|
1960
|
+
const N = F(
|
|
1961
|
+
(P) => {
|
|
1962
|
+
const ee = P == null ? void 0 : P.errors, ne = [];
|
|
1963
|
+
return ee && ee.forEach(([ue, Ie]) => {
|
|
1964
|
+
const Ce = document.querySelector(`[name="${ue}"]`);
|
|
1965
|
+
(Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ne.push(t(`_entities:${f}.${ue}.${Ie}`)));
|
|
1966
1966
|
}), ne;
|
|
1967
1967
|
},
|
|
1968
1968
|
[t, f]
|
|
1969
|
-
),
|
|
1970
|
-
document.querySelectorAll("input, textarea, select").forEach((
|
|
1971
|
-
|
|
1969
|
+
), E = F(() => {
|
|
1970
|
+
document.querySelectorAll("input, textarea, select").forEach((ee) => {
|
|
1971
|
+
ee.classList.remove("error");
|
|
1972
1972
|
});
|
|
1973
|
-
}, []),
|
|
1974
|
-
(
|
|
1975
|
-
|
|
1973
|
+
}, []), R = F(
|
|
1974
|
+
(P) => {
|
|
1975
|
+
q(P ?? 0), z();
|
|
1976
1976
|
},
|
|
1977
|
-
[
|
|
1978
|
-
),
|
|
1979
|
-
|
|
1980
|
-
}, [
|
|
1981
|
-
mutationFn:
|
|
1982
|
-
onError: (
|
|
1983
|
-
if (console.error(
|
|
1977
|
+
[z]
|
|
1978
|
+
), J = F(() => {
|
|
1979
|
+
E(), k(), G();
|
|
1980
|
+
}, [G, E, k]), X = Pe({
|
|
1981
|
+
mutationFn: a,
|
|
1982
|
+
onError: (P) => {
|
|
1983
|
+
if (console.error(P), g) g(P);
|
|
1984
1984
|
else {
|
|
1985
|
-
const
|
|
1986
|
-
if (
|
|
1987
|
-
const ne = N(
|
|
1985
|
+
const ee = P;
|
|
1986
|
+
if (Ke(ee)) {
|
|
1987
|
+
const ne = N(ee);
|
|
1988
1988
|
n(
|
|
1989
1989
|
ne.map(
|
|
1990
|
-
(
|
|
1991
|
-
message:
|
|
1992
|
-
type:
|
|
1990
|
+
(ue) => ({
|
|
1991
|
+
message: ue,
|
|
1992
|
+
type: j.error
|
|
1993
1993
|
})
|
|
1994
1994
|
)
|
|
1995
1995
|
);
|
|
1996
|
-
} else if (
|
|
1997
|
-
const ne =
|
|
1998
|
-
s({ message:
|
|
1996
|
+
} else if (We(ee)) {
|
|
1997
|
+
const ne = ee.message || t("_accessibility:errors.500"), ue = t(`_accessibility:errors.${ee.status}`);
|
|
1998
|
+
s({ message: ue || ne });
|
|
1999
1999
|
} else
|
|
2000
2000
|
s({ message: t("_accessibility:errors.500") });
|
|
2001
2001
|
}
|
|
2002
2002
|
},
|
|
2003
|
-
onSuccess: async (
|
|
2004
|
-
await pe.invalidateQueries({ queryKey: f }), y && y(
|
|
2003
|
+
onSuccess: async (P) => {
|
|
2004
|
+
await pe.invalidateQueries({ queryKey: f }), y && y(P), i({
|
|
2005
2005
|
message: w
|
|
2006
|
-
}),
|
|
2006
|
+
}), J();
|
|
2007
2007
|
}
|
|
2008
2008
|
});
|
|
2009
2009
|
return {
|
|
2010
|
-
open:
|
|
2011
|
-
openDialog:
|
|
2012
|
-
handleClose:
|
|
2013
|
-
control:
|
|
2014
|
-
getValues:
|
|
2015
|
-
setValue:
|
|
2016
|
-
handleSubmit:
|
|
2017
|
-
onSubmit: (
|
|
2018
|
-
d ? d(
|
|
2010
|
+
open: ae,
|
|
2011
|
+
openDialog: R,
|
|
2012
|
+
handleClose: J,
|
|
2013
|
+
control: D,
|
|
2014
|
+
getValues: le,
|
|
2015
|
+
setValue: B,
|
|
2016
|
+
handleSubmit: $,
|
|
2017
|
+
onSubmit: (P) => X.mutate(
|
|
2018
|
+
d ? d(P) : P
|
|
2019
2019
|
),
|
|
2020
|
-
reset:
|
|
2021
|
-
setError:
|
|
2020
|
+
reset: G,
|
|
2021
|
+
setError: V,
|
|
2022
2022
|
parseFormError: N,
|
|
2023
|
-
releaseFormError:
|
|
2023
|
+
releaseFormError: E,
|
|
2024
2024
|
title: C,
|
|
2025
|
-
isLoading:
|
|
2025
|
+
isLoading: I || X.isPending
|
|
2026
2026
|
};
|
|
2027
2027
|
}, un = (e) => {
|
|
2028
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = ke(), { t: r } =
|
|
2028
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = ke(), { t: r } = T(), { open: c, onClick: a, close: d, dialogFn: h, isLoading: g } = Xt({
|
|
2029
2029
|
onSuccessMessage: r("_pages:common.actions.restore.successMessage"),
|
|
2030
2030
|
onError: (f) => {
|
|
2031
2031
|
const w = f;
|
|
2032
|
-
if (
|
|
2032
|
+
if (Ke(w))
|
|
2033
2033
|
i(
|
|
2034
2034
|
w.errors.map(
|
|
2035
2035
|
([C, x]) => ({
|
|
2036
2036
|
message: r(`_pages:${C}.errors.${x}`),
|
|
2037
|
-
type:
|
|
2037
|
+
type: j.error
|
|
2038
2038
|
})
|
|
2039
2039
|
)
|
|
2040
2040
|
);
|
|
2041
|
-
else if (
|
|
2041
|
+
else if (We(w)) {
|
|
2042
2042
|
const C = w.message || r("_accessibility:errors.500"), x = r(`_accessibility:errors.${w.status}`);
|
|
2043
2043
|
i([
|
|
2044
2044
|
{
|
|
2045
2045
|
message: x || C,
|
|
2046
|
-
type:
|
|
2046
|
+
type: j.error
|
|
2047
2047
|
}
|
|
2048
2048
|
]);
|
|
2049
2049
|
}
|
|
@@ -2052,9 +2052,9 @@ const Sr = (e) => {
|
|
|
2052
2052
|
await pe.invalidateQueries({ queryKey: t }), s && s(f);
|
|
2053
2053
|
},
|
|
2054
2054
|
...n
|
|
2055
|
-
}), { action: y } = Cr({ onClick:
|
|
2055
|
+
}), { action: y } = Cr({ onClick: a });
|
|
2056
2056
|
return {
|
|
2057
|
-
onClick:
|
|
2057
|
+
onClick: a,
|
|
2058
2058
|
title: r("_pages:common.actions.restore.dialog.title"),
|
|
2059
2059
|
open: c,
|
|
2060
2060
|
isLoading: g,
|
|
@@ -2064,9 +2064,7 @@ const Sr = (e) => {
|
|
|
2064
2064
|
};
|
|
2065
2065
|
};
|
|
2066
2066
|
function dn(e) {
|
|
2067
|
-
const { t } =
|
|
2068
|
-
console.log(o);
|
|
2069
|
-
const w = Pe({
|
|
2067
|
+
const { t } = T(), { queryKey: s, mutationFn: n, entity: i, fileProcessor: r, onError: c } = e, [a, d] = H(!1), [h, g] = H(null), [y, f] = H(!1), w = Pe({
|
|
2070
2068
|
mutationFn: n,
|
|
2071
2069
|
onError: (x) => {
|
|
2072
2070
|
console.error(x), c == null || c(x);
|
|
@@ -2093,23 +2091,23 @@ function dn(e) {
|
|
|
2093
2091
|
fileProcessor: r,
|
|
2094
2092
|
onFileProcessed: (x) => g(x),
|
|
2095
2093
|
onOverrideChange: (x) => f(x),
|
|
2096
|
-
open:
|
|
2094
|
+
open: a,
|
|
2097
2095
|
title: t("_pages:common.actions.import.dialog.title", {
|
|
2098
2096
|
entity: t(`_pages:${i}.title`)
|
|
2099
2097
|
}),
|
|
2100
2098
|
handleClose: () => {
|
|
2101
|
-
|
|
2099
|
+
d(!1), g(null);
|
|
2102
2100
|
},
|
|
2103
2101
|
action: C
|
|
2104
2102
|
};
|
|
2105
2103
|
}
|
|
2106
2104
|
const fn = (e) => {
|
|
2107
|
-
const { showSuccessNotification: t } = ke(), { t: s } =
|
|
2105
|
+
const { showSuccessNotification: t } = ke(), { t: s } = T(), {
|
|
2108
2106
|
entity: n,
|
|
2109
2107
|
mutationFn: i,
|
|
2110
2108
|
onError: r,
|
|
2111
2109
|
onSuccess: c,
|
|
2112
|
-
onSuccessMessage:
|
|
2110
|
+
onSuccessMessage: a = s("_pages:common.actions.export.successMessage")
|
|
2113
2111
|
} = e, d = Pe({
|
|
2114
2112
|
mutationFn: () => i(),
|
|
2115
2113
|
onError: (y) => {
|
|
@@ -2118,10 +2116,10 @@ const fn = (e) => {
|
|
|
2118
2116
|
onSuccess: async (y) => {
|
|
2119
2117
|
const f = JSON.stringify(y, null, 2), w = new Blob([f], { type: "application/json" }), C = URL.createObjectURL(w), x = document.createElement("a");
|
|
2120
2118
|
x.href = C, x.download = `${n}.json`, x.click(), URL.revokeObjectURL(C), c && c(y), t({
|
|
2121
|
-
message:
|
|
2119
|
+
message: a
|
|
2122
2120
|
});
|
|
2123
2121
|
}
|
|
2124
|
-
}), h =
|
|
2122
|
+
}), h = F(() => {
|
|
2125
2123
|
d.mutate();
|
|
2126
2124
|
}, [d]), { action: g } = Sr({
|
|
2127
2125
|
onClick: h,
|
|
@@ -2132,16 +2130,16 @@ const fn = (e) => {
|
|
|
2132
2130
|
};
|
|
2133
2131
|
};
|
|
2134
2132
|
function Nr(e) {
|
|
2135
|
-
const [t, s] =
|
|
2133
|
+
const [t, s] = H(!1), n = F(() => {
|
|
2136
2134
|
const i = window.scrollY > e;
|
|
2137
2135
|
s(i);
|
|
2138
2136
|
}, [e]);
|
|
2139
|
-
return
|
|
2137
|
+
return Z(() => (window.addEventListener("scroll", n), () => {
|
|
2140
2138
|
window.removeEventListener("scroll", n);
|
|
2141
2139
|
}), [n]), t;
|
|
2142
2140
|
}
|
|
2143
2141
|
const mn = () => {
|
|
2144
|
-
const { t: e } =
|
|
2142
|
+
const { t: e } = T(), t = Nr(200);
|
|
2145
2143
|
return /* @__PURE__ */ m(
|
|
2146
2144
|
be,
|
|
2147
2145
|
{
|
|
@@ -2153,7 +2151,7 @@ const mn = () => {
|
|
|
2153
2151
|
}
|
|
2154
2152
|
);
|
|
2155
2153
|
}, Ar = (e) => {
|
|
2156
|
-
const { actions: t = [], className: s = "" } = e, { t: n } =
|
|
2154
|
+
const { actions: t = [], className: s = "" } = e, { t: n } = T(), [i, r] = H(!1);
|
|
2157
2155
|
return /* @__PURE__ */ A("div", { className: `actions-dropdown ${s}`, children: [
|
|
2158
2156
|
/* @__PURE__ */ m(
|
|
2159
2157
|
be,
|
|
@@ -2181,7 +2179,7 @@ const mn = () => {
|
|
|
2181
2179
|
state: i = ws.default,
|
|
2182
2180
|
name: r = "",
|
|
2183
2181
|
id: c = "",
|
|
2184
|
-
label:
|
|
2182
|
+
label: a = "",
|
|
2185
2183
|
disabled: d = !1,
|
|
2186
2184
|
required: h = !1,
|
|
2187
2185
|
containerClassName: g = "",
|
|
@@ -2212,7 +2210,7 @@ const mn = () => {
|
|
|
2212
2210
|
htmlFor: r,
|
|
2213
2211
|
className: `text-input-label ${xs(i)} ${f}`,
|
|
2214
2212
|
children: [
|
|
2215
|
-
|
|
2213
|
+
a,
|
|
2216
2214
|
h ? " *" : ""
|
|
2217
2215
|
]
|
|
2218
2216
|
}
|
|
@@ -2226,13 +2224,13 @@ const mn = () => {
|
|
|
2226
2224
|
)
|
|
2227
2225
|
] });
|
|
2228
2226
|
}), yn = (e) => {
|
|
2229
|
-
const { t } =
|
|
2227
|
+
const { t } = T(), {
|
|
2230
2228
|
children: s,
|
|
2231
2229
|
handleSubmit: n,
|
|
2232
2230
|
onSubmit: i,
|
|
2233
2231
|
isLoading: r = !1,
|
|
2234
2232
|
buttonEnd: c = !0,
|
|
2235
|
-
reset:
|
|
2233
|
+
reset: a
|
|
2236
2234
|
} = e;
|
|
2237
2235
|
return /* @__PURE__ */ A("form", { className: "form-container", onSubmit: n(i), children: [
|
|
2238
2236
|
s,
|
|
@@ -2257,7 +2255,7 @@ const mn = () => {
|
|
|
2257
2255
|
{
|
|
2258
2256
|
type: "button",
|
|
2259
2257
|
variant: "outlined",
|
|
2260
|
-
onClick: () =>
|
|
2258
|
+
onClick: () => a == null ? void 0 : a(),
|
|
2261
2259
|
name: t("_accessibility:buttons.cancel"),
|
|
2262
2260
|
"aria-label": t("_accessibility:ariaLabels.cancel"),
|
|
2263
2261
|
children: t("_accessibility:buttons.cancel")
|
|
@@ -2266,7 +2264,7 @@ const mn = () => {
|
|
|
2266
2264
|
] })
|
|
2267
2265
|
] });
|
|
2268
2266
|
}, gn = It(function(e, t) {
|
|
2269
|
-
const [s, n] =
|
|
2267
|
+
const [s, n] = H(!1);
|
|
2270
2268
|
return /* @__PURE__ */ m(Cs, { ...e, type: s ? "text" : "password", ref: t, children: /* @__PURE__ */ m(
|
|
2271
2269
|
be,
|
|
2272
2270
|
{
|
|
@@ -2278,39 +2276,39 @@ const mn = () => {
|
|
|
2278
2276
|
}
|
|
2279
2277
|
) });
|
|
2280
2278
|
}), lt = (e) => {
|
|
2281
|
-
const { t } =
|
|
2279
|
+
const { t } = T(), {
|
|
2282
2280
|
title: s,
|
|
2283
2281
|
children: n,
|
|
2284
2282
|
handleClose: i,
|
|
2285
2283
|
open: r = !1,
|
|
2286
2284
|
containerClassName: c = "",
|
|
2287
|
-
className:
|
|
2285
|
+
className: a = "",
|
|
2288
2286
|
animationClass: d = "appear"
|
|
2289
|
-
} = e, [h, g] =
|
|
2287
|
+
} = e, [h, g] = H(window.innerWidth), y = F(
|
|
2290
2288
|
(x) => {
|
|
2291
2289
|
x.key === "Escape" && r && i();
|
|
2292
2290
|
},
|
|
2293
2291
|
[r, i]
|
|
2294
2292
|
);
|
|
2295
|
-
|
|
2293
|
+
Z(() => (window.addEventListener("keydown", y), () => {
|
|
2296
2294
|
window.removeEventListener("keydown", y);
|
|
2297
2295
|
}), [y]);
|
|
2298
|
-
const f =
|
|
2296
|
+
const f = F(() => {
|
|
2299
2297
|
g(window.innerWidth);
|
|
2300
2298
|
}, []);
|
|
2301
|
-
|
|
2299
|
+
Z(() => (window.addEventListener("resize", f), () => {
|
|
2302
2300
|
window.removeEventListener("resize", f);
|
|
2303
2301
|
}), [f]);
|
|
2304
|
-
const w = Ve(() => Bs({ width: `${h}px` }), [h]), C =
|
|
2302
|
+
const w = Ve(() => Bs({ width: `${h}px` }), [h]), C = F(
|
|
2305
2303
|
(x) => {
|
|
2306
|
-
var
|
|
2307
|
-
((
|
|
2304
|
+
var q;
|
|
2305
|
+
((q = x == null ? void 0 : x.currentTarget) == null ? void 0 : q.getAttribute("name")) === t("_accessibility:buttons.closeDialog") && i();
|
|
2308
2306
|
},
|
|
2309
2307
|
[t, i]
|
|
2310
2308
|
);
|
|
2311
|
-
return
|
|
2312
|
-
const x = (
|
|
2313
|
-
|
|
2309
|
+
return Z(() => {
|
|
2310
|
+
const x = (q) => {
|
|
2311
|
+
q ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
|
|
2314
2312
|
};
|
|
2315
2313
|
return x(r), () => {
|
|
2316
2314
|
x(r);
|
|
@@ -2326,7 +2324,7 @@ const mn = () => {
|
|
|
2326
2324
|
children: /* @__PURE__ */ A(
|
|
2327
2325
|
"div",
|
|
2328
2326
|
{
|
|
2329
|
-
className: `dialog elevated animated ${r ? `opened ${d}` : "closed"} ${
|
|
2327
|
+
className: `dialog elevated animated ${r ? `opened ${d}` : "closed"} ${a}`,
|
|
2330
2328
|
children: [
|
|
2331
2329
|
/* @__PURE__ */ A("div", { className: "dialog-header", children: [
|
|
2332
2330
|
/* @__PURE__ */ m("h3", { className: "text-text text-xl", children: s }),
|
|
@@ -2359,7 +2357,7 @@ const mn = () => {
|
|
|
2359
2357
|
onCancel: i,
|
|
2360
2358
|
isLoading: r = !1,
|
|
2361
2359
|
disabled: c = !1,
|
|
2362
|
-
primaryType:
|
|
2360
|
+
primaryType: a = "submit",
|
|
2363
2361
|
containerClassName: d = "",
|
|
2364
2362
|
primaryClassName: h = "",
|
|
2365
2363
|
alignEnd: g = !1,
|
|
@@ -2376,12 +2374,12 @@ const mn = () => {
|
|
|
2376
2374
|
/* @__PURE__ */ A(
|
|
2377
2375
|
xe,
|
|
2378
2376
|
{
|
|
2379
|
-
type:
|
|
2377
|
+
type: a,
|
|
2380
2378
|
color: "primary",
|
|
2381
2379
|
variant: "submit",
|
|
2382
2380
|
className: h,
|
|
2383
2381
|
disabled: c,
|
|
2384
|
-
onClick:
|
|
2382
|
+
onClick: a === "button" ? n : void 0,
|
|
2385
2383
|
name: y,
|
|
2386
2384
|
"aria-label": f,
|
|
2387
2385
|
children: [
|
|
@@ -2406,13 +2404,13 @@ const mn = () => {
|
|
|
2406
2404
|
}
|
|
2407
2405
|
);
|
|
2408
2406
|
}, bn = (e) => {
|
|
2409
|
-
const { t } =
|
|
2407
|
+
const { t } = T(), {
|
|
2410
2408
|
children: s,
|
|
2411
2409
|
handleSubmit: n,
|
|
2412
2410
|
onSubmit: i,
|
|
2413
2411
|
handleClose: r,
|
|
2414
2412
|
isLoading: c = !1,
|
|
2415
|
-
buttonEnd:
|
|
2413
|
+
buttonEnd: a = !0,
|
|
2416
2414
|
...d
|
|
2417
2415
|
} = e;
|
|
2418
2416
|
return /* @__PURE__ */ m(lt, { ...d, handleClose: r, children: /* @__PURE__ */ A("form", { onSubmit: n(i), children: [
|
|
@@ -2427,7 +2425,7 @@ const mn = () => {
|
|
|
2427
2425
|
isLoading: c,
|
|
2428
2426
|
disabled: c,
|
|
2429
2427
|
primaryClassName: "!px-6",
|
|
2430
|
-
alignEnd:
|
|
2428
|
+
alignEnd: a,
|
|
2431
2429
|
primaryName: t("_accessibility:buttons.submit"),
|
|
2432
2430
|
primaryAriaLabel: t("_accessibility:ariaLabels.submit"),
|
|
2433
2431
|
cancelName: t("_accessibility:buttons.cancel"),
|
|
@@ -2436,7 +2434,7 @@ const mn = () => {
|
|
|
2436
2434
|
)
|
|
2437
2435
|
] }) });
|
|
2438
2436
|
}, pn = (e) => {
|
|
2439
|
-
const { t } =
|
|
2437
|
+
const { t } = T(), {
|
|
2440
2438
|
children: s,
|
|
2441
2439
|
handleSubmit: n,
|
|
2442
2440
|
handleClose: i,
|
|
@@ -2465,11 +2463,11 @@ const mn = () => {
|
|
|
2465
2463
|
] });
|
|
2466
2464
|
};
|
|
2467
2465
|
function Er(e) {
|
|
2468
|
-
const { message: t, className: s = "" } = e, { t: n } =
|
|
2466
|
+
const { message: t, className: s = "" } = e, { t: n } = T();
|
|
2469
2467
|
return t ? /* @__PURE__ */ m("p", { className: `text-red-600 text-sm mt-2 ${s}`, children: t || n("_messages:errors.parseFile", { defaultValue: "Failed to process file" }) }) : null;
|
|
2470
2468
|
}
|
|
2471
2469
|
function $r(e) {
|
|
2472
|
-
const { message: t, className: s = "" } = e, { t: n } =
|
|
2470
|
+
const { message: t, className: s = "" } = e, { t: n } = T();
|
|
2473
2471
|
return /* @__PURE__ */ A(
|
|
2474
2472
|
"div",
|
|
2475
2473
|
{
|
|
@@ -2484,7 +2482,7 @@ function $r(e) {
|
|
|
2484
2482
|
);
|
|
2485
2483
|
}
|
|
2486
2484
|
function Fr(e) {
|
|
2487
|
-
const { items: t, max: s = 5, className: n = "" } = e, { t: i } =
|
|
2485
|
+
const { items: t, max: s = 5, className: n = "" } = e, { t: i } = T();
|
|
2488
2486
|
if (!t || t.length === 0) return null;
|
|
2489
2487
|
const r = t.slice(0, s);
|
|
2490
2488
|
return /* @__PURE__ */ A("div", { className: `mt-4 ${n}`, children: [
|
|
@@ -2496,61 +2494,63 @@ function Fr(e) {
|
|
|
2496
2494
|
] });
|
|
2497
2495
|
}
|
|
2498
2496
|
const wn = (e) => {
|
|
2499
|
-
const { t } =
|
|
2497
|
+
const { t } = T(), [s, n] = H(null), [i, r] = H(null), [c, a] = H(null), [d, h] = H(!1), [g, y] = H(!1), {
|
|
2500
2498
|
children: f,
|
|
2501
2499
|
handleSubmit: w,
|
|
2502
2500
|
handleClose: C,
|
|
2503
2501
|
isLoading: x = !1,
|
|
2504
|
-
fileProcessor:
|
|
2505
|
-
onFileProcessed:
|
|
2502
|
+
fileProcessor: q,
|
|
2503
|
+
onFileProcessed: ae,
|
|
2506
2504
|
onOverrideChange: k,
|
|
2507
|
-
open:
|
|
2508
|
-
...
|
|
2509
|
-
} = e;
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
}, [
|
|
2515
|
-
|
|
2516
|
-
}, [
|
|
2517
|
-
const
|
|
2518
|
-
var
|
|
2519
|
-
if (
|
|
2505
|
+
open: z,
|
|
2506
|
+
...D
|
|
2507
|
+
} = e, [$, G] = H(0), V = Re(ae), le = Re(q);
|
|
2508
|
+
Z(() => {
|
|
2509
|
+
V.current = ae;
|
|
2510
|
+
}, [ae]), Z(() => {
|
|
2511
|
+
le.current = q;
|
|
2512
|
+
}, [q]), Z(() => {
|
|
2513
|
+
z || (n(null), r(null), a(null), h(!1), y(!1), G((M) => M + 1));
|
|
2514
|
+
}, [z]);
|
|
2515
|
+
const B = F(async () => {
|
|
2516
|
+
var M;
|
|
2517
|
+
if (le.current && s) {
|
|
2520
2518
|
h(!0);
|
|
2521
2519
|
try {
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2520
|
+
const I = await le.current(s, {
|
|
2521
|
+
override: g
|
|
2522
|
+
});
|
|
2523
|
+
r(I ?? []), a(null), (M = V.current) == null || M.call(V, I ?? []);
|
|
2524
|
+
} catch (I) {
|
|
2525
|
+
console.error(I), r(null);
|
|
2526
|
+
const N = I instanceof Error ? I.message : "Failed to parse file";
|
|
2527
|
+
a(N);
|
|
2528
2528
|
}
|
|
2529
2529
|
h(!1);
|
|
2530
2530
|
}
|
|
2531
|
-
}, [s,
|
|
2532
|
-
return
|
|
2533
|
-
|
|
2534
|
-
}, [
|
|
2531
|
+
}, [s, g]);
|
|
2532
|
+
return Z(() => {
|
|
2533
|
+
B();
|
|
2534
|
+
}, [B]), /* @__PURE__ */ A(lt, { ...D, open: z, handleClose: C, children: [
|
|
2535
2535
|
/* @__PURE__ */ m(
|
|
2536
2536
|
Ss,
|
|
2537
2537
|
{
|
|
2538
2538
|
onClear: () => {
|
|
2539
|
-
var
|
|
2540
|
-
n(null), r(null),
|
|
2539
|
+
var M;
|
|
2540
|
+
n(null), r(null), a(null), h(!1), (M = V.current) == null || M.call(V, []);
|
|
2541
2541
|
},
|
|
2542
|
-
onChange: (
|
|
2543
|
-
var
|
|
2544
|
-
const
|
|
2545
|
-
if (!
|
|
2546
|
-
n(null), r(null),
|
|
2542
|
+
onChange: (M) => {
|
|
2543
|
+
var N, E;
|
|
2544
|
+
const I = (N = M.target.files) == null ? void 0 : N[0];
|
|
2545
|
+
if (!I) {
|
|
2546
|
+
n(null), r(null), a(null), h(!1), (E = V.current) == null || E.call(V, []);
|
|
2547
2547
|
return;
|
|
2548
2548
|
}
|
|
2549
|
-
n(
|
|
2549
|
+
n(I);
|
|
2550
2550
|
},
|
|
2551
2551
|
label: t("_accessibility:labels.file")
|
|
2552
2552
|
},
|
|
2553
|
-
|
|
2553
|
+
$
|
|
2554
2554
|
),
|
|
2555
2555
|
/* @__PURE__ */ A("label", { className: "mt-3 flex items-center gap-2 text-sm", children: [
|
|
2556
2556
|
/* @__PURE__ */ m(
|
|
@@ -2558,9 +2558,9 @@ const wn = (e) => {
|
|
|
2558
2558
|
{
|
|
2559
2559
|
type: "checkbox",
|
|
2560
2560
|
checked: g,
|
|
2561
|
-
onChange: (
|
|
2562
|
-
const
|
|
2563
|
-
y(
|
|
2561
|
+
onChange: (M) => {
|
|
2562
|
+
const I = M.target.checked;
|
|
2563
|
+
y(I), k == null || k(I);
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
2566
|
),
|
|
@@ -2578,11 +2578,10 @@ const wn = (e) => {
|
|
|
2578
2578
|
primaryText: t("_accessibility:buttons.ok"),
|
|
2579
2579
|
cancelText: t("_accessibility:buttons.cancel"),
|
|
2580
2580
|
onPrimaryClick: () => {
|
|
2581
|
-
(!
|
|
2581
|
+
(!q || !!i && i.length > 0) && w();
|
|
2582
2582
|
},
|
|
2583
2583
|
onCancel: C,
|
|
2584
2584
|
isLoading: x,
|
|
2585
|
-
disabled: !!x || !!d || !!R && (!i || i.length === 0),
|
|
2586
2585
|
primaryType: "button",
|
|
2587
2586
|
containerClassName: "mt-5",
|
|
2588
2587
|
primaryName: t("_accessibility:buttons.ok"),
|
|
@@ -2594,16 +2593,16 @@ const wn = (e) => {
|
|
|
2594
2593
|
] });
|
|
2595
2594
|
};
|
|
2596
2595
|
function vn(e) {
|
|
2597
|
-
const { t } =
|
|
2596
|
+
const { t } = T(), { open: s, onClose: n, menuMap: i, logo: r } = e, { account: c } = Jt(), { linkComponent: a } = ze(), d = a, h = Ve(() => i.filter((y) => {
|
|
2598
2597
|
const f = y.auth, w = !!(c != null && c.email);
|
|
2599
2598
|
return f == null || f && w || !f && !w;
|
|
2600
|
-
}), [c]), g =
|
|
2599
|
+
}), [c]), g = F(
|
|
2601
2600
|
(y) => {
|
|
2602
2601
|
y.key === "Escape" && s && n();
|
|
2603
2602
|
},
|
|
2604
2603
|
[n, s]
|
|
2605
2604
|
);
|
|
2606
|
-
return
|
|
2605
|
+
return Z(() => (document.addEventListener("keydown", g), () => {
|
|
2607
2606
|
document.removeEventListener("keydown", g);
|
|
2608
2607
|
}), [g]), /* @__PURE__ */ m(
|
|
2609
2608
|
"div",
|
|
@@ -2648,14 +2647,14 @@ function vn(e) {
|
|
|
2648
2647
|
);
|
|
2649
2648
|
}
|
|
2650
2649
|
function xn(e) {
|
|
2651
|
-
const { error: t } = e, { t: s } =
|
|
2650
|
+
const { error: t } = e, { t: s } = T();
|
|
2652
2651
|
return /* @__PURE__ */ A("div", { className: "flex flex-col items-center justify-center pt-10 gap-5", children: [
|
|
2653
2652
|
/* @__PURE__ */ m(ce, { icon: Ks, className: "text-red-300 text-4xl" }),
|
|
2654
2653
|
/* @__PURE__ */ m("p", { className: "text-text text-center", children: (t == null ? void 0 : t.message) ?? s("_accessibility:errors.unknownError") })
|
|
2655
2654
|
] });
|
|
2656
2655
|
}
|
|
2657
2656
|
const Tr = (e) => {
|
|
2658
|
-
const { showBackButton: t, title: s, actions: n } = e, { t: i } =
|
|
2657
|
+
const { showBackButton: t, title: s, actions: n } = e, { t: i } = T(), { navigate: r } = ze();
|
|
2659
2658
|
return /* @__PURE__ */ A("div", { className: "page-header", children: [
|
|
2660
2659
|
/* @__PURE__ */ A("div", { className: "flex gap-2 items-center justify-start", children: [
|
|
2661
2660
|
t && /* @__PURE__ */ m(
|
|
@@ -2683,10 +2682,10 @@ const Tr = (e) => {
|
|
|
2683
2682
|
filterOptions: i,
|
|
2684
2683
|
actions: r,
|
|
2685
2684
|
queryKey: c,
|
|
2686
|
-
isLoading:
|
|
2685
|
+
isLoading: a = !1,
|
|
2687
2686
|
isAnimated: d = !0,
|
|
2688
2687
|
showBackButton: h = !1
|
|
2689
|
-
} = e, { t: g } =
|
|
2688
|
+
} = e, { t: g } = T(), { countOfFilters: y } = ks(), f = Ve(() => {
|
|
2690
2689
|
const w = Array.isArray(r) ? [...r] : [];
|
|
2691
2690
|
if (c) {
|
|
2692
2691
|
const C = {
|
|
@@ -2736,7 +2735,7 @@ const Tr = (e) => {
|
|
|
2736
2735
|
"div",
|
|
2737
2736
|
{
|
|
2738
2737
|
className: `px-5 py-3 h-useConfigfull ${d ? "appear" : ""}`,
|
|
2739
|
-
children:
|
|
2738
|
+
children: a ? /* @__PURE__ */ m(De, { className: "flex justify-center items-center h-50" }) : s
|
|
2740
2739
|
}
|
|
2741
2740
|
)
|
|
2742
2741
|
] }),
|
|
@@ -2755,17 +2754,17 @@ const Tr = (e) => {
|
|
|
2755
2754
|
)
|
|
2756
2755
|
] });
|
|
2757
2756
|
}, Cn = (e) => {
|
|
2758
|
-
const { t } =
|
|
2757
|
+
const { t } = T(), {
|
|
2759
2758
|
loading: s = !1,
|
|
2760
2759
|
emptyComponent: n = null,
|
|
2761
2760
|
emptyMessage: i = t("_accessibility:messages.empty"),
|
|
2762
2761
|
renderComponent: r,
|
|
2763
2762
|
data: c = []
|
|
2764
2763
|
} = e;
|
|
2765
|
-
return /* @__PURE__ */ m(Le, { children: c != null && c.length ? /* @__PURE__ */ m("ul", { className: "pretty-grid-main", children: c == null ? void 0 : c.map((
|
|
2764
|
+
return /* @__PURE__ */ m(Le, { children: c != null && c.length ? /* @__PURE__ */ m("ul", { className: "pretty-grid-main", children: c == null ? void 0 : c.map((a) => /* @__PURE__ */ m("li", { className: "pretty-grid-item", children: r(a) }, a.id)) }) : /* @__PURE__ */ m(Le, { children: n || /* @__PURE__ */ m(Or, { message: i }) }) });
|
|
2766
2765
|
}, Lr = () => {
|
|
2767
|
-
const [e, t] =
|
|
2768
|
-
return
|
|
2766
|
+
const [e, t] = H(St());
|
|
2767
|
+
return Z(() => {
|
|
2769
2768
|
const s = setInterval(() => {
|
|
2770
2769
|
t(St());
|
|
2771
2770
|
}, 1e3);
|
|
@@ -2773,16 +2772,16 @@ const Tr = (e) => {
|
|
|
2773
2772
|
}, []), /* @__PURE__ */ m("p", { className: "capitalize max-xs:hidden", children: e });
|
|
2774
2773
|
};
|
|
2775
2774
|
function Sn(e) {
|
|
2776
|
-
const { t } =
|
|
2775
|
+
const { t } = T(), { openDrawer: s } = e, { searchComponent: n } = ze(), [i, r] = H(!1), c = F((d) => {
|
|
2777
2776
|
(Xs() ? d.metaKey : d.ctrlKey) && d.shiftKey && d.key.toLowerCase() === "f" && (r(!0), d.preventDefault());
|
|
2778
2777
|
}, []);
|
|
2779
|
-
|
|
2778
|
+
Z(() => (window.addEventListener("keydown", c), () => {
|
|
2780
2779
|
window.removeEventListener("keydown", c);
|
|
2781
2780
|
}), [c]);
|
|
2782
|
-
const
|
|
2781
|
+
const a = n;
|
|
2783
2782
|
return /* @__PURE__ */ A(Le, { children: [
|
|
2784
|
-
location.pathname !== "/" && !!
|
|
2785
|
-
|
|
2783
|
+
location.pathname !== "/" && !!a && /* @__PURE__ */ m(
|
|
2784
|
+
a,
|
|
2786
2785
|
{
|
|
2787
2786
|
open: i,
|
|
2788
2787
|
onClose: () => r(!1)
|
|
@@ -2818,7 +2817,7 @@ function Sn(e) {
|
|
|
2818
2817
|
] });
|
|
2819
2818
|
}
|
|
2820
2819
|
function kn() {
|
|
2821
|
-
const { t: e } =
|
|
2820
|
+
const { t: e } = T(), { notification: t, removeNotification: s } = ke(), [n, i] = H(/* @__PURE__ */ new Set()), r = F(
|
|
2822
2821
|
(g) => {
|
|
2823
2822
|
if (g === void 0) {
|
|
2824
2823
|
const y = new Set(t.map((f, w) => w));
|
|
@@ -2827,39 +2826,39 @@ function kn() {
|
|
|
2827
2826
|
i((y) => new Set(y).add(g)), window.setTimeout(() => s(g), 300);
|
|
2828
2827
|
},
|
|
2829
2828
|
[t, s]
|
|
2830
|
-
), c =
|
|
2829
|
+
), c = F((g) => {
|
|
2831
2830
|
switch (g) {
|
|
2832
|
-
case
|
|
2831
|
+
case j.error:
|
|
2833
2832
|
return qs;
|
|
2834
2833
|
default:
|
|
2835
2834
|
return Rs;
|
|
2836
2835
|
}
|
|
2837
|
-
}, []),
|
|
2836
|
+
}, []), a = F((g) => {
|
|
2838
2837
|
switch (g) {
|
|
2839
|
-
case
|
|
2838
|
+
case j.success:
|
|
2840
2839
|
return "!text-success";
|
|
2841
|
-
case
|
|
2840
|
+
case j.error:
|
|
2842
2841
|
return "!text-error";
|
|
2843
|
-
case
|
|
2842
|
+
case j.warning:
|
|
2844
2843
|
return "!text-warning";
|
|
2845
2844
|
default:
|
|
2846
2845
|
return "!text-info";
|
|
2847
2846
|
}
|
|
2848
|
-
}, []), d =
|
|
2847
|
+
}, []), d = F((g) => {
|
|
2849
2848
|
switch (g) {
|
|
2850
|
-
case
|
|
2849
|
+
case j.success:
|
|
2851
2850
|
return "bg-bg-success";
|
|
2852
|
-
case
|
|
2851
|
+
case j.error:
|
|
2853
2852
|
return "bg-bg-error";
|
|
2854
|
-
case
|
|
2853
|
+
case j.warning:
|
|
2855
2854
|
return "bg-bg-warning";
|
|
2856
2855
|
default:
|
|
2857
2856
|
return "bg-bg-info";
|
|
2858
2857
|
}
|
|
2859
|
-
}, []), h =
|
|
2860
|
-
return
|
|
2858
|
+
}, []), h = Re();
|
|
2859
|
+
return Z(() => {
|
|
2861
2860
|
h.current = () => r();
|
|
2862
|
-
}, [r]),
|
|
2861
|
+
}, [r]), Z(() => {
|
|
2863
2862
|
if (!(t != null && t.length)) return;
|
|
2864
2863
|
const g = (y) => {
|
|
2865
2864
|
var f;
|
|
@@ -2868,7 +2867,7 @@ function kn() {
|
|
|
2868
2867
|
return window.addEventListener("click", g), () => {
|
|
2869
2868
|
window.removeEventListener("click", g);
|
|
2870
2869
|
};
|
|
2871
|
-
}, [t == null ? void 0 : t.length]),
|
|
2870
|
+
}, [t == null ? void 0 : t.length]), Z(() => {
|
|
2872
2871
|
i(/* @__PURE__ */ new Set());
|
|
2873
2872
|
}, [t]), qt(
|
|
2874
2873
|
/* @__PURE__ */ m(
|
|
@@ -2879,7 +2878,7 @@ function kn() {
|
|
|
2879
2878
|
"div",
|
|
2880
2879
|
{
|
|
2881
2880
|
className: `notification ${n.has(w) ? "closing" : ""} ${d(
|
|
2882
|
-
y ??
|
|
2881
|
+
y ?? j.error
|
|
2883
2882
|
)}`,
|
|
2884
2883
|
onClick: (C) => C.stopPropagation(),
|
|
2885
2884
|
children: [
|
|
@@ -2887,15 +2886,15 @@ function kn() {
|
|
|
2887
2886
|
/* @__PURE__ */ m(
|
|
2888
2887
|
ce,
|
|
2889
2888
|
{
|
|
2890
|
-
icon: c(y ??
|
|
2891
|
-
className: `${
|
|
2889
|
+
icon: c(y ?? j.error),
|
|
2890
|
+
className: `${a(y ?? j.error)}`
|
|
2892
2891
|
}
|
|
2893
2892
|
),
|
|
2894
2893
|
/* @__PURE__ */ m(
|
|
2895
2894
|
"p",
|
|
2896
2895
|
{
|
|
2897
|
-
className: `whitespace-nowrap ${
|
|
2898
|
-
y ??
|
|
2896
|
+
className: `whitespace-nowrap ${a(
|
|
2897
|
+
y ?? j.error
|
|
2899
2898
|
)}`,
|
|
2900
2899
|
children: f
|
|
2901
2900
|
}
|
|
@@ -2911,8 +2910,8 @@ function kn() {
|
|
|
2911
2910
|
onClick: (C) => {
|
|
2912
2911
|
C.stopPropagation(), r(w);
|
|
2913
2912
|
},
|
|
2914
|
-
iconClassName: `${
|
|
2915
|
-
y ??
|
|
2913
|
+
iconClassName: `${a(
|
|
2914
|
+
y ?? j.error
|
|
2916
2915
|
)} group-hover:!text-red-400 cursor-pointer`,
|
|
2917
2916
|
name: e("_accessibility:buttons.closeNotification"),
|
|
2918
2917
|
"aria-label": e("_accessibility:ariaLabels.closeNotification")
|
|
@@ -2931,7 +2930,7 @@ function Nn() {
|
|
|
2931
2930
|
return /* @__PURE__ */ m("div", { className: "w-screen h-screen flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ m(De, { className: "blur-appear" }) });
|
|
2932
2931
|
}
|
|
2933
2932
|
const Dr = (e) => {
|
|
2934
|
-
const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent: c } =
|
|
2933
|
+
const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent: c } = ze();
|
|
2935
2934
|
return /* @__PURE__ */ m(
|
|
2936
2935
|
c,
|
|
2937
2936
|
{
|
|
@@ -2948,8 +2947,8 @@ const Dr = (e) => {
|
|
|
2948
2947
|
defaultTab: s,
|
|
2949
2948
|
className: n = "",
|
|
2950
2949
|
tabsContainerClassName: i = ""
|
|
2951
|
-
} = e, [r, c] =
|
|
2952
|
-
return
|
|
2950
|
+
} = e, [r, c] = H((d = t[0]) == null ? void 0 : d.id), a = Ve(() => t.find((h) => h.id === r), [t, r]);
|
|
2951
|
+
return Z(() => {
|
|
2953
2952
|
s && c(s);
|
|
2954
2953
|
}, [s]), /* @__PURE__ */ A("div", { className: `tabs-layout-main ${n}`, children: [
|
|
2955
2954
|
/* @__PURE__ */ m(
|
|
@@ -2969,7 +2968,7 @@ const Dr = (e) => {
|
|
|
2969
2968
|
) }, h))
|
|
2970
2969
|
}
|
|
2971
2970
|
),
|
|
2972
|
-
|
|
2971
|
+
a == null ? void 0 : a.content
|
|
2973
2972
|
] });
|
|
2974
2973
|
}, Pr = (e) => {
|
|
2975
2974
|
const {
|
|
@@ -2978,11 +2977,11 @@ const Dr = (e) => {
|
|
|
2978
2977
|
image: n = "",
|
|
2979
2978
|
alt: i = "",
|
|
2980
2979
|
final: r = !1
|
|
2981
|
-
} = e, { setGuestMode: c } = Jt(), { t:
|
|
2980
|
+
} = e, { setGuestMode: c } = Jt(), { t: a } = T();
|
|
2982
2981
|
return /* @__PURE__ */ A("div", { className: "big-appear w-md flex flex-col gap-20", children: [
|
|
2983
2982
|
/* @__PURE__ */ m("img", { src: n, alt: i }),
|
|
2984
|
-
/* @__PURE__ */ m("h2", { className: "text-5xl text-center leading-16", children:
|
|
2985
|
-
/* @__PURE__ */ m("p", { className: "text-center !text-lg", children:
|
|
2983
|
+
/* @__PURE__ */ m("h2", { className: "text-5xl text-center leading-16", children: a(`_pages:onboarding.${t}.title`) }),
|
|
2984
|
+
/* @__PURE__ */ m("p", { className: "text-center !text-lg", children: a(`_pages:onboarding.${t}.body`) }),
|
|
2986
2985
|
/* @__PURE__ */ m("div", { className: "flex gap-5 items-center justify-center", children: r ? /* @__PURE__ */ A(Le, { children: [
|
|
2987
2986
|
/* @__PURE__ */ m(
|
|
2988
2987
|
xe,
|
|
@@ -2993,8 +2992,8 @@ const Dr = (e) => {
|
|
|
2993
2992
|
onClick: () => {
|
|
2994
2993
|
c(!0), window.location.href = "/";
|
|
2995
2994
|
},
|
|
2996
|
-
"aria-label":
|
|
2997
|
-
children:
|
|
2995
|
+
"aria-label": a("_accessibility:ariaLabels.start"),
|
|
2996
|
+
children: a("_accessibility:buttons.startAsGuest")
|
|
2998
2997
|
}
|
|
2999
2998
|
),
|
|
3000
2999
|
/* @__PURE__ */ m(
|
|
@@ -3003,9 +3002,9 @@ const Dr = (e) => {
|
|
|
3003
3002
|
color: "primary",
|
|
3004
3003
|
variant: "submit",
|
|
3005
3004
|
className: "!px-8",
|
|
3006
|
-
"aria-label":
|
|
3005
|
+
"aria-label": a("_accessibility:ariaLabels.start"),
|
|
3007
3006
|
onClick: () => window.location.href = "/auth/sign-in",
|
|
3008
|
-
children:
|
|
3007
|
+
children: a("_accessibility:buttons.signIn")
|
|
3009
3008
|
}
|
|
3010
3009
|
)
|
|
3011
3010
|
] }) : /* @__PURE__ */ A(Le, { children: [
|
|
@@ -3016,8 +3015,8 @@ const Dr = (e) => {
|
|
|
3016
3015
|
className: "!px-8",
|
|
3017
3016
|
variant: "outlined",
|
|
3018
3017
|
onClick: () => window.location.href = "/auth/sign-in",
|
|
3019
|
-
"aria-label":
|
|
3020
|
-
children:
|
|
3018
|
+
"aria-label": a("_accessibility:ariaLabels.skip"),
|
|
3019
|
+
children: a("_accessibility:buttons.skip")
|
|
3021
3020
|
}
|
|
3022
3021
|
),
|
|
3023
3022
|
/* @__PURE__ */ m(
|
|
@@ -3027,14 +3026,14 @@ const Dr = (e) => {
|
|
|
3027
3026
|
className: "!px-8",
|
|
3028
3027
|
variant: "outlined",
|
|
3029
3028
|
onClick: () => s(),
|
|
3030
|
-
"aria-label":
|
|
3031
|
-
children:
|
|
3029
|
+
"aria-label": a("_accessibility:ariaLabels.next"),
|
|
3030
|
+
children: a("_accessibility:buttons.next")
|
|
3032
3031
|
}
|
|
3033
3032
|
)
|
|
3034
3033
|
] }) })
|
|
3035
3034
|
] });
|
|
3036
3035
|
}, An = (e) => {
|
|
3037
|
-
const { steps: t } = e, [s, n] =
|
|
3036
|
+
const { steps: t } = e, [s, n] = H(1), i = Ve(() => t.map((r, c) => ({
|
|
3038
3037
|
id: c + 1,
|
|
3039
3038
|
label: "",
|
|
3040
3039
|
content: /* @__PURE__ */ m(
|
|
@@ -3087,7 +3086,7 @@ export {
|
|
|
3087
3086
|
re as Methods,
|
|
3088
3087
|
Sn as Navbar,
|
|
3089
3088
|
kn as Notification,
|
|
3090
|
-
|
|
3089
|
+
j as NotificationEnumType,
|
|
3091
3090
|
tn as NotificationProvider,
|
|
3092
3091
|
An as Onboarding,
|
|
3093
3092
|
_n as Page,
|
|
@@ -3104,9 +3103,9 @@ export {
|
|
|
3104
3103
|
Zr as formatForDatetimeLocal,
|
|
3105
3104
|
Kt as fromLocal,
|
|
3106
3105
|
St as getFormattedDateTime,
|
|
3107
|
-
|
|
3106
|
+
We as isHttpError,
|
|
3108
3107
|
Xs as isMac,
|
|
3109
|
-
|
|
3108
|
+
Ke as isValidationError,
|
|
3110
3109
|
Ae as makeRequest,
|
|
3111
3110
|
en as mapValidationErrors,
|
|
3112
3111
|
Ht as parseQueries,
|
|
@@ -3114,12 +3113,12 @@ export {
|
|
|
3114
3113
|
Ct as removeFromLocal,
|
|
3115
3114
|
_t as toLocal,
|
|
3116
3115
|
Jt as useAuth,
|
|
3117
|
-
|
|
3116
|
+
ze as useConfig,
|
|
3118
3117
|
Xt as useConfirmationForm,
|
|
3119
3118
|
_r as useDeleteAction,
|
|
3120
3119
|
cn as useDeleteDialog,
|
|
3121
|
-
|
|
3122
|
-
|
|
3120
|
+
os as useDialog,
|
|
3121
|
+
on as useEditAction,
|
|
3123
3122
|
Sr as useExportAction,
|
|
3124
3123
|
fn as useExportActionMutate,
|
|
3125
3124
|
ln as useFormDialog,
|
|
@@ -3127,7 +3126,7 @@ export {
|
|
|
3127
3126
|
dn as useImportDialog,
|
|
3128
3127
|
Zs as useManager,
|
|
3129
3128
|
ke as useNotification,
|
|
3130
|
-
|
|
3129
|
+
an as usePostForm,
|
|
3131
3130
|
Cr as useRestoreAction,
|
|
3132
3131
|
un as useRestoreDialog,
|
|
3133
3132
|
Nr as useScrollTrigger,
|