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