@minimalstuff/ui 2.1.0 → 3.0.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.
@@ -1,30 +1,34 @@
1
1
  import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import r, { createElement as i, useCallback as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u, useSyncExternalStore as d } from "react";
3
- import { createPortal as f } from "react-dom";
2
+ import * as r from "react";
3
+ import i, { Children as a, Fragment as o, cloneElement as s, createContext as c, createElement as l, isValidElement as u, useCallback as d, useContext as f, useEffect as p, useId as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v, useSyncExternalStore as y } from "react";
4
+ import * as b from "react-dom";
5
+ import { createPortal as x } from "react-dom";
4
6
  //#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
5
- function p(e) {
7
+ function S(e) {
6
8
  var t, n, r = "";
7
9
  if (typeof e == "string" || typeof e == "number") r += e;
8
- else if (typeof e == "object") if (Array.isArray(e)) {
9
- var i = e.length;
10
- for (t = 0; t < i; t++) e[t] && (n = p(e[t])) && (r && (r += " "), r += n);
11
- } else for (n in e) e[n] && (r && (r += " "), r += n);
10
+ else if (typeof e == "object") {
11
+ if (Array.isArray(e)) {
12
+ var i = e.length;
13
+ for (t = 0; t < i; t++) e[t] && (n = S(e[t])) && (r && (r += " "), r += n);
14
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
15
+ }
12
16
  return r;
13
17
  }
14
- function m() {
15
- for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = p(e)) && (r && (r += " "), r += t);
18
+ function C() {
19
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = S(e)) && (r && (r += " "), r += t);
16
20
  return r;
17
21
  }
18
22
  //#endregion
19
23
  //#region src/components/shared/radius.ts
20
- var h = {
24
+ var w = {
21
25
  none: "rounded-none",
22
26
  sm: "rounded-sm",
23
27
  md: "rounded-md",
24
28
  lg: "rounded-lg",
25
29
  xl: "rounded-xl",
26
30
  full: "rounded-full"
27
- }, g = {
31
+ }, T = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", E = "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", D = "focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900", O = "focus-within:ring-blue-500", k = "focus-within:ring-red-500", A = {
28
32
  primary: {
29
33
  solid: "border-transparent bg-blue-600 text-white enabled:hover:bg-blue-700 enabled:active:bg-blue-800 dark:bg-blue-500 dark:enabled:hover:bg-blue-600 dark:enabled:active:bg-blue-700",
30
34
  outline: "border-blue-300 bg-transparent text-blue-700 enabled:hover:bg-blue-50 enabled:active:bg-blue-100 dark:border-blue-800 dark:text-blue-400 dark:enabled:hover:bg-blue-950/40 dark:enabled:active:bg-blue-950/60",
@@ -52,110 +56,166 @@ var h = {
52
56
  ghost: "border-transparent bg-transparent text-green-700 enabled:hover:bg-green-50 enabled:active:bg-green-100 dark:text-green-400 dark:enabled:hover:bg-green-950/40 dark:enabled:active:bg-green-950/60",
53
57
  subtle: "border-transparent bg-green-50 text-green-700 enabled:hover:bg-green-100 enabled:active:bg-green-200 dark:bg-green-500/10 dark:text-green-400 dark:enabled:hover:bg-green-500/20 dark:enabled:active:bg-green-500/30",
54
58
  focusOutline: "focus-visible:outline-green-500"
59
+ },
60
+ warning: {
61
+ solid: "border-transparent bg-yellow-600 text-white enabled:hover:bg-yellow-700 enabled:active:bg-yellow-800 dark:bg-yellow-500 dark:enabled:hover:bg-yellow-600 dark:enabled:active:bg-yellow-700",
62
+ outline: "border-yellow-300 bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:border-yellow-800 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
63
+ ghost: "border-transparent bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
64
+ subtle: "border-transparent bg-yellow-50 text-yellow-700 enabled:hover:bg-yellow-100 enabled:active:bg-yellow-200 dark:bg-yellow-500/10 dark:text-yellow-400 dark:enabled:hover:bg-yellow-500/20 dark:enabled:active:bg-yellow-500/30",
65
+ focusOutline: "focus-visible:outline-yellow-500"
55
66
  }
56
- }, _ = "cursor-pointer inline-flex items-center justify-center transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", v = {
67
+ }, j = "inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed", M = `cursor-pointer transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] ${T}`, N = {
68
+ xs: "px-1.5 py-0.5 text-xs",
69
+ sm: "px-2.5 py-1 text-sm",
70
+ md: "px-3 py-1 text-base",
71
+ lg: "px-3.5 py-1.5 text-lg"
72
+ }, P = ({ children: e, color: n = "primary", variant: r = "subtle", size: i = "sm", radius: a = "md", className: o, ...s }) => /* @__PURE__ */ t("span", {
73
+ className: C("inline-flex items-center gap-1 border", w[a], N[i], A[n][r], o),
74
+ ...s,
75
+ children: e
76
+ }), F = {
57
77
  xs: "px-2 py-1 text-xs",
58
78
  sm: "px-3 py-1.5 text-sm",
59
79
  md: "px-4 py-2 text-sm",
60
80
  lg: "px-4 py-3 text-base"
61
- }, y = {
81
+ }, I = {
62
82
  xs: "w-3.5 h-3.5",
63
83
  sm: "w-4 h-4",
64
84
  md: "w-4 h-4",
65
85
  lg: "w-5 h-5"
66
- }, b = ({ variant: e = "solid", color: r = "primary", size: i = "md", radius: a = "md", children: o, className: s, fullWidth: c = !1, loading: l = !1, startIcon: u, endIcon: d, disabled: f, ...p }) => {
67
- let b = g[r], x = y[i];
86
+ };
87
+ function ee(e) {
88
+ let { unstyled: r = !1, variant: i = "solid", color: a = "primary", size: o = "md", radius: s = "md", children: c, className: l, fullWidth: u = !1, loading: d = !1, startIcon: f, endIcon: p, disabled: m, ...h } = e, g = A[a], _ = I[o];
68
89
  return /* @__PURE__ */ n("button", {
69
90
  type: "button",
70
- className: m(_, "gap-2 font-medium", e !== "unstyled" && [
71
- "border",
72
- h[a],
73
- b[e],
74
- b.focusOutline
75
- ], v[i], c && "w-full", s),
76
- disabled: f ?? l,
77
- "aria-busy": l || void 0,
78
- ...p,
91
+ className: C(j, !r && [
92
+ M,
93
+ "gap-2 font-medium border",
94
+ w[s],
95
+ F[o],
96
+ g[i],
97
+ g.focusOutline
98
+ ], u && "w-full", l),
99
+ disabled: m ?? d,
100
+ "aria-busy": d || void 0,
101
+ ...h,
79
102
  children: [
80
- l && /* @__PURE__ */ t("span", {
81
- className: m("i-svg-spinners-3-dots-fade", x),
103
+ d && /* @__PURE__ */ t("span", {
104
+ className: C("i-svg-spinners-3-dots-fade", _),
82
105
  "aria-hidden": "true"
83
106
  }),
84
- !l && u && /* @__PURE__ */ t("span", {
85
- className: m(u, x),
107
+ !d && f && /* @__PURE__ */ t("span", {
108
+ className: C(f, _),
86
109
  "aria-hidden": "true"
87
110
  }),
88
- o,
89
- !l && d && /* @__PURE__ */ t("span", {
90
- className: m(d, x),
111
+ c,
112
+ !d && p && /* @__PURE__ */ t("span", {
113
+ className: C(p, _),
91
114
  "aria-hidden": "true"
92
115
  })
93
116
  ]
94
117
  });
95
- }, x = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
96
- function S(e) {
97
- return e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-600 dark:text-amber-400" : "";
98
118
  }
99
- function C({ current: e, min: r, max: i, showMin: a, showMax: o }) {
100
- let s = a === !0 || o === !0, c = r !== void 0 && e <= r ? "atLimit" : "ok", l = i !== void 0 && e > i ? "overLimit" : i !== void 0 && e >= i ? "atLimit" : "ok", u = s ? `${e}/${r} min` : `${e} (min ${r})`, d = s ? `${e}/${i} max` : `${e}/${i}`;
119
+ //#endregion
120
+ //#region src/components/character_count/character_count.tsx
121
+ var L = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
122
+ function R(e, t) {
123
+ return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-600 dark:text-amber-400" : "";
124
+ }
125
+ function te({ current: e, min: r, max: i, showMin: a, showMax: o, unstyled: s = !1, className: c }) {
126
+ let l = a === !0 || o === !0, u = r !== void 0 && e <= r ? "atLimit" : "ok", d = i !== void 0 && e > i ? "overLimit" : i !== void 0 && e >= i ? "atLimit" : "ok", f = l ? `${e}/${r} min` : `${e} (min ${r})`, p = l ? `${e}/${i} max` : `${e}/${i}`;
101
127
  return /* @__PURE__ */ n("div", {
102
- className: x,
128
+ className: C(!s && L, c),
103
129
  children: [
104
130
  a && r !== void 0 && /* @__PURE__ */ t("span", {
105
- className: S(c),
106
- children: u
131
+ className: R(u, s),
132
+ children: f
107
133
  }),
108
134
  a && o && " · ",
109
135
  o && i !== void 0 && /* @__PURE__ */ t("span", {
110
- className: S(l),
111
- children: d
136
+ className: R(d, s),
137
+ children: p
112
138
  }),
113
139
  !a && !o && i !== void 0 && /* @__PURE__ */ t("span", {
114
- className: S(l),
115
- children: d
140
+ className: R(d, s),
141
+ children: p
116
142
  }),
117
143
  !a && !o && r !== void 0 && i === void 0 && /* @__PURE__ */ t("span", {
118
- className: S(c),
119
- children: u
144
+ className: R(u, s),
145
+ children: f
120
146
  })
121
147
  ]
122
148
  });
123
149
  }
124
150
  //#endregion
125
151
  //#region src/components/shared/surface_tokens.ts
126
- var w = "border-gray-300 dark:border-gray-600", T = "bg-white dark:bg-gray-800", E = "border-gray-200 dark:border-gray-700", D = "bg-white dark:bg-gray-900", O = "bg-blue-600 dark:bg-blue-500", k = "text-sm font-medium text-gray-700 dark:text-gray-300", A = "border-red-500 dark:border-red-400";
152
+ var ne = "border-gray-300 dark:border-gray-600", re = "bg-white dark:bg-gray-800", ie = "border-gray-100 dark:border-gray-800", ae = "bg-white dark:bg-gray-900", z = `w-full border ${ne} ${re} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 ${E} transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`, oe = "text-xs text-gray-500 dark:text-gray-400", se = "text-xs text-red-600 dark:text-red-400", ce = "border-red-500 dark:border-red-400", le = ({ id: e, error: n, className: r }) => n ? /* @__PURE__ */ t("p", {
153
+ id: e,
154
+ className: C(se, r),
155
+ role: "alert",
156
+ children: n
157
+ }) : null;
158
+ //#endregion
159
+ //#region src/components/shared/use_field_ids.ts
160
+ function B(e) {
161
+ let t = m(), n = e ?? t;
162
+ return {
163
+ fieldId: n,
164
+ errorId: `${n}-error`,
165
+ descriptionId: `${n}-description`
166
+ };
167
+ }
168
+ //#endregion
169
+ //#region src/components/shared/field_description.tsx
170
+ var ue = ({ id: e, description: n, className: r }) => n ? typeof n == "string" ? /* @__PURE__ */ t("p", {
171
+ id: e,
172
+ className: C(oe, r),
173
+ children: n
174
+ }) : /* @__PURE__ */ t("span", {
175
+ id: e,
176
+ className: C(oe, "block", r),
177
+ children: n
178
+ }) : null;
179
+ //#endregion
180
+ //#region src/components/shared/use_controlled_state.ts
181
+ function de(e, t) {
182
+ let [n, r] = v(t), i = e !== void 0, a = d((e) => {
183
+ i || r(e);
184
+ }, [i]);
185
+ return [i ? e : n, a];
186
+ }
127
187
  //#endregion
128
188
  //#region src/components/checkbox/checkbox.tsx
129
- function j({ label: e, description: r, error: i, radius: a = "sm", unstyled: o = !1, className: c, wrapperClassName: l, checked: d, defaultChecked: f = !1, onChange: p, id: g = "checkbox", ..._ }) {
130
- let v = `${g}-${s()}`, [y, b] = u(f), x = d !== void 0, S = x ? d : y, C = [r && `${v}-description`, i && `${v}-error`].filter(Boolean).join(" ") || void 0;
189
+ function fe({ label: r, description: i, error: a, radius: o = "sm", unstyled: s = !1, className: c, wrapperClassName: l, checked: u, defaultChecked: d = !1, onChange: f, id: p, ...m }) {
190
+ let { fieldId: h, errorId: g, descriptionId: _ } = B(p), [v, y] = de(u, d), b = [i && _, a && g].filter(Boolean).join(" ") || void 0;
131
191
  return /* @__PURE__ */ n("div", {
132
- className: m("w-full", l),
192
+ className: C("w-full", l),
133
193
  children: [
134
194
  /* @__PURE__ */ n("label", {
135
- htmlFor: v,
136
- className: m("flex items-start gap-3 cursor-pointer", _.disabled && "cursor-not-allowed opacity-50"),
195
+ htmlFor: h,
196
+ className: C("flex items-start gap-3 cursor-pointer", m.disabled && "cursor-not-allowed opacity-50"),
137
197
  children: [/* @__PURE__ */ n("span", {
138
- className: m("relative shrink-0 rounded", "focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900", i ? "focus-within:ring-red-500" : "focus-within:ring-blue-500"),
198
+ className: C("relative shrink-0", w[o], D, a ? k : O),
139
199
  children: [/* @__PURE__ */ t("input", {
140
200
  type: "checkbox",
141
- id: v,
201
+ id: h,
142
202
  className: "sr-only",
143
- checked: S,
203
+ checked: v,
144
204
  onChange: (e) => {
145
- x || b(e.target.checked), p?.(e);
205
+ y(e.target.checked), f?.(e);
146
206
  },
147
- "aria-invalid": !!i,
148
- "aria-describedby": C,
149
- ..._
207
+ "aria-invalid": !!a,
208
+ "aria-describedby": b,
209
+ ...m
150
210
  }), /* @__PURE__ */ t("span", {
151
- className: m("flex h-5 w-5 items-center justify-center transition-all duration-200", !o && [
152
- h[a],
211
+ className: C("flex h-5 w-5 items-center justify-center transition-all duration-200", !s && [
212
+ w[o],
153
213
  "border-2",
154
- S ? m("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : m("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
155
- i && "border-red-500 dark:border-red-400"
214
+ v ? C("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : C("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
215
+ a && "border-red-500 dark:border-red-400"
156
216
  ], c),
157
217
  "aria-hidden": !0,
158
- children: S && /* @__PURE__ */ t("svg", {
218
+ children: v && /* @__PURE__ */ t("svg", {
159
219
  className: "h-3 w-3 text-white",
160
220
  viewBox: "0 0 12 12",
161
221
  fill: "none",
@@ -166,252 +226,1497 @@ function j({ label: e, description: r, error: i, radius: a = "sm", unstyled: o =
166
226
  children: /* @__PURE__ */ t("polyline", { points: "2 6 5 9 10 3" })
167
227
  })
168
228
  })]
169
- }), typeof e == "string" ? /* @__PURE__ */ n("span", {
170
- className: m(k, "select-none"),
171
- children: [e, _.required && /* @__PURE__ */ t("span", {
229
+ }), r !== void 0 && (typeof r == "string" ? /* @__PURE__ */ n("span", {
230
+ className: C("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
231
+ children: [r, m.required && /* @__PURE__ */ t("span", {
172
232
  className: "text-red-500 dark:text-red-400 ml-1",
173
233
  children: "*"
174
234
  })]
175
- }) : e]
235
+ }) : /* @__PURE__ */ n(e, { children: [r, m.required && /* @__PURE__ */ t("span", {
236
+ className: "text-red-500 dark:text-red-400 ml-1",
237
+ children: "*"
238
+ })] }))]
239
+ }),
240
+ /* @__PURE__ */ t(ue, {
241
+ id: _,
242
+ description: i,
243
+ className: "mt-1 ml-8"
176
244
  }),
177
- r && (typeof r == "string" ? /* @__PURE__ */ t("p", {
178
- id: `${v}-description`,
179
- className: m("text-xs text-gray-500 dark:text-gray-400", "mt-1 ml-8"),
180
- children: r
181
- }) : /* @__PURE__ */ t("span", {
182
- id: `${v}-description`,
183
- className: m("text-xs text-gray-500 dark:text-gray-400", "block mt-1 ml-8"),
184
- children: r
185
- })),
186
- i && /* @__PURE__ */ t("p", {
187
- id: `${v}-error`,
188
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1 ml-8"),
189
- role: "alert",
190
- children: i
245
+ /* @__PURE__ */ t(le, {
246
+ id: g,
247
+ error: a,
248
+ className: "mt-1 ml-8"
191
249
  })
192
250
  ]
193
251
  });
194
252
  }
195
253
  //#endregion
196
- //#region src/hooks/use_client_only/use_client_only.tsx
197
- var M = () => {
198
- let [e, t] = u(!1);
199
- return o(() => {
254
+ //#region src/hooks/use_is_client/use_is_client.tsx
255
+ var pe = () => {
256
+ let [e, t] = v(!1);
257
+ return p(() => {
200
258
  requestAnimationFrame(() => {
201
259
  t(!0);
202
260
  });
203
261
  }, []), e;
204
- }, N = (e) => (n) => M() ? /* @__PURE__ */ t(e, { ...n }) : null;
262
+ };
205
263
  //#endregion
206
264
  //#region src/components/client_only/client_only.tsx
207
- function P({ children: n, fallback: r }) {
208
- return M() ? /* @__PURE__ */ t(e, { children: n }) : r ?? null;
265
+ function me({ children: n, fallback: r }) {
266
+ return pe() ? /* @__PURE__ */ t(e, { children: n }) : r ?? null;
209
267
  }
210
268
  //#endregion
211
- //#region src/components/input/input.tsx
212
- var F = `w-full border ${w} ${T} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`;
213
- function I({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: c = "md", unstyled: l = !1, className: d, wrapperClassName: f, value: p, defaultValue: g, onChange: _, id: v = "input", ...y }) {
214
- let b = `${v}-${s()}`, [x, S] = u(typeof g == "string" ? g.length : 0), w = typeof p == "string" ? p.length : p === void 0 ? x : 0, T = i && (a !== void 0 || o !== void 0), E = (e) => {
215
- p === void 0 && S(e.target.value.length), _?.(e);
216
- };
217
- return /* @__PURE__ */ n("div", {
218
- className: m("w-full", f),
219
- children: [
220
- typeof e == "string" ? /* @__PURE__ */ n("label", {
221
- className: m(k, "block mb-1"),
222
- htmlFor: b,
223
- children: [e, y.required && /* @__PURE__ */ t("span", {
224
- className: "text-red-500 dark:text-red-400 ml-1",
225
- children: "*"
226
- })]
227
- }) : e,
228
- /* @__PURE__ */ t("input", {
229
- id: b,
230
- className: m("w-full disabled:opacity-50 disabled:cursor-not-allowed", !l && [
231
- F,
232
- h[c],
233
- "px-3 py-2 text-sm"
234
- ], !l && r && m("border-red-500 dark:border-red-400", "focus:ring-red-500"), d),
235
- ...p === void 0 ? { defaultValue: g } : { value: p },
236
- minLength: a,
237
- maxLength: o,
238
- onChange: E,
239
- "aria-invalid": !!r,
240
- "aria-describedby": r ? `${b}-error` : void 0,
241
- ...y
242
- }),
243
- T && /* @__PURE__ */ t(C, {
244
- current: w,
245
- min: a,
246
- max: o,
247
- showMin: a !== void 0,
248
- showMax: o !== void 0
249
- }),
250
- r && /* @__PURE__ */ t("p", {
251
- id: `${b}-error`,
252
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1"),
253
- role: "alert",
254
- children: r
255
- })
256
- ]
257
- });
258
- }
269
+ //#region src/components/shared/field.tsx
270
+ var he = ({ fieldId: r, errorId: i, label: a, error: o, required: s = !1, wrapperClassName: c, children: l }) => /* @__PURE__ */ n("div", {
271
+ className: C("w-full", c),
272
+ children: [
273
+ a !== void 0 && (typeof a == "string" ? /* @__PURE__ */ n("label", {
274
+ className: C("text-sm font-medium text-gray-700 dark:text-gray-300", "block mb-1"),
275
+ htmlFor: r,
276
+ children: [a, s && /* @__PURE__ */ t("span", {
277
+ className: "text-red-500 dark:text-red-400 ml-1",
278
+ children: "*"
279
+ })]
280
+ }) : /* @__PURE__ */ n(e, { children: [a, s && /* @__PURE__ */ t("span", {
281
+ className: "text-red-500 dark:text-red-400 ml-1",
282
+ children: "*"
283
+ })] })),
284
+ l,
285
+ /* @__PURE__ */ t(le, {
286
+ id: i,
287
+ error: o,
288
+ className: "mt-1"
289
+ })
290
+ ]
291
+ });
259
292
  //#endregion
260
293
  //#region src/components/combobox/combobox.tsx
261
- function L({ options: e, label: r, error: i, placeholder: a, noResultsText: o = "No results found", radius: l = "md", unstyled: d = !1, disabled: f = !1, required: p = !1, className: g, wrapperClassName: _, value: v, defaultValue: y = "", onChange: b, id: x = "combobox" }) {
262
- let S = `${x}-${s()}`, C = `${S}-listbox`, [w, T] = u(y), E = v !== void 0, D = E ? v : w, O = e.find((e) => e.value === D), [A, j] = u(""), [M, N] = u(!1), [P, I] = u(!1), [L, R] = u(-1), z = c(() => M ? e.filter((e) => e.label.toLowerCase().includes(A.toLowerCase())) : e, [
294
+ function ge({ options: e, label: r, error: i, placeholder: a, noResultsText: o = "No results found", clearLabel: s = "Clear selection", radius: c = "md", unstyled: l = !1, disabled: u = !1, required: d = !1, className: f, wrapperClassName: p, value: m, defaultValue: h = "", onChange: _, id: y }) {
295
+ let { fieldId: b, errorId: x } = B(y), S = `${b}-listbox`, [T, E] = de(m, h), D = e.find((e) => e.value === T), [O, k] = v(""), [A, j] = v(!1), [M, N] = v(!1), [P, F] = v(-1), I = g(() => A ? e.filter((e) => e.label.toLowerCase().includes(O.toLowerCase())) : e, [
263
296
  e,
264
- M,
265
- A
266
- ]), B = P ? A : O?.label ?? "", V = () => {
267
- f || (j(O?.label ?? ""), N(!1), I(!0), R(-1));
268
- }, H = () => {
269
- I(!1), N(!1), R(-1);
270
- }, U = (e) => {
271
- E || T(e.value), b?.(e.value), H();
272
- }, W = () => {
273
- E || T(""), b?.(""), j("");
274
- }, ee = (e) => {
275
- j(e.target.value), N(!0), I(!0), R(0);
297
+ A,
298
+ O
299
+ ]), ee = M ? O : D?.label ?? "", L = () => {
300
+ u || (k(D?.label ?? ""), j(!1), N(!0), F(-1));
301
+ }, R = () => {
302
+ N(!1), j(!1), F(-1);
276
303
  }, te = (e) => {
277
- z.length !== 0 && R((t) => {
304
+ E(e.value), _?.(e.value), R();
305
+ }, ne = () => {
306
+ E(""), _?.(""), k("");
307
+ }, re = (e) => {
308
+ k(e.target.value), j(!0), N(!0), F(0);
309
+ }, ie = (e) => {
310
+ I.length !== 0 && F((t) => {
278
311
  let n = t + e;
279
- return n < 0 ? z.length - 1 : n >= z.length ? 0 : n;
312
+ return n < 0 ? I.length - 1 : n >= I.length ? 0 : n;
280
313
  });
281
- }, G = (e) => {
314
+ }, ae = (e) => {
282
315
  if (e.key === "ArrowDown") {
283
- e.preventDefault(), P ? te(1) : V();
316
+ e.preventDefault(), M ? ie(1) : L();
284
317
  return;
285
318
  }
286
319
  if (e.key === "ArrowUp") {
287
- e.preventDefault(), P ? te(-1) : V();
320
+ e.preventDefault(), M ? ie(-1) : L();
288
321
  return;
289
322
  }
290
323
  if (e.key === "Enter") {
291
- if (!P) return;
324
+ if (!M) return;
292
325
  e.preventDefault();
293
- let t = z[L];
294
- t && U(t);
326
+ let t = I[P];
327
+ t && te(t);
295
328
  return;
296
329
  }
297
330
  if (e.key === "Escape") {
298
- if (!P) return;
299
- e.preventDefault(), H();
331
+ if (!M) return;
332
+ e.preventDefault(), R();
300
333
  }
301
- }, K = P && L >= 0 ? `${C}-option-${L}` : void 0;
302
- return /* @__PURE__ */ n("div", {
303
- className: m("w-full", _),
304
- children: [
305
- typeof r == "string" ? /* @__PURE__ */ n("label", {
306
- className: m(k, "block mb-1"),
307
- htmlFor: S,
308
- children: [r, p && /* @__PURE__ */ t("span", {
309
- className: "text-red-500 dark:text-red-400 ml-1",
310
- children: "*"
311
- })]
312
- }) : r,
313
- /* @__PURE__ */ n("div", {
314
- className: "relative",
315
- children: [
316
- !d && /* @__PURE__ */ t("span", {
317
- className: "i-mdi-magnify absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none",
334
+ }, oe = M && P >= 0 ? `${S}-option-${P}` : void 0;
335
+ return /* @__PURE__ */ t(he, {
336
+ fieldId: b,
337
+ errorId: x,
338
+ label: r,
339
+ error: i,
340
+ required: d,
341
+ wrapperClassName: p,
342
+ children: /* @__PURE__ */ n("div", {
343
+ className: "relative",
344
+ children: [
345
+ !l && /* @__PURE__ */ t("span", {
346
+ className: "i-mdi-magnify absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none",
347
+ "aria-hidden": !0
348
+ }),
349
+ /* @__PURE__ */ t("input", {
350
+ id: b,
351
+ role: "combobox",
352
+ type: "text",
353
+ autoComplete: "off",
354
+ disabled: u,
355
+ placeholder: a,
356
+ value: ee,
357
+ onChange: re,
358
+ onFocus: L,
359
+ onBlur: R,
360
+ onKeyDown: ae,
361
+ "aria-expanded": M,
362
+ "aria-controls": S,
363
+ "aria-autocomplete": "list",
364
+ "aria-activedescendant": oe,
365
+ "aria-invalid": !!i,
366
+ "aria-describedby": i ? x : void 0,
367
+ className: C("w-full disabled:opacity-50 disabled:cursor-not-allowed", !l && [
368
+ z,
369
+ w[c],
370
+ "pl-9 pr-8 py-2 text-sm"
371
+ ], !l && i && C("border-red-500 dark:border-red-400", "focus:ring-red-500"), f)
372
+ }),
373
+ !l && D && !u && /* @__PURE__ */ t("button", {
374
+ type: "button",
375
+ "aria-label": s,
376
+ onMouseDown: (e) => e.preventDefault(),
377
+ onClick: ne,
378
+ className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300",
379
+ children: /* @__PURE__ */ t("span", {
380
+ className: "i-mdi-close block w-4 h-4",
318
381
  "aria-hidden": !0
319
- }),
320
- /* @__PURE__ */ t("input", {
321
- id: S,
322
- role: "combobox",
323
- type: "text",
324
- autoComplete: "off",
325
- disabled: f,
326
- placeholder: a,
327
- value: B,
328
- onChange: ee,
329
- onFocus: V,
330
- onBlur: H,
331
- onKeyDown: G,
332
- "aria-expanded": P,
333
- "aria-controls": C,
334
- "aria-autocomplete": "list",
335
- "aria-activedescendant": K,
336
- "aria-invalid": !!i,
337
- "aria-describedby": i ? `${S}-error` : void 0,
338
- className: m("w-full disabled:opacity-50 disabled:cursor-not-allowed", !d && [
339
- F,
340
- h[l],
341
- "pl-9 pr-8 py-2 text-sm"
342
- ], !d && i && m("border-red-500 dark:border-red-400", "focus:ring-red-500"), g)
343
- }),
344
- !d && O && !f && /* @__PURE__ */ t("button", {
345
- type: "button",
346
- "aria-label": "Clear selection",
347
- onMouseDown: (e) => e.preventDefault(),
348
- onClick: W,
349
- className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300",
350
- children: /* @__PURE__ */ t("span", {
351
- className: "i-mdi-close block w-4 h-4",
352
- "aria-hidden": !0
353
- })
354
- }),
355
- P && /* @__PURE__ */ t("ul", {
356
- id: C,
357
- role: "listbox",
358
- className: m("absolute z-10 mt-1 w-full max-h-60 overflow-auto py-1 text-sm shadow-lg", !d && [
359
- "border",
360
- "bg-white dark:bg-gray-900",
361
- "border-gray-100 dark:border-gray-800",
362
- h[l]
363
- ]),
364
- children: z.length === 0 ? /* @__PURE__ */ t("li", {
365
- className: "px-3 py-2 text-gray-500 dark:text-gray-400",
366
- children: o
367
- }) : z.map((e, n) => /* @__PURE__ */ t("li", {
368
- id: `${C}-option-${n}`,
369
- role: "option",
370
- "aria-selected": e.value === D,
371
- onMouseDown: (e) => e.preventDefault(),
372
- onClick: () => U(e),
373
- className: m("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", n === L ? "bg-blue-50 dark:bg-blue-900/40" : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === D && "font-medium"),
374
- children: e.label
375
- }, e.value))
376
382
  })
377
- ]
378
- }),
379
- i && /* @__PURE__ */ t("p", {
380
- id: `${S}-error`,
381
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1"),
382
- role: "alert",
383
- children: i
383
+ }),
384
+ M && /* @__PURE__ */ t("ul", {
385
+ id: S,
386
+ role: "listbox",
387
+ className: C("absolute z-10 mt-1 w-full max-h-60 overflow-auto py-1 text-sm shadow-lg", !l && [
388
+ "border",
389
+ "bg-white dark:bg-gray-900",
390
+ "border-gray-100 dark:border-gray-800",
391
+ w[c]
392
+ ]),
393
+ children: I.length === 0 ? /* @__PURE__ */ t("li", {
394
+ className: "px-3 py-2 text-gray-500 dark:text-gray-400",
395
+ children: o
396
+ }) : I.map((e, n) => /* @__PURE__ */ t("li", {
397
+ id: `${S}-option-${n}`,
398
+ role: "option",
399
+ "aria-selected": e.value === T,
400
+ onMouseDown: (e) => e.preventDefault(),
401
+ onClick: () => te(e),
402
+ className: C("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", n === P ? "bg-blue-50 dark:bg-blue-900/40" : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === T && "font-medium"),
403
+ children: e.label
404
+ }, e.value))
405
+ })
406
+ ]
407
+ })
408
+ });
409
+ }
410
+ //#endregion
411
+ //#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
412
+ var V = Math.min, H = Math.max, _e = Math.round, ve = Math.floor, U = (e) => ({
413
+ x: e,
414
+ y: e
415
+ }), ye = {
416
+ left: "right",
417
+ right: "left",
418
+ bottom: "top",
419
+ top: "bottom"
420
+ };
421
+ function be(e, t, n) {
422
+ return H(e, V(t, n));
423
+ }
424
+ function xe(e, t) {
425
+ return typeof e == "function" ? e(t) : e;
426
+ }
427
+ function Se(e) {
428
+ return e.split("-")[0];
429
+ }
430
+ function Ce(e) {
431
+ return e.split("-")[1];
432
+ }
433
+ function we(e) {
434
+ return e === "x" ? "y" : "x";
435
+ }
436
+ function Te(e) {
437
+ return e === "y" ? "height" : "width";
438
+ }
439
+ function W(e) {
440
+ let t = e[0];
441
+ return t === "t" || t === "b" ? "y" : "x";
442
+ }
443
+ function Ee(e) {
444
+ return we(W(e));
445
+ }
446
+ function De(e, t, n) {
447
+ n === void 0 && (n = !1);
448
+ let r = Ce(e), i = Ee(e), a = Te(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
449
+ return t.reference[a] > t.floating[a] && (o = Ie(o)), [o, Ie(o)];
450
+ }
451
+ function Oe(e) {
452
+ let t = Ie(e);
453
+ return [
454
+ ke(e),
455
+ t,
456
+ ke(t)
457
+ ];
458
+ }
459
+ function ke(e) {
460
+ return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
461
+ }
462
+ var Ae = ["left", "right"], je = ["right", "left"], Me = ["top", "bottom"], Ne = ["bottom", "top"];
463
+ function Pe(e, t, n) {
464
+ switch (e) {
465
+ case "top":
466
+ case "bottom": return n ? t ? je : Ae : t ? Ae : je;
467
+ case "left":
468
+ case "right": return t ? Me : Ne;
469
+ default: return [];
470
+ }
471
+ }
472
+ function Fe(e, t, n, r) {
473
+ let i = Ce(e), a = Pe(Se(e), n === "start", r);
474
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(ke)))), a;
475
+ }
476
+ function Ie(e) {
477
+ let t = Se(e);
478
+ return ye[t] + e.slice(t.length);
479
+ }
480
+ function Le(e) {
481
+ return {
482
+ top: e.top ?? 0,
483
+ right: e.right ?? 0,
484
+ bottom: e.bottom ?? 0,
485
+ left: e.left ?? 0
486
+ };
487
+ }
488
+ function Re(e) {
489
+ return typeof e == "number" ? {
490
+ top: e,
491
+ right: e,
492
+ bottom: e,
493
+ left: e
494
+ } : Le(e);
495
+ }
496
+ function ze(e) {
497
+ let { x: t, y: n, width: r, height: i } = e;
498
+ return {
499
+ width: r,
500
+ height: i,
501
+ top: n,
502
+ left: t,
503
+ right: t + r,
504
+ bottom: n + i,
505
+ x: t,
506
+ y: n
507
+ };
508
+ }
509
+ //#endregion
510
+ //#region node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
511
+ function Be(e, t, n) {
512
+ let { reference: r, floating: i } = e, a = W(t), o = Ee(t), s = Te(o), c = Se(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
513
+ switch (c) {
514
+ case "top":
515
+ p = {
516
+ x: u,
517
+ y: r.y - i.height
518
+ };
519
+ break;
520
+ case "bottom":
521
+ p = {
522
+ x: u,
523
+ y: r.y + r.height
524
+ };
525
+ break;
526
+ case "right":
527
+ p = {
528
+ x: r.x + r.width,
529
+ y: d
530
+ };
531
+ break;
532
+ case "left":
533
+ p = {
534
+ x: r.x - i.width,
535
+ y: d
536
+ };
537
+ break;
538
+ default: p = {
539
+ x: r.x,
540
+ y: r.y
541
+ };
542
+ }
543
+ let m = Ce(t);
544
+ return m && (p[o] += f * (m === "end" ? 1 : -1) * (n && l ? -1 : 1)), p;
545
+ }
546
+ async function Ve(e, t) {
547
+ t === void 0 && (t = {});
548
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = xe(t, e), p = Re(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = ze(await i.getClippingRect({
549
+ element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
550
+ boundary: c,
551
+ rootBoundary: l,
552
+ strategy: s
553
+ })), g = u === "floating" ? {
554
+ x: n,
555
+ y: r,
556
+ width: a.floating.width,
557
+ height: a.floating.height
558
+ } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
559
+ x: 1,
560
+ y: 1
561
+ }, y = ze(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
562
+ elements: o,
563
+ rect: g,
564
+ offsetParent: _,
565
+ strategy: s
566
+ }) : g);
567
+ return {
568
+ top: (h.top - y.top + p.top) / v.y,
569
+ bottom: (y.bottom - h.bottom + p.bottom) / v.y,
570
+ left: (h.left - y.left + p.left) / v.x,
571
+ right: (y.right - h.right + p.right) / v.x
572
+ };
573
+ }
574
+ var He = 50, Ue = async (e, t, n) => {
575
+ let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
576
+ ...o,
577
+ detectOverflow: Ve
578
+ }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
579
+ reference: e,
580
+ floating: t,
581
+ strategy: i
582
+ }), { x: u, y: d } = Be(l, r, c), f = r, p = 0, m = {};
583
+ for (let n = 0; n < a.length; n++) {
584
+ let h = a[n];
585
+ if (!h) continue;
586
+ let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
587
+ x: u,
588
+ y: d,
589
+ initialPlacement: r,
590
+ placement: f,
591
+ strategy: i,
592
+ middlewareData: m,
593
+ rects: l,
594
+ platform: s,
595
+ elements: {
596
+ reference: e,
597
+ floating: t
598
+ }
599
+ });
600
+ u = v ?? u, d = y ?? d, m[g] = {
601
+ ...m[g],
602
+ ...b
603
+ }, x && p < He && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
604
+ reference: e,
605
+ floating: t,
606
+ strategy: i
607
+ }) : x.rects), {x: u, y: d} = Be(l, f, c)), n = -1);
608
+ }
609
+ return {
610
+ x: u,
611
+ y: d,
612
+ placement: f,
613
+ strategy: i,
614
+ middlewareData: m
615
+ };
616
+ }, We = (e) => ({
617
+ name: "arrow",
618
+ options: e,
619
+ async fn(t) {
620
+ let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = xe(e, t) || {};
621
+ if (l == null) return {};
622
+ let d = Re(u), f = {
623
+ x: n,
624
+ y: r
625
+ }, p = Ee(i), m = Te(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
626
+ (!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
627
+ let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = V(d[_], T), D = V(d[v], T), O = C - h[m] - D, k = C / 2 - h[m] / 2 + w, A = be(E, k, O), j = !c.arrow && Ce(i) != null && k !== A && a.reference[m] / 2 - (k < E ? E : D) - h[m] / 2 < 0, M = j ? k < E ? k - E : k - O : 0;
628
+ return {
629
+ [p]: f[p] + M,
630
+ data: {
631
+ [p]: A,
632
+ centerOffset: k - A - M,
633
+ ...j && { alignmentOffset: M }
634
+ },
635
+ reset: j
636
+ };
637
+ }
638
+ }), Ge = function(e) {
639
+ return e === void 0 && (e = {}), {
640
+ name: "flip",
641
+ options: e,
642
+ async fn(t) {
643
+ var n;
644
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = xe(e, t);
645
+ if ((n = i.arrow) != null && n.alignmentOffset) return {};
646
+ let g = Se(r), _ = W(o), v = Se(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Ie(o)] : Oe(o)), x = p !== "none";
647
+ !d && x && b.push(...Fe(o, m, p, y));
648
+ let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
649
+ if (l && w.push(C[g]), u) {
650
+ let e = De(r, a, y);
651
+ w.push(C[e[0]], C[e[1]]);
652
+ }
653
+ if (T = [...T, {
654
+ placement: r,
655
+ overflows: w
656
+ }], !w.every((e) => e <= 0)) {
657
+ let e = (i.flip?.index || 0) + 1, t = S[e];
658
+ if (t && (u !== "alignment" || _ === W(t) || T.every((e) => W(e.placement) !== _ || e.overflows[0] > 0))) return {
659
+ data: {
660
+ index: e,
661
+ overflows: T
662
+ },
663
+ reset: { placement: t }
664
+ };
665
+ let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
666
+ if (!n) switch (f) {
667
+ case "bestFit": {
668
+ let e = T.filter((e) => {
669
+ if (x) {
670
+ let t = W(e.placement);
671
+ return t === _ || t === "y";
672
+ }
673
+ return !0;
674
+ }).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
675
+ e && (n = e);
676
+ break;
677
+ }
678
+ case "initialPlacement": n = o;
679
+ }
680
+ if (r !== n) return { reset: { placement: n } };
681
+ }
682
+ return {};
683
+ }
684
+ };
685
+ }, Ke = /*#__PURE__*/ new Set(["left", "top"]);
686
+ async function qe(e, t) {
687
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = Se(n), s = Ce(n), c = W(n) === "y", l = Ke.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = xe(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
688
+ mainAxis: d,
689
+ crossAxis: 0,
690
+ alignmentAxis: null
691
+ } : {
692
+ mainAxis: d.mainAxis || 0,
693
+ crossAxis: d.crossAxis || 0,
694
+ alignmentAxis: d.alignmentAxis
695
+ };
696
+ return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
697
+ x: p * u,
698
+ y: f * l
699
+ } : {
700
+ x: f * l,
701
+ y: p * u
702
+ };
703
+ }
704
+ var Je = function(e) {
705
+ return e === void 0 && (e = 0), {
706
+ name: "offset",
707
+ options: e,
708
+ async fn(t) {
709
+ var n;
710
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await qe(t, e);
711
+ return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
712
+ x: r + s.x,
713
+ y: i + s.y,
714
+ data: {
715
+ ...s,
716
+ placement: a
717
+ }
718
+ };
719
+ }
720
+ };
721
+ }, Ye = function(e) {
722
+ return e === void 0 && (e = {}), {
723
+ name: "shift",
724
+ options: e,
725
+ async fn(t) {
726
+ let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
727
+ let { x: t, y: n } = e;
728
+ return {
729
+ x: t,
730
+ y: n
731
+ };
732
+ } }, ...l } = xe(e, t), u = {
733
+ x: n,
734
+ y: r
735
+ }, d = await a.detectOverflow(t, l), f = W(i), p = we(f), m = u[p], h = u[f], g = (e, t) => be(t + d[e === "y" ? "top" : "left"], t, t - d[e === "y" ? "bottom" : "right"]);
736
+ o && (m = g(p, m)), s && (h = g(f, h));
737
+ let _ = c.fn({
738
+ ...t,
739
+ [p]: m,
740
+ [f]: h
741
+ });
742
+ return {
743
+ ..._,
744
+ data: {
745
+ x: _.x - n,
746
+ y: _.y - r,
747
+ enabled: {
748
+ [p]: o,
749
+ [f]: s
750
+ }
751
+ }
752
+ };
753
+ }
754
+ };
755
+ };
756
+ //#endregion
757
+ //#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
758
+ function Xe() {
759
+ return typeof window < "u";
760
+ }
761
+ function Ze(e) {
762
+ return Qe(e) ? (e.nodeName || "").toLowerCase() : "#document";
763
+ }
764
+ function G(e) {
765
+ var t;
766
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
767
+ }
768
+ function K(e) {
769
+ return ((Qe(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
770
+ }
771
+ function Qe(e) {
772
+ return Xe() ? e instanceof Node || e instanceof G(e).Node : !1;
773
+ }
774
+ function q(e) {
775
+ return Xe() ? e instanceof Element || e instanceof G(e).Element : !1;
776
+ }
777
+ function J(e) {
778
+ return Xe() ? e instanceof HTMLElement || e instanceof G(e).HTMLElement : !1;
779
+ }
780
+ function $e(e) {
781
+ return !Xe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof G(e).ShadowRoot;
782
+ }
783
+ function et(e) {
784
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = X(e);
785
+ return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
786
+ }
787
+ function tt(e) {
788
+ return /^(table|td|th)$/.test(Ze(e));
789
+ }
790
+ function nt(e) {
791
+ try {
792
+ if (e.matches(":popover-open")) return !0;
793
+ } catch {}
794
+ try {
795
+ return e.matches(":modal");
796
+ } catch {
797
+ return !1;
798
+ }
799
+ }
800
+ var rt = /transform|translate|scale|rotate|perspective|filter/, it = /paint|layout|strict|content/, Y = (e) => !!e && e !== "none", at;
801
+ function ot(e) {
802
+ let t = q(e) ? X(e) : e;
803
+ return Y(t.transform) || Y(t.translate) || Y(t.scale) || Y(t.rotate) || Y(t.perspective) || !ct() && (Y(t.backdropFilter) || Y(t.filter)) || rt.test(t.willChange || "") || it.test(t.contain || "");
804
+ }
805
+ function st(e) {
806
+ let t = Z(e);
807
+ for (; J(t) && !lt(t);) {
808
+ if (ot(t)) return t;
809
+ if (nt(t)) return null;
810
+ t = Z(t);
811
+ }
812
+ return null;
813
+ }
814
+ function ct() {
815
+ return at ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), at;
816
+ }
817
+ function lt(e) {
818
+ return /^(html|body|#document)$/.test(Ze(e));
819
+ }
820
+ function X(e) {
821
+ return G(e).getComputedStyle(e);
822
+ }
823
+ function ut(e) {
824
+ return q(e) ? {
825
+ scrollLeft: e.scrollLeft,
826
+ scrollTop: e.scrollTop
827
+ } : {
828
+ scrollLeft: e.scrollX,
829
+ scrollTop: e.scrollY
830
+ };
831
+ }
832
+ function Z(e) {
833
+ if (Ze(e) === "html") return e;
834
+ let t = e.assignedSlot || e.parentNode || $e(e) && e.host || K(e);
835
+ return $e(t) ? t.host : t;
836
+ }
837
+ function dt(e) {
838
+ let t = Z(e);
839
+ return lt(t) ? (e.ownerDocument || e).body : J(t) && et(t) ? t : dt(t);
840
+ }
841
+ function ft(e, t, n) {
842
+ t === void 0 && (t = []), n === void 0 && (n = !0);
843
+ let r = dt(e), i = r === e.ownerDocument?.body, a = G(r);
844
+ if (i) {
845
+ let e = pt(a);
846
+ return t.concat(a, a.visualViewport || [], et(r) ? r : [], e && n ? ft(e) : []);
847
+ }
848
+ return t.concat(r, ft(r, [], n));
849
+ }
850
+ function pt(e) {
851
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
852
+ }
853
+ //#endregion
854
+ //#region node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
855
+ function mt(e) {
856
+ let t = X(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = J(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = _e(n) !== a || _e(r) !== o;
857
+ return s && (n = a, r = o), {
858
+ width: n,
859
+ height: r,
860
+ $: s
861
+ };
862
+ }
863
+ function ht(e) {
864
+ return q(e) ? e : e.contextElement;
865
+ }
866
+ function Q(e) {
867
+ let t = ht(e);
868
+ if (!J(t)) return U(1);
869
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = mt(t), o = (a ? _e(n.width) : n.width) / r, s = (a ? _e(n.height) : n.height) / i;
870
+ return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
871
+ x: o,
872
+ y: s
873
+ };
874
+ }
875
+ var gt = /*#__PURE__*/ U(0);
876
+ function _t(e) {
877
+ let t = G(e);
878
+ return !ct() || !t.visualViewport ? gt : {
879
+ x: t.visualViewport.offsetLeft,
880
+ y: t.visualViewport.offsetTop
881
+ };
882
+ }
883
+ function vt(e, t, n) {
884
+ return t === void 0 && (t = !1), !!n && t && n === G(e);
885
+ }
886
+ function $(e, t, n, r) {
887
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
888
+ let i = e.getBoundingClientRect(), a = ht(e), o = U(1);
889
+ t && (r ? q(r) && (o = Q(r)) : o = Q(e));
890
+ let s = vt(a, n, r) ? _t(a) : U(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
891
+ if (a && r) {
892
+ let e = G(a), t = q(r) ? G(r) : r, n = e, i = pt(n);
893
+ for (; i && t !== n;) {
894
+ let e = Q(i), t = i.getBoundingClientRect(), r = X(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
895
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = G(i), i = pt(n);
896
+ }
897
+ }
898
+ return ze({
899
+ width: u,
900
+ height: d,
901
+ x: c,
902
+ y: l
903
+ });
904
+ }
905
+ function yt(e, t) {
906
+ let n = ut(e).scrollLeft;
907
+ return t ? t.left + n : $(K(e)).left + n;
908
+ }
909
+ function bt(e, t) {
910
+ let n = e.getBoundingClientRect();
911
+ return {
912
+ x: n.left + t.scrollLeft - yt(e, n),
913
+ y: n.top + t.scrollTop
914
+ };
915
+ }
916
+ function xt(e) {
917
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = K(r), s = t ? nt(t.floating) : !1;
918
+ if (r === o || s && a) return n;
919
+ let c = {
920
+ scrollLeft: 0,
921
+ scrollTop: 0
922
+ }, l = U(1), u = U(0), d = J(r);
923
+ if ((d || !a) && ((Ze(r) !== "body" || et(o)) && (c = ut(r)), d)) {
924
+ let e = $(r);
925
+ l = Q(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
926
+ }
927
+ let f = o && !d && !a ? bt(o, c) : U(0);
928
+ return {
929
+ width: n.width * l.x,
930
+ height: n.height * l.y,
931
+ x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
932
+ y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
933
+ };
934
+ }
935
+ function St(e) {
936
+ return e.getClientRects ? Array.from(e.getClientRects()) : [];
937
+ }
938
+ function Ct(e) {
939
+ let t = ut(e), n = e.ownerDocument.body, r = H(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = H(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight), a = -t.scrollLeft + yt(e), o = -t.scrollTop;
940
+ return X(n).direction === "rtl" && (a += H(e.clientWidth, n.clientWidth) - r), {
941
+ width: r,
942
+ height: i,
943
+ x: a,
944
+ y: o
945
+ };
946
+ }
947
+ var wt = 25;
948
+ function Tt(e, t, n) {
949
+ n === void 0 && (n = "viewport");
950
+ let r = n === "layoutViewport", i = G(e), a = K(e), o = i.visualViewport, s = a.clientWidth, c = a.clientHeight, l = 0, u = 0;
951
+ if (o) {
952
+ let e = !ct() || t === "fixed";
953
+ r ? e || (l = -o.offsetLeft, u = -o.offsetTop) : (s = o.width, c = o.height, e && (l = o.offsetLeft, u = o.offsetTop));
954
+ }
955
+ if (yt(a) <= 0) {
956
+ let e = a.ownerDocument, t = e.body, n = getComputedStyle(t), r = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, i = Math.abs(a.clientWidth - t.clientWidth - r), o = getComputedStyle(a).scrollbarGutter === "stable both-edges" ? i / 2 : i;
957
+ o <= wt && (s -= o);
958
+ }
959
+ return {
960
+ width: s,
961
+ height: c,
962
+ x: l,
963
+ y: u
964
+ };
965
+ }
966
+ function Et(e, t) {
967
+ let n = $(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = Q(e);
968
+ return {
969
+ width: e.clientWidth * a.x,
970
+ height: e.clientHeight * a.y,
971
+ x: i * a.x,
972
+ y: r * a.y
973
+ };
974
+ }
975
+ function Dt(e, t, n) {
976
+ let r;
977
+ if (t === "viewport" || t === "layoutViewport") r = Tt(e, n, t);
978
+ else if (t === "document") r = Ct(K(e));
979
+ else if (q(t)) r = Et(t, n);
980
+ else {
981
+ let n = _t(e);
982
+ r = {
983
+ x: t.x - n.x,
984
+ y: t.y - n.y,
985
+ width: t.width,
986
+ height: t.height
987
+ };
988
+ }
989
+ return ze(r);
990
+ }
991
+ function Ot(e, t) {
992
+ let n = t.get(e);
993
+ if (n) return n;
994
+ let r = ft(e, [], !1).filter((e) => q(e) && Ze(e) !== "body"), i = null, a = X(e).position === "fixed", o = a ? Z(e) : e;
995
+ for (; q(o) && !lt(o);) {
996
+ let e = X(o), t = ot(o), n = i ? i.position : a ? "fixed" : "";
997
+ !t && (n === "fixed" || n === "absolute" && e.position === "static") ? r = r.filter((e) => e !== o) : i = e, o = Z(o);
998
+ }
999
+ return t.set(e, r), r;
1000
+ }
1001
+ function kt(e) {
1002
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? nt(t) ? [] : Ot(t, this._c) : [].concat(n), r], o = Dt(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1003
+ for (let e = 1; e < a.length; e++) {
1004
+ let n = Dt(t, a[e], i);
1005
+ s = H(n.top, s), c = V(n.right, c), l = V(n.bottom, l), u = H(n.left, u);
1006
+ }
1007
+ return {
1008
+ width: c - u,
1009
+ height: l - s,
1010
+ x: u,
1011
+ y: s
1012
+ };
1013
+ }
1014
+ function At(e) {
1015
+ let { width: t, height: n } = mt(e);
1016
+ return {
1017
+ width: t,
1018
+ height: n
1019
+ };
1020
+ }
1021
+ function jt(e, t, n) {
1022
+ let r = J(t), i = K(t), a = n === "fixed", o = $(e, !0, a, t), s = {
1023
+ scrollLeft: 0,
1024
+ scrollTop: 0
1025
+ }, c = U(0);
1026
+ if ((r || !a) && ((Ze(t) !== "body" || et(i)) && (s = ut(t)), r)) {
1027
+ let e = $(t, !0, a, t);
1028
+ c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
1029
+ }
1030
+ !r && i && (c.x = yt(i));
1031
+ let l = i && !r && !a ? bt(i, s) : U(0);
1032
+ return {
1033
+ x: o.left + s.scrollLeft - c.x - l.x,
1034
+ y: o.top + s.scrollTop - c.y - l.y,
1035
+ width: o.width,
1036
+ height: o.height
1037
+ };
1038
+ }
1039
+ function Mt(e) {
1040
+ return X(e).position === "static";
1041
+ }
1042
+ function Nt(e, t) {
1043
+ if (!J(e) || X(e).position === "fixed") return null;
1044
+ if (t) return t(e);
1045
+ let n = e.offsetParent;
1046
+ return K(e) === n && (n = n.ownerDocument.body), n;
1047
+ }
1048
+ function Pt(e, t) {
1049
+ let n = G(e);
1050
+ if (nt(e)) return n;
1051
+ if (!J(e)) {
1052
+ let t = Z(e);
1053
+ for (; t && !lt(t);) {
1054
+ if (q(t) && !Mt(t)) return t;
1055
+ t = Z(t);
1056
+ }
1057
+ return n;
1058
+ }
1059
+ let r = Nt(e, t);
1060
+ for (; r && tt(r) && Mt(r);) r = Nt(r, t);
1061
+ return r && lt(r) && Mt(r) && !ot(r) ? n : r || st(e) || n;
1062
+ }
1063
+ var Ft = async function(e) {
1064
+ let t = this.getOffsetParent || Pt, n = this.getDimensions, r = await n(e.floating);
1065
+ return {
1066
+ reference: jt(e.reference, await t(e.floating), e.strategy),
1067
+ floating: {
1068
+ x: 0,
1069
+ y: 0,
1070
+ width: r.width,
1071
+ height: r.height
1072
+ }
1073
+ };
1074
+ };
1075
+ function It(e) {
1076
+ return X(e).direction === "rtl";
1077
+ }
1078
+ var Lt = {
1079
+ convertOffsetParentRelativeRectToViewportRelativeRect: xt,
1080
+ getDocumentElement: K,
1081
+ getClippingRect: kt,
1082
+ getOffsetParent: Pt,
1083
+ getElementRects: Ft,
1084
+ getClientRects: St,
1085
+ getDimensions: At,
1086
+ getScale: Q,
1087
+ isElement: q,
1088
+ isRTL: It
1089
+ };
1090
+ function Rt(e, t) {
1091
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1092
+ }
1093
+ function zt(e, t, n) {
1094
+ let r = null, i, a = K(e);
1095
+ function o() {
1096
+ var e;
1097
+ clearTimeout(i), (e = r) == null || e.disconnect(), r = null;
1098
+ }
1099
+ function s(n, c) {
1100
+ n === void 0 && (n = !1), c === void 0 && (c = 1), o();
1101
+ let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
1102
+ if (n || t(), !f || !p) return;
1103
+ let m = ve(d), h = ve(a.clientWidth - (u + f)), g = ve(a.clientHeight - (d + p)), _ = ve(u), v = {
1104
+ rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
1105
+ threshold: H(0, V(1, c)) || 1
1106
+ }, y = !0;
1107
+ function b(t) {
1108
+ let n = t[0].intersectionRatio;
1109
+ if (!Rt(l, e.getBoundingClientRect())) return s();
1110
+ if (n !== c) {
1111
+ if (!y) return s();
1112
+ n ? s(!1, n) : i = setTimeout(() => {
1113
+ s(!1, 1e-7);
1114
+ }, 1e3);
1115
+ }
1116
+ y = !1;
1117
+ }
1118
+ try {
1119
+ r = new IntersectionObserver(b, {
1120
+ ...v,
1121
+ root: a.ownerDocument
1122
+ });
1123
+ } catch {
1124
+ r = new IntersectionObserver(b, v);
1125
+ }
1126
+ r.observe(e);
1127
+ }
1128
+ let c = G(e), l = () => s(n);
1129
+ return c.addEventListener("resize", l), s(!0), () => {
1130
+ c.removeEventListener("resize", l), o();
1131
+ };
1132
+ }
1133
+ function Bt(e, t, n, r) {
1134
+ r === void 0 && (r = {});
1135
+ let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = ht(e), u = i || a ? [...l ? ft(l) : [], ...t ? ft(t) : []] : [];
1136
+ u.forEach((e) => {
1137
+ i && e.addEventListener("scroll", n), a && e.addEventListener("resize", n);
1138
+ });
1139
+ let d = l && s ? zt(l, n, a) : null, f = -1, p = null;
1140
+ o && (p = new ResizeObserver((e) => {
1141
+ let [r] = e;
1142
+ r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1143
+ var e;
1144
+ (e = p) == null || e.observe(t);
1145
+ })), n();
1146
+ }), l && !c && p.observe(l), t && p.observe(t));
1147
+ let m, h = c ? $(e) : null;
1148
+ c && g();
1149
+ function g() {
1150
+ let t = $(e);
1151
+ h && !Rt(h, t) && n(), h = t, m = requestAnimationFrame(g);
1152
+ }
1153
+ return n(), () => {
1154
+ var e;
1155
+ u.forEach((e) => {
1156
+ i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
1157
+ }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
1158
+ };
1159
+ }
1160
+ var Vt = Je, Ht = Ye, Ut = Ge, Wt = We, Gt = (e, t, n) => {
1161
+ let r = /* @__PURE__ */ new Map(), i = n ?? {}, a = {
1162
+ ...Lt,
1163
+ ...i.platform,
1164
+ _c: r
1165
+ };
1166
+ return Ue(e, t, {
1167
+ ...i,
1168
+ platform: a
1169
+ });
1170
+ }, Kt = typeof document < "u" ? h : function() {};
1171
+ function qt(e, t) {
1172
+ if (e === t) return !0;
1173
+ if (typeof e != typeof t) return !1;
1174
+ if (typeof e == "function" && e.toString() === t.toString()) return !0;
1175
+ let n, r, i;
1176
+ if (e && t && typeof e == "object") {
1177
+ if (Array.isArray(e)) {
1178
+ if (n = e.length, n !== t.length) return !1;
1179
+ for (r = n; r-- !== 0;) if (!qt(e[r], t[r])) return !1;
1180
+ return !0;
1181
+ }
1182
+ if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
1183
+ for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
1184
+ for (r = n; r-- !== 0;) {
1185
+ let n = i[r];
1186
+ if (!(n === "_owner" && e.$$typeof) && !qt(e[n], t[n])) return !1;
1187
+ }
1188
+ return !0;
1189
+ }
1190
+ return e !== e && t !== t;
1191
+ }
1192
+ function Jt(e) {
1193
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1194
+ }
1195
+ function Yt(e, t) {
1196
+ let n = Jt(e);
1197
+ return Math.round(t * n) / n;
1198
+ }
1199
+ function Xt(e) {
1200
+ let t = r.useRef(e);
1201
+ return Kt(() => {
1202
+ t.current = e;
1203
+ }), t;
1204
+ }
1205
+ function Zt(e) {
1206
+ e === void 0 && (e = {});
1207
+ let { placement: t = "bottom", strategy: n = "absolute", middleware: i = [], platform: a, elements: { reference: o, floating: s } = {}, transform: c = !0, whileElementsMounted: l, open: u } = e, [d, f] = r.useState({
1208
+ x: 0,
1209
+ y: 0,
1210
+ strategy: n,
1211
+ placement: t,
1212
+ middlewareData: {},
1213
+ isPositioned: !1
1214
+ }), [p, m] = r.useState(i);
1215
+ qt(p, i) || m(i);
1216
+ let [h, g] = r.useState(null), [_, v] = r.useState(null), y = r.useCallback((e) => {
1217
+ e !== w.current && (w.current = e, g(e));
1218
+ }, []), x = r.useCallback((e) => {
1219
+ e !== T.current && (T.current = e, v(e));
1220
+ }, []), S = o || h, C = s || _, w = r.useRef(null), T = r.useRef(null), E = r.useRef(d), D = l != null, O = Xt(l), k = Xt(a), A = Xt(u), j = r.useCallback(() => {
1221
+ if (!w.current || !T.current) return;
1222
+ let e = {
1223
+ placement: t,
1224
+ strategy: n,
1225
+ middleware: p
1226
+ };
1227
+ k.current && (e.platform = k.current), Gt(w.current, T.current, e).then((e) => {
1228
+ let t = {
1229
+ ...e,
1230
+ isPositioned: A.current !== !1
1231
+ };
1232
+ M.current && !qt(E.current, t) && (E.current = t, b.flushSync(() => {
1233
+ f(t);
1234
+ }));
1235
+ });
1236
+ }, [
1237
+ p,
1238
+ t,
1239
+ n,
1240
+ k,
1241
+ A
1242
+ ]);
1243
+ Kt(() => {
1244
+ u === !1 && E.current.isPositioned && (E.current.isPositioned = !1, f((e) => ({
1245
+ ...e,
1246
+ isPositioned: !1
1247
+ })));
1248
+ }, [u]);
1249
+ let M = r.useRef(!1);
1250
+ Kt(() => (M.current = !0, () => {
1251
+ M.current = !1;
1252
+ }), []), Kt(() => {
1253
+ if (S && (w.current = S), C && (T.current = C), S && C) {
1254
+ if (O.current) return O.current(S, C, j);
1255
+ j();
1256
+ }
1257
+ }, [
1258
+ S,
1259
+ C,
1260
+ j,
1261
+ O,
1262
+ D
1263
+ ]);
1264
+ let N = r.useMemo(() => ({
1265
+ reference: w,
1266
+ floating: T,
1267
+ setReference: y,
1268
+ setFloating: x
1269
+ }), [y, x]), P = r.useMemo(() => ({
1270
+ reference: S,
1271
+ floating: C
1272
+ }), [S, C]), F = r.useMemo(() => {
1273
+ let e = {
1274
+ position: n,
1275
+ left: 0,
1276
+ top: 0
1277
+ };
1278
+ if (!P.floating) return e;
1279
+ let t = Yt(P.floating, d.x), r = Yt(P.floating, d.y);
1280
+ return c ? {
1281
+ ...e,
1282
+ transform: "translate(" + t + "px, " + r + "px)",
1283
+ ...Jt(P.floating) >= 1.5 && { willChange: "transform" }
1284
+ } : {
1285
+ position: n,
1286
+ left: t,
1287
+ top: r
1288
+ };
1289
+ }, [
1290
+ n,
1291
+ c,
1292
+ P.floating,
1293
+ d.x,
1294
+ d.y
1295
+ ]);
1296
+ return r.useMemo(() => ({
1297
+ ...d,
1298
+ update: j,
1299
+ refs: N,
1300
+ elements: P,
1301
+ floatingStyles: F
1302
+ }), [
1303
+ d,
1304
+ j,
1305
+ N,
1306
+ P,
1307
+ F
1308
+ ]);
1309
+ }
1310
+ var Qt = (e) => {
1311
+ function t(e) {
1312
+ return {}.hasOwnProperty.call(e, "current");
1313
+ }
1314
+ return {
1315
+ name: "arrow",
1316
+ options: e,
1317
+ fn(n) {
1318
+ let { element: r, padding: i } = typeof e == "function" ? e(n) : e;
1319
+ return r && t(r) ? r.current == null ? {} : Wt({
1320
+ element: r.current,
1321
+ padding: i
1322
+ }).fn(n) : r ? Wt({
1323
+ element: r,
1324
+ padding: i
1325
+ }).fn(n) : {};
1326
+ }
1327
+ };
1328
+ }, $t = (e, t) => {
1329
+ let n = Vt(e);
1330
+ return {
1331
+ name: n.name,
1332
+ fn: n.fn,
1333
+ options: [e, t]
1334
+ };
1335
+ }, en = (e, t) => {
1336
+ let n = Ht(e);
1337
+ return {
1338
+ name: n.name,
1339
+ fn: n.fn,
1340
+ options: [e, t]
1341
+ };
1342
+ }, tn = (e, t) => {
1343
+ let n = Ut(e);
1344
+ return {
1345
+ name: n.name,
1346
+ fn: n.fn,
1347
+ options: [e, t]
1348
+ };
1349
+ }, nn = (e, t) => {
1350
+ let n = Qt(e);
1351
+ return {
1352
+ name: n.name,
1353
+ fn: n.fn,
1354
+ options: [e, t]
1355
+ };
1356
+ }, rn = c(null);
1357
+ function an() {
1358
+ return f(rn);
1359
+ }
1360
+ //#endregion
1361
+ //#region src/components/menu/menu_surface.tsx
1362
+ var on = "[role=\"menuitem\"]:not(:disabled)";
1363
+ function sn(e, t) {
1364
+ let n = Array.from(e.querySelectorAll(on));
1365
+ n.length !== 0 && n[(t % n.length + n.length) % n.length]?.focus({ preventScroll: !0 });
1366
+ }
1367
+ function cn({ setFloating: r, floatingStyles: i, isVisible: a, isPositioned: o, radius: s, onClose: c, children: l }) {
1368
+ let u = _(null);
1369
+ return p(() => {
1370
+ if (!o) return;
1371
+ let e = u.current;
1372
+ e && e.querySelector(on)?.focus({ preventScroll: !0 });
1373
+ }, [o]), x(/* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
1374
+ className: "fixed inset-0 z-40",
1375
+ onClick: c,
1376
+ "aria-hidden": "true"
1377
+ }), /* @__PURE__ */ t("div", {
1378
+ ref: r,
1379
+ style: i,
1380
+ className: "z-50",
1381
+ children: /* @__PURE__ */ t("div", {
1382
+ ref: u,
1383
+ role: "menu",
1384
+ tabIndex: -1,
1385
+ "data-state": a ? "open" : "closed",
1386
+ onKeyDown: (e) => {
1387
+ let t = u.current;
1388
+ if (!t) return;
1389
+ let n = Array.from(t.querySelectorAll(on)), r = n.indexOf(document.activeElement);
1390
+ e.key === "ArrowDown" ? (e.preventDefault(), sn(t, r + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), sn(t, r - 1)) : e.key === "Home" ? (e.preventDefault(), sn(t, 0)) : e.key === "End" ? (e.preventDefault(), sn(t, n.length - 1)) : (e.key === "Escape" || e.key === "Tab") && c();
1391
+ },
1392
+ className: C("w-max min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm", "transition-[opacity,transform] duration-150 ease-out", a ? "scale-100 opacity-100" : "scale-95 opacity-0", ae, ie, w[s]),
1393
+ onClick: (e) => e.stopPropagation(),
1394
+ children: /* @__PURE__ */ t(rn.Provider, {
1395
+ value: c,
1396
+ children: l
384
1397
  })
1398
+ })
1399
+ })] }), document.body);
1400
+ }
1401
+ //#endregion
1402
+ //#region src/components/shared/use_overlay_state.ts
1403
+ function ln() {
1404
+ let [e, t] = v(!1), [n, r] = v(!1), i = _(void 0);
1405
+ return p(() => () => clearTimeout(i.current), []), {
1406
+ isMounted: e,
1407
+ isVisible: n,
1408
+ setIsVisible: r,
1409
+ open: d((e) => {
1410
+ clearTimeout(i.current), t(!0), e && r(!0);
1411
+ }, []),
1412
+ close: d(() => {
1413
+ clearTimeout(i.current), r(!1), i.current = setTimeout(() => t(!1), 150);
1414
+ }, [])
1415
+ };
1416
+ }
1417
+ function un(e, t, n) {
1418
+ p(() => {
1419
+ if (!e || !t) return;
1420
+ let r = requestAnimationFrame(() => n(!0));
1421
+ return () => cancelAnimationFrame(r);
1422
+ }, [
1423
+ e,
1424
+ t,
1425
+ n
1426
+ ]);
1427
+ }
1428
+ //#endregion
1429
+ //#region src/components/context_menu/context_menu.tsx
1430
+ var dn = 2;
1431
+ function fn(e, t) {
1432
+ return { getBoundingClientRect: () => ({
1433
+ width: 0,
1434
+ height: 0,
1435
+ x: e,
1436
+ y: t,
1437
+ top: t,
1438
+ left: e,
1439
+ right: e,
1440
+ bottom: t
1441
+ }) };
1442
+ }
1443
+ function pn(e) {
1444
+ if (e.clientX !== 0 || e.clientY !== 0) return {
1445
+ x: e.clientX,
1446
+ y: e.clientY
1447
+ };
1448
+ let t = e.target?.getBoundingClientRect();
1449
+ return t ? {
1450
+ x: t.left,
1451
+ y: t.bottom
1452
+ } : {
1453
+ x: 0,
1454
+ y: 0
1455
+ };
1456
+ }
1457
+ function mn({ children: e, items: r, radius: i = "md", className: a, ref: o }) {
1458
+ let s = _(null), { isMounted: c, isVisible: l, setIsVisible: u, open: f, close: p } = ln(), { refs: m, floatingStyles: h, isPositioned: g } = Zt({
1459
+ placement: "bottom-start",
1460
+ open: c,
1461
+ whileElementsMounted: Bt,
1462
+ middleware: [
1463
+ $t(dn),
1464
+ tn(),
1465
+ en({ padding: 8 })
385
1466
  ]
386
1467
  });
1468
+ un(c, g, u);
1469
+ let v = d(() => {
1470
+ p(), s.current?.focus();
1471
+ }, [p]);
1472
+ return /* @__PURE__ */ n("div", {
1473
+ ref: o,
1474
+ className: a,
1475
+ onContextMenu: (e) => {
1476
+ e.preventDefault(), s.current = document.activeElement;
1477
+ let { x: t, y: n } = pn(e);
1478
+ m.setReference(fn(t, n)), f(!1);
1479
+ },
1480
+ children: [e, c && /* @__PURE__ */ t(cn, {
1481
+ setFloating: m.setFloating,
1482
+ floatingStyles: h,
1483
+ isVisible: l,
1484
+ isPositioned: g,
1485
+ radius: i,
1486
+ onClose: v,
1487
+ children: r
1488
+ })]
1489
+ });
1490
+ }
1491
+ //#endregion
1492
+ //#region src/lib/surface_error.ts
1493
+ function hn(e, t) {
1494
+ if (t) {
1495
+ t(e);
1496
+ return;
1497
+ }
1498
+ queueMicrotask(() => {
1499
+ throw e;
1500
+ });
1501
+ }
1502
+ //#endregion
1503
+ //#region src/components/copy_button/copy_button.tsx
1504
+ var gn = 2e3;
1505
+ function _n({ value: n, children: r, onError: i }) {
1506
+ let [a, o] = v(!1), s = _(void 0);
1507
+ return p(() => () => clearTimeout(s.current), []), /* @__PURE__ */ t(e, { children: r({
1508
+ copied: a,
1509
+ copy: async () => {
1510
+ try {
1511
+ await navigator.clipboard.writeText(n), o(!0), clearTimeout(s.current), s.current = setTimeout(() => o(!1), gn);
1512
+ } catch (e) {
1513
+ hn(e, i);
1514
+ }
1515
+ }
1516
+ }) });
1517
+ }
1518
+ //#endregion
1519
+ //#region src/lib/split_into_highlight_segments.ts
1520
+ function vn(e, t) {
1521
+ if (t.length === 0) return [{
1522
+ text: e,
1523
+ isMatch: !1
1524
+ }];
1525
+ let n = [], r = 0;
1526
+ for (let i = 0; i < t.length; i += 2) {
1527
+ let a = t[i], o = t[i + 1];
1528
+ a !== void 0 && o !== void 0 && (a > r && n.push({
1529
+ text: e.slice(r, a),
1530
+ isMatch: !1
1531
+ }), n.push({
1532
+ text: e.slice(a, o),
1533
+ isMatch: !0
1534
+ }), r = o);
1535
+ }
1536
+ return r < e.length && n.push({
1537
+ text: e.slice(r),
1538
+ isMatch: !1
1539
+ }), n;
1540
+ }
1541
+ //#endregion
1542
+ //#region src/components/highlight/highlight.tsx
1543
+ function yn({ text: n, ranges: r }) {
1544
+ let i = vn(n, r), a = 0;
1545
+ return /* @__PURE__ */ t(e, { children: i.map((e) => {
1546
+ let n = a;
1547
+ return a += e.text.length, e.isMatch ? /* @__PURE__ */ t("mark", {
1548
+ className: "rounded bg-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:text-yellow-100",
1549
+ children: e.text
1550
+ }, n) : /* @__PURE__ */ t("span", { children: e.text }, n);
1551
+ }) });
387
1552
  }
388
1553
  //#endregion
389
1554
  //#region src/components/icon_button/icon_button.tsx
390
- var R = {
391
- sm: "p-1",
1555
+ var bn = {
1556
+ xs: "p-1",
1557
+ sm: "p-2",
392
1558
  md: "p-2",
393
1559
  lg: "p-3"
394
- }, z = {
1560
+ }, xn = {
1561
+ xs: "w-4 h-4",
395
1562
  sm: "w-4 h-4",
396
1563
  md: "w-5 h-5",
397
1564
  lg: "w-6 h-6"
398
- }, B = ({ icon: e, "aria-label": r, variant: i = "outline", color: a = "neutral", size: o = "md", radius: s = "md", className: c, children: l, ref: u, ...d }) => {
399
- let f = g[a];
1565
+ };
1566
+ function Sn(e) {
1567
+ let { icon: r, "aria-label": i, unstyled: a = !1, variant: o = "outline", color: s = "neutral", size: c = "md", radius: l = "md", className: u, children: d, ref: f, ...p } = e, m = A[s];
400
1568
  return /* @__PURE__ */ n("button", {
401
- ref: u,
1569
+ ref: f,
402
1570
  type: "button",
403
- "aria-label": r,
404
- className: m(_, i !== "unstyled" && [
1571
+ "aria-label": i,
1572
+ className: C(j, !a && [
1573
+ M,
405
1574
  "border",
406
- h[s],
407
- f[i],
408
- f.focusOutline
409
- ], R[o], c),
410
- ...d,
411
- children: [/* @__PURE__ */ t("div", { className: m(e, z[o], l && "mr-1") }), l]
1575
+ w[l],
1576
+ bn[c],
1577
+ m[o],
1578
+ m.focusOutline
1579
+ ], u),
1580
+ ...p,
1581
+ children: [/* @__PURE__ */ t("div", { className: C(r, xn[c], d && "mr-1") }), d]
1582
+ });
1583
+ }
1584
+ //#endregion
1585
+ //#region src/components/shared/use_controlled_length.ts
1586
+ function Cn(e) {
1587
+ return typeof e == "string" ? e.length : 0;
1588
+ }
1589
+ function wn(e, t) {
1590
+ let [n, r] = v(Cn(t)), i = e !== void 0;
1591
+ return {
1592
+ length: i ? Cn(e) : n,
1593
+ trackLength: (e) => {
1594
+ i || r(e.length);
1595
+ }
1596
+ };
1597
+ }
1598
+ //#endregion
1599
+ //#region src/components/input/input.tsx
1600
+ function Tn({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: s = "md", unstyled: c = !1, className: l, wrapperClassName: u, value: d, defaultValue: f, onChange: p, id: m, ...h }) {
1601
+ let { fieldId: g, errorId: _ } = B(m), { length: v, trackLength: y } = wn(d, f), b = i && (a !== void 0 || o !== void 0), x = (e) => {
1602
+ y(e.target.value), p?.(e);
1603
+ };
1604
+ return /* @__PURE__ */ n(he, {
1605
+ fieldId: g,
1606
+ errorId: _,
1607
+ label: e,
1608
+ error: r,
1609
+ required: h.required,
1610
+ wrapperClassName: u,
1611
+ children: [/* @__PURE__ */ t("input", {
1612
+ id: g,
1613
+ className: C("w-full disabled:opacity-50 disabled:cursor-not-allowed", !c && [
1614
+ z,
1615
+ w[s],
1616
+ "px-3 py-2 text-sm"
1617
+ ], !c && r && C("border-red-500 dark:border-red-400", "focus:ring-red-500"), l),
1618
+ ...d === void 0 ? { defaultValue: f } : { value: d },
1619
+ minLength: a,
1620
+ maxLength: o,
1621
+ onChange: x,
1622
+ "aria-invalid": !!r,
1623
+ "aria-describedby": r ? _ : void 0,
1624
+ ...h
1625
+ }), b && /* @__PURE__ */ t(te, {
1626
+ current: v,
1627
+ min: a,
1628
+ max: o,
1629
+ showMin: a !== void 0,
1630
+ showMax: o !== void 0
1631
+ })]
1632
+ });
1633
+ }
1634
+ //#endregion
1635
+ //#region src/components/kbd/kbd.tsx
1636
+ var En = {
1637
+ xs: "px-1.5 py-0.5 text-xs",
1638
+ sm: "px-2 py-0.5 text-xs",
1639
+ md: "px-2.5 py-1 text-sm",
1640
+ lg: "px-3 py-1 text-base"
1641
+ }, Dn = ({ children: e, size: n = "sm", radius: r = "sm", unstyled: i = !1, className: a }) => /* @__PURE__ */ t("kbd", {
1642
+ className: C("inline-flex items-center", En[n], !i && [
1643
+ "border font-semibold uppercase",
1644
+ "text-gray-500 dark:text-gray-400",
1645
+ "bg-gray-100 dark:bg-gray-700",
1646
+ "border-gray-200 dark:border-gray-600",
1647
+ w[r]
1648
+ ], a),
1649
+ children: e
1650
+ });
1651
+ //#endregion
1652
+ //#region src/lib/merge_refs.ts
1653
+ function On(...e) {
1654
+ return (t) => {
1655
+ for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
1656
+ };
1657
+ }
1658
+ //#endregion
1659
+ //#region src/components/menu/menu.tsx
1660
+ var kn = 4;
1661
+ function An(e, t) {
1662
+ return t === "center" ? e : `${e}-${t}`;
1663
+ }
1664
+ function jn({ trigger: e, children: r, side: i = "bottom", align: a = "start", radius: o = "md", className: c, ref: l }) {
1665
+ let f = _(null), { isMounted: p, isVisible: m, setIsVisible: h, open: g, close: v } = ln(), { refs: y, floatingStyles: b, isPositioned: x } = Zt({
1666
+ placement: An(i, a),
1667
+ open: p,
1668
+ whileElementsMounted: Bt,
1669
+ middleware: [
1670
+ $t(kn),
1671
+ tn(),
1672
+ en({ padding: 8 })
1673
+ ]
1674
+ });
1675
+ un(p, x, h);
1676
+ let S = d(() => {
1677
+ v(), f.current?.querySelector("button, [href], [tabindex]")?.focus();
1678
+ }, [v]), w = d((e) => On(y.setReference, f, l)(e), [y, l]), T = {
1679
+ onClick: (t) => {
1680
+ t.stopPropagation(), m ? v() : g(x), u(e) && e.props.onClick?.(t);
1681
+ },
1682
+ "aria-haspopup": "menu",
1683
+ "aria-expanded": p
1684
+ }, E = u(e) ? s(e, T) : e;
1685
+ return /* @__PURE__ */ n("span", {
1686
+ ref: w,
1687
+ className: C("inline-block", c),
1688
+ children: [E, p && /* @__PURE__ */ t(cn, {
1689
+ setFloating: y.setFloating,
1690
+ floatingStyles: b,
1691
+ isVisible: m,
1692
+ isPositioned: x,
1693
+ radius: o,
1694
+ onClose: S,
1695
+ children: r
1696
+ })]
1697
+ });
1698
+ }
1699
+ //#endregion
1700
+ //#region src/components/menu_item/menu_item.tsx
1701
+ function Mn({ icon: e, onClick: r, danger: i = !1, disabled: a = !1, children: o, className: s, ref: c }) {
1702
+ let l = an();
1703
+ return /* @__PURE__ */ n("button", {
1704
+ ref: c,
1705
+ type: "button",
1706
+ role: "menuitem",
1707
+ tabIndex: -1,
1708
+ onClick: (e) => {
1709
+ e.stopPropagation(), r(e), l?.();
1710
+ },
1711
+ disabled: a,
1712
+ className: C("flex w-full cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2 text-left text-sm transition-colors", "hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700", "focus-visible:bg-gray-100 focus-visible:outline-none dark:focus-visible:bg-gray-700", "disabled:cursor-not-allowed disabled:opacity-50", i ? "text-red-600 dark:text-red-400" : "text-gray-700 dark:text-gray-300", s),
1713
+ children: [e && /* @__PURE__ */ t("div", { className: C(e, "h-4 w-4 flex-shrink-0") }), o]
412
1714
  });
413
- }, V = [];
414
- function H() {
1715
+ }
1716
+ //#endregion
1717
+ //#region node_modules/.pnpm/react-call@2.0.2_react-dom@19.2.8_react@19.2.8__react@19.2.8_vite@8.2.1_@types+node@26.2.0_es_s57p6lt2ddgt4vomhz3tbzqsbu/node_modules/react-call/dist/main.js
1718
+ var Nn = [];
1719
+ function Pn() {
415
1720
  let e = 0, t = [], n = null, r = /* @__PURE__ */ new Set(), i = () => {
416
1721
  for (let e of r) e(t);
417
1722
  };
@@ -432,7 +1737,7 @@ function H() {
432
1737
  r.delete(i), r.size || (e = 0, t = [], n = null);
433
1738
  }),
434
1739
  getSnapshot: () => t,
435
- getServerSnapshot: () => V,
1740
+ getServerSnapshot: () => Nn,
436
1741
  getListenersSize: () => r.size,
437
1742
  getUpsertPromise: () => n,
438
1743
  setUpsertPromise: (e) => {
@@ -440,39 +1745,39 @@ function H() {
440
1745
  }
441
1746
  };
442
1747
  }
443
- var U = /* @__PURE__ */ new Map();
444
- function W(e, t = 0) {
445
- let n = { current: H() }, r = (e) => (r) => {
1748
+ var Fn = /* @__PURE__ */ new Map();
1749
+ function In(e, t = 0) {
1750
+ let n = { current: Pn() }, r = (e) => (r) => {
446
1751
  let i = /* @__PURE__ */ new Set();
447
1752
  n.current.set(e, (e) => (e.resolve(r), i.add(e.promise), {
448
1753
  ...e,
449
1754
  ended: !0
450
1755
  })), globalThis.setTimeout(() => n.current.remove(i), t);
451
- }, a = () => {
1756
+ }, i = () => {
452
1757
  let e = n.current.getListenersSize();
453
1758
  if (!e) throw Error("No <Root> found!");
454
1759
  if (e > 1) throw Error("Multiple instances of <Root> found!");
455
- }, o = (e) => {
456
- a();
457
- let t, i = new Promise((e) => {
1760
+ }, a = (e) => {
1761
+ i();
1762
+ let t, a = new Promise((e) => {
458
1763
  t = e;
459
1764
  });
460
1765
  return n.current.add({
461
1766
  props: e,
462
- end: r(i),
1767
+ end: r(a),
463
1768
  ended: !1,
464
- promise: i,
1769
+ promise: a,
465
1770
  resolve: t
466
- }), i;
467
- }, s = (e) => {
468
- a();
1771
+ }), a;
1772
+ }, o = (e) => {
1773
+ i();
469
1774
  let t = n.current.getUpsertPromise();
470
1775
  if (t) return n.current.set(t, (t) => ({
471
1776
  ...t,
472
1777
  props: e
473
1778
  })), t;
474
- let i, o = new Promise((e) => {
475
- i = e;
1779
+ let a, o = new Promise((e) => {
1780
+ a = e;
476
1781
  });
477
1782
  return n.current.setUpsertPromise(o), n.current.add({
478
1783
  props: e,
@@ -481,12 +1786,12 @@ function W(e, t = 0) {
481
1786
  },
482
1787
  ended: !1,
483
1788
  promise: o,
484
- resolve: i
1789
+ resolve: a
485
1790
  }), o;
486
- }, c = (...e) => {
1791
+ }, s = (...e) => {
487
1792
  let t = e.length === 2, i = t ? e[0] : null, a = t ? e[1] : e[0];
488
1793
  return (!t || i === n.current.getUpsertPromise()) && n.current.setUpsertPromise(null), r(i)(a);
489
- }, l = (...e) => {
1794
+ }, c = (...e) => {
490
1795
  let t = e.length === 2;
491
1796
  n.current.set(t ? e[0] : null, (n) => ({
492
1797
  ...n,
@@ -496,76 +1801,85 @@ function W(e, t = 0) {
496
1801
  }
497
1802
  }));
498
1803
  }, u = function(t) {
499
- return d(n.current.subscribe, n.current.getSnapshot, n.current.getServerSnapshot).map(({ props: n, key: r, end: a, ended: o }, s, c) => /* @__PURE__ */ i(e, {
1804
+ return y(n.current.subscribe, n.current.getSnapshot, n.current.getServerSnapshot).map(({ props: n, key: r, end: i, ended: a }, o, s) => /* @__PURE__ */ l(e, {
500
1805
  ...n,
501
1806
  key: r,
502
1807
  call: {
503
1808
  key: r,
504
- end: a,
505
- ended: o,
1809
+ end: i,
1810
+ ended: a,
506
1811
  root: t,
507
- index: s,
508
- stackSize: c.length
1812
+ index: o,
1813
+ stackSize: s.length
509
1814
  }
510
1815
  }));
511
- }, f = Object.assign(u, {
1816
+ }, d = Object.assign(u, {
512
1817
  Root: u,
513
- call: o,
514
- upsert: s,
515
- end: c,
516
- update: l
1818
+ call: a,
1819
+ upsert: o,
1820
+ end: s,
1821
+ update: c
517
1822
  });
518
1823
  if (process.env.NODE_ENV !== "production") {
519
- Object.defineProperty(f, "name", {
1824
+ Object.defineProperty(d, "name", {
520
1825
  value: "Root",
521
1826
  configurable: !0
522
1827
  });
523
1828
  let e, t = !1;
524
- Object.defineProperty(f, "displayName", {
1829
+ Object.defineProperty(d, "displayName", {
525
1830
  configurable: !0,
526
1831
  enumerable: !0,
527
1832
  get: () => e,
528
1833
  set: (r) => {
529
1834
  if (t || (e = r, !r)) return;
530
1835
  t = !0;
531
- let i = U.get(r);
532
- i ? n.current = i : U.set(r, n.current);
1836
+ let i = Fn.get(r);
1837
+ i ? n.current = i : Fn.set(r, n.current);
533
1838
  }
534
1839
  });
535
1840
  }
536
- return f;
1841
+ return d;
537
1842
  }
538
1843
  //#endregion
539
- //#region src/components/modal/modal_shell.tsx
540
- var ee = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", te = {
1844
+ //#region src/components/modal/modal_footer.tsx
1845
+ var Ln = ({ children: e, className: n }) => /* @__PURE__ */ t("div", {
1846
+ className: C("flex items-center justify-end gap-3 px-6 py-4 border-t flex-shrink-0", ie, n),
1847
+ children: e
1848
+ }), Rn = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
1849
+ function zn(e) {
1850
+ return a.toArray(e).flatMap((e) => u(e) && e.type === o ? zn(e.props.children) : [e]);
1851
+ }
1852
+ var Bn = {
541
1853
  sm: "max-w-md",
542
1854
  md: "max-w-lg",
543
1855
  lg: "max-w-2xl",
544
1856
  xl: "max-w-4xl"
545
1857
  };
546
- function G({ isEnded: e, onDismiss: r, title: i, children: a, footer: c, size: d = "md", radius: p = "xl", className: g, dismissible: _ = !0 }) {
547
- let [v, y] = u(!1), b = l(null), x = l(null), S = s();
548
- o(() => {
549
- document.body.style.overflow = "hidden", x.current = document.activeElement, b.current?.focus();
550
- let e = requestAnimationFrame(() => {
551
- requestAnimationFrame(() => y(!0));
1858
+ function Vn({ isEnded: e, onDismiss: r, title: i, children: a, footer: o, size: s = "md", radius: c = "xl", className: l, dismissible: d = !0, closeLabel: f = "Close" }) {
1859
+ let [h, g] = v(!1), y = _(null), b = _(null), S = _(null), T = m();
1860
+ p(() => {
1861
+ document.body.style.overflow = "hidden", S.current = document.activeElement;
1862
+ let e = y.current;
1863
+ (b.current?.querySelector(Rn) ?? e?.querySelector(Rn) ?? e)?.focus();
1864
+ let t = requestAnimationFrame(() => {
1865
+ requestAnimationFrame(() => g(!0));
552
1866
  });
553
1867
  return () => {
554
- cancelAnimationFrame(e), document.body.style.overflow = "";
1868
+ cancelAnimationFrame(t), document.body.style.overflow = "";
555
1869
  };
556
- }, []), o(() => {
557
- e && x.current?.focus();
558
- }, [e]), o(() => {
1870
+ }, []), p(() => {
1871
+ e && S.current?.focus();
1872
+ }, [e]), p(() => {
559
1873
  if (e) return;
560
1874
  let t = (e) => {
561
1875
  if (e.key === "Escape") {
562
- _ && r();
1876
+ d && r();
563
1877
  return;
564
1878
  }
565
1879
  if (e.key !== "Tab") return;
566
- let t = b.current;
1880
+ let t = y.current;
567
1881
  if (!t) return;
568
- let n = Array.from(t.querySelectorAll(ee));
1882
+ let n = Array.from(t.querySelectorAll(Rn));
569
1883
  if (n.length === 0) return;
570
1884
  let i = n[0], a = n[n.length - 1];
571
1885
  e.shiftKey && document.activeElement === i ? (e.preventDefault(), a.focus()) : !e.shiftKey && document.activeElement === a && (e.preventDefault(), i.focus());
@@ -574,36 +1888,36 @@ function G({ isEnded: e, onDismiss: r, title: i, children: a, footer: c, size: d
574
1888
  }, [
575
1889
  e,
576
1890
  r,
577
- _
1891
+ d
578
1892
  ]);
579
- let C = () => {
580
- !e && _ && r();
581
- }, w = v && !e;
582
- return f(/* @__PURE__ */ n("div", {
583
- className: m("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out", w ? "opacity-100" : "opacity-0"),
584
- onClick: C,
1893
+ let E = () => {
1894
+ !e && d && r();
1895
+ }, D = h && !e, O = zn(a).some((e) => u(e) && e.type === Ln);
1896
+ return x(/* @__PURE__ */ n("div", {
1897
+ className: C("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out", D ? "opacity-100" : "opacity-0"),
1898
+ onClick: E,
585
1899
  children: [/* @__PURE__ */ t("div", {
586
- className: m("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", w ? "opacity-100" : "opacity-0"),
1900
+ className: C("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", D ? "opacity-100" : "opacity-0"),
587
1901
  "aria-hidden": "true"
588
1902
  }), /* @__PURE__ */ n("div", {
589
- ref: b,
1903
+ ref: y,
590
1904
  role: "dialog",
591
1905
  "aria-modal": "true",
592
- "aria-labelledby": i ? S : void 0,
1906
+ "aria-labelledby": i ? T : void 0,
593
1907
  tabIndex: -1,
594
- className: m("relative w-full", te[d], D, "shadow-2xl", h[p], "max-h-[calc(100vh-4rem)] sm:max-h-[calc(100vh-10rem)] overflow-hidden flex flex-col", "transition-all duration-200 ease-out", "focus:outline-none", w ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 translate-y-1"),
1908
+ className: C("relative w-full", Bn[s], ae, "shadow-2xl", w[c], "max-h-[calc(100vh-4rem)] sm:max-h-[calc(100vh-10rem)] overflow-hidden flex flex-col", "transition-all duration-200 ease-out", "focus:outline-none", D ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 translate-y-1"),
595
1909
  onClick: (e) => e.stopPropagation(),
596
1910
  children: [
597
1911
  i && /* @__PURE__ */ n("div", {
598
1912
  className: "flex items-center justify-between gap-4 px-6 pt-5 pb-4 flex-shrink-0",
599
1913
  children: [/* @__PURE__ */ t("h2", {
600
- id: S,
1914
+ id: T,
601
1915
  className: "text-base font-medium tracking-tight text-gray-900 dark:text-gray-100",
602
1916
  children: i
603
- }), _ && /* @__PURE__ */ t(B, {
1917
+ }), d && /* @__PURE__ */ t(Sn, {
604
1918
  icon: "i-mdi-close",
605
1919
  onClick: r,
606
- "aria-label": "Close",
1920
+ "aria-label": f,
607
1921
  variant: "subtle",
608
1922
  size: "sm",
609
1923
  radius: "full",
@@ -611,20 +1925,18 @@ function G({ isEnded: e, onDismiss: r, title: i, children: a, footer: c, size: d
611
1925
  })]
612
1926
  }),
613
1927
  /* @__PURE__ */ t("div", {
614
- className: m("flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400 min-h-0", !i && "pt-6", g),
1928
+ ref: b,
1929
+ className: C("min-h-0", O ? "flex-1 flex flex-col overflow-hidden" : ["flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400", !i && "pt-6"], l),
615
1930
  children: a
616
1931
  }),
617
- c && /* @__PURE__ */ t("div", {
618
- className: m("flex items-center justify-end gap-3 px-6 py-4 border-t flex-shrink-0", "border-gray-100 dark:border-gray-800"),
619
- children: c
620
- })
1932
+ !O && o && /* @__PURE__ */ t(Ln, { children: o })
621
1933
  ]
622
1934
  })]
623
1935
  }), document.body);
624
1936
  }
625
1937
  //#endregion
626
- //#region node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.17_react@19.2.7_use-sync-external-store@1.6.0_react@19.2.7_/node_modules/zustand/esm/vanilla.mjs
627
- var K = (e) => {
1938
+ //#region node_modules/.pnpm/zustand@5.0.14_@types+react@19.2.18_react@19.2.8_use-sync-external-store@1.6.0_react@19.2.8_/node_modules/zustand/esm/vanilla.mjs
1939
+ var Hn = (e) => {
628
1940
  let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
629
1941
  let i = typeof e == "function" ? e(t) : e;
630
1942
  if (!Object.is(i, t)) {
@@ -638,437 +1950,435 @@ var K = (e) => {
638
1950
  subscribe: (e) => (n.add(e), () => n.delete(e))
639
1951
  }, o = t = e(r, i, a);
640
1952
  return a;
641
- }, ne = ((e) => e ? K(e) : K), re = (e) => e;
642
- function ie(e, t = re) {
643
- let n = r.useSyncExternalStore(e.subscribe, r.useCallback(() => t(e.getState()), [e, t]), r.useCallback(() => t(e.getInitialState()), [e, t]));
644
- return r.useDebugValue(n), n;
1953
+ }, Un = ((e) => e ? Hn(e) : Hn), Wn = (e) => e;
1954
+ function Gn(e, t = Wn) {
1955
+ let n = i.useSyncExternalStore(e.subscribe, i.useCallback(() => t(e.getState()), [e, t]), i.useCallback(() => t(e.getInitialState()), [e, t]));
1956
+ return i.useDebugValue(n), n;
645
1957
  }
646
- var ae = (e) => {
647
- let t = ne(e), n = (e) => ie(t, e);
1958
+ var Kn = (e) => {
1959
+ let t = Un(e), n = (e) => Gn(t, e);
648
1960
  return Object.assign(n, t), n;
649
- }, oe = ((e) => e ? ae(e) : ae), q = oe((e) => ({
1961
+ }, qn = ((e) => e ? Kn(e) : Kn), Jn = qn((e) => ({
650
1962
  globalHotkeysEnabled: !0,
651
1963
  setGlobalHotkeysEnabled: (t) => e({ globalHotkeysEnabled: t })
652
- })), J = 0;
653
- function Y() {
654
- o(() => (J += 1, J === 1 && q.getState().setGlobalHotkeysEnabled(!1), () => {
655
- --J, J === 0 && q.getState().setGlobalHotkeysEnabled(!0);
1964
+ })), Yn = 0;
1965
+ function Xn() {
1966
+ p(() => (Yn += 1, Yn === 1 && Jn.getState().setGlobalHotkeysEnabled(!1), () => {
1967
+ --Yn, Yn === 0 && Jn.getState().setGlobalHotkeysEnabled(!0);
656
1968
  }), []);
657
1969
  }
658
1970
  //#endregion
659
1971
  //#region src/components/modal/confirm_modal.tsx
660
- var se = {
661
- red: "danger",
662
- blue: "primary",
663
- green: "success"
664
- }, ce = {
665
- red: "i-mdi-alert-circle",
666
- blue: "i-mdi-help-circle",
667
- green: "i-mdi-check-circle"
668
- }, le = {
669
- red: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
670
- blue: "bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",
671
- green: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400"
1972
+ var Zn = {
1973
+ danger: "i-mdi-alert-circle",
1974
+ primary: "i-mdi-help-circle",
1975
+ success: "i-mdi-check-circle"
1976
+ }, Qn = {
1977
+ danger: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
1978
+ primary: "bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",
1979
+ success: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400"
672
1980
  };
673
- function ue({ title: e, color: r }) {
1981
+ function $n({ title: e, color: r }) {
674
1982
  return /* @__PURE__ */ n("div", {
675
1983
  className: "flex items-center gap-3",
676
1984
  children: [/* @__PURE__ */ t("span", {
677
- className: m("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", le[r]),
1985
+ className: C("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", Qn[r]),
678
1986
  "aria-hidden": "true",
679
- children: /* @__PURE__ */ t("span", { className: m(ce[r], "h-5 w-5") })
1987
+ children: /* @__PURE__ */ t("span", { className: C(Zn[r], "h-5 w-5") })
680
1988
  }), e]
681
1989
  });
682
1990
  }
683
- var de = W(({ call: r, title: i, children: a, confirmLabel: o, cancelLabel: s, confirmColor: c, radius: l, onConfirm: d }) => {
684
- Y();
685
- let [f, p] = u(!1), m = () => r.end(!1), h = async () => {
1991
+ var er = In(({ call: r, title: i, children: a, confirmLabel: o, cancelLabel: s, confirmColor: c, radius: l, closeLabel: u, onConfirm: d, onError: f }) => {
1992
+ Xn();
1993
+ let [p, m] = v(!1), h = () => r.end(!1), g = async () => {
686
1994
  if (!d) {
687
1995
  r.end(!0);
688
1996
  return;
689
1997
  }
690
- p(!0);
1998
+ m(!0);
691
1999
  try {
692
2000
  await d(), r.end(!0);
693
- } finally {
694
- p(!1);
2001
+ } catch (e) {
2002
+ m(!1), hn(e, f);
695
2003
  }
696
- }, g = f, _ = o ?? "Confirm", v = s ?? "Cancel", y = c ?? "blue";
697
- return /* @__PURE__ */ t(G, {
2004
+ }, _ = p, y = o ?? "Confirm", b = s ?? "Cancel", x = c ?? "primary";
2005
+ return /* @__PURE__ */ t(Vn, {
698
2006
  isEnded: r.ended,
699
- onDismiss: m,
700
- title: /* @__PURE__ */ t(ue, {
2007
+ onDismiss: h,
2008
+ title: /* @__PURE__ */ t($n, {
701
2009
  title: i,
702
- color: y
2010
+ color: x
703
2011
  }),
704
2012
  size: "sm",
705
2013
  radius: l,
706
- footer: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(b, {
2014
+ closeLabel: u,
2015
+ footer: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(ee, {
707
2016
  variant: "outline",
708
2017
  color: "neutral",
709
- onClick: m,
710
- disabled: g,
2018
+ onClick: h,
2019
+ disabled: _,
711
2020
  size: "sm",
712
- children: v
713
- }), /* @__PURE__ */ t(b, {
714
- color: se[y],
2021
+ children: b
2022
+ }), /* @__PURE__ */ t(ee, {
2023
+ color: x,
715
2024
  onClick: () => {
716
- h();
2025
+ g();
717
2026
  },
718
- loading: g,
719
- disabled: g,
2027
+ loading: _,
2028
+ disabled: _,
720
2029
  size: "sm",
721
- children: _
2030
+ children: y
722
2031
  })] }),
723
2032
  children: a
724
2033
  });
725
- }, 200), fe = 200;
726
- function pe(e, t) {
2034
+ }, 200);
2035
+ //#endregion
2036
+ //#region src/components/modal/modal.tsx
2037
+ function tr(e, t) {
727
2038
  return typeof e == "function" ? e(t) : e;
728
2039
  }
729
- var me = W(({ call: e, title: n, children: r, footer: i, size: a, radius: o, className: s, dismissible: c }) => {
730
- Y();
731
- let l = () => e.end();
732
- return /* @__PURE__ */ t(G, {
2040
+ var nr = In(({ call: e, title: n, children: r, footer: i, size: a, radius: o, className: s, dismissible: c, closeLabel: l }) => {
2041
+ Xn();
2042
+ let u = () => e.end();
2043
+ return /* @__PURE__ */ t(Vn, {
733
2044
  isEnded: e.ended,
734
- onDismiss: l,
2045
+ onDismiss: u,
735
2046
  title: n,
736
- footer: pe(i, l),
2047
+ footer: tr(i, u),
737
2048
  size: a,
738
2049
  radius: o,
739
2050
  className: s,
740
2051
  dismissible: c,
741
- children: pe(r, l)
2052
+ closeLabel: l,
2053
+ children: tr(r, u)
742
2054
  });
743
- }, fe);
2055
+ }, 200), rr = ({ children: e, className: n }) => /* @__PURE__ */ t("div", {
2056
+ className: C("flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400 min-h-0", n),
2057
+ children: e
2058
+ });
744
2059
  //#endregion
745
2060
  //#region src/components/modal_provider/modal_provider.tsx
746
- function he() {
747
- return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(me, {}), /* @__PURE__ */ t(de, {})] });
2061
+ function ir() {
2062
+ return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t(nr, {}), /* @__PURE__ */ t(er, {})] });
2063
+ }
2064
+ //#endregion
2065
+ //#region src/components/radio_options/radio_option_row.tsx
2066
+ function ar({ option: e, optionId: r, descriptionId: i, name: a, orientation: o, isSelected: s, isDisabled: c, isFirstOption: l, required: u, error: d, radius: f, unstyled: p, className: m, onSelect: h }) {
2067
+ return /* @__PURE__ */ n("label", {
2068
+ htmlFor: r,
2069
+ className: C("flex cursor-pointer items-start gap-3 transition-colors duration-150", o === "horizontal" && "flex-1", D, d ? k : O, !p && [
2070
+ w[f],
2071
+ "border px-3 py-2.5",
2072
+ s ? d ? C("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : d ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : C("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
2073
+ ], c && "cursor-not-allowed opacity-50", m),
2074
+ children: [
2075
+ /* @__PURE__ */ t("input", {
2076
+ type: "radio",
2077
+ id: r,
2078
+ name: a,
2079
+ value: e.value,
2080
+ checked: s,
2081
+ onChange: () => h(e.value),
2082
+ disabled: c,
2083
+ required: u && l,
2084
+ "aria-invalid": d ? !0 : void 0,
2085
+ "aria-describedby": e.description ? i : void 0,
2086
+ className: "sr-only"
2087
+ }),
2088
+ /* @__PURE__ */ t("span", {
2089
+ className: C("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", s ? d ? ce : "border-blue-600 dark:border-blue-500" : d ? "border-red-400 dark:border-red-600" : ne),
2090
+ "aria-hidden": !0,
2091
+ children: s && /* @__PURE__ */ t("span", { className: C("h-2 w-2 rounded-full", d ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
2092
+ }),
2093
+ /* @__PURE__ */ n("span", {
2094
+ className: "flex min-w-0 flex-col",
2095
+ children: [/* @__PURE__ */ n("span", {
2096
+ className: "flex items-center gap-1.5",
2097
+ children: [e.icon && /* @__PURE__ */ t("span", {
2098
+ className: C(e.icon, "h-4 w-4 shrink-0", s ? d ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
2099
+ "aria-hidden": !0
2100
+ }), /* @__PURE__ */ t("span", {
2101
+ className: C("select-none text-sm font-medium", s ? d ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
2102
+ children: e.label
2103
+ })]
2104
+ }), e.description && /* @__PURE__ */ t("span", {
2105
+ id: i,
2106
+ className: C("text-xs text-gray-500 dark:text-gray-400", "mt-0.5"),
2107
+ children: e.description
2108
+ })]
2109
+ })
2110
+ ]
2111
+ });
748
2112
  }
749
2113
  //#endregion
750
2114
  //#region src/components/radio_options/radio_options.tsx
751
- function ge({ options: e, orientation: r = "vertical", value: i, defaultValue: a, onChange: o, name: c, label: l, error: d, required: f, disabled: p, radius: g = "lg", unstyled: _ = !1, className: v, wrapperClassName: y, id: b = "radio", ...x }) {
752
- let S = `${b}-${s()}`, C = c ?? S, [T, E] = u(a ?? ""), D = i !== void 0, O = D ? i : T, k = e.map((e) => typeof e == "string" ? {
2115
+ function or({ options: e, orientation: r = "vertical", value: i, defaultValue: a, onChange: o, name: s, label: c, error: l, required: u, disabled: d, radius: f = "lg", unstyled: p = !1, className: m, wrapperClassName: h, id: g, ..._ }) {
2116
+ let { fieldId: v, errorId: y } = B(g), b = s ?? v, [x, S] = de(i, a ?? ""), w = e.map((e) => typeof e == "string" ? {
753
2117
  value: e,
754
2118
  label: e
755
- } : e), j = `${S}-error`, M = (e) => {
756
- D || E(e), o?.(e);
2119
+ } : e), T = (e) => {
2120
+ S(e), o?.(e);
757
2121
  };
758
2122
  return /* @__PURE__ */ n("fieldset", {
759
- className: m("m-0 border-0 p-0", y),
760
- disabled: p,
761
- "aria-describedby": d ? j : void 0,
762
- "aria-required": f,
763
- ...x,
2123
+ className: C("m-0 border-0 p-0", h),
2124
+ disabled: d,
2125
+ "aria-describedby": l ? y : void 0,
2126
+ "aria-required": u,
2127
+ ..._,
764
2128
  children: [
765
- l && /* @__PURE__ */ n("legend", {
766
- className: m("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2", v),
767
- children: [l, f && /* @__PURE__ */ t("span", {
2129
+ c && /* @__PURE__ */ n("legend", {
2130
+ className: C("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
2131
+ children: [c, u && /* @__PURE__ */ t("span", {
768
2132
  className: "text-red-500 dark:text-red-400 ml-1",
769
2133
  children: "*"
770
2134
  })]
771
2135
  }),
772
2136
  /* @__PURE__ */ t("div", {
773
- className: m(r === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
774
- children: k.map((e, i) => {
775
- let a = `${S}-${i}`, o = `${S}-${i}-desc`, s = O === e.value, c = p ?? e.disabled;
776
- return /* @__PURE__ */ n("label", {
777
- htmlFor: a,
778
- className: m("flex cursor-pointer items-start gap-3 transition-colors duration-150", r === "horizontal" && "flex-1", "focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2", "focus-within:ring-offset-white dark:focus-within:ring-offset-gray-900", d ? "focus-within:ring-red-500" : "focus-within:ring-blue-500", !_ && [
779
- h[g],
780
- "border px-3 py-2.5",
781
- s ? d ? m("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : d ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : m("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
782
- ], c && "cursor-not-allowed opacity-50"),
783
- children: [
784
- /* @__PURE__ */ t("input", {
785
- type: "radio",
786
- id: a,
787
- name: C,
788
- value: e.value,
789
- checked: s,
790
- onChange: () => M(e.value),
791
- disabled: c,
792
- required: f && i === 0,
793
- "aria-invalid": d ? !0 : void 0,
794
- "aria-describedby": e.description ? o : void 0,
795
- className: "sr-only"
796
- }),
797
- /* @__PURE__ */ t("span", {
798
- className: m("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", s ? d ? A : "border-blue-600 dark:border-blue-500" : d ? "border-red-400 dark:border-red-600" : w),
799
- "aria-hidden": !0,
800
- children: s && /* @__PURE__ */ t("span", { className: m("h-2 w-2 rounded-full", d ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
801
- }),
802
- /* @__PURE__ */ n("span", {
803
- className: "flex min-w-0 flex-col",
804
- children: [/* @__PURE__ */ n("span", {
805
- className: "flex items-center gap-1.5",
806
- children: [e.icon && /* @__PURE__ */ t("span", {
807
- className: m(e.icon, "h-4 w-4 shrink-0", s ? d ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
808
- "aria-hidden": !0
809
- }), /* @__PURE__ */ t("span", {
810
- className: m("select-none text-sm font-medium", s ? d ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
811
- children: e.label
812
- })]
813
- }), e.description && /* @__PURE__ */ t("span", {
814
- id: o,
815
- className: m("text-xs text-gray-500 dark:text-gray-400", "mt-0.5"),
816
- children: e.description
817
- })]
818
- })
819
- ]
820
- }, e.value);
821
- })
2137
+ className: C(r === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
2138
+ children: w.map((e, n) => /* @__PURE__ */ t(ar, {
2139
+ option: e,
2140
+ optionId: `${v}-${n}`,
2141
+ descriptionId: `${v}-${n}-desc`,
2142
+ name: b,
2143
+ orientation: r,
2144
+ isSelected: x === e.value,
2145
+ isDisabled: d === !0 || e.disabled === !0,
2146
+ isFirstOption: n === 0,
2147
+ required: u,
2148
+ error: l,
2149
+ radius: f,
2150
+ unstyled: p,
2151
+ className: m,
2152
+ onSelect: T
2153
+ }, e.value))
822
2154
  }),
823
- d && /* @__PURE__ */ t("p", {
824
- id: j,
825
- className: m("text-xs text-red-600 dark:text-red-400", "mt-2"),
826
- role: "alert",
827
- children: d
2155
+ /* @__PURE__ */ t(le, {
2156
+ id: y,
2157
+ error: l,
2158
+ className: "mt-2"
828
2159
  })
829
2160
  ]
830
2161
  });
831
2162
  }
832
2163
  //#endregion
833
2164
  //#region src/components/select/select.tsx
834
- function _e({ options: e, label: r, error: i, placeholder: a, radius: o = "md", unstyled: c = !1, className: l, wrapperClassName: u, value: d, defaultValue: f, onChange: p, id: g = "select", ..._ }) {
835
- let v = `${g}-${s()}`;
836
- return /* @__PURE__ */ n("div", {
837
- className: m("w-full", u),
838
- children: [
839
- typeof r == "string" ? /* @__PURE__ */ n("label", {
840
- className: m(k, "block mb-1"),
841
- htmlFor: v,
842
- children: [r, _.required && /* @__PURE__ */ t("span", {
843
- className: "text-red-500 dark:text-red-400 ml-1",
844
- children: "*"
845
- })]
846
- }) : r,
847
- /* @__PURE__ */ n("select", {
848
- id: v,
849
- className: m("w-full disabled:opacity-50 disabled:cursor-not-allowed", !c && [
850
- F,
851
- h[o],
852
- "pl-3 pr-8 py-2 text-sm appearance-none bg-[length:1rem_1rem] bg-[position:right_0.5rem_center] bg-no-repeat",
853
- "bg-[url(\"data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e\")]"
854
- ], !c && i && m("border-red-500 dark:border-red-400", "focus:ring-red-500"), l),
855
- ...d === void 0 ? { defaultValue: f } : { value: d },
856
- onChange: p,
857
- "aria-invalid": !!i,
858
- "aria-describedby": i ? `${v}-error` : void 0,
859
- ..._,
860
- children: [a !== void 0 && /* @__PURE__ */ t("option", {
861
- value: "",
862
- children: a
863
- }), e.map((e) => /* @__PURE__ */ t("option", {
864
- value: e.value,
865
- children: e.label
866
- }, e.value))]
867
- }),
868
- i && /* @__PURE__ */ t("p", {
869
- id: `${v}-error`,
870
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1"),
871
- role: "alert",
872
- children: i
873
- })
874
- ]
2165
+ function sr({ options: e, label: r, error: i, placeholder: a, radius: o = "md", unstyled: s = !1, className: c, wrapperClassName: l, value: u, defaultValue: d, onChange: f, id: p, ...m }) {
2166
+ let { fieldId: h, errorId: g } = B(p);
2167
+ return /* @__PURE__ */ t(he, {
2168
+ fieldId: h,
2169
+ errorId: g,
2170
+ label: r,
2171
+ error: i,
2172
+ required: m.required,
2173
+ wrapperClassName: l,
2174
+ children: /* @__PURE__ */ n("select", {
2175
+ id: h,
2176
+ className: C("w-full disabled:opacity-50 disabled:cursor-not-allowed", !s && [
2177
+ z,
2178
+ w[o],
2179
+ "pl-3 pr-8 py-2 text-sm appearance-none bg-[length:1rem_1rem] bg-[position:right_0.5rem_center] bg-no-repeat",
2180
+ "bg-[url(\"data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e\")]"
2181
+ ], !s && i && C("border-red-500 dark:border-red-400", "focus:ring-red-500"), c),
2182
+ ...u === void 0 ? { defaultValue: d } : { value: u },
2183
+ onChange: f,
2184
+ "aria-invalid": !!i,
2185
+ "aria-describedby": i ? g : void 0,
2186
+ ...m,
2187
+ children: [a !== void 0 && /* @__PURE__ */ t("option", {
2188
+ value: "",
2189
+ children: a
2190
+ }), e.map((e) => /* @__PURE__ */ t("option", {
2191
+ value: e.value,
2192
+ children: e.label
2193
+ }, e.value))]
2194
+ })
875
2195
  });
876
2196
  }
877
2197
  //#endregion
878
2198
  //#region src/components/switch/switch.tsx
879
- function ve({ label: r, description: i, error: a, className: o, wrapperClassName: c, checked: l, defaultChecked: d = !1, onChange: f, id: p = "switch", ...h }) {
880
- let g = `${p}-${s()}`, [_, v] = u(d), y = l !== void 0, b = y ? l : _, x = [i && `${g}-description`, a && `${g}-error`].filter(Boolean).join(" ") || void 0;
2199
+ function cr({ label: r, description: i, error: a, unstyled: o = !1, className: s, wrapperClassName: c, checked: l, defaultChecked: u = !1, onChange: d, id: f, ...p }) {
2200
+ let { fieldId: m, errorId: h, descriptionId: g } = B(f), [_, v] = de(l, u), y = [i && g, a && h].filter(Boolean).join(" ") || void 0;
881
2201
  return /* @__PURE__ */ n("div", {
882
- className: m("w-full", c),
2202
+ className: C("w-full", c),
883
2203
  children: [
884
2204
  /* @__PURE__ */ n("label", {
885
- htmlFor: g,
886
- className: m("flex items-center gap-3 cursor-pointer", h.disabled && "cursor-not-allowed opacity-50"),
2205
+ htmlFor: m,
2206
+ className: C("flex items-center gap-3 cursor-pointer", p.disabled && "cursor-not-allowed opacity-50"),
887
2207
  children: [/* @__PURE__ */ n("span", {
888
- className: m("relative inline-flex w-11 shrink-0 rounded-full border-2 border-transparent", "transition-colors duration-200 ease-in-out", "focus-within:outline-none focus-within:ring-2 focus-within:ring-blue-500 focus-within:ring-offset-2", "disabled:opacity-50", b ? O : "bg-gray-200 dark:bg-gray-600", a && "ring-2 ring-red-500 dark:ring-red-400", o),
2208
+ className: C("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out", D, O, !o && [
2209
+ "rounded-full border-2 border-transparent",
2210
+ _ ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-600",
2211
+ a && "ring-2 ring-red-500 dark:ring-red-400"
2212
+ ], s),
889
2213
  children: [/* @__PURE__ */ t("input", {
890
2214
  type: "checkbox",
891
2215
  role: "switch",
892
- id: g,
2216
+ id: m,
893
2217
  className: "sr-only",
894
- checked: b,
2218
+ checked: _,
895
2219
  onChange: (e) => {
896
- y || v(e.target.checked), f?.(e);
2220
+ v(e.target.checked), d?.(e);
897
2221
  },
898
2222
  "aria-invalid": !!a,
899
- "aria-describedby": x,
900
- ...h
2223
+ "aria-describedby": y,
2224
+ ...p
901
2225
  }), /* @__PURE__ */ t("span", {
902
- className: m("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", b ? "translate-x-5.25" : "translate-x-0"),
2226
+ className: C("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", _ ? "translate-x-5.25" : "translate-x-0"),
903
2227
  "aria-hidden": !0
904
2228
  })]
905
2229
  }), r && /* @__PURE__ */ t(e, { children: typeof r == "string" ? /* @__PURE__ */ n("span", {
906
- className: m("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
907
- children: [r, h.required && /* @__PURE__ */ t("span", {
2230
+ className: C("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
2231
+ children: [r, p.required && /* @__PURE__ */ t("span", {
908
2232
  className: "text-red-500 dark:text-red-400 ml-1",
909
2233
  children: "*"
910
2234
  })]
911
- }) : /* @__PURE__ */ n(e, { children: [r, h.required && /* @__PURE__ */ t("span", {
2235
+ }) : /* @__PURE__ */ n(e, { children: [r, p.required && /* @__PURE__ */ t("span", {
912
2236
  className: "text-red-500 dark:text-red-400 ml-1",
913
2237
  children: "*"
914
2238
  })] }) })]
915
2239
  }),
916
- i && (typeof i == "string" ? /* @__PURE__ */ t("p", {
917
- id: `${g}-description`,
918
- className: m("text-xs text-gray-500 dark:text-gray-400", "mt-1 ml-14"),
919
- children: i
920
- }) : /* @__PURE__ */ t("span", {
921
- id: `${g}-description`,
922
- className: m("text-xs text-gray-500 dark:text-gray-400", "block mt-1 ml-14"),
923
- children: i
924
- })),
925
- a && /* @__PURE__ */ t("p", {
926
- id: `${g}-error`,
927
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1 ml-14"),
928
- role: "alert",
929
- children: a
2240
+ /* @__PURE__ */ t(ue, {
2241
+ id: g,
2242
+ description: i,
2243
+ className: "mt-1 ml-14"
2244
+ }),
2245
+ /* @__PURE__ */ t(le, {
2246
+ id: h,
2247
+ error: a,
2248
+ className: "mt-1 ml-14"
930
2249
  })
931
2250
  ]
932
2251
  });
933
2252
  }
934
2253
  //#endregion
935
2254
  //#region src/components/tabs/tabs.tsx
936
- function ye({ items: e, defaultIndex: r = 0, radius: i = "md", className: a, tabListClassName: o, panelClassName: c, onChange: d }) {
937
- let [f, p] = u(r), g = s(), _ = l([]), v = (t) => {
938
- e[t]?.disabled || (p(t), d?.(t));
939
- }, y = (e) => {
940
- _.current[e]?.focus(), v(e);
941
- }, b = (t) => {
2255
+ function lr({ items: e, value: r, defaultIndex: i = 0, radius: a = "md", unstyled: o = !1, className: s, tabListClassName: c, panelClassName: l, onChange: u }) {
2256
+ let [d, f] = de(r, i), p = m(), h = _([]), g = (t) => {
2257
+ e[t]?.disabled || (f(t), u?.(t));
2258
+ }, v = (e) => {
2259
+ h.current[e]?.focus(), g(e);
2260
+ }, y = (t) => {
942
2261
  let n = e.map((e, t) => t).filter((t) => !e[t]?.disabled);
943
2262
  if (n.length === 0) return;
944
- let r = n.indexOf(f);
945
- t.key === "ArrowRight" ? (t.preventDefault(), y(n[(r + 1) % n.length])) : t.key === "ArrowLeft" ? (t.preventDefault(), y(n[(r - 1 + n.length) % n.length])) : t.key === "Home" ? (t.preventDefault(), y(n[0])) : t.key === "End" && (t.preventDefault(), y(n[n.length - 1]));
946
- }, x = e[f];
2263
+ let r = n.indexOf(d);
2264
+ t.key === "ArrowRight" ? (t.preventDefault(), v(n[(r + 1) % n.length])) : t.key === "ArrowLeft" ? (t.preventDefault(), v(n[(r - 1 + n.length) % n.length])) : t.key === "Home" ? (t.preventDefault(), v(n[0])) : t.key === "End" && (t.preventDefault(), v(n[n.length - 1]));
2265
+ }, b = e[d];
947
2266
  return /* @__PURE__ */ n("div", {
948
- className: m("w-full", a),
2267
+ className: C("w-full", s),
949
2268
  children: [/* @__PURE__ */ t("div", {
950
2269
  role: "tablist",
951
- className: m("flex gap-1 p-1 bg-gray-100 dark:bg-gray-800/50 border", E, h[i], o),
2270
+ className: C("flex gap-1 p-1", !o && [
2271
+ "bg-gray-100 dark:bg-gray-800/50 border",
2272
+ "border-gray-200 dark:border-gray-700",
2273
+ w[a]
2274
+ ], c),
952
2275
  children: e.map((e, r) => /* @__PURE__ */ n("button", {
953
2276
  ref: (e) => {
954
- _.current[r] = e;
2277
+ h.current[r] = e;
955
2278
  },
956
- id: `${g}-tab-${r}`,
2279
+ id: `${p}-tab-${r}`,
957
2280
  role: "tab",
958
2281
  type: "button",
959
- "aria-selected": f === r,
2282
+ "aria-selected": d === r,
960
2283
  "aria-disabled": e.disabled,
961
- "aria-controls": `${g}-panel-${r}`,
962
- tabIndex: f === r ? 0 : -1,
2284
+ "aria-controls": `${p}-panel-${r}`,
2285
+ tabIndex: d === r ? 0 : -1,
963
2286
  disabled: e.disabled,
964
- onClick: () => v(r),
965
- onKeyDown: b,
966
- className: m("flex items-center gap-2 px-4 py-2.5 text-sm font-medium", h[i], f === r ? m("bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm border", E) : m("text-gray-600 dark:text-gray-400 border border-transparent", e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-200/50 dark:hover:bg-gray-700/50")),
967
- children: [e.icon && /* @__PURE__ */ t("span", { className: m("w-4 h-4 block shrink-0", e.icon, f === r ? "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400") }), e.title]
968
- }, r))
2287
+ onClick: () => g(r),
2288
+ onKeyDown: y,
2289
+ className: C("flex items-center gap-2 px-4 py-2.5 text-sm font-medium", e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !o && [w[a], d === r ? C("bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400 shadow-sm border", "border-gray-200 dark:border-gray-700") : C("text-gray-600 dark:text-gray-400 border border-transparent", !e.disabled && "hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-200/50 dark:hover:bg-gray-700/50")]),
2290
+ children: [e.icon && /* @__PURE__ */ t("span", { className: C("w-4 h-4 block shrink-0", e.icon, !o && (d === r ? "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400")) }), e.title]
2291
+ }, e.title))
969
2292
  }), /* @__PURE__ */ t("div", {
970
2293
  role: "tabpanel",
971
- id: `${g}-panel-${f}`,
972
- "aria-labelledby": `${g}-tab-${f}`,
2294
+ id: `${p}-panel-${d}`,
2295
+ "aria-labelledby": `${p}-tab-${d}`,
973
2296
  tabIndex: 0,
974
- className: m("mt-3 border bg-white dark:bg-gray-800/50 p-4 overflow-hidden focus:outline-none", E, h[i], c),
2297
+ className: C("mt-3 overflow-hidden focus:outline-none", !o && [
2298
+ "border bg-white dark:bg-gray-800/50 p-4",
2299
+ "border-gray-200 dark:border-gray-700",
2300
+ w[a]
2301
+ ], l),
975
2302
  children: /* @__PURE__ */ t("div", {
976
2303
  className: "tabs-panel-inner",
977
- children: x?.content
978
- }, f)
2304
+ children: b?.content
2305
+ }, d)
979
2306
  })]
980
2307
  });
981
2308
  }
982
2309
  //#endregion
983
2310
  //#region src/components/textarea/textarea.tsx
984
- function be({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: c = "md", unstyled: l = !1, className: d, wrapperClassName: f, value: p, defaultValue: g, onChange: _, id: v = "textarea", ...y }) {
985
- let b = `${v}-${s()}`, [x, S] = u(typeof g == "string" ? g.length : 0), w = typeof p == "string" ? p.length : p === void 0 ? x : 0, T = i && (a !== void 0 || o !== void 0), E = (e) => {
986
- p === void 0 && S(e.target.value.length), _?.(e);
2311
+ function ur({ label: e, error: r, showCharCount: i = !1, minLength: a, maxLength: o, radius: s = "md", unstyled: c = !1, className: l, wrapperClassName: u, value: d, defaultValue: f, onChange: p, id: m, ...h }) {
2312
+ let { fieldId: g, errorId: _ } = B(m), { length: v, trackLength: y } = wn(d, f), b = i && (a !== void 0 || o !== void 0), x = (e) => {
2313
+ y(e.target.value), p?.(e);
987
2314
  };
988
- return /* @__PURE__ */ n("div", {
989
- className: m("w-full", f),
990
- children: [
991
- typeof e == "string" ? /* @__PURE__ */ n("label", {
992
- className: m(k, "block mb-1"),
993
- htmlFor: b,
994
- children: [e, y.required && /* @__PURE__ */ t("span", {
995
- className: "text-red-500 dark:text-red-400 ml-1",
996
- children: "*"
997
- })]
998
- }) : e,
999
- /* @__PURE__ */ t("textarea", {
1000
- id: b,
1001
- className: m("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !l && [
1002
- F,
1003
- h[c],
1004
- "px-3 py-2 text-sm"
1005
- ], !l && r && m("border-red-500 dark:border-red-400", "focus:ring-red-500"), d),
1006
- ...p === void 0 ? { defaultValue: g } : { value: p },
1007
- minLength: a,
1008
- maxLength: o,
1009
- onChange: E,
1010
- "aria-invalid": !!r,
1011
- "aria-describedby": r ? `${b}-error` : void 0,
1012
- ...y
1013
- }),
1014
- T && /* @__PURE__ */ t(C, {
1015
- current: w,
1016
- min: a,
1017
- max: o,
1018
- showMin: a !== void 0,
1019
- showMax: o !== void 0
1020
- }),
1021
- r && /* @__PURE__ */ t("p", {
1022
- id: `${b}-error`,
1023
- className: m("text-xs text-red-600 dark:text-red-400", "mt-1"),
1024
- role: "alert",
1025
- children: r
1026
- })
1027
- ]
2315
+ return /* @__PURE__ */ n(he, {
2316
+ fieldId: g,
2317
+ errorId: _,
2318
+ label: e,
2319
+ error: r,
2320
+ required: h.required,
2321
+ wrapperClassName: u,
2322
+ children: [/* @__PURE__ */ t("textarea", {
2323
+ id: g,
2324
+ className: C("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !c && [
2325
+ z,
2326
+ w[s],
2327
+ "px-3 py-2 text-sm"
2328
+ ], !c && r && C("border-red-500 dark:border-red-400", "focus:ring-red-500"), l),
2329
+ ...d === void 0 ? { defaultValue: f } : { value: d },
2330
+ minLength: a,
2331
+ maxLength: o,
2332
+ onChange: x,
2333
+ "aria-invalid": !!r,
2334
+ "aria-describedby": r ? _ : void 0,
2335
+ ...h
2336
+ }), b && /* @__PURE__ */ t(te, {
2337
+ current: v,
2338
+ min: a,
2339
+ max: o,
2340
+ showMin: a !== void 0,
2341
+ showMax: o !== void 0
2342
+ })]
1028
2343
  });
1029
2344
  }
1030
2345
  //#endregion
1031
2346
  //#region src/stores/theme_store/theme_store.ts
1032
- var X = "theme";
1033
- function xe(e) {
2347
+ var dr = "theme";
2348
+ function fr(e) {
1034
2349
  return e === "light" || e === "dark" || e === "system";
1035
2350
  }
1036
- function Z() {
2351
+ function pr() {
1037
2352
  return globalThis.window !== void 0 && globalThis.document !== void 0;
1038
2353
  }
1039
- function Q(e) {
2354
+ function mr(e) {
1040
2355
  let t = window.matchMedia("(prefers-color-scheme: dark)").matches, n = e === "dark" || e === "system" && t;
1041
2356
  document.documentElement.classList.toggle("dark", n);
1042
2357
  }
1043
- function Se() {
1044
- if (!Z()) return "system";
1045
- let e = globalThis.localStorage.getItem(X);
1046
- return xe(e) ? e : "system";
2358
+ function hr() {
2359
+ if (!pr()) return "system";
2360
+ let e = globalThis.localStorage.getItem(dr);
2361
+ return fr(e) ? e : "system";
1047
2362
  }
1048
- var $ = oe((e) => ({
1049
- theme: Se(),
2363
+ var gr = hr();
2364
+ pr() && mr(gr);
2365
+ var _r = qn((e) => ({
2366
+ theme: gr,
1050
2367
  setTheme: (t) => {
1051
- Q(t), Z() && globalThis.localStorage.setItem(X, t), e({ theme: t });
2368
+ mr(t), pr() && globalThis.localStorage.setItem(dr, t), e({ theme: t });
1052
2369
  }
1053
2370
  }));
1054
- Z() && (globalThis.addEventListener("storage", (e) => {
1055
- if (e.key !== X) return;
1056
- let t = xe(e.newValue) ? e.newValue : "system";
1057
- Q(t), $.setState({ theme: t });
2371
+ pr() && (globalThis.addEventListener("storage", (e) => {
2372
+ if (e.key !== dr) return;
2373
+ let t = fr(e.newValue) ? e.newValue : "system";
2374
+ mr(t), _r.setState({ theme: t });
1058
2375
  }), globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
1059
- $.getState().theme === "system" && Q("system");
2376
+ _r.getState().theme === "system" && mr("system");
1060
2377
  }));
1061
2378
  //#endregion
1062
- //#region src/hooks/use_is_client/use_is_client.tsx
1063
- var Ce = () => {
1064
- let [e, t] = u(!1);
1065
- return o(() => {
1066
- requestAnimationFrame(() => {
1067
- t(!0);
1068
- });
1069
- }, []), e;
1070
- }, we = 750, Te = "ease-in-out";
1071
- async function Ee({ theme: e, element: t, transitionDuration: n = we, transitionEasing: r = Te, applyThemeCallback: i }) {
2379
+ //#region src/lib/theme_transition.ts
2380
+ var vr = 750, yr = "ease-in-out";
2381
+ async function br({ theme: e, element: t, transitionDuration: n = vr, transitionEasing: r = yr, applyThemeCallback: i }) {
1072
2382
  if (!document.startViewTransition || globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches) {
1073
2383
  i(e);
1074
2384
  return;
@@ -1082,55 +2392,129 @@ async function Ee({ theme: e, element: t, transitionDuration: n = we, transition
1082
2392
  pseudoElement: "::view-transition-new(root)"
1083
2393
  });
1084
2394
  }
1085
- function De(e) {
2395
+ function xr(e) {
1086
2396
  return e === "light" ? "dark" : e === "dark" ? "system" : "light";
1087
2397
  }
1088
2398
  //#endregion
1089
2399
  //#region src/components/theme_toggle/theme_toggle.tsx
1090
- var Oe = {
2400
+ var Sr = {
1091
2401
  light: "i-tabler-sun text-yellow-500",
1092
2402
  dark: "i-tabler-moon-stars text-gray-700 dark:text-yellow-500",
1093
2403
  system: "i-tabler-device-desktop text-blue-500"
1094
- }, ke = "i-tabler-device-desktop text-gray-400";
1095
- function Ae({ isTransitionEnabled: e = !0, transitionDuration: n, transitionEasing: r, size: i = "md", radius: s }) {
1096
- let c = $((e) => e.theme), u = $((e) => e.setTheme), d = Ce(), f = l(null);
1097
- o(() => {
1098
- u($.getState().theme);
1099
- }, [u]);
1100
- let p = a(async () => {
1101
- let t = De(c), i = f.current;
1102
- i && e ? await Ee({
2404
+ }, Cr = "i-tabler-device-desktop text-gray-400";
2405
+ function wr(e) {
2406
+ return `Current theme: ${e}`;
2407
+ }
2408
+ function Tr({ isTransitionEnabled: e = !0, transitionDuration: n, transitionEasing: r, size: i = "md", radius: a, variant: o, getAriaLabel: s = wr }) {
2409
+ let c = _r((e) => e.theme), l = _r((e) => e.setTheme), u = pe(), f = _(null), p = d(async () => {
2410
+ let t = xr(c), i = f.current;
2411
+ i && e ? await br({
1103
2412
  theme: t,
1104
2413
  element: i,
1105
2414
  transitionDuration: n,
1106
2415
  transitionEasing: r,
1107
- applyThemeCallback: u
1108
- }) : u(t);
2416
+ applyThemeCallback: l
2417
+ }) : l(t);
1109
2418
  }, [
1110
2419
  c,
1111
2420
  e,
1112
2421
  n,
1113
2422
  r,
1114
- u
1115
- ]);
1116
- return /* @__PURE__ */ t(B, {
2423
+ l
2424
+ ]), m = u ? Sr[c] : Cr;
2425
+ return /* @__PURE__ */ t(Sn, {
1117
2426
  ref: f,
1118
- icon: d ? Oe[c] : ke,
1119
- "aria-label": `Thème actuel: ${c}`,
2427
+ icon: m,
2428
+ "aria-label": s(c),
1120
2429
  size: i,
1121
- radius: s,
2430
+ radius: a,
2431
+ variant: o,
1122
2432
  onClick: () => {
1123
2433
  p();
1124
2434
  }
1125
2435
  });
1126
2436
  }
1127
2437
  //#endregion
1128
- //#region src/hooks/use_run_after_animation/use_run_after_animation.ts
1129
- function je(e) {
1130
- return a((t) => {
1131
- let n = setTimeout(t, e);
1132
- return () => clearTimeout(n);
1133
- }, [e]);
2438
+ //#region src/components/tooltip/tooltip.tsx
2439
+ var Er = 8, Dr = 8, Or = {
2440
+ top: "data-[state=closed]:translate-y-1",
2441
+ bottom: "data-[state=closed]:-translate-y-1",
2442
+ left: "data-[state=closed]:translate-x-1",
2443
+ right: "data-[state=closed]:-translate-x-1"
2444
+ }, kr = {
2445
+ top: "bottom",
2446
+ bottom: "top",
2447
+ left: "right",
2448
+ right: "left"
2449
+ };
2450
+ function Ar({ content: r, children: i, position: a = "top", showOnClick: o = !1, temporaryContent: c, temporaryDuration: l = 2e3, disabled: f = !1, radius: h = "lg", onTemporaryShow: g, className: y, ref: b }) {
2451
+ let { isMounted: S, isVisible: T, setIsVisible: E, open: D, close: O } = ln(), [k, A] = v(!1), j = m(), M = _(null), N = _(void 0), { refs: P, floatingStyles: F, placement: I, middlewareData: ee, isPositioned: L } = Zt({
2452
+ placement: a,
2453
+ open: S,
2454
+ whileElementsMounted: Bt,
2455
+ middleware: [
2456
+ $t(Er),
2457
+ tn(),
2458
+ en({ padding: 8 }),
2459
+ nn({ element: M })
2460
+ ]
2461
+ }), R = I.split("-")[0];
2462
+ un(S, L, E);
2463
+ let te = d((e) => On(P.setReference, b)(e), [P, b]), ne = () => {
2464
+ A(!1), O();
2465
+ }, re = () => {
2466
+ f || !c || (A(!0), D(L), clearTimeout(N.current), N.current = setTimeout(ne, l), g?.());
2467
+ }, ie = () => {
2468
+ f || D(L);
2469
+ }, ae = () => {
2470
+ clearTimeout(N.current), ne();
2471
+ };
2472
+ p(() => () => clearTimeout(N.current), []);
2473
+ let z = S && !f, oe = k && c ? c : r, se = {
2474
+ onClick: (e) => {
2475
+ o && c && re(), u(i) && i.props.onClick?.(e);
2476
+ },
2477
+ "aria-describedby": z ? j : void 0
2478
+ }, ce = u(i) ? s(i, se) : i, le = ee.arrow?.x, B = ee.arrow?.y, ue = kr[R];
2479
+ return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
2480
+ ref: te,
2481
+ className: C("inline-block", y),
2482
+ onMouseEnter: ie,
2483
+ onMouseLeave: ae,
2484
+ onFocus: ie,
2485
+ onBlur: ae,
2486
+ children: ce
2487
+ }), z && x(/* @__PURE__ */ t("div", {
2488
+ ref: P.setFloating,
2489
+ style: F,
2490
+ className: "z-50 inline-block pointer-events-none",
2491
+ children: /* @__PURE__ */ n("div", {
2492
+ id: j,
2493
+ role: "tooltip",
2494
+ "data-state": T ? "open" : "closed",
2495
+ className: C("px-3 py-1.5 text-sm whitespace-nowrap", "text-white dark:text-gray-900 bg-gray-900 dark:bg-gray-100 shadow-lg", "transition-[opacity,transform] duration-150 ease-out", T ? "opacity-100" : "opacity-0", Or[R], w[h]),
2496
+ children: [oe, /* @__PURE__ */ t("div", {
2497
+ ref: M,
2498
+ style: {
2499
+ position: "absolute",
2500
+ width: `${Dr}px`,
2501
+ height: `${Dr}px`,
2502
+ left: le === void 0 ? void 0 : `${le}px`,
2503
+ top: B === void 0 ? void 0 : `${B}px`,
2504
+ [ue]: `-${Dr / 2}px`
2505
+ },
2506
+ className: "rotate-45 bg-gray-900 dark:bg-gray-100"
2507
+ })]
2508
+ })
2509
+ }), document.body)] });
1134
2510
  }
1135
2511
  //#endregion
1136
- export { F as BASE_INPUT_STYLES, b as Button, C as CharacterCount, j as Checkbox, P as ClientOnly, L as Combobox, de as ConfirmModal, B as IconButton, I as Input, me as Modal, he as ModalProvider, ge as RadioOptions, _e as Select, ve as Switch, ye as Tabs, be as Textarea, Ae as ThemeToggle, M as useClientOnly, Y as useDisableHotkeysWhileMounted, q as useGlobalHotkeysStore, Ce as useIsClient, je as useRunAfterAnimation, $ as useThemeStore, N as withClientOnly };
2512
+ //#region src/hooks/use_is_client/with_client_only.tsx
2513
+ var jr = (e) => {
2514
+ function n(n) {
2515
+ return pe() ? /* @__PURE__ */ t(e, { ...n }) : null;
2516
+ }
2517
+ return n;
2518
+ };
2519
+ //#endregion
2520
+ export { z as BASE_INPUT_STYLES, P as Badge, ee as Button, te as CharacterCount, fe as Checkbox, me as ClientOnly, ge as Combobox, er as ConfirmModal, mn as ContextMenu, _n as CopyButton, yn as Highlight, Sn as IconButton, Tn as Input, Dn as Kbd, jn as Menu, Mn as MenuItem, nr as Modal, rr as ModalBody, Ln as ModalFooter, ir as ModalProvider, or as RadioOptions, sr as Select, cr as Switch, lr as Tabs, ur as Textarea, Tr as ThemeToggle, Ar as Tooltip, vn as splitIntoHighlightSegments, Xn as useDisableHotkeysWhileMounted, Jn as useGlobalHotkeysStore, pe as useIsClient, _r as useThemeStore, jr as withClientOnly };