@sito/dashboard-app 0.0.58 → 0.0.60

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.
Files changed (75) hide show
  1. package/README.md +99 -5
  2. package/dist/components/BottomNavigation/BottomNavigation.d.ts +8 -0
  3. package/dist/components/BottomNavigation/NavLink.d.ts +13 -0
  4. package/dist/components/BottomNavigation/index.d.ts +2 -0
  5. package/dist/components/BottomNavigation/testmap.d.ts +2 -0
  6. package/dist/components/BottomNavigation/types.d.ts +26 -0
  7. package/dist/components/BottomNavigation/utils.d.ts +17 -0
  8. package/dist/components/Buttons/IconButton.d.ts +5 -0
  9. package/dist/components/Buttons/ToTop.d.ts +5 -0
  10. package/dist/components/Dialog/ConfirmationDialog.d.ts +5 -0
  11. package/dist/components/Dialog/Dialog.d.ts +5 -0
  12. package/dist/components/Dialog/DialogActions.d.ts +5 -0
  13. package/dist/components/Dialog/FormDialog.d.ts +5 -0
  14. package/dist/components/Dialog/ImportDialog/Error.d.ts +6 -5
  15. package/dist/components/Dialog/ImportDialog/ImportDialog.d.ts +5 -0
  16. package/dist/components/Dialog/ImportDialog/Loading.d.ts +6 -5
  17. package/dist/components/Dialog/ImportDialog/Preview.d.ts +5 -0
  18. package/dist/components/Dialog/ImportDialog/types.d.ts +33 -0
  19. package/dist/components/Drawer/Drawer.d.ts +5 -0
  20. package/dist/components/Empty/Empty.d.ts +5 -0
  21. package/dist/components/Error/Error.d.ts +5 -0
  22. package/dist/components/Form/FormContainer.d.ts +5 -0
  23. package/dist/components/Form/PasswordInput.d.ts +6 -0
  24. package/dist/components/Loading/SplashScreen.d.ts +5 -0
  25. package/dist/components/Navbar/Navbar.d.ts +5 -0
  26. package/dist/components/Notification/Notification.d.ts +4 -0
  27. package/dist/components/Onboarding/Onboarding.d.ts +5 -0
  28. package/dist/components/Onboarding/Step.d.ts +5 -0
  29. package/dist/components/Page/Page.d.ts +5 -0
  30. package/dist/components/Page/PageHeader.d.ts +5 -0
  31. package/dist/components/PrettyGrid/PrettyGrid.d.ts +5 -0
  32. package/dist/components/TabsLayout/Tab.d.ts +5 -0
  33. package/dist/components/TabsLayout/TabsLayout.d.ts +5 -0
  34. package/dist/components/index.d.ts +1 -0
  35. package/dist/dashboard-app.cjs +1 -1
  36. package/dist/dashboard-app.js +1162 -1030
  37. package/dist/hooks/actions/types.d.ts +1 -0
  38. package/dist/hooks/actions/useDeleteAction.d.ts +5 -0
  39. package/dist/hooks/actions/useEditAction.d.ts +5 -0
  40. package/dist/hooks/actions/useExportAction.d.ts +5 -0
  41. package/dist/hooks/actions/useImportAction.d.ts +5 -0
  42. package/dist/hooks/actions/useRestoreAction.d.ts +5 -0
  43. package/dist/hooks/dialogs/useDeleteDialog.d.ts +5 -0
  44. package/dist/hooks/dialogs/useDialog.d.ts +4 -0
  45. package/dist/hooks/dialogs/useFormDialog.d.ts +5 -0
  46. package/dist/hooks/dialogs/useImportDialog.d.ts +5 -0
  47. package/dist/hooks/dialogs/usePostDialog.d.ts +5 -0
  48. package/dist/hooks/dialogs/usePutDialog.d.ts +5 -0
  49. package/dist/hooks/dialogs/useRestoreDialog.d.ts +5 -0
  50. package/dist/hooks/forms/useConfirmationForm.d.ts +5 -0
  51. package/dist/hooks/forms/usePostForm.d.ts +5 -0
  52. package/dist/hooks/mutate/useExportActionMutate.d.ts +5 -0
  53. package/dist/hooks/useScrollTrigger.d.ts +5 -0
  54. package/dist/hooks/useTimeAge.d.ts +4 -0
  55. package/dist/lib/Notification.d.ts +1 -0
  56. package/dist/lib/api/AuthClient.d.ts +6 -0
  57. package/dist/lib/api/BaseClient.d.ts +6 -3
  58. package/dist/lib/api/IManager.d.ts +6 -0
  59. package/dist/lib/api/IndexedDBClient.d.ts +6 -0
  60. package/dist/lib/api/SupabaseDataClient.d.ts +6 -0
  61. package/dist/lib/api/supabaseAuth.d.ts +6 -0
  62. package/dist/lib/api/utils/services.d.ts +7 -0
  63. package/dist/lib/errors.d.ts +16 -0
  64. package/dist/lib/utils/enums.d.ts +5 -0
  65. package/dist/lib/utils/os.d.ts +4 -0
  66. package/dist/main.css +1 -1
  67. package/dist/providers/Auth/authContext.d.ts +9 -0
  68. package/dist/providers/BottomNavAction/BottomNavActionContext.d.ts +6 -0
  69. package/dist/providers/BottomNavAction/BottomNavActionProvider.d.ts +2 -0
  70. package/dist/providers/BottomNavAction/index.d.ts +3 -0
  71. package/dist/providers/BottomNavAction/useBottomNavAction.d.ts +15 -0
  72. package/dist/providers/NotificationProvider.d.ts +5 -0
  73. package/dist/providers/Supbase/SupabaseContext.d.ts +5 -0
  74. package/dist/providers/index.d.ts +1 -0
  75. package/package.json +1 -1
@@ -1,89 +1,89 @@
1
- var Ye = Object.defineProperty;
2
- var Xe = (r, e, s) => e in r ? Ye(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
3
- var A = (r, e, s) => Xe(r, typeof e != "symbol" ? e + "" : e, s);
1
+ var et = Object.defineProperty;
2
+ var tt = (n, e, s) => e in n ? et(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s;
3
+ var A = (n, e, s) => tt(n, typeof e != "symbol" ? e + "" : e, s);
4
4
  import "./main.css";
5
- import { State as Ze, inputStateClassName as et, labelStateClassName as tt, helperTextStateClassName as st, useTranslation as k, Button as H, Loading as re, TextInput as rt, FileInput as nt, IconButton as ot, Actions as it, ActionsDropdown as at, useTableOptions as ct, Badge as lt, Action as ut } from "@sito/dashboard";
5
+ import { State as st, inputStateClassName as nt, labelStateClassName as rt, helperTextStateClassName as ot, useTranslation as E, Button as V, Loading as ne, TextInput as it, FileInput as at, IconButton as ct, Actions as lt, ActionsDropdown as ut, useTableOptions as dt, Badge as mt, Action as ht } from "@sito/dashboard";
6
6
  export * from "@sito/dashboard";
7
- import { Action as pr, Actions as gr, ActionsDropdown as br, Button as yr } from "@sito/dashboard";
8
- import { jsxs as E, jsx as h, Fragment as ae } from "react/jsx-runtime";
9
- import { FontAwesomeIcon as q } from "@fortawesome/react-fontawesome";
10
- import { forwardRef as xe, useState as R, useCallback as S, useEffect as M, useReducer as $e, useRef as F, useMemo as V, createContext as X, useContext as Y, 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
- import { createPortal as Ie } from "react-dom";
13
- import { faSadTear as kt } from "@fortawesome/free-regular-svg-icons";
14
- import { QueryClient as Nt, QueryClientProvider as _e, useMutation as ne, useQueryClient as Z, useQuery as At } from "@tanstack/react-query";
15
- import { useForm as Pe } from "react-hook-form";
16
- const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
7
+ import { Action as An, Actions as xn, ActionsDropdown as $n, Button as Dn } from "@sito/dashboard";
8
+ import { jsxs as N, jsx as m, Fragment as ce } from "react/jsx-runtime";
9
+ import { FontAwesomeIcon as U } from "@fortawesome/react-fontawesome";
10
+ import { forwardRef as $e, useState as D, useCallback as v, useEffect as P, useReducer as De, useRef as K, useMemo as q, createContext as X, useContext as G, useLayoutEffect as ft } from "react";
11
+ import { faEyeSlash as pt, faEye as gt, faClose as Le, faTrash as bt, faRotateLeft as Re, faPencil as yt, faCircleNotch as Ie, faCloudArrowDown as wt, faCloudUpload as St, faArrowUp as vt, faArrowLeft as Ct, faAdd as Te, faFilter as Tt, faBars as Nt, faSearch as kt, faCircleCheck as Et, faWarning as At, faPlus as xt } from "@fortawesome/free-solid-svg-icons";
12
+ import { createPortal as _e } from "react-dom";
13
+ import { faSadTear as $t } from "@fortawesome/free-regular-svg-icons";
14
+ import { QueryClient as Dt, QueryClientProvider as Pe, useMutation as re, useQueryClient as Z, useQuery as Lt } from "@tanstack/react-query";
15
+ import { useForm as Oe } from "react-hook-form";
16
+ const Ne = (n) => n == null ? !1 : `${n}`.length > 0, Ls = $e(function(n, e) {
17
17
  const {
18
18
  value: s,
19
19
  defaultValue: t,
20
- onChange: n,
21
- state: o = Ze.default,
20
+ onChange: r,
21
+ state: o = st.default,
22
22
  name: i = "",
23
23
  id: c = "",
24
24
  label: a = "",
25
25
  disabled: l = !1,
26
26
  required: u = !1,
27
27
  containerClassName: d = "",
28
- inputClassName: m = "",
28
+ inputClassName: h = "",
29
29
  labelClassName: f = "",
30
30
  helperText: p = "",
31
31
  helperTextClassName: b = "",
32
32
  ...y
33
- } = r, g = s !== void 0, [T, w] = R(
34
- () => Ee(t)
35
- ), v = g ? Ee(s) : T, N = (U) => {
36
- g || w(U.currentTarget.value.length > 0), n == null || n(U);
33
+ } = n, g = s !== void 0, [C, w] = D(
34
+ () => Ne(t)
35
+ ), T = g ? Ne(s) : C, k = (O) => {
36
+ g || w(O.currentTarget.value.length > 0), r == null || r(O);
37
37
  };
38
- return /* @__PURE__ */ E("div", { className: `form-paragraph-container group ${d}`, children: [
39
- /* @__PURE__ */ h(
38
+ return /* @__PURE__ */ N("div", { className: `form-paragraph-container group ${d}`, children: [
39
+ /* @__PURE__ */ m(
40
40
  "textarea",
41
41
  {
42
42
  ref: e,
43
43
  name: i,
44
44
  id: c,
45
- className: `text-input text-area form-paragraph-textarea peer ${et(o)} ${v ? "has-value" : ""} ${y.placeholder ? "has-placeholder" : ""} ${m}`,
45
+ className: `text-input text-area form-paragraph-textarea peer ${nt(o)} ${T ? "has-value" : ""} ${y.placeholder ? "has-placeholder" : ""} ${h}`,
46
46
  required: u,
47
47
  defaultValue: t,
48
48
  ...g ? { value: s } : {},
49
- onChange: N,
49
+ onChange: k,
50
50
  disabled: l,
51
51
  ...y
52
52
  }
53
53
  ),
54
- /* @__PURE__ */ E(
54
+ /* @__PURE__ */ N(
55
55
  "label",
56
56
  {
57
57
  htmlFor: c,
58
- className: `text-input-label ${tt(o)} ${f}`,
58
+ className: `text-input-label ${rt(o)} ${f}`,
59
59
  children: [
60
60
  a,
61
61
  u ? " *" : ""
62
62
  ]
63
63
  }
64
64
  ),
65
- !!p && /* @__PURE__ */ h(
65
+ !!p && /* @__PURE__ */ m(
66
66
  "p",
67
67
  {
68
- className: `text-input-helper-text ${st(o)} ${b}`,
68
+ className: `text-input-helper-text ${ot(o)} ${b}`,
69
69
  children: p
70
70
  }
71
71
  )
72
72
  ] });
73
- }), Es = (r) => {
74
- const { t: e } = k(), {
73
+ }), Rs = (n) => {
74
+ const { t: e } = E(), {
75
75
  children: s,
76
76
  handleSubmit: t,
77
- onSubmit: n,
77
+ onSubmit: r,
78
78
  isLoading: o = !1,
79
79
  buttonEnd: i = !0,
80
80
  reset: c
81
- } = r;
82
- return /* @__PURE__ */ E("form", { className: "form-container", onSubmit: t(n), children: [
81
+ } = n;
82
+ return /* @__PURE__ */ N("form", { className: "form-container", onSubmit: t(r), children: [
83
83
  s,
84
- /* @__PURE__ */ E("div", { className: `form-actions ${i ? "end" : ""}`, children: [
85
- /* @__PURE__ */ E(
86
- H,
84
+ /* @__PURE__ */ N("div", { className: `form-actions ${i ? "end" : ""}`, children: [
85
+ /* @__PURE__ */ N(
86
+ V,
87
87
  {
88
88
  type: "submit",
89
89
  color: "primary",
@@ -92,8 +92,8 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
92
92
  name: e("_accessibility:buttons.submit"),
93
93
  "aria-label": e("_accessibility:ariaLabels.submit"),
94
94
  children: [
95
- o ? /* @__PURE__ */ h(
96
- re,
95
+ o ? /* @__PURE__ */ m(
96
+ ne,
97
97
  {
98
98
  color: "stroke-base",
99
99
  loaderClass: "!w-6 mt-1",
@@ -104,8 +104,8 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
104
104
  ]
105
105
  }
106
106
  ),
107
- /* @__PURE__ */ h(
108
- H,
107
+ /* @__PURE__ */ m(
108
+ V,
109
109
  {
110
110
  type: "button",
111
111
  variant: "outlined",
@@ -117,10 +117,10 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
117
117
  )
118
118
  ] })
119
119
  ] });
120
- }, ks = xe(function(r, e) {
121
- const { t: s } = k(), [t, n] = R(!1);
122
- return /* @__PURE__ */ h(rt, { ...r, type: t ? "text" : "password", ref: e, children: /* @__PURE__ */ h(
123
- z,
120
+ }, Is = $e(function(n, e) {
121
+ const { t: s } = E(), [t, r] = D(!1);
122
+ return /* @__PURE__ */ m(it, { ...n, type: t ? "text" : "password", ref: e, children: /* @__PURE__ */ m(
123
+ W,
124
124
  {
125
125
  type: "button",
126
126
  tabIndex: -1,
@@ -128,63 +128,63 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
128
128
  t ? "_accessibility:ariaLabels.hidePassword" : "_accessibility:ariaLabels.showPassword"
129
129
  ),
130
130
  className: "password-icon",
131
- onClick: () => n(!t),
132
- icon: t ? mt : ht
131
+ onClick: () => r(!t),
132
+ icon: t ? pt : gt
133
133
  }
134
134
  ) });
135
- }), ye = (r) => {
136
- const { t: e } = k(), {
135
+ }), ye = (n) => {
136
+ const { t: e } = E(), {
137
137
  title: s,
138
138
  children: t,
139
- handleClose: n,
139
+ handleClose: r,
140
140
  open: o = !1,
141
141
  containerClassName: i = "",
142
142
  className: c = "",
143
143
  animationClass: a = "appear"
144
- } = r, l = S(
144
+ } = n, l = v(
145
145
  (d) => {
146
- d.key === "Escape" && o && n();
146
+ d.key === "Escape" && o && r();
147
147
  },
148
- [o, n]
148
+ [o, r]
149
149
  );
150
- M(() => (window.addEventListener("keydown", l), () => {
150
+ P(() => (window.addEventListener("keydown", l), () => {
151
151
  window.removeEventListener("keydown", l);
152
152
  }), [l]);
153
- const u = S(
153
+ const u = v(
154
154
  (d) => {
155
- d.target === d.currentTarget && n();
155
+ d.target === d.currentTarget && r();
156
156
  },
157
- [n]
157
+ [r]
158
158
  );
159
- return M(() => {
160
- const d = (m) => {
161
- m ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
159
+ return P(() => {
160
+ const d = (h) => {
161
+ h ? document.body.style.overflow = "hidden" : document.body.style.overflow = "auto";
162
162
  };
163
163
  return d(o), () => {
164
164
  d(!1);
165
165
  };
166
- }, [o]), Ie(
167
- /* @__PURE__ */ h(
166
+ }, [o]), _e(
167
+ /* @__PURE__ */ m(
168
168
  "div",
169
169
  {
170
170
  "aria-label": e("_accessibility:ariaLabels.closeDialog"),
171
171
  "aria-hidden": !o,
172
172
  onClick: u,
173
173
  className: `dialog-backdrop animated ${o ? `opened ${a}` : "closed"} ${i}`,
174
- children: /* @__PURE__ */ E(
174
+ children: /* @__PURE__ */ N(
175
175
  "div",
176
176
  {
177
177
  className: `dialog elevated animated ${o ? `opened ${a}` : "closed"} ${c}`,
178
178
  children: [
179
- /* @__PURE__ */ E("div", { className: "dialog-header", children: [
180
- /* @__PURE__ */ h("h3", { className: "dialog-title", children: s }),
181
- /* @__PURE__ */ h(
182
- z,
179
+ /* @__PURE__ */ N("div", { className: "dialog-header", children: [
180
+ /* @__PURE__ */ m("h3", { className: "dialog-title", children: s }),
181
+ /* @__PURE__ */ m(
182
+ W,
183
183
  {
184
- icon: De,
184
+ icon: Le,
185
185
  disabled: !o,
186
186
  "aria-disabled": !o,
187
- onClick: n,
187
+ onClick: r,
188
188
  variant: "text",
189
189
  color: "error",
190
190
  className: "icon-button dialog-close-btn",
@@ -201,12 +201,12 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
201
201
  ),
202
202
  document.body
203
203
  );
204
- }, we = (r) => {
204
+ }, we = (n) => {
205
205
  const {
206
206
  primaryText: e,
207
207
  cancelText: s,
208
208
  onPrimaryClick: t,
209
- onCancel: n,
209
+ onCancel: r,
210
210
  isLoading: o = !1,
211
211
  disabled: i = !1,
212
212
  primaryType: c = "submit",
@@ -214,18 +214,18 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
214
214
  primaryClassName: l = "",
215
215
  alignEnd: u = !1,
216
216
  primaryName: d,
217
- primaryAriaLabel: m,
217
+ primaryAriaLabel: h,
218
218
  cancelName: f,
219
219
  cancelAriaLabel: p,
220
220
  extraActions: b = []
221
- } = r;
222
- return /* @__PURE__ */ E(
221
+ } = n;
222
+ return /* @__PURE__ */ N(
223
223
  "div",
224
224
  {
225
225
  className: `dialog-actions ${u ? "end" : ""} ${a}`,
226
226
  children: [
227
- /* @__PURE__ */ E(
228
- H,
227
+ /* @__PURE__ */ N(
228
+ V,
229
229
  {
230
230
  type: c,
231
231
  color: "primary",
@@ -234,10 +234,10 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
234
234
  disabled: i,
235
235
  onClick: t,
236
236
  name: d,
237
- "aria-label": m,
237
+ "aria-label": h,
238
238
  children: [
239
- o ? /* @__PURE__ */ h(
240
- re,
239
+ o ? /* @__PURE__ */ m(
240
+ ne,
241
241
  {
242
242
  color: "stroke-base",
243
243
  loaderClass: "!w-6 mt-1",
@@ -248,14 +248,14 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
248
248
  ]
249
249
  }
250
250
  ),
251
- b == null ? void 0 : b.map((y) => /* @__PURE__ */ h(H, { ...y }, y.id)),
252
- /* @__PURE__ */ h(
253
- H,
251
+ b == null ? void 0 : b.map((y) => /* @__PURE__ */ m(V, { ...y }, y.id)),
252
+ /* @__PURE__ */ m(
253
+ V,
254
254
  {
255
255
  type: "button",
256
256
  variant: "outlined",
257
257
  disabled: i,
258
- onClick: n,
258
+ onClick: r,
259
259
  name: f,
260
260
  "aria-label": p,
261
261
  children: s
@@ -264,20 +264,20 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
264
264
  ]
265
265
  }
266
266
  );
267
- }, Ns = (r) => {
268
- const { t: e } = k(), {
267
+ }, _s = (n) => {
268
+ const { t: e } = E(), {
269
269
  children: s,
270
270
  handleSubmit: t,
271
- onSubmit: n,
271
+ onSubmit: r,
272
272
  handleClose: o,
273
273
  isLoading: i = !1,
274
274
  buttonEnd: c = !0,
275
275
  extraActions: a = [],
276
276
  ...l
277
- } = r;
278
- return /* @__PURE__ */ h(ye, { ...l, handleClose: o, children: /* @__PURE__ */ E("form", { onSubmit: t(n), children: [
279
- /* @__PURE__ */ h("div", { className: "form-container", children: s }),
280
- /* @__PURE__ */ h(
277
+ } = n;
278
+ return /* @__PURE__ */ m(ye, { ...l, handleClose: o, children: /* @__PURE__ */ N("form", { onSubmit: t(r), children: [
279
+ /* @__PURE__ */ m("div", { className: "form-container", children: s }),
280
+ /* @__PURE__ */ m(
281
281
  we,
282
282
  {
283
283
  primaryType: "submit",
@@ -296,24 +296,24 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
296
296
  }
297
297
  )
298
298
  ] }) });
299
- }, As = (r) => {
300
- const { t: e } = k(), {
299
+ }, Ps = (n) => {
300
+ const { t: e } = E(), {
301
301
  children: s,
302
302
  handleSubmit: t,
303
- handleClose: n,
303
+ handleClose: r,
304
304
  isLoading: o = !1,
305
305
  extraActions: i = [],
306
306
  ...c
307
- } = r;
308
- return /* @__PURE__ */ E(ye, { ...c, handleClose: n, children: [
307
+ } = n;
308
+ return /* @__PURE__ */ N(ye, { ...c, handleClose: r, children: [
309
309
  s,
310
- /* @__PURE__ */ h(
310
+ /* @__PURE__ */ m(
311
311
  we,
312
312
  {
313
313
  primaryText: e("_accessibility:buttons.ok"),
314
314
  cancelText: e("_accessibility:buttons.cancel"),
315
315
  onPrimaryClick: t,
316
- onCancel: n,
316
+ onCancel: r,
317
317
  isLoading: o,
318
318
  disabled: o,
319
319
  primaryType: "button",
@@ -327,31 +327,31 @@ const Ee = (r) => r == null ? !1 : `${r}`.length > 0, vs = xe(function(r, e) {
327
327
  )
328
328
  ] });
329
329
  };
330
- function xt(r) {
331
- const { message: e, className: s = "" } = r, { t } = k();
332
- return /* @__PURE__ */ h("p", { className: `import-error-message ${s}`, children: e ?? t("_messages:errors.parseFile", {
330
+ function Rt(n) {
331
+ const { message: e, className: s = "" } = n, { t } = E();
332
+ return /* @__PURE__ */ m("p", { className: `import-error-message ${s}`, children: e ?? t("_messages:errors.parseFile", {
333
333
  defaultValue: "Failed to process file"
334
334
  }) });
335
335
  }
336
- function $t(r) {
337
- const { message: e, className: s = "" } = r, { t } = k();
338
- return /* @__PURE__ */ E("div", { className: `import-loading ${s}`, children: [
339
- /* @__PURE__ */ h(re, { loaderClass: "w-5 h-5", className: "!w-auto" }),
340
- /* @__PURE__ */ h("span", { children: e ?? t("_messages:loading.processingFile", {
336
+ function It(n) {
337
+ const { message: e, className: s = "" } = n, { t } = E();
338
+ return /* @__PURE__ */ N("div", { className: `import-loading ${s}`, children: [
339
+ /* @__PURE__ */ m(ne, { loaderClass: "w-5 h-5", className: "!w-auto" }),
340
+ /* @__PURE__ */ m("span", { children: e ?? t("_messages:loading.processingFile", {
341
341
  defaultValue: "Processing file..."
342
342
  }) })
343
343
  ] });
344
344
  }
345
- function Dt(r) {
346
- const { items: e, max: s = 5, className: t = "" } = r, { t: n } = k();
345
+ function _t(n) {
346
+ const { items: e, max: s = 5, className: t = "" } = n, { t: r } = E();
347
347
  if (!e || e.length === 0) return null;
348
348
  const o = e.slice(0, s);
349
- return /* @__PURE__ */ E("div", { className: `import-preview ${t}`, children: [
350
- /* @__PURE__ */ h("p", { className: "import-preview-count", children: n("_pages:common.actions.import.previewCount", {
349
+ return /* @__PURE__ */ N("div", { className: `import-preview ${t}`, children: [
350
+ /* @__PURE__ */ m("p", { className: "import-preview-count", children: r("_pages:common.actions.import.previewCount", {
351
351
  count: e.length,
352
352
  defaultValue: `Preview: ${e.length} items`
353
353
  }) }),
354
- /* @__PURE__ */ h("pre", { className: "import-preview-content", children: JSON.stringify(o, null, 2) })
354
+ /* @__PURE__ */ m("pre", { className: "import-preview-content", children: JSON.stringify(o, null, 2) })
355
355
  ] });
356
356
  }
357
357
  const Me = () => ({
@@ -362,43 +362,43 @@ const Me = () => ({
362
362
  overrideExisting: !1,
363
363
  inputKey: 0
364
364
  });
365
- function Lt(r, e) {
365
+ function Pt(n, e) {
366
366
  switch (e.type) {
367
367
  case "SET_FILE":
368
368
  return {
369
- ...r,
369
+ ...n,
370
370
  file: e.file,
371
371
  previewItems: null,
372
372
  parseError: null,
373
373
  processing: !1
374
374
  };
375
375
  case "START_PROCESSING":
376
- return { ...r, processing: !0 };
376
+ return { ...n, processing: !0 };
377
377
  case "SET_PREVIEW":
378
378
  return {
379
- ...r,
379
+ ...n,
380
380
  previewItems: e.items,
381
381
  parseError: null,
382
382
  processing: !1
383
383
  };
384
384
  case "SET_ERROR":
385
385
  return {
386
- ...r,
386
+ ...n,
387
387
  previewItems: null,
388
388
  parseError: e.message,
389
389
  processing: !1
390
390
  };
391
391
  case "SET_OVERRIDE":
392
- return { ...r, overrideExisting: e.value };
392
+ return { ...n, overrideExisting: e.value };
393
393
  case "RESET":
394
- return { ...Me(), inputKey: r.inputKey + 1 };
394
+ return { ...Me(), inputKey: n.inputKey + 1 };
395
395
  }
396
396
  }
397
- const xs = (r) => {
398
- const { t: e } = k(), {
397
+ const Os = (n) => {
398
+ const { t: e } = E(), {
399
399
  children: s,
400
400
  handleSubmit: t,
401
- handleClose: n,
401
+ handleClose: r,
402
402
  isLoading: o = !1,
403
403
  fileProcessor: i,
404
404
  onFileProcessed: c,
@@ -406,84 +406,84 @@ const xs = (r) => {
406
406
  onOverrideChange: l,
407
407
  open: u,
408
408
  extraActions: d = [],
409
- ...m
410
- } = r, [f, p] = $e(
411
- Lt,
409
+ ...h
410
+ } = n, [f, p] = De(
411
+ Pt,
412
412
  Me()
413
413
  ), {
414
414
  file: b,
415
415
  previewItems: y,
416
416
  parseError: g,
417
- processing: T,
417
+ processing: C,
418
418
  overrideExisting: w,
419
- inputKey: v
420
- } = f, N = F(c), U = F(i);
421
- M(() => {
422
- N.current = c;
423
- }, [c]), M(() => {
424
- U.current = i;
425
- }, [i]), M(() => {
419
+ inputKey: T
420
+ } = f, k = K(c), O = K(i);
421
+ P(() => {
422
+ k.current = c;
423
+ }, [c]), P(() => {
424
+ O.current = i;
425
+ }, [i]), P(() => {
426
426
  u || p({ type: "RESET" });
427
427
  }, [u]);
428
- const B = S(
429
- async (C, D) => {
430
- var L;
431
- if (U.current) {
428
+ const j = v(
429
+ async (S, L) => {
430
+ var R;
431
+ if (O.current) {
432
432
  p({ type: "START_PROCESSING" });
433
433
  try {
434
- const _ = await U.current(C, { override: D });
435
- p({ type: "SET_PREVIEW", items: _ ?? [] }), (L = N.current) == null || L.call(N, _ ?? []);
434
+ const _ = await O.current(S, { override: L });
435
+ p({ type: "SET_PREVIEW", items: _ ?? [] }), (R = k.current) == null || R.call(k, _ ?? []);
436
436
  } catch (_) {
437
437
  console.error(_);
438
- const K = _ instanceof Error ? _.message : "Failed to parse file";
439
- p({ type: "SET_ERROR", message: K });
438
+ const Q = _ instanceof Error ? _.message : "Failed to parse file";
439
+ p({ type: "SET_ERROR", message: Q });
440
440
  }
441
441
  }
442
442
  },
443
443
  []
444
444
  );
445
- return /* @__PURE__ */ E(ye, { ...m, open: u, handleClose: n, children: [
446
- /* @__PURE__ */ h(
447
- nt,
445
+ return /* @__PURE__ */ N(ye, { ...h, open: u, handleClose: r, children: [
446
+ /* @__PURE__ */ m(
447
+ at,
448
448
  {
449
449
  onClear: () => {
450
- var C;
451
- p({ type: "SET_FILE", file: null }), (C = N.current) == null || C.call(N, []);
450
+ var S;
451
+ p({ type: "SET_FILE", file: null }), (S = k.current) == null || S.call(k, []);
452
452
  },
453
- onChange: (C) => {
454
- var L, _;
455
- const D = (L = C.target.files) == null ? void 0 : L[0];
456
- if (!D) {
457
- p({ type: "SET_FILE", file: null }), (_ = N.current) == null || _.call(N, []);
453
+ onChange: (S) => {
454
+ var R, _;
455
+ const L = (R = S.target.files) == null ? void 0 : R[0];
456
+ if (!L) {
457
+ p({ type: "SET_FILE", file: null }), (_ = k.current) == null || _.call(k, []);
458
458
  return;
459
459
  }
460
- p({ type: "SET_FILE", file: D }), B(D, w);
460
+ p({ type: "SET_FILE", file: L }), j(L, w);
461
461
  },
462
462
  label: e("_accessibility:labels.file")
463
463
  },
464
- v
464
+ T
465
465
  ),
466
- /* @__PURE__ */ E("label", { className: "import-override-label", children: [
467
- /* @__PURE__ */ h(
466
+ /* @__PURE__ */ N("label", { className: "import-override-label", children: [
467
+ /* @__PURE__ */ m(
468
468
  "input",
469
469
  {
470
470
  type: "checkbox",
471
471
  checked: w,
472
- onChange: (C) => {
473
- const D = C.target.checked;
474
- p({ type: "SET_OVERRIDE", value: D }), l == null || l(D), b && B(b, D);
472
+ onChange: (S) => {
473
+ const L = S.target.checked;
474
+ p({ type: "SET_OVERRIDE", value: L }), l == null || l(L), b && j(b, L);
475
475
  }
476
476
  }
477
477
  ),
478
- /* @__PURE__ */ h("span", { children: e("_pages:common.actions.import.override", {
478
+ /* @__PURE__ */ m("span", { children: e("_pages:common.actions.import.override", {
479
479
  defaultValue: "Override existing items"
480
480
  }) })
481
481
  ] }),
482
- /* @__PURE__ */ h(xt, { message: g }),
483
- T && /* @__PURE__ */ h($t, {}),
484
- a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */ h(Dt, { items: y }),
482
+ /* @__PURE__ */ m(Rt, { message: g }),
483
+ C && /* @__PURE__ */ m(It, {}),
484
+ a ? a(y) : !!y && y.length > 0 && /* @__PURE__ */ m(_t, { items: y }),
485
485
  s,
486
- /* @__PURE__ */ h(
486
+ /* @__PURE__ */ m(
487
487
  we,
488
488
  {
489
489
  primaryText: e("_accessibility:buttons.ok"),
@@ -491,7 +491,7 @@ const xs = (r) => {
491
491
  onPrimaryClick: () => {
492
492
  (!i || !!y && y.length > 0) && t();
493
493
  },
494
- onCancel: n,
494
+ onCancel: r,
495
495
  isLoading: o,
496
496
  primaryType: "button",
497
497
  containerClassName: "import-dialog-actions",
@@ -504,18 +504,18 @@ const xs = (r) => {
504
504
  )
505
505
  ] });
506
506
  };
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
- 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
- async function he(r, e = "GET", s, t) {
510
- const n = It(t), o = {
507
+ var F = /* @__PURE__ */ ((n) => (n[n.success = 0] = "success", n[n.error = 1] = "error", n[n.warning = 2] = "warning", n[n.info = 3] = "info", n))(F || {}), M = /* @__PURE__ */ ((n) => (n.GET = "GET", n.POST = "POST", n.PUT = "PUT", n.PATCH = "PATCH", n.DELETE = "DELETE", n))(M || {});
508
+ const Ot = (n) => Array.isArray(n) || n instanceof Headers ? !1 : typeof n == "object" && n !== null && ("headers" in n || "credentials" in n), Mt = (n) => n ? Ot(n) ? n : { headers: n } : {}, Ft = (n) => n ? n instanceof Headers ? Object.fromEntries(n.entries()) : Array.isArray(n) ? Object.fromEntries(n) : n : {};
509
+ async function he(n, e = "GET", s, t) {
510
+ const r = Mt(t), o = {
511
511
  ...s !== void 0 ? { "Content-Type": "application/json" } : {},
512
- ..._t(n.headers)
512
+ ...Ft(r.headers)
513
513
  };
514
514
  try {
515
- const i = await fetch(r, {
515
+ const i = await fetch(n, {
516
516
  method: e,
517
517
  headers: o,
518
- ...n.credentials ? { credentials: n.credentials } : {},
518
+ ...r.credentials ? { credentials: r.credentials } : {},
519
519
  ...s !== void 0 ? { body: JSON.stringify(s) } : {}
520
520
  }), c = await i.text();
521
521
  let a = null;
@@ -551,44 +551,44 @@ async function he(r, e = "GET", s, t) {
551
551
  };
552
552
  }
553
553
  }
554
- function Pt(r, e) {
554
+ function Ut(n, e) {
555
555
  const s = (t) => t instanceof Date ? t.toISOString() : String(t);
556
556
  if (e) {
557
- const t = Object.entries(e).filter(([, n]) => n != null).map(
558
- ([n, o]) => `${encodeURIComponent(n)}=${encodeURIComponent(s(o))}`
557
+ const t = Object.entries(e).filter(([, r]) => r != null).map(
558
+ ([r, o]) => `${encodeURIComponent(r)}=${encodeURIComponent(s(o))}`
559
559
  ).join("&");
560
- return t ? `${r}?${t}` : r;
560
+ return t ? `${n}?${t}` : n;
561
561
  }
562
- return r;
562
+ return n;
563
563
  }
564
- const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Date ? encodeURIComponent(r.toISOString()) : encodeURIComponent(String(r)), Mt = (r) => {
565
- if (typeof r != "string") return;
566
- const e = r.trim().toUpperCase();
564
+ const fe = (n) => typeof n == "object" && n !== null, J = (n) => n instanceof Date ? encodeURIComponent(n.toISOString()) : encodeURIComponent(String(n)), Kt = (n) => {
565
+ if (typeof n != "string") return;
566
+ const e = n.trim().toUpperCase();
567
567
  if (e === "ACTIVE" || e === "DELETED" || e === "ALL")
568
568
  return e;
569
- }, Oe = (r, e, s) => {
569
+ }, Fe = (n, e, s) => {
570
570
  const t = [];
571
571
  if (e) {
572
- const { sortingBy: n, sortingOrder: o, currentPage: i, pageSize: c } = e;
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}`);
572
+ const { sortingBy: r, sortingOrder: o, currentPage: i, pageSize: c } = e;
573
+ r !== void 0 && t.push(`sort=${String(r)}`), 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 = Mt(s.softDeleteScope);
577
- n && t.push(`softDeleteScope=${encodeURIComponent(n)}`);
576
+ const r = Kt(s.softDeleteScope);
577
+ r && t.push(`softDeleteScope=${encodeURIComponent(r)}`);
578
578
  const o = Object.entries(s).filter(
579
579
  ([i, c]) => i !== "softDeleteScope" && c !== null && c !== void 0 && c !== ""
580
580
  ).flatMap(([i, c]) => {
581
581
  if (Array.isArray(c))
582
- return c.map((a) => a instanceof Date ? `${i}==${W(a)}` : fe(a) ? `${i}==${W(a.id ?? "")}` : `${i}==${W(a)}`);
582
+ return c.map((a) => a instanceof Date ? `${i}==${J(a)}` : fe(a) ? `${i}==${J(a.id ?? "")}` : `${i}==${J(a)}`);
583
583
  if (fe(c) && "start" in c && "end" in c) {
584
584
  const a = [];
585
- return c.start != null && c.start !== "" && a.push(`${i}>=${W(c.start)}`), c.end != null && c.end !== "" && a.push(`${i}<=${W(c.end)}`), a;
585
+ return c.start != null && c.start !== "" && a.push(`${i}>=${J(c.start)}`), c.end != null && c.end !== "" && a.push(`${i}<=${J(c.end)}`), a;
586
586
  }
587
- return c instanceof Date ? `${i}==${W(c)}` : fe(c) ? `${i}==${W(c.id ?? "")}` : `${i}==${W(c)}`;
587
+ return c instanceof Date ? `${i}==${J(c)}` : fe(c) ? `${i}==${J(c.id ?? "")}` : `${i}==${J(c)}`;
588
588
  });
589
589
  o.length > 0 && t.push(`filters=${o.join(",")}`);
590
590
  }
591
- return t.length ? `${r}?${t.join("&")}` : r;
591
+ return t.length ? `${n}?${t.join("&")}` : n;
592
592
  }, se = class se {
593
593
  /**
594
594
  * @param baseUrl the base url of the server
@@ -596,7 +596,7 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
596
596
  * @param secured if the api client requires token
597
597
  * @param tokenAcquirer custom token acquirer
598
598
  */
599
- constructor(e, s = "user", t = !0, n, o = {}) {
599
+ constructor(e, s = "user", t = !0, r, o = {}) {
600
600
  A(this, "baseUrl");
601
601
  A(this, "userKey");
602
602
  A(this, "rememberKey");
@@ -606,11 +606,11 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
606
606
  A(this, "refreshExpirySkewMs");
607
607
  A(this, "secured");
608
608
  A(this, "tokenAcquirer");
609
- this.baseUrl = e, this.secured = t, this.userKey = s, this.rememberKey = o.rememberKey ?? "remember", this.refreshTokenKey = o.refreshTokenKey ?? "refreshToken", this.accessTokenExpiresAtKey = o.accessTokenExpiresAtKey ?? "accessTokenExpiresAt", this.refreshEndpoint = o.refreshEndpoint ?? "auth/refresh", this.refreshExpirySkewMs = o.refreshExpirySkewMs ?? 5e3, this.tokenAcquirer = n ?? this.defaultTokenAcquirer;
609
+ this.baseUrl = e, this.secured = t, this.userKey = s, this.rememberKey = o.rememberKey ?? "remember", this.refreshTokenKey = o.refreshTokenKey ?? "refreshToken", this.accessTokenExpiresAtKey = o.accessTokenExpiresAtKey ?? "accessTokenExpiresAt", this.refreshEndpoint = o.refreshEndpoint ?? "auth/refresh", this.refreshExpirySkewMs = o.refreshExpirySkewMs ?? 5e3, this.tokenAcquirer = r ?? this.defaultTokenAcquirer;
610
610
  }
611
611
  defaultTokenAcquirer(e) {
612
612
  if (e) return { credentials: "include" };
613
- const s = G(this.userKey);
613
+ const s = z(this.userKey);
614
614
  if (s && s.length) return { Authorization: `Bearer ${s}` };
615
615
  }
616
616
  getRefreshLockKey() {
@@ -621,12 +621,12 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
621
621
  return `${s}${t}`;
622
622
  }
623
623
  getRefreshToken() {
624
- const e = G(this.refreshTokenKey);
624
+ const e = z(this.refreshTokenKey);
625
625
  if (typeof e == "string" && e.length)
626
626
  return e;
627
627
  }
628
628
  getAccessTokenExpiresAt() {
629
- const e = G(this.accessTokenExpiresAtKey);
629
+ const e = z(this.accessTokenExpiresAtKey);
630
630
  if (typeof e == "string" && e.length)
631
631
  return e;
632
632
  }
@@ -643,9 +643,9 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
643
643
  I(this.userKey), I(this.rememberKey), I(this.refreshTokenKey), I(this.accessTokenExpiresAtKey);
644
644
  }
645
645
  storeSession(e, s) {
646
- Q(this.userKey, e.token);
646
+ H(this.userKey, e.token);
647
647
  const t = e.refreshToken === void 0 ? s : e.refreshToken;
648
- typeof t == "string" && t.length ? Q(this.refreshTokenKey, t) : I(this.refreshTokenKey), typeof e.accessTokenExpiresAt == "string" && e.accessTokenExpiresAt.length ? Q(this.accessTokenExpiresAtKey, e.accessTokenExpiresAt) : I(this.accessTokenExpiresAtKey);
648
+ typeof t == "string" && t.length ? H(this.refreshTokenKey, t) : I(this.refreshTokenKey), typeof e.accessTokenExpiresAt == "string" && e.accessTokenExpiresAt.length ? H(this.accessTokenExpiresAtKey, e.accessTokenExpiresAt) : I(this.accessTokenExpiresAtKey);
649
649
  }
650
650
  async refreshAccessTokenWithMutex() {
651
651
  const e = this.getRefreshToken();
@@ -659,10 +659,10 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
659
659
  await t;
660
660
  return;
661
661
  }
662
- const n = (async () => {
662
+ const r = (async () => {
663
663
  const { data: o, status: i, error: c } = await he(
664
664
  this.buildUrl(this.refreshEndpoint),
665
- P.POST,
665
+ M.POST,
666
666
  { refreshToken: e }
667
667
  );
668
668
  if (c || !(o != null && o.token))
@@ -672,9 +672,9 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
672
672
  };
673
673
  this.storeSession(o, e);
674
674
  })();
675
- se.refreshInFlight.set(s, n);
675
+ se.refreshInFlight.set(s, r);
676
676
  try {
677
- await n;
677
+ await r;
678
678
  } finally {
679
679
  se.refreshInFlight.delete(s);
680
680
  }
@@ -689,30 +689,30 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
689
689
  return e ? e instanceof Headers ? Object.fromEntries(e.entries()) : Array.isArray(e) ? Object.fromEntries(e) : e : {};
690
690
  }
691
691
  mergeRequestConfig(e) {
692
- const s = this.secured ? this.tokenAcquirer() : void 0, t = this.toRequestOptions(s), n = this.toRequestOptions(e), o = {
692
+ const s = this.secured ? this.tokenAcquirer() : void 0, t = this.toRequestOptions(s), r = this.toRequestOptions(e), o = {
693
693
  ...this.toHeaderRecord(t.headers),
694
- ...this.toHeaderRecord(n.headers)
695
- }, i = n.credentials ?? t.credentials, c = Object.keys(o).length > 0;
694
+ ...this.toHeaderRecord(r.headers)
695
+ }, i = r.credentials ?? t.credentials, c = Object.keys(o).length > 0;
696
696
  if (i)
697
697
  return c ? { headers: o, credentials: i } : { credentials: i };
698
698
  if (c) return o;
699
699
  }
700
- async makeRequestWithRefresh(e, s, t, n) {
700
+ async makeRequestWithRefresh(e, s, t, r) {
701
701
  this.secured && this.shouldRefreshBeforeRequest() && await this.refreshAccessTokenWithMutex();
702
702
  let o = await he(
703
703
  this.buildUrl(e),
704
704
  s,
705
705
  t,
706
- this.mergeRequestConfig(n)
706
+ this.mergeRequestConfig(r)
707
707
  );
708
708
  return this.secured && o.status === 401 && this.canRefresh() && (await this.refreshAccessTokenWithMutex(), o = await he(
709
709
  this.buildUrl(e),
710
710
  s,
711
711
  t,
712
- this.mergeRequestConfig(n)
712
+ this.mergeRequestConfig(r)
713
713
  )), o;
714
714
  }
715
- async doQuery(e, s = P.GET, t, n) {
715
+ async doQuery(e, s = M.GET, t, r) {
716
716
  const {
717
717
  data: o,
718
718
  status: i,
@@ -721,7 +721,7 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
721
721
  e,
722
722
  s,
723
723
  t,
724
- n
724
+ r
725
725
  );
726
726
  if (c || i < 200 || i >= 300)
727
727
  throw c ?? {
@@ -737,13 +737,13 @@ const fe = (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 = Oe(e, s, t), {
740
+ const r = Fe(e, s, t), {
741
741
  data: o,
742
742
  error: i,
743
743
  status: c
744
744
  } = await this.makeRequestWithRefresh(
745
- n,
746
- P.GET
745
+ r,
746
+ M.GET
747
747
  );
748
748
  if (i || c < 200 || c >= 300 || !o)
749
749
  throw i ?? {
@@ -761,19 +761,19 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
761
761
  async patch(e, s) {
762
762
  const {
763
763
  error: t,
764
- data: n,
764
+ data: r,
765
765
  status: o
766
766
  } = await this.makeRequestWithRefresh(
767
767
  e,
768
- P.PATCH,
768
+ M.PATCH,
769
769
  s
770
770
  );
771
- if (t || n === null || n === void 0)
771
+ if (t || r === null || r === void 0)
772
772
  throw t ?? {
773
773
  status: o,
774
774
  message: "Unknown error"
775
775
  };
776
- return n;
776
+ return r;
777
777
  }
778
778
  /**
779
779
  * @param endpoint - backend endpoint
@@ -783,19 +783,19 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
783
783
  async delete(e, s) {
784
784
  const {
785
785
  error: t,
786
- data: n,
786
+ data: r,
787
787
  status: o
788
788
  } = await this.makeRequestWithRefresh(
789
789
  e,
790
- P.DELETE,
790
+ M.DELETE,
791
791
  s
792
792
  );
793
- if (t || n === null || n === void 0)
793
+ if (t || r === null || r === void 0)
794
794
  throw t ?? {
795
795
  status: o,
796
796
  message: "Unknown error"
797
797
  };
798
- return n;
798
+ return r;
799
799
  }
800
800
  /**
801
801
  *
@@ -806,24 +806,29 @@ const fe = (r) => typeof r == "object" && r !== null, W = (r) => r instanceof Da
806
806
  async post(e, s) {
807
807
  const {
808
808
  error: t,
809
- data: n,
809
+ data: r,
810
810
  status: o
811
811
  } = await this.makeRequestWithRefresh(
812
812
  e,
813
- P.POST,
813
+ M.POST,
814
814
  s
815
815
  );
816
- if (t || n === null || n === void 0)
816
+ if (t || r === null || r === void 0)
817
817
  throw t ?? {
818
818
  status: o,
819
819
  message: "Unknown error"
820
820
  };
821
- return n;
821
+ return r;
822
822
  }
823
823
  };
824
824
  A(se, "refreshInFlight", /* @__PURE__ */ new Map());
825
825
  let de = se;
826
- class Ot {
826
+ class jt {
827
+ /**
828
+ * @param baseUrl - API base URL.
829
+ * @param userKey - Storage key for user session data.
830
+ * @param authConfig - Custom auth storage key configuration.
831
+ */
827
832
  constructor(e, s = "user", t = {}) {
828
833
  A(this, "api");
829
834
  this.api = new de(e, s, !1, void 0, t);
@@ -832,48 +837,53 @@ class Ot {
832
837
  const s = "auth/sign-in", t = e;
833
838
  return await this.api.doQuery(
834
839
  s,
835
- P.POST,
840
+ M.POST,
836
841
  t
837
842
  );
838
843
  }
839
844
  async refresh(e) {
840
845
  return await this.api.doQuery(
841
846
  "auth/refresh",
842
- P.POST,
847
+ M.POST,
843
848
  e
844
849
  );
845
850
  }
846
851
  async logout(e) {
847
852
  const s = "auth/sign-out", t = e != null && e.accessToken ? {
848
853
  Authorization: `Bearer ${e.accessToken}`
849
- } : void 0, n = e != null && e.refreshToken ? { refreshToken: e.refreshToken } : void 0;
854
+ } : void 0, r = e != null && e.refreshToken ? { refreshToken: e.refreshToken } : void 0;
850
855
  return await this.api.doQuery(
851
856
  s,
852
- P.POST,
853
- n,
857
+ M.POST,
858
+ r,
854
859
  t
855
860
  );
856
861
  }
857
862
  async register(e) {
858
863
  return await this.api.doQuery(
859
864
  "auth/sign-up",
860
- P.POST,
865
+ M.POST,
861
866
  e
862
867
  );
863
868
  }
864
869
  async getSession() {
865
870
  return await this.api.doQuery(
866
871
  "auth/session",
867
- P.GET,
872
+ M.GET,
868
873
  void 0,
869
874
  this.api.defaultTokenAcquirer()
870
875
  );
871
876
  }
872
877
  }
873
- class $s {
878
+ class Ms {
879
+ /**
880
+ * @param baseUrl - API base URL.
881
+ * @param userKey - Storage key for user session data.
882
+ * @param authConfig - Custom auth storage key configuration.
883
+ */
874
884
  constructor(e, s, t = {}) {
875
885
  A(this, "auth");
876
- this.auth = new Ot(e, s, t);
886
+ this.auth = new jt(e, s, t);
877
887
  }
878
888
  /**
879
889
  * @returns auth
@@ -882,17 +892,19 @@ class $s {
882
892
  return this.auth;
883
893
  }
884
894
  }
885
- class Ds {
895
+ class Fs {
886
896
  /**
887
- *
888
- * @param table
889
- * @param secured to see if the api client requires jwt protection
897
+ * @param table - Resource table/endpoint name.
898
+ * @param baseUrl - API base URL.
899
+ * @param userKey - Storage key for user session data.
900
+ * @param secured - Whether this client requires auth headers.
901
+ * @param authConfig - Custom auth storage key configuration.
890
902
  */
891
- constructor(e, s, t = "user", n = !0, o = {}) {
903
+ constructor(e, s, t = "user", r = !0, o = {}) {
892
904
  A(this, "table");
893
905
  A(this, "secured");
894
906
  A(this, "api");
895
- this.table = e, this.secured = n, this.api = new de(s, t, n, void 0, o);
907
+ this.table = e, this.secured = r, this.api = new de(s, t, r, void 0, o);
896
908
  }
897
909
  /**
898
910
  *
@@ -910,7 +922,7 @@ class Ds {
910
922
  async insertMany(e) {
911
923
  return await this.api.doQuery(
912
924
  `${this.table}/batch`,
913
- P.POST,
925
+ M.POST,
914
926
  e
915
927
  );
916
928
  }
@@ -940,12 +952,12 @@ class Ds {
940
952
  * @returns - List of elements
941
953
  */
942
954
  async export(e) {
943
- const s = Oe(
955
+ const s = Fe(
944
956
  `${this.table}/export`,
945
957
  void 0,
946
958
  e
947
959
  );
948
- return await this.api.doQuery(s, P.GET, void 0);
960
+ return await this.api.doQuery(s, M.GET, void 0);
949
961
  }
950
962
  /**
951
963
  *
@@ -955,7 +967,7 @@ class Ds {
955
967
  async import(e) {
956
968
  return await this.api.doQuery(
957
969
  `${this.table}/import`,
958
- P.POST,
970
+ M.POST,
959
971
  e
960
972
  );
961
973
  }
@@ -966,8 +978,8 @@ class Ds {
966
978
  */
967
979
  async commonGet(e) {
968
980
  return await this.api.doQuery(
969
- Pt(`${this.table}/common`, e),
970
- P.GET
981
+ Ut(`${this.table}/common`, e),
982
+ M.GET
971
983
  );
972
984
  }
973
985
  /**
@@ -985,7 +997,12 @@ class Ds {
985
997
  return await this.api.patch(`${this.table}/restore`, e);
986
998
  }
987
999
  }
988
- class Ls {
1000
+ class Us {
1001
+ /**
1002
+ * @param table - Object store name.
1003
+ * @param dbName - IndexedDB database name.
1004
+ * @param version - IndexedDB schema version.
1005
+ */
989
1006
  constructor(e, s, t = 1) {
990
1007
  A(this, "table");
991
1008
  A(this, "dbName");
@@ -999,18 +1016,18 @@ class Ls {
999
1016
  open() {
1000
1017
  return this.db ? Promise.resolve(this.db) : new Promise((e, s) => {
1001
1018
  const t = indexedDB.open(this.dbName, this.version);
1002
- t.onupgradeneeded = (n) => {
1003
- const o = n.target.result;
1019
+ t.onupgradeneeded = (r) => {
1020
+ const o = r.target.result;
1004
1021
  o.objectStoreNames.contains(this.table) || o.createObjectStore(this.table, {
1005
1022
  keyPath: "id",
1006
1023
  autoIncrement: !0
1007
1024
  });
1008
- }, t.onsuccess = (n) => {
1009
- this.db = n.target.result, this.db.onversionchange = () => {
1025
+ }, t.onsuccess = (r) => {
1026
+ this.db = r.target.result, this.db.onversionchange = () => {
1010
1027
  this.close();
1011
1028
  }, e(this.db);
1012
- }, t.onerror = (n) => {
1013
- s(n.target.error);
1029
+ }, t.onerror = (r) => {
1030
+ s(r.target.error);
1014
1031
  };
1015
1032
  });
1016
1033
  }
@@ -1029,25 +1046,25 @@ class Ls {
1029
1046
  async insertMany(e) {
1030
1047
  const s = await this.transaction("readwrite");
1031
1048
  let t = 0;
1032
- for (const n of e)
1033
- t = await this.request(s.add(n));
1049
+ for (const r of e)
1050
+ t = await this.request(s.add(r));
1034
1051
  return { ...e[e.length - 1], id: t };
1035
1052
  }
1036
1053
  async update(e, s) {
1037
1054
  const t = typeof e == "number" ? s : e;
1038
1055
  if (!t)
1039
1056
  throw new Error("IndexedDBClient.update requires a value payload");
1040
- const n = typeof e == "number" ? { ...t, id: t.id ?? e } : t, o = await this.transaction("readwrite");
1041
- return await this.request(o.put(n)), n;
1057
+ const r = typeof e == "number" ? { ...t, id: t.id ?? e } : t, o = await this.transaction("readwrite");
1058
+ return await this.request(o.put(r)), r;
1042
1059
  }
1043
1060
  async get(e, s) {
1044
1061
  var f;
1045
- const t = await this.transaction("readonly"), n = await this.request(t.getAll()), o = this.applyFilter(n, s), i = (e == null ? void 0 : e.sortingBy) ?? "id", c = ((f = e == null ? void 0 : e.sortingOrder) == null ? void 0 : f.toLowerCase()) ?? "asc";
1062
+ const t = await this.transaction("readonly"), r = await this.request(t.getAll()), o = this.applyFilter(r, s), i = (e == null ? void 0 : e.sortingBy) ?? "id", c = ((f = e == null ? void 0 : e.sortingOrder) == null ? void 0 : f.toLowerCase()) ?? "asc";
1046
1063
  o.sort((p, b) => {
1047
1064
  const y = p[i], g = b[i];
1048
1065
  return y < g ? c === "asc" ? -1 : 1 : y > g ? c === "asc" ? 1 : -1 : 0;
1049
1066
  });
1050
- const a = (e == null ? void 0 : e.pageSize) ?? 10, l = (e == null ? void 0 : e.currentPage) ?? 0, u = o.length, d = Math.ceil(u / a), m = o.slice(
1067
+ const a = (e == null ? void 0 : e.pageSize) ?? 10, l = (e == null ? void 0 : e.currentPage) ?? 0, u = o.length, d = Math.ceil(u / a), h = o.slice(
1051
1068
  l * a,
1052
1069
  l * a + a
1053
1070
  );
@@ -1058,7 +1075,7 @@ class Ls {
1058
1075
  pageSize: a,
1059
1076
  totalElements: u,
1060
1077
  totalPages: d,
1061
- items: m
1078
+ items: h
1062
1079
  };
1063
1080
  }
1064
1081
  async export(e) {
@@ -1068,8 +1085,8 @@ class Ls {
1068
1085
  async import(e) {
1069
1086
  const s = await this.transaction("readwrite");
1070
1087
  let t = 0;
1071
- for (const n of e.items)
1072
- e.override ? await this.request(s.put(n)) : await this.request(s.add(n)), t++;
1088
+ for (const r of e.items)
1089
+ e.override ? await this.request(s.put(r)) : await this.request(s.add(r)), t++;
1073
1090
  return t;
1074
1091
  }
1075
1092
  async commonGet(e) {
@@ -1084,8 +1101,8 @@ class Ls {
1084
1101
  async softDelete(e) {
1085
1102
  const s = await this.transaction("readwrite");
1086
1103
  let t = 0;
1087
- for (const n of e) {
1088
- const o = await this.request(s.get(n));
1104
+ for (const r of e) {
1105
+ const o = await this.request(s.get(r));
1089
1106
  o && (await this.request(s.put({ ...o, deletedAt: /* @__PURE__ */ new Date() })), t++);
1090
1107
  }
1091
1108
  return t;
@@ -1093,15 +1110,15 @@ class Ls {
1093
1110
  async restore(e) {
1094
1111
  const s = await this.transaction("readwrite");
1095
1112
  let t = 0;
1096
- for (const n of e) {
1097
- const o = await this.request(s.get(n));
1113
+ for (const r of e) {
1114
+ const o = await this.request(s.get(r));
1098
1115
  o && (await this.request(s.put({ ...o, deletedAt: null })), t++);
1099
1116
  }
1100
1117
  return t;
1101
1118
  }
1102
1119
  applyFilter(e, s) {
1103
1120
  if (!s) return e;
1104
- const t = this.resolveSoftDeleteScope(s.softDeleteScope), n = t === void 0 ? e : e.filter(
1121
+ const t = this.resolveSoftDeleteScope(s.softDeleteScope), r = t === void 0 ? e : e.filter(
1105
1122
  (i) => this.matchesSoftDeleteScope(
1106
1123
  t,
1107
1124
  i.deletedAt
@@ -1109,7 +1126,7 @@ class Ls {
1109
1126
  ), o = Object.entries(s).filter(
1110
1127
  ([i, c]) => i !== "softDeleteScope" && c !== void 0
1111
1128
  );
1112
- return o.length === 0 ? n : n.filter(
1129
+ return o.length === 0 ? r : r.filter(
1113
1130
  (i) => o.every(
1114
1131
  ([c, a]) => this.matchesFilterValue(
1115
1132
  a,
@@ -1143,14 +1160,19 @@ class Ls {
1143
1160
  return e === "DELETED" ? t : !t;
1144
1161
  }
1145
1162
  }
1146
- const be = (r) => typeof r == "object" && r !== null, Ft = (r) => be(r) ? "start" in r || "end" in r : !1, Ut = (r) => r !== void 0, ie = (r) => r instanceof Date ? r.toISOString() : r, Kt = (r) => {
1147
- if (typeof r != "string") return;
1148
- const e = r.trim().toUpperCase();
1163
+ const be = (n) => typeof n == "object" && n !== null, Qt = (n) => be(n) ? "start" in n || "end" in n : !1, Bt = (n) => n !== void 0, ae = (n) => n instanceof Date ? n.toISOString() : n, Ht = (n) => {
1164
+ if (typeof n != "string") return;
1165
+ const e = n.trim().toUpperCase();
1149
1166
  if (e === "ACTIVE") return "ACTIVE";
1150
1167
  if (e === "DELETED") return "DELETED";
1151
1168
  if (e === "ALL") return "ALL";
1152
1169
  };
1153
- class Rs {
1170
+ class Ks {
1171
+ /**
1172
+ * @param table - Resource table name.
1173
+ * @param supabase - Supabase client with `from` capability.
1174
+ * @param options - Mapping and column configuration options.
1175
+ */
1154
1176
  constructor(e, s, t = {}) {
1155
1177
  A(this, "table");
1156
1178
  A(this, "supabase");
@@ -1163,14 +1185,14 @@ class Rs {
1163
1185
  resolveStatus(e) {
1164
1186
  return typeof e == "number" && Number.isFinite(e) ? e : 500;
1165
1187
  }
1166
- throwHttpError(e, s, t, n = "Unknown error") {
1188
+ throwHttpError(e, s, t, r = "Unknown error") {
1167
1189
  throw {
1168
1190
  status: this.resolveStatus(s),
1169
- message: (e == null ? void 0 : e.message) || t || n
1191
+ message: (e == null ? void 0 : e.message) || t || r
1170
1192
  };
1171
1193
  }
1172
- assertNoError(e, s, t, n) {
1173
- e && this.throwHttpError(e, s, t, n);
1194
+ assertNoError(e, s, t, r) {
1195
+ e && this.throwHttpError(e, s, t, r);
1174
1196
  }
1175
1197
  toDto(e) {
1176
1198
  return this.options.mapRowToDto ? this.options.mapRowToDto(e) : e;
@@ -1188,28 +1210,28 @@ class Rs {
1188
1210
  return this.options.mapImportPreviewToRow ? this.options.mapImportPreviewToRow(e) : e;
1189
1211
  }
1190
1212
  resolveObjectFilterValue(e) {
1191
- return "id" in e ? ie(e.id) : "";
1213
+ return "id" in e ? ae(e.id) : "";
1192
1214
  }
1193
1215
  applyFilters(e, s) {
1194
1216
  if (!s) return e;
1195
1217
  let t = e;
1196
- const n = Kt(s.softDeleteScope);
1197
- return n === "ACTIVE" ? t = t.is(this.deletedAtColumn, null) : n === "DELETED" && (t = t.not(this.deletedAtColumn, "is", null)), Object.entries(s).forEach(([o, i]) => {
1218
+ const r = Ht(s.softDeleteScope);
1219
+ return r === "ACTIVE" ? t = t.is(this.deletedAtColumn, null) : r === "DELETED" && (t = t.not(this.deletedAtColumn, "is", null)), Object.entries(s).forEach(([o, i]) => {
1198
1220
  if (o === "softDeleteScope" || i === void 0 || i === null || i === "")
1199
1221
  return;
1200
1222
  const c = o === "deletedAt" ? this.deletedAtColumn : o;
1201
1223
  if (Array.isArray(i)) {
1202
- const a = i.map((l) => l instanceof Date ? l.toISOString() : be(l) ? this.resolveObjectFilterValue(l) : ie(l)).filter(Ut);
1224
+ const a = i.map((l) => l instanceof Date ? l.toISOString() : be(l) ? this.resolveObjectFilterValue(l) : ae(l)).filter(Bt);
1203
1225
  a.length > 0 && (t = t.in(c, a));
1204
1226
  return;
1205
1227
  }
1206
- if (Ft(i)) {
1228
+ if (Qt(i)) {
1207
1229
  i.start !== void 0 && i.start !== "" && (t = t.gte(
1208
1230
  c,
1209
- ie(i.start)
1231
+ ae(i.start)
1210
1232
  )), i.end !== void 0 && i.end !== "" && (t = t.lte(
1211
1233
  c,
1212
- ie(i.end)
1234
+ ae(i.end)
1213
1235
  ));
1214
1236
  return;
1215
1237
  }
@@ -1226,7 +1248,7 @@ class Rs {
1226
1248
  }
1227
1249
  t = t.eq(
1228
1250
  c,
1229
- ie(i)
1251
+ ae(i)
1230
1252
  );
1231
1253
  }), t;
1232
1254
  }
@@ -1254,13 +1276,13 @@ class Rs {
1254
1276
  t.statusText,
1255
1277
  "Unable to insert many rows"
1256
1278
  );
1257
- const n = (o = t.data) == null ? void 0 : o.at(-1);
1258
- return n || this.throwHttpError(
1279
+ const r = (o = t.data) == null ? void 0 : o.at(-1);
1280
+ return r || this.throwHttpError(
1259
1281
  null,
1260
1282
  t.status,
1261
1283
  t.statusText,
1262
1284
  "Unable to insert many rows"
1263
- ), this.toDto(n);
1285
+ ), this.toDto(r);
1264
1286
  }
1265
1287
  async update(e) {
1266
1288
  const s = {
@@ -1279,7 +1301,7 @@ class Rs {
1279
1301
  ), this.toDto(t.data);
1280
1302
  }
1281
1303
  async get(e, s) {
1282
- const t = (e == null ? void 0 : e.pageSize) ?? 10, n = (e == null ? void 0 : e.currentPage) ?? 0, o = String((e == null ? void 0 : e.sortingBy) ?? this.defaultSortColumn), i = String((e == null ? void 0 : e.sortingOrder) ?? "asc").toLowerCase() === "desc" ? "desc" : "asc", c = n * t, a = c + t - 1;
1304
+ const t = (e == null ? void 0 : e.pageSize) ?? 10, r = (e == null ? void 0 : e.currentPage) ?? 0, o = String((e == null ? void 0 : e.sortingBy) ?? this.defaultSortColumn), i = String((e == null ? void 0 : e.sortingOrder) ?? "asc").toLowerCase() === "desc" ? "desc" : "asc", c = r * t, a = c + t - 1;
1283
1305
  let l = this.supabase.from(this.table).select("*", {
1284
1306
  count: "exact"
1285
1307
  });
@@ -1291,14 +1313,14 @@ class Rs {
1291
1313
  u.statusText,
1292
1314
  "Unable to load list"
1293
1315
  );
1294
- const d = (u.data ?? []).map((f) => this.toDto(f)), m = u.count ?? d.length;
1316
+ const d = (u.data ?? []).map((f) => this.toDto(f)), h = u.count ?? d.length;
1295
1317
  return {
1296
1318
  sort: o,
1297
1319
  order: i,
1298
- currentPage: n,
1320
+ currentPage: r,
1299
1321
  pageSize: t,
1300
- totalElements: m,
1301
- totalPages: t > 0 ? Math.ceil(m / t) : 0,
1322
+ totalElements: h,
1323
+ totalPages: t > 0 ? Math.ceil(h / t) : 0,
1302
1324
  items: d
1303
1325
  };
1304
1326
  }
@@ -1311,18 +1333,18 @@ class Rs {
1311
1333
  t.status,
1312
1334
  t.statusText,
1313
1335
  "Unable to export"
1314
- ), (t.data ?? []).map((n) => this.toDto(n));
1336
+ ), (t.data ?? []).map((r) => this.toDto(r));
1315
1337
  }
1316
1338
  async import(e) {
1317
1339
  var o;
1318
1340
  if (e.items.length === 0) return 0;
1319
- const s = e.items.map((i) => this.toImportRow(i)), n = await (e.override ? this.supabase.from(this.table).upsert(s, { onConflict: this.idColumn }).select(this.idColumn) : this.supabase.from(this.table).insert(s).select(this.idColumn));
1341
+ const s = e.items.map((i) => this.toImportRow(i)), r = await (e.override ? this.supabase.from(this.table).upsert(s, { onConflict: this.idColumn }).select(this.idColumn) : this.supabase.from(this.table).insert(s).select(this.idColumn));
1320
1342
  return this.assertNoError(
1321
- n.error,
1322
- n.status,
1323
- n.statusText,
1343
+ r.error,
1344
+ r.status,
1345
+ r.statusText,
1324
1346
  "Unable to import rows"
1325
- ), ((o = n.data) == null ? void 0 : o.length) ?? 0;
1347
+ ), ((o = r.data) == null ? void 0 : o.length) ?? 0;
1326
1348
  }
1327
1349
  async commonGet(e) {
1328
1350
  let s = this.supabase.from(this.table).select("*");
@@ -1333,7 +1355,7 @@ class Rs {
1333
1355
  t.status,
1334
1356
  t.statusText,
1335
1357
  "Unable to load common data"
1336
- ), (t.data ?? []).map((n) => this.toCommonDto(n));
1358
+ ), (t.data ?? []).map((r) => this.toCommonDto(r));
1337
1359
  }
1338
1360
  async getById(e) {
1339
1361
  const s = {
@@ -1356,7 +1378,7 @@ class Rs {
1356
1378
  if (e.length === 0) return 0;
1357
1379
  const s = ((c = (i = this.options).nowFactory) == null ? void 0 : c.call(i).toISOString()) ?? (/* @__PURE__ */ new Date()).toISOString(), t = this.supabase.from(this.table).update({
1358
1380
  [this.deletedAtColumn]: s
1359
- }), n = `(${e.join(",")})`, o = await t.filter(this.idColumn, "in", n).select(this.idColumn);
1381
+ }), r = `(${e.join(",")})`, o = await t.filter(this.idColumn, "in", r).select(this.idColumn);
1360
1382
  return this.assertNoError(
1361
1383
  o.error,
1362
1384
  o.status,
@@ -1367,53 +1389,53 @@ class Rs {
1367
1389
  async restore(e) {
1368
1390
  var o;
1369
1391
  if (e.length === 0) return 0;
1370
- const s = this.supabase.from(this.table).update({ [this.deletedAtColumn]: null }), t = `(${e.join(",")})`, n = await s.filter(this.idColumn, "in", t).select(this.idColumn);
1392
+ const s = this.supabase.from(this.table).update({ [this.deletedAtColumn]: null }), t = `(${e.join(",")})`, r = await s.filter(this.idColumn, "in", t).select(this.idColumn);
1371
1393
  return this.assertNoError(
1372
- n.error,
1373
- n.status,
1374
- n.statusText,
1394
+ r.error,
1395
+ r.status,
1396
+ r.statusText,
1375
1397
  "Unable to restore"
1376
- ), ((o = n.data) == null ? void 0 : o.length) ?? 0;
1398
+ ), ((o = r.data) == null ? void 0 : o.length) ?? 0;
1377
1399
  }
1378
1400
  }
1379
- const jt = (r) => typeof r == "object" && r !== null, Qt = (r, e) => {
1380
- if (jt(r))
1401
+ const qt = (n) => typeof n == "object" && n !== null, Vt = (n, e) => {
1402
+ if (qt(n))
1381
1403
  for (const s of e) {
1382
- const t = r[s];
1404
+ const t = n[s];
1383
1405
  if (typeof t == "string" && t.trim().length > 0)
1384
1406
  return t.trim();
1385
1407
  }
1386
- }, qt = (r, e) => {
1387
- if (!r) return e;
1388
- const s = Number(r);
1408
+ }, zt = (n, e) => {
1409
+ if (!n) return e;
1410
+ const s = Number(n);
1389
1411
  return Number.isFinite(s) ? s : e;
1390
- }, ke = (r, e) => {
1412
+ }, ke = (n, e) => {
1391
1413
  const {
1392
1414
  defaultId: s = 0,
1393
1415
  defaultUsername: t = "",
1394
- defaultEmail: n = "",
1416
+ defaultEmail: r = "",
1395
1417
  usernameMetadataKeys: o = ["username", "name", "full_name"]
1396
- } = e ?? {}, i = Qt(
1397
- r.user.user_metadata,
1418
+ } = e ?? {}, i = Vt(
1419
+ n.user.user_metadata,
1398
1420
  o
1399
1421
  );
1400
1422
  return {
1401
- id: qt(r.user.id, s),
1423
+ id: zt(n.user.id, s),
1402
1424
  username: i ?? t,
1403
- email: r.user.email ?? n,
1404
- token: r.access_token,
1405
- refreshToken: r.refresh_token ?? null,
1406
- accessTokenExpiresAt: typeof r.expires_at == "number" ? new Date(r.expires_at * 1e3).toISOString() : null
1425
+ email: n.user.email ?? r,
1426
+ token: n.access_token,
1427
+ refreshToken: n.refresh_token ?? null,
1428
+ accessTokenExpiresAt: typeof n.expires_at == "number" ? new Date(n.expires_at * 1e3).toISOString() : null
1407
1429
  };
1408
1430
  };
1409
- function Is(r) {
1410
- return Object.keys(r).filter((e) => isNaN(Number(e))).map((e) => ({
1431
+ function js(n) {
1432
+ return Object.keys(n).filter((e) => isNaN(Number(e))).map((e) => ({
1411
1433
  key: e,
1412
- value: r[e]
1434
+ value: n[e]
1413
1435
  }));
1414
1436
  }
1415
- const G = (r, e = "") => {
1416
- const s = localStorage.getItem(r) ?? void 0;
1437
+ const z = (n, e = "") => {
1438
+ const s = localStorage.getItem(n) ?? void 0;
1417
1439
  if (s && e.length)
1418
1440
  switch (e) {
1419
1441
  case "object":
@@ -1426,12 +1448,12 @@ const G = (r, e = "") => {
1426
1448
  return s;
1427
1449
  }
1428
1450
  return s;
1429
- }, Q = (r, e) => localStorage.setItem(
1430
- r,
1451
+ }, H = (n, e) => localStorage.setItem(
1452
+ n,
1431
1453
  typeof e == "object" ? JSON.stringify(e) : e
1432
- ), I = (r) => localStorage.removeItem(r);
1433
- function _s(r) {
1434
- const e = r ? new Date(r) : /* @__PURE__ */ new Date(), s = {
1454
+ ), I = (n) => localStorage.removeItem(n);
1455
+ function Qs(n) {
1456
+ const e = n ? new Date(n) : /* @__PURE__ */ new Date(), s = {
1435
1457
  weekday: "long",
1436
1458
  // martes
1437
1459
  day: "numeric",
@@ -1452,70 +1474,70 @@ function _s(r) {
1452
1474
  s
1453
1475
  );
1454
1476
  }
1455
- function Ps(r) {
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
- return `${s}/${t}/${n} ${o}:${i}`;
1477
+ function Bs(n) {
1478
+ const e = n ? new Date(n) : /* @__PURE__ */ new Date(), s = String(e.getDate()).padStart(2, "0"), t = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getFullYear()).slice(-2), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
1479
+ return `${s}/${t}/${r} ${o}:${i}`;
1458
1480
  }
1459
- function Ms(r) {
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
- return `${s}-${t}-${n}T${o}:${i}`;
1481
+ function Hs(n) {
1482
+ const e = n ? new Date(n) : /* @__PURE__ */ new Date(), s = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0"), o = String(e.getHours()).padStart(2, "0"), i = String(e.getMinutes()).padStart(2, "0");
1483
+ return `${s}-${t}-${r}T${o}:${i}`;
1462
1484
  }
1463
- const Ht = () => {
1485
+ const Wt = () => {
1464
1486
  var s;
1465
- const r = navigator, e = ((s = r == null ? void 0 : r.userAgentData) == null ? void 0 : s.platform) || (r == null ? void 0 : r.platform) || "";
1487
+ const n = navigator, e = ((s = n == null ? void 0 : n.userAgentData) == null ? void 0 : s.platform) || (n == null ? void 0 : n.platform) || "";
1466
1488
  return /Mac|iPhone|iPod|iPad/i.test(e);
1467
1489
  };
1468
- function Se(r) {
1469
- if (!r || typeof r != "object") return !1;
1470
- const e = r;
1490
+ function Se(n) {
1491
+ if (!n || typeof n != "object") return !1;
1492
+ const e = n;
1471
1493
  return Array.isArray(e.errors) && e.errors.every(
1472
1494
  (s) => Array.isArray(s) && s.length === 2 && typeof s[0] == "string"
1473
1495
  );
1474
1496
  }
1475
- function Te(r) {
1476
- if (!r || typeof r != "object") return !1;
1477
- const e = r;
1497
+ function ve(n) {
1498
+ if (!n || typeof n != "object") return !1;
1499
+ const e = n;
1478
1500
  return typeof (e == null ? void 0 : e.status) == "number" && typeof (e == null ? void 0 : e.message) == "string";
1479
1501
  }
1480
- function Os(r, e) {
1481
- return r != null && r.errors ? r.errors.map(([s, t]) => e(s, t)) : [];
1502
+ function qs(n, e) {
1503
+ return n != null && n.errors ? n.errors.map(([s, t]) => e(s, t)) : [];
1482
1504
  }
1483
- const Fe = X(
1505
+ const Ue = X(
1484
1506
  void 0
1485
1507
  );
1486
- function Fs(r) {
1487
- const { children: e } = r, s = F(0), [t, n] = $e(
1488
- (m, f) => {
1508
+ function Vs(n) {
1509
+ const { children: e } = n, s = K(0), [t, r] = De(
1510
+ (h, f) => {
1489
1511
  const { type: p, items: b, id: y } = f;
1490
1512
  switch (p) {
1491
1513
  case "set":
1492
1514
  return b ?? [];
1493
1515
  case "remove":
1494
- return y !== void 0 ? m.filter((g) => g.id !== y) : [];
1516
+ return y !== void 0 ? h.filter((g) => g.id !== y) : [];
1495
1517
  }
1496
- return m;
1518
+ return h;
1497
1519
  },
1498
1520
  [],
1499
1521
  () => []
1500
- ), o = (m) => m.map((f) => ({ ...f, id: s.current++ })), i = S(
1501
- (m) => n({
1522
+ ), o = (h) => h.map((f) => ({ ...f, id: s.current++ })), i = v(
1523
+ (h) => r({
1502
1524
  type: "set",
1503
- items: o([{ ...m, type: O.error }])
1525
+ items: o([{ ...h, type: F.error }])
1504
1526
  }),
1505
1527
  []
1506
- ), c = S(
1507
- (m) => n({ type: "set", items: o([{ ...m }]) }),
1528
+ ), c = v(
1529
+ (h) => r({ type: "set", items: o([{ ...h }]) }),
1508
1530
  []
1509
- ), a = S(
1510
- (m) => n({ type: "set", items: o(m) }),
1531
+ ), a = v(
1532
+ (h) => r({ type: "set", items: o(h) }),
1511
1533
  []
1512
- ), l = S(
1513
- (m) => n({
1534
+ ), l = v(
1535
+ (h) => r({
1514
1536
  type: "set",
1515
- items: o([{ ...m, type: O.success }])
1537
+ items: o([{ ...h, type: F.success }])
1516
1538
  }),
1517
1539
  []
1518
- ), u = (m) => n({ type: "remove", id: m }), d = V(() => ({
1540
+ ), u = (h) => r({ type: "remove", id: h }), d = q(() => ({
1519
1541
  notification: t,
1520
1542
  removeNotification: u,
1521
1543
  showErrorNotification: i,
@@ -1529,14 +1551,14 @@ function Fs(r) {
1529
1551
  a,
1530
1552
  l
1531
1553
  ]);
1532
- return /* @__PURE__ */ h(Fe.Provider, { value: d, children: e });
1554
+ return /* @__PURE__ */ m(Ue.Provider, { value: d, children: e });
1533
1555
  }
1534
1556
  const oe = () => {
1535
- const r = Y(Fe);
1536
- if (!r)
1557
+ const n = G(Ue);
1558
+ if (!n)
1537
1559
  throw new Error("NotificationContext must be used within a Provider");
1538
- return r;
1539
- }, Ce = () => new Nt({
1560
+ return n;
1561
+ }, Ce = () => new Dt({
1540
1562
  defaultOptions: {
1541
1563
  queries: {
1542
1564
  refetchInterval: !1,
@@ -1548,50 +1570,50 @@ const oe = () => {
1548
1570
  // default: true
1549
1571
  }
1550
1572
  }
1551
- }), Us = Ce(), Ue = X(
1573
+ }), zs = Ce(), Ke = X(
1552
1574
  void 0
1553
- ), Ks = (r) => {
1554
- const { children: e, manager: s, queryClient: t } = r, [n] = R(Ce), o = t ?? n;
1555
- return /* @__PURE__ */ h(Ue.Provider, { value: { client: s }, children: /* @__PURE__ */ h(_e, { client: o, children: e }) });
1556
- }, Bt = () => {
1557
- const r = Y(Ue);
1558
- if (!r)
1575
+ ), Ws = (n) => {
1576
+ const { children: e, manager: s, queryClient: t } = n, [r] = D(Ce), o = t ?? r;
1577
+ return /* @__PURE__ */ m(Ke.Provider, { value: { client: s }, children: /* @__PURE__ */ m(Pe, { client: o, children: e }) });
1578
+ }, Gt = () => {
1579
+ const n = G(Ke);
1580
+ if (!n)
1559
1581
  throw new Error("managerContext must be used within a Provider");
1560
- return r.client;
1582
+ return n.client;
1561
1583
  }, me = X(
1562
1584
  void 0
1563
- ), Vt = () => {
1564
- const r = Y(me);
1565
- if (!r) throw new Error("authContext must be used within a Provider");
1566
- return r;
1567
- }, Ke = () => Y(me), js = (r) => {
1585
+ ), Jt = () => {
1586
+ const n = G(me);
1587
+ if (!n) throw new Error("authContext must be used within a Provider");
1588
+ return n;
1589
+ }, je = () => G(me), Gs = (n) => {
1568
1590
  const {
1569
1591
  children: e,
1570
1592
  guestMode: s = "guest_mode",
1571
1593
  user: t = "user",
1572
- remember: n = "remember",
1594
+ remember: r = "remember",
1573
1595
  refreshTokenKey: o = "refreshToken",
1574
1596
  accessTokenExpiresAtKey: i = "accessTokenExpiresAt"
1575
- } = r, c = Bt(), [a, l] = R({}), u = S(() => {
1576
- I(t), I(n), I(o), I(i);
1577
- }, [i, o, n, t]), d = S(() => !!G(s, "boolean") && a.token === void 0, [a.token, s]), m = S(
1597
+ } = n, c = Gt(), [a, l] = D({}), u = v(() => {
1598
+ I(t), I(r), I(o), I(i);
1599
+ }, [i, o, r, t]), d = v(() => !!z(s, "boolean") && a.token === void 0, [a.token, s]), h = v(
1578
1600
  (g) => {
1579
- Q(s, g);
1601
+ H(s, g);
1580
1602
  },
1581
1603
  [s]
1582
- ), f = S(
1583
- (g, T) => {
1604
+ ), f = v(
1605
+ (g, C) => {
1584
1606
  if (!g) return;
1585
- const w = G(n, "boolean"), v = T ?? (typeof w == "boolean" ? w : !1);
1586
- l(g), I(s), Q(t, g.token), Q(n, v), typeof g.refreshToken == "string" && g.refreshToken.length ? Q(o, g.refreshToken) : I(o), typeof g.accessTokenExpiresAt == "string" && g.accessTokenExpiresAt.length ? Q(i, g.accessTokenExpiresAt) : I(i);
1607
+ const w = z(r, "boolean"), T = C ?? (typeof w == "boolean" ? w : !1);
1608
+ l(g), I(s), H(t, g.token), H(r, T), typeof g.refreshToken == "string" && g.refreshToken.length ? H(o, g.refreshToken) : I(o), typeof g.accessTokenExpiresAt == "string" && g.accessTokenExpiresAt.length ? H(i, g.accessTokenExpiresAt) : I(i);
1587
1609
  },
1588
- [i, s, o, n, t]
1589
- ), p = S(async () => {
1590
- const g = G(t) ?? a.token, T = G(o) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
1610
+ [i, s, o, r, t]
1611
+ ), p = v(async () => {
1612
+ const g = z(t) ?? a.token, C = z(o) ?? (typeof a.refreshToken == "string" ? a.refreshToken : void 0);
1591
1613
  try {
1592
1614
  await c.Auth.logout({
1593
1615
  accessToken: g,
1594
- refreshToken: T
1616
+ refreshToken: C
1595
1617
  });
1596
1618
  } catch (w) {
1597
1619
  console.error(w);
@@ -1604,100 +1626,100 @@ const oe = () => {
1604
1626
  c.Auth,
1605
1627
  o,
1606
1628
  t
1607
- ]), b = S(async () => {
1629
+ ]), b = v(async () => {
1608
1630
  try {
1609
1631
  const g = await c.Auth.getSession();
1610
1632
  f(g);
1611
1633
  } catch (g) {
1612
1634
  console.error(g), p();
1613
1635
  }
1614
- }, [f, p, c.Auth]), y = V(() => ({
1636
+ }, [f, p, c.Auth]), y = q(() => ({
1615
1637
  account: a,
1616
1638
  logUser: f,
1617
1639
  logoutUser: p,
1618
1640
  logUserFromLocal: b,
1619
1641
  isInGuestMode: d,
1620
- setGuestMode: m
1642
+ setGuestMode: h
1621
1643
  }), [
1622
1644
  a,
1623
1645
  f,
1624
1646
  p,
1625
1647
  b,
1626
1648
  d,
1627
- m
1649
+ h
1628
1650
  ]);
1629
- return /* @__PURE__ */ h(me.Provider, { value: y, children: e });
1630
- }, Qs = () => Vt(), je = X(void 0), Gt = () => {
1631
- const r = Y(je);
1632
- if (!r)
1651
+ return /* @__PURE__ */ m(me.Provider, { value: y, children: e });
1652
+ }, Js = () => Jt(), Qe = X(void 0), Yt = () => {
1653
+ const n = G(Qe);
1654
+ if (!n)
1633
1655
  throw new Error("supabaseManagerContext must be used within a Provider");
1634
- return r.client;
1635
- }, qs = (r) => {
1656
+ return n.client;
1657
+ }, Ys = (n) => {
1636
1658
  const {
1637
1659
  children: e,
1638
1660
  guestMode: s = "guest_mode",
1639
1661
  user: t = "user",
1640
- remember: n = "remember",
1662
+ remember: r = "remember",
1641
1663
  refreshTokenKey: o = "refreshToken",
1642
1664
  accessTokenExpiresAtKey: i = "accessTokenExpiresAt",
1643
1665
  sessionMapper: c
1644
- } = r, a = Gt(), l = F(c ?? ke);
1645
- M(() => {
1666
+ } = n, a = Yt(), l = K(c ?? ke);
1667
+ P(() => {
1646
1668
  l.current = c ?? ke;
1647
1669
  }, [c]);
1648
- const [u, d] = R({}), m = S(() => {
1649
- I(t), I(n), I(o), I(i);
1650
- }, [i, o, n, t]), f = S(() => !!G(s, "boolean") && u.token === void 0, [u.token, s]), p = S(
1670
+ const [u, d] = D({}), h = v(() => {
1671
+ I(t), I(r), I(o), I(i);
1672
+ }, [i, o, r, t]), f = v(() => !!z(s, "boolean") && u.token === void 0, [u.token, s]), p = v(
1651
1673
  (w) => {
1652
- Q(s, w);
1674
+ H(s, w);
1653
1675
  },
1654
1676
  [s]
1655
- ), b = S(
1656
- (w, v) => {
1677
+ ), b = v(
1678
+ (w, T) => {
1657
1679
  if (!w) return;
1658
- const N = G(n, "boolean"), U = v ?? (typeof N == "boolean" ? N : !1);
1659
- d(w), I(s), Q(t, w.token), Q(n, U), typeof w.refreshToken == "string" && w.refreshToken.length ? Q(o, w.refreshToken) : I(o), typeof w.accessTokenExpiresAt == "string" && w.accessTokenExpiresAt.length ? Q(i, w.accessTokenExpiresAt) : I(i);
1680
+ const k = z(r, "boolean"), O = T ?? (typeof k == "boolean" ? k : !1);
1681
+ d(w), I(s), H(t, w.token), H(r, O), typeof w.refreshToken == "string" && w.refreshToken.length ? H(o, w.refreshToken) : I(o), typeof w.accessTokenExpiresAt == "string" && w.accessTokenExpiresAt.length ? H(i, w.accessTokenExpiresAt) : I(i);
1660
1682
  },
1661
- [i, s, o, n, t]
1662
- ), y = S(async () => {
1683
+ [i, s, o, r, t]
1684
+ ), y = v(async () => {
1663
1685
  try {
1664
1686
  await a.auth.signOut();
1665
1687
  } catch (w) {
1666
1688
  console.error(w);
1667
1689
  }
1668
- d({}), m();
1669
- }, [m, a.auth]), g = S(async () => {
1690
+ d({}), h();
1691
+ }, [h, a.auth]), g = v(async () => {
1670
1692
  try {
1671
- const { data: w, error: v } = await a.auth.getSession();
1672
- if (v) throw v;
1693
+ const { data: w, error: T } = await a.auth.getSession();
1694
+ if (T) throw T;
1673
1695
  if (!w.session) {
1674
- d({}), m();
1696
+ d({}), h();
1675
1697
  return;
1676
1698
  }
1677
1699
  b(l.current(w.session));
1678
1700
  } catch (w) {
1679
1701
  console.error(w), await y();
1680
1702
  }
1681
- }, [m, b, y, a.auth]);
1682
- M(() => {
1703
+ }, [h, b, y, a.auth]);
1704
+ P(() => {
1683
1705
  let w = !0;
1684
1706
  (async () => {
1685
1707
  w && await g();
1686
1708
  })();
1687
- const { data: N } = a.auth.onAuthStateChange((U, B) => {
1709
+ const { data: k } = a.auth.onAuthStateChange((O, j) => {
1688
1710
  if (w) {
1689
- if (!B) {
1690
- d({}), m();
1711
+ if (!j) {
1712
+ d({}), h();
1691
1713
  return;
1692
1714
  }
1693
- b(l.current(B));
1715
+ b(l.current(j));
1694
1716
  }
1695
1717
  });
1696
1718
  return () => {
1697
- w = !1, N.subscription.unsubscribe();
1719
+ w = !1, k.subscription.unsubscribe();
1698
1720
  };
1699
- }, [m, b, g, a.auth]);
1700
- const T = V(() => ({
1721
+ }, [h, b, g, a.auth]);
1722
+ const C = q(() => ({
1701
1723
  account: u,
1702
1724
  logUser: b,
1703
1725
  logoutUser: y,
@@ -1712,27 +1734,27 @@ const oe = () => {
1712
1734
  f,
1713
1735
  p
1714
1736
  ]);
1715
- return /* @__PURE__ */ h(me.Provider, { value: T, children: e });
1716
- }, Hs = (r) => {
1717
- const { children: e, supabase: s, queryClient: t } = r, [n] = R(Ce), o = t ?? n;
1718
- return /* @__PURE__ */ h(je.Provider, { value: { client: s }, children: /* @__PURE__ */ h(_e, { client: o, children: e }) });
1719
- }, Qe = X({}), Bs = (r) => {
1720
- const { children: e, location: s, navigate: t, linkComponent: n, searchComponent: o } = r;
1721
- return /* @__PURE__ */ h(
1722
- Qe.Provider,
1737
+ return /* @__PURE__ */ m(me.Provider, { value: C, children: e });
1738
+ }, Xs = (n) => {
1739
+ const { children: e, supabase: s, queryClient: t } = n, [r] = D(Ce), o = t ?? r;
1740
+ return /* @__PURE__ */ m(Qe.Provider, { value: { client: s }, children: /* @__PURE__ */ m(Pe, { client: o, children: e }) });
1741
+ }, Be = X({}), Zs = (n) => {
1742
+ const { children: e, location: s, navigate: t, linkComponent: r, searchComponent: o } = n;
1743
+ return /* @__PURE__ */ m(
1744
+ Be.Provider,
1723
1745
  {
1724
- value: { location: s, navigate: t, linkComponent: n, searchComponent: o },
1746
+ value: { location: s, navigate: t, linkComponent: r, searchComponent: o },
1725
1747
  children: e
1726
1748
  }
1727
1749
  );
1728
- }, ce = () => {
1729
- const r = Y(Qe);
1730
- if (r === void 0 || Object.keys(r).length === 0)
1750
+ }, ie = () => {
1751
+ const n = G(Be);
1752
+ if (n === void 0 || Object.keys(n).length === 0)
1731
1753
  throw new Error(
1732
1754
  "Config provider has not been set. This step is required and cannot be skipped."
1733
1755
  );
1734
- return r;
1735
- }, Wt = {
1756
+ return n;
1757
+ }, Xt = {
1736
1758
  addChildItem: () => {
1737
1759
  },
1738
1760
  removeChildItem: () => {
@@ -1740,67 +1762,88 @@ const oe = () => {
1740
1762
  clearDynamicItems: () => {
1741
1763
  },
1742
1764
  dynamicItems: {}
1743
- }, qe = X(
1744
- Wt
1745
- ), Vs = (r) => {
1746
- const { children: e } = r, [s, t] = R({}), n = S(
1765
+ }, He = X(
1766
+ Xt
1767
+ ), en = (n) => {
1768
+ const { children: e } = n, [s, t] = D({}), r = v(
1747
1769
  (a, l) => t((u) => ({
1748
1770
  ...u,
1749
1771
  [a]: [...u[a] ?? [], l]
1750
1772
  })),
1751
1773
  []
1752
- ), o = S(
1774
+ ), o = v(
1753
1775
  (a, l) => t((u) => ({
1754
1776
  ...u,
1755
- [a]: (u[a] ?? []).filter((d, m) => m !== l)
1777
+ [a]: (u[a] ?? []).filter((d, h) => h !== l)
1756
1778
  })),
1757
1779
  []
1758
- ), i = S((a) => {
1780
+ ), i = v((a) => {
1759
1781
  t(a ? (l) => ({
1760
1782
  ...l,
1761
1783
  [a]: []
1762
1784
  }) : {});
1763
- }, []), c = V(
1785
+ }, []), c = q(
1764
1786
  () => ({
1765
1787
  dynamicItems: s,
1766
- addChildItem: n,
1788
+ addChildItem: r,
1767
1789
  removeChildItem: o,
1768
1790
  clearDynamicItems: i
1769
1791
  }),
1770
- [s, i, o, n]
1792
+ [s, i, o, r]
1771
1793
  );
1772
- return /* @__PURE__ */ h(
1773
- qe.Provider,
1794
+ return /* @__PURE__ */ m(
1795
+ He.Provider,
1774
1796
  {
1775
1797
  value: c,
1776
1798
  children: e
1777
1799
  }
1778
1800
  );
1779
- }, zt = () => Y(qe);
1780
- function Gs(r) {
1801
+ }, Zt = () => G(He), qe = X(void 0), tn = ({
1802
+ children: n
1803
+ }) => {
1804
+ const [e, s] = D(null), t = v(
1805
+ (o) => s(o),
1806
+ []
1807
+ ), r = q(
1808
+ () => ({ centerAction: e, setCenterAction: t }),
1809
+ [e, t]
1810
+ );
1811
+ return /* @__PURE__ */ m(qe.Provider, { value: r, children: n });
1812
+ }, es = (n) => n ? typeof n == "function" ? { onClick: () => n() } : n : null, Ve = () => G(qe), ts = () => {
1813
+ const n = Ve();
1814
+ if (!n)
1815
+ throw new Error(
1816
+ "useBottomNavAction must be used within BottomNavActionProvider"
1817
+ );
1818
+ return n;
1819
+ }, sn = (n) => {
1820
+ const { setCenterAction: e } = ts();
1821
+ P(() => (e(es(n)), () => e(null)), [n, e]);
1822
+ };
1823
+ function nn(n) {
1781
1824
  var y;
1782
- const { t: e } = k(), { open: s, onClose: t, menuMap: n, logo: o } = r, i = Ke(), { dynamicItems: c } = zt(), { linkComponent: a, location: l } = ce(), u = a, d = V(() => n.filter((g) => {
1783
- var v;
1784
- const T = g.auth, w = !!((v = i == null ? void 0 : i.account) != null && v.email);
1785
- return T == null || T && w || !T && !w;
1786
- }), [(y = i == null ? void 0 : i.account) == null ? void 0 : y.email, n]), m = S(
1825
+ const { t: e } = E(), { open: s, onClose: t, menuMap: r, logo: o } = n, i = je(), { dynamicItems: c } = Zt(), { linkComponent: a, location: l } = ie(), u = a, d = q(() => r.filter((g) => {
1826
+ var T;
1827
+ const C = g.auth, w = !!((T = i == null ? void 0 : i.account) != null && T.email);
1828
+ return C == null || C && w || !C && !w;
1829
+ }), [(y = i == null ? void 0 : i.account) == null ? void 0 : y.email, r]), h = v(
1787
1830
  (g) => {
1788
1831
  g.key === "Escape" && s && t();
1789
1832
  },
1790
1833
  [t, s]
1791
1834
  );
1792
- M(() => (document.addEventListener("keydown", m), () => {
1793
- document.removeEventListener("keydown", m);
1794
- }), [m]);
1795
- const f = S(
1796
- (g, T) => T ? g === `${l.pathname}${l.search}` : g === l.pathname,
1835
+ P(() => (document.addEventListener("keydown", h), () => {
1836
+ document.removeEventListener("keydown", h);
1837
+ }), [h]);
1838
+ const f = v(
1839
+ (g, C) => C ? g === `${l.pathname}${l.search}` : g === l.pathname,
1797
1840
  [l.pathname, l.search]
1798
- ), p = S(
1799
- (g) => /* @__PURE__ */ h(
1841
+ ), p = v(
1842
+ (g) => /* @__PURE__ */ m(
1800
1843
  "li",
1801
1844
  {
1802
1845
  className: `drawer-list-item-child ${f(g.path, !0) ? "active" : ""} animated`,
1803
- children: g.path ? /* @__PURE__ */ h(
1846
+ children: g.path ? /* @__PURE__ */ m(
1804
1847
  u,
1805
1848
  {
1806
1849
  tabIndex: s ? 0 : -1,
@@ -1816,13 +1859,13 @@ function Gs(r) {
1816
1859
  g.id
1817
1860
  ),
1818
1861
  [u, s, e, f]
1819
- ), b = V(() => d.map((g, T) => {
1820
- const w = g.page ?? String(T), v = `drawer-list-item ${f(g.path) ? "active" : ""} animated`;
1862
+ ), b = q(() => d.map((g, C) => {
1863
+ const w = g.page ?? String(C), T = `drawer-list-item ${f(g.path) ? "active" : ""} animated`;
1821
1864
  if (g.type === "divider")
1822
- return /* @__PURE__ */ h("li", { className: v, children: /* @__PURE__ */ h("hr", { className: "drawer-divider" }) }, w);
1823
- const N = g.children ?? (g.page && c ? c[g.page] : null);
1824
- return /* @__PURE__ */ E("li", { className: v, children: [
1825
- /* @__PURE__ */ E(
1865
+ return /* @__PURE__ */ m("li", { className: T, children: /* @__PURE__ */ m("hr", { className: "drawer-divider" }) }, w);
1866
+ const k = g.children ?? (g.page && c ? c[g.page] : null);
1867
+ return /* @__PURE__ */ N("li", { className: T, children: [
1868
+ /* @__PURE__ */ N(
1826
1869
  u,
1827
1870
  {
1828
1871
  tabIndex: s ? 0 : -1,
@@ -1837,32 +1880,32 @@ function Gs(r) {
1837
1880
  ]
1838
1881
  }
1839
1882
  ),
1840
- N && /* @__PURE__ */ h("ul", { className: "drawer-children-list", children: N.map(p) })
1883
+ k && /* @__PURE__ */ m("ul", { className: "drawer-children-list", children: k.map(p) })
1841
1884
  ] }, w);
1842
1885
  }), [u, c, f, s, d, p, e]);
1843
- return /* @__PURE__ */ h(
1886
+ return /* @__PURE__ */ m(
1844
1887
  "div",
1845
1888
  {
1846
1889
  "aria-label": e("_accessibility:ariaLabels.closeMenu"),
1847
1890
  "aria-disabled": !s,
1848
1891
  className: `${s ? "opened" : "closed"} drawer-backdrop`,
1849
1892
  onClick: () => t(),
1850
- children: /* @__PURE__ */ E("aside", { className: `${s ? "opened" : "closed"} drawer animated`, children: [
1851
- /* @__PURE__ */ E("div", { className: "drawer-header-container", children: [
1893
+ children: /* @__PURE__ */ N("aside", { className: `${s ? "opened" : "closed"} drawer animated`, children: [
1894
+ /* @__PURE__ */ N("div", { className: "drawer-header-container", children: [
1852
1895
  o,
1853
- /* @__PURE__ */ h("h2", { className: "drawer-header poppins", children: e("_pages:home.appName") })
1896
+ /* @__PURE__ */ m("h2", { className: "drawer-header poppins", children: e("_pages:home.appName") })
1854
1897
  ] }),
1855
- /* @__PURE__ */ h("ul", { className: "drawer-menu-list", children: b })
1898
+ /* @__PURE__ */ m("ul", { className: "drawer-menu-list", children: b })
1856
1899
  ] })
1857
1900
  }
1858
1901
  );
1859
1902
  }
1860
- const z = ({ icon: r, ...e }) => /* @__PURE__ */ h(ot, { icon: /* @__PURE__ */ h(q, { icon: r }), ...e });
1861
- var pe, Ne;
1862
- function Jt() {
1863
- if (Ne) return pe;
1864
- Ne = 1;
1865
- const r = (c, a = "local", l = void 0) => {
1903
+ const W = ({ icon: n, ...e }) => /* @__PURE__ */ m(ct, { icon: /* @__PURE__ */ m(U, { icon: n }), ...e });
1904
+ var pe, Ee;
1905
+ function ss() {
1906
+ if (Ee) return pe;
1907
+ Ee = 1;
1908
+ const n = (c, a = "local", l = void 0) => {
1866
1909
  if (a === "local") {
1867
1910
  if (localStorage.getItem(c) !== void 0 && localStorage.getItem(c) !== "undefined" && localStorage.getItem(c) !== null)
1868
1911
  return l === void 0 || l !== void 0 && localStorage.getItem(c) === l;
@@ -1872,68 +1915,68 @@ function Jt() {
1872
1915
  }, e = (c) => {
1873
1916
  const a = {};
1874
1917
  return c.substring(1).split("&").forEach((u) => {
1875
- const [d, m] = u.split("=");
1876
- a[d] = m;
1918
+ const [d, h] = u.split("=");
1919
+ a[d] = h;
1877
1920
  }), a;
1878
1921
  }, s = (c = "") => {
1879
1922
  if (o(c) && c.length) return o(c);
1880
1923
  {
1881
1924
  let a = navigator.language || navigator.userLanguage;
1882
1925
  if (a.indexOf("en") < 0 && a.indexOf("es") < 0 && (a = "en-US"), a = a.split("-")[0], a)
1883
- return c.length && n(c, 730, a), a;
1926
+ return c.length && r(c, 730, a), a;
1884
1927
  }
1885
1928
  return "en";
1886
1929
  }, t = (c = 0, a = 0, l = window, u = "smooth") => l.scroll({
1887
1930
  top: c,
1888
1931
  left: a,
1889
1932
  behavior: u
1890
- }), n = (c, a, l, u = "/", d = "Lax") => {
1891
- var m = /* @__PURE__ */ new Date();
1892
- m.setTime(m.getTime() + a * 24 * 60 * 60 * 1e3);
1893
- const f = "; expires=" + m.toUTCString();
1933
+ }), r = (c, a, l, u = "/", d = "Lax") => {
1934
+ var h = /* @__PURE__ */ new Date();
1935
+ h.setTime(h.getTime() + a * 24 * 60 * 60 * 1e3);
1936
+ const f = "; expires=" + h.toUTCString();
1894
1937
  document.cookie = `${c}=${l || ""}${f};path=${u};SameSite=${d}`;
1895
1938
  }, o = (c) => {
1896
1939
  const a = `${c}=`, u = decodeURIComponent(document.cookie).split(";");
1897
1940
  for (let d = 0; d < u.length; d += 1) {
1898
- let m = u[d];
1899
- for (; m.charAt(0) === " "; )
1900
- m = m.substring(1);
1901
- if (m.indexOf(a) === 0)
1902
- return m.substring(a.length, m.length);
1941
+ let h = u[d];
1942
+ for (; h.charAt(0) === " "; )
1943
+ h = h.substring(1);
1944
+ if (h.indexOf(a) === 0)
1945
+ return h.substring(a.length, h.length);
1903
1946
  }
1904
1947
  return "";
1905
1948
  };
1906
1949
  return pe = {
1907
1950
  getCookie: o,
1908
- createCookie: n,
1951
+ createCookie: r,
1909
1952
  deleteCookie: (c) => document.cookie = `${c}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`,
1910
1953
  getUserLanguage: s,
1911
1954
  scrollTo: t,
1912
1955
  parseQueries: e,
1913
- validation: r
1956
+ validation: n
1914
1957
  }, pe;
1915
1958
  }
1916
- var Yt = Jt();
1917
- function Ws() {
1918
- const { t: r, language: e } = k();
1919
- return { timeAge: S(
1959
+ var ns = ss();
1960
+ function rn() {
1961
+ const { t: n, language: e } = E();
1962
+ return { timeAge: v(
1920
1963
  (t) => {
1921
- const o = /* @__PURE__ */ new Date() - t, i = Math.floor(o / (1e3 * 60)), c = Math.floor(i / 60), a = e === "es", l = r("_accessibility:labels.ago"), u = r("_accessibility:labels.minute"), d = r("_accessibility:labels.minutes"), m = r("_accessibility:labels.hour"), f = r("_accessibility:labels.hours"), p = r("_accessibility:labels.yesterday"), b = r("_accessibility:labels.justNow");
1922
- return o < 1e3 * 60 ? b : i < 60 ? `${a ? l : ""} ${i} ${i === 1 ? u : d} ${a ? "" : l}` : c < 24 ? `${a ? l : ""} ${c} ${c === 1 ? m : f} ${a ? "" : l}` : c < 48 ? p : t.toLocaleDateString(navigator.language || "es-ES", {
1964
+ const o = /* @__PURE__ */ new Date() - t, i = Math.floor(o / (1e3 * 60)), c = Math.floor(i / 60), a = e === "es", l = n("_accessibility:labels.ago"), u = n("_accessibility:labels.minute"), d = n("_accessibility:labels.minutes"), h = n("_accessibility:labels.hour"), f = n("_accessibility:labels.hours"), p = n("_accessibility:labels.yesterday"), b = n("_accessibility:labels.justNow");
1965
+ return o < 1e3 * 60 ? b : i < 60 ? `${a ? l : ""} ${i} ${i === 1 ? u : d} ${a ? "" : l}` : c < 24 ? `${a ? l : ""} ${c} ${c === 1 ? h : f} ${a ? "" : l}` : c < 48 ? p : t.toLocaleDateString(navigator.language || "es-ES", {
1923
1966
  day: "2-digit",
1924
1967
  month: "2-digit",
1925
1968
  year: "numeric"
1926
1969
  });
1927
1970
  },
1928
- [r, e]
1971
+ [n, e]
1929
1972
  ) };
1930
1973
  }
1931
- const He = (r) => {
1932
- const { showSuccessNotification: e } = oe(), { mutationFn: s, onError: t, onSuccess: n, onSuccessMessage: o } = r, [i, c] = R([]), { open: a, handleClose: l, handleOpen: u } = Be(), d = () => {
1974
+ const ze = (n) => {
1975
+ const { showSuccessNotification: e } = oe(), { mutationFn: s, onError: t, onSuccess: r, onSuccessMessage: o } = n, [i, c] = D([]), { open: a, handleClose: l, handleOpen: u } = We(), d = () => {
1933
1976
  l(), c([]);
1934
- }, m = async (p) => {
1977
+ }, h = async (p) => {
1935
1978
  c(p), u();
1936
- }, f = ne({
1979
+ }, f = re({
1937
1980
  mutationFn: () => s(
1938
1981
  Array.isArray(i) ? i : [i]
1939
1982
  ),
@@ -1941,17 +1984,17 @@ const He = (r) => {
1941
1984
  console.error(p), t && t(p), d();
1942
1985
  },
1943
1986
  onSuccess: async (p) => {
1944
- n && n(p), e({
1987
+ r && r(p), e({
1945
1988
  message: o
1946
1989
  }), d();
1947
1990
  }
1948
1991
  });
1949
- return { open: a, onClick: m, close: d, dialogFn: f, isLoading: f.isPending };
1950
- }, zs = (r) => {
1951
- const { t: e } = k(), {
1992
+ return { open: a, onClick: h, close: d, dialogFn: f, isLoading: f.isPending };
1993
+ }, on = (n) => {
1994
+ const { t: e } = E(), {
1952
1995
  showStackNotifications: s,
1953
1996
  showSuccessNotification: t,
1954
- showErrorNotification: n
1997
+ showErrorNotification: r
1955
1998
  } = oe(), o = Z(), {
1956
1999
  defaultValues: i,
1957
2000
  mutationFn: c,
@@ -1959,59 +2002,59 @@ const He = (r) => {
1959
2002
  onError: l,
1960
2003
  onSuccess: u,
1961
2004
  queryKey: d,
1962
- onSuccessMessage: m
1963
- } = r, { control: f, handleSubmit: p, reset: b, setError: y, getValues: g, setValue: T } = Pe({
2005
+ onSuccessMessage: h
2006
+ } = n, { control: f, handleSubmit: p, reset: b, setError: y, getValues: g, setValue: C } = Oe({
1964
2007
  defaultValues: i
1965
- }), w = F(null), v = S(() => {
1966
- const C = document.activeElement;
1967
- if (!(C instanceof HTMLElement)) {
2008
+ }), w = K(null), T = v(() => {
2009
+ const S = document.activeElement;
2010
+ if (!(S instanceof HTMLElement)) {
1968
2011
  w.current = null;
1969
2012
  return;
1970
2013
  }
1971
- w.current = C.closest("form");
1972
- }, []), N = S(
1973
- (C) => {
1974
- const D = C == null ? void 0 : C.errors, L = [], _ = w.current;
1975
- if (!_) return L;
1976
- let K = !1;
1977
- return D && D.forEach(([le, ee]) => {
1978
- const j = _.querySelector(`[name="${le}"]`);
1979
- (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}`)));
1980
- }), L;
2014
+ w.current = S.closest("form");
2015
+ }, []), k = v(
2016
+ (S) => {
2017
+ const L = S == null ? void 0 : S.errors, R = [], _ = w.current;
2018
+ if (!_) return R;
2019
+ let Q = !1;
2020
+ return L && L.forEach(([le, ee]) => {
2021
+ const B = _.querySelector(`[name="${le}"]`);
2022
+ (B instanceof HTMLInputElement || B instanceof HTMLTextAreaElement || B instanceof HTMLSelectElement) && (Q || (B.focus(), Q = !0), B.classList.add("error"), R.push(e(`_entities:${d}.${le}.${ee}`)));
2023
+ }), R;
1981
2024
  },
1982
2025
  [e, d]
1983
- ), U = S(() => {
1984
- const C = w.current;
1985
- if (!C) return;
1986
- C.querySelectorAll("input, textarea, select").forEach((L) => {
1987
- L.classList.remove("error");
2026
+ ), O = v(() => {
2027
+ const S = w.current;
2028
+ if (!S) return;
2029
+ S.querySelectorAll("input, textarea, select").forEach((R) => {
2030
+ R.classList.remove("error");
1988
2031
  });
1989
- }, []), B = ne(
2032
+ }, []), j = re(
1990
2033
  {
1991
2034
  mutationFn: c,
1992
- onError: (C) => {
1993
- console.error(C);
1994
- const D = C;
1995
- if (l) l(C);
1996
- else if (Se(D)) {
1997
- const L = N(D);
2035
+ onError: (S) => {
2036
+ console.error(S);
2037
+ const L = S;
2038
+ if (l) l(S);
2039
+ else if (Se(L)) {
2040
+ const R = k(L);
1998
2041
  s(
1999
- L.map(
2042
+ R.map(
2000
2043
  (_) => ({
2001
2044
  message: _,
2002
- type: O.error
2045
+ type: F.error
2003
2046
  })
2004
2047
  )
2005
2048
  );
2006
- } else if (Te(D)) {
2007
- const L = D.message || e("_accessibility:errors.500"), _ = e(`_accessibility:errors.${D.status}`);
2008
- n({ message: _ || L });
2049
+ } else if (ve(L)) {
2050
+ const R = L.message || e("_accessibility:errors.500"), _ = e(`_accessibility:errors.${L.status}`);
2051
+ r({ message: _ || R });
2009
2052
  } else
2010
- n({ message: e("_accessibility:errors.500") });
2053
+ r({ message: e("_accessibility:errors.500") });
2011
2054
  },
2012
- onSuccess: async (C) => {
2013
- await o.invalidateQueries({ queryKey: d }), u && u(C), m && t({
2014
- message: m
2055
+ onSuccess: async (S) => {
2056
+ await o.invalidateQueries({ queryKey: d }), u && u(S), h && t({
2057
+ message: h
2015
2058
  });
2016
2059
  }
2017
2060
  }
@@ -2019,151 +2062,151 @@ const He = (r) => {
2019
2062
  return {
2020
2063
  control: f,
2021
2064
  getValues: g,
2022
- setValue: T,
2065
+ setValue: C,
2023
2066
  handleSubmit: p,
2024
- onSubmit: (C) => {
2025
- v(), U(), B.mutate(
2026
- a ? a(C) : C
2067
+ onSubmit: (S) => {
2068
+ T(), O(), j.mutate(
2069
+ a ? a(S) : S
2027
2070
  );
2028
2071
  },
2029
2072
  reset: b,
2030
2073
  setError: y,
2031
- isLoading: B.isPending
2074
+ isLoading: j.isPending
2032
2075
  };
2033
- }, Xt = (r) => {
2034
- const { t: e } = k(), {
2076
+ }, rs = (n) => {
2077
+ const { t: e } = E(), {
2035
2078
  onClick: s,
2036
- icon: t = ft,
2037
- sticky: n = !0,
2079
+ icon: t = bt,
2080
+ sticky: r = !0,
2038
2081
  hidden: o = !1,
2039
2082
  multiple: i = !0,
2040
2083
  disabled: c = !1,
2041
- id: a = J.Delete,
2084
+ id: a = Y.Delete,
2042
2085
  tooltip: l = e("_pages:common.actions.delete.text")
2043
- } = r;
2086
+ } = n;
2044
2087
  return {
2045
- action: S(
2088
+ action: v(
2046
2089
  (d) => ({
2047
2090
  id: a,
2048
- sticky: n,
2091
+ sticky: r,
2049
2092
  tooltip: l,
2050
2093
  multiple: i,
2051
2094
  onClick: () => s([d == null ? void 0 : d.id]),
2052
2095
  hidden: !!d.deletedAt || o,
2053
2096
  disabled: !!d.deletedAt || c,
2054
- icon: /* @__PURE__ */ h(q, { className: "text-bg-error", icon: t }),
2055
- onMultipleClick: (m) => s(m.map((f) => f.id))
2097
+ icon: /* @__PURE__ */ m(U, { className: "text-bg-error", icon: t }),
2098
+ onMultipleClick: (h) => s(h.map((f) => f.id))
2056
2099
  }),
2057
- [c, o, t, a, i, s, n, l]
2100
+ [c, o, t, a, i, s, r, l]
2058
2101
  )
2059
2102
  };
2060
- }, Zt = (r) => {
2061
- const { t: e } = k(), {
2103
+ }, os = (n) => {
2104
+ const { t: e } = E(), {
2062
2105
  onClick: s,
2063
2106
  sticky: t = !0,
2064
- hidden: n = !1,
2107
+ hidden: r = !1,
2065
2108
  disabled: o = !1,
2066
2109
  multiple: i = !1,
2067
- icon: c = Le,
2068
- id: a = J.Restore,
2110
+ icon: c = Re,
2111
+ id: a = Y.Restore,
2069
2112
  tooltip: l = e("_pages:common.actions.restore.text")
2070
- } = r;
2113
+ } = n;
2071
2114
  return {
2072
- action: S(
2115
+ action: v(
2073
2116
  (d) => ({
2074
2117
  id: a,
2075
2118
  sticky: t,
2076
2119
  tooltip: l,
2077
2120
  multiple: i,
2078
2121
  onClick: () => s([d == null ? void 0 : d.id]),
2079
- hidden: !d.deletedAt || n,
2122
+ hidden: !d.deletedAt || r,
2080
2123
  disabled: !d.deletedAt || o,
2081
- icon: /* @__PURE__ */ h(q, { className: "text-bg-error", icon: c }),
2082
- onMultipleClick: (m) => s(m.map((f) => f.id))
2124
+ icon: /* @__PURE__ */ m(U, { className: "text-bg-error", icon: c }),
2125
+ onMultipleClick: (h) => s(h.map((f) => f.id))
2083
2126
  }),
2084
- [o, n, c, a, i, s, t, l]
2127
+ [o, r, c, a, i, s, t, l]
2085
2128
  )
2086
2129
  };
2087
- }, Js = (r) => {
2088
- const { t: e } = k(), {
2130
+ }, an = (n) => {
2131
+ const { t: e } = E(), {
2089
2132
  onClick: s,
2090
2133
  hidden: t = !1,
2091
- sticky: n = !0,
2134
+ sticky: r = !0,
2092
2135
  disabled: o = !1,
2093
- id: i = J.Edit,
2094
- icon: c = pt,
2136
+ id: i = Y.Edit,
2137
+ icon: c = yt,
2095
2138
  tooltip: a = e("_pages:common.actions.edit.text")
2096
- } = r;
2139
+ } = n;
2097
2140
  return {
2098
- action: S(
2141
+ action: v(
2099
2142
  (u) => ({
2100
2143
  id: i,
2101
- sticky: n,
2144
+ sticky: r,
2102
2145
  tooltip: a,
2103
2146
  onClick: () => s(u == null ? void 0 : u.id),
2104
2147
  hidden: !!u.deletedAt || t,
2105
2148
  disabled: !!u.deletedAt || o,
2106
- icon: /* @__PURE__ */ h(q, { className: "primary", icon: c })
2149
+ icon: /* @__PURE__ */ m(U, { className: "primary", icon: c })
2107
2150
  }),
2108
- [o, t, c, i, s, n, a]
2151
+ [o, t, c, i, s, r, a]
2109
2152
  )
2110
2153
  };
2111
2154
  };
2112
- var J = /* @__PURE__ */ ((r) => (r.Add = "add", r.Edit = "edit", r.Delete = "delete", r.Restore = "restore", r.Refresh = "refresh", r.Export = "export", r.Import = "import", r))(J || {});
2113
- const es = (r) => {
2114
- const { t: e } = k(), {
2155
+ var Y = /* @__PURE__ */ ((n) => (n.Add = "add", n.Edit = "edit", n.Delete = "delete", n.Restore = "restore", n.Refresh = "refresh", n.Export = "export", n.Import = "import", n))(Y || {});
2156
+ const is = (n) => {
2157
+ const { t: e } = E(), {
2115
2158
  onClick: s,
2116
2159
  hidden: t = !1,
2117
- disabled: n = !1,
2160
+ disabled: r = !1,
2118
2161
  isLoading: o = !1
2119
- } = r;
2162
+ } = n;
2120
2163
  return {
2121
- action: S(
2164
+ action: v(
2122
2165
  () => ({
2123
- id: J.Export,
2166
+ id: Y.Export,
2124
2167
  hidden: t,
2125
- disabled: n,
2126
- icon: /* @__PURE__ */ h(
2127
- q,
2168
+ disabled: r,
2169
+ icon: /* @__PURE__ */ m(
2170
+ U,
2128
2171
  {
2129
2172
  className: `${o ? "rotate" : ""}`,
2130
- icon: o ? Re : gt
2173
+ icon: o ? Ie : wt
2131
2174
  }
2132
2175
  ),
2133
2176
  tooltip: e("_pages:common.actions.export.text"),
2134
2177
  onClick: s
2135
2178
  }),
2136
- [n, t, o, s, e]
2179
+ [r, t, o, s, e]
2137
2180
  )
2138
2181
  };
2139
- }, ts = (r) => {
2140
- const { t: e } = k(), {
2182
+ }, as = (n) => {
2183
+ const { t: e } = E(), {
2141
2184
  onClick: s,
2142
2185
  hidden: t = !1,
2143
- disabled: n = !1,
2186
+ disabled: r = !1,
2144
2187
  isLoading: o = !1
2145
- } = r;
2188
+ } = n;
2146
2189
  return {
2147
- action: S(
2190
+ action: v(
2148
2191
  () => ({
2149
- id: J.Import,
2192
+ id: Y.Import,
2150
2193
  hidden: t,
2151
- disabled: n,
2152
- icon: /* @__PURE__ */ h(
2153
- q,
2194
+ disabled: r,
2195
+ icon: /* @__PURE__ */ m(
2196
+ U,
2154
2197
  {
2155
2198
  className: `${o ? "rotate" : ""}`,
2156
- icon: o ? Re : bt
2199
+ icon: o ? Ie : St
2157
2200
  }
2158
2201
  ),
2159
2202
  tooltip: e("_pages:common.actions.import.text"),
2160
2203
  onClick: s
2161
2204
  }),
2162
- [n, t, o, s, e]
2205
+ [r, t, o, s, e]
2163
2206
  )
2164
2207
  };
2165
- }, Ys = (r) => {
2166
- 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({
2208
+ }, cn = (n) => {
2209
+ const { queryKey: e, onSuccess: s, ...t } = n, r = Z(), { showStackNotifications: o } = oe(), { t: i } = E(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = ze({
2167
2210
  onSuccessMessage: i("_pages:common.actions.delete.successMessage"),
2168
2211
  onError: (f) => {
2169
2212
  const p = f;
@@ -2172,25 +2215,25 @@ const es = (r) => {
2172
2215
  p.errors.map(
2173
2216
  ([b, y]) => ({
2174
2217
  message: i(`_pages:${b}.errors.${y}`),
2175
- type: O.error
2218
+ type: F.error
2176
2219
  })
2177
2220
  )
2178
2221
  );
2179
- else if (Te(p)) {
2222
+ else if (ve(p)) {
2180
2223
  const b = p.message || i("_accessibility:errors.500"), y = i(`_accessibility:errors.${p.status}`);
2181
2224
  o([
2182
2225
  {
2183
2226
  message: y || b,
2184
- type: O.error
2227
+ type: F.error
2185
2228
  }
2186
2229
  ]);
2187
2230
  }
2188
2231
  },
2189
2232
  onSuccess: async (f) => {
2190
- await n.invalidateQueries({ queryKey: e }), s && s(f);
2233
+ await r.invalidateQueries({ queryKey: e }), s && s(f);
2191
2234
  },
2192
2235
  ...t
2193
- }), { action: m } = Xt({ onClick: a });
2236
+ }), { action: h } = rs({ onClick: a });
2194
2237
  return {
2195
2238
  onClick: a,
2196
2239
  title: i("_pages:common.actions.delete.dialog.title"),
@@ -2198,17 +2241,17 @@ const es = (r) => {
2198
2241
  isLoading: d,
2199
2242
  handleSubmit: () => u.mutate(),
2200
2243
  handleClose: l,
2201
- action: m
2244
+ action: h
2202
2245
  };
2203
- }, Be = () => {
2204
- const [r, e] = R(!1);
2205
- return { open: r, setOpen: e, handleClose: () => e(!1), handleOpen: () => e(!0) };
2206
- }, Ve = (r) => {
2246
+ }, We = () => {
2247
+ const [n, e] = D(!1);
2248
+ return { open: n, setOpen: e, handleClose: () => e(!1), handleOpen: () => e(!0) };
2249
+ }, Ge = (n) => {
2207
2250
  const {
2208
2251
  closeOnSubmit: e = !0,
2209
2252
  defaultValues: s,
2210
2253
  dtoToForm: t,
2211
- formToDto: n,
2254
+ formToDto: r,
2212
2255
  mode: o = "state",
2213
2256
  onApply: i,
2214
2257
  onClear: c,
@@ -2216,149 +2259,149 @@ const es = (r) => {
2216
2259
  onSubmit: l,
2217
2260
  reinitializeOnOpen: u,
2218
2261
  resetOnOpen: d,
2219
- title: m
2220
- } = r, [f, p] = R(), [b, y] = R(!1), g = F(!1), T = F(null), { open: w, handleClose: v, handleOpen: N } = Be(), { control: U, handleSubmit: B, reset: C, setError: D, getValues: L, setValue: _ } = Pe({
2262
+ title: h
2263
+ } = n, [f, p] = D(), [b, y] = D(!1), g = K(!1), C = K(null), { open: w, handleClose: T, handleOpen: k } = We(), { control: O, handleSubmit: j, reset: S, setError: L, getValues: R, setValue: _ } = Oe({
2221
2264
  defaultValues: s || {}
2222
2265
  });
2223
- M(() => {
2266
+ P(() => {
2224
2267
  if (!w) {
2225
- g.current = !1, T.current = null;
2268
+ g.current = !1, C.current = null;
2226
2269
  return;
2227
2270
  }
2228
2271
  if (g.current) return;
2229
- if (g.current = !0, T.current) {
2230
- C(T.current), T.current = null;
2272
+ if (g.current = !0, C.current) {
2273
+ S(C.current), C.current = null;
2231
2274
  return;
2232
2275
  }
2233
2276
  const $ = t;
2234
2277
  if (u && $) {
2235
- C($(s || {}));
2278
+ S($(s || {}));
2236
2279
  return;
2237
2280
  }
2238
2281
  if (u && s) {
2239
- C(s);
2282
+ S(s);
2240
2283
  return;
2241
2284
  }
2242
- d && C(s || {});
2243
- }, [s, t, w, u, C, d]);
2244
- const K = S(() => {
2245
- v(), C();
2246
- }, [v, C]), le = S(
2285
+ d && S(s || {});
2286
+ }, [s, t, w, u, S, d]);
2287
+ const Q = v(() => {
2288
+ T(), S();
2289
+ }, [T, S]), le = v(
2247
2290
  ($) => {
2248
2291
  let x, te;
2249
- typeof $ == "number" || $ == null ? x = $ : (x = $.id, te = $.values), p(x), te ? w ? C(te) : T.current = te : T.current = null, w || N();
2292
+ typeof $ == "number" || $ == null ? x = $ : (x = $.id, te = $.values), p(x), te ? w ? S(te) : C.current = te : C.current = null, w || k();
2250
2293
  },
2251
- [N, w, C]
2252
- ), ee = S(
2294
+ [k, w, S]
2295
+ ), ee = v(
2253
2296
  ($) => {
2254
- const x = n;
2297
+ const x = r;
2255
2298
  return x ? x($, { id: f }) : $;
2256
2299
  },
2257
- [n, f]
2258
- ), j = S(
2300
+ [r, f]
2301
+ ), B = v(
2259
2302
  async ($, x, te) => {
2260
2303
  a && await a($, {
2261
- close: K,
2304
+ close: Q,
2262
2305
  id: f,
2263
2306
  phase: x,
2264
2307
  values: te
2265
2308
  });
2266
2309
  },
2267
- [K, f, a]
2268
- ), We = S(async () => {
2310
+ [Q, f, a]
2311
+ ), Ye = v(async () => {
2269
2312
  if (!i) return;
2270
- const $ = L();
2313
+ const $ = R();
2271
2314
  y(!0);
2272
2315
  try {
2273
2316
  const x = ee($);
2274
2317
  await i(x, {
2275
- close: K,
2318
+ close: Q,
2276
2319
  id: f,
2277
2320
  values: $
2278
2321
  });
2279
2322
  } catch (x) {
2280
- throw await j(x, "apply", $).catch(() => {
2323
+ throw await B(x, "apply", $).catch(() => {
2281
2324
  }), x;
2282
2325
  } finally {
2283
2326
  y(!1);
2284
2327
  }
2285
- }, [K, L, j, f, ee, i]), ze = S(async () => {
2286
- const $ = L();
2328
+ }, [Q, R, B, f, ee, i]), Xe = v(async () => {
2329
+ const $ = R();
2287
2330
  if (c) {
2288
2331
  y(!0);
2289
2332
  try {
2290
2333
  await c();
2291
2334
  } catch (x) {
2292
- throw await j(x, "clear", $).catch(() => {
2335
+ throw await B(x, "clear", $).catch(() => {
2293
2336
  }), x;
2294
2337
  } finally {
2295
2338
  y(!1);
2296
2339
  }
2297
2340
  }
2298
2341
  try {
2299
- C(s || {});
2342
+ S(s || {});
2300
2343
  } catch (x) {
2301
- throw await j(x, "clear", $).catch(() => {
2344
+ throw await B(x, "clear", $).catch(() => {
2302
2345
  }), x;
2303
2346
  }
2304
- }, [s, L, j, c, C]), Je = S(
2347
+ }, [s, R, B, c, S]), Ze = v(
2305
2348
  async ($) => {
2306
2349
  y(!0);
2307
2350
  try {
2308
2351
  const x = ee($);
2309
2352
  l && await l(x, {
2310
- close: K,
2353
+ close: Q,
2311
2354
  id: f,
2312
2355
  values: $
2313
- }), e && K();
2356
+ }), e && Q();
2314
2357
  } catch (x) {
2315
- throw await j(x, "submit", $).catch(() => {
2358
+ throw await B(x, "submit", $).catch(() => {
2316
2359
  }), x;
2317
2360
  } finally {
2318
2361
  y(!1);
2319
2362
  }
2320
2363
  },
2321
- [K, e, j, f, ee, l]
2364
+ [Q, e, B, f, ee, l]
2322
2365
  );
2323
2366
  return {
2324
2367
  open: w,
2325
2368
  mode: o,
2326
2369
  id: f,
2327
2370
  openDialog: le,
2328
- handleClose: K,
2329
- control: U,
2330
- getValues: L,
2371
+ handleClose: Q,
2372
+ control: O,
2373
+ getValues: R,
2331
2374
  setValue: _,
2332
- handleSubmit: B,
2333
- onSubmit: Je,
2334
- reset: C,
2335
- setError: D,
2336
- title: m,
2375
+ handleSubmit: j,
2376
+ onSubmit: Ze,
2377
+ reset: S,
2378
+ setError: L,
2379
+ title: h,
2337
2380
  isSubmitting: b,
2338
- onApply: We,
2339
- onClear: ze,
2381
+ onApply: Ye,
2382
+ onClear: Xe,
2340
2383
  isLoading: b
2341
2384
  };
2342
- }, Xs = (r) => {
2343
- const e = Z(), { mutationFn: s, queryKey: t, onSuccess: n, onError: o, formToDto: i, ...c } = r, a = ne({
2385
+ }, ln = (n) => {
2386
+ const e = Z(), { mutationFn: s, queryKey: t, onSuccess: r, onError: o, formToDto: i, ...c } = n, a = re({
2344
2387
  mutationFn: s
2345
2388
  });
2346
- return Ve({
2389
+ return Ge({
2347
2390
  ...c,
2348
2391
  mode: "entity",
2349
2392
  formToDto: i,
2350
2393
  onSubmit: async (l) => {
2351
2394
  try {
2352
2395
  const u = await a.mutateAsync(l);
2353
- t && await e.invalidateQueries({ queryKey: t }), n && await n(u);
2396
+ t && await e.invalidateQueries({ queryKey: t }), r && await r(u);
2354
2397
  } catch (u) {
2355
2398
  throw o && o(u), u;
2356
2399
  }
2357
2400
  }
2358
2401
  });
2359
- }, Zs = (r) => {
2360
- const e = Z(), s = F(), t = F(), {
2361
- mutationFn: n,
2402
+ }, un = (n) => {
2403
+ const e = Z(), s = K(), t = K(), {
2404
+ mutationFn: r,
2362
2405
  queryKey: o,
2363
2406
  onSuccess: i,
2364
2407
  onError: c,
@@ -2366,48 +2409,48 @@ const es = (r) => {
2366
2409
  getFunction: l,
2367
2410
  dtoToForm: u,
2368
2411
  title: d,
2369
- ...m
2370
- } = r, f = F(u);
2371
- M(() => {
2412
+ ...h
2413
+ } = n, f = K(u);
2414
+ P(() => {
2372
2415
  f.current = u;
2373
2416
  }, [u]);
2374
- const p = ne({
2375
- mutationFn: n
2376
- }), b = Ve({
2377
- ...m,
2417
+ const p = re({
2418
+ mutationFn: r
2419
+ }), b = Ge({
2420
+ ...h,
2378
2421
  mode: "entity",
2379
2422
  title: d,
2380
2423
  onSubmit: async (w) => {
2381
2424
  try {
2382
- const v = await p.mutateAsync(w);
2383
- o && await e.invalidateQueries({ queryKey: o }), i && await i(v);
2384
- } catch (v) {
2385
- throw c && c(v), v;
2425
+ const T = await p.mutateAsync(w);
2426
+ o && await e.invalidateQueries({ queryKey: o }), i && await i(T);
2427
+ } catch (T) {
2428
+ throw c && c(T), T;
2386
2429
  }
2387
2430
  },
2388
2431
  formToDto: (w) => {
2389
- const v = a;
2390
- return v ? v(w, s.current) : w;
2432
+ const T = a;
2433
+ return T ? T(w, s.current) : w;
2391
2434
  }
2392
- }), { reset: y } = b, T = At({
2435
+ }), { reset: y } = b, C = Lt({
2393
2436
  queryFn: () => l(b.id),
2394
2437
  queryKey: [...o || ["put-dialog", d], b.id],
2395
2438
  enabled: b.open && !!b.id
2396
2439
  });
2397
- return M(() => {
2398
- if (T.data && t.current !== T.data) {
2399
- if (s.current = T.data, t.current = T.data, f.current && y) {
2400
- y(f.current(T.data));
2440
+ return P(() => {
2441
+ if (C.data && t.current !== C.data) {
2442
+ if (s.current = C.data, t.current = C.data, f.current && y) {
2443
+ y(f.current(C.data));
2401
2444
  return;
2402
2445
  }
2403
- y == null || y(T.data);
2446
+ y == null || y(C.data);
2404
2447
  }
2405
- }, [T.data, y]), {
2448
+ }, [C.data, y]), {
2406
2449
  ...b,
2407
- isLoading: b.isLoading || p.isPending || T.isFetching || T.isLoading
2450
+ isLoading: b.isLoading || p.isPending || C.isFetching || C.isLoading
2408
2451
  };
2409
- }, er = (r) => {
2410
- 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({
2452
+ }, dn = (n) => {
2453
+ const { queryKey: e, onSuccess: s, ...t } = n, r = Z(), { showStackNotifications: o } = oe(), { t: i } = E(), { open: c, onClick: a, close: l, dialogFn: u, isLoading: d } = ze({
2411
2454
  onSuccessMessage: i("_pages:common.actions.restore.successMessage"),
2412
2455
  onError: (f) => {
2413
2456
  const p = f;
@@ -2416,25 +2459,25 @@ const es = (r) => {
2416
2459
  p.errors.map(
2417
2460
  ([b, y]) => ({
2418
2461
  message: i(`_pages:${b}.errors.${y}`),
2419
- type: O.error
2462
+ type: F.error
2420
2463
  })
2421
2464
  )
2422
2465
  );
2423
- else if (Te(p)) {
2466
+ else if (ve(p)) {
2424
2467
  const b = p.message || i("_accessibility:errors.500"), y = i(`_accessibility:errors.${p.status}`);
2425
2468
  o([
2426
2469
  {
2427
2470
  message: y || b,
2428
- type: O.error
2471
+ type: F.error
2429
2472
  }
2430
2473
  ]);
2431
2474
  }
2432
2475
  },
2433
2476
  onSuccess: async (f) => {
2434
- await n.invalidateQueries({ queryKey: e }), s && s(f);
2477
+ await r.invalidateQueries({ queryKey: e }), s && s(f);
2435
2478
  },
2436
2479
  ...t
2437
- }), { action: m } = Zt({ onClick: a });
2480
+ }), { action: h } = os({ onClick: a });
2438
2481
  return {
2439
2482
  onClick: a,
2440
2483
  title: i("_pages:common.actions.restore.dialog.title"),
@@ -2442,26 +2485,26 @@ const es = (r) => {
2442
2485
  isLoading: d,
2443
2486
  handleSubmit: () => u.mutate(),
2444
2487
  handleClose: l,
2445
- action: m
2488
+ action: h
2446
2489
  };
2447
2490
  };
2448
- function tr(r) {
2449
- const { t: e } = k(), s = Z(), {
2491
+ function mn(n) {
2492
+ const { t: e } = E(), s = Z(), {
2450
2493
  queryKey: t,
2451
- mutationFn: n,
2494
+ mutationFn: r,
2452
2495
  entity: o,
2453
2496
  fileProcessor: i,
2454
2497
  renderCustomPreview: c,
2455
2498
  onError: a
2456
- } = r, [l, u] = R(!1), [d, m] = R(null), [f, p] = R(!1), b = ne({
2457
- mutationFn: n,
2499
+ } = n, [l, u] = D(!1), [d, h] = D(null), [f, p] = D(!1), b = re({
2500
+ mutationFn: r,
2458
2501
  onError: (g) => {
2459
2502
  console.error(g), a == null || a(g);
2460
2503
  },
2461
2504
  onSuccess: async () => {
2462
2505
  await s.invalidateQueries({ queryKey: t });
2463
2506
  }
2464
- }), { action: y } = ts({
2507
+ }), { action: y } = as({
2465
2508
  onClick: () => u(!0)
2466
2509
  });
2467
2510
  return {
@@ -2471,14 +2514,14 @@ function tr(r) {
2471
2514
  await b.mutateAsync({
2472
2515
  items: d,
2473
2516
  override: f
2474
- }), u(!1), m(null), p(!1);
2517
+ }), u(!1), h(null), p(!1);
2475
2518
  } catch (g) {
2476
2519
  console.error(g);
2477
2520
  }
2478
2521
  },
2479
2522
  isLoading: b.isPending,
2480
2523
  fileProcessor: i,
2481
- onFileProcessed: (g) => m(g),
2524
+ onFileProcessed: (g) => h(g),
2482
2525
  renderCustomPreview: c,
2483
2526
  onOverrideChange: (g) => p(g),
2484
2527
  open: l,
@@ -2486,32 +2529,32 @@ function tr(r) {
2486
2529
  entity: e(`_pages:${o}.title`)
2487
2530
  }),
2488
2531
  handleClose: () => {
2489
- u(!1), m(null), p(!1);
2532
+ u(!1), h(null), p(!1);
2490
2533
  },
2491
2534
  action: y
2492
2535
  };
2493
2536
  }
2494
- const sr = (r) => {
2495
- const { showSuccessNotification: e } = oe(), { t: s } = k(), {
2537
+ const hn = (n) => {
2538
+ const { showSuccessNotification: e } = oe(), { t: s } = E(), {
2496
2539
  entity: t,
2497
- mutationFn: n,
2540
+ mutationFn: r,
2498
2541
  onError: o,
2499
2542
  onSuccess: i,
2500
2543
  onSuccessMessage: c = s("_pages:common.actions.export.successMessage")
2501
- } = r, a = ne({
2502
- mutationFn: () => n(),
2544
+ } = n, a = re({
2545
+ mutationFn: () => r(),
2503
2546
  onError: (d) => {
2504
2547
  console.error(d), o && o(d);
2505
2548
  },
2506
2549
  onSuccess: async (d) => {
2507
- const m = JSON.stringify(d, null, 2), f = new Blob([m], { type: "application/json" }), p = URL.createObjectURL(f), b = document.createElement("a");
2550
+ const h = JSON.stringify(d, null, 2), f = new Blob([h], { type: "application/json" }), p = URL.createObjectURL(f), b = document.createElement("a");
2508
2551
  b.href = p, b.download = `${t}.json`, b.click(), URL.revokeObjectURL(p), i && i(d), e({
2509
2552
  message: c
2510
2553
  });
2511
2554
  }
2512
- }), l = S(() => {
2555
+ }), l = v(() => {
2513
2556
  a.mutate();
2514
- }, [a]), { action: u } = es({
2557
+ }, [a]), { action: u } = is({
2515
2558
  onClick: l,
2516
2559
  isLoading: a.isPending
2517
2560
  });
@@ -2519,19 +2562,19 @@ const sr = (r) => {
2519
2562
  action: u
2520
2563
  };
2521
2564
  }, Ae = () => typeof window < "u" ? window.scrollY : 0;
2522
- function ss(r) {
2523
- const [e, s] = R(Ae), t = S(() => {
2565
+ function cs(n) {
2566
+ const [e, s] = D(Ae), t = v(() => {
2524
2567
  s(Ae());
2525
2568
  }, []);
2526
- return M(() => (window.addEventListener("scroll", t), () => {
2569
+ return P(() => (window.addEventListener("scroll", t), () => {
2527
2570
  window.removeEventListener("scroll", t);
2528
- }), [t]), e > r;
2571
+ }), [t]), e > n;
2529
2572
  }
2530
- const rr = (r) => {
2531
- const { t: e } = k(), {
2532
- icon: s = yt,
2573
+ const fn = (n) => {
2574
+ const { t: e } = E(), {
2575
+ icon: s = vt,
2533
2576
  threshold: t = 200,
2534
- scrollTop: n = 0,
2577
+ scrollTop: r = 0,
2535
2578
  scrollLeft: o = 0,
2536
2579
  tooltip: i = e("_accessibility:buttons.toTop"),
2537
2580
  scrollOnClick: c = !0,
@@ -2539,33 +2582,33 @@ const rr = (r) => {
2539
2582
  className: l = "",
2540
2583
  variant: u = "submit",
2541
2584
  color: d = "primary",
2542
- ...m
2543
- } = r, f = ss(t);
2544
- return /* @__PURE__ */ h(
2545
- z,
2585
+ ...h
2586
+ } = n, f = cs(t);
2587
+ return /* @__PURE__ */ m(
2588
+ W,
2546
2589
  {
2547
2590
  variant: u,
2548
2591
  color: d,
2549
2592
  icon: s,
2550
2593
  "data-tooltip-id": "tooltip",
2551
2594
  onClick: () => {
2552
- a == null || a(), c && Yt.scrollTo(o, n);
2595
+ a == null || a(), c && ns.scrollTo(o, r);
2553
2596
  },
2554
2597
  className: `to-top ${f ? "show" : "hide"} ${l}`.trim(),
2555
2598
  "data-tooltip-content": i,
2556
- ...m
2599
+ ...h
2557
2600
  }
2558
2601
  );
2559
2602
  };
2560
- function nr(r) {
2561
- const { t: e } = k();
2562
- if ("children" in r) {
2563
- const { children: v, className: N } = r;
2564
- return /* @__PURE__ */ h("div", { className: `error-container${N ? ` ${N}` : ""}`, children: v });
2603
+ function pn(n) {
2604
+ const { t: e } = E();
2605
+ if ("children" in n) {
2606
+ const { children: T, className: k } = n;
2607
+ return /* @__PURE__ */ m("div", { className: `error-container${k ? ` ${k}` : ""}`, children: T });
2565
2608
  }
2566
2609
  const {
2567
2610
  error: t,
2568
- message: n,
2611
+ message: r,
2569
2612
  iconProps: o,
2570
2613
  onRetry: i,
2571
2614
  retryLabel: c,
@@ -2573,72 +2616,72 @@ function nr(r) {
2573
2616
  messageProps: l,
2574
2617
  className: u,
2575
2618
  resetErrorBoundary: d
2576
- } = r, m = i ?? d, {
2619
+ } = n, h = i ?? d, {
2577
2620
  className: f,
2578
2621
  children: p,
2579
2622
  onClick: b,
2580
2623
  ...y
2581
- } = a ?? {}, { className: g, ...T } = l ?? {}, w = o !== null;
2582
- return /* @__PURE__ */ E("div", { className: `error-container${u ? ` ${u}` : ""}`, children: [
2583
- w && /* @__PURE__ */ h(
2584
- q,
2624
+ } = a ?? {}, { className: g, ...C } = l ?? {}, w = o !== null;
2625
+ return /* @__PURE__ */ N("div", { className: `error-container${u ? ` ${u}` : ""}`, children: [
2626
+ w && /* @__PURE__ */ m(
2627
+ U,
2585
2628
  {
2586
2629
  ...o,
2587
- icon: (o == null ? void 0 : o.icon) ?? kt,
2630
+ icon: (o == null ? void 0 : o.icon) ?? $t,
2588
2631
  className: `error-icon${o != null && o.className ? ` ${o.className}` : ""}`
2589
2632
  }
2590
2633
  ),
2591
- /* @__PURE__ */ h(
2634
+ /* @__PURE__ */ m(
2592
2635
  "p",
2593
2636
  {
2594
- ...T,
2637
+ ...C,
2595
2638
  className: `error-message${g ? ` ${g}` : ""}`,
2596
- children: n ?? (t == null ? void 0 : t.message) ?? e("_accessibility:errors.unknownError")
2639
+ children: r ?? (t == null ? void 0 : t.message) ?? e("_accessibility:errors.unknownError")
2597
2640
  }
2598
2641
  ),
2599
- m && /* @__PURE__ */ h(
2600
- H,
2642
+ h && /* @__PURE__ */ m(
2643
+ V,
2601
2644
  {
2602
2645
  type: "button",
2603
2646
  variant: "submit",
2604
2647
  color: "primary",
2605
2648
  ...y,
2606
2649
  className: `error-retry ${f ? ` ${f}` : ""}`,
2607
- onClick: (v) => {
2608
- b == null || b(v), v.defaultPrevented || m();
2650
+ onClick: (T) => {
2651
+ b == null || b(T), T.defaultPrevented || h();
2609
2652
  },
2610
2653
  children: p ?? c ?? e("_accessibility:actions.retry", { defaultValue: "Retry" })
2611
2654
  }
2612
2655
  )
2613
2656
  ] });
2614
2657
  }
2615
- const rs = (r) => {
2616
- const { showBackButton: e, title: s, actions: t } = r, { t: n } = k(), { navigate: o } = ce();
2617
- return /* @__PURE__ */ E("div", { className: "page-header", children: [
2618
- /* @__PURE__ */ E("div", { className: "page-header-left", children: [
2619
- e && /* @__PURE__ */ h(
2620
- z,
2658
+ const ls = (n) => {
2659
+ const { showBackButton: e, title: s, actions: t } = n, { t: r } = E(), { navigate: o } = ie();
2660
+ return /* @__PURE__ */ N("div", { className: "page-header", children: [
2661
+ /* @__PURE__ */ N("div", { className: "page-header-left", children: [
2662
+ e && /* @__PURE__ */ m(
2663
+ W,
2621
2664
  {
2622
- icon: wt,
2665
+ icon: Ct,
2623
2666
  onClick: () => o(-1),
2624
2667
  className: "page-header-back",
2625
- name: n("_accessibility:buttons.back"),
2668
+ name: r("_accessibility:buttons.back"),
2626
2669
  "data-tooltip-id": "tooltip",
2627
- "data-tooltip-content": n("_accessibility:buttons.back")
2670
+ "data-tooltip-content": r("_accessibility:buttons.back")
2628
2671
  }
2629
2672
  ),
2630
- /* @__PURE__ */ h("h2", { className: "page-header-title", children: s })
2673
+ /* @__PURE__ */ m("h2", { className: "page-header-title", children: s })
2631
2674
  ] }),
2632
- /* @__PURE__ */ E("div", { children: [
2633
- /* @__PURE__ */ h(
2634
- it,
2675
+ /* @__PURE__ */ N("div", { children: [
2676
+ /* @__PURE__ */ m(
2677
+ lt,
2635
2678
  {
2636
2679
  className: "page-header-actions-desktop",
2637
2680
  actions: t ?? []
2638
2681
  }
2639
2682
  ),
2640
- /* @__PURE__ */ h(
2641
- at,
2683
+ /* @__PURE__ */ m(
2684
+ ut,
2642
2685
  {
2643
2686
  className: "page-header-actions-mobile",
2644
2687
  actions: t ?? []
@@ -2646,24 +2689,24 @@ const rs = (r) => {
2646
2689
  )
2647
2690
  ] })
2648
2691
  ] });
2649
- }, or = (r) => {
2692
+ }, gn = (n) => {
2650
2693
  const {
2651
2694
  title: e,
2652
2695
  children: s,
2653
2696
  addOptions: t,
2654
- filterOptions: n,
2697
+ filterOptions: r,
2655
2698
  actions: o,
2656
2699
  queryKey: i,
2657
2700
  isLoading: c = !1,
2658
2701
  isAnimated: a = !0,
2659
2702
  showBackButton: l = !1
2660
- } = r, { t: u } = k(), d = Z(), { countOfFilters: m } = ct(), f = V(() => {
2703
+ } = n, { t: u } = E(), d = Z(), { countOfFilters: h } = dt(), f = q(() => {
2661
2704
  const p = Array.isArray(o) ? [...o] : [];
2662
2705
  if (i) {
2663
2706
  const b = {
2664
- id: J.Refresh,
2707
+ id: Y.Refresh,
2665
2708
  onClick: () => d.invalidateQueries({ queryKey: i }),
2666
- icon: /* @__PURE__ */ h(q, { icon: Le }),
2709
+ icon: /* @__PURE__ */ m(U, { icon: Re }),
2667
2710
  tooltip: u("_pages:common.actions.refresh.text")
2668
2711
  };
2669
2712
  p.unshift(b);
@@ -2671,21 +2714,21 @@ const rs = (r) => {
2671
2714
  if (t) {
2672
2715
  const b = {
2673
2716
  ...t,
2674
- id: J.Add,
2675
- icon: /* @__PURE__ */ h(q, { icon: ve })
2717
+ id: Y.Add,
2718
+ icon: /* @__PURE__ */ m(U, { icon: Te })
2676
2719
  };
2677
2720
  p.unshift(b);
2678
2721
  }
2679
- if (n) {
2722
+ if (r) {
2680
2723
  const b = {
2681
- ...n,
2724
+ ...r,
2682
2725
  id: "filter",
2683
- icon: /* @__PURE__ */ h(q, { icon: St }),
2684
- children: /* @__PURE__ */ h(
2685
- lt,
2726
+ icon: /* @__PURE__ */ m(U, { icon: Tt }),
2727
+ children: /* @__PURE__ */ m(
2728
+ mt,
2686
2729
  {
2687
- className: `${m > 0 ? "show" : "hide"} `,
2688
- count: m
2730
+ className: `${h > 0 ? "show" : "hide"} `,
2731
+ count: h
2689
2732
  }
2690
2733
  )
2691
2734
  };
@@ -2695,26 +2738,26 @@ const rs = (r) => {
2695
2738
  }, [
2696
2739
  o,
2697
2740
  t,
2698
- m,
2699
- n,
2741
+ h,
2742
+ r,
2700
2743
  d,
2701
2744
  i,
2702
2745
  u
2703
2746
  ]);
2704
- return /* @__PURE__ */ E("main", { className: "page-main", children: [
2705
- /* @__PURE__ */ h(
2706
- rs,
2747
+ return /* @__PURE__ */ N("main", { className: "page-main", children: [
2748
+ /* @__PURE__ */ m(
2749
+ ls,
2707
2750
  {
2708
2751
  showBackButton: l,
2709
2752
  actions: f,
2710
2753
  title: e
2711
2754
  }
2712
2755
  ),
2713
- /* @__PURE__ */ h("div", { className: `page-main-content ${a ? "appear" : ""}`, children: c ? /* @__PURE__ */ h(re, { className: "page-loading" }) : s }),
2714
- t && /* @__PURE__ */ h(
2715
- z,
2756
+ /* @__PURE__ */ m("div", { className: `page-main-content ${a ? "appear" : ""}`, children: c ? /* @__PURE__ */ m(ne, { className: "page-loading" }) : s }),
2757
+ t && /* @__PURE__ */ m(
2758
+ W,
2716
2759
  {
2717
- icon: t.icon ?? ve,
2760
+ icon: t.icon ?? Te,
2718
2761
  color: t.color ?? "primary",
2719
2762
  variant: t.variant ?? "submit",
2720
2763
  onClick: () => {
@@ -2725,11 +2768,11 @@ const rs = (r) => {
2725
2768
  }
2726
2769
  )
2727
2770
  ] });
2728
- }, ir = (r) => {
2729
- const { t: e } = k(), {
2771
+ }, bn = (n) => {
2772
+ const { t: e } = E(), {
2730
2773
  className: s = "",
2731
2774
  itemClassName: t = "",
2732
- loading: n = !1,
2775
+ loading: r = !1,
2733
2776
  emptyComponent: o = null,
2734
2777
  emptyMessage: i = e("_accessibility:messages.empty"),
2735
2778
  renderComponent: c,
@@ -2737,10 +2780,10 @@ const rs = (r) => {
2737
2780
  hasMore: l = !1,
2738
2781
  loadingMore: u = !1,
2739
2782
  onLoadMore: d,
2740
- loadMoreComponent: m = null,
2783
+ loadMoreComponent: h = null,
2741
2784
  observerRootMargin: f = "0px 0px 200px 0px",
2742
2785
  observerThreshold: p = 0
2743
- } = r, b = F(!1), y = F(null), g = S(async () => {
2786
+ } = n, b = K(!1), y = K(null), g = v(async () => {
2744
2787
  if (!(!l || !d) && !(u || b.current)) {
2745
2788
  b.current = !0;
2746
2789
  try {
@@ -2750,86 +2793,86 @@ const rs = (r) => {
2750
2793
  }
2751
2794
  }
2752
2795
  }, [l, u, d]);
2753
- return M(() => {
2796
+ return P(() => {
2754
2797
  if (!l || !d || !y.current || typeof IntersectionObserver > "u") return;
2755
- const T = new IntersectionObserver(
2798
+ const C = new IntersectionObserver(
2756
2799
  (w) => {
2757
- w.some((v) => v.isIntersecting) && g();
2800
+ w.some((T) => T.isIntersecting) && g();
2758
2801
  },
2759
2802
  {
2760
2803
  rootMargin: f,
2761
2804
  threshold: p
2762
2805
  }
2763
2806
  );
2764
- return T.observe(y.current), () => T.disconnect();
2807
+ return C.observe(y.current), () => C.disconnect();
2765
2808
  }, [
2766
2809
  l,
2767
2810
  d,
2768
2811
  f,
2769
2812
  p,
2770
2813
  g
2771
- ]), n ? /* @__PURE__ */ h(re, {}) : /* @__PURE__ */ h(ae, { children: a != null && a.length ? /* @__PURE__ */ E("ul", { className: `pretty-grid-main ${s}`, children: [
2772
- a == null ? void 0 : a.map((T) => /* @__PURE__ */ h("li", { className: `pretty-grid-item ${t}`, children: c(T) }, T.id)),
2773
- l && d && /* @__PURE__ */ h("li", { className: "pretty-grid-load-more", ref: y, children: m })
2774
- ] }) : /* @__PURE__ */ h(ae, { children: o || /* @__PURE__ */ h(ds, { message: i }) }) });
2775
- }, Ge = X({
2814
+ ]), r ? /* @__PURE__ */ m(ne, {}) : /* @__PURE__ */ m(ce, { children: a != null && a.length ? /* @__PURE__ */ N("ul", { className: `pretty-grid-main ${s}`, children: [
2815
+ a == null ? void 0 : a.map((C) => /* @__PURE__ */ m("li", { className: `pretty-grid-item ${t}`, children: c(C) }, C.id)),
2816
+ l && d && /* @__PURE__ */ m("li", { className: "pretty-grid-load-more", ref: y, children: h })
2817
+ ] }) : /* @__PURE__ */ m(ce, { children: o || /* @__PURE__ */ m(ws, { message: i }) }) });
2818
+ }, Je = X({
2776
2819
  title: "",
2777
2820
  setTitle: () => {
2778
2821
  },
2779
2822
  rightContent: null,
2780
2823
  setRightContent: () => {
2781
2824
  }
2782
- }), ar = (r) => {
2783
- const { children: e } = r, [s, t] = R(""), [n, o] = R(null), i = S((l) => {
2825
+ }), yn = (n) => {
2826
+ const { children: e } = n, [s, t] = D(""), [r, o] = D(null), i = v((l) => {
2784
2827
  t(l);
2785
- }, []), c = S((l) => {
2828
+ }, []), c = v((l) => {
2786
2829
  o(l);
2787
- }, []), a = V(
2830
+ }, []), a = q(
2788
2831
  () => ({
2789
2832
  title: s,
2790
2833
  setTitle: i,
2791
- rightContent: n,
2834
+ rightContent: r,
2792
2835
  setRightContent: c
2793
2836
  }),
2794
- [s, i, n, c]
2837
+ [s, i, r, c]
2795
2838
  );
2796
- return /* @__PURE__ */ h(Ge.Provider, { value: a, children: e });
2797
- }, ns = () => Y(Ge);
2798
- function cr(r) {
2799
- 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) => {
2800
- (Ht() ? p.metaKey : p.ctrlKey) && p.shiftKey && p.key.toLowerCase() === "f" && (u(!0), p.preventDefault());
2839
+ return /* @__PURE__ */ m(Je.Provider, { value: a, children: e });
2840
+ }, us = () => G(Je);
2841
+ function wn(n) {
2842
+ const { t: e } = E(), { openDrawer: s, showSearch: t = !0, menuButtonProps: r } = n, { searchComponent: o, location: i } = ie(), { title: c, rightContent: a } = us(), [l, u] = D(!1), d = v((p) => {
2843
+ (Wt() ? p.metaKey : p.ctrlKey) && p.shiftKey && p.key.toLowerCase() === "f" && (u(!0), p.preventDefault());
2801
2844
  }, []);
2802
- M(() => (window.addEventListener("keydown", d), () => {
2845
+ P(() => (window.addEventListener("keydown", d), () => {
2803
2846
  window.removeEventListener("keydown", d);
2804
2847
  }), [d]);
2805
- const m = o, f = t && !!m;
2806
- return /* @__PURE__ */ E(ae, { children: [
2807
- i.pathname !== "/" && !!m && /* @__PURE__ */ h(m, { open: l, onClose: () => u(!1) }),
2808
- /* @__PURE__ */ E("header", { id: "header", className: "header", children: [
2809
- /* @__PURE__ */ E("div", { className: "navbar-left", children: [
2810
- /* @__PURE__ */ h(
2811
- z,
2848
+ const h = o, f = t && !!h;
2849
+ return /* @__PURE__ */ N(ce, { children: [
2850
+ i.pathname !== "/" && !!h && /* @__PURE__ */ m(h, { open: l, onClose: () => u(!1) }),
2851
+ /* @__PURE__ */ N("header", { id: "header", className: "header", children: [
2852
+ /* @__PURE__ */ N("div", { className: "navbar-left", children: [
2853
+ /* @__PURE__ */ m(
2854
+ W,
2812
2855
  {
2813
- ...n,
2814
- type: (n == null ? void 0 : n.type) ?? "button",
2815
- icon: (n == null ? void 0 : n.icon) ?? Tt,
2856
+ ...r,
2857
+ type: (r == null ? void 0 : r.type) ?? "button",
2858
+ icon: (r == null ? void 0 : r.icon) ?? Nt,
2816
2859
  onClick: (p) => {
2817
2860
  var b;
2818
- (b = n == null ? void 0 : n.onClick) == null || b.call(n, p), s();
2861
+ (b = r == null ? void 0 : r.onClick) == null || b.call(r, p), s();
2819
2862
  },
2820
- name: (n == null ? void 0 : n.name) ?? e("_accessibility:buttons.openMenu"),
2821
- "aria-label": (n == null ? void 0 : n["aria-label"]) ?? e("_accessibility:ariaLabels.openMenu"),
2822
- className: `navbar-menu animated ${(n == null ? void 0 : n.className) ?? ""}`
2863
+ name: (r == null ? void 0 : r.name) ?? e("_accessibility:buttons.openMenu"),
2864
+ "aria-label": (r == null ? void 0 : r["aria-label"]) ?? e("_accessibility:ariaLabels.openMenu"),
2865
+ className: `navbar-menu animated ${(r == null ? void 0 : r.className) ?? ""}`
2823
2866
  }
2824
2867
  ),
2825
- /* @__PURE__ */ h("h1", { className: "poppins navbar-title", children: c || e("_pages:home.appName") })
2868
+ /* @__PURE__ */ m("h1", { className: "poppins navbar-title", children: c || e("_pages:home.appName") })
2826
2869
  ] }),
2827
- /* @__PURE__ */ E("div", { className: "navbar-right", children: [
2870
+ /* @__PURE__ */ N("div", { className: "navbar-right", children: [
2828
2871
  a,
2829
- f && /* @__PURE__ */ h(
2830
- z,
2872
+ f && /* @__PURE__ */ m(
2873
+ W,
2831
2874
  {
2832
- icon: Ct,
2875
+ icon: kt,
2833
2876
  className: "navbar-search-btn",
2834
2877
  onClick: () => u(!0)
2835
2878
  }
@@ -2838,63 +2881,63 @@ function cr(r) {
2838
2881
  ] })
2839
2882
  ] });
2840
2883
  }
2841
- const ue = 300, os = (r) => r ?? O.error, is = (r) => {
2842
- switch (r) {
2843
- case O.error:
2844
- return Et;
2884
+ const ue = 300, ds = (n) => n ?? F.error, ms = (n) => {
2885
+ switch (n) {
2886
+ case F.error:
2887
+ return At;
2845
2888
  default:
2846
- return vt;
2889
+ return Et;
2847
2890
  }
2848
- }, ge = (r) => {
2849
- switch (r) {
2850
- case O.success:
2891
+ }, ge = (n) => {
2892
+ switch (n) {
2893
+ case F.success:
2851
2894
  return "!text-success";
2852
- case O.error:
2895
+ case F.error:
2853
2896
  return "!text-error";
2854
- case O.warning:
2897
+ case F.warning:
2855
2898
  return "!text-warning";
2856
2899
  default:
2857
2900
  return "!text-info";
2858
2901
  }
2859
- }, as = (r) => {
2860
- switch (r) {
2861
- case O.success:
2902
+ }, hs = (n) => {
2903
+ switch (n) {
2904
+ case F.success:
2862
2905
  return "bg-bg-success";
2863
- case O.error:
2906
+ case F.error:
2864
2907
  return "bg-bg-error";
2865
- case O.warning:
2908
+ case F.warning:
2866
2909
  return "bg-bg-warning";
2867
2910
  default:
2868
2911
  return "bg-bg-info";
2869
2912
  }
2870
2913
  };
2871
- function lr() {
2872
- const { t: r } = k(), { notification: e, removeNotification: s } = oe(), [t, n] = R([]), o = F(t);
2873
- dt(() => {
2914
+ function Sn() {
2915
+ const { t: n } = E(), { notification: e, removeNotification: s } = oe(), [t, r] = D([]), o = K(t);
2916
+ ft(() => {
2874
2917
  o.current = t;
2875
2918
  });
2876
- const i = F(null), c = S(
2919
+ const i = K(null), c = v(
2877
2920
  (a) => {
2878
- n(
2921
+ r(
2879
2922
  (l) => a !== void 0 ? l.map((u) => u.id === a ? { ...u, closing: !0 } : u) : l.map((u) => ({ ...u, closing: !0 }))
2880
2923
  ), a !== void 0 ? setTimeout(() => {
2881
- s(a), n((l) => l.filter((u) => u.id !== a));
2924
+ s(a), r((l) => l.filter((u) => u.id !== a));
2882
2925
  }, ue) : (i.current && clearTimeout(i.current), i.current = setTimeout(() => {
2883
- s(), n([]), i.current = null;
2926
+ s(), r([]), i.current = null;
2884
2927
  }, ue));
2885
2928
  },
2886
2929
  [s]
2887
2930
  );
2888
- return M(() => {
2931
+ return P(() => {
2889
2932
  let a = null;
2890
2933
  const l = () => {
2891
2934
  a && clearTimeout(a), i.current && (clearTimeout(i.current), i.current = null);
2892
2935
  };
2893
2936
  if (e.length === 0)
2894
2937
  return o.current.length === 0 ? void 0 : (i.current && clearTimeout(i.current), a = setTimeout(() => {
2895
- n((f) => f.map((p) => ({ ...p, closing: !0 }))), a = null;
2938
+ r((f) => f.map((p) => ({ ...p, closing: !0 }))), a = null;
2896
2939
  }, 0), i.current = setTimeout(() => {
2897
- n([]), i.current = null;
2940
+ r([]), i.current = null;
2898
2941
  }, ue), l);
2899
2942
  const u = new Set(o.current.map((f) => f.id));
2900
2943
  if (!e.some(
@@ -2903,21 +2946,21 @@ function lr() {
2903
2946
  if (o.current.length === 0) {
2904
2947
  const f = [...e];
2905
2948
  return a = setTimeout(() => {
2906
- n(f.map((p) => ({ ...p, closing: !1 }))), a = null;
2949
+ r(f.map((p) => ({ ...p, closing: !1 }))), a = null;
2907
2950
  }, 0), () => {
2908
2951
  a && clearTimeout(a);
2909
2952
  };
2910
2953
  }
2911
2954
  i.current && clearTimeout(i.current), a = setTimeout(() => {
2912
- n(
2955
+ r(
2913
2956
  (f) => f.every((p) => p.closing) ? f : f.map((p) => ({ ...p, closing: !0 }))
2914
2957
  ), a = null;
2915
2958
  }, 0);
2916
- const m = [...e];
2959
+ const h = [...e];
2917
2960
  return i.current = setTimeout(() => {
2918
- n(m.map((f) => ({ ...f, closing: !1 }))), i.current = null;
2961
+ r(h.map((f) => ({ ...f, closing: !1 }))), i.current = null;
2919
2962
  }, ue), l;
2920
- }, [e]), M(() => {
2963
+ }, [e]), P(() => {
2921
2964
  if (!t.length) return;
2922
2965
  let a;
2923
2966
  const l = window.setTimeout(() => {
@@ -2928,38 +2971,38 @@ function lr() {
2928
2971
  return window.addEventListener("keydown", u), () => {
2929
2972
  window.clearTimeout(l), a && window.removeEventListener("click", a), window.removeEventListener("keydown", u);
2930
2973
  };
2931
- }, [t.length, c]), Ie(
2932
- /* @__PURE__ */ h("div", { className: `notification-portal ${t.length ? "active" : ""}`, children: t.map(({ id: a, type: l, message: u, closing: d }) => {
2933
- const m = os(l);
2934
- return /* @__PURE__ */ E(
2974
+ }, [t.length, c]), _e(
2975
+ /* @__PURE__ */ m("div", { className: `notification-portal ${t.length ? "active" : ""}`, children: t.map(({ id: a, type: l, message: u, closing: d }) => {
2976
+ const h = ds(l);
2977
+ return /* @__PURE__ */ N(
2935
2978
  "div",
2936
2979
  {
2937
- className: `notification ${d ? "closing" : ""} ${as(m)}`,
2980
+ className: `notification ${d ? "closing" : ""} ${hs(h)}`,
2938
2981
  onClick: (f) => f.stopPropagation(),
2939
2982
  children: [
2940
- /* @__PURE__ */ E("div", { className: "notification-body", children: [
2941
- /* @__PURE__ */ h(
2942
- q,
2983
+ /* @__PURE__ */ N("div", { className: "notification-body", children: [
2984
+ /* @__PURE__ */ m(
2985
+ U,
2943
2986
  {
2944
- icon: is(m),
2945
- className: `notification-icon ${ge(m)}`
2987
+ icon: ms(h),
2988
+ className: `notification-icon ${ge(h)}`
2946
2989
  }
2947
2990
  ),
2948
- /* @__PURE__ */ h("p", { className: `notification-text ${ge(m)}`, children: u })
2991
+ /* @__PURE__ */ m("p", { className: `notification-text ${ge(h)}`, children: u })
2949
2992
  ] }),
2950
- /* @__PURE__ */ h(
2951
- z,
2993
+ /* @__PURE__ */ m(
2994
+ W,
2952
2995
  {
2953
2996
  type: "button",
2954
- icon: De,
2997
+ icon: Le,
2955
2998
  color: "error",
2956
2999
  className: "notification-close group",
2957
3000
  onClick: (f) => {
2958
3001
  f.stopPropagation(), a !== void 0 && c(a);
2959
3002
  },
2960
- iconClassName: `${ge(m)} notification-close-icon`,
2961
- name: r("_accessibility:buttons.closeNotification"),
2962
- "aria-label": r("_accessibility:ariaLabels.closeNotification")
3003
+ iconClassName: `${ge(h)} notification-close-icon`,
3004
+ name: n("_accessibility:buttons.closeNotification"),
3005
+ "aria-label": n("_accessibility:ariaLabels.closeNotification")
2963
3006
  }
2964
3007
  )
2965
3008
  ]
@@ -2970,78 +3013,78 @@ function lr() {
2970
3013
  document.body
2971
3014
  );
2972
3015
  }
2973
- function ur(r) {
2974
- const { className: e, ...s } = r;
2975
- return /* @__PURE__ */ h("div", { className: "splash-screen", children: /* @__PURE__ */ h(
2976
- re,
3016
+ function vn(n) {
3017
+ const { className: e, ...s } = n;
3018
+ return /* @__PURE__ */ m("div", { className: "splash-screen", children: /* @__PURE__ */ m(
3019
+ ne,
2977
3020
  {
2978
3021
  className: `blur-appear ${e ? ` ${e}` : ""}`,
2979
3022
  ...s
2980
3023
  }
2981
3024
  ) });
2982
3025
  }
2983
- const cs = (r) => {
3026
+ const fs = (n) => {
2984
3027
  const {
2985
3028
  id: e,
2986
3029
  active: s,
2987
3030
  onClick: t,
2988
- children: n,
3031
+ children: r,
2989
3032
  to: o,
2990
3033
  useLinks: i = !0,
2991
3034
  tabButtonProps: c
2992
- } = r, { linkComponent: a } = ce(), l = a;
3035
+ } = n, { linkComponent: a } = ie(), l = a;
2993
3036
  if (!i) {
2994
3037
  const {
2995
3038
  className: d = "",
2996
- variant: m = s ? "submit" : "outlined",
3039
+ variant: h = s ? "submit" : "outlined",
2997
3040
  color: f = s ? "primary" : "default",
2998
3041
  ...p
2999
3042
  } = c ?? {};
3000
- return /* @__PURE__ */ h(
3001
- H,
3043
+ return /* @__PURE__ */ m(
3044
+ V,
3002
3045
  {
3003
3046
  type: "button",
3004
- variant: m,
3047
+ variant: h,
3005
3048
  color: f,
3006
3049
  className: `tab ${d}`,
3007
3050
  onClick: t,
3008
3051
  ...p,
3009
- children: n
3052
+ children: r
3010
3053
  }
3011
3054
  );
3012
3055
  }
3013
3056
  const u = `button submit tab ${s ? "primary" : "outlined"} ${(c == null ? void 0 : c.className) ?? ""}`.trim();
3014
- return /* @__PURE__ */ h(
3057
+ return /* @__PURE__ */ m(
3015
3058
  l,
3016
3059
  {
3017
3060
  to: o ?? `#${e}`,
3018
3061
  onClick: () => t(),
3019
3062
  className: u,
3020
- children: n
3063
+ children: r
3021
3064
  }
3022
3065
  );
3023
- }, ls = (r) => {
3066
+ }, ps = (n) => {
3024
3067
  var f;
3025
3068
  const {
3026
3069
  tabs: e = [],
3027
3070
  defaultTab: s,
3028
3071
  currentTab: t,
3029
- onTabChange: n,
3072
+ onTabChange: r,
3030
3073
  className: o = "",
3031
3074
  tabsContainerClassName: i = "",
3032
3075
  useLinks: c = !0,
3033
3076
  tabButtonProps: a
3034
- } = r, [l, u] = R(s ?? ((f = e[0]) == null ? void 0 : f.id)), d = t ?? l, m = V(() => e.find((p) => p.id === d), [e, d]);
3035
- return /* @__PURE__ */ E("div", { className: `tabs-layout-main ${o}`, children: [
3036
- /* @__PURE__ */ h(
3077
+ } = n, [l, u] = D(s ?? ((f = e[0]) == null ? void 0 : f.id)), d = t ?? l, h = q(() => e.find((p) => p.id === d), [e, d]);
3078
+ return /* @__PURE__ */ N("div", { className: `tabs-layout-main ${o}`, children: [
3079
+ /* @__PURE__ */ m(
3037
3080
  "ul",
3038
3081
  {
3039
3082
  className: `horizontal tabs tabs-container ${i}`,
3040
- children: e.map(({ id: p, to: b, label: y }) => /* @__PURE__ */ h("li", { children: /* @__PURE__ */ h(
3041
- cs,
3083
+ children: e.map(({ id: p, to: b, label: y }) => /* @__PURE__ */ m("li", { children: /* @__PURE__ */ m(
3084
+ fs,
3042
3085
  {
3043
3086
  onClick: () => {
3044
- t === void 0 && u(p), n == null || n(p);
3087
+ t === void 0 && u(p), r == null || r(p);
3045
3088
  },
3046
3089
  id: p,
3047
3090
  to: b,
@@ -3054,29 +3097,29 @@ const cs = (r) => {
3054
3097
  ) }, p))
3055
3098
  }
3056
3099
  ),
3057
- m == null ? void 0 : m.content
3100
+ h == null ? void 0 : h.content
3058
3101
  ] });
3059
- }, us = (r) => {
3102
+ }, gs = (n) => {
3060
3103
  const {
3061
3104
  title: e,
3062
3105
  body: s,
3063
3106
  content: t,
3064
- onClickNext: n,
3107
+ onClickNext: r,
3065
3108
  onSkip: o,
3066
3109
  onStartAsGuest: i,
3067
3110
  onSignIn: c,
3068
3111
  image: a = "",
3069
3112
  alt: l = "",
3070
3113
  final: u = !1
3071
- } = r, { t: d } = k();
3072
- return /* @__PURE__ */ E("div", { className: "big-appear step-container", children: [
3073
- a && /* @__PURE__ */ h("img", { src: a, alt: l }),
3074
- e != null && /* @__PURE__ */ h("h2", { className: "step-title", children: e }),
3075
- s != null && /* @__PURE__ */ h("div", { className: "step-body", children: s }),
3076
- t != null && /* @__PURE__ */ h("div", { className: "step-content", children: t }),
3077
- /* @__PURE__ */ h("div", { className: "step-actions", children: u ? /* @__PURE__ */ E(ae, { children: [
3078
- /* @__PURE__ */ h(
3079
- H,
3114
+ } = n, { t: d } = E();
3115
+ return /* @__PURE__ */ N("div", { className: "big-appear step-container", children: [
3116
+ a && /* @__PURE__ */ m("img", { src: a, alt: l }),
3117
+ e != null && /* @__PURE__ */ m("h2", { className: "step-title", children: e }),
3118
+ s != null && /* @__PURE__ */ m("div", { className: "step-body", children: s }),
3119
+ t != null && /* @__PURE__ */ m("div", { className: "step-content", children: t }),
3120
+ /* @__PURE__ */ m("div", { className: "step-actions", children: u ? /* @__PURE__ */ N(ce, { children: [
3121
+ /* @__PURE__ */ m(
3122
+ V,
3080
3123
  {
3081
3124
  color: "primary",
3082
3125
  className: "step-button",
@@ -3086,8 +3129,8 @@ const cs = (r) => {
3086
3129
  children: d("_accessibility:buttons.startAsGuest")
3087
3130
  }
3088
3131
  ),
3089
- /* @__PURE__ */ h(
3090
- H,
3132
+ /* @__PURE__ */ m(
3133
+ V,
3091
3134
  {
3092
3135
  color: "primary",
3093
3136
  variant: "submit",
@@ -3097,9 +3140,9 @@ const cs = (r) => {
3097
3140
  children: d("_accessibility:buttons.signIn")
3098
3141
  }
3099
3142
  )
3100
- ] }) : /* @__PURE__ */ E(ae, { children: [
3101
- /* @__PURE__ */ h(
3102
- H,
3143
+ ] }) : /* @__PURE__ */ N(ce, { children: [
3144
+ /* @__PURE__ */ m(
3145
+ V,
3103
3146
  {
3104
3147
  color: "primary",
3105
3148
  className: "step-button",
@@ -3109,62 +3152,62 @@ const cs = (r) => {
3109
3152
  children: d("_accessibility:buttons.skip")
3110
3153
  }
3111
3154
  ),
3112
- /* @__PURE__ */ h(
3113
- H,
3155
+ /* @__PURE__ */ m(
3156
+ V,
3114
3157
  {
3115
3158
  color: "primary",
3116
3159
  className: "step-button",
3117
3160
  variant: "outlined",
3118
- onClick: () => n(),
3161
+ onClick: () => r(),
3119
3162
  "aria-label": d("_accessibility:ariaLabels.next"),
3120
3163
  children: d("_accessibility:buttons.next")
3121
3164
  }
3122
3165
  )
3123
3166
  ] }) })
3124
3167
  ] });
3125
- }, dr = (r) => {
3168
+ }, Cn = (n) => {
3126
3169
  const {
3127
3170
  steps: e,
3128
3171
  signInPath: s = "/auth/sign-in",
3129
3172
  guestPath: t = "/",
3130
- onSkip: n,
3173
+ onSkip: r,
3131
3174
  onSignIn: o,
3132
3175
  onStartAsGuest: i
3133
- } = r, c = Ke(), { navigate: a } = ce(), [l, u] = R(1), d = S(() => {
3134
- if (n) {
3135
- n();
3176
+ } = n, c = je(), { navigate: a } = ie(), [l, u] = D(1), d = v(() => {
3177
+ if (r) {
3178
+ r();
3136
3179
  return;
3137
3180
  }
3138
3181
  a(s);
3139
- }, [a, n, s]), m = S(() => {
3182
+ }, [a, r, s]), h = v(() => {
3140
3183
  if (o) {
3141
3184
  o();
3142
3185
  return;
3143
3186
  }
3144
3187
  a(s);
3145
- }, [a, o, s]), f = S(() => {
3188
+ }, [a, o, s]), f = v(() => {
3146
3189
  if (i) {
3147
3190
  i();
3148
3191
  return;
3149
3192
  }
3150
3193
  c == null || c.setGuestMode(!0), a(t);
3151
- }, [c, t, a, i]), p = V(() => e.map((b, y) => ({
3194
+ }, [c, t, a, i]), p = q(() => e.map((b, y) => ({
3152
3195
  id: y + 1,
3153
3196
  label: "",
3154
- content: /* @__PURE__ */ h(
3155
- us,
3197
+ content: /* @__PURE__ */ m(
3198
+ gs,
3156
3199
  {
3157
3200
  ...b,
3158
3201
  final: y === e.length - 1,
3159
3202
  onClickNext: () => u((g) => g + 1),
3160
3203
  onSkip: d,
3161
3204
  onStartAsGuest: f,
3162
- onSignIn: m
3205
+ onSignIn: h
3163
3206
  }
3164
3207
  )
3165
- })), [m, d, f, e]);
3166
- return /* @__PURE__ */ h("div", { className: "onboarding-main", children: /* @__PURE__ */ h(
3167
- ls,
3208
+ })), [h, d, f, e]);
3209
+ return /* @__PURE__ */ m("div", { className: "onboarding-main", children: /* @__PURE__ */ m(
3210
+ ps,
3168
3211
  {
3169
3212
  currentTab: l,
3170
3213
  onTabChange: (b) => u(Number(b)),
@@ -3172,109 +3215,198 @@ const cs = (r) => {
3172
3215
  useLinks: !1
3173
3216
  }
3174
3217
  ) });
3175
- }, ds = (r) => {
3218
+ }, bs = (n, e) => e === "/" ? n === "/" : n.startsWith(e), ys = (n) => {
3219
+ const e = n.filter((s) => !s.hidden);
3220
+ return {
3221
+ leftItems: e.filter((s) => s.position !== "right"),
3222
+ rightItems: e.filter((s) => s.position === "right")
3223
+ };
3224
+ }, xe = ({
3225
+ item: n,
3226
+ isActive: e,
3227
+ linkComponent: s
3228
+ }) => {
3229
+ const o = `flex flex-col items-center justify-center gap-0.5 flex-1 py-2 transition-colors ${e ? "text-hover-primary" : "text-text-muted/60"}`.trim(), i = n.ariaLabel ?? n.label;
3230
+ return n.disabled ? /* @__PURE__ */ N(
3231
+ "span",
3232
+ {
3233
+ className: `${o} opacity-50 cursor-not-allowed`,
3234
+ "aria-disabled": !0,
3235
+ children: [
3236
+ /* @__PURE__ */ m("span", { className: "text-lg", children: /* @__PURE__ */ m(U, { icon: n.icon }) }),
3237
+ /* @__PURE__ */ m("span", { className: "text-[10px] leading-tight", children: n.label })
3238
+ ]
3239
+ }
3240
+ ) : /* @__PURE__ */ N(s, { to: n.to, className: o, "aria-label": i, children: [
3241
+ /* @__PURE__ */ m("span", { className: "text-lg", children: /* @__PURE__ */ m(U, { icon: n.icon }) }),
3242
+ /* @__PURE__ */ m("span", { className: "text-[10px] leading-tight", children: n.label })
3243
+ ] });
3244
+ }, Tn = (n) => {
3245
+ var j;
3246
+ const { items: e, centerAction: s, className: t = "", isItemActive: r } = n, o = (j = Ve()) == null ? void 0 : j.centerAction, i = o ? { ...s ?? {}, ...o } : s, { location: c, navigate: a, linkComponent: l } = ie(), { leftItems: u, rightItems: d } = q(
3247
+ () => ys(e),
3248
+ [e]
3249
+ ), {
3250
+ hidden: h,
3251
+ to: f,
3252
+ icon: p = xt,
3253
+ ariaLabel: b = "Bottom navigation action",
3254
+ onClick: y,
3255
+ variant: g = "submit",
3256
+ color: C = "primary",
3257
+ className: w = "",
3258
+ ...T
3259
+ } = i ?? {}, k = !!i && !h, O = (S) => r ? r(c.pathname, S) : bs(c.pathname, S.to);
3260
+ return /* @__PURE__ */ m(
3261
+ "nav",
3262
+ {
3263
+ className: `fixed -bottom-1 left-0 right-0 z-20 bg-base border-t border-border sm:hidden ${t}`.trim(),
3264
+ children: /* @__PURE__ */ N("div", { className: "flex items-center justify-around h-16", children: [
3265
+ u.map((S) => /* @__PURE__ */ m(
3266
+ xe,
3267
+ {
3268
+ item: S,
3269
+ isActive: O(S),
3270
+ linkComponent: l
3271
+ },
3272
+ S.id
3273
+ )),
3274
+ k && /* @__PURE__ */ m("div", { className: "flex items-center justify-center flex-1", children: /* @__PURE__ */ m(
3275
+ W,
3276
+ {
3277
+ ...T,
3278
+ type: "button",
3279
+ variant: g,
3280
+ color: C,
3281
+ icon: p,
3282
+ name: b,
3283
+ "aria-label": b,
3284
+ onClick: (S) => {
3285
+ y == null || y(S), !S.defaultPrevented && f && a(f);
3286
+ },
3287
+ className: `rounded-full! w-12! h-12! min-w-0! p-0! flex items-center justify-center shadow-lg -mt-4 ${w}`.trim()
3288
+ }
3289
+ ) }),
3290
+ d.map((S) => /* @__PURE__ */ m(
3291
+ xe,
3292
+ {
3293
+ item: S,
3294
+ isActive: O(S),
3295
+ linkComponent: l
3296
+ },
3297
+ S.id
3298
+ ))
3299
+ ] })
3300
+ }
3301
+ );
3302
+ }, ws = (n) => {
3176
3303
  const {
3177
3304
  message: e,
3178
3305
  messageProps: s = { className: "empty-message" },
3179
3306
  action: t,
3180
- iconProps: n
3181
- } = r;
3182
- return /* @__PURE__ */ E("div", { className: "empty-container", children: [
3183
- n && /* @__PURE__ */ h(q, { ...n }),
3184
- /* @__PURE__ */ h("p", { ...s, children: e }),
3185
- t && /* @__PURE__ */ h(ut, { showTooltips: !1, showText: !0, ...t })
3307
+ iconProps: r
3308
+ } = n;
3309
+ return /* @__PURE__ */ N("div", { className: "empty-container", children: [
3310
+ r && /* @__PURE__ */ m(U, { ...r }),
3311
+ /* @__PURE__ */ m("p", { ...s, children: e }),
3312
+ t && /* @__PURE__ */ m(ht, { showTooltips: !1, showText: !0, ...t })
3186
3313
  ] });
3187
3314
  };
3188
3315
  export {
3189
3316
  de as APIClient,
3190
- pr as Action,
3191
- gr as Actions,
3192
- br as ActionsDropdown,
3193
- z as AppIconButton,
3194
- Ot as AuthClient,
3317
+ An as Action,
3318
+ xn as Actions,
3319
+ $n as ActionsDropdown,
3320
+ W as AppIconButton,
3321
+ jt as AuthClient,
3195
3322
  me as AuthContext,
3196
- js as AuthProvider,
3197
- Ds as BaseClient,
3198
- yr as Button,
3199
- Bs as ConfigProvider,
3200
- As as ConfirmationDialog,
3323
+ Gs as AuthProvider,
3324
+ Fs as BaseClient,
3325
+ tn as BottomNavActionProvider,
3326
+ Tn as BottomNavigation,
3327
+ Dn as Button,
3328
+ Zs as ConfigProvider,
3329
+ Ps as ConfirmationDialog,
3201
3330
  ye as Dialog,
3202
3331
  we as DialogActions,
3203
- Gs as Drawer,
3204
- qe as DrawerMenuContext,
3205
- Vs as DrawerMenuProvider,
3206
- ds as Empty,
3207
- nr as Error,
3208
- Es as FormContainer,
3209
- Ns as FormDialog,
3210
- J as GlobalActions,
3211
- $s as IManager,
3212
- z as IconButton,
3213
- xs as ImportDialog,
3214
- Ls as IndexedDBClient,
3215
- Ks as ManagerProvider,
3216
- P as Methods,
3217
- cr as Navbar,
3218
- Ge as NavbarContext,
3219
- ar as NavbarProvider,
3220
- lr as Notification,
3221
- O as NotificationEnumType,
3222
- Fs as NotificationProvider,
3223
- dr as Onboarding,
3224
- or as Page,
3225
- vs as ParagraphInput,
3226
- ks as PasswordInput,
3227
- ir as PrettyGrid,
3228
- ur as SplashScreen,
3229
- us as Step,
3230
- qs as SupabaseAuthProvider,
3231
- Rs as SupabaseDataClient,
3232
- je as SupabaseManagerContext,
3233
- Hs as SupabaseManagerProvider,
3234
- cs as Tab,
3235
- ls as TabsLayout,
3236
- rr as ToTop,
3237
- Pt as buildQueryUrl,
3332
+ nn as Drawer,
3333
+ He as DrawerMenuContext,
3334
+ en as DrawerMenuProvider,
3335
+ ws as Empty,
3336
+ pn as Error,
3337
+ Rs as FormContainer,
3338
+ _s as FormDialog,
3339
+ Y as GlobalActions,
3340
+ Ms as IManager,
3341
+ W as IconButton,
3342
+ Os as ImportDialog,
3343
+ Us as IndexedDBClient,
3344
+ Ws as ManagerProvider,
3345
+ M as Methods,
3346
+ wn as Navbar,
3347
+ Je as NavbarContext,
3348
+ yn as NavbarProvider,
3349
+ Sn as Notification,
3350
+ F as NotificationEnumType,
3351
+ Vs as NotificationProvider,
3352
+ Cn as Onboarding,
3353
+ gn as Page,
3354
+ Ls as ParagraphInput,
3355
+ Is as PasswordInput,
3356
+ bn as PrettyGrid,
3357
+ vn as SplashScreen,
3358
+ gs as Step,
3359
+ Ys as SupabaseAuthProvider,
3360
+ Ks as SupabaseDataClient,
3361
+ Qe as SupabaseManagerContext,
3362
+ Xs as SupabaseManagerProvider,
3363
+ fs as Tab,
3364
+ ps as TabsLayout,
3365
+ fn as ToTop,
3366
+ Ut as buildQueryUrl,
3238
3367
  Ce as createQueryClient,
3239
- Is as enumToKeyValueArray,
3240
- Ms as formatForDatetimeLocal,
3241
- G as fromLocal,
3242
- _s as getFormattedDateTime,
3243
- Ps as getShortFormattedDateTime,
3244
- Te as isHttpError,
3245
- Ht as isMac,
3368
+ js as enumToKeyValueArray,
3369
+ Hs as formatForDatetimeLocal,
3370
+ z as fromLocal,
3371
+ Qs as getFormattedDateTime,
3372
+ Bs as getShortFormattedDateTime,
3373
+ ve as isHttpError,
3374
+ Wt as isMac,
3246
3375
  Se as isValidationError,
3247
3376
  he as makeRequest,
3248
3377
  ke as mapSupabaseSessionToSessionDto,
3249
- Os as mapValidationErrors,
3250
- Oe as parseQueries,
3251
- Us as queryClient,
3378
+ qs as mapValidationErrors,
3379
+ Fe as parseQueries,
3380
+ zs as queryClient,
3252
3381
  I as removeFromLocal,
3253
- Q as toLocal,
3254
- Qs as useAuth,
3255
- Vt as useAuthContext,
3256
- ce as useConfig,
3257
- He as useConfirmationForm,
3258
- Xt as useDeleteAction,
3259
- Ys as useDeleteDialog,
3260
- Be as useDialog,
3261
- zt as useDrawerMenu,
3262
- Js as useEditAction,
3263
- es as useExportAction,
3264
- sr as useExportActionMutate,
3265
- Ve as useFormDialog,
3266
- ts as useImportAction,
3267
- tr as useImportDialog,
3268
- Bt as useManager,
3269
- ns as useNavbar,
3382
+ H as toLocal,
3383
+ Js as useAuth,
3384
+ Jt as useAuthContext,
3385
+ ts as useBottomNavAction,
3386
+ ie as useConfig,
3387
+ ze as useConfirmationForm,
3388
+ rs as useDeleteAction,
3389
+ cn as useDeleteDialog,
3390
+ We as useDialog,
3391
+ Zt as useDrawerMenu,
3392
+ an as useEditAction,
3393
+ is as useExportAction,
3394
+ hn as useExportActionMutate,
3395
+ Ge as useFormDialog,
3396
+ as as useImportAction,
3397
+ mn as useImportDialog,
3398
+ Gt as useManager,
3399
+ us as useNavbar,
3270
3400
  oe as useNotification,
3271
- Ke as useOptionalAuthContext,
3272
- Xs as usePostDialog,
3273
- zs as usePostForm,
3274
- Zs as usePutDialog,
3275
- Zt as useRestoreAction,
3276
- er as useRestoreDialog,
3277
- ss as useScrollTrigger,
3278
- Gt as useSupabase,
3279
- Ws as useTimeAge
3401
+ je as useOptionalAuthContext,
3402
+ Ve as useOptionalBottomNavAction,
3403
+ ln as usePostDialog,
3404
+ on as usePostForm,
3405
+ un as usePutDialog,
3406
+ sn as useRegisterBottomNavAction,
3407
+ os as useRestoreAction,
3408
+ dn as useRestoreDialog,
3409
+ cs as useScrollTrigger,
3410
+ Yt as useSupabase,
3411
+ rn as useTimeAge
3280
3412
  };