prometeo-design-system 4.3.3 → 4.3.6

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