prometeo-design-system 4.8.0 → 4.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PyrionLayout.es.js +281 -281
- package/dist/Scrollable.es.js +58 -58
- package/package.json +1 -1
package/dist/PyrionLayout.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
2
|
import { u as Je, g as Nt } from "./useDevice-vwn4GLwK.js";
|
|
3
3
|
import { c as D } from "./cn-B6yFEsav.js";
|
|
4
|
-
import { g as
|
|
5
|
-
import qe, { forwardRef as be, useState as J, useRef as O, useEffect as se, memo as M, useContext as Ge, createContext as Me, useCallback as h, Children as yt, isValidElement as ke, useMemo as
|
|
4
|
+
import { g as Se } from "./utils-X4-h3cum.js";
|
|
5
|
+
import qe, { forwardRef as be, useState as J, useRef as O, useEffect as se, memo as M, useContext as Ge, createContext as Me, useCallback as h, Children as yt, isValidElement as ke, useMemo as pe, useImperativeHandle as Re, useLayoutEffect as Ct, use as jt } from "react";
|
|
6
6
|
import { createPortal as $e } from "react-dom";
|
|
7
|
-
import { useLocation as
|
|
8
|
-
import
|
|
7
|
+
import { useLocation as St, useNavigate as kt } from "react-router";
|
|
8
|
+
import ce from "./Skeleton.es.js";
|
|
9
9
|
import { CloseNavBarDesktop as Lt } from "./Icons/CloseNavBarDesktop.es.js";
|
|
10
10
|
import { c as Be } from "./index-BOQuZ0gG.js";
|
|
11
11
|
import { B as Qe } from "./badge-BEx-0Q-K.js";
|
|
@@ -17,13 +17,13 @@ import Ze from "./UserCard.es.js";
|
|
|
17
17
|
import he from "./Button.es.js";
|
|
18
18
|
import { Logout as Tt } from "./Icons/Logout.es.js";
|
|
19
19
|
import Ot from "./NotificationCard.es.js";
|
|
20
|
-
import { T as
|
|
20
|
+
import { T as It, a as Et } from "./TabLinks-DnoWdrdk.js";
|
|
21
21
|
import { Notifications as et } from "./Icons/Notifications.es.js";
|
|
22
22
|
import { Close as Fe } from "./Icons/Close.es.js";
|
|
23
23
|
import { Help as tt } from "./Icons/Help.es.js";
|
|
24
24
|
import { Settings as _t } from "./Icons/Settings.es.js";
|
|
25
25
|
const Pt = be((t, r) => {
|
|
26
|
-
const [s,
|
|
26
|
+
const [s, a] = J(t?.currentTabName || t.tabs[0]?.name), c = O(null), { tabs: l = [], className: d, activeColor: i = "var(--neutral-900)", currentSystemId: f, isLoading: p = !1 } = t;
|
|
27
27
|
console.log("tabs en el tabswitch del layout", l, f), se(() => {
|
|
28
28
|
c.current?.style.setProperty("--tab-bg", i);
|
|
29
29
|
}, [i]);
|
|
@@ -59,11 +59,11 @@ const Pt = be((t, r) => {
|
|
|
59
59
|
"tab-thumbnail-icon",
|
|
60
60
|
"bg-transparent text-neutral-default-default",
|
|
61
61
|
m?.className
|
|
62
|
-
), children: /* @__PURE__ */ e.jsx(
|
|
62
|
+
), children: /* @__PURE__ */ e.jsx(ce, { shape: "rounded", className: "w-full h-full" }) })
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
const
|
|
66
|
-
m.disabled || (
|
|
65
|
+
const j = 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
|
+
m.disabled || (a(m?.name), m.onClick && m.onClick(m?.name));
|
|
67
67
|
};
|
|
68
68
|
return /* @__PURE__ */ e.jsx(
|
|
69
69
|
"div",
|
|
@@ -74,7 +74,7 @@ const Pt = be((t, r) => {
|
|
|
74
74
|
"flex items-center pl-[6px] ",
|
|
75
75
|
"rounded-l-[8px]",
|
|
76
76
|
"tabswitch-element relative",
|
|
77
|
-
|
|
77
|
+
j && "active"
|
|
78
78
|
),
|
|
79
79
|
onClick: y,
|
|
80
80
|
ref: c,
|
|
@@ -92,8 +92,8 @@ const Pt = be((t, r) => {
|
|
|
92
92
|
)
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
|
-
}), rt = M(be(({ children: t, className: r, context: s, modal:
|
|
96
|
-
const i = ge(t, s), f = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: p } = Mt(), { closeSidebar: x } =
|
|
95
|
+
}), rt = M(be(({ children: t, className: r, context: s, modal: a = !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 } = de(), [m, b] = J(() => l ? p : !0), [j, k] = J(!1);
|
|
97
97
|
return se(() => {
|
|
98
98
|
l && s?.subscribeToSidebarOpen((y) => {
|
|
99
99
|
y ? (k(!1), b(!0)) : k(!0);
|
|
@@ -102,11 +102,11 @@ const Pt = be((t, r) => {
|
|
|
102
102
|
const y = d && typeof d == "object" && "current" in d ? d.current : null;
|
|
103
103
|
if (!y) return;
|
|
104
104
|
const C = () => {
|
|
105
|
-
|
|
105
|
+
j && (b(!1), k(!1));
|
|
106
106
|
};
|
|
107
107
|
return y.addEventListener("transitionend", C), () => y.removeEventListener("transitionend", C);
|
|
108
|
-
}, [
|
|
109
|
-
|
|
108
|
+
}, [j]), /* @__PURE__ */ e.jsxs("div", { ref: d, className: D("sidebar", f ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": a || void 0, children: [
|
|
109
|
+
a && f && /* @__PURE__ */ e.jsx(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
112
112
|
className: D("navigation-drawer-sidebar-overlay"),
|
|
@@ -125,7 +125,7 @@ const Pt = be((t, r) => {
|
|
|
125
125
|
const t = Ge(st);
|
|
126
126
|
if (!t) throw new Error("useDrawerState must be used within NavigationDrawer");
|
|
127
127
|
return t;
|
|
128
|
-
},
|
|
128
|
+
}, de = () => {
|
|
129
129
|
const t = Ge(nt);
|
|
130
130
|
if (!t) throw new Error("useDrawerActions must be used within NavigationDrawer");
|
|
131
131
|
return t;
|
|
@@ -144,44 +144,44 @@ const Pt = be((t, r) => {
|
|
|
144
144
|
} catch {
|
|
145
145
|
}
|
|
146
146
|
}, Bt = (t) => {
|
|
147
|
-
const { children: r, classNameDrawer: s, classNameSidebar:
|
|
147
|
+
const { children: r, classNameDrawer: s, classNameSidebar: a, disableDragOpen: c, modal: l = !0, closeOnOutsideClick: d = !0 } = t, i = O(null), f = O(null), p = t.outletRef ?? O(null), x = O(null), m = O(Ke()), b = O(!1), j = O("drawer"), k = O(/* @__PURE__ */ new Set()), y = O(/* @__PURE__ */ new Set()), C = O(!1), A = O(null), H = h((n) => {
|
|
148
148
|
const u = f.current;
|
|
149
149
|
u && (u.classList.toggle("collapsed", n), u.classList.toggle("expanded", !n));
|
|
150
|
-
}, []),
|
|
150
|
+
}, []), K = h((n) => {
|
|
151
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
|
-
}, []),
|
|
156
|
+
}, []), S = h(
|
|
157
157
|
(n, { notify: u = !0 } = {}) => {
|
|
158
158
|
const v = m.current !== n;
|
|
159
|
-
m.current = n, Rt(n),
|
|
159
|
+
m.current = n, Rt(n), H(n), u && v && k.current.forEach((E) => E(n));
|
|
160
160
|
},
|
|
161
|
-
[
|
|
161
|
+
[H]
|
|
162
162
|
), U = h(
|
|
163
163
|
(n, { notify: u = !0 } = {}) => {
|
|
164
164
|
const v = b.current !== n;
|
|
165
|
-
if (b.current = n,
|
|
166
|
-
const
|
|
167
|
-
y.current.forEach((
|
|
165
|
+
if (b.current = n, K(n), u && v) {
|
|
166
|
+
const E = !n;
|
|
167
|
+
y.current.forEach((V) => V(E));
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
|
-
[
|
|
170
|
+
[K]
|
|
171
171
|
), N = h(
|
|
172
172
|
(n, { notify: u = !0 } = {}) => {
|
|
173
|
-
const v =
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
u &&
|
|
173
|
+
const v = j.current, E = v !== n;
|
|
174
|
+
j.current = n, window.matchMedia("(min-width: 768px)").matches || S(n !== "drawer", { notify: u });
|
|
175
|
+
const V = v === "sidebar", B = n === "sidebar";
|
|
176
|
+
u && E && V !== B && y.current.forEach((te) => te(B)), U(n !== "sidebar", { notify: u }), S(n !== "drawer", { notify: u });
|
|
177
177
|
},
|
|
178
|
-
[
|
|
179
|
-
),
|
|
178
|
+
[S, U]
|
|
179
|
+
), $ = h((n) => {
|
|
180
180
|
const u = i.current;
|
|
181
181
|
if (!u || window.matchMedia("(min-width: 768px)").matches) return;
|
|
182
182
|
C.current = !0;
|
|
183
|
-
const v = p.current?.offsetLeft ?? 0,
|
|
184
|
-
A.current =
|
|
183
|
+
const v = p.current?.offsetLeft ?? 0, E = x.current?.offsetLeft ?? v, V = n === "drawer" ? 0 : n === "sidebar" ? E : v;
|
|
184
|
+
A.current = V, u.scrollTo({ left: V, behavior: "smooth" });
|
|
185
185
|
const B = () => {
|
|
186
186
|
C.current = !1, A.current = null, u.removeEventListener("scrollend", B);
|
|
187
187
|
};
|
|
@@ -194,13 +194,13 @@ const Pt = be((t, r) => {
|
|
|
194
194
|
const v = [
|
|
195
195
|
{ panel: "drawer", offset: 0 },
|
|
196
196
|
{ panel: "outlet", offset: u.offsetLeft }
|
|
197
|
-
],
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
let B = v[0], te = Math.abs(
|
|
197
|
+
], E = x.current;
|
|
198
|
+
E && v.push({ panel: "sidebar", offset: E.offsetLeft });
|
|
199
|
+
const V = n.scrollLeft;
|
|
200
|
+
let B = v[0], te = Math.abs(V - B.offset);
|
|
201
201
|
for (let oe = 1; oe < v.length; oe++) {
|
|
202
|
-
const
|
|
203
|
-
|
|
202
|
+
const me = Math.abs(V - v[oe].offset);
|
|
203
|
+
me < te && (B = v[oe], te = me);
|
|
204
204
|
}
|
|
205
205
|
N(B.panel);
|
|
206
206
|
}, [N]);
|
|
@@ -211,52 +211,52 @@ const Pt = be((t, r) => {
|
|
|
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
|
|
215
|
-
|
|
214
|
+
const E = Ke();
|
|
215
|
+
S(E, { notify: !1 }), U(!0, { notify: !1 });
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
218
|
requestAnimationFrame(() => {
|
|
219
219
|
n.scrollLeft = u.offsetLeft, N("outlet");
|
|
220
220
|
});
|
|
221
|
-
}, [N,
|
|
221
|
+
}, [N, S, U]), se(() => {
|
|
222
222
|
const n = i.current;
|
|
223
223
|
if (!n || !p.current) return;
|
|
224
|
-
let v = !1,
|
|
224
|
+
let v = !1, E = 0, V = 0;
|
|
225
225
|
const B = (L) => {
|
|
226
|
-
|
|
226
|
+
E = L.touches[0].clientX, V = L.touches[0].clientY;
|
|
227
227
|
}, te = (L, Y) => {
|
|
228
|
-
const
|
|
228
|
+
const W = window.getComputedStyle(L), le = Y === "x" ? W.overflowX : W.overflowY;
|
|
229
229
|
return /(auto|scroll|overlay)/.test(le) ? Y === "x" ? L.scrollWidth > L.clientWidth : L.scrollHeight > L.clientHeight : !1;
|
|
230
230
|
}, oe = (L, Y) => {
|
|
231
|
-
let
|
|
232
|
-
for (;
|
|
233
|
-
if (te(
|
|
234
|
-
return
|
|
235
|
-
|
|
231
|
+
let W = L;
|
|
232
|
+
for (; W && W !== n; ) {
|
|
233
|
+
if (te(W, Y))
|
|
234
|
+
return W;
|
|
235
|
+
W = W.parentElement;
|
|
236
236
|
}
|
|
237
237
|
return null;
|
|
238
|
-
},
|
|
238
|
+
}, me = (L, Y, W) => W === 0 ? !1 : Y === "x" ? W < 0 ? L.scrollLeft + L.clientWidth < L.scrollWidth : L.scrollLeft > 0 : W < 0 ? L.scrollTop + L.clientHeight < L.scrollHeight : L.scrollTop > 0, Ne = (L) => {
|
|
239
239
|
if (!(L.target instanceof HTMLElement)) return;
|
|
240
|
-
const Y = L.touches[0].clientX -
|
|
241
|
-
if (Ce &&
|
|
240
|
+
const Y = L.touches[0].clientX - E, W = L.touches[0].clientY - V, le = Math.abs(Y) > Math.abs(W) ? "x" : "y", Ie = le === "x" ? Y : W, Ce = oe(L.target, le);
|
|
241
|
+
if (Ce && me(Ce, le, Ie))
|
|
242
242
|
return;
|
|
243
|
-
const
|
|
243
|
+
const je = n.classList.contains("disabled-dragopen"), o = n.classList.contains("disabled-dragopen-sidebar"), w = () => L.cancelable ? (L.preventDefault(), !0) : !1;
|
|
244
244
|
if (le === "x") {
|
|
245
245
|
if (Y > 0) {
|
|
246
|
-
if (
|
|
246
|
+
if (j.current === "sidebar" && !o) {
|
|
247
247
|
v = !0;
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
|
-
if (
|
|
250
|
+
if (je) {
|
|
251
251
|
w();
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
254
|
} else if (Y < 0) {
|
|
255
|
-
if (
|
|
255
|
+
if (j.current === "drawer" && !je) {
|
|
256
256
|
v = !0;
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
|
-
if (
|
|
259
|
+
if (o) {
|
|
260
260
|
w();
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
@@ -275,20 +275,20 @@ const Pt = be((t, r) => {
|
|
|
275
275
|
const q = h(() => {
|
|
276
276
|
const n = window.matchMedia("(min-width: 768px)").matches, u = !m.current;
|
|
277
277
|
if (n) {
|
|
278
|
-
|
|
278
|
+
S(u);
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
281
|
const v = u ? "outlet" : "drawer";
|
|
282
|
-
N(v),
|
|
283
|
-
}, [
|
|
282
|
+
N(v), $(v);
|
|
283
|
+
}, [$, N, S]), X = O(null);
|
|
284
284
|
X.current || (X.current = {
|
|
285
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
|
|
291
|
-
return B !== m.current && (m.current = B,
|
|
290
|
+
const E = u.scrollLeft, V = v.offsetLeft, B = Math.abs(E - V) < Math.abs(E - 0);
|
|
291
|
+
return B !== m.current && (m.current = B, H(B)), B;
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
return m.current;
|
|
@@ -302,7 +302,7 @@ const Pt = be((t, r) => {
|
|
|
302
302
|
U(!1);
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
N("sidebar"),
|
|
305
|
+
N("sidebar"), $("sidebar");
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
308
|
closeSidebar: () => {
|
|
@@ -310,7 +310,7 @@ const Pt = be((t, r) => {
|
|
|
310
310
|
U(!0);
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
N("outlet"),
|
|
313
|
+
N("outlet"), $("outlet");
|
|
314
314
|
},
|
|
315
315
|
toggleSidebar: () => {
|
|
316
316
|
if (!x.current) return;
|
|
@@ -318,10 +318,10 @@ const Pt = be((t, r) => {
|
|
|
318
318
|
U(!b.current);
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
const n =
|
|
322
|
-
N(n),
|
|
321
|
+
const n = j.current === "sidebar" ? "outlet" : "sidebar";
|
|
322
|
+
N(n), $(n);
|
|
323
323
|
},
|
|
324
|
-
getIsSidebarOpen: () => x.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current :
|
|
324
|
+
getIsSidebarOpen: () => x.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current : j.current === "sidebar" : !1,
|
|
325
325
|
subscribeToSidebarOpen: (n) => (y.current.add(n), () => {
|
|
326
326
|
y.current.delete(n);
|
|
327
327
|
}),
|
|
@@ -330,10 +330,10 @@ const Pt = be((t, r) => {
|
|
|
330
330
|
if (!u) return;
|
|
331
331
|
const v = u.scrollLeft;
|
|
332
332
|
if (n) {
|
|
333
|
-
const
|
|
333
|
+
const E = 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 =
|
|
336
|
+
u.style.scrollBehavior = E;
|
|
337
337
|
});
|
|
338
338
|
});
|
|
339
339
|
} else
|
|
@@ -343,17 +343,17 @@ const Pt = be((t, r) => {
|
|
|
343
343
|
const u = i.current;
|
|
344
344
|
if (u)
|
|
345
345
|
if (n) {
|
|
346
|
-
const v = u.scrollLeft,
|
|
346
|
+
const v = u.scrollLeft, E = 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 =
|
|
349
|
+
u.style.scrollBehavior = E;
|
|
350
350
|
});
|
|
351
351
|
});
|
|
352
352
|
} else
|
|
353
353
|
u.classList.add("disabled-dragopen-sidebar");
|
|
354
354
|
}
|
|
355
355
|
});
|
|
356
|
-
const
|
|
356
|
+
const I = X.current, _ = typeof r == "function" ? r(I) : r, g = yt.toArray(_);
|
|
357
357
|
let P = null, R = null, z = null;
|
|
358
358
|
const Q = [];
|
|
359
359
|
let ae = null, Z = null;
|
|
@@ -384,11 +384,11 @@ const Pt = be((t, r) => {
|
|
|
384
384
|
}
|
|
385
385
|
Q.push(n);
|
|
386
386
|
});
|
|
387
|
-
const ve = !!R, we = R ?? (Q.length ? /* @__PURE__ */ e.jsx(Le, { children: Q }) : null), Ae = ve ? Q : [],
|
|
387
|
+
const ve = !!R, we = R ?? (Q.length ? /* @__PURE__ */ e.jsx(Le, { children: Q }) : null), Ae = ve ? Q : [], ue = ae ?? (!!ae ? /* @__PURE__ */ e.jsx(_e, { children: _, context: I, modal: l, closeOnOutsideClick: d }) : null), Te = z ?? (!!z ? /* @__PURE__ */ e.jsx(De, { children: z }) : null), Oe = !!Z, ee = Z, fe = pe(() => ({
|
|
388
388
|
isCollapsed: m.current,
|
|
389
389
|
isSidebarOpen: !b.current
|
|
390
390
|
}), [m.current, b.current]);
|
|
391
|
-
return /* @__PURE__ */ e.jsx(st.Provider, { value:
|
|
391
|
+
return /* @__PURE__ */ e.jsx(st.Provider, { value: fe, children: /* @__PURE__ */ e.jsx(nt.Provider, { value: I, 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
393
|
Oe ? "navigation-drawer-with-sidebar" : "navigation-drawer",
|
|
394
394
|
c?.drawer ? "disabled-dragopen" : "",
|
|
@@ -418,10 +418,10 @@ const Pt = be((t, r) => {
|
|
|
418
418
|
]
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
|
-
|
|
421
|
+
ue && ke(ue) ? qe.cloneElement(ue, { ref: p, modal: l, closeOnOutsideClick: d }) : ue,
|
|
422
422
|
ee && ke(ee) ? qe.cloneElement(ee, {
|
|
423
423
|
ref: x,
|
|
424
|
-
className: D("sidebar", ee.props?.className,
|
|
424
|
+
className: D("sidebar", ee.props?.className, a)
|
|
425
425
|
}) : ee
|
|
426
426
|
] }) }) });
|
|
427
427
|
}, Ye = M(Bt), ot = M(({ onToggleCollapse: t }) => /* @__PURE__ */ e.jsx(
|
|
@@ -435,28 +435,28 @@ const Pt = be((t, r) => {
|
|
|
435
435
|
), (t, r) => t.onToggleCollapse === r.onToggleCollapse);
|
|
436
436
|
ot.displayName = "NavigationDrawerCollapseButton";
|
|
437
437
|
const ze = M(({ children: t, className: r, context: s }) => {
|
|
438
|
-
const
|
|
439
|
-
return /* @__PURE__ */ e.jsx("div", { className: D("flex items-center justify-between", r), children:
|
|
438
|
+
const a = ge(t, s);
|
|
439
|
+
return /* @__PURE__ */ e.jsx("div", { className: D("flex items-center justify-between", r), children: a });
|
|
440
440
|
});
|
|
441
441
|
ze.displayName = "NavigationDrawerHeader";
|
|
442
|
-
const Le = M(({ children: t, className: r, context: s, ...
|
|
442
|
+
const Le = M(({ children: t, className: r, context: s, ...a }) => {
|
|
443
443
|
const c = ge(t, s);
|
|
444
|
-
return /* @__PURE__ */ e.jsx("div", { ...
|
|
444
|
+
return /* @__PURE__ */ e.jsx("div", { ...a, className: D("w-full flex-1 drawer-content select-none", r), children: c });
|
|
445
445
|
});
|
|
446
446
|
Le.displayName = "NavigationDrawerContent";
|
|
447
447
|
const De = M(({ children: t, className: r, context: s }) => {
|
|
448
|
-
const
|
|
449
|
-
return /* @__PURE__ */ e.jsx("div", { className: D("flex items-center justify-between", r), children:
|
|
448
|
+
const a = ge(t, s);
|
|
449
|
+
return /* @__PURE__ */ e.jsx("div", { className: D("flex items-center justify-between", r), children: a });
|
|
450
450
|
});
|
|
451
451
|
De.displayName = "NavigationDrawerFooter";
|
|
452
452
|
const lt = M(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: D("w-full border-t border-neutral-strong-default ", t) }));
|
|
453
453
|
lt.displayName = "NavigationDrawerSpacer";
|
|
454
|
-
const _e = M(be(({ children: t, className: r, context: s, modal:
|
|
455
|
-
const d = ge(t, s), i =
|
|
454
|
+
const _e = M(be(({ children: t, className: r, context: s, modal: a, closeOnOutsideClick: c }, l) => {
|
|
455
|
+
const d = ge(t, s), i = de(), f = () => {
|
|
456
456
|
c && (i.toggleCollapse(), i.closeSidebar());
|
|
457
457
|
};
|
|
458
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
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "navigation-drawer-backdrop select-none", onClick: f }),
|
|
460
460
|
d
|
|
461
461
|
] }) });
|
|
462
462
|
}), (t, r) => t.children === r.children && t.className === r.className), re = Object.assign(Ye, {
|
|
@@ -503,7 +503,7 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
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
|
-
),
|
|
506
|
+
), Ee = Be(
|
|
507
507
|
D(
|
|
508
508
|
"transition-colors duration-300 ease-out min-w-max"
|
|
509
509
|
),
|
|
@@ -529,7 +529,7 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
529
529
|
const {
|
|
530
530
|
title: r,
|
|
531
531
|
icon: s,
|
|
532
|
-
count:
|
|
532
|
+
count: a,
|
|
533
533
|
className: c,
|
|
534
534
|
isSelected: l = !1,
|
|
535
535
|
hasSublinks: d,
|
|
@@ -539,16 +539,16 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
539
539
|
onClick: x,
|
|
540
540
|
onAuxClick: m,
|
|
541
541
|
disabled: b = !1,
|
|
542
|
-
tooltipText:
|
|
543
|
-
} = t, k = (
|
|
544
|
-
b || x?.(
|
|
542
|
+
tooltipText: j
|
|
543
|
+
} = t, k = (H) => {
|
|
544
|
+
b || x?.(H);
|
|
545
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 && (
|
|
547
|
+
s && (j ? /* @__PURE__ */ e.jsx(Dt, { title: j, disabled: b, children: /* @__PURE__ */ e.jsx(s, { size: 24, className: Ee({ disabled: b, isSelected: l }) }) }) : /* @__PURE__ */ e.jsx(s, { size: 24, className: Ee({ disabled: b, isSelected: l }) })),
|
|
548
548
|
/* @__PURE__ */ e.jsx("label", { className: Ut({ disabled: b, isSelected: l }), children: r })
|
|
549
549
|
] }),
|
|
550
550
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
551
|
-
|
|
551
|
+
a && a ? /* @__PURE__ */ e.jsx(Qe, { count: a, maxCount: 9, className: "badge", disabled: b }) : "",
|
|
552
552
|
d && /* @__PURE__ */ e.jsx(
|
|
553
553
|
"div",
|
|
554
554
|
{
|
|
@@ -565,7 +565,7 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
565
565
|
disabled: b,
|
|
566
566
|
type: "button",
|
|
567
567
|
onClick: f,
|
|
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",
|
|
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", Ee({ disabled: b, isSelected: l }), b && "pointer-events-none"),
|
|
569
569
|
children: /* @__PURE__ */ e.jsx(At, {})
|
|
570
570
|
}
|
|
571
571
|
)
|
|
@@ -581,20 +581,20 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
581
581
|
c
|
|
582
582
|
);
|
|
583
583
|
if (p === "a") {
|
|
584
|
-
const
|
|
584
|
+
const H = {
|
|
585
585
|
onClick: k,
|
|
586
586
|
onAuxClick: m,
|
|
587
587
|
className: C
|
|
588
588
|
};
|
|
589
|
-
return /* @__PURE__ */ e.jsx("a", { ...
|
|
589
|
+
return /* @__PURE__ */ e.jsx("a", { ...H, children: y });
|
|
590
590
|
}
|
|
591
591
|
if (p === "button") {
|
|
592
|
-
const
|
|
592
|
+
const H = {
|
|
593
593
|
onClick: k,
|
|
594
594
|
type: "button",
|
|
595
595
|
className: C
|
|
596
596
|
};
|
|
597
|
-
return /* @__PURE__ */ e.jsx("button", { ...
|
|
597
|
+
return /* @__PURE__ */ e.jsx("button", { ...H, children: y });
|
|
598
598
|
}
|
|
599
599
|
const A = {
|
|
600
600
|
onClick: k,
|
|
@@ -604,14 +604,14 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
604
604
|
}, Ue = M(Wt);
|
|
605
605
|
Ue.displayName = "NavigationDrawerItemBase";
|
|
606
606
|
const Ht = (t) => {
|
|
607
|
-
const { title: r, icon: s, count:
|
|
607
|
+
const { title: r, icon: s, count: a, className: c, isActive: l, onClick: d, isView: i = !0, disabled: f, tooltipText: p } = t;
|
|
608
608
|
return i ? /* @__PURE__ */ e.jsx(
|
|
609
609
|
Ue,
|
|
610
610
|
{
|
|
611
611
|
as: "button",
|
|
612
612
|
title: r,
|
|
613
613
|
icon: s,
|
|
614
|
-
count:
|
|
614
|
+
count: a,
|
|
615
615
|
className: c,
|
|
616
616
|
isSelected: l,
|
|
617
617
|
onClick: d,
|
|
@@ -621,7 +621,7 @@ const Ht = (t) => {
|
|
|
621
621
|
) : null;
|
|
622
622
|
}, it = M(Ht);
|
|
623
623
|
it.displayName = "NavigationDrawerActionItem";
|
|
624
|
-
const Vt = ({ actions: t, activeActionId: r, onActionClick: s, className:
|
|
624
|
+
const Vt = ({ actions: t, activeActionId: r, onActionClick: s, className: a }) => /* @__PURE__ */ e.jsx(xe, { className: D("flex flex-col gap-2 w-full ", a), 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) => {
|
|
@@ -641,16 +641,16 @@ const Vt = ({ actions: t, activeActionId: r, onActionClick: s, className: o }) =
|
|
|
641
641
|
}) }), ct = M(Vt);
|
|
642
642
|
ct.displayName = "NavigationDrawerActions";
|
|
643
643
|
const qt = (t) => {
|
|
644
|
-
const { className: r, title: s, path:
|
|
645
|
-
c?.(
|
|
646
|
-
}, [
|
|
647
|
-
if (
|
|
644
|
+
const { className: r, title: s, path: a, onClick: c, isSelected: l, parentPath: d } = t, i = h(() => {
|
|
645
|
+
c?.(a);
|
|
646
|
+
}, [a]), f = h(() => {
|
|
647
|
+
if (a.startsWith("./")) {
|
|
648
648
|
if (!d) return;
|
|
649
|
-
const p = d +
|
|
649
|
+
const p = d + a.slice(2);
|
|
650
650
|
window.open(p, "_blank");
|
|
651
651
|
} else
|
|
652
|
-
window.open(
|
|
653
|
-
}, [
|
|
652
|
+
window.open(a, "_blank");
|
|
653
|
+
}, [a]);
|
|
654
654
|
return /* @__PURE__ */ e.jsx(
|
|
655
655
|
"a",
|
|
656
656
|
{
|
|
@@ -674,41 +674,41 @@ const qt = (t) => {
|
|
|
674
674
|
}, dt = M(qt);
|
|
675
675
|
dt.displayName = "NavItemSecondary";
|
|
676
676
|
const $t = be((t, r) => {
|
|
677
|
-
const [s,
|
|
677
|
+
const [s, a] = J(!0), c = O(null), { path: l, title: d, icon: i, count: f, className: p, isSelected: x = !1, onClick: m, sublinks: b, toggleCollapse: j, getIsCollapsed: k, subscribeToCollapse: y, isView: C = !0, disabled: A, tooltipText: H } = t;
|
|
678
678
|
se(() => y ? y((_) => {
|
|
679
|
-
_ &&
|
|
679
|
+
_ && a(!0);
|
|
680
680
|
}) : void 0, [y]);
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
}, []),
|
|
684
|
-
|
|
681
|
+
const K = h(() => {
|
|
682
|
+
a((I) => !I);
|
|
683
|
+
}, []), S = h((I) => {
|
|
684
|
+
a(I);
|
|
685
685
|
}, []), U = {
|
|
686
|
-
toggle:
|
|
687
|
-
setIsCollapsed:
|
|
686
|
+
toggle: K,
|
|
687
|
+
setIsCollapsed: S,
|
|
688
688
|
get isCollapsed() {
|
|
689
689
|
return s;
|
|
690
690
|
},
|
|
691
691
|
get isDrawerCollapsed() {
|
|
692
692
|
return k?.() ?? !1;
|
|
693
693
|
},
|
|
694
|
-
toggleDrawerCollapse:
|
|
694
|
+
toggleDrawerCollapse: j,
|
|
695
695
|
subscribeToCollapse: y
|
|
696
696
|
};
|
|
697
|
-
Re(r, () => U, [U, s, k,
|
|
698
|
-
const N = i,
|
|
699
|
-
const
|
|
700
|
-
if (b && b.length > 0 &&
|
|
701
|
-
|
|
697
|
+
Re(r, () => U, [U, s, k, j]);
|
|
698
|
+
const N = i, $ = h(() => {
|
|
699
|
+
const I = k?.() ?? !1;
|
|
700
|
+
if (b && b.length > 0 && I) {
|
|
701
|
+
S(!1), j?.();
|
|
702
702
|
return;
|
|
703
703
|
}
|
|
704
704
|
m?.(l);
|
|
705
|
-
}, [l, m, b,
|
|
705
|
+
}, [l, m, b, j, S, k]), G = h(() => {
|
|
706
706
|
window.open(l, "_blank");
|
|
707
707
|
}, [l]), q = () => {
|
|
708
708
|
if (!b || A) return null;
|
|
709
709
|
if (t.subLinksRender && b)
|
|
710
710
|
return t.subLinksRender(b, U);
|
|
711
|
-
const
|
|
711
|
+
const I = h((_) => {
|
|
712
712
|
if (_.startsWith("./")) {
|
|
713
713
|
const g = l + _.slice(2);
|
|
714
714
|
m?.(g);
|
|
@@ -720,9 +720,9 @@ const $t = be((t, r) => {
|
|
|
720
720
|
if (!_) return;
|
|
721
721
|
const g = _.scrollHeight;
|
|
722
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: b.map((_) => /* @__PURE__ */ e.jsx(dt, { ..._, onClick:
|
|
724
|
-
}, X = (
|
|
725
|
-
|
|
723
|
+
}, []), /* @__PURE__ */ e.jsx("div", { ref: c, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: b.map((_) => /* @__PURE__ */ e.jsx(dt, { ..._, onClick: I, parentPath: l }, `${_.title}-${_.path}`)) });
|
|
724
|
+
}, X = (I) => {
|
|
725
|
+
I.stopPropagation(), I.preventDefault(), K();
|
|
726
726
|
};
|
|
727
727
|
return C ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 ", children: [
|
|
728
728
|
/* @__PURE__ */ e.jsx(
|
|
@@ -737,18 +737,18 @@ const $t = be((t, r) => {
|
|
|
737
737
|
hasSublinks: !!b,
|
|
738
738
|
subLinksCollapsed: s,
|
|
739
739
|
onToggleSublinks: X,
|
|
740
|
-
onClick:
|
|
740
|
+
onClick: $,
|
|
741
741
|
onAuxClick: G,
|
|
742
742
|
disabled: A,
|
|
743
|
-
tooltipText:
|
|
743
|
+
tooltipText: H
|
|
744
744
|
}
|
|
745
745
|
),
|
|
746
746
|
q()
|
|
747
747
|
] }) : null;
|
|
748
748
|
}), ut = M($t);
|
|
749
749
|
ut.displayName = "NavigationDrawerLinkItem";
|
|
750
|
-
const Kt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed:
|
|
751
|
-
const { pathname: d } =
|
|
750
|
+
const Kt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: a, toggleCollapse: c, subscribeToCollapse: l }) => {
|
|
751
|
+
const { pathname: d } = St();
|
|
752
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 }
|
|
@@ -761,7 +761,7 @@ const Kt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: o,
|
|
|
761
761
|
isSelected: p,
|
|
762
762
|
onClick: r,
|
|
763
763
|
toggleCollapse: c,
|
|
764
|
-
getIsCollapsed:
|
|
764
|
+
getIsCollapsed: a,
|
|
765
765
|
subscribeToCollapse: l,
|
|
766
766
|
disabled: i.disabled,
|
|
767
767
|
isView: i.isView
|
|
@@ -771,8 +771,8 @@ const Kt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: o,
|
|
|
771
771
|
}) });
|
|
772
772
|
}, ft = M(Kt);
|
|
773
773
|
ft.displayName = "NavigationDrawerNavlinks";
|
|
774
|
-
const mt = M(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId:
|
|
775
|
-
const { getIsCollapsed: l, toggleCollapse: d, subscribeToCollapse: i } =
|
|
774
|
+
const mt = M(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId: a, onActionClick: c }) => {
|
|
775
|
+
const { getIsCollapsed: l, toggleCollapse: d, subscribeToCollapse: i } = de();
|
|
776
776
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
777
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: [
|
|
@@ -791,7 +791,7 @@ const mt = M(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId:
|
|
|
791
791
|
ct,
|
|
792
792
|
{
|
|
793
793
|
actions: s,
|
|
794
|
-
activeActionId:
|
|
794
|
+
activeActionId: a,
|
|
795
795
|
onActionClick: c,
|
|
796
796
|
className: "max-h-[30dvh]"
|
|
797
797
|
}
|
|
@@ -801,7 +801,7 @@ const mt = M(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId:
|
|
|
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
802
|
mt.displayName = "PyrionNavigationDrawer.Content";
|
|
803
803
|
const Yt = (t) => {
|
|
804
|
-
const { sessions: r, onSessionClick: s, secondarySlot:
|
|
804
|
+
const { sessions: r, onSessionClick: s, secondarySlot: a, subImageUrlAccessor: c } = t;
|
|
805
805
|
if (!r || r.length === 0)
|
|
806
806
|
return null;
|
|
807
807
|
const l = (f, p) => {
|
|
@@ -812,10 +812,10 @@ const Yt = (t) => {
|
|
|
812
812
|
const p = f.metadata;
|
|
813
813
|
if (!p)
|
|
814
814
|
return;
|
|
815
|
-
const x =
|
|
815
|
+
const x = Se({ metadata: p }, c);
|
|
816
816
|
if (x != null)
|
|
817
817
|
return typeof x == "string" ? x : String(x);
|
|
818
|
-
}, i = h((f) => typeof
|
|
818
|
+
}, i = h((f) => typeof a == "function" ? a(f) : a, [a]);
|
|
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, t.userOptionsControls), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
|
|
@@ -835,7 +835,7 @@ const Yt = (t) => {
|
|
|
835
835
|
state: t,
|
|
836
836
|
currentAppSessions: r,
|
|
837
837
|
resolveUserSecondarySlot: s,
|
|
838
|
-
resolveSessionSecondarySlot:
|
|
838
|
+
resolveSessionSecondarySlot: a,
|
|
839
839
|
onSessionClick: c,
|
|
840
840
|
onLogoutClick: l,
|
|
841
841
|
onProfileClick: d,
|
|
@@ -844,13 +844,13 @@ const Yt = (t) => {
|
|
|
844
844
|
userOptionsControls: p,
|
|
845
845
|
mobileAppSwitcherControls: x
|
|
846
846
|
}) => {
|
|
847
|
-
const { getIsCollapsed: m, toggleCollapse: b, subscribeToCollapse:
|
|
847
|
+
const { getIsCollapsed: m, toggleCollapse: b, subscribeToCollapse: j } = de(), k = h(() => {
|
|
848
848
|
const y = m();
|
|
849
849
|
y ? (b(), p.current?.open()) : d?.(y);
|
|
850
850
|
}, [m, b, p, d]);
|
|
851
|
-
return se(() =>
|
|
851
|
+
return se(() => j((y) => {
|
|
852
852
|
y && (p.current?.close(), x.current?.close());
|
|
853
|
-
}), [
|
|
853
|
+
}), [j, p, x]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
854
854
|
/* @__PURE__ */ e.jsx(re.Spacer, { className: "mb-3" }),
|
|
855
855
|
/* @__PURE__ */ e.jsxs(ie, { className: "", controls: p, children: [
|
|
856
856
|
/* @__PURE__ */ e.jsx(ie.Content, { onClick: k, children: /* @__PURE__ */ e.jsx(
|
|
@@ -873,7 +873,7 @@ const Yt = (t) => {
|
|
|
873
873
|
{
|
|
874
874
|
sessions: r,
|
|
875
875
|
onSessionClick: c,
|
|
876
|
-
secondarySlot:
|
|
876
|
+
secondarySlot: a,
|
|
877
877
|
subImageUrlAccessor: i?.sessionCardOptions?.subImageUrlAccessor,
|
|
878
878
|
currentSystemId: f,
|
|
879
879
|
userOptionsControls: p
|
|
@@ -901,8 +901,8 @@ const Yt = (t) => {
|
|
|
901
901
|
] })
|
|
902
902
|
] });
|
|
903
903
|
}, pt = M(Xt, (t, r) => {
|
|
904
|
-
const s = Object.keys(t),
|
|
905
|
-
if (s.length !==
|
|
904
|
+
const s = Object.keys(t), a = Object.keys(r);
|
|
905
|
+
if (s.length !== a.length)
|
|
906
906
|
return !1;
|
|
907
907
|
for (const c of s) {
|
|
908
908
|
if (!Object.prototype.hasOwnProperty.call(r, c))
|
|
@@ -919,23 +919,23 @@ const Jt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ie,
|
|
|
919
919
|
/* @__PURE__ */ e.jsxs(ie.Options, { children: [
|
|
920
920
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col p-2 pl-4 gap-2", children: [
|
|
921
921
|
/* @__PURE__ */ e.jsx("p", { className: " prometeo-fonts-label-medium text-neutral-medium-default", children: "Cambiar módulo" }),
|
|
922
|
-
/* @__PURE__ */ e.jsx(xe, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: t?.map((
|
|
923
|
-
const c = typeof
|
|
922
|
+
/* @__PURE__ */ e.jsx(xe, { className: "max-h-52", scrollbarProps: { hide: !0 }, children: t?.map((a) => {
|
|
923
|
+
const c = typeof a.thumbnail == "string" ? /* @__PURE__ */ e.jsx(
|
|
924
924
|
"img",
|
|
925
925
|
{
|
|
926
|
-
src:
|
|
927
|
-
alt:
|
|
926
|
+
src: a.thumbnail,
|
|
927
|
+
alt: a.description,
|
|
928
928
|
className: "size-8 aspect-square rounded",
|
|
929
929
|
draggable: !1
|
|
930
930
|
}
|
|
931
|
-
) :
|
|
932
|
-
|
|
931
|
+
) : a.thumbnail, l = () => {
|
|
932
|
+
a.disabled || a.onClick && a.onClick(a.name);
|
|
933
933
|
};
|
|
934
934
|
return /* @__PURE__ */ e.jsxs("div", { onClick: l, className: "flex gap-2 p-2 rounded-lg h-12", children: [
|
|
935
935
|
c,
|
|
936
936
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center h-full justify-center ", children: [
|
|
937
|
-
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1", children:
|
|
938
|
-
|
|
937
|
+
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-large text-neutral-default-default line-clamp-1", children: a.name }),
|
|
938
|
+
a.description && /* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-medium-default line-clamp-1", children: a.description })
|
|
939
939
|
] })
|
|
940
940
|
] });
|
|
941
941
|
}) })
|
|
@@ -943,7 +943,7 @@ const Jt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ie,
|
|
|
943
943
|
/* @__PURE__ */ e.jsx("div", {})
|
|
944
944
|
] })
|
|
945
945
|
] }), Pe = M(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
|
|
946
|
-
const
|
|
946
|
+
const a = h(() => {
|
|
947
947
|
if (t) {
|
|
948
948
|
if (s) {
|
|
949
949
|
const i = t.find((f) => f._id === s);
|
|
@@ -955,31 +955,31 @@ const Jt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ie,
|
|
|
955
955
|
return { coverImage: "", thumbnail: "" };
|
|
956
956
|
}, [t]), c = !!r;
|
|
957
957
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
958
|
-
/* @__PURE__ */ e.jsx(
|
|
958
|
+
a().coverImage ? /* @__PURE__ */ e.jsx(
|
|
959
959
|
"img",
|
|
960
960
|
{
|
|
961
|
-
src:
|
|
961
|
+
src: a().coverImage,
|
|
962
962
|
alt: "System Logo",
|
|
963
963
|
className: D("w-full h-12 rounded object-contain system-cover-image ", c && "cursor-pointer"),
|
|
964
964
|
draggable: !1,
|
|
965
965
|
onClick: r
|
|
966
966
|
}
|
|
967
|
-
),
|
|
968
|
-
/* @__PURE__ */ e.jsx(
|
|
967
|
+
) : /* @__PURE__ */ e.jsx(ce, { className: "w-full h-12 rounded object-contain system-cover-image " }),
|
|
968
|
+
a().thumbnail ? /* @__PURE__ */ e.jsx(
|
|
969
969
|
"img",
|
|
970
970
|
{
|
|
971
|
-
src:
|
|
971
|
+
src: a().thumbnail,
|
|
972
972
|
alt: "System Logo",
|
|
973
973
|
className: D("w-12 h-12 rounded object-cover system-thumbnail ", c && "cursor-pointer"),
|
|
974
974
|
draggable: !1,
|
|
975
975
|
onClick: r
|
|
976
976
|
}
|
|
977
|
-
)
|
|
977
|
+
) : /* @__PURE__ */ e.jsx(ce, { className: "w-12 h-12 rounded object-cover system-thumbnail " })
|
|
978
978
|
] });
|
|
979
979
|
}, (t, r) => t.enabled_systems === r.enabled_systems && t.onClick === r.onClick && t.currentSystemId === r.currentSystemId);
|
|
980
980
|
Pe.displayName = "PyrionNavigationDrawer.SystemLogo";
|
|
981
|
-
const ht = M(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs:
|
|
982
|
-
const { getIsCollapsed: l } =
|
|
981
|
+
const ht = M(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: a, mobileAppSwitcherControls: c }) => {
|
|
982
|
+
const { getIsCollapsed: l } = de(), d = Je(), i = h(() => {
|
|
983
983
|
if (t) {
|
|
984
984
|
const f = l();
|
|
985
985
|
t(f);
|
|
@@ -989,7 +989,7 @@ const ht = M(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: o, mob
|
|
|
989
989
|
Jt,
|
|
990
990
|
{
|
|
991
991
|
controls: c,
|
|
992
|
-
tabs:
|
|
992
|
+
tabs: a,
|
|
993
993
|
content: /* @__PURE__ */ e.jsx(
|
|
994
994
|
Pe,
|
|
995
995
|
{
|
|
@@ -1014,12 +1014,12 @@ const Xe = ({ type: t }) => {
|
|
|
1014
1014
|
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, {}) })) });
|
|
1015
1015
|
}, Gt = () => /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-end gap-1 p-2", children: [
|
|
1016
1016
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 w-full", children: [
|
|
1017
|
-
/* @__PURE__ */ e.jsx(
|
|
1018
|
-
/* @__PURE__ */ e.jsx(
|
|
1017
|
+
/* @__PURE__ */ e.jsx(ce, { shape: "circle", className: "w-12 h-12 aspect-square!" }),
|
|
1018
|
+
/* @__PURE__ */ e.jsx(ce, { shape: "rounded", className: "w-full h-12 min-h-12" })
|
|
1019
1019
|
] }),
|
|
1020
|
-
/* @__PURE__ */ e.jsx(
|
|
1021
|
-
] }), Qt = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s, scrollableControls:
|
|
1022
|
-
const [c, l] = J([]), [d, i] = J("NO_LEIDAS"), [f, p] = J({ isLoading: !1, type: "load_more" }), [x, m] = J({ hasError: !1 }), b = O(/* @__PURE__ */ new Set()),
|
|
1020
|
+
/* @__PURE__ */ e.jsx(ce, { shape: "rounded", className: "w-20 h-3" })
|
|
1021
|
+
] }), Qt = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s, scrollableControls: a }) => {
|
|
1022
|
+
const [c, l] = J([]), [d, i] = J("NO_LEIDAS"), [f, p] = J({ isLoading: !1, type: "load_more" }), [x, m] = J({ hasError: !1 }), b = O(/* @__PURE__ */ new Set()), j = O(null), k = O(null), y = h((g, P = "top") => {
|
|
1023
1023
|
l((R) => {
|
|
1024
1024
|
const z = Array.isArray(g) ? P === "bottom" ? [...R, ...g] : [...g, ...R] : P === "bottom" ? [...R, g] : [g, ...R];
|
|
1025
1025
|
return queueMicrotask(() => {
|
|
@@ -1035,15 +1035,15 @@ const Xe = ({ type: t }) => {
|
|
|
1035
1035
|
b.current.forEach((z) => z(R, R.length));
|
|
1036
1036
|
}), R;
|
|
1037
1037
|
});
|
|
1038
|
-
}, []),
|
|
1038
|
+
}, []), H = h(() => {
|
|
1039
1039
|
l([]), queueMicrotask(() => {
|
|
1040
1040
|
b.current.forEach((g) => g([], 0));
|
|
1041
1041
|
});
|
|
1042
|
-
}, []),
|
|
1042
|
+
}, []), K = h((g) => {
|
|
1043
1043
|
l(g), queueMicrotask(() => {
|
|
1044
1044
|
b.current.forEach((P) => P(g, g.length));
|
|
1045
1045
|
});
|
|
1046
|
-
}, []),
|
|
1046
|
+
}, []), S = h((g, P = "load_more") => {
|
|
1047
1047
|
p({ isLoading: g, type: P });
|
|
1048
1048
|
}, []), U = h((g, P) => {
|
|
1049
1049
|
m({ hasError: g, children: P });
|
|
@@ -1051,28 +1051,28 @@ const Xe = ({ type: t }) => {
|
|
|
1051
1051
|
Re(s, () => ({
|
|
1052
1052
|
addNewNotification: y,
|
|
1053
1053
|
subscribeToUpdates: C,
|
|
1054
|
-
setNotifications:
|
|
1054
|
+
setNotifications: K,
|
|
1055
1055
|
removeNotification: A,
|
|
1056
|
-
removeAllNotifications:
|
|
1057
|
-
setLoading:
|
|
1056
|
+
removeAllNotifications: H,
|
|
1057
|
+
setLoading: S,
|
|
1058
1058
|
setError: U
|
|
1059
|
-
}), [y, C,
|
|
1059
|
+
}), [y, C, K, A, H, S, U]);
|
|
1060
1060
|
const N = (g) => {
|
|
1061
1061
|
i(g);
|
|
1062
|
-
},
|
|
1062
|
+
}, $ = c.length > 0;
|
|
1063
1063
|
Ct(() => {
|
|
1064
|
-
if (
|
|
1065
|
-
const g =
|
|
1064
|
+
if (j.current && k.current) {
|
|
1065
|
+
const g = j.current.clientHeight;
|
|
1066
1066
|
k.current.style.setProperty("height", `calc(100vh - ${g}px - 20px)`);
|
|
1067
1067
|
}
|
|
1068
|
-
}, [
|
|
1069
|
-
const G = c.filter((g) => !g.read).length, { isLoading: q, type: X } = f, { hasError:
|
|
1068
|
+
}, [j?.current]);
|
|
1069
|
+
const G = c.filter((g) => !g.read).length, { isLoading: q, type: X } = f, { hasError: I, children: _ } = x;
|
|
1070
1070
|
return /* @__PURE__ */ e.jsx(
|
|
1071
1071
|
"section",
|
|
1072
1072
|
{
|
|
1073
1073
|
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",
|
|
1074
1074
|
children: /* @__PURE__ */ e.jsxs("div", { className: " w-full flex flex-col gap-4 ", children: [
|
|
1075
|
-
/* @__PURE__ */ e.jsxs("div", { ref:
|
|
1075
|
+
/* @__PURE__ */ e.jsxs("div", { ref: j, className: "flex flex-col gap-4", children: [
|
|
1076
1076
|
/* @__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: [
|
|
1077
1077
|
/* @__PURE__ */ e.jsxs("span", { className: "flex gap-2 items-center", children: [
|
|
1078
1078
|
/* @__PURE__ */ e.jsx(et, { className: "text-neutral-strong-default", size: 24 }),
|
|
@@ -1081,7 +1081,7 @@ const Xe = ({ type: t }) => {
|
|
|
1081
1081
|
/* @__PURE__ */ e.jsx(he, { onClick: () => t?.(), icon: /* @__PURE__ */ e.jsx(Fe, {}), variant: "text", animate: !1, animateIcon: !1, color: "secondary", className: "size-12" })
|
|
1082
1082
|
] }),
|
|
1083
1083
|
/* @__PURE__ */ e.jsx(
|
|
1084
|
-
|
|
1084
|
+
It,
|
|
1085
1085
|
{
|
|
1086
1086
|
className: "px-4 md:px-2 md:pl-2 pl-2 gap-0 md:gap-0",
|
|
1087
1087
|
onTabChange: N,
|
|
@@ -1092,7 +1092,7 @@ const Xe = ({ type: t }) => {
|
|
|
1092
1092
|
],
|
|
1093
1093
|
renderTab: (g, P, R, z, Q, ae, Z, ve) => /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
1094
1094
|
/* @__PURE__ */ e.jsx(
|
|
1095
|
-
|
|
1095
|
+
Et,
|
|
1096
1096
|
{
|
|
1097
1097
|
id: g.id,
|
|
1098
1098
|
title: g.title,
|
|
@@ -1105,11 +1105,11 @@ const Xe = ({ type: t }) => {
|
|
|
1105
1105
|
iconSize: ve
|
|
1106
1106
|
}
|
|
1107
1107
|
),
|
|
1108
|
-
G > 0 && g.id === "NO_LEIDAS" && (q ? /* @__PURE__ */ e.jsx("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ e.jsx(
|
|
1108
|
+
G > 0 && g.id === "NO_LEIDAS" && (q ? /* @__PURE__ */ e.jsx("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ e.jsx(ce, { className: "size-5.5", shape: "circle" }) }) : /* @__PURE__ */ e.jsx(Qe, { count: G, className: "absolute top-0 right-0" }))
|
|
1109
1109
|
] })
|
|
1110
1110
|
}
|
|
1111
1111
|
),
|
|
1112
|
-
r &&
|
|
1112
|
+
r && $ && d === "NO_LEIDAS" && !I && /* @__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" }) })
|
|
1113
1113
|
] }),
|
|
1114
1114
|
/* @__PURE__ */ e.jsx("div", { ref: k, className: "", children: /* @__PURE__ */ e.jsxs(
|
|
1115
1115
|
xe,
|
|
@@ -1119,7 +1119,7 @@ const Xe = ({ type: t }) => {
|
|
|
1119
1119
|
scrollbarProps: { hide: !0, size: "small" },
|
|
1120
1120
|
axis: "y",
|
|
1121
1121
|
disableMouseScroll: !1,
|
|
1122
|
-
controls:
|
|
1122
|
+
controls: a,
|
|
1123
1123
|
scrollTopButton: {
|
|
1124
1124
|
target: "2000px"
|
|
1125
1125
|
},
|
|
@@ -1128,9 +1128,9 @@ const Xe = ({ type: t }) => {
|
|
|
1128
1128
|
isLoading: q
|
|
1129
1129
|
},
|
|
1130
1130
|
children: [
|
|
1131
|
-
|
|
1132
|
-
!
|
|
1133
|
-
q && X === "skeletons" ? /* @__PURE__ */ e.jsx(Xe, { type: X }) :
|
|
1131
|
+
I && /* @__PURE__ */ e.jsx("div", { className: "w-full h-full grid place-items-center", children: typeof _ == "function" ? _() : _ }),
|
|
1132
|
+
!I && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1133
|
+
q && X === "skeletons" ? /* @__PURE__ */ e.jsx(Xe, { type: X }) : $ ? 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" }),
|
|
1134
1134
|
q && X === "load_more" && /* @__PURE__ */ e.jsx(Xe, { type: X })
|
|
1135
1135
|
] })
|
|
1136
1136
|
]
|
|
@@ -1154,8 +1154,8 @@ const Xe = ({ type: t }) => {
|
|
|
1154
1154
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-3 pb-8 pt-4 px-4 ", children: r })
|
|
1155
1155
|
]
|
|
1156
1156
|
}
|
|
1157
|
-
), er = ({ closeSidebar: t, options: r, helpSection: s, initialSection:
|
|
1158
|
-
const [i, f] = J(
|
|
1157
|
+
), er = ({ closeSidebar: t, options: r, helpSection: s, initialSection: a, notificationsListControls: c, scrollableControls: l }, d) => {
|
|
1158
|
+
const [i, f] = J(a ?? "notifications");
|
|
1159
1159
|
Re(d, () => ({
|
|
1160
1160
|
setActiveSection: f
|
|
1161
1161
|
}));
|
|
@@ -1180,11 +1180,11 @@ const tr = ({
|
|
|
1180
1180
|
options: t,
|
|
1181
1181
|
helpSection: r,
|
|
1182
1182
|
sidebarContentRef: s,
|
|
1183
|
-
initialSectionRef:
|
|
1183
|
+
initialSectionRef: a,
|
|
1184
1184
|
notificationsListControls: c,
|
|
1185
1185
|
scrollableControls: l
|
|
1186
1186
|
}) => {
|
|
1187
|
-
const { closeSidebar: d } =
|
|
1187
|
+
const { closeSidebar: d } = de();
|
|
1188
1188
|
return /* @__PURE__ */ e.jsx(
|
|
1189
1189
|
bt,
|
|
1190
1190
|
{
|
|
@@ -1192,7 +1192,7 @@ const tr = ({
|
|
|
1192
1192
|
closeSidebar: d,
|
|
1193
1193
|
options: t,
|
|
1194
1194
|
helpSection: r,
|
|
1195
|
-
initialSection:
|
|
1195
|
+
initialSection: a.current,
|
|
1196
1196
|
notificationsListControls: c,
|
|
1197
1197
|
scrollableControls: l
|
|
1198
1198
|
}
|
|
@@ -1200,10 +1200,10 @@ const tr = ({
|
|
|
1200
1200
|
}, xt = M(tr);
|
|
1201
1201
|
xt.displayName = "PyrionNavigationDrawer.Sidebar";
|
|
1202
1202
|
const rr = ({ navigationControlsRef: t }) => {
|
|
1203
|
-
const r =
|
|
1203
|
+
const r = de();
|
|
1204
1204
|
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;
|
|
1205
1205
|
}, sr = (t) => {
|
|
1206
|
-
const { children: r, currentAppSessions: s, resolveUserSecondarySlot:
|
|
1206
|
+
const { children: r, currentAppSessions: s, resolveUserSecondarySlot: a, resolveSessionSecondarySlot: c, handleNavigation: l, allActions: d, tabs: i, navigationControlsRef: f, sidebarContentRef: p, initialSectionRef: x, userOptionsControls: m, mobileAppSwitcherControls: b, notificationsListControls: j, scrollableControls: k, outletRef: y, ...C } = t;
|
|
1207
1207
|
return /* @__PURE__ */ e.jsxs(re, { disableDragOpen: C.options?.disableDragOpen, outletRef: y, children: [
|
|
1208
1208
|
/* @__PURE__ */ e.jsx(rr, { navigationControlsRef: f }),
|
|
1209
1209
|
/* @__PURE__ */ e.jsx(re.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
|
|
@@ -1231,7 +1231,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1231
1231
|
{
|
|
1232
1232
|
state: C.state,
|
|
1233
1233
|
currentAppSessions: s,
|
|
1234
|
-
resolveUserSecondarySlot:
|
|
1234
|
+
resolveUserSecondarySlot: a,
|
|
1235
1235
|
resolveSessionSecondarySlot: c,
|
|
1236
1236
|
onSessionClick: C.onSessionClick,
|
|
1237
1237
|
onLogoutClick: C.onLogoutClick,
|
|
@@ -1256,7 +1256,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1256
1256
|
helpSection: C.helpSection,
|
|
1257
1257
|
sidebarContentRef: p,
|
|
1258
1258
|
initialSectionRef: x,
|
|
1259
|
-
notificationsListControls:
|
|
1259
|
+
notificationsListControls: j,
|
|
1260
1260
|
scrollableControls: k
|
|
1261
1261
|
}
|
|
1262
1262
|
)
|
|
@@ -1264,13 +1264,13 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1264
1264
|
)
|
|
1265
1265
|
] });
|
|
1266
1266
|
}, gt = M(sr, (t, r) => {
|
|
1267
|
-
const { children: s, ...
|
|
1267
|
+
const { children: s, ...a } = t, { children: c, ...l } = r, d = Object.keys(a), i = Object.keys(l);
|
|
1268
1268
|
if (d.length !== i.length)
|
|
1269
1269
|
return !1;
|
|
1270
1270
|
for (const f of d) {
|
|
1271
1271
|
if (!Object.prototype.hasOwnProperty.call(l, f))
|
|
1272
1272
|
return !1;
|
|
1273
|
-
const p =
|
|
1273
|
+
const p = a[f], x = l[f];
|
|
1274
1274
|
if (p !== x)
|
|
1275
1275
|
return !1;
|
|
1276
1276
|
}
|
|
@@ -1280,66 +1280,66 @@ gt.displayName = "PyrionNavigationDrawer.LayoutBase";
|
|
|
1280
1280
|
const vt = M(({ children: t }) => /* @__PURE__ */ e.jsx(re.Outlet, { children: t }));
|
|
1281
1281
|
vt.displayName = "PyrionNavigationDrawer.IsolatedOutlet";
|
|
1282
1282
|
const wt = Me(null), Dr = () => {
|
|
1283
|
-
const t =
|
|
1283
|
+
const t = jt(wt);
|
|
1284
1284
|
if (!t)
|
|
1285
1285
|
throw new Error("usePyrionLayout debe usarse dentro de PyrionLayout");
|
|
1286
1286
|
return t;
|
|
1287
|
-
}, Ar = ({ children: t, helpSection: r, state: s, links:
|
|
1287
|
+
}, Ar = ({ children: t, helpSection: r, state: s, links: a, onLinkClick: c, onNavigate: l, onLogoutClick: d, actions: i, activeActionId: f, onActionClick: p, tabsProps: x, currentSystemId: m, onSessionClick: b, onSystemLogoClick: j, onProfileClick: k, ...y }) => {
|
|
1288
1288
|
const A = Object.assign({
|
|
1289
1289
|
closeDrawerOnNavigate: !0,
|
|
1290
1290
|
disableDragOpen: {
|
|
1291
1291
|
sidebar: !0,
|
|
1292
1292
|
drawer: !1
|
|
1293
1293
|
}
|
|
1294
|
-
}, y.options),
|
|
1294
|
+
}, y.options), H = kt(), K = Je(), S = O(null), U = O(null), N = O({}), $ = O(null), G = O("notifications"), q = O(null), X = O(null), I = O(null), [_, g] = J(0), [P, R] = J(!1), [z, Q] = J(null), ae = h((o) => {
|
|
1295
1295
|
if (R(!1), c) {
|
|
1296
|
-
c(
|
|
1296
|
+
c(o);
|
|
1297
1297
|
return;
|
|
1298
1298
|
}
|
|
1299
1299
|
const w = window.location.pathname;
|
|
1300
|
-
|
|
1301
|
-
}, [c, l,
|
|
1302
|
-
|
|
1300
|
+
H(o), A.closeDrawerOnNavigate && Nt() && !N.current?.getIsCollapsed?.() && N.current?.toggleCollapse?.(), l && l(w, o);
|
|
1301
|
+
}, [c, l, H]), Z = (o) => {
|
|
1302
|
+
o && window.open(o, "_blank");
|
|
1303
1303
|
}, we = {
|
|
1304
1304
|
system: {
|
|
1305
1305
|
mobile: Z,
|
|
1306
|
-
desktop: (
|
|
1307
|
-
typeof window < "u" &&
|
|
1306
|
+
desktop: (o) => {
|
|
1307
|
+
typeof window < "u" && o && (window.location.href = o);
|
|
1308
1308
|
}
|
|
1309
1309
|
},
|
|
1310
1310
|
product: {
|
|
1311
1311
|
mobile: Z,
|
|
1312
1312
|
desktop: Z
|
|
1313
1313
|
}
|
|
1314
|
-
}, Ae = h((
|
|
1315
|
-
const w =
|
|
1316
|
-
we.system[w](F), x?.onTabClick?.(
|
|
1317
|
-
}, [
|
|
1318
|
-
const w =
|
|
1319
|
-
we.product[w](F), x?.onTabClick?.(
|
|
1320
|
-
}, [
|
|
1314
|
+
}, Ae = h((o) => {
|
|
1315
|
+
const w = K ? "mobile" : "desktop", F = s.enabled_systems.find((T) => T.name === o)?.url;
|
|
1316
|
+
we.system[w](F), x?.onTabClick?.(o);
|
|
1317
|
+
}, [K, s.enabled_systems, x?.onTabClick]), We = h((o) => {
|
|
1318
|
+
const w = K ? "mobile" : "desktop", F = s.company.products?.find((T) => T.name === o)?.domain;
|
|
1319
|
+
we.product[w](F), x?.onTabClick?.(o);
|
|
1320
|
+
}, [K, s.company.products, x?.onTabClick]), ue = h((o, w) => {
|
|
1321
1321
|
if (w) {
|
|
1322
|
-
w(
|
|
1322
|
+
w(o), x?.onTabClick?.(o);
|
|
1323
1323
|
return;
|
|
1324
1324
|
} else
|
|
1325
|
-
x?.onTabClick?.(
|
|
1325
|
+
x?.onTabClick?.(o);
|
|
1326
1326
|
}, [x?.onTabClick]), He = h(() => {
|
|
1327
|
-
const
|
|
1327
|
+
const o = {};
|
|
1328
1328
|
s.enabled_systems.forEach((F) => {
|
|
1329
|
-
|
|
1329
|
+
o[F.url] = F.name;
|
|
1330
1330
|
});
|
|
1331
1331
|
const w = window.location.origin;
|
|
1332
|
-
for (const [F, T] of Object.entries(
|
|
1332
|
+
for (const [F, T] of Object.entries(o))
|
|
1333
1333
|
if (w === F)
|
|
1334
1334
|
return T;
|
|
1335
1335
|
return "";
|
|
1336
|
-
}, [s.enabled_systems]), Te = x?.currentTabName || He(), Oe =
|
|
1336
|
+
}, [s.enabled_systems]), Te = x?.currentTabName || He(), Oe = pe(
|
|
1337
1337
|
() => s.sessions || [],
|
|
1338
1338
|
[s.sessions]
|
|
1339
|
-
), ee = (
|
|
1340
|
-
if (!
|
|
1341
|
-
if (Array.isArray(
|
|
1342
|
-
const F =
|
|
1339
|
+
), ee = (o) => o == null ? null : typeof o == "string" || typeof o == "number" || typeof o == "boolean" ? String(o) : ke(o) ? o : typeof o == "object" ? JSON.stringify(o) : null, fe = h((o, w) => {
|
|
1340
|
+
if (!o) return null;
|
|
1341
|
+
if (Array.isArray(o)) {
|
|
1342
|
+
const F = o?.[0] ? Se(w, o[0]) : null, T = o?.[1] ? Se(w, o[1]) : null, ne = ee(F), Ve = ee(T);
|
|
1343
1343
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1344
1344
|
/* @__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 }),
|
|
1345
1345
|
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: [
|
|
@@ -1348,110 +1348,110 @@ const wt = Me(null), Dr = () => {
|
|
|
1348
1348
|
] })
|
|
1349
1349
|
] });
|
|
1350
1350
|
}
|
|
1351
|
-
if (typeof
|
|
1352
|
-
const F =
|
|
1351
|
+
if (typeof o == "string") {
|
|
1352
|
+
const F = Se(w, o);
|
|
1353
1353
|
return ee(F);
|
|
1354
1354
|
}
|
|
1355
|
-
return typeof
|
|
1355
|
+
return typeof o == "function" ? ee(o(w)) : null;
|
|
1356
1356
|
}, []), n = h(
|
|
1357
|
-
(
|
|
1357
|
+
(o) => {
|
|
1358
1358
|
const w = A?.userCardOptions?.secondarySlot;
|
|
1359
1359
|
if (!w) return null;
|
|
1360
|
-
const F = s.enabled_systems?.find((ne) => ne._id === m), T = { company: s.company, user: s.user, system: F, metadata:
|
|
1361
|
-
return
|
|
1360
|
+
const F = s.enabled_systems?.find((ne) => ne._id === m), T = { company: s.company, user: s.user, system: F, metadata: o };
|
|
1361
|
+
return fe(w, T);
|
|
1362
1362
|
},
|
|
1363
|
-
[m, A?.userCardOptions?.secondarySlot,
|
|
1363
|
+
[m, A?.userCardOptions?.secondarySlot, fe, s.company, s.enabled_systems, s.user]
|
|
1364
1364
|
), u = h(
|
|
1365
|
-
(
|
|
1365
|
+
(o) => {
|
|
1366
1366
|
const w = A?.sessionCardOptions?.secondarySlot || A?.userCardOptions?.secondarySlot;
|
|
1367
1367
|
if (!w) return null;
|
|
1368
|
-
const F = s.enabled_systems?.find((ne) => ne._id === m), T = { company: s.company, user:
|
|
1369
|
-
return
|
|
1368
|
+
const F = s.enabled_systems?.find((ne) => ne._id === m), T = { company: s.company, user: o.auth_id, metadata: o?.metadata, system: F };
|
|
1369
|
+
return fe(w, T);
|
|
1370
1370
|
},
|
|
1371
|
-
[m, A?.sessionCardOptions?.secondarySlot, A?.userCardOptions?.secondarySlot,
|
|
1372
|
-
), v =
|
|
1373
|
-
const
|
|
1371
|
+
[m, A?.sessionCardOptions?.secondarySlot, A?.userCardOptions?.secondarySlot, fe, s.company, s.enabled_systems]
|
|
1372
|
+
), v = pe(() => {
|
|
1373
|
+
const o = [];
|
|
1374
1374
|
return N.current.openNotifications = () => {
|
|
1375
|
-
G.current = "notifications", N.current.openSidebar?.(),
|
|
1375
|
+
G.current = "notifications", N.current.openSidebar?.(), $.current?.setActiveSection("notifications");
|
|
1376
1376
|
}, N.current.openHelp = () => {
|
|
1377
|
-
G.current = "help", N.current.openSidebar?.(),
|
|
1378
|
-
}, !A?.notificationsDrawerOptions?.hideActionButton && !A?.notificationsDrawerOptions?.hide &&
|
|
1377
|
+
G.current = "help", N.current.openSidebar?.(), $.current?.setActiveSection("help");
|
|
1378
|
+
}, !A?.notificationsDrawerOptions?.hideActionButton && !A?.notificationsDrawerOptions?.hide && o.push({
|
|
1379
1379
|
id: "notifications",
|
|
1380
1380
|
title: "Notificaciones",
|
|
1381
1381
|
icon: et,
|
|
1382
1382
|
onClick: N.current.openNotifications,
|
|
1383
1383
|
count: _
|
|
1384
|
-
}), !A?.helpSectionDrawerOptions?.hideActionButton && r && !A?.helpSectionDrawerOptions?.hide &&
|
|
1384
|
+
}), !A?.helpSectionDrawerOptions?.hideActionButton && r && !A?.helpSectionDrawerOptions?.hide && o.push({
|
|
1385
1385
|
id: "help",
|
|
1386
1386
|
title: "Ayuda",
|
|
1387
1387
|
icon: tt,
|
|
1388
1388
|
onClick: N.current.openHelp
|
|
1389
|
-
}), A?.configurationActionOptions?.onClick && !A?.configurationActionOptions?.hideActionButton &&
|
|
1389
|
+
}), A?.configurationActionOptions?.onClick && !A?.configurationActionOptions?.hideActionButton && o.push({
|
|
1390
1390
|
id: "configuration",
|
|
1391
1391
|
title: "Configuracion",
|
|
1392
1392
|
icon: _t,
|
|
1393
1393
|
onClick: A.configurationActionOptions?.onClick
|
|
1394
|
-
}),
|
|
1395
|
-
}, [A, r, p, _]),
|
|
1394
|
+
}), o;
|
|
1395
|
+
}, [A, r, p, _]), E = pe(
|
|
1396
1396
|
() => [...v, ...i || []],
|
|
1397
1397
|
[v, i]
|
|
1398
|
-
),
|
|
1399
|
-
const
|
|
1398
|
+
), V = pe(() => {
|
|
1399
|
+
const o = s.enabled_systems.map((T) => ({
|
|
1400
1400
|
name: T.name,
|
|
1401
1401
|
thumbnail: T.thumbnail,
|
|
1402
1402
|
onClick: Ae,
|
|
1403
1403
|
id: T._id
|
|
1404
1404
|
})) || [], w = x?.customTabs?.map((T) => ({
|
|
1405
1405
|
...T,
|
|
1406
|
-
onClick: () =>
|
|
1406
|
+
onClick: () => ue(T.name, T?.onClick)
|
|
1407
1407
|
})) || [], F = s.company.products?.map((T) => ({
|
|
1408
1408
|
name: T.name,
|
|
1409
1409
|
thumbnail: T.thumbnail,
|
|
1410
1410
|
onClick: We
|
|
1411
1411
|
})) || [];
|
|
1412
|
-
return [...
|
|
1413
|
-
}, [s.enabled_systems, s.company.products, x?.customTabs]), B = h((
|
|
1414
|
-
|
|
1415
|
-
}, []), te = h((
|
|
1416
|
-
}), []), oe = h((
|
|
1417
|
-
|
|
1418
|
-
}, []),
|
|
1419
|
-
|
|
1420
|
-
}, []), Ne = h((
|
|
1421
|
-
|
|
1422
|
-
}, []), ye = h((
|
|
1423
|
-
}), []), L = h((
|
|
1424
|
-
|
|
1425
|
-
}, []), Y = h((
|
|
1426
|
-
|
|
1427
|
-
}, []),
|
|
1412
|
+
return [...o, ...w, ...F];
|
|
1413
|
+
}, [s.enabled_systems, s.company.products, x?.customTabs]), B = h((o, w) => {
|
|
1414
|
+
S.current?.addNewNotification ? S.current.addNewNotification(o, w) : console.warn("Notifications controls not ready yet");
|
|
1415
|
+
}, []), te = h((o) => S.current?.subscribeToUpdates ? S.current.subscribeToUpdates(o) : (console.warn("Notifications controls not ready yet"), () => {
|
|
1416
|
+
}), []), oe = h((o) => {
|
|
1417
|
+
S.current?.removeNotification ? S.current.removeNotification(o) : console.warn("Notifications controls not ready yet");
|
|
1418
|
+
}, []), me = h(() => {
|
|
1419
|
+
S.current?.removeAllNotifications ? S.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
|
|
1420
|
+
}, []), Ne = h((o) => {
|
|
1421
|
+
S.current?.setNotifications ? S.current.setNotifications(o) : console.warn("Notifications controls not ready yet");
|
|
1422
|
+
}, []), ye = h((o, w) => U.current?.subscribeToScrollTarget ? U.current.subscribeToScrollTarget(o, w) : (console.warn("Scrollable controls not ready yet"), () => {
|
|
1423
|
+
}), []), L = h((o, w = "load_more") => {
|
|
1424
|
+
S.current?.setLoading ? S.current.setLoading(o, w) : console.warn("Notifications controls not ready yet");
|
|
1425
|
+
}, []), Y = h((o, w) => {
|
|
1426
|
+
S.current?.setError ? S.current.setError(o, w) : console.warn("Notifications controls not ready yet");
|
|
1427
|
+
}, []), W = h(() => {
|
|
1428
1428
|
q.current?.open();
|
|
1429
1429
|
}, []), le = h(() => {
|
|
1430
1430
|
q.current?.close();
|
|
1431
|
-
}, []),
|
|
1431
|
+
}, []), Ie = h(() => {
|
|
1432
1432
|
q.current?.toggle();
|
|
1433
|
-
}, []), Ce = h((
|
|
1433
|
+
}, []), Ce = h((o, w, F) => {
|
|
1434
1434
|
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: [
|
|
1435
1435
|
!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" }),
|
|
1436
|
-
typeof
|
|
1436
|
+
typeof o == "function" ? o() : o
|
|
1437
1437
|
] });
|
|
1438
1438
|
let ne;
|
|
1439
|
-
return w ? ne = $e(T, document.body, `modal-error-${Date.now()}`) :
|
|
1440
|
-
}, [
|
|
1439
|
+
return w ? ne = $e(T, document.body, `modal-error-${Date.now()}`) : I.current && (ne = $e(T, I.current, `modal-error-${Date.now()}`)), Q(ne), R(!0), T;
|
|
1440
|
+
}, [I]), je = h(() => {
|
|
1441
1441
|
R(!1);
|
|
1442
1442
|
}, []);
|
|
1443
|
-
return N.current.addNewNotification = B, N.current.subscribeToNotificationsUpdates = te, N.current.removeNotification = oe, N.current.removeAllNotifications =
|
|
1444
|
-
te((
|
|
1443
|
+
return N.current.addNewNotification = B, N.current.subscribeToNotificationsUpdates = te, N.current.removeNotification = oe, N.current.removeAllNotifications = me, N.current.setNotifications = Ne, N.current.setNotificationsError = Y, N.current.setNotificationsLoading = L, N.current.subscribeToNotificationsScroll = ye, N.current.showErrorModal = Ce, N.current.closeErrorModal = je, N.current.userCardExpand = W, N.current.userCardCollapse = le, N.current.userCardToggle = Ie, se(() => {
|
|
1444
|
+
te((o, w) => {
|
|
1445
1445
|
g(w);
|
|
1446
1446
|
});
|
|
1447
1447
|
}, [te]), /* @__PURE__ */ e.jsxs(wt.Provider, { value: N.current, children: [
|
|
1448
1448
|
P && z,
|
|
1449
1449
|
/* @__PURE__ */ e.jsxs("div", { className: "flex h-screen", children: [
|
|
1450
|
-
|
|
1450
|
+
/* @__PURE__ */ e.jsx(
|
|
1451
1451
|
Pt,
|
|
1452
1452
|
{
|
|
1453
1453
|
className: "hidden md:flex",
|
|
1454
|
-
tabs:
|
|
1454
|
+
tabs: V,
|
|
1455
1455
|
activeColor: "var(--neutral-900)",
|
|
1456
1456
|
currentTabName: Te,
|
|
1457
1457
|
currentSystemId: m,
|
|
@@ -1461,9 +1461,9 @@ const wt = Me(null), Dr = () => {
|
|
|
1461
1461
|
/* @__PURE__ */ e.jsx(
|
|
1462
1462
|
gt,
|
|
1463
1463
|
{
|
|
1464
|
-
links:
|
|
1464
|
+
links: a,
|
|
1465
1465
|
handleNavigation: ae,
|
|
1466
|
-
allActions:
|
|
1466
|
+
allActions: E,
|
|
1467
1467
|
activeActionId: f,
|
|
1468
1468
|
onActionClick: p,
|
|
1469
1469
|
state: s,
|
|
@@ -1476,15 +1476,15 @@ const wt = Me(null), Dr = () => {
|
|
|
1476
1476
|
currentSystemId: m,
|
|
1477
1477
|
userOptionsControls: q,
|
|
1478
1478
|
mobileAppSwitcherControls: X,
|
|
1479
|
-
onSystemLogoClick:
|
|
1480
|
-
tabs:
|
|
1479
|
+
onSystemLogoClick: j,
|
|
1480
|
+
tabs: V,
|
|
1481
1481
|
helpSection: r,
|
|
1482
|
-
sidebarContentRef:
|
|
1482
|
+
sidebarContentRef: $,
|
|
1483
1483
|
initialSectionRef: G,
|
|
1484
1484
|
navigationControlsRef: N,
|
|
1485
|
-
notificationsListControls:
|
|
1485
|
+
notificationsListControls: S,
|
|
1486
1486
|
scrollableControls: U,
|
|
1487
|
-
outletRef:
|
|
1487
|
+
outletRef: I,
|
|
1488
1488
|
onProfileClick: k,
|
|
1489
1489
|
children: t
|
|
1490
1490
|
}
|