prometeo-design-system 4.7.5 → 4.7.7

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