reactigoded 1.0.0-beta.26

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.
Files changed (177) hide show
  1. package/CHANGELOG.md +3001 -0
  2. package/LICENSE +21 -0
  3. package/README.md +556 -0
  4. package/dist/Toast-FZUdYH1L.js +594 -0
  5. package/dist/cn.js +7 -0
  6. package/dist/components/Accordion/Accordion.d.ts +49 -0
  7. package/dist/components/Accordion/AccordionContent.d.ts +15 -0
  8. package/dist/components/Accordion/AccordionContext.d.ts +59 -0
  9. package/dist/components/Accordion/AccordionHeader.d.ts +22 -0
  10. package/dist/components/Accordion/AccordionItem.d.ts +11 -0
  11. package/dist/components/Accordion/index.d.ts +8 -0
  12. package/dist/components/Alert/Alert.d.ts +39 -0
  13. package/dist/components/Alert/index.d.ts +2 -0
  14. package/dist/components/AlertDialog/AlertDialogClose.d.ts +64 -0
  15. package/dist/components/AlertDialog/AlertDialogContent.d.ts +58 -0
  16. package/dist/components/AlertDialog/index.d.ts +14 -0
  17. package/dist/components/Avatar/Avatar.d.ts +62 -0
  18. package/dist/components/Avatar/AvatarGroup.d.ts +13 -0
  19. package/dist/components/Avatar/index.d.ts +4 -0
  20. package/dist/components/Badge/Badge.d.ts +33 -0
  21. package/dist/components/Badge/index.d.ts +2 -0
  22. package/dist/components/Breadcrumb/Breadcrumb.d.ts +14 -0
  23. package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +21 -0
  24. package/dist/components/Breadcrumb/index.d.ts +4 -0
  25. package/dist/components/Button/Button.d.ts +61 -0
  26. package/dist/components/Button/IconButton.d.ts +48 -0
  27. package/dist/components/Button/index.d.ts +4 -0
  28. package/dist/components/Card/Card.d.ts +79 -0
  29. package/dist/components/Card/CardBody.d.ts +8 -0
  30. package/dist/components/Card/CardDivider.d.ts +8 -0
  31. package/dist/components/Card/CardFooter.d.ts +8 -0
  32. package/dist/components/Card/CardHeader.d.ts +8 -0
  33. package/dist/components/Card/CardImage.d.ts +15 -0
  34. package/dist/components/Card/index.d.ts +12 -0
  35. package/dist/components/Checkbox/Checkbox.d.ts +47 -0
  36. package/dist/components/Checkbox/index.d.ts +2 -0
  37. package/dist/components/Chip/Chip.d.ts +38 -0
  38. package/dist/components/Chip/index.d.ts +2 -0
  39. package/dist/components/Dialog/Dialog.d.ts +80 -0
  40. package/dist/components/Dialog/DialogBody.d.ts +8 -0
  41. package/dist/components/Dialog/DialogClose.d.ts +61 -0
  42. package/dist/components/Dialog/DialogContent.d.ts +36 -0
  43. package/dist/components/Dialog/DialogContext.d.ts +1 -0
  44. package/dist/components/Dialog/DialogFooter.d.ts +8 -0
  45. package/dist/components/Dialog/DialogHeader.d.ts +13 -0
  46. package/dist/components/Dialog/DialogTrigger.d.ts +44 -0
  47. package/dist/components/Dialog/index.d.ts +16 -0
  48. package/dist/components/Divider/Divider.d.ts +34 -0
  49. package/dist/components/Divider/index.d.ts +2 -0
  50. package/dist/components/Input/ErrorText.d.ts +13 -0
  51. package/dist/components/Input/Helper.d.ts +11 -0
  52. package/dist/components/Input/Input.d.ts +35 -0
  53. package/dist/components/Input/InputAddon.d.ts +8 -0
  54. package/dist/components/Input/InputGroup.d.ts +17 -0
  55. package/dist/components/Input/Label.d.ts +12 -0
  56. package/dist/components/Input/index.d.ts +12 -0
  57. package/dist/components/NativeSelect/NativeSelect.d.ts +41 -0
  58. package/dist/components/NativeSelect/index.d.ts +2 -0
  59. package/dist/components/Navbar/Navbar.d.ts +46 -0
  60. package/dist/components/Navbar/NavbarActions.d.ts +10 -0
  61. package/dist/components/Navbar/NavbarLink.d.ts +13 -0
  62. package/dist/components/Navbar/NavbarLogo.d.ts +22 -0
  63. package/dist/components/Navbar/NavbarMenuButton.d.ts +15 -0
  64. package/dist/components/Navbar/NavbarNav.d.ts +14 -0
  65. package/dist/components/Navbar/index.d.ts +12 -0
  66. package/dist/components/Pagination/Pagination.d.ts +77 -0
  67. package/dist/components/Pagination/index.d.ts +2 -0
  68. package/dist/components/Progress/Progress.d.ts +63 -0
  69. package/dist/components/Progress/index.d.ts +2 -0
  70. package/dist/components/Radio/Radio.d.ts +28 -0
  71. package/dist/components/Radio/index.d.ts +2 -0
  72. package/dist/components/Rating/Rating.d.ts +85 -0
  73. package/dist/components/Rating/index.d.ts +2 -0
  74. package/dist/components/Sidebar/Sidebar.d.ts +28 -0
  75. package/dist/components/Sidebar/SidebarContext.d.ts +32 -0
  76. package/dist/components/Sidebar/SidebarDivider.d.ts +8 -0
  77. package/dist/components/Sidebar/SidebarFooter.d.ts +8 -0
  78. package/dist/components/Sidebar/SidebarHeader.d.ts +13 -0
  79. package/dist/components/Sidebar/SidebarItem.d.ts +42 -0
  80. package/dist/components/Sidebar/SidebarNav.d.ts +13 -0
  81. package/dist/components/Sidebar/SidebarSection.d.ts +11 -0
  82. package/dist/components/Sidebar/SidebarToggle.d.ts +17 -0
  83. package/dist/components/Sidebar/index.d.ts +16 -0
  84. package/dist/components/Skeleton/Skeleton.d.ts +60 -0
  85. package/dist/components/Skeleton/index.d.ts +2 -0
  86. package/dist/components/Slider/Slider.d.ts +44 -0
  87. package/dist/components/Slider/index.d.ts +2 -0
  88. package/dist/components/Slot/Slot.d.ts +1 -0
  89. package/dist/components/Slot/composeEventHandlers.d.ts +1 -0
  90. package/dist/components/Slot/composeRefs.d.ts +1 -0
  91. package/dist/components/Slot/index.d.ts +3 -0
  92. package/dist/components/Spinner/Spinner.d.ts +31 -0
  93. package/dist/components/Spinner/index.d.ts +2 -0
  94. package/dist/components/Stepper/Step.d.ts +17 -0
  95. package/dist/components/Stepper/Stepper.d.ts +97 -0
  96. package/dist/components/Stepper/index.d.ts +4 -0
  97. package/dist/components/Switch/Switch.d.ts +53 -0
  98. package/dist/components/Switch/index.d.ts +2 -0
  99. package/dist/components/Table/Table.d.ts +74 -0
  100. package/dist/components/Table/index.d.ts +2 -0
  101. package/dist/components/Tabs/Tabs.d.ts +41 -0
  102. package/dist/components/Tabs/TabsContent.d.ts +15 -0
  103. package/dist/components/Tabs/TabsContext.d.ts +61 -0
  104. package/dist/components/Tabs/TabsList.d.ts +10 -0
  105. package/dist/components/Tabs/TabsTrigger.d.ts +15 -0
  106. package/dist/components/Tabs/index.d.ts +8 -0
  107. package/dist/components/Textarea/Textarea.d.ts +51 -0
  108. package/dist/components/Textarea/index.d.ts +2 -0
  109. package/dist/components/ThemeToggle/ThemeToggle.d.ts +43 -0
  110. package/dist/components/ThemeToggle/index.d.ts +2 -0
  111. package/dist/components/Timeline/Timeline.d.ts +20 -0
  112. package/dist/components/Timeline/TimelineItem.d.ts +32 -0
  113. package/dist/components/Timeline/index.d.ts +4 -0
  114. package/dist/components/Toast/Toast.d.ts +47 -0
  115. package/dist/components/Toast/ToastContext.d.ts +93 -0
  116. package/dist/components/Toast/ToastProvider.d.ts +116 -0
  117. package/dist/components/Toast/index.d.ts +6 -0
  118. package/dist/components/floating/Menu/Menu.d.ts +67 -0
  119. package/dist/components/floating/Menu/MenuContent.d.ts +60 -0
  120. package/dist/components/floating/Menu/MenuContext.d.ts +78 -0
  121. package/dist/components/floating/Menu/MenuItem.d.ts +47 -0
  122. package/dist/components/floating/Menu/MenuLabel.d.ts +6 -0
  123. package/dist/components/floating/Menu/MenuSeparator.d.ts +6 -0
  124. package/dist/components/floating/Menu/MenuTrigger.d.ts +53 -0
  125. package/dist/components/floating/Menu/index.d.ts +12 -0
  126. package/dist/components/floating/Menu/menuSelectors.d.ts +15 -0
  127. package/dist/components/floating/Tooltip/Tooltip.d.ts +194 -0
  128. package/dist/components/floating/Tooltip/index.d.ts +2 -0
  129. package/dist/components/floating/index.d.ts +3 -0
  130. package/dist/components/floating/primitives/FloatingTreeRoot.d.ts +55 -0
  131. package/dist/components/floating/primitives/index.d.ts +2 -0
  132. package/dist/components/floating/primitives/useFloatingNode.d.ts +1 -0
  133. package/dist/components/index.d.ts +38 -0
  134. package/dist/hooks/useControllableState.d.ts +152 -0
  135. package/dist/hooks/useTheme.d.ts +44 -0
  136. package/dist/index.d.ts +36 -0
  137. package/dist/index.js +1843 -0
  138. package/dist/server-safe.d.ts +69 -0
  139. package/dist/server-safe.js +47 -0
  140. package/dist/styles/igoded-base.css +1 -0
  141. package/dist/styles/igoded-components.css +1 -0
  142. package/dist/styles/igoded-design.css +1 -0
  143. package/dist/styles/igoded-fonts.css +1 -0
  144. package/dist/styles/igoded-reset.css +1 -0
  145. package/dist/styles/igoded-state-css.css +1 -0
  146. package/dist/styles/igoded-tokens.css +1 -0
  147. package/dist/styles/index.css +3 -0
  148. package/dist/styles/state/active.css +1 -0
  149. package/dist/styles/state/checked.css +1 -0
  150. package/dist/styles/state/default.css +1 -0
  151. package/dist/styles/state/disabled.css +1 -0
  152. package/dist/styles/state/empty.css +1 -0
  153. package/dist/styles/state/first-child.css +1 -0
  154. package/dist/styles/state/first-of-type.css +1 -0
  155. package/dist/styles/state/focus-visible.css +1 -0
  156. package/dist/styles/state/focus-within.css +1 -0
  157. package/dist/styles/state/focus.css +1 -0
  158. package/dist/styles/state/group-hover.css +1 -0
  159. package/dist/styles/state/hover.css +1 -0
  160. package/dist/styles/state/in-range.css +1 -0
  161. package/dist/styles/state/indeterminate.css +1 -0
  162. package/dist/styles/state/invalid.css +1 -0
  163. package/dist/styles/state/last-child.css +1 -0
  164. package/dist/styles/state/last-of-type.css +1 -0
  165. package/dist/styles/state/nth-child.css +1 -0
  166. package/dist/styles/state/only-child.css +1 -0
  167. package/dist/styles/state/optional.css +1 -0
  168. package/dist/styles/state/other.css +1 -0
  169. package/dist/styles/state/out-of-range.css +1 -0
  170. package/dist/styles/state/placeholder-shown.css +1 -0
  171. package/dist/styles/state/read-only.css +1 -0
  172. package/dist/styles/state/read-write.css +1 -0
  173. package/dist/styles/state/required.css +1 -0
  174. package/dist/styles/state/target.css +1 -0
  175. package/dist/styles/state/valid.css +1 -0
  176. package/dist/utils/cn.d.ts +11 -0
  177. package/package.json +282 -0
package/dist/index.js ADDED
@@ -0,0 +1,1843 @@
1
+ "use client";
2
+ import { cn as A } from "./cn.js";
3
+ import { A as bt, B as mt, C as pt, D as vt, E as ht, F as yt, G as Ct, H as Nt, I as kt, L as wt, M as It, N as j, O as Rt, P as At, R as xt, S as Dt, T as Tt, U as St, V as Et, W as Pt, _ as Mt, a as Ft, b as Lt, c as Vt, d as $t, f as Ot, g as Bt, h as _t, i as Ht, j as Kt, k as jt, l as Ut, m as Wt, n as qt, o as zt, p as Gt, r as Yt, s as Zt, t as Se, u as Jt, v as Qt, w as Xt, x as en, y as tn, z as nn } from "./Toast-FZUdYH1L.js";
4
+ import { Children as te, Fragment as Z, cloneElement as J, createContext as U, isValidElement as W, useCallback as M, useContext as _, useEffect as F, useId as H, useLayoutEffect as Ee, useMemo as B, useRef as T, useState as O, useSyncExternalStore as ne } from "react";
5
+ import { Fragment as Pe, jsx as f, jsxs as L } from "react/jsx-runtime";
6
+ import { createPortal as Me } from "react-dom";
7
+ import { FloatingFocusManager as Fe, FloatingNode as ue, FloatingPortal as de, FloatingTree as Le, autoUpdate as fe, flip as ge, offset as be, shift as me, useClick as Ve, useDismiss as pe, useFloating as ve, useFloatingNodeId as $e, useFloatingParentNodeId as Oe, useFocus as Be, useHover as _e, useInteractions as he, useListNavigation as He, useMergeRefs as Q, useRole as Ke, useTypeahead as je } from "@floating-ui/react";
8
+ var q = typeof window < "u" ? Ee : F, z = /* @__PURE__ */ Symbol("reactigoded.suppressNoHandlerWarn");
9
+ function Ue(e) {
10
+ return "derive" in e && typeof e.derive == "function" && "setDerivedValue" in e && typeof e.setDerivedValue == "function";
11
+ }
12
+ function $(e) {
13
+ const t = Ue(e), a = e.value, n = a !== void 0, [r, s] = O(() => t ? e.derive() : e.defaultValue), i = T(n), o = T(e.onChange), l = T(t ? e.setDerivedValue : void 0), u = T(void 0), d = n ? a : t ? e.derive() : r;
14
+ q(() => {
15
+ i.current = n, o.current = e.onChange, l.current = t ? e.setDerivedValue : void 0, u.current = d;
16
+ });
17
+ const c = M((m, v) => {
18
+ const p = typeof m == "function" ? m(u.current) : m;
19
+ if (!i.current) {
20
+ u.current = p;
21
+ const I = l.current;
22
+ I ? I(p) : s(p);
23
+ }
24
+ v?.silent || o.current?.(p);
25
+ }, []), b = e[z] === !0;
26
+ return T(!1), F(() => {
27
+ }, [
28
+ n,
29
+ e.onChange,
30
+ b
31
+ ]), {
32
+ value: d,
33
+ setValue: c,
34
+ isControlled: n
35
+ };
36
+ }
37
+ var re = U(null);
38
+ function We() {
39
+ const e = _(re);
40
+ if (!e) throw new Error("Componentes AccordionItem/Header/Content deben usarse dentro de <Accordion>");
41
+ return e;
42
+ }
43
+ var ye = U(null);
44
+ function Ce() {
45
+ const e = _(ye);
46
+ if (!e) throw new Error("AccordionHeader/AccordionContent deben usarse dentro de <AccordionItem>");
47
+ return e;
48
+ }
49
+ function ln(e) {
50
+ const t = H();
51
+ if (e.type === "multiple") {
52
+ const { type: r, ...s } = e;
53
+ return /* @__PURE__ */ f(ze, {
54
+ ...s,
55
+ baseId: t
56
+ });
57
+ }
58
+ const { type: a, ...n } = e;
59
+ return /* @__PURE__ */ f(qe, {
60
+ ...n,
61
+ baseId: t
62
+ });
63
+ }
64
+ function qe({ value: e, defaultValue: t = null, onValueChange: a, collapsible: n = !1, className: r, children: s, baseId: i, ref: o, ...l }) {
65
+ const { value: u, setValue: d } = $({
66
+ value: e,
67
+ defaultValue: t,
68
+ onChange: a
69
+ }), c = M((v) => u === v, [u]), b = M((v) => {
70
+ if (u === v) {
71
+ n && d(null);
72
+ return;
73
+ }
74
+ d(v);
75
+ }, [
76
+ u,
77
+ n,
78
+ d
79
+ ]), m = B(() => ({
80
+ isOpen: c,
81
+ toggle: b,
82
+ baseId: i
83
+ }), [
84
+ c,
85
+ b,
86
+ i
87
+ ]);
88
+ return /* @__PURE__ */ f(re.Provider, {
89
+ value: m,
90
+ children: /* @__PURE__ */ f("div", {
91
+ ref: o,
92
+ className: A("ig-accordion", r),
93
+ ...l,
94
+ children: s
95
+ })
96
+ });
97
+ }
98
+ function ze({ value: e, defaultValue: t = [], onValueChange: a, className: n, children: r, baseId: s, ref: i, ...o }) {
99
+ const { value: l, setValue: u } = $({
100
+ value: e,
101
+ defaultValue: t,
102
+ onChange: a
103
+ }), d = M((m) => l.includes(m), [l]), c = M((m) => {
104
+ l.includes(m) ? u(l.filter((v) => v !== m)) : u([...l, m]);
105
+ }, [l, u]), b = B(() => ({
106
+ isOpen: d,
107
+ toggle: c,
108
+ baseId: s
109
+ }), [
110
+ d,
111
+ c,
112
+ s
113
+ ]);
114
+ return /* @__PURE__ */ f(re.Provider, {
115
+ value: b,
116
+ children: /* @__PURE__ */ f("div", {
117
+ ref: i,
118
+ className: A("ig-accordion", n),
119
+ ...o,
120
+ children: r
121
+ })
122
+ });
123
+ }
124
+ function cn({ value: e, className: t, children: a, ref: n, ...r }) {
125
+ const { isOpen: s, toggle: i, baseId: o } = We(), l = s(e), u = B(() => ({
126
+ value: e,
127
+ open: l,
128
+ toggle: () => {
129
+ i(e);
130
+ },
131
+ headerId: `${o}-${e}-header`,
132
+ contentId: `${o}-${e}-content`
133
+ }), [
134
+ e,
135
+ l,
136
+ i,
137
+ o
138
+ ]);
139
+ return /* @__PURE__ */ f(ye.Provider, {
140
+ value: u,
141
+ children: /* @__PURE__ */ f("div", {
142
+ ref: n,
143
+ className: A("ig-accordion-item", l && "ig-accordion-item-open", t),
144
+ ...r,
145
+ children: a
146
+ })
147
+ });
148
+ }
149
+ function un({ className: e, children: t, hideIcon: a = !1, icon: n, disabled: r, onOpenChange: s, onKeyDown: i, ref: o, ...l }) {
150
+ const { open: u, toggle: d, headerId: c, contentId: b } = Ce(), m = T(null), v = (N) => {
151
+ m.current = N, typeof o == "function" ? o(N) : o && (o.current = N);
152
+ }, p = () => {
153
+ d(), s?.(!u);
154
+ }, I = (N) => {
155
+ if (i?.(N), N.defaultPrevented) return;
156
+ const k = m.current, g = k?.closest(".ig-accordion");
157
+ if (!k || !g) return;
158
+ const w = Array.from(g.querySelectorAll(".ig-accordion-header")).filter((C) => !C.disabled), S = w.indexOf(k);
159
+ if (S === -1) return;
160
+ let y = -1;
161
+ switch (N.key) {
162
+ case "ArrowDown":
163
+ y = (S + 1) % w.length;
164
+ break;
165
+ case "ArrowUp":
166
+ y = (S - 1 + w.length) % w.length;
167
+ break;
168
+ case "Home":
169
+ y = 0;
170
+ break;
171
+ case "End":
172
+ y = w.length - 1;
173
+ break;
174
+ default:
175
+ return;
176
+ }
177
+ N.preventDefault(), w[y]?.focus();
178
+ };
179
+ return /* @__PURE__ */ L("button", {
180
+ ...l,
181
+ ref: v,
182
+ id: c,
183
+ type: "button",
184
+ className: A("ig-accordion-header", e),
185
+ "aria-expanded": u,
186
+ "aria-controls": b,
187
+ disabled: r,
188
+ onClick: p,
189
+ onKeyDown: I,
190
+ children: [/* @__PURE__ */ f("span", { children: t }), !a && /* @__PURE__ */ f("span", {
191
+ className: "ig-accordion-icon",
192
+ "aria-hidden": "true",
193
+ children: n ?? "▼"
194
+ })]
195
+ });
196
+ }
197
+ function dn({ className: e, children: t, forceMount: a = !1, hidden: n, ref: r, ...s }) {
198
+ const { open: i, headerId: o, contentId: l } = Ce();
199
+ return !i && !a ? null : /* @__PURE__ */ f("div", {
200
+ ...s,
201
+ ref: r,
202
+ id: l,
203
+ role: "region",
204
+ "aria-labelledby": o,
205
+ className: A("ig-accordion-content", e),
206
+ hidden: n ?? (!i && a),
207
+ children: t
208
+ });
209
+ }
210
+ function fn({ variant: e = "info", icon: t, title: a, dismissible: n = !1, onClose: r, closeLabel: s = "Cerrar", open: i, defaultOpen: o = !0, onOpenChange: l, className: u, children: d, ref: c, ...b }) {
211
+ const { value: m, setValue: v } = $({
212
+ value: i,
213
+ defaultValue: o,
214
+ onChange: l
215
+ });
216
+ if (!m) return null;
217
+ const p = e === "danger" || e === "warning", I = () => {
218
+ v(!1), r?.();
219
+ };
220
+ return /* @__PURE__ */ L("div", {
221
+ ...b,
222
+ ref: c,
223
+ role: p ? "alert" : "status",
224
+ "aria-live": p ? "assertive" : "polite",
225
+ className: A("ig-alert", `ig-alert-${e}`, u),
226
+ children: [
227
+ t && /* @__PURE__ */ f("span", {
228
+ className: "ig-alert-icon",
229
+ "aria-hidden": "true",
230
+ children: t
231
+ }),
232
+ /* @__PURE__ */ L("div", {
233
+ className: "ig-alert-content",
234
+ children: [a && /* @__PURE__ */ f("div", {
235
+ className: "ig-alert-title",
236
+ children: a
237
+ }), d !== void 0 && /* @__PURE__ */ f("div", {
238
+ className: "ig-alert-description",
239
+ children: d
240
+ })]
241
+ }),
242
+ n && /* @__PURE__ */ f("button", {
243
+ type: "button",
244
+ className: "ig-alert-close",
245
+ onClick: I,
246
+ "aria-label": s,
247
+ children: "×"
248
+ })
249
+ ]
250
+ });
251
+ }
252
+ var ae = U(null);
253
+ function ie() {
254
+ return _(ae);
255
+ }
256
+ function Ne() {
257
+ const e = _(ae);
258
+ if (!e) throw new Error("DialogContent / DialogTrigger deben usarse dentro de <Dialog>");
259
+ return e;
260
+ }
261
+ function gn({ open: e, defaultOpen: t, onOpenChange: a, onClose: n, children: r }) {
262
+ const s = e !== void 0 && a === void 0 && n === void 0, { value: i, setValue: o } = $({
263
+ value: e,
264
+ defaultValue: t ?? !1,
265
+ onChange: a,
266
+ [z]: s
267
+ });
268
+ T(!1), F(() => {
269
+ }, [n, a]);
270
+ const l = M((v, p) => {
271
+ o(v, p), !p?.silent && !v && n?.();
272
+ }, [o, n]), u = H(), [d, c] = O(null), b = M((v) => {
273
+ c(v);
274
+ }, []), m = B(() => ({
275
+ open: i,
276
+ setOpen: l,
277
+ contentId: u,
278
+ headerId: d,
279
+ setHeaderId: b
280
+ }), [
281
+ i,
282
+ l,
283
+ u,
284
+ d,
285
+ b
286
+ ]);
287
+ return /* @__PURE__ */ f(ae.Provider, {
288
+ value: m,
289
+ children: r
290
+ });
291
+ }
292
+ function Ge({ size: e = "md", backdrop: t = "default", closeOnBackdrop: a = !0, closeOnEsc: n = !0, loading: r = !1, className: s, children: i, ref: o, onPointerDown: l, onClick: u, onClose: d, ...c }) {
293
+ const { open: b, setOpen: m, contentId: v, headerId: p } = Ne(), I = T(null), N = T(null), k = T(!1);
294
+ F(() => {
295
+ const y = I.current;
296
+ if (y)
297
+ return b && !y.open ? y.showModal() : !b && y.open && (k.current = !0, y.close()), () => {
298
+ k.current = !1;
299
+ };
300
+ }, [b]), F(() => {
301
+ const y = I.current;
302
+ if (!y || n) return;
303
+ const C = (D) => {
304
+ D.preventDefault();
305
+ };
306
+ return y.addEventListener("cancel", C), () => {
307
+ y.removeEventListener("cancel", C);
308
+ };
309
+ }, [n]);
310
+ const g = (y) => {
311
+ I.current = y, typeof o == "function" ? o(y) : o && (o.current = y);
312
+ }, w = t === "default" ? void 0 : t === "none" ? "ig-dialog-no-backdrop" : `ig-dialog-backdrop-${t}`, S = c["aria-labelledby"];
313
+ return /* @__PURE__ */ f("dialog", {
314
+ ...c,
315
+ ref: g,
316
+ id: v,
317
+ className: A("ig-dialog", e !== "md" && `ig-dialog-${e}`, w, r && "ig-dialog-loading", s),
318
+ "aria-labelledby": S ?? p ?? void 0,
319
+ "aria-busy": r || void 0,
320
+ onClose: (y) => {
321
+ if (d?.(y), k.current) {
322
+ k.current = !1;
323
+ return;
324
+ }
325
+ m(!1);
326
+ },
327
+ onPointerDown: (y) => {
328
+ l?.(y), N.current = y.target;
329
+ },
330
+ onClick: (y) => {
331
+ u?.(y);
332
+ const C = N.current;
333
+ N.current = null, !y.defaultPrevented && a && y.target === y.currentTarget && (C === null || C === y.currentTarget) && m(!1);
334
+ },
335
+ children: i
336
+ });
337
+ }
338
+ function ce(e, t) {
339
+ if (typeof e == "function") {
340
+ const a = e(t);
341
+ return typeof a == "function" ? a : void 0;
342
+ }
343
+ e.current = t;
344
+ }
345
+ function Ye(...e) {
346
+ const t = e.filter((a) => a != null);
347
+ return t.length === 0 ? null : (a) => {
348
+ const n = t.map((r) => ({
349
+ ref: r,
350
+ cleanup: ce(r, a)
351
+ }));
352
+ if (n.some((r) => typeof r.cleanup == "function")) return () => {
353
+ for (const { ref: r, cleanup: s } of n) typeof s == "function" ? s() : ce(r, null);
354
+ };
355
+ };
356
+ }
357
+ function Ze(e, t) {
358
+ if (!(!e && !t))
359
+ return (a) => {
360
+ e?.(a), a.defaultPrevented || t?.(a);
361
+ };
362
+ }
363
+ function G({ children: e, ...t }) {
364
+ return e == null || e === !1 || W(e) && e.type === Z || te.count(e) > 1 || !W(e) ? null : Je(e, t);
365
+ }
366
+ function Je(e, t) {
367
+ const a = e.props ?? {}, n = { ...t };
368
+ for (const r of Object.keys(a)) {
369
+ const s = a[r], i = n[r];
370
+ r === "className" ? n[r] = A(i, s) : r === "style" ? n[r] = {
371
+ ...i ?? {},
372
+ ...s ?? {}
373
+ } : r === "ref" ? n[r] = Ye(i, s) : typeof i == "function" && typeof s == "function" && /^on[A-Z]/.test(r) ? n[r] = Ze(s, i) : s !== void 0 && (n[r] = s);
374
+ }
375
+ return J(e, n);
376
+ }
377
+ function bn({ asChild: e = !1, type: t = "button", onClick: a, children: n, ref: r, ...s }) {
378
+ const { open: i, setOpen: o, contentId: l } = Ne(), u = (d) => {
379
+ a?.(d), !d.defaultPrevented && o(!0);
380
+ };
381
+ return e ? /* @__PURE__ */ f(G, {
382
+ ...s,
383
+ ref: r,
384
+ type: t,
385
+ "aria-haspopup": "dialog",
386
+ "aria-expanded": i,
387
+ "aria-controls": l,
388
+ onClick: u,
389
+ children: n
390
+ }) : /* @__PURE__ */ f("button", {
391
+ ...s,
392
+ ref: r,
393
+ type: t,
394
+ "aria-haspopup": "dialog",
395
+ "aria-expanded": i,
396
+ "aria-controls": l,
397
+ onClick: u,
398
+ children: n
399
+ });
400
+ }
401
+ function mn({ className: e, children: t, id: a, ref: n, ...r }) {
402
+ const s = H(), i = a ?? s, o = ie(), l = o?.setHeaderId;
403
+ return o?.headerId, F(() => {
404
+ if (l)
405
+ return l(i), () => {
406
+ l(null);
407
+ };
408
+ }, [i, l]), /* @__PURE__ */ f("div", {
409
+ ref: n,
410
+ id: i,
411
+ className: A("ig-dialog-header", e),
412
+ ...r,
413
+ children: t
414
+ });
415
+ }
416
+ function pn({ asChild: e = !1, className: t, children: a, type: n = "button", "aria-label": r, onClick: s, ref: i, ...o }) {
417
+ const l = ie(), u = (c) => {
418
+ s?.(c), !c.defaultPrevented && l?.setOpen(!1);
419
+ };
420
+ return e ? /* @__PURE__ */ f(G, {
421
+ ...o,
422
+ ref: i,
423
+ type: n,
424
+ className: t,
425
+ ...r !== void 0 ? { "aria-label": r } : {},
426
+ onClick: u,
427
+ children: a
428
+ }) : /* @__PURE__ */ f("button", {
429
+ ...o,
430
+ ref: i,
431
+ type: n,
432
+ "aria-label": r ?? "Cerrar",
433
+ className: A("ig-dialog-close", t),
434
+ onClick: u,
435
+ children: a ?? "×"
436
+ });
437
+ }
438
+ function vn({ closeOnBackdrop: e = !1, role: t = "alertdialog", ref: a, ...n }) {
439
+ return /* @__PURE__ */ f(Ge, {
440
+ ...n,
441
+ closeOnBackdrop: e,
442
+ role: t,
443
+ ...a ? { ref: a } : {}
444
+ });
445
+ }
446
+ function hn({ asChild: e = !1, className: t, children: a, type: n = "button", "aria-label": r, onClick: s, ref: i, ...o }) {
447
+ const l = ie(), u = (c) => {
448
+ s?.(c), !c.defaultPrevented && l?.setOpen(!1);
449
+ };
450
+ return e ? /* @__PURE__ */ f(G, {
451
+ ...o,
452
+ ref: i,
453
+ type: n,
454
+ className: t,
455
+ ...r !== void 0 ? { "aria-label": r } : {},
456
+ onClick: u,
457
+ children: a
458
+ }) : /* @__PURE__ */ f("button", {
459
+ ...o,
460
+ ref: i,
461
+ type: n,
462
+ "aria-label": r ?? "Cerrar",
463
+ className: A("ig-dialog-close", t),
464
+ onClick: u,
465
+ children: a ?? "×"
466
+ });
467
+ }
468
+ var Qe = {
469
+ online: "en línea",
470
+ offline: "sin conexión",
471
+ busy: "ocupado",
472
+ away: "ausente"
473
+ };
474
+ function yn(e) {
475
+ const { size: t, rounded: a = !1, status: n, statusLabel: r, className: s, ref: i, src: o, alt: l, initials: u, loading: d = "lazy", "aria-label": c, ...b } = e, [m, v] = O(!1), [p, I] = O(o);
476
+ o !== p && (I(o), v(!1));
477
+ const N = !o || m ? !!u : !1, k = o && !m, g = c ?? (m && o && l ? l : void 0), w = g ? "img" : void 0;
478
+ return /* @__PURE__ */ L("div", {
479
+ ref: i,
480
+ className: A("ig-avatar", t && `ig-avatar-${t}`, a && "ig-avatar-rounded", s),
481
+ role: w,
482
+ "aria-label": g,
483
+ ...b,
484
+ children: [
485
+ k && /* @__PURE__ */ f("img", {
486
+ src: o,
487
+ alt: l,
488
+ loading: d,
489
+ onError: () => {
490
+ v(!0);
491
+ }
492
+ }),
493
+ N && /* @__PURE__ */ f("span", {
494
+ "aria-hidden": "true",
495
+ children: u
496
+ }),
497
+ n && /* @__PURE__ */ f("span", {
498
+ role: "img",
499
+ className: `ig-avatar-status ig-avatar-status-${n}`,
500
+ "aria-label": r ?? `Estado: ${Qe[n]}`
501
+ })
502
+ ]
503
+ });
504
+ }
505
+ function Y(e, t) {
506
+ F(() => {
507
+ }, [e, t]);
508
+ }
509
+ function Cn({ separator: e = "/", className: t, children: a, ref: n, ...r }) {
510
+ const s = te.toArray(a).filter(W), { "aria-label": i, ...o } = r, l = i ?? "Migas de pan";
511
+ return Y("navigation", l), /* @__PURE__ */ f("nav", {
512
+ ...o,
513
+ ref: n,
514
+ "aria-label": l,
515
+ className: A("ig-breadcrumb", t),
516
+ children: s.map((u, d) => /* @__PURE__ */ L(Z, { children: [u, d < s.length - 1 && /* @__PURE__ */ f("span", {
517
+ className: "ig-breadcrumb-separator",
518
+ "aria-hidden": "true",
519
+ children: e
520
+ })] }, d))
521
+ });
522
+ }
523
+ function Nn({ as: e, variant: t, appearance: a = "outline", bordered: n = !1, elevated: r = !1, glass: s = !1, interactive: i = !1, className: o, children: l, ref: u, role: d, onClick: c, onKeyDown: b, ...m }) {
524
+ const v = e ?? "div", p = i && d === "button" && !!c;
525
+ T(!1), F(() => {
526
+ }, [
527
+ e,
528
+ i,
529
+ c,
530
+ d
531
+ ]);
532
+ const I = (k) => {
533
+ b?.(k), p && (k.defaultPrevented || (k.key === "Enter" || k.key === " ") && (k.preventDefault(), k.currentTarget.click()));
534
+ }, N = t && (a === "filled" ? `ig-card-${t}-filled` : `ig-card-${t}`);
535
+ return /* @__PURE__ */ f(v, {
536
+ ref: u,
537
+ role: d,
538
+ tabIndex: p ? 0 : void 0,
539
+ onClick: c,
540
+ onKeyDown: p || b ? I : void 0,
541
+ className: A("ig-card", N, n && "ig-card-bordered", r && "ig-card-elevated", s && "ig-card-glass", i && "ig-card-interactive", o),
542
+ ...m,
543
+ children: l
544
+ });
545
+ }
546
+ function kn({ variant: e = "brand", className: t, children: a, ref: n, disabled: r, indeterminate: s, describedBy: i, onChange: o, ...l }) {
547
+ const { "aria-describedby": u, ...d } = l, c = j(u, i), b = T(null), m = M((p) => {
548
+ b.current = p, typeof n == "function" ? n(p) : n && (n.current = p);
549
+ }, [n]);
550
+ T(!1), F(() => {
551
+ }, [
552
+ l.checked !== void 0,
553
+ o,
554
+ r
555
+ ]), q(() => {
556
+ b.current && (b.current.indeterminate = !!s);
557
+ }, [s]);
558
+ const v = (p) => {
559
+ s && b.current && (b.current.indeterminate = !0), o?.(p);
560
+ };
561
+ return /* @__PURE__ */ L("label", {
562
+ className: A("ig-checkbox", `ig-checkbox-${e}`, t),
563
+ "data-disabled": r ? "true" : void 0,
564
+ children: [
565
+ /* @__PURE__ */ f("input", {
566
+ ...d,
567
+ ref: m,
568
+ type: "checkbox",
569
+ disabled: r,
570
+ "aria-checked": s ? "mixed" : void 0,
571
+ "aria-describedby": c,
572
+ onChange: v
573
+ }),
574
+ /* @__PURE__ */ f("span", {
575
+ className: "ig-checkbox-mark",
576
+ "aria-hidden": "true"
577
+ }),
578
+ a !== void 0 && /* @__PURE__ */ f("span", { children: a })
579
+ ]
580
+ });
581
+ }
582
+ function oe(e, t) {
583
+ T(!1), F(() => {
584
+ }, [e, t]);
585
+ }
586
+ function wn({ size: e = "md", state: t = "default", describedBy: a, className: n, ref: r, ...s }) {
587
+ const { "aria-describedby": i, ...o } = s, l = j(i, a), u = T(null);
588
+ oe(u, "Input");
589
+ const d = M((c) => {
590
+ u.current = c, typeof r == "function" ? r(c) : r && (r.current = c);
591
+ }, [r]);
592
+ return /* @__PURE__ */ f("input", {
593
+ ...o,
594
+ ref: d,
595
+ className: A("ig-input", e !== "md" && `ig-input-${e}`, t === "invalid" && "ig-input-invalid", t === "valid" && "ig-input-valid", n),
596
+ "aria-invalid": t === "invalid" ? !0 : void 0,
597
+ "aria-describedby": l
598
+ });
599
+ }
600
+ [
601
+ "article",
602
+ "aside",
603
+ "nav",
604
+ "section",
605
+ "main",
606
+ '[role="main"]',
607
+ '[role="article"]',
608
+ '[role="complementary"]',
609
+ '[role="navigation"]',
610
+ '[role="region"]'
611
+ ].join(", ");
612
+ function Xe(e, t) {
613
+ F(() => {
614
+ }, [e, t]);
615
+ }
616
+ function In({ className: e, position: t, glass: a, ref: n, ...r }) {
617
+ const s = T(null);
618
+ return Xe(s, "banner"), /* @__PURE__ */ f("header", {
619
+ ref: M((i) => {
620
+ s.current = i, typeof n == "function" ? n(i) : n && (n.current = i);
621
+ }, [n]),
622
+ className: A("ig-navbar", t && `ig-navbar-${t}`, a && "ig-navbar-glass", e),
623
+ ...r
624
+ });
625
+ }
626
+ function Rn({ className: e, ref: t, ...a }) {
627
+ const { "aria-label": n, ...r } = a, s = n ?? "Principal";
628
+ return Y("navigation", s), /* @__PURE__ */ f("nav", {
629
+ ...r,
630
+ ref: t,
631
+ "aria-label": s,
632
+ className: A("ig-navbar-nav", e)
633
+ });
634
+ }
635
+ function et(e, t, a) {
636
+ if (t <= a * 2 + 5) return Array.from({ length: t }, (l, u) => u + 1);
637
+ const n = Math.max(e - a, 2), r = Math.min(e + a, t - 1), s = n > 2, i = r < t - 1, o = [1];
638
+ s && o.push("ellipsis-start");
639
+ for (let l = n; l <= r; l++) o.push(l);
640
+ return i && o.push("ellipsis-end"), o.push(t), o;
641
+ }
642
+ function An({ page: e, defaultPage: t = 1, totalPages: a, siblingCount: n = 1, onPageChange: r, variant: s, prevLabel: i = "Anterior", nextLabel: o = "Siguiente", prevAriaLabel: l, nextAriaLabel: u, getPageLabel: d = (v) => `Página ${String(v)}`, className: c, ref: b, ...m }) {
643
+ const v = l ?? (typeof i == "string" ? i : "Página anterior"), p = u ?? (typeof o == "string" ? o : "Página siguiente"), { "aria-label": I, ...N } = m, k = I ?? "Paginación";
644
+ Y("navigation", k);
645
+ const g = Math.max(1, Math.floor(a || 1)), { value: w, setValue: S } = $({
646
+ value: e,
647
+ defaultValue: Math.min(Math.max(1, Math.floor(t || 1)), g),
648
+ onChange: r
649
+ }), y = g, C = Math.min(Math.max(1, Math.floor(w || 1)), y), D = Math.max(0, Math.floor(n || 0));
650
+ F(() => {
651
+ e === void 0 && w !== C && S(C, { silent: !0 });
652
+ }, [
653
+ e,
654
+ w,
655
+ C,
656
+ S
657
+ ]), T(!1), F(() => {
658
+ }, [
659
+ e,
660
+ a,
661
+ C,
662
+ y
663
+ ]);
664
+ const h = et(C, y, D), R = C > 1, P = C < y, x = (E) => {
665
+ E !== C && S(E);
666
+ };
667
+ return /* @__PURE__ */ L("nav", {
668
+ ...N,
669
+ ref: b,
670
+ "aria-label": k,
671
+ className: A("ig-pagination", s && `ig-pagination-${s}`, c),
672
+ children: [
673
+ /* @__PURE__ */ f("button", {
674
+ type: "button",
675
+ className: "ig-pagination-item ig-pagination-prev",
676
+ disabled: !R,
677
+ "aria-label": v,
678
+ onClick: () => {
679
+ R && x(C - 1);
680
+ },
681
+ children: i
682
+ }),
683
+ h.map((E, V) => {
684
+ if (E === "ellipsis-start" || E === "ellipsis-end") return /* @__PURE__ */ f("span", {
685
+ className: "ig-pagination-ellipsis",
686
+ "aria-hidden": "true",
687
+ children: "…"
688
+ }, E + String(V));
689
+ const K = E === C;
690
+ return /* @__PURE__ */ f("button", {
691
+ type: "button",
692
+ className: A("ig-pagination-item", K && "ig-pagination-active"),
693
+ "aria-current": K ? "page" : void 0,
694
+ "aria-label": d(E),
695
+ onClick: () => {
696
+ K || x(E);
697
+ },
698
+ children: E
699
+ }, E);
700
+ }),
701
+ /* @__PURE__ */ f("button", {
702
+ type: "button",
703
+ className: "ig-pagination-item ig-pagination-next",
704
+ disabled: !P,
705
+ "aria-label": p,
706
+ onClick: () => {
707
+ P && x(C + 1);
708
+ },
709
+ children: o
710
+ })
711
+ ]
712
+ });
713
+ }
714
+ function xn({ value: e, defaultValue: t = 0, max: a = 5, readOnly: n = !1, size: r = "md", onValueChange: s, describedBy: i, getStarLabel: o, name: l, className: u, ref: d, ...c }) {
715
+ const { "aria-label": b, "aria-describedby": m, ...v } = c, p = j(m, i), I = Math.max(1, Math.floor(a)), { value: N, setValue: k } = $({
716
+ value: e,
717
+ defaultValue: Math.min(Math.max(t, 0), I),
718
+ onChange: s,
719
+ [z]: n
720
+ }), g = Math.min(Math.max(N, 0), I), [w, S] = O(null), y = w ?? g, C = g > 0 ? g : 1, D = (R, P) => {
721
+ n || (k(Math.min(Math.max(R, 1), I)), P?.focus());
722
+ }, h = (R, P) => {
723
+ if (n) return;
724
+ const x = R.currentTarget.parentElement;
725
+ if (!x) return;
726
+ const E = Array.from(x.querySelectorAll('button[role="radio"]'));
727
+ switch (R.key) {
728
+ case "ArrowRight":
729
+ case "ArrowDown": {
730
+ R.preventDefault();
731
+ const V = Math.min(P + 1, I);
732
+ D(V, E[V - 1] ?? null);
733
+ break;
734
+ }
735
+ case "ArrowLeft":
736
+ case "ArrowUp": {
737
+ R.preventDefault();
738
+ const V = Math.max(P - 1, 1);
739
+ D(V, E[V - 1] ?? null);
740
+ break;
741
+ }
742
+ case "Home":
743
+ R.preventDefault(), D(1, E[0] ?? null);
744
+ break;
745
+ case "End":
746
+ R.preventDefault(), D(I, E[I - 1] ?? null);
747
+ break;
748
+ case " ":
749
+ case "Enter":
750
+ R.preventDefault(), k(P);
751
+ break;
752
+ default:
753
+ break;
754
+ }
755
+ };
756
+ return /* @__PURE__ */ L("div", {
757
+ ...v,
758
+ ref: d,
759
+ role: "radiogroup",
760
+ "aria-label": b ?? "Puntuación",
761
+ "aria-describedby": p,
762
+ "aria-readonly": n || void 0,
763
+ className: A("ig-rating", n && "ig-rating-readonly", r !== "md" && `ig-rating-${r}`, u),
764
+ onMouseLeave: () => {
765
+ n || S(null);
766
+ },
767
+ children: [Array.from({ length: I }, (R, P) => {
768
+ const x = P + 1, E = x <= y, V = x === C;
769
+ return /* @__PURE__ */ f("button", {
770
+ type: "button",
771
+ role: "radio",
772
+ "aria-checked": x === g,
773
+ "aria-label": o?.(x) ?? `${String(x)} ${x === 1 ? "estrella" : "estrellas"}`,
774
+ tabIndex: V ? 0 : -1,
775
+ className: A("ig-star", E && "ig-star-filled"),
776
+ onClick: () => {
777
+ n || k(x);
778
+ },
779
+ onKeyDown: (K) => {
780
+ h(K, x);
781
+ },
782
+ onMouseEnter: () => {
783
+ n || S(x);
784
+ }
785
+ }, x);
786
+ }), l !== void 0 && /* @__PURE__ */ f("input", {
787
+ type: "hidden",
788
+ name: l,
789
+ value: String(g)
790
+ })]
791
+ });
792
+ }
793
+ function Dn({ state: e = "default", describedBy: t, className: a, children: n, ref: r, ...s }) {
794
+ const { "aria-describedby": i, ...o } = s, l = j(i, t), u = T(null);
795
+ oe(u, "NativeSelect");
796
+ const d = M((c) => {
797
+ u.current = c, typeof r == "function" ? r(c) : r && (r.current = c);
798
+ }, [r]);
799
+ return /* @__PURE__ */ f("select", {
800
+ ...o,
801
+ ref: d,
802
+ className: A("ig-native-select", e === "invalid" && "ig-input-invalid", e === "valid" && "ig-input-valid", a),
803
+ "aria-invalid": e === "invalid" ? !0 : void 0,
804
+ "aria-describedby": l,
805
+ children: n
806
+ });
807
+ }
808
+ var ke = U(null);
809
+ function we() {
810
+ const e = _(ke);
811
+ if (!e) throw new Error("Componentes SidebarToggle/Item/etc. deben usarse dentro de <Sidebar>");
812
+ return e;
813
+ }
814
+ function Tn({ collapsed: e, defaultCollapsed: t = !1, onCollapsedChange: a, className: n, children: r, ref: s, ...i }) {
815
+ const { "aria-label": o, id: l, ...u } = i, d = o ?? "Navegación lateral", c = H(), b = l ?? c;
816
+ Y("complementary", d);
817
+ const { value: m, setValue: v } = $({
818
+ value: e,
819
+ defaultValue: t,
820
+ onChange: a
821
+ }), p = B(() => ({
822
+ collapsed: m,
823
+ setCollapsed: v,
824
+ asideId: b
825
+ }), [
826
+ m,
827
+ v,
828
+ b
829
+ ]);
830
+ return /* @__PURE__ */ f(ke.Provider, {
831
+ value: p,
832
+ children: /* @__PURE__ */ f("aside", {
833
+ ...u,
834
+ ref: s,
835
+ id: b,
836
+ "aria-label": d,
837
+ className: A("ig-sidebar", m && "ig-sidebar-collapsed", n),
838
+ children: r
839
+ })
840
+ });
841
+ }
842
+ function Sn({ className: e, children: t, ref: a, ...n }) {
843
+ const { "aria-label": r, ...s } = n, i = r ?? "Principal";
844
+ return Y("navigation", i), /* @__PURE__ */ f("nav", {
845
+ ...s,
846
+ ref: a,
847
+ "aria-label": i,
848
+ className: A("ig-sidebar-nav", e),
849
+ children: t
850
+ });
851
+ }
852
+ function En(e) {
853
+ const { collapsed: t } = we();
854
+ if (e.href !== void 0) {
855
+ const { icon: c, active: b, className: m, children: v, ref: p, "aria-label": I, ...N } = e;
856
+ return /* @__PURE__ */ L("a", {
857
+ ...N,
858
+ ref: p,
859
+ "aria-current": b ? "page" : void 0,
860
+ "aria-label": I ?? (t && typeof v == "string" ? v : void 0),
861
+ className: A("ig-sidebar-item", b && "ig-sidebar-item-active", m),
862
+ children: [c !== void 0 && /* @__PURE__ */ f("span", {
863
+ className: "ig-sidebar-icon",
864
+ "aria-hidden": "true",
865
+ children: c
866
+ }), /* @__PURE__ */ f("span", {
867
+ className: "ig-sidebar-text",
868
+ children: v
869
+ })]
870
+ });
871
+ }
872
+ const { icon: a, active: n, className: r, type: s = "button", children: i, ref: o, "aria-label": l, ...u } = e;
873
+ return /* @__PURE__ */ L("button", {
874
+ ...u,
875
+ ref: o,
876
+ type: s,
877
+ "aria-current": n ? "page" : void 0,
878
+ "aria-label": l ?? (t && typeof i == "string" ? i : void 0),
879
+ className: A("ig-sidebar-item", n && "ig-sidebar-item-active", r),
880
+ children: [a !== void 0 && /* @__PURE__ */ f("span", {
881
+ className: "ig-sidebar-icon",
882
+ "aria-hidden": "true",
883
+ children: a
884
+ }), /* @__PURE__ */ f("span", {
885
+ className: "ig-sidebar-text",
886
+ children: i
887
+ })]
888
+ });
889
+ }
890
+ function Pn({ className: e, children: t = "☰", type: a = "button", expandLabel: n = "Expandir sidebar", collapseLabel: r = "Colapsar sidebar", onClick: s, ref: i, ...o }) {
891
+ const { collapsed: l, setCollapsed: u, asideId: d } = we();
892
+ return /* @__PURE__ */ f("button", {
893
+ ...o,
894
+ ref: i,
895
+ type: a,
896
+ "aria-expanded": !l,
897
+ "aria-controls": d,
898
+ "aria-label": l ? n : r,
899
+ className: A("ig-sidebar-toggle", e),
900
+ onClick: (c) => {
901
+ s?.(c), c.defaultPrevented || u(!l);
902
+ },
903
+ children: t
904
+ });
905
+ }
906
+ function Mn({ min: e = 0, max: t = 100, step: a = 1, value: n, defaultValue: r, showValue: s = !1, formatValue: i, className: o, onValueChange: l, describedBy: u, ref: d, ...c }) {
907
+ const { "aria-describedby": b, ...m } = c, v = j(b, u), p = Number(e), I = Number.isFinite(p) ? p : 0, N = typeof r == "number" ? r : typeof r == "string" && r.length > 0 ? Number(r) : NaN, k = Number.isFinite(N) ? N : I, g = typeof n == "number" ? n : typeof n == "string" && n.length > 0 ? Number(n) : void 0, { value: w, setValue: S, isControlled: y } = $({
908
+ value: g === void 0 ? void 0 : Number.isFinite(g) ? g : I,
909
+ defaultValue: k,
910
+ onChange: l
911
+ });
912
+ T(!1), F(() => {
913
+ }, [
914
+ r,
915
+ N,
916
+ I,
917
+ n,
918
+ g
919
+ ]);
920
+ const C = w, D = Number.isFinite(C) ? C : I, h = i ? i(D) : String(D), R = (E) => typeof E == "number" || typeof E == "string", P = y && R(n) && Number.isFinite(g) ? { value: n } : y ? { value: String(D) } : R(r) ? { defaultValue: r } : { defaultValue: String(k) }, x = /* @__PURE__ */ f("input", {
921
+ ...m,
922
+ ref: d,
923
+ type: "range",
924
+ className: A("ig-slider", o),
925
+ min: e,
926
+ max: t,
927
+ step: a,
928
+ "aria-valuetext": i ? h : void 0,
929
+ "aria-describedby": v,
930
+ ...P,
931
+ onChange: (E) => {
932
+ const V = Number(E.target.value);
933
+ S(V);
934
+ }
935
+ });
936
+ return s ? /* @__PURE__ */ L("div", {
937
+ className: "ig-slider-group",
938
+ children: [x, /* @__PURE__ */ f("span", {
939
+ className: "ig-slider-value",
940
+ "aria-hidden": "true",
941
+ children: h
942
+ })]
943
+ }) : x;
944
+ }
945
+ function Fn({ active: e, defaultActive: t, onActiveChange: a, labeled: n = !1, className: r, children: s, ref: i, ...o }) {
946
+ const l = te.toArray(s).filter(W), u = l.length, d = e !== void 0, c = !d || a !== void 0, b = d && !c, { value: m, setValue: v } = $({
947
+ value: e,
948
+ defaultValue: t ?? 0,
949
+ onChange: a,
950
+ [z]: b
951
+ }), p = B(() => {
952
+ if (u === 0) return 0;
953
+ const h = u - 1;
954
+ return !Number.isFinite(m) || m < 0 ? 0 : m > h ? h : m;
955
+ }, [m, u]), [I, N] = O(u);
956
+ I !== u && (N(u), !d && u > 0 && m > u - 1 && v(u - 1, { silent: !0 })), T(!1), F(() => {
957
+ }, [
958
+ e,
959
+ d,
960
+ u
961
+ ]);
962
+ const { "aria-label": k, ...g } = o, w = T(null), S = T(null);
963
+ F(() => {
964
+ if (S.current === null) return;
965
+ const h = S.current;
966
+ S.current = null, h === p && w.current?.querySelector(`.ig-step[role="button"][data-step-index="${String(h)}"]`)?.focus();
967
+ }, [p]);
968
+ const y = M((h) => {
969
+ if (!c) return;
970
+ const R = u - 1, P = Number(h.currentTarget.dataset.stepIndex), x = Number.isInteger(P) && P >= 0 && P <= R ? P : p;
971
+ let E = -1;
972
+ switch (h.key) {
973
+ case "ArrowLeft":
974
+ case "ArrowUp":
975
+ E = x > 0 ? x - 1 : R;
976
+ break;
977
+ case "ArrowRight":
978
+ case "ArrowDown":
979
+ E = x < R ? x + 1 : 0;
980
+ break;
981
+ case "Home":
982
+ E = 0;
983
+ break;
984
+ case "End":
985
+ E = R;
986
+ break;
987
+ default:
988
+ return;
989
+ }
990
+ h.preventDefault(), S.current = E, v(E);
991
+ }, [
992
+ p,
993
+ c,
994
+ v,
995
+ u
996
+ ]), C = M((h) => {
997
+ c && h !== p && v(h);
998
+ }, [
999
+ p,
1000
+ c,
1001
+ v
1002
+ ]), D = M((h) => {
1003
+ w.current = h, typeof i == "function" ? i(h) : i && (i.current = h);
1004
+ }, [i]);
1005
+ return /* @__PURE__ */ f("div", {
1006
+ ...g,
1007
+ ref: D,
1008
+ role: "group",
1009
+ "aria-label": k ?? "Progreso",
1010
+ className: A(n ? "ig-stepper-labeled" : "ig-stepper", r),
1011
+ children: l.map((h, R) => {
1012
+ const P = c ? {
1013
+ onActivate: () => {
1014
+ C(R);
1015
+ },
1016
+ onStepKeyDown: y
1017
+ } : {}, x = J(h, {
1018
+ index: R + 1,
1019
+ active: R === p,
1020
+ complete: R < p,
1021
+ labeled: n,
1022
+ interactive: c,
1023
+ ...P
1024
+ });
1025
+ return n ? /* @__PURE__ */ f(Z, { children: x }, R) : /* @__PURE__ */ L(Z, { children: [x, R < u - 1 && /* @__PURE__ */ f("span", {
1026
+ className: A("ig-step-line", R < p && "ig-step-line-complete"),
1027
+ "aria-hidden": "true"
1028
+ })] }, R);
1029
+ })
1030
+ });
1031
+ }
1032
+ function tt({ variant: e = "brand", className: t, children: a, ref: n, disabled: r, checked: s, defaultChecked: i, indeterminate: o, describedBy: l, onChange: u, ...d }) {
1033
+ const { "aria-describedby": c, ...b } = d, m = j(c, l), { value: v, setValue: p, isControlled: I } = $({
1034
+ value: s,
1035
+ defaultValue: i === !0,
1036
+ [z]: !0
1037
+ });
1038
+ T(!1), F(() => {
1039
+ }, [
1040
+ I,
1041
+ u,
1042
+ r
1043
+ ]);
1044
+ const N = T(null), k = M((w) => {
1045
+ N.current = w, typeof n == "function" ? n(w) : n && (n.current = w);
1046
+ }, [n]);
1047
+ q(() => {
1048
+ N.current && (N.current.indeterminate = !!o);
1049
+ }, [o]);
1050
+ const g = (w) => {
1051
+ o && N.current && (N.current.indeterminate = !0), p(w.target.checked), u?.(w);
1052
+ };
1053
+ return /* @__PURE__ */ L("label", {
1054
+ className: A("ig-switch", `ig-switch-${e}`, t),
1055
+ "data-disabled": r ? "true" : void 0,
1056
+ children: [
1057
+ /* @__PURE__ */ f("input", {
1058
+ ...b,
1059
+ ref: k,
1060
+ type: "checkbox",
1061
+ role: o ? "checkbox" : "switch",
1062
+ "aria-checked": o ? "mixed" : v,
1063
+ "aria-describedby": m,
1064
+ disabled: r,
1065
+ onChange: g,
1066
+ ...I ? { checked: s } : { defaultChecked: i }
1067
+ }),
1068
+ /* @__PURE__ */ f("span", {
1069
+ className: "ig-switch-track",
1070
+ "aria-hidden": "true"
1071
+ }),
1072
+ a !== void 0 && /* @__PURE__ */ f("span", { children: a })
1073
+ ]
1074
+ });
1075
+ }
1076
+ var Ie = U(null);
1077
+ function se() {
1078
+ const e = _(Ie);
1079
+ if (!e) throw new Error("Componentes TabsTrigger/TabsContent/TabsList deben usarse dentro de <Tabs>");
1080
+ return e;
1081
+ }
1082
+ function Ln({ value: e, defaultValue: t, onValueChange: a, variant: n, pills: r = !1, orientation: s = "horizontal", className: i, children: o, ref: l, ...u }) {
1083
+ const d = H(), { value: c, setValue: b, isControlled: m } = $({
1084
+ value: e,
1085
+ defaultValue: t ?? "",
1086
+ onChange: a
1087
+ }), v = M((C) => {
1088
+ b(C);
1089
+ }, [b]), [p, I] = O([]), N = T(!1), k = M((C) => (I((D) => D.includes(C) ? D : [...D, C]), () => {
1090
+ I((D) => D.filter((h) => h !== C));
1091
+ }), []), g = T(!1);
1092
+ q(() => {
1093
+ if (g.current || m || c !== "") return;
1094
+ const C = p[0];
1095
+ C !== void 0 && (g.current = !0, b(C, { silent: !0 }));
1096
+ }, [
1097
+ p,
1098
+ m,
1099
+ c,
1100
+ b
1101
+ ]), F(() => {
1102
+ if (p.length === 0 || c === "" || p.includes(c)) return;
1103
+ const C = p[0];
1104
+ C !== void 0 && (N.current, m || b(C, { silent: !0 }));
1105
+ }, [
1106
+ p,
1107
+ c,
1108
+ m,
1109
+ b
1110
+ ]);
1111
+ const w = p.includes(c), S = p[0], y = B(() => ({
1112
+ selected: c,
1113
+ setSelected: v,
1114
+ baseId: d,
1115
+ orientation: s,
1116
+ register: k,
1117
+ selectedExists: w,
1118
+ firstRegistered: S
1119
+ }), [
1120
+ c,
1121
+ v,
1122
+ d,
1123
+ s,
1124
+ k,
1125
+ w,
1126
+ S
1127
+ ]);
1128
+ return /* @__PURE__ */ f(Ie.Provider, {
1129
+ value: y,
1130
+ children: /* @__PURE__ */ f("div", {
1131
+ ...u,
1132
+ ref: l,
1133
+ className: A("ig-tabs", n && `ig-tabs-${n}`, r && "ig-tabs-pills", s === "vertical" && "ig-tabs-vertical", i),
1134
+ children: o
1135
+ })
1136
+ });
1137
+ }
1138
+ function Vn({ className: e, children: t, ref: a, ...n }) {
1139
+ const { orientation: r } = se();
1140
+ return /* @__PURE__ */ f("div", {
1141
+ ...n,
1142
+ ref: a,
1143
+ role: "tablist",
1144
+ "aria-orientation": r,
1145
+ className: A("ig-tabs-list", e),
1146
+ children: t
1147
+ });
1148
+ }
1149
+ function $n({ value: e, className: t, children: a, disabled: n, onKeyDown: r, ref: s, ...i }) {
1150
+ const { selected: o, setSelected: l, baseId: u, orientation: d, register: c, selectedExists: b, firstRegistered: m } = se(), v = o === e, p = `${u}-tab-${e}`, I = `${u}-panel-${e}`, N = !b && e === m;
1151
+ q(() => c(e), [c, e]);
1152
+ const k = (g) => {
1153
+ if (r?.(g), g.defaultPrevented) return;
1154
+ const w = d === "horizontal" ? "ArrowRight" : "ArrowDown", S = d === "horizontal" ? "ArrowLeft" : "ArrowUp", y = g.currentTarget.closest('[role="tablist"]');
1155
+ if (!y) return;
1156
+ const C = Array.from(y.querySelectorAll('[role="tab"]:not([disabled])')), D = C.indexOf(g.currentTarget);
1157
+ if (D === -1) return;
1158
+ let h;
1159
+ if (g.key === w) h = C[(D + 1) % C.length];
1160
+ else if (g.key === S) h = C[(D - 1 + C.length) % C.length];
1161
+ else if (g.key === "Home") h = C[0];
1162
+ else if (g.key === "End") h = C[C.length - 1];
1163
+ else return;
1164
+ g.preventDefault(), h?.focus(), h?.click();
1165
+ };
1166
+ return /* @__PURE__ */ f("button", {
1167
+ ...i,
1168
+ ref: s,
1169
+ role: "tab",
1170
+ type: "button",
1171
+ id: p,
1172
+ "aria-selected": v,
1173
+ "aria-controls": I,
1174
+ tabIndex: v || N ? 0 : -1,
1175
+ disabled: n,
1176
+ className: A("ig-tabs-trigger", v && "ig-tabs-trigger-active", t),
1177
+ onClick: (g) => {
1178
+ i.onClick?.(g), !g.defaultPrevented && !n && l(e);
1179
+ },
1180
+ onKeyDown: k,
1181
+ children: a
1182
+ });
1183
+ }
1184
+ function On({ value: e, keepMounted: t = !1, className: a, children: n, ref: r, ...s }) {
1185
+ const { selected: i, baseId: o } = se(), l = i === e, u = `${o}-tab-${e}`, d = `${o}-panel-${e}`;
1186
+ return !l && !t ? null : /* @__PURE__ */ f("div", {
1187
+ ...s,
1188
+ ref: r,
1189
+ role: "tabpanel",
1190
+ id: d,
1191
+ "aria-labelledby": u,
1192
+ hidden: !l,
1193
+ tabIndex: l ? 0 : -1,
1194
+ className: A("ig-tabs-content", l && "ig-tabs-content-active", a),
1195
+ children: n
1196
+ });
1197
+ }
1198
+ function Bn({ auto: e = !1, state: t = "default", describedBy: a, className: n, ref: r, ...s }) {
1199
+ const { "aria-describedby": i, ...o } = s, l = j(i, a), u = T(null);
1200
+ oe(u, "Textarea");
1201
+ const d = M((c) => {
1202
+ u.current = c, typeof r == "function" ? r(c) : r && (r.current = c);
1203
+ }, [r]);
1204
+ return /* @__PURE__ */ f("textarea", {
1205
+ ...o,
1206
+ ref: d,
1207
+ className: A(e ? "ig-textarea-auto" : "ig-textarea", t === "invalid" && "ig-input-invalid", t === "valid" && "ig-input-valid", n),
1208
+ "aria-invalid": t === "invalid" ? !0 : void 0,
1209
+ "aria-describedby": l
1210
+ });
1211
+ }
1212
+ var nt = "theme";
1213
+ function Re(e) {
1214
+ if (!e || typeof window > "u") return null;
1215
+ try {
1216
+ const t = window.localStorage.getItem(e);
1217
+ return t === "light" || t === "dark" ? t : null;
1218
+ } catch {
1219
+ return null;
1220
+ }
1221
+ }
1222
+ function rt(e) {
1223
+ return ne(M((t) => {
1224
+ if (!e || typeof window > "u") return () => {
1225
+ };
1226
+ const a = (n) => {
1227
+ n.key === e && t();
1228
+ };
1229
+ return window.addEventListener("storage", a), () => {
1230
+ window.removeEventListener("storage", a);
1231
+ };
1232
+ }, [e]), M(() => Re(e), [e]), M(() => null, []));
1233
+ }
1234
+ function _n({ theme: e, defaultTheme: t, onThemeChange: a, storageKey: n = nt, attribute: r = "data-theme", label: s, ref: i, ...o }) {
1235
+ const l = rt(n), [u, d] = O(null), { value: c, setValue: b } = $({
1236
+ value: e,
1237
+ derive: () => {
1238
+ if (u) return u;
1239
+ if (l) return l;
1240
+ if (typeof document < "u" && r) {
1241
+ const N = document.documentElement.getAttribute(r);
1242
+ if (N === "light" || N === "dark") return N;
1243
+ }
1244
+ return t ?? "dark";
1245
+ },
1246
+ setDerivedValue: d,
1247
+ onChange: a
1248
+ });
1249
+ F(() => {
1250
+ if (r && typeof document < "u" && document.documentElement.setAttribute(r, c), n && typeof window < "u") try {
1251
+ Re(n) !== c && window.localStorage.setItem(n, c);
1252
+ } catch {
1253
+ }
1254
+ }, [
1255
+ c,
1256
+ r,
1257
+ n
1258
+ ]);
1259
+ const m = M(() => {
1260
+ b(c === "dark" ? "light" : "dark");
1261
+ }, [c, b]), v = typeof s == "function" ? s(c) : s !== void 0 ? s : c === "dark" ? "Dark" : "Light", { "aria-label": p, ...I } = o;
1262
+ return /* @__PURE__ */ f(tt, {
1263
+ ...I,
1264
+ ...i !== void 0 ? { ref: i } : {},
1265
+ "aria-label": p ?? "Cambiar entre tema claro y oscuro",
1266
+ checked: c === "dark",
1267
+ onChange: m,
1268
+ children: v
1269
+ });
1270
+ }
1271
+ var Ae = U(null);
1272
+ function Hn() {
1273
+ const e = _(Ae);
1274
+ if (!e) throw new Error("useToast() debe usarse dentro de <ToastProvider>");
1275
+ return e;
1276
+ }
1277
+ function Kn({ position: e = "top-right", defaultDuration: t = 5e3, container: a, maxToasts: n, dedupeBy: r, children: s }) {
1278
+ const [i, o] = O([]), l = T(/* @__PURE__ */ new Map()), u = H(), d = T(0), c = T([]), b = M((g) => {
1279
+ const w = l.current.get(g);
1280
+ w && (clearTimeout(w), l.current.delete(g));
1281
+ const S = c.current.find((C) => C.id === g);
1282
+ if (!S) return;
1283
+ const y = c.current.filter((C) => C.id !== g);
1284
+ c.current = y, S.onDismiss?.(), o(y);
1285
+ }, []), m = M(() => {
1286
+ l.current.forEach((w) => {
1287
+ clearTimeout(w);
1288
+ }), l.current.clear();
1289
+ const g = c.current;
1290
+ c.current = [], g.forEach((w) => w.onDismiss?.()), o([]);
1291
+ }, []), v = M((g) => {
1292
+ if (r) {
1293
+ const D = r(g), h = c.current.find((R) => r(R) === D);
1294
+ if (h) return h.id;
1295
+ }
1296
+ d.current += 1;
1297
+ const w = `${u}-${String(d.current)}`, S = {
1298
+ id: w,
1299
+ ...g
1300
+ };
1301
+ let y = [...c.current, S];
1302
+ if (n !== void 0 && y.length > n) {
1303
+ const D = y.length - n;
1304
+ y.slice(0, D).forEach((h) => {
1305
+ const R = l.current.get(h.id);
1306
+ R && (clearTimeout(R), l.current.delete(h.id)), h.onDismiss?.();
1307
+ }), y = y.slice(D);
1308
+ }
1309
+ c.current = y, o(y);
1310
+ const C = g.duration ?? t;
1311
+ if (C > 0) {
1312
+ const D = setTimeout(() => {
1313
+ b(w);
1314
+ }, C);
1315
+ l.current.set(w, D);
1316
+ }
1317
+ return w;
1318
+ }, [
1319
+ t,
1320
+ b,
1321
+ u,
1322
+ n,
1323
+ r
1324
+ ]);
1325
+ F(() => {
1326
+ const g = l.current;
1327
+ return () => {
1328
+ g.forEach((w) => {
1329
+ clearTimeout(w);
1330
+ }), g.clear();
1331
+ };
1332
+ }, []);
1333
+ const p = ne(() => () => {
1334
+ }, () => !0, () => !1), I = B(() => ({
1335
+ toast: v,
1336
+ dismiss: b,
1337
+ dismissAll: m
1338
+ }), [
1339
+ v,
1340
+ b,
1341
+ m
1342
+ ]), N = a === null ? null : a !== void 0 ? a : p ? document.body : null, k = /* @__PURE__ */ f("div", {
1343
+ className: A("ig-toast-container", `ig-toast-${e}`),
1344
+ "data-toast-container": "",
1345
+ children: i.map((g) => /* @__PURE__ */ f(Se, {
1346
+ ...g.variant !== void 0 ? { variant: g.variant } : {},
1347
+ ...g.title !== void 0 ? { title: g.title } : {},
1348
+ ...g.message !== void 0 ? { message: g.message } : {},
1349
+ ...g.icon !== void 0 ? { icon: g.icon } : {},
1350
+ dismissible: g.dismissible ?? !0,
1351
+ onClose: () => {
1352
+ b(g.id);
1353
+ }
1354
+ }, g.id))
1355
+ });
1356
+ return /* @__PURE__ */ L(Ae.Provider, {
1357
+ value: I,
1358
+ children: [s, N ? Me(k, N) : k]
1359
+ });
1360
+ }
1361
+ function jn({ children: e }) {
1362
+ return /* @__PURE__ */ f(Le, { children: e });
1363
+ }
1364
+ function xe() {
1365
+ return {
1366
+ nodeId: $e(),
1367
+ parentId: Oe()
1368
+ };
1369
+ }
1370
+ function X(e) {
1371
+ if (e == null || typeof e == "boolean") return "";
1372
+ if (typeof e == "string" || typeof e == "number") return String(e);
1373
+ if (Array.isArray(e)) return e.map(X).join("");
1374
+ if (W(e)) {
1375
+ const t = e.props.children;
1376
+ return X(t);
1377
+ }
1378
+ return "";
1379
+ }
1380
+ var at = /* @__PURE__ */ Symbol.for("react.forward_ref"), it = /* @__PURE__ */ Symbol.for("react.memo");
1381
+ function De(e) {
1382
+ if (typeof e == "string") return {
1383
+ kind: "guaranteed_ok",
1384
+ reason: "dom_intrinsic"
1385
+ };
1386
+ if (e != null && typeof e == "object") {
1387
+ const t = e.$$typeof;
1388
+ if (t === at) return {
1389
+ kind: "guaranteed_ok",
1390
+ reason: "forward_ref"
1391
+ };
1392
+ if (t === it) {
1393
+ const a = e.type;
1394
+ return De(a);
1395
+ }
1396
+ }
1397
+ return { kind: "ambiguous" };
1398
+ }
1399
+ function Un({ text: e, placement: t = "top", variant: a, children: n, openDelay: r = 0, closeDelay: s = 0, container: i, ...o }) {
1400
+ const l = H(), { nodeId: u } = xe();
1401
+ T(!1), F(() => {
1402
+ }, [e]);
1403
+ const [d, c] = O(!1), { refs: b, floatingStyles: m, context: v } = ve({
1404
+ ...u !== void 0 ? { nodeId: u } : {},
1405
+ open: d,
1406
+ onOpenChange: c,
1407
+ placement: t,
1408
+ middleware: [
1409
+ be(8),
1410
+ ge(),
1411
+ me({ padding: 8 })
1412
+ ],
1413
+ whileElementsMounted: fe
1414
+ }), { getReferenceProps: p, getFloatingProps: I } = he([
1415
+ _e(v, {
1416
+ move: !1,
1417
+ delay: {
1418
+ open: r,
1419
+ close: s
1420
+ }
1421
+ }),
1422
+ Be(v),
1423
+ pe(v, {
1424
+ outsidePress: !1,
1425
+ bubbles: { escapeKey: !0 }
1426
+ })
1427
+ ]), N = De(n.type), k = T(!1), g = M((P) => {
1428
+ if (P == null) return;
1429
+ const x = P;
1430
+ if (x instanceof Element) {
1431
+ k.current = !0;
1432
+ return;
1433
+ }
1434
+ typeof x == "object" && x !== null && "getBoundingClientRect" in x && typeof x.getBoundingClientRect == "function" && (k.current = !0);
1435
+ }, []);
1436
+ T(!1);
1437
+ const w = n.props.ref ?? null, S = Q([
1438
+ b.setReference,
1439
+ g,
1440
+ w
1441
+ ]);
1442
+ T(!1);
1443
+ const y = M((P) => {
1444
+ }, [n.type]);
1445
+ F(() => {
1446
+ }, [N.kind, y]);
1447
+ const C = !1;
1448
+ T(null), F(() => {
1449
+ }, [C, y]);
1450
+ const D = [
1451
+ typeof o["aria-describedby"] == "string" ? o["aria-describedby"] : void 0,
1452
+ n.props["aria-describedby"],
1453
+ l
1454
+ ].filter((P) => typeof P == "string" && P.length > 0).join(" "), h = J(n, {
1455
+ ...p(n.props),
1456
+ ref: S,
1457
+ "aria-describedby": D
1458
+ }), R = d && /* @__PURE__ */ f(de, {
1459
+ ...i ? { root: i } : {},
1460
+ children: /* @__PURE__ */ f("span", {
1461
+ ref: b.setFloating,
1462
+ style: m,
1463
+ className: A("ig-tooltip", `ig-tooltip-place-${t}`, a && `ig-tooltip-${a}`),
1464
+ inert: !0,
1465
+ ...typeof e == "string" ? { "data-tooltip-content": e } : {},
1466
+ ...I(),
1467
+ children: e
1468
+ })
1469
+ });
1470
+ return /* @__PURE__ */ L(Pe, { children: [
1471
+ Object.keys(o).length > 0 ? /* @__PURE__ */ f(G, {
1472
+ ...o,
1473
+ children: h
1474
+ }) : h,
1475
+ /* @__PURE__ */ f("span", {
1476
+ id: l,
1477
+ role: "tooltip",
1478
+ className: "ig-sr-only",
1479
+ children: X(e)
1480
+ }),
1481
+ u === void 0 ? R : /* @__PURE__ */ f(ue, {
1482
+ id: u,
1483
+ children: R
1484
+ })
1485
+ ] });
1486
+ }
1487
+ var Te = U(null);
1488
+ function le() {
1489
+ const e = _(Te);
1490
+ if (!e) throw new Error("Componentes MenuTrigger/MenuContent/MenuItem deben usarse dentro de <Menu>");
1491
+ return e;
1492
+ }
1493
+ function Wn({ open: e, defaultOpen: t = !1, onOpenChange: a, placement: n = "left", direction: r = "down", closeOnSelect: s = !0, className: i, children: o, ref: l, ...u }) {
1494
+ const d = H(), c = `${d}-trigger`, b = `${d}-menu`, { value: m, setValue: v } = $({
1495
+ value: e,
1496
+ defaultValue: t,
1497
+ onChange: a
1498
+ }), { nodeId: p } = xe(), I = r === "up" ? n === "right" ? "top-end" : "top-start" : n === "right" ? "bottom-end" : "bottom-start", { refs: N, context: k, floatingStyles: g } = ve({
1499
+ ...p !== void 0 ? { nodeId: p } : {},
1500
+ open: m,
1501
+ onOpenChange: (x) => {
1502
+ v(x);
1503
+ },
1504
+ placement: I,
1505
+ middleware: [
1506
+ be(4),
1507
+ ge(),
1508
+ me({ padding: 4 })
1509
+ ],
1510
+ whileElementsMounted: fe
1511
+ }), w = T([]), S = T([]), [y, C] = O(null), { getReferenceProps: D, getFloatingProps: h, getItemProps: R } = he([
1512
+ Ve(k),
1513
+ pe(k, { bubbles: { escapeKey: !0 } }),
1514
+ Ke(k, { role: "menu" }),
1515
+ He(k, {
1516
+ listRef: w,
1517
+ activeIndex: y,
1518
+ onNavigate: C,
1519
+ loop: !0,
1520
+ focusItemOnOpen: "auto"
1521
+ }),
1522
+ je(k, {
1523
+ listRef: S,
1524
+ activeIndex: y,
1525
+ onMatch: (x) => {
1526
+ m && C(x);
1527
+ }
1528
+ })
1529
+ ]), P = B(() => ({
1530
+ open: m,
1531
+ setOpen: v,
1532
+ triggerId: c,
1533
+ menuId: b,
1534
+ closeOnSelect: s,
1535
+ getReferenceProps: D,
1536
+ getFloatingProps: h,
1537
+ getItemProps: R,
1538
+ listRef: w,
1539
+ labelsRef: S,
1540
+ activeIndex: y,
1541
+ setActiveIndex: C,
1542
+ setReference: N.setReference,
1543
+ setFloating: N.setFloating,
1544
+ context: k,
1545
+ floatingStyles: g,
1546
+ nodeId: p
1547
+ }), [
1548
+ m,
1549
+ v,
1550
+ c,
1551
+ b,
1552
+ s,
1553
+ D,
1554
+ h,
1555
+ R,
1556
+ y,
1557
+ N.setReference,
1558
+ N.setFloating,
1559
+ k,
1560
+ g,
1561
+ p
1562
+ ]);
1563
+ return /* @__PURE__ */ f(Te.Provider, {
1564
+ value: P,
1565
+ children: /* @__PURE__ */ f("div", {
1566
+ ref: l,
1567
+ className: A("ig-menu", i),
1568
+ ...u,
1569
+ children: o
1570
+ })
1571
+ });
1572
+ }
1573
+ function qn({ asChild: e = !1, className: t, children: a, type: n = "button", ref: r, ...s }) {
1574
+ const { triggerId: i, menuId: o, setReference: l, getReferenceProps: u } = le(), d = Q([l, r ?? null]);
1575
+ if (e) {
1576
+ const c = u(s), b = W(a) ? J(a, { id: i }) : a;
1577
+ return /* @__PURE__ */ f(G, {
1578
+ ...c,
1579
+ ref: d,
1580
+ type: n,
1581
+ "aria-controls": o,
1582
+ className: t,
1583
+ children: b
1584
+ });
1585
+ }
1586
+ return /* @__PURE__ */ f("button", {
1587
+ ...u(s),
1588
+ ref: d,
1589
+ id: i,
1590
+ type: n,
1591
+ "aria-controls": o,
1592
+ className: A("ig-menu-trigger", t),
1593
+ children: a
1594
+ });
1595
+ }
1596
+ function ot(e) {
1597
+ const t = e.split("-")[0];
1598
+ return t === "top" || t === "bottom" || t === "left" || t === "right" ? t : "bottom";
1599
+ }
1600
+ function st(e) {
1601
+ const t = e.split("-")[1];
1602
+ return t === "start" || t === "end" ? t : "center";
1603
+ }
1604
+ function zn({ className: e, children: t, ref: a, container: n, style: r, ...s }) {
1605
+ const { menuId: i, triggerId: o, open: l, setFloating: u, getFloatingProps: d, context: c, floatingStyles: b, nodeId: m } = le(), v = Q([u, a ?? null]);
1606
+ if (!l) return null;
1607
+ const p = ot(c.placement), I = st(c.placement), N = {
1608
+ ...r,
1609
+ ...b
1610
+ }, k = /* @__PURE__ */ f(Fe, {
1611
+ context: c,
1612
+ modal: !1,
1613
+ initialFocus: -1,
1614
+ returnFocus: !0,
1615
+ children: /* @__PURE__ */ f("div", {
1616
+ ...d(s),
1617
+ ref: v,
1618
+ id: i,
1619
+ role: "menu",
1620
+ "aria-labelledby": o,
1621
+ "data-side": p,
1622
+ "data-align": I,
1623
+ "data-state": "open",
1624
+ style: N,
1625
+ className: A("ig-menu-content", e),
1626
+ children: t
1627
+ })
1628
+ }), g = /* @__PURE__ */ f(de, {
1629
+ ...n ? { root: n } : {},
1630
+ children: k
1631
+ });
1632
+ return m === void 0 ? g : /* @__PURE__ */ f(ue, {
1633
+ id: m,
1634
+ children: g
1635
+ });
1636
+ }
1637
+ function ee(e) {
1638
+ return typeof e == "string" ? e : typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(ee).join(" ") : e !== null && typeof e == "object" && "props" in e && typeof e.props == "object" && e.props !== null && "children" in e.props ? ee(e.props.children) : "";
1639
+ }
1640
+ function Gn({ ref: e, ...t }) {
1641
+ const { setOpen: a, closeOnSelect: n, listRef: r, labelsRef: s, getItemProps: i } = le(), o = T(null), l = "href" in t && typeof t.href == "string", d = Q([(h) => {
1642
+ if (h === null) {
1643
+ o.current !== null && (r.current[o.current] = null, s.current[o.current] = null, o.current = null);
1644
+ return;
1645
+ }
1646
+ let R = r.current.indexOf(h);
1647
+ R === -1 && (R = r.current.indexOf(null), R === -1 && (R = r.current.length), r.current[R] = h, s.current[R] = ee(t.children).trim() || null), o.current = R;
1648
+ }, e ?? null]), c = () => {
1649
+ n && a(!1);
1650
+ }, b = t["aria-disabled"], m = b === !0 || b === "true", v = (h) => {
1651
+ if (m) {
1652
+ h.preventDefault();
1653
+ return;
1654
+ }
1655
+ t.onClick?.(h), h.defaultPrevented || c();
1656
+ }, p = (h) => {
1657
+ t.onKeyDown?.(h);
1658
+ }, I = (h) => {
1659
+ if (t.onKeyDown?.(h), !h.defaultPrevented) {
1660
+ if (m && (h.key === "Enter" || h.key === " ")) {
1661
+ h.preventDefault();
1662
+ return;
1663
+ }
1664
+ if (h.key === " ") {
1665
+ if (h.preventDefault(), h.repeat) return;
1666
+ h.currentTarget instanceof HTMLElement && h.currentTarget.click();
1667
+ }
1668
+ }
1669
+ };
1670
+ if (l) {
1671
+ const { onClick: h, onKeyDown: R, children: P, className: x, danger: E, active: V, ...K } = t;
1672
+ return /* @__PURE__ */ f("a", {
1673
+ ...i({
1674
+ ...K,
1675
+ onClick: v,
1676
+ onKeyDown: I
1677
+ }),
1678
+ ref: d,
1679
+ role: "menuitem",
1680
+ tabIndex: -1,
1681
+ className: A("ig-menu-item", E && "ig-menu-item-danger", V && "ig-menu-item-active", x),
1682
+ children: P
1683
+ });
1684
+ }
1685
+ const { onClick: N, onKeyDown: k, children: g, className: w, danger: S, active: y, type: C = "button", ...D } = t;
1686
+ return /* @__PURE__ */ f("button", {
1687
+ ...i({
1688
+ ...D,
1689
+ onClick: v,
1690
+ onKeyDown: p
1691
+ }),
1692
+ ref: d,
1693
+ type: C,
1694
+ role: "menuitem",
1695
+ tabIndex: -1,
1696
+ className: A("ig-menu-item", S && "ig-menu-item-danger", y && "ig-menu-item-active", w),
1697
+ children: g
1698
+ });
1699
+ }
1700
+ function Yn({ className: e, ref: t, ...a }) {
1701
+ return /* @__PURE__ */ f("div", {
1702
+ ...a,
1703
+ ref: t,
1704
+ role: "separator",
1705
+ className: A("ig-menu-separator", e)
1706
+ });
1707
+ }
1708
+ function Zn({ className: e, children: t, ref: a, ...n }) {
1709
+ return /* @__PURE__ */ f("div", {
1710
+ ref: a,
1711
+ className: A("ig-menu-label", e),
1712
+ ...n,
1713
+ children: t
1714
+ });
1715
+ }
1716
+ var lt = (e) => e === "light" || e === "dark", ct = () => {
1717
+ if (typeof document > "u") return "dark";
1718
+ const e = document.documentElement.dataset.theme;
1719
+ return lt(e) ? e : "dark";
1720
+ }, ut = (e) => {
1721
+ if (typeof document > "u") return () => {
1722
+ };
1723
+ const t = new MutationObserver(() => {
1724
+ e();
1725
+ });
1726
+ return t.observe(document.documentElement, {
1727
+ attributes: !0,
1728
+ attributeFilter: ["data-theme"]
1729
+ }), () => {
1730
+ t.disconnect();
1731
+ };
1732
+ }, dt = () => "dark";
1733
+ function Jn() {
1734
+ const e = ne(ut, ct, dt), t = M((a) => {
1735
+ typeof document > "u" || (document.documentElement.dataset.theme = a);
1736
+ }, []);
1737
+ return {
1738
+ theme: e,
1739
+ setTheme: t,
1740
+ toggleTheme: M(() => {
1741
+ t(e === "dark" ? "light" : "dark");
1742
+ }, [e, t])
1743
+ };
1744
+ }
1745
+ export {
1746
+ ln as Accordion,
1747
+ dn as AccordionContent,
1748
+ un as AccordionHeader,
1749
+ cn as AccordionItem,
1750
+ fn as Alert,
1751
+ gn as AlertDialog,
1752
+ Ct as AlertDialogBody,
1753
+ hn as AlertDialogClose,
1754
+ vn as AlertDialogContent,
1755
+ Pt as AlertDialogFooter,
1756
+ mn as AlertDialogHeader,
1757
+ bn as AlertDialogTrigger,
1758
+ yn as Avatar,
1759
+ St as AvatarGroup,
1760
+ Nt as Badge,
1761
+ Cn as Breadcrumb,
1762
+ Et as BreadcrumbItem,
1763
+ mt as Button,
1764
+ Nn as Card,
1765
+ wt as CardBody,
1766
+ At as CardDivider,
1767
+ kt as CardFooter,
1768
+ xt as CardHeader,
1769
+ yt as CardImage,
1770
+ kn as Checkbox,
1771
+ It as Chip,
1772
+ gn as Dialog,
1773
+ Ct as DialogBody,
1774
+ pn as DialogClose,
1775
+ Ge as DialogContent,
1776
+ Pt as DialogFooter,
1777
+ mn as DialogHeader,
1778
+ bn as DialogTrigger,
1779
+ Kt as Divider,
1780
+ Rt as ErrorText,
1781
+ jn as FloatingTreeRoot,
1782
+ jt as Helper,
1783
+ nn as IconButton,
1784
+ wn as Input,
1785
+ ht as InputAddon,
1786
+ vt as InputGroup,
1787
+ bt as Label,
1788
+ Wn as Menu,
1789
+ zn as MenuContent,
1790
+ Gn as MenuItem,
1791
+ Zn as MenuLabel,
1792
+ Yn as MenuSeparator,
1793
+ qn as MenuTrigger,
1794
+ Dn as NativeSelect,
1795
+ In as Navbar,
1796
+ pt as NavbarActions,
1797
+ Xt as NavbarLink,
1798
+ Tt as NavbarLogo,
1799
+ Dt as NavbarMenuButton,
1800
+ Rn as NavbarNav,
1801
+ An as Pagination,
1802
+ en as Progress,
1803
+ Lt as Radio,
1804
+ xn as Rating,
1805
+ Tn as Sidebar,
1806
+ Mt as SidebarDivider,
1807
+ Qt as SidebarFooter,
1808
+ tn as SidebarHeader,
1809
+ En as SidebarItem,
1810
+ Sn as SidebarNav,
1811
+ Bt as SidebarSection,
1812
+ Pn as SidebarToggle,
1813
+ Wt as Skeleton,
1814
+ _t as SkeletonContainer,
1815
+ Mn as Slider,
1816
+ Gt as Spinner,
1817
+ Ot as Step,
1818
+ Fn as Stepper,
1819
+ tt as Switch,
1820
+ Ht as Table,
1821
+ Ft as TableBody,
1822
+ zt as TableCaption,
1823
+ Zt as TableCell,
1824
+ Vt as TableFoot,
1825
+ Ut as TableHead,
1826
+ Jt as TableHeaderCell,
1827
+ $t as TableRow,
1828
+ Ln as Tabs,
1829
+ On as TabsContent,
1830
+ Vn as TabsList,
1831
+ $n as TabsTrigger,
1832
+ Bn as Textarea,
1833
+ _n as ThemeToggle,
1834
+ Yt as Timeline,
1835
+ qt as TimelineItem,
1836
+ Se as Toast,
1837
+ Kn as ToastProvider,
1838
+ Un as Tooltip,
1839
+ A as cn,
1840
+ $ as useControllableState,
1841
+ Jn as useTheme,
1842
+ Hn as useToast
1843
+ };