@sito/dashboard-app 0.0.39 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Actions/types.d.ts +3 -0
- package/dist/components/Dialog/DialogActions.d.ts +1 -17
- package/dist/components/Dialog/FormDialog.d.ts +1 -1
- package/dist/components/Dialog/FormDialog.stories.d.ts +1 -1
- package/dist/components/Dialog/ImportDialog/Error.d.ts +1 -1
- package/dist/components/Dialog/types.d.ts +17 -1
- package/dist/components/Empty/types.d.ts +3 -2
- package/dist/components/Error/types.d.ts +2 -2
- package/dist/components/Form/FormContainer.d.ts +1 -1
- package/dist/components/Form/types.d.ts +2 -4
- package/dist/components/Loading/SplashScreen.d.ts +2 -1
- package/dist/components/Loading/types.d.ts +1 -1
- package/dist/dashboard-app.cjs +1 -1
- package/dist/dashboard-app.js +1601 -1552
- package/dist/hooks/actions/PrefabActions.stories.d.ts +12 -0
- package/dist/hooks/dialogs/types.d.ts +2 -2
- package/dist/hooks/dialogs/useFormDialog.d.ts +1 -2
- package/dist/hooks/forms/usePostForm.d.ts +1 -2
- package/dist/main.css +1 -1
- package/dist/providers/types.d.ts +1 -1
- package/package.json +3 -3
package/dist/dashboard-app.js
CHANGED
|
@@ -1,129 +1,138 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var me = (e, t, s) =>
|
|
1
|
+
var Cs = Object.defineProperty;
|
|
2
|
+
var Es = (e, t, s) => t in e ? Cs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var me = (e, t, s) => Es(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
4
|
import "./main.css";
|
|
5
|
-
import { IconButton as
|
|
5
|
+
import { IconButton as Ns, useTranslation as D, Dropdown as ks, State as As, inputStateClassName as xs, labelStateClassName as Ts, helperTextStateClassName as $s, Button as _e, Loading as xe, TextInput as Fs, FileInput as Ls, useTableOptions as Ds, Badge as Vs } from "@sito/dashboard";
|
|
6
6
|
export * from "@sito/dashboard";
|
|
7
|
-
import { Button as
|
|
8
|
-
import { jsxs as
|
|
7
|
+
import { Button as Bn } from "@sito/dashboard";
|
|
8
|
+
import { jsxs as x, jsx as h, Fragment as Ve } from "react/jsx-runtime";
|
|
9
9
|
import { FontAwesomeIcon as ce } from "@fortawesome/react-fontawesome";
|
|
10
|
-
import ie, { useCallback as
|
|
11
|
-
import { faTrash as
|
|
12
|
-
import { createPortal as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
function Bt(e) {
|
|
10
|
+
import ie, { useCallback as V, useRef as Ie, useReducer as Ut, createContext as Pe, useContext as Oe, useState as J, useMemo as Ae, useEffect as le, forwardRef as qt, useLayoutEffect as Is } from "react";
|
|
11
|
+
import { faTrash as Ps, faRotateLeft as Ht, faPencil as Os, faCircleNotch as Bt, faCloudArrowDown as Ms, faCloudUpload as Rs, faArrowUp as Us, faEllipsisV as qs, faEyeSlash as Hs, faEye as Bs, faClose as Qt, faArrowLeft as Qs, faAdd as St, faFilter as Ks, faBars as js, faSearch as Ws, faCircleCheck as Gs, faWarning as Js } from "@fortawesome/free-solid-svg-icons";
|
|
12
|
+
import { createPortal as Kt } from "react-dom";
|
|
13
|
+
import { QueryClient as zs, QueryClientProvider as Ys, useMutation as Me, useQuery as Xs } from "@tanstack/react-query";
|
|
14
|
+
import { faSadTear as Zs } from "@fortawesome/free-regular-svg-icons";
|
|
15
|
+
function jt(e) {
|
|
17
16
|
const {
|
|
18
17
|
id: t,
|
|
19
18
|
icon: s,
|
|
20
19
|
tooltip: n,
|
|
21
20
|
onClick: i,
|
|
22
21
|
children: r,
|
|
23
|
-
hidden:
|
|
24
|
-
disabled:
|
|
25
|
-
showText:
|
|
26
|
-
showTooltips:
|
|
22
|
+
hidden: a = !1,
|
|
23
|
+
disabled: c = !1,
|
|
24
|
+
showText: l = !1,
|
|
25
|
+
showTooltips: m = !0,
|
|
26
|
+
className: y = ""
|
|
27
27
|
} = e;
|
|
28
|
-
return
|
|
28
|
+
return a ? null : /* @__PURE__ */ x(
|
|
29
29
|
"button",
|
|
30
30
|
{
|
|
31
31
|
id: t,
|
|
32
|
-
className: `action ${
|
|
33
|
-
disabled:
|
|
34
|
-
onClick: () => i(),
|
|
35
|
-
"aria-disabled":
|
|
32
|
+
className: `action ${l ? "text-action" : "icon-action"} ${y}`,
|
|
33
|
+
disabled: c,
|
|
34
|
+
onClick: () => i == null ? void 0 : i(),
|
|
35
|
+
"aria-disabled": c,
|
|
36
36
|
"data-tooltip-id": "tooltip",
|
|
37
|
-
"data-tooltip-content":
|
|
37
|
+
"data-tooltip-content": m ? n : "",
|
|
38
38
|
children: [
|
|
39
39
|
s,
|
|
40
40
|
" ",
|
|
41
|
-
|
|
41
|
+
l && n,
|
|
42
42
|
r
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Wt(e) {
|
|
48
48
|
const {
|
|
49
49
|
actions: t = [],
|
|
50
50
|
className: s = "",
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
itemClassName: n = "",
|
|
52
|
+
actionClassName: i = "",
|
|
53
|
+
showTooltips: r = !0,
|
|
54
|
+
showActionTexts: a = !1
|
|
53
55
|
} = e;
|
|
54
|
-
return /* @__PURE__ */ h("ul", { className: `actions-container ${s}`, children: t
|
|
55
|
-
|
|
56
|
+
return /* @__PURE__ */ h("ul", { className: `actions-container ${s}`, children: t.map((c) => /* @__PURE__ */ h(
|
|
57
|
+
"li",
|
|
56
58
|
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
className: `actions-container-item ${n}`,
|
|
60
|
+
children: /* @__PURE__ */ h(
|
|
61
|
+
jt,
|
|
62
|
+
{
|
|
63
|
+
showTooltips: r,
|
|
64
|
+
showText: a,
|
|
65
|
+
className: i,
|
|
66
|
+
...c
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
},
|
|
70
|
+
c.id
|
|
71
|
+
)) });
|
|
63
72
|
}
|
|
64
|
-
const
|
|
65
|
-
var
|
|
66
|
-
function
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
const e = (
|
|
70
|
-
if (
|
|
71
|
-
if (localStorage.getItem(
|
|
72
|
-
return
|
|
73
|
-
} else if (
|
|
74
|
-
return
|
|
73
|
+
const pe = ({ icon: e, ...t }) => /* @__PURE__ */ h(Ns, { icon: /* @__PURE__ */ h(ce, { icon: e }), ...t });
|
|
74
|
+
var st, Ct;
|
|
75
|
+
function er() {
|
|
76
|
+
if (Ct) return st;
|
|
77
|
+
Ct = 1;
|
|
78
|
+
const e = (c, l = "local", m = void 0) => {
|
|
79
|
+
if (l === "local") {
|
|
80
|
+
if (localStorage.getItem(c) !== void 0 && localStorage.getItem(c) !== "undefined" && localStorage.getItem(c) !== null)
|
|
81
|
+
return m === void 0 || m !== void 0 && localStorage.getItem(c) === m;
|
|
82
|
+
} else if (l === "session" && sessionStorage.getItem(c) !== void 0 && sessionStorage.getItem(c) !== "undefined" && sessionStorage.getItem(c) !== null)
|
|
83
|
+
return m === void 0 || m !== void 0 && sessionStorage.getItem(c) === m;
|
|
75
84
|
return !1;
|
|
76
|
-
}, t = (
|
|
77
|
-
const
|
|
78
|
-
return
|
|
79
|
-
const [g,
|
|
80
|
-
|
|
81
|
-
}),
|
|
82
|
-
}, s = (
|
|
83
|
-
if (r(
|
|
85
|
+
}, t = (c) => {
|
|
86
|
+
const l = {};
|
|
87
|
+
return c.substring(1).split("&").forEach((y) => {
|
|
88
|
+
const [g, f] = y.split("=");
|
|
89
|
+
l[g] = f;
|
|
90
|
+
}), l;
|
|
91
|
+
}, s = (c = "") => {
|
|
92
|
+
if (r(c) && c.length) return r(c);
|
|
84
93
|
{
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
94
|
+
let l = navigator.language || navigator.userLanguage;
|
|
95
|
+
if (l.indexOf("en") < 0 && l.indexOf("es") < 0 && (l = "en-US"), l = l.split("-")[0], l)
|
|
96
|
+
return c.length && i(c, 730, l), l;
|
|
88
97
|
}
|
|
89
98
|
return "en";
|
|
90
|
-
}, n = (
|
|
91
|
-
top:
|
|
92
|
-
left:
|
|
93
|
-
behavior:
|
|
94
|
-
}), i = (
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
const p = "; expires=" +
|
|
98
|
-
document.cookie = `${
|
|
99
|
-
}, r = (
|
|
100
|
-
const
|
|
101
|
-
for (let g = 0; g <
|
|
102
|
-
let
|
|
103
|
-
for (;
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
return
|
|
99
|
+
}, n = (c = 0, l = 0, m = window, y = "smooth") => m.scroll({
|
|
100
|
+
top: c,
|
|
101
|
+
left: l,
|
|
102
|
+
behavior: y
|
|
103
|
+
}), i = (c, l, m, y = "/", g = "Lax") => {
|
|
104
|
+
var f = /* @__PURE__ */ new Date();
|
|
105
|
+
f.setTime(f.getTime() + l * 24 * 60 * 60 * 1e3);
|
|
106
|
+
const p = "; expires=" + f.toUTCString();
|
|
107
|
+
document.cookie = `${c}=${m || ""}${p};path=${y};SameSite=${g}`;
|
|
108
|
+
}, r = (c) => {
|
|
109
|
+
const l = `${c}=`, y = decodeURIComponent(document.cookie).split(";");
|
|
110
|
+
for (let g = 0; g < y.length; g += 1) {
|
|
111
|
+
let f = y[g];
|
|
112
|
+
for (; f.charAt(0) === " "; )
|
|
113
|
+
f = f.substring(1);
|
|
114
|
+
if (f.indexOf(l) === 0)
|
|
115
|
+
return f.substring(l.length, f.length);
|
|
107
116
|
}
|
|
108
117
|
return "";
|
|
109
118
|
};
|
|
110
|
-
return
|
|
119
|
+
return st = {
|
|
111
120
|
getCookie: r,
|
|
112
121
|
createCookie: i,
|
|
113
|
-
deleteCookie: (
|
|
122
|
+
deleteCookie: (c) => document.cookie = `${c}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
|
|
114
123
|
getUserLanguage: s,
|
|
115
124
|
scrollTo: n,
|
|
116
125
|
parseQueries: t,
|
|
117
126
|
validation: e
|
|
118
|
-
},
|
|
127
|
+
}, st;
|
|
119
128
|
}
|
|
120
|
-
var
|
|
121
|
-
function
|
|
122
|
-
const { t: e, language: t } =
|
|
123
|
-
return { timeAge:
|
|
129
|
+
var tr = er();
|
|
130
|
+
function on() {
|
|
131
|
+
const { t: e, language: t } = D();
|
|
132
|
+
return { timeAge: V(
|
|
124
133
|
(n) => {
|
|
125
|
-
const r = /* @__PURE__ */ new Date() - n,
|
|
126
|
-
return r < 1e3 * 60 ?
|
|
134
|
+
const r = /* @__PURE__ */ new Date() - n, a = Math.floor(r / (1e3 * 60)), c = Math.floor(a / 60), l = t === "es", m = e("_accessibility:labels.ago"), y = e("_accessibility:labels.minute"), g = e("_accessibility:labels.minutes"), f = e("_accessibility:labels.hour"), p = e("_accessibility:labels.hours"), _ = e("_accessibility:labels.yesterday"), C = e("_accessibility:labels.justNow");
|
|
135
|
+
return r < 1e3 * 60 ? C : a < 60 ? `${l ? m : ""} ${a} ${a === 1 ? y : g} ${l ? "" : m}` : c < 24 ? `${l ? m : ""} ${c} ${c === 1 ? f : p} ${l ? "" : m}` : c < 48 ? _ : n.toLocaleDateString(navigator.language || "es-ES", {
|
|
127
136
|
day: "2-digit",
|
|
128
137
|
month: "2-digit",
|
|
129
138
|
year: "numeric"
|
|
@@ -132,8 +141,8 @@ function Zr() {
|
|
|
132
141
|
[e, t]
|
|
133
142
|
) };
|
|
134
143
|
}
|
|
135
|
-
var
|
|
136
|
-
async function
|
|
144
|
+
var z = /* @__PURE__ */ ((e) => (e[e.success = 0] = "success", e[e.error = 1] = "error", e[e.warning = 2] = "warning", e[e.info = 3] = "info", e))(z || {}), te = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.PATCH = "PATCH", e.DELETE = "DELETE", e))(te || {});
|
|
145
|
+
async function Te(e, t = "GET", s, n) {
|
|
137
146
|
const i = {
|
|
138
147
|
...s ? { "Content-Type": "application/json" } : {},
|
|
139
148
|
...n
|
|
@@ -143,26 +152,26 @@ async function Ee(e, t = "GET", s, n) {
|
|
|
143
152
|
method: t,
|
|
144
153
|
headers: i,
|
|
145
154
|
...s ? { body: JSON.stringify(s) } : {}
|
|
146
|
-
}),
|
|
147
|
-
let
|
|
155
|
+
}), a = await r.text();
|
|
156
|
+
let c = null;
|
|
148
157
|
try {
|
|
149
|
-
|
|
158
|
+
c = a ? JSON.parse(a) : null;
|
|
150
159
|
} catch {
|
|
151
|
-
|
|
160
|
+
c = null;
|
|
152
161
|
}
|
|
153
162
|
if (!r.ok) {
|
|
154
|
-
const
|
|
163
|
+
const l = typeof c == "object" && c !== null ? c.message ?? c.error ?? a : a || r.statusText;
|
|
155
164
|
return {
|
|
156
165
|
data: null,
|
|
157
166
|
status: r.status,
|
|
158
167
|
error: {
|
|
159
168
|
status: r.status,
|
|
160
|
-
message:
|
|
169
|
+
message: l || "Unknown error occurred"
|
|
161
170
|
}
|
|
162
171
|
};
|
|
163
172
|
}
|
|
164
173
|
return {
|
|
165
|
-
data: r.status !== 204 &&
|
|
174
|
+
data: r.status !== 204 && c !== null ? c : null,
|
|
166
175
|
status: r.status,
|
|
167
176
|
error: null
|
|
168
177
|
};
|
|
@@ -177,7 +186,7 @@ async function Ee(e, t = "GET", s, n) {
|
|
|
177
186
|
};
|
|
178
187
|
}
|
|
179
188
|
}
|
|
180
|
-
function
|
|
189
|
+
function sr(e, t) {
|
|
181
190
|
if (t) {
|
|
182
191
|
const s = Object.entries(t).filter(([, n]) => n != null).map(
|
|
183
192
|
([n, i]) => `${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`
|
|
@@ -186,34 +195,34 @@ function Xs(e, t) {
|
|
|
186
195
|
}
|
|
187
196
|
return e;
|
|
188
197
|
}
|
|
189
|
-
const
|
|
198
|
+
const Gt = (e, t, s) => {
|
|
190
199
|
const n = [];
|
|
191
200
|
if (t) {
|
|
192
|
-
const { sortingBy: i, sortingOrder: r, currentPage:
|
|
201
|
+
const { sortingBy: i, sortingOrder: r, currentPage: a, pageSize: c } = t;
|
|
193
202
|
n.push(
|
|
194
203
|
`sort=${String(i)}`,
|
|
195
204
|
`order=${r}`,
|
|
196
|
-
`page=${
|
|
197
|
-
`pageSize=${
|
|
205
|
+
`page=${a}`,
|
|
206
|
+
`pageSize=${c}`
|
|
198
207
|
);
|
|
199
208
|
}
|
|
200
209
|
if (s) {
|
|
201
210
|
const i = Object.entries(s).filter(
|
|
202
211
|
([, r]) => r != null && r !== ""
|
|
203
|
-
).flatMap(([r,
|
|
204
|
-
if (Array.isArray(
|
|
205
|
-
return
|
|
206
|
-
if (typeof
|
|
207
|
-
const
|
|
208
|
-
return
|
|
212
|
+
).flatMap(([r, a]) => {
|
|
213
|
+
if (Array.isArray(a))
|
|
214
|
+
return a.map((c) => `${r}==${encodeURIComponent((c == null ? void 0 : c.id) ?? c)}`);
|
|
215
|
+
if (typeof a == "object" && a !== null && "start" in a && "end" in a) {
|
|
216
|
+
const c = [];
|
|
217
|
+
return a.start != null && a.start !== "" && c.push(`${r}>=${encodeURIComponent(a.start)}`), a.end != null && a.end !== "" && c.push(`${r}<=${encodeURIComponent(a.end)}`), c;
|
|
209
218
|
}
|
|
210
|
-
return typeof
|
|
219
|
+
return typeof a == "object" && a !== null ? `${r}==${encodeURIComponent(a.id ?? "")}` : `${r}==${encodeURIComponent(a)}`;
|
|
211
220
|
});
|
|
212
221
|
i.length > 0 && n.push(`filters=${i.join(",")}`);
|
|
213
222
|
}
|
|
214
223
|
return n.length ? `${e}?${n.join("&")}` : e;
|
|
215
224
|
};
|
|
216
|
-
class
|
|
225
|
+
class Jt {
|
|
217
226
|
/**
|
|
218
227
|
* @param baseUrl the base url of the server
|
|
219
228
|
* @param userKey the local storage user key
|
|
@@ -229,12 +238,12 @@ class Qt {
|
|
|
229
238
|
}
|
|
230
239
|
defaultTokenAcquirer(t) {
|
|
231
240
|
if (t) return { credentials: "include" };
|
|
232
|
-
const s =
|
|
241
|
+
const s = zt(this.userKey);
|
|
233
242
|
if (s && s.length)
|
|
234
243
|
return { Authorization: `Bearer ${s}` };
|
|
235
244
|
}
|
|
236
|
-
async doQuery(t, s =
|
|
237
|
-
const r = this.secured ? this.tokenAcquirer() : {}, { data:
|
|
245
|
+
async doQuery(t, s = te.GET, n, i) {
|
|
246
|
+
const r = this.secured ? this.tokenAcquirer() : {}, { data: a, status: c, error: l } = await Te(
|
|
238
247
|
`${this.baseUrl}${t}`,
|
|
239
248
|
s,
|
|
240
249
|
n,
|
|
@@ -243,12 +252,12 @@ class Qt {
|
|
|
243
252
|
...i ?? {}
|
|
244
253
|
}
|
|
245
254
|
);
|
|
246
|
-
if (
|
|
247
|
-
throw
|
|
248
|
-
status:
|
|
249
|
-
message: String(
|
|
255
|
+
if (l || c < 200 || c >= 300)
|
|
256
|
+
throw l ?? {
|
|
257
|
+
status: c,
|
|
258
|
+
message: String(c)
|
|
250
259
|
};
|
|
251
|
-
return
|
|
260
|
+
return a;
|
|
252
261
|
}
|
|
253
262
|
/**
|
|
254
263
|
* @description Get all objects
|
|
@@ -257,14 +266,14 @@ class Qt {
|
|
|
257
266
|
* @returns Result list
|
|
258
267
|
*/
|
|
259
268
|
async get(t, s, n) {
|
|
260
|
-
const i =
|
|
269
|
+
const i = Gt(t, s, n), r = this.secured ? this.tokenAcquirer() : void 0, { data: a, error: c } = await Te(
|
|
261
270
|
`${this.baseUrl}${i}`,
|
|
262
|
-
|
|
271
|
+
te.GET,
|
|
263
272
|
null,
|
|
264
273
|
r
|
|
265
274
|
);
|
|
266
|
-
if (
|
|
267
|
-
return
|
|
275
|
+
if (c) throw c;
|
|
276
|
+
return a;
|
|
268
277
|
}
|
|
269
278
|
/**
|
|
270
279
|
* @description Get entity by id
|
|
@@ -273,15 +282,15 @@ class Qt {
|
|
|
273
282
|
* @returns updated entity
|
|
274
283
|
*/
|
|
275
284
|
async patch(t, s) {
|
|
276
|
-
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status:
|
|
285
|
+
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
|
|
277
286
|
`${this.baseUrl}${t}`,
|
|
278
|
-
|
|
287
|
+
te.PATCH,
|
|
279
288
|
s,
|
|
280
289
|
n
|
|
281
290
|
);
|
|
282
291
|
if (i || !r)
|
|
283
292
|
throw i ?? {
|
|
284
|
-
status:
|
|
293
|
+
status: a,
|
|
285
294
|
message: "Unknown error"
|
|
286
295
|
};
|
|
287
296
|
return r;
|
|
@@ -292,15 +301,15 @@ class Qt {
|
|
|
292
301
|
* @returns delete result
|
|
293
302
|
*/
|
|
294
303
|
async delete(t, s) {
|
|
295
|
-
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status:
|
|
304
|
+
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
|
|
296
305
|
`${this.baseUrl}${t}`,
|
|
297
|
-
|
|
306
|
+
te.DELETE,
|
|
298
307
|
s,
|
|
299
308
|
n
|
|
300
309
|
);
|
|
301
310
|
if (i || !r)
|
|
302
311
|
throw i ?? {
|
|
303
|
-
status:
|
|
312
|
+
status: a,
|
|
304
313
|
message: "Unknown error"
|
|
305
314
|
};
|
|
306
315
|
return r;
|
|
@@ -312,53 +321,53 @@ class Qt {
|
|
|
312
321
|
* @returns inserted item
|
|
313
322
|
*/
|
|
314
323
|
async post(t, s) {
|
|
315
|
-
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status:
|
|
324
|
+
const n = this.secured ? this.tokenAcquirer() : void 0, { error: i, data: r, status: a } = await Te(
|
|
316
325
|
`${this.baseUrl}${t}`,
|
|
317
|
-
|
|
326
|
+
te.POST,
|
|
318
327
|
s,
|
|
319
328
|
n
|
|
320
329
|
);
|
|
321
330
|
if (i || !r)
|
|
322
331
|
throw i ?? {
|
|
323
|
-
status:
|
|
332
|
+
status: a,
|
|
324
333
|
message: "Unknown error"
|
|
325
334
|
};
|
|
326
335
|
return r;
|
|
327
336
|
}
|
|
328
337
|
}
|
|
329
|
-
class
|
|
338
|
+
class rr {
|
|
330
339
|
constructor(t, s = "user") {
|
|
331
340
|
me(this, "api");
|
|
332
|
-
this.api = new
|
|
341
|
+
this.api = new Jt(t, s, !1);
|
|
333
342
|
}
|
|
334
343
|
async login(t) {
|
|
335
344
|
const s = "auth/sign-in", n = t;
|
|
336
345
|
return await this.api.doQuery(
|
|
337
346
|
s,
|
|
338
|
-
|
|
347
|
+
te.POST,
|
|
339
348
|
n
|
|
340
349
|
);
|
|
341
350
|
}
|
|
342
351
|
async logout() {
|
|
343
|
-
return await this.api.doQuery("auth/sign-out",
|
|
352
|
+
return await this.api.doQuery("auth/sign-out", te.POST);
|
|
344
353
|
}
|
|
345
354
|
async register(t) {
|
|
346
355
|
return await this.api.doQuery(
|
|
347
356
|
"auth/sign-up",
|
|
348
|
-
|
|
357
|
+
te.POST,
|
|
349
358
|
t
|
|
350
359
|
);
|
|
351
360
|
}
|
|
352
361
|
async getSession() {
|
|
353
|
-
return await this.api.doQuery("auth/session",
|
|
362
|
+
return await this.api.doQuery("auth/session", te.GET, null, {
|
|
354
363
|
...this.api.defaultTokenAcquirer()
|
|
355
364
|
});
|
|
356
365
|
}
|
|
357
366
|
}
|
|
358
|
-
class
|
|
367
|
+
class cn {
|
|
359
368
|
constructor(t, s) {
|
|
360
369
|
me(this, "auth");
|
|
361
|
-
this.auth = new
|
|
370
|
+
this.auth = new rr(t, s);
|
|
362
371
|
}
|
|
363
372
|
/**
|
|
364
373
|
* @returns auth
|
|
@@ -367,7 +376,7 @@ class en {
|
|
|
367
376
|
return this.auth;
|
|
368
377
|
}
|
|
369
378
|
}
|
|
370
|
-
class
|
|
379
|
+
class ln {
|
|
371
380
|
/**
|
|
372
381
|
*
|
|
373
382
|
* @param table
|
|
@@ -377,7 +386,7 @@ class tn {
|
|
|
377
386
|
me(this, "table");
|
|
378
387
|
me(this, "secured");
|
|
379
388
|
me(this, "api");
|
|
380
|
-
this.table = t, this.secured = i, this.api = new
|
|
389
|
+
this.table = t, this.secured = i, this.api = new Jt(s, n, i);
|
|
381
390
|
}
|
|
382
391
|
/**
|
|
383
392
|
*
|
|
@@ -395,7 +404,7 @@ class tn {
|
|
|
395
404
|
async insertMany(t) {
|
|
396
405
|
return await this.api.doQuery(
|
|
397
406
|
`${this.table}/batch`,
|
|
398
|
-
|
|
407
|
+
te.POST,
|
|
399
408
|
t
|
|
400
409
|
);
|
|
401
410
|
}
|
|
@@ -425,12 +434,12 @@ class tn {
|
|
|
425
434
|
* @returns - List of elements
|
|
426
435
|
*/
|
|
427
436
|
async export(t) {
|
|
428
|
-
const s =
|
|
437
|
+
const s = Gt(
|
|
429
438
|
`${this.table}/export`,
|
|
430
439
|
void 0,
|
|
431
440
|
t
|
|
432
441
|
);
|
|
433
|
-
return await this.api.doQuery(s,
|
|
442
|
+
return await this.api.doQuery(s, te.GET, void 0);
|
|
434
443
|
}
|
|
435
444
|
/**
|
|
436
445
|
*
|
|
@@ -440,7 +449,7 @@ class tn {
|
|
|
440
449
|
async import(t) {
|
|
441
450
|
return await this.api.doQuery(
|
|
442
451
|
`${this.table}/import`,
|
|
443
|
-
|
|
452
|
+
te.POST,
|
|
444
453
|
t
|
|
445
454
|
);
|
|
446
455
|
}
|
|
@@ -451,8 +460,8 @@ class tn {
|
|
|
451
460
|
*/
|
|
452
461
|
async commonGet(t) {
|
|
453
462
|
return await this.api.doQuery(
|
|
454
|
-
|
|
455
|
-
|
|
463
|
+
sr(`${this.table}/common`, t),
|
|
464
|
+
te.GET
|
|
456
465
|
);
|
|
457
466
|
}
|
|
458
467
|
/**
|
|
@@ -470,13 +479,13 @@ class tn {
|
|
|
470
479
|
return await this.api.patch(`${this.table}/restore`, t);
|
|
471
480
|
}
|
|
472
481
|
}
|
|
473
|
-
function
|
|
482
|
+
function un(e) {
|
|
474
483
|
return Object.keys(e).filter((t) => isNaN(Number(t))).map((t) => ({
|
|
475
484
|
key: t,
|
|
476
485
|
value: e[t]
|
|
477
486
|
}));
|
|
478
487
|
}
|
|
479
|
-
const
|
|
488
|
+
const zt = (e, t = "") => {
|
|
480
489
|
const s = localStorage.getItem(e) ?? void 0;
|
|
481
490
|
if (s && t.length)
|
|
482
491
|
switch (t) {
|
|
@@ -490,11 +499,11 @@ const Kt = (e, t = "") => {
|
|
|
490
499
|
return s;
|
|
491
500
|
}
|
|
492
501
|
return s;
|
|
493
|
-
},
|
|
502
|
+
}, Et = (e, t) => localStorage.setItem(
|
|
494
503
|
e,
|
|
495
504
|
typeof t == "object" ? JSON.stringify(t) : t
|
|
496
|
-
),
|
|
497
|
-
function
|
|
505
|
+
), Nt = (e) => localStorage.removeItem(e);
|
|
506
|
+
function kt(e) {
|
|
498
507
|
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = {
|
|
499
508
|
weekday: "long",
|
|
500
509
|
// martes
|
|
@@ -516,83 +525,77 @@ function Ct(e) {
|
|
|
516
525
|
s
|
|
517
526
|
);
|
|
518
527
|
}
|
|
519
|
-
function
|
|
520
|
-
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getFullYear()).slice(-2), r = String(t.getHours()).padStart(2, "0"),
|
|
521
|
-
return `${s}/${n}/${i} ${r}:${
|
|
528
|
+
function nr(e) {
|
|
529
|
+
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getFullYear()).slice(-2), r = String(t.getHours()).padStart(2, "0"), a = String(t.getMinutes()).padStart(2, "0");
|
|
530
|
+
return `${s}/${n}/${i} ${r}:${a}`;
|
|
522
531
|
}
|
|
523
|
-
function
|
|
524
|
-
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), r = String(t.getHours()).padStart(2, "0"),
|
|
525
|
-
return `${s}-${n}-${i}T${r}:${
|
|
532
|
+
function dn(e) {
|
|
533
|
+
const t = e ? new Date(e) : /* @__PURE__ */ new Date(), s = t.getFullYear(), n = String(t.getMonth() + 1).padStart(2, "0"), i = String(t.getDate()).padStart(2, "0"), r = String(t.getHours()).padStart(2, "0"), a = String(t.getMinutes()).padStart(2, "0");
|
|
534
|
+
return `${s}-${n}-${i}T${r}:${a}`;
|
|
526
535
|
}
|
|
527
|
-
const
|
|
536
|
+
const ir = () => {
|
|
528
537
|
var s;
|
|
529
538
|
const e = navigator, t = ((s = e == null ? void 0 : e.userAgentData) == null ? void 0 : s.platform) || (e == null ? void 0 : e.platform) || "";
|
|
530
539
|
return /Mac|iPhone|iPod|iPad/i.test(t);
|
|
531
540
|
};
|
|
532
|
-
function
|
|
541
|
+
function Ge(e) {
|
|
533
542
|
if (!e || typeof e != "object") return !1;
|
|
534
543
|
const t = e;
|
|
535
544
|
return Array.isArray(t.errors) && t.errors.every(
|
|
536
545
|
(s) => Array.isArray(s) && s.length === 2 && typeof s[0] == "string"
|
|
537
546
|
);
|
|
538
547
|
}
|
|
539
|
-
function
|
|
548
|
+
function Je(e) {
|
|
540
549
|
if (!e || typeof e != "object") return !1;
|
|
541
550
|
const t = e;
|
|
542
551
|
return typeof (t == null ? void 0 : t.status) == "number" && typeof (t == null ? void 0 : t.message) == "string";
|
|
543
552
|
}
|
|
544
|
-
function
|
|
553
|
+
function fn(e, t) {
|
|
545
554
|
return e != null && e.errors ? e.errors.map(([s, n]) => t(s, n)) : [];
|
|
546
555
|
}
|
|
547
|
-
const
|
|
548
|
-
function
|
|
549
|
-
const { children: t } = e,
|
|
550
|
-
(
|
|
551
|
-
const { type:
|
|
552
|
-
switch (
|
|
556
|
+
const Yt = Pe({});
|
|
557
|
+
function mn(e) {
|
|
558
|
+
const { children: t } = e, s = Ie(0), [n, i] = Ut(
|
|
559
|
+
(g, f) => {
|
|
560
|
+
const { type: p, items: _, id: C } = f;
|
|
561
|
+
switch (p) {
|
|
553
562
|
case "set":
|
|
554
|
-
return
|
|
555
|
-
..._,
|
|
556
|
-
id: y
|
|
557
|
-
}))) ?? [];
|
|
563
|
+
return _ ?? [];
|
|
558
564
|
case "remove":
|
|
559
|
-
return
|
|
565
|
+
return C !== void 0 ? g.filter((N) => N.id !== C) : [];
|
|
560
566
|
}
|
|
561
|
-
return
|
|
567
|
+
return g;
|
|
562
568
|
},
|
|
563
569
|
[],
|
|
564
570
|
() => []
|
|
565
|
-
),
|
|
566
|
-
type: "set",
|
|
567
|
-
items: [{ ...f, type: j.error }]
|
|
568
|
-
}), r = (f) => n({
|
|
571
|
+
), r = (g) => g.map((f) => ({ ...f, id: s.current++ })), a = (g) => i({
|
|
569
572
|
type: "set",
|
|
570
|
-
items: [{ ...
|
|
571
|
-
}), c = (
|
|
573
|
+
items: r([{ ...g, type: z.error }])
|
|
574
|
+
}), c = (g) => i({ type: "set", items: r([{ ...g }]) }), l = (g) => i({ type: "set", items: r(g) }), m = (g) => i({
|
|
572
575
|
type: "set",
|
|
573
|
-
items: [{ ...
|
|
574
|
-
}),
|
|
576
|
+
items: r([{ ...g, type: z.success }])
|
|
577
|
+
}), y = (g) => i({ type: "remove", id: g });
|
|
575
578
|
return /* @__PURE__ */ h(
|
|
576
|
-
|
|
579
|
+
Yt.Provider,
|
|
577
580
|
{
|
|
578
581
|
value: {
|
|
579
|
-
notification:
|
|
580
|
-
removeNotification:
|
|
581
|
-
showErrorNotification:
|
|
582
|
-
showNotification:
|
|
583
|
-
showSuccessNotification:
|
|
584
|
-
showStackNotifications:
|
|
582
|
+
notification: n,
|
|
583
|
+
removeNotification: y,
|
|
584
|
+
showErrorNotification: a,
|
|
585
|
+
showNotification: c,
|
|
586
|
+
showSuccessNotification: m,
|
|
587
|
+
showStackNotifications: l
|
|
585
588
|
},
|
|
586
589
|
children: t
|
|
587
590
|
}
|
|
588
591
|
);
|
|
589
592
|
}
|
|
590
593
|
const Ne = () => {
|
|
591
|
-
const e =
|
|
594
|
+
const e = Oe(Yt);
|
|
592
595
|
if (e === void 0)
|
|
593
596
|
throw new Error("NotificationContext must be used within a Provider");
|
|
594
597
|
return e;
|
|
595
|
-
},
|
|
598
|
+
}, be = new zs({
|
|
596
599
|
defaultOptions: {
|
|
597
600
|
queries: {
|
|
598
601
|
refetchInterval: !1,
|
|
@@ -604,105 +607,105 @@ const Ne = () => {
|
|
|
604
607
|
// default: true
|
|
605
608
|
}
|
|
606
609
|
}
|
|
607
|
-
}),
|
|
610
|
+
}), Xt = Pe(
|
|
608
611
|
void 0
|
|
609
|
-
),
|
|
612
|
+
), hn = (e) => {
|
|
610
613
|
const { children: t, manager: s } = e;
|
|
611
|
-
return /* @__PURE__ */ h(
|
|
612
|
-
},
|
|
613
|
-
const e =
|
|
614
|
+
return /* @__PURE__ */ h(Xt.Provider, { value: { client: s }, children: /* @__PURE__ */ h(Ys, { client: be, children: t }) });
|
|
615
|
+
}, ar = () => {
|
|
616
|
+
const e = Oe(Xt);
|
|
614
617
|
if (!e)
|
|
615
618
|
throw new Error("managerContext must be used within a Provider");
|
|
616
619
|
return e.client;
|
|
617
|
-
},
|
|
620
|
+
}, Zt = Pe(
|
|
618
621
|
void 0
|
|
619
|
-
),
|
|
620
|
-
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i =
|
|
621
|
-
|
|
622
|
-
}, [s]),
|
|
623
|
-
p && (
|
|
624
|
-
}, [s, n]),
|
|
622
|
+
), yn = (e) => {
|
|
623
|
+
const { children: t, guestMode: s = "guest_mode", user: n = "user" } = e, i = ar(), [r, a] = J({}), c = V(() => !!zt(s, "boolean") && r.token === void 0, [r.token, s]), l = V((p) => {
|
|
624
|
+
Et(s, p);
|
|
625
|
+
}, [s]), m = V((p) => {
|
|
626
|
+
p && (a(p), Nt(s), Et(n, p.token));
|
|
627
|
+
}, [s, n]), y = V(async () => {
|
|
625
628
|
try {
|
|
626
629
|
await i.Auth.logout();
|
|
627
630
|
} catch (p) {
|
|
628
631
|
console.error(p);
|
|
629
632
|
}
|
|
630
|
-
|
|
631
|
-
}, [i.Auth, n]), g =
|
|
633
|
+
a({}), Nt(n);
|
|
634
|
+
}, [i.Auth, n]), g = V(async () => {
|
|
632
635
|
try {
|
|
633
636
|
const p = await i.Auth.getSession();
|
|
634
|
-
|
|
637
|
+
m(p);
|
|
635
638
|
} catch (p) {
|
|
636
|
-
console.error(p),
|
|
639
|
+
console.error(p), y();
|
|
637
640
|
}
|
|
638
|
-
}, [
|
|
641
|
+
}, [m, y, i.Auth]), f = {
|
|
639
642
|
account: r,
|
|
640
|
-
logUser:
|
|
641
|
-
logoutUser:
|
|
643
|
+
logUser: m,
|
|
644
|
+
logoutUser: y,
|
|
642
645
|
logUserFromLocal: g,
|
|
643
|
-
isInGuestMode:
|
|
644
|
-
setGuestMode:
|
|
646
|
+
isInGuestMode: c,
|
|
647
|
+
setGuestMode: l
|
|
645
648
|
};
|
|
646
|
-
return /* @__PURE__ */ h(
|
|
647
|
-
},
|
|
648
|
-
const e =
|
|
649
|
+
return /* @__PURE__ */ h(Zt.Provider, { value: f, children: t });
|
|
650
|
+
}, es = () => {
|
|
651
|
+
const e = Oe(Zt);
|
|
649
652
|
if (!e)
|
|
650
653
|
throw new Error("authContext must be used within a Provider");
|
|
651
654
|
return e;
|
|
652
|
-
},
|
|
655
|
+
}, ts = Pe({}), gn = (e) => {
|
|
653
656
|
const { children: t, location: s, navigate: n, linkComponent: i, searchComponent: r } = e;
|
|
654
657
|
return /* @__PURE__ */ h(
|
|
655
|
-
|
|
658
|
+
ts.Provider,
|
|
656
659
|
{
|
|
657
660
|
value: { location: s, navigate: n, linkComponent: i, searchComponent: r },
|
|
658
661
|
children: t
|
|
659
662
|
}
|
|
660
663
|
);
|
|
661
|
-
},
|
|
662
|
-
const e =
|
|
664
|
+
}, Re = () => {
|
|
665
|
+
const e = Oe(ts);
|
|
663
666
|
if (e === void 0 || Object.keys(e).length === 0)
|
|
664
667
|
throw new Error(
|
|
665
668
|
"Config provider has not been set. This step is required and cannot be skipped."
|
|
666
669
|
);
|
|
667
670
|
return e;
|
|
668
|
-
},
|
|
669
|
-
const { children: t } = e, [s, n] =
|
|
670
|
-
(
|
|
671
|
-
...
|
|
672
|
-
[
|
|
671
|
+
}, ss = Pe({}), pn = (e) => {
|
|
672
|
+
const { children: t } = e, [s, n] = J({}), i = V(
|
|
673
|
+
(l, m) => n((y) => ({
|
|
674
|
+
...y,
|
|
675
|
+
[l]: [...y[l] ?? [], m]
|
|
673
676
|
})),
|
|
674
677
|
[]
|
|
675
|
-
), r =
|
|
676
|
-
(
|
|
677
|
-
...
|
|
678
|
-
[
|
|
678
|
+
), r = V(
|
|
679
|
+
(l, m) => n((y) => ({
|
|
680
|
+
...y,
|
|
681
|
+
[l]: (y[l] ?? []).filter((g, f) => f !== m)
|
|
679
682
|
})),
|
|
680
683
|
[]
|
|
681
|
-
),
|
|
682
|
-
n(
|
|
683
|
-
...
|
|
684
|
-
[
|
|
684
|
+
), a = V((l) => {
|
|
685
|
+
n(l ? (m) => ({
|
|
686
|
+
...m,
|
|
687
|
+
[l]: []
|
|
685
688
|
}) : {});
|
|
686
|
-
}, []),
|
|
689
|
+
}, []), c = Ae(
|
|
687
690
|
() => ({
|
|
688
691
|
dynamicItems: s,
|
|
689
692
|
addChildItem: i,
|
|
690
693
|
removeChildItem: r,
|
|
691
|
-
clearDynamicItems:
|
|
694
|
+
clearDynamicItems: a
|
|
692
695
|
}),
|
|
693
|
-
[s,
|
|
696
|
+
[s, a, r, i]
|
|
694
697
|
);
|
|
695
|
-
return /* @__PURE__ */ h(
|
|
696
|
-
},
|
|
697
|
-
|
|
698
|
-
),
|
|
699
|
-
const { showSuccessNotification: t } = Ne(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [
|
|
700
|
-
|
|
701
|
-
},
|
|
702
|
-
|
|
698
|
+
return /* @__PURE__ */ h(ss.Provider, { value: c, children: t });
|
|
699
|
+
}, or = () => Oe(
|
|
700
|
+
ss
|
|
701
|
+
), rs = (e) => {
|
|
702
|
+
const { showSuccessNotification: t } = Ne(), { mutationFn: s, onError: n, onSuccess: i, onSuccessMessage: r } = e, [a, c] = J([]), { open: l, handleClose: m, handleOpen: y } = fs(), g = () => {
|
|
703
|
+
m(), c([]);
|
|
704
|
+
}, f = async (_) => {
|
|
705
|
+
c(_), y();
|
|
703
706
|
}, p = Me({
|
|
704
707
|
mutationFn: () => s(
|
|
705
|
-
Array.isArray(
|
|
708
|
+
Array.isArray(a) ? a : [a]
|
|
706
709
|
),
|
|
707
710
|
onError: (_) => {
|
|
708
711
|
console.error(_), n && n(_), g();
|
|
@@ -713,50 +716,50 @@ const Ne = () => {
|
|
|
713
716
|
}), g();
|
|
714
717
|
}
|
|
715
718
|
});
|
|
716
|
-
return { open:
|
|
719
|
+
return { open: l, onClick: f, close: g, dialogFn: p, isLoading: p.isPending };
|
|
717
720
|
};
|
|
718
|
-
var
|
|
719
|
-
const
|
|
720
|
-
var
|
|
721
|
+
var Ue = (e) => e.type === "checkbox", Ee = (e) => e instanceof Date, Z = (e) => e == null;
|
|
722
|
+
const ns = (e) => typeof e == "object";
|
|
723
|
+
var Q = (e) => !Z(e) && !Array.isArray(e) && ns(e) && !Ee(e), cr = (e) => Q(e) && e.target ? Ue(e.target) ? e.target.checked : e.target.value : e, lr = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ur = (e, t) => e.has(lr(t)), dr = (e) => {
|
|
721
724
|
const t = e.constructor && e.constructor.prototype;
|
|
722
|
-
return
|
|
723
|
-
},
|
|
724
|
-
function
|
|
725
|
+
return Q(t) && t.hasOwnProperty("isPrototypeOf");
|
|
726
|
+
}, at = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
727
|
+
function G(e) {
|
|
725
728
|
let t;
|
|
726
729
|
const s = Array.isArray(e), n = typeof FileList < "u" ? e instanceof FileList : !1;
|
|
727
730
|
if (e instanceof Date)
|
|
728
731
|
t = new Date(e);
|
|
729
|
-
else if (!(
|
|
730
|
-
if (t = s ? [] : {}, !s && !
|
|
732
|
+
else if (!(at && (e instanceof Blob || n)) && (s || Q(e)))
|
|
733
|
+
if (t = s ? [] : {}, !s && !dr(e))
|
|
731
734
|
t = e;
|
|
732
735
|
else
|
|
733
736
|
for (const i in e)
|
|
734
|
-
e.hasOwnProperty(i) && (t[i] =
|
|
737
|
+
e.hasOwnProperty(i) && (t[i] = G(e[i]));
|
|
735
738
|
else
|
|
736
739
|
return e;
|
|
737
740
|
return t;
|
|
738
741
|
}
|
|
739
|
-
var ze = (e) => /^\w*$/.test(e),
|
|
740
|
-
if (!t || !
|
|
742
|
+
var ze = (e) => /^\w*$/.test(e), j = (e) => e === void 0, ot = (e) => Array.isArray(e) ? e.filter(Boolean) : [], ct = (e) => ot(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, t, s) => {
|
|
743
|
+
if (!t || !Q(e))
|
|
741
744
|
return s;
|
|
742
|
-
const n = (ze(t) ? [t] :
|
|
743
|
-
return
|
|
744
|
-
}, he = (e) => typeof e == "boolean",
|
|
745
|
+
const n = (ze(t) ? [t] : ct(t)).reduce((i, r) => Z(i) ? i : i[r], e);
|
|
746
|
+
return j(n) || n === e ? j(e[t]) ? s : e[t] : n;
|
|
747
|
+
}, he = (e) => typeof e == "boolean", q = (e, t, s) => {
|
|
745
748
|
let n = -1;
|
|
746
|
-
const i = ze(t) ? [t] :
|
|
749
|
+
const i = ze(t) ? [t] : ct(t), r = i.length, a = r - 1;
|
|
747
750
|
for (; ++n < r; ) {
|
|
748
|
-
const
|
|
749
|
-
let
|
|
750
|
-
if (n !==
|
|
751
|
-
const
|
|
752
|
-
|
|
751
|
+
const c = i[n];
|
|
752
|
+
let l = s;
|
|
753
|
+
if (n !== a) {
|
|
754
|
+
const m = e[c];
|
|
755
|
+
l = Q(m) || Array.isArray(m) ? m : isNaN(+i[n + 1]) ? {} : [];
|
|
753
756
|
}
|
|
754
|
-
if (
|
|
757
|
+
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
755
758
|
return;
|
|
756
|
-
e[
|
|
759
|
+
e[c] = l, e = e[c];
|
|
757
760
|
}
|
|
758
761
|
};
|
|
759
|
-
const
|
|
762
|
+
const At = {
|
|
760
763
|
BLUR: "blur",
|
|
761
764
|
FOCUS_OUT: "focusout"
|
|
762
765
|
}, de = {
|
|
@@ -773,27 +776,27 @@ const kt = {
|
|
|
773
776
|
pattern: "pattern",
|
|
774
777
|
required: "required",
|
|
775
778
|
validate: "validate"
|
|
776
|
-
},
|
|
777
|
-
|
|
778
|
-
var
|
|
779
|
+
}, fr = ie.createContext(null);
|
|
780
|
+
fr.displayName = "HookFormContext";
|
|
781
|
+
var mr = (e, t, s, n = !0) => {
|
|
779
782
|
const i = {
|
|
780
783
|
defaultValues: t._defaultValues
|
|
781
784
|
};
|
|
782
785
|
for (const r in e)
|
|
783
786
|
Object.defineProperty(i, r, {
|
|
784
787
|
get: () => {
|
|
785
|
-
const
|
|
786
|
-
return t._proxyFormState[
|
|
788
|
+
const a = r;
|
|
789
|
+
return t._proxyFormState[a] !== de.all && (t._proxyFormState[a] = !n || de.all), e[a];
|
|
787
790
|
}
|
|
788
791
|
});
|
|
789
792
|
return i;
|
|
790
793
|
};
|
|
791
|
-
const
|
|
792
|
-
var ye = (e) => typeof e == "string",
|
|
794
|
+
const hr = typeof window < "u" ? ie.useLayoutEffect : ie.useEffect;
|
|
795
|
+
var ye = (e) => typeof e == "string", yr = (e, t, s, n, i) => ye(e) ? (n && t.watch.add(e), S(s, e, i)) : Array.isArray(e) ? e.map((r) => (n && t.watch.add(r), S(s, r))) : (n && (t.watchAll = !0), s), it = (e) => Z(e) || !ns(e);
|
|
793
796
|
function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
|
|
794
|
-
if (
|
|
797
|
+
if (it(e) || it(t))
|
|
795
798
|
return e === t;
|
|
796
|
-
if (
|
|
799
|
+
if (Ee(e) && Ee(t))
|
|
797
800
|
return e.getTime() === t.getTime();
|
|
798
801
|
const n = Object.keys(e), i = Object.keys(t);
|
|
799
802
|
if (n.length !== i.length)
|
|
@@ -802,24 +805,24 @@ function ve(e, t, s = /* @__PURE__ */ new WeakSet()) {
|
|
|
802
805
|
return !0;
|
|
803
806
|
s.add(e), s.add(t);
|
|
804
807
|
for (const r of n) {
|
|
805
|
-
const
|
|
808
|
+
const a = e[r];
|
|
806
809
|
if (!i.includes(r))
|
|
807
810
|
return !1;
|
|
808
811
|
if (r !== "ref") {
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
812
|
+
const c = t[r];
|
|
813
|
+
if (Ee(a) && Ee(c) || Q(a) && Q(c) || Array.isArray(a) && Array.isArray(c) ? !ve(a, c, s) : a !== c)
|
|
811
814
|
return !1;
|
|
812
815
|
}
|
|
813
816
|
}
|
|
814
817
|
return !0;
|
|
815
818
|
}
|
|
816
|
-
var
|
|
819
|
+
var gr = (e, t, s, n, i) => t ? {
|
|
817
820
|
...s[e],
|
|
818
821
|
types: {
|
|
819
822
|
...s[e] && s[e].types ? s[e].types : {},
|
|
820
823
|
[n]: i || !0
|
|
821
824
|
}
|
|
822
|
-
} : {}, Le = (e) => Array.isArray(e) ? e : [e],
|
|
825
|
+
} : {}, Le = (e) => Array.isArray(e) ? e : [e], xt = () => {
|
|
823
826
|
let e = [];
|
|
824
827
|
return {
|
|
825
828
|
get observers() {
|
|
@@ -838,55 +841,55 @@ var fr = (e, t, s, n, i) => t ? {
|
|
|
838
841
|
e = [];
|
|
839
842
|
}
|
|
840
843
|
};
|
|
841
|
-
},
|
|
842
|
-
if (!
|
|
844
|
+
}, ee = (e) => Q(e) && !Object.keys(e).length, lt = (e) => e.type === "file", fe = (e) => typeof e == "function", Ke = (e) => {
|
|
845
|
+
if (!at)
|
|
843
846
|
return !1;
|
|
844
847
|
const t = e ? e.ownerDocument : 0;
|
|
845
848
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
846
|
-
},
|
|
847
|
-
function
|
|
849
|
+
}, is = (e) => e.type === "select-multiple", ut = (e) => e.type === "radio", pr = (e) => ut(e) || Ue(e), rt = (e) => Ke(e) && e.isConnected;
|
|
850
|
+
function br(e, t) {
|
|
848
851
|
const s = t.slice(0, -1).length;
|
|
849
852
|
let n = 0;
|
|
850
853
|
for (; n < s; )
|
|
851
|
-
e =
|
|
854
|
+
e = j(e) ? n++ : e[t[n++]];
|
|
852
855
|
return e;
|
|
853
856
|
}
|
|
854
|
-
function
|
|
857
|
+
function wr(e) {
|
|
855
858
|
for (const t in e)
|
|
856
|
-
if (e.hasOwnProperty(t) && !
|
|
859
|
+
if (e.hasOwnProperty(t) && !j(e[t]))
|
|
857
860
|
return !1;
|
|
858
861
|
return !0;
|
|
859
862
|
}
|
|
860
|
-
function
|
|
861
|
-
const s = Array.isArray(t) ? t : ze(t) ? [t] :
|
|
862
|
-
return n && delete n[r], i !== 0 && (
|
|
863
|
+
function K(e, t) {
|
|
864
|
+
const s = Array.isArray(t) ? t : ze(t) ? [t] : ct(t), n = s.length === 1 ? e : br(e, s), i = s.length - 1, r = s[i];
|
|
865
|
+
return n && delete n[r], i !== 0 && (Q(n) && ee(n) || Array.isArray(n) && wr(n)) && K(e, s.slice(0, -1)), e;
|
|
863
866
|
}
|
|
864
|
-
var
|
|
867
|
+
var as = (e) => {
|
|
865
868
|
for (const t in e)
|
|
866
869
|
if (fe(e[t]))
|
|
867
870
|
return !0;
|
|
868
871
|
return !1;
|
|
869
872
|
};
|
|
870
|
-
function
|
|
873
|
+
function je(e, t = {}) {
|
|
871
874
|
const s = Array.isArray(e);
|
|
872
|
-
if (
|
|
875
|
+
if (Q(e) || s)
|
|
873
876
|
for (const n in e)
|
|
874
|
-
Array.isArray(e[n]) ||
|
|
877
|
+
Array.isArray(e[n]) || Q(e[n]) && !as(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, je(e[n], t[n])) : Z(e[n]) || (t[n] = !0);
|
|
875
878
|
return t;
|
|
876
879
|
}
|
|
877
|
-
function
|
|
880
|
+
function os(e, t, s) {
|
|
878
881
|
const n = Array.isArray(e);
|
|
879
|
-
if (
|
|
882
|
+
if (Q(e) || n)
|
|
880
883
|
for (const i in e)
|
|
881
|
-
Array.isArray(e[i]) ||
|
|
884
|
+
Array.isArray(e[i]) || Q(e[i]) && !as(e[i]) ? j(t) || it(s[i]) ? s[i] = Array.isArray(e[i]) ? je(e[i], []) : { ...je(e[i]) } : os(e[i], Z(t) ? {} : t[i], s[i]) : s[i] = !ve(e[i], t[i]);
|
|
882
885
|
return s;
|
|
883
886
|
}
|
|
884
|
-
var $e = (e, t) =>
|
|
885
|
-
const
|
|
887
|
+
var $e = (e, t) => os(e, t, je(t));
|
|
888
|
+
const Tt = {
|
|
886
889
|
value: !1,
|
|
887
890
|
isValid: !1
|
|
888
|
-
},
|
|
889
|
-
var
|
|
891
|
+
}, $t = { value: !0, isValid: !0 };
|
|
892
|
+
var cs = (e) => {
|
|
890
893
|
if (Array.isArray(e)) {
|
|
891
894
|
if (e.length > 1) {
|
|
892
895
|
const t = e.filter((s) => s && s.checked && !s.disabled).map((s) => s.value);
|
|
@@ -894,28 +897,28 @@ var ns = (e) => {
|
|
|
894
897
|
}
|
|
895
898
|
return e[0].checked && !e[0].disabled ? (
|
|
896
899
|
// @ts-expect-error expected to work in the browser
|
|
897
|
-
e[0].attributes && !
|
|
898
|
-
) :
|
|
900
|
+
e[0].attributes && !j(e[0].attributes.value) ? j(e[0].value) || e[0].value === "" ? $t : { value: e[0].value, isValid: !0 } : $t
|
|
901
|
+
) : Tt;
|
|
899
902
|
}
|
|
900
|
-
return
|
|
901
|
-
},
|
|
902
|
-
const
|
|
903
|
+
return Tt;
|
|
904
|
+
}, ls = (e, { valueAsNumber: t, valueAsDate: s, setValueAs: n }) => j(e) ? e : t ? e === "" ? NaN : e && +e : s && ye(e) ? new Date(e) : n ? n(e) : e;
|
|
905
|
+
const Ft = {
|
|
903
906
|
isValid: !1,
|
|
904
907
|
value: null
|
|
905
908
|
};
|
|
906
|
-
var
|
|
909
|
+
var us = (e) => Array.isArray(e) ? e.reduce((t, s) => s && s.checked && !s.disabled ? {
|
|
907
910
|
isValid: !0,
|
|
908
911
|
value: s.value
|
|
909
|
-
} : t,
|
|
910
|
-
function
|
|
912
|
+
} : t, Ft) : Ft;
|
|
913
|
+
function Lt(e) {
|
|
911
914
|
const t = e.ref;
|
|
912
|
-
return
|
|
915
|
+
return lt(t) ? t.files : ut(t) ? us(e.refs).value : is(t) ? [...t.selectedOptions].map(({ value: s }) => s) : Ue(t) ? cs(e.refs).value : ls(j(t.value) ? e.ref.value : t.value, e);
|
|
913
916
|
}
|
|
914
|
-
var
|
|
917
|
+
var vr = (e, t, s, n) => {
|
|
915
918
|
const i = {};
|
|
916
919
|
for (const r of e) {
|
|
917
|
-
const
|
|
918
|
-
|
|
920
|
+
const a = S(t, r);
|
|
921
|
+
a && q(i, r, a._f);
|
|
919
922
|
}
|
|
920
923
|
return {
|
|
921
924
|
criteriaMode: s,
|
|
@@ -923,33 +926,33 @@ var gr = (e, t, s, n) => {
|
|
|
923
926
|
fields: i,
|
|
924
927
|
shouldUseNativeValidation: n
|
|
925
928
|
};
|
|
926
|
-
},
|
|
929
|
+
}, We = (e) => e instanceof RegExp, Fe = (e) => j(e) ? e : We(e) ? e.source : Q(e) ? We(e.value) ? e.value.source : e.value : e, Dt = (e) => ({
|
|
927
930
|
isOnSubmit: !e || e === de.onSubmit,
|
|
928
931
|
isOnBlur: e === de.onBlur,
|
|
929
932
|
isOnChange: e === de.onChange,
|
|
930
933
|
isOnAll: e === de.all,
|
|
931
934
|
isOnTouch: e === de.onTouched
|
|
932
935
|
});
|
|
933
|
-
const
|
|
934
|
-
var
|
|
935
|
-
const
|
|
936
|
+
const Vt = "AsyncFunction";
|
|
937
|
+
var _r = (e) => !!e && !!e.validate && !!(fe(e.validate) && e.validate.constructor.name === Vt || Q(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Vt)), Sr = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), It = (e, t, s) => !s && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
938
|
+
const De = (e, t, s, n) => {
|
|
936
939
|
for (const i of s || Object.keys(e)) {
|
|
937
940
|
const r = S(e, i);
|
|
938
941
|
if (r) {
|
|
939
|
-
const { _f:
|
|
940
|
-
if (
|
|
941
|
-
if (
|
|
942
|
+
const { _f: a, ...c } = r;
|
|
943
|
+
if (a) {
|
|
944
|
+
if (a.refs && a.refs[0] && t(a.refs[0], i) && !n)
|
|
942
945
|
return !0;
|
|
943
|
-
if (
|
|
946
|
+
if (a.ref && t(a.ref, a.name) && !n)
|
|
944
947
|
return !0;
|
|
945
|
-
if (
|
|
948
|
+
if (De(c, t))
|
|
946
949
|
break;
|
|
947
|
-
} else if (
|
|
950
|
+
} else if (Q(c) && De(c, t))
|
|
948
951
|
break;
|
|
949
952
|
}
|
|
950
953
|
}
|
|
951
954
|
};
|
|
952
|
-
function
|
|
955
|
+
function Pt(e, t, s) {
|
|
953
956
|
const n = S(e, s);
|
|
954
957
|
if (n || ze(s))
|
|
955
958
|
return {
|
|
@@ -958,18 +961,18 @@ function Vt(e, t, s) {
|
|
|
958
961
|
};
|
|
959
962
|
const i = s.split(".");
|
|
960
963
|
for (; i.length; ) {
|
|
961
|
-
const r = i.join("."),
|
|
962
|
-
if (
|
|
964
|
+
const r = i.join("."), a = S(t, r), c = S(e, r);
|
|
965
|
+
if (a && !Array.isArray(a) && s !== r)
|
|
963
966
|
return { name: s };
|
|
964
|
-
if (
|
|
967
|
+
if (c && c.type)
|
|
965
968
|
return {
|
|
966
969
|
name: r,
|
|
967
|
-
error:
|
|
970
|
+
error: c
|
|
968
971
|
};
|
|
969
|
-
if (
|
|
972
|
+
if (c && c.root && c.root.type)
|
|
970
973
|
return {
|
|
971
974
|
name: `${r}.root`,
|
|
972
|
-
error:
|
|
975
|
+
error: c.root
|
|
973
976
|
};
|
|
974
977
|
i.pop();
|
|
975
978
|
}
|
|
@@ -977,114 +980,114 @@ function Vt(e, t, s) {
|
|
|
977
980
|
name: s
|
|
978
981
|
};
|
|
979
982
|
}
|
|
980
|
-
var
|
|
983
|
+
var Cr = (e, t, s, n) => {
|
|
981
984
|
s(e);
|
|
982
985
|
const { name: i, ...r } = e;
|
|
983
|
-
return
|
|
984
|
-
},
|
|
986
|
+
return ee(r) || Object.keys(r).length >= Object.keys(t).length || Object.keys(r).find((a) => t[a] === (!n || de.all));
|
|
987
|
+
}, Er = (e, t, s) => !e || !t || e === t || Le(e).some((n) => n && (s ? n === t : n.startsWith(t) || t.startsWith(n))), Nr = (e, t, s, n, i) => i.isOnAll ? !1 : !s && i.isOnTouch ? !(t || e) : (s ? n.isOnBlur : i.isOnBlur) ? !e : (s ? n.isOnChange : i.isOnChange) ? e : !0, kr = (e, t) => !ot(S(e, t)).length && K(e, t), Ar = (e, t, s) => {
|
|
985
988
|
const n = Le(S(e, s));
|
|
986
|
-
return
|
|
987
|
-
},
|
|
988
|
-
function
|
|
989
|
-
if (
|
|
989
|
+
return q(n, "root", t[s]), q(e, s, n), e;
|
|
990
|
+
}, Qe = (e) => ye(e);
|
|
991
|
+
function Ot(e, t, s = "validate") {
|
|
992
|
+
if (Qe(e) || Array.isArray(e) && e.every(Qe) || he(e) && !e)
|
|
990
993
|
return {
|
|
991
994
|
type: s,
|
|
992
|
-
message:
|
|
995
|
+
message: Qe(e) ? e : "",
|
|
993
996
|
ref: t
|
|
994
997
|
};
|
|
995
998
|
}
|
|
996
|
-
var
|
|
999
|
+
var ke = (e) => Q(e) && !We(e) ? e : {
|
|
997
1000
|
value: e,
|
|
998
1001
|
message: ""
|
|
999
|
-
},
|
|
1000
|
-
const { ref:
|
|
1001
|
-
if (!
|
|
1002
|
+
}, Mt = async (e, t, s, n, i, r) => {
|
|
1003
|
+
const { ref: a, refs: c, required: l, maxLength: m, minLength: y, min: g, max: f, pattern: p, validate: _, name: C, valueAsNumber: N, mount: B } = e._f, k = S(s, C);
|
|
1004
|
+
if (!B || t.has(C))
|
|
1002
1005
|
return {};
|
|
1003
|
-
const
|
|
1004
|
-
i &&
|
|
1005
|
-
},
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
type:
|
|
1009
|
-
message:
|
|
1010
|
-
ref:
|
|
1011
|
-
...re(
|
|
1006
|
+
const F = c ? c[0] : a, T = ($) => {
|
|
1007
|
+
i && F.reportValidity && (F.setCustomValidity(he($) ? "" : $ || ""), F.reportValidity());
|
|
1008
|
+
}, A = {}, I = ut(a), M = Ue(a), se = I || M, P = (N || lt(a)) && j(a.value) && j(k) || Ke(a) && a.value === "" || k === "" || Array.isArray(k) && !k.length, re = gr.bind(null, C, n, A), ae = ($, L, H, W = ge.maxLength, Y = ge.minLength) => {
|
|
1009
|
+
const R = $ ? L : H;
|
|
1010
|
+
A[C] = {
|
|
1011
|
+
type: $ ? W : Y,
|
|
1012
|
+
message: R,
|
|
1013
|
+
ref: a,
|
|
1014
|
+
...re($ ? W : Y, R)
|
|
1012
1015
|
};
|
|
1013
1016
|
};
|
|
1014
|
-
if (r ? !Array.isArray(
|
|
1015
|
-
const { value:
|
|
1016
|
-
if (
|
|
1017
|
+
if (r ? !Array.isArray(k) || !k.length : l && (!se && (P || Z(k)) || he(k) && !k || M && !cs(c).isValid || I && !us(c).isValid)) {
|
|
1018
|
+
const { value: $, message: L } = Qe(l) ? { value: !!l, message: l } : ke(l);
|
|
1019
|
+
if ($ && (A[C] = {
|
|
1017
1020
|
type: ge.required,
|
|
1018
|
-
message:
|
|
1019
|
-
ref:
|
|
1020
|
-
...re(ge.required,
|
|
1021
|
+
message: L,
|
|
1022
|
+
ref: F,
|
|
1023
|
+
...re(ge.required, L)
|
|
1021
1024
|
}, !n))
|
|
1022
|
-
return
|
|
1025
|
+
return T(L), A;
|
|
1023
1026
|
}
|
|
1024
|
-
if (!
|
|
1025
|
-
let
|
|
1026
|
-
const
|
|
1027
|
-
if (!
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1027
|
+
if (!P && (!Z(g) || !Z(f))) {
|
|
1028
|
+
let $, L;
|
|
1029
|
+
const H = ke(f), W = ke(g);
|
|
1030
|
+
if (!Z(k) && !isNaN(k)) {
|
|
1031
|
+
const Y = a.valueAsNumber || k && +k;
|
|
1032
|
+
Z(H.value) || ($ = Y > H.value), Z(W.value) || (L = Y < W.value);
|
|
1030
1033
|
} else {
|
|
1031
|
-
const
|
|
1032
|
-
ye(
|
|
1034
|
+
const Y = a.valueAsDate || new Date(k), R = (ue) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ue), X = a.type == "time", ne = a.type == "week";
|
|
1035
|
+
ye(H.value) && k && ($ = X ? R(k) > R(H.value) : ne ? k > H.value : Y > new Date(H.value)), ye(W.value) && k && (L = X ? R(k) < R(W.value) : ne ? k < W.value : Y < new Date(W.value));
|
|
1033
1036
|
}
|
|
1034
|
-
if ((
|
|
1035
|
-
return
|
|
1037
|
+
if (($ || L) && (ae(!!$, H.message, W.message, ge.max, ge.min), !n))
|
|
1038
|
+
return T(A[C].message), A;
|
|
1036
1039
|
}
|
|
1037
|
-
if ((
|
|
1038
|
-
const
|
|
1039
|
-
if ((
|
|
1040
|
-
return
|
|
1040
|
+
if ((m || y) && !P && (ye(k) || r && Array.isArray(k))) {
|
|
1041
|
+
const $ = ke(m), L = ke(y), H = !Z($.value) && k.length > +$.value, W = !Z(L.value) && k.length < +L.value;
|
|
1042
|
+
if ((H || W) && (ae(H, $.message, L.message), !n))
|
|
1043
|
+
return T(A[C].message), A;
|
|
1041
1044
|
}
|
|
1042
|
-
if (p && !
|
|
1043
|
-
const { value:
|
|
1044
|
-
if (
|
|
1045
|
+
if (p && !P && ye(k)) {
|
|
1046
|
+
const { value: $, message: L } = ke(p);
|
|
1047
|
+
if (We($) && !k.match($) && (A[C] = {
|
|
1045
1048
|
type: ge.pattern,
|
|
1046
|
-
message:
|
|
1047
|
-
ref:
|
|
1048
|
-
...re(ge.pattern,
|
|
1049
|
+
message: L,
|
|
1050
|
+
ref: a,
|
|
1051
|
+
...re(ge.pattern, L)
|
|
1049
1052
|
}, !n))
|
|
1050
|
-
return
|
|
1053
|
+
return T(L), A;
|
|
1051
1054
|
}
|
|
1052
1055
|
if (_) {
|
|
1053
1056
|
if (fe(_)) {
|
|
1054
|
-
const
|
|
1055
|
-
if (
|
|
1056
|
-
...
|
|
1057
|
-
...re(ge.validate,
|
|
1057
|
+
const $ = await _(k, s), L = Ot($, F);
|
|
1058
|
+
if (L && (A[C] = {
|
|
1059
|
+
...L,
|
|
1060
|
+
...re(ge.validate, L.message)
|
|
1058
1061
|
}, !n))
|
|
1059
|
-
return
|
|
1060
|
-
} else if (
|
|
1061
|
-
let
|
|
1062
|
-
for (const
|
|
1063
|
-
if (!
|
|
1062
|
+
return T(L.message), A;
|
|
1063
|
+
} else if (Q(_)) {
|
|
1064
|
+
let $ = {};
|
|
1065
|
+
for (const L in _) {
|
|
1066
|
+
if (!ee($) && !n)
|
|
1064
1067
|
break;
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1067
|
-
...
|
|
1068
|
-
...re(
|
|
1069
|
-
},
|
|
1068
|
+
const H = Ot(await _[L](k, s), F, L);
|
|
1069
|
+
H && ($ = {
|
|
1070
|
+
...H,
|
|
1071
|
+
...re(L, H.message)
|
|
1072
|
+
}, T(H.message), n && (A[C] = $));
|
|
1070
1073
|
}
|
|
1071
|
-
if (!
|
|
1072
|
-
ref:
|
|
1073
|
-
|
|
1074
|
+
if (!ee($) && (A[C] = {
|
|
1075
|
+
ref: F,
|
|
1076
|
+
...$
|
|
1074
1077
|
}, !n))
|
|
1075
|
-
return
|
|
1078
|
+
return A;
|
|
1076
1079
|
}
|
|
1077
1080
|
}
|
|
1078
|
-
return
|
|
1081
|
+
return T(!0), A;
|
|
1079
1082
|
};
|
|
1080
|
-
const
|
|
1083
|
+
const xr = {
|
|
1081
1084
|
mode: de.onSubmit,
|
|
1082
1085
|
reValidateMode: de.onChange,
|
|
1083
1086
|
shouldFocusError: !0
|
|
1084
1087
|
};
|
|
1085
|
-
function
|
|
1088
|
+
function Tr(e = {}) {
|
|
1086
1089
|
let t = {
|
|
1087
|
-
...
|
|
1090
|
+
...xr,
|
|
1088
1091
|
...e
|
|
1089
1092
|
}, s = {
|
|
1090
1093
|
submitCount: 0,
|
|
@@ -1101,18 +1104,18 @@ function kr(e = {}) {
|
|
|
1101
1104
|
validatingFields: {},
|
|
1102
1105
|
errors: t.errors || {},
|
|
1103
1106
|
disabled: t.disabled || !1
|
|
1104
|
-
}, n = {}, i =
|
|
1107
|
+
}, n = {}, i = Q(t.defaultValues) || Q(t.values) ? G(t.defaultValues || t.values) || {} : {}, r = t.shouldUnregister ? {} : G(i), a = {
|
|
1105
1108
|
action: !1,
|
|
1106
1109
|
mount: !1,
|
|
1107
1110
|
watch: !1
|
|
1108
|
-
},
|
|
1111
|
+
}, c = {
|
|
1109
1112
|
mount: /* @__PURE__ */ new Set(),
|
|
1110
1113
|
disabled: /* @__PURE__ */ new Set(),
|
|
1111
1114
|
unMount: /* @__PURE__ */ new Set(),
|
|
1112
1115
|
array: /* @__PURE__ */ new Set(),
|
|
1113
1116
|
watch: /* @__PURE__ */ new Set()
|
|
1114
|
-
},
|
|
1115
|
-
const
|
|
1117
|
+
}, l, m = 0;
|
|
1118
|
+
const y = {
|
|
1116
1119
|
isDirty: !1,
|
|
1117
1120
|
dirtyFields: !1,
|
|
1118
1121
|
validatingFields: !1,
|
|
@@ -1122,380 +1125,380 @@ function kr(e = {}) {
|
|
|
1122
1125
|
errors: !1
|
|
1123
1126
|
};
|
|
1124
1127
|
let g = {
|
|
1125
|
-
...
|
|
1128
|
+
...y
|
|
1126
1129
|
};
|
|
1127
|
-
const
|
|
1128
|
-
array:
|
|
1129
|
-
state:
|
|
1130
|
-
}, p = t.criteriaMode === de.all, _ = (
|
|
1131
|
-
clearTimeout(
|
|
1132
|
-
},
|
|
1133
|
-
if (!t.disabled && (
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
isValid:
|
|
1130
|
+
const f = {
|
|
1131
|
+
array: xt(),
|
|
1132
|
+
state: xt()
|
|
1133
|
+
}, p = t.criteriaMode === de.all, _ = (o) => (u) => {
|
|
1134
|
+
clearTimeout(m), m = setTimeout(o, u);
|
|
1135
|
+
}, C = async (o) => {
|
|
1136
|
+
if (!t.disabled && (y.isValid || g.isValid || o)) {
|
|
1137
|
+
const u = t.resolver ? ee((await M()).errors) : await P(n, !0);
|
|
1138
|
+
u !== s.isValid && f.state.next({
|
|
1139
|
+
isValid: u
|
|
1137
1140
|
});
|
|
1138
1141
|
}
|
|
1139
|
-
},
|
|
1140
|
-
!t.disabled && (
|
|
1141
|
-
|
|
1142
|
-
}),
|
|
1142
|
+
}, N = (o, u) => {
|
|
1143
|
+
!t.disabled && (y.isValidating || y.validatingFields || g.isValidating || g.validatingFields) && ((o || Array.from(c.mount)).forEach((d) => {
|
|
1144
|
+
d && (u ? q(s.validatingFields, d, u) : K(s.validatingFields, d));
|
|
1145
|
+
}), f.state.next({
|
|
1143
1146
|
validatingFields: s.validatingFields,
|
|
1144
|
-
isValidating: !
|
|
1147
|
+
isValidating: !ee(s.validatingFields)
|
|
1145
1148
|
}));
|
|
1146
|
-
},
|
|
1147
|
-
if (
|
|
1148
|
-
if (
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1149
|
+
}, B = (o, u = [], d, v, w = !0, b = !0) => {
|
|
1150
|
+
if (v && d && !t.disabled) {
|
|
1151
|
+
if (a.action = !0, b && Array.isArray(S(n, o))) {
|
|
1152
|
+
const E = d(S(n, o), v.argA, v.argB);
|
|
1153
|
+
w && q(n, o, E);
|
|
1151
1154
|
}
|
|
1152
|
-
if (
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1155
|
+
if (b && Array.isArray(S(s.errors, o))) {
|
|
1156
|
+
const E = d(S(s.errors, o), v.argA, v.argB);
|
|
1157
|
+
w && q(s.errors, o, E), kr(s.errors, o);
|
|
1155
1158
|
}
|
|
1156
|
-
if ((
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
+
if ((y.touchedFields || g.touchedFields) && b && Array.isArray(S(s.touchedFields, o))) {
|
|
1160
|
+
const E = d(S(s.touchedFields, o), v.argA, v.argB);
|
|
1161
|
+
w && q(s.touchedFields, o, E);
|
|
1159
1162
|
}
|
|
1160
|
-
(
|
|
1161
|
-
name:
|
|
1162
|
-
isDirty:
|
|
1163
|
+
(y.dirtyFields || g.dirtyFields) && (s.dirtyFields = $e(i, r)), f.state.next({
|
|
1164
|
+
name: o,
|
|
1165
|
+
isDirty: ae(o, u),
|
|
1163
1166
|
dirtyFields: s.dirtyFields,
|
|
1164
1167
|
errors: s.errors,
|
|
1165
1168
|
isValid: s.isValid
|
|
1166
1169
|
});
|
|
1167
1170
|
} else
|
|
1168
|
-
|
|
1169
|
-
},
|
|
1170
|
-
|
|
1171
|
+
q(r, o, u);
|
|
1172
|
+
}, k = (o, u) => {
|
|
1173
|
+
q(s.errors, o, u), f.state.next({
|
|
1171
1174
|
errors: s.errors
|
|
1172
1175
|
});
|
|
1173
|
-
},
|
|
1174
|
-
s.errors =
|
|
1176
|
+
}, F = (o) => {
|
|
1177
|
+
s.errors = o, f.state.next({
|
|
1175
1178
|
errors: s.errors,
|
|
1176
1179
|
isValid: !1
|
|
1177
1180
|
});
|
|
1178
|
-
},
|
|
1179
|
-
const
|
|
1180
|
-
if (
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1181
|
+
}, T = (o, u, d, v) => {
|
|
1182
|
+
const w = S(n, o);
|
|
1183
|
+
if (w) {
|
|
1184
|
+
const b = S(r, o, j(d) ? S(i, o) : d);
|
|
1185
|
+
j(b) || v && v.defaultChecked || u ? q(r, o, u ? b : Lt(w._f)) : H(o, b), a.mount && C();
|
|
1183
1186
|
}
|
|
1184
|
-
},
|
|
1185
|
-
let
|
|
1186
|
-
const
|
|
1187
|
-
name:
|
|
1187
|
+
}, A = (o, u, d, v, w) => {
|
|
1188
|
+
let b = !1, E = !1;
|
|
1189
|
+
const O = {
|
|
1190
|
+
name: o
|
|
1188
1191
|
};
|
|
1189
1192
|
if (!t.disabled) {
|
|
1190
|
-
if (!
|
|
1191
|
-
(
|
|
1192
|
-
const U = ve(S(i,
|
|
1193
|
-
|
|
1193
|
+
if (!d || v) {
|
|
1194
|
+
(y.isDirty || g.isDirty) && (E = s.isDirty, s.isDirty = O.isDirty = ae(), b = E !== O.isDirty);
|
|
1195
|
+
const U = ve(S(i, o), u);
|
|
1196
|
+
E = !!S(s.dirtyFields, o), U ? K(s.dirtyFields, o) : q(s.dirtyFields, o, !0), O.dirtyFields = s.dirtyFields, b = b || (y.dirtyFields || g.dirtyFields) && E !== !U;
|
|
1194
1197
|
}
|
|
1195
|
-
if (
|
|
1196
|
-
const U = S(s.touchedFields,
|
|
1197
|
-
U || (
|
|
1198
|
+
if (d) {
|
|
1199
|
+
const U = S(s.touchedFields, o);
|
|
1200
|
+
U || (q(s.touchedFields, o, d), O.touchedFields = s.touchedFields, b = b || (y.touchedFields || g.touchedFields) && U !== d);
|
|
1198
1201
|
}
|
|
1199
|
-
|
|
1202
|
+
b && w && f.state.next(O);
|
|
1200
1203
|
}
|
|
1201
|
-
return
|
|
1202
|
-
},
|
|
1203
|
-
const
|
|
1204
|
-
if (t.delayError &&
|
|
1205
|
-
const
|
|
1206
|
-
...
|
|
1207
|
-
...
|
|
1204
|
+
return b ? O : {};
|
|
1205
|
+
}, I = (o, u, d, v) => {
|
|
1206
|
+
const w = S(s.errors, o), b = (y.isValid || g.isValid) && he(u) && s.isValid !== u;
|
|
1207
|
+
if (t.delayError && d ? (l = _(() => k(o, d)), l(t.delayError)) : (clearTimeout(m), l = null, d ? q(s.errors, o, d) : K(s.errors, o)), (d ? !ve(w, d) : w) || !ee(v) || b) {
|
|
1208
|
+
const E = {
|
|
1209
|
+
...v,
|
|
1210
|
+
...b && he(u) ? { isValid: u } : {},
|
|
1208
1211
|
errors: s.errors,
|
|
1209
|
-
name:
|
|
1212
|
+
name: o
|
|
1210
1213
|
};
|
|
1211
1214
|
s = {
|
|
1212
1215
|
...s,
|
|
1213
|
-
...
|
|
1214
|
-
},
|
|
1216
|
+
...E
|
|
1217
|
+
}, f.state.next(E);
|
|
1215
1218
|
}
|
|
1216
|
-
},
|
|
1217
|
-
|
|
1218
|
-
const
|
|
1219
|
-
return
|
|
1220
|
-
},
|
|
1221
|
-
const { errors:
|
|
1222
|
-
if (
|
|
1223
|
-
for (const
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1219
|
+
}, M = async (o) => {
|
|
1220
|
+
N(o, !0);
|
|
1221
|
+
const u = await t.resolver(r, t.context, vr(o || c.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
1222
|
+
return N(o), u;
|
|
1223
|
+
}, se = async (o) => {
|
|
1224
|
+
const { errors: u } = await M(o);
|
|
1225
|
+
if (o)
|
|
1226
|
+
for (const d of o) {
|
|
1227
|
+
const v = S(u, d);
|
|
1228
|
+
v ? q(s.errors, d, v) : K(s.errors, d);
|
|
1226
1229
|
}
|
|
1227
1230
|
else
|
|
1228
|
-
s.errors =
|
|
1229
|
-
return
|
|
1230
|
-
},
|
|
1231
|
+
s.errors = u;
|
|
1232
|
+
return u;
|
|
1233
|
+
}, P = async (o, u, d = {
|
|
1231
1234
|
valid: !0
|
|
1232
1235
|
}) => {
|
|
1233
|
-
for (const
|
|
1234
|
-
const
|
|
1235
|
-
if (
|
|
1236
|
-
const { _f:
|
|
1237
|
-
if (
|
|
1238
|
-
const
|
|
1239
|
-
U &&
|
|
1240
|
-
const oe = await
|
|
1241
|
-
if (U &&
|
|
1236
|
+
for (const v in o) {
|
|
1237
|
+
const w = o[v];
|
|
1238
|
+
if (w) {
|
|
1239
|
+
const { _f: b, ...E } = w;
|
|
1240
|
+
if (b) {
|
|
1241
|
+
const O = c.array.has(b.name), U = w._f && _r(w._f);
|
|
1242
|
+
U && y.validatingFields && N([v], !0);
|
|
1243
|
+
const oe = await Mt(w, c.disabled, r, p, t.shouldUseNativeValidation && !u, O);
|
|
1244
|
+
if (U && y.validatingFields && N([v]), oe[b.name] && (d.valid = !1, u))
|
|
1242
1245
|
break;
|
|
1243
|
-
!
|
|
1246
|
+
!u && (S(oe, b.name) ? O ? Ar(s.errors, oe, b.name) : q(s.errors, b.name, oe[b.name]) : K(s.errors, b.name));
|
|
1244
1247
|
}
|
|
1245
|
-
!
|
|
1248
|
+
!ee(E) && await P(E, u, d);
|
|
1246
1249
|
}
|
|
1247
1250
|
}
|
|
1248
|
-
return
|
|
1251
|
+
return d.valid;
|
|
1249
1252
|
}, re = () => {
|
|
1250
|
-
for (const
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1253
|
+
for (const o of c.unMount) {
|
|
1254
|
+
const u = S(n, o);
|
|
1255
|
+
u && (u._f.refs ? u._f.refs.every((d) => !rt(d)) : !rt(u._f.ref)) && Ye(o);
|
|
1253
1256
|
}
|
|
1254
|
-
|
|
1255
|
-
},
|
|
1256
|
-
...
|
|
1257
|
-
},
|
|
1258
|
-
const
|
|
1259
|
-
let
|
|
1260
|
-
if (
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
(!
|
|
1264
|
-
}) :
|
|
1265
|
-
name:
|
|
1266
|
-
values:
|
|
1257
|
+
c.unMount = /* @__PURE__ */ new Set();
|
|
1258
|
+
}, ae = (o, u) => !t.disabled && (o && u && q(r, o, u), !ve(ue(), i)), $ = (o, u, d) => yr(o, c, {
|
|
1259
|
+
...a.mount ? r : j(u) ? i : ye(o) ? { [o]: u } : u
|
|
1260
|
+
}, d, u), L = (o) => ot(S(a.mount ? r : i, o, t.shouldUnregister ? S(i, o, []) : [])), H = (o, u, d = {}) => {
|
|
1261
|
+
const v = S(n, o);
|
|
1262
|
+
let w = u;
|
|
1263
|
+
if (v) {
|
|
1264
|
+
const b = v._f;
|
|
1265
|
+
b && (!b.disabled && q(r, o, ls(u, b)), w = Ke(b.ref) && Z(u) ? "" : u, is(b.ref) ? [...b.ref.options].forEach((E) => E.selected = w.includes(E.value)) : b.refs ? Ue(b.ref) ? b.refs.forEach((E) => {
|
|
1266
|
+
(!E.defaultChecked || !E.disabled) && (Array.isArray(w) ? E.checked = !!w.find((O) => O === E.value) : E.checked = w === E.value || !!w);
|
|
1267
|
+
}) : b.refs.forEach((E) => E.checked = E.value === w) : lt(b.ref) ? b.ref.value = "" : (b.ref.value = w, b.ref.type || f.state.next({
|
|
1268
|
+
name: o,
|
|
1269
|
+
values: G(r)
|
|
1267
1270
|
})));
|
|
1268
1271
|
}
|
|
1269
|
-
(
|
|
1270
|
-
},
|
|
1271
|
-
for (const
|
|
1272
|
-
if (!
|
|
1272
|
+
(d.shouldDirty || d.shouldTouch) && A(o, w, d.shouldTouch, d.shouldDirty, !0), d.shouldValidate && ne(o);
|
|
1273
|
+
}, W = (o, u, d) => {
|
|
1274
|
+
for (const v in u) {
|
|
1275
|
+
if (!u.hasOwnProperty(v))
|
|
1273
1276
|
return;
|
|
1274
|
-
const
|
|
1275
|
-
(
|
|
1277
|
+
const w = u[v], b = o + "." + v, E = S(n, b);
|
|
1278
|
+
(c.array.has(o) || Q(w) || E && !E._f) && !Ee(w) ? W(b, w, d) : H(b, w, d);
|
|
1276
1279
|
}
|
|
1277
|
-
},
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
name:
|
|
1281
|
-
values:
|
|
1282
|
-
}), (
|
|
1283
|
-
name:
|
|
1280
|
+
}, Y = (o, u, d = {}) => {
|
|
1281
|
+
const v = S(n, o), w = c.array.has(o), b = G(u);
|
|
1282
|
+
q(r, o, b), w ? (f.array.next({
|
|
1283
|
+
name: o,
|
|
1284
|
+
values: G(r)
|
|
1285
|
+
}), (y.isDirty || y.dirtyFields || g.isDirty || g.dirtyFields) && d.shouldDirty && f.state.next({
|
|
1286
|
+
name: o,
|
|
1284
1287
|
dirtyFields: $e(i, r),
|
|
1285
|
-
isDirty:
|
|
1286
|
-
})) :
|
|
1287
|
-
name:
|
|
1288
|
-
values:
|
|
1288
|
+
isDirty: ae(o, b)
|
|
1289
|
+
})) : v && !v._f && !Z(b) ? W(o, b, d) : H(o, b, d), It(o, c) && f.state.next({ ...s, name: o }), f.state.next({
|
|
1290
|
+
name: a.mount ? o : void 0,
|
|
1291
|
+
values: G(r)
|
|
1289
1292
|
});
|
|
1290
|
-
},
|
|
1291
|
-
|
|
1292
|
-
const
|
|
1293
|
-
let
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
},
|
|
1297
|
-
if (
|
|
1293
|
+
}, R = async (o) => {
|
|
1294
|
+
a.mount = !0;
|
|
1295
|
+
const u = o.target;
|
|
1296
|
+
let d = u.name, v = !0;
|
|
1297
|
+
const w = S(n, d), b = (U) => {
|
|
1298
|
+
v = Number.isNaN(U) || Ee(U) && isNaN(U.getTime()) || ve(U, S(r, d, U));
|
|
1299
|
+
}, E = Dt(t.mode), O = Dt(t.reValidateMode);
|
|
1300
|
+
if (w) {
|
|
1298
1301
|
let U, oe;
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1301
|
-
const
|
|
1302
|
-
if (!we &&
|
|
1303
|
-
name:
|
|
1304
|
-
type:
|
|
1305
|
-
values:
|
|
1306
|
-
}),
|
|
1307
|
-
return (
|
|
1308
|
-
if (!we &&
|
|
1309
|
-
const { errors:
|
|
1310
|
-
if (
|
|
1311
|
-
const
|
|
1312
|
-
U =
|
|
1302
|
+
const He = u.type ? Lt(w._f) : cr(o), we = o.type === At.BLUR || o.type === At.FOCUS_OUT, vs = !Sr(w._f) && !t.resolver && !S(s.errors, d) && !w._f.deps || Nr(we, S(s.touchedFields, d), s.isSubmitted, O, E), et = It(d, c, we);
|
|
1303
|
+
q(r, d, He), we ? (w._f.onBlur && w._f.onBlur(o), l && l(0)) : w._f.onChange && w._f.onChange(o);
|
|
1304
|
+
const tt = A(d, He, we), _s = !ee(tt) || et;
|
|
1305
|
+
if (!we && f.state.next({
|
|
1306
|
+
name: d,
|
|
1307
|
+
type: o.type,
|
|
1308
|
+
values: G(r)
|
|
1309
|
+
}), vs)
|
|
1310
|
+
return (y.isValid || g.isValid) && (t.mode === "onBlur" ? we && C() : we || C()), _s && f.state.next({ name: d, ...et ? {} : tt });
|
|
1311
|
+
if (!we && et && f.state.next({ ...s }), t.resolver) {
|
|
1312
|
+
const { errors: vt } = await M([d]);
|
|
1313
|
+
if (b(He), v) {
|
|
1314
|
+
const Ss = Pt(s.errors, n, d), _t = Pt(vt, n, Ss.name || d);
|
|
1315
|
+
U = _t.error, d = _t.name, oe = ee(vt);
|
|
1313
1316
|
}
|
|
1314
1317
|
} else
|
|
1315
|
-
|
|
1316
|
-
|
|
1318
|
+
N([d], !0), U = (await Mt(w, c.disabled, r, p, t.shouldUseNativeValidation))[d], N([d]), b(He), v && (U ? oe = !1 : (y.isValid || g.isValid) && (oe = await P(n, !0)));
|
|
1319
|
+
v && (w._f.deps && ne(w._f.deps), I(d, oe, U, tt));
|
|
1317
1320
|
}
|
|
1318
|
-
}, X = (
|
|
1319
|
-
if (S(s.errors,
|
|
1320
|
-
return
|
|
1321
|
-
}, ne = async (
|
|
1322
|
-
let
|
|
1323
|
-
const
|
|
1321
|
+
}, X = (o, u) => {
|
|
1322
|
+
if (S(s.errors, u) && o.focus)
|
|
1323
|
+
return o.focus(), 1;
|
|
1324
|
+
}, ne = async (o, u = {}) => {
|
|
1325
|
+
let d, v;
|
|
1326
|
+
const w = Le(o);
|
|
1324
1327
|
if (t.resolver) {
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1327
|
-
} else
|
|
1328
|
-
const
|
|
1329
|
-
return await
|
|
1330
|
-
}))).every(Boolean), !(!
|
|
1331
|
-
return
|
|
1332
|
-
...!ye(
|
|
1333
|
-
...t.resolver || !
|
|
1328
|
+
const b = await se(j(o) ? o : w);
|
|
1329
|
+
d = ee(b), v = o ? !w.some((E) => S(b, E)) : d;
|
|
1330
|
+
} else o ? (v = (await Promise.all(w.map(async (b) => {
|
|
1331
|
+
const E = S(n, b);
|
|
1332
|
+
return await P(E && E._f ? { [b]: E } : E);
|
|
1333
|
+
}))).every(Boolean), !(!v && !s.isValid) && C()) : v = d = await P(n);
|
|
1334
|
+
return f.state.next({
|
|
1335
|
+
...!ye(o) || (y.isValid || g.isValid) && d !== s.isValid ? {} : { name: o },
|
|
1336
|
+
...t.resolver || !o ? { isValid: d } : {},
|
|
1334
1337
|
errors: s.errors
|
|
1335
|
-
}),
|
|
1336
|
-
}, ue = (
|
|
1337
|
-
const
|
|
1338
|
-
...
|
|
1338
|
+
}), u.shouldFocus && !v && De(n, X, o ? w : c.mount), v;
|
|
1339
|
+
}, ue = (o) => {
|
|
1340
|
+
const u = {
|
|
1341
|
+
...a.mount ? r : i
|
|
1339
1342
|
};
|
|
1340
|
-
return
|
|
1341
|
-
},
|
|
1342
|
-
invalid: !!S((
|
|
1343
|
-
isDirty: !!S((
|
|
1344
|
-
error: S((
|
|
1345
|
-
isValidating: !!S(s.validatingFields,
|
|
1346
|
-
isTouched: !!S((
|
|
1347
|
-
}),
|
|
1348
|
-
|
|
1349
|
-
errors:
|
|
1343
|
+
return j(o) ? u : ye(o) ? S(u, o) : o.map((d) => S(u, d));
|
|
1344
|
+
}, qe = (o, u) => ({
|
|
1345
|
+
invalid: !!S((u || s).errors, o),
|
|
1346
|
+
isDirty: !!S((u || s).dirtyFields, o),
|
|
1347
|
+
error: S((u || s).errors, o),
|
|
1348
|
+
isValidating: !!S(s.validatingFields, o),
|
|
1349
|
+
isTouched: !!S((u || s).touchedFields, o)
|
|
1350
|
+
}), Ce = (o) => {
|
|
1351
|
+
o && Le(o).forEach((u) => K(s.errors, u)), f.state.next({
|
|
1352
|
+
errors: o ? s.errors : {}
|
|
1350
1353
|
});
|
|
1351
|
-
},
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1354
|
+
}, mt = (o, u, d) => {
|
|
1355
|
+
const v = (S(n, o, { _f: {} })._f || {}).ref, w = S(s.errors, o) || {}, { ref: b, message: E, type: O, ...U } = w;
|
|
1356
|
+
q(s.errors, o, {
|
|
1354
1357
|
...U,
|
|
1355
|
-
...
|
|
1356
|
-
ref:
|
|
1357
|
-
}),
|
|
1358
|
-
name:
|
|
1358
|
+
...u,
|
|
1359
|
+
ref: v
|
|
1360
|
+
}), f.state.next({
|
|
1361
|
+
name: o,
|
|
1359
1362
|
errors: s.errors,
|
|
1360
1363
|
isValid: !1
|
|
1361
|
-
}),
|
|
1362
|
-
},
|
|
1363
|
-
next: (
|
|
1364
|
-
}) :
|
|
1365
|
-
next: (
|
|
1366
|
-
|
|
1364
|
+
}), d && d.shouldFocus && v && v.focus && v.focus();
|
|
1365
|
+
}, hs = (o, u) => fe(o) ? f.state.subscribe({
|
|
1366
|
+
next: (d) => "values" in d && o($(void 0, u), d)
|
|
1367
|
+
}) : $(o, u, !0), ht = (o) => f.state.subscribe({
|
|
1368
|
+
next: (u) => {
|
|
1369
|
+
Er(o.name, u.name, o.exact) && Cr(u, o.formState || y, ws, o.reRenderRoot) && o.callback({
|
|
1367
1370
|
values: { ...r },
|
|
1368
1371
|
...s,
|
|
1369
|
-
...
|
|
1372
|
+
...u,
|
|
1370
1373
|
defaultValues: i
|
|
1371
1374
|
});
|
|
1372
1375
|
}
|
|
1373
|
-
}).unsubscribe,
|
|
1376
|
+
}).unsubscribe, ys = (o) => (a.mount = !0, g = {
|
|
1374
1377
|
...g,
|
|
1375
|
-
...
|
|
1376
|
-
},
|
|
1377
|
-
...
|
|
1378
|
+
...o.formState
|
|
1379
|
+
}, ht({
|
|
1380
|
+
...o,
|
|
1378
1381
|
formState: g
|
|
1379
|
-
})),
|
|
1380
|
-
for (const
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
values:
|
|
1384
|
-
}),
|
|
1382
|
+
})), Ye = (o, u = {}) => {
|
|
1383
|
+
for (const d of o ? Le(o) : c.mount)
|
|
1384
|
+
c.mount.delete(d), c.array.delete(d), u.keepValue || (K(n, d), K(r, d)), !u.keepError && K(s.errors, d), !u.keepDirty && K(s.dirtyFields, d), !u.keepTouched && K(s.touchedFields, d), !u.keepIsValidating && K(s.validatingFields, d), !t.shouldUnregister && !u.keepDefaultValue && K(i, d);
|
|
1385
|
+
f.state.next({
|
|
1386
|
+
values: G(r)
|
|
1387
|
+
}), f.state.next({
|
|
1385
1388
|
...s,
|
|
1386
|
-
...
|
|
1387
|
-
}), !
|
|
1388
|
-
},
|
|
1389
|
-
(he(
|
|
1390
|
-
},
|
|
1391
|
-
let
|
|
1392
|
-
const
|
|
1393
|
-
return
|
|
1394
|
-
...
|
|
1389
|
+
...u.keepDirty ? { isDirty: ae() } : {}
|
|
1390
|
+
}), !u.keepIsValid && C();
|
|
1391
|
+
}, yt = ({ disabled: o, name: u }) => {
|
|
1392
|
+
(he(o) && a.mount || o || c.disabled.has(u)) && (o ? c.disabled.add(u) : c.disabled.delete(u));
|
|
1393
|
+
}, Xe = (o, u = {}) => {
|
|
1394
|
+
let d = S(n, o);
|
|
1395
|
+
const v = he(u.disabled) || he(t.disabled);
|
|
1396
|
+
return q(n, o, {
|
|
1397
|
+
...d || {},
|
|
1395
1398
|
_f: {
|
|
1396
|
-
...
|
|
1397
|
-
name:
|
|
1399
|
+
...d && d._f ? d._f : { ref: { name: o } },
|
|
1400
|
+
name: o,
|
|
1398
1401
|
mount: !0,
|
|
1399
|
-
...
|
|
1402
|
+
...u
|
|
1400
1403
|
}
|
|
1401
|
-
}),
|
|
1402
|
-
disabled: he(
|
|
1403
|
-
name:
|
|
1404
|
-
}) :
|
|
1405
|
-
...
|
|
1404
|
+
}), c.mount.add(o), d ? yt({
|
|
1405
|
+
disabled: he(u.disabled) ? u.disabled : t.disabled,
|
|
1406
|
+
name: o
|
|
1407
|
+
}) : T(o, !0, u.value), {
|
|
1408
|
+
...v ? { disabled: u.disabled || t.disabled } : {},
|
|
1406
1409
|
...t.progressive ? {
|
|
1407
|
-
required: !!
|
|
1408
|
-
min: Fe(
|
|
1409
|
-
max: Fe(
|
|
1410
|
-
minLength: Fe(
|
|
1411
|
-
maxLength: Fe(
|
|
1412
|
-
pattern: Fe(
|
|
1410
|
+
required: !!u.required,
|
|
1411
|
+
min: Fe(u.min),
|
|
1412
|
+
max: Fe(u.max),
|
|
1413
|
+
minLength: Fe(u.minLength),
|
|
1414
|
+
maxLength: Fe(u.maxLength),
|
|
1415
|
+
pattern: Fe(u.pattern)
|
|
1413
1416
|
} : {},
|
|
1414
|
-
name:
|
|
1415
|
-
onChange:
|
|
1416
|
-
onBlur:
|
|
1417
|
-
ref: (
|
|
1418
|
-
if (
|
|
1419
|
-
|
|
1420
|
-
const
|
|
1421
|
-
if (
|
|
1417
|
+
name: o,
|
|
1418
|
+
onChange: R,
|
|
1419
|
+
onBlur: R,
|
|
1420
|
+
ref: (w) => {
|
|
1421
|
+
if (w) {
|
|
1422
|
+
Xe(o, u), d = S(n, o);
|
|
1423
|
+
const b = j(w.value) && w.querySelectorAll && w.querySelectorAll("input,select,textarea")[0] || w, E = pr(b), O = d._f.refs || [];
|
|
1424
|
+
if (E ? O.find((U) => U === b) : b === d._f.ref)
|
|
1422
1425
|
return;
|
|
1423
|
-
|
|
1426
|
+
q(n, o, {
|
|
1424
1427
|
_f: {
|
|
1425
|
-
...
|
|
1426
|
-
...
|
|
1428
|
+
...d._f,
|
|
1429
|
+
...E ? {
|
|
1427
1430
|
refs: [
|
|
1428
|
-
...
|
|
1429
|
-
|
|
1430
|
-
...Array.isArray(S(i,
|
|
1431
|
+
...O.filter(rt),
|
|
1432
|
+
b,
|
|
1433
|
+
...Array.isArray(S(i, o)) ? [{}] : []
|
|
1431
1434
|
],
|
|
1432
|
-
ref: { type:
|
|
1433
|
-
} : { ref:
|
|
1435
|
+
ref: { type: b.type, name: o }
|
|
1436
|
+
} : { ref: b }
|
|
1434
1437
|
}
|
|
1435
|
-
}),
|
|
1438
|
+
}), T(o, !1, void 0, b);
|
|
1436
1439
|
} else
|
|
1437
|
-
|
|
1440
|
+
d = S(n, o, {}), d._f && (d._f.mount = !1), (t.shouldUnregister || u.shouldUnregister) && !(ur(c.array, o) && a.action) && c.unMount.add(o);
|
|
1438
1441
|
}
|
|
1439
1442
|
};
|
|
1440
|
-
},
|
|
1441
|
-
he(
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1444
|
-
|
|
1443
|
+
}, Ze = () => t.shouldFocusError && De(n, X, c.mount), gs = (o) => {
|
|
1444
|
+
he(o) && (f.state.next({ disabled: o }), De(n, (u, d) => {
|
|
1445
|
+
const v = S(n, d);
|
|
1446
|
+
v && (u.disabled = v._f.disabled || o, Array.isArray(v._f.refs) && v._f.refs.forEach((w) => {
|
|
1447
|
+
w.disabled = v._f.disabled || o;
|
|
1445
1448
|
}));
|
|
1446
1449
|
}, 0, !1));
|
|
1447
|
-
},
|
|
1448
|
-
let
|
|
1449
|
-
|
|
1450
|
-
let
|
|
1451
|
-
if (
|
|
1450
|
+
}, gt = (o, u) => async (d) => {
|
|
1451
|
+
let v;
|
|
1452
|
+
d && (d.preventDefault && d.preventDefault(), d.persist && d.persist());
|
|
1453
|
+
let w = G(r);
|
|
1454
|
+
if (f.state.next({
|
|
1452
1455
|
isSubmitting: !0
|
|
1453
1456
|
}), t.resolver) {
|
|
1454
|
-
const { errors:
|
|
1455
|
-
s.errors =
|
|
1457
|
+
const { errors: b, values: E } = await M();
|
|
1458
|
+
s.errors = b, w = G(E);
|
|
1456
1459
|
} else
|
|
1457
|
-
await
|
|
1458
|
-
if (
|
|
1459
|
-
for (const
|
|
1460
|
-
|
|
1461
|
-
if (
|
|
1462
|
-
|
|
1460
|
+
await P(n);
|
|
1461
|
+
if (c.disabled.size)
|
|
1462
|
+
for (const b of c.disabled)
|
|
1463
|
+
K(w, b);
|
|
1464
|
+
if (K(s.errors, "root"), ee(s.errors)) {
|
|
1465
|
+
f.state.next({
|
|
1463
1466
|
errors: {}
|
|
1464
1467
|
});
|
|
1465
1468
|
try {
|
|
1466
|
-
await
|
|
1467
|
-
} catch (
|
|
1468
|
-
|
|
1469
|
+
await o(w, d);
|
|
1470
|
+
} catch (b) {
|
|
1471
|
+
v = b;
|
|
1469
1472
|
}
|
|
1470
1473
|
} else
|
|
1471
|
-
|
|
1472
|
-
if (
|
|
1474
|
+
u && await u({ ...s.errors }, d), Ze(), setTimeout(Ze);
|
|
1475
|
+
if (f.state.next({
|
|
1473
1476
|
isSubmitted: !0,
|
|
1474
1477
|
isSubmitting: !1,
|
|
1475
|
-
isSubmitSuccessful:
|
|
1478
|
+
isSubmitSuccessful: ee(s.errors) && !v,
|
|
1476
1479
|
submitCount: s.submitCount + 1,
|
|
1477
1480
|
errors: s.errors
|
|
1478
|
-
}),
|
|
1479
|
-
throw
|
|
1480
|
-
},
|
|
1481
|
-
S(n,
|
|
1482
|
-
},
|
|
1483
|
-
const
|
|
1484
|
-
if (
|
|
1485
|
-
if (
|
|
1486
|
-
const
|
|
1487
|
-
...
|
|
1481
|
+
}), v)
|
|
1482
|
+
throw v;
|
|
1483
|
+
}, ps = (o, u = {}) => {
|
|
1484
|
+
S(n, o) && (j(u.defaultValue) ? Y(o, G(S(i, o))) : (Y(o, u.defaultValue), q(i, o, G(u.defaultValue))), u.keepTouched || K(s.touchedFields, o), u.keepDirty || (K(s.dirtyFields, o), s.isDirty = u.defaultValue ? ae(o, G(S(i, o))) : ae()), u.keepError || (K(s.errors, o), y.isValid && C()), f.state.next({ ...s }));
|
|
1485
|
+
}, pt = (o, u = {}) => {
|
|
1486
|
+
const d = o ? G(o) : i, v = G(d), w = ee(o), b = w ? i : v;
|
|
1487
|
+
if (u.keepDefaultValues || (i = d), !u.keepValues) {
|
|
1488
|
+
if (u.keepDirtyValues) {
|
|
1489
|
+
const E = /* @__PURE__ */ new Set([
|
|
1490
|
+
...c.mount,
|
|
1488
1491
|
...Object.keys($e(i, r))
|
|
1489
1492
|
]);
|
|
1490
|
-
for (const
|
|
1491
|
-
S(s.dirtyFields,
|
|
1493
|
+
for (const O of Array.from(E))
|
|
1494
|
+
S(s.dirtyFields, O) ? q(b, O, S(r, O)) : Y(O, S(b, O));
|
|
1492
1495
|
} else {
|
|
1493
|
-
if (
|
|
1494
|
-
for (const
|
|
1495
|
-
const
|
|
1496
|
-
if (
|
|
1497
|
-
const U = Array.isArray(
|
|
1498
|
-
if (
|
|
1496
|
+
if (at && j(o))
|
|
1497
|
+
for (const E of c.mount) {
|
|
1498
|
+
const O = S(n, E);
|
|
1499
|
+
if (O && O._f) {
|
|
1500
|
+
const U = Array.isArray(O._f.refs) ? O._f.refs[0] : O._f.ref;
|
|
1501
|
+
if (Ke(U)) {
|
|
1499
1502
|
const oe = U.closest("form");
|
|
1500
1503
|
if (oe) {
|
|
1501
1504
|
oe.reset();
|
|
@@ -1504,74 +1507,74 @@ function kr(e = {}) {
|
|
|
1504
1507
|
}
|
|
1505
1508
|
}
|
|
1506
1509
|
}
|
|
1507
|
-
if (
|
|
1508
|
-
for (const
|
|
1509
|
-
|
|
1510
|
+
if (u.keepFieldsRef)
|
|
1511
|
+
for (const E of c.mount)
|
|
1512
|
+
Y(E, S(b, E));
|
|
1510
1513
|
else
|
|
1511
1514
|
n = {};
|
|
1512
1515
|
}
|
|
1513
|
-
r = t.shouldUnregister ?
|
|
1514
|
-
values: { ...
|
|
1515
|
-
}),
|
|
1516
|
-
values: { ...
|
|
1516
|
+
r = t.shouldUnregister ? u.keepDefaultValues ? G(i) : {} : G(b), f.array.next({
|
|
1517
|
+
values: { ...b }
|
|
1518
|
+
}), f.state.next({
|
|
1519
|
+
values: { ...b }
|
|
1517
1520
|
});
|
|
1518
1521
|
}
|
|
1519
|
-
|
|
1520
|
-
mount:
|
|
1522
|
+
c = {
|
|
1523
|
+
mount: u.keepDirtyValues ? c.mount : /* @__PURE__ */ new Set(),
|
|
1521
1524
|
unMount: /* @__PURE__ */ new Set(),
|
|
1522
1525
|
array: /* @__PURE__ */ new Set(),
|
|
1523
1526
|
disabled: /* @__PURE__ */ new Set(),
|
|
1524
1527
|
watch: /* @__PURE__ */ new Set(),
|
|
1525
1528
|
watchAll: !1,
|
|
1526
1529
|
focus: ""
|
|
1527
|
-
},
|
|
1528
|
-
submitCount:
|
|
1529
|
-
isDirty:
|
|
1530
|
-
isSubmitted:
|
|
1531
|
-
dirtyFields:
|
|
1532
|
-
touchedFields:
|
|
1533
|
-
errors:
|
|
1534
|
-
isSubmitSuccessful:
|
|
1530
|
+
}, a.mount = !y.isValid || !!u.keepIsValid || !!u.keepDirtyValues, a.watch = !!t.shouldUnregister, f.state.next({
|
|
1531
|
+
submitCount: u.keepSubmitCount ? s.submitCount : 0,
|
|
1532
|
+
isDirty: w ? !1 : u.keepDirty ? s.isDirty : !!(u.keepDefaultValues && !ve(o, i)),
|
|
1533
|
+
isSubmitted: u.keepIsSubmitted ? s.isSubmitted : !1,
|
|
1534
|
+
dirtyFields: w ? {} : u.keepDirtyValues ? u.keepDefaultValues && r ? $e(i, r) : s.dirtyFields : u.keepDefaultValues && o ? $e(i, o) : u.keepDirty ? s.dirtyFields : {},
|
|
1535
|
+
touchedFields: u.keepTouched ? s.touchedFields : {},
|
|
1536
|
+
errors: u.keepErrors ? s.errors : {},
|
|
1537
|
+
isSubmitSuccessful: u.keepIsSubmitSuccessful ? s.isSubmitSuccessful : !1,
|
|
1535
1538
|
isSubmitting: !1
|
|
1536
1539
|
});
|
|
1537
|
-
},
|
|
1538
|
-
const
|
|
1539
|
-
if (
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1540
|
+
}, bt = (o, u) => pt(fe(o) ? o(r) : o, u), bs = (o, u = {}) => {
|
|
1541
|
+
const d = S(n, o), v = d && d._f;
|
|
1542
|
+
if (v) {
|
|
1543
|
+
const w = v.refs ? v.refs[0] : v.ref;
|
|
1544
|
+
w.focus && (w.focus(), u.shouldSelect && fe(w.select) && w.select());
|
|
1542
1545
|
}
|
|
1543
|
-
},
|
|
1546
|
+
}, ws = (o) => {
|
|
1544
1547
|
s = {
|
|
1545
1548
|
...s,
|
|
1546
|
-
...
|
|
1549
|
+
...o
|
|
1547
1550
|
};
|
|
1548
|
-
},
|
|
1551
|
+
}, wt = {
|
|
1549
1552
|
control: {
|
|
1550
|
-
register:
|
|
1551
|
-
unregister:
|
|
1552
|
-
getFieldState:
|
|
1553
|
-
handleSubmit:
|
|
1554
|
-
setError:
|
|
1555
|
-
_subscribe:
|
|
1556
|
-
_runSchema:
|
|
1557
|
-
_focusError:
|
|
1558
|
-
_getWatch:
|
|
1559
|
-
_getDirty:
|
|
1560
|
-
_setValid:
|
|
1561
|
-
_setFieldArray:
|
|
1562
|
-
_setDisabledField:
|
|
1563
|
-
_setErrors:
|
|
1564
|
-
_getFieldArray:
|
|
1565
|
-
_reset:
|
|
1566
|
-
_resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((
|
|
1567
|
-
|
|
1553
|
+
register: Xe,
|
|
1554
|
+
unregister: Ye,
|
|
1555
|
+
getFieldState: qe,
|
|
1556
|
+
handleSubmit: gt,
|
|
1557
|
+
setError: mt,
|
|
1558
|
+
_subscribe: ht,
|
|
1559
|
+
_runSchema: M,
|
|
1560
|
+
_focusError: Ze,
|
|
1561
|
+
_getWatch: $,
|
|
1562
|
+
_getDirty: ae,
|
|
1563
|
+
_setValid: C,
|
|
1564
|
+
_setFieldArray: B,
|
|
1565
|
+
_setDisabledField: yt,
|
|
1566
|
+
_setErrors: F,
|
|
1567
|
+
_getFieldArray: L,
|
|
1568
|
+
_reset: pt,
|
|
1569
|
+
_resetDefaultValues: () => fe(t.defaultValues) && t.defaultValues().then((o) => {
|
|
1570
|
+
bt(o, t.resetOptions), f.state.next({
|
|
1568
1571
|
isLoading: !1
|
|
1569
1572
|
});
|
|
1570
1573
|
}),
|
|
1571
1574
|
_removeUnmounted: re,
|
|
1572
|
-
_disableForm:
|
|
1573
|
-
_subjects:
|
|
1574
|
-
_proxyFormState:
|
|
1575
|
+
_disableForm: gs,
|
|
1576
|
+
_subjects: f,
|
|
1577
|
+
_proxyFormState: y,
|
|
1575
1578
|
get _fields() {
|
|
1576
1579
|
return n;
|
|
1577
1580
|
},
|
|
@@ -1579,19 +1582,19 @@ function kr(e = {}) {
|
|
|
1579
1582
|
return r;
|
|
1580
1583
|
},
|
|
1581
1584
|
get _state() {
|
|
1582
|
-
return
|
|
1585
|
+
return a;
|
|
1583
1586
|
},
|
|
1584
|
-
set _state(
|
|
1585
|
-
|
|
1587
|
+
set _state(o) {
|
|
1588
|
+
a = o;
|
|
1586
1589
|
},
|
|
1587
1590
|
get _defaultValues() {
|
|
1588
1591
|
return i;
|
|
1589
1592
|
},
|
|
1590
1593
|
get _names() {
|
|
1591
|
-
return
|
|
1594
|
+
return c;
|
|
1592
1595
|
},
|
|
1593
|
-
set _names(
|
|
1594
|
-
|
|
1596
|
+
set _names(o) {
|
|
1597
|
+
c = o;
|
|
1595
1598
|
},
|
|
1596
1599
|
get _formState() {
|
|
1597
1600
|
return s;
|
|
@@ -1599,34 +1602,34 @@ function kr(e = {}) {
|
|
|
1599
1602
|
get _options() {
|
|
1600
1603
|
return t;
|
|
1601
1604
|
},
|
|
1602
|
-
set _options(
|
|
1605
|
+
set _options(o) {
|
|
1603
1606
|
t = {
|
|
1604
1607
|
...t,
|
|
1605
|
-
...
|
|
1608
|
+
...o
|
|
1606
1609
|
};
|
|
1607
1610
|
}
|
|
1608
1611
|
},
|
|
1609
|
-
subscribe:
|
|
1612
|
+
subscribe: ys,
|
|
1610
1613
|
trigger: ne,
|
|
1611
|
-
register:
|
|
1612
|
-
handleSubmit:
|
|
1613
|
-
watch:
|
|
1614
|
-
setValue:
|
|
1614
|
+
register: Xe,
|
|
1615
|
+
handleSubmit: gt,
|
|
1616
|
+
watch: hs,
|
|
1617
|
+
setValue: Y,
|
|
1615
1618
|
getValues: ue,
|
|
1616
|
-
reset:
|
|
1617
|
-
resetField:
|
|
1618
|
-
clearErrors:
|
|
1619
|
-
unregister:
|
|
1620
|
-
setError:
|
|
1621
|
-
setFocus:
|
|
1622
|
-
getFieldState:
|
|
1619
|
+
reset: bt,
|
|
1620
|
+
resetField: ps,
|
|
1621
|
+
clearErrors: Ce,
|
|
1622
|
+
unregister: Ye,
|
|
1623
|
+
setError: mt,
|
|
1624
|
+
setFocus: bs,
|
|
1625
|
+
getFieldState: qe
|
|
1623
1626
|
};
|
|
1624
1627
|
return {
|
|
1625
|
-
...
|
|
1626
|
-
formControl:
|
|
1628
|
+
...wt,
|
|
1629
|
+
formControl: wt
|
|
1627
1630
|
};
|
|
1628
1631
|
}
|
|
1629
|
-
function
|
|
1632
|
+
function ds(e = {}) {
|
|
1630
1633
|
const t = ie.useRef(void 0), s = ie.useRef(void 0), [n, i] = ie.useState({
|
|
1631
1634
|
isDirty: !1,
|
|
1632
1635
|
isValidating: !1,
|
|
@@ -1651,23 +1654,23 @@ function os(e = {}) {
|
|
|
1651
1654
|
formState: n
|
|
1652
1655
|
}, e.defaultValues && !fe(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
1653
1656
|
else {
|
|
1654
|
-
const { formControl:
|
|
1657
|
+
const { formControl: a, ...c } = Tr(e);
|
|
1655
1658
|
t.current = {
|
|
1656
|
-
...
|
|
1659
|
+
...c,
|
|
1657
1660
|
formState: n
|
|
1658
1661
|
};
|
|
1659
1662
|
}
|
|
1660
1663
|
const r = t.current.control;
|
|
1661
|
-
return r._options = e,
|
|
1662
|
-
const
|
|
1664
|
+
return r._options = e, hr(() => {
|
|
1665
|
+
const a = r._subscribe({
|
|
1663
1666
|
formState: r._proxyFormState,
|
|
1664
1667
|
callback: () => i({ ...r._formState }),
|
|
1665
1668
|
reRenderRoot: !0
|
|
1666
1669
|
});
|
|
1667
|
-
return i((
|
|
1668
|
-
...
|
|
1670
|
+
return i((c) => ({
|
|
1671
|
+
...c,
|
|
1669
1672
|
isReady: !0
|
|
1670
|
-
})), r._formState.isReady = !0,
|
|
1673
|
+
})), r._formState.isReady = !0, a;
|
|
1671
1674
|
}, [r]), ie.useEffect(() => r._disableForm(e.disabled), [r, e.disabled]), ie.useEffect(() => {
|
|
1672
1675
|
e.mode && (r._options.mode = e.mode), e.reValidateMode && (r._options.reValidateMode = e.reValidateMode);
|
|
1673
1676
|
}, [r, e.mode, e.reValidateMode]), ie.useEffect(() => {
|
|
@@ -1678,135 +1681,135 @@ function os(e = {}) {
|
|
|
1678
1681
|
});
|
|
1679
1682
|
}, [r, e.shouldUnregister]), ie.useEffect(() => {
|
|
1680
1683
|
if (r._proxyFormState.isDirty) {
|
|
1681
|
-
const
|
|
1682
|
-
|
|
1683
|
-
isDirty:
|
|
1684
|
+
const a = r._getDirty();
|
|
1685
|
+
a !== n.isDirty && r._subjects.state.next({
|
|
1686
|
+
isDirty: a
|
|
1684
1687
|
});
|
|
1685
1688
|
}
|
|
1686
1689
|
}, [r, n.isDirty]), ie.useEffect(() => {
|
|
1687
1690
|
e.values && !ve(e.values, s.current) ? (r._reset(e.values, {
|
|
1688
1691
|
keepFieldsRef: !0,
|
|
1689
1692
|
...r._options.resetOptions
|
|
1690
|
-
}), s.current = e.values, i((
|
|
1693
|
+
}), s.current = e.values, i((a) => ({ ...a }))) : r._resetDefaultValues();
|
|
1691
1694
|
}, [r, e.values]), ie.useEffect(() => {
|
|
1692
1695
|
r._state.mount || (r._setValid(), r._state.mount = !0), r._state.watch && (r._state.watch = !1, r._subjects.state.next({ ...r._formState })), r._removeUnmounted();
|
|
1693
|
-
}), t.current.formState =
|
|
1696
|
+
}), t.current.formState = mr(n, r), t.current;
|
|
1694
1697
|
}
|
|
1695
|
-
const
|
|
1696
|
-
const { t } =
|
|
1698
|
+
const bn = (e) => {
|
|
1699
|
+
const { t } = D(), { showStackNotifications: s, showSuccessNotification: n } = Ne(), {
|
|
1697
1700
|
defaultValues: i,
|
|
1698
1701
|
mutationFn: r,
|
|
1699
|
-
formToDto:
|
|
1700
|
-
onError:
|
|
1701
|
-
onSuccess:
|
|
1702
|
-
queryKey:
|
|
1703
|
-
onSuccessMessage:
|
|
1704
|
-
} = e, { control: g, handleSubmit:
|
|
1702
|
+
formToDto: a,
|
|
1703
|
+
onError: c,
|
|
1704
|
+
onSuccess: l,
|
|
1705
|
+
queryKey: m,
|
|
1706
|
+
onSuccessMessage: y
|
|
1707
|
+
} = e, { control: g, handleSubmit: f, reset: p, setError: _, getValues: C, setValue: N } = ds({
|
|
1705
1708
|
defaultValues: i
|
|
1706
|
-
}),
|
|
1707
|
-
(
|
|
1708
|
-
const
|
|
1709
|
-
return
|
|
1710
|
-
const
|
|
1711
|
-
(
|
|
1712
|
-
}),
|
|
1709
|
+
}), B = V(
|
|
1710
|
+
(T) => {
|
|
1711
|
+
const A = T == null ? void 0 : T.errors, I = [];
|
|
1712
|
+
return A && A.forEach(([M, se]) => {
|
|
1713
|
+
const P = document.querySelector(`[name="${M}"]`);
|
|
1714
|
+
(P instanceof HTMLInputElement || P instanceof HTMLTextAreaElement || P instanceof HTMLSelectElement) && (P.focus(), P.classList.add("error"), I.push(t(`_entities:${m}.${M}.${se}`)));
|
|
1715
|
+
}), I;
|
|
1713
1716
|
},
|
|
1714
|
-
[t,
|
|
1715
|
-
),
|
|
1716
|
-
document.querySelectorAll("input, textarea, select").forEach((
|
|
1717
|
-
|
|
1717
|
+
[t, m]
|
|
1718
|
+
), k = V(() => {
|
|
1719
|
+
document.querySelectorAll("input, textarea, select").forEach((A) => {
|
|
1720
|
+
A.classList.remove("error");
|
|
1718
1721
|
});
|
|
1719
|
-
}, []),
|
|
1722
|
+
}, []), F = Me(
|
|
1720
1723
|
{
|
|
1721
1724
|
mutationFn: r,
|
|
1722
|
-
onError: (
|
|
1723
|
-
console.error(
|
|
1724
|
-
const
|
|
1725
|
-
if (
|
|
1726
|
-
else if (
|
|
1727
|
-
const
|
|
1725
|
+
onError: (T) => {
|
|
1726
|
+
console.error(T);
|
|
1727
|
+
const A = T;
|
|
1728
|
+
if (c) c(T);
|
|
1729
|
+
else if (Ge(A)) {
|
|
1730
|
+
const I = B(A);
|
|
1728
1731
|
s(
|
|
1729
|
-
|
|
1730
|
-
(
|
|
1731
|
-
message:
|
|
1732
|
-
type:
|
|
1732
|
+
I.map(
|
|
1733
|
+
(M) => ({
|
|
1734
|
+
message: M,
|
|
1735
|
+
type: z.error
|
|
1733
1736
|
})
|
|
1734
1737
|
)
|
|
1735
1738
|
);
|
|
1736
|
-
} else if (
|
|
1737
|
-
const
|
|
1739
|
+
} else if (Je(A)) {
|
|
1740
|
+
const I = A.message || t("_accessibility:errors.500"), M = t(`_accessibility:errors.${A.status}`);
|
|
1738
1741
|
s([
|
|
1739
1742
|
{
|
|
1740
|
-
message:
|
|
1741
|
-
type:
|
|
1743
|
+
message: M || I,
|
|
1744
|
+
type: z.error
|
|
1742
1745
|
}
|
|
1743
1746
|
]);
|
|
1744
1747
|
}
|
|
1745
1748
|
},
|
|
1746
|
-
onSuccess: async (
|
|
1747
|
-
|
|
1748
|
-
message:
|
|
1749
|
+
onSuccess: async (T) => {
|
|
1750
|
+
be && await be.invalidateQueries({ queryKey: m }), l && l(T), y && n({
|
|
1751
|
+
message: y
|
|
1749
1752
|
});
|
|
1750
1753
|
}
|
|
1751
1754
|
}
|
|
1752
1755
|
);
|
|
1753
1756
|
return {
|
|
1754
1757
|
control: g,
|
|
1755
|
-
getValues:
|
|
1756
|
-
setValue:
|
|
1757
|
-
handleSubmit:
|
|
1758
|
-
onSubmit: (
|
|
1759
|
-
|
|
1760
|
-
|
|
1758
|
+
getValues: C,
|
|
1759
|
+
setValue: N,
|
|
1760
|
+
handleSubmit: f,
|
|
1761
|
+
onSubmit: (T) => {
|
|
1762
|
+
k(), F.mutate(
|
|
1763
|
+
a ? a(T) : T
|
|
1764
|
+
);
|
|
1765
|
+
},
|
|
1761
1766
|
reset: p,
|
|
1762
1767
|
setError: _,
|
|
1763
|
-
|
|
1764
|
-
releaseFormError: N,
|
|
1765
|
-
isLoading: q.isPending
|
|
1768
|
+
isLoading: F.isPending
|
|
1766
1769
|
};
|
|
1767
|
-
},
|
|
1768
|
-
const { t } =
|
|
1770
|
+
}, $r = (e) => {
|
|
1771
|
+
const { t } = D(), { onClick: s, hidden: n = !1, disabled: i = !1 } = e;
|
|
1769
1772
|
return {
|
|
1770
|
-
action:
|
|
1771
|
-
(
|
|
1772
|
-
id:
|
|
1773
|
-
hidden: !!
|
|
1774
|
-
disabled: !!
|
|
1775
|
-
icon: /* @__PURE__ */ h(ce, { className: "text-
|
|
1773
|
+
action: V(
|
|
1774
|
+
(a) => ({
|
|
1775
|
+
id: Se.Delete,
|
|
1776
|
+
hidden: !!a.deletedAt || n,
|
|
1777
|
+
disabled: !!a.deletedAt || i,
|
|
1778
|
+
icon: /* @__PURE__ */ h(ce, { className: "text-bg-error", icon: Ps }),
|
|
1776
1779
|
tooltip: t("_pages:common.actions.delete.text"),
|
|
1777
|
-
onClick: () => s([
|
|
1778
|
-
onMultipleClick: (
|
|
1780
|
+
onClick: () => s([a == null ? void 0 : a.id]),
|
|
1781
|
+
onMultipleClick: (c) => s(c.map((l) => l.id)),
|
|
1779
1782
|
multiple: !0
|
|
1780
1783
|
}),
|
|
1781
1784
|
[i, n, s, t]
|
|
1782
1785
|
)
|
|
1783
1786
|
};
|
|
1784
|
-
},
|
|
1785
|
-
const { t } =
|
|
1787
|
+
}, Fr = (e) => {
|
|
1788
|
+
const { t } = D(), { onClick: s, hidden: n = !1 } = e;
|
|
1786
1789
|
return {
|
|
1787
|
-
action:
|
|
1790
|
+
action: V(
|
|
1788
1791
|
(r) => ({
|
|
1789
|
-
id:
|
|
1792
|
+
id: Se.Restore,
|
|
1790
1793
|
hidden: !r.deletedAt || n,
|
|
1791
1794
|
disabled: !r.deletedAt,
|
|
1792
|
-
icon: /* @__PURE__ */ h(ce, { className: "text-
|
|
1795
|
+
icon: /* @__PURE__ */ h(ce, { className: "text-bg-error", icon: Ht }),
|
|
1793
1796
|
tooltip: t("_pages:common.actions.restore.text"),
|
|
1794
1797
|
onClick: () => s([r == null ? void 0 : r.id]),
|
|
1795
|
-
onMultipleClick: (
|
|
1798
|
+
onMultipleClick: (a) => s(a.map((c) => c.id)),
|
|
1796
1799
|
multiple: !0
|
|
1797
1800
|
}),
|
|
1798
1801
|
[n, s, t]
|
|
1799
1802
|
)
|
|
1800
1803
|
};
|
|
1801
|
-
},
|
|
1802
|
-
const { t } =
|
|
1804
|
+
}, wn = (e) => {
|
|
1805
|
+
const { t } = D(), { onClick: s, hidden: n = !1 } = e;
|
|
1803
1806
|
return {
|
|
1804
|
-
action:
|
|
1807
|
+
action: V(
|
|
1805
1808
|
(r) => ({
|
|
1806
|
-
id:
|
|
1809
|
+
id: Se.Edit,
|
|
1807
1810
|
hidden: !!r.deletedAt || n,
|
|
1808
1811
|
disabled: !!r.deletedAt,
|
|
1809
|
-
icon: /* @__PURE__ */ h(ce, { className: "primary", icon:
|
|
1812
|
+
icon: /* @__PURE__ */ h(ce, { className: "primary", icon: Os }),
|
|
1810
1813
|
tooltip: t("_pages:common.actions.edit.text"),
|
|
1811
1814
|
onClick: () => s(r == null ? void 0 : r.id)
|
|
1812
1815
|
}),
|
|
@@ -1814,25 +1817,25 @@ const dn = (e) => {
|
|
|
1814
1817
|
)
|
|
1815
1818
|
};
|
|
1816
1819
|
};
|
|
1817
|
-
var
|
|
1818
|
-
const
|
|
1819
|
-
const { t } =
|
|
1820
|
+
var Se = /* @__PURE__ */ ((e) => (e.Add = "add", e.Edit = "edit", e.Delete = "delete", e.Restore = "restore", e.Refresh = "refresh", e.Export = "export", e.Import = "import", e))(Se || {});
|
|
1821
|
+
const Lr = (e) => {
|
|
1822
|
+
const { t } = D(), {
|
|
1820
1823
|
onClick: s,
|
|
1821
1824
|
hidden: n = !1,
|
|
1822
1825
|
disabled: i = !1,
|
|
1823
1826
|
isLoading: r = !1
|
|
1824
1827
|
} = e;
|
|
1825
1828
|
return {
|
|
1826
|
-
action:
|
|
1829
|
+
action: V(
|
|
1827
1830
|
() => ({
|
|
1828
|
-
id:
|
|
1831
|
+
id: Se.Export,
|
|
1829
1832
|
hidden: n,
|
|
1830
1833
|
disabled: i,
|
|
1831
1834
|
icon: /* @__PURE__ */ h(
|
|
1832
1835
|
ce,
|
|
1833
1836
|
{
|
|
1834
1837
|
className: `${r ? "rotate" : ""}`,
|
|
1835
|
-
icon: r ?
|
|
1838
|
+
icon: r ? Bt : Ms
|
|
1836
1839
|
}
|
|
1837
1840
|
),
|
|
1838
1841
|
tooltip: t("_pages:common.actions.export.text"),
|
|
@@ -1841,24 +1844,24 @@ const Er = (e) => {
|
|
|
1841
1844
|
[i, n, r, s, t]
|
|
1842
1845
|
)
|
|
1843
1846
|
};
|
|
1844
|
-
},
|
|
1845
|
-
const { t } =
|
|
1847
|
+
}, Dr = (e) => {
|
|
1848
|
+
const { t } = D(), {
|
|
1846
1849
|
onClick: s,
|
|
1847
1850
|
hidden: n = !1,
|
|
1848
1851
|
disabled: i = !1,
|
|
1849
1852
|
isLoading: r = !1
|
|
1850
1853
|
} = e;
|
|
1851
1854
|
return {
|
|
1852
|
-
action:
|
|
1855
|
+
action: V(
|
|
1853
1856
|
() => ({
|
|
1854
|
-
id:
|
|
1857
|
+
id: Se.Import,
|
|
1855
1858
|
hidden: n,
|
|
1856
1859
|
disabled: i,
|
|
1857
1860
|
icon: /* @__PURE__ */ h(
|
|
1858
1861
|
ce,
|
|
1859
1862
|
{
|
|
1860
1863
|
className: `${r ? "rotate" : ""}`,
|
|
1861
|
-
icon: r ?
|
|
1864
|
+
icon: r ? Bt : Rs
|
|
1862
1865
|
}
|
|
1863
1866
|
),
|
|
1864
1867
|
tooltip: t("_pages:common.actions.import.text"),
|
|
@@ -1867,354 +1870,372 @@ const Er = (e) => {
|
|
|
1867
1870
|
[i, n, r, s, t]
|
|
1868
1871
|
)
|
|
1869
1872
|
};
|
|
1870
|
-
},
|
|
1871
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } =
|
|
1873
|
+
}, vn = (e) => {
|
|
1874
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } = D(), { open: a, onClick: c, close: l, dialogFn: m, isLoading: y } = rs({
|
|
1872
1875
|
onSuccessMessage: r("_pages:common.actions.delete.successMessage"),
|
|
1873
|
-
onError: (
|
|
1874
|
-
const p =
|
|
1875
|
-
if (
|
|
1876
|
+
onError: (f) => {
|
|
1877
|
+
const p = f;
|
|
1878
|
+
if (Ge(p))
|
|
1876
1879
|
i(
|
|
1877
1880
|
p.errors.map(
|
|
1878
|
-
([_,
|
|
1879
|
-
message: r(`_pages:${_}.errors.${
|
|
1880
|
-
type:
|
|
1881
|
+
([_, C]) => ({
|
|
1882
|
+
message: r(`_pages:${_}.errors.${C}`),
|
|
1883
|
+
type: z.error
|
|
1881
1884
|
})
|
|
1882
1885
|
)
|
|
1883
1886
|
);
|
|
1884
|
-
else if (
|
|
1885
|
-
const _ = p.message || r("_accessibility:errors.500"),
|
|
1887
|
+
else if (Je(p)) {
|
|
1888
|
+
const _ = p.message || r("_accessibility:errors.500"), C = r(`_accessibility:errors.${p.status}`);
|
|
1886
1889
|
i([
|
|
1887
1890
|
{
|
|
1888
|
-
message:
|
|
1889
|
-
type:
|
|
1891
|
+
message: C || _,
|
|
1892
|
+
type: z.error
|
|
1890
1893
|
}
|
|
1891
1894
|
]);
|
|
1892
1895
|
}
|
|
1893
1896
|
},
|
|
1894
|
-
onSuccess: async (
|
|
1895
|
-
await
|
|
1897
|
+
onSuccess: async (f) => {
|
|
1898
|
+
await be.invalidateQueries({ queryKey: t }), s && s(f);
|
|
1896
1899
|
},
|
|
1897
1900
|
...n
|
|
1898
|
-
}), { action: g } =
|
|
1901
|
+
}), { action: g } = $r({ onClick: c });
|
|
1899
1902
|
return {
|
|
1900
|
-
onClick:
|
|
1903
|
+
onClick: c,
|
|
1901
1904
|
title: r("_pages:common.actions.delete.dialog.title"),
|
|
1902
|
-
open:
|
|
1903
|
-
isLoading:
|
|
1904
|
-
handleSubmit: () =>
|
|
1905
|
-
handleClose:
|
|
1905
|
+
open: a,
|
|
1906
|
+
isLoading: y,
|
|
1907
|
+
handleSubmit: () => m.mutate(),
|
|
1908
|
+
handleClose: l,
|
|
1906
1909
|
action: g
|
|
1907
1910
|
};
|
|
1908
|
-
},
|
|
1909
|
-
const [e, t] =
|
|
1911
|
+
}, fs = () => {
|
|
1912
|
+
const [e, t] = J(!1);
|
|
1910
1913
|
return { open: e, setOpen: t, handleClose: () => t(!1), handleOpen: () => t(!0) };
|
|
1911
|
-
},
|
|
1912
|
-
const { t } =
|
|
1914
|
+
}, _n = (e) => {
|
|
1915
|
+
const { t } = D(), {
|
|
1913
1916
|
showErrorNotification: s,
|
|
1914
1917
|
showStackNotifications: n,
|
|
1915
1918
|
showSuccessNotification: i
|
|
1916
1919
|
} = Ne(), {
|
|
1917
1920
|
defaultValues: r,
|
|
1918
|
-
getFunction:
|
|
1919
|
-
mutationFn:
|
|
1920
|
-
formToDto:
|
|
1921
|
-
dtoToForm:
|
|
1922
|
-
onError:
|
|
1921
|
+
getFunction: a,
|
|
1922
|
+
mutationFn: c,
|
|
1923
|
+
formToDto: l,
|
|
1924
|
+
dtoToForm: m,
|
|
1925
|
+
onError: y,
|
|
1923
1926
|
onSuccess: g,
|
|
1924
|
-
queryKey:
|
|
1927
|
+
queryKey: f,
|
|
1925
1928
|
onSuccessMessage: p,
|
|
1926
1929
|
title: _
|
|
1927
|
-
} = e, [
|
|
1930
|
+
} = e, [C, N] = J(0), { open: B, handleClose: k, handleOpen: F } = fs(), { control: T, handleSubmit: A, reset: I, setError: M, getValues: se, setValue: P } = ds({
|
|
1928
1931
|
defaultValues: r
|
|
1929
|
-
}), { data: re, isLoading:
|
|
1930
|
-
queryFn: () =>
|
|
1931
|
-
queryKey: [...
|
|
1932
|
-
enabled: !!
|
|
1932
|
+
}), { data: re, isLoading: ae } = Xs({
|
|
1933
|
+
queryFn: () => a == null ? void 0 : a(C),
|
|
1934
|
+
queryKey: [...f, C],
|
|
1935
|
+
enabled: !!a && !!f && !!C
|
|
1933
1936
|
});
|
|
1934
|
-
|
|
1935
|
-
re &&
|
|
1937
|
+
le(() => {
|
|
1938
|
+
re && m && I({ ...m(re) });
|
|
1936
1939
|
}, [re]);
|
|
1937
|
-
const
|
|
1938
|
-
(
|
|
1939
|
-
const X =
|
|
1940
|
-
return X && X.forEach(([ue,
|
|
1941
|
-
const
|
|
1942
|
-
(
|
|
1940
|
+
const $ = V(
|
|
1941
|
+
(R) => {
|
|
1942
|
+
const X = R == null ? void 0 : R.errors, ne = [];
|
|
1943
|
+
return X && X.forEach(([ue, qe]) => {
|
|
1944
|
+
const Ce = document.querySelector(`[name="${ue}"]`);
|
|
1945
|
+
(Ce instanceof HTMLInputElement || Ce instanceof HTMLTextAreaElement || Ce instanceof HTMLSelectElement) && (Ce.focus(), Ce.classList.add("error"), ne.push(t(`_entities:${f}.${ue}.${qe}`)));
|
|
1943
1946
|
}), ne;
|
|
1944
1947
|
},
|
|
1945
|
-
[t,
|
|
1946
|
-
),
|
|
1948
|
+
[t, f]
|
|
1949
|
+
), L = V(() => {
|
|
1947
1950
|
document.querySelectorAll("input, textarea, select").forEach((X) => {
|
|
1948
1951
|
X.classList.remove("error");
|
|
1949
1952
|
});
|
|
1950
|
-
}, []),
|
|
1951
|
-
(
|
|
1952
|
-
|
|
1953
|
+
}, []), H = V(
|
|
1954
|
+
(R) => {
|
|
1955
|
+
N(R ?? 0), F();
|
|
1953
1956
|
},
|
|
1954
|
-
[
|
|
1955
|
-
),
|
|
1956
|
-
|
|
1957
|
-
}, [
|
|
1958
|
-
mutationFn:
|
|
1959
|
-
onError: (
|
|
1960
|
-
if (console.error(
|
|
1957
|
+
[F]
|
|
1958
|
+
), W = V(() => {
|
|
1959
|
+
L(), k(), I();
|
|
1960
|
+
}, [I, L, k]), Y = Me({
|
|
1961
|
+
mutationFn: c,
|
|
1962
|
+
onError: (R) => {
|
|
1963
|
+
if (console.error(R), y) y(R);
|
|
1961
1964
|
else {
|
|
1962
|
-
const X =
|
|
1963
|
-
if (
|
|
1964
|
-
const ne =
|
|
1965
|
+
const X = R;
|
|
1966
|
+
if (Ge(X)) {
|
|
1967
|
+
const ne = $(X);
|
|
1965
1968
|
n(
|
|
1966
1969
|
ne.map(
|
|
1967
1970
|
(ue) => ({
|
|
1968
1971
|
message: ue,
|
|
1969
|
-
type:
|
|
1972
|
+
type: z.error
|
|
1970
1973
|
})
|
|
1971
1974
|
)
|
|
1972
1975
|
);
|
|
1973
|
-
} else if (
|
|
1976
|
+
} else if (Je(X)) {
|
|
1974
1977
|
const ne = X.message || t("_accessibility:errors.500"), ue = t(`_accessibility:errors.${X.status}`);
|
|
1975
1978
|
s({ message: ue || ne });
|
|
1976
1979
|
} else
|
|
1977
1980
|
s({ message: t("_accessibility:errors.500") });
|
|
1978
1981
|
}
|
|
1979
1982
|
},
|
|
1980
|
-
onSuccess: async (
|
|
1981
|
-
await
|
|
1983
|
+
onSuccess: async (R) => {
|
|
1984
|
+
await be.invalidateQueries({ queryKey: f }), g && g(R), i({
|
|
1982
1985
|
message: p
|
|
1983
|
-
}),
|
|
1986
|
+
}), W();
|
|
1984
1987
|
}
|
|
1985
1988
|
});
|
|
1986
1989
|
return {
|
|
1987
|
-
open:
|
|
1988
|
-
openDialog:
|
|
1989
|
-
handleClose:
|
|
1990
|
-
control:
|
|
1991
|
-
getValues:
|
|
1992
|
-
setValue:
|
|
1993
|
-
handleSubmit:
|
|
1994
|
-
onSubmit: (
|
|
1995
|
-
|
|
1990
|
+
open: B,
|
|
1991
|
+
openDialog: H,
|
|
1992
|
+
handleClose: W,
|
|
1993
|
+
control: T,
|
|
1994
|
+
getValues: se,
|
|
1995
|
+
setValue: P,
|
|
1996
|
+
handleSubmit: A,
|
|
1997
|
+
onSubmit: (R) => Y.mutate(
|
|
1998
|
+
l ? l(R) : R
|
|
1996
1999
|
),
|
|
1997
|
-
reset:
|
|
1998
|
-
setError:
|
|
1999
|
-
parseFormError: k,
|
|
2000
|
-
releaseFormError: A,
|
|
2000
|
+
reset: I,
|
|
2001
|
+
setError: M,
|
|
2001
2002
|
title: _,
|
|
2002
|
-
isLoading:
|
|
2003
|
+
isLoading: ae || Y.isPending
|
|
2003
2004
|
};
|
|
2004
|
-
},
|
|
2005
|
-
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } =
|
|
2005
|
+
}, Sn = (e) => {
|
|
2006
|
+
const { queryKey: t, onSuccess: s, ...n } = e, { showStackNotifications: i } = Ne(), { t: r } = D(), { open: a, onClick: c, close: l, dialogFn: m, isLoading: y } = rs({
|
|
2006
2007
|
onSuccessMessage: r("_pages:common.actions.restore.successMessage"),
|
|
2007
|
-
onError: (
|
|
2008
|
-
const p =
|
|
2009
|
-
if (
|
|
2008
|
+
onError: (f) => {
|
|
2009
|
+
const p = f;
|
|
2010
|
+
if (Ge(p))
|
|
2010
2011
|
i(
|
|
2011
2012
|
p.errors.map(
|
|
2012
|
-
([_,
|
|
2013
|
-
message: r(`_pages:${_}.errors.${
|
|
2014
|
-
type:
|
|
2013
|
+
([_, C]) => ({
|
|
2014
|
+
message: r(`_pages:${_}.errors.${C}`),
|
|
2015
|
+
type: z.error
|
|
2015
2016
|
})
|
|
2016
2017
|
)
|
|
2017
2018
|
);
|
|
2018
|
-
else if (
|
|
2019
|
-
const _ = p.message || r("_accessibility:errors.500"),
|
|
2019
|
+
else if (Je(p)) {
|
|
2020
|
+
const _ = p.message || r("_accessibility:errors.500"), C = r(`_accessibility:errors.${p.status}`);
|
|
2020
2021
|
i([
|
|
2021
2022
|
{
|
|
2022
|
-
message:
|
|
2023
|
-
type:
|
|
2023
|
+
message: C || _,
|
|
2024
|
+
type: z.error
|
|
2024
2025
|
}
|
|
2025
2026
|
]);
|
|
2026
2027
|
}
|
|
2027
2028
|
},
|
|
2028
|
-
onSuccess: async (
|
|
2029
|
-
await
|
|
2029
|
+
onSuccess: async (f) => {
|
|
2030
|
+
await be.invalidateQueries({ queryKey: t }), s && s(f);
|
|
2030
2031
|
},
|
|
2031
2032
|
...n
|
|
2032
|
-
}), { action: g } =
|
|
2033
|
+
}), { action: g } = Fr({ onClick: c });
|
|
2033
2034
|
return {
|
|
2034
|
-
onClick:
|
|
2035
|
+
onClick: c,
|
|
2035
2036
|
title: r("_pages:common.actions.restore.dialog.title"),
|
|
2036
|
-
open:
|
|
2037
|
-
isLoading:
|
|
2038
|
-
handleSubmit: () =>
|
|
2039
|
-
handleClose:
|
|
2037
|
+
open: a,
|
|
2038
|
+
isLoading: y,
|
|
2039
|
+
handleSubmit: () => m.mutate(),
|
|
2040
|
+
handleClose: l,
|
|
2040
2041
|
action: g
|
|
2041
2042
|
};
|
|
2042
2043
|
};
|
|
2043
|
-
function
|
|
2044
|
-
const { t } =
|
|
2044
|
+
function Cn(e) {
|
|
2045
|
+
const { t } = D(), { queryKey: s, mutationFn: n, entity: i, fileProcessor: r, onError: a } = e, [c, l] = J(!1), [m, y] = J(null), [g, f] = J(!1), p = Me({
|
|
2045
2046
|
mutationFn: n,
|
|
2046
|
-
onError: (
|
|
2047
|
-
console.error(
|
|
2047
|
+
onError: (C) => {
|
|
2048
|
+
console.error(C), a == null || a(C);
|
|
2048
2049
|
},
|
|
2049
2050
|
onSuccess: async () => {
|
|
2050
|
-
|
|
2051
|
+
be && await be.invalidateQueries({ queryKey: s });
|
|
2051
2052
|
}
|
|
2052
|
-
}), { action: _ } =
|
|
2053
|
-
onClick: () =>
|
|
2053
|
+
}), { action: _ } = Dr({
|
|
2054
|
+
onClick: () => l(!0)
|
|
2054
2055
|
});
|
|
2055
2056
|
return {
|
|
2056
2057
|
handleSubmit: async () => {
|
|
2057
|
-
if (!(!
|
|
2058
|
+
if (!(!m || m.length === 0))
|
|
2058
2059
|
try {
|
|
2059
2060
|
await p.mutateAsync({
|
|
2060
|
-
items:
|
|
2061
|
+
items: m,
|
|
2061
2062
|
override: g
|
|
2062
|
-
}),
|
|
2063
|
-
} catch (
|
|
2064
|
-
console.error(
|
|
2063
|
+
}), l(!1), y(null), f(!1);
|
|
2064
|
+
} catch (C) {
|
|
2065
|
+
console.error(C);
|
|
2065
2066
|
}
|
|
2066
2067
|
},
|
|
2067
2068
|
isLoading: p.isPending,
|
|
2068
2069
|
fileProcessor: r,
|
|
2069
|
-
onFileProcessed: (
|
|
2070
|
-
onOverrideChange: (
|
|
2071
|
-
open:
|
|
2070
|
+
onFileProcessed: (C) => y(C),
|
|
2071
|
+
onOverrideChange: (C) => f(C),
|
|
2072
|
+
open: c,
|
|
2072
2073
|
title: t("_pages:common.actions.import.dialog.title", {
|
|
2073
2074
|
entity: t(`_pages:${i}.title`)
|
|
2074
2075
|
}),
|
|
2075
2076
|
handleClose: () => {
|
|
2076
|
-
|
|
2077
|
+
l(!1), y(null);
|
|
2077
2078
|
},
|
|
2078
2079
|
action: _
|
|
2079
2080
|
};
|
|
2080
2081
|
}
|
|
2081
|
-
const
|
|
2082
|
-
const { showSuccessNotification: t } = Ne(), { t: s } =
|
|
2082
|
+
const En = (e) => {
|
|
2083
|
+
const { showSuccessNotification: t } = Ne(), { t: s } = D(), {
|
|
2083
2084
|
entity: n,
|
|
2084
2085
|
mutationFn: i,
|
|
2085
2086
|
onError: r,
|
|
2086
|
-
onSuccess:
|
|
2087
|
-
onSuccessMessage:
|
|
2088
|
-
} = e,
|
|
2087
|
+
onSuccess: a,
|
|
2088
|
+
onSuccessMessage: c = s("_pages:common.actions.export.successMessage")
|
|
2089
|
+
} = e, l = Me({
|
|
2089
2090
|
mutationFn: () => i(),
|
|
2090
2091
|
onError: (g) => {
|
|
2091
2092
|
console.error(g), r && r(g);
|
|
2092
2093
|
},
|
|
2093
2094
|
onSuccess: async (g) => {
|
|
2094
|
-
const
|
|
2095
|
-
|
|
2096
|
-
message:
|
|
2095
|
+
const f = JSON.stringify(g, null, 2), p = new Blob([f], { type: "application/json" }), _ = URL.createObjectURL(p), C = document.createElement("a");
|
|
2096
|
+
C.href = _, C.download = `${n}.json`, C.click(), URL.revokeObjectURL(_), a && a(g), t({
|
|
2097
|
+
message: c
|
|
2097
2098
|
});
|
|
2098
2099
|
}
|
|
2099
|
-
}),
|
|
2100
|
-
|
|
2101
|
-
}, [
|
|
2102
|
-
onClick:
|
|
2103
|
-
isLoading:
|
|
2100
|
+
}), m = V(() => {
|
|
2101
|
+
l.mutate();
|
|
2102
|
+
}, [l]), { action: y } = Lr({
|
|
2103
|
+
onClick: m,
|
|
2104
|
+
isLoading: l.isPending
|
|
2104
2105
|
});
|
|
2105
2106
|
return {
|
|
2106
|
-
action:
|
|
2107
|
+
action: y
|
|
2107
2108
|
};
|
|
2108
2109
|
};
|
|
2109
|
-
function
|
|
2110
|
-
const [t, s] =
|
|
2110
|
+
function Vr(e) {
|
|
2111
|
+
const [t, s] = J(!1), n = V(() => {
|
|
2111
2112
|
const i = window.scrollY > e;
|
|
2112
2113
|
s(i);
|
|
2113
2114
|
}, [e]);
|
|
2114
|
-
return
|
|
2115
|
+
return le(() => (window.addEventListener("scroll", n), () => {
|
|
2115
2116
|
window.removeEventListener("scroll", n);
|
|
2116
2117
|
}), [n]), t;
|
|
2117
2118
|
}
|
|
2118
|
-
const
|
|
2119
|
-
const { t: e } =
|
|
2119
|
+
const Nn = () => {
|
|
2120
|
+
const { t: e } = D(), t = Vr(200);
|
|
2120
2121
|
return /* @__PURE__ */ h(
|
|
2121
|
-
|
|
2122
|
+
pe,
|
|
2122
2123
|
{
|
|
2123
|
-
|
|
2124
|
-
|
|
2124
|
+
variant: "submit",
|
|
2125
|
+
color: "primary",
|
|
2126
|
+
icon: Us,
|
|
2125
2127
|
"data-tooltip-id": "tooltip",
|
|
2126
|
-
|
|
2127
|
-
className: `
|
|
2128
|
+
onClick: () => tr.scrollTo(0, 0),
|
|
2129
|
+
className: `to-top ${t ? "show" : "hide"}`,
|
|
2130
|
+
"data-tooltip-content": e("_accessibility:buttons.toTop")
|
|
2128
2131
|
}
|
|
2129
2132
|
);
|
|
2130
|
-
},
|
|
2131
|
-
const { actions: t = [], className: s = "" } = e, { t: n } =
|
|
2132
|
-
return /* @__PURE__ */
|
|
2133
|
+
}, Ir = (e) => {
|
|
2134
|
+
const { actions: t = [], className: s = "" } = e, { t: n } = D(), [i, r] = J(!1), [a, c] = J(null);
|
|
2135
|
+
return /* @__PURE__ */ x("div", { className: `actions-dropdown ${s}`, children: [
|
|
2133
2136
|
/* @__PURE__ */ h(
|
|
2134
|
-
|
|
2137
|
+
pe,
|
|
2135
2138
|
{
|
|
2136
|
-
icon:
|
|
2137
|
-
onClick: () =>
|
|
2139
|
+
icon: qs,
|
|
2140
|
+
onClick: (l) => {
|
|
2141
|
+
c(l.currentTarget), r((m) => !m);
|
|
2142
|
+
},
|
|
2138
2143
|
className: "actions-dropdown-trigger",
|
|
2139
2144
|
"data-tooltip-id": "tooltip",
|
|
2140
2145
|
"data-tooltip-content": n("_accessibility:buttons.openActions")
|
|
2141
2146
|
}
|
|
2142
2147
|
),
|
|
2143
|
-
/* @__PURE__ */ h(
|
|
2144
|
-
|
|
2148
|
+
/* @__PURE__ */ h(
|
|
2149
|
+
ks,
|
|
2145
2150
|
{
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2151
|
+
open: i,
|
|
2152
|
+
onClose: () => r(!1),
|
|
2153
|
+
anchorEl: a,
|
|
2154
|
+
children: /* @__PURE__ */ h(
|
|
2155
|
+
Wt,
|
|
2156
|
+
{
|
|
2157
|
+
showActionTexts: !0,
|
|
2158
|
+
actions: t,
|
|
2159
|
+
itemClassName: "w-full",
|
|
2160
|
+
actionClassName: "action-dropdown-item",
|
|
2161
|
+
className: "actions-dropdown-list",
|
|
2162
|
+
showTooltips: !1
|
|
2163
|
+
}
|
|
2164
|
+
)
|
|
2150
2165
|
}
|
|
2151
|
-
)
|
|
2166
|
+
)
|
|
2152
2167
|
] });
|
|
2153
|
-
},
|
|
2168
|
+
}, Rt = (e) => e == null ? !1 : `${e}`.length > 0, kn = qt(function(e, t) {
|
|
2154
2169
|
const {
|
|
2155
2170
|
value: s,
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2171
|
+
defaultValue: n,
|
|
2172
|
+
onChange: i,
|
|
2173
|
+
state: r = As.default,
|
|
2174
|
+
name: a = "",
|
|
2159
2175
|
id: c = "",
|
|
2160
|
-
label:
|
|
2161
|
-
disabled:
|
|
2162
|
-
required:
|
|
2163
|
-
containerClassName:
|
|
2164
|
-
inputClassName:
|
|
2165
|
-
labelClassName:
|
|
2166
|
-
helperText:
|
|
2167
|
-
helperTextClassName:
|
|
2168
|
-
...
|
|
2169
|
-
} = e
|
|
2170
|
-
|
|
2176
|
+
label: l = "",
|
|
2177
|
+
disabled: m = !1,
|
|
2178
|
+
required: y = !1,
|
|
2179
|
+
containerClassName: g = "",
|
|
2180
|
+
inputClassName: f = "",
|
|
2181
|
+
labelClassName: p = "",
|
|
2182
|
+
helperText: _ = "",
|
|
2183
|
+
helperTextClassName: C = "",
|
|
2184
|
+
...N
|
|
2185
|
+
} = e, B = s !== void 0, [k, F] = J(
|
|
2186
|
+
() => Rt(n)
|
|
2187
|
+
), T = B ? Rt(s) : k, A = (I) => {
|
|
2188
|
+
B || F(I.currentTarget.value.length > 0), i == null || i(I);
|
|
2189
|
+
};
|
|
2190
|
+
return /* @__PURE__ */ x("div", { className: `form-paragraph-container group ${g}`, children: [
|
|
2171
2191
|
/* @__PURE__ */ h(
|
|
2172
2192
|
"textarea",
|
|
2173
2193
|
{
|
|
2174
2194
|
ref: t,
|
|
2175
|
-
name:
|
|
2195
|
+
name: a,
|
|
2176
2196
|
id: c,
|
|
2177
|
-
className: `text-input text-area ${
|
|
2178
|
-
required:
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2197
|
+
className: `text-input text-area form-paragraph-textarea peer ${xs(r)} ${T ? "has-value" : ""} ${N.placeholder ? "has-placeholder" : ""} ${f}`,
|
|
2198
|
+
required: y,
|
|
2199
|
+
defaultValue: n,
|
|
2200
|
+
...B ? { value: s } : {},
|
|
2201
|
+
onChange: A,
|
|
2202
|
+
disabled: m,
|
|
2203
|
+
...N
|
|
2183
2204
|
}
|
|
2184
2205
|
),
|
|
2185
|
-
/* @__PURE__ */
|
|
2206
|
+
/* @__PURE__ */ x(
|
|
2186
2207
|
"label",
|
|
2187
2208
|
{
|
|
2188
|
-
htmlFor:
|
|
2189
|
-
className: `text-input-label ${
|
|
2209
|
+
htmlFor: c,
|
|
2210
|
+
className: `text-input-label ${Ts(r)} ${p}`,
|
|
2190
2211
|
children: [
|
|
2191
|
-
|
|
2192
|
-
|
|
2212
|
+
l,
|
|
2213
|
+
y ? " *" : ""
|
|
2193
2214
|
]
|
|
2194
2215
|
}
|
|
2195
2216
|
),
|
|
2196
|
-
!!
|
|
2217
|
+
!!_ && /* @__PURE__ */ h(
|
|
2197
2218
|
"p",
|
|
2198
2219
|
{
|
|
2199
|
-
className: `text-input-helper-text ${
|
|
2200
|
-
children:
|
|
2220
|
+
className: `text-input-helper-text ${$s(r)} ${C}`,
|
|
2221
|
+
children: _
|
|
2201
2222
|
}
|
|
2202
2223
|
)
|
|
2203
2224
|
] });
|
|
2204
|
-
}),
|
|
2205
|
-
const { t } =
|
|
2225
|
+
}), An = (e) => {
|
|
2226
|
+
const { t } = D(), {
|
|
2206
2227
|
children: s,
|
|
2207
2228
|
handleSubmit: n,
|
|
2208
2229
|
onSubmit: i,
|
|
2209
2230
|
isLoading: r = !1,
|
|
2210
|
-
buttonEnd:
|
|
2211
|
-
reset:
|
|
2231
|
+
buttonEnd: a = !0,
|
|
2232
|
+
reset: c
|
|
2212
2233
|
} = e;
|
|
2213
|
-
return /* @__PURE__ */
|
|
2234
|
+
return /* @__PURE__ */ x("form", { className: "form-container", onSubmit: n(i), children: [
|
|
2214
2235
|
s,
|
|
2215
|
-
/* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2217
|
-
|
|
2236
|
+
/* @__PURE__ */ x("div", { className: `form-actions ${a ? "end" : ""}`, children: [
|
|
2237
|
+
/* @__PURE__ */ x(
|
|
2238
|
+
_e,
|
|
2218
2239
|
{
|
|
2219
2240
|
type: "submit",
|
|
2220
2241
|
color: "primary",
|
|
@@ -2223,17 +2244,17 @@ const pn = () => {
|
|
|
2223
2244
|
name: t("_accessibility:buttons.submit"),
|
|
2224
2245
|
"aria-label": t("_accessibility:ariaLabels.submit"),
|
|
2225
2246
|
children: [
|
|
2226
|
-
r ? /* @__PURE__ */ h(
|
|
2247
|
+
r ? /* @__PURE__ */ h(xe, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
|
|
2227
2248
|
t("_accessibility:buttons.submit")
|
|
2228
2249
|
]
|
|
2229
2250
|
}
|
|
2230
2251
|
),
|
|
2231
2252
|
/* @__PURE__ */ h(
|
|
2232
|
-
|
|
2253
|
+
_e,
|
|
2233
2254
|
{
|
|
2234
2255
|
type: "button",
|
|
2235
2256
|
variant: "outlined",
|
|
2236
|
-
onClick: () =>
|
|
2257
|
+
onClick: () => c == null ? void 0 : c(),
|
|
2237
2258
|
name: t("_accessibility:buttons.cancel"),
|
|
2238
2259
|
"aria-label": t("_accessibility:ariaLabels.cancel"),
|
|
2239
2260
|
children: t("_accessibility:buttons.cancel")
|
|
@@ -2241,79 +2262,75 @@ const pn = () => {
|
|
|
2241
2262
|
)
|
|
2242
2263
|
] })
|
|
2243
2264
|
] });
|
|
2244
|
-
}, xn =
|
|
2245
|
-
const
|
|
2246
|
-
return /* @__PURE__ */ h(
|
|
2247
|
-
|
|
2265
|
+
}, xn = qt(function(e, t) {
|
|
2266
|
+
const { t: s } = D(), [n, i] = J(!1);
|
|
2267
|
+
return /* @__PURE__ */ h(Fs, { ...e, type: n ? "text" : "password", ref: t, children: /* @__PURE__ */ h(
|
|
2268
|
+
pe,
|
|
2248
2269
|
{
|
|
2249
2270
|
type: "button",
|
|
2250
2271
|
tabIndex: -1,
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2272
|
+
"aria-label": s(
|
|
2273
|
+
n ? "_accessibility:ariaLabels.hidePassword" : "_accessibility:ariaLabels.showPassword"
|
|
2274
|
+
),
|
|
2275
|
+
className: "password-icon",
|
|
2276
|
+
onClick: () => i(!n),
|
|
2277
|
+
icon: n ? Hs : Bs
|
|
2254
2278
|
}
|
|
2255
2279
|
) });
|
|
2256
|
-
}),
|
|
2257
|
-
const { t } =
|
|
2280
|
+
}), dt = (e) => {
|
|
2281
|
+
const { t } = D(), {
|
|
2258
2282
|
title: s,
|
|
2259
2283
|
children: n,
|
|
2260
2284
|
handleClose: i,
|
|
2261
2285
|
open: r = !1,
|
|
2262
|
-
containerClassName:
|
|
2263
|
-
className:
|
|
2264
|
-
animationClass:
|
|
2265
|
-
} = e,
|
|
2266
|
-
(
|
|
2267
|
-
|
|
2286
|
+
containerClassName: a = "",
|
|
2287
|
+
className: c = "",
|
|
2288
|
+
animationClass: l = "appear"
|
|
2289
|
+
} = e, m = V(
|
|
2290
|
+
(g) => {
|
|
2291
|
+
g.key === "Escape" && r && i();
|
|
2268
2292
|
},
|
|
2269
2293
|
[r, i]
|
|
2270
2294
|
);
|
|
2271
|
-
|
|
2272
|
-
window.removeEventListener("keydown",
|
|
2273
|
-
}), [g]);
|
|
2274
|
-
const m = F(() => {
|
|
2275
|
-
b(window.innerWidth);
|
|
2276
|
-
}, []);
|
|
2277
|
-
ae(() => (window.addEventListener("resize", m), () => {
|
|
2278
|
-
window.removeEventListener("resize", m);
|
|
2295
|
+
le(() => (window.addEventListener("keydown", m), () => {
|
|
2296
|
+
window.removeEventListener("keydown", m);
|
|
2279
2297
|
}), [m]);
|
|
2280
|
-
const
|
|
2281
|
-
(
|
|
2282
|
-
|
|
2283
|
-
((E = y == null ? void 0 : y.currentTarget) == null ? void 0 : E.getAttribute("name")) === t("_accessibility:buttons.closeDialog") && i();
|
|
2298
|
+
const y = V(
|
|
2299
|
+
(g) => {
|
|
2300
|
+
g.target === g.currentTarget && i();
|
|
2284
2301
|
},
|
|
2285
|
-
[
|
|
2302
|
+
[i]
|
|
2286
2303
|
);
|
|
2287
|
-
return
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2304
|
+
return le(() => {
|
|
2305
|
+
const g = (f) => {
|
|
2306
|
+
f ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
|
|
2290
2307
|
};
|
|
2291
|
-
return
|
|
2292
|
-
|
|
2308
|
+
return g(r), () => {
|
|
2309
|
+
g(!1);
|
|
2293
2310
|
};
|
|
2294
|
-
}, [r]),
|
|
2311
|
+
}, [r]), Kt(
|
|
2295
2312
|
/* @__PURE__ */ h(
|
|
2296
2313
|
"div",
|
|
2297
2314
|
{
|
|
2298
2315
|
"aria-label": t("_accessibility:ariaLabels.closeDialog"),
|
|
2299
|
-
"aria-
|
|
2300
|
-
onClick:
|
|
2301
|
-
className: `dialog-backdrop animated ${r ? `opened ${
|
|
2302
|
-
children: /* @__PURE__ */
|
|
2316
|
+
"aria-hidden": !r,
|
|
2317
|
+
onClick: y,
|
|
2318
|
+
className: `dialog-backdrop animated ${r ? `opened ${l}` : "closed"} ${a}`,
|
|
2319
|
+
children: /* @__PURE__ */ x(
|
|
2303
2320
|
"div",
|
|
2304
2321
|
{
|
|
2305
|
-
className: `dialog elevated animated ${r ? `opened ${
|
|
2322
|
+
className: `dialog elevated animated ${r ? `opened ${l}` : "closed"} ${c}`,
|
|
2306
2323
|
children: [
|
|
2307
|
-
/* @__PURE__ */
|
|
2308
|
-
/* @__PURE__ */ h("h3", { className: "
|
|
2324
|
+
/* @__PURE__ */ x("div", { className: "dialog-header", children: [
|
|
2325
|
+
/* @__PURE__ */ h("h3", { className: "dialog-title", children: s }),
|
|
2309
2326
|
/* @__PURE__ */ h(
|
|
2310
|
-
|
|
2327
|
+
pe,
|
|
2311
2328
|
{
|
|
2312
|
-
icon:
|
|
2329
|
+
icon: Qt,
|
|
2313
2330
|
disabled: !r,
|
|
2314
2331
|
"aria-disabled": !r,
|
|
2315
2332
|
onClick: i,
|
|
2316
|
-
className: "icon-button
|
|
2333
|
+
className: "icon-button dialog-close-btn",
|
|
2317
2334
|
name: t("_accessibility:buttons.closeDialog"),
|
|
2318
2335
|
"aria-label": t("_accessibility:ariaLabels.closeDialog")
|
|
2319
2336
|
}
|
|
@@ -2327,51 +2344,51 @@ const pn = () => {
|
|
|
2327
2344
|
),
|
|
2328
2345
|
document.body
|
|
2329
2346
|
);
|
|
2330
|
-
},
|
|
2347
|
+
}, ft = (e) => {
|
|
2331
2348
|
const {
|
|
2332
2349
|
primaryText: t,
|
|
2333
2350
|
cancelText: s,
|
|
2334
2351
|
onPrimaryClick: n,
|
|
2335
2352
|
onCancel: i,
|
|
2336
2353
|
isLoading: r = !1,
|
|
2337
|
-
disabled:
|
|
2338
|
-
primaryType:
|
|
2339
|
-
containerClassName:
|
|
2340
|
-
primaryClassName:
|
|
2341
|
-
alignEnd:
|
|
2354
|
+
disabled: a = !1,
|
|
2355
|
+
primaryType: c = "submit",
|
|
2356
|
+
containerClassName: l = "",
|
|
2357
|
+
primaryClassName: m = "",
|
|
2358
|
+
alignEnd: y = !1,
|
|
2342
2359
|
primaryName: g,
|
|
2343
|
-
primaryAriaLabel:
|
|
2360
|
+
primaryAriaLabel: f,
|
|
2344
2361
|
cancelName: p,
|
|
2345
2362
|
cancelAriaLabel: _
|
|
2346
2363
|
} = e;
|
|
2347
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ x(
|
|
2348
2365
|
"div",
|
|
2349
2366
|
{
|
|
2350
|
-
className: `
|
|
2367
|
+
className: `dialog-actions ${y ? "end" : ""} ${l}`,
|
|
2351
2368
|
children: [
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
|
|
2369
|
+
/* @__PURE__ */ x(
|
|
2370
|
+
_e,
|
|
2354
2371
|
{
|
|
2355
|
-
type:
|
|
2372
|
+
type: c,
|
|
2356
2373
|
color: "primary",
|
|
2357
2374
|
variant: "submit",
|
|
2358
|
-
className:
|
|
2359
|
-
disabled:
|
|
2360
|
-
onClick:
|
|
2375
|
+
className: m,
|
|
2376
|
+
disabled: a,
|
|
2377
|
+
onClick: n,
|
|
2361
2378
|
name: g,
|
|
2362
|
-
"aria-label":
|
|
2379
|
+
"aria-label": f,
|
|
2363
2380
|
children: [
|
|
2364
|
-
r ? /* @__PURE__ */ h(
|
|
2381
|
+
r ? /* @__PURE__ */ h(xe, { color: "stroke-base", loaderClass: "!w-6 mt-1", strokeWidth: "6" }) : null,
|
|
2365
2382
|
t
|
|
2366
2383
|
]
|
|
2367
2384
|
}
|
|
2368
2385
|
),
|
|
2369
2386
|
/* @__PURE__ */ h(
|
|
2370
|
-
|
|
2387
|
+
_e,
|
|
2371
2388
|
{
|
|
2372
2389
|
type: "button",
|
|
2373
2390
|
variant: "outlined",
|
|
2374
|
-
disabled:
|
|
2391
|
+
disabled: a,
|
|
2375
2392
|
onClick: i,
|
|
2376
2393
|
name: p,
|
|
2377
2394
|
"aria-label": _,
|
|
@@ -2381,29 +2398,29 @@ const pn = () => {
|
|
|
2381
2398
|
]
|
|
2382
2399
|
}
|
|
2383
2400
|
);
|
|
2384
|
-
},
|
|
2385
|
-
const { t } =
|
|
2401
|
+
}, Tn = (e) => {
|
|
2402
|
+
const { t } = D(), {
|
|
2386
2403
|
children: s,
|
|
2387
2404
|
handleSubmit: n,
|
|
2388
2405
|
onSubmit: i,
|
|
2389
2406
|
handleClose: r,
|
|
2390
|
-
isLoading:
|
|
2391
|
-
buttonEnd:
|
|
2392
|
-
...
|
|
2407
|
+
isLoading: a = !1,
|
|
2408
|
+
buttonEnd: c = !0,
|
|
2409
|
+
...l
|
|
2393
2410
|
} = e;
|
|
2394
|
-
return /* @__PURE__ */ h(
|
|
2411
|
+
return /* @__PURE__ */ h(dt, { ...l, handleClose: r, children: /* @__PURE__ */ x("form", { onSubmit: n(i), children: [
|
|
2395
2412
|
/* @__PURE__ */ h("div", { className: "form-container", children: s }),
|
|
2396
2413
|
/* @__PURE__ */ h(
|
|
2397
|
-
|
|
2414
|
+
ft,
|
|
2398
2415
|
{
|
|
2399
2416
|
primaryType: "submit",
|
|
2400
2417
|
primaryText: t("_accessibility:buttons.submit"),
|
|
2401
2418
|
cancelText: t("_accessibility:buttons.cancel"),
|
|
2402
2419
|
onCancel: r,
|
|
2403
|
-
isLoading:
|
|
2404
|
-
disabled:
|
|
2405
|
-
primaryClassName: "
|
|
2406
|
-
alignEnd:
|
|
2420
|
+
isLoading: a,
|
|
2421
|
+
disabled: a,
|
|
2422
|
+
primaryClassName: "dialog-form-primary",
|
|
2423
|
+
alignEnd: c,
|
|
2407
2424
|
primaryName: t("_accessibility:buttons.submit"),
|
|
2408
2425
|
primaryAriaLabel: t("_accessibility:ariaLabels.submit"),
|
|
2409
2426
|
cancelName: t("_accessibility:buttons.cancel"),
|
|
@@ -2411,18 +2428,18 @@ const pn = () => {
|
|
|
2411
2428
|
}
|
|
2412
2429
|
)
|
|
2413
2430
|
] }) });
|
|
2414
|
-
},
|
|
2415
|
-
const { t } =
|
|
2431
|
+
}, $n = (e) => {
|
|
2432
|
+
const { t } = D(), {
|
|
2416
2433
|
children: s,
|
|
2417
2434
|
handleSubmit: n,
|
|
2418
2435
|
handleClose: i,
|
|
2419
2436
|
isLoading: r = !1,
|
|
2420
|
-
...
|
|
2437
|
+
...a
|
|
2421
2438
|
} = e;
|
|
2422
|
-
return /* @__PURE__ */
|
|
2439
|
+
return /* @__PURE__ */ x(dt, { ...a, handleClose: i, children: [
|
|
2423
2440
|
s,
|
|
2424
2441
|
/* @__PURE__ */ h(
|
|
2425
|
-
|
|
2442
|
+
ft,
|
|
2426
2443
|
{
|
|
2427
2444
|
primaryText: t("_accessibility:buttons.ok"),
|
|
2428
2445
|
cancelText: t("_accessibility:buttons.cancel"),
|
|
@@ -2440,104 +2457,120 @@ const pn = () => {
|
|
|
2440
2457
|
)
|
|
2441
2458
|
] });
|
|
2442
2459
|
};
|
|
2443
|
-
function
|
|
2444
|
-
const { message: t, className: s = "" } = e, { t: n } =
|
|
2445
|
-
return
|
|
2460
|
+
function Pr(e) {
|
|
2461
|
+
const { message: t, className: s = "" } = e, { t: n } = D();
|
|
2462
|
+
return /* @__PURE__ */ h("p", { className: `import-error-message ${s}`, children: t ?? n("_messages:errors.parseFile", {
|
|
2463
|
+
defaultValue: "Failed to process file"
|
|
2464
|
+
}) });
|
|
2446
2465
|
}
|
|
2447
|
-
function
|
|
2448
|
-
const { message: t, className: s = "" } = e, { t: n } =
|
|
2449
|
-
return /* @__PURE__ */ $
|
|
2450
|
-
"
|
|
2451
|
-
{
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
/* @__PURE__ */ h("span", { children: t ?? n("_messages:loading.processingFile", {
|
|
2456
|
-
defaultValue: "Processing file..."
|
|
2457
|
-
}) })
|
|
2458
|
-
]
|
|
2459
|
-
}
|
|
2460
|
-
);
|
|
2466
|
+
function Or(e) {
|
|
2467
|
+
const { message: t, className: s = "" } = e, { t: n } = D();
|
|
2468
|
+
return /* @__PURE__ */ x("div", { className: `import-loading ${s}`, children: [
|
|
2469
|
+
/* @__PURE__ */ h(xe, { loaderClass: "w-5 h-5", className: "!w-auto" }),
|
|
2470
|
+
/* @__PURE__ */ h("span", { children: t ?? n("_messages:loading.processingFile", {
|
|
2471
|
+
defaultValue: "Processing file..."
|
|
2472
|
+
}) })
|
|
2473
|
+
] });
|
|
2461
2474
|
}
|
|
2462
|
-
function
|
|
2463
|
-
const { items: t, max: s = 5, className: n = "" } = e, { t: i } =
|
|
2475
|
+
function Mr(e) {
|
|
2476
|
+
const { items: t, max: s = 5, className: n = "" } = e, { t: i } = D();
|
|
2464
2477
|
if (!t || t.length === 0) return null;
|
|
2465
2478
|
const r = t.slice(0, s);
|
|
2466
|
-
return /* @__PURE__ */
|
|
2467
|
-
/* @__PURE__ */ h("p", { className: "
|
|
2479
|
+
return /* @__PURE__ */ x("div", { className: `import-preview ${n}`, children: [
|
|
2480
|
+
/* @__PURE__ */ h("p", { className: "import-preview-count", children: i("_pages:common.actions.import.previewCount", {
|
|
2468
2481
|
count: t.length,
|
|
2469
2482
|
defaultValue: `Preview: ${t.length} items`
|
|
2470
2483
|
}) }),
|
|
2471
|
-
/* @__PURE__ */ h("pre", { className: "
|
|
2484
|
+
/* @__PURE__ */ h("pre", { className: "import-preview-content", children: JSON.stringify(r, null, 2) })
|
|
2472
2485
|
] });
|
|
2473
2486
|
}
|
|
2474
|
-
const
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2487
|
+
const ms = () => ({
|
|
2488
|
+
file: null,
|
|
2489
|
+
previewItems: null,
|
|
2490
|
+
parseError: null,
|
|
2491
|
+
processing: !1,
|
|
2492
|
+
overrideExisting: !1,
|
|
2493
|
+
inputKey: 0
|
|
2494
|
+
});
|
|
2495
|
+
function Rr(e, t) {
|
|
2496
|
+
switch (t.type) {
|
|
2497
|
+
case "SET_FILE":
|
|
2498
|
+
return { ...e, file: t.file, previewItems: null, parseError: null, processing: !1 };
|
|
2499
|
+
case "START_PROCESSING":
|
|
2500
|
+
return { ...e, processing: !0 };
|
|
2501
|
+
case "SET_PREVIEW":
|
|
2502
|
+
return { ...e, previewItems: t.items, parseError: null, processing: !1 };
|
|
2503
|
+
case "SET_ERROR":
|
|
2504
|
+
return { ...e, previewItems: null, parseError: t.message, processing: !1 };
|
|
2505
|
+
case "SET_OVERRIDE":
|
|
2506
|
+
return { ...e, overrideExisting: t.value };
|
|
2507
|
+
case "RESET":
|
|
2508
|
+
return { ...ms(), inputKey: e.inputKey + 1 };
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
const Fn = (e) => {
|
|
2512
|
+
const { t } = D(), {
|
|
2513
|
+
children: s,
|
|
2514
|
+
handleSubmit: n,
|
|
2515
|
+
handleClose: i,
|
|
2516
|
+
isLoading: r = !1,
|
|
2517
|
+
fileProcessor: a,
|
|
2518
|
+
onFileProcessed: c,
|
|
2519
|
+
onOverrideChange: l,
|
|
2520
|
+
open: m,
|
|
2521
|
+
...y
|
|
2522
|
+
} = e, [g, f] = Ut(Rr, ms()), { file: p, previewItems: _, parseError: C, processing: N, overrideExisting: B, inputKey: k } = g, F = Ie(c), T = Ie(a);
|
|
2523
|
+
le(() => {
|
|
2524
|
+
F.current = c;
|
|
2525
|
+
}, [c]), le(() => {
|
|
2526
|
+
T.current = a;
|
|
2527
|
+
}, [a]), le(() => {
|
|
2528
|
+
m || f({ type: "RESET" });
|
|
2529
|
+
}, [m]);
|
|
2530
|
+
const A = V(async (I, M) => {
|
|
2531
|
+
var se;
|
|
2532
|
+
if (T.current) {
|
|
2533
|
+
f({ type: "START_PROCESSING" });
|
|
2534
|
+
try {
|
|
2535
|
+
const P = await T.current(I, { override: M });
|
|
2536
|
+
f({ type: "SET_PREVIEW", items: P ?? [] }), (se = F.current) == null || se.call(F, P ?? []);
|
|
2537
|
+
} catch (P) {
|
|
2538
|
+
console.error(P);
|
|
2539
|
+
const re = P instanceof Error ? P.message : "Failed to parse file";
|
|
2540
|
+
f({ type: "SET_ERROR", message: re });
|
|
2507
2541
|
}
|
|
2508
|
-
}
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
return /* @__PURE__ */ $(lt, { ...P, open: q, handleClose: _, children: [
|
|
2542
|
+
}
|
|
2543
|
+
}, []);
|
|
2544
|
+
return /* @__PURE__ */ x(dt, { ...y, open: m, handleClose: i, children: [
|
|
2512
2545
|
/* @__PURE__ */ h(
|
|
2513
|
-
|
|
2546
|
+
Ls,
|
|
2514
2547
|
{
|
|
2515
2548
|
onClear: () => {
|
|
2516
|
-
var
|
|
2517
|
-
|
|
2549
|
+
var I;
|
|
2550
|
+
f({ type: "SET_FILE", file: null }), (I = F.current) == null || I.call(F, []);
|
|
2518
2551
|
},
|
|
2519
|
-
onChange: (
|
|
2520
|
-
var
|
|
2521
|
-
const
|
|
2522
|
-
if (!
|
|
2523
|
-
|
|
2552
|
+
onChange: (I) => {
|
|
2553
|
+
var se, P;
|
|
2554
|
+
const M = (se = I.target.files) == null ? void 0 : se[0];
|
|
2555
|
+
if (!M) {
|
|
2556
|
+
f({ type: "SET_FILE", file: null }), (P = F.current) == null || P.call(F, []);
|
|
2524
2557
|
return;
|
|
2525
2558
|
}
|
|
2526
|
-
|
|
2559
|
+
f({ type: "SET_FILE", file: M }), A(M, B);
|
|
2527
2560
|
},
|
|
2528
2561
|
label: t("_accessibility:labels.file")
|
|
2529
2562
|
},
|
|
2530
|
-
|
|
2563
|
+
k
|
|
2531
2564
|
),
|
|
2532
|
-
/* @__PURE__ */
|
|
2565
|
+
/* @__PURE__ */ x("label", { className: "import-override-label", children: [
|
|
2533
2566
|
/* @__PURE__ */ h(
|
|
2534
2567
|
"input",
|
|
2535
2568
|
{
|
|
2536
2569
|
type: "checkbox",
|
|
2537
|
-
checked:
|
|
2538
|
-
onChange: (
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2570
|
+
checked: B,
|
|
2571
|
+
onChange: (I) => {
|
|
2572
|
+
const M = I.target.checked;
|
|
2573
|
+
f({ type: "SET_OVERRIDE", value: M }), l == null || l(M), p && A(p, M);
|
|
2541
2574
|
}
|
|
2542
2575
|
}
|
|
2543
2576
|
),
|
|
@@ -2545,22 +2578,22 @@ const Cn = (e) => {
|
|
|
2545
2578
|
defaultValue: "Override existing items"
|
|
2546
2579
|
}) })
|
|
2547
2580
|
] }),
|
|
2548
|
-
/* @__PURE__ */ h(
|
|
2549
|
-
|
|
2550
|
-
!!
|
|
2551
|
-
|
|
2581
|
+
/* @__PURE__ */ h(Pr, { message: C }),
|
|
2582
|
+
N && /* @__PURE__ */ h(Or, {}),
|
|
2583
|
+
!!_ && _.length > 0 && /* @__PURE__ */ h(Mr, { items: _ }),
|
|
2584
|
+
s,
|
|
2552
2585
|
/* @__PURE__ */ h(
|
|
2553
|
-
|
|
2586
|
+
ft,
|
|
2554
2587
|
{
|
|
2555
2588
|
primaryText: t("_accessibility:buttons.ok"),
|
|
2556
2589
|
cancelText: t("_accessibility:buttons.cancel"),
|
|
2557
2590
|
onPrimaryClick: () => {
|
|
2558
|
-
(!
|
|
2591
|
+
(!a || !!_ && _.length > 0) && n();
|
|
2559
2592
|
},
|
|
2560
|
-
onCancel:
|
|
2561
|
-
isLoading:
|
|
2593
|
+
onCancel: i,
|
|
2594
|
+
isLoading: r,
|
|
2562
2595
|
primaryType: "button",
|
|
2563
|
-
containerClassName: "
|
|
2596
|
+
containerClassName: "import-dialog-actions",
|
|
2564
2597
|
primaryName: t("_accessibility:buttons.ok"),
|
|
2565
2598
|
primaryAriaLabel: t("_accessibility:ariaLabels.ok"),
|
|
2566
2599
|
cancelName: t("_accessibility:buttons.cancel"),
|
|
@@ -2569,63 +2602,67 @@ const Cn = (e) => {
|
|
|
2569
2602
|
)
|
|
2570
2603
|
] });
|
|
2571
2604
|
};
|
|
2572
|
-
function
|
|
2573
|
-
const { t } =
|
|
2574
|
-
const
|
|
2575
|
-
return
|
|
2576
|
-
}), [
|
|
2577
|
-
(
|
|
2578
|
-
|
|
2605
|
+
function Ln(e) {
|
|
2606
|
+
const { t } = D(), { open: s, onClose: n, menuMap: i, logo: r } = e, { account: a } = es(), { dynamicItems: c } = or(), { linkComponent: l, location: m } = Re(), y = l, g = Ae(() => i.filter((N) => {
|
|
2607
|
+
const B = N.auth, k = !!(a != null && a.email);
|
|
2608
|
+
return B == null || B && k || !B && !k;
|
|
2609
|
+
}), [a == null ? void 0 : a.email, i]), f = V(
|
|
2610
|
+
(N) => {
|
|
2611
|
+
N.key === "Escape" && s && n();
|
|
2579
2612
|
},
|
|
2580
2613
|
[n, s]
|
|
2581
2614
|
);
|
|
2582
|
-
|
|
2583
|
-
document.removeEventListener("keydown",
|
|
2584
|
-
}), [
|
|
2585
|
-
const
|
|
2586
|
-
(
|
|
2587
|
-
[]
|
|
2588
|
-
),
|
|
2589
|
-
(
|
|
2615
|
+
le(() => (document.addEventListener("keydown", f), () => {
|
|
2616
|
+
document.removeEventListener("keydown", f);
|
|
2617
|
+
}), [f]);
|
|
2618
|
+
const p = V(
|
|
2619
|
+
(N, B) => B ? N === `${m.pathname}${m.search}` : N === m.pathname,
|
|
2620
|
+
[m.pathname, m.search]
|
|
2621
|
+
), _ = V(
|
|
2622
|
+
(N) => /* @__PURE__ */ h(
|
|
2590
2623
|
"li",
|
|
2591
2624
|
{
|
|
2592
|
-
className: `drawer-list-item-child ${
|
|
2593
|
-
children:
|
|
2594
|
-
|
|
2625
|
+
className: `drawer-list-item-child ${p(N.path, !0) ? "active" : ""} animated`,
|
|
2626
|
+
children: N.path ? /* @__PURE__ */ h(
|
|
2627
|
+
y,
|
|
2595
2628
|
{
|
|
2596
|
-
|
|
2597
|
-
to:
|
|
2598
|
-
"aria-label": t(`_accessibility:ariaLabels.${
|
|
2629
|
+
tabIndex: s ? 0 : -1,
|
|
2630
|
+
to: N.path ?? "/",
|
|
2631
|
+
"aria-label": t(`_accessibility:ariaLabels.${N.id}`, {
|
|
2632
|
+
defaultValue: N.label
|
|
2633
|
+
}),
|
|
2599
2634
|
className: "drawer-link",
|
|
2600
|
-
children:
|
|
2635
|
+
children: N.label
|
|
2601
2636
|
}
|
|
2602
|
-
) :
|
|
2637
|
+
) : N.label
|
|
2603
2638
|
},
|
|
2604
|
-
|
|
2639
|
+
N.id
|
|
2605
2640
|
),
|
|
2606
|
-
[
|
|
2607
|
-
),
|
|
2608
|
-
const
|
|
2609
|
-
if (
|
|
2610
|
-
return /* @__PURE__ */ h("li", { className:
|
|
2611
|
-
const
|
|
2612
|
-
return /* @__PURE__ */
|
|
2613
|
-
/* @__PURE__ */
|
|
2614
|
-
|
|
2641
|
+
[y, s, t, p]
|
|
2642
|
+
), C = Ae(() => g.map((N, B) => {
|
|
2643
|
+
const k = N.page ?? String(B), F = `drawer-list-item ${p(N.path) ? "active" : ""} animated`;
|
|
2644
|
+
if (N.type === "divider")
|
|
2645
|
+
return /* @__PURE__ */ h("li", { className: F, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, k);
|
|
2646
|
+
const T = N.children ?? (N.page && c ? c[N.page] : null);
|
|
2647
|
+
return /* @__PURE__ */ x("li", { className: F, children: [
|
|
2648
|
+
/* @__PURE__ */ x(
|
|
2649
|
+
y,
|
|
2615
2650
|
{
|
|
2616
|
-
|
|
2617
|
-
to:
|
|
2618
|
-
"aria-label": t(`_accessibility:ariaLabels.${
|
|
2651
|
+
tabIndex: s ? 0 : -1,
|
|
2652
|
+
to: N.path ?? "/",
|
|
2653
|
+
"aria-label": t(`_accessibility:ariaLabels.${String(N.page)}`, {
|
|
2654
|
+
defaultValue: t(`_pages:${String(N.page)}.title`)
|
|
2655
|
+
}),
|
|
2619
2656
|
className: "drawer-link",
|
|
2620
2657
|
children: [
|
|
2621
|
-
|
|
2622
|
-
t(`_pages:${
|
|
2658
|
+
N.icon,
|
|
2659
|
+
t(`_pages:${N.page}.title`)
|
|
2623
2660
|
]
|
|
2624
2661
|
}
|
|
2625
2662
|
),
|
|
2626
|
-
|
|
2627
|
-
] },
|
|
2628
|
-
}), [
|
|
2663
|
+
T && /* @__PURE__ */ h("ul", { className: "drawer-children-list", children: T.map(_) })
|
|
2664
|
+
] }, k);
|
|
2665
|
+
}), [y, c, p, s, g, _, t]);
|
|
2629
2666
|
return /* @__PURE__ */ h(
|
|
2630
2667
|
"div",
|
|
2631
2668
|
{
|
|
@@ -2633,31 +2670,32 @@ function kn(e) {
|
|
|
2633
2670
|
"aria-disabled": !s,
|
|
2634
2671
|
className: `${s ? "opened" : "closed"} drawer-backdrop`,
|
|
2635
2672
|
onClick: () => n(),
|
|
2636
|
-
children: /* @__PURE__ */
|
|
2637
|
-
/* @__PURE__ */
|
|
2673
|
+
children: /* @__PURE__ */ x("aside", { className: `${s ? "opened" : "closed"} drawer animated`, children: [
|
|
2674
|
+
/* @__PURE__ */ x("div", { className: "drawer-header-container", children: [
|
|
2638
2675
|
r,
|
|
2639
2676
|
/* @__PURE__ */ h("h2", { className: "drawer-header poppins", children: t("_pages:home.appName") })
|
|
2640
2677
|
] }),
|
|
2641
|
-
/* @__PURE__ */ h("ul", { className: "
|
|
2678
|
+
/* @__PURE__ */ h("ul", { className: "drawer-menu-list", children: C })
|
|
2642
2679
|
] })
|
|
2643
2680
|
}
|
|
2644
2681
|
);
|
|
2645
2682
|
}
|
|
2646
|
-
function
|
|
2647
|
-
const { error: t } = e, { t:
|
|
2648
|
-
return /* @__PURE__ */
|
|
2649
|
-
/* @__PURE__ */ h(ce, { icon:
|
|
2650
|
-
/* @__PURE__ */ h("p", { className: "
|
|
2683
|
+
function Dn(e) {
|
|
2684
|
+
const { error: t, resetErrorBoundary: s } = e, { t: n } = D();
|
|
2685
|
+
return /* @__PURE__ */ x("div", { className: "error-container", children: [
|
|
2686
|
+
/* @__PURE__ */ h(ce, { icon: Zs, className: "error-icon" }),
|
|
2687
|
+
/* @__PURE__ */ h("p", { className: "error-message", children: (t == null ? void 0 : t.message) ?? n("_accessibility:errors.unknownError") }),
|
|
2688
|
+
s && /* @__PURE__ */ h("button", { className: "error-retry", onClick: s, children: n("_accessibility:actions.retry", { defaultValue: "Retry" }) })
|
|
2651
2689
|
] });
|
|
2652
2690
|
}
|
|
2653
|
-
const
|
|
2654
|
-
const { showBackButton: t, title: s, actions: n } = e, { t: i } =
|
|
2655
|
-
return /* @__PURE__ */
|
|
2656
|
-
/* @__PURE__ */
|
|
2691
|
+
const Ur = (e) => {
|
|
2692
|
+
const { showBackButton: t, title: s, actions: n } = e, { t: i } = D(), { navigate: r } = Re();
|
|
2693
|
+
return /* @__PURE__ */ x("div", { className: "page-header", children: [
|
|
2694
|
+
/* @__PURE__ */ x("div", { className: "page-header-left", children: [
|
|
2657
2695
|
t && /* @__PURE__ */ h(
|
|
2658
|
-
|
|
2696
|
+
pe,
|
|
2659
2697
|
{
|
|
2660
|
-
icon:
|
|
2698
|
+
icon: Qs,
|
|
2661
2699
|
onClick: () => r(-1),
|
|
2662
2700
|
name: i("_accessibility:buttons.back"),
|
|
2663
2701
|
"data-tooltip-id": "tooltip",
|
|
@@ -2666,38 +2704,38 @@ const Pr = (e) => {
|
|
|
2666
2704
|
),
|
|
2667
2705
|
/* @__PURE__ */ h("h2", { className: "page-header-title", children: s })
|
|
2668
2706
|
] }),
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */ h(
|
|
2671
|
-
/* @__PURE__ */ h(
|
|
2707
|
+
/* @__PURE__ */ x("div", { children: [
|
|
2708
|
+
/* @__PURE__ */ h(Wt, { className: "page-header-actions-desktop", actions: n ?? [] }),
|
|
2709
|
+
/* @__PURE__ */ h(Ir, { className: "page-header-actions-mobile", actions: n ?? [] })
|
|
2672
2710
|
] })
|
|
2673
2711
|
] });
|
|
2674
|
-
},
|
|
2712
|
+
}, Vn = (e) => {
|
|
2675
2713
|
const {
|
|
2676
2714
|
title: t,
|
|
2677
2715
|
children: s,
|
|
2678
2716
|
addOptions: n,
|
|
2679
2717
|
filterOptions: i,
|
|
2680
2718
|
actions: r,
|
|
2681
|
-
queryKey:
|
|
2682
|
-
isLoading:
|
|
2683
|
-
isAnimated:
|
|
2684
|
-
showBackButton:
|
|
2685
|
-
} = e, { t:
|
|
2719
|
+
queryKey: a,
|
|
2720
|
+
isLoading: c = !1,
|
|
2721
|
+
isAnimated: l = !0,
|
|
2722
|
+
showBackButton: m = !1
|
|
2723
|
+
} = e, { t: y } = D(), { countOfFilters: g } = Ds(), f = Ae(() => {
|
|
2686
2724
|
const p = Array.isArray(r) ? [...r] : [];
|
|
2687
|
-
if (
|
|
2725
|
+
if (a) {
|
|
2688
2726
|
const _ = {
|
|
2689
|
-
id:
|
|
2690
|
-
onClick: () =>
|
|
2691
|
-
icon: /* @__PURE__ */ h(ce, { icon:
|
|
2692
|
-
tooltip:
|
|
2727
|
+
id: Se.Refresh,
|
|
2728
|
+
onClick: () => be.invalidateQueries({ queryKey: a }),
|
|
2729
|
+
icon: /* @__PURE__ */ h(ce, { icon: Ht }),
|
|
2730
|
+
tooltip: y("_pages:common.actions.refresh.text")
|
|
2693
2731
|
};
|
|
2694
2732
|
p.unshift(_);
|
|
2695
2733
|
}
|
|
2696
2734
|
if (n) {
|
|
2697
2735
|
const _ = {
|
|
2698
2736
|
...n,
|
|
2699
|
-
id:
|
|
2700
|
-
icon: /* @__PURE__ */ h(ce, { icon:
|
|
2737
|
+
id: Se.Add,
|
|
2738
|
+
icon: /* @__PURE__ */ h(ce, { icon: St })
|
|
2701
2739
|
};
|
|
2702
2740
|
p.unshift(_);
|
|
2703
2741
|
}
|
|
@@ -2705,9 +2743,9 @@ const Pr = (e) => {
|
|
|
2705
2743
|
const _ = {
|
|
2706
2744
|
...i,
|
|
2707
2745
|
id: "filter",
|
|
2708
|
-
icon: /* @__PURE__ */ h(ce, { icon:
|
|
2746
|
+
icon: /* @__PURE__ */ h(ce, { icon: Ks }),
|
|
2709
2747
|
children: /* @__PURE__ */ h(
|
|
2710
|
-
|
|
2748
|
+
Vs,
|
|
2711
2749
|
{
|
|
2712
2750
|
className: `${g > 0 ? "show" : "hide"} `,
|
|
2713
2751
|
count: g
|
|
@@ -2717,81 +2755,81 @@ const Pr = (e) => {
|
|
|
2717
2755
|
p.push(_);
|
|
2718
2756
|
}
|
|
2719
2757
|
return p;
|
|
2720
|
-
}, [r, n, g, i,
|
|
2721
|
-
return /* @__PURE__ */
|
|
2758
|
+
}, [r, n, g, i, a, y]);
|
|
2759
|
+
return /* @__PURE__ */ x("main", { className: "page-main", children: [
|
|
2722
2760
|
/* @__PURE__ */ h(
|
|
2723
|
-
|
|
2761
|
+
Ur,
|
|
2724
2762
|
{
|
|
2725
|
-
showBackButton:
|
|
2726
|
-
actions:
|
|
2763
|
+
showBackButton: m,
|
|
2764
|
+
actions: f,
|
|
2727
2765
|
title: t
|
|
2728
2766
|
}
|
|
2729
2767
|
),
|
|
2730
|
-
/* @__PURE__ */ h("div", { className: `page-main-content ${
|
|
2768
|
+
/* @__PURE__ */ h("div", { className: `page-main-content ${l ? "appear" : ""}`, children: c ? /* @__PURE__ */ h(xe, { className: "page-loading" }) : s }),
|
|
2731
2769
|
n && /* @__PURE__ */ h(
|
|
2732
|
-
|
|
2770
|
+
pe,
|
|
2733
2771
|
{
|
|
2734
|
-
icon: n.icon ??
|
|
2772
|
+
icon: n.icon ?? St,
|
|
2735
2773
|
color: n.color ?? "primary",
|
|
2736
2774
|
variant: n.variant ?? "submit",
|
|
2737
2775
|
onClick: () => {
|
|
2738
2776
|
var p;
|
|
2739
2777
|
return (p = n.onClick) == null ? void 0 : p.call(n);
|
|
2740
2778
|
},
|
|
2741
|
-
className: `button fab
|
|
2779
|
+
className: `button fab ${n.className ?? ""}`
|
|
2742
2780
|
}
|
|
2743
2781
|
)
|
|
2744
2782
|
] });
|
|
2745
|
-
},
|
|
2746
|
-
const { t } =
|
|
2783
|
+
}, In = (e) => {
|
|
2784
|
+
const { t } = D(), {
|
|
2747
2785
|
className: s = "",
|
|
2748
2786
|
itemClassName: n = "",
|
|
2749
2787
|
loading: i = !1,
|
|
2750
2788
|
emptyComponent: r = null,
|
|
2751
|
-
emptyMessage:
|
|
2752
|
-
renderComponent:
|
|
2753
|
-
data:
|
|
2789
|
+
emptyMessage: a = t("_accessibility:messages.empty"),
|
|
2790
|
+
renderComponent: c,
|
|
2791
|
+
data: l = []
|
|
2754
2792
|
} = e;
|
|
2755
|
-
return /* @__PURE__ */ h(
|
|
2756
|
-
},
|
|
2757
|
-
const [e, t] =
|
|
2758
|
-
return
|
|
2793
|
+
return i ? /* @__PURE__ */ h(xe, {}) : /* @__PURE__ */ h(Ve, { children: l != null && l.length ? /* @__PURE__ */ h("ul", { className: `pretty-grid-main ${s}`, children: l == null ? void 0 : l.map((m) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${n}`, children: c(m) }, m.id)) }) : /* @__PURE__ */ h(Ve, { children: r || /* @__PURE__ */ h(Gr, { message: a }) }) });
|
|
2794
|
+
}, qr = () => {
|
|
2795
|
+
const [e, t] = J(kt());
|
|
2796
|
+
return le(() => {
|
|
2759
2797
|
const s = window.matchMedia("(min-width: 768px)"), n = () => {
|
|
2760
2798
|
t(
|
|
2761
|
-
s.matches ?
|
|
2799
|
+
s.matches ? kt() : nr()
|
|
2762
2800
|
);
|
|
2763
2801
|
}, i = setInterval(n, 1e3);
|
|
2764
2802
|
return s.addEventListener("change", n), () => {
|
|
2765
2803
|
clearInterval(i), s.removeEventListener("change", n);
|
|
2766
2804
|
};
|
|
2767
|
-
}, []), /* @__PURE__ */ h("p", { className: "
|
|
2805
|
+
}, []), /* @__PURE__ */ h("p", { className: "clock", children: e });
|
|
2768
2806
|
};
|
|
2769
|
-
function
|
|
2770
|
-
const { t } =
|
|
2807
|
+
function Pn(e) {
|
|
2808
|
+
const { t } = D(), {
|
|
2771
2809
|
openDrawer: s,
|
|
2772
2810
|
showClock: n = !0,
|
|
2773
2811
|
showSearch: i = !0,
|
|
2774
2812
|
menuButtonProps: r
|
|
2775
|
-
} = e, { searchComponent: c } =
|
|
2776
|
-
(
|
|
2813
|
+
} = e, { searchComponent: a, location: c } = Re(), [l, m] = J(!1), y = V((f) => {
|
|
2814
|
+
(ir() ? f.metaKey : f.ctrlKey) && f.shiftKey && f.key.toLowerCase() === "f" && (m(!0), f.preventDefault());
|
|
2777
2815
|
}, []);
|
|
2778
|
-
|
|
2779
|
-
window.removeEventListener("keydown",
|
|
2780
|
-
}), [
|
|
2781
|
-
const
|
|
2782
|
-
return /* @__PURE__ */
|
|
2783
|
-
|
|
2784
|
-
/* @__PURE__ */
|
|
2785
|
-
/* @__PURE__ */
|
|
2816
|
+
le(() => (window.addEventListener("keydown", y), () => {
|
|
2817
|
+
window.removeEventListener("keydown", y);
|
|
2818
|
+
}), [y]);
|
|
2819
|
+
const g = a;
|
|
2820
|
+
return /* @__PURE__ */ x(Ve, { children: [
|
|
2821
|
+
c.pathname !== "/" && !!g && /* @__PURE__ */ h(g, { open: l, onClose: () => m(!1) }),
|
|
2822
|
+
/* @__PURE__ */ x("header", { id: "header", className: "header", children: [
|
|
2823
|
+
/* @__PURE__ */ x("div", { className: "navbar-left", children: [
|
|
2786
2824
|
/* @__PURE__ */ h(
|
|
2787
|
-
|
|
2825
|
+
pe,
|
|
2788
2826
|
{
|
|
2789
2827
|
...r,
|
|
2790
2828
|
type: (r == null ? void 0 : r.type) ?? "button",
|
|
2791
|
-
icon: (r == null ? void 0 : r.icon) ??
|
|
2792
|
-
onClick: (
|
|
2793
|
-
var
|
|
2794
|
-
(
|
|
2829
|
+
icon: (r == null ? void 0 : r.icon) ?? js,
|
|
2830
|
+
onClick: (f) => {
|
|
2831
|
+
var p;
|
|
2832
|
+
(p = r == null ? void 0 : r.onClick) == null || p.call(r, f), s();
|
|
2795
2833
|
},
|
|
2796
2834
|
name: (r == null ? void 0 : r.name) ?? t("_accessibility:buttons.openMenu"),
|
|
2797
2835
|
"aria-label": (r == null ? void 0 : r["aria-label"]) ?? t("_accessibility:ariaLabels.openMenu"),
|
|
@@ -2800,149 +2838,160 @@ function $n(e) {
|
|
|
2800
2838
|
),
|
|
2801
2839
|
/* @__PURE__ */ h("h1", { className: "poppins navbar-title", children: t("_pages:home.appName") })
|
|
2802
2840
|
] }),
|
|
2803
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ x("div", { className: "navbar-right", children: [
|
|
2804
2842
|
i && /* @__PURE__ */ h(
|
|
2805
|
-
|
|
2843
|
+
pe,
|
|
2806
2844
|
{
|
|
2807
|
-
icon:
|
|
2808
|
-
className: "
|
|
2809
|
-
onClick: () =>
|
|
2845
|
+
icon: Ws,
|
|
2846
|
+
className: "navbar-search-btn",
|
|
2847
|
+
onClick: () => m(!0)
|
|
2810
2848
|
}
|
|
2811
2849
|
),
|
|
2812
|
-
n && /* @__PURE__ */ h(
|
|
2850
|
+
n && /* @__PURE__ */ h(qr, {})
|
|
2813
2851
|
] })
|
|
2814
2852
|
] })
|
|
2815
2853
|
] });
|
|
2816
2854
|
}
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2855
|
+
const Be = 300, Hr = (e) => e ?? z.error, Br = (e) => {
|
|
2856
|
+
switch (e) {
|
|
2857
|
+
case z.error:
|
|
2858
|
+
return Js;
|
|
2859
|
+
default:
|
|
2860
|
+
return Gs;
|
|
2861
|
+
}
|
|
2862
|
+
}, nt = (e) => {
|
|
2863
|
+
switch (e) {
|
|
2864
|
+
case z.success:
|
|
2865
|
+
return "!text-success";
|
|
2866
|
+
case z.error:
|
|
2867
|
+
return "!text-error";
|
|
2868
|
+
case z.warning:
|
|
2869
|
+
return "!text-warning";
|
|
2870
|
+
default:
|
|
2871
|
+
return "!text-info";
|
|
2872
|
+
}
|
|
2873
|
+
}, Qr = (e) => {
|
|
2874
|
+
switch (e) {
|
|
2875
|
+
case z.success:
|
|
2876
|
+
return "bg-bg-success";
|
|
2877
|
+
case z.error:
|
|
2878
|
+
return "bg-bg-error";
|
|
2879
|
+
case z.warning:
|
|
2880
|
+
return "bg-bg-warning";
|
|
2881
|
+
default:
|
|
2882
|
+
return "bg-bg-info";
|
|
2883
|
+
}
|
|
2884
|
+
};
|
|
2885
|
+
function On() {
|
|
2886
|
+
const { t: e } = D(), { notification: t, removeNotification: s } = Ne(), [n, i] = J([]), r = Ie(n);
|
|
2887
|
+
Is(() => {
|
|
2888
|
+
r.current = n;
|
|
2889
|
+
});
|
|
2890
|
+
const a = Ie(null), c = V(
|
|
2891
|
+
(l) => {
|
|
2892
|
+
i(
|
|
2893
|
+
(m) => l !== void 0 ? m.map((y) => y.id === l ? { ...y, closing: !0 } : y) : m.map((y) => ({ ...y, closing: !0 }))
|
|
2894
|
+
), l !== void 0 ? setTimeout(() => {
|
|
2895
|
+
s(l), i((m) => m.filter((y) => y.id !== l));
|
|
2896
|
+
}, Be) : (a.current && clearTimeout(a.current), a.current = setTimeout(() => {
|
|
2897
|
+
s(), i([]), a.current = null;
|
|
2898
|
+
}, Be));
|
|
2827
2899
|
},
|
|
2828
|
-
[
|
|
2829
|
-
)
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
return "bg-bg-error";
|
|
2853
|
-
case j.warning:
|
|
2854
|
-
return "bg-bg-warning";
|
|
2855
|
-
default:
|
|
2856
|
-
return "bg-bg-info";
|
|
2900
|
+
[s]
|
|
2901
|
+
);
|
|
2902
|
+
return le(() => {
|
|
2903
|
+
let l = null;
|
|
2904
|
+
const m = () => {
|
|
2905
|
+
l && clearTimeout(l), a.current && (clearTimeout(a.current), a.current = null);
|
|
2906
|
+
};
|
|
2907
|
+
if (t.length === 0)
|
|
2908
|
+
return r.current.length === 0 ? void 0 : (a.current && clearTimeout(a.current), l = setTimeout(() => {
|
|
2909
|
+
i((p) => p.map((_) => ({ ..._, closing: !0 }))), l = null;
|
|
2910
|
+
}, 0), a.current = setTimeout(() => {
|
|
2911
|
+
i([]), a.current = null;
|
|
2912
|
+
}, Be), m);
|
|
2913
|
+
const y = new Set(r.current.map((p) => p.id));
|
|
2914
|
+
if (!t.some(
|
|
2915
|
+
(p) => p.id !== void 0 && !y.has(p.id)
|
|
2916
|
+
)) return;
|
|
2917
|
+
if (r.current.length === 0) {
|
|
2918
|
+
const p = [...t];
|
|
2919
|
+
return l = setTimeout(() => {
|
|
2920
|
+
i(p.map((_) => ({ ..._, closing: !1 }))), l = null;
|
|
2921
|
+
}, 0), () => {
|
|
2922
|
+
l && clearTimeout(l);
|
|
2923
|
+
};
|
|
2857
2924
|
}
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
if (!(t != null && t.length)) return;
|
|
2863
|
-
let p;
|
|
2864
|
-
const _ = window.setTimeout(() => {
|
|
2865
|
-
p = (y) => {
|
|
2866
|
-
var E;
|
|
2867
|
-
return (E = g.current) == null ? void 0 : E.call(g, y);
|
|
2868
|
-
}, window.addEventListener("click", p);
|
|
2925
|
+
a.current && clearTimeout(a.current), l = setTimeout(() => {
|
|
2926
|
+
i(
|
|
2927
|
+
(p) => p.every((_) => _.closing) ? p : p.map((_) => ({ ..._, closing: !0 }))
|
|
2928
|
+
), l = null;
|
|
2869
2929
|
}, 0);
|
|
2870
|
-
|
|
2871
|
-
|
|
2930
|
+
const f = [...t];
|
|
2931
|
+
return a.current = setTimeout(() => {
|
|
2932
|
+
i(f.map((p) => ({ ...p, closing: !1 }))), a.current = null;
|
|
2933
|
+
}, Be), m;
|
|
2934
|
+
}, [t]), le(() => {
|
|
2935
|
+
if (!n.length) return;
|
|
2936
|
+
let l;
|
|
2937
|
+
const m = window.setTimeout(() => {
|
|
2938
|
+
l = () => c(), window.addEventListener("click", l);
|
|
2939
|
+
}, 0), y = (g) => {
|
|
2940
|
+
g.key === "Escape" && c();
|
|
2872
2941
|
};
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
},
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
className: `notification-portal ${t != null && t.length ? "w-screen h-screen" : ""}`,
|
|
2887
|
-
children: t != null && t.length ? t == null ? void 0 : t.map(({ id: p, type: _, message: y }, E) => /* @__PURE__ */ $(
|
|
2888
|
-
"div",
|
|
2889
|
-
{
|
|
2890
|
-
className: `notification ${n.has(E) ? "closing" : ""} ${b(
|
|
2891
|
-
_ ?? j.error
|
|
2892
|
-
)}`,
|
|
2893
|
-
onClick: (H) => H.stopPropagation(),
|
|
2894
|
-
children: [
|
|
2895
|
-
/* @__PURE__ */ $("div", { className: "flex gap-3 items-center", children: [
|
|
2896
|
-
/* @__PURE__ */ h(
|
|
2897
|
-
ce,
|
|
2898
|
-
{
|
|
2899
|
-
icon: d(_ ?? j.error),
|
|
2900
|
-
className: `${f(_ ?? j.error)}`
|
|
2901
|
-
}
|
|
2902
|
-
),
|
|
2903
|
-
/* @__PURE__ */ h(
|
|
2904
|
-
"p",
|
|
2905
|
-
{
|
|
2906
|
-
className: `whitespace-nowrap ${f(
|
|
2907
|
-
_ ?? j.error
|
|
2908
|
-
)}`,
|
|
2909
|
-
children: y
|
|
2910
|
-
}
|
|
2911
|
-
)
|
|
2912
|
-
] }),
|
|
2942
|
+
return window.addEventListener("keydown", y), () => {
|
|
2943
|
+
window.clearTimeout(m), l && window.removeEventListener("click", l), window.removeEventListener("keydown", y);
|
|
2944
|
+
};
|
|
2945
|
+
}, [n.length, c]), Kt(
|
|
2946
|
+
/* @__PURE__ */ h("div", { className: `notification-portal ${n.length ? "active" : ""}`, children: n.map(({ id: l, type: m, message: y, closing: g }) => {
|
|
2947
|
+
const f = Hr(m);
|
|
2948
|
+
return /* @__PURE__ */ x(
|
|
2949
|
+
"div",
|
|
2950
|
+
{
|
|
2951
|
+
className: `notification ${g ? "closing" : ""} ${Qr(f)}`,
|
|
2952
|
+
onClick: (p) => p.stopPropagation(),
|
|
2953
|
+
children: [
|
|
2954
|
+
/* @__PURE__ */ x("div", { className: "notification-body", children: [
|
|
2913
2955
|
/* @__PURE__ */ h(
|
|
2914
|
-
|
|
2956
|
+
ce,
|
|
2915
2957
|
{
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
color: "error",
|
|
2919
|
-
className: "group",
|
|
2920
|
-
onClick: (H) => {
|
|
2921
|
-
H.stopPropagation(), o(E);
|
|
2922
|
-
},
|
|
2923
|
-
iconClassName: `${f(
|
|
2924
|
-
_ ?? j.error
|
|
2925
|
-
)} group-hover:!text-red-400 cursor-pointer`,
|
|
2926
|
-
name: e("_accessibility:buttons.closeNotification"),
|
|
2927
|
-
"aria-label": e("_accessibility:ariaLabels.closeNotification")
|
|
2958
|
+
icon: Br(f),
|
|
2959
|
+
className: `notification-icon ${nt(f)}`
|
|
2928
2960
|
}
|
|
2929
|
-
)
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2961
|
+
),
|
|
2962
|
+
/* @__PURE__ */ h("p", { className: `notification-text ${nt(f)}`, children: y })
|
|
2963
|
+
] }),
|
|
2964
|
+
/* @__PURE__ */ h(
|
|
2965
|
+
pe,
|
|
2966
|
+
{
|
|
2967
|
+
type: "button",
|
|
2968
|
+
icon: Qt,
|
|
2969
|
+
color: "error",
|
|
2970
|
+
className: "notification-close group",
|
|
2971
|
+
onClick: (p) => {
|
|
2972
|
+
p.stopPropagation(), l !== void 0 && c(l);
|
|
2973
|
+
},
|
|
2974
|
+
iconClassName: `${nt(f)} notification-close-icon`,
|
|
2975
|
+
name: e("_accessibility:buttons.closeNotification"),
|
|
2976
|
+
"aria-label": e("_accessibility:ariaLabels.closeNotification")
|
|
2977
|
+
}
|
|
2978
|
+
)
|
|
2979
|
+
]
|
|
2980
|
+
},
|
|
2981
|
+
l
|
|
2982
|
+
);
|
|
2983
|
+
}) }),
|
|
2936
2984
|
document.body
|
|
2937
2985
|
);
|
|
2938
2986
|
}
|
|
2939
|
-
function
|
|
2940
|
-
|
|
2987
|
+
function Mn(e) {
|
|
2988
|
+
const { className: t, ...s } = e;
|
|
2989
|
+
return /* @__PURE__ */ h("div", { className: "splash-screen", children: /* @__PURE__ */ h(xe, { className: `blur-appear ${t ? ` ${t}` : ""}`, ...s }) });
|
|
2941
2990
|
}
|
|
2942
|
-
const
|
|
2943
|
-
const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent:
|
|
2991
|
+
const Kr = (e) => {
|
|
2992
|
+
const { id: t, active: s, onClick: n, children: i, to: r } = e, { linkComponent: a } = Re();
|
|
2944
2993
|
return /* @__PURE__ */ h(
|
|
2945
|
-
|
|
2994
|
+
a,
|
|
2946
2995
|
{
|
|
2947
2996
|
to: r ?? `#${t}`,
|
|
2948
2997
|
onClick: () => n(),
|
|
@@ -2950,197 +2999,197 @@ const Mr = (e) => {
|
|
|
2950
2999
|
children: i
|
|
2951
3000
|
}
|
|
2952
3001
|
);
|
|
2953
|
-
},
|
|
2954
|
-
var
|
|
3002
|
+
}, jr = (e) => {
|
|
3003
|
+
var l;
|
|
2955
3004
|
const {
|
|
2956
3005
|
tabs: t = [],
|
|
2957
3006
|
defaultTab: s,
|
|
2958
3007
|
className: n = "",
|
|
2959
3008
|
tabsContainerClassName: i = ""
|
|
2960
|
-
} = e, [r,
|
|
2961
|
-
return /* @__PURE__ */
|
|
3009
|
+
} = e, [r, a] = J(s ?? ((l = t[0]) == null ? void 0 : l.id)), c = Ae(() => t.find((m) => m.id === r), [t, r]);
|
|
3010
|
+
return /* @__PURE__ */ x("div", { className: `tabs-layout-main ${n}`, children: [
|
|
2962
3011
|
/* @__PURE__ */ h(
|
|
2963
3012
|
"ul",
|
|
2964
3013
|
{
|
|
2965
3014
|
className: `horizontal tabs tabs-container ${i}`,
|
|
2966
|
-
children: t.map(({ id:
|
|
2967
|
-
|
|
3015
|
+
children: t.map(({ id: m, to: y, label: g }) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
|
|
3016
|
+
Kr,
|
|
2968
3017
|
{
|
|
2969
|
-
onClick: () =>
|
|
2970
|
-
id:
|
|
2971
|
-
to:
|
|
3018
|
+
onClick: () => a(m),
|
|
3019
|
+
id: m,
|
|
3020
|
+
to: y ?? "",
|
|
2972
3021
|
siblings: t.length > 1,
|
|
2973
|
-
active: r ===
|
|
3022
|
+
active: r === m,
|
|
2974
3023
|
children: g
|
|
2975
3024
|
}
|
|
2976
|
-
) },
|
|
3025
|
+
) }, m))
|
|
2977
3026
|
}
|
|
2978
3027
|
),
|
|
2979
|
-
|
|
3028
|
+
c == null ? void 0 : c.content
|
|
2980
3029
|
] });
|
|
2981
|
-
},
|
|
3030
|
+
}, Wr = (e) => {
|
|
2982
3031
|
const {
|
|
2983
3032
|
translation: t,
|
|
2984
3033
|
onClickNext: s,
|
|
2985
3034
|
image: n = "",
|
|
2986
3035
|
alt: i = "",
|
|
2987
3036
|
final: r = !1
|
|
2988
|
-
} = e, { setGuestMode: c } =
|
|
2989
|
-
return /* @__PURE__ */
|
|
2990
|
-
/* @__PURE__ */ h("img", { src: n, alt: i }),
|
|
2991
|
-
/* @__PURE__ */ h("h2", { className: "
|
|
2992
|
-
/* @__PURE__ */ h("p", { className: "
|
|
2993
|
-
/* @__PURE__ */ h("div", { className: "
|
|
3037
|
+
} = e, { setGuestMode: a } = es(), { navigate: c } = Re(), { t: l } = D();
|
|
3038
|
+
return /* @__PURE__ */ x("div", { className: "big-appear step-container", children: [
|
|
3039
|
+
n && /* @__PURE__ */ h("img", { src: n, alt: i }),
|
|
3040
|
+
/* @__PURE__ */ h("h2", { className: "step-title", children: l(`_pages:onboarding.${t}.title`) }),
|
|
3041
|
+
/* @__PURE__ */ h("p", { className: "step-body", children: l(`_pages:onboarding.${t}.body`) }),
|
|
3042
|
+
/* @__PURE__ */ h("div", { className: "step-actions", children: r ? /* @__PURE__ */ x(Ve, { children: [
|
|
2994
3043
|
/* @__PURE__ */ h(
|
|
2995
|
-
|
|
3044
|
+
_e,
|
|
2996
3045
|
{
|
|
2997
3046
|
color: "primary",
|
|
2998
|
-
className: "
|
|
3047
|
+
className: "step-button",
|
|
2999
3048
|
variant: "outlined",
|
|
3000
3049
|
onClick: () => {
|
|
3001
|
-
|
|
3050
|
+
a(!0), c("/");
|
|
3002
3051
|
},
|
|
3003
|
-
"aria-label":
|
|
3004
|
-
children:
|
|
3052
|
+
"aria-label": l("_accessibility:ariaLabels.start"),
|
|
3053
|
+
children: l("_accessibility:buttons.startAsGuest")
|
|
3005
3054
|
}
|
|
3006
3055
|
),
|
|
3007
3056
|
/* @__PURE__ */ h(
|
|
3008
|
-
|
|
3057
|
+
_e,
|
|
3009
3058
|
{
|
|
3010
3059
|
color: "primary",
|
|
3011
3060
|
variant: "submit",
|
|
3012
|
-
className: "
|
|
3013
|
-
"aria-label":
|
|
3014
|
-
onClick: () =>
|
|
3015
|
-
children:
|
|
3061
|
+
className: "step-button",
|
|
3062
|
+
"aria-label": l("_accessibility:ariaLabels.start"),
|
|
3063
|
+
onClick: () => c("/auth/sign-in"),
|
|
3064
|
+
children: l("_accessibility:buttons.signIn")
|
|
3016
3065
|
}
|
|
3017
3066
|
)
|
|
3018
|
-
] }) : /* @__PURE__ */
|
|
3067
|
+
] }) : /* @__PURE__ */ x(Ve, { children: [
|
|
3019
3068
|
/* @__PURE__ */ h(
|
|
3020
|
-
|
|
3069
|
+
_e,
|
|
3021
3070
|
{
|
|
3022
3071
|
color: "primary",
|
|
3023
|
-
className: "
|
|
3072
|
+
className: "step-button",
|
|
3024
3073
|
variant: "outlined",
|
|
3025
|
-
onClick: () =>
|
|
3026
|
-
"aria-label":
|
|
3027
|
-
children:
|
|
3074
|
+
onClick: () => c("/auth/sign-in"),
|
|
3075
|
+
"aria-label": l("_accessibility:ariaLabels.skip"),
|
|
3076
|
+
children: l("_accessibility:buttons.skip")
|
|
3028
3077
|
}
|
|
3029
3078
|
),
|
|
3030
3079
|
/* @__PURE__ */ h(
|
|
3031
|
-
|
|
3080
|
+
_e,
|
|
3032
3081
|
{
|
|
3033
3082
|
color: "primary",
|
|
3034
|
-
className: "
|
|
3083
|
+
className: "step-button",
|
|
3035
3084
|
variant: "outlined",
|
|
3036
3085
|
onClick: () => s(),
|
|
3037
|
-
"aria-label":
|
|
3038
|
-
children:
|
|
3086
|
+
"aria-label": l("_accessibility:ariaLabels.next"),
|
|
3087
|
+
children: l("_accessibility:buttons.next")
|
|
3039
3088
|
}
|
|
3040
3089
|
)
|
|
3041
3090
|
] }) })
|
|
3042
3091
|
] });
|
|
3043
|
-
},
|
|
3044
|
-
const { steps: t } = e, [s, n] =
|
|
3045
|
-
id:
|
|
3092
|
+
}, Rn = (e) => {
|
|
3093
|
+
const { steps: t } = e, [s, n] = J(1), i = Ae(() => t.map((r, a) => ({
|
|
3094
|
+
id: a + 1,
|
|
3046
3095
|
label: "",
|
|
3047
3096
|
content: /* @__PURE__ */ h(
|
|
3048
|
-
|
|
3097
|
+
Wr,
|
|
3049
3098
|
{
|
|
3050
3099
|
translation: r,
|
|
3051
|
-
final:
|
|
3052
|
-
onClickNext: () => n((
|
|
3100
|
+
final: a === t.length - 1,
|
|
3101
|
+
onClickNext: () => n((c) => c + 1)
|
|
3053
3102
|
}
|
|
3054
3103
|
)
|
|
3055
3104
|
})), [t]);
|
|
3056
|
-
return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(
|
|
3057
|
-
},
|
|
3105
|
+
return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(jr, { defaultTab: s, tabs: i }) });
|
|
3106
|
+
}, Gr = (e) => {
|
|
3058
3107
|
const {
|
|
3059
3108
|
message: t,
|
|
3060
|
-
messageProps: s = { className: "
|
|
3109
|
+
messageProps: s = { className: "empty-message" },
|
|
3061
3110
|
action: n,
|
|
3062
3111
|
iconProps: i
|
|
3063
3112
|
} = e;
|
|
3064
|
-
return /* @__PURE__ */
|
|
3065
|
-
i && /* @__PURE__ */ h(ce, { ...i
|
|
3066
|
-
/* @__PURE__ */ h("p", { ...s
|
|
3067
|
-
n && /* @__PURE__ */ h(
|
|
3113
|
+
return /* @__PURE__ */ x("div", { className: "empty-container", children: [
|
|
3114
|
+
i && /* @__PURE__ */ h(ce, { ...i }),
|
|
3115
|
+
/* @__PURE__ */ h("p", { ...s, children: t }),
|
|
3116
|
+
n && /* @__PURE__ */ h(jt, { showTooltips: !1, showText: !0, ...n })
|
|
3068
3117
|
] });
|
|
3069
3118
|
};
|
|
3070
3119
|
export {
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3120
|
+
Jt as APIClient,
|
|
3121
|
+
jt as Action,
|
|
3122
|
+
Wt as Actions,
|
|
3123
|
+
Ir as ActionsDropdown,
|
|
3124
|
+
pe as AppIconButton,
|
|
3125
|
+
rr as AuthClient,
|
|
3126
|
+
yn as AuthProvider,
|
|
3127
|
+
ln as BaseClient,
|
|
3128
|
+
Bn as Button,
|
|
3129
|
+
gn as ConfigProvider,
|
|
3130
|
+
$n as ConfirmationDialog,
|
|
3131
|
+
dt as Dialog,
|
|
3132
|
+
ft as DialogActions,
|
|
3133
|
+
Ln as Drawer,
|
|
3134
|
+
ss as DrawerMenuContext,
|
|
3135
|
+
pn as DrawerMenuProvider,
|
|
3136
|
+
Gr as Empty,
|
|
3137
|
+
Dn as Error,
|
|
3138
|
+
An as FormContainer,
|
|
3139
|
+
Tn as FormDialog,
|
|
3140
|
+
Se as GlobalActions,
|
|
3141
|
+
cn as IManager,
|
|
3142
|
+
pe as IconButton,
|
|
3143
|
+
Fn as ImportDialog,
|
|
3144
|
+
hn as ManagerProvider,
|
|
3145
|
+
te as Methods,
|
|
3146
|
+
Pn as Navbar,
|
|
3147
|
+
On as Notification,
|
|
3148
|
+
z as NotificationEnumType,
|
|
3149
|
+
mn as NotificationProvider,
|
|
3150
|
+
Rn as Onboarding,
|
|
3151
|
+
Vn as Page,
|
|
3152
|
+
kn as ParagraphInput,
|
|
3104
3153
|
xn as PasswordInput,
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3154
|
+
In as PrettyGrid,
|
|
3155
|
+
Mn as SplashScreen,
|
|
3156
|
+
Wr as Step,
|
|
3157
|
+
Kr as Tab,
|
|
3158
|
+
jr as TabsLayout,
|
|
3159
|
+
Nn as ToTop,
|
|
3160
|
+
sr as buildQueryUrl,
|
|
3161
|
+
un as enumToKeyValueArray,
|
|
3162
|
+
dn as formatForDatetimeLocal,
|
|
3163
|
+
zt as fromLocal,
|
|
3164
|
+
kt as getFormattedDateTime,
|
|
3165
|
+
nr as getShortFormattedDateTime,
|
|
3166
|
+
Je as isHttpError,
|
|
3167
|
+
ir as isMac,
|
|
3168
|
+
Ge as isValidationError,
|
|
3169
|
+
Te as makeRequest,
|
|
3170
|
+
fn as mapValidationErrors,
|
|
3171
|
+
Gt as parseQueries,
|
|
3172
|
+
be as queryClient,
|
|
3173
|
+
Nt as removeFromLocal,
|
|
3174
|
+
Et as toLocal,
|
|
3175
|
+
es as useAuth,
|
|
3176
|
+
Re as useConfig,
|
|
3177
|
+
rs as useConfirmationForm,
|
|
3178
|
+
$r as useDeleteAction,
|
|
3179
|
+
vn as useDeleteDialog,
|
|
3180
|
+
fs as useDialog,
|
|
3181
|
+
or as useDrawerMenu,
|
|
3182
|
+
wn as useEditAction,
|
|
3183
|
+
Lr as useExportAction,
|
|
3184
|
+
En as useExportActionMutate,
|
|
3185
|
+
_n as useFormDialog,
|
|
3186
|
+
Dr as useImportAction,
|
|
3187
|
+
Cn as useImportDialog,
|
|
3188
|
+
ar as useManager,
|
|
3140
3189
|
Ne as useNotification,
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3190
|
+
bn as usePostForm,
|
|
3191
|
+
Fr as useRestoreAction,
|
|
3192
|
+
Sn as useRestoreDialog,
|
|
3193
|
+
Vr as useScrollTrigger,
|
|
3194
|
+
on as useTimeAge
|
|
3146
3195
|
};
|