teodor-new-chat-ui 3.0.5 → 3.0.6

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
@@ -1,7 +1,7 @@
1
1
  import { jsx as c, jsxs as E, Fragment as Ae } from "react/jsx-runtime";
2
2
  import * as u from "react";
3
3
  import qe, { useState as re, useRef as Te, useCallback as ve, useEffect as ge, useReducer as Zu, useMemo as gt, createContext as Ia, useContext as _a, useLayoutEffect as Qu } from "react";
4
- import { ChevronUp as Zt, ChevronDown as kt, Copy as Ns, Edit as Rs, RotateCcw as fo, Bot as Ts, Wrench as ed, User as td, Image as nd, ChevronRight as rd, Check as $o, Circle as od, X as tn, Loader2 as As, Edit3 as Oa, Paperclip as Ps, Plus as sd, FileSpreadsheet as ad, Square as id, Send as cd, MessageSquarePlus as ld, MessageSquare as ud, Calendar as dd, Trash2 as fd, PanelLeft as pd, Settings as hd, Server as md, EyeOff as gd, Eye as bd, Layout as vd, MessageCircle as wd, Save as yd } from "lucide-react";
4
+ import { ChevronUp as Zt, ChevronDown as Mt, Copy as Ns, Edit as Rs, RotateCcw as fo, Bot as Ts, Wrench as ed, User as td, Image as nd, ChevronRight as rd, Check as $o, Circle as od, X as tn, Loader2 as As, Edit3 as Oa, Paperclip as Ps, Plus as sd, FileSpreadsheet as ad, Square as id, Send as cd, MessageSquarePlus as ld, MessageSquare as ud, Calendar as dd, Trash2 as fd, PanelLeft as pd, Settings as hd, Server as md, EyeOff as gd, Eye as bd, Layout as vd, MessageCircle as wd, Save as yd } from "lucide-react";
5
5
  import { Slot as zt, createSlot as Ft, createSlottable as xd } from "@radix-ui/react-slot";
6
6
  import { cva as fn } from "class-variance-authority";
7
7
  import { clsx as Sd } from "clsx";
@@ -10,12 +10,12 @@ import * as ur from "react-dom";
10
10
  import Ed from "react-dom";
11
11
  import Nd from "react-markdown";
12
12
  import Rd from "remark-gfm";
13
- function Ma(e, t) {
13
+ function ka(e, t) {
14
14
  return function() {
15
15
  return e.apply(t, arguments);
16
16
  };
17
17
  }
18
- const { toString: Td } = Object.prototype, { getPrototypeOf: Bo } = Object, { iterator: dr, toStringTag: ka } = Symbol, fr = /* @__PURE__ */ ((e) => (t) => {
18
+ const { toString: Td } = Object.prototype, { getPrototypeOf: Bo } = Object, { iterator: dr, toStringTag: Ma } = Symbol, fr = /* @__PURE__ */ ((e) => (t) => {
19
19
  const n = Td.call(t);
20
20
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
21
21
  })(/* @__PURE__ */ Object.create(null)), Ve = (e) => (e = e.toLowerCase(), (t) => fr(t) === e), pr = (e) => (t) => typeof t === e, { isArray: Wt } = Array, $t = pr("undefined");
@@ -31,7 +31,7 @@ const Pd = pr("string"), Pe = pr("function"), La = pr("number"), hn = (e) => e !
31
31
  if (fr(e) !== "object")
32
32
  return !1;
33
33
  const t = Bo(e);
34
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(ka in e) && !(dr in e);
34
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Ma in e) && !(dr in e);
35
35
  }, _d = (e) => {
36
36
  if (!hn(e) || pn(e))
37
37
  return !1;
@@ -40,7 +40,7 @@ const Pd = pr("string"), Pe = pr("function"), La = pr("number"), hn = (e) => e !
40
40
  } catch {
41
41
  return !1;
42
42
  }
43
- }, Od = Ve("Date"), Md = Ve("File"), kd = Ve("Blob"), Dd = Ve("FileList"), Ld = (e) => hn(e) && Pe(e.pipe), Fd = (e) => {
43
+ }, Od = Ve("Date"), kd = Ve("File"), Md = Ve("Blob"), Dd = Ve("FileList"), Ld = (e) => hn(e) && Pe(e.pipe), Fd = (e) => {
44
44
  let t;
45
45
  return e && (typeof FormData == "function" && e instanceof FormData || Pe(e.append) && ((t = fr(e)) === "formdata" || // detect form-data instance
46
46
  t === "object" && Pe(e.toString) && e.toString() === "[object FormData]"));
@@ -83,7 +83,7 @@ function po() {
83
83
  return n;
84
84
  }
85
85
  const Vd = (e, t, n, { allOwnKeys: r } = {}) => (mn(t, (o, s) => {
86
- n && Pe(o) ? e[s] = Ma(o, n) : e[s] = o;
86
+ n && Pe(o) ? e[s] = ka(o, n) : e[s] = o;
87
87
  }, { allOwnKeys: r }), e), jd = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Kd = (e, t, n, r) => {
88
88
  e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
89
89
  value: t.prototype
@@ -160,7 +160,7 @@ const Vd = (e, t, n, { allOwnKeys: r } = {}) => (mn(t, (o, s) => {
160
160
  }, of = () => {
161
161
  }, sf = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
162
162
  function af(e) {
163
- return !!(e && Pe(e.append) && e[ka] === "FormData" && e[dr]);
163
+ return !!(e && Pe(e.append) && e[Ma] === "FormData" && e[dr]);
164
164
  }
165
165
  const cf = (e) => {
166
166
  const t = new Array(10), n = (r, o) => {
@@ -206,8 +206,8 @@ const cf = (e) => {
206
206
  isHeaders: zd,
207
207
  isUndefined: $t,
208
208
  isDate: Od,
209
- isFile: Md,
210
- isBlob: kd,
209
+ isFile: kd,
210
+ isBlob: Md,
211
211
  isRegExp: tf,
212
212
  isFunction: Pe,
213
213
  isStream: Ld,
@@ -428,7 +428,7 @@ function ja(e, t, n) {
428
428
  }
429
429
  return e;
430
430
  }
431
- class Ms {
431
+ class ks {
432
432
  constructor() {
433
433
  this.handlers = [];
434
434
  }
@@ -645,7 +645,7 @@ const Pf = S.toObjectSet([
645
645
  `).forEach(function(a) {
646
646
  o = a.indexOf(":"), n = a.substring(0, o).trim().toLowerCase(), r = a.substring(o + 1).trim(), !(!n || t[n] && Pf[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
647
647
  }), t;
648
- }, ks = Symbol("internals");
648
+ }, Ms = Symbol("internals");
649
649
  function Jt(e) {
650
650
  return e && String(e).trim().toLowerCase();
651
651
  }
@@ -670,10 +670,10 @@ function Vr(e, t, n, r, o) {
670
670
  return r.test(t);
671
671
  }
672
672
  }
673
- function Mf(e) {
673
+ function kf(e) {
674
674
  return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
675
675
  }
676
- function kf(e, t) {
676
+ function Mf(e, t) {
677
677
  const n = S.toCamelCase(" " + t);
678
678
  ["get", "set", "has"].forEach((r) => {
679
679
  Object.defineProperty(e, r + n, {
@@ -766,7 +766,7 @@ let Ie = class {
766
766
  n[a] = $n(o), delete n[s];
767
767
  return;
768
768
  }
769
- const i = t ? Mf(s) : String(s).trim();
769
+ const i = t ? kf(s) : String(s).trim();
770
770
  i !== s && delete n[s], n[i] = $n(o), r[i] = !0;
771
771
  }), this;
772
772
  }
@@ -800,12 +800,12 @@ let Ie = class {
800
800
  return n.forEach((o) => r.set(o)), r;
801
801
  }
802
802
  static accessor(t) {
803
- const r = (this[ks] = this[ks] = {
803
+ const r = (this[Ms] = this[Ms] = {
804
804
  accessors: {}
805
805
  }).accessors, o = this.prototype;
806
806
  function s(a) {
807
807
  const i = Jt(a);
808
- r[i] || (kf(o, a), r[i] = !0);
808
+ r[i] || (Mf(o, a), r[i] = !0);
809
809
  }
810
810
  return S.isArray(t) ? t.forEach(s) : s(t), this;
811
811
  }
@@ -1238,24 +1238,24 @@ const Ja = (e) => {
1238
1238
  onDownloadProgress: R,
1239
1239
  onUploadProgress: _,
1240
1240
  responseType: N,
1241
- headers: M,
1241
+ headers: k,
1242
1242
  withCredentials: L = "same-origin",
1243
1243
  fetchOptions: P
1244
1244
  } = Ja(g), $ = t || fetch;
1245
1245
  N = N ? (N + "").toLowerCase() : "text";
1246
1246
  let K = Vf([x, y && y.toAbortSignal()], C), B = null;
1247
- const k = K && K.unsubscribe && (() => {
1247
+ const M = K && K.unsubscribe && (() => {
1248
1248
  K.unsubscribe();
1249
1249
  });
1250
1250
  let H;
1251
1251
  try {
1252
- if (_ && f && b !== "get" && b !== "head" && (H = await v(M, w)) !== 0) {
1252
+ if (_ && f && b !== "get" && b !== "head" && (H = await v(k, w)) !== 0) {
1253
1253
  let q = new n(h, {
1254
1254
  method: "POST",
1255
1255
  body: w,
1256
1256
  duplex: "half"
1257
1257
  }), se;
1258
- if (S.isFormData(w) && (se = q.headers.get("content-type")) && M.setContentType(se), q.body) {
1258
+ if (S.isFormData(w) && (se = q.headers.get("content-type")) && k.setContentType(se), q.body) {
1259
1259
  const [F, V] = Ds(
1260
1260
  H,
1261
1261
  Zn(Ls(_))
@@ -1268,7 +1268,7 @@ const Ja = (e) => {
1268
1268
  ...P,
1269
1269
  signal: K,
1270
1270
  method: b.toUpperCase(),
1271
- headers: M.normalize().toJSON(),
1271
+ headers: k.normalize().toJSON(),
1272
1272
  body: w,
1273
1273
  duplex: "half",
1274
1274
  credentials: O ? L : void 0
@@ -1276,7 +1276,7 @@ const Ja = (e) => {
1276
1276
  B = s && new n(h, G);
1277
1277
  let D = await (s ? $(B, P) : $(h, G));
1278
1278
  const T = d && (N === "stream" || N === "response");
1279
- if (d && (R || T && k)) {
1279
+ if (d && (R || T && M)) {
1280
1280
  const q = {};
1281
1281
  ["status", "statusText", "headers"].forEach((ce) => {
1282
1282
  q[ce] = D[ce];
@@ -1287,14 +1287,14 @@ const Ja = (e) => {
1287
1287
  ) || [];
1288
1288
  D = new r(
1289
1289
  $s(D.body, Bs, F, () => {
1290
- V && V(), k && k();
1290
+ V && V(), M && M();
1291
1291
  }),
1292
1292
  q
1293
1293
  );
1294
1294
  }
1295
1295
  N = N || "text";
1296
1296
  let Q = await p[S.findKey(p, N) || "text"](D, g);
1297
- return !T && k && k(), await new Promise((q, se) => {
1297
+ return !T && M && M(), await new Promise((q, se) => {
1298
1298
  Xa(q, se, {
1299
1299
  data: Q,
1300
1300
  headers: Ie.from(D.headers),
@@ -1305,7 +1305,7 @@ const Ja = (e) => {
1305
1305
  });
1306
1306
  });
1307
1307
  } catch (O) {
1308
- throw k && k(), O && O.name === "TypeError" && /Load failed|fetch/i.test(O.message) ? Object.assign(
1308
+ throw M && M(), O && O.name === "TypeError" && /Load failed|fetch/i.test(O.message) ? Object.assign(
1309
1309
  new ne("Network Error", ne.ERR_NETWORK, g, B),
1310
1310
  {
1311
1311
  cause: O.cause || O
@@ -1447,8 +1447,8 @@ const Bn = {
1447
1447
  let vt = class {
1448
1448
  constructor(t) {
1449
1449
  this.defaults = t || {}, this.interceptors = {
1450
- request: new Ms(),
1451
- response: new Ms()
1450
+ request: new ks(),
1451
+ response: new ks()
1452
1452
  };
1453
1453
  }
1454
1454
  /**
@@ -1718,7 +1718,7 @@ Object.entries(bo).forEach(([e, t]) => {
1718
1718
  bo[t] = e;
1719
1719
  });
1720
1720
  function ni(e) {
1721
- const t = new vt(e), n = Ma(vt.prototype.request, t);
1721
+ const t = new vt(e), n = ka(vt.prototype.request, t);
1722
1722
  return S.extend(n, vt.prototype, t, { allOwnKeys: !0 }), S.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
1723
1723
  return ni(wt(e, o));
1724
1724
  }, n;
@@ -1754,8 +1754,8 @@ const {
1754
1754
  Cancel: Iy,
1755
1755
  isAxiosError: _y,
1756
1756
  spread: Oy,
1757
- toFormData: My,
1758
- AxiosHeaders: ky,
1757
+ toFormData: ky,
1758
+ AxiosHeaders: My,
1759
1759
  HttpStatusCode: Dy,
1760
1760
  formToJSON: Ly,
1761
1761
  getAdapter: Fy,
@@ -1945,29 +1945,29 @@ function ip(e = {}) {
1945
1945
  return g.current = _, (async () => {
1946
1946
  var L, P, $, K, B;
1947
1947
  const N = (() => {
1948
- var k;
1948
+ var M;
1949
1949
  try {
1950
- return typeof window < "u" && ((k = window.localStorage) == null ? void 0 : k.getItem("chat-debug")) === "1";
1950
+ return typeof window < "u" && ((M = window.localStorage) == null ? void 0 : M.getItem("chat-debug")) === "1";
1951
1951
  } catch {
1952
1952
  return !1;
1953
1953
  }
1954
- })(), M = (k) => {
1954
+ })(), k = (M) => {
1955
1955
  var H;
1956
1956
  try {
1957
- const O = JSON.parse(JSON.stringify(k));
1957
+ const O = JSON.parse(JSON.stringify(M));
1958
1958
  return (H = O == null ? void 0 : O.payload) != null && H.files_info && Array.isArray(O.payload.files_info) && (O.payload.files_info = O.payload.files_info.map((G) => ({
1959
1959
  ...G,
1960
1960
  data: G != null && G.data ? `<base64 ${String(G.data).length} chars>` : G == null ? void 0 : G.data
1961
1961
  }))), O;
1962
1962
  } catch {
1963
- return k;
1963
+ return M;
1964
1964
  }
1965
1965
  };
1966
1966
  try {
1967
- let k = {};
1967
+ let M = {};
1968
1968
  try {
1969
1969
  if (r)
1970
- k = { Authorization: `Bearer ${r}` };
1970
+ M = { Authorization: `Bearer ${r}` };
1971
1971
  else if (typeof window < "u") {
1972
1972
  const Q = window.__AUTH_TOKEN__, q = ((L = window.localStorage) == null ? void 0 : L.getItem("authToken")) || null;
1973
1973
  let se = null;
@@ -1977,17 +1977,17 @@ function ip(e = {}) {
1977
1977
  } catch {
1978
1978
  }
1979
1979
  const F = Q || q || se || null;
1980
- F && (k = { Authorization: `Bearer ${F}` });
1980
+ F && (M = { Authorization: `Bearer ${F}` });
1981
1981
  }
1982
1982
  } catch {
1983
1983
  }
1984
- N && console.debug("[use-chat] POST", t + n, M(y));
1984
+ N && console.debug("[use-chat] POST", t + n, k(y));
1985
1985
  const H = await fetch(t + n, {
1986
1986
  method: "POST",
1987
1987
  headers: {
1988
1988
  "Content-Type": "application/json",
1989
1989
  Accept: "text/event-stream",
1990
- ...k,
1990
+ ...M,
1991
1991
  ...s.current
1992
1992
  },
1993
1993
  body: JSON.stringify(y),
@@ -2037,9 +2037,9 @@ function ip(e = {}) {
2037
2037
  } else ce.type === "checkpoint" ? v(ce.checkpointId) : ce.type === "error" && f(ce.message);
2038
2038
  }
2039
2039
  }
2040
- } catch (k) {
2041
- if ((k == null ? void 0 : k.name) === "AbortError") return;
2042
- const H = (k == null ? void 0 : k.message) || String(k);
2040
+ } catch (M) {
2041
+ if ((M == null ? void 0 : M.name) === "AbortError") return;
2042
+ const H = (M == null ? void 0 : M.message) || String(M);
2043
2043
  N && console.debug("[use-chat] error:", H), f(H), (B = R == null ? void 0 : R.onError) == null || B.call(R, H);
2044
2044
  } finally {
2045
2045
  i(!1), g.current = null;
@@ -2278,7 +2278,7 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2278
2278
  }, [l, v]);
2279
2279
  const b = ve((Z) => {
2280
2280
  l.setAuthToken(Z);
2281
- }, [l]), { state: w, seed: x, prepend: y, pushUser: C, onEvent: R, reset: _ } = fp(), N = s && s > 0 ? s : 6, [M, L] = re(!1), [P, $] = re(!1), [K, B] = re(null), [k, H] = re(void 0), O = ve(
2281
+ }, [l]), { state: w, seed: x, prepend: y, pushUser: C, onEvent: R, reset: _ } = fp(), N = s && s > 0 ? s : 6, [k, L] = re(!1), [P, $] = re(!1), [K, B] = re(null), [M, H] = re(void 0), O = ve(
2282
2282
  (Z, Y) => {
2283
2283
  const he = Array.isArray(Z == null ? void 0 : Z.messages) ? Z.messages : [];
2284
2284
  Y === "replace" ? x(he) : Y === "prepend" && he.length && y(he), B((Z == null ? void 0 : Z.nextCursor) ?? null), L(!!(Z != null && Z.hasMore)), H((Oe) => (Z == null ? void 0 : Z.checkpointId) ?? Oe ?? void 0);
@@ -2459,14 +2459,14 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2459
2459
  }, [T, C, p, R, w.lastCheckpointId, l, t == null ? void 0 : t.uploadPath, q, Q]), me = ve(
2460
2460
  async (Z) => {
2461
2461
  if (!T) throw new Error("No active thread");
2462
- if (P || !M) return;
2462
+ if (P || !k) return;
2463
2463
  const Y = K;
2464
2464
  if (Y) {
2465
2465
  $(!0);
2466
2466
  try {
2467
2467
  const he = await l.getMessages({
2468
2468
  threadId: T,
2469
- checkpointId: k,
2469
+ checkpointId: M,
2470
2470
  limit: (Z == null ? void 0 : Z.limit) ?? N,
2471
2471
  beforeId: Y
2472
2472
  });
@@ -2476,7 +2476,7 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2476
2476
  }
2477
2477
  }
2478
2478
  },
2479
- [l, T, k, K, M, P, O]
2479
+ [l, T, M, K, k, P, O]
2480
2480
  ), de = {
2481
2481
  baseUrl: l.baseUrl,
2482
2482
  token: g,
@@ -2490,7 +2490,7 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2490
2490
  error: d,
2491
2491
  lastCheckpointId: w.lastCheckpointId,
2492
2492
  streamingAssistantId: w.assemblingId,
2493
- hasMoreHistory: M,
2493
+ hasMoreHistory: k,
2494
2494
  isLoadingHistory: P,
2495
2495
  loadOlderMessages: me,
2496
2496
  historyPageSize: N,
@@ -2888,11 +2888,11 @@ di.displayName = ui;
2888
2888
  var Vo = "CollapsibleContent", Op = u.forwardRef(
2889
2889
  (e, t) => {
2890
2890
  const { forceMount: n, ...r } = e, o = Wo(Vo, e.__scopeCollapsible);
2891
- return /* @__PURE__ */ c(_e, { present: n || o.open, children: ({ present: s }) => /* @__PURE__ */ c(Mp, { ...r, ref: t, present: s }) });
2891
+ return /* @__PURE__ */ c(_e, { present: n || o.open, children: ({ present: s }) => /* @__PURE__ */ c(kp, { ...r, ref: t, present: s }) });
2892
2892
  }
2893
2893
  );
2894
2894
  Op.displayName = Vo;
2895
- var Mp = u.forwardRef((e, t) => {
2895
+ var kp = u.forwardRef((e, t) => {
2896
2896
  const { __scopeCollapsible: n, present: r, children: o, ...s } = e, a = Wo(Vo, n), [i, l] = u.useState(r), f = u.useRef(null), d = ie(t, f), p = u.useRef(0), m = p.current, v = u.useRef(0), g = v.current, h = a.open || i, b = u.useRef(h), w = u.useRef(void 0);
2897
2897
  return u.useEffect(() => {
2898
2898
  const x = requestAnimationFrame(() => b.current = !1);
@@ -2928,8 +2928,8 @@ var Mp = u.forwardRef((e, t) => {
2928
2928
  function jo(e) {
2929
2929
  return e ? "open" : "closed";
2930
2930
  }
2931
- var kp = li;
2932
- const Ys = kp, Js = di;
2931
+ var Mp = li;
2932
+ const Ys = Mp, Js = di;
2933
2933
  function _n({ content: e, className: t = "" }) {
2934
2934
  const n = qe.useMemo(() => ({ table: ({ node: f, className: d, ...p }) => /* @__PURE__ */ c("div", { className: "max-w-full", children: /* @__PURE__ */ c(
2935
2935
  "table",
@@ -3031,7 +3031,7 @@ function Lp({
3031
3031
  onCancelEdit: b,
3032
3032
  onCopy: w
3033
3033
  }) {
3034
- const [x, y] = re(!1), [C, R] = re(!1), [_, N] = re(!1), [M, L] = re(!1), P = l === "phone" || l === "half-screen", $ = e.role, K = $ === "tool", B = qe.useMemo(() => {
3034
+ const [x, y] = re(!1), [C, R] = re(!1), [_, N] = re(!1), [k, L] = re(!1), P = l === "phone" || l === "half-screen", $ = e.role, K = $ === "tool", B = qe.useMemo(() => {
3035
3035
  switch ($) {
3036
3036
  case "user":
3037
3037
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -3044,16 +3044,16 @@ function Lp({
3044
3044
  default:
3045
3045
  return "text-foreground";
3046
3046
  }
3047
- }, [$]), k = gt(() => Fp(e.content), [e.content]), H = gt(() => Wp(e.content), [e.content]), O = gt(() => e.content.filter((W) => W.type === "image_url"), [e.content]), G = gt(() => e.content.filter((W) => W.type === "file"), [e.content]), D = jp(k, n ? r : 0), T = async () => {
3047
+ }, [$]), M = gt(() => Fp(e.content), [e.content]), H = gt(() => Wp(e.content), [e.content]), O = gt(() => e.content.filter((W) => W.type === "image_url"), [e.content]), G = gt(() => e.content.filter((W) => W.type === "file"), [e.content]), D = jp(M, n ? r : 0), T = async () => {
3048
3048
  try {
3049
- const W = K ? Pt(e.content) : k;
3049
+ const W = K ? Pt(e.content) : M;
3050
3050
  await navigator.clipboard.writeText(W), y(!0), setTimeout(() => y(!1), 2e3), w == null || w(W);
3051
3051
  } catch (W) {
3052
3052
  console.error("Failed to copy:", W);
3053
3053
  }
3054
3054
  }, Q = () => {
3055
3055
  if (!g) return;
3056
- const W = K ? Pt(e.content) : k;
3056
+ const W = K ? Pt(e.content) : M;
3057
3057
  g(e.id, W);
3058
3058
  }, q = () => h == null ? void 0 : h(t), se = () => {
3059
3059
  const ae = A(P ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", B);
@@ -3115,7 +3115,7 @@ function Lp({
3115
3115
  }
3116
3116
  }, pe = () => {
3117
3117
  if (e.model === "reflection") {
3118
- const j = k.trim(), X = Jr(j);
3118
+ const j = M.trim(), X = Jr(j);
3119
3119
  if (X && typeof X == "object")
3120
3120
  return /* @__PURE__ */ c(Kp, { data: X });
3121
3121
  }
@@ -3138,7 +3138,7 @@ function Lp({
3138
3138
  /* @__PURE__ */ c(Zt, { className: "h-3 w-3 mr-1" }),
3139
3139
  "Show less"
3140
3140
  ] }) : /* @__PURE__ */ E(Ae, { children: [
3141
- /* @__PURE__ */ c(kt, { className: "h-3 w-3 mr-1" }),
3141
+ /* @__PURE__ */ c(Mt, { className: "h-3 w-3 mr-1" }),
3142
3142
  "Show more (",
3143
3143
  j.length - d,
3144
3144
  " chars)"
@@ -3161,13 +3161,13 @@ function Lp({
3161
3161
  })(),
3162
3162
  /* @__PURE__ */ c(Dp, { className: A(B, P ? "text-xs" : "text-sm") })
3163
3163
  ] }) : (() => {
3164
- const j = Jr(k.trim());
3164
+ const j = Jr(M.trim());
3165
3165
  if (j !== null) return /* @__PURE__ */ c(Zs, { data: j });
3166
3166
  if ($ === "user" && p) {
3167
- const X = k.trim();
3167
+ const X = M.trim();
3168
3168
  if (X.length > m)
3169
- return /* @__PURE__ */ E(Ys, { open: M, onOpenChange: L, children: [
3170
- /* @__PURE__ */ c("div", { className: A("text-sm text-[hsl(var(--chat-bubble-user-text))]", P && "text-xs"), children: M ? /* @__PURE__ */ c(_n, { content: X }) : /* @__PURE__ */ E("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", P && "text-xs"), children: [
3169
+ return /* @__PURE__ */ E(Ys, { open: k, onOpenChange: L, children: [
3170
+ /* @__PURE__ */ c("div", { className: A("text-sm text-[hsl(var(--chat-bubble-user-text))]", P && "text-xs"), children: k ? /* @__PURE__ */ c(_n, { content: X }) : /* @__PURE__ */ E("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", P && "text-xs"), children: [
3171
3171
  X.substring(0, m),
3172
3172
  "..."
3173
3173
  ] }) }),
@@ -3177,11 +3177,11 @@ function Lp({
3177
3177
  variant: "ghost",
3178
3178
  size: "sm",
3179
3179
  className: "h-6 text-xs !text-[hsl(var(--chat-bubble-user-text))]",
3180
- children: M ? /* @__PURE__ */ E(Ae, { children: [
3180
+ children: k ? /* @__PURE__ */ E(Ae, { children: [
3181
3181
  /* @__PURE__ */ c(Zt, { className: "h-3 w-3 mr-1" }),
3182
3182
  " Show less"
3183
3183
  ] }) : /* @__PURE__ */ E(Ae, { children: [
3184
- /* @__PURE__ */ c(kt, { className: "h-3 w-3 mr-1" }),
3184
+ /* @__PURE__ */ c(Mt, { className: "h-3 w-3 mr-1" }),
3185
3185
  " Show more (",
3186
3186
  X.length - m,
3187
3187
  " chars)"
@@ -3190,7 +3190,7 @@ function Lp({
3190
3190
  ) })
3191
3191
  ] });
3192
3192
  }
3193
- return /* @__PURE__ */ c(_n, { content: k.trim() });
3193
+ return /* @__PURE__ */ c(_n, { content: M.trim() });
3194
3194
  })(),
3195
3195
  W && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-2 gap-2", children: O.map((j, X) => /* @__PURE__ */ E("div", { className: "relative border rounded overflow-hidden", children: [
3196
3196
  /* @__PURE__ */ c("img", { src: j.url, alt: j.alt ?? "image", className: "w-full h-auto" }),
@@ -3208,10 +3208,15 @@ function Lp({
3208
3208
  download: me,
3209
3209
  target: "_blank",
3210
3210
  rel: "noreferrer",
3211
- className: "inline-flex items-center gap-2 bg-gray-100 border border-gray-200 rounded px-2 py-1 text-xs hover:bg-gray-200",
3211
+ className: A(
3212
+ "inline-flex items-center gap-2 rounded px-2 py-1 text-xs",
3213
+ "bg-gray-100 border border-gray-200 hover:bg-gray-200",
3214
+ "dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20",
3215
+ "text-current"
3216
+ ),
3212
3217
  title: me,
3213
3218
  children: [
3214
- /* @__PURE__ */ c("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-gray-400" }),
3219
+ /* @__PURE__ */ c("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-gray-400 dark:bg-gray-500" }),
3215
3220
  /* @__PURE__ */ c("span", { className: "truncate max-w-[180px]", children: me })
3216
3221
  ]
3217
3222
  },
@@ -3247,7 +3252,7 @@ function Lp({
3247
3252
  onClick: () => N((W) => !W),
3248
3253
  children: [
3249
3254
  /* @__PURE__ */ c("span", { children: H.name }),
3250
- /* @__PURE__ */ c("span", { className: "inline-flex items-center", children: _ ? /* @__PURE__ */ c(Zt, { className: "h-3 w-3" }) : /* @__PURE__ */ c(kt, { className: "h-3 w-3" }) })
3255
+ /* @__PURE__ */ c("span", { className: "inline-flex items-center", children: _ ? /* @__PURE__ */ c(Zt, { className: "h-3 w-3" }) : /* @__PURE__ */ c(Mt, { className: "h-3 w-3" }) })
3251
3256
  ]
3252
3257
  }
3253
3258
  ),
@@ -3260,7 +3265,7 @@ function Lp({
3260
3265
  onClick: () => N((W) => !W),
3261
3266
  children: /* @__PURE__ */ E("span", { className: "text-xs flex items-center gap-1", children: [
3262
3267
  "Tool Output ",
3263
- _ ? /* @__PURE__ */ c(Zt, { className: "h-3 w-3" }) : /* @__PURE__ */ c(kt, { className: "h-3 w-3" })
3268
+ _ ? /* @__PURE__ */ c(Zt, { className: "h-3 w-3" }) : /* @__PURE__ */ c(Mt, { className: "h-3 w-3" })
3264
3269
  ] })
3265
3270
  }
3266
3271
  )
@@ -3377,10 +3382,8 @@ function Lp({
3377
3382
  ] }) });
3378
3383
  }
3379
3384
  function Fp(e) {
3380
- const t = e.filter((r) => r.type === "text").map((r) => r.text).join("");
3381
- if (t) return t;
3382
- const n = e.filter((r) => r.type !== "file");
3383
- return JSON.stringify(n);
3385
+ const t = e.filter((n) => n.type === "text").map((n) => n.text).join("");
3386
+ return t || JSON.stringify(e);
3384
3387
  }
3385
3388
  function $p(e) {
3386
3389
  return e.includes(`
@@ -3576,7 +3579,7 @@ function Gp({ issues: e }) {
3576
3579
  ] }, n.key);
3577
3580
  }) });
3578
3581
  }
3579
- const Mt = 1e4;
3582
+ const kt = 1e4;
3580
3583
  function qp(e) {
3581
3584
  if (typeof e != "string")
3582
3585
  return String(e);
@@ -3604,7 +3607,7 @@ function qp(e) {
3604
3607
  `).replace(/<li>(.*?)<\/li>/gi, `- $1
3605
3608
  `).trim() : n.replace(/</g, "&lt;").replace(/>/g, "&gt;").trim();
3606
3609
  }
3607
- function Xp(e, t = Mt) {
3610
+ function Xp(e, t = kt) {
3608
3611
  if (!e || typeof e != "string")
3609
3612
  throw new Error("Invalid content: must be a non-empty string");
3610
3613
  if (e.length > t)
@@ -3693,11 +3696,11 @@ var Qp = "DismissableLayer", wo = "dismissableLayer.update", eh = "dismissableLa
3693
3696
  onDismiss: i,
3694
3697
  ...l
3695
3698
  } = e, f = u.useContext(pi), [d, p] = u.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = u.useState({}), g = ie(t, (N) => p(N)), h = Array.from(f.layers), [b] = [...f.layersWithOutsidePointerEventsDisabled].slice(-1), w = h.indexOf(b), x = d ? h.indexOf(d) : -1, y = f.layersWithOutsidePointerEventsDisabled.size > 0, C = x >= w, R = oh((N) => {
3696
- const M = N.target, L = [...f.branches].some((P) => P.contains(M));
3699
+ const k = N.target, L = [...f.branches].some((P) => P.contains(k));
3697
3700
  !C || L || (o == null || o(N), a == null || a(N), N.defaultPrevented || i == null || i());
3698
3701
  }, m), _ = sh((N) => {
3699
- const M = N.target;
3700
- [...f.branches].some((P) => P.contains(M)) || (s == null || s(N), a == null || a(N), N.defaultPrevented || i == null || i());
3702
+ const k = N.target;
3703
+ [...f.branches].some((P) => P.contains(k)) || (s == null || s(N), a == null || a(N), N.defaultPrevented || i == null || i());
3701
3704
  }, m);
3702
3705
  return Zp((N) => {
3703
3706
  x === f.layers.size - 1 && (r == null || r(N), !N.defaultPrevented && i && (N.preventDefault(), i()));
@@ -3936,7 +3939,7 @@ function sa(e, t) {
3936
3939
  function fh(e) {
3937
3940
  return e.filter((t) => t.tagName !== "A");
3938
3941
  }
3939
- const ph = ["top", "right", "bottom", "left"], dt = Math.min, Me = Math.max, er = Math.round, On = Math.floor, Je = (e) => ({
3942
+ const ph = ["top", "right", "bottom", "left"], dt = Math.min, ke = Math.max, er = Math.round, On = Math.floor, Je = (e) => ({
3940
3943
  x: e,
3941
3944
  y: e
3942
3945
  }), hh = {
@@ -3949,7 +3952,7 @@ const ph = ["top", "right", "bottom", "left"], dt = Math.min, Me = Math.max, er
3949
3952
  end: "start"
3950
3953
  };
3951
3954
  function yo(e, t, n) {
3952
- return Me(e, dt(t, n));
3955
+ return ke(e, dt(t, n));
3953
3956
  }
3954
3957
  function rt(e, t) {
3955
3958
  return typeof e == "function" ? e(t) : e;
@@ -4220,12 +4223,12 @@ const Nh = (e) => ({
4220
4223
  }, v = Yo(o), g = Xo(v), h = await a.getDimensions(f), b = v === "y", w = b ? "top" : "left", x = b ? "bottom" : "right", y = b ? "clientHeight" : "clientWidth", C = s.reference[g] + s.reference[v] - m[v] - s.floating[g], R = m[v] - s.reference[v], _ = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(f));
4221
4224
  let N = _ ? _[y] : 0;
4222
4225
  (!N || !await (a.isElement == null ? void 0 : a.isElement(_))) && (N = i.floating[y] || s.floating[g]);
4223
- const M = C / 2 - R / 2, L = N / 2 - h[g] / 2 - 1, P = dt(p[w], L), $ = dt(p[x], L), K = P, B = N - h[g] - $, k = N / 2 - h[g] / 2 + M, H = yo(K, k, B), O = !l.arrow && jt(o) != null && k !== H && s.reference[g] / 2 - (k < K ? P : $) - h[g] / 2 < 0, G = O ? k < K ? k - K : k - B : 0;
4226
+ const k = C / 2 - R / 2, L = N / 2 - h[g] / 2 - 1, P = dt(p[w], L), $ = dt(p[x], L), K = P, B = N - h[g] - $, M = N / 2 - h[g] / 2 + k, H = yo(K, M, B), O = !l.arrow && jt(o) != null && M !== H && s.reference[g] / 2 - (M < K ? P : $) - h[g] / 2 < 0, G = O ? M < K ? M - K : M - B : 0;
4224
4227
  return {
4225
4228
  [v]: m[v] + G,
4226
4229
  data: {
4227
4230
  [v]: H,
4228
- centerOffset: k - H - G,
4231
+ centerOffset: M - H - G,
4229
4232
  ...O && {
4230
4233
  alignmentOffset: G
4231
4234
  }
@@ -4259,24 +4262,24 @@ const Nh = (e) => ({
4259
4262
  return {};
4260
4263
  const w = ot(o), x = Ye(i), y = ot(i) === i, C = await (l.isRTL == null ? void 0 : l.isRTL(f.floating)), R = m || (y || !h ? [tr(i)] : vh(i)), _ = g !== "none";
4261
4264
  !m && _ && R.push(...Sh(i, h, g, C));
4262
- const N = [i, ...R], M = await sn(t, b), L = [];
4265
+ const N = [i, ...R], k = await sn(t, b), L = [];
4263
4266
  let P = ((r = s.flip) == null ? void 0 : r.overflows) || [];
4264
- if (d && L.push(M[w]), p) {
4265
- const k = bh(o, a, C);
4266
- L.push(M[k[0]], M[k[1]]);
4267
+ if (d && L.push(k[w]), p) {
4268
+ const M = bh(o, a, C);
4269
+ L.push(k[M[0]], k[M[1]]);
4267
4270
  }
4268
4271
  if (P = [...P, {
4269
4272
  placement: o,
4270
4273
  overflows: L
4271
- }], !L.every((k) => k <= 0)) {
4274
+ }], !L.every((M) => M <= 0)) {
4272
4275
  var $, K;
4273
- const k = ((($ = s.flip) == null ? void 0 : $.index) || 0) + 1, H = N[k];
4276
+ const M = ((($ = s.flip) == null ? void 0 : $.index) || 0) + 1, H = N[M];
4274
4277
  if (H && (!(p === "alignment" ? x !== Ye(H) : !1) || // We leave the current main axis only if every placement on that axis
4275
4278
  // overflows the main axis.
4276
4279
  P.every((D) => Ye(D.placement) === x ? D.overflows[0] > 0 : !0)))
4277
4280
  return {
4278
4281
  data: {
4279
- index: k,
4282
+ index: M,
4280
4283
  overflows: P
4281
4284
  },
4282
4285
  reset: {
@@ -4537,14 +4540,14 @@ const Ph = function(e) {
4537
4540
  let b, w;
4538
4541
  p === "top" || p === "bottom" ? (b = p, w = m === (await (a.isRTL == null ? void 0 : a.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (w = p, b = m === "end" ? "top" : "bottom");
4539
4542
  const x = h - d.top - d.bottom, y = g - d.left - d.right, C = dt(h - d[b], x), R = dt(g - d[w], y), _ = !t.middlewareData.shift;
4540
- let N = C, M = R;
4541
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !m) {
4542
- const P = Me(d.left, 0), $ = Me(d.right, 0), K = Me(d.top, 0), B = Me(d.bottom, 0);
4543
- v ? M = g - 2 * (P !== 0 || $ !== 0 ? P + $ : Me(d.left, d.right)) : N = h - 2 * (K !== 0 || B !== 0 ? K + B : Me(d.top, d.bottom));
4543
+ let N = C, k = R;
4544
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (k = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !m) {
4545
+ const P = ke(d.left, 0), $ = ke(d.right, 0), K = ke(d.top, 0), B = ke(d.bottom, 0);
4546
+ v ? k = g - 2 * (P !== 0 || $ !== 0 ? P + $ : ke(d.left, d.right)) : N = h - 2 * (K !== 0 || B !== 0 ? K + B : ke(d.top, d.bottom));
4544
4547
  }
4545
4548
  await l({
4546
4549
  ...t,
4547
- availableWidth: M,
4550
+ availableWidth: k,
4548
4551
  availableHeight: N
4549
4552
  });
4550
4553
  const L = await a.getDimensions(i.floating);
@@ -4562,7 +4565,7 @@ function wr() {
4562
4565
  function Kt(e) {
4563
4566
  return vi(e) ? (e.nodeName || "").toLowerCase() : "#document";
4564
4567
  }
4565
- function ke(e) {
4568
+ function Me(e) {
4566
4569
  var t;
4567
4570
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
4568
4571
  }
@@ -4571,18 +4574,18 @@ function Qe(e) {
4571
4574
  return (t = (vi(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
4572
4575
  }
4573
4576
  function vi(e) {
4574
- return wr() ? e instanceof Node || e instanceof ke(e).Node : !1;
4577
+ return wr() ? e instanceof Node || e instanceof Me(e).Node : !1;
4575
4578
  }
4576
4579
  function ze(e) {
4577
- return wr() ? e instanceof Element || e instanceof ke(e).Element : !1;
4580
+ return wr() ? e instanceof Element || e instanceof Me(e).Element : !1;
4578
4581
  }
4579
4582
  function Ze(e) {
4580
- return wr() ? e instanceof HTMLElement || e instanceof ke(e).HTMLElement : !1;
4583
+ return wr() ? e instanceof HTMLElement || e instanceof Me(e).HTMLElement : !1;
4581
4584
  }
4582
4585
  function da(e) {
4583
- return !wr() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof ke(e).ShadowRoot;
4586
+ return !wr() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Me(e).ShadowRoot;
4584
4587
  }
4585
- const Mh = /* @__PURE__ */ new Set(["inline", "contents"]);
4588
+ const kh = /* @__PURE__ */ new Set(["inline", "contents"]);
4586
4589
  function vn(e) {
4587
4590
  const {
4588
4591
  overflow: t,
@@ -4590,11 +4593,11 @@ function vn(e) {
4590
4593
  overflowY: r,
4591
4594
  display: o
4592
4595
  } = We(e);
4593
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !Mh.has(o);
4596
+ return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !kh.has(o);
4594
4597
  }
4595
- const kh = /* @__PURE__ */ new Set(["table", "td", "th"]);
4598
+ const Mh = /* @__PURE__ */ new Set(["table", "td", "th"]);
4596
4599
  function Dh(e) {
4597
- return kh.has(Kt(e));
4600
+ return Mh.has(Kt(e));
4598
4601
  }
4599
4602
  const Lh = [":popover-open", ":modal"];
4600
4603
  function yr(e) {
@@ -4630,7 +4633,7 @@ function Bt(e) {
4630
4633
  return Hh.has(Kt(e));
4631
4634
  }
4632
4635
  function We(e) {
4633
- return ke(e).getComputedStyle(e);
4636
+ return Me(e).getComputedStyle(e);
4634
4637
  }
4635
4638
  function xr(e) {
4636
4639
  return ze(e) ? {
@@ -4660,7 +4663,7 @@ function wi(e) {
4660
4663
  function an(e, t, n) {
4661
4664
  var r;
4662
4665
  t === void 0 && (t = []), n === void 0 && (n = !0);
4663
- const o = wi(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), a = ke(o);
4666
+ const o = wi(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), a = Me(o);
4664
4667
  if (s) {
4665
4668
  const i = So(a);
4666
4669
  return t.concat(a, a.visualViewport || [], vn(o) ? o : [], i && n ? an(i) : []);
@@ -4700,14 +4703,14 @@ function Dt(e) {
4700
4703
  }
4701
4704
  const zh = /* @__PURE__ */ Je(0);
4702
4705
  function xi(e) {
4703
- const t = ke(e);
4706
+ const t = Me(e);
4704
4707
  return !Zo() || !t.visualViewport ? zh : {
4705
4708
  x: t.visualViewport.offsetLeft,
4706
4709
  y: t.visualViewport.offsetTop
4707
4710
  };
4708
4711
  }
4709
4712
  function Wh(e, t, n) {
4710
- return t === void 0 && (t = !1), !n || t && n !== ke(e) ? !1 : t;
4713
+ return t === void 0 && (t = !1), !n || t && n !== Me(e) ? !1 : t;
4711
4714
  }
4712
4715
  function xt(e, t, n, r) {
4713
4716
  t === void 0 && (t = !1), n === void 0 && (n = !1);
@@ -4717,11 +4720,11 @@ function xt(e, t, n, r) {
4717
4720
  const i = Wh(s, n, r) ? xi(s) : Je(0);
4718
4721
  let l = (o.left + i.x) / a.x, f = (o.top + i.y) / a.y, d = o.width / a.x, p = o.height / a.y;
4719
4722
  if (s) {
4720
- const m = ke(s), v = r && ze(r) ? ke(r) : r;
4723
+ const m = Me(s), v = r && ze(r) ? Me(r) : r;
4721
4724
  let g = m, h = So(g);
4722
4725
  for (; h && r && v !== g; ) {
4723
4726
  const b = Dt(h), w = h.getBoundingClientRect(), x = We(h), y = w.left + (h.clientLeft + parseFloat(x.paddingLeft)) * b.x, C = w.top + (h.clientTop + parseFloat(x.paddingTop)) * b.y;
4724
- l *= b.x, f *= b.y, d *= b.x, p *= b.y, l += y, f += C, g = ke(h), h = So(g);
4727
+ l *= b.x, f *= b.y, d *= b.x, p *= b.y, l += y, f += C, g = Me(h), h = So(g);
4725
4728
  }
4726
4729
  }
4727
4730
  return nr({
@@ -4773,10 +4776,10 @@ function jh(e) {
4773
4776
  return Array.from(e.getClientRects());
4774
4777
  }
4775
4778
  function Kh(e) {
4776
- const t = Qe(e), n = xr(e), r = e.ownerDocument.body, o = Me(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = Me(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
4779
+ const t = Qe(e), n = xr(e), r = e.ownerDocument.body, o = ke(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = ke(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
4777
4780
  let a = -n.scrollLeft + Sr(e);
4778
4781
  const i = -n.scrollTop;
4779
- return We(r).direction === "rtl" && (a += Me(t.clientWidth, r.clientWidth) - o), {
4782
+ return We(r).direction === "rtl" && (a += ke(t.clientWidth, r.clientWidth) - o), {
4780
4783
  width: o,
4781
4784
  height: s,
4782
4785
  x: a,
@@ -4785,7 +4788,7 @@ function Kh(e) {
4785
4788
  }
4786
4789
  const fa = 25;
4787
4790
  function Gh(e, t) {
4788
- const n = ke(e), r = Qe(e), o = n.visualViewport;
4791
+ const n = Me(e), r = Qe(e), o = n.visualViewport;
4789
4792
  let s = r.clientWidth, a = r.clientHeight, i = 0, l = 0;
4790
4793
  if (o) {
4791
4794
  s = o.width, a = o.height;
@@ -4859,7 +4862,7 @@ function Jh(e) {
4859
4862
  } = e;
4860
4863
  const a = [...n === "clippingAncestors" ? yr(t) ? [] : Yh(t, this._c) : [].concat(n), r], i = a[0], l = a.reduce((f, d) => {
4861
4864
  const p = pa(t, d, o);
4862
- return f.top = Me(p.top, f.top), f.right = dt(p.right, f.right), f.bottom = dt(p.bottom, f.bottom), f.left = Me(p.left, f.left), f;
4865
+ return f.top = ke(p.top, f.top), f.right = dt(p.right, f.right), f.bottom = dt(p.bottom, f.bottom), f.left = ke(p.left, f.left), f;
4863
4866
  }, pa(t, i, o));
4864
4867
  return {
4865
4868
  width: l.right - l.left,
@@ -4914,7 +4917,7 @@ function ha(e, t) {
4914
4917
  return Qe(e) === n && (n = n.ownerDocument.body), n;
4915
4918
  }
4916
4919
  function Ei(e, t) {
4917
- const n = ke(e);
4920
+ const n = Me(e);
4918
4921
  if (yr(e))
4919
4922
  return n;
4920
4923
  if (!Ze(e)) {
@@ -4980,7 +4983,7 @@ function rm(e, t) {
4980
4983
  return;
4981
4984
  const g = On(p), h = On(o.clientWidth - (d + m)), b = On(o.clientHeight - (p + v)), w = On(d), y = {
4982
4985
  rootMargin: -g + "px " + -h + "px " + -b + "px " + -w + "px",
4983
- threshold: Me(0, dt(1, l)) || 1
4986
+ threshold: ke(0, dt(1, l)) || 1
4984
4987
  };
4985
4988
  let C = !0;
4986
4989
  function R(_) {
@@ -5128,7 +5131,7 @@ function hm(e) {
5128
5131
  D !== _.current && (_.current = D, h(D));
5129
5132
  }, []), y = u.useCallback((D) => {
5130
5133
  D !== N.current && (N.current = D, w(D));
5131
- }, []), C = s || g, R = a || b, _ = u.useRef(null), N = u.useRef(null), M = u.useRef(d), L = l != null, P = no(l), $ = no(o), K = no(f), B = u.useCallback(() => {
5134
+ }, []), C = s || g, R = a || b, _ = u.useRef(null), N = u.useRef(null), k = u.useRef(d), L = l != null, P = no(l), $ = no(o), K = no(f), B = u.useCallback(() => {
5132
5135
  if (!_.current || !N.current)
5133
5136
  return;
5134
5137
  const D = {
@@ -5145,20 +5148,20 @@ function hm(e) {
5145
5148
  // setting it to `true` when `open === false` (must be specified).
5146
5149
  isPositioned: K.current !== !1
5147
5150
  };
5148
- k.current && !rr(M.current, Q) && (M.current = Q, ur.flushSync(() => {
5151
+ M.current && !rr(k.current, Q) && (k.current = Q, ur.flushSync(() => {
5149
5152
  p(Q);
5150
5153
  }));
5151
5154
  });
5152
5155
  }, [m, t, n, $, K]);
5153
5156
  zn(() => {
5154
- f === !1 && M.current.isPositioned && (M.current.isPositioned = !1, p((D) => ({
5157
+ f === !1 && k.current.isPositioned && (k.current.isPositioned = !1, p((D) => ({
5155
5158
  ...D,
5156
5159
  isPositioned: !1
5157
5160
  })));
5158
5161
  }, [f]);
5159
- const k = u.useRef(!1);
5160
- zn(() => (k.current = !0, () => {
5161
- k.current = !1;
5162
+ const M = u.useRef(!1);
5163
+ zn(() => (M.current = !0, () => {
5164
+ M.current = !1;
5162
5165
  }), []), zn(() => {
5163
5166
  if (C && (_.current = C), R && (N.current = R), C && R) {
5164
5167
  if (P.current)
@@ -5290,7 +5293,7 @@ var es = "Popper", [Pi, Gt] = je(es), [Nm, Ii] = Pi(es), _i = (e) => {
5290
5293
  return /* @__PURE__ */ c(Nm, { scope: t, anchor: r, onAnchorChange: o, children: n });
5291
5294
  };
5292
5295
  _i.displayName = es;
5293
- var Oi = "PopperAnchor", Mi = u.forwardRef(
5296
+ var Oi = "PopperAnchor", ki = u.forwardRef(
5294
5297
  (e, t) => {
5295
5298
  const { __scopePopper: n, virtualRef: r, ...o } = e, s = Ii(Oi, n), a = u.useRef(null), i = ie(t, a), l = u.useRef(null);
5296
5299
  return u.useEffect(() => {
@@ -5299,8 +5302,8 @@ var Oi = "PopperAnchor", Mi = u.forwardRef(
5299
5302
  }), r ? null : /* @__PURE__ */ c(ee.div, { ...o, ref: i });
5300
5303
  }
5301
5304
  );
5302
- Mi.displayName = Oi;
5303
- var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5305
+ ki.displayName = Oi;
5306
+ var ts = "PopperContent", [Rm, Tm] = Pi(ts), Mi = u.forwardRef(
5304
5307
  (e, t) => {
5305
5308
  var z, W, ae, j, X, te;
5306
5309
  const {
@@ -5318,12 +5321,12 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5318
5321
  updatePositionStrategy: v = "optimized",
5319
5322
  onPlaced: g,
5320
5323
  ...h
5321
- } = e, b = Ii(ts, n), [w, x] = u.useState(null), y = ie(t, (me) => x(me)), [C, R] = u.useState(null), _ = Ai(C), N = (_ == null ? void 0 : _.width) ?? 0, M = (_ == null ? void 0 : _.height) ?? 0, L = r + (s !== "center" ? "-" + s : ""), P = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, $ = Array.isArray(f) ? f : [f], K = $.length > 0, B = {
5324
+ } = e, b = Ii(ts, n), [w, x] = u.useState(null), y = ie(t, (me) => x(me)), [C, R] = u.useState(null), _ = Ai(C), N = (_ == null ? void 0 : _.width) ?? 0, k = (_ == null ? void 0 : _.height) ?? 0, L = r + (s !== "center" ? "-" + s : ""), P = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, $ = Array.isArray(f) ? f : [f], K = $.length > 0, B = {
5322
5325
  padding: P,
5323
5326
  boundary: $.filter(Pm),
5324
5327
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
5325
5328
  altBoundary: K
5326
- }, { refs: k, floatingStyles: H, placement: O, isPositioned: G, middlewareData: D } = hm({
5329
+ }, { refs: M, floatingStyles: H, placement: O, isPositioned: G, middlewareData: D } = hm({
5327
5330
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
5328
5331
  strategy: "fixed",
5329
5332
  placement: L,
@@ -5334,7 +5337,7 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5334
5337
  reference: b.anchor
5335
5338
  },
5336
5339
  middleware: [
5337
- gm({ mainAxis: o + M, alignmentAxis: a }),
5340
+ gm({ mainAxis: o + k, alignmentAxis: a }),
5338
5341
  l && bm({
5339
5342
  mainAxis: !0,
5340
5343
  crossAxis: !1,
@@ -5350,7 +5353,7 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5350
5353
  }
5351
5354
  }),
5352
5355
  C && Sm({ element: C, padding: i }),
5353
- Im({ arrowWidth: N, arrowHeight: M }),
5356
+ Im({ arrowWidth: N, arrowHeight: k }),
5354
5357
  m && xm({ strategy: "referenceHidden", ...B })
5355
5358
  ]
5356
5359
  }), [T, Q] = Fi(O), q = ye(g);
@@ -5363,7 +5366,7 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5363
5366
  }, [w]), /* @__PURE__ */ c(
5364
5367
  "div",
5365
5368
  {
5366
- ref: k.setFloating,
5369
+ ref: M.setFloating,
5367
5370
  "data-radix-popper-content-wrapper": "",
5368
5371
  style: {
5369
5372
  ...H,
@@ -5414,7 +5417,7 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5414
5417
  );
5415
5418
  }
5416
5419
  );
5417
- ki.displayName = ts;
5420
+ Mi.displayName = ts;
5418
5421
  var Di = "PopperArrow", Am = {
5419
5422
  top: "bottom",
5420
5423
  right: "left",
@@ -5483,7 +5486,7 @@ function Fi(e) {
5483
5486
  const [t, n = "center"] = e.split("-");
5484
5487
  return [t, n];
5485
5488
  }
5486
- var ns = _i, rs = Mi, os = ki, ss = Li, _m = "Portal", Cr = u.forwardRef((e, t) => {
5489
+ var ns = _i, rs = ki, os = Mi, ss = Li, _m = "Portal", Cr = u.forwardRef((e, t) => {
5487
5490
  var i;
5488
5491
  const { container: n, ...r } = e, [o, s] = u.useState(!1);
5489
5492
  we(() => s(!0), []);
@@ -5491,10 +5494,10 @@ var ns = _i, rs = Mi, os = ki, ss = Li, _m = "Portal", Cr = u.forwardRef((e, t)
5491
5494
  return a ? Ed.createPortal(/* @__PURE__ */ c(ee.div, { ...r, ref: t }), a) : null;
5492
5495
  });
5493
5496
  Cr.displayName = _m;
5494
- var ro = "rovingFocusGroup.onEntryFocus", Om = { bubbles: !1, cancelable: !0 }, wn = "RovingFocusGroup", [Co, $i, Mm] = Ko(wn), [km, Bi] = je(
5497
+ var ro = "rovingFocusGroup.onEntryFocus", Om = { bubbles: !1, cancelable: !0 }, wn = "RovingFocusGroup", [Co, $i, km] = Ko(wn), [Mm, Bi] = je(
5495
5498
  wn,
5496
- [Mm]
5497
- ), [Dm, Lm] = km(wn), Ui = u.forwardRef(
5499
+ [km]
5500
+ ), [Dm, Lm] = Mm(wn), Ui = u.forwardRef(
5498
5501
  (e, t) => /* @__PURE__ */ c(Co.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(Co.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(Fm, { ...e, ref: t }) }) })
5499
5502
  );
5500
5503
  Ui.displayName = wn;
@@ -5517,9 +5520,9 @@ var Fm = u.forwardRef((e, t) => {
5517
5520
  caller: wn
5518
5521
  }), [w, x] = u.useState(!1), y = ye(f), C = $i(n), R = u.useRef(!1), [_, N] = u.useState(0);
5519
5522
  return u.useEffect(() => {
5520
- const M = m.current;
5521
- if (M)
5522
- return M.addEventListener(ro, y), () => M.removeEventListener(ro, y);
5523
+ const k = m.current;
5524
+ if (k)
5525
+ return k.addEventListener(ro, y), () => k.removeEventListener(ro, y);
5523
5526
  }, [y]), /* @__PURE__ */ c(
5524
5527
  Dm,
5525
5528
  {
@@ -5529,16 +5532,16 @@ var Fm = u.forwardRef((e, t) => {
5529
5532
  loop: o,
5530
5533
  currentTabStopId: h,
5531
5534
  onItemFocus: u.useCallback(
5532
- (M) => b(M),
5535
+ (k) => b(k),
5533
5536
  [b]
5534
5537
  ),
5535
5538
  onItemShiftTab: u.useCallback(() => x(!0), []),
5536
5539
  onFocusableItemAdd: u.useCallback(
5537
- () => N((M) => M + 1),
5540
+ () => N((k) => k + 1),
5538
5541
  []
5539
5542
  ),
5540
5543
  onFocusableItemRemove: u.useCallback(
5541
- () => N((M) => M - 1),
5544
+ () => N((k) => k - 1),
5542
5545
  []
5543
5546
  ),
5544
5547
  children: /* @__PURE__ */ c(
@@ -5552,11 +5555,11 @@ var Fm = u.forwardRef((e, t) => {
5552
5555
  onMouseDown: U(e.onMouseDown, () => {
5553
5556
  R.current = !0;
5554
5557
  }),
5555
- onFocus: U(e.onFocus, (M) => {
5558
+ onFocus: U(e.onFocus, (k) => {
5556
5559
  const L = !R.current;
5557
- if (M.target === M.currentTarget && L && !w) {
5560
+ if (k.target === k.currentTarget && L && !w) {
5558
5561
  const P = new CustomEvent(ro, Om);
5559
- if (M.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
5562
+ if (k.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
5560
5563
  const $ = C().filter((O) => O.focusable), K = $.find((O) => O.active), B = $.find((O) => O.id === h), H = [K, B, ...$].filter(
5561
5564
  Boolean
5562
5565
  ).map((O) => O.ref.current);
@@ -5660,7 +5663,7 @@ var zm = Ui, Wm = zi, Vm = function(e) {
5660
5663
  return null;
5661
5664
  var t = Array.isArray(e) ? e[0] : e;
5662
5665
  return t.ownerDocument.body;
5663
- }, It = /* @__PURE__ */ new WeakMap(), Mn = /* @__PURE__ */ new WeakMap(), kn = {}, oo = 0, Vi = function(e) {
5666
+ }, It = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), Mn = {}, oo = 0, Vi = function(e) {
5664
5667
  return e && (e.host || Vi(e.parentNode));
5665
5668
  }, jm = function(e, t) {
5666
5669
  return t.map(function(n) {
@@ -5673,8 +5676,8 @@ var zm = Ui, Wm = zi, Vm = function(e) {
5673
5676
  });
5674
5677
  }, Km = function(e, t, n, r) {
5675
5678
  var o = jm(t, Array.isArray(e) ? e : [e]);
5676
- kn[n] || (kn[n] = /* @__PURE__ */ new WeakMap());
5677
- var s = kn[n], a = [], i = /* @__PURE__ */ new Set(), l = new Set(o), f = function(p) {
5679
+ Mn[n] || (Mn[n] = /* @__PURE__ */ new WeakMap());
5680
+ var s = Mn[n], a = [], i = /* @__PURE__ */ new Set(), l = new Set(o), f = function(p) {
5678
5681
  !p || i.has(p) || (i.add(p), f(p.parentNode));
5679
5682
  };
5680
5683
  o.forEach(f);
@@ -5685,7 +5688,7 @@ var zm = Ui, Wm = zi, Vm = function(e) {
5685
5688
  else
5686
5689
  try {
5687
5690
  var v = m.getAttribute(r), g = v !== null && v !== "false", h = (It.get(m) || 0) + 1, b = (s.get(m) || 0) + 1;
5688
- It.set(m, h), s.set(m, b), a.push(m), h === 1 && g && Mn.set(m, !0), b === 1 && m.setAttribute(n, "true"), g || m.setAttribute(r, "true");
5691
+ It.set(m, h), s.set(m, b), a.push(m), h === 1 && g && kn.set(m, !0), b === 1 && m.setAttribute(n, "true"), g || m.setAttribute(r, "true");
5689
5692
  } catch (w) {
5690
5693
  console.error("aria-hidden: cannot operate on ", m, w);
5691
5694
  }
@@ -5694,8 +5697,8 @@ var zm = Ui, Wm = zi, Vm = function(e) {
5694
5697
  return d(t), i.clear(), oo++, function() {
5695
5698
  a.forEach(function(p) {
5696
5699
  var m = It.get(p) - 1, v = s.get(p) - 1;
5697
- It.set(p, m), s.set(p, v), m || (Mn.has(p) || p.removeAttribute(r), Mn.delete(p)), v || p.removeAttribute(n);
5698
- }), oo--, oo || (It = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Mn = /* @__PURE__ */ new WeakMap(), kn = {});
5700
+ It.set(p, m), s.set(p, v), m || (kn.has(p) || p.removeAttribute(r), kn.delete(p)), v || p.removeAttribute(n);
5701
+ }), oo--, oo || (It = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), Mn = {});
5699
5702
  };
5700
5703
  }, as = function(e, t, n) {
5701
5704
  n === void 0 && (n = "data-aria-hidden");
@@ -6106,10 +6109,10 @@ function Rg(e) {
6106
6109
  var w = Ln(h), x = n.current, y = "deltaX" in h ? h.deltaX : x[0] - w[0], C = "deltaY" in h ? h.deltaY : x[1] - w[1], R, _ = h.target, N = Math.abs(y) > Math.abs(C) ? "h" : "v";
6107
6110
  if ("touches" in h && N === "h" && _.type === "range")
6108
6111
  return !1;
6109
- var M = wa(N, _);
6110
- if (!M)
6112
+ var k = wa(N, _);
6113
+ if (!k)
6111
6114
  return !0;
6112
- if (M ? R = N : (R = N === "v" ? "h" : "v", M = wa(N, _)), !M)
6115
+ if (k ? R = N : (R = N === "v" ? "h" : "v", k = wa(N, _)), !k)
6113
6116
  return !1;
6114
6117
  if (!r.current && "changedTouches" in h && (y || C) && (r.current = R), !R)
6115
6118
  return !0;
@@ -6181,8 +6184,8 @@ var No = ["Enter", " "], Pg = ["ArrowDown", "PageUp", "Home"], Zi = ["ArrowUp",
6181
6184
  }, Og = {
6182
6185
  ltr: ["ArrowLeft"],
6183
6186
  rtl: ["ArrowRight"]
6184
- }, yn = "Menu", [cn, Mg, kg] = Ko(yn), [Nt, Qi] = je(yn, [
6185
- kg,
6187
+ }, yn = "Menu", [cn, kg, Mg] = Ko(yn), [Nt, Qi] = je(yn, [
6188
+ Mg,
6186
6189
  Gt,
6187
6190
  Bi
6188
6191
  ]), Rr = Gt(), ec = Bi(), [Dg, Rt] = Nt(yn), [Lg, xn] = Nt(yn), tc = (e) => {
@@ -6289,7 +6292,7 @@ var Le = "MenuContent", [Bg, ls] = Nt(Le), oc = u.forwardRef(
6289
6292
  onDismiss: v,
6290
6293
  disableOutsideScroll: g,
6291
6294
  ...h
6292
- } = e, b = Rt(Le, n), w = xn(Le, n), x = Rr(n), y = ec(n), C = Mg(n), [R, _] = u.useState(null), N = u.useRef(null), M = ie(t, N, b.onContentChange), L = u.useRef(0), P = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), k = u.useRef(0), H = g ? Nr : u.Fragment, O = g ? { as: zg, allowPinchZoom: !0 } : void 0, G = (T) => {
6295
+ } = e, b = Rt(Le, n), w = xn(Le, n), x = Rr(n), y = ec(n), C = kg(n), [R, _] = u.useState(null), N = u.useRef(null), k = ie(t, N, b.onContentChange), L = u.useRef(0), P = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), M = u.useRef(0), H = g ? Nr : u.Fragment, O = g ? { as: zg, allowPinchZoom: !0 } : void 0, G = (T) => {
6293
6296
  var z, W;
6294
6297
  const Q = P.current + T, q = C().filter((ae) => !ae.disabled), se = document.activeElement, F = (z = q.find((ae) => ae.ref.current === se)) == null ? void 0 : z.textValue, V = q.map((ae) => ae.textValue), ce = eb(V, Q, F), pe = (W = q.find((ae) => ae.textValue === ce)) == null ? void 0 : W.ref.current;
6295
6298
  (function ae(j) {
@@ -6373,7 +6376,7 @@ var Le = "MenuContent", [Bg, ls] = Nt(Le), oc = u.forwardRef(
6373
6376
  dir: w.dir,
6374
6377
  ...x,
6375
6378
  ...h,
6376
- ref: M,
6379
+ ref: k,
6377
6380
  style: { outline: "none", ...h.style },
6378
6381
  onKeyDown: U(h.onKeyDown, (T) => {
6379
6382
  const q = T.target.closest("[data-radix-menu-content]") === T.currentTarget, se = T.ctrlKey || T.altKey || T.metaKey, F = T.key.length === 1;
@@ -6390,10 +6393,10 @@ var Le = "MenuContent", [Bg, ls] = Nt(Le), oc = u.forwardRef(
6390
6393
  onPointerMove: U(
6391
6394
  e.onPointerMove,
6392
6395
  ln((T) => {
6393
- const Q = T.target, q = k.current !== T.clientX;
6396
+ const Q = T.target, q = M.current !== T.clientX;
6394
6397
  if (T.currentTarget.contains(Q) && q) {
6395
- const se = T.clientX > k.current ? "right" : "left";
6396
- B.current = se, k.current = T.clientX;
6398
+ const se = T.clientX > M.current ? "right" : "left";
6399
+ B.current = se, M.current = T.clientX;
6397
6400
  }
6398
6401
  })
6399
6402
  )
@@ -6885,11 +6888,11 @@ var Pb = "DropdownMenuItemIndicator", Oc = u.forwardRef((e, t) => {
6885
6888
  return /* @__PURE__ */ c(pb, { ...o, ...r, ref: t });
6886
6889
  });
6887
6890
  Oc.displayName = Pb;
6888
- var Ib = "DropdownMenuSeparator", Mc = u.forwardRef((e, t) => {
6891
+ var Ib = "DropdownMenuSeparator", kc = u.forwardRef((e, t) => {
6889
6892
  const { __scopeDropdownMenu: n, ...r } = e, o = Ee(n);
6890
6893
  return /* @__PURE__ */ c(hb, { ...o, ...r, ref: t });
6891
6894
  });
6892
- Mc.displayName = Ib;
6895
+ kc.displayName = Ib;
6893
6896
  var _b = "DropdownMenuArrow", Ob = u.forwardRef(
6894
6897
  (e, t) => {
6895
6898
  const { __scopeDropdownMenu: n, ...r } = e, o = Ee(n);
@@ -6897,12 +6900,12 @@ var _b = "DropdownMenuArrow", Ob = u.forwardRef(
6897
6900
  }
6898
6901
  );
6899
6902
  Ob.displayName = _b;
6900
- var Mb = "DropdownMenuSubTrigger", kc = u.forwardRef((e, t) => {
6903
+ var kb = "DropdownMenuSubTrigger", Mc = u.forwardRef((e, t) => {
6901
6904
  const { __scopeDropdownMenu: n, ...r } = e, o = Ee(n);
6902
6905
  return /* @__PURE__ */ c(gb, { ...o, ...r, ref: t });
6903
6906
  });
6904
- kc.displayName = Mb;
6905
- var kb = "DropdownMenuSubContent", Dc = u.forwardRef((e, t) => {
6907
+ Mc.displayName = kb;
6908
+ var Mb = "DropdownMenuSubContent", Dc = u.forwardRef((e, t) => {
6906
6909
  const { __scopeDropdownMenu: n, ...r } = e, o = Ee(n);
6907
6910
  return /* @__PURE__ */ c(
6908
6911
  bb,
@@ -6921,8 +6924,8 @@ var kb = "DropdownMenuSubContent", Dc = u.forwardRef((e, t) => {
6921
6924
  }
6922
6925
  );
6923
6926
  });
6924
- Dc.displayName = kb;
6925
- var Db = Sc, Lb = Ec, Fb = Nc, Lc = Tc, Fc = Ac, $c = Pc, Bc = Ic, Uc = _c, Hc = Oc, zc = Mc, Wc = kc, Vc = Dc;
6927
+ Dc.displayName = Mb;
6928
+ var Db = Sc, Lb = Ec, Fb = Nc, Lc = Tc, Fc = Ac, $c = Pc, Bc = Ic, Uc = _c, Hc = Oc, zc = kc, Wc = Mc, Vc = Dc;
6926
6929
  const $b = Db, Bb = Lb, Ub = u.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ E(
6927
6930
  Wc,
6928
6931
  {
@@ -7060,10 +7063,10 @@ function jn({
7060
7063
  navigateToCheckpoint: R,
7061
7064
  returnToLatest: _,
7062
7065
  hasMoreHistory: N,
7063
- isLoadingHistory: M,
7066
+ isLoadingHistory: k,
7064
7067
  loadOlderMessages: L,
7065
7068
  api: P
7066
- } = si(), [$, K] = re(""), [B, k] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q, se] = re(null), [F, V] = re(null), [ce, pe] = re(!1), [z, W] = re(null), [ae, j] = re([]), [X, te] = re(null), me = Te(null), de = Te(null), Z = Te(null), Y = Te(null), he = Te(null), Oe = Te(!1), Ce = Te(!0), Xt = Te(0), st = Te(null), [Tt, Ur] = re("desktop");
7069
+ } = si(), [$, K] = re(""), [B, M] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q, se] = re(null), [F, V] = re(null), [ce, pe] = re(!1), [z, W] = re(null), [ae, j] = re([]), [X, te] = re(null), me = Te(null), de = Te(null), Z = Te(null), Y = Te(null), he = Te(null), Oe = Te(!1), Ce = Te(!0), Xt = Te(0), st = Te(null), [Tt, Ur] = re("desktop");
7067
7070
  ge(() => {
7068
7071
  const I = () => {
7069
7072
  const J = window.innerWidth;
@@ -7097,7 +7100,7 @@ function jn({
7097
7100
  y && te(y);
7098
7101
  }, [y]);
7099
7102
  const At = ve(async () => {
7100
- if (!N || M) return;
7103
+ if (!N || k) return;
7101
7104
  const I = he.current;
7102
7105
  if (!I) return;
7103
7106
  const J = I.scrollHeight, le = I.scrollTop;
@@ -7119,7 +7122,7 @@ function jn({
7119
7122
  Ce.current = at <= 32, Oe.current = !1;
7120
7123
  });
7121
7124
  }
7122
- }, [N, M, L]);
7125
+ }, [N, k, L]);
7123
7126
  ge(() => {
7124
7127
  const I = he.current;
7125
7128
  if (!I) return;
@@ -7150,8 +7153,8 @@ function jn({
7150
7153
  b && !ce && (p == null || p(b));
7151
7154
  }, [b, ce, p]);
7152
7155
  const Hr = (I) => {
7153
- if (I.length > Mt)
7154
- return `Message too long (${I.length}/${Mt} characters)`;
7156
+ if (I.length > kt)
7157
+ return `Message too long (${I.length}/${kt} characters)`;
7155
7158
  try {
7156
7159
  return Yp(I), null;
7157
7160
  } catch (J) {
@@ -7176,18 +7179,18 @@ function jn({
7176
7179
  }
7177
7180
  }
7178
7181
  try {
7179
- await w(I, { checkpointId: X || y || void 0, payloadExtras: B ? { edit: !0, originalMessageId: B } : void 0, attachments: G }), f == null || f(I), K(""), O(null), D([]), k(null), de.current && (de.current.style.height = "auto");
7182
+ await w(I, { checkpointId: X || y || void 0, payloadExtras: B ? { edit: !0, originalMessageId: B } : void 0, attachments: G }), f == null || f(I), K(""), O(null), D([]), M(null), de.current && (de.current.style.height = "auto");
7180
7183
  } catch (J) {
7181
7184
  const le = (J == null ? void 0 : J.message) || "Failed to send message";
7182
7185
  O(le), p == null || p(le);
7183
7186
  }
7184
7187
  }
7185
7188
  }, zr = (I, J) => {
7186
- i && (k(I), K(J), O(null), setTimeout(() => {
7189
+ i && (M(I), K(J), O(null), setTimeout(() => {
7187
7190
  de.current && (de.current.focus(), de.current.style.height = "auto", de.current.style.height = de.current.scrollHeight + "px");
7188
7191
  }, 0));
7189
7192
  }, Yt = () => {
7190
- k(null), K(""), O(null), de.current && (de.current.style.height = "auto");
7193
+ M(null), K(""), O(null), de.current && (de.current.style.height = "auto");
7191
7194
  }, En = (I) => {
7192
7195
  I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), Cn()) : I.key === "Escape" && B && (I.preventDefault(), Yt());
7193
7196
  }, oe = (I) => {
@@ -7264,7 +7267,7 @@ function jn({
7264
7267
  style: r ? { maxHeight: r } : void 0,
7265
7268
  children: [
7266
7269
  v.length === 0 ? /* @__PURE__ */ c("div", { className: "flex items-center justify-center py-8 text-muted-foreground text-center max-w-md mx-auto", children: z || "No messages yet. Start a conversation!" }) : /* @__PURE__ */ E(Ae, { children: [
7267
- (M || !N) && /* @__PURE__ */ c("div", { className: "flex justify-center py-2 text-xs text-muted-foreground", children: M ? /* @__PURE__ */ c(As, { className: "h-4 w-4 animate-spin" }) : "You've reached the beginning" }),
7270
+ (k || !N) && /* @__PURE__ */ c("div", { className: "flex justify-center py-2 text-xs text-muted-foreground", children: k ? /* @__PURE__ */ c(As, { className: "h-4 w-4 animate-spin" }) : "You've reached the beginning" }),
7268
7271
  v.map((I, J) => /* @__PURE__ */ c(
7269
7272
  Lp,
7270
7273
  {
@@ -7408,7 +7411,7 @@ function jn({
7408
7411
  placeholder: B ? "Edit your message..." : t,
7409
7412
  className: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${B ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${H ? "border-red-400" : ""} ${l.textarea || ""}`,
7410
7413
  disabled: !1,
7411
- maxLength: Mt,
7414
+ maxLength: kt,
7412
7415
  rows: 1
7413
7416
  }
7414
7417
  ) }),
@@ -7436,10 +7439,10 @@ function jn({
7436
7439
  }
7437
7440
  ) })
7438
7441
  ] }),
7439
- $.length > Mt * 0.8 && /* @__PURE__ */ E("div", { className: "mt-2 text-xs text-gray-500 text-right", children: [
7442
+ $.length > kt * 0.8 && /* @__PURE__ */ E("div", { className: "mt-2 text-xs text-gray-500 text-right", children: [
7440
7443
  $.length,
7441
7444
  "/",
7442
- Mt
7445
+ kt
7443
7446
  ] })
7444
7447
  ] })
7445
7448
  ] });
@@ -7473,7 +7476,7 @@ var hs = "ScrollArea", [Kc, zy] = je(hs), [Gb, Fe] = Kc(hs), Gc = u.forwardRef(
7473
7476
  dir: o,
7474
7477
  scrollHideDelay: s = 600,
7475
7478
  ...a
7476
- } = e, [i, l] = u.useState(null), [f, d] = u.useState(null), [p, m] = u.useState(null), [v, g] = u.useState(null), [h, b] = u.useState(null), [w, x] = u.useState(0), [y, C] = u.useState(0), [R, _] = u.useState(!1), [N, M] = u.useState(!1), L = ie(t, ($) => l($)), P = br(o);
7479
+ } = e, [i, l] = u.useState(null), [f, d] = u.useState(null), [p, m] = u.useState(null), [v, g] = u.useState(null), [h, b] = u.useState(null), [w, x] = u.useState(0), [y, C] = u.useState(0), [R, _] = u.useState(!1), [N, k] = u.useState(!1), L = ie(t, ($) => l($)), P = br(o);
7477
7480
  return /* @__PURE__ */ c(
7478
7481
  Gb,
7479
7482
  {
@@ -7493,7 +7496,7 @@ var hs = "ScrollArea", [Kc, zy] = je(hs), [Gb, Fe] = Kc(hs), Gc = u.forwardRef(
7493
7496
  scrollbarY: h,
7494
7497
  onScrollbarYChange: b,
7495
7498
  scrollbarYEnabled: N,
7496
- onScrollbarYEnabledChange: M,
7499
+ onScrollbarYEnabledChange: k,
7497
7500
  onCornerWidthChange: x,
7498
7501
  onCornerHeightChange: C,
7499
7502
  children: /* @__PURE__ */ c(
@@ -7796,7 +7799,7 @@ var qb = u.forwardRef((e, t) => {
7796
7799
  onResize: p,
7797
7800
  ...m
7798
7801
  } = e, v = Fe(et, n), [g, h] = u.useState(null), b = ie(t, (L) => h(L)), w = u.useRef(null), x = u.useRef(""), y = v.viewport, C = r.content - r.viewport, R = ye(d), _ = ye(l), N = Ir(p, 10);
7799
- function M(L) {
7802
+ function k(L) {
7800
7803
  if (w.current) {
7801
7804
  const P = L.clientX - w.current.left, $ = L.clientY - w.current.top;
7802
7805
  f({ x: P, y: $ });
@@ -7825,9 +7828,9 @@ var qb = u.forwardRef((e, t) => {
7825
7828
  ref: b,
7826
7829
  style: { position: "absolute", ...m.style },
7827
7830
  onPointerDown: U(e.onPointerDown, (L) => {
7828
- L.button === 0 && (L.target.setPointerCapture(L.pointerId), w.current = g.getBoundingClientRect(), x.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), M(L));
7831
+ L.button === 0 && (L.target.setPointerCapture(L.pointerId), w.current = g.getBoundingClientRect(), x.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), k(L));
7829
7832
  }),
7830
- onPointerMove: U(e.onPointerMove, M),
7833
+ onPointerMove: U(e.onPointerMove, k),
7831
7834
  onPointerUp: U(e.onPointerUp, (L) => {
7832
7835
  const P = L.target;
7833
7836
  P.hasPointerCapture(L.pointerId) && P.releasePointerCapture(L.pointerId), document.body.style.webkitUserSelect = x.current, v.viewport && (v.viewport.style.scrollBehavior = ""), w.current = null;
@@ -8024,11 +8027,11 @@ function Ao({
8024
8027
  createThread: h,
8025
8028
  deleteThread: b,
8026
8029
  renameThread: w
8027
- } = si(), [x, y] = re(m ?? []), [C, R] = re(!1), [_, N] = re(null), [M, L] = re(null), [P, $] = re(""), [K, B] = re(!1);
8030
+ } = si(), [x, y] = re(m ?? []), [C, R] = re(!1), [_, N] = re(null), [k, L] = re(null), [P, $] = re(""), [K, B] = re(!1);
8028
8031
  ge(() => {
8029
8032
  y(m ?? []);
8030
8033
  }, [m]);
8031
- const k = async (F) => {
8034
+ const M = async (F) => {
8032
8035
  try {
8033
8036
  await p(F), i == null || i(F), l == null || l(F);
8034
8037
  } catch (V) {
@@ -8097,11 +8100,11 @@ function Ao({
8097
8100
  ] }) : x.slice().sort((F, V) => new Date(V.updatedAt || V.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ E(
8098
8101
  "div",
8099
8102
  {
8100
- onClick: () => k(F.threadId),
8103
+ onClick: () => M(F.threadId),
8101
8104
  className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(a ?? g) === F.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
8102
8105
  children: [
8103
8106
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
8104
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: M === F.threadId ? /* @__PURE__ */ E("div", { className: "flex items-center gap-2", onClick: (V) => V.stopPropagation(), children: [
8107
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: k === F.threadId ? /* @__PURE__ */ E("div", { className: "flex items-center gap-2", onClick: (V) => V.stopPropagation(), children: [
8105
8108
  /* @__PURE__ */ c(un, { value: P, onChange: (V) => $(V.target.value), onKeyDown: (V) => Q(V, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
8106
8109
  /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: () => D(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c($o, { size: 12 }) }),
8107
8110
  /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: T, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(tn, { size: 12 }) })
@@ -8113,7 +8116,7 @@ function Ao({
8113
8116
  ] })
8114
8117
  ] }) }),
8115
8118
  /* @__PURE__ */ E("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
8116
- r && M !== F.threadId && /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: (V) => G(F, V), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c(Oa, { size: 12 }) }),
8119
+ r && k !== F.threadId && /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: (V) => G(F, V), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c(Oa, { size: 12 }) }),
8117
8120
  n && /* @__PURE__ */ c(
8118
8121
  fe,
8119
8122
  {
@@ -8533,7 +8536,7 @@ const Iv = fn(
8533
8536
  )
8534
8537
  ] }));
8535
8538
  Ss.displayName = Al.displayName;
8536
- const Ml = ({
8539
+ const kl = ({
8537
8540
  className: e,
8538
8541
  ...t
8539
8542
  }) => /* @__PURE__ */ c(
@@ -8546,8 +8549,8 @@ const Ml = ({
8546
8549
  ...t
8547
8550
  }
8548
8551
  );
8549
- Ml.displayName = "SheetHeader";
8550
- const kl = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8552
+ kl.displayName = "SheetHeader";
8553
+ const Ml = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8551
8554
  Pl,
8552
8555
  {
8553
8556
  ref: n,
@@ -8555,7 +8558,7 @@ const kl = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8555
8558
  ...t
8556
8559
  }
8557
8560
  ));
8558
- kl.displayName = Pl.displayName;
8561
+ Ml.displayName = Pl.displayName;
8559
8562
  const Dl = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8560
8563
  Il,
8561
8564
  {
@@ -8602,10 +8605,10 @@ var Ll = Object.freeze({
8602
8605
  Fl.displayName = _v;
8603
8606
  var Ov = Fl, [Or, Xy] = je("Tooltip", [
8604
8607
  Gt
8605
- ]), Mr = Gt(), $l = "TooltipProvider", Mv = 700, Po = "tooltip.open", [kv, Cs] = Or($l), Bl = (e) => {
8608
+ ]), kr = Gt(), $l = "TooltipProvider", kv = 700, Po = "tooltip.open", [Mv, Cs] = Or($l), Bl = (e) => {
8606
8609
  const {
8607
8610
  __scopeTooltip: t,
8608
- delayDuration: n = Mv,
8611
+ delayDuration: n = kv,
8609
8612
  skipDelayDuration: r = 300,
8610
8613
  disableHoverableContent: o = !1,
8611
8614
  children: s
@@ -8614,7 +8617,7 @@ var Ov = Fl, [Or, Xy] = je("Tooltip", [
8614
8617
  const f = l.current;
8615
8618
  return () => window.clearTimeout(f);
8616
8619
  }, []), /* @__PURE__ */ c(
8617
- kv,
8620
+ Mv,
8618
8621
  {
8619
8622
  scope: t,
8620
8623
  isOpenDelayedRef: a,
@@ -8638,7 +8641,7 @@ var Ov = Fl, [Or, Xy] = je("Tooltip", [
8638
8641
  );
8639
8642
  };
8640
8643
  Bl.displayName = $l;
8641
- var dn = "Tooltip", [Dv, kr] = Or(dn), Ul = (e) => {
8644
+ var dn = "Tooltip", [Dv, Mr] = Or(dn), Ul = (e) => {
8642
8645
  const {
8643
8646
  __scopeTooltip: t,
8644
8647
  children: n,
@@ -8647,7 +8650,7 @@ var dn = "Tooltip", [Dv, kr] = Or(dn), Ul = (e) => {
8647
8650
  onOpenChange: s,
8648
8651
  disableHoverableContent: a,
8649
8652
  delayDuration: i
8650
- } = e, l = Cs(dn, e.__scopeTooltip), f = Mr(t), [d, p] = u.useState(null), m = He(), v = u.useRef(0), g = a ?? l.disableHoverableContent, h = i ?? l.delayDuration, b = u.useRef(!1), [w, x] = ut({
8653
+ } = e, l = Cs(dn, e.__scopeTooltip), f = kr(t), [d, p] = u.useState(null), m = He(), v = u.useRef(0), g = a ?? l.disableHoverableContent, h = i ?? l.delayDuration, b = u.useRef(!1), [w, x] = ut({
8651
8654
  prop: r,
8652
8655
  defaultProp: o ?? !1,
8653
8656
  onChange: (N) => {
@@ -8690,7 +8693,7 @@ var dn = "Tooltip", [Dv, kr] = Or(dn), Ul = (e) => {
8690
8693
  Ul.displayName = dn;
8691
8694
  var Io = "TooltipTrigger", Hl = u.forwardRef(
8692
8695
  (e, t) => {
8693
- const { __scopeTooltip: n, ...r } = e, o = kr(Io, n), s = Cs(Io, n), a = Mr(n), i = u.useRef(null), l = ie(t, i, o.onTriggerChange), f = u.useRef(!1), d = u.useRef(!1), p = u.useCallback(() => f.current = !1, []);
8696
+ const { __scopeTooltip: n, ...r } = e, o = Mr(Io, n), s = Cs(Io, n), a = kr(n), i = u.useRef(null), l = ie(t, i, o.onTriggerChange), f = u.useRef(!1), d = u.useRef(!1), p = u.useCallback(() => f.current = !1, []);
8694
8697
  return u.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(rs, { asChild: !0, ...a, children: /* @__PURE__ */ c(
8695
8698
  ee.button,
8696
8699
  {
@@ -8721,11 +8724,11 @@ var Lv = "TooltipPortal", [Yy, Fv] = Or(Lv, {
8721
8724
  forceMount: void 0
8722
8725
  }), Ht = "TooltipContent", zl = u.forwardRef(
8723
8726
  (e, t) => {
8724
- const n = Fv(Ht, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = kr(Ht, e.__scopeTooltip);
8727
+ const n = Fv(Ht, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = Mr(Ht, e.__scopeTooltip);
8725
8728
  return /* @__PURE__ */ c(_e, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(Wl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c($v, { side: o, ...s, ref: t }) });
8726
8729
  }
8727
8730
  ), $v = u.forwardRef((e, t) => {
8728
- const n = kr(Ht, e.__scopeTooltip), r = Cs(Ht, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, m = u.useCallback(() => {
8731
+ const n = Mr(Ht, e.__scopeTooltip), r = Cs(Ht, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, m = u.useCallback(() => {
8729
8732
  i(null), p(!1);
8730
8733
  }, [p]), v = u.useCallback(
8731
8734
  (g, h) => {
@@ -8759,7 +8762,7 @@ var Lv = "TooltipPortal", [Yy, Fv] = Or(Lv, {
8759
8762
  onEscapeKeyDown: s,
8760
8763
  onPointerDownOutside: a,
8761
8764
  ...i
8762
- } = e, l = kr(Ht, n), f = Mr(n), { onClose: d } = l;
8765
+ } = e, l = Mr(Ht, n), f = kr(n), { onClose: d } = l;
8763
8766
  return u.useEffect(() => (document.addEventListener(Po, d), () => document.removeEventListener(Po, d)), [d]), u.useEffect(() => {
8764
8767
  if (l.trigger) {
8765
8768
  const p = (m) => {
@@ -8805,7 +8808,7 @@ var Lv = "TooltipPortal", [Yy, Fv] = Or(Lv, {
8805
8808
  zl.displayName = Ht;
8806
8809
  var Vl = "TooltipArrow", zv = u.forwardRef(
8807
8810
  (e, t) => {
8808
- const { __scopeTooltip: n, ...r } = e, o = Mr(n);
8811
+ const { __scopeTooltip: n, ...r } = e, o = kr(n);
8809
8812
  return Uv(
8810
8813
  Vl,
8811
8814
  n
@@ -9629,7 +9632,7 @@ var Rw = [" ", "Enter", "ArrowUp", "ArrowDown"], Tw = [" ", "Enter"], Ct = "Sele
9629
9632
  disabled: m,
9630
9633
  required: v,
9631
9634
  form: g
9632
- } = e, h = Br(t), [b, w] = u.useState(null), [x, y] = u.useState(null), [C, R] = u.useState(!1), _ = br(f), [N, M] = ut({
9635
+ } = e, h = Br(t), [b, w] = u.useState(null), [x, y] = u.useState(null), [C, R] = u.useState(!1), _ = br(f), [N, k] = ut({
9633
9636
  prop: r,
9634
9637
  defaultProp: o ?? !1,
9635
9638
  onChange: s,
@@ -9639,7 +9642,7 @@ var Rw = [" ", "Enter", "ArrowUp", "ArrowDown"], Tw = [" ", "Enter"], Ct = "Sele
9639
9642
  defaultProp: i,
9640
9643
  onChange: l,
9641
9644
  caller: Ct
9642
- }), $ = u.useRef(null), K = b ? g || !!b.closest("form") : !0, [B, k] = u.useState(/* @__PURE__ */ new Set()), H = Array.from(B).map((O) => O.props.value).join(";");
9645
+ }), $ = u.useRef(null), K = b ? g || !!b.closest("form") : !0, [B, M] = u.useState(/* @__PURE__ */ new Set()), H = Array.from(B).map((O) => O.props.value).join(";");
9643
9646
  return /* @__PURE__ */ c(ns, { ...h, children: /* @__PURE__ */ E(
9644
9647
  Pw,
9645
9648
  {
@@ -9655,7 +9658,7 @@ var Rw = [" ", "Enter", "ArrowUp", "ArrowDown"], Tw = [" ", "Enter"], Ct = "Sele
9655
9658
  value: L,
9656
9659
  onValueChange: P,
9657
9660
  open: N,
9658
- onOpenChange: M,
9661
+ onOpenChange: k,
9659
9662
  dir: _,
9660
9663
  triggerPointerDownPosRef: $,
9661
9664
  disabled: m,
@@ -9665,10 +9668,10 @@ var Rw = [" ", "Enter", "ArrowUp", "ArrowDown"], Tw = [" ", "Enter"], Ct = "Sele
9665
9668
  {
9666
9669
  scope: e.__scopeSelect,
9667
9670
  onNativeOptionAdd: u.useCallback((O) => {
9668
- k((G) => new Set(G).add(O));
9671
+ M((G) => new Set(G).add(O));
9669
9672
  }, []),
9670
9673
  onNativeOptionRemove: u.useCallback((O) => {
9671
- k((G) => {
9674
+ M((G) => {
9672
9675
  const D = new Set(G);
9673
9676
  return D.delete(O), D;
9674
9677
  });
@@ -9768,8 +9771,8 @@ var Ow = "SelectIcon", yu = u.forwardRef(
9768
9771
  }
9769
9772
  );
9770
9773
  yu.displayName = Ow;
9771
- var Mw = "SelectPortal", xu = (e) => /* @__PURE__ */ c(Cr, { asChild: !0, ...e });
9772
- xu.displayName = Mw;
9774
+ var kw = "SelectPortal", xu = (e) => /* @__PURE__ */ c(Cr, { asChild: !0, ...e });
9775
+ xu.displayName = kw;
9773
9776
  var Et = "SelectContent", Su = u.forwardRef(
9774
9777
  (e, t) => {
9775
9778
  const n = pt(Et, e.__scopeSelect), [r, o] = u.useState();
@@ -9786,7 +9789,7 @@ var Et = "SelectContent", Su = u.forwardRef(
9786
9789
  }
9787
9790
  );
9788
9791
  Su.displayName = Et;
9789
- var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent.RemoveScroll"), Eu = u.forwardRef(
9792
+ var Ue = 10, [Cu, ht] = qt(Et), Mw = "SelectContentImpl", Dw = Ft("SelectContent.RemoveScroll"), Eu = u.forwardRef(
9790
9793
  (e, t) => {
9791
9794
  const {
9792
9795
  __scopeSelect: n,
@@ -9808,9 +9811,9 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9808
9811
  avoidCollisions: b,
9809
9812
  //
9810
9813
  ...w
9811
- } = e, x = pt(Et, n), [y, C] = u.useState(null), [R, _] = u.useState(null), N = ie(t, (z) => C(z)), [M, L] = u.useState(null), [P, $] = u.useState(
9814
+ } = e, x = pt(Et, n), [y, C] = u.useState(null), [R, _] = u.useState(null), N = ie(t, (z) => C(z)), [k, L] = u.useState(null), [P, $] = u.useState(
9812
9815
  null
9813
- ), K = $r(n), [B, k] = u.useState(!1), H = u.useRef(!1);
9816
+ ), K = $r(n), [B, M] = u.useState(!1), H = u.useRef(!1);
9814
9817
  u.useEffect(() => {
9815
9818
  if (y) return as(y);
9816
9819
  }, [y]), Go();
@@ -9822,8 +9825,8 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9822
9825
  },
9823
9826
  [K, R]
9824
9827
  ), G = u.useCallback(
9825
- () => O([M, y]),
9826
- [O, M, y]
9828
+ () => O([k, y]),
9829
+ [O, k, y]
9827
9830
  );
9828
9831
  u.useEffect(() => {
9829
9832
  B && G();
@@ -9886,7 +9889,7 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9886
9889
  viewport: R,
9887
9890
  onViewportChange: _,
9888
9891
  itemRefCallback: se,
9889
- selectedItem: M,
9892
+ selectedItem: k,
9890
9893
  onItemLeave: F,
9891
9894
  itemTextRefCallback: V,
9892
9895
  focusSelectedItem: G,
@@ -9925,7 +9928,7 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9925
9928
  onContextMenu: (z) => z.preventDefault(),
9926
9929
  ...w,
9927
9930
  ...pe,
9928
- onPlaced: () => k(!0),
9931
+ onPlaced: () => M(!0),
9929
9932
  ref: N,
9930
9933
  style: {
9931
9934
  // flex layout so we can place the scroll buttons properly
@@ -9956,13 +9959,13 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9956
9959
  );
9957
9960
  }
9958
9961
  );
9959
- Eu.displayName = kw;
9962
+ Eu.displayName = Mw;
9960
9963
  var Lw = "SelectItemAlignedPosition", Nu = u.forwardRef((e, t) => {
9961
9964
  const { __scopeSelect: n, onPlaced: r, ...o } = e, s = pt(Et, n), a = ht(Et, n), [i, l] = u.useState(null), [f, d] = u.useState(null), p = ie(t, (N) => d(N)), m = $r(n), v = u.useRef(!1), g = u.useRef(!0), { viewport: h, selectedItem: b, selectedItemText: w, focusSelectedItem: x } = a, y = u.useCallback(() => {
9962
9965
  if (s.trigger && s.valueNode && i && f && h && b && w) {
9963
- const N = s.trigger.getBoundingClientRect(), M = f.getBoundingClientRect(), L = s.valueNode.getBoundingClientRect(), P = w.getBoundingClientRect();
9966
+ const N = s.trigger.getBoundingClientRect(), k = f.getBoundingClientRect(), L = s.valueNode.getBoundingClientRect(), P = w.getBoundingClientRect();
9964
9967
  if (s.dir !== "rtl") {
9965
- const X = P.left - M.left, te = L.left - X, me = N.left - te, de = N.width + me, Z = Math.max(de, M.width), Y = window.innerWidth - Ue, he = To(te, [
9968
+ const X = P.left - k.left, te = L.left - X, me = N.left - te, de = N.width + me, Z = Math.max(de, k.width), Y = window.innerWidth - Ue, he = To(te, [
9966
9969
  Ue,
9967
9970
  // Prevents the content from going off the starting edge of the
9968
9971
  // viewport. It may still go off the ending edge, but this can be
@@ -9973,13 +9976,13 @@ var Lw = "SelectItemAlignedPosition", Nu = u.forwardRef((e, t) => {
9973
9976
  ]);
9974
9977
  i.style.minWidth = de + "px", i.style.left = he + "px";
9975
9978
  } else {
9976
- const X = M.right - P.right, te = window.innerWidth - L.right - X, me = window.innerWidth - N.right - te, de = N.width + me, Z = Math.max(de, M.width), Y = window.innerWidth - Ue, he = To(te, [
9979
+ const X = k.right - P.right, te = window.innerWidth - L.right - X, me = window.innerWidth - N.right - te, de = N.width + me, Z = Math.max(de, k.width), Y = window.innerWidth - Ue, he = To(te, [
9977
9980
  Ue,
9978
9981
  Math.max(Ue, Y - Z)
9979
9982
  ]);
9980
9983
  i.style.minWidth = de + "px", i.style.right = he + "px";
9981
9984
  }
9982
- const $ = m(), K = window.innerHeight - Ue * 2, B = h.scrollHeight, k = window.getComputedStyle(f), H = parseInt(k.borderTopWidth, 10), O = parseInt(k.paddingTop, 10), G = parseInt(k.borderBottomWidth, 10), D = parseInt(k.paddingBottom, 10), T = H + O + B + D + G, Q = Math.min(b.offsetHeight * 5, T), q = window.getComputedStyle(h), se = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), V = N.top + N.height / 2 - Ue, ce = K - V, pe = b.offsetHeight / 2, z = b.offsetTop + pe, W = H + O + z, ae = T - W;
9985
+ const $ = m(), K = window.innerHeight - Ue * 2, B = h.scrollHeight, M = window.getComputedStyle(f), H = parseInt(M.borderTopWidth, 10), O = parseInt(M.paddingTop, 10), G = parseInt(M.borderBottomWidth, 10), D = parseInt(M.paddingBottom, 10), T = H + O + B + D + G, Q = Math.min(b.offsetHeight * 5, T), q = window.getComputedStyle(h), se = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), V = N.top + N.height / 2 - Ue, ce = K - V, pe = b.offsetHeight / 2, z = b.offsetTop + pe, W = H + O + z, ae = T - W;
9983
9986
  if (W <= V) {
9984
9987
  const X = $.length > 0 && b === $[$.length - 1].ref.current;
9985
9988
  i.style.bottom = "0px";
@@ -10263,15 +10266,15 @@ var en = "SelectItemText", Ou = u.forwardRef(
10263
10266
  }
10264
10267
  );
10265
10268
  Ou.displayName = en;
10266
- var Mu = "SelectItemIndicator", ku = u.forwardRef(
10269
+ var ku = "SelectItemIndicator", Mu = u.forwardRef(
10267
10270
  (e, t) => {
10268
10271
  const { __scopeSelect: n, ...r } = e;
10269
- return Iu(Mu, n).isSelected ? /* @__PURE__ */ c(ee.span, { "aria-hidden": !0, ...r, ref: t }) : null;
10272
+ return Iu(ku, n).isSelected ? /* @__PURE__ */ c(ee.span, { "aria-hidden": !0, ...r, ref: t }) : null;
10270
10273
  }
10271
10274
  );
10272
- ku.displayName = Mu;
10273
- var Mo = "SelectScrollUpButton", Du = u.forwardRef((e, t) => {
10274
- const n = ht(Mo, e.__scopeSelect), r = Es(Mo, e.__scopeSelect), [o, s] = u.useState(!1), a = ie(t, r.onScrollButtonChange);
10275
+ Mu.displayName = ku;
10276
+ var ko = "SelectScrollUpButton", Du = u.forwardRef((e, t) => {
10277
+ const n = ht(ko, e.__scopeSelect), r = Es(ko, e.__scopeSelect), [o, s] = u.useState(!1), a = ie(t, r.onScrollButtonChange);
10275
10278
  return we(() => {
10276
10279
  if (n.viewport && n.isPositioned) {
10277
10280
  let i = function() {
@@ -10293,9 +10296,9 @@ var Mo = "SelectScrollUpButton", Du = u.forwardRef((e, t) => {
10293
10296
  }
10294
10297
  ) : null;
10295
10298
  });
10296
- Du.displayName = Mo;
10297
- var ko = "SelectScrollDownButton", Lu = u.forwardRef((e, t) => {
10298
- const n = ht(ko, e.__scopeSelect), r = Es(ko, e.__scopeSelect), [o, s] = u.useState(!1), a = ie(t, r.onScrollButtonChange);
10299
+ Du.displayName = ko;
10300
+ var Mo = "SelectScrollDownButton", Lu = u.forwardRef((e, t) => {
10301
+ const n = ht(Mo, e.__scopeSelect), r = Es(Mo, e.__scopeSelect), [o, s] = u.useState(!1), a = ie(t, r.onScrollButtonChange);
10299
10302
  return we(() => {
10300
10303
  if (n.viewport && n.isPositioned) {
10301
10304
  let i = function() {
@@ -10317,7 +10320,7 @@ var ko = "SelectScrollDownButton", Lu = u.forwardRef((e, t) => {
10317
10320
  }
10318
10321
  ) : null;
10319
10322
  });
10320
- Lu.displayName = ko;
10323
+ Lu.displayName = Mo;
10321
10324
  var Fu = u.forwardRef((e, t) => {
10322
10325
  const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = ht("SelectScrollButton", n), a = u.useRef(null), i = $r(n), l = u.useCallback(() => {
10323
10326
  a.current !== null && (window.clearInterval(a.current), a.current = null);
@@ -10414,7 +10417,7 @@ function zu(e, t, n) {
10414
10417
  function Kw(e, t) {
10415
10418
  return e.map((n, r) => e[(t + r) % e.length]);
10416
10419
  }
10417
- var Gw = mu, Wu = bu, qw = wu, Xw = yu, Yw = xu, Vu = Su, Jw = Ru, ju = Pu, Ku = _u, Zw = Ou, Qw = ku, Gu = Du, qu = Lu, Xu = $u;
10420
+ var Gw = mu, Wu = bu, qw = wu, Xw = yu, Yw = xu, Vu = Su, Jw = Ru, ju = Pu, Ku = _u, Zw = Ou, Qw = Mu, Gu = Du, qu = Lu, Xu = $u;
10418
10421
  const Ta = Gw, Aa = qw, Lo = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
10419
10422
  Wu,
10420
10423
  {
@@ -10426,7 +10429,7 @@ const Ta = Gw, Aa = qw, Lo = u.forwardRef(({ className: e, children: t, ...n },
10426
10429
  ...n,
10427
10430
  children: [
10428
10431
  t,
10429
- /* @__PURE__ */ c(Xw, { asChild: !0, children: /* @__PURE__ */ c(kt, { className: "h-4 w-4 opacity-50" }) })
10432
+ /* @__PURE__ */ c(Xw, { asChild: !0, children: /* @__PURE__ */ c(Mt, { className: "h-4 w-4 opacity-50" }) })
10430
10433
  ]
10431
10434
  }
10432
10435
  ));
@@ -10453,7 +10456,7 @@ const Ju = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10453
10456
  e
10454
10457
  ),
10455
10458
  ...t,
10456
- children: /* @__PURE__ */ c(kt, { className: "h-4 w-4" })
10459
+ children: /* @__PURE__ */ c(Mt, { className: "h-4 w-4" })
10457
10460
  }
10458
10461
  ));
10459
10462
  Ju.displayName = qu.displayName;
@@ -10724,8 +10727,8 @@ function ex({ settings: e, onSettingsChange: t, className: n = "" }) {
10724
10727
  f && /* @__PURE__ */ c(ii, { variant: "destructive", className: "ml-2 h-4 w-4 p-0" })
10725
10728
  ] }) }),
10726
10729
  /* @__PURE__ */ E(Ss, { className: "w-[500px] sm:w-[600px] overflow-y-auto", children: [
10727
- /* @__PURE__ */ E(Ml, { children: [
10728
- /* @__PURE__ */ c(kl, { children: "Chat Settings" }),
10730
+ /* @__PURE__ */ E(kl, { children: [
10731
+ /* @__PURE__ */ c(Ml, { children: "Chat Settings" }),
10729
10732
  /* @__PURE__ */ c(Dl, { children: "Configure your chat interface, API connection, and behavior preferences." })
10730
10733
  ] }),
10731
10734
  /* @__PURE__ */ E("div", { className: "space-y-6 py-6", children: [