@sito/dashboard-app 0.0.20 → 0.0.21

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