@sito/dashboard-app 0.0.56 → 0.0.57

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.
@@ -7,8 +7,8 @@ export * from "@sito/dashboard";
7
7
  import { Action as fr, Actions as pr, ActionsDropdown as gr, Button as br } from "@sito/dashboard";
8
8
  import { jsxs as v, jsx as h, Fragment as ae } from "react/jsx-runtime";
9
9
  import { FontAwesomeIcon as q } from "@fortawesome/react-fontawesome";
10
- import { forwardRef as $e, useState as R, useCallback as S, useEffect as O, useReducer as xe, useRef as F, useMemo as V, createContext as Y, useContext as X, useLayoutEffect as dt } from "react";
11
- import { faEyeSlash as mt, faEye as ht, faClose as De, faTrash as ft, faRotateLeft as Le, faPencil as pt, faCircleNotch as Re, faCloudArrowDown as gt, faCloudUpload as bt, faArrowUp as yt, faArrowLeft as wt, faAdd as ve, faFilter as St, faBars as Ct, faSearch as Tt, faCircleCheck as vt, faWarning as Et } from "@fortawesome/free-solid-svg-icons";
10
+ import { forwardRef as $e, useState as R, useCallback as S, useEffect as M, useReducer as xe, useRef as F, useMemo as V, createContext as Y, useContext as X, useLayoutEffect as dt } from "react";
11
+ import { faEyeSlash as mt, faEye as ht, faClose as De, faTrash as ft, faRotateLeft as Le, faPencil as pt, faCircleNotch as Re, faCloudArrowDown as gt, faCloudUpload as bt, faArrowUp as yt, faArrowLeft as wt, faAdd as ve, faFilter as St, faBars as Tt, faSearch as Ct, faCircleCheck as vt, faWarning as Et } from "@fortawesome/free-solid-svg-icons";
12
12
  import { createPortal as Ie } from "react-dom";
13
13
  import { QueryClient as kt, QueryClientProvider as _e, useMutation as ne, useQueryClient as Z, useQuery as Nt } from "@tanstack/react-query";
14
14
  import { faSadTear as At } from "@fortawesome/free-regular-svg-icons";
@@ -30,9 +30,9 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
30
30
  helperText: p = "",
31
31
  helperTextClassName: b = "",
32
32
  ...g
33
- } = r, y = s !== void 0, [C, w] = R(
33
+ } = r, y = s !== void 0, [T, w] = R(
34
34
  () => Ee(t)
35
- ), E = y ? Ee(s) : C, A = (U) => {
35
+ ), E = y ? Ee(s) : T, A = (U) => {
36
36
  y || w(U.currentTarget.value.length > 0), n == null || n(U);
37
37
  };
38
38
  return /* @__PURE__ */ v("div", { className: `form-paragraph-container group ${d}`, children: [
@@ -147,7 +147,7 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
147
147
  },
148
148
  [o, n]
149
149
  );
150
- O(() => (window.addEventListener("keydown", l), () => {
150
+ M(() => (window.addEventListener("keydown", l), () => {
151
151
  window.removeEventListener("keydown", l);
152
152
  }), [l]);
153
153
  const u = S(
@@ -156,7 +156,7 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = $e(function(r, e) {
156
156
  },
157
157
  [n]
158
158
  );
159
- return O(() => {
159
+ return M(() => {
160
160
  const d = (m) => {
161
161
  m ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
162
162
  };
@@ -354,7 +354,7 @@ function Dt(r) {
354
354
  /* @__PURE__ */ h("pre", { className: "import-preview-content", children: JSON.stringify(o, null, 2) })
355
355
  ] });
356
356
  }
357
- const Oe = () => ({
357
+ const Me = () => ({
358
358
  file: null,
359
359
  previewItems: null,
360
360
  parseError: null,
@@ -391,7 +391,7 @@ function Lt(r, e) {
391
391
  case "SET_OVERRIDE":
392
392
  return { ...r, overrideExisting: e.value };
393
393
  case "RESET":
394
- return { ...Oe(), inputKey: r.inputKey + 1 };
394
+ return { ...Me(), inputKey: r.inputKey + 1 };
395
395
  }
396
396
  }
397
397
  const $s = (r) => {
@@ -409,30 +409,30 @@ const $s = (r) => {
409
409
  ...m
410
410
  } = r, [f, p] = xe(
411
411
  Lt,
412
- Oe()
412
+ Me()
413
413
  ), {
414
414
  file: b,
415
415
  previewItems: g,
416
416
  parseError: y,
417
- processing: C,
417
+ processing: T,
418
418
  overrideExisting: w,
419
419
  inputKey: E
420
420
  } = f, A = F(c), U = F(i);
421
- O(() => {
421
+ M(() => {
422
422
  A.current = c;
423
- }, [c]), O(() => {
423
+ }, [c]), M(() => {
424
424
  U.current = i;
425
- }, [i]), O(() => {
425
+ }, [i]), M(() => {
426
426
  u || p({ type: "RESET" });
427
427
  }, [u]);
428
428
  const B = S(
429
- async (T, $) => {
430
- var x;
429
+ async (C, D) => {
430
+ var L;
431
431
  if (U.current) {
432
432
  p({ type: "START_PROCESSING" });
433
433
  try {
434
- const _ = await U.current(T, { override: $ });
435
- p({ type: "SET_PREVIEW", items: _ ?? [] }), (x = A.current) == null || x.call(A, _ ?? []);
434
+ const _ = await U.current(C, { override: D });
435
+ p({ type: "SET_PREVIEW", items: _ ?? [] }), (L = A.current) == null || L.call(A, _ ?? []);
436
436
  } catch (_) {
437
437
  console.error(_);
438
438
  const K = _ instanceof Error ? _.message : "Failed to parse file";
@@ -447,17 +447,17 @@ const $s = (r) => {
447
447
  nt,
448
448
  {
449
449
  onClear: () => {
450
- var T;
451
- p({ type: "SET_FILE", file: null }), (T = A.current) == null || T.call(A, []);
450
+ var C;
451
+ p({ type: "SET_FILE", file: null }), (C = A.current) == null || C.call(A, []);
452
452
  },
453
- onChange: (T) => {
454
- var x, _;
455
- const $ = (x = T.target.files) == null ? void 0 : x[0];
456
- if (!$) {
453
+ onChange: (C) => {
454
+ var L, _;
455
+ const D = (L = C.target.files) == null ? void 0 : L[0];
456
+ if (!D) {
457
457
  p({ type: "SET_FILE", file: null }), (_ = A.current) == null || _.call(A, []);
458
458
  return;
459
459
  }
460
- p({ type: "SET_FILE", file: $ }), B($, w);
460
+ p({ type: "SET_FILE", file: D }), B(D, w);
461
461
  },
462
462
  label: e("_accessibility:labels.file")
463
463
  },
@@ -469,9 +469,9 @@ const $s = (r) => {
469
469
  {
470
470
  type: "checkbox",
471
471
  checked: w,
472
- onChange: (T) => {
473
- const $ = T.target.checked;
474
- p({ type: "SET_OVERRIDE", value: $ }), l == null || l($), b && B(b, $);
472
+ onChange: (C) => {
473
+ const D = C.target.checked;
474
+ p({ type: "SET_OVERRIDE", value: D }), l == null || l(D), b && B(b, D);
475
475
  }
476
476
  }
477
477
  ),
@@ -480,7 +480,7 @@ const $s = (r) => {
480
480
  }) })
481
481
  ] }),
482
482
  /* @__PURE__ */ h($t, { message: y }),
483
- C && /* @__PURE__ */ h(xt, {}),
483
+ T && /* @__PURE__ */ h(xt, {}),
484
484
  a ? a(g) : !!g && g.length > 0 && /* @__PURE__ */ h(Dt, { items: g }),
485
485
  s,
486
486
  /* @__PURE__ */ h(
@@ -504,7 +504,7 @@ const $s = (r) => {
504
504
  )
505
505
  ] });
506
506
  };
507
- var M = /* @__PURE__ */ ((r) => (r[r.success = 0] = "success", r[r.error = 1] = "error", r[r.warning = 2] = "warning", r[r.info = 3] = "info", r))(M || {}), P = /* @__PURE__ */ ((r) => (r.GET = "GET", r.POST = "POST", r.PUT = "PUT", r.PATCH = "PATCH", r.DELETE = "DELETE", r))(P || {});
507
+ var O = /* @__PURE__ */ ((r) => (r[r.success = 0] = "success", r[r.error = 1] = "error", r[r.warning = 2] = "warning", r[r.info = 3] = "info", r))(O || {}), P = /* @__PURE__ */ ((r) => (r.GET = "GET", r.POST = "POST", r.PUT = "PUT", r.PATCH = "PATCH", r.DELETE = "DELETE", r))(P || {});
508
508
  const Rt = (r) => Array.isArray(r) || r instanceof Headers ? !1 : typeof r == "object" && r !== null && ("headers" in r || "credentials" in r), It = (r) => r ? Rt(r) ? r : { headers: r } : {}, _t = (r) => r ? r instanceof Headers ? Object.fromEntries(r.entries()) : Array.isArray(r) ? Object.fromEntries(r) : r : {};
509
509
  async function me(r, e = "GET", s, t) {
510
510
  const n = It(t), o = {
@@ -561,19 +561,19 @@ function Pt(r, e) {
561
561
  }
562
562
  return r;
563
563
  }
564
- const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Date ? encodeURIComponent(r.toISOString()) : encodeURIComponent(String(r)), Ot = (r) => {
564
+ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Date ? encodeURIComponent(r.toISOString()) : encodeURIComponent(String(r)), Mt = (r) => {
565
565
  if (typeof r != "string") return;
566
566
  const e = r.trim().toUpperCase();
567
567
  if (e === "ACTIVE" || e === "DELETED" || e === "ALL")
568
568
  return e;
569
- }, Me = (r, e, s) => {
569
+ }, Oe = (r, e, s) => {
570
570
  const t = [];
571
571
  if (e) {
572
572
  const { sortingBy: n, sortingOrder: o, currentPage: i, pageSize: c } = e;
573
573
  n !== void 0 && t.push(`sort=${String(n)}`), o !== void 0 && t.push(`order=${o}`), i !== void 0 && t.push(`page=${i}`), c !== void 0 && t.push(`pageSize=${c}`);
574
574
  }
575
575
  if (s) {
576
- const n = Ot(s.softDeleteScope);
576
+ const n = Mt(s.softDeleteScope);
577
577
  n && t.push(`softDeleteScope=${encodeURIComponent(n)}`);
578
578
  const o = Object.entries(s).filter(
579
579
  ([i, c]) => i !== "softDeleteScope" && c !== null && c !== void 0 && c !== ""
@@ -737,7 +737,7 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
737
737
  * @returns Result list
738
738
  */
739
739
  async get(e, s, t) {
740
- const n = Me(e, s, t), {
740
+ const n = Oe(e, s, t), {
741
741
  data: o,
742
742
  error: i,
743
743
  status: c
@@ -823,7 +823,7 @@ const he = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
823
823
  };
824
824
  N(se, "refreshInFlight", /* @__PURE__ */ new Map());
825
825
  let de = se;
826
- class Mt {
826
+ class Ot {
827
827
  constructor(e, s = "user", t = {}) {
828
828
  N(this, "api");
829
829
  this.api = new de(e, s, !1, void 0, t);
@@ -873,7 +873,7 @@ class Mt {
873
873
  class xs {
874
874
  constructor(e, s, t = {}) {
875
875
  N(this, "auth");
876
- this.auth = new Mt(e, s, t);
876
+ this.auth = new Ot(e, s, t);
877
877
  }
878
878
  /**
879
879
  * @returns auth
@@ -940,7 +940,7 @@ class Ds {
940
940
  * @returns - List of elements
941
941
  */
942
942
  async export(e) {
943
- const s = Me(
943
+ const s = Oe(
944
944
  `${this.table}/export`,
945
945
  void 0,
946
946
  e
@@ -1456,7 +1456,7 @@ function Ps(r) {
1456
1456
  const e = r ? new Date(r) : /* @__PURE__ */ new Date(), s = String(e.getDate()).padStart(2, "0"), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getFullYear()).slice(-2), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
1457
1457
  return `${s}/${t}/${n} ${o}:${i}`;
1458
1458
  }
1459
- function Os(r) {
1459
+ function Ms(r) {
1460
1460
  const e = r ? new Date(r) : /* @__PURE__ */ new Date(), s = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0"), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
1461
1461
  return `${s}-${t}-${n}T${o}:${i}`;
1462
1462
  }
@@ -1477,7 +1477,7 @@ function Se(r) {
1477
1477
  const e = r;
1478
1478
  return typeof (e == null ? void 0 : e.status) == "number" && typeof (e == null ? void 0 : e.message) == "string";
1479
1479
  }
1480
- function Ms(r, e) {
1480
+ function Os(r, e) {
1481
1481
  return r != null && r.errors ? r.errors.map(([s, t]) => e(s, t)) : [];
1482
1482
  }
1483
1483
  const Fe = Y(
@@ -1500,7 +1500,7 @@ function Fs(r) {
1500
1500
  ), o = (m) => m.map((f) => ({ ...f, id: s.current++ })), i = S(
1501
1501
  (m) => n({
1502
1502
  type: "set",
1503
- items: o([{ ...m, type: M.error }])
1503
+ items: o([{ ...m, type: O.error }])
1504
1504
  }),
1505
1505
  []
1506
1506
  ), c = S(
@@ -1512,7 +1512,7 @@ function Fs(r) {
1512
1512
  ), l = S(
1513
1513
  (m) => n({
1514
1514
  type: "set",
1515
- items: o([{ ...m, type: M.success }])
1515
+ items: o([{ ...m, type: O.success }])
1516
1516
  }),
1517
1517
  []
1518
1518
  ), u = (m) => n({ type: "remove", id: m }), d = V(() => ({
@@ -1536,7 +1536,7 @@ const oe = () => {
1536
1536
  if (!r)
1537
1537
  throw new Error("NotificationContext must be used within a Provider");
1538
1538
  return r;
1539
- }, Ce = () => new kt({
1539
+ }, Te = () => new kt({
1540
1540
  defaultOptions: {
1541
1541
  queries: {
1542
1542
  refetchInterval: !1,
@@ -1548,20 +1548,20 @@ const oe = () => {
1548
1548
  // default: true
1549
1549
  }
1550
1550
  }
1551
- }), Us = Ce(), Ue = Y(
1551
+ }), Us = Te(), Ue = Y(
1552
1552
  void 0
1553
1553
  ), Ks = (r) => {
1554
- const { children: e, manager: s, queryClient: t } = r, [n] = R(Ce), o = t ?? n;
1554
+ const { children: e, manager: s, queryClient: t } = r, [n] = R(Te), o = t ?? n;
1555
1555
  return /* @__PURE__ */ h(Ue.Provider, { value: { client: s }, children: /* @__PURE__ */ h(_e, { client: o, children: e }) });
1556
1556
  }, Bt = () => {
1557
1557
  const r = X(Ue);
1558
1558
  if (!r)
1559
1559
  throw new Error("managerContext must be used within a Provider");
1560
1560
  return r.client;
1561
- }, Te = Y(
1561
+ }, Ce = Y(
1562
1562
  void 0
1563
1563
  ), Vt = () => {
1564
- const r = X(Te);
1564
+ const r = X(Ce);
1565
1565
  if (!r) throw new Error("authContext must be used within a Provider");
1566
1566
  return r;
1567
1567
  }, js = (r) => {
@@ -1580,18 +1580,18 @@ const oe = () => {
1580
1580
  },
1581
1581
  [s]
1582
1582
  ), f = S(
1583
- (y, C) => {
1583
+ (y, T) => {
1584
1584
  if (!y) return;
1585
- const w = G(n, "boolean"), E = C ?? (typeof w == "boolean" ? w : !1);
1585
+ const w = G(n, "boolean"), E = T ?? (typeof w == "boolean" ? w : !1);
1586
1586
  l(y), I(s), Q(t, y.token), Q(n, E), typeof y.refreshToken == "string" && y.refreshToken.length ? Q(o, y.refreshToken) : I(o), typeof y.accessTokenExpiresAt == "string" && y.accessTokenExpiresAt.length ? Q(i, y.accessTokenExpiresAt) : I(i);
1587
1587
  },
1588
1588
  [i, s, o, n, t]
1589
1589
  ), p = S(async () => {
1590
- const y = G(t) ?? a.token, C = G(o) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
1590
+ const y = G(t) ?? a.token, T = G(o) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
1591
1591
  try {
1592
1592
  await c.Auth.logout({
1593
1593
  accessToken: y,
1594
- refreshToken: C
1594
+ refreshToken: T
1595
1595
  });
1596
1596
  } catch (w) {
1597
1597
  console.error(w);
@@ -1626,7 +1626,7 @@ const oe = () => {
1626
1626
  d,
1627
1627
  m
1628
1628
  ]);
1629
- return /* @__PURE__ */ h(Te.Provider, { value: g, children: e });
1629
+ return /* @__PURE__ */ h(Ce.Provider, { value: g, children: e });
1630
1630
  }, Ke = () => Vt(), je = Y(void 0), Gt = () => {
1631
1631
  const r = X(je);
1632
1632
  if (!r)
@@ -1642,7 +1642,7 @@ const oe = () => {
1642
1642
  accessTokenExpiresAtKey: i = "accessTokenExpiresAt",
1643
1643
  sessionMapper: c
1644
1644
  } = r, a = Gt(), l = F(c ?? ke);
1645
- O(() => {
1645
+ M(() => {
1646
1646
  l.current = c ?? ke;
1647
1647
  }, [c]);
1648
1648
  const [u, d] = R({}), m = S(() => {
@@ -1679,7 +1679,7 @@ const oe = () => {
1679
1679
  console.error(w), await g();
1680
1680
  }
1681
1681
  }, [m, b, g, a.auth]);
1682
- O(() => {
1682
+ M(() => {
1683
1683
  let w = !0;
1684
1684
  (async () => {
1685
1685
  w && await y();
@@ -1697,7 +1697,7 @@ const oe = () => {
1697
1697
  w = !1, A.subscription.unsubscribe();
1698
1698
  };
1699
1699
  }, [m, b, y, a.auth]);
1700
- const C = V(() => ({
1700
+ const T = V(() => ({
1701
1701
  account: u,
1702
1702
  logUser: b,
1703
1703
  logoutUser: g,
@@ -1712,9 +1712,9 @@ const oe = () => {
1712
1712
  f,
1713
1713
  p
1714
1714
  ]);
1715
- return /* @__PURE__ */ h(Te.Provider, { value: C, children: e });
1715
+ return /* @__PURE__ */ h(Ce.Provider, { value: T, children: e });
1716
1716
  }, qs = (r) => {
1717
- const { children: e, supabase: s, queryClient: t } = r, [n] = R(Ce), o = t ?? n;
1717
+ const { children: e, supabase: s, queryClient: t } = r, [n] = R(Te), o = t ?? n;
1718
1718
  return /* @__PURE__ */ h(je.Provider, { value: { client: s }, children: /* @__PURE__ */ h(_e, { client: o, children: e }) });
1719
1719
  }, Qe = Y({}), Hs = (r) => {
1720
1720
  const { children: e, location: s, navigate: t, linkComponent: n, searchComponent: o } = r;
@@ -1779,15 +1779,15 @@ const oe = () => {
1779
1779
  }, zt = () => X(qe);
1780
1780
  function Vs(r) {
1781
1781
  const { t: e } = k(), { open: s, onClose: t, menuMap: n, logo: o } = r, { account: i } = Ke(), { dynamicItems: c } = zt(), { linkComponent: a, location: l } = ce(), u = a, d = V(() => n.filter((g) => {
1782
- const y = g.auth, C = !!(i != null && i.email);
1783
- return y == null || y && C || !y && !C;
1782
+ const y = g.auth, T = !!(i != null && i.email);
1783
+ return y == null || y && T || !y && !T;
1784
1784
  }), [i == null ? void 0 : i.email, n]), m = S(
1785
1785
  (g) => {
1786
1786
  g.key === "Escape" && s && t();
1787
1787
  },
1788
1788
  [t, s]
1789
1789
  );
1790
- O(() => (document.addEventListener("keydown", m), () => {
1790
+ M(() => (document.addEventListener("keydown", m), () => {
1791
1791
  document.removeEventListener("keydown", m);
1792
1792
  }), [m]);
1793
1793
  const f = S(
@@ -1815,9 +1815,9 @@ function Vs(r) {
1815
1815
  ),
1816
1816
  [u, s, e, f]
1817
1817
  ), b = V(() => d.map((g, y) => {
1818
- const C = g.page ?? String(y), w = `drawer-list-item ${f(g.path) ? "active" : ""} animated`;
1818
+ const T = g.page ?? String(y), w = `drawer-list-item ${f(g.path) ? "active" : ""} animated`;
1819
1819
  if (g.type === "divider")
1820
- return /* @__PURE__ */ h("li", { className: w, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, C);
1820
+ return /* @__PURE__ */ h("li", { className: w, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, T);
1821
1821
  const E = g.children ?? (g.page && c ? c[g.page] : null);
1822
1822
  return /* @__PURE__ */ v("li", { className: w, children: [
1823
1823
  /* @__PURE__ */ v(
@@ -1836,7 +1836,7 @@ function Vs(r) {
1836
1836
  }
1837
1837
  ),
1838
1838
  E && /* @__PURE__ */ h("ul", { className: "drawer-children-list", children: E.map(p) })
1839
- ] }, C);
1839
+ ] }, T);
1840
1840
  }), [u, c, f, s, d, p, e]);
1841
1841
  return /* @__PURE__ */ h(
1842
1842
  "div",
@@ -1958,57 +1958,57 @@ const He = (r) => {
1958
1958
  onSuccess: u,
1959
1959
  queryKey: d,
1960
1960
  onSuccessMessage: m
1961
- } = r, { control: f, handleSubmit: p, reset: b, setError: g, getValues: y, setValue: C } = Pe({
1961
+ } = r, { control: f, handleSubmit: p, reset: b, setError: g, getValues: y, setValue: T } = Pe({
1962
1962
  defaultValues: i
1963
1963
  }), w = F(null), E = S(() => {
1964
- const T = document.activeElement;
1965
- if (!(T instanceof HTMLElement)) {
1964
+ const C = document.activeElement;
1965
+ if (!(C instanceof HTMLElement)) {
1966
1966
  w.current = null;
1967
1967
  return;
1968
1968
  }
1969
- w.current = T.closest("form");
1969
+ w.current = C.closest("form");
1970
1970
  }, []), A = S(
1971
- (T) => {
1972
- const $ = T == null ? void 0 : T.errors, x = [], _ = w.current;
1973
- if (!_) return x;
1971
+ (C) => {
1972
+ const D = C == null ? void 0 : C.errors, L = [], _ = w.current;
1973
+ if (!_) return L;
1974
1974
  let K = !1;
1975
- return $ && $.forEach(([le, ee]) => {
1975
+ return D && D.forEach(([le, ee]) => {
1976
1976
  const j = _.querySelector(`[name="${le}"]`);
1977
- (j instanceof HTMLInputElement || j instanceof HTMLTextAreaElement || j instanceof HTMLSelectElement) && (K || (j.focus(), K = !0), j.classList.add("error"), x.push(e(`_entities:${d}.${le}.${ee}`)));
1978
- }), x;
1977
+ (j instanceof HTMLInputElement || j instanceof HTMLTextAreaElement || j instanceof HTMLSelectElement) && (K || (j.focus(), K = !0), j.classList.add("error"), L.push(e(`_entities:${d}.${le}.${ee}`)));
1978
+ }), L;
1979
1979
  },
1980
1980
  [e, d]
1981
1981
  ), U = S(() => {
1982
- const T = w.current;
1983
- if (!T) return;
1984
- T.querySelectorAll("input, textarea, select").forEach((x) => {
1985
- x.classList.remove("error");
1982
+ const C = w.current;
1983
+ if (!C) return;
1984
+ C.querySelectorAll("input, textarea, select").forEach((L) => {
1985
+ L.classList.remove("error");
1986
1986
  });
1987
1987
  }, []), B = ne(
1988
1988
  {
1989
1989
  mutationFn: c,
1990
- onError: (T) => {
1991
- console.error(T);
1992
- const $ = T;
1993
- if (l) l(T);
1994
- else if (we($)) {
1995
- const x = A($);
1990
+ onError: (C) => {
1991
+ console.error(C);
1992
+ const D = C;
1993
+ if (l) l(C);
1994
+ else if (we(D)) {
1995
+ const L = A(D);
1996
1996
  s(
1997
- x.map(
1997
+ L.map(
1998
1998
  (_) => ({
1999
1999
  message: _,
2000
- type: M.error
2000
+ type: O.error
2001
2001
  })
2002
2002
  )
2003
2003
  );
2004
- } else if (Se($)) {
2005
- const x = $.message || e("_accessibility:errors.500"), _ = e(`_accessibility:errors.${$.status}`);
2006
- n({ message: _ || x });
2004
+ } else if (Se(D)) {
2005
+ const L = D.message || e("_accessibility:errors.500"), _ = e(`_accessibility:errors.${D.status}`);
2006
+ n({ message: _ || L });
2007
2007
  } else
2008
2008
  n({ message: e("_accessibility:errors.500") });
2009
2009
  },
2010
- onSuccess: async (T) => {
2011
- await o.invalidateQueries({ queryKey: d }), u && u(T), m && t({
2010
+ onSuccess: async (C) => {
2011
+ await o.invalidateQueries({ queryKey: d }), u && u(C), m && t({
2012
2012
  message: m
2013
2013
  });
2014
2014
  }
@@ -2017,11 +2017,11 @@ const He = (r) => {
2017
2017
  return {
2018
2018
  control: f,
2019
2019
  getValues: y,
2020
- setValue: C,
2020
+ setValue: T,
2021
2021
  handleSubmit: p,
2022
- onSubmit: (T) => {
2022
+ onSubmit: (C) => {
2023
2023
  E(), U(), B.mutate(
2024
- a ? a(T) : T
2024
+ a ? a(C) : C
2025
2025
  );
2026
2026
  },
2027
2027
  reset: b,
@@ -2170,7 +2170,7 @@ const es = (r) => {
2170
2170
  p.errors.map(
2171
2171
  ([b, g]) => ({
2172
2172
  message: i(`_pages:${b}.errors.${g}`),
2173
- type: M.error
2173
+ type: O.error
2174
2174
  })
2175
2175
  )
2176
2176
  );
@@ -2179,7 +2179,7 @@ const es = (r) => {
2179
2179
  o([
2180
2180
  {
2181
2181
  message: g || b,
2182
- type: M.error
2182
+ type: O.error
2183
2183
  }
2184
2184
  ]);
2185
2185
  }
@@ -2205,8 +2205,8 @@ const es = (r) => {
2205
2205
  const {
2206
2206
  closeOnSubmit: e = !0,
2207
2207
  defaultValues: s,
2208
- mapIn: t,
2209
- mapOut: n,
2208
+ dtoToForm: t,
2209
+ formToDto: n,
2210
2210
  mode: o = "state",
2211
2211
  onApply: i,
2212
2212
  onClear: c,
@@ -2215,100 +2215,103 @@ const es = (r) => {
2215
2215
  reinitializeOnOpen: u,
2216
2216
  resetOnOpen: d,
2217
2217
  title: m
2218
- } = r, [f, p] = R(), [b, g] = R(!1), y = F(!1), C = F(null), { open: w, handleClose: E, handleOpen: A } = Be(), { control: U, handleSubmit: B, reset: T, setError: $, getValues: x, setValue: _ } = Pe({
2218
+ } = r, [f, p] = R(), [b, g] = R(!1), y = F(!1), T = F(null), { open: w, handleClose: E, handleOpen: A } = Be(), { control: U, handleSubmit: B, reset: C, setError: D, getValues: L, setValue: _ } = Pe({
2219
2219
  defaultValues: s || {}
2220
2220
  });
2221
- O(() => {
2221
+ M(() => {
2222
2222
  if (!w) {
2223
- y.current = !1, C.current = null;
2223
+ y.current = !1, T.current = null;
2224
2224
  return;
2225
2225
  }
2226
- if (!y.current) {
2227
- if (y.current = !0, C.current) {
2228
- T(C.current), C.current = null;
2229
- return;
2230
- }
2231
- if (u && t) {
2232
- T(t());
2233
- return;
2234
- }
2235
- if (u && s) {
2236
- T(s);
2237
- return;
2238
- }
2239
- d && T(s || {});
2226
+ if (y.current) return;
2227
+ if (y.current = !0, T.current) {
2228
+ C(T.current), T.current = null;
2229
+ return;
2240
2230
  }
2241
- }, [s, t, w, u, T, d]);
2231
+ const x = t;
2232
+ if (u && x) {
2233
+ C(x(s || {}));
2234
+ return;
2235
+ }
2236
+ if (u && s) {
2237
+ C(s);
2238
+ return;
2239
+ }
2240
+ d && C(s || {});
2241
+ }, [s, t, w, u, C, d]);
2242
2242
  const K = S(() => {
2243
- E(), T();
2244
- }, [E, T]), le = S(
2245
- (D) => {
2246
- let L, te;
2247
- typeof D == "number" || D == null ? L = D : (L = D.id, te = D.values), p(L), te ? w ? T(te) : C.current = te : C.current = null, w || A();
2243
+ E(), C();
2244
+ }, [E, C]), le = S(
2245
+ (x) => {
2246
+ let $, te;
2247
+ typeof x == "number" || x == null ? $ = x : ($ = x.id, te = x.values), p($), te ? w ? C(te) : T.current = te : T.current = null, w || A();
2248
2248
  },
2249
- [A, w, T]
2249
+ [A, w, C]
2250
2250
  ), ee = S(
2251
- (D) => n ? n(D, { id: f }) : D,
2252
- [f, n]
2251
+ (x) => {
2252
+ const $ = n;
2253
+ return $ ? $(x, { id: f }) : x;
2254
+ },
2255
+ [n, f]
2253
2256
  ), j = S(
2254
- async (D, L, te) => {
2255
- a && await a(D, {
2257
+ async (x, $, te) => {
2258
+ a && await a(x, {
2256
2259
  close: K,
2257
2260
  id: f,
2258
- phase: L,
2261
+ phase: $,
2259
2262
  values: te
2260
2263
  });
2261
2264
  },
2262
2265
  [K, f, a]
2263
2266
  ), We = S(async () => {
2264
2267
  if (!i) return;
2265
- const D = x();
2268
+ const x = L();
2266
2269
  g(!0);
2267
2270
  try {
2268
- const L = ee(D);
2269
- await i(L, {
2271
+ const $ = ee(x);
2272
+ await i($, {
2270
2273
  close: K,
2271
2274
  id: f,
2272
- values: D
2275
+ values: x
2273
2276
  });
2274
- } catch (L) {
2275
- throw await j(L, "apply", D).catch(() => {
2276
- }), L;
2277
+ } catch ($) {
2278
+ throw await j($, "apply", x).catch(() => {
2279
+ }), $;
2277
2280
  } finally {
2278
2281
  g(!1);
2279
2282
  }
2280
- }, [K, x, j, f, ee, i]), ze = S(async () => {
2281
- const D = x();
2283
+ }, [K, L, j, f, ee, i]), ze = S(async () => {
2284
+ const x = L();
2282
2285
  if (c) {
2283
2286
  g(!0);
2284
2287
  try {
2285
2288
  await c();
2286
- } catch (L) {
2287
- throw await j(L, "clear", D).catch(() => {
2288
- }), L;
2289
+ } catch ($) {
2290
+ throw await j($, "clear", x).catch(() => {
2291
+ }), $;
2289
2292
  } finally {
2290
2293
  g(!1);
2291
2294
  }
2292
2295
  }
2293
2296
  try {
2294
- T(s || {});
2295
- } catch (L) {
2296
- throw await j(L, "clear", D).catch(() => {
2297
- }), L;
2297
+ C(s || {});
2298
+ } catch ($) {
2299
+ throw await j($, "clear", x).catch(() => {
2300
+ }), $;
2298
2301
  }
2299
- }, [s, x, j, c, T]), Je = S(
2300
- async (D) => {
2302
+ }, [s, L, j, c, C]), Je = S(
2303
+ async (x) => {
2301
2304
  g(!0);
2302
2305
  try {
2303
- const L = ee(D);
2304
- l && await l(L, {
2306
+ const $ = ee(x);
2307
+ l && await l($, {
2305
2308
  close: K,
2306
2309
  id: f,
2307
- values: D
2310
+ values: x
2308
2311
  }), e && K();
2309
- } catch (L) {
2310
- throw await j(L, "submit", D).catch(() => {
2311
- }), L;
2312
+ } catch ($) {
2313
+ throw await j($, "submit", x).catch(() => {
2314
+ }), $;
2312
2315
  } finally {
2313
2316
  g(!1);
2314
2317
  }
@@ -2322,12 +2325,12 @@ const es = (r) => {
2322
2325
  openDialog: le,
2323
2326
  handleClose: K,
2324
2327
  control: U,
2325
- getValues: x,
2328
+ getValues: L,
2326
2329
  setValue: _,
2327
2330
  handleSubmit: B,
2328
2331
  onSubmit: Je,
2329
- reset: T,
2330
- setError: $,
2332
+ reset: C,
2333
+ setError: D,
2331
2334
  title: m,
2332
2335
  isSubmitting: b,
2333
2336
  onApply: We,
@@ -2335,13 +2338,13 @@ const es = (r) => {
2335
2338
  isLoading: b
2336
2339
  };
2337
2340
  }, Ys = (r) => {
2338
- const e = Z(), { mutationFn: s, queryKey: t, onSuccess: n, onError: o, mapOut: i, ...c } = r, a = ne({
2341
+ const e = Z(), { mutationFn: s, queryKey: t, onSuccess: n, onError: o, formToDto: i, ...c } = r, a = ne({
2339
2342
  mutationFn: s
2340
2343
  });
2341
2344
  return Ve({
2342
2345
  ...c,
2343
2346
  mode: "entity",
2344
- mapOut: i,
2347
+ formToDto: i,
2345
2348
  onSubmit: async (l) => {
2346
2349
  try {
2347
2350
  const u = await a.mutateAsync(l);
@@ -2357,13 +2360,13 @@ const es = (r) => {
2357
2360
  queryKey: o,
2358
2361
  onSuccess: i,
2359
2362
  onError: c,
2360
- mapOut: a,
2363
+ formToDto: a,
2361
2364
  getFunction: l,
2362
2365
  dtoToForm: u,
2363
2366
  title: d,
2364
2367
  ...m
2365
2368
  } = r, f = F(u);
2366
- O(() => {
2369
+ M(() => {
2367
2370
  f.current = u;
2368
2371
  }, [u]);
2369
2372
  const p = ne({
@@ -2380,23 +2383,26 @@ const es = (r) => {
2380
2383
  throw c && c(E), E;
2381
2384
  }
2382
2385
  },
2383
- mapOut: (w) => a ? a(w, s.current) : w
2384
- }), { reset: g } = b, C = Nt({
2386
+ formToDto: (w) => {
2387
+ const E = a;
2388
+ return E ? E(w, s.current) : w;
2389
+ }
2390
+ }), { reset: g } = b, T = Nt({
2385
2391
  queryFn: () => l(b.id),
2386
2392
  queryKey: [...o || ["put-dialog", d], b.id],
2387
2393
  enabled: b.open && !!b.id
2388
2394
  });
2389
- return O(() => {
2390
- if (C.data && t.current !== C.data) {
2391
- if (s.current = C.data, t.current = C.data, f.current && g) {
2392
- g(f.current(C.data));
2395
+ return M(() => {
2396
+ if (T.data && t.current !== T.data) {
2397
+ if (s.current = T.data, t.current = T.data, f.current && g) {
2398
+ g(f.current(T.data));
2393
2399
  return;
2394
2400
  }
2395
- g == null || g(C.data);
2401
+ g == null || g(T.data);
2396
2402
  }
2397
- }, [C.data, g]), {
2403
+ }, [T.data, g]), {
2398
2404
  ...b,
2399
- isLoading: b.isLoading || p.isPending || C.isFetching || C.isLoading
2405
+ isLoading: b.isLoading || p.isPending || T.isFetching || T.isLoading
2400
2406
  };
2401
2407
  }, Zs = (r) => {
2402
2408
  const { queryKey: e, onSuccess: s, ...t } = r, n = Z(), { showStackNotifications: o } = oe(), { t: i } = k(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = He({
@@ -2408,7 +2414,7 @@ const es = (r) => {
2408
2414
  p.errors.map(
2409
2415
  ([b, g]) => ({
2410
2416
  message: i(`_pages:${b}.errors.${g}`),
2411
- type: M.error
2417
+ type: O.error
2412
2418
  })
2413
2419
  )
2414
2420
  );
@@ -2417,7 +2423,7 @@ const es = (r) => {
2417
2423
  o([
2418
2424
  {
2419
2425
  message: g || b,
2420
- type: M.error
2426
+ type: O.error
2421
2427
  }
2422
2428
  ]);
2423
2429
  }
@@ -2515,7 +2521,7 @@ function ss(r) {
2515
2521
  const [e, s] = R(Ae), t = S(() => {
2516
2522
  s(Ae());
2517
2523
  }, []);
2518
- return O(() => (window.addEventListener("scroll", t), () => {
2524
+ return M(() => (window.addEventListener("scroll", t), () => {
2519
2525
  window.removeEventListener("scroll", t);
2520
2526
  }), [t]), e > r;
2521
2527
  }
@@ -2570,7 +2576,7 @@ function rr(r) {
2570
2576
  children: p,
2571
2577
  onClick: b,
2572
2578
  ...g
2573
- } = a ?? {}, { className: y, ...C } = l ?? {}, w = o !== null;
2579
+ } = a ?? {}, { className: y, ...T } = l ?? {}, w = o !== null;
2574
2580
  return /* @__PURE__ */ v("div", { className: `error-container${u ? ` ${u}` : ""}`, children: [
2575
2581
  w && /* @__PURE__ */ h(
2576
2582
  q,
@@ -2583,7 +2589,7 @@ function rr(r) {
2583
2589
  /* @__PURE__ */ h(
2584
2590
  "p",
2585
2591
  {
2586
- ...C,
2592
+ ...T,
2587
2593
  className: `error-message${y ? ` ${y}` : ""}`,
2588
2594
  children: n ?? (t == null ? void 0 : t.message) ?? e("_accessibility:errors.unknownError")
2589
2595
  }
@@ -2742,9 +2748,9 @@ const rs = (r) => {
2742
2748
  }
2743
2749
  }
2744
2750
  }, [l, u, d]);
2745
- return O(() => {
2751
+ return M(() => {
2746
2752
  if (!l || !d || !g.current || typeof IntersectionObserver > "u") return;
2747
- const C = new IntersectionObserver(
2753
+ const T = new IntersectionObserver(
2748
2754
  (w) => {
2749
2755
  w.some((E) => E.isIntersecting) && y();
2750
2756
  },
@@ -2753,7 +2759,7 @@ const rs = (r) => {
2753
2759
  threshold: p
2754
2760
  }
2755
2761
  );
2756
- return C.observe(g.current), () => C.disconnect();
2762
+ return T.observe(g.current), () => T.disconnect();
2757
2763
  }, [
2758
2764
  l,
2759
2765
  d,
@@ -2761,7 +2767,7 @@ const rs = (r) => {
2761
2767
  p,
2762
2768
  y
2763
2769
  ]), n ? /* @__PURE__ */ h(re, {}) : /* @__PURE__ */ h(ae, { children: a != null && a.length ? /* @__PURE__ */ v("ul", { className: `pretty-grid-main ${s}`, children: [
2764
- a == null ? void 0 : a.map((C) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${t}`, children: c(C) }, C.id)),
2770
+ a == null ? void 0 : a.map((T) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${t}`, children: c(T) }, T.id)),
2765
2771
  l && d && /* @__PURE__ */ h("li", { className: "pretty-grid-load-more", ref: g, children: m })
2766
2772
  ] }) : /* @__PURE__ */ h(ae, { children: o || /* @__PURE__ */ h(ds, { message: i }) }) });
2767
2773
  }, Ge = Y({
@@ -2791,7 +2797,7 @@ function ar(r) {
2791
2797
  const { t: e } = k(), { openDrawer: s, showSearch: t = !0, menuButtonProps: n } = r, { searchComponent: o, location: i } = ce(), { title: c, rightContent: a } = ns(), [l, u] = R(!1), d = S((p) => {
2792
2798
  (Ht() ? p.metaKey : p.ctrlKey) && p.shiftKey && p.key.toLowerCase() === "f" && (u(!0), p.preventDefault());
2793
2799
  }, []);
2794
- O(() => (window.addEventListener("keydown", d), () => {
2800
+ M(() => (window.addEventListener("keydown", d), () => {
2795
2801
  window.removeEventListener("keydown", d);
2796
2802
  }), [d]);
2797
2803
  const m = o, f = t && !!m;
@@ -2804,7 +2810,7 @@ function ar(r) {
2804
2810
  {
2805
2811
  ...n,
2806
2812
  type: (n == null ? void 0 : n.type) ?? "button",
2807
- icon: (n == null ? void 0 : n.icon) ?? Ct,
2813
+ icon: (n == null ? void 0 : n.icon) ?? Tt,
2808
2814
  onClick: (p) => {
2809
2815
  var b;
2810
2816
  (b = n == null ? void 0 : n.onClick) == null || b.call(n, p), s();
@@ -2821,7 +2827,7 @@ function ar(r) {
2821
2827
  f && /* @__PURE__ */ h(
2822
2828
  z,
2823
2829
  {
2824
- icon: Tt,
2830
+ icon: Ct,
2825
2831
  className: "navbar-search-btn",
2826
2832
  onClick: () => u(!0)
2827
2833
  }
@@ -2830,31 +2836,31 @@ function ar(r) {
2830
2836
  ] })
2831
2837
  ] });
2832
2838
  }
2833
- const ue = 300, os = (r) => r ?? M.error, is = (r) => {
2839
+ const ue = 300, os = (r) => r ?? O.error, is = (r) => {
2834
2840
  switch (r) {
2835
- case M.error:
2841
+ case O.error:
2836
2842
  return Et;
2837
2843
  default:
2838
2844
  return vt;
2839
2845
  }
2840
2846
  }, pe = (r) => {
2841
2847
  switch (r) {
2842
- case M.success:
2848
+ case O.success:
2843
2849
  return "!text-success";
2844
- case M.error:
2850
+ case O.error:
2845
2851
  return "!text-error";
2846
- case M.warning:
2852
+ case O.warning:
2847
2853
  return "!text-warning";
2848
2854
  default:
2849
2855
  return "!text-info";
2850
2856
  }
2851
2857
  }, as = (r) => {
2852
2858
  switch (r) {
2853
- case M.success:
2859
+ case O.success:
2854
2860
  return "bg-bg-success";
2855
- case M.error:
2861
+ case O.error:
2856
2862
  return "bg-bg-error";
2857
- case M.warning:
2863
+ case O.warning:
2858
2864
  return "bg-bg-warning";
2859
2865
  default:
2860
2866
  return "bg-bg-info";
@@ -2877,7 +2883,7 @@ function cr() {
2877
2883
  },
2878
2884
  [s]
2879
2885
  );
2880
- return O(() => {
2886
+ return M(() => {
2881
2887
  let a = null;
2882
2888
  const l = () => {
2883
2889
  a && clearTimeout(a), i.current && (clearTimeout(i.current), i.current = null);
@@ -2909,7 +2915,7 @@ function cr() {
2909
2915
  return i.current = setTimeout(() => {
2910
2916
  n(m.map((f) => ({ ...f, closing: !1 }))), i.current = null;
2911
2917
  }, ue), l;
2912
- }, [e]), O(() => {
2918
+ }, [e]), M(() => {
2913
2919
  if (!t.length) return;
2914
2920
  let a;
2915
2921
  const l = window.setTimeout(() => {
@@ -3183,8 +3189,8 @@ export {
3183
3189
  pr as Actions,
3184
3190
  gr as ActionsDropdown,
3185
3191
  z as AppIconButton,
3186
- Mt as AuthClient,
3187
- Te as AuthContext,
3192
+ Ot as AuthClient,
3193
+ Ce as AuthContext,
3188
3194
  js as AuthProvider,
3189
3195
  Ds as BaseClient,
3190
3196
  br as Button,
@@ -3210,7 +3216,7 @@ export {
3210
3216
  Ge as NavbarContext,
3211
3217
  ir as NavbarProvider,
3212
3218
  cr as Notification,
3213
- M as NotificationEnumType,
3219
+ O as NotificationEnumType,
3214
3220
  Fs as NotificationProvider,
3215
3221
  ur as Onboarding,
3216
3222
  nr as Page,
@@ -3227,9 +3233,9 @@ export {
3227
3233
  ls as TabsLayout,
3228
3234
  sr as ToTop,
3229
3235
  Pt as buildQueryUrl,
3230
- Ce as createQueryClient,
3236
+ Te as createQueryClient,
3231
3237
  Is as enumToKeyValueArray,
3232
- Os as formatForDatetimeLocal,
3238
+ Ms as formatForDatetimeLocal,
3233
3239
  G as fromLocal,
3234
3240
  _s as getFormattedDateTime,
3235
3241
  Ps as getShortFormattedDateTime,
@@ -3238,8 +3244,8 @@ export {
3238
3244
  we as isValidationError,
3239
3245
  me as makeRequest,
3240
3246
  ke as mapSupabaseSessionToSessionDto,
3241
- Ms as mapValidationErrors,
3242
- Me as parseQueries,
3247
+ Os as mapValidationErrors,
3248
+ Oe as parseQueries,
3243
3249
  Us as queryClient,
3244
3250
  I as removeFromLocal,
3245
3251
  Q as toLocal,