prometeo-design-system 4.3.0 → 4.3.1

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 (59) hide show
  1. package/dist/Avatar.es.js +41 -40
  2. package/dist/CardProfile-C1F83KJV.js +280 -0
  3. package/dist/CardProfile.es.js +3 -291
  4. package/dist/CheckBox.es.js +21 -24
  5. package/dist/DialogModal.es.js +46 -52
  6. package/dist/Icons/UserAvatar.es.js +4 -4
  7. package/dist/Input.es.js +72 -73
  8. package/dist/NotificationCard.es.js +21 -28
  9. package/dist/PlainTooltip.es.js +19 -19
  10. package/dist/PyrionLayout.es.js +810 -916
  11. package/dist/Scrollable.es.js +177 -322
  12. package/dist/Select.es.js +47 -47
  13. package/dist/SelectSearch.es.js +103 -107
  14. package/dist/TabLinks.es.js +121 -2
  15. package/dist/TicketCard.es.js +2 -2
  16. package/dist/Toast.es.js +51 -95
  17. package/dist/badge-CbqYNrl4.js +87 -0
  18. package/dist/components/Avatar/Avatar.d.ts +4 -2
  19. package/dist/components/CardProfile/CardProfile.d.ts +4 -7
  20. package/dist/components/DropZone/useFileDropzone.d.ts +1 -9
  21. package/dist/components/Layout/LayoutGeneric.d.ts +6 -0
  22. package/dist/components/NotificationCard/NotificationCard.d.ts +2 -3
  23. package/dist/components/PyrionNavigationDrawer/PLNotificationsList.d.ts +2 -5
  24. package/dist/components/PyrionNavigationDrawer/PLSidebar.d.ts +1 -3
  25. package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +0 -2
  26. package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +0 -2
  27. package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +1 -4
  28. package/dist/components/Scrollable/Scrollable.d.ts +0 -29
  29. package/dist/components/Sidebar/SecondaryBar/SecondaryBar.d.ts +32 -0
  30. package/dist/components/Sidebar/SecondaryBar/hooks/useSecondaryBarAnimation.d.ts +2 -0
  31. package/dist/components/Sidebar/SecondaryBar/index.d.ts +1 -0
  32. package/dist/components/Sidebar/SidebarComposable.d.ts +43 -0
  33. package/dist/components/Sidebar/components/NavigationLink.d.ts +11 -0
  34. package/dist/components/Sidebar/components/company-logo.d.ts +5 -0
  35. package/dist/components/Sidebar/components/nav-actions.d.ts +7 -0
  36. package/dist/components/Sidebar/components/nav-links.d.ts +7 -0
  37. package/dist/components/Sidebar/context/SidebarContext.d.ts +13 -0
  38. package/dist/components/Sidebar/hooks/SidebarProvider.d.ts +3 -0
  39. package/dist/components/Sidebar/hooks/useNavBarActions.d.ts +9 -0
  40. package/dist/components/Sidebar/hooks/useNavBarCollapse.d.ts +4 -0
  41. package/dist/components/Sidebar/hooks/useNavLinks.d.ts +32 -0
  42. package/dist/components/Sidebar/hooks/useSidebarHook.d.ts +13 -0
  43. package/dist/components/Sidebar/index.d.ts +12 -0
  44. package/dist/components/Sidebar/ui/useNavbarAnimation.d.ts +2 -0
  45. package/dist/components/TabLinks/TabLinks.d.ts +0 -19
  46. package/dist/components/Toaster/Toaster.d.ts +1 -13
  47. package/dist/components/UserCard/UserCard.d.ts +2 -3
  48. package/dist/hooks/useLabelBackground.d.ts +0 -1
  49. package/dist/index.d.ts +16 -0
  50. package/dist/prometeo-design-system.es.js +2906 -119
  51. package/dist/styles.css +1 -1
  52. package/dist/useLabelBackground-BDIHUdND.js +26 -0
  53. package/package.json +2 -2
  54. package/dist/TabLinks-DxqprStp.js +0 -147
  55. package/dist/UserCard.d.ts +0 -6
  56. package/dist/UserCard.es.js +0 -28
  57. package/dist/badge-BEx-0Q-K.js +0 -35
  58. package/dist/exports/UserCard.d.ts +0 -2
  59. package/dist/useLabelBackground-D5SzHhl_.js +0 -32
@@ -1,440 +1,389 @@
1
1
  import { j as e } from "./jsx-runtime-GkKLlHH4.js";
2
- import { u as qe, g as bt } from "./useDevice-vwn4GLwK.js";
3
- import { c as T } from "./cn-B6yFEsav.js";
4
- import { g as we } from "./utils-X4-h3cum.js";
5
- import Ue, { forwardRef as me, useState as X, useRef as A, useEffect as Q, memo as B, useContext as $e, createContext as Ie, useCallback as h, Children as ht, isValidElement as Ne, useMemo as ue, useImperativeHandle as Ee, useLayoutEffect as xt, use as gt } from "react";
6
- import { createPortal as He } from "react-dom";
7
- import { useLocation as vt, useNavigate as wt } from "react-router";
8
- import { CloseNavBarDesktop as Nt } from "./Icons/CloseNavBarDesktop.es.js";
9
- import { c as Pe } from "./index-BOQuZ0gG.js";
10
- import { B as Ke } from "./badge-BEx-0Q-K.js";
11
- import yt from "./PlainTooltip.es.js";
12
- import { CrevronLeft as Ct } from "./Icons/CrevronLeft.es.js";
13
- import { Scrollable as pe } from "./Scrollable.es.js";
14
- import se from "./TicketCard.es.js";
15
- import Ye from "./UserCard.es.js";
2
+ import { u as We, g as ft } from "./useDevice-vwn4GLwK.js";
3
+ import { g as xe } from "./utils-X4-h3cum.js";
4
+ import Ue, { memo as T, forwardRef as Ne, useState as Z, useEffect as X, useContext as $e, createContext as Le, useRef as I, useCallback as x, Children as mt, isValidElement as ge, useMemo as ue, useImperativeHandle as Oe, use as pt } from "react";
5
+ import { createPortal as ze } from "react-dom";
6
+ import { useLocation as ht, useNavigate as bt } from "react-router";
7
+ import { B as xt, T as gt } from "./badge-CbqYNrl4.js";
8
+ import { c as A } from "./cn-B6yFEsav.js";
9
+ import { CloseNavBarDesktop as vt } from "./Icons/CloseNavBarDesktop.es.js";
10
+ import { c as Te } from "./index-BOQuZ0gG.js";
11
+ import wt from "./PlainTooltip.es.js";
12
+ import { CrevronLeft as Nt } from "./Icons/CrevronLeft.es.js";
13
+ import { Scrollable as ye } from "./Scrollable.es.js";
14
+ import ee from "./TicketCard.es.js";
15
+ import yt from "./Avatar.es.js";
16
16
  import fe from "./Button.es.js";
17
- import { Logout as St } from "./Icons/Logout.es.js";
17
+ import { Logout as Ct } from "./Icons/Logout.es.js";
18
18
  import jt from "./NotificationCard.es.js";
19
- import { T as kt, a as Dt } from "./TabLinks-DxqprStp.js";
20
- import { Notifications as Xe } from "./Icons/Notifications.es.js";
21
- import { Close as _e } from "./Icons/Close.es.js";
22
- import { Help as Je } from "./Icons/Help.es.js";
23
- import { Settings as Lt } from "./Icons/Settings.es.js";
24
- const Tt = me((t, r) => {
25
- const [s, o] = X(t?.currentTabName || t.tabs[0].name), d = A(null), { tabs: a = [], className: f, activeColor: m = "var(--neutral-900)", currentSystemId: u } = t;
26
- Q(() => {
27
- d.current?.style.setProperty("--tab-bg", m);
28
- }, [m]);
29
- const b = a.find((i) => i.id === u || i.name === (t?.currentTabName || s));
30
- return /* @__PURE__ */ e.jsx(
31
- "div",
32
- {
33
- ref: r,
34
- className: T(
35
- "select-none",
36
- "flex flex-col gap-2",
37
- "bg-neutral-strong-default",
38
- "h-full w-14 max-w-14 pl-[6px] py-6",
39
- "border-r border-neutral-default-default",
40
- f
41
- ),
42
- children: a.map(
43
- (i) => {
44
- const g = i.name === b?.name, x = typeof i.thumbnail == "string" ? /* @__PURE__ */ e.jsx("img", { src: i.thumbnail, alt: i.description, className: "aspect-square object-contain rounded", draggable: !1 }) : i.thumbnail, j = () => {
45
- i.disabled || (o(i.name), i.onClick && i.onClick(i.name));
46
- };
47
- return /* @__PURE__ */ e.jsx(
48
- "div",
49
- {
50
- className: T(
51
- "bg-[(--tab-bg)]",
52
- "h-12 w-[50px] z-20",
53
- "flex items-center pl-[6px] ",
54
- "rounded-l-[8px]",
55
- "tabswitch-element relative",
56
- g && "active"
57
- ),
58
- onClick: j,
59
- ref: d,
60
- children: /* @__PURE__ */ e.jsx("div", { className: T(
61
- "size-8 rounded-[4px]",
62
- "grid place-items-center",
63
- "tab-thumbnail-icon",
64
- "bg-transparent text-neutral-default-default",
65
- i?.className
66
- ), children: x })
67
- },
68
- i.name
69
- );
70
- }
71
- )
72
- }
73
- );
74
- }), Ge = B(me(({ children: t, className: r, context: s, modal: o = !1, closeOnOverlayClick: d = !1, unmountChildrenOnClose: a = !0 }, f) => {
75
- const m = be(t, s), u = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: b } = At(), { closeSidebar: i } = ce(), [g, x] = X(() => a ? b : !0), [j, L] = X(!1);
76
- return Q(() => {
77
- a && s?.subscribeToSidebarOpen((y) => {
78
- y ? (L(!1), x(!0)) : L(!0);
19
+ import { Notifications as qe } from "./Icons/Notifications.es.js";
20
+ import { Close as Ie } from "./Icons/Close.es.js";
21
+ import { Help as Ke } from "./Icons/Help.es.js";
22
+ import { Settings as St } from "./Icons/Settings.es.js";
23
+ const Ye = T(Ne(({ children: t, className: r, context: s, modal: l = !1, closeOnOverlayClick: i = !1, unmountChildrenOnClose: n = !0 }, c) => {
24
+ const m = me(t, s), d = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: h } = kt(), { closeSidebar: b } = ie(), [w, u] = Z(() => n ? h : !0), [N, y] = Z(!1);
25
+ return X(() => {
26
+ n && s?.subscribeToSidebarOpen((f) => {
27
+ f ? (y(!1), u(!0)) : y(!0);
79
28
  });
80
- }, [a, s]), Q(() => {
81
- const y = f && typeof f == "object" && "current" in f ? f.current : null;
82
- if (!y) return;
83
- const N = () => {
84
- j && (x(!1), L(!1));
29
+ }, [n, s]), X(() => {
30
+ const f = c && typeof c == "object" && "current" in c ? c.current : null;
31
+ if (!f) return;
32
+ const F = () => {
33
+ N && (u(!1), y(!1));
85
34
  };
86
- return y.addEventListener("transitionend", N), () => y.removeEventListener("transitionend", N);
87
- }, [j]), /* @__PURE__ */ e.jsxs("div", { ref: f, className: T("sidebar", u ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": o || void 0, children: [
88
- o && u && /* @__PURE__ */ e.jsx(
35
+ return f.addEventListener("transitionend", F), () => f.removeEventListener("transitionend", F);
36
+ }, [N]), /* @__PURE__ */ e.jsxs("div", { ref: c, className: A("sidebar", d ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": l || void 0, children: [
37
+ l && d && /* @__PURE__ */ e.jsx(
89
38
  "div",
90
39
  {
91
- className: T("navigation-drawer-sidebar-overlay"),
92
- onClick: (y) => {
93
- y.preventDefault(), y.stopPropagation(), d && i?.();
40
+ className: A("navigation-drawer-sidebar-overlay"),
41
+ onClick: (f) => {
42
+ f.preventDefault(), f.stopPropagation(), i && b?.();
94
43
  },
95
44
  "aria-hidden": "true"
96
45
  }
97
46
  ),
98
- /* @__PURE__ */ e.jsxs("div", { className: T("navigation-drawer-sidebar-inner"), children: [
47
+ /* @__PURE__ */ e.jsxs("div", { className: A("navigation-drawer-sidebar-inner"), children: [
99
48
  /* @__PURE__ */ e.jsx("div", { className: "secure-click-margin" }),
100
- g && m
49
+ w && m
101
50
  ] })
102
51
  ] });
103
- })), Qe = Ie(null), Ze = Ie(null), At = () => {
104
- const t = $e(Qe);
52
+ })), Xe = Le(null), Je = Le(null), kt = () => {
53
+ const t = $e(Xe);
105
54
  if (!t) throw new Error("useDrawerState must be used within NavigationDrawer");
106
55
  return t;
107
- }, ce = () => {
108
- const t = $e(Ze);
56
+ }, ie = () => {
57
+ const t = $e(Je);
109
58
  if (!t) throw new Error("useDrawerActions must be used within NavigationDrawer");
110
59
  return t;
111
- }, be = (t, r) => typeof t == "function" ? r ? t(r) : null : t, et = "navigation-drawer-collapsed", Ve = () => {
60
+ }, me = (t, r) => typeof t == "function" ? r ? t(r) : null : t, Ge = "navigation-drawer-collapsed", He = () => {
112
61
  if (typeof window > "u") return !1;
113
62
  try {
114
- const t = sessionStorage.getItem(et);
63
+ const t = sessionStorage.getItem(Ge);
115
64
  return t ? JSON.parse(t) : !1;
116
65
  } catch {
117
66
  return !1;
118
67
  }
119
- }, Ot = (t) => {
68
+ }, Dt = (t) => {
120
69
  if (!(typeof window > "u"))
121
70
  try {
122
- sessionStorage.setItem(et, JSON.stringify(t));
71
+ sessionStorage.setItem(Ge, JSON.stringify(t));
123
72
  } catch {
124
73
  }
125
- }, It = (t) => {
126
- const { children: r, classNameDrawer: s, classNameSidebar: o, disableDragOpen: d } = t, a = A(null), f = A(null), m = t.outletRef ?? A(null), u = A(null), b = A(Ve()), i = A(!1), g = A("drawer"), x = A(/* @__PURE__ */ new Set()), j = A(/* @__PURE__ */ new Set()), L = A(!1), y = A(null), N = h((n) => {
127
- const p = f.current;
128
- p && (p.classList.toggle("collapsed", n), p.classList.toggle("expanded", !n));
129
- }, []), k = h((n) => {
130
- const p = u.current;
74
+ }, At = (t) => {
75
+ const { children: r, classNameDrawer: s, classNameSidebar: l, disableDragOpen: i } = t, n = I(null), c = I(null), m = t.outletRef ?? I(null), d = I(null), h = I(He()), b = I(!1), w = I("drawer"), u = I(/* @__PURE__ */ new Set()), N = I(/* @__PURE__ */ new Set()), y = I(!1), f = I(null), F = x((o) => {
76
+ const p = c.current;
77
+ p && (p.classList.toggle("collapsed", o), p.classList.toggle("expanded", !o));
78
+ }, []), D = x((o) => {
79
+ const p = d.current;
131
80
  if (!p) return;
132
- p.classList.toggle("collapsed", n), p.classList.toggle("expanded", !n);
133
- const v = a.current;
134
- v && (v.classList.toggle("sidebar-collapsed", n), v.classList.toggle("sidebar-expanded", !n));
135
- }, []), P = h(
136
- (n, { notify: p = !0 } = {}) => {
137
- const v = b.current !== n;
138
- b.current = n, Ot(n), N(n), p && v && x.current.forEach((E) => E(n));
81
+ p.classList.toggle("collapsed", o), p.classList.toggle("expanded", !o);
82
+ const g = n.current;
83
+ g && (g.classList.toggle("sidebar-collapsed", o), g.classList.toggle("sidebar-expanded", !o));
84
+ }, []), P = x(
85
+ (o, { notify: p = !0 } = {}) => {
86
+ const g = h.current !== o;
87
+ h.current = o, Dt(o), F(o), p && g && u.current.forEach((L) => L(o));
139
88
  },
140
- [N]
141
- ), z = h(
142
- (n, { notify: p = !0 } = {}) => {
143
- const v = i.current !== n;
144
- if (i.current = n, k(n), p && v) {
145
- const E = !n;
146
- j.current.forEach((W) => W(E));
89
+ [F]
90
+ ), R = x(
91
+ (o, { notify: p = !0 } = {}) => {
92
+ const g = b.current !== o;
93
+ if (b.current = o, D(o), p && g) {
94
+ const L = !o;
95
+ N.current.forEach((B) => B(L));
147
96
  }
148
97
  },
149
- [k]
150
- ), C = h(
151
- (n, { notify: p = !0 } = {}) => {
152
- const v = g.current, E = v !== n;
153
- g.current = n, window.matchMedia("(min-width: 768px)").matches || P(n !== "drawer", { notify: p });
154
- const W = v === "sidebar", V = n === "sidebar";
155
- p && E && W !== V && j.current.forEach((Y) => Y(V)), z(n !== "sidebar", { notify: p }), P(n !== "drawer", { notify: p });
98
+ [D]
99
+ ), k = x(
100
+ (o, { notify: p = !0 } = {}) => {
101
+ const g = w.current, L = g !== o;
102
+ w.current = o, window.matchMedia("(min-width: 768px)").matches || P(o !== "drawer", { notify: p });
103
+ const B = g === "sidebar", _ = o === "sidebar";
104
+ p && L && B !== _ && N.current.forEach((Q) => Q(_)), R(o !== "sidebar", { notify: p }), P(o !== "drawer", { notify: p });
156
105
  },
157
- [P, z]
158
- ), H = h((n) => {
159
- const p = a.current;
106
+ [P, R]
107
+ ), j = x((o) => {
108
+ const p = n.current;
160
109
  if (!p || window.matchMedia("(min-width: 768px)").matches) return;
161
- L.current = !0;
162
- const v = m.current?.offsetLeft ?? 0, E = u.current?.offsetLeft ?? v, W = n === "drawer" ? 0 : n === "sidebar" ? E : v;
163
- y.current = W, p.scrollTo({ left: W, behavior: "smooth" });
164
- const V = () => {
165
- L.current = !1, y.current = null, p.removeEventListener("scrollend", V);
110
+ y.current = !0;
111
+ const g = m.current?.offsetLeft ?? 0, L = d.current?.offsetLeft ?? g, B = o === "drawer" ? 0 : o === "sidebar" ? L : g;
112
+ f.current = B, p.scrollTo({ left: B, behavior: "smooth" });
113
+ const _ = () => {
114
+ y.current = !1, f.current = null, p.removeEventListener("scrollend", _);
166
115
  };
167
- p.addEventListener("scrollend", V, { once: !0 }), setTimeout(() => {
168
- L.current && V();
116
+ p.addEventListener("scrollend", _, { once: !0 }), setTimeout(() => {
117
+ y.current && _();
169
118
  }, 1e3);
170
- }, []), c = h(() => {
171
- const n = a.current, p = m.current;
172
- if (!n || !p || window.matchMedia("(min-width: 768px)").matches) return;
173
- const v = [
119
+ }, []), K = x(() => {
120
+ const o = n.current, p = m.current;
121
+ if (!o || !p || window.matchMedia("(min-width: 768px)").matches) return;
122
+ const g = [
174
123
  { panel: "drawer", offset: 0 },
175
124
  { panel: "outlet", offset: p.offsetLeft }
176
- ], E = u.current;
177
- E && v.push({ panel: "sidebar", offset: E.offsetLeft });
178
- const W = n.scrollLeft;
179
- let V = v[0], Y = Math.abs(W - V.offset);
180
- for (let ee = 1; ee < v.length; ee++) {
181
- const te = Math.abs(W - v[ee].offset);
182
- te < Y && (V = v[ee], Y = te);
125
+ ], L = d.current;
126
+ L && g.push({ panel: "sidebar", offset: L.offsetLeft });
127
+ const B = o.scrollLeft;
128
+ let _ = g[0], Q = Math.abs(B - _.offset);
129
+ for (let $ = 1; $ < g.length; $++) {
130
+ const le = Math.abs(B - g[$].offset);
131
+ le < Q && (_ = g[$], Q = le);
183
132
  }
184
- C(V.panel);
185
- }, [C]);
186
- Q(() => {
187
- const n = a.current;
188
- n && (d?.drawer && n.classList.add("disabled-dragopen"), d?.sidebar && n.classList.add("disabled-dragopen-sidebar"));
189
- }, [d, a]), Q(() => {
190
- const n = a.current, p = m.current;
191
- if (!n || !p) return;
133
+ k(_.panel);
134
+ }, [k]);
135
+ X(() => {
136
+ const o = n.current;
137
+ o && (i?.drawer && o.classList.add("disabled-dragopen"), i?.sidebar && o.classList.add("disabled-dragopen-sidebar"));
138
+ }, [i, n]), X(() => {
139
+ const o = n.current, p = m.current;
140
+ if (!o || !p) return;
192
141
  if (window.matchMedia("(min-width: 768px)").matches) {
193
- const E = Ve();
194
- P(E, { notify: !1 }), z(!0, { notify: !1 });
142
+ const L = He();
143
+ P(L, { notify: !1 }), R(!0, { notify: !1 });
195
144
  return;
196
145
  }
197
146
  requestAnimationFrame(() => {
198
- n.scrollLeft = p.offsetLeft, C("outlet");
147
+ o.scrollLeft = p.offsetLeft, k("outlet");
199
148
  });
200
- }, [C, P, z]), Q(() => {
201
- const n = a.current;
202
- if (!n || !m.current) return;
203
- let v = !1, E = 0, W = 0;
204
- const V = (D) => {
205
- E = D.touches[0].clientX, W = D.touches[0].clientY;
206
- }, Y = (D, q) => {
207
- const U = window.getComputedStyle(D), re = q === "x" ? U.overflowX : U.overflowY;
208
- return /(auto|scroll|overlay)/.test(re) ? q === "x" ? D.scrollWidth > D.clientWidth : D.scrollHeight > D.clientHeight : !1;
209
- }, ee = (D, q) => {
210
- let U = D;
211
- for (; U && U !== n; ) {
212
- if (Y(U, q))
213
- return U;
214
- U = U.parentElement;
149
+ }, [k, P, R]), X(() => {
150
+ const o = n.current;
151
+ if (!o || !m.current) return;
152
+ let g = !1, L = 0, B = 0;
153
+ const _ = (S) => {
154
+ L = S.touches[0].clientX, B = S.touches[0].clientY;
155
+ }, Q = (S, U) => {
156
+ const a = window.getComputedStyle(S), v = U === "x" ? a.overflowX : a.overflowY;
157
+ return /(auto|scroll|overlay)/.test(v) ? U === "x" ? S.scrollWidth > S.clientWidth : S.scrollHeight > S.clientHeight : !1;
158
+ }, $ = (S, U) => {
159
+ let a = S;
160
+ for (; a && a !== o; ) {
161
+ if (Q(a, U))
162
+ return a;
163
+ a = a.parentElement;
215
164
  }
216
165
  return null;
217
- }, te = (D, q, U) => U === 0 ? !1 : q === "x" ? U < 0 ? D.scrollLeft + D.clientWidth < D.scrollWidth : D.scrollLeft > 0 : U < 0 ? D.scrollTop + D.clientHeight < D.scrollHeight : D.scrollTop > 0, ge = (D) => {
218
- if (!(D.target instanceof HTMLElement)) return;
219
- const q = D.touches[0].clientX - E, U = D.touches[0].clientY - W, re = Math.abs(q) > Math.abs(U) ? "x" : "y", De = re === "x" ? q : U, l = ee(D.target, re);
220
- if (l && te(l, re, De))
166
+ }, le = (S, U, a) => a === 0 ? !1 : U === "x" ? a < 0 ? S.scrollLeft + S.clientWidth < S.scrollWidth : S.scrollLeft > 0 : a < 0 ? S.scrollTop + S.clientHeight < S.scrollHeight : S.scrollTop > 0, he = (S) => {
167
+ if (!(S.target instanceof HTMLElement)) return;
168
+ const U = S.touches[0].clientX - L, a = S.touches[0].clientY - B, v = Math.abs(U) > Math.abs(a) ? "x" : "y", O = v === "x" ? U : a, C = $(S.target, v);
169
+ if (C && le(C, v, O))
221
170
  return;
222
- const w = n.classList.contains("disabled-dragopen"), O = n.classList.contains("disabled-dragopen-sidebar"), S = () => D.cancelable ? (D.preventDefault(), !0) : !1;
223
- if (re === "x") {
224
- if (q > 0) {
225
- if (g.current === "sidebar" && !O) {
226
- v = !0;
171
+ const z = o.classList.contains("disabled-dragopen"), de = o.classList.contains("disabled-dragopen-sidebar"), Fe = () => S.cancelable ? (S.preventDefault(), !0) : !1;
172
+ if (v === "x") {
173
+ if (U > 0) {
174
+ if (w.current === "sidebar" && !de) {
175
+ g = !0;
227
176
  return;
228
177
  }
229
- if (w) {
230
- S();
178
+ if (z) {
179
+ Fe();
231
180
  return;
232
181
  }
233
- } else if (q < 0) {
234
- if (g.current === "drawer" && !w) {
235
- v = !0;
182
+ } else if (U < 0) {
183
+ if (w.current === "drawer" && !z) {
184
+ g = !0;
236
185
  return;
237
186
  }
238
- if (O) {
239
- S();
187
+ if (de) {
188
+ Fe();
240
189
  return;
241
190
  }
242
191
  }
243
- v = !0;
192
+ g = !0;
244
193
  }
245
- }, ve = () => {
194
+ }, be = () => {
246
195
  setTimeout(() => {
247
- v && (c(), v = !1);
196
+ g && (K(), g = !1);
248
197
  }, 100);
249
198
  };
250
- return n.addEventListener("touchstart", V, { passive: !0 }), n.addEventListener("touchmove", ge, { passive: !1 }), n.addEventListener("touchend", ve), () => {
251
- n.removeEventListener("touchstart", V), n.removeEventListener("touchmove", ge), n.removeEventListener("touchend", ve);
199
+ return o.addEventListener("touchstart", _, { passive: !0 }), o.addEventListener("touchmove", he, { passive: !1 }), o.addEventListener("touchend", be), () => {
200
+ o.removeEventListener("touchstart", _), o.removeEventListener("touchmove", he), o.removeEventListener("touchend", be);
252
201
  };
253
- }, [c]);
254
- const _ = h(() => {
255
- const n = window.matchMedia("(min-width: 768px)").matches, p = !b.current;
256
- if (n) {
202
+ }, [K]);
203
+ const Y = x(() => {
204
+ const o = window.matchMedia("(min-width: 768px)").matches, p = !h.current;
205
+ if (o) {
257
206
  P(p);
258
207
  return;
259
208
  }
260
- const v = p ? "outlet" : "drawer";
261
- C(v), H(v);
262
- }, [H, C, P]), M = A(null);
263
- M.current || (M.current = {
264
- toggleCollapse: () => _(),
265
- getIsCollapsed: () => b.current,
266
- subscribeToCollapse: (n) => (x.current.add(n), () => {
267
- x.current.delete(n);
209
+ const g = p ? "outlet" : "drawer";
210
+ k(g), j(g);
211
+ }, [j, k, P]), J = I(null);
212
+ J.current || (J.current = {
213
+ toggleCollapse: () => Y(),
214
+ getIsCollapsed: () => h.current,
215
+ subscribeToCollapse: (o) => (u.current.add(o), () => {
216
+ u.current.delete(o);
268
217
  }),
269
218
  openSidebar: () => {
270
- if (u.current) {
219
+ if (d.current) {
271
220
  if (window.matchMedia("(min-width: 768px)").matches) {
272
- z(!1);
221
+ R(!1);
273
222
  return;
274
223
  }
275
- C("sidebar"), H("sidebar");
224
+ k("sidebar"), j("sidebar");
276
225
  }
277
226
  },
278
227
  closeSidebar: () => {
279
228
  if (window.matchMedia("(min-width: 768px)").matches) {
280
- z(!0);
229
+ R(!0);
281
230
  return;
282
231
  }
283
- C("outlet"), H("outlet");
232
+ k("outlet"), j("outlet");
284
233
  },
285
234
  toggleSidebar: () => {
286
- if (!u.current) return;
235
+ if (!d.current) return;
287
236
  if (window.matchMedia("(min-width: 768px)").matches) {
288
- z(!i.current);
237
+ R(!b.current);
289
238
  return;
290
239
  }
291
- const n = g.current === "sidebar" ? "outlet" : "sidebar";
292
- C(n), H(n);
240
+ const o = w.current === "sidebar" ? "outlet" : "sidebar";
241
+ k(o), j(o);
293
242
  },
294
- getIsSidebarOpen: () => u.current ? window.matchMedia("(min-width: 768px)").matches ? !i.current : g.current === "sidebar" : !1,
295
- subscribeToSidebarOpen: (n) => (j.current.add(n), () => {
296
- j.current.delete(n);
243
+ getIsSidebarOpen: () => d.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current : w.current === "sidebar" : !1,
244
+ subscribeToSidebarOpen: (o) => (N.current.add(o), () => {
245
+ N.current.delete(o);
297
246
  }),
298
- setDrawerDragEnabled: (n) => {
299
- const p = a.current;
247
+ setDrawerDragEnabled: (o) => {
248
+ const p = n.current;
300
249
  if (!p) return;
301
- const v = p.scrollLeft;
302
- if (n) {
303
- const E = p.style.scrollBehavior;
250
+ const g = p.scrollLeft;
251
+ if (o) {
252
+ const L = p.style.scrollBehavior;
304
253
  p.style.scrollBehavior = "auto", p.classList.remove("disabled-dragopen"), requestAnimationFrame(() => {
305
- p.scrollLeft = v, requestAnimationFrame(() => {
306
- p.style.scrollBehavior = E;
254
+ p.scrollLeft = g, requestAnimationFrame(() => {
255
+ p.style.scrollBehavior = L;
307
256
  });
308
257
  });
309
258
  } else
310
259
  p.classList.add("disabled-dragopen");
311
260
  },
312
- setSidebarDragEnabled: (n) => {
313
- const p = a.current;
261
+ setSidebarDragEnabled: (o) => {
262
+ const p = n.current;
314
263
  if (p)
315
- if (n) {
316
- const v = p.scrollLeft, E = p.style.scrollBehavior;
264
+ if (o) {
265
+ const g = p.scrollLeft, L = p.style.scrollBehavior;
317
266
  p.style.scrollBehavior = "auto", p.classList.remove("disabled-dragopen-sidebar"), requestAnimationFrame(() => {
318
- p.scrollLeft = v, requestAnimationFrame(() => {
319
- p.style.scrollBehavior = E;
267
+ p.scrollLeft = g, requestAnimationFrame(() => {
268
+ p.style.scrollBehavior = L;
320
269
  });
321
270
  });
322
271
  } else
323
272
  p.classList.add("disabled-dragopen-sidebar");
324
273
  }
325
274
  });
326
- const F = M.current, K = typeof r == "function" ? r(F) : r, R = ht.toArray(K);
327
- let I = null, $ = null, ne = null;
328
- const J = [];
329
- let oe = null, le = null;
330
- R.forEach((n) => {
331
- if (!Ne(n)) {
332
- J.push(n);
275
+ const te = J.current, H = typeof r == "function" ? r(te) : r, M = mt.toArray(H);
276
+ let E = null, V = null, W = null;
277
+ const re = [];
278
+ let ne = null, se = null;
279
+ M.forEach((o) => {
280
+ if (!ge(o)) {
281
+ re.push(o);
333
282
  return;
334
283
  }
335
- if (n.type === Me && !I) {
336
- I = n;
284
+ if (o.type === Ee && !E) {
285
+ E = o;
337
286
  return;
338
287
  }
339
- if (n.type === ye && !$) {
340
- $ = n;
288
+ if (o.type === ve && !V) {
289
+ V = o;
341
290
  return;
342
291
  }
343
- if (n.type === Ce && !ne) {
344
- ne = n;
292
+ if (o.type === we && !W) {
293
+ W = o;
345
294
  return;
346
295
  }
347
- if (n.type === Te && !oe) {
348
- oe = n;
296
+ if (o.type === ke && !ne) {
297
+ ne = o;
349
298
  return;
350
299
  }
351
- if (n.type === Ge && !le) {
352
- le = n;
300
+ if (o.type === Ye && !se) {
301
+ se = o;
353
302
  return;
354
303
  }
355
- J.push(n);
304
+ re.push(o);
356
305
  });
357
- const he = !!$, de = $ ?? (J.length ? /* @__PURE__ */ e.jsx(ye, { children: J }) : null), Be = he ? J : [], ie = oe ?? (!!oe ? /* @__PURE__ */ e.jsx(Te, { children: K }) : null), je = ne ?? (!!ne ? /* @__PURE__ */ e.jsx(Ce, { children: ne }) : null), ke = !!le, ae = le, xe = ue(() => ({
358
- isCollapsed: b.current,
359
- isSidebarOpen: !i.current
360
- }), [b.current, i.current]);
361
- return /* @__PURE__ */ e.jsx(Qe.Provider, { value: xe, children: /* @__PURE__ */ e.jsx(Ze.Provider, { value: F, children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-container", ref: a, className: T(
306
+ const ce = !!V, Re = V ?? (re.length ? /* @__PURE__ */ e.jsx(ve, { children: re }) : null), pe = ce ? re : [], ae = ne ?? (!!ne ? /* @__PURE__ */ e.jsx(ke, { children: H }) : null), Ce = W ?? (!!W ? /* @__PURE__ */ e.jsx(we, { children: W }) : null), je = !!se, G = se, oe = ue(() => ({
307
+ isCollapsed: h.current,
308
+ isSidebarOpen: !b.current
309
+ }), [h.current, b.current]);
310
+ return /* @__PURE__ */ e.jsx(Xe.Provider, { value: oe, children: /* @__PURE__ */ e.jsx(Je.Provider, { value: te, children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-container", ref: n, className: A(
362
311
  "w-full h-full max-h-dvh overflow-y-hidden",
363
- ke ? "navigation-drawer-with-sidebar" : "navigation-drawer",
364
- d?.drawer ? "disabled-dragopen" : "",
365
- d?.sidebar ? "disabled-dragopen-sidebar" : ""
312
+ je ? "navigation-drawer-with-sidebar" : "navigation-drawer",
313
+ i?.drawer ? "disabled-dragopen" : "",
314
+ i?.sidebar ? "disabled-dragopen-sidebar" : ""
366
315
  ), children: [
367
316
  /* @__PURE__ */ e.jsxs(
368
317
  "div",
369
318
  {
370
- ref: f,
371
- className: T(
319
+ ref: c,
320
+ className: A(
372
321
  "bg-neutral-default-default border-r border-neutral-strong-default h-dvh md:h-screen p-4 overflow-hidden drawer flex flex-col gap-4",
373
- b.current ? "collapsed" : "expanded w-min",
322
+ h.current ? "collapsed" : "expanded w-min",
374
323
  s
375
324
  ),
376
325
  children: [
377
326
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 gap-4 overflow-hidden", children: [
378
327
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
379
- /* @__PURE__ */ e.jsx(tt, { onToggleCollapse: _ }),
380
- I
328
+ /* @__PURE__ */ e.jsx(Qe, { onToggleCollapse: Y }),
329
+ E
381
330
  ] }),
382
331
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-hidden relative flex-col", children: [
383
- Be,
384
- de
332
+ pe,
333
+ Re
385
334
  ] })
386
335
  ] }),
387
- je
336
+ Ce
388
337
  ]
389
338
  }
390
339
  ),
391
- ie && Ne(ie) ? Ue.cloneElement(ie, { ref: m }) : ie,
392
- ae && Ne(ae) ? Ue.cloneElement(ae, {
393
- ref: u,
394
- className: T("sidebar", ae.props?.className, o)
395
- }) : ae
340
+ ae && ge(ae) ? Ue.cloneElement(ae, { ref: m }) : ae,
341
+ G && ge(G) ? Ue.cloneElement(G, {
342
+ ref: d,
343
+ className: A("sidebar", G.props?.className, l)
344
+ }) : G
396
345
  ] }) }) });
397
- }, We = B(It), tt = B(({ onToggleCollapse: t }) => /* @__PURE__ */ e.jsx(
346
+ }, Ve = T(At), Qe = T(({ onToggleCollapse: t }) => /* @__PURE__ */ e.jsx(
398
347
  "button",
399
348
  {
400
349
  type: "button",
401
350
  onClick: t,
402
351
  className: "collapse-button cursor-pointer text-neutral-default-default hover:text-primary-default transition-colors duration-300 w-max",
403
- children: /* @__PURE__ */ e.jsx(Nt, { size: 32, className: "transition-transform duration-300 p-1" })
352
+ children: /* @__PURE__ */ e.jsx(vt, { size: 32, className: "transition-transform duration-300 p-1" })
404
353
  }
405
354
  ), (t, r) => t.onToggleCollapse === r.onToggleCollapse);
406
- tt.displayName = "NavigationDrawerCollapseButton";
407
- const Me = B(({ children: t, className: r, context: s }) => {
408
- const o = be(t, s);
409
- return /* @__PURE__ */ e.jsx("div", { className: T("flex items-center justify-between", r), children: o });
355
+ Qe.displayName = "NavigationDrawerCollapseButton";
356
+ const Ee = T(({ children: t, className: r, context: s }) => {
357
+ const l = me(t, s);
358
+ return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
410
359
  });
411
- Me.displayName = "NavigationDrawerHeader";
412
- const ye = B(({ children: t, className: r, context: s, ...o }) => {
413
- const d = be(t, s);
414
- return /* @__PURE__ */ e.jsx("div", { ...o, className: T("w-full flex-1 drawer-content", r), children: d });
360
+ Ee.displayName = "NavigationDrawerHeader";
361
+ const ve = T(({ children: t, className: r, context: s, ...l }) => {
362
+ const i = me(t, s);
363
+ return /* @__PURE__ */ e.jsx("div", { ...l, className: A("w-full flex-1 drawer-content", r), children: i });
415
364
  });
416
- ye.displayName = "NavigationDrawerContent";
417
- const Ce = B(({ children: t, className: r, context: s }) => {
418
- const o = be(t, s);
419
- return /* @__PURE__ */ e.jsx("div", { className: T("flex items-center justify-between", r), children: o });
365
+ ve.displayName = "NavigationDrawerContent";
366
+ const we = T(({ children: t, className: r, context: s }) => {
367
+ const l = me(t, s);
368
+ return /* @__PURE__ */ e.jsx("div", { className: A("flex items-center justify-between", r), children: l });
420
369
  });
421
- Ce.displayName = "NavigationDrawerFooter";
422
- const rt = B(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: T("w-full border-t border-neutral-strong-default ", t) }));
423
- rt.displayName = "NavigationDrawerSpacer";
424
- const Te = B(me(({ children: t, className: r, context: s }, o) => {
425
- const d = be(t, s);
426
- return /* @__PURE__ */ e.jsx("div", { id: "navigation-drawer-outlet", ref: o, className: T("flex-1 overflow-auto ", r), children: d });
427
- }), (t, r) => t.children === r.children && t.className === r.className), G = Object.assign(We, {
428
- Root: We,
429
- Header: Me,
430
- Content: ye,
431
- Footer: Ce,
432
- Spacer: rt,
433
- Outlet: Te,
434
- Sidebar: Ge
370
+ we.displayName = "NavigationDrawerFooter";
371
+ const Ze = T(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: A("w-full border-t border-neutral-strong-default ", t) }));
372
+ Ze.displayName = "NavigationDrawerSpacer";
373
+ const ke = T(Ne(({ children: t, className: r, context: s }, l) => {
374
+ const i = me(t, s);
375
+ return /* @__PURE__ */ e.jsx("div", { id: "navigation-drawer-outlet", ref: l, className: A("flex-1 overflow-auto ", r), children: i });
376
+ }), (t, r) => t.children === r.children && t.className === r.className), q = Object.assign(Ve, {
377
+ Root: Ve,
378
+ Header: Ee,
379
+ Content: ve,
380
+ Footer: we,
381
+ Spacer: Ze,
382
+ Outlet: ke,
383
+ Sidebar: Ye
435
384
  });
436
- G.displayName = "NavigationDrawer";
437
- const Et = "hover:bg-neutral-medium-hover", Pt = Pe("", {
385
+ q.displayName = "NavigationDrawer";
386
+ const Lt = "hover:bg-neutral-medium-hover", Ot = Te("", {
438
387
  variants: {
439
388
  isSelected: {
440
389
  true: "bg-neutral-medium-selected ",
@@ -445,8 +394,8 @@ const Et = "hover:bg-neutral-medium-hover", Pt = Pe("", {
445
394
  false: "cursor-pointer"
446
395
  }
447
396
  }
448
- }), _t = Pe(
449
- T(
397
+ }), Tt = Te(
398
+ A(
450
399
  "select-none line-clamp-1 min-w-max",
451
400
  "prometeo-fonts-label-large transition-colors duration-300 ease-out"
452
401
  ),
@@ -468,8 +417,8 @@ const Et = "hover:bg-neutral-medium-hover", Pt = Pe("", {
468
417
  { isSelected: !1, disabled: !1, className: " text-neutral-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" }
469
418
  ]
470
419
  }
471
- ), Le = Pe(
472
- T(
420
+ ), Se = Te(
421
+ A(
473
422
  "transition-colors duration-300 ease-out min-w-max"
474
423
  ),
475
424
  {
@@ -490,263 +439,263 @@ const Et = "hover:bg-neutral-medium-hover", Pt = Pe("", {
490
439
  { isSelected: !1, disabled: !1, className: "text-neutral-default-default group-active:text-neutral-default-pressed group-focus-visible:text-neutral-default-pressed" }
491
440
  ]
492
441
  }
493
- ), Mt = (t) => {
442
+ ), It = (t) => {
494
443
  const {
495
444
  title: r,
496
445
  icon: s,
497
- count: o,
498
- className: d,
499
- isSelected: a = !1,
500
- hasSublinks: f,
446
+ count: l,
447
+ className: i,
448
+ isSelected: n = !1,
449
+ hasSublinks: c,
501
450
  subLinksCollapsed: m,
502
- onToggleSublinks: u,
503
- as: b = "div",
504
- onClick: i,
505
- onAuxClick: g,
506
- disabled: x = !1,
507
- tooltipText: j
508
- } = t, L = (P) => {
509
- x || i?.(P);
510
- }, y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
451
+ onToggleSublinks: d,
452
+ as: h = "div",
453
+ onClick: b,
454
+ onAuxClick: w,
455
+ disabled: u = !1,
456
+ tooltipText: N
457
+ } = t, y = (P) => {
458
+ u || b?.(P);
459
+ }, f = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
511
460
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center flex-nowrap", children: [
512
- s && (j ? /* @__PURE__ */ e.jsx(yt, { title: j, disabled: x, children: /* @__PURE__ */ e.jsx(s, { size: 24, className: Le({ disabled: x, isSelected: a }) }) }) : /* @__PURE__ */ e.jsx(s, { size: 24, className: Le({ disabled: x, isSelected: a }) })),
513
- /* @__PURE__ */ e.jsx("label", { className: _t({ disabled: x, isSelected: a }), children: r })
461
+ s && (N ? /* @__PURE__ */ e.jsx(wt, { title: N, disabled: u, children: /* @__PURE__ */ e.jsx(s, { size: 24, className: Se({ disabled: u, isSelected: n }) }) }) : /* @__PURE__ */ e.jsx(s, { size: 24, className: Se({ disabled: u, isSelected: n }) })),
462
+ /* @__PURE__ */ e.jsx("label", { className: Tt({ disabled: u, isSelected: n }), children: r })
514
463
  ] }),
515
464
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
516
- o && o ? /* @__PURE__ */ e.jsx(Ke, { count: o, maxCount: 9, className: "badge", disabled: x }) : "",
517
- f && /* @__PURE__ */ e.jsx(
465
+ l && l ? /* @__PURE__ */ e.jsx(xt, { count: l, maxCount: 9, className: "badge", disabled: u }) : "",
466
+ c && /* @__PURE__ */ e.jsx(
518
467
  "div",
519
468
  {
520
- className: T(
469
+ className: A(
521
470
  "sublinks-toggle",
522
471
  "transition-all duration-200",
523
472
  "rounded-full relative grid place-items-center size-6",
524
- a && "text-primary-default-default",
473
+ n && "text-primary-default-default",
525
474
  `${m ? "-rotate-90" : "rotate-90"}`
526
475
  ),
527
476
  children: /* @__PURE__ */ e.jsx(
528
477
  "button",
529
478
  {
530
- disabled: x,
479
+ disabled: u,
531
480
  type: "button",
532
- onClick: u,
533
- className: T("absolute cursor-pointer hover:text-primary-default-hover top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-2 z-100 select-none", Le({ disabled: x, isSelected: a }), x && "pointer-events-none"),
534
- children: /* @__PURE__ */ e.jsx(Ct, {})
481
+ onClick: d,
482
+ className: A("absolute cursor-pointer hover:text-primary-default-hover top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-2 z-100 select-none", Se({ disabled: u, isSelected: n }), u && "pointer-events-none"),
483
+ children: /* @__PURE__ */ e.jsx(Nt, {})
535
484
  }
536
485
  )
537
486
  }
538
487
  )
539
488
  ] })
540
- ] }), N = T(
489
+ ] }), F = A(
541
490
  "group navitem",
542
491
  "h-12 flex-1 flex items-center p-3 rounded-lg justify-between w-full",
543
492
  "transition-all duration-300",
544
- Et,
545
- Pt({ isSelected: a, disabled: x }),
546
- d
493
+ Lt,
494
+ Ot({ isSelected: n, disabled: u }),
495
+ i
547
496
  );
548
- if (b === "a") {
497
+ if (h === "a") {
549
498
  const P = {
550
- onClick: L,
551
- onAuxClick: g,
552
- className: N
499
+ onClick: y,
500
+ onAuxClick: w,
501
+ className: F
553
502
  };
554
- return /* @__PURE__ */ e.jsx("a", { ...P, children: y });
503
+ return /* @__PURE__ */ e.jsx("a", { ...P, children: f });
555
504
  }
556
- if (b === "button") {
505
+ if (h === "button") {
557
506
  const P = {
558
- onClick: L,
507
+ onClick: y,
559
508
  type: "button",
560
- className: N
509
+ className: F
561
510
  };
562
- return /* @__PURE__ */ e.jsx("button", { ...P, children: y });
511
+ return /* @__PURE__ */ e.jsx("button", { ...P, children: f });
563
512
  }
564
- const k = {
565
- onClick: L,
566
- className: N
513
+ const D = {
514
+ onClick: y,
515
+ className: F
567
516
  };
568
- return /* @__PURE__ */ e.jsx("div", { ...k, children: y });
569
- }, Re = B(Mt);
570
- Re.displayName = "NavigationDrawerItemBase";
571
- const Rt = (t) => {
572
- const { title: r, icon: s, count: o, className: d, isActive: a, onClick: f, isView: m = !0, disabled: u, tooltipText: b } = t;
517
+ return /* @__PURE__ */ e.jsx("div", { ...D, children: f });
518
+ }, Pe = T(It);
519
+ Pe.displayName = "NavigationDrawerItemBase";
520
+ const Et = (t) => {
521
+ const { title: r, icon: s, count: l, className: i, isActive: n, onClick: c, isView: m = !0, disabled: d, tooltipText: h } = t;
573
522
  return m ? /* @__PURE__ */ e.jsx(
574
- Re,
523
+ Pe,
575
524
  {
576
525
  as: "button",
577
526
  title: r,
578
527
  icon: s,
579
- count: o,
580
- className: d,
581
- isSelected: a,
582
- onClick: f,
583
- disabled: u,
584
- tooltipText: b
528
+ count: l,
529
+ className: i,
530
+ isSelected: n,
531
+ onClick: c,
532
+ disabled: d,
533
+ tooltipText: h
585
534
  }
586
535
  ) : null;
587
- }, st = B(Rt);
588
- st.displayName = "NavigationDrawerActionItem";
589
- const Bt = ({ actions: t, activeActionId: r, onActionClick: s, className: o }) => /* @__PURE__ */ e.jsx(pe, { className: T("flex flex-col gap-2 w-full ", o), scrollbarProps: { hide: !0 }, persistScroll: "navigation-actions", indicators: {
536
+ }, et = T(Et);
537
+ et.displayName = "NavigationDrawerActionItem";
538
+ const Pt = ({ actions: t, activeActionId: r, onActionClick: s, className: l }) => /* @__PURE__ */ e.jsx(ye, { className: A("flex flex-col gap-2 w-full ", l), scrollbarProps: { hide: !0 }, persistScroll: "navigation-actions", indicators: {
590
539
  top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
591
540
  bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
592
- }, children: t?.map((d) => {
593
- const { id: a, onClick: f, isView: m = !0, payload: u, ...b } = d, i = a === r, g = () => {
594
- s?.(a, u), f?.();
541
+ }, children: t?.map((i) => {
542
+ const { id: n, onClick: c, isView: m = !0, payload: d, ...h } = i, b = n === r, w = () => {
543
+ s?.(n, d), c?.();
595
544
  };
596
545
  return m ? /* @__PURE__ */ e.jsx(
597
- st,
546
+ et,
598
547
  {
599
- ...b,
600
- id: a,
601
- isActive: i,
602
- onClick: g
548
+ ...h,
549
+ id: n,
550
+ isActive: b,
551
+ onClick: w
603
552
  },
604
- a
553
+ n
605
554
  ) : null;
606
- }) }), nt = B(Bt);
607
- nt.displayName = "NavigationDrawerActions";
608
- const Ft = (t) => {
609
- const { className: r, title: s, path: o, onClick: d, isSelected: a, parentPath: f } = t, m = h(() => {
610
- d?.(o);
611
- }, [o]), u = h(() => {
612
- if (o.startsWith("./")) {
613
- if (!f) return;
614
- const b = f + o.slice(2);
615
- window.open(b, "_blank");
555
+ }) }), tt = T(Pt);
556
+ tt.displayName = "NavigationDrawerActions";
557
+ const _t = (t) => {
558
+ const { className: r, title: s, path: l, onClick: i, isSelected: n, parentPath: c } = t, m = x(() => {
559
+ i?.(l);
560
+ }, [l]), d = x(() => {
561
+ if (l.startsWith("./")) {
562
+ if (!c) return;
563
+ const h = c + l.slice(2);
564
+ window.open(h, "_blank");
616
565
  } else
617
- window.open(o, "_blank");
618
- }, [o]);
566
+ window.open(l, "_blank");
567
+ }, [l]);
619
568
  return /* @__PURE__ */ e.jsx(
620
569
  "a",
621
570
  {
622
571
  onClick: m,
623
- onAuxClick: u,
624
- className: T(
572
+ onAuxClick: d,
573
+ className: A(
625
574
  "group",
626
575
  "transition-all duration-300 ease-in-out cursor-pointer",
627
576
  "h-10 w-full rounded-lg py-[11px] px-3",
628
577
  "hover:bg-neutral-medium-hover",
629
- a && "bg-neutral-medium-selected hover:bg-neutral-medium-hover active:bg-transparent focus:bg-transparent",
578
+ n && "bg-neutral-medium-selected hover:bg-neutral-medium-hover active:bg-transparent focus:bg-transparent",
630
579
  r
631
580
  ),
632
- children: /* @__PURE__ */ e.jsx("p", { className: T(
581
+ children: /* @__PURE__ */ e.jsx("p", { className: A(
633
582
  "prometeo-fonts-label-large text-neutral-medium-default",
634
583
  "group-active:text-neutral-default-focused group-focus:text-neutral-default-focused",
635
- a && "text-primary-default-default group-hover:text-primary-default-hover group-focus:text-primary-default-focused group-active:text-primary-default-focused"
584
+ n && "text-primary-default-default group-hover:text-primary-default-hover group-focus:text-primary-default-focused group-active:text-primary-default-focused"
636
585
  ), children: s })
637
586
  }
638
587
  );
639
- }, at = B(Ft);
640
- at.displayName = "NavItemSecondary";
641
- const zt = me((t, r) => {
642
- const [s, o] = X(!0), d = A(null), { path: a, title: f, icon: m, count: u, className: b, isSelected: i = !1, onClick: g, sublinks: x, toggleCollapse: j, getIsCollapsed: L, subscribeToCollapse: y, isView: N = !0, disabled: k, tooltipText: P } = t;
643
- Q(() => y ? y((I) => {
644
- I && o(!0);
645
- }) : void 0, [y]);
646
- const z = h(() => {
647
- o((R) => !R);
648
- }, []), C = h((R) => {
649
- o(R);
650
- }, []), H = {
651
- toggle: z,
652
- setIsCollapsed: C,
588
+ }, rt = T(_t);
589
+ rt.displayName = "NavItemSecondary";
590
+ const Rt = Ne((t, r) => {
591
+ const [s, l] = Z(!0), i = I(null), { path: n, title: c, icon: m, count: d, className: h, isSelected: b = !1, onClick: w, sublinks: u, toggleCollapse: N, getIsCollapsed: y, subscribeToCollapse: f, isView: F = !0, disabled: D, tooltipText: P } = t;
592
+ X(() => f ? f((E) => {
593
+ E && l(!0);
594
+ }) : void 0, [f]);
595
+ const R = x(() => {
596
+ l((M) => !M);
597
+ }, []), k = x((M) => {
598
+ l(M);
599
+ }, []), j = {
600
+ toggle: R,
601
+ setIsCollapsed: k,
653
602
  get isCollapsed() {
654
603
  return s;
655
604
  },
656
605
  get isDrawerCollapsed() {
657
- return L?.() ?? !1;
606
+ return y?.() ?? !1;
658
607
  },
659
- toggleDrawerCollapse: j,
660
- subscribeToCollapse: y
608
+ toggleDrawerCollapse: N,
609
+ subscribeToCollapse: f
661
610
  };
662
- Ee(r, () => H, [H, s, L, j]);
663
- const c = m, _ = h(() => {
664
- const R = L?.() ?? !1;
665
- if (x && x.length > 0 && R) {
666
- C(!1), j?.();
611
+ Oe(r, () => j, [j, s, y, N]);
612
+ const K = m, Y = x(() => {
613
+ const M = y?.() ?? !1;
614
+ if (u && u.length > 0 && M) {
615
+ k(!1), N?.();
667
616
  return;
668
617
  }
669
- g?.(a);
670
- }, [a, g, x, j, C, L]), M = h(() => {
671
- window.open(a, "_blank");
672
- }, [a]), F = () => {
673
- if (!x || k) return null;
674
- if (t.subLinksRender && x)
675
- return t.subLinksRender(x, H);
676
- const R = h((I) => {
677
- if (I.startsWith("./")) {
678
- const $ = a + I.slice(2);
679
- g?.($);
618
+ w?.(n);
619
+ }, [n, w, u, N, k, y]), J = x(() => {
620
+ window.open(n, "_blank");
621
+ }, [n]), te = () => {
622
+ if (!u || D) return null;
623
+ if (t.subLinksRender && u)
624
+ return t.subLinksRender(u, j);
625
+ const M = x((E) => {
626
+ if (E.startsWith("./")) {
627
+ const V = n + E.slice(2);
628
+ w?.(V);
680
629
  } else
681
- g?.(I);
682
- }, [a]);
683
- return Q(() => {
684
- const I = d.current;
685
- if (!I) return;
686
- const $ = I.scrollHeight;
687
- I.style.setProperty("--sublinks-max-height", `${$}px`);
688
- }, []), /* @__PURE__ */ e.jsx("div", { ref: d, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: x.map((I) => /* @__PURE__ */ e.jsx(at, { ...I, onClick: R, parentPath: a }, `${I.title}-${I.path}`)) });
689
- }, K = (R) => {
690
- R.stopPropagation(), R.preventDefault(), z();
630
+ w?.(E);
631
+ }, [n]);
632
+ return X(() => {
633
+ const E = i.current;
634
+ if (!E) return;
635
+ const V = E.scrollHeight;
636
+ E.style.setProperty("--sublinks-max-height", `${V}px`);
637
+ }, []), /* @__PURE__ */ e.jsx("div", { ref: i, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: u.map((E) => /* @__PURE__ */ e.jsx(rt, { ...E, onClick: M, parentPath: n }, `${E.title}-${E.path}`)) });
638
+ }, H = (M) => {
639
+ M.stopPropagation(), M.preventDefault(), R();
691
640
  };
692
- return N ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
641
+ return F ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
693
642
  /* @__PURE__ */ e.jsx(
694
- Re,
643
+ Pe,
695
644
  {
696
645
  as: "a",
697
- title: f,
698
- icon: c,
699
- count: u,
700
- className: b,
701
- isSelected: i,
702
- hasSublinks: !!x,
646
+ title: c,
647
+ icon: K,
648
+ count: d,
649
+ className: h,
650
+ isSelected: b,
651
+ hasSublinks: !!u,
703
652
  subLinksCollapsed: s,
704
- onToggleSublinks: K,
705
- onClick: _,
706
- onAuxClick: M,
707
- disabled: k,
653
+ onToggleSublinks: H,
654
+ onClick: Y,
655
+ onAuxClick: J,
656
+ disabled: D,
708
657
  tooltipText: P
709
658
  }
710
659
  ),
711
- F()
660
+ te()
712
661
  ] }) : null;
713
- }), ot = B(zt);
714
- ot.displayName = "NavigationDrawerLinkItem";
715
- const Ut = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: o, toggleCollapse: d, subscribeToCollapse: a }) => {
716
- const { pathname: f } = vt();
717
- return /* @__PURE__ */ e.jsx(pe, { className: T("flex flex-col gap-2 w-full ", s), scrollbarProps: { hide: !0 }, persistScroll: "navigation-links", indicators: {
662
+ }), st = T(Rt);
663
+ st.displayName = "NavigationDrawerLinkItem";
664
+ const Mt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: l, toggleCollapse: i, subscribeToCollapse: n }) => {
665
+ const { pathname: c } = ht();
666
+ return /* @__PURE__ */ e.jsx(ye, { className: A("flex flex-col gap-2 w-full ", s), scrollbarProps: { hide: !0 }, persistScroll: "navigation-links", indicators: {
718
667
  top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
719
668
  bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
720
- }, children: t?.map((m, u) => {
721
- const b = m.isSelected || m.path === f || (m.relatedPaths?.some((i) => f.startsWith(i)) ?? !1);
669
+ }, children: t?.map((m, d) => {
670
+ const h = m.isSelected || m.path === c || (m.relatedPaths?.some((b) => c.startsWith(b)) ?? !1);
722
671
  return /* @__PURE__ */ e.jsx(
723
- ot,
672
+ st,
724
673
  {
725
674
  className: "",
726
675
  ...m,
727
- isSelected: b,
676
+ isSelected: h,
728
677
  onClick: r,
729
- toggleCollapse: d,
730
- getIsCollapsed: o,
731
- subscribeToCollapse: a,
678
+ toggleCollapse: i,
679
+ getIsCollapsed: l,
680
+ subscribeToCollapse: n,
732
681
  disabled: m.disabled,
733
682
  isView: m.isView
734
683
  },
735
- u
684
+ d
736
685
  );
737
686
  }) });
738
- }, lt = B(Ut);
739
- lt.displayName = "NavigationDrawerNavlinks";
740
- const it = B(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId: o, onActionClick: d }) => {
741
- const { getIsCollapsed: a, toggleCollapse: f, subscribeToCollapse: m } = ce();
687
+ }, nt = T(Mt);
688
+ nt.displayName = "NavigationDrawerNavlinks";
689
+ const at = T(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId: l, onActionClick: i }) => {
690
+ const { getIsCollapsed: n, toggleCollapse: c, subscribeToCollapse: m } = ie();
742
691
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
743
- /* @__PURE__ */ e.jsx(G.Spacer, { className: "pb-3" }),
692
+ /* @__PURE__ */ e.jsx(q.Spacer, { className: "pb-3" }),
744
693
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col overflow-hidden h-full gap-4", children: [
745
694
  /* @__PURE__ */ e.jsx(
746
- lt,
695
+ nt,
747
696
  {
748
- getIsCollapsed: a,
749
- toggleCollapse: f,
697
+ getIsCollapsed: n,
698
+ toggleCollapse: c,
750
699
  subscribeToCollapse: m,
751
700
  navlinks: t,
752
701
  handleNavigation: r,
@@ -754,73 +703,93 @@ const it = B(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId:
754
703
  }
755
704
  ),
756
705
  /* @__PURE__ */ e.jsx(
757
- nt,
706
+ tt,
758
707
  {
759
708
  actions: s,
760
- activeActionId: o,
761
- onActionClick: d,
709
+ activeActionId: l,
710
+ onActionClick: i,
762
711
  className: "max-h-[35vh]"
763
712
  }
764
713
  )
765
714
  ] })
766
715
  ] });
767
716
  }, (t, r) => t.navlinks === r.navlinks && t.handleNavigation === r.handleNavigation && t.allActions === r.allActions && t.activeActionId === r.activeActionId && t.onActionClick === r.onActionClick);
768
- it.displayName = "PyrionNavigationDrawer.Content";
769
- const Ht = (t) => {
770
- const { sessions: r, onSessionClick: s, secondarySlot: o, subImageUrlAccessor: d } = t;
717
+ at.displayName = "PyrionNavigationDrawer.Content";
718
+ const Bt = ({ name: t, imageUrl: r, avatarSize: s = "xxs", subImageUrl: l, className: i, mainSlot: n = t, secondarySlot: c }) => {
719
+ const m = x(() => n ? typeof n == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1 select-text", children: n }) : typeof n == "function" ? n() : n : null, [n]), d = x(() => c ? typeof c == "string" ? /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis select-text", children: c }) : typeof c == "function" ? c() : c : null, [c]);
720
+ return /* @__PURE__ */ e.jsxs("div", { className: A("flex items-center gap-2 p-3 rounded-lg max-w-full max-h-full select-none ", i), children: [
721
+ /* @__PURE__ */ e.jsx(
722
+ yt,
723
+ {
724
+ fallbackText: t,
725
+ sizeImage: s,
726
+ sizeFallback: s,
727
+ imageUrl: r,
728
+ subImageUrl: l
729
+ }
730
+ ),
731
+ /* @__PURE__ */ e.jsxs("div", { className: A("usercard-content flex flex-col gap-0 flex-1 overflow-hidden w-full transition-all duration-300 ease-in-out ", c && "gap-1"), children: [
732
+ /* @__PURE__ */ e.jsx("div", { className: "w-full", children: m() }),
733
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-1 justify-between overflow-hidden relative w-full", children: d() })
734
+ ] })
735
+ ] });
736
+ }, _e = T(Bt);
737
+ _e.displayName = "UserCard";
738
+ const Ft = (t) => {
739
+ const { sessions: r, onSessionClick: s, secondarySlot: l, subImageUrlAccessor: i } = t;
771
740
  if (!r || r.length === 0)
772
741
  return null;
773
- const a = (u) => {
774
- s && s(u);
775
- }, f = (u) => {
776
- if (!d)
742
+ const n = (d) => {
743
+ s && s(d);
744
+ }, c = (d) => {
745
+ if (!i)
777
746
  return;
778
- const b = u.metadata;
779
- if (!b)
747
+ const h = d.metadata;
748
+ if (!h)
780
749
  return;
781
- const i = we({ metadata: b }, d);
782
- if (i != null)
783
- return typeof i == "string" ? i : String(i);
784
- }, m = h((u) => typeof o == "function" ? o(u) : o, [o]);
785
- return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((u) => {
786
- const { auth_id: b } = u;
787
- return /* @__PURE__ */ e.jsx(se, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(se.Content, { onClick: () => a(u), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
788
- Ye,
750
+ const b = xe({ metadata: h }, i);
751
+ if (b != null)
752
+ return typeof b == "string" ? b : String(b);
753
+ }, m = x((d) => typeof l == "function" ? l(d) : l, [l]);
754
+ return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((d) => {
755
+ const { auth_id: h } = d;
756
+ return /* @__PURE__ */ e.jsx(ee, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(ee.Content, { onClick: () => n(d), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
757
+ _e,
789
758
  {
790
- name: b.name,
759
+ name: h.name,
791
760
  avatarSize: "xxs",
792
- secondarySlot: m(u),
793
- subImageUrl: f(u),
794
- imageUrl: b.profile_picture,
761
+ secondarySlot: m(d),
762
+ subImageUrl: c(d),
763
+ imageUrl: h.profile_picture,
795
764
  className: "pyrion-navigation-drawer-user-card"
796
765
  },
797
- u.token
798
- ) }) }, u.token);
766
+ d.token
767
+ ) }) }, d.token);
799
768
  }) });
800
- }, Vt = ({
769
+ }, Ut = ({
801
770
  state: t,
802
771
  currentAppSessions: r,
803
772
  resolveUserSecondarySlot: s,
804
- resolveSessionSecondarySlot: o,
805
- onSessionClick: d,
806
- onLogoutClick: a,
807
- onProfileClick: f,
773
+ resolveSessionSecondarySlot: l,
774
+ onSessionClick: i,
775
+ onLogoutClick: n,
776
+ onProfileClick: c,
808
777
  options: m,
809
- currentSystemId: u,
810
- userOptionsControls: b,
811
- mobileAppSwitcherControls: i
778
+ currentSystemId: d,
779
+ userOptionsControls: h,
780
+ mobileAppSwitcherControls: b
812
781
  }) => {
813
- const { getIsCollapsed: g, toggleCollapse: x, subscribeToCollapse: j } = ce(), L = h(() => {
814
- const y = g();
815
- y ? (x(), b.current?.open()) : f?.(y);
816
- }, [g, x, b, f]);
817
- return Q(() => j((y) => {
818
- y && (b.current?.close(), i.current?.close());
819
- }), [j, b, i]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
820
- /* @__PURE__ */ e.jsx(G.Spacer, { className: "mb-3" }),
821
- /* @__PURE__ */ e.jsxs(se, { className: "", controls: b, children: [
822
- /* @__PURE__ */ e.jsx(se.Content, { onClick: L, children: /* @__PURE__ */ e.jsx(
823
- Ye,
782
+ const { getIsCollapsed: w, toggleCollapse: u, subscribeToCollapse: N } = ie(), y = x(() => {
783
+ const f = w();
784
+ f ? (u(), h.current?.open()) : c?.(f);
785
+ }, [w, u, h, c]);
786
+ return X(() => N((f) => {
787
+ f && (h.current?.close(), b.current?.close());
788
+ }), [N, h, b]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
789
+ /* @__PURE__ */ e.jsx(q.Spacer, { className: "mb-3" }),
790
+ /* @__PURE__ */ e.jsxs(ee, { className: "", controls: h, children: [
791
+ /* @__PURE__ */ e.jsx(ee.Content, { onClick: y, children: /* @__PURE__ */ e.jsx(
792
+ _e,
824
793
  {
825
794
  className: "pyrion-navigation-drawer-user-card p-0",
826
795
  name: t.user.name,
@@ -830,31 +799,31 @@ const Ht = (t) => {
830
799
  avatarSize: "xxs"
831
800
  }
832
801
  ) }),
833
- /* @__PURE__ */ e.jsxs(se.Options, { className: "min-h-max flex flex-col gap-3 pl-3 mt-3 pt-2", children: [
802
+ /* @__PURE__ */ e.jsxs(ee.Options, { className: "min-h-max flex flex-col gap-3 pl-3 mt-3 pt-2", children: [
834
803
  r && r.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
835
804
  /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-medium text-neutral-medium-default select-none", children: "Cambiar cuenta" }),
836
- /* @__PURE__ */ e.jsx(pe, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, children: /* @__PURE__ */ e.jsx(
837
- Ht,
805
+ /* @__PURE__ */ e.jsx(ye, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, children: /* @__PURE__ */ e.jsx(
806
+ Ft,
838
807
  {
839
808
  sessions: r,
840
- onSessionClick: d,
841
- secondarySlot: o,
809
+ onSessionClick: i,
810
+ secondarySlot: l,
842
811
  subImageUrlAccessor: m?.sessionCardOptions?.subImageUrlAccessor,
843
- currentSystemId: u
812
+ currentSystemId: d
844
813
  }
845
814
  ) })
846
815
  ] }),
847
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: a && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
816
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: n && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
848
817
  /* @__PURE__ */ e.jsx("span", { className: "border-t border-neutral-strong-default w-full bg-neutral-strong-default" }),
849
818
  /* @__PURE__ */ e.jsx(
850
819
  fe,
851
820
  {
852
- onClick: a,
821
+ onClick: n,
853
822
  animate: !1,
854
823
  animateIcon: !1,
855
824
  variant: "text",
856
825
  label: "Cerrar sesión",
857
- icon: /* @__PURE__ */ e.jsx(St, {}),
826
+ icon: /* @__PURE__ */ e.jsx(Ct, {}),
858
827
  size: "small",
859
828
  color: "secondary"
860
829
  }
@@ -863,67 +832,67 @@ const Ht = (t) => {
863
832
  ] })
864
833
  ] })
865
834
  ] });
866
- }, ct = B(Vt, (t, r) => {
867
- const s = Object.keys(t), o = Object.keys(r);
868
- if (s.length !== o.length)
835
+ }, ot = T(Ut, (t, r) => {
836
+ const s = Object.keys(t), l = Object.keys(r);
837
+ if (s.length !== l.length)
869
838
  return !1;
870
- for (const d of s) {
871
- if (!Object.prototype.hasOwnProperty.call(r, d))
839
+ for (const i of s) {
840
+ if (!Object.prototype.hasOwnProperty.call(r, i))
872
841
  return !1;
873
- const a = t[d], f = r[d];
874
- if (a !== f)
842
+ const n = t[i], c = r[i];
843
+ if (n !== c)
875
844
  return !1;
876
845
  }
877
846
  return t.currentAppSessions !== r.currentAppSessions || t.options !== r.options || t.currentSystemId !== r.currentSystemId || t.userOptionsControls !== r.userOptionsControls || t.mobileAppSwitcherControls !== r.mobileAppSwitcherControls;
878
847
  });
879
- ct.displayName = "PyrionNavigationDrawer.Footer";
880
- const Wt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(se, { controls: s, children: [
881
- /* @__PURE__ */ e.jsx(se.Content, { children: typeof r == "function" ? r() : r }),
882
- /* @__PURE__ */ e.jsxs(se.Options, { children: [
848
+ ot.displayName = "PyrionNavigationDrawer.Footer";
849
+ const zt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ee, { controls: s, children: [
850
+ /* @__PURE__ */ e.jsx(ee.Content, { children: typeof r == "function" ? r() : r }),
851
+ /* @__PURE__ */ e.jsxs(ee.Options, { children: [
883
852
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col p-2 pl-4 gap-2", children: [
884
853
  /* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-label-medium text-neutral-medium-default", children: "Cambiar módulo" }),
885
- /* @__PURE__ */ e.jsx(pe, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: t?.map((o) => {
886
- const d = typeof o.thumbnail == "string" ? /* @__PURE__ */ e.jsx(
854
+ /* @__PURE__ */ e.jsx(ye, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: t?.map((l) => {
855
+ const i = typeof l.thumbnail == "string" ? /* @__PURE__ */ e.jsx(
887
856
  "img",
888
857
  {
889
- src: o.thumbnail,
890
- alt: o.description,
858
+ src: l.thumbnail,
859
+ alt: l.description,
891
860
  className: "size-8 aspect-square rounded",
892
861
  draggable: !1
893
862
  }
894
- ) : o.thumbnail, a = () => {
895
- o.disabled || o.onClick && o.onClick(o.name);
863
+ ) : l.thumbnail, n = () => {
864
+ l.disabled || l.onClick && l.onClick(l.name);
896
865
  };
897
- return /* @__PURE__ */ e.jsxs("div", { onClick: a, className: "flex gap-2 p-2 rounded-lg h-12", children: [
898
- d,
866
+ return /* @__PURE__ */ e.jsxs("div", { onClick: n, className: "flex gap-2 p-2 rounded-lg h-12", children: [
867
+ i,
899
868
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center h-full justify-center ", children: [
900
- /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1", children: o.name }),
901
- o.description && /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: o.description })
869
+ /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1", children: l.name }),
870
+ l.description && /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: l.description })
902
871
  ] })
903
872
  ] });
904
873
  }) })
905
874
  ] }),
906
875
  /* @__PURE__ */ e.jsx("div", {})
907
876
  ] })
908
- ] }), Ae = B(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
909
- const o = h(() => {
877
+ ] }), De = T(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
878
+ const l = x(() => {
910
879
  if (t) {
911
880
  if (s) {
912
- const m = t.find((u) => u._id === s);
881
+ const m = t.find((d) => d._id === s);
913
882
  if (m) return { coverImage: m.coverImage, thumbnail: m.thumbnail };
914
883
  }
915
- const a = window.location.origin, f = t.find((m) => m.url === a);
916
- if (f) return { coverImage: f.coverImage, thumbnail: f.thumbnail };
884
+ const n = window.location.origin, c = t.find((m) => m.url === n);
885
+ if (c) return { coverImage: c.coverImage, thumbnail: c.thumbnail };
917
886
  }
918
887
  return { coverImage: "", thumbnail: "" };
919
- }, [t]), d = !!r;
888
+ }, [t]), i = !!r;
920
889
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
921
890
  /* @__PURE__ */ e.jsx(
922
891
  "img",
923
892
  {
924
- src: o().coverImage,
893
+ src: l().coverImage,
925
894
  alt: "System Logo",
926
- className: T("w-full h-12 rounded object-contain system-cover-image ", d && "cursor-pointer"),
895
+ className: A("w-full h-12 rounded object-contain system-cover-image ", i && "cursor-pointer"),
927
896
  draggable: !1,
928
897
  onClick: r
929
898
  }
@@ -931,30 +900,30 @@ const Wt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(se,
931
900
  /* @__PURE__ */ e.jsx(
932
901
  "img",
933
902
  {
934
- src: o().thumbnail,
903
+ src: l().thumbnail,
935
904
  alt: "System Logo",
936
- className: T("w-12 h-12 rounded object-cover system-thumbnail ", d && "cursor-pointer"),
905
+ className: A("w-12 h-12 rounded object-cover system-thumbnail ", i && "cursor-pointer"),
937
906
  draggable: !1,
938
907
  onClick: r
939
908
  }
940
909
  )
941
910
  ] });
942
911
  }, (t, r) => t.enabled_systems === r.enabled_systems && t.onClick === r.onClick && t.currentSystemId === r.currentSystemId);
943
- Ae.displayName = "PyrionNavigationDrawer.SystemLogo";
944
- const dt = B(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: o, mobileAppSwitcherControls: d }) => {
945
- const { getIsCollapsed: a } = ce(), f = qe(), m = h(() => {
912
+ De.displayName = "PyrionNavigationDrawer.SystemLogo";
913
+ const lt = T(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: l, mobileAppSwitcherControls: i }) => {
914
+ const { getIsCollapsed: n } = ie(), c = We(), m = x(() => {
946
915
  if (t) {
947
- const u = a();
948
- t(u);
916
+ const d = n();
917
+ t(d);
949
918
  }
950
- }, [t, a]);
951
- return f ? /* @__PURE__ */ e.jsx(
952
- Wt,
919
+ }, [t, n]);
920
+ return c ? /* @__PURE__ */ e.jsx(
921
+ zt,
953
922
  {
954
- controls: d,
955
- tabs: o,
923
+ controls: i,
924
+ tabs: l,
956
925
  content: /* @__PURE__ */ e.jsx(
957
- Ae,
926
+ De,
958
927
  {
959
928
  enabled_systems: r.enabled_systems,
960
929
  onClick: m,
@@ -963,7 +932,7 @@ const dt = B(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: o, mob
963
932
  )
964
933
  }
965
934
  ) : /* @__PURE__ */ e.jsx(
966
- Ae,
935
+ De,
967
936
  {
968
937
  enabled_systems: r.enabled_systems,
969
938
  onClick: m,
@@ -971,486 +940,411 @@ const dt = B(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: o, mob
971
940
  }
972
941
  );
973
942
  });
974
- dt.displayName = "PyrionNavigationDrawer.Header";
975
- const qt = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s, scrollableControls: o }) => {
976
- const [d, a] = X([]), [f, m] = X("NO_LEIDAS"), [u, b] = X(!1), i = A(/* @__PURE__ */ new Set()), g = A(null), x = A(null), j = h((c, _ = "top") => {
977
- a((M) => {
978
- const F = Array.isArray(c) ? _ === "bottom" ? [...M, ...c] : [...c, ...M] : _ === "bottom" ? [...M, c] : [c, ...M];
979
- return queueMicrotask(() => {
980
- i.current.forEach((K) => K(F, F.length));
981
- }), F;
982
- });
983
- }, []), L = h((c) => (i.current.add(c), () => {
984
- i.current.delete(c);
985
- }), []), y = h((c) => {
986
- a((_) => {
987
- const M = Array.isArray(c) ? _.filter((F) => !c.includes(F._id)) : _.filter((F) => F._id !== c);
988
- return queueMicrotask(() => {
989
- i.current.forEach((F) => F(M, M.length));
990
- }), M;
991
- });
992
- }, []), N = h(() => {
993
- a([]), queueMicrotask(() => {
994
- i.current.forEach((c) => c([], 0));
943
+ lt.displayName = "PyrionNavigationDrawer.Header";
944
+ const Ht = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s }) => {
945
+ const [l, i] = Z([]), n = I(/* @__PURE__ */ new Set()), c = x((u, N = "top") => {
946
+ i((y) => {
947
+ const f = Array.isArray(u) ? N === "bottom" ? [...y, ...u] : [...u, ...y] : N === "bottom" ? [...y, u] : [u, ...y];
948
+ return n.current.forEach((F) => F(f, f.length)), f;
995
949
  });
996
- }, []), k = h((c) => {
997
- a(c), queueMicrotask(() => {
998
- i.current.forEach((_) => _(c, c.length));
950
+ }, []), m = x((u) => (n.current.add(u), () => {
951
+ n.current.delete(u);
952
+ }), []), d = x((u) => {
953
+ i((N) => {
954
+ const y = Array.isArray(u) ? N.filter((f) => !u.includes(f._id)) : N.filter((f) => f._id !== u);
955
+ return n.current.forEach((f) => f(y, y.length)), y;
999
956
  });
1000
- }, []), P = h((c) => {
1001
- b(c);
957
+ }, []), h = x(() => {
958
+ i([]), n.current.forEach((u) => u([], 0));
959
+ }, []), b = x((u) => {
960
+ i(u), n.current.forEach((N) => N(u, u.length));
1002
961
  }, []);
1003
- Ee(s, () => ({
1004
- addNewNotification: j,
1005
- subscribeToUpdates: L,
1006
- setNotifications: k,
1007
- removeNotification: y,
1008
- removeAllNotifications: N,
1009
- setLoading: P
1010
- }), [j, L, k, y, N, P]);
1011
- const z = (c) => {
1012
- m(c);
1013
- }, C = d.length > 0;
1014
- xt(() => {
1015
- if (g.current && x.current) {
1016
- const c = g.current.clientHeight;
1017
- x.current.style.setProperty("height", `calc(100vh - ${c}px - 20px)`);
1018
- }
1019
- }, [g?.current]);
1020
- const H = d.filter((c) => !c.read).length;
1021
- return /* @__PURE__ */ e.jsx(
962
+ Oe(s, () => ({
963
+ addNewNotification: c,
964
+ subscribeToUpdates: m,
965
+ setNotifications: b,
966
+ removeNotification: d,
967
+ removeAllNotifications: h
968
+ }), [c, m, b, d, h]);
969
+ const w = l.length > 0;
970
+ return /* @__PURE__ */ e.jsxs(
1022
971
  "section",
1023
972
  {
1024
- className: "w-full md:w-[479px] bg-neutral-default-default flex flex-col border-l-0 md:border-l border-neutral-strong-default min-h-full h-full max-h-full overflow-hidden",
1025
- children: /* @__PURE__ */ e.jsxs("div", { className: " w-full flex flex-col gap-4 ", children: [
1026
- /* @__PURE__ */ e.jsxs("div", { ref: g, className: "flex flex-col gap-4", children: [
1027
- /* @__PURE__ */ e.jsxs("div", { className: "w-full h-max flex gap-2 items-center justify-between pt-8 pb-2 pr-2 pl-4 border-b border-neutral-strong-default sticky top-0 z-50 bg-neutral-default-default", children: [
1028
- /* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
1029
- /* @__PURE__ */ e.jsx(Xe, { className: "text-neutral-strong-default", size: 24 }),
1030
- /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: "Notificaciones" })
1031
- ] }),
1032
- /* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(_e, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
973
+ className: "w-full md:w-[479px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default min-h-full",
974
+ children: [
975
+ /* @__PURE__ */ e.jsxs("div", { className: "w-full h-max flex gap-2 items-center justify-between pt-8 pb-2 pr-2 pl-4 border-b border-neutral-strong-default sticky top-0 z-50 bg-neutral-default-default", children: [
976
+ /* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
977
+ /* @__PURE__ */ e.jsx(qe, { className: "text-neutral-strong-default", size: 24 }),
978
+ /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: "Notificaciones" })
1033
979
  ] }),
1034
- /* @__PURE__ */ e.jsx(
1035
- kt,
1036
- {
1037
- className: "px-4 md:px-2 md:pl-2 pl-2 gap-0 md:gap-0",
1038
- onTabChange: z,
1039
- activeTab: f,
1040
- items: [
1041
- { id: "ALL", title: "Todas" },
1042
- { id: "NO_LEIDAS", title: "Sin leer" }
1043
- ],
1044
- renderTab: (c, _, M, F, K, R, I, $) => /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
1045
- /* @__PURE__ */ e.jsx(
1046
- Dt,
1047
- {
1048
- id: c.id,
1049
- title: c.title,
1050
- onClick: M,
1051
- isActive: _,
1052
- onIconClick: F,
1053
- onIconHover: K,
1054
- iconTooltipProps: I,
1055
- iconTooltipTitle: R,
1056
- iconSize: $
1057
- }
1058
- ),
1059
- H > 0 && c.title === "Sin leer" && /* @__PURE__ */ e.jsx(Ke, { count: H, className: "absolute top-0 right-0" })
1060
- ] })
1061
- }
1062
- ),
1063
- r && C && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end px-4", children: /* @__PURE__ */ e.jsx(fe, { onClick: r, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) })
980
+ /* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Ie, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
1064
981
  ] }),
1065
- /* @__PURE__ */ e.jsx("div", { ref: x, className: "", children: /* @__PURE__ */ e.jsxs(
1066
- pe,
1067
- {
1068
- className: "px-4 md:px-2 py-0 md:py-0 flex flex-col gap-3 h-full",
1069
- persistScroll: "notifications-scroll",
1070
- scrollbarProps: { hide: !0, size: "small" },
1071
- axis: "y",
1072
- disableMouseScroll: !1,
1073
- controls: o,
1074
- scrollTopButton: {
1075
- target: "2000px"
1076
- },
1077
- children: [
1078
- C ? d?.filter((c) => f === "NO_LEIDAS" ? !c.read : c)?.map((c, _) => /* @__PURE__ */ e.jsx(jt, { ...c, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, _)) : /* @__PURE__ */ e.jsx("p", { className: "flex-1 grid place-items-center prometeo-fonts-headline-xsmall text-neutral-default-default text-center py-8 text-balance", children: "No tienes notificaciones nuevas por el momento" }),
1079
- u && /* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-body-large text-neutral-medium-default w-full text-center py-4", children: "Cargando más ..." })
1080
- ]
1081
- }
1082
- ) })
1083
- ] })
982
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: [
983
+ r && w && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(fe, { onClick: r, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) }),
984
+ w ? l?.map((u, N) => /* @__PURE__ */ e.jsx(jt, { ...u, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, N)) : /* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-body-medium text-neutral-default-hover text-center py-8", children: "No hay notificaciones" })
985
+ ] })
986
+ ]
1084
987
  }
1085
988
  );
1086
- }, $t = ({ onCloseClick: t, children: r, title: s = "Ayuda" }) => /* @__PURE__ */ e.jsxs(
989
+ }, Vt = ({ onCloseClick: t, children: r, title: s = "Ayuda" }) => /* @__PURE__ */ e.jsxs(
1087
990
  "section",
1088
991
  {
1089
- className: "overflow-auto w-full md:w-[479px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default h-full",
992
+ className: "w-full md:w-[479px] bg-neutral-default-default border-l-0 md:border-l border-neutral-strong-default h-full",
1090
993
  children: [
1091
994
  /* @__PURE__ */ e.jsxs("div", { className: "w-full h-max flex gap-2 items-center justify-between pt-8 pb-2 pr-2 pl-4 border-b border-neutral-strong-default sticky top-0 z-50 bg-neutral-default-default", children: [
1092
995
  /* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
1093
- /* @__PURE__ */ e.jsx(Je, { className: "text-neutral-strong-default", size: 24 }),
996
+ /* @__PURE__ */ e.jsx(Ke, { className: "text-neutral-strong-default", size: 24 }),
1094
997
  /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-headline-small text-neutral-strong-default", children: s })
1095
998
  ] }),
1096
- /* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(_e, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
999
+ /* @__PURE__ */ e.jsx(fe, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Ie, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
1097
1000
  ] }),
1098
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4 ", children: r })
1001
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4", children: r })
1099
1002
  ]
1100
1003
  }
1101
- ), Kt = ({ closeSidebar: t, options: r, helpSection: s, initialSection: o, notificationsListControls: d, scrollableControls: a }, f) => {
1102
- const [m, u] = X(o ?? "notifications");
1103
- Ee(f, () => ({
1104
- setActiveSection: u
1004
+ ), Wt = ({ closeSidebar: t, options: r, helpSection: s, initialSection: l, notificationsListControls: i }, n) => {
1005
+ const [c, m] = Z(l ?? "notifications");
1006
+ Oe(n, () => ({
1007
+ setActiveSection: m
1105
1008
  }));
1106
- const b = () => {
1009
+ const d = () => {
1107
1010
  t();
1108
1011
  };
1109
1012
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1110
- m === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
1111
- qt,
1013
+ c === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
1014
+ Ht,
1112
1015
  {
1113
- onCloseClick: b,
1016
+ onCloseClick: d,
1114
1017
  onMarkAllAsRead: r?.notificationsDrawerOptions?.onMarkAllAsRead,
1115
- notificationsListControls: d,
1116
- scrollableControls: a
1018
+ notificationsListControls: i
1117
1019
  }
1118
1020
  ),
1119
- m === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx($t, { onCloseClick: b, children: typeof s == "function" ? s() : s })
1021
+ c === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Vt, { onCloseClick: d, children: typeof s == "function" ? s() : s })
1120
1022
  ] });
1121
- }, ut = me(Kt);
1122
- ut.displayName = "SidebarContent";
1123
- const Yt = ({
1023
+ }, it = Ne(Wt);
1024
+ it.displayName = "SidebarContent";
1025
+ const $t = ({
1124
1026
  options: t,
1125
1027
  helpSection: r,
1126
1028
  sidebarContentRef: s,
1127
- initialSectionRef: o,
1128
- notificationsListControls: d,
1129
- scrollableControls: a
1029
+ initialSectionRef: l,
1030
+ notificationsListControls: i
1130
1031
  }) => {
1131
- const { closeSidebar: f } = ce();
1032
+ const { closeSidebar: n } = ie();
1132
1033
  return /* @__PURE__ */ e.jsx(
1133
- ut,
1034
+ it,
1134
1035
  {
1135
1036
  ref: s,
1136
- closeSidebar: f,
1037
+ closeSidebar: n,
1137
1038
  options: t,
1138
1039
  helpSection: r,
1139
- initialSection: o.current,
1140
- notificationsListControls: d,
1141
- scrollableControls: a
1040
+ initialSection: l.current,
1041
+ notificationsListControls: i
1142
1042
  }
1143
1043
  );
1144
- }, ft = B(Yt);
1145
- ft.displayName = "PyrionNavigationDrawer.Sidebar";
1146
- const Xt = ({ navigationControlsRef: t }) => {
1147
- const r = ce();
1044
+ }, ct = T($t);
1045
+ ct.displayName = "PyrionNavigationDrawer.Sidebar";
1046
+ const qt = ({ navigationControlsRef: t }) => {
1047
+ const r = ie();
1148
1048
  return t.current.toggleCollapse = r.toggleCollapse, t.current.getIsCollapsed = r.getIsCollapsed, t.current.subscribeToCollapse = r.subscribeToCollapse, t.current.openSidebar = r.openSidebar, t.current.closeSidebar = r.closeSidebar, t.current.toggleSidebar = r.toggleSidebar, t.current.getIsSidebarOpen = r.getIsSidebarOpen, t.current.subscribeToSidebarOpen = r.subscribeToSidebarOpen, t.current.setDrawerDragEnabled = r.setDrawerDragEnabled, t.current.setSidebarDragEnabled = r.setSidebarDragEnabled, null;
1149
- }, Jt = (t) => {
1150
- const { children: r, currentAppSessions: s, resolveUserSecondarySlot: o, resolveSessionSecondarySlot: d, handleNavigation: a, allActions: f, tabs: m, navigationControlsRef: u, sidebarContentRef: b, initialSectionRef: i, userOptionsControls: g, mobileAppSwitcherControls: x, notificationsListControls: j, scrollableControls: L, outletRef: y, ...N } = t;
1151
- return /* @__PURE__ */ e.jsxs(G, { disableDragOpen: N.options?.disableDragOpen, outletRef: y, children: [
1152
- /* @__PURE__ */ e.jsx(Xt, { navigationControlsRef: u }),
1153
- /* @__PURE__ */ e.jsx(G.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
1154
- dt,
1049
+ }, Kt = (t) => {
1050
+ const { children: r, currentAppSessions: s, resolveUserSecondarySlot: l, resolveSessionSecondarySlot: i, handleNavigation: n, allActions: c, tabs: m, navigationControlsRef: d, sidebarContentRef: h, initialSectionRef: b, userOptionsControls: w, mobileAppSwitcherControls: u, notificationsListControls: N, outletRef: y, ...f } = t;
1051
+ return /* @__PURE__ */ e.jsxs(q, { disableDragOpen: f.options?.disableDragOpen, outletRef: y, children: [
1052
+ /* @__PURE__ */ e.jsx(qt, { navigationControlsRef: d }),
1053
+ /* @__PURE__ */ e.jsx(q.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
1054
+ lt,
1155
1055
  {
1156
- onSystemLogoClick: N.onSystemLogoClick,
1157
- state: N.state,
1158
- currentSystemId: N.currentSystemId,
1056
+ onSystemLogoClick: f.onSystemLogoClick,
1057
+ state: f.state,
1058
+ currentSystemId: f.currentSystemId,
1159
1059
  tabs: m,
1160
- mobileAppSwitcherControls: x
1060
+ mobileAppSwitcherControls: u
1161
1061
  }
1162
1062
  ) }, "PL-Header"),
1163
- /* @__PURE__ */ e.jsx(G.Content, { className: "overflow-hidden flex flex-col relative flex-1 w-[285px] md:w-auto", children: /* @__PURE__ */ e.jsx(
1164
- it,
1063
+ /* @__PURE__ */ e.jsx(q.Content, { className: "overflow-hidden flex flex-col relative flex-1 w-[285px] md:w-auto", children: /* @__PURE__ */ e.jsx(
1064
+ at,
1165
1065
  {
1166
- navlinks: N.links,
1167
- handleNavigation: a,
1168
- allActions: f,
1169
- activeActionId: N.activeActionId,
1170
- onActionClick: N.onActionClick
1066
+ navlinks: f.links,
1067
+ handleNavigation: n,
1068
+ allActions: c,
1069
+ activeActionId: f.activeActionId,
1070
+ onActionClick: f.onActionClick
1171
1071
  }
1172
1072
  ) }, "PL-Content"),
1173
- /* @__PURE__ */ e.jsx(G.Footer, { className: "md:min-h-max flex flex-col w-full overflow-hidden max-w-full", children: /* @__PURE__ */ e.jsx(
1174
- ct,
1073
+ /* @__PURE__ */ e.jsx(q.Footer, { className: "md:min-h-max flex flex-col w-full overflow-hidden max-w-full", children: /* @__PURE__ */ e.jsx(
1074
+ ot,
1175
1075
  {
1176
- state: N.state,
1076
+ state: f.state,
1177
1077
  currentAppSessions: s,
1178
- resolveUserSecondarySlot: o,
1179
- resolveSessionSecondarySlot: d,
1180
- onSessionClick: N.onSessionClick,
1181
- onLogoutClick: N.onLogoutClick,
1182
- options: N.options,
1183
- currentSystemId: N.currentSystemId,
1184
- userOptionsControls: g,
1185
- mobileAppSwitcherControls: x,
1186
- onProfileClick: N.onProfileClick
1078
+ resolveUserSecondarySlot: l,
1079
+ resolveSessionSecondarySlot: i,
1080
+ onSessionClick: f.onSessionClick,
1081
+ onLogoutClick: f.onLogoutClick,
1082
+ options: f.options,
1083
+ currentSystemId: f.currentSystemId,
1084
+ userOptionsControls: w,
1085
+ mobileAppSwitcherControls: u,
1086
+ onProfileClick: f.onProfileClick
1187
1087
  }
1188
1088
  ) }, "PL-Footer"),
1189
- /* @__PURE__ */ e.jsx(G.Outlet, { children: /* @__PURE__ */ e.jsx(mt, { children: r }) }),
1089
+ /* @__PURE__ */ e.jsx(q.Outlet, { children: /* @__PURE__ */ e.jsx(dt, { children: r }) }),
1190
1090
  /* @__PURE__ */ e.jsx(
1191
- G.Sidebar,
1091
+ q.Sidebar,
1192
1092
  {
1193
1093
  className: "bg-neutral-default-default",
1194
- modal: N.options?.sidebarOptions?.modal,
1195
- closeOnOverlayClick: N.options?.sidebarOptions?.closeOnOverlayClick,
1094
+ modal: f.options?.sidebarOptions?.modal,
1095
+ closeOnOverlayClick: f.options?.sidebarOptions?.closeOnOverlayClick,
1196
1096
  children: /* @__PURE__ */ e.jsx(
1197
- ft,
1097
+ ct,
1198
1098
  {
1199
- options: N.options,
1200
- helpSection: N.helpSection,
1201
- sidebarContentRef: b,
1202
- initialSectionRef: i,
1203
- notificationsListControls: j,
1204
- scrollableControls: L
1099
+ options: f.options,
1100
+ helpSection: f.helpSection,
1101
+ sidebarContentRef: h,
1102
+ initialSectionRef: b,
1103
+ notificationsListControls: N
1205
1104
  }
1206
1105
  )
1207
1106
  }
1208
1107
  )
1209
1108
  ] });
1210
- }, Oe = B(Jt, (t, r) => {
1211
- const { children: s, ...o } = t, { children: d, ...a } = r, f = Object.keys(o), m = Object.keys(a);
1212
- if (f.length !== m.length)
1109
+ }, Ae = T(Kt, (t, r) => {
1110
+ const { children: s, ...l } = t, { children: i, ...n } = r, c = Object.keys(l), m = Object.keys(n);
1111
+ if (c.length !== m.length)
1213
1112
  return !1;
1214
- for (const u of f) {
1215
- if (!Object.prototype.hasOwnProperty.call(a, u))
1113
+ for (const d of c) {
1114
+ if (!Object.prototype.hasOwnProperty.call(n, d))
1216
1115
  return !1;
1217
- const b = o[u], i = a[u];
1218
- if (b !== i)
1116
+ const h = l[d], b = n[d];
1117
+ if (h !== b)
1219
1118
  return !1;
1220
1119
  }
1221
1120
  return !0;
1222
1121
  });
1223
- Oe.displayName = "PyrionNavigationDrawer.LayoutBase";
1224
- const mt = B(({ children: t }) => /* @__PURE__ */ e.jsx(G.Outlet, { children: t }));
1225
- mt.displayName = "PyrionNavigationDrawer.IsolatedOutlet";
1226
- const pt = Ie(null), wr = () => {
1227
- const t = gt(pt);
1122
+ Ae.displayName = "PyrionNavigationDrawer.LayoutBase";
1123
+ const dt = T(({ children: t }) => /* @__PURE__ */ e.jsx(q.Outlet, { children: t }));
1124
+ dt.displayName = "PyrionNavigationDrawer.IsolatedOutlet";
1125
+ const ut = Le(null), br = () => {
1126
+ const t = pt(ut);
1228
1127
  if (!t)
1229
1128
  throw new Error("usePyrionLayout debe usarse dentro de PyrionLayout");
1230
1129
  return t;
1231
- }, Nr = ({ children: t, helpSection: r, state: s, links: o, onLinkClick: d, onNavigate: a, onLogoutClick: f, actions: m, activeActionId: u, onActionClick: b, tabsProps: i, currentSystemId: g, onSessionClick: x, onSystemLogoClick: j, onProfileClick: L, ...y }) => {
1232
- const k = Object.assign({
1130
+ }, xr = ({ children: t, helpSection: r, state: s, links: l, onLinkClick: i, onNavigate: n, onLogoutClick: c, actions: m, activeActionId: d, onActionClick: h, tabsProps: b, currentSystemId: w, onSessionClick: u, onSystemLogoClick: N, onProfileClick: y, ...f }) => {
1131
+ const D = Object.assign({
1233
1132
  closeDrawerOnNavigate: !0,
1234
1133
  disableDragOpen: {
1235
1134
  sidebar: !0,
1236
1135
  drawer: !1
1237
1136
  }
1238
- }, y.options), P = wt(), z = qe(), C = A(null), H = A(null), c = A({}), _ = A(null), M = A("notifications"), F = A(null), K = A(null), R = A(null), [I, $] = X(0), [ne, J] = X(!1), [oe, le] = X(null), he = h((l) => {
1239
- if (J(!1), d) {
1240
- d(l);
1137
+ }, f.options), P = bt(), R = We(), k = I(null), j = I({}), K = I(null), Y = I("notifications"), J = I(null), te = I(null), H = I(null), [M, E] = Z(0), [V, W] = Z(!1), [re, ne] = Z(null), se = x((a) => {
1138
+ if (W(!1), i) {
1139
+ i(a);
1241
1140
  return;
1242
1141
  }
1243
- const w = window.location.pathname;
1244
- P(l), k.closeDrawerOnNavigate && bt() && !c.current?.getIsCollapsed?.() && c.current?.toggleCollapse?.(), a && a(w, l);
1245
- }, [d, a, P]), de = (l) => {
1246
- l && window.open(l, "_blank");
1247
- }, Se = {
1142
+ const v = window.location.pathname;
1143
+ P(a), D.closeDrawerOnNavigate && ft() && !j.current?.getIsCollapsed?.() && j.current?.toggleCollapse?.(), n && n(v, a);
1144
+ }, [i, n, P]), ce = (a) => {
1145
+ a && window.open(a, "_blank");
1146
+ }, pe = {
1248
1147
  system: {
1249
- mobile: de,
1250
- desktop: (l) => {
1251
- typeof window < "u" && l && (window.location.href = l);
1148
+ mobile: ce,
1149
+ desktop: (a) => {
1150
+ typeof window < "u" && a && (window.location.href = a);
1252
1151
  }
1253
1152
  },
1254
1153
  product: {
1255
- mobile: de,
1256
- desktop: de
1154
+ mobile: ce,
1155
+ desktop: ce
1257
1156
  }
1258
- }, ie = h((l) => {
1259
- const w = z ? "mobile" : "desktop", O = s.enabled_systems.find((S) => S.name === l)?.url;
1260
- Se.system[w](O), i?.onTabClick?.(l);
1261
- }, [z, s.enabled_systems, i?.onTabClick]), Fe = h((l) => {
1262
- const w = z ? "mobile" : "desktop", O = s.company.products?.find((S) => S.name === l)?.domain;
1263
- Se.product[w](O), i?.onTabClick?.(l);
1264
- }, [z, s.company.products, i?.onTabClick]), je = h((l, w) => {
1265
- if (w) {
1266
- w(l), i?.onTabClick?.(l);
1157
+ }, Me = x((a) => {
1158
+ const v = R ? "mobile" : "desktop", O = s.enabled_systems.find((C) => C.name === a)?.url;
1159
+ pe.system[v](O), b?.onTabClick?.(a);
1160
+ }, [R, s.enabled_systems, b?.onTabClick]), ae = x((a) => {
1161
+ const v = R ? "mobile" : "desktop", O = s.company.products?.find((C) => C.name === a)?.domain;
1162
+ pe.product[v](O), b?.onTabClick?.(a);
1163
+ }, [R, s.company.products, b?.onTabClick]), Be = x((a, v) => {
1164
+ if (v) {
1165
+ v(a), b?.onTabClick?.(a);
1267
1166
  return;
1268
1167
  } else
1269
- i?.onTabClick?.(l);
1270
- }, [i?.onTabClick]), ke = h(() => {
1271
- const l = {};
1168
+ b?.onTabClick?.(a);
1169
+ }, [b?.onTabClick]), Ce = x(() => {
1170
+ const a = {};
1272
1171
  s.enabled_systems.forEach((O) => {
1273
- l[O.url] = O.name;
1172
+ a[O.url] = O.name;
1274
1173
  });
1275
- const w = window.location.origin;
1276
- for (const [O, S] of Object.entries(l))
1277
- if (w === O)
1278
- return S;
1174
+ const v = window.location.origin;
1175
+ for (const [O, C] of Object.entries(a))
1176
+ if (v === O)
1177
+ return C;
1279
1178
  return "";
1280
- }, [s.enabled_systems]), ae = i?.currentTabName || ke(), xe = ue(
1179
+ }, [s.enabled_systems]), je = b?.currentTabName || Ce(), G = ue(
1281
1180
  () => s.sessions || [],
1282
1181
  [s.sessions]
1283
- ), n = (l) => l == null ? null : typeof l == "string" || typeof l == "number" || typeof l == "boolean" ? String(l) : Ne(l) ? l : typeof l == "object" ? JSON.stringify(l) : null, p = h((l, w) => {
1284
- if (!l) return null;
1285
- if (Array.isArray(l)) {
1286
- const O = l?.[0] ? we(w, l[0]) : null, S = l?.[1] ? we(w, l[1]) : null, Z = n(O), ze = n(S);
1182
+ ), oe = (a) => a == null ? null : typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : ge(a) ? a : typeof a == "object" ? JSON.stringify(a) : null, o = x((a, v) => {
1183
+ if (!a) return null;
1184
+ if (Array.isArray(a)) {
1185
+ const O = a?.[0] ? xe(v, a[0]) : null, C = a?.[1] ? xe(v, a[1]) : null, z = oe(O), de = oe(C);
1287
1186
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1288
- /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-break-spaces min-w-1/2", children: Z }),
1289
- ze && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-[40%] overflow-hidden", children: [
1187
+ /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-break-spaces min-w-1/2", children: z }),
1188
+ de && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-[40%] overflow-hidden", children: [
1290
1189
  /* @__PURE__ */ e.jsx("span", { className: "size-0.5 bg-[--neutral-300] rounded-full" }),
1291
- /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis", children: ze })
1190
+ /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 whitespace-pre text-ellipsis", children: de })
1292
1191
  ] })
1293
1192
  ] });
1294
1193
  }
1295
- if (typeof l == "string") {
1296
- const O = we(w, l);
1297
- return n(O);
1194
+ if (typeof a == "string") {
1195
+ const O = xe(v, a);
1196
+ return oe(O);
1298
1197
  }
1299
- return typeof l == "function" ? n(l(w)) : null;
1300
- }, []), v = h(
1301
- (l) => {
1302
- const w = k?.userCardOptions?.secondarySlot;
1303
- if (!w) return null;
1304
- const O = s.enabled_systems?.find((Z) => Z._id === g), S = { company: s.company, user: s.user, system: O, metadata: l };
1305
- return p(w, S);
1198
+ return typeof a == "function" ? oe(a(v)) : null;
1199
+ }, []), p = x(
1200
+ (a) => {
1201
+ const v = D?.userCardOptions?.secondarySlot;
1202
+ if (!v) return null;
1203
+ const O = s.enabled_systems?.find((z) => z._id === w), C = { company: s.company, user: s.user, system: O, metadata: a };
1204
+ return o(v, C);
1306
1205
  },
1307
- [g, k?.userCardOptions?.secondarySlot, p, s.company, s.enabled_systems, s.user]
1308
- ), E = h(
1309
- (l) => {
1310
- const w = k?.sessionCardOptions?.secondarySlot || k?.userCardOptions?.secondarySlot;
1311
- if (!w) return null;
1312
- const O = s.enabled_systems?.find((Z) => Z._id === g), S = { company: s.company, user: l.auth_id, metadata: l?.metadata, system: O };
1313
- return p(w, S);
1206
+ [w, D?.userCardOptions?.secondarySlot, o, s.company, s.enabled_systems, s.user]
1207
+ ), g = x(
1208
+ (a) => {
1209
+ const v = D?.sessionCardOptions?.secondarySlot || D?.userCardOptions?.secondarySlot;
1210
+ if (!v) return null;
1211
+ const O = s.enabled_systems?.find((z) => z._id === w), C = { company: s.company, user: a.auth_id, metadata: a?.metadata, system: O };
1212
+ return o(v, C);
1314
1213
  },
1315
- [g, k?.sessionCardOptions?.secondarySlot, k?.userCardOptions?.secondarySlot, p, s.company]
1316
- ), W = ue(() => {
1317
- const l = [];
1318
- return c.current.openNotifications = () => {
1319
- M.current = "notifications", c.current.openSidebar?.(), _.current?.setActiveSection("notifications");
1320
- }, c.current.openHelp = () => {
1321
- M.current = "help", c.current.openSidebar?.(), _.current?.setActiveSection("help");
1322
- }, !k?.notificationsDrawerOptions?.hideActionButton && !k?.notificationsDrawerOptions?.hide && l.push({
1214
+ [w, D?.sessionCardOptions?.secondarySlot, D?.userCardOptions?.secondarySlot, o, s.company]
1215
+ ), L = ue(() => {
1216
+ const a = [];
1217
+ return j.current.openNotifications = () => {
1218
+ Y.current = "notifications", j.current.openSidebar?.(), K.current?.setActiveSection("notifications");
1219
+ }, j.current.openHelp = () => {
1220
+ Y.current = "help", j.current.openSidebar?.(), K.current?.setActiveSection("help");
1221
+ }, !D?.notificationsDrawerOptions?.hideActionButton && !D?.notificationsDrawerOptions?.hide && a.push({
1323
1222
  id: "notifications",
1324
1223
  title: "Notificaciones",
1325
- icon: Xe,
1326
- onClick: c.current.openNotifications,
1327
- count: I
1328
- }), !k?.helpSectionDrawerOptions?.hideActionButton && r && !k?.helpSectionDrawerOptions?.hide && l.push({
1224
+ icon: qe,
1225
+ onClick: j.current.openNotifications,
1226
+ count: M
1227
+ }), !D?.helpSectionDrawerOptions?.hideActionButton && r && !D?.helpSectionDrawerOptions?.hide && a.push({
1329
1228
  id: "help",
1330
1229
  title: "Ayuda",
1331
- icon: Je,
1332
- onClick: c.current.openHelp
1333
- }), k?.configurationActionOptions?.onClick && !k?.configurationActionOptions?.hideActionButton && l.push({
1230
+ icon: Ke,
1231
+ onClick: j.current.openHelp
1232
+ }), D?.configurationActionOptions?.onClick && !D?.configurationActionOptions?.hideActionButton && a.push({
1334
1233
  id: "configuration",
1335
1234
  title: "Configuracion",
1336
- icon: Lt,
1337
- onClick: k.configurationActionOptions?.onClick
1338
- }), l;
1339
- }, [k, r, b, I]), V = ue(
1340
- () => [...W, ...m || []],
1341
- [W, m]
1342
- ), Y = ue(() => {
1343
- const l = s.enabled_systems.map((S) => ({
1344
- name: S.name,
1345
- thumbnail: S.thumbnail,
1346
- onClick: ie,
1347
- id: S._id
1348
- })) || [], w = i?.customTabs?.map((S) => ({
1349
- ...S,
1350
- onClick: () => je(S.name, S?.onClick)
1351
- })) || [], O = s.company.products?.map((S) => ({
1352
- name: S.name,
1353
- thumbnail: S.thumbnail,
1354
- onClick: Fe
1235
+ icon: St,
1236
+ onClick: D.configurationActionOptions?.onClick
1237
+ }), a;
1238
+ }, [D, r, h, M]), B = ue(
1239
+ () => [...L, ...m || []],
1240
+ [L, m]
1241
+ ), _ = ue(() => {
1242
+ const a = s.enabled_systems.map((C) => ({
1243
+ name: C.name,
1244
+ thumbnail: C.thumbnail,
1245
+ onClick: Me,
1246
+ id: C._id
1247
+ })) || [], v = b?.customTabs?.map((C) => ({
1248
+ ...C,
1249
+ onClick: () => Be(C.name, C?.onClick)
1250
+ })) || [], O = s.company.products?.map((C) => ({
1251
+ name: C.name,
1252
+ thumbnail: C.thumbnail,
1253
+ onClick: ae
1355
1254
  })) || [];
1356
- return [...l, ...w, ...O];
1357
- }, [s.enabled_systems, s.company.products, i?.customTabs]), ee = h((l, w) => {
1358
- C.current?.addNewNotification ? C.current.addNewNotification(l, w) : console.warn("Notifications controls not ready yet");
1359
- }, []), te = h((l) => C.current?.subscribeToUpdates ? C.current.subscribeToUpdates(l) : (console.warn("Notifications controls not ready yet"), () => {
1360
- }), []), ge = h((l) => {
1361
- C.current?.removeNotification ? C.current.removeNotification(l) : console.warn("Notifications controls not ready yet");
1362
- }, []), ve = h(() => {
1363
- C.current?.removeAllNotifications ? C.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
1364
- }, []), D = h((l) => {
1365
- C.current?.setNotifications ? C.current.setNotifications(l) : console.warn("Notifications controls not ready yet");
1366
- }, []), q = h((l, w) => H.current?.subscribeToScrollTarget ? H.current.subscribeToScrollTarget(l, w) : (console.warn("Scrollable controls not ready yet"), () => {
1367
- }), []), U = h((l) => {
1368
- C.current?.setLoading ? C.current.setLoading(l) : console.warn("Notifications controls not ready yet");
1369
- }, []), re = h((l, w, O) => {
1370
- const S = /* @__PURE__ */ e.jsxs("div", { className: T(" bg-black/60 z-200 inset-0 h-full w-full grid place-items-center text-neutral-default-default", w ? "fixed" : "sticky"), children: [
1371
- !O && /* @__PURE__ */ e.jsx(fe, { label: "", icon: /* @__PURE__ */ e.jsx(_e, {}), onClick: () => J(!1), variant: "text", className: "absolute top-0 right-0", size: "small", color: "secondary" }),
1372
- typeof l == "function" ? l() : l
1255
+ return [...a, ...v, ...O];
1256
+ }, [s.enabled_systems, s.company.products, b?.customTabs]), Q = x((a) => {
1257
+ k.current?.addNewNotification ? k.current.addNewNotification(a) : console.warn("Notifications controls not ready yet");
1258
+ }, []), $ = x((a) => k.current?.subscribeToUpdates ? k.current.subscribeToUpdates(a) : (console.warn("Notifications controls not ready yet"), () => {
1259
+ }), []), le = x((a) => {
1260
+ k.current?.removeNotification ? k.current.removeNotification(a) : console.warn("Notifications controls not ready yet");
1261
+ }, []), he = x(() => {
1262
+ k.current?.removeAllNotifications ? k.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
1263
+ }, []), be = x((a) => {
1264
+ k.current?.setNotifications ? k.current.setNotifications(a) : console.warn("Notifications controls not ready yet");
1265
+ }, []), S = x((a, v, O) => {
1266
+ const C = /* @__PURE__ */ e.jsxs("div", { className: A(" bg-black/60 z-200 inset-0 h-full w-full grid place-items-center text-neutral-default-default", v ? "fixed" : "sticky"), children: [
1267
+ !O && /* @__PURE__ */ e.jsx(fe, { label: "", icon: /* @__PURE__ */ e.jsx(Ie, {}), onClick: () => W(!1), variant: "text", className: "absolute top-0 right-0", size: "small", color: "secondary" }),
1268
+ typeof a == "function" ? a() : a
1373
1269
  ] });
1374
- let Z;
1375
- return w ? Z = He(S, document.body, `modal-error-${Date.now()}`) : R.current && (Z = He(S, R.current, `modal-error-${Date.now()}`)), le(Z), J(!0), S;
1376
- }, [R]), De = h(() => {
1377
- J(!1);
1270
+ let z;
1271
+ return v ? z = ze(C, document.body, `modal-error-${Date.now()}`) : H.current && (z = ze(C, H.current, `modal-error-${Date.now()}`)), ne(z), W(!0), C;
1272
+ }, [H]), U = x(() => {
1273
+ W(!1);
1378
1274
  }, []);
1379
- return c.current.addNewNotification = ee, c.current.subscribeToNotificationsUpdates = te, c.current.removeNotification = ge, c.current.removeAllNotifications = ve, c.current.setNotifications = D, c.current.setNotificationsLoading = U, c.current.subscribeToNotificationsScroll = q, c.current.showErrorModal = re, c.current.closeErrorModal = De, Q(() => {
1380
- te((l, w) => {
1381
- $(w);
1275
+ return j.current.addNewNotification = Q, j.current.subscribeToNotificationsUpdates = $, j.current.removeNotification = le, j.current.removeAllNotifications = he, j.current.setNotifications = be, j.current.showErrorModal = S, j.current.closeErrorModal = U, X(() => {
1276
+ $((a, v) => {
1277
+ E(v);
1382
1278
  });
1383
- }, [te]), /* @__PURE__ */ e.jsxs(pt.Provider, { value: c.current, children: [
1384
- ne && oe,
1385
- z ? /* @__PURE__ */ e.jsx("div", { className: "flex h-screen", children: /* @__PURE__ */ e.jsx(
1386
- Oe,
1279
+ }, [$]), /* @__PURE__ */ e.jsxs(ut.Provider, { value: j.current, children: [
1280
+ V && re,
1281
+ R ? /* @__PURE__ */ e.jsx("div", { className: "flex h-screen", children: /* @__PURE__ */ e.jsx(
1282
+ Ae,
1387
1283
  {
1388
- links: o,
1389
- handleNavigation: he,
1390
- allActions: V,
1391
- activeActionId: u,
1392
- onActionClick: b,
1284
+ links: l,
1285
+ handleNavigation: se,
1286
+ allActions: B,
1287
+ activeActionId: d,
1288
+ onActionClick: h,
1393
1289
  state: s,
1394
- currentAppSessions: xe,
1395
- resolveUserSecondarySlot: v,
1396
- resolveSessionSecondarySlot: E,
1397
- onSessionClick: x,
1398
- onLogoutClick: f,
1399
- options: k,
1400
- currentSystemId: g,
1401
- userOptionsControls: F,
1402
- mobileAppSwitcherControls: K,
1403
- onSystemLogoClick: j,
1404
- tabs: Y,
1290
+ currentAppSessions: G,
1291
+ resolveUserSecondarySlot: p,
1292
+ resolveSessionSecondarySlot: g,
1293
+ onSessionClick: u,
1294
+ onLogoutClick: c,
1295
+ options: D,
1296
+ currentSystemId: w,
1297
+ userOptionsControls: J,
1298
+ mobileAppSwitcherControls: te,
1299
+ onSystemLogoClick: N,
1300
+ tabs: _,
1405
1301
  helpSection: r,
1406
- sidebarContentRef: _,
1407
- initialSectionRef: M,
1408
- navigationControlsRef: c,
1409
- notificationsListControls: C,
1410
- scrollableControls: H,
1411
- outletRef: R,
1412
- onProfileClick: L,
1302
+ sidebarContentRef: K,
1303
+ initialSectionRef: Y,
1304
+ navigationControlsRef: j,
1305
+ notificationsListControls: k,
1306
+ outletRef: H,
1307
+ onProfileClick: y,
1413
1308
  children: t
1414
1309
  }
1415
1310
  ) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex h-screen", children: [
1416
- Y.length > 0 && /* @__PURE__ */ e.jsx(
1417
- Tt,
1311
+ _.length > 0 && /* @__PURE__ */ e.jsx(
1312
+ gt,
1418
1313
  {
1419
1314
  className: "hidden md:flex",
1420
- tabs: Y,
1315
+ tabs: _,
1421
1316
  activeColor: "var(--neutral-900)",
1422
- currentTabName: ae,
1423
- currentSystemId: g
1317
+ currentTabName: je,
1318
+ currentSystemId: w
1424
1319
  }
1425
1320
  ),
1426
1321
  /* @__PURE__ */ e.jsx(
1427
- Oe,
1322
+ Ae,
1428
1323
  {
1429
- links: o,
1430
- handleNavigation: he,
1431
- allActions: V,
1432
- activeActionId: u,
1433
- onActionClick: b,
1324
+ links: l,
1325
+ handleNavigation: se,
1326
+ allActions: B,
1327
+ activeActionId: d,
1328
+ onActionClick: h,
1434
1329
  state: s,
1435
- currentAppSessions: xe,
1436
- resolveUserSecondarySlot: v,
1437
- resolveSessionSecondarySlot: E,
1438
- onSessionClick: x,
1439
- onLogoutClick: f,
1440
- options: k,
1441
- currentSystemId: g,
1442
- userOptionsControls: F,
1443
- mobileAppSwitcherControls: K,
1444
- onSystemLogoClick: j,
1445
- tabs: Y,
1330
+ currentAppSessions: G,
1331
+ resolveUserSecondarySlot: p,
1332
+ resolveSessionSecondarySlot: g,
1333
+ onSessionClick: u,
1334
+ onLogoutClick: c,
1335
+ options: D,
1336
+ currentSystemId: w,
1337
+ userOptionsControls: J,
1338
+ mobileAppSwitcherControls: te,
1339
+ onSystemLogoClick: N,
1340
+ tabs: _,
1446
1341
  helpSection: r,
1447
- sidebarContentRef: _,
1448
- initialSectionRef: M,
1449
- navigationControlsRef: c,
1450
- notificationsListControls: C,
1451
- scrollableControls: H,
1452
- outletRef: R,
1453
- onProfileClick: L,
1342
+ sidebarContentRef: K,
1343
+ initialSectionRef: Y,
1344
+ navigationControlsRef: j,
1345
+ notificationsListControls: k,
1346
+ outletRef: H,
1347
+ onProfileClick: y,
1454
1348
  children: t
1455
1349
  }
1456
1350
  )
@@ -1458,6 +1352,6 @@ const pt = Ie(null), wr = () => {
1458
1352
  ] });
1459
1353
  };
1460
1354
  export {
1461
- Nr as default,
1462
- wr as u
1355
+ xr as default,
1356
+ br as u
1463
1357
  };