@opencxh/ui-kit 3.94.0 → 3.98.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { clsx as je } from "clsx";
2
- import { jsxs as d, jsx as e, Fragment as $e } from "react/jsx-runtime";
3
- import { VideoOff as _e, User as Pe, MicOff as Be, Mic as Oe, ChevronDown as We, FileText as xe, HardDrive as ke, X as Fe, ArrowLeft as we, Search as Te, FolderPlus as Ve, Upload as Re, Folder as Ce, Pencil as He, ChevronDownIcon as qe, ChevronRight as Ue } from "lucide-react";
4
- import se, { useRef as J, useEffect as U, forwardRef as ce, useState as P, useCallback as ae, useMemo as de, createContext as Ge, Component as Ke } from "react";
2
+ import { jsxs as d, jsx as e, Fragment as we } from "react/jsx-runtime";
3
+ import { VideoOff as _e, User as Pe, MicOff as Be, Mic as Oe, ChevronDown as We, ChevronDownIcon as $e, FileText as xe, HardDrive as Ce, X as Fe, ArrowLeft as ke, Search as Te, FolderPlus as Ve, Upload as Re, Folder as Se, Pencil as He, ChevronRight as qe } from "lucide-react";
4
+ import se, { useRef as Z, useEffect as G, forwardRef as ce, useState as B, useMemo as de, useCallback as ae, createContext as Ue, Component as Ge } from "react";
5
5
  function p(...t) {
6
6
  return je(t);
7
7
  }
@@ -28,14 +28,14 @@ function nr({
28
28
  hasVideo: s,
29
29
  videoSlot: o,
30
30
  className: u,
31
- fill: b
31
+ fill: x
32
32
  }) {
33
33
  return /* @__PURE__ */ d(
34
34
  "div",
35
35
  {
36
36
  className: p(
37
37
  "relative rounded-lg overflow-hidden bg-gray-800 flex items-center justify-center",
38
- b ? "h-full w-full" : "aspect-video",
38
+ x ? "h-full w-full" : "aspect-video",
39
39
  n && "ring-2 ring-emerald-400",
40
40
  u
41
41
  ),
@@ -50,8 +50,8 @@ function nr({
50
50
  );
51
51
  }
52
52
  function ar({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
53
- const s = J(null);
54
- return U(() => {
53
+ const s = Z(null);
54
+ return G(() => {
55
55
  if (!a || !s.current) return;
56
56
  const o = t(s.current);
57
57
  return () => {
@@ -69,20 +69,20 @@ function ar({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
69
69
  }
70
70
  );
71
71
  }
72
- const Je = {
72
+ const Ke = {
73
73
  primary: "btn o__primary",
74
74
  secondary: "btn o__secondary",
75
75
  outline: "btn o__secondary",
76
76
  ghost: "btn o__tertiary",
77
77
  destructive: "btn o__destructive"
78
- }, Ye = {
78
+ }, Je = {
79
79
  xs: "px-2 py-1 text-xs",
80
80
  sm: "px-3 py-1.5 text-sm",
81
81
  md: "px-4 py-2 text-sm",
82
82
  lg: "px-6 py-3 text-base",
83
83
  xl: "px-8 py-4 text-lg",
84
84
  full: "px-4 py-3 text-base"
85
- }, Ze = {
85
+ }, Ye = {
86
86
  xs: "p-1",
87
87
  sm: "p-1.5",
88
88
  md: "p-2",
@@ -98,8 +98,8 @@ const Je = {
98
98
  leftIcon: s,
99
99
  rightIcon: o,
100
100
  iconOnly: u = !1,
101
- className: b,
102
- children: x,
101
+ className: x,
102
+ children: b,
103
103
  disabled: g,
104
104
  ...f
105
105
  }, l) => {
@@ -114,14 +114,14 @@ const Je = {
114
114
  "inline-flex items-center justify-center transition-colors duration-200",
115
115
  "disabled:opacity-50 disabled:cursor-not-allowed",
116
116
  // Variant styles
117
- Je[t],
117
+ Ke[t],
118
118
  // Size styles
119
- u ? Ze[a] : Ye[a],
119
+ u ? Ye[a] : Je[a],
120
120
  // Full width
121
121
  r && "w-full",
122
122
  // Loading state
123
123
  n && "cursor-wait",
124
- b
124
+ x
125
125
  ),
126
126
  disabled: m,
127
127
  ...f,
@@ -159,9 +159,9 @@ const Je = {
159
159
  }
160
160
  ),
161
161
  !n && s && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", !u && "mr-2"), children: s }),
162
- !u && x,
162
+ !u && b,
163
163
  !n && o && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", !u && "ml-2"), children: o }),
164
- u && !n && !s && !o && x
164
+ u && !n && !s && !o && b
165
165
  ]
166
166
  }
167
167
  );
@@ -206,12 +206,12 @@ const lr = ({
206
206
  external: s = !1,
207
207
  className: o,
208
208
  children: u,
209
- href: b,
210
- target: x,
209
+ href: x,
210
+ target: b,
211
211
  rel: g,
212
212
  ...f
213
213
  }) => {
214
- const l = s || b && (b.startsWith("http") || b.startsWith("mailto:")), m = p(
214
+ const l = s || x && (x.startsWith("http") || x.startsWith("mailto:")), m = p(
215
215
  // Base styles
216
216
  "inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
217
217
  // Size variants
@@ -267,8 +267,8 @@ const lr = ({
267
267
  o
268
268
  ), h = {
269
269
  ...f,
270
- href: n ? void 0 : b,
271
- target: l ? "_blank" : x,
270
+ href: n ? void 0 : x,
271
+ target: l ? "_blank" : b,
272
272
  rel: l ? "noopener noreferrer" : g
273
273
  };
274
274
  return /* @__PURE__ */ d("a", { className: m, ...h, children: [
@@ -293,84 +293,136 @@ const lr = ({
293
293
  }
294
294
  )
295
295
  ] });
296
- }, Se = {
296
+ }, Ze = ({
297
+ trigger: t,
298
+ children: a,
299
+ placement: r = "bottom-start",
300
+ className: n,
301
+ disabled: s = !1,
302
+ triggerLabel: o
303
+ }) => {
304
+ const [u, x] = B(!1), [b, g] = B({}), f = Z(null), l = Z(null);
305
+ G(() => {
306
+ if (!u) return;
307
+ const k = (y) => {
308
+ f.current && !f.current.contains(y.target) && x(!1);
309
+ }, w = (y) => {
310
+ y.key === "Escape" && x(!1);
311
+ };
312
+ return document.addEventListener("mousedown", k), document.addEventListener("keydown", w), () => {
313
+ document.removeEventListener("mousedown", k), document.removeEventListener("keydown", w);
314
+ };
315
+ }, [u]);
316
+ const m = (k) => {
317
+ if (k.stopPropagation(), !s) {
318
+ if (!u) {
319
+ const w = l.current?.getBoundingClientRect();
320
+ if (w) {
321
+ const A = {};
322
+ r.startsWith("bottom") ? A.top = w.bottom + 6 : A.bottom = window.innerHeight - w.top + 6, r.endsWith("start") ? A.left = w.left : A.right = window.innerWidth - w.right, g(A);
323
+ }
324
+ }
325
+ x((w) => !w);
326
+ }
327
+ }, h = () => x(!1);
328
+ return /* @__PURE__ */ d("div", { ref: f, className: "relative inline-flex", children: [
329
+ /* @__PURE__ */ e(
330
+ "button",
331
+ {
332
+ ref: l,
333
+ type: "button",
334
+ onClick: m,
335
+ disabled: s,
336
+ "aria-label": o,
337
+ "aria-expanded": u,
338
+ className: p("inline-flex items-center", s && "opacity-50 cursor-not-allowed"),
339
+ children: t
340
+ }
341
+ ),
342
+ u && /* @__PURE__ */ e(
343
+ "div",
344
+ {
345
+ className: p(
346
+ "fixed z-[60] bg-module rounded-lg shadow-lg border border-neutral",
347
+ n
348
+ ),
349
+ style: b,
350
+ children: typeof a == "function" ? a(h) : a
351
+ }
352
+ )
353
+ ] });
354
+ }, Xe = {
297
355
  primary: "btn o__primary",
298
356
  secondary: "btn o__secondary",
299
357
  outline: "btn o__secondary"
300
- }, Xe = {
301
- sm: "px-3 py-1.5 text-sm",
302
- md: "px-4 py-2 text-sm"
303
358
  };
304
- function ze({
359
+ function De({
305
360
  label: t,
306
361
  onClick: a,
307
362
  variant: r = "primary",
308
363
  size: n = "md",
309
364
  icon: s,
310
365
  options: o,
311
- disabled: u = !1
366
+ disabled: u = !1,
367
+ loading: x = !1,
368
+ menuPlacement: b = "bottom-end",
369
+ menuLabel: g = "More options"
312
370
  }) {
313
- const [b, x] = P(!1), g = J(null), f = ae(() => {
314
- x((l) => !l);
315
- }, []);
316
- return U(() => {
317
- const l = (m) => {
318
- g.current && !g.current.contains(m.target) && x(!1);
319
- };
320
- return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
321
- }, []), /* @__PURE__ */ d("div", { ref: g, className: "relative inline-flex items-center gap-px", children: [
322
- /* @__PURE__ */ d(
323
- "button",
371
+ const f = u || x, l = o.length > 0;
372
+ return /* @__PURE__ */ d("div", { className: "inline-flex items-center gap-px", children: [
373
+ /* @__PURE__ */ e(
374
+ te,
324
375
  {
325
- type: "button",
376
+ variant: r,
377
+ size: n,
326
378
  onClick: a,
327
379
  disabled: u,
328
- className: p(
329
- "inline-flex items-center justify-center font-medium transition-colors duration-200",
330
- "focus:outline-none focus:ring-1 focus:ring-offset-1",
331
- "disabled:opacity-50 disabled:cursor-not-allowed",
332
- Se[r],
333
- Xe[n],
334
- "!rounded-r-none"
335
- ),
336
- children: [
337
- s && /* @__PURE__ */ e("span", { className: "mr-2 flex-shrink-0", children: s }),
338
- t
339
- ]
380
+ loading: x,
381
+ leftIcon: s,
382
+ className: p(l && "!rounded-r-none"),
383
+ children: t
340
384
  }
341
385
  ),
342
- /* @__PURE__ */ e(
343
- "button",
386
+ l && /* @__PURE__ */ e(
387
+ Ze,
344
388
  {
345
- type: "button",
346
- onClick: f,
347
- disabled: u,
348
- className: p(
349
- "inline-flex items-center justify-center font-medium transition-colors duration-200",
350
- "focus:outline-none focus:ring-1 focus:ring-offset-1",
351
- "disabled:opacity-50 disabled:cursor-not-allowed",
352
- Se[r],
353
- n === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
354
- "!rounded-l-none"
389
+ placement: b,
390
+ disabled: f,
391
+ triggerLabel: g,
392
+ className: "min-w-[200px] py-1",
393
+ trigger: /* @__PURE__ */ e(
394
+ "span",
395
+ {
396
+ "aria-hidden": "true",
397
+ className: p(
398
+ "inline-flex items-center justify-center transition-colors duration-200",
399
+ Xe[r],
400
+ n === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
401
+ "!rounded-l-none"
402
+ ),
403
+ children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
404
+ }
355
405
  ),
356
- children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
406
+ children: (m) => /* @__PURE__ */ e(we, { children: o.map((h) => /* @__PURE__ */ d(
407
+ "button",
408
+ {
409
+ type: "button",
410
+ onClick: () => {
411
+ h.onClick(), m();
412
+ },
413
+ className: p(
414
+ "flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors",
415
+ h.variant === "destructive" ? "text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900" : "text-default hover:bg-neutral-container"
416
+ ),
417
+ children: [
418
+ h.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: h.icon }),
419
+ h.label
420
+ ]
421
+ },
422
+ h.id
423
+ )) })
357
424
  }
358
- ),
359
- b && o.length > 0 && /* @__PURE__ */ e("div", { className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-gray-200 bg-white shadow-lg py-1", children: o.map((l) => /* @__PURE__ */ e(
360
- "button",
361
- {
362
- type: "button",
363
- onClick: () => {
364
- l.onClick(), x(!1);
365
- },
366
- className: p(
367
- "w-full text-left px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
368
- l.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "text-gray-700"
369
- ),
370
- children: l.label
371
- },
372
- l.id
373
- )) })
425
+ )
374
426
  ] });
375
427
  }
376
428
  const Qe = {
@@ -383,7 +435,7 @@ const Qe = {
383
435
  md: "text-sm",
384
436
  lg: "text-base",
385
437
  full: "text-base"
386
- }, ye = ce(
438
+ }, ve = ce(
387
439
  ({
388
440
  label: t,
389
441
  helperText: a,
@@ -392,11 +444,11 @@ const Qe = {
392
444
  indeterminate: s = !1,
393
445
  containerClassName: o,
394
446
  labelClassName: u,
395
- className: b,
396
- id: x,
447
+ className: x,
448
+ id: b,
397
449
  ...g
398
450
  }, f) => {
399
- const l = x || `checkbox-${Math.random().toString(36).substr(2, 9)}`, m = !!r;
451
+ const l = b || `checkbox-${Math.random().toString(36).substr(2, 9)}`, m = !!r;
400
452
  return se.useEffect(() => {
401
453
  f && typeof f == "object" && f.current && (f.current.indeterminate = s);
402
454
  }, [s, f]), /* @__PURE__ */ d("div", { className: p("flex flex-col", o), children: [
@@ -419,7 +471,7 @@ const Qe = {
419
471
  // check glyph is white, so the fill must stay dark in both modes
420
472
  // (accent-fill would invert to near-white in dark → invisible check).
421
473
  m ? "border-error [&:not(:checked)]:bg-[var(--base-input)] text-error focus:border-error focus:ring-error" : "border-neutral [&:not(:checked)]:bg-[var(--base-input)] text-[#1a1a1a] focus:border-primary focus:ring-primary",
422
- b
474
+ x
423
475
  ),
424
476
  ...g
425
477
  }
@@ -445,8 +497,8 @@ const Qe = {
445
497
  ] });
446
498
  }
447
499
  );
448
- ye.displayName = "Checkbox";
449
- const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), rt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), nt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ve = ce(({
500
+ ve.displayName = "Checkbox";
501
+ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), rt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), nt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ye = ce(({
450
502
  value: t,
451
503
  onChange: a,
452
504
  placeholder: r = "Select date",
@@ -454,22 +506,22 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
454
506
  required: s = !1,
455
507
  size: o = "md",
456
508
  className: u,
457
- minDate: b,
458
- maxDate: x,
509
+ minDate: x,
510
+ maxDate: b,
459
511
  format: g = "MM/dd/yyyy"
460
512
  }, f) => {
461
- const [l, m] = P(!1), [h, w] = P(() => t || /* @__PURE__ */ new Date()), k = J(null);
462
- U(() => {
463
- const z = (W) => {
464
- k.current && !k.current.contains(W.target) && m(!1);
513
+ const [l, m] = B(!1), [h, k] = B(() => t || /* @__PURE__ */ new Date()), w = Z(null);
514
+ G(() => {
515
+ const D = (W) => {
516
+ w.current && !w.current.contains(W.target) && m(!1);
465
517
  };
466
- return l && document.addEventListener("mousedown", z), () => {
467
- document.removeEventListener("mousedown", z);
518
+ return l && document.addEventListener("mousedown", D), () => {
519
+ document.removeEventListener("mousedown", D);
468
520
  };
469
521
  }, [l]);
470
- const v = (z) => {
471
- if (!z) return "";
472
- const W = z.getDate().toString().padStart(2, "0"), V = (z.getMonth() + 1).toString().padStart(2, "0"), i = z.getFullYear();
522
+ const y = (D) => {
523
+ if (!D) return "";
524
+ const W = D.getDate().toString().padStart(2, "0"), V = (D.getMonth() + 1).toString().padStart(2, "0"), i = D.getFullYear();
473
525
  switch (g) {
474
526
  case "dd/MM/yyyy":
475
527
  return `${W}/${V}/${i}`;
@@ -479,20 +531,20 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
479
531
  default:
480
532
  return `${V}/${W}/${i}`;
481
533
  }
482
- }, j = () => {
483
- const z = h.getFullYear(), W = h.getMonth(), V = new Date(z, W, 1), i = new Date(V);
534
+ }, A = () => {
535
+ const D = h.getFullYear(), W = h.getMonth(), V = new Date(D, W, 1), i = new Date(V);
484
536
  i.setDate(i.getDate() - V.getDay());
485
- const y = [], E = new Date(i);
537
+ const v = [], E = new Date(i);
486
538
  for (let S = 0; S < 42; S++)
487
- y.push(new Date(E)), E.setDate(E.getDate() + 1);
488
- return y;
489
- }, N = (z) => {
490
- z.getMonth() === h.getMonth() && (b && z < b || x && z > x || (a?.(z), m(!1)));
539
+ v.push(new Date(E)), E.setDate(E.getDate() + 1);
540
+ return v;
541
+ }, N = (D) => {
542
+ D.getMonth() === h.getMonth() && (x && D < x || b && D > b || (a?.(D), m(!1)));
491
543
  }, q = () => {
492
- w(new Date(h.getFullYear(), h.getMonth() - 1, 1));
493
- }, B = () => {
494
- w(new Date(h.getFullYear(), h.getMonth() + 1, 1));
495
- }, G = () => {
544
+ k(new Date(h.getFullYear(), h.getMonth() - 1, 1));
545
+ }, P = () => {
546
+ k(new Date(h.getFullYear(), h.getMonth() + 1, 1));
547
+ }, U = () => {
496
548
  a?.(null), m(!1);
497
549
  }, F = p(
498
550
  "w-full border border-neutral rounded-md transition-colors duration-200",
@@ -507,7 +559,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
507
559
  "px-4 py-3 text-base": o === "full"
508
560
  },
509
561
  u
510
- ), I = j(), H = [
562
+ ), z = A(), H = [
511
563
  "January",
512
564
  "February",
513
565
  "March",
@@ -521,14 +573,14 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
521
573
  "November",
522
574
  "December"
523
575
  ];
524
- return /* @__PURE__ */ d("div", { ref: k, className: "relative", children: [
576
+ return /* @__PURE__ */ d("div", { ref: w, className: "relative", children: [
525
577
  /* @__PURE__ */ d("div", { className: "relative", children: [
526
578
  /* @__PURE__ */ e(
527
579
  "input",
528
580
  {
529
581
  ref: f,
530
582
  type: "text",
531
- value: v(t ?? null),
583
+ value: y(t ?? null),
532
584
  placeholder: r,
533
585
  disabled: n,
534
586
  required: s,
@@ -566,30 +618,30 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
566
618
  /* @__PURE__ */ e(
567
619
  "button",
568
620
  {
569
- onClick: B,
621
+ onClick: P,
570
622
  className: "p-1 hover:bg-neutral-container rounded",
571
623
  children: /* @__PURE__ */ e(nt, {})
572
624
  }
573
625
  )
574
626
  ] }),
575
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((z) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted text-center py-1", children: z }, z)) }),
576
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: I.map((z, W) => {
577
- const V = z.getMonth() === h.getMonth(), i = t && z.toDateString() === t.toDateString(), y = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), E = !V || b && z < b || x && z > x;
627
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((D) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted text-center py-1", children: D }, D)) }),
628
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: z.map((D, W) => {
629
+ const V = D.getMonth() === h.getMonth(), i = t && D.toDateString() === t.toDateString(), v = D.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), E = !V || x && D < x || b && D > b;
578
630
  return /* @__PURE__ */ e(
579
631
  "button",
580
632
  {
581
- onClick: () => !E && N(z),
633
+ onClick: () => !E && N(D),
582
634
  disabled: E,
583
635
  className: p(
584
636
  "w-8 h-8 text-sm rounded transition-colors duration-200",
585
637
  {
586
638
  "text-default hover:bg-neutral-container": V && !i && !E,
587
639
  "bg-primary text-white": i,
588
- "bg-neutral-container text-default": y && !i,
640
+ "bg-neutral-container text-default": v && !i,
589
641
  "text-muted cursor-not-allowed": E
590
642
  }
591
643
  ),
592
- children: z.getDate()
644
+ children: D.getDate()
593
645
  },
594
646
  W
595
647
  );
@@ -598,7 +650,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
598
650
  /* @__PURE__ */ e(
599
651
  "button",
600
652
  {
601
- onClick: G,
653
+ onClick: U,
602
654
  className: "text-sm text-muted hover:text-default",
603
655
  children: "Clear"
604
656
  }
@@ -669,69 +721,69 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
669
721
  fullWidth: s = !1,
670
722
  startIcon: o = /* @__PURE__ */ e(at, {}),
671
723
  loading: u = !1,
672
- containerClassName: b,
673
- labelClassName: x,
724
+ containerClassName: x,
725
+ labelClassName: b,
674
726
  className: g,
675
727
  id: f,
676
728
  options: l,
677
729
  onRemoteSearch: m,
678
730
  onSelect: h,
679
- debounceTime: w = 500,
680
- showAllOnOpen: k = !1,
681
- value: v,
682
- onChange: j,
731
+ debounceTime: k = 500,
732
+ showAllOnOpen: w = !1,
733
+ value: y,
734
+ onChange: A,
683
735
  ...N
684
736
  }, q) => {
685
- const B = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, G = !!r, F = J(null), I = J(null), [H, z] = P(v || ""), [W, V] = P(!1), [i, y] = P(!1), [E, S] = P(!1);
686
- U(() => {
687
- v !== void 0 && z(v);
688
- }, [v]);
737
+ const P = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, U = !!r, F = Z(null), z = Z(null), [H, D] = B(y || ""), [W, V] = B(!1), [i, v] = B(!1), [E, S] = B(!1);
738
+ G(() => {
739
+ y !== void 0 && D(y);
740
+ }, [y]);
689
741
  const M = de(() => {
690
- if (k && !E || !H) return l;
742
+ if (w && !E || !H) return l;
691
743
  const T = String(H).toLowerCase();
692
744
  return l.filter(
693
- (D) => String(D.label).toLowerCase().includes(T)
745
+ (I) => String(I.label).toLowerCase().includes(T)
694
746
  );
695
- }, [H, l, k, E]);
696
- U(() => {
747
+ }, [H, l, w, E]);
748
+ G(() => {
697
749
  if (!m || !H) {
698
- y(!1);
750
+ v(!1);
699
751
  return;
700
752
  }
701
753
  const T = setTimeout(async () => {
702
- y(!0);
754
+ v(!0);
703
755
  try {
704
756
  await m(String(H));
705
- } catch (D) {
706
- console.error("Remote search failed:", D);
757
+ } catch (I) {
758
+ console.error("Remote search failed:", I);
707
759
  } finally {
708
- y(!1);
760
+ v(!1);
709
761
  }
710
- }, w);
762
+ }, k);
711
763
  return () => {
712
- clearTimeout(T), y(!1);
764
+ clearTimeout(T), v(!1);
713
765
  };
714
- }, [H, w, m]), U(() => {
715
- const T = (D) => {
716
- F.current && !F.current.contains(D.target) && V(!1);
766
+ }, [H, k, m]), G(() => {
767
+ const T = (I) => {
768
+ F.current && !F.current.contains(I.target) && V(!1);
717
769
  };
718
770
  return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
719
771
  }, []);
720
772
  const L = (T) => {
721
- const D = T.target.value;
722
- z(D), V(!0), S(!0), j && j(T);
773
+ const I = T.target.value;
774
+ D(I), V(!0), S(!0), A && A(T);
723
775
  }, Q = (T) => {
724
- z(T.label), V(!1), S(!1), h && h(T.value);
776
+ D(T.label), V(!1), S(!1), h && h(T.value);
725
777
  }, re = () => {
726
778
  (l.length > 0 || m) && (V(!0), S(!1));
727
- }, X = u || i, $ = W && (M.length > 0 || X), A = de(() => q || I, [q]);
779
+ }, X = u || i, $ = W && (M.length > 0 || X), j = de(() => q || z, [q]);
728
780
  return /* @__PURE__ */ d(
729
781
  "div",
730
782
  {
731
783
  className: ie(
732
784
  "flex flex-col",
733
785
  s ? "w-full" : "",
734
- b || "",
786
+ x || "",
735
787
  "relative"
736
788
  ),
737
789
  ref: F,
@@ -739,11 +791,11 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
739
791
  t && /* @__PURE__ */ e(
740
792
  "label",
741
793
  {
742
- htmlFor: B,
794
+ htmlFor: P,
743
795
  className: ie(
744
796
  "block text-sm font-medium mb-1",
745
- G ? "text-error" : "text-default",
746
- x || ""
797
+ U ? "text-error" : "text-default",
798
+ b || ""
747
799
  ),
748
800
  children: t
749
801
  }
@@ -753,8 +805,8 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
753
805
  /* @__PURE__ */ e(
754
806
  "input",
755
807
  {
756
- ref: A,
757
- id: B,
808
+ ref: j,
809
+ id: P,
758
810
  value: H,
759
811
  onChange: L,
760
812
  onFocus: re,
@@ -770,7 +822,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
770
822
  "pr-10",
771
823
  // Altijd padding rechts voor de dropdown/loading icon
772
824
  // State styles
773
- G ? "border-red-500 text-error focus:border-red-500 focus:ring-red-500" : "border-neutral text-default",
825
+ U ? "border-red-500 text-error focus:border-red-500 focus:ring-red-500" : "border-neutral text-default",
774
826
  g || ""
775
827
  ),
776
828
  ...N
@@ -848,7 +900,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
848
900
  {
849
901
  className: ie(
850
902
  "mt-1 text-xs",
851
- G ? "text-error" : "text-muted"
903
+ U ? "text-error" : "text-muted"
852
904
  ),
853
905
  children: r || a
854
906
  }
@@ -877,124 +929,136 @@ const ct = {
877
929
  fullWidth: s = !1,
878
930
  options: o,
879
931
  placeholder: u,
880
- containerClassName: b,
881
- labelClassName: x,
932
+ containerClassName: x,
933
+ labelClassName: b,
882
934
  className: g,
883
935
  id: f,
884
936
  searchable: l,
885
937
  multiple: m,
886
938
  value: h,
887
- onChange: w,
888
- allowCreate: k,
889
- onCreateOption: v,
890
- ...j
939
+ onChange: k,
940
+ allowCreate: w,
941
+ onCreateOption: y,
942
+ ...A
891
943
  }, N) => {
892
- const q = f || `select-${Math.random().toString(36).substr(2, 9)}`, B = !!r, [G, F] = se.useState(!1), [I, H] = se.useState(""), z = se.useRef(null), [W, V] = se.useState(o);
893
- se.useImperativeHandle(N, () => z.current), se.useEffect(() => {
894
- const $ = (A) => {
895
- z.current && !z.current.contains(A.target) && F(!1);
944
+ const q = f || `select-${Math.random().toString(36).substr(2, 9)}`, P = !!r, [U, F] = se.useState(!1), [z, H] = se.useState(""), D = se.useRef(null), [W, V] = se.useState(o);
945
+ se.useImperativeHandle(N, () => D.current), se.useEffect(() => {
946
+ const $ = (j) => {
947
+ D.current && !D.current.contains(j.target) && F(!1);
896
948
  };
897
949
  return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
898
950
  }, []);
899
951
  const i = se.useCallback(
900
- ($, A) => $.some(
901
- (T) => me(T.value) === me(A) || me(T.label) === me(A)
952
+ ($, j) => $.some(
953
+ (T) => me(T.value) === me(j) || me(T.label) === me(j)
902
954
  ),
903
955
  []
904
- ), y = se.useCallback(
905
- ($, A) => {
906
- const T = [...$], D = (ee) => {
956
+ ), v = se.useCallback(
957
+ ($, j) => {
958
+ const T = [...$], I = (ee) => {
907
959
  const ne = (ee ?? "").trim();
908
960
  ne && (i(T, ne) || T.push({ value: ne, label: ne }));
909
961
  };
910
- return Array.isArray(A) ? A.forEach(D) : D(A), T;
962
+ return Array.isArray(j) ? j.forEach(I) : I(j), T;
911
963
  },
912
964
  [i]
913
965
  );
914
966
  se.useEffect(() => {
915
967
  V(($) => {
916
- const A = [...o];
968
+ const j = [...o];
917
969
  return $.forEach((T) => {
918
- !i(A, T.value) && !i(A, T.label) && A.push(T);
919
- }), y(A, h);
970
+ !i(j, T.value) && !i(j, T.label) && j.push(T);
971
+ }), v(j, h);
920
972
  });
921
- }, [o, h, y, i]);
973
+ }, [o, h, v, i]);
922
974
  const E = ($) => {
923
975
  if (m) {
924
- const A = Array.isArray(h) ? h : [], T = A.includes($) ? A.filter((D) => D !== $) : [...A, $];
925
- w?.(T);
976
+ const j = Array.isArray(h) ? h : [], T = j.includes($) ? j.filter((I) => I !== $) : [...j, $];
977
+ k?.(T);
926
978
  } else
927
- w?.($), F(!1), H("");
979
+ k?.($), F(!1), H("");
928
980
  }, S = m ? null : W.find(($) => $.value === h), M = m ? W.filter(
929
981
  ($) => Array.isArray(h) && h.includes($.value)
930
- ) : [], L = l && I ? W.filter(
931
- ($) => $.label.toLowerCase().includes(I.toLowerCase())
932
- ) : W, Q = !!k && !!l && !!I.trim() && !i(W, I), re = ($) => {
933
- const A = $.trim();
934
- if (!A) return;
935
- const T = v?.(A) ?? {
936
- value: A,
937
- label: A
982
+ ) : [], L = l && z ? W.filter(
983
+ ($) => $.label.toLowerCase().includes(z.toLowerCase())
984
+ ) : W, Q = !!w && !!l && !!z.trim() && !i(W, z), re = ($) => {
985
+ const j = $.trim();
986
+ if (!j) return;
987
+ const T = y?.(j) ?? {
988
+ value: j,
989
+ label: j
938
990
  };
939
991
  if (i(W, T.value) || i(W, T.label)) {
940
992
  E(T.value), H(""), m || F(!1);
941
993
  return;
942
994
  }
943
- V((D) => [...D, T]), E(T.value), H(""), m || F(!1);
995
+ V((I) => [...I, T]), E(T.value), H(""), m || F(!1);
944
996
  }, X = () => m ? M.length > 0 ? M.map(($) => $.label).join(", ") : u || "Select options" : S?.label || u || "Select an option";
945
997
  return /* @__PURE__ */ d(
946
998
  "div",
947
999
  {
948
- ref: z,
1000
+ ref: D,
949
1001
  className: p(
950
1002
  "relative flex flex-col",
951
1003
  s && "w-full",
952
- b
1004
+ x
953
1005
  ),
954
- ...j,
1006
+ ...A,
955
1007
  children: [
956
1008
  t && /* @__PURE__ */ e(
957
1009
  "label",
958
1010
  {
959
1011
  htmlFor: q,
960
- onClick: () => F(!G),
1012
+ onClick: () => F(!U),
961
1013
  className: p(
962
1014
  "block text-sm font-medium mb-1",
963
- B ? "text-error" : "text-default",
964
- x
1015
+ P ? "text-error" : "text-default",
1016
+ b
965
1017
  ),
966
1018
  children: t
967
1019
  }
968
1020
  ),
969
1021
  /* @__PURE__ */ d("div", { className: "relative", children: [
970
- /* @__PURE__ */ e(
1022
+ /* @__PURE__ */ d(
971
1023
  "button",
972
1024
  {
973
1025
  type: "button",
974
1026
  id: q,
975
- onClick: () => F(!G),
1027
+ onClick: () => F(!U),
976
1028
  className: p(
977
- "block w-full rounded-lg border transition-colors duration-200 text-left",
1029
+ "flex w-full items-center justify-between gap-2 rounded-lg border transition-colors duration-200 text-left",
978
1030
  "focus:outline-none focus:ring-0 focus:ring-offset-0",
979
1031
  "disabled:opacity-50 disabled:cursor-not-allowed",
980
1032
  "bg-module",
981
1033
  ct[n],
982
- B ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
1034
+ P ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
983
1035
  g
984
1036
  ),
985
- children: /* @__PURE__ */ e("span", { className: "block truncate", children: X() })
1037
+ children: [
1038
+ /* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: X() }),
1039
+ /* @__PURE__ */ e(
1040
+ $e,
1041
+ {
1042
+ size: 16,
1043
+ className: p(
1044
+ "shrink-0 opacity-60 transition-transform duration-200",
1045
+ U && "rotate-180"
1046
+ )
1047
+ }
1048
+ )
1049
+ ]
986
1050
  }
987
1051
  ),
988
- G && /* @__PURE__ */ d("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-module shadow-lg border border-neutral", children: [
1052
+ U && /* @__PURE__ */ d("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-module shadow-lg border border-neutral", children: [
989
1053
  l && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
990
1054
  "input",
991
1055
  {
992
1056
  type: "text",
993
1057
  placeholder: "Search...",
994
- value: I,
1058
+ value: z,
995
1059
  onChange: ($) => H($.target.value),
996
1060
  onKeyDown: ($) => {
997
- $.key === "Enter" && Q && ($.preventDefault(), re(I));
1061
+ $.key === "Enter" && Q && ($.preventDefault(), re(z));
998
1062
  },
999
1063
  className: p(
1000
1064
  "w-full px-3 py-2 text-sm rounded-md border",
@@ -1009,10 +1073,10 @@ const ct = {
1009
1073
  "px-4 py-2 text-sm cursor-pointer",
1010
1074
  "text-primary hover:bg-neutral-container"
1011
1075
  ),
1012
- onClick: () => re(I),
1076
+ onClick: () => re(z),
1013
1077
  children: [
1014
1078
  "+: “",
1015
- I.trim(),
1079
+ z.trim(),
1016
1080
  "”"
1017
1081
  ]
1018
1082
  }
@@ -1023,13 +1087,13 @@ const ct = {
1023
1087
  {
1024
1088
  className: "px-4 py-2 text-sm text-muted cursor-pointer hover:bg-neutral-container",
1025
1089
  onClick: () => {
1026
- w?.(""), F(!1);
1090
+ k?.(""), F(!1);
1027
1091
  },
1028
1092
  children: u
1029
1093
  }
1030
1094
  ),
1031
1095
  L.map(($) => {
1032
- const A = m ? Array.isArray(h) && h.includes($.value) : h === $.value;
1096
+ const j = m ? Array.isArray(h) && h.includes($.value) : h === $.value;
1033
1097
  return /* @__PURE__ */ e(
1034
1098
  "li",
1035
1099
  {
@@ -1038,14 +1102,14 @@ const ct = {
1038
1102
  "px-4 py-2 text-sm cursor-pointer",
1039
1103
  "text-default",
1040
1104
  $.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-neutral-container",
1041
- A && "font-semibold"
1105
+ j && "font-semibold"
1042
1106
  ),
1043
1107
  children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1044
1108
  m && /* @__PURE__ */ e(
1045
1109
  "input",
1046
1110
  {
1047
1111
  type: "checkbox",
1048
- checked: A,
1112
+ checked: j,
1049
1113
  readOnly: !0,
1050
1114
  className: "mr-3 h-4 w-4 rounded border-neutral [&:not(:checked)]:bg-[var(--base-input)] text-[#1a1a1a] focus:ring-primary"
1051
1115
  }
@@ -1064,7 +1128,7 @@ const ct = {
1064
1128
  {
1065
1129
  className: p(
1066
1130
  "mt-1 text-xs",
1067
- B ? "text-error" : "text-muted"
1131
+ P ? "text-error" : "text-muted"
1068
1132
  ),
1069
1133
  children: r || a
1070
1134
  }
@@ -1089,13 +1153,13 @@ const it = {
1089
1153
  fullWidth: s = !1,
1090
1154
  loading: o = !1,
1091
1155
  containerClassName: u,
1092
- labelClassName: b,
1093
- className: x,
1156
+ labelClassName: x,
1157
+ className: b,
1094
1158
  id: g,
1095
1159
  rows: f = 4,
1096
1160
  ...l
1097
1161
  }, m) => {
1098
- const h = g || `textarea-${Math.random().toString(36).substr(2, 9)}`, w = !!r;
1162
+ const h = g || `textarea-${Math.random().toString(36).substr(2, 9)}`, k = !!r;
1099
1163
  return /* @__PURE__ */ d("div", { className: p("flex flex-col", s && "w-full", u), children: [
1100
1164
  t && /* @__PURE__ */ e(
1101
1165
  "label",
@@ -1103,8 +1167,8 @@ const it = {
1103
1167
  htmlFor: h,
1104
1168
  className: p(
1105
1169
  "block text-sm font-medium mb-1",
1106
- w ? "text-error" : "text-default",
1107
- b
1170
+ k ? "text-error" : "text-default",
1171
+ x
1108
1172
  ),
1109
1173
  children: t
1110
1174
  }
@@ -1124,8 +1188,8 @@ const it = {
1124
1188
  // Size styles
1125
1189
  it[n],
1126
1190
  // State styles
1127
- w ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
1128
- x
1191
+ k ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
1192
+ b
1129
1193
  ),
1130
1194
  ...l
1131
1195
  }
@@ -1165,7 +1229,7 @@ const it = {
1165
1229
  {
1166
1230
  className: p(
1167
1231
  "mt-1 text-xs",
1168
- w ? "text-error" : "text-muted"
1232
+ k ? "text-error" : "text-muted"
1169
1233
  ),
1170
1234
  children: r || a
1171
1235
  }
@@ -1193,22 +1257,22 @@ const dt = {
1193
1257
  fullWidth: s = !1,
1194
1258
  startIcon: o,
1195
1259
  endIcon: u,
1196
- loading: b = !1,
1197
- containerClassName: x,
1260
+ loading: x = !1,
1261
+ containerClassName: b,
1198
1262
  labelClassName: g,
1199
1263
  className: f,
1200
1264
  id: l,
1201
1265
  ...m
1202
1266
  }, h) => {
1203
- const w = l || `textfield-${Math.random().toString(36).substr(2, 9)}`, k = !!r;
1204
- return /* @__PURE__ */ d("div", { className: p("flex flex-col", s && "w-full", x), children: [
1267
+ const k = l || `textfield-${Math.random().toString(36).substr(2, 9)}`, w = !!r;
1268
+ return /* @__PURE__ */ d("div", { className: p("flex flex-col", s && "w-full", b), children: [
1205
1269
  t && /* @__PURE__ */ e(
1206
1270
  "label",
1207
1271
  {
1208
- htmlFor: w,
1272
+ htmlFor: k,
1209
1273
  className: p(
1210
1274
  "block text-sm font-medium mb-1",
1211
- k ? "text-error" : "text-default",
1275
+ w ? "text-error" : "text-default",
1212
1276
  g
1213
1277
  ),
1214
1278
  children: t
@@ -1221,7 +1285,7 @@ const dt = {
1221
1285
  "input",
1222
1286
  {
1223
1287
  ref: h,
1224
- id: w,
1288
+ id: k,
1225
1289
  className: p(
1226
1290
  // Base styles
1227
1291
  "block w-full rounded-lg border transition-colors duration-200 bg-input",
@@ -1233,13 +1297,13 @@ const dt = {
1233
1297
  o && "pl-10",
1234
1298
  u && "pr-10",
1235
1299
  // State styles
1236
- k ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default focus:border-primary focus:ring-primary",
1300
+ w ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default focus:border-primary focus:ring-primary",
1237
1301
  f
1238
1302
  ),
1239
1303
  ...m
1240
1304
  }
1241
1305
  ),
1242
- (u || b) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: b ? /* @__PURE__ */ d(
1306
+ (u || x) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: x ? /* @__PURE__ */ d(
1243
1307
  "svg",
1244
1308
  {
1245
1309
  className: p("animate-spin text-muted", ge[n]),
@@ -1274,7 +1338,7 @@ const dt = {
1274
1338
  {
1275
1339
  className: p(
1276
1340
  "mt-1 text-xs",
1277
- k ? "text-error" : "text-muted"
1341
+ w ? "text-error" : "text-muted"
1278
1342
  ),
1279
1343
  children: r || a
1280
1344
  }
@@ -1291,9 +1355,9 @@ const oe = ({
1291
1355
  onClick: s,
1292
1356
  className: o,
1293
1357
  "aria-label": u,
1294
- ...b
1358
+ ...x
1295
1359
  }) => {
1296
- const x = typeof a == "number" ? a : ut(a), g = p(
1360
+ const b = typeof a == "number" ? a : ut(a), g = p(
1297
1361
  "inline-block",
1298
1362
  // Color variants
1299
1363
  {
@@ -1314,7 +1378,7 @@ const oe = ({
1314
1378
  },
1315
1379
  o
1316
1380
  ), f = {
1317
- size: x,
1381
+ size: b,
1318
1382
  className: g,
1319
1383
  onClick: n ? s : void 0,
1320
1384
  "aria-label": u,
@@ -1323,7 +1387,7 @@ const oe = ({
1323
1387
  onKeyDown: n ? (l) => {
1324
1388
  (l.key === "Enter" || l.key === " ") && (l.preventDefault(), s?.());
1325
1389
  } : void 0,
1326
- ...b
1390
+ ...x
1327
1391
  };
1328
1392
  return /* @__PURE__ */ e(t, { ...f });
1329
1393
  };
@@ -1343,7 +1407,7 @@ function mt({
1343
1407
  tableRows: n = 8
1344
1408
  }) {
1345
1409
  return t ? /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */ e("div", { className: "w-full max-w-6xl mx-auto animate-pulse", children: t }) }) : /* @__PURE__ */ e("main", { className: "flex-1 bg-module p-6", children: /* @__PURE__ */ d("div", { className: "w-full mx-auto space-y-6 animate-pulse", children: [
1346
- !a && /* @__PURE__ */ d($e, { children: [
1410
+ !a && /* @__PURE__ */ d(we, { children: [
1347
1411
  /* @__PURE__ */ e("div", { className: "h-6 bg-neutral-container-emphasis rounded w-1/4" }),
1348
1412
  /* @__PURE__ */ d("div", { className: "space-y-2", children: [
1349
1413
  /* @__PURE__ */ e("div", { className: "h-4 bg-neutral-container-emphasis rounded w-3/4" }),
@@ -1362,12 +1426,12 @@ function mt({
1362
1426
  "div",
1363
1427
  {
1364
1428
  className: `grid grid-cols-${r} gap-2 p-3 border-t border-neutral`,
1365
- children: Array.from({ length: r }).map((u, b) => /* @__PURE__ */ e(
1429
+ children: Array.from({ length: r }).map((u, x) => /* @__PURE__ */ e(
1366
1430
  "div",
1367
1431
  {
1368
1432
  className: "h-4 bg-neutral-container-emphasis rounded w-full"
1369
1433
  },
1370
- `cell-${o}-${b}`
1434
+ `cell-${o}-${x}`
1371
1435
  ))
1372
1436
  },
1373
1437
  `row-${o}`
@@ -1383,61 +1447,61 @@ const ft = ({
1383
1447
  placement: s = "bottom-start",
1384
1448
  disabled: o = !1,
1385
1449
  className: u,
1386
- showCheck: b = !0,
1387
- header: x
1450
+ showCheck: x = !0,
1451
+ header: b
1388
1452
  }) => {
1389
- const [g, f] = P(!1), [l, m] = P(null), [h, w] = P({ top: 0, left: 0 }), [k, v] = P({}), j = J(null), N = J(null), q = J(null), B = J(null);
1390
- U(() => {
1391
- const i = (y) => {
1392
- j.current && (!j.current.contains(y.target) || q.current && !q.current.contains(y.target)) && (f(!1), m(null), B.current && (clearTimeout(B.current), B.current = null));
1453
+ const [g, f] = B(!1), [l, m] = B(null), [h, k] = B({ top: 0, left: 0 }), [w, y] = B({}), A = Z(null), N = Z(null), q = Z(null), P = Z(null);
1454
+ G(() => {
1455
+ const i = (v) => {
1456
+ A.current && (!A.current.contains(v.target) || q.current && !q.current.contains(v.target)) && (f(!1), m(null), P.current && (clearTimeout(P.current), P.current = null));
1393
1457
  };
1394
1458
  return g && document.addEventListener("mousedown", i), () => {
1395
1459
  document.removeEventListener("mousedown", i);
1396
1460
  };
1397
- }, [g]), U(() => {
1398
- const i = (y) => {
1399
- y.key === "Escape" && (f(!1), m(null), B.current && (clearTimeout(B.current), B.current = null));
1461
+ }, [g]), G(() => {
1462
+ const i = (v) => {
1463
+ v.key === "Escape" && (f(!1), m(null), P.current && (clearTimeout(P.current), P.current = null));
1400
1464
  };
1401
1465
  return g && document.addEventListener("keydown", i), () => {
1402
1466
  document.removeEventListener("keydown", i);
1403
1467
  };
1404
- }, [g]), U(() => {
1405
- if (l && j.current) {
1406
- const i = j.current.querySelector(
1468
+ }, [g]), G(() => {
1469
+ if (l && A.current) {
1470
+ const i = A.current.querySelector(
1407
1471
  `[data-option-value="${l}"]`
1408
1472
  );
1409
1473
  if (i) {
1410
- const y = i.getBoundingClientRect();
1411
- w({
1412
- top: y.top,
1413
- left: y.right + 8
1474
+ const v = i.getBoundingClientRect();
1475
+ k({
1476
+ top: v.top,
1477
+ left: v.right + 8
1414
1478
  });
1415
1479
  }
1416
1480
  }
1417
- }, [l]), U(() => () => {
1418
- B.current && clearTimeout(B.current);
1481
+ }, [l]), G(() => () => {
1482
+ P.current && clearTimeout(P.current);
1419
1483
  }, []);
1420
- const G = (i) => {
1484
+ const U = (i) => {
1421
1485
  if (i.stopPropagation(), !o) {
1422
1486
  if (!g) {
1423
- const y = N.current?.getBoundingClientRect();
1424
- if (y) {
1487
+ const v = N.current?.getBoundingClientRect();
1488
+ if (v) {
1425
1489
  const S = {};
1426
- s.startsWith("bottom") ? S.top = y.bottom + 6 : S.bottom = window.innerHeight - y.top + 6, s.endsWith("start") ? S.left = y.left : S.right = window.innerWidth - y.right, v(S);
1490
+ s.startsWith("bottom") ? S.top = v.bottom + 6 : S.bottom = window.innerHeight - v.top + 6, s.endsWith("start") ? S.left = v.left : S.right = window.innerWidth - v.right, y(S);
1427
1491
  }
1428
1492
  }
1429
- f(!g), m(null), B.current && (clearTimeout(B.current), B.current = null);
1493
+ f(!g), m(null), P.current && (clearTimeout(P.current), P.current = null);
1430
1494
  }
1431
- }, F = (i, y, E) => {
1432
- i.stopPropagation(), !y.disabled && !y.divider && (!y.children || y.children.length === 0) && (n?.(y.value, E), f(!1), m(null));
1433
- }, I = (i) => {
1434
- B.current && (clearTimeout(B.current), B.current = null), i.children && i.children.length > 0 ? m(i.value) : m(null);
1495
+ }, F = (i, v, E) => {
1496
+ i.stopPropagation(), !v.disabled && !v.divider && (!v.children || v.children.length === 0) && (n?.(v.value, E), f(!1), m(null));
1497
+ }, z = (i) => {
1498
+ P.current && (clearTimeout(P.current), P.current = null), i.children && i.children.length > 0 ? m(i.value) : m(null);
1435
1499
  }, H = (i) => {
1436
- i.children && i.children.length > 0 ? B.current = setTimeout(() => {
1500
+ i.children && i.children.length > 0 ? P.current = setTimeout(() => {
1437
1501
  m(null);
1438
1502
  }, 150) : m(null);
1439
- }, z = (i, y, E) => {
1440
- i.stopPropagation(), !y.disabled && !y.divider && (n?.(y.value, E), f(!1), m(null));
1503
+ }, D = (i, v, E) => {
1504
+ i.stopPropagation(), !v.disabled && !v.divider && (n?.(v.value, E), f(!1), m(null));
1441
1505
  }, W = p(
1442
1506
  "fixed z-[60] min-w-[200px] bg-module rounded-md shadow-lg border border-neutral",
1443
1507
  "max-h-60 overflow-auto"
@@ -1448,7 +1512,7 @@ const ft = ({
1448
1512
  return /* @__PURE__ */ d(
1449
1513
  "div",
1450
1514
  {
1451
- ref: j,
1515
+ ref: A,
1452
1516
  className: p(
1453
1517
  "relative flex flex-row items-center justify-center rounded-lg hover:bg-neutral-container",
1454
1518
  u
@@ -1458,7 +1522,7 @@ const ft = ({
1458
1522
  "button",
1459
1523
  {
1460
1524
  ref: N,
1461
- onClick: G,
1525
+ onClick: U,
1462
1526
  disabled: o,
1463
1527
  className: p("inline-flex items-center justify-center", {
1464
1528
  "opacity-50 cursor-not-allowed": o
@@ -1466,16 +1530,16 @@ const ft = ({
1466
1530
  children: t
1467
1531
  }
1468
1532
  ),
1469
- g && /* @__PURE__ */ e("div", { className: W, style: k, children: /* @__PURE__ */ d("div", { className: "p-2", children: [
1470
- x && (typeof x == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted uppercase tracking-wider px-3 py-2", children: x }) : x),
1471
- a.map((i, y) => {
1533
+ g && /* @__PURE__ */ e("div", { className: W, style: w, children: /* @__PURE__ */ d("div", { className: "p-2", children: [
1534
+ b && (typeof b == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-muted uppercase tracking-wider px-3 py-2", children: b }) : b),
1535
+ a.map((i, v) => {
1472
1536
  if (i.divider)
1473
1537
  return /* @__PURE__ */ e(
1474
1538
  "div",
1475
1539
  {
1476
1540
  className: "border-t border-neutral my-2"
1477
1541
  },
1478
- `divider-${y}`
1542
+ `divider-${v}`
1479
1543
  );
1480
1544
  const E = i.children && i.children.length > 0, S = l === i.value;
1481
1545
  return /* @__PURE__ */ d("div", { className: "relative group", children: [
@@ -1484,7 +1548,7 @@ const ft = ({
1484
1548
  {
1485
1549
  "data-option-value": i.value,
1486
1550
  onClick: (M) => F(M, i),
1487
- onMouseEnter: () => I(i),
1551
+ onMouseEnter: () => z(i),
1488
1552
  onMouseLeave: () => H(i),
1489
1553
  disabled: i.disabled,
1490
1554
  className: p(
@@ -1503,7 +1567,7 @@ const ft = ({
1503
1567
  ] })
1504
1568
  ] }),
1505
1569
  /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
1506
- b && r === i.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" }),
1570
+ x && r === i.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" }),
1507
1571
  E && /* @__PURE__ */ e("span", { className: "text-muted text-xs", children: "▶" })
1508
1572
  ] })
1509
1573
  ]
@@ -1519,10 +1583,10 @@ const ft = ({
1519
1583
  left: `${h.left}px`
1520
1584
  },
1521
1585
  onMouseEnter: () => {
1522
- B.current && (clearTimeout(B.current), B.current = null), m(i.value);
1586
+ P.current && (clearTimeout(P.current), P.current = null), m(i.value);
1523
1587
  },
1524
1588
  onMouseLeave: () => {
1525
- B.current = setTimeout(() => {
1589
+ P.current = setTimeout(() => {
1526
1590
  m(null);
1527
1591
  }, 150);
1528
1592
  },
@@ -1541,7 +1605,7 @@ const ft = ({
1541
1605
  return /* @__PURE__ */ d(
1542
1606
  "button",
1543
1607
  {
1544
- onClick: (re) => z(
1608
+ onClick: (re) => D(
1545
1609
  re,
1546
1610
  M,
1547
1611
  i.value
@@ -1561,7 +1625,7 @@ const ft = ({
1561
1625
  M.description && /* @__PURE__ */ e("span", { className: "text-xs text-muted", children: M.description })
1562
1626
  ] })
1563
1627
  ] }),
1564
- b && Q && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" })
1628
+ x && Q && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-success flex-shrink-0 text-sm font-bold", children: "✓" })
1565
1629
  ]
1566
1630
  },
1567
1631
  M.value
@@ -1572,10 +1636,10 @@ const ft = ({
1572
1636
  ] }, i.value);
1573
1637
  }),
1574
1638
  (() => {
1575
- const i = a.reduce((y, E) => {
1576
- if (E.divider) return y;
1639
+ const i = a.reduce((v, E) => {
1640
+ if (E.divider) return v;
1577
1641
  const S = E.children ? E.children.filter((M) => !M.divider).length : 0;
1578
- return y + 1 + S;
1642
+ return v + 1 + S;
1579
1643
  }, 0);
1580
1644
  return i > 1 && /* @__PURE__ */ e("div", { className: "border-t border-neutral mt-2 pt-2", children: /* @__PURE__ */ d("div", { className: "text-xs text-muted px-3 py-1", children: [
1581
1645
  i,
@@ -1677,7 +1741,7 @@ const ft = ({
1677
1741
  }
1678
1742
  )
1679
1743
  }
1680
- ), yt = () => /* @__PURE__ */ e(
1744
+ ), vt = () => /* @__PURE__ */ e(
1681
1745
  "svg",
1682
1746
  {
1683
1747
  className: "h-4 w-4",
@@ -1694,7 +1758,7 @@ const ft = ({
1694
1758
  }
1695
1759
  )
1696
1760
  }
1697
- ), vt = () => /* @__PURE__ */ e(
1761
+ ), yt = () => /* @__PURE__ */ e(
1698
1762
  "svg",
1699
1763
  {
1700
1764
  className: "h-4 w-4",
@@ -1711,7 +1775,7 @@ const ft = ({
1711
1775
  }
1712
1776
  )
1713
1777
  }
1714
- ), De = () => /* @__PURE__ */ e(
1778
+ ), Ie = () => /* @__PURE__ */ e(
1715
1779
  "svg",
1716
1780
  {
1717
1781
  className: "h-4 w-4",
@@ -1733,7 +1797,7 @@ const ft = ({
1733
1797
  t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((s) => s !== n)) : t.onChange(n);
1734
1798
  };
1735
1799
  return t.type === "date" ? /* @__PURE__ */ e("div", { className: "flex items-center space-x-1 max-w-[160px]", children: /* @__PURE__ */ e(
1736
- ve,
1800
+ ye,
1737
1801
  {
1738
1802
  size: "sm",
1739
1803
  value: t.value,
@@ -1747,7 +1811,7 @@ const ft = ({
1747
1811
  /* @__PURE__ */ e("span", { className: "text-default", children: t.multiSelect && Array.isArray(t.value) ? t.value?.map(
1748
1812
  (n) => t.options?.find((s) => s.value === n)?.label
1749
1813
  ).join(", ") : t.options?.find((n) => n.value === t.value)?.label }),
1750
- /* @__PURE__ */ e("span", { className: "text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(De, {}) })
1814
+ /* @__PURE__ */ e("span", { className: "text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(Ie, {}) })
1751
1815
  ] }),
1752
1816
  /* @__PURE__ */ d("div", { className: "absolute z-10 left-0 mt-1 bg-module border border-neutral rounded-lg shadow-lvl-0 p-2 w-48", children: [
1753
1817
  t.options?.map((n) => /* @__PURE__ */ e(
@@ -1783,59 +1847,59 @@ const ft = ({
1783
1847
  searchPlaceholder: s = "Search...",
1784
1848
  filters: o = [],
1785
1849
  paginated: u = !1,
1786
- pageSizeOptions: b = [10, 25, 50, 100],
1787
- defaultPageSize: x = 10,
1850
+ pageSizeOptions: x = [10, 25, 50, 100],
1851
+ defaultPageSize: b = 10,
1788
1852
  actions: g = [],
1789
1853
  onRowClick: f,
1790
1854
  selectable: l = !1,
1791
1855
  selectedRows: m = [],
1792
1856
  onSelectionChange: h,
1793
- getRowKey: w = (G, F) => F,
1794
- emptyContent: k,
1795
- hoverable: v = !0,
1796
- bordered: j = !1,
1857
+ getRowKey: k = (U, F) => F,
1858
+ emptyContent: w,
1859
+ hoverable: y = !0,
1860
+ bordered: A = !1,
1797
1861
  striped: N = !1,
1798
1862
  className: q,
1799
- rowClassName: B
1863
+ rowClassName: P
1800
1864
  }) => {
1801
- const [G, F] = P(""), [I, H] = P({
1865
+ const [U, F] = B(""), [z, H] = B({
1802
1866
  column: null,
1803
1867
  direction: null
1804
- }), [z, W] = P({
1868
+ }), [D, W] = B({
1805
1869
  page: 0,
1806
- pageSize: x
1807
- }), V = J(null), i = de(() => {
1870
+ pageSize: b
1871
+ }), V = Z(null), i = de(() => {
1808
1872
  let c = t;
1809
- if (n && G.trim()) {
1873
+ if (n && U.trim()) {
1810
1874
  const C = a.filter(
1811
1875
  (R) => R.searchable !== !1
1812
- ), O = G.toLowerCase();
1876
+ ), O = U.toLowerCase();
1813
1877
  c = c.filter((R) => C.some((_) => {
1814
- const Y = typeof _.accessor == "function" ? _.accessor(R) : R[_.accessor];
1815
- return String(Y || "").toLowerCase().includes(O);
1878
+ const J = typeof _.accessor == "function" ? _.accessor(R) : R[_.accessor];
1879
+ return String(J || "").toLowerCase().includes(O);
1816
1880
  }));
1817
1881
  }
1818
1882
  return o.forEach((C) => {
1819
1883
  C.value && C.value !== "all" && (c = c.filter((O) => {
1820
- const R = a.find((Y) => Y.id === C.id);
1884
+ const R = a.find((J) => J.id === C.id);
1821
1885
  if (!R) return !0;
1822
1886
  const _ = typeof R.accessor == "function" ? R.accessor(O) : O[R.accessor];
1823
1887
  return String(_ || "") === C.value;
1824
1888
  }));
1825
1889
  }), c;
1826
- }, [t, G, a, n, o]), y = de(() => {
1827
- if (!I.column || !I.direction) return i;
1828
- const c = a.find((C) => C.id === I.column);
1890
+ }, [t, U, a, n, o]), v = de(() => {
1891
+ if (!z.column || !z.direction) return i;
1892
+ const c = a.find((C) => C.id === z.column);
1829
1893
  return c ? [...i].sort((C, O) => {
1830
1894
  const R = typeof c.accessor == "function" ? c.accessor(C) : C[c.accessor], _ = typeof c.accessor == "function" ? c.accessor(O) : O[c.accessor];
1831
- let Y = 0;
1832
- return R < _ ? Y = -1 : R > _ && (Y = 1), I.direction === "desc" ? -Y : Y;
1895
+ let J = 0;
1896
+ return R < _ ? J = -1 : R > _ && (J = 1), z.direction === "desc" ? -J : J;
1833
1897
  }) : i;
1834
- }, [i, I, a]), E = de(() => {
1835
- if (!u) return y;
1836
- const c = z.page * z.pageSize, C = c + z.pageSize;
1837
- return y.slice(c, C);
1838
- }, [y, z, u]), S = ae(
1898
+ }, [i, z, a]), E = de(() => {
1899
+ if (!u) return v;
1900
+ const c = D.page * D.pageSize, C = c + D.pageSize;
1901
+ return v.slice(c, C);
1902
+ }, [v, D, u]), S = ae(
1839
1903
  (c) => {
1840
1904
  a.find((O) => O.id === c)?.sortable && H((O) => O.column !== c ? { column: c, direction: "asc" } : O.direction === "asc" ? { column: c, direction: "desc" } : { column: null, direction: null });
1841
1905
  },
@@ -1847,32 +1911,32 @@ const ft = ({
1847
1911
  }, []), Q = ae(
1848
1912
  (c, C) => {
1849
1913
  if (!h) return;
1850
- const O = w(c, 0);
1851
- m.map((R, _) => w(R, _)), h(C ? [...m, c] : m.filter(
1852
- (R, _) => w(m[_], _) !== O
1914
+ const O = k(c, 0);
1915
+ m.map((R, _) => k(R, _)), h(C ? [...m, c] : m.filter(
1916
+ (R, _) => k(m[_], _) !== O
1853
1917
  ));
1854
1918
  },
1855
- [m, h, w]
1919
+ [m, h, k]
1856
1920
  ), re = ae(
1857
1921
  (c) => {
1858
1922
  h && h(c ? [...E] : []);
1859
1923
  },
1860
1924
  [E, h]
1861
1925
  );
1862
- U(() => {
1926
+ G(() => {
1863
1927
  W((c) => ({ ...c, page: 0 }));
1864
- }, [G, I]), U(() => {
1928
+ }, [U, z]), G(() => {
1865
1929
  W((c) => ({ ...c, page: 0 }));
1866
1930
  }, [o.map((c) => c.value).join(",")]);
1867
- const X = y.length, $ = Math.ceil(X / z.pageSize), A = z.page * z.pageSize + 1, T = Math.min(A + z.pageSize - 1, X), D = E.length > 0 && E.every((c) => {
1868
- const C = w(c, 0);
1931
+ const X = v.length, $ = Math.ceil(X / D.pageSize), j = D.page * D.pageSize + 1, T = Math.min(j + D.pageSize - 1, X), I = E.length > 0 && E.every((c) => {
1932
+ const C = k(c, 0);
1869
1933
  return m.some(
1870
- (O, R) => w(O, R) === C
1934
+ (O, R) => k(O, R) === C
1871
1935
  );
1872
1936
  }), ee = E.some((c) => {
1873
- const C = w(c, 0);
1937
+ const C = k(c, 0);
1874
1938
  return m.some(
1875
- (O, R) => w(O, R) === C
1939
+ (O, R) => k(O, R) === C
1876
1940
  );
1877
1941
  }), ne = p(
1878
1942
  "w-full text-sm leading-5 text-[var(--text-default)] border-collapse",
@@ -1880,7 +1944,7 @@ const ft = ({
1880
1944
  ), K = p("bg-[var(--base-module)]"), le = p(
1881
1945
  "text-[var(--text-default)] p-3 border-b border-[var(--neutral-border)]"
1882
1946
  ), he = p("h-12", {
1883
- "hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": v,
1947
+ "hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": y,
1884
1948
  "cursor-pointer": f
1885
1949
  });
1886
1950
  return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
@@ -1890,7 +1954,7 @@ const ft = ({
1890
1954
  ue,
1891
1955
  {
1892
1956
  placeholder: s,
1893
- value: G,
1957
+ value: U,
1894
1958
  onChange: (c) => F(c.target.value),
1895
1959
  startIcon: /* @__PURE__ */ e(ht, {}),
1896
1960
  className: "max-w-sm"
@@ -1912,9 +1976,9 @@ const ft = ({
1912
1976
  "input",
1913
1977
  {
1914
1978
  type: "checkbox",
1915
- checked: D,
1979
+ checked: I,
1916
1980
  ref: (c) => {
1917
- c && (c.indeterminate = ee && !D);
1981
+ c && (c.indeterminate = ee && !I);
1918
1982
  },
1919
1983
  onChange: (c) => re(c.target.checked),
1920
1984
  className: "rounded border-neutral [&:not(:checked)]:bg-[var(--base-input)] text-[#1a1a1a]"
@@ -1945,19 +2009,19 @@ const ft = ({
1945
2009
  {
1946
2010
  className: p(
1947
2011
  "flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
1948
- I.column === c.id && "opacity-100"
2012
+ z.column === c.id && "opacity-100"
1949
2013
  ),
1950
2014
  children: [
1951
2015
  /* @__PURE__ */ e(
1952
2016
  pt,
1953
2017
  {
1954
- active: I.column === c.id && I.direction === "asc"
2018
+ active: z.column === c.id && z.direction === "asc"
1955
2019
  }
1956
2020
  ),
1957
2021
  /* @__PURE__ */ e(
1958
2022
  xt,
1959
2023
  {
1960
- active: I.column === c.id && I.direction === "desc"
2024
+ active: z.column === c.id && z.direction === "desc"
1961
2025
  }
1962
2026
  )
1963
2027
  ]
@@ -1977,11 +2041,11 @@ const ft = ({
1977
2041
  le,
1978
2042
  "text-center py-8 text-muted"
1979
2043
  ),
1980
- children: k || "No data available"
2044
+ children: w || "No data available"
1981
2045
  }
1982
2046
  ) }) : E.map((c, C) => {
1983
- const O = w(c, C), R = m.some(
1984
- (_, Y) => w(_, Y) === O
2047
+ const O = k(c, C), R = m.some(
2048
+ (_, J) => k(_, J) === O
1985
2049
  );
1986
2050
  return /* @__PURE__ */ d(
1987
2051
  "tr",
@@ -1989,7 +2053,7 @@ const ft = ({
1989
2053
  className: p(
1990
2054
  he,
1991
2055
  { "bg-accent-container": R },
1992
- B?.(c, C)
2056
+ P?.(c, C)
1993
2057
  ),
1994
2058
  onClick: (_) => {
1995
2059
  _.stopPropagation(), f?.(c, C);
@@ -2007,7 +2071,7 @@ const ft = ({
2007
2071
  }
2008
2072
  ) }),
2009
2073
  a.map((_) => {
2010
- const Y = typeof _.accessor == "function" ? _.accessor(c) : c[_.accessor];
2074
+ const J = typeof _.accessor == "function" ? _.accessor(c) : c[_.accessor];
2011
2075
  return /* @__PURE__ */ e(
2012
2076
  "td",
2013
2077
  {
@@ -2018,7 +2082,7 @@ const ft = ({
2018
2082
  "sticky left-0 bg-module": _.sticky === "left",
2019
2083
  "sticky right-0 bg-module": _.sticky === "right"
2020
2084
  }),
2021
- children: _.cell ? _.cell(Y, c, C) : String(Y || "")
2085
+ children: _.cell ? _.cell(J, c, C) : String(J || "")
2022
2086
  },
2023
2087
  _.id
2024
2088
  );
@@ -2028,7 +2092,7 @@ const ft = ({
2028
2092
  {
2029
2093
  trigger: /* @__PURE__ */ d("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-muted hover:text-default", children: [
2030
2094
  /* @__PURE__ */ e("span", { children: "Options" }),
2031
- /* @__PURE__ */ e(De, {})
2095
+ /* @__PURE__ */ e(Ie, {})
2032
2096
  ] }),
2033
2097
  options: g.map((_) => ({
2034
2098
  value: _.id,
@@ -2037,10 +2101,10 @@ const ft = ({
2037
2101
  disabled: _.disabled?.(c)
2038
2102
  })),
2039
2103
  onSelect: (_) => {
2040
- const Y = g.find(
2104
+ const J = g.find(
2041
2105
  (pe) => pe.id === _
2042
2106
  );
2043
- Y && Y.onClick(c, C);
2107
+ J && J.onClick(c, C);
2044
2108
  },
2045
2109
  placement: "bottom-end"
2046
2110
  }
@@ -2056,7 +2120,7 @@ const ft = ({
2056
2120
  /* @__PURE__ */ d("div", { className: "flex items-center gap-4", children: [
2057
2121
  /* @__PURE__ */ d("span", { className: "text-sm text-muted", children: [
2058
2122
  "Showing ",
2059
- A,
2123
+ j,
2060
2124
  " to ",
2061
2125
  T,
2062
2126
  " of ",
@@ -2068,10 +2132,10 @@ const ft = ({
2068
2132
  /* @__PURE__ */ e(
2069
2133
  "select",
2070
2134
  {
2071
- value: z.pageSize,
2135
+ value: D.pageSize,
2072
2136
  onChange: (c) => L(Number(c.target.value)),
2073
2137
  className: "border border-[var(--neutral-border)] text-[var(--text-default)] rounded-md px-2 py-1 text-sm bg-[var(--base-input)] w-16",
2074
- children: b.map((c) => /* @__PURE__ */ e("option", { value: c, children: c }, c))
2138
+ children: x.map((c) => /* @__PURE__ */ e("option", { value: c, children: c }, c))
2075
2139
  }
2076
2140
  )
2077
2141
  ] })
@@ -2083,9 +2147,9 @@ const ft = ({
2083
2147
  size: "sm",
2084
2148
  variant: "ghost",
2085
2149
  onClick: () => M(0),
2086
- disabled: z.page === 0,
2150
+ disabled: D.page === 0,
2087
2151
  iconOnly: !0,
2088
- children: /* @__PURE__ */ e(yt, {})
2152
+ children: /* @__PURE__ */ e(vt, {})
2089
2153
  }
2090
2154
  ),
2091
2155
  /* @__PURE__ */ e(
@@ -2093,15 +2157,15 @@ const ft = ({
2093
2157
  {
2094
2158
  size: "sm",
2095
2159
  variant: "ghost",
2096
- onClick: () => M(z.page - 1),
2097
- disabled: z.page === 0,
2160
+ onClick: () => M(D.page - 1),
2161
+ disabled: D.page === 0,
2098
2162
  iconOnly: !0,
2099
2163
  children: /* @__PURE__ */ e(bt, {})
2100
2164
  }
2101
2165
  ),
2102
2166
  /* @__PURE__ */ d("span", { className: "px-3 py-1 text-sm text-muted", children: [
2103
2167
  "Page ",
2104
- z.page + 1,
2168
+ D.page + 1,
2105
2169
  " of ",
2106
2170
  $
2107
2171
  ] }),
@@ -2110,8 +2174,8 @@ const ft = ({
2110
2174
  {
2111
2175
  size: "sm",
2112
2176
  variant: "ghost",
2113
- onClick: () => M(z.page + 1),
2114
- disabled: z.page >= $ - 1,
2177
+ onClick: () => M(D.page + 1),
2178
+ disabled: D.page >= $ - 1,
2115
2179
  iconOnly: !0,
2116
2180
  children: /* @__PURE__ */ e(gt, {})
2117
2181
  }
@@ -2122,45 +2186,45 @@ const ft = ({
2122
2186
  size: "sm",
2123
2187
  variant: "ghost",
2124
2188
  onClick: () => M($ - 1),
2125
- disabled: z.page >= $ - 1,
2189
+ disabled: D.page >= $ - 1,
2126
2190
  iconOnly: !0,
2127
- children: /* @__PURE__ */ e(vt, {})
2191
+ children: /* @__PURE__ */ e(yt, {})
2128
2192
  }
2129
2193
  )
2130
2194
  ] })
2131
2195
  ] })
2132
2196
  ] });
2133
- }, wt = Ge(null), or = ({
2197
+ }, wt = Ue(null), or = ({
2134
2198
  items: t,
2135
2199
  activeTab: a,
2136
2200
  onTabChange: r,
2137
2201
  className: n
2138
2202
  }) => {
2139
- const [s, o] = P(t[0]?.id || ""), u = a || s, b = (x) => {
2140
- r ? r(x) : o(x);
2203
+ const [s, o] = B(t[0]?.id || ""), u = a || s, x = (b) => {
2204
+ r ? r(b) : o(b);
2141
2205
  };
2142
- return /* @__PURE__ */ e("div", { className: p("border-b border-neutral-200 dark:border-neutral-700", n), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((x) => /* @__PURE__ */ e(
2206
+ return /* @__PURE__ */ e("div", { className: p("border-b border-neutral-200 dark:border-neutral-700", n), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((b) => /* @__PURE__ */ e(
2143
2207
  "button",
2144
2208
  {
2145
- onClick: () => !x.disabled && b(x.id),
2146
- disabled: x.disabled,
2209
+ onClick: () => !b.disabled && x(b.id),
2210
+ disabled: b.disabled,
2147
2211
  className: p(
2148
2212
  "border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-200",
2149
2213
  {
2150
- "border-primary text-primary": u === x.id,
2151
- "border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": u !== x.id && !x.disabled,
2152
- "border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": x.disabled
2214
+ "border-primary text-primary": u === b.id,
2215
+ "border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": u !== b.id && !b.disabled,
2216
+ "border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": b.disabled
2153
2217
  }
2154
2218
  ),
2155
2219
  children: /* @__PURE__ */ d("span", { className: "flex items-center gap-2", children: [
2156
- x.label,
2157
- x.badge && /* @__PURE__ */ e("span", { className: p(
2220
+ b.label,
2221
+ b.badge && /* @__PURE__ */ e("span", { className: p(
2158
2222
  "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
2159
- u === x.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
2160
- ), children: x.badge })
2223
+ u === b.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
2224
+ ), children: b.badge })
2161
2225
  ] })
2162
2226
  },
2163
- x.id
2227
+ b.id
2164
2228
  )) }) });
2165
2229
  }, kt = ({
2166
2230
  items: t,
@@ -2171,14 +2235,14 @@ const ft = ({
2171
2235
  size: o = "md",
2172
2236
  className: u
2173
2237
  }) => {
2174
- const [b, x] = P(
2238
+ const [x, b] = B(
2175
2239
  a || r || t[0]?.id || ""
2176
- ), g = r || b, f = (k) => {
2177
- n ? n(k) : x(k);
2240
+ ), g = r || x, f = (w) => {
2241
+ n ? n(w) : b(w);
2178
2242
  }, l = {
2179
2243
  activeTab: g,
2180
2244
  setActiveTab: f
2181
- }, m = t.find((k) => k.id === g), h = p(
2245
+ }, m = t.find((w) => w.id === g), h = p(
2182
2246
  "flex",
2183
2247
  {
2184
2248
  "border-b border-neutral-200 dark:border-neutral-700 px-2": s === "default" || s === "underline",
@@ -2187,8 +2251,8 @@ const ft = ({
2187
2251
  "space-x-8": s === "default" || s === "underline"
2188
2252
  },
2189
2253
  u
2190
- ), w = (k, v) => {
2191
- const j = "transition-colors duration-200 font-medium", N = {
2254
+ ), k = (w, y) => {
2255
+ const A = "transition-colors duration-200 font-medium", N = {
2192
2256
  "text-xs px-2 py-1": o === "sm",
2193
2257
  "text-sm px-3 py-2": o === "md",
2194
2258
  "text-base px-4 py-3": o === "lg"
@@ -2199,36 +2263,36 @@ const ft = ({
2199
2263
  "rounded-md": s === "pills",
2200
2264
  // Underline variant
2201
2265
  "border-b-2 pb-2": s === "underline"
2202
- }, B = {
2203
- "opacity-50 cursor-not-allowed": k.disabled,
2204
- "cursor-pointer": !k.disabled
2205
- }, G = v ? {
2266
+ }, P = {
2267
+ "opacity-50 cursor-not-allowed": w.disabled,
2268
+ "cursor-pointer": !w.disabled
2269
+ }, U = y ? {
2206
2270
  "border-primary text-primary": s === "default" || s === "underline",
2207
2271
  "bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": s === "pills"
2208
- } : {}, F = !v && !k.disabled ? {
2272
+ } : {}, F = !y && !w.disabled ? {
2209
2273
  "border-transparent text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "default",
2210
2274
  "text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "pills",
2211
2275
  "border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": s === "underline"
2212
2276
  } : {};
2213
- return p(j, N, q, B, G, F);
2277
+ return p(A, N, q, P, U, F);
2214
2278
  };
2215
2279
  return /* @__PURE__ */ e(wt.Provider, { value: l, children: /* @__PURE__ */ d("div", { children: [
2216
- /* @__PURE__ */ e("div", { className: h, role: "tablist", children: t.map((k) => /* @__PURE__ */ e(
2280
+ /* @__PURE__ */ e("div", { className: h, role: "tablist", children: t.map((w) => /* @__PURE__ */ e(
2217
2281
  "button",
2218
2282
  {
2219
2283
  type: "button",
2220
2284
  role: "tab",
2221
- "aria-selected": g === k.id,
2222
- "aria-controls": `tabpanel-${k.id}`,
2223
- disabled: k.disabled,
2224
- onClick: () => !k.disabled && f(k.id),
2225
- className: w(k, g === k.id),
2285
+ "aria-selected": g === w.id,
2286
+ "aria-controls": `tabpanel-${w.id}`,
2287
+ disabled: w.disabled,
2288
+ onClick: () => !w.disabled && f(w.id),
2289
+ className: k(w, g === w.id),
2226
2290
  children: /* @__PURE__ */ d("span", { className: "flex items-center gap-2", children: [
2227
- k.label,
2228
- k.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300", children: k.badge })
2291
+ w.label,
2292
+ w.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300", children: w.badge })
2229
2293
  ] })
2230
2294
  },
2231
- k.id
2295
+ w.id
2232
2296
  )) }),
2233
2297
  m?.content && /* @__PURE__ */ e(
2234
2298
  "div",
@@ -2256,23 +2320,23 @@ function St({
2256
2320
  closeOnBackdropClick: s = !0,
2257
2321
  closeOnEscape: o = !0,
2258
2322
  className: u,
2259
- backdropClassName: b,
2260
- children: x,
2323
+ backdropClassName: x,
2324
+ children: b,
2261
2325
  footer: g,
2262
2326
  showCloseButton: f = !0
2263
2327
  }) {
2264
- const l = J(null), m = J(null);
2265
- U(() => {
2328
+ const l = Z(null), m = Z(null);
2329
+ G(() => {
2266
2330
  if (!t || !o) return;
2267
- const w = (k) => {
2268
- k.key === "Escape" && a();
2331
+ const k = (w) => {
2332
+ w.key === "Escape" && a();
2269
2333
  };
2270
- return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
2271
- }, [t, o, a]), U(() => (t ? (m.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (m.current && m.current.focus(), document.body.style.overflow = ""), () => {
2334
+ return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
2335
+ }, [t, o, a]), G(() => (t ? (m.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (m.current && m.current.focus(), document.body.style.overflow = ""), () => {
2272
2336
  document.body.style.overflow = "";
2273
2337
  }), [t]);
2274
- const h = (w) => {
2275
- s && w.target === w.currentTarget && a();
2338
+ const h = (k) => {
2339
+ s && k.target === k.currentTarget && a();
2276
2340
  };
2277
2341
  return t ? /* @__PURE__ */ e(
2278
2342
  "div",
@@ -2281,7 +2345,7 @@ function St({
2281
2345
  "fixed inset-0 z-50 flex items-center justify-center p-4",
2282
2346
  "bg-black/20",
2283
2347
  // 'animate-fade-in',
2284
- b
2348
+ x
2285
2349
  ),
2286
2350
  onClick: h,
2287
2351
  children: /* @__PURE__ */ d(
@@ -2319,7 +2383,7 @@ function St({
2319
2383
  }
2320
2384
  )
2321
2385
  ] }),
2322
- /* @__PURE__ */ e("div", { className: "p-6", children: x }),
2386
+ /* @__PURE__ */ e("div", { className: "p-6", children: b }),
2323
2387
  g && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: g })
2324
2388
  ]
2325
2389
  }
@@ -2327,7 +2391,7 @@ function St({
2327
2391
  }
2328
2392
  ) : null;
2329
2393
  }
2330
- const Z = ({
2394
+ const Y = ({
2331
2395
  variant: t = "body",
2332
2396
  size: a = "md",
2333
2397
  weight: r = "normal",
@@ -2335,14 +2399,14 @@ const Z = ({
2335
2399
  align: s = "left",
2336
2400
  truncate: o = !1,
2337
2401
  italic: u = !1,
2338
- underline: b = !1,
2339
- lineHeight: x = "normal",
2402
+ underline: x = !1,
2403
+ lineHeight: b = "normal",
2340
2404
  as: g,
2341
2405
  className: f,
2342
2406
  children: l,
2343
2407
  ...m
2344
2408
  }) => {
2345
- const h = g || Lt(t), w = p(
2409
+ const h = g || Lt(t), k = p(
2346
2410
  // Base styles
2347
2411
  "font-primary",
2348
2412
  // Variant styles
@@ -2393,19 +2457,19 @@ const Z = ({
2393
2457
  },
2394
2458
  // Line height (override variant line heights)
2395
2459
  t === "body" && {
2396
- "leading-tight": x === "tight",
2397
- "leading-normal": x === "normal",
2398
- "leading-relaxed": x === "relaxed"
2460
+ "leading-tight": b === "tight",
2461
+ "leading-normal": b === "normal",
2462
+ "leading-relaxed": b === "relaxed"
2399
2463
  },
2400
2464
  // Text decorations
2401
2465
  {
2402
2466
  italic: u,
2403
- underline: b,
2467
+ underline: x,
2404
2468
  truncate: o
2405
2469
  },
2406
2470
  f
2407
2471
  );
2408
- return /* @__PURE__ */ e(h, { className: w, ...m, children: l });
2472
+ return /* @__PURE__ */ e(h, { className: k, ...m, children: l });
2409
2473
  };
2410
2474
  function Lt(t) {
2411
2475
  return {
@@ -2423,46 +2487,46 @@ const Et = ({
2423
2487
  error: s,
2424
2488
  disabled: o,
2425
2489
  accept: u,
2426
- onListFiles: b,
2427
- onListMounts: x,
2490
+ onListFiles: x,
2491
+ onListMounts: b,
2428
2492
  onUploadFile: g,
2429
2493
  onDownloadFile: f,
2430
2494
  onRegisterFile: l
2431
2495
  }) => {
2432
- const [m, h] = P(!1), [w, k] = P([]), [v, j] = P(null), [N, q] = P("/"), [B, G] = P([]), [F, I] = P(!1), [H, z] = P(""), [W, V] = P(
2496
+ const [m, h] = B(!1), [k, w] = B([]), [y, A] = B(null), [N, q] = B("/"), [P, U] = B([]), [F, z] = B(!1), [H, D] = B(""), [W, V] = B(
2433
2497
  typeof t == "object" ? t : null
2434
- ), [i, y] = P(!1), [E, S] = P(""), M = J(null);
2435
- U(() => {
2498
+ ), [i, v] = B(!1), [E, S] = B(""), M = Z(null);
2499
+ G(() => {
2436
2500
  m && L();
2437
- }, [m]), U(() => {
2438
- m && v && Q();
2439
- }, [m, v, N, H]);
2501
+ }, [m]), G(() => {
2502
+ m && y && Q();
2503
+ }, [m, y, N, H]);
2440
2504
  const L = async () => {
2441
- I(!0);
2505
+ z(!0);
2442
2506
  try {
2443
- const c = await x?.();
2444
- c?.data && k(c.data);
2507
+ const c = await b?.();
2508
+ c?.data && w(c.data);
2445
2509
  } catch (c) {
2446
2510
  console.error("Failed to load mounts", c);
2447
2511
  } finally {
2448
- I(!1);
2512
+ z(!1);
2449
2513
  }
2450
2514
  }, Q = async () => {
2451
- if (v) {
2452
- I(!0);
2515
+ if (y) {
2516
+ z(!0);
2453
2517
  try {
2454
- const c = await b?.({ mountId: v.id, name: H, path: N });
2455
- c?.data && G(c.data);
2518
+ const c = await x?.({ mountId: y.id, name: H, path: N });
2519
+ c?.data && U(c.data);
2456
2520
  } catch (c) {
2457
2521
  console.error("Failed to load files", c);
2458
2522
  } finally {
2459
- I(!1);
2523
+ z(!1);
2460
2524
  }
2461
2525
  }
2462
2526
  }, re = async (c) => {
2463
2527
  const C = c.target.files?.[0];
2464
2528
  if (C) {
2465
- I(!0);
2529
+ z(!0);
2466
2530
  try {
2467
2531
  const O = await C.arrayBuffer(), R = new Uint8Array(O), _ = {
2468
2532
  id: `local-${Date.now()}`,
@@ -2479,19 +2543,19 @@ const Et = ({
2479
2543
  } catch (O) {
2480
2544
  console.error("Local file selection failed", O);
2481
2545
  } finally {
2482
- I(!1);
2546
+ z(!1);
2483
2547
  }
2484
2548
  }
2485
2549
  }, X = async (c) => {
2486
2550
  const C = c.target.files?.[0];
2487
- if (!(!C || !v)) {
2488
- I(!0);
2551
+ if (!(!C || !y)) {
2552
+ z(!0);
2489
2553
  try {
2490
2554
  const O = await C.arrayBuffer(), R = await g?.({
2491
2555
  file: new Uint8Array(O),
2492
2556
  filename: C.name,
2493
2557
  mimeType: C.type || "application/octet-stream",
2494
- mountId: v.id,
2558
+ mountId: y.id,
2495
2559
  path: N
2496
2560
  });
2497
2561
  if (R?.data) {
@@ -2501,12 +2565,12 @@ const Et = ({
2501
2565
  } catch (O) {
2502
2566
  console.error("Upload failed", O);
2503
2567
  } finally {
2504
- I(!1);
2568
+ z(!1);
2505
2569
  }
2506
2570
  }
2507
2571
  }, $ = async () => {
2508
- if (!(!E || !v)) {
2509
- I(!0);
2572
+ if (!(!E || !y)) {
2573
+ z(!0);
2510
2574
  try {
2511
2575
  const c = `${N}${E}/`;
2512
2576
  l && (await l({
@@ -2515,59 +2579,59 @@ const Et = ({
2515
2579
  path: N,
2516
2580
  mimeType: "application/x-directory",
2517
2581
  size: 0,
2518
- mountId: v.id,
2582
+ mountId: y.id,
2519
2583
  providerKey: c,
2520
2584
  ownerId: "me"
2521
- }), await Q()), y(!1), S("");
2585
+ }), await Q()), v(!1), S("");
2522
2586
  } catch (c) {
2523
2587
  console.error("Failed to create folder", c);
2524
2588
  } finally {
2525
- I(!1);
2589
+ z(!1);
2526
2590
  }
2527
2591
  }
2528
- }, A = async (c) => {
2529
- I(!0);
2592
+ }, j = async (c) => {
2593
+ z(!0);
2530
2594
  try {
2531
2595
  const C = await f?.(c.id);
2532
2596
  V(c), a(c, C), h(!1);
2533
2597
  } catch (C) {
2534
2598
  console.error("Failed to download file", C);
2535
2599
  } finally {
2536
- I(!1);
2600
+ z(!1);
2537
2601
  }
2538
2602
  }, T = (c) => {
2539
2603
  c.stopPropagation(), V(null), a(null);
2540
- }, D = de(() => {
2604
+ }, I = de(() => {
2541
2605
  const c = /* @__PURE__ */ new Set(), C = [];
2542
- return B.forEach((O) => {
2606
+ return P.forEach((O) => {
2543
2607
  if (O.type === "folder") {
2544
2608
  O.path === N && c.add(O.name);
2545
2609
  return;
2546
2610
  }
2547
- const R = O.providerKey || O.name, Y = (N ? R.substring(N.length) : R).split("/").filter((pe) => pe !== "");
2548
- Y.length > 1 ? c.add(Y[0]) : Y.length === 1 && C.push(O);
2611
+ const R = O.providerKey || O.name, J = (N ? R.substring(N.length) : R).split("/").filter((pe) => pe !== "");
2612
+ J.length > 1 ? c.add(J[0]) : J.length === 1 && C.push(O);
2549
2613
  }), {
2550
2614
  folders: Array.from(c).sort(),
2551
2615
  files: C.sort((O, R) => O.name.localeCompare(R.name))
2552
2616
  };
2553
- }, [B, N]), ee = (c) => {
2617
+ }, [P, N]), ee = (c) => {
2554
2618
  q((C) => `${C}${c}/`);
2555
2619
  }, ne = () => {
2556
2620
  const c = N.split("/").filter((C) => C !== "");
2557
2621
  c.pop(), c.length === 0 ? q("/") : q(`${c.join("/")}/`);
2558
2622
  }, K = de(() => {
2559
- const c = D.folders.map((C) => ({
2623
+ const c = I.folders.map((C) => ({
2560
2624
  id: `folder-${C}`,
2561
2625
  name: C,
2562
2626
  type: "folder"
2563
2627
  }));
2564
- return D.files.forEach((C) => {
2628
+ return I.files.forEach((C) => {
2565
2629
  c.push({
2566
2630
  ...C,
2567
2631
  type: "file"
2568
2632
  });
2569
2633
  }), c;
2570
- }, [D]), le = [
2634
+ }, [I]), le = [
2571
2635
  {
2572
2636
  id: "name",
2573
2637
  header: "Name",
@@ -2576,7 +2640,7 @@ const Et = ({
2576
2640
  /* @__PURE__ */ e(
2577
2641
  oe,
2578
2642
  {
2579
- icon: C.type === "folder" ? Ce : xe,
2643
+ icon: C.type === "folder" ? Se : xe,
2580
2644
  size: "sm",
2581
2645
  color: C.type === "folder" ? "warning" : "secondary"
2582
2646
  }
@@ -2605,7 +2669,7 @@ const Et = ({
2605
2669
  size: "sm",
2606
2670
  variant: "outline",
2607
2671
  onClick: (O) => {
2608
- O.stopPropagation(), C.type === "folder" ? ee(C.name) : A(C);
2672
+ O.stopPropagation(), C.type === "folder" ? ee(C.name) : j(C);
2609
2673
  },
2610
2674
  loading: F && C.type === "file" && W?.id === C.id,
2611
2675
  children: C.type === "folder" ? "Open" : "Select"
@@ -2618,7 +2682,7 @@ const Et = ({
2618
2682
  header: "Mount Name",
2619
2683
  accessor: "name",
2620
2684
  cell: (c) => /* @__PURE__ */ d("div", { className: "flex items-center gap-2 font-medium", children: [
2621
- /* @__PURE__ */ e(oe, { icon: ke, size: "sm", color: "primary" }),
2685
+ /* @__PURE__ */ e(oe, { icon: Ce, size: "sm", color: "primary" }),
2622
2686
  /* @__PURE__ */ e("span", { children: c })
2623
2687
  ] })
2624
2688
  },
@@ -2627,11 +2691,11 @@ const Et = ({
2627
2691
  header: "",
2628
2692
  accessor: "id",
2629
2693
  align: "right",
2630
- cell: (c, C) => /* @__PURE__ */ e(te, { size: "sm", variant: "outline", onClick: () => j(C), children: "Open" })
2694
+ cell: (c, C) => /* @__PURE__ */ e(te, { size: "sm", variant: "outline", onClick: () => A(C), children: "Open" })
2631
2695
  }
2632
2696
  ];
2633
2697
  return /* @__PURE__ */ d("div", { className: "space-y-1", children: [
2634
- r && /* @__PURE__ */ e(Z, { variant: "label", size: "sm", weight: "medium", children: r }),
2698
+ r && /* @__PURE__ */ e(Y, { variant: "label", size: "sm", weight: "medium", children: r }),
2635
2699
  /* @__PURE__ */ d(
2636
2700
  "div",
2637
2701
  {
@@ -2643,7 +2707,7 @@ const Et = ({
2643
2707
  o && "opacity-50 cursor-not-allowed bg-module-subtle"
2644
2708
  ),
2645
2709
  children: [
2646
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: W ? xe : ke, color: W ? "primary" : "secondary" }) }),
2710
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: W ? xe : Ce, color: W ? "primary" : "secondary" }) }),
2647
2711
  /* @__PURE__ */ e("div", { className: "flex-grow truncate", children: W ? /* @__PURE__ */ e("span", { className: "text-sm text-default font-medium", children: W.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-muted", children: n }) }),
2648
2712
  W && !o && /* @__PURE__ */ e(
2649
2713
  "button",
@@ -2656,15 +2720,15 @@ const Et = ({
2656
2720
  ]
2657
2721
  }
2658
2722
  ),
2659
- s && /* @__PURE__ */ e(Z, { variant: "body", size: "xs", className: "text-error", children: s }),
2723
+ s && /* @__PURE__ */ e(Y, { variant: "body", size: "xs", className: "text-error", children: s }),
2660
2724
  /* @__PURE__ */ e(
2661
2725
  St,
2662
2726
  {
2663
2727
  open: m,
2664
2728
  onClose: () => {
2665
- h(!1), j(null), q("/"), y(!1);
2729
+ h(!1), A(null), q("/"), v(!1);
2666
2730
  },
2667
- title: v ? `Explorer: ${v.name}` : "Select Storage Mount",
2731
+ title: y ? `Explorer: ${y.name}` : "Select Storage Mount",
2668
2732
  size: "lg",
2669
2733
  children: /* @__PURE__ */ e(
2670
2734
  kt,
@@ -2674,7 +2738,7 @@ const Et = ({
2674
2738
  {
2675
2739
  id: "remote",
2676
2740
  label: "Platform Storage",
2677
- content: /* @__PURE__ */ e("div", { className: "space-y-4", children: v ? /* @__PURE__ */ d($e, { children: [
2741
+ content: /* @__PURE__ */ e("div", { className: "space-y-4", children: y ? /* @__PURE__ */ d(we, { children: [
2678
2742
  /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
2679
2743
  /* @__PURE__ */ e(
2680
2744
  te,
@@ -2682,9 +2746,9 @@ const Et = ({
2682
2746
  variant: "ghost",
2683
2747
  size: "sm",
2684
2748
  onClick: () => {
2685
- N && N !== "/" ? ne() : j(null);
2749
+ N && N !== "/" ? ne() : A(null);
2686
2750
  },
2687
- leftIcon: /* @__PURE__ */ e(oe, { icon: we, size: "xs" }),
2751
+ leftIcon: /* @__PURE__ */ e(oe, { icon: ke, size: "xs" }),
2688
2752
  children: N ? "Back" : "Back to Mounts"
2689
2753
  }
2690
2754
  ),
@@ -2694,7 +2758,7 @@ const Et = ({
2694
2758
  {
2695
2759
  placeholder: "Search...",
2696
2760
  value: H,
2697
- onChange: (c) => z(c.target.value),
2761
+ onChange: (c) => D(c.target.value),
2698
2762
  startIcon: /* @__PURE__ */ e(Te, { size: 14 }),
2699
2763
  fullWidth: !0,
2700
2764
  size: "sm"
@@ -2706,7 +2770,7 @@ const Et = ({
2706
2770
  {
2707
2771
  variant: "outline",
2708
2772
  size: "sm",
2709
- onClick: () => y(!0),
2773
+ onClick: () => v(!0),
2710
2774
  leftIcon: /* @__PURE__ */ e(oe, { icon: Ve, size: "xs" }),
2711
2775
  children: "New Folder"
2712
2776
  }
@@ -2735,7 +2799,7 @@ const Et = ({
2735
2799
  ] })
2736
2800
  ] }),
2737
2801
  i && /* @__PURE__ */ d("div", { className: "flex items-center gap-2 p-3 bg-module-subtle rounded-lg border border-neutral", children: [
2738
- /* @__PURE__ */ e(oe, { icon: Ce, size: "sm", color: "warning" }),
2802
+ /* @__PURE__ */ e(oe, { icon: Se, size: "sm", color: "warning" }),
2739
2803
  /* @__PURE__ */ e(
2740
2804
  ue,
2741
2805
  {
@@ -2747,7 +2811,7 @@ const Et = ({
2747
2811
  }
2748
2812
  ),
2749
2813
  /* @__PURE__ */ e(te, { size: "sm", onClick: $, loading: F, children: "Create" }),
2750
- /* @__PURE__ */ e(te, { size: "sm", variant: "ghost", onClick: () => y(!1), children: "Cancel" })
2814
+ /* @__PURE__ */ e(te, { size: "sm", variant: "ghost", onClick: () => v(!1), children: "Cancel" })
2751
2815
  ] }),
2752
2816
  /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
2753
2817
  Le,
@@ -2756,17 +2820,17 @@ const Et = ({
2756
2820
  columns: le,
2757
2821
  loading: F,
2758
2822
  emptyContent: "This folder is empty",
2759
- onRowClick: (c) => c.type === "folder" ? ee(c.name) : A(c)
2823
+ onRowClick: (c) => c.type === "folder" ? ee(c.name) : j(c)
2760
2824
  }
2761
2825
  ) })
2762
2826
  ] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral", children: /* @__PURE__ */ e(
2763
2827
  Le,
2764
2828
  {
2765
- data: w,
2829
+ data: k,
2766
2830
  columns: he,
2767
2831
  loading: F,
2768
2832
  emptyContent: "No storage mounts configured",
2769
- onRowClick: (c) => j(c)
2833
+ onRowClick: (c) => A(c)
2770
2834
  }
2771
2835
  ) }) })
2772
2836
  },
@@ -2775,8 +2839,8 @@ const Et = ({
2775
2839
  label: "Local File",
2776
2840
  content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-neutral rounded-xl bg-module-subtle/50", children: [
2777
2841
  /* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: xe, size: "xl", color: "primary" }) }),
2778
- /* @__PURE__ */ e(Z, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
2779
- /* @__PURE__ */ d(Z, { variant: "body", size: "sm", className: "text-muted mt-1 mb-6 text-center max-w-xs", children: [
2842
+ /* @__PURE__ */ e(Y, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
2843
+ /* @__PURE__ */ d(Y, { variant: "body", size: "sm", className: "text-muted mt-1 mb-6 text-center max-w-xs", children: [
2780
2844
  "This file will be used directly in the form and will ",
2781
2845
  /* @__PURE__ */ e("strong", { children: "not" }),
2782
2846
  " be uploaded to platform storage."
@@ -2820,10 +2884,10 @@ function Mt({
2820
2884
  size: s = "md",
2821
2885
  placeholder: o,
2822
2886
  templatePlaceholder: u,
2823
- showTemplate: b = !0
2887
+ showTemplate: x = !0
2824
2888
  }) {
2825
- const [x, g] = P([]);
2826
- U(() => {
2889
+ const [b, g] = B([]);
2890
+ G(() => {
2827
2891
  let l = !0;
2828
2892
  return Promise.resolve(r?.()).then((m) => {
2829
2893
  l && m && g(m.data ?? []);
@@ -2840,12 +2904,12 @@ function Mt({
2840
2904
  size: s,
2841
2905
  fullWidth: !0,
2842
2906
  value: f.folderId ?? "",
2843
- options: x.map((l) => ({ value: l.id, label: l.name })),
2907
+ options: b.map((l) => ({ value: l.id, label: l.name })),
2844
2908
  placeholder: o ?? "Select a folder",
2845
2909
  onChange: (l) => a?.({ ...f, folderId: l })
2846
2910
  }
2847
2911
  ),
2848
- b && /* @__PURE__ */ e(
2912
+ x && /* @__PURE__ */ e(
2849
2913
  ue,
2850
2914
  {
2851
2915
  size: s,
@@ -2867,8 +2931,8 @@ function $t(t, a, r) {
2867
2931
  const n = a.split("."), s = Array.isArray(t) ? [...t] : { ...t };
2868
2932
  let o = s;
2869
2933
  for (let u = 0; u < n.length - 1; u++) {
2870
- const b = n[u], x = o[b];
2871
- o[b] = x && typeof x == "object" ? Array.isArray(x) ? [...x] : { ...x } : {}, o = o[b];
2934
+ const x = n[u], b = o[x];
2935
+ o[x] = b && typeof b == "object" ? Array.isArray(b) ? [...b] : { ...b } : {}, o = o[x];
2872
2936
  }
2873
2937
  return o[n[n.length - 1]] = r, s;
2874
2938
  }
@@ -2890,42 +2954,42 @@ const cr = ({
2890
2954
  onChange: s,
2891
2955
  transform: o,
2892
2956
  validate: u,
2893
- submitButton: b = { label: "Submit", variant: "primary" },
2894
- cancelButton: x = { label: "Cancel", variant: "outline" },
2957
+ submitButton: x = { label: "Submit", variant: "primary" },
2958
+ cancelButton: b = { label: "Cancel", variant: "outline" },
2895
2959
  showButtons: g = !0,
2896
2960
  layout: f = "vertical",
2897
2961
  size: l = "md",
2898
2962
  loading: m = !1,
2899
2963
  className: h,
2900
- ref: w,
2901
- sdk: k
2964
+ ref: k,
2965
+ sdk: w
2902
2966
  }) => {
2903
- const [v, j] = P(a || {}), [N, q] = P({}), [B, G] = P({});
2904
- U(() => {
2905
- a && j({ ...a });
2967
+ const [y, A] = B(a || {}), [N, q] = B({}), [P, U] = B({});
2968
+ G(() => {
2969
+ a && A({ ...a });
2906
2970
  }, [a]);
2907
2971
  const F = ae(
2908
- (i, y, E) => {
2972
+ (i, v, E) => {
2909
2973
  const S = t.flatMap((M) => M.items).find((M) => M.name === i);
2910
2974
  if (!S) return null;
2911
- if (S.required && (y == null || y === ""))
2975
+ if (S.required && (v == null || v === ""))
2912
2976
  return `${S.label} is required`;
2913
2977
  if (S.type === "array") {
2914
- if (S.required && (!y || y.length === 0))
2978
+ if (S.required && (!v || v.length === 0))
2915
2979
  return `${S.label} cannot be empty.`;
2916
- if (y && !Array.isArray(y))
2980
+ if (v && !Array.isArray(v))
2917
2981
  return `${S.label} must be an array.`;
2918
- if (Array.isArray(y) && S.arrayFields) {
2982
+ if (Array.isArray(v) && S.arrayFields) {
2919
2983
  const M = [];
2920
2984
  let L = !1;
2921
- if (y.forEach((Q, re) => {
2985
+ if (v.forEach((Q, re) => {
2922
2986
  const X = {};
2923
2987
  for (const $ of S.arrayFields) {
2924
- const A = Q?.[$.name];
2925
- if ($.required && (A == null || A === ""))
2988
+ const j = Q?.[$.name];
2989
+ if ($.required && (j == null || j === ""))
2926
2990
  X[$.name] = `${$.label} is required`, L = !0;
2927
2991
  else if ($.validator) {
2928
- const T = $.validator(A, Q);
2992
+ const T = $.validator(j, Q);
2929
2993
  T && (X[$.name] = T, L = !0);
2930
2994
  }
2931
2995
  }
@@ -2934,52 +2998,52 @@ const cr = ({
2934
2998
  return JSON.stringify(M);
2935
2999
  }
2936
3000
  }
2937
- return S.validator ? S.validator(y, E) : null;
3001
+ return S.validator ? S.validator(v, E) : null;
2938
3002
  },
2939
3003
  [t]
2940
- ), I = ae(
2941
- (i, y) => {
3004
+ ), z = ae(
3005
+ (i, v) => {
2942
3006
  let E = $t(
2943
- v,
3007
+ y,
2944
3008
  i,
2945
- y
3009
+ v
2946
3010
  );
2947
- t.flatMap((L) => L.items).find((L) => L.name === i)?.removeIfEmpty && (y == null || y === "") && (E = Tt(E, i)), j(E), G((L) => ({ ...L, [i]: !0 }));
2948
- const M = F(i, y, E);
3011
+ t.flatMap((L) => L.items).find((L) => L.name === i)?.removeIfEmpty && (v == null || v === "") && (E = Tt(E, i)), A(E), U((L) => ({ ...L, [i]: !0 }));
3012
+ const M = F(i, v, E);
2949
3013
  q((L) => ({
2950
3014
  ...L,
2951
3015
  [i]: M || ""
2952
3016
  })), s?.(E, i);
2953
3017
  },
2954
- [v, t, F, s]
3018
+ [y, t, F, s]
2955
3019
  ), H = ae(
2956
3020
  async (i) => {
2957
3021
  if (console.log("handleSubmit"), i.preventDefault(), m) return;
2958
- const y = {}, E = t.flatMap((M) => M.items);
3022
+ const v = {}, E = t.flatMap((M) => M.items);
2959
3023
  for (const M of E) {
2960
- if (M.hidden || M.conditional && !M.conditional(v))
3024
+ if (M.hidden || M.conditional && !M.conditional(y))
2961
3025
  continue;
2962
3026
  const L = F(
2963
3027
  M.name,
2964
- Ee(v, M.name),
2965
- v
3028
+ Ee(y, M.name),
3029
+ y
2966
3030
  );
2967
- L && (y[M.name] = L);
3031
+ L && (v[M.name] = L);
2968
3032
  }
2969
3033
  if (u) {
2970
- const M = u(v);
2971
- M && Object.assign(y, M);
3034
+ const M = u(y);
3035
+ M && Object.assign(v, M);
2972
3036
  }
2973
- if (q(y), console.log("newErrors", y), Object.keys(y).some((M) => y[M]))
3037
+ if (q(v), console.log("newErrors", v), Object.keys(v).some((M) => v[M]))
2974
3038
  return;
2975
- const S = o ? o(v) : v;
2976
- await r?.(v, S);
3039
+ const S = o ? o(y) : y;
3040
+ await r?.(y, S);
2977
3041
  },
2978
- [v, t, F, u, o, r, m]
2979
- ), z = ae(
3042
+ [y, t, F, u, o, r, m]
3043
+ ), D = ae(
2980
3044
  (i) => {
2981
- const y = Ee(v, i.name), E = B[i.name] ? N[i.name] : void 0, S = i.disabled || m, M = {
2982
- value: y || "",
3045
+ const v = Ee(y, i.name), E = P[i.name] ? N[i.name] : void 0, S = i.disabled || m, M = {
3046
+ value: v || "",
2983
3047
  disabled: S,
2984
3048
  required: i.required,
2985
3049
  placeholder: i.placeholder,
@@ -2996,7 +3060,7 @@ const cr = ({
2996
3060
  ue,
2997
3061
  {
2998
3062
  ...M,
2999
- onChange: (L) => I(i.name, L.target.value),
3063
+ onChange: (L) => z(i.name, L.target.value),
3000
3064
  type: i.textType || i.type,
3001
3065
  autoComplete: i.autocomplete,
3002
3066
  error: E,
@@ -3008,7 +3072,7 @@ const cr = ({
3008
3072
  Ne,
3009
3073
  {
3010
3074
  ...M,
3011
- onChange: (L) => I(i.name, L.target.value),
3075
+ onChange: (L) => z(i.name, L.target.value),
3012
3076
  rows: 4,
3013
3077
  error: E,
3014
3078
  size: l
@@ -3019,7 +3083,7 @@ const cr = ({
3019
3083
  fe,
3020
3084
  {
3021
3085
  ...M,
3022
- onChange: (L) => I(i.name, L),
3086
+ onChange: (L) => z(i.name, L),
3023
3087
  options: (i.options || []).map((L) => ({
3024
3088
  ...L,
3025
3089
  value: String(L.value)
@@ -3033,11 +3097,11 @@ const cr = ({
3033
3097
  );
3034
3098
  case "checkbox":
3035
3099
  return /* @__PURE__ */ e(
3036
- ye,
3100
+ ve,
3037
3101
  {
3038
3102
  ...M,
3039
- checked: !!y,
3040
- onChange: (L) => I(i.name, L.target.checked),
3103
+ checked: !!v,
3104
+ onChange: (L) => z(i.name, L.target.checked),
3041
3105
  size: l
3042
3106
  }
3043
3107
  );
@@ -3049,21 +3113,21 @@ const cr = ({
3049
3113
  type: "radio",
3050
3114
  name: i.name,
3051
3115
  value: L.value,
3052
- checked: y === L.value,
3053
- onChange: () => I(i.name, L.value),
3116
+ checked: v === L.value,
3117
+ onChange: () => z(i.name, L.value),
3054
3118
  disabled: S || L.disabled,
3055
3119
  className: "rounded-full border-neutral-100 dark:border-neutral-600"
3056
3120
  }
3057
3121
  ),
3058
- /* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: L.label })
3122
+ /* @__PURE__ */ e(Y, { variant: "label", size: "sm", children: L.label })
3059
3123
  ] }, L.value)) });
3060
3124
  case "date":
3061
3125
  return /* @__PURE__ */ e(
3062
- ve,
3126
+ ye,
3063
3127
  {
3064
3128
  ...M,
3065
- value: y ? new Date(y) : null,
3066
- onChange: (L) => I(i.name, L),
3129
+ value: v ? new Date(v) : null,
3130
+ onChange: (L) => z(i.name, L),
3067
3131
  size: l
3068
3132
  }
3069
3133
  );
@@ -3072,28 +3136,28 @@ const cr = ({
3072
3136
  Et,
3073
3137
  {
3074
3138
  ...M,
3075
- value: y,
3076
- onChange: (L) => I(i.name, L),
3139
+ value: v,
3140
+ onChange: (L) => z(i.name, L),
3077
3141
  error: E,
3078
- onListFiles: (L) => k?.http.invoke({
3142
+ onListFiles: (L) => w?.http.invoke({
3079
3143
  method: "POST",
3080
3144
  action: "storage.file.list",
3081
3145
  body: L
3082
3146
  }),
3083
- onListMounts: () => k?.http.invoke({
3147
+ onListMounts: () => w?.http.invoke({
3084
3148
  method: "GET",
3085
3149
  action: "storage.mount"
3086
3150
  }),
3087
- onUploadFile: (L) => k?.http.invoke({
3151
+ onUploadFile: (L) => w?.http.invoke({
3088
3152
  method: "POST",
3089
3153
  action: "storage.file.upload",
3090
3154
  body: L
3091
3155
  }),
3092
- onDownloadFile: (L) => k?.http.invoke({
3156
+ onDownloadFile: (L) => w?.http.invoke({
3093
3157
  method: "GET",
3094
3158
  action: `storage.file.${L}.download`
3095
3159
  }),
3096
- onRegisterFile: (L) => k?.http.invoke({
3160
+ onRegisterFile: (L) => w?.http.invoke({
3097
3161
  method: "POST",
3098
3162
  action: "storage.file.folder",
3099
3163
  body: L
@@ -3104,9 +3168,9 @@ const cr = ({
3104
3168
  return /* @__PURE__ */ e(
3105
3169
  Mt,
3106
3170
  {
3107
- value: y || {},
3108
- onChange: (L) => I(i.name, L),
3109
- onListFolders: () => k?.http.invoke({
3171
+ value: v || {},
3172
+ onChange: (L) => z(i.name, L),
3173
+ onListFolders: () => w?.http.invoke({
3110
3174
  method: "GET",
3111
3175
  action: "storage.mount"
3112
3176
  }),
@@ -3117,13 +3181,13 @@ const cr = ({
3117
3181
  );
3118
3182
  case "custom":
3119
3183
  return i.customComponent?.({
3120
- value: y,
3121
- onChange: (L) => I(i.name, L),
3184
+ value: v,
3185
+ onChange: (L) => z(i.name, L),
3122
3186
  error: E,
3123
3187
  disabled: S
3124
3188
  });
3125
3189
  case "array": {
3126
- const L = y || [];
3190
+ const L = v || [];
3127
3191
  let Q = [];
3128
3192
  if (typeof E == "string" && E.startsWith("["))
3129
3193
  try {
@@ -3131,21 +3195,21 @@ const cr = ({
3131
3195
  } catch {
3132
3196
  }
3133
3197
  const re = () => {
3134
- I(i.name, [...L, {}]);
3135
- }, X = (A) => {
3136
- I(
3198
+ z(i.name, [...L, {}]);
3199
+ }, X = (j) => {
3200
+ z(
3137
3201
  i.name,
3138
- L.filter((T, D) => D !== A)
3202
+ L.filter((T, I) => I !== j)
3139
3203
  );
3140
- }, $ = (A, T, D) => {
3204
+ }, $ = (j, T, I) => {
3141
3205
  const ee = [...L];
3142
- ee[A] = {
3143
- ...ee[A],
3144
- [T]: D
3145
- }, I(i.name, ee);
3206
+ ee[j] = {
3207
+ ...ee[j],
3208
+ [T]: I
3209
+ }, z(i.name, ee);
3146
3210
  };
3147
3211
  return /* @__PURE__ */ d("div", { className: "space-y-2", children: [
3148
- L.map((A, T) => /* @__PURE__ */ d(
3212
+ L.map((j, T) => /* @__PURE__ */ d(
3149
3213
  "div",
3150
3214
  {
3151
3215
  className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
@@ -3161,34 +3225,34 @@ const cr = ({
3161
3225
  children: "Remove"
3162
3226
  }
3163
3227
  ) }),
3164
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: i.arrayFields?.map((D) => {
3165
- const ee = Q?.[T]?.[D.name];
3228
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: i.arrayFields?.map((I) => {
3229
+ const ee = Q?.[T]?.[I.name];
3166
3230
  return /* @__PURE__ */ d(
3167
3231
  "div",
3168
3232
  {
3169
3233
  className: "space-y-1",
3170
3234
  children: [
3171
3235
  /* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */ d(
3172
- Z,
3236
+ Y,
3173
3237
  {
3174
3238
  variant: "label",
3175
3239
  size: "sm",
3176
3240
  className: "font-semibold text-neutral-700 dark:text-neutral-300",
3177
3241
  children: [
3178
- D.label,
3179
- D.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
3242
+ I.label,
3243
+ I.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
3180
3244
  ]
3181
3245
  }
3182
3246
  ) }),
3183
3247
  (() => {
3184
3248
  const ne = {
3185
- value: A?.[D.name] || "",
3249
+ value: j?.[I.name] || "",
3186
3250
  disabled: S,
3187
- required: D.required,
3188
- placeholder: D.placeholder,
3189
- ...D.fieldProps
3251
+ required: I.required,
3252
+ placeholder: I.placeholder,
3253
+ ...I.fieldProps
3190
3254
  };
3191
- switch (D.type) {
3255
+ switch (I.type) {
3192
3256
  case "text":
3193
3257
  case "email":
3194
3258
  case "password":
@@ -3201,11 +3265,11 @@ const cr = ({
3201
3265
  ...ne,
3202
3266
  onChange: (K) => $(
3203
3267
  T,
3204
- D.name,
3268
+ I.name,
3205
3269
  K.target.value
3206
3270
  ),
3207
- type: D.textType || D.type,
3208
- autoComplete: D.autocomplete,
3271
+ type: I.textType || I.type,
3272
+ autoComplete: I.autocomplete,
3209
3273
  error: ee,
3210
3274
  size: l
3211
3275
  }
@@ -3217,7 +3281,7 @@ const cr = ({
3217
3281
  ...ne,
3218
3282
  onChange: (K) => $(
3219
3283
  T,
3220
- D.name,
3284
+ I.name,
3221
3285
  K.target.value
3222
3286
  ),
3223
3287
  rows: 4,
@@ -3232,38 +3296,38 @@ const cr = ({
3232
3296
  ...ne,
3233
3297
  onChange: (K) => $(
3234
3298
  T,
3235
- D.name,
3299
+ I.name,
3236
3300
  K
3237
3301
  ),
3238
- options: (D.options || []).map(
3302
+ options: (I.options || []).map(
3239
3303
  (K) => ({
3240
3304
  ...K,
3241
3305
  value: String(K.value)
3242
3306
  })
3243
3307
  ),
3244
- searchable: D.searchable,
3245
- multiple: D.multiple,
3246
- allowCreate: D.allowCreate,
3308
+ searchable: I.searchable,
3309
+ multiple: I.multiple,
3310
+ allowCreate: I.allowCreate,
3247
3311
  error: ee,
3248
3312
  size: l
3249
3313
  }
3250
3314
  );
3251
3315
  case "checkbox":
3252
3316
  return /* @__PURE__ */ e(
3253
- ye,
3317
+ ve,
3254
3318
  {
3255
3319
  ...ne,
3256
- checked: !!A?.[D.name],
3320
+ checked: !!j?.[I.name],
3257
3321
  onChange: (K) => $(
3258
3322
  T,
3259
- D.name,
3323
+ I.name,
3260
3324
  K.target.checked
3261
3325
  ),
3262
3326
  size: l
3263
3327
  }
3264
3328
  );
3265
3329
  case "radio":
3266
- return /* @__PURE__ */ e("div", { className: "space-y-1", children: D.options?.map((K) => /* @__PURE__ */ d(
3330
+ return /* @__PURE__ */ e("div", { className: "space-y-1", children: I.options?.map((K) => /* @__PURE__ */ d(
3267
3331
  "label",
3268
3332
  {
3269
3333
  className: "flex items-center gap-2",
@@ -3272,33 +3336,33 @@ const cr = ({
3272
3336
  "input",
3273
3337
  {
3274
3338
  type: "radio",
3275
- name: `${i.name}.${T}.${D.name}`,
3339
+ name: `${i.name}.${T}.${I.name}`,
3276
3340
  value: K.value,
3277
- checked: A?.[D.name] === K.value,
3341
+ checked: j?.[I.name] === K.value,
3278
3342
  onChange: () => $(
3279
3343
  T,
3280
- D.name,
3344
+ I.name,
3281
3345
  K.value
3282
3346
  ),
3283
3347
  disabled: S || K.disabled,
3284
3348
  className: "rounded-full border-neutral-100 dark:border-neutral-600"
3285
3349
  }
3286
3350
  ),
3287
- /* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: K.label })
3351
+ /* @__PURE__ */ e(Y, { variant: "label", size: "sm", children: K.label })
3288
3352
  ]
3289
3353
  },
3290
3354
  K.value
3291
3355
  )) });
3292
3356
  case "date": {
3293
- const K = A?.[D.name];
3357
+ const K = j?.[I.name];
3294
3358
  return /* @__PURE__ */ e(
3295
- ve,
3359
+ ye,
3296
3360
  {
3297
3361
  ...ne,
3298
3362
  value: K ? new Date(K) : null,
3299
3363
  onChange: (le) => $(
3300
3364
  T,
3301
- D.name,
3365
+ I.name,
3302
3366
  le
3303
3367
  ),
3304
3368
  size: l
@@ -3306,11 +3370,11 @@ const cr = ({
3306
3370
  );
3307
3371
  }
3308
3372
  case "custom":
3309
- return D.customComponent?.({
3310
- value: A?.[D.name],
3373
+ return I.customComponent?.({
3374
+ value: j?.[I.name],
3311
3375
  onChange: (K) => $(
3312
3376
  T,
3313
- D.name,
3377
+ I.name,
3314
3378
  K
3315
3379
  ),
3316
3380
  error: ee,
@@ -3321,12 +3385,12 @@ const cr = ({
3321
3385
  return /* @__PURE__ */ d("p", { children: [
3322
3386
  "Unsupported field type in array:",
3323
3387
  " ",
3324
- D.type
3388
+ I.type
3325
3389
  ] });
3326
3390
  }
3327
3391
  })(),
3328
3392
  ee && /* @__PURE__ */ e(
3329
- Z,
3393
+ Y,
3330
3394
  {
3331
3395
  variant: "body",
3332
3396
  size: "sm",
@@ -3336,7 +3400,7 @@ const cr = ({
3336
3400
  )
3337
3401
  ]
3338
3402
  },
3339
- D.name
3403
+ I.name
3340
3404
  );
3341
3405
  }) })
3342
3406
  ]
@@ -3363,13 +3427,13 @@ const cr = ({
3363
3427
  return null;
3364
3428
  }
3365
3429
  },
3366
- [v, B, N, m, l, I]
3430
+ [y, P, N, m, l, z]
3367
3431
  ), W = ae(
3368
3432
  (i) => {
3369
- if (i.conditional && !i.conditional(v))
3433
+ if (i.conditional && !i.conditional(y))
3370
3434
  return null;
3371
- const y = i.items.filter((S) => !(S.hidden || S.conditional && !S.conditional(v)));
3372
- if (y.length === 0) return null;
3435
+ const v = i.items.filter((S) => !(S.hidden || S.conditional && !S.conditional(y)));
3436
+ if (v.length === 0) return null;
3373
3437
  const E = p(
3374
3438
  "space-y-2",
3375
3439
  {
@@ -3391,7 +3455,7 @@ const cr = ({
3391
3455
  children: [
3392
3456
  /* @__PURE__ */ d("div", { className: "md:col-span-1", children: [
3393
3457
  /* @__PURE__ */ e(
3394
- Z,
3458
+ Y,
3395
3459
  {
3396
3460
  variant: "label",
3397
3461
  size: "lg",
@@ -3401,7 +3465,7 @@ const cr = ({
3401
3465
  }
3402
3466
  ),
3403
3467
  i.description && /* @__PURE__ */ e(
3404
- Z,
3468
+ Y,
3405
3469
  {
3406
3470
  variant: "body",
3407
3471
  size: "sm",
@@ -3410,7 +3474,7 @@ const cr = ({
3410
3474
  }
3411
3475
  )
3412
3476
  ] }),
3413
- /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: E, children: y.map((S) => (B[S.name] && N[S.name], /* @__PURE__ */ d(
3477
+ /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: E, children: v.map((S) => (P[S.name] && N[S.name], /* @__PURE__ */ d(
3414
3478
  "div",
3415
3479
  {
3416
3480
  className: p(
@@ -3420,7 +3484,7 @@ const cr = ({
3420
3484
  ),
3421
3485
  children: [
3422
3486
  S.type !== "custom" && /* @__PURE__ */ e("label", { className: "block", children: /* @__PURE__ */ d(
3423
- Z,
3487
+ Y,
3424
3488
  {
3425
3489
  variant: "label",
3426
3490
  size: "sm",
@@ -3431,7 +3495,7 @@ const cr = ({
3431
3495
  ]
3432
3496
  }
3433
3497
  ) }),
3434
- z(S)
3498
+ D(S)
3435
3499
  ]
3436
3500
  },
3437
3501
  S.name
@@ -3441,7 +3505,7 @@ const cr = ({
3441
3505
  i.id
3442
3506
  );
3443
3507
  },
3444
- [v, B, N, z]
3508
+ [y, P, N, D]
3445
3509
  ), V = p(
3446
3510
  "space-y-6",
3447
3511
  {
@@ -3452,91 +3516,36 @@ const cr = ({
3452
3516
  },
3453
3517
  h
3454
3518
  );
3455
- return /* @__PURE__ */ d("form", { ref: w, onSubmit: H, className: V, children: [
3519
+ return /* @__PURE__ */ d("form", { ref: k, onSubmit: H, className: V, children: [
3456
3520
  /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(W) }),
3457
3521
  g && /* @__PURE__ */ d("div", { className: p("flex gap-3 justify-end pt-8"), children: [
3458
3522
  n && /* @__PURE__ */ e(
3459
3523
  te,
3460
3524
  {
3461
3525
  type: "button",
3462
- variant: x.variant,
3463
- size: x.size || l,
3464
- disabled: x.disabled || m,
3526
+ variant: b.variant,
3527
+ size: b.size || l,
3528
+ disabled: b.disabled || m,
3465
3529
  onClick: n,
3466
- className: x.className,
3467
- children: x.label
3530
+ className: b.className,
3531
+ children: b.label
3468
3532
  }
3469
3533
  ),
3470
3534
  /* @__PURE__ */ e(
3471
3535
  te,
3472
3536
  {
3473
3537
  type: "submit",
3474
- variant: b.variant,
3475
- size: b.size || l,
3476
- disabled: b.disabled || m,
3538
+ variant: x.variant,
3539
+ size: x.size || l,
3540
+ disabled: x.disabled || m,
3477
3541
  loading: m,
3478
- className: b.className,
3479
- children: b.label
3542
+ className: x.className,
3543
+ children: x.label
3480
3544
  }
3481
3545
  )
3482
3546
  ] })
3483
3547
  ] });
3484
- }, ir = ({
3485
- trigger: t,
3486
- children: a,
3487
- placement: r = "bottom-start",
3488
- className: n,
3489
- disabled: s = !1
3490
- }) => {
3491
- const [o, u] = P(!1), [b, x] = P({}), g = J(null), f = J(null);
3492
- U(() => {
3493
- if (!o) return;
3494
- const h = (k) => {
3495
- g.current && !g.current.contains(k.target) && u(!1);
3496
- }, w = (k) => {
3497
- k.key === "Escape" && u(!1);
3498
- };
3499
- return document.addEventListener("mousedown", h), document.addEventListener("keydown", w), () => {
3500
- document.removeEventListener("mousedown", h), document.removeEventListener("keydown", w);
3501
- };
3502
- }, [o]);
3503
- const l = (h) => {
3504
- if (h.stopPropagation(), !s) {
3505
- if (!o) {
3506
- const w = f.current?.getBoundingClientRect();
3507
- if (w) {
3508
- const v = {};
3509
- r.startsWith("bottom") ? v.top = w.bottom + 6 : v.bottom = window.innerHeight - w.top + 6, r.endsWith("start") ? v.left = w.left : v.right = window.innerWidth - w.right, x(v);
3510
- }
3511
- }
3512
- u((w) => !w);
3513
- }
3514
- }, m = () => u(!1);
3515
- return /* @__PURE__ */ d("div", { ref: g, className: "relative inline-flex", children: [
3516
- /* @__PURE__ */ e(
3517
- "button",
3518
- {
3519
- ref: f,
3520
- type: "button",
3521
- onClick: l,
3522
- disabled: s,
3523
- className: p("inline-flex items-center", s && "opacity-50 cursor-not-allowed"),
3524
- children: t
3525
- }
3526
- ),
3527
- o && /* @__PURE__ */ e(
3528
- "div",
3529
- {
3530
- className: p(
3531
- "fixed z-[60] bg-module rounded-lg shadow-lg border border-neutral",
3532
- n
3533
- ),
3534
- style: b,
3535
- children: typeof a == "function" ? a(m) : a
3536
- }
3537
- )
3538
- ] });
3539
- }, zt = {
3548
+ }, Dt = {
3540
3549
  default: "bg-neutral-container text-default",
3541
3550
  primary: "bg-accent-container text-accent",
3542
3551
  secondary: "bg-neutral-container text-muted",
@@ -3544,11 +3553,11 @@ const cr = ({
3544
3553
  warning: "bg-notice-container text-on-notice",
3545
3554
  error: "bg-error-container text-error",
3546
3555
  info: "bg-beta-container text-link"
3547
- }, Dt = {
3556
+ }, It = {
3548
3557
  sm: "px-2 py-0.5 text-xs",
3549
3558
  md: "px-2.5 py-1 text-sm",
3550
3559
  lg: "px-3 py-1.5 text-base"
3551
- }, It = {
3560
+ }, zt = {
3552
3561
  default: "bg-neutral-fill",
3553
3562
  primary: "bg-accent-fill",
3554
3563
  secondary: "bg-neutral-fill",
@@ -3557,7 +3566,7 @@ const cr = ({
3557
3566
  error: "bg-error-fill",
3558
3567
  info: "bg-beta-fill"
3559
3568
  };
3560
- function dr({
3569
+ function ir({
3561
3570
  variant: t = "default",
3562
3571
  size: a = "md",
3563
3572
  dot: r = !1,
@@ -3565,8 +3574,8 @@ function dr({
3565
3574
  dismissible: s = !1,
3566
3575
  onDismiss: o,
3567
3576
  className: u,
3568
- children: b,
3569
- ...x
3577
+ children: x,
3578
+ ...b
3570
3579
  }) {
3571
3580
  return /* @__PURE__ */ d(
3572
3581
  "span",
@@ -3575,24 +3584,24 @@ function dr({
3575
3584
  // Base styles
3576
3585
  "inline-flex items-center font-medium rounded-full",
3577
3586
  // Variant styles
3578
- zt[t],
3587
+ Dt[t],
3579
3588
  // Size styles
3580
- Dt[a],
3589
+ It[a],
3581
3590
  u
3582
3591
  ),
3583
- ...x,
3592
+ ...b,
3584
3593
  children: [
3585
3594
  r && /* @__PURE__ */ e(
3586
3595
  "span",
3587
3596
  {
3588
3597
  className: p(
3589
3598
  "w-2 h-2 rounded-full mr-1.5",
3590
- It[t]
3599
+ zt[t]
3591
3600
  )
3592
3601
  }
3593
3602
  ),
3594
- n && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", b && "mr-1"), children: n }),
3595
- b,
3603
+ n && /* @__PURE__ */ e("span", { className: p("flex-shrink-0", x && "mr-1"), children: n }),
3604
+ x,
3596
3605
  s && o && /* @__PURE__ */ e(
3597
3606
  "button",
3598
3607
  {
@@ -3631,7 +3640,7 @@ const At = {
3631
3640
  lg: "text-base",
3632
3641
  xl: "text-lg"
3633
3642
  };
3634
- function ur({
3643
+ function dr({
3635
3644
  size: t = "md",
3636
3645
  variant: a = "primary",
3637
3646
  label: r = "Loading...",
@@ -3711,7 +3720,7 @@ function Bt(t) {
3711
3720
  return a.length >= 2 ? (a[0][0] + a[1][0]).toUpperCase() : a.length === 1 ? a[0].slice(0, 2).toUpperCase() : "?";
3712
3721
  }
3713
3722
  const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3714
- const [o, u] = se.useState(!1), b = p(
3723
+ const [o, u] = se.useState(!1), x = p(
3715
3724
  "inline-flex items-center justify-center rounded-full overflow-hidden shrink-0 font-semibold select-none bg-neutral-border-emphasis text-default",
3716
3725
  Pt[r],
3717
3726
  n
@@ -3722,15 +3731,15 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3722
3731
  src: a,
3723
3732
  alt: t ?? "",
3724
3733
  title: s ?? t,
3725
- className: p(b, "object-cover"),
3734
+ className: p(x, "object-cover"),
3726
3735
  onError: () => u(!0)
3727
3736
  }
3728
- ) : /* @__PURE__ */ e("span", { className: b, title: s ?? t, "aria-label": t, children: Bt(t) });
3729
- }, Me = "shadow-[0_0_0_2px_var(--base-module)]", Wt = "shadow-[0_0_0_2px_var(--base-module),0_0_0_3.5px_var(--accent-border)]", mr = ({ people: t, max: a = 4, size: r = "sm", className: n }) => {
3737
+ ) : /* @__PURE__ */ e("span", { className: x, title: s ?? t, "aria-label": t, children: Bt(t) });
3738
+ }, Me = "shadow-[0_0_0_2px_var(--base-module)]", Wt = "shadow-[0_0_0_2px_var(--base-module),0_0_0_3.5px_var(--accent-border)]", ur = ({ people: t, max: a = 4, size: r = "sm", className: n }) => {
3730
3739
  if (t.length === 0) return null;
3731
3740
  const s = t.slice(0, a), o = t.length - s.length;
3732
3741
  return /* @__PURE__ */ d("span", { className: p("inline-flex items-center", n), children: [
3733
- s.map((u, b) => /* @__PURE__ */ e(
3742
+ s.map((u, x) => /* @__PURE__ */ e(
3734
3743
  Ot,
3735
3744
  {
3736
3745
  name: u.name,
@@ -3738,12 +3747,12 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3738
3747
  size: r,
3739
3748
  title: u.name ? u.seen === !1 ? `${u.name} — nog niet gelezen` : u.name : void 0,
3740
3749
  className: p(
3741
- b > 0 && "-ml-2",
3750
+ x > 0 && "-ml-2",
3742
3751
  u.owner ? Wt : Me,
3743
3752
  u.seen === !1 && "opacity-40"
3744
3753
  )
3745
3754
  },
3746
- u.id ?? `${u.name}-${b}`
3755
+ u.id ?? `${u.name}-${x}`
3747
3756
  )),
3748
3757
  o > 0 && /* @__PURE__ */ d(
3749
3758
  "span",
@@ -3760,7 +3769,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3760
3769
  }
3761
3770
  )
3762
3771
  ] });
3763
- }, fr = ({
3772
+ }, mr = ({
3764
3773
  src: t,
3765
3774
  alt: a,
3766
3775
  size: r = "md",
@@ -3768,19 +3777,19 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3768
3777
  radius: s = "md",
3769
3778
  showLoading: o = !0,
3770
3779
  showError: u = !0,
3771
- fallback: b,
3772
- loadingContent: x,
3780
+ fallback: x,
3781
+ loadingContent: b,
3773
3782
  errorContent: g,
3774
3783
  className: f,
3775
3784
  onLoad: l,
3776
3785
  onError: m,
3777
3786
  ...h
3778
3787
  }) => {
3779
- const [w, k] = P(!0), [v, j] = P(!1), [N, q] = P(t), B = (V) => {
3780
- k(!1), j(!1), l?.(V);
3781
- }, G = (V) => {
3782
- if (k(!1), j(!0), b && N !== b) {
3783
- q(b), j(!1), k(!0);
3788
+ const [k, w] = B(!0), [y, A] = B(!1), [N, q] = B(t), P = (V) => {
3789
+ w(!1), A(!1), l?.(V);
3790
+ }, U = (V) => {
3791
+ if (w(!1), A(!0), x && N !== x) {
3792
+ q(x), A(!1), w(!0);
3784
3793
  return;
3785
3794
  }
3786
3795
  m?.(V);
@@ -3812,16 +3821,16 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3812
3821
  "rounded-full": s === "full"
3813
3822
  },
3814
3823
  f
3815
- ), I = p(
3824
+ ), z = p(
3816
3825
  "w-full h-full object-cover transition-opacity duration-200",
3817
3826
  {
3818
- "opacity-0": w || v,
3819
- "opacity-100": !w && !v
3827
+ "opacity-0": k || y,
3828
+ "opacity-100": !k && !y
3820
3829
  }
3821
3830
  ), H = p(
3822
3831
  "absolute inset-0 flex items-center justify-center",
3823
3832
  "text-neutral-400 dark:text-neutral-500"
3824
- ), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), W = /* @__PURE__ */ d("div", { className: "text-center", children: [
3833
+ ), D = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), W = /* @__PURE__ */ d("div", { className: "text-center", children: [
3825
3834
  /* @__PURE__ */ e(
3826
3835
  "svg",
3827
3836
  {
@@ -3849,15 +3858,15 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3849
3858
  ...h,
3850
3859
  src: N,
3851
3860
  alt: a,
3852
- className: I,
3853
- onLoad: B,
3854
- onError: G
3861
+ className: z,
3862
+ onLoad: P,
3863
+ onError: U
3855
3864
  }
3856
3865
  ),
3857
- w && o && /* @__PURE__ */ e("div", { className: H, children: x || z }),
3858
- v && u && /* @__PURE__ */ e("div", { className: H, children: g || W })
3866
+ k && o && /* @__PURE__ */ e("div", { className: H, children: b || D }),
3867
+ y && u && /* @__PURE__ */ e("div", { className: H, children: g || W })
3859
3868
  ] });
3860
- }, hr = ({
3869
+ }, fr = ({
3861
3870
  title: t,
3862
3871
  subtitle: a,
3863
3872
  actions: r = [],
@@ -3865,22 +3874,22 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3865
3874
  className: s,
3866
3875
  backLabel: o = "Back",
3867
3876
  backClassName: u,
3868
- onBack: b,
3869
- editable: x = !1,
3877
+ onBack: x,
3878
+ editable: b = !1,
3870
3879
  onTitleChange: g
3871
3880
  }) => {
3872
- const [f, l] = P(!1), [m, h] = P(t), w = J(null);
3873
- U(() => {
3881
+ const [f, l] = B(!1), [m, h] = B(t), k = Z(null);
3882
+ G(() => {
3874
3883
  h(t);
3875
- }, [t]), U(() => {
3876
- f && w.current && (w.current.focus(), w.current.select());
3884
+ }, [t]), G(() => {
3885
+ f && k.current && (k.current.focus(), k.current.select());
3877
3886
  }, [f]);
3878
- const k = () => {
3879
- x && l(!0);
3880
- }, v = () => {
3887
+ const w = () => {
3888
+ b && l(!0);
3889
+ }, y = () => {
3881
3890
  l(!1), m.trim() !== "" && m !== t && g ? g(m.trim()) : h(t);
3882
- }, j = (N) => {
3883
- N.key === "Enter" ? w.current?.blur() : N.key === "Escape" && (h(t), l(!1));
3891
+ }, A = (N) => {
3892
+ N.key === "Enter" ? k.current?.blur() : N.key === "Escape" && (h(t), l(!1));
3884
3893
  };
3885
3894
  return /* @__PURE__ */ d(
3886
3895
  "div",
@@ -3892,47 +3901,47 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3892
3901
  children: [
3893
3902
  /* @__PURE__ */ d("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
3894
3903
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2 text-default", children: [
3895
- b && /* @__PURE__ */ e(
3904
+ x && /* @__PURE__ */ e(
3896
3905
  "button",
3897
3906
  {
3898
3907
  type: "button",
3899
- onClick: b,
3908
+ onClick: x,
3900
3909
  className: p(
3901
3910
  "flex items-center text-sm cursor-pointer transition",
3902
3911
  u
3903
3912
  ),
3904
- children: /* @__PURE__ */ e(we, { size: 16, color: "currentColor" })
3913
+ children: /* @__PURE__ */ e(ke, { size: 16, color: "currentColor" })
3905
3914
  }
3906
3915
  ),
3907
3916
  f ? /* @__PURE__ */ e(
3908
3917
  "input",
3909
3918
  {
3910
- ref: w,
3919
+ ref: k,
3911
3920
  type: "text",
3912
3921
  value: m,
3913
3922
  onChange: (N) => h(N.target.value),
3914
- onBlur: v,
3915
- onKeyDown: j,
3923
+ onBlur: y,
3924
+ onKeyDown: A,
3916
3925
  className: "text-1xl font-semibold bg-transparent border-b-1 border-neutral rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 flex-1"
3917
3926
  }
3918
3927
  ) : /* @__PURE__ */ d("div", { className: "group flex items-center gap-1.5 min-w-0", children: [
3919
3928
  /* @__PURE__ */ e(
3920
3929
  "h2",
3921
3930
  {
3922
- onClick: k,
3931
+ onClick: w,
3923
3932
  className: p(
3924
3933
  "text-2xl font-semibold truncate",
3925
- x && "cursor-pointer"
3934
+ b && "cursor-pointer"
3926
3935
  ),
3927
- title: x ? "Klik om te bewerken" : void 0,
3936
+ title: b ? "Klik om te bewerken" : void 0,
3928
3937
  children: t
3929
3938
  }
3930
3939
  ),
3931
- x && /* @__PURE__ */ e(
3940
+ b && /* @__PURE__ */ e(
3932
3941
  He,
3933
3942
  {
3934
3943
  size: 15,
3935
- onClick: k,
3944
+ onClick: w,
3936
3945
  className: "shrink-0 cursor-pointer text-muted opacity-0 group-hover:opacity-100 transition-opacity"
3937
3946
  }
3938
3947
  )
@@ -3940,7 +3949,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3940
3949
  ] }) }),
3941
3950
  r.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: r.map(
3942
3951
  (N) => N.splitOptions && N.splitOptions.length > 0 ? /* @__PURE__ */ e(
3943
- ze,
3952
+ De,
3944
3953
  {
3945
3954
  label: N.label,
3946
3955
  onClick: N.onClick,
@@ -3977,7 +3986,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3977
3986
  ]
3978
3987
  }
3979
3988
  );
3980
- }, pr = ({
3989
+ }, hr = ({
3981
3990
  actions: t = [],
3982
3991
  onBack: a,
3983
3992
  backLabel: r = "Back",
@@ -3991,7 +4000,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3991
4000
  onClick: a,
3992
4001
  className: "flex items-center gap-1 text-sm text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 cursor-pointer transition px-2 py-1 rounded",
3993
4002
  children: [
3994
- /* @__PURE__ */ e(we, { size: 16 }),
4003
+ /* @__PURE__ */ e(ke, { size: 16 }),
3995
4004
  /* @__PURE__ */ e("span", { children: r })
3996
4005
  ]
3997
4006
  }
@@ -3999,7 +4008,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
3999
4008
  s && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: s }),
4000
4009
  t.length > 0 && /* @__PURE__ */ e("div", { className: p("flex flex-wrap gap-2", !s && "ml-auto"), children: t.map(
4001
4010
  (o) => o.splitOptions && o.splitOptions.length > 0 ? /* @__PURE__ */ e(
4002
- ze,
4011
+ De,
4003
4012
  {
4004
4013
  label: o.label,
4005
4014
  onClick: o.onClick,
@@ -4038,7 +4047,7 @@ function Ft(t, a) {
4038
4047
  t
4039
4048
  );
4040
4049
  }
4041
- const xr = ({
4050
+ const pr = ({
4042
4051
  groups: t,
4043
4052
  data: a,
4044
4053
  size: r = "md",
@@ -4059,26 +4068,26 @@ const xr = ({
4059
4068
  if (!l) return String(f || "-");
4060
4069
  const m = l.find((h) => h.value === f);
4061
4070
  return m ? m.label : String(f || "-");
4062
- }, b = ae(
4071
+ }, x = ae(
4063
4072
  (f) => {
4064
4073
  const l = Ft(a, f.name);
4065
4074
  if (f.type === "array") {
4066
4075
  const h = l;
4067
4076
  return !h || h.length === 0 ? /* @__PURE__ */ e(
4068
- Z,
4077
+ Y,
4069
4078
  {
4070
4079
  variant: "body",
4071
4080
  size: "sm",
4072
4081
  className: "text-neutral-500 dark:text-neutral-400",
4073
4082
  children: "Geen items"
4074
4083
  }
4075
- ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((w, k) => /* @__PURE__ */ d(
4084
+ ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((k, w) => /* @__PURE__ */ d(
4076
4085
  "div",
4077
4086
  {
4078
4087
  className: "p-4 border border-neutral-200 dark:border-neutral-700 rounded-lg space-y-3",
4079
4088
  children: [
4080
4089
  /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ d(
4081
- Z,
4090
+ Y,
4082
4091
  {
4083
4092
  variant: "label",
4084
4093
  size: "sm",
@@ -4087,55 +4096,55 @@ const xr = ({
4087
4096
  children: [
4088
4097
  f.label,
4089
4098
  " ",
4090
- k + 1
4099
+ w + 1
4091
4100
  ]
4092
4101
  }
4093
4102
  ) }),
4094
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: f.arrayFields?.map((v) => {
4095
- const j = w?.[v.name];
4103
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: f.arrayFields?.map((y) => {
4104
+ const A = k?.[y.name];
4096
4105
  let N = "-";
4097
- switch (v.type) {
4106
+ switch (y.type) {
4098
4107
  case "text":
4099
4108
  case "email":
4100
4109
  case "number":
4101
4110
  case "tel":
4102
4111
  case "url":
4103
4112
  case "textarea":
4104
- N = j || "-";
4113
+ N = A || "-";
4105
4114
  break;
4106
4115
  case "select":
4107
4116
  case "radio":
4108
4117
  N = u(
4109
- j,
4110
- v.options
4118
+ A,
4119
+ y.options
4111
4120
  );
4112
4121
  break;
4113
4122
  case "checkbox":
4114
- N = o(j);
4123
+ N = o(A);
4115
4124
  break;
4116
4125
  case "date":
4117
- N = s(j);
4126
+ N = s(A);
4118
4127
  break;
4119
4128
  case "custom":
4120
- N = v.customComponent?.({
4121
- value: j
4129
+ N = y.customComponent?.({
4130
+ value: A
4122
4131
  });
4123
4132
  break;
4124
4133
  default:
4125
- N = String(j || "-");
4134
+ N = String(A || "-");
4126
4135
  }
4127
- return v.format && (N = v.format(j, w)), /* @__PURE__ */ d("div", { className: "space-y-1", children: [
4136
+ return y.format && (N = y.format(A, k)), /* @__PURE__ */ d("div", { className: "space-y-1", children: [
4128
4137
  /* @__PURE__ */ e(
4129
- Z,
4138
+ Y,
4130
4139
  {
4131
4140
  variant: "label",
4132
4141
  size: "xs",
4133
4142
  className: "text-neutral-600 dark:text-neutral-400",
4134
- children: v.label
4143
+ children: y.label
4135
4144
  }
4136
4145
  ),
4137
4146
  /* @__PURE__ */ e(
4138
- Z,
4147
+ Y,
4139
4148
  {
4140
4149
  variant: "body",
4141
4150
  size: "sm",
@@ -4143,11 +4152,11 @@ const xr = ({
4143
4152
  children: N
4144
4153
  }
4145
4154
  )
4146
- ] }, v.name);
4155
+ ] }, y.name);
4147
4156
  }) })
4148
4157
  ]
4149
4158
  },
4150
- k
4159
+ w
4151
4160
  )) });
4152
4161
  }
4153
4162
  if (f.type === "custom" && f.customComponent)
@@ -4155,7 +4164,7 @@ const xr = ({
4155
4164
  if (f.format) {
4156
4165
  const h = f.format(l, a);
4157
4166
  return /* @__PURE__ */ e(
4158
- Z,
4167
+ Y,
4159
4168
  {
4160
4169
  variant: "body",
4161
4170
  size: "sm",
@@ -4191,7 +4200,7 @@ const xr = ({
4191
4200
  m = l ? String(l) : "-";
4192
4201
  }
4193
4202
  return /* @__PURE__ */ e(
4194
- Z,
4203
+ Y,
4195
4204
  {
4196
4205
  variant: "body",
4197
4206
  size: "sm",
@@ -4201,7 +4210,7 @@ const xr = ({
4201
4210
  );
4202
4211
  },
4203
4212
  [a]
4204
- ), x = ae(
4213
+ ), b = ae(
4205
4214
  (f) => {
4206
4215
  if (f.conditional && !f.conditional(a))
4207
4216
  return null;
@@ -4228,7 +4237,7 @@ const xr = ({
4228
4237
  children: [
4229
4238
  /* @__PURE__ */ d("div", { className: "md:col-span-1", children: [
4230
4239
  /* @__PURE__ */ e(
4231
- Z,
4240
+ Y,
4232
4241
  {
4233
4242
  variant: "label",
4234
4243
  size: "lg",
@@ -4238,7 +4247,7 @@ const xr = ({
4238
4247
  }
4239
4248
  ),
4240
4249
  f.description && /* @__PURE__ */ e(
4241
- Z,
4250
+ Y,
4242
4251
  {
4243
4252
  variant: "body",
4244
4253
  size: "sm",
@@ -4257,7 +4266,7 @@ const xr = ({
4257
4266
  ),
4258
4267
  children: [
4259
4268
  h.type !== "custom" && /* @__PURE__ */ e(
4260
- Z,
4269
+ Y,
4261
4270
  {
4262
4271
  variant: "label",
4263
4272
  size: "sm",
@@ -4265,7 +4274,7 @@ const xr = ({
4265
4274
  children: h.label
4266
4275
  }
4267
4276
  ),
4268
- b(h)
4277
+ x(h)
4269
4278
  ]
4270
4279
  },
4271
4280
  h.name
@@ -4275,7 +4284,7 @@ const xr = ({
4275
4284
  f.id
4276
4285
  );
4277
4286
  },
4278
- [a, b]
4287
+ [a, x]
4279
4288
  ), g = p(
4280
4289
  "space-y-6",
4281
4290
  {
@@ -4286,9 +4295,9 @@ const xr = ({
4286
4295
  },
4287
4296
  n
4288
4297
  );
4289
- return /* @__PURE__ */ e("div", { className: g, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(x) }) });
4290
- }, Ie = ({ item: t, isSelectedHandler: a, onClick: r, depth: n = 0 }) => {
4291
- const [s, o] = P(t.defaultCollapsed ?? !1), u = t.children && t.children.length > 0, b = u && n === 0, x = () => {
4298
+ return /* @__PURE__ */ e("div", { className: g, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(b) }) });
4299
+ }, ze = ({ item: t, isSelectedHandler: a, onClick: r, depth: n = 0 }) => {
4300
+ const [s, o] = B(t.defaultCollapsed ?? !1), u = t.children && t.children.length > 0, x = u && n === 0, b = () => {
4292
4301
  u && o(!s);
4293
4302
  }, g = a ? a(t.path) : !1;
4294
4303
  return /* @__PURE__ */ d("li", { children: [
@@ -4300,22 +4309,22 @@ const xr = ({
4300
4309
  {
4301
4310
  "active-nav-item": g && !u,
4302
4311
  "shadow-lvl-0": g && !u,
4303
- "font-semibold": g || b
4312
+ "font-semibold": g || x
4304
4313
  }
4305
4314
  ),
4306
4315
  onClick: () => {
4307
- u ? x() : t.path && r?.(t.path);
4316
+ u ? b() : t.path && r?.(t.path);
4308
4317
  },
4309
4318
  children: [
4310
4319
  t.icon && /* @__PURE__ */ e("span", { className: "mr-2 shrink-0", children: t.icon }),
4311
4320
  /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 truncate", children: t.label }),
4312
4321
  t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: "ml-2 mr-1.5", children: t.count }),
4313
- u && /* @__PURE__ */ e("span", { className: `${s ? "collapsed" : ""}`, children: /* @__PURE__ */ e(qe, { className: "w-4 h-4 text-muted" }) })
4322
+ u && /* @__PURE__ */ e("span", { className: `${s ? "collapsed" : ""}`, children: /* @__PURE__ */ e($e, { className: "w-4 h-4 text-muted" }) })
4314
4323
  ]
4315
4324
  }
4316
4325
  ),
4317
4326
  u && !s && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: t.children?.map((f, l) => /* @__PURE__ */ e(
4318
- Ie,
4327
+ ze,
4319
4328
  {
4320
4329
  item: f,
4321
4330
  isSelectedHandler: a,
@@ -4325,7 +4334,7 @@ const xr = ({
4325
4334
  l
4326
4335
  )) })
4327
4336
  ] });
4328
- }, br = ({
4337
+ }, xr = ({
4329
4338
  title: t,
4330
4339
  actionIcons: a,
4331
4340
  items: r,
@@ -4335,21 +4344,21 @@ const xr = ({
4335
4344
  }) => /* @__PURE__ */ d("div", { className: "flex flex-col h-screen mb-6", children: [
4336
4345
  /* @__PURE__ */ d("div", { className: "sidebar-menu-header", children: [
4337
4346
  /* @__PURE__ */ e("span", { className: "text-xl font-semibold text-default mb-2", children: t }),
4338
- /* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: a?.map((u, b) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: u }, b)) })
4347
+ /* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: a?.map((u, x) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: u }, x)) })
4339
4348
  ] }),
4340
4349
  o && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: o }),
4341
4350
  /* @__PURE__ */ e("ul", { children: r.map(
4342
- (u, b) => !u.path && !u.label && !u.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, b) : /* @__PURE__ */ e(
4343
- Ie,
4351
+ (u, x) => !u.path && !u.label && !u.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, x) : /* @__PURE__ */ e(
4352
+ ze,
4344
4353
  {
4345
4354
  item: u,
4346
4355
  isSelectedHandler: n,
4347
4356
  onClick: s
4348
4357
  },
4349
- b
4358
+ x
4350
4359
  )
4351
4360
  ) })
4352
- ] }), gr = ({
4361
+ ] }), br = ({
4353
4362
  level: t = 1,
4354
4363
  size: a,
4355
4364
  weight: r = "bold",
@@ -4357,8 +4366,8 @@ const xr = ({
4357
4366
  align: s = "left",
4358
4367
  truncate: o = !1,
4359
4368
  className: u,
4360
- children: b,
4361
- ...x
4369
+ children: x,
4370
+ ...b
4362
4371
  }) => {
4363
4372
  const g = a || Vt(t), f = p(
4364
4373
  "font-primary",
@@ -4405,7 +4414,7 @@ const xr = ({
4405
4414
  },
4406
4415
  u
4407
4416
  ), l = `h${t}`;
4408
- return /* @__PURE__ */ e(l, { className: f, ...x, children: b });
4417
+ return /* @__PURE__ */ e(l, { className: f, ...b, children: x });
4409
4418
  };
4410
4419
  function Vt(t) {
4411
4420
  return {
@@ -4417,7 +4426,7 @@ function Vt(t) {
4417
4426
  6: "md"
4418
4427
  }[t] || "md";
4419
4428
  }
4420
- const yr = ({
4429
+ const gr = ({
4421
4430
  items: t,
4422
4431
  type: a = "unordered",
4423
4432
  variant: r = "default",
@@ -4426,7 +4435,7 @@ const yr = ({
4426
4435
  className: o,
4427
4436
  itemClassName: u
4428
4437
  }) => {
4429
- const b = p(
4438
+ const x = p(
4430
4439
  // Base styles
4431
4440
  "space-y-1",
4432
4441
  // Variant styles
@@ -4447,7 +4456,7 @@ const yr = ({
4447
4456
  "text-lg": n === "lg"
4448
4457
  },
4449
4458
  o
4450
- ), x = (l, m) => p(
4459
+ ), b = (l, m) => p(
4451
4460
  // Base item styles
4452
4461
  "transition-colors duration-200",
4453
4462
  // Size-based padding
@@ -4471,10 +4480,10 @@ const yr = ({
4471
4480
  }, f = (l, m) => {
4472
4481
  s && !m.disabled && (l.key === "Enter" || l.key === " ") && (l.preventDefault(), m.onClick?.());
4473
4482
  };
4474
- return a === "ordered" ? /* @__PURE__ */ e("ol", { className: b, children: t.map((l, m) => /* @__PURE__ */ e(
4483
+ return a === "ordered" ? /* @__PURE__ */ e("ol", { className: x, children: t.map((l, m) => /* @__PURE__ */ e(
4475
4484
  "li",
4476
4485
  {
4477
- className: x(l),
4486
+ className: b(l),
4478
4487
  onClick: () => g(l),
4479
4488
  onKeyDown: (h) => f(h, l),
4480
4489
  tabIndex: s && !l.disabled ? 0 : void 0,
@@ -4482,10 +4491,10 @@ const yr = ({
4482
4491
  children: l.content
4483
4492
  },
4484
4493
  l.id || m
4485
- )) }) : a === "description" ? /* @__PURE__ */ e("dl", { className: b, children: t.map((l, m) => /* @__PURE__ */ e(
4494
+ )) }) : a === "description" ? /* @__PURE__ */ e("dl", { className: x, children: t.map((l, m) => /* @__PURE__ */ e(
4486
4495
  "div",
4487
4496
  {
4488
- className: x(l),
4497
+ className: b(l),
4489
4498
  onClick: () => g(l),
4490
4499
  onKeyDown: (h) => f(h, l),
4491
4500
  tabIndex: s && !l.disabled ? 0 : void 0,
@@ -4493,10 +4502,10 @@ const yr = ({
4493
4502
  children: l.content
4494
4503
  },
4495
4504
  l.id || m
4496
- )) }) : /* @__PURE__ */ e("ul", { className: b, children: t.map((l, m) => /* @__PURE__ */ e(
4505
+ )) }) : /* @__PURE__ */ e("ul", { className: x, children: t.map((l, m) => /* @__PURE__ */ e(
4497
4506
  "li",
4498
4507
  {
4499
- className: x(l),
4508
+ className: b(l),
4500
4509
  onClick: () => g(l),
4501
4510
  onKeyDown: (h) => f(h, l),
4502
4511
  tabIndex: s && !l.disabled ? 0 : void 0,
@@ -4513,37 +4522,37 @@ const yr = ({
4513
4522
  initialCommandPath: s,
4514
4523
  initialActiveIndex: o
4515
4524
  }) => {
4516
- const [u, b] = P(""), [x, g] = P(s || []), [f, l] = P(o || 0), m = J(null), h = J(null), k = (x.length ? t.find((v) => v.id === x[0])?.subCommands || [] : t).filter(
4517
- (v) => v.label.toLowerCase().includes(u.toLowerCase())
4525
+ const [u, x] = B(""), [b, g] = B(s || []), [f, l] = B(o || 0), m = Z(null), h = Z(null), w = (b.length ? t.find((y) => y.id === b[0])?.subCommands || [] : t).filter(
4526
+ (y) => y.label.toLowerCase().includes(u.toLowerCase())
4518
4527
  );
4519
- return U(() => {
4520
- a || (b(""), g(s || []), l(o || 0));
4521
- }, [a]), U(() => {
4522
- const v = (j) => {
4528
+ return G(() => {
4529
+ a || (x(""), g(s || []), l(o || 0));
4530
+ }, [a]), G(() => {
4531
+ const y = (A) => {
4523
4532
  if (a) {
4524
- if (j.key === "Escape")
4533
+ if (A.key === "Escape")
4525
4534
  r();
4526
- else if (j.key === "ArrowUp")
4535
+ else if (A.key === "ArrowUp")
4527
4536
  l(
4528
- (N) => N > 0 ? N - 1 : k.length - 1
4537
+ (N) => N > 0 ? N - 1 : w.length - 1
4529
4538
  );
4530
- else if (j.key === "ArrowDown")
4539
+ else if (A.key === "ArrowDown")
4531
4540
  l(
4532
- (N) => N < k.length - 1 ? N + 1 : 0
4541
+ (N) => N < w.length - 1 ? N + 1 : 0
4533
4542
  );
4534
- else if (j.key === "Enter") {
4535
- const N = k[f];
4536
- N && (N.subCommands ? (g([...x, N.id]), l(0)) : N.action && (N.action(), r()));
4543
+ else if (A.key === "Enter") {
4544
+ const N = w[f];
4545
+ N && (N.subCommands ? (g([...b, N.id]), l(0)) : N.action && (N.action(), r()));
4537
4546
  }
4538
4547
  }
4539
4548
  };
4540
- return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
4541
- }, [a, r, k, f, x]), U(() => {
4542
- const v = (j) => {
4543
- m.current && !m.current.contains(j.target) && r();
4549
+ return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
4550
+ }, [a, r, w, f, b]), G(() => {
4551
+ const y = (A) => {
4552
+ m.current && !m.current.contains(A.target) && r();
4544
4553
  };
4545
- return a && document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
4546
- }, [a, r]), U(() => {
4554
+ return a && document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
4555
+ }, [a, r]), G(() => {
4547
4556
  if (!a) return;
4548
4557
  h.current?.querySelector(`[data-index="${f}"]`)?.scrollIntoView({ block: "nearest" });
4549
4558
  }, [f, a]), a ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center shadow-lvl-0", children: /* @__PURE__ */ d(
@@ -4561,7 +4570,7 @@ const yr = ({
4561
4570
  autoFocus: !0,
4562
4571
  placeholder: n?.searchPlaceholder || "Search commands...",
4563
4572
  value: u,
4564
- onChange: (v) => b(v.target.value),
4573
+ onChange: (y) => x(y.target.value),
4565
4574
  className: "w-full py-2 text-default border-0 focus:outline-none focus:ring-0 focus:border-0 focus:shadow-none bg-transparent"
4566
4575
  }
4567
4576
  )
@@ -4572,23 +4581,23 @@ const yr = ({
4572
4581
  ref: h,
4573
4582
  className: "mt-2 pt-2 text-sm border-t border-neutral max-h-[50vh] overflow-y-auto",
4574
4583
  children: [
4575
- k.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted text-center text-sm", children: n?.noCommandsFound || "No commands found" }),
4576
- k.map((v, j) => /* @__PURE__ */ d(
4584
+ w.length === 0 && /* @__PURE__ */ e("div", { className: "text-muted text-center text-sm", children: n?.noCommandsFound || "No commands found" }),
4585
+ w.map((y, A) => /* @__PURE__ */ d(
4577
4586
  "div",
4578
4587
  {
4579
- "data-index": j,
4580
- className: `flex items-center p-2 cursor-pointer rounded-md text-default ${j === f ? "bg-neutral-container" : ""}`,
4588
+ "data-index": A,
4589
+ className: `flex items-center p-2 cursor-pointer rounded-md text-default ${A === f ? "bg-neutral-container" : ""}`,
4581
4590
  onClick: () => {
4582
- v.subCommands ? (g([...x, v.id]), l(0)) : v.action && (v.action(), r());
4591
+ y.subCommands ? (g([...b, y.id]), l(0)) : y.action && (y.action(), r());
4583
4592
  },
4584
- onMouseEnter: () => l(j),
4593
+ onMouseEnter: () => l(A),
4585
4594
  children: [
4586
- v.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: v.icon }),
4587
- /* @__PURE__ */ e("span", { className: "flex-grow", children: v.label }),
4588
- v.subCommands && /* @__PURE__ */ e("span", { className: "text-muted", children: /* @__PURE__ */ e(Ue, { className: "w-4 h-4" }) })
4595
+ y.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: y.icon }),
4596
+ /* @__PURE__ */ e("span", { className: "flex-grow", children: y.label }),
4597
+ y.subCommands && /* @__PURE__ */ e("span", { className: "text-muted", children: /* @__PURE__ */ e(qe, { className: "w-4 h-4" }) })
4589
4598
  ]
4590
4599
  },
4591
- v.id
4600
+ y.id
4592
4601
  ))
4593
4602
  ]
4594
4603
  }
@@ -4680,8 +4689,8 @@ const yr = ({
4680
4689
  shadow: s,
4681
4690
  border: o,
4682
4691
  borderColor: u,
4683
- className: b,
4684
- children: x,
4692
+ className: x,
4693
+ children: b,
4685
4694
  ...g
4686
4695
  }, f) => /* @__PURE__ */ e(
4687
4696
  "div",
@@ -4695,19 +4704,19 @@ const yr = ({
4695
4704
  s && Gt[s],
4696
4705
  o && Kt[o],
4697
4706
  u && Jt[u],
4698
- b
4707
+ x
4699
4708
  ),
4700
4709
  ...g,
4701
- children: x
4710
+ children: b
4702
4711
  }
4703
4712
  )
4704
4713
  );
4705
4714
  Ae.displayName = "Box";
4706
- const Nr = ({ children: t, title: a, ...r }) => /* @__PURE__ */ d(Ae, { background: "module", radius: "xl", shadow: "sm", ...r, children: [
4715
+ const yr = ({ children: t, title: a, ...r }) => /* @__PURE__ */ d(Ae, { background: "module", radius: "xl", shadow: "sm", ...r, children: [
4707
4716
  a && /* @__PURE__ */ e("span", { className: "text-base font-medium text-default mb-2", children: a }),
4708
4717
  t
4709
4718
  ] });
4710
- function wr({
4719
+ function Nr({
4711
4720
  identifier: t,
4712
4721
  resourceLoader: a,
4713
4722
  framework: r = "react",
@@ -4715,31 +4724,31 @@ function wr({
4715
4724
  componentProps: s,
4716
4725
  className: o
4717
4726
  }) {
4718
- const u = J(null), [b, x] = P(!0), [g, f] = P(null), l = J(null);
4719
- return J(null), U(() => {
4727
+ const u = Z(null), [x, b] = B(!0), [g, f] = B(null), l = Z(null);
4728
+ return Z(null), G(() => {
4720
4729
  let m = !0;
4721
4730
  return (async () => {
4722
- x(!0);
4731
+ b(!0);
4723
4732
  try {
4724
- const w = await a();
4733
+ const k = await a();
4725
4734
  if (!m) return;
4726
- const k = w.component || w.default || w;
4727
- f(r === "react" ? () => k : () => w);
4728
- } catch (w) {
4729
- console.error(`[FederatedResource] Load failed: ${t}`, w);
4735
+ const w = k.component || k.default || k;
4736
+ f(r === "react" ? () => w : () => k);
4737
+ } catch (k) {
4738
+ console.error(`[FederatedResource] Load failed: ${t}`, k);
4730
4739
  } finally {
4731
- m && x(!1);
4740
+ m && b(!1);
4732
4741
  }
4733
4742
  })(), () => {
4734
4743
  m = !1;
4735
4744
  };
4736
- }, [t, a]), U(() => {
4737
- if (b || !g || r === "react") return;
4745
+ }, [t, a]), G(() => {
4746
+ if (x || !g || r === "react") return;
4738
4747
  const m = u.current;
4739
4748
  if (m) {
4740
4749
  if (r === "svelte") {
4741
- const h = g.default || g, w = new h({ target: m, props: s || {} });
4742
- return l.current = w, () => w.$destroy();
4750
+ const h = g.default || g, k = new h({ target: m, props: s || {} });
4751
+ return l.current = k, () => k.$destroy();
4743
4752
  }
4744
4753
  if (g.mount) {
4745
4754
  const h = g.mount({ container: m, props: s || {} });
@@ -4748,14 +4757,14 @@ function wr({
4748
4757
  };
4749
4758
  }
4750
4759
  }
4751
- }, [g, r, b]), U(() => {
4760
+ }, [g, r, x]), G(() => {
4752
4761
  r === "svelte" && l.current && l.current.$set?.(s);
4753
4762
  }, [s, r]), /* @__PURE__ */ d("div", { ref: u, className: o, style: { display: "contents" }, children: [
4754
- b && n,
4763
+ x && n,
4755
4764
  r === "react" && g && /* @__PURE__ */ e(g, { ...s })
4756
4765
  ] });
4757
4766
  }
4758
- class kr extends Ke {
4767
+ class wr extends Ge {
4759
4768
  constructor() {
4760
4769
  super(...arguments), this.state = {
4761
4770
  hasError: !1,
@@ -4785,46 +4794,46 @@ class kr extends Ke {
4785
4794
  }
4786
4795
  export {
4787
4796
  Ot as Avatar,
4788
- mr as AvatarStack,
4789
- dr as Badge,
4797
+ ur as AvatarStack,
4798
+ ir as Badge,
4790
4799
  Ae as Box,
4791
4800
  te as Button,
4792
4801
  lr as ButtonGroup,
4793
- Nr as Card,
4794
- ye as Checkbox,
4802
+ yr as Card,
4803
+ ve as Checkbox,
4795
4804
  vr as CommandPalette,
4796
4805
  mt as ContentLoading,
4797
- ve as DatePicker,
4806
+ ye as DatePicker,
4798
4807
  ft as Dropdown,
4799
- kr as ErrorBoundary,
4800
- wr as FederatedResource,
4808
+ wr as ErrorBoundary,
4809
+ Nr as FederatedResource,
4801
4810
  Mt as FolderSelect,
4802
4811
  cr as Form,
4803
- gr as Heading,
4812
+ br as Heading,
4804
4813
  oe as Icon,
4805
- fr as Image,
4814
+ mr as Image,
4806
4815
  sr as Link,
4807
- yr as List,
4816
+ gr as List,
4808
4817
  rr as MeetingGrid,
4809
4818
  St as Modal,
4810
- hr as PageHeader,
4811
- pr as PageToolbar,
4819
+ fr as PageHeader,
4820
+ hr as PageToolbar,
4812
4821
  nr as ParticipantTile,
4813
- ir as Popover,
4822
+ Ze as Popover,
4814
4823
  ot as SearchableTextField,
4815
4824
  fe as Select,
4816
- br as SidebarMenu,
4817
- ur as Spinner,
4818
- ze as SplitButton,
4825
+ xr as SidebarMenu,
4826
+ dr as Spinner,
4827
+ De as SplitButton,
4819
4828
  Et as StorageInput,
4820
4829
  or as TabBar,
4821
4830
  Le as Table,
4822
4831
  kt as Tabs,
4823
- Z as Text,
4832
+ Y as Text,
4824
4833
  Ne as TextArea,
4825
4834
  ue as TextField,
4826
4835
  ar as VideoSurface,
4827
- xr as View,
4836
+ pr as View,
4828
4837
  p as cn,
4829
4838
  tr as createSizes,
4830
4839
  er as createVariants