@owodesign/owoui 0.1.7-beta2 → 0.1.8

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.min.js CHANGED
@@ -345,50 +345,50 @@ var N = {
345
345
  pulse: A,
346
346
  orbit: j,
347
347
  flow: M
348
- }, ee = new Set([
348
+ }, P = new Set([
349
349
  "ring",
350
350
  "arc",
351
351
  "dots"
352
352
  ]);
353
- function P({ variant: e = "ring", size: t = "md", className: n, label: r }) {
353
+ function F({ variant: e = "ring", size: t = "md", className: n, label: r }) {
354
354
  let i = typeof t == "number" ? t : w[t], a = N[e];
355
355
  return /* @__PURE__ */ p("span", {
356
356
  "aria-hidden": !r,
357
357
  "aria-label": r,
358
358
  role: r ? "img" : void 0,
359
- "data-animate": ee.has(e) ? "spin" : void 0,
359
+ "data-animate": P.has(e) ? "spin" : void 0,
360
360
  className: _("owo-spinner", C.root, n),
361
361
  children: /* @__PURE__ */ p(a, { px: i })
362
362
  });
363
363
  }
364
- var F = {
364
+ var I = {
365
365
  root: "_root_yhdgl_1",
366
366
  icon: "_icon_yhdgl_83",
367
367
  label: "_label_yhdgl_95"
368
368
  };
369
369
  //#endregion
370
370
  //#region src/components/Button.tsx
371
- function I({ className: e }) {
372
- return _("owo-button", F.root, e);
371
+ function L({ className: e }) {
372
+ return _("owo-button", I.root, e);
373
373
  }
374
- function L(e) {
374
+ function R(e) {
375
375
  let { variant: t = "secondary", size: n = "md", loading: r = !1, leadingIcon: i, trailingIcon: a, className: o, children: s, ...c } = e, l = /* @__PURE__ */ m(f, { children: [
376
376
  r ? /* @__PURE__ */ p("span", {
377
- className: F.icon,
378
- children: /* @__PURE__ */ p(P, { size: n === "xs" ? "xs" : n === "sm" ? "sm" : n === "xl" ? "lg" : "md" })
377
+ className: I.icon,
378
+ children: /* @__PURE__ */ p(F, { size: n === "xs" ? "xs" : n === "sm" ? "sm" : n === "xl" ? "lg" : "md" })
379
379
  }) : i ? /* @__PURE__ */ p("span", {
380
- className: F.icon,
380
+ className: I.icon,
381
381
  children: i
382
382
  }) : null,
383
383
  /* @__PURE__ */ p("span", {
384
- className: F.label,
384
+ className: I.label,
385
385
  children: s
386
386
  }),
387
387
  !r && a ? /* @__PURE__ */ p("span", {
388
- className: F.icon,
388
+ className: I.icon,
389
389
  children: a
390
390
  }) : null
391
- ] }), u = I({
391
+ ] }), u = L({
392
392
  variant: t,
393
393
  size: n,
394
394
  loading: r,
@@ -421,28 +421,149 @@ function L(e) {
421
421
  children: l
422
422
  });
423
423
  }
424
- var R = {
424
+ //#endregion
425
+ //#region src/contexts/FieldContext.ts
426
+ var z = n(void 0);
427
+ function ee() {
428
+ return a(z);
429
+ }
430
+ //#endregion
431
+ //#region src/hooks/useAccessibilityGuard.ts
432
+ function B({ componentName: e, ariaLabel: t, labelledBy: n, hasVisibleLabel: r = !1, disabled: i = !1 }) {
433
+ o(() => {
434
+ process.env.NODE_ENV !== "production" && (i || t || n || r || console.warn(`${e} requires an accessible name when used outside Field. Provide ariaLabel or wrap it in Field.`));
435
+ }, [
436
+ t,
437
+ e,
438
+ i,
439
+ r,
440
+ n
441
+ ]);
442
+ }
443
+ //#endregion
444
+ //#region src/hooks/useFieldProps.ts
445
+ function V(e) {
446
+ let t = ee();
447
+ return {
448
+ id: e.id ?? t?.controlId,
449
+ disabled: e.disabled ?? t?.disabled ?? !1,
450
+ required: e.required ?? t?.required ?? !1,
451
+ invalid: e.invalid ?? t?.invalid ?? !1,
452
+ "aria-describedby": e["aria-describedby"] ?? t?.describedBy
453
+ };
454
+ }
455
+ //#endregion
456
+ //#region src/hooks/useControllableState.ts
457
+ function H({ value: e, defaultValue: t, onChange: n, fallback: r, isControlled: i }) {
458
+ let [a, o] = d(t ?? r), s = i ?? e !== void 0, c = s ? e : a;
459
+ function l(e) {
460
+ s || o(e), n?.(e);
461
+ }
462
+ return [c, l];
463
+ }
464
+ var U = {
465
+ root: "_root_ypadq_1",
466
+ input: "_input_ypadq_15",
467
+ control: "_control_ypadq_28",
468
+ icon: "_icon_ypadq_91",
469
+ label: "_label_ypadq_108"
470
+ };
471
+ //#endregion
472
+ //#region src/components/Checkbox.tsx
473
+ function te({ checked: e, defaultChecked: t, onCheckedChange: n, indeterminate: r = !1, disabled: i, required: a, invalid: s, name: c, value: l = "on", id: d, size: f = "md", className: h, ariaLabel: g, children: v, "aria-describedby": y }) {
474
+ let b = ee(), [x, S] = H({
475
+ value: e,
476
+ defaultValue: t,
477
+ onChange: n,
478
+ fallback: !1
479
+ }), C = V({
480
+ id: d,
481
+ disabled: i,
482
+ required: a,
483
+ invalid: s,
484
+ "aria-describedby": y
485
+ });
486
+ B({
487
+ componentName: "Checkbox",
488
+ ariaLabel: g,
489
+ labelledBy: b?.labelId,
490
+ hasVisibleLabel: v != null,
491
+ disabled: C.disabled
492
+ });
493
+ let w = u(null);
494
+ o(() => {
495
+ w.current && (w.current.indeterminate = r);
496
+ }, [r]);
497
+ let T = r ? "indeterminate" : x ? "checked" : "unchecked", E = T === "indeterminate" ? "M4 8h8" : "M3.5 8.5l3 3 6-7";
498
+ return /* @__PURE__ */ m("label", {
499
+ "data-scope": "checkbox",
500
+ "data-state": T,
501
+ "data-disabled": C.disabled || void 0,
502
+ "data-invalid": C.invalid || void 0,
503
+ className: _("owo-checkbox", U.root, h),
504
+ children: [
505
+ /* @__PURE__ */ p("input", {
506
+ ref: w,
507
+ id: C.id,
508
+ type: "checkbox",
509
+ name: c,
510
+ value: l,
511
+ checked: x,
512
+ disabled: C.disabled,
513
+ required: C.required,
514
+ "aria-label": g,
515
+ "aria-describedby": C["aria-describedby"],
516
+ "aria-invalid": C.invalid || void 0,
517
+ "aria-checked": r ? "mixed" : x,
518
+ className: U.input,
519
+ onChange: (e) => {
520
+ C.disabled || S(e.target.checked);
521
+ }
522
+ }),
523
+ /* @__PURE__ */ p("span", {
524
+ "data-scope": "checkbox",
525
+ "data-part": "control",
526
+ "data-state": T,
527
+ "data-size": f,
528
+ className: U.control,
529
+ children: /* @__PURE__ */ p("svg", {
530
+ "aria-hidden": "true",
531
+ viewBox: "0 0 16 16",
532
+ className: U.icon,
533
+ children: /* @__PURE__ */ p("path", { d: E })
534
+ })
535
+ }),
536
+ v != null && /* @__PURE__ */ p("span", {
537
+ "data-scope": "checkbox",
538
+ "data-part": "label",
539
+ className: U.label,
540
+ children: v
541
+ })
542
+ ]
543
+ });
544
+ }
545
+ var W = {
425
546
  root: "_root_bx150_1",
426
547
  triggerInner: "_triggerInner_bx150_27",
427
548
  triggerIcon: "_triggerIcon_bx150_34",
428
549
  triggerIndicator: "_triggerIndicator_bx150_35",
429
550
  triggerLabel: "_triggerLabel_bx150_44",
430
551
  contentInner: "_contentInner_bx150_50"
431
- }, te = n(null);
432
- function ne(e) {
433
- let t = a(te);
552
+ }, G = n(null);
553
+ function K(e) {
554
+ let t = a(G);
434
555
  if (!t) throw Error(`${e} must be used within Collapsible.Root`);
435
556
  return t;
436
557
  }
437
- function z({ open: e, defaultOpen: t, onOpenChange: n }) {
558
+ function ne({ open: e, defaultOpen: t, onOpenChange: n }) {
438
559
  let [r, i] = d(t ?? !1), a = e !== void 0, o = a ? e : r;
439
560
  function s(e) {
440
561
  a || i(e), n?.(e);
441
562
  }
442
563
  return [o, s];
443
564
  }
444
- function B({ children: e, open: t, defaultOpen: n, onOpenChange: r, classNames: i, className: a, ...o }) {
445
- let [c, u] = z({
565
+ function q({ children: e, open: t, defaultOpen: n, onOpenChange: r, classNames: i, className: a, ...o }) {
566
+ let [c, u] = ne({
446
567
  open: t,
447
568
  defaultOpen: n,
448
569
  onOpenChange: r
@@ -457,43 +578,43 @@ function B({ children: e, open: t, defaultOpen: n, onOpenChange: r, classNames:
457
578
  u,
458
579
  i
459
580
  ]);
460
- return /* @__PURE__ */ p(te.Provider, {
581
+ return /* @__PURE__ */ p(G.Provider, {
461
582
  value: f,
462
583
  children: /* @__PURE__ */ p("div", {
463
584
  "data-state": c ? "open" : "closed",
464
585
  "data-scope": "collapsible",
465
- className: _("owo-collapsible", R.root, a),
586
+ className: _("owo-collapsible", W.root, a),
466
587
  ...o,
467
588
  children: e
468
589
  })
469
590
  });
470
591
  }
471
- function re({ children: e, icon: t, indicator: n, iconPosition: r = "start", className: i, onClick: a, ...o }) {
472
- let { open: s, setOpen: c, contentId: l, classNames: u } = ne("Collapsible.Trigger"), d = t !== void 0 || n !== void 0 ? /* @__PURE__ */ m("span", {
592
+ function J({ children: e, icon: t, indicator: n, iconPosition: r = "start", className: i, onClick: a, ...o }) {
593
+ let { open: s, setOpen: c, contentId: l, classNames: u } = K("Collapsible.Trigger"), d = t !== void 0 || n !== void 0 ? /* @__PURE__ */ m("span", {
473
594
  "data-part": "triggerInner",
474
- className: _(R.triggerInner, u?.triggerInner),
595
+ className: _(W.triggerInner, u?.triggerInner),
475
596
  children: [
476
597
  t && r === "start" ? /* @__PURE__ */ p("span", {
477
598
  "data-part": "triggerIcon",
478
599
  "aria-hidden": "true",
479
- className: _(R.triggerIcon, u?.triggerIcon),
600
+ className: _(W.triggerIcon, u?.triggerIcon),
480
601
  children: t
481
602
  }) : null,
482
603
  /* @__PURE__ */ p("span", {
483
604
  "data-part": "triggerLabel",
484
- className: _(R.triggerLabel, u?.triggerLabel),
605
+ className: _(W.triggerLabel, u?.triggerLabel),
485
606
  children: e
486
607
  }),
487
608
  t && r === "end" ? /* @__PURE__ */ p("span", {
488
609
  "data-part": "triggerIcon",
489
610
  "aria-hidden": "true",
490
- className: _(R.triggerIcon, u?.triggerIcon),
611
+ className: _(W.triggerIcon, u?.triggerIcon),
491
612
  children: t
492
613
  }) : null,
493
614
  n ? /* @__PURE__ */ p("span", {
494
615
  "data-part": "triggerIndicator",
495
616
  "aria-hidden": "true",
496
- className: _(R.triggerIndicator, u?.triggerIndicator),
617
+ className: _(W.triggerIndicator, u?.triggerIndicator),
497
618
  children: n
498
619
  }) : null
499
620
  ]
@@ -513,8 +634,8 @@ function re({ children: e, icon: t, indicator: n, iconPosition: r = "start", cla
513
634
  children: d
514
635
  });
515
636
  }
516
- function V({ children: e, className: t, ...n }) {
517
- let { open: r, contentId: i, classNames: a } = ne("Collapsible.Content"), [s, c] = d(r), l = u(null), f = u(null);
637
+ function Y({ children: e, className: t, ...n }) {
638
+ let { open: r, contentId: i, classNames: a } = K("Collapsible.Content"), [s, c] = d(r), l = u(null), f = u(null);
518
639
  return o(() => {
519
640
  let e = l.current, t = f.current;
520
641
  if (!e || !t) return;
@@ -551,21 +672,21 @@ function V({ children: e, className: t, ...n }) {
551
672
  children: /* @__PURE__ */ p("div", {
552
673
  ref: f,
553
674
  "data-part": "contentInner",
554
- className: _(R.contentInner, a?.contentInner),
675
+ className: _(W.contentInner, a?.contentInner),
555
676
  children: e
556
677
  })
557
678
  });
558
679
  }
559
- var ie = Object.assign(B, {
560
- Root: B,
561
- Trigger: re,
562
- Content: V
563
- }), H = "_overlay_1p0ee_1", ae = "_panel_1p0ee_19", oe = "_confirmDescription_1p0ee_64", U = {
564
- overlay: H,
680
+ var X = Object.assign(q, {
681
+ Root: q,
682
+ Trigger: J,
683
+ Content: Y
684
+ }), re = "_overlay_1p0ee_1", ie = "_panel_1p0ee_19", ae = "_confirmDescription_1p0ee_64", oe = {
685
+ overlay: re,
565
686
  "dialog-backdrop-in": "_dialog-backdrop-in_1p0ee_1",
566
- panel: ae,
687
+ panel: ie,
567
688
  "dialog-in": "_dialog-in_1p0ee_1",
568
- confirmDescription: oe
689
+ confirmDescription: ae
569
690
  }, se = n(void 0);
570
691
  function ce({ className: e, children: t, ...n }) {
571
692
  let r = a(se);
@@ -597,7 +718,7 @@ function ue({ className: e, children: t, ...n }) {
597
718
  children: t
598
719
  });
599
720
  }
600
- function W({ open: e, onClose: t, size: n = "sm", children: r, className: a, overlayClassName: s, panelClassName: c, classNames: l, ...d }) {
721
+ function de({ open: e, onClose: t, size: n = "sm", children: r, className: a, overlayClassName: s, panelClassName: c, classNames: l, ...d }) {
601
722
  let f = u(null), h = u(null), g = i((e) => {
602
723
  e.key === "Escape" && (e.stopPropagation(), t());
603
724
  }, [t]);
@@ -614,7 +735,7 @@ function W({ open: e, onClose: t, size: n = "sm", children: r, className: a, ove
614
735
  "data-state": "open",
615
736
  "data-scope": "dialog",
616
737
  "data-part": "overlay",
617
- className: _("owo-dialog-overlay", U.overlay, l?.overlay),
738
+ className: _("owo-dialog-overlay", oe.overlay, l?.overlay),
618
739
  children: [/* @__PURE__ */ p("button", {
619
740
  type: "button",
620
741
  "aria-label": "Close dialog",
@@ -630,23 +751,23 @@ function W({ open: e, onClose: t, size: n = "sm", children: r, className: a, ove
630
751
  tabIndex: -1,
631
752
  "data-state": "open",
632
753
  "data-size": n,
633
- className: _("owo-dialog", U.panel, c, a),
754
+ className: _("owo-dialog", oe.panel, c, a),
634
755
  ...d,
635
756
  children: r
636
757
  })]
637
758
  })
638
759
  }) : null;
639
760
  }
640
- W.Header = ce, W.Body = le, W.Footer = ue;
761
+ de.Header = ce, de.Body = le, de.Footer = ue;
641
762
  //#endregion
642
763
  //#region src/components/ConfirmDialog.tsx
643
- var de = n(null);
644
- function fe() {
645
- let e = a(de);
764
+ var fe = n(null);
765
+ function pe() {
766
+ let e = a(fe);
646
767
  if (!e) throw Error("useConfirm must be used within <ConfirmProvider>");
647
768
  return e;
648
769
  }
649
- function pe({ children: e }) {
770
+ function me({ children: e }) {
650
771
  let [t, n] = d(null), r = u(null), a = i((e) => (r.current && r.current.resolve(!1), new Promise((t) => {
651
772
  let i = {
652
773
  options: e,
@@ -656,23 +777,23 @@ function pe({ children: e }) {
656
777
  })), []), o = i((e) => {
657
778
  r.current &&= (r.current.resolve(e), null), n(null);
658
779
  }, []);
659
- return /* @__PURE__ */ m(de.Provider, {
780
+ return /* @__PURE__ */ m(fe.Provider, {
660
781
  value: a,
661
- children: [e, /* @__PURE__ */ p(W, {
782
+ children: [e, /* @__PURE__ */ p(de, {
662
783
  open: t !== null,
663
784
  onClose: () => o(!1),
664
785
  children: t && /* @__PURE__ */ m(f, { children: [
665
- /* @__PURE__ */ p(W.Header, { children: t.options.title }),
666
- /* @__PURE__ */ p(W.Body, { children: typeof t.options.description == "string" ? /* @__PURE__ */ p("p", {
667
- className: U.confirmDescription,
786
+ /* @__PURE__ */ p(de.Header, { children: t.options.title }),
787
+ /* @__PURE__ */ p(de.Body, { children: typeof t.options.description == "string" ? /* @__PURE__ */ p("p", {
788
+ className: oe.confirmDescription,
668
789
  children: t.options.description
669
790
  }) : t.options.description }),
670
- /* @__PURE__ */ m(W.Footer, { children: [/* @__PURE__ */ p(L, {
791
+ /* @__PURE__ */ m(de.Footer, { children: [/* @__PURE__ */ p(R, {
671
792
  variant: "ghost",
672
793
  size: "sm",
673
794
  onClick: () => o(!1),
674
795
  children: t.options.cancelLabel ?? "取消"
675
- }), /* @__PURE__ */ p(L, {
796
+ }), /* @__PURE__ */ p(R, {
676
797
  variant: t.options.variant ?? "primary",
677
798
  size: "sm",
678
799
  onClick: () => o(!0),
@@ -684,22 +805,22 @@ function pe({ children: e }) {
684
805
  }
685
806
  //#endregion
686
807
  //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
687
- var me = Math.min, he = Math.max, ge = Math.round, _e = Math.floor, G = (e) => ({
808
+ var he = Math.min, ge = Math.max, _e = Math.round, ve = Math.floor, Z = (e) => ({
688
809
  x: e,
689
810
  y: e
690
- }), ve = {
811
+ }), ye = {
691
812
  left: "right",
692
813
  right: "left",
693
814
  bottom: "top",
694
815
  top: "bottom"
695
816
  };
696
- function ye(e, t, n) {
697
- return he(e, me(t, n));
817
+ function be(e, t, n) {
818
+ return ge(e, he(t, n));
698
819
  }
699
- function be(e, t) {
820
+ function xe(e, t) {
700
821
  return typeof e == "function" ? e(t) : e;
701
822
  }
702
- function xe(e) {
823
+ function Q(e) {
703
824
  return e.split("-")[0];
704
825
  }
705
826
  function Se(e) {
@@ -711,48 +832,48 @@ function Ce(e) {
711
832
  function we(e) {
712
833
  return e === "y" ? "height" : "width";
713
834
  }
714
- function K(e) {
835
+ function Te(e) {
715
836
  let t = e[0];
716
837
  return t === "t" || t === "b" ? "y" : "x";
717
838
  }
718
- function Te(e) {
719
- return Ce(K(e));
839
+ function Ee(e) {
840
+ return Ce(Te(e));
720
841
  }
721
- function Ee(e, t, n) {
842
+ function De(e, t, n) {
722
843
  n === void 0 && (n = !1);
723
- let r = Se(e), i = Te(e), a = we(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
724
- return t.reference[a] > t.floating[a] && (o = Fe(o)), [o, Fe(o)];
844
+ let r = Se(e), i = Ee(e), a = we(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
845
+ return t.reference[a] > t.floating[a] && (o = Ie(o)), [o, Ie(o)];
725
846
  }
726
- function De(e) {
727
- let t = Fe(e);
847
+ function Oe(e) {
848
+ let t = Ie(e);
728
849
  return [
729
- Oe(e),
850
+ ke(e),
730
851
  t,
731
- Oe(t)
852
+ ke(t)
732
853
  ];
733
854
  }
734
- function Oe(e) {
855
+ function ke(e) {
735
856
  return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
736
857
  }
737
- var ke = ["left", "right"], Ae = ["right", "left"], je = ["top", "bottom"], Me = ["bottom", "top"];
738
- function Ne(e, t, n) {
858
+ var Ae = ["left", "right"], je = ["right", "left"], Me = ["top", "bottom"], Ne = ["bottom", "top"];
859
+ function Pe(e, t, n) {
739
860
  switch (e) {
740
861
  case "top":
741
- case "bottom": return n ? t ? Ae : ke : t ? ke : Ae;
862
+ case "bottom": return n ? t ? je : Ae : t ? Ae : je;
742
863
  case "left":
743
- case "right": return t ? je : Me;
864
+ case "right": return t ? Me : Ne;
744
865
  default: return [];
745
866
  }
746
867
  }
747
- function Pe(e, t, n, r) {
748
- let i = Se(e), a = Ne(xe(e), n === "start", r);
749
- return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Oe)))), a;
750
- }
751
- function Fe(e) {
752
- let t = xe(e);
753
- return ve[t] + e.slice(t.length);
868
+ function Fe(e, t, n, r) {
869
+ let i = Se(e), a = Pe(Q(e), n === "start", r);
870
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(ke)))), a;
754
871
  }
755
872
  function Ie(e) {
873
+ let t = Q(e);
874
+ return ye[t] + e.slice(t.length);
875
+ }
876
+ function Le(e) {
756
877
  return {
757
878
  top: 0,
758
879
  right: 0,
@@ -761,15 +882,15 @@ function Ie(e) {
761
882
  ...e
762
883
  };
763
884
  }
764
- function Le(e) {
885
+ function Re(e) {
765
886
  return typeof e == "number" ? {
766
887
  top: e,
767
888
  right: e,
768
889
  bottom: e,
769
890
  left: e
770
- } : Ie(e);
891
+ } : Le(e);
771
892
  }
772
- function Re(e) {
893
+ function ze(e) {
773
894
  let { x: t, y: n, width: r, height: i } = e;
774
895
  return {
775
896
  width: r,
@@ -784,8 +905,8 @@ function Re(e) {
784
905
  }
785
906
  //#endregion
786
907
  //#region node_modules/@floating-ui/core/dist/floating-ui.core.mjs
787
- function ze(e, t, n) {
788
- let { reference: r, floating: i } = e, a = K(t), o = Te(t), s = we(o), c = xe(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
908
+ function Be(e, t, n) {
909
+ let { reference: r, floating: i } = e, a = Te(t), o = Ee(t), s = we(o), c = Q(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
789
910
  switch (c) {
790
911
  case "top":
791
912
  p = {
@@ -826,9 +947,9 @@ function ze(e, t, n) {
826
947
  }
827
948
  return p;
828
949
  }
829
- async function Be(e, t) {
950
+ async function Ve(e, t) {
830
951
  t === void 0 && (t = {});
831
- let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = be(t, e), p = Le(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = Re(await i.getClippingRect({
952
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = xe(t, e), p = Re(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = ze(await i.getClippingRect({
832
953
  element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
833
954
  boundary: c,
834
955
  rootBoundary: l,
@@ -841,7 +962,7 @@ async function Be(e, t) {
841
962
  } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
842
963
  x: 1,
843
964
  y: 1
844
- }, y = Re(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
965
+ }, y = ze(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
845
966
  elements: o,
846
967
  rect: g,
847
968
  offsetParent: _,
@@ -854,15 +975,15 @@ async function Be(e, t) {
854
975
  right: (y.right - h.right + p.right) / v.x
855
976
  };
856
977
  }
857
- var Ve = 50, He = async (e, t, n) => {
978
+ var He = 50, Ue = async (e, t, n) => {
858
979
  let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
859
980
  ...o,
860
- detectOverflow: Be
981
+ detectOverflow: Ve
861
982
  }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
862
983
  reference: e,
863
984
  floating: t,
864
985
  strategy: i
865
- }), { x: u, y: d } = ze(l, r, c), f = r, p = 0, m = {};
986
+ }), { x: u, y: d } = Be(l, r, c), f = r, p = 0, m = {};
866
987
  for (let n = 0; n < a.length; n++) {
867
988
  let h = a[n];
868
989
  if (!h) continue;
@@ -883,11 +1004,11 @@ var Ve = 50, He = async (e, t, n) => {
883
1004
  u = v ?? u, d = y ?? d, m[g] = {
884
1005
  ...m[g],
885
1006
  ...b
886
- }, x && p < Ve && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
1007
+ }, x && p < He && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
887
1008
  reference: e,
888
1009
  floating: t,
889
1010
  strategy: i
890
- }) : x.rects), {x: u, y: d} = ze(l, f, c)), n = -1);
1011
+ }) : x.rects), {x: u, y: d} = Be(l, f, c)), n = -1);
891
1012
  }
892
1013
  return {
893
1014
  x: u,
@@ -896,18 +1017,18 @@ var Ve = 50, He = async (e, t, n) => {
896
1017
  strategy: i,
897
1018
  middlewareData: m
898
1019
  };
899
- }, Ue = (e) => ({
1020
+ }, We = (e) => ({
900
1021
  name: "arrow",
901
1022
  options: e,
902
1023
  async fn(t) {
903
- let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = be(e, t) || {};
1024
+ let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = xe(e, t) || {};
904
1025
  if (l == null) return {};
905
- let d = Le(u), f = {
1026
+ let d = Re(u), f = {
906
1027
  x: n,
907
1028
  y: r
908
- }, p = Te(i), m = we(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
1029
+ }, p = Ee(i), m = we(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
909
1030
  (!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
910
- let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = me(d[_], T), D = me(d[v], T), O = E, k = C - h[m] - D, A = C / 2 - h[m] / 2 + w, j = ye(O, A, k), M = !c.arrow && Se(i) != null && A !== j && a.reference[m] / 2 - (A < O ? E : D) - h[m] / 2 < 0, N = M ? A < O ? A - O : A - k : 0;
1031
+ let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = he(d[_], T), D = he(d[v], T), O = E, k = C - h[m] - D, A = C / 2 - h[m] / 2 + w, j = be(O, A, k), M = !c.arrow && Se(i) != null && A !== j && a.reference[m] / 2 - (A < O ? E : D) - h[m] / 2 < 0, N = M ? A < O ? A - O : A - k : 0;
911
1032
  return {
912
1033
  [p]: f[p] + N,
913
1034
  data: {
@@ -918,19 +1039,19 @@ var Ve = 50, He = async (e, t, n) => {
918
1039
  reset: M
919
1040
  };
920
1041
  }
921
- }), We = function(e) {
1042
+ }), Ge = function(e) {
922
1043
  return e === void 0 && (e = {}), {
923
1044
  name: "flip",
924
1045
  options: e,
925
1046
  async fn(t) {
926
1047
  var n;
927
- let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = be(e, t);
1048
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = xe(e, t);
928
1049
  if ((n = i.arrow) != null && n.alignmentOffset) return {};
929
- let g = xe(r), _ = K(o), v = xe(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Fe(o)] : De(o)), x = p !== "none";
930
- !d && x && b.push(...Pe(o, m, p, y));
1050
+ let g = Q(r), _ = Te(o), v = Q(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Ie(o)] : Oe(o)), x = p !== "none";
1051
+ !d && x && b.push(...Fe(o, m, p, y));
931
1052
  let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
932
1053
  if (l && w.push(C[g]), u) {
933
- let e = Ee(r, a, y);
1054
+ let e = De(r, a, y);
934
1055
  w.push(C[e[0]], C[e[1]]);
935
1056
  }
936
1057
  if (T = [...T, {
@@ -938,7 +1059,7 @@ var Ve = 50, He = async (e, t, n) => {
938
1059
  overflows: w
939
1060
  }], !w.every((e) => e <= 0)) {
940
1061
  let e = (i.flip?.index || 0) + 1, t = S[e];
941
- if (t && (!(u === "alignment" && _ !== K(t)) || T.every((e) => K(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
1062
+ if (t && (!(u === "alignment" && _ !== Te(t)) || T.every((e) => Te(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
942
1063
  data: {
943
1064
  index: e,
944
1065
  overflows: T
@@ -950,7 +1071,7 @@ var Ve = 50, He = async (e, t, n) => {
950
1071
  case "bestFit": {
951
1072
  let e = T.filter((e) => {
952
1073
  if (x) {
953
- let t = K(e.placement);
1074
+ let t = Te(e.placement);
954
1075
  return t === _ || t === "y";
955
1076
  }
956
1077
  return !0;
@@ -967,9 +1088,9 @@ var Ve = 50, He = async (e, t, n) => {
967
1088
  return {};
968
1089
  }
969
1090
  };
970
- }, Ge = /* @__PURE__ */ new Set(["left", "top"]);
971
- async function Ke(e, t) {
972
- let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = xe(n), s = Se(n), c = K(n) === "y", l = Ge.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = be(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
1091
+ }, Ke = /* @__PURE__ */ new Set(["left", "top"]);
1092
+ async function qe(e, t) {
1093
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = Q(n), s = Se(n), c = Te(n) === "y", l = Ke.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = xe(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
973
1094
  mainAxis: d,
974
1095
  crossAxis: 0,
975
1096
  alignmentAxis: null
@@ -986,13 +1107,13 @@ async function Ke(e, t) {
986
1107
  y: p * u
987
1108
  };
988
1109
  }
989
- var qe = function(e) {
1110
+ var Je = function(e) {
990
1111
  return e === void 0 && (e = 0), {
991
1112
  name: "offset",
992
1113
  options: e,
993
1114
  async fn(t) {
994
1115
  var n;
995
- let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Ke(t, e);
1116
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await qe(t, e);
996
1117
  return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
997
1118
  x: r + s.x,
998
1119
  y: i + s.y,
@@ -1003,7 +1124,7 @@ var qe = function(e) {
1003
1124
  };
1004
1125
  }
1005
1126
  };
1006
- }, Je = function(e) {
1127
+ }, Ye = function(e) {
1007
1128
  return e === void 0 && (e = {}), {
1008
1129
  name: "shift",
1009
1130
  options: e,
@@ -1014,17 +1135,17 @@ var qe = function(e) {
1014
1135
  x: t,
1015
1136
  y: n
1016
1137
  };
1017
- } }, ...l } = be(e, t), u = {
1138
+ } }, ...l } = xe(e, t), u = {
1018
1139
  x: n,
1019
1140
  y: r
1020
- }, d = await a.detectOverflow(t, l), f = K(xe(i)), p = Ce(f), m = u[p], h = u[f];
1141
+ }, d = await a.detectOverflow(t, l), f = Te(Q(i)), p = Ce(f), m = u[p], h = u[f];
1021
1142
  if (o) {
1022
1143
  let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
1023
- m = ye(n, m, r);
1144
+ m = be(n, m, r);
1024
1145
  }
1025
1146
  if (s) {
1026
1147
  let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
1027
- h = ye(n, h, r);
1148
+ h = be(n, h, r);
1028
1149
  }
1029
1150
  let g = c.fn({
1030
1151
  ...t,
@@ -1047,39 +1168,39 @@ var qe = function(e) {
1047
1168
  };
1048
1169
  //#endregion
1049
1170
  //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1050
- function Ye() {
1171
+ function Xe() {
1051
1172
  return typeof window < "u";
1052
1173
  }
1053
- function Xe(e) {
1054
- return Ze(e) ? (e.nodeName || "").toLowerCase() : "#document";
1174
+ function Ze(e) {
1175
+ return et(e) ? (e.nodeName || "").toLowerCase() : "#document";
1055
1176
  }
1056
- function q(e) {
1177
+ function Qe(e) {
1057
1178
  var t;
1058
1179
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1059
1180
  }
1060
- function J(e) {
1061
- return ((Ze(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
1181
+ function $e(e) {
1182
+ return ((et(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
1062
1183
  }
1063
- function Ze(e) {
1064
- return Ye() ? e instanceof Node || e instanceof q(e).Node : !1;
1184
+ function et(e) {
1185
+ return Xe() ? e instanceof Node || e instanceof Qe(e).Node : !1;
1065
1186
  }
1066
- function Y(e) {
1067
- return Ye() ? e instanceof Element || e instanceof q(e).Element : !1;
1187
+ function tt(e) {
1188
+ return Xe() ? e instanceof Element || e instanceof Qe(e).Element : !1;
1068
1189
  }
1069
- function X(e) {
1070
- return Ye() ? e instanceof HTMLElement || e instanceof q(e).HTMLElement : !1;
1190
+ function nt(e) {
1191
+ return Xe() ? e instanceof HTMLElement || e instanceof Qe(e).HTMLElement : !1;
1071
1192
  }
1072
- function Qe(e) {
1073
- return !Ye() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof q(e).ShadowRoot;
1193
+ function rt(e) {
1194
+ return !Xe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Qe(e).ShadowRoot;
1074
1195
  }
1075
- function $e(e) {
1076
- let { overflow: t, overflowX: n, overflowY: r, display: i } = Z(e);
1196
+ function it(e) {
1197
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = ht(e);
1077
1198
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
1078
1199
  }
1079
- function et(e) {
1080
- return /^(table|td|th)$/.test(Xe(e));
1200
+ function at(e) {
1201
+ return /^(table|td|th)$/.test(Ze(e));
1081
1202
  }
1082
- function tt(e) {
1203
+ function ot(e) {
1083
1204
  try {
1084
1205
  if (e.matches(":popover-open")) return !0;
1085
1206
  } catch {}
@@ -1089,31 +1210,31 @@ function tt(e) {
1089
1210
  return !1;
1090
1211
  }
1091
1212
  }
1092
- var nt = /transform|translate|scale|rotate|perspective|filter/, rt = /paint|layout|strict|content/, it = (e) => !!e && e !== "none", at;
1093
- function ot(e) {
1094
- let t = Y(e) ? Z(e) : e;
1095
- return it(t.transform) || it(t.translate) || it(t.scale) || it(t.rotate) || it(t.perspective) || !ct() && (it(t.backdropFilter) || it(t.filter)) || nt.test(t.willChange || "") || rt.test(t.contain || "");
1096
- }
1097
- function st(e) {
1098
- let t = dt(e);
1099
- for (; X(t) && !lt(t);) {
1100
- if (ot(t)) return t;
1101
- if (tt(t)) return null;
1102
- t = dt(t);
1213
+ var st = /transform|translate|scale|rotate|perspective|filter/, ct = /paint|layout|strict|content/, lt = (e) => !!e && e !== "none", ut;
1214
+ function dt(e) {
1215
+ let t = tt(e) ? ht(e) : e;
1216
+ return lt(t.transform) || lt(t.translate) || lt(t.scale) || lt(t.rotate) || lt(t.perspective) || !pt() && (lt(t.backdropFilter) || lt(t.filter)) || st.test(t.willChange || "") || ct.test(t.contain || "");
1217
+ }
1218
+ function ft(e) {
1219
+ let t = _t(e);
1220
+ for (; nt(t) && !mt(t);) {
1221
+ if (dt(t)) return t;
1222
+ if (ot(t)) return null;
1223
+ t = _t(t);
1103
1224
  }
1104
1225
  return null;
1105
1226
  }
1106
- function ct() {
1107
- return at ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), at;
1227
+ function pt() {
1228
+ return ut ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), ut;
1108
1229
  }
1109
- function lt(e) {
1110
- return /^(html|body|#document)$/.test(Xe(e));
1230
+ function mt(e) {
1231
+ return /^(html|body|#document)$/.test(Ze(e));
1111
1232
  }
1112
- function Z(e) {
1113
- return q(e).getComputedStyle(e);
1233
+ function ht(e) {
1234
+ return Qe(e).getComputedStyle(e);
1114
1235
  }
1115
- function ut(e) {
1116
- return Y(e) ? {
1236
+ function gt(e) {
1237
+ return tt(e) ? {
1117
1238
  scrollLeft: e.scrollLeft,
1118
1239
  scrollTop: e.scrollTop
1119
1240
  } : {
@@ -1121,101 +1242,101 @@ function ut(e) {
1121
1242
  scrollTop: e.scrollY
1122
1243
  };
1123
1244
  }
1124
- function dt(e) {
1125
- if (Xe(e) === "html") return e;
1126
- let t = e.assignedSlot || e.parentNode || Qe(e) && e.host || J(e);
1127
- return Qe(t) ? t.host : t;
1245
+ function _t(e) {
1246
+ if (Ze(e) === "html") return e;
1247
+ let t = e.assignedSlot || e.parentNode || rt(e) && e.host || $e(e);
1248
+ return rt(t) ? t.host : t;
1128
1249
  }
1129
- function ft(e) {
1130
- let t = dt(e);
1131
- return lt(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : X(t) && $e(t) ? t : ft(t);
1250
+ function vt(e) {
1251
+ let t = _t(e);
1252
+ return mt(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : nt(t) && it(t) ? t : vt(t);
1132
1253
  }
1133
- function pt(e, t, n) {
1254
+ function yt(e, t, n) {
1134
1255
  t === void 0 && (t = []), n === void 0 && (n = !0);
1135
- let r = ft(e), i = r === e.ownerDocument?.body, a = q(r);
1256
+ let r = vt(e), i = r === e.ownerDocument?.body, a = Qe(r);
1136
1257
  if (i) {
1137
- let e = mt(a);
1138
- return t.concat(a, a.visualViewport || [], $e(r) ? r : [], e && n ? pt(e) : []);
1139
- } else return t.concat(r, pt(r, [], n));
1258
+ let e = bt(a);
1259
+ return t.concat(a, a.visualViewport || [], it(r) ? r : [], e && n ? yt(e) : []);
1260
+ } else return t.concat(r, yt(r, [], n));
1140
1261
  }
1141
- function mt(e) {
1262
+ function bt(e) {
1142
1263
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1143
1264
  }
1144
1265
  //#endregion
1145
1266
  //#region node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
1146
- function ht(e) {
1147
- let t = Z(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = X(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = ge(n) !== a || ge(r) !== o;
1267
+ function xt(e) {
1268
+ let t = ht(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = nt(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = _e(n) !== a || _e(r) !== o;
1148
1269
  return s && (n = a, r = o), {
1149
1270
  width: n,
1150
1271
  height: r,
1151
1272
  $: s
1152
1273
  };
1153
1274
  }
1154
- function gt(e) {
1155
- return Y(e) ? e : e.contextElement;
1275
+ function St(e) {
1276
+ return tt(e) ? e : e.contextElement;
1156
1277
  }
1157
- function _t(e) {
1158
- let t = gt(e);
1159
- if (!X(t)) return G(1);
1160
- let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = ht(t), o = (a ? ge(n.width) : n.width) / r, s = (a ? ge(n.height) : n.height) / i;
1278
+ function Ct(e) {
1279
+ let t = St(e);
1280
+ if (!nt(t)) return Z(1);
1281
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = xt(t), o = (a ? _e(n.width) : n.width) / r, s = (a ? _e(n.height) : n.height) / i;
1161
1282
  return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
1162
1283
  x: o,
1163
1284
  y: s
1164
1285
  };
1165
1286
  }
1166
- var vt = /* @__PURE__ */ G(0);
1167
- function yt(e) {
1168
- let t = q(e);
1169
- return !ct() || !t.visualViewport ? vt : {
1287
+ var wt = /* @__PURE__ */ Z(0);
1288
+ function Tt(e) {
1289
+ let t = Qe(e);
1290
+ return !pt() || !t.visualViewport ? wt : {
1170
1291
  x: t.visualViewport.offsetLeft,
1171
1292
  y: t.visualViewport.offsetTop
1172
1293
  };
1173
1294
  }
1174
- function bt(e, t, n) {
1175
- return t === void 0 && (t = !1), !n || t && n !== q(e) ? !1 : t;
1295
+ function Et(e, t, n) {
1296
+ return t === void 0 && (t = !1), !n || t && n !== Qe(e) ? !1 : t;
1176
1297
  }
1177
- function xt(e, t, n, r) {
1298
+ function Dt(e, t, n, r) {
1178
1299
  t === void 0 && (t = !1), n === void 0 && (n = !1);
1179
- let i = e.getBoundingClientRect(), a = gt(e), o = G(1);
1180
- t && (r ? Y(r) && (o = _t(r)) : o = _t(e));
1181
- let s = bt(a, n, r) ? yt(a) : G(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
1300
+ let i = e.getBoundingClientRect(), a = St(e), o = Z(1);
1301
+ t && (r ? tt(r) && (o = Ct(r)) : o = Ct(e));
1302
+ let s = Et(a, n, r) ? Tt(a) : Z(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
1182
1303
  if (a) {
1183
- let e = q(a), t = r && Y(r) ? q(r) : r, n = e, i = mt(n);
1304
+ let e = Qe(a), t = r && tt(r) ? Qe(r) : r, n = e, i = bt(n);
1184
1305
  for (; i && r && t !== n;) {
1185
- let e = _t(i), t = i.getBoundingClientRect(), r = Z(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
1186
- c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = q(i), i = mt(n);
1306
+ let e = Ct(i), t = i.getBoundingClientRect(), r = ht(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
1307
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = Qe(i), i = bt(n);
1187
1308
  }
1188
1309
  }
1189
- return Re({
1310
+ return ze({
1190
1311
  width: u,
1191
1312
  height: d,
1192
1313
  x: c,
1193
1314
  y: l
1194
1315
  });
1195
1316
  }
1196
- function St(e, t) {
1197
- let n = ut(e).scrollLeft;
1198
- return t ? t.left + n : xt(J(e)).left + n;
1317
+ function Ot(e, t) {
1318
+ let n = gt(e).scrollLeft;
1319
+ return t ? t.left + n : Dt($e(e)).left + n;
1199
1320
  }
1200
- function Ct(e, t) {
1321
+ function kt(e, t) {
1201
1322
  let n = e.getBoundingClientRect();
1202
1323
  return {
1203
- x: n.left + t.scrollLeft - St(e, n),
1324
+ x: n.left + t.scrollLeft - Ot(e, n),
1204
1325
  y: n.top + t.scrollTop
1205
1326
  };
1206
1327
  }
1207
- function wt(e) {
1208
- let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = J(r), s = t ? tt(t.floating) : !1;
1328
+ function At(e) {
1329
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = $e(r), s = t ? ot(t.floating) : !1;
1209
1330
  if (r === o || s && a) return n;
1210
1331
  let c = {
1211
1332
  scrollLeft: 0,
1212
1333
  scrollTop: 0
1213
- }, l = G(1), u = G(0), d = X(r);
1214
- if ((d || !d && !a) && ((Xe(r) !== "body" || $e(o)) && (c = ut(r)), d)) {
1215
- let e = xt(r);
1216
- l = _t(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
1334
+ }, l = Z(1), u = Z(0), d = nt(r);
1335
+ if ((d || !d && !a) && ((Ze(r) !== "body" || it(o)) && (c = gt(r)), d)) {
1336
+ let e = Dt(r);
1337
+ l = Ct(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
1217
1338
  }
1218
- let f = o && !d && !a ? Ct(o, c) : G(0);
1339
+ let f = o && !d && !a ? kt(o, c) : Z(0);
1219
1340
  return {
1220
1341
  width: n.width * l.x,
1221
1342
  height: n.height * l.y,
@@ -1223,31 +1344,31 @@ function wt(e) {
1223
1344
  y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
1224
1345
  };
1225
1346
  }
1226
- function Tt(e) {
1347
+ function jt(e) {
1227
1348
  return Array.from(e.getClientRects());
1228
1349
  }
1229
- function Et(e) {
1230
- let t = J(e), n = ut(e), r = e.ownerDocument.body, i = he(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = he(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + St(e), s = -n.scrollTop;
1231
- return Z(r).direction === "rtl" && (o += he(t.clientWidth, r.clientWidth) - i), {
1350
+ function Mt(e) {
1351
+ let t = $e(e), n = gt(e), r = e.ownerDocument.body, i = ge(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = ge(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Ot(e), s = -n.scrollTop;
1352
+ return ht(r).direction === "rtl" && (o += ge(t.clientWidth, r.clientWidth) - i), {
1232
1353
  width: i,
1233
1354
  height: a,
1234
1355
  x: o,
1235
1356
  y: s
1236
1357
  };
1237
1358
  }
1238
- var Dt = 25;
1239
- function Ot(e, t) {
1240
- let n = q(e), r = J(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
1359
+ var Nt = 25;
1360
+ function Pt(e, t) {
1361
+ let n = Qe(e), r = $e(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
1241
1362
  if (i) {
1242
1363
  a = i.width, o = i.height;
1243
- let e = ct();
1364
+ let e = pt();
1244
1365
  (!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
1245
1366
  }
1246
- let l = St(r);
1367
+ let l = Ot(r);
1247
1368
  if (l <= 0) {
1248
1369
  let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
1249
- o <= Dt && (a -= o);
1250
- } else l <= Dt && (a += l);
1370
+ o <= Nt && (a -= o);
1371
+ } else l <= Nt && (a += l);
1251
1372
  return {
1252
1373
  width: a,
1253
1374
  height: o,
@@ -1255,8 +1376,8 @@ function Ot(e, t) {
1255
1376
  y: c
1256
1377
  };
1257
1378
  }
1258
- function kt(e, t) {
1259
- let n = xt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = X(e) ? _t(e) : G(1);
1379
+ function Ft(e, t) {
1380
+ let n = Dt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = nt(e) ? Ct(e) : Z(1);
1260
1381
  return {
1261
1382
  width: e.clientWidth * a.x,
1262
1383
  height: e.clientHeight * a.y,
@@ -1264,13 +1385,13 @@ function kt(e, t) {
1264
1385
  y: r * a.y
1265
1386
  };
1266
1387
  }
1267
- function At(e, t, n) {
1388
+ function It(e, t, n) {
1268
1389
  let r;
1269
- if (t === "viewport") r = Ot(e, n);
1270
- else if (t === "document") r = Et(J(e));
1271
- else if (Y(t)) r = kt(t, n);
1390
+ if (t === "viewport") r = Pt(e, n);
1391
+ else if (t === "document") r = Mt($e(e));
1392
+ else if (tt(t)) r = Ft(t, n);
1272
1393
  else {
1273
- let n = yt(e);
1394
+ let n = Tt(e);
1274
1395
  r = {
1275
1396
  x: t.x - n.x,
1276
1397
  y: t.y - n.y,
@@ -1278,27 +1399,27 @@ function At(e, t, n) {
1278
1399
  height: t.height
1279
1400
  };
1280
1401
  }
1281
- return Re(r);
1402
+ return ze(r);
1282
1403
  }
1283
- function jt(e, t) {
1284
- let n = dt(e);
1285
- return n === t || !Y(n) || lt(n) ? !1 : Z(n).position === "fixed" || jt(n, t);
1404
+ function Lt(e, t) {
1405
+ let n = _t(e);
1406
+ return n === t || !tt(n) || mt(n) ? !1 : ht(n).position === "fixed" || Lt(n, t);
1286
1407
  }
1287
- function Mt(e, t) {
1408
+ function Rt(e, t) {
1288
1409
  let n = t.get(e);
1289
1410
  if (n) return n;
1290
- let r = pt(e, [], !1).filter((e) => Y(e) && Xe(e) !== "body"), i = null, a = Z(e).position === "fixed", o = a ? dt(e) : e;
1291
- for (; Y(o) && !lt(o);) {
1292
- let t = Z(o), n = ot(o);
1293
- !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || $e(o) && !n && jt(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = dt(o);
1411
+ let r = yt(e, [], !1).filter((e) => tt(e) && Ze(e) !== "body"), i = null, a = ht(e).position === "fixed", o = a ? _t(e) : e;
1412
+ for (; tt(o) && !mt(o);) {
1413
+ let t = ht(o), n = dt(o);
1414
+ !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || it(o) && !n && Lt(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = _t(o);
1294
1415
  }
1295
1416
  return t.set(e, r), r;
1296
1417
  }
1297
- function Nt(e) {
1298
- let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? tt(t) ? [] : Mt(t, this._c) : [].concat(n), r], o = At(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1418
+ function zt(e) {
1419
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? ot(t) ? [] : Rt(t, this._c) : [].concat(n), r], o = It(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1299
1420
  for (let e = 1; e < a.length; e++) {
1300
- let n = At(t, a[e], i);
1301
- s = he(n.top, s), c = me(n.right, c), l = me(n.bottom, l), u = he(n.left, u);
1421
+ let n = It(t, a[e], i);
1422
+ s = ge(n.top, s), c = he(n.right, c), l = he(n.bottom, l), u = ge(n.left, u);
1302
1423
  }
1303
1424
  return {
1304
1425
  width: c - u,
@@ -1307,27 +1428,27 @@ function Nt(e) {
1307
1428
  y: s
1308
1429
  };
1309
1430
  }
1310
- function Pt(e) {
1311
- let { width: t, height: n } = ht(e);
1431
+ function Bt(e) {
1432
+ let { width: t, height: n } = xt(e);
1312
1433
  return {
1313
1434
  width: t,
1314
1435
  height: n
1315
1436
  };
1316
1437
  }
1317
- function Ft(e, t, n) {
1318
- let r = X(t), i = J(t), a = n === "fixed", o = xt(e, !0, a, t), s = {
1438
+ function Vt(e, t, n) {
1439
+ let r = nt(t), i = $e(t), a = n === "fixed", o = Dt(e, !0, a, t), s = {
1319
1440
  scrollLeft: 0,
1320
1441
  scrollTop: 0
1321
- }, c = G(0);
1442
+ }, c = Z(0);
1322
1443
  function l() {
1323
- c.x = St(i);
1444
+ c.x = Ot(i);
1324
1445
  }
1325
- if (r || !r && !a) if ((Xe(t) !== "body" || $e(i)) && (s = ut(t)), r) {
1326
- let e = xt(t, !0, a, t);
1446
+ if (r || !r && !a) if ((Ze(t) !== "body" || it(i)) && (s = gt(t)), r) {
1447
+ let e = Dt(t, !0, a, t);
1327
1448
  c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
1328
1449
  } else i && l();
1329
1450
  a && !r && i && l();
1330
- let u = i && !r && !a ? Ct(i, s) : G(0);
1451
+ let u = i && !r && !a ? kt(i, s) : Z(0);
1331
1452
  return {
1332
1453
  x: o.left + s.scrollLeft - c.x - u.x,
1333
1454
  y: o.top + s.scrollTop - c.y - u.y,
@@ -1335,34 +1456,34 @@ function Ft(e, t, n) {
1335
1456
  height: o.height
1336
1457
  };
1337
1458
  }
1338
- function It(e) {
1339
- return Z(e).position === "static";
1459
+ function Ht(e) {
1460
+ return ht(e).position === "static";
1340
1461
  }
1341
- function Lt(e, t) {
1342
- if (!X(e) || Z(e).position === "fixed") return null;
1462
+ function Ut(e, t) {
1463
+ if (!nt(e) || ht(e).position === "fixed") return null;
1343
1464
  if (t) return t(e);
1344
1465
  let n = e.offsetParent;
1345
- return J(e) === n && (n = n.ownerDocument.body), n;
1346
- }
1347
- function Rt(e, t) {
1348
- let n = q(e);
1349
- if (tt(e)) return n;
1350
- if (!X(e)) {
1351
- let t = dt(e);
1352
- for (; t && !lt(t);) {
1353
- if (Y(t) && !It(t)) return t;
1354
- t = dt(t);
1466
+ return $e(e) === n && (n = n.ownerDocument.body), n;
1467
+ }
1468
+ function Wt(e, t) {
1469
+ let n = Qe(e);
1470
+ if (ot(e)) return n;
1471
+ if (!nt(e)) {
1472
+ let t = _t(e);
1473
+ for (; t && !mt(t);) {
1474
+ if (tt(t) && !Ht(t)) return t;
1475
+ t = _t(t);
1355
1476
  }
1356
1477
  return n;
1357
1478
  }
1358
- let r = Lt(e, t);
1359
- for (; r && et(r) && It(r);) r = Lt(r, t);
1360
- return r && lt(r) && It(r) && !ot(r) ? n : r || st(e) || n;
1479
+ let r = Ut(e, t);
1480
+ for (; r && at(r) && Ht(r);) r = Ut(r, t);
1481
+ return r && mt(r) && Ht(r) && !dt(r) ? n : r || ft(e) || n;
1361
1482
  }
1362
- var zt = async function(e) {
1363
- let t = this.getOffsetParent || Rt, n = this.getDimensions, r = await n(e.floating);
1483
+ var Gt = async function(e) {
1484
+ let t = this.getOffsetParent || Wt, n = this.getDimensions, r = await n(e.floating);
1364
1485
  return {
1365
- reference: Ft(e.reference, await t(e.floating), e.strategy),
1486
+ reference: Vt(e.reference, await t(e.floating), e.strategy),
1366
1487
  floating: {
1367
1488
  x: 0,
1368
1489
  y: 0,
@@ -1371,26 +1492,26 @@ var zt = async function(e) {
1371
1492
  }
1372
1493
  };
1373
1494
  };
1374
- function Bt(e) {
1375
- return Z(e).direction === "rtl";
1376
- }
1377
- var Vt = {
1378
- convertOffsetParentRelativeRectToViewportRelativeRect: wt,
1379
- getDocumentElement: J,
1380
- getClippingRect: Nt,
1381
- getOffsetParent: Rt,
1382
- getElementRects: zt,
1383
- getClientRects: Tt,
1384
- getDimensions: Pt,
1385
- getScale: _t,
1386
- isElement: Y,
1387
- isRTL: Bt
1495
+ function Kt(e) {
1496
+ return ht(e).direction === "rtl";
1497
+ }
1498
+ var qt = {
1499
+ convertOffsetParentRelativeRectToViewportRelativeRect: At,
1500
+ getDocumentElement: $e,
1501
+ getClippingRect: zt,
1502
+ getOffsetParent: Wt,
1503
+ getElementRects: Gt,
1504
+ getClientRects: jt,
1505
+ getDimensions: Bt,
1506
+ getScale: Ct,
1507
+ isElement: tt,
1508
+ isRTL: Kt
1388
1509
  };
1389
- function Ht(e, t) {
1510
+ function Jt(e, t) {
1390
1511
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1391
1512
  }
1392
- function Ut(e, t) {
1393
- let n = null, r, i = J(e);
1513
+ function Yt(e, t) {
1514
+ let n = null, r, i = $e(e);
1394
1515
  function a() {
1395
1516
  var e;
1396
1517
  clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
@@ -1399,9 +1520,9 @@ function Ut(e, t) {
1399
1520
  s === void 0 && (s = !1), c === void 0 && (c = 1), a();
1400
1521
  let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
1401
1522
  if (s || t(), !f || !p) return;
1402
- let m = _e(d), h = _e(i.clientWidth - (u + f)), g = _e(i.clientHeight - (d + p)), _ = _e(u), v = {
1523
+ let m = ve(d), h = ve(i.clientWidth - (u + f)), g = ve(i.clientHeight - (d + p)), _ = ve(u), v = {
1403
1524
  rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
1404
- threshold: he(0, me(1, c)) || 1
1525
+ threshold: ge(0, he(1, c)) || 1
1405
1526
  }, y = !0;
1406
1527
  function b(t) {
1407
1528
  let n = t[0].intersectionRatio;
@@ -1411,7 +1532,7 @@ function Ut(e, t) {
1411
1532
  o(!1, 1e-7);
1412
1533
  }, 1e3);
1413
1534
  }
1414
- n === 1 && !Ht(l, e.getBoundingClientRect()) && o(), y = !1;
1535
+ n === 1 && !Jt(l, e.getBoundingClientRect()) && o(), y = !1;
1415
1536
  }
1416
1537
  try {
1417
1538
  n = new IntersectionObserver(b, {
@@ -1425,13 +1546,13 @@ function Ut(e, t) {
1425
1546
  }
1426
1547
  return o(!0), a;
1427
1548
  }
1428
- function Wt(e, t, n, r) {
1549
+ function Xt(e, t, n, r) {
1429
1550
  r === void 0 && (r = {});
1430
- let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = gt(e), u = i || a ? [...l ? pt(l) : [], ...t ? pt(t) : []] : [];
1551
+ let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = St(e), u = i || a ? [...l ? yt(l) : [], ...t ? yt(t) : []] : [];
1431
1552
  u.forEach((e) => {
1432
1553
  i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
1433
1554
  });
1434
- let d = l && s ? Ut(l, n) : null, f = -1, p = null;
1555
+ let d = l && s ? Yt(l, n) : null, f = -1, p = null;
1435
1556
  o && (p = new ResizeObserver((e) => {
1436
1557
  let [r] = e;
1437
1558
  r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
@@ -1439,11 +1560,11 @@ function Wt(e, t, n, r) {
1439
1560
  (e = p) == null || e.observe(t);
1440
1561
  })), n();
1441
1562
  }), l && !c && p.observe(l), t && p.observe(t));
1442
- let m, h = c ? xt(e) : null;
1563
+ let m, h = c ? Dt(e) : null;
1443
1564
  c && g();
1444
1565
  function g() {
1445
- let t = xt(e);
1446
- h && !Ht(h, t) && n(), h = t, m = requestAnimationFrame(g);
1566
+ let t = Dt(e);
1567
+ h && !Jt(h, t) && n(), h = t, m = requestAnimationFrame(g);
1447
1568
  }
1448
1569
  return n(), () => {
1449
1570
  var e;
@@ -1452,53 +1573,53 @@ function Wt(e, t, n, r) {
1452
1573
  }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
1453
1574
  };
1454
1575
  }
1455
- var Gt = qe, Kt = Je, qt = We, Jt = Ue, Yt = (e, t, n) => {
1576
+ var Zt = Je, Qt = Ye, $t = Ge, en = We, tn = (e, t, n) => {
1456
1577
  let r = /* @__PURE__ */ new Map(), i = {
1457
- platform: Vt,
1578
+ platform: qt,
1458
1579
  ...n
1459
1580
  }, a = {
1460
1581
  ...i.platform,
1461
1582
  _c: r
1462
1583
  };
1463
- return He(e, t, {
1584
+ return Ue(e, t, {
1464
1585
  ...i,
1465
1586
  platform: a
1466
1587
  });
1467
- }, Xt = "_trigger_e00wn_1", Zt = "_content_e00wn_10", Qt = "_subTrigger_e00wn_61", $t = "_itemMain_e00wn_90", en = "_itemInset_e00wn_106", tn = "_shortcut_e00wn_118", nn = "_indicator_e00wn_119", rn = "_submenuIndicator_e00wn_120", Q = {
1468
- trigger: Xt,
1469
- content: Zt,
1588
+ }, nn = "_trigger_e00wn_1", rn = "_content_e00wn_10", an = "_subTrigger_e00wn_61", on = "_itemMain_e00wn_90", sn = "_itemInset_e00wn_106", cn = "_shortcut_e00wn_118", ln = "_indicator_e00wn_119", un = "_submenuIndicator_e00wn_120", dn = {
1589
+ trigger: nn,
1590
+ content: rn,
1470
1591
  "owo-dropdown-menu-in": "_owo-dropdown-menu-in_e00wn_1",
1471
- subTrigger: Qt,
1472
- itemMain: $t,
1473
- itemInset: en,
1474
- shortcut: tn,
1475
- indicator: nn,
1476
- submenuIndicator: rn
1477
- }, an = n(null), on = n(null);
1478
- function sn(e) {
1479
- let t = a(an);
1592
+ subTrigger: an,
1593
+ itemMain: on,
1594
+ itemInset: sn,
1595
+ shortcut: cn,
1596
+ indicator: ln,
1597
+ submenuIndicator: un
1598
+ }, fn = n(null), pn = n(null);
1599
+ function mn(e) {
1600
+ let t = a(fn);
1480
1601
  if (!t) throw Error(`${e} must be used within DropdownMenu.`);
1481
1602
  return t;
1482
1603
  }
1483
- function cn(e) {
1484
- let t = a(on);
1604
+ function hn(e) {
1605
+ let t = a(pn);
1485
1606
  if (!t) throw Error(`${e} must be used within DropdownMenu.Content.`);
1486
1607
  return t;
1487
1608
  }
1488
- function ln(e, t) {
1609
+ function gn(e, t) {
1489
1610
  return (n) => {
1490
1611
  e?.(n), t(n);
1491
1612
  };
1492
1613
  }
1493
- function un(...e) {
1614
+ function _n(...e) {
1494
1615
  return (t) => {
1495
1616
  for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
1496
1617
  };
1497
1618
  }
1498
- function dn(e) {
1499
- return typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(dn).join(" ") : !e || typeof e == "boolean" ? "" : r(e) ? dn(e.props.children) : "";
1619
+ function vn(e) {
1620
+ return typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(vn).join(" ") : !e || typeof e == "boolean" ? "" : r(e) ? vn(e.props.children) : "";
1500
1621
  }
1501
- function fn(e) {
1622
+ function yn(e) {
1502
1623
  return [...e].sort((e, t) => {
1503
1624
  let n = e.ref.current, r = t.ref.current;
1504
1625
  if (!n || !r) return 0;
@@ -1506,18 +1627,18 @@ function fn(e) {
1506
1627
  return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
1507
1628
  });
1508
1629
  }
1509
- function pn(e, t) {
1630
+ function bn(e, t) {
1510
1631
  return t === "center" ? e : `${e}-${t}`;
1511
1632
  }
1512
- function mn(e) {
1633
+ function xn(e) {
1513
1634
  let t = e.split("-");
1514
1635
  return {
1515
1636
  side: t[0],
1516
1637
  align: t[1] ?? "center"
1517
1638
  };
1518
1639
  }
1519
- function hn({ open: e, defaultOpen: t = !1, onOpenChange: n, side: r = "bottom", align: o = "start", sideOffset: c = 8, alignOffset: f = 0, collisionPadding: m = 8, portal: h = !0, contentRole: g = "menu", classNames: _, children: v }) {
1520
- let y = a(on), [b, x] = d(t), S = e !== void 0, C = S ? e : b, w = u(null), T = u(null), E = u("selected"), D = s(), O = s(), k = i((e) => {
1640
+ function Sn({ open: e, defaultOpen: t = !1, onOpenChange: n, side: r = "bottom", align: o = "start", sideOffset: c = 8, alignOffset: f = 0, collisionPadding: m = 8, portal: h = !0, contentRole: g = "menu", classNames: _, children: v }) {
1641
+ let y = a(pn), [b, x] = d(t), S = e !== void 0, C = S ? e : b, w = u(null), T = u(null), E = u("selected"), D = s(), O = s(), k = i((e) => {
1521
1642
  S || x(e), n?.(e);
1522
1643
  }, [S, n]), A = i(() => {
1523
1644
  k(!1);
@@ -1527,7 +1648,7 @@ function hn({ open: e, defaultOpen: t = !1, onOpenChange: n, side: r = "bottom",
1527
1648
  k(!C);
1528
1649
  }, [C, k]), N = i(() => {
1529
1650
  w.current?.focus();
1530
- }, []), ee = l(() => ({
1651
+ }, []), P = l(() => ({
1531
1652
  open: C,
1532
1653
  setOpen: k,
1533
1654
  toggleOpen: M,
@@ -1568,33 +1689,33 @@ function hn({ open: e, defaultOpen: t = !1, onOpenChange: n, side: r = "bottom",
1568
1689
  O,
1569
1690
  N
1570
1691
  ]);
1571
- return /* @__PURE__ */ p(an.Provider, {
1572
- value: ee,
1692
+ return /* @__PURE__ */ p(fn.Provider, {
1693
+ value: P,
1573
1694
  children: v
1574
1695
  });
1575
1696
  }
1576
- function gn({ asChild: n = !1, disabled: r = !1, className: i, children: a }) {
1577
- let { open: o, setOpen: s, toggleOpen: c, triggerRef: l, contentRole: u, triggerId: d, contentId: f, focusIntentRef: m, isSubmenu: h, classNames: g } = sn("DropdownMenu.Trigger"), v = e.only(a), y = v.props ?? {}, b = typeof y.className == "string" ? y.className : void 0, x = {
1697
+ function Cn({ asChild: n = !1, disabled: r = !1, className: i, children: a }) {
1698
+ let { open: o, setOpen: s, toggleOpen: c, triggerRef: l, contentRole: u, triggerId: d, contentId: f, focusIntentRef: m, isSubmenu: h, classNames: g } = mn("DropdownMenu.Trigger"), v = e.only(a), y = v.props ?? {}, b = typeof y.className == "string" ? y.className : void 0, x = {
1578
1699
  id: d,
1579
1700
  "data-state": o ? "open" : "closed",
1580
1701
  "aria-expanded": o,
1581
1702
  "aria-haspopup": u,
1582
1703
  "aria-controls": o ? f : void 0,
1583
- onClick: ln(y.onClick, (e) => {
1704
+ onClick: gn(y.onClick, (e) => {
1584
1705
  if (r) {
1585
1706
  e.preventDefault();
1586
1707
  return;
1587
1708
  }
1588
1709
  m.current = "selected", c();
1589
1710
  }),
1590
- onKeyDown: ln(y.onKeyDown, (e) => {
1711
+ onKeyDown: gn(y.onKeyDown, (e) => {
1591
1712
  r || (e.key === "ArrowDown" ? (e.preventDefault(), m.current = "first", s(!0)) : e.key === "ArrowUp" ? (e.preventDefault(), m.current = "last", s(!0)) : !h && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m.current = "selected", c()));
1592
1713
  })
1593
1714
  };
1594
1715
  return n ? t(v, {
1595
1716
  ...x,
1596
- ref: un(l, y.ref),
1597
- className: _(Q.trigger, g?.trigger, i, b),
1717
+ ref: _n(l, y.ref),
1718
+ className: _(dn.trigger, g?.trigger, i, b),
1598
1719
  type: v.type === "button" ? y.type ?? "button" : y.type
1599
1720
  }) : /* @__PURE__ */ p("button", {
1600
1721
  ref: l,
@@ -1602,61 +1723,61 @@ function gn({ asChild: n = !1, disabled: r = !1, className: i, children: a }) {
1602
1723
  type: "button",
1603
1724
  "data-scope": "dropdown-menu",
1604
1725
  "data-part": "trigger",
1605
- className: _(Q.trigger, g?.trigger, i),
1726
+ className: _(dn.trigger, g?.trigger, i),
1606
1727
  ...x,
1607
1728
  children: v
1608
1729
  });
1609
1730
  }
1610
- function _n({ className: e, children: t, style: n, matchTriggerWidth: r = !1, maxHeight: a = 320, ...s }) {
1611
- let { open: f, setOpen: m, triggerRef: g, contentRef: v, side: y, align: b, sideOffset: x, alignOffset: S, collisionPadding: C, portal: w, contentRole: T, triggerId: E, contentId: D, focusIntentRef: O, parentList: k, isSubmenu: A, closeSelf: j, closeTree: M, focusTrigger: N, classNames: ee } = sn("DropdownMenu.Content"), P = u([]), [F, I] = d(null), [L, R] = d(null), [te, ne] = d(null), [z, B] = d(!1), re = u(""), V = u(null), ie = i((e) => (P.current = [...P.current.filter((t) => t.id !== e.id), e], () => {
1612
- P.current = P.current.filter((t) => t.id !== e.id);
1613
- }), []), H = i(() => fn(P.current), []), ae = i((e) => {
1731
+ function wn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, maxHeight: a = 320, ...s }) {
1732
+ let { open: f, setOpen: m, triggerRef: g, contentRef: v, side: y, align: b, sideOffset: x, alignOffset: S, collisionPadding: C, portal: w, contentRole: T, triggerId: E, contentId: D, focusIntentRef: O, parentList: k, isSubmenu: A, closeSelf: j, closeTree: M, focusTrigger: N, classNames: P } = mn("DropdownMenu.Content"), F = u([]), [I, L] = d(null), [R, z] = d(null), [ee, B] = d(null), [V, H] = d(!1), U = u(""), te = u(null), W = i((e) => (F.current = [...F.current.filter((t) => t.id !== e.id), e], () => {
1733
+ F.current = F.current.filter((t) => t.id !== e.id);
1734
+ }), []), G = i(() => yn(F.current), []), K = i((e) => {
1614
1735
  O.current = e;
1615
1736
  }, [O]);
1616
1737
  o(() => {
1617
- B(!0);
1738
+ H(!0);
1618
1739
  }, []);
1619
- let oe = l(() => ({
1740
+ let ne = l(() => ({
1620
1741
  role: T,
1621
- highlightedId: F,
1622
- setHighlightedId: I,
1623
- registerItem: ie,
1624
- getItems: H,
1625
- requestFocusIntent: ae,
1742
+ highlightedId: I,
1743
+ setHighlightedId: L,
1744
+ registerItem: W,
1745
+ getItems: G,
1746
+ requestFocusIntent: K,
1626
1747
  closeTree: M,
1627
1748
  closeSelf: j,
1628
1749
  focusTrigger: N,
1629
- activeSubmenuId: L,
1630
- setActiveSubmenuId: R,
1750
+ activeSubmenuId: R,
1751
+ setActiveSubmenuId: z,
1631
1752
  contentRef: v
1632
1753
  }), [
1633
- L,
1754
+ R,
1634
1755
  j,
1635
1756
  M,
1636
1757
  v,
1637
1758
  T,
1638
1759
  N,
1639
- H,
1640
- F,
1641
- ie,
1642
- ae
1760
+ G,
1761
+ I,
1762
+ W,
1763
+ K
1643
1764
  ]);
1644
1765
  c(() => {
1645
- if (!(!f || !z || !g.current || !v.current)) return Wt(g.current, v.current, () => {
1646
- !g.current || !v.current || Yt(g.current, v.current, {
1647
- placement: pn(y, b),
1766
+ if (!(!f || !V || !g.current || !v.current)) return Xt(g.current, v.current, () => {
1767
+ !g.current || !v.current || tn(g.current, v.current, {
1768
+ placement: bn(y, b),
1648
1769
  strategy: "fixed",
1649
1770
  middleware: [
1650
- Gt({
1771
+ Zt({
1651
1772
  mainAxis: x,
1652
1773
  crossAxis: S
1653
1774
  }),
1654
- qt({ padding: C }),
1655
- Kt({ padding: C })
1775
+ $t({ padding: C }),
1776
+ Qt({ padding: C })
1656
1777
  ]
1657
1778
  }).then(({ x: e, y: t, placement: n }) => {
1658
- let r = mn(n);
1659
- ne({
1779
+ let r = xn(n);
1780
+ B({
1660
1781
  top: t,
1661
1782
  left: e,
1662
1783
  side: r.side,
@@ -1669,26 +1790,26 @@ function _n({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
1669
1790
  S,
1670
1791
  C,
1671
1792
  v,
1672
- z,
1793
+ V,
1673
1794
  f,
1674
1795
  y,
1675
1796
  x,
1676
1797
  g
1677
1798
  ]), o(() => {
1678
1799
  if (!f) {
1679
- I(null), R(null);
1800
+ L(null), z(null);
1680
1801
  return;
1681
1802
  }
1682
- let e = H().filter((e) => !e.disabled);
1803
+ let e = G().filter((e) => !e.disabled);
1683
1804
  if (e.length === 0) return;
1684
1805
  let t = e[0];
1685
- O.current === "last" ? t = e[e.length - 1] : O.current === "selected" && (t = e.find((e) => e.selected) ?? e[0]), I(t.id), requestAnimationFrame(() => {
1806
+ O.current === "last" ? t = e[e.length - 1] : O.current === "selected" && (t = e.find((e) => e.selected) ?? e[0]), L(t.id), requestAnimationFrame(() => {
1686
1807
  v.current?.focus(), t.ref.current?.scrollIntoView({ block: "nearest" });
1687
1808
  });
1688
1809
  }, [
1689
1810
  v,
1690
1811
  O,
1691
- H,
1812
+ G,
1692
1813
  f
1693
1814
  ]), o(() => {
1694
1815
  if (!f) return;
@@ -1714,64 +1835,64 @@ function _n({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
1714
1835
  g
1715
1836
  ]), o(() => {
1716
1837
  if (f) return () => {
1717
- V.current && clearTimeout(V.current);
1838
+ te.current && clearTimeout(te.current);
1718
1839
  };
1719
1840
  }, [f]);
1720
- let U = i((e) => {
1721
- if (I(e), !e) {
1722
- R(null);
1841
+ let q = i((e) => {
1842
+ if (L(e), !e) {
1843
+ z(null);
1723
1844
  return;
1724
1845
  }
1725
- H().find((t) => t.id === e)?.submenu || R(null);
1726
- }, [H]), se = i((e, t = "first") => {
1727
- let n = H().filter((e) => !e.disabled);
1846
+ G().find((t) => t.id === e)?.submenu || z(null);
1847
+ }, [G]), J = i((e, t = "first") => {
1848
+ let n = G().filter((e) => !e.disabled);
1728
1849
  if (n.length === 0) return;
1729
- let r = n.findIndex((e) => e.id === F);
1850
+ let r = n.findIndex((e) => e.id === I);
1730
1851
  if (r === -1) {
1731
- U(t === "last" ? n[n.length - 1].id : n[0].id);
1852
+ q(t === "last" ? n[n.length - 1].id : n[0].id);
1732
1853
  return;
1733
1854
  }
1734
1855
  let i = n[(r + e + n.length) % n.length];
1735
- U(i.id), i.ref.current?.scrollIntoView({ block: "nearest" });
1856
+ q(i.id), i.ref.current?.scrollIntoView({ block: "nearest" });
1736
1857
  }, [
1737
- H,
1738
- F,
1739
- U
1740
- ]), ce = i((e) => {
1858
+ G,
1859
+ I,
1860
+ q
1861
+ ]), Y = i((e) => {
1741
1862
  let t = e.length === 1 ? e.toLowerCase() : "";
1742
1863
  if (!t) return;
1743
- V.current && clearTimeout(V.current), re.current += t, V.current = setTimeout(() => {
1744
- re.current = "", V.current = null;
1864
+ te.current && clearTimeout(te.current), U.current += t, te.current = setTimeout(() => {
1865
+ U.current = "", te.current = null;
1745
1866
  }, 350);
1746
- let n = H().filter((e) => !e.disabled);
1867
+ let n = G().filter((e) => !e.disabled);
1747
1868
  if (n.length === 0) return;
1748
- let r = n.findIndex((e) => e.id === F), i = (r >= 0 ? [...n.slice(r + 1), ...n.slice(0, r + 1)] : n).find((e) => e.textValue.toLowerCase().startsWith(re.current));
1749
- i && (U(i.id), i.ref.current?.scrollIntoView({ block: "nearest" }));
1869
+ let r = n.findIndex((e) => e.id === I), i = (r >= 0 ? [...n.slice(r + 1), ...n.slice(0, r + 1)] : n).find((e) => e.textValue.toLowerCase().startsWith(U.current));
1870
+ i && (q(i.id), i.ref.current?.scrollIntoView({ block: "nearest" }));
1750
1871
  }, [
1751
- H,
1752
- F,
1753
- U
1754
- ]), le = i((e) => {
1755
- let t = H(), n = t.find((e) => e.id === F) ?? null;
1872
+ G,
1873
+ I,
1874
+ q
1875
+ ]), X = i((e) => {
1876
+ let t = G(), n = t.find((e) => e.id === I) ?? null;
1756
1877
  switch (e.key) {
1757
1878
  case "ArrowDown":
1758
- e.preventDefault(), se(1);
1879
+ e.preventDefault(), J(1);
1759
1880
  break;
1760
1881
  case "ArrowUp":
1761
- e.preventDefault(), se(-1, "last");
1882
+ e.preventDefault(), J(-1, "last");
1762
1883
  break;
1763
1884
  case "Home":
1764
1885
  e.preventDefault();
1765
1886
  {
1766
1887
  let e = t.find((e) => !e.disabled);
1767
- e && U(e.id);
1888
+ e && q(e.id);
1768
1889
  }
1769
1890
  break;
1770
1891
  case "End":
1771
1892
  e.preventDefault();
1772
1893
  {
1773
1894
  let e = t.filter((e) => !e.disabled), n = e[e.length - 1];
1774
- n && U(n.id);
1895
+ n && q(n.id);
1775
1896
  }
1776
1897
  break;
1777
1898
  case "Enter":
@@ -1790,23 +1911,23 @@ function _n({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
1790
1911
  case "Escape":
1791
1912
  e.preventDefault(), j(), N(), A && k?.setActiveSubmenuId(null);
1792
1913
  break;
1793
- default: ce(e.key);
1914
+ default: Y(e.key);
1794
1915
  }
1795
1916
  }, [
1796
1917
  j,
1797
1918
  M,
1798
1919
  N,
1799
- H,
1800
- ce,
1801
- F,
1802
- U,
1920
+ G,
1921
+ Y,
1922
+ I,
1923
+ q,
1803
1924
  A,
1804
- se,
1925
+ J,
1805
1926
  k
1806
1927
  ]);
1807
- if (!f || !z) return null;
1808
- let ue = /* @__PURE__ */ p(on.Provider, {
1809
- value: oe,
1928
+ if (!f || !V) return null;
1929
+ let re = /* @__PURE__ */ p(pn.Provider, {
1930
+ value: ne,
1810
1931
  children: /* @__PURE__ */ p("div", {
1811
1932
  ref: v,
1812
1933
  id: D,
@@ -1814,28 +1935,28 @@ function _n({ className: e, children: t, style: n, matchTriggerWidth: r = !1, ma
1814
1935
  tabIndex: -1,
1815
1936
  "aria-labelledby": T === "menu" ? E : void 0,
1816
1937
  "data-state": "open",
1817
- "data-side": te?.side ?? y,
1818
- "data-align": te?.align ?? b,
1938
+ "data-side": ee?.side ?? y,
1939
+ "data-align": ee?.align ?? b,
1819
1940
  "data-scope": "dropdown-menu",
1820
1941
  "data-part": "content",
1821
- className: _(Q.content, ee?.content, e),
1942
+ className: _(dn.content, P?.content, e),
1822
1943
  style: {
1823
1944
  ...n,
1824
1945
  position: "fixed",
1825
- top: te?.top ?? 0,
1826
- left: te?.left ?? 0,
1946
+ top: ee?.top ?? 0,
1947
+ left: ee?.left ?? 0,
1827
1948
  maxHeight: a,
1828
1949
  minWidth: r ? g.current?.getBoundingClientRect().width : void 0
1829
1950
  },
1830
- onKeyDown: le,
1951
+ onKeyDown: X,
1831
1952
  ...s,
1832
1953
  children: t
1833
1954
  })
1834
1955
  });
1835
- return w ? h(ue, document.body) : ue;
1956
+ return w ? h(re, document.body) : re;
1836
1957
  }
1837
- function vn({ className: e, children: t, ...n }) {
1838
- let { classNames: r } = sn("DropdownMenu.Group");
1958
+ function Tn({ className: e, children: t, ...n }) {
1959
+ let { classNames: r } = mn("DropdownMenu.Group");
1839
1960
  return /* @__PURE__ */ p("div", {
1840
1961
  "data-scope": "dropdown-menu",
1841
1962
  "data-part": "group",
@@ -1844,8 +1965,8 @@ function vn({ className: e, children: t, ...n }) {
1844
1965
  children: t
1845
1966
  });
1846
1967
  }
1847
- function yn({ className: e, children: t, ...n }) {
1848
- let { classNames: r } = sn("DropdownMenu.Label");
1968
+ function En({ className: e, children: t, ...n }) {
1969
+ let { classNames: r } = mn("DropdownMenu.Label");
1849
1970
  return /* @__PURE__ */ p("div", {
1850
1971
  "data-scope": "dropdown-menu",
1851
1972
  "data-part": "label",
@@ -1854,8 +1975,8 @@ function yn({ className: e, children: t, ...n }) {
1854
1975
  children: t
1855
1976
  });
1856
1977
  }
1857
- function bn({ className: e, ...t }) {
1858
- let { classNames: n } = sn("DropdownMenu.Separator");
1978
+ function Dn({ className: e, ...t }) {
1979
+ let { classNames: n } = mn("DropdownMenu.Separator");
1859
1980
  return /* @__PURE__ */ p("div", {
1860
1981
  role: "separator",
1861
1982
  "data-scope": "dropdown-menu",
@@ -1864,8 +1985,8 @@ function bn({ className: e, ...t }) {
1864
1985
  ...t
1865
1986
  });
1866
1987
  }
1867
- function xn({ className: e, children: t, inset: n = !1, disabled: r = !1, selected: a = !1, destructive: c = !1, closeOnSelect: d = !0, shortcut: f, indicator: h, onSelect: g, onMouseEnter: v, onClick: y, ...b }) {
1868
- let x = s(), S = u(null), { role: C, highlightedId: w, setHighlightedId: T, registerItem: E, closeTree: D, setActiveSubmenuId: O } = cn("DropdownMenu.Item"), { classNames: k } = sn("DropdownMenu.Item"), A = l(() => dn(t), [t]), j = w === x, M = i(() => {
1988
+ function On({ className: e, children: t, inset: n = !1, disabled: r = !1, selected: a = !1, destructive: c = !1, closeOnSelect: d = !0, shortcut: f, indicator: h, onSelect: g, onMouseEnter: v, onClick: y, ...b }) {
1989
+ let x = s(), S = u(null), { role: C, highlightedId: w, setHighlightedId: T, registerItem: E, closeTree: D, setActiveSubmenuId: O } = hn("DropdownMenu.Item"), { classNames: k } = mn("DropdownMenu.Item"), A = l(() => vn(t), [t]), j = w === x, M = i(() => {
1869
1990
  r || (g?.(), d && D());
1870
1991
  }, [
1871
1992
  d,
@@ -1904,32 +2025,32 @@ function xn({ className: e, children: t, inset: n = !1, disabled: r = !1, select
1904
2025
  "data-destructive": c || void 0,
1905
2026
  "data-scope": "dropdown-menu",
1906
2027
  "data-part": "item",
1907
- className: _(n && Q.itemInset, k?.item, e),
1908
- onMouseEnter: ln(v, () => {
2028
+ className: _(n && dn.itemInset, k?.item, e),
2029
+ onMouseEnter: gn(v, () => {
1909
2030
  r || (T(x), O(null));
1910
2031
  }),
1911
- onClick: ln(y, (e) => {
2032
+ onClick: gn(y, (e) => {
1912
2033
  e.preventDefault(), M();
1913
2034
  }),
1914
2035
  ...b,
1915
2036
  children: [
1916
2037
  /* @__PURE__ */ p("span", {
1917
- className: Q.itemMain,
2038
+ className: dn.itemMain,
1918
2039
  children: t
1919
2040
  }),
1920
2041
  f ? /* @__PURE__ */ p("span", {
1921
- className: Q.shortcut,
2042
+ className: dn.shortcut,
1922
2043
  children: f
1923
2044
  }) : null,
1924
2045
  a ? /* @__PURE__ */ p("span", {
1925
- className: Q.indicator,
2046
+ className: dn.indicator,
1926
2047
  children: h ?? "✓"
1927
2048
  }) : null
1928
2049
  ]
1929
2050
  });
1930
2051
  }
1931
- function Sn(e) {
1932
- return /* @__PURE__ */ p(hn, {
2052
+ function kn(e) {
2053
+ return /* @__PURE__ */ p(Sn, {
1933
2054
  side: "right",
1934
2055
  align: "start",
1935
2056
  sideOffset: 6,
@@ -1937,8 +2058,8 @@ function Sn(e) {
1937
2058
  contentRole: "menu"
1938
2059
  });
1939
2060
  }
1940
- function Cn({ className: e, children: t, inset: n = !1, disabled: r = !1, destructive: a = !1, shortcut: c, onSelect: d, onMouseEnter: f, onClick: h, ...g }) {
1941
- let v = s(), y = u(null), b = sn("DropdownMenu.SubTrigger"), { highlightedId: x, setHighlightedId: S, registerItem: C, setActiveSubmenuId: w, activeSubmenuId: T } = cn("DropdownMenu.SubTrigger"), E = l(() => dn(t), [t]), D = x === v, O = b.open && T === v, k = i(() => {
2061
+ function An({ className: e, children: t, inset: n = !1, disabled: r = !1, destructive: a = !1, shortcut: c, onSelect: d, onMouseEnter: f, onClick: h, ...g }) {
2062
+ let v = s(), y = u(null), b = mn("DropdownMenu.SubTrigger"), { highlightedId: x, setHighlightedId: S, registerItem: C, setActiveSubmenuId: w, activeSubmenuId: T } = hn("DropdownMenu.SubTrigger"), E = l(() => vn(t), [t]), D = x === v, O = b.open && T === v, k = i(() => {
1942
2063
  r || (b.focusIntentRef.current = "first", S(v), w(v), b.setOpen(!0));
1943
2064
  }, [
1944
2065
  r,
@@ -1970,7 +2091,7 @@ function Cn({ className: e, children: t, inset: n = !1, disabled: r = !1, destru
1970
2091
  v,
1971
2092
  b
1972
2093
  ]), /* @__PURE__ */ m("button", {
1973
- ref: un(y, b.triggerRef),
2094
+ ref: _n(y, b.triggerRef),
1974
2095
  id: b.triggerId,
1975
2096
  type: "button",
1976
2097
  role: "menuitem",
@@ -1982,47 +2103,47 @@ function Cn({ className: e, children: t, inset: n = !1, disabled: r = !1, destru
1982
2103
  "data-state": O ? "open" : "closed",
1983
2104
  "data-disabled": r || void 0,
1984
2105
  "data-destructive": a || void 0,
1985
- className: _(Q.subTrigger, n && Q.itemInset, e),
1986
- onMouseEnter: ln(f, () => {
2106
+ className: _(dn.subTrigger, n && dn.itemInset, e),
2107
+ onMouseEnter: gn(f, () => {
1987
2108
  k();
1988
2109
  }),
1989
- onClick: ln(h, (e) => {
2110
+ onClick: gn(h, (e) => {
1990
2111
  e.preventDefault(), k(), d?.();
1991
2112
  }),
1992
2113
  ...g,
1993
2114
  children: [
1994
2115
  /* @__PURE__ */ p("span", {
1995
- className: Q.itemMain,
2116
+ className: dn.itemMain,
1996
2117
  children: t
1997
2118
  }),
1998
2119
  c ? /* @__PURE__ */ p("span", {
1999
- className: Q.shortcut,
2120
+ className: dn.shortcut,
2000
2121
  children: c
2001
2122
  }) : null,
2002
2123
  /* @__PURE__ */ p("span", {
2003
- className: Q.submenuIndicator,
2124
+ className: dn.submenuIndicator,
2004
2125
  "aria-hidden": "true",
2005
2126
  children: "›"
2006
2127
  })
2007
2128
  ]
2008
2129
  });
2009
2130
  }
2010
- var wn = Object.assign(hn, {
2011
- Trigger: gn,
2012
- Content: _n,
2013
- Group: vn,
2014
- Label: yn,
2015
- Item: xn,
2016
- Separator: bn,
2017
- Submenu: Sn,
2018
- SubTrigger: Cn
2019
- }), Tn = {
2131
+ var jn = Object.assign(Sn, {
2132
+ Trigger: Cn,
2133
+ Content: wn,
2134
+ Group: Tn,
2135
+ Label: En,
2136
+ Item: On,
2137
+ Separator: Dn,
2138
+ Submenu: kn,
2139
+ SubTrigger: An
2140
+ }), Mn = {
2020
2141
  panel: "_panel_7f715_1",
2021
2142
  backdrop: "_backdrop_7f715_55"
2022
2143
  };
2023
2144
  //#endregion
2024
2145
  //#region src/components/Drawer.tsx
2025
- function En({ as: e = "aside", open: t, children: n, side: r = "right", position: i = "fixed", showBackdrop: a = !0, onClose: o, closeLabel: s = "关闭抽屉", backdropClassName: c, className: l, classNames: u, ...d }) {
2146
+ function Nn({ as: e = "aside", open: t, children: n, side: r = "right", position: i = "fixed", showBackdrop: a = !0, onClose: o, closeLabel: s = "关闭抽屉", backdropClassName: c, className: l, classNames: u, ...d }) {
2026
2147
  return /* @__PURE__ */ m(f, { children: [a && t && o && /* @__PURE__ */ p("button", {
2027
2148
  type: "button",
2028
2149
  "aria-label": s,
@@ -2030,7 +2151,7 @@ function En({ as: e = "aside", open: t, children: n, side: r = "right", position
2030
2151
  "data-scope": "drawer",
2031
2152
  "data-part": "backdrop",
2032
2153
  "data-position": i,
2033
- className: _("owo-drawer-backdrop", Tn.backdrop, c, u?.backdrop),
2154
+ className: _("owo-drawer-backdrop", Mn.backdrop, c, u?.backdrop),
2034
2155
  onClick: o
2035
2156
  }), /* @__PURE__ */ p(e, {
2036
2157
  "aria-hidden": !t,
@@ -2039,43 +2160,91 @@ function En({ as: e = "aside", open: t, children: n, side: r = "right", position
2039
2160
  "data-position": i,
2040
2161
  "data-scope": "drawer",
2041
2162
  "data-part": "panel",
2042
- className: _("owo-drawer", Tn.panel, l, u?.panel),
2163
+ className: _("owo-drawer", Mn.panel, l, u?.panel),
2043
2164
  ...d,
2044
2165
  children: n
2045
2166
  })] });
2046
2167
  }
2047
- var Dn = {
2048
- root: "_root_1fz2l_1",
2049
- label: "_label_1fz2l_7",
2050
- help: "_help_1fz2l_15"
2168
+ var Pn = {
2169
+ root: "_root_38gc5_1",
2170
+ label: "_label_38gc5_10",
2171
+ required: "_required_38gc5_18",
2172
+ description: "_description_38gc5_23",
2173
+ error: "_error_38gc5_31",
2174
+ help: "_help_38gc5_39"
2051
2175
  };
2052
2176
  //#endregion
2053
2177
  //#region src/components/Field.tsx
2054
- function On({ label: e, help: t, htmlFor: n, children: r, className: i, classNames: a, ...o }) {
2178
+ function Fn({ label: e, description: t, error: n, help: r, required: i = !1, disabled: a = !1, invalid: o = !1, htmlFor: c, children: u, className: d, classNames: f, ...h }) {
2179
+ let g = s(), v = c ?? g, y = `${v}-label`, b = t == null ? void 0 : `${v}-description`, x = n == null ? void 0 : `${v}-error`, S = r == null ? void 0 : `${v}-help`, C = [
2180
+ b,
2181
+ x,
2182
+ S
2183
+ ].filter(Boolean).join(" ") || void 0, w = l(() => ({
2184
+ controlId: v,
2185
+ labelId: y,
2186
+ describedBy: C,
2187
+ disabled: a,
2188
+ invalid: o,
2189
+ required: i
2190
+ }), [
2191
+ v,
2192
+ y,
2193
+ C,
2194
+ a,
2195
+ o,
2196
+ i
2197
+ ]);
2055
2198
  return /* @__PURE__ */ m("div", {
2056
- className: _("owo-field", Dn.root, i),
2057
- ...o,
2199
+ className: _("owo-field", Pn.root, d),
2200
+ "data-disabled": a || void 0,
2201
+ "data-invalid": o || void 0,
2202
+ "data-required": i || void 0,
2203
+ ...h,
2058
2204
  children: [
2059
- /* @__PURE__ */ p("label", {
2060
- htmlFor: n,
2205
+ /* @__PURE__ */ m("label", {
2206
+ id: y,
2207
+ htmlFor: v,
2061
2208
  "data-part": "label",
2062
- className: _(Dn.label, a?.label),
2063
- children: e
2209
+ className: _(Pn.label, f?.label),
2210
+ children: [e, i && /* @__PURE__ */ p("span", {
2211
+ "data-part": "required",
2212
+ "aria-hidden": "true",
2213
+ className: _(Pn.required, f?.required),
2214
+ children: "*"
2215
+ })]
2064
2216
  }),
2065
- r,
2066
- t ? /* @__PURE__ */ p("span", {
2067
- "data-part": "help",
2068
- className: _(Dn.help, a?.help),
2217
+ t != null && /* @__PURE__ */ p("span", {
2218
+ id: b,
2219
+ "data-part": "description",
2220
+ className: _(Pn.description, f?.description),
2069
2221
  children: t
2070
- }) : null
2222
+ }),
2223
+ /* @__PURE__ */ p(z.Provider, {
2224
+ value: w,
2225
+ children: u
2226
+ }),
2227
+ n != null && /* @__PURE__ */ p("span", {
2228
+ id: x,
2229
+ "data-part": "error",
2230
+ role: "alert",
2231
+ className: _(Pn.error, f?.error),
2232
+ children: n
2233
+ }),
2234
+ r != null && /* @__PURE__ */ p("span", {
2235
+ id: S,
2236
+ "data-part": "help",
2237
+ className: _(Pn.help, f?.help),
2238
+ children: r
2239
+ })
2071
2240
  ]
2072
2241
  });
2073
2242
  }
2074
- var kn = { root: "_root_1hqa8_1" };
2243
+ var In = { root: "_root_1hqa8_1" };
2075
2244
  //#endregion
2076
2245
  //#region src/components/IconButton.tsx
2077
- function An({ variant: e = "ghost", size: t = "md", label: n, icon: r, className: i, ...a }) {
2078
- let o = _("owo-icon-button", kn.root, i);
2246
+ function Ln({ variant: e = "ghost", size: t = "md", label: n, icon: r, className: i, ...a }) {
2247
+ let o = _("owo-icon-button", In.root, i);
2079
2248
  if ("href" in a && a.href) {
2080
2249
  let { href: i, ...s } = a;
2081
2250
  return /* @__PURE__ */ p("a", {
@@ -2101,37 +2270,329 @@ function An({ variant: e = "ghost", size: t = "md", label: n, icon: r, className
2101
2270
  children: r
2102
2271
  });
2103
2272
  }
2104
- var jn = { root: "_root_8zge1_1" };
2273
+ var Rn = { root: "_root_8zge1_1" };
2105
2274
  //#endregion
2106
2275
  //#region src/components/Input.tsx
2107
- function Mn(e) {
2108
- let { className: t, tone: n = "default", size: r = "md", ...i } = e;
2109
- return e.as === "textarea" ? /* @__PURE__ */ p("textarea", {
2110
- "data-tone": n,
2111
- "data-size": r,
2112
- className: _("owo-input", jn.root, t),
2113
- ...i
2114
- }) : /* @__PURE__ */ p("input", {
2115
- "data-tone": n,
2116
- "data-size": r,
2117
- className: _("owo-input", jn.root, t),
2118
- ...i
2276
+ function zn({ className: e, tone: t = "default", size: n = "md", invalid: r, ...i }) {
2277
+ let a = V({
2278
+ id: i.id,
2279
+ disabled: i.disabled,
2280
+ required: i.required,
2281
+ invalid: r,
2282
+ "aria-describedby": i["aria-describedby"]
2283
+ });
2284
+ return /* @__PURE__ */ p("input", {
2285
+ ...i,
2286
+ id: a.id,
2287
+ disabled: a.disabled,
2288
+ required: a.required,
2289
+ "aria-describedby": a["aria-describedby"],
2290
+ "aria-invalid": a.invalid || void 0,
2291
+ "data-tone": t,
2292
+ "data-size": n,
2293
+ "data-invalid": a.invalid || void 0,
2294
+ className: _("owo-input", Rn.root, e)
2295
+ });
2296
+ }
2297
+ var Bn = {
2298
+ trigger: "_trigger_xunrw_1",
2299
+ content: "_content_xunrw_5",
2300
+ "tooltip-in": "_tooltip-in_xunrw_1"
2301
+ }, Vn = 6, Hn = 8, Un = 4;
2302
+ function Wn(e) {
2303
+ return e.split("-")[0];
2304
+ }
2305
+ var Gn = {
2306
+ top: "",
2307
+ bottom: "rotate(180deg)",
2308
+ left: "rotate(-90deg)",
2309
+ right: "rotate(90deg)"
2310
+ };
2311
+ function Kn({ content: e, placement: t = "top", density: n = "default", showDelay: r = 300, hideDelay: a = 150, arrow: l = !0, renderArrow: g, className: v, children: y, classNames: b }) {
2312
+ let [x, S] = d(!1), [C, w] = d(null), [T, E] = d(t), [D, O] = d({}), k = u(null), A = u(null), j = u(null), M = u(void 0), N = u(void 0), P = s(), F = i(() => {
2313
+ clearTimeout(M.current), clearTimeout(N.current);
2314
+ }, []), I = i(() => {
2315
+ F(), M.current = setTimeout(() => S(!0), r);
2316
+ }, [F, r]), L = i(() => {
2317
+ F(), S(!0);
2318
+ }, [F]), R = i(() => {
2319
+ F(), N.current = setTimeout(() => S(!1), a);
2320
+ }, [F, a]), z = i((e) => {
2321
+ if (e.target === k.current) {
2322
+ I();
2323
+ return;
2324
+ }
2325
+ L();
2326
+ }, [I, L]), ee = i((e) => {
2327
+ e.pointerType !== "mouse" && L();
2328
+ }, [L]), B = i((e) => {
2329
+ e.key === "Escape" && x && S(!1);
2330
+ }, [x]);
2331
+ c(() => {
2332
+ if (!x || !k.current || !A.current) return;
2333
+ let e = [
2334
+ Zt(l ? Hn + Vn : Hn),
2335
+ $t({ padding: Un }),
2336
+ Qt({ padding: Un })
2337
+ ];
2338
+ return l && j.current && e.push(en({ element: j.current })), Xt(k.current, A.current, () => {
2339
+ !k.current || !A.current || tn(k.current, A.current, {
2340
+ placement: t,
2341
+ strategy: "fixed",
2342
+ middleware: e
2343
+ }).then(({ x: e, y: t, placement: n, middlewareData: r }) => {
2344
+ w({
2345
+ top: t,
2346
+ left: e
2347
+ }), E(Wn(n)), r.arrow && O({
2348
+ x: r.arrow.x,
2349
+ y: r.arrow.y
2350
+ });
2351
+ });
2352
+ });
2353
+ }, [
2354
+ x,
2355
+ t,
2356
+ l
2357
+ ]), o(() => {
2358
+ if (x) return document.addEventListener("keydown", B), () => document.removeEventListener("keydown", B);
2359
+ }, [x, B]), o(() => F, [F]);
2360
+ let V = { position: "absolute" }, H = T;
2361
+ return H === "top" || H === "bottom" ? (V.left = D.x ?? 0, V[H === "top" ? "bottom" : "top"] = -Vn, V.transform = Gn[H] || void 0) : (V.top = D.y ?? 0, V[H === "left" ? "right" : "left"] = -Vn, V.transform = Gn[H]), /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
2362
+ ref: k,
2363
+ "data-state": x ? "open" : "closed",
2364
+ "data-scope": "tooltip",
2365
+ "data-part": "trigger",
2366
+ className: _("owo-tooltip-trigger", Bn.trigger, b?.trigger),
2367
+ onMouseEnter: I,
2368
+ onMouseLeave: R,
2369
+ onFocus: z,
2370
+ onBlur: R,
2371
+ onPointerDown: ee,
2372
+ "aria-describedby": x ? P : void 0,
2373
+ children: y
2374
+ }), x && h(/* @__PURE__ */ m("div", {
2375
+ ref: A,
2376
+ id: P,
2377
+ role: "tooltip",
2378
+ "data-state": x ? "open" : "closed",
2379
+ "data-placement": T,
2380
+ "data-density": n,
2381
+ "data-scope": "tooltip",
2382
+ "data-part": "content",
2383
+ className: _("owo-tooltip", Bn.content, b?.content, v),
2384
+ style: C ? {
2385
+ top: C.top,
2386
+ left: C.left
2387
+ } : { visibility: "hidden" },
2388
+ onMouseEnter: I,
2389
+ onMouseLeave: R,
2390
+ children: [e, l && /* @__PURE__ */ p("span", {
2391
+ ref: j,
2392
+ "data-scope": "tooltip",
2393
+ "data-part": "arrow",
2394
+ className: _(b?.arrow),
2395
+ style: V,
2396
+ children: g ? g({ placement: T }) : /* @__PURE__ */ p("svg", {
2397
+ width: Vn * 2,
2398
+ height: Vn,
2399
+ viewBox: "0 0 12 6",
2400
+ children: /* @__PURE__ */ p("path", {
2401
+ d: "M0 0l6 6 6-6z",
2402
+ fill: "currentColor"
2403
+ })
2404
+ })
2405
+ })]
2406
+ }), document.body)] });
2407
+ }
2408
+ var qn = {
2409
+ root: "_root_56wh4_1",
2410
+ section: "_section_56wh4_21",
2411
+ buttonReset: "_buttonReset_56wh4_31",
2412
+ linkReset: "_linkReset_56wh4_32",
2413
+ item: "_item_56wh4_42",
2414
+ icon: "_icon_56wh4_82",
2415
+ spacer: "_spacer_56wh4_88"
2416
+ }, Jn = n(null);
2417
+ function Yn(e) {
2418
+ let t = a(Jn);
2419
+ if (!t) throw Error(`${e} must be used within NavRail.`);
2420
+ return t;
2421
+ }
2422
+ function Xn({ activeKey: e, onChange: t, classNames: n, orientation: r = "vertical", className: i, children: a, ...o }) {
2423
+ let s = u([]), c = l(() => ({
2424
+ activeKey: e,
2425
+ onChange: t,
2426
+ classNames: n,
2427
+ orientation: r,
2428
+ registerItem: (e) => {
2429
+ let t = s.current.filter((t) => t.value !== e.value);
2430
+ t.push(e), s.current = t;
2431
+ },
2432
+ unregisterItem: (e) => {
2433
+ s.current = s.current.filter((t) => t.value !== e);
2434
+ },
2435
+ moveFocus: (e, t) => {
2436
+ let n = s.current.filter((e) => !e.disabled && e.ref);
2437
+ if (n.length === 0) return;
2438
+ let r = n.findIndex((t) => t.value === e), i = n[0];
2439
+ t === "first" && (i = n[0]), t === "last" && (i = n[n.length - 1]), t === "next" && (i = n[r >= 0 ? (r + 1) % n.length : 0]), t === "prev" && (i = n[r >= 0 ? (r - 1 + n.length) % n.length : n.length - 1]), i?.ref?.focus();
2440
+ }
2441
+ }), [
2442
+ e,
2443
+ n,
2444
+ t,
2445
+ r
2446
+ ]);
2447
+ return /* @__PURE__ */ p(Jn.Provider, {
2448
+ value: c,
2449
+ children: /* @__PURE__ */ p("nav", {
2450
+ "aria-label": "Navigation rail",
2451
+ "data-scope": "nav-rail",
2452
+ "data-orientation": r,
2453
+ className: _("owo-nav-rail", qn.root, i),
2454
+ ...o,
2455
+ children: a
2456
+ })
2457
+ });
2458
+ }
2459
+ function Zn(e) {
2460
+ let { activeKey: t, onChange: n, classNames: r, orientation: i, registerItem: a, unregisterItem: o, moveFocus: s } = Yn("NavRail.Item"), c = t === e.value, l = (t) => {
2461
+ let n = i === "horizontal" ? {
2462
+ next: "ArrowRight",
2463
+ prev: "ArrowLeft"
2464
+ } : {
2465
+ next: "ArrowDown",
2466
+ prev: "ArrowUp"
2467
+ };
2468
+ switch (t.key) {
2469
+ case n.next:
2470
+ t.preventDefault(), s(e.value, "next");
2471
+ break;
2472
+ case n.prev:
2473
+ t.preventDefault(), s(e.value, "prev");
2474
+ break;
2475
+ case "Home":
2476
+ t.preventDefault(), s(e.value, "first");
2477
+ break;
2478
+ case "End":
2479
+ t.preventDefault(), s(e.value, "last");
2480
+ break;
2481
+ }
2482
+ }, u = /* @__PURE__ */ p("span", {
2483
+ "data-scope": "nav-rail",
2484
+ "data-part": "item",
2485
+ "data-active": c || void 0,
2486
+ "data-disabled": e.disabled || void 0,
2487
+ className: _(qn.item, r?.item, e.className),
2488
+ children: /* @__PURE__ */ p("span", {
2489
+ "aria-hidden": "true",
2490
+ "data-scope": "nav-rail",
2491
+ "data-part": "icon",
2492
+ className: _(qn.icon, r?.icon),
2493
+ children: e.icon
2494
+ })
2495
+ });
2496
+ if ("href" in e && e.href) {
2497
+ let { value: t, icon: r, label: i, disabled: s, className: d, href: f, onClick: m, ...h } = e;
2498
+ return /* @__PURE__ */ p(Kn, {
2499
+ content: i,
2500
+ density: "compact",
2501
+ children: /* @__PURE__ */ p("a", {
2502
+ ...h,
2503
+ ref: (e) => {
2504
+ e ? a({
2505
+ value: t,
2506
+ disabled: !!s,
2507
+ ref: e
2508
+ }) : o(t);
2509
+ },
2510
+ href: s ? void 0 : f,
2511
+ "aria-label": i,
2512
+ "aria-disabled": s || void 0,
2513
+ "aria-current": c ? "page" : void 0,
2514
+ tabIndex: s ? -1 : h.tabIndex,
2515
+ className: qn.linkReset,
2516
+ onKeyDown: (e) => {
2517
+ h.onKeyDown?.(e), e.defaultPrevented || l(e);
2518
+ },
2519
+ onClick: (e) => {
2520
+ if (m?.(e), s) {
2521
+ e.preventDefault();
2522
+ return;
2523
+ }
2524
+ e.defaultPrevented || n?.(t);
2525
+ },
2526
+ children: u
2527
+ })
2528
+ });
2529
+ }
2530
+ let { value: d, icon: f, label: m, disabled: h, className: g, onClick: v, ...y } = e;
2531
+ return /* @__PURE__ */ p(Kn, {
2532
+ content: m,
2533
+ density: "compact",
2534
+ children: /* @__PURE__ */ p("button", {
2535
+ ...y,
2536
+ ref: (e) => {
2537
+ e ? a({
2538
+ value: d,
2539
+ disabled: !!h,
2540
+ ref: e
2541
+ }) : o(d);
2542
+ },
2543
+ type: "button",
2544
+ disabled: h,
2545
+ "aria-label": m,
2546
+ className: qn.buttonReset,
2547
+ onKeyDown: (e) => {
2548
+ y.onKeyDown?.(e), e.defaultPrevented || l(e);
2549
+ },
2550
+ onClick: (e) => {
2551
+ v?.(e), !e.defaultPrevented && !h && n?.(d);
2552
+ },
2553
+ children: u
2554
+ })
2555
+ });
2556
+ }
2557
+ function Qn() {
2558
+ let { classNames: e } = Yn("NavRail.Spacer");
2559
+ return /* @__PURE__ */ p("div", {
2560
+ "aria-hidden": "true",
2561
+ "data-scope": "nav-rail",
2562
+ "data-part": "spacer",
2563
+ className: _(qn.spacer, e?.spacer)
2564
+ });
2565
+ }
2566
+ function $n({ label: e, className: t, children: n, ...r }) {
2567
+ let { classNames: i } = Yn("NavRail.Section");
2568
+ return /* @__PURE__ */ p("div", {
2569
+ "data-scope": "nav-rail",
2570
+ "data-part": "section",
2571
+ className: _(qn.section, i?.section, t),
2572
+ "aria-label": e,
2573
+ role: e ? "group" : void 0,
2574
+ ...r,
2575
+ children: n
2119
2576
  });
2120
2577
  }
2121
- var Nn = { root: "_root_1226l_1" };
2578
+ var er = Object.assign(Xn, {
2579
+ Item: Zn,
2580
+ Section: $n,
2581
+ Spacer: Qn
2582
+ }), tr = { root: "_root_1226l_1" };
2122
2583
  //#endregion
2123
2584
  //#region src/components/Panel.tsx
2124
- function Pn({ as: e = "section", variant: t = "default", padding: n = "none", className: r, children: i, ...a }) {
2585
+ function nr({ as: e = "section", variant: t = "default", padding: n = "none", className: r, children: i, ...a }) {
2125
2586
  return /* @__PURE__ */ p(e, {
2126
2587
  "data-variant": t,
2127
2588
  "data-padding": n === "none" ? void 0 : n,
2128
2589
  "data-scope": "panel",
2129
- className: _("owo-panel", Nn.root, r),
2590
+ className: _("owo-panel", tr.root, r),
2130
2591
  ...a,
2131
2592
  children: i
2132
2593
  });
2133
2594
  }
2134
- function Fn({ className: e, children: t, ...n }) {
2595
+ function rr({ className: e, children: t, ...n }) {
2135
2596
  return /* @__PURE__ */ p("div", {
2136
2597
  "data-scope": "panel",
2137
2598
  "data-part": "header",
@@ -2140,7 +2601,7 @@ function Fn({ className: e, children: t, ...n }) {
2140
2601
  children: t
2141
2602
  });
2142
2603
  }
2143
- function In({ className: e, children: t, ...n }) {
2604
+ function ir({ className: e, children: t, ...n }) {
2144
2605
  return /* @__PURE__ */ p("div", {
2145
2606
  "data-scope": "panel",
2146
2607
  "data-part": "body",
@@ -2149,7 +2610,7 @@ function In({ className: e, children: t, ...n }) {
2149
2610
  children: t
2150
2611
  });
2151
2612
  }
2152
- function Ln({ className: e, children: t, ...n }) {
2613
+ function ar({ className: e, children: t, ...n }) {
2153
2614
  return /* @__PURE__ */ p("div", {
2154
2615
  "data-scope": "panel",
2155
2616
  "data-part": "footer",
@@ -2158,193 +2619,759 @@ function Ln({ className: e, children: t, ...n }) {
2158
2619
  children: t
2159
2620
  });
2160
2621
  }
2161
- var Rn = {
2162
- root: "_root_biv8a_1",
2163
- item: "_item_biv8a_41"
2164
- };
2165
- //#endregion
2166
- //#region src/components/SegmentedControl.tsx
2167
- function zn({ value: e, onChange: t, options: n, size: r = "md", className: i, ariaLabel: a }) {
2168
- return /* @__PURE__ */ p("div", {
2169
- role: "tablist",
2170
- "aria-label": a,
2171
- "data-size": r,
2172
- className: _("owo-segmented-control", Rn.root, i),
2173
- children: n.map((n) => {
2174
- let r = n.value === e;
2175
- return /* @__PURE__ */ p("button", {
2176
- type: "button",
2177
- role: "tab",
2178
- "aria-selected": r,
2179
- disabled: n.disabled,
2180
- "data-active": r ? "true" : void 0,
2181
- className: Rn.item,
2182
- onClick: () => t(n.value),
2183
- children: n.label
2184
- }, n.value);
2185
- })
2186
- });
2622
+ var or = {
2623
+ trigger: "_trigger_93qj8_1",
2624
+ content: "_content_93qj8_10",
2625
+ arrow: "_arrow_93qj8_22"
2626
+ }, sr = n(null);
2627
+ function cr(e) {
2628
+ let t = a(sr);
2629
+ if (!t) throw Error(`${e} must be used within Popover.Root.`);
2630
+ return t;
2187
2631
  }
2188
- var Bn = {
2189
- root: "_root_pixr0_1",
2190
- valueText: "_valueText_pixr0_91",
2191
- placeholder: "_placeholder_pixr0_97"
2192
- };
2193
- //#endregion
2194
- //#region src/components/Select.tsx
2195
- function Vn({ value: e, onChange: t, options: n, placeholder: r = "Select…", size: a = "md", tone: c = "default", disabled: f = !1, className: h, ariaLabel: g, renderValue: v, renderOption: y, classNames: b }) {
2196
- let [x, S] = d(!1), [C, w] = d(-1), T = u(null), E = u(null), D = s(), O = n.find((t) => t.value === e), k = l(() => n.reduce((e, t, n) => (t.disabled || e.push(n), e), []), [n]), A = i(() => {
2197
- if (f || n.length === 0) return;
2198
- S(!0);
2199
- let t = n.findIndex((t) => t.value === e);
2200
- w(t >= 0 ? t : k[0] ?? -1);
2201
- }, [
2202
- f,
2632
+ function lr(...e) {
2633
+ return (t) => {
2634
+ for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
2635
+ };
2636
+ }
2637
+ function ur(e, t) {
2638
+ return (n) => {
2639
+ e?.(n), t(n);
2640
+ };
2641
+ }
2642
+ function dr(e, t) {
2643
+ let n = document.activeElement;
2644
+ return n instanceof Node ? !!(e?.contains(n) || t?.contains(n)) : !1;
2645
+ }
2646
+ function fr(e) {
2647
+ return typeof e.type == "string" && [
2648
+ "button",
2649
+ "a",
2650
+ "input",
2651
+ "select",
2652
+ "textarea",
2653
+ "summary"
2654
+ ].includes(e.type);
2655
+ }
2656
+ function pr({ open: e, defaultOpen: t = !1, onOpenChange: n, trigger: r = "click", classNames: a, children: o }) {
2657
+ let [c, f] = d(t), m = e !== void 0, h = m ? e : c, g = u(null), _ = u(null), v = s(), y = s(), b = i((e) => {
2658
+ m || f(e), n?.(e);
2659
+ }, [m, n]), x = l(() => ({
2660
+ open: h,
2661
+ trigger: r,
2662
+ setOpen: b,
2663
+ triggerRef: g,
2664
+ contentRef: _,
2665
+ triggerId: v,
2666
+ contentId: y,
2667
+ classNames: a
2668
+ }), [
2669
+ h,
2670
+ a,
2671
+ b,
2672
+ r,
2673
+ v,
2674
+ y
2675
+ ]);
2676
+ return /* @__PURE__ */ p(sr.Provider, {
2677
+ value: x,
2678
+ children: o
2679
+ });
2680
+ }
2681
+ function mr({ asChild: e = !1, disabled: n = !1, className: a, children: s }) {
2682
+ let { open: c, trigger: l, setOpen: d, triggerRef: f, contentRef: m, triggerId: h, contentId: g, classNames: v } = cr("Popover.Trigger"), y = u(void 0), b = i(() => {
2683
+ clearTimeout(y.current);
2684
+ }, []), x = i(() => {
2685
+ b(), y.current = setTimeout(() => d(!1), 100);
2686
+ }, [b, d]);
2687
+ if (o(() => b, [b]), !r(s)) throw Error("Popover.Trigger expects a single React element child.");
2688
+ let S = {
2689
+ ref: lr(s.ref, f),
2690
+ id: h,
2691
+ "aria-expanded": c,
2692
+ "aria-controls": g,
2693
+ "aria-haspopup": "dialog",
2694
+ "data-state": c ? "open" : "closed",
2695
+ "data-scope": "popover",
2696
+ "data-part": "trigger",
2697
+ className: _(!e && or.trigger, v?.trigger, a, s.props.className),
2698
+ onClick: ur(s.props.onClick, (e) => {
2699
+ n || (l === "click" || (e.detail ?? 0) > 0) && d(!c);
2700
+ }),
2701
+ onMouseEnter: ur(s.props.onMouseEnter, () => {
2702
+ n || l !== "hover" || (b(), d(!0));
2703
+ }),
2704
+ onMouseLeave: ur(s.props.onMouseLeave, () => {
2705
+ if (!(n || l !== "hover")) {
2706
+ if (dr(f.current, m.current)) {
2707
+ b();
2708
+ return;
2709
+ }
2710
+ x();
2711
+ }
2712
+ }),
2713
+ onPointerDown: ur(s.props.onPointerDown, (e) => {
2714
+ n || l !== "hover" || e.pointerType !== "mouse" && d(!0);
2715
+ }),
2716
+ onFocus: ur(s.props.onFocus, () => {
2717
+ n || l !== "hover" || (b(), d(!0));
2718
+ }),
2719
+ onBlur: ur(s.props.onBlur, (e) => {
2720
+ if (n || l !== "hover") return;
2721
+ let t = e.relatedTarget;
2722
+ if (t && m.current?.contains(t)) {
2723
+ b();
2724
+ return;
2725
+ }
2726
+ x();
2727
+ })
2728
+ };
2729
+ return e || fr(s) ? t(s, S) : /* @__PURE__ */ p("button", {
2730
+ type: "button",
2731
+ ...S,
2732
+ children: s
2733
+ });
2734
+ }
2735
+ var hr = 6;
2736
+ function gr({ placement: e = "bottom", side: t = "bottom", align: n = "center", sideOffset: r = 8, alignOffset: a = 0, collisionPadding: s = 8, portal: l = !0, arrow: f = !0, matchTriggerWidth: g = !1, closeOnInteractOutside: v = !0, closeOnEscape: y = !0, closeOnPointerDownOutside: b = !0, restoreFocus: x = !0, initialFocusRef: S, onInteractOutside: C, onEscapeKeyDown: w, onPointerDownOutside: T, className: E, classNames: D, children: O, onMouseEnter: k, onMouseLeave: A, onFocus: j, onBlur: M, ...N }) {
2737
+ let { open: P, trigger: F, setOpen: I, triggerRef: L, contentRef: R, contentId: z, triggerId: ee, classNames: B } = cr("Popover.Content"), [V, H] = d(null), [U, te] = d("bottom"), [W, G] = d({}), [K, ne] = d(null), q = u(null), J = u(void 0), Y = i(() => {
2738
+ clearTimeout(J.current);
2739
+ }, []), X = i(() => {
2740
+ Y(), J.current = setTimeout(() => I(!1), 100);
2741
+ }, [Y, I]);
2742
+ if (c(() => {
2743
+ if (!P || !L.current || !R.current) return;
2744
+ let i = e === "auto" ? t : e ?? (n === "center" ? t : `${t}-${n}`), o = [
2745
+ Zt({
2746
+ mainAxis: f ? r + hr : r,
2747
+ crossAxis: a
2748
+ }),
2749
+ $t({ padding: s }),
2750
+ Qt({ padding: s })
2751
+ ];
2752
+ return f && q.current && o.push(en({ element: q.current })), Xt(L.current, R.current, () => {
2753
+ !L.current || !R.current || tn(L.current, R.current, {
2754
+ placement: i,
2755
+ strategy: "fixed",
2756
+ middleware: o
2757
+ }).then(({ x: e, y: t, placement: n, middlewareData: r }) => {
2758
+ H({
2759
+ top: t,
2760
+ left: e
2761
+ }), te(n), ne(L.current?.offsetWidth ?? null), r.arrow && G({
2762
+ x: r.arrow.x,
2763
+ y: r.arrow.y
2764
+ });
2765
+ });
2766
+ });
2767
+ }, [
2203
2768
  n,
2769
+ a,
2770
+ f,
2771
+ s,
2772
+ R,
2773
+ g,
2774
+ P,
2204
2775
  e,
2205
- k
2206
- ]), j = i(() => {
2207
- S(!1), w(-1);
2208
- }, []), M = i((e) => {
2209
- e.disabled || (t(e.value), j());
2210
- }, [t, j]);
2211
- o(() => {
2212
- if (!x) return;
2776
+ t,
2777
+ r,
2778
+ L
2779
+ ]), o(() => {
2780
+ if (!P) return;
2781
+ F === "click" && requestAnimationFrame(() => {
2782
+ let e = R.current;
2783
+ if (!e) return;
2784
+ if (S?.current) {
2785
+ S.current.focus();
2786
+ return;
2787
+ }
2788
+ let t = e.querySelector("button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])");
2789
+ if (t) {
2790
+ t.focus();
2791
+ return;
2792
+ }
2793
+ e.focus();
2794
+ });
2213
2795
  function e(e) {
2214
- T.current && !T.current.contains(e.target) && j();
2796
+ let t = e.target;
2797
+ R.current?.contains(t) || L.current?.contains(t) || (C?.(t), T?.(t), !(!v || !b) && (I(!1), x && L.current?.focus()));
2215
2798
  }
2216
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2217
- }, [x, j]), o(() => {
2218
- !x || C < 0 || (E.current?.children[C])?.scrollIntoView({ block: "nearest" });
2219
- }, [x, C]);
2799
+ function t(e) {
2800
+ e.key === "Escape" && (w?.(), y && (e.stopPropagation(), I(!1), x && L.current?.focus()));
2801
+ }
2802
+ return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
2803
+ document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
2804
+ };
2805
+ }, [
2806
+ y,
2807
+ v,
2808
+ b,
2809
+ R,
2810
+ S,
2811
+ w,
2812
+ C,
2813
+ T,
2814
+ P,
2815
+ x,
2816
+ I,
2817
+ L,
2818
+ F
2819
+ ]), o(() => Y, [Y]), !P) return null;
2820
+ let re = U.split("-")[0], ie = { position: "absolute" };
2821
+ re === "top" || re === "bottom" ? (ie.left = W.x ?? 0, ie[re === "top" ? "bottom" : "top"] = -hr) : (ie.top = W.y ?? 0, ie[re === "left" ? "right" : "left"] = -hr);
2822
+ let ae = /* @__PURE__ */ m("div", {
2823
+ ref: R,
2824
+ id: z,
2825
+ role: "dialog",
2826
+ "aria-modal": "false",
2827
+ "aria-labelledby": ee,
2828
+ tabIndex: -1,
2829
+ "data-state": "open",
2830
+ "data-placement": re,
2831
+ "data-scope": "popover",
2832
+ "data-part": "content",
2833
+ className: _("owo-popover", or.content, B?.content, D?.content, E),
2834
+ style: V ? {
2835
+ top: V.top,
2836
+ left: V.left,
2837
+ width: g && K ? K : void 0
2838
+ } : {
2839
+ top: 0,
2840
+ left: 0,
2841
+ width: g && K ? K : void 0
2842
+ },
2843
+ onMouseEnter: (e) => {
2844
+ k?.(e), F === "hover" && Y();
2845
+ },
2846
+ onMouseLeave: (e) => {
2847
+ if (A?.(e), F === "hover") {
2848
+ if (dr(L.current, R.current)) {
2849
+ Y();
2850
+ return;
2851
+ }
2852
+ X();
2853
+ }
2854
+ },
2855
+ onFocus: (e) => {
2856
+ j?.(e), F === "hover" && Y();
2857
+ },
2858
+ onBlur: (e) => {
2859
+ if (M?.(e), F !== "hover") return;
2860
+ let t = e.relatedTarget;
2861
+ if (t && (R.current?.contains(t) || L.current?.contains(t))) {
2862
+ Y();
2863
+ return;
2864
+ }
2865
+ X();
2866
+ },
2867
+ ...N,
2868
+ children: [O, f && /* @__PURE__ */ p("span", {
2869
+ ref: q,
2870
+ "data-scope": "popover",
2871
+ "data-part": "arrow",
2872
+ className: _(or.arrow, B?.arrow, D?.arrow),
2873
+ style: ie
2874
+ })]
2875
+ });
2876
+ return l ? h(ae, document.body) : ae;
2877
+ }
2878
+ var _r = Object.assign(pr, {
2879
+ Root: pr,
2880
+ Trigger: mr,
2881
+ Content: gr
2882
+ }), vr = {
2883
+ group: "_group_bhiyd_1",
2884
+ root: "_root_bhiyd_13",
2885
+ input: "_input_bhiyd_27",
2886
+ control: "_control_bhiyd_40",
2887
+ indicator: "_indicator_bhiyd_55",
2888
+ label: "_label_bhiyd_107"
2889
+ }, yr = n(null);
2890
+ function br() {
2891
+ return a(yr);
2892
+ }
2893
+ function xr({ checked: e, defaultChecked: t, onCheckedChange: n, size: r = "md", invalid: i, disabled: a, required: o, id: s, name: c, value: l = "on", className: u, ariaLabel: d, children: f, onKeyDown: h, "aria-describedby": g, ...v }) {
2894
+ let y = br(), b = ee(), x = V({
2895
+ id: s,
2896
+ disabled: a,
2897
+ required: o,
2898
+ invalid: i,
2899
+ "aria-describedby": g
2900
+ }), S = String(l), C = y ? y.value === S : e, [w, T] = H({
2901
+ value: e,
2902
+ defaultValue: t,
2903
+ onChange: n,
2904
+ fallback: !1
2905
+ }), E = y ? C : w, D = y?.disabled ?? x.disabled, O = y?.invalid ?? x.invalid, k = y?.required ?? x.required, A = y?.name ?? c, j = y?.size ?? r, M = y?.describedBy ?? x["aria-describedby"];
2906
+ B({
2907
+ componentName: "Radio",
2908
+ ariaLabel: d,
2909
+ labelledBy: y ? void 0 : b?.labelId,
2910
+ hasVisibleLabel: f != null,
2911
+ disabled: D
2912
+ });
2220
2913
  function N(e) {
2221
- if (!f) switch (e.key) {
2914
+ if (y) switch (e.key) {
2915
+ case "ArrowRight":
2916
+ case "ArrowDown":
2917
+ e.preventDefault(), y.moveSelection(S, "next");
2918
+ break;
2919
+ case "ArrowLeft":
2920
+ case "ArrowUp":
2921
+ e.preventDefault(), y.moveSelection(S, "prev");
2922
+ break;
2923
+ case "Home":
2924
+ e.preventDefault(), y.moveSelection(S, "first");
2925
+ break;
2926
+ case "End":
2927
+ e.preventDefault(), y.moveSelection(S, "last");
2928
+ break;
2929
+ }
2930
+ }
2931
+ return /* @__PURE__ */ m("label", {
2932
+ "data-scope": "radio",
2933
+ "data-part": "root",
2934
+ "data-disabled": D || void 0,
2935
+ "data-invalid": O || void 0,
2936
+ className: _("owo-radio", vr.root, u),
2937
+ children: [
2938
+ /* @__PURE__ */ p("input", {
2939
+ ...v,
2940
+ ref: (e) => {
2941
+ y != null && (e ? y.registerItem({
2942
+ value: S,
2943
+ disabled: !!a,
2944
+ ref: e
2945
+ }) : y.unregisterItem(S));
2946
+ },
2947
+ id: y ? void 0 : x.id,
2948
+ type: "radio",
2949
+ name: A,
2950
+ value: l,
2951
+ checked: !!E,
2952
+ disabled: D,
2953
+ required: k,
2954
+ "aria-label": d,
2955
+ "aria-describedby": M,
2956
+ "aria-invalid": O || void 0,
2957
+ className: vr.input,
2958
+ onChange: (e) => {
2959
+ if (!D) {
2960
+ if (y) {
2961
+ y.selectValue(String(e.target.value));
2962
+ return;
2963
+ }
2964
+ T(!0);
2965
+ }
2966
+ },
2967
+ onKeyDown: (e) => {
2968
+ h?.(e), e.defaultPrevented || N(e);
2969
+ }
2970
+ }),
2971
+ /* @__PURE__ */ p("span", {
2972
+ "data-scope": "radio",
2973
+ "data-part": "control",
2974
+ "data-size": j,
2975
+ className: vr.control,
2976
+ children: /* @__PURE__ */ p("span", {
2977
+ "data-scope": "radio",
2978
+ "data-part": "indicator",
2979
+ className: vr.indicator
2980
+ })
2981
+ }),
2982
+ f != null && /* @__PURE__ */ p("span", {
2983
+ "data-scope": "radio",
2984
+ "data-part": "label",
2985
+ className: vr.label,
2986
+ children: f
2987
+ })
2988
+ ]
2989
+ });
2990
+ }
2991
+ function Sr({ value: e, defaultValue: t, onValueChange: n, options: r, size: i = "md", orientation: a = "vertical", disabled: o, required: s, invalid: c, id: d, name: f, className: m, ariaLabel: h, children: g, "aria-describedby": v }) {
2992
+ let y = ee(), [b, x] = H({
2993
+ value: e,
2994
+ defaultValue: t,
2995
+ onChange: (e) => {
2996
+ e !== void 0 && n?.(e);
2997
+ },
2998
+ fallback: void 0
2999
+ }), S = V({
3000
+ id: d,
3001
+ disabled: o,
3002
+ required: s,
3003
+ invalid: c,
3004
+ "aria-describedby": v
3005
+ });
3006
+ B({
3007
+ componentName: "RadioGroup",
3008
+ ariaLabel: h,
3009
+ labelledBy: y?.labelId,
3010
+ disabled: S.disabled
3011
+ });
3012
+ let C = u([]), w = l(() => ({
3013
+ name: f,
3014
+ value: b,
3015
+ disabled: S.disabled,
3016
+ invalid: S.invalid,
3017
+ required: S.required,
3018
+ size: i,
3019
+ orientation: a,
3020
+ describedBy: S["aria-describedby"],
3021
+ selectValue: (e) => {
3022
+ x(e);
3023
+ },
3024
+ registerItem: (e) => {
3025
+ let t = C.current.filter((t) => t.value !== e.value);
3026
+ t.push(e), C.current = t;
3027
+ },
3028
+ unregisterItem: (e) => {
3029
+ C.current = C.current.filter((t) => t.value !== e);
3030
+ },
3031
+ moveSelection: (e, t) => {
3032
+ let n = C.current.filter((e) => !e.disabled);
3033
+ if (n.length === 0) return;
3034
+ let r = n.findIndex((t) => t.value === e), i = n[0];
3035
+ t === "first" && (i = n[0]), t === "last" && (i = n[n.length - 1]), t === "next" && (i = n[r >= 0 ? (r + 1) % n.length : 0]), t === "prev" && (i = n[r >= 0 ? (r - 1 + n.length) % n.length : n.length - 1]), x(i.value), i.ref?.focus();
3036
+ }
3037
+ }), [
3038
+ S.disabled,
3039
+ S.invalid,
3040
+ S.required,
3041
+ S["aria-describedby"],
3042
+ f,
3043
+ a,
3044
+ x,
3045
+ i,
3046
+ b
3047
+ ]), T = r?.findIndex((e) => e.value === b) ?? -1, E = r?.findIndex((e) => !e.disabled) ?? -1, D = T >= 0 ? r?.[T]?.value : r?.[E]?.value, O = r?.map((e) => /* @__PURE__ */ p(xr, {
3048
+ value: e.value,
3049
+ disabled: e.disabled,
3050
+ ariaLabel: typeof e.label == "string" ? e.label : e.textValue,
3051
+ tabIndex: e.disabled || S.disabled ? -1 : D === e.value ? 0 : -1,
3052
+ children: e.label
3053
+ }, e.value));
3054
+ return /* @__PURE__ */ p(yr.Provider, {
3055
+ value: w,
3056
+ children: /* @__PURE__ */ p("div", {
3057
+ role: "radiogroup",
3058
+ id: S.id,
3059
+ "aria-label": h,
3060
+ "aria-labelledby": h ? void 0 : y?.labelId,
3061
+ "aria-describedby": S["aria-describedby"],
3062
+ "aria-invalid": S.invalid || void 0,
3063
+ "aria-required": S.required || void 0,
3064
+ "data-scope": "radio-group",
3065
+ "data-part": "group",
3066
+ "data-size": i,
3067
+ "data-orientation": a,
3068
+ "data-disabled": S.disabled || void 0,
3069
+ "data-invalid": S.invalid || void 0,
3070
+ className: _("owo-radio-group", vr.group, m),
3071
+ children: r ? O : g
3072
+ })
3073
+ });
3074
+ }
3075
+ var Cr = {
3076
+ root: "_root_c2l0v_1",
3077
+ item: "_item_c2l0v_41"
3078
+ };
3079
+ //#endregion
3080
+ //#region src/components/SegmentedControl.tsx
3081
+ function wr({ value: e, defaultValue: t, onValueChange: n, options: r, size: i = "md", disabled: a, required: o, invalid: s, id: c, name: l, className: d, ariaLabel: f, "aria-describedby": h }) {
3082
+ let g = ee(), [v, y] = H({
3083
+ value: e,
3084
+ defaultValue: t,
3085
+ onChange: n,
3086
+ fallback: r.find((e) => !e.disabled)?.value ?? r[0]?.value ?? ""
3087
+ }), b = V({
3088
+ id: c,
3089
+ disabled: a,
3090
+ required: o,
3091
+ invalid: s,
3092
+ "aria-describedby": h
3093
+ });
3094
+ B({
3095
+ componentName: "SegmentedControl",
3096
+ ariaLabel: f,
3097
+ labelledBy: g?.labelId,
3098
+ disabled: b.disabled
3099
+ });
3100
+ let x = u([]), S = r.reduce((e, t, n) => (!t.disabled && !b.disabled && e.push(n), e), []), C = r.findIndex((e) => e.value === v), w = C >= 0 && !r[C]?.disabled ? C : -1, T = w >= 0 ? w : S[0] ?? -1, E = w >= 0 ? v : void 0;
3101
+ function D(e, t) {
3102
+ if (S.length === 0) return;
3103
+ let n = S.indexOf(e), i;
3104
+ t === "first" && (i = S[0]), t === "last" && (i = S[S.length - 1]), t === "next" && (i = n >= 0 ? S[(n + 1) % S.length] : S[0]), t === "prev" && (i = n >= 0 ? S[(n - 1 + S.length) % S.length] : S[S.length - 1]), i !== void 0 && (y(r[i].value), x.current[i]?.focus());
3105
+ }
3106
+ return /* @__PURE__ */ m("div", {
3107
+ role: "radiogroup",
3108
+ id: b.id,
3109
+ "aria-label": f,
3110
+ "aria-labelledby": f ? void 0 : g?.labelId,
3111
+ "aria-describedby": b["aria-describedby"],
3112
+ "aria-invalid": b.invalid || void 0,
3113
+ "aria-required": b.required || void 0,
3114
+ "data-size": i,
3115
+ "data-disabled": b.disabled || void 0,
3116
+ "data-invalid": b.invalid || void 0,
3117
+ className: _("owo-segmented-control", Cr.root, d),
3118
+ children: [r.map((e, t) => {
3119
+ let n = e.value === v, r = e.disabled || b.disabled;
3120
+ return /* @__PURE__ */ p("button", {
3121
+ ref: (e) => {
3122
+ x.current[t] = e;
3123
+ },
3124
+ type: "button",
3125
+ role: "radio",
3126
+ "aria-checked": n,
3127
+ disabled: r,
3128
+ tabIndex: r ? -1 : t === T ? 0 : -1,
3129
+ "data-disabled": r || void 0,
3130
+ "data-active": n ? "true" : void 0,
3131
+ className: Cr.item,
3132
+ onClick: () => y(e.value),
3133
+ onKeyDown: (e) => {
3134
+ if (!r) switch (e.key) {
3135
+ case "ArrowRight":
3136
+ case "ArrowDown":
3137
+ e.preventDefault(), D(t, "next");
3138
+ break;
3139
+ case "ArrowLeft":
3140
+ case "ArrowUp":
3141
+ e.preventDefault(), D(t, "prev");
3142
+ break;
3143
+ case "Home":
3144
+ e.preventDefault(), D(t, "first");
3145
+ break;
3146
+ case "End":
3147
+ e.preventDefault(), D(t, "last");
3148
+ break;
3149
+ }
3150
+ },
3151
+ children: e.label
3152
+ }, e.value);
3153
+ }), l != null && E !== void 0 && /* @__PURE__ */ p("input", {
3154
+ type: "hidden",
3155
+ name: l,
3156
+ value: E,
3157
+ disabled: b.disabled,
3158
+ "aria-hidden": "true"
3159
+ })]
3160
+ });
3161
+ }
3162
+ var Tr = {
3163
+ root: "_root_11cvf_1",
3164
+ nativeControl: "_nativeControl_11cvf_6",
3165
+ valueText: "_valueText_11cvf_109",
3166
+ placeholder: "_placeholder_11cvf_115"
3167
+ }, Er = "";
3168
+ function Dr(e) {
3169
+ return e.textValue ? e.textValue : typeof e.label == "string" ? e.label : "";
3170
+ }
3171
+ function Or({ value: e, defaultValue: t, onValueChange: n, open: r, defaultOpen: a = !1, onOpenChange: c, options: f, placeholder: h = "Select…", size: g = "md", tone: v = "default", disabled: y, required: b, invalid: x, id: S, name: C, className: w, ariaLabel: T, "aria-describedby": E, renderValue: D, renderOption: O, classNames: k }) {
3172
+ let A = ee(), j = e !== void 0, M = e === null ? Er : e ?? void 0, [N, P] = H({
3173
+ value: M === void 0 ? void 0 : M,
3174
+ defaultValue: t ?? Er,
3175
+ onChange: (e) => {
3176
+ n?.(e === "" ? void 0 : e);
3177
+ },
3178
+ fallback: Er,
3179
+ isControlled: j
3180
+ }), F = V({
3181
+ id: S,
3182
+ disabled: y,
3183
+ required: b,
3184
+ invalid: x,
3185
+ "aria-describedby": E
3186
+ }), I = F.disabled;
3187
+ B({
3188
+ componentName: "Select",
3189
+ ariaLabel: T,
3190
+ labelledBy: A?.labelId,
3191
+ disabled: I
3192
+ });
3193
+ let [L, R] = H({
3194
+ value: r,
3195
+ defaultValue: a,
3196
+ onChange: c,
3197
+ fallback: !1,
3198
+ isControlled: r !== void 0
3199
+ }), [z, U] = d(-1), te = u(null), W = u(null), G = s(), K = f.find((e) => e.value === N), ne = K ? N : Er, q = K ? Dr(K) : "", J = l(() => f.reduce((e, t, n) => (t.disabled || e.push(n), e), []), [f]), Y = i(() => {
3200
+ if (I || f.length === 0) return;
3201
+ R(!0);
3202
+ let e = f.findIndex((e) => e.value === N);
3203
+ U(e >= 0 ? e : J[0] ?? -1);
3204
+ }, [
3205
+ I,
3206
+ f,
3207
+ N,
3208
+ J
3209
+ ]), X = i(() => {
3210
+ R(!1), U(-1);
3211
+ }, []), re = i((e) => {
3212
+ e.disabled || (P(e.value), X());
3213
+ }, [P, X]);
3214
+ o(() => {
3215
+ if (!L) return;
3216
+ function e(e) {
3217
+ te.current && !te.current.contains(e.target) && X();
3218
+ }
3219
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
3220
+ }, [L, X]), o(() => {
3221
+ !L || z < 0 || (W.current?.children[z])?.scrollIntoView?.({ block: "nearest" });
3222
+ }, [L, z]);
3223
+ function ie(e) {
3224
+ if (!I) switch (e.key) {
2222
3225
  case "Enter":
2223
3226
  case " ":
2224
- e.preventDefault(), x ? C >= 0 && n[C] && !n[C].disabled && M(n[C]) : A();
3227
+ e.preventDefault(), L ? z >= 0 && f[z] && !f[z].disabled && re(f[z]) : Y();
2225
3228
  break;
2226
3229
  case "ArrowDown":
2227
- if (e.preventDefault(), !x) A();
3230
+ if (e.preventDefault(), !L) Y();
2228
3231
  else {
2229
- let e = k[k.indexOf(C) + 1];
2230
- e !== void 0 && w(e);
3232
+ let e = J[J.indexOf(z) + 1];
3233
+ e !== void 0 && U(e);
2231
3234
  }
2232
3235
  break;
2233
3236
  case "ArrowUp":
2234
- if (e.preventDefault(), !x) A();
3237
+ if (e.preventDefault(), !L) Y();
2235
3238
  else {
2236
- let e = k[k.indexOf(C) - 1];
2237
- e !== void 0 && w(e);
3239
+ let e = J[J.indexOf(z) - 1];
3240
+ e !== void 0 && U(e);
2238
3241
  }
2239
3242
  break;
2240
3243
  case "Escape":
2241
- x && (e.preventDefault(), j());
3244
+ L && (e.preventDefault(), X());
2242
3245
  break;
2243
3246
  case "Tab":
2244
- x && j();
3247
+ L && X();
2245
3248
  break;
2246
3249
  }
2247
3250
  }
2248
- let ee = e !== "" && O, P = v ? v({
2249
- open: x,
2250
- placeholder: r,
2251
- selectedOption: O
3251
+ let ae = N !== Er && K, oe = ae ? K.label : null, se = D ? D({
3252
+ open: L,
3253
+ placeholder: h,
3254
+ selectedOption: K
2252
3255
  }) : /* @__PURE__ */ p("span", {
2253
- className: _(Bn.valueText, !ee && Bn.placeholder),
2254
- children: ee ? O.label : r
3256
+ className: _(Tr.valueText, !ae && Tr.placeholder),
3257
+ children: ae ? oe : h
2255
3258
  });
2256
3259
  return /* @__PURE__ */ m("div", {
2257
- ref: T,
2258
- "data-state": x ? "open" : "closed",
2259
- "data-disabled": f || void 0,
2260
- "data-size": a,
2261
- "data-tone": c,
3260
+ ref: te,
3261
+ "data-state": L ? "open" : "closed",
3262
+ "data-disabled": I || void 0,
3263
+ "data-invalid": F.invalid || void 0,
3264
+ "data-size": g,
3265
+ "data-tone": v,
2262
3266
  "data-scope": "select",
2263
- className: _("owo-select", Bn.root, h),
2264
- children: [/* @__PURE__ */ m("button", {
2265
- type: "button",
2266
- role: "combobox",
2267
- "aria-expanded": x,
2268
- "aria-haspopup": "listbox",
2269
- "aria-controls": D,
2270
- "aria-label": g,
2271
- "aria-activedescendant": x && C >= 0 ? `${D}-opt-${C}` : void 0,
2272
- "data-state": x ? "open" : "closed",
2273
- "data-disabled": f || void 0,
2274
- "data-tone": c,
2275
- "data-size": a,
2276
- "data-has-value": ee || void 0,
2277
- "data-scope": "select",
2278
- "data-part": "trigger",
2279
- disabled: f,
2280
- className: _(b?.trigger),
2281
- onClick: () => x ? j() : A(),
2282
- onKeyDown: N,
2283
- children: [P, /* @__PURE__ */ p("svg", {
2284
- "aria-hidden": "true",
2285
- "data-state": x ? "open" : "closed",
3267
+ className: _("owo-select", Tr.root, w),
3268
+ children: [
3269
+ /* @__PURE__ */ m("button", {
3270
+ type: "button",
3271
+ role: "combobox",
3272
+ id: F.id,
3273
+ "aria-expanded": L,
3274
+ "aria-haspopup": "listbox",
3275
+ "aria-controls": G,
3276
+ "aria-label": T,
3277
+ "aria-describedby": F["aria-describedby"],
3278
+ "aria-invalid": F.invalid || void 0,
3279
+ "aria-required": F.required || void 0,
3280
+ "aria-activedescendant": L && z >= 0 ? `${G}-opt-${z}` : void 0,
3281
+ "data-state": L ? "open" : "closed",
3282
+ "data-disabled": I || void 0,
3283
+ "data-tone": v,
3284
+ "data-size": g,
3285
+ "data-has-value": ae || void 0,
2286
3286
  "data-scope": "select",
2287
- "data-part": "chevron",
2288
- className: _(b?.chevron),
2289
- viewBox: "0 0 16 16",
2290
- fill: "none",
2291
- stroke: "currentColor",
2292
- strokeWidth: "2",
2293
- strokeLinecap: "round",
2294
- strokeLinejoin: "round",
2295
- children: /* @__PURE__ */ p("path", { d: "M4 6l4 4 4-4" })
2296
- })]
2297
- }), x && /* @__PURE__ */ p("ul", {
2298
- ref: E,
2299
- id: D,
2300
- role: "listbox",
2301
- "aria-label": g,
2302
- "data-state": "open",
2303
- "data-size": a,
2304
- "data-scope": "select",
2305
- "data-part": "dropdown",
2306
- className: _(b?.dropdown),
2307
- children: n.map((t, n) => /* @__PURE__ */ p("li", {
2308
- id: `${D}-opt-${n}`,
2309
- role: "option",
2310
- "aria-selected": t.value === e,
2311
- "aria-disabled": t.disabled || void 0,
2312
- "data-state": t.value === e ? "selected" : n === C ? "highlighted" : "idle",
2313
- "data-focused": n === C || void 0,
2314
- "data-selected": t.value === e || void 0,
2315
- "data-disabled": t.disabled || void 0,
2316
- "data-highlighted": n === C || void 0,
3287
+ "data-part": "trigger",
3288
+ disabled: I,
3289
+ className: _(k?.trigger),
3290
+ onClick: () => L ? X() : Y(),
3291
+ onKeyDown: ie,
3292
+ children: [se, /* @__PURE__ */ p("svg", {
3293
+ "aria-hidden": "true",
3294
+ "data-state": L ? "open" : "closed",
3295
+ "data-scope": "select",
3296
+ "data-part": "chevron",
3297
+ className: _(k?.chevron),
3298
+ viewBox: "0 0 16 16",
3299
+ fill: "none",
3300
+ stroke: "currentColor",
3301
+ strokeWidth: "2",
3302
+ strokeLinecap: "round",
3303
+ strokeLinejoin: "round",
3304
+ children: /* @__PURE__ */ p("path", { d: "M4 6l4 4 4-4" })
3305
+ })]
3306
+ }),
3307
+ L && /* @__PURE__ */ p("ul", {
3308
+ ref: W,
3309
+ id: G,
3310
+ role: "listbox",
3311
+ "aria-label": T ?? (q || h),
3312
+ "data-state": "open",
3313
+ "data-size": g,
2317
3314
  "data-scope": "select",
2318
- "data-part": "option",
2319
- className: _(b?.option),
2320
- onClick: () => M(t),
2321
- onMouseEnter: () => !t.disabled && w(n),
2322
- children: y ? y({
2323
- option: t,
2324
- index: n,
2325
- selected: t.value === e,
2326
- highlighted: n === C
2327
- }) : t.label
2328
- }, t.value))
2329
- })]
3315
+ "data-part": "dropdown",
3316
+ className: _(k?.dropdown),
3317
+ children: f.map((e, t) => /* @__PURE__ */ p("li", {
3318
+ id: `${G}-opt-${t}`,
3319
+ role: "option",
3320
+ "aria-selected": e.value === N,
3321
+ "aria-disabled": e.disabled || void 0,
3322
+ "data-state": e.value === N ? "selected" : t === z ? "highlighted" : "idle",
3323
+ "data-focused": t === z || void 0,
3324
+ "data-selected": e.value === N || void 0,
3325
+ "data-disabled": e.disabled || void 0,
3326
+ "data-highlighted": t === z || void 0,
3327
+ "data-scope": "select",
3328
+ "data-part": "option",
3329
+ className: _(k?.option),
3330
+ onClick: () => re(e),
3331
+ onMouseEnter: () => !e.disabled && U(t),
3332
+ children: O ? O({
3333
+ option: e,
3334
+ index: t,
3335
+ selected: e.value === N,
3336
+ highlighted: t === z
3337
+ }) : e.label
3338
+ }, e.value))
3339
+ }),
3340
+ (C != null || F.required) && /* @__PURE__ */ m("select", {
3341
+ tabIndex: -1,
3342
+ "aria-hidden": "true",
3343
+ "data-native-control": "true",
3344
+ className: Tr.nativeControl,
3345
+ name: K ? C : void 0,
3346
+ value: ne,
3347
+ disabled: I,
3348
+ required: F.required,
3349
+ onChange: () => {},
3350
+ children: [/* @__PURE__ */ p("option", { value: Er }), f.map((e) => /* @__PURE__ */ p("option", {
3351
+ value: e.value,
3352
+ disabled: e.disabled,
3353
+ children: Dr(e)
3354
+ }, e.value))]
3355
+ })
3356
+ ]
2330
3357
  });
2331
3358
  }
2332
- var Hn = {
3359
+ var kr = {
2333
3360
  root: "_root_1sshx_1",
2334
3361
  "owo-skeleton-breathe": "_owo-skeleton-breathe_1sshx_1",
2335
3362
  "owo-skeleton-scan": "_owo-skeleton-scan_1sshx_1"
2336
- }, Un = {
3363
+ }, Ar = {
2337
3364
  slow: "4s",
2338
3365
  medium: "3s",
2339
3366
  fast: "2s"
2340
3367
  };
2341
- function Wn({ className: e, animation: t = "scan", tone: n = "default", speed: r = "medium", style: i, ...a }) {
3368
+ function jr({ className: e, animation: t = "scan", tone: n = "default", speed: r = "medium", style: i, ...a }) {
2342
3369
  let o = n === "warm" ? "emphasis" : n, s = {
2343
3370
  ...i,
2344
- "--_owo-skeleton-scan-duration": Un[r]
3371
+ "--_owo-skeleton-scan-duration": Ar[r]
2345
3372
  };
2346
3373
  return /* @__PURE__ */ p("div", {
2347
- className: _("owo-skeleton", Hn.root, e),
3374
+ className: _("owo-skeleton", kr.root, e),
2348
3375
  "data-animation": t,
2349
3376
  "data-tone": o,
2350
3377
  "aria-hidden": "true",
@@ -2352,7 +3379,7 @@ function Wn({ className: e, animation: t = "scan", tone: n = "default", speed: r
2352
3379
  ...a
2353
3380
  });
2354
3381
  }
2355
- var $ = {
3382
+ var Mr = {
2356
3383
  root: "_root_h4455_1",
2357
3384
  withIcon: "_withIcon_h4455_19",
2358
3385
  icon: "_icon_h4455_25",
@@ -2363,32 +3390,33 @@ var $ = {
2363
3390
  };
2364
3391
  //#endregion
2365
3392
  //#region src/components/StatusNotice.tsx
2366
- function Gn({ tone: e = "neutral", layout: t = "horizontal", icon: n, title: r, description: i, action: a, className: o, children: s, classNames: c, ...l }) {
3393
+ function Nr({ tone: e = "neutral", layout: t = "horizontal", icon: n, title: r, description: i, action: a, className: o, children: s, classNames: c, ...l }) {
3394
+ let u = i ?? s;
2367
3395
  if (t === "vertical") {
2368
3396
  let t = n || r || i || a;
2369
3397
  return /* @__PURE__ */ p("div", {
2370
3398
  "data-tone": e,
2371
3399
  "data-layout": "vertical",
2372
- className: _("owo-status-notice", $.root, o),
3400
+ className: _("owo-status-notice", Mr.root, o),
2373
3401
  ...l,
2374
3402
  children: /* @__PURE__ */ p("div", {
2375
3403
  "data-part": "body",
2376
- className: _($.body, c?.body),
3404
+ className: _(Mr.body, c?.body),
2377
3405
  children: t ? /* @__PURE__ */ m(f, { children: [
2378
3406
  n ? /* @__PURE__ */ p("div", {
2379
3407
  "data-part": "icon",
2380
- className: _($.icon, c?.icon),
3408
+ className: _(Mr.icon, c?.icon),
2381
3409
  children: n
2382
3410
  }) : null,
2383
3411
  r ? /* @__PURE__ */ p("div", {
2384
3412
  "data-part": "title",
2385
- className: _($.title, c?.title),
3413
+ className: _(Mr.title, c?.title),
2386
3414
  children: r
2387
3415
  }) : null,
2388
- i ? /* @__PURE__ */ p("div", { children: i }) : s,
3416
+ i == null ? s : /* @__PURE__ */ p("div", { children: i }),
2389
3417
  a ? /* @__PURE__ */ p("div", {
2390
3418
  "data-part": "action",
2391
- className: _($.action, c?.action),
3419
+ className: _(Mr.action, c?.action),
2392
3420
  children: a
2393
3421
  }) : null
2394
3422
  ] }) : s
@@ -2397,112 +3425,840 @@ function Gn({ tone: e = "neutral", layout: t = "horizontal", icon: n, title: r,
2397
3425
  }
2398
3426
  return /* @__PURE__ */ m("div", {
2399
3427
  "data-tone": e,
2400
- className: _("owo-status-notice", $.root, n && $.withIcon, o),
3428
+ className: _("owo-status-notice", Mr.root, n && Mr.withIcon, o),
2401
3429
  ...l,
2402
3430
  children: [n ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
2403
3431
  "data-part": "icon",
2404
- className: _($.icon, c?.icon),
3432
+ className: _(Mr.icon, c?.icon),
2405
3433
  "aria-hidden": "true",
2406
3434
  children: n
2407
3435
  }), /* @__PURE__ */ m("div", {
2408
3436
  "data-part": "body",
2409
- className: _($.text, c?.body),
3437
+ className: _(Mr.text, c?.body),
2410
3438
  children: [r ? /* @__PURE__ */ p("div", {
2411
3439
  "data-part": "title",
2412
- className: _($.title, c?.title),
3440
+ className: _(Mr.title, c?.title),
2413
3441
  children: r
2414
- }) : null, s]
3442
+ }) : null, u]
2415
3443
  })] }) : /* @__PURE__ */ m("div", {
2416
3444
  "data-part": "body",
2417
3445
  className: _(c?.body),
2418
3446
  children: [r ? /* @__PURE__ */ p("div", {
2419
3447
  "data-part": "title",
2420
- className: _($.title, c?.title),
3448
+ className: _(Mr.title, c?.title),
2421
3449
  children: r
2422
- }) : null, s]
3450
+ }) : null, u]
2423
3451
  }), a ? /* @__PURE__ */ p("div", {
2424
3452
  "data-part": "action",
2425
- className: _($.action, c?.action),
3453
+ className: _(Mr.action, c?.action),
2426
3454
  children: a
2427
3455
  }) : null]
2428
3456
  });
2429
3457
  }
2430
- var Kn = {
2431
- root: "_root_1qzgu_1",
2432
- thumb: "_thumb_1qzgu_81"
3458
+ var Pr = {
3459
+ root: "_root_91dlh_1",
3460
+ thumb: "_thumb_91dlh_81"
2433
3461
  };
2434
3462
  //#endregion
2435
3463
  //#region src/components/Switch.tsx
2436
- function qn({ checked: e, onChange: t, size: n = "md", disabled: r = !1, className: i, ariaLabel: a }) {
2437
- return /* @__PURE__ */ p("button", {
3464
+ function Fr({ checked: e, defaultChecked: t, onCheckedChange: n, size: r = "md", disabled: i, required: a, invalid: o, id: s, name: c, className: l, ariaLabel: u, "aria-describedby": d }) {
3465
+ let f = ee(), [h, g] = H({
3466
+ value: e,
3467
+ defaultValue: t,
3468
+ onChange: n,
3469
+ fallback: !1
3470
+ }), v = V({
3471
+ id: s,
3472
+ disabled: i,
3473
+ required: a,
3474
+ invalid: o,
3475
+ "aria-describedby": d
3476
+ });
3477
+ return B({
3478
+ componentName: "Switch",
3479
+ ariaLabel: u,
3480
+ labelledBy: f?.labelId,
3481
+ disabled: v.disabled
3482
+ }), /* @__PURE__ */ m("button", {
2438
3483
  type: "button",
2439
3484
  role: "switch",
2440
- "aria-checked": e,
2441
- "aria-label": a,
2442
- disabled: r,
2443
- "data-size": n,
2444
- className: _("owo-switch", Kn.root, i),
2445
- onClick: () => t(!e),
2446
- children: /* @__PURE__ */ p("span", {
3485
+ id: v.id,
3486
+ "aria-checked": h,
3487
+ "aria-label": u,
3488
+ "aria-describedby": v["aria-describedby"],
3489
+ "aria-invalid": v.invalid || void 0,
3490
+ "aria-required": v.required || void 0,
3491
+ disabled: v.disabled,
3492
+ "data-size": r,
3493
+ "data-invalid": v.invalid || void 0,
3494
+ className: _("owo-switch", Pr.root, l),
3495
+ onClick: () => g(!h),
3496
+ children: [/* @__PURE__ */ p("span", {
2447
3497
  "aria-hidden": "true",
2448
- className: Kn.thumb
3498
+ className: Pr.thumb
3499
+ }), c != null && /* @__PURE__ */ p("input", {
3500
+ type: "checkbox",
3501
+ name: c,
3502
+ checked: h,
3503
+ disabled: v.disabled,
3504
+ hidden: !0,
3505
+ readOnly: !0,
3506
+ tabIndex: -1,
3507
+ "aria-hidden": "true"
3508
+ })]
3509
+ });
3510
+ }
3511
+ var $ = {
3512
+ root: "_root_8sfay_1",
3513
+ table: "_table_8sfay_10",
3514
+ header: "_header_8sfay_14",
3515
+ headerSticky: "_headerSticky_8sfay_19",
3516
+ body: "_body_8sfay_25",
3517
+ row: "_row_8sfay_31",
3518
+ stateRow: "_stateRow_8sfay_46",
3519
+ cell: "_cell_8sfay_50",
3520
+ headerCell: "_headerCell_8sfay_70",
3521
+ headerLabel: "_headerLabel_8sfay_76",
3522
+ headerSortButton: "_headerSortButton_8sfay_81",
3523
+ selectionCell: "_selectionCell_8sfay_105",
3524
+ sortIndicator: "_sortIndicator_8sfay_113",
3525
+ resizeHandle: "_resizeHandle_8sfay_117",
3526
+ loadingState: "_loadingState_8sfay_153",
3527
+ stateCell: "_stateCell_8sfay_157",
3528
+ skeletonStack: "_skeletonStack_8sfay_161",
3529
+ skeletonCell: "_skeletonCell_8sfay_166",
3530
+ empty: "_empty_8sfay_175"
3531
+ }, Ir = ["asc", "desc"], Lr = 72, Rr = 16;
3532
+ function zr(e, t) {
3533
+ if (e.size !== t.size) return !1;
3534
+ for (let n of e) if (!t.has(n)) return !1;
3535
+ return !0;
3536
+ }
3537
+ function Br(e, t, n) {
3538
+ return typeof e.accessor == "function" ? e.accessor(t, n) : e.accessor ? t[e.accessor] : t[e.key];
3539
+ }
3540
+ function Vr(e, t) {
3541
+ return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : typeof e == "boolean" && typeof t == "boolean" ? Number(e) - Number(t) : String(e).localeCompare(String(t), void 0, {
3542
+ numeric: !0,
3543
+ sensitivity: "base"
3544
+ });
3545
+ }
3546
+ function Hr(e, t, n) {
3547
+ if (e === "single") return new Set(t.has(n) ? [] : [n]);
3548
+ let r = new Set(t);
3549
+ return r.has(n) ? r.delete(n) : r.add(n), r;
3550
+ }
3551
+ function Ur(e, t) {
3552
+ return e ? t === "ternary" && e === "desc" ? null : Ir[(Ir.indexOf(e) + 1) % Ir.length] : Ir[0];
3553
+ }
3554
+ function Wr(e, t) {
3555
+ if (t.length === 0) return /* @__PURE__ */ new Set();
3556
+ let n = new Set(t), r = new Set(Array.from(e ?? t).filter((e) => n.has(e)));
3557
+ return r.size === 0 && r.add(t[0]), r;
3558
+ }
3559
+ function Gr({ type: e, checked: t, label: n, indeterminate: r = !1, disabled: i = !1, className: a, part: o, name: s, onChange: c, onClick: l }) {
3560
+ return /* @__PURE__ */ p("input", {
3561
+ type: e,
3562
+ name: s,
3563
+ checked: t,
3564
+ disabled: i,
3565
+ "aria-label": n,
3566
+ "aria-checked": e === "checkbox" && r ? "mixed" : void 0,
3567
+ "data-scope": "table",
3568
+ "data-part": o,
3569
+ className: a,
3570
+ ref: (t) => {
3571
+ t && e === "checkbox" && (t.indeterminate = r);
3572
+ },
3573
+ onChange: c,
3574
+ onClick: l
3575
+ });
3576
+ }
3577
+ function Kr({ columns: e, data: t, visibleColumnKeys: n, defaultVisibleColumnKeys: r, columnWidths: i, defaultColumnWidths: a, onColumnWidthsChange: s, getRowId: f, selectionMode: h, selectedRows: g, defaultSelectedRows: v, onSelectionChange: y, sort: b, defaultSort: x = null, onSort: S, onSortChange: C, sortCycle: w = "binary", getSortButtonAriaLabel: T, selectionColumnAriaLabel: E = "Row selection", getRowSelectionAriaLabel: D, getSelectAllAriaLabel: O, isRowSelectable: k, rowHeight: A = "default", stickyHeader: j = !1, virtualized: M = !1, loading: N = !1, loadingState: P, skeletonRows: F = 5, emptyState: I, className: L, classNames: R }) {
3578
+ let [z, ee] = d(r ? new Set(r) : null), [B, V] = d(a ?? {}), [H, U] = d(v ?? /* @__PURE__ */ new Set()), [te, W] = d(x), [G, K] = d(0), [ne, q] = d(0), J = n !== void 0, Y = i !== void 0, X = g !== void 0, re = b !== void 0, ie = !!h, ae = u(null), oe = u(/* @__PURE__ */ new Map()), se = u(!1), ce = u(e.map((e) => e.key)), le = u(null), ue = l(() => e.map((e) => e.key), [e]), de = l(() => Wr(J ? n : z, ue), [
3579
+ ue,
3580
+ z,
3581
+ n,
3582
+ J
3583
+ ]), fe = l(() => e.filter((e) => de.has(e.key)), [de, e]), pe = Y ? i : B, me = u(pe);
3584
+ me.current = pe;
3585
+ let he = u(Y);
3586
+ he.current = Y;
3587
+ let ge = u(s);
3588
+ ge.current = s;
3589
+ let _e = X ? g : H, ve = re ? b ?? null : te, Z = ve && de.has(ve.key) ? ve : null, ye = l(() => {
3590
+ if (!Z) return t;
3591
+ let n = e.find((e) => e.key === Z.key);
3592
+ return n ? t.map((e, t) => ({
3593
+ row: e,
3594
+ index: t,
3595
+ sortValue: Br(n, e, t)
3596
+ })).sort((e, t) => {
3597
+ let r = n.compare ? n.compare(e.row, t.row, e.index, t.index) : Vr(e.sortValue, t.sortValue);
3598
+ return r === 0 ? e.index - t.index : Z.direction === "asc" ? r : -r;
3599
+ }).map((e) => e.row) : t;
3600
+ }, [
3601
+ e,
3602
+ t,
3603
+ Z
3604
+ ]), be = A === "compact" ? 36 : 44, xe = typeof M == "object" ? M : void 0, Q = !!M, Se = xe?.height ?? 320, Ce = xe?.overscan ?? 4, we = l(() => {
3605
+ let e = fe.map((e) => {
3606
+ let t = pe[e.key];
3607
+ return t == null ? e.width == null ? "minmax(0, 1fr)" : typeof e.width == "number" ? `${e.width}px` : e.width : `${t}px`;
3608
+ });
3609
+ return h && e.unshift("2.75rem"), e.join(" ");
3610
+ }, [
3611
+ pe,
3612
+ h,
3613
+ fe
3614
+ ]), Te = ye.length * be, Ee = Q ? Math.ceil(Se / be) + Ce * 2 : ye.length, De = Q ? Math.max(0, Math.floor(G / be) - Ce) : 0, Oe = Q ? Math.min(ye.length, De + Ee) : ye.length, ke = ye.slice(De, Oe), Ae = Q ? De * be : 0, je = Q ? Math.max(0, Te - Ae - ke.length * be) : 0, Me = ye.flatMap((e, t) => h && k && !k(e, t) ? [] : [f?.(e, t) ?? String(e.id ?? t)]), Ne = h === "multiple" && Me.length > 0 && Me.every((e) => _e.has(e)), Pe = h === "multiple" ? Me.filter((e) => _e.has(e)).length : 0, Fe = h === "multiple" && Pe > 0 && !Ne, Ie = fe.length + (h ? 1 : 0), Le = N ? P ? 2 : F + 1 : ye.length === 0 ? 2 : ye.length + 1, Re = ie ? "gridcell" : "cell", ze = l(() => h ? ye.flatMap((e, t) => !k || k(e, t) ? [t] : []) : [], [
3615
+ k,
3616
+ h,
3617
+ ye
3618
+ ]), Be = l(() => ye.map((e, t) => f?.(e, t) ?? String(e.id ?? t)), [f, ye]), Ve = ze[0] ?? null, He = Ve == null ? null : Be[Ve] ?? null, [Ue, We] = d(He), Ge = Ue == null ? null : Be.indexOf(Ue);
3619
+ o(() => {
3620
+ if (J) return;
3621
+ let e = new Set(ce.current), t = Wr(z, ue), n = new Set(t);
3622
+ ue.forEach((t) => {
3623
+ e.has(t) || n.add(t);
3624
+ }), n.size === 0 && ue[0] && n.add(ue[0]), ce.current = ue, zr(n, t) || ee(n);
3625
+ }, [
3626
+ ue,
3627
+ z,
3628
+ J
3629
+ ]), o(() => {
3630
+ if (Y) return;
3631
+ let e = new Set(ue), t = Object.fromEntries(Object.entries(B).filter(([t]) => e.has(t)));
3632
+ Object.keys(t).length !== Object.keys(B).length && (V(t), s?.(t));
3633
+ }, [
3634
+ ue,
3635
+ Y,
3636
+ s,
3637
+ B
3638
+ ]), o(() => {
3639
+ We((e) => {
3640
+ if (He == null) return null;
3641
+ if (e == null) return He;
3642
+ let t = Be.indexOf(e);
3643
+ return t === -1 || !ze.includes(t) ? He : e;
3644
+ });
3645
+ }, [
3646
+ He,
3647
+ ze,
3648
+ Be
3649
+ ]), o(() => {
3650
+ ve && !de.has(ve.key) && !re && (W(null), C?.(null), S?.(ve.key, null));
3651
+ }, [
3652
+ ve,
3653
+ de,
3654
+ S,
3655
+ C,
3656
+ re
3657
+ ]), o(() => {
3658
+ if (X || !h) return;
3659
+ let e = new Set(Be), t = new Set(Array.from(H).filter((t) => e.has(t)));
3660
+ zr(t, H) || (U(t), y?.(t));
3661
+ }, [
3662
+ y,
3663
+ Be,
3664
+ X,
3665
+ h,
3666
+ H
3667
+ ]), o(() => {
3668
+ if (!h || Ge == null || !se.current) return;
3669
+ if (Q && (Ge < De || Ge >= Oe)) {
3670
+ Ze(Ge);
3671
+ return;
3672
+ }
3673
+ let e = oe.current.get(Ge);
3674
+ e && document.activeElement !== e && !e.contains(document.activeElement) && e.focus();
3675
+ }, [
3676
+ Ge,
3677
+ h,
3678
+ De,
3679
+ Oe,
3680
+ Q
3681
+ ]), c(() => {
3682
+ if (!Q || !ae.current) {
3683
+ q(0);
3684
+ return;
3685
+ }
3686
+ let e = ae.current, t = () => {
3687
+ q(e.offsetWidth - e.clientWidth);
3688
+ };
3689
+ t();
3690
+ let n = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
3691
+ return n?.observe(e), window.addEventListener("resize", t), () => {
3692
+ n?.disconnect(), window.removeEventListener("resize", t);
3693
+ };
3694
+ }, [
3695
+ Q,
3696
+ Se,
3697
+ ye.length
3698
+ ]), o(() => {
3699
+ let e = (e) => {
3700
+ let t = le.current;
3701
+ if (!t) return;
3702
+ let n = Math.max(t.minWidth, Math.round(t.startWidth + e.clientX - t.startX)), r = {
3703
+ ...me.current,
3704
+ [t.columnKey]: n
3705
+ };
3706
+ he.current || V(r), ge.current?.(r);
3707
+ }, t = () => {
3708
+ le.current = null, document.body.style.cursor = "", document.body.style.userSelect = "";
3709
+ };
3710
+ return window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), () => {
3711
+ window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t);
3712
+ };
3713
+ }, []), o(() => () => {
3714
+ le.current = null, document.body.style.cursor = "", document.body.style.userSelect = "";
3715
+ }, []);
3716
+ let Ke = (e) => {
3717
+ X || U(e), y?.(e);
3718
+ }, qe = (e) => {
3719
+ re || W(e), C?.(e), S?.(e?.key ?? Z?.key ?? ve?.key ?? "", e?.direction ?? null);
3720
+ }, Je = (e) => {
3721
+ let t = Ur(Z?.key === e ? Z.direction : void 0, w);
3722
+ qe(t ? {
3723
+ key: e,
3724
+ direction: t
3725
+ } : null);
3726
+ }, Ye = () => {
3727
+ if (h !== "multiple" || Me.length === 0) return;
3728
+ let e = new Set(_e);
3729
+ Ne ? Me.forEach((t) => {
3730
+ e.delete(t);
3731
+ }) : Me.forEach((t) => {
3732
+ e.add(t);
3733
+ }), zr(e, _e) || Ke(e);
3734
+ }, Xe = (e, t) => {
3735
+ let n = {
3736
+ ...pe,
3737
+ [e]: t
3738
+ };
3739
+ Y || V(n), s?.(n);
3740
+ }, Ze = (e) => {
3741
+ if (We(Be[e] ?? null), !Q) return;
3742
+ let t = e * be, n = t + be, r = ae.current?.scrollTop ?? G, i = r + Se;
3743
+ if (t < r) {
3744
+ ae.current?.scrollTo?.({ top: t }), K(t);
3745
+ return;
3746
+ }
3747
+ if (n > i) {
3748
+ let e = Math.max(0, n - Se);
3749
+ ae.current?.scrollTo?.({ top: e }), K(e);
3750
+ }
3751
+ }, Qe = (e, t) => {
3752
+ e.preventDefault(), e.stopPropagation();
3753
+ let n = e.currentTarget.closest("[role=\"columnheader\"]");
3754
+ n instanceof HTMLElement && (le.current = {
3755
+ columnKey: t.key,
3756
+ minWidth: t.minWidth ?? Lr,
3757
+ startX: e.clientX,
3758
+ startWidth: pe[t.key] ?? (typeof t.width == "number" ? t.width : void 0) ?? Math.round(n.getBoundingClientRect().width) ?? Lr
3759
+ }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none");
3760
+ }, $e = (e, t) => {
3761
+ let n = t.minWidth ?? Lr, r = pe[t.key] ?? (typeof t.width == "number" ? t.width : void 0) ?? n;
3762
+ if (e.key === "ArrowLeft") {
3763
+ e.preventDefault(), Xe(t.key, Math.max(n, r - Rr));
3764
+ return;
3765
+ }
3766
+ if (e.key === "ArrowRight") {
3767
+ e.preventDefault(), Xe(t.key, Math.max(n, r + Rr));
3768
+ return;
3769
+ }
3770
+ e.key === "Home" && (e.preventDefault(), Xe(t.key, n));
3771
+ }, et = {
3772
+ "--table-template-columns": we,
3773
+ "--table-row-height": `${be}px`,
3774
+ "--table-scrollbar-width": `${ne}px`
3775
+ };
3776
+ return /* @__PURE__ */ p("div", {
3777
+ "data-scope": "table",
3778
+ "data-row-height": A,
3779
+ className: _("owo-table", $.root, L),
3780
+ style: et,
3781
+ children: /* @__PURE__ */ m("div", {
3782
+ role: ie ? "grid" : "table",
3783
+ "aria-rowcount": Le,
3784
+ "aria-colcount": Ie,
3785
+ "aria-multiselectable": ie && h === "multiple" ? !0 : void 0,
3786
+ "aria-busy": N || void 0,
3787
+ className: $.table,
3788
+ children: [/* @__PURE__ */ p("div", {
3789
+ role: "rowgroup",
3790
+ className: _($.header, j && $.headerSticky),
3791
+ children: /* @__PURE__ */ m("div", {
3792
+ role: "row",
3793
+ "aria-rowindex": 1,
3794
+ className: $.row,
3795
+ children: [
3796
+ h === "multiple" && /* @__PURE__ */ p("div", {
3797
+ role: "columnheader",
3798
+ "aria-label": E,
3799
+ "data-scope": "table",
3800
+ "data-part": "selectionCell",
3801
+ className: _($.cell, $.headerCell, $.selectionCell, R?.selectionCell),
3802
+ children: /* @__PURE__ */ p(Gr, {
3803
+ type: "checkbox",
3804
+ checked: Ne,
3805
+ indeterminate: Fe,
3806
+ disabled: Me.length === 0,
3807
+ label: O?.({
3808
+ allSelected: Ne,
3809
+ partiallySelected: Fe,
3810
+ selectableCount: Me.length
3811
+ }) ?? (Ne ? "Clear row selection" : "Select all rows"),
3812
+ part: "selectionControl",
3813
+ className: R?.selectionControl,
3814
+ onClick: (e) => e.stopPropagation(),
3815
+ onChange: Ye
3816
+ })
3817
+ }),
3818
+ h === "single" && /* @__PURE__ */ p("div", {
3819
+ role: "columnheader",
3820
+ "aria-label": E,
3821
+ "data-scope": "table",
3822
+ "data-part": "selectionCell",
3823
+ className: _($.cell, $.headerCell, $.selectionCell, R?.selectionCell)
3824
+ }),
3825
+ fe.map((e) => {
3826
+ let t = Z?.key === e.key ? Z.direction : void 0, n = !!e.sortable, r = n ? Ur(t, w) : null, i = e.renderHeader?.({
3827
+ column: e,
3828
+ sorted: t,
3829
+ sortable: n
3830
+ }) ?? e.header;
3831
+ return /* @__PURE__ */ m("div", {
3832
+ role: "columnheader",
3833
+ "aria-sort": n ? t === "asc" ? "ascending" : t === "desc" ? "descending" : "none" : void 0,
3834
+ "data-scope": "table",
3835
+ "data-part": "headerCell",
3836
+ "data-align": e.align ?? "start",
3837
+ className: _($.cell, $.headerCell, R?.headerCell, e.headerClassName),
3838
+ children: [n ? /* @__PURE__ */ m("button", {
3839
+ type: "button",
3840
+ "aria-label": T?.({
3841
+ column: e,
3842
+ sorted: t,
3843
+ nextDirection: r
3844
+ }),
3845
+ "data-scope": "table",
3846
+ "data-part": "headerSortButton",
3847
+ className: _($.headerSortButton, R?.headerSortButton),
3848
+ onFocus: () => {
3849
+ se.current = !1;
3850
+ },
3851
+ onClick: () => Je(e.key),
3852
+ children: [/* @__PURE__ */ p("span", {
3853
+ "data-scope": "table",
3854
+ "data-part": "headerLabel",
3855
+ className: _($.headerLabel, R?.headerLabel),
3856
+ children: i
3857
+ }), /* @__PURE__ */ p("span", {
3858
+ "aria-hidden": "true",
3859
+ className: $.sortIndicator,
3860
+ children: t === "asc" ? "↑" : t === "desc" ? "↓" : "↕"
3861
+ })]
3862
+ }) : /* @__PURE__ */ p("span", {
3863
+ "data-scope": "table",
3864
+ "data-part": "headerLabel",
3865
+ className: _($.headerLabel, R?.headerLabel),
3866
+ children: i
3867
+ }), e.resizable && /* @__PURE__ */ p("button", {
3868
+ type: "button",
3869
+ "aria-label": `Resize ${String(e.header)} column`,
3870
+ "data-scope": "table",
3871
+ "data-part": "resizeHandle",
3872
+ className: _($.resizeHandle, R?.resizeHandle),
3873
+ onMouseDown: (t) => Qe(t, e),
3874
+ onKeyDown: (t) => $e(t, e),
3875
+ onClick: (e) => {
3876
+ e.preventDefault(), e.stopPropagation();
3877
+ }
3878
+ })]
3879
+ }, e.key);
3880
+ })
3881
+ ]
3882
+ })
3883
+ }), /* @__PURE__ */ p("div", {
3884
+ role: "rowgroup",
3885
+ ref: ae,
3886
+ className: $.body,
3887
+ style: Q ? { maxHeight: Se } : void 0,
3888
+ onScroll: Q ? (e) => K(e.currentTarget.scrollTop) : void 0,
3889
+ children: N ? P ? /* @__PURE__ */ p("div", {
3890
+ role: "row",
3891
+ "aria-rowindex": 2,
3892
+ className: _($.row, $.stateRow),
3893
+ children: /* @__PURE__ */ p("div", {
3894
+ role: Re,
3895
+ "data-scope": "table",
3896
+ "data-part": "loadingState",
3897
+ className: _($.loadingState, $.stateCell, R?.loadingState),
3898
+ children: P
3899
+ })
3900
+ }) : /* @__PURE__ */ p("div", {
3901
+ "data-scope": "table",
3902
+ "data-part": "loadingState",
3903
+ className: _($.loadingState, R?.loadingState),
3904
+ children: /* @__PURE__ */ p("div", {
3905
+ className: $.skeletonStack,
3906
+ children: Array.from({ length: F }, (e, t) => /* @__PURE__ */ m("div", {
3907
+ role: "row",
3908
+ "aria-rowindex": t + 2,
3909
+ className: _($.row, $.stateRow),
3910
+ children: [h && /* @__PURE__ */ p("div", {
3911
+ role: Re,
3912
+ "data-scope": "table",
3913
+ "data-part": "selectionCell",
3914
+ className: _($.cell, $.selectionCell, R?.selectionCell),
3915
+ children: /* @__PURE__ */ p("span", {
3916
+ "aria-hidden": "true",
3917
+ "data-scope": "table",
3918
+ "data-part": "skeletonCell",
3919
+ className: _($.skeletonCell, R?.skeletonCell)
3920
+ })
3921
+ }), fe.map((e) => /* @__PURE__ */ p("div", {
3922
+ role: Re,
3923
+ "data-scope": "table",
3924
+ "data-part": "cell",
3925
+ "data-align": e.align ?? "start",
3926
+ className: _($.cell, R?.cell, e.cellClassName),
3927
+ children: /* @__PURE__ */ p("span", {
3928
+ "aria-hidden": "true",
3929
+ "data-scope": "table",
3930
+ "data-part": "skeletonCell",
3931
+ className: _($.skeletonCell, R?.skeletonCell)
3932
+ })
3933
+ }, `${e.key}-${t}`))]
3934
+ }, `skeleton-row-${t}`))
3935
+ })
3936
+ }) : ye.length === 0 ? /* @__PURE__ */ p("div", {
3937
+ role: "row",
3938
+ "aria-rowindex": 2,
3939
+ className: _($.row, $.stateRow),
3940
+ children: /* @__PURE__ */ p("div", {
3941
+ role: Re,
3942
+ "data-scope": "table",
3943
+ "data-part": "emptyState",
3944
+ className: _($.empty, $.stateCell, R?.emptyState),
3945
+ children: I ?? "No rows to display."
3946
+ })
3947
+ }) : /* @__PURE__ */ p("div", {
3948
+ style: Q ? {
3949
+ paddingTop: Ae,
3950
+ paddingBottom: je
3951
+ } : void 0,
3952
+ children: ke.map((e, t) => {
3953
+ let n = De + t, r = f?.(e, n) ?? String(e.id ?? n), i = _e.has(r), a = h ? k ? k(e, n) : !0 : !1;
3954
+ return /* @__PURE__ */ m("div", {
3955
+ role: "row",
3956
+ "aria-rowindex": n + 2,
3957
+ "aria-selected": h ? i : void 0,
3958
+ "data-selected": i || void 0,
3959
+ className: $.row,
3960
+ ref: (e) => {
3961
+ e ? oe.current.set(n, e) : oe.current.delete(n);
3962
+ },
3963
+ onFocus: () => {
3964
+ a && (se.current = !0, We(r));
3965
+ },
3966
+ onClick: () => {
3967
+ !h || !a || (We(r), Ke(Hr(h, _e, r)));
3968
+ },
3969
+ onKeyDown: (e) => {
3970
+ if (!(!h || !a)) {
3971
+ if (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End") {
3972
+ e.preventDefault();
3973
+ let t = ze.indexOf(n);
3974
+ if (t === -1) return;
3975
+ if (e.key === "ArrowDown") {
3976
+ Ze(ze[t + 1] ?? ze[t]);
3977
+ return;
3978
+ }
3979
+ if (e.key === "ArrowUp") {
3980
+ Ze(ze[t - 1] ?? ze[t]);
3981
+ return;
3982
+ }
3983
+ if (e.key === "Home" && Ve != null) {
3984
+ Ze(Ve);
3985
+ return;
3986
+ }
3987
+ let r = ze[ze.length - 1];
3988
+ e.key === "End" && r != null && Ze(r);
3989
+ return;
3990
+ }
3991
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Ke(Hr(h, _e, r)));
3992
+ }
3993
+ },
3994
+ tabIndex: h && a ? Ue === r ? 0 : -1 : void 0,
3995
+ children: [h && /* @__PURE__ */ p("div", {
3996
+ role: Re,
3997
+ "data-scope": "table",
3998
+ "data-part": "selectionCell",
3999
+ className: _($.cell, $.selectionCell, R?.selectionCell),
4000
+ children: /* @__PURE__ */ p(Gr, {
4001
+ type: h === "single" ? "radio" : "checkbox",
4002
+ name: h === "single" ? "table-selection" : void 0,
4003
+ checked: i,
4004
+ disabled: !a,
4005
+ label: a ? D?.({
4006
+ row: e,
4007
+ rowId: r,
4008
+ index: n,
4009
+ selected: i,
4010
+ selectionMode: h
4011
+ }) ?? `Select row ${n + 1}` : `Row ${n + 1} is not selectable`,
4012
+ part: "selectionControl",
4013
+ className: R?.selectionControl,
4014
+ onChange: () => {
4015
+ a && Ke(Hr(h, _e, r));
4016
+ },
4017
+ onClick: (e) => e.stopPropagation()
4018
+ })
4019
+ }), fe.map((t) => {
4020
+ let a = t.cell ? t.cell(e, n) : typeof t.accessor == "function" ? t.accessor(e, n) : t.accessor ? e[t.accessor] : e[t.key], o = t.renderCell?.({
4021
+ column: t,
4022
+ row: e,
4023
+ rowId: r,
4024
+ index: n,
4025
+ selected: i,
4026
+ value: a
4027
+ }) ?? a;
4028
+ return /* @__PURE__ */ p("div", {
4029
+ role: Re,
4030
+ "data-scope": "table",
4031
+ "data-part": "cell",
4032
+ "data-align": t.align ?? "start",
4033
+ className: _($.cell, R?.cell, t.cellClassName),
4034
+ children: o
4035
+ }, t.key);
4036
+ })]
4037
+ }, r);
4038
+ })
4039
+ })
4040
+ })]
4041
+ })
4042
+ });
4043
+ }
4044
+ var qr = {
4045
+ root: "_root_cqty6_1",
4046
+ item: "_item_cqty6_7",
4047
+ button: "_button_cqty6_11",
4048
+ labelText: "_labelText_cqty6_55",
4049
+ chevron: "_chevron_cqty6_59"
4050
+ };
4051
+ //#endregion
4052
+ //#region src/components/Tree.tsx
4053
+ function Jr(e, t) {
4054
+ return t ? (e.textValue ?? (typeof e.label == "string" ? e.label : "")).toLowerCase().includes(t.toLowerCase()) : !0;
4055
+ }
4056
+ function Yr(e, t) {
4057
+ return Jr(e, t) ? !0 : e.children?.some((e) => Yr(e, t)) ?? !1;
4058
+ }
4059
+ function Xr(e, t) {
4060
+ if (!t || typeof e != "string") return e;
4061
+ let n = e.toLowerCase(), r = t.toLowerCase(), i = n.indexOf(r);
4062
+ if (i < 0) return e;
4063
+ let a = i + t.length;
4064
+ return /* @__PURE__ */ m(f, { children: [
4065
+ e.slice(0, i),
4066
+ /* @__PURE__ */ p("mark", { children: e.slice(i, a) }),
4067
+ e.slice(a)
4068
+ ] });
4069
+ }
4070
+ function Zr({ nodes: e, expandedKeys: t, defaultExpandedKeys: n, onExpand: r, onExpandedKeysChange: i, selectedKey: a, defaultSelectedKey: o, onSelect: s, renderNode: c, searchQuery: h = "", className: g, ariaLabel: v = "Tree", classNames: y }) {
4071
+ let b = h.trim(), [x, S] = d(n ?? /* @__PURE__ */ new Set()), [C, w] = d(o), T = t ?? x, E = a ?? C, D = u(/* @__PURE__ */ new Map()), O = l(() => {
4072
+ let t = [], n = b.length > 0;
4073
+ function r(e, i, a) {
4074
+ for (let o of e) n && !Yr(o, b) || (t.push({
4075
+ node: o,
4076
+ depth: i,
4077
+ parentKey: a
4078
+ }), (n ? o.children?.length : o.children?.length && T.has(o.key)) && r(o.children ?? [], i + 1, o.key));
4079
+ }
4080
+ return r(e, 0), t;
4081
+ }, [
4082
+ T,
4083
+ e,
4084
+ b
4085
+ ]);
4086
+ l(() => new Map(O.map((e, t) => [e.node.key, t])), [O]);
4087
+ let k = l(() => new Map(O.map((e) => [e.node.key, e])), [O]), A = l(() => O.filter((e) => !e.node.disabled), [O]), j = l(() => new Map(A.map((e, t) => [e.node.key, t])), [A]), M = E != null && j.has(E), N = (e, n) => {
4088
+ let a = new Set(T);
4089
+ n ? a.add(e) : a.delete(e), t || S(a), i?.(a), r?.(e, n);
4090
+ }, P = (e) => {
4091
+ a || w(e), s?.(e);
4092
+ }, F = (e) => {
4093
+ e && D.current.get(e)?.focus();
4094
+ }, I = (e, t) => {
4095
+ if (A.length === 0) return;
4096
+ let n = j.get(e) ?? -1;
4097
+ if (t === "first") {
4098
+ F(A[0]?.node.key);
4099
+ return;
4100
+ }
4101
+ if (t === "last") {
4102
+ F(A[A.length - 1]?.node.key);
4103
+ return;
4104
+ }
4105
+ F(A[t === "next" ? n + 1 : n - 1]?.node.key);
4106
+ }, L = (e) => e.children?.find((e) => !e.disabled)?.key, R = (e) => {
4107
+ let t = e;
4108
+ for (; t;) {
4109
+ let e = k.get(t);
4110
+ if (e && !e.node.disabled) return t;
4111
+ t = e?.parentKey;
4112
+ }
4113
+ }, z = (e, t) => {
4114
+ let n = !!t.node.children?.length, r = T.has(t.node.key);
4115
+ switch (e.key) {
4116
+ case "ArrowDown":
4117
+ e.preventDefault(), I(t.node.key, "next");
4118
+ break;
4119
+ case "ArrowUp":
4120
+ e.preventDefault(), I(t.node.key, "prev");
4121
+ break;
4122
+ case "ArrowRight":
4123
+ e.preventDefault(), n && !r ? N(t.node.key, !0) : n && F(L(t.node));
4124
+ break;
4125
+ case "ArrowLeft":
4126
+ e.preventDefault(), n && r ? N(t.node.key, !1) : F(R(t.parentKey));
4127
+ break;
4128
+ case "Home":
4129
+ e.preventDefault(), I(t.node.key, "first");
4130
+ break;
4131
+ case "End":
4132
+ e.preventDefault(), I(t.node.key, "last");
4133
+ break;
4134
+ case "Enter":
4135
+ case " ":
4136
+ e.preventDefault(), P(t.node.key);
4137
+ break;
4138
+ }
4139
+ };
4140
+ return /* @__PURE__ */ p("div", {
4141
+ role: "tree",
4142
+ "aria-label": v,
4143
+ "data-scope": "tree",
4144
+ className: _("owo-tree", qr.root, g),
4145
+ children: O.map((e) => {
4146
+ let { node: t, depth: n } = e, r = E === t.key, i = b.length > 0, a = i ? !!t.children?.length : T.has(t.key), o = !!t.children?.length, s = Jr(t, b), l = !t.disabled && (M ? r : A[0]?.node.key === t.key), u = c?.({
4147
+ node: t,
4148
+ depth: n,
4149
+ expanded: a,
4150
+ selected: r,
4151
+ match: s
4152
+ });
4153
+ return /* @__PURE__ */ p("div", {
4154
+ "data-scope": "tree",
4155
+ "data-part": "item",
4156
+ "data-depth": n,
4157
+ "data-selected": r || void 0,
4158
+ "data-match": s || void 0,
4159
+ className: _(qr.item, y?.item),
4160
+ children: /* @__PURE__ */ p("button", {
4161
+ ref: (e) => {
4162
+ D.current.set(t.key, e);
4163
+ },
4164
+ type: "button",
4165
+ role: "treeitem",
4166
+ "aria-selected": r,
4167
+ "aria-expanded": o ? a : void 0,
4168
+ "aria-level": n + 1,
4169
+ "data-scope": "tree",
4170
+ "data-part": "button",
4171
+ className: _(qr.button, y?.button),
4172
+ disabled: t.disabled,
4173
+ tabIndex: l ? 0 : -1,
4174
+ style: { paddingInlineStart: `${.75 + n * 1.25}rem` },
4175
+ onClick: () => {
4176
+ P(t.key), o && !i && N(t.key, !a);
4177
+ },
4178
+ onKeyDown: (t) => z(t, e),
4179
+ children: c ? u : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
4180
+ "data-scope": "tree",
4181
+ "data-part": "label",
4182
+ className: _(qr.labelText, y?.label),
4183
+ children: Xr(t.label, b)
4184
+ }), o && /* @__PURE__ */ p("span", {
4185
+ "aria-hidden": "true",
4186
+ "data-scope": "tree",
4187
+ "data-part": "chevron",
4188
+ className: _(qr.chevron, y?.chevron),
4189
+ children: a ? "▾" : "▸"
4190
+ })] })
4191
+ })
4192
+ }, t.key);
2449
4193
  })
2450
4194
  });
2451
4195
  }
2452
- var Jn = { root: "_root_1dxq8_1" }, Yn = n(null);
2453
- function Xn(e) {
2454
- let t = a(Yn);
4196
+ var Qr = { root: "_root_158qs_1" }, $r = n(null);
4197
+ function ei(e) {
4198
+ let t = a($r);
2455
4199
  if (!t) throw Error(`${e} must be used within Tabs.Root`);
2456
4200
  return t;
2457
4201
  }
2458
- function Zn(e) {
4202
+ function ti(e) {
2459
4203
  return e.replace(/[^a-zA-Z0-9_-]+/g, "-");
2460
4204
  }
2461
- function Qn({ value: e, defaultValue: t, onValueChange: n }) {
2462
- let [r, i] = d(t ?? ""), a = e !== void 0, o = a ? e : r;
2463
- function s(e) {
2464
- a || i(e), n?.(e);
2465
- }
2466
- return [o, s];
2467
- }
2468
- function $n({ children: e, value: t, defaultValue: n, onValueChange: r, className: i, ...a }) {
2469
- let [o, c] = Qn({
4205
+ function ni({ children: e, value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", classNames: a, className: o, ...c }) {
4206
+ let [u, d] = H({
2470
4207
  value: t,
2471
4208
  defaultValue: n,
2472
- onValueChange: r
2473
- }), u = s(), d = l(() => ({
2474
- value: o,
2475
- setValue: c,
2476
- baseId: u
4209
+ onChange: r,
4210
+ fallback: ""
4211
+ }), f = s(), m = l(() => ({
4212
+ value: u,
4213
+ setValue: d,
4214
+ baseId: f,
4215
+ orientation: i,
4216
+ classNames: a
2477
4217
  }), [
4218
+ f,
4219
+ a,
2478
4220
  u,
2479
- o,
2480
- c
4221
+ i,
4222
+ d
2481
4223
  ]);
2482
- return /* @__PURE__ */ p(Yn.Provider, {
2483
- value: d,
4224
+ return /* @__PURE__ */ p($r.Provider, {
4225
+ value: m,
2484
4226
  children: /* @__PURE__ */ p("div", {
2485
4227
  "data-scope": "tabs",
2486
- className: _("owo-tabs", Jn.root, i),
2487
- ...a,
4228
+ "data-orientation": i,
4229
+ className: _("owo-tabs", Qr.root, o),
4230
+ ...c,
2488
4231
  children: e
2489
4232
  })
2490
4233
  });
2491
4234
  }
2492
- function er({ children: e, className: t, ariaLabel: n, ...r }) {
4235
+ function ri({ children: e, className: t, ariaLabel: n, ...r }) {
4236
+ let { orientation: i, classNames: a } = ei("Tabs.List");
2493
4237
  return /* @__PURE__ */ p("div", {
2494
4238
  role: "tablist",
2495
4239
  "aria-label": n,
4240
+ "aria-orientation": i,
2496
4241
  "data-scope": "tabs",
2497
4242
  "data-part": "list",
2498
- className: _(t),
4243
+ "data-orientation": i,
4244
+ className: _(a?.list, t),
2499
4245
  ...r,
2500
4246
  children: e
2501
4247
  });
2502
4248
  }
2503
- function tr({ children: e, className: t, value: n, disabled: r, onClick: i, onKeyDown: a, ...o }) {
2504
- let { value: s, setValue: c, baseId: l } = Xn("Tabs.Trigger"), u = s === n, d = `${l}-trigger-${Zn(n)}`, f = `${l}-panel-${Zn(n)}`;
2505
- function m(e, t) {
4249
+ function ii({ children: e, className: t, value: n, disabled: r, onClick: i, onKeyDown: a, ...s }) {
4250
+ let { value: c, setValue: l, baseId: d, orientation: f, classNames: m } = ei("Tabs.Trigger"), h = c === n, g = `${d}-trigger-${ti(n)}`, v = `${d}-panel-${ti(n)}`, y = u(null);
4251
+ o(() => {
4252
+ if (r || c !== "") return;
4253
+ let e = y.current, t = e?.closest("[role=\"tablist\"]");
4254
+ !e || !t || t.querySelector("[role=\"tab\"]:not([disabled])") === e && l(n);
4255
+ }, [
4256
+ c,
4257
+ r,
4258
+ l,
4259
+ n
4260
+ ]);
4261
+ function b(e, t) {
2506
4262
  let n = e.closest("[role=\"tablist\"]");
2507
4263
  if (!n) return;
2508
4264
  let r = Array.from(n.querySelectorAll("[role=\"tab\"]:not([disabled])")), i = r.indexOf(e);
@@ -2511,111 +4267,132 @@ function tr({ children: e, className: t, value: n, disabled: r, onClick: i, onKe
2511
4267
  t === "first" && (a = r[0]), t === "last" && (a = r[r.length - 1]), t === "next" && (a = r[(i + 1) % r.length]), t === "prev" && (a = r[(i - 1 + r.length) % r.length]), a && (a.focus(), a.click());
2512
4268
  }
2513
4269
  return /* @__PURE__ */ p("button", {
4270
+ ref: y,
2514
4271
  type: "button",
2515
- id: d,
4272
+ id: g,
2516
4273
  role: "tab",
2517
- "aria-selected": u,
2518
- "aria-controls": f,
2519
- tabIndex: u ? 0 : -1,
2520
- "data-state": u ? "active" : "inactive",
4274
+ "aria-selected": h,
4275
+ "aria-controls": v,
4276
+ tabIndex: h ? 0 : -1,
4277
+ "data-state": h ? "active" : "inactive",
2521
4278
  "data-scope": "tabs",
2522
4279
  "data-part": "trigger",
4280
+ "data-orientation": f,
2523
4281
  disabled: r,
2524
- className: _(t),
4282
+ className: _(m?.trigger, t),
2525
4283
  onClick: (e) => {
2526
- i?.(e), !e.defaultPrevented && !r && c(n);
4284
+ i?.(e), !e.defaultPrevented && !r && l(n);
2527
4285
  },
2528
4286
  onKeyDown: (e) => {
2529
4287
  if (a?.(e), e.defaultPrevented || r) return;
2530
4288
  let t = e.currentTarget;
2531
4289
  switch (e.key) {
2532
4290
  case "ArrowRight":
2533
- e.preventDefault(), m(t, "next");
4291
+ f === "horizontal" && (e.preventDefault(), b(t, "next"));
2534
4292
  break;
2535
4293
  case "ArrowLeft":
2536
- e.preventDefault(), m(t, "prev");
4294
+ f === "horizontal" && (e.preventDefault(), b(t, "prev"));
4295
+ break;
4296
+ case "ArrowDown":
4297
+ f === "vertical" && (e.preventDefault(), b(t, "next"));
4298
+ break;
4299
+ case "ArrowUp":
4300
+ f === "vertical" && (e.preventDefault(), b(t, "prev"));
2537
4301
  break;
2538
4302
  case "Home":
2539
- e.preventDefault(), m(t, "first");
4303
+ e.preventDefault(), b(t, "first");
2540
4304
  break;
2541
4305
  case "End":
2542
- e.preventDefault(), m(t, "last");
4306
+ e.preventDefault(), b(t, "last");
2543
4307
  break;
2544
4308
  }
2545
4309
  },
2546
- ...o,
4310
+ ...s,
2547
4311
  children: e
2548
4312
  });
2549
4313
  }
2550
- function nr({ children: e, className: t, value: n, ...r }) {
2551
- let { value: i, baseId: a } = Xn("Tabs.Content"), o = i === n, s = `${a}-trigger-${Zn(n)}`, c = `${a}-panel-${Zn(n)}`;
2552
- return o ? /* @__PURE__ */ p("div", {
2553
- id: c,
4314
+ function ai({ children: e, className: t, value: n, ...r }) {
4315
+ let { value: i, baseId: a, orientation: o, classNames: s } = ei("Tabs.Content"), c = i === n, l = `${a}-trigger-${ti(n)}`, u = `${a}-panel-${ti(n)}`;
4316
+ return c ? /* @__PURE__ */ p("div", {
4317
+ id: u,
2554
4318
  role: "tabpanel",
2555
- "aria-labelledby": s,
4319
+ "aria-labelledby": l,
2556
4320
  "data-state": "active",
2557
4321
  "data-scope": "tabs",
2558
4322
  "data-part": "content",
2559
- className: _(t),
4323
+ "data-orientation": o,
4324
+ className: _(s?.content, t),
2560
4325
  ...r,
2561
4326
  children: e
2562
4327
  }) : null;
2563
4328
  }
2564
- var rr = Object.assign($n, {
2565
- Root: $n,
2566
- List: er,
2567
- Trigger: tr,
2568
- Content: nr
2569
- }), ir = { root: "_root_17j1y_1" };
4329
+ var oi = Object.assign(ni, {
4330
+ Root: ni,
4331
+ List: ri,
4332
+ Trigger: ii,
4333
+ Content: ai
4334
+ }), si = { root: "_root_17j1y_1" };
2570
4335
  //#endregion
2571
4336
  //#region src/components/Textarea.tsx
2572
- function ar({ className: e, tone: t = "default", size: n = "md", resize: r = "vertical", autoResize: a = !1, style: s, onInput: c, rows: l = 3, ...d }) {
2573
- let f = u(null), m = c, h = i(() => {
2574
- if (!a || !f.current) return;
2575
- let e = f.current;
4337
+ function ci({ className: e, tone: t = "default", size: n = "md", resize: r = "vertical", autoResize: a = !1, invalid: s, style: c, onInput: l, rows: d = 3, ...f }) {
4338
+ let m = V({
4339
+ id: f.id,
4340
+ disabled: f.disabled,
4341
+ required: f.required,
4342
+ invalid: s,
4343
+ "aria-describedby": f["aria-describedby"]
4344
+ }), h = u(null), g = l, v = i(() => {
4345
+ if (!a || !h.current) return;
4346
+ let e = h.current;
2576
4347
  e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
2577
4348
  }, [a]);
2578
4349
  o(() => {
2579
- h();
4350
+ v();
2580
4351
  }, [
2581
- h,
2582
- d.value,
2583
- d.defaultValue,
2584
- l
4352
+ v,
4353
+ f.value,
4354
+ f.defaultValue,
4355
+ d
2585
4356
  ]);
2586
- function g(e) {
2587
- h(), m?.(e);
4357
+ function y(e) {
4358
+ v(), g?.(e);
2588
4359
  }
2589
- let v = {
2590
- ...s,
4360
+ let b = {
4361
+ ...c,
2591
4362
  resize: a ? "none" : r
2592
4363
  };
2593
4364
  return /* @__PURE__ */ p("textarea", {
2594
- ...d,
2595
- ref: f,
2596
- rows: l,
4365
+ ...f,
4366
+ ref: h,
4367
+ id: m.id,
4368
+ disabled: m.disabled,
4369
+ required: m.required,
4370
+ "aria-describedby": m["aria-describedby"],
4371
+ "aria-invalid": m.invalid || void 0,
4372
+ rows: d,
2597
4373
  "data-tone": t,
2598
4374
  "data-size": n,
4375
+ "data-invalid": m.invalid || void 0,
2599
4376
  "data-auto-resize": a || void 0,
2600
- className: _("owo-input", jn.root, "owo-textarea", ir.root, e),
2601
- style: v,
2602
- onInput: g
4377
+ className: _("owo-input", Rn.root, "owo-textarea", si.root, e),
4378
+ style: b,
4379
+ onInput: y
2603
4380
  });
2604
4381
  }
2605
4382
  //#endregion
2606
4383
  //#region src/styles/ui/toast.module.css
2607
- var or = "_container_73rls_1", sr = "_toast_73rls_12", cr = "_toastDefault_73rls_32", lr = {
2608
- container: or,
2609
- toast: sr,
4384
+ var li = "_container_73rls_1", ui = "_toast_73rls_12", di = "_toastDefault_73rls_32", fi = {
4385
+ container: li,
4386
+ toast: ui,
2610
4387
  "toast-in": "_toast-in_73rls_1",
2611
- toastDefault: cr
2612
- }, ur = n(null), dr = 5, fr = 4e3;
2613
- function pr() {
2614
- let e = a(ur);
4388
+ toastDefault: di
4389
+ }, pi = n(null), mi = 5, hi = 4e3;
4390
+ function gi() {
4391
+ let e = a(pi);
2615
4392
  if (!e) throw Error("useToast must be used within <ToastProvider>");
2616
4393
  return e;
2617
4394
  }
2618
- function mr({ tone: e }) {
4395
+ function _i({ tone: e }) {
2619
4396
  let t = {
2620
4397
  width: 16,
2621
4398
  height: 16,
@@ -2657,18 +4434,18 @@ function mr({ tone: e }) {
2657
4434
  });
2658
4435
  }
2659
4436
  }
2660
- function hr(e, t) {
4437
+ function vi(e, t) {
2661
4438
  return typeof e == "string" ? {
2662
4439
  message: e,
2663
- duration: t ?? fr
4440
+ duration: t ?? hi
2664
4441
  } : {
2665
4442
  title: e.title,
2666
4443
  message: e.message,
2667
- duration: e.duration ?? t ?? fr
4444
+ duration: e.duration ?? t ?? hi
2668
4445
  };
2669
4446
  }
2670
- function gr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
2671
- let i = () => t(e.id), a = /* @__PURE__ */ p(mr, { tone: e.tone });
4447
+ function yi({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
4448
+ let i = () => t(e.id), a = /* @__PURE__ */ p(_i, { tone: e.tone });
2672
4449
  return n ? /* @__PURE__ */ p("div", {
2673
4450
  role: "status",
2674
4451
  "aria-live": "polite",
@@ -2676,7 +4453,7 @@ function gr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
2676
4453
  "data-tone": e.tone,
2677
4454
  "data-scope": "toast",
2678
4455
  "data-part": "toast",
2679
- className: _("owo-toast", lr.toast, r?.toast),
4456
+ className: _("owo-toast", fi.toast, r?.toast),
2680
4457
  children: n({
2681
4458
  item: e,
2682
4459
  dismiss: i,
@@ -2689,7 +4466,7 @@ function gr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
2689
4466
  "data-tone": e.tone,
2690
4467
  "data-scope": "toast",
2691
4468
  "data-part": "toast",
2692
- className: _("owo-toast", lr.toast, lr.toastDefault, r?.toast),
4469
+ className: _("owo-toast", fi.toast, fi.toastDefault, r?.toast),
2693
4470
  children: [
2694
4471
  /* @__PURE__ */ p("span", {
2695
4472
  "data-scope": "toast",
@@ -2735,7 +4512,7 @@ function gr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
2735
4512
  ]
2736
4513
  });
2737
4514
  }
2738
- function _r({ children: e, renderToast: t, classNames: n }) {
4515
+ function bi({ children: e, renderToast: t, classNames: n }) {
2739
4516
  let [r, a] = d([]), o = u(0), s = u(/* @__PURE__ */ new Map()), c = i((e) => {
2740
4517
  let t = s.current.get(e);
2741
4518
  t && clearTimeout(t), s.current.delete(e), a((t) => t.filter((t) => t.id !== e));
@@ -2743,17 +4520,17 @@ function _r({ children: e, renderToast: t, classNames: n }) {
2743
4520
  let r = o.current++, i = {
2744
4521
  id: r,
2745
4522
  tone: e,
2746
- ...hr(t, n)
4523
+ ...vi(t, n)
2747
4524
  };
2748
4525
  a((e) => {
2749
4526
  let t = [...e, i];
2750
- if (t.length > dr) {
2751
- let e = t.slice(0, t.length - dr);
4527
+ if (t.length > mi) {
4528
+ let e = t.slice(0, t.length - mi);
2752
4529
  for (let t of e) {
2753
4530
  let e = s.current.get(t.id);
2754
4531
  e && clearTimeout(e), s.current.delete(t.id);
2755
4532
  }
2756
- return t.slice(-dr);
4533
+ return t.slice(-mi);
2757
4534
  }
2758
4535
  return t;
2759
4536
  }), i.duration > 0 && s.current.set(r, setTimeout(() => c(r), i.duration));
@@ -2763,15 +4540,15 @@ function _r({ children: e, renderToast: t, classNames: n }) {
2763
4540
  danger: (e, t) => f("danger", e, t),
2764
4541
  info: (e, t) => f("info", e, t)
2765
4542
  }), [f]);
2766
- return /* @__PURE__ */ m(ur.Provider, {
4543
+ return /* @__PURE__ */ m(pi.Provider, {
2767
4544
  value: h,
2768
4545
  children: [e, /* @__PURE__ */ p("div", {
2769
4546
  "aria-label": "Notifications",
2770
4547
  "data-state": r.length > 0 ? "open" : "closed",
2771
4548
  "data-scope": "toast",
2772
4549
  "data-part": "container",
2773
- className: _("owo-toast-container", lr.container, n?.container),
2774
- children: r.map((e) => /* @__PURE__ */ p(gr, {
4550
+ className: _("owo-toast-container", fi.container, n?.container),
4551
+ children: r.map((e) => /* @__PURE__ */ p(yi, {
2775
4552
  item: e,
2776
4553
  onDismiss: c,
2777
4554
  renderToast: t,
@@ -2780,116 +4557,5 @@ function _r({ children: e, renderToast: t, classNames: n }) {
2780
4557
  })]
2781
4558
  });
2782
4559
  }
2783
- var vr = {
2784
- trigger: "_trigger_xunrw_1",
2785
- content: "_content_xunrw_5",
2786
- "tooltip-in": "_tooltip-in_xunrw_1"
2787
- }, yr = 6, br = 8, xr = 4;
2788
- function Sr(e) {
2789
- return e.split("-")[0];
2790
- }
2791
- var Cr = {
2792
- top: "",
2793
- bottom: "rotate(180deg)",
2794
- left: "rotate(-90deg)",
2795
- right: "rotate(90deg)"
2796
- };
2797
- function wr({ content: e, placement: t = "top", density: n = "default", showDelay: r = 300, hideDelay: a = 150, arrow: l = !0, renderArrow: g, className: v, children: y, classNames: b }) {
2798
- let [x, S] = d(!1), [C, w] = d(null), [T, E] = d(t), [D, O] = d({}), k = u(null), A = u(null), j = u(null), M = u(void 0), N = u(void 0), ee = s(), P = i(() => {
2799
- clearTimeout(M.current), clearTimeout(N.current);
2800
- }, []), F = i(() => {
2801
- P(), M.current = setTimeout(() => S(!0), r);
2802
- }, [P, r]), I = i(() => {
2803
- P(), S(!0);
2804
- }, [P]), L = i(() => {
2805
- P(), N.current = setTimeout(() => S(!1), a);
2806
- }, [P, a]), R = i((e) => {
2807
- if (e.target === k.current) {
2808
- F();
2809
- return;
2810
- }
2811
- I();
2812
- }, [F, I]), te = i((e) => {
2813
- e.pointerType !== "mouse" && I();
2814
- }, [I]), ne = i((e) => {
2815
- e.key === "Escape" && x && S(!1);
2816
- }, [x]);
2817
- c(() => {
2818
- if (!x || !k.current || !A.current) return;
2819
- let e = [
2820
- Gt(l ? br + yr : br),
2821
- qt({ padding: xr }),
2822
- Kt({ padding: xr })
2823
- ];
2824
- return l && j.current && e.push(Jt({ element: j.current })), Wt(k.current, A.current, () => {
2825
- !k.current || !A.current || Yt(k.current, A.current, {
2826
- placement: t,
2827
- strategy: "fixed",
2828
- middleware: e
2829
- }).then(({ x: e, y: t, placement: n, middlewareData: r }) => {
2830
- w({
2831
- top: t,
2832
- left: e
2833
- }), E(Sr(n)), r.arrow && O({
2834
- x: r.arrow.x,
2835
- y: r.arrow.y
2836
- });
2837
- });
2838
- });
2839
- }, [
2840
- x,
2841
- t,
2842
- l
2843
- ]), o(() => {
2844
- if (x) return document.addEventListener("keydown", ne), () => document.removeEventListener("keydown", ne);
2845
- }, [x, ne]), o(() => P, [P]);
2846
- let z = { position: "absolute" }, B = T;
2847
- return B === "top" || B === "bottom" ? (z.left = D.x ?? 0, z[B === "top" ? "bottom" : "top"] = -yr, z.transform = Cr[B] || void 0) : (z.top = D.y ?? 0, z[B === "left" ? "right" : "left"] = -yr, z.transform = Cr[B]), /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
2848
- ref: k,
2849
- "data-state": x ? "open" : "closed",
2850
- "data-scope": "tooltip",
2851
- "data-part": "trigger",
2852
- className: _("owo-tooltip-trigger", vr.trigger, b?.trigger),
2853
- onMouseEnter: F,
2854
- onMouseLeave: L,
2855
- onFocus: R,
2856
- onBlur: L,
2857
- onPointerDown: te,
2858
- "aria-describedby": x ? ee : void 0,
2859
- children: y
2860
- }), x && h(/* @__PURE__ */ m("div", {
2861
- ref: A,
2862
- id: ee,
2863
- role: "tooltip",
2864
- "data-state": x ? "open" : "closed",
2865
- "data-placement": T,
2866
- "data-density": n,
2867
- "data-scope": "tooltip",
2868
- "data-part": "content",
2869
- className: _("owo-tooltip", vr.content, b?.content, v),
2870
- style: C ? {
2871
- top: C.top,
2872
- left: C.left
2873
- } : { visibility: "hidden" },
2874
- onMouseEnter: F,
2875
- onMouseLeave: L,
2876
- children: [e, l && /* @__PURE__ */ p("span", {
2877
- ref: j,
2878
- "data-scope": "tooltip",
2879
- "data-part": "arrow",
2880
- className: _(b?.arrow),
2881
- style: z,
2882
- children: g ? g({ placement: T }) : /* @__PURE__ */ p("svg", {
2883
- width: yr * 2,
2884
- height: yr,
2885
- viewBox: "0 0 12 6",
2886
- children: /* @__PURE__ */ p("path", {
2887
- d: "M0 0l6 6 6-6z",
2888
- fill: "currentColor"
2889
- })
2890
- })
2891
- })]
2892
- }), document.body)] });
2893
- }
2894
4560
  //#endregion
2895
- export { b as Avatar, S as Badge, L as Button, ie as Collapsible, V as CollapsibleContent, B as CollapsibleRoot, re as CollapsibleTrigger, pe as ConfirmProvider, W as Dialog, En as Drawer, wn as DropdownMenu, On as Field, An as IconButton, Mn as Input, Pn as Panel, In as PanelBody, Ln as PanelFooter, Fn as PanelHeader, zn as SegmentedControl, Vn as Select, Wn as Skeleton, P as Spinner, Gn as StatusNotice, qn as Switch, rr as Tabs, nr as TabsContent, er as TabsList, $n as TabsRoot, tr as TabsTrigger, ar as Textarea, _r as ToastProvider, wr as Tooltip, I as buttonClassName, fe as useConfirm, pr as useToast };
4561
+ export { b as Avatar, S as Badge, R as Button, te as Checkbox, X as Collapsible, Y as CollapsibleContent, q as CollapsibleRoot, J as CollapsibleTrigger, me as ConfirmProvider, de as Dialog, Nn as Drawer, jn as DropdownMenu, Fn as Field, Ln as IconButton, zn as Input, er as NavRail, Zn as NavRailItem, Xn as NavRailRoot, Qn as NavRailSpacer, nr as Panel, ir as PanelBody, ar as PanelFooter, rr as PanelHeader, _r as Popover, gr as PopoverContent, pr as PopoverRoot, mr as PopoverTrigger, xr as Radio, Sr as RadioGroup, wr as SegmentedControl, Or as Select, jr as Skeleton, F as Spinner, Nr as StatusNotice, Fr as Switch, Kr as Table, oi as Tabs, ai as TabsContent, ri as TabsList, ni as TabsRoot, ii as TabsTrigger, ci as Textarea, bi as ToastProvider, Kn as Tooltip, Zr as Tree, L as buttonClassName, pe as useConfirm, gi as useToast };