prometeo-design-system 4.3.3 → 4.3.5
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 +660 -647
- package/dist/Scrollable.es.js +1 -1
- package/dist/Select.es.js +540 -528
- package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +4 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/PyrionLayout.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
-
import { u as qe, g as
|
|
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
|
|
5
|
-
import Ue, { forwardRef as
|
|
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
|
|
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
|
|
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 =
|
|
25
|
-
const [s, o] =
|
|
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
|
-
|
|
28
|
-
}, [
|
|
29
|
-
const
|
|
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:
|
|
43
|
-
(
|
|
44
|
-
const g =
|
|
45
|
-
|
|
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:
|
|
59
|
-
ref:
|
|
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
|
-
|
|
66
|
-
), children:
|
|
65
|
+
c?.className
|
|
66
|
+
), children: b })
|
|
67
67
|
},
|
|
68
|
-
|
|
68
|
+
c.name
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
|
-
}), Ge =
|
|
75
|
-
const
|
|
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
|
-
|
|
78
|
-
|
|
77
|
+
l && s?.subscribeToSidebarOpen((w) => {
|
|
78
|
+
w ? (L(!1), b(!0)) : L(!0);
|
|
79
79
|
});
|
|
80
|
-
}, [
|
|
81
|
-
const
|
|
82
|
-
if (!
|
|
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
|
-
|
|
84
|
+
C && (b(!1), L(!1));
|
|
85
85
|
};
|
|
86
|
-
return
|
|
87
|
-
}, [
|
|
88
|
-
o &&
|
|
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: (
|
|
93
|
-
|
|
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 &&
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
}, []),
|
|
130
|
-
const
|
|
131
|
-
if (!
|
|
132
|
-
|
|
133
|
-
const v =
|
|
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
|
-
}, []),
|
|
136
|
-
(n, { notify:
|
|
137
|
-
const v =
|
|
138
|
-
|
|
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
|
-
[
|
|
141
|
-
),
|
|
142
|
-
(n, { notify:
|
|
143
|
-
const v =
|
|
144
|
-
if (
|
|
145
|
-
const
|
|
146
|
-
|
|
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
|
-
[
|
|
150
|
-
),
|
|
151
|
-
(n, { notify:
|
|
152
|
-
const v =
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
|
|
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
|
-
[
|
|
158
|
-
),
|
|
159
|
-
const
|
|
160
|
-
if (!
|
|
161
|
-
|
|
162
|
-
const v =
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
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
|
-
|
|
168
|
-
|
|
167
|
+
m.addEventListener("scrollend", B, { once: !0 }), setTimeout(() => {
|
|
168
|
+
N.current && B();
|
|
169
169
|
}, 1e3);
|
|
170
|
-
}, []),
|
|
171
|
-
const n =
|
|
172
|
-
if (!n || !
|
|
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:
|
|
176
|
-
],
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
let
|
|
180
|
-
for (let
|
|
181
|
-
const
|
|
182
|
-
|
|
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
|
-
|
|
185
|
-
}, [
|
|
184
|
+
i(B.panel);
|
|
185
|
+
}, [i]);
|
|
186
186
|
Q(() => {
|
|
187
|
-
const n =
|
|
188
|
-
n && (
|
|
189
|
-
}, [
|
|
190
|
-
const n =
|
|
191
|
-
if (!n || !
|
|
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
|
|
194
|
-
|
|
193
|
+
const A = Ve();
|
|
194
|
+
S(A, { notify: !1 }), F(!0, { notify: !1 });
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
requestAnimationFrame(() => {
|
|
198
|
-
n.scrollLeft =
|
|
198
|
+
n.scrollLeft = m.offsetLeft, i("outlet");
|
|
199
199
|
});
|
|
200
|
-
}, [
|
|
201
|
-
const n =
|
|
202
|
-
if (!n || !
|
|
203
|
-
let v = !1,
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
const
|
|
208
|
-
return /(auto|scroll|overlay)/.test(
|
|
209
|
-
},
|
|
210
|
-
let
|
|
211
|
-
for (;
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
214
|
-
|
|
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
|
-
},
|
|
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 -
|
|
220
|
-
if (
|
|
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
|
|
223
|
-
if (
|
|
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 (
|
|
225
|
+
if (C.current === "sidebar" && !K) {
|
|
226
226
|
v = !0;
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
|
-
if (
|
|
230
|
-
|
|
229
|
+
if (j) {
|
|
230
|
+
fe();
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
} else if (q < 0) {
|
|
234
|
-
if (
|
|
234
|
+
if (C.current === "drawer" && !j) {
|
|
235
235
|
v = !0;
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
if (
|
|
239
|
-
|
|
238
|
+
if (K) {
|
|
239
|
+
fe();
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
v = !0;
|
|
244
244
|
}
|
|
245
|
-
},
|
|
245
|
+
}, Ne = () => {
|
|
246
246
|
setTimeout(() => {
|
|
247
|
-
v && (
|
|
247
|
+
v && (R(), v = !1);
|
|
248
248
|
}, 100);
|
|
249
249
|
};
|
|
250
|
-
return n.addEventListener("touchstart",
|
|
251
|
-
n.removeEventListener("touchstart",
|
|
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
|
-
}, [
|
|
254
|
-
const
|
|
255
|
-
const n = window.matchMedia("(min-width: 768px)").matches,
|
|
253
|
+
}, [R]);
|
|
254
|
+
const z = x(() => {
|
|
255
|
+
const n = window.matchMedia("(min-width: 768px)").matches, m = !g.current;
|
|
256
256
|
if (n) {
|
|
257
|
-
|
|
257
|
+
S(m);
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
-
const v =
|
|
261
|
-
|
|
262
|
-
}, [
|
|
263
|
-
|
|
264
|
-
toggleCollapse: () =>
|
|
265
|
-
getIsCollapsed: () =>
|
|
266
|
-
|
|
267
|
-
|
|
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 (
|
|
279
|
+
if (c.current) {
|
|
271
280
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
272
|
-
|
|
281
|
+
F(!1);
|
|
273
282
|
return;
|
|
274
283
|
}
|
|
275
|
-
|
|
284
|
+
i("sidebar"), I("sidebar");
|
|
276
285
|
}
|
|
277
286
|
},
|
|
278
287
|
closeSidebar: () => {
|
|
279
288
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
280
|
-
|
|
289
|
+
F(!0);
|
|
281
290
|
return;
|
|
282
291
|
}
|
|
283
|
-
|
|
292
|
+
i("outlet"), I("outlet");
|
|
284
293
|
},
|
|
285
294
|
toggleSidebar: () => {
|
|
286
|
-
if (!
|
|
295
|
+
if (!c.current) return;
|
|
287
296
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
288
|
-
|
|
297
|
+
F(!b.current);
|
|
289
298
|
return;
|
|
290
299
|
}
|
|
291
|
-
const n =
|
|
292
|
-
|
|
300
|
+
const n = C.current === "sidebar" ? "outlet" : "sidebar";
|
|
301
|
+
i(n), I(n);
|
|
293
302
|
},
|
|
294
|
-
getIsSidebarOpen: () =>
|
|
295
|
-
subscribeToSidebarOpen: (n) => (
|
|
296
|
-
|
|
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
|
|
300
|
-
if (!
|
|
301
|
-
const v =
|
|
308
|
+
const m = d.current;
|
|
309
|
+
if (!m) return;
|
|
310
|
+
const v = m.scrollLeft;
|
|
302
311
|
if (n) {
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
-
|
|
319
|
+
m.classList.add("disabled-dragopen");
|
|
311
320
|
},
|
|
312
321
|
setSidebarDragEnabled: (n) => {
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
322
|
+
const m = d.current;
|
|
323
|
+
if (m)
|
|
315
324
|
if (n) {
|
|
316
|
-
const v =
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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
|
-
|
|
332
|
+
m.classList.add("disabled-dragopen-sidebar");
|
|
324
333
|
}
|
|
325
334
|
});
|
|
326
|
-
const
|
|
327
|
-
let
|
|
328
|
-
const
|
|
329
|
-
let oe = null,
|
|
330
|
-
|
|
331
|
-
if (!
|
|
332
|
-
|
|
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 && !
|
|
336
|
-
|
|
344
|
+
if (n.type === Me && !ue) {
|
|
345
|
+
ue = n;
|
|
337
346
|
return;
|
|
338
347
|
}
|
|
339
|
-
if (n.type ===
|
|
340
|
-
|
|
348
|
+
if (n.type === Se && !ee) {
|
|
349
|
+
ee = n;
|
|
341
350
|
return;
|
|
342
351
|
}
|
|
343
|
-
if (n.type ===
|
|
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 && !
|
|
352
|
-
|
|
360
|
+
if (n.type === Ge && !te) {
|
|
361
|
+
te = n;
|
|
353
362
|
return;
|
|
354
363
|
}
|
|
355
|
-
|
|
364
|
+
ae.push(n);
|
|
356
365
|
});
|
|
357
|
-
const
|
|
358
|
-
isCollapsed:
|
|
359
|
-
isSidebarOpen: !
|
|
360
|
-
}), [
|
|
361
|
-
return /* @__PURE__ */ e.jsx(Qe.Provider, { value:
|
|
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
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
384
|
-
|
|
392
|
+
ke,
|
|
393
|
+
ge
|
|
385
394
|
] })
|
|
386
395
|
] }),
|
|
387
|
-
|
|
396
|
+
De
|
|
388
397
|
]
|
|
389
398
|
}
|
|
390
399
|
),
|
|
391
|
-
ie &&
|
|
392
|
-
|
|
393
|
-
ref:
|
|
394
|
-
className: T("sidebar",
|
|
395
|
-
}) :
|
|
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 =
|
|
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 =
|
|
408
|
-
const o =
|
|
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
|
|
413
|
-
const
|
|
414
|
-
return /* @__PURE__ */ e.jsx("div", { ...o, className: T("w-full flex-1 drawer-content", r), children:
|
|
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
|
-
|
|
417
|
-
const
|
|
418
|
-
const o =
|
|
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
|
-
|
|
422
|
-
const rt =
|
|
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 =
|
|
425
|
-
const
|
|
426
|
-
|
|
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:
|
|
431
|
-
Footer:
|
|
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:
|
|
499
|
-
isSelected:
|
|
512
|
+
className: u,
|
|
513
|
+
isSelected: l = !1,
|
|
500
514
|
hasSublinks: f,
|
|
501
|
-
subLinksCollapsed:
|
|
502
|
-
onToggleSublinks:
|
|
503
|
-
as:
|
|
504
|
-
onClick:
|
|
515
|
+
subLinksCollapsed: d,
|
|
516
|
+
onToggleSublinks: p,
|
|
517
|
+
as: h = "div",
|
|
518
|
+
onClick: c,
|
|
505
519
|
onAuxClick: g,
|
|
506
|
-
disabled:
|
|
507
|
-
tooltipText:
|
|
508
|
-
} = t, L = (
|
|
509
|
-
|
|
510
|
-
},
|
|
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 && (
|
|
513
|
-
/* @__PURE__ */ e.jsx("label", { className: _t({ disabled:
|
|
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:
|
|
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
|
-
|
|
525
|
-
`${
|
|
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:
|
|
544
|
+
disabled: b,
|
|
531
545
|
type: "button",
|
|
532
|
-
onClick:
|
|
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:
|
|
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:
|
|
546
|
-
|
|
559
|
+
Pt({ isSelected: l, disabled: b }),
|
|
560
|
+
u
|
|
547
561
|
);
|
|
548
|
-
if (
|
|
549
|
-
const
|
|
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", { ...
|
|
568
|
+
return /* @__PURE__ */ e.jsx("a", { ...V, children: w });
|
|
555
569
|
}
|
|
556
|
-
if (
|
|
557
|
-
const
|
|
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", { ...
|
|
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:
|
|
569
|
-
}, Re =
|
|
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:
|
|
573
|
-
return
|
|
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:
|
|
581
|
-
isSelected:
|
|
594
|
+
className: u,
|
|
595
|
+
isSelected: l,
|
|
582
596
|
onClick: f,
|
|
583
|
-
disabled:
|
|
584
|
-
tooltipText:
|
|
597
|
+
disabled: p,
|
|
598
|
+
tooltipText: h
|
|
585
599
|
}
|
|
586
600
|
) : null;
|
|
587
|
-
}, st =
|
|
601
|
+
}, st = M(Rt);
|
|
588
602
|
st.displayName = "NavigationDrawerActionItem";
|
|
589
|
-
const Bt = ({ actions: t, activeActionId: r, onActionClick: s, className: o }) => /* @__PURE__ */ e.jsx(
|
|
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((
|
|
593
|
-
const { id:
|
|
594
|
-
s?.(
|
|
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
|
|
610
|
+
return d ? /* @__PURE__ */ e.jsx(
|
|
597
611
|
st,
|
|
598
612
|
{
|
|
599
|
-
...
|
|
600
|
-
id:
|
|
601
|
-
isActive:
|
|
613
|
+
...h,
|
|
614
|
+
id: l,
|
|
615
|
+
isActive: c,
|
|
602
616
|
onClick: g
|
|
603
617
|
},
|
|
604
|
-
|
|
618
|
+
l
|
|
605
619
|
) : null;
|
|
606
|
-
}) }), nt =
|
|
620
|
+
}) }), nt = M(Bt);
|
|
607
621
|
nt.displayName = "NavigationDrawerActions";
|
|
608
622
|
const Ft = (t) => {
|
|
609
|
-
const { className: r, title: s, path: o, onClick:
|
|
610
|
-
|
|
611
|
-
}, [o]),
|
|
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
|
|
615
|
-
window.open(
|
|
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:
|
|
623
|
-
onAuxClick:
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
653
|
+
}, at = M(Ft);
|
|
640
654
|
at.displayName = "NavItemSecondary";
|
|
641
|
-
const zt =
|
|
642
|
-
const [s, o] =
|
|
643
|
-
Q(() =>
|
|
644
|
-
|
|
645
|
-
}) : void 0, [
|
|
646
|
-
const
|
|
647
|
-
o((
|
|
648
|
-
}, []),
|
|
649
|
-
o(
|
|
650
|
-
}, []),
|
|
651
|
-
toggle:
|
|
652
|
-
setIsCollapsed:
|
|
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:
|
|
660
|
-
subscribeToCollapse:
|
|
673
|
+
toggleDrawerCollapse: C,
|
|
674
|
+
subscribeToCollapse: w
|
|
661
675
|
};
|
|
662
|
-
Ee(r, () =>
|
|
663
|
-
const
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
666
|
-
|
|
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?.(
|
|
670
|
-
}, [
|
|
671
|
-
window.open(
|
|
672
|
-
}, [
|
|
673
|
-
if (!
|
|
674
|
-
if (t.subLinksRender &&
|
|
675
|
-
return t.subLinksRender(
|
|
676
|
-
const
|
|
677
|
-
if (
|
|
678
|
-
const
|
|
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?.(
|
|
682
|
-
}, [
|
|
695
|
+
g?.(_);
|
|
696
|
+
}, [l]);
|
|
683
697
|
return Q(() => {
|
|
684
|
-
const
|
|
685
|
-
if (!
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
}, []), /* @__PURE__ */ e.jsx("div", { ref:
|
|
689
|
-
},
|
|
690
|
-
|
|
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:
|
|
699
|
-
count:
|
|
700
|
-
className:
|
|
701
|
-
isSelected:
|
|
702
|
-
hasSublinks: !!
|
|
712
|
+
icon: i,
|
|
713
|
+
count: p,
|
|
714
|
+
className: h,
|
|
715
|
+
isSelected: c,
|
|
716
|
+
hasSublinks: !!b,
|
|
703
717
|
subLinksCollapsed: s,
|
|
704
|
-
onToggleSublinks:
|
|
705
|
-
onClick:
|
|
706
|
-
onAuxClick:
|
|
718
|
+
onToggleSublinks: $,
|
|
719
|
+
onClick: I,
|
|
720
|
+
onAuxClick: R,
|
|
707
721
|
disabled: k,
|
|
708
|
-
tooltipText:
|
|
722
|
+
tooltipText: V
|
|
709
723
|
}
|
|
710
724
|
),
|
|
711
|
-
|
|
725
|
+
z()
|
|
712
726
|
] }) : null;
|
|
713
|
-
}), ot =
|
|
727
|
+
}), ot = M(zt);
|
|
714
728
|
ot.displayName = "NavigationDrawerLinkItem";
|
|
715
|
-
const Ut = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: o, toggleCollapse:
|
|
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(
|
|
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((
|
|
721
|
-
const
|
|
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
|
-
|
|
726
|
-
|
|
727
|
-
isSelected: b,
|
|
739
|
+
...d,
|
|
740
|
+
isSelected: h,
|
|
728
741
|
onClick: r,
|
|
729
|
-
toggleCollapse:
|
|
742
|
+
toggleCollapse: u,
|
|
730
743
|
getIsCollapsed: o,
|
|
731
|
-
subscribeToCollapse:
|
|
732
|
-
disabled:
|
|
733
|
-
isView:
|
|
744
|
+
subscribeToCollapse: l,
|
|
745
|
+
disabled: d.disabled,
|
|
746
|
+
isView: d.isView
|
|
734
747
|
},
|
|
735
|
-
|
|
748
|
+
p
|
|
736
749
|
);
|
|
737
750
|
}) });
|
|
738
|
-
}, lt =
|
|
751
|
+
}, lt = M(Ut);
|
|
739
752
|
lt.displayName = "NavigationDrawerNavlinks";
|
|
740
|
-
const it =
|
|
741
|
-
const { getIsCollapsed:
|
|
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:
|
|
761
|
+
getIsCollapsed: l,
|
|
749
762
|
toggleCollapse: f,
|
|
750
|
-
subscribeToCollapse:
|
|
763
|
+
subscribeToCollapse: d,
|
|
751
764
|
navlinks: t,
|
|
752
765
|
handleNavigation: r,
|
|
753
|
-
className: "flex flex-1 min-h-[
|
|
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:
|
|
762
|
-
className: "max-h-[
|
|
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:
|
|
783
|
+
const { sessions: r, onSessionClick: s, secondarySlot: o, subImageUrlAccessor: u } = t;
|
|
771
784
|
if (!r || r.length === 0)
|
|
772
785
|
return null;
|
|
773
|
-
const
|
|
774
|
-
s && s(
|
|
775
|
-
}, f = (
|
|
776
|
-
if (!
|
|
786
|
+
const l = (p) => {
|
|
787
|
+
s && s(p);
|
|
788
|
+
}, f = (p) => {
|
|
789
|
+
if (!u)
|
|
777
790
|
return;
|
|
778
|
-
const
|
|
779
|
-
if (!
|
|
791
|
+
const h = p.metadata;
|
|
792
|
+
if (!h)
|
|
780
793
|
return;
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
return typeof
|
|
784
|
-
},
|
|
785
|
-
return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((
|
|
786
|
-
const { auth_id:
|
|
787
|
-
return /* @__PURE__ */ e.jsx(se, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(se.Content, { onClick: () =>
|
|
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:
|
|
803
|
+
name: h.name,
|
|
791
804
|
avatarSize: "xxs",
|
|
792
|
-
secondarySlot:
|
|
793
|
-
subImageUrl: f(
|
|
794
|
-
imageUrl:
|
|
805
|
+
secondarySlot: d(p),
|
|
806
|
+
subImageUrl: f(p),
|
|
807
|
+
imageUrl: h.profile_picture,
|
|
795
808
|
className: "pyrion-navigation-drawer-user-card"
|
|
796
809
|
},
|
|
797
|
-
|
|
798
|
-
) }) },
|
|
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:
|
|
806
|
-
onLogoutClick:
|
|
818
|
+
onSessionClick: u,
|
|
819
|
+
onLogoutClick: l,
|
|
807
820
|
onProfileClick: f,
|
|
808
|
-
options:
|
|
809
|
-
currentSystemId:
|
|
810
|
-
userOptionsControls:
|
|
811
|
-
mobileAppSwitcherControls:
|
|
821
|
+
options: d,
|
|
822
|
+
currentSystemId: p,
|
|
823
|
+
userOptionsControls: h,
|
|
824
|
+
mobileAppSwitcherControls: c
|
|
812
825
|
}) => {
|
|
813
|
-
const { getIsCollapsed: g, toggleCollapse:
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
}, [g,
|
|
817
|
-
return Q(() =>
|
|
818
|
-
|
|
819
|
-
}), [
|
|
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:
|
|
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(
|
|
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:
|
|
853
|
+
onSessionClick: u,
|
|
841
854
|
secondarySlot: o,
|
|
842
|
-
subImageUrlAccessor:
|
|
843
|
-
currentSystemId:
|
|
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:
|
|
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
|
-
|
|
863
|
+
pe,
|
|
851
864
|
{
|
|
852
|
-
onClick:
|
|
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 =
|
|
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
|
|
871
|
-
if (!Object.prototype.hasOwnProperty.call(r,
|
|
883
|
+
for (const u of s) {
|
|
884
|
+
if (!Object.prototype.hasOwnProperty.call(r, u))
|
|
872
885
|
return !1;
|
|
873
|
-
const
|
|
874
|
-
if (
|
|
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(
|
|
886
|
-
const
|
|
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,
|
|
907
|
+
) : o.thumbnail, l = () => {
|
|
895
908
|
o.disabled || o.onClick && o.onClick(o.name);
|
|
896
909
|
};
|
|
897
|
-
return /* @__PURE__ */ e.jsxs("div", { onClick:
|
|
898
|
-
|
|
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 =
|
|
909
|
-
const o =
|
|
921
|
+
] }), Ae = M(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
|
|
922
|
+
const o = x(() => {
|
|
910
923
|
if (t) {
|
|
911
924
|
if (s) {
|
|
912
|
-
const
|
|
913
|
-
if (
|
|
925
|
+
const d = t.find((p) => p._id === s);
|
|
926
|
+
if (d) return { coverImage: d.coverImage, thumbnail: d.thumbnail };
|
|
914
927
|
}
|
|
915
|
-
const
|
|
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]),
|
|
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 ",
|
|
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 ",
|
|
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 =
|
|
945
|
-
const { getIsCollapsed:
|
|
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
|
|
948
|
-
t(
|
|
960
|
+
const p = l();
|
|
961
|
+
t(p);
|
|
949
962
|
}
|
|
950
|
-
}, [t,
|
|
963
|
+
}, [t, l]);
|
|
951
964
|
return f ? /* @__PURE__ */ e.jsx(
|
|
952
965
|
Wt,
|
|
953
966
|
{
|
|
954
|
-
controls:
|
|
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:
|
|
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:
|
|
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 [
|
|
977
|
-
|
|
978
|
-
const
|
|
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
|
-
|
|
981
|
-
}),
|
|
993
|
+
c.current.forEach(($) => $(z, z.length));
|
|
994
|
+
}), z;
|
|
982
995
|
});
|
|
983
|
-
}, []), L =
|
|
984
|
-
|
|
985
|
-
}), []),
|
|
986
|
-
|
|
987
|
-
const
|
|
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
|
-
|
|
990
|
-
}),
|
|
1002
|
+
c.current.forEach((z) => z(R, R.length));
|
|
1003
|
+
}), R;
|
|
991
1004
|
});
|
|
992
|
-
}, []), N =
|
|
993
|
-
|
|
994
|
-
|
|
1005
|
+
}, []), N = x(() => {
|
|
1006
|
+
l([]), queueMicrotask(() => {
|
|
1007
|
+
c.current.forEach((i) => i([], 0));
|
|
995
1008
|
});
|
|
996
|
-
}, []), k =
|
|
997
|
-
|
|
998
|
-
|
|
1009
|
+
}, []), k = x((i) => {
|
|
1010
|
+
l(i), queueMicrotask(() => {
|
|
1011
|
+
c.current.forEach((I) => I(i, i.length));
|
|
999
1012
|
});
|
|
1000
|
-
}, []),
|
|
1001
|
-
|
|
1013
|
+
}, []), V = x((i) => {
|
|
1014
|
+
h(i);
|
|
1002
1015
|
}, []);
|
|
1003
1016
|
Ee(s, () => ({
|
|
1004
|
-
addNewNotification:
|
|
1017
|
+
addNewNotification: C,
|
|
1005
1018
|
subscribeToUpdates: L,
|
|
1006
1019
|
setNotifications: k,
|
|
1007
|
-
removeNotification:
|
|
1020
|
+
removeNotification: w,
|
|
1008
1021
|
removeAllNotifications: N,
|
|
1009
|
-
setLoading:
|
|
1010
|
-
}), [
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1013
|
-
},
|
|
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 &&
|
|
1016
|
-
const
|
|
1017
|
-
|
|
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
|
|
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(
|
|
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:
|
|
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: (
|
|
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:
|
|
1049
|
-
title:
|
|
1050
|
-
onClick:
|
|
1051
|
-
isActive:
|
|
1052
|
-
onIconClick:
|
|
1053
|
-
onIconHover:
|
|
1054
|
-
iconTooltipProps:
|
|
1055
|
-
iconTooltipTitle:
|
|
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
|
-
|
|
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 &&
|
|
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:
|
|
1066
|
-
|
|
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
|
-
|
|
1079
|
-
|
|
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(
|
|
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:
|
|
1102
|
-
const [
|
|
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:
|
|
1117
|
+
setActiveSection: p
|
|
1105
1118
|
}));
|
|
1106
|
-
const
|
|
1119
|
+
const h = () => {
|
|
1107
1120
|
t();
|
|
1108
1121
|
};
|
|
1109
1122
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1110
|
-
|
|
1123
|
+
d === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
|
|
1111
1124
|
qt,
|
|
1112
1125
|
{
|
|
1113
|
-
onCloseClick:
|
|
1126
|
+
onCloseClick: h,
|
|
1114
1127
|
onMarkAllAsRead: r?.notificationsDrawerOptions?.onMarkAllAsRead,
|
|
1115
|
-
notificationsListControls:
|
|
1116
|
-
scrollableControls:
|
|
1128
|
+
notificationsListControls: u,
|
|
1129
|
+
scrollableControls: l
|
|
1117
1130
|
}
|
|
1118
1131
|
),
|
|
1119
|
-
|
|
1132
|
+
d === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx($t, { onCloseClick: h, children: typeof s == "function" ? s() : s })
|
|
1120
1133
|
] });
|
|
1121
|
-
}, ut =
|
|
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:
|
|
1129
|
-
scrollableControls:
|
|
1141
|
+
notificationsListControls: u,
|
|
1142
|
+
scrollableControls: l
|
|
1130
1143
|
}) => {
|
|
1131
|
-
const { closeSidebar: f } =
|
|
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:
|
|
1141
|
-
scrollableControls:
|
|
1153
|
+
notificationsListControls: u,
|
|
1154
|
+
scrollableControls: l
|
|
1142
1155
|
}
|
|
1143
1156
|
);
|
|
1144
|
-
}, ft =
|
|
1157
|
+
}, ft = M(Yt);
|
|
1145
1158
|
ft.displayName = "PyrionNavigationDrawer.Sidebar";
|
|
1146
1159
|
const Xt = ({ navigationControlsRef: t }) => {
|
|
1147
|
-
const r =
|
|
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:
|
|
1151
|
-
return /* @__PURE__ */ e.jsxs(G, { disableDragOpen: N.options?.disableDragOpen, outletRef:
|
|
1152
|
-
/* @__PURE__ */ e.jsx(Xt, { navigationControlsRef:
|
|
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:
|
|
1160
|
-
mobileAppSwitcherControls:
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
1202
|
-
initialSectionRef:
|
|
1203
|
-
notificationsListControls:
|
|
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 =
|
|
1211
|
-
const { children: s, ...o } = t, { children:
|
|
1212
|
-
if (f.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
|
|
1215
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1227
|
+
for (const p of f) {
|
|
1228
|
+
if (!Object.prototype.hasOwnProperty.call(l, p))
|
|
1216
1229
|
return !1;
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
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 =
|
|
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:
|
|
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
|
-
},
|
|
1239
|
-
if (
|
|
1240
|
-
|
|
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
|
|
1244
|
-
|
|
1245
|
-
}, [
|
|
1246
|
-
|
|
1247
|
-
},
|
|
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:
|
|
1250
|
-
desktop: (
|
|
1251
|
-
typeof window < "u" &&
|
|
1262
|
+
mobile: te,
|
|
1263
|
+
desktop: (a) => {
|
|
1264
|
+
typeof window < "u" && a && (window.location.href = a);
|
|
1252
1265
|
}
|
|
1253
1266
|
},
|
|
1254
1267
|
product: {
|
|
1255
|
-
mobile:
|
|
1256
|
-
desktop:
|
|
1268
|
+
mobile: te,
|
|
1269
|
+
desktop: te
|
|
1257
1270
|
}
|
|
1258
|
-
},
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1261
|
-
}, [
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
}, [
|
|
1265
|
-
if (
|
|
1266
|
-
|
|
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
|
-
|
|
1270
|
-
}, [
|
|
1271
|
-
const
|
|
1272
|
-
s.enabled_systems.forEach((
|
|
1273
|
-
|
|
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
|
|
1276
|
-
for (const [
|
|
1277
|
-
if (
|
|
1278
|
-
return
|
|
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]),
|
|
1293
|
+
}, [s.enabled_systems]), De = c?.currentTabName || ze(), ve = me(
|
|
1281
1294
|
() => s.sessions || [],
|
|
1282
1295
|
[s.sessions]
|
|
1283
|
-
),
|
|
1284
|
-
if (!
|
|
1285
|
-
if (Array.isArray(
|
|
1286
|
-
const
|
|
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:
|
|
1289
|
-
|
|
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:
|
|
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
|
|
1296
|
-
const
|
|
1297
|
-
return
|
|
1308
|
+
if (typeof a == "string") {
|
|
1309
|
+
const P = ye(y, a);
|
|
1310
|
+
return X(P);
|
|
1298
1311
|
}
|
|
1299
|
-
return typeof
|
|
1300
|
-
}, []),
|
|
1301
|
-
(
|
|
1302
|
-
const
|
|
1303
|
-
if (!
|
|
1304
|
-
const
|
|
1305
|
-
return
|
|
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,
|
|
1308
|
-
),
|
|
1309
|
-
(
|
|
1310
|
-
const
|
|
1311
|
-
if (!
|
|
1312
|
-
const
|
|
1313
|
-
return
|
|
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,
|
|
1316
|
-
),
|
|
1317
|
-
const
|
|
1318
|
-
return
|
|
1319
|
-
|
|
1320
|
-
},
|
|
1321
|
-
|
|
1322
|
-
}, !k?.notificationsDrawerOptions?.hideActionButton && !k?.notificationsDrawerOptions?.hide &&
|
|
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:
|
|
1327
|
-
count:
|
|
1328
|
-
}), !k?.helpSectionDrawerOptions?.hideActionButton && r && !k?.helpSectionDrawerOptions?.hide &&
|
|
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:
|
|
1333
|
-
}), k?.configurationActionOptions?.onClick && !k?.configurationActionOptions?.hideActionButton &&
|
|
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
|
-
}),
|
|
1339
|
-
}, [k, r,
|
|
1340
|
-
() => [...
|
|
1341
|
-
[
|
|
1342
|
-
),
|
|
1343
|
-
const
|
|
1344
|
-
name:
|
|
1345
|
-
thumbnail:
|
|
1346
|
-
onClick:
|
|
1347
|
-
id:
|
|
1348
|
-
})) || [],
|
|
1349
|
-
...
|
|
1350
|
-
onClick: () =>
|
|
1351
|
-
})) || [],
|
|
1352
|
-
name:
|
|
1353
|
-
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 [...
|
|
1357
|
-
}, [s.enabled_systems, s.company.products,
|
|
1358
|
-
|
|
1359
|
-
}, []),
|
|
1360
|
-
}), []),
|
|
1361
|
-
|
|
1362
|
-
}, []),
|
|
1363
|
-
|
|
1364
|
-
}, []),
|
|
1365
|
-
|
|
1366
|
-
}, []),
|
|
1367
|
-
}), []),
|
|
1368
|
-
|
|
1369
|
-
}, []),
|
|
1370
|
-
const
|
|
1371
|
-
!
|
|
1372
|
-
typeof
|
|
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
|
|
1375
|
-
return
|
|
1376
|
-
}, [
|
|
1377
|
-
|
|
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
|
|
1380
|
-
|
|
1381
|
-
|
|
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
|
-
}, [
|
|
1384
|
-
|
|
1385
|
-
|
|
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:
|
|
1390
|
-
allActions:
|
|
1391
|
-
activeActionId:
|
|
1392
|
-
onActionClick:
|
|
1402
|
+
handleNavigation: oe,
|
|
1403
|
+
allActions: A,
|
|
1404
|
+
activeActionId: p,
|
|
1405
|
+
onActionClick: h,
|
|
1393
1406
|
state: s,
|
|
1394
|
-
currentAppSessions:
|
|
1395
|
-
resolveUserSecondarySlot:
|
|
1396
|
-
resolveSessionSecondarySlot:
|
|
1397
|
-
onSessionClick:
|
|
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:
|
|
1402
|
-
mobileAppSwitcherControls:
|
|
1403
|
-
onSystemLogoClick:
|
|
1404
|
-
tabs:
|
|
1414
|
+
userOptionsControls: z,
|
|
1415
|
+
mobileAppSwitcherControls: $,
|
|
1416
|
+
onSystemLogoClick: C,
|
|
1417
|
+
tabs: U,
|
|
1405
1418
|
helpSection: r,
|
|
1406
|
-
sidebarContentRef:
|
|
1407
|
-
initialSectionRef:
|
|
1408
|
-
navigationControlsRef:
|
|
1409
|
-
notificationsListControls:
|
|
1410
|
-
scrollableControls:
|
|
1411
|
-
outletRef:
|
|
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
|
-
|
|
1429
|
+
U.length > 0 && /* @__PURE__ */ e.jsx(
|
|
1417
1430
|
Tt,
|
|
1418
1431
|
{
|
|
1419
1432
|
className: "hidden md:flex",
|
|
1420
|
-
tabs:
|
|
1433
|
+
tabs: U,
|
|
1421
1434
|
activeColor: "var(--neutral-900)",
|
|
1422
|
-
currentTabName:
|
|
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:
|
|
1431
|
-
allActions:
|
|
1432
|
-
activeActionId:
|
|
1433
|
-
onActionClick:
|
|
1443
|
+
handleNavigation: oe,
|
|
1444
|
+
allActions: A,
|
|
1445
|
+
activeActionId: p,
|
|
1446
|
+
onActionClick: h,
|
|
1434
1447
|
state: s,
|
|
1435
|
-
currentAppSessions:
|
|
1436
|
-
resolveUserSecondarySlot:
|
|
1437
|
-
resolveSessionSecondarySlot:
|
|
1438
|
-
onSessionClick:
|
|
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:
|
|
1443
|
-
mobileAppSwitcherControls:
|
|
1444
|
-
onSystemLogoClick:
|
|
1445
|
-
tabs:
|
|
1455
|
+
userOptionsControls: z,
|
|
1456
|
+
mobileAppSwitcherControls: $,
|
|
1457
|
+
onSystemLogoClick: C,
|
|
1458
|
+
tabs: U,
|
|
1446
1459
|
helpSection: r,
|
|
1447
|
-
sidebarContentRef:
|
|
1448
|
-
initialSectionRef:
|
|
1449
|
-
navigationControlsRef:
|
|
1450
|
-
notificationsListControls:
|
|
1451
|
-
scrollableControls:
|
|
1452
|
-
outletRef:
|
|
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
|
}
|