teodor-new-chat-ui 3.0.4 → 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
  )
@@ -3574,7 +3579,7 @@ function Gp({ issues: e }) {
3574
3579
  ] }, n.key);
3575
3580
  }) });
3576
3581
  }
3577
- const Mt = 1e4;
3582
+ const kt = 1e4;
3578
3583
  function qp(e) {
3579
3584
  if (typeof e != "string")
3580
3585
  return String(e);
@@ -3602,7 +3607,7 @@ function qp(e) {
3602
3607
  `).replace(/<li>(.*?)<\/li>/gi, `- $1
3603
3608
  `).trim() : n.replace(/</g, "&lt;").replace(/>/g, "&gt;").trim();
3604
3609
  }
3605
- function Xp(e, t = Mt) {
3610
+ function Xp(e, t = kt) {
3606
3611
  if (!e || typeof e != "string")
3607
3612
  throw new Error("Invalid content: must be a non-empty string");
3608
3613
  if (e.length > t)
@@ -3691,11 +3696,11 @@ var Qp = "DismissableLayer", wo = "dismissableLayer.update", eh = "dismissableLa
3691
3696
  onDismiss: i,
3692
3697
  ...l
3693
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) => {
3694
- 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));
3695
3700
  !C || L || (o == null || o(N), a == null || a(N), N.defaultPrevented || i == null || i());
3696
3701
  }, m), _ = sh((N) => {
3697
- const M = N.target;
3698
- [...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());
3699
3704
  }, m);
3700
3705
  return Zp((N) => {
3701
3706
  x === f.layers.size - 1 && (r == null || r(N), !N.defaultPrevented && i && (N.preventDefault(), i()));
@@ -3934,7 +3939,7 @@ function sa(e, t) {
3934
3939
  function fh(e) {
3935
3940
  return e.filter((t) => t.tagName !== "A");
3936
3941
  }
3937
- 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) => ({
3938
3943
  x: e,
3939
3944
  y: e
3940
3945
  }), hh = {
@@ -3947,7 +3952,7 @@ const ph = ["top", "right", "bottom", "left"], dt = Math.min, Me = Math.max, er
3947
3952
  end: "start"
3948
3953
  };
3949
3954
  function yo(e, t, n) {
3950
- return Me(e, dt(t, n));
3955
+ return ke(e, dt(t, n));
3951
3956
  }
3952
3957
  function rt(e, t) {
3953
3958
  return typeof e == "function" ? e(t) : e;
@@ -4218,12 +4223,12 @@ const Nh = (e) => ({
4218
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));
4219
4224
  let N = _ ? _[y] : 0;
4220
4225
  (!N || !await (a.isElement == null ? void 0 : a.isElement(_))) && (N = i.floating[y] || s.floating[g]);
4221
- 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;
4222
4227
  return {
4223
4228
  [v]: m[v] + G,
4224
4229
  data: {
4225
4230
  [v]: H,
4226
- centerOffset: k - H - G,
4231
+ centerOffset: M - H - G,
4227
4232
  ...O && {
4228
4233
  alignmentOffset: G
4229
4234
  }
@@ -4257,24 +4262,24 @@ const Nh = (e) => ({
4257
4262
  return {};
4258
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";
4259
4264
  !m && _ && R.push(...Sh(i, h, g, C));
4260
- const N = [i, ...R], M = await sn(t, b), L = [];
4265
+ const N = [i, ...R], k = await sn(t, b), L = [];
4261
4266
  let P = ((r = s.flip) == null ? void 0 : r.overflows) || [];
4262
- if (d && L.push(M[w]), p) {
4263
- const k = bh(o, a, C);
4264
- 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]]);
4265
4270
  }
4266
4271
  if (P = [...P, {
4267
4272
  placement: o,
4268
4273
  overflows: L
4269
- }], !L.every((k) => k <= 0)) {
4274
+ }], !L.every((M) => M <= 0)) {
4270
4275
  var $, K;
4271
- 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];
4272
4277
  if (H && (!(p === "alignment" ? x !== Ye(H) : !1) || // We leave the current main axis only if every placement on that axis
4273
4278
  // overflows the main axis.
4274
4279
  P.every((D) => Ye(D.placement) === x ? D.overflows[0] > 0 : !0)))
4275
4280
  return {
4276
4281
  data: {
4277
- index: k,
4282
+ index: M,
4278
4283
  overflows: P
4279
4284
  },
4280
4285
  reset: {
@@ -4535,14 +4540,14 @@ const Ph = function(e) {
4535
4540
  let b, w;
4536
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");
4537
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;
4538
- let N = C, M = R;
4539
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = x), _ && !m) {
4540
- const P = Me(d.left, 0), $ = Me(d.right, 0), K = Me(d.top, 0), B = Me(d.bottom, 0);
4541
- 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));
4542
4547
  }
4543
4548
  await l({
4544
4549
  ...t,
4545
- availableWidth: M,
4550
+ availableWidth: k,
4546
4551
  availableHeight: N
4547
4552
  });
4548
4553
  const L = await a.getDimensions(i.floating);
@@ -4560,7 +4565,7 @@ function wr() {
4560
4565
  function Kt(e) {
4561
4566
  return vi(e) ? (e.nodeName || "").toLowerCase() : "#document";
4562
4567
  }
4563
- function ke(e) {
4568
+ function Me(e) {
4564
4569
  var t;
4565
4570
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
4566
4571
  }
@@ -4569,18 +4574,18 @@ function Qe(e) {
4569
4574
  return (t = (vi(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
4570
4575
  }
4571
4576
  function vi(e) {
4572
- return wr() ? e instanceof Node || e instanceof ke(e).Node : !1;
4577
+ return wr() ? e instanceof Node || e instanceof Me(e).Node : !1;
4573
4578
  }
4574
4579
  function ze(e) {
4575
- return wr() ? e instanceof Element || e instanceof ke(e).Element : !1;
4580
+ return wr() ? e instanceof Element || e instanceof Me(e).Element : !1;
4576
4581
  }
4577
4582
  function Ze(e) {
4578
- return wr() ? e instanceof HTMLElement || e instanceof ke(e).HTMLElement : !1;
4583
+ return wr() ? e instanceof HTMLElement || e instanceof Me(e).HTMLElement : !1;
4579
4584
  }
4580
4585
  function da(e) {
4581
- 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;
4582
4587
  }
4583
- const Mh = /* @__PURE__ */ new Set(["inline", "contents"]);
4588
+ const kh = /* @__PURE__ */ new Set(["inline", "contents"]);
4584
4589
  function vn(e) {
4585
4590
  const {
4586
4591
  overflow: t,
@@ -4588,11 +4593,11 @@ function vn(e) {
4588
4593
  overflowY: r,
4589
4594
  display: o
4590
4595
  } = We(e);
4591
- 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);
4592
4597
  }
4593
- const kh = /* @__PURE__ */ new Set(["table", "td", "th"]);
4598
+ const Mh = /* @__PURE__ */ new Set(["table", "td", "th"]);
4594
4599
  function Dh(e) {
4595
- return kh.has(Kt(e));
4600
+ return Mh.has(Kt(e));
4596
4601
  }
4597
4602
  const Lh = [":popover-open", ":modal"];
4598
4603
  function yr(e) {
@@ -4628,7 +4633,7 @@ function Bt(e) {
4628
4633
  return Hh.has(Kt(e));
4629
4634
  }
4630
4635
  function We(e) {
4631
- return ke(e).getComputedStyle(e);
4636
+ return Me(e).getComputedStyle(e);
4632
4637
  }
4633
4638
  function xr(e) {
4634
4639
  return ze(e) ? {
@@ -4658,7 +4663,7 @@ function wi(e) {
4658
4663
  function an(e, t, n) {
4659
4664
  var r;
4660
4665
  t === void 0 && (t = []), n === void 0 && (n = !0);
4661
- 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);
4662
4667
  if (s) {
4663
4668
  const i = So(a);
4664
4669
  return t.concat(a, a.visualViewport || [], vn(o) ? o : [], i && n ? an(i) : []);
@@ -4698,14 +4703,14 @@ function Dt(e) {
4698
4703
  }
4699
4704
  const zh = /* @__PURE__ */ Je(0);
4700
4705
  function xi(e) {
4701
- const t = ke(e);
4706
+ const t = Me(e);
4702
4707
  return !Zo() || !t.visualViewport ? zh : {
4703
4708
  x: t.visualViewport.offsetLeft,
4704
4709
  y: t.visualViewport.offsetTop
4705
4710
  };
4706
4711
  }
4707
4712
  function Wh(e, t, n) {
4708
- 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;
4709
4714
  }
4710
4715
  function xt(e, t, n, r) {
4711
4716
  t === void 0 && (t = !1), n === void 0 && (n = !1);
@@ -4715,11 +4720,11 @@ function xt(e, t, n, r) {
4715
4720
  const i = Wh(s, n, r) ? xi(s) : Je(0);
4716
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;
4717
4722
  if (s) {
4718
- const m = ke(s), v = r && ze(r) ? ke(r) : r;
4723
+ const m = Me(s), v = r && ze(r) ? Me(r) : r;
4719
4724
  let g = m, h = So(g);
4720
4725
  for (; h && r && v !== g; ) {
4721
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;
4722
- 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);
4723
4728
  }
4724
4729
  }
4725
4730
  return nr({
@@ -4771,10 +4776,10 @@ function jh(e) {
4771
4776
  return Array.from(e.getClientRects());
4772
4777
  }
4773
4778
  function Kh(e) {
4774
- 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);
4775
4780
  let a = -n.scrollLeft + Sr(e);
4776
4781
  const i = -n.scrollTop;
4777
- 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), {
4778
4783
  width: o,
4779
4784
  height: s,
4780
4785
  x: a,
@@ -4783,7 +4788,7 @@ function Kh(e) {
4783
4788
  }
4784
4789
  const fa = 25;
4785
4790
  function Gh(e, t) {
4786
- const n = ke(e), r = Qe(e), o = n.visualViewport;
4791
+ const n = Me(e), r = Qe(e), o = n.visualViewport;
4787
4792
  let s = r.clientWidth, a = r.clientHeight, i = 0, l = 0;
4788
4793
  if (o) {
4789
4794
  s = o.width, a = o.height;
@@ -4857,7 +4862,7 @@ function Jh(e) {
4857
4862
  } = e;
4858
4863
  const a = [...n === "clippingAncestors" ? yr(t) ? [] : Yh(t, this._c) : [].concat(n), r], i = a[0], l = a.reduce((f, d) => {
4859
4864
  const p = pa(t, d, o);
4860
- 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;
4861
4866
  }, pa(t, i, o));
4862
4867
  return {
4863
4868
  width: l.right - l.left,
@@ -4912,7 +4917,7 @@ function ha(e, t) {
4912
4917
  return Qe(e) === n && (n = n.ownerDocument.body), n;
4913
4918
  }
4914
4919
  function Ei(e, t) {
4915
- const n = ke(e);
4920
+ const n = Me(e);
4916
4921
  if (yr(e))
4917
4922
  return n;
4918
4923
  if (!Ze(e)) {
@@ -4978,7 +4983,7 @@ function rm(e, t) {
4978
4983
  return;
4979
4984
  const g = On(p), h = On(o.clientWidth - (d + m)), b = On(o.clientHeight - (p + v)), w = On(d), y = {
4980
4985
  rootMargin: -g + "px " + -h + "px " + -b + "px " + -w + "px",
4981
- threshold: Me(0, dt(1, l)) || 1
4986
+ threshold: ke(0, dt(1, l)) || 1
4982
4987
  };
4983
4988
  let C = !0;
4984
4989
  function R(_) {
@@ -5126,7 +5131,7 @@ function hm(e) {
5126
5131
  D !== _.current && (_.current = D, h(D));
5127
5132
  }, []), y = u.useCallback((D) => {
5128
5133
  D !== N.current && (N.current = D, w(D));
5129
- }, []), 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(() => {
5130
5135
  if (!_.current || !N.current)
5131
5136
  return;
5132
5137
  const D = {
@@ -5143,20 +5148,20 @@ function hm(e) {
5143
5148
  // setting it to `true` when `open === false` (must be specified).
5144
5149
  isPositioned: K.current !== !1
5145
5150
  };
5146
- k.current && !rr(M.current, Q) && (M.current = Q, ur.flushSync(() => {
5151
+ M.current && !rr(k.current, Q) && (k.current = Q, ur.flushSync(() => {
5147
5152
  p(Q);
5148
5153
  }));
5149
5154
  });
5150
5155
  }, [m, t, n, $, K]);
5151
5156
  zn(() => {
5152
- f === !1 && M.current.isPositioned && (M.current.isPositioned = !1, p((D) => ({
5157
+ f === !1 && k.current.isPositioned && (k.current.isPositioned = !1, p((D) => ({
5153
5158
  ...D,
5154
5159
  isPositioned: !1
5155
5160
  })));
5156
5161
  }, [f]);
5157
- const k = u.useRef(!1);
5158
- zn(() => (k.current = !0, () => {
5159
- k.current = !1;
5162
+ const M = u.useRef(!1);
5163
+ zn(() => (M.current = !0, () => {
5164
+ M.current = !1;
5160
5165
  }), []), zn(() => {
5161
5166
  if (C && (_.current = C), R && (N.current = R), C && R) {
5162
5167
  if (P.current)
@@ -5288,7 +5293,7 @@ var es = "Popper", [Pi, Gt] = je(es), [Nm, Ii] = Pi(es), _i = (e) => {
5288
5293
  return /* @__PURE__ */ c(Nm, { scope: t, anchor: r, onAnchorChange: o, children: n });
5289
5294
  };
5290
5295
  _i.displayName = es;
5291
- var Oi = "PopperAnchor", Mi = u.forwardRef(
5296
+ var Oi = "PopperAnchor", ki = u.forwardRef(
5292
5297
  (e, t) => {
5293
5298
  const { __scopePopper: n, virtualRef: r, ...o } = e, s = Ii(Oi, n), a = u.useRef(null), i = ie(t, a), l = u.useRef(null);
5294
5299
  return u.useEffect(() => {
@@ -5297,8 +5302,8 @@ var Oi = "PopperAnchor", Mi = u.forwardRef(
5297
5302
  }), r ? null : /* @__PURE__ */ c(ee.div, { ...o, ref: i });
5298
5303
  }
5299
5304
  );
5300
- Mi.displayName = Oi;
5301
- 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(
5302
5307
  (e, t) => {
5303
5308
  var z, W, ae, j, X, te;
5304
5309
  const {
@@ -5316,12 +5321,12 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5316
5321
  updatePositionStrategy: v = "optimized",
5317
5322
  onPlaced: g,
5318
5323
  ...h
5319
- } = 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 = {
5320
5325
  padding: P,
5321
5326
  boundary: $.filter(Pm),
5322
5327
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
5323
5328
  altBoundary: K
5324
- }, { refs: k, floatingStyles: H, placement: O, isPositioned: G, middlewareData: D } = hm({
5329
+ }, { refs: M, floatingStyles: H, placement: O, isPositioned: G, middlewareData: D } = hm({
5325
5330
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
5326
5331
  strategy: "fixed",
5327
5332
  placement: L,
@@ -5332,7 +5337,7 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5332
5337
  reference: b.anchor
5333
5338
  },
5334
5339
  middleware: [
5335
- gm({ mainAxis: o + M, alignmentAxis: a }),
5340
+ gm({ mainAxis: o + k, alignmentAxis: a }),
5336
5341
  l && bm({
5337
5342
  mainAxis: !0,
5338
5343
  crossAxis: !1,
@@ -5348,7 +5353,7 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5348
5353
  }
5349
5354
  }),
5350
5355
  C && Sm({ element: C, padding: i }),
5351
- Im({ arrowWidth: N, arrowHeight: M }),
5356
+ Im({ arrowWidth: N, arrowHeight: k }),
5352
5357
  m && xm({ strategy: "referenceHidden", ...B })
5353
5358
  ]
5354
5359
  }), [T, Q] = Fi(O), q = ye(g);
@@ -5361,7 +5366,7 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5361
5366
  }, [w]), /* @__PURE__ */ c(
5362
5367
  "div",
5363
5368
  {
5364
- ref: k.setFloating,
5369
+ ref: M.setFloating,
5365
5370
  "data-radix-popper-content-wrapper": "",
5366
5371
  style: {
5367
5372
  ...H,
@@ -5412,7 +5417,7 @@ var ts = "PopperContent", [Rm, Tm] = Pi(ts), ki = u.forwardRef(
5412
5417
  );
5413
5418
  }
5414
5419
  );
5415
- ki.displayName = ts;
5420
+ Mi.displayName = ts;
5416
5421
  var Di = "PopperArrow", Am = {
5417
5422
  top: "bottom",
5418
5423
  right: "left",
@@ -5481,7 +5486,7 @@ function Fi(e) {
5481
5486
  const [t, n = "center"] = e.split("-");
5482
5487
  return [t, n];
5483
5488
  }
5484
- 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) => {
5485
5490
  var i;
5486
5491
  const { container: n, ...r } = e, [o, s] = u.useState(!1);
5487
5492
  we(() => s(!0), []);
@@ -5489,10 +5494,10 @@ var ns = _i, rs = Mi, os = ki, ss = Li, _m = "Portal", Cr = u.forwardRef((e, t)
5489
5494
  return a ? Ed.createPortal(/* @__PURE__ */ c(ee.div, { ...r, ref: t }), a) : null;
5490
5495
  });
5491
5496
  Cr.displayName = _m;
5492
- 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(
5493
5498
  wn,
5494
- [Mm]
5495
- ), [Dm, Lm] = km(wn), Ui = u.forwardRef(
5499
+ [km]
5500
+ ), [Dm, Lm] = Mm(wn), Ui = u.forwardRef(
5496
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 }) }) })
5497
5502
  );
5498
5503
  Ui.displayName = wn;
@@ -5515,9 +5520,9 @@ var Fm = u.forwardRef((e, t) => {
5515
5520
  caller: wn
5516
5521
  }), [w, x] = u.useState(!1), y = ye(f), C = $i(n), R = u.useRef(!1), [_, N] = u.useState(0);
5517
5522
  return u.useEffect(() => {
5518
- const M = m.current;
5519
- if (M)
5520
- 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);
5521
5526
  }, [y]), /* @__PURE__ */ c(
5522
5527
  Dm,
5523
5528
  {
@@ -5527,16 +5532,16 @@ var Fm = u.forwardRef((e, t) => {
5527
5532
  loop: o,
5528
5533
  currentTabStopId: h,
5529
5534
  onItemFocus: u.useCallback(
5530
- (M) => b(M),
5535
+ (k) => b(k),
5531
5536
  [b]
5532
5537
  ),
5533
5538
  onItemShiftTab: u.useCallback(() => x(!0), []),
5534
5539
  onFocusableItemAdd: u.useCallback(
5535
- () => N((M) => M + 1),
5540
+ () => N((k) => k + 1),
5536
5541
  []
5537
5542
  ),
5538
5543
  onFocusableItemRemove: u.useCallback(
5539
- () => N((M) => M - 1),
5544
+ () => N((k) => k - 1),
5540
5545
  []
5541
5546
  ),
5542
5547
  children: /* @__PURE__ */ c(
@@ -5550,11 +5555,11 @@ var Fm = u.forwardRef((e, t) => {
5550
5555
  onMouseDown: U(e.onMouseDown, () => {
5551
5556
  R.current = !0;
5552
5557
  }),
5553
- onFocus: U(e.onFocus, (M) => {
5558
+ onFocus: U(e.onFocus, (k) => {
5554
5559
  const L = !R.current;
5555
- if (M.target === M.currentTarget && L && !w) {
5560
+ if (k.target === k.currentTarget && L && !w) {
5556
5561
  const P = new CustomEvent(ro, Om);
5557
- if (M.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
5562
+ if (k.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
5558
5563
  const $ = C().filter((O) => O.focusable), K = $.find((O) => O.active), B = $.find((O) => O.id === h), H = [K, B, ...$].filter(
5559
5564
  Boolean
5560
5565
  ).map((O) => O.ref.current);
@@ -5658,7 +5663,7 @@ var zm = Ui, Wm = zi, Vm = function(e) {
5658
5663
  return null;
5659
5664
  var t = Array.isArray(e) ? e[0] : e;
5660
5665
  return t.ownerDocument.body;
5661
- }, 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) {
5662
5667
  return e && (e.host || Vi(e.parentNode));
5663
5668
  }, jm = function(e, t) {
5664
5669
  return t.map(function(n) {
@@ -5671,8 +5676,8 @@ var zm = Ui, Wm = zi, Vm = function(e) {
5671
5676
  });
5672
5677
  }, Km = function(e, t, n, r) {
5673
5678
  var o = jm(t, Array.isArray(e) ? e : [e]);
5674
- kn[n] || (kn[n] = /* @__PURE__ */ new WeakMap());
5675
- 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) {
5676
5681
  !p || i.has(p) || (i.add(p), f(p.parentNode));
5677
5682
  };
5678
5683
  o.forEach(f);
@@ -5683,7 +5688,7 @@ var zm = Ui, Wm = zi, Vm = function(e) {
5683
5688
  else
5684
5689
  try {
5685
5690
  var v = m.getAttribute(r), g = v !== null && v !== "false", h = (It.get(m) || 0) + 1, b = (s.get(m) || 0) + 1;
5686
- 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");
5687
5692
  } catch (w) {
5688
5693
  console.error("aria-hidden: cannot operate on ", m, w);
5689
5694
  }
@@ -5692,8 +5697,8 @@ var zm = Ui, Wm = zi, Vm = function(e) {
5692
5697
  return d(t), i.clear(), oo++, function() {
5693
5698
  a.forEach(function(p) {
5694
5699
  var m = It.get(p) - 1, v = s.get(p) - 1;
5695
- It.set(p, m), s.set(p, v), m || (Mn.has(p) || p.removeAttribute(r), Mn.delete(p)), v || p.removeAttribute(n);
5696
- }), 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 = {});
5697
5702
  };
5698
5703
  }, as = function(e, t, n) {
5699
5704
  n === void 0 && (n = "data-aria-hidden");
@@ -6104,10 +6109,10 @@ function Rg(e) {
6104
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";
6105
6110
  if ("touches" in h && N === "h" && _.type === "range")
6106
6111
  return !1;
6107
- var M = wa(N, _);
6108
- if (!M)
6112
+ var k = wa(N, _);
6113
+ if (!k)
6109
6114
  return !0;
6110
- 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)
6111
6116
  return !1;
6112
6117
  if (!r.current && "changedTouches" in h && (y || C) && (r.current = R), !R)
6113
6118
  return !0;
@@ -6179,8 +6184,8 @@ var No = ["Enter", " "], Pg = ["ArrowDown", "PageUp", "Home"], Zi = ["ArrowUp",
6179
6184
  }, Og = {
6180
6185
  ltr: ["ArrowLeft"],
6181
6186
  rtl: ["ArrowRight"]
6182
- }, yn = "Menu", [cn, Mg, kg] = Ko(yn), [Nt, Qi] = je(yn, [
6183
- kg,
6187
+ }, yn = "Menu", [cn, kg, Mg] = Ko(yn), [Nt, Qi] = je(yn, [
6188
+ Mg,
6184
6189
  Gt,
6185
6190
  Bi
6186
6191
  ]), Rr = Gt(), ec = Bi(), [Dg, Rt] = Nt(yn), [Lg, xn] = Nt(yn), tc = (e) => {
@@ -6287,7 +6292,7 @@ var Le = "MenuContent", [Bg, ls] = Nt(Le), oc = u.forwardRef(
6287
6292
  onDismiss: v,
6288
6293
  disableOutsideScroll: g,
6289
6294
  ...h
6290
- } = 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) => {
6291
6296
  var z, W;
6292
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;
6293
6298
  (function ae(j) {
@@ -6371,7 +6376,7 @@ var Le = "MenuContent", [Bg, ls] = Nt(Le), oc = u.forwardRef(
6371
6376
  dir: w.dir,
6372
6377
  ...x,
6373
6378
  ...h,
6374
- ref: M,
6379
+ ref: k,
6375
6380
  style: { outline: "none", ...h.style },
6376
6381
  onKeyDown: U(h.onKeyDown, (T) => {
6377
6382
  const q = T.target.closest("[data-radix-menu-content]") === T.currentTarget, se = T.ctrlKey || T.altKey || T.metaKey, F = T.key.length === 1;
@@ -6388,10 +6393,10 @@ var Le = "MenuContent", [Bg, ls] = Nt(Le), oc = u.forwardRef(
6388
6393
  onPointerMove: U(
6389
6394
  e.onPointerMove,
6390
6395
  ln((T) => {
6391
- const Q = T.target, q = k.current !== T.clientX;
6396
+ const Q = T.target, q = M.current !== T.clientX;
6392
6397
  if (T.currentTarget.contains(Q) && q) {
6393
- const se = T.clientX > k.current ? "right" : "left";
6394
- B.current = se, k.current = T.clientX;
6398
+ const se = T.clientX > M.current ? "right" : "left";
6399
+ B.current = se, M.current = T.clientX;
6395
6400
  }
6396
6401
  })
6397
6402
  )
@@ -6883,11 +6888,11 @@ var Pb = "DropdownMenuItemIndicator", Oc = u.forwardRef((e, t) => {
6883
6888
  return /* @__PURE__ */ c(pb, { ...o, ...r, ref: t });
6884
6889
  });
6885
6890
  Oc.displayName = Pb;
6886
- var Ib = "DropdownMenuSeparator", Mc = u.forwardRef((e, t) => {
6891
+ var Ib = "DropdownMenuSeparator", kc = u.forwardRef((e, t) => {
6887
6892
  const { __scopeDropdownMenu: n, ...r } = e, o = Ee(n);
6888
6893
  return /* @__PURE__ */ c(hb, { ...o, ...r, ref: t });
6889
6894
  });
6890
- Mc.displayName = Ib;
6895
+ kc.displayName = Ib;
6891
6896
  var _b = "DropdownMenuArrow", Ob = u.forwardRef(
6892
6897
  (e, t) => {
6893
6898
  const { __scopeDropdownMenu: n, ...r } = e, o = Ee(n);
@@ -6895,12 +6900,12 @@ var _b = "DropdownMenuArrow", Ob = u.forwardRef(
6895
6900
  }
6896
6901
  );
6897
6902
  Ob.displayName = _b;
6898
- var Mb = "DropdownMenuSubTrigger", kc = u.forwardRef((e, t) => {
6903
+ var kb = "DropdownMenuSubTrigger", Mc = u.forwardRef((e, t) => {
6899
6904
  const { __scopeDropdownMenu: n, ...r } = e, o = Ee(n);
6900
6905
  return /* @__PURE__ */ c(gb, { ...o, ...r, ref: t });
6901
6906
  });
6902
- kc.displayName = Mb;
6903
- var kb = "DropdownMenuSubContent", Dc = u.forwardRef((e, t) => {
6907
+ Mc.displayName = kb;
6908
+ var Mb = "DropdownMenuSubContent", Dc = u.forwardRef((e, t) => {
6904
6909
  const { __scopeDropdownMenu: n, ...r } = e, o = Ee(n);
6905
6910
  return /* @__PURE__ */ c(
6906
6911
  bb,
@@ -6919,8 +6924,8 @@ var kb = "DropdownMenuSubContent", Dc = u.forwardRef((e, t) => {
6919
6924
  }
6920
6925
  );
6921
6926
  });
6922
- Dc.displayName = kb;
6923
- 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;
6924
6929
  const $b = Db, Bb = Lb, Ub = u.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ E(
6925
6930
  Wc,
6926
6931
  {
@@ -7058,10 +7063,10 @@ function jn({
7058
7063
  navigateToCheckpoint: R,
7059
7064
  returnToLatest: _,
7060
7065
  hasMoreHistory: N,
7061
- isLoadingHistory: M,
7066
+ isLoadingHistory: k,
7062
7067
  loadOlderMessages: L,
7063
7068
  api: P
7064
- } = 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");
7065
7070
  ge(() => {
7066
7071
  const I = () => {
7067
7072
  const J = window.innerWidth;
@@ -7095,7 +7100,7 @@ function jn({
7095
7100
  y && te(y);
7096
7101
  }, [y]);
7097
7102
  const At = ve(async () => {
7098
- if (!N || M) return;
7103
+ if (!N || k) return;
7099
7104
  const I = he.current;
7100
7105
  if (!I) return;
7101
7106
  const J = I.scrollHeight, le = I.scrollTop;
@@ -7117,7 +7122,7 @@ function jn({
7117
7122
  Ce.current = at <= 32, Oe.current = !1;
7118
7123
  });
7119
7124
  }
7120
- }, [N, M, L]);
7125
+ }, [N, k, L]);
7121
7126
  ge(() => {
7122
7127
  const I = he.current;
7123
7128
  if (!I) return;
@@ -7148,8 +7153,8 @@ function jn({
7148
7153
  b && !ce && (p == null || p(b));
7149
7154
  }, [b, ce, p]);
7150
7155
  const Hr = (I) => {
7151
- if (I.length > Mt)
7152
- return `Message too long (${I.length}/${Mt} characters)`;
7156
+ if (I.length > kt)
7157
+ return `Message too long (${I.length}/${kt} characters)`;
7153
7158
  try {
7154
7159
  return Yp(I), null;
7155
7160
  } catch (J) {
@@ -7174,18 +7179,18 @@ function jn({
7174
7179
  }
7175
7180
  }
7176
7181
  try {
7177
- 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");
7178
7183
  } catch (J) {
7179
7184
  const le = (J == null ? void 0 : J.message) || "Failed to send message";
7180
7185
  O(le), p == null || p(le);
7181
7186
  }
7182
7187
  }
7183
7188
  }, zr = (I, J) => {
7184
- i && (k(I), K(J), O(null), setTimeout(() => {
7189
+ i && (M(I), K(J), O(null), setTimeout(() => {
7185
7190
  de.current && (de.current.focus(), de.current.style.height = "auto", de.current.style.height = de.current.scrollHeight + "px");
7186
7191
  }, 0));
7187
7192
  }, Yt = () => {
7188
- 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");
7189
7194
  }, En = (I) => {
7190
7195
  I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), Cn()) : I.key === "Escape" && B && (I.preventDefault(), Yt());
7191
7196
  }, oe = (I) => {
@@ -7262,7 +7267,7 @@ function jn({
7262
7267
  style: r ? { maxHeight: r } : void 0,
7263
7268
  children: [
7264
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: [
7265
- (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" }),
7266
7271
  v.map((I, J) => /* @__PURE__ */ c(
7267
7272
  Lp,
7268
7273
  {
@@ -7406,7 +7411,7 @@ function jn({
7406
7411
  placeholder: B ? "Edit your message..." : t,
7407
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 || ""}`,
7408
7413
  disabled: !1,
7409
- maxLength: Mt,
7414
+ maxLength: kt,
7410
7415
  rows: 1
7411
7416
  }
7412
7417
  ) }),
@@ -7434,10 +7439,10 @@ function jn({
7434
7439
  }
7435
7440
  ) })
7436
7441
  ] }),
7437
- $.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: [
7438
7443
  $.length,
7439
7444
  "/",
7440
- Mt
7445
+ kt
7441
7446
  ] })
7442
7447
  ] })
7443
7448
  ] });
@@ -7471,7 +7476,7 @@ var hs = "ScrollArea", [Kc, zy] = je(hs), [Gb, Fe] = Kc(hs), Gc = u.forwardRef(
7471
7476
  dir: o,
7472
7477
  scrollHideDelay: s = 600,
7473
7478
  ...a
7474
- } = 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);
7475
7480
  return /* @__PURE__ */ c(
7476
7481
  Gb,
7477
7482
  {
@@ -7491,7 +7496,7 @@ var hs = "ScrollArea", [Kc, zy] = je(hs), [Gb, Fe] = Kc(hs), Gc = u.forwardRef(
7491
7496
  scrollbarY: h,
7492
7497
  onScrollbarYChange: b,
7493
7498
  scrollbarYEnabled: N,
7494
- onScrollbarYEnabledChange: M,
7499
+ onScrollbarYEnabledChange: k,
7495
7500
  onCornerWidthChange: x,
7496
7501
  onCornerHeightChange: C,
7497
7502
  children: /* @__PURE__ */ c(
@@ -7794,7 +7799,7 @@ var qb = u.forwardRef((e, t) => {
7794
7799
  onResize: p,
7795
7800
  ...m
7796
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);
7797
- function M(L) {
7802
+ function k(L) {
7798
7803
  if (w.current) {
7799
7804
  const P = L.clientX - w.current.left, $ = L.clientY - w.current.top;
7800
7805
  f({ x: P, y: $ });
@@ -7823,9 +7828,9 @@ var qb = u.forwardRef((e, t) => {
7823
7828
  ref: b,
7824
7829
  style: { position: "absolute", ...m.style },
7825
7830
  onPointerDown: U(e.onPointerDown, (L) => {
7826
- 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));
7827
7832
  }),
7828
- onPointerMove: U(e.onPointerMove, M),
7833
+ onPointerMove: U(e.onPointerMove, k),
7829
7834
  onPointerUp: U(e.onPointerUp, (L) => {
7830
7835
  const P = L.target;
7831
7836
  P.hasPointerCapture(L.pointerId) && P.releasePointerCapture(L.pointerId), document.body.style.webkitUserSelect = x.current, v.viewport && (v.viewport.style.scrollBehavior = ""), w.current = null;
@@ -8022,11 +8027,11 @@ function Ao({
8022
8027
  createThread: h,
8023
8028
  deleteThread: b,
8024
8029
  renameThread: w
8025
- } = 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);
8026
8031
  ge(() => {
8027
8032
  y(m ?? []);
8028
8033
  }, [m]);
8029
- const k = async (F) => {
8034
+ const M = async (F) => {
8030
8035
  try {
8031
8036
  await p(F), i == null || i(F), l == null || l(F);
8032
8037
  } catch (V) {
@@ -8095,11 +8100,11 @@ function Ao({
8095
8100
  ] }) : x.slice().sort((F, V) => new Date(V.updatedAt || V.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ E(
8096
8101
  "div",
8097
8102
  {
8098
- onClick: () => k(F.threadId),
8103
+ onClick: () => M(F.threadId),
8099
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`,
8100
8105
  children: [
8101
8106
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
8102
- /* @__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: [
8103
8108
  /* @__PURE__ */ c(un, { value: P, onChange: (V) => $(V.target.value), onKeyDown: (V) => Q(V, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
8104
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 }) }),
8105
8110
  /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: T, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(tn, { size: 12 }) })
@@ -8111,7 +8116,7 @@ function Ao({
8111
8116
  ] })
8112
8117
  ] }) }),
8113
8118
  /* @__PURE__ */ E("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
8114
- 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 }) }),
8115
8120
  n && /* @__PURE__ */ c(
8116
8121
  fe,
8117
8122
  {
@@ -8531,7 +8536,7 @@ const Iv = fn(
8531
8536
  )
8532
8537
  ] }));
8533
8538
  Ss.displayName = Al.displayName;
8534
- const Ml = ({
8539
+ const kl = ({
8535
8540
  className: e,
8536
8541
  ...t
8537
8542
  }) => /* @__PURE__ */ c(
@@ -8544,8 +8549,8 @@ const Ml = ({
8544
8549
  ...t
8545
8550
  }
8546
8551
  );
8547
- Ml.displayName = "SheetHeader";
8548
- 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(
8549
8554
  Pl,
8550
8555
  {
8551
8556
  ref: n,
@@ -8553,7 +8558,7 @@ const kl = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8553
8558
  ...t
8554
8559
  }
8555
8560
  ));
8556
- kl.displayName = Pl.displayName;
8561
+ Ml.displayName = Pl.displayName;
8557
8562
  const Dl = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8558
8563
  Il,
8559
8564
  {
@@ -8600,10 +8605,10 @@ var Ll = Object.freeze({
8600
8605
  Fl.displayName = _v;
8601
8606
  var Ov = Fl, [Or, Xy] = je("Tooltip", [
8602
8607
  Gt
8603
- ]), 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) => {
8604
8609
  const {
8605
8610
  __scopeTooltip: t,
8606
- delayDuration: n = Mv,
8611
+ delayDuration: n = kv,
8607
8612
  skipDelayDuration: r = 300,
8608
8613
  disableHoverableContent: o = !1,
8609
8614
  children: s
@@ -8612,7 +8617,7 @@ var Ov = Fl, [Or, Xy] = je("Tooltip", [
8612
8617
  const f = l.current;
8613
8618
  return () => window.clearTimeout(f);
8614
8619
  }, []), /* @__PURE__ */ c(
8615
- kv,
8620
+ Mv,
8616
8621
  {
8617
8622
  scope: t,
8618
8623
  isOpenDelayedRef: a,
@@ -8636,7 +8641,7 @@ var Ov = Fl, [Or, Xy] = je("Tooltip", [
8636
8641
  );
8637
8642
  };
8638
8643
  Bl.displayName = $l;
8639
- var dn = "Tooltip", [Dv, kr] = Or(dn), Ul = (e) => {
8644
+ var dn = "Tooltip", [Dv, Mr] = Or(dn), Ul = (e) => {
8640
8645
  const {
8641
8646
  __scopeTooltip: t,
8642
8647
  children: n,
@@ -8645,7 +8650,7 @@ var dn = "Tooltip", [Dv, kr] = Or(dn), Ul = (e) => {
8645
8650
  onOpenChange: s,
8646
8651
  disableHoverableContent: a,
8647
8652
  delayDuration: i
8648
- } = 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({
8649
8654
  prop: r,
8650
8655
  defaultProp: o ?? !1,
8651
8656
  onChange: (N) => {
@@ -8688,7 +8693,7 @@ var dn = "Tooltip", [Dv, kr] = Or(dn), Ul = (e) => {
8688
8693
  Ul.displayName = dn;
8689
8694
  var Io = "TooltipTrigger", Hl = u.forwardRef(
8690
8695
  (e, t) => {
8691
- 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, []);
8692
8697
  return u.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(rs, { asChild: !0, ...a, children: /* @__PURE__ */ c(
8693
8698
  ee.button,
8694
8699
  {
@@ -8719,11 +8724,11 @@ var Lv = "TooltipPortal", [Yy, Fv] = Or(Lv, {
8719
8724
  forceMount: void 0
8720
8725
  }), Ht = "TooltipContent", zl = u.forwardRef(
8721
8726
  (e, t) => {
8722
- 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);
8723
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 }) });
8724
8729
  }
8725
8730
  ), $v = u.forwardRef((e, t) => {
8726
- 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(() => {
8727
8732
  i(null), p(!1);
8728
8733
  }, [p]), v = u.useCallback(
8729
8734
  (g, h) => {
@@ -8757,7 +8762,7 @@ var Lv = "TooltipPortal", [Yy, Fv] = Or(Lv, {
8757
8762
  onEscapeKeyDown: s,
8758
8763
  onPointerDownOutside: a,
8759
8764
  ...i
8760
- } = e, l = kr(Ht, n), f = Mr(n), { onClose: d } = l;
8765
+ } = e, l = Mr(Ht, n), f = kr(n), { onClose: d } = l;
8761
8766
  return u.useEffect(() => (document.addEventListener(Po, d), () => document.removeEventListener(Po, d)), [d]), u.useEffect(() => {
8762
8767
  if (l.trigger) {
8763
8768
  const p = (m) => {
@@ -8803,7 +8808,7 @@ var Lv = "TooltipPortal", [Yy, Fv] = Or(Lv, {
8803
8808
  zl.displayName = Ht;
8804
8809
  var Vl = "TooltipArrow", zv = u.forwardRef(
8805
8810
  (e, t) => {
8806
- const { __scopeTooltip: n, ...r } = e, o = Mr(n);
8811
+ const { __scopeTooltip: n, ...r } = e, o = kr(n);
8807
8812
  return Uv(
8808
8813
  Vl,
8809
8814
  n
@@ -9627,7 +9632,7 @@ var Rw = [" ", "Enter", "ArrowUp", "ArrowDown"], Tw = [" ", "Enter"], Ct = "Sele
9627
9632
  disabled: m,
9628
9633
  required: v,
9629
9634
  form: g
9630
- } = 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({
9631
9636
  prop: r,
9632
9637
  defaultProp: o ?? !1,
9633
9638
  onChange: s,
@@ -9637,7 +9642,7 @@ var Rw = [" ", "Enter", "ArrowUp", "ArrowDown"], Tw = [" ", "Enter"], Ct = "Sele
9637
9642
  defaultProp: i,
9638
9643
  onChange: l,
9639
9644
  caller: Ct
9640
- }), $ = 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(";");
9641
9646
  return /* @__PURE__ */ c(ns, { ...h, children: /* @__PURE__ */ E(
9642
9647
  Pw,
9643
9648
  {
@@ -9653,7 +9658,7 @@ var Rw = [" ", "Enter", "ArrowUp", "ArrowDown"], Tw = [" ", "Enter"], Ct = "Sele
9653
9658
  value: L,
9654
9659
  onValueChange: P,
9655
9660
  open: N,
9656
- onOpenChange: M,
9661
+ onOpenChange: k,
9657
9662
  dir: _,
9658
9663
  triggerPointerDownPosRef: $,
9659
9664
  disabled: m,
@@ -9663,10 +9668,10 @@ var Rw = [" ", "Enter", "ArrowUp", "ArrowDown"], Tw = [" ", "Enter"], Ct = "Sele
9663
9668
  {
9664
9669
  scope: e.__scopeSelect,
9665
9670
  onNativeOptionAdd: u.useCallback((O) => {
9666
- k((G) => new Set(G).add(O));
9671
+ M((G) => new Set(G).add(O));
9667
9672
  }, []),
9668
9673
  onNativeOptionRemove: u.useCallback((O) => {
9669
- k((G) => {
9674
+ M((G) => {
9670
9675
  const D = new Set(G);
9671
9676
  return D.delete(O), D;
9672
9677
  });
@@ -9766,8 +9771,8 @@ var Ow = "SelectIcon", yu = u.forwardRef(
9766
9771
  }
9767
9772
  );
9768
9773
  yu.displayName = Ow;
9769
- var Mw = "SelectPortal", xu = (e) => /* @__PURE__ */ c(Cr, { asChild: !0, ...e });
9770
- xu.displayName = Mw;
9774
+ var kw = "SelectPortal", xu = (e) => /* @__PURE__ */ c(Cr, { asChild: !0, ...e });
9775
+ xu.displayName = kw;
9771
9776
  var Et = "SelectContent", Su = u.forwardRef(
9772
9777
  (e, t) => {
9773
9778
  const n = pt(Et, e.__scopeSelect), [r, o] = u.useState();
@@ -9784,7 +9789,7 @@ var Et = "SelectContent", Su = u.forwardRef(
9784
9789
  }
9785
9790
  );
9786
9791
  Su.displayName = Et;
9787
- 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(
9788
9793
  (e, t) => {
9789
9794
  const {
9790
9795
  __scopeSelect: n,
@@ -9806,9 +9811,9 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9806
9811
  avoidCollisions: b,
9807
9812
  //
9808
9813
  ...w
9809
- } = 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(
9810
9815
  null
9811
- ), 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);
9812
9817
  u.useEffect(() => {
9813
9818
  if (y) return as(y);
9814
9819
  }, [y]), Go();
@@ -9820,8 +9825,8 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9820
9825
  },
9821
9826
  [K, R]
9822
9827
  ), G = u.useCallback(
9823
- () => O([M, y]),
9824
- [O, M, y]
9828
+ () => O([k, y]),
9829
+ [O, k, y]
9825
9830
  );
9826
9831
  u.useEffect(() => {
9827
9832
  B && G();
@@ -9884,7 +9889,7 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9884
9889
  viewport: R,
9885
9890
  onViewportChange: _,
9886
9891
  itemRefCallback: se,
9887
- selectedItem: M,
9892
+ selectedItem: k,
9888
9893
  onItemLeave: F,
9889
9894
  itemTextRefCallback: V,
9890
9895
  focusSelectedItem: G,
@@ -9923,7 +9928,7 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9923
9928
  onContextMenu: (z) => z.preventDefault(),
9924
9929
  ...w,
9925
9930
  ...pe,
9926
- onPlaced: () => k(!0),
9931
+ onPlaced: () => M(!0),
9927
9932
  ref: N,
9928
9933
  style: {
9929
9934
  // flex layout so we can place the scroll buttons properly
@@ -9954,13 +9959,13 @@ var Ue = 10, [Cu, ht] = qt(Et), kw = "SelectContentImpl", Dw = Ft("SelectContent
9954
9959
  );
9955
9960
  }
9956
9961
  );
9957
- Eu.displayName = kw;
9962
+ Eu.displayName = Mw;
9958
9963
  var Lw = "SelectItemAlignedPosition", Nu = u.forwardRef((e, t) => {
9959
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(() => {
9960
9965
  if (s.trigger && s.valueNode && i && f && h && b && w) {
9961
- 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();
9962
9967
  if (s.dir !== "rtl") {
9963
- 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, [
9964
9969
  Ue,
9965
9970
  // Prevents the content from going off the starting edge of the
9966
9971
  // viewport. It may still go off the ending edge, but this can be
@@ -9971,13 +9976,13 @@ var Lw = "SelectItemAlignedPosition", Nu = u.forwardRef((e, t) => {
9971
9976
  ]);
9972
9977
  i.style.minWidth = de + "px", i.style.left = he + "px";
9973
9978
  } else {
9974
- 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, [
9975
9980
  Ue,
9976
9981
  Math.max(Ue, Y - Z)
9977
9982
  ]);
9978
9983
  i.style.minWidth = de + "px", i.style.right = he + "px";
9979
9984
  }
9980
- 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;
9981
9986
  if (W <= V) {
9982
9987
  const X = $.length > 0 && b === $[$.length - 1].ref.current;
9983
9988
  i.style.bottom = "0px";
@@ -10261,15 +10266,15 @@ var en = "SelectItemText", Ou = u.forwardRef(
10261
10266
  }
10262
10267
  );
10263
10268
  Ou.displayName = en;
10264
- var Mu = "SelectItemIndicator", ku = u.forwardRef(
10269
+ var ku = "SelectItemIndicator", Mu = u.forwardRef(
10265
10270
  (e, t) => {
10266
10271
  const { __scopeSelect: n, ...r } = e;
10267
- 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;
10268
10273
  }
10269
10274
  );
10270
- ku.displayName = Mu;
10271
- var Mo = "SelectScrollUpButton", Du = u.forwardRef((e, t) => {
10272
- 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);
10273
10278
  return we(() => {
10274
10279
  if (n.viewport && n.isPositioned) {
10275
10280
  let i = function() {
@@ -10291,9 +10296,9 @@ var Mo = "SelectScrollUpButton", Du = u.forwardRef((e, t) => {
10291
10296
  }
10292
10297
  ) : null;
10293
10298
  });
10294
- Du.displayName = Mo;
10295
- var ko = "SelectScrollDownButton", Lu = u.forwardRef((e, t) => {
10296
- 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);
10297
10302
  return we(() => {
10298
10303
  if (n.viewport && n.isPositioned) {
10299
10304
  let i = function() {
@@ -10315,7 +10320,7 @@ var ko = "SelectScrollDownButton", Lu = u.forwardRef((e, t) => {
10315
10320
  }
10316
10321
  ) : null;
10317
10322
  });
10318
- Lu.displayName = ko;
10323
+ Lu.displayName = Mo;
10319
10324
  var Fu = u.forwardRef((e, t) => {
10320
10325
  const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = ht("SelectScrollButton", n), a = u.useRef(null), i = $r(n), l = u.useCallback(() => {
10321
10326
  a.current !== null && (window.clearInterval(a.current), a.current = null);
@@ -10412,7 +10417,7 @@ function zu(e, t, n) {
10412
10417
  function Kw(e, t) {
10413
10418
  return e.map((n, r) => e[(t + r) % e.length]);
10414
10419
  }
10415
- 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;
10416
10421
  const Ta = Gw, Aa = qw, Lo = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
10417
10422
  Wu,
10418
10423
  {
@@ -10424,7 +10429,7 @@ const Ta = Gw, Aa = qw, Lo = u.forwardRef(({ className: e, children: t, ...n },
10424
10429
  ...n,
10425
10430
  children: [
10426
10431
  t,
10427
- /* @__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" }) })
10428
10433
  ]
10429
10434
  }
10430
10435
  ));
@@ -10451,7 +10456,7 @@ const Ju = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10451
10456
  e
10452
10457
  ),
10453
10458
  ...t,
10454
- children: /* @__PURE__ */ c(kt, { className: "h-4 w-4" })
10459
+ children: /* @__PURE__ */ c(Mt, { className: "h-4 w-4" })
10455
10460
  }
10456
10461
  ));
10457
10462
  Ju.displayName = qu.displayName;
@@ -10722,8 +10727,8 @@ function ex({ settings: e, onSettingsChange: t, className: n = "" }) {
10722
10727
  f && /* @__PURE__ */ c(ii, { variant: "destructive", className: "ml-2 h-4 w-4 p-0" })
10723
10728
  ] }) }),
10724
10729
  /* @__PURE__ */ E(Ss, { className: "w-[500px] sm:w-[600px] overflow-y-auto", children: [
10725
- /* @__PURE__ */ E(Ml, { children: [
10726
- /* @__PURE__ */ c(kl, { children: "Chat Settings" }),
10730
+ /* @__PURE__ */ E(kl, { children: [
10731
+ /* @__PURE__ */ c(Ml, { children: "Chat Settings" }),
10727
10732
  /* @__PURE__ */ c(Dl, { children: "Configure your chat interface, API connection, and behavior preferences." })
10728
10733
  ] }),
10729
10734
  /* @__PURE__ */ E("div", { className: "space-y-6 py-6", children: [