teodor-new-chat-ui 3.0.185 → 3.0.186

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
@@ -2,7 +2,7 @@ var vp = Object.defineProperty;
2
2
  var wp = (e, t, n) => t in e ? vp(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Oa = (e, t, n) => wp(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as p from "react";
5
- import B, { useState as me, useRef as rt, useCallback as Ye, useEffect as ct, useReducer as bp, useMemo as Gt, createContext as yp, useContext as Sp, createElement as co, useLayoutEffect as Cp } from "react";
5
+ import B, { useState as me, useRef as rt, useCallback as Ye, useEffect as ct, useReducer as bp, useMemo as qt, createContext as yp, useContext as Sp, createElement as co, useLayoutEffect as Cp } from "react";
6
6
  import { Square as Tp, Send as Rp, X as rr, ExternalLink as kp, Download as Ep, Image as Ip, FileText as Ma, Loader as gc, Bot as Da, Wrench as Np, User as Ap, Paperclip as ni, ChevronUp as kr, ChevronDown as nr, Copy as La, Edit as $a, RotateCcw as ri, ChevronRight as _p, Check as Mi, Circle as jp, Edit3 as xc, Loader2 as Pp, Plus as Op, FileSpreadsheet as Mp, MessageSquarePlus as Dp, MessageSquare as Lp, Calendar as $p, Trash2 as Fp, Settings as zp, Server as Bp, EyeOff as Hp, Eye as Up, Layout as Wp, MessageCircle as Vp, Save as Kp } from "lucide-react";
7
7
  import { Slot as qp, createSlot as lr } from "@radix-ui/react-slot";
8
8
  import { cva as qo } from "class-variance-authority";
@@ -66,8 +66,8 @@ function Jp() {
66
66
  {
67
67
  var Se = x.ReactDebugCurrentFrame, Ve = Se.getStackAddendum();
68
68
  Ve !== "" && (U += "%s", ne = ne.concat([Ve]));
69
- var Ge = ne.map(function(Fe) {
70
- return String(Fe);
69
+ var Ge = ne.map(function(ze) {
70
+ return String(ze);
71
71
  });
72
72
  Ge.unshift("Warning: " + U), Function.prototype.apply.call(console[T], console, Ge);
73
73
  }
@@ -126,9 +126,9 @@ function Jp() {
126
126
  var Se = T.displayName || null;
127
127
  return Se !== null ? Se : V(T.type) || "Memo";
128
128
  case h: {
129
- var Ve = T, Ge = Ve._payload, Fe = Ve._init;
129
+ var Ve = T, Ge = Ve._payload, ze = Ve._init;
130
130
  try {
131
- return V(Fe(Ge));
131
+ return V(ze(Ge));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -136,14 +136,14 @@ function Jp() {
136
136
  }
137
137
  return null;
138
138
  }
139
- var P = Object.assign, G = 0, W, K, D, O, ie, Z, ee;
139
+ var P = Object.assign, G = 0, W, K, D, O, ie, J, ee;
140
140
  function M() {
141
141
  }
142
142
  M.__reactDisabledLog = !0;
143
- function J() {
143
+ function Z() {
144
144
  {
145
145
  if (G === 0) {
146
- W = console.log, K = console.info, D = console.warn, O = console.error, ie = console.group, Z = console.groupCollapsed, ee = console.groupEnd;
146
+ W = console.log, K = console.info, D = console.warn, O = console.error, ie = console.group, J = console.groupCollapsed, ee = console.groupEnd;
147
147
  var T = {
148
148
  configurable: !0,
149
149
  enumerable: !0,
@@ -188,7 +188,7 @@ function Jp() {
188
188
  value: ie
189
189
  }),
190
190
  groupCollapsed: P({}, T, {
191
- value: Z
191
+ value: J
192
192
  }),
193
193
  groupEnd: P({}, T, {
194
194
  value: ee
@@ -230,30 +230,30 @@ function Jp() {
230
230
  var Ve = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
232
232
  var Ge;
233
- Ge = fe.current, fe.current = null, J();
233
+ Ge = fe.current, fe.current = null, Z();
234
234
  try {
235
235
  if (U) {
236
- var Fe = function() {
236
+ var ze = function() {
237
237
  throw Error();
238
238
  };
239
- if (Object.defineProperty(Fe.prototype, "props", {
239
+ if (Object.defineProperty(ze.prototype, "props", {
240
240
  set: function() {
241
241
  throw Error();
242
242
  }
243
243
  }), typeof Reflect == "object" && Reflect.construct) {
244
244
  try {
245
- Reflect.construct(Fe, []);
245
+ Reflect.construct(ze, []);
246
246
  } catch (kt) {
247
247
  Se = kt;
248
248
  }
249
- Reflect.construct(T, [], Fe);
249
+ Reflect.construct(T, [], ze);
250
250
  } else {
251
251
  try {
252
- Fe.call();
252
+ ze.call();
253
253
  } catch (kt) {
254
254
  Se = kt;
255
255
  }
256
- T.call(Fe.prototype);
256
+ T.call(ze.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
@@ -274,9 +274,9 @@ function Jp() {
274
274
  if (ot !== 1 || lt !== 1)
275
275
  do
276
276
  if (ot--, lt--, lt < 0 || Oe[ot] !== St[lt]) {
277
- var $t = `
277
+ var Lt = `
278
278
  ` + Oe[ot].replace(" at new ", " at ");
279
- return T.displayName && $t.includes("<anonymous>") && ($t = $t.replace("<anonymous>", T.displayName)), typeof T == "function" && Q.set(T, $t), $t;
279
+ return T.displayName && Lt.includes("<anonymous>") && (Lt = Lt.replace("<anonymous>", T.displayName)), typeof T == "function" && Q.set(T, Lt), Lt;
280
280
  }
281
281
  while (ot >= 1 && lt >= 0);
282
282
  break;
@@ -335,19 +335,19 @@ function Jp() {
335
335
  function dt(T, U, ne, Se, Ve) {
336
336
  {
337
337
  var Ge = Function.call.bind(ke);
338
- for (var Fe in T)
339
- if (Ge(T, Fe)) {
338
+ for (var ze in T)
339
+ if (Ge(T, ze)) {
340
340
  var Oe = void 0;
341
341
  try {
342
- if (typeof T[Fe] != "function") {
343
- var St = Error((Se || "React class") + ": " + ne + " type `" + Fe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[Fe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
342
+ if (typeof T[ze] != "function") {
343
+ var St = Error((Se || "React class") + ": " + ne + " type `" + ze + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[ze] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
344
  throw St.name = "Invariant Violation", St;
345
345
  }
346
- Oe = T[Fe](U, Fe, Se, ne, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ Oe = T[ze](U, ze, Se, ne, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (ot) {
348
348
  Oe = ot;
349
349
  }
350
- Oe && !(Oe instanceof Error) && (qe(Ve), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Se || "React class", ne, Fe, typeof Oe), qe(null)), Oe instanceof Error && !(Oe.message in Be) && (Be[Oe.message] = !0, qe(Ve), w("Failed %s type: %s", ne, Oe.message), qe(null));
350
+ Oe && !(Oe instanceof Error) && (qe(Ve), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Se || "React class", ne, ze, typeof Oe), qe(null)), Oe instanceof Error && !(Oe.message in Be) && (Be[Oe.message] = !0, qe(Ve), w("Failed %s type: %s", ne, Oe.message), qe(null));
351
351
  }
352
352
  }
353
353
  }
@@ -422,7 +422,7 @@ function Jp() {
422
422
  });
423
423
  }
424
424
  }
425
- var xt = function(T, U, ne, Se, Ve, Ge, Fe) {
425
+ var xt = function(T, U, ne, Se, Ve, Ge, ze) {
426
426
  var Oe = {
427
427
  // This tag allows us to uniquely identify this as a React Element
428
428
  $$typeof: t,
@@ -430,7 +430,7 @@ function Jp() {
430
430
  type: T,
431
431
  key: U,
432
432
  ref: ne,
433
- props: Fe,
433
+ props: ze,
434
434
  // Record the component responsible for creating this element.
435
435
  _owner: Ge
436
436
  };
@@ -453,20 +453,20 @@ function Jp() {
453
453
  };
454
454
  function At(T, U, ne, Se, Ve) {
455
455
  {
456
- var Ge, Fe = {}, Oe = null, St = null;
456
+ var Ge, ze = {}, Oe = null, St = null;
457
457
  ne !== void 0 && (Pe(ne), Oe = "" + ne), Ne(U) && (Pe(U.key), Oe = "" + U.key), tt(U) && (St = U.ref, at(U, Ve));
458
458
  for (Ge in U)
459
- ke.call(U, Ge) && !$.hasOwnProperty(Ge) && (Fe[Ge] = U[Ge]);
459
+ ke.call(U, Ge) && !$.hasOwnProperty(Ge) && (ze[Ge] = U[Ge]);
460
460
  if (T && T.defaultProps) {
461
461
  var ot = T.defaultProps;
462
462
  for (Ge in ot)
463
- Fe[Ge] === void 0 && (Fe[Ge] = ot[Ge]);
463
+ ze[Ge] === void 0 && (ze[Ge] = ot[Ge]);
464
464
  }
465
465
  if (Oe || St) {
466
466
  var lt = typeof T == "function" ? T.displayName || T.name || "Unknown" : T;
467
- Oe && Dt(Fe, lt), St && _n(Fe, lt);
467
+ Oe && Dt(ze, lt), St && _n(ze, lt);
468
468
  }
469
- return xt(T, Oe, St, Ve, Se, Ue.current, Fe);
469
+ return xt(T, Oe, St, Ve, Se, Ue.current, ze);
470
470
  }
471
471
  }
472
472
  var ht = x.ReactCurrentOwner, Rt = x.ReactDebugCurrentFrame;
@@ -482,7 +482,7 @@ function Jp() {
482
482
  function je(T) {
483
483
  return typeof T == "object" && T !== null && T.$$typeof === t;
484
484
  }
485
- function ze() {
485
+ function Fe() {
486
486
  {
487
487
  if (ht.current) {
488
488
  var T = V(ht.current.type);
@@ -494,13 +494,13 @@ Check the render method of \`` + T + "`.";
494
494
  return "";
495
495
  }
496
496
  }
497
- function Lt(T) {
497
+ function en(T) {
498
498
  return "";
499
499
  }
500
500
  var tn = {};
501
501
  function wr(T) {
502
502
  {
503
- var U = ze();
503
+ var U = Fe();
504
504
  if (!U) {
505
505
  var ne = typeof T == "string" ? T : T.displayName || T.name;
506
506
  ne && (U = `
@@ -537,8 +537,8 @@ Check the top-level render call using <` + ne + ">.");
537
537
  else if (T) {
538
538
  var Ve = g(T);
539
539
  if (typeof Ve == "function" && Ve !== T.entries)
540
- for (var Ge = Ve.call(T), Fe; !(Fe = Ge.next()).done; )
541
- je(Fe.value) && br(Fe.value, U);
540
+ for (var Ge = Ve.call(T), ze; !(ze = Ge.next()).done; )
541
+ je(ze.value) && br(ze.value, U);
542
542
  }
543
543
  }
544
544
  }
@@ -582,30 +582,30 @@ Check the top-level render call using <` + ne + ">.");
582
582
  var ja = {};
583
583
  function Pa(T, U, ne, Se, Ve, Ge) {
584
584
  {
585
- var Fe = _(T);
586
- if (!Fe) {
585
+ var ze = _(T);
586
+ if (!ze) {
587
587
  var Oe = "";
588
588
  (T === void 0 || typeof T == "object" && T !== null && Object.keys(T).length === 0) && (Oe += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
589
- var St = Lt();
590
- St ? Oe += St : Oe += ze();
589
+ var St = en();
590
+ St ? Oe += St : Oe += Fe();
591
591
  var ot;
592
592
  T === null ? ot = "null" : ce(T) ? ot = "array" : T !== void 0 && T.$$typeof === t ? (ot = "<" + (V(T.type) || "Unknown") + " />", Oe = " Did you accidentally export a JSX literal instead of a component?") : ot = typeof T, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ot, Oe);
593
593
  }
594
594
  var lt = At(T, U, ne, Ve, Ge);
595
595
  if (lt == null)
596
596
  return lt;
597
- if (Fe) {
598
- var $t = U.children;
599
- if ($t !== void 0)
597
+ if (ze) {
598
+ var Lt = U.children;
599
+ if (Lt !== void 0)
600
600
  if (Se)
601
- if (ce($t)) {
602
- for (var Zn = 0; Zn < $t.length; Zn++)
603
- yr($t[Zn], T);
604
- Object.freeze && Object.freeze($t);
601
+ if (ce(Lt)) {
602
+ for (var Zn = 0; Zn < Lt.length; Zn++)
603
+ yr(Lt[Zn], T);
604
+ Object.freeze && Object.freeze(Lt);
605
605
  } else
606
606
  w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
607
607
  else
608
- yr($t, T);
608
+ yr(Lt, T);
609
609
  }
610
610
  if (ke.call(U, "key")) {
611
611
  var jn = V(T), kt = Object.keys(U).filter(function(xp) {
@@ -644,11 +644,11 @@ function wc(e, t) {
644
644
  const { toString: Zp } = Object.prototype, { getPrototypeOf: Di } = Object, { iterator: Yo, toStringTag: bc } = Symbol, Xo = /* @__PURE__ */ ((e) => (t) => {
645
645
  const n = Zp.call(t);
646
646
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
647
- })(/* @__PURE__ */ Object.create(null)), Qt = (e) => (e = e.toLowerCase(), (t) => Xo(t) === e), Jo = (e) => (t) => typeof t === e, { isArray: fr } = Array, cr = Jo("undefined");
647
+ })(/* @__PURE__ */ Object.create(null)), Zt = (e) => (e = e.toLowerCase(), (t) => Xo(t) === e), Jo = (e) => (t) => typeof t === e, { isArray: fr } = Array, cr = Jo("undefined");
648
648
  function Hr(e) {
649
649
  return e !== null && !cr(e) && e.constructor !== null && !cr(e.constructor) && Et(e.constructor.isBuffer) && e.constructor.isBuffer(e);
650
650
  }
651
- const yc = Qt("ArrayBuffer");
651
+ const yc = Zt("ArrayBuffer");
652
652
  function Qp(e) {
653
653
  let t;
654
654
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && yc(e.buffer), t;
@@ -666,11 +666,11 @@ const em = Jo("string"), Et = Jo("function"), Sc = Jo("number"), Ur = (e) => e !
666
666
  } catch {
667
667
  return !1;
668
668
  }
669
- }, rm = Qt("Date"), om = Qt("File"), sm = Qt("Blob"), im = Qt("FileList"), am = (e) => Ur(e) && Et(e.pipe), lm = (e) => {
669
+ }, rm = Zt("Date"), om = Zt("File"), sm = Zt("Blob"), im = Zt("FileList"), am = (e) => Ur(e) && Et(e.pipe), lm = (e) => {
670
670
  let t;
671
671
  return e && (typeof FormData == "function" && e instanceof FormData || Et(e.append) && ((t = Xo(e)) === "formdata" || // detect form-data instance
672
672
  t === "object" && Et(e.toString) && e.toString() === "[object FormData]"));
673
- }, cm = Qt("URLSearchParams"), [um, dm, fm, hm] = ["ReadableStream", "Request", "Response", "Headers"].map(Qt), pm = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
673
+ }, cm = Zt("URLSearchParams"), [um, dm, fm, hm] = ["ReadableStream", "Request", "Response", "Headers"].map(Zt), pm = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
674
674
  function Wr(e, t, { allOwnKeys: n = !1 } = {}) {
675
675
  if (e === null || typeof e > "u")
676
676
  return;
@@ -750,12 +750,12 @@ const mm = (e, t, n, { allOwnKeys: r } = {}) => (Wr(t, (o, s) => {
750
750
  for (; (n = e.exec(t)) !== null; )
751
751
  r.push(n);
752
752
  return r;
753
- }, Tm = Qt("HTMLFormElement"), Rm = (e) => e.toLowerCase().replace(
753
+ }, Tm = Zt("HTMLFormElement"), Rm = (e) => e.toLowerCase().replace(
754
754
  /[-_\s]([a-z\d])(\w*)/g,
755
755
  function(n, r, o) {
756
756
  return r.toUpperCase() + o;
757
757
  }
758
- ), Ba = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), km = Qt("RegExp"), Rc = (e, t) => {
758
+ ), Ba = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), km = Zt("RegExp"), Rc = (e, t) => {
759
759
  const n = Object.getOwnPropertyDescriptors(e), r = {};
760
760
  Wr(n, (o, s) => {
761
761
  let i;
@@ -807,7 +807,7 @@ const jm = (e) => {
807
807
  return r;
808
808
  };
809
809
  return n(e, 0);
810
- }, Pm = Qt("AsyncFunction"), Om = (e) => e && (Ur(e) || Et(e)) && Et(e.then) && Et(e.catch), kc = ((e, t) => e ? setImmediate : t ? ((n, r) => (Mn.addEventListener("message", ({ source: o, data: s }) => {
810
+ }, Pm = Zt("AsyncFunction"), Om = (e) => e && (Ur(e) || Et(e)) && Et(e.then) && Et(e.catch), kc = ((e, t) => e ? setImmediate : t ? ((n, r) => (Mn.addEventListener("message", ({ source: o, data: s }) => {
811
811
  o === Mn && s === n && r.length && r.shift()();
812
812
  }, !1), (o) => {
813
813
  r.push(o), Mn.postMessage(n, "*");
@@ -848,7 +848,7 @@ const jm = (e) => {
848
848
  inherits: xm,
849
849
  toFlatObject: vm,
850
850
  kindOf: Xo,
851
- kindOfTest: Qt,
851
+ kindOfTest: Zt,
852
852
  endsWith: wm,
853
853
  toArray: bm,
854
854
  forEachEntry: Sm,
@@ -1876,17 +1876,17 @@ const Lc = (e) => {
1876
1876
  let G;
1877
1877
  try {
1878
1878
  if (C && u && g !== "get" && g !== "head" && (G = await m(E, x)) !== 0) {
1879
- let Z = new n(v, {
1879
+ let J = new n(v, {
1880
1880
  method: "POST",
1881
1881
  body: x,
1882
1882
  duplex: "half"
1883
1883
  }), ee;
1884
- if (A.isFormData(x) && (ee = Z.headers.get("content-type")) && E.setContentType(ee), Z.body) {
1885
- const [M, J] = Ka(
1884
+ if (A.isFormData(x) && (ee = J.headers.get("content-type")) && E.setContentType(ee), J.body) {
1885
+ const [M, Z] = Ka(
1886
1886
  G,
1887
1887
  Io(qa(C))
1888
1888
  );
1889
- x = Ya(Z.body, Xa, M, J);
1889
+ x = Ya(J.body, Xa, M, Z);
1890
1890
  }
1891
1891
  }
1892
1892
  A.isString(N) || (N = N ? "include" : "omit");
@@ -1903,25 +1903,25 @@ const Lc = (e) => {
1903
1903
  let D = await (s ? I(V, _) : I(v, K));
1904
1904
  const O = d && (k === "stream" || k === "response");
1905
1905
  if (d && (S || O && P)) {
1906
- const Z = {};
1906
+ const J = {};
1907
1907
  ["status", "statusText", "headers"].forEach((Re) => {
1908
- Z[Re] = D[Re];
1908
+ J[Re] = D[Re];
1909
1909
  });
1910
- const ee = A.toFiniteNumber(D.headers.get("content-length")), [M, J] = S && Ka(
1910
+ const ee = A.toFiniteNumber(D.headers.get("content-length")), [M, Z] = S && Ka(
1911
1911
  ee,
1912
1912
  Io(qa(S), !0)
1913
1913
  ) || [];
1914
1914
  D = new r(
1915
1915
  Ya(D.body, Xa, M, () => {
1916
- J && J(), P && P();
1916
+ Z && Z(), P && P();
1917
1917
  }),
1918
- Z
1918
+ J
1919
1919
  );
1920
1920
  }
1921
1921
  k = k || "text";
1922
1922
  let ie = await f[A.findKey(f, k) || "text"](D, b);
1923
- return !O && P && P(), await new Promise((Z, ee) => {
1924
- Mc(Z, ee, {
1923
+ return !O && P && P(), await new Promise((J, ee) => {
1924
+ Mc(J, ee, {
1925
1925
  data: ie,
1926
1926
  headers: It.from(D.headers),
1927
1927
  status: D.status,
@@ -2398,41 +2398,41 @@ function sl(e) {
2398
2398
  function Eg(e) {
2399
2399
  return ui.add(e), () => ui.delete(e);
2400
2400
  }
2401
- const Vt = it.create({
2401
+ const Wt = it.create({
2402
2402
  // Only set baseURL when configured — do NOT fall back to localhost. Falling back causes
2403
2403
  // noisy network requests to the frontend Dev server when the backend isn't configured.
2404
2404
  ...ol ? { baseURL: ol } : {},
2405
2405
  timeout: 3e4,
2406
2406
  withCredentials: !0
2407
2407
  });
2408
- Vt.interceptors.request.use((e) => (No && (e.headers.Authorization = `Bearer ${No}`), e));
2409
- Vt.interceptors.response.use(
2408
+ Wt.interceptors.request.use((e) => (No && (e.headers.Authorization = `Bearer ${No}`), e));
2409
+ Wt.interceptors.response.use(
2410
2410
  (e) => e,
2411
2411
  (e) => Promise.reject(e)
2412
2412
  );
2413
- async function Bt(e, t) {
2414
- return Vt.defaults.baseURL ? (await Vt.get(e, t)).data : Promise.reject(new Error("API base URL is not configured"));
2413
+ async function zt(e, t) {
2414
+ return Wt.defaults.baseURL ? (await Wt.get(e, t)).data : Promise.reject(new Error("API base URL is not configured"));
2415
2415
  }
2416
2416
  async function Ig(e, t, n) {
2417
- return Vt.defaults.baseURL ? (await Vt.post(e, t, n)).data : Promise.reject(new Error("API base URL is not configured"));
2417
+ return Wt.defaults.baseURL ? (await Wt.post(e, t, n)).data : Promise.reject(new Error("API base URL is not configured"));
2418
2418
  }
2419
2419
  async function Ng(e, t, n) {
2420
- return Vt.defaults.baseURL ? (await Vt.put(e, t, n)).data : Promise.reject(new Error("API base URL is not configured"));
2420
+ return Wt.defaults.baseURL ? (await Wt.put(e, t, n)).data : Promise.reject(new Error("API base URL is not configured"));
2421
2421
  }
2422
2422
  async function Ag(e, t) {
2423
- return Vt.defaults.baseURL ? (await Vt.delete(e, t)).data : Promise.reject(new Error("API base URL is not configured"));
2423
+ return Wt.defaults.baseURL ? (await Wt.delete(e, t)).data : Promise.reject(new Error("API base URL is not configured"));
2424
2424
  }
2425
- function Ft(e) {
2425
+ function $t(e) {
2426
2426
  return e && typeof e == "object" && "data" in e ? e.data : e;
2427
2427
  }
2428
2428
  class _g {
2429
2429
  // ---- Configuration ----
2430
2430
  get baseUrl() {
2431
- const t = Vt.defaults.baseURL || "";
2431
+ const t = Wt.defaults.baseURL || "";
2432
2432
  return String(t).replace(/\/+$|^\s+|\s+$/g, "");
2433
2433
  }
2434
2434
  updateConfig(t) {
2435
- t.baseUrl && (Vt.defaults.baseURL = String(t.baseUrl).replace(/\/+$/g, "")), t.authToken !== void 0 && sl(t.authToken);
2435
+ t.baseUrl && (Wt.defaults.baseURL = String(t.baseUrl).replace(/\/+$/g, "")), t.authToken !== void 0 && sl(t.authToken);
2436
2436
  }
2437
2437
  // ---- Token Management ----
2438
2438
  getAuthToken() {
@@ -2446,41 +2446,41 @@ class _g {
2446
2446
  }
2447
2447
  // ---- Thread Management ----
2448
2448
  async listThreads() {
2449
- const t = await Bt("/chat/threads"), n = Ft(t);
2449
+ const t = await zt("/chat/threads"), n = $t(t);
2450
2450
  return (n == null ? void 0 : n.items) ?? (t == null ? void 0 : t.items) ?? [];
2451
2451
  }
2452
2452
  async createThread(t) {
2453
2453
  const r = await Ig("/chat/threads", t ? { title: t } : void 0);
2454
- return Ft(r);
2454
+ return $t(r);
2455
2455
  }
2456
2456
  async updateThread(t, n) {
2457
2457
  const r = await Ng(`/chat/threads/${t}`, { title: n });
2458
- return Ft(r);
2458
+ return $t(r);
2459
2459
  }
2460
2460
  async deleteThread(t) {
2461
2461
  const n = await Ag(`/chat/threads/${t}`);
2462
- return Ft(n);
2462
+ return $t(n);
2463
2463
  }
2464
2464
  async threadInfo(t) {
2465
- const n = await Bt(`/chat/threads/${t}/info`);
2466
- return Ft(n);
2465
+ const n = await zt(`/chat/threads/${t}/info`);
2466
+ return $t(n);
2467
2467
  }
2468
2468
  // ---- Agents ----
2469
2469
  async listAgents() {
2470
- const t = await Bt("/chat/agents"), n = Ft(t);
2470
+ const t = await zt("/chat/agents"), n = $t(t);
2471
2471
  return (n == null ? void 0 : n.items) ?? [];
2472
2472
  }
2473
2473
  async getAgent(t) {
2474
- const n = await Bt(`/chat/agents/${t}`);
2475
- return Ft(n);
2474
+ const n = await zt(`/chat/agents/${t}`);
2475
+ return $t(n);
2476
2476
  }
2477
2477
  async getAgentSchema(t) {
2478
- const n = await Bt(`/chat/agents/${t}/schema`);
2479
- return Ft(n);
2478
+ const n = await zt(`/chat/agents/${t}/schema`);
2479
+ return $t(n);
2480
2480
  }
2481
2481
  // ---- Messages & State ----
2482
2482
  async getMessages(t) {
2483
- const n = await Bt(`/chat/threads/${t.threadId}/messages`, {
2483
+ const n = await zt(`/chat/threads/${t.threadId}/messages`, {
2484
2484
  params: {
2485
2485
  thread_id: t.threadId,
2486
2486
  checkpoint_id: t.checkpointId,
@@ -2489,34 +2489,34 @@ class _g {
2489
2489
  before_id: t.beforeId ?? void 0
2490
2490
  }
2491
2491
  });
2492
- return Ft(n);
2492
+ return $t(n);
2493
2493
  }
2494
2494
  async getState(t) {
2495
- const n = await Bt(`/chat/threads/${t.threadId}/state`, {
2495
+ const n = await zt(`/chat/threads/${t.threadId}/state`, {
2496
2496
  params: {
2497
2497
  thread_id: t.threadId,
2498
2498
  checkpoint_id: t.checkpointId,
2499
2499
  checkpoint_ns: t.checkpointNs
2500
2500
  }
2501
2501
  });
2502
- return Ft(n);
2502
+ return $t(n);
2503
2503
  }
2504
2504
  async getStateHistory(t) {
2505
- const n = await Bt(`/chat/threads/${t.threadId}/state/history`, {
2505
+ const n = await zt(`/chat/threads/${t.threadId}/state/history`, {
2506
2506
  params: {
2507
2507
  thread_id: t.threadId,
2508
2508
  checkpoint_id: t.checkpointId,
2509
2509
  checkpoint_ns: t.checkpointNs
2510
2510
  }
2511
2511
  });
2512
- return Ft(n);
2512
+ return $t(n);
2513
2513
  }
2514
2514
  // ---- Checkpoints ----
2515
2515
  async listCheckpoints(t) {
2516
- const n = await Bt(`/chat/threads/${t}/checkpoints`, {
2516
+ const n = await zt(`/chat/threads/${t}/checkpoints`, {
2517
2517
  params: { thread_id: t }
2518
2518
  });
2519
- return Ft(n);
2519
+ return $t(n);
2520
2520
  }
2521
2521
  }
2522
2522
  const zn = new _g();
@@ -2533,15 +2533,15 @@ function jg(e = {}) {
2533
2533
  w.current && (w.current.abort(), w.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && f("");
2534
2534
  const F = new AbortController();
2535
2535
  return w.current = F, (async () => {
2536
- var P, G, W, K, D, O, ie, Z;
2536
+ var P, G, W, K, D, O, ie, J;
2537
2537
  const V = (ee) => {
2538
2538
  var M;
2539
2539
  try {
2540
- const J = JSON.parse(JSON.stringify(ee));
2541
- return (M = J == null ? void 0 : J.payload) != null && M.files_info && Array.isArray(J.payload.files_info) && (J.payload.files_info = J.payload.files_info.map((Re) => ({
2540
+ const Z = JSON.parse(JSON.stringify(ee));
2541
+ return (M = Z == null ? void 0 : Z.payload) != null && M.files_info && Array.isArray(Z.payload.files_info) && (Z.payload.files_info = Z.payload.files_info.map((Re) => ({
2542
2542
  ...Re,
2543
2543
  data: Re != null && Re.data ? `<base64 ${String(Re.data).length} chars>` : Re == null ? void 0 : Re.data
2544
- }))), J;
2544
+ }))), Z;
2545
2545
  } catch {
2546
2546
  return ee;
2547
2547
  }
@@ -2591,7 +2591,7 @@ function jg(e = {}) {
2591
2591
  );
2592
2592
  }
2593
2593
  x(!0);
2594
- const J = M.body.getReader(), Re = new TextDecoder();
2594
+ const Z = M.body.getReader(), Re = new TextDecoder();
2595
2595
  let fe = "", L = [], j = R.current, H = null;
2596
2596
  const Q = () => {
2597
2597
  if (L.length) {
@@ -2613,7 +2613,7 @@ function jg(e = {}) {
2613
2613
  try {
2614
2614
  const ve = M.headers.get("X-Thread-Id") || M.headers.get("x-thread-id"), ke = M.headers.get("X-Thread-Created") || M.headers.get("x-thread-created"), Be = ve ?? null, Ze = String(ke ?? "").toLowerCase() === "true";
2615
2615
  for ((K = I == null ? void 0 : I.onOpen) == null || K.call(I, { threadId: Be, created: Ze }); ; ) {
2616
- const { value: qe, done: dt } = await J.read();
2616
+ const { value: qe, done: dt } = await Z.read();
2617
2617
  if (dt) break;
2618
2618
  fe += Re.decode(qe, { stream: !0 }), fe.length > De && (fe = "", console.warn("Stream buffer reset: exceeded 1MB"));
2619
2619
  let ft;
@@ -2655,17 +2655,17 @@ function jg(e = {}) {
2655
2655
  }
2656
2656
  } finally {
2657
2657
  try {
2658
- await J.cancel();
2658
+ await Z.cancel();
2659
2659
  } catch {
2660
2660
  } finally {
2661
- (ie = J.releaseLock) == null || ie.call(J);
2661
+ (ie = Z.releaseLock) == null || ie.call(Z);
2662
2662
  }
2663
2663
  H !== null && typeof window < "u" && window.cancelAnimationFrame(H), clearInterval($e), a(!1), x(!1), w.current = null;
2664
2664
  }
2665
2665
  } catch (ee) {
2666
2666
  if (ee.name !== "AbortError") {
2667
2667
  const M = ee.message || String(ee);
2668
- u(M), (Z = I == null ? void 0 : I.onError) == null || Z.call(I, M);
2668
+ u(M), (J = I == null ? void 0 : I.onError) == null || J.call(I, M);
2669
2669
  }
2670
2670
  } finally {
2671
2671
  a(!1), x(!1), w.current = null;
@@ -2783,7 +2783,7 @@ function Lg(e = []) {
2783
2783
  ct(() => () => {
2784
2784
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
2785
2785
  }, []);
2786
- const u = Gt(() => ({
2786
+ const u = qt(() => ({
2787
2787
  reset: (d) => n({ type: "reset", payload: { messages: d } }),
2788
2788
  seed: (d, f) => n({ type: "seed", payload: { messages: d, ...f ?? {} } }),
2789
2789
  prepend: (d) => n({ type: "prepend", payload: { messages: d } }),
@@ -3001,7 +3001,7 @@ function Ms({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3001
3001
  }, [u, b]);
3002
3002
  const x = Ye(($) => {
3003
3003
  u.setAuthToken($);
3004
- }, [u]), { state: w, seed: y, prepend: R, pushUser: S, onEvent: C, reset: k } = Lg(), E = 20, [N, _] = me(!1), [I, F] = me(!1), [V, P] = me(null), [G, W] = me(void 0), [K, D] = me(void 0), O = rt(!1), ie = rt([]), Z = rt(null), ee = Ye(($) => {
3004
+ }, [u]), { state: w, seed: y, prepend: R, pushUser: S, onEvent: C, reset: k } = Lg(), E = 20, [N, _] = me(!1), [I, F] = me(!1), [V, P] = me(null), [G, W] = me(void 0), [K, D] = me(void 0), O = rt(!1), ie = rt([]), J = rt(null), ee = Ye(($) => {
3005
3005
  $.cursor !== void 0 && P($.cursor), $.hasMore !== void 0 && _($.hasMore), $.checkpointId !== void 0 && W($.checkpointId), $.checkpointNs !== void 0 && D($.checkpointNs);
3006
3006
  }, []), M = Ye(($, Y) => new Promise((Ae, tt) => {
3007
3007
  const Ne = async () => {
@@ -3024,7 +3024,7 @@ function Ms({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3024
3024
  O.current ? (ie.current.push(Ne), console.log(`[ChatProvider] Queued operation: ${Y}`)) : Ne().catch((at) => {
3025
3025
  tt(at);
3026
3026
  });
3027
- }), []), J = Ye(
3027
+ }), []), Z = Ye(
3028
3028
  ($, Y) => {
3029
3029
  const Ae = Array.isArray($ == null ? void 0 : $.messages) ? $.messages : [];
3030
3030
  Y === "replace" ? (console.log("[ChatProvider] Replacing messages, count:", Ae.length), y(Ae, {
@@ -3116,8 +3116,8 @@ function Ms({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3116
3116
  const De = rt(null), ve = rt(null), ke = Ye(
3117
3117
  async ($, Y, Ae) => {
3118
3118
  await M(async () => {
3119
- if (Z.current === $) {
3120
- console.log(`[ChatProvider] Skipping auto-load for thread ${$} - suppressed after clear`), Z.current = null;
3119
+ if (J.current === $) {
3120
+ console.log(`[ChatProvider] Skipping auto-load for thread ${$} - suppressed after clear`), J.current = null;
3121
3121
  return;
3122
3122
  }
3123
3123
  if (!u.baseUrl) {
@@ -3170,9 +3170,9 @@ function Ms({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3170
3170
  checkpointNs: Y ?? void 0,
3171
3171
  limit: E
3172
3172
  });
3173
- J(Ae, "replace");
3173
+ Z(Ae, "replace");
3174
3174
  }, `navigateToCheckpoint-${$}`);
3175
- }, [u, L, J, M, ee]), qe = Ye(async () => {
3175
+ }, [u, L, Z, M, ee]), qe = Ye(async () => {
3176
3176
  if (!L) throw new Error("No active thread");
3177
3177
  await ke(L);
3178
3178
  }, [L, ke]), dt = rt(!1);
@@ -3185,9 +3185,9 @@ function Ms({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3185
3185
  console.warn("[ChatProvider] Post-streaming thread refresh failed:", Y);
3186
3186
  }
3187
3187
  }, "postStreamingRefresh");
3188
- }, [d, L, u, J, H, M]);
3188
+ }, [d, L, u, Z, H, M]);
3189
3189
  const ft = Ye(async () => {
3190
- console.log("[ChatProvider] 🔄 clearCurrentThread called"), console.log("[ChatProvider] 📊 Before clear - currentThreadId:", L), console.log("[ChatProvider] 📊 Before clear - messages count:", w.messages.length), L && (Z.current = L, console.log(`[ChatProvider] 🚫 Suppressing next auto-load for thread: ${L}`)), await M(() => (console.log("[ChatProvider] 🚀 Executing atomic clear operation"), j(null), k([]), ee({
3190
+ console.log("[ChatProvider] 🔄 clearCurrentThread called"), console.log("[ChatProvider] 📊 Before clear - currentThreadId:", L), console.log("[ChatProvider] 📊 Before clear - messages count:", w.messages.length), L && (J.current = L, console.log(`[ChatProvider] 🚫 Suppressing next auto-load for thread: ${L}`)), await M(() => (console.log("[ChatProvider] 🚀 Executing atomic clear operation"), j(null), k([]), ee({
3191
3191
  cursor: null,
3192
3192
  hasMore: !1,
3193
3193
  checkpointId: void 0,
@@ -3238,12 +3238,11 @@ function Ms({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3238
3238
  };
3239
3239
  h(
3240
3240
  pe,
3241
- (ze) => C(ze),
3241
+ (Fe) => C(Fe),
3242
3242
  {
3243
- onError: (ze) => console.warn("stream error", ze),
3244
- onOpen: ({ threadId: ze, created: Lt }) => {
3245
- !L && ze && (j(ze), Lt && H().catch(() => {
3246
- }));
3243
+ onError: (Fe) => console.warn("stream error", Fe),
3244
+ onOpen: ({ threadId: Fe }) => {
3245
+ !L && Fe && (J.current = Fe, j(Fe));
3247
3246
  }
3248
3247
  }
3249
3248
  );
@@ -3262,13 +3261,13 @@ function Ms({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3262
3261
  limit: ($ == null ? void 0 : $.limit) ?? E,
3263
3262
  beforeId: Y
3264
3263
  });
3265
- J(Ae, "prepend");
3264
+ Z(Ae, "prepend");
3266
3265
  } finally {
3267
3266
  F(!1);
3268
3267
  }
3269
3268
  }
3270
3269
  },
3271
- [u, L, G, K, V, N, I, J, E]
3270
+ [u, L, G, K, V, N, I, Z, E]
3272
3271
  ), Ue = {
3273
3272
  baseUrl: u.baseUrl,
3274
3273
  token: v,
@@ -3504,7 +3503,7 @@ function st(e) {
3504
3503
  function de(e, t) {
3505
3504
  return Ke(e, Xg(t, es));
3506
3505
  }
3507
- function Yt(e, t) {
3506
+ function Gt(e, t) {
3508
3507
  const n = e(kn, (r) => {
3509
3508
  n(), t(r);
3510
3509
  });
@@ -3891,16 +3890,16 @@ function Pr(e, t) {
3891
3890
  if (!Xe(e))
3892
3891
  return t === e.k ? e.v : t < e.k ? Pr(e.l, t) : Pr(e.r, t);
3893
3892
  }
3894
- function Xt(e, t, n = "k") {
3893
+ function Yt(e, t, n = "k") {
3895
3894
  if (Xe(e))
3896
3895
  return [-1 / 0, void 0];
3897
3896
  if (Number(e[n]) === t)
3898
3897
  return [e.k, e.v];
3899
3898
  if (Number(e[n]) < t) {
3900
- const r = Xt(e.r, t, n);
3899
+ const r = Yt(e.r, t, n);
3901
3900
  return r[0] === -1 / 0 ? [e.k, e.v] : r;
3902
3901
  }
3903
- return Xt(e.l, t, n);
3902
+ return Yt(e.l, t, n);
3904
3903
  }
3905
3904
  function jt(e, t, n) {
3906
3905
  return Xe(e) ? Qc(t, n, 1) : t === e.k ? pt(e, { k: t, v: n }) : t < e.k ? fl(pt(e, { l: jt(e.l, t, n) })) : fl(pt(e, { r: jt(e.r, t, n) }));
@@ -3911,7 +3910,7 @@ function or() {
3911
3910
  function ns(e, t, n) {
3912
3911
  if (Xe(e))
3913
3912
  return [];
3914
- const r = Xt(e, t)[0];
3913
+ const r = Yt(e, t)[0];
3915
3914
  return ax(hi(e, r, n));
3916
3915
  }
3917
3916
  function fi(e, t) {
@@ -4151,8 +4150,8 @@ function mi(e, t, n, r) {
4151
4150
  let o = e, s = 0, i = 0, a = 0, c = 0;
4152
4151
  if (t !== 0) {
4153
4152
  c = Ao(o, t - 1, Wi), a = o[c].offset;
4154
- const u = Xt(n, t - 1);
4155
- s = u[0], i = u[1], o.length && o[c].size === Xt(n, t)[1] && (c -= 1), o = o.slice(0, c + 1);
4153
+ const u = Yt(n, t - 1);
4154
+ s = u[0], i = u[1], o.length && o[c].size === Yt(n, t)[1] && (c -= 1), o = o.slice(0, c + 1);
4156
4155
  } else
4157
4156
  o = [];
4158
4157
  for (const { start: u, value: d } of ns(n, t, 1 / 0)) {
@@ -4372,7 +4371,7 @@ const vx = {
4372
4371
  if (E = Dn(C.sizeTree).reduce((V, { k: P, v: G }) => jt(V, Math.max(0, P + S), G), E), _ !== -S) {
4373
4372
  const V = Pr(C.sizeTree, F);
4374
4373
  E = jt(E, 0, V);
4375
- const P = Xt(C.sizeTree, -S + 1)[1];
4374
+ const P = Yt(C.sizeTree, -S + 1)[1];
4376
4375
  E = jt(E, 1, P);
4377
4376
  }
4378
4377
  return {
@@ -4444,7 +4443,7 @@ const su = He(
4444
4443
  z(
4445
4444
  ut(o, t, r),
4446
4445
  be(([c, u]) => rs(u)),
4447
- re(([c, u, d]) => Xt(u.groupOffsetTree, Math.max(c - d, 0), "v")[0]),
4446
+ re(([c, u, d]) => Yt(u.groupOffsetTree, Math.max(c - d, 0), "v")[0]),
4448
4447
  Qe(),
4449
4448
  re((c) => [c])
4450
4449
  ),
@@ -4505,23 +4504,23 @@ const Kr = He(
4505
4504
  P
4506
4505
  ]) => {
4507
4506
  const G = iu(R), { align: W, behavior: K, offset: D } = G, O = k - 1, ie = ou(G, S, O);
4508
- let Z = Mr(ie, S.offsetTree, F) + N;
4509
- W === "end" ? (Z += V + Xt(S.sizeTree, ie)[1] - C + P, ie === O && (Z += _)) : W === "center" ? Z += (V + Xt(S.sizeTree, ie)[1] - C + P) / 2 : Z -= E, D && (Z += D);
4507
+ let J = Mr(ie, S.offsetTree, F) + N;
4508
+ W === "end" ? (J += V + Yt(S.sizeTree, ie)[1] - C + P, ie === O && (J += _)) : W === "center" ? J += (V + Yt(S.sizeTree, ie)[1] - C + P) / 2 : J -= E, D && (J += D);
4510
4509
  const ee = (M) => {
4511
4510
  y(), M ? (I("retrying to scroll to", { location: R }, Nt.DEBUG), Ie(m, R)) : (Ie(b, !0), I("list did not change, scroll successful", {}, Nt.DEBUG));
4512
4511
  };
4513
4512
  if (y(), K === "smooth") {
4514
4513
  let M = !1;
4515
- w = Ke(t, (J) => {
4516
- M = M || J;
4517
- }), g = Yt(d, () => {
4514
+ w = Ke(t, (Z) => {
4515
+ M = M || Z;
4516
+ }), g = Gt(d, () => {
4518
4517
  ee(M);
4519
4518
  });
4520
4519
  } else
4521
- g = Yt(z(t, yx(150)), ee);
4520
+ g = Gt(z(t, yx(150)), ee);
4522
4521
  return x = setTimeout(() => {
4523
4522
  y();
4524
- }, 1200), Ie(c, !0), I("scrolling from index to", { behavior: K, index: ie, top: Z }, Nt.DEBUG), { behavior: K, top: Z };
4523
+ }, 1200), Ie(c, !0), I("scrolling from index to", { behavior: K, index: ie, top: J }, Nt.DEBUG), { behavior: K, top: J };
4525
4524
  }
4526
4525
  )
4527
4526
  ),
@@ -4581,10 +4580,10 @@ const qr = He(
4581
4580
  _e(c)
4582
4581
  ),
4583
4582
  ([, d]) => {
4584
- Yt(o, () => {
4583
+ Gt(o, () => {
4585
4584
  Ie(u, !0);
4586
4585
  }), Vi(4, () => {
4587
- Yt(r, () => {
4586
+ Gt(r, () => {
4588
4587
  Ie(a, !0);
4589
4588
  }), Ie(s, d);
4590
4589
  });
@@ -4808,7 +4807,7 @@ function Rx(e, t, n) {
4808
4807
  if (rs(t)) {
4809
4808
  const r = ru(e, t);
4810
4809
  return [
4811
- { index: Xt(t.groupOffsetTree, r)[0], offset: 0, size: 0 },
4810
+ { index: Yt(t.groupOffsetTree, r)[0], offset: 0, size: 0 },
4812
4811
  { data: n == null ? void 0 : n[0], index: r, offset: 0, size: 0 }
4813
4812
  ];
4814
4813
  }
@@ -4960,10 +4959,10 @@ const Gn = He(
4960
4959
  }
4961
4960
  if (!I)
4962
4961
  return mo([], ie, E, P, W, V);
4963
- const Z = F.length > 0 ? F[F.length - 1] + 1 : 0, ee = hx(K, C, k, Z);
4962
+ const J = F.length > 0 ? F[F.length - 1] + 1 : 0, ee = hx(K, C, k, J);
4964
4963
  if (ee.length === 0)
4965
4964
  return null;
4966
- const M = E - 1, J = ts([], (Re) => {
4965
+ const M = E - 1, Z = ts([], (Re) => {
4967
4966
  for (const fe of ee) {
4968
4967
  const L = fe.value;
4969
4968
  let j = L.offset, H = fe.start;
@@ -4973,13 +4972,13 @@ const Gn = He(
4973
4972
  const oe = H - fe.start;
4974
4973
  j += oe * Q + oe * P;
4975
4974
  }
4976
- H < Z && (j += (Z - H) * Q, H = Z);
4975
+ H < J && (j += (J - H) * Q, H = J);
4977
4976
  const le = Math.min(fe.end, M);
4978
4977
  for (let oe = H; oe <= le && !(j >= k); oe++)
4979
4978
  Re.push({ data: G == null ? void 0 : G[oe], index: oe, offset: j, size: Q }), j += Q + P;
4980
4979
  }
4981
4980
  });
4982
- return mo(J, ie, E, P, W, V);
4981
+ return mo(Z, ie, E, P, W, V);
4983
4982
  }
4984
4983
  ),
4985
4984
  //@ts-expect-error filter needs to be fixed
@@ -5113,14 +5112,14 @@ const Gn = He(
5113
5112
  _e(t, c, n, s, o, r, a),
5114
5113
  _e(e),
5115
5114
  re(([[f, h, m, b, v, g, x, w], y]) => {
5116
- const { align: R, behavior: S, calculateViewLocation: C = Ex, done: k, ...E } = f, N = ou(f, h, b - 1), _ = Mr(N, h.offsetTree, y) + v + g, I = _ + Xt(h.sizeTree, N)[1], F = w + g, V = w + m - x, P = C({
5115
+ const { align: R, behavior: S, calculateViewLocation: C = Ex, done: k, ...E } = f, N = ou(f, h, b - 1), _ = Mr(N, h.offsetTree, y) + v + g, I = _ + Yt(h.sizeTree, N)[1], F = w + g, V = w + m - x, P = C({
5117
5116
  itemBottom: I,
5118
5117
  itemTop: _,
5119
5118
  locationParams: { align: R, behavior: S, ...E },
5120
5119
  viewportBottom: V,
5121
5120
  viewportTop: F
5122
5121
  });
5123
- return P ? k && Yt(
5122
+ return P ? k && Gt(
5124
5123
  z(
5125
5124
  i,
5126
5125
  be((G) => !G),
@@ -5178,13 +5177,13 @@ const Ix = (e, t) => typeof e == "function" ? vl(e(t)) : t && vl(e), Nx = He(
5178
5177
  ({ followOutputBehavior: S, totalCount: C }) => {
5179
5178
  g && (g(), g = null), st(n) ? requestAnimationFrame(() => {
5180
5179
  st(d)("following output to ", { totalCount: C }, Nt.DEBUG), x(S);
5181
- }) : g = Yt(e, () => {
5180
+ }) : g = Gt(e, () => {
5182
5181
  st(d)("following output to ", { totalCount: C }, Nt.DEBUG), x(S), g = null;
5183
5182
  });
5184
5183
  }
5185
5184
  );
5186
5185
  function w(S) {
5187
- const C = Yt(o, (k) => {
5186
+ const C = Gt(o, (k) => {
5188
5187
  S && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !g && (st(d)("scrolling to bottom due to increased size", {}, Nt.DEBUG), x("auto"));
5189
5188
  });
5190
5189
  setTimeout(C, 100);
@@ -5232,7 +5231,7 @@ const Ix = (e, t) => typeof e == "function" ? vl(e(t)) : t && vl(e), Nx = He(
5232
5231
  (S) => {
5233
5232
  g && (g(), g = null), st(n) ? requestAnimationFrame(() => {
5234
5233
  st(d)("scrolling into view", {}), Ie(m, S);
5235
- }) : g = Yt(e, () => {
5234
+ }) : g = Gt(e, () => {
5236
5235
  st(d)("scrolling into view", {}), Ie(m, S), g = null;
5237
5236
  });
5238
5237
  }
@@ -5273,7 +5272,7 @@ const Ix = (e, t) => typeof e == "function" ? vl(e(t)) : t && vl(e), Nx = He(
5273
5272
  re(([, o]) => ({ top: o }))
5274
5273
  ),
5275
5274
  (o) => {
5276
- Yt(
5275
+ Gt(
5277
5276
  z(
5278
5277
  n,
5279
5278
  Bn(1),
@@ -5784,7 +5783,7 @@ const zx = /* @__PURE__ */ He(() => {
5784
5783
  ([e, t]) => ({ ...e, ...t }),
5785
5784
  et(pu, zx)
5786
5785
  ), Hx = ({ height: e }) => /* @__PURE__ */ l.jsx("div", { style: { height: e } }), Ux = { overflowAnchor: "none", position: Yi(), zIndex: 1 }, bu = { overflowAnchor: "none" }, Wx = { ...bu, display: "inline-block", height: "100%" }, bl = /* @__PURE__ */ B.memo(function({ showTopList: e = !1 }) {
5787
- const t = Te("listState"), n = Ht("sizeRanges"), r = Te("useWindowScroll"), o = Te("customScrollParent"), s = Ht("windowScrollContainerState"), i = Ht("scrollContainerState"), a = o || r ? s : i, c = Te("itemContent"), u = Te("context"), d = Te("groupContent"), f = Te("trackItemSizes"), h = Te("itemSize"), m = Te("log"), b = Ht("gap"), v = Te("horizontalDirection"), { callbackRef: g } = sx(
5786
+ const t = Te("listState"), n = Bt("sizeRanges"), r = Te("useWindowScroll"), o = Te("customScrollParent"), s = Bt("windowScrollContainerState"), i = Bt("scrollContainerState"), a = o || r ? s : i, c = Te("itemContent"), u = Te("context"), d = Te("groupContent"), f = Te("trackItemSizes"), h = Te("itemSize"), m = Te("log"), b = Bt("gap"), v = Te("horizontalDirection"), { callbackRef: g } = sx(
5788
5787
  n,
5789
5788
  h,
5790
5789
  f,
@@ -5891,7 +5890,7 @@ function Gx(e, t) {
5891
5890
  return { item: typeof e == "string" ? void 0 : t };
5892
5891
  }
5893
5892
  const Yx = /* @__PURE__ */ B.memo(function() {
5894
- const e = Te("HeaderComponent"), t = Ht("headerHeight"), n = Te("HeaderFooterTag"), r = qn(
5893
+ const e = Te("HeaderComponent"), t = Bt("headerHeight"), n = Te("HeaderFooterTag"), r = qn(
5895
5894
  B.useMemo(
5896
5895
  () => (s) => {
5897
5896
  t(yn(s, "height"));
@@ -5903,7 +5902,7 @@ const Yx = /* @__PURE__ */ B.memo(function() {
5903
5902
  ), o = Te("context");
5904
5903
  return e ? /* @__PURE__ */ l.jsx(n, { ref: r, children: /* @__PURE__ */ l.jsx(e, { ...bt(e, o) }) }) : null;
5905
5904
  }), Xx = /* @__PURE__ */ B.memo(function() {
5906
- const e = Te("FooterComponent"), t = Ht("footerHeight"), n = Te("HeaderFooterTag"), r = qn(
5905
+ const e = Te("FooterComponent"), t = Bt("footerHeight"), n = Te("HeaderFooterTag"), r = qn(
5907
5906
  B.useMemo(
5908
5907
  () => (s) => {
5909
5908
  t(yn(s, "height"));
@@ -5968,7 +5967,7 @@ function Su({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
5968
5967
  });
5969
5968
  }
5970
5969
  const Jx = ({ children: e }) => {
5971
- const t = B.useContext(gu), n = Ht("viewportHeight"), r = Ht("fixedItemHeight"), o = Te("alignToBottom"), s = Te("horizontalDirection"), i = B.useMemo(
5970
+ const t = B.useContext(gu), n = Bt("viewportHeight"), r = Bt("fixedItemHeight"), o = Te("alignToBottom"), s = Te("horizontalDirection"), i = B.useMemo(
5972
5971
  () => qc(n, (c) => yn(c, s ? "width" : "height")),
5973
5972
  [n, s]
5974
5973
  ), a = qn(i, !0, Te("skipAnimationFrameInResizeObserver"));
@@ -5976,7 +5975,7 @@ const Jx = ({ children: e }) => {
5976
5975
  t && (n(t.viewportHeight), r(t.itemHeight));
5977
5976
  }, [t, n, r]), /* @__PURE__ */ l.jsx("div", { "data-viewport-type": "element", ref: a, style: os(o), children: e });
5978
5977
  }, Zx = ({ children: e }) => {
5979
- const t = B.useContext(gu), n = Ht("windowViewportRect"), r = Ht("fixedItemHeight"), o = Te("customScrollParent"), s = Yc(
5978
+ const t = B.useContext(gu), n = Bt("windowViewportRect"), r = Bt("fixedItemHeight"), o = Te("customScrollParent"), s = Yc(
5980
5979
  n,
5981
5980
  o,
5982
5981
  Te("skipAnimationFrameInResizeObserver")
@@ -6001,7 +6000,7 @@ const Jx = ({ children: e }) => {
6001
6000
  Component: tv,
6002
6001
  useEmitter: Ji,
6003
6002
  useEmitterValue: Te,
6004
- usePublisher: Ht
6003
+ usePublisher: Bt
6005
6004
  } = /* @__PURE__ */ mu(
6006
6005
  Bx,
6007
6006
  {
@@ -6061,7 +6060,7 @@ const Jx = ({ children: e }) => {
6061
6060
  }
6062
6061
  },
6063
6062
  ev
6064
- ), nv = /* @__PURE__ */ yu({ useEmitter: Ji, useEmitterValue: Te, usePublisher: Ht }), rv = /* @__PURE__ */ Su({ useEmitter: Ji, useEmitterValue: Te, usePublisher: Ht }), ov = tv, sv = /* @__PURE__ */ He(() => {
6063
+ ), nv = /* @__PURE__ */ yu({ useEmitter: Ji, useEmitterValue: Te, usePublisher: Bt }), rv = /* @__PURE__ */ Su({ useEmitter: Ji, useEmitterValue: Te, usePublisher: Bt }), ov = tv, sv = /* @__PURE__ */ He(() => {
6065
6064
  const e = q((u) => /* @__PURE__ */ l.jsxs("td", { children: [
6066
6065
  "Item $",
6067
6066
  u
@@ -6141,7 +6140,7 @@ const cv = /* @__PURE__ */ He(
6141
6140
  { customScrollParent: g, useWindowScroll: x, windowScrollContainerState: w, windowScrollTo: y, windowViewportRect: R },
6142
6141
  S
6143
6142
  ]) => {
6144
- const C = q(0), k = q(0), E = q(yl), N = q({ height: 0, width: 0 }), _ = q({ height: 0, width: 0 }), I = Le(), F = Le(), V = q(0), P = q(null), G = q({ column: 0, row: 0 }), W = Le(), K = Le(), D = q(!1), O = q(0), ie = q(!0), Z = q(!1), ee = q(!1);
6143
+ const C = q(0), k = q(0), E = q(yl), N = q({ height: 0, width: 0 }), _ = q({ height: 0, width: 0 }), I = Le(), F = Le(), V = q(0), P = q(null), G = q({ column: 0, row: 0 }), W = Le(), K = Le(), D = q(!1), O = q(0), ie = q(!0), J = q(!1), ee = q(!1);
6145
6144
  Ke(
6146
6145
  z(
6147
6146
  b,
@@ -6153,13 +6152,13 @@ const cv = /* @__PURE__ */ He(
6153
6152
  }
6154
6153
  ), Ke(
6155
6154
  z(
6156
- ut(b, ie, _, N, O, Z),
6155
+ ut(b, ie, _, N, O, J),
6157
6156
  be(([j, H, Q, le, , oe]) => j && !H && Q.height !== 0 && le.height !== 0 && !oe)
6158
6157
  ),
6159
6158
  ([, , , , j]) => {
6160
- Ie(Z, !0), Vi(1, () => {
6159
+ Ie(J, !0), Vi(1, () => {
6161
6160
  Ie(I, j);
6162
- }), Yt(z(u), () => {
6161
+ }), Gt(z(u), () => {
6163
6162
  Ie(t, [0, 0]), Ie(ie, !0);
6164
6163
  });
6165
6164
  }
@@ -6177,7 +6176,7 @@ const cv = /* @__PURE__ */ He(
6177
6176
  be(([, j]) => j != null)
6178
6177
  ),
6179
6178
  ([, j]) => {
6180
- j && (Ie(N, j.viewport), Ie(_, j.item), Ie(G, j.gap), j.scrollTop > 0 && (Ie(D, !0), Yt(z(u, Bn(1)), (H) => {
6179
+ j && (Ie(N, j.viewport), Ie(_, j.item), Ie(G, j.gap), j.scrollTop > 0 && (Ie(D, !0), Gt(z(u, Bn(1)), (H) => {
6181
6180
  Ie(D, !1);
6182
6181
  }), Ie(c, { top: j.scrollTop })));
6183
6182
  }
@@ -6275,7 +6274,7 @@ const cv = /* @__PURE__ */ He(
6275
6274
  ),
6276
6275
  M
6277
6276
  );
6278
- const J = Pt(
6277
+ const Z = Pt(
6279
6278
  z(
6280
6279
  ut(E, C),
6281
6280
  be(([{ items: j }]) => j.length > 0),
@@ -6367,7 +6366,7 @@ const cv = /* @__PURE__ */ He(
6367
6366
  initialTopMostItemIndex: O,
6368
6367
  totalListHeight: L,
6369
6368
  ...h,
6370
- endReached: J,
6369
+ endReached: Z,
6371
6370
  propsReady: v,
6372
6371
  rangeChanged: fe,
6373
6372
  startReached: Re,
@@ -6423,7 +6422,7 @@ const uv = /* @__PURE__ */ He(() => {
6423
6422
  ([e, t]) => ({ ...e, ...t }),
6424
6423
  et(cv, uv)
6425
6424
  ), fv = /* @__PURE__ */ B.memo(function() {
6426
- const e = nt("gridState"), t = nt("listClassName"), n = nt("itemClassName"), r = nt("itemContent"), o = nt("computeItemKey"), s = nt("isSeeking"), i = Ut("scrollHeight"), a = nt("ItemComponent"), c = nt("ListComponent"), u = nt("ScrollSeekPlaceholder"), d = nt("context"), f = Ut("itemDimensions"), h = Ut("gap"), m = nt("log"), b = nt("stateRestoreInProgress"), v = Ut("reportReadyState"), g = qn(
6425
+ const e = nt("gridState"), t = nt("listClassName"), n = nt("itemClassName"), r = nt("itemContent"), o = nt("computeItemKey"), s = nt("isSeeking"), i = Ht("scrollHeight"), a = nt("ItemComponent"), c = nt("ListComponent"), u = nt("ScrollSeekPlaceholder"), d = nt("context"), f = Ht("itemDimensions"), h = Ht("gap"), m = nt("log"), b = nt("stateRestoreInProgress"), v = Ht("reportReadyState"), g = qn(
6427
6426
  B.useMemo(
6428
6427
  () => (x) => {
6429
6428
  const w = x.parentElement.parentElement.scrollHeight;
@@ -6478,7 +6477,7 @@ const uv = /* @__PURE__ */ He(() => {
6478
6477
  }
6479
6478
  );
6480
6479
  }), hv = B.memo(function() {
6481
- const e = nt("HeaderComponent"), t = Ut("headerHeight"), n = nt("headerFooterTag"), r = qn(
6480
+ const e = nt("HeaderComponent"), t = Ht("headerHeight"), n = nt("headerFooterTag"), r = qn(
6482
6481
  B.useMemo(
6483
6482
  () => (s) => {
6484
6483
  t(yn(s, "height"));
@@ -6490,7 +6489,7 @@ const uv = /* @__PURE__ */ He(() => {
6490
6489
  ), o = nt("context");
6491
6490
  return e ? /* @__PURE__ */ l.jsx(n, { ref: r, children: /* @__PURE__ */ l.jsx(e, { ...bt(e, o) }) }) : null;
6492
6491
  }), pv = B.memo(function() {
6493
- const e = nt("FooterComponent"), t = Ut("footerHeight"), n = nt("headerFooterTag"), r = qn(
6492
+ const e = nt("FooterComponent"), t = Ht("footerHeight"), n = nt("headerFooterTag"), r = qn(
6494
6493
  B.useMemo(
6495
6494
  () => (s) => {
6496
6495
  t(yn(s, "height"));
@@ -6502,7 +6501,7 @@ const uv = /* @__PURE__ */ He(() => {
6502
6501
  ), o = nt("context");
6503
6502
  return e ? /* @__PURE__ */ l.jsx(n, { ref: r, children: /* @__PURE__ */ l.jsx(e, { ...bt(e, o) }) }) : null;
6504
6503
  }), mv = ({ children: e }) => {
6505
- const t = B.useContext(xu), n = Ut("itemDimensions"), r = Ut("viewportDimensions"), o = qn(
6504
+ const t = B.useContext(xu), n = Ht("itemDimensions"), r = Ht("viewportDimensions"), o = qn(
6506
6505
  B.useMemo(
6507
6506
  () => (s) => {
6508
6507
  r(s.getBoundingClientRect());
@@ -6516,7 +6515,7 @@ const uv = /* @__PURE__ */ He(() => {
6516
6515
  t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
6517
6516
  }, [t, r, n]), /* @__PURE__ */ l.jsx("div", { ref: o, style: os(!1), children: e });
6518
6517
  }, gv = ({ children: e }) => {
6519
- const t = B.useContext(xu), n = Ut("windowViewportRect"), r = Ut("itemDimensions"), o = nt("customScrollParent"), s = Yc(n, o, !1);
6518
+ const t = B.useContext(xu), n = Ht("windowViewportRect"), r = Ht("itemDimensions"), o = nt("customScrollParent"), s = Yc(n, o, !1);
6520
6519
  return B.useEffect(() => {
6521
6520
  t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
6522
6521
  }, [t, n, r]), /* @__PURE__ */ l.jsx("div", { ref: s, style: os(!1), children: e });
@@ -6530,7 +6529,7 @@ const uv = /* @__PURE__ */ He(() => {
6530
6529
  }), {
6531
6530
  useEmitter: Tu,
6532
6531
  useEmitterValue: nt,
6533
- usePublisher: Ut
6532
+ usePublisher: Ht
6534
6533
  } = /* @__PURE__ */ mu(
6535
6534
  dv,
6536
6535
  {
@@ -6572,7 +6571,7 @@ const uv = /* @__PURE__ */ He(() => {
6572
6571
  }
6573
6572
  },
6574
6573
  xv
6575
- ), vv = /* @__PURE__ */ yu({ useEmitter: Tu, useEmitterValue: nt, usePublisher: Ut }), wv = /* @__PURE__ */ Su({ useEmitter: Tu, useEmitterValue: nt, usePublisher: Ut });
6574
+ ), vv = /* @__PURE__ */ yu({ useEmitter: Tu, useEmitterValue: nt, usePublisher: Ht }), wv = /* @__PURE__ */ Su({ useEmitter: Tu, useEmitterValue: nt, usePublisher: Ht });
6576
6575
  function kl(e, t, n) {
6577
6576
  return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Nt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
6578
6577
  }
@@ -8496,7 +8495,7 @@ function Bs({
8496
8495
  className: t = "",
8497
8496
  allowHtml: n = !1
8498
8497
  }) {
8499
- const r = Gt(() => {
8498
+ const r = qt(() => {
8500
8499
  try {
8501
8500
  if (!n) {
8502
8501
  const o = e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, "").replace(/javascript:/gi, "").replace(/on\w+\s*=/gi, "");
@@ -8516,7 +8515,7 @@ function Bs({
8516
8515
  );
8517
8516
  }
8518
8517
  async function Du(e, t) {
8519
- return await Bt(e, {
8518
+ return await zt(e, {
8520
8519
  responseType: "blob",
8521
8520
  onDownloadProgress: (r) => {
8522
8521
  try {
@@ -8535,7 +8534,7 @@ async function ew(e, t) {
8535
8534
  const n = await Du(`/chat/files/${e}/download`, t), r = URL.createObjectURL(n);
8536
8535
  let o = `file_${e}`;
8537
8536
  try {
8538
- const i = await Bt(`/chat/files/${e}`);
8537
+ const i = await zt(`/chat/files/${e}`);
8539
8538
  o = (i == null ? void 0 : i.filename) ?? o;
8540
8539
  } catch {
8541
8540
  }
@@ -8544,7 +8543,7 @@ async function ew(e, t) {
8544
8543
  }
8545
8544
  async function tw(e, t = 50, n = 0) {
8546
8545
  const r = { limit: t, offset: n };
8547
- return e && (r.thread_id = e), await Bt("/chat/files", { params: r });
8546
+ return e && (r.thread_id = e), await zt("/chat/files", { params: r });
8548
8547
  }
8549
8548
  const nw = 1, rw = 1e6;
8550
8549
  let Hs = 0;
@@ -9441,7 +9440,7 @@ var sb = function(e) {
9441
9440
  return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), ab(r, o, n, "aria-hidden")) : function() {
9442
9441
  return null;
9443
9442
  };
9444
- }, ds = "Dialog", [Gu, wT] = fn(ds), [lb, en] = Gu(ds), Yu = (e) => {
9443
+ }, ds = "Dialog", [Gu, wT] = fn(ds), [lb, Qt] = Gu(ds), Yu = (e) => {
9445
9444
  const {
9446
9445
  __scopeDialog: t,
9447
9446
  children: n,
@@ -9475,7 +9474,7 @@ var sb = function(e) {
9475
9474
  Yu.displayName = ds;
9476
9475
  var Xu = "DialogTrigger", Ju = p.forwardRef(
9477
9476
  (e, t) => {
9478
- const { __scopeDialog: n, ...r } = e, o = en(Xu, n), s = Me(t, o.triggerRef);
9477
+ const { __scopeDialog: n, ...r } = e, o = Qt(Xu, n), s = Me(t, o.triggerRef);
9479
9478
  return /* @__PURE__ */ l.jsx(
9480
9479
  Ce.button,
9481
9480
  {
@@ -9495,20 +9494,20 @@ Ju.displayName = Xu;
9495
9494
  var aa = "DialogPortal", [cb, Zu] = Gu(aa, {
9496
9495
  forceMount: void 0
9497
9496
  }), Qu = (e) => {
9498
- const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, s = en(aa, t);
9497
+ const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, s = Qt(aa, t);
9499
9498
  return /* @__PURE__ */ l.jsx(cb, { scope: t, forceMount: n, children: p.Children.map(r, (i) => /* @__PURE__ */ l.jsx(Mt, { present: n || s.open, children: /* @__PURE__ */ l.jsx(ls, { asChild: !0, container: o, children: i }) })) });
9500
9499
  };
9501
9500
  Qu.displayName = aa;
9502
9501
  var Do = "DialogOverlay", ed = p.forwardRef(
9503
9502
  (e, t) => {
9504
- const n = Zu(Do, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = en(Do, e.__scopeDialog);
9503
+ const n = Zu(Do, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Qt(Do, e.__scopeDialog);
9505
9504
  return s.modal ? /* @__PURE__ */ l.jsx(Mt, { present: r || s.open, children: /* @__PURE__ */ l.jsx(db, { ...o, ref: t }) }) : null;
9506
9505
  }
9507
9506
  );
9508
9507
  ed.displayName = Do;
9509
9508
  var ub = lr("DialogOverlay.RemoveScroll"), db = p.forwardRef(
9510
9509
  (e, t) => {
9511
- const { __scopeDialog: n, ...r } = e, o = en(Do, n);
9510
+ const { __scopeDialog: n, ...r } = e, o = Qt(Do, n);
9512
9511
  return (
9513
9512
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
9514
9513
  // ie. when `Overlay` and `Content` are siblings
@@ -9525,14 +9524,14 @@ var ub = lr("DialogOverlay.RemoveScroll"), db = p.forwardRef(
9525
9524
  }
9526
9525
  ), Un = "DialogContent", td = p.forwardRef(
9527
9526
  (e, t) => {
9528
- const n = Zu(Un, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = en(Un, e.__scopeDialog);
9527
+ const n = Zu(Un, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Qt(Un, e.__scopeDialog);
9529
9528
  return /* @__PURE__ */ l.jsx(Mt, { present: r || s.open, children: s.modal ? /* @__PURE__ */ l.jsx(fb, { ...o, ref: t }) : /* @__PURE__ */ l.jsx(hb, { ...o, ref: t }) });
9530
9529
  }
9531
9530
  );
9532
9531
  td.displayName = Un;
9533
9532
  var fb = p.forwardRef(
9534
9533
  (e, t) => {
9535
- const n = en(Un, e.__scopeDialog), r = p.useRef(null), o = Me(t, n.contentRef, r);
9534
+ const n = Qt(Un, e.__scopeDialog), r = p.useRef(null), o = Me(t, n.contentRef, r);
9536
9535
  return p.useEffect(() => {
9537
9536
  const s = r.current;
9538
9537
  if (s) return ia(s);
@@ -9560,7 +9559,7 @@ var fb = p.forwardRef(
9560
9559
  }
9561
9560
  ), hb = p.forwardRef(
9562
9561
  (e, t) => {
9563
- const n = en(Un, e.__scopeDialog), r = p.useRef(!1), o = p.useRef(!1);
9562
+ const n = Qt(Un, e.__scopeDialog), r = p.useRef(!1), o = p.useRef(!1);
9564
9563
  return /* @__PURE__ */ l.jsx(
9565
9564
  nd,
9566
9565
  {
@@ -9583,7 +9582,7 @@ var fb = p.forwardRef(
9583
9582
  }
9584
9583
  ), nd = p.forwardRef(
9585
9584
  (e, t) => {
9586
- const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = en(Un, n), c = p.useRef(null), u = Me(t, c);
9585
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = Qt(Un, n), c = p.useRef(null), u = Me(t, c);
9587
9586
  return sa(), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
9588
9587
  /* @__PURE__ */ l.jsx(
9589
9588
  as,
@@ -9616,21 +9615,21 @@ var fb = p.forwardRef(
9616
9615
  }
9617
9616
  ), la = "DialogTitle", rd = p.forwardRef(
9618
9617
  (e, t) => {
9619
- const { __scopeDialog: n, ...r } = e, o = en(la, n);
9618
+ const { __scopeDialog: n, ...r } = e, o = Qt(la, n);
9620
9619
  return /* @__PURE__ */ l.jsx(Ce.h2, { id: o.titleId, ...r, ref: t });
9621
9620
  }
9622
9621
  );
9623
9622
  rd.displayName = la;
9624
9623
  var od = "DialogDescription", sd = p.forwardRef(
9625
9624
  (e, t) => {
9626
- const { __scopeDialog: n, ...r } = e, o = en(od, n);
9625
+ const { __scopeDialog: n, ...r } = e, o = Qt(od, n);
9627
9626
  return /* @__PURE__ */ l.jsx(Ce.p, { id: o.descriptionId, ...r, ref: t });
9628
9627
  }
9629
9628
  );
9630
9629
  sd.displayName = od;
9631
9630
  var id = "DialogClose", ad = p.forwardRef(
9632
9631
  (e, t) => {
9633
- const { __scopeDialog: n, ...r } = e, o = en(id, n);
9632
+ const { __scopeDialog: n, ...r } = e, o = Qt(id, n);
9634
9633
  return /* @__PURE__ */ l.jsx(
9635
9634
  Ce.button,
9636
9635
  {
@@ -10088,7 +10087,7 @@ const jb = B.memo(function({
10088
10087
  onCancelEdit: x,
10089
10088
  onCopy: w
10090
10089
  }) {
10091
- const [y, R] = me(!1), [S, C] = me("collapsed"), [k, E] = me(!1), { currentThreadId: N } = Fi(), { toast: _ } = oa(), [I, F] = me({}), [V, P] = me(!1), [G, W] = me(null), K = u === "phone" || u === "half-screen", D = t.role, O = D === "tool", ie = !(r && D !== "user"), Z = B.useMemo(() => {
10090
+ const [y, R] = me(!1), [S, C] = me("collapsed"), [k, E] = me(!1), { currentThreadId: N } = Fi(), { toast: _ } = oa(), [I, F] = me({}), [V, P] = me(!1), [G, W] = me(null), K = u === "phone" || u === "half-screen", D = t.role, O = D === "tool", ie = !(r && D !== "user"), J = B.useMemo(() => {
10092
10091
  switch (D) {
10093
10092
  case "user":
10094
10093
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -10101,15 +10100,15 @@ const jb = B.memo(function({
10101
10100
  default:
10102
10101
  return "text-[hsl(var(--chat-bubble-ai-text))]";
10103
10102
  }
10104
- }, [D]), ee = Gt(() => Tb(t.content), [t.content]), M = Gt(() => Rb(t.content), [t.content]), J = Gt(
10103
+ }, [D]), ee = qt(() => Tb(t.content), [t.content]), M = qt(() => Rb(t.content), [t.content]), Z = qt(
10105
10104
  () => t.content.filter((ce) => ce.type === "image_url"),
10106
10105
  [t.content]
10107
- ), Re = Gt(
10106
+ ), Re = qt(
10108
10107
  () => t.content.filter((ce) => ce.type === "file"),
10109
10108
  [t.content]
10110
- ), fe = Gt(() => Eb(t.content), [t.content]);
10111
- Gt(() => Ib(t.content), [t.content]);
10112
- const L = Gt(() => fe.length <= Pn ? fe : `${fe.slice(0, Pn)}
10109
+ ), fe = qt(() => Eb(t.content), [t.content]);
10110
+ qt(() => Ib(t.content), [t.content]);
10111
+ const L = qt(() => fe.length <= Pn ? fe : `${fe.slice(0, Pn)}
10113
10112
  … [truncated ${fe.length - Pn} chars]`, [fe]), j = Ab(ee, r, o), H = B.useCallback(async (ce = "all") => {
10114
10113
  const he = ce === "visible" && O ? L : O ? fe : ee;
10115
10114
  async function ye(Pe) {
@@ -10185,7 +10184,7 @@ const jb = B.memo(function({
10185
10184
  console.error("File click error:", ye), F((Pe) => ({ ...Pe, [he]: !1 }));
10186
10185
  }
10187
10186
  }, [ie, I, _, N]), $e = B.useCallback(() => {
10188
- const ue = X(K ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", Z);
10187
+ const ue = X(K ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", J);
10189
10188
  switch (D) {
10190
10189
  case "user":
10191
10190
  return /* @__PURE__ */ l.jsx(Ap, { className: ue });
@@ -10196,7 +10195,7 @@ const jb = B.memo(function({
10196
10195
  default:
10197
10196
  return /* @__PURE__ */ l.jsx(Da, { className: ue });
10198
10197
  }
10199
- }, [K, Z, D]), De = B.useCallback(() => {
10198
+ }, [K, J, D]), De = B.useCallback(() => {
10200
10199
  const ce = "group relative mb-4 flex w-full";
10201
10200
  switch (D) {
10202
10201
  case "user":
@@ -10330,7 +10329,7 @@ const jb = B.memo(function({
10330
10329
  }
10331
10330
  return /* @__PURE__ */ l.jsx(Bs, { content: ee.trim(), allowHtml: !1 });
10332
10331
  }, [ee, D, h, m, k, K]), dt = B.useCallback(() => {
10333
- if (!(ee.trim().length > 0 || J.length > 0 || Re.length > 0) && !r)
10332
+ if (!(ee.trim().length > 0 || Z.length > 0 || Re.length > 0) && !r)
10334
10333
  return Be();
10335
10334
  if (t.model === "reflection") {
10336
10335
  const ue = ee.trim(), he = Js(ue);
@@ -10364,11 +10363,11 @@ const jb = B.memo(function({
10364
10363
  if (!O)
10365
10364
  return r ? /* @__PURE__ */ l.jsxs("div", { "aria-busy": "true", role: "status", children: [
10366
10365
  Ze(),
10367
- r && /* @__PURE__ */ l.jsx(_b, { className: Z })
10366
+ r && /* @__PURE__ */ l.jsx(_b, { className: J })
10368
10367
  ] }) : /* @__PURE__ */ l.jsx("div", { className: "space-y-2", children: t.content.map((ue, he) => /* @__PURE__ */ l.jsx(ke, { part: ue, i: he }, he)) });
10369
10368
  }, [
10370
10369
  ee,
10371
- J.length,
10370
+ Z.length,
10372
10371
  Re.length,
10373
10372
  r,
10374
10373
  t.model,
@@ -10380,8 +10379,8 @@ const jb = B.memo(function({
10380
10379
  Be,
10381
10380
  Ze,
10382
10381
  qe,
10383
- Z
10384
- ]), ft = Gt(() => Nb(t), [t]);
10382
+ J
10383
+ ]), ft = qt(() => Nb(t), [t]);
10385
10384
  return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
10386
10385
  /* @__PURE__ */ l.jsx("div", { className: X(De(), b.container), children: /* @__PURE__ */ l.jsxs("div", { className: X(ve(), b.content), children: [
10387
10386
  (a || c || O) && /* @__PURE__ */ l.jsxs(
@@ -10390,7 +10389,7 @@ const jb = B.memo(function({
10390
10389
  className: X(
10391
10390
  "flex items-center justify-between mb-2 pb-2 border-b border-current/10",
10392
10391
  K && "mb-1 pb-1",
10393
- Z,
10392
+ J,
10394
10393
  b.header
10395
10394
  ),
10396
10395
  children: [
@@ -10403,7 +10402,7 @@ const jb = B.memo(function({
10403
10402
  variant: "outline",
10404
10403
  className: X(
10405
10404
  "text-xs flex items-center gap-1 cursor-pointer",
10406
- Z,
10405
+ J,
10407
10406
  "border border-current/40",
10408
10407
  K && "text-xs h-4"
10409
10408
  ),
@@ -10425,7 +10424,7 @@ const jb = B.memo(function({
10425
10424
  {
10426
10425
  variant: "ghost",
10427
10426
  size: "sm",
10428
- className: X("h-6 px-1", Z, "hover:bg-foreground/10"),
10427
+ className: X("h-6 px-1", J, "hover:bg-foreground/10"),
10429
10428
  onClick: () => C((ce) => ce === "collapsed" ? "preview" : "collapsed"),
10430
10429
  children: /* @__PURE__ */ l.jsxs("span", { className: "text-xs flex items-center gap-1", children: [
10431
10430
  "Tool Output ",
@@ -10438,7 +10437,7 @@ const jb = B.memo(function({
10438
10437
  a && t.createdAt && /* @__PURE__ */ l.jsx(
10439
10438
  "time",
10440
10439
  {
10441
- className: X("text-xs opacity-60", Z, K && "text-xs"),
10440
+ className: X("text-xs opacity-60", J, K && "text-xs"),
10442
10441
  dateTime: new Date(t.createdAt).toISOString(),
10443
10442
  title: new Date(t.createdAt).toLocaleString(),
10444
10443
  children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(t.createdAt))
@@ -10460,10 +10459,10 @@ const jb = B.memo(function({
10460
10459
  variant: "ghost",
10461
10460
  size: "sm",
10462
10461
  onClick: () => H(O ? "visible" : "all"),
10463
- className: X("h-6 w-6 p-0 hover:bg-foreground/10", Z, K && "h-5 w-5"),
10462
+ className: X("h-6 w-6 p-0 hover:bg-foreground/10", J, K && "h-5 w-5"),
10464
10463
  "aria-label": O ? "Copy visible" : "Copy message",
10465
10464
  title: O ? "Copy visible portion" : "Copy message",
10466
- children: /* @__PURE__ */ l.jsx(La, { className: X(y ? "text-success" : Z, K ? "h-3 w-3" : "h-4 w-4") })
10465
+ children: /* @__PURE__ */ l.jsx(La, { className: X(y ? "text-success" : J, K ? "h-3 w-3" : "h-4 w-4") })
10467
10466
  }
10468
10467
  ),
10469
10468
  O && /* @__PURE__ */ l.jsx(
@@ -10472,7 +10471,7 @@ const jb = B.memo(function({
10472
10471
  variant: "ghost",
10473
10472
  size: "sm",
10474
10473
  onClick: () => H("all"),
10475
- className: X("h-6 px-1 text-xs hover:bg-foreground/10", Z),
10474
+ className: X("h-6 px-1 text-xs hover:bg-foreground/10", J),
10476
10475
  "aria-label": "Copy all (may be large)",
10477
10476
  title: "Copy all (may be large)",
10478
10477
  children: "all"
@@ -10485,9 +10484,9 @@ const jb = B.memo(function({
10485
10484
  variant: "ghost",
10486
10485
  size: "sm",
10487
10486
  onClick: Q,
10488
- className: X("h-6 w-6 p-0 hover:bg-foreground/10", Z, K && "h-5 w-5"),
10487
+ className: X("h-6 w-6 p-0 hover:bg-foreground/10", J, K && "h-5 w-5"),
10489
10488
  "aria-label": "Edit message",
10490
- children: /* @__PURE__ */ l.jsx($a, { className: X(Z, K ? "h-3 w-3" : "h-4 w-4") })
10489
+ children: /* @__PURE__ */ l.jsx($a, { className: X(J, K ? "h-3 w-3" : "h-4 w-4") })
10491
10490
  }
10492
10491
  ),
10493
10492
  D === "assistant" && g && /* @__PURE__ */ l.jsx(
@@ -10496,9 +10495,9 @@ const jb = B.memo(function({
10496
10495
  variant: "ghost",
10497
10496
  size: "sm",
10498
10497
  onClick: le,
10499
- className: X("h-6 w-6 p-0 hover:bg-foreground/10", Z, K && "h-5 w-5"),
10498
+ className: X("h-6 w-6 p-0 hover:bg-foreground/10", J, K && "h-5 w-5"),
10500
10499
  "aria-label": "Regenerate response",
10501
- children: /* @__PURE__ */ l.jsx(ri, { className: X(Z, K ? "h-3 w-3" : "h-4 w-4") })
10500
+ children: /* @__PURE__ */ l.jsx(ri, { className: X(J, K ? "h-3 w-3" : "h-4 w-4") })
10502
10501
  }
10503
10502
  )
10504
10503
  ]
@@ -10692,7 +10691,7 @@ const Ql = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, wd = B.forwa
10692
10691
  }, w) => {
10693
10692
  const y = rt(null), R = rt(null), S = rt(!1), [C, k] = me(!0), E = Ye((I) => {
10694
10693
  k(I), g && g(!I), x && x(I);
10695
- }, [g, x]), N = Gt(() => {
10694
+ }, [g, x]), N = qt(() => {
10696
10695
  if (a)
10697
10696
  return async () => {
10698
10697
  if (!S.current) {
@@ -11492,7 +11491,7 @@ function hn(e) {
11492
11491
  function Sd(e) {
11493
11492
  return gs() ? e instanceof Node || e instanceof Ot(e).Node : !1;
11494
11493
  }
11495
- function Jt(e) {
11494
+ function Xt(e) {
11496
11495
  return gs() ? e instanceof Element || e instanceof Ot(e).Element : !1;
11497
11496
  }
11498
11497
  function un(e) {
@@ -11508,7 +11507,7 @@ function Yr(e) {
11508
11507
  overflowX: n,
11509
11508
  overflowY: r,
11510
11509
  display: o
11511
- } = Zt(e);
11510
+ } = Jt(e);
11512
11511
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !iy.has(o);
11513
11512
  }
11514
11513
  const ay = /* @__PURE__ */ new Set(["table", "td", "th"]);
@@ -11527,7 +11526,7 @@ function xs(e) {
11527
11526
  }
11528
11527
  const uy = ["transform", "translate", "scale", "rotate", "perspective"], dy = ["transform", "translate", "scale", "rotate", "perspective", "filter"], fy = ["paint", "layout", "strict", "content"];
11529
11528
  function pa(e) {
11530
- const t = ma(), n = Jt(e) ? Zt(e) : e;
11529
+ const t = ma(), n = Xt(e) ? Jt(e) : e;
11531
11530
  return uy.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || dy.some((r) => (n.willChange || "").includes(r)) || fy.some((r) => (n.contain || "").includes(r));
11532
11531
  }
11533
11532
  function hy(e) {
@@ -11548,11 +11547,11 @@ const py = /* @__PURE__ */ new Set(["html", "body", "#document"]);
11548
11547
  function ur(e) {
11549
11548
  return py.has(xr(e));
11550
11549
  }
11551
- function Zt(e) {
11550
+ function Jt(e) {
11552
11551
  return Ot(e).getComputedStyle(e);
11553
11552
  }
11554
11553
  function vs(e) {
11555
- return Jt(e) ? {
11554
+ return Xt(e) ? {
11556
11555
  scrollLeft: e.scrollLeft,
11557
11556
  scrollTop: e.scrollTop
11558
11557
  } : {
@@ -11590,7 +11589,7 @@ function Ci(e) {
11590
11589
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
11591
11590
  }
11592
11591
  function Td(e) {
11593
- const t = Zt(e);
11592
+ const t = Jt(e);
11594
11593
  let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
11595
11594
  const o = un(e), s = o ? e.offsetWidth : n, i = o ? e.offsetHeight : r, a = Lo(n) !== s || Lo(r) !== i;
11596
11595
  return a && (n = s, r = i), {
@@ -11600,7 +11599,7 @@ function Td(e) {
11600
11599
  };
11601
11600
  }
11602
11601
  function ga(e) {
11603
- return Jt(e) ? e : e.contextElement;
11602
+ return Xt(e) ? e : e.contextElement;
11604
11603
  }
11605
11604
  function ir(e) {
11606
11605
  const t = ga(e);
@@ -11632,14 +11631,14 @@ function Wn(e, t, n, r) {
11632
11631
  t === void 0 && (t = !1), n === void 0 && (n = !1);
11633
11632
  const o = e.getBoundingClientRect(), s = ga(e);
11634
11633
  let i = cn(1);
11635
- t && (r ? Jt(r) && (i = ir(r)) : i = ir(e));
11634
+ t && (r ? Xt(r) && (i = ir(r)) : i = ir(e));
11636
11635
  const a = gy(s, n, r) ? Rd(s) : cn(0);
11637
11636
  let c = (o.left + a.x) / i.x, u = (o.top + a.y) / i.y, d = o.width / i.x, f = o.height / i.y;
11638
11637
  if (s) {
11639
- const h = Ot(s), m = r && Jt(r) ? Ot(r) : r;
11638
+ const h = Ot(s), m = r && Xt(r) ? Ot(r) : r;
11640
11639
  let b = h, v = Ci(b);
11641
11640
  for (; v && r && m !== b; ) {
11642
- const g = ir(v), x = v.getBoundingClientRect(), w = Zt(v), y = x.left + (v.clientLeft + parseFloat(w.paddingLeft)) * g.x, R = x.top + (v.clientTop + parseFloat(w.paddingTop)) * g.y;
11641
+ const g = ir(v), x = v.getBoundingClientRect(), w = Jt(v), y = x.left + (v.clientLeft + parseFloat(w.paddingLeft)) * g.x, R = x.top + (v.clientTop + parseFloat(w.paddingTop)) * g.y;
11643
11642
  c *= g.x, u *= g.y, d *= g.x, f *= g.y, c += y, u += R, b = Ot(v), v = Ci(b);
11644
11643
  }
11645
11644
  }
@@ -11699,7 +11698,7 @@ function wy(e) {
11699
11698
  const t = hn(e), n = vs(e), r = e.ownerDocument.body, o = _t(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = _t(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
11700
11699
  let i = -n.scrollLeft + xa(e);
11701
11700
  const a = -n.scrollTop;
11702
- return Zt(r).direction === "rtl" && (i += _t(t.clientWidth, r.clientWidth) - o), {
11701
+ return Jt(r).direction === "rtl" && (i += _t(t.clientWidth, r.clientWidth) - o), {
11703
11702
  width: o,
11704
11703
  height: s,
11705
11704
  x: i,
@@ -11737,7 +11736,7 @@ function ic(e, t, n) {
11737
11736
  r = by(e, n);
11738
11737
  else if (t === "document")
11739
11738
  r = wy(hn(e));
11740
- else if (Jt(t))
11739
+ else if (Xt(t))
11741
11740
  r = Sy(t, n);
11742
11741
  else {
11743
11742
  const o = Rd(e);
@@ -11752,17 +11751,17 @@ function ic(e, t, n) {
11752
11751
  }
11753
11752
  function Ed(e, t) {
11754
11753
  const n = Rn(e);
11755
- return n === t || !Jt(n) || ur(n) ? !1 : Zt(n).position === "fixed" || Ed(n, t);
11754
+ return n === t || !Xt(n) || ur(n) ? !1 : Jt(n).position === "fixed" || Ed(n, t);
11756
11755
  }
11757
11756
  function Cy(e, t) {
11758
11757
  const n = t.get(e);
11759
11758
  if (n)
11760
11759
  return n;
11761
- let r = Fr(e, [], !1).filter((a) => Jt(a) && xr(a) !== "body"), o = null;
11762
- const s = Zt(e).position === "fixed";
11760
+ let r = Fr(e, [], !1).filter((a) => Xt(a) && xr(a) !== "body"), o = null;
11761
+ const s = Jt(e).position === "fixed";
11763
11762
  let i = s ? Rn(e) : e;
11764
- for (; Jt(i) && !ur(i); ) {
11765
- const a = Zt(i), c = pa(i);
11763
+ for (; Xt(i) && !ur(i); ) {
11764
+ const a = Jt(i), c = pa(i);
11766
11765
  !c && a.position === "fixed" && (o = null), (s ? !c && !o : !c && a.position === "static" && !!o && yy.has(o.position) || Yr(i) && !c && Ed(e, i)) ? r = r.filter((d) => d !== i) : o = a, i = Rn(i);
11767
11766
  }
11768
11767
  return t.set(e, r), r;
@@ -11820,10 +11819,10 @@ function ky(e, t, n) {
11820
11819
  };
11821
11820
  }
11822
11821
  function Zs(e) {
11823
- return Zt(e).position === "static";
11822
+ return Jt(e).position === "static";
11824
11823
  }
11825
11824
  function ac(e, t) {
11826
- if (!un(e) || Zt(e).position === "fixed")
11825
+ if (!un(e) || Jt(e).position === "fixed")
11827
11826
  return null;
11828
11827
  if (t)
11829
11828
  return t(e);
@@ -11837,7 +11836,7 @@ function Id(e, t) {
11837
11836
  if (!un(e)) {
11838
11837
  let o = Rn(e);
11839
11838
  for (; o && !ur(o); ) {
11840
- if (Jt(o) && !Zs(o))
11839
+ if (Xt(o) && !Zs(o))
11841
11840
  return o;
11842
11841
  o = Rn(o);
11843
11842
  }
@@ -11861,7 +11860,7 @@ const Ey = async function(e) {
11861
11860
  };
11862
11861
  };
11863
11862
  function Iy(e) {
11864
- return Zt(e).direction === "rtl";
11863
+ return Jt(e).direction === "rtl";
11865
11864
  }
11866
11865
  const Ny = {
11867
11866
  convertOffsetParentRelativeRectToViewportRelativeRect: xy,
@@ -11872,7 +11871,7 @@ const Ny = {
11872
11871
  getClientRects: vy,
11873
11872
  getDimensions: Ry,
11874
11873
  getScale: ir,
11875
- isElement: Jt,
11874
+ isElement: Xt,
11876
11875
  isRTL: Iy
11877
11876
  };
11878
11877
  function Nd(e, t) {
@@ -12270,11 +12269,11 @@ var wa = "PopperContent", [Qy, e0] = Pd(wa), $d = p.forwardRef(
12270
12269
  r0({ arrowWidth: k, arrowHeight: E }),
12271
12270
  h && Gy({ strategy: "referenceHidden", ...V })
12272
12271
  ]
12273
- }), [O, ie] = Bd(W), Z = gt(b);
12272
+ }), [O, ie] = Bd(W), J = gt(b);
12274
12273
  mt(() => {
12275
- K && (Z == null || Z());
12276
- }, [K, Z]);
12277
- const ee = (L = D.arrow) == null ? void 0 : L.x, M = (j = D.arrow) == null ? void 0 : j.y, J = ((H = D.arrow) == null ? void 0 : H.centerOffset) !== 0, [Re, fe] = p.useState();
12274
+ K && (J == null || J());
12275
+ }, [K, J]);
12276
+ const ee = (L = D.arrow) == null ? void 0 : L.x, M = (j = D.arrow) == null ? void 0 : j.y, Z = ((H = D.arrow) == null ? void 0 : H.centerOffset) !== 0, [Re, fe] = p.useState();
12278
12277
  return mt(() => {
12279
12278
  x && fe(window.getComputedStyle(x).zIndex);
12280
12279
  }, [x]), /* @__PURE__ */ l.jsx(
@@ -12309,7 +12308,7 @@ var wa = "PopperContent", [Qy, e0] = Pd(wa), $d = p.forwardRef(
12309
12308
  onArrowChange: S,
12310
12309
  arrowX: ee,
12311
12310
  arrowY: M,
12312
- shouldHideArrow: J,
12311
+ shouldHideArrow: Z,
12313
12312
  children: /* @__PURE__ */ l.jsx(
12314
12313
  Ce.div,
12315
12314
  {
@@ -12620,14 +12619,14 @@ var ya = "MenuPortal", [R0, nf] = Xn(ya, {
12620
12619
  return /* @__PURE__ */ l.jsx(R0, { scope: t, forceMount: n, children: /* @__PURE__ */ l.jsx(Mt, { present: n || s.open, children: /* @__PURE__ */ l.jsx(ls, { asChild: !0, container: o, children: r }) }) });
12621
12620
  };
12622
12621
  rf.displayName = ya;
12623
- var Wt = "MenuContent", [k0, Sa] = Xn(Wt), of = p.forwardRef(
12622
+ var Ut = "MenuContent", [k0, Sa] = Xn(Ut), of = p.forwardRef(
12624
12623
  (e, t) => {
12625
- const n = nf(Wt, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = Jn(Wt, e.__scopeMenu), i = Zr(Wt, e.__scopeMenu);
12624
+ const n = nf(Ut, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = Jn(Ut, e.__scopeMenu), i = Zr(Ut, e.__scopeMenu);
12626
12625
  return /* @__PURE__ */ l.jsx(zr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ l.jsx(Mt, { present: r || s.open, children: /* @__PURE__ */ l.jsx(zr.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ l.jsx(E0, { ...o, ref: t }) : /* @__PURE__ */ l.jsx(I0, { ...o, ref: t }) }) }) });
12627
12626
  }
12628
12627
  ), E0 = p.forwardRef(
12629
12628
  (e, t) => {
12630
- const n = Jn(Wt, e.__scopeMenu), r = p.useRef(null), o = Me(t, r);
12629
+ const n = Jn(Ut, e.__scopeMenu), r = p.useRef(null), o = Me(t, r);
12631
12630
  return p.useEffect(() => {
12632
12631
  const s = r.current;
12633
12632
  if (s) return ia(s);
@@ -12649,7 +12648,7 @@ var Wt = "MenuContent", [k0, Sa] = Xn(Wt), of = p.forwardRef(
12649
12648
  );
12650
12649
  }
12651
12650
  ), I0 = p.forwardRef((e, t) => {
12652
- const n = Jn(Wt, e.__scopeMenu);
12651
+ const n = Jn(Ut, e.__scopeMenu);
12653
12652
  return /* @__PURE__ */ l.jsx(
12654
12653
  Ca,
12655
12654
  {
@@ -12678,17 +12677,17 @@ var Wt = "MenuContent", [k0, Sa] = Xn(Wt), of = p.forwardRef(
12678
12677
  onDismiss: m,
12679
12678
  disableOutsideScroll: b,
12680
12679
  ...v
12681
- } = e, g = Jn(Wt, n), x = Zr(Wt, n), w = bs(n), y = ef(n), R = b0(n), [S, C] = p.useState(null), k = p.useRef(null), E = Me(t, k, g.onContentChange), N = p.useRef(0), _ = p.useRef(""), I = p.useRef(0), F = p.useRef(null), V = p.useRef("right"), P = p.useRef(0), G = b ? us : p.Fragment, W = b ? { as: N0, allowPinchZoom: !0 } : void 0, K = (O) => {
12680
+ } = e, g = Jn(Ut, n), x = Zr(Ut, n), w = bs(n), y = ef(n), R = b0(n), [S, C] = p.useState(null), k = p.useRef(null), E = Me(t, k, g.onContentChange), N = p.useRef(0), _ = p.useRef(""), I = p.useRef(0), F = p.useRef(null), V = p.useRef("right"), P = p.useRef(0), G = b ? us : p.Fragment, W = b ? { as: N0, allowPinchZoom: !0 } : void 0, K = (O) => {
12682
12681
  var L, j;
12683
- const ie = _.current + O, Z = R().filter((H) => !H.disabled), ee = document.activeElement, M = (L = Z.find((H) => H.ref.current === ee)) == null ? void 0 : L.textValue, J = Z.map((H) => H.textValue), Re = B0(J, ie, M), fe = (j = Z.find((H) => H.textValue === Re)) == null ? void 0 : j.ref.current;
12682
+ const ie = _.current + O, J = R().filter((H) => !H.disabled), ee = document.activeElement, M = (L = J.find((H) => H.ref.current === ee)) == null ? void 0 : L.textValue, Z = J.map((H) => H.textValue), Re = B0(Z, ie, M), fe = (j = J.find((H) => H.textValue === Re)) == null ? void 0 : j.ref.current;
12684
12683
  (function H(Q) {
12685
12684
  _.current = Q, window.clearTimeout(N.current), Q !== "" && (N.current = window.setTimeout(() => H(""), 1e3));
12686
12685
  })(ie), fe && setTimeout(() => fe.focus());
12687
12686
  };
12688
12687
  p.useEffect(() => () => window.clearTimeout(N.current), []), sa();
12689
12688
  const D = p.useCallback((O) => {
12690
- var Z, ee;
12691
- return V.current === ((Z = F.current) == null ? void 0 : Z.side) && U0(O, (ee = F.current) == null ? void 0 : ee.area);
12689
+ var J, ee;
12690
+ return V.current === ((J = F.current) == null ? void 0 : J.side) && U0(O, (ee = F.current) == null ? void 0 : ee.area);
12692
12691
  }, []);
12693
12692
  return /* @__PURE__ */ l.jsx(
12694
12693
  k0,
@@ -12765,10 +12764,10 @@ var Wt = "MenuContent", [k0, Sa] = Xn(Wt), of = p.forwardRef(
12765
12764
  ref: E,
12766
12765
  style: { outline: "none", ...v.style },
12767
12766
  onKeyDown: ae(v.onKeyDown, (O) => {
12768
- const Z = O.target.closest("[data-radix-menu-content]") === O.currentTarget, ee = O.ctrlKey || O.altKey || O.metaKey, M = O.key.length === 1;
12769
- Z && (O.key === "Tab" && O.preventDefault(), !ee && M && K(O.key));
12770
- const J = k.current;
12771
- if (O.target !== J || !x0.includes(O.key)) return;
12767
+ const J = O.target.closest("[data-radix-menu-content]") === O.currentTarget, ee = O.ctrlKey || O.altKey || O.metaKey, M = O.key.length === 1;
12768
+ J && (O.key === "Tab" && O.preventDefault(), !ee && M && K(O.key));
12769
+ const Z = k.current;
12770
+ if (O.target !== Z || !x0.includes(O.key)) return;
12772
12771
  O.preventDefault();
12773
12772
  const fe = R().filter((L) => !L.disabled).map((L) => L.ref.current);
12774
12773
  Zd.includes(O.key) && fe.reverse(), F0(fe);
@@ -12779,8 +12778,8 @@ var Wt = "MenuContent", [k0, Sa] = Xn(Wt), of = p.forwardRef(
12779
12778
  onPointerMove: ae(
12780
12779
  e.onPointerMove,
12781
12780
  Br((O) => {
12782
- const ie = O.target, Z = P.current !== O.clientX;
12783
- if (O.currentTarget.contains(ie) && Z) {
12781
+ const ie = O.target, J = P.current !== O.clientX;
12782
+ if (O.currentTarget.contains(ie) && J) {
12784
12783
  const ee = O.clientX > P.current ? "right" : "left";
12785
12784
  V.current = ee, P.current = O.clientX;
12786
12785
  }
@@ -12798,7 +12797,7 @@ var Wt = "MenuContent", [k0, Sa] = Xn(Wt), of = p.forwardRef(
12798
12797
  );
12799
12798
  }
12800
12799
  );
12801
- of.displayName = Wt;
12800
+ of.displayName = Ut;
12802
12801
  var A0 = "MenuGroup", Ta = p.forwardRef(
12803
12802
  (e, t) => {
12804
12803
  const { __scopeMenu: n, ...r } = e;
@@ -13058,7 +13057,7 @@ var $0 = "MenuSub", [yT, xf] = Xn($0), Er = "MenuSubTrigger", vf = p.forwardRef(
13058
13057
  vf.displayName = Er;
13059
13058
  var wf = "MenuSubContent", bf = p.forwardRef(
13060
13059
  (e, t) => {
13061
- const n = nf(Wt, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = Jn(Wt, e.__scopeMenu), i = Zr(Wt, e.__scopeMenu), a = xf(wf, e.__scopeMenu), c = p.useRef(null), u = Me(t, c);
13060
+ const n = nf(Ut, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = Jn(Ut, e.__scopeMenu), i = Zr(Ut, e.__scopeMenu), a = xf(wf, e.__scopeMenu), c = p.useRef(null), u = Me(t, c);
13062
13061
  return /* @__PURE__ */ l.jsx(zr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ l.jsx(Mt, { present: r || s.open, children: /* @__PURE__ */ l.jsx(zr.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ l.jsx(
13063
13062
  Ca,
13064
13063
  {
@@ -13455,7 +13454,7 @@ function ti({
13455
13454
  isLoadingHistory: I,
13456
13455
  loadOlderMessages: F,
13457
13456
  api: V
13458
- } = Fi(), [P, G] = me(null), [W, K] = me(""), [D, O] = me(null), [ie, Z] = me([]), [ee, M] = me(!1), [J, Re] = me(null), [fe, L] = me(null), [j, H] = me(!1), [Q, le] = me(null), [oe, $e] = me([]), [De, ve] = me(null), [ke, Be] = me(null), [Ze, qe] = me(!1), dt = rt(null), ft = rt(null), ce = rt(null), [ue, he] = me("desktop");
13457
+ } = Fi(), [P, G] = me(null), [W, K] = me(""), [D, O] = me(null), [ie, J] = me([]), [ee, M] = me(!1), [Z, Re] = me(null), [fe, L] = me(null), [j, H] = me(!1), [Q, le] = me(null), [oe, $e] = me([]), [De, ve] = me(null), [ke, Be] = me(null), [Ze, qe] = me(!1), dt = rt(null), ft = rt(null), ce = rt(null), [ue, he] = me("desktop");
13459
13458
  ct(() => {
13460
13459
  const te = () => {
13461
13460
  const pe = window.innerWidth;
@@ -13474,20 +13473,20 @@ function ti({
13474
13473
  checkpointNs: C ?? null
13475
13474
  }, je = ce.current;
13476
13475
  if (!(je && je.threadId === pe.threadId && je.checkpointId === pe.checkpointId && je.checkpointNs === pe.checkpointNs))
13477
- return k(b).then((ze) => {
13476
+ return k(b).then((Fe) => {
13478
13477
  var yr;
13479
13478
  if (te) return;
13480
- const Lt = ((ze == null ? void 0 : ze.checkpoints) ?? []).slice().sort((mn, Sr) => new Date(Sr.createdAt).getTime() - new Date(mn.createdAt).getTime());
13481
- $e(Lt);
13482
- const tn = De, wr = tn && Lt.some((mn) => mn.checkpointId === tn) ? tn : ((yr = Lt[0]) == null ? void 0 : yr.checkpointId) ?? null;
13479
+ const en = ((Fe == null ? void 0 : Fe.checkpoints) ?? []).slice().sort((mn, Sr) => new Date(Sr.createdAt).getTime() - new Date(mn.createdAt).getTime());
13480
+ $e(en);
13481
+ const tn = De, wr = tn && en.some((mn) => mn.checkpointId === tn) ? tn : ((yr = en[0]) == null ? void 0 : yr.checkpointId) ?? null;
13483
13482
  let br = null;
13484
13483
  if (wr) {
13485
- const mn = Lt.find((Sr) => Sr.checkpointId === wr);
13484
+ const mn = en.find((Sr) => Sr.checkpointId === wr);
13486
13485
  br = (mn == null ? void 0 : mn.checkpointNs) ?? null;
13487
13486
  }
13488
13487
  ve(wr), Be(br), ce.current = pe;
13489
- }).catch((ze) => {
13490
- console.error("ChatInterface - listCheckpoints error:", ze), te || ($e([]), ce.current = null);
13488
+ }).catch((Fe) => {
13489
+ console.error("ChatInterface - listCheckpoints error:", Fe), te || ($e([]), ce.current = null);
13491
13490
  }), () => {
13492
13491
  te = !0;
13493
13492
  };
@@ -13542,10 +13541,10 @@ function ti({
13542
13541
  checkpointNs: ke ?? C ?? void 0,
13543
13542
  payloadExtras: P ? { edit: !0, originalMessageId: P } : void 0,
13544
13543
  attachments: ie
13545
- }), f == null || f(pe), O(null), Z([]), G(null), K("");
13544
+ }), f == null || f(pe), O(null), J([]), G(null), K("");
13546
13545
  } catch (je) {
13547
- const ze = (je == null ? void 0 : je.message) || "Failed to send message";
13548
- O(ze), m == null || m(ze);
13546
+ const Fe = (je == null ? void 0 : je.message) || "Failed to send message";
13547
+ O(Fe), m == null || m(Fe);
13549
13548
  }
13550
13549
  }
13551
13550
  }, $ = B.useCallback((te, pe) => {
@@ -13556,18 +13555,18 @@ function ti({
13556
13555
  $(te, pe);
13557
13556
  }, [$]), tt = Ye((te) => {
13558
13557
  const pe = (je) => {
13559
- const ze = je.content || [], Lt = ze.filter((tn) => tn.type === "text").map((tn) => tn.text).join("");
13560
- if (Lt) return Lt;
13558
+ const Fe = je.content || [], en = Fe.filter((tn) => tn.type === "text").map((tn) => tn.text).join("");
13559
+ if (en) return en;
13561
13560
  try {
13562
- return JSON.stringify(ze, null, 2);
13561
+ return JSON.stringify(Fe, null, 2);
13563
13562
  } catch {
13564
- return String(ze);
13563
+ return String(Fe);
13565
13564
  }
13566
13565
  };
13567
13566
  for (let je = te - 1; je >= 0; je--)
13568
13567
  if (v[je].role === "user") {
13569
- const ze = pe(v[je]);
13570
- ze && y(ze, {
13568
+ const Fe = pe(v[je]);
13569
+ Fe && y(Fe, {
13571
13570
  checkpointId: De ?? S ?? void 0,
13572
13571
  checkpointNs: ke ?? C ?? void 0
13573
13572
  });
@@ -13575,8 +13574,8 @@ function ti({
13575
13574
  }
13576
13575
  }, [v, y, De, ke, S, C]), Ne = (te) => {
13577
13576
  const pe = Array.from(te.target.files || []);
13578
- Z((je) => [...je, ...pe]);
13579
- }, at = (te) => Z((pe) => pe.filter((je, ze) => te !== ze)), Dt = async (te) => {
13577
+ J((je) => [...je, ...pe]);
13578
+ }, at = (te) => J((pe) => pe.filter((je, Fe) => te !== Fe)), Dt = async (te) => {
13580
13579
  const pe = (te.target.files || [])[0];
13581
13580
  if (pe) {
13582
13581
  Re(null), L(null), M(!0);
@@ -13589,8 +13588,8 @@ function ti({
13589
13588
  const je = `Uploaded ${pe.name} - processing through chat stream`;
13590
13589
  L(je);
13591
13590
  } catch (je) {
13592
- const ze = je instanceof Error ? je.message : "Failed to upload Excel file";
13593
- console.error("Excel upload failed", je), Re(ze), m == null || m(ze);
13591
+ const Fe = je instanceof Error ? je.message : "Failed to upload Excel file";
13592
+ console.error("Excel upload failed", je), Re(Fe), m == null || m(Fe);
13594
13593
  } finally {
13595
13594
  M(!1), te.target.value = "";
13596
13595
  }
@@ -13607,7 +13606,7 @@ function ti({
13607
13606
  await N(), ve(null), Be(null);
13608
13607
  return;
13609
13608
  }
13610
- const pe = oe.find((ze) => ze.checkpointId === te), je = (pe == null ? void 0 : pe.checkpointNs) ?? null;
13609
+ const pe = oe.find((Fe) => Fe.checkpointId === te), je = (pe == null ? void 0 : pe.checkpointNs) ?? null;
13611
13610
  await E(te, je), ve(te), Be(je);
13612
13611
  } finally {
13613
13612
  qe(!1);
@@ -13734,7 +13733,7 @@ function ti({
13734
13733
  " Uploading Excel file..."
13735
13734
  ] }),
13736
13735
  fe && !ee && /* @__PURE__ */ l.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: fe }),
13737
- J && !ee && /* @__PURE__ */ l.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: J })
13736
+ Z && !ee && /* @__PURE__ */ l.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: Z })
13738
13737
  ] })
13739
13738
  ] }),
13740
13739
  D && /* @__PURE__ */ l.jsx("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: D }),
@@ -13817,7 +13816,7 @@ function Ei(e, [t, n]) {
13817
13816
  function PS(e, t) {
13818
13817
  return p.useReducer((n, r) => t[n][r] ?? n, e);
13819
13818
  }
13820
- var Ea = "ScrollArea", [qf, CT] = fn(Ea), [OS, Kt] = qf(Ea), Gf = p.forwardRef(
13819
+ var Ea = "ScrollArea", [qf, CT] = fn(Ea), [OS, Vt] = qf(Ea), Gf = p.forwardRef(
13821
13820
  (e, t) => {
13822
13821
  const {
13823
13822
  __scopeScrollArea: n,
@@ -13870,7 +13869,7 @@ var Ea = "ScrollArea", [qf, CT] = fn(Ea), [OS, Kt] = qf(Ea), Gf = p.forwardRef(
13870
13869
  Gf.displayName = Ea;
13871
13870
  var Yf = "ScrollAreaViewport", Xf = p.forwardRef(
13872
13871
  (e, t) => {
13873
- const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = Kt(Yf, n), a = p.useRef(null), c = Me(t, a, i.onViewportChange);
13872
+ const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = Vt(Yf, n), a = p.useRef(null), c = Me(t, a, i.onViewportChange);
13874
13873
  return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
13875
13874
  /* @__PURE__ */ l.jsx(
13876
13875
  "style",
@@ -13912,7 +13911,7 @@ var Yf = "ScrollAreaViewport", Xf = p.forwardRef(
13912
13911
  Xf.displayName = Yf;
13913
13912
  var pn = "ScrollAreaScrollbar", Ia = p.forwardRef(
13914
13913
  (e, t) => {
13915
- const { forceMount: n, ...r } = e, o = Kt(pn, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: i } = o, a = e.orientation === "horizontal";
13914
+ const { forceMount: n, ...r } = e, o = Vt(pn, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: i } = o, a = e.orientation === "horizontal";
13916
13915
  return p.useEffect(() => (a ? s(!0) : i(!0), () => {
13917
13916
  a ? s(!1) : i(!1);
13918
13917
  }), [a, s, i]), o.type === "hover" ? /* @__PURE__ */ l.jsx(MS, { ...r, ref: t, forceMount: n }) : o.type === "scroll" ? /* @__PURE__ */ l.jsx(DS, { ...r, ref: t, forceMount: n }) : o.type === "auto" ? /* @__PURE__ */ l.jsx(Jf, { ...r, ref: t, forceMount: n }) : o.type === "always" ? /* @__PURE__ */ l.jsx(Na, { ...r, ref: t }) : null;
@@ -13920,7 +13919,7 @@ var pn = "ScrollAreaScrollbar", Ia = p.forwardRef(
13920
13919
  );
13921
13920
  Ia.displayName = pn;
13922
13921
  var MS = p.forwardRef((e, t) => {
13923
- const { forceMount: n, ...r } = e, o = Kt(pn, e.__scopeScrollArea), [s, i] = p.useState(!1);
13922
+ const { forceMount: n, ...r } = e, o = Vt(pn, e.__scopeScrollArea), [s, i] = p.useState(!1);
13924
13923
  return p.useEffect(() => {
13925
13924
  const a = o.scrollArea;
13926
13925
  let c = 0;
@@ -13943,7 +13942,7 @@ var MS = p.forwardRef((e, t) => {
13943
13942
  }
13944
13943
  ) });
13945
13944
  }), DS = p.forwardRef((e, t) => {
13946
- const { forceMount: n, ...r } = e, o = Kt(pn, e.__scopeScrollArea), s = e.orientation === "horizontal", i = Ts(() => c("SCROLL_END"), 100), [a, c] = PS("hidden", {
13945
+ const { forceMount: n, ...r } = e, o = Vt(pn, e.__scopeScrollArea), s = e.orientation === "horizontal", i = Ts(() => c("SCROLL_END"), 100), [a, c] = PS("hidden", {
13947
13946
  hidden: {
13948
13947
  SCROLL: "scrolling"
13949
13948
  },
@@ -13987,7 +13986,7 @@ var MS = p.forwardRef((e, t) => {
13987
13986
  }
13988
13987
  ) });
13989
13988
  }), Jf = p.forwardRef((e, t) => {
13990
- const n = Kt(pn, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, i] = p.useState(!1), a = e.orientation === "horizontal", c = Ts(() => {
13989
+ const n = Vt(pn, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, i] = p.useState(!1), a = e.orientation === "horizontal", c = Ts(() => {
13991
13990
  if (n.viewport) {
13992
13991
  const u = n.viewport.offsetWidth < n.viewport.scrollWidth, d = n.viewport.offsetHeight < n.viewport.scrollHeight;
13993
13992
  i(a ? u : d);
@@ -14002,7 +14001,7 @@ var MS = p.forwardRef((e, t) => {
14002
14001
  }
14003
14002
  ) });
14004
14003
  }), Na = p.forwardRef((e, t) => {
14005
- const { orientation: n = "vertical", ...r } = e, o = Kt(pn, e.__scopeScrollArea), s = p.useRef(null), i = p.useRef(0), [a, c] = p.useState({
14004
+ const { orientation: n = "vertical", ...r } = e, o = Vt(pn, e.__scopeScrollArea), s = p.useRef(null), i = p.useRef(0), [a, c] = p.useState({
14006
14005
  content: 0,
14007
14006
  viewport: 0,
14008
14007
  scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
@@ -14056,7 +14055,7 @@ var MS = p.forwardRef((e, t) => {
14056
14055
  }
14057
14056
  ) : null;
14058
14057
  }), LS = p.forwardRef((e, t) => {
14059
- const { sizes: n, onSizesChange: r, ...o } = e, s = Kt(pn, e.__scopeScrollArea), [i, a] = p.useState(), c = p.useRef(null), u = Me(t, c, s.onScrollbarXChange);
14058
+ const { sizes: n, onSizesChange: r, ...o } = e, s = Vt(pn, e.__scopeScrollArea), [i, a] = p.useState(), c = p.useRef(null), u = Me(t, c, s.onScrollbarXChange);
14060
14059
  return p.useEffect(() => {
14061
14060
  c.current && a(getComputedStyle(c.current));
14062
14061
  }, [c]), /* @__PURE__ */ l.jsx(
@@ -14095,7 +14094,7 @@ var MS = p.forwardRef((e, t) => {
14095
14094
  }
14096
14095
  );
14097
14096
  }), $S = p.forwardRef((e, t) => {
14098
- const { sizes: n, onSizesChange: r, ...o } = e, s = Kt(pn, e.__scopeScrollArea), [i, a] = p.useState(), c = p.useRef(null), u = Me(t, c, s.onScrollbarYChange);
14097
+ const { sizes: n, onSizesChange: r, ...o } = e, s = Vt(pn, e.__scopeScrollArea), [i, a] = p.useState(), c = p.useRef(null), u = Me(t, c, s.onScrollbarYChange);
14099
14098
  return p.useEffect(() => {
14100
14099
  c.current && a(getComputedStyle(c.current));
14101
14100
  }, [c]), /* @__PURE__ */ l.jsx(
@@ -14147,7 +14146,7 @@ var MS = p.forwardRef((e, t) => {
14147
14146
  onWheelScroll: d,
14148
14147
  onResize: f,
14149
14148
  ...h
14150
- } = e, m = Kt(pn, n), [b, v] = p.useState(null), g = Me(t, (N) => v(N)), x = p.useRef(null), w = p.useRef(""), y = m.viewport, R = r.content - r.viewport, S = gt(d), C = gt(c), k = Ts(f, 10);
14149
+ } = e, m = Vt(pn, n), [b, v] = p.useState(null), g = Me(t, (N) => v(N)), x = p.useRef(null), w = p.useRef(""), y = m.viewport, R = r.content - r.viewport, S = gt(d), C = gt(c), k = Ts(f, 10);
14151
14150
  function E(N) {
14152
14151
  if (x.current) {
14153
14152
  const _ = N.clientX - x.current.left, I = N.clientY - x.current.top;
@@ -14195,7 +14194,7 @@ var MS = p.forwardRef((e, t) => {
14195
14194
  }
14196
14195
  ), zS = p.forwardRef(
14197
14196
  (e, t) => {
14198
- const { __scopeScrollArea: n, style: r, ...o } = e, s = Kt(Wo, n), i = Zf(Wo, n), { onThumbPositionChange: a } = i, c = Me(
14197
+ const { __scopeScrollArea: n, style: r, ...o } = e, s = Vt(Wo, n), i = Zf(Wo, n), { onThumbPositionChange: a } = i, c = Me(
14199
14198
  t,
14200
14199
  (f) => i.onThumbChange(f)
14201
14200
  ), u = p.useRef(void 0), d = Ts(() => {
@@ -14235,13 +14234,13 @@ var MS = p.forwardRef((e, t) => {
14235
14234
  eh.displayName = Wo;
14236
14235
  var Aa = "ScrollAreaCorner", th = p.forwardRef(
14237
14236
  (e, t) => {
14238
- const n = Kt(Aa, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
14237
+ const n = Vt(Aa, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
14239
14238
  return n.type !== "scroll" && r ? /* @__PURE__ */ l.jsx(BS, { ...e, ref: t }) : null;
14240
14239
  }
14241
14240
  );
14242
14241
  th.displayName = Aa;
14243
14242
  var BS = p.forwardRef((e, t) => {
14244
- const { __scopeScrollArea: n, ...r } = e, o = Kt(Aa, n), [s, i] = p.useState(0), [a, c] = p.useState(0), u = !!(s && a);
14243
+ const { __scopeScrollArea: n, ...r } = e, o = Vt(Aa, n), [s, i] = p.useState(0), [a, c] = p.useState(0), u = !!(s && a);
14245
14244
  return dr(o.scrollbarX, () => {
14246
14245
  var f;
14247
14246
  const d = ((f = o.scrollbarX) == null ? void 0 : f.offsetHeight) || 0;
@@ -14383,8 +14382,8 @@ function fc({
14383
14382
  const P = async (M) => {
14384
14383
  try {
14385
14384
  await f(M), a == null || a(M), c == null || c(M);
14386
- } catch (J) {
14387
- console.error("Failed to select thread:", J);
14385
+ } catch (Z) {
14386
+ console.error("Failed to select thread:", Z);
14388
14387
  }
14389
14388
  }, G = async () => {
14390
14389
  try {
@@ -14396,31 +14395,31 @@ function fc({
14396
14395
  } finally {
14397
14396
  V(!1);
14398
14397
  }
14399
- }, W = async (M, J) => {
14400
- if (J.stopPropagation(), !!confirm("Delete this thread?"))
14398
+ }, W = async (M, Z) => {
14399
+ if (Z.stopPropagation(), !!confirm("Delete this thread?"))
14401
14400
  try {
14402
14401
  await g(M), d == null || d(M);
14403
14402
  } catch (Re) {
14404
14403
  console.error("Failed to delete thread:", Re);
14405
14404
  }
14406
- }, K = (M, J) => {
14407
- J.stopPropagation(), N(M.threadId), I(M.title || `Thread ${M.threadId.slice(0, 8)}`);
14405
+ }, K = (M, Z) => {
14406
+ Z.stopPropagation(), N(M.threadId), I(M.title || `Thread ${M.threadId.slice(0, 8)}`);
14408
14407
  }, D = async (M) => {
14409
14408
  if (_.trim())
14410
14409
  try {
14411
14410
  await x(M, _.trim()), N(null), I("");
14412
- } catch (J) {
14413
- console.error("Failed to update title:", J);
14411
+ } catch (Z) {
14412
+ console.error("Failed to update title:", Z);
14414
14413
  }
14415
14414
  }, O = () => {
14416
14415
  N(null), I("");
14417
- }, ie = (M, J) => {
14418
- M.key === "Enter" ? D(J) : M.key === "Escape" && O();
14419
- }, Z = (M) => {
14416
+ }, ie = (M, Z) => {
14417
+ M.key === "Enter" ? D(Z) : M.key === "Escape" && O();
14418
+ }, J = (M) => {
14420
14419
  if (!M) return "";
14421
14420
  try {
14422
- const J = new Date(M), fe = (/* @__PURE__ */ new Date()).getTime() - J.getTime(), L = Math.floor(fe / (1e3 * 60 * 60 * 24));
14423
- return L === 0 ? J.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : L === 1 ? "Yesterday" : L < 7 ? `${L} days ago` : J.toLocaleDateString();
14421
+ const Z = new Date(M), fe = (/* @__PURE__ */ new Date()).getTime() - Z.getTime(), L = Math.floor(fe / (1e3 * 60 * 60 * 24));
14422
+ return L === 0 ? Z.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : L === 1 ? "Yesterday" : L < 7 ? `${L} days ago` : Z.toLocaleDateString();
14424
14423
  } catch {
14425
14424
  return "";
14426
14425
  }
@@ -14446,32 +14445,32 @@ function fc({
14446
14445
  children: /* @__PURE__ */ l.jsx("div", { className: "p-2 space-y-1 pb-4", children: R ? /* @__PURE__ */ l.jsx("div", { className: "text-center py-8 text-slate-400", children: "Loading…" }) : w.length === 0 ? /* @__PURE__ */ l.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
14447
14446
  /* @__PURE__ */ l.jsx(Lp, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
14448
14447
  /* @__PURE__ */ l.jsx("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
14449
- ] }) : w.slice().sort((M, J) => new Date(J.updatedAt || J.createdAt || "").getTime() - new Date(M.updatedAt || M.createdAt || "").getTime()).map((M) => /* @__PURE__ */ l.jsxs(
14448
+ ] }) : w.slice().sort((M, Z) => new Date(Z.updatedAt || Z.createdAt || "").getTime() - new Date(M.updatedAt || M.createdAt || "").getTime()).map((M) => /* @__PURE__ */ l.jsxs(
14450
14449
  "div",
14451
14450
  {
14452
14451
  onClick: () => P(M.threadId),
14453
14452
  className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? b) === M.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`,
14454
14453
  children: [
14455
14454
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
14456
- /* @__PURE__ */ l.jsx("div", { className: "flex-1 min-w-0", children: E === M.threadId ? /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", onClick: (J) => J.stopPropagation(), children: [
14457
- /* @__PURE__ */ l.jsx(Uo, { value: _, onChange: (J) => I(J.target.value), onKeyDown: (J) => ie(J, M.threadId), className: "h-6 text-sm", autoFocus: !0 }),
14455
+ /* @__PURE__ */ l.jsx("div", { className: "flex-1 min-w-0", children: E === M.threadId ? /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", onClick: (Z) => Z.stopPropagation(), children: [
14456
+ /* @__PURE__ */ l.jsx(Uo, { value: _, onChange: (Z) => I(Z.target.value), onKeyDown: (Z) => ie(Z, M.threadId), className: "h-6 text-sm", autoFocus: !0 }),
14458
14457
  /* @__PURE__ */ l.jsx(We, { variant: "ghost", size: "sm", onClick: () => D(M.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Mi, { size: 12 }) }),
14459
14458
  /* @__PURE__ */ l.jsx(We, { variant: "ghost", size: "sm", onClick: O, className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(rr, { size: 12 }) })
14460
14459
  ] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
14461
14460
  /* @__PURE__ */ l.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: ee(M) }),
14462
14461
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
14463
14462
  /* @__PURE__ */ l.jsx($p, { size: 10 }),
14464
- /* @__PURE__ */ l.jsx("span", { children: Z(M.updatedAt || M.createdAt) })
14463
+ /* @__PURE__ */ l.jsx("span", { children: J(M.updatedAt || M.createdAt) })
14465
14464
  ] })
14466
14465
  ] }) }),
14467
14466
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
14468
- r && E !== M.threadId && /* @__PURE__ */ l.jsx(We, { variant: "ghost", size: "sm", onClick: (J) => K(M, J), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(xc, { size: 12 }) }),
14467
+ r && E !== M.threadId && /* @__PURE__ */ l.jsx(We, { variant: "ghost", size: "sm", onClick: (Z) => K(M, Z), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(xc, { size: 12 }) }),
14469
14468
  n && /* @__PURE__ */ l.jsx(
14470
14469
  We,
14471
14470
  {
14472
14471
  variant: "ghost",
14473
14472
  size: "sm",
14474
- onClick: (J) => W(M.threadId, J),
14473
+ onClick: (Z) => W(M.threadId, Z),
14475
14474
  className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
14476
14475
  title: "Delete thread",
14477
14476
  children: /* @__PURE__ */ l.jsx(Fp, { size: 12 })
@@ -14586,7 +14585,7 @@ dh.displayName = JS;
14586
14585
  var fh = dh;
14587
14586
  const ZS = qo(
14588
14587
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
14589
- ), zt = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
14588
+ ), Ft = p.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
14590
14589
  fh,
14591
14590
  {
14592
14591
  ref: n,
@@ -14594,7 +14593,7 @@ const ZS = qo(
14594
14593
  ...t
14595
14594
  }
14596
14595
  ));
14597
- zt.displayName = fh.displayName;
14596
+ Ft.displayName = fh.displayName;
14598
14597
  function hh(e) {
14599
14598
  const t = p.useRef({ value: e, previous: e });
14600
14599
  return p.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
@@ -14935,7 +14934,7 @@ var Kn = "SelectContent", Ih = p.forwardRef(
14935
14934
  }
14936
14935
  );
14937
14936
  Ih.displayName = Kn;
14938
- var qt = 10, [Nh, An] = vr(Kn), pC = "SelectContentImpl", mC = lr("SelectContent.RemoveScroll"), Ah = p.forwardRef(
14937
+ var Kt = 10, [Nh, An] = vr(Kn), pC = "SelectContentImpl", mC = lr("SelectContent.RemoveScroll"), Ah = p.forwardRef(
14939
14938
  (e, t) => {
14940
14939
  const {
14941
14940
  __scopeSelect: n,
@@ -15000,7 +14999,7 @@ var qt = 10, [Nh, An] = vr(Kn), pC = "SelectContentImpl", mC = lr("SelectContent
15000
14999
  window.removeEventListener("blur", L), window.removeEventListener("resize", L);
15001
15000
  };
15002
15001
  }, [D]);
15003
- const [ie, Z] = qh((L) => {
15002
+ const [ie, J] = qh((L) => {
15004
15003
  const j = F().filter((le) => !le.disabled), H = j.find((le) => le.ref.current === document.activeElement), Q = Gh(j, L, H);
15005
15004
  Q && setTimeout(() => Q.ref.current.focus());
15006
15005
  }), ee = p.useCallback(
@@ -15009,7 +15008,7 @@ var qt = 10, [Nh, An] = vr(Kn), pC = "SelectContentImpl", mC = lr("SelectContent
15009
15008
  (w.value !== void 0 && w.value === j || Q) && (N(L), Q && (G.current = !0));
15010
15009
  },
15011
15010
  [w.value]
15012
- ), M = p.useCallback(() => y == null ? void 0 : y.focus(), [y]), J = p.useCallback(
15011
+ ), M = p.useCallback(() => y == null ? void 0 : y.focus(), [y]), Z = p.useCallback(
15013
15012
  (L, j, H) => {
15014
15013
  const Q = !G.current && !H;
15015
15014
  (w.value !== void 0 && w.value === j || Q) && I(L);
@@ -15037,7 +15036,7 @@ var qt = 10, [Nh, An] = vr(Kn), pC = "SelectContentImpl", mC = lr("SelectContent
15037
15036
  itemRefCallback: ee,
15038
15037
  selectedItem: E,
15039
15038
  onItemLeave: M,
15040
- itemTextRefCallback: J,
15039
+ itemTextRefCallback: Z,
15041
15040
  focusSelectedItem: K,
15042
15041
  selectedItemText: _,
15043
15042
  position: r,
@@ -15086,7 +15085,7 @@ var qt = 10, [Nh, An] = vr(Kn), pC = "SelectContentImpl", mC = lr("SelectContent
15086
15085
  },
15087
15086
  onKeyDown: ae(x.onKeyDown, (L) => {
15088
15087
  const j = L.ctrlKey || L.altKey || L.metaKey;
15089
- if (L.key === "Tab" && L.preventDefault(), !j && L.key.length === 1 && Z(L.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(L.key)) {
15088
+ if (L.key === "Tab" && L.preventDefault(), !j && L.key.length === 1 && J(L.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(L.key)) {
15090
15089
  let Q = F().filter((le) => !le.disabled).map((le) => le.ref.current);
15091
15090
  if (["ArrowUp", "End"].includes(L.key) && (Q = Q.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(L.key)) {
15092
15091
  const le = L.target, oe = Q.indexOf(le);
@@ -15111,25 +15110,25 @@ var gC = "SelectItemAlignedPosition", _h = p.forwardRef((e, t) => {
15111
15110
  if (s.trigger && s.valueNode && a && u && v && g && x) {
15112
15111
  const k = s.trigger.getBoundingClientRect(), E = u.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
15113
15112
  if (s.dir !== "rtl") {
15114
- const le = _.left - E.left, oe = N.left - le, $e = k.left - oe, De = k.width + $e, ve = Math.max(De, E.width), ke = window.innerWidth - qt, Be = Ei(oe, [
15115
- qt,
15113
+ const le = _.left - E.left, oe = N.left - le, $e = k.left - oe, De = k.width + $e, ve = Math.max(De, E.width), ke = window.innerWidth - Kt, Be = Ei(oe, [
15114
+ Kt,
15116
15115
  // Prevents the content from going off the starting edge of the
15117
15116
  // viewport. It may still go off the ending edge, but this can be
15118
15117
  // controlled by the user since they may want to manage overflow in a
15119
15118
  // specific way.
15120
15119
  // https://github.com/radix-ui/primitives/issues/2049
15121
- Math.max(qt, ke - ve)
15120
+ Math.max(Kt, ke - ve)
15122
15121
  ]);
15123
15122
  a.style.minWidth = De + "px", a.style.left = Be + "px";
15124
15123
  } else {
15125
- const le = E.right - _.right, oe = window.innerWidth - N.right - le, $e = window.innerWidth - k.right - oe, De = k.width + $e, ve = Math.max(De, E.width), ke = window.innerWidth - qt, Be = Ei(oe, [
15126
- qt,
15127
- Math.max(qt, ke - ve)
15124
+ const le = E.right - _.right, oe = window.innerWidth - N.right - le, $e = window.innerWidth - k.right - oe, De = k.width + $e, ve = Math.max(De, E.width), ke = window.innerWidth - Kt, Be = Ei(oe, [
15125
+ Kt,
15126
+ Math.max(Kt, ke - ve)
15128
15127
  ]);
15129
15128
  a.style.minWidth = De + "px", a.style.right = Be + "px";
15130
15129
  }
15131
- const I = h(), F = window.innerHeight - qt * 2, V = v.scrollHeight, P = window.getComputedStyle(u), G = parseInt(P.borderTopWidth, 10), W = parseInt(P.paddingTop, 10), K = parseInt(P.borderBottomWidth, 10), D = parseInt(P.paddingBottom, 10), O = G + W + V + D + K, ie = Math.min(g.offsetHeight * 5, O), Z = window.getComputedStyle(v), ee = parseInt(Z.paddingTop, 10), M = parseInt(Z.paddingBottom, 10), J = k.top + k.height / 2 - qt, Re = F - J, fe = g.offsetHeight / 2, L = g.offsetTop + fe, j = G + W + L, H = O - j;
15132
- if (j <= J) {
15130
+ const I = h(), F = window.innerHeight - Kt * 2, V = v.scrollHeight, P = window.getComputedStyle(u), G = parseInt(P.borderTopWidth, 10), W = parseInt(P.paddingTop, 10), K = parseInt(P.borderBottomWidth, 10), D = parseInt(P.paddingBottom, 10), O = G + W + V + D + K, ie = Math.min(g.offsetHeight * 5, O), J = window.getComputedStyle(v), ee = parseInt(J.paddingTop, 10), M = parseInt(J.paddingBottom, 10), Z = k.top + k.height / 2 - Kt, Re = F - Z, fe = g.offsetHeight / 2, L = g.offsetTop + fe, j = G + W + L, H = O - j;
15131
+ if (j <= Z) {
15133
15132
  const le = I.length > 0 && g === I[I.length - 1].ref.current;
15134
15133
  a.style.bottom = "0px";
15135
15134
  const oe = u.clientHeight - v.offsetTop - v.offsetHeight, $e = Math.max(
@@ -15142,13 +15141,13 @@ var gC = "SelectItemAlignedPosition", _h = p.forwardRef((e, t) => {
15142
15141
  const le = I.length > 0 && g === I[0].ref.current;
15143
15142
  a.style.top = "0px";
15144
15143
  const $e = Math.max(
15145
- J,
15144
+ Z,
15146
15145
  G + v.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
15147
15146
  (le ? ee : 0) + fe
15148
15147
  ) + H;
15149
- a.style.height = $e + "px", v.scrollTop = j - J + v.offsetTop;
15148
+ a.style.height = $e + "px", v.scrollTop = j - Z + v.offsetTop;
15150
15149
  }
15151
- a.style.margin = `${qt}px 0`, a.style.minHeight = ie + "px", a.style.maxHeight = F + "px", r == null || r(), requestAnimationFrame(() => m.current = !0);
15150
+ a.style.margin = `${Kt}px 0`, a.style.minHeight = ie + "px", a.style.maxHeight = F + "px", r == null || r(), requestAnimationFrame(() => m.current = !0);
15152
15151
  }
15153
15152
  }, [
15154
15153
  h,
@@ -15215,7 +15214,7 @@ var xC = "SelectPopperPosition", Ii = p.forwardRef((e, t) => {
15215
15214
  const {
15216
15215
  __scopeSelect: n,
15217
15216
  align: r = "start",
15218
- collisionPadding: o = qt,
15217
+ collisionPadding: o = Kt,
15219
15218
  ...s
15220
15219
  } = e, i = Is(n);
15221
15220
  return /* @__PURE__ */ l.jsx(
@@ -15278,7 +15277,7 @@ var [vC, _a] = vr(Kn, {}), Ni = "SelectViewport", jh = p.forwardRef(
15278
15277
  if (h != null && h.current && f) {
15279
15278
  const m = Math.abs(c.current - d.scrollTop);
15280
15279
  if (m > 0) {
15281
- const b = window.innerHeight - qt * 2, v = parseFloat(f.style.minHeight), g = parseFloat(f.style.height), x = Math.max(v, g);
15280
+ const b = window.innerHeight - Kt * 2, v = parseFloat(f.style.minHeight), g = parseFloat(f.style.height), x = Math.max(v, g);
15282
15281
  if (x < b) {
15283
15282
  const w = x + m, y = Math.min(b, w), R = w - y;
15284
15283
  f.style.height = y + "px", f.style.bottom === "0px" && (d.scrollTop = R > 0 ? R : 0, f.style.justifyContent = "flex-end");
@@ -15906,7 +15905,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
15906
15905
  ] }) }),
15907
15906
  /* @__PURE__ */ l.jsxs(Eo, { className: "space-y-4", children: [
15908
15907
  /* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
15909
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "api-url", children: "API Base URL" }),
15908
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "api-url", children: "API Base URL" }),
15910
15909
  /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2", children: [
15911
15910
  /* @__PURE__ */ l.jsx(
15912
15911
  Uo,
@@ -15924,7 +15923,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
15924
15923
  ] })
15925
15924
  ] }),
15926
15925
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
15927
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "enable-auth", children: "Enable Authentication" }),
15926
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "enable-auth", children: "Enable Authentication" }),
15928
15927
  /* @__PURE__ */ l.jsx(
15929
15928
  bn,
15930
15929
  {
@@ -15938,7 +15937,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
15938
15937
  )
15939
15938
  ] }),
15940
15939
  a.api.enableAuth && /* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
15941
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "auth-token", children: "Authentication Token" }),
15940
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "auth-token", children: "Authentication Token" }),
15942
15941
  /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2", children: [
15943
15942
  /* @__PURE__ */ l.jsx(
15944
15943
  Uo,
@@ -15973,7 +15972,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
15973
15972
  ] }) }),
15974
15973
  /* @__PURE__ */ l.jsxs(Eo, { className: "space-y-4", children: [
15975
15974
  /* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
15976
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "layout", children: "Layout Style" }),
15975
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "layout", children: "Layout Style" }),
15977
15976
  /* @__PURE__ */ l.jsxs(
15978
15977
  hc,
15979
15978
  {
@@ -15994,7 +15993,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
15994
15993
  )
15995
15994
  ] }),
15996
15995
  /* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
15997
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "theme", children: "Theme" }),
15996
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "theme", children: "Theme" }),
15998
15997
  /* @__PURE__ */ l.jsxs(
15999
15998
  hc,
16000
15999
  {
@@ -16017,7 +16016,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
16017
16016
  /* @__PURE__ */ l.jsx(ip, {}),
16018
16017
  /* @__PURE__ */ l.jsxs("div", { className: "space-y-3", children: [
16019
16018
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
16020
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
16019
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
16021
16020
  /* @__PURE__ */ l.jsx(
16022
16021
  bn,
16023
16022
  {
@@ -16031,7 +16030,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
16031
16030
  )
16032
16031
  ] }),
16033
16032
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
16034
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
16033
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
16035
16034
  /* @__PURE__ */ l.jsx(
16036
16035
  bn,
16037
16036
  {
@@ -16045,7 +16044,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
16045
16044
  )
16046
16045
  ] }),
16047
16046
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
16048
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "compact-messages", children: "Compact Messages" }),
16047
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "compact-messages", children: "Compact Messages" }),
16049
16048
  /* @__PURE__ */ l.jsx(
16050
16049
  bn,
16051
16050
  {
@@ -16069,7 +16068,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
16069
16068
  /* @__PURE__ */ l.jsxs(Eo, { className: "space-y-4", children: [
16070
16069
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
16071
16070
  /* @__PURE__ */ l.jsxs("div", { children: [
16072
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
16071
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
16073
16072
  /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground", children: "Automatically save messages to threads" })
16074
16073
  ] }),
16075
16074
  /* @__PURE__ */ l.jsx(
@@ -16086,7 +16085,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
16086
16085
  ] }),
16087
16086
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
16088
16087
  /* @__PURE__ */ l.jsxs("div", { children: [
16089
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "enable-streaming", children: "Enable Streaming" }),
16088
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "enable-streaming", children: "Enable Streaming" }),
16090
16089
  /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground", children: "Stream responses in real-time" })
16091
16090
  ] }),
16092
16091
  /* @__PURE__ */ l.jsx(
@@ -16103,7 +16102,7 @@ function IT({ settings: e, onSettingsChange: t, className: n = "" }) {
16103
16102
  ] }),
16104
16103
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
16105
16104
  /* @__PURE__ */ l.jsxs("div", { children: [
16106
- /* @__PURE__ */ l.jsx(zt, { htmlFor: "typing-indicator", children: "Typing Indicator" }),
16105
+ /* @__PURE__ */ l.jsx(Ft, { htmlFor: "typing-indicator", children: "Typing Indicator" }),
16107
16106
  /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground", children: "Show typing indicator during responses" })
16108
16107
  ] }),
16109
16108
  /* @__PURE__ */ l.jsx(
@@ -16224,7 +16223,7 @@ export {
16224
16223
  zn as chatApiClient,
16225
16224
  NT as default,
16226
16225
  Ag as del,
16227
- Bt as get,
16226
+ zt as get,
16228
16227
  kg as getChatToken,
16229
16228
  TT as getCurrentSettings,
16230
16229
  qS as getDefaultApiConfig,