bonsaif-ui 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,19 @@
1
- import { jsx as e, jsxs as s, Fragment as le } from "react/jsx-runtime";
2
- import Xe, { useState as E, useRef as J, useEffect as R, useCallback as Ve, useLayoutEffect as Dt, useMemo as Je, useSyncExternalStore as At } from "react";
3
- import { HiChevronLeft as Se, HiChevronDown as ge, HiChevronRight as xe, HiCalendarDays as Ie, HiMagnifyingGlass as We, HiXMark as ce, HiExclamationTriangle as zt, HiChevronUp as Ot, HiChevronUpDown as It, HiEyeSlash as Ht, HiEye as Wt, HiBars3 as Pt, HiHome as Ce, HiArrowRightOnRectangle as _t, HiShieldCheck as De, HiInbox as Ft, HiListBullet as Ze, HiBriefcase as jt, HiCog6Tooth as Ke, HiUsers as Qe, HiDocumentText as Ut, HiBell as Yt, HiUser as qt, HiClipboardDocumentList as Gt, HiBuildingOffice2 as Xt, HiRectangleGroup as Vt, HiTicket as Jt, HiChartBar as Zt } from "react-icons/hi2";
4
- import { OverlayScrollbars as et } from "overlayscrollbars";
5
- import { createPortal as Ee } from "react-dom";
6
- import { MdDragIndicator as Kt } from "react-icons/md";
7
- import { OverlayScrollbarsComponent as tt } from "overlayscrollbars-react";
8
- import { DayPicker as Qt, useDayPicker as er } from "react-day-picker";
1
+ "use client";
2
+ import { jsx as e, jsxs as i, Fragment as we } from "react/jsx-runtime";
3
+ import ct, { useRef as ie, useState as B, useEffect as O, useMemo as Oe, useCallback as et, useLayoutEffect as _t, useSyncExternalStore as Ht } from "react";
4
+ import { HiMagnifyingGlass as Ye, HiXMark as Se, HiChevronLeft as _e, HiChevronDown as He, HiChevronRight as Te, HiCalendarDays as tt, HiExclamationTriangle as Pt, HiChevronUp as Wt, HiChevronUpDown as jt, HiEyeSlash as Ft, HiEye as Ut, HiCheck as qt, HiLockClosed as Yt, HiBars3 as Gt, HiHome as qe, HiArrowRightOnRectangle as Xt, HiShieldCheck as Ve, HiInbox as Jt, HiListBullet as dt, HiBriefcase as Vt, HiCog6Tooth as ut, HiUsers as mt, HiDocumentText as Kt, HiBell as Zt, HiUser as Qt, HiClipboardDocumentList as er, HiBuildingOffice2 as tr, HiRectangleGroup as rr, HiTicket as nr, HiChartBar as ar } from "react-icons/hi2";
5
+ import { OverlayScrollbars as ft } from "overlayscrollbars";
6
+ import { createPortal as Ge } from "react-dom";
7
+ import { MdDragIndicator as or } from "react-icons/md";
8
+ import { OverlayScrollbarsComponent as pt } from "overlayscrollbars-react";
9
+ import { DayPicker as ir, useDayPicker as sr } from "react-day-picker";
9
10
  import "react-day-picker/dist/style.css";
10
- import { FiSave as tr } from "react-icons/fi";
11
- import { Toaster as rr } from "sonner";
12
- function nr(...t) {
11
+ import { FiSave as lr } from "react-icons/fi";
12
+ import { Toaster as cr } from "sonner";
13
+ function dr(...t) {
13
14
  return t.filter(Boolean).join(" ");
14
15
  }
15
- function Qr({
16
+ function bn({
16
17
  variant: t = "primary",
17
18
  className: r,
18
19
  type: n = "button",
@@ -22,71 +23,504 @@ function Qr({
22
23
  return /* @__PURE__ */ e(
23
24
  "button",
24
25
  {
25
- className: nr("bonsaif-ui-button", `bonsaif-ui-button--${t}`, r),
26
+ className: dr("bonsaif-ui-button", `bonsaif-ui-button--${t}`, r),
26
27
  type: n,
27
28
  ...l,
28
29
  children: a
29
30
  }
30
31
  );
31
32
  }
32
- function rt(t) {
33
+ function ur({
34
+ value: t,
35
+ onChange: r,
36
+ placeholder: n,
37
+ className: a = "",
38
+ autoFocus: l = !1,
39
+ forceExpanded: u = !1,
40
+ onEscape: d,
41
+ size: p = "default",
42
+ inputTabIndex: m
43
+ }) {
44
+ const h = ie(null), [w, N] = B(!1), g = u || w || t.trim().length > 0, f = p === "sm" ? "h-9 rounded-md" : "h-11 rounded-lg";
45
+ O(() => {
46
+ var c;
47
+ l && (N(!0), (c = h.current) == null || c.focus());
48
+ }, [l]);
49
+ const v = () => {
50
+ var c;
51
+ N(!0), (c = h.current) == null || c.focus();
52
+ };
53
+ return /* @__PURE__ */ i(
54
+ "div",
55
+ {
56
+ className: `relative flex-shrink-0 overflow-visible transition-[width] duration-200 ease-out ${g ? a || "w-full" : "w-28"}`,
57
+ onMouseDown: (c) => {
58
+ g || (c.preventDefault(), v());
59
+ },
60
+ children: [
61
+ /* @__PURE__ */ e(
62
+ Ye,
63
+ {
64
+ className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none transition-colors duration-200",
65
+ style: { color: "var(--text-muted)" }
66
+ }
67
+ ),
68
+ /* @__PURE__ */ e(
69
+ "input",
70
+ {
71
+ ref: h,
72
+ type: "text",
73
+ tabIndex: m,
74
+ "aria-label": n,
75
+ value: t,
76
+ onChange: (c) => r(c.target.value),
77
+ onKeyDown: (c) => {
78
+ c.key === "Escape" && (d == null || d());
79
+ },
80
+ placeholder: g ? n : "Buscar",
81
+ className: `${f} w-full py-0 text-sm placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${g ? "pl-9 pr-9" : "cursor-pointer pl-9 pr-3"}`,
82
+ style: {
83
+ background: "var(--bg-card)",
84
+ border: "1px solid var(--border)",
85
+ color: "var(--text-main)"
86
+ },
87
+ onFocus: (c) => {
88
+ N(!0), c.currentTarget.style.borderColor = "var(--primary)", c.currentTarget.style.boxShadow = "0 0 0 3px rgba(59,130,246,0.12)";
89
+ },
90
+ onBlur: (c) => {
91
+ N(!1), c.currentTarget.style.borderColor = "var(--border)", c.currentTarget.style.boxShadow = "none";
92
+ }
93
+ }
94
+ ),
95
+ t && /* @__PURE__ */ e(
96
+ "button",
97
+ {
98
+ type: "button",
99
+ onClick: () => r(""),
100
+ className: "absolute right-2 top-1/2 flex !h-6 !w-6 -translate-y-1/2 items-center justify-center rounded-full !p-0 leading-none transition-colors hover:bg-black/5",
101
+ style: { color: "var(--text-muted)" },
102
+ "aria-label": "Limpiar búsqueda",
103
+ children: /* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5 flex-shrink-0" })
104
+ }
105
+ )
106
+ ]
107
+ }
108
+ );
109
+ }
110
+ function ht(t) {
33
111
  if (t !== void 0)
34
112
  return typeof t == "number" ? `${t}px` : t;
35
113
  }
36
- const ar = "inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap leading-none font-medium transition-all duration-150 focus:outline-none disabled:opacity-50 rounded-lg", or = {
114
+ const mr = "inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap leading-none font-medium transition-all duration-150 focus:outline-none disabled:opacity-50 rounded-lg", fr = {
37
115
  primary: "border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",
38
116
  secondary: "border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",
39
117
  danger: "border border-[var(--border)] text-[var(--danger)] hover:border-[var(--danger)] hover:bg-[var(--danger-bg)] active:scale-[0.98] transition-colors",
40
118
  ghost: "text-[var(--text-secondary)] hover:opacity-70",
41
119
  icon: "h-9 w-9 text-[var(--text-muted)] hover:text-[var(--primary)] hover:bg-primary/5"
42
- }, ir = {
120
+ }, pr = {
43
121
  sm: "h-9 px-3.5 text-xs",
44
122
  md: "h-11 px-4 text-sm",
45
123
  lg: "h-12 px-5 text-sm font-semibold"
46
- }, sr = {
124
+ }, hr = {
47
125
  primary: { background: "var(--bg-card)" },
48
126
  secondary: { background: "var(--bg-card)" },
49
127
  danger: { background: "var(--bg-card)" },
50
128
  ghost: {},
51
129
  icon: {}
52
130
  };
53
- function ne({
131
+ function he({
54
132
  variant: t = "primary",
55
133
  size: r = "md",
56
134
  loading: n = !1,
57
135
  icon: a,
58
136
  height: l,
59
137
  padding: u,
60
- children: m,
138
+ children: d,
61
139
  className: p = "",
62
- disabled: c,
63
- style: d,
64
- ...y
140
+ disabled: m,
141
+ style: h,
142
+ ...w
65
143
  }) {
66
- const C = t === "icon";
67
- return /* @__PURE__ */ s(
144
+ const N = t === "icon";
145
+ return /* @__PURE__ */ i(
68
146
  "button",
69
147
  {
70
- ...y,
148
+ ...w,
71
149
  "data-variant": t,
72
150
  "data-size": r,
73
- "data-icon": C ? "true" : void 0,
74
- disabled: c || n,
75
- className: `${ar} ${or[t]} ${C ? "" : ir[r]} ${p}`,
151
+ "data-icon": N ? "true" : void 0,
152
+ disabled: m || n,
153
+ className: `${mr} ${fr[t]} ${N ? "" : pr[r]} ${p}`,
76
154
  style: {
77
- ...sr[t],
78
- height: rt(l),
79
- padding: rt(u),
80
- ...d
155
+ ...hr[t],
156
+ height: ht(l),
157
+ padding: ht(u),
158
+ ...h
81
159
  },
82
160
  children: [
83
161
  n ? /* @__PURE__ */ e("span", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : a,
84
- m
162
+ d
85
163
  ]
86
164
  }
87
165
  );
88
166
  }
89
- const pt = [
167
+ function br({
168
+ variant: t = "page",
169
+ title: r = "Cargando...",
170
+ rows: n = 6,
171
+ children: a
172
+ }) {
173
+ return t === "table" ? /* @__PURE__ */ e(Et, { rows: n }) : t === "sections" ? /* @__PURE__ */ e(xr, { rows: n }) : t === "cards" ? /* @__PURE__ */ e(vr, { rows: n }) : /* @__PURE__ */ e("div", { className: "flex min-h-[240px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-3 text-center", children: [
174
+ /* @__PURE__ */ e("div", { className: "h-9 w-9 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--primary)]" }),
175
+ /* @__PURE__ */ i("div", { children: [
176
+ /* @__PURE__ */ e("p", { className: "text-sm font-semibold text-[var(--text-main)]", children: r }),
177
+ a && /* @__PURE__ */ e("div", { className: "mt-1 text-xs text-[var(--text-muted)]", children: a })
178
+ ] })
179
+ ] }) });
180
+ }
181
+ function xr({ rows: t }) {
182
+ return /* @__PURE__ */ e("div", { className: "space-y-4", children: Array.from({ length: Math.max(2, Math.min(t, 4)) }).map(
183
+ (r, n) => /* @__PURE__ */ i(
184
+ "section",
185
+ {
186
+ className: "overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",
187
+ children: [
188
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--border)] px-3 py-3", children: [
189
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
190
+ /* @__PURE__ */ e("div", { className: "h-4 w-4 animate-pulse rounded bg-[var(--bg-input)]" }),
191
+ /* @__PURE__ */ e("div", { className: "h-4 w-32 animate-pulse rounded bg-[var(--bg-input)]" }),
192
+ /* @__PURE__ */ e("div", { className: "h-5 w-20 animate-pulse rounded-full bg-[var(--bg-input)]" })
193
+ ] }),
194
+ /* @__PURE__ */ i("div", { className: "flex gap-1", children: [
195
+ /* @__PURE__ */ e("div", { className: "h-8 w-8 animate-pulse rounded-md bg-[var(--bg-input)]" }),
196
+ /* @__PURE__ */ e("div", { className: "h-8 w-8 animate-pulse rounded-md bg-[var(--bg-input)]" })
197
+ ] })
198
+ ] }),
199
+ /* @__PURE__ */ e(
200
+ Et,
201
+ {
202
+ rows: n === 0 ? t : Math.max(3, t - 2),
203
+ compact: !0
204
+ }
205
+ )
206
+ ]
207
+ },
208
+ n
209
+ )
210
+ ) });
211
+ }
212
+ function vr({ rows: t }) {
213
+ return /* @__PURE__ */ e("div", { className: "grid gap-3 md:grid-cols-2 xl:grid-cols-3", children: Array.from({ length: t }).map((r, n) => /* @__PURE__ */ i(
214
+ "div",
215
+ {
216
+ className: "rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4",
217
+ children: [
218
+ /* @__PURE__ */ e("div", { className: "h-4 w-2/3 animate-pulse rounded bg-[var(--bg-input)]" }),
219
+ /* @__PURE__ */ e("div", { className: "mt-3 h-3 w-full animate-pulse rounded bg-[var(--bg-input)]" }),
220
+ /* @__PURE__ */ e("div", { className: "mt-2 h-3 w-4/5 animate-pulse rounded bg-[var(--bg-input)]" })
221
+ ]
222
+ },
223
+ n
224
+ )) });
225
+ }
226
+ function Et({
227
+ rows: t,
228
+ compact: r = !1
229
+ }) {
230
+ const n = r ? 5 : 6;
231
+ return /* @__PURE__ */ i("div", { className: "overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]", children: [
232
+ /* @__PURE__ */ e(
233
+ "div",
234
+ {
235
+ className: "grid border-b border-[var(--border)]",
236
+ style: { gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` },
237
+ children: Array.from({ length: n }).map((a, l) => /* @__PURE__ */ e("div", { className: "px-3 py-3", children: /* @__PURE__ */ e("div", { className: "h-3 w-2/3 animate-pulse rounded bg-[var(--bg-input)]" }) }, l))
238
+ }
239
+ ),
240
+ Array.from({ length: t }).map((a, l) => /* @__PURE__ */ e(
241
+ "div",
242
+ {
243
+ className: "grid border-b border-[var(--border)] last:border-b-0",
244
+ style: { gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` },
245
+ children: Array.from({ length: n }).map((u, d) => /* @__PURE__ */ e("div", { className: "px-3 py-3", children: /* @__PURE__ */ e(
246
+ "div",
247
+ {
248
+ className: "h-3.5 animate-pulse rounded-full bg-[var(--bg-input)]",
249
+ style: {
250
+ width: `${52 + (l * 13 + d * 11) % 36}%`
251
+ }
252
+ }
253
+ ) }, d))
254
+ },
255
+ l
256
+ ))
257
+ ] });
258
+ }
259
+ function Mt(t) {
260
+ const r = t.split("/").filter(Boolean);
261
+ return (r[r.length - 1] ?? t).replace(/^lv_/, "").split(/[-_]/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ");
262
+ }
263
+ function bt(t) {
264
+ return t.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim();
265
+ }
266
+ function gr(t) {
267
+ return [
268
+ t.label,
269
+ Mt(t.service),
270
+ t.description,
271
+ t.service
272
+ ].filter(Boolean).join(" ");
273
+ }
274
+ function yr(t) {
275
+ return typeof t == "function" ? t : t.default;
276
+ }
277
+ function wr(t, r) {
278
+ return /* @__PURE__ */ e("div", { className: "flex min-h-[220px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6 text-center", children: /* @__PURE__ */ i("div", { className: "max-w-md", children: [
279
+ /* @__PURE__ */ e("p", { className: "text-sm font-semibold text-[var(--text-main)]", children: "No se pudo cargar este modulo" }),
280
+ /* @__PURE__ */ e("p", { className: "mt-1 text-xs text-[var(--text-muted)]", children: t.message }),
281
+ /* @__PURE__ */ e(he, { className: "mt-4", height: 36, padding: "0 14px", onClick: r, children: "Reintentar" })
282
+ ] }) });
283
+ }
284
+ function xn({
285
+ parentPanel: t,
286
+ parentPanelComponent: r,
287
+ renderParentPanel: n,
288
+ parent: a,
289
+ context: l,
290
+ links: u,
291
+ moduleRegistry: d,
292
+ loadModule: p,
293
+ activeService: m,
294
+ initialService: h,
295
+ onActiveServiceChange: w,
296
+ canAccess: N,
297
+ keepAlive: g = !0,
298
+ title: f,
299
+ subtitle: v,
300
+ emptyState: c,
301
+ loadingState: $,
302
+ errorState: D = wr,
303
+ renderTabLabel: K,
304
+ searchableTabs: W = "auto",
305
+ tabsSearchThreshold: E = 6,
306
+ tabsSearchPlaceholder: T = "Buscar modulo...",
307
+ tabsSearchValue: I,
308
+ onTabsSearchChange: L,
309
+ emptySearchState: F,
310
+ showTabCount: M = !0,
311
+ className: S = "",
312
+ parentClassName: P = "",
313
+ contentClassName: J = "",
314
+ tabsClassName: _ = ""
315
+ }) {
316
+ var ue;
317
+ const j = Oe(
318
+ () => u.filter(
319
+ (b) => !b.hidden && ((N == null ? void 0 : N(b, l)) ?? !0)
320
+ ),
321
+ [N, l, u]
322
+ ), U = (ue = j.find(
323
+ (b) => !b.disabled
324
+ )) == null ? void 0 : ue.service, [Z, o] = B(
325
+ h ?? U ?? ""
326
+ ), [y, H] = B({}), [q, G] = B({}), [ee, me] = B(""), [te, be] = B(!1), fe = ie(q), ve = ie(0), de = I ?? ee, k = bt(de), A = W === !0 || W === "auto" && j.length >= E, X = A && de.trim().length > 0, ne = Oe(() => k ? j.filter(
327
+ (b) => bt(gr(b)).includes(k)
328
+ ) : j, [k, j]), ce = m ?? Z, R = j.find((b) => b.service === ce) ?? j.find((b) => !b.disabled);
329
+ O(() => {
330
+ !R && U && o(U);
331
+ }, [U, R]), O(() => {
332
+ fe.current = q;
333
+ }, [q]);
334
+ const Ne = (b) => {
335
+ b.disabled || (m || o(b.service), w == null || w(b.service, b));
336
+ }, Pe = (b) => {
337
+ I === void 0 && me(b), L == null || L(b);
338
+ }, xe = (b, V) => {
339
+ const oe = ne.filter((se) => !se.disabled), Ce = oe.findIndex(
340
+ (se) => se.service === V.service
341
+ );
342
+ Ce < 0 || ((b.key === "ArrowRight" || b.key === "ArrowDown") && (b.preventDefault(), Ne(oe[(Ce + 1) % oe.length])), (b.key === "ArrowLeft" || b.key === "ArrowUp") && (b.preventDefault(), Ne(
343
+ oe[(Ce - 1 + oe.length) % oe.length]
344
+ )), b.key === "Home" && (b.preventDefault(), Ne(oe[0])), b.key === "End" && (b.preventDefault(), Ne(oe[oe.length - 1])));
345
+ }, De = et(() => {
346
+ if (!R) return;
347
+ const b = R.service, V = fe.current[b];
348
+ if (V != null && V.loading || V != null && V.component && g) return;
349
+ const oe = (d == null ? void 0 : d[b]) ?? p;
350
+ if (!oe) {
351
+ G((se) => ({
352
+ ...se,
353
+ [b]: {
354
+ loading: !1,
355
+ error: new Error(`No module loader found for service "${b}".`)
356
+ }
357
+ }));
358
+ return;
359
+ }
360
+ const Ce = ++ve.current;
361
+ G((se) => ({
362
+ ...se,
363
+ [b]: { ...se[b], loading: !0, error: void 0 }
364
+ })), oe(R, l).then((se) => {
365
+ if (Ce !== ve.current && !g) return;
366
+ const $e = yr(se);
367
+ G((Be) => ({
368
+ ...Be,
369
+ [b]: { component: $e, loading: !1 }
370
+ }));
371
+ }).catch((se) => {
372
+ const $e = se instanceof Error ? se : new Error(String(se));
373
+ G((Be) => ({
374
+ ...Be,
375
+ [b]: { ...Be[b], loading: !1, error: $e }
376
+ }));
377
+ });
378
+ }, [l, g, p, d, R]);
379
+ O(De, [De]);
380
+ const We = R ? y[R.service] ?? null : null, ae = R ? q[R.service] : void 0, Me = ae == null ? void 0 : ae.component, Ie = (b) => {
381
+ R && H((V) => ({
382
+ ...V,
383
+ [R.service]: b
384
+ }));
385
+ }, je = () => {
386
+ R && H((b) => ({
387
+ ...b,
388
+ [R.service]: null
389
+ }));
390
+ }, ge = {
391
+ context: l,
392
+ parent: a,
393
+ links: u,
394
+ visibleLinks: j,
395
+ filteredLinks: ne,
396
+ selectedLink: R,
397
+ selectedService: R == null ? void 0 : R.service,
398
+ activeItemId: We,
399
+ tabsSearch: de,
400
+ onSelectService: Ne,
401
+ onOpenDetail: Ie,
402
+ onBackToList: je
403
+ }, ye = n ? n(ge) : r ? /* @__PURE__ */ e(r, { ...ge }) : t;
404
+ return /* @__PURE__ */ i(
405
+ "section",
406
+ {
407
+ className: `grid min-h-[520px] gap-4 lg:grid-cols-[minmax(260px,360px)_minmax(0,1fr)] ${S}`,
408
+ children: [
409
+ /* @__PURE__ */ e(
410
+ "aside",
411
+ {
412
+ className: `min-w-0 rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4 ${P}`,
413
+ children: ye
414
+ }
415
+ ),
416
+ /* @__PURE__ */ i(
417
+ "div",
418
+ {
419
+ className: `relative min-w-0 overflow-visible rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${J}`,
420
+ children: [
421
+ (f || v || A || M) && /* @__PURE__ */ e("div", { className: "relative border-b border-[var(--border)] px-4 py-3", children: /* @__PURE__ */ i("div", { className: "flex min-w-0 items-start justify-between gap-3", children: [
422
+ /* @__PURE__ */ i("div", { className: "min-w-0", children: [
423
+ f && /* @__PURE__ */ e("h2", { className: "truncate text-sm font-semibold text-[var(--text-main)]", children: f }),
424
+ v && /* @__PURE__ */ e("p", { className: "mt-1 line-clamp-2 text-xs text-[var(--text-muted)]", children: v })
425
+ ] }),
426
+ (A || M) && /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-shrink-0 items-center justify-end gap-2", children: [
427
+ M && /* @__PURE__ */ i("span", { className: "hidden text-xs font-semibold text-[var(--text-muted)] transition-opacity duration-200 sm:inline", children: [
428
+ ne.length,
429
+ " / ",
430
+ j.length
431
+ ] }),
432
+ A && /* @__PURE__ */ i(we, { children: [
433
+ /* @__PURE__ */ e(
434
+ "div",
435
+ {
436
+ className: `origin-right overflow-hidden transition-[width,opacity,transform] duration-200 ease-out ${te ? "w-[min(20rem,44vw)] translate-x-0 opacity-100" : "w-0 translate-x-2 opacity-0"}`,
437
+ "aria-hidden": !te,
438
+ children: /* @__PURE__ */ e(
439
+ ur,
440
+ {
441
+ value: de,
442
+ onChange: Pe,
443
+ placeholder: T,
444
+ className: "w-full",
445
+ autoFocus: te,
446
+ forceExpanded: !0,
447
+ onEscape: () => be(!1),
448
+ size: "sm",
449
+ inputTabIndex: te ? 0 : -1
450
+ }
451
+ )
452
+ }
453
+ ),
454
+ /* @__PURE__ */ e(
455
+ "button",
456
+ {
457
+ type: "button",
458
+ "aria-label": te ? "Cerrar busqueda" : "Buscar tabs",
459
+ "aria-expanded": te,
460
+ onClick: () => {
461
+ te && de && Pe(""), be((b) => !b);
462
+ },
463
+ className: `inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border transition-all duration-200 hover:scale-[1.03] active:scale-95 ${te || X ? "border-[var(--primary)] bg-[var(--bg-input)] text-[var(--text-main)] shadow-sm" : "border-[var(--border)] text-[var(--text-muted)] hover:bg-[var(--bg-input)] hover:text-[var(--text-main)]"}`,
464
+ children: /* @__PURE__ */ e("span", { className: "grid h-4 w-4 place-items-center transition-transform duration-200", children: te || X ? /* @__PURE__ */ e(Se, { className: "h-4 w-4" }) : /* @__PURE__ */ e(Ye, { className: "h-4 w-4" }) })
465
+ }
466
+ )
467
+ ] })
468
+ ] })
469
+ ] }) }),
470
+ /* @__PURE__ */ e(
471
+ "div",
472
+ {
473
+ role: "tablist",
474
+ "aria-label": f ?? "Modulos relacionados",
475
+ className: `flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${_}`,
476
+ children: ne.length > 0 ? ne.map((b) => {
477
+ const V = b.service === (R == null ? void 0 : R.service);
478
+ return /* @__PURE__ */ e(
479
+ "button",
480
+ {
481
+ type: "button",
482
+ role: "tab",
483
+ "aria-selected": V,
484
+ disabled: b.disabled,
485
+ onClick: () => Ne(b),
486
+ onKeyDown: (oe) => xe(oe, b),
487
+ className: `inline-flex h-9 min-w-max items-center gap-2 rounded-md border px-3 text-xs font-semibold transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50 ${V ? "border-[var(--primary)] bg-[var(--bg-card)] text-[var(--text-main)] shadow-sm" : "border-transparent text-[var(--text-muted)] hover:bg-[var(--bg-card)] hover:text-[var(--text-main)]"}`,
488
+ children: K ? K(b, V) : /* @__PURE__ */ i(we, { children: [
489
+ b.icon,
490
+ /* @__PURE__ */ e("span", { children: b.label ?? Mt(b.service) }),
491
+ b.badge && /* @__PURE__ */ e("span", { className: "rounded-full bg-[var(--bg-input)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]", children: b.badge })
492
+ ] })
493
+ },
494
+ b.service
495
+ );
496
+ }) : /* @__PURE__ */ e("div", { className: "flex min-h-9 flex-1 items-center rounded-md border border-dashed border-[var(--border)] px-3 text-xs text-[var(--text-muted)]", children: F ?? "No hay modulos que coincidan con la busqueda." })
497
+ }
498
+ ),
499
+ (R == null ? void 0 : R.description) && /* @__PURE__ */ e("div", { className: "border-b border-[var(--border)] px-4 py-2 text-xs text-[var(--text-muted)]", children: R.description }),
500
+ /* @__PURE__ */ i("div", { className: "min-h-[420px] p-4", children: [
501
+ !R && (c ?? /* @__PURE__ */ e("div", { className: "flex min-h-[220px] items-center justify-center rounded-lg border border-dashed border-[var(--border)] text-sm text-[var(--text-muted)]", children: "No hay modulos disponibles." })),
502
+ R && (ae == null ? void 0 : ae.loading) && ($ ?? /* @__PURE__ */ e(br, { title: "Cargando modulo..." })),
503
+ R && (ae == null ? void 0 : ae.error) && D(ae.error, De),
504
+ R && Me && !(ae != null && ae.loading) && !(ae != null && ae.error) && /* @__PURE__ */ e(
505
+ Me,
506
+ {
507
+ context: l,
508
+ parent: a,
509
+ link: R,
510
+ activeItemId: We,
511
+ onOpenDetail: Ie,
512
+ onBackToList: je
513
+ }
514
+ )
515
+ ] })
516
+ ]
517
+ }
518
+ )
519
+ ]
520
+ }
521
+ );
522
+ }
523
+ const Bt = [
90
524
  "Enero",
91
525
  "Febrero",
92
526
  "Marzo",
@@ -99,7 +533,7 @@ const pt = [
99
533
  "Octubre",
100
534
  "Noviembre",
101
535
  "Diciembre"
102
- ], lr = [
536
+ ], Nr = [
103
537
  "Ene",
104
538
  "Feb",
105
539
  "Mar",
@@ -112,69 +546,69 @@ const pt = [
112
546
  "Oct",
113
547
  "Nov",
114
548
  "Dic"
115
- ], cr = ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sá"], Ae = 6;
116
- function He(t, r, n) {
549
+ ], kr = ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sá"], Ke = 6;
550
+ function rt(t, r, n) {
117
551
  return `${t}-${String(r).padStart(2, "0")}-${String(n).padStart(2, "0")}`;
118
552
  }
119
- function dr() {
553
+ function Sr() {
120
554
  const t = /* @__PURE__ */ new Date();
121
- return He(t.getFullYear(), t.getMonth() + 1, t.getDate());
555
+ return rt(t.getFullYear(), t.getMonth() + 1, t.getDate());
122
556
  }
123
- function ht(t) {
557
+ function Lt(t) {
124
558
  const [r, n, a] = t.split("-").map(Number);
125
559
  return { year: r, month: n, day: a };
126
560
  }
127
- function ur(t) {
561
+ function Cr(t) {
128
562
  if (!t) return "Seleccionar fecha";
129
- const { year: r, month: n, day: a } = ht(t);
130
- return !r || !n || !a ? "Seleccionar fecha" : `${String(a).padStart(2, "0")} ${pt[n - 1]} ${r}`;
563
+ const { year: r, month: n, day: a } = Lt(t);
564
+ return !r || !n || !a ? "Seleccionar fecha" : `${String(a).padStart(2, "0")} ${Bt[n - 1]} ${r}`;
131
565
  }
132
- function en({
566
+ function vn({
133
567
  value: t,
134
568
  onChange: r,
135
569
  minDate: n,
136
570
  displayMode: a = "inline"
137
571
  }) {
138
- const l = dr(), m = ht(t || l), p = a === "popover", [c, d] = E(!1), y = J(null), [C, w] = E({
572
+ const l = Sr(), d = Lt(t || l), p = a === "popover", [m, h] = B(!1), w = ie(null), [N, g] = B({
139
573
  horizontal: "left",
140
574
  vertical: "bottom"
141
- }), [f, g] = E(m.year), [b, N] = E(m.month), [L, X] = E("days"), Y = 16, [k, M] = E(0), $ = f - 7 + k, B = Array.from({ length: Y }, (o, x) => $ + x);
142
- R(() => {
143
- if (!p || !c || !y.current) return;
144
- const o = y.current.getBoundingClientRect(), x = 8, z = 280, j = 340, P = o.left + z > window.innerWidth - x, Z = o.right - z >= x, ee = o.bottom + 8 + j > window.innerHeight - x, ae = o.top - 8 - j >= x;
145
- w({
146
- horizontal: P && Z ? "right" : "left",
147
- vertical: ee && ae ? "top" : "bottom"
575
+ }), [f, v] = B(d.year), [c, $] = B(d.month), [D, K] = B("days"), W = 16, [E, T] = B(0), I = f - 7 + E, L = Array.from({ length: W }, (o, y) => I + y);
576
+ O(() => {
577
+ if (!p || !m || !w.current) return;
578
+ const o = w.current.getBoundingClientRect(), y = 8, H = 280, q = 340, G = o.left + H > window.innerWidth - y, ee = o.right - H >= y, me = o.bottom + 8 + q > window.innerHeight - y, te = o.top - 8 - q >= y;
579
+ g({
580
+ horizontal: G && ee ? "right" : "left",
581
+ vertical: me && te ? "top" : "bottom"
148
582
  });
149
- }, [p, c]), R(() => {
150
- if (!p || !c) return;
151
- function o(z) {
152
- y.current && (y.current.contains(z.target) || d(!1));
583
+ }, [p, m]), O(() => {
584
+ if (!p || !m) return;
585
+ function o(H) {
586
+ w.current && (w.current.contains(H.target) || h(!1));
153
587
  }
154
- function x(z) {
155
- z.key === "Escape" && d(!1);
588
+ function y(H) {
589
+ H.key === "Escape" && h(!1);
156
590
  }
157
- return document.addEventListener("mousedown", o), document.addEventListener("keydown", x), () => {
158
- document.removeEventListener("mousedown", o), document.removeEventListener("keydown", x);
591
+ return document.addEventListener("mousedown", o), document.addEventListener("keydown", y), () => {
592
+ document.removeEventListener("mousedown", o), document.removeEventListener("keydown", y);
159
593
  };
160
- }, [p, c]);
161
- function W() {
162
- b === 1 ? (g((o) => o - 1), N(12)) : N((o) => o - 1);
594
+ }, [p, m]);
595
+ function F() {
596
+ c === 1 ? (v((o) => o - 1), $(12)) : $((o) => o - 1);
163
597
  }
164
- function I() {
165
- b === 12 ? (g((o) => o + 1), N(1)) : N((o) => o + 1);
598
+ function M() {
599
+ c === 12 ? (v((o) => o + 1), $(1)) : $((o) => o + 1);
166
600
  }
167
- const T = new Date(f, b - 1, 1).getDay(), A = new Date(f, b, 0).getDate(), q = [
168
- ...Array(T).fill(null),
169
- ...Array.from({ length: A }, (o, x) => x + 1)
601
+ const S = new Date(f, c - 1, 1).getDay(), P = new Date(f, c, 0).getDate(), J = [
602
+ ...Array(S).fill(null),
603
+ ...Array.from({ length: P }, (o, y) => y + 1)
170
604
  ];
171
- for (; q.length < Ae * 7; ) q.push(null);
172
- const O = q.slice(0, Ae * 7);
173
- function G(o) {
174
- const x = He(f, b, o);
175
- n && x < n || (r(x), p && d(!1));
605
+ for (; J.length < Ke * 7; ) J.push(null);
606
+ const _ = J.slice(0, Ke * 7);
607
+ function j(o) {
608
+ const y = rt(f, c, o);
609
+ n && y < n || (r(y), p && h(!1));
176
610
  }
177
- const F = {
611
+ const U = {
178
612
  background: "none",
179
613
  border: "none",
180
614
  cursor: "pointer",
@@ -183,7 +617,7 @@ function en({
183
617
  borderRadius: 6,
184
618
  display: "flex",
185
619
  alignItems: "center"
186
- }, U = /* @__PURE__ */ s(
620
+ }, Z = /* @__PURE__ */ i(
187
621
  "div",
188
622
  {
189
623
  style: {
@@ -205,23 +639,23 @@ function en({
205
639
  padding: "10px 12px",
206
640
  borderBottom: "1px solid var(--border)"
207
641
  },
208
- children: L === "days" ? /* @__PURE__ */ s(le, { children: [
642
+ children: D === "days" ? /* @__PURE__ */ i(we, { children: [
209
643
  /* @__PURE__ */ e(
210
644
  "button",
211
645
  {
212
646
  type: "button",
213
- onClick: W,
214
- style: F,
647
+ onClick: F,
648
+ style: U,
215
649
  title: "Mes anterior",
216
- children: /* @__PURE__ */ e(Se, { size: 16 })
650
+ children: /* @__PURE__ */ e(_e, { size: 16 })
217
651
  }
218
652
  ),
219
- /* @__PURE__ */ s(
653
+ /* @__PURE__ */ i(
220
654
  "button",
221
655
  {
222
656
  type: "button",
223
657
  onClick: () => {
224
- X("years"), M(0);
658
+ K("years"), T(0);
225
659
  },
226
660
  style: {
227
661
  background: "none",
@@ -237,10 +671,10 @@ function en({
237
671
  padding: "2px 6px"
238
672
  },
239
673
  children: [
240
- pt[b - 1],
674
+ Bt[c - 1],
241
675
  " ",
242
676
  f,
243
- /* @__PURE__ */ e(ge, { size: 13, style: { color: "var(--text-muted)" } })
677
+ /* @__PURE__ */ e(He, { size: 13, style: { color: "var(--text-muted)" } })
244
678
  ]
245
679
  }
246
680
  ),
@@ -248,27 +682,27 @@ function en({
248
682
  "button",
249
683
  {
250
684
  type: "button",
251
- onClick: I,
252
- style: F,
685
+ onClick: M,
686
+ style: U,
253
687
  title: "Mes siguiente",
254
- children: /* @__PURE__ */ e(xe, { size: 16 })
688
+ children: /* @__PURE__ */ e(Te, { size: 16 })
255
689
  }
256
690
  )
257
- ] }) : /* @__PURE__ */ s(le, { children: [
691
+ ] }) : /* @__PURE__ */ i(we, { children: [
258
692
  /* @__PURE__ */ e(
259
693
  "button",
260
694
  {
261
695
  type: "button",
262
- onClick: () => M((o) => o - Y),
263
- style: F,
264
- children: /* @__PURE__ */ e(Se, { size: 16 })
696
+ onClick: () => T((o) => o - W),
697
+ style: U,
698
+ children: /* @__PURE__ */ e(_e, { size: 16 })
265
699
  }
266
700
  ),
267
- /* @__PURE__ */ s(
701
+ /* @__PURE__ */ i(
268
702
  "button",
269
703
  {
270
704
  type: "button",
271
- onClick: () => X("days"),
705
+ onClick: () => K("days"),
272
706
  style: {
273
707
  background: "none",
274
708
  border: "none",
@@ -280,9 +714,9 @@ function en({
280
714
  padding: "2px 6px"
281
715
  },
282
716
  children: [
283
- B[0],
717
+ L[0],
284
718
  " – ",
285
- B[B.length - 1]
719
+ L[L.length - 1]
286
720
  ]
287
721
  }
288
722
  ),
@@ -290,15 +724,15 @@ function en({
290
724
  "button",
291
725
  {
292
726
  type: "button",
293
- onClick: () => M((o) => o + Y),
294
- style: F,
295
- children: /* @__PURE__ */ e(xe, { size: 16 })
727
+ onClick: () => T((o) => o + W),
728
+ style: U,
729
+ children: /* @__PURE__ */ e(Te, { size: 16 })
296
730
  }
297
731
  )
298
732
  ] })
299
733
  }
300
734
  ),
301
- L === "years" && /* @__PURE__ */ s("div", { style: { padding: "8px 10px 10px" }, children: [
735
+ D === "years" && /* @__PURE__ */ i("div", { style: { padding: "8px 10px 10px" }, children: [
302
736
  /* @__PURE__ */ e(
303
737
  "div",
304
738
  {
@@ -308,22 +742,22 @@ function en({
308
742
  gap: 3,
309
743
  marginBottom: 8
310
744
  },
311
- children: lr.map((o, x) => {
312
- const z = x + 1 === b;
745
+ children: Nr.map((o, y) => {
746
+ const H = y + 1 === c;
313
747
  return /* @__PURE__ */ e(
314
748
  "button",
315
749
  {
316
750
  type: "button",
317
- onClick: () => N(x + 1),
751
+ onClick: () => $(y + 1),
318
752
  style: {
319
753
  border: "none",
320
754
  cursor: "pointer",
321
755
  borderRadius: 6,
322
756
  fontSize: 11,
323
- fontWeight: z ? 700 : 400,
757
+ fontWeight: H ? 700 : 400,
324
758
  padding: "4px 0",
325
- background: z ? "var(--primary)" : "transparent",
326
- color: z ? "var(--primary-fg, #ffffff)" : "var(--text-secondary)"
759
+ background: H ? "var(--primary)" : "transparent",
760
+ color: H ? "var(--primary-fg, #ffffff)" : "var(--text-secondary)"
327
761
  },
328
762
  children: o
329
763
  },
@@ -346,25 +780,25 @@ function en({
346
780
  gridTemplateColumns: "repeat(4,1fr)",
347
781
  gap: 3
348
782
  },
349
- children: B.map((o) => {
350
- const x = o === f;
783
+ children: L.map((o) => {
784
+ const y = o === f;
351
785
  return /* @__PURE__ */ e(
352
786
  "button",
353
787
  {
354
788
  type: "button",
355
789
  onClick: () => {
356
- g(o), X("days");
790
+ v(o), K("days");
357
791
  },
358
792
  style: {
359
793
  border: "none",
360
794
  cursor: "pointer",
361
795
  borderRadius: 6,
362
796
  fontSize: 12,
363
- fontWeight: x ? 700 : 400,
797
+ fontWeight: y ? 700 : 400,
364
798
  padding: "6px 0",
365
- background: x ? "var(--primary)" : "transparent",
366
- color: x ? "var(--primary-fg, #ffffff)" : "var(--text-main)",
367
- outline: o === (/* @__PURE__ */ new Date()).getFullYear() && !x ? "2px solid var(--primary)" : "none",
799
+ background: y ? "var(--primary)" : "transparent",
800
+ color: y ? "var(--primary-fg, #ffffff)" : "var(--text-main)",
801
+ outline: o === (/* @__PURE__ */ new Date()).getFullYear() && !y ? "2px solid var(--primary)" : "none",
368
802
  outlineOffset: "-2px"
369
803
  },
370
804
  children: o
@@ -375,7 +809,7 @@ function en({
375
809
  }
376
810
  )
377
811
  ] }),
378
- L === "days" && /* @__PURE__ */ s(le, { children: [
812
+ D === "days" && /* @__PURE__ */ i(we, { children: [
379
813
  /* @__PURE__ */ e(
380
814
  "div",
381
815
  {
@@ -384,7 +818,7 @@ function en({
384
818
  gridTemplateColumns: "repeat(7,1fr)",
385
819
  padding: "6px 8px 0"
386
820
  },
387
- children: cr.map((o) => /* @__PURE__ */ e(
821
+ children: kr.map((o) => /* @__PURE__ */ e(
388
822
  "div",
389
823
  {
390
824
  style: {
@@ -407,36 +841,36 @@ function en({
407
841
  style: {
408
842
  display: "grid",
409
843
  gridTemplateColumns: "repeat(7,1fr)",
410
- gridTemplateRows: `repeat(${Ae},1fr)`,
844
+ gridTemplateRows: `repeat(${Ke},1fr)`,
411
845
  padding: "4px 8px 10px",
412
846
  gap: 2
413
847
  },
414
- children: O.map((o, x) => {
848
+ children: _.map((o, y) => {
415
849
  if (o === null)
416
- return /* @__PURE__ */ e("div", { style: { aspectRatio: "1" } }, x);
417
- const z = He(f, b, o), j = z === t, P = z === l, Z = !!(n && z < n);
850
+ return /* @__PURE__ */ e("div", { style: { aspectRatio: "1" } }, y);
851
+ const H = rt(f, c, o), q = H === t, G = H === l, ee = !!(n && H < n);
418
852
  return /* @__PURE__ */ e(
419
853
  "button",
420
854
  {
421
855
  type: "button",
422
- onClick: () => !Z && G(o),
856
+ onClick: () => !ee && j(o),
423
857
  style: {
424
858
  width: "100%",
425
859
  aspectRatio: "1",
426
860
  borderRadius: 6,
427
861
  border: "none",
428
- cursor: Z ? "not-allowed" : "pointer",
862
+ cursor: ee ? "not-allowed" : "pointer",
429
863
  fontSize: 12,
430
- fontWeight: j || P ? 700 : 400,
431
- background: j ? "var(--primary)" : "transparent",
432
- color: j ? "var(--primary-fg, #ffffff)" : Z ? "var(--text-muted)" : "var(--text-main)",
433
- opacity: Z ? 0.4 : 1,
434
- outline: P && !j ? "2px solid var(--primary)" : "none",
864
+ fontWeight: q || G ? 700 : 400,
865
+ background: q ? "var(--primary)" : "transparent",
866
+ color: q ? "var(--primary-fg, #ffffff)" : ee ? "var(--text-muted)" : "var(--text-main)",
867
+ opacity: ee ? 0.4 : 1,
868
+ outline: G && !q ? "2px solid var(--primary)" : "none",
435
869
  outlineOffset: "-2px"
436
870
  },
437
871
  children: o
438
872
  },
439
- x
873
+ y
440
874
  );
441
875
  })
442
876
  }
@@ -445,137 +879,137 @@ function en({
445
879
  ]
446
880
  }
447
881
  );
448
- return p ? /* @__PURE__ */ s("div", { ref: y, className: "relative w-full", children: [
449
- /* @__PURE__ */ s(
882
+ return p ? /* @__PURE__ */ i("div", { ref: w, className: "relative w-full", children: [
883
+ /* @__PURE__ */ i(
450
884
  "button",
451
885
  {
452
886
  type: "button",
453
- onClick: () => d((o) => !o),
887
+ onClick: () => h((o) => !o),
454
888
  className: "flex h-11 w-full items-center justify-between gap-2 rounded-lg px-3 py-0 text-sm transition-all duration-150 focus:outline-none",
455
889
  style: {
456
890
  background: "var(--bg-input)",
457
- border: `1px solid ${c ? "var(--primary)" : "var(--border)"}`,
891
+ border: `1px solid ${m ? "var(--primary)" : "var(--border)"}`,
458
892
  color: "var(--text-main)",
459
- boxShadow: c ? "0 0 0 3px rgba(59,130,246,0.12)" : "none"
893
+ boxShadow: m ? "0 0 0 3px rgba(59,130,246,0.12)" : "none"
460
894
  },
461
895
  children: [
462
- /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-2 min-w-0", children: [
463
- /* @__PURE__ */ e(Ie, { className: "w-4 h-4 text-[var(--text-muted)]" }),
464
- /* @__PURE__ */ e("span", { className: "truncate", children: ur(t) })
896
+ /* @__PURE__ */ i("span", { className: "inline-flex items-center gap-2 min-w-0", children: [
897
+ /* @__PURE__ */ e(tt, { className: "w-4 h-4 text-[var(--text-muted)]" }),
898
+ /* @__PURE__ */ e("span", { className: "truncate", children: Cr(t) })
465
899
  ] }),
466
900
  /* @__PURE__ */ e(
467
- ge,
901
+ He,
468
902
  {
469
- className: `w-4 h-4 text-[var(--text-muted)] transition-transform ${c ? "rotate-180" : ""}`
903
+ className: `w-4 h-4 text-[var(--text-muted)] transition-transform ${m ? "rotate-180" : ""}`
470
904
  }
471
905
  )
472
906
  ]
473
907
  }
474
908
  ),
475
- c && /* @__PURE__ */ e(
909
+ m && /* @__PURE__ */ e(
476
910
  "div",
477
911
  {
478
912
  className: "absolute z-50",
479
913
  style: {
480
- ...C.horizontal === "left" ? { left: 0 } : { right: 0 },
481
- ...C.vertical === "bottom" ? { top: "calc(100% + 8px)" } : { bottom: "calc(100% + 8px)" }
914
+ ...N.horizontal === "left" ? { left: 0 } : { right: 0 },
915
+ ...N.vertical === "bottom" ? { top: "calc(100% + 8px)" } : { bottom: "calc(100% + 8px)" }
482
916
  },
483
- children: U
917
+ children: Z
484
918
  }
485
919
  )
486
- ] }) : U;
920
+ ] }) : Z;
487
921
  }
488
- function nt(t) {
922
+ function xt(t) {
489
923
  if (t !== void 0)
490
924
  return typeof t == "number" ? `${t}px` : t;
491
925
  }
492
- function ft({
926
+ function Tt({
493
927
  value: t,
494
928
  onChange: r,
495
929
  options: n,
496
930
  placeholder: a = "Seleccionar…",
497
931
  emptyLabel: l,
498
932
  disabled: u = !1,
499
- className: m = "",
933
+ className: d = "",
500
934
  style: p,
501
- height: c = 44,
502
- padding: d = "0 12px",
503
- searchable: y = !0,
504
- minOptionsForSearch: C = 6
935
+ height: m = 44,
936
+ padding: h = "0 12px",
937
+ searchable: w = !0,
938
+ minOptionsForSearch: N = 6
505
939
  }) {
506
- const [w, f] = E(!1), [g, b] = E(""), [N, L] = E(-1), [X, Y] = E(!1), [k, M] = E({}), $ = J(null), B = J(null), W = J(null), I = J(null), T = y && n.length >= C, A = n.find((o) => o.value === t) ?? null, q = T && g.trim() ? n.filter(
940
+ const [g, f] = B(!1), [v, c] = B(""), [$, D] = B(-1), [K, W] = B(!1), [E, T] = B({}), I = ie(null), L = ie(null), F = ie(null), M = ie(null), S = w && n.length >= N, P = n.find((o) => o.value === t) ?? null, J = S && v.trim() ? n.filter(
507
941
  (o) => {
508
- var x;
509
- return o.label.toLowerCase().includes(g.toLowerCase()) || ((x = o.sublabel) == null ? void 0 : x.toLowerCase().includes(g.toLowerCase()));
942
+ var y;
943
+ return o.label.toLowerCase().includes(v.toLowerCase()) || ((y = o.sublabel) == null ? void 0 : y.toLowerCase().includes(v.toLowerCase()));
510
944
  }
511
- ) : n, O = Ve(() => {
512
- const o = $.current;
945
+ ) : n, _ = et(() => {
946
+ const o = I.current;
513
947
  if (!o) return;
514
- const x = o.getBoundingClientRect(), z = T ? 272 : 212, j = window.innerHeight - x.bottom, P = j < z && x.top > j;
515
- M({
948
+ const y = o.getBoundingClientRect(), H = S ? 272 : 212, q = window.innerHeight - y.bottom, G = q < H && y.top > q;
949
+ T({
516
950
  position: "fixed",
517
- left: x.left,
518
- top: P ? void 0 : x.bottom + 4,
519
- bottom: P ? window.innerHeight - x.top + 4 : void 0,
520
- width: x.width,
951
+ left: y.left,
952
+ top: G ? void 0 : y.bottom + 4,
953
+ bottom: G ? window.innerHeight - y.top + 4 : void 0,
954
+ width: y.width,
521
955
  zIndex: 9999
522
956
  });
523
- }, [T]);
524
- R(() => Y(!0), []), R(() => {
525
- if (!w) return;
526
- function o(x) {
527
- var j, P;
528
- const z = x.target;
529
- !((j = $.current) != null && j.contains(z)) && !((P = B.current) != null && P.contains(z)) && (f(!1), b(""));
957
+ }, [S]);
958
+ O(() => W(!0), []), O(() => {
959
+ if (!g) return;
960
+ function o(y) {
961
+ var q, G;
962
+ const H = y.target;
963
+ !((q = I.current) != null && q.contains(H)) && !((G = L.current) != null && G.contains(H)) && (f(!1), c(""));
530
964
  }
531
965
  return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
532
- }, [w]), R(() => {
533
- w && (L(-1), O(), T && setTimeout(() => {
966
+ }, [g]), O(() => {
967
+ g && (D(-1), _(), S && setTimeout(() => {
534
968
  var o;
535
- return (o = W.current) == null ? void 0 : o.focus();
969
+ return (o = F.current) == null ? void 0 : o.focus();
536
970
  }, 0));
537
- }, [w, T, O]), R(() => {
538
- if (w)
539
- return window.addEventListener("resize", O), window.addEventListener("scroll", O, !0), () => {
540
- window.removeEventListener("resize", O), window.removeEventListener("scroll", O, !0);
971
+ }, [g, S, _]), O(() => {
972
+ if (g)
973
+ return window.addEventListener("resize", _), window.addEventListener("scroll", _, !0), () => {
974
+ window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
541
975
  };
542
- }, [w, O]), R(() => {
543
- if (N < 0 || !I.current) return;
544
- const o = I.current.children[N];
976
+ }, [g, _]), O(() => {
977
+ if ($ < 0 || !M.current) return;
978
+ const o = M.current.children[$];
545
979
  o == null || o.scrollIntoView({ block: "nearest" });
546
- }, [N]);
547
- const G = Ve(
980
+ }, [$]);
981
+ const j = et(
548
982
  (o) => {
549
- r(o), f(!1), b("");
983
+ r(o), f(!1), c("");
550
984
  },
551
985
  [r]
552
986
  );
553
- function F(o) {
554
- if (!w) {
987
+ function U(o) {
988
+ if (!g) {
555
989
  (o.key === "Enter" || o.key === " " || o.key === "ArrowDown") && (o.preventDefault(), f(!0));
556
990
  return;
557
991
  }
558
- o.key === "Escape" ? (o.preventDefault(), f(!1), b("")) : o.key === "ArrowDown" ? (o.preventDefault(), L((x) => Math.min(x + 1, q.length - 1))) : o.key === "ArrowUp" ? (o.preventDefault(), L((x) => Math.max(x - 1, l ? -1 : 0))) : o.key === "Enter" && (o.preventDefault(), N === -1 && l ? G("") : q[N] && G(q[N].value));
992
+ o.key === "Escape" ? (o.preventDefault(), f(!1), c("")) : o.key === "ArrowDown" ? (o.preventDefault(), D((y) => Math.min(y + 1, J.length - 1))) : o.key === "ArrowUp" ? (o.preventDefault(), D((y) => Math.max(y - 1, l ? -1 : 0))) : o.key === "Enter" && (o.preventDefault(), $ === -1 && l ? j("") : J[$] && j(J[$].value));
559
993
  }
560
- const U = /* @__PURE__ */ s(
994
+ const Z = /* @__PURE__ */ i(
561
995
  "div",
562
996
  {
563
- ref: B,
997
+ ref: L,
564
998
  className: "rounded-xl shadow-xl overflow-hidden",
565
999
  style: {
566
- ...k,
1000
+ ...E,
567
1001
  background: "var(--bg-card)",
568
1002
  border: "1px solid var(--border)"
569
1003
  },
570
1004
  children: [
571
- T && /* @__PURE__ */ s(
1005
+ S && /* @__PURE__ */ i(
572
1006
  "div",
573
1007
  {
574
1008
  className: "flex items-center gap-2 px-3 py-2",
575
1009
  style: { borderBottom: "1px solid var(--border)" },
576
1010
  children: [
577
1011
  /* @__PURE__ */ e(
578
- We,
1012
+ Ye,
579
1013
  {
580
1014
  className: "w-3.5 h-3.5 flex-shrink-0",
581
1015
  style: { color: "var(--text-muted)" }
@@ -584,25 +1018,25 @@ function ft({
584
1018
  /* @__PURE__ */ e(
585
1019
  "input",
586
1020
  {
587
- ref: W,
588
- value: g,
1021
+ ref: F,
1022
+ value: v,
589
1023
  onChange: (o) => {
590
- b(o.target.value), L(-1);
1024
+ c(o.target.value), D(-1);
591
1025
  },
592
1026
  placeholder: "Buscar…",
593
1027
  className: "min-w-0 flex-1 text-sm bg-transparent outline-none",
594
1028
  style: { color: "var(--text-main)" }
595
1029
  }
596
1030
  ),
597
- g && /* @__PURE__ */ e(
1031
+ v && /* @__PURE__ */ e(
598
1032
  "button",
599
1033
  {
600
1034
  type: "button",
601
1035
  onMouseDown: (o) => {
602
- o.preventDefault(), b("");
1036
+ o.preventDefault(), c("");
603
1037
  },
604
1038
  children: /* @__PURE__ */ e(
605
- ce,
1039
+ Se,
606
1040
  {
607
1041
  className: "w-3.5 h-3.5",
608
1042
  style: { color: "var(--text-muted)" }
@@ -613,14 +1047,14 @@ function ft({
613
1047
  ]
614
1048
  }
615
1049
  ),
616
- /* @__PURE__ */ s(
1050
+ /* @__PURE__ */ i(
617
1051
  "ul",
618
1052
  {
619
- ref: I,
1053
+ ref: M,
620
1054
  role: "listbox",
621
1055
  className: "overflow-y-auto",
622
1056
  style: {
623
- maxHeight: T ? 220 : 180,
1057
+ maxHeight: S ? 220 : 180,
624
1058
  scrollbarWidth: "thin",
625
1059
  scrollbarColor: "var(--border) transparent",
626
1060
  overscrollBehavior: "contain"
@@ -632,35 +1066,35 @@ function ft({
632
1066
  role: "option",
633
1067
  "aria-selected": t === "",
634
1068
  onMouseDown: (o) => {
635
- o.preventDefault(), G("");
1069
+ o.preventDefault(), j("");
636
1070
  },
637
- onMouseEnter: () => L(-1),
1071
+ onMouseEnter: () => D(-1),
638
1072
  className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",
639
1073
  style: {
640
- background: N === -1 ? "var(--bg-hover)" : "transparent",
1074
+ background: $ === -1 ? "var(--bg-hover)" : "transparent",
641
1075
  color: "var(--text-muted)",
642
1076
  fontStyle: "italic"
643
1077
  },
644
1078
  children: l
645
1079
  }
646
1080
  ),
647
- q.map((o, x) => {
648
- const j = x === N, P = o.value === t;
649
- return /* @__PURE__ */ s(
1081
+ J.map((o, y) => {
1082
+ const q = y === $, G = o.value === t;
1083
+ return /* @__PURE__ */ i(
650
1084
  "li",
651
1085
  {
652
1086
  role: "option",
653
- "aria-selected": P,
654
- onMouseDown: (Z) => {
655
- Z.preventDefault(), o.disabled || G(o.value);
1087
+ "aria-selected": G,
1088
+ onMouseDown: (ee) => {
1089
+ ee.preventDefault(), o.disabled || j(o.value);
656
1090
  },
657
- onMouseEnter: () => !o.disabled && L(x),
1091
+ onMouseEnter: () => !o.disabled && D(y),
658
1092
  className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",
659
1093
  style: {
660
- background: j ? "var(--bg-hover)" : P ? "color-mix(in srgb, var(--primary) 6%, transparent)" : "transparent",
1094
+ background: q ? "var(--bg-hover)" : G ? "color-mix(in srgb, var(--primary) 6%, transparent)" : "transparent",
661
1095
  color: o.disabled ? "var(--text-muted)" : "var(--text-main)",
662
1096
  cursor: o.disabled ? "not-allowed" : "pointer",
663
- boxShadow: P ? "inset 2px 0 0 var(--primary)" : void 0
1097
+ boxShadow: G ? "inset 2px 0 0 var(--primary)" : void 0
664
1098
  },
665
1099
  children: [
666
1100
  o.color && /* @__PURE__ */ e(
@@ -670,7 +1104,7 @@ function ft({
670
1104
  style: { background: o.color }
671
1105
  }
672
1106
  ),
673
- /* @__PURE__ */ s("span", { className: "min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden", children: [
1107
+ /* @__PURE__ */ i("span", { className: "min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden", children: [
674
1108
  /* @__PURE__ */ e("span", { className: "truncate", children: o.label }),
675
1109
  o.sublabel && /* @__PURE__ */ e(
676
1110
  "span",
@@ -694,7 +1128,7 @@ function ft({
694
1128
  o.value
695
1129
  );
696
1130
  }),
697
- q.length === 0 && /* @__PURE__ */ e(
1131
+ J.length === 0 && /* @__PURE__ */ e(
698
1132
  "li",
699
1133
  {
700
1134
  className: "px-3 py-4 text-sm text-center",
@@ -708,15 +1142,15 @@ function ft({
708
1142
  ]
709
1143
  }
710
1144
  );
711
- return /* @__PURE__ */ s(
1145
+ return /* @__PURE__ */ i(
712
1146
  "div",
713
1147
  {
714
- ref: $,
715
- className: `relative ${m || "w-full"}`,
1148
+ ref: I,
1149
+ className: `relative ${d || "w-full"}`,
716
1150
  style: p,
717
- onKeyDown: F,
1151
+ onKeyDown: U,
718
1152
  children: [
719
- /* @__PURE__ */ s(
1153
+ /* @__PURE__ */ i(
720
1154
  "button",
721
1155
  {
722
1156
  type: "button",
@@ -724,84 +1158,84 @@ function ft({
724
1158
  onClick: () => !u && f((o) => !o),
725
1159
  className: "flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",
726
1160
  style: {
727
- height: nt(c),
728
- padding: nt(d),
1161
+ height: xt(m),
1162
+ padding: xt(h),
729
1163
  background: "var(--bg-input)",
730
- color: A ? "var(--text-main)" : "var(--text-muted)",
731
- border: w ? "1px solid var(--primary)" : "1px solid var(--border)",
1164
+ color: P ? "var(--text-main)" : "var(--text-muted)",
1165
+ border: g ? "1px solid var(--primary)" : "1px solid var(--border)",
732
1166
  opacity: u ? 0.5 : 1,
733
1167
  cursor: u ? "not-allowed" : "pointer"
734
1168
  },
735
1169
  "aria-haspopup": "listbox",
736
- "aria-expanded": w,
1170
+ "aria-expanded": g,
737
1171
  children: [
738
- (A == null ? void 0 : A.color) && /* @__PURE__ */ e(
1172
+ (P == null ? void 0 : P.color) && /* @__PURE__ */ e(
739
1173
  "span",
740
1174
  {
741
1175
  className: "flex-shrink-0 w-2.5 h-2.5 rounded-full",
742
- style: { background: A.color }
1176
+ style: { background: P.color }
743
1177
  }
744
1178
  ),
745
- /* @__PURE__ */ e("span", { className: "min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden", children: A ? /* @__PURE__ */ s(le, { children: [
746
- /* @__PURE__ */ e("span", { className: "truncate", children: A.label }),
747
- A.sublabel && /* @__PURE__ */ e(
1179
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden", children: P ? /* @__PURE__ */ i(we, { children: [
1180
+ /* @__PURE__ */ e("span", { className: "truncate", children: P.label }),
1181
+ P.sublabel && /* @__PURE__ */ e(
748
1182
  "span",
749
1183
  {
750
1184
  className: "min-w-0 flex-shrink truncate",
751
1185
  style: { color: "var(--text-muted)", fontSize: 12 },
752
- children: A.sublabel
1186
+ children: P.sublabel
753
1187
  }
754
1188
  )
755
1189
  ] }) : /* @__PURE__ */ e("span", { className: "truncate", children: a }) }),
756
- A && l ? /* @__PURE__ */ e(
1190
+ P && l ? /* @__PURE__ */ e(
757
1191
  "span",
758
1192
  {
759
1193
  role: "button",
760
1194
  tabIndex: -1,
761
1195
  onMouseDown: (o) => {
762
- o.preventDefault(), o.stopPropagation(), G("");
1196
+ o.preventDefault(), o.stopPropagation(), j("");
763
1197
  },
764
1198
  className: "flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",
765
1199
  style: { color: "var(--text-muted)" },
766
- children: /* @__PURE__ */ e(ce, { className: "w-3 h-3" })
1200
+ children: /* @__PURE__ */ e(Se, { className: "w-3 h-3" })
767
1201
  }
768
1202
  ) : /* @__PURE__ */ e(
769
- ge,
1203
+ He,
770
1204
  {
771
1205
  className: "flex-shrink-0 w-4 h-4 transition-transform",
772
1206
  style: {
773
1207
  color: "var(--text-muted)",
774
- transform: w ? "rotate(180deg)" : "rotate(0deg)"
1208
+ transform: g ? "rotate(180deg)" : "rotate(0deg)"
775
1209
  }
776
1210
  }
777
1211
  )
778
1212
  ]
779
1213
  }
780
1214
  ),
781
- w && X && Ee(U, document.body)
1215
+ g && K && Ge(Z, document.body)
782
1216
  ]
783
1217
  }
784
1218
  );
785
1219
  }
786
- function ke(t) {
1220
+ function Ue(t) {
787
1221
  if (t !== void 0)
788
1222
  return typeof t == "number" ? `${t}px` : t;
789
1223
  }
790
- function tn({
1224
+ function gn({
791
1225
  value: t,
792
1226
  onChange: r,
793
1227
  placeholder: n = "Buscar...",
794
1228
  className: a = "",
795
1229
  height: l = 44,
796
1230
  padding: u = "0 12px 0 34px",
797
- iconLeft: m = 12
1231
+ iconLeft: d = 12
798
1232
  }) {
799
- return /* @__PURE__ */ s("div", { className: `relative ${a}`, children: [
1233
+ return /* @__PURE__ */ i("div", { className: `relative ${a}`, children: [
800
1234
  /* @__PURE__ */ e(
801
- We,
1235
+ Ye,
802
1236
  {
803
1237
  className: "absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)] pointer-events-none",
804
- style: { left: ke(m) }
1238
+ style: { left: Ue(d) }
805
1239
  }
806
1240
  ),
807
1241
  /* @__PURE__ */ e(
@@ -812,52 +1246,52 @@ function tn({
812
1246
  onChange: (p) => r(p.target.value),
813
1247
  placeholder: n,
814
1248
  className: "w-full rounded-lg border border-[var(--border)] [background:var(--bg-card)] text-sm text-[var(--text-main)] placeholder:text-[var(--text-muted)] outline-none transition-[border-color,box-shadow] focus:border-primary focus:ring-2 focus:ring-primary/20",
815
- style: { height: ke(l), padding: ke(u) }
1249
+ style: { height: Ue(l), padding: Ue(u) }
816
1250
  }
817
1251
  )
818
1252
  ] });
819
1253
  }
820
- function rn({
1254
+ function yn({
821
1255
  value: t,
822
1256
  onChange: r,
823
1257
  options: n,
824
1258
  placeholder: a,
825
1259
  icon: l,
826
1260
  className: u = "",
827
- height: m = 44,
1261
+ height: d = 44,
828
1262
  padding: p,
829
- iconLeft: c = 12,
830
- searchable: d = !0
1263
+ iconLeft: m = 12,
1264
+ searchable: h = !0
831
1265
  }) {
832
- const y = l ? n.map(
833
- (C, w) => w === 0 && !C.color ? { ...C, sublabel: C.sublabel ?? void 0 } : C
1266
+ const w = l ? n.map(
1267
+ (N, g) => g === 0 && !N.color ? { ...N, sublabel: N.sublabel ?? void 0 } : N
834
1268
  ) : n;
835
- return /* @__PURE__ */ s("div", { className: `relative ${u}`, children: [
1269
+ return /* @__PURE__ */ i("div", { className: `relative ${u}`, children: [
836
1270
  l && /* @__PURE__ */ e(
837
1271
  "span",
838
1272
  {
839
1273
  className: "pointer-events-none absolute top-1/2 z-10 -translate-y-1/2 text-[var(--text-muted)]",
840
- style: { left: ke(c) },
1274
+ style: { left: Ue(m) },
841
1275
  children: l
842
1276
  }
843
1277
  ),
844
1278
  /* @__PURE__ */ e(
845
- ft,
1279
+ Tt,
846
1280
  {
847
1281
  value: t,
848
1282
  onChange: r,
849
- options: y,
1283
+ options: w,
850
1284
  placeholder: a,
851
- searchable: d,
1285
+ searchable: h,
852
1286
  minOptionsForSearch: 5,
853
- height: m,
1287
+ height: d,
854
1288
  padding: p ?? (l ? "0 12px 0 34px" : "0 12px"),
855
1289
  className: "[&>button]:text-sm [&>button]:[background:var(--bg-card)]"
856
1290
  }
857
1291
  )
858
1292
  ] });
859
1293
  }
860
- const mr = {
1294
+ const $r = {
861
1295
  sm: "24rem",
862
1296
  md: "28rem",
863
1297
  lg: "32rem",
@@ -865,93 +1299,93 @@ const mr = {
865
1299
  "2xl": "48rem",
866
1300
  "4xl": "56rem",
867
1301
  "5xl": "64rem"
868
- }, Ne = 180;
869
- function pr({
1302
+ }, Fe = 180;
1303
+ function Er({
870
1304
  open: t,
871
1305
  onClose: r,
872
1306
  title: n,
873
1307
  subtitle: a,
874
1308
  leadingIcon: l,
875
1309
  headerActions: u,
876
- footer: m,
1310
+ footer: d,
877
1311
  children: p,
878
- size: c = "md",
879
- maxWidth: d,
880
- zIndex: y = 1e3,
881
- closeOnBackdrop: C = !0,
882
- closeOnEscape: w = !0,
1312
+ size: m = "md",
1313
+ maxWidth: h,
1314
+ zIndex: w = 1e3,
1315
+ closeOnBackdrop: N = !0,
1316
+ closeOnEscape: g = !0,
883
1317
  showCloseButton: f = !0,
884
- placement: g = "center",
885
- bodyClassName: b = "px-6 py-5",
886
- panelClassName: N = "",
887
- backdropClassName: L = "bg-black/50 backdrop-blur-sm",
888
- contentClassName: X = "p-4",
889
- ariaLabel: Y,
890
- frameless: k = !1
1318
+ placement: v = "center",
1319
+ bodyClassName: c = "px-6 py-5",
1320
+ panelClassName: $ = "",
1321
+ backdropClassName: D = "bg-black/50 backdrop-blur-sm",
1322
+ contentClassName: K = "p-4",
1323
+ ariaLabel: W,
1324
+ frameless: E = !1
891
1325
  }) {
892
- const [M, $] = E(!1), [B, W] = E(!1), I = J(null);
893
- if (R(() => (t ? (I.current && clearTimeout(I.current), $(!0), requestAnimationFrame(() => requestAnimationFrame(() => W(!0)))) : (W(!1), I.current = setTimeout(
894
- () => $(!1),
895
- Ne + 40
1326
+ const [T, I] = B(!1), [L, F] = B(!1), M = ie(null);
1327
+ if (O(() => (t ? (M.current && clearTimeout(M.current), I(!0), requestAnimationFrame(() => requestAnimationFrame(() => F(!0)))) : (F(!1), M.current = setTimeout(
1328
+ () => I(!1),
1329
+ Fe + 40
896
1330
  )), () => {
897
- I.current && clearTimeout(I.current);
898
- }), [t]), R(() => {
1331
+ M.current && clearTimeout(M.current);
1332
+ }), [t]), O(() => {
899
1333
  if (t)
900
1334
  return document.body.style.overflow = "hidden", () => {
901
1335
  document.body.style.overflow = "";
902
1336
  };
903
- }, [t]), R(() => {
904
- if (!t || !w) return;
905
- const F = (U) => {
906
- U.key === "Escape" && r();
1337
+ }, [t]), O(() => {
1338
+ if (!t || !g) return;
1339
+ const U = (Z) => {
1340
+ Z.key === "Escape" && r();
907
1341
  };
908
- return window.addEventListener("keydown", F), () => window.removeEventListener("keydown", F);
909
- }, [w, r, t]), !M) return null;
910
- const T = n || a || l || u || f, A = d ?? mr[c], q = g === "bottom-mobile" ? "items-end sm:items-center justify-center p-0 sm:p-4" : "items-center justify-center", O = g === "bottom-mobile" ? "rounded-t-2xl sm:rounded-2xl" : "rounded-2xl", G = B ? "translateY(0) scale(1)" : g === "bottom-mobile" ? "translateY(16px) scale(0.98)" : "translateY(10px) scale(0.96)";
911
- return Ee(
912
- /* @__PURE__ */ s(
1342
+ return window.addEventListener("keydown", U), () => window.removeEventListener("keydown", U);
1343
+ }, [g, r, t]), !T) return null;
1344
+ const S = n || a || l || u || f, P = h ?? $r[m], J = v === "bottom-mobile" ? "items-end sm:items-center justify-center p-0 sm:p-4" : "items-center justify-center", _ = v === "bottom-mobile" ? "rounded-t-2xl sm:rounded-2xl" : "rounded-2xl", j = L ? "translateY(0) scale(1)" : v === "bottom-mobile" ? "translateY(16px) scale(0.98)" : "translateY(10px) scale(0.96)";
1345
+ return Ge(
1346
+ /* @__PURE__ */ i(
913
1347
  "div",
914
1348
  {
915
1349
  role: "dialog",
916
1350
  "aria-modal": "true",
917
- "aria-label": Y ?? n,
918
- className: `fixed inset-0 flex ${q} ${X}`,
919
- style: { zIndex: y },
1351
+ "aria-label": W ?? n,
1352
+ className: `fixed inset-0 flex ${J} ${K}`,
1353
+ style: { zIndex: w },
920
1354
  children: [
921
1355
  /* @__PURE__ */ e(
922
1356
  "div",
923
1357
  {
924
- className: `absolute inset-0 ${L}`,
925
- onClick: C ? r : void 0,
1358
+ className: `absolute inset-0 ${D}`,
1359
+ onClick: N ? r : void 0,
926
1360
  style: {
927
- opacity: B ? 1 : 0,
928
- transition: `opacity ${Ne}ms ease`
1361
+ opacity: L ? 1 : 0,
1362
+ transition: `opacity ${Fe}ms ease`
929
1363
  }
930
1364
  }
931
1365
  ),
932
- /* @__PURE__ */ s(
1366
+ /* @__PURE__ */ i(
933
1367
  "div",
934
1368
  {
935
- className: `relative z-10 flex max-h-[92dvh] w-full flex-col overflow-hidden ${k ? "shadow-none" : "shadow-2xl"} ${O} ${N}`,
1369
+ className: `relative z-10 flex max-h-[92dvh] w-full flex-col overflow-hidden ${E ? "shadow-none" : "shadow-2xl"} ${_} ${$}`,
936
1370
  style: {
937
- maxWidth: A,
938
- background: k ? "transparent" : "var(--bg-card)",
939
- border: k ? "none" : "1px solid var(--border)",
940
- opacity: B ? 1 : 0,
941
- transform: G,
942
- transition: `opacity ${Ne}ms ease, transform ${Ne}ms ease`
1371
+ maxWidth: P,
1372
+ background: E ? "transparent" : "var(--bg-card)",
1373
+ border: E ? "none" : "1px solid var(--border)",
1374
+ opacity: L ? 1 : 0,
1375
+ transform: j,
1376
+ transition: `opacity ${Fe}ms ease, transform ${Fe}ms ease`
943
1377
  },
944
- onClick: (F) => F.stopPropagation(),
1378
+ onClick: (U) => U.stopPropagation(),
945
1379
  children: [
946
- T && /* @__PURE__ */ s(
1380
+ S && /* @__PURE__ */ i(
947
1381
  "div",
948
1382
  {
949
1383
  className: "flex flex-shrink-0 items-center justify-between gap-3 px-6 py-4",
950
1384
  style: { borderBottom: "1px solid var(--border)" },
951
1385
  children: [
952
- /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-3", children: [
1386
+ /* @__PURE__ */ i("div", { className: "flex min-w-0 items-center gap-3", children: [
953
1387
  l && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: l }),
954
- (n || a) && /* @__PURE__ */ s("div", { className: "min-w-0", children: [
1388
+ (n || a) && /* @__PURE__ */ i("div", { className: "min-w-0", children: [
955
1389
  n && /* @__PURE__ */ e(
956
1390
  "h2",
957
1391
  {
@@ -970,20 +1404,20 @@ function pr({
970
1404
  )
971
1405
  ] })
972
1406
  ] }),
973
- /* @__PURE__ */ s("div", { className: "flex flex-shrink-0 items-center gap-2", children: [
1407
+ /* @__PURE__ */ i("div", { className: "flex flex-shrink-0 items-center gap-2", children: [
974
1408
  u,
975
- f && /* @__PURE__ */ e(ne, { variant: "icon", onClick: r, title: "Cerrar", children: /* @__PURE__ */ e(ce, { className: "h-5 w-5" }) })
1409
+ f && /* @__PURE__ */ e(he, { variant: "icon", onClick: r, title: "Cerrar", children: /* @__PURE__ */ e(Se, { className: "h-5 w-5" }) })
976
1410
  ] })
977
1411
  ]
978
1412
  }
979
1413
  ),
980
- /* @__PURE__ */ e("div", { className: `min-h-0 flex-1 overflow-y-auto ${b}`, children: p }),
981
- m && /* @__PURE__ */ e(
1414
+ /* @__PURE__ */ e("div", { className: `min-h-0 flex-1 overflow-y-auto ${c}`, children: p }),
1415
+ d && /* @__PURE__ */ e(
982
1416
  "div",
983
1417
  {
984
1418
  className: "flex flex-shrink-0 justify-end gap-2 px-6 py-4",
985
1419
  style: { borderTop: "1px solid var(--border)" },
986
- children: m
1420
+ children: d
987
1421
  }
988
1422
  )
989
1423
  ]
@@ -995,7 +1429,7 @@ function pr({
995
1429
  document.body
996
1430
  );
997
1431
  }
998
- const hr = {
1432
+ const Mr = {
999
1433
  danger: {
1000
1434
  iconBg: "rgba(239,68,68,0.12)",
1001
1435
  iconColor: "var(--danger)",
@@ -1015,19 +1449,19 @@ const hr = {
1015
1449
  btnColor: "#fff"
1016
1450
  }
1017
1451
  };
1018
- function nn({
1452
+ function wn({
1019
1453
  open: t,
1020
1454
  title: r,
1021
1455
  description: n,
1022
1456
  confirmLabel: a = "Confirmar",
1023
1457
  cancelLabel: l = "Cancelar",
1024
1458
  variant: u = "danger",
1025
- onConfirm: m,
1459
+ onConfirm: d,
1026
1460
  onCancel: p
1027
1461
  }) {
1028
- const c = hr[u];
1029
- return /* @__PURE__ */ s(
1030
- pr,
1462
+ const m = Mr[u];
1463
+ return /* @__PURE__ */ i(
1464
+ Er,
1031
1465
  {
1032
1466
  open: t,
1033
1467
  onClose: p,
@@ -1039,14 +1473,14 @@ function nn({
1039
1473
  ariaLabel: r,
1040
1474
  children: [
1041
1475
  /* @__PURE__ */ e(
1042
- ne,
1476
+ he,
1043
1477
  {
1044
1478
  variant: "icon",
1045
1479
  onClick: p,
1046
1480
  className: "absolute right-3 top-3 h-7 w-7 hover:opacity-70",
1047
1481
  style: { color: "var(--text-muted)" },
1048
1482
  "aria-label": "Cancelar",
1049
- children: /* @__PURE__ */ e(ce, { className: "h-4 w-4" })
1483
+ children: /* @__PURE__ */ e(Se, { className: "h-4 w-4" })
1050
1484
  }
1051
1485
  ),
1052
1486
  /* @__PURE__ */ e(
@@ -1054,13 +1488,13 @@ function nn({
1054
1488
  {
1055
1489
  className: "mb-4 flex h-11 w-11 items-center justify-center rounded-xl",
1056
1490
  style: {
1057
- background: c.iconBg
1491
+ background: m.iconBg
1058
1492
  },
1059
1493
  children: /* @__PURE__ */ e(
1060
- zt,
1494
+ Pt,
1061
1495
  {
1062
1496
  className: "h-5 w-5",
1063
- style: { color: c.iconColor }
1497
+ style: { color: m.iconColor }
1064
1498
  }
1065
1499
  )
1066
1500
  }
@@ -1074,9 +1508,9 @@ function nn({
1074
1508
  }
1075
1509
  ),
1076
1510
  n && /* @__PURE__ */ e("p", { className: "text-sm", style: { color: "var(--text-muted)" }, children: n }),
1077
- /* @__PURE__ */ s("div", { className: "mt-6 flex gap-2", children: [
1511
+ /* @__PURE__ */ i("div", { className: "mt-6 flex gap-2", children: [
1078
1512
  /* @__PURE__ */ e(
1079
- ne,
1513
+ he,
1080
1514
  {
1081
1515
  variant: "secondary",
1082
1516
  onClick: p,
@@ -1086,14 +1520,14 @@ function nn({
1086
1520
  }
1087
1521
  ),
1088
1522
  /* @__PURE__ */ e(
1089
- ne,
1523
+ he,
1090
1524
  {
1091
1525
  variant: "danger",
1092
- onClick: m,
1526
+ onClick: d,
1093
1527
  className: "flex-1",
1094
1528
  style: {
1095
- background: c.btnBg,
1096
- color: c.btnColor,
1529
+ background: m.btnBg,
1530
+ color: m.btnColor,
1097
1531
  borderColor: "transparent"
1098
1532
  },
1099
1533
  children: a
@@ -1104,7 +1538,7 @@ function nn({
1104
1538
  }
1105
1539
  );
1106
1540
  }
1107
- function fr(t) {
1541
+ function Br(t) {
1108
1542
  var a;
1109
1543
  const r = Array.from(
1110
1544
  t.querySelectorAll("*")
@@ -1116,7 +1550,7 @@ function fr(t) {
1116
1550
  );
1117
1551
  return (t.scrollWidth > t.clientWidth || r.length > 0) && (((a = r[0]) == null ? void 0 : a.textContent) ?? t.textContent ?? "").trim() || null;
1118
1552
  }
1119
- function br({
1553
+ function Dt({
1120
1554
  children: t,
1121
1555
  content: r,
1122
1556
  onlyWhenOverflow: n = !1,
@@ -1124,56 +1558,56 @@ function br({
1124
1558
  style: l,
1125
1559
  as: u = "div"
1126
1560
  }) {
1127
- const m = J(null), p = J(null), [c, d] = E(null), [y, C] = E("");
1128
- R(() => {
1129
- const g = m.current;
1130
- g && (g.querySelectorAll("[title]").forEach((b) => {
1131
- const N = b.getAttribute("title");
1132
- N && (b.getAttribute("aria-label") || b.setAttribute("aria-label", N), b.removeAttribute("title"));
1133
- }), g.querySelectorAll("svg title").forEach((b) => b.remove()));
1134
- }), Dt(() => {
1135
- if (!c) return;
1136
- const g = p.current;
1137
- if (!g) return;
1138
- const b = 12, N = 14, L = g.getBoundingClientRect(), X = window.innerWidth - L.width - b, Y = window.innerHeight - L.height - b;
1139
- let k = c.mouseX + N, M = c.mouseY + N;
1140
- k > X && (k = c.mouseX - L.width - N), M > Y && (M = c.mouseY - L.height - N), k = Math.min(Math.max(b, k), Math.max(b, X)), M = Math.min(Math.max(b, M), Math.max(b, Y)), (Math.abs(k - c.x) > 0.5 || Math.abs(M - c.y) > 0.5) && d(
1141
- ($) => $ && {
1142
- ...$,
1143
- x: k,
1144
- y: M
1561
+ const d = ie(null), p = ie(null), [m, h] = B(null), [w, N] = B("");
1562
+ O(() => {
1563
+ const v = d.current;
1564
+ v && (v.querySelectorAll("[title]").forEach((c) => {
1565
+ const $ = c.getAttribute("title");
1566
+ $ && (c.getAttribute("aria-label") || c.setAttribute("aria-label", $), c.removeAttribute("title"));
1567
+ }), v.querySelectorAll("svg title").forEach((c) => c.remove()));
1568
+ }), _t(() => {
1569
+ if (!m) return;
1570
+ const v = p.current;
1571
+ if (!v) return;
1572
+ const c = 12, $ = 14, D = v.getBoundingClientRect(), K = window.innerWidth - D.width - c, W = window.innerHeight - D.height - c;
1573
+ let E = m.mouseX + $, T = m.mouseY + $;
1574
+ E > K && (E = m.mouseX - D.width - $), T > W && (T = m.mouseY - D.height - $), E = Math.min(Math.max(c, E), Math.max(c, K)), T = Math.min(Math.max(c, T), Math.max(c, W)), (Math.abs(E - m.x) > 0.5 || Math.abs(T - m.y) > 0.5) && h(
1575
+ (I) => I && {
1576
+ ...I,
1577
+ x: E,
1578
+ y: T
1145
1579
  }
1146
1580
  );
1147
- }, [c]);
1148
- const w = (g, b) => {
1149
- const N = m.current;
1150
- if (N) {
1581
+ }, [m]);
1582
+ const g = (v, c) => {
1583
+ const $ = d.current;
1584
+ if ($) {
1151
1585
  if (n) {
1152
- const L = fr(N);
1153
- if (!L) return;
1154
- C(L);
1586
+ const D = Br($);
1587
+ if (!D) return;
1588
+ N(D);
1155
1589
  }
1156
- !n && !r || d({ mouseX: g, mouseY: b, x: g + 14, y: b + 14 });
1590
+ !n && !r || h({ mouseX: v, mouseY: c, x: v + 14, y: c + 14 });
1157
1591
  }
1158
- }, f = n ? y : r;
1159
- return /* @__PURE__ */ s(le, { children: [
1592
+ }, f = n ? w : r;
1593
+ return /* @__PURE__ */ i(we, { children: [
1160
1594
  /* @__PURE__ */ e(
1161
1595
  u,
1162
1596
  {
1163
- ref: (g) => {
1164
- m.current = g;
1597
+ ref: (v) => {
1598
+ d.current = v;
1165
1599
  },
1166
1600
  className: a,
1167
1601
  style: l,
1168
- onMouseEnter: (g) => w(g.clientX, g.clientY),
1169
- onMouseMove: (g) => {
1170
- c && w(g.clientX, g.clientY);
1602
+ onMouseEnter: (v) => g(v.clientX, v.clientY),
1603
+ onMouseMove: (v) => {
1604
+ m && g(v.clientX, v.clientY);
1171
1605
  },
1172
- onMouseLeave: () => d(null),
1606
+ onMouseLeave: () => h(null),
1173
1607
  children: t
1174
1608
  }
1175
1609
  ),
1176
- c && f ? Ee(
1610
+ m && f ? Ge(
1177
1611
  /* @__PURE__ */ e(
1178
1612
  "div",
1179
1613
  {
@@ -1181,8 +1615,8 @@ function br({
1181
1615
  role: "tooltip",
1182
1616
  style: {
1183
1617
  position: "fixed",
1184
- top: c.y,
1185
- left: c.x,
1618
+ top: m.y,
1619
+ left: m.x,
1186
1620
  zIndex: 9999,
1187
1621
  background: "var(--bg-card)",
1188
1622
  border: "1px solid var(--border)",
@@ -1204,17 +1638,17 @@ function br({
1204
1638
  ) : null
1205
1639
  ] });
1206
1640
  }
1207
- const gr = "[&_button]:h-7 [&_button]:min-h-0 [&_button]:gap-1 [&_button]:px-2 [&_button]:text-xs [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button[data-icon=true]]:w-7 [&_button[data-icon=true]]:px-0";
1208
- function fe(t) {
1641
+ const Lr = "[&_button]:h-7 [&_button]:min-h-0 [&_button]:gap-1 [&_button]:px-2 [&_button]:text-xs [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button[data-icon=true]]:w-7 [&_button[data-icon=true]]:px-0";
1642
+ function ze(t) {
1209
1643
  if (!t) return 150;
1210
1644
  const r = parseInt(t, 10);
1211
1645
  return isNaN(r) || r <= 0 ? 150 : r;
1212
1646
  }
1213
- function se(t, r) {
1647
+ function Ee(t, r) {
1214
1648
  const n = t.minWidth ?? 80, a = t.maxWidth ?? 1 / 0;
1215
1649
  return Math.min(a, Math.max(n, r));
1216
1650
  }
1217
- function xr(t, r) {
1651
+ function Tr(t, r) {
1218
1652
  if (r <= 7) return Array.from({ length: r }, (a, l) => l + 1);
1219
1653
  const n = [1];
1220
1654
  t > 3 && n.push("...");
@@ -1222,13 +1656,13 @@ function xr(t, r) {
1222
1656
  n.push(a);
1223
1657
  return t < r - 2 && n.push("..."), n.push(r), n;
1224
1658
  }
1225
- function at({
1659
+ function vt({
1226
1660
  children: t,
1227
1661
  className: r = "",
1228
1662
  style: n
1229
1663
  }) {
1230
1664
  return /* @__PURE__ */ e(
1231
- br,
1665
+ Dt,
1232
1666
  {
1233
1667
  onlyWhenOverflow: !0,
1234
1668
  className: r,
@@ -1243,221 +1677,222 @@ function at({
1243
1677
  }
1244
1678
  );
1245
1679
  }
1246
- function an({
1680
+ function Nn({
1247
1681
  columns: t,
1248
1682
  data: r,
1249
1683
  getRowId: n,
1250
1684
  loading: a = !1,
1251
1685
  skeletonRows: l = 8,
1252
1686
  emptyIcon: u,
1253
- emptyText: m = "Sin resultados",
1687
+ emptyText: d = "Sin resultados",
1254
1688
  onRowClick: p,
1255
- selected: c,
1256
- onToggleOne: d,
1257
- onToggleAll: y,
1258
- highlightSelected: C = !0,
1259
- rowClassName: w,
1689
+ selected: m,
1690
+ onToggleOne: h,
1691
+ onToggleAll: w,
1692
+ highlightSelected: N = !0,
1693
+ rowClassName: g,
1260
1694
  stickyHeader: f = !0,
1261
- pageSize: g = 25,
1262
- pageSizeOptions: b = [25, 50, 100],
1263
- pageSizeSelectWidth: N = 62,
1264
- pageSizeSelectHeight: L = 30,
1265
- pageSizeSelectPadding: X = "0 7px",
1266
- totalRows: Y,
1267
- page: k,
1268
- onPageChange: M,
1269
- onPageSizeChange: $,
1270
- storageKey: B,
1271
- stickyFirstColumn: W = !1,
1272
- bottomOffset: I = 0,
1273
- compact: T = !0,
1274
- restrictHeight: A = !0
1695
+ pageSize: v = 25,
1696
+ pageSizeOptions: c = [25, 50, 100],
1697
+ pageSizeSelectWidth: $ = 62,
1698
+ pageSizeSelectHeight: D = 30,
1699
+ pageSizeSelectPadding: K = "0 7px",
1700
+ totalRows: W,
1701
+ page: E,
1702
+ onPageChange: T,
1703
+ onPageSizeChange: I,
1704
+ storageKey: L,
1705
+ stickyFirstColumn: F = !1,
1706
+ bottomOffset: M = 0,
1707
+ compact: S = !0,
1708
+ restrictHeight: P = !0,
1709
+ minTableWidth: J
1275
1710
  }) {
1276
- const q = t.map((i) => i.key).join(","), [O, G] = E(!B), F = J(null), U = J(!B), o = (i, h) => 50 + (i * 17 + h * 13 + 7) % 40, x = J(null), [z, j] = E(
1711
+ const _ = t.map((s) => s.key).join(","), [j, U] = B(!L), Z = ie(null), o = ie(!L), y = (s, x) => 50 + (s * 17 + x * 13 + 7) % 40, H = ie(null), [q, G] = B(
1277
1712
  void 0
1278
- ), [P, Z] = E(!1);
1279
- R(() => {
1280
- const h = g !== !1 ? 32 : 0, v = 12;
1281
- function S() {
1282
- if (Z(window.innerWidth < 640), !x.current) return;
1283
- const D = x.current.getBoundingClientRect().top;
1284
- j(
1713
+ ), [ee, me] = B(!1);
1714
+ O(() => {
1715
+ const x = v !== !1 ? 32 : 0, C = 12;
1716
+ function z() {
1717
+ if (me(window.innerWidth < 640), !H.current) return;
1718
+ const Y = H.current.getBoundingClientRect().top;
1719
+ G(
1285
1720
  Math.max(
1286
1721
  120,
1287
- window.innerHeight - D - h - v - I
1722
+ window.innerHeight - Y - x - C - M
1288
1723
  )
1289
1724
  );
1290
1725
  }
1291
- return S(), window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
1292
- }, [a, g, I]);
1293
- const [ee, ae] = E(
1294
- () => t.map((i) => i.key)
1295
- ), [de, ve] = E(
1726
+ return z(), window.addEventListener("resize", z), () => window.removeEventListener("resize", z);
1727
+ }, [a, v, M]);
1728
+ const [te, be] = B(
1729
+ () => t.map((s) => s.key)
1730
+ ), [fe, ve] = B(
1296
1731
  () => Object.fromEntries(
1297
- t.map((i) => [i.key, se(i, fe(i.width))])
1732
+ t.map((s) => [s.key, Ee(s, ze(s.width))])
1298
1733
  )
1299
1734
  );
1300
- R(() => {
1301
- const i = t.map((v) => v.key);
1302
- if (!B) {
1303
- ae(i), U.current = !1, G(!0);
1735
+ O(() => {
1736
+ const s = t.map((C) => C.key);
1737
+ if (!L) {
1738
+ be(s), o.current = !1, U(!0);
1304
1739
  return;
1305
1740
  }
1306
- let h = !1;
1307
- return U.current = !1, G(!1), fetch(
1308
- `/api/user/preferences/datatables?key=${encodeURIComponent(B)}`,
1741
+ let x = !1;
1742
+ return o.current = !1, U(!1), fetch(
1743
+ `/api/user/preferences/datatables?key=${encodeURIComponent(L)}`,
1309
1744
  { cache: "no-store" }
1310
- ).then((v) => v.ok ? v.json() : null).then((v) => {
1311
- var qe, Ge;
1312
- if (h) return;
1313
- const S = (qe = v == null ? void 0 : v.settings) == null ? void 0 : qe.columnOrder, D = Array.isArray(S) ? S.filter((K) => i.includes(K)) : [], V = i.filter((K) => !D.includes(K)), H = D.length > 0 ? [...D, ...V] : i, me = Object.fromEntries(
1314
- t.map((K) => [K.key, se(K, fe(K.width))])
1315
- ), _ = ((Ge = v == null ? void 0 : v.settings) == null ? void 0 : Ge.columnWidths) ?? {}, Ye = Object.fromEntries(
1316
- t.map((K) => [
1317
- K.key,
1318
- se(K, _[K.key] ?? me[K.key])
1745
+ ).then((C) => C.ok ? C.json() : null).then((C) => {
1746
+ var st, lt;
1747
+ if (x) return;
1748
+ const z = (st = C == null ? void 0 : C.settings) == null ? void 0 : st.columnOrder, Y = Array.isArray(z) ? z.filter((pe) => s.includes(pe)) : [], le = s.filter((pe) => !Y.includes(pe)), Q = Y.length > 0 ? [...Y, ...le] : s, Le = Object.fromEntries(
1749
+ t.map((pe) => [pe.key, Ee(pe, ze(pe.width))])
1750
+ ), re = ((lt = C == null ? void 0 : C.settings) == null ? void 0 : lt.columnWidths) ?? {}, it = Object.fromEntries(
1751
+ t.map((pe) => [
1752
+ pe.key,
1753
+ Ee(pe, re[pe.key] ?? Le[pe.key])
1319
1754
  ])
1320
1755
  );
1321
- ae(H), ve(Ye), F.current = JSON.stringify({
1322
- columnOrder: H,
1323
- columnWidths: Ye
1324
- }), U.current = !0;
1756
+ be(Q), ve(it), Z.current = JSON.stringify({
1757
+ columnOrder: Q,
1758
+ columnWidths: it
1759
+ }), o.current = !0;
1325
1760
  }).catch(() => {
1326
- if (!h) {
1327
- ae(i);
1328
- const v = Object.fromEntries(
1329
- t.map((S) => [
1330
- S.key,
1331
- se(S, fe(S.width))
1761
+ if (!x) {
1762
+ be(s);
1763
+ const C = Object.fromEntries(
1764
+ t.map((z) => [
1765
+ z.key,
1766
+ Ee(z, ze(z.width))
1332
1767
  ])
1333
1768
  );
1334
- ve(v), F.current = JSON.stringify({
1335
- columnOrder: i,
1336
- columnWidths: v
1337
- }), U.current = !0;
1769
+ ve(C), Z.current = JSON.stringify({
1770
+ columnOrder: s,
1771
+ columnWidths: C
1772
+ }), o.current = !0;
1338
1773
  }
1339
1774
  }).finally(() => {
1340
- h || G(!0);
1775
+ x || U(!0);
1341
1776
  }), () => {
1342
- h = !0;
1777
+ x = !0;
1343
1778
  };
1344
- }, [B, q, t]), R(() => {
1345
- if (!B || !O || !U.current) return;
1346
- const i = {
1347
- columnOrder: ee,
1348
- columnWidths: de
1349
- }, h = JSON.stringify(i);
1350
- if (h === F.current) return;
1351
- const v = window.setTimeout(() => {
1779
+ }, [L, _, t]), O(() => {
1780
+ if (!L || !j || !o.current) return;
1781
+ const s = {
1782
+ columnOrder: te,
1783
+ columnWidths: fe
1784
+ }, x = JSON.stringify(s);
1785
+ if (x === Z.current) return;
1786
+ const C = window.setTimeout(() => {
1352
1787
  fetch("/api/user/preferences/datatables", {
1353
1788
  method: "PATCH",
1354
1789
  headers: { "Content-Type": "application/json" },
1355
- body: JSON.stringify({ key: B, settings: i })
1356
- }).then((S) => {
1357
- S.ok && (F.current = h);
1790
+ body: JSON.stringify({ key: L, settings: s })
1791
+ }).then((z) => {
1792
+ z.ok && (Z.current = x);
1358
1793
  }).catch(() => {
1359
1794
  });
1360
1795
  }, 300);
1361
- return () => window.clearTimeout(v);
1362
- }, [ee, de, B, O]), R(() => {
1363
- ae((i) => {
1364
- const h = t.map((D) => D.key), v = i.filter((D) => h.includes(D)), S = h.filter((D) => !v.includes(D));
1365
- return [...v, ...S];
1796
+ return () => window.clearTimeout(C);
1797
+ }, [te, fe, L, j]), O(() => {
1798
+ be((s) => {
1799
+ const x = t.map((Y) => Y.key), C = s.filter((Y) => x.includes(Y)), z = x.filter((Y) => !C.includes(Y));
1800
+ return [...C, ...z];
1366
1801
  });
1367
- }, [q, t]);
1368
- const pe = ee.map((i) => t.find((h) => h.key === i)).filter((i) => !!i);
1369
- R(() => {
1370
- ve((i) => {
1371
- const h = Object.fromEntries(
1372
- t.map((v) => [v.key, se(v, fe(v.width))])
1802
+ }, [_, t]);
1803
+ const de = te.map((s) => t.find((x) => x.key === s)).filter((s) => !!s);
1804
+ O(() => {
1805
+ ve((s) => {
1806
+ const x = Object.fromEntries(
1807
+ t.map((C) => [C.key, Ee(C, ze(C.width))])
1373
1808
  );
1374
1809
  return Object.fromEntries(
1375
- t.map((v) => [
1376
- v.key,
1377
- se(v, i[v.key] ?? h[v.key])
1810
+ t.map((C) => [
1811
+ C.key,
1812
+ Ee(C, s[C.key] ?? x[C.key])
1378
1813
  ])
1379
1814
  );
1380
1815
  });
1381
- }, [q, t]);
1382
- const ye = J(null);
1383
- R(() => {
1384
- function i(v) {
1385
- const S = ye.current;
1386
- if (!S) return;
1387
- const D = v.clientX - S.startX, V = t.find((H) => H.key === S.colKey);
1388
- V && ve((H) => ({
1389
- ...H,
1390
- [S.colKey]: se(V, S.startWidth + D)
1816
+ }, [_, t]);
1817
+ const k = ie(null);
1818
+ O(() => {
1819
+ function s(C) {
1820
+ const z = k.current;
1821
+ if (!z) return;
1822
+ const Y = C.clientX - z.startX, le = t.find((Q) => Q.key === z.colKey);
1823
+ le && ve((Q) => ({
1824
+ ...Q,
1825
+ [z.colKey]: Ee(le, z.startWidth + Y)
1391
1826
  }));
1392
1827
  }
1393
- function h() {
1394
- ye.current && (ye.current = null, document.body.style.cursor = "", document.body.style.userSelect = "");
1828
+ function x() {
1829
+ k.current && (k.current = null, document.body.style.cursor = "", document.body.style.userSelect = "");
1395
1830
  }
1396
- return document.addEventListener("pointermove", i), document.addEventListener("pointerup", h), () => {
1397
- document.removeEventListener("pointermove", i), document.removeEventListener("pointerup", h);
1831
+ return document.addEventListener("pointermove", s), document.addEventListener("pointerup", x), () => {
1832
+ document.removeEventListener("pointermove", s), document.removeEventListener("pointerup", x);
1398
1833
  };
1399
1834
  }, [t]);
1400
- const we = J(null), [Pe, Me] = E(null);
1401
- function xt(i, h) {
1402
- we.current = i, h.dataTransfer.effectAllowed = "move";
1835
+ const A = ie(null), [X, ne] = B(null);
1836
+ function ce(s, x) {
1837
+ A.current = s, x.dataTransfer.effectAllowed = "move";
1403
1838
  }
1404
- function vt(i, h) {
1405
- h.preventDefault(), h.dataTransfer.dropEffect = "move", Pe !== i && Me(i);
1839
+ function R(s, x) {
1840
+ x.preventDefault(), x.dataTransfer.dropEffect = "move", X !== s && ne(s);
1406
1841
  }
1407
- function yt(i, h) {
1408
- h.preventDefault();
1409
- const v = we.current;
1410
- v !== null && v !== i && ae((S) => {
1411
- const D = [...S], [V] = D.splice(v, 1);
1412
- return D.splice(i, 0, V), D;
1413
- }), we.current = null, Me(null);
1842
+ function Ne(s, x) {
1843
+ x.preventDefault();
1844
+ const C = A.current;
1845
+ C !== null && C !== s && be((z) => {
1846
+ const Y = [...z], [le] = Y.splice(C, 1);
1847
+ return Y.splice(s, 0, le), Y;
1848
+ }), A.current = null, ne(null);
1414
1849
  }
1415
- function wt() {
1416
- we.current = null, Me(null);
1850
+ function Pe() {
1851
+ A.current = null, ne(null);
1417
1852
  }
1418
- const [re, Nt] = E(null);
1419
- function kt(i) {
1420
- i.sortKey && Nt(
1421
- (h) => (h == null ? void 0 : h.key) === i.key ? { key: i.key, dir: h.dir === "asc" ? "desc" : "asc" } : { key: i.key, dir: "asc" }
1853
+ const [xe, De] = B(null);
1854
+ function We(s) {
1855
+ s.sortKey && De(
1856
+ (x) => (x == null ? void 0 : x.key) === s.key ? { key: s.key, dir: x.dir === "asc" ? "desc" : "asc" } : { key: s.key, dir: "asc" }
1422
1857
  );
1423
1858
  }
1424
- const [St, $e] = E(1), [_e, Ct] = E(
1425
- g === !1 ? 0 : g
1859
+ const [ae, Me] = B(1), [Ie, je] = B(
1860
+ v === !1 ? 0 : v
1426
1861
  );
1427
- R(() => {
1428
- $e(1);
1862
+ O(() => {
1863
+ Me(1);
1429
1864
  }, [r]);
1430
- const ue = !!(M && $), oe = g !== !1, Q = ue ? k ?? 1 : St, ie = ue || oe ? _e : r.length, te = !!c && !!d && !!y, Le = te ? 40 : 0, Et = te && r.length > 0 && c.size === r.length, Mt = te && c.size > 0 && c.size < r.length, Te = Xe.useMemo(() => {
1431
- if (!re) return r;
1432
- const i = t.find((h) => h.key === re.key && h.sortKey);
1433
- return i != null && i.sortKey ? [...r].sort((h, v) => {
1434
- const S = h[i.sortKey], D = v[i.sortKey], V = S === D ? 0 : S == null ? 1 : D == null || S < D ? -1 : 1;
1435
- return re.dir === "asc" ? V : -V;
1865
+ const ge = !!(T && I), ye = v !== !1, ue = ge ? E ?? 1 : ae, b = ge || ye ? Ie : r.length, V = !!m && !!h && !!w, oe = V ? 40 : 0, Ce = V && r.length > 0 && m.size === r.length, se = V && m.size > 0 && m.size < r.length, $e = ct.useMemo(() => {
1866
+ if (!xe) return r;
1867
+ const s = t.find((x) => x.key === xe.key && x.sortKey);
1868
+ return s != null && s.sortKey ? [...r].sort((x, C) => {
1869
+ const z = x[s.sortKey], Y = C[s.sortKey], le = z === Y ? 0 : z == null ? 1 : Y == null || z < Y ? -1 : 1;
1870
+ return xe.dir === "asc" ? le : -le;
1436
1871
  }) : r;
1437
- }, [r, re, t]), $t = Xe.useMemo(() => {
1438
- if (ue || !oe) return Te;
1439
- const i = (Q - 1) * ie;
1440
- return Te.slice(i, i + ie);
1441
- }, [Te, ue, oe, Q, ie]), he = Y ?? r.length, Be = oe ? Math.max(1, Math.ceil(he / ie)) : 1, Lt = oe ? (Q - 1) * ie + 1 : 1, Tt = oe ? Math.min(Q * ie, he) : he;
1442
- function Re(i) {
1443
- const h = Math.max(1, Math.min(i, Be));
1444
- ue ? M(h) : $e(h);
1872
+ }, [r, xe, t]), Be = ct.useMemo(() => {
1873
+ if (ge || !ye) return $e;
1874
+ const s = (ue - 1) * b;
1875
+ return $e.slice(s, s + b);
1876
+ }, [$e, ge, ye, ue, b]), Re = W ?? r.length, Xe = ye ? Math.max(1, Math.ceil(Re / b)) : 1, Rt = ye ? (ue - 1) * b + 1 : 1, zt = ye ? Math.min(ue * b, Re) : Re;
1877
+ function Je(s) {
1878
+ const x = Math.max(1, Math.min(s, Xe));
1879
+ ge ? T(x) : Me(x);
1445
1880
  }
1446
- function Bt(i) {
1447
- Ct(i), ue ? ($(i), M(1)) : $e(1), $ && $(i);
1881
+ function At(s) {
1882
+ je(s), ge ? (I(s), T(1)) : Me(1), I && I(s);
1448
1883
  }
1449
- const Fe = (i) => i === "center" ? "text-center" : i === "right" ? "text-right" : "text-left", Rt = "color-mix(in srgb, var(--primary) 6%, var(--bg-card))", je = () => /* @__PURE__ */ s(
1884
+ const nt = (s) => s === "center" ? "text-center" : s === "right" ? "text-right" : "text-left", Ot = "color-mix(in srgb, var(--primary) 6%, var(--bg-card))", at = () => /* @__PURE__ */ i(
1450
1885
  "tr",
1451
1886
  {
1452
1887
  style: {
1453
1888
  background: "color-mix(in srgb, var(--bg-input) 72%, transparent)"
1454
1889
  },
1455
1890
  children: [
1456
- te && /* @__PURE__ */ e(
1891
+ V && /* @__PURE__ */ e(
1457
1892
  "th",
1458
1893
  {
1459
- className: `${T ? "px-2 py-1.5" : "px-3 py-2.5"} w-10`,
1460
- style: W ? {
1894
+ className: `${S ? "px-2 py-1.5" : "px-3 py-2.5"} w-10`,
1895
+ style: F ? {
1461
1896
  position: "sticky",
1462
1897
  left: 0,
1463
1898
  zIndex: 12,
@@ -1474,26 +1909,26 @@ function an({
1474
1909
  "input",
1475
1910
  {
1476
1911
  type: "checkbox",
1477
- checked: Et,
1478
- ref: (i) => {
1479
- i && (i.indeterminate = Mt);
1912
+ checked: Ce,
1913
+ ref: (s) => {
1914
+ s && (s.indeterminate = se);
1480
1915
  },
1481
- onChange: y,
1916
+ onChange: w,
1482
1917
  className: "rounded cursor-pointer accent-[var(--primary)]"
1483
1918
  }
1484
1919
  )
1485
1920
  }
1486
1921
  ),
1487
- pe.map((i, h) => {
1488
- const v = (re == null ? void 0 : re.key) === i.key, S = !!i.sortKey, D = W && !P && h === 0, V = Pe === h, me = (de[i.key] ?? fe(i.width)) < 120;
1489
- return /* @__PURE__ */ s(
1922
+ de.map((s, x) => {
1923
+ const C = (xe == null ? void 0 : xe.key) === s.key, z = !!s.sortKey, Y = F && !ee && x === 0, le = X === x, Le = (fe[s.key] ?? ze(s.width)) < 120;
1924
+ return /* @__PURE__ */ i(
1490
1925
  "th",
1491
1926
  {
1492
- className: `group select-none ${me ? "text-left" : Fe(i.align)}`,
1927
+ className: `group select-none ${Le ? "text-left" : nt(s.align)}`,
1493
1928
  style: {
1494
- ...D ? {
1929
+ ...Y ? {
1495
1930
  position: "sticky",
1496
- left: Le,
1931
+ left: oe,
1497
1932
  zIndex: 12,
1498
1933
  background: "color-mix(in srgb, var(--bg-input) 72%, transparent)",
1499
1934
  backdropFilter: "blur(14px)",
@@ -1505,29 +1940,29 @@ function an({
1505
1940
  borderBottom: "2px solid var(--border)",
1506
1941
  borderRight: "1px solid var(--border)"
1507
1942
  },
1508
- color: v ? "var(--primary)" : "var(--text-muted)",
1943
+ color: C ? "var(--primary)" : "var(--text-muted)",
1509
1944
  whiteSpace: "nowrap",
1510
1945
  transition: "color 0.15s",
1511
- borderLeft: V ? "2px solid var(--primary)" : "2px solid transparent",
1512
- cursor: S ? "pointer" : "default",
1946
+ borderLeft: le ? "2px solid var(--primary)" : "2px solid transparent",
1947
+ cursor: z ? "pointer" : "default",
1513
1948
  // Padding: room for grip icon left, resize handle right
1514
- padding: T ? "5px 24px 5px 6px" : "7px 28px 7px 6px"
1949
+ padding: S ? "5px 24px 5px 6px" : "7px 28px 7px 6px"
1515
1950
  },
1516
- onDragOver: (_) => vt(h, _),
1517
- onDrop: (_) => yt(h, _),
1518
- onClick: S ? () => kt(i) : void 0,
1951
+ onDragOver: (re) => R(x, re),
1952
+ onDrop: (re) => Ne(x, re),
1953
+ onClick: z ? () => We(s) : void 0,
1519
1954
  children: [
1520
1955
  /* @__PURE__ */ e(
1521
1956
  "span",
1522
1957
  {
1523
1958
  draggable: !0,
1524
- onDragStart: (_) => {
1525
- _.stopPropagation(), xt(h, _);
1959
+ onDragStart: (re) => {
1960
+ re.stopPropagation(), ce(x, re);
1526
1961
  },
1527
- onDragEnd: (_) => {
1528
- _.stopPropagation(), wt();
1962
+ onDragEnd: (re) => {
1963
+ re.stopPropagation(), Pe();
1529
1964
  },
1530
- onClick: (_) => _.stopPropagation(),
1965
+ onClick: (re) => re.stopPropagation(),
1531
1966
  title: "Arrastrar para reordenar",
1532
1967
  className: "inline-flex items-center mr-1 opacity-0 group-hover:opacity-40 transition-opacity",
1533
1968
  style: {
@@ -1535,24 +1970,24 @@ function an({
1535
1970
  color: "var(--text-muted)",
1536
1971
  verticalAlign: "middle"
1537
1972
  },
1538
- children: /* @__PURE__ */ e(Kt, { size: 15 })
1973
+ children: /* @__PURE__ */ e(or, { size: 15 })
1539
1974
  }
1540
1975
  ),
1541
1976
  /* @__PURE__ */ e(
1542
- at,
1977
+ vt,
1543
1978
  {
1544
1979
  className: "inline-block max-w-full align-middle",
1545
1980
  style: {
1546
1981
  width: "calc(100% - 22px)",
1547
- textAlign: me ? "left" : i.align === "center" ? "center" : i.align === "right" ? "right" : "left"
1982
+ textAlign: Le ? "left" : s.align === "center" ? "center" : s.align === "right" ? "right" : "left"
1548
1983
  },
1549
- children: /* @__PURE__ */ s(
1984
+ children: /* @__PURE__ */ i(
1550
1985
  "span",
1551
1986
  {
1552
- className: `inline-flex max-w-full items-center gap-1 font-semibold uppercase tracking-wider ${T ? "text-[11px]" : "text-xs"}`,
1987
+ className: `inline-flex max-w-full items-center gap-1 font-semibold uppercase tracking-wider ${S ? "text-[11px]" : "text-xs"}`,
1553
1988
  children: [
1554
- /* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: i.header }),
1555
- S && /* @__PURE__ */ e("span", { className: "flex-shrink-0 opacity-60", children: v ? re.dir === "asc" ? /* @__PURE__ */ e(Ot, { className: "w-3 h-3" }) : /* @__PURE__ */ e(ge, { className: "w-3 h-3" }) : /* @__PURE__ */ e(It, { className: "w-3 h-3 opacity-40" }) })
1989
+ /* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: s.header }),
1990
+ z && /* @__PURE__ */ e("span", { className: "flex-shrink-0 opacity-60", children: C ? xe.dir === "asc" ? /* @__PURE__ */ e(Wt, { className: "w-3 h-3" }) : /* @__PURE__ */ e(He, { className: "w-3 h-3" }) : /* @__PURE__ */ e(jt, { className: "w-3 h-3 opacity-40" }) })
1556
1991
  ]
1557
1992
  }
1558
1993
  )
@@ -1564,14 +1999,14 @@ function an({
1564
1999
  role: "separator",
1565
2000
  "aria-orientation": "vertical",
1566
2001
  title: "Arrastrar para redimensionar",
1567
- onPointerDown: (_) => {
1568
- _.preventDefault(), _.stopPropagation(), ye.current = {
1569
- colKey: i.key,
1570
- startX: _.clientX,
1571
- startWidth: de[i.key] ?? 150
2002
+ onPointerDown: (re) => {
2003
+ re.preventDefault(), re.stopPropagation(), k.current = {
2004
+ colKey: s.key,
2005
+ startX: re.clientX,
2006
+ startWidth: fe[s.key] ?? 150
1572
2007
  }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
1573
2008
  },
1574
- onClick: (_) => _.stopPropagation(),
2009
+ onClick: (re) => re.stopPropagation(),
1575
2010
  className: "absolute right-0 top-0 h-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",
1576
2011
  style: { width: 12, cursor: "col-resize", zIndex: 3 },
1577
2012
  children: /* @__PURE__ */ e(
@@ -1590,85 +2025,85 @@ function an({
1590
2025
  )
1591
2026
  ]
1592
2027
  },
1593
- i.key
2028
+ s.key
1594
2029
  );
1595
2030
  })
1596
2031
  ]
1597
2032
  }
1598
- ), Ue = () => {
1599
- if (!oe || a) return null;
1600
- const i = xr(Q, Be);
1601
- return /* @__PURE__ */ s(
2033
+ ), ot = () => {
2034
+ if (!ye || a) return null;
2035
+ const s = Tr(ue, Xe);
2036
+ return /* @__PURE__ */ i(
1602
2037
  "div",
1603
2038
  {
1604
- className: `flex items-center justify-between gap-2 rounded-b-xl border-t text-xs select-none ${T ? "px-2 py-0.5" : "px-3 py-1"}`,
2039
+ className: `flex items-center justify-between gap-2 rounded-b-xl border-t text-xs select-none ${S ? "px-2 py-0.5" : "px-3 py-1"}`,
1605
2040
  style: { borderColor: "var(--border)", background: "var(--bg-input)" },
1606
2041
  children: [
1607
- /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
1608
- /* @__PURE__ */ e("span", { style: { color: "var(--text-muted)" }, children: he === 0 ? "0 filas" : `${Lt}–${Tt} de ${he}` }),
1609
- /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
2042
+ /* @__PURE__ */ i("div", { className: "flex min-w-0 items-center gap-2", children: [
2043
+ /* @__PURE__ */ e("span", { style: { color: "var(--text-muted)" }, children: Re === 0 ? "0 filas" : `${Rt}–${zt} de ${Re}` }),
2044
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
1610
2045
  /* @__PURE__ */ e("span", { style: { color: "var(--text-muted)" }, children: "Filas:" }),
1611
2046
  /* @__PURE__ */ e(
1612
- ft,
2047
+ Tt,
1613
2048
  {
1614
- value: String(ie),
1615
- onChange: (h) => Bt(Number(h)),
1616
- options: b.map((h) => ({
1617
- value: String(h),
1618
- label: String(h)
2049
+ value: String(b),
2050
+ onChange: (x) => At(Number(x)),
2051
+ options: c.map((x) => ({
2052
+ value: String(x),
2053
+ label: String(x)
1619
2054
  })),
1620
2055
  placeholder: "Filas",
1621
2056
  searchable: !1,
1622
- height: L,
1623
- padding: X,
2057
+ height: D,
2058
+ padding: K,
1624
2059
  className: "shrink-0 [&>button]:rounded-md [&>button]:text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",
1625
- style: { width: N }
2060
+ style: { width: $ }
1626
2061
  }
1627
2062
  )
1628
2063
  ] })
1629
2064
  ] }),
1630
- /* @__PURE__ */ s("div", { className: "flex items-center gap-0.5", children: [
2065
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-0.5", children: [
1631
2066
  /* @__PURE__ */ e(
1632
2067
  "button",
1633
2068
  {
1634
- disabled: Q <= 1,
1635
- onClick: () => Re(Q - 1),
2069
+ disabled: ue <= 1,
2070
+ onClick: () => Je(ue - 1),
1636
2071
  className: "rounded p-0.5 transition-colors disabled:opacity-30",
1637
2072
  style: { color: "var(--text-muted)", background: "transparent" },
1638
- children: /* @__PURE__ */ e(Se, { className: "h-3.5 w-3.5" })
2073
+ children: /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" })
1639
2074
  }
1640
2075
  ),
1641
- i.map(
1642
- (h, v) => h === "..." ? /* @__PURE__ */ e(
2076
+ s.map(
2077
+ (x, C) => x === "..." ? /* @__PURE__ */ e(
1643
2078
  "span",
1644
2079
  {
1645
2080
  className: "px-1",
1646
2081
  style: { color: "var(--text-muted)" },
1647
2082
  children: "…"
1648
2083
  },
1649
- `e${v}`
2084
+ `e${C}`
1650
2085
  ) : /* @__PURE__ */ e(
1651
2086
  "button",
1652
2087
  {
1653
- onClick: () => Re(h),
2088
+ onClick: () => Je(x),
1654
2089
  className: "h-5 w-5 rounded text-[11px] font-medium transition-colors",
1655
2090
  style: {
1656
- background: h === Q ? "var(--primary)" : "transparent",
1657
- color: h === Q ? "var(--primary-fg)" : "var(--text-muted)"
2091
+ background: x === ue ? "var(--primary)" : "transparent",
2092
+ color: x === ue ? "var(--primary-fg)" : "var(--text-muted)"
1658
2093
  },
1659
- children: h
2094
+ children: x
1660
2095
  },
1661
- h
2096
+ x
1662
2097
  )
1663
2098
  ),
1664
2099
  /* @__PURE__ */ e(
1665
2100
  "button",
1666
2101
  {
1667
- disabled: Q >= Be,
1668
- onClick: () => Re(Q + 1),
2102
+ disabled: ue >= Xe,
2103
+ onClick: () => Je(ue + 1),
1669
2104
  className: "rounded p-0.5 transition-colors disabled:opacity-30",
1670
2105
  style: { color: "var(--text-muted)", background: "transparent" },
1671
- children: /* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5" })
2106
+ children: /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" })
1672
2107
  }
1673
2108
  )
1674
2109
  ] })
@@ -1676,266 +2111,286 @@ function an({
1676
2111
  }
1677
2112
  );
1678
2113
  };
1679
- return a && r.length === 0 ? /* @__PURE__ */ s(
2114
+ return a && r.length === 0 ? /* @__PURE__ */ i(
1680
2115
  "div",
1681
2116
  {
1682
- className: "w-full flex flex-col rounded-xl overflow-visible",
2117
+ className: "w-full min-w-0 max-w-full flex flex-col rounded-xl overflow-visible",
1683
2118
  style: { border: "1px solid var(--border)" },
1684
2119
  children: [
1685
- /* @__PURE__ */ e("div", { ref: x, className: "overflow-hidden rounded-t-xl", children: /* @__PURE__ */ e(
1686
- tt,
2120
+ /* @__PURE__ */ e(
2121
+ "div",
1687
2122
  {
1688
- options: { scrollbars: { autoHide: "leave", autoHideDelay: 200 } },
1689
- className: "w-full",
1690
- style: { maxHeight: A ? z : void 0 },
1691
- defer: !0,
1692
- children: /* @__PURE__ */ s(
1693
- "table",
2123
+ ref: H,
2124
+ className: "min-w-0 max-w-full overflow-hidden rounded-t-xl",
2125
+ children: /* @__PURE__ */ e(
2126
+ pt,
1694
2127
  {
1695
- className: "text-sm",
2128
+ options: { scrollbars: { autoHide: "leave", autoHideDelay: 200 } },
2129
+ className: "w-full",
1696
2130
  style: {
1697
- tableLayout: "fixed",
1698
- width: "100%",
1699
- minWidth: "max-content",
1700
- borderCollapse: "separate",
1701
- borderSpacing: 0
2131
+ maxHeight: P ? q : void 0,
2132
+ maxWidth: "100%"
1702
2133
  },
1703
- children: [
1704
- /* @__PURE__ */ s("colgroup", { children: [
1705
- te && /* @__PURE__ */ e("col", { style: { width: 40 } }),
1706
- pe.map((i) => /* @__PURE__ */ e(
1707
- "col",
1708
- {
1709
- style: { width: de[i.key] ?? 150 }
1710
- },
1711
- i.key
1712
- ))
1713
- ] }),
1714
- /* @__PURE__ */ e(
1715
- "thead",
1716
- {
1717
- style: f ? {
1718
- position: "sticky",
1719
- top: 0,
1720
- zIndex: 10,
1721
- backdropFilter: "blur(14px)",
1722
- WebkitBackdropFilter: "blur(14px)"
1723
- } : void 0,
1724
- children: je()
1725
- }
1726
- ),
1727
- /* @__PURE__ */ e("tbody", { children: Array.from({ length: l }).map((i, h) => /* @__PURE__ */ s("tr", { children: [
1728
- te && /* @__PURE__ */ e(
1729
- "td",
1730
- {
1731
- className: `${T ? "px-2 py-1.5" : "px-3 py-2"} w-10`,
1732
- style: {
1733
- borderBottom: "1px solid var(--border)",
1734
- borderRight: "1px solid var(--border)"
2134
+ defer: !0,
2135
+ children: /* @__PURE__ */ i(
2136
+ "table",
2137
+ {
2138
+ className: "text-sm",
2139
+ style: {
2140
+ tableLayout: "fixed",
2141
+ width: "100%",
2142
+ minWidth: J ?? "max-content",
2143
+ borderCollapse: "separate",
2144
+ borderSpacing: 0
2145
+ },
2146
+ children: [
2147
+ /* @__PURE__ */ i("colgroup", { children: [
2148
+ V && /* @__PURE__ */ e("col", { style: { width: 40 } }),
2149
+ de.map((s) => /* @__PURE__ */ e(
2150
+ "col",
2151
+ {
2152
+ style: { width: fe[s.key] ?? 150 }
2153
+ },
2154
+ s.key
2155
+ ))
2156
+ ] }),
2157
+ /* @__PURE__ */ e(
2158
+ "thead",
2159
+ {
2160
+ style: f ? {
2161
+ position: "sticky",
2162
+ top: 0,
2163
+ zIndex: 10,
2164
+ backdropFilter: "blur(14px)",
2165
+ WebkitBackdropFilter: "blur(14px)"
2166
+ } : void 0,
2167
+ children: at()
1735
2168
  }
1736
- }
1737
- ),
1738
- pe.map((v, S) => /* @__PURE__ */ e(
1739
- "td",
1740
- {
1741
- className: T ? "px-2 py-1.5" : "px-3 py-2",
1742
- style: W && !P && S === 0 ? {
1743
- position: "sticky",
1744
- left: Le,
1745
- zIndex: 1,
1746
- background: "color-mix(in srgb, var(--bg-card) 72%, transparent)",
1747
- backdropFilter: "blur(10px)",
1748
- WebkitBackdropFilter: "blur(10px)",
1749
- boxShadow: "3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -1px 0 var(--border)",
1750
- borderRight: "1px solid var(--border)"
1751
- } : {
1752
- borderBottom: "1px solid var(--border)",
1753
- borderRight: "1px solid var(--border)"
1754
- },
1755
- children: /* @__PURE__ */ e(
1756
- "div",
2169
+ ),
2170
+ /* @__PURE__ */ e("tbody", { children: Array.from({ length: l }).map((s, x) => /* @__PURE__ */ i("tr", { children: [
2171
+ V && /* @__PURE__ */ e(
2172
+ "td",
1757
2173
  {
1758
- className: "h-3.5 rounded-full animate-pulse",
2174
+ className: `${S ? "px-2 py-1.5" : "px-3 py-2"} w-10`,
1759
2175
  style: {
1760
- background: "var(--border)",
1761
- width: `${o(h, S)}%`,
1762
- minWidth: 32
2176
+ borderBottom: "1px solid var(--border)",
2177
+ borderRight: "1px solid var(--border)"
1763
2178
  }
1764
2179
  }
1765
- )
1766
- },
1767
- v.key
1768
- ))
1769
- ] }, h)) })
1770
- ]
2180
+ ),
2181
+ de.map((C, z) => /* @__PURE__ */ e(
2182
+ "td",
2183
+ {
2184
+ className: S ? "px-2 py-1.5" : "px-3 py-2",
2185
+ style: F && !ee && z === 0 ? {
2186
+ position: "sticky",
2187
+ left: oe,
2188
+ zIndex: 1,
2189
+ background: "color-mix(in srgb, var(--bg-card) 72%, transparent)",
2190
+ backdropFilter: "blur(10px)",
2191
+ WebkitBackdropFilter: "blur(10px)",
2192
+ boxShadow: "3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -1px 0 var(--border)",
2193
+ borderRight: "1px solid var(--border)"
2194
+ } : {
2195
+ borderBottom: "1px solid var(--border)",
2196
+ borderRight: "1px solid var(--border)"
2197
+ },
2198
+ children: /* @__PURE__ */ e(
2199
+ "div",
2200
+ {
2201
+ className: "h-3.5 rounded-full animate-pulse",
2202
+ style: {
2203
+ background: "var(--border)",
2204
+ width: `${y(x, z)}%`,
2205
+ minWidth: 32
2206
+ }
2207
+ }
2208
+ )
2209
+ },
2210
+ C.key
2211
+ ))
2212
+ ] }, x)) })
2213
+ ]
2214
+ }
2215
+ )
1771
2216
  }
1772
2217
  )
1773
2218
  }
1774
- ) }),
1775
- Ue()
2219
+ ),
2220
+ ot()
1776
2221
  ]
1777
2222
  }
1778
- ) : !a && r.length === 0 ? /* @__PURE__ */ s("div", { className: "py-20 flex flex-col items-center gap-3", children: [
2223
+ ) : !a && r.length === 0 ? /* @__PURE__ */ i("div", { className: "py-20 flex flex-col items-center gap-3", children: [
1779
2224
  u && /* @__PURE__ */ e("div", { style: { color: "var(--text-muted)", opacity: 0.5 }, children: u }),
1780
- /* @__PURE__ */ e("p", { className: "text-sm", style: { color: "var(--text-muted)" }, children: m })
1781
- ] }) : /* @__PURE__ */ s(
2225
+ /* @__PURE__ */ e("p", { className: "text-sm", style: { color: "var(--text-muted)" }, children: d })
2226
+ ] }) : /* @__PURE__ */ i(
1782
2227
  "div",
1783
2228
  {
1784
- className: "w-full flex flex-col rounded-xl overflow-visible",
2229
+ className: "w-full min-w-0 max-w-full flex flex-col rounded-xl overflow-visible",
1785
2230
  style: { border: "1px solid var(--border)" },
1786
2231
  children: [
1787
- /* @__PURE__ */ e("div", { ref: x, className: "overflow-hidden rounded-t-xl", children: /* @__PURE__ */ e(
1788
- tt,
2232
+ /* @__PURE__ */ e(
2233
+ "div",
1789
2234
  {
1790
- options: { scrollbars: { autoHide: "leave", autoHideDelay: 200 } },
1791
- className: "w-full",
1792
- style: { maxHeight: A ? z : void 0 },
1793
- defer: !0,
1794
- children: /* @__PURE__ */ s(
1795
- "table",
2235
+ ref: H,
2236
+ className: "min-w-0 max-w-full overflow-hidden rounded-t-xl",
2237
+ children: /* @__PURE__ */ e(
2238
+ pt,
1796
2239
  {
1797
- className: "text-sm",
2240
+ options: { scrollbars: { autoHide: "leave", autoHideDelay: 200 } },
2241
+ className: "w-full",
1798
2242
  style: {
1799
- tableLayout: "fixed",
1800
- width: "100%",
1801
- minWidth: "max-content",
1802
- borderCollapse: "separate",
1803
- borderSpacing: 0
2243
+ maxHeight: P ? q : void 0,
2244
+ maxWidth: "100%"
1804
2245
  },
1805
- children: [
1806
- /* @__PURE__ */ s("colgroup", { children: [
1807
- te && /* @__PURE__ */ e("col", { style: { width: 40 } }),
1808
- pe.map((i) => /* @__PURE__ */ e(
1809
- "col",
1810
- {
1811
- style: { width: de[i.key] ?? 150 }
1812
- },
1813
- i.key
1814
- ))
1815
- ] }),
1816
- /* @__PURE__ */ e(
1817
- "thead",
1818
- {
1819
- style: f ? {
1820
- position: "sticky",
1821
- top: 0,
1822
- zIndex: 10,
1823
- backdropFilter: "blur(14px)",
1824
- WebkitBackdropFilter: "blur(14px)"
1825
- } : void 0,
1826
- children: je()
1827
- }
1828
- ),
1829
- /* @__PURE__ */ e("tbody", { children: $t.map((i, h) => {
1830
- const v = n(i), S = te && c.has(v), D = !!p, V = S && C ? "color-mix(in srgb, var(--primary) 8%, var(--bg-card))" : h % 2 === 1 ? "color-mix(in srgb, var(--bg-input) 50%, var(--bg-card))" : "var(--bg-card)";
1831
- return /* @__PURE__ */ s(
1832
- "tr",
1833
- {
1834
- onClick: D ? () => p(i) : void 0,
1835
- className: `transition-colors ${D ? "cursor-pointer" : ""} ${w ? w(i) : ""}`,
1836
- style: {
1837
- "--dt-row-bg": V,
1838
- "--dt-sticky-bg": V,
1839
- background: "var(--dt-row-bg)"
1840
- },
1841
- onMouseEnter: (H) => {
1842
- S || (H.currentTarget.style.setProperty(
1843
- "--dt-row-bg",
1844
- "var(--bg-hover)"
1845
- ), H.currentTarget.style.setProperty(
1846
- "--dt-sticky-bg",
1847
- Rt
1848
- ));
1849
- },
1850
- onMouseLeave: (H) => {
1851
- H.currentTarget.style.setProperty("--dt-row-bg", V), H.currentTarget.style.setProperty(
1852
- "--dt-sticky-bg",
1853
- V
1854
- );
1855
- },
1856
- children: [
1857
- te && /* @__PURE__ */ e(
1858
- "td",
1859
- {
1860
- className: `${T ? "px-2 py-1.5" : "px-3 py-2"} w-10`,
1861
- style: W ? {
1862
- position: "sticky",
1863
- left: 0,
1864
- zIndex: 3,
1865
- background: "var(--dt-sticky-bg)",
1866
- boxShadow: "inset 0 -1px 0 var(--border)"
1867
- } : {
1868
- borderBottom: "1px solid var(--border)",
1869
- borderRight: "1px solid var(--border)"
1870
- },
1871
- onClick: (H) => {
1872
- H.stopPropagation(), d(v);
1873
- },
1874
- children: /* @__PURE__ */ e(
1875
- "input",
2246
+ defer: !0,
2247
+ children: /* @__PURE__ */ i(
2248
+ "table",
2249
+ {
2250
+ className: "text-sm",
2251
+ style: {
2252
+ tableLayout: "fixed",
2253
+ width: "100%",
2254
+ minWidth: J ?? "max-content",
2255
+ borderCollapse: "separate",
2256
+ borderSpacing: 0
2257
+ },
2258
+ children: [
2259
+ /* @__PURE__ */ i("colgroup", { children: [
2260
+ V && /* @__PURE__ */ e("col", { style: { width: 40 } }),
2261
+ de.map((s) => /* @__PURE__ */ e(
2262
+ "col",
2263
+ {
2264
+ style: { width: fe[s.key] ?? 150 }
2265
+ },
2266
+ s.key
2267
+ ))
2268
+ ] }),
2269
+ /* @__PURE__ */ e(
2270
+ "thead",
2271
+ {
2272
+ style: f ? {
2273
+ position: "sticky",
2274
+ top: 0,
2275
+ zIndex: 10,
2276
+ backdropFilter: "blur(14px)",
2277
+ WebkitBackdropFilter: "blur(14px)"
2278
+ } : void 0,
2279
+ children: at()
2280
+ }
2281
+ ),
2282
+ /* @__PURE__ */ e("tbody", { children: Be.map((s, x) => {
2283
+ const C = n(s), z = V && m.has(C), Y = !!p, le = z && N ? "color-mix(in srgb, var(--primary) 8%, var(--bg-card))" : x % 2 === 1 ? "color-mix(in srgb, var(--bg-input) 50%, var(--bg-card))" : "var(--bg-card)";
2284
+ return /* @__PURE__ */ i(
2285
+ "tr",
2286
+ {
2287
+ onClick: Y ? () => p(s) : void 0,
2288
+ className: `transition-colors ${Y ? "cursor-pointer" : ""} ${g ? g(s) : ""}`,
2289
+ style: {
2290
+ "--dt-row-bg": le,
2291
+ "--dt-sticky-bg": le,
2292
+ background: "var(--dt-row-bg)"
2293
+ },
2294
+ onMouseEnter: (Q) => {
2295
+ z || (Q.currentTarget.style.setProperty(
2296
+ "--dt-row-bg",
2297
+ "var(--bg-hover)"
2298
+ ), Q.currentTarget.style.setProperty(
2299
+ "--dt-sticky-bg",
2300
+ Ot
2301
+ ));
2302
+ },
2303
+ onMouseLeave: (Q) => {
2304
+ Q.currentTarget.style.setProperty("--dt-row-bg", le), Q.currentTarget.style.setProperty(
2305
+ "--dt-sticky-bg",
2306
+ le
2307
+ );
2308
+ },
2309
+ children: [
2310
+ V && /* @__PURE__ */ e(
2311
+ "td",
1876
2312
  {
1877
- type: "checkbox",
1878
- checked: S,
1879
- onClick: (H) => H.stopPropagation(),
1880
- onChange: () => d(v),
1881
- className: "rounded cursor-pointer accent-[var(--primary)]"
1882
- }
1883
- )
1884
- }
1885
- ),
1886
- pe.map((H, me) => {
1887
- const _ = W && !P && me === 0;
1888
- return /* @__PURE__ */ e(
1889
- "td",
1890
- {
1891
- className: `${T ? "px-2 py-1.5" : "px-3 py-2"} ${gr} ${Fe(H.align)} ${H.className ?? ""}`,
1892
- style: {
1893
- overflow: "hidden",
1894
- whiteSpace: "nowrap",
1895
- ..._ ? {
2313
+ className: `${S ? "px-2 py-1.5" : "px-3 py-2"} w-10`,
2314
+ style: F ? {
1896
2315
  position: "sticky",
1897
- left: Le,
2316
+ left: 0,
1898
2317
  zIndex: 3,
1899
2318
  background: "var(--dt-sticky-bg)",
1900
- boxShadow: "3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -1px 0 var(--border)",
1901
- borderRight: "1px solid var(--border)"
2319
+ boxShadow: "inset 0 -1px 0 var(--border)"
1902
2320
  } : {
1903
2321
  borderBottom: "1px solid var(--border)",
1904
2322
  borderRight: "1px solid var(--border)"
1905
- }
1906
- },
1907
- children: /* @__PURE__ */ e(at, { children: H.cell(i) })
1908
- },
1909
- H.key
1910
- );
1911
- })
1912
- ]
1913
- },
1914
- v
1915
- );
1916
- }) })
1917
- ]
2323
+ },
2324
+ onClick: (Q) => {
2325
+ Q.stopPropagation(), h(C);
2326
+ },
2327
+ children: /* @__PURE__ */ e(
2328
+ "input",
2329
+ {
2330
+ type: "checkbox",
2331
+ checked: z,
2332
+ onClick: (Q) => Q.stopPropagation(),
2333
+ onChange: () => h(C),
2334
+ className: "rounded cursor-pointer accent-[var(--primary)]"
2335
+ }
2336
+ )
2337
+ }
2338
+ ),
2339
+ de.map((Q, Le) => {
2340
+ const re = F && !ee && Le === 0;
2341
+ return /* @__PURE__ */ e(
2342
+ "td",
2343
+ {
2344
+ className: `${S ? "px-2 py-1.5" : "px-3 py-2"} ${Lr} ${nt(Q.align)} ${Q.className ?? ""}`,
2345
+ style: {
2346
+ overflow: "hidden",
2347
+ whiteSpace: "nowrap",
2348
+ ...re ? {
2349
+ position: "sticky",
2350
+ left: oe,
2351
+ zIndex: 3,
2352
+ background: "var(--dt-sticky-bg)",
2353
+ boxShadow: "3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -1px 0 var(--border)",
2354
+ borderRight: "1px solid var(--border)"
2355
+ } : {
2356
+ borderBottom: "1px solid var(--border)",
2357
+ borderRight: "1px solid var(--border)"
2358
+ }
2359
+ },
2360
+ children: /* @__PURE__ */ e(vt, { children: Q.cell(s) })
2361
+ },
2362
+ Q.key
2363
+ );
2364
+ })
2365
+ ]
2366
+ },
2367
+ C
2368
+ );
2369
+ }) })
2370
+ ]
2371
+ }
2372
+ )
1918
2373
  }
1919
2374
  )
1920
2375
  }
1921
- ) }),
1922
- Ue()
2376
+ ),
2377
+ ot()
1923
2378
  ]
1924
2379
  }
1925
2380
  );
1926
2381
  }
1927
- function be(t) {
2382
+ function Ae(t) {
1928
2383
  return t ? /* @__PURE__ */ new Date(`${t}T12:00:00`) : void 0;
1929
2384
  }
1930
- function ot(t) {
2385
+ function gt(t) {
1931
2386
  return t.toISOString().slice(0, 10);
1932
2387
  }
1933
- function vr({
2388
+ function Dr({
1934
2389
  calendarMonth: t,
1935
2390
  displayIndex: r
1936
2391
  }) {
1937
- const { previousMonth: n, nextMonth: a, goToMonth: l, months: u, labels: m, formatters: p } = er(), c = !!n && r === 0, d = !!a && r === u.length - 1;
1938
- return /* @__PURE__ */ s(
2392
+ const { previousMonth: n, nextMonth: a, goToMonth: l, months: u, labels: d, formatters: p } = sr(), m = !!n && r === 0, h = !!a && r === u.length - 1;
2393
+ return /* @__PURE__ */ i(
1939
2394
  "div",
1940
2395
  {
1941
2396
  style: {
@@ -1953,9 +2408,9 @@ function vr({
1953
2408
  "button",
1954
2409
  {
1955
2410
  type: "button",
1956
- "aria-label": m.labelPrevious(n),
2411
+ "aria-label": d.labelPrevious(n),
1957
2412
  onClick: () => n && l(n),
1958
- disabled: !c,
2413
+ disabled: !m,
1959
2414
  style: {
1960
2415
  height: 28,
1961
2416
  width: 28,
@@ -1966,19 +2421,19 @@ function vr({
1966
2421
  alignItems: "center",
1967
2422
  justifyContent: "center",
1968
2423
  color: "var(--text-main)",
1969
- opacity: c ? 1 : 0.45,
1970
- cursor: c ? "pointer" : "not-allowed"
2424
+ opacity: m ? 1 : 0.45,
2425
+ cursor: m ? "pointer" : "not-allowed"
1971
2426
  },
1972
- children: /* @__PURE__ */ e(Se, { size: 16 })
2427
+ children: /* @__PURE__ */ e(_e, { size: 16 })
1973
2428
  }
1974
2429
  ),
1975
2430
  /* @__PURE__ */ e(
1976
2431
  "button",
1977
2432
  {
1978
2433
  type: "button",
1979
- "aria-label": m.labelNext(a),
2434
+ "aria-label": d.labelNext(a),
1980
2435
  onClick: () => a && l(a),
1981
- disabled: !d,
2436
+ disabled: !h,
1982
2437
  style: {
1983
2438
  height: 28,
1984
2439
  width: 28,
@@ -1989,39 +2444,39 @@ function vr({
1989
2444
  alignItems: "center",
1990
2445
  justifyContent: "center",
1991
2446
  color: "var(--text-main)",
1992
- opacity: d ? 1 : 0.45,
1993
- cursor: d ? "pointer" : "not-allowed"
2447
+ opacity: h ? 1 : 0.45,
2448
+ cursor: h ? "pointer" : "not-allowed"
1994
2449
  },
1995
- children: /* @__PURE__ */ e(xe, { size: 16 })
2450
+ children: /* @__PURE__ */ e(Te, { size: 16 })
1996
2451
  }
1997
2452
  )
1998
2453
  ]
1999
2454
  }
2000
2455
  );
2001
2456
  }
2002
- function yr(t) {
2457
+ function Ir(t) {
2003
2458
  return t.charAt(0).toUpperCase() + t.slice(1);
2004
2459
  }
2005
- function on({
2460
+ function kn({
2006
2461
  startDate: t,
2007
2462
  endDate: r,
2008
2463
  onChange: n,
2009
2464
  minDate: a,
2010
2465
  viewMonth: l,
2011
2466
  numberOfMonths: u = 1,
2012
- showSummary: m = !0,
2467
+ showSummary: d = !0,
2013
2468
  startLabel: p = "Inicio",
2014
- endLabel: c = "Regreso"
2469
+ endLabel: m = "Regreso"
2015
2470
  }) {
2016
- const d = {
2017
- from: be(t),
2018
- to: be(r)
2019
- }, y = be(a), [C, w] = E(
2020
- be(l || t)
2471
+ const h = {
2472
+ from: Ae(t),
2473
+ to: Ae(r)
2474
+ }, w = Ae(a), [N, g] = B(
2475
+ Ae(l || t)
2021
2476
  );
2022
- return R(() => {
2023
- w(be(l || t));
2024
- }, [l, t]), /* @__PURE__ */ s("div", { children: [
2477
+ return O(() => {
2478
+ g(Ae(l || t));
2479
+ }, [l, t]), /* @__PURE__ */ i("div", { children: [
2025
2480
  /* @__PURE__ */ e(
2026
2481
  "div",
2027
2482
  {
@@ -2035,22 +2490,22 @@ function on({
2035
2490
  padding: "10px 8px"
2036
2491
  },
2037
2492
  children: /* @__PURE__ */ e(
2038
- Qt,
2493
+ ir,
2039
2494
  {
2040
2495
  mode: "range",
2041
- selected: d,
2042
- month: C,
2043
- onMonthChange: w,
2496
+ selected: h,
2497
+ month: N,
2498
+ onMonthChange: g,
2044
2499
  onSelect: (f) => {
2045
- const g = f != null && f.from ? ot(f.from) : t, b = f != null && f.to ? ot(f.to) : "";
2046
- n({ startDate: g, endDate: b });
2500
+ const v = f != null && f.from ? gt(f.from) : t, c = f != null && f.to ? gt(f.to) : "";
2501
+ n({ startDate: v, endDate: c });
2047
2502
  },
2048
2503
  numberOfMonths: u,
2049
2504
  hideNavigation: !0,
2050
- disabled: y ? { before: y } : void 0,
2505
+ disabled: w ? { before: w } : void 0,
2051
2506
  showOutsideDays: !1,
2052
2507
  components: {
2053
- MonthCaption: vr
2508
+ MonthCaption: Dr
2054
2509
  },
2055
2510
  className: "text-sm",
2056
2511
  classNames: {
@@ -2142,7 +2597,7 @@ function on({
2142
2597
  }
2143
2598
  },
2144
2599
  formatters: {
2145
- formatCaption: (f) => yr(
2600
+ formatCaption: (f) => Ir(
2146
2601
  new Intl.DateTimeFormat("es-MX", {
2147
2602
  month: "long",
2148
2603
  year: "numeric"
@@ -2160,7 +2615,7 @@ function on({
2160
2615
  )
2161
2616
  }
2162
2617
  ),
2163
- m && t && /* @__PURE__ */ s(
2618
+ d && t && /* @__PURE__ */ i(
2164
2619
  "div",
2165
2620
  {
2166
2621
  style: {
@@ -2172,14 +2627,14 @@ function on({
2172
2627
  flexWrap: "wrap"
2173
2628
  },
2174
2629
  children: [
2175
- /* @__PURE__ */ s("span", { children: [
2630
+ /* @__PURE__ */ i("span", { children: [
2176
2631
  p,
2177
2632
  ":",
2178
2633
  " ",
2179
2634
  /* @__PURE__ */ e("strong", { style: { color: "var(--text-main)" }, children: t })
2180
2635
  ] }),
2181
- r && /* @__PURE__ */ s("span", { children: [
2182
- c,
2636
+ r && /* @__PURE__ */ i("span", { children: [
2637
+ m,
2183
2638
  ":",
2184
2639
  " ",
2185
2640
  /* @__PURE__ */ e("strong", { style: { color: "var(--text-main)" }, children: r })
@@ -2189,34 +2644,34 @@ function on({
2189
2644
  )
2190
2645
  ] });
2191
2646
  }
2192
- function sn({
2647
+ function Sn({
2193
2648
  open: t,
2194
2649
  onClose: r,
2195
2650
  title: n,
2196
2651
  subtitle: a,
2197
2652
  leadingIcon: l,
2198
2653
  confirmLabel: u = "Guardar",
2199
- onConfirm: m,
2654
+ onConfirm: d,
2200
2655
  loading: p = !1,
2201
- confirmDisabled: c = !1,
2202
- headerActions: d,
2203
- bodyClassName: y = "flex-1 overflow-y-auto px-6 py-5",
2204
- width: C = 440,
2205
- children: w
2656
+ confirmDisabled: m = !1,
2657
+ headerActions: h,
2658
+ bodyClassName: w = "flex-1 overflow-y-auto px-6 py-5",
2659
+ width: N = 440,
2660
+ children: g
2206
2661
  }) {
2207
- const [f, g] = E(!1);
2208
- return R(() => {
2209
- g(!0);
2210
- }, []), R(() => (document.body.style.overflow = t ? "hidden" : "", () => {
2662
+ const [f, v] = B(!1);
2663
+ return O(() => {
2664
+ v(!0);
2665
+ }, []), O(() => (document.body.style.overflow = t ? "hidden" : "", () => {
2211
2666
  document.body.style.overflow = "";
2212
- }), [t]), R(() => {
2667
+ }), [t]), O(() => {
2213
2668
  if (!t) return;
2214
- const b = (N) => {
2215
- N.key === "Escape" && r();
2669
+ const c = ($) => {
2670
+ $.key === "Escape" && r();
2216
2671
  };
2217
- return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
2218
- }, [t, r]), f ? Ee(
2219
- /* @__PURE__ */ s(
2672
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
2673
+ }, [t, r]), f ? Ge(
2674
+ /* @__PURE__ */ i(
2220
2675
  "div",
2221
2676
  {
2222
2677
  "aria-hidden": !t,
@@ -2229,26 +2684,26 @@ function sn({
2229
2684
  onClick: r
2230
2685
  }
2231
2686
  ),
2232
- /* @__PURE__ */ s(
2687
+ /* @__PURE__ */ i(
2233
2688
  "div",
2234
2689
  {
2235
2690
  className: `absolute inset-y-0 right-0 flex flex-col shadow-2xl transition-transform duration-300 ${t ? "translate-x-0" : "translate-x-full"}`,
2236
2691
  style: {
2237
- width: `min(100vw, ${C}px)`,
2692
+ width: `min(100vw, ${N}px)`,
2238
2693
  background: "var(--bg-card)",
2239
2694
  borderLeft: "1px solid var(--border)"
2240
2695
  },
2241
2696
  children: [
2242
- /* @__PURE__ */ s(
2697
+ /* @__PURE__ */ i(
2243
2698
  "div",
2244
2699
  {
2245
2700
  className: "flex items-center justify-between px-6 py-4 flex-shrink-0",
2246
2701
  style: { borderBottom: "1px solid var(--border)" },
2247
2702
  children: [
2248
- /* @__PURE__ */ s("div", { className: "flex items-center gap-3 min-w-0", children: [
2249
- /* @__PURE__ */ e(ne, { variant: "icon", onClick: r, title: "Cerrar", children: /* @__PURE__ */ e(ce, { className: "w-5 h-5" }) }),
2703
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3 min-w-0", children: [
2704
+ /* @__PURE__ */ e(he, { variant: "icon", onClick: r, title: "Cerrar", children: /* @__PURE__ */ e(Se, { className: "w-5 h-5" }) }),
2250
2705
  l && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: l }),
2251
- /* @__PURE__ */ s("div", { className: "min-w-0", children: [
2706
+ /* @__PURE__ */ i("div", { className: "min-w-0", children: [
2252
2707
  /* @__PURE__ */ e(
2253
2708
  "h3",
2254
2709
  {
@@ -2267,11 +2722,11 @@ function sn({
2267
2722
  )
2268
2723
  ] })
2269
2724
  ] }),
2270
- (d || m) && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
2271
- d,
2272
- m && /* @__PURE__ */ s(le, { children: [
2725
+ (h || d) && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
2726
+ h,
2727
+ d && /* @__PURE__ */ i(we, { children: [
2273
2728
  /* @__PURE__ */ e(
2274
- ne,
2729
+ he,
2275
2730
  {
2276
2731
  variant: "secondary",
2277
2732
  size: "sm",
@@ -2281,14 +2736,14 @@ function sn({
2281
2736
  }
2282
2737
  ),
2283
2738
  /* @__PURE__ */ e(
2284
- ne,
2739
+ he,
2285
2740
  {
2286
2741
  variant: "primary",
2287
2742
  size: "sm",
2288
- icon: /* @__PURE__ */ e(tr, { className: "w-4 h-4" }),
2289
- onClick: m,
2743
+ icon: /* @__PURE__ */ e(lr, { className: "w-4 h-4" }),
2744
+ onClick: d,
2290
2745
  loading: p,
2291
- disabled: c,
2746
+ disabled: m,
2292
2747
  title: u
2293
2748
  }
2294
2749
  )
@@ -2297,7 +2752,7 @@ function sn({
2297
2752
  ]
2298
2753
  }
2299
2754
  ),
2300
- /* @__PURE__ */ e("div", { "data-drawer-scroll": "true", className: y, children: w })
2755
+ /* @__PURE__ */ e("div", { "data-drawer-scroll": "true", className: w, children: g })
2301
2756
  ]
2302
2757
  }
2303
2758
  )
@@ -2307,7 +2762,7 @@ function sn({
2307
2762
  document.body
2308
2763
  ) : null;
2309
2764
  }
2310
- function it({
2765
+ function yt({
2311
2766
  className: t = "",
2312
2767
  ...r
2313
2768
  }) {
@@ -2319,55 +2774,55 @@ function it({
2319
2774
  }
2320
2775
  );
2321
2776
  }
2322
- function ln({
2777
+ function Cn({
2323
2778
  label: t,
2324
2779
  containerClassName: r = "",
2325
2780
  helperText: n,
2326
2781
  error: a,
2327
2782
  labelAction: l,
2328
2783
  floatingLabel: u = !1,
2329
- showPasswordToggle: m = !0,
2784
+ showPasswordToggle: d = !0,
2330
2785
  className: p = "",
2331
- required: c,
2332
- ...d
2786
+ required: m,
2787
+ ...h
2333
2788
  }) {
2334
- const [y, C] = E(() => !!d.autoFocus), [w, f] = E(!1), g = d.type === "password" && m, b = g && w ? "text" : d.type, N = d.value !== void 0 ? String(d.value).length > 0 : d.defaultValue !== void 0 && String(d.defaultValue).length > 0, L = y || N, X = {
2335
- top: L ? 8 : 15,
2336
- color: y ? "var(--primary)" : "var(--text-muted)",
2337
- fontSize: L ? 11 : 14,
2338
- fontWeight: L ? 600 : 400,
2339
- textTransform: L ? "uppercase" : "none"
2340
- }, Y = (M) => {
2341
- var $;
2342
- C(!0), ($ = d.onFocus) == null || $.call(d, M);
2343
- }, k = (M) => {
2344
- var $;
2345
- C(!1), ($ = d.onBlur) == null || $.call(d, M);
2789
+ const [w, N] = B(() => !!h.autoFocus), [g, f] = B(!1), v = h.type === "password" && d, c = v && g ? "text" : h.type, $ = h.value !== void 0 ? String(h.value).length > 0 : h.defaultValue !== void 0 && String(h.defaultValue).length > 0, D = w || $, K = {
2790
+ top: D ? 8 : 15,
2791
+ color: w ? "var(--primary)" : "var(--text-muted)",
2792
+ fontSize: D ? 11 : 14,
2793
+ fontWeight: D ? 600 : 400,
2794
+ textTransform: D ? "uppercase" : "none"
2795
+ }, W = (T) => {
2796
+ var I;
2797
+ N(!0), (I = h.onFocus) == null || I.call(h, T);
2798
+ }, E = (T) => {
2799
+ var I;
2800
+ N(!1), (I = h.onBlur) == null || I.call(h, T);
2346
2801
  };
2347
- return u ? /* @__PURE__ */ s("label", { className: `flex flex-col gap-2 ${r}`, children: [
2348
- /* @__PURE__ */ s("span", { className: "relative block", children: [
2802
+ return u ? /* @__PURE__ */ i("label", { className: `flex flex-col gap-2 ${r}`, children: [
2803
+ /* @__PURE__ */ i("span", { className: "relative block", children: [
2349
2804
  /* @__PURE__ */ e(
2350
- it,
2805
+ yt,
2351
2806
  {
2352
- ...d,
2353
- type: b,
2354
- required: c,
2807
+ ...h,
2808
+ type: c,
2809
+ required: m,
2355
2810
  placeholder: " ",
2356
- "aria-invalid": !!a || d["aria-invalid"],
2357
- "data-has-value": N ? "true" : void 0,
2358
- className: `h-12 w-full pt-5 ${g ? "pr-10" : ""} ${p}`,
2359
- onFocus: Y,
2360
- onBlur: k
2811
+ "aria-invalid": !!a || h["aria-invalid"],
2812
+ "data-has-value": $ ? "true" : void 0,
2813
+ className: `h-12 w-full pt-5 ${v ? "pr-10" : ""} ${p}`,
2814
+ onFocus: W,
2815
+ onBlur: E
2361
2816
  }
2362
2817
  ),
2363
- /* @__PURE__ */ s(
2818
+ /* @__PURE__ */ i(
2364
2819
  "span",
2365
2820
  {
2366
2821
  className: "pointer-events-none absolute left-3 transition-all duration-150",
2367
- style: X,
2822
+ style: K,
2368
2823
  children: [
2369
2824
  t,
2370
- c && /* @__PURE__ */ e("span", { className: "ml-1 text-[var(--danger)]", children: "*" })
2825
+ m && /* @__PURE__ */ e("span", { className: "ml-1 text-[var(--danger)]", children: "*" })
2371
2826
  ]
2372
2827
  }
2373
2828
  ),
@@ -2375,135 +2830,284 @@ function ln({
2375
2830
  "span",
2376
2831
  {
2377
2832
  className: "absolute right-2 transition-all duration-150",
2378
- style: { top: L ? 8 : 15 },
2833
+ style: { top: D ? 8 : 15 },
2379
2834
  children: l
2380
2835
  }
2381
2836
  ),
2382
- g && /* @__PURE__ */ e(
2837
+ v && /* @__PURE__ */ e(
2383
2838
  "button",
2384
2839
  {
2385
2840
  type: "button",
2386
- "aria-label": w ? "Ocultar contraseña" : "Mostrar contraseña",
2841
+ "aria-label": g ? "Ocultar contraseña" : "Mostrar contraseña",
2387
2842
  className: "absolute right-3 top-1/2 -translate-y-1/2 transition-colors",
2388
2843
  style: { color: "var(--text-muted)" },
2389
2844
  tabIndex: -1,
2390
- onClick: () => f((M) => !M),
2391
- children: w ? /* @__PURE__ */ e(Ht, { className: "h-[18px] w-[18px]" }) : /* @__PURE__ */ e(Wt, { className: "h-[18px] w-[18px]" })
2845
+ onClick: () => f((T) => !T),
2846
+ children: g ? /* @__PURE__ */ e(Ft, { className: "h-[18px] w-[18px]" }) : /* @__PURE__ */ e(Ut, { className: "h-[18px] w-[18px]" })
2392
2847
  }
2393
2848
  )
2394
2849
  ] }),
2395
2850
  a ? /* @__PURE__ */ e("span", { className: "text-xs font-medium normal-case text-[var(--danger)]", children: a }) : n ? /* @__PURE__ */ e("span", { className: "text-xs font-medium normal-case text-[var(--text-muted)]", children: n }) : null
2396
- ] }) : /* @__PURE__ */ s("label", { className: `flex flex-col gap-2 ${r}`, children: [
2397
- /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]", children: [
2851
+ ] }) : /* @__PURE__ */ i("label", { className: `flex flex-col gap-2 ${r}`, children: [
2852
+ /* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]", children: [
2398
2853
  /* @__PURE__ */ e("span", { children: t }),
2399
- c && /* @__PURE__ */ e("span", { className: "text-[var(--danger)]", children: "*" }),
2854
+ m && /* @__PURE__ */ e("span", { className: "text-[var(--danger)]", children: "*" }),
2400
2855
  l && /* @__PURE__ */ e("span", { className: "ml-auto normal-case", children: l })
2401
2856
  ] }),
2402
2857
  /* @__PURE__ */ e(
2403
- it,
2858
+ yt,
2404
2859
  {
2405
- ...d,
2406
- required: c,
2407
- "aria-invalid": !!a || d["aria-invalid"],
2860
+ ...h,
2861
+ required: m,
2862
+ "aria-invalid": !!a || h["aria-invalid"],
2408
2863
  className: p
2409
2864
  }
2410
2865
  ),
2411
2866
  a ? /* @__PURE__ */ e("span", { className: "text-xs font-medium normal-case text-[var(--danger)]", children: a }) : n ? /* @__PURE__ */ e("span", { className: "text-xs font-medium normal-case text-[var(--text-muted)]", children: n }) : null
2412
2867
  ] });
2413
2868
  }
2414
- function cn({
2415
- variant: t = "page",
2416
- title: r = "Cargando...",
2417
- rows: n = 6,
2418
- children: a
2419
- }) {
2420
- return t === "table" ? /* @__PURE__ */ e(bt, { rows: n }) : t === "sections" ? /* @__PURE__ */ e(wr, { rows: n }) : t === "cards" ? /* @__PURE__ */ e(Nr, { rows: n }) : /* @__PURE__ */ e("div", { className: "flex min-h-[240px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-3 text-center", children: [
2421
- /* @__PURE__ */ e("div", { className: "h-9 w-9 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--primary)]" }),
2422
- /* @__PURE__ */ s("div", { children: [
2423
- /* @__PURE__ */ e("p", { className: "text-sm font-semibold text-[var(--text-main)]", children: r }),
2424
- a && /* @__PURE__ */ e("div", { className: "mt-1 text-xs text-[var(--text-muted)]", children: a })
2425
- ] })
2426
- ] }) });
2427
- }
2428
- function wr({ rows: t }) {
2429
- return /* @__PURE__ */ e("div", { className: "space-y-4", children: Array.from({ length: Math.max(2, Math.min(t, 4)) }).map(
2430
- (r, n) => /* @__PURE__ */ s(
2431
- "section",
2432
- {
2433
- className: "overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",
2434
- children: [
2435
- /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--border)] px-3 py-3", children: [
2436
- /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
2437
- /* @__PURE__ */ e("div", { className: "h-4 w-4 animate-pulse rounded bg-[var(--bg-input)]" }),
2438
- /* @__PURE__ */ e("div", { className: "h-4 w-32 animate-pulse rounded bg-[var(--bg-input)]" }),
2439
- /* @__PURE__ */ e("div", { className: "h-5 w-20 animate-pulse rounded-full bg-[var(--bg-input)]" })
2440
- ] }),
2441
- /* @__PURE__ */ s("div", { className: "flex gap-1", children: [
2442
- /* @__PURE__ */ e("div", { className: "h-8 w-8 animate-pulse rounded-md bg-[var(--bg-input)]" }),
2443
- /* @__PURE__ */ e("div", { className: "h-8 w-8 animate-pulse rounded-md bg-[var(--bg-input)]" })
2444
- ] })
2445
- ] }),
2446
- /* @__PURE__ */ e(
2447
- bt,
2448
- {
2449
- rows: n === 0 ? t : Math.max(3, t - 2),
2450
- compact: !0
2451
- }
2452
- )
2453
- ]
2454
- },
2455
- n
2456
- )
2457
- ) });
2869
+ function ke(...t) {
2870
+ return t.filter(Boolean).join(" ");
2458
2871
  }
2459
- function Nr({ rows: t }) {
2460
- return /* @__PURE__ */ e("div", { className: "grid gap-3 md:grid-cols-2 xl:grid-cols-3", children: Array.from({ length: t }).map((r, n) => /* @__PURE__ */ s(
2461
- "div",
2872
+ function $n({
2873
+ steps: t,
2874
+ activeStepId: r,
2875
+ initialStepId: n,
2876
+ completedStepIds: a,
2877
+ defaultCompletedStepIds: l = [],
2878
+ onActiveStepChange: u,
2879
+ onCompletedStepIdsChange: d,
2880
+ onBlockedStep: p,
2881
+ allowBackNavigation: m = !0,
2882
+ showFooter: h = !0,
2883
+ previousLabel: w = "Anterior",
2884
+ nextLabel: N = "Siguiente",
2885
+ blockedNextLabel: g = "Completa este paso",
2886
+ className: f = "",
2887
+ headerClassName: v = "",
2888
+ contentClassName: c = "",
2889
+ footerClassName: $ = ""
2890
+ }) {
2891
+ var de;
2892
+ const D = ((de = t[0]) == null ? void 0 : de.id) ?? "", [K, W] = B(
2893
+ n ?? D
2894
+ ), [E, T] = B(
2895
+ l
2896
+ ), I = r ?? K, L = a ?? E, F = Oe(
2897
+ () => new Set(L),
2898
+ [L]
2899
+ ), M = Math.max(
2900
+ 0,
2901
+ t.findIndex((k) => k.id === I)
2902
+ ), S = t[M] ?? t[0], P = t.length <= 1 ? 100 : M / (t.length - 1) * 100, J = (k) => {
2903
+ a || T(k), d == null || d(k);
2904
+ }, _ = (k) => {
2905
+ const A = t.find((X) => X.id === k);
2906
+ A && (r || W(k), u == null || u(k, A));
2907
+ }, j = (k) => F.has(k), U = (k) => t.slice(0, k).find((A) => !A.optional && !F.has(A.id)), Z = (k) => {
2908
+ const A = t[k];
2909
+ return !A || A.disabled ? !1 : k === M || m && k < M ? !0 : !U(k);
2910
+ }, o = (k) => {
2911
+ const A = t.findIndex((X) => X.id === k);
2912
+ return A >= 0 && Z(A);
2913
+ }, y = (k) => {
2914
+ const A = t.findIndex((X) => X.id === k);
2915
+ if (A < 0) return !1;
2916
+ if (!Z(A)) {
2917
+ const X = U(A);
2918
+ return X && (p == null || p(t[A], X)), !1;
2919
+ }
2920
+ return _(k), !0;
2921
+ }, H = (k = S == null ? void 0 : S.id) => {
2922
+ !k || F.has(k) || J([...L, k]);
2923
+ }, q = (k = S == null ? void 0 : S.id) => {
2924
+ if (!k) return;
2925
+ const A = t.findIndex((ne) => ne.id === k), X = L.filter((ne) => {
2926
+ const ce = t.findIndex((R) => R.id === ne);
2927
+ return ce >= 0 && ce < A;
2928
+ });
2929
+ J(X), A >= 0 && M > A && _(k);
2930
+ }, G = () => M <= 0 ? !1 : y(t[M - 1].id), ee = () => {
2931
+ const k = t[M + 1];
2932
+ return k ? y(k.id) : !1;
2933
+ }, me = {
2934
+ activeStep: S,
2935
+ activeIndex: M,
2936
+ completedStepIds: L,
2937
+ isCompleted: j,
2938
+ isUnlocked: o,
2939
+ completeStep: H,
2940
+ uncompleteStep: q,
2941
+ goToStep: y,
2942
+ goNext: ee,
2943
+ goPrevious: G
2944
+ };
2945
+ if (!S) return null;
2946
+ const te = t[M + 1], be = M > 0, fe = te ? o(te.id) : !1, ve = typeof S.content == "function" ? S.content(me) : S.content;
2947
+ return /* @__PURE__ */ i(
2948
+ "section",
2462
2949
  {
2463
- className: "rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4",
2950
+ className: ke(
2951
+ "overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",
2952
+ f
2953
+ ),
2464
2954
  children: [
2465
- /* @__PURE__ */ e("div", { className: "h-4 w-2/3 animate-pulse rounded bg-[var(--bg-input)]" }),
2466
- /* @__PURE__ */ e("div", { className: "mt-3 h-3 w-full animate-pulse rounded bg-[var(--bg-input)]" }),
2467
- /* @__PURE__ */ e("div", { className: "mt-2 h-3 w-4/5 animate-pulse rounded bg-[var(--bg-input)]" })
2468
- ]
2469
- },
2470
- n
2471
- )) });
2472
- }
2473
- function bt({
2474
- rows: t,
2475
- compact: r = !1
2476
- }) {
2477
- const n = r ? 5 : 6;
2478
- return /* @__PURE__ */ s("div", { className: "overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]", children: [
2479
- /* @__PURE__ */ e(
2480
- "div",
2481
- {
2482
- className: "grid border-b border-[var(--border)]",
2483
- style: { gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` },
2484
- children: Array.from({ length: n }).map((a, l) => /* @__PURE__ */ e("div", { className: "px-3 py-3", children: /* @__PURE__ */ e("div", { className: "h-3 w-2/3 animate-pulse rounded bg-[var(--bg-input)]" }) }, l))
2485
- }
2486
- ),
2487
- Array.from({ length: t }).map((a, l) => /* @__PURE__ */ e(
2488
- "div",
2489
- {
2490
- className: "grid border-b border-[var(--border)] last:border-b-0",
2491
- style: { gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` },
2492
- children: Array.from({ length: n }).map((u, m) => /* @__PURE__ */ e("div", { className: "px-3 py-3", children: /* @__PURE__ */ e(
2955
+ /* @__PURE__ */ i(
2493
2956
  "div",
2494
2957
  {
2495
- className: "h-3.5 animate-pulse rounded-full bg-[var(--bg-input)]",
2496
- style: {
2497
- width: `${52 + (l * 13 + m * 11) % 36}%`
2498
- }
2958
+ className: ke(
2959
+ "border-b border-[var(--border)] bg-[var(--bg-input)]",
2960
+ v
2961
+ ),
2962
+ children: [
2963
+ /* @__PURE__ */ e("div", { className: "relative h-1 overflow-hidden bg-[var(--border)]/55", children: /* @__PURE__ */ e(
2964
+ "div",
2965
+ {
2966
+ className: "h-full rounded-r-full bg-[var(--primary)] transition-[width] duration-500 ease-out",
2967
+ style: { width: `${P}%` }
2968
+ }
2969
+ ) }),
2970
+ /* @__PURE__ */ e(
2971
+ "div",
2972
+ {
2973
+ className: "grid gap-2 p-2",
2974
+ style: {
2975
+ gridTemplateColumns: `repeat(${t.length}, minmax(0, 1fr))`
2976
+ },
2977
+ children: t.map((k, A) => {
2978
+ const X = k.id === S.id, ne = j(k.id), ce = Z(A), R = U(A);
2979
+ return /* @__PURE__ */ i(
2980
+ "button",
2981
+ {
2982
+ type: "button",
2983
+ disabled: !ce,
2984
+ "aria-current": X ? "step" : void 0,
2985
+ "aria-disabled": !ce,
2986
+ title: !ce && R ? `Completa ${R.title}` : k.title,
2987
+ onClick: () => y(k.id),
2988
+ className: ke(
2989
+ "group relative min-h-16 min-w-0 overflow-hidden rounded-md border p-3 text-left transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/35 disabled:cursor-not-allowed",
2990
+ X && "border-[var(--primary)] bg-[var(--bg-card)] shadow-sm",
2991
+ ne && !X && "border-[var(--primary)]/35 bg-[var(--bg-card)]",
2992
+ !X && !ne && ce && "border-transparent bg-[var(--bg-card)]/45 hover:border-[var(--border)] hover:bg-[var(--bg-card)]",
2993
+ !ce && "border-transparent bg-[var(--bg-card)]/35 opacity-60"
2994
+ ),
2995
+ children: [
2996
+ /* @__PURE__ */ e(
2997
+ "span",
2998
+ {
2999
+ className: ke(
3000
+ "absolute inset-x-0 top-0 h-0.5 origin-left scale-x-0 bg-[var(--primary)] transition-transform duration-300",
3001
+ X && "scale-x-100"
3002
+ )
3003
+ }
3004
+ ),
3005
+ /* @__PURE__ */ i("span", { className: "flex min-w-0 items-center gap-2", children: [
3006
+ /* @__PURE__ */ e(
3007
+ "span",
3008
+ {
3009
+ className: ke(
3010
+ "grid h-7 w-7 shrink-0 place-items-center rounded-full border text-xs font-bold transition-all duration-200",
3011
+ X && "border-[var(--primary)] bg-[var(--primary)] text-[var(--primary-fg)]",
3012
+ ne && !X && "border-[var(--primary)] bg-[var(--primary)]/12 text-[var(--primary)]",
3013
+ !ne && !X && ce && "border-[var(--border)] text-[var(--text-muted)]",
3014
+ !ce && "border-[var(--border)] text-[var(--text-muted)]"
3015
+ ),
3016
+ children: ne ? /* @__PURE__ */ e(qt, { className: "h-4 w-4" }) : ce ? A + 1 : /* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" })
3017
+ }
3018
+ ),
3019
+ /* @__PURE__ */ i("span", { className: "min-w-0 flex-1", children: [
3020
+ /* @__PURE__ */ i(
3021
+ "span",
3022
+ {
3023
+ className: ke(
3024
+ "block truncate text-xs font-semibold transition-colors duration-200",
3025
+ X ? "text-[var(--text-main)]" : "text-[var(--text-secondary)]"
3026
+ ),
3027
+ children: [
3028
+ A + 1,
3029
+ ". ",
3030
+ k.title
3031
+ ]
3032
+ }
3033
+ ),
3034
+ k.description && /* @__PURE__ */ e("span", { className: "mt-1 block truncate text-[11px] text-[var(--text-muted)]", children: k.description })
3035
+ ] }),
3036
+ k.badge && /* @__PURE__ */ e("span", { className: "shrink-0", children: k.badge })
3037
+ ] })
3038
+ ]
3039
+ },
3040
+ k.id
3041
+ );
3042
+ })
3043
+ }
3044
+ )
3045
+ ]
2499
3046
  }
2500
- ) }, m))
2501
- },
2502
- l
2503
- ))
2504
- ] });
3047
+ ),
3048
+ /* @__PURE__ */ e(
3049
+ "div",
3050
+ {
3051
+ className: ke(
3052
+ "min-h-72 animate-[stepWizardIn_220ms_ease-out] p-5",
3053
+ c
3054
+ ),
3055
+ children: ve
3056
+ },
3057
+ S.id
3058
+ ),
3059
+ h && /* @__PURE__ */ i(
3060
+ "div",
3061
+ {
3062
+ className: ke(
3063
+ "flex flex-wrap items-center justify-between gap-3 border-t border-[var(--border)] bg-[var(--bg-input)] px-4 py-3",
3064
+ $
3065
+ ),
3066
+ children: [
3067
+ /* @__PURE__ */ e(
3068
+ he,
3069
+ {
3070
+ variant: "secondary",
3071
+ height: 38,
3072
+ padding: "0 14px",
3073
+ icon: /* @__PURE__ */ e(_e, {}),
3074
+ disabled: !be,
3075
+ onClick: G,
3076
+ children: w
3077
+ }
3078
+ ),
3079
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3 text-xs text-[var(--text-muted)]", children: [
3080
+ /* @__PURE__ */ i("span", { children: [
3081
+ "Paso ",
3082
+ M + 1,
3083
+ " de ",
3084
+ t.length
3085
+ ] }),
3086
+ /* @__PURE__ */ e("span", { className: "h-1 w-1 rounded-full bg-[var(--border)]" }),
3087
+ /* @__PURE__ */ i("span", { children: [
3088
+ L.length,
3089
+ " completados"
3090
+ ] })
3091
+ ] }),
3092
+ /* @__PURE__ */ e(
3093
+ he,
3094
+ {
3095
+ height: 38,
3096
+ padding: "0 14px",
3097
+ icon: /* @__PURE__ */ e(Te, {}),
3098
+ disabled: !te || !fe,
3099
+ onClick: ee,
3100
+ children: te && !fe ? g : N
3101
+ }
3102
+ )
3103
+ ]
3104
+ }
3105
+ )
3106
+ ]
3107
+ }
3108
+ );
2505
3109
  }
2506
- const kr = {
3110
+ const Rr = {
2507
3111
  xs: {
2508
3112
  width: 28,
2509
3113
  height: 16,
@@ -2517,7 +3121,7 @@ const kr = {
2517
3121
  padding: 2
2518
3122
  }
2519
3123
  };
2520
- function dn({
3124
+ function En({
2521
3125
  checked: t,
2522
3126
  disabled: r,
2523
3127
  onCheckedChange: n,
@@ -2525,7 +3129,7 @@ function dn({
2525
3129
  className: l = "",
2526
3130
  ...u
2527
3131
  }) {
2528
- const m = kr[a], p = t ? m.width - m.thumb - m.padding * 2 : 0;
3132
+ const d = Rr[a], p = t ? d.width - d.thumb - d.padding * 2 : 0;
2529
3133
  return /* @__PURE__ */ e(
2530
3134
  "button",
2531
3135
  {
@@ -2537,8 +3141,8 @@ function dn({
2537
3141
  onClick: () => !r && n(!t),
2538
3142
  className: `relative inline-flex shrink-0 items-center rounded-full transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/50 disabled:cursor-not-allowed disabled:opacity-50 ${l}`,
2539
3143
  style: {
2540
- width: m.width,
2541
- height: m.height,
3144
+ width: d.width,
3145
+ height: d.height,
2542
3146
  background: t ? "color-mix(in srgb, var(--primary) 85%, transparent)" : "var(--bg-input)",
2543
3147
  border: t ? "1px solid color-mix(in srgb, var(--primary) 55%, transparent)" : "1px solid var(--border)"
2544
3148
  },
@@ -2547,9 +3151,9 @@ function dn({
2547
3151
  {
2548
3152
  className: "absolute inline-block rounded-full transition-transform",
2549
3153
  style: {
2550
- width: m.thumb,
2551
- height: m.thumb,
2552
- left: m.padding,
3154
+ width: d.thumb,
3155
+ height: d.thumb,
3156
+ left: d.padding,
2553
3157
  top: "50%",
2554
3158
  transform: `translate(${p}px, -50%)`,
2555
3159
  background: t ? "var(--primary-fg)" : "var(--text-muted)"
@@ -2559,11 +3163,11 @@ function dn({
2559
3163
  }
2560
3164
  );
2561
3165
  }
2562
- const st = [
3166
+ const wt = [
2563
3167
  ".sidebar-scroll",
2564
3168
  "[data-overlay-scroll='true']"
2565
3169
  ].join(",");
2566
- function Sr(t) {
3170
+ function zr(t) {
2567
3171
  if (!(t instanceof HTMLElement) || t.dataset.overlayScroll === "false" || t.closest("[data-overlayscrollbars]") || t.matches("textarea,input,select,[contenteditable='true']"))
2568
3172
  return !1;
2569
3173
  const r = window.getComputedStyle(t);
@@ -2573,33 +3177,33 @@ function Sr(t) {
2573
3177
  r.overflowY
2574
3178
  ].join(" ").match(/auto|scroll/) || t.clientWidth === 0 && t.clientHeight === 0);
2575
3179
  }
2576
- function gt(t) {
3180
+ function It(t) {
2577
3181
  return t.classList.contains("sidebar-scroll");
2578
3182
  }
2579
- function lt(t) {
2580
- gt(t) && t.querySelectorAll(".os-scrollbar-horizontal").forEach((r) => {
3183
+ function Nt(t) {
3184
+ It(t) && t.querySelectorAll(".os-scrollbar-horizontal").forEach((r) => {
2581
3185
  r.style.display = "none", r.style.height = "0", r.style.pointerEvents = "none";
2582
3186
  });
2583
3187
  }
2584
- function Cr() {
2585
- return R(() => {
3188
+ function Ar() {
3189
+ return O(() => {
2586
3190
  const t = /* @__PURE__ */ new WeakMap();
2587
3191
  let r = 0;
2588
3192
  const n = () => {
2589
- r = 0, document.querySelectorAll(st).forEach((u) => {
2590
- if (!Sr(u)) return;
2591
- if (et(u)) {
2592
- lt(u);
3193
+ r = 0, document.querySelectorAll(wt).forEach((u) => {
3194
+ if (!zr(u)) return;
3195
+ if (ft(u)) {
3196
+ Nt(u);
2593
3197
  return;
2594
3198
  }
2595
- const p = et(u, {
2596
- overflow: gt(u) ? { x: "hidden", y: "scroll" } : void 0,
3199
+ const p = ft(u, {
3200
+ overflow: It(u) ? { x: "hidden", y: "scroll" } : void 0,
2597
3201
  scrollbars: {
2598
3202
  autoHide: "leave",
2599
3203
  autoHideDelay: 180
2600
3204
  }
2601
3205
  });
2602
- lt(u), t.set(u, p);
3206
+ Nt(u), t.set(u, p);
2603
3207
  });
2604
3208
  }, a = () => {
2605
3209
  r || (r = window.requestAnimationFrame(n));
@@ -2612,100 +3216,194 @@ function Cr() {
2612
3216
  attributes: !0,
2613
3217
  attributeFilter: ["class", "data-overlay-scroll"]
2614
3218
  }), window.addEventListener("resize", a), () => {
2615
- r && window.cancelAnimationFrame(r), l.disconnect(), window.removeEventListener("resize", a), document.querySelectorAll(st).forEach((u) => {
2616
- var m;
2617
- u instanceof HTMLElement && ((m = t.get(u)) == null || m.destroy());
3219
+ r && window.cancelAnimationFrame(r), l.disconnect(), window.removeEventListener("resize", a), document.querySelectorAll(wt).forEach((u) => {
3220
+ var d;
3221
+ u instanceof HTMLElement && ((d = t.get(u)) == null || d.destroy());
2618
3222
  });
2619
3223
  };
2620
3224
  }, []), null;
2621
3225
  }
2622
- const Er = {
3226
+ const Or = {
2623
3227
  xs: { wh: "w-5 h-5", text: "text-[8px]" },
2624
3228
  sm: { wh: "w-7 h-7", text: "text-[11px]" },
2625
3229
  md: { wh: "w-9 h-9", text: "text-sm" },
2626
3230
  lg: { wh: "w-12 h-12", text: "text-base" },
2627
3231
  xl: { wh: "w-16 h-16", text: "text-xl" }
2628
- }, ct = [
2629
- "bg-emerald-600",
2630
- "bg-teal-600",
2631
- "bg-lime-600",
2632
- "bg-cyan-700",
2633
- "bg-slate-600"
2634
- ];
2635
- function dt(t) {
3232
+ }, kt = [
3233
+ "bg-indigo-500",
3234
+ "bg-blue-500",
3235
+ "bg-emerald-500",
3236
+ "bg-violet-500",
3237
+ "bg-amber-500",
3238
+ "bg-teal-500",
3239
+ "bg-rose-500",
3240
+ "bg-cyan-500"
3241
+ ], _r = {
3242
+ xs: "text-xs",
3243
+ sm: "text-sm",
3244
+ md: "text-base",
3245
+ lg: "text-lg"
3246
+ }, Hr = "bonsaif.bot", Pr = "Bonsaif Bot", Wr = {
3247
+ xs: "p-0.5",
3248
+ sm: "p-1",
3249
+ md: "p-1.5",
3250
+ lg: "p-2",
3251
+ xl: "p-2.5"
3252
+ };
3253
+ function St(t) {
2636
3254
  return typeof t == "string" ? t.trim() : "";
2637
3255
  }
2638
- function Mr(t) {
2639
- return ct[[...t].reduce((r, n) => r + n.charCodeAt(0), 0) % ct.length];
3256
+ function jr(t) {
3257
+ let r = 0;
3258
+ for (const n of t) r = r * 31 + n.charCodeAt(0) & 65535;
3259
+ return kt[r % kt.length];
2640
3260
  }
2641
- function $r({
3261
+ function Fr(t, r) {
3262
+ return t === Hr || r === Pr;
3263
+ }
3264
+ function Ur({
2642
3265
  userId: t,
2643
3266
  username: r,
2644
3267
  name: n,
2645
3268
  size: a = "md",
2646
- className: l = "",
2647
- style: u
3269
+ showName: l = !1,
3270
+ showTooltip: u,
3271
+ tooltipContent: d,
3272
+ fallbackLabel: p = "Usuario",
3273
+ wrapperClassName: m = "",
3274
+ labelClassName: h = "",
3275
+ labelSize: w = "xs",
3276
+ avatarVersion: N = 0,
3277
+ className: g = "",
3278
+ style: f
2648
3279
  }) {
2649
- const { wh: m, text: p } = Er[a], c = dt(n) || dt(r) || "Usuario";
2650
- return /* @__PURE__ */ e(
3280
+ var _;
3281
+ const [v, c] = B(!1), $ = typeof t == "string" && t.trim() && t !== "undefined" && t !== "null" ? t.trim() : "";
3282
+ O(() => {
3283
+ c(!1);
3284
+ }, [$, N]);
3285
+ const { wh: D, text: K } = Or[a], W = St(n) || St(r) || p, E = W.trim()[0] || "?", T = typeof process < "u" && ((_ = process.env) == null ? void 0 : _.NEXT_PUBLIC_BASE_PATH) || "", I = Fr(r, n), L = $ ? `${T}/api/user/avatar/${$}${N ? `?v=${N}` : ""}` : "", M = {
3286
+ xs: 20,
3287
+ sm: 28,
3288
+ md: 36,
3289
+ lg: 48,
3290
+ xl: 64
3291
+ }[a], S = I ? /* @__PURE__ */ e(
2651
3292
  "span",
2652
3293
  {
2653
- className: `${m} ${Mr(c)} ${p} rounded-full flex items-center justify-center font-black text-white uppercase flex-shrink-0 ${l}`,
2654
- style: u,
2655
- children: c[0]
3294
+ className: `${D} ${Wr[a]} rounded-full flex items-center justify-center bg-[#071f1a] ring-1 ring-emerald-400/35 shadow-[0_0_0_1px_rgba(255,255,255,0.06)] flex-shrink-0 ${g}`,
3295
+ style: f,
3296
+ children: /* @__PURE__ */ e(
3297
+ "img",
3298
+ {
3299
+ src: `${T}/favicon.svg`,
3300
+ alt: W,
3301
+ width: M,
3302
+ height: M,
3303
+ className: "h-full w-full object-contain"
3304
+ }
3305
+ )
3306
+ }
3307
+ ) : L && !v ? /* @__PURE__ */ e(
3308
+ "img",
3309
+ {
3310
+ src: L,
3311
+ alt: W,
3312
+ width: M,
3313
+ height: M,
3314
+ className: `${D} rounded-full object-cover flex-shrink-0 ${g}`,
3315
+ style: f,
3316
+ onError: () => c(!0)
3317
+ },
3318
+ `${$}-${N}`
3319
+ ) : /* @__PURE__ */ e(
3320
+ "span",
3321
+ {
3322
+ className: `${D} ${jr(W)} ${K} rounded-full flex items-center justify-center font-black text-white uppercase flex-shrink-0 ${g}`,
3323
+ style: f,
3324
+ title: W,
3325
+ children: E
2656
3326
  }
2657
3327
  );
3328
+ if (l)
3329
+ return /* @__PURE__ */ i(
3330
+ "span",
3331
+ {
3332
+ className: `inline-flex min-w-0 items-center gap-2 ${m}`,
3333
+ children: [
3334
+ S,
3335
+ /* @__PURE__ */ e(
3336
+ "span",
3337
+ {
3338
+ className: `min-w-0 truncate ${_r[w]} font-medium text-[var(--text-main)] ${h}`,
3339
+ title: W,
3340
+ children: W
3341
+ }
3342
+ )
3343
+ ]
3344
+ }
3345
+ );
3346
+ const P = u ?? !0, J = d ?? W;
3347
+ return P && J ? /* @__PURE__ */ e(
3348
+ Dt,
3349
+ {
3350
+ as: "span",
3351
+ content: J,
3352
+ className: `inline-flex flex-shrink-0 ${m}`,
3353
+ children: S
3354
+ }
3355
+ ) : S;
2658
3356
  }
2659
- function Lr({ href: t, className: r, children: n }) {
3357
+ function qr({ href: t, className: r, children: n }) {
2660
3358
  return /* @__PURE__ */ e("a", { href: t, className: r, children: n });
2661
3359
  }
2662
- function Tr(t) {
3360
+ function Yr(t) {
2663
3361
  return t.reduce((r, n) => {
2664
3362
  const a = n.section ?? "Principal";
2665
3363
  return r[a] = [...r[a] ?? [], n], r;
2666
3364
  }, {});
2667
3365
  }
2668
- function Br({
3366
+ function Gr({
2669
3367
  children: t,
2670
3368
  navItems: r = [],
2671
3369
  currentPath: n = typeof window > "u" ? "/" : window.location.pathname,
2672
3370
  user: a,
2673
3371
  appName: l = "Bonsaif",
2674
3372
  appLogo: u,
2675
- header: m,
3373
+ header: d,
2676
3374
  footer: p,
2677
- onLogout: c,
2678
- LinkComponent: d = Lr
3375
+ onLogout: m,
3376
+ LinkComponent: h = qr
2679
3377
  }) {
2680
- const [y, C] = E(!1), w = Tr(r);
2681
- return /* @__PURE__ */ s("div", { className: "min-h-screen bg-[var(--bg-main)] text-[var(--text-main)]", children: [
2682
- /* @__PURE__ */ e(Cr, {}),
3378
+ const [w, N] = B(!1), g = Yr(r);
3379
+ return /* @__PURE__ */ i("div", { className: "min-h-screen bg-[var(--bg-main)] text-[var(--text-main)]", children: [
3380
+ /* @__PURE__ */ e(Ar, {}),
2683
3381
  /* @__PURE__ */ e(
2684
3382
  "button",
2685
3383
  {
2686
3384
  type: "button",
2687
3385
  "aria-label": "Abrir navegación",
2688
3386
  className: "fixed left-3 top-3 z-50 inline-flex h-9 w-9 items-center justify-center rounded-md border border-white/10 bg-black/70 text-white lg:hidden",
2689
- onClick: () => C(!0),
2690
- children: /* @__PURE__ */ e(Pt, { className: "h-5 w-5" })
3387
+ onClick: () => N(!0),
3388
+ children: /* @__PURE__ */ e(Gt, { className: "h-5 w-5" })
2691
3389
  }
2692
3390
  ),
2693
- y && /* @__PURE__ */ e(
3391
+ w && /* @__PURE__ */ e(
2694
3392
  "button",
2695
3393
  {
2696
3394
  type: "button",
2697
3395
  "aria-label": "Cerrar navegación",
2698
3396
  className: "fixed inset-0 z-40 bg-black/45 lg:hidden",
2699
- onClick: () => C(!1)
3397
+ onClick: () => N(!1)
2700
3398
  }
2701
3399
  ),
2702
- /* @__PURE__ */ s(
3400
+ /* @__PURE__ */ i(
2703
3401
  "aside",
2704
3402
  {
2705
- className: `fixed inset-y-0 left-0 z-50 flex w-72 flex-col bg-[#071716] text-white shadow-2xl transition-transform duration-200 lg:translate-x-0 ${y ? "translate-x-0" : "-translate-x-full"}`,
3403
+ className: `fixed inset-y-0 left-0 z-50 flex w-72 flex-col bg-[#071716] text-white shadow-2xl transition-transform duration-200 lg:translate-x-0 ${w ? "translate-x-0" : "-translate-x-full"}`,
2706
3404
  children: [
2707
- /* @__PURE__ */ s("div", { className: "flex h-16 items-center gap-3 border-b border-white/10 px-4", children: [
2708
- /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-white/10 text-white", children: u ?? /* @__PURE__ */ e(Ce, { className: "h-5 w-5" }) }),
3405
+ /* @__PURE__ */ i("div", { className: "flex h-16 items-center gap-3 border-b border-white/10 px-4", children: [
3406
+ /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-white/10 text-white", children: u ?? /* @__PURE__ */ e(qe, { className: "h-5 w-5" }) }),
2709
3407
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1 truncate text-sm font-semibold", children: l }),
2710
3408
  /* @__PURE__ */ e(
2711
3409
  "button",
@@ -2713,8 +3411,8 @@ function Br({
2713
3411
  type: "button",
2714
3412
  "aria-label": "Cerrar navegación",
2715
3413
  className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-white/70 hover:bg-white/10 lg:hidden",
2716
- onClick: () => C(!1),
2717
- children: /* @__PURE__ */ e(ce, { className: "h-5 w-5" })
3414
+ onClick: () => N(!1),
3415
+ children: /* @__PURE__ */ e(Se, { className: "h-5 w-5" })
2718
3416
  }
2719
3417
  )
2720
3418
  ] }),
@@ -2723,51 +3421,51 @@ function Br({
2723
3421
  {
2724
3422
  className: "sidebar-scroll min-h-0 flex-1 overflow-y-auto px-3 py-4",
2725
3423
  "data-overlay-scroll": "true",
2726
- children: Object.entries(w).map(([f, g]) => /* @__PURE__ */ s("div", { className: "mb-5", children: [
2727
- /* @__PURE__ */ s("div", { className: "mb-2 flex items-center gap-2 px-2 text-[11px] font-semibold uppercase tracking-wide text-white/35", children: [
2728
- /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" }),
3424
+ children: Object.entries(g).map(([f, v]) => /* @__PURE__ */ i("div", { className: "mb-5", children: [
3425
+ /* @__PURE__ */ i("div", { className: "mb-2 flex items-center gap-2 px-2 text-[11px] font-semibold uppercase tracking-wide text-white/35", children: [
3426
+ /* @__PURE__ */ e(He, { className: "h-3.5 w-3.5" }),
2729
3427
  f
2730
3428
  ] }),
2731
- /* @__PURE__ */ e("div", { className: "space-y-1", children: g.map((b) => {
2732
- const N = n === b.href || n.startsWith(`${b.href}/`);
2733
- return /* @__PURE__ */ s(
2734
- d,
3429
+ /* @__PURE__ */ e("div", { className: "space-y-1", children: v.map((c) => {
3430
+ const $ = n === c.href || n.startsWith(`${c.href}/`);
3431
+ return /* @__PURE__ */ i(
3432
+ h,
2735
3433
  {
2736
- href: b.href,
2737
- className: `flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors ${N ? "bg-white/10 text-white" : "text-white/55 hover:bg-white/[0.06] hover:text-white/85"}`,
3434
+ href: c.href,
3435
+ className: `flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors ${$ ? "bg-white/10 text-white" : "text-white/55 hover:bg-white/[0.06] hover:text-white/85"}`,
2738
3436
  children: [
2739
- /* @__PURE__ */ e("span", { className: "flex h-5 w-5 flex-shrink-0 items-center justify-center", children: b.icon ?? /* @__PURE__ */ e(Ce, { className: "h-4 w-4" }) }),
2740
- /* @__PURE__ */ e("span", { className: "truncate", children: b.label })
3437
+ /* @__PURE__ */ e("span", { className: "flex h-5 w-5 flex-shrink-0 items-center justify-center", children: c.icon ?? /* @__PURE__ */ e(qe, { className: "h-4 w-4" }) }),
3438
+ /* @__PURE__ */ e("span", { className: "truncate", children: c.label })
2741
3439
  ]
2742
3440
  },
2743
- b.href
3441
+ c.href
2744
3442
  );
2745
3443
  }) })
2746
3444
  ] }, f))
2747
3445
  }
2748
3446
  ),
2749
- /* @__PURE__ */ s("div", { className: "border-t border-white/10 p-3", children: [
2750
- a && /* @__PURE__ */ s("div", { className: "mb-3 flex min-w-0 items-center gap-3 rounded-lg bg-white/[0.04] p-2", children: [
3447
+ /* @__PURE__ */ i("div", { className: "border-t border-white/10 p-3", children: [
3448
+ a && /* @__PURE__ */ i("div", { className: "mb-3 flex min-w-0 items-center gap-3 rounded-lg bg-white/[0.04] p-2", children: [
2751
3449
  /* @__PURE__ */ e(
2752
- $r,
3450
+ Ur,
2753
3451
  {
2754
3452
  name: a.initials ?? a.name ?? a.email ?? "Usuario",
2755
3453
  size: "md"
2756
3454
  }
2757
3455
  ),
2758
- /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
3456
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
2759
3457
  /* @__PURE__ */ e("div", { className: "truncate text-sm font-medium text-white", children: a.name ?? "Usuario" }),
2760
3458
  a.email && /* @__PURE__ */ e("div", { className: "truncate text-xs text-white/45", children: a.email })
2761
3459
  ] })
2762
3460
  ] }),
2763
- c && /* @__PURE__ */ s(
2764
- ne,
3461
+ m && /* @__PURE__ */ i(
3462
+ he,
2765
3463
  {
2766
3464
  variant: "ghost",
2767
3465
  className: "w-full justify-start text-white hover:bg-white/10",
2768
- onClick: c,
3466
+ onClick: m,
2769
3467
  children: [
2770
- /* @__PURE__ */ e(_t, { className: "h-4 w-4" }),
3468
+ /* @__PURE__ */ e(Xt, { className: "h-4 w-4" }),
2771
3469
  " Salir"
2772
3470
  ]
2773
3471
  }
@@ -2777,13 +3475,13 @@ function Br({
2777
3475
  ]
2778
3476
  }
2779
3477
  ),
2780
- /* @__PURE__ */ s("div", { className: "min-h-screen lg:pl-72", children: [
2781
- m,
3478
+ /* @__PURE__ */ i("div", { className: "min-h-screen lg:pl-72", children: [
3479
+ d,
2782
3480
  /* @__PURE__ */ e("main", { className: "min-h-screen", children: t })
2783
3481
  ] })
2784
3482
  ] });
2785
3483
  }
2786
- const Rr = {
3484
+ const Xr = {
2787
3485
  dashboard: "Dashboard",
2788
3486
  tickets: "Tickets",
2789
3487
  teams: "Equipos",
@@ -2806,30 +3504,30 @@ const Rr = {
2806
3504
  "email-inbox": "Buzones",
2807
3505
  "security-incidents": "Incidentes",
2808
3506
  "guard-schedule": "Guardias"
2809
- }, ze = {
2810
- dashboard: /* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
2811
- tickets: /* @__PURE__ */ e(Jt, { className: "h-5 w-5" }),
2812
- teams: /* @__PURE__ */ e(Qe, { className: "h-5 w-5" }),
2813
- projects: /* @__PURE__ */ e(Vt, { className: "h-5 w-5" }),
2814
- clients: /* @__PURE__ */ e(Xt, { className: "h-5 w-5" }),
2815
- surveys: /* @__PURE__ */ e(Gt, { className: "h-5 w-5" }),
2816
- profile: /* @__PURE__ */ e(qt, { className: "h-5 w-5" }),
2817
- settings: /* @__PURE__ */ e(Ke, { className: "h-5 w-5" }),
2818
- notifications: /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
2819
- changelog: /* @__PURE__ */ e(Ut, { className: "h-5 w-5" }),
2820
- admin: /* @__PURE__ */ e(De, { className: "h-5 w-5" }),
2821
- users: /* @__PURE__ */ e(Qe, { className: "h-5 w-5" }),
2822
- roles: /* @__PURE__ */ e(De, { className: "h-5 w-5" }),
2823
- menus: /* @__PURE__ */ e(Ke, { className: "h-5 w-5" }),
2824
- guards: /* @__PURE__ */ e(Ie, { className: "h-5 w-5" }),
2825
- vacations: /* @__PURE__ */ e(Ie, { className: "h-5 w-5" }),
2826
- audit: /* @__PURE__ */ e(Ze, { className: "h-5 w-5" }),
2827
- positions: /* @__PURE__ */ e(jt, { className: "h-5 w-5" }),
2828
- ranks: /* @__PURE__ */ e(Ze, { className: "h-5 w-5" }),
2829
- "email-inbox": /* @__PURE__ */ e(Ft, { className: "h-5 w-5" }),
2830
- "security-incidents": /* @__PURE__ */ e(De, { className: "h-5 w-5" })
3507
+ }, Ze = {
3508
+ dashboard: /* @__PURE__ */ e(ar, { className: "h-5 w-5" }),
3509
+ tickets: /* @__PURE__ */ e(nr, { className: "h-5 w-5" }),
3510
+ teams: /* @__PURE__ */ e(mt, { className: "h-5 w-5" }),
3511
+ projects: /* @__PURE__ */ e(rr, { className: "h-5 w-5" }),
3512
+ clients: /* @__PURE__ */ e(tr, { className: "h-5 w-5" }),
3513
+ surveys: /* @__PURE__ */ e(er, { className: "h-5 w-5" }),
3514
+ profile: /* @__PURE__ */ e(Qt, { className: "h-5 w-5" }),
3515
+ settings: /* @__PURE__ */ e(ut, { className: "h-5 w-5" }),
3516
+ notifications: /* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
3517
+ changelog: /* @__PURE__ */ e(Kt, { className: "h-5 w-5" }),
3518
+ admin: /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
3519
+ users: /* @__PURE__ */ e(mt, { className: "h-5 w-5" }),
3520
+ roles: /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
3521
+ menus: /* @__PURE__ */ e(ut, { className: "h-5 w-5" }),
3522
+ guards: /* @__PURE__ */ e(tt, { className: "h-5 w-5" }),
3523
+ vacations: /* @__PURE__ */ e(tt, { className: "h-5 w-5" }),
3524
+ audit: /* @__PURE__ */ e(dt, { className: "h-5 w-5" }),
3525
+ positions: /* @__PURE__ */ e(Vt, { className: "h-5 w-5" }),
3526
+ ranks: /* @__PURE__ */ e(dt, { className: "h-5 w-5" }),
3527
+ "email-inbox": /* @__PURE__ */ e(Jt, { className: "h-5 w-5" }),
3528
+ "security-incidents": /* @__PURE__ */ e(Ve, { className: "h-5 w-5" })
2831
3529
  };
2832
- function Dr({
3530
+ function Jr({
2833
3531
  href: t,
2834
3532
  className: r,
2835
3533
  style: n,
@@ -2837,127 +3535,127 @@ function Dr({
2837
3535
  }) {
2838
3536
  return /* @__PURE__ */ e("a", { href: t, className: r, style: n, children: a });
2839
3537
  }
2840
- function Ar(t) {
3538
+ function Vr(t) {
2841
3539
  return t.split("-").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
2842
3540
  }
2843
- function zr(t) {
3541
+ function Kr(t) {
2844
3542
  return /^\d+$/.test(t) || /^[a-f0-9]{8,}$/i.test(t);
2845
3543
  }
2846
- function Or(t) {
3544
+ function Zr(t) {
2847
3545
  const r = t.split("/").filter(Boolean);
2848
3546
  if (r.length === 0 || r.length === 1 && r[0] === "dashboard")
2849
3547
  return [];
2850
- const n = decodeURIComponent(r[r.length - 1]), a = r.length > 1 ? decodeURIComponent(r[r.length - 2]) : void 0, l = zr(n) && a ? a : n, u = Rr[l] ?? Ar(l);
3548
+ const n = decodeURIComponent(r[r.length - 1]), a = r.length > 1 ? decodeURIComponent(r[r.length - 2]) : void 0, l = Kr(n) && a ? a : n, u = Xr[l] ?? Vr(l);
2851
3549
  return [{ label: "Inicio", href: "/" }, { label: u }];
2852
3550
  }
2853
- function Oe(t) {
3551
+ function Qe(t) {
2854
3552
  return (t == null ? void 0 : t.querySelector(":scope > .os-viewport")) ?? (t == null ? void 0 : t.querySelector(
2855
3553
  ":scope > [data-overlayscrollbars-viewport]"
2856
3554
  ));
2857
3555
  }
2858
- function Ir(t) {
3556
+ function Qr(t) {
2859
3557
  const r = t.split("/").filter(Boolean), n = r[r.length - 1];
2860
- if (!n) return /* @__PURE__ */ e(Ce, { className: "h-5 w-5" });
2861
- if (ze[n]) return ze[n];
3558
+ if (!n) return /* @__PURE__ */ e(qe, { className: "h-5 w-5" });
3559
+ if (Ze[n]) return Ze[n];
2862
3560
  const a = r.length > 1 ? r[r.length - 2] : "";
2863
- return ze[a] ?? /* @__PURE__ */ e(Ce, { className: "h-5 w-5" });
3561
+ return Ze[a] ?? /* @__PURE__ */ e(qe, { className: "h-5 w-5" });
2864
3562
  }
2865
- function un({
3563
+ function Mn({
2866
3564
  title: t,
2867
3565
  subtitle: r,
2868
3566
  action: n,
2869
3567
  meta: a,
2870
3568
  icon: l,
2871
3569
  className: u = "",
2872
- contentClassName: m = "",
3570
+ contentClassName: d = "",
2873
3571
  breadcrumbs: p,
2874
- currentPath: c = typeof window > "u" ? "/" : window.location.pathname,
2875
- showBreadcrumbs: d = !0,
2876
- contained: y = !1,
2877
- LinkComponent: C = Dr
3572
+ currentPath: m = typeof window > "u" ? "/" : window.location.pathname,
3573
+ showBreadcrumbs: h = !0,
3574
+ contained: w = !1,
3575
+ LinkComponent: N = Jr
2878
3576
  }) {
2879
- const w = J(null), [f, g] = E(!1), [b, N] = E(null), L = p ?? Or(c), X = l ?? Ir(c), Y = d && L.length > 1;
2880
- return R(() => {
2881
- if (y) {
2882
- g(!1);
3577
+ const g = ie(null), [f, v] = B(!1), [c, $] = B(null), D = p ?? Zr(m), K = l ?? Qr(m), W = h && D.length > 1;
3578
+ return O(() => {
3579
+ if (w) {
3580
+ v(!1);
2883
3581
  return;
2884
3582
  }
2885
- let k = null, M = 0, $ = 0;
2886
- const B = () => {
2887
- const T = w.current, A = document.querySelector(
3583
+ let E = null, T = 0, I = 0;
3584
+ const L = () => {
3585
+ const S = g.current, P = document.querySelector(
2888
3586
  "[data-app-scroll='true']"
2889
3587
  );
2890
- return (T == null ? void 0 : T.closest(".os-viewport")) ?? (T == null ? void 0 : T.closest(
3588
+ return (S == null ? void 0 : S.closest(".os-viewport")) ?? (S == null ? void 0 : S.closest(
2891
3589
  "[data-overlayscrollbars-viewport]"
2892
- )) ?? Oe(A) ?? A ?? window;
2893
- }, W = () => {
2894
- const T = k && k !== window ? k.scrollTop : window.scrollY;
2895
- g((A) => A ? T > 24 : T > 72);
2896
- }, I = () => {
2897
- k == null || k.removeEventListener("scroll", W), k = B(), k.addEventListener("scroll", W, { passive: !0 }), W();
3590
+ )) ?? Qe(P) ?? P ?? window;
3591
+ }, F = () => {
3592
+ const S = E && E !== window ? E.scrollTop : window.scrollY;
3593
+ v((P) => P ? S > 24 : S > 72);
3594
+ }, M = () => {
3595
+ E == null || E.removeEventListener("scroll", F), E = L(), E.addEventListener("scroll", F, { passive: !0 }), F();
2898
3596
  };
2899
- return I(), M = window.requestAnimationFrame(I), $ = window.setTimeout(I, 120), () => {
2900
- window.cancelAnimationFrame(M), window.clearTimeout($), k == null || k.removeEventListener("scroll", W);
3597
+ return M(), T = window.requestAnimationFrame(M), I = window.setTimeout(M, 120), () => {
3598
+ window.cancelAnimationFrame(T), window.clearTimeout(I), E == null || E.removeEventListener("scroll", F);
2901
3599
  };
2902
- }, [y]), R(() => {
2903
- if (y) {
2904
- N(null);
3600
+ }, [w]), O(() => {
3601
+ if (w) {
3602
+ $(null);
2905
3603
  return;
2906
3604
  }
2907
- let k = 0;
2908
- const M = [], $ = () => {
2909
- const O = w.current, G = O == null ? void 0 : O.parentElement, F = document.querySelector(
3605
+ let E = 0;
3606
+ const T = [], I = () => {
3607
+ const _ = g.current, j = _ == null ? void 0 : _.parentElement, U = document.querySelector(
2910
3608
  "[data-app-scroll='true']"
2911
- ), U = Oe(F) ?? F;
2912
- if (!O || !G || !U) {
2913
- N(null);
3609
+ ), Z = Qe(U) ?? U;
3610
+ if (!_ || !j || !Z) {
3611
+ $(null);
2914
3612
  return;
2915
3613
  }
2916
- const o = G.getBoundingClientRect(), x = window.getComputedStyle(G), z = U.getBoundingClientRect(), j = U instanceof HTMLElement && U.clientWidth > 0 ? U.clientWidth : z.width, P = o.left + parseFloat(x.paddingLeft || "0"), Z = {
2917
- marginLeft: Math.round(z.left - P),
2918
- width: Math.round(j)
3614
+ const o = j.getBoundingClientRect(), y = window.getComputedStyle(j), H = Z.getBoundingClientRect(), q = Z instanceof HTMLElement && Z.clientWidth > 0 ? Z.clientWidth : H.width, G = o.left + parseFloat(y.paddingLeft || "0"), ee = {
3615
+ marginLeft: Math.round(H.left - G),
3616
+ width: Math.round(q)
2919
3617
  };
2920
- N(
2921
- (ee) => ee && ee.marginLeft === Z.marginLeft && ee.width === Z.width ? ee : Z
3618
+ $(
3619
+ (me) => me && me.marginLeft === ee.marginLeft && me.width === ee.width ? me : ee
2922
3620
  );
2923
- }, B = () => {
2924
- window.cancelAnimationFrame(k), k = window.requestAnimationFrame($);
3621
+ }, L = () => {
3622
+ window.cancelAnimationFrame(E), E = window.requestAnimationFrame(I);
2925
3623
  };
2926
- B(), window.addEventListener("resize", B);
2927
- const W = new ResizeObserver(B), I = w.current, T = I == null ? void 0 : I.parentElement, A = document.querySelector(
3624
+ L(), window.addEventListener("resize", L);
3625
+ const F = new ResizeObserver(L), M = g.current, S = M == null ? void 0 : M.parentElement, P = document.querySelector(
2928
3626
  "[data-app-scroll='true']"
2929
- ), q = Oe(A) ?? A;
2930
- return [T, A, q].forEach((O) => {
2931
- O && W.observe(O);
2932
- }), M.push(window.setTimeout(B, 120)), M.push(window.setTimeout(B, 280)), () => {
2933
- window.cancelAnimationFrame(k), window.removeEventListener("resize", B), W.disconnect(), M.forEach((O) => window.clearTimeout(O));
3627
+ ), J = Qe(P) ?? P;
3628
+ return [S, P, J].forEach((_) => {
3629
+ _ && F.observe(_);
3630
+ }), T.push(window.setTimeout(L, 120)), T.push(window.setTimeout(L, 280)), () => {
3631
+ window.cancelAnimationFrame(E), window.removeEventListener("resize", L), F.disconnect(), T.forEach((_) => window.clearTimeout(_));
2934
3632
  };
2935
- }, [y]), /* @__PURE__ */ e(
3633
+ }, [w]), /* @__PURE__ */ e(
2936
3634
  "div",
2937
3635
  {
2938
- ref: w,
3636
+ ref: g,
2939
3637
  "data-page-header": "true",
2940
3638
  "data-compact": f ? "true" : "false",
2941
- className: `sticky top-0 z-30 overflow-visible py-0 transition-[background-color,box-shadow,border-color] duration-300 ease-out ${y ? "mb-0 flex-shrink-0" : "mb-6 sm:mb-1"} ${u}`,
3639
+ className: `sticky top-0 z-30 overflow-visible py-0 transition-[background-color,box-shadow,border-color] duration-300 ease-out ${w ? "mb-0 flex-shrink-0" : "mb-6 sm:mb-1"} ${u}`,
2942
3640
  style: {
2943
- ...b ? { marginLeft: b.marginLeft, width: b.width } : null,
2944
- background: y ? "var(--bg-card)" : f ? "var(--bg-main)" : "color-mix(in srgb, var(--bg-main) 44%, transparent)",
3641
+ ...c ? { marginLeft: c.marginLeft, width: c.width } : null,
3642
+ background: w ? "var(--bg-card)" : f ? "var(--bg-main)" : "color-mix(in srgb, var(--bg-main) 44%, transparent)",
2945
3643
  backdropFilter: "saturate(1.2) blur(14px)",
2946
3644
  WebkitBackdropFilter: "saturate(1.2) blur(14px)",
2947
- borderBottom: y || f ? "1px solid var(--border)" : "1px solid transparent",
3645
+ borderBottom: w || f ? "1px solid var(--border)" : "1px solid transparent",
2948
3646
  boxShadow: f ? "0 10px 28px rgba(12, 54, 53, 0.12)" : "none"
2949
3647
  },
2950
- children: /* @__PURE__ */ s(
3648
+ children: /* @__PURE__ */ i(
2951
3649
  "div",
2952
3650
  {
2953
- className: `flex flex-wrap items-center justify-between px-4 pt-0.5 transition-[gap,min-height,padding] duration-300 ease-out ${f ? "min-h-10 gap-2 sm:min-h-11 sm:gap-3" : "min-h-11 gap-3 sm:min-h-12 sm:gap-4"} ${m}`,
3651
+ className: `flex flex-wrap items-center justify-between px-4 pt-0.5 transition-[gap,min-height,padding] duration-300 ease-out ${f ? "min-h-10 gap-2 sm:min-h-11 sm:gap-3" : "min-h-11 gap-3 sm:min-h-12 sm:gap-4"} ${d}`,
2954
3652
  children: [
2955
- /* @__PURE__ */ s(
3653
+ /* @__PURE__ */ i(
2956
3654
  "div",
2957
3655
  {
2958
3656
  className: `min-w-0 flex flex-1 flex-col justify-center transition-[gap,transform] duration-300 ease-out ${f ? "gap-1" : "gap-1.5 sm:gap-2"}`,
2959
3657
  children: [
2960
- Y && /* @__PURE__ */ e(
3658
+ W && /* @__PURE__ */ e(
2961
3659
  "nav",
2962
3660
  {
2963
3661
  "aria-label": "Breadcrumb",
@@ -2966,49 +3664,49 @@ function un({
2966
3664
  "ol",
2967
3665
  {
2968
3666
  className: `flex flex-wrap items-center gap-1.5 leading-none transition-[font-size,line-height] duration-300 ease-out ${f ? "text-[10px] sm:text-[11px]" : "text-[11px] sm:text-xs"}`,
2969
- children: L.map((k, M) => {
2970
- const $ = M === L.length - 1;
2971
- return /* @__PURE__ */ s(
3667
+ children: D.map((E, T) => {
3668
+ const I = T === D.length - 1;
3669
+ return /* @__PURE__ */ i(
2972
3670
  "li",
2973
3671
  {
2974
3672
  className: "flex min-w-0 items-center gap-1.5",
2975
3673
  children: [
2976
- M > 0 && /* @__PURE__ */ e(
2977
- xe,
3674
+ T > 0 && /* @__PURE__ */ e(
3675
+ Te,
2978
3676
  {
2979
3677
  className: "h-3.5 w-3.5 transition-[color,transform] duration-300 ease-out",
2980
3678
  style: { color: "var(--text-muted)" }
2981
3679
  }
2982
3680
  ),
2983
- k.href && !$ ? /* @__PURE__ */ e(
2984
- C,
3681
+ E.href && !I ? /* @__PURE__ */ e(
3682
+ N,
2985
3683
  {
2986
- href: k.href,
3684
+ href: E.href,
2987
3685
  className: "truncate transition-colors duration-300 hover:underline",
2988
3686
  style: { color: "var(--text-muted)" },
2989
- children: k.label
3687
+ children: E.label
2990
3688
  }
2991
3689
  ) : /* @__PURE__ */ e(
2992
3690
  "span",
2993
3691
  {
2994
- "aria-current": $ ? "page" : void 0,
2995
- className: $ ? "truncate font-semibold" : "truncate",
3692
+ "aria-current": I ? "page" : void 0,
3693
+ className: I ? "truncate font-semibold" : "truncate",
2996
3694
  style: {
2997
- color: $ ? "var(--text-main)" : "var(--text-muted)"
3695
+ color: I ? "var(--text-main)" : "var(--text-muted)"
2998
3696
  },
2999
- children: k.label
3697
+ children: E.label
3000
3698
  }
3001
3699
  )
3002
3700
  ]
3003
3701
  },
3004
- `${k.label}-${M}`
3702
+ `${E.label}-${T}`
3005
3703
  );
3006
3704
  })
3007
3705
  }
3008
3706
  )
3009
3707
  }
3010
3708
  ),
3011
- /* @__PURE__ */ s(
3709
+ /* @__PURE__ */ i(
3012
3710
  "div",
3013
3711
  {
3014
3712
  className: `flex min-w-0 items-center transition-[gap,transform] duration-300 ease-out ${f ? "gap-2" : "gap-2.5 sm:gap-3"}`,
@@ -3018,17 +3716,17 @@ function un({
3018
3716
  {
3019
3717
  className: `flex-shrink-0 transition-[color,transform,opacity] duration-300 ease-out ${f ? "scale-90 opacity-80" : "scale-100 opacity-100"}`,
3020
3718
  style: {
3021
- color: Y ? "var(--text-secondary)" : "var(--text-muted)"
3719
+ color: W ? "var(--text-secondary)" : "var(--text-muted)"
3022
3720
  },
3023
- children: X
3721
+ children: K
3024
3722
  }
3025
3723
  ),
3026
- /* @__PURE__ */ s(
3724
+ /* @__PURE__ */ i(
3027
3725
  "div",
3028
3726
  {
3029
3727
  className: `flex min-w-0 flex-1 flex-wrap items-center transition-[gap] duration-300 ease-out ${f ? "gap-x-2 gap-y-1" : "gap-x-3 gap-y-2"}`,
3030
3728
  children: [
3031
- /* @__PURE__ */ s("div", { className: "min-w-0 flex-shrink transition-[transform] duration-300 ease-out", children: [
3729
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-shrink transition-[transform] duration-300 ease-out", children: [
3032
3730
  /* @__PURE__ */ e(
3033
3731
  "h1",
3034
3732
  {
@@ -3076,83 +3774,20 @@ function un({
3076
3774
  }
3077
3775
  );
3078
3776
  }
3079
- function mn({
3080
- value: t,
3081
- onChange: r,
3082
- placeholder: n,
3083
- className: a = ""
3084
- }) {
3085
- const l = J(null), [u, m] = E(!1), p = u || t.trim().length > 0, c = () => {
3086
- var d;
3087
- m(!0), (d = l.current) == null || d.focus();
3088
- };
3089
- return /* @__PURE__ */ s(
3090
- "div",
3091
- {
3092
- className: `relative flex-shrink-0 overflow-visible transition-[width] duration-200 ease-out ${p ? a || "w-full" : "w-28"}`,
3093
- onMouseDown: (d) => {
3094
- p || (d.preventDefault(), c());
3095
- },
3096
- children: [
3097
- /* @__PURE__ */ e(
3098
- We,
3099
- {
3100
- className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none transition-colors duration-200",
3101
- style: { color: "var(--text-muted)" }
3102
- }
3103
- ),
3104
- /* @__PURE__ */ e(
3105
- "input",
3106
- {
3107
- ref: l,
3108
- type: "text",
3109
- "aria-label": n,
3110
- value: t,
3111
- onChange: (d) => r(d.target.value),
3112
- placeholder: p ? n : "Buscar",
3113
- className: `h-11 w-full rounded-lg py-0 text-sm placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-150 ${p ? "pl-9 pr-9" : "cursor-pointer pl-9 pr-3"}`,
3114
- style: {
3115
- background: "var(--bg-card)",
3116
- border: "1px solid var(--border)",
3117
- color: "var(--text-main)"
3118
- },
3119
- onFocus: (d) => {
3120
- m(!0), d.currentTarget.style.borderColor = "var(--primary)", d.currentTarget.style.boxShadow = "0 0 0 3px rgba(59,130,246,0.12)";
3121
- },
3122
- onBlur: (d) => {
3123
- m(!1), d.currentTarget.style.borderColor = "var(--border)", d.currentTarget.style.boxShadow = "none";
3124
- }
3125
- }
3126
- ),
3127
- t && /* @__PURE__ */ e(
3128
- "button",
3129
- {
3130
- type: "button",
3131
- onClick: () => r(""),
3132
- className: "absolute right-2 top-1/2 flex !h-6 !w-6 -translate-y-1/2 items-center justify-center rounded-full !p-0 leading-none transition-colors hover:bg-black/5",
3133
- style: { color: "var(--text-muted)" },
3134
- "aria-label": "Limpiar búsqueda",
3135
- children: /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5 flex-shrink-0" })
3136
- }
3137
- )
3138
- ]
3139
- }
3140
- );
3141
- }
3142
- function pn({
3777
+ function Bn({
3143
3778
  children: t,
3144
3779
  currentPath: r = typeof window > "u" ? "/" : window.location.pathname,
3145
3780
  publicRoutes: n = ["/", "/login", "/reset-password"],
3146
3781
  ...a
3147
3782
  }) {
3148
- return n.includes(r) ? /* @__PURE__ */ e(le, { children: t }) : /* @__PURE__ */ e(Br, { currentPath: r, ...a, children: t });
3783
+ return n.includes(r) ? /* @__PURE__ */ e(we, { children: t }) : /* @__PURE__ */ e(Gr, { currentPath: r, ...a, children: t });
3149
3784
  }
3150
- function ut() {
3785
+ function Ct() {
3151
3786
  if (typeof window > "u") return "system";
3152
3787
  const t = localStorage.getItem("theme");
3153
3788
  return t === "light" || t === "dark" ? t : t === "system" ? "system" : document.documentElement.classList.contains("dark") ? "dark" : "light";
3154
3789
  }
3155
- function Hr(t, r, n) {
3790
+ function en(t, r, n) {
3156
3791
  try {
3157
3792
  const a = new URL(t), l = a.searchParams.get("callbackUrl");
3158
3793
  if (l) {
@@ -3167,57 +3802,57 @@ function Hr(t, r, n) {
3167
3802
  return t;
3168
3803
  }
3169
3804
  }
3170
- function hn({
3805
+ function Ln({
3171
3806
  name: t,
3172
3807
  src: r,
3173
3808
  projectKey: n
3174
3809
  }) {
3175
- const [a, l] = E(
3176
- () => ut()
3177
- ), u = J(null);
3178
- R(() => {
3179
- const c = new MutationObserver(
3180
- () => l(ut())
3810
+ const [a, l] = B(
3811
+ () => Ct()
3812
+ ), u = ie(null);
3813
+ O(() => {
3814
+ const m = new MutationObserver(
3815
+ () => l(Ct())
3181
3816
  );
3182
- return c.observe(document.documentElement, {
3817
+ return m.observe(document.documentElement, {
3183
3818
  attributes: !0,
3184
3819
  attributeFilter: ["class"]
3185
- }), () => c.disconnect();
3820
+ }), () => m.disconnect();
3186
3821
  }, []);
3187
- const m = Je(
3188
- () => Hr(r, a, n),
3822
+ const d = Oe(
3823
+ () => en(r, a, n),
3189
3824
  [n, r, a]
3190
- ), p = Je(() => {
3825
+ ), p = Oe(() => {
3191
3826
  try {
3192
- return new URL(m).origin;
3827
+ return new URL(d).origin;
3193
3828
  } catch {
3194
3829
  return "";
3195
3830
  }
3196
- }, [m]);
3197
- return R(() => {
3831
+ }, [d]);
3832
+ return O(() => {
3198
3833
  if (!n) return;
3199
- const c = n;
3200
- function d(y) {
3201
- var f, g, b;
3202
- if (y.source !== ((f = u.current) == null ? void 0 : f.contentWindow) || p && y.origin !== p) return;
3203
- if (((g = y.data) == null ? void 0 : g.type) === "prime-microservice:overlay") {
3834
+ const m = n;
3835
+ function h(w) {
3836
+ var f, v, c;
3837
+ if (w.source !== ((f = u.current) == null ? void 0 : f.contentWindow) || p && w.origin !== p) return;
3838
+ if (((v = w.data) == null ? void 0 : v.type) === "prime-microservice:overlay") {
3204
3839
  window.dispatchEvent(
3205
3840
  new CustomEvent("prime-auth:microservice-overlay", {
3206
- detail: { active: !!y.data.active }
3841
+ detail: { active: !!w.data.active }
3207
3842
  })
3208
3843
  );
3209
3844
  return;
3210
3845
  }
3211
- if (((b = y.data) == null ? void 0 : b.type) !== "prime-microservice:navigation") return;
3212
- const C = y.data.path;
3213
- if (!C || !C.startsWith("/") || C.startsWith("//")) return;
3214
- const w = `/apps/${encodeURIComponent(c)}${C}`;
3215
- `${window.location.pathname}${window.location.search}${window.location.hash}` !== w && (window.history.replaceState(window.history.state, "", w), window.dispatchEvent(
3846
+ if (((c = w.data) == null ? void 0 : c.type) !== "prime-microservice:navigation") return;
3847
+ const N = w.data.path;
3848
+ if (!N || !N.startsWith("/") || N.startsWith("//")) return;
3849
+ const g = `/apps/${encodeURIComponent(m)}${N}`;
3850
+ `${window.location.pathname}${window.location.search}${window.location.hash}` !== g && (window.history.replaceState(window.history.state, "", g), window.dispatchEvent(
3216
3851
  new CustomEvent("prime-auth:microservice-navigation")
3217
3852
  ));
3218
3853
  }
3219
- return window.addEventListener("message", d), () => {
3220
- window.removeEventListener("message", d), window.dispatchEvent(
3854
+ return window.addEventListener("message", h), () => {
3855
+ window.removeEventListener("message", h), window.dispatchEvent(
3221
3856
  new CustomEvent("prime-auth:microservice-overlay", {
3222
3857
  detail: { active: !1 }
3223
3858
  })
@@ -3227,7 +3862,7 @@ function hn({
3227
3862
  "iframe",
3228
3863
  {
3229
3864
  ref: u,
3230
- src: m,
3865
+ src: d,
3231
3866
  title: t,
3232
3867
  className: "min-h-0 flex-1 border-0 bg-[var(--bg-main)]",
3233
3868
  allow: "clipboard-write",
@@ -3236,27 +3871,27 @@ function hn({
3236
3871
  }
3237
3872
  ) });
3238
3873
  }
3239
- function fn() {
3240
- const [t, r] = E(""), [n, a] = E(!1), [l, u] = E({ width: 96, height: 96 });
3241
- return R(() => {
3242
- let m = !1;
3874
+ function Tn() {
3875
+ const [t, r] = B(""), [n, a] = B(!1), [l, u] = B({ width: 96, height: 96 });
3876
+ return O(() => {
3877
+ let d = !1;
3243
3878
  return fetch("/api/microservices/prime-suite/chat-url", { cache: "no-store" }).then((p) => p.ok ? p.json() : null).then((p) => {
3244
- !m && (p != null && p.src) && r(p.src);
3879
+ !d && (p != null && p.src) && r(p.src);
3245
3880
  }).catch(() => {
3246
3881
  }), () => {
3247
- m = !0;
3882
+ d = !0;
3248
3883
  };
3249
- }, []), R(() => {
3250
- const m = (p) => {
3251
- var d;
3252
- if (((d = p.data) == null ? void 0 : d.type) !== "prime-suite-chat:state") return;
3253
- const c = !!p.data.active;
3254
- a(c), u({
3255
- width: mt(p.data.width, 96, 720),
3256
- height: mt(p.data.height, 96, 560)
3884
+ }, []), O(() => {
3885
+ const d = (p) => {
3886
+ var h;
3887
+ if (((h = p.data) == null ? void 0 : h.type) !== "prime-suite-chat:state") return;
3888
+ const m = !!p.data.active;
3889
+ a(m), u({
3890
+ width: $t(p.data.width, 96, 720),
3891
+ height: $t(p.data.height, 96, 560)
3257
3892
  });
3258
3893
  };
3259
- return window.addEventListener("message", m), () => window.removeEventListener("message", m);
3894
+ return window.addEventListener("message", d), () => window.removeEventListener("message", d);
3260
3895
  }, []), t ? /* @__PURE__ */ e(
3261
3896
  "iframe",
3262
3897
  {
@@ -3274,11 +3909,11 @@ function fn() {
3274
3909
  }
3275
3910
  ) : null;
3276
3911
  }
3277
- function mt(t, r, n) {
3912
+ function $t(t, r, n) {
3278
3913
  const a = typeof t == "number" && Number.isFinite(t) ? t : r;
3279
3914
  return Math.max(r, Math.min(n, Math.ceil(a)));
3280
3915
  }
3281
- function Wr(t) {
3916
+ function tn(t) {
3282
3917
  const r = document.documentElement, n = new MutationObserver(t);
3283
3918
  n.observe(r, { attributes: !0, attributeFilter: ["class"] });
3284
3919
  const a = window.matchMedia("(prefers-color-scheme: dark)");
@@ -3286,46 +3921,48 @@ function Wr(t) {
3286
3921
  n.disconnect(), a.removeEventListener("change", t);
3287
3922
  };
3288
3923
  }
3289
- function Pr() {
3924
+ function rn() {
3290
3925
  const t = localStorage.getItem("theme") || "system", r = window.matchMedia("(prefers-color-scheme: dark)").matches;
3291
3926
  return document.documentElement.classList.contains("dark") || t === "dark" || t === "system" && r ? "dark" : "light";
3292
3927
  }
3293
- function _r() {
3928
+ function nn() {
3294
3929
  return "light";
3295
3930
  }
3296
- function bn() {
3297
- const t = At(
3298
- Wr,
3299
- Pr,
3300
- _r
3931
+ function Dn() {
3932
+ const t = Ht(
3933
+ tn,
3934
+ rn,
3935
+ nn
3301
3936
  );
3302
- return /* @__PURE__ */ e(rr, { position: "bottom-center", theme: t, richColors: !0, closeButton: !0 });
3937
+ return /* @__PURE__ */ e(cr, { position: "bottom-center", theme: t, richColors: !0, closeButton: !0 });
3303
3938
  }
3304
3939
  export {
3305
- Br as AuthShell,
3306
- Qr as BonsaifButton,
3307
- ne as Button,
3308
- en as CalendarPicker,
3309
- rn as CompactFilterSelect,
3310
- tn as CompactSearchInput,
3311
- nn as ConfirmDialog,
3312
- an as DataTable,
3313
- on as DateRangePicker,
3314
- sn as Drawer,
3315
- Cr as GlobalScrollbars,
3316
- ln as InputField,
3317
- cn as LoadingState,
3318
- hn as MicroserviceFrame,
3319
- pr as Modal,
3320
- br as MouseTooltip,
3321
- un as PageHeader,
3322
- mn as PageSearchInput,
3323
- pn as PrimeAuthRouteShell,
3324
- bn as PrimeAuthToaster,
3325
- fn as PrimeSuiteChatFrame,
3326
- ft as SearchableSelect,
3327
- it as TextInput,
3328
- dn as Toggle,
3329
- $r as UserAvatar,
3330
- nr as cn
3940
+ Gr as AuthShell,
3941
+ bn as BonsaifButton,
3942
+ he as Button,
3943
+ vn as CalendarPicker,
3944
+ yn as CompactFilterSelect,
3945
+ gn as CompactSearchInput,
3946
+ wn as ConfirmDialog,
3947
+ Nn as DataTable,
3948
+ kn as DateRangePicker,
3949
+ Sn as Drawer,
3950
+ xn as DynamicDetailTabs,
3951
+ Ar as GlobalScrollbars,
3952
+ Cn as InputField,
3953
+ br as LoadingState,
3954
+ Ln as MicroserviceFrame,
3955
+ Er as Modal,
3956
+ Dt as MouseTooltip,
3957
+ Mn as PageHeader,
3958
+ ur as PageSearchInput,
3959
+ Bn as PrimeAuthRouteShell,
3960
+ Dn as PrimeAuthToaster,
3961
+ Tn as PrimeSuiteChatFrame,
3962
+ Tt as SearchableSelect,
3963
+ $n as StepWizard,
3964
+ yt as TextInput,
3965
+ En as Toggle,
3966
+ Ur as UserAvatar,
3967
+ dr as cn
3331
3968
  };