@arcadeai/design-system 3.33.2 → 3.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +30 -317
  2. package/dist/arcade-logo-BVV97-cr.js +33 -0
  3. package/dist/assets/icons/granola.js +14 -0
  4. package/dist/assets/images/arcade-grid.d.ts +1 -1
  5. package/dist/assets/images/arcade-grid.d.ts.map +1 -1
  6. package/dist/assets/images/arcade-logo.d.ts +1 -1
  7. package/dist/assets/images/arcade-logo.d.ts.map +1 -1
  8. package/dist/assets/images/arcade-logo.js +10 -31
  9. package/dist/components/index.js +597 -567
  10. package/dist/components/ui/atoms/accordion.d.ts +1 -1
  11. package/dist/components/ui/atoms/accordion.d.ts.map +1 -1
  12. package/dist/components/ui/atoms/alert-dialog.d.ts +1 -1
  13. package/dist/components/ui/atoms/alert-dialog.d.ts.map +1 -1
  14. package/dist/components/ui/atoms/alert.d.ts +1 -1
  15. package/dist/components/ui/atoms/alert.d.ts.map +1 -1
  16. package/dist/components/ui/atoms/avatar-notification-badge.d.ts +34 -0
  17. package/dist/components/ui/atoms/avatar-notification-badge.d.ts.map +1 -0
  18. package/dist/components/ui/atoms/avatar-notification-badge.js +78 -0
  19. package/dist/components/ui/atoms/avatar.d.ts +1 -1
  20. package/dist/components/ui/atoms/avatar.d.ts.map +1 -1
  21. package/dist/components/ui/atoms/breadcrumb.d.ts +1 -1
  22. package/dist/components/ui/atoms/breadcrumb.d.ts.map +1 -1
  23. package/dist/components/ui/atoms/card.d.ts +1 -1
  24. package/dist/components/ui/atoms/card.d.ts.map +1 -1
  25. package/dist/components/ui/atoms/chart.d.ts +1 -1
  26. package/dist/components/ui/atoms/chart.d.ts.map +1 -1
  27. package/dist/components/ui/atoms/chat-container.d.ts +1 -1
  28. package/dist/components/ui/atoms/chat-container.d.ts.map +1 -1
  29. package/dist/components/ui/atoms/code-block.d.ts +1 -1
  30. package/dist/components/ui/atoms/code-block.d.ts.map +1 -1
  31. package/dist/components/ui/atoms/collapsible.d.ts +1 -1
  32. package/dist/components/ui/atoms/command.d.ts +1 -1
  33. package/dist/components/ui/atoms/command.d.ts.map +1 -1
  34. package/dist/components/ui/atoms/command.js +364 -288
  35. package/dist/components/ui/atoms/copy-button.d.ts +1 -1
  36. package/dist/components/ui/atoms/copy-button.d.ts.map +1 -1
  37. package/dist/components/ui/atoms/dropdown-menu.d.ts +1 -1
  38. package/dist/components/ui/atoms/dropdown-menu.d.ts.map +1 -1
  39. package/dist/components/ui/atoms/form.d.ts +1 -1
  40. package/dist/components/ui/atoms/form.d.ts.map +1 -1
  41. package/dist/components/ui/atoms/hover-card.d.ts +1 -1
  42. package/dist/components/ui/atoms/icons/granola.d.ts +4 -0
  43. package/dist/components/ui/atoms/icons/granola.d.ts.map +1 -0
  44. package/dist/components/ui/atoms/icons/granola.js +20 -0
  45. package/dist/components/ui/atoms/icons/index.d.ts +1 -0
  46. package/dist/components/ui/atoms/icons/index.d.ts.map +1 -1
  47. package/dist/components/ui/atoms/icons/index.js +156 -154
  48. package/dist/components/ui/atoms/index.d.ts +3 -0
  49. package/dist/components/ui/atoms/index.d.ts.map +1 -1
  50. package/dist/components/ui/atoms/index.js +514 -504
  51. package/dist/components/ui/atoms/json-highlight.d.ts +60 -0
  52. package/dist/components/ui/atoms/json-highlight.d.ts.map +1 -0
  53. package/dist/components/ui/atoms/json-highlight.js +77 -0
  54. package/dist/components/ui/atoms/loader.d.ts +1 -1
  55. package/dist/components/ui/atoms/loader.d.ts.map +1 -1
  56. package/dist/components/ui/atoms/markdown.js +1 -1
  57. package/dist/components/ui/atoms/popover.d.ts +1 -1
  58. package/dist/components/ui/atoms/popover.d.ts.map +1 -1
  59. package/dist/components/ui/atoms/resizable.d.ts +1 -1
  60. package/dist/components/ui/atoms/resizable.d.ts.map +1 -1
  61. package/dist/components/ui/atoms/scroll-button.d.ts +1 -1
  62. package/dist/components/ui/atoms/scroll-button.d.ts.map +1 -1
  63. package/dist/components/ui/atoms/scroll-button.js +8 -8
  64. package/dist/components/ui/atoms/sheet.d.ts +1 -1
  65. package/dist/components/ui/atoms/sheet.d.ts.map +1 -1
  66. package/dist/components/ui/atoms/table.d.ts +1 -1
  67. package/dist/components/ui/atoms/table.d.ts.map +1 -1
  68. package/dist/components/ui/atoms/tabs.d.ts +1 -1
  69. package/dist/components/ui/atoms/tabs.d.ts.map +1 -1
  70. package/dist/components/ui/atoms/tooltip.d.ts +4 -2
  71. package/dist/components/ui/atoms/tooltip.d.ts.map +1 -1
  72. package/dist/components/ui/atoms/tooltip.js +3 -2
  73. package/dist/components/ui/atoms/view-tools-control.d.ts +1 -1
  74. package/dist/components/ui/atoms/view-tools-control.d.ts.map +1 -1
  75. package/dist/components/ui/atoms/view-tools-control.js +20 -19
  76. package/dist/components/ui/index.js +597 -567
  77. package/dist/components/ui/molecules/chat-message-list.d.ts +5 -2
  78. package/dist/components/ui/molecules/chat-message-list.d.ts.map +1 -1
  79. package/dist/components/ui/molecules/chat-message-list.js +2 -2
  80. package/dist/components/ui/molecules/index.d.ts +8 -0
  81. package/dist/components/ui/molecules/index.d.ts.map +1 -1
  82. package/dist/components/ui/molecules/index.js +48 -28
  83. package/dist/components/ui/molecules/message.d.ts +2 -2
  84. package/dist/components/ui/molecules/message.d.ts.map +1 -1
  85. package/dist/components/ui/molecules/message.js +1 -1
  86. package/dist/components/ui/molecules/prompt-input.d.ts +1 -1
  87. package/dist/components/ui/molecules/prompt-input.d.ts.map +1 -1
  88. package/dist/components/ui/molecules/prompt-input.js +20 -20
  89. package/dist/components/ui/molecules/requirement-badges.js +9 -5
  90. package/dist/components/ui/molecules/switcher.d.ts +83 -0
  91. package/dist/components/ui/molecules/switcher.d.ts.map +1 -0
  92. package/dist/components/ui/molecules/switcher.js +164 -0
  93. package/dist/components/ui/molecules/tool-authorization.d.ts +56 -0
  94. package/dist/components/ui/molecules/tool-authorization.d.ts.map +1 -0
  95. package/dist/components/ui/molecules/tool-authorization.js +160 -0
  96. package/dist/components/ui/molecules/tool-call-accordion.d.ts +36 -0
  97. package/dist/components/ui/molecules/tool-call-accordion.d.ts.map +1 -0
  98. package/dist/components/ui/molecules/tool-call-accordion.js +301 -0
  99. package/dist/components/ui/molecules/toolkit-card.js +1 -1
  100. package/dist/components/ui/molecules/user-nav.d.ts +65 -0
  101. package/dist/components/ui/molecules/user-nav.d.ts.map +1 -0
  102. package/dist/components/ui/molecules/user-nav.js +154 -0
  103. package/dist/components/ui/pages/chat-page.d.ts +18 -10
  104. package/dist/components/ui/pages/chat-page.d.ts.map +1 -1
  105. package/dist/components/ui/pages/chat-page.js +328 -243
  106. package/dist/components/ui/pages/login-page.js +6 -6
  107. package/dist/components/ui/templates/chat-template.d.ts +1 -1
  108. package/dist/components/ui/templates/chat-template.d.ts.map +1 -1
  109. package/dist/components/ui/templates/chat-template.js +11 -11
  110. package/dist/{highlighted-body-TPN3WLV5-DyOGcftJ.js → highlighted-body-TPN3WLV5-D6UnKGod.js} +1 -1
  111. package/dist/lib/utils.js +1 -1
  112. package/dist/main.js +623 -593
  113. package/dist/{markdown-9KGBuupR.js → markdown-D0xxRbwP.js} +2597 -2592
  114. package/dist/mermaid-O7DHMXV3-gUrB-Xs1.js +4 -0
  115. package/dist/metadata/toolkit-icons.d.ts.map +1 -1
  116. package/dist/metadata/toolkit-icons.js +130 -128
  117. package/dist/metadata/toolkits.d.ts.map +1 -1
  118. package/dist/metadata/toolkits.js +13 -0
  119. package/dist/{toolkit-card-k8jio69G.js → toolkit-card-B97E7TBA.js} +15 -12
  120. package/package.json +6 -6
  121. package/dist/mermaid-O7DHMXV3-CUp9wvRi.js +0 -4
@@ -1,404 +1,480 @@
1
- import { jsx as C, jsxs as ne } from "react/jsx-runtime";
2
- import { R as Se, P as Ie, O as Re, a as Ae } from "../../../index-By-GFSsC.js";
1
+ import { jsx as x, jsxs as le } from "react/jsx-runtime";
2
+ import { R as Re, P as _e, O as Ae, a as $e } from "../../../index-By-GFSsC.js";
3
3
  import * as l from "react";
4
- import { P as A } from "../../../index-DLohNuco.js";
5
- import { u as j } from "../../../index-Cv867SGx.js";
6
- import { b as V } from "../../../index-D2LZVjSn.js";
4
+ import "react-dom";
5
+ import { b as O } from "../../../index-D2LZVjSn.js";
6
+ import { u as V } from "../../../index-Cv867SGx.js";
7
7
  import { SearchIcon as De } from "lucide-react";
8
- import { Dialog as _e, DialogHeader as Me, DialogTitle as $e, DialogDescription as Ne, DialogContent as Pe } from "./dialog.js";
9
- import { cn as D } from "../../../lib/utils.js";
10
- var pe = 1, Fe = 0.9, Ke = 0.8, je = 0.17, ee = 0.1, te = 0.999, Le = 0.9999, qe = 0.99, Ve = /[\\\/_+.#"@\[\(\{&]/, ze = /[\\\/_+.#"@\[\(\{&]/g, Oe = /[\s-]/, he = /[\s-]/g;
11
- function le(e, n, r, s, o, i, c) {
12
- if (i === n.length) return o === e.length ? pe : qe;
13
- var f = `${o},${i}`;
14
- if (c[f] !== void 0) return c[f];
15
- for (var b = s.charAt(i), u = r.indexOf(b, o), v = 0, g, S, w, I; u >= 0; ) g = le(e, n, r, s, u + 1, i + 1, c), g > v && (u === o ? g *= pe : Ve.test(e.charAt(u - 1)) ? (g *= Ke, w = e.slice(o, u - 1).match(ze), w && o > 0 && (g *= Math.pow(te, w.length))) : Oe.test(e.charAt(u - 1)) ? (g *= Fe, I = e.slice(o, u - 1).match(he), I && o > 0 && (g *= Math.pow(te, I.length))) : (g *= je, o > 0 && (g *= Math.pow(te, u - o))), e.charAt(u) !== n.charAt(i) && (g *= Le)), (g < ee && r.charAt(u - 1) === s.charAt(i + 1) || s.charAt(i + 1) === s.charAt(i) && r.charAt(u - 1) !== s.charAt(i)) && (S = le(e, n, r, s, u + 1, i + 2, c), S * ee > g && (g = S * ee)), g > v && (v = g), u = r.indexOf(b, u + 1);
16
- return c[f] = v, v;
8
+ import { Dialog as Ne, DialogHeader as Pe, DialogTitle as Me, DialogDescription as je, DialogContent as Le } from "./dialog.js";
9
+ import { cn as _ } from "../../../lib/utils.js";
10
+ var ve = 1, Ve = 0.9, Oe = 0.8, Fe = 0.17, te = 0.1, re = 0.999, Ke = 0.9999, ze = 0.99, Te = /[\\\/_+.#"@\[\(\{&]/, qe = /[\\\/_+.#"@\[\(\{&]/g, We = /[\s-]/, be = /[\s-]/g;
11
+ function ae(e, t, r, i, a, o, d) {
12
+ if (o === t.length) return a === e.length ? ve : ze;
13
+ var m = `${a},${o}`;
14
+ if (d[m] !== void 0) return d[m];
15
+ for (var p = i.charAt(o), c = r.indexOf(p, a), v = 0, h, S, k, I; c >= 0; ) h = ae(e, t, r, i, c + 1, o + 1, d), h > v && (c === a ? h *= ve : Te.test(e.charAt(c - 1)) ? (h *= Oe, k = e.slice(a, c - 1).match(qe), k && a > 0 && (h *= Math.pow(re, k.length))) : We.test(e.charAt(c - 1)) ? (h *= Ve, I = e.slice(a, c - 1).match(be), I && a > 0 && (h *= Math.pow(re, I.length))) : (h *= Fe, a > 0 && (h *= Math.pow(re, c - a))), e.charAt(c) !== t.charAt(o) && (h *= Ke)), (h < te && r.charAt(c - 1) === i.charAt(o + 1) || i.charAt(o + 1) === i.charAt(o) && r.charAt(c - 1) !== i.charAt(o)) && (S = ae(e, t, r, i, c + 1, o + 2, d), S * te > h && (h = S * te)), h > v && (v = h), c = r.indexOf(p, c + 1);
16
+ return d[m] = v, v;
17
17
  }
18
- function ve(e) {
19
- return e.toLowerCase().replace(he, " ");
18
+ function ge(e) {
19
+ return e.toLowerCase().replace(be, " ");
20
20
  }
21
- function Be(e, n, r) {
22
- return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, le(e, n, ve(e), ve(n), 0, 0, {});
21
+ function Be(e, t, r) {
22
+ return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, ae(e, t, ge(e), ge(t), 0, 0, {});
23
23
  }
24
- var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Ge = '[cmdk-group-heading=""]', be = '[cmdk-item=""]', ge = `${be}:not([aria-disabled="true"])`, ae = "cmdk-item-select", F = "data-value", He = (e, n, r) => Be(e, n, r), xe = l.createContext(void 0), z = () => l.useContext(xe), ke = l.createContext(void 0), oe = () => l.useContext(ke), we = l.createContext(void 0), ye = l.forwardRef((e, n) => {
25
- let r = K(() => {
26
- var t, d;
27
- return { search: "", value: (d = (t = e.value) != null ? t : e.defaultValue) != null ? d : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
28
- }), s = K(() => /* @__PURE__ */ new Set()), o = K(() => /* @__PURE__ */ new Map()), i = K(() => /* @__PURE__ */ new Map()), c = K(() => /* @__PURE__ */ new Set()), f = Ee(e), { label: b, children: u, value: v, onValueChange: g, filter: S, shouldFilter: w, loop: I, disablePointerSelection: H = !1, vimBindings: _ = !0, ...O } = e, T = j(), ue = j(), U = j(), M = l.useRef(null), x = rt();
29
- $(() => {
24
+ var He = /* @__PURE__ */ Symbol.for("react.lazy"), W = l[" use ".trim().toString()];
25
+ function Ge(e) {
26
+ return typeof e == "object" && e !== null && "then" in e;
27
+ }
28
+ function ye(e) {
29
+ return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === He && "_payload" in e && Ge(e._payload);
30
+ }
31
+ // @__NO_SIDE_EFFECTS__
32
+ function Ue(e) {
33
+ const t = /* @__PURE__ */ Ye(e), r = l.forwardRef((i, a) => {
34
+ let { children: o, ...d } = i;
35
+ ye(o) && typeof W == "function" && (o = W(o._payload));
36
+ const m = l.Children.toArray(o), p = m.find(Je);
37
+ if (p) {
38
+ const c = p.props.children, v = m.map((h) => h === p ? l.Children.count(c) > 1 ? l.Children.only(null) : l.isValidElement(c) ? c.props.children : null : h);
39
+ return /* @__PURE__ */ x(t, { ...d, ref: a, children: l.isValidElement(c) ? l.cloneElement(c, void 0, v) : null });
40
+ }
41
+ return /* @__PURE__ */ x(t, { ...d, ref: a, children: o });
42
+ });
43
+ return r.displayName = `${e}.Slot`, r;
44
+ }
45
+ // @__NO_SIDE_EFFECTS__
46
+ function Ye(e) {
47
+ const t = l.forwardRef((r, i) => {
48
+ let { children: a, ...o } = r;
49
+ if (ye(a) && typeof W == "function" && (a = W(a._payload)), l.isValidElement(a)) {
50
+ const d = Qe(a), m = Xe(o, a.props);
51
+ return a.type !== l.Fragment && (m.ref = i ? O(i, d) : d), l.cloneElement(a, m);
52
+ }
53
+ return l.Children.count(a) > 1 ? l.Children.only(null) : null;
54
+ });
55
+ return t.displayName = `${e}.SlotClone`, t;
56
+ }
57
+ var Ze = /* @__PURE__ */ Symbol("radix.slottable");
58
+ function Je(e) {
59
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Ze;
60
+ }
61
+ function Xe(e, t) {
62
+ const r = { ...t };
63
+ for (const i in t) {
64
+ const a = e[i], o = t[i];
65
+ /^on[A-Z]/.test(i) ? a && o ? r[i] = (...m) => {
66
+ const p = o(...m);
67
+ return a(...m), p;
68
+ } : a && (r[i] = a) : i === "style" ? r[i] = { ...a, ...o } : i === "className" && (r[i] = [a, o].filter(Boolean).join(" "));
69
+ }
70
+ return { ...e, ...r };
71
+ }
72
+ function Qe(e) {
73
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
74
+ return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
75
+ }
76
+ var et = [
77
+ "a",
78
+ "button",
79
+ "div",
80
+ "form",
81
+ "h2",
82
+ "h3",
83
+ "img",
84
+ "input",
85
+ "label",
86
+ "li",
87
+ "nav",
88
+ "ol",
89
+ "p",
90
+ "select",
91
+ "span",
92
+ "svg",
93
+ "ul"
94
+ ], A = et.reduce((e, t) => {
95
+ const r = /* @__PURE__ */ Ue(`Primitive.${t}`), i = l.forwardRef((a, o) => {
96
+ const { asChild: d, ...m } = a, p = d ? r : t;
97
+ return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ x(p, { ...m, ref: o });
98
+ });
99
+ return i.displayName = `Primitive.${t}`, { ...e, [t]: i };
100
+ }, {}), K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', tt = '[cmdk-group-heading=""]', xe = '[cmdk-item=""]', he = `${xe}:not([aria-disabled="true"])`, oe = "cmdk-item-select", j = "data-value", rt = (e, t, r) => Be(e, t, r), we = l.createContext(void 0), z = () => l.useContext(we), ke = l.createContext(void 0), ie = () => l.useContext(ke), Ee = l.createContext(void 0), Ce = l.forwardRef((e, t) => {
101
+ let r = L(() => {
102
+ var n, s;
103
+ return { search: "", value: (s = (n = e.value) != null ? n : e.defaultValue) != null ? s : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
104
+ }), i = L(() => /* @__PURE__ */ new Set()), a = L(() => /* @__PURE__ */ new Map()), o = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Set()), m = Se(e), { label: p, children: c, value: v, onValueChange: h, filter: S, shouldFilter: k, loop: I, disablePointerSelection: H = !1, vimBindings: $ = !0, ...T } = e, G = V(), ue = V(), U = V(), D = l.useRef(null), y = ft();
105
+ N(() => {
30
106
  if (v !== void 0) {
31
- let t = v.trim();
32
- r.current.value = t, y.emit();
107
+ let n = v.trim();
108
+ r.current.value = n, E.emit();
33
109
  }
34
- }, [v]), $(() => {
35
- x(6, de);
110
+ }, [v]), N(() => {
111
+ y(6, de);
36
112
  }, []);
37
- let y = l.useMemo(() => ({ subscribe: (t) => (c.current.add(t), () => c.current.delete(t)), snapshot: () => r.current, setState: (t, d, m) => {
38
- var a, p, h, E;
39
- if (!Object.is(r.current[t], d)) {
40
- if (r.current[t] = d, t === "search") Y(), J(), x(1, X);
41
- else if (t === "value") {
113
+ let E = l.useMemo(() => ({ subscribe: (n) => (d.current.add(n), () => d.current.delete(n)), snapshot: () => r.current, setState: (n, s, f) => {
114
+ var u, g, b, C;
115
+ if (!Object.is(r.current[n], s)) {
116
+ if (r.current[n] = s, n === "search") X(), Z(), y(1, J);
117
+ else if (n === "value") {
42
118
  if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
43
- let k = document.getElementById(U);
44
- k ? k.focus() : (a = document.getElementById(T)) == null || a.focus();
119
+ let w = document.getElementById(U);
120
+ w ? w.focus() : (u = document.getElementById(G)) == null || u.focus();
45
121
  }
46
- if (x(7, () => {
47
- var k;
48
- r.current.selectedItemId = (k = P()) == null ? void 0 : k.id, y.emit();
49
- }), m || x(5, de), ((p = f.current) == null ? void 0 : p.value) !== void 0) {
50
- let k = d ?? "";
51
- (E = (h = f.current).onValueChange) == null || E.call(h, k);
122
+ if (y(7, () => {
123
+ var w;
124
+ r.current.selectedItemId = (w = M()) == null ? void 0 : w.id, E.emit();
125
+ }), f || y(5, de), ((g = m.current) == null ? void 0 : g.value) !== void 0) {
126
+ let w = s ?? "";
127
+ (C = (b = m.current).onValueChange) == null || C.call(b, w);
52
128
  return;
53
129
  }
54
130
  }
55
- y.emit();
131
+ E.emit();
56
132
  }
57
133
  }, emit: () => {
58
- c.current.forEach((t) => t());
59
- } }), []), W = l.useMemo(() => ({ value: (t, d, m) => {
60
- var a;
61
- d !== ((a = i.current.get(t)) == null ? void 0 : a.value) && (i.current.set(t, { value: d, keywords: m }), r.current.filtered.items.set(t, ie(d, m)), x(2, () => {
62
- J(), y.emit();
134
+ d.current.forEach((n) => n());
135
+ } }), []), Y = l.useMemo(() => ({ value: (n, s, f) => {
136
+ var u;
137
+ s !== ((u = o.current.get(n)) == null ? void 0 : u.value) && (o.current.set(n, { value: s, keywords: f }), r.current.filtered.items.set(n, ce(s, f)), y(2, () => {
138
+ Z(), E.emit();
63
139
  }));
64
- }, item: (t, d) => (s.current.add(t), d && (o.current.has(d) ? o.current.get(d).add(t) : o.current.set(d, /* @__PURE__ */ new Set([t]))), x(3, () => {
65
- Y(), J(), r.current.value || X(), y.emit();
140
+ }, item: (n, s) => (i.current.add(n), s && (a.current.has(s) ? a.current.get(s).add(n) : a.current.set(s, /* @__PURE__ */ new Set([n]))), y(3, () => {
141
+ X(), Z(), r.current.value || J(), E.emit();
66
142
  }), () => {
67
- i.current.delete(t), s.current.delete(t), r.current.filtered.items.delete(t);
68
- let m = P();
69
- x(4, () => {
70
- Y(), m?.getAttribute("id") === t && X(), y.emit();
143
+ o.current.delete(n), i.current.delete(n), r.current.filtered.items.delete(n);
144
+ let f = M();
145
+ y(4, () => {
146
+ X(), f?.getAttribute("id") === n && J(), E.emit();
71
147
  });
72
- }), group: (t) => (o.current.has(t) || o.current.set(t, /* @__PURE__ */ new Set()), () => {
73
- i.current.delete(t), o.current.delete(t);
74
- }), filter: () => f.current.shouldFilter, label: b || e["aria-label"], getDisablePointerSelection: () => f.current.disablePointerSelection, listId: T, inputId: U, labelId: ue, listInnerRef: M }), []);
75
- function ie(t, d) {
76
- var m, a;
77
- let p = (a = (m = f.current) == null ? void 0 : m.filter) != null ? a : He;
78
- return t ? p(t, r.current.search, d) : 0;
148
+ }), group: (n) => (a.current.has(n) || a.current.set(n, /* @__PURE__ */ new Set()), () => {
149
+ o.current.delete(n), a.current.delete(n);
150
+ }), filter: () => m.current.shouldFilter, label: p || e["aria-label"], getDisablePointerSelection: () => m.current.disablePointerSelection, listId: G, inputId: U, labelId: ue, listInnerRef: D }), []);
151
+ function ce(n, s) {
152
+ var f, u;
153
+ let g = (u = (f = m.current) == null ? void 0 : f.filter) != null ? u : rt;
154
+ return n ? g(n, r.current.search, s) : 0;
79
155
  }
80
- function J() {
81
- if (!r.current.search || f.current.shouldFilter === !1) return;
82
- let t = r.current.filtered.items, d = [];
83
- r.current.filtered.groups.forEach((a) => {
84
- let p = o.current.get(a), h = 0;
85
- p.forEach((E) => {
86
- let k = t.get(E);
87
- h = Math.max(k, h);
88
- }), d.push([a, h]);
156
+ function Z() {
157
+ if (!r.current.search || m.current.shouldFilter === !1) return;
158
+ let n = r.current.filtered.items, s = [];
159
+ r.current.filtered.groups.forEach((u) => {
160
+ let g = a.current.get(u), b = 0;
161
+ g.forEach((C) => {
162
+ let w = n.get(C);
163
+ b = Math.max(w, b);
164
+ }), s.push([u, b]);
89
165
  });
90
- let m = M.current;
91
- L().sort((a, p) => {
92
- var h, E;
93
- let k = a.getAttribute("id"), B = p.getAttribute("id");
94
- return ((h = t.get(B)) != null ? h : 0) - ((E = t.get(k)) != null ? E : 0);
95
- }).forEach((a) => {
96
- let p = a.closest(re);
97
- p ? p.appendChild(a.parentElement === p ? a : a.closest(`${re} > *`)) : m.appendChild(a.parentElement === m ? a : a.closest(`${re} > *`));
98
- }), d.sort((a, p) => p[1] - a[1]).forEach((a) => {
99
- var p;
100
- let h = (p = M.current) == null ? void 0 : p.querySelector(`${q}[${F}="${encodeURIComponent(a[0])}"]`);
101
- h?.parentElement.appendChild(h);
166
+ let f = D.current;
167
+ F().sort((u, g) => {
168
+ var b, C;
169
+ let w = u.getAttribute("id"), q = g.getAttribute("id");
170
+ return ((b = n.get(q)) != null ? b : 0) - ((C = n.get(w)) != null ? C : 0);
171
+ }).forEach((u) => {
172
+ let g = u.closest(ne);
173
+ g ? g.appendChild(u.parentElement === g ? u : u.closest(`${ne} > *`)) : f.appendChild(u.parentElement === f ? u : u.closest(`${ne} > *`));
174
+ }), s.sort((u, g) => g[1] - u[1]).forEach((u) => {
175
+ var g;
176
+ let b = (g = D.current) == null ? void 0 : g.querySelector(`${K}[${j}="${encodeURIComponent(u[0])}"]`);
177
+ b?.parentElement.appendChild(b);
102
178
  });
103
179
  }
104
- function X() {
105
- let t = L().find((m) => m.getAttribute("aria-disabled") !== "true"), d = t?.getAttribute(F);
106
- y.setState("value", d || void 0);
180
+ function J() {
181
+ let n = F().find((f) => f.getAttribute("aria-disabled") !== "true"), s = n?.getAttribute(j);
182
+ E.setState("value", s || void 0);
107
183
  }
108
- function Y() {
109
- var t, d, m, a;
110
- if (!r.current.search || f.current.shouldFilter === !1) {
111
- r.current.filtered.count = s.current.size;
184
+ function X() {
185
+ var n, s, f, u;
186
+ if (!r.current.search || m.current.shouldFilter === !1) {
187
+ r.current.filtered.count = i.current.size;
112
188
  return;
113
189
  }
114
190
  r.current.filtered.groups = /* @__PURE__ */ new Set();
115
- let p = 0;
116
- for (let h of s.current) {
117
- let E = (d = (t = i.current.get(h)) == null ? void 0 : t.value) != null ? d : "", k = (a = (m = i.current.get(h)) == null ? void 0 : m.keywords) != null ? a : [], B = ie(E, k);
118
- r.current.filtered.items.set(h, B), B > 0 && p++;
191
+ let g = 0;
192
+ for (let b of i.current) {
193
+ let C = (s = (n = o.current.get(b)) == null ? void 0 : n.value) != null ? s : "", w = (u = (f = o.current.get(b)) == null ? void 0 : f.keywords) != null ? u : [], q = ce(C, w);
194
+ r.current.filtered.items.set(b, q), q > 0 && g++;
119
195
  }
120
- for (let [h, E] of o.current) for (let k of E) if (r.current.filtered.items.get(k) > 0) {
121
- r.current.filtered.groups.add(h);
196
+ for (let [b, C] of a.current) for (let w of C) if (r.current.filtered.items.get(w) > 0) {
197
+ r.current.filtered.groups.add(b);
122
198
  break;
123
199
  }
124
- r.current.filtered.count = p;
200
+ r.current.filtered.count = g;
125
201
  }
126
202
  function de() {
127
- var t, d, m;
128
- let a = P();
129
- a && (((t = a.parentElement) == null ? void 0 : t.firstChild) === a && ((m = (d = a.closest(q)) == null ? void 0 : d.querySelector(Ge)) == null || m.scrollIntoView({ block: "nearest" })), a.scrollIntoView({ block: "nearest" }));
203
+ var n, s, f;
204
+ let u = M();
205
+ u && (((n = u.parentElement) == null ? void 0 : n.firstChild) === u && ((f = (s = u.closest(K)) == null ? void 0 : s.querySelector(tt)) == null || f.scrollIntoView({ block: "nearest" })), u.scrollIntoView({ block: "nearest" }));
130
206
  }
131
- function P() {
132
- var t;
133
- return (t = M.current) == null ? void 0 : t.querySelector(`${be}[aria-selected="true"]`);
207
+ function M() {
208
+ var n;
209
+ return (n = D.current) == null ? void 0 : n.querySelector(`${xe}[aria-selected="true"]`);
134
210
  }
135
- function L() {
136
- var t;
137
- return Array.from(((t = M.current) == null ? void 0 : t.querySelectorAll(ge)) || []);
211
+ function F() {
212
+ var n;
213
+ return Array.from(((n = D.current) == null ? void 0 : n.querySelectorAll(he)) || []);
138
214
  }
139
- function Q(t) {
140
- let d = L()[t];
141
- d && y.setState("value", d.getAttribute(F));
215
+ function Q(n) {
216
+ let s = F()[n];
217
+ s && E.setState("value", s.getAttribute(j));
142
218
  }
143
- function Z(t) {
144
- var d;
145
- let m = P(), a = L(), p = a.findIndex((E) => E === m), h = a[p + t];
146
- (d = f.current) != null && d.loop && (h = p + t < 0 ? a[a.length - 1] : p + t === a.length ? a[0] : a[p + t]), h && y.setState("value", h.getAttribute(F));
219
+ function ee(n) {
220
+ var s;
221
+ let f = M(), u = F(), g = u.findIndex((C) => C === f), b = u[g + n];
222
+ (s = m.current) != null && s.loop && (b = g + n < 0 ? u[u.length - 1] : g + n === u.length ? u[0] : u[g + n]), b && E.setState("value", b.getAttribute(j));
147
223
  }
148
- function ce(t) {
149
- let d = P(), m = d?.closest(q), a;
150
- for (; m && !a; ) m = t > 0 ? et(m, q) : tt(m, q), a = m?.querySelector(ge);
151
- a ? y.setState("value", a.getAttribute(F)) : Z(t);
224
+ function se(n) {
225
+ let s = M(), f = s?.closest(K), u;
226
+ for (; f && !u; ) f = n > 0 ? st(f, K) : mt(f, K), u = f?.querySelector(he);
227
+ u ? E.setState("value", u.getAttribute(j)) : ee(n);
152
228
  }
153
- let se = () => Q(L().length - 1), me = (t) => {
154
- t.preventDefault(), t.metaKey ? se() : t.altKey ? ce(1) : Z(1);
155
- }, fe = (t) => {
156
- t.preventDefault(), t.metaKey ? Q(0) : t.altKey ? ce(-1) : Z(-1);
229
+ let me = () => Q(F().length - 1), fe = (n) => {
230
+ n.preventDefault(), n.metaKey ? me() : n.altKey ? se(1) : ee(1);
231
+ }, pe = (n) => {
232
+ n.preventDefault(), n.metaKey ? Q(0) : n.altKey ? se(-1) : ee(-1);
157
233
  };
158
- return l.createElement(A.div, { ref: n, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (t) => {
159
- var d;
160
- (d = O.onKeyDown) == null || d.call(O, t);
161
- let m = t.nativeEvent.isComposing || t.keyCode === 229;
162
- if (!(t.defaultPrevented || m)) switch (t.key) {
234
+ return l.createElement(A.div, { ref: t, tabIndex: -1, ...T, "cmdk-root": "", onKeyDown: (n) => {
235
+ var s;
236
+ (s = T.onKeyDown) == null || s.call(T, n);
237
+ let f = n.nativeEvent.isComposing || n.keyCode === 229;
238
+ if (!(n.defaultPrevented || f)) switch (n.key) {
163
239
  case "n":
164
240
  case "j": {
165
- _ && t.ctrlKey && me(t);
241
+ $ && n.ctrlKey && fe(n);
166
242
  break;
167
243
  }
168
244
  case "ArrowDown": {
169
- me(t);
245
+ fe(n);
170
246
  break;
171
247
  }
172
248
  case "p":
173
249
  case "k": {
174
- _ && t.ctrlKey && fe(t);
250
+ $ && n.ctrlKey && pe(n);
175
251
  break;
176
252
  }
177
253
  case "ArrowUp": {
178
- fe(t);
254
+ pe(n);
179
255
  break;
180
256
  }
181
257
  case "Home": {
182
- t.preventDefault(), Q(0);
258
+ n.preventDefault(), Q(0);
183
259
  break;
184
260
  }
185
261
  case "End": {
186
- t.preventDefault(), se();
262
+ n.preventDefault(), me();
187
263
  break;
188
264
  }
189
265
  case "Enter": {
190
- t.preventDefault();
191
- let a = P();
192
- if (a) {
193
- let p = new Event(ae);
194
- a.dispatchEvent(p);
266
+ n.preventDefault();
267
+ let u = M();
268
+ if (u) {
269
+ let g = new Event(oe);
270
+ u.dispatchEvent(g);
195
271
  }
196
272
  }
197
273
  }
198
- } }, l.createElement("label", { "cmdk-label": "", htmlFor: W.inputId, id: W.labelId, style: lt }, b), G(e, (t) => l.createElement(ke.Provider, { value: y }, l.createElement(xe.Provider, { value: W }, t))));
199
- }), Te = l.forwardRef((e, n) => {
200
- var r, s;
201
- let o = j(), i = l.useRef(null), c = l.useContext(we), f = z(), b = Ee(e), u = (s = (r = b.current) == null ? void 0 : r.forceMount) != null ? s : c?.forceMount;
202
- $(() => {
203
- if (!u) return f.item(o, c?.id);
204
- }, [u]);
205
- let v = Ce(o, i, [e.value, e.children, i], e.keywords), g = oe(), S = R((x) => x.value && x.value === v.current), w = R((x) => u || f.filter() === !1 ? !0 : x.search ? x.filtered.items.get(o) > 0 : !0);
274
+ } }, l.createElement("label", { "cmdk-label": "", htmlFor: Y.inputId, id: Y.labelId, style: vt }, p), B(e, (n) => l.createElement(ke.Provider, { value: E }, l.createElement(we.Provider, { value: Y }, n))));
275
+ }), nt = l.forwardRef((e, t) => {
276
+ var r, i;
277
+ let a = V(), o = l.useRef(null), d = l.useContext(Ee), m = z(), p = Se(e), c = (i = (r = p.current) == null ? void 0 : r.forceMount) != null ? i : d?.forceMount;
278
+ N(() => {
279
+ if (!c) return m.item(a, d?.id);
280
+ }, [c]);
281
+ let v = Ie(a, o, [e.value, e.children, o], e.keywords), h = ie(), S = R((y) => y.value && y.value === v.current), k = R((y) => c || m.filter() === !1 ? !0 : y.search ? y.filtered.items.get(a) > 0 : !0);
206
282
  l.useEffect(() => {
207
- let x = i.current;
208
- if (!(!x || e.disabled)) return x.addEventListener(ae, I), () => x.removeEventListener(ae, I);
209
- }, [w, e.onSelect, e.disabled]);
283
+ let y = o.current;
284
+ if (!(!y || e.disabled)) return y.addEventListener(oe, I), () => y.removeEventListener(oe, I);
285
+ }, [k, e.onSelect, e.disabled]);
210
286
  function I() {
211
- var x, y;
212
- H(), (y = (x = b.current).onSelect) == null || y.call(x, v.current);
287
+ var y, E;
288
+ H(), (E = (y = p.current).onSelect) == null || E.call(y, v.current);
213
289
  }
214
290
  function H() {
215
- g.setState("value", v.current, !0);
291
+ h.setState("value", v.current, !0);
216
292
  }
217
- if (!w) return null;
218
- let { disabled: _, value: O, onSelect: T, forceMount: ue, keywords: U, ...M } = e;
219
- return l.createElement(A.div, { ref: V(i, n), ...M, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!_, "aria-selected": !!S, "data-disabled": !!_, "data-selected": !!S, onPointerMove: _ || f.getDisablePointerSelection() ? void 0 : H, onClick: _ ? void 0 : I }, e.children);
220
- }), Ue = l.forwardRef((e, n) => {
221
- let { heading: r, children: s, forceMount: o, ...i } = e, c = j(), f = l.useRef(null), b = l.useRef(null), u = j(), v = z(), g = R((w) => o || v.filter() === !1 ? !0 : w.search ? w.filtered.groups.has(c) : !0);
222
- $(() => v.group(c), []), Ce(c, f, [e.value, e.heading, b]);
223
- let S = l.useMemo(() => ({ id: c, forceMount: o }), [o]);
224
- return l.createElement(A.div, { ref: V(f, n), ...i, "cmdk-group": "", role: "presentation", hidden: g ? void 0 : !0 }, r && l.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, r), G(e, (w) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? u : void 0 }, l.createElement(we.Provider, { value: S }, w))));
225
- }), We = l.forwardRef((e, n) => {
226
- let { alwaysRender: r, ...s } = e, o = l.useRef(null), i = R((c) => !c.search);
227
- return !r && !i ? null : l.createElement(A.div, { ref: V(o, n), ...s, "cmdk-separator": "", role: "separator" });
228
- }), Je = l.forwardRef((e, n) => {
229
- let { onValueChange: r, ...s } = e, o = e.value != null, i = oe(), c = R((u) => u.search), f = R((u) => u.selectedItemId), b = z();
293
+ if (!k) return null;
294
+ let { disabled: $, value: T, onSelect: G, forceMount: ue, keywords: U, ...D } = e;
295
+ return l.createElement(A.div, { ref: O(o, t), ...D, id: a, "cmdk-item": "", role: "option", "aria-disabled": !!$, "aria-selected": !!S, "data-disabled": !!$, "data-selected": !!S, onPointerMove: $ || m.getDisablePointerSelection() ? void 0 : H, onClick: $ ? void 0 : I }, e.children);
296
+ }), lt = l.forwardRef((e, t) => {
297
+ let { heading: r, children: i, forceMount: a, ...o } = e, d = V(), m = l.useRef(null), p = l.useRef(null), c = V(), v = z(), h = R((k) => a || v.filter() === !1 ? !0 : k.search ? k.filtered.groups.has(d) : !0);
298
+ N(() => v.group(d), []), Ie(d, m, [e.value, e.heading, p]);
299
+ let S = l.useMemo(() => ({ id: d, forceMount: a }), [a]);
300
+ return l.createElement(A.div, { ref: O(m, t), ...o, "cmdk-group": "", role: "presentation", hidden: h ? void 0 : !0 }, r && l.createElement("div", { ref: p, "cmdk-group-heading": "", "aria-hidden": !0, id: c }, r), B(e, (k) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? c : void 0 }, l.createElement(Ee.Provider, { value: S }, k))));
301
+ }), at = l.forwardRef((e, t) => {
302
+ let { alwaysRender: r, ...i } = e, a = l.useRef(null), o = R((d) => !d.search);
303
+ return !r && !o ? null : l.createElement(A.div, { ref: O(a, t), ...i, "cmdk-separator": "", role: "separator" });
304
+ }), ot = l.forwardRef((e, t) => {
305
+ let { onValueChange: r, ...i } = e, a = e.value != null, o = ie(), d = R((c) => c.search), m = R((c) => c.selectedItemId), p = z();
230
306
  return l.useEffect(() => {
231
- e.value != null && i.setState("search", e.value);
232
- }, [e.value]), l.createElement(A.input, { ref: n, ...s, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": f, id: b.inputId, type: "text", value: o ? e.value : c, onChange: (u) => {
233
- o || i.setState("search", u.target.value), r?.(u.target.value);
307
+ e.value != null && o.setState("search", e.value);
308
+ }, [e.value]), l.createElement(A.input, { ref: t, ...i, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": p.listId, "aria-labelledby": p.labelId, "aria-activedescendant": m, id: p.inputId, type: "text", value: a ? e.value : d, onChange: (c) => {
309
+ a || o.setState("search", c.target.value), r?.(c.target.value);
234
310
  } });
235
- }), Xe = l.forwardRef((e, n) => {
236
- let { children: r, label: s = "Suggestions", ...o } = e, i = l.useRef(null), c = l.useRef(null), f = R((u) => u.selectedItemId), b = z();
311
+ }), it = l.forwardRef((e, t) => {
312
+ let { children: r, label: i = "Suggestions", ...a } = e, o = l.useRef(null), d = l.useRef(null), m = R((c) => c.selectedItemId), p = z();
237
313
  return l.useEffect(() => {
238
- if (c.current && i.current) {
239
- let u = c.current, v = i.current, g, S = new ResizeObserver(() => {
240
- g = requestAnimationFrame(() => {
241
- let w = u.offsetHeight;
242
- v.style.setProperty("--cmdk-list-height", w.toFixed(1) + "px");
314
+ if (d.current && o.current) {
315
+ let c = d.current, v = o.current, h, S = new ResizeObserver(() => {
316
+ h = requestAnimationFrame(() => {
317
+ let k = c.offsetHeight;
318
+ v.style.setProperty("--cmdk-list-height", k.toFixed(1) + "px");
243
319
  });
244
320
  });
245
- return S.observe(u), () => {
246
- cancelAnimationFrame(g), S.unobserve(u);
321
+ return S.observe(c), () => {
322
+ cancelAnimationFrame(h), S.unobserve(c);
247
323
  };
248
324
  }
249
- }, []), l.createElement(A.div, { ref: V(i, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": f, "aria-label": s, id: b.listId }, G(e, (u) => l.createElement("div", { ref: V(c, b.listInnerRef), "cmdk-list-sizer": "" }, u)));
250
- }), Ye = l.forwardRef((e, n) => {
251
- let { open: r, onOpenChange: s, overlayClassName: o, contentClassName: i, container: c, ...f } = e;
252
- return l.createElement(Se, { open: r, onOpenChange: s }, l.createElement(Ie, { container: c }, l.createElement(Re, { "cmdk-overlay": "", className: o }), l.createElement(Ae, { "aria-label": e.label, "cmdk-dialog": "", className: i }, l.createElement(ye, { ref: n, ...f }))));
253
- }), Qe = l.forwardRef((e, n) => R((r) => r.filtered.count === 0) ? l.createElement(A.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), Ze = l.forwardRef((e, n) => {
254
- let { progress: r, children: s, label: o = "Loading...", ...i } = e;
255
- return l.createElement(A.div, { ref: n, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, G(e, (c) => l.createElement("div", { "aria-hidden": !0 }, c)));
256
- }), N = Object.assign(ye, { List: Xe, Item: Te, Input: Je, Group: Ue, Separator: We, Dialog: Ye, Empty: Qe, Loading: Ze });
257
- function et(e, n) {
325
+ }, []), l.createElement(A.div, { ref: O(o, t), ...a, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": m, "aria-label": i, id: p.listId }, B(e, (c) => l.createElement("div", { ref: O(d, p.listInnerRef), "cmdk-list-sizer": "" }, c)));
326
+ }), ut = l.forwardRef((e, t) => {
327
+ let { open: r, onOpenChange: i, overlayClassName: a, contentClassName: o, container: d, ...m } = e;
328
+ return l.createElement(Re, { open: r, onOpenChange: i }, l.createElement(_e, { container: d }, l.createElement(Ae, { "cmdk-overlay": "", className: a }), l.createElement($e, { "aria-label": e.label, "cmdk-dialog": "", className: o }, l.createElement(Ce, { ref: t, ...m }))));
329
+ }), ct = l.forwardRef((e, t) => R((r) => r.filtered.count === 0) ? l.createElement(A.div, { ref: t, ...e, "cmdk-empty": "", role: "presentation" }) : null), dt = l.forwardRef((e, t) => {
330
+ let { progress: r, children: i, label: a = "Loading...", ...o } = e;
331
+ return l.createElement(A.div, { ref: t, ...o, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": a }, B(e, (d) => l.createElement("div", { "aria-hidden": !0 }, d)));
332
+ }), P = Object.assign(Ce, { List: it, Item: nt, Input: ot, Group: lt, Separator: at, Dialog: ut, Empty: ct, Loading: dt });
333
+ function st(e, t) {
258
334
  let r = e.nextElementSibling;
259
335
  for (; r; ) {
260
- if (r.matches(n)) return r;
336
+ if (r.matches(t)) return r;
261
337
  r = r.nextElementSibling;
262
338
  }
263
339
  }
264
- function tt(e, n) {
340
+ function mt(e, t) {
265
341
  let r = e.previousElementSibling;
266
342
  for (; r; ) {
267
- if (r.matches(n)) return r;
343
+ if (r.matches(t)) return r;
268
344
  r = r.previousElementSibling;
269
345
  }
270
346
  }
271
- function Ee(e) {
272
- let n = l.useRef(e);
273
- return $(() => {
274
- n.current = e;
275
- }), n;
347
+ function Se(e) {
348
+ let t = l.useRef(e);
349
+ return N(() => {
350
+ t.current = e;
351
+ }), t;
276
352
  }
277
- var $ = typeof window > "u" ? l.useEffect : l.useLayoutEffect;
278
- function K(e) {
279
- let n = l.useRef();
280
- return n.current === void 0 && (n.current = e()), n;
353
+ var N = typeof window > "u" ? l.useEffect : l.useLayoutEffect;
354
+ function L(e) {
355
+ let t = l.useRef();
356
+ return t.current === void 0 && (t.current = e()), t;
281
357
  }
282
358
  function R(e) {
283
- let n = oe(), r = () => e(n.snapshot());
284
- return l.useSyncExternalStore(n.subscribe, r, r);
359
+ let t = ie(), r = () => e(t.snapshot());
360
+ return l.useSyncExternalStore(t.subscribe, r, r);
285
361
  }
286
- function Ce(e, n, r, s = []) {
287
- let o = l.useRef(), i = z();
288
- return $(() => {
289
- var c;
290
- let f = (() => {
291
- var u;
362
+ function Ie(e, t, r, i = []) {
363
+ let a = l.useRef(), o = z();
364
+ return N(() => {
365
+ var d;
366
+ let m = (() => {
367
+ var c;
292
368
  for (let v of r) {
293
369
  if (typeof v == "string") return v.trim();
294
- if (typeof v == "object" && "current" in v) return v.current ? (u = v.current.textContent) == null ? void 0 : u.trim() : o.current;
370
+ if (typeof v == "object" && "current" in v) return v.current ? (c = v.current.textContent) == null ? void 0 : c.trim() : a.current;
295
371
  }
296
- })(), b = s.map((u) => u.trim());
297
- i.value(e, f, b), (c = n.current) == null || c.setAttribute(F, f), o.current = f;
298
- }), o;
372
+ })(), p = i.map((c) => c.trim());
373
+ o.value(e, m, p), (d = t.current) == null || d.setAttribute(j, m), a.current = m;
374
+ }), a;
299
375
  }
300
- var rt = () => {
301
- let [e, n] = l.useState(), r = K(() => /* @__PURE__ */ new Map());
302
- return $(() => {
303
- r.current.forEach((s) => s()), r.current = /* @__PURE__ */ new Map();
304
- }, [e]), (s, o) => {
305
- r.current.set(s, o), n({});
376
+ var ft = () => {
377
+ let [e, t] = l.useState(), r = L(() => /* @__PURE__ */ new Map());
378
+ return N(() => {
379
+ r.current.forEach((i) => i()), r.current = /* @__PURE__ */ new Map();
380
+ }, [e]), (i, a) => {
381
+ r.current.set(i, a), t({});
306
382
  };
307
383
  };
308
- function nt(e) {
309
- let n = e.type;
310
- return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
384
+ function pt(e) {
385
+ let t = e.type;
386
+ return typeof t == "function" ? t(e.props) : "render" in t ? t.render(e.props) : e;
311
387
  }
312
- function G({ asChild: e, children: n }, r) {
313
- return e && l.isValidElement(n) ? l.cloneElement(nt(n), { ref: n.ref }, r(n.props.children)) : r(n);
388
+ function B({ asChild: e, children: t }, r) {
389
+ return e && l.isValidElement(t) ? l.cloneElement(pt(t), { ref: t.ref }, r(t.props.children)) : r(t);
314
390
  }
315
- var lt = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
316
- function at({
391
+ var vt = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
392
+ function gt({
317
393
  className: e,
318
- ...n
394
+ ...t
319
395
  }) {
320
- return /* @__PURE__ */ C(
321
- N,
396
+ return /* @__PURE__ */ x(
397
+ P,
322
398
  {
323
- className: D(
399
+ className: _(
324
400
  "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
325
401
  e
326
402
  ),
327
403
  "data-slot": "command",
328
- ...n
404
+ ...t
329
405
  }
330
406
  );
331
407
  }
332
- function pt({
408
+ function St({
333
409
  title: e = "Command Palette",
334
- description: n = "Search for a command to run...",
410
+ description: t = "Search for a command to run...",
335
411
  children: r,
336
- className: s,
337
- showCloseButton: o = !0,
338
- ...i
412
+ className: i,
413
+ showCloseButton: a = !0,
414
+ ...o
339
415
  }) {
340
- return /* @__PURE__ */ ne(_e, { ...i, children: [
341
- /* @__PURE__ */ ne(Me, { className: "sr-only", children: [
342
- /* @__PURE__ */ C($e, { children: e }),
343
- /* @__PURE__ */ C(Ne, { children: n })
416
+ return /* @__PURE__ */ le(Ne, { ...o, children: [
417
+ /* @__PURE__ */ le(Pe, { className: "sr-only", children: [
418
+ /* @__PURE__ */ x(Me, { children: e }),
419
+ /* @__PURE__ */ x(je, { children: t })
344
420
  ] }),
345
- /* @__PURE__ */ C(
346
- Pe,
421
+ /* @__PURE__ */ x(
422
+ Le,
347
423
  {
348
- className: D("overflow-hidden p-0", s),
349
- showCloseButton: o,
350
- children: /* @__PURE__ */ C(at, { className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: r })
424
+ className: _("overflow-hidden p-0", i),
425
+ showCloseButton: a,
426
+ children: /* @__PURE__ */ x(gt, { className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: r })
351
427
  }
352
428
  )
353
429
  ] });
354
430
  }
355
- function vt({
431
+ function It({
356
432
  className: e,
357
- ...n
433
+ ...t
358
434
  }) {
359
- return /* @__PURE__ */ ne(
435
+ return /* @__PURE__ */ le(
360
436
  "div",
361
437
  {
362
438
  className: "flex h-9 items-center gap-2 border-b px-3",
363
439
  "data-slot": "command-input-wrapper",
364
440
  children: [
365
- /* @__PURE__ */ C(De, { className: "size-4 shrink-0 opacity-50" }),
366
- /* @__PURE__ */ C(
367
- N.Input,
441
+ /* @__PURE__ */ x(De, { className: "size-4 shrink-0 opacity-50" }),
442
+ /* @__PURE__ */ x(
443
+ P.Input,
368
444
  {
369
- className: D(
445
+ className: _(
370
446
  "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
371
447
  e
372
448
  ),
373
449
  "data-slot": "command-input",
374
- ...n
450
+ ...t
375
451
  }
376
452
  )
377
453
  ]
378
454
  }
379
455
  );
380
456
  }
381
- function gt({
457
+ function Rt({
382
458
  className: e,
383
- ...n
459
+ ...t
384
460
  }) {
385
- return /* @__PURE__ */ C(
386
- N.List,
461
+ return /* @__PURE__ */ x(
462
+ P.List,
387
463
  {
388
- className: D(
464
+ className: _(
389
465
  "max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",
390
466
  e
391
467
  ),
392
468
  "data-slot": "command-list",
393
- ...n
469
+ ...t
394
470
  }
395
471
  );
396
472
  }
397
- function ht({
473
+ function _t({
398
474
  ...e
399
475
  }) {
400
- return /* @__PURE__ */ C(
401
- N.Empty,
476
+ return /* @__PURE__ */ x(
477
+ P.Empty,
402
478
  {
403
479
  className: "py-6 text-center text-sm",
404
480
  "data-slot": "command-empty",
@@ -406,75 +482,75 @@ function ht({
406
482
  }
407
483
  );
408
484
  }
409
- function bt({
485
+ function At({
410
486
  className: e,
411
- ...n
487
+ ...t
412
488
  }) {
413
- return /* @__PURE__ */ C(
414
- N.Group,
489
+ return /* @__PURE__ */ x(
490
+ P.Group,
415
491
  {
416
- className: D(
492
+ className: _(
417
493
  "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",
418
494
  e
419
495
  ),
420
496
  "data-slot": "command-group",
421
- ...n
497
+ ...t
422
498
  }
423
499
  );
424
500
  }
425
- function xt({
501
+ function $t({
426
502
  className: e,
427
- ...n
503
+ ...t
428
504
  }) {
429
- return /* @__PURE__ */ C(
430
- N.Separator,
505
+ return /* @__PURE__ */ x(
506
+ P.Separator,
431
507
  {
432
- className: D("-mx-1 h-px bg-border", e),
508
+ className: _("-mx-1 h-px bg-border", e),
433
509
  "data-slot": "command-separator",
434
- ...n
510
+ ...t
435
511
  }
436
512
  );
437
513
  }
438
- function kt({
514
+ function Dt({
439
515
  className: e,
440
- ...n
516
+ ...t
441
517
  }) {
442
- return /* @__PURE__ */ C(
443
- N.Item,
518
+ return /* @__PURE__ */ x(
519
+ P.Item,
444
520
  {
445
- className: D(
521
+ className: _(
446
522
  "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
447
523
  e
448
524
  ),
449
525
  "data-slot": "command-item",
450
- ...n
526
+ ...t
451
527
  }
452
528
  );
453
529
  }
454
- function wt({
530
+ function Nt({
455
531
  className: e,
456
- ...n
532
+ ...t
457
533
  }) {
458
- return /* @__PURE__ */ C(
534
+ return /* @__PURE__ */ x(
459
535
  "span",
460
536
  {
461
- className: D(
537
+ className: _(
462
538
  "ml-auto text-muted-foreground text-xs tracking-widest",
463
539
  e
464
540
  ),
465
541
  "data-slot": "command-shortcut",
466
- ...n
542
+ ...t
467
543
  }
468
544
  );
469
545
  }
470
546
  export {
471
- at as Command,
472
- pt as CommandDialog,
473
- ht as CommandEmpty,
474
- bt as CommandGroup,
475
- vt as CommandInput,
476
- kt as CommandItem,
477
- gt as CommandList,
478
- xt as CommandSeparator,
479
- wt as CommandShortcut
547
+ gt as Command,
548
+ St as CommandDialog,
549
+ _t as CommandEmpty,
550
+ At as CommandGroup,
551
+ It as CommandInput,
552
+ Dt as CommandItem,
553
+ Rt as CommandList,
554
+ $t as CommandSeparator,
555
+ Nt as CommandShortcut
480
556
  };