teodor-new-chat-ui 1.2.2 → 1.2.4

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.esm.js CHANGED
@@ -8,7 +8,7 @@ import { clsx as kn } from "clsx";
8
8
  import { twMerge as $n } from "tailwind-merge";
9
9
  import * as sr from "react-dom";
10
10
  const ir = 1e4, It = 200, In = /^[a-zA-Z0-9\-_]{1,50}$/;
11
- function Ui(e) {
11
+ function Ji(e) {
12
12
  return typeof e != "string" ? String(e) : e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;").replace(/\//g, "&#x2F;").trim();
13
13
  }
14
14
  function me(e) {
@@ -37,7 +37,7 @@ function zn(e, t = ir) {
37
37
  throw new Error(`Message exceeds maximum length of ${t} characters`);
38
38
  return e;
39
39
  }
40
- function Ji(e) {
40
+ function qi(e) {
41
41
  if (!e || typeof e != "string")
42
42
  throw new Error("Invalid thread ID: must be a non-empty string");
43
43
  if (!In.test(e))
@@ -48,14 +48,14 @@ function Ie(e) {
48
48
  let t;
49
49
  return typeof e == "string" ? t = e : typeof e == "object" && e !== null ? t = JSON.stringify(e) : t = String(e), zn(t), me(t);
50
50
  }
51
- function qi(e) {
51
+ function Gi(e) {
52
52
  if (!e || typeof e != "string")
53
53
  throw new Error("Invalid title: must be a non-empty string");
54
54
  if (e.length > It)
55
55
  throw new Error(`Title exceeds maximum length of ${It} characters`);
56
56
  return me(e);
57
57
  }
58
- function Gi(e) {
58
+ function Ki(e) {
59
59
  try {
60
60
  const t = JSON.parse(e);
61
61
  if (typeof t == "object" && t !== null) {
@@ -69,14 +69,17 @@ function Gi(e) {
69
69
  throw new Error(`Invalid JSON: ${t instanceof Error ? t.message : "Unknown error"}`);
70
70
  }
71
71
  }
72
- function Ki(e, t) {
72
+ function Zi(e, t) {
73
73
  return (...r) => (typeof r[0] == "string" && (r[0] = t(r[0])), e(...r));
74
74
  }
75
+ function Hn(e) {
76
+ return !e || typeof e != "string" ? "" : e.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#x27;/g, "'").replace(/&#x2F;/g, "/");
77
+ }
75
78
  function zt(e, t = {}) {
76
79
  if (!e || typeof e != "string")
77
80
  return "";
78
- const { escapeHtml: r = !0, breaks: n = !0 } = t;
79
- let o = e;
81
+ const { escapeHtml: r = !1, breaks: n = !0 } = t;
82
+ let o = Hn(e);
80
83
  return r && (o = o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;")), n && (o = o.replace(/\n/g, "<br>")), o = o.replace(/^### (.*$)/gm, "<h3>$1</h3>"), o = o.replace(/^## (.*$)/gm, "<h2>$1</h2>"), o = o.replace(/^# (.*$)/gm, "<h1>$1</h1>"), o = o.replace(/\*\*\*(.*?)\*\*\*/g, "<strong><em>$1</em></strong>"), o = o.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>"), o = o.replace(/\*(.*?)\*/g, "<em>$1</em>"), o = o.replace(/```([\s\S]*?)```/g, "<pre><code>$1</code></pre>"), o = o.replace(/`(.*?)`/g, "<code>$1</code>"), o = o.replace(/^[\s]*\* (.*$)/gm, "<li>$1</li>"), o = o.replace(/^[\s]*- (.*$)/gm, "<li>$1</li>"), o = o.replace(/^[\s]*\+ (.*$)/gm, "<li>$1</li>"), o = o.replace(/(<li>[\s\S]*?<\/li>)/g, (s) => s.includes("<ul>") ? s : `<ul>${s}</ul>`), o = o.replace(/^[\s]*\d+\. (.*$)/gm, "<li>$1</li>"), o = o.replace(/(<li>[\s\S]*?<\/li>)/g, (s, i, a, d) => {
81
84
  const l = d.substring(0, a);
82
85
  return /\d+\.\s/.test(l.split(`
@@ -105,10 +108,10 @@ function Ht(e) {
105
108
  // Blockquotes
106
109
  ].some((r) => r.test(e));
107
110
  }
108
- const ar = pn(null), Hn = "http://localhost:8000/api/chat";
111
+ const ar = pn(null), Fn = "http://localhost:8000/api/chat";
109
112
  function ct({
110
113
  children: e,
111
- apiBaseUrl: t = Hn,
114
+ apiBaseUrl: t = Fn,
112
115
  enableUrlSync: r = !1,
113
116
  getAuthHeaders: n,
114
117
  authToken: o
@@ -174,7 +177,7 @@ function ct({
174
177
  return {
175
178
  id: w.id,
176
179
  role: w.role === "human" ? "human" : w.role === "ai" ? "ai" : "tool",
177
- content: L ? zt(w.content, { escapeHtml: !0, breaks: !0 }) : w.content,
180
+ content: L ? zt(w.content, { escapeHtml: !1, breaks: !0 }) : w.content,
178
181
  timestamp: w.timestamp,
179
182
  name: w.name,
180
183
  tool_call_id: w.tool_call_id,
@@ -184,7 +187,7 @@ function ct({
184
187
  isMarkdown: L
185
188
  };
186
189
  }), m = (x, w) => typeof x == "string" && Ht(x) ? {
187
- content: zt(x, { escapeHtml: !0, breaks: !0 }),
190
+ content: zt(x, { escapeHtml: !1, breaks: !0 }),
188
191
  isMarkdown: !0
189
192
  } : {
190
193
  content: typeof x == "string" ? x : String(x),
@@ -483,7 +486,7 @@ function ye() {
483
486
  function Y(...e) {
484
487
  return $n(kn(e));
485
488
  }
486
- const Fn = or(
489
+ const Wn = or(
487
490
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
488
491
  {
489
492
  variants: {
@@ -511,7 +514,7 @@ const Fn = or(
511
514
  ({ className: e, variant: t, size: r, asChild: n = !1, ...o }, s) => /* @__PURE__ */ u(
512
515
  n ? Dn : "button",
513
516
  {
514
- className: Y(Fn({ variant: t, size: r, className: e })),
517
+ className: Y(Wn({ variant: t, size: r, className: e })),
515
518
  ref: s,
516
519
  ...o
517
520
  }
@@ -581,7 +584,7 @@ function lr({
581
584
  }
582
585
  }, E = () => {
583
586
  try {
584
- return typeof e.content == "string" ? me(e.content) : e.role === "tool" && e.args ? me(JSON.stringify(e.args, null, 2)) : me(JSON.stringify(e.content, null, 2));
587
+ return typeof e.content == "string" ? e.role === "ai" && e.isMarkdown ? e.content : me(e.content) : e.role === "tool" && e.args ? me(JSON.stringify(e.args, null, 2)) : me(JSON.stringify(e.content, null, 2));
585
588
  } catch (v) {
586
589
  return console.warn("Error formatting message content:", v), "[Content formatting error]";
587
590
  }
@@ -739,7 +742,13 @@ function lr({
739
742
  v.branch_id
740
743
  ))
741
744
  ] }),
742
- (e.role !== "tool" || a) && /* @__PURE__ */ u("div", { className: `whitespace-pre-wrap ${e.role === "tool" ? "font-mono text-sm" : ""}`, children: E() }),
745
+ (e.role !== "tool" || a) && /* @__PURE__ */ u("div", { className: `${e.role === "tool" ? "font-mono text-sm" : ""}`, children: e.role === "ai" && e.isMarkdown ? /* @__PURE__ */ u(
746
+ "div",
747
+ {
748
+ className: "whitespace-pre-wrap",
749
+ dangerouslySetInnerHTML: { __html: E() }
750
+ }
751
+ ) : /* @__PURE__ */ u("div", { className: "whitespace-pre-wrap", children: E() }) }),
743
752
  e.timestamp && /* @__PURE__ */ u("div", { className: "text-xs opacity-70 mt-2", children: new Date(e.timestamp).toLocaleTimeString() })
744
753
  ] })
745
754
  ] });
@@ -966,7 +975,7 @@ function Re({
966
975
  /* @__PURE__ */ u("div", { className: "text-sm", children: "Select a thread or create a new one to start chatting" })
967
976
  ] }) });
968
977
  }
969
- var Wn = [
978
+ var Bn = [
970
979
  "a",
971
980
  "button",
972
981
  "div",
@@ -984,14 +993,14 @@ var Wn = [
984
993
  "span",
985
994
  "svg",
986
995
  "ul"
987
- ], X = Wn.reduce((e, t) => {
996
+ ], X = Bn.reduce((e, t) => {
988
997
  const r = _n(`Primitive.${t}`), n = f.forwardRef((o, s) => {
989
998
  const { asChild: i, ...a } = o, d = i ? r : t;
990
999
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(d, { ...a, ref: s });
991
1000
  });
992
1001
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
993
1002
  }, {});
994
- function Bn(e, t) {
1003
+ function jn(e, t) {
995
1004
  e && sr.flushSync(() => e.dispatchEvent(t));
996
1005
  }
997
1006
  function Ft(e, t) {
@@ -999,7 +1008,7 @@ function Ft(e, t) {
999
1008
  return e(t);
1000
1009
  e != null && (e.current = t);
1001
1010
  }
1002
- function jn(...e) {
1011
+ function Vn(...e) {
1003
1012
  return (t) => {
1004
1013
  let r = !1;
1005
1014
  const n = e.map((o) => {
@@ -1016,20 +1025,20 @@ function jn(...e) {
1016
1025
  };
1017
1026
  }
1018
1027
  function G(...e) {
1019
- return f.useCallback(jn(...e), e);
1028
+ return f.useCallback(Vn(...e), e);
1020
1029
  }
1021
1030
  var ue = globalThis != null && globalThis.document ? f.useLayoutEffect : () => {
1022
1031
  };
1023
- function Vn(e, t) {
1032
+ function Yn(e, t) {
1024
1033
  return f.useReducer((r, n) => t[r][n] ?? r, e);
1025
1034
  }
1026
1035
  var xe = (e) => {
1027
- const { present: t, children: r } = e, n = Yn(t), o = typeof r == "function" ? r({ present: n.isPresent }) : f.Children.only(r), s = G(n.ref, Xn(o));
1036
+ const { present: t, children: r } = e, n = Xn(t), o = typeof r == "function" ? r({ present: n.isPresent }) : f.Children.only(r), s = G(n.ref, Un(o));
1028
1037
  return typeof r == "function" || n.isPresent ? f.cloneElement(o, { ref: s }) : null;
1029
1038
  };
1030
1039
  xe.displayName = "Presence";
1031
- function Yn(e) {
1032
- const [t, r] = f.useState(), n = f.useRef(null), o = f.useRef(e), s = f.useRef("none"), i = e ? "mounted" : "unmounted", [a, d] = Vn(i, {
1040
+ function Xn(e) {
1041
+ const [t, r] = f.useState(), n = f.useRef(null), o = f.useRef(e), s = f.useRef("none"), i = e ? "mounted" : "unmounted", [a, d] = Yn(i, {
1033
1042
  mounted: {
1034
1043
  UNMOUNT: "unmounted",
1035
1044
  ANIMATION_OUT: "unmountSuspended"
@@ -1080,7 +1089,7 @@ function Yn(e) {
1080
1089
  function _e(e) {
1081
1090
  return (e == null ? void 0 : e.animationName) || "none";
1082
1091
  }
1083
- function Xn(e) {
1092
+ function Un(e) {
1084
1093
  var n, o;
1085
1094
  let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, r = t && "isReactWarning" in t && t.isReactWarning;
1086
1095
  return r ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
@@ -1115,9 +1124,9 @@ function ut(e, t = []) {
1115
1124
  );
1116
1125
  };
1117
1126
  };
1118
- return o.scopeName = e, [n, Un(o, ...t)];
1127
+ return o.scopeName = e, [n, Jn(o, ...t)];
1119
1128
  }
1120
- function Un(...e) {
1129
+ function Jn(...e) {
1121
1130
  const t = e[0];
1122
1131
  if (e.length === 1) return t;
1123
1132
  const r = () => {
@@ -1144,12 +1153,12 @@ function Q(e) {
1144
1153
  return (n = t.current) == null ? void 0 : n.call(t, ...r);
1145
1154
  }, []);
1146
1155
  }
1147
- var Jn = f.createContext(void 0);
1148
- function qn(e) {
1149
- const t = f.useContext(Jn);
1156
+ var qn = f.createContext(void 0);
1157
+ function Gn(e) {
1158
+ const t = f.useContext(qn);
1150
1159
  return e || t || "ltr";
1151
1160
  }
1152
- function Gn(e, [t, r]) {
1161
+ function Kn(e, [t, r]) {
1153
1162
  return Math.min(r, Math.max(t, e));
1154
1163
  }
1155
1164
  function j(e, t, { checkForDefaultPrevented: r = !0 } = {}) {
@@ -1158,10 +1167,10 @@ function j(e, t, { checkForDefaultPrevented: r = !0 } = {}) {
1158
1167
  return t == null ? void 0 : t(o);
1159
1168
  };
1160
1169
  }
1161
- function Kn(e, t) {
1170
+ function Zn(e, t) {
1162
1171
  return f.useReducer((r, n) => t[r][n] ?? r, e);
1163
1172
  }
1164
- var ft = "ScrollArea", [cr, Zi] = ut(ft), [Zn, Z] = cr(ft), dr = f.forwardRef(
1173
+ var ft = "ScrollArea", [cr, Qi] = ut(ft), [Qn, Z] = cr(ft), dr = f.forwardRef(
1165
1174
  (e, t) => {
1166
1175
  const {
1167
1176
  __scopeScrollArea: r,
@@ -1169,9 +1178,9 @@ var ft = "ScrollArea", [cr, Zi] = ut(ft), [Zn, Z] = cr(ft), dr = f.forwardRef(
1169
1178
  dir: o,
1170
1179
  scrollHideDelay: s = 600,
1171
1180
  ...i
1172
- } = e, [a, d] = f.useState(null), [l, c] = f.useState(null), [h, m] = f.useState(null), [p, g] = f.useState(null), [y, C] = f.useState(null), [S, E] = f.useState(0), [R, v] = f.useState(0), [b, A] = f.useState(!1), [N, M] = f.useState(!1), k = G(t, (z) => d(z)), $ = qn(o);
1181
+ } = e, [a, d] = f.useState(null), [l, c] = f.useState(null), [h, m] = f.useState(null), [p, g] = f.useState(null), [y, C] = f.useState(null), [S, E] = f.useState(0), [R, v] = f.useState(0), [b, A] = f.useState(!1), [N, M] = f.useState(!1), k = G(t, (z) => d(z)), $ = Gn(o);
1173
1182
  return /* @__PURE__ */ u(
1174
- Zn,
1183
+ Qn,
1175
1184
  {
1176
1185
  scope: r,
1177
1186
  type: n,
@@ -1259,11 +1268,11 @@ var ae = "ScrollAreaScrollbar", ht = f.forwardRef(
1259
1268
  const { forceMount: r, ...n } = e, o = Z(ae, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: i } = o, a = e.orientation === "horizontal";
1260
1269
  return f.useEffect(() => (a ? s(!0) : i(!0), () => {
1261
1270
  a ? s(!1) : i(!1);
1262
- }), [a, s, i]), o.type === "hover" ? /* @__PURE__ */ u(Qn, { ...n, ref: t, forceMount: r }) : o.type === "scroll" ? /* @__PURE__ */ u(eo, { ...n, ref: t, forceMount: r }) : o.type === "auto" ? /* @__PURE__ */ u(hr, { ...n, ref: t, forceMount: r }) : o.type === "always" ? /* @__PURE__ */ u(mt, { ...n, ref: t }) : null;
1271
+ }), [a, s, i]), o.type === "hover" ? /* @__PURE__ */ u(eo, { ...n, ref: t, forceMount: r }) : o.type === "scroll" ? /* @__PURE__ */ u(to, { ...n, ref: t, forceMount: r }) : o.type === "auto" ? /* @__PURE__ */ u(hr, { ...n, ref: t, forceMount: r }) : o.type === "always" ? /* @__PURE__ */ u(mt, { ...n, ref: t }) : null;
1263
1272
  }
1264
1273
  );
1265
1274
  ht.displayName = ae;
1266
- var Qn = f.forwardRef((e, t) => {
1275
+ var eo = f.forwardRef((e, t) => {
1267
1276
  const { forceMount: r, ...n } = e, o = Z(ae, e.__scopeScrollArea), [s, i] = f.useState(!1);
1268
1277
  return f.useEffect(() => {
1269
1278
  const a = o.scrollArea;
@@ -1286,8 +1295,8 @@ var Qn = f.forwardRef((e, t) => {
1286
1295
  ref: t
1287
1296
  }
1288
1297
  ) });
1289
- }), eo = f.forwardRef((e, t) => {
1290
- const { forceMount: r, ...n } = e, o = Z(ae, e.__scopeScrollArea), s = e.orientation === "horizontal", i = Ue(() => d("SCROLL_END"), 100), [a, d] = Kn("hidden", {
1298
+ }), to = f.forwardRef((e, t) => {
1299
+ const { forceMount: r, ...n } = e, o = Z(ae, e.__scopeScrollArea), s = e.orientation === "horizontal", i = Ue(() => d("SCROLL_END"), 100), [a, d] = Zn("hidden", {
1291
1300
  hidden: {
1292
1301
  SCROLL: "scrolling"
1293
1302
  },
@@ -1360,10 +1369,10 @@ var Qn = f.forwardRef((e, t) => {
1360
1369
  onThumbPointerDown: (m) => i.current = m
1361
1370
  };
1362
1371
  function h(m, p) {
1363
- return io(m, i.current, a, p);
1372
+ return ao(m, i.current, a, p);
1364
1373
  }
1365
1374
  return r === "horizontal" ? /* @__PURE__ */ u(
1366
- to,
1375
+ ro,
1367
1376
  {
1368
1377
  ...c,
1369
1378
  ref: t,
@@ -1381,7 +1390,7 @@ var Qn = f.forwardRef((e, t) => {
1381
1390
  }
1382
1391
  }
1383
1392
  ) : r === "vertical" ? /* @__PURE__ */ u(
1384
- ro,
1393
+ no,
1385
1394
  {
1386
1395
  ...c,
1387
1396
  ref: t,
@@ -1399,7 +1408,7 @@ var Qn = f.forwardRef((e, t) => {
1399
1408
  }
1400
1409
  }
1401
1410
  ) : null;
1402
- }), to = f.forwardRef((e, t) => {
1411
+ }), ro = f.forwardRef((e, t) => {
1403
1412
  const { sizes: r, onSizesChange: n, ...o } = e, s = Z(ae, e.__scopeScrollArea), [i, a] = f.useState(), d = f.useRef(null), l = G(t, d, s.onScrollbarXChange);
1404
1413
  return f.useEffect(() => {
1405
1414
  d.current && a(getComputedStyle(d.current));
@@ -1438,7 +1447,7 @@ var Qn = f.forwardRef((e, t) => {
1438
1447
  }
1439
1448
  }
1440
1449
  );
1441
- }), ro = f.forwardRef((e, t) => {
1450
+ }), no = f.forwardRef((e, t) => {
1442
1451
  const { sizes: r, onSizesChange: n, ...o } = e, s = Z(ae, e.__scopeScrollArea), [i, a] = f.useState(), d = f.useRef(null), l = G(t, d, s.onScrollbarYChange);
1443
1452
  return f.useEffect(() => {
1444
1453
  d.current && a(getComputedStyle(d.current));
@@ -1478,7 +1487,7 @@ var Qn = f.forwardRef((e, t) => {
1478
1487
  }
1479
1488
  }
1480
1489
  );
1481
- }), [no, mr] = cr(ae), pr = f.forwardRef((e, t) => {
1490
+ }), [oo, mr] = cr(ae), pr = f.forwardRef((e, t) => {
1482
1491
  const {
1483
1492
  __scopeScrollArea: r,
1484
1493
  sizes: n,
@@ -1505,7 +1514,7 @@ var Qn = f.forwardRef((e, t) => {
1505
1514
  };
1506
1515
  return document.addEventListener("wheel", k, { passive: !1 }), () => document.removeEventListener("wheel", k, { passive: !1 });
1507
1516
  }, [R, g, v, b]), f.useEffect(A, [n, A]), ve(g, N), ve(p.content, N), /* @__PURE__ */ u(
1508
- no,
1517
+ oo,
1509
1518
  {
1510
1519
  scope: r,
1511
1520
  scrollbar: g,
@@ -1535,9 +1544,9 @@ var Qn = f.forwardRef((e, t) => {
1535
1544
  }), ze = "ScrollAreaThumb", gr = f.forwardRef(
1536
1545
  (e, t) => {
1537
1546
  const { forceMount: r, ...n } = e, o = mr(ze, e.__scopeScrollArea);
1538
- return /* @__PURE__ */ u(xe, { present: r || o.hasThumb, children: /* @__PURE__ */ u(oo, { ref: t, ...n }) });
1547
+ return /* @__PURE__ */ u(xe, { present: r || o.hasThumb, children: /* @__PURE__ */ u(so, { ref: t, ...n }) });
1539
1548
  }
1540
- ), oo = f.forwardRef(
1549
+ ), so = f.forwardRef(
1541
1550
  (e, t) => {
1542
1551
  const { __scopeScrollArea: r, style: n, ...o } = e, s = Z(ze, r), i = mr(ze, r), { onThumbPositionChange: a } = i, d = G(
1543
1552
  t,
@@ -1550,7 +1559,7 @@ var Qn = f.forwardRef((e, t) => {
1550
1559
  if (h) {
1551
1560
  const m = () => {
1552
1561
  if (c(), !l.current) {
1553
- const p = ao(h, a);
1562
+ const p = lo(h, a);
1554
1563
  l.current = p, a();
1555
1564
  }
1556
1565
  };
@@ -1580,11 +1589,11 @@ gr.displayName = ze;
1580
1589
  var pt = "ScrollAreaCorner", vr = f.forwardRef(
1581
1590
  (e, t) => {
1582
1591
  const r = Z(pt, e.__scopeScrollArea), n = !!(r.scrollbarX && r.scrollbarY);
1583
- return r.type !== "scroll" && n ? /* @__PURE__ */ u(so, { ...e, ref: t }) : null;
1592
+ return r.type !== "scroll" && n ? /* @__PURE__ */ u(io, { ...e, ref: t }) : null;
1584
1593
  }
1585
1594
  );
1586
1595
  vr.displayName = pt;
1587
- var so = f.forwardRef((e, t) => {
1596
+ var io = f.forwardRef((e, t) => {
1588
1597
  const { __scopeScrollArea: r, ...n } = e, o = Z(pt, r), [s, i] = f.useState(0), [a, d] = f.useState(0), l = !!(s && a);
1589
1598
  return ve(o.scrollbarX, () => {
1590
1599
  var h;
@@ -1622,12 +1631,12 @@ function Xe(e) {
1622
1631
  const t = wr(e.viewport, e.content), r = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, n = (e.scrollbar.size - r) * t;
1623
1632
  return Math.max(n, 18);
1624
1633
  }
1625
- function io(e, t, r, n = "ltr") {
1634
+ function ao(e, t, r, n = "ltr") {
1626
1635
  const o = Xe(r), s = o / 2, i = t || s, a = o - i, d = r.scrollbar.paddingStart + i, l = r.scrollbar.size - r.scrollbar.paddingEnd - a, c = r.content - r.viewport, h = n === "ltr" ? [0, c] : [c * -1, 0];
1627
1636
  return br([d, l], h)(e);
1628
1637
  }
1629
1638
  function Wt(e, t, r = "ltr") {
1630
- const n = Xe(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - o, i = t.content - t.viewport, a = s - n, d = r === "ltr" ? [0, i] : [i * -1, 0], l = Gn(e, d);
1639
+ const n = Xe(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - o, i = t.content - t.viewport, a = s - n, d = r === "ltr" ? [0, i] : [i * -1, 0], l = Kn(e, d);
1631
1640
  return br([0, i], [0, a])(l);
1632
1641
  }
1633
1642
  function br(e, t) {
@@ -1640,7 +1649,7 @@ function br(e, t) {
1640
1649
  function yr(e, t) {
1641
1650
  return e > 0 && e < t;
1642
1651
  }
1643
- var ao = (e, t = () => {
1652
+ var lo = (e, t = () => {
1644
1653
  }) => {
1645
1654
  let r = { left: e.scrollLeft, top: e.scrollTop }, n = 0;
1646
1655
  return function o() {
@@ -1668,7 +1677,7 @@ function ve(e, t) {
1668
1677
  }
1669
1678
  }, [e, r]);
1670
1679
  }
1671
- var xr = dr, lo = fr, co = vr;
1680
+ var xr = dr, co = fr, uo = vr;
1672
1681
  const Cr = f.forwardRef(({ className: e, children: t, ...r }, n) => /* @__PURE__ */ O(
1673
1682
  xr,
1674
1683
  {
@@ -1676,9 +1685,9 @@ const Cr = f.forwardRef(({ className: e, children: t, ...r }, n) => /* @__PURE__
1676
1685
  className: Y("relative overflow-hidden", e),
1677
1686
  ...r,
1678
1687
  children: [
1679
- /* @__PURE__ */ u(lo, { className: "h-full w-full rounded-[inherit]", children: t }),
1688
+ /* @__PURE__ */ u(co, { className: "h-full w-full rounded-[inherit]", children: t }),
1680
1689
  /* @__PURE__ */ u(Sr, {}),
1681
- /* @__PURE__ */ u(co, {})
1690
+ /* @__PURE__ */ u(uo, {})
1682
1691
  ]
1683
1692
  }
1684
1693
  ));
@@ -1820,25 +1829,25 @@ function Ae({
1820
1829
  ] }) })
1821
1830
  ] });
1822
1831
  }
1823
- function uo({
1832
+ function fo({
1824
1833
  apiBaseUrl: e,
1825
1834
  enableUrlSync: t = !0,
1826
1835
  layout: r = "sidebar",
1827
1836
  className: n = ""
1828
1837
  }) {
1829
1838
  return /* @__PURE__ */ u(ct, { apiBaseUrl: e, enableUrlSync: t, children: /* @__PURE__ */ O("div", { className: `h-full ${n}`, children: [
1830
- r === "sidebar" && /* @__PURE__ */ u(fo, {}),
1831
- r === "tabs" && /* @__PURE__ */ u(ho, {}),
1832
- r === "split" && /* @__PURE__ */ u(mo, {})
1839
+ r === "sidebar" && /* @__PURE__ */ u(ho, {}),
1840
+ r === "tabs" && /* @__PURE__ */ u(mo, {}),
1841
+ r === "split" && /* @__PURE__ */ u(po, {})
1833
1842
  ] }) });
1834
1843
  }
1835
- function fo() {
1844
+ function ho() {
1836
1845
  return /* @__PURE__ */ O("div", { className: "flex h-full", children: [
1837
1846
  /* @__PURE__ */ u("div", { className: "w-80 border-r bg-gray-50", children: /* @__PURE__ */ u(Ae, {}) }),
1838
1847
  /* @__PURE__ */ u("div", { className: "flex-1", children: /* @__PURE__ */ u(Re, {}) })
1839
1848
  ] });
1840
1849
  }
1841
- function ho() {
1850
+ function mo() {
1842
1851
  const [e, t] = mn.useState("chat");
1843
1852
  return /* @__PURE__ */ O("div", { className: "flex flex-col h-full", children: [
1844
1853
  /* @__PURE__ */ u("div", { className: "border-b", children: /* @__PURE__ */ O("div", { className: "flex", children: [
@@ -1865,13 +1874,13 @@ function ho() {
1865
1874
  ] })
1866
1875
  ] });
1867
1876
  }
1868
- function mo() {
1877
+ function po() {
1869
1878
  return /* @__PURE__ */ O("div", { className: "flex flex-col h-full", children: [
1870
1879
  /* @__PURE__ */ u("div", { className: "h-1/3 border-b", children: /* @__PURE__ */ u(Ae, {}) }),
1871
1880
  /* @__PURE__ */ u("div", { className: "flex-1", children: /* @__PURE__ */ u(Re, {}) })
1872
1881
  ] });
1873
1882
  }
1874
- function po({
1883
+ function go({
1875
1884
  placeholder: e,
1876
1885
  showThreadHistory: t = !0
1877
1886
  }) {
@@ -1922,7 +1931,7 @@ function po({
1922
1931
  ) })
1923
1932
  ] });
1924
1933
  }
1925
- const go = {
1934
+ const vo = {
1926
1935
  sm: "w-80 h-80",
1927
1936
  md: "w-96 h-96",
1928
1937
  lg: "w-[28rem] h-[32rem]"
@@ -1932,7 +1941,7 @@ const go = {
1932
1941
  "top-right": "top-6 right-6",
1933
1942
  "top-left": "top-6 left-6"
1934
1943
  };
1935
- function Qi({
1944
+ function ea({
1936
1945
  apiBaseUrl: e = "http://localhost:8000/api/chat",
1937
1946
  title: t = "AI Assistant",
1938
1947
  subtitle: r = "How can I help you?",
@@ -1969,7 +1978,7 @@ function Qi({
1969
1978
  enableUrlSync: c,
1970
1979
  getAuthHeaders: o,
1971
1980
  authToken: s,
1972
- children: /* @__PURE__ */ u("div", { className: `fixed ${Bt[a]} z-50 transition-all duration-300 ${E ? "scale-75" : "scale-100"}`, children: /* @__PURE__ */ O("div", { className: `${go[d]} ${b} rounded-xl shadow-2xl border overflow-hidden relative`, children: [
1981
+ children: /* @__PURE__ */ u("div", { className: `fixed ${Bt[a]} z-50 transition-all duration-300 ${E ? "scale-75" : "scale-100"}`, children: /* @__PURE__ */ O("div", { className: `${vo[d]} ${b} rounded-xl shadow-2xl border overflow-hidden relative`, children: [
1973
1982
  /* @__PURE__ */ u("div", { className: `${A} p-4 flex-shrink-0`, children: /* @__PURE__ */ O("div", { className: "flex items-center justify-between", children: [
1974
1983
  /* @__PURE__ */ O("div", { className: "flex items-center gap-3", children: [
1975
1984
  /* @__PURE__ */ u("div", { className: "w-8 h-8 bg-white/10 rounded-full flex items-center justify-center border border-slate-600", children: /* @__PURE__ */ u($t, { size: 16, className: "text-white" }) }),
@@ -2018,7 +2027,7 @@ function Qi({
2018
2027
  ] })
2019
2028
  ] }) }),
2020
2029
  !E && /* @__PURE__ */ u("div", { className: "flex-1 h-full overflow-hidden", children: /* @__PURE__ */ u(
2021
- po,
2030
+ go,
2022
2031
  {
2023
2032
  placeholder: n,
2024
2033
  showThreadHistory: m
@@ -2039,7 +2048,7 @@ function Qi({
2039
2048
  }
2040
2049
  );
2041
2050
  }
2042
- function vo() {
2051
+ function wo() {
2043
2052
  const e = ye();
2044
2053
  return {
2045
2054
  ...rt(() => ({
@@ -2060,8 +2069,8 @@ function vo() {
2060
2069
  refresh: e.refresh
2061
2070
  };
2062
2071
  }
2063
- function ea() {
2064
- const { tool: e } = vo(), t = rt(() => e.map((i) => {
2072
+ function ta() {
2073
+ const { tool: e } = wo(), t = rt(() => e.map((i) => {
2065
2074
  let a = "", d = null, l = !1;
2066
2075
  try {
2067
2076
  if (typeof i.content == "string") {
@@ -2115,7 +2124,7 @@ function ea() {
2115
2124
  hasToolMessages: t.length > 0
2116
2125
  };
2117
2126
  }
2118
- function ta() {
2127
+ function ra() {
2119
2128
  const e = ye();
2120
2129
  return {
2121
2130
  // State
@@ -2133,7 +2142,7 @@ function ta() {
2133
2142
  refresh: e.refresh
2134
2143
  };
2135
2144
  }
2136
- function wo() {
2145
+ function bo() {
2137
2146
  const e = ye(), [t, r] = V({
2138
2147
  isStreaming: !1,
2139
2148
  events: [],
@@ -2210,7 +2219,7 @@ function wo() {
2210
2219
  };
2211
2220
  }
2212
2221
  function gt(e, t) {
2213
- const { toolEvents: r, latestToolEvent: n } = wo(), [o, s] = V([]), [i, a] = V(null);
2222
+ const { toolEvents: r, latestToolEvent: n } = bo(), [o, s] = V([]), [i, a] = V(null);
2214
2223
  J(() => {
2215
2224
  const c = r.filter(
2216
2225
  (h) => h.data.name === e
@@ -2229,11 +2238,11 @@ function gt(e, t) {
2229
2238
  hasNewData: d
2230
2239
  };
2231
2240
  }
2232
- const ra = (e = "search") => gt(e, (t) => Array.isArray(t) ? t : t != null && t.results ? t.results : t != null && t.data ? t.data : t), na = (e = "read_file") => gt(e, (t) => typeof t == "string" ? t : t != null && t.content ? t.content : t != null && t.text ? t.text : String(t)), oa = (e = "execute_code") => gt(e, (t) => ({
2241
+ const na = (e = "search") => gt(e, (t) => Array.isArray(t) ? t : t != null && t.results ? t.results : t != null && t.data ? t.data : t), oa = (e = "read_file") => gt(e, (t) => typeof t == "string" ? t : t != null && t.content ? t.content : t != null && t.text ? t.text : String(t)), sa = (e = "execute_code") => gt(e, (t) => ({
2233
2242
  output: (t == null ? void 0 : t.output) || (t == null ? void 0 : t.stdout) || t,
2234
2243
  error: (t == null ? void 0 : t.error) || (t == null ? void 0 : t.stderr) || null,
2235
2244
  exitCode: (t == null ? void 0 : t.exit_code) || (t == null ? void 0 : t.exitCode) || 0
2236
- })), bo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2245
+ })), yo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2237
2246
  "div",
2238
2247
  {
2239
2248
  ref: r,
@@ -2244,8 +2253,8 @@ const ra = (e = "search") => gt(e, (t) => Array.isArray(t) ? t : t != null && t.
2244
2253
  ...t
2245
2254
  }
2246
2255
  ));
2247
- bo.displayName = "Card";
2248
- const yo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2256
+ yo.displayName = "Card";
2257
+ const xo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2249
2258
  "div",
2250
2259
  {
2251
2260
  ref: r,
@@ -2253,8 +2262,8 @@ const yo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2253
2262
  ...t
2254
2263
  }
2255
2264
  ));
2256
- yo.displayName = "CardHeader";
2257
- const xo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2265
+ xo.displayName = "CardHeader";
2266
+ const Co = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2258
2267
  "h3",
2259
2268
  {
2260
2269
  ref: r,
@@ -2265,8 +2274,8 @@ const xo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2265
2274
  ...t
2266
2275
  }
2267
2276
  ));
2268
- xo.displayName = "CardTitle";
2269
- const Co = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2277
+ Co.displayName = "CardTitle";
2278
+ const So = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2270
2279
  "p",
2271
2280
  {
2272
2281
  ref: r,
@@ -2274,10 +2283,10 @@ const Co = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2274
2283
  ...t
2275
2284
  }
2276
2285
  ));
2277
- Co.displayName = "CardDescription";
2278
- const So = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u("div", { ref: r, className: Y("p-6 pt-0", e), ...t }));
2279
- So.displayName = "CardContent";
2280
- const Eo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2286
+ So.displayName = "CardDescription";
2287
+ const Eo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u("div", { ref: r, className: Y("p-6 pt-0", e), ...t }));
2288
+ Eo.displayName = "CardContent";
2289
+ const To = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2281
2290
  "div",
2282
2291
  {
2283
2292
  ref: r,
@@ -2285,8 +2294,8 @@ const Eo = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2285
2294
  ...t
2286
2295
  }
2287
2296
  ));
2288
- Eo.displayName = "CardFooter";
2289
- const To = f.forwardRef(
2297
+ To.displayName = "CardFooter";
2298
+ const No = f.forwardRef(
2290
2299
  ({ className: e, type: t, ...r }, n) => /* @__PURE__ */ u(
2291
2300
  "input",
2292
2301
  {
@@ -2300,8 +2309,8 @@ const To = f.forwardRef(
2300
2309
  }
2301
2310
  )
2302
2311
  );
2303
- To.displayName = "Input";
2304
- var No = "Label", Er = f.forwardRef((e, t) => /* @__PURE__ */ u(
2312
+ No.displayName = "Input";
2313
+ var Po = "Label", Er = f.forwardRef((e, t) => /* @__PURE__ */ u(
2305
2314
  X.label,
2306
2315
  {
2307
2316
  ...e,
@@ -2312,21 +2321,21 @@ var No = "Label", Er = f.forwardRef((e, t) => /* @__PURE__ */ u(
2312
2321
  }
2313
2322
  }
2314
2323
  ));
2315
- Er.displayName = No;
2324
+ Er.displayName = Po;
2316
2325
  var Tr = Er;
2317
- const Po = or(
2326
+ const Ro = or(
2318
2327
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
2319
- ), Ro = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2328
+ ), Ao = f.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u(
2320
2329
  Tr,
2321
2330
  {
2322
2331
  ref: r,
2323
- className: Y(Po(), e),
2332
+ className: Y(Ro(), e),
2324
2333
  ...t
2325
2334
  }
2326
2335
  ));
2327
- Ro.displayName = Tr.displayName;
2328
- var Ao = "Separator", jt = "horizontal", Oo = ["horizontal", "vertical"], Nr = f.forwardRef((e, t) => {
2329
- const { decorative: r, orientation: n = jt, ...o } = e, s = Lo(n) ? n : jt, a = r ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
2336
+ Ao.displayName = Tr.displayName;
2337
+ var Oo = "Separator", jt = "horizontal", Lo = ["horizontal", "vertical"], Nr = f.forwardRef((e, t) => {
2338
+ const { decorative: r, orientation: n = jt, ...o } = e, s = Do(n) ? n : jt, a = r ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
2330
2339
  return /* @__PURE__ */ u(
2331
2340
  X.div,
2332
2341
  {
@@ -2337,12 +2346,12 @@ var Ao = "Separator", jt = "horizontal", Oo = ["horizontal", "vertical"], Nr = f
2337
2346
  }
2338
2347
  );
2339
2348
  });
2340
- Nr.displayName = Ao;
2341
- function Lo(e) {
2342
- return Oo.includes(e);
2349
+ Nr.displayName = Oo;
2350
+ function Do(e) {
2351
+ return Lo.includes(e);
2343
2352
  }
2344
2353
  var Pr = Nr;
2345
- const Do = f.forwardRef(
2354
+ const _o = f.forwardRef(
2346
2355
  ({ className: e, orientation: t = "horizontal", decorative: r = !0, ...n }, o) => /* @__PURE__ */ u(
2347
2356
  Pr,
2348
2357
  {
@@ -2358,8 +2367,8 @@ const Do = f.forwardRef(
2358
2367
  }
2359
2368
  )
2360
2369
  );
2361
- Do.displayName = Pr.displayName;
2362
- function _o(e, t = globalThis == null ? void 0 : globalThis.document) {
2370
+ _o.displayName = Pr.displayName;
2371
+ function Mo(e, t = globalThis == null ? void 0 : globalThis.document) {
2363
2372
  const r = Q(e);
2364
2373
  f.useEffect(() => {
2365
2374
  const n = (o) => {
@@ -2368,7 +2377,7 @@ function _o(e, t = globalThis == null ? void 0 : globalThis.document) {
2368
2377
  return t.addEventListener("keydown", n, { capture: !0 }), () => t.removeEventListener("keydown", n, { capture: !0 });
2369
2378
  }, [r, t]);
2370
2379
  }
2371
- var Mo = "DismissableLayer", nt = "dismissableLayer.update", ko = "dismissableLayer.pointerDownOutside", $o = "dismissableLayer.focusOutside", Vt, Rr = f.createContext({
2380
+ var ko = "DismissableLayer", nt = "dismissableLayer.update", $o = "dismissableLayer.pointerDownOutside", Io = "dismissableLayer.focusOutside", Vt, Rr = f.createContext({
2372
2381
  layers: /* @__PURE__ */ new Set(),
2373
2382
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
2374
2383
  branches: /* @__PURE__ */ new Set()
@@ -2382,14 +2391,14 @@ var Mo = "DismissableLayer", nt = "dismissableLayer.update", ko = "dismissableLa
2382
2391
  onInteractOutside: i,
2383
2392
  onDismiss: a,
2384
2393
  ...d
2385
- } = e, l = f.useContext(Rr), [c, h] = f.useState(null), m = (c == null ? void 0 : c.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = f.useState({}), g = G(t, (N) => h(N)), y = Array.from(l.layers), [C] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), S = y.indexOf(C), E = c ? y.indexOf(c) : -1, R = l.layersWithOutsidePointerEventsDisabled.size > 0, v = E >= S, b = Ho((N) => {
2394
+ } = e, l = f.useContext(Rr), [c, h] = f.useState(null), m = (c == null ? void 0 : c.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = f.useState({}), g = G(t, (N) => h(N)), y = Array.from(l.layers), [C] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), S = y.indexOf(C), E = c ? y.indexOf(c) : -1, R = l.layersWithOutsidePointerEventsDisabled.size > 0, v = E >= S, b = Fo((N) => {
2386
2395
  const M = N.target, k = [...l.branches].some(($) => $.contains(M));
2387
2396
  !v || k || (o == null || o(N), i == null || i(N), N.defaultPrevented || a == null || a());
2388
- }, m), A = Fo((N) => {
2397
+ }, m), A = Wo((N) => {
2389
2398
  const M = N.target;
2390
2399
  [...l.branches].some(($) => $.contains(M)) || (s == null || s(N), i == null || i(N), N.defaultPrevented || a == null || a());
2391
2400
  }, m);
2392
- return _o((N) => {
2401
+ return Mo((N) => {
2393
2402
  E === l.layers.size - 1 && (n == null || n(N), !N.defaultPrevented && a && (N.preventDefault(), a()));
2394
2403
  }, m), f.useEffect(() => {
2395
2404
  if (c)
@@ -2420,8 +2429,8 @@ var Mo = "DismissableLayer", nt = "dismissableLayer.update", ko = "dismissableLa
2420
2429
  );
2421
2430
  }
2422
2431
  );
2423
- Ar.displayName = Mo;
2424
- var Io = "DismissableLayerBranch", zo = f.forwardRef((e, t) => {
2432
+ Ar.displayName = ko;
2433
+ var zo = "DismissableLayerBranch", Ho = f.forwardRef((e, t) => {
2425
2434
  const r = f.useContext(Rr), n = f.useRef(null), o = G(t, n);
2426
2435
  return f.useEffect(() => {
2427
2436
  const s = n.current;
@@ -2431,8 +2440,8 @@ var Io = "DismissableLayerBranch", zo = f.forwardRef((e, t) => {
2431
2440
  };
2432
2441
  }, [r.branches]), /* @__PURE__ */ u(X.div, { ...e, ref: o });
2433
2442
  });
2434
- zo.displayName = Io;
2435
- function Ho(e, t = globalThis == null ? void 0 : globalThis.document) {
2443
+ Ho.displayName = zo;
2444
+ function Fo(e, t = globalThis == null ? void 0 : globalThis.document) {
2436
2445
  const r = Q(e), n = f.useRef(!1), o = f.useRef(() => {
2437
2446
  });
2438
2447
  return f.useEffect(() => {
@@ -2440,7 +2449,7 @@ function Ho(e, t = globalThis == null ? void 0 : globalThis.document) {
2440
2449
  if (a.target && !n.current) {
2441
2450
  let d = function() {
2442
2451
  Or(
2443
- ko,
2452
+ $o,
2444
2453
  r,
2445
2454
  l,
2446
2455
  { discrete: !0 }
@@ -2462,11 +2471,11 @@ function Ho(e, t = globalThis == null ? void 0 : globalThis.document) {
2462
2471
  onPointerDownCapture: () => n.current = !0
2463
2472
  };
2464
2473
  }
2465
- function Fo(e, t = globalThis == null ? void 0 : globalThis.document) {
2474
+ function Wo(e, t = globalThis == null ? void 0 : globalThis.document) {
2466
2475
  const r = Q(e), n = f.useRef(!1);
2467
2476
  return f.useEffect(() => {
2468
2477
  const o = (s) => {
2469
- s.target && !n.current && Or($o, r, { originalEvent: s }, {
2478
+ s.target && !n.current && Or(Io, r, { originalEvent: s }, {
2470
2479
  discrete: !1
2471
2480
  });
2472
2481
  };
@@ -2482,25 +2491,25 @@ function Yt() {
2482
2491
  }
2483
2492
  function Or(e, t, r, { discrete: n }) {
2484
2493
  const o = r.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: r });
2485
- t && o.addEventListener(e, t, { once: !0 }), n ? Bn(o, s) : o.dispatchEvent(s);
2494
+ t && o.addEventListener(e, t, { once: !0 }), n ? jn(o, s) : o.dispatchEvent(s);
2486
2495
  }
2487
- var Wo = f[" useId ".trim().toString()] || (() => {
2488
- }), Bo = 0;
2489
- function jo(e) {
2490
- const [t, r] = f.useState(Wo());
2496
+ var Bo = f[" useId ".trim().toString()] || (() => {
2497
+ }), jo = 0;
2498
+ function Vo(e) {
2499
+ const [t, r] = f.useState(Bo());
2491
2500
  return ue(() => {
2492
- r((n) => n ?? String(Bo++));
2501
+ r((n) => n ?? String(jo++));
2493
2502
  }, [e]), t ? `radix-${t}` : "";
2494
2503
  }
2495
- const Vo = ["top", "right", "bottom", "left"], fe = Math.min, U = Math.max, Fe = Math.round, Me = Math.floor, se = (e) => ({
2504
+ const Yo = ["top", "right", "bottom", "left"], fe = Math.min, U = Math.max, Fe = Math.round, Me = Math.floor, se = (e) => ({
2496
2505
  x: e,
2497
2506
  y: e
2498
- }), Yo = {
2507
+ }), Xo = {
2499
2508
  left: "right",
2500
2509
  right: "left",
2501
2510
  bottom: "top",
2502
2511
  top: "bottom"
2503
- }, Xo = {
2512
+ }, Uo = {
2504
2513
  start: "end",
2505
2514
  end: "start"
2506
2515
  };
@@ -2522,48 +2531,48 @@ function vt(e) {
2522
2531
  function wt(e) {
2523
2532
  return e === "y" ? "height" : "width";
2524
2533
  }
2525
- const Uo = /* @__PURE__ */ new Set(["top", "bottom"]);
2534
+ const Jo = /* @__PURE__ */ new Set(["top", "bottom"]);
2526
2535
  function oe(e) {
2527
- return Uo.has(de(e)) ? "y" : "x";
2536
+ return Jo.has(de(e)) ? "y" : "x";
2528
2537
  }
2529
2538
  function bt(e) {
2530
2539
  return vt(oe(e));
2531
2540
  }
2532
- function Jo(e, t, r) {
2541
+ function qo(e, t, r) {
2533
2542
  r === void 0 && (r = !1);
2534
2543
  const n = Ce(e), o = bt(e), s = wt(o);
2535
2544
  let i = o === "x" ? n === (r ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
2536
2545
  return t.reference[s] > t.floating[s] && (i = We(i)), [i, We(i)];
2537
2546
  }
2538
- function qo(e) {
2547
+ function Go(e) {
2539
2548
  const t = We(e);
2540
2549
  return [st(e), t, st(t)];
2541
2550
  }
2542
2551
  function st(e) {
2543
- return e.replace(/start|end/g, (t) => Xo[t]);
2552
+ return e.replace(/start|end/g, (t) => Uo[t]);
2544
2553
  }
2545
- const Xt = ["left", "right"], Ut = ["right", "left"], Go = ["top", "bottom"], Ko = ["bottom", "top"];
2546
- function Zo(e, t, r) {
2554
+ const Xt = ["left", "right"], Ut = ["right", "left"], Ko = ["top", "bottom"], Zo = ["bottom", "top"];
2555
+ function Qo(e, t, r) {
2547
2556
  switch (e) {
2548
2557
  case "top":
2549
2558
  case "bottom":
2550
2559
  return r ? t ? Ut : Xt : t ? Xt : Ut;
2551
2560
  case "left":
2552
2561
  case "right":
2553
- return t ? Go : Ko;
2562
+ return t ? Ko : Zo;
2554
2563
  default:
2555
2564
  return [];
2556
2565
  }
2557
2566
  }
2558
- function Qo(e, t, r, n) {
2567
+ function es(e, t, r, n) {
2559
2568
  const o = Ce(e);
2560
- let s = Zo(de(e), r === "start", n);
2569
+ let s = Qo(de(e), r === "start", n);
2561
2570
  return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(st)))), s;
2562
2571
  }
2563
2572
  function We(e) {
2564
- return e.replace(/left|right|bottom|top/g, (t) => Yo[t]);
2573
+ return e.replace(/left|right|bottom|top/g, (t) => Xo[t]);
2565
2574
  }
2566
- function es(e) {
2575
+ function ts(e) {
2567
2576
  return {
2568
2577
  top: 0,
2569
2578
  right: 0,
@@ -2573,7 +2582,7 @@ function es(e) {
2573
2582
  };
2574
2583
  }
2575
2584
  function Lr(e) {
2576
- return typeof e != "number" ? es(e) : {
2585
+ return typeof e != "number" ? ts(e) : {
2577
2586
  top: e,
2578
2587
  right: e,
2579
2588
  bottom: e,
@@ -2646,7 +2655,7 @@ function Jt(e, t, r) {
2646
2655
  }
2647
2656
  return p;
2648
2657
  }
2649
- const ts = async (e, t, r) => {
2658
+ const rs = async (e, t, r) => {
2650
2659
  const {
2651
2660
  placement: n = "bottom",
2652
2661
  strategy: o = "absolute",
@@ -2752,7 +2761,7 @@ async function Te(e, t) {
2752
2761
  right: (b.right - S.right + g.right) / v.x
2753
2762
  };
2754
2763
  }
2755
- const rs = (e) => ({
2764
+ const ns = (e) => ({
2756
2765
  name: "arrow",
2757
2766
  options: e,
2758
2767
  async fn(t) {
@@ -2789,7 +2798,7 @@ const rs = (e) => ({
2789
2798
  reset: T
2790
2799
  };
2791
2800
  }
2792
- }), ns = function(e) {
2801
+ }), os = function(e) {
2793
2802
  return e === void 0 && (e = {}), {
2794
2803
  name: "flip",
2795
2804
  options: e,
@@ -2813,12 +2822,12 @@ const rs = (e) => ({
2813
2822
  } = ce(e, t);
2814
2823
  if ((r = s.arrow) != null && r.alignmentOffset)
2815
2824
  return {};
2816
- const S = de(o), E = oe(a), R = de(a) === a, v = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), b = m || (R || !y ? [We(a)] : qo(a)), A = g !== "none";
2817
- !m && A && b.push(...Qo(a, y, g, v));
2825
+ const S = de(o), E = oe(a), R = de(a) === a, v = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), b = m || (R || !y ? [We(a)] : Go(a)), A = g !== "none";
2826
+ !m && A && b.push(...es(a, y, g, v));
2818
2827
  const N = [a, ...b], M = await Te(t, C), k = [];
2819
2828
  let $ = ((n = s.flip) == null ? void 0 : n.overflows) || [];
2820
2829
  if (c && k.push(M[S]), h) {
2821
- const P = Jo(o, i, v);
2830
+ const P = qo(o, i, v);
2822
2831
  k.push(M[P[0]], M[P[1]]);
2823
2832
  }
2824
2833
  if ($ = [...$, {
@@ -2880,9 +2889,9 @@ function qt(e, t) {
2880
2889
  };
2881
2890
  }
2882
2891
  function Gt(e) {
2883
- return Vo.some((t) => e[t] >= 0);
2892
+ return Yo.some((t) => e[t] >= 0);
2884
2893
  }
2885
- const os = function(e) {
2894
+ const ss = function(e) {
2886
2895
  return e === void 0 && (e = {}), {
2887
2896
  name: "hide",
2888
2897
  options: e,
@@ -2924,7 +2933,7 @@ const os = function(e) {
2924
2933
  }
2925
2934
  };
2926
2935
  }, Dr = /* @__PURE__ */ new Set(["left", "top"]);
2927
- async function ss(e, t) {
2936
+ async function is(e, t) {
2928
2937
  const {
2929
2938
  placement: r,
2930
2939
  platform: n,
@@ -2951,7 +2960,7 @@ async function ss(e, t) {
2951
2960
  y: p * c
2952
2961
  };
2953
2962
  }
2954
- const is = function(e) {
2963
+ const as = function(e) {
2955
2964
  return e === void 0 && (e = 0), {
2956
2965
  name: "offset",
2957
2966
  options: e,
@@ -2962,7 +2971,7 @@ const is = function(e) {
2962
2971
  y: s,
2963
2972
  placement: i,
2964
2973
  middlewareData: a
2965
- } = t, d = await ss(t, e);
2974
+ } = t, d = await is(t, e);
2966
2975
  return i === ((r = a.offset) == null ? void 0 : r.placement) && (n = a.arrow) != null && n.alignmentOffset ? {} : {
2967
2976
  x: o + d.x,
2968
2977
  y: s + d.y,
@@ -2973,7 +2982,7 @@ const is = function(e) {
2973
2982
  };
2974
2983
  }
2975
2984
  };
2976
- }, as = function(e) {
2985
+ }, ls = function(e) {
2977
2986
  return e === void 0 && (e = {}), {
2978
2987
  name: "shift",
2979
2988
  options: e,
@@ -3029,7 +3038,7 @@ const is = function(e) {
3029
3038
  };
3030
3039
  }
3031
3040
  };
3032
- }, ls = function(e) {
3041
+ }, cs = function(e) {
3033
3042
  return e === void 0 && (e = {}), {
3034
3043
  options: e,
3035
3044
  fn(t) {
@@ -3071,7 +3080,7 @@ const is = function(e) {
3071
3080
  };
3072
3081
  }
3073
3082
  };
3074
- }, cs = function(e) {
3083
+ }, ds = function(e) {
3075
3084
  return e === void 0 && (e = {}), {
3076
3085
  name: "size",
3077
3086
  options: e,
@@ -3138,7 +3147,7 @@ function ie(e) {
3138
3147
  function Kt(e) {
3139
3148
  return !Je() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof q(e).ShadowRoot;
3140
3149
  }
3141
- const ds = /* @__PURE__ */ new Set(["inline", "contents"]);
3150
+ const us = /* @__PURE__ */ new Set(["inline", "contents"]);
3142
3151
  function Oe(e) {
3143
3152
  const {
3144
3153
  overflow: t,
@@ -3146,15 +3155,15 @@ function Oe(e) {
3146
3155
  overflowY: n,
3147
3156
  display: o
3148
3157
  } = te(e);
3149
- return /auto|scroll|overlay|hidden|clip/.test(t + n + r) && !ds.has(o);
3158
+ return /auto|scroll|overlay|hidden|clip/.test(t + n + r) && !us.has(o);
3150
3159
  }
3151
- const us = /* @__PURE__ */ new Set(["table", "td", "th"]);
3152
- function fs(e) {
3153
- return us.has(Se(e));
3160
+ const fs = /* @__PURE__ */ new Set(["table", "td", "th"]);
3161
+ function hs(e) {
3162
+ return fs.has(Se(e));
3154
3163
  }
3155
- const hs = [":popover-open", ":modal"];
3164
+ const ms = [":popover-open", ":modal"];
3156
3165
  function qe(e) {
3157
- return hs.some((t) => {
3166
+ return ms.some((t) => {
3158
3167
  try {
3159
3168
  return e.matches(t);
3160
3169
  } catch {
@@ -3162,12 +3171,12 @@ function qe(e) {
3162
3171
  }
3163
3172
  });
3164
3173
  }
3165
- const ms = ["transform", "translate", "scale", "rotate", "perspective"], ps = ["transform", "translate", "scale", "rotate", "perspective", "filter"], gs = ["paint", "layout", "strict", "content"];
3174
+ const ps = ["transform", "translate", "scale", "rotate", "perspective"], gs = ["transform", "translate", "scale", "rotate", "perspective", "filter"], vs = ["paint", "layout", "strict", "content"];
3166
3175
  function yt(e) {
3167
3176
  const t = xt(), r = ee(e) ? te(e) : e;
3168
- return ms.some((n) => r[n] ? r[n] !== "none" : !1) || (r.containerType ? r.containerType !== "normal" : !1) || !t && (r.backdropFilter ? r.backdropFilter !== "none" : !1) || !t && (r.filter ? r.filter !== "none" : !1) || ps.some((n) => (r.willChange || "").includes(n)) || gs.some((n) => (r.contain || "").includes(n));
3177
+ return ps.some((n) => r[n] ? r[n] !== "none" : !1) || (r.containerType ? r.containerType !== "normal" : !1) || !t && (r.backdropFilter ? r.backdropFilter !== "none" : !1) || !t && (r.filter ? r.filter !== "none" : !1) || gs.some((n) => (r.willChange || "").includes(n)) || vs.some((n) => (r.contain || "").includes(n));
3169
3178
  }
3170
- function vs(e) {
3179
+ function ws(e) {
3171
3180
  let t = he(e);
3172
3181
  for (; ie(t) && !we(t); ) {
3173
3182
  if (yt(t))
@@ -3181,9 +3190,9 @@ function vs(e) {
3181
3190
  function xt() {
3182
3191
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
3183
3192
  }
3184
- const ws = /* @__PURE__ */ new Set(["html", "body", "#document"]);
3193
+ const bs = /* @__PURE__ */ new Set(["html", "body", "#document"]);
3185
3194
  function we(e) {
3186
- return ws.has(Se(e));
3195
+ return bs.has(Se(e));
3187
3196
  }
3188
3197
  function te(e) {
3189
3198
  return q(e).getComputedStyle(e);
@@ -3254,15 +3263,15 @@ function ge(e) {
3254
3263
  y: a
3255
3264
  };
3256
3265
  }
3257
- const bs = /* @__PURE__ */ se(0);
3266
+ const ys = /* @__PURE__ */ se(0);
3258
3267
  function $r(e) {
3259
3268
  const t = q(e);
3260
- return !xt() || !t.visualViewport ? bs : {
3269
+ return !xt() || !t.visualViewport ? ys : {
3261
3270
  x: t.visualViewport.offsetLeft,
3262
3271
  y: t.visualViewport.offsetTop
3263
3272
  };
3264
3273
  }
3265
- function ys(e, t, r) {
3274
+ function xs(e, t, r) {
3266
3275
  return t === void 0 && (t = !1), !r || t && r !== q(e) ? !1 : t;
3267
3276
  }
3268
3277
  function pe(e, t, r, n) {
@@ -3270,7 +3279,7 @@ function pe(e, t, r, n) {
3270
3279
  const o = e.getBoundingClientRect(), s = Ct(e);
3271
3280
  let i = se(1);
3272
3281
  t && (n ? ee(n) && (i = ge(n)) : i = ge(e));
3273
- const a = ys(s, r, n) ? $r(s) : se(0);
3282
+ const a = xs(s, r, n) ? $r(s) : se(0);
3274
3283
  let d = (o.left + a.x) / i.x, l = (o.top + a.y) / i.y, c = o.width / i.x, h = o.height / i.y;
3275
3284
  if (s) {
3276
3285
  const m = q(s), p = n && ee(n) ? q(n) : n;
@@ -3302,7 +3311,7 @@ function Ir(e, t, r) {
3302
3311
  y: s
3303
3312
  };
3304
3313
  }
3305
- function xs(e) {
3314
+ function Cs(e) {
3306
3315
  let {
3307
3316
  elements: t,
3308
3317
  rect: r,
@@ -3329,10 +3338,10 @@ function xs(e) {
3329
3338
  y: r.y * l.y - d.scrollTop * l.y + c.y + m.y
3330
3339
  };
3331
3340
  }
3332
- function Cs(e) {
3341
+ function Ss(e) {
3333
3342
  return Array.from(e.getClientRects());
3334
3343
  }
3335
- function Ss(e) {
3344
+ function Es(e) {
3336
3345
  const t = le(e), r = Ge(e), n = e.ownerDocument.body, o = U(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), s = U(t.scrollHeight, t.clientHeight, n.scrollHeight, n.clientHeight);
3337
3346
  let i = -r.scrollLeft + St(e);
3338
3347
  const a = -r.scrollTop;
@@ -3343,7 +3352,7 @@ function Ss(e) {
3343
3352
  y: a
3344
3353
  };
3345
3354
  }
3346
- function Es(e, t) {
3355
+ function Ts(e, t) {
3347
3356
  const r = q(e), n = le(e), o = r.visualViewport;
3348
3357
  let s = n.clientWidth, i = n.clientHeight, a = 0, d = 0;
3349
3358
  if (o) {
@@ -3358,8 +3367,8 @@ function Es(e, t) {
3358
3367
  y: d
3359
3368
  };
3360
3369
  }
3361
- const Ts = /* @__PURE__ */ new Set(["absolute", "fixed"]);
3362
- function Ns(e, t) {
3370
+ const Ns = /* @__PURE__ */ new Set(["absolute", "fixed"]);
3371
+ function Ps(e, t) {
3363
3372
  const r = pe(e, !0, t === "fixed"), n = r.top + e.clientTop, o = r.left + e.clientLeft, s = ie(e) ? ge(e) : se(1), i = e.clientWidth * s.x, a = e.clientHeight * s.y, d = o * s.x, l = n * s.y;
3364
3373
  return {
3365
3374
  width: i,
@@ -3371,11 +3380,11 @@ function Ns(e, t) {
3371
3380
  function Zt(e, t, r) {
3372
3381
  let n;
3373
3382
  if (t === "viewport")
3374
- n = Es(e, r);
3383
+ n = Ts(e, r);
3375
3384
  else if (t === "document")
3376
- n = Ss(le(e));
3385
+ n = Es(le(e));
3377
3386
  else if (ee(t))
3378
- n = Ns(t, r);
3387
+ n = Ps(t, r);
3379
3388
  else {
3380
3389
  const o = $r(e);
3381
3390
  n = {
@@ -3391,7 +3400,7 @@ function zr(e, t) {
3391
3400
  const r = he(e);
3392
3401
  return r === t || !ee(r) || we(r) ? !1 : te(r).position === "fixed" || zr(r, t);
3393
3402
  }
3394
- function Ps(e, t) {
3403
+ function Rs(e, t) {
3395
3404
  const r = t.get(e);
3396
3405
  if (r)
3397
3406
  return r;
@@ -3400,18 +3409,18 @@ function Ps(e, t) {
3400
3409
  let i = s ? he(e) : e;
3401
3410
  for (; ee(i) && !we(i); ) {
3402
3411
  const a = te(i), d = yt(i);
3403
- !d && a.position === "fixed" && (o = null), (s ? !d && !o : !d && a.position === "static" && !!o && Ts.has(o.position) || Oe(i) && !d && zr(e, i)) ? n = n.filter((c) => c !== i) : o = a, i = he(i);
3412
+ !d && a.position === "fixed" && (o = null), (s ? !d && !o : !d && a.position === "static" && !!o && Ns.has(o.position) || Oe(i) && !d && zr(e, i)) ? n = n.filter((c) => c !== i) : o = a, i = he(i);
3404
3413
  }
3405
3414
  return t.set(e, n), n;
3406
3415
  }
3407
- function Rs(e) {
3416
+ function As(e) {
3408
3417
  let {
3409
3418
  element: t,
3410
3419
  boundary: r,
3411
3420
  rootBoundary: n,
3412
3421
  strategy: o
3413
3422
  } = e;
3414
- const i = [...r === "clippingAncestors" ? qe(t) ? [] : Ps(t, this._c) : [].concat(r), n], a = i[0], d = i.reduce((l, c) => {
3423
+ const i = [...r === "clippingAncestors" ? qe(t) ? [] : Rs(t, this._c) : [].concat(r), n], a = i[0], d = i.reduce((l, c) => {
3415
3424
  const h = Zt(t, c, o);
3416
3425
  return l.top = U(h.top, l.top), l.right = fe(h.right, l.right), l.bottom = fe(h.bottom, l.bottom), l.left = U(h.left, l.left), l;
3417
3426
  }, Zt(t, a, o));
@@ -3422,7 +3431,7 @@ function Rs(e) {
3422
3431
  y: d.top
3423
3432
  };
3424
3433
  }
3425
- function As(e) {
3434
+ function Os(e) {
3426
3435
  const {
3427
3436
  width: t,
3428
3437
  height: r
@@ -3432,7 +3441,7 @@ function As(e) {
3432
3441
  height: r
3433
3442
  };
3434
3443
  }
3435
- function Os(e, t, r) {
3444
+ function Ls(e, t, r) {
3436
3445
  const n = ie(t), o = le(t), s = r === "fixed", i = pe(e, !0, s, t);
3437
3446
  let a = {
3438
3447
  scrollLeft: 0,
@@ -3481,14 +3490,14 @@ function Hr(e, t) {
3481
3490
  return r;
3482
3491
  }
3483
3492
  let n = Qt(e, t);
3484
- for (; n && fs(n) && et(n); )
3493
+ for (; n && hs(n) && et(n); )
3485
3494
  n = Qt(n, t);
3486
- return n && we(n) && et(n) && !yt(n) ? r : n || vs(e) || r;
3495
+ return n && we(n) && et(n) && !yt(n) ? r : n || ws(e) || r;
3487
3496
  }
3488
- const Ls = async function(e) {
3497
+ const Ds = async function(e) {
3489
3498
  const t = this.getOffsetParent || Hr, r = this.getDimensions, n = await r(e.floating);
3490
3499
  return {
3491
- reference: Os(e.reference, await t(e.floating), e.strategy),
3500
+ reference: Ls(e.reference, await t(e.floating), e.strategy),
3492
3501
  floating: {
3493
3502
  x: 0,
3494
3503
  y: 0,
@@ -3497,25 +3506,25 @@ const Ls = async function(e) {
3497
3506
  }
3498
3507
  };
3499
3508
  };
3500
- function Ds(e) {
3509
+ function _s(e) {
3501
3510
  return te(e).direction === "rtl";
3502
3511
  }
3503
- const _s = {
3504
- convertOffsetParentRelativeRectToViewportRelativeRect: xs,
3512
+ const Ms = {
3513
+ convertOffsetParentRelativeRectToViewportRelativeRect: Cs,
3505
3514
  getDocumentElement: le,
3506
- getClippingRect: Rs,
3515
+ getClippingRect: As,
3507
3516
  getOffsetParent: Hr,
3508
- getElementRects: Ls,
3509
- getClientRects: Cs,
3510
- getDimensions: As,
3517
+ getElementRects: Ds,
3518
+ getClientRects: Ss,
3519
+ getDimensions: Os,
3511
3520
  getScale: ge,
3512
3521
  isElement: ee,
3513
- isRTL: Ds
3522
+ isRTL: _s
3514
3523
  };
3515
3524
  function Fr(e, t) {
3516
3525
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
3517
3526
  }
3518
- function Ms(e, t) {
3527
+ function ks(e, t) {
3519
3528
  let r = null, n;
3520
3529
  const o = le(e);
3521
3530
  function s() {
@@ -3561,7 +3570,7 @@ function Ms(e, t) {
3561
3570
  }
3562
3571
  return i(!0), s;
3563
3572
  }
3564
- function ks(e, t, r, n) {
3573
+ function $s(e, t, r, n) {
3565
3574
  n === void 0 && (n = {});
3566
3575
  const {
3567
3576
  ancestorScroll: o = !0,
@@ -3575,7 +3584,7 @@ function ks(e, t, r, n) {
3575
3584
  passive: !0
3576
3585
  }), s && S.addEventListener("resize", r);
3577
3586
  });
3578
- const h = l && a ? Ms(l, r) : null;
3587
+ const h = l && a ? ks(l, r) : null;
3579
3588
  let m = -1, p = null;
3580
3589
  i && (p = new ResizeObserver((S) => {
3581
3590
  let [E] = S;
@@ -3597,21 +3606,21 @@ function ks(e, t, r, n) {
3597
3606
  }), h == null || h(), (S = p) == null || S.disconnect(), p = null, d && cancelAnimationFrame(g);
3598
3607
  };
3599
3608
  }
3600
- const $s = is, Is = as, zs = ns, Hs = cs, Fs = os, er = rs, Ws = ls, Bs = (e, t, r) => {
3609
+ const Is = as, zs = ls, Hs = os, Fs = ds, Ws = ss, er = ns, Bs = cs, js = (e, t, r) => {
3601
3610
  const n = /* @__PURE__ */ new Map(), o = {
3602
- platform: _s,
3611
+ platform: Ms,
3603
3612
  ...r
3604
3613
  }, s = {
3605
3614
  ...o.platform,
3606
3615
  _c: n
3607
3616
  };
3608
- return ts(e, t, {
3617
+ return rs(e, t, {
3609
3618
  ...o,
3610
3619
  platform: s
3611
3620
  });
3612
3621
  };
3613
- var js = typeof document < "u", Vs = function() {
3614
- }, ke = js ? vn : Vs;
3622
+ var Vs = typeof document < "u", Ys = function() {
3623
+ }, ke = Vs ? vn : Ys;
3615
3624
  function je(e, t) {
3616
3625
  if (e === t)
3617
3626
  return !0;
@@ -3655,7 +3664,7 @@ function tt(e) {
3655
3664
  t.current = e;
3656
3665
  }), t;
3657
3666
  }
3658
- function Ys(e) {
3667
+ function Xs(e) {
3659
3668
  e === void 0 && (e = {});
3660
3669
  const {
3661
3670
  placement: t = "bottom",
@@ -3690,7 +3699,7 @@ function Ys(e) {
3690
3699
  strategy: r,
3691
3700
  middleware: m
3692
3701
  };
3693
- z.current && (D.platform = z.current), Bs(A.current, N.current, D).then((H) => {
3702
+ z.current && (D.platform = z.current), js(A.current, N.current, D).then((H) => {
3694
3703
  const I = {
3695
3704
  ...H,
3696
3705
  // The floating element's position may be recomputed while it's closed
@@ -3757,7 +3766,7 @@ function Ys(e) {
3757
3766
  floatingStyles: _
3758
3767
  }), [c, w, L, T, _]);
3759
3768
  }
3760
- const Xs = (e) => {
3769
+ const Us = (e) => {
3761
3770
  function t(r) {
3762
3771
  return {}.hasOwnProperty.call(r, "current");
3763
3772
  }
@@ -3778,17 +3787,14 @@ const Xs = (e) => {
3778
3787
  }).fn(r) : {};
3779
3788
  }
3780
3789
  };
3781
- }, Us = (e, t) => ({
3782
- ...$s(e),
3783
- options: [e, t]
3784
- }), Js = (e, t) => ({
3790
+ }, Js = (e, t) => ({
3785
3791
  ...Is(e),
3786
3792
  options: [e, t]
3787
3793
  }), qs = (e, t) => ({
3788
- ...Ws(e),
3794
+ ...zs(e),
3789
3795
  options: [e, t]
3790
3796
  }), Gs = (e, t) => ({
3791
- ...zs(e),
3797
+ ...Bs(e),
3792
3798
  options: [e, t]
3793
3799
  }), Ks = (e, t) => ({
3794
3800
  ...Hs(e),
@@ -3797,10 +3803,13 @@ const Xs = (e) => {
3797
3803
  ...Fs(e),
3798
3804
  options: [e, t]
3799
3805
  }), Qs = (e, t) => ({
3800
- ...Xs(e),
3806
+ ...Ws(e),
3807
+ options: [e, t]
3808
+ }), ei = (e, t) => ({
3809
+ ...Us(e),
3801
3810
  options: [e, t]
3802
3811
  });
3803
- var ei = "Arrow", Br = f.forwardRef((e, t) => {
3812
+ var ti = "Arrow", Br = f.forwardRef((e, t) => {
3804
3813
  const { children: r, width: n = 10, height: o = 5, ...s } = e;
3805
3814
  return /* @__PURE__ */ u(
3806
3815
  X.svg,
@@ -3815,9 +3824,9 @@ var ei = "Arrow", Br = f.forwardRef((e, t) => {
3815
3824
  }
3816
3825
  );
3817
3826
  });
3818
- Br.displayName = ei;
3819
- var ti = Br;
3820
- function ri(e) {
3827
+ Br.displayName = ti;
3828
+ var ri = Br;
3829
+ function ni(e) {
3821
3830
  const [t, r] = f.useState(void 0);
3822
3831
  return ue(() => {
3823
3832
  if (e) {
@@ -3839,9 +3848,9 @@ function ri(e) {
3839
3848
  r(void 0);
3840
3849
  }, [e]), t;
3841
3850
  }
3842
- var Et = "Popper", [jr, Vr] = ut(Et), [ni, Yr] = jr(Et), Xr = (e) => {
3851
+ var Et = "Popper", [jr, Vr] = ut(Et), [oi, Yr] = jr(Et), Xr = (e) => {
3843
3852
  const { __scopePopper: t, children: r } = e, [n, o] = f.useState(null);
3844
- return /* @__PURE__ */ u(ni, { scope: t, anchor: n, onAnchorChange: o, children: r });
3853
+ return /* @__PURE__ */ u(oi, { scope: t, anchor: n, onAnchorChange: o, children: r });
3845
3854
  };
3846
3855
  Xr.displayName = Et;
3847
3856
  var Ur = "PopperAnchor", Jr = f.forwardRef(
@@ -3853,7 +3862,7 @@ var Ur = "PopperAnchor", Jr = f.forwardRef(
3853
3862
  }
3854
3863
  );
3855
3864
  Jr.displayName = Ur;
3856
- var Tt = "PopperContent", [oi, si] = jr(Tt), qr = f.forwardRef(
3865
+ var Tt = "PopperContent", [si, ii] = jr(Tt), qr = f.forwardRef(
3857
3866
  (e, t) => {
3858
3867
  var Pt, Rt, At, Ot, Lt, Dt;
3859
3868
  const {
@@ -3871,40 +3880,40 @@ var Tt = "PopperContent", [oi, si] = jr(Tt), qr = f.forwardRef(
3871
3880
  updatePositionStrategy: p = "optimized",
3872
3881
  onPlaced: g,
3873
3882
  ...y
3874
- } = e, C = Yr(Tt, r), [S, E] = f.useState(null), R = G(t, (Ee) => E(Ee)), [v, b] = f.useState(null), A = ri(v), N = (A == null ? void 0 : A.width) ?? 0, M = (A == null ? void 0 : A.height) ?? 0, k = n + (s !== "center" ? "-" + s : ""), $ = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, z = Array.isArray(l) ? l : [l], x = z.length > 0, w = {
3883
+ } = e, C = Yr(Tt, r), [S, E] = f.useState(null), R = G(t, (Ee) => E(Ee)), [v, b] = f.useState(null), A = ni(v), N = (A == null ? void 0 : A.width) ?? 0, M = (A == null ? void 0 : A.height) ?? 0, k = n + (s !== "center" ? "-" + s : ""), $ = typeof c == "number" ? c : { top: 0, right: 0, bottom: 0, left: 0, ...c }, z = Array.isArray(l) ? l : [l], x = z.length > 0, w = {
3875
3884
  padding: $,
3876
- boundary: z.filter(ai),
3885
+ boundary: z.filter(li),
3877
3886
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
3878
3887
  altBoundary: x
3879
- }, { refs: P, floatingStyles: L, placement: T, isPositioned: _, middlewareData: D } = Ys({
3888
+ }, { refs: P, floatingStyles: L, placement: T, isPositioned: _, middlewareData: D } = Xs({
3880
3889
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
3881
3890
  strategy: "fixed",
3882
3891
  placement: k,
3883
- whileElementsMounted: (...Ee) => ks(...Ee, {
3892
+ whileElementsMounted: (...Ee) => $s(...Ee, {
3884
3893
  animationFrame: p === "always"
3885
3894
  }),
3886
3895
  elements: {
3887
3896
  reference: C.anchor
3888
3897
  },
3889
3898
  middleware: [
3890
- Us({ mainAxis: o + M, alignmentAxis: i }),
3891
- d && Js({
3899
+ Js({ mainAxis: o + M, alignmentAxis: i }),
3900
+ d && qs({
3892
3901
  mainAxis: !0,
3893
3902
  crossAxis: !1,
3894
- limiter: h === "partial" ? qs() : void 0,
3903
+ limiter: h === "partial" ? Gs() : void 0,
3895
3904
  ...w
3896
3905
  }),
3897
- d && Gs({ ...w }),
3898
- Ks({
3906
+ d && Ks({ ...w }),
3907
+ Zs({
3899
3908
  ...w,
3900
3909
  apply: ({ elements: Ee, rects: _t, availableWidth: dn, availableHeight: un }) => {
3901
3910
  const { width: fn, height: hn } = _t.reference, De = Ee.floating.style;
3902
3911
  De.setProperty("--radix-popper-available-width", `${dn}px`), De.setProperty("--radix-popper-available-height", `${un}px`), De.setProperty("--radix-popper-anchor-width", `${fn}px`), De.setProperty("--radix-popper-anchor-height", `${hn}px`);
3903
3912
  }
3904
3913
  }),
3905
- v && Qs({ element: v, padding: a }),
3906
- li({ arrowWidth: N, arrowHeight: M }),
3907
- m && Zs({ strategy: "referenceHidden", ...w })
3914
+ v && ei({ element: v, padding: a }),
3915
+ ci({ arrowWidth: N, arrowHeight: M }),
3916
+ m && Qs({ strategy: "referenceHidden", ...w })
3908
3917
  ]
3909
3918
  }), [H, I] = Zr(T), W = Q(g);
3910
3919
  ue(() => {
@@ -3938,7 +3947,7 @@ var Tt = "PopperContent", [oi, si] = jr(Tt), qr = f.forwardRef(
3938
3947
  },
3939
3948
  dir: e.dir,
3940
3949
  children: /* @__PURE__ */ u(
3941
- oi,
3950
+ si,
3942
3951
  {
3943
3952
  scope: r,
3944
3953
  placedSide: H,
@@ -3968,13 +3977,13 @@ var Tt = "PopperContent", [oi, si] = jr(Tt), qr = f.forwardRef(
3968
3977
  }
3969
3978
  );
3970
3979
  qr.displayName = Tt;
3971
- var Gr = "PopperArrow", ii = {
3980
+ var Gr = "PopperArrow", ai = {
3972
3981
  top: "bottom",
3973
3982
  right: "left",
3974
3983
  bottom: "top",
3975
3984
  left: "right"
3976
3985
  }, Kr = f.forwardRef(function(t, r) {
3977
- const { __scopePopper: n, ...o } = t, s = si(Gr, n), i = ii[s.placedSide];
3986
+ const { __scopePopper: n, ...o } = t, s = ii(Gr, n), i = ai[s.placedSide];
3978
3987
  return (
3979
3988
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
3980
3989
  // doesn't report size as we'd expect on SVG elements.
@@ -4003,7 +4012,7 @@ var Gr = "PopperArrow", ii = {
4003
4012
  visibility: s.shouldHideArrow ? "hidden" : void 0
4004
4013
  },
4005
4014
  children: /* @__PURE__ */ u(
4006
- ti,
4015
+ ri,
4007
4016
  {
4008
4017
  ...o,
4009
4018
  ref: r,
@@ -4019,10 +4028,10 @@ var Gr = "PopperArrow", ii = {
4019
4028
  );
4020
4029
  });
4021
4030
  Kr.displayName = Gr;
4022
- function ai(e) {
4031
+ function li(e) {
4023
4032
  return e !== null;
4024
4033
  }
4025
- var li = (e) => ({
4034
+ var ci = (e) => ({
4026
4035
  name: "transformOrigin",
4027
4036
  options: e,
4028
4037
  fn(t) {
@@ -4036,15 +4045,15 @@ function Zr(e) {
4036
4045
  const [t, r = "center"] = e.split("-");
4037
4046
  return [t, r];
4038
4047
  }
4039
- var ci = Xr, di = Jr, ui = qr, fi = Kr, hi = f[" useInsertionEffect ".trim().toString()] || ue;
4040
- function mi({
4048
+ var di = Xr, ui = Jr, fi = qr, hi = Kr, mi = f[" useInsertionEffect ".trim().toString()] || ue;
4049
+ function pi({
4041
4050
  prop: e,
4042
4051
  defaultProp: t,
4043
4052
  onChange: r = () => {
4044
4053
  },
4045
4054
  caller: n
4046
4055
  }) {
4047
- const [o, s, i] = pi({
4056
+ const [o, s, i] = gi({
4048
4057
  defaultProp: t,
4049
4058
  onChange: r
4050
4059
  }), a = e !== void 0, d = a ? e : o;
@@ -4061,7 +4070,7 @@ function mi({
4061
4070
  (c) => {
4062
4071
  var h;
4063
4072
  if (a) {
4064
- const m = gi(c) ? c(e) : c;
4073
+ const m = vi(c) ? c(e) : c;
4065
4074
  m !== e && ((h = i.current) == null || h.call(i, m));
4066
4075
  } else
4067
4076
  s(c);
@@ -4070,22 +4079,22 @@ function mi({
4070
4079
  );
4071
4080
  return [d, l];
4072
4081
  }
4073
- function pi({
4082
+ function gi({
4074
4083
  defaultProp: e,
4075
4084
  onChange: t
4076
4085
  }) {
4077
4086
  const [r, n] = f.useState(e), o = f.useRef(r), s = f.useRef(t);
4078
- return hi(() => {
4087
+ return mi(() => {
4079
4088
  s.current = t;
4080
4089
  }, [t]), f.useEffect(() => {
4081
4090
  var i;
4082
4091
  o.current !== r && ((i = s.current) == null || i.call(s, r), o.current = r);
4083
4092
  }, [r, o]), [r, n, s];
4084
4093
  }
4085
- function gi(e) {
4094
+ function vi(e) {
4086
4095
  return typeof e == "function";
4087
4096
  }
4088
- var vi = Object.freeze({
4097
+ var wi = Object.freeze({
4089
4098
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
4090
4099
  position: "absolute",
4091
4100
  border: 0,
@@ -4097,23 +4106,23 @@ var vi = Object.freeze({
4097
4106
  clip: "rect(0, 0, 0, 0)",
4098
4107
  whiteSpace: "nowrap",
4099
4108
  wordWrap: "normal"
4100
- }), wi = "VisuallyHidden", Qr = f.forwardRef(
4109
+ }), bi = "VisuallyHidden", Qr = f.forwardRef(
4101
4110
  (e, t) => /* @__PURE__ */ u(
4102
4111
  X.span,
4103
4112
  {
4104
4113
  ...e,
4105
4114
  ref: t,
4106
- style: { ...vi, ...e.style }
4115
+ style: { ...wi, ...e.style }
4107
4116
  }
4108
4117
  )
4109
4118
  );
4110
- Qr.displayName = wi;
4111
- var bi = Qr, [Ke, sa] = ut("Tooltip", [
4119
+ Qr.displayName = bi;
4120
+ var yi = Qr, [Ke, ia] = ut("Tooltip", [
4112
4121
  Vr
4113
- ]), Ze = Vr(), en = "TooltipProvider", yi = 700, at = "tooltip.open", [xi, Nt] = Ke(en), tn = (e) => {
4122
+ ]), Ze = Vr(), en = "TooltipProvider", xi = 700, at = "tooltip.open", [Ci, Nt] = Ke(en), tn = (e) => {
4114
4123
  const {
4115
4124
  __scopeTooltip: t,
4116
- delayDuration: r = yi,
4125
+ delayDuration: r = xi,
4117
4126
  skipDelayDuration: n = 300,
4118
4127
  disableHoverableContent: o = !1,
4119
4128
  children: s
@@ -4122,7 +4131,7 @@ var bi = Qr, [Ke, sa] = ut("Tooltip", [
4122
4131
  const l = d.current;
4123
4132
  return () => window.clearTimeout(l);
4124
4133
  }, []), /* @__PURE__ */ u(
4125
- xi,
4134
+ Ci,
4126
4135
  {
4127
4136
  scope: t,
4128
4137
  isOpenDelayedRef: i,
@@ -4146,7 +4155,7 @@ var bi = Qr, [Ke, sa] = ut("Tooltip", [
4146
4155
  );
4147
4156
  };
4148
4157
  tn.displayName = en;
4149
- var Pe = "Tooltip", [Ci, Qe] = Ke(Pe), rn = (e) => {
4158
+ var Pe = "Tooltip", [Si, Qe] = Ke(Pe), rn = (e) => {
4150
4159
  const {
4151
4160
  __scopeTooltip: t,
4152
4161
  children: r,
@@ -4155,7 +4164,7 @@ var Pe = "Tooltip", [Ci, Qe] = Ke(Pe), rn = (e) => {
4155
4164
  onOpenChange: s,
4156
4165
  disableHoverableContent: i,
4157
4166
  delayDuration: a
4158
- } = e, d = Nt(Pe, e.__scopeTooltip), l = Ze(t), [c, h] = f.useState(null), m = jo(), p = f.useRef(0), g = i ?? d.disableHoverableContent, y = a ?? d.delayDuration, C = f.useRef(!1), [S, E] = mi({
4167
+ } = e, d = Nt(Pe, e.__scopeTooltip), l = Ze(t), [c, h] = f.useState(null), m = Vo(), p = f.useRef(0), g = i ?? d.disableHoverableContent, y = a ?? d.delayDuration, C = f.useRef(!1), [S, E] = pi({
4159
4168
  prop: n,
4160
4169
  defaultProp: o ?? !1,
4161
4170
  onChange: (N) => {
@@ -4173,8 +4182,8 @@ var Pe = "Tooltip", [Ci, Qe] = Ke(Pe), rn = (e) => {
4173
4182
  }, [y, E]);
4174
4183
  return f.useEffect(() => () => {
4175
4184
  p.current && (window.clearTimeout(p.current), p.current = 0);
4176
- }, []), /* @__PURE__ */ u(ci, { ...l, children: /* @__PURE__ */ u(
4177
- Ci,
4185
+ }, []), /* @__PURE__ */ u(di, { ...l, children: /* @__PURE__ */ u(
4186
+ Si,
4178
4187
  {
4179
4188
  scope: t,
4180
4189
  contentId: m,
@@ -4199,7 +4208,7 @@ rn.displayName = Pe;
4199
4208
  var lt = "TooltipTrigger", nn = f.forwardRef(
4200
4209
  (e, t) => {
4201
4210
  const { __scopeTooltip: r, ...n } = e, o = Qe(lt, r), s = Nt(lt, r), i = Ze(r), a = f.useRef(null), d = G(t, a, o.onTriggerChange), l = f.useRef(!1), c = f.useRef(!1), h = f.useCallback(() => l.current = !1, []);
4202
- return f.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ u(di, { asChild: !0, ...i, children: /* @__PURE__ */ u(
4211
+ return f.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ u(ui, { asChild: !0, ...i, children: /* @__PURE__ */ u(
4203
4212
  X.button,
4204
4213
  {
4205
4214
  "aria-describedby": o.open ? o.contentId : void 0,
@@ -4225,19 +4234,19 @@ var lt = "TooltipTrigger", nn = f.forwardRef(
4225
4234
  }
4226
4235
  );
4227
4236
  nn.displayName = lt;
4228
- var Si = "TooltipPortal", [ia, Ei] = Ke(Si, {
4237
+ var Ei = "TooltipPortal", [aa, Ti] = Ke(Ei, {
4229
4238
  forceMount: void 0
4230
4239
  }), be = "TooltipContent", on = f.forwardRef(
4231
4240
  (e, t) => {
4232
- const r = Ei(be, e.__scopeTooltip), { forceMount: n = r.forceMount, side: o = "top", ...s } = e, i = Qe(be, e.__scopeTooltip);
4233
- return /* @__PURE__ */ u(xe, { present: n || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ u(sn, { side: o, ...s, ref: t }) : /* @__PURE__ */ u(Ti, { side: o, ...s, ref: t }) });
4241
+ const r = Ti(be, e.__scopeTooltip), { forceMount: n = r.forceMount, side: o = "top", ...s } = e, i = Qe(be, e.__scopeTooltip);
4242
+ return /* @__PURE__ */ u(xe, { present: n || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ u(sn, { side: o, ...s, ref: t }) : /* @__PURE__ */ u(Ni, { side: o, ...s, ref: t }) });
4234
4243
  }
4235
- ), Ti = f.forwardRef((e, t) => {
4244
+ ), Ni = f.forwardRef((e, t) => {
4236
4245
  const r = Qe(be, e.__scopeTooltip), n = Nt(be, e.__scopeTooltip), o = f.useRef(null), s = G(t, o), [i, a] = f.useState(null), { trigger: d, onClose: l } = r, c = o.current, { onPointerInTransitChange: h } = n, m = f.useCallback(() => {
4237
4246
  a(null), h(!1);
4238
4247
  }, [h]), p = f.useCallback(
4239
4248
  (g, y) => {
4240
- const C = g.currentTarget, S = { x: g.clientX, y: g.clientY }, E = Oi(S, C.getBoundingClientRect()), R = Li(S, E), v = Di(y.getBoundingClientRect()), b = Mi([...R, ...v]);
4249
+ const C = g.currentTarget, S = { x: g.clientX, y: g.clientY }, E = Li(S, C.getBoundingClientRect()), R = Di(S, E), v = _i(y.getBoundingClientRect()), b = ki([...R, ...v]);
4241
4250
  a(b), h(!0);
4242
4251
  },
4243
4252
  [h]
@@ -4252,13 +4261,13 @@ var Si = "TooltipPortal", [ia, Ei] = Ke(Si, {
4252
4261
  }, [d, c, p, m]), f.useEffect(() => {
4253
4262
  if (i) {
4254
4263
  const g = (y) => {
4255
- const C = y.target, S = { x: y.clientX, y: y.clientY }, E = (d == null ? void 0 : d.contains(C)) || (c == null ? void 0 : c.contains(C)), R = !_i(S, i);
4264
+ const C = y.target, S = { x: y.clientX, y: y.clientY }, E = (d == null ? void 0 : d.contains(C)) || (c == null ? void 0 : c.contains(C)), R = !Mi(S, i);
4256
4265
  E ? m() : R && (m(), l());
4257
4266
  };
4258
4267
  return document.addEventListener("pointermove", g), () => document.removeEventListener("pointermove", g);
4259
4268
  }
4260
4269
  }, [d, c, i, l, m]), /* @__PURE__ */ u(sn, { ...e, ref: s });
4261
- }), [Ni, Pi] = Ke(Pe, { isInside: !1 }), Ri = Mn("TooltipContent"), sn = f.forwardRef(
4270
+ }), [Pi, Ri] = Ke(Pe, { isInside: !1 }), Ai = Mn("TooltipContent"), sn = f.forwardRef(
4262
4271
  (e, t) => {
4263
4272
  const {
4264
4273
  __scopeTooltip: r,
@@ -4286,7 +4295,7 @@ var Si = "TooltipPortal", [ia, Ei] = Ke(Si, {
4286
4295
  onFocusOutside: (h) => h.preventDefault(),
4287
4296
  onDismiss: c,
4288
4297
  children: /* @__PURE__ */ O(
4289
- ui,
4298
+ fi,
4290
4299
  {
4291
4300
  "data-state": d.stateAttribute,
4292
4301
  ...l,
@@ -4301,8 +4310,8 @@ var Si = "TooltipPortal", [ia, Ei] = Ke(Si, {
4301
4310
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
4302
4311
  },
4303
4312
  children: [
4304
- /* @__PURE__ */ u(Ri, { children: n }),
4305
- /* @__PURE__ */ u(Ni, { scope: r, isInside: !0, children: /* @__PURE__ */ u(bi, { id: d.contentId, role: "tooltip", children: o || n }) })
4313
+ /* @__PURE__ */ u(Ai, { children: n }),
4314
+ /* @__PURE__ */ u(Pi, { scope: r, isInside: !0, children: /* @__PURE__ */ u(yi, { id: d.contentId, role: "tooltip", children: o || n }) })
4306
4315
  ]
4307
4316
  }
4308
4317
  )
@@ -4311,17 +4320,17 @@ var Si = "TooltipPortal", [ia, Ei] = Ke(Si, {
4311
4320
  }
4312
4321
  );
4313
4322
  on.displayName = be;
4314
- var an = "TooltipArrow", Ai = f.forwardRef(
4323
+ var an = "TooltipArrow", Oi = f.forwardRef(
4315
4324
  (e, t) => {
4316
4325
  const { __scopeTooltip: r, ...n } = e, o = Ze(r);
4317
- return Pi(
4326
+ return Ri(
4318
4327
  an,
4319
4328
  r
4320
- ).isInside ? null : /* @__PURE__ */ u(fi, { ...o, ...n, ref: t });
4329
+ ).isInside ? null : /* @__PURE__ */ u(hi, { ...o, ...n, ref: t });
4321
4330
  }
4322
4331
  );
4323
- Ai.displayName = an;
4324
- function Oi(e, t) {
4332
+ Oi.displayName = an;
4333
+ function Li(e, t) {
4325
4334
  const r = Math.abs(t.top - e.y), n = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), s = Math.abs(t.left - e.x);
4326
4335
  switch (Math.min(r, n, o, s)) {
4327
4336
  case s:
@@ -4336,7 +4345,7 @@ function Oi(e, t) {
4336
4345
  throw new Error("unreachable");
4337
4346
  }
4338
4347
  }
4339
- function Li(e, t, r = 5) {
4348
+ function Di(e, t, r = 5) {
4340
4349
  const n = [];
4341
4350
  switch (t) {
4342
4351
  case "top":
@@ -4366,7 +4375,7 @@ function Li(e, t, r = 5) {
4366
4375
  }
4367
4376
  return n;
4368
4377
  }
4369
- function Di(e) {
4378
+ function _i(e) {
4370
4379
  const { top: t, right: r, bottom: n, left: o } = e;
4371
4380
  return [
4372
4381
  { x: o, y: t },
@@ -4375,7 +4384,7 @@ function Di(e) {
4375
4384
  { x: o, y: n }
4376
4385
  ];
4377
4386
  }
4378
- function _i(e, t) {
4387
+ function Mi(e, t) {
4379
4388
  const { x: r, y: n } = e;
4380
4389
  let o = !1;
4381
4390
  for (let s = 0, i = t.length - 1; s < t.length; i = s++) {
@@ -4384,11 +4393,11 @@ function _i(e, t) {
4384
4393
  }
4385
4394
  return o;
4386
4395
  }
4387
- function Mi(e) {
4396
+ function ki(e) {
4388
4397
  const t = e.slice();
4389
- return t.sort((r, n) => r.x < n.x ? -1 : r.x > n.x ? 1 : r.y < n.y ? -1 : r.y > n.y ? 1 : 0), ki(t);
4398
+ return t.sort((r, n) => r.x < n.x ? -1 : r.x > n.x ? 1 : r.y < n.y ? -1 : r.y > n.y ? 1 : 0), $i(t);
4390
4399
  }
4391
- function ki(e) {
4400
+ function $i(e) {
4392
4401
  if (e.length <= 1) return e.slice();
4393
4402
  const t = [];
4394
4403
  for (let n = 0; n < e.length; n++) {
@@ -4413,8 +4422,8 @@ function ki(e) {
4413
4422
  }
4414
4423
  return r.pop(), t.length === 1 && r.length === 1 && t[0].x === r[0].x && t[0].y === r[0].y ? t : t.concat(r);
4415
4424
  }
4416
- var $i = tn, Ii = rn, zi = nn, ln = on;
4417
- const aa = $i, la = Ii, ca = zi, Hi = f.forwardRef(({ className: e, sideOffset: t = 4, ...r }, n) => /* @__PURE__ */ u(
4425
+ var Ii = tn, zi = rn, Hi = nn, ln = on;
4426
+ const la = Ii, ca = zi, da = Hi, Fi = f.forwardRef(({ className: e, sideOffset: t = 4, ...r }, n) => /* @__PURE__ */ u(
4418
4427
  ln,
4419
4428
  {
4420
4429
  ref: n,
@@ -4426,58 +4435,58 @@ const aa = $i, la = Ii, ca = zi, Hi = f.forwardRef(({ className: e, sideOffset:
4426
4435
  ...r
4427
4436
  }
4428
4437
  ));
4429
- Hi.displayName = ln.displayName;
4430
- const da = {
4438
+ Fi.displayName = ln.displayName;
4439
+ const ua = {
4431
4440
  ChatProvider: ct,
4432
4441
  ChatInterface: Re,
4433
4442
  MessageComponent: lr,
4434
4443
  ThreadManager: Ae,
4435
- ChatApp: uo,
4444
+ ChatApp: fo,
4436
4445
  useChat: ye
4437
4446
  };
4438
4447
  export {
4439
4448
  F as Button,
4440
- bo as Card,
4441
- So as CardContent,
4442
- Co as CardDescription,
4443
- Eo as CardFooter,
4444
- yo as CardHeader,
4445
- xo as CardTitle,
4446
- uo as ChatApp,
4449
+ yo as Card,
4450
+ Eo as CardContent,
4451
+ So as CardDescription,
4452
+ To as CardFooter,
4453
+ xo as CardHeader,
4454
+ Co as CardTitle,
4455
+ fo as ChatApp,
4447
4456
  Re as ChatInterface,
4448
4457
  ct as ChatProvider,
4449
- Qi as ChatWidget,
4450
- To as Input,
4451
- Ro as Label,
4458
+ ea as ChatWidget,
4459
+ No as Input,
4460
+ Ao as Label,
4452
4461
  ir as MESSAGE_MAX_LENGTH,
4453
4462
  lr as MessageComponent,
4454
4463
  Cr as ScrollArea,
4455
- Do as Separator,
4464
+ _o as Separator,
4456
4465
  In as THREAD_ID_PATTERN,
4457
4466
  It as TITLE_MAX_LENGTH,
4458
4467
  dt as Textarea,
4459
4468
  Ae as ThreadManager,
4460
- la as Tooltip,
4461
- Hi as TooltipContent,
4462
- aa as TooltipProvider,
4463
- ca as TooltipTrigger,
4469
+ ca as Tooltip,
4470
+ Fi as TooltipContent,
4471
+ la as TooltipProvider,
4472
+ da as TooltipTrigger,
4464
4473
  Y as cn,
4465
- da as default,
4466
- Gi as safeJsonParse,
4467
- Ui as sanitizeHtml,
4474
+ ua as default,
4475
+ Ki as safeJsonParse,
4476
+ Ji as sanitizeHtml,
4468
4477
  me as sanitizeText,
4469
4478
  ye as useChat,
4470
- ta as useChatActions,
4471
- vo as useChatMessages,
4472
- oa as useCodeExecution,
4473
- na as useFileContents,
4474
- ra as useSearchResults,
4475
- wo as useStreamMonitor,
4479
+ ra as useChatActions,
4480
+ wo as useChatMessages,
4481
+ sa as useCodeExecution,
4482
+ oa as useFileContents,
4483
+ na as useSearchResults,
4484
+ bo as useStreamMonitor,
4476
4485
  gt as useToolExtractor,
4477
- ea as useToolMessages,
4486
+ ta as useToolMessages,
4478
4487
  Ie as validateAndSanitizeMessage,
4479
- qi as validateAndSanitizeTitle,
4488
+ Gi as validateAndSanitizeTitle,
4480
4489
  zn as validateMessageLength,
4481
- Ji as validateThreadId,
4482
- Ki as withInputValidation
4490
+ qi as validateThreadId,
4491
+ Zi as withInputValidation
4483
4492
  };