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