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