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