@rinzai/zen 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/actions-menu/index.d.ts +18 -0
  2. package/dist/actions-menu/index.d.ts.map +1 -0
  3. package/dist/backdrop/index.d.ts +14 -0
  4. package/dist/backdrop/index.d.ts.map +1 -0
  5. package/dist/{packages/badge → badge}/index.d.ts +1 -1
  6. package/dist/badge/index.d.ts.map +1 -0
  7. package/dist/{packages/button → button}/index.d.ts +5 -4
  8. package/dist/button/index.d.ts.map +1 -0
  9. package/dist/card/index.d.ts +23 -0
  10. package/dist/card/index.d.ts.map +1 -0
  11. package/dist/{packages/collapse → collapse}/index.d.ts +1 -1
  12. package/dist/collapse/index.d.ts.map +1 -0
  13. package/dist/confirm-dialog/index.d.ts +14 -0
  14. package/dist/confirm-dialog/index.d.ts.map +1 -0
  15. package/dist/dialog/index.d.ts +22 -0
  16. package/dist/dialog/index.d.ts.map +1 -0
  17. package/dist/{packages/dropdown → dropdown}/index.d.ts +1 -1
  18. package/dist/dropdown/index.d.ts.map +1 -0
  19. package/dist/icons/chevron-down.d.ts +3 -0
  20. package/dist/icons/chevron-down.d.ts.map +1 -0
  21. package/dist/icons/chevron-up.d.ts +3 -0
  22. package/dist/icons/chevron-up.d.ts.map +1 -0
  23. package/dist/icons/icon.types.d.ts.map +1 -0
  24. package/dist/icons/index.d.ts.map +1 -0
  25. package/dist/icons/search.d.ts +3 -0
  26. package/dist/icons/search.d.ts.map +1 -0
  27. package/dist/icons/x-mark.d.ts +3 -0
  28. package/dist/icons/x-mark.d.ts.map +1 -0
  29. package/dist/index.d.ts +29 -2
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/input/index.d.ts +4 -0
  32. package/dist/input/index.d.ts.map +1 -0
  33. package/dist/nav-pills/index.d.ts +31 -0
  34. package/dist/nav-pills/index.d.ts.map +1 -0
  35. package/dist/{packages/popover → popover}/index.d.ts +3 -1
  36. package/dist/popover/index.d.ts.map +1 -0
  37. package/dist/progress-ring/index.d.ts +14 -0
  38. package/dist/progress-ring/index.d.ts.map +1 -0
  39. package/dist/segmented/index.d.ts +18 -0
  40. package/dist/segmented/index.d.ts.map +1 -0
  41. package/dist/skeleton/index.d.ts +6 -0
  42. package/dist/skeleton/index.d.ts.map +1 -0
  43. package/dist/spinner/index.d.ts +6 -0
  44. package/dist/spinner/index.d.ts.map +1 -0
  45. package/dist/tabs/index.d.ts +26 -0
  46. package/dist/tabs/index.d.ts.map +1 -0
  47. package/dist/textarea/index.d.ts +4 -0
  48. package/dist/textarea/index.d.ts.map +1 -0
  49. package/dist/toast/index.d.ts +20 -0
  50. package/dist/toast/index.d.ts.map +1 -0
  51. package/dist/toggle/index.d.ts +10 -0
  52. package/dist/toggle/index.d.ts.map +1 -0
  53. package/dist/utils/cva.d.ts.map +1 -0
  54. package/dist/utils/cx.d.ts.map +1 -0
  55. package/dist/utils/styles.d.ts +15 -0
  56. package/dist/utils/styles.d.ts.map +1 -0
  57. package/dist/utils/useClickOutside.d.ts.map +1 -0
  58. package/dist/zen.css +2 -2
  59. package/dist/zen.js +1358 -365
  60. package/package.json +42 -37
  61. package/dist/packages/badge/index.d.ts.map +0 -1
  62. package/dist/packages/button/index.d.ts.map +0 -1
  63. package/dist/packages/collapse/index.d.ts.map +0 -1
  64. package/dist/packages/dropdown/index.d.ts.map +0 -1
  65. package/dist/packages/icons/chevron-down.d.ts +0 -3
  66. package/dist/packages/icons/chevron-down.d.ts.map +0 -1
  67. package/dist/packages/icons/chevron-up.d.ts +0 -3
  68. package/dist/packages/icons/chevron-up.d.ts.map +0 -1
  69. package/dist/packages/icons/icon.types.d.ts.map +0 -1
  70. package/dist/packages/icons/index.d.ts.map +0 -1
  71. package/dist/packages/icons/search.d.ts +0 -3
  72. package/dist/packages/icons/search.d.ts.map +0 -1
  73. package/dist/packages/icons/x-mark.d.ts +0 -3
  74. package/dist/packages/icons/x-mark.d.ts.map +0 -1
  75. package/dist/packages/index.d.ts +0 -17
  76. package/dist/packages/index.d.ts.map +0 -1
  77. package/dist/packages/input/index.d.ts +0 -4
  78. package/dist/packages/input/index.d.ts.map +0 -1
  79. package/dist/packages/popover/index.d.ts.map +0 -1
  80. package/dist/packages/textarea/index.d.ts +0 -4
  81. package/dist/packages/textarea/index.d.ts.map +0 -1
  82. package/dist/packages/toggle/index.d.ts +0 -6
  83. package/dist/packages/toggle/index.d.ts.map +0 -1
  84. package/dist/packages/utils/cva.d.ts.map +0 -1
  85. package/dist/packages/utils/cx.d.ts.map +0 -1
  86. package/dist/packages/utils/useClickOutside.d.ts.map +0 -1
  87. /package/dist/{packages/icons → icons}/icon.types.d.ts +0 -0
  88. /package/dist/{packages/icons → icons}/index.d.ts +0 -0
  89. /package/dist/{packages/utils → utils}/cva.d.ts +0 -0
  90. /package/dist/{packages/utils → utils}/cx.d.ts +0 -0
  91. /package/dist/{packages/utils → utils}/useClickOutside.d.ts +0 -0
package/dist/zen.js CHANGED
@@ -1,14 +1,129 @@
1
+ "use client";
1
2
  import * as e from "react";
2
- import { useEffect as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
3
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
4
- import { flushSync as l } from "react-dom";
3
+ import { cloneElement as t, createContext as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
4
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { createPortal as h, flushSync as g } from "react-dom";
5
6
  //#region packages/utils/cx.ts
6
- var u = (...e) => e.reduce((e, t) => t == null || t === !1 ? e : typeof t == "string" || typeof t == "number" ? e + " " + t : Array.isArray(t) ? e + " " + u(...t) : typeof t == "object" ? e + " " + Object.entries(t).reduce((e, [t, n]) => n == null || n === !1 ? e : typeof n == "string" || typeof n == "number" ? e + " " + t + "-" + n : typeof n == "boolean" && n ? e + " " + t : e, "") : e, ""), d = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, f = (e, t) => (n) => {
7
- if (t?.variants == null) return u(e, n?.class, n?.className);
7
+ var _ = (...e) => e.reduce((e, t) => t == null || t === !1 ? e : typeof t == "string" || typeof t == "number" ? e + " " + t : Array.isArray(t) ? e + " " + _(...t) : typeof t == "object" ? e + " " + Object.entries(t).reduce((e, [t, n]) => n == null || n === !1 ? e : typeof n == "string" || typeof n == "number" ? e + " " + t + "-" + n : typeof n == "boolean" && n ? e + " " + t : e, "") : e, ""), v = "flex w-full cursor-default items-center rounded-lg px-3 py-2 text-sm outline-hidden select-none hover:bg-tint/[0.07] focus:bg-tint/[0.07]";
8
+ function y({ label: e, actions: t, className: n }) {
9
+ let r = `zen__menu-${s().replace(/[^\w-]/g, "")}`, i = u(null), a = t.filter((e) => !!e);
10
+ return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
11
+ type: "button",
12
+ "aria-label": e,
13
+ "aria-haspopup": "menu",
14
+ popoverTarget: r,
15
+ className: _("text-muted-foreground grid size-9 shrink-0 place-items-center rounded-lg outline-hidden", "hover:bg-tint/[0.06] hover:text-foreground focus-visible:ring-ring/50 focus-visible:ring-2", "[&:has(+:popover-open)]:bg-tint/[0.06]", n),
16
+ style: { anchorName: `--${r}` },
17
+ children: /* @__PURE__ */ m("svg", {
18
+ viewBox: "0 0 16 16",
19
+ fill: "currentColor",
20
+ className: "size-4",
21
+ "aria-hidden": !0,
22
+ children: [
23
+ /* @__PURE__ */ p("circle", {
24
+ cx: "3",
25
+ cy: "8",
26
+ r: "1.4"
27
+ }),
28
+ /* @__PURE__ */ p("circle", {
29
+ cx: "8",
30
+ cy: "8",
31
+ r: "1.4"
32
+ }),
33
+ /* @__PURE__ */ p("circle", {
34
+ cx: "13",
35
+ cy: "8",
36
+ r: "1.4"
37
+ })
38
+ ]
39
+ })
40
+ }), /* @__PURE__ */ p("div", {
41
+ ref: i,
42
+ id: r,
43
+ popover: "auto",
44
+ role: "menu",
45
+ "aria-label": e,
46
+ tabIndex: -1,
47
+ onKeyDown: (e) => {
48
+ let t = Array.from(i.current?.querySelectorAll("[role=\"menuitem\"]") ?? []), n = t.indexOf(document.activeElement), r = t.length - 1, a = {
49
+ ArrowDown: n + 1,
50
+ ArrowUp: n === -1 ? r : n - 1,
51
+ Home: 0,
52
+ End: r
53
+ }[e.key];
54
+ a !== void 0 && (e.preventDefault(), t[(a + t.length) % t.length]?.focus());
55
+ },
56
+ onToggle: (e) => {
57
+ e.nativeEvent.newState === "open" && i.current?.focus();
58
+ },
59
+ className: _("zen__popover glass glass-blur text-foreground min-w-44 rounded-xl p-1.5 outline-hidden", "[position-area:block-end_span-inline-start] [position-try-fallbacks:flip-block]"),
60
+ style: {
61
+ positionAnchor: `--${r}`,
62
+ inset: "auto",
63
+ margin: "6px 0"
64
+ },
65
+ children: a.map((e) => /* @__PURE__ */ p("button", {
66
+ type: "button",
67
+ role: "menuitem",
68
+ tabIndex: -1,
69
+ className: _(v, e.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"),
70
+ onClick: () => {
71
+ i.current?.hidePopover?.(), e.onClick();
72
+ },
73
+ children: e.label
74
+ }, e.label))
75
+ })] });
76
+ }
77
+ //#endregion
78
+ //#region packages/backdrop/index.tsx
79
+ function b({ pattern: e, topoSrc: t }) {
80
+ let n = e ?? (t ? "contours" : "dots");
81
+ return o(() => {
82
+ let e = document.documentElement, t = 0, n = -9999, r = -9999, i = /* @__PURE__ */ new WeakSet(), a = !0, o = () => {
83
+ t = 0, e.dataset.pointer = a ? "out" : "in", a || (e.style.setProperty("--mx", `${n}px`), e.style.setProperty("--my", `${r}px`));
84
+ let o = Array.from(document.querySelectorAll(".glow-edge")), s = o.map((e) => e.getBoundingClientRect());
85
+ o.forEach((e, t) => {
86
+ let a = s[t];
87
+ n > a.left - 400 && n < a.right + 400 && r > a.top - 400 && r < a.bottom + 400 ? (e.style.setProperty("--gx", `${n - a.left}px`), e.style.setProperty("--gy", `${r - a.top}px`), i.delete(e)) : i.has(e) || (e.style.setProperty("--gx", "-9999px"), e.style.setProperty("--gy", "-9999px"), i.add(e));
88
+ });
89
+ }, s = () => {
90
+ t ||= requestAnimationFrame(o);
91
+ }, c = (e) => {
92
+ n = e.clientX, r = e.clientY, a = !1, s();
93
+ }, l = () => {
94
+ n = r = -9999, a = !0, s();
95
+ };
96
+ if (!window.matchMedia?.("(hover: none), (pointer: coarse)").matches) return window.addEventListener("pointermove", c, { passive: !0 }), e.addEventListener("pointerleave", l), window.addEventListener("scroll", s, {
97
+ passive: !0,
98
+ capture: !0
99
+ }), window.addEventListener("resize", s, { passive: !0 }), () => {
100
+ window.removeEventListener("pointermove", c), e.removeEventListener("pointerleave", l), window.removeEventListener("scroll", s, { capture: !0 }), window.removeEventListener("resize", s), cancelAnimationFrame(t);
101
+ };
102
+ }, []), /* @__PURE__ */ m("div", {
103
+ className: "zen-backdrop",
104
+ "aria-hidden": !0,
105
+ style: t ? { "--zen-topo": `url("${t}")` } : void 0,
106
+ children: [
107
+ /* @__PURE__ */ p("div", { className: "zen-aurora zen-aurora--a" }),
108
+ /* @__PURE__ */ p("div", { className: "zen-aurora zen-aurora--b" }),
109
+ /* @__PURE__ */ p("div", { className: "zen-aurora zen-aurora--c" }),
110
+ n === "contours" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "zen-topo" }), /* @__PURE__ */ p("div", { className: "zen-topo zen-topo--lit" })] }) : /* @__PURE__ */ m(f, { children: [
111
+ /* @__PURE__ */ p("div", { className: "zen-dots" }),
112
+ /* @__PURE__ */ p("div", { className: "zen-dots zen-dots--ambient" }),
113
+ /* @__PURE__ */ p("div", { className: "zen-dots zen-dots--lit" })
114
+ ] }),
115
+ /* @__PURE__ */ p("div", { className: "zen-vignette" })
116
+ ]
117
+ });
118
+ }
119
+ //#endregion
120
+ //#region packages/utils/cva.ts
121
+ var x = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, S = (e, t) => (n) => {
122
+ if (t?.variants == null) return _(e, n?.class, n?.className);
8
123
  let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
9
124
  let t = n?.[e], a = i?.[e];
10
125
  if (t === null) return null;
11
- let o = d(t) || d(a);
126
+ let o = x(t) || x(a);
12
127
  return r[e][o];
13
128
  }), o = n && Object.entries(n).reduce((e, [t, n]) => (n === void 0 || (e[t] = n), e), {}), s = t?.compoundVariants?.reduce((e, { class: t, className: n, ...r }) => Object.entries(r).every(([e, t]) => Array.isArray(t) ? t.includes({
14
129
  ...i,
@@ -21,56 +136,67 @@ var u = (...e) => e.reduce((e, t) => t == null || t === !1 ? e : typeof t == "st
21
136
  t,
22
137
  n
23
138
  ] : e, []);
24
- return u(e, a, s, n?.class, n?.className);
139
+ return _(e, a, s, n?.class, n?.className);
25
140
  };
26
141
  //#endregion
27
142
  //#region packages/badge/index.tsx
28
- function p({ variant: e, className: t, ...n }) {
29
- return /* @__PURE__ */ s("span", {
143
+ function C({ variant: e, className: t, ...n }) {
144
+ return /* @__PURE__ */ p("span", {
30
145
  ...n,
31
- className: m({
146
+ className: w({
32
147
  variant: e,
33
148
  className: t
34
149
  })
35
150
  });
36
151
  }
37
- var m = f("zen__badge inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors whitespace-nowrap focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring", {
152
+ var w = S("zen__badge inline-flex items-center rounded-md border px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wider uppercase whitespace-nowrap focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-glow/50", {
38
153
  variants: { variant: {
39
- default: "border-transparent bg-primary text-primary-foreground shadow-sm",
40
- secondary: "border-transparent bg-secondary text-secondary-foreground shadow-sm",
41
- destructive: "border-transparent bg-destructive text-destructive-foreground shadow-sm",
42
- outline: "border-border text-foreground"
154
+ default: "border-glow/30 bg-glow/10 text-primary",
155
+ secondary: "border-tint/10 bg-tint/[0.06] text-foreground",
156
+ destructive: "border-destructive/40 bg-destructive/15 text-destructive",
157
+ outline: "border-tint/10 text-foreground"
43
158
  } },
44
159
  defaultVariants: { variant: "default" }
45
160
  });
46
161
  //#endregion
162
+ //#region packages/spinner/index.tsx
163
+ function T({ className: e }) {
164
+ return /* @__PURE__ */ p("span", {
165
+ "aria-hidden": !0,
166
+ className: _("zen__spinner inline-block size-4 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent", e)
167
+ });
168
+ }
169
+ //#endregion
47
170
  //#region packages/button/index.tsx
48
- function h({ className: e, variant: t, size: n, ...r }) {
49
- return /* @__PURE__ */ s("button", {
50
- className: g({
171
+ function E({ className: e, variant: t, size: n, loading: r = !1, disabled: i, children: a, ...o }) {
172
+ return /* @__PURE__ */ m("button", {
173
+ disabled: i || r,
174
+ "aria-busy": r || void 0,
175
+ className: D({
51
176
  variant: t,
52
177
  size: n,
53
178
  className: e
54
179
  }),
55
- ...r
180
+ ...o,
181
+ children: [r && /* @__PURE__ */ p(T, {}), a]
56
182
  });
57
183
  }
58
- var g = f("zen__button inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", {
184
+ var D = S("zen__button inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap outline-hidden select-none transition-[background-color,border-color,box-shadow,color,transform] duration-200 ease-out active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-glow/50 disabled:pointer-events-none disabled:opacity-50", {
59
185
  variants: {
60
186
  variant: {
61
- default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/70 active:bg-primary/90",
62
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/70 active:bg-destructive/90",
63
- outline: "border border-input bg-background text-foreground shadow-sm hover:bg-accent hover:text-accent-foreground active:bg-accent active:text-accent-foreground",
64
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/70 active:bg-secondary/90",
65
- ghost: "text-foreground hover:bg-accent hover:text-accent-foreground active:bg-accent active:text-accent-foreground",
66
- link: "text-primary underline-offset-4 hover:underline active:underline active:opacity-75",
67
- icon: "text-foreground hover:bg-accent hover:text-accent-foreground active:bg-accent/80"
187
+ default: "bg-primary bg-[linear-gradient(to_bottom,oklch(1_0_0/0.16),transparent)] text-primary-foreground shadow-[0_0_0_1px_oklch(var(--glow)/0.55),0_0_22px_-6px_oklch(var(--glow)/0.7),inset_0_1px_0_hsl(0_0%_100%/0.3)] hover:shadow-[0_0_0_1px_oklch(var(--glow)/0.8),0_0_28px_-4px_oklch(var(--glow)/0.85),inset_0_1px_0_hsl(0_0%_100%/0.35)]",
188
+ secondary: "bg-primary/15 text-foreground shadow-[inset_0_0_0_1px_oklch(var(--primary)/0.25)] hover:bg-primary/25",
189
+ outline: "glow-edge border border-tint/10 bg-tint/[0.03] text-foreground hover:border-tint/20 hover:bg-tint/[0.07]",
190
+ ghost: "text-muted-foreground hover:bg-tint/[0.06] hover:text-foreground",
191
+ destructive: "bg-destructive/90 text-destructive-foreground shadow-[0_0_0_1px_oklch(var(--destructive)/0.6),0_0_22px_-8px_oklch(var(--destructive)/0.7)] hover:bg-destructive",
192
+ link: "h-auto! px-0! text-primary underline-offset-4 hover:underline",
193
+ icon: "text-muted-foreground hover:bg-tint/[0.06] hover:text-foreground"
68
194
  },
69
195
  size: {
70
- default: "h-9 px-4 py-2",
196
+ default: "h-10 px-4",
71
197
  sm: "h-8 px-3 text-xs",
72
- lg: "h-10 px-8",
73
- icon: "p-0"
198
+ lg: "h-11 px-6",
199
+ icon: "size-9"
74
200
  }
75
201
  },
76
202
  defaultVariants: {
@@ -79,120 +205,263 @@ var g = f("zen__button inline-flex items-center justify-center whitespace-nowrap
79
205
  }
80
206
  });
81
207
  //#endregion
208
+ //#region packages/card/index.tsx
209
+ function ee({ title: e, action: t, children: n, className: r, ...i }) {
210
+ return /* @__PURE__ */ m("section", {
211
+ className: _("zen__card glass glow-edge text-card-foreground rounded-xl p-4 md:p-5", r),
212
+ ...i,
213
+ children: [(e || t) && /* @__PURE__ */ m("header", {
214
+ className: "mb-4 flex items-center justify-between gap-4",
215
+ children: [e && /* @__PURE__ */ p("h4", {
216
+ className: "text-base tracking-tight",
217
+ children: e
218
+ }), t]
219
+ }), n]
220
+ });
221
+ }
222
+ function te({ label: e, value: t, hint: n, tone: r = "default", className: i }) {
223
+ return /* @__PURE__ */ m("div", {
224
+ className: _("zen__stat glass glow-edge flex flex-col gap-1 rounded-xl p-3.5 md:p-4", i),
225
+ children: [
226
+ /* @__PURE__ */ p("span", {
227
+ className: "text-muted-foreground truncate text-[0.68rem] tracking-[0.1em] uppercase sm:text-xs",
228
+ children: e
229
+ }),
230
+ /* @__PURE__ */ p("span", {
231
+ className: _("truncate text-lg font-semibold tracking-tight tabular-nums sm:text-xl md:text-2xl", r === "positive" && "text-primary text-glow", r === "negative" && "text-destructive"),
232
+ children: t
233
+ }),
234
+ n && /* @__PURE__ */ p("span", {
235
+ className: "text-muted-foreground text-xs",
236
+ children: n
237
+ })
238
+ ]
239
+ });
240
+ }
241
+ function ne({ children: e, className: t }) {
242
+ return /* @__PURE__ */ p("div", {
243
+ className: _("grid grid-cols-2 gap-3 sm:grid-cols-3 md:gap-4 [&>*]:min-w-0", "[&>*:last-child:nth-child(odd)]:col-span-2 sm:[&>*:last-child:nth-child(odd)]:col-span-1", t),
244
+ children: e
245
+ });
246
+ }
247
+ //#endregion
248
+ //#region packages/utils/styles.ts
249
+ var O = "h-10 rounded-lg border border-tint/10 bg-tint/[0.035] px-3 text-sm text-foreground shadow-[inset_0_1px_0_hsl(0_0%_100%/0.04)] transition-[border-color,background-color,box-shadow] duration-200 placeholder:text-muted-foreground hover:border-tint/20 focus-visible:border-glow/60 focus-visible:bg-tint/[0.05] focus-visible:shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)] focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50", re = _(O, "inline-flex items-center justify-between gap-2 whitespace-nowrap"), ie = "glass glass-blur rounded-xl text-foreground shadow-[var(--popup-shadow),0_0_40px_-20px_oklch(var(--glow)/0.5)] outline-hidden", k = "relative flex w-fit items-center gap-1 rounded-full border border-tint/5 bg-tint/[0.03] p-1", ae = "absolute top-1 bottom-1 left-0 rounded-full bg-primary/15 shadow-[inset_0_0_0_1px_oklch(var(--glow)/0.35),0_0_24px_-4px_oklch(var(--glow)/0.6)] transition-[translate,width] duration-500 ease-[cubic-bezier(0.2,0.8,0.2,1)]", A = "relative z-10 rounded-full px-3.5 py-1.5 text-sm whitespace-nowrap outline-hidden transition-colors duration-300 select-none focus-visible:ring-2 focus-visible:ring-ring/40";
250
+ //#endregion
82
251
  //#region packages/popover/index.tsx
83
- function _(e) {
84
- let { className: n, content: r, children: o, role: l = "tooltip", triggerType: d = "auto", trigger: f = "click", gap: p = "5px", show: m, setShow: h, style: g, ..._ } = e, v = i(null);
85
- v.current === null && (v.current = crypto.randomUUID());
86
- let y = v.current, [b, x] = a(!1), S = i(null);
87
- return t(() => {
88
- let t = S.current;
89
- if (!t) return;
90
- let n = () => {
91
- x(!0), e.onOpen?.();
92
- }, r = () => {
93
- x(!1), e.onClose?.();
252
+ function j(e) {
253
+ let { className: t, content: n, children: r, role: i = "tooltip", triggerType: a = "auto", trigger: c = "click", gap: l = "5px", triggerClassName: f, show: h, setShow: g, style: v, onOpen: y, onClose: b, ...x } = e, S = s().replace(/[^\w-]/g, ""), [C, w] = d(!1), T = u(null);
254
+ return o(() => {
255
+ let e = T.current;
256
+ if (!e) return;
257
+ let t = () => {
258
+ w(!0), y?.();
259
+ }, n = () => {
260
+ w(!1), b?.();
94
261
  };
95
- return t.addEventListener("popover:open", n), t.addEventListener("popover:close", r), () => {
96
- t.removeEventListener("popover:open", n), t.removeEventListener("popover:close", r);
262
+ return e.addEventListener("popover:open", t), e.addEventListener("popover:close", n), () => {
263
+ e.removeEventListener("popover:open", t), e.removeEventListener("popover:close", n);
97
264
  };
98
- }, [e.onOpen, e.onClose]), t(() => {
99
- d === "manual" && (m ? S.current?.showPopover?.() : S.current?.hidePopover?.());
100
- }, [m, d]), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("div", {
101
- "aria-expanded": b,
102
- className: "max-w-fit min-w-fit",
103
- style: { "anchor-name": `--zen-popover-anchor-${y}` },
104
- popoverTarget: `zen__popover-${y}`,
265
+ }, [y, b]), o(() => {
266
+ a === "manual" && (h ? T.current?.showPopover?.() : T.current?.hidePopover?.());
267
+ }, [h, a]), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
268
+ "aria-expanded": C,
269
+ className: _("max-w-fit min-w-fit", f),
270
+ style: { anchorName: `--zen-popover-anchor-${S}` },
271
+ popoverTarget: `zen__popover-${S}`,
105
272
  popoverTargetAction: "toggle",
106
- onClick: f === "click" ? (e) => {
107
- switch (e.stopPropagation(), e.nativeEvent.stopImmediatePropagation(), d) {
273
+ onClick: c === "click" ? (e) => {
274
+ switch (e.stopPropagation(), e.nativeEvent.stopImmediatePropagation(), a) {
108
275
  case "auto":
109
- S.current?.togglePopover?.();
110
- break;
111
- case "manual":
112
- h?.(!m);
276
+ T.current?.togglePopover?.();
113
277
  break;
278
+ case "manual": g?.(!h);
114
279
  }
115
280
  } : void 0,
116
- onMouseEnter: f === "hover" ? (e) => {
117
- e.stopPropagation(), S.current?.showPopover?.();
281
+ onMouseEnter: c === "hover" ? (e) => {
282
+ e.stopPropagation(), T.current?.showPopover?.();
118
283
  } : void 0,
119
- onMouseLeave: f === "hover" ? (e) => {
120
- e.stopPropagation(), S.current?.hidePopover?.();
284
+ onMouseLeave: c === "hover" ? (e) => {
285
+ e.stopPropagation(), T.current?.hidePopover?.();
121
286
  } : void 0,
122
- children: o
123
- }), /* @__PURE__ */ s("div", {
124
- ..._,
125
- ref: S,
126
- role: l,
127
- popover: d,
128
- id: `zen__popover-${y}`,
129
- className: u("zen__popover border-border bg-background fixed z-50 w-[anchor-size(width)] min-w-max [justify-self:anchor-center] rounded border shadow-md [position-area:block-end_center]", n),
287
+ children: r
288
+ }), /* @__PURE__ */ p("div", {
289
+ ...x,
290
+ ref: T,
291
+ role: i,
292
+ popover: a,
293
+ id: `zen__popover-${S}`,
294
+ className: _("zen__popover fixed z-50 w-[anchor-size(width)] min-w-max [justify-self:anchor-center] overflow-visible p-0 [position-area:block-end_center]", ie, t),
130
295
  style: {
131
- ...g,
132
- "--gap": p,
296
+ ...v,
297
+ "--gap": l,
133
298
  top: "calc(anchor(bottom) + var(--gap))",
134
299
  left: "calc(anchor(center) - 50%)",
135
- "position-anchor": `--zen-popover-anchor-${y}`
300
+ positionAnchor: `--zen-popover-anchor-${S}`
136
301
  },
137
- children: r
302
+ children: n
138
303
  })] });
139
304
  }
140
305
  //#endregion
141
306
  //#region packages/collapse/index.tsx
142
- function v(e) {
143
- let { items: n = [], children: i, moreItemsLabel: l = "", parentRef: u, data: d, estimator: f = (e, t) => t + 30, font: m = "12px Inter", badgeVariant: h = "secondary", badgeStyles: g } = e, [v, y] = a({
144
- visible: n,
307
+ function M(e) {
308
+ let { items: t = [], children: n, moreItemsLabel: r = "", parentRef: i, data: a, estimator: s = (e, t) => t + 30, font: c = "12px Inter", badgeVariant: u = "secondary", badgeStyles: h } = e, [g, v] = d({
309
+ visible: t,
145
310
  hidden: []
146
- }), b = r(() => {
311
+ }), y = l(() => {
147
312
  if (typeof document > "u") return null;
148
313
  let e = document.createElement("canvas").getContext("2d");
149
- return e && (e.font = m), e;
150
- }, []), x = () => {
151
- let e = u?.current;
314
+ return e && (e.font = c), e;
315
+ }, []), b = () => {
316
+ let e = i?.current;
152
317
  if (!e) return;
153
- let t = e.offsetWidth, r = [], i = [], a = f(l, (b?.measureText(l).width ?? 0) + 10);
154
- S?.reduce((e, o, s) => (e + o + a > t - 20 ? i.push(n[s]) : r.push(n[s]), e + o), 0), y({
155
- visible: r,
156
- hidden: i
318
+ let n = e.offsetWidth;
319
+ if (x.reduce((e, t) => e + t, 0) <= n - 20) {
320
+ v({
321
+ visible: t,
322
+ hidden: []
323
+ });
324
+ return;
325
+ }
326
+ let a = [], o = [], c = s(r, (y?.measureText(r).width ?? 0) + 10);
327
+ x?.reduce((e, r, i) => (e + r + c > n - 20 ? o.push(t[i]) : a.push(t[i]), e + r), 0), v({
328
+ visible: a,
329
+ hidden: o
157
330
  });
158
- }, S = r(() => n?.map((e) => f(e, b?.measureText(e).width ?? 0)) ?? [], [n]);
159
- return t(() => {
160
- x();
161
- }, [n]), t(() => {
162
- if (!u?.current) return;
331
+ }, x = l(() => t?.map((e) => s(e, y?.measureText(e).width ?? 0)) ?? [], [t]);
332
+ return o(() => {
333
+ b();
334
+ }, [t]), o(() => {
335
+ if (!i?.current) return;
163
336
  let e = new ResizeObserver(() => {
164
- x();
337
+ b();
165
338
  });
166
- return e.observe(u.current), () => {
339
+ return e.observe(i.current), () => {
167
340
  e.disconnect();
168
341
  };
169
- }, [n]), /* @__PURE__ */ c(o, { children: [v.visible?.map((e, t) => i(e, t, d?.[t])), v.hidden?.length > 0 && /* @__PURE__ */ s(_, {
342
+ }, [t]), /* @__PURE__ */ m(f, { children: [g.visible?.map((e, t) => n(e, t, a?.[t])), g.hidden?.length > 0 && /* @__PURE__ */ p(j, {
170
343
  trigger: "click",
171
- content: /* @__PURE__ */ s("div", {
344
+ content: /* @__PURE__ */ p("div", {
172
345
  className: "grid max-h-60 grid-flow-row grid-cols-2 gap-3 overflow-auto p-2",
173
- children: v.hidden.map((e, t) => i(e, v.visible.length + t, d?.[v.visible.length + t]))
346
+ children: g.hidden.map((e, t) => n(e, g.visible.length + t, a?.[g.visible.length + t]))
174
347
  }),
175
- children: /* @__PURE__ */ s(p, {
176
- className: g,
177
- variant: h,
178
- "aria-label": `Show ${v.hidden.length} more ${l}`,
179
- children: /* @__PURE__ */ s("span", { children: `+${v.hidden.length} ${l}` })
348
+ children: /* @__PURE__ */ p(C, {
349
+ className: _("cursor-pointer", h),
350
+ variant: u,
351
+ "aria-label": `Show ${g.hidden.length} more ${r}`,
352
+ children: /* @__PURE__ */ p("span", { children: `+${g.hidden.length} ${r}` })
180
353
  }, "more_items_button")
181
354
  })] });
182
355
  }
183
356
  //#endregion
184
- //#region node_modules/.pnpm/@tanstack+virtual-core@3.14.0/node_modules/@tanstack/virtual-core/dist/esm/utils.js
185
- function y(e, t, n) {
357
+ //#region packages/dialog/index.tsx
358
+ function N({ open: e, onOpenChange: t, title: n, description: r, children: i, dismissible: a = !0, initialFocus: c, size: l = "md", className: d, role: f }) {
359
+ let h = u(null), g = s(), v = s();
360
+ return o(() => {
361
+ let t = h.current;
362
+ t && (e && !t.open ? (t.showModal(), c?.current?.focus()) : !e && t.open && t.close());
363
+ }, [e, c]), /* @__PURE__ */ p("dialog", {
364
+ ref: h,
365
+ role: f,
366
+ "aria-labelledby": g,
367
+ "aria-describedby": r ? v : void 0,
368
+ className: _("zen__dialog glass glass-blur glow-edge text-card-foreground", "bg-card/90! m-auto max-h-[calc(100dvh-2rem)] max-w-[calc(100vw-2rem)] overflow-visible rounded-xl p-0", l === "lg" ? "w-[60rem]" : "w-[28rem]", "backdrop:bg-black/50 backdrop:backdrop-blur-sm pointer-coarse:backdrop:backdrop-blur-none", d),
369
+ onCancel: (e) => {
370
+ e.preventDefault(), a && t?.(!1);
371
+ },
372
+ onClick: (e) => {
373
+ e.target === e.currentTarget && a && t?.(!1);
374
+ },
375
+ children: /* @__PURE__ */ m("div", {
376
+ className: "flex max-h-[calc(100dvh-2rem)] flex-col gap-4 overflow-x-hidden overflow-y-auto p-6",
377
+ children: [/* @__PURE__ */ m("div", {
378
+ className: "flex flex-col gap-2",
379
+ children: [/* @__PURE__ */ p("h2", {
380
+ id: g,
381
+ className: "text-lg font-semibold",
382
+ children: n
383
+ }), r && /* @__PURE__ */ p("p", {
384
+ id: v,
385
+ className: "text-muted-foreground mt-0! text-sm leading-5",
386
+ children: r
387
+ })]
388
+ }), i]
389
+ })
390
+ });
391
+ }
392
+ //#endregion
393
+ //#region packages/confirm-dialog/index.tsx
394
+ function P({ open: e, onOpenChange: t, title: n, description: r, confirmLabel: i, cancelLabel: a = "Cancel", destructive: o = !1, onConfirm: s }) {
395
+ return /* @__PURE__ */ p(N, {
396
+ role: "alertdialog",
397
+ open: e,
398
+ onOpenChange: t,
399
+ title: n,
400
+ description: r,
401
+ className: "w-[26rem]",
402
+ children: /* @__PURE__ */ m("div", {
403
+ className: "flex justify-end gap-2",
404
+ children: [/* @__PURE__ */ p(E, {
405
+ variant: "outline",
406
+ autoFocus: !0,
407
+ onClick: () => t(!1),
408
+ children: a
409
+ }), /* @__PURE__ */ p(E, {
410
+ variant: o ? "destructive" : "default",
411
+ onClick: () => {
412
+ s(), t(!1);
413
+ },
414
+ children: i
415
+ })]
416
+ })
417
+ });
418
+ }
419
+ //#endregion
420
+ //#region node_modules/.pnpm/@tanstack+virtual-core@3.17.11/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js
421
+ function oe(e) {
422
+ return typeof e == "object" ? e.key : e;
423
+ }
424
+ function se(e, t) {
425
+ let n = e.length;
426
+ return new Proxy(e, { get(e, r, i) {
427
+ if (typeof r == "string") {
428
+ let i = r.charCodeAt(0);
429
+ if (i >= 48 && i <= 57) {
430
+ let i = +r;
431
+ if (Number.isInteger(i) && i >= 0 && i < n) {
432
+ let n = e[i];
433
+ if (typeof n != "object") {
434
+ let r = t[i * 2];
435
+ n = e[i] = {
436
+ index: i,
437
+ key: n,
438
+ start: r,
439
+ size: t[i * 2 + 1],
440
+ end: r + t[i * 2 + 1],
441
+ lane: 0
442
+ };
443
+ }
444
+ return n;
445
+ }
446
+ }
447
+ if (r === "length") return n;
448
+ }
449
+ return Reflect.get(e, r, i);
450
+ } });
451
+ }
452
+ //#endregion
453
+ //#region node_modules/.pnpm/@tanstack+virtual-core@3.17.11/node_modules/@tanstack/virtual-core/dist/esm/utils.js
454
+ function F(e, t, n) {
186
455
  let r = n.initialDeps ?? [], i, a = !0;
187
456
  function o() {
188
- let o;
189
- n.key && n.debug?.call(n) && (o = Date.now());
190
- let s = e();
191
- if (!(s.length !== r.length || s.some((e, t) => r[t] !== e))) return i;
192
- r = s;
193
- let c;
194
- if (n.key && n.debug?.call(n) && (c = Date.now()), i = t(...s), n.key && n.debug?.call(n)) {
195
- let e = Math.round((Date.now() - o) * 100) / 100, t = Math.round((Date.now() - c) * 100) / 100, r = t / 16, i = (e, t) => {
457
+ let o = process.env.NODE_ENV !== "production" && !!n.key && !!n.debug?.call(n), s = 0;
458
+ o && (s = Date.now());
459
+ let c = e();
460
+ if (!(c.length !== r.length || c.some((e, t) => r[t] !== e))) return i;
461
+ r = c;
462
+ let l = 0;
463
+ if (o && (l = Date.now()), i = t(...c), o) {
464
+ let e = Math.round((Date.now() - s) * 100) / 100, t = Math.round((Date.now() - l) * 100) / 100, r = t / 16, i = (e, t) => {
196
465
  for (e = String(e); e.length < t;) e = " " + e;
197
466
  return e;
198
467
  };
@@ -207,26 +476,34 @@ function y(e, t, n) {
207
476
  r = e;
208
477
  }, o;
209
478
  }
210
- function b(e, t) {
479
+ function I(e, t) {
211
480
  if (e === void 0) throw Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
212
481
  return e;
213
482
  }
214
- var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
483
+ var L = (e, t) => Math.abs(e - t) < 1.01, ce = (e, t, n) => {
215
484
  let r;
216
- return function(...i) {
485
+ return Object.assign(function(...i) {
217
486
  e.clearTimeout(r), r = e.setTimeout(() => t.apply(this, i), n);
218
- };
219
- }, C = (e) => {
487
+ }, { cancel: () => {
488
+ e.clearTimeout(r);
489
+ } });
490
+ }, R, z = () => {
491
+ if (R !== void 0) return R;
492
+ if (typeof navigator > "u") return R = !1;
493
+ if (/iP(hone|od|ad)/.test(navigator.userAgent)) return R = !0;
494
+ let e = navigator.maxTouchPoints;
495
+ return R = navigator.platform === "MacIntel" && e !== void 0 && e > 0;
496
+ }, B = (e) => {
220
497
  let { offsetWidth: t, offsetHeight: n } = e;
221
498
  return {
222
499
  width: t,
223
500
  height: n
224
501
  };
225
- }, w = (e) => e, T = (e) => {
226
- let t = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1), r = [];
227
- for (let e = t; e <= n; e++) r.push(e);
502
+ }, le = (e) => e, ue = (e) => {
503
+ let t = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1) - t + 1, r = Array(n);
504
+ for (let e = 0; e < n; e++) r[e] = t + e;
228
505
  return r;
229
- }, E = (e, t) => {
506
+ }, de = (e, t) => {
230
507
  let n = e.scrollElement;
231
508
  if (!n) return;
232
509
  let r = e.targetWindow;
@@ -238,7 +515,7 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
238
515
  height: Math.round(r)
239
516
  });
240
517
  };
241
- if (i(C(n)), !r.ResizeObserver) return () => {};
518
+ if (i(B(n)), !r.ResizeObserver) return () => {};
242
519
  let a = new r.ResizeObserver((t) => {
243
520
  let r = () => {
244
521
  let e = t[0];
@@ -252,45 +529,65 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
252
529
  return;
253
530
  }
254
531
  }
255
- i(C(n));
532
+ i(B(n));
256
533
  };
257
534
  e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
258
535
  });
259
536
  return a.observe(n, { box: "border-box" }), () => {
260
537
  a.unobserve(n);
261
538
  };
262
- }, D = { passive: !0 }, O = typeof window > "u" ? !0 : "onscrollend" in window, k = (e, t) => {
263
- let n = e.scrollElement;
264
- if (!n) return;
265
- let r = e.targetWindow;
539
+ }, V = { passive: !0 }, H = typeof window > "u" || "onscrollend" in window, fe = (e, t, n) => {
540
+ let r = e.scrollElement;
266
541
  if (!r) return;
267
- let i = 0, a = e.options.useScrollendEvent && O ? () => void 0 : S(r, () => {
268
- t(i, !1);
269
- }, e.options.isScrollingResetDelay), o = (r) => () => {
270
- let { horizontal: o, isRtl: s } = e.options;
271
- i = o ? n.scrollLeft * (s && -1 || 1) : n.scrollTop, a(), t(i, r);
272
- }, s = o(!0), c = o(!1);
273
- n.addEventListener("scroll", s, D);
274
- let l = e.options.useScrollendEvent && O;
275
- return l && n.addEventListener("scrollend", c, D), () => {
276
- n.removeEventListener("scroll", s), l && n.removeEventListener("scrollend", c);
542
+ let i = e.targetWindow;
543
+ if (!i) return;
544
+ let a = e.options.useScrollendEvent && H, o = 0, s = a ? null : ce(i, () => t(n(r), !1), e.options.isScrollingResetDelay), c = (e) => () => {
545
+ o = n(r), s?.(), t(o, e);
546
+ }, l = c(!0), u = c(!1);
547
+ return r.addEventListener("scroll", l, V), a && r.addEventListener("scrollend", u, V), () => {
548
+ r.removeEventListener("scroll", l), a && r.removeEventListener("scrollend", u), s?.cancel();
277
549
  };
278
- }, A = (e, t, n) => {
550
+ }, pe = (e, t) => fe(e, t, (t) => {
551
+ let { horizontal: n, isRtl: r } = e.options;
552
+ return n ? t.scrollLeft * (r && -1 || 1) : t.scrollTop;
553
+ }), me = (e, t, n) => {
554
+ if (n.options.useCachedMeasurements) {
555
+ let t = n.indexFromElement(e), r = n.options.getItemKey(t);
556
+ return n.itemSizeCache.get(r) ?? n.options.estimateSize(t);
557
+ }
279
558
  if (t?.borderBoxSize) {
280
559
  let e = t.borderBoxSize[0];
281
560
  if (e) return Math.round(e[n.options.horizontal ? "inlineSize" : "blockSize"]);
282
561
  }
562
+ if (!t) {
563
+ let t = n.indexFromElement(e), r = n.options.getItemKey(t), i = n.itemSizeCache.get(r);
564
+ if (i !== void 0) return i;
565
+ }
283
566
  return e[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
284
- }, j = (e, { adjustments: t = 0, behavior: n }, r) => {
567
+ }, he = (e, { adjustments: t = 0, behavior: n }, r) => {
285
568
  var i, a;
286
- let o = e + t;
287
569
  (a = (i = r.scrollElement)?.scrollTo) == null || a.call(i, {
288
- [r.options.horizontal ? "left" : "top"]: o,
570
+ [r.options.horizontal ? "left" : "top"]: e + t,
289
571
  behavior: n
290
572
  });
291
- }, M = class {
573
+ };
574
+ function ge(e, t, n, r) {
575
+ if (t === 0) return !1;
576
+ let i = r(0), a = /* @__PURE__ */ new Set(), o = 0;
577
+ for (; o < e;) {
578
+ let e = n(o);
579
+ if (e === i) break;
580
+ a.add(e), o++;
581
+ }
582
+ let s = e - o;
583
+ if (s === 0 || s >= t) return !1;
584
+ for (let e = 0; e < s; e++) if (r(e) !== n(o + e)) return !1;
585
+ for (let e = s; e < t; e++) if (a.has(r(e))) return !1;
586
+ return !0;
587
+ }
588
+ var _e = class {
292
589
  constructor(e) {
293
- this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
590
+ this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this._singleLaneMeasurements = null, this.itemSizeCache = /* @__PURE__ */ new Map(), this.itemSizeCacheVersion = 0, this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMin = null, this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.pendingScrollAnchor = null, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._intendedScrollOffset = null, this._clampedAdjustment = null, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
294
591
  var e;
295
592
  return ((e = this.targetWindow?.performance)?.now)?.call(e) ?? Date.now();
296
593
  }, this.observer = /* @__PURE__ */ (() => {
@@ -300,9 +597,13 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
300
597
  let t = e.target, n = this.indexFromElement(t);
301
598
  if (!t.isConnected) {
302
599
  this.observer.unobserve(t);
600
+ for (let [e, n] of this.elementsCache) if (n === t) {
601
+ this.elementsCache.delete(e);
602
+ break;
603
+ }
303
604
  return;
304
605
  }
305
- this.shouldMeasureDuringScroll(n) && this.resizeItem(n, this.options.measureElement(t, e, this));
606
+ this.isIndexInRange(n) && this.shouldMeasureDuringScroll(n) && this.resizeItem(n, this.options.measureElement(t, e, this));
306
607
  };
307
608
  this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(t) : t();
308
609
  });
@@ -316,9 +617,7 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
316
617
  unobserve: (e) => t()?.unobserve(e)
317
618
  };
318
619
  })(), this.range = null, this.setOptions = (e) => {
319
- Object.entries(e).forEach(([t, n]) => {
320
- n === void 0 && delete e[t];
321
- }), this.options = {
620
+ let t = {
322
621
  debug: !1,
323
622
  initialOffset: 0,
324
623
  overscan: 1,
@@ -327,10 +626,10 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
327
626
  scrollPaddingStart: 0,
328
627
  scrollPaddingEnd: 0,
329
628
  horizontal: !1,
330
- getItemKey: w,
331
- rangeExtractor: T,
629
+ getItemKey: le,
630
+ rangeExtractor: ue,
332
631
  onChange: () => {},
333
- measureElement: A,
632
+ measureElement: me,
334
633
  initialRect: {
335
634
  width: 0,
336
635
  height: 0
@@ -340,18 +639,55 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
340
639
  indexAttribute: "data-index",
341
640
  initialMeasurementsCache: [],
342
641
  lanes: 1,
642
+ anchorTo: "start",
643
+ followOnAppend: !1,
644
+ scrollEndThreshold: 1,
343
645
  isScrollingResetDelay: 150,
344
646
  enabled: !0,
345
647
  isRtl: !1,
346
648
  useScrollendEvent: !1,
347
649
  useAnimationFrameWithResizeObserver: !1,
348
650
  laneAssignmentMode: "estimate",
349
- ...e
651
+ useCachedMeasurements: !1
350
652
  };
653
+ for (let n in e) {
654
+ let r = e[n];
655
+ r !== void 0 && (t[n] = r);
656
+ }
657
+ let n = this.options, r = null, i = null, a = !1;
658
+ if (n !== void 0 && n.enabled && t.enabled && t.anchorTo === "end" && this.scrollElement !== null) {
659
+ let e = n.count, o = t.count, s = this.getMeasurements(), c = this._singleLaneMeasurements?.items ?? s, l = (e) => oe(c[e]), u = e > 0 ? l(0) : null, d = e > 0 ? l(e - 1) : null;
660
+ if (o !== e || e > 0 && o > 0 && (t.getItemKey(0) !== u || t.getItemKey(o - 1) !== d)) {
661
+ a = !0;
662
+ let c = e > 0 ? this.getVirtualItemForOffset(this.getScrollOffset()) ?? s[0] : null;
663
+ c && (r = [c.key, this.getScrollOffset() - c.start]);
664
+ let u = t.followOnAppend === !0 ? "auto" : t.followOnAppend || null;
665
+ u && o > 0 && this.isAtEnd(n.scrollEndThreshold) && (e === 0 || t.getItemKey(o - 1) !== d) && (o > e || ge(e, o, l, t.getItemKey)) && (i = u);
666
+ }
667
+ }
668
+ this.options = t, a && (this.pendingMin = 0, this.itemSizeCacheVersion++);
669
+ let o = !1, s = 0;
670
+ if (r && this.scrollOffset !== null) {
671
+ let [e, t] = r, n = this.getMeasurements(), { count: a, getItemKey: c } = this.options, l = 0;
672
+ for (; l < a && c(l) !== e;) l++;
673
+ if (l < a) {
674
+ let e = n[l];
675
+ if (e) {
676
+ let n = Math.max(0, e.start + t);
677
+ !i && n !== this.scrollOffset && (s = n - this.scrollOffset, this.scrollOffset = n, o = !0);
678
+ }
679
+ }
680
+ }
681
+ (o || i) && (this.pendingScrollAnchor = [
682
+ o ? r[0] : null,
683
+ o ? r[1] : 0,
684
+ i,
685
+ s
686
+ ]);
351
687
  }, this.notify = (e) => {
352
688
  var t, n;
353
689
  (n = (t = this.options).onChange) == null || n.call(t, this, e);
354
- }, this.maybeNotify = y(() => (this.calculateRange(), [
690
+ }, this.maybeNotify = F(() => (this.calculateRange(), [
355
691
  this.isScrolling,
356
692
  this.range ? this.range.startIndex : null,
357
693
  this.range ? this.range.endIndex : null
@@ -366,7 +702,7 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
366
702
  this.range ? this.range.endIndex : null
367
703
  ]
368
704
  }), this.cleanup = () => {
369
- this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
705
+ this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.isScrolling = !1, this.scrollDirection = null, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this._clampedAdjustment = null, this.scrollElement = null, this.targetWindow = null;
370
706
  }, this._didMount = () => () => {
371
707
  this.cleanup();
372
708
  }, this._willUpdate = () => {
@@ -376,93 +712,157 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
376
712
  this.maybeNotify();
377
713
  return;
378
714
  }
379
- this.scrollElement = e, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = this.scrollElement?.window ?? null, this.elementsCache.forEach((e) => {
715
+ if (this.scrollElement = e, this.targetWindow = this.scrollElement && "ownerDocument" in this.scrollElement ? this.scrollElement.ownerDocument.defaultView : this.scrollElement?.window ?? null, this.elementsCache.forEach((e) => {
380
716
  this.observer.observe(e);
381
717
  }), this.unsubs.push(this.options.observeElementRect(this, (e) => {
382
718
  this.scrollRect = e, this.maybeNotify();
383
719
  })), this.unsubs.push(this.options.observeElementOffset(this, (e, t) => {
384
- this.scrollAdjustments = 0, this.scrollDirection = t ? this.getScrollOffset() < e ? "forward" : "backward" : null, this.scrollOffset = e, this.isScrolling = t, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
385
- })), this._scrollToOffset(this.getScrollOffset(), {
720
+ if (t && this._intendedScrollOffset === null && e === this.scrollOffset) return;
721
+ this._intendedScrollOffset !== null && Math.abs(e - this._intendedScrollOffset) < 1.5 && (e = this._intendedScrollOffset), this._intendedScrollOffset = null, this._clampedAdjustment !== null && Math.abs(e - this._clampedAdjustment.maxAtWrite) >= 1.5 && (this._clampedAdjustment = null), this.scrollAdjustments = 0;
722
+ let n = this.getScrollOffset();
723
+ this.scrollDirection = t ? n === e ? this.scrollDirection : n < e ? "forward" : "backward" : null, this.scrollOffset = e, this.isScrolling = t, this._flushIosDeferredIfReady(), this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
724
+ })), "addEventListener" in this.scrollElement) {
725
+ let e = this.scrollElement, t = () => {
726
+ this._iosTouching = !0, this._iosJustTouchEnded = !1, this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
727
+ }, n = () => {
728
+ this._iosTouching = !1, z() && this.targetWindow != null && (this._iosJustTouchEnded = !0, this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {
729
+ this._iosJustTouchEnded = !1, this._iosTouchEndTimerId = null, this._flushIosDeferredIfReady();
730
+ }, 150));
731
+ };
732
+ e.addEventListener("touchstart", t, V), e.addEventListener("touchend", n, V), this.unsubs.push(() => {
733
+ e.removeEventListener("touchstart", t), e.removeEventListener("touchend", n), this._iosTouchEndTimerId !== null && this.targetWindow != null && (this.targetWindow.clearTimeout(this._iosTouchEndTimerId), this._iosTouchEndTimerId = null);
734
+ });
735
+ }
736
+ this._scrollToOffset(this.getScrollOffset(), {
386
737
  adjustments: void 0,
387
738
  behavior: void 0
388
739
  });
389
740
  }
390
- }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, t) => {
391
- let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
392
- for (let i = t - 1; i >= 0; i--) {
393
- let t = e[i];
394
- if (n.has(t.lane)) continue;
395
- let a = r.get(t.lane);
396
- if (a == null || t.end > a.end ? r.set(t.lane, t) : t.end < a.end && n.set(t.lane, !0), n.size === this.options.lanes) break;
741
+ let t = this.pendingScrollAnchor;
742
+ if (this.pendingScrollAnchor = null, t && this.scrollElement && this.options.enabled) {
743
+ let [e, n, r, i] = t;
744
+ e !== null && !r && (z() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded) ? i !== 0 && (this._iosDeferredAdjustment += i) : this.scrollState?.behavior === "smooth" && !L(this.getScrollOffset() - i, this.scrollState.lastTargetOffset) || this._scrollToOffset(this.getScrollOffset(), {
745
+ adjustments: void 0,
746
+ behavior: void 0
747
+ })), r && this.scrollToEnd({ behavior: r });
397
748
  }
398
- return r.size === this.options.lanes ? Array.from(r.values()).sort((e, t) => e.end === t.end ? e.index - t.index : e.end - t.end)[0] : void 0;
399
- }, this.getMeasurementOptions = y(() => [
749
+ this._retryClampedAdjustment();
750
+ }, this._retryClampedAdjustment = () => {
751
+ if (this._clampedAdjustment === null || !this.scrollElement || !this.options.enabled) return;
752
+ let { target: e, maxAtWrite: t } = this._clampedAdjustment, n = this.getMaxScrollOffset();
753
+ n > t + .5 && (this._clampedAdjustment = e > n + .5 ? {
754
+ target: e,
755
+ maxAtWrite: n
756
+ } : null, this._scrollToOffset(e, {
757
+ adjustments: void 0,
758
+ behavior: void 0
759
+ }));
760
+ }, this._flushIosDeferredIfReady = () => {
761
+ if (this._iosDeferredAdjustment === 0 || this.isScrolling || this._iosTouching || this._iosJustTouchEnded) return;
762
+ let e = this.getScrollOffset(), t = this.getMaxScrollOffset();
763
+ if (e < 0 || e > t) return;
764
+ if (this._iosDeferredAdjustment < 0 && e >= t - 1) {
765
+ this._iosDeferredAdjustment = 0;
766
+ return;
767
+ }
768
+ let n = this._iosDeferredAdjustment;
769
+ this._iosDeferredAdjustment = 0, this._scrollToOffset(e, {
770
+ adjustments: this.scrollAdjustments += n,
771
+ behavior: void 0
772
+ });
773
+ }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getMeasurementOptions = F(() => [
400
774
  this.options.count,
401
775
  this.options.paddingStart,
402
776
  this.options.scrollMargin,
403
777
  this.options.getItemKey,
404
778
  this.options.enabled,
405
779
  this.options.lanes,
406
- this.options.laneAssignmentMode
407
- ], (e, t, n, r, i, a, o) => (this.prevLanes !== void 0 && this.prevLanes !== a && (this.lanesChangedFlag = !0), this.prevLanes = a, this.pendingMeasuredCacheIndexes = [], {
780
+ this.options.laneAssignmentMode,
781
+ this.options.gap
782
+ ], (e, t, n, r, i, a, o, s) => (this.prevLanes !== void 0 && this.prevLanes !== a && (this.lanesChangedFlag = !0), this.prevLanes = a, this.pendingMin = null, {
408
783
  count: e,
409
784
  paddingStart: t,
410
785
  scrollMargin: n,
411
786
  getItemKey: r,
412
787
  enabled: i,
413
788
  lanes: a,
414
- laneAssignmentMode: o
415
- }), { key: !1 }), this.getMeasurements = y(() => [this.getMeasurementOptions(), this.itemSizeCache], ({ count: e, paddingStart: t, scrollMargin: n, getItemKey: r, enabled: i, lanes: a, laneAssignmentMode: o }, s) => {
416
- if (!i) return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
789
+ laneAssignmentMode: o,
790
+ gap: s
791
+ }), { key: !1 }), this.isIndexInRange = (e) => e >= 0 && e < this.options.count, this.getMeasurements = F(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: e, paddingStart: t, scrollMargin: n, getItemKey: r, enabled: i, lanes: a, laneAssignmentMode: o, gap: s }, c) => {
792
+ let l = this.itemSizeCache;
793
+ if (!i) return this.measurementsCache = [], this._singleLaneMeasurements = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
417
794
  if (this.laneAssignments.size > e) for (let t of this.laneAssignments.keys()) t >= e && this.laneAssignments.delete(t);
418
- this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((e) => {
795
+ this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this._singleLaneMeasurements = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMin = null), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((e) => {
419
796
  this.itemSizeCache.set(e.key, e.size);
420
797
  }));
421
- let c = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
422
- this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
423
- let l = this.measurementsCache.slice(0, c), u = Array(a).fill(void 0);
424
- for (let e = 0; e < c; e++) {
425
- let t = l[e];
426
- t && (u[t.lane] = e);
427
- }
428
- for (let i = c; i < e; i++) {
429
- let e = r(i), a = this.laneAssignments.get(i), c, d, f = o === "estimate" || s.has(e);
430
- if (a !== void 0 && this.options.lanes > 1) {
431
- c = a;
432
- let e = u[c], r = e === void 0 ? void 0 : l[e];
433
- d = r ? r.end + this.options.gap : t + n;
434
- } else {
435
- let e = this.options.lanes === 1 ? l[i - 1] : this.getFurthestMeasurement(l, i);
436
- d = e ? e.end + this.options.gap : t + n, c = e ? e.lane : i % this.options.lanes, this.options.lanes > 1 && f && this.laneAssignments.set(i, c);
798
+ let u = this.lanesSettling ? 0 : this.pendingMin ?? 0;
799
+ if (this.pendingMin = null, this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1), a === 1) {
800
+ let i = e * 2, a = this._singleLaneMeasurements?.flat;
801
+ if (!a || a.length < i) {
802
+ let e = new Float64Array(i);
803
+ a && u > 0 && e.set(a.subarray(0, u * 2)), a = e;
437
804
  }
438
- let p = s.get(e), m = typeof p == "number" ? p : this.options.estimateSize(i), h = d + m;
439
- l[i] = {
805
+ let o = u === 0 ? Array(e) : this._singleLaneMeasurements.items.slice(), c;
806
+ if (u === 0) c = t + n;
807
+ else {
808
+ let e = u - 1;
809
+ c = a[e * 2] + a[e * 2 + 1] + s;
810
+ }
811
+ for (let t = u; t < e; t++) {
812
+ let e = r(t);
813
+ o[t] = e;
814
+ let n = l.get(e), i = typeof n == "number" ? n : this.options.estimateSize(t);
815
+ a[t * 2] = c, a[t * 2 + 1] = i, c += i + s;
816
+ }
817
+ this._singleLaneMeasurements = {
818
+ flat: a,
819
+ items: o
820
+ };
821
+ let d = se(o, a);
822
+ return this.measurementsCache = d, d;
823
+ }
824
+ let d = this.measurementsCache.slice(0, u), f = Array(a).fill(void 0), p = new Float64Array(a), m = 0;
825
+ for (let e = 0; e < u; e++) {
826
+ let t = d[e];
827
+ t && (f[t.lane] === void 0 && m++, f[t.lane] = e, p[t.lane] = t.end);
828
+ }
829
+ for (let i = u; i < e; i++) {
830
+ let e = r(i), c = this.laneAssignments.get(i), u, h, g = o === "estimate" || l.has(e);
831
+ if (c !== void 0 && this.options.lanes > 1) {
832
+ u = c;
833
+ let e = f[u], r = e === void 0 ? void 0 : d[e];
834
+ h = r ? r.end + s : t + n;
835
+ } else if (m === a) {
836
+ let e = 0, t = p[0], n = f[0];
837
+ for (let r = 1; r < a; r++) {
838
+ let i = p[r];
839
+ (i < t || i === t && f[r] < n) && (e = r, t = i, n = f[r]);
840
+ }
841
+ u = e, h = t + s, g && this.laneAssignments.set(i, u);
842
+ } else u = i % this.options.lanes, h = t + n, g && this.laneAssignments.set(i, u);
843
+ let _ = l.get(e), v = typeof _ == "number" ? _ : this.options.estimateSize(i), y = h + v;
844
+ d[i] = {
440
845
  index: i,
441
- start: d,
442
- size: m,
443
- end: h,
846
+ start: h,
847
+ size: v,
848
+ end: y,
444
849
  key: e,
445
- lane: c
446
- }, u[c] = i;
850
+ lane: u
851
+ }, f[u] === void 0 && m++, f[u] = i, p[u] = y;
447
852
  }
448
- return this.measurementsCache = l, l;
853
+ return this.measurementsCache = d, d;
449
854
  }, {
450
855
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
451
856
  debug: () => this.options.debug
452
- }), this.calculateRange = y(() => [
857
+ }), this.calculateRange = F(() => [
453
858
  this.getMeasurements(),
454
859
  this.getSize(),
455
860
  this.getScrollOffset(),
456
861
  this.options.lanes
457
- ], (e, t, n, r) => this.range = e.length > 0 && t > 0 ? P({
458
- measurements: e,
459
- outerSize: t,
460
- scrollOffset: n,
461
- lanes: r
462
- }) : null, {
862
+ ], (e, t, n, r) => e.length === 0 || t === 0 ? (this.range = null, null) : (this.range = ye(e, t, n, r, r === 1 && this._singleLaneMeasurements !== null ? this._singleLaneMeasurements.flat : null), this.range), {
463
863
  key: process.env.NODE_ENV !== "production" && "calculateRange",
464
864
  debug: () => this.options.debug
465
- }), this.getVirtualIndexes = y(() => {
865
+ }), this.getVirtualIndexes = F(() => {
466
866
  let e = null, t = null, n = this.calculateRange();
467
867
  return n && (e = n.startIndex, t = n.endIndex), this.maybeNotify.updateDeps([
468
868
  this.isScrolling,
@@ -501,17 +901,34 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
501
901
  });
502
902
  return;
503
903
  }
504
- let t = this.indexFromElement(e), n = this.options.getItemKey(t), r = this.elementsCache.get(n);
904
+ let t = this.indexFromElement(e);
905
+ if (!this.isIndexInRange(t)) return;
906
+ let n = this.options.getItemKey(t), r = this.elementsCache.get(n);
505
907
  r !== e && (r && this.observer.unobserve(r), this.observer.observe(e), this.elementsCache.set(n, e)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(t) && this.resizeItem(t, this.options.measureElement(e, void 0, this));
506
908
  }, this.resizeItem = (e, t) => {
507
- let n = this.measurementsCache[e];
508
- if (!n) return;
509
- let r = t - (this.itemSizeCache.get(n.key) ?? n.size);
510
- r !== 0 && (this.scrollState?.behavior !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange === void 0 ? n.start < this.getScrollOffset() + this.scrollAdjustments : this.shouldAdjustScrollPositionOnItemSizeChange(n, r, this)) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
511
- adjustments: this.scrollAdjustments += r,
512
- behavior: void 0
513
- })), this.pendingMeasuredCacheIndexes.push(n.index), this.itemSizeCache = new Map(this.itemSizeCache.set(n.key, t)), this.notify(!1));
514
- }, this.getVirtualItems = y(() => [this.getVirtualIndexes(), this.getMeasurements()], (e, t) => {
909
+ if (!this.isIndexInRange(e)) return;
910
+ let n, r, i, a = this._singleLaneMeasurements?.flat;
911
+ if (this.options.lanes === 1 && a != null) i = this.options.getItemKey(e), r = a[e * 2], n = a[e * 2 + 1];
912
+ else {
913
+ let t = this.measurementsCache[e];
914
+ if (!t) return;
915
+ i = t.key, r = t.start, n = t.size;
916
+ }
917
+ let o = this.itemSizeCache.get(i) ?? n, s = t - o;
918
+ if (s !== 0) {
919
+ let a = this.options.anchorTo === "end" && this.scrollState?.behavior !== "smooth" && this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold, c = a ? this.getTotalSize() : 0, l = this.getScrollOffset() + this.scrollAdjustments, u = this.itemSizeCache.has(i) ? r + o <= l && this.scrollDirection !== "backward" : r < l, d = this.scrollState?.behavior !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange === void 0 ? u : this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e] ?? {
920
+ index: e,
921
+ key: i,
922
+ start: r,
923
+ size: n,
924
+ end: r + n,
925
+ lane: 0
926
+ }, s, this));
927
+ (this.pendingMin === null || e < this.pendingMin) && (this.pendingMin = e), this.itemSizeCache.set(i, t), this.itemSizeCacheVersion++;
928
+ let f = !1;
929
+ a ? f = this.applyScrollAdjustment(this.getTotalSize() - c) : d && (f = this.applyScrollAdjustment(s)), this.notify(f), this._retryClampedAdjustment();
930
+ }
931
+ }, this.getVirtualItems = F(() => [this.getVirtualIndexes(), this.getMeasurements()], (e, t) => {
515
932
  let n = [];
516
933
  for (let r = 0, i = e.length; r < i; r++) {
517
934
  let i = t[e[r]];
@@ -523,7 +940,9 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
523
940
  debug: () => this.options.debug
524
941
  }), this.getVirtualItemForOffset = (e) => {
525
942
  let t = this.getMeasurements();
526
- if (t.length !== 0) return b(t[N(0, t.length - 1, (e) => b(t[e]).start, e)]);
943
+ if (t.length === 0) return;
944
+ let n = this._singleLaneMeasurements?.flat, r = this.options.lanes === 1 && n != null;
945
+ return I(t[U(0, t.length - 1, r ? (e) => n[e * 2] : (e) => I(t[e]).start, e)]);
527
946
  }, this.getMaxScrollOffset = () => {
528
947
  if (!this.scrollElement) return 0;
529
948
  if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
@@ -531,7 +950,7 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
531
950
  let e = this.scrollElement.document.documentElement;
532
951
  return this.options.horizontal ? e.scrollWidth - this.scrollElement.innerWidth : e.scrollHeight - this.scrollElement.innerHeight;
533
952
  }
534
- }, this.getOffsetForAlignment = (e, t, n = 0) => {
953
+ }, this.getVirtualDistanceFromEnd = () => Math.max(this.getTotalSize() - this.getSize() - this.getScrollOffset(), 0), this.getDistanceFromEnd = () => Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0), this.isAtEnd = (e = this.options.scrollEndThreshold) => this.getDistanceFromEnd() <= e, this.getOffsetForAlignment = (e, t, n = 0) => {
535
954
  if (!this.scrollElement) return 0;
536
955
  let r = this.getSize(), i = this.getScrollOffset();
537
956
  t === "auto" && (t = e >= i + r ? "end" : "start"), t === "center" ? e += (n - r) / 2 : t === "end" && (e -= r);
@@ -541,13 +960,16 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
541
960
  e = Math.max(0, Math.min(e, this.options.count - 1));
542
961
  let n = this.getSize(), r = this.getScrollOffset(), i = this.measurementsCache[e];
543
962
  if (!i) return;
544
- if (t === "auto") if (i.end >= r + n - this.options.scrollPaddingEnd) t = "end";
545
- else if (i.start <= r + this.options.scrollPaddingStart) t = "start";
546
- else return [r, t];
963
+ if (t === "auto") {
964
+ if (i.end >= r + n - this.options.scrollPaddingEnd) t = "end";
965
+ else if (i.start <= r + this.options.scrollPaddingStart) t = "start";
966
+ else return [r, t];
967
+ }
547
968
  if (t === "end" && e === this.options.count - 1) return [this.getMaxScrollOffset(), t];
548
969
  let a = t === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
549
970
  return [this.getOffsetForAlignment(a, t, i.size), t];
550
971
  }, this.scrollToOffset = (e, { align: t = "start", behavior: n = "auto" } = {}) => {
972
+ this._iosDeferredAdjustment = 0;
551
973
  let r = this.getOffsetForAlignment(e, t), i = this.now();
552
974
  this.scrollState = {
553
975
  index: null,
@@ -561,7 +983,7 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
561
983
  behavior: n
562
984
  }), this.scheduleScrollReconcile();
563
985
  }, this.scrollToIndex = (e, { align: t = "auto", behavior: n = "auto" } = {}) => {
564
- e = Math.max(0, Math.min(e, this.options.count - 1));
986
+ this._iosDeferredAdjustment = 0, e = Math.max(0, Math.min(e, this.options.count - 1));
565
987
  let r = this.getOffsetForIndex(e, t);
566
988
  if (!r) return;
567
989
  let [i, a] = r, o = this.now();
@@ -589,11 +1011,22 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
589
1011
  adjustments: void 0,
590
1012
  behavior: t
591
1013
  }), this.scheduleScrollReconcile();
1014
+ }, this.scrollToEnd = ({ behavior: e = "auto" } = {}) => {
1015
+ if (this.options.count > 0) {
1016
+ this.scrollToIndex(this.options.count - 1, {
1017
+ align: "end",
1018
+ behavior: e
1019
+ });
1020
+ return;
1021
+ }
1022
+ this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), { behavior: e });
592
1023
  }, this.getTotalSize = () => {
593
1024
  let e = this.getMeasurements(), t;
594
1025
  if (e.length === 0) t = this.options.paddingStart;
595
- else if (this.options.lanes === 1) t = e[e.length - 1]?.end ?? 0;
596
- else {
1026
+ else if (this.options.lanes === 1) {
1027
+ let n = e.length - 1, r = this._singleLaneMeasurements?.flat;
1028
+ t = r == null ? e[n]?.end ?? 0 : r[n * 2] + r[n * 2 + 1];
1029
+ } else {
597
1030
  let n = Array(this.options.lanes).fill(null), r = e.length - 1;
598
1031
  for (; r >= 0 && n.some((e) => e === null);) {
599
1032
  let t = e[r];
@@ -602,15 +1035,42 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
602
1035
  t = Math.max(...n.filter((e) => e !== null));
603
1036
  }
604
1037
  return Math.max(t - this.options.scrollMargin + this.options.paddingEnd, 0);
1038
+ }, this.takeSnapshot = () => {
1039
+ let e = [];
1040
+ if (this.itemSizeCache.size === 0) return e;
1041
+ let t = this.getMeasurements();
1042
+ for (let n of t) n && this.itemSizeCache.has(n.key) && e.push({
1043
+ index: n.index,
1044
+ key: n.key,
1045
+ start: n.start,
1046
+ size: n.size,
1047
+ end: n.end,
1048
+ lane: n.lane
1049
+ });
1050
+ return e;
605
1051
  }, this._scrollToOffset = (e, { adjustments: t, behavior: n }) => {
606
- this.options.scrollToFn(e, {
1052
+ this._intendedScrollOffset = e + (t ?? 0), this.options.scrollToFn(e, {
607
1053
  behavior: n,
608
1054
  adjustments: t
609
1055
  }, this);
610
1056
  }, this.measure = () => {
611
- this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
1057
+ this.pendingMin = null, this.itemSizeCache.clear(), this.laneAssignments.clear(), this.itemSizeCacheVersion++, this.notify(!1);
612
1058
  }, this.setOptions(e);
613
1059
  }
1060
+ applyScrollAdjustment(e, t) {
1061
+ if (e === 0) return !1;
1062
+ if (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", e), z() && (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)) return this._iosDeferredAdjustment += e, !1;
1063
+ {
1064
+ let n = this.getScrollOffset() + this.scrollAdjustments + e, r = this.scrollElement, i = r !== null && ("scrollHeight" in r || "document" in r) ? this.getMaxScrollOffset() : null;
1065
+ return this._clampedAdjustment = i !== null && n > i + .5 ? {
1066
+ target: n,
1067
+ maxAtWrite: i
1068
+ } : null, this._scrollToOffset(this.getScrollOffset(), {
1069
+ adjustments: this.scrollAdjustments += e,
1070
+ behavior: t
1071
+ }), this.scrollOffset !== null && (this.scrollOffset += this.scrollAdjustments, this.scrollOffset < 0 && (this.scrollOffset = 0), this.scrollAdjustments = 0), !0;
1072
+ }
1073
+ }
614
1074
  scheduleScrollReconcile() {
615
1075
  if (!this.targetWindow) {
616
1076
  this.scrollState = null;
@@ -627,18 +1087,24 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
627
1087
  return;
628
1088
  }
629
1089
  let e = this.scrollState.index == null ? void 0 : this.getOffsetForIndex(this.scrollState.index, this.scrollState.align), t = e ? e[0] : this.scrollState.lastTargetOffset, n = t !== this.scrollState.lastTargetOffset;
630
- if (!n && x(t, this.getScrollOffset())) {
1090
+ if (!n && L(t, this.getScrollOffset())) {
631
1091
  if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= 1) {
632
- this.scrollState = null;
1092
+ this.getScrollOffset() !== t && this._scrollToOffset(t, {
1093
+ adjustments: void 0,
1094
+ behavior: "auto"
1095
+ }), this.scrollState = null;
633
1096
  return;
634
1097
  }
635
- } else this.scrollState.stableFrames = 0, n && (this.scrollState.lastTargetOffset = t, this.scrollState.behavior = "auto", this._scrollToOffset(t, {
636
- adjustments: void 0,
637
- behavior: "auto"
638
- }));
1098
+ } else if (this.scrollState.stableFrames = 0, n) {
1099
+ let e = this.getSize() || 600, n = Math.abs(t - this.getScrollOffset()), r = this.scrollState.behavior === "smooth" && n > e;
1100
+ this.scrollState.lastTargetOffset = t, r || (this.scrollState.behavior = "auto"), this._scrollToOffset(t, {
1101
+ adjustments: void 0,
1102
+ behavior: r ? "smooth" : "auto"
1103
+ });
1104
+ }
639
1105
  this.scheduleScrollReconcile();
640
1106
  }
641
- }, N = (e, t, n, r) => {
1107
+ }, U = (e, t, n, r) => {
642
1108
  for (; e <= t;) {
643
1109
  let i = (e + t) / 2 | 0, a = n(i);
644
1110
  if (a < r) e = i + 1;
@@ -647,26 +1113,44 @@ var x = (e, t) => Math.abs(e - t) < 1.01, S = (e, t, n) => {
647
1113
  }
648
1114
  return e > 0 ? e - 1 : 0;
649
1115
  };
650
- function P({ measurements: e, outerSize: t, scrollOffset: n, lanes: r }) {
651
- let i = e.length - 1, a = (t) => e[t].start;
1116
+ function ve(e, t, n) {
1117
+ let r = 0;
1118
+ for (; r <= t;) {
1119
+ let i = (r + t) / 2 | 0, a = e[i * 2];
1120
+ if (a < n) r = i + 1;
1121
+ else if (a > n) t = i - 1;
1122
+ else return i;
1123
+ }
1124
+ return r > 0 ? r - 1 : 0;
1125
+ }
1126
+ function ye(e, t, n, r, i) {
1127
+ let a = e.length - 1;
652
1128
  if (e.length <= r) return {
653
1129
  startIndex: 0,
654
- endIndex: i
1130
+ endIndex: a
655
1131
  };
656
- let o = N(0, i, a, n), s = o;
657
- if (r === 1) for (; s < i && e[s].end < n + t;) s++;
1132
+ if (r === 1 && i !== null) {
1133
+ let e = ve(i, a, n), r = e, o = n + t;
1134
+ for (; r < a && i[r * 2] + i[r * 2 + 1] < o;) r++;
1135
+ return {
1136
+ startIndex: e,
1137
+ endIndex: r
1138
+ };
1139
+ }
1140
+ let o = U(0, a, (t) => e[t].start, n), s = o;
1141
+ if (r === 1) for (; s < a && e[s].end < n + t;) s++;
658
1142
  else if (r > 1) {
659
- let a = Array(r).fill(0);
660
- for (; s < i && a.some((e) => e < n + t);) {
1143
+ let i = Array(r).fill(0);
1144
+ for (; s < a && i.some((e) => e < n + t);) {
661
1145
  let t = e[s];
662
- a[t.lane] = t.end, s++;
1146
+ i[t.lane] = t.end, s++;
663
1147
  }
664
1148
  let c = Array(r).fill(n + t);
665
1149
  for (; o >= 0 && c.some((e) => e >= n);) {
666
1150
  let t = e[o];
667
1151
  c[t.lane] = t.start, o--;
668
1152
  }
669
- o = Math.max(0, o - o % r), s = Math.min(i, s + (r - 1 - s % r));
1153
+ o = Math.max(0, o - o % r), s = Math.min(a, s + (r - 1 - s % r));
670
1154
  }
671
1155
  return {
672
1156
  startIndex: o,
@@ -674,48 +1158,87 @@ function P({ measurements: e, outerSize: t, scrollOffset: n, lanes: r }) {
674
1158
  };
675
1159
  }
676
1160
  //#endregion
677
- //#region node_modules/.pnpm/@tanstack+react-virtual@3.13.24_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@tanstack/react-virtual/dist/esm/index.js
678
- var F = typeof document < "u" ? e.useLayoutEffect : e.useEffect;
679
- function I({ useFlushSync: t = !0, ...n }) {
680
- let r = e.useReducer(() => ({}), {})[1], i = {
681
- ...n,
682
- onChange: (e, i) => {
683
- var a;
684
- t && i ? l(r) : r(), (a = n.onChange) == null || a.call(n, e, i);
1161
+ //#region node_modules/.pnpm/@tanstack+react-virtual@3.14.13_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-virtual/dist/esm/index.js
1162
+ var W = typeof document < "u" ? e.useLayoutEffect : e.useEffect;
1163
+ function be({ useFlushSync: t = !0, directDomUpdates: n = !1, directDomUpdatesMode: r = "transform", ...i }) {
1164
+ let a = e.useReducer((e) => e + 1, 0)[1], o = e.useRef({
1165
+ enabled: n,
1166
+ mode: r,
1167
+ container: null,
1168
+ lastSize: null,
1169
+ lastPositions: /* @__PURE__ */ new WeakMap(),
1170
+ prevRange: null
1171
+ });
1172
+ o.current.enabled = n, o.current.mode = r;
1173
+ let s = e.useRef(!1), c = (e) => {
1174
+ let t = o.current;
1175
+ if (!t.enabled || !t.container) return;
1176
+ let n = e.getTotalSize();
1177
+ if (n !== t.lastSize) {
1178
+ t.lastSize = n;
1179
+ let r = e.options.horizontal ? "width" : "height";
1180
+ t.container.style[r] = `${n}px`;
685
1181
  }
686
- }, [a] = e.useState(() => new M(i));
687
- return a.setOptions(i), F(() => a._didMount(), []), F(() => a._willUpdate()), a;
688
- }
689
- function L(e) {
690
- return I({
691
- observeElementRect: E,
692
- observeElementOffset: k,
693
- scrollToFn: j,
694
- ...e
1182
+ }, l = (e) => {
1183
+ let t = o.current;
1184
+ if (!t.enabled || !t.container) return;
1185
+ c(e);
1186
+ let n = !!e.options.horizontal, r = t.mode === "transform", i = n ? "left" : "top", a = e.options.scrollMargin, s = e.getVirtualItems();
1187
+ for (let o of s) {
1188
+ let s = o.start - a, c = e.elementsCache.get(o.key);
1189
+ c && t.lastPositions.get(c) !== s && (t.lastPositions.set(c, s), r ? c.style.transform = n ? `translate3d(${s}px, 0, 0)` : `translate3d(0, ${s}px, 0)` : c.style[i] = `${s}px`);
1190
+ }
1191
+ }, u = {
1192
+ ...i,
1193
+ onChange: (e, n) => {
1194
+ var r;
1195
+ let c = o.current, u = !0;
1196
+ if (c.enabled) {
1197
+ l(e);
1198
+ let t = e.range, n = c.prevRange;
1199
+ u = !n || n.isScrolling !== e.isScrolling || n.startIndex !== t?.startIndex || n.endIndex !== t?.endIndex, u && (c.prevRange = t ? {
1200
+ startIndex: t.startIndex,
1201
+ endIndex: t.endIndex,
1202
+ isScrolling: e.isScrolling
1203
+ } : null);
1204
+ }
1205
+ u && (t && n && !s.current ? g(a) : a()), (r = i.onChange) == null || r.call(i, e, n);
1206
+ }
1207
+ }, [d] = e.useState(() => {
1208
+ let e = new _e(u), t = e.measureElement;
1209
+ return e.measureElement = (e) => {
1210
+ s.current = !0;
1211
+ try {
1212
+ t(e);
1213
+ } finally {
1214
+ s.current = !1;
1215
+ }
1216
+ }, Object.assign(e, { containerRef: (t) => {
1217
+ let n = o.current;
1218
+ if (n.container = t, n.lastSize = null, t && n.enabled) {
1219
+ let r = e.getTotalSize();
1220
+ n.lastSize = r;
1221
+ let i = e.options.horizontal ? "width" : "height";
1222
+ t.style[i] = `${r}px`;
1223
+ }
1224
+ } });
695
1225
  });
1226
+ return d.setOptions(u), W(() => d._didMount(), []), W(() => (c(d), d._willUpdate())), W(() => {
1227
+ l(d);
1228
+ }), d;
696
1229
  }
697
- //#endregion
698
- //#region packages/icons/chevron-up.tsx
699
- function R(e) {
700
- return /* @__PURE__ */ s("svg", {
701
- xmlns: "http://www.w3.org/2000/svg",
702
- fill: "none",
703
- viewBox: "0 0 24 24",
704
- strokeWidth: 1.5,
705
- stroke: "currentColor",
706
- className: "h-6 w-6",
707
- ...e,
708
- children: /* @__PURE__ */ s("path", {
709
- strokeLinecap: "round",
710
- strokeLinejoin: "round",
711
- d: "m19.5 8.25-7.5 7.5-7.5-7.5"
712
- })
1230
+ function xe(e) {
1231
+ return be({
1232
+ observeElementRect: de,
1233
+ observeElementOffset: pe,
1234
+ scrollToFn: he,
1235
+ ...e
713
1236
  });
714
1237
  }
715
1238
  //#endregion
716
1239
  //#region packages/icons/search.tsx
717
- function z(e) {
718
- return /* @__PURE__ */ s("svg", {
1240
+ function G(e) {
1241
+ return /* @__PURE__ */ p("svg", {
719
1242
  xmlns: "http://www.w3.org/2000/svg",
720
1243
  fill: "none",
721
1244
  viewBox: "0 0 24 24",
@@ -723,7 +1246,7 @@ function z(e) {
723
1246
  stroke: "currentColor",
724
1247
  className: "h-6 w-6",
725
1248
  ...e,
726
- children: /* @__PURE__ */ s("path", {
1249
+ children: /* @__PURE__ */ p("path", {
727
1250
  strokeLinecap: "round",
728
1251
  strokeLinejoin: "round",
729
1252
  d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"
@@ -732,8 +1255,8 @@ function z(e) {
732
1255
  }
733
1256
  //#endregion
734
1257
  //#region packages/icons/x-mark.tsx
735
- function B(e) {
736
- return /* @__PURE__ */ s("svg", {
1258
+ function Se(e) {
1259
+ return /* @__PURE__ */ p("svg", {
737
1260
  xmlns: "http://www.w3.org/2000/svg",
738
1261
  fill: "none",
739
1262
  viewBox: "0 0 24 24",
@@ -741,7 +1264,7 @@ function B(e) {
741
1264
  stroke: "currentColor",
742
1265
  className: "h-6 w-6",
743
1266
  ...e,
744
- children: /* @__PURE__ */ s("path", {
1267
+ children: /* @__PURE__ */ p("path", {
745
1268
  strokeLinecap: "round",
746
1269
  strokeLinejoin: "round",
747
1270
  d: "M6 18 18 6M6 6l12 12"
@@ -750,114 +1273,135 @@ function B(e) {
750
1273
  }
751
1274
  //#endregion
752
1275
  //#region packages/dropdown/index.tsx
753
- function V(e) {
754
- let { items: t, selected: n, className: r, onChange: o, disabled: l, placeholder: d = "Select an Item", multiple: f, mutable: m, onAdd: g } = e, y = i(null), [b, x] = a(!1);
755
- return /* @__PURE__ */ s(_, {
756
- content: /* @__PURE__ */ s(H, {
757
- ...m ? {
758
- mutable: m,
759
- onAdd: g
760
- } : { mutable: m },
761
- ...f ? {
762
- multiple: f,
1276
+ function Ce(e) {
1277
+ let { items: t, selected: n, className: r, onChange: i, disabled: a, placeholder: o = "Select an Item", multiple: s, mutable: c, onAdd: l } = e, f = u(null), [h, g] = d(!1), v = !!r && /(^|\s)(w-|min-w-|max-w-)/.test(r), y = !!r && /(^|\s)w-full(\s|$)/.test(r);
1278
+ return /* @__PURE__ */ p(j, {
1279
+ triggerClassName: y ? "w-full max-w-none" : void 0,
1280
+ content: /* @__PURE__ */ p(we, {
1281
+ ...c ? {
1282
+ mutable: c,
1283
+ onAdd: l
1284
+ } : { mutable: c },
1285
+ ...s ? {
1286
+ multiple: s,
763
1287
  items: t,
764
- onChange: o,
1288
+ onChange: i,
765
1289
  selected: n
766
1290
  } : {
767
1291
  items: t,
768
- onChange: o,
1292
+ onChange: i,
769
1293
  selected: n
770
1294
  }
771
1295
  }),
772
- onOpen: () => x(!0),
773
- onClose: () => x(!1),
774
- children: /* @__PURE__ */ c("div", {
1296
+ onOpen: () => g(!0),
1297
+ onClose: () => g(!1),
1298
+ children: /* @__PURE__ */ m("div", {
775
1299
  role: "combobox",
776
- "aria-expanded": b,
1300
+ "aria-expanded": h,
777
1301
  "aria-haspopup": "listbox",
778
- className: u("border-input bg-background inline-flex h-10 w-56 grow items-center justify-between rounded border-2 p-2 transition", l ? "bg-muted text-muted-foreground cursor-not-allowed" : "cursor-pointer", b && "border-primary", r),
779
- children: [/* @__PURE__ */ s("div", {
780
- className: u("flex max-w-[calc(100%-30px)] flex-none grow items-center gap-1 text-sm", l ? "text-muted-foreground" : "text-foreground"),
781
- ref: y,
782
- children: f ? /* @__PURE__ */ s(v, {
1302
+ className: _(re, !v && "w-56", "grow", a ? "cursor-not-allowed opacity-50" : "cursor-pointer", h && "border-glow/60 shadow-[0_0_0_3px_oklch(var(--glow)/0.16),0_0_24px_-6px_oklch(var(--glow)/0.6)]", r),
1303
+ children: [/* @__PURE__ */ p("div", {
1304
+ className: _("flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm", a ? "text-muted-foreground" : "text-foreground"),
1305
+ ref: f,
1306
+ children: s && !n.length ? /* @__PURE__ */ p("span", {
1307
+ className: "text-muted-foreground",
1308
+ children: o
1309
+ }) : s ? /* @__PURE__ */ p(M, {
783
1310
  items: n.map((e) => e.text),
784
1311
  data: n,
785
- parentRef: y,
1312
+ parentRef: f,
786
1313
  estimator: (e, t) => t + 40,
787
1314
  badgeVariant: "secondary",
788
- badgeStyles: "bg-input! h-6 min-w-min gap-2",
789
- children: (e, t, r) => /* @__PURE__ */ c(p, {
790
- className: "bg-input! flex h-6 min-w-min gap-2 pr-1",
1315
+ badgeStyles: "h-6 min-w-min gap-2",
1316
+ children: (e, t, r) => /* @__PURE__ */ m(C, {
1317
+ className: "flex h-6 min-w-min gap-2 pr-1",
791
1318
  variant: "secondary",
792
- children: [e, /* @__PURE__ */ s(h, {
1319
+ children: [e, /* @__PURE__ */ p(E, {
793
1320
  onClick: () => {
794
- o(n.filter((e) => e.key !== r?.key));
1321
+ i(n.filter((e) => e.key !== r?.key));
795
1322
  },
796
1323
  variant: "icon",
797
1324
  size: "icon",
798
- className: "group bg-muted hover:bg-muted-foreground p-0.5",
799
- children: /* @__PURE__ */ s(B, { className: "group-hover:text-muted size-3 transition duration-300 group-hover:rotate-90" })
1325
+ className: "group size-4 rounded-sm p-0.5",
1326
+ children: /* @__PURE__ */ p(Se, { className: "size-3 transition duration-300 group-hover:rotate-90" })
800
1327
  })]
801
1328
  }, `collapsed_item_${r?.key ?? t}`)
802
- }) : n.text ?? d
803
- }), /* @__PURE__ */ s(R, { className: u("bg-input size-4 rounded-full p-0.5 transition duration-300 ease-in-out", b ? "rotate-180" : "rotate-0", l ? "text-muted-foreground" : "text-foreground") })]
1329
+ }) : n.text ?? o
1330
+ }), /* @__PURE__ */ p("svg", {
1331
+ viewBox: "0 0 16 16",
1332
+ fill: "none",
1333
+ stroke: "currentColor",
1334
+ strokeWidth: "1.6",
1335
+ strokeLinecap: "round",
1336
+ strokeLinejoin: "round",
1337
+ "aria-hidden": !0,
1338
+ className: _("text-muted-foreground size-4 shrink-0 transition-transform duration-300", h && "rotate-180"),
1339
+ children: /* @__PURE__ */ p("path", { d: "m4 6 4 4 4-4" })
1340
+ })]
804
1341
  })
805
1342
  });
806
1343
  }
807
- function H(e) {
808
- let { items: t, multiple: n, selected: o, onChange: l, mutable: d, onAdd: f } = e, [p, m] = a(""), h = i(null), g = r(() => t.reduce((e, t) => ((!p.length || t.text.toLowerCase().includes(p.toLowerCase())) && e.push(t), e), []), [t, p]), _ = L({
809
- count: g.length,
810
- getScrollElement: () => h.current,
1344
+ function we(e) {
1345
+ let { items: t, multiple: n, selected: r, onChange: i, mutable: a, onAdd: o } = e, [s, c] = d(""), f = u(null), h = l(() => t.reduce((e, t) => ((!s.length || t.text.toLowerCase().includes(s.toLowerCase())) && e.push(t), e), []), [t, s]), g = xe({
1346
+ count: h.length,
1347
+ getScrollElement: () => f.current,
811
1348
  estimateSize: () => 35
812
- }), v = o instanceof Array ? o.map((e) => e.key) : [o.key];
813
- return /* @__PURE__ */ c("div", {
814
- className: "divide-border border-input bg-background flex w-full flex-col divide-y overflow-hidden rounded border",
815
- children: [/* @__PURE__ */ c("div", {
816
- className: u("flex grow items-center rounded px-3 py-2"),
817
- children: [/* @__PURE__ */ s(z, { className: "text-muted-foreground mr-2 size-4" }), /* @__PURE__ */ s("input", {
1349
+ }), v = r instanceof Array ? r.map((e) => e.key) : [r.key];
1350
+ return /* @__PURE__ */ m("div", {
1351
+ className: "divide-tint/10 flex w-full flex-col divide-y overflow-hidden rounded-xl",
1352
+ children: [/* @__PURE__ */ m("div", {
1353
+ className: _("flex grow items-center rounded px-3 py-2"),
1354
+ children: [/* @__PURE__ */ p(G, { className: "text-muted-foreground mr-2 size-4" }), /* @__PURE__ */ p("input", {
818
1355
  className: "text-foreground inline-flex grow bg-transparent text-sm outline-hidden",
819
1356
  placeholder: "Search",
820
- value: p,
821
- onChange: (e) => m(e.target.value)
1357
+ value: s,
1358
+ onChange: (e) => c(e.target.value)
822
1359
  })]
823
- }), /* @__PURE__ */ c("ul", {
1360
+ }), /* @__PURE__ */ m("ul", {
824
1361
  role: "listbox",
825
- className: u("max-h-60 grow overflow-auto shadow-sm", "focus:ring-0 focus:outline-hidden"),
826
- ref: h,
827
- children: [/* @__PURE__ */ s("div", {
1362
+ className: _("max-h-72 grow overflow-y-auto py-1", "focus:ring-0 focus:outline-hidden"),
1363
+ ref: f,
1364
+ children: [/* @__PURE__ */ p("div", {
828
1365
  style: {
829
- height: `${_.getTotalSize()}px`,
1366
+ height: `${g.getTotalSize()}px`,
830
1367
  width: "100%",
831
1368
  position: "relative"
832
1369
  },
833
- children: _.getVirtualItems().map((e) => /* @__PURE__ */ s("li", {
1370
+ children: g.getVirtualItems().map((e) => /* @__PURE__ */ m("li", {
834
1371
  role: "option",
835
- "aria-selected": v.includes(g[e.index].key),
1372
+ "aria-selected": v.includes(h[e.index].key),
836
1373
  style: {
837
1374
  height: `${e.size}px`,
838
1375
  transform: `translateY(${e.start}px)`
839
1376
  },
840
- className: u("text-foreground absolute top-0 left-0 w-full cursor-pointer px-3 py-2 text-sm transition", v.includes(g[e.index].key) ? "bg-primary/90 text-primary-foreground dark:text-foreground" : "hover:bg-primary/60 hover:text-primary-foreground dark:hover:text-foreground"),
1377
+ className: _("hover:bg-muted absolute top-0 left-0 grid w-full cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 px-3 py-2 text-sm outline-hidden select-none"),
841
1378
  onClick: () => {
842
- n ? v.includes(g[e.index].key) ? l(structuredClone(o.filter((t) => t.key !== g[e.index].key))) : l(structuredClone([...o, g[e.index]])) : l(g[e.index]);
1379
+ n ? v.includes(h[e.index].key) ? i(structuredClone(r.filter((t) => t.key !== h[e.index].key))) : i(structuredClone([...r, h[e.index]])) : i(h[e.index]);
843
1380
  },
844
- children: g[e.index].text
1381
+ children: [/* @__PURE__ */ p("span", {
1382
+ className: "text-primary col-start-1",
1383
+ "aria-hidden": !0,
1384
+ children: v.includes(h[e.index].key) && "✓"
1385
+ }), /* @__PURE__ */ p("span", {
1386
+ className: "col-start-2 truncate",
1387
+ children: h[e.index].text
1388
+ })]
845
1389
  }, e.key))
846
- }), p.length > 0 && g.length === 0 && (d ? /* @__PURE__ */ c("li", {
1390
+ }), s.length > 0 && h.length === 0 && (a ? /* @__PURE__ */ m("li", {
847
1391
  role: "option",
848
1392
  "aria-selected": !1,
849
- className: u("text-foreground cursor-pointer px-3 py-2 text-sm"),
1393
+ className: _("hover:bg-muted cursor-pointer px-3 py-2 text-sm select-none"),
850
1394
  onClick: () => {
851
- f({
852
- text: p,
853
- key: p
854
- }), m("");
1395
+ o({
1396
+ text: s,
1397
+ key: s
1398
+ }), c("");
855
1399
  },
856
- children: ["Add ", p]
857
- }) : /* @__PURE__ */ s("li", {
1400
+ children: ["Add ", s]
1401
+ }) : /* @__PURE__ */ p("li", {
858
1402
  role: "option",
859
1403
  "aria-selected": !1,
860
- className: u("text-foreground cursor-not-allowed px-3 py-2 text-sm"),
1404
+ className: _("text-muted-foreground cursor-not-allowed px-3 py-2 text-sm"),
861
1405
  children: "No results found"
862
1406
  }))]
863
1407
  })]
@@ -865,8 +1409,26 @@ function H(e) {
865
1409
  }
866
1410
  //#endregion
867
1411
  //#region packages/icons/chevron-down.tsx
868
- function U(e) {
869
- return /* @__PURE__ */ s("svg", {
1412
+ function Te(e) {
1413
+ return /* @__PURE__ */ p("svg", {
1414
+ xmlns: "http://www.w3.org/2000/svg",
1415
+ fill: "none",
1416
+ viewBox: "0 0 24 24",
1417
+ strokeWidth: 1.5,
1418
+ stroke: "currentColor",
1419
+ className: "h-6 w-6",
1420
+ ...e,
1421
+ children: /* @__PURE__ */ p("path", {
1422
+ strokeLinecap: "round",
1423
+ strokeLinejoin: "round",
1424
+ d: "m19.5 8.25-7.5 7.5-7.5-7.5"
1425
+ })
1426
+ });
1427
+ }
1428
+ //#endregion
1429
+ //#region packages/icons/chevron-up.tsx
1430
+ function Ee(e) {
1431
+ return /* @__PURE__ */ p("svg", {
870
1432
  xmlns: "http://www.w3.org/2000/svg",
871
1433
  fill: "none",
872
1434
  viewBox: "0 0 24 24",
@@ -874,7 +1436,7 @@ function U(e) {
874
1436
  stroke: "currentColor",
875
1437
  className: "h-6 w-6",
876
1438
  ...e,
877
- children: /* @__PURE__ */ s("path", {
1439
+ children: /* @__PURE__ */ p("path", {
878
1440
  strokeLinecap: "round",
879
1441
  strokeLinejoin: "round",
880
1442
  d: "m4.5 15.75 7.5-7.5 7.5 7.5"
@@ -883,46 +1445,477 @@ function U(e) {
883
1445
  }
884
1446
  //#endregion
885
1447
  //#region packages/input/index.tsx
886
- function W(e) {
1448
+ function De(e) {
887
1449
  let { className: t, ...n } = e;
888
- return /* @__PURE__ */ s("input", {
889
- className: u("border-input bg-background text-foreground h-10 w-full rounded border-2 px-3 py-2 text-sm transition", "placeholder:text-muted-foreground", "focus-visible:border-primary focus-visible:ring-ring/30 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-hidden", "read-only:text-foreground read-only:cursor-default read-only:border-none! read-only:bg-transparent read-only:shadow-none! read-only:outline-hidden!", "disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed", "file:border-0 file:bg-transparent file:text-sm file:font-medium", "[[type=\"checkbox\"]]:accent-primary [[type=\"checkbox\"]]:h-4 [[type=\"checkbox\"]]:w-4 [[type=\"checkbox\"]]:rounded-sm", "[[type=\"radio\"]]:accent-primary [[type=\"radio\"]]:h-4 [[type=\"radio\"]]:w-4", t),
1450
+ return /* @__PURE__ */ p("input", {
1451
+ className: _(O, "w-full", "read-only:text-foreground read-only:cursor-default read-only:border-none! read-only:bg-transparent read-only:shadow-none! read-only:outline-hidden!", "file:text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium", "[[type=\"checkbox\"]]:accent-primary [[type=\"checkbox\"]]:h-4 [[type=\"checkbox\"]]:w-4 [[type=\"checkbox\"]]:rounded-sm", "[[type=\"radio\"]]:accent-primary [[type=\"radio\"]]:h-4 [[type=\"radio\"]]:w-4", t),
890
1452
  ...n
891
1453
  });
892
1454
  }
893
1455
  //#endregion
1456
+ //#region packages/nav-pills/index.tsx
1457
+ var K = n(null);
1458
+ function Oe({ className: e, children: t, ...n }) {
1459
+ let r = u(null), [i, a] = d(null);
1460
+ return c(() => {
1461
+ let e = r.current;
1462
+ if (!e) return;
1463
+ let t = () => {
1464
+ let t = e.querySelector("[aria-current=\"page\"]");
1465
+ a(t ? {
1466
+ x: t.offsetLeft,
1467
+ w: t.offsetWidth
1468
+ } : null);
1469
+ };
1470
+ t();
1471
+ let n = new MutationObserver(t);
1472
+ n.observe(e, {
1473
+ subtree: !0,
1474
+ childList: !0,
1475
+ attributes: !0,
1476
+ attributeFilter: ["aria-current"]
1477
+ });
1478
+ let i = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
1479
+ return i?.observe(e), () => {
1480
+ n.disconnect(), i?.disconnect();
1481
+ };
1482
+ }, []), /* @__PURE__ */ p("nav", {
1483
+ className: _("zen__nav-pills", e),
1484
+ ...n,
1485
+ children: /* @__PURE__ */ p("div", {
1486
+ ref: r,
1487
+ className: k,
1488
+ children: /* @__PURE__ */ p(K.Provider, {
1489
+ value: i,
1490
+ children: t
1491
+ })
1492
+ })
1493
+ });
1494
+ }
1495
+ function ke({ className: e }) {
1496
+ let t = a(K);
1497
+ return t ? /* @__PURE__ */ p("span", {
1498
+ "aria-hidden": !0,
1499
+ className: _(ae, e),
1500
+ style: {
1501
+ translate: `${t.x}px 0`,
1502
+ width: t.w
1503
+ }
1504
+ }) : null;
1505
+ }
1506
+ var q = _(A, "text-muted-foreground hover:text-foreground aria-[current=page]:text-foreground aria-[current=page]:hover:text-foreground");
1507
+ function Ae({ active: e, asChild: n, className: i, children: a, ...o }) {
1508
+ let s = e ? "page" : void 0;
1509
+ if (n && r(a)) {
1510
+ let e = a;
1511
+ return t(e, {
1512
+ ...o,
1513
+ ...s && { "aria-current": s },
1514
+ className: _(q, e.props.className, i)
1515
+ });
1516
+ }
1517
+ return /* @__PURE__ */ p("a", {
1518
+ "aria-current": s,
1519
+ className: _(q, i),
1520
+ ...o,
1521
+ children: a
1522
+ });
1523
+ }
1524
+ //#endregion
1525
+ //#region packages/progress-ring/index.tsx
1526
+ function je({ value: e, size: t = 84, stroke: n = 7, label: r, children: i, className: a }) {
1527
+ let o = (t - n) / 2, s = 2 * Math.PI * o, c = Math.min(Math.max(e, 0), 1);
1528
+ return /* @__PURE__ */ m("div", {
1529
+ role: "progressbar",
1530
+ "aria-label": r,
1531
+ "aria-valuemin": 0,
1532
+ "aria-valuemax": 100,
1533
+ "aria-valuenow": Math.round(c * 100),
1534
+ className: _("zen__progress-ring relative grid shrink-0 place-items-center", a),
1535
+ style: {
1536
+ width: t,
1537
+ height: t
1538
+ },
1539
+ children: [/* @__PURE__ */ m("svg", {
1540
+ width: t,
1541
+ height: t,
1542
+ viewBox: `0 0 ${t} ${t}`,
1543
+ className: "-rotate-90",
1544
+ "aria-hidden": !0,
1545
+ children: [/* @__PURE__ */ p("circle", {
1546
+ cx: t / 2,
1547
+ cy: t / 2,
1548
+ r: o,
1549
+ fill: "none",
1550
+ strokeWidth: n,
1551
+ className: "stroke-tint/[0.07]"
1552
+ }), /* @__PURE__ */ p("circle", {
1553
+ cx: t / 2,
1554
+ cy: t / 2,
1555
+ r: o,
1556
+ fill: "none",
1557
+ strokeWidth: n,
1558
+ strokeLinecap: "round",
1559
+ strokeDasharray: s,
1560
+ strokeDashoffset: s * (1 - c),
1561
+ className: "stroke-primary [filter:drop-shadow(0_0_6px_oklch(var(--glow)/0.45))] transition-[stroke-dashoffset] duration-700 ease-out"
1562
+ })]
1563
+ }), /* @__PURE__ */ p("div", {
1564
+ className: "absolute inset-0 grid place-items-center text-center",
1565
+ children: i
1566
+ })]
1567
+ });
1568
+ }
1569
+ //#endregion
1570
+ //#region packages/segmented/index.tsx
1571
+ function Me({ label: e, value: t, options: n, onChange: r, name: i, className: a }) {
1572
+ let o = s();
1573
+ return /* @__PURE__ */ m("div", {
1574
+ className: _("zen__segmented flex flex-col gap-2", a),
1575
+ children: [/* @__PURE__ */ p("span", {
1576
+ id: o,
1577
+ className: "text-sm font-medium",
1578
+ children: e
1579
+ }), /* @__PURE__ */ p("div", {
1580
+ role: "radiogroup",
1581
+ "aria-labelledby": o,
1582
+ className: "border-tint/10 bg-tint/[0.03] inline-flex w-fit flex-wrap gap-1 rounded-xl border p-1",
1583
+ children: n.map((e) => /* @__PURE__ */ m("label", {
1584
+ className: _("text-muted-foreground cursor-pointer rounded-lg px-3 py-1.5 text-sm transition-[background-color,color,box-shadow] duration-200", "hover:text-foreground has-focus-visible:ring-ring/50 has-focus-visible:ring-2", "has-checked:bg-primary/15 has-checked:text-foreground has-checked:shadow-[inset_0_0_0_1px_oklch(var(--primary)/0.4)]"),
1585
+ children: [/* @__PURE__ */ p("input", {
1586
+ type: "radio",
1587
+ className: "sr-only",
1588
+ name: i ?? o,
1589
+ value: e.value,
1590
+ checked: t === e.value,
1591
+ onChange: () => r(e.value)
1592
+ }), e.label]
1593
+ }, e.value))
1594
+ })]
1595
+ });
1596
+ }
1597
+ //#endregion
1598
+ //#region packages/skeleton/index.tsx
1599
+ function Ne({ className: e }) {
1600
+ return /* @__PURE__ */ p("span", {
1601
+ "aria-hidden": !0,
1602
+ className: _("zen__skeleton block rounded-md", e)
1603
+ });
1604
+ }
1605
+ //#endregion
1606
+ //#region packages/tabs/index.tsx
1607
+ var J = n(null);
1608
+ function Y(e) {
1609
+ let t = a(J);
1610
+ if (!t) throw Error(`<${e}> must be inside <Tabs>`);
1611
+ return t;
1612
+ }
1613
+ function Pe({ value: e, defaultValue: t = "", onValueChange: n, className: r, ...i }) {
1614
+ let [a, o] = d(t), c = e ?? a, l = s();
1615
+ return /* @__PURE__ */ p(J.Provider, {
1616
+ value: {
1617
+ value: c,
1618
+ select: (t) => {
1619
+ e === void 0 && o(t), n?.(t);
1620
+ },
1621
+ idFor: (e, t) => `${l}-${e}-${t.replace(/\s+/g, "-")}`
1622
+ },
1623
+ children: /* @__PURE__ */ p("div", {
1624
+ className: _("zen__tabs flex flex-col gap-4", r),
1625
+ ...i
1626
+ })
1627
+ });
1628
+ }
1629
+ var X = n("underline");
1630
+ function Fe({ variant: e = "underline", className: t, children: n, ...r }) {
1631
+ let { value: i } = Y("TabList"), a = e === "pills", o = u(null), [s, l] = d({
1632
+ left: 0,
1633
+ width: 0
1634
+ });
1635
+ return c(() => {
1636
+ let e = o.current;
1637
+ if (!e) return;
1638
+ let t = () => {
1639
+ let t = e.querySelector("[role=\"tab\"][aria-selected=\"true\"]");
1640
+ l(t ? {
1641
+ left: t.offsetLeft,
1642
+ width: t.offsetWidth
1643
+ } : {
1644
+ left: 0,
1645
+ width: 0
1646
+ });
1647
+ };
1648
+ if (t(), typeof ResizeObserver > "u") return;
1649
+ let n = new ResizeObserver(t);
1650
+ return n.observe(e), () => n.disconnect();
1651
+ }, [i]), /* @__PURE__ */ m("div", {
1652
+ ref: o,
1653
+ role: "tablist",
1654
+ onKeyDown: (e) => {
1655
+ let t = Array.from(o.current?.querySelectorAll("[role=\"tab\"]:not(:disabled)") ?? []), n = t.indexOf(document.activeElement);
1656
+ if (n === -1) return;
1657
+ let r = {
1658
+ ArrowRight: n + 1,
1659
+ ArrowLeft: n - 1,
1660
+ Home: 0,
1661
+ End: t.length - 1
1662
+ }[e.key];
1663
+ if (r === void 0) return;
1664
+ e.preventDefault();
1665
+ let i = t[(r + t.length) % t.length];
1666
+ i.focus(), i.click();
1667
+ },
1668
+ className: _(a ? k : "border-border relative flex gap-1 border-b", t),
1669
+ ...r,
1670
+ children: [/* @__PURE__ */ p(X.Provider, {
1671
+ value: e,
1672
+ children: n
1673
+ }), a ? s.width > 0 && /* @__PURE__ */ p("span", {
1674
+ "aria-hidden": !0,
1675
+ className: "absolute top-1 bottom-1 left-0 rounded-full bg-primary/15 shadow-[inset_0_0_0_1px_oklch(var(--glow)/0.35),0_0_24px_-4px_oklch(var(--glow)/0.6)] transition-[translate,width] duration-500 ease-[cubic-bezier(0.2,0.8,0.2,1)]",
1676
+ style: {
1677
+ width: s.width,
1678
+ translate: `${s.left}px 0`
1679
+ }
1680
+ }) : /* @__PURE__ */ p("span", {
1681
+ "aria-hidden": !0,
1682
+ className: "bg-primary absolute bottom-[-1px] left-0 h-0.5 transition-[translate,width] duration-150 ease-in-out",
1683
+ style: {
1684
+ width: s.width,
1685
+ translate: `${s.left}px 0`
1686
+ }
1687
+ })]
1688
+ });
1689
+ }
1690
+ function Ie({ value: e, className: t, onClick: n, ...r }) {
1691
+ let { value: i, select: o, idFor: s } = Y("Tab"), c = a(X), l = i === e;
1692
+ return /* @__PURE__ */ p("button", {
1693
+ type: "button",
1694
+ role: "tab",
1695
+ id: s("tab", e),
1696
+ "aria-selected": l,
1697
+ "aria-controls": s("panel", e),
1698
+ tabIndex: l ? 0 : -1,
1699
+ "data-active": l || void 0,
1700
+ onClick: (t) => {
1701
+ o(e), n?.(t);
1702
+ },
1703
+ className: _(c === "pills" ? A : "focus-visible:ring-ring px-3 py-2 text-sm whitespace-nowrap outline-hidden select-none focus-visible:ring-1", "text-muted-foreground hover:text-foreground data-active:text-foreground", t),
1704
+ ...r
1705
+ });
1706
+ }
1707
+ function Z({ value: e, className: t, ...n }) {
1708
+ let { value: r, idFor: i } = Y("TabPanel");
1709
+ return r === e ? /* @__PURE__ */ p("div", {
1710
+ role: "tabpanel",
1711
+ id: i("panel", e),
1712
+ "aria-labelledby": i("tab", e),
1713
+ tabIndex: 0,
1714
+ className: _("outline-hidden", t),
1715
+ ...n
1716
+ }) : null;
1717
+ }
1718
+ //#endregion
894
1719
  //#region packages/textarea/index.tsx
895
- function G(e) {
1720
+ function Le(e) {
896
1721
  let { className: t, ...n } = e;
897
- return /* @__PURE__ */ s("textarea", {
898
- className: u("border-input bg-background text-foreground h-32 w-full resize-y rounded border-2 px-3 py-2 text-sm transition", "placeholder:text-muted-foreground", "focus-visible:border-primary focus-visible:ring-ring/30 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-hidden", "read-only:text-foreground read-only:cursor-default read-only:border-none! read-only:bg-transparent read-only:shadow-none! read-only:outline-hidden!", "disabled:bg-muted disabled:text-muted-foreground disabled:cursor-not-allowed", t),
1722
+ return /* @__PURE__ */ p("textarea", {
1723
+ className: _(O.replace("h-10", ""), "h-32 w-full resize-y py-2", "read-only:text-foreground read-only:cursor-default read-only:border-none! read-only:bg-transparent read-only:shadow-none! read-only:outline-hidden!", t),
899
1724
  ...n
900
1725
  });
901
1726
  }
902
1727
  //#endregion
1728
+ //#region packages/toast/index.tsx
1729
+ var Re = 5e3, ze = 300, Q = n(null);
1730
+ function Be({ children: e }) {
1731
+ let [t, n] = d([]), [r, a] = d(!1), s = u(0);
1732
+ o(() => a(!0), []);
1733
+ let c = i((e) => {
1734
+ n((t) => t.map((t) => t.id === e ? {
1735
+ ...t,
1736
+ leaving: !0
1737
+ } : t)), setTimeout(() => n((t) => t.filter((t) => t.id !== e)), ze);
1738
+ }, []), l = i((e, { description: t, tone: r = "info", action: i, timeout: a } = {}) => {
1739
+ let o = s.current++, c = {
1740
+ id: o,
1741
+ title: e,
1742
+ description: t,
1743
+ tone: r,
1744
+ action: i,
1745
+ timeout: a ?? (i ? 1e4 : Re)
1746
+ };
1747
+ return n((e) => [...e, c]), o;
1748
+ }, []), f = t.slice(-3);
1749
+ return /* @__PURE__ */ m(Q.Provider, {
1750
+ value: l,
1751
+ children: [e, r && h(/* @__PURE__ */ p("section", {
1752
+ "aria-label": "Notifications",
1753
+ className: "zen__toast-viewport fixed right-4 bottom-[calc(1rem+env(safe-area-inset-bottom))] z-50 flex w-[calc(100vw-2rem)] flex-col-reverse gap-2.5 md:bottom-5 md:w-[24rem]",
1754
+ children: f.map((e) => /* @__PURE__ */ p(He, {
1755
+ toast: e,
1756
+ onDismiss: () => c(e.id)
1757
+ }, e.id))
1758
+ }), document.body)]
1759
+ });
1760
+ }
1761
+ function Ve() {
1762
+ let e = a(Q);
1763
+ if (!e) throw Error("useToast() needs a <ToastProvider> above it");
1764
+ return e;
1765
+ }
1766
+ var $ = {
1767
+ success: {
1768
+ icon: Ue,
1769
+ ring: "border-primary/30",
1770
+ badge: "bg-primary/15 text-primary",
1771
+ bar: "bg-primary",
1772
+ glow: "shadow-[0_18px_50px_-18px_oklch(var(--glow)/0.55)]"
1773
+ },
1774
+ error: {
1775
+ icon: We,
1776
+ ring: "border-destructive/40",
1777
+ badge: "bg-destructive/15 text-destructive",
1778
+ bar: "bg-destructive",
1779
+ glow: "shadow-[0_18px_50px_-18px_oklch(var(--destructive)/0.55)]"
1780
+ },
1781
+ info: {
1782
+ icon: Ge,
1783
+ ring: "border-tint/10",
1784
+ badge: "bg-tint/[0.08] text-foreground",
1785
+ bar: "bg-muted-foreground",
1786
+ glow: "shadow-[var(--toast-shadow)]"
1787
+ }
1788
+ };
1789
+ function He({ toast: e, onDismiss: t }) {
1790
+ let n = $[e.tone] ?? $.info, r = n.icon, [i, a] = d(!1), s = u(e.timeout);
1791
+ return o(() => {
1792
+ if (!e.timeout || i || e.leaving) return;
1793
+ let n = Date.now(), r = setTimeout(t, s.current);
1794
+ return () => {
1795
+ clearTimeout(r), s.current -= Date.now() - n;
1796
+ };
1797
+ }, [
1798
+ i,
1799
+ e.timeout,
1800
+ e.leaving,
1801
+ t
1802
+ ]), /* @__PURE__ */ m("div", {
1803
+ role: e.tone === "error" ? "alert" : "status",
1804
+ "aria-atomic": "true",
1805
+ onMouseEnter: () => a(!0),
1806
+ onMouseLeave: () => a(!1),
1807
+ className: _("zen__toast group glass glass-blur text-card-foreground relative flex items-start gap-3 overflow-hidden rounded-2xl border p-3.5 pr-10 select-none", "transition-[transform,opacity] duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)]", "starting:translate-y-3 starting:scale-[0.97] starting:opacity-0", e.leaving && "translate-x-6 opacity-0", n.ring, n.glow),
1808
+ children: [
1809
+ /* @__PURE__ */ p("span", {
1810
+ className: _("mt-0.5 grid size-8 shrink-0 place-items-center rounded-full", n.badge),
1811
+ "aria-hidden": !0,
1812
+ children: /* @__PURE__ */ p(r, { className: "size-4" })
1813
+ }),
1814
+ /* @__PURE__ */ m("div", {
1815
+ className: "flex min-w-0 flex-1 flex-col gap-0.5 pt-0.5",
1816
+ children: [
1817
+ /* @__PURE__ */ p("div", {
1818
+ className: "text-sm font-semibold",
1819
+ children: e.title
1820
+ }),
1821
+ e.description && /* @__PURE__ */ p("div", {
1822
+ className: "text-muted-foreground text-sm leading-5",
1823
+ children: e.description
1824
+ }),
1825
+ e.action && /* @__PURE__ */ p("button", {
1826
+ type: "button",
1827
+ onClick: () => {
1828
+ e.action?.onClick(), t();
1829
+ },
1830
+ className: "border-tint/10 bg-tint/[0.06] hover:bg-tint/[0.12] focus-visible:ring-ring/50 mt-2 self-start rounded-lg border px-3 py-1 text-xs font-medium outline-hidden transition-colors focus-visible:ring-2",
1831
+ children: e.action.label
1832
+ })
1833
+ ]
1834
+ }),
1835
+ /* @__PURE__ */ p("button", {
1836
+ type: "button",
1837
+ "aria-label": "Dismiss",
1838
+ onClick: t,
1839
+ className: "text-muted-foreground hover:bg-tint/[0.07] hover:text-foreground focus-visible:ring-ring/50 absolute top-2.5 right-2.5 grid size-7 place-items-center rounded-lg outline-hidden transition-colors focus-visible:ring-2",
1840
+ children: /* @__PURE__ */ p("svg", {
1841
+ viewBox: "0 0 16 16",
1842
+ fill: "none",
1843
+ stroke: "currentColor",
1844
+ strokeWidth: "1.8",
1845
+ strokeLinecap: "round",
1846
+ className: "size-3.5",
1847
+ "aria-hidden": !0,
1848
+ children: /* @__PURE__ */ p("path", { d: "m4 4 8 8M12 4l-8 8" })
1849
+ })
1850
+ }),
1851
+ e.timeout > 0 && /* @__PURE__ */ p("span", {
1852
+ "aria-hidden": !0,
1853
+ className: _("zen__toast-timer absolute bottom-0 left-0 h-0.5 w-full origin-left opacity-60 group-hover:[animation-play-state:paused]", n.bar),
1854
+ style: { animationDuration: `${e.timeout}ms` }
1855
+ })
1856
+ ]
1857
+ });
1858
+ }
1859
+ function Ue({ className: e }) {
1860
+ return /* @__PURE__ */ p("svg", {
1861
+ viewBox: "0 0 16 16",
1862
+ fill: "none",
1863
+ stroke: "currentColor",
1864
+ strokeWidth: "2",
1865
+ strokeLinecap: "round",
1866
+ strokeLinejoin: "round",
1867
+ className: _("size-3.5", e),
1868
+ "aria-hidden": !0,
1869
+ children: /* @__PURE__ */ p("path", { d: "m3.5 8.5 3 3 6-7" })
1870
+ });
1871
+ }
1872
+ function We({ className: e }) {
1873
+ return /* @__PURE__ */ m("svg", {
1874
+ viewBox: "0 0 16 16",
1875
+ fill: "none",
1876
+ stroke: "currentColor",
1877
+ strokeWidth: "1.8",
1878
+ strokeLinecap: "round",
1879
+ strokeLinejoin: "round",
1880
+ className: _("size-3.5", e),
1881
+ "aria-hidden": !0,
1882
+ children: [/* @__PURE__ */ p("path", { d: "M8 2.2 1.6 13.3h12.8L8 2.2Z" }), /* @__PURE__ */ p("path", { d: "M8 6.5v3M8 11.6v.1" })]
1883
+ });
1884
+ }
1885
+ function Ge({ className: e }) {
1886
+ return /* @__PURE__ */ m("svg", {
1887
+ viewBox: "0 0 16 16",
1888
+ fill: "none",
1889
+ stroke: "currentColor",
1890
+ strokeWidth: "1.8",
1891
+ strokeLinecap: "round",
1892
+ className: _("size-3.5", e),
1893
+ "aria-hidden": !0,
1894
+ children: [/* @__PURE__ */ p("circle", {
1895
+ cx: "8",
1896
+ cy: "8",
1897
+ r: "6.3"
1898
+ }), /* @__PURE__ */ p("path", { d: "M8 7.3v3.8M8 4.9v.1" })]
1899
+ });
1900
+ }
1901
+ //#endregion
903
1902
  //#region packages/toggle/index.tsx
904
- function K(e) {
905
- let { className: t, checked: r, onChange: i, defaultChecked: a, id: o, ...l } = e, d = n(), f = o ?? d;
906
- return /* @__PURE__ */ c("div", {
907
- role: "switch",
908
- "aria-checked": r ?? a ?? !1,
909
- tabIndex: 0,
910
- className: u("relative inline-flex h-5 w-10 shrink-0 cursor-pointer items-center rounded-full", "border-primary bg-secondary dark:bg-muted border", "focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden", "transition-colors duration-300 ease-in-out", t),
911
- onClick: () => i?.(!r),
912
- onKeyDown: (e) => {
913
- (e.key === " " || e.key === "Enter") && (e.preventDefault(), i?.(!r));
914
- },
915
- children: [/* @__PURE__ */ s("input", {
1903
+ function Ke(e) {
1904
+ let { className: t, onChange: n, disabled: r, ...i } = e;
1905
+ return /* @__PURE__ */ m("label", {
1906
+ className: _("zen__toggle border-tint/10 bg-tint/[0.06] relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border p-0.5", "has-focus-visible:ring-glow/50 transition-[background-color,box-shadow,border-color] duration-300 has-focus-visible:ring-2", "has-checked:border-glow/60 has-checked:bg-glow/40 has-checked:shadow-[0_0_18px_-2px_oklch(var(--glow)/0.8)]", "has-disabled:cursor-not-allowed has-disabled:opacity-50", t),
1907
+ children: [/* @__PURE__ */ p("input", {
916
1908
  type: "checkbox",
917
- id: f,
918
- className: "sr-only",
919
- checked: r,
920
- defaultChecked: a,
921
- onChange: (e) => i?.(e.target.checked),
922
- tabIndex: -1,
923
- ...l
924
- }), /* @__PURE__ */ s("span", { className: u("bg-primary size-4 rounded-full transition-all duration-300 ease-in-out", r ? "translate-x-5" : "translate-x-0.5") })]
1909
+ role: "switch",
1910
+ className: "peer sr-only",
1911
+ disabled: r,
1912
+ onChange: (e) => n?.(e.target.checked),
1913
+ ...i
1914
+ }), /* @__PURE__ */ p("span", {
1915
+ "aria-hidden": !0,
1916
+ className: _("size-[1.125rem] rounded-full bg-white/70 shadow-md", "transition-[translate,background-color] duration-300 ease-[cubic-bezier(0.2,0.8,0.2,1)]", "peer-checked:translate-x-5 peer-checked:bg-white")
1917
+ })]
925
1918
  });
926
1919
  }
927
1920
  //#endregion
928
- export { p as Badge, h as Button, U as ChevronDown, R as ChevronUp, v as Collapse, V as Dropdown, W as Input, _ as Popover, z as Search, G as TextArea, K as Toggle, f as cva, u as cx };
1921
+ export { y as ActionsMenu, b as Backdrop, C as Badge, E as Button, ee as Card, Te as ChevronDown, Ee as ChevronUp, M as Collapse, P as ConfirmDialog, N as Dialog, Ce as Dropdown, De as Input, Ae as NavPill, ke as NavPillIndicator, Oe as NavPills, j as Popover, je as ProgressRing, G as Search, Me as Segmented, Ne as Skeleton, T as Spinner, te as Stat, ne as StatRow, Ie as Tab, Fe as TabList, Z as TabPanel, Pe as Tabs, Le as TextArea, Be as ToastProvider, Ke as Toggle, D as buttonVariants, S as cva, _ as cx, Ve as useToast };