@matthiaskrijgsman/mat-ui 0.0.39 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
3
- import * as R from "react";
4
- import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Pe, useLayoutEffect as It, useMemo as se } from "react";
5
- import { AnimatePresence as De, motion as J, animate as Kt } from "motion/react";
6
- import { IconExclamationCircleFilled as et, IconEyeOff as Gt, IconEye as Jt, IconPaperclip as Yt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as qt, IconCheck as Rt, IconChevronDown as be, IconBold as Qt, IconItalic as Zt, IconUnderline as en, IconList as Ye, IconListNumbers as tn, IconLink as nn, IconArrowBackUp as rn, IconArrowForwardUp as ln, IconDots as on, IconSearch as Fe, IconSearchOff as nt, IconInfoCircleFilled as sn, IconAlertTriangleFilled as an, IconChevronRight as cn, IconChevronUp as dn, IconSettings as mt, IconPlus as ft, IconTrash as un, IconMailFilled as mn } from "@tabler/icons-react";
3
+ import * as C from "react";
4
+ import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Le, useLayoutEffect as It, useMemo as se } from "react";
5
+ import { AnimatePresence as De, motion as q, animate as Kt } from "motion/react";
6
+ import { IconExclamationCircleFilled as et, IconEyeOff as Gt, IconEye as qt, IconPaperclip as Jt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as Yt, IconCheck as Rt, IconChevronDown as be, IconBold as Qt, IconItalic as Zt, IconUnderline as en, IconList as Je, IconListNumbers as tn, IconLink as nn, IconArrowBackUp as rn, IconArrowForwardUp as ln, IconDots as on, IconSearch as Fe, IconSearchOff as nt, IconInfoCircleFilled as sn, IconAlertTriangleFilled as an, IconChevronRight as cn, IconChevronUp as dn, IconSettings as mt, IconPlus as ft, IconTrash as un, IconMailFilled as mn } from "@tabler/icons-react";
7
7
  import { FloatingPortal as Me, flip as rt, shift as lt, size as ot, useFloating as st, autoUpdate as at, useDismiss as St, useInteractions as Dt, offset as fn, useListNavigation as hn, FloatingOverlay as Ot } from "@floating-ui/react";
8
8
  import { mergeRefs as pn } from "react-merge-refs";
9
9
  import { useDropzone as zt } from "react-dropzone";
@@ -17,10 +17,10 @@ import { OnChangePlugin as yn } from "@lexical/react/LexicalOnChangePlugin";
17
17
  import { AutoFocusPlugin as kn } from "@lexical/react/LexicalAutoFocusPlugin";
18
18
  import { LexicalErrorBoundary as Cn } from "@lexical/react/LexicalErrorBoundary";
19
19
  import { HeadingNode as In, QuoteNode as Rn, $isHeadingNode as Sn, $createHeadingNode as Dn } from "@lexical/rich-text";
20
- import { ListNode as Tt, ListItemNode as On, $isListNode as zn, REMOVE_LIST_COMMAND as ht, INSERT_UNORDERED_LIST_COMMAND as Tn, INSERT_ORDERED_LIST_COMMAND as Pn } from "@lexical/list";
21
- import { LinkNode as Ln, $isLinkNode as pt, TOGGLE_LINK_COMMAND as gt } from "@lexical/link";
20
+ import { ListNode as Tt, ListItemNode as On, $isListNode as zn, REMOVE_LIST_COMMAND as ht, INSERT_UNORDERED_LIST_COMMAND as Tn, INSERT_ORDERED_LIST_COMMAND as Ln } from "@lexical/list";
21
+ import { LinkNode as Pn, $isLinkNode as pt, TOGGLE_LINK_COMMAND as gt } from "@lexical/link";
22
22
  import { useLexicalComposerContext as ue } from "@lexical/react/LexicalComposerContext";
23
- import { CAN_UNDO_COMMAND as En, COMMAND_PRIORITY_LOW as Le, CAN_REDO_COMMAND as Fn, $getSelection as Pt, $isRangeSelection as Lt, $createParagraphNode as Mn, FORMAT_TEXT_COMMAND as je, UNDO_COMMAND as Bn, REDO_COMMAND as An, FOCUS_COMMAND as Un, BLUR_COMMAND as Wn } from "lexical";
23
+ import { CAN_UNDO_COMMAND as En, COMMAND_PRIORITY_LOW as Pe, CAN_REDO_COMMAND as Fn, $getSelection as Lt, $isRangeSelection as Pt, $createParagraphNode as Mn, FORMAT_TEXT_COMMAND as je, UNDO_COMMAND as Bn, REDO_COMMAND as An, FOCUS_COMMAND as Un, BLUR_COMMAND as Wn } from "lexical";
24
24
  import { mergeRegister as Et, $getNearestNodeOfType as Hn } from "@lexical/utils";
25
25
  import { $setBlocksType as bt } from "@lexical/selection";
26
26
  const m = (...n) => n.filter(Boolean).join(" "), $n = [
@@ -32,17 +32,17 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
32
32
  ], Se = (n) => {
33
33
  const {
34
34
  speed: t = 1,
35
- className: s
36
- } = n, l = 1 / t, r = 2 / t;
35
+ className: o
36
+ } = n, s = 1 / t, r = 2 / t;
37
37
  return /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
38
- J.div,
38
+ q.div,
39
39
  {
40
40
  role: "status",
41
- className: m("relative rounded-full", s),
41
+ className: m("relative rounded-full", o),
42
42
  animate: { rotate: 360 },
43
- transition: { repeat: 1 / 0, ease: "linear", duration: l },
43
+ transition: { repeat: 1 / 0, ease: "linear", duration: s },
44
44
  children: /* @__PURE__ */ e(
45
- J.div,
45
+ q.div,
46
46
  {
47
47
  className: "absolute inset-0 rounded-full",
48
48
  style: {
@@ -69,7 +69,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
69
69
  sm: "min-h-[var(--control-size-sm-height)]",
70
70
  md: "min-h-[var(--control-size-md-height)]",
71
71
  lg: "min-h-[var(--control-size-lg-height)]"
72
- }, Y = {
72
+ }, J = {
73
73
  sm: "text-[length:var(--control-size-sm-font-size)]",
74
74
  md: "text-[length:var(--control-size-md-font-size)]",
75
75
  lg: "text-[length:var(--control-size-lg-font-size)]"
@@ -130,16 +130,16 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
130
130
  white: "border button-white shadow-sm",
131
131
  black: "border button-black shadow-sm",
132
132
  transparent: "border button-transparent"
133
- }, Gn = R.forwardRef((n, t) => {
133
+ }, Gn = C.forwardRef((n, t) => {
134
134
  const {
135
- variant: s = "white",
136
- size: l = "md",
135
+ variant: o = "white",
136
+ size: s = "md",
137
137
  className: r,
138
- children: o,
138
+ children: l,
139
139
  loading: a = !1,
140
140
  Icon: i,
141
141
  IconRight: c,
142
- ...f
142
+ ...b
143
143
  } = n;
144
144
  return /* @__PURE__ */ d(
145
145
  "button",
@@ -147,43 +147,43 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
147
147
  ref: t,
148
148
  className: m(
149
149
  Vn,
150
- Kn[s],
151
- te[l],
152
- jn[l],
153
- Y[l],
154
- _n[l],
150
+ Kn[o],
151
+ te[s],
152
+ jn[s],
153
+ J[s],
154
+ _n[s],
155
155
  r
156
156
  ),
157
- ...f,
157
+ ...b,
158
158
  children: [
159
- a && /* @__PURE__ */ e(Se, { className: m(ae[l]) }),
159
+ a && /* @__PURE__ */ e(Se, { className: m(ae[s]) }),
160
160
  !a && /* @__PURE__ */ d(ce, { children: [
161
- i && /* @__PURE__ */ e(i, { className: m(ae[l], "-ml-1") }),
162
- o,
163
- c && /* @__PURE__ */ e(c, { className: m(ae[l], "-mr-1") })
161
+ i && /* @__PURE__ */ e(i, { className: m(ae[s], "-ml-1") }),
162
+ l,
163
+ c && /* @__PURE__ */ e(c, { className: m(ae[s], "-mr-1") })
164
164
  ] })
165
165
  ]
166
166
  }
167
167
  );
168
- }), Jn = `
168
+ }), qn = `
169
169
  inline-flex flex-row items-center justify-center
170
170
  button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1
171
171
  rounded-[var(--border-radius-input)]
172
172
  cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
173
173
  disabled:cursor-default
174
- `, Yn = {
174
+ `, Jn = {
175
175
  primary: "border button-primary shadow-sm",
176
176
  secondary: "border button-secondary shadow-sm",
177
177
  tertiary: "border button-tertiary",
178
178
  white: "border button-white shadow-sm",
179
179
  black: "border button-black shadow-sm",
180
180
  transparent: "border button-transparent"
181
- }, qe = R.forwardRef((n, t) => {
181
+ }, Ye = C.forwardRef((n, t) => {
182
182
  const {
183
- variant: s = "white",
184
- size: l = "md",
183
+ variant: o = "white",
184
+ size: s = "md",
185
185
  className: r,
186
- Icon: o,
186
+ Icon: l,
187
187
  ...a
188
188
  } = n;
189
189
  return /* @__PURE__ */ e(
@@ -191,16 +191,16 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
191
191
  {
192
192
  ref: t,
193
193
  className: m(
194
- Jn,
195
- Yn[s],
196
- At[l],
194
+ qn,
195
+ Jn[o],
196
+ At[s],
197
197
  r
198
198
  ),
199
199
  ...a,
200
- children: /* @__PURE__ */ e(o, { className: ae[l] })
200
+ children: /* @__PURE__ */ e(l, { className: ae[s] })
201
201
  }
202
202
  );
203
- }), qn = `
203
+ }), Yn = `
204
204
  inline-flex flex-row items-center justify-center
205
205
  button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1 rounded-full cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
206
206
  disabled:cursor-default
@@ -211,12 +211,12 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
211
211
  white: "border button-white shadow-sm",
212
212
  black: "border button-black shadow-sm",
213
213
  transparent: "border button-transparent"
214
- }, Ut = R.forwardRef((n, t) => {
214
+ }, Ut = C.forwardRef((n, t) => {
215
215
  const {
216
- variant: s = "white",
217
- size: l = "md",
216
+ variant: o = "white",
217
+ size: s = "md",
218
218
  className: r,
219
- Icon: o,
219
+ Icon: l,
220
220
  ...a
221
221
  } = n;
222
222
  return /* @__PURE__ */ e(
@@ -224,24 +224,24 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
224
224
  {
225
225
  ref: t,
226
226
  className: m(
227
- qn,
228
- Qn[s],
229
- At[l],
227
+ Yn,
228
+ Qn[o],
229
+ At[s],
230
230
  r
231
231
  ),
232
232
  ...a,
233
- children: /* @__PURE__ */ e(o, { className: ae[l] })
233
+ children: /* @__PURE__ */ e(l, { className: ae[s] })
234
234
  }
235
235
  );
236
- }), q = (n) => {
236
+ }), Y = (n) => {
237
237
  const {
238
238
  children: t
239
239
  } = n;
240
240
  return t ? /* @__PURE__ */ e("label", { className: "input-label font-medium mb-1", children: t }) : null;
241
- }, ne = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Zn = () => Ze(Q), he = R.forwardRef((n, t) => {
241
+ }, ne = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Zn = () => Ze(Q), he = C.forwardRef((n, t) => {
242
242
  const {
243
- children: s,
244
- className: l
243
+ children: o,
244
+ className: s
245
245
  } = n, r = Zn();
246
246
  return /* @__PURE__ */ e(
247
247
  "div",
@@ -250,9 +250,9 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
250
250
  className: m(
251
251
  "absolute top-1/2 -translate-y-1/2 flex flex-row items-center gap-1 pointer-events-none",
252
252
  Xn[r],
253
- l
253
+ s
254
254
  ),
255
- children: s
255
+ children: o
256
256
  }
257
257
  );
258
258
  }), V = (n) => {
@@ -268,14 +268,14 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
268
268
  }, Wt = (n) => {
269
269
  const {
270
270
  className: t,
271
- label: s,
272
- description: l,
271
+ label: o,
272
+ description: s,
273
273
  Icon: r,
274
- error: o,
274
+ error: l,
275
275
  buttonTray: a,
276
276
  size: i = "md",
277
277
  ...c
278
- } = n, f = !!o || !!a;
278
+ } = n, b = !!l || !!a;
279
279
  return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d(
280
280
  "div",
281
281
  {
@@ -284,7 +284,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
284
284
  t
285
285
  ),
286
286
  children: [
287
- /* @__PURE__ */ e(q, { children: s }),
287
+ /* @__PURE__ */ e(Y, { children: o }),
288
288
  /* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
289
289
  r && /* @__PURE__ */ e(r, { className: m(
290
290
  "input-icon absolute top-1/2 -translate-y-1/2",
@@ -297,77 +297,77 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
297
297
  className: m(
298
298
  "border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
299
299
  te[i],
300
- Y[i],
300
+ J[i],
301
301
  r ? Mt[i] : me[i],
302
- f ? fe[i] : it[i],
303
- o && "input-error"
302
+ b ? fe[i] : it[i],
303
+ l && "input-error"
304
304
  ),
305
305
  ...c
306
306
  }
307
307
  ),
308
308
  /* @__PURE__ */ d(he, { children: [
309
- o && /* @__PURE__ */ e(ne, {}),
309
+ l && /* @__PURE__ */ e(ne, {}),
310
310
  a
311
311
  ] })
312
312
  ] }),
313
- /* @__PURE__ */ e(V, { children: l }),
314
- /* @__PURE__ */ e(K, { children: o })
313
+ /* @__PURE__ */ e(V, { children: s }),
314
+ /* @__PURE__ */ e(K, { children: l })
315
315
  ]
316
316
  }
317
317
  ) });
318
318
  }, er = (n) => {
319
319
  const t = n.match(/^#?([0-9a-fA-F]{6})$/);
320
320
  if (!t) return null;
321
- const s = parseInt(t[1], 16);
322
- return [(s >> 16 & 255) / 255, (s >> 8 & 255) / 255, (s & 255) / 255];
323
- }, tr = (n, t, s) => {
324
- const l = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
325
- return "#" + l(n) + l(t) + l(s);
326
- }, nr = (n, t, s) => {
327
- const l = Math.max(n, t, s), r = Math.min(n, t, s), o = l - r;
321
+ const o = parseInt(t[1], 16);
322
+ return [(o >> 16 & 255) / 255, (o >> 8 & 255) / 255, (o & 255) / 255];
323
+ }, tr = (n, t, o) => {
324
+ const s = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
325
+ return "#" + s(n) + s(t) + s(o);
326
+ }, nr = (n, t, o) => {
327
+ const s = Math.max(n, t, o), r = Math.min(n, t, o), l = s - r;
328
328
  let a = 0;
329
- return o !== 0 && (l === n ? a = ((t - s) / o + 6) % 6 : l === t ? a = (s - n) / o + 2 : a = (n - t) / o + 4, a *= 60), [a, l === 0 ? 0 : o / l, l];
330
- }, rr = (n, t, s) => {
331
- const l = s * t, r = n / 60, o = l * (1 - Math.abs(r % 2 - 1));
329
+ return l !== 0 && (s === n ? a = ((t - o) / l + 6) % 6 : s === t ? a = (o - n) / l + 2 : a = (n - t) / l + 4, a *= 60), [a, s === 0 ? 0 : l / s, s];
330
+ }, rr = (n, t, o) => {
331
+ const s = o * t, r = n / 60, l = s * (1 - Math.abs(r % 2 - 1));
332
332
  let a = 0, i = 0, c = 0;
333
- r < 1 ? (a = l, i = o) : r < 2 ? (a = o, i = l) : r < 3 ? (i = l, c = o) : r < 4 ? (i = o, c = l) : r < 5 ? (a = o, c = l) : (a = l, c = o);
334
- const f = s - l;
335
- return [a + f, i + f, c + f];
336
- }, Re = (n, t, s) => {
337
- const [l, r, o] = rr(n, t, s);
338
- return tr(l, r, o);
333
+ r < 1 ? (a = s, i = l) : r < 2 ? (a = l, i = s) : r < 3 ? (i = s, c = l) : r < 4 ? (i = l, c = s) : r < 5 ? (a = l, c = s) : (a = s, c = l);
334
+ const b = o - s;
335
+ return [a + b, i + b, c + b];
336
+ }, Re = (n, t, o) => {
337
+ const [s, r, l] = rr(n, t, o);
338
+ return tr(s, r, l);
339
339
  }, vt = (n) => {
340
340
  const t = er(n);
341
341
  return t ? nr(t[0], t[1], t[2]) : null;
342
342
  }, lr = (n) => {
343
343
  const t = n.trim();
344
344
  if (!t) return null;
345
- const s = t.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
346
- if (s) {
347
- let a = s[1];
345
+ const o = t.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
346
+ if (o) {
347
+ let a = o[1];
348
348
  return a.length === 3 && (a = a.split("").map((i) => i + i).join("")), "#" + a.toUpperCase();
349
349
  }
350
350
  if (typeof document > "u") return null;
351
- const l = document.createElement("div");
352
- if (l.style.color = t, !l.style.color) return null;
353
- document.body.appendChild(l);
354
- const r = getComputedStyle(l).color;
355
- document.body.removeChild(l);
356
- const o = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
357
- return o ? "#" + [o[1], o[2], o[3]].map((a) => parseInt(a, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
351
+ const s = document.createElement("div");
352
+ if (s.style.color = t, !s.style.color) return null;
353
+ document.body.appendChild(s);
354
+ const r = getComputedStyle(s).color;
355
+ document.body.removeChild(s);
356
+ const l = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
357
+ return l ? "#" + [l[1], l[2], l[3]].map((a) => parseInt(a, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
358
358
  }, Xe = (n) => {
359
- const t = R.useRef(null), [s, l] = R.useState(!1), r = (o) => {
360
- t.current = null, l(!1), o.currentTarget.releasePointerCapture?.(o.pointerId);
359
+ const t = C.useRef(null), [o, s] = C.useState(!1), r = (l) => {
360
+ t.current = null, s(!1), l.currentTarget.releasePointerCapture?.(l.pointerId);
361
361
  };
362
362
  return {
363
- isDragging: s,
363
+ isDragging: o,
364
364
  bind: {
365
- onPointerDown: (o) => {
366
- const a = o.currentTarget;
367
- t.current = a.getBoundingClientRect(), a.setPointerCapture?.(o.pointerId), l(!0), n(o.clientX, o.clientY, t.current);
365
+ onPointerDown: (l) => {
366
+ const a = l.currentTarget;
367
+ t.current = a.getBoundingClientRect(), a.setPointerCapture?.(l.pointerId), s(!0), n(l.clientX, l.clientY, t.current);
368
368
  },
369
- onPointerMove: (o) => {
370
- t.current && n(o.clientX, o.clientY, t.current);
369
+ onPointerMove: (l) => {
370
+ t.current && n(l.clientX, l.clientY, t.current);
371
371
  },
372
372
  onPointerUp: r,
373
373
  onPointerCancel: r
@@ -380,16 +380,16 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
380
380
  }, ve = (n) => {
381
381
  const {
382
382
  className: t,
383
- children: s,
384
- padding: l = "md",
383
+ children: o,
384
+ padding: s = "md",
385
385
  ...r
386
386
  } = n;
387
387
  return /* @__PURE__ */ e(
388
388
  "div",
389
389
  {
390
- className: m(or, sr[l], t),
390
+ className: m(or, sr[s], t),
391
391
  ...r,
392
- children: s
392
+ children: o
393
393
  }
394
394
  );
395
395
  }, ar = {
@@ -405,12 +405,12 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
405
405
  left: "right center",
406
406
  "left-start": "top right",
407
407
  "left-end": "bottom right"
408
- }, Ht = R.memo(
409
- ({ open: n, children: t, className: s, floatingStyles: l, setFloating: r, placement: o, floatingProps: a }) => /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ e("div", { ref: r, style: l, className: "z-50", ...a, children: /* @__PURE__ */ e(
410
- J.div,
408
+ }, Ht = C.memo(
409
+ ({ open: n, children: t, className: o, floatingStyles: s, setFloating: r, placement: l, floatingProps: a }) => /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ e("div", { ref: r, style: s, className: "z-50", ...a, children: /* @__PURE__ */ e(
410
+ q.div,
411
411
  {
412
- className: s,
413
- style: { transformOrigin: ar[o] },
412
+ className: o,
413
+ style: { transformOrigin: ar[l] },
414
414
  initial: { opacity: 0, scale: 0.95 },
415
415
  animate: { opacity: 1, scale: 1 },
416
416
  exit: { opacity: 0, scale: 0.95 },
@@ -419,103 +419,103 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
419
419
  }
420
420
  ) }) }) })
421
421
  ), ct = (n) => {
422
- const { placement: t = "bottom", open: s, onOpenChange: l, fullWidth: r, minWidth: o, maxWidth: a } = n, i = R.useMemo(() => [
422
+ const { placement: t = "bottom", open: o, onOpenChange: s, fullWidth: r, minWidth: l, maxWidth: a } = n, i = C.useMemo(() => [
423
423
  rt({ padding: 8 }),
424
424
  lt({ padding: 8 }),
425
425
  ot({
426
- apply({ rects: b, elements: C }) {
427
- r && (C.floating.style.width = `${b.reference.width}px`), o && (C.floating.style.minWidth = `${o}px`), a && (C.floating.style.maxWidth = `${a}px`);
426
+ apply({ rects: u, elements: I }) {
427
+ r && (I.floating.style.width = `${u.reference.width}px`), l && (I.floating.style.minWidth = `${l}px`), a && (I.floating.style.maxWidth = `${a}px`);
428
428
  }
429
429
  })
430
- ], [r, a, o]), { refs: c, floatingStyles: f, context: w, placement: x } = st({
430
+ ], [r, a, l]), { refs: c, floatingStyles: b, context: R, placement: N } = st({
431
431
  placement: t,
432
- open: s,
433
- onOpenChange: l,
432
+ open: o,
433
+ onOpenChange: s,
434
434
  middleware: i,
435
435
  whileElementsMounted: at
436
- }), h = St(w, {
437
- enabled: !!l,
436
+ }), h = St(R, {
437
+ enabled: !!s,
438
438
  outsidePress: !0,
439
439
  escapeKey: !1
440
- }), { getFloatingProps: g } = Dt([h]), p = R.useRef({
441
- floatingStyles: f,
440
+ }), { getFloatingProps: v } = Dt([h]), f = C.useRef({
441
+ floatingStyles: b,
442
442
  setFloating: c.setFloating,
443
443
  placement: t,
444
- getFloatingProps: g
444
+ getFloatingProps: v
445
445
  });
446
- p.current = {
447
- floatingStyles: f,
446
+ f.current = {
447
+ floatingStyles: b,
448
448
  setFloating: c.setFloating,
449
- placement: x,
450
- getFloatingProps: g
449
+ placement: N,
450
+ getFloatingProps: v
451
451
  };
452
- const u = R.useMemo(() => {
453
- const b = (C) => {
454
- const { floatingStyles: v, setFloating: k, placement: I, getFloatingProps: D } = p.current, { className: O, open: P, children: L } = C;
452
+ const p = C.useMemo(() => {
453
+ const u = (I) => {
454
+ const { floatingStyles: x, setFloating: y, placement: k, getFloatingProps: S } = f.current, { className: O, open: P, children: T } = I;
455
455
  return /* @__PURE__ */ e(
456
456
  Ht,
457
457
  {
458
458
  open: P,
459
459
  className: O,
460
- floatingStyles: v,
461
- setFloating: k,
462
- placement: I,
463
- floatingProps: D(),
464
- children: L
460
+ floatingStyles: x,
461
+ setFloating: y,
462
+ placement: k,
463
+ floatingProps: S(),
464
+ children: T
465
465
  }
466
466
  );
467
467
  };
468
- return R.memo(b);
468
+ return C.memo(u);
469
469
  }, []);
470
470
  return {
471
471
  anchorRef: c.setReference,
472
- Popover: u
472
+ Popover: p
473
473
  };
474
474
  }, xe = (n, t) => {
475
475
  _(() => {
476
476
  if (!n) return;
477
- const s = (l) => {
478
- l.key === "Escape" && t();
477
+ const o = (s) => {
478
+ s.key === "Escape" && t();
479
479
  };
480
- return document.addEventListener("keydown", s), () => {
481
- document.removeEventListener("keydown", s);
480
+ return document.addEventListener("keydown", o), () => {
481
+ document.removeEventListener("keydown", o);
482
482
  };
483
483
  }, [n, t]);
484
484
  }, ir = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", cr = "linear-gradient(to right, #fff, rgba(255,255,255,0))", dr = "linear-gradient(to top, #000, rgba(0,0,0,0))", Ve = "0 0 0 1px rgba(0,0,0,0.15)", ur = 14, mr = 28, fr = 6, hr = 8, Ke = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 }, ye = (n) => {
485
- const t = n ? mr : ur, s = t / 2;
485
+ const t = n ? mr : ur, o = t / 2;
486
486
  return {
487
487
  width: t,
488
488
  height: t,
489
- marginLeft: -s,
490
- marginTop: -s,
489
+ marginLeft: -o,
490
+ marginTop: -o,
491
491
  borderRadius: n ? hr : fr
492
492
  };
493
493
  }, Te = (n) => Math.max(0, Math.min(1, n)), xt = (n, t) => {
494
494
  Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(n, t), n.dispatchEvent(new Event("input", { bubbles: !0 }));
495
495
  }, pr = ({ value: n, onChange: t }) => {
496
- const [s, l] = W(() => vt(n) ?? [0, 0, 1]), r = Ce(Re(s[0], s[1], s[2]));
496
+ const [o, s] = W(() => vt(n) ?? [0, 0, 1]), r = Ce(Re(o[0], o[1], o[2]));
497
497
  _(() => {
498
498
  if ((n || "").toUpperCase() === r.current) return;
499
- const u = vt(n);
500
- u && l(u);
499
+ const p = vt(n);
500
+ p && s(p);
501
501
  }, [n]);
502
- const o = (u) => {
503
- l(u);
504
- const b = Re(u[0], u[1], u[2]);
505
- r.current = b, t(b);
506
- }, [a, i, c] = s, f = Re(a, 1, 1), w = Re(a, i, 1), x = Re(a, i, c), h = Xe((u, b, C) => {
507
- o([a, Te((u - C.left) / C.width), 1 - Te((b - C.top) / C.height)]);
508
- }), g = Xe((u, b, C) => {
509
- o([Te((u - C.left) / C.width) * 360, i, c]);
510
- }), p = Xe((u, b, C) => {
511
- o([a, i, Te((u - C.left) / C.width)]);
502
+ const l = (p) => {
503
+ s(p);
504
+ const u = Re(p[0], p[1], p[2]);
505
+ r.current = u, t(u);
506
+ }, [a, i, c] = o, b = Re(a, 1, 1), R = Re(a, i, 1), N = Re(a, i, c), h = Xe((p, u, I) => {
507
+ l([a, Te((p - I.left) / I.width), 1 - Te((u - I.top) / I.height)]);
508
+ }), v = Xe((p, u, I) => {
509
+ l([Te((p - I.left) / I.width) * 360, i, c]);
510
+ }), f = Xe((p, u, I) => {
511
+ l([a, i, Te((p - I.left) / I.width)]);
512
512
  });
513
513
  return /* @__PURE__ */ d(
514
514
  "div",
515
515
  {
516
516
  className: "flex flex-col gap-3",
517
517
  style: { width: 220, userSelect: "none" },
518
- onMouseDown: (u) => u.preventDefault(),
518
+ onMouseDown: (p) => p.preventDefault(),
519
519
  children: [
520
520
  /* @__PURE__ */ d(
521
521
  "div",
@@ -532,7 +532,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
532
532
  "div",
533
533
  {
534
534
  className: "absolute inset-0 rounded-md overflow-hidden border color-picker-surface",
535
- style: { backgroundColor: f },
535
+ style: { backgroundColor: b },
536
536
  children: [
537
537
  /* @__PURE__ */ e(
538
538
  "div",
@@ -552,14 +552,14 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
552
552
  }
553
553
  ),
554
554
  /* @__PURE__ */ e(
555
- J.div,
555
+ q.div,
556
556
  {
557
557
  className: "absolute pointer-events-none border-1 border-white",
558
558
  style: {
559
559
  left: `${i * 100}%`,
560
560
  top: `${(1 - c) * 100}%`,
561
561
  boxShadow: Ve,
562
- backgroundColor: x
562
+ backgroundColor: N
563
563
  },
564
564
  initial: ye(!1),
565
565
  animate: ye(h.isDragging),
@@ -579,19 +579,19 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
579
579
  touchAction: "none",
580
580
  cursor: "ew-resize"
581
581
  },
582
- ...g.bind,
582
+ ...v.bind,
583
583
  children: /* @__PURE__ */ e(
584
- J.div,
584
+ q.div,
585
585
  {
586
586
  className: "absolute pointer-events-none border-1 border-white",
587
587
  style: {
588
588
  top: "50%",
589
589
  left: `${a / 360 * 100}%`,
590
- backgroundColor: f,
590
+ backgroundColor: b,
591
591
  boxShadow: Ve
592
592
  },
593
593
  initial: ye(!1),
594
- animate: ye(g.isDragging),
594
+ animate: ye(v.isDragging),
595
595
  transition: Ke
596
596
  }
597
597
  )
@@ -603,23 +603,23 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
603
603
  className: "relative w-full rounded-md",
604
604
  style: {
605
605
  height: 12,
606
- background: `linear-gradient(to right, #000, ${w})`,
606
+ background: `linear-gradient(to right, #000, ${R})`,
607
607
  touchAction: "none",
608
608
  cursor: "ew-resize"
609
609
  },
610
- ...p.bind,
610
+ ...f.bind,
611
611
  children: /* @__PURE__ */ e(
612
- J.div,
612
+ q.div,
613
613
  {
614
614
  className: "absolute pointer-events-none border-1 border-white",
615
615
  style: {
616
616
  top: "50%",
617
617
  left: `${c * 100}%`,
618
- backgroundColor: x,
618
+ backgroundColor: N,
619
619
  boxShadow: Ve
620
620
  },
621
621
  initial: ye(!1),
622
- animate: ye(p.isDragging),
622
+ animate: ye(f.isDragging),
623
623
  transition: Ke
624
624
  }
625
625
  )
@@ -631,35 +631,35 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
631
631
  }, xl = (n) => {
632
632
  const {
633
633
  className: t,
634
- label: s,
635
- description: l,
634
+ label: o,
635
+ description: s,
636
636
  error: r,
637
- buttonTray: o,
637
+ buttonTray: l,
638
638
  size: a = "md",
639
639
  value: i,
640
640
  defaultValue: c,
641
- onChange: f,
642
- onBlur: w,
643
- onFocus: x,
641
+ onChange: b,
642
+ onBlur: R,
643
+ onFocus: N,
644
644
  ...h
645
- } = n, [g, p] = W(
645
+ } = n, [v, f] = W(
646
646
  i != null ? String(i) : c != null ? String(c) : ""
647
- ), [u, b] = W(!1), C = Ce(null), v = i != null ? String(i) : g, k = v || "white";
648
- xe(u, () => b(!1));
649
- const { anchorRef: I, Popover: D } = ct({
647
+ ), [p, u] = W(!1), I = Ce(null), x = i != null ? String(i) : v, y = x || "white";
648
+ xe(p, () => u(!1));
649
+ const { anchorRef: k, Popover: S } = ct({
650
650
  placement: "bottom-start",
651
- open: u,
652
- onOpenChange: b
653
- }), O = (y) => {
654
- p(y.target.value), f?.(y);
655
- }, P = (y) => {
656
- b(!0), x?.(y);
657
- }, L = (y) => {
658
- const A = y.target.value, z = lr(A);
659
- z && z !== A && C.current && xt(C.current, z), b(!1), w?.(y);
660
- }, T = (y) => {
661
- C.current && xt(C.current, y);
662
- }, N = !!r || !!o;
651
+ open: p,
652
+ onOpenChange: u
653
+ }), O = (g) => {
654
+ f(g.target.value), b?.(g);
655
+ }, P = (g) => {
656
+ u(!0), N?.(g);
657
+ }, T = (g) => {
658
+ const M = g.target.value, L = lr(M);
659
+ L && L !== M && I.current && xt(I.current, L), u(!1), R?.(g);
660
+ }, z = (g) => {
661
+ I.current && xt(I.current, g);
662
+ }, w = !!r || !!l;
663
663
  return /* @__PURE__ */ e(Q.Provider, { value: a, children: /* @__PURE__ */ d(
664
664
  "div",
665
665
  {
@@ -668,8 +668,8 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
668
668
  t
669
669
  ),
670
670
  children: [
671
- /* @__PURE__ */ e(q, { children: s }),
672
- /* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: I, children: [
671
+ /* @__PURE__ */ e(Y, { children: o }),
672
+ /* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: k, children: [
673
673
  /* @__PURE__ */ e(
674
674
  "div",
675
675
  {
@@ -678,36 +678,36 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
678
678
  ae[a],
679
679
  Bt[a]
680
680
  ),
681
- style: { backgroundColor: k }
681
+ style: { backgroundColor: y }
682
682
  }
683
683
  ),
684
684
  /* @__PURE__ */ e(
685
685
  "input",
686
686
  {
687
- ref: C,
687
+ ref: I,
688
688
  className: m(
689
689
  "border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
690
690
  te[a],
691
- Y[a],
691
+ J[a],
692
692
  Mt[a],
693
- N ? fe[a] : it[a],
693
+ w ? fe[a] : it[a],
694
694
  r && "input-error"
695
695
  ),
696
- value: i ?? g,
696
+ value: i ?? v,
697
697
  onChange: O,
698
698
  onFocus: P,
699
- onBlur: L,
700
- onClick: () => b(!0),
699
+ onBlur: T,
700
+ onClick: () => u(!0),
701
701
  ...h
702
702
  }
703
703
  ),
704
704
  /* @__PURE__ */ d(he, { children: [
705
705
  r && /* @__PURE__ */ e(ne, {}),
706
- o
706
+ l
707
707
  ] }),
708
- /* @__PURE__ */ e(D, { open: u, children: /* @__PURE__ */ e(ve, { padding: "md", children: /* @__PURE__ */ e(pr, { value: v, onChange: T }) }) })
708
+ /* @__PURE__ */ e(S, { open: p, children: /* @__PURE__ */ e(ve, { padding: "md", children: /* @__PURE__ */ e(pr, { value: x, onChange: z }) }) })
709
709
  ] }),
710
- /* @__PURE__ */ e(V, { children: l }),
710
+ /* @__PURE__ */ e(V, { children: s }),
711
711
  /* @__PURE__ */ e(K, { children: r })
712
712
  ]
713
713
  }
@@ -715,7 +715,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
715
715
  }, Z = (n) => {
716
716
  const {
717
717
  onClick: t,
718
- Icon: s
718
+ Icon: o
719
719
  } = n;
720
720
  return /* @__PURE__ */ e(
721
721
  "div",
@@ -725,59 +725,59 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
725
725
  "h-6 w-6 select-none rounded-full p-0.5",
726
726
  t && "ring-0 transition-all duration-150 input-icon-button-interactive active:ring-2 cursor-pointer hover:ring-4 group pointer-events-auto"
727
727
  ),
728
- children: /* @__PURE__ */ e(s, { className: m("h-5 w-5 input-icon-button-icon", t && "group-active:scale-[0.8] transition-transform origin-center") })
728
+ children: /* @__PURE__ */ e(o, { className: m("h-5 w-5 input-icon-button-icon", t && "group-active:scale-[0.8] transition-transform origin-center") })
729
729
  }
730
730
  );
731
731
  }, wl = (n) => {
732
732
  const {
733
733
  type: t = "password",
734
- enableShowPasswordToggle: s = !0,
735
- ...l
736
- } = n, [r, o] = W(!1);
734
+ enableShowPasswordToggle: o = !0,
735
+ ...s
736
+ } = n, [r, l] = W(!1);
737
737
  return /* @__PURE__ */ e(
738
738
  Wt,
739
739
  {
740
740
  type: r ? "text" : t,
741
- buttonTray: s ? /* @__PURE__ */ e(Z, { Icon: r ? Gt : Jt, onClick: () => {
742
- o(!r);
741
+ buttonTray: o ? /* @__PURE__ */ e(Z, { Icon: r ? Gt : qt, onClick: () => {
742
+ l(!r);
743
743
  } }) : void 0,
744
- ...l
744
+ ...s
745
745
  }
746
746
  );
747
747
  }, Nl = (n) => {
748
748
  const {
749
749
  className: t,
750
- label: s,
751
- description: l,
750
+ label: o,
751
+ description: s,
752
752
  error: r,
753
- size: o = "md",
753
+ size: l = "md",
754
754
  autogrow: a = !1,
755
755
  maxRows: i,
756
756
  ref: c,
757
- onChange: f,
758
- ...w
759
- } = n, x = R.useRef(null), h = R.useCallback(() => {
760
- const p = x.current;
761
- if (!p) return;
762
- p.style.height = "auto";
763
- let u = p.scrollHeight;
757
+ onChange: b,
758
+ ...R
759
+ } = n, N = C.useRef(null), h = C.useCallback(() => {
760
+ const f = N.current;
761
+ if (!f) return;
762
+ f.style.height = "auto";
763
+ let p = f.scrollHeight;
764
764
  if (i) {
765
- const b = window.getComputedStyle(p), C = parseFloat(b.lineHeight), v = parseFloat(b.paddingTop), k = parseFloat(b.paddingBottom), I = parseFloat(b.borderTopWidth), D = parseFloat(b.borderBottomWidth), O = C * i + v + k + I + D;
766
- u = Math.min(p.scrollHeight, O);
765
+ const u = window.getComputedStyle(f), I = parseFloat(u.lineHeight), x = parseFloat(u.paddingTop), y = parseFloat(u.paddingBottom), k = parseFloat(u.borderTopWidth), S = parseFloat(u.borderBottomWidth), O = I * i + x + y + k + S;
766
+ p = Math.min(f.scrollHeight, O);
767
767
  }
768
- p.style.height = `${u}px`;
768
+ f.style.height = `${p}px`;
769
769
  }, [i]);
770
- R.useLayoutEffect(() => {
770
+ C.useLayoutEffect(() => {
771
771
  if (!a) {
772
- x.current && (x.current.style.height = "");
772
+ N.current && (N.current.style.height = "");
773
773
  return;
774
774
  }
775
775
  h();
776
- }, [a, h, n.value, n.defaultValue, o]);
777
- const g = (p) => {
778
- f?.(p), a && h();
776
+ }, [a, h, n.value, n.defaultValue, l]);
777
+ const v = (f) => {
778
+ b?.(f), a && h();
779
779
  };
780
- return /* @__PURE__ */ e(Q.Provider, { value: o, children: /* @__PURE__ */ d(
780
+ return /* @__PURE__ */ e(Q.Provider, { value: l, children: /* @__PURE__ */ d(
781
781
  "div",
782
782
  {
783
783
  className: m(
@@ -785,28 +785,28 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
785
785
  t
786
786
  ),
787
787
  children: [
788
- /* @__PURE__ */ e(q, { children: s }),
788
+ /* @__PURE__ */ e(Y, { children: o }),
789
789
  /* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
790
790
  /* @__PURE__ */ e(
791
791
  "textarea",
792
792
  {
793
- ref: c ? pn([c, x]) : x,
794
- onChange: g,
793
+ ref: c ? pn([c, N]) : N,
794
+ onChange: v,
795
795
  className: m(
796
796
  "py-2.5 border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
797
- Ft[o],
798
- Y[o],
799
- me[o],
800
- r ? fe[o] : it[o],
797
+ Ft[l],
798
+ J[l],
799
+ me[l],
800
+ r ? fe[l] : it[l],
801
801
  r && "input-error",
802
802
  a && (i ? "resize-none overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : "resize-none overflow-hidden")
803
803
  ),
804
- ...w
804
+ ...R
805
805
  }
806
806
  ),
807
807
  /* @__PURE__ */ e(he, { className: "top-3.5 translate-y-0", children: r && /* @__PURE__ */ e(ne, {}) })
808
808
  ] }),
809
- /* @__PURE__ */ e(V, { children: l }),
809
+ /* @__PURE__ */ e(V, { children: s }),
810
810
  /* @__PURE__ */ e(K, { children: r })
811
811
  ]
812
812
  }
@@ -814,10 +814,10 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
814
814
  }, yl = (n) => {
815
815
  const {
816
816
  className: t,
817
- label: s,
818
- description: l,
817
+ label: o,
818
+ description: s,
819
819
  error: r,
820
- ...o
820
+ ...l
821
821
  } = n;
822
822
  return /* @__PURE__ */ d(
823
823
  "div",
@@ -833,15 +833,15 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
833
833
  {
834
834
  type: "radio",
835
835
  className: "h-6 w-6 shrink-0 rounded-full border check-base shadow-sm ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
836
- ...o
836
+ ...l
837
837
  }
838
838
  ),
839
- s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
839
+ o && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
840
840
  "input-label font-medium mb-1",
841
841
  n.id && "cursor-pointer"
842
- ), children: s })
842
+ ), children: o })
843
843
  ] }),
844
- /* @__PURE__ */ e(V, { children: l }),
844
+ /* @__PURE__ */ e(V, { children: s }),
845
845
  /* @__PURE__ */ e(K, { children: r })
846
846
  ]
847
847
  }
@@ -849,10 +849,10 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
849
849
  }, kl = (n) => {
850
850
  const {
851
851
  className: t,
852
- label: s,
853
- description: l,
852
+ label: o,
853
+ description: s,
854
854
  error: r,
855
- ...o
855
+ ...l
856
856
  } = n;
857
857
  return /* @__PURE__ */ d(
858
858
  "div",
@@ -869,7 +869,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
869
869
  {
870
870
  type: "checkbox",
871
871
  className: "appearance-none absolute inset-0 h-6 w-10 rounded-full checked:bg-transparent border-0 toggle-input ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
872
- ...o
872
+ ...l
873
873
  }
874
874
  ),
875
875
  /* @__PURE__ */ e("div", { className: m(
@@ -880,12 +880,12 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
880
880
  n.checked && "translate-x-3.5 "
881
881
  ) }) })
882
882
  ] }),
883
- s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
883
+ o && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
884
884
  "input-label font-medium mb-1",
885
885
  n.id && "cursor-pointer"
886
- ), children: s })
886
+ ), children: o })
887
887
  ] }),
888
- /* @__PURE__ */ e(V, { children: l }),
888
+ /* @__PURE__ */ e(V, { children: s }),
889
889
  /* @__PURE__ */ e(K, { children: r })
890
890
  ]
891
891
  }
@@ -893,10 +893,10 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
893
893
  }, Cl = (n) => {
894
894
  const {
895
895
  className: t,
896
- label: s,
897
- description: l,
896
+ label: o,
897
+ description: s,
898
898
  error: r,
899
- ...o
899
+ ...l
900
900
  } = n;
901
901
  return /* @__PURE__ */ d(
902
902
  "div",
@@ -912,15 +912,15 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
912
912
  {
913
913
  type: "checkbox",
914
914
  className: "h-6 w-6 shrink-0 rounded-lg border check-base shadow-sm ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
915
- ...o
915
+ ...l
916
916
  }
917
917
  ),
918
- s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
918
+ o && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
919
919
  "input-label font-medium mb-1",
920
920
  n.id && "cursor-pointer"
921
- ), children: s })
921
+ ), children: o })
922
922
  ] }),
923
- /* @__PURE__ */ e(V, { children: l }),
923
+ /* @__PURE__ */ e(V, { children: s }),
924
924
  /* @__PURE__ */ e(K, { children: r })
925
925
  ]
926
926
  }
@@ -940,82 +940,82 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
940
940
  }, Il = (n) => {
941
941
  const {
942
942
  label: t,
943
- description: s,
944
- error: l,
943
+ description: o,
944
+ error: s,
945
945
  placeholder: r = "No file chosen",
946
- buttonText: o = "Choose",
947
- Icon: a = Yt,
946
+ buttonText: l = "Choose",
947
+ Icon: a = Jt,
948
948
  size: i = "md",
949
949
  value: c,
950
- isUploaded: f = !1,
951
- isUploading: w = !1,
952
- onChange: x,
950
+ isUploaded: b = !1,
951
+ isUploading: R = !1,
952
+ onChange: N,
953
953
  onDropRejected: h,
954
- accept: g,
955
- maxSize: p,
956
- minSize: u,
957
- disabled: b = !1,
958
- className: C
959
- } = n, v = async (T) => {
960
- const [N] = T;
961
- N && await x?.(N);
954
+ accept: v,
955
+ maxSize: f,
956
+ minSize: p,
957
+ disabled: u = !1,
958
+ className: I
959
+ } = n, x = async (z) => {
960
+ const [w] = z;
961
+ w && await N?.(w);
962
962
  }, {
963
- getRootProps: k,
964
- getInputProps: I,
965
- open: D,
963
+ getRootProps: y,
964
+ getInputProps: k,
965
+ open: S,
966
966
  isDragActive: O,
967
967
  isFocused: P
968
968
  } = zt({
969
969
  multiple: !1,
970
- accept: g,
971
- maxSize: p,
972
- minSize: u,
973
- disabled: b,
974
- onDrop: v,
970
+ accept: v,
971
+ maxSize: f,
972
+ minSize: p,
973
+ disabled: u,
974
+ onDrop: x,
975
975
  onDropRejected: h
976
- }), L = c?.name;
977
- return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", C), children: [
978
- /* @__PURE__ */ e(q, { children: t }),
976
+ }), T = c?.name;
977
+ return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", I), children: [
978
+ /* @__PURE__ */ e(Y, { children: t }),
979
979
  /* @__PURE__ */ d(
980
980
  "div",
981
981
  {
982
- ...k({
982
+ ...y({
983
983
  className: m(
984
984
  "flex flex-row items-center",
985
985
  "border input-base rounded-xl shadow-sm transition-all duration-150",
986
986
  "ring-0 focus:outline-none",
987
987
  (P || O) && "ring-4",
988
- l && "input-error",
989
- b && "opacity-60 cursor-not-allowed",
988
+ s && "input-error",
989
+ u && "opacity-60 cursor-not-allowed",
990
990
  te[i],
991
991
  me[i],
992
992
  "gap-3"
993
993
  )
994
994
  }),
995
995
  children: [
996
- /* @__PURE__ */ e("input", { ...I() }),
996
+ /* @__PURE__ */ e("input", { ...k() }),
997
997
  /* @__PURE__ */ e(a, { className: m("input-icon shrink-0", ae[i]) }),
998
998
  /* @__PURE__ */ e(
999
999
  "span",
1000
1000
  {
1001
1001
  className: m(
1002
1002
  "flex-1 truncate",
1003
- Y[i],
1004
- !L && "text-[var(--color-input-placeholder)]"
1003
+ J[i],
1004
+ !T && "text-[var(--color-input-placeholder)]"
1005
1005
  ),
1006
- children: L ?? r
1006
+ children: T ?? r
1007
1007
  }
1008
1008
  ),
1009
- l && /* @__PURE__ */ e(ne, {}),
1010
- w && !l && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
1011
- f && !w && !l && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1009
+ s && /* @__PURE__ */ e(ne, {}),
1010
+ R && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
1011
+ b && !R && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1012
1012
  /* @__PURE__ */ e(
1013
1013
  "button",
1014
1014
  {
1015
1015
  type: "button",
1016
- disabled: b,
1017
- onClick: (T) => {
1018
- T.stopPropagation(), D();
1016
+ disabled: u,
1017
+ onClick: (z) => {
1018
+ z.stopPropagation(), S();
1019
1019
  },
1020
1020
  className: m(
1021
1021
  "inline-flex flex-row items-center justify-center shrink-0",
@@ -1028,24 +1028,24 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1028
1028
  br[i],
1029
1029
  vr[i]
1030
1030
  ),
1031
- children: o
1031
+ children: l
1032
1032
  }
1033
1033
  )
1034
1034
  ]
1035
1035
  }
1036
1036
  ),
1037
- /* @__PURE__ */ e(V, { children: s }),
1038
- /* @__PURE__ */ e(K, { children: l })
1037
+ /* @__PURE__ */ e(V, { children: o }),
1038
+ /* @__PURE__ */ e(K, { children: s })
1039
1039
  ] }) });
1040
1040
  }, xr = (n) => n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(1)} KB` : n < 1024 * 1024 * 1024 ? `${(n / (1024 * 1024)).toFixed(1)} MB` : `${(n / (1024 * 1024 * 1024)).toFixed(1)} GB`, wr = (n) => {
1041
1041
  const {
1042
1042
  file: t,
1043
- isUploaded: s = !1,
1044
- isUploading: l = !1,
1043
+ isUploaded: o = !1,
1044
+ isUploading: s = !1,
1045
1045
  error: r,
1046
- onRemove: o,
1046
+ onRemove: l,
1047
1047
  className: a
1048
- } = n, i = l || s || !!r;
1048
+ } = n, i = s || o || !!r;
1049
1049
  return /* @__PURE__ */ d(
1050
1050
  "div",
1051
1051
  {
@@ -1057,16 +1057,16 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1057
1057
  a
1058
1058
  ),
1059
1059
  children: [
1060
- i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) : l ? /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) : /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1060
+ i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) : s ? /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) : /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1061
1061
  /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 font-medium truncate", children: t.name }),
1062
1062
  /* @__PURE__ */ e("div", { className: "shrink-0 text-sm text-[var(--color-input-description-text)]", children: xr(t.size) }),
1063
- o && /* @__PURE__ */ e(
1064
- qe,
1063
+ l && /* @__PURE__ */ e(
1064
+ Ye,
1065
1065
  {
1066
1066
  variant: "transparent",
1067
1067
  size: "sm",
1068
1068
  Icon: de,
1069
- onClick: o,
1069
+ onClick: l,
1070
1070
  "aria-label": "Remove file",
1071
1071
  className: "shrink-0"
1072
1072
  }
@@ -1077,58 +1077,58 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1077
1077
  }, Rl = (n) => {
1078
1078
  const {
1079
1079
  label: t,
1080
- description: s,
1081
- error: l,
1080
+ description: o,
1081
+ error: s,
1082
1082
  title: r = "Drop files here",
1083
- hint: o,
1084
- Icon: a = qt,
1083
+ hint: l,
1084
+ Icon: a = Yt,
1085
1085
  onUpload: i,
1086
1086
  onFileRemoved: c,
1087
- onDropRejected: f,
1088
- renderFileTile: w,
1089
- accept: x,
1087
+ onDropRejected: b,
1088
+ renderFileTile: R,
1089
+ accept: N,
1090
1090
  maxSize: h,
1091
- minSize: g,
1092
- maxFiles: p,
1093
- disabled: u = !1,
1094
- className: b
1095
- } = n, [C, v] = W([]), k = Ce(0), I = (y, A) => {
1096
- v((z) => z.map(($) => $.id === y ? { ...$, ...A } : $));
1097
- }, D = (y) => {
1098
- if (y.length === 0) return;
1099
- const A = y.map((z) => ({
1100
- id: String(++k.current),
1101
- file: z,
1091
+ minSize: v,
1092
+ maxFiles: f,
1093
+ disabled: p = !1,
1094
+ className: u
1095
+ } = n, [I, x] = W([]), y = Ce(0), k = (g, M) => {
1096
+ x((L) => L.map(($) => $.id === g ? { ...$, ...M } : $));
1097
+ }, S = (g) => {
1098
+ if (g.length === 0) return;
1099
+ const M = g.map((L) => ({
1100
+ id: String(++y.current),
1101
+ file: L,
1102
1102
  status: i ? "uploading" : "idle"
1103
1103
  }));
1104
- if (v((z) => [...z, ...A]), !!i)
1105
- for (const z of A)
1106
- Promise.resolve().then(() => i(z.file)).then(() => I(z.id, { status: "uploaded" })).catch(($) => {
1107
- I(z.id, {
1104
+ if (x((L) => [...L, ...M]), !!i)
1105
+ for (const L of M)
1106
+ Promise.resolve().then(() => i(L.file)).then(() => k(L.id, { status: "uploaded" })).catch(($) => {
1107
+ k(L.id, {
1108
1108
  status: "error",
1109
1109
  error: $ instanceof Error ? $ : new Error(String($))
1110
1110
  });
1111
1111
  });
1112
- }, O = (y) => {
1113
- const A = C.find((z) => z.id === y);
1114
- v((z) => z.filter(($) => $.id !== y)), A && c?.(A.file);
1112
+ }, O = (g) => {
1113
+ const M = I.find((L) => L.id === g);
1114
+ x((L) => L.filter(($) => $.id !== g)), M && c?.(M.file);
1115
1115
  }, {
1116
1116
  getRootProps: P,
1117
- getInputProps: L,
1118
- isDragActive: T,
1119
- isFocused: N
1117
+ getInputProps: T,
1118
+ isDragActive: z,
1119
+ isFocused: w
1120
1120
  } = zt({
1121
1121
  multiple: !0,
1122
- accept: x,
1122
+ accept: N,
1123
1123
  maxSize: h,
1124
- minSize: g,
1125
- maxFiles: p,
1126
- disabled: u,
1127
- onDrop: D,
1128
- onDropRejected: f
1124
+ minSize: v,
1125
+ maxFiles: f,
1126
+ disabled: p,
1127
+ onDrop: S,
1128
+ onDropRejected: b
1129
1129
  });
1130
- return /* @__PURE__ */ d("div", { className: m("flex flex-col", b), children: [
1131
- /* @__PURE__ */ e(q, { children: t }),
1130
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col", u), children: [
1131
+ /* @__PURE__ */ e(Y, { children: t }),
1132
1132
  /* @__PURE__ */ d(
1133
1133
  "div",
1134
1134
  {
@@ -1138,38 +1138,38 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1138
1138
  "border-2 border-dashed input-base rounded-xl bg-transparent!",
1139
1139
  "py-10 px-6 cursor-pointer transition-all duration-150",
1140
1140
  "ring-0 focus:outline-none",
1141
- (N || T) && "ring-4",
1142
- l && "input-error",
1143
- u && "opacity-60 cursor-not-allowed"
1141
+ (w || z) && "ring-4",
1142
+ s && "input-error",
1143
+ p && "opacity-60 cursor-not-allowed"
1144
1144
  )
1145
1145
  }),
1146
1146
  children: [
1147
- /* @__PURE__ */ e("input", { ...L() }),
1147
+ /* @__PURE__ */ e("input", { ...T() }),
1148
1148
  /* @__PURE__ */ e("div", { className: "h-14 w-14 rounded-xl flex items-center justify-center bg-[var(--color-input-file-icon-bg)] mb-2", children: /* @__PURE__ */ e(a, { className: "h-7 w-7 input-icon" }) }),
1149
1149
  /* @__PURE__ */ e("div", { className: "text-base font-semibold", children: r }),
1150
- o && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: o })
1150
+ l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: l })
1151
1151
  ]
1152
1152
  }
1153
1153
  ),
1154
- C.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: C.map((y) => {
1155
- const A = {
1156
- file: y.file,
1157
- isUploading: y.status === "uploading",
1158
- isUploaded: y.status === "uploaded",
1159
- error: y.status === "error" ? y.error?.message : void 0,
1160
- onRemove: () => O(y.id)
1154
+ I.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: I.map((g) => {
1155
+ const M = {
1156
+ file: g.file,
1157
+ isUploading: g.status === "uploading",
1158
+ isUploaded: g.status === "uploaded",
1159
+ error: g.status === "error" ? g.error?.message : void 0,
1160
+ onRemove: () => O(g.id)
1161
1161
  };
1162
- return /* @__PURE__ */ e(R.Fragment, { children: w ? w(y.file, A) : /* @__PURE__ */ e(wr, { ...A }) }, y.id);
1162
+ return /* @__PURE__ */ e(C.Fragment, { children: R ? R(g.file, M) : /* @__PURE__ */ e(wr, { ...M }) }, g.id);
1163
1163
  }) }),
1164
- /* @__PURE__ */ e(V, { children: s }),
1165
- /* @__PURE__ */ e(K, { children: l })
1164
+ /* @__PURE__ */ e(V, { children: o }),
1165
+ /* @__PURE__ */ e(K, { children: s })
1166
1166
  ] });
1167
1167
  }, Nr = [
1168
1168
  In,
1169
1169
  Rn,
1170
1170
  Tt,
1171
1171
  On,
1172
- Ln
1172
+ Pn
1173
1173
  ], wt = {
1174
1174
  paragraph: "lexical-paragraph",
1175
1175
  heading: {
@@ -1208,25 +1208,25 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1208
1208
  tone: "light",
1209
1209
  orientation: "horizontal"
1210
1210
  }), we = () => Ze(Ae), _t = () => {
1211
- const [n] = ue(), [t, s] = W($t);
1211
+ const [n] = ue(), [t, o] = W($t);
1212
1212
  return _(() => {
1213
- const l = () => {
1213
+ const s = () => {
1214
1214
  n.getEditorState().read(() => {
1215
- const r = Pt();
1216
- if (!Lt(r))
1215
+ const r = Lt();
1216
+ if (!Pt(r))
1217
1217
  return;
1218
- const o = r.anchor.getNode(), a = Hn(o, Tt), i = a && zn(a) ? a.getListType() : null;
1218
+ const l = r.anchor.getNode(), a = Hn(l, Tt), i = a && zn(a) ? a.getListType() : null;
1219
1219
  let c = "paragraph";
1220
1220
  if (!i) {
1221
- const g = o.getKey() === "root" ? o : o.getTopLevelElementOrThrow();
1222
- Sn(g) && (c = g.getTag());
1221
+ const v = l.getKey() === "root" ? l : l.getTopLevelElementOrThrow();
1222
+ Sn(v) && (c = v.getTag());
1223
1223
  }
1224
- const f = r.hasFormat("bold"), w = r.hasFormat("italic"), x = r.hasFormat("underline"), h = pt(o.getParent()) || pt(o);
1225
- s((g) => ({
1226
- ...g,
1227
- isBold: f,
1228
- isItalic: w,
1229
- isUnderline: x,
1224
+ const b = r.hasFormat("bold"), R = r.hasFormat("italic"), N = r.hasFormat("underline"), h = pt(l.getParent()) || pt(l);
1225
+ o((v) => ({
1226
+ ...v,
1227
+ isBold: b,
1228
+ isItalic: R,
1229
+ isUnderline: N,
1230
1230
  isLink: h,
1231
1231
  isUnorderedList: i === "bullet",
1232
1232
  isOrderedList: i === "number",
@@ -1235,16 +1235,16 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1235
1235
  });
1236
1236
  };
1237
1237
  return Et(
1238
- n.registerUpdateListener(() => l()),
1238
+ n.registerUpdateListener(() => s()),
1239
1239
  n.registerCommand(
1240
1240
  En,
1241
- (r) => (s((o) => ({ ...o, canUndo: r })), !1),
1242
- Le
1241
+ (r) => (o((l) => ({ ...l, canUndo: r })), !1),
1242
+ Pe
1243
1243
  ),
1244
1244
  n.registerCommand(
1245
1245
  Fn,
1246
- (r) => (s((o) => ({ ...o, canRedo: r })), !1),
1247
- Le
1246
+ (r) => (o((l) => ({ ...l, canRedo: r })), !1),
1247
+ Pe
1248
1248
  )
1249
1249
  );
1250
1250
  }, [n]), t;
@@ -1252,26 +1252,26 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1252
1252
  dismiss: Ze(jt) || (() => {
1253
1253
  })
1254
1254
  }), Ue = (n) => {
1255
- const { trigger: t, children: s, placement: l = "bottom-end", minWidth: r = 200, className: o } = n, [a, i] = W(!1), { Popover: c, anchorRef: f } = ct({
1256
- placement: l,
1255
+ const { trigger: t, children: o, placement: s = "bottom-end", minWidth: r = 200, className: l } = n, [a, i] = W(!1), { Popover: c, anchorRef: b } = ct({
1256
+ placement: s,
1257
1257
  open: a,
1258
1258
  onOpenChange: i,
1259
1259
  minWidth: r
1260
1260
  });
1261
1261
  return /* @__PURE__ */ d(ce, { children: [
1262
- /* @__PURE__ */ e("div", { ref: f, className: o, onClick: () => i(!a), children: t }),
1263
- /* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(ve, { padding: "sm", children: /* @__PURE__ */ e(jt.Provider, { value: () => i(!1), children: s }) }) })
1262
+ /* @__PURE__ */ e("div", { ref: b, className: l, onClick: () => i(!a), children: t }),
1263
+ /* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(ve, { padding: "sm", children: /* @__PURE__ */ e(jt.Provider, { value: () => i(!1), children: o }) }) })
1264
1264
  ] });
1265
- }, kr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", X = R.forwardRef((n, t) => {
1265
+ }, kr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", X = C.forwardRef((n, t) => {
1266
1266
  const {
1267
- className: s,
1268
- children: l,
1267
+ className: o,
1268
+ children: s,
1269
1269
  Icon: r,
1270
- onClick: o,
1270
+ onClick: l,
1271
1271
  dismissOnClick: a = !0,
1272
1272
  ...i
1273
- } = n, { dismiss: c } = yr(), f = (w) => {
1274
- o && o(w), a && c();
1273
+ } = n, { dismiss: c } = yr(), b = (R) => {
1274
+ l && l(R), a && c();
1275
1275
  };
1276
1276
  return /* @__PURE__ */ d(
1277
1277
  "button",
@@ -1279,13 +1279,13 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1279
1279
  ref: t,
1280
1280
  className: m(
1281
1281
  kr,
1282
- s
1282
+ o
1283
1283
  ),
1284
- onClick: f,
1284
+ onClick: b,
1285
1285
  ...i,
1286
1286
  children: [
1287
1287
  r && /* @__PURE__ */ e(r, { className: "h-5 w-5" }),
1288
- l
1288
+ s
1289
1289
  ]
1290
1290
  }
1291
1291
  );
@@ -1296,12 +1296,12 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1296
1296
  { value: "h3", label: "Heading 3" },
1297
1297
  { value: "h4", label: "Heading 4" }
1298
1298
  ], Cr = () => {
1299
- const [n] = ue(), { state: t, tone: s } = we(), l = (o) => {
1299
+ const [n] = ue(), { state: t, tone: o } = we(), s = (l) => {
1300
1300
  n.update(() => {
1301
- const a = Pt();
1302
- Lt(a) && (o === "paragraph" ? bt(a, () => Mn()) : bt(a, () => Dn(o)));
1301
+ const a = Lt();
1302
+ Pt(a) && (l === "paragraph" ? bt(a, () => Mn()) : bt(a, () => Dn(l)));
1303
1303
  });
1304
- }, r = Ge.find((o) => o.value === t.blockType) ?? Ge[0];
1304
+ }, r = Ge.find((l) => l.value === t.blockType) ?? Ge[0];
1305
1305
  return /* @__PURE__ */ e(
1306
1306
  Ue,
1307
1307
  {
@@ -1311,10 +1311,10 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1311
1311
  "button",
1312
1312
  {
1313
1313
  type: "button",
1314
- onMouseDown: (o) => o.preventDefault(),
1314
+ onMouseDown: (l) => l.preventDefault(),
1315
1315
  className: m(
1316
1316
  "lexical-tb-btn h-8 px-2 gap-1 text-sm font-medium",
1317
- s === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1317
+ o === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1318
1318
  ),
1319
1319
  children: [
1320
1320
  r.label,
@@ -1322,51 +1322,51 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1322
1322
  ]
1323
1323
  }
1324
1324
  ),
1325
- children: Ge.map((o) => /* @__PURE__ */ e(
1325
+ children: Ge.map((l) => /* @__PURE__ */ e(
1326
1326
  X,
1327
1327
  {
1328
- Icon: o.value === t.blockType ? Rt : void 0,
1329
- onClick: () => l(o.value),
1330
- className: o.value === t.blockType ? void 0 : "pl-11",
1331
- children: o.label
1328
+ Icon: l.value === t.blockType ? Rt : void 0,
1329
+ onClick: () => s(l.value),
1330
+ className: l.value === t.blockType ? void 0 : "pl-11",
1331
+ children: l.label
1332
1332
  },
1333
- o.value
1333
+ l.value
1334
1334
  ))
1335
1335
  }
1336
1336
  );
1337
1337
  }, Ir = {
1338
1338
  light: "lexical-tb-btn-light",
1339
1339
  dark: "lexical-tb-btn-dark"
1340
- }, ie = R.forwardRef(
1340
+ }, ie = C.forwardRef(
1341
1341
  (n, t) => {
1342
- const { Icon: s, active: l = !1, tone: r = "light", className: o, onMouseDown: a, ...i } = n;
1342
+ const { Icon: o, active: s = !1, tone: r = "light", className: l, onMouseDown: a, ...i } = n;
1343
1343
  return /* @__PURE__ */ e(
1344
1344
  "button",
1345
1345
  {
1346
1346
  ref: t,
1347
1347
  type: "button",
1348
- onMouseDown: (f) => {
1349
- f.preventDefault(), a?.(f);
1348
+ onMouseDown: (b) => {
1349
+ b.preventDefault(), a?.(b);
1350
1350
  },
1351
1351
  className: m(
1352
1352
  "lexical-tb-btn h-8 w-8",
1353
1353
  Ir[r],
1354
- l && "lexical-tb-btn-active",
1355
- o
1354
+ s && "lexical-tb-btn-active",
1355
+ l
1356
1356
  ),
1357
1357
  ...i,
1358
- children: /* @__PURE__ */ e(s, { className: "h-[18px] w-[18px]" })
1358
+ children: /* @__PURE__ */ e(o, { className: "h-[18px] w-[18px]" })
1359
1359
  }
1360
1360
  );
1361
1361
  }
1362
1362
  ), Rr = () => {
1363
- const [n] = ue(), { state: t, tone: s } = we();
1363
+ const [n] = ue(), { state: t, tone: o } = we();
1364
1364
  return /* @__PURE__ */ d(ce, { children: [
1365
1365
  /* @__PURE__ */ e(
1366
1366
  ie,
1367
1367
  {
1368
1368
  Icon: Qt,
1369
- tone: s,
1369
+ tone: o,
1370
1370
  active: t.isBold,
1371
1371
  "aria-label": "Bold",
1372
1372
  onClick: () => n.dispatchCommand(je, "bold")
@@ -1376,7 +1376,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1376
1376
  ie,
1377
1377
  {
1378
1378
  Icon: Zt,
1379
- tone: s,
1379
+ tone: o,
1380
1380
  active: t.isItalic,
1381
1381
  "aria-label": "Italic",
1382
1382
  onClick: () => n.dispatchCommand(je, "italic")
@@ -1386,7 +1386,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1386
1386
  ie,
1387
1387
  {
1388
1388
  Icon: en,
1389
- tone: s,
1389
+ tone: o,
1390
1390
  active: t.isUnderline,
1391
1391
  "aria-label": "Underline",
1392
1392
  onClick: () => n.dispatchCommand(je, "underline")
@@ -1394,14 +1394,14 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1394
1394
  )
1395
1395
  ] });
1396
1396
  }, Sr = () => {
1397
- const [n] = ue(), { state: t, tone: s } = we(), l = () => {
1397
+ const [n] = ue(), { state: t, tone: o } = we(), s = () => {
1398
1398
  n.dispatchCommand(
1399
1399
  t.isUnorderedList ? ht : Tn,
1400
1400
  void 0
1401
1401
  );
1402
1402
  }, r = () => {
1403
1403
  n.dispatchCommand(
1404
- t.isOrderedList ? ht : Pn,
1404
+ t.isOrderedList ? ht : Ln,
1405
1405
  void 0
1406
1406
  );
1407
1407
  };
@@ -1409,18 +1409,18 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1409
1409
  /* @__PURE__ */ e(
1410
1410
  ie,
1411
1411
  {
1412
- Icon: Ye,
1413
- tone: s,
1412
+ Icon: Je,
1413
+ tone: o,
1414
1414
  active: t.isUnorderedList,
1415
1415
  "aria-label": "Bullet list",
1416
- onClick: l
1416
+ onClick: s
1417
1417
  }
1418
1418
  ),
1419
1419
  /* @__PURE__ */ e(
1420
1420
  ie,
1421
1421
  {
1422
1422
  Icon: tn,
1423
- tone: s,
1423
+ tone: o,
1424
1424
  active: t.isOrderedList,
1425
1425
  "aria-label": "Numbered list",
1426
1426
  onClick: r
@@ -1428,7 +1428,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1428
1428
  )
1429
1429
  ] });
1430
1430
  }, Dr = () => {
1431
- const [n] = ue(), { state: t, tone: s } = we(), l = () => {
1431
+ const [n] = ue(), { state: t, tone: o } = we(), s = () => {
1432
1432
  if (t.isLink) {
1433
1433
  n.dispatchCommand(gt, null);
1434
1434
  return;
@@ -1440,20 +1440,20 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1440
1440
  ie,
1441
1441
  {
1442
1442
  Icon: nn,
1443
- tone: s,
1443
+ tone: o,
1444
1444
  active: t.isLink,
1445
1445
  "aria-label": "Link",
1446
- onClick: l
1446
+ onClick: s
1447
1447
  }
1448
1448
  );
1449
1449
  }, Or = () => {
1450
- const [n] = ue(), { state: t, tone: s } = we();
1450
+ const [n] = ue(), { state: t, tone: o } = we();
1451
1451
  return /* @__PURE__ */ d(ce, { children: [
1452
1452
  /* @__PURE__ */ e(
1453
1453
  ie,
1454
1454
  {
1455
1455
  Icon: rn,
1456
- tone: s,
1456
+ tone: o,
1457
1457
  disabled: !t.canUndo,
1458
1458
  "aria-label": "Undo",
1459
1459
  onClick: () => n.dispatchCommand(Bn, void 0)
@@ -1463,7 +1463,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1463
1463
  ie,
1464
1464
  {
1465
1465
  Icon: ln,
1466
- tone: s,
1466
+ tone: o,
1467
1467
  disabled: !t.canRedo,
1468
1468
  "aria-label": "Redo",
1469
1469
  onClick: () => n.dispatchCommand(An, void 0)
@@ -1473,54 +1473,54 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1473
1473
  }, zr = {
1474
1474
  light: "lexical-tb-divider-light",
1475
1475
  dark: "lexical-tb-divider-dark"
1476
- }, Je = (n) => {
1477
- const { tone: t, className: s } = n, { tone: l, orientation: r } = we();
1476
+ }, qe = (n) => {
1477
+ const { tone: t, className: o } = n, { tone: s, orientation: r } = we();
1478
1478
  return /* @__PURE__ */ e(
1479
1479
  "div",
1480
1480
  {
1481
1481
  className: m(
1482
1482
  r === "vertical" ? "h-px w-full my-1" : "w-px h-5 my-auto mx-1",
1483
1483
  "shrink-0",
1484
- zr[t ?? l],
1485
- s
1484
+ zr[t ?? s],
1485
+ o
1486
1486
  )
1487
1487
  }
1488
1488
  );
1489
1489
  }, Nt = 4, Tr = 36, Xt = (n) => {
1490
1490
  const t = [];
1491
- return R.Children.forEach(n, (s) => {
1492
- R.isValidElement(s) && s.type === R.Fragment ? t.push(...Xt(s.props.children)) : t.push(s);
1491
+ return C.Children.forEach(n, (o) => {
1492
+ C.isValidElement(o) && o.type === C.Fragment ? t.push(...Xt(o.props.children)) : t.push(o);
1493
1493
  }), t;
1494
1494
  }, Vt = (n) => {
1495
- const { children: t } = n, { state: s, tone: l } = we(), r = Xt(t), o = Ce(null), a = Ce(null), [i, c] = W(r.length), f = Pe(() => {
1496
- const h = o.current, g = a.current;
1497
- if (!h || !g) return;
1498
- const p = h.clientWidth, u = Array.from(g.children).map((k) => k.offsetWidth);
1499
- if (u.reduce((k, I, D) => k + I + (D > 0 ? Nt : 0), 0) <= p) {
1500
- c(u.length);
1495
+ const { children: t } = n, { state: o, tone: s } = we(), r = Xt(t), l = Ce(null), a = Ce(null), [i, c] = W(r.length), b = Le(() => {
1496
+ const h = l.current, v = a.current;
1497
+ if (!h || !v) return;
1498
+ const f = h.clientWidth, p = Array.from(v.children).map((y) => y.offsetWidth);
1499
+ if (p.reduce((y, k, S) => y + k + (S > 0 ? Nt : 0), 0) <= f) {
1500
+ c(p.length);
1501
1501
  return;
1502
1502
  }
1503
- let C = 0, v = 0;
1504
- for (let k = 0; k < u.length; k++) {
1505
- const I = u[k] + (k > 0 ? Nt : 0);
1506
- if (C + I + Tr > p) break;
1507
- C += I, v++;
1503
+ let I = 0, x = 0;
1504
+ for (let y = 0; y < p.length; y++) {
1505
+ const k = p[y] + (y > 0 ? Nt : 0);
1506
+ if (I + k + Tr > f) break;
1507
+ I += k, x++;
1508
1508
  }
1509
- c(v);
1509
+ c(x);
1510
1510
  }, []);
1511
1511
  It(() => {
1512
- f();
1512
+ b();
1513
1513
  }), _(() => {
1514
- const h = o.current, g = a.current;
1514
+ const h = l.current, v = a.current;
1515
1515
  if (!h) return;
1516
- const p = new ResizeObserver(() => f());
1517
- return p.observe(h), g && p.observe(g), () => p.disconnect();
1518
- }, [f]);
1519
- const w = r.slice(0, i), x = r.slice(i);
1516
+ const f = new ResizeObserver(() => b());
1517
+ return f.observe(h), v && f.observe(v), () => f.disconnect();
1518
+ }, [b]);
1519
+ const R = r.slice(0, i), N = r.slice(i);
1520
1520
  return /* @__PURE__ */ d(
1521
1521
  "div",
1522
1522
  {
1523
- ref: o,
1523
+ ref: l,
1524
1524
  className: "relative flex flex-row items-center gap-1 min-w-0 flex-1",
1525
1525
  children: [
1526
1526
  /* @__PURE__ */ e(
@@ -1529,11 +1529,11 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1529
1529
  ref: a,
1530
1530
  "aria-hidden": !0,
1531
1531
  className: "pointer-events-none invisible absolute left-0 top-0 flex flex-row items-center gap-1 w-max",
1532
- children: r.map((h, g) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, g))
1532
+ children: r.map((h, v) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, v))
1533
1533
  }
1534
1534
  ),
1535
- w.map((h, g) => /* @__PURE__ */ e(R.Fragment, { children: h }, g)),
1536
- x.length > 0 && /* @__PURE__ */ e(
1535
+ R.map((h, v) => /* @__PURE__ */ e(C.Fragment, { children: h }, v)),
1536
+ N.length > 0 && /* @__PURE__ */ e(
1537
1537
  Ue,
1538
1538
  {
1539
1539
  placement: "bottom-end",
@@ -1546,17 +1546,17 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1546
1546
  onMouseDown: (h) => h.preventDefault(),
1547
1547
  className: m(
1548
1548
  "lexical-tb-btn h-8 w-8 shrink-0",
1549
- l === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1549
+ s === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1550
1550
  ),
1551
1551
  children: /* @__PURE__ */ e(on, { className: "h-[18px] w-[18px]" })
1552
1552
  }
1553
1553
  ),
1554
- children: /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
1554
+ children: /* @__PURE__ */ e(Ae.Provider, { value: { state: o, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
1555
1555
  "div",
1556
1556
  {
1557
1557
  className: "flex flex-col items-stretch gap-1",
1558
1558
  onMouseDown: (h) => h.preventDefault(),
1559
- children: x.map((h, g) => /* @__PURE__ */ e(R.Fragment, { children: h }, g))
1559
+ children: N.map((h, v) => /* @__PURE__ */ e(C.Fragment, { children: h }, v))
1560
1560
  }
1561
1561
  ) })
1562
1562
  }
@@ -1566,27 +1566,27 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1566
1566
  );
1567
1567
  }, dt = () => /* @__PURE__ */ d(ce, { children: [
1568
1568
  /* @__PURE__ */ e(Cr, {}),
1569
- /* @__PURE__ */ e(Je, {}),
1569
+ /* @__PURE__ */ e(qe, {}),
1570
1570
  /* @__PURE__ */ e(Rr, {}),
1571
- /* @__PURE__ */ e(Je, {}),
1571
+ /* @__PURE__ */ e(qe, {}),
1572
1572
  /* @__PURE__ */ e(Sr, {}),
1573
1573
  /* @__PURE__ */ e(Dr, {}),
1574
- /* @__PURE__ */ e(Je, {}),
1574
+ /* @__PURE__ */ e(qe, {}),
1575
1575
  /* @__PURE__ */ e(Or, {})
1576
- ] }), Sl = () => dt(), Pr = (n) => {
1577
- const { render: t, className: s } = n, [l] = ue(), r = _t();
1576
+ ] }), Sl = () => dt(), Lr = (n) => {
1577
+ const { render: t, className: o } = n, [s] = ue(), r = _t();
1578
1578
  return /* @__PURE__ */ e(Ae.Provider, { value: { state: r, tone: "light" }, children: /* @__PURE__ */ e(
1579
1579
  "div",
1580
1580
  {
1581
1581
  className: m(
1582
1582
  "lexical-toolbar flex flex-row items-center p-1.5",
1583
- s
1583
+ o
1584
1584
  ),
1585
- children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: l, state: r, tone: "light" }) : dt() })
1585
+ children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: s, state: r, tone: "light" }) : dt() })
1586
1586
  }
1587
1587
  ) });
1588
- }, Lr = (n) => {
1589
- const { render: t } = n, [s] = ue(), l = _t(), [r, o] = W(!1), { refs: a, floatingStyles: i } = st({
1588
+ }, Pr = (n) => {
1589
+ const { render: t } = n, [o] = ue(), s = _t(), [r, l] = W(!1), { refs: a, floatingStyles: i } = st({
1590
1590
  placement: "top-start",
1591
1591
  strategy: "fixed",
1592
1592
  middleware: [
@@ -1594,77 +1594,77 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1594
1594
  rt(),
1595
1595
  lt({ padding: 8 }),
1596
1596
  ot({
1597
- apply({ rects: c, elements: f }) {
1598
- f.floating.style.width = `${c.reference.width}px`;
1597
+ apply({ rects: c, elements: b }) {
1598
+ b.floating.style.width = `${c.reference.width}px`;
1599
1599
  }
1600
1600
  })
1601
1601
  ],
1602
1602
  whileElementsMounted: at
1603
1603
  });
1604
- return _(() => s.registerRootListener((c) => a.setReference(c ?? null)), [s, a]), _(() => Et(
1605
- s.registerCommand(
1604
+ return _(() => o.registerRootListener((c) => a.setReference(c ?? null)), [o, a]), _(() => Et(
1605
+ o.registerCommand(
1606
1606
  Un,
1607
- () => (o(!0), !1),
1608
- Le
1607
+ () => (l(!0), !1),
1608
+ Pe
1609
1609
  ),
1610
- s.registerCommand(
1610
+ o.registerCommand(
1611
1611
  Wn,
1612
- () => (o(!1), !1),
1613
- Le
1612
+ () => (l(!1), !1),
1613
+ Pe
1614
1614
  )
1615
- ), [s]), /* @__PURE__ */ e(Ae.Provider, { value: { state: l, tone: "dark" }, children: /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: r && /* @__PURE__ */ e("div", { ref: a.setFloating, style: i, className: "z-50", children: /* @__PURE__ */ e(
1616
- J.div,
1615
+ ), [o]), /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "dark" }, children: /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: r && /* @__PURE__ */ e("div", { ref: a.setFloating, style: i, className: "z-50", children: /* @__PURE__ */ e(
1616
+ q.div,
1617
1617
  {
1618
1618
  className: "lexical-floating-toolbar flex w-full flex-row items-center p-1 rounded-xl",
1619
1619
  initial: { opacity: 0, y: 4 },
1620
1620
  animate: { opacity: 1, y: 0 },
1621
1621
  exit: { opacity: 0, y: 4 },
1622
1622
  transition: { duration: 0.1, ease: "easeInOut" },
1623
- children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: s, state: l, tone: "dark" }) : dt() })
1623
+ children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: o, state: s, tone: "dark" }) : dt() })
1624
1624
  }
1625
1625
  ) }) }) }) });
1626
1626
  }, Dl = (n) => {
1627
1627
  const {
1628
1628
  label: t,
1629
- description: s,
1630
- error: l,
1629
+ description: o,
1630
+ error: s,
1631
1631
  placeholder: r,
1632
- value: o,
1632
+ value: l,
1633
1633
  onChange: a,
1634
1634
  size: i = "md",
1635
1635
  toolbar: c = "static",
1636
- renderToolbar: f,
1637
- minRows: w = 4,
1638
- maxRows: x,
1636
+ renderToolbar: b,
1637
+ minRows: R = 4,
1638
+ maxRows: N,
1639
1639
  autogrow: h = !1,
1640
- namespace: g = "InputLexical",
1641
- nodes: p,
1642
- theme: u,
1643
- autoFocus: b = !1,
1644
- children: C,
1645
- className: v
1646
- } = n, k = se(
1640
+ namespace: v = "InputLexical",
1641
+ nodes: f,
1642
+ theme: p,
1643
+ autoFocus: u = !1,
1644
+ children: I,
1645
+ className: x
1646
+ } = n, y = se(
1647
1647
  () => ({
1648
- namespace: g,
1649
- theme: u ? { ...wt, ...u } : wt,
1650
- nodes: [...Nr, ...p ?? []],
1651
- editorState: o ?? null,
1652
- onError: (T) => {
1653
- throw T;
1648
+ namespace: v,
1649
+ theme: p ? { ...wt, ...p } : wt,
1650
+ nodes: [...Nr, ...f ?? []],
1651
+ editorState: l ?? null,
1652
+ onError: (z) => {
1653
+ throw z;
1654
1654
  }
1655
1655
  }),
1656
1656
  // Lexical reads initialConfig once on mount; later prop changes are ignored by design.
1657
1657
  // eslint-disable-next-line react-hooks/exhaustive-deps
1658
1658
  []
1659
- ), I = Pe(
1660
- (T) => {
1661
- a?.(JSON.stringify(T.toJSON()));
1659
+ ), k = Le(
1660
+ (z) => {
1661
+ a?.(JSON.stringify(z.toJSON()));
1662
1662
  },
1663
1663
  [a]
1664
- ), D = Y[i], O = !!l, P = (T) => `calc(${T} * 1lh + 1.5rem)`, L = h ? { minHeight: P(w), maxHeight: x ? P(x) : void 0 } : { height: P(w) };
1665
- return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", v), children: [
1666
- /* @__PURE__ */ e(q, { children: t }),
1667
- /* @__PURE__ */ e(gn, { initialConfig: k, children: /* @__PURE__ */ d(
1664
+ ), S = J[i], O = !!s, P = (z) => `calc(${z} * 1lh + 1.5rem)`, T = h ? { minHeight: P(R), maxHeight: N ? P(N) : void 0 } : { height: P(R) };
1665
+ return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", x), children: [
1666
+ /* @__PURE__ */ e(Y, { children: t }),
1667
+ /* @__PURE__ */ e(gn, { initialConfig: y, children: /* @__PURE__ */ d(
1668
1668
  "div",
1669
1669
  {
1670
1670
  className: m(
@@ -1672,7 +1672,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1672
1672
  O && "input-error"
1673
1673
  ),
1674
1674
  children: [
1675
- c === "static" && /* @__PURE__ */ e(Pr, { render: f }),
1675
+ c === "static" && /* @__PURE__ */ e(Lr, { render: b }),
1676
1676
  /* @__PURE__ */ e("div", { className: "relative flex-1 min-h-0", children: /* @__PURE__ */ e(
1677
1677
  bn,
1678
1678
  {
@@ -1681,16 +1681,16 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1681
1681
  {
1682
1682
  className: m(
1683
1683
  "lexical-content w-full outline-none px-3 py-3 leading-[1.55] overflow-y-auto mat-ui-hide-scrollbars",
1684
- D
1684
+ S
1685
1685
  ),
1686
- style: L,
1686
+ style: T,
1687
1687
  "aria-placeholder": r ?? "",
1688
1688
  placeholder: /* @__PURE__ */ e(
1689
1689
  "div",
1690
1690
  {
1691
1691
  className: m(
1692
1692
  "lexical-placeholder pointer-events-none absolute left-3 top-3",
1693
- D
1693
+ S
1694
1694
  ),
1695
1695
  children: r ?? ""
1696
1696
  }
@@ -1703,23 +1703,23 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1703
1703
  /* @__PURE__ */ e(xn, {}),
1704
1704
  /* @__PURE__ */ e(wn, {}),
1705
1705
  /* @__PURE__ */ e(Nn, {}),
1706
- b && /* @__PURE__ */ e(kn, {}),
1707
- a && /* @__PURE__ */ e(yn, { onChange: I }),
1708
- C,
1709
- c === "floating" && /* @__PURE__ */ e(Lr, { render: f })
1706
+ u && /* @__PURE__ */ e(kn, {}),
1707
+ a && /* @__PURE__ */ e(yn, { onChange: k }),
1708
+ I,
1709
+ c === "floating" && /* @__PURE__ */ e(Pr, { render: b })
1710
1710
  ]
1711
1711
  }
1712
1712
  ) }),
1713
- /* @__PURE__ */ e(V, { children: s }),
1714
- /* @__PURE__ */ e(K, { children: l })
1713
+ /* @__PURE__ */ e(V, { children: o }),
1714
+ /* @__PURE__ */ e(K, { children: s })
1715
1715
  ] }) });
1716
1716
  }, Ol = (n) => {
1717
1717
  const {
1718
1718
  className: t,
1719
- label: s,
1720
- description: l,
1719
+ label: o,
1720
+ description: s,
1721
1721
  options: r,
1722
- error: o,
1722
+ error: l,
1723
1723
  size: a = "md",
1724
1724
  ...i
1725
1725
  } = n;
@@ -1731,7 +1731,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1731
1731
  t
1732
1732
  ),
1733
1733
  children: [
1734
- /* @__PURE__ */ e(q, { children: s }),
1734
+ /* @__PURE__ */ e(Y, { children: o }),
1735
1735
  /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", children: [
1736
1736
  /* @__PURE__ */ e(
1737
1737
  "select",
@@ -1739,38 +1739,38 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1739
1739
  className: m(
1740
1740
  "appearance-none border input-base bg-none transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
1741
1741
  te[a],
1742
- Y[a],
1742
+ J[a],
1743
1743
  me[a],
1744
1744
  fe[a]
1745
1745
  ),
1746
1746
  ...i,
1747
- children: r && r.map((c, f) => /* @__PURE__ */ e(
1747
+ children: r && r.map((c, b) => /* @__PURE__ */ e(
1748
1748
  "option",
1749
1749
  {
1750
1750
  value: c.value,
1751
1751
  disabled: c.disabled,
1752
1752
  children: c.label
1753
1753
  },
1754
- f
1754
+ b
1755
1755
  ))
1756
1756
  }
1757
1757
  ),
1758
1758
  /* @__PURE__ */ d(he, { children: [
1759
- o && /* @__PURE__ */ e(ne, {}),
1759
+ l && /* @__PURE__ */ e(ne, {}),
1760
1760
  /* @__PURE__ */ e(Z, { Icon: be })
1761
1761
  ] })
1762
1762
  ] }),
1763
- /* @__PURE__ */ e(V, { children: l }),
1764
- /* @__PURE__ */ e(K, { children: o })
1763
+ /* @__PURE__ */ e(V, { children: s }),
1764
+ /* @__PURE__ */ e(K, { children: l })
1765
1765
  ]
1766
1766
  }
1767
1767
  ) });
1768
- }, We = R.forwardRef((n, t) => {
1768
+ }, We = C.forwardRef((n, t) => {
1769
1769
  const {
1770
- children: s,
1771
- onClick: l,
1770
+ children: o,
1771
+ onClick: s,
1772
1772
  selected: r,
1773
- disabled: o = !1,
1773
+ disabled: l = !1,
1774
1774
  active: a = !1,
1775
1775
  className: i,
1776
1776
  ...c
@@ -1780,22 +1780,22 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1780
1780
  {
1781
1781
  ref: t,
1782
1782
  ...c,
1783
- onClick: () => !o && l && l(),
1783
+ onClick: () => !l && s && s(),
1784
1784
  className: m(
1785
1785
  "option-base px-4 py-2 rounded-xl cursor-pointer transition-all duration-150 select-none flex flex-row gap-3 items-center",
1786
- r && !o && "option-selected",
1787
- a && !o && "option-active",
1788
- o && "option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent",
1786
+ r && !l && "option-selected",
1787
+ a && !l && "option-active",
1788
+ l && "option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent",
1789
1789
  i
1790
1790
  ),
1791
1791
  children: [
1792
- /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: s }),
1793
- r && !o && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(Rt, { className: "h-5 w-5" }) })
1792
+ /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: o }),
1793
+ r && !l && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(Rt, { className: "h-5 w-5" }) })
1794
1794
  ]
1795
1795
  }
1796
1796
  );
1797
- }), He = R.forwardRef((n, t) => {
1798
- const { children: s, className: l, ...r } = n;
1797
+ }), He = C.forwardRef((n, t) => {
1798
+ const { children: o, className: s, ...r } = n;
1799
1799
  return /* @__PURE__ */ e(
1800
1800
  "div",
1801
1801
  {
@@ -1803,144 +1803,144 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1803
1803
  ...r,
1804
1804
  className: m(
1805
1805
  "option-group-header px-4 pt-3 pb-1 text-xs font-semibold uppercase tracking-wide select-none",
1806
- l
1806
+ s
1807
1807
  ),
1808
- children: s
1808
+ children: o
1809
1809
  }
1810
1810
  );
1811
- }), $e = R.forwardRef((n, t) => {
1812
- const { className: s, ...l } = n;
1811
+ }), $e = C.forwardRef((n, t) => {
1812
+ const { className: o, ...s } = n;
1813
1813
  return /* @__PURE__ */ e(
1814
1814
  "div",
1815
1815
  {
1816
1816
  ref: t,
1817
- ...l,
1817
+ ...s,
1818
1818
  className: m(
1819
1819
  "option-divider my-1 h-px",
1820
- s
1820
+ o
1821
1821
  )
1822
1822
  }
1823
1823
  );
1824
1824
  }), H = (n) => !("kind" in n), G = (n, t) => n === t ? !0 : n == null || t == null || typeof n != "object" || typeof t != "object" ? !1 : JSON.stringify(n) === JSON.stringify(t), _e = (n) => {
1825
1825
  const {
1826
1826
  placement: t = "bottom",
1827
- fullWidth: s,
1828
- minWidth: l,
1827
+ fullWidth: o,
1828
+ minWidth: s,
1829
1829
  maxWidth: r,
1830
- open: o,
1830
+ open: l,
1831
1831
  onOpenChange: a,
1832
1832
  listRef: i,
1833
1833
  activeIndex: c,
1834
- onNavigate: f,
1835
- loop: w = !0,
1836
- disabledIndices: x
1837
- } = n, h = R.useMemo(() => [
1834
+ onNavigate: b,
1835
+ loop: R = !0,
1836
+ disabledIndices: N
1837
+ } = n, h = C.useMemo(() => [
1838
1838
  rt({ padding: 8 }),
1839
1839
  lt({ padding: 8 }),
1840
1840
  ot({
1841
- apply({ rects: L, elements: T }) {
1842
- s && (T.floating.style.width = `${L.reference.width}px`), l && (T.floating.style.minWidth = `${l}px`), r && (T.floating.style.maxWidth = `${r}px`);
1841
+ apply({ rects: T, elements: z }) {
1842
+ o && (z.floating.style.width = `${T.reference.width}px`), s && (z.floating.style.minWidth = `${s}px`), r && (z.floating.style.maxWidth = `${r}px`);
1843
1843
  }
1844
1844
  })
1845
- ], [s, r, l]), { refs: g, floatingStyles: p, context: u, placement: b } = st({
1845
+ ], [o, r, s]), { refs: v, floatingStyles: f, context: p, placement: u } = st({
1846
1846
  placement: t,
1847
- open: o,
1847
+ open: l,
1848
1848
  onOpenChange: a,
1849
1849
  middleware: h,
1850
1850
  whileElementsMounted: at
1851
- }), C = hn(u, {
1851
+ }), I = hn(p, {
1852
1852
  listRef: i,
1853
1853
  activeIndex: c,
1854
- onNavigate: f,
1855
- loop: w,
1854
+ onNavigate: b,
1855
+ loop: R,
1856
1856
  virtual: !0,
1857
1857
  focusItemOnOpen: !1,
1858
- disabledIndices: x
1859
- }), v = St(u, {
1858
+ disabledIndices: N
1859
+ }), x = St(p, {
1860
1860
  outsidePress: !0,
1861
1861
  escapeKey: !1
1862
- }), { getReferenceProps: k, getFloatingProps: I, getItemProps: D } = Dt([C, v]), O = R.useRef({
1863
- floatingStyles: p,
1864
- setFloating: g.setFloating,
1862
+ }), { getReferenceProps: y, getFloatingProps: k, getItemProps: S } = Dt([I, x]), O = C.useRef({
1863
+ floatingStyles: f,
1864
+ setFloating: v.setFloating,
1865
1865
  placement: t,
1866
- getFloatingProps: I
1866
+ getFloatingProps: k
1867
1867
  });
1868
1868
  O.current = {
1869
- floatingStyles: p,
1870
- setFloating: g.setFloating,
1871
- placement: b,
1872
- getFloatingProps: I
1869
+ floatingStyles: f,
1870
+ setFloating: v.setFloating,
1871
+ placement: u,
1872
+ getFloatingProps: k
1873
1873
  };
1874
- const P = R.useMemo(() => {
1875
- const L = (T) => {
1876
- const { floatingStyles: N, setFloating: y, placement: A, getFloatingProps: z } = O.current, { className: $, open: j, children: re } = T;
1874
+ const P = C.useMemo(() => {
1875
+ const T = (z) => {
1876
+ const { floatingStyles: w, setFloating: g, placement: M, getFloatingProps: L } = O.current, { className: $, open: j, children: re } = z;
1877
1877
  return /* @__PURE__ */ e(
1878
1878
  Ht,
1879
1879
  {
1880
1880
  open: j,
1881
1881
  className: $,
1882
- floatingStyles: N,
1883
- setFloating: y,
1884
- placement: A,
1885
- floatingProps: z(),
1882
+ floatingStyles: w,
1883
+ setFloating: g,
1884
+ placement: M,
1885
+ floatingProps: L(),
1886
1886
  children: re
1887
1887
  }
1888
1888
  );
1889
1889
  };
1890
- return R.memo(L);
1890
+ return C.memo(T);
1891
1891
  }, []);
1892
1892
  return {
1893
- anchorRef: g.setReference,
1893
+ anchorRef: v.setReference,
1894
1894
  Popover: P,
1895
- getReferenceProps: k,
1896
- getItemProps: D
1895
+ getReferenceProps: y,
1896
+ getItemProps: S
1897
1897
  };
1898
1898
  }, Er = (n) => {
1899
1899
  const {
1900
1900
  className: t,
1901
- label: s,
1902
- description: l,
1901
+ label: o,
1902
+ description: s,
1903
1903
  options: r,
1904
- onChange: o,
1904
+ onChange: l,
1905
1905
  value: a,
1906
1906
  placeholder: i,
1907
1907
  maxHeight: c = 300,
1908
- error: f,
1909
- size: w = "md",
1910
- disabled: x = !1,
1908
+ error: b,
1909
+ size: R = "md",
1910
+ disabled: N = !1,
1911
1911
  clearable: h = !0
1912
- } = n, [g, p] = W(!1), [u, b] = W(null), C = R.useRef(null), v = R.useRef([]), k = r?.find((N) => H(N) && G(N.value, a)), I = se(
1913
- () => r.map((N, y) => !H(N) || N.disabled ? y : -1).filter((N) => N !== -1),
1912
+ } = n, [v, f] = W(!1), [p, u] = W(null), I = C.useRef(null), x = C.useRef([]), y = r?.find((w) => H(w) && G(w.value, a)), k = se(
1913
+ () => r.map((w, g) => !H(w) || w.disabled ? g : -1).filter((w) => w !== -1),
1914
1914
  [r]
1915
1915
  );
1916
- xe(g, () => p(!1)), _(() => {
1917
- if (g) {
1918
- C.current?.focus({ preventScroll: !0 });
1919
- const N = r.findIndex((y) => H(y) && G(y.value, a));
1920
- if (N >= 0)
1921
- b(N);
1916
+ xe(v, () => f(!1)), _(() => {
1917
+ if (v) {
1918
+ I.current?.focus({ preventScroll: !0 });
1919
+ const w = r.findIndex((g) => H(g) && G(g.value, a));
1920
+ if (w >= 0)
1921
+ u(w);
1922
1922
  else {
1923
- const y = r.findIndex((A) => H(A) && !A.disabled);
1924
- b(y >= 0 ? y : null);
1923
+ const g = r.findIndex((M) => H(M) && !M.disabled);
1924
+ u(g >= 0 ? g : null);
1925
1925
  }
1926
1926
  } else
1927
- b(null);
1928
- }, [g]);
1929
- const { anchorRef: D, Popover: O, getReferenceProps: P, getItemProps: L } = _e({
1927
+ u(null);
1928
+ }, [v]);
1929
+ const { anchorRef: S, Popover: O, getReferenceProps: P, getItemProps: T } = _e({
1930
1930
  placement: "bottom",
1931
1931
  fullWidth: !0,
1932
1932
  minWidth: 200,
1933
- open: g,
1934
- onOpenChange: p,
1935
- listRef: v,
1936
- activeIndex: u,
1937
- onNavigate: b,
1938
- disabledIndices: I
1939
- }), T = (N) => {
1940
- const y = r[N];
1941
- y && H(y) && !y.disabled && (o(y.value), p(!1));
1933
+ open: v,
1934
+ onOpenChange: f,
1935
+ listRef: x,
1936
+ activeIndex: p,
1937
+ onNavigate: u,
1938
+ disabledIndices: k
1939
+ }), z = (w) => {
1940
+ const g = r[w];
1941
+ g && H(g) && !g.disabled && (l(g.value), f(!1));
1942
1942
  };
1943
- return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
1943
+ return /* @__PURE__ */ e(Q.Provider, { value: R, children: /* @__PURE__ */ d(
1944
1944
  "div",
1945
1945
  {
1946
1946
  className: m(
@@ -1948,140 +1948,140 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
1948
1948
  t
1949
1949
  ),
1950
1950
  children: [
1951
- /* @__PURE__ */ e(q, { children: s }),
1952
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: D, children: [
1951
+ /* @__PURE__ */ e(Y, { children: o }),
1952
+ /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: S, children: [
1953
1953
  /* @__PURE__ */ d(
1954
1954
  "div",
1955
1955
  {
1956
1956
  ...P({
1957
- ref: C,
1957
+ ref: I,
1958
1958
  role: "button",
1959
- tabIndex: x ? -1 : 0,
1960
- "aria-disabled": x,
1959
+ tabIndex: N ? -1 : 0,
1960
+ "aria-disabled": N,
1961
1961
  onClick: () => {
1962
- x || p(!g);
1962
+ N || f(!v);
1963
1963
  },
1964
- onKeyDown: (N) => {
1965
- x || (N.key === " " ? (N.preventDefault(), p((y) => !y)) : N.key === "Enter" && (N.preventDefault(), g && u != null ? T(u) : p(!0)));
1964
+ onKeyDown: (w) => {
1965
+ N || (w.key === " " ? (w.preventDefault(), f((g) => !g)) : w.key === "Enter" && (w.preventDefault(), v && p != null ? z(p) : f(!0)));
1966
1966
  }
1967
1967
  }),
1968
1968
  className: m(
1969
1969
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
1970
- te[w],
1971
- Y[w],
1972
- me[w],
1973
- h && a ? Be[w] : fe[w],
1974
- x ? "select-trigger-disabled" : f && "select-trigger-error",
1975
- !x && g && "ring-4"
1970
+ te[R],
1971
+ J[R],
1972
+ me[R],
1973
+ h && a ? Be[R] : fe[R],
1974
+ N ? "select-trigger-disabled" : b && "select-trigger-error",
1975
+ !N && v && "ring-4"
1976
1976
  ),
1977
1977
  children: [
1978
- k && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: k.label }),
1979
- !k && i && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: i })
1978
+ y && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: y.label }),
1979
+ !y && i && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: i })
1980
1980
  ]
1981
1981
  }
1982
1982
  ),
1983
1983
  /* @__PURE__ */ d(he, { children: [
1984
- !x && f && /* @__PURE__ */ e(ne, {}),
1985
- h && !!a && !x && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o(null) }),
1984
+ !N && b && /* @__PURE__ */ e(ne, {}),
1985
+ h && !!a && !N && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l(null) }),
1986
1986
  /* @__PURE__ */ e(Z, { Icon: be })
1987
1987
  ] }),
1988
- /* @__PURE__ */ e(O, { open: g, children: /* @__PURE__ */ e(ve, { className: "!p-0", style: { maxHeight: c }, children: /* @__PURE__ */ e("div", { className: "flex flex-col p-2 gap-1", children: r.map((N, y) => {
1989
- if (!H(N))
1990
- return N.kind === "header" ? /* @__PURE__ */ e(
1988
+ /* @__PURE__ */ e(O, { open: v, children: /* @__PURE__ */ e(ve, { className: "!p-0", style: { maxHeight: c }, children: /* @__PURE__ */ e("div", { className: "flex flex-col p-2 gap-1", children: r.map((w, g) => {
1989
+ if (!H(w))
1990
+ return w.kind === "header" ? /* @__PURE__ */ e(
1991
1991
  He,
1992
1992
  {
1993
- ref: (z) => {
1994
- v.current[y] = z;
1993
+ ref: (L) => {
1994
+ x.current[g] = L;
1995
1995
  },
1996
- children: N.label
1996
+ children: w.label
1997
1997
  },
1998
- `header-${y}`
1998
+ `header-${g}`
1999
1999
  ) : /* @__PURE__ */ e(
2000
2000
  $e,
2001
2001
  {
2002
- ref: (z) => {
2003
- v.current[y] = z;
2002
+ ref: (L) => {
2003
+ x.current[g] = L;
2004
2004
  }
2005
2005
  },
2006
- `divider-${y}`
2006
+ `divider-${g}`
2007
2007
  );
2008
- const A = G(N.value, a);
2008
+ const M = G(w.value, a);
2009
2009
  return /* @__PURE__ */ e(
2010
2010
  We,
2011
2011
  {
2012
- ...L({
2013
- ref(z) {
2014
- v.current[y] = z;
2012
+ ...T({
2013
+ ref(L) {
2014
+ x.current[g] = L;
2015
2015
  }
2016
2016
  }),
2017
- onClick: () => T(y),
2018
- selected: A,
2019
- active: u === y,
2020
- disabled: N.disabled,
2021
- children: N.label
2017
+ onClick: () => z(g),
2018
+ selected: M,
2019
+ active: p === g,
2020
+ disabled: w.disabled,
2021
+ children: w.label
2022
2022
  },
2023
- `option-${y}`
2023
+ `option-${g}`
2024
2024
  );
2025
2025
  }) }) }) })
2026
2026
  ] }),
2027
- /* @__PURE__ */ e(V, { children: l }),
2028
- /* @__PURE__ */ e(K, { children: f })
2027
+ /* @__PURE__ */ e(V, { children: s }),
2028
+ /* @__PURE__ */ e(K, { children: b })
2029
2029
  ]
2030
2030
  }
2031
2031
  ) });
2032
2032
  }, zl = (n) => {
2033
2033
  const {
2034
2034
  className: t,
2035
- label: s,
2036
- description: l,
2035
+ label: o,
2036
+ description: s,
2037
2037
  options: r,
2038
- onChange: o,
2038
+ onChange: l,
2039
2039
  onSearch: a,
2040
2040
  value: i,
2041
2041
  placeholder: c,
2042
- maxHeight: f = 300,
2043
- error: w,
2044
- size: x = "md",
2042
+ maxHeight: b = 300,
2043
+ error: R,
2044
+ size: N = "md",
2045
2045
  disabled: h = !1,
2046
- clearable: g = !0
2047
- } = n, [p, u] = W(!1), [b, C] = W(r), [v, k] = W(""), [I, D] = W(null), O = R.useRef(null), P = R.useRef(null), L = R.useRef([]), T = r?.find((E) => H(E) && G(E.value, i)), N = se(() => v !== "" ? b : r, [v, b, r]), y = se(
2048
- () => N.map((E, U) => !H(E) || E.disabled ? U : -1).filter((E) => E !== -1),
2049
- [N]
2046
+ clearable: v = !0
2047
+ } = n, [f, p] = W(!1), [u, I] = W(r), [x, y] = W(""), [k, S] = W(null), O = C.useRef(null), P = C.useRef(null), T = C.useRef([]), z = r?.find((E) => H(E) && G(E.value, i)), w = se(() => x !== "" ? u : r, [x, u, r]), g = se(
2048
+ () => w.map((E, U) => !H(E) || E.disabled ? U : -1).filter((E) => E !== -1),
2049
+ [w]
2050
2050
  );
2051
- xe(p, () => u(!1)), _(() => {
2052
- C(a(v));
2053
- }, [v, r, a]), _(() => {
2054
- if (p) {
2051
+ xe(f, () => p(!1)), _(() => {
2052
+ I(a(x));
2053
+ }, [x, r, a]), _(() => {
2054
+ if (f) {
2055
2055
  setTimeout(() => P.current?.focus(), 100);
2056
2056
  const E = r.findIndex((U) => H(U) && G(U.value, i));
2057
2057
  if (E >= 0)
2058
- D(E);
2058
+ S(E);
2059
2059
  else {
2060
2060
  const U = r.findIndex((le) => H(le) && !le.disabled);
2061
- D(U >= 0 ? U : null);
2061
+ S(U >= 0 ? U : null);
2062
2062
  }
2063
2063
  } else
2064
- D(null), k("");
2065
- }, [p]), _(() => {
2066
- if (!p) return;
2067
- const E = N.findIndex((U) => H(U) && !U.disabled);
2068
- D(E >= 0 ? E : null);
2069
- }, [v, p, N]);
2070
- const { anchorRef: A, Popover: z, getReferenceProps: $, getItemProps: j } = _e({
2064
+ S(null), y("");
2065
+ }, [f]), _(() => {
2066
+ if (!f) return;
2067
+ const E = w.findIndex((U) => H(U) && !U.disabled);
2068
+ S(E >= 0 ? E : null);
2069
+ }, [x, f, w]);
2070
+ const { anchorRef: M, Popover: L, getReferenceProps: $, getItemProps: j } = _e({
2071
2071
  placement: "bottom",
2072
2072
  fullWidth: !0,
2073
2073
  minWidth: 200,
2074
- open: p,
2075
- onOpenChange: u,
2076
- listRef: L,
2077
- activeIndex: I,
2078
- onNavigate: D,
2079
- disabledIndices: y
2074
+ open: f,
2075
+ onOpenChange: p,
2076
+ listRef: T,
2077
+ activeIndex: k,
2078
+ onNavigate: S,
2079
+ disabledIndices: g
2080
2080
  }), re = (E) => {
2081
- const U = N[E];
2082
- U && H(U) && !U.disabled && (o(U.value), u(!1));
2083
- }, Ne = N.some((E) => H(E));
2084
- return /* @__PURE__ */ e(Q.Provider, { value: x, children: /* @__PURE__ */ d(
2081
+ const U = w[E];
2082
+ U && H(U) && !U.disabled && (l(U.value), p(!1));
2083
+ }, Ne = w.some((E) => H(E));
2084
+ return /* @__PURE__ */ e(Q.Provider, { value: N, children: /* @__PURE__ */ d(
2085
2085
  "div",
2086
2086
  {
2087
2087
  className: m(
@@ -2089,8 +2089,8 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2089
2089
  t
2090
2090
  ),
2091
2091
  children: [
2092
- /* @__PURE__ */ e(q, { children: s }),
2093
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: A, children: [
2092
+ /* @__PURE__ */ e(Y, { children: o }),
2093
+ /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: M, children: [
2094
2094
  /* @__PURE__ */ d(
2095
2095
  "div",
2096
2096
  {
@@ -2100,33 +2100,33 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2100
2100
  tabIndex: h ? -1 : 0,
2101
2101
  "aria-disabled": h,
2102
2102
  onClick: () => {
2103
- h || u(!p);
2103
+ h || p(!f);
2104
2104
  },
2105
2105
  onKeyDown: (E) => {
2106
- h || (E.key === " " ? (E.preventDefault(), u((U) => !U)) : E.key === "Enter" && !p && (E.preventDefault(), u(!0)));
2106
+ h || (E.key === " " ? (E.preventDefault(), p((U) => !U)) : E.key === "Enter" && !f && (E.preventDefault(), p(!0)));
2107
2107
  }
2108
2108
  }),
2109
2109
  className: m(
2110
2110
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2111
- te[x],
2112
- Y[x],
2113
- me[x],
2114
- g && i ? Be[x] : fe[x],
2115
- h ? "select-trigger-disabled" : w && "select-trigger-error",
2116
- !h && p && "ring-4"
2111
+ te[N],
2112
+ J[N],
2113
+ me[N],
2114
+ v && i ? Be[N] : fe[N],
2115
+ h ? "select-trigger-disabled" : R && "select-trigger-error",
2116
+ !h && f && "ring-4"
2117
2117
  ),
2118
2118
  children: [
2119
- T && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: T.label }),
2120
- !T && c && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: c })
2119
+ z && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: z.label }),
2120
+ !z && c && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: c })
2121
2121
  ]
2122
2122
  }
2123
2123
  ),
2124
2124
  /* @__PURE__ */ d(he, { children: [
2125
- !h && w && /* @__PURE__ */ e(ne, {}),
2126
- g && !!i && !h && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o(null) }),
2125
+ !h && R && /* @__PURE__ */ e(ne, {}),
2126
+ v && !!i && !h && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l(null) }),
2127
2127
  /* @__PURE__ */ e(Z, { Icon: be })
2128
2128
  ] }),
2129
- /* @__PURE__ */ e(z, { open: p, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: f }, children: [
2129
+ /* @__PURE__ */ e(L, { open: f, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: b }, children: [
2130
2130
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2131
2131
  /* @__PURE__ */ e(
2132
2132
  "input",
@@ -2134,25 +2134,25 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2134
2134
  ref: P,
2135
2135
  type: "text",
2136
2136
  placeholder: "Search",
2137
- value: v,
2137
+ value: x,
2138
2138
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2139
- onChange: (E) => k(E.target.value),
2139
+ onChange: (E) => y(E.target.value),
2140
2140
  onKeyDown: (E) => {
2141
- E.key === "Enter" && I != null && (E.preventDefault(), re(I));
2141
+ E.key === "Enter" && k != null && (E.preventDefault(), re(k));
2142
2142
  }
2143
2143
  }
2144
2144
  ),
2145
2145
  /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2146
2146
  ] }),
2147
2147
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2148
- v !== "" && !Ne && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2149
- N.map((E, U) => {
2148
+ x !== "" && !Ne && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2149
+ w.map((E, U) => {
2150
2150
  if (!H(E))
2151
2151
  return E.kind === "header" ? /* @__PURE__ */ e(
2152
2152
  He,
2153
2153
  {
2154
2154
  ref: (ee) => {
2155
- L.current[U] = ee;
2155
+ T.current[U] = ee;
2156
2156
  },
2157
2157
  children: E.label
2158
2158
  },
@@ -2161,7 +2161,7 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2161
2161
  $e,
2162
2162
  {
2163
2163
  ref: (ee) => {
2164
- L.current[U] = ee;
2164
+ T.current[U] = ee;
2165
2165
  }
2166
2166
  },
2167
2167
  `divider-${U}`
@@ -2172,12 +2172,12 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2172
2172
  {
2173
2173
  ...j({
2174
2174
  ref(ee) {
2175
- L.current[U] = ee;
2175
+ T.current[U] = ee;
2176
2176
  }
2177
2177
  }),
2178
2178
  onClick: () => re(U),
2179
2179
  selected: le,
2180
- active: I === U,
2180
+ active: k === U,
2181
2181
  disabled: E.disabled,
2182
2182
  children: E.label
2183
2183
  },
@@ -2187,81 +2187,81 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2187
2187
  ] })
2188
2188
  ] }) })
2189
2189
  ] }),
2190
- /* @__PURE__ */ e(V, { children: l }),
2191
- /* @__PURE__ */ e(K, { children: w })
2190
+ /* @__PURE__ */ e(V, { children: s }),
2191
+ /* @__PURE__ */ e(K, { children: R })
2192
2192
  ]
2193
2193
  }
2194
2194
  ) });
2195
2195
  }, Fr = (n, t) => {
2196
- const [s, l] = W(n);
2196
+ const [o, s] = W(n);
2197
2197
  return _(() => {
2198
2198
  const r = setTimeout(() => {
2199
- l(n);
2199
+ s(n);
2200
2200
  }, t);
2201
2201
  return () => {
2202
2202
  clearTimeout(r);
2203
2203
  };
2204
- }, [n, t]), s;
2204
+ }, [n, t]), o;
2205
2205
  }, Tl = (n) => {
2206
2206
  const {
2207
2207
  className: t,
2208
- label: s,
2209
- description: l,
2208
+ label: o,
2209
+ description: s,
2210
2210
  onChange: r,
2211
- fetchOptionsByQuery: o,
2211
+ fetchOptionsByQuery: l,
2212
2212
  fetchOptionByValue: a,
2213
2213
  onSearchDebounceMs: i = 300,
2214
2214
  value: c,
2215
- placeholder: f,
2216
- maxHeight: w = 300,
2217
- error: x,
2215
+ placeholder: b,
2216
+ maxHeight: R = 300,
2217
+ error: N,
2218
2218
  size: h = "md",
2219
- disabled: g = !1,
2220
- clearable: p = !0
2221
- } = n, [u, b] = W(!1), C = R.useRef(null), [v, k] = W(""), [I, D] = W([]), [O, P] = W(null), L = R.useRef(null), [T, N] = W(!1), [y, A] = W(!1), [z, $] = W(null), j = R.useRef([]), re = se(
2222
- () => I.map((M, B) => !H(M) || M.disabled ? B : -1).filter((M) => M !== -1),
2223
- [I]
2219
+ disabled: v = !1,
2220
+ clearable: f = !0
2221
+ } = n, [p, u] = W(!1), I = C.useRef(null), [x, y] = W(""), [k, S] = W([]), [O, P] = W(null), T = C.useRef(null), [z, w] = W(!1), [g, M] = W(!1), [L, $] = W(null), j = C.useRef([]), re = se(
2222
+ () => k.map((B, A) => !H(B) || B.disabled ? A : -1).filter((B) => B !== -1),
2223
+ [k]
2224
2224
  );
2225
- xe(u, () => b(!1));
2226
- const Ne = Fr(v, i);
2225
+ xe(p, () => u(!1));
2226
+ const Ne = Fr(x, i);
2227
2227
  _(() => {
2228
2228
  (async () => {
2229
- N(!0);
2230
- const B = await o(Ne);
2231
- D(B), N(!1);
2229
+ w(!0);
2230
+ const A = await l(Ne);
2231
+ S(A), w(!1);
2232
2232
  })();
2233
- }, [Ne, o]), _(() => {
2233
+ }, [Ne, l]), _(() => {
2234
2234
  if (c == null) {
2235
2235
  P(null);
2236
2236
  return;
2237
2237
  }
2238
- const M = I?.find((B) => H(B) && G(B.value, c));
2239
- M ? P(M) : (async () => {
2240
- A(!0);
2238
+ const B = k?.find((A) => H(A) && G(A.value, c));
2239
+ B ? P(B) : (async () => {
2240
+ M(!0);
2241
2241
  const oe = await a(c);
2242
- P(oe), A(!1);
2242
+ P(oe), M(!1);
2243
2243
  })();
2244
- }, [a, I, c]), _(() => {
2245
- u ? setTimeout(() => L.current?.focus(), 100) : ($(null), k(""));
2246
- }, [u]), _(() => {
2247
- if (!u) return;
2248
- const M = I.findIndex((B) => H(B) && !B.disabled);
2249
- $(M >= 0 ? M : null);
2250
- }, [I, u]);
2244
+ }, [a, k, c]), _(() => {
2245
+ p ? setTimeout(() => T.current?.focus(), 100) : ($(null), y(""));
2246
+ }, [p]), _(() => {
2247
+ if (!p) return;
2248
+ const B = k.findIndex((A) => H(A) && !A.disabled);
2249
+ $(B >= 0 ? B : null);
2250
+ }, [k, p]);
2251
2251
  const { anchorRef: E, Popover: U, getReferenceProps: le, getItemProps: ee } = _e({
2252
2252
  placement: "bottom",
2253
2253
  fullWidth: !0,
2254
2254
  minWidth: 200,
2255
- open: u,
2256
- onOpenChange: b,
2255
+ open: p,
2256
+ onOpenChange: u,
2257
2257
  listRef: j,
2258
- activeIndex: z,
2258
+ activeIndex: L,
2259
2259
  onNavigate: $,
2260
2260
  disabledIndices: re
2261
- }), Oe = (M) => {
2262
- const B = I[M];
2263
- B && H(B) && !B.disabled && (r(B.value), b(!1));
2264
- }, ze = I.some((M) => H(M));
2261
+ }), Oe = (B) => {
2262
+ const A = k[B];
2263
+ A && H(A) && !A.disabled && (r(A.value), u(!1));
2264
+ }, ze = k.some((B) => H(B));
2265
2265
  return /* @__PURE__ */ e(Q.Provider, { value: h, children: /* @__PURE__ */ d(
2266
2266
  "div",
2267
2267
  {
@@ -2270,108 +2270,108 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2270
2270
  t
2271
2271
  ),
2272
2272
  children: [
2273
- /* @__PURE__ */ e(q, { children: s }),
2273
+ /* @__PURE__ */ e(Y, { children: o }),
2274
2274
  /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: E, children: [
2275
2275
  /* @__PURE__ */ d(
2276
2276
  "div",
2277
2277
  {
2278
2278
  ...le({
2279
- ref: C,
2279
+ ref: I,
2280
2280
  role: "button",
2281
- tabIndex: g ? -1 : 0,
2282
- "aria-disabled": g,
2281
+ tabIndex: v ? -1 : 0,
2282
+ "aria-disabled": v,
2283
2283
  onClick: () => {
2284
- g || b(!u);
2284
+ v || u(!p);
2285
2285
  },
2286
- onKeyDown: (M) => {
2287
- g || (M.key === " " ? (M.preventDefault(), b((B) => !B)) : M.key === "Enter" && !u && (M.preventDefault(), b(!0)));
2286
+ onKeyDown: (B) => {
2287
+ v || (B.key === " " ? (B.preventDefault(), u((A) => !A)) : B.key === "Enter" && !p && (B.preventDefault(), u(!0)));
2288
2288
  }
2289
2289
  }),
2290
2290
  className: m(
2291
2291
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2292
2292
  te[h],
2293
- Y[h],
2293
+ J[h],
2294
2294
  me[h],
2295
- p && c ? Be[h] : fe[h],
2296
- g ? "select-trigger-disabled" : x && "select-trigger-error",
2297
- !g && u && "ring-4"
2295
+ f && c ? Be[h] : fe[h],
2296
+ v ? "select-trigger-disabled" : N && "select-trigger-error",
2297
+ !v && p && "ring-4"
2298
2298
  ),
2299
2299
  children: [
2300
- !y && O && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: O.label }),
2301
- !y && !O && f && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: f }),
2302
- y && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
2300
+ !g && O && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: O.label }),
2301
+ !g && !O && b && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: b }),
2302
+ g && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
2303
2303
  ]
2304
2304
  }
2305
2305
  ),
2306
2306
  /* @__PURE__ */ d(he, { children: [
2307
- !g && x && /* @__PURE__ */ e(ne, {}),
2308
- p && !!c && !g && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => r(null) }),
2307
+ !v && N && /* @__PURE__ */ e(ne, {}),
2308
+ f && !!c && !v && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => r(null) }),
2309
2309
  /* @__PURE__ */ e(Z, { Icon: be })
2310
2310
  ] }),
2311
- /* @__PURE__ */ e(U, { open: u, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: w }, children: [
2311
+ /* @__PURE__ */ e(U, { open: p, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: R }, children: [
2312
2312
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2313
2313
  /* @__PURE__ */ e(
2314
2314
  "input",
2315
2315
  {
2316
- ref: L,
2316
+ ref: T,
2317
2317
  type: "text",
2318
2318
  placeholder: "Search",
2319
- value: v,
2319
+ value: x,
2320
2320
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2321
- onChange: (M) => k(M.target.value),
2322
- onKeyDown: (M) => {
2323
- M.key === "Enter" && z != null && (M.preventDefault(), Oe(z));
2321
+ onChange: (B) => y(B.target.value),
2322
+ onKeyDown: (B) => {
2323
+ B.key === "Enter" && L != null && (B.preventDefault(), Oe(L));
2324
2324
  }
2325
2325
  }
2326
2326
  ),
2327
2327
  /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2328
2328
  ] }),
2329
2329
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2330
- !T && !ze && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2331
- T && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Se, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2332
- !T && I.map((M, B) => {
2333
- if (!H(M))
2334
- return M.kind === "header" ? /* @__PURE__ */ e(
2330
+ !z && !ze && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2331
+ z && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Se, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2332
+ !z && k.map((B, A) => {
2333
+ if (!H(B))
2334
+ return B.kind === "header" ? /* @__PURE__ */ e(
2335
2335
  He,
2336
2336
  {
2337
2337
  ref: (pe) => {
2338
- j.current[B] = pe;
2338
+ j.current[A] = pe;
2339
2339
  },
2340
- children: M.label
2340
+ children: B.label
2341
2341
  },
2342
- `header-${B}`
2342
+ `header-${A}`
2343
2343
  ) : /* @__PURE__ */ e(
2344
2344
  $e,
2345
2345
  {
2346
2346
  ref: (pe) => {
2347
- j.current[B] = pe;
2347
+ j.current[A] = pe;
2348
2348
  }
2349
2349
  },
2350
- `divider-${B}`
2350
+ `divider-${A}`
2351
2351
  );
2352
- const oe = G(M.value, c);
2352
+ const oe = G(B.value, c);
2353
2353
  return /* @__PURE__ */ e(
2354
2354
  We,
2355
2355
  {
2356
2356
  ...ee({
2357
2357
  ref(pe) {
2358
- j.current[B] = pe;
2358
+ j.current[A] = pe;
2359
2359
  }
2360
2360
  }),
2361
- onClick: () => Oe(B),
2361
+ onClick: () => Oe(A),
2362
2362
  selected: oe,
2363
- active: z === B,
2364
- disabled: M.disabled,
2365
- children: M.label
2363
+ active: L === A,
2364
+ disabled: B.disabled,
2365
+ children: B.label
2366
2366
  },
2367
- `option-${B}`
2367
+ `option-${A}`
2368
2368
  );
2369
2369
  })
2370
2370
  ] })
2371
2371
  ] }) })
2372
2372
  ] }),
2373
- /* @__PURE__ */ e(V, { children: l }),
2374
- /* @__PURE__ */ e(K, { children: x })
2373
+ /* @__PURE__ */ e(V, { children: s }),
2374
+ /* @__PURE__ */ e(K, { children: N })
2375
2375
  ]
2376
2376
  }
2377
2377
  ) });
@@ -2400,18 +2400,18 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2400
2400
  stone: "bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",
2401
2401
  white: "bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",
2402
2402
  black: "bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"
2403
- }, Ee = R.forwardRef((n, t) => {
2403
+ }, Ee = C.forwardRef((n, t) => {
2404
2404
  const {
2405
- className: s,
2406
- children: l,
2405
+ className: o,
2406
+ children: s,
2407
2407
  onClick: r,
2408
- showCloseIcon: o,
2408
+ showCloseIcon: l,
2409
2409
  Icon: a,
2410
2410
  color: i = "gray"
2411
2411
  } = n, c = m(
2412
2412
  "inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",
2413
2413
  Mr[i],
2414
- s
2414
+ o
2415
2415
  );
2416
2416
  return r ? /* @__PURE__ */ e("div", { ref: t, children: /* @__PURE__ */ d(
2417
2417
  "button",
@@ -2420,8 +2420,8 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2420
2420
  onClick: r,
2421
2421
  children: [
2422
2422
  a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
2423
- /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: l }),
2424
- o && /* @__PURE__ */ e(
2423
+ /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s }),
2424
+ l && /* @__PURE__ */ e(
2425
2425
  de,
2426
2426
  {
2427
2427
  className: "h-4 w-4 shrink-0"
@@ -2431,129 +2431,129 @@ const m = (...n) => n.filter(Boolean).join(" "), $n = [
2431
2431
  }
2432
2432
  ) }) : /* @__PURE__ */ d("div", { className: c, ref: t, children: [
2433
2433
  a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
2434
- /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: l })
2434
+ /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s })
2435
2435
  ] });
2436
2436
  });
2437
2437
  function Br(n) {
2438
2438
  const {
2439
2439
  enabled: t,
2440
- triggerRef: s,
2441
- measureRef: l,
2440
+ triggerRef: o,
2441
+ measureRef: s,
2442
2442
  trayRef: r,
2443
- itemCount: o,
2443
+ itemCount: l,
2444
2444
  deps: a = [],
2445
2445
  gap: i = 4
2446
- } = n, [c, f] = W(0);
2446
+ } = n, [c, b] = W(0);
2447
2447
  return It(() => {
2448
2448
  if (!t) return;
2449
- const w = s.current, x = l.current;
2450
- if (!w || !x) return;
2449
+ const R = o.current, N = s.current;
2450
+ if (!R || !N) return;
2451
2451
  const h = () => {
2452
- if (o === 0) {
2453
- f(0);
2452
+ if (l === 0) {
2453
+ b(0);
2454
2454
  return;
2455
2455
  }
2456
- if (o === 1) {
2457
- f(1);
2456
+ if (l === 1) {
2457
+ b(1);
2458
2458
  return;
2459
2459
  }
2460
- const p = window.getComputedStyle(w), u = parseFloat(p.paddingLeft || "0"), b = w.getBoundingClientRect(), C = b.left + u;
2461
- let v = b.right - parseFloat(p.paddingRight || "0");
2462
- const k = r?.current;
2463
- if (k) {
2464
- const N = k.getBoundingClientRect();
2465
- N.width > 0 && (v = Math.min(v, N.left - i));
2460
+ const f = window.getComputedStyle(R), p = parseFloat(f.paddingLeft || "0"), u = R.getBoundingClientRect(), I = u.left + p;
2461
+ let x = u.right - parseFloat(f.paddingRight || "0");
2462
+ const y = r?.current;
2463
+ if (y) {
2464
+ const w = y.getBoundingClientRect();
2465
+ w.width > 0 && (x = Math.min(x, w.left - i));
2466
2466
  }
2467
- const I = Math.max(0, v - C), D = Array.from(x.children);
2468
- if (D.length < o + 1) return;
2467
+ const k = Math.max(0, x - I), S = Array.from(N.children);
2468
+ if (S.length < l + 1) return;
2469
2469
  let O = 0;
2470
- for (let N = 0; N < o; N++)
2471
- O += D[N].offsetWidth + (N > 0 ? i : 0);
2472
- if (O <= I) {
2473
- f(o);
2470
+ for (let w = 0; w < l; w++)
2471
+ O += S[w].offsetWidth + (w > 0 ? i : 0);
2472
+ if (O <= k) {
2473
+ b(l);
2474
2474
  return;
2475
2475
  }
2476
- const P = D[o].offsetWidth;
2477
- let L = 0, T = 0;
2478
- for (let N = 0; N < o; N++) {
2479
- const y = D[N].offsetWidth, A = L + y + (N > 0 ? i : 0);
2480
- if (A + P + i > I) break;
2481
- L = A, T++;
2476
+ const P = S[l].offsetWidth;
2477
+ let T = 0, z = 0;
2478
+ for (let w = 0; w < l; w++) {
2479
+ const g = S[w].offsetWidth, M = T + g + (w > 0 ? i : 0);
2480
+ if (M + P + i > k) break;
2481
+ T = M, z++;
2482
2482
  }
2483
- f(Math.max(1, T));
2484
- }, g = new ResizeObserver(h);
2485
- return g.observe(w), r?.current && g.observe(r.current), h(), () => g.disconnect();
2486
- }, [t, o, ...a]), c;
2483
+ b(Math.max(1, z));
2484
+ }, v = new ResizeObserver(h);
2485
+ return v.observe(R), r?.current && v.observe(r.current), h(), () => v.disconnect();
2486
+ }, [t, l, ...a]), c;
2487
2487
  }
2488
- const Pl = (n) => {
2488
+ const Ll = (n) => {
2489
2489
  const {
2490
2490
  className: t,
2491
- label: s,
2492
- description: l,
2491
+ label: o,
2492
+ description: s,
2493
2493
  options: r,
2494
- onChange: o,
2494
+ onChange: l,
2495
2495
  onSearch: a,
2496
2496
  value: i,
2497
2497
  placeholder: c,
2498
- maxHeight: f = 300,
2499
- error: w,
2500
- size: x = "md",
2498
+ maxHeight: b = 300,
2499
+ error: R,
2500
+ size: N = "md",
2501
2501
  singleLine: h = !1,
2502
- color: g = "blue",
2503
- disabled: p = !1,
2504
- clearable: u = !0
2505
- } = n, [b, C] = W(!1), [v, k] = W(r), [I, D] = W(""), [O, P] = W(null), L = R.useRef(null), T = R.useRef(null), N = R.useRef([]), y = R.useRef(null), A = R.useRef(null), z = se(
2506
- () => i.map((S) => r.find((F) => H(F) && G(F.value, S))).filter((S) => S !== void 0),
2502
+ color: v = "blue",
2503
+ disabled: f = !1,
2504
+ clearable: p = !0
2505
+ } = n, [u, I] = W(!1), [x, y] = W(r), [k, S] = W(""), [O, P] = W(null), T = C.useRef(null), z = C.useRef(null), w = C.useRef([]), g = C.useRef(null), M = C.useRef(null), L = se(
2506
+ () => i.map((D) => r.find((F) => H(F) && G(F.value, D))).filter((D) => D !== void 0),
2507
2507
  [i, r]
2508
- ), $ = (S) => {
2509
- if (S === "") return r;
2510
- const F = S.toLowerCase();
2508
+ ), $ = (D) => {
2509
+ if (D === "") return r;
2510
+ const F = D.toLowerCase();
2511
2511
  return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(F) : !0);
2512
2512
  }, j = se(
2513
- () => I !== "" ? v : r,
2514
- [I, v, r]
2513
+ () => k !== "" ? x : r,
2514
+ [k, x, r]
2515
2515
  ), re = se(
2516
- () => j.map((S, F) => !H(S) || S.disabled ? F : -1).filter((S) => S !== -1),
2516
+ () => j.map((D, F) => !H(D) || D.disabled ? F : -1).filter((D) => D !== -1),
2517
2517
  [j]
2518
2518
  );
2519
- xe(b, () => C(!1)), _(() => {
2520
- k((a ?? $)(I));
2521
- }, [I, r, a]), _(() => {
2522
- if (b) {
2523
- setTimeout(() => T.current?.focus(), 100);
2524
- const S = r.findIndex((F) => H(F) && !F.disabled);
2525
- P(S >= 0 ? S : null);
2519
+ xe(u, () => I(!1)), _(() => {
2520
+ y((a ?? $)(k));
2521
+ }, [k, r, a]), _(() => {
2522
+ if (u) {
2523
+ setTimeout(() => z.current?.focus(), 100);
2524
+ const D = r.findIndex((F) => H(F) && !F.disabled);
2525
+ P(D >= 0 ? D : null);
2526
2526
  } else
2527
- P(null), D("");
2528
- }, [b]), _(() => {
2529
- if (!b) return;
2530
- const S = j.findIndex((F) => H(F) && !F.disabled);
2531
- P(S >= 0 ? S : null);
2532
- }, [I, b, j]);
2527
+ P(null), S("");
2528
+ }, [u]), _(() => {
2529
+ if (!u) return;
2530
+ const D = j.findIndex((F) => H(F) && !F.disabled);
2531
+ P(D >= 0 ? D : null);
2532
+ }, [k, u, j]);
2533
2533
  const Ne = Br({
2534
2534
  enabled: h,
2535
- triggerRef: L,
2536
- measureRef: y,
2537
- trayRef: A,
2538
- itemCount: z.length,
2539
- deps: [z, w]
2535
+ triggerRef: T,
2536
+ measureRef: g,
2537
+ trayRef: M,
2538
+ itemCount: L.length,
2539
+ deps: [L, R]
2540
2540
  }), { anchorRef: E, Popover: U, getReferenceProps: le, getItemProps: ee } = _e({
2541
2541
  placement: "bottom",
2542
2542
  fullWidth: !0,
2543
2543
  minWidth: 200,
2544
- open: b,
2545
- onOpenChange: C,
2546
- listRef: N,
2544
+ open: u,
2545
+ onOpenChange: I,
2546
+ listRef: w,
2547
2547
  activeIndex: O,
2548
2548
  onNavigate: P,
2549
2549
  disabledIndices: re
2550
- }), Oe = (S) => {
2551
- i.some((F) => G(F, S)) ? o(i.filter((F) => !G(F, S))) : o([...i, S]);
2552
- }, ze = (S) => {
2553
- const F = j[S];
2550
+ }), Oe = (D) => {
2551
+ i.some((F) => G(F, D)) ? l(i.filter((F) => !G(F, D))) : l([...i, D]);
2552
+ }, ze = (D) => {
2553
+ const F = j[D];
2554
2554
  F && H(F) && !F.disabled && Oe(F.value);
2555
- }, M = j.some((S) => H(S)), B = i.length > 0, oe = h ? Ne : z.length, pe = z.slice(0, oe), ut = z.length - oe;
2556
- return /* @__PURE__ */ e(Q.Provider, { value: x, children: /* @__PURE__ */ d(
2555
+ }, B = j.some((D) => H(D)), A = i.length > 0, oe = h ? Ne : L.length, pe = L.slice(0, oe), ut = L.length - oe;
2556
+ return /* @__PURE__ */ e(Q.Provider, { value: N, children: /* @__PURE__ */ d(
2557
2557
  "div",
2558
2558
  {
2559
2559
  className: m(
@@ -2561,130 +2561,130 @@ const Pl = (n) => {
2561
2561
  t
2562
2562
  ),
2563
2563
  children: [
2564
- /* @__PURE__ */ e(q, { children: s }),
2564
+ /* @__PURE__ */ e(Y, { children: o }),
2565
2565
  /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: E, children: [
2566
2566
  /* @__PURE__ */ d(
2567
2567
  "div",
2568
2568
  {
2569
2569
  ...le({
2570
- ref: L,
2570
+ ref: T,
2571
2571
  role: "button",
2572
- tabIndex: p ? -1 : 0,
2573
- "aria-disabled": p,
2572
+ tabIndex: f ? -1 : 0,
2573
+ "aria-disabled": f,
2574
2574
  onClick: () => {
2575
- p || C(!b);
2575
+ f || I(!u);
2576
2576
  },
2577
- onKeyDown: (S) => {
2578
- p || (S.key === " " ? (S.preventDefault(), C((F) => !F)) : S.key === "Enter" && !b ? (S.preventDefault(), C(!0)) : S.key === "Backspace" && !b && B && (S.preventDefault(), o(i.slice(0, -1))));
2577
+ onKeyDown: (D) => {
2578
+ f || (D.key === " " ? (D.preventDefault(), I((F) => !F)) : D.key === "Enter" && !u ? (D.preventDefault(), I(!0)) : D.key === "Backspace" && !u && A && (D.preventDefault(), l(i.slice(0, -1))));
2579
2579
  }
2580
2580
  }),
2581
2581
  className: m(
2582
2582
  "flex flex-row items-center gap-1 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2583
- h && m("flex-nowrap overflow-hidden", te[x]),
2584
- !h && m("flex-wrap py-1.5", Ft[x]),
2585
- Y[x],
2586
- me[x],
2587
- u && B ? Be[x] : fe[x],
2588
- p ? "select-trigger-disabled" : w && "select-trigger-error",
2589
- !p && b && "ring-4"
2583
+ h && m("flex-nowrap overflow-hidden", te[N]),
2584
+ !h && m("flex-wrap py-1.5", Ft[N]),
2585
+ J[N],
2586
+ me[N],
2587
+ p && A ? Be[N] : fe[N],
2588
+ f ? "select-trigger-disabled" : R && "select-trigger-error",
2589
+ !f && u && "ring-4"
2590
2590
  ),
2591
2591
  children: [
2592
- B && pe.map((S, F) => /* @__PURE__ */ e(
2592
+ A && pe.map((D, F) => /* @__PURE__ */ e(
2593
2593
  Ee,
2594
2594
  {
2595
- color: g,
2595
+ color: v,
2596
2596
  className: m(
2597
2597
  h && oe > 1 && "shrink-0",
2598
2598
  (!h || oe === 1) && "max-w-full min-w-0"
2599
2599
  ),
2600
- children: S.label
2600
+ children: D.label
2601
2601
  },
2602
2602
  `badge-${F}`
2603
2603
  )),
2604
- B && ut > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-medium select-placeholder px-1", children: [
2604
+ A && ut > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-medium select-placeholder px-1", children: [
2605
2605
  "+",
2606
2606
  ut,
2607
2607
  " more"
2608
2608
  ] }),
2609
- !B && c && /* @__PURE__ */ e("span", { className: "select-placeholder", children: c })
2609
+ !A && c && /* @__PURE__ */ e("span", { className: "select-placeholder", children: c })
2610
2610
  ]
2611
2611
  }
2612
2612
  ),
2613
2613
  h && /* @__PURE__ */ d(
2614
2614
  "div",
2615
2615
  {
2616
- ref: y,
2616
+ ref: g,
2617
2617
  "aria-hidden": !0,
2618
2618
  className: "absolute top-0 left-0 invisible pointer-events-none flex flex-row flex-nowrap items-center gap-1 w-max",
2619
2619
  children: [
2620
- z.map((S, F) => /* @__PURE__ */ e(Ee, { color: g, children: S.label }, `measure-${F}`)),
2621
- z.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
2620
+ L.map((D, F) => /* @__PURE__ */ e(Ee, { color: v, children: D.label }, `measure-${F}`)),
2621
+ L.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
2622
2622
  "+",
2623
- z.length,
2623
+ L.length,
2624
2624
  " more"
2625
2625
  ] })
2626
2626
  ]
2627
2627
  }
2628
2628
  ),
2629
- /* @__PURE__ */ d(he, { ref: A, children: [
2630
- !p && w && /* @__PURE__ */ e(ne, {}),
2631
- u && B && !p && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o([]) }),
2629
+ /* @__PURE__ */ d(he, { ref: M, children: [
2630
+ !f && R && /* @__PURE__ */ e(ne, {}),
2631
+ p && A && !f && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l([]) }),
2632
2632
  /* @__PURE__ */ e(Z, { Icon: be })
2633
2633
  ] }),
2634
- /* @__PURE__ */ e(U, { open: b, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: f }, children: [
2634
+ /* @__PURE__ */ e(U, { open: u, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: b }, children: [
2635
2635
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2636
2636
  /* @__PURE__ */ e(
2637
2637
  "input",
2638
2638
  {
2639
- ref: T,
2639
+ ref: z,
2640
2640
  type: "text",
2641
2641
  placeholder: "Search",
2642
- value: I,
2642
+ value: k,
2643
2643
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2644
- onChange: (S) => D(S.target.value),
2645
- onKeyDown: (S) => {
2646
- S.key === "Enter" && O != null ? (S.preventDefault(), ze(O)) : S.key === "Backspace" && I === "" && B && (S.preventDefault(), o(i.slice(0, -1)));
2644
+ onChange: (D) => S(D.target.value),
2645
+ onKeyDown: (D) => {
2646
+ D.key === "Enter" && O != null ? (D.preventDefault(), ze(O)) : D.key === "Backspace" && k === "" && A && (D.preventDefault(), l(i.slice(0, -1)));
2647
2647
  }
2648
2648
  }
2649
2649
  ),
2650
2650
  /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2651
2651
  ] }),
2652
2652
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2653
- I !== "" && !M && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2654
- j.map((S, F) => {
2655
- if (!H(S))
2656
- return S.kind === "header" ? /* @__PURE__ */ e(
2653
+ k !== "" && !B && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2654
+ j.map((D, F) => {
2655
+ if (!H(D))
2656
+ return D.kind === "header" ? /* @__PURE__ */ e(
2657
2657
  He,
2658
2658
  {
2659
2659
  ref: (ge) => {
2660
- N.current[F] = ge;
2660
+ w.current[F] = ge;
2661
2661
  },
2662
- children: S.label
2662
+ children: D.label
2663
2663
  },
2664
2664
  `header-${F}`
2665
2665
  ) : /* @__PURE__ */ e(
2666
2666
  $e,
2667
2667
  {
2668
2668
  ref: (ge) => {
2669
- N.current[F] = ge;
2669
+ w.current[F] = ge;
2670
2670
  }
2671
2671
  },
2672
2672
  `divider-${F}`
2673
2673
  );
2674
- const Ie = i.some((ge) => G(ge, S.value));
2674
+ const Ie = i.some((ge) => G(ge, D.value));
2675
2675
  return /* @__PURE__ */ e(
2676
2676
  We,
2677
2677
  {
2678
2678
  ...ee({
2679
2679
  ref(ge) {
2680
- N.current[F] = ge;
2680
+ w.current[F] = ge;
2681
2681
  }
2682
2682
  }),
2683
2683
  onClick: () => ze(F),
2684
2684
  selected: Ie,
2685
2685
  active: O === F,
2686
- disabled: S.disabled,
2687
- children: S.label
2686
+ disabled: D.disabled,
2687
+ children: D.label
2688
2688
  },
2689
2689
  `option-${F}`
2690
2690
  );
@@ -2692,15 +2692,15 @@ const Pl = (n) => {
2692
2692
  ] })
2693
2693
  ] }) })
2694
2694
  ] }),
2695
- /* @__PURE__ */ e(V, { children: l }),
2696
- /* @__PURE__ */ e(K, { children: w })
2695
+ /* @__PURE__ */ e(V, { children: s }),
2696
+ /* @__PURE__ */ e(K, { children: R })
2697
2697
  ]
2698
2698
  }
2699
2699
  ) });
2700
- }, Ll = R.forwardRef((n, t) => {
2700
+ }, Pl = C.forwardRef((n, t) => {
2701
2701
  const {
2702
- className: s,
2703
- children: l,
2702
+ className: o,
2703
+ children: s,
2704
2704
  ...r
2705
2705
  } = n;
2706
2706
  return /* @__PURE__ */ e(
@@ -2709,16 +2709,16 @@ const Pl = (n) => {
2709
2709
  ref: t,
2710
2710
  className: m(
2711
2711
  "flex flex-col gap-6 border panel-base rounded-2xl shadow-sm px-6 py-6",
2712
- s
2712
+ o
2713
2713
  ),
2714
2714
  ...r,
2715
- children: l
2715
+ children: s
2716
2716
  }
2717
2717
  );
2718
- }), El = R.forwardRef((n, t) => {
2718
+ }), El = C.forwardRef((n, t) => {
2719
2719
  const {
2720
- className: s,
2721
- children: l,
2720
+ className: o,
2721
+ children: s,
2722
2722
  ...r
2723
2723
  } = n;
2724
2724
  return /* @__PURE__ */ e(
@@ -2727,19 +2727,19 @@ const Pl = (n) => {
2727
2727
  ref: t,
2728
2728
  className: m(
2729
2729
  "flex flex-col gap-1 border panel-base rounded-2xl shadow-sm p-2",
2730
- s
2730
+ o
2731
2731
  ),
2732
2732
  ...r,
2733
- children: l
2733
+ children: s
2734
2734
  }
2735
2735
  );
2736
2736
  }), yt = "input-description text-sm font-medium", Fl = (n) => {
2737
2737
  const {
2738
2738
  className: t,
2739
- label: s,
2740
- children: l,
2739
+ label: o,
2740
+ children: s,
2741
2741
  orientation: r = "vertical",
2742
- ...o
2742
+ ...l
2743
2743
  } = n;
2744
2744
  return r === "horizontal" ? /* @__PURE__ */ d(
2745
2745
  "div",
@@ -2748,10 +2748,10 @@ const Pl = (n) => {
2748
2748
  "flex flex-row items-center gap-3 px-3 py-2",
2749
2749
  t
2750
2750
  ),
2751
- ...o,
2751
+ ...l,
2752
2752
  children: [
2753
- /* @__PURE__ */ e("div", { className: m(yt, "w-1/2 line-clamp-1 break-all"), children: s }),
2754
- /* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: l })
2753
+ /* @__PURE__ */ e("div", { className: m(yt, "w-1/2 line-clamp-1 break-all"), children: o }),
2754
+ /* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: s })
2755
2755
  ]
2756
2756
  }
2757
2757
  ) : /* @__PURE__ */ d(
@@ -2761,10 +2761,10 @@ const Pl = (n) => {
2761
2761
  "flex flex-col gap-1 px-3 py-2",
2762
2762
  t
2763
2763
  ),
2764
- ...o,
2764
+ ...l,
2765
2765
  children: [
2766
- s && /* @__PURE__ */ e("div", { className: yt, children: s }),
2767
- /* @__PURE__ */ e("div", { children: l })
2766
+ o && /* @__PURE__ */ e("div", { className: yt, children: o }),
2767
+ /* @__PURE__ */ e("div", { children: s })
2768
2768
  ]
2769
2769
  }
2770
2770
  );
@@ -2781,28 +2781,28 @@ const Pl = (n) => {
2781
2781
  }, kt = "inline-flex flex-row gap-3 items-center justify-between h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", Ml = (n) => {
2782
2782
  const {
2783
2783
  className: t,
2784
- children: s,
2785
- Icon: l,
2784
+ children: o,
2785
+ Icon: s,
2786
2786
  status: r,
2787
- ...o
2787
+ ...l
2788
2788
  } = n, a = r ? Ar[r] : null, i = /* @__PURE__ */ d(ce, { children: [
2789
2789
  /* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-3 min-w-0", children: [
2790
- l && /* @__PURE__ */ e(l, { className: "h-5 w-5 shrink-0" }),
2791
- /* @__PURE__ */ e("span", { className: "truncate", children: s })
2790
+ s && /* @__PURE__ */ e(s, { className: "h-5 w-5 shrink-0" }),
2791
+ /* @__PURE__ */ e("span", { className: "truncate", children: o })
2792
2792
  ] }),
2793
2793
  /* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-2 shrink-0", children: [
2794
2794
  a && r && /* @__PURE__ */ e(a, { className: m("h-5 w-5", Ur[r]) }),
2795
2795
  /* @__PURE__ */ e(cn, { className: "h-5 w-5 text-[var(--color-input-icon-button-icon)]" })
2796
2796
  ] })
2797
2797
  ] });
2798
- if (o.href !== void 0) {
2799
- const { href: c, ...f } = o;
2798
+ if (l.href !== void 0) {
2799
+ const { href: c, ...b } = l;
2800
2800
  return /* @__PURE__ */ e(
2801
2801
  "a",
2802
2802
  {
2803
2803
  href: c,
2804
2804
  className: m(kt, t),
2805
- ...f,
2805
+ ...b,
2806
2806
  children: i
2807
2807
  }
2808
2808
  );
@@ -2811,67 +2811,67 @@ const Pl = (n) => {
2811
2811
  "button",
2812
2812
  {
2813
2813
  className: m(kt, t),
2814
- ...o,
2814
+ ...l,
2815
2815
  children: i
2816
2816
  }
2817
2817
  );
2818
2818
  }, Bl = (n) => {
2819
2819
  const {
2820
2820
  className: t,
2821
- vertical: s = !1,
2822
- ...l
2821
+ vertical: o = !1,
2822
+ ...s
2823
2823
  } = n;
2824
2824
  return /* @__PURE__ */ e(
2825
2825
  "div",
2826
2826
  {
2827
2827
  className: m(
2828
- s ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
2828
+ o ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
2829
2829
  t
2830
2830
  ),
2831
- ...l
2831
+ ...s
2832
2832
  }
2833
2833
  );
2834
2834
  }, Al = (n) => {
2835
2835
  const {
2836
2836
  children: t,
2837
- content: s,
2838
- className: l,
2837
+ content: o,
2838
+ className: s,
2839
2839
  placement: r = "top",
2840
- minWidth: o = 100,
2840
+ minWidth: l = 100,
2841
2841
  maxWidth: a = 200
2842
- } = n, [i, c] = W(!1), { anchorRef: f, Popover: w } = ct({
2842
+ } = n, [i, c] = W(!1), { anchorRef: b, Popover: R } = ct({
2843
2843
  placement: r,
2844
- minWidth: o,
2844
+ minWidth: l,
2845
2845
  maxWidth: a
2846
2846
  });
2847
2847
  return /* @__PURE__ */ d(
2848
2848
  "span",
2849
2849
  {
2850
- ref: f,
2851
- className: l,
2850
+ ref: b,
2851
+ className: s,
2852
2852
  onMouseEnter: () => c(!0),
2853
2853
  onMouseLeave: () => c(!1),
2854
2854
  children: [
2855
2855
  t,
2856
- /* @__PURE__ */ e(w, { open: i, children: /* @__PURE__ */ e(ve, { children: s }) })
2856
+ /* @__PURE__ */ e(R, { open: i, children: /* @__PURE__ */ e(ve, { children: o }) })
2857
2857
  ]
2858
2858
  }
2859
2859
  );
2860
2860
  }, Ul = (n) => {
2861
2861
  const {
2862
2862
  open: t,
2863
- onDismiss: s,
2864
- enableDismissOnOutsideClick: l,
2863
+ onDismiss: o,
2864
+ enableDismissOnOutsideClick: s,
2865
2865
  enableDismissOnEscKey: r,
2866
- enableDismissButton: o,
2866
+ enableDismissButton: l,
2867
2867
  className: a,
2868
2868
  children: i,
2869
2869
  maxWidth: c = 600
2870
2870
  } = n;
2871
- return xe(!!r && t, s || (() => {
2871
+ return xe(!!r && t, o || (() => {
2872
2872
  })), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
2873
2873
  /* @__PURE__ */ e(
2874
- J.div,
2874
+ q.div,
2875
2875
  {
2876
2876
  className: "z-40",
2877
2877
  style: { transformOrigin: "center" },
@@ -2883,14 +2883,14 @@ const Pl = (n) => {
2883
2883
  Ot,
2884
2884
  {
2885
2885
  className: "modal-overlay backdrop-blur-[1px]",
2886
- onClick: l ? s : void 0,
2886
+ onClick: s ? o : void 0,
2887
2887
  lockScroll: !0
2888
2888
  }
2889
2889
  )
2890
2890
  }
2891
2891
  ),
2892
2892
  /* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-50", children: /* @__PURE__ */ d(
2893
- J.div,
2893
+ q.div,
2894
2894
  {
2895
2895
  className: m(
2896
2896
  "flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",
@@ -2902,14 +2902,14 @@ const Pl = (n) => {
2902
2902
  exit: { opacity: 0, scale: 0.98, translateY: 10 },
2903
2903
  transition: { duration: 0.15, ease: "easeInOut" },
2904
2904
  children: [
2905
- o && /* @__PURE__ */ e(
2905
+ l && /* @__PURE__ */ e(
2906
2906
  Ut,
2907
2907
  {
2908
2908
  Icon: de,
2909
2909
  className: "absolute top-4 right-4",
2910
2910
  variant: "transparent",
2911
2911
  size: "sm",
2912
- onClick: s
2912
+ onClick: o
2913
2913
  }
2914
2914
  ),
2915
2915
  i
@@ -2920,18 +2920,18 @@ const Pl = (n) => {
2920
2920
  }, Wl = (n) => {
2921
2921
  const {
2922
2922
  open: t,
2923
- onDismiss: s,
2924
- enableDismissOnOutsideClick: l,
2923
+ onDismiss: o,
2924
+ enableDismissOnOutsideClick: s,
2925
2925
  enableDismissOnEscKey: r,
2926
- enableDismissButton: o,
2926
+ enableDismissButton: l,
2927
2927
  className: a,
2928
2928
  children: i,
2929
2929
  maxWidth: c = 480
2930
2930
  } = n;
2931
- return xe(!!r && t, s || (() => {
2931
+ return xe(!!r && t, o || (() => {
2932
2932
  })), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
2933
2933
  /* @__PURE__ */ e(
2934
- J.div,
2934
+ q.div,
2935
2935
  {
2936
2936
  className: "z-40",
2937
2937
  style: { transformOrigin: "center" },
@@ -2943,14 +2943,14 @@ const Pl = (n) => {
2943
2943
  Ot,
2944
2944
  {
2945
2945
  className: "modal-overlay backdrop-blur-[1px]",
2946
- onClick: l ? s : void 0,
2946
+ onClick: s ? o : void 0,
2947
2947
  lockScroll: !0
2948
2948
  }
2949
2949
  )
2950
2950
  }
2951
2951
  ),
2952
2952
  /* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-row justify-end pointer-events-none z-50", children: /* @__PURE__ */ d(
2953
- J.div,
2953
+ q.div,
2954
2954
  {
2955
2955
  className: m(
2956
2956
  "flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",
@@ -2962,14 +2962,14 @@ const Pl = (n) => {
2962
2962
  exit: { translateX: "100%" },
2963
2963
  transition: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
2964
2964
  children: [
2965
- o && /* @__PURE__ */ e(
2965
+ l && /* @__PURE__ */ e(
2966
2966
  Ut,
2967
2967
  {
2968
2968
  Icon: de,
2969
2969
  className: "absolute top-4 right-4",
2970
2970
  variant: "transparent",
2971
2971
  size: "sm",
2972
- onClick: s
2972
+ onClick: o
2973
2973
  }
2974
2974
  ),
2975
2975
  i
@@ -2980,35 +2980,35 @@ const Pl = (n) => {
2980
2980
  }, Wr = (n) => {
2981
2981
  const {
2982
2982
  className: t,
2983
- tabs: s
2983
+ tabs: o
2984
2984
  } = n;
2985
2985
  return /* @__PURE__ */ e("div", { className: m(
2986
2986
  "h-12 tab-container p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto mat-ui-hide-scrollbars",
2987
2987
  t
2988
- ), children: s.map((l, r) => {
2989
- const o = m(
2988
+ ), children: o.map((s, r) => {
2989
+ const l = m(
2990
2990
  "shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 tab-button transition-all duration-150 select-none focus:outline-none focus:ring-0",
2991
- l.active && "tab-button-active shadow-sm"
2991
+ s.active && "tab-button-active shadow-sm"
2992
2992
  );
2993
- return l.href ? /* @__PURE__ */ d(
2993
+ return s.href ? /* @__PURE__ */ d(
2994
2994
  "a",
2995
2995
  {
2996
- href: l.href,
2997
- className: o,
2996
+ href: s.href,
2997
+ className: l,
2998
2998
  children: [
2999
- l.Icon && /* @__PURE__ */ e(l.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3000
- l.label
2999
+ s.Icon && /* @__PURE__ */ e(s.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3000
+ s.label
3001
3001
  ]
3002
3002
  },
3003
3003
  r
3004
3004
  ) : /* @__PURE__ */ d(
3005
3005
  "button",
3006
3006
  {
3007
- className: o,
3008
- onClick: l.onClick,
3007
+ className: l,
3008
+ onClick: s.onClick,
3009
3009
  children: [
3010
- l.Icon && /* @__PURE__ */ e(l.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3011
- l.label
3010
+ s.Icon && /* @__PURE__ */ e(s.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3011
+ s.label
3012
3012
  ]
3013
3013
  },
3014
3014
  r
@@ -3017,112 +3017,131 @@ const Pl = (n) => {
3017
3017
  }, Hl = (n) => {
3018
3018
  const {
3019
3019
  duration: t = 0.3,
3020
- ease: s = "easeInOut",
3021
- horizontal: l = !1,
3022
- children: r,
3023
- className: o,
3024
- ...a
3025
- } = n, i = R.useRef(null), c = R.useRef(null), f = R.useRef(null);
3026
- return R.useEffect(() => {
3027
- const w = i.current, x = c.current;
3028
- if (!w || !x) return;
3029
- let h = !0;
3030
- const g = () => {
3031
- const u = l ? w.scrollWidth - w.clientWidth : w.scrollHeight - w.clientHeight, b = l ? w.scrollLeft : w.scrollTop;
3032
- if (!(u <= 0 || Math.abs(u - b) < 1)) {
3033
- if (h) {
3034
- h = !1, l ? w.scrollLeft = u : w.scrollTop = u;
3020
+ ease: o = "easeInOut",
3021
+ horizontal: s = !1,
3022
+ pauseOnScroll: r = !1,
3023
+ threshold: l = 1,
3024
+ onPinnedChange: a,
3025
+ children: i,
3026
+ className: c,
3027
+ ...b
3028
+ } = n, R = C.useRef(null), N = C.useRef(null), h = C.useRef(null), v = C.useRef(!0), f = C.useRef(!1), p = C.useRef(a);
3029
+ return p.current = a, C.useEffect(() => {
3030
+ const u = R.current, I = N.current;
3031
+ if (!u || !I) return;
3032
+ let x = !0;
3033
+ const y = () => s ? u.scrollWidth - u.clientWidth : u.scrollHeight - u.clientHeight, k = () => s ? u.scrollLeft : u.scrollTop, S = (g) => {
3034
+ s ? u.scrollLeft = g : u.scrollTop = g;
3035
+ }, O = (g) => {
3036
+ v.current !== g && (v.current = g, p.current?.(g));
3037
+ }, P = () => {
3038
+ if (r && !v.current) return;
3039
+ const g = y(), M = k();
3040
+ if (!(g <= 0 || Math.abs(g - M) < 1)) {
3041
+ if (x) {
3042
+ x = !1, f.current = !0, S(g), requestAnimationFrame(() => {
3043
+ f.current = !1;
3044
+ });
3035
3045
  return;
3036
3046
  }
3037
- f.current?.stop(), f.current = Kt(b, u, {
3047
+ h.current?.stop(), f.current = !0, h.current = Kt(M, g, {
3038
3048
  duration: t,
3039
- ease: s,
3040
- onUpdate: (C) => {
3041
- l ? w.scrollLeft = C : w.scrollTop = C;
3049
+ ease: o,
3050
+ onUpdate: S,
3051
+ onComplete: () => {
3052
+ requestAnimationFrame(() => {
3053
+ f.current = !1;
3054
+ });
3042
3055
  }
3043
3056
  });
3044
3057
  }
3045
- }, p = new ResizeObserver(g);
3046
- return p.observe(x), () => {
3047
- p.disconnect(), f.current?.stop();
3058
+ }, T = new ResizeObserver(P);
3059
+ T.observe(I);
3060
+ const z = () => {
3061
+ f.current || O(y() - k() <= l);
3062
+ }, w = () => {
3063
+ h.current?.stop(), f.current = !1;
3064
+ };
3065
+ return r && (u.addEventListener("scroll", z, { passive: !0 }), u.addEventListener("wheel", w, { passive: !0 }), u.addEventListener("touchstart", w, { passive: !0 })), () => {
3066
+ T.disconnect(), h.current?.stop(), r && (u.removeEventListener("scroll", z), u.removeEventListener("wheel", w), u.removeEventListener("touchstart", w));
3048
3067
  };
3049
- }, [t, s, l]), /* @__PURE__ */ e(
3068
+ }, [t, o, s, r, l]), /* @__PURE__ */ e(
3050
3069
  "div",
3051
3070
  {
3052
- ref: i,
3071
+ ref: R,
3053
3072
  className: m(
3054
3073
  "min-h-0 min-w-0",
3055
- l ? "overflow-x-auto" : "overflow-y-auto",
3056
- o
3074
+ s ? "overflow-x-auto" : "overflow-y-auto",
3075
+ c
3057
3076
  ),
3058
- ...a,
3059
- children: /* @__PURE__ */ e("div", { ref: c, children: r })
3077
+ ...b,
3078
+ children: /* @__PURE__ */ e("div", { ref: N, children: i })
3060
3079
  }
3061
3080
  );
3062
3081
  };
3063
3082
  function Hr(n) {
3064
3083
  const {
3065
3084
  onDelta: t,
3066
- onDragStart: s,
3067
- onDragEnd: l,
3085
+ onDragStart: o,
3086
+ onDragEnd: s,
3068
3087
  disabled: r = !1,
3069
- primaryButtonOnly: o = !0,
3088
+ primaryButtonOnly: l = !0,
3070
3089
  preventScrollOnMove: a = !0
3071
- } = n, [i, c] = R.useState(!1), f = R.useRef(!1), w = R.useRef(0), x = R.useRef(0), h = R.useRef(0), g = R.useRef(null), p = R.useRef(null), u = R.useRef({ onDelta: t, onDragStart: s, onDragEnd: l, preventScrollOnMove: a });
3072
- R.useEffect(() => {
3073
- u.current = { onDelta: t, onDragStart: s, onDragEnd: l, preventScrollOnMove: a };
3090
+ } = n, [i, c] = C.useState(!1), b = C.useRef(!1), R = C.useRef(0), N = C.useRef(0), h = C.useRef(0), v = C.useRef(null), f = C.useRef(null), p = C.useRef({ onDelta: t, onDragStart: o, onDragEnd: s, preventScrollOnMove: a });
3091
+ C.useEffect(() => {
3092
+ p.current = { onDelta: t, onDragStart: o, onDragEnd: s, preventScrollOnMove: a };
3074
3093
  });
3075
- const b = R.useRef({}), C = R.useCallback((k) => {
3076
- if (!f.current) return;
3077
- const I = {
3078
- clientX: k ?? x.current,
3079
- startX: w.current,
3094
+ const u = C.useRef({}), I = C.useCallback((y) => {
3095
+ if (!b.current) return;
3096
+ const k = {
3097
+ clientX: y ?? N.current,
3098
+ startX: R.current,
3080
3099
  totalDeltaX: h.current,
3081
- target: g.current
3100
+ target: v.current
3082
3101
  };
3083
- f.current = !1, c(!1);
3084
- const { move: D, up: O, keydown: P } = b.current;
3085
- D && window.removeEventListener("pointermove", D, !0), O && (window.removeEventListener("pointerup", O, !0), window.removeEventListener("pointercancel", O, !0)), P && window.removeEventListener("keydown", P, !0), b.current = {}, p.current != null && (cancelAnimationFrame(p.current), p.current = null), u.current.onDragEnd?.(I), g.current = null, h.current = 0;
3086
- }, []), v = R.useCallback((k) => {
3087
- if (r || o && k.button !== 0) return;
3088
- k.target.setPointerCapture?.(k.pointerId), w.current = k.clientX, x.current = k.clientX, h.current = 0, g.current = k.target, f.current = !0, c(!0);
3089
- const I = {
3090
- clientX: k.clientX,
3091
- startX: k.clientX,
3102
+ b.current = !1, c(!1);
3103
+ const { move: S, up: O, keydown: P } = u.current;
3104
+ S && window.removeEventListener("pointermove", S, !0), O && (window.removeEventListener("pointerup", O, !0), window.removeEventListener("pointercancel", O, !0)), P && window.removeEventListener("keydown", P, !0), u.current = {}, f.current != null && (cancelAnimationFrame(f.current), f.current = null), p.current.onDragEnd?.(k), v.current = null, h.current = 0;
3105
+ }, []), x = C.useCallback((y) => {
3106
+ if (r || l && y.button !== 0) return;
3107
+ y.target.setPointerCapture?.(y.pointerId), R.current = y.clientX, N.current = y.clientX, h.current = 0, v.current = y.target, b.current = !0, c(!0);
3108
+ const k = {
3109
+ clientX: y.clientX,
3110
+ startX: y.clientX,
3092
3111
  totalDeltaX: 0,
3093
- target: k.target
3112
+ target: y.target
3094
3113
  };
3095
- u.current.onDragStart?.(I);
3096
- const D = (L) => {
3097
- f.current && p.current == null && (p.current = requestAnimationFrame(() => {
3098
- p.current = null;
3099
- const T = L.clientX, N = T - x.current;
3100
- if (N === 0) return;
3101
- x.current = T, h.current += N;
3102
- const y = {
3103
- clientX: T,
3104
- startX: w.current,
3114
+ p.current.onDragStart?.(k);
3115
+ const S = (T) => {
3116
+ b.current && f.current == null && (f.current = requestAnimationFrame(() => {
3117
+ f.current = null;
3118
+ const z = T.clientX, w = z - N.current;
3119
+ if (w === 0) return;
3120
+ N.current = z, h.current += w;
3121
+ const g = {
3122
+ clientX: z,
3123
+ startX: R.current,
3105
3124
  totalDeltaX: h.current,
3106
- target: g.current
3125
+ target: v.current
3107
3126
  };
3108
- u.current.preventScrollOnMove && L.preventDefault(), u.current.onDelta(N, y);
3127
+ p.current.preventScrollOnMove && T.preventDefault(), p.current.onDelta(w, g);
3109
3128
  }));
3110
- }, O = (L) => {
3111
- C(L.clientX);
3112
- }, P = (L) => {
3113
- L.key === "Escape" && (L.preventDefault(), C());
3129
+ }, O = (T) => {
3130
+ I(T.clientX);
3131
+ }, P = (T) => {
3132
+ T.key === "Escape" && (T.preventDefault(), I());
3114
3133
  };
3115
- b.current = { move: D, up: O, keydown: P }, window.addEventListener("pointermove", D, {
3134
+ u.current = { move: S, up: O, keydown: P }, window.addEventListener("pointermove", S, {
3116
3135
  passive: !a,
3117
3136
  capture: !0
3118
3137
  }), window.addEventListener("pointerup", O, { capture: !0 }), window.addEventListener("pointercancel", O, { capture: !0 }), window.addEventListener("keydown", P, !0);
3119
- }, [C, r, a, o]);
3120
- return R.useEffect(() => () => {
3121
- f.current && C();
3122
- }, [C]), {
3138
+ }, [I, r, a, l]);
3139
+ return C.useEffect(() => () => {
3140
+ b.current && I();
3141
+ }, [I]), {
3123
3142
  isDragging: i,
3124
3143
  bind: {
3125
- onPointerDown: v,
3144
+ onPointerDown: x,
3126
3145
  role: "separator",
3127
3146
  style: { touchAction: "none", cursor: "col-resize", userSelect: "none" }
3128
3147
  }
@@ -3131,18 +3150,18 @@ function Hr(n) {
3131
3150
  const $r = (n) => {
3132
3151
  const {
3133
3152
  column: t,
3134
- width: s,
3135
- height: l,
3153
+ width: o,
3154
+ height: s,
3136
3155
  onResize: r,
3137
- sortDirection: o,
3156
+ sortDirection: l,
3138
3157
  onSortClick: a
3139
3158
  } = n, i = !!t.sortable, { bind: c } = Hr({
3140
- onDelta: (f) => r(f)
3159
+ onDelta: (b) => r(b)
3141
3160
  });
3142
3161
  return /* @__PURE__ */ d(
3143
3162
  "div",
3144
3163
  {
3145
- style: { width: s, height: l },
3164
+ style: { width: o, height: s },
3146
3165
  className: "flex flex-row items-stretch select-none shrink-0",
3147
3166
  children: [
3148
3167
  /* @__PURE__ */ d(
@@ -3155,8 +3174,8 @@ const $r = (n) => {
3155
3174
  onClick: i ? a : void 0,
3156
3175
  children: [
3157
3176
  /* @__PURE__ */ e("span", { className: "truncate", children: t.header }),
3158
- i && o === "asc" && /* @__PURE__ */ e(dn, { className: "h-4 w-4 shrink-0" }),
3159
- i && o === "desc" && /* @__PURE__ */ e(be, { className: "h-4 w-4 shrink-0" })
3177
+ i && l === "asc" && /* @__PURE__ */ e(dn, { className: "h-4 w-4 shrink-0" }),
3178
+ i && l === "desc" && /* @__PURE__ */ e(be, { className: "h-4 w-4 shrink-0" })
3160
3179
  ]
3161
3180
  }
3162
3181
  ),
@@ -3178,77 +3197,77 @@ const $r = (n) => {
3178
3197
  );
3179
3198
  }, ke = 200, _r = 60, jr = (n) => {
3180
3199
  const t = {};
3181
- for (const s of n)
3182
- t[s.id] = s.defaultWidth ?? ke;
3200
+ for (const o of n)
3201
+ t[o.id] = o.defaultWidth ?? ke;
3183
3202
  return t;
3184
3203
  }, Xr = (n) => {
3185
3204
  const {
3186
3205
  columns: t,
3187
- rows: s,
3188
- getRowId: l,
3206
+ rows: o,
3207
+ getRowId: s,
3189
3208
  onRowClick: r,
3190
- sort: o,
3209
+ sort: l,
3191
3210
  onSortChange: a,
3192
3211
  className: i,
3193
3212
  rowHeight: c = 44,
3194
- headerHeight: f = 44,
3195
- emptyState: w
3196
- } = n, [x, h] = W(() => jr(t));
3213
+ headerHeight: b = 44,
3214
+ emptyState: R
3215
+ } = n, [N, h] = W(() => jr(t));
3197
3216
  _(() => {
3198
- h((v) => {
3199
- const k = {};
3200
- let I = Object.keys(v).length !== t.length;
3201
- for (const D of t)
3202
- D.id in v ? k[D.id] = v[D.id] : (k[D.id] = D.defaultWidth ?? ke, I = !0);
3203
- return I ? k : v;
3217
+ h((x) => {
3218
+ const y = {};
3219
+ let k = Object.keys(x).length !== t.length;
3220
+ for (const S of t)
3221
+ S.id in x ? y[S.id] = x[S.id] : (y[S.id] = S.defaultWidth ?? ke, k = !0);
3222
+ return k ? y : x;
3204
3223
  });
3205
3224
  }, [t]);
3206
- const g = Pe((v, k, I) => {
3207
- h((D) => {
3208
- const O = D[v] ?? ke, P = Math.max(I, O + k);
3209
- return P === O ? D : { ...D, [v]: P };
3225
+ const v = Le((x, y, k) => {
3226
+ h((S) => {
3227
+ const O = S[x] ?? ke, P = Math.max(k, O + y);
3228
+ return P === O ? S : { ...S, [x]: P };
3210
3229
  });
3211
- }, []), p = Pe((v) => {
3230
+ }, []), f = Le((x) => {
3212
3231
  if (a) {
3213
- if (!o || o.columnId !== v) {
3214
- a({ columnId: v, direction: "asc" });
3232
+ if (!l || l.columnId !== x) {
3233
+ a({ columnId: x, direction: "asc" });
3215
3234
  return;
3216
3235
  }
3217
- if (o.direction === "asc") {
3218
- a({ columnId: v, direction: "desc" });
3236
+ if (l.direction === "asc") {
3237
+ a({ columnId: x, direction: "desc" });
3219
3238
  return;
3220
3239
  }
3221
3240
  a(null);
3222
3241
  }
3223
- }, [o, a]), u = t.reduce(
3224
- (v, k) => v + (x[k.id] ?? k.defaultWidth ?? ke),
3242
+ }, [l, a]), p = t.reduce(
3243
+ (x, y) => x + (N[y.id] ?? y.defaultWidth ?? ke),
3225
3244
  0
3226
- ), b = Ce(null), C = (v) => {
3227
- b.current && (b.current.scrollLeft = v.currentTarget.scrollLeft);
3245
+ ), u = Ce(null), I = (x) => {
3246
+ u.current && (u.current.scrollLeft = x.currentTarget.scrollLeft);
3228
3247
  };
3229
3248
  return /* @__PURE__ */ d("div", { className: m("flex flex-col h-full w-full", i), children: [
3230
3249
  /* @__PURE__ */ e(
3231
3250
  "div",
3232
3251
  {
3233
- ref: b,
3252
+ ref: u,
3234
3253
  className: "overflow-hidden shrink-0 table-header-strip",
3235
- style: { height: f },
3254
+ style: { height: b },
3236
3255
  children: /* @__PURE__ */ e(
3237
3256
  "div",
3238
3257
  {
3239
3258
  className: "flex flex-row table-header font-medium",
3240
- style: { width: u, minWidth: "100%" },
3241
- children: t.map((v) => /* @__PURE__ */ e(
3259
+ style: { width: p, minWidth: "100%" },
3260
+ children: t.map((x) => /* @__PURE__ */ e(
3242
3261
  $r,
3243
3262
  {
3244
- column: v,
3245
- width: x[v.id] ?? v.defaultWidth ?? ke,
3246
- height: f,
3247
- onResize: (k) => g(v.id, k, v.minWidth ?? _r),
3248
- sortDirection: o?.columnId === v.id ? o.direction : null,
3249
- onSortClick: () => p(v.id)
3263
+ column: x,
3264
+ width: N[x.id] ?? x.defaultWidth ?? ke,
3265
+ height: b,
3266
+ onResize: (y) => v(x.id, y, x.minWidth ?? _r),
3267
+ sortDirection: l?.columnId === x.id ? l.direction : null,
3268
+ onSortClick: () => f(x.id)
3250
3269
  },
3251
- v.id
3270
+ x.id
3252
3271
  ))
3253
3272
  }
3254
3273
  )
@@ -3258,34 +3277,34 @@ const $r = (n) => {
3258
3277
  "div",
3259
3278
  {
3260
3279
  className: "flex-1 overflow-auto",
3261
- onScroll: C,
3262
- children: s.length === 0 && w ? /* @__PURE__ */ e("div", { className: "flex h-full min-w-full items-center justify-center p-8", children: w }) : /* @__PURE__ */ e(
3280
+ onScroll: I,
3281
+ children: o.length === 0 && R ? /* @__PURE__ */ e("div", { className: "flex h-full min-w-full items-center justify-center p-8", children: R }) : /* @__PURE__ */ e(
3263
3282
  "div",
3264
3283
  {
3265
3284
  className: "flex flex-col",
3266
- style: { width: u, minWidth: "100%" },
3267
- children: s.map((v, k) => /* @__PURE__ */ e(
3285
+ style: { width: p, minWidth: "100%" },
3286
+ children: o.map((x, y) => /* @__PURE__ */ e(
3268
3287
  "div",
3269
3288
  {
3270
3289
  className: m(
3271
3290
  "flex flex-row table-body-row transition-colors duration-100",
3272
3291
  r && "cursor-pointer"
3273
3292
  ),
3274
- onClick: r ? () => r(v, k) : void 0,
3275
- children: t.map((I) => /* @__PURE__ */ e(
3293
+ onClick: r ? () => r(x, y) : void 0,
3294
+ children: t.map((k) => /* @__PURE__ */ e(
3276
3295
  "div",
3277
3296
  {
3278
3297
  className: "shrink-0 content-center px-4 relative",
3279
3298
  style: {
3280
- width: x[I.id] ?? I.defaultWidth ?? ke,
3299
+ width: N[k.id] ?? k.defaultWidth ?? ke,
3281
3300
  height: c
3282
3301
  },
3283
- children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: I.renderCell(v, k) })
3302
+ children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: k.renderCell(x, y) })
3284
3303
  },
3285
- I.id
3304
+ k.id
3286
3305
  ))
3287
3306
  },
3288
- l(v, k)
3307
+ s(x, y)
3289
3308
  ))
3290
3309
  }
3291
3310
  )
@@ -3293,20 +3312,20 @@ const $r = (n) => {
3293
3312
  )
3294
3313
  ] });
3295
3314
  }, $l = (n) => {
3296
- const { Icon: t, title: s, description: l, children: r, className: o } = n;
3297
- return /* @__PURE__ */ d("div", { className: m("flex flex-col items-center gap-3 text-center", o), children: [
3315
+ const { Icon: t, title: o, description: s, children: r, className: l } = n;
3316
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col items-center gap-3 text-center", l), children: [
3298
3317
  t && /* @__PURE__ */ e("div", { className: "flex h-14 w-14 items-center justify-center rounded-2xl bg-[var(--color-table-header-bg)]", children: /* @__PURE__ */ e(t, { className: "h-6 w-6 text-[var(--color-input-icon)]" }) }),
3299
- (s || l) && /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
3300
- s && /* @__PURE__ */ e("div", { className: "font-medium text-[var(--color-input-text)]", children: s }),
3301
- l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)]", children: l })
3318
+ (o || s) && /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
3319
+ o && /* @__PURE__ */ e("div", { className: "font-medium text-[var(--color-input-text)]", children: o }),
3320
+ s && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)]", children: s })
3302
3321
  ] }),
3303
3322
  r
3304
3323
  ] });
3305
3324
  }, Ct = (n) => {
3306
- const { label: t, children: s, className: l } = n;
3307
- return /* @__PURE__ */ d("div", { className: m("flex flex-col dropdown-button-group", l), children: [
3325
+ const { label: t, children: o, className: s } = n;
3326
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col dropdown-button-group", s), children: [
3308
3327
  t && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: t }),
3309
- s
3328
+ o
3310
3329
  ] });
3311
3330
  }, Vr = () => /* @__PURE__ */ e("div", {}), Kr = [
3312
3331
  { id: 1, email: "sarah.jennings@example.com", firstname: "Sarah", lastname: "Jennings", status: "active" },
@@ -3334,17 +3353,17 @@ const $r = (n) => {
3334
3353
  {
3335
3354
  id: "status",
3336
3355
  header: "Status",
3337
- renderCell: () => /* @__PURE__ */ e(Jr, {})
3356
+ renderCell: () => /* @__PURE__ */ e(qr, {})
3338
3357
  }
3339
3358
  ], _l = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
3340
3359
  /* @__PURE__ */ d("div", { className: "flex flex-row items-center justify-start gap-3", children: [
3341
3360
  /* @__PURE__ */ e(Wt, { Icon: Fe, placeholder: "Search..." }),
3342
- /* @__PURE__ */ e(qe, { Icon: mt }),
3361
+ /* @__PURE__ */ e(Ye, { Icon: mt }),
3343
3362
  /* @__PURE__ */ e(Gn, { Icon: ft, children: "New" }),
3344
3363
  /* @__PURE__ */ d(
3345
3364
  Ue,
3346
3365
  {
3347
- trigger: /* @__PURE__ */ e(qe, { Icon: mt }),
3366
+ trigger: /* @__PURE__ */ e(Ye, { Icon: mt }),
3348
3367
  children: [
3349
3368
  /* @__PURE__ */ e(X, { dismissOnClick: !1, Icon: ft, children: "Add new" }),
3350
3369
  /* @__PURE__ */ e(X, { Icon: un, children: "Remove" }),
@@ -3366,7 +3385,7 @@ const $r = (n) => {
3366
3385
  /* @__PURE__ */ e(Wr, { tabs: [
3367
3386
  {
3368
3387
  label: "Tab 1",
3369
- Icon: Ye,
3388
+ Icon: Je,
3370
3389
  active: !0,
3371
3390
  onClick: () => {
3372
3391
  }
@@ -3379,7 +3398,7 @@ const $r = (n) => {
3379
3398
  },
3380
3399
  {
3381
3400
  label: "Tab 3",
3382
- Icon: Ye,
3401
+ Icon: Je,
3383
3402
  active: !1,
3384
3403
  onClick: () => {
3385
3404
  }
@@ -3402,7 +3421,7 @@ const $r = (n) => {
3402
3421
  }
3403
3422
  ),
3404
3423
  /* @__PURE__ */ e(Vr, {})
3405
- ] }), Jr = () => /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ d(
3424
+ ] }), qr = () => /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ d(
3406
3425
  Ue,
3407
3426
  {
3408
3427
  placement: "bottom-end",
@@ -3422,7 +3441,7 @@ export {
3422
3441
  Mr as BadgeColor,
3423
3442
  Gn as Button,
3424
3443
  Ut as ButtonIconRound,
3425
- qe as ButtonIconSquare,
3444
+ Ye as ButtonIconSquare,
3426
3445
  Bl as Divider,
3427
3446
  X as DropdownButton,
3428
3447
  Ct as DropdownButtonGroup,
@@ -3438,14 +3457,14 @@ export {
3438
3457
  Il as InputFileSingle,
3439
3458
  Z as InputIconButton,
3440
3459
  he as InputIconButtonTray,
3441
- q as InputLabel,
3460
+ Y as InputLabel,
3442
3461
  Dl as InputLexical,
3443
3462
  wl as InputPassword,
3444
3463
  yl as InputRadio,
3445
3464
  Er as InputSelect,
3446
3465
  $e as InputSelectDivider,
3447
3466
  He as InputSelectGroupHeader,
3448
- Pl as InputSelectMultiple,
3467
+ Ll as InputSelectMultiple,
3449
3468
  Ol as InputSelectNative,
3450
3469
  We as InputSelectOption,
3451
3470
  zl as InputSelectSearchable,
@@ -3455,17 +3474,17 @@ export {
3455
3474
  Nr as LEXICAL_NODES,
3456
3475
  Cr as LexicalBlockTypeSelect,
3457
3476
  Sl as LexicalDefaultToolbarContent,
3458
- Lr as LexicalFloatingToolbar,
3477
+ Pr as LexicalFloatingToolbar,
3459
3478
  Rr as LexicalFormatButtons,
3460
3479
  Or as LexicalHistoryButtons,
3461
3480
  Dr as LexicalLinkButton,
3462
3481
  Sr as LexicalListButtons,
3463
- Pr as LexicalToolbar,
3482
+ Lr as LexicalToolbar,
3464
3483
  ie as LexicalToolbarButton,
3465
- Je as LexicalToolbarDivider,
3484
+ qe as LexicalToolbarDivider,
3466
3485
  Vt as LexicalToolbarItems,
3467
3486
  Ul as Modal,
3468
- Ll as Panel,
3487
+ Pl as Panel,
3469
3488
  Fl as PanelField,
3470
3489
  Ml as PanelLink,
3471
3490
  El as PanelStack,