teodor-new-chat-ui 3.0.63 → 3.0.64

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,12 +2,12 @@ import * as f from "react";
2
2
  import K, { useState as fe, useRef as bt, useCallback as Ye, useEffect as Ve, useReducer as Pp, useMemo as wn, createContext as pc, useContext as mc, createElement as to, useLayoutEffect as _p } from "react";
3
3
  import * as Bo from "react-dom";
4
4
  import gc from "react-dom";
5
- import { Square as Op, Send as Mp, X as Wn, ExternalLink as Dp, Download as Lp, Image as vc, FileText as Ba, Loader as Fp, ChevronUp as pr, ChevronDown as Un, Copy as Ha, Edit as $a, RotateCcw as Xs, Bot as za, Wrench as Bp, User as Hp, ChevronRight as $p, Check as _i, Circle as zp, Edit3 as xc, Paperclip as Ua, Loader2 as Up, Plus as Wp, FileSpreadsheet as Vp, MessageSquarePlus as Gp, MessageSquare as Kp, Calendar as Yp, Trash2 as Xp, PanelLeft as qp, Settings as Jp, Server as Zp, EyeOff as Qp, Eye as em, Layout as tm, MessageCircle as nm, Save as rm } from "lucide-react";
6
- import { Slot as er, createSlot as Xn, createSlottable as om } from "@radix-ui/react-slot";
5
+ import { Square as Op, Send as Mp, X as Wn, ExternalLink as Dp, Download as Lp, Image as vc, FileText as Ba, Loader as Fp, ChevronUp as pr, ChevronDown as Un, Copy as Ha, Edit as $a, RotateCcw as qs, Bot as za, Wrench as Bp, User as Hp, ChevronRight as $p, Check as _i, Circle as zp, Edit3 as xc, Paperclip as Ua, Loader2 as Up, Plus as Wp, FileSpreadsheet as Vp, MessageSquarePlus as Gp, MessageSquare as Kp, Calendar as Yp, Trash2 as qp, PanelLeft as Xp, Settings as Jp, Server as Zp, EyeOff as Qp, Eye as em, Layout as tm, MessageCircle as nm, Save as rm } from "lucide-react";
6
+ import { Slot as er, createSlot as qn, createSlottable as om } from "@radix-ui/react-slot";
7
7
  import { cva as Pr } from "class-variance-authority";
8
8
  import { clsx as sm } from "clsx";
9
9
  import { twMerge as im } from "tailwind-merge";
10
- var qs = { exports: {} }, ur = {};
10
+ var Xs = { exports: {} }, ur = {};
11
11
  /**
12
12
  * @license React
13
13
  * react-jsx-runtime.production.min.js
@@ -69,10 +69,10 @@ function lm() {
69
69
  Me.unshift("Warning: " + U), Function.prototype.apply.call(console[T], console, Me);
70
70
  }
71
71
  }
72
- var E = !1, S = !1, C = !1, R = !1, I = !1, A;
72
+ var R = !1, S = !1, C = !1, E = !1, I = !1, A;
73
73
  A = Symbol.for("react.module.reference");
74
74
  function k(T) {
75
- return !!(typeof T == "string" || typeof T == "function" || T === r || T === s || I || T === o || T === u || T === d || R || T === x || E || S || C || typeof T == "object" && T !== null && (T.$$typeof === p || T.$$typeof === h || T.$$typeof === i || T.$$typeof === a || T.$$typeof === c || // This needs to include all possible module reference object
75
+ return !!(typeof T == "string" || typeof T == "function" || T === r || T === s || I || T === o || T === u || T === d || E || T === x || R || S || C || typeof T == "object" && T !== null && (T.$$typeof === p || T.$$typeof === h || T.$$typeof === i || T.$$typeof === a || T.$$typeof === c || // This needs to include all possible module reference object
76
76
  // types supported by any Flight configuration anywhere since
77
77
  // we don't know which Flight build this will end up being used
78
78
  // with.
@@ -133,14 +133,14 @@ function lm() {
133
133
  }
134
134
  return null;
135
135
  }
136
- var N = Object.assign, $ = 0, L, X, O, _, z, q, oe;
136
+ var N = Object.assign, $ = 0, L, q, O, _, z, X, oe;
137
137
  function F() {
138
138
  }
139
139
  F.__reactDisabledLog = !0;
140
140
  function Q() {
141
141
  {
142
142
  if ($ === 0) {
143
- L = console.log, X = console.info, O = console.warn, _ = console.error, z = console.group, q = console.groupCollapsed, oe = console.groupEnd;
143
+ L = console.log, q = console.info, O = console.warn, _ = console.error, z = console.group, X = console.groupCollapsed, oe = console.groupEnd;
144
144
  var T = {
145
145
  configurable: !0,
146
146
  enumerable: !0,
@@ -173,7 +173,7 @@ function lm() {
173
173
  value: L
174
174
  }),
175
175
  info: N({}, T, {
176
- value: X
176
+ value: q
177
177
  }),
178
178
  warn: N({}, T, {
179
179
  value: O
@@ -185,7 +185,7 @@ function lm() {
185
185
  value: z
186
186
  }),
187
187
  groupCollapsed: N({}, T, {
188
- value: q
188
+ value: X
189
189
  }),
190
190
  groupEnd: N({}, T, {
191
191
  value: oe
@@ -262,18 +262,18 @@ function lm() {
262
262
  }
263
263
  } catch (tn) {
264
264
  if (tn && ge && typeof tn.stack == "string") {
265
- for (var Re = tn.stack.split(`
265
+ for (var Ee = tn.stack.split(`
266
266
  `), dt = ge.stack.split(`
267
- `), Ke = Re.length - 1, Je = dt.length - 1; Ke >= 1 && Je >= 0 && Re[Ke] !== dt[Je]; )
267
+ `), Ke = Ee.length - 1, Je = dt.length - 1; Ke >= 1 && Je >= 0 && Ee[Ke] !== dt[Je]; )
268
268
  Je--;
269
269
  for (; Ke >= 1 && Je >= 0; Ke--, Je--)
270
- if (Re[Ke] !== dt[Je]) {
270
+ if (Ee[Ke] !== dt[Je]) {
271
271
  if (Ke !== 1 || Je !== 1)
272
272
  do
273
- if (Ke--, Je--, Je < 0 || Re[Ke] !== dt[Je]) {
274
- var Rt = `
275
- ` + Re[Ke].replace(" at new ", " at ");
276
- return T.displayName && Rt.includes("<anonymous>") && (Rt = Rt.replace("<anonymous>", T.displayName)), typeof T == "function" && ne.set(T, Rt), Rt;
273
+ if (Ke--, Je--, Je < 0 || Ee[Ke] !== dt[Je]) {
274
+ var Et = `
275
+ ` + Ee[Ke].replace(" at new ", " at ");
276
+ return T.displayName && Et.includes("<anonymous>") && (Et = Et.replace("<anonymous>", T.displayName)), typeof T == "function" && ne.set(T, Et), Et;
277
277
  }
278
278
  while (Ke >= 1 && Je >= 0);
279
279
  break;
@@ -334,17 +334,17 @@ function lm() {
334
334
  var Me = Function.call.bind(ce);
335
335
  for (var Ie in T)
336
336
  if (Me(T, Ie)) {
337
- var Re = void 0;
337
+ var Ee = void 0;
338
338
  try {
339
339
  if (typeof T[Ie] != "function") {
340
340
  var dt = Error((ge || "React class") + ": " + te + " type `" + Ie + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[Ie] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
341
341
  throw dt.name = "Invariant Violation", dt;
342
342
  }
343
- Re = T[Ie](U, Ie, ge, te, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
343
+ Ee = T[Ie](U, Ie, ge, te, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
344
344
  } catch (Ke) {
345
- Re = Ke;
345
+ Ee = Ke;
346
346
  }
347
- Re && !(Re instanceof Error) && (H(_e), 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).", ge || "React class", te, Ie, typeof Re), H(null)), Re instanceof Error && !(Re.message in Ae) && (Ae[Re.message] = !0, H(_e), w("Failed %s type: %s", te, Re.message), H(null));
347
+ Ee && !(Ee instanceof Error) && (H(_e), 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).", ge || "React class", te, Ie, typeof Ee), H(null)), Ee instanceof Error && !(Ee.message in Ae) && (Ae[Ee.message] = !0, H(_e), w("Failed %s type: %s", te, Ee.message), H(null));
348
348
  }
349
349
  }
350
350
  }
@@ -420,7 +420,7 @@ function lm() {
420
420
  }
421
421
  }
422
422
  var Cs = function(T, U, te, ge, _e, Me, Ie) {
423
- var Re = {
423
+ var Ee = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
425
  $$typeof: t,
426
426
  // Built-in properties that belong on the element
@@ -431,27 +431,27 @@ function lm() {
431
431
  // Record the component responsible for creating this element.
432
432
  _owner: Me
433
433
  };
434
- return Re._store = {}, Object.defineProperty(Re._store, "validated", {
434
+ return Ee._store = {}, Object.defineProperty(Ee._store, "validated", {
435
435
  configurable: !1,
436
436
  enumerable: !1,
437
437
  writable: !0,
438
438
  value: !1
439
- }), Object.defineProperty(Re, "_self", {
439
+ }), Object.defineProperty(Ee, "_self", {
440
440
  configurable: !1,
441
441
  enumerable: !1,
442
442
  writable: !1,
443
443
  value: ge
444
- }), Object.defineProperty(Re, "_source", {
444
+ }), Object.defineProperty(Ee, "_source", {
445
445
  configurable: !1,
446
446
  enumerable: !1,
447
447
  writable: !1,
448
448
  value: _e
449
- }), Object.freeze && (Object.freeze(Re.props), Object.freeze(Re)), Re;
449
+ }), Object.freeze && (Object.freeze(Ee.props), Object.freeze(Ee)), Ee;
450
450
  };
451
451
  function Ts(T, U, te, ge, _e) {
452
452
  {
453
- var Me, Ie = {}, Re = null, dt = null;
454
- te !== void 0 && (Tt(te), Re = "" + te), xn(U) && (Tt(U.key), Re = "" + U.key), Pt(U) && (dt = U.ref, Dn(U, _e));
453
+ var Me, Ie = {}, Ee = null, dt = null;
454
+ te !== void 0 && (Tt(te), Ee = "" + te), xn(U) && (Tt(U.key), Ee = "" + U.key), Pt(U) && (dt = U.ref, Dn(U, _e));
455
455
  for (Me in U)
456
456
  ce.call(U, Me) && !st.hasOwnProperty(Me) && (Ie[Me] = U[Me]);
457
457
  if (T && T.defaultProps) {
@@ -459,11 +459,11 @@ function lm() {
459
459
  for (Me in Ke)
460
460
  Ie[Me] === void 0 && (Ie[Me] = Ke[Me]);
461
461
  }
462
- if (Re || dt) {
462
+ if (Ee || dt) {
463
463
  var Je = typeof T == "function" ? T.displayName || T.name || "Unknown" : T;
464
- Re && Ue(Ie, Je), dt && cr(Ie, Je);
464
+ Ee && Ue(Ie, Je), dt && cr(Ie, Je);
465
465
  }
466
- return Cs(T, Re, dt, _e, ge, We.current, Ie);
466
+ return Cs(T, Ee, dt, _e, ge, We.current, Ie);
467
467
  }
468
468
  }
469
469
  var J = b.ReactCurrentOwner, se = b.ReactDebugCurrentFrame;
@@ -495,7 +495,7 @@ Check the render method of \`` + T + "`.";
495
495
  return "";
496
496
  }
497
497
  var Oa = {};
498
- function Rp(T) {
498
+ function Ep(T) {
499
499
  {
500
500
  var U = Ot();
501
501
  if (!U) {
@@ -512,7 +512,7 @@ Check the top-level render call using <` + te + ">.");
512
512
  if (!T._store || T._store.validated || T.key != null)
513
513
  return;
514
514
  T._store.validated = !0;
515
- var te = Rp(U);
515
+ var te = Ep(U);
516
516
  if (Oa[te])
517
517
  return;
518
518
  Oa[te] = !0;
@@ -539,7 +539,7 @@ Check the top-level render call using <` + te + ">.");
539
539
  }
540
540
  }
541
541
  }
542
- function Ep(T) {
542
+ function Rp(T) {
543
543
  {
544
544
  var U = T.type;
545
545
  if (U == null || typeof U == "string")
@@ -580,30 +580,30 @@ Check the top-level render call using <` + te + ">.");
580
580
  {
581
581
  var Ie = k(T);
582
582
  if (!Ie) {
583
- var Re = "";
584
- (T === void 0 || typeof T == "object" && T !== null && Object.keys(T).length === 0) && (Re += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
583
+ var Ee = "";
584
+ (T === void 0 || typeof T == "object" && T !== null && Object.keys(T).length === 0) && (Ee += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
585
585
  var dt = Ln();
586
- dt ? Re += dt : Re += Ot();
586
+ dt ? Ee += dt : Ee += Ot();
587
587
  var Ke;
588
- T === null ? Ke = "null" : nt(T) ? Ke = "array" : T !== void 0 && T.$$typeof === t ? (Ke = "<" + (G(T.type) || "Unknown") + " />", Re = " Did you accidentally export a JSX literal instead of a component?") : Ke = 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", Ke, Re);
588
+ T === null ? Ke = "null" : nt(T) ? Ke = "array" : T !== void 0 && T.$$typeof === t ? (Ke = "<" + (G(T.type) || "Unknown") + " />", Ee = " Did you accidentally export a JSX literal instead of a component?") : Ke = 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", Ke, Ee);
589
589
  }
590
590
  var Je = Ts(T, U, te, _e, Me);
591
591
  if (Je == null)
592
592
  return Je;
593
593
  if (Ie) {
594
- var Rt = U.children;
595
- if (Rt !== void 0)
594
+ var Et = U.children;
595
+ if (Et !== void 0)
596
596
  if (ge)
597
- if (nt(Rt)) {
598
- for (var Fn = 0; Fn < Rt.length; Fn++)
599
- Da(Rt[Fn], T);
600
- Object.freeze && Object.freeze(Rt);
597
+ if (nt(Et)) {
598
+ for (var Fn = 0; Fn < Et.length; Fn++)
599
+ Da(Et[Fn], T);
600
+ Object.freeze && Object.freeze(Et);
601
601
  } else
602
602
  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.");
603
603
  else
604
- Da(Rt, T);
604
+ Da(Et, T);
605
605
  }
606
- return T === r ? Ip(Je) : Ep(Je), Je;
606
+ return T === r ? Ip(Je) : Rp(Je), Je;
607
607
  }
608
608
  }
609
609
  function Np(T, U, te) {
@@ -616,8 +616,8 @@ Check the top-level render call using <` + te + ">.");
616
616
  dr.Fragment = r, dr.jsx = Ap, dr.jsxs = kp;
617
617
  }()), dr;
618
618
  }
619
- process.env.NODE_ENV === "production" ? qs.exports = am() : qs.exports = lm();
620
- var l = qs.exports;
619
+ process.env.NODE_ENV === "production" ? Xs.exports = am() : Xs.exports = lm();
620
+ var l = Xs.exports;
621
621
  function bc(e, t) {
622
622
  return function() {
623
623
  return e.apply(t, arguments);
@@ -626,9 +626,9 @@ function bc(e, t) {
626
626
  const { toString: cm } = Object.prototype, { getPrototypeOf: Oi } = Object, { iterator: Ho, toStringTag: wc } = Symbol, $o = /* @__PURE__ */ ((e) => (t) => {
627
627
  const n = cm.call(t);
628
628
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
629
- })(/* @__PURE__ */ Object.create(null)), zt = (e) => (e = e.toLowerCase(), (t) => $o(t) === e), zo = (e) => (t) => typeof t === e, { isArray: tr } = Array, qn = zo("undefined");
629
+ })(/* @__PURE__ */ Object.create(null)), zt = (e) => (e = e.toLowerCase(), (t) => $o(t) === e), zo = (e) => (t) => typeof t === e, { isArray: tr } = Array, Xn = zo("undefined");
630
630
  function _r(e) {
631
- return e !== null && !qn(e) && e.constructor !== null && !qn(e.constructor) && pt(e.constructor.isBuffer) && e.constructor.isBuffer(e);
631
+ return e !== null && !Xn(e) && e.constructor !== null && !Xn(e.constructor) && pt(e.constructor.isBuffer) && e.constructor.isBuffer(e);
632
632
  }
633
633
  const yc = zt("ArrayBuffer");
634
634
  function um(e) {
@@ -652,7 +652,7 @@ const dm = zo("string"), pt = zo("function"), Sc = zo("number"), Or = (e) => e !
652
652
  let t;
653
653
  return e && (typeof FormData == "function" && e instanceof FormData || pt(e.append) && ((t = $o(e)) === "formdata" || // detect form-data instance
654
654
  t === "object" && pt(e.toString) && e.toString() === "[object FormData]"));
655
- }, wm = zt("URLSearchParams"), [ym, Sm, Cm, Tm] = ["ReadableStream", "Request", "Response", "Headers"].map(zt), Rm = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
655
+ }, wm = zt("URLSearchParams"), [ym, Sm, Cm, Tm] = ["ReadableStream", "Request", "Response", "Headers"].map(zt), Em = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
656
656
  function Mr(e, t, { allOwnKeys: n = !1 } = {}) {
657
657
  if (e === null || typeof e > "u")
658
658
  return;
@@ -680,17 +680,17 @@ function Cc(e, t) {
680
680
  return o;
681
681
  return null;
682
682
  }
683
- const yn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Tc = (e) => !qn(e) && e !== yn;
683
+ const yn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Tc = (e) => !Xn(e) && e !== yn;
684
684
  function Js() {
685
685
  const { caseless: e, skipUndefined: t } = Tc(this) && this || {}, n = {}, r = (o, s) => {
686
686
  const i = e && Cc(n, s) || s;
687
- no(n[i]) && no(o) ? n[i] = Js(n[i], o) : no(o) ? n[i] = Js({}, o) : tr(o) ? n[i] = o.slice() : (!t || !qn(o)) && (n[i] = o);
687
+ no(n[i]) && no(o) ? n[i] = Js(n[i], o) : no(o) ? n[i] = Js({}, o) : tr(o) ? n[i] = o.slice() : (!t || !Xn(o)) && (n[i] = o);
688
688
  };
689
689
  for (let o = 0, s = arguments.length; o < s; o++)
690
690
  arguments[o] && Mr(arguments[o], r);
691
691
  return n;
692
692
  }
693
- const Em = (e, t, n, { allOwnKeys: r } = {}) => (Mr(t, (o, s) => {
693
+ const Rm = (e, t, n, { allOwnKeys: r } = {}) => (Mr(t, (o, s) => {
694
694
  n && pt(o) ? e[s] = bc(o, n) : e[s] = o;
695
695
  }, { allOwnKeys: r }), e), Im = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Nm = (e, t, n, r) => {
696
696
  e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
@@ -737,14 +737,14 @@ const Em = (e, t, n, { allOwnKeys: r } = {}) => (Mr(t, (o, s) => {
737
737
  function(n, r, o) {
738
738
  return r.toUpperCase() + o;
739
739
  }
740
- ), Ga = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Lm = zt("RegExp"), Rc = (e, t) => {
740
+ ), Ga = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Lm = zt("RegExp"), Ec = (e, t) => {
741
741
  const n = Object.getOwnPropertyDescriptors(e), r = {};
742
742
  Mr(n, (o, s) => {
743
743
  let i;
744
744
  (i = t(o, s, e)) !== !1 && (r[s] = i || o);
745
745
  }), Object.defineProperties(e, r);
746
746
  }, Fm = (e) => {
747
- Rc(e, (t, n) => {
747
+ Ec(e, (t, n) => {
748
748
  if (pt(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
749
749
  return !1;
750
750
  const r = e[n];
@@ -782,21 +782,21 @@ const Um = (e) => {
782
782
  const s = tr(r) ? [] : {};
783
783
  return Mr(r, (i, a) => {
784
784
  const c = n(i, o + 1);
785
- !qn(c) && (s[a] = c);
785
+ !Xn(c) && (s[a] = c);
786
786
  }), t[o] = void 0, s;
787
787
  }
788
788
  }
789
789
  return r;
790
790
  };
791
791
  return n(e, 0);
792
- }, Wm = zt("AsyncFunction"), Vm = (e) => e && (Or(e) || pt(e)) && pt(e.then) && pt(e.catch), Ec = ((e, t) => e ? setImmediate : t ? ((n, r) => (yn.addEventListener("message", ({ source: o, data: s }) => {
792
+ }, Wm = zt("AsyncFunction"), Vm = (e) => e && (Or(e) || pt(e)) && pt(e.then) && pt(e.catch), Rc = ((e, t) => e ? setImmediate : t ? ((n, r) => (yn.addEventListener("message", ({ source: o, data: s }) => {
793
793
  o === yn && s === n && r.length && r.shift()();
794
794
  }, !1), (o) => {
795
795
  r.push(o), yn.postMessage(n, "*");
796
796
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
797
797
  typeof setImmediate == "function",
798
798
  pt(yn.postMessage)
799
- ), Gm = typeof queueMicrotask < "u" ? queueMicrotask.bind(yn) : typeof process < "u" && process.nextTick || Ec, Km = (e) => e != null && pt(e[Ho]), j = {
799
+ ), Gm = typeof queueMicrotask < "u" ? queueMicrotask.bind(yn) : typeof process < "u" && process.nextTick || Rc, Km = (e) => e != null && pt(e[Ho]), j = {
800
800
  isArray: tr,
801
801
  isArrayBuffer: yc,
802
802
  isBuffer: _r,
@@ -812,7 +812,7 @@ const Um = (e) => {
812
812
  isRequest: Sm,
813
813
  isResponse: Cm,
814
814
  isHeaders: Tm,
815
- isUndefined: qn,
815
+ isUndefined: Xn,
816
816
  isDate: pm,
817
817
  isFile: mm,
818
818
  isBlob: gm,
@@ -824,8 +824,8 @@ const Um = (e) => {
824
824
  isFileList: vm,
825
825
  forEach: Mr,
826
826
  merge: Js,
827
- extend: Em,
828
- trim: Rm,
827
+ extend: Rm,
828
+ trim: Em,
829
829
  stripBOM: Im,
830
830
  inherits: Nm,
831
831
  toFlatObject: jm,
@@ -839,7 +839,7 @@ const Um = (e) => {
839
839
  hasOwnProperty: Ga,
840
840
  hasOwnProp: Ga,
841
841
  // an alias to avoid ESLint no-prototype-builtins detection
842
- reduceDescriptors: Rc,
842
+ reduceDescriptors: Ec,
843
843
  freezeMethods: Fm,
844
844
  toObjectSet: Bm,
845
845
  toCamelCase: Dm,
@@ -852,7 +852,7 @@ const Um = (e) => {
852
852
  toJSONObject: Um,
853
853
  isAsyncFn: Wm,
854
854
  isThenable: Vm,
855
- setImmediate: Ec,
855
+ setImmediate: Rc,
856
856
  asap: Gm,
857
857
  isIterable: Km
858
858
  };
@@ -920,10 +920,10 @@ function Ka(e, t, n) {
920
920
  return o = jc(o), !n && s ? "[" + o + "]" : o;
921
921
  }).join(n ? "." : "") : t;
922
922
  }
923
- function Xm(e) {
923
+ function qm(e) {
924
924
  return j.isArray(e) && !e.some(Zs);
925
925
  }
926
- const qm = j.toFlatObject(j, {}, null, function(t) {
926
+ const Xm = j.toFlatObject(j, {}, null, function(t) {
927
927
  return /^is[A-Z]/.test(t);
928
928
  });
929
929
  function Uo(e, t, n) {
@@ -954,18 +954,18 @@ function Uo(e, t, n) {
954
954
  if (g && !m && typeof g == "object") {
955
955
  if (j.endsWith(v, "{}"))
956
956
  v = r ? v : v.slice(0, -2), g = JSON.stringify(g);
957
- else if (j.isArray(g) && Xm(g) || (j.isFileList(g) || j.endsWith(v, "[]")) && (b = j.toArray(g)))
958
- return v = jc(v), b.forEach(function(y, E) {
957
+ else if (j.isArray(g) && qm(g) || (j.isFileList(g) || j.endsWith(v, "[]")) && (b = j.toArray(g)))
958
+ return v = jc(v), b.forEach(function(y, R) {
959
959
  !(j.isUndefined(y) || y === null) && t.append(
960
960
  // eslint-disable-next-line no-nested-ternary
961
- i === !0 ? Ka([v], E, s) : i === null ? v : v + "[]",
961
+ i === !0 ? Ka([v], R, s) : i === null ? v : v + "[]",
962
962
  u(y)
963
963
  );
964
964
  }), !1;
965
965
  }
966
966
  return Zs(g) ? !0 : (t.append(Ka(m, v, s), u(g)), !1);
967
967
  }
968
- const h = [], p = Object.assign(qm, {
968
+ const h = [], p = Object.assign(Xm, {
969
969
  defaultVisitor: d,
970
970
  convertValue: u,
971
971
  isVisitable: Zs
@@ -1036,7 +1036,7 @@ function kc(e, t, n) {
1036
1036
  }
1037
1037
  return e;
1038
1038
  }
1039
- class Xa {
1039
+ class qa {
1040
1040
  constructor() {
1041
1041
  this.handlers = [];
1042
1042
  }
@@ -1253,7 +1253,7 @@ const ug = j.toObjectSet([
1253
1253
  `).forEach(function(i) {
1254
1254
  o = i.indexOf(":"), n = i.substring(0, o).trim().toLowerCase(), r = i.substring(o + 1).trim(), !(!n || t[n] && ug[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
1255
1255
  }), t;
1256
- }, qa = Symbol("internals");
1256
+ }, Xa = Symbol("internals");
1257
1257
  function fr(e) {
1258
1258
  return e && String(e).trim().toLowerCase();
1259
1259
  }
@@ -1268,7 +1268,7 @@ function fg(e) {
1268
1268
  return t;
1269
1269
  }
1270
1270
  const hg = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
1271
- function Rs(e, t, n, r, o) {
1271
+ function Es(e, t, n, r, o) {
1272
1272
  if (j.isFunction(r))
1273
1273
  return r.call(this, t, n);
1274
1274
  if (o && (t = n), !!j.isString(t)) {
@@ -1342,7 +1342,7 @@ let mt = class {
1342
1342
  has(t, n) {
1343
1343
  if (t = fr(t), t) {
1344
1344
  const r = j.findKey(this, t);
1345
- return !!(r && this[r] !== void 0 && (!n || Rs(this, this[r], r, n)));
1345
+ return !!(r && this[r] !== void 0 && (!n || Es(this, this[r], r, n)));
1346
1346
  }
1347
1347
  return !1;
1348
1348
  }
@@ -1352,7 +1352,7 @@ let mt = class {
1352
1352
  function s(i) {
1353
1353
  if (i = fr(i), i) {
1354
1354
  const a = j.findKey(r, i);
1355
- a && (!n || Rs(r, r[a], a, n)) && (delete r[a], o = !0);
1355
+ a && (!n || Es(r, r[a], a, n)) && (delete r[a], o = !0);
1356
1356
  }
1357
1357
  }
1358
1358
  return j.isArray(t) ? t.forEach(s) : s(t), o;
@@ -1362,7 +1362,7 @@ let mt = class {
1362
1362
  let r = n.length, o = !1;
1363
1363
  for (; r--; ) {
1364
1364
  const s = n[r];
1365
- (!t || Rs(this, this[s], s, t, !0)) && (delete this[s], o = !0);
1365
+ (!t || Es(this, this[s], s, t, !0)) && (delete this[s], o = !0);
1366
1366
  }
1367
1367
  return o;
1368
1368
  }
@@ -1408,7 +1408,7 @@ let mt = class {
1408
1408
  return n.forEach((o) => r.set(o)), r;
1409
1409
  }
1410
1410
  static accessor(t) {
1411
- const r = (this[qa] = this[qa] = {
1411
+ const r = (this[Xa] = this[Xa] = {
1412
1412
  accessors: {}
1413
1413
  }).accessors, o = this.prototype;
1414
1414
  function s(i) {
@@ -1429,7 +1429,7 @@ j.reduceDescriptors(mt.prototype, ({ value: e }, t) => {
1429
1429
  };
1430
1430
  });
1431
1431
  j.freezeMethods(mt);
1432
- function Es(e, t) {
1432
+ function Rs(e, t) {
1433
1433
  const n = this || Dr, r = t || n, o = mt.from(r.headers);
1434
1434
  let s = r.data;
1435
1435
  return j.forEach(e, function(a) {
@@ -1554,7 +1554,7 @@ function Dc(e, t, n) {
1554
1554
  return e && (r || n == !1) ? Sg(e, t) : t;
1555
1555
  }
1556
1556
  const Qa = (e) => e instanceof mt ? { ...e } : e;
1557
- function Rn(e, t) {
1557
+ function En(e, t) {
1558
1558
  t = t || {};
1559
1559
  const n = {};
1560
1560
  function r(u, d, h, p) {
@@ -1619,7 +1619,7 @@ function Rn(e, t) {
1619
1619
  }), n;
1620
1620
  }
1621
1621
  const Lc = (e) => {
1622
- const t = Rn({}, e);
1622
+ const t = En({}, e);
1623
1623
  let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
1624
1624
  if (t.headers = i = mt.from(i), t.url = kc(Dc(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1625
1625
  "Authorization",
@@ -1663,30 +1663,30 @@ const Lc = (e) => {
1663
1663
  config: e,
1664
1664
  request: m
1665
1665
  };
1666
- Mc(function(R) {
1667
- n(R), v();
1668
- }, function(R) {
1669
- r(R), v();
1666
+ Mc(function(E) {
1667
+ n(E), v();
1668
+ }, function(E) {
1669
+ r(E), v();
1670
1670
  }, S), m = null;
1671
1671
  }
1672
1672
  "onloadend" in m ? m.onloadend = b : m.onreadystatechange = function() {
1673
1673
  !m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(b);
1674
1674
  }, m.onabort = function() {
1675
1675
  m && (r(new we("Request aborted", we.ECONNABORTED, e, m)), m = null);
1676
- }, m.onerror = function(E) {
1677
- const S = E && E.message ? E.message : "Network Error", C = new we(S, we.ERR_NETWORK, e, m);
1678
- C.event = E || null, r(C), m = null;
1676
+ }, m.onerror = function(R) {
1677
+ const S = R && R.message ? R.message : "Network Error", C = new we(S, we.ERR_NETWORK, e, m);
1678
+ C.event = R || null, r(C), m = null;
1679
1679
  }, m.ontimeout = function() {
1680
- let E = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1680
+ let R = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1681
1681
  const S = o.transitional || Pc;
1682
- o.timeoutErrorMessage && (E = o.timeoutErrorMessage), r(new we(
1683
- E,
1682
+ o.timeoutErrorMessage && (R = o.timeoutErrorMessage), r(new we(
1683
+ R,
1684
1684
  S.clarifyTimeoutError ? we.ETIMEDOUT : we.ECONNABORTED,
1685
1685
  e,
1686
1686
  m
1687
1687
  )), m = null;
1688
- }, s === void 0 && i.setContentType(null), "setRequestHeader" in m && j.forEach(i.toJSON(), function(E, S) {
1689
- m.setRequestHeader(S, E);
1688
+ }, s === void 0 && i.setContentType(null), "setRequestHeader" in m && j.forEach(i.toJSON(), function(R, S) {
1689
+ m.setRequestHeader(S, R);
1690
1690
  }), j.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), a && a !== "json" && (m.responseType = o.responseType), u && ([p, g] = So(u, !0), m.addEventListener("progress", p)), c && m.upload && ([h, x] = So(c), m.upload.addEventListener("progress", h), m.upload.addEventListener("loadend", x)), (o.cancelToken || o.signal) && (d = (y) => {
1691
1691
  m && (r(!y || y.type ? new nr(null, e, m) : y), m.abort(), m = null);
1692
1692
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
@@ -1697,7 +1697,7 @@ const Lc = (e) => {
1697
1697
  }
1698
1698
  m.send(s || null);
1699
1699
  });
1700
- }, Rg = (e, t) => {
1700
+ }, Eg = (e, t) => {
1701
1701
  const { length: n } = e = e ? e.filter(Boolean) : [];
1702
1702
  if (t || n) {
1703
1703
  let r = new AbortController(), o;
@@ -1720,7 +1720,7 @@ const Lc = (e) => {
1720
1720
  const { signal: c } = r;
1721
1721
  return c.unsubscribe = () => j.asap(a), c;
1722
1722
  }
1723
- }, Eg = function* (e, t) {
1723
+ }, Rg = function* (e, t) {
1724
1724
  let n = e.byteLength;
1725
1725
  if (n < t) {
1726
1726
  yield e;
@@ -1731,7 +1731,7 @@ const Lc = (e) => {
1731
1731
  o = r + t, yield e.slice(r, o), r = o;
1732
1732
  }, Ig = async function* (e, t) {
1733
1733
  for await (const n of Ng(e))
1734
- yield* Eg(n, t);
1734
+ yield* Rg(n, t);
1735
1735
  }, Ng = async function* (e) {
1736
1736
  if (e[Symbol.asyncIterator]) {
1737
1737
  yield* e;
@@ -1842,37 +1842,37 @@ const Lc = (e) => {
1842
1842
  data: b,
1843
1843
  signal: w,
1844
1844
  cancelToken: y,
1845
- timeout: E,
1845
+ timeout: R,
1846
1846
  onDownloadProgress: S,
1847
1847
  onUploadProgress: C,
1848
- responseType: R,
1848
+ responseType: E,
1849
1849
  headers: I,
1850
1850
  withCredentials: A = "same-origin",
1851
1851
  fetchOptions: k
1852
1852
  } = Lc(g), M = t || fetch;
1853
- R = R ? (R + "").toLowerCase() : "text";
1854
- let W = Rg([w, y && y.toAbortSignal()], E), G = null;
1853
+ E = E ? (E + "").toLowerCase() : "text";
1854
+ let W = Eg([w, y && y.toAbortSignal()], R), G = null;
1855
1855
  const N = W && W.unsubscribe && (() => {
1856
1856
  W.unsubscribe();
1857
1857
  });
1858
1858
  let $;
1859
1859
  try {
1860
1860
  if (C && u && m !== "get" && m !== "head" && ($ = await x(I, b)) !== 0) {
1861
- let q = new n(v, {
1861
+ let X = new n(v, {
1862
1862
  method: "POST",
1863
1863
  body: b,
1864
1864
  duplex: "half"
1865
1865
  }), oe;
1866
- if (j.isFormData(b) && (oe = q.headers.get("content-type")) && I.setContentType(oe), q.body) {
1866
+ if (j.isFormData(b) && (oe = X.headers.get("content-type")) && I.setContentType(oe), X.body) {
1867
1867
  const [F, Q] = Ja(
1868
1868
  $,
1869
1869
  So(Za(C))
1870
1870
  );
1871
- b = el(q.body, tl, F, Q);
1871
+ b = el(X.body, tl, F, Q);
1872
1872
  }
1873
1873
  }
1874
1874
  j.isString(A) || (A = A ? "include" : "omit");
1875
- const L = s && "credentials" in n.prototype, X = {
1875
+ const L = s && "credentials" in n.prototype, q = {
1876
1876
  ...k,
1877
1877
  signal: W,
1878
1878
  method: m.toUpperCase(),
@@ -1881,13 +1881,13 @@ const Lc = (e) => {
1881
1881
  duplex: "half",
1882
1882
  credentials: L ? A : void 0
1883
1883
  };
1884
- G = s && new n(v, X);
1885
- let O = await (s ? M(G, k) : M(v, X));
1886
- const _ = d && (R === "stream" || R === "response");
1884
+ G = s && new n(v, q);
1885
+ let O = await (s ? M(G, k) : M(v, q));
1886
+ const _ = d && (E === "stream" || E === "response");
1887
1887
  if (d && (S || _ && N)) {
1888
- const q = {};
1888
+ const X = {};
1889
1889
  ["status", "statusText", "headers"].forEach((de) => {
1890
- q[de] = O[de];
1890
+ X[de] = O[de];
1891
1891
  });
1892
1892
  const oe = j.toFiniteNumber(O.headers.get("content-length")), [F, Q] = S && Ja(
1893
1893
  oe,
@@ -1897,13 +1897,13 @@ const Lc = (e) => {
1897
1897
  el(O.body, tl, F, () => {
1898
1898
  Q && Q(), N && N();
1899
1899
  }),
1900
- q
1900
+ X
1901
1901
  );
1902
1902
  }
1903
- R = R || "text";
1904
- let z = await h[j.findKey(h, R) || "text"](O, g);
1905
- return !_ && N && N(), await new Promise((q, oe) => {
1906
- Mc(q, oe, {
1903
+ E = E || "text";
1904
+ let z = await h[j.findKey(h, E) || "text"](O, g);
1905
+ return !_ && N && N(), await new Promise((X, oe) => {
1906
+ Mc(X, oe, {
1907
1907
  data: z,
1908
1908
  headers: mt.from(O.headers),
1909
1909
  status: O.status,
@@ -1986,17 +1986,17 @@ function Is(e) {
1986
1986
  throw new nr(null, e);
1987
1987
  }
1988
1988
  function il(e) {
1989
- return Is(e), e.headers = mt.from(e.headers), e.data = Es.call(
1989
+ return Is(e), e.headers = mt.from(e.headers), e.data = Rs.call(
1990
1990
  e,
1991
1991
  e.transformRequest
1992
1992
  ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Bc.getAdapter(e.adapter || Dr.adapter, e)(e).then(function(r) {
1993
- return Is(e), r.data = Es.call(
1993
+ return Is(e), r.data = Rs.call(
1994
1994
  e,
1995
1995
  e.transformResponse,
1996
1996
  r
1997
1997
  ), r.headers = mt.from(r.headers), r;
1998
1998
  }, function(r) {
1999
- return Oc(r) || (Is(e), r && r.response && (r.response.data = Es.call(
1999
+ return Oc(r) || (Is(e), r && r.response && (r.response.data = Rs.call(
2000
2000
  e,
2001
2001
  e.transformResponse,
2002
2002
  r.response
@@ -2055,8 +2055,8 @@ const oo = {
2055
2055
  let Cn = class {
2056
2056
  constructor(t) {
2057
2057
  this.defaults = t || {}, this.interceptors = {
2058
- request: new Xa(),
2059
- response: new Xa()
2058
+ request: new qa(),
2059
+ response: new qa()
2060
2060
  };
2061
2061
  }
2062
2062
  /**
@@ -2085,7 +2085,7 @@ let Cn = class {
2085
2085
  }
2086
2086
  }
2087
2087
  _request(t, n) {
2088
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = Rn(this.defaults, n);
2088
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = En(this.defaults, n);
2089
2089
  const { transitional: r, paramsSerializer: o, headers: s } = n;
2090
2090
  r !== void 0 && oo.assertOptions(r, {
2091
2091
  silentJSONParsing: Vt.transitional(Vt.boolean),
@@ -2147,14 +2147,14 @@ let Cn = class {
2147
2147
  return d;
2148
2148
  }
2149
2149
  getUri(t) {
2150
- t = Rn(this.defaults, t);
2150
+ t = En(this.defaults, t);
2151
2151
  const n = Dc(t.baseURL, t.url, t.allowAbsoluteUrls);
2152
2152
  return kc(n, t.params, t.paramsSerializer);
2153
2153
  }
2154
2154
  };
2155
2155
  j.forEach(["delete", "get", "head", "options"], function(t) {
2156
2156
  Cn.prototype[t] = function(n, r) {
2157
- return this.request(Rn(r || {}, {
2157
+ return this.request(En(r || {}, {
2158
2158
  method: t,
2159
2159
  url: n,
2160
2160
  data: (r || {}).data
@@ -2164,7 +2164,7 @@ j.forEach(["delete", "get", "head", "options"], function(t) {
2164
2164
  j.forEach(["post", "put", "patch"], function(t) {
2165
2165
  function n(r) {
2166
2166
  return function(s, i, a) {
2167
- return this.request(Rn(a || {}, {
2167
+ return this.request(En(a || {}, {
2168
2168
  method: t,
2169
2169
  headers: r ? {
2170
2170
  "Content-Type": "multipart/form-data"
@@ -2328,29 +2328,29 @@ Object.entries(ti).forEach(([e, t]) => {
2328
2328
  function zc(e) {
2329
2329
  const t = new Cn(e), n = bc(Cn.prototype.request, t);
2330
2330
  return j.extend(n, Cn.prototype, t, { allOwnKeys: !0 }), j.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2331
- return zc(Rn(e, o));
2331
+ return zc(En(e, o));
2332
2332
  }, n;
2333
2333
  }
2334
- const qe = zc(Dr);
2335
- qe.Axios = Cn;
2336
- qe.CanceledError = nr;
2337
- qe.CancelToken = Og;
2338
- qe.isCancel = Oc;
2339
- qe.VERSION = Hc;
2340
- qe.toFormData = Uo;
2341
- qe.AxiosError = we;
2342
- qe.Cancel = qe.CanceledError;
2343
- qe.all = function(t) {
2334
+ const Xe = zc(Dr);
2335
+ Xe.Axios = Cn;
2336
+ Xe.CanceledError = nr;
2337
+ Xe.CancelToken = Og;
2338
+ Xe.isCancel = Oc;
2339
+ Xe.VERSION = Hc;
2340
+ Xe.toFormData = Uo;
2341
+ Xe.AxiosError = we;
2342
+ Xe.Cancel = Xe.CanceledError;
2343
+ Xe.all = function(t) {
2344
2344
  return Promise.all(t);
2345
2345
  };
2346
- qe.spread = Mg;
2347
- qe.isAxiosError = Dg;
2348
- qe.mergeConfig = Rn;
2349
- qe.AxiosHeaders = mt;
2350
- qe.formToJSON = (e) => _c(j.isHTMLForm(e) ? new FormData(e) : e);
2351
- qe.getAdapter = Bc.getAdapter;
2352
- qe.HttpStatusCode = ti;
2353
- qe.default = qe;
2346
+ Xe.spread = Mg;
2347
+ Xe.isAxiosError = Dg;
2348
+ Xe.mergeConfig = En;
2349
+ Xe.AxiosHeaders = mt;
2350
+ Xe.formToJSON = (e) => _c(j.isHTMLForm(e) ? new FormData(e) : e);
2351
+ Xe.getAdapter = Bc.getAdapter;
2352
+ Xe.HttpStatusCode = ti;
2353
+ Xe.default = Xe;
2354
2354
  const {
2355
2355
  Axios: MT,
2356
2356
  AxiosError: DT,
@@ -2366,9 +2366,9 @@ const {
2366
2366
  AxiosHeaders: GT,
2367
2367
  HttpStatusCode: KT,
2368
2368
  formToJSON: YT,
2369
- getAdapter: XT,
2370
- mergeConfig: qT
2371
- } = qe;
2369
+ getAdapter: qT,
2370
+ mergeConfig: XT
2371
+ } = Xe;
2372
2372
  function ll() {
2373
2373
  var e;
2374
2374
  try {
@@ -2390,7 +2390,7 @@ function ul(e) {
2390
2390
  function Fg(e) {
2391
2391
  return ri.add(e), () => ri.delete(e);
2392
2392
  }
2393
- const At = qe.create({
2393
+ const At = Xe.create({
2394
2394
  // Only set baseURL when configured — do NOT fall back to localhost. Falling back causes
2395
2395
  // noisy network requests to the frontend Dev server when the backend isn't configured.
2396
2396
  ...ni ? { baseURL: ni } : {},
@@ -2521,7 +2521,7 @@ class $g {
2521
2521
  return ll() && console.debug("[api.uploadExcel] <-", c), c;
2522
2522
  }
2523
2523
  }
2524
- const En = new $g();
2524
+ const Rn = new $g();
2525
2525
  function zg(e = {}) {
2526
2526
  const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = fe(e.token ?? null), s = bt(e.headers ?? {}), [i, a] = fe(!1), [c, u] = fe(null), [d, h] = fe(""), [p, x] = fe(null), g = bt(null), v = Ye((y) => {
2527
2527
  o(y);
@@ -2531,12 +2531,12 @@ function zg(e = {}) {
2531
2531
  }, []), b = Ye(() => {
2532
2532
  h(""), x(null), u(null);
2533
2533
  }, []), w = Ye(
2534
- (y, E, S) => {
2534
+ (y, R, S) => {
2535
2535
  g.current && (g.current.abort(), g.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && h("");
2536
2536
  const C = new AbortController();
2537
2537
  return g.current = C, (async () => {
2538
2538
  var A, k, M, W, G;
2539
- const R = (() => {
2539
+ const E = (() => {
2540
2540
  var N;
2541
2541
  try {
2542
2542
  return typeof window < "u" && ((N = window.localStorage) == null ? void 0 : N.getItem("chat-debug")) === "1";
@@ -2547,9 +2547,9 @@ function zg(e = {}) {
2547
2547
  var $;
2548
2548
  try {
2549
2549
  const L = JSON.parse(JSON.stringify(N));
2550
- return ($ = L == null ? void 0 : L.payload) != null && $.files_info && Array.isArray(L.payload.files_info) && (L.payload.files_info = L.payload.files_info.map((X) => ({
2551
- ...X,
2552
- data: X != null && X.data ? `<base64 ${String(X.data).length} chars>` : X == null ? void 0 : X.data
2550
+ return ($ = L == null ? void 0 : L.payload) != null && $.files_info && Array.isArray(L.payload.files_info) && (L.payload.files_info = L.payload.files_info.map((q) => ({
2551
+ ...q,
2552
+ data: q != null && q.data ? `<base64 ${String(q.data).length} chars>` : q == null ? void 0 : q.data
2553
2553
  }))), L;
2554
2554
  } catch {
2555
2555
  return N;
@@ -2561,19 +2561,19 @@ function zg(e = {}) {
2561
2561
  if (r)
2562
2562
  N = { Authorization: `Bearer ${r}` };
2563
2563
  else if (typeof window < "u") {
2564
- const z = window.__AUTH_TOKEN__, q = ((A = window.localStorage) == null ? void 0 : A.getItem("authToken")) || null;
2564
+ const z = window.__AUTH_TOKEN__, X = ((A = window.localStorage) == null ? void 0 : A.getItem("authToken")) || null;
2565
2565
  let oe = null;
2566
2566
  try {
2567
2567
  const Q = (k = window.localStorage) == null ? void 0 : k.getItem("chat-settings");
2568
2568
  Q && (oe = ((M = JSON.parse(Q)) == null ? void 0 : M.apiKey) || null);
2569
2569
  } catch {
2570
2570
  }
2571
- const F = z || q || oe || null;
2571
+ const F = z || X || oe || null;
2572
2572
  F && (N = { Authorization: `Bearer ${F}` });
2573
2573
  }
2574
2574
  } catch {
2575
2575
  }
2576
- R && console.debug("[use-chat] POST", t + n, I(y));
2576
+ E && console.debug("[use-chat] POST", t + n, I(y));
2577
2577
  const $ = await fetch(t + n, {
2578
2578
  method: "POST",
2579
2579
  headers: {
@@ -2587,41 +2587,41 @@ function zg(e = {}) {
2587
2587
  });
2588
2588
  if (!$.ok || !$.body) {
2589
2589
  const _ = await $.text().catch(() => "");
2590
- throw R && console.debug("[use-chat] non-OK response", $.status, _ == null ? void 0 : _.slice(0, 500)), new Error(`stream ${$.status}${_ ? ": " + _ : ""}`);
2590
+ throw E && console.debug("[use-chat] non-OK response", $.status, _ == null ? void 0 : _.slice(0, 500)), new Error(`stream ${$.status}${_ ? ": " + _ : ""}`);
2591
2591
  }
2592
2592
  try {
2593
- const _ = $.headers.get("X-Thread-Id") || $.headers.get("x-thread-id"), z = $.headers.get("X-Thread-Created") || $.headers.get("x-thread-created"), q = _ ?? null, oe = String(z ?? "").toLowerCase() === "true";
2593
+ const _ = $.headers.get("X-Thread-Id") || $.headers.get("x-thread-id"), z = $.headers.get("X-Thread-Created") || $.headers.get("x-thread-created"), X = _ ?? null, oe = String(z ?? "").toLowerCase() === "true";
2594
2594
  try {
2595
- (W = S == null ? void 0 : S.onOpen) == null || W.call(S, { threadId: q, created: oe });
2595
+ (W = S == null ? void 0 : S.onOpen) == null || W.call(S, { threadId: X, created: oe });
2596
2596
  } catch (F) {
2597
- R && console.debug("[use-chat] onOpen handler threw:", F);
2597
+ E && console.debug("[use-chat] onOpen handler threw:", F);
2598
2598
  }
2599
2599
  } catch (_) {
2600
- R && console.debug("[use-chat] failed to read headers:", _);
2600
+ E && console.debug("[use-chat] failed to read headers:", _);
2601
2601
  }
2602
- const L = $.body.getReader(), X = new TextDecoder();
2602
+ const L = $.body.getReader(), q = new TextDecoder();
2603
2603
  let O = "";
2604
2604
  for (; ; ) {
2605
2605
  const { value: _, done: z } = await L.read();
2606
2606
  if (z) break;
2607
- O += X.decode(_, { stream: !0 });
2608
- let q;
2609
- for (; (q = O.indexOf(`
2607
+ O += q.decode(_, { stream: !0 });
2608
+ let X;
2609
+ for (; (X = O.indexOf(`
2610
2610
 
2611
2611
  `)) >= 0; ) {
2612
- const oe = O.slice(0, q);
2613
- O = O.slice(q + 2);
2612
+ const oe = O.slice(0, X);
2613
+ O = O.slice(X + 2);
2614
2614
  const F = Wg(oe);
2615
2615
  if (!F) continue;
2616
2616
  let Q;
2617
2617
  try {
2618
2618
  Q = JSON.parse(F);
2619
2619
  } catch {
2620
- R && console.debug("[use-chat] skip malformed SSE data:", F == null ? void 0 : F.slice(0, 200));
2620
+ E && console.debug("[use-chat] skip malformed SSE data:", F == null ? void 0 : F.slice(0, 200));
2621
2621
  continue;
2622
2622
  }
2623
2623
  const de = Ug(Q) ? Q.data : Q;
2624
- if (R && console.debug("[use-chat] event:", de == null ? void 0 : de.type, de), E == null || E(de), de.type === "token")
2624
+ if (E && console.debug("[use-chat] event:", de == null ? void 0 : de.type, de), R == null || R(de), de.type === "token")
2625
2625
  e.autoAppendAssistant !== !1 && h((be) => be + de.content);
2626
2626
  else if (de.type === "message_delta") {
2627
2627
  const be = de.delta.filter((Y) => Y.type === "text").map((Y) => Y.text).join("");
@@ -2632,7 +2632,7 @@ function zg(e = {}) {
2632
2632
  } catch (N) {
2633
2633
  if ((N == null ? void 0 : N.name) === "AbortError") return;
2634
2634
  const $ = (N == null ? void 0 : N.message) || String(N);
2635
- R && console.debug("[use-chat] error:", $), u($), (G = S == null ? void 0 : S.onError) == null || G.call(S, $);
2635
+ E && console.debug("[use-chat] error:", $), u($), (G = S == null ? void 0 : S.onError) == null || G.call(S, $);
2636
2636
  } finally {
2637
2637
  a(!1), g.current = null;
2638
2638
  }
@@ -2757,7 +2757,7 @@ function Gg(e, t) {
2757
2757
  return { ...e, messages: u };
2758
2758
  }
2759
2759
  if (o.type === "checkpoint") {
2760
- const s = qg(e.messages, o.checkpointId);
2760
+ const s = Xg(e.messages, o.checkpointId);
2761
2761
  return { ...e, lastCheckpointId: o.checkpointId, messages: s };
2762
2762
  }
2763
2763
  if (o.type === "branch") {
@@ -2816,9 +2816,9 @@ function Yg(e, t, n) {
2816
2816
  });
2817
2817
  }
2818
2818
  function fl(e, t, n) {
2819
- return e.map((r) => r.id === t ? { ...r, content: Xg(r.content, n) } : r);
2819
+ return e.map((r) => r.id === t ? { ...r, content: qg(r.content, n) } : r);
2820
2820
  }
2821
- function Xg(e, t) {
2821
+ function qg(e, t) {
2822
2822
  const n = e.slice();
2823
2823
  for (const r of t)
2824
2824
  if (r.type === "text") {
@@ -2828,7 +2828,7 @@ function Xg(e, t) {
2828
2828
  n.push(r);
2829
2829
  return n;
2830
2830
  }
2831
- function qg(e, t) {
2831
+ function Xg(e, t) {
2832
2832
  for (let n = e.length - 1; n >= 0; n--)
2833
2833
  if (e[n].role === "assistant") {
2834
2834
  const o = { ...e[n], checkpointId: t };
@@ -2925,7 +2925,7 @@ async function tv(e, t = [], n, r, o, s) {
2925
2925
  }
2926
2926
  const Uc = pc(null);
2927
2927
  function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialThreadId: o = null, historyPageSize: s, autoLoadInitial: i = !0, enableFileAgentRouting: a = !1, fileAgentId: c = "invoice_reader" }) {
2928
- const u = En;
2928
+ const u = Rn;
2929
2929
  Ve(() => {
2930
2930
  t && u.updateConfig({
2931
2931
  baseUrl: t.baseUrl,
@@ -2952,13 +2952,13 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2952
2952
  }, [u, g]);
2953
2953
  const b = Ye((H) => {
2954
2954
  u.setAuthToken(H);
2955
- }, [u]), { state: w, seed: y, prepend: E, pushUser: S, onEvent: C, reset: R } = Kg(), I = s && s > 0 ? s : 6, [A, k] = fe(!1), [M, W] = fe(!1), [G, N] = fe(null), [$, L] = fe(void 0), X = Ye(
2955
+ }, [u]), { state: w, seed: y, prepend: R, pushUser: S, onEvent: C, reset: E } = Kg(), I = s && s > 0 ? s : 6, [A, k] = fe(!1), [M, W] = fe(!1), [G, N] = fe(null), [$, L] = fe(void 0), q = Ye(
2956
2956
  (H, ae) => {
2957
2957
  const Be = Array.isArray(H == null ? void 0 : H.messages) ? H.messages : [];
2958
- ae === "replace" ? y(Be) : ae === "prepend" && Be.length && E(Be), N((H == null ? void 0 : H.nextCursor) ?? null), k(!!(H != null && H.hasMore)), L((nt) => (H == null ? void 0 : H.checkpointId) ?? nt ?? void 0);
2958
+ ae === "replace" ? y(Be) : ae === "prepend" && Be.length && R(Be), N((H == null ? void 0 : H.nextCursor) ?? null), k(!!(H != null && H.hasMore)), L((nt) => (H == null ? void 0 : H.checkpointId) ?? nt ?? void 0);
2959
2959
  },
2960
- [y, E]
2961
- ), [O, _] = fe([]), [z, q] = fe(null), oe = Ye(async () => {
2960
+ [y, R]
2961
+ ), [O, _] = fe([]), [z, X] = fe(null), oe = Ye(async () => {
2962
2962
  const H = await u.listThreads();
2963
2963
  _(H);
2964
2964
  }, [u]), [F, Q] = fe(!1), de = Ye(
@@ -3054,13 +3054,13 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3054
3054
  checkpointNs: Be,
3055
3055
  limit: I
3056
3056
  });
3057
- q(H), X(nt, "replace");
3057
+ X(H), q(nt, "replace");
3058
3058
  } finally {
3059
3059
  Y.current = null;
3060
3060
  }
3061
3061
  }
3062
3062
  },
3063
- [u, X]
3063
+ [u, q]
3064
3064
  ), Z = Ye(async (H) => {
3065
3065
  const ae = await u.listCheckpoints(H);
3066
3066
  return Zg(ae, H);
@@ -3072,8 +3072,8 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3072
3072
  checkpointId: H,
3073
3073
  limit: I
3074
3074
  });
3075
- X(ae, "replace");
3076
- }, [u, z, X, I]), le = Ye(async () => {
3075
+ q(ae, "replace");
3076
+ }, [u, z, q, I]), le = Ye(async () => {
3077
3077
  if (!z) throw new Error("No active thread");
3078
3078
  await P(z);
3079
3079
  }, [z, P]), ie = bt(!1);
@@ -3088,7 +3088,7 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3088
3088
  checkpointId: ae,
3089
3089
  limit: I
3090
3090
  });
3091
- X(Be, "replace");
3091
+ q(Be, "replace");
3092
3092
  } catch {
3093
3093
  }
3094
3094
  try {
@@ -3097,13 +3097,13 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3097
3097
  }
3098
3098
  })();
3099
3099
  }
3100
- }, [d, z, w.lastCheckpointId, u, X, oe]);
3100
+ }, [d, z, w.lastCheckpointId, u, q, oe]);
3101
3101
  const Pe = Ye(async (H) => {
3102
3102
  const ae = await u.createThread(H);
3103
3103
  return await oe(), await P(ae.threadId), ae.threadId;
3104
3104
  }, [u, oe, P]), Fe = Ye(async (H) => {
3105
- await u.deleteThread(H), await oe(), z === H && (q(null), R([]), k(!1), N(null), L(void 0));
3106
- }, [u, oe, z, R]), Le = Ye(async (H, ae) => {
3105
+ await u.deleteThread(H), await oe(), z === H && (X(null), E([]), k(!1), N(null), L(void 0));
3106
+ }, [u, oe, z, E]), Le = Ye(async (H, ae) => {
3107
3107
  await u.updateThread(H, ae), await oe();
3108
3108
  }, [u, oe]), ce = Ye(async (H, ae) => {
3109
3109
  var Dn;
@@ -3150,12 +3150,12 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3150
3150
  {
3151
3151
  onError: (Ue) => console.warn("stream error", Ue),
3152
3152
  onOpen: ({ threadId: Ue, created: cr }) => {
3153
- !z && Ue && (q(Ue), cr && oe().catch(() => {
3153
+ !z && Ue && (X(Ue), cr && oe().catch(() => {
3154
3154
  }));
3155
3155
  }
3156
3156
  }
3157
3157
  );
3158
- }, [z, S, p, C, w.lastCheckpointId, u, t == null ? void 0 : t.uploadPath, oe, q, a, c]), Ae = Ye(
3158
+ }, [z, S, p, C, w.lastCheckpointId, u, t == null ? void 0 : t.uploadPath, oe, X, a, c]), Ae = Ye(
3159
3159
  async (H) => {
3160
3160
  if (!z) throw new Error("No active thread");
3161
3161
  if (M || !A) return;
@@ -3169,13 +3169,13 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3169
3169
  limit: (H == null ? void 0 : H.limit) ?? I,
3170
3170
  beforeId: ae
3171
3171
  });
3172
- X(Be, "prepend");
3172
+ q(Be, "prepend");
3173
3173
  } finally {
3174
3174
  W(!1);
3175
3175
  }
3176
3176
  }
3177
3177
  },
3178
- [u, z, $, G, A, M, X]
3178
+ [u, z, $, G, A, M, q]
3179
3179
  ), ve = {
3180
3180
  baseUrl: u.baseUrl,
3181
3181
  token: v,
@@ -3183,7 +3183,7 @@ function so({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3183
3183
  api: u,
3184
3184
  threads: O,
3185
3185
  currentThreadId: z,
3186
- setCurrentThreadId: q,
3186
+ setCurrentThreadId: X,
3187
3187
  messages: w.messages,
3188
3188
  isStreaming: d,
3189
3189
  error: h,
@@ -3255,7 +3255,7 @@ function ye(e, t) {
3255
3255
  function Bi(e) {
3256
3256
  e(rr);
3257
3257
  }
3258
- function Xe(e) {
3258
+ function qe(e) {
3259
3259
  return e(Wc);
3260
3260
  }
3261
3261
  function ue(e, t) {
@@ -3362,7 +3362,7 @@ function av(e) {
3362
3362
  }
3363
3363
  function V(e) {
3364
3364
  let t = e;
3365
- const n = Ee();
3365
+ const n = Re();
3366
3366
  return (r, o) => {
3367
3367
  switch (r) {
3368
3368
  case Vo:
@@ -3381,7 +3381,7 @@ function V(e) {
3381
3381
  function ct(e, t) {
3382
3382
  return Go(V(t), (n) => ue(e, n));
3383
3383
  }
3384
- function Ee() {
3384
+ function Re() {
3385
3385
  const e = [];
3386
3386
  return (t, n) => {
3387
3387
  switch (t) {
@@ -3402,7 +3402,7 @@ function Ee() {
3402
3402
  };
3403
3403
  }
3404
3404
  function St(e) {
3405
- return Go(Ee(), (t) => ue(e, t));
3405
+ return Go(Re(), (t) => ue(e, t));
3406
3406
  }
3407
3407
  function je(e, t = [], { singleton: n } = { singleton: !0 }) {
3408
3408
  return {
@@ -3423,7 +3423,7 @@ function cv(e) {
3423
3423
  return n(e);
3424
3424
  }
3425
3425
  function Ze(...e) {
3426
- const t = Ee(), n = new Array(e.length);
3426
+ const t = Re(), n = new Array(e.length);
3427
3427
  let r = 0;
3428
3428
  const o = Math.pow(2, e.length) - 1;
3429
3429
  return e.forEach((s, i) => {
@@ -3470,7 +3470,7 @@ const uv = {
3470
3470
  return {
3471
3471
  log: V((t, n, r = 1) => {
3472
3472
  var o;
3473
- const s = (o = dv().VIRTUOSO_LOG_LEVEL) != null ? o : Xe(e);
3473
+ const s = (o = dv().VIRTUOSO_LOG_LEVEL) != null ? o : qe(e);
3474
3474
  r >= s && console[uv[r]](
3475
3475
  "%creact-virtuoso: %c%s %o",
3476
3476
  "color: #0253b3; font-weight: bold",
@@ -3591,7 +3591,7 @@ function Kc(e, t, n) {
3591
3591
  }
3592
3592
  const ft = je(
3593
3593
  () => {
3594
- const e = Ee(), t = Ee(), n = V(0), r = Ee(), o = V(0), s = Ee(), i = Ee(), a = V(0), c = V(0), u = V(0), d = V(0), h = Ee(), p = Ee(), x = V(!1), g = V(!1), v = V(!1);
3594
+ const e = Re(), t = Re(), n = V(0), r = Re(), o = V(0), s = Re(), i = Re(), a = V(0), c = V(0), u = V(0), d = V(0), h = Re(), p = Re(), x = V(!1), g = V(!1), v = V(!1);
3595
3595
  return ue(
3596
3596
  B(
3597
3597
  e,
@@ -3680,8 +3680,8 @@ function ii(e, t) {
3680
3680
  if (De(o))
3681
3681
  return r;
3682
3682
  {
3683
- const [s, i] = qc(r);
3684
- return io(et(e, { k: s, l: Xc(r), v: i }));
3683
+ const [s, i] = Xc(r);
3684
+ return io(et(e, { k: s, l: qc(r), v: i }));
3685
3685
  }
3686
3686
  } else return t < n ? io(et(e, { l: ii(r, t) })) : io(et(e, { r: ii(o, t) }));
3687
3687
  }
@@ -3738,14 +3738,14 @@ function et(e, t) {
3738
3738
  t.r !== void 0 ? t.r : e.r
3739
3739
  );
3740
3740
  }
3741
- function Xc(e) {
3742
- return De(e.r) ? e.l : io(et(e, { r: Xc(e.r) }));
3741
+ function qc(e) {
3742
+ return De(e.r) ? e.l : io(et(e, { r: qc(e.r) }));
3743
3743
  }
3744
3744
  function As(e) {
3745
3745
  return De(e) || e.lvl > e.r.lvl;
3746
3746
  }
3747
- function qc(e) {
3748
- return De(e.r) ? [e.k, e.v] : qc(e.r);
3747
+ function Xc(e) {
3748
+ return De(e.r) ? [e.k, e.v] : Xc(e.r);
3749
3749
  }
3750
3750
  function Jc(e, t, n, r = yr, o = yr) {
3751
3751
  return { k: e, l: r, lvl: n, r: o, v: t };
@@ -3934,12 +3934,12 @@ function Tv(e) {
3934
3934
  const { endIndex: t, size: n, startIndex: r } = e;
3935
3935
  return (o) => o.start === r && (o.end === t || o.end === 1 / 0) && o.value === n;
3936
3936
  }
3937
- const Rv = {
3937
+ const Ev = {
3938
3938
  offsetHeight: "height",
3939
3939
  offsetWidth: "width"
3940
3940
  }, Zt = je(
3941
3941
  ([{ log: e }, { recalcInProgress: t }]) => {
3942
- const n = Ee(), r = Ee(), o = ct(r, 0), s = Ee(), i = Ee(), a = V(0), c = V([]), u = V(void 0), d = V(void 0), h = V((S, C) => cn(S, Rv[C])), p = V(void 0), x = V(0), g = gv(), v = ct(
3942
+ const n = Re(), r = Re(), o = ct(r, 0), s = Re(), i = Re(), a = V(0), c = V([]), u = V(void 0), d = V(void 0), h = V((S, C) => cn(S, Ev[C])), p = V(void 0), x = V(0), g = gv(), v = ct(
3943
3943
  B(n, Se(c, e, x), Yt(yv, g), He()),
3944
3944
  g
3945
3945
  ), m = ct(
@@ -3959,8 +3959,8 @@ const Rv = {
3959
3959
  c,
3960
3960
  pe((S) => S.length > 0),
3961
3961
  Se(v, x),
3962
- re(([S, C, R]) => {
3963
- const I = S.reduce((A, k, M) => yt(A, k, Tr(k, C.offsetTree, R) || M), Vn());
3962
+ re(([S, C, E]) => {
3963
+ const I = S.reduce((A, k, M) => yt(A, k, Tr(k, C.offsetTree, E) || M), Vn());
3964
3964
  return {
3965
3965
  ...C,
3966
3966
  groupIndices: S,
@@ -3974,10 +3974,10 @@ const Rv = {
3974
3974
  r,
3975
3975
  Se(v),
3976
3976
  pe(([S, { lastIndex: C }]) => S < C),
3977
- re(([S, { lastIndex: C, lastSize: R }]) => [
3977
+ re(([S, { lastIndex: C, lastSize: E }]) => [
3978
3978
  {
3979
3979
  endIndex: C,
3980
- size: R,
3980
+ size: E,
3981
3981
  startIndex: S
3982
3982
  }
3983
3983
  ])
@@ -3994,7 +3994,7 @@ const Rv = {
3994
3994
  ue(
3995
3995
  B(
3996
3996
  d,
3997
- pe((S) => S !== void 0 && De(Xe(v).sizeTree)),
3997
+ pe((S) => S !== void 0 && De(qe(v).sizeTree)),
3998
3998
  re((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
3999
3999
  ),
4000
4000
  n
@@ -4004,9 +4004,9 @@ const Rv = {
4004
4004
  n,
4005
4005
  Se(v),
4006
4006
  Yt(
4007
- ({ sizes: S }, [C, R]) => ({
4008
- changed: R !== S,
4009
- sizes: R
4007
+ ({ sizes: S }, [C, E]) => ({
4008
+ changed: E !== S,
4009
+ sizes: E
4010
4010
  }),
4011
4011
  { changed: !1, sizes: g }
4012
4012
  ),
@@ -4023,12 +4023,12 @@ const Rv = {
4023
4023
  re((S) => S.diff)
4024
4024
  ),
4025
4025
  (S) => {
4026
- const { groupIndices: C } = Xe(v);
4026
+ const { groupIndices: C } = qe(v);
4027
4027
  if (S > 0)
4028
4028
  ye(t, !0), ye(s, S + xl(S, C));
4029
4029
  else if (S < 0) {
4030
- const R = Xe(m);
4031
- R.length > 0 && (S -= xl(-S, R)), ye(i, S);
4030
+ const E = qe(m);
4031
+ E.length > 0 && (S -= xl(-S, E)), ye(i, S);
4032
4032
  }
4033
4033
  }
4034
4034
  ), Oe(B(a, Se(e)), ([S, C]) => {
@@ -4044,8 +4044,8 @@ const Rv = {
4044
4044
  s,
4045
4045
  Se(v),
4046
4046
  re(([S, C]) => {
4047
- const R = C.groupIndices.length > 0, I = [], A = C.lastSize;
4048
- if (R) {
4047
+ const E = C.groupIndices.length > 0, I = [], A = C.lastSize;
4048
+ if (E) {
4049
4049
  const k = Sr(C.sizeTree, 0);
4050
4050
  let M = 0, W = 0;
4051
4051
  for (; M < S; ) {
@@ -4063,8 +4063,8 @@ const Rv = {
4063
4063
  const G = Sn(C.sizeTree);
4064
4064
  return M !== S && G.shift(), G.reduce(
4065
4065
  (N, { k: $, v: L }) => {
4066
- let X = N.ranges;
4067
- return N.prevSize !== 0 && (X = [
4066
+ let q = N.ranges;
4067
+ return N.prevSize !== 0 && (q = [
4068
4068
  ...N.ranges,
4069
4069
  {
4070
4070
  endIndex: $ + S - 1,
@@ -4074,7 +4074,7 @@ const Rv = {
4074
4074
  ]), {
4075
4075
  prevIndex: $ + S,
4076
4076
  prevSize: L,
4077
- ranges: X
4077
+ ranges: q
4078
4078
  };
4079
4079
  },
4080
4080
  {
@@ -4100,13 +4100,13 @@ const Rv = {
4100
4100
  ),
4101
4101
  n
4102
4102
  );
4103
- const E = St(
4103
+ const R = St(
4104
4104
  B(
4105
4105
  i,
4106
4106
  Se(v, x),
4107
- re(([S, { offsetTree: C }, R]) => {
4107
+ re(([S, { offsetTree: C }, E]) => {
4108
4108
  const I = -S;
4109
- return Tr(I, C, R);
4109
+ return Tr(I, C, E);
4110
4110
  })
4111
4111
  )
4112
4112
  );
@@ -4114,12 +4114,12 @@ const Rv = {
4114
4114
  B(
4115
4115
  i,
4116
4116
  Se(v, x),
4117
- re(([S, C, R]) => {
4117
+ re(([S, C, E]) => {
4118
4118
  if (C.groupIndices.length > 0) {
4119
4119
  if (De(C.sizeTree))
4120
4120
  return C;
4121
4121
  let I = Vn();
4122
- const A = Xe(m);
4122
+ const A = qe(m);
4123
4123
  let k = 0, M = 0, W = 0;
4124
4124
  for (; k < -S; ) {
4125
4125
  W = A[M];
@@ -4135,14 +4135,14 @@ const Rv = {
4135
4135
  return {
4136
4136
  ...C,
4137
4137
  sizeTree: I,
4138
- ...ci(C.offsetTree, 0, I, R)
4138
+ ...ci(C.offsetTree, 0, I, E)
4139
4139
  };
4140
4140
  } else {
4141
4141
  const I = Sn(C.sizeTree).reduce((A, { k, v: M }) => yt(A, Math.max(0, k + S), M), Vn());
4142
4142
  return {
4143
4143
  ...C,
4144
4144
  sizeTree: I,
4145
- ...ci(C.offsetTree, 0, I, R)
4145
+ ...ci(C.offsetTree, 0, I, E)
4146
4146
  };
4147
4147
  }
4148
4148
  })
@@ -4160,7 +4160,7 @@ const Rv = {
4160
4160
  itemSize: h,
4161
4161
  listRefresh: w,
4162
4162
  shiftWith: i,
4163
- shiftWithOffset: E,
4163
+ shiftWithOffset: R,
4164
4164
  sizeRanges: n,
4165
4165
  // output
4166
4166
  sizes: v,
@@ -4173,7 +4173,7 @@ const Rv = {
4173
4173
  $e(pn, $i),
4174
4174
  { singleton: !0 }
4175
4175
  );
4176
- function Ev(e) {
4176
+ function Rv(e) {
4177
4177
  return e.reduce(
4178
4178
  (t, n) => (t.groupIndices.push(t.totalCount), t.totalCount += n + 1, t),
4179
4179
  {
@@ -4184,7 +4184,7 @@ function Ev(e) {
4184
4184
  }
4185
4185
  const ru = je(
4186
4186
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
4187
- const s = Ee(), i = Ee(), a = St(B(s, re(Ev)));
4187
+ const s = Re(), i = Re(), a = St(B(s, re(Rv)));
4188
4188
  return ue(
4189
4189
  B(
4190
4190
  a,
@@ -4219,7 +4219,7 @@ const ru = je(
4219
4219
  )
4220
4220
  );
4221
4221
  return Oe(t, (r) => {
4222
- r && Xe(e)("props updated", {}, gt.DEBUG);
4222
+ r && qe(e)("props updated", {}, gt.DEBUG);
4223
4223
  }), { didMount: n, propsReady: t };
4224
4224
  },
4225
4225
  $e(pn),
@@ -4244,7 +4244,7 @@ const Lr = je(
4244
4244
  },
4245
4245
  { log: p }
4246
4246
  ]) => {
4247
- const x = Ee(), g = Ee(), v = V(0);
4247
+ const x = Re(), g = Re(), v = V(0);
4248
4248
  let m = null, b = null, w = null;
4249
4249
  function y() {
4250
4250
  m && (m(), m = null), w && (w(), w = null), b && (clearTimeout(b), b = null), ye(c, !1);
@@ -4256,18 +4256,18 @@ const Lr = je(
4256
4256
  Se(e, s, o),
4257
4257
  re(
4258
4258
  ([
4259
- [E, S, C, R, I, A, k, M],
4259
+ [R, S, C, E, I, A, k, M],
4260
4260
  W,
4261
4261
  G,
4262
4262
  N
4263
4263
  ]) => {
4264
- const $ = ou(E), { align: L, behavior: X, offset: O } = $, _ = R - 1, z = nu($, S, _);
4265
- let q = Tr(z, S.offsetTree, W) + A;
4266
- L === "end" ? (q += G + Bt(S.sizeTree, z)[1] - C + N, z === _ && (q += k)) : L === "center" ? q += (G + Bt(S.sizeTree, z)[1] - C + N) / 2 : q -= I, O && (q += O);
4264
+ const $ = ou(R), { align: L, behavior: q, offset: O } = $, _ = E - 1, z = nu($, S, _);
4265
+ let X = Tr(z, S.offsetTree, W) + A;
4266
+ L === "end" ? (X += G + Bt(S.sizeTree, z)[1] - C + N, z === _ && (X += k)) : L === "center" ? X += (G + Bt(S.sizeTree, z)[1] - C + N) / 2 : X -= I, O && (X += O);
4267
4267
  const oe = (F) => {
4268
- y(), F ? (M("retrying to scroll to", { location: E }, gt.DEBUG), ye(x, E)) : (ye(g, !0), M("list did not change, scroll successful", {}, gt.DEBUG));
4268
+ y(), F ? (M("retrying to scroll to", { location: R }, gt.DEBUG), ye(x, R)) : (ye(g, !0), M("list did not change, scroll successful", {}, gt.DEBUG));
4269
4269
  };
4270
- if (y(), X === "smooth") {
4270
+ if (y(), q === "smooth") {
4271
4271
  let F = !1;
4272
4272
  w = Oe(t, (Q) => {
4273
4273
  F = F || Q;
@@ -4278,7 +4278,7 @@ const Lr = je(
4278
4278
  m = Lt(B(t, Nv(150)), oe);
4279
4279
  return b = setTimeout(() => {
4280
4280
  y();
4281
- }, 1200), ye(c, !0), M("scrolling from index to", { behavior: X, index: z, top: q }, gt.DEBUG), { behavior: X, top: q };
4281
+ }, 1200), ye(c, !0), M("scrolling from index to", { behavior: q, index: z, top: X }, gt.DEBUG), { behavior: q, top: X };
4282
4282
  }
4283
4283
  )
4284
4284
  ),
@@ -4358,7 +4358,7 @@ const Fr = je(
4358
4358
  function su(e, t) {
4359
4359
  return Math.abs(e - t) < 1.01;
4360
4360
  }
4361
- const Rr = "up", vr = "down", jv = "none", Av = {
4361
+ const Er = "up", vr = "down", jv = "none", Av = {
4362
4362
  atBottom: !1,
4363
4363
  notAtBottomBecause: "NOT_SHOWING_LAST_ITEM",
4364
4364
  state: {
@@ -4368,7 +4368,7 @@ const Rr = "up", vr = "down", jv = "none", Av = {
4368
4368
  viewportHeight: 0
4369
4369
  }
4370
4370
  }, kv = 0, Br = je(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
4371
- const i = V(!1), a = V(!0), c = Ee(), u = Ee(), d = V(4), h = V(kv), p = ct(
4371
+ const i = V(!1), a = V(!0), c = Re(), u = Re(), d = V(4), h = V(kv), p = ct(
4372
4372
  B(
4373
4373
  si(B(he(o), In(1), Gt(!0)), B(he(o), In(1), Gt(!1), ml(100))),
4374
4374
  He()
@@ -4389,15 +4389,15 @@ const Rr = "up", vr = "down", jv = "none", Av = {
4389
4389
  const g = St(
4390
4390
  B(
4391
4391
  Ze(r, he(s), he(t), he(e), he(d)),
4392
- Yt((w, [{ scrollHeight: y, scrollTop: E }, S, C, R, I]) => {
4393
- const A = E + S - y > -I, k = {
4392
+ Yt((w, [{ scrollHeight: y, scrollTop: R }, S, C, E, I]) => {
4393
+ const A = R + S - y > -I, k = {
4394
4394
  scrollHeight: y,
4395
- scrollTop: E,
4395
+ scrollTop: R,
4396
4396
  viewportHeight: S
4397
4397
  };
4398
4398
  if (A) {
4399
4399
  let W, G;
4400
- return E > w.state.scrollTop ? (W = "SCROLLED_DOWN", G = w.state.scrollTop - E) : (W = "SIZE_DECREASED", G = w.state.scrollTop - E || w.scrollTopDelta), {
4400
+ return R > w.state.scrollTop ? (W = "SCROLLED_DOWN", G = w.state.scrollTop - R) : (W = "SIZE_DECREASED", G = w.state.scrollTop - R || w.scrollTopDelta), {
4401
4401
  atBottom: !0,
4402
4402
  atBottomBecause: W,
4403
4403
  scrollTopDelta: G,
@@ -4405,7 +4405,7 @@ const Rr = "up", vr = "down", jv = "none", Av = {
4405
4405
  };
4406
4406
  }
4407
4407
  let M;
4408
- return k.scrollHeight > w.state.scrollHeight ? M = "SIZE_INCREASED" : S < w.state.viewportHeight ? M = "VIEWPORT_HEIGHT_DECREASING" : E < w.state.scrollTop ? M = "SCROLLING_UPWARDS" : M = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
4408
+ return k.scrollHeight > w.state.scrollHeight ? M = "SIZE_INCREASED" : S < w.state.viewportHeight ? M = "VIEWPORT_HEIGHT_DECREASING" : R < w.state.scrollTop ? M = "SCROLLING_UPWARDS" : M = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
4409
4409
  atBottom: !1,
4410
4410
  notAtBottomBecause: M,
4411
4411
  state: k
@@ -4417,26 +4417,26 @@ const Rr = "up", vr = "down", jv = "none", Av = {
4417
4417
  B(
4418
4418
  r,
4419
4419
  Yt(
4420
- (w, { scrollHeight: y, scrollTop: E, viewportHeight: S }) => {
4420
+ (w, { scrollHeight: y, scrollTop: R, viewportHeight: S }) => {
4421
4421
  if (su(w.scrollHeight, y))
4422
4422
  return {
4423
4423
  changed: !1,
4424
4424
  jump: 0,
4425
4425
  scrollHeight: y,
4426
- scrollTop: E
4426
+ scrollTop: R
4427
4427
  };
4428
4428
  {
4429
- const C = y - (E + S) < 1;
4430
- return w.scrollTop !== E && C ? {
4429
+ const C = y - (R + S) < 1;
4430
+ return w.scrollTop !== R && C ? {
4431
4431
  changed: !0,
4432
- jump: w.scrollTop - E,
4432
+ jump: w.scrollTop - R,
4433
4433
  scrollHeight: y,
4434
- scrollTop: E
4434
+ scrollTop: R
4435
4435
  } : {
4436
4436
  changed: !0,
4437
4437
  jump: 0,
4438
4438
  scrollHeight: y,
4439
- scrollTop: E
4439
+ scrollTop: R
4440
4440
  };
4441
4441
  }
4442
4442
  },
@@ -4461,7 +4461,7 @@ const Rr = "up", vr = "down", jv = "none", Av = {
4461
4461
  re(({ scrollTop: w }) => w),
4462
4462
  He(),
4463
4463
  Yt(
4464
- (w, y) => Xe(x) ? { direction: w.direction, prevScrollTop: y } : { direction: y < w.prevScrollTop ? Rr : vr, prevScrollTop: y },
4464
+ (w, y) => qe(x) ? { direction: w.direction, prevScrollTop: y } : { direction: y < w.prevScrollTop ? Er : vr, prevScrollTop: y },
4465
4465
  { direction: vr, prevScrollTop: 0 }
4466
4466
  ),
4467
4467
  re((w) => w.direction)
@@ -4482,7 +4482,7 @@ const Rr = "up", vr = "down", jv = "none", Av = {
4482
4482
  nn(100),
4483
4483
  Se(p),
4484
4484
  pe(([w, y]) => !!y),
4485
- Yt(([w, y], [E]) => [y, E], [0, 0]),
4485
+ Yt(([w, y], [R]) => [y, R], [0, 0]),
4486
4486
  re(([w, y]) => y - w)
4487
4487
  ),
4488
4488
  b
@@ -4499,9 +4499,9 @@ const Rr = "up", vr = "down", jv = "none", Av = {
4499
4499
  scrollDirection: m,
4500
4500
  scrollVelocity: b
4501
4501
  };
4502
- }, $e(ft)), Ro = "top", Eo = "bottom", bl = "none";
4502
+ }, $e(ft)), Eo = "top", Ro = "bottom", bl = "none";
4503
4503
  function wl(e, t, n) {
4504
- return typeof e == "number" ? n === Rr && t === Ro || n === vr && t === Eo ? e : 0 : n === Rr ? t === Ro ? e.main : e.reverse : t === Eo ? e.main : e.reverse;
4504
+ return typeof e == "number" ? n === Er && t === Eo || n === vr && t === Ro ? e : 0 : n === Er ? t === Eo ? e.main : e.reverse : t === Ro ? e.main : e.reverse;
4505
4505
  }
4506
4506
  function yl(e, t) {
4507
4507
  var n;
@@ -4509,7 +4509,7 @@ function yl(e, t) {
4509
4509
  }
4510
4510
  const Vi = je(
4511
4511
  ([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
4512
- const s = Ee(), i = V(0), a = V(0), c = V(0), u = ct(
4512
+ const s = Re(), i = V(0), a = V(0), c = V(0), u = ct(
4513
4513
  B(
4514
4514
  Ze(
4515
4515
  he(r),
@@ -4534,12 +4534,12 @@ const Vi = je(
4534
4534
  w,
4535
4535
  y
4536
4536
  ]) => {
4537
- const E = d - w, S = m + b, C = Math.max(p - E, 0);
4538
- let R = bl;
4539
- const I = yl(y, Ro), A = yl(y, Eo);
4540
- return x -= w, x += p + b, g += p + b, g -= w, x > d + S - I && (R = Rr), g < d - C + h + A && (R = vr), R !== bl ? [
4541
- Math.max(E - p - wl(v, Ro, R) - I, 0),
4542
- E - C - b + h + wl(v, Eo, R) + A
4537
+ const R = d - w, S = m + b, C = Math.max(p - R, 0);
4538
+ let E = bl;
4539
+ const I = yl(y, Eo), A = yl(y, Ro);
4540
+ return x -= w, x += p + b, g += p + b, g -= w, x > d + S - I && (E = Er), g < d - C + h + A && (E = vr), E !== bl ? [
4541
+ Math.max(R - p - wl(v, Eo, E) - I, 0),
4542
+ R - C - b + h + wl(v, Ro, E) + A
4543
4543
  ] : null;
4544
4544
  }
4545
4545
  ),
@@ -4656,7 +4656,7 @@ const _n = je(
4656
4656
  { didMount: x },
4657
4657
  { recalcInProgress: g }
4658
4658
  ]) => {
4659
- const v = V([]), m = V(0), b = Ee();
4659
+ const v = V([]), m = V(0), b = Re();
4660
4660
  ue(s.topItemsIndexes, v);
4661
4661
  const w = ct(
4662
4662
  B(
@@ -4673,15 +4673,15 @@ const _n = je(
4673
4673
  he(n),
4674
4674
  e
4675
4675
  ),
4676
- pe(([C, R, , I, , , , , , , A]) => {
4676
+ pe(([C, E, , I, , , , , , , A]) => {
4677
4677
  const k = A && A.length !== I;
4678
- return C && !R && !k;
4678
+ return C && !E && !k;
4679
4679
  }),
4680
4680
  re(
4681
4681
  ([
4682
4682
  ,
4683
4683
  ,
4684
- [C, R],
4684
+ [C, E],
4685
4685
  I,
4686
4686
  A,
4687
4687
  k,
@@ -4691,10 +4691,10 @@ const _n = je(
4691
4691
  N,
4692
4692
  $
4693
4693
  ]) => {
4694
- const L = A, { offsetTree: X, sizeTree: O } = L, _ = Xe(m);
4694
+ const L = A, { offsetTree: q, sizeTree: O } = L, _ = qe(m);
4695
4695
  if (I === 0)
4696
4696
  return { ...ks, totalCount: I };
4697
- if (C === 0 && R === 0)
4697
+ if (C === 0 && E === 0)
4698
4698
  return _ === 0 ? { ...ks, totalCount: I } : iu(_, k, A, G, N, $ || []);
4699
4699
  if (De(O))
4700
4700
  return _ > 0 ? null : ao(
@@ -4717,7 +4717,7 @@ const _n = je(
4717
4717
  }
4718
4718
  if (!M)
4719
4719
  return ao([], z, I, N, L, G);
4720
- const q = W.length > 0 ? W[W.length - 1] + 1 : 0, oe = wv(X, C, R, q);
4720
+ const X = W.length > 0 ? W[W.length - 1] + 1 : 0, oe = wv(q, C, E, X);
4721
4721
  if (oe.length === 0)
4722
4722
  return null;
4723
4723
  const F = I - 1, Q = Go([], (de) => {
@@ -4730,9 +4730,9 @@ const _n = je(
4730
4730
  const ie = Z - be.start;
4731
4731
  P += ie * ne + ie * N;
4732
4732
  }
4733
- Z < q && (P += (q - Z) * ne, Z = q);
4733
+ Z < X && (P += (X - Z) * ne, Z = X);
4734
4734
  const le = Math.min(be.end, F);
4735
- for (let ie = Z; ie <= le && !(P >= R); ie++)
4735
+ for (let ie = Z; ie <= le && !(P >= E); ie++)
4736
4736
  de.push({ data: $ == null ? void 0 : $[ie], index: ie, offset: P, size: ne }), P += ne + N;
4737
4737
  }
4738
4738
  });
@@ -4776,16 +4776,16 @@ const _n = je(
4776
4776
  w,
4777
4777
  pe(({ items: C }) => C.length > 0),
4778
4778
  Se(o, e),
4779
- pe(([{ items: C }, R]) => C[C.length - 1].originalIndex === R - 1),
4780
- re(([, C, R]) => [C - 1, R]),
4779
+ pe(([{ items: C }, E]) => C[C.length - 1].originalIndex === E - 1),
4780
+ re(([, C, E]) => [C - 1, E]),
4781
4781
  He(Cr),
4782
4782
  re(([C]) => C)
4783
4783
  )
4784
- ), E = St(
4784
+ ), R = St(
4785
4785
  B(
4786
4786
  w,
4787
4787
  nn(200),
4788
- pe(({ items: C, topItems: R }) => C.length > 0 && C[0].originalIndex === R.length),
4788
+ pe(({ items: C, topItems: E }) => C.length > 0 && C[0].originalIndex === E.length),
4789
4789
  re(({ items: C }) => C[0].index),
4790
4790
  He()
4791
4791
  )
@@ -4794,20 +4794,20 @@ const _n = je(
4794
4794
  w,
4795
4795
  pe(({ items: C }) => C.length > 0),
4796
4796
  re(({ items: C }) => {
4797
- let R = 0, I = C.length - 1;
4798
- for (; C[R].type === "group" && R < I; )
4799
- R++;
4800
- for (; C[I].type === "group" && I > R; )
4797
+ let E = 0, I = C.length - 1;
4798
+ for (; C[E].type === "group" && E < I; )
4799
+ E++;
4800
+ for (; C[I].type === "group" && I > E; )
4801
4801
  I--;
4802
4802
  return {
4803
4803
  endIndex: C[I].index,
4804
- startIndex: C[R].index
4804
+ startIndex: C[E].index
4805
4805
  };
4806
4806
  }),
4807
4807
  He(Qc)
4808
4808
  )
4809
4809
  );
4810
- return { endReached: y, initialItemCount: m, itemsRendered: b, listState: w, rangeChanged: S, startReached: E, topItemsIndexes: v, ...p };
4810
+ return { endReached: y, initialItemCount: m, itemsRendered: b, listState: w, rangeChanged: S, startReached: R, topItemsIndexes: v, ...p };
4811
4811
  },
4812
4812
  $e(
4813
4813
  Zt,
@@ -4822,7 +4822,7 @@ const _n = je(
4822
4822
  { singleton: !0 }
4823
4823
  ), au = je(
4824
4824
  ([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
4825
- const s = Ee(), i = ct(
4825
+ const s = Re(), i = ct(
4826
4826
  B(
4827
4827
  Ze(n, e, r, t, o),
4828
4828
  re(([a, c, u, d, h]) => a + c + u + d + h.offsetBottom + h.bottom)
@@ -4863,30 +4863,30 @@ const _n = je(
4863
4863
  { fixedFooterHeight: r, fixedHeaderHeight: o, headerHeight: s, scrollingInProgress: i, scrollTop: a, viewportHeight: c },
4864
4864
  { scrollToIndex: u }
4865
4865
  ]) => {
4866
- const d = Ee();
4866
+ const d = Re();
4867
4867
  return ue(
4868
4868
  B(
4869
4869
  d,
4870
4870
  Se(t, c, n, s, o, r, a),
4871
4871
  Se(e),
4872
4872
  re(([[h, p, x, g, v, m, b, w], y]) => {
4873
- const { align: E, behavior: S, calculateViewLocation: C = Ov, done: R, ...I } = h, A = nu(h, p, g - 1), k = Tr(A, p.offsetTree, y) + v + m, M = k + Bt(p.sizeTree, A)[1], W = w + m, G = w + x - b, N = C({
4873
+ const { align: R, behavior: S, calculateViewLocation: C = Ov, done: E, ...I } = h, A = nu(h, p, g - 1), k = Tr(A, p.offsetTree, y) + v + m, M = k + Bt(p.sizeTree, A)[1], W = w + m, G = w + x - b, N = C({
4874
4874
  itemBottom: M,
4875
4875
  itemTop: k,
4876
- locationParams: { align: E, behavior: S, ...I },
4876
+ locationParams: { align: R, behavior: S, ...I },
4877
4877
  viewportBottom: G,
4878
4878
  viewportTop: W
4879
4879
  });
4880
- return N ? R && Lt(
4880
+ return N ? E && Lt(
4881
4881
  B(
4882
4882
  i,
4883
4883
  pe(($) => !$),
4884
4884
  // skips the initial publish of false, and the cleanup call.
4885
4885
  // but if scrollingInProgress is true, we skip the initial publish.
4886
- In(Xe(i) ? 1 : 2)
4886
+ In(qe(i) ? 1 : 2)
4887
4887
  ),
4888
- R
4889
- ) : R && R(), N;
4888
+ E
4889
+ ) : E && E(), N;
4890
4890
  }),
4891
4891
  pe((h) => h !== null)
4892
4892
  ),
@@ -4913,7 +4913,7 @@ const Mv = (e, t) => typeof e == "function" ? Cl(e(t)) : t && Cl(e), Dv = je(
4913
4913
  { context: p },
4914
4914
  { scrollIntoView: x }
4915
4915
  ]) => {
4916
- const g = V(!1), v = Ee();
4916
+ const g = V(!1), v = Re();
4917
4917
  let m = null;
4918
4918
  function b(S) {
4919
4919
  ye(i, {
@@ -4926,23 +4926,23 @@ const Mv = (e, t) => typeof e == "function" ? Cl(e(t)) : t && Cl(e), Dv = je(
4926
4926
  B(
4927
4927
  Ze(B(he(t), In(1)), c),
4928
4928
  Se(he(g), s, a, h),
4929
- re(([[S, C], R, I, A, k]) => {
4929
+ re(([[S, C], E, I, A, k]) => {
4930
4930
  let M = C && A, W = "auto";
4931
- return M && (W = Mv(R, I || k), M = M && !!W), { followOutputBehavior: W, shouldFollow: M, totalCount: S };
4931
+ return M && (W = Mv(E, I || k), M = M && !!W), { followOutputBehavior: W, shouldFollow: M, totalCount: S };
4932
4932
  }),
4933
4933
  pe(({ shouldFollow: S }) => S)
4934
4934
  ),
4935
4935
  ({ followOutputBehavior: S, totalCount: C }) => {
4936
- m && (m(), m = null), Xe(n) ? requestAnimationFrame(() => {
4937
- Xe(d)("following output to ", { totalCount: C }, gt.DEBUG), b(S);
4936
+ m && (m(), m = null), qe(n) ? requestAnimationFrame(() => {
4937
+ qe(d)("following output to ", { totalCount: C }, gt.DEBUG), b(S);
4938
4938
  }) : m = Lt(e, () => {
4939
- Xe(d)("following output to ", { totalCount: C }, gt.DEBUG), b(S), m = null;
4939
+ qe(d)("following output to ", { totalCount: C }, gt.DEBUG), b(S), m = null;
4940
4940
  });
4941
4941
  }
4942
4942
  );
4943
4943
  function w(S) {
4944
- const C = Lt(o, (R) => {
4945
- S && !R.atBottom && R.notAtBottomBecause === "SIZE_INCREASED" && !m && (Xe(d)("scrolling to bottom due to increased size", {}, gt.DEBUG), b("auto"));
4944
+ const C = Lt(o, (E) => {
4945
+ S && !E.atBottom && E.notAtBottomBecause === "SIZE_INCREASED" && !m && (qe(d)("scrolling to bottom due to increased size", {}, gt.DEBUG), b("auto"));
4946
4946
  });
4947
4947
  setTimeout(C, 100);
4948
4948
  }
@@ -4958,14 +4958,14 @@ const Mv = (e, t) => typeof e == "function" ? Cl(e(t)) : t && Cl(e), Dv = je(
4958
4958
  Se(g, t)
4959
4959
  ),
4960
4960
  ([, S]) => {
4961
- Xe(a) && w(S !== !1);
4961
+ qe(a) && w(S !== !1);
4962
4962
  }
4963
4963
  ), Oe(v, () => {
4964
- w(Xe(g) !== !1);
4964
+ w(qe(g) !== !1);
4965
4965
  }), Oe(Ze(he(g), o), ([S, C]) => {
4966
4966
  S && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && b("auto");
4967
4967
  });
4968
- const y = V(null), E = Ee();
4968
+ const y = V(null), R = Re();
4969
4969
  return ue(
4970
4970
  si(
4971
4971
  B(
@@ -4977,20 +4977,20 @@ const Mv = (e, t) => typeof e == "function" ? Cl(e(t)) : t && Cl(e), Dv = je(
4977
4977
  ),
4978
4978
  B(he(t))
4979
4979
  ),
4980
- E
4980
+ R
4981
4981
  ), Oe(
4982
4982
  B(
4983
- Ze(B(E, In(1)), c),
4983
+ Ze(B(R, In(1)), c),
4984
4984
  Se(he(y), a, h, p),
4985
- re(([[S, C], R, I, A, k]) => C && I && (R == null ? void 0 : R({ context: k, totalCount: S, scrollingInProgress: A }))),
4985
+ re(([[S, C], E, I, A, k]) => C && I && (E == null ? void 0 : E({ context: k, totalCount: S, scrollingInProgress: A }))),
4986
4986
  pe((S) => !!S),
4987
4987
  nn(0)
4988
4988
  ),
4989
4989
  (S) => {
4990
- m && (m(), m = null), Xe(n) ? requestAnimationFrame(() => {
4991
- Xe(d)("scrolling into view", {}), ye(x, S);
4990
+ m && (m(), m = null), qe(n) ? requestAnimationFrame(() => {
4991
+ qe(d)("scrolling into view", {}), ye(x, S);
4992
4992
  }) : m = Lt(e, () => {
4993
- Xe(d)("scrolling into view", {}), ye(x, S), m = null;
4993
+ qe(d)("scrolling into view", {}), ye(x, S), m = null;
4994
4994
  });
4995
4995
  }
4996
4996
  ), { autoscrollToBottom: v, followOutput: g, scrollIntoViewOnChange: y };
@@ -5051,7 +5051,7 @@ const Mv = (e, t) => typeof e == "function" ? Cl(e(t)) : t && Cl(e), Dv = je(
5051
5051
  { singleton: !0 }
5052
5052
  ), uu = je(
5053
5053
  ([{ scrollVelocity: e }]) => {
5054
- const t = V(!1), n = Ee(), r = V(!1);
5054
+ const t = V(!1), n = Re(), r = V(!1);
5055
5055
  return ue(
5056
5056
  B(
5057
5057
  e,
@@ -5079,7 +5079,7 @@ const Mv = (e, t) => typeof e == "function" ? Cl(e(t)) : t && Cl(e), Dv = je(
5079
5079
  $e(Br),
5080
5080
  { singleton: !0 }
5081
5081
  ), Gi = je(([{ scrollContainerState: e, scrollTo: t }]) => {
5082
- const n = Ee(), r = Ee(), o = Ee(), s = V(!1), i = V(void 0);
5082
+ const n = Re(), r = Re(), o = Re(), s = V(!1), i = V(void 0);
5083
5083
  return ue(
5084
5084
  B(
5085
5085
  Ze(n, r),
@@ -5118,15 +5118,15 @@ const Mv = (e, t) => typeof e == "function" ? Cl(e(t)) : t && Cl(e), Dv = je(
5118
5118
  { didMount: s },
5119
5119
  { useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: c }
5120
5120
  ]) => {
5121
- const u = Ee(), d = V(void 0), h = V(null), p = V(null);
5121
+ const u = Re(), d = V(void 0), h = V(null), p = V(null);
5122
5122
  return ue(a, h), ue(c, p), Oe(
5123
5123
  B(
5124
5124
  u,
5125
5125
  Se(t, r, i, h, p, n)
5126
5126
  ),
5127
5127
  ([x, g, v, m, b, w, y]) => {
5128
- const E = Sv(g.sizeTree);
5129
- m && b !== null && w !== null && (v = b.scrollTop - w.offsetTop), v -= y, x({ ranges: E, scrollTop: v });
5128
+ const R = Sv(g.sizeTree);
5129
+ m && b !== null && w !== null && (v = b.scrollTop - w.offsetTop), v -= y, x({ ranges: R, scrollTop: v });
5130
5130
  }
5131
5131
  ), ue(B(d, pe(Fi), re(Hv)), o), ue(
5132
5132
  B(
@@ -5176,16 +5176,16 @@ const zv = du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5176
5176
  c,
5177
5177
  Se(i),
5178
5178
  Yt(
5179
- ([, b, w, y], [{ bottom: E, items: S, offsetBottom: C, totalCount: R }, I]) => {
5180
- const A = E + C;
5179
+ ([, b, w, y], [{ bottom: R, items: S, offsetBottom: C, totalCount: E }, I]) => {
5180
+ const A = R + C;
5181
5181
  let k = 0;
5182
- return w === R && b.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && b[0].originalIndex === 0 || (k = A - y, k !== 0 && (k += I))), [k, S, R, A];
5182
+ return w === E && b.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && b[0].originalIndex === 0 || (k = A - y, k !== 0 && (k += I))), [k, S, E, A];
5183
5183
  },
5184
5184
  [0, [], 0, 0]
5185
5185
  ),
5186
5186
  pe(([b]) => b !== 0),
5187
5187
  Se(r, a, n, o, x, g),
5188
- pe(([, b, w, y, , , E]) => !E && !y && b !== 0 && w === Rr),
5188
+ pe(([, b, w, y, , , R]) => !R && !y && b !== 0 && w === Er),
5189
5189
  re(([[b], , , , , w]) => (w("Upward scrolling compensation", { amount: b }, gt.DEBUG), b))
5190
5190
  )
5191
5191
  );
@@ -5212,22 +5212,22 @@ const zv = du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5212
5212
  B(
5213
5213
  u,
5214
5214
  Se(p, d),
5215
- re(([b, { groupIndices: w, lastSize: y, sizeTree: E }, S]) => {
5216
- function C(R) {
5217
- return R * (y + S);
5215
+ re(([b, { groupIndices: w, lastSize: y, sizeTree: R }, S]) => {
5216
+ function C(E) {
5217
+ return E * (y + S);
5218
5218
  }
5219
5219
  if (w.length === 0)
5220
5220
  return C(b);
5221
5221
  {
5222
- let R = 0;
5223
- const I = Sr(E, 0);
5222
+ let E = 0;
5223
+ const I = Sr(R, 0);
5224
5224
  let A = 0, k = 0;
5225
5225
  for (; A < b; ) {
5226
- A++, R += I;
5226
+ A++, E += I;
5227
5227
  let M = w.length === k + 1 ? 1 / 0 : w[k + 1] - w[k] - 1;
5228
- A + M > b && (R -= I, M = b - A + 1), A += M, R += C(M), k++;
5228
+ A + M > b && (E -= I, M = b - A + 1), A += M, E += C(M), k++;
5229
5229
  }
5230
- return R;
5230
+ return E;
5231
5231
  }
5232
5232
  })
5233
5233
  ),
@@ -5300,13 +5300,13 @@ const zv = du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5300
5300
  v,
5301
5301
  m,
5302
5302
  b,
5303
- { listState: w, topItemsIndexes: y, ...E },
5303
+ { listState: w, topItemsIndexes: y, ...R },
5304
5304
  { scrollToIndex: S },
5305
5305
  C,
5306
- { topItemCount: R },
5306
+ { topItemCount: E },
5307
5307
  { groupCounts: I },
5308
5308
  A
5309
- ]) => (ue(E.rangeChanged, A.scrollSeekRangeChanged), ue(
5309
+ ]) => (ue(R.rangeChanged, A.scrollSeekRangeChanged), ue(
5310
5310
  B(
5311
5311
  A.windowViewportRect,
5312
5312
  re((k) => k.visibleHeight)
@@ -5323,7 +5323,7 @@ const zv = du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5323
5323
  initialTopMostItemIndex: x,
5324
5324
  scrolledToInitialItem: g,
5325
5325
  sizeRanges: a,
5326
- topItemCount: R,
5326
+ topItemCount: E,
5327
5327
  topItemsIndexes: y,
5328
5328
  // input
5329
5329
  totalCount: d,
@@ -5336,7 +5336,7 @@ const zv = du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5336
5336
  statefulTotalCount: u,
5337
5337
  trackItemSizes: h,
5338
5338
  // exported from stateFlagsSystem
5339
- ...E,
5339
+ ...R,
5340
5340
  // the bag of IO from featureGroup1System
5341
5341
  ...A,
5342
5342
  ...v,
@@ -5385,28 +5385,28 @@ function hu(e, t, n) {
5385
5385
  }
5386
5386
  function u(m) {
5387
5387
  return s.reduce((b, w) => (b[w] = (y) => {
5388
- const E = m[t.methods[w]];
5389
- ye(E, y);
5388
+ const R = m[t.methods[w]];
5389
+ ye(R, y);
5390
5390
  }, b), {});
5391
5391
  }
5392
5392
  function d(m) {
5393
5393
  return i.reduce((b, w) => (b[w] = av(m[t.events[w]]), b), {});
5394
5394
  }
5395
5395
  const h = K.forwardRef((m, b) => {
5396
- const { children: w, ...y } = m, [E] = K.useState(() => Go(cv(e), (R) => {
5397
- c(R, y);
5398
- })), [S] = K.useState(pl(d, E));
5396
+ const { children: w, ...y } = m, [R] = K.useState(() => Go(cv(e), (E) => {
5397
+ c(E, y);
5398
+ })), [S] = K.useState(pl(d, R));
5399
5399
  Gr(() => {
5400
- for (const R of i)
5401
- R in y && Oe(S[R], y[R]);
5400
+ for (const E of i)
5401
+ E in y && Oe(S[E], y[E]);
5402
5402
  return () => {
5403
5403
  Object.values(S).map(Bi);
5404
5404
  };
5405
- }, [y, S, E]), Gr(() => {
5406
- c(E, y);
5407
- }), K.useImperativeHandle(b, hl(u(E)));
5405
+ }, [y, S, R]), Gr(() => {
5406
+ c(R, y);
5407
+ }), K.useImperativeHandle(b, hl(u(R)));
5408
5408
  const C = n;
5409
- return /* @__PURE__ */ l.jsx(a.Provider, { value: E, children: n ? /* @__PURE__ */ l.jsx(C, { ...Vv([...r, ...o, ...i], y), children: w }) : w });
5409
+ return /* @__PURE__ */ l.jsx(a.Provider, { value: R, children: n ? /* @__PURE__ */ l.jsx(C, { ...Vv([...r, ...o, ...i], y), children: w }) : w });
5410
5410
  }), p = (m) => {
5411
5411
  const b = K.useContext(a);
5412
5412
  return K.useCallback(
@@ -5422,14 +5422,14 @@ function hu(e, t, n) {
5422
5422
  );
5423
5423
  return K.useSyncExternalStore(
5424
5424
  w,
5425
- () => Xe(b),
5426
- () => Xe(b)
5425
+ () => qe(b),
5426
+ () => qe(b)
5427
5427
  );
5428
5428
  }, g = (m) => {
5429
- const b = K.useContext(a)[m], [w, y] = K.useState(pl(Xe, b));
5429
+ const b = K.useContext(a)[m], [w, y] = K.useState(pl(qe, b));
5430
5430
  return Gr(
5431
- () => Oe(b, (E) => {
5432
- E !== w && y(hl(E));
5431
+ () => Oe(b, (R) => {
5432
+ R !== w && y(hl(R));
5433
5433
  }),
5434
5434
  [b, w]
5435
5435
  ), w;
@@ -5540,7 +5540,7 @@ const Kv = /* @__PURE__ */ je(() => {
5540
5540
  }), Yv = /* @__PURE__ */ je(
5541
5541
  ([e, t]) => ({ ...e, ...t }),
5542
5542
  $e(fu, Kv)
5543
- ), Xv = ({ height: e }) => /* @__PURE__ */ l.jsx("div", { style: { height: e } }), qv = { overflowAnchor: "none", position: Ki(), zIndex: 1 }, xu = { overflowAnchor: "none" }, Jv = { ...xu, display: "inline-block", height: "100%" }, Rl = /* @__PURE__ */ K.memo(function({ showTopList: e = !1 }) {
5543
+ ), qv = ({ height: e }) => /* @__PURE__ */ l.jsx("div", { style: { height: e } }), Xv = { overflowAnchor: "none", position: Ki(), zIndex: 1 }, xu = { overflowAnchor: "none" }, Jv = { ...xu, display: "inline-block", height: "100%" }, El = /* @__PURE__ */ K.memo(function({ showTopList: e = !1 }) {
5544
5544
  const t = xe("listState"), n = It("sizeRanges"), r = xe("useWindowScroll"), o = xe("customScrollParent"), s = It("windowScrollContainerState"), i = It("scrollContainerState"), a = o || r ? s : i, c = xe("itemContent"), u = xe("context"), d = xe("groupContent"), h = xe("trackItemSizes"), p = xe("itemSize"), x = xe("log"), g = It("gap"), v = xe("horizontalDirection"), { callbackRef: m } = fv(
5545
5545
  n,
5546
5546
  p,
@@ -5552,10 +5552,10 @@ const Kv = /* @__PURE__ */ je(() => {
5552
5552
  v,
5553
5553
  xe("skipAnimationFrameInResizeObserver")
5554
5554
  ), [b, w] = K.useState(0);
5555
- Xi("deviation", (N) => {
5555
+ qi("deviation", (N) => {
5556
5556
  b !== N && w(N);
5557
5557
  });
5558
- const y = xe("EmptyPlaceholder"), E = xe("ScrollSeekPlaceholder") || Xv, S = xe("ListComponent"), C = xe("ItemComponent"), R = xe("GroupComponent"), I = xe("computeItemKey"), A = xe("isSeeking"), k = xe("groupIndices").length > 0, M = xe("alignToBottom"), W = xe("initialItemFinalLocationReached"), G = e ? {} : {
5558
+ const y = xe("EmptyPlaceholder"), R = xe("ScrollSeekPlaceholder") || qv, S = xe("ListComponent"), C = xe("ItemComponent"), E = xe("GroupComponent"), I = xe("computeItemKey"), A = xe("isSeeking"), k = xe("groupIndices").length > 0, M = xe("alignToBottom"), W = xe("initialItemFinalLocationReached"), G = e ? {} : {
5559
5559
  boxSizing: "border-box",
5560
5560
  ...v ? {
5561
5561
  display: "inline-block",
@@ -5581,9 +5581,9 @@ const Kv = /* @__PURE__ */ je(() => {
5581
5581
  children: (e ? t.topItems : t.items).map((N) => {
5582
5582
  const $ = N.originalIndex, L = I($ + t.firstItemIndex, N.data, u);
5583
5583
  return A ? /* @__PURE__ */ to(
5584
- E,
5584
+ R,
5585
5585
  {
5586
- ...lt(E, u),
5586
+ ...lt(R, u),
5587
5587
  height: N.size,
5588
5588
  index: N.index,
5589
5589
  key: L,
@@ -5591,14 +5591,14 @@ const Kv = /* @__PURE__ */ je(() => {
5591
5591
  ...N.type === "group" ? {} : { groupIndex: N.groupIndex }
5592
5592
  }
5593
5593
  ) : N.type === "group" ? /* @__PURE__ */ to(
5594
- R,
5594
+ E,
5595
5595
  {
5596
- ...lt(R, u),
5596
+ ...lt(E, u),
5597
5597
  "data-index": $,
5598
5598
  "data-item-index": N.index,
5599
5599
  "data-known-size": N.size,
5600
5600
  key: L,
5601
- style: qv
5601
+ style: Xv
5602
5602
  },
5603
5603
  d(N.index, u)
5604
5604
  ) : /* @__PURE__ */ to(
@@ -5628,7 +5628,7 @@ const Kv = /* @__PURE__ */ je(() => {
5628
5628
  outline: "none",
5629
5629
  overflowX: "auto",
5630
5630
  position: "relative"
5631
- }, Xo = (e) => ({
5631
+ }, qo = (e) => ({
5632
5632
  height: "100%",
5633
5633
  position: "absolute",
5634
5634
  top: 0,
@@ -5731,7 +5731,7 @@ const ox = ({ children: e }) => {
5731
5731
  ), a = Pn(i, !0, xe("skipAnimationFrameInResizeObserver"));
5732
5732
  return K.useEffect(() => {
5733
5733
  t && (n(t.viewportHeight), r(t.itemHeight));
5734
- }, [t, n, r]), /* @__PURE__ */ l.jsx("div", { "data-viewport-type": "element", ref: a, style: Xo(o), children: e });
5734
+ }, [t, n, r]), /* @__PURE__ */ l.jsx("div", { "data-viewport-type": "element", ref: a, style: qo(o), children: e });
5735
5735
  }, sx = ({ children: e }) => {
5736
5736
  const t = K.useContext(pu), n = It("windowViewportRect"), r = It("fixedItemHeight"), o = xe("customScrollParent"), s = Kc(
5737
5737
  n,
@@ -5740,23 +5740,23 @@ const ox = ({ children: e }) => {
5740
5740
  ), i = xe("alignToBottom");
5741
5741
  return K.useEffect(() => {
5742
5742
  t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
5743
- }, [t, n, r]), /* @__PURE__ */ l.jsx("div", { "data-viewport-type": "window", ref: s, style: Xo(i), children: e });
5743
+ }, [t, n, r]), /* @__PURE__ */ l.jsx("div", { "data-viewport-type": "window", ref: s, style: qo(i), children: e });
5744
5744
  }, ix = ({ children: e }) => {
5745
5745
  const t = xe("TopItemListComponent") || "div", n = xe("headerHeight"), r = { ...ex, marginTop: `${n}px` }, o = xe("context");
5746
5746
  return /* @__PURE__ */ l.jsx(t, { style: r, ...lt(t, o), children: e });
5747
5747
  }, ax = /* @__PURE__ */ K.memo(function(e) {
5748
5748
  const t = xe("useWindowScroll"), n = xe("topItemsIndexes").length > 0, r = xe("customScrollParent"), o = xe("context");
5749
5749
  return /* @__PURE__ */ l.jsxs(r || t ? ux : cx, { ...e, context: o, children: [
5750
- n && /* @__PURE__ */ l.jsx(ix, { children: /* @__PURE__ */ l.jsx(Rl, { showTopList: !0 }) }),
5750
+ n && /* @__PURE__ */ l.jsx(ix, { children: /* @__PURE__ */ l.jsx(El, { showTopList: !0 }) }),
5751
5751
  /* @__PURE__ */ l.jsxs(r || t ? sx : ox, { children: [
5752
5752
  /* @__PURE__ */ l.jsx(nx, {}),
5753
- /* @__PURE__ */ l.jsx(Rl, {}),
5753
+ /* @__PURE__ */ l.jsx(El, {}),
5754
5754
  /* @__PURE__ */ l.jsx(rx, {})
5755
5755
  ] })
5756
5756
  ] });
5757
5757
  }), {
5758
5758
  Component: lx,
5759
- useEmitter: Xi,
5759
+ useEmitter: qi,
5760
5760
  useEmitterValue: xe,
5761
5761
  usePublisher: It
5762
5762
  } = /* @__PURE__ */ hu(
@@ -5818,7 +5818,7 @@ const ox = ({ children: e }) => {
5818
5818
  }
5819
5819
  },
5820
5820
  ax
5821
- ), cx = /* @__PURE__ */ bu({ useEmitter: Xi, useEmitterValue: xe, usePublisher: It }), ux = /* @__PURE__ */ wu({ useEmitter: Xi, useEmitterValue: xe, usePublisher: It }), dx = lx, fx = /* @__PURE__ */ je(() => {
5821
+ ), cx = /* @__PURE__ */ bu({ useEmitter: qi, useEmitterValue: xe, usePublisher: It }), ux = /* @__PURE__ */ wu({ useEmitter: qi, useEmitterValue: xe, usePublisher: It }), dx = lx, fx = /* @__PURE__ */ je(() => {
5822
5822
  const e = V((u) => /* @__PURE__ */ l.jsxs("td", { children: [
5823
5823
  "Item $",
5824
5824
  u
@@ -5856,7 +5856,7 @@ const ox = ({ children: e }) => {
5856
5856
  });
5857
5857
  $e(fu, fx);
5858
5858
  Ki();
5859
- const El = {
5859
+ const Rl = {
5860
5860
  bottom: 0,
5861
5861
  itemHeight: 0,
5862
5862
  items: [],
@@ -5895,10 +5895,10 @@ const gx = /* @__PURE__ */ je(
5895
5895
  p,
5896
5896
  x,
5897
5897
  { didMount: g, propsReady: v },
5898
- { customScrollParent: m, useWindowScroll: b, windowScrollContainerState: w, windowScrollTo: y, windowViewportRect: E },
5898
+ { customScrollParent: m, useWindowScroll: b, windowScrollContainerState: w, windowScrollTo: y, windowViewportRect: R },
5899
5899
  S
5900
5900
  ]) => {
5901
- const C = V(0), R = V(0), I = V(El), A = V({ height: 0, width: 0 }), k = V({ height: 0, width: 0 }), M = Ee(), W = Ee(), G = V(0), N = V(null), $ = V({ column: 0, row: 0 }), L = Ee(), X = Ee(), O = V(!1), _ = V(0), z = V(!0), q = V(!1), oe = V(!1);
5901
+ const C = V(0), E = V(0), I = V(Rl), A = V({ height: 0, width: 0 }), k = V({ height: 0, width: 0 }), M = Re(), W = Re(), G = V(0), N = V(null), $ = V({ column: 0, row: 0 }), L = Re(), q = Re(), O = V(!1), _ = V(0), z = V(!0), X = V(!1), oe = V(!1);
5902
5902
  Oe(
5903
5903
  B(
5904
5904
  g,
@@ -5910,11 +5910,11 @@ const gx = /* @__PURE__ */ je(
5910
5910
  }
5911
5911
  ), Oe(
5912
5912
  B(
5913
- Ze(g, z, k, A, _, q),
5913
+ Ze(g, z, k, A, _, X),
5914
5914
  pe(([P, Z, ne, le, , ie]) => P && !Z && ne.height !== 0 && le.height !== 0 && !ie)
5915
5915
  ),
5916
5916
  ([, , , , P]) => {
5917
- ye(q, !0), Ui(1, () => {
5917
+ ye(X, !0), Ui(1, () => {
5918
5918
  ye(M, P);
5919
5919
  }), Lt(B(u), () => {
5920
5920
  ye(t, [0, 0]), ye(z, !0);
@@ -5922,15 +5922,15 @@ const gx = /* @__PURE__ */ je(
5922
5922
  }
5923
5923
  ), ue(
5924
5924
  B(
5925
- X,
5925
+ q,
5926
5926
  pe((P) => P != null && P.scrollTop > 0),
5927
5927
  Gt(0)
5928
5928
  ),
5929
- R
5929
+ E
5930
5930
  ), Oe(
5931
5931
  B(
5932
5932
  g,
5933
- Se(X),
5933
+ Se(q),
5934
5934
  pe(([, P]) => P != null)
5935
5935
  ),
5936
5936
  ([, P]) => {
@@ -5969,7 +5969,7 @@ const gx = /* @__PURE__ */ je(
5969
5969
  he(k, Kr),
5970
5970
  he(A, Kr),
5971
5971
  he(N),
5972
- he(R),
5972
+ he(E),
5973
5973
  he(O),
5974
5974
  he(z),
5975
5975
  he(_)
@@ -5990,7 +5990,7 @@ const gx = /* @__PURE__ */ je(
5990
5990
  ]) => {
5991
5991
  const { column: ve, row: H } = le, { height: ae, width: Be } = ie, { width: nt } = Pe;
5992
5992
  if (Le === 0 && (P === 0 || nt === 0))
5993
- return El;
5993
+ return Rl;
5994
5994
  if (Be === 0) {
5995
5995
  const Pt = Wi(Ae, P), xn = Pt + Math.max(Le - 1, 0);
5996
5996
  return px(jl(Pt, xn, Fe));
@@ -6087,7 +6087,7 @@ const gx = /* @__PURE__ */ je(
6087
6087
  );
6088
6088
  return ue(
6089
6089
  B(
6090
- E,
6090
+ R,
6091
6091
  re((P) => ({ height: P.visibleHeight, width: P.visibleWidth }))
6092
6092
  ),
6093
6093
  A
@@ -6100,10 +6100,10 @@ const gx = /* @__PURE__ */ je(
6100
6100
  gap: $,
6101
6101
  headerHeight: s,
6102
6102
  increaseViewportBy: e,
6103
- initialItemCount: R,
6103
+ initialItemCount: E,
6104
6104
  itemDimensions: k,
6105
6105
  overscan: n,
6106
- restoreStateFrom: X,
6106
+ restoreStateFrom: q,
6107
6107
  scrollBy: i,
6108
6108
  scrollContainerState: a,
6109
6109
  scrollHeight: W,
@@ -6116,7 +6116,7 @@ const gx = /* @__PURE__ */ je(
6116
6116
  viewportDimensions: A,
6117
6117
  windowScrollContainerState: w,
6118
6118
  windowScrollTo: y,
6119
- windowViewportRect: E,
6119
+ windowViewportRect: R,
6120
6120
  ...x,
6121
6121
  // output
6122
6122
  gridState: I,
@@ -6187,8 +6187,8 @@ const vx = /* @__PURE__ */ je(() => {
6187
6187
  i(w);
6188
6188
  const y = b.firstChild;
6189
6189
  if (y) {
6190
- const { height: E, width: S } = y.getBoundingClientRect();
6191
- h({ height: E, width: S });
6190
+ const { height: R, width: S } = y.getBoundingClientRect();
6191
+ h({ height: R, width: S });
6192
6192
  }
6193
6193
  p({
6194
6194
  column: kl("column-gap", getComputedStyle(b).columnGap, x),
@@ -6271,14 +6271,14 @@ const vx = /* @__PURE__ */ je(() => {
6271
6271
  );
6272
6272
  return K.useEffect(() => {
6273
6273
  t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
6274
- }, [t, r, n]), /* @__PURE__ */ l.jsx("div", { ref: o, style: Xo(!1), children: e });
6274
+ }, [t, r, n]), /* @__PURE__ */ l.jsx("div", { ref: o, style: qo(!1), children: e });
6275
6275
  }, Cx = ({ children: e }) => {
6276
6276
  const t = K.useContext(mu), n = Nt("windowViewportRect"), r = Nt("itemDimensions"), o = ze("customScrollParent"), s = Kc(n, o, !1);
6277
6277
  return K.useEffect(() => {
6278
6278
  t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
6279
- }, [t, n, r]), /* @__PURE__ */ l.jsx("div", { ref: s, style: Xo(!1), children: e });
6279
+ }, [t, n, r]), /* @__PURE__ */ l.jsx("div", { ref: s, style: qo(!1), children: e });
6280
6280
  }, Tx = /* @__PURE__ */ K.memo(function({ ...e }) {
6281
- const t = ze("useWindowScroll"), n = ze("customScrollParent"), r = n || t ? Ex : Rx, o = n || t ? Cx : Sx, s = ze("context");
6281
+ const t = ze("useWindowScroll"), n = ze("customScrollParent"), r = n || t ? Rx : Ex, o = n || t ? Cx : Sx, s = ze("context");
6282
6282
  return /* @__PURE__ */ l.jsx(r, { ...e, ...lt(r, s), children: /* @__PURE__ */ l.jsxs(o, { children: [
6283
6283
  /* @__PURE__ */ l.jsx(wx, {}),
6284
6284
  /* @__PURE__ */ l.jsx(bx, {}),
@@ -6329,7 +6329,7 @@ const vx = /* @__PURE__ */ je(() => {
6329
6329
  }
6330
6330
  },
6331
6331
  Tx
6332
- ), Rx = /* @__PURE__ */ bu({ useEmitter: Su, useEmitterValue: ze, usePublisher: Nt }), Ex = /* @__PURE__ */ wu({ useEmitter: Su, useEmitterValue: ze, usePublisher: Nt });
6332
+ ), Ex = /* @__PURE__ */ bu({ useEmitter: Su, useEmitterValue: ze, usePublisher: Nt }), Rx = /* @__PURE__ */ wu({ useEmitter: Su, useEmitterValue: ze, usePublisher: Nt });
6333
6333
  function kl(e, t, n) {
6334
6334
  return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, gt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
6335
6335
  }
@@ -6431,12 +6431,12 @@ function Nx({
6431
6431
  [p, i, h]
6432
6432
  ), y = K.useCallback((I) => {
6433
6433
  x(I.target.value), m.current && (m.current.style.height = "auto", m.current.style.height = `${m.current.scrollHeight}px`);
6434
- }, []), E = K.useCallback(
6434
+ }, []), R = K.useCallback(
6435
6435
  (I) => {
6436
6436
  I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), w()) : I.key === "Escape" && t && (I.preventDefault(), a == null || a());
6437
6437
  },
6438
6438
  [w, t, a]
6439
- ), R = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
6439
+ ), E = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
6440
6440
  return /* @__PURE__ */ l.jsx("form", { onSubmit: (I) => void w(I), className: `w-full ${u}`, children: /* @__PURE__ */ l.jsxs("div", { className: "flex items-end gap-2", children: [
6441
6441
  /* @__PURE__ */ l.jsx("div", { className: "flex-1", children: /* @__PURE__ */ l.jsx(
6442
6442
  Cu,
@@ -6444,9 +6444,9 @@ function Nx({
6444
6444
  ref: m,
6445
6445
  value: p,
6446
6446
  onChange: y,
6447
- onKeyDown: E,
6447
+ onKeyDown: R,
6448
6448
  placeholder: t ? "Edit your message..." : n,
6449
- className: R,
6449
+ className: E,
6450
6450
  disabled: o,
6451
6451
  maxLength: s,
6452
6452
  rows: 1,
@@ -6625,7 +6625,7 @@ function Pl(e, t) {
6625
6625
  return e(t);
6626
6626
  e != null && (e.current = t);
6627
6627
  }
6628
- function qi(...e) {
6628
+ function Xi(...e) {
6629
6629
  return (t) => {
6630
6630
  let n = !1;
6631
6631
  const r = e.map((o) => {
@@ -6642,7 +6642,7 @@ function qi(...e) {
6642
6642
  };
6643
6643
  }
6644
6644
  function Te(...e) {
6645
- return f.useCallback(qi(...e), e);
6645
+ return f.useCallback(Xi(...e), e);
6646
6646
  }
6647
6647
  var Dx = [
6648
6648
  "a",
@@ -6663,13 +6663,13 @@ var Dx = [
6663
6663
  "svg",
6664
6664
  "ul"
6665
6665
  ], me = Dx.reduce((e, t) => {
6666
- const n = Xn(`Primitive.${t}`), r = f.forwardRef((o, s) => {
6666
+ const n = qn(`Primitive.${t}`), r = f.forwardRef((o, s) => {
6667
6667
  const { asChild: i, ...a } = o, c = i ? n : t;
6668
6668
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l.jsx(c, { ...a, ref: s });
6669
6669
  });
6670
6670
  return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
6671
6671
  }, {});
6672
- function Ru(e, t) {
6672
+ function Eu(e, t) {
6673
6673
  e && Bo.flushSync(() => e.dispatchEvent(t));
6674
6674
  }
6675
6675
  function Lx(e, t) {
@@ -6745,7 +6745,7 @@ function Ft(e) {
6745
6745
  n((r) => r ?? String($x++));
6746
6746
  }, [e]), e || (t ? `radix-${t}` : "");
6747
6747
  }
6748
- var qo = "Collapsible", [zx, JT] = Ut(qo), [Ux, Ji] = zx(qo), Eu = f.forwardRef(
6748
+ var Xo = "Collapsible", [zx, JT] = Ut(Xo), [Ux, Ji] = zx(Xo), Ru = f.forwardRef(
6749
6749
  (e, t) => {
6750
6750
  const {
6751
6751
  __scopeCollapsible: n,
@@ -6758,7 +6758,7 @@ var qo = "Collapsible", [zx, JT] = Ut(qo), [Ux, Ji] = zx(qo), Eu = f.forwardRef(
6758
6758
  prop: r,
6759
6759
  defaultProp: o ?? !1,
6760
6760
  onChange: i,
6761
- caller: qo
6761
+ caller: Xo
6762
6762
  });
6763
6763
  return /* @__PURE__ */ l.jsx(
6764
6764
  Ux,
@@ -6781,7 +6781,7 @@ var qo = "Collapsible", [zx, JT] = Ut(qo), [Ux, Ji] = zx(qo), Eu = f.forwardRef(
6781
6781
  );
6782
6782
  }
6783
6783
  );
6784
- Eu.displayName = qo;
6784
+ Ru.displayName = Xo;
6785
6785
  var Iu = "CollapsibleTrigger", Nu = f.forwardRef(
6786
6786
  (e, t) => {
6787
6787
  const { __scopeCollapsible: n, ...r } = e, o = Ji(Iu, n);
@@ -6845,8 +6845,8 @@ var Vx = f.forwardRef((e, t) => {
6845
6845
  function Qi(e) {
6846
6846
  return e ? "open" : "closed";
6847
6847
  }
6848
- var Gx = Eu;
6849
- const _l = Gx, Ol = Nu, ju = new URL("data:video/mp2t;base64,Ly8gQHRzLWlnbm9yZSAtIG1hcmtlZCB3aWxsIGJlIGF2YWlsYWJsZSBnbG9iYWxseSBpbiB0aGUgd29ya2VyIGNvbnRleHQKLyoqIEB0eXBlIHtmdW5jdGlvbihzdHJpbmcpOiBzdHJpbmd9ICovCnZhciBwYXJzZTsKdmFyIHNjb3BlID0gc2VsZjsKCmNvbnNvbGUubG9nKCdbTWFya2Rvd25Xb3JrZXJdIHdvcmtlciBzY3JpcHQgbG9hZGVkJyk7Ci8vIFNpZ25hbCB0byB0aGUgbWFpbiB0aHJlYWQgdGhhdCB0aGUgd29ya2VyIGlzIHJlYWR5IHRvIHJlY2VpdmUgd29yay4KLy8gVGhpcyBoZWxwcyBjYWxsZXJzIGF2b2lkIHBvc3RpbmcgbWVzc2FnZXMgYmVmb3JlIHRoZSB3b3JrZXIgaGFzIGZpbmlzaGVkIGluaXRpYWxpemluZy4KaWYgKHNjb3BlLnBvc3RNZXNzYWdlKSB7CiAgc2NvcGUucG9zdE1lc3NhZ2UoeyAnd29ya2VyX3JlYWR5JzogdHJ1ZSB9KTsKfQoKc2NvcGUuYWRkRXZlbnRMaXN0ZW5lcignbWVzc2FnZScsIGZ1bmN0aW9uKGV2ZW50KSB7CiAgdmFyIHBheWxvYWQgPSBldmVudCAmJiBldmVudC5kYXRhID8gZXZlbnQuZGF0YSA6IHt9OwogIHZhciBpZCA9IHR5cGVvZiBwYXlsb2FkLmlkID09PSAnc3RyaW5nJyA/IHBheWxvYWQuaWQgOiB1bmRlZmluZWQ7CiAgdmFyIHNvdXJjZSA9IHR5cGVvZiBwYXlsb2FkLnNvdXJjZSA9PT0gJ3N0cmluZycgPyBwYXlsb2FkLnNvdXJjZSA6IHVuZGVmaW5lZDsKICBpZiAoIWlkIHx8IHR5cGVvZiBzb3VyY2UgIT09ICdzdHJpbmcnKSB7CiAgICByZXR1cm47CiAgfQogIHRyeSB7CiAgICBjb25zb2xlLmxvZygnW01hcmtkb3duV29ya2VyXSByZWNlaXZlZCB3b3JrJywgaWQsICdzb3VyY2VMZW4nLCBzb3VyY2UgJiYgc291cmNlLmxlbmd0aCA/IHNvdXJjZS5sZW5ndGggOiAwKTsKICAgIHZhciBodG1sID0gcGFyc2Uoc291cmNlKTsKICAgIGNvbnNvbGUubG9nKCdbTWFya2Rvd25Xb3JrZXJdIHBhcnNlZCBodG1sIGxlbmd0aCcsIGh0bWwgJiYgaHRtbC5sZW5ndGggPyBodG1sLmxlbmd0aCA6IDAsICdmb3InLCBpZCk7CiAgICAvLyBSZXR1cm4gdGhlIGdlbmVyYXRlZCBIVE1MIGZvciB0aGUgY2FsbGVyIHRvIGNhY2hlIGFuZCByZW5kZXIKICAgIC8vIEtlZXAgdGhlIHBheWxvYWQgc21hbGw6IHNlbmQgaWQgKyBodG1sCiAgICAvLyBNYXJrZWQgb3V0cHV0IHNob3VsZCBiZSBzYWZlLWVub3VnaCBmb3IgaW50ZXJuYWwgVUlzOyBjYWxsZXJzIG1heSBmdXJ0aGVyIHNhbml0aXplIGlmIHJlcXVpcmVkLgogICAgc2NvcGUucG9zdE1lc3NhZ2UoeyBpZDogaWQsIGh0bWw6IGh0bWwgfSk7CiAgfSBjYXRjaCAoZXJyKSB7CiAgICBjb25zb2xlLmVycm9yKCdbTWFya2Rvd25Xb3JrZXJdIHJlbmRlciBlcnJvcicsIGVycik7CiAgICBzY29wZS5wb3N0TWVzc2FnZSh7IGlkOiBpZCwgaHRtbDogJzxwcmU+RXJyb3IgcmVuZGVyaW5nIG1hcmtkb3duOiAnICsgU3RyaW5nKGVycikgKyAnPC9wcmU+JyB9KTsKICB9Cn0pOwo=", import.meta.url), lo = ju.toString();
6848
+ var Gx = Ru;
6849
+ const _l = Gx, Ol = Nu, ju = new URL("data:video/mp2t;base64,Ly8vIDxyZWZlcmVuY2UgbGliPSJ3ZWJ3b3JrZXIiIC8+CmltcG9ydCBtYXJrZWQgZnJvbSAnbWFya2VkJzsgICAvLyDinIUgZGVmYXVsdCBpbXBvcnQKCmNvbnN0IHNjb3BlOiBEZWRpY2F0ZWRXb3JrZXJHbG9iYWxTY29wZSA9IHNlbGYgYXMgYW55OwoKc2NvcGUucG9zdE1lc3NhZ2U/Lih7IHdvcmtlcl9yZWFkeTogdHJ1ZSB9KTsKCnNjb3BlLmFkZEV2ZW50TGlzdGVuZXIoJ21lc3NhZ2UnLCAoZXZlbnQ6IE1lc3NhZ2VFdmVudCkgPT4gewogIGNvbnN0IHBheWxvYWQ6IGFueSA9IGV2ZW50Py5kYXRhID8/IHt9OwogIGNvbnN0IGlkID0gdHlwZW9mIHBheWxvYWQuaWQgPT09ICdzdHJpbmcnID8gcGF5bG9hZC5pZCA6IHVuZGVmaW5lZDsKICBjb25zdCBzb3VyY2UgPSB0eXBlb2YgcGF5bG9hZC5zb3VyY2UgPT09ICdzdHJpbmcnID8gcGF5bG9hZC5zb3VyY2UgOiB1bmRlZmluZWQ7CiAgaWYgKCFpZCB8fCB0eXBlb2Ygc291cmNlICE9PSAnc3RyaW5nJykgcmV0dXJuOwoKICB0cnkgewogICAgY29uc3QgaHRtbCA9IG1hcmtlZC5wYXJzZShzb3VyY2UpOwogICAgc2NvcGUucG9zdE1lc3NhZ2UoeyBpZCwgaHRtbCB9KTsKICB9IGNhdGNoIChlcnIpIHsKICAgIHNjb3BlLnBvc3RNZXNzYWdlKHsgaWQsIGh0bWw6IGA8cHJlPkVycm9yIHJlbmRlcmluZyBtYXJrZG93bjogJHtTdHJpbmcoZXJyKX08L3ByZT5gIH0pOwogIH0KfSk7Cg==", import.meta.url), lo = ju.toString();
6850
6850
  console.log("[MarkdownContent] worker url", lo);
6851
6851
  const di = [];
6852
6852
  let fi = !1;
@@ -6950,12 +6950,12 @@ async function Yx(e) {
6950
6950
  }
6951
6951
  })();
6952
6952
  const hr = /* @__PURE__ */ new Map();
6953
- function Xx(e) {
6953
+ function qx(e) {
6954
6954
  const t = e.slice(0, 64), n = e.length > 64 ? e.slice(-64) : "";
6955
6955
  return `${e.length}:${t}:${n}`;
6956
6956
  }
6957
- function Xr({ content: e, className: t = "", fallback: n = /* @__PURE__ */ l.jsx("div", { "aria-busy": !0, children: "Rendering…" }) }) {
6958
- const r = Xx(e), [o, s] = fe(() => hr.get(r) ?? null);
6957
+ function qr({ content: e, className: t = "", fallback: n = /* @__PURE__ */ l.jsx("div", { "aria-busy": !0, children: "Rendering…" }) }) {
6958
+ const r = qx(e), [o, s] = fe(() => hr.get(r) ?? null);
6959
6959
  Ve(() => {
6960
6960
  if (hr.has(r)) {
6961
6961
  const g = hr.get(r) ?? null;
@@ -7048,7 +7048,7 @@ async function ku(e, t) {
7048
7048
  async function Dl(e, t) {
7049
7049
  return await (await ku(`/chat/files/${e}/view`, t)).text();
7050
7050
  }
7051
- async function qx(e, t) {
7051
+ async function Xx(e, t) {
7052
7052
  const n = await ku(`/chat/files/${e}/download`, t), r = URL.createObjectURL(n);
7053
7053
  let o = `file_${e}`;
7054
7054
  try {
@@ -7182,15 +7182,15 @@ var rb = "DismissableLayer", pi = "dismissableLayer.update", ob = "dismissableLa
7182
7182
  onInteractOutside: i,
7183
7183
  onDismiss: a,
7184
7184
  ...c
7185
- } = e, u = f.useContext(Pu), [d, h] = f.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, x] = f.useState({}), g = Te(t, (R) => h(R)), v = Array.from(u.layers), [m] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), b = v.indexOf(m), w = d ? v.indexOf(d) : -1, y = u.layersWithOutsidePointerEventsDisabled.size > 0, E = w >= b, S = lb((R) => {
7186
- const I = R.target, A = [...u.branches].some((k) => k.contains(I));
7187
- !E || A || (o == null || o(R), i == null || i(R), R.defaultPrevented || a == null || a());
7188
- }, p), C = cb((R) => {
7189
- const I = R.target;
7190
- [...u.branches].some((k) => k.contains(I)) || (s == null || s(R), i == null || i(R), R.defaultPrevented || a == null || a());
7185
+ } = e, u = f.useContext(Pu), [d, h] = f.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, x] = f.useState({}), g = Te(t, (E) => h(E)), v = Array.from(u.layers), [m] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), b = v.indexOf(m), w = d ? v.indexOf(d) : -1, y = u.layersWithOutsidePointerEventsDisabled.size > 0, R = w >= b, S = lb((E) => {
7186
+ const I = E.target, A = [...u.branches].some((k) => k.contains(I));
7187
+ !R || A || (o == null || o(E), i == null || i(E), E.defaultPrevented || a == null || a());
7188
+ }, p), C = cb((E) => {
7189
+ const I = E.target;
7190
+ [...u.branches].some((k) => k.contains(I)) || (s == null || s(E), i == null || i(E), E.defaultPrevented || a == null || a());
7191
7191
  }, p);
7192
- return nb((R) => {
7193
- w === u.layers.size - 1 && (r == null || r(R), !R.defaultPrevented && a && (R.preventDefault(), a()));
7192
+ return nb((E) => {
7193
+ w === u.layers.size - 1 && (r == null || r(E), !E.defaultPrevented && a && (E.preventDefault(), a()));
7194
7194
  }, p), f.useEffect(() => {
7195
7195
  if (d)
7196
7196
  return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (Fl = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), Bl(), () => {
@@ -7199,15 +7199,15 @@ var rb = "DismissableLayer", pi = "dismissableLayer.update", ob = "dismissableLa
7199
7199
  }, [d, p, n, u]), f.useEffect(() => () => {
7200
7200
  d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), Bl());
7201
7201
  }, [d, u]), f.useEffect(() => {
7202
- const R = () => x({});
7203
- return document.addEventListener(pi, R), () => document.removeEventListener(pi, R);
7202
+ const E = () => x({});
7203
+ return document.addEventListener(pi, E), () => document.removeEventListener(pi, E);
7204
7204
  }, []), /* @__PURE__ */ l.jsx(
7205
7205
  me.div,
7206
7206
  {
7207
7207
  ...c,
7208
7208
  ref: g,
7209
7209
  style: {
7210
- pointerEvents: y ? E ? "auto" : "none" : void 0,
7210
+ pointerEvents: y ? R ? "auto" : "none" : void 0,
7211
7211
  ...e.style
7212
7212
  },
7213
7213
  onFocusCapture: ee(e.onFocusCapture, C.onFocusCapture),
@@ -7282,7 +7282,7 @@ function Bl() {
7282
7282
  }
7283
7283
  function _u(e, t, n, { discrete: r }) {
7284
7284
  const o = n.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
7285
- t && o.addEventListener(e, t, { once: !0 }), r ? Ru(o, s) : o.dispatchEvent(s);
7285
+ t && o.addEventListener(e, t, { once: !0 }), r ? Eu(o, s) : o.dispatchEvent(s);
7286
7286
  }
7287
7287
  var Ls = "focusScope.autoFocusOnMount", Fs = "focusScope.autoFocusOnUnmount", Hl = { bubbles: !1, cancelable: !0 }, ub = "FocusScope", Jo = f.forwardRef((e, t) => {
7288
7288
  const {
@@ -7304,12 +7304,12 @@ var Ls = "focusScope.autoFocusOnMount", Fs = "focusScope.autoFocusOnUnmount", Hl
7304
7304
  if (r) {
7305
7305
  let v = function(y) {
7306
7306
  if (x.paused || !a) return;
7307
- const E = y.target;
7308
- a.contains(E) ? h.current = E : sn(h.current, { select: !0 });
7307
+ const R = y.target;
7308
+ a.contains(R) ? h.current = R : sn(h.current, { select: !0 });
7309
7309
  }, m = function(y) {
7310
7310
  if (x.paused || !a) return;
7311
- const E = y.relatedTarget;
7312
- E !== null && (a.contains(E) || sn(h.current, { select: !0 }));
7311
+ const R = y.relatedTarget;
7312
+ R !== null && (a.contains(R) || sn(h.current, { select: !0 }));
7313
7313
  }, b = function(y) {
7314
7314
  if (document.activeElement === document.body)
7315
7315
  for (const S of y)
@@ -7342,8 +7342,8 @@ var Ls = "focusScope.autoFocusOnMount", Fs = "focusScope.autoFocusOnUnmount", Hl
7342
7342
  if (!n && !r || x.paused) return;
7343
7343
  const m = v.key === "Tab" && !v.altKey && !v.ctrlKey && !v.metaKey, b = document.activeElement;
7344
7344
  if (m && b) {
7345
- const w = v.currentTarget, [y, E] = fb(w);
7346
- y && E ? !v.shiftKey && b === E ? (v.preventDefault(), n && sn(y, { select: !0 })) : v.shiftKey && b === y && (v.preventDefault(), n && sn(E, { select: !0 })) : b === w && v.preventDefault();
7345
+ const w = v.currentTarget, [y, R] = fb(w);
7346
+ y && R ? !v.shiftKey && b === R ? (v.preventDefault(), n && sn(y, { select: !0 })) : v.shiftKey && b === y && (v.preventDefault(), n && sn(R, { select: !0 })) : b === w && v.preventDefault();
7347
7347
  }
7348
7348
  },
7349
7349
  [n, r, x.paused]
@@ -7504,7 +7504,7 @@ function Cb(e, t) {
7504
7504
  function Tb(e) {
7505
7505
  return e;
7506
7506
  }
7507
- function Rb(e, t) {
7507
+ function Eb(e, t) {
7508
7508
  t === void 0 && (t = Tb);
7509
7509
  var n = [], r = !1, o = {
7510
7510
  read: function() {
@@ -7559,9 +7559,9 @@ function Rb(e, t) {
7559
7559
  };
7560
7560
  return o;
7561
7561
  }
7562
- function Eb(e) {
7562
+ function Rb(e) {
7563
7563
  e === void 0 && (e = {});
7564
- var t = Rb(null);
7564
+ var t = Eb(null);
7565
7565
  return t.options = Kt({ async: !0, ssr: !1 }, e), t;
7566
7566
  }
7567
7567
  var Du = function(e) {
@@ -7577,18 +7577,18 @@ Du.isSideCarExport = !0;
7577
7577
  function Ib(e, t) {
7578
7578
  return e.useMedium(t), Du;
7579
7579
  }
7580
- var Lu = Eb(), $s = function() {
7580
+ var Lu = Rb(), $s = function() {
7581
7581
  }, Qo = f.forwardRef(function(e, t) {
7582
7582
  var n = f.useRef(null), r = f.useState({
7583
7583
  onScrollCapture: $s,
7584
7584
  onWheelCapture: $s,
7585
7585
  onTouchMoveCapture: $s
7586
- }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, c = e.className, u = e.removeScrollBar, d = e.enabled, h = e.shards, p = e.sideCar, x = e.noRelative, g = e.noIsolation, v = e.inert, m = e.allowPinchZoom, b = e.as, w = b === void 0 ? "div" : b, y = e.gapMode, E = Mu(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = p, C = Cb([n, t]), R = Kt(Kt({}, E), o);
7586
+ }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, c = e.className, u = e.removeScrollBar, d = e.enabled, h = e.shards, p = e.sideCar, x = e.noRelative, g = e.noIsolation, v = e.inert, m = e.allowPinchZoom, b = e.as, w = b === void 0 ? "div" : b, y = e.gapMode, R = Mu(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = p, C = Cb([n, t]), E = Kt(Kt({}, R), o);
7587
7587
  return f.createElement(
7588
7588
  f.Fragment,
7589
7589
  null,
7590
7590
  d && f.createElement(S, { sideCar: Lu, removeScrollBar: u, shards: h, noRelative: x, noIsolation: g, inert: v, setCallbacks: s, allowPinchZoom: !!m, lockRef: n, gapMode: y }),
7591
- i ? f.cloneElement(f.Children.only(a), Kt(Kt({}, R), { ref: C })) : f.createElement(w, Kt({}, R, { className: c, ref: C }), a)
7591
+ i ? f.cloneElement(f.Children.only(a), Kt(Kt({}, E), { ref: C })) : f.createElement(w, Kt({}, E, { className: c, ref: C }), a)
7592
7592
  );
7593
7593
  });
7594
7594
  Qo.defaultProps = {
@@ -7728,12 +7728,12 @@ var Pb = function() {
7728
7728
  }, mi = !1;
7729
7729
  if (typeof window < "u")
7730
7730
  try {
7731
- var qr = Object.defineProperty({}, "passive", {
7731
+ var Xr = Object.defineProperty({}, "passive", {
7732
7732
  get: function() {
7733
7733
  return mi = !0, !0;
7734
7734
  }
7735
7735
  });
7736
- window.addEventListener("test", qr, qr), window.removeEventListener("test", qr, qr);
7736
+ window.addEventListener("test", Xr, Xr), window.removeEventListener("test", Xr, Xr);
7737
7737
  } catch {
7738
7738
  mi = !1;
7739
7739
  }
@@ -7804,24 +7804,24 @@ var Bn = mi ? { passive: !1 } : !1, $b = function(e) {
7804
7804
  return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
7805
7805
  }, Yl = function(e) {
7806
7806
  return [e.deltaX, e.deltaY];
7807
- }, Xl = function(e) {
7807
+ }, ql = function(e) {
7808
7808
  return e && "current" in e ? e.current : e;
7809
7809
  }, Yb = function(e, t) {
7810
7810
  return e[0] === t[0] && e[1] === t[1];
7811
- }, Xb = function(e) {
7811
+ }, qb = function(e) {
7812
7812
  return `
7813
7813
  .block-interactivity-`.concat(e, ` {pointer-events: none;}
7814
7814
  .allow-interactivity-`).concat(e, ` {pointer-events: all;}
7815
7815
  `);
7816
- }, qb = 0, Hn = [];
7816
+ }, Xb = 0, Hn = [];
7817
7817
  function Jb(e) {
7818
- var t = f.useRef([]), n = f.useRef([0, 0]), r = f.useRef(), o = f.useState(qb++)[0], s = f.useState(Fu)[0], i = f.useRef(e);
7818
+ var t = f.useRef([]), n = f.useRef([0, 0]), r = f.useRef(), o = f.useState(Xb++)[0], s = f.useState(Fu)[0], i = f.useRef(e);
7819
7819
  f.useEffect(function() {
7820
7820
  i.current = e;
7821
7821
  }, [e]), f.useEffect(function() {
7822
7822
  if (e.inert) {
7823
7823
  document.body.classList.add("block-interactivity-".concat(o));
7824
- var v = xb([e.lockRef.current], (e.shards || []).map(Xl), !0).filter(Boolean);
7824
+ var v = xb([e.lockRef.current], (e.shards || []).map(ql), !0).filter(Boolean);
7825
7825
  return v.forEach(function(m) {
7826
7826
  return m.classList.add("allow-interactivity-".concat(o));
7827
7827
  }), function() {
@@ -7834,18 +7834,18 @@ function Jb(e) {
7834
7834
  var a = f.useCallback(function(v, m) {
7835
7835
  if ("touches" in v && v.touches.length === 2 || v.type === "wheel" && v.ctrlKey)
7836
7836
  return !i.current.allowPinchZoom;
7837
- var b = Jr(v), w = n.current, y = "deltaX" in v ? v.deltaX : w[0] - b[0], E = "deltaY" in v ? v.deltaY : w[1] - b[1], S, C = v.target, R = Math.abs(y) > Math.abs(E) ? "h" : "v";
7838
- if ("touches" in v && R === "h" && C.type === "range")
7837
+ var b = Jr(v), w = n.current, y = "deltaX" in v ? v.deltaX : w[0] - b[0], R = "deltaY" in v ? v.deltaY : w[1] - b[1], S, C = v.target, E = Math.abs(y) > Math.abs(R) ? "h" : "v";
7838
+ if ("touches" in v && E === "h" && C.type === "range")
7839
7839
  return !1;
7840
- var I = Kl(R, C);
7840
+ var I = Kl(E, C);
7841
7841
  if (!I)
7842
7842
  return !0;
7843
- if (I ? S = R : (S = R === "v" ? "h" : "v", I = Kl(R, C)), !I)
7843
+ if (I ? S = E : (S = E === "v" ? "h" : "v", I = Kl(E, C)), !I)
7844
7844
  return !1;
7845
- if (!r.current && "changedTouches" in v && (y || E) && (r.current = S), !S)
7845
+ if (!r.current && "changedTouches" in v && (y || R) && (r.current = S), !S)
7846
7846
  return !0;
7847
7847
  var A = r.current || S;
7848
- return Kb(A, m, v, A === "h" ? y : E);
7848
+ return Kb(A, m, v, A === "h" ? y : R);
7849
7849
  }, []), c = f.useCallback(function(v) {
7850
7850
  var m = v;
7851
7851
  if (!(!Hn.length || Hn[Hn.length - 1] !== s)) {
@@ -7857,17 +7857,17 @@ function Jb(e) {
7857
7857
  return;
7858
7858
  }
7859
7859
  if (!w) {
7860
- var y = (i.current.shards || []).map(Xl).filter(Boolean).filter(function(S) {
7860
+ var y = (i.current.shards || []).map(ql).filter(Boolean).filter(function(S) {
7861
7861
  return S.contains(m.target);
7862
- }), E = y.length > 0 ? a(m, y[0]) : !i.current.noIsolation;
7863
- E && m.cancelable && m.preventDefault();
7862
+ }), R = y.length > 0 ? a(m, y[0]) : !i.current.noIsolation;
7863
+ R && m.cancelable && m.preventDefault();
7864
7864
  }
7865
7865
  }
7866
7866
  }, []), u = f.useCallback(function(v, m, b, w) {
7867
7867
  var y = { name: v, delta: m, target: b, should: w, shadowParent: Zb(b) };
7868
7868
  t.current.push(y), setTimeout(function() {
7869
- t.current = t.current.filter(function(E) {
7870
- return E !== y;
7869
+ t.current = t.current.filter(function(R) {
7870
+ return R !== y;
7871
7871
  });
7872
7872
  }, 1);
7873
7873
  }, []), d = f.useCallback(function(v) {
@@ -7892,7 +7892,7 @@ function Jb(e) {
7892
7892
  return f.createElement(
7893
7893
  f.Fragment,
7894
7894
  null,
7895
- g ? f.createElement(s, { styles: Xb(o) }) : null,
7895
+ g ? f.createElement(s, { styles: qb(o) }) : null,
7896
7896
  x ? f.createElement(Hb, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
7897
7897
  );
7898
7898
  }
@@ -8012,14 +8012,14 @@ var ra = "DialogPortal", [ow, Ku] = Uu(ra, {
8012
8012
  return /* @__PURE__ */ l.jsx(ow, { scope: t, forceMount: n, children: f.Children.map(r, (i) => /* @__PURE__ */ l.jsx(vt, { present: n || s.open, children: /* @__PURE__ */ l.jsx(Zo, { asChild: !0, container: o, children: i }) })) });
8013
8013
  };
8014
8014
  Yu.displayName = ra;
8015
- var No = "DialogOverlay", Xu = f.forwardRef(
8015
+ var No = "DialogOverlay", qu = f.forwardRef(
8016
8016
  (e, t) => {
8017
8017
  const n = Ku(No, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Wt(No, e.__scopeDialog);
8018
8018
  return s.modal ? /* @__PURE__ */ l.jsx(vt, { present: r || s.open, children: /* @__PURE__ */ l.jsx(iw, { ...o, ref: t }) }) : null;
8019
8019
  }
8020
8020
  );
8021
- Xu.displayName = No;
8022
- var sw = Xn("DialogOverlay.RemoveScroll"), iw = f.forwardRef(
8021
+ qu.displayName = No;
8022
+ var sw = qn("DialogOverlay.RemoveScroll"), iw = f.forwardRef(
8023
8023
  (e, t) => {
8024
8024
  const { __scopeDialog: n, ...r } = e, o = Wt(No, n);
8025
8025
  return (
@@ -8036,13 +8036,13 @@ var sw = Xn("DialogOverlay.RemoveScroll"), iw = f.forwardRef(
8036
8036
  ) })
8037
8037
  );
8038
8038
  }
8039
- ), Nn = "DialogContent", qu = f.forwardRef(
8039
+ ), Nn = "DialogContent", Xu = f.forwardRef(
8040
8040
  (e, t) => {
8041
8041
  const n = Ku(Nn, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Wt(Nn, e.__scopeDialog);
8042
8042
  return /* @__PURE__ */ l.jsx(vt, { present: r || s.open, children: s.modal ? /* @__PURE__ */ l.jsx(aw, { ...o, ref: t }) : /* @__PURE__ */ l.jsx(lw, { ...o, ref: t }) });
8043
8043
  }
8044
8044
  );
8045
- qu.displayName = Nn;
8045
+ Xu.displayName = Nn;
8046
8046
  var aw = f.forwardRef(
8047
8047
  (e, t) => {
8048
8048
  const n = Wt(Nn, e.__scopeDialog), r = f.useRef(null), o = Te(t, n.contentRef, r);
@@ -8179,7 +8179,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
8179
8179
  const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
8180
8180
  t && o && (document.getElementById(t) || console.warn(r));
8181
8181
  }, [r, e, t]), null;
8182
- }, sd = Wu, fw = Gu, id = Yu, ns = Xu, rs = qu, Tn = Zu, os = ed, ad = nd;
8182
+ }, sd = Wu, fw = Gu, id = Yu, ns = qu, rs = Xu, Tn = Zu, os = ed, ad = nd;
8183
8183
  const hw = sd, pw = id, ld = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
8184
8184
  ns,
8185
8185
  {
@@ -8287,7 +8287,7 @@ function gw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
8287
8287
  }, x = async () => {
8288
8288
  if (n)
8289
8289
  try {
8290
- await qx(n), h({ title: "Download started", description: `Downloading ${r}` });
8290
+ await Xx(n), h({ title: "Download started", description: `Downloading ${r}` });
8291
8291
  } catch (b) {
8292
8292
  console.error("Failed to download file:", b), h({ title: "Download failed", description: String(b), variant: "destructive" });
8293
8293
  }
@@ -8413,9 +8413,9 @@ const xw = K.memo(function({
8413
8413
  onCancelEdit: b,
8414
8414
  onCopy: w
8415
8415
  }) {
8416
- const [y, E] = fe(!1), [S, C] = fe(!1), [R, I] = fe(!1), [A, k] = fe(!1), { currentThreadId: M } = Li();
8416
+ const [y, R] = fe(!1), [S, C] = fe(!1), [E, I] = fe(!1), [A, k] = fe(!1), { currentThreadId: M } = Li();
8417
8417
  ea();
8418
- const [W, G] = fe({}), [N, $] = fe(!1), [L, X] = fe(null), O = u === "phone" || u === "half-screen", _ = t.role, z = _ === "tool", q = K.useMemo(() => {
8418
+ const [W, G] = fe({}), [N, $] = fe(!1), [L, q] = fe(null), O = u === "phone" || u === "half-screen", _ = t.role, z = _ === "tool", X = K.useMemo(() => {
8419
8419
  switch (_) {
8420
8420
  case "user":
8421
8421
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -8439,10 +8439,10 @@ const xw = K.memo(function({
8439
8439
  fileParts: de.map((ce) => ({ type: ce.type, name: ce.name, url: ce.url }))
8440
8440
  });
8441
8441
  }, [t.id, t.content, de, Q]);
8442
- const be = Ew(oe, r ? o : 0), Y = async () => {
8442
+ const be = Rw(oe, r ? o : 0), Y = async () => {
8443
8443
  try {
8444
8444
  const ce = z ? zn(t.content) : oe;
8445
- await navigator.clipboard.writeText(ce), E(!0), setTimeout(() => E(!1), 2e3), w == null || w(ce);
8445
+ await navigator.clipboard.writeText(ce), R(!0), setTimeout(() => R(!1), 2e3), w == null || w(ce);
8446
8446
  } catch (ce) {
8447
8447
  console.error("Failed to copy:", ce);
8448
8448
  }
@@ -8451,7 +8451,7 @@ const xw = K.memo(function({
8451
8451
  const ce = z ? zn(t.content) : oe;
8452
8452
  v(t.id, ce);
8453
8453
  }, Z = () => m == null ? void 0 : m(n), ne = () => {
8454
- const Ae = D(O ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", q);
8454
+ const Ae = D(O ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", X);
8455
8455
  switch (_) {
8456
8456
  case "user":
8457
8457
  return /* @__PURE__ */ l.jsx(Hp, { className: Ae });
@@ -8523,7 +8523,7 @@ const xw = K.memo(function({
8523
8523
  const ve = t.content.find((Be) => Be.type === "tool_result"), H = (ve == null ? void 0 : ve.output) ?? zn(t.content), ae = hd(H);
8524
8524
  if (ae) return /* @__PURE__ */ l.jsx(Nw, { issues: ae });
8525
8525
  }
8526
- if (z && !R) {
8526
+ if (z && !E) {
8527
8527
  const ve = zn(t.content).slice(0, 80).replace(/\s+/g, " ");
8528
8528
  return /* @__PURE__ */ l.jsx("div", { className: D("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", O && "text-[10px]"), children: /* @__PURE__ */ l.jsxs("span", { className: "truncate max-w-full text-current", children: [
8529
8529
  ve,
@@ -8545,10 +8545,10 @@ const xw = K.memo(function({
8545
8545
  ] }) }) })
8546
8546
  ] }) });
8547
8547
  }
8548
- if (z && R && !d) {
8548
+ if (z && E && !d) {
8549
8549
  const ve = jw(t.content);
8550
8550
  if (ve && ww(ve))
8551
- return /* @__PURE__ */ l.jsx(Xr, { content: ve.trim() });
8551
+ return /* @__PURE__ */ l.jsx(qr, { content: ve.trim() });
8552
8552
  const H = zn(t.content);
8553
8553
  return /* @__PURE__ */ l.jsx("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ l.jsx("pre", { className: D("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: H }) });
8554
8554
  }
@@ -8557,17 +8557,17 @@ const xw = K.memo(function({
8557
8557
  r ? /* @__PURE__ */ l.jsxs("div", { className: "relative", children: [
8558
8558
  (() => {
8559
8559
  const ve = Ws(be);
8560
- return ve !== null ? /* @__PURE__ */ l.jsx(ql, { data: ve }) : /* @__PURE__ */ l.jsx(Xr, { content: Sw(yw(be)) });
8560
+ return ve !== null ? /* @__PURE__ */ l.jsx(Xl, { data: ve }) : /* @__PURE__ */ l.jsx(qr, { content: Sw(yw(be)) });
8561
8561
  })(),
8562
- /* @__PURE__ */ l.jsx(vw, { className: D(q, O ? "text-xs" : "text-sm") })
8562
+ /* @__PURE__ */ l.jsx(vw, { className: D(X, O ? "text-xs" : "text-sm") })
8563
8563
  ] }) : (() => {
8564
8564
  const ve = Ws(oe.trim());
8565
- if (ve !== null) return /* @__PURE__ */ l.jsx(ql, { data: ve });
8565
+ if (ve !== null) return /* @__PURE__ */ l.jsx(Xl, { data: ve });
8566
8566
  if (_ === "user" && p) {
8567
8567
  const H = oe.trim();
8568
8568
  if (H.length > x)
8569
8569
  return /* @__PURE__ */ l.jsxs(_l, { open: A, onOpenChange: k, children: [
8570
- /* @__PURE__ */ l.jsx("div", { className: D("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: A ? /* @__PURE__ */ l.jsx(Xr, { content: H }) : /* @__PURE__ */ l.jsxs("pre", { className: D("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
8570
+ /* @__PURE__ */ l.jsx("div", { className: D("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: A ? /* @__PURE__ */ l.jsx(qr, { content: H }) : /* @__PURE__ */ l.jsxs("pre", { className: D("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
8571
8571
  H.substring(0, x),
8572
8572
  "..."
8573
8573
  ] }) }),
@@ -8590,7 +8590,7 @@ const xw = K.memo(function({
8590
8590
  ) })
8591
8591
  ] });
8592
8592
  }
8593
- return /* @__PURE__ */ l.jsx(Xr, { content: oe.trim() });
8593
+ return /* @__PURE__ */ l.jsx(qr, { content: oe.trim() });
8594
8594
  })(),
8595
8595
  ce && /* @__PURE__ */ l.jsx("div", { className: "mt-2 grid grid-cols-2 gap-2", children: Q.map((ve, H) => /* @__PURE__ */ l.jsxs("div", { className: "relative border rounded overflow-hidden", children: [
8596
8596
  /* @__PURE__ */ l.jsx("img", { src: ve.url, alt: ve.alt ?? "image", className: "w-full h-auto" }),
@@ -8601,7 +8601,7 @@ const xw = K.memo(function({
8601
8601
  ] }, H)) }),
8602
8602
  Ae
8603
8603
  ] });
8604
- }, Le = wn(() => Rw(t), [t]);
8604
+ }, Le = wn(() => Ew(t), [t]);
8605
8605
  return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
8606
8606
  /* @__PURE__ */ l.jsx("div", { className: D(le(), g.container), children: /* @__PURE__ */ l.jsxs("div", { className: D(ie(), g.content), children: [
8607
8607
  (a || c || z) && /* @__PURE__ */ l.jsxs(
@@ -8610,7 +8610,7 @@ const xw = K.memo(function({
8610
8610
  className: D(
8611
8611
  "flex items-center justify-between mb-2 pb-2 border-b border-current/10",
8612
8612
  O && "mb-1 pb-1",
8613
- q,
8613
+ X,
8614
8614
  g.header
8615
8615
  ),
8616
8616
  children: [
@@ -8623,14 +8623,14 @@ const xw = K.memo(function({
8623
8623
  variant: "outline",
8624
8624
  className: D(
8625
8625
  "text-xs flex items-center gap-1 cursor-pointer",
8626
- q,
8626
+ X,
8627
8627
  "border border-current/40",
8628
8628
  O && "text-xs h-4"
8629
8629
  ),
8630
8630
  onClick: () => I((ce) => !ce),
8631
8631
  children: [
8632
8632
  /* @__PURE__ */ l.jsx("span", { children: F.name }),
8633
- /* @__PURE__ */ l.jsx("span", { className: "inline-flex items-center", children: R ? /* @__PURE__ */ l.jsx(pr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(Un, { className: "h-3 w-3" }) })
8633
+ /* @__PURE__ */ l.jsx("span", { className: "inline-flex items-center", children: E ? /* @__PURE__ */ l.jsx(pr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(Un, { className: "h-3 w-3" }) })
8634
8634
  ]
8635
8635
  }
8636
8636
  ),
@@ -8639,17 +8639,17 @@ const xw = K.memo(function({
8639
8639
  {
8640
8640
  variant: "ghost",
8641
8641
  size: "sm",
8642
- className: D("h-6 px-1", q, "hover:bg-foreground/10"),
8642
+ className: D("h-6 px-1", X, "hover:bg-foreground/10"),
8643
8643
  onClick: () => I((ce) => !ce),
8644
8644
  children: /* @__PURE__ */ l.jsxs("span", { className: "text-xs flex items-center gap-1", children: [
8645
8645
  "Tool Output ",
8646
- R ? /* @__PURE__ */ l.jsx(pr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(Un, { className: "h-3 w-3" })
8646
+ E ? /* @__PURE__ */ l.jsx(pr, { className: "h-3 w-3" }) : /* @__PURE__ */ l.jsx(Un, { className: "h-3 w-3" })
8647
8647
  ] })
8648
8648
  }
8649
8649
  )
8650
8650
  ] }),
8651
8651
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
8652
- a && /* @__PURE__ */ l.jsx("span", { className: D("text-xs opacity-60", q, O && "text-xs"), children: Pe(t.createdAt) }),
8652
+ a && /* @__PURE__ */ l.jsx("span", { className: D("text-xs opacity-60", X, O && "text-xs"), children: Pe(t.createdAt) }),
8653
8653
  i && !s && /* @__PURE__ */ l.jsxs(
8654
8654
  "div",
8655
8655
  {
@@ -8665,12 +8665,12 @@ const xw = K.memo(function({
8665
8665
  variant: "ghost",
8666
8666
  size: "sm",
8667
8667
  onClick: Y,
8668
- className: D("h-6 w-6 p-0 hover:bg-foreground/10", q, O && "h-5 w-5"),
8668
+ className: D("h-6 w-6 p-0 hover:bg-foreground/10", X, O && "h-5 w-5"),
8669
8669
  children: /* @__PURE__ */ l.jsx(
8670
8670
  Ha,
8671
8671
  {
8672
8672
  className: D(
8673
- y ? "text-success" : q,
8673
+ y ? "text-success" : X,
8674
8674
  O ? "h-3 w-3" : "h-4 w-4"
8675
8675
  )
8676
8676
  }
@@ -8683,8 +8683,8 @@ const xw = K.memo(function({
8683
8683
  variant: "ghost",
8684
8684
  size: "sm",
8685
8685
  onClick: P,
8686
- className: D("h-6 w-6 p-0 hover:bg-foreground/10", q, O && "h-5 w-5"),
8687
- children: /* @__PURE__ */ l.jsx($a, { className: D(q, O ? "h-3 w-3" : "h-4 w-4") })
8686
+ className: D("h-6 w-6 p-0 hover:bg-foreground/10", X, O && "h-5 w-5"),
8687
+ children: /* @__PURE__ */ l.jsx($a, { className: D(X, O ? "h-3 w-3" : "h-4 w-4") })
8688
8688
  }
8689
8689
  ),
8690
8690
  _ === "assistant" && m && /* @__PURE__ */ l.jsx(
@@ -8693,8 +8693,8 @@ const xw = K.memo(function({
8693
8693
  variant: "ghost",
8694
8694
  size: "sm",
8695
8695
  onClick: Z,
8696
- className: D("h-6 w-6 p-0 hover:bg-foreground/10", q, O && "h-5 w-5"),
8697
- children: /* @__PURE__ */ l.jsx(Xs, { className: D(q, O ? "h-3 w-3" : "h-4 w-4") })
8696
+ className: D("h-6 w-6 p-0 hover:bg-foreground/10", X, O && "h-5 w-5"),
8697
+ children: /* @__PURE__ */ l.jsx(qs, { className: D(X, O ? "h-3 w-3" : "h-4 w-4") })
8698
8698
  }
8699
8699
  )
8700
8700
  ]
@@ -8705,7 +8705,7 @@ const xw = K.memo(function({
8705
8705
  }
8706
8706
  ),
8707
8707
  /* @__PURE__ */ l.jsx("div", { className: "relative", children: Fe() }),
8708
- z && R && (F.toolCallId || F.name) && /* @__PURE__ */ l.jsxs("div", { className: D("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", O && "text-xs"), children: [
8708
+ z && E && (F.toolCallId || F.name) && /* @__PURE__ */ l.jsxs("div", { className: D("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", O && "text-xs"), children: [
8709
8709
  F.name && /* @__PURE__ */ l.jsxs("div", { children: [
8710
8710
  "Function: ",
8711
8711
  F.name
@@ -8751,7 +8751,7 @@ const xw = K.memo(function({
8751
8751
  size: "sm",
8752
8752
  onClick: Z,
8753
8753
  className: D("h-6 w-6 p-0 hover:bg-background/50 text-current", O && "h-5 w-5"),
8754
- children: /* @__PURE__ */ l.jsx(Xs, { className: D("text-current", O ? "h-3 w-3" : "h-4 w-4") })
8754
+ children: /* @__PURE__ */ l.jsx(qs, { className: D("text-current", O ? "h-3 w-3" : "h-4 w-4") })
8755
8755
  }
8756
8756
  )
8757
8757
  ]
@@ -8763,7 +8763,7 @@ const xw = K.memo(function({
8763
8763
  {
8764
8764
  isOpen: N,
8765
8765
  onClose: () => {
8766
- $(!1), X(null);
8766
+ $(!1), q(null);
8767
8767
  },
8768
8768
  fileId: L.id,
8769
8769
  fileName: L.name,
@@ -8807,7 +8807,7 @@ function Ws(e) {
8807
8807
  return null;
8808
8808
  }
8809
8809
  }
8810
- function ql({ data: e }) {
8810
+ function Xl({ data: e }) {
8811
8811
  if (Array.isArray(e))
8812
8812
  return e.every((n) => n === null || ["string", "number", "boolean"].includes(typeof n)) ? /* @__PURE__ */ l.jsx("div", { className: po, children: /* @__PURE__ */ l.jsx("ul", { className: "list-disc pl-5", children: e.map((n, r) => /* @__PURE__ */ l.jsx("li", { children: String(n) }, r)) }) }) : /* @__PURE__ */ l.jsx("pre", { className: "font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words", children: wr(e) });
8813
8813
  if (e && typeof e == "object") {
@@ -8894,10 +8894,10 @@ function Tw(e) {
8894
8894
  toolCallId: (n == null ? void 0 : n.toolCallId) ?? (t == null ? void 0 : t.id)
8895
8895
  };
8896
8896
  }
8897
- function Rw(e) {
8897
+ function Ew(e) {
8898
8898
  return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
8899
8899
  }
8900
- function Ew(e, t) {
8900
+ function Rw(e, t) {
8901
8901
  const [n, r] = fe(e);
8902
8902
  return Ve(() => {
8903
8903
  if (!t) {
@@ -9047,17 +9047,17 @@ function ia(e) {
9047
9047
  return /* @__PURE__ */ l.jsx(o, { scope: m, itemMap: y, collectionRef: w, children: b });
9048
9048
  };
9049
9049
  i.displayName = t;
9050
- const a = e + "CollectionSlot", c = Xn(a), u = K.forwardRef(
9050
+ const a = e + "CollectionSlot", c = qn(a), u = K.forwardRef(
9051
9051
  (v, m) => {
9052
- const { scope: b, children: w } = v, y = s(a, b), E = Te(m, y.collectionRef);
9053
- return /* @__PURE__ */ l.jsx(c, { ref: E, children: w });
9052
+ const { scope: b, children: w } = v, y = s(a, b), R = Te(m, y.collectionRef);
9053
+ return /* @__PURE__ */ l.jsx(c, { ref: R, children: w });
9054
9054
  }
9055
9055
  );
9056
9056
  u.displayName = a;
9057
- const d = e + "CollectionItemSlot", h = "data-radix-collection-item", p = Xn(d), x = K.forwardRef(
9057
+ const d = e + "CollectionItemSlot", h = "data-radix-collection-item", p = qn(d), x = K.forwardRef(
9058
9058
  (v, m) => {
9059
- const { scope: b, children: w, ...y } = v, E = K.useRef(null), S = Te(m, E), C = s(d, b);
9060
- return K.useEffect(() => (C.itemMap.set(E, { ref: E, ...y }), () => void C.itemMap.delete(E))), /* @__PURE__ */ l.jsx(p, { [h]: "", ref: S, children: w });
9059
+ const { scope: b, children: w, ...y } = v, R = K.useRef(null), S = Te(m, R), C = s(d, b);
9060
+ return K.useEffect(() => (C.itemMap.set(R, { ref: R, ...y }), () => void C.itemMap.delete(R))), /* @__PURE__ */ l.jsx(p, { [h]: "", ref: S, children: w });
9061
9061
  }
9062
9062
  );
9063
9063
  x.displayName = d;
@@ -9068,7 +9068,7 @@ function ia(e) {
9068
9068
  if (!w) return [];
9069
9069
  const y = Array.from(w.querySelectorAll(`[${h}]`));
9070
9070
  return Array.from(m.itemMap.values()).sort(
9071
- (C, R) => y.indexOf(C.ref.current) - y.indexOf(R.ref.current)
9071
+ (C, E) => y.indexOf(C.ref.current) - y.indexOf(E.ref.current)
9072
9072
  );
9073
9073
  }, [m.collectionRef, m.itemMap]);
9074
9074
  }
@@ -9083,7 +9083,7 @@ function ss(e) {
9083
9083
  const t = f.useContext(_w);
9084
9084
  return e || t || "ltr";
9085
9085
  }
9086
- const Ow = ["top", "right", "bottom", "left"], dn = Math.min, wt = Math.max, Ao = Math.round, eo = Math.floor, qt = (e) => ({
9086
+ const Ow = ["top", "right", "bottom", "left"], dn = Math.min, wt = Math.max, Ao = Math.round, eo = Math.floor, Xt = (e) => ({
9087
9087
  x: e,
9088
9088
  y: e
9089
9089
  }), Mw = {
@@ -9114,11 +9114,11 @@ function la(e) {
9114
9114
  return e === "y" ? "height" : "width";
9115
9115
  }
9116
9116
  const Lw = /* @__PURE__ */ new Set(["top", "bottom"]);
9117
- function Xt(e) {
9117
+ function qt(e) {
9118
9118
  return Lw.has(on(e)) ? "y" : "x";
9119
9119
  }
9120
9120
  function ca(e) {
9121
- return aa(Xt(e));
9121
+ return aa(qt(e));
9122
9122
  }
9123
9123
  function Fw(e, t, n) {
9124
9124
  n === void 0 && (n = !1);
@@ -9194,7 +9194,7 @@ function Ql(e, t, n) {
9194
9194
  reference: r,
9195
9195
  floating: o
9196
9196
  } = e;
9197
- const s = Xt(t), i = ca(t), a = la(i), c = on(t), u = s === "y", d = r.x + r.width / 2 - o.width / 2, h = r.y + r.height / 2 - o.height / 2, p = r[a] / 2 - o[a] / 2;
9197
+ const s = qt(t), i = ca(t), a = la(i), c = on(t), u = s === "y", d = r.x + r.width / 2 - o.width / 2, h = r.y + r.height / 2 - o.height / 2, p = r[a] / 2 - o[a] / 2;
9198
9198
  let x;
9199
9199
  switch (c) {
9200
9200
  case "top":
@@ -9259,7 +9259,7 @@ const Vw = async (e, t, n) => {
9259
9259
  } = a[v], {
9260
9260
  x: w,
9261
9261
  y,
9262
- data: E,
9262
+ data: R,
9263
9263
  reset: S
9264
9264
  } = await b({
9265
9265
  x: d,
@@ -9279,7 +9279,7 @@ const Vw = async (e, t, n) => {
9279
9279
  ...x,
9280
9280
  [m]: {
9281
9281
  ...x[m],
9282
- ...E
9282
+ ...R
9283
9283
  }
9284
9284
  }, S && g <= 50 && (g++, typeof S == "object" && (S.placement && (p = S.placement), S.rects && (u = S.rects === !0 ? await i.getElementRects({
9285
9285
  reference: e,
@@ -9298,7 +9298,7 @@ const Vw = async (e, t, n) => {
9298
9298
  middlewareData: x
9299
9299
  };
9300
9300
  };
9301
- async function Er(e, t) {
9301
+ async function Rr(e, t) {
9302
9302
  var n;
9303
9303
  t === void 0 && (t = {});
9304
9304
  const {
@@ -9324,7 +9324,7 @@ async function Er(e, t) {
9324
9324
  y: o,
9325
9325
  width: i.floating.width,
9326
9326
  height: i.floating.height
9327
- } : i.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), E = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
9327
+ } : i.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), R = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
9328
9328
  x: 1,
9329
9329
  y: 1
9330
9330
  } : {
@@ -9337,10 +9337,10 @@ async function Er(e, t) {
9337
9337
  strategy: c
9338
9338
  }) : w);
9339
9339
  return {
9340
- top: (b.top - S.top + g.top) / E.y,
9341
- bottom: (S.bottom - b.bottom + g.bottom) / E.y,
9342
- left: (b.left - S.left + g.left) / E.x,
9343
- right: (S.right - b.right + g.right) / E.x
9340
+ top: (b.top - S.top + g.top) / R.y,
9341
+ bottom: (S.bottom - b.bottom + g.bottom) / R.y,
9342
+ left: (b.left - S.left + g.left) / R.x,
9343
+ right: (S.right - b.right + g.right) / R.x
9344
9344
  };
9345
9345
  }
9346
9346
  const Gw = (e) => ({
@@ -9364,17 +9364,17 @@ const Gw = (e) => ({
9364
9364
  const h = pd(d), p = {
9365
9365
  x: n,
9366
9366
  y: r
9367
- }, x = ca(o), g = la(x), v = await i.getDimensions(u), m = x === "y", b = m ? "top" : "left", w = m ? "bottom" : "right", y = m ? "clientHeight" : "clientWidth", E = s.reference[g] + s.reference[x] - p[x] - s.floating[g], S = p[x] - s.reference[x], C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
9368
- let R = C ? C[y] : 0;
9369
- (!R || !await (i.isElement == null ? void 0 : i.isElement(C))) && (R = a.floating[y] || s.floating[g]);
9370
- const I = E / 2 - S / 2, A = R / 2 - v[g] / 2 - 1, k = dn(h[b], A), M = dn(h[w], A), W = k, G = R - v[g] - M, N = R / 2 - v[g] / 2 + I, $ = gi(W, N, G), L = !c.arrow && sr(o) != null && N !== $ && s.reference[g] / 2 - (N < W ? k : M) - v[g] / 2 < 0, X = L ? N < W ? N - W : N - G : 0;
9367
+ }, x = ca(o), g = la(x), v = await i.getDimensions(u), m = x === "y", b = m ? "top" : "left", w = m ? "bottom" : "right", y = m ? "clientHeight" : "clientWidth", R = s.reference[g] + s.reference[x] - p[x] - s.floating[g], S = p[x] - s.reference[x], C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
9368
+ let E = C ? C[y] : 0;
9369
+ (!E || !await (i.isElement == null ? void 0 : i.isElement(C))) && (E = a.floating[y] || s.floating[g]);
9370
+ const I = R / 2 - S / 2, A = E / 2 - v[g] / 2 - 1, k = dn(h[b], A), M = dn(h[w], A), W = k, G = E - v[g] - M, N = E / 2 - v[g] / 2 + I, $ = gi(W, N, G), L = !c.arrow && sr(o) != null && N !== $ && s.reference[g] / 2 - (N < W ? k : M) - v[g] / 2 < 0, q = L ? N < W ? N - W : N - G : 0;
9371
9371
  return {
9372
- [x]: p[x] + X,
9372
+ [x]: p[x] + q,
9373
9373
  data: {
9374
9374
  [x]: $,
9375
- centerOffset: N - $ - X,
9375
+ centerOffset: N - $ - q,
9376
9376
  ...L && {
9377
- alignmentOffset: X
9377
+ alignmentOffset: q
9378
9378
  }
9379
9379
  },
9380
9380
  reset: L
@@ -9404,12 +9404,12 @@ const Gw = (e) => ({
9404
9404
  } = rn(e, t);
9405
9405
  if ((n = s.arrow) != null && n.alignmentOffset)
9406
9406
  return {};
9407
- const b = on(o), w = Xt(a), y = on(a) === a, E = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), S = p || (y || !v ? [ko(a)] : Bw(a)), C = g !== "none";
9408
- !p && C && S.push(...Uw(a, v, g, E));
9409
- const R = [a, ...S], I = await Er(t, m), A = [];
9407
+ const b = on(o), w = qt(a), y = on(a) === a, R = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), S = p || (y || !v ? [ko(a)] : Bw(a)), C = g !== "none";
9408
+ !p && C && S.push(...Uw(a, v, g, R));
9409
+ const E = [a, ...S], I = await Rr(t, m), A = [];
9410
9410
  let k = ((r = s.flip) == null ? void 0 : r.overflows) || [];
9411
9411
  if (d && A.push(I[b]), h) {
9412
- const N = Fw(o, i, E);
9412
+ const N = Fw(o, i, R);
9413
9413
  A.push(I[N[0]], I[N[1]]);
9414
9414
  }
9415
9415
  if (k = [...k, {
@@ -9417,10 +9417,10 @@ const Gw = (e) => ({
9417
9417
  overflows: A
9418
9418
  }], !A.every((N) => N <= 0)) {
9419
9419
  var M, W;
9420
- const N = (((M = s.flip) == null ? void 0 : M.index) || 0) + 1, $ = R[N];
9421
- if ($ && (!(h === "alignment" ? w !== Xt($) : !1) || // We leave the current main axis only if every placement on that axis
9420
+ const N = (((M = s.flip) == null ? void 0 : M.index) || 0) + 1, $ = E[N];
9421
+ if ($ && (!(h === "alignment" ? w !== qt($) : !1) || // We leave the current main axis only if every placement on that axis
9422
9422
  // overflows the main axis.
9423
- k.every((O) => Xt(O.placement) === w ? O.overflows[0] > 0 : !0)))
9423
+ k.every((O) => qt(O.placement) === w ? O.overflows[0] > 0 : !0)))
9424
9424
  return {
9425
9425
  data: {
9426
9426
  index: N,
@@ -9430,21 +9430,21 @@ const Gw = (e) => ({
9430
9430
  placement: $
9431
9431
  }
9432
9432
  };
9433
- let L = (W = k.filter((X) => X.overflows[0] <= 0).sort((X, O) => X.overflows[1] - O.overflows[1])[0]) == null ? void 0 : W.placement;
9433
+ let L = (W = k.filter((q) => q.overflows[0] <= 0).sort((q, O) => q.overflows[1] - O.overflows[1])[0]) == null ? void 0 : W.placement;
9434
9434
  if (!L)
9435
9435
  switch (x) {
9436
9436
  case "bestFit": {
9437
9437
  var G;
9438
- const X = (G = k.filter((O) => {
9438
+ const q = (G = k.filter((O) => {
9439
9439
  if (C) {
9440
- const _ = Xt(O.placement);
9440
+ const _ = qt(O.placement);
9441
9441
  return _ === w || // Create a bias to the `y` side axis due to horizontal
9442
9442
  // reading directions favoring greater width.
9443
9443
  _ === "y";
9444
9444
  }
9445
9445
  return !0;
9446
9446
  }).map((O) => [O.placement, O.overflows.filter((_) => _ > 0).reduce((_, z) => _ + z, 0)]).sort((O, _) => O[1] - _[1])[0]) == null ? void 0 : G[0];
9447
- X && (L = X);
9447
+ q && (L = q);
9448
9448
  break;
9449
9449
  }
9450
9450
  case "initialPlacement":
@@ -9486,7 +9486,7 @@ const Yw = function(e) {
9486
9486
  } = rn(e, t);
9487
9487
  switch (r) {
9488
9488
  case "referenceHidden": {
9489
- const s = await Er(t, {
9489
+ const s = await Rr(t, {
9490
9490
  ...o,
9491
9491
  elementContext: "reference"
9492
9492
  }), i = ec(s, n.reference);
@@ -9498,7 +9498,7 @@ const Yw = function(e) {
9498
9498
  };
9499
9499
  }
9500
9500
  case "escaped": {
9501
- const s = await Er(t, {
9501
+ const s = await Rr(t, {
9502
9502
  ...o,
9503
9503
  altBoundary: !0
9504
9504
  }), i = ec(s, n.floating);
@@ -9515,12 +9515,12 @@ const Yw = function(e) {
9515
9515
  }
9516
9516
  };
9517
9517
  }, md = /* @__PURE__ */ new Set(["left", "top"]);
9518
- async function Xw(e, t) {
9518
+ async function qw(e, t) {
9519
9519
  const {
9520
9520
  placement: n,
9521
9521
  platform: r,
9522
9522
  elements: o
9523
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = on(n), a = sr(n), c = Xt(n) === "y", u = md.has(i) ? -1 : 1, d = s && c ? -1 : 1, h = rn(t, e);
9523
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = on(n), a = sr(n), c = qt(n) === "y", u = md.has(i) ? -1 : 1, d = s && c ? -1 : 1, h = rn(t, e);
9524
9524
  let {
9525
9525
  mainAxis: p,
9526
9526
  crossAxis: x,
@@ -9542,7 +9542,7 @@ async function Xw(e, t) {
9542
9542
  y: x * d
9543
9543
  };
9544
9544
  }
9545
- const qw = function(e) {
9545
+ const Xw = function(e) {
9546
9546
  return e === void 0 && (e = 0), {
9547
9547
  name: "offset",
9548
9548
  options: e,
@@ -9553,7 +9553,7 @@ const qw = function(e) {
9553
9553
  y: s,
9554
9554
  placement: i,
9555
9555
  middlewareData: a
9556
- } = t, c = await Xw(t, e);
9556
+ } = t, c = await qw(t, e);
9557
9557
  return i === ((n = a.offset) == null ? void 0 : n.placement) && (r = a.arrow) != null && r.alignmentOffset ? {} : {
9558
9558
  x: o + c.x,
9559
9559
  y: s + c.y,
@@ -9592,7 +9592,7 @@ const qw = function(e) {
9592
9592
  } = rn(e, t), u = {
9593
9593
  x: n,
9594
9594
  y: r
9595
- }, d = await Er(t, c), h = Xt(on(o)), p = aa(h);
9595
+ }, d = await Rr(t, c), h = qt(on(o)), p = aa(h);
9596
9596
  let x = u[p], g = u[h];
9597
9597
  if (s) {
9598
9598
  const m = p === "y" ? "top" : "left", b = p === "y" ? "bottom" : "right", w = x + d[m], y = x - d[b];
@@ -9637,7 +9637,7 @@ const qw = function(e) {
9637
9637
  } = rn(e, t), d = {
9638
9638
  x: n,
9639
9639
  y: r
9640
- }, h = Xt(o), p = aa(h);
9640
+ }, h = qt(o), p = aa(h);
9641
9641
  let x = d[p], g = d[h];
9642
9642
  const v = rn(a, t), m = typeof v == "number" ? {
9643
9643
  mainAxis: v,
@@ -9648,12 +9648,12 @@ const qw = function(e) {
9648
9648
  ...v
9649
9649
  };
9650
9650
  if (c) {
9651
- const y = p === "y" ? "height" : "width", E = s.reference[p] - s.floating[y] + m.mainAxis, S = s.reference[p] + s.reference[y] - m.mainAxis;
9652
- x < E ? x = E : x > S && (x = S);
9651
+ const y = p === "y" ? "height" : "width", R = s.reference[p] - s.floating[y] + m.mainAxis, S = s.reference[p] + s.reference[y] - m.mainAxis;
9652
+ x < R ? x = R : x > S && (x = S);
9653
9653
  }
9654
9654
  if (u) {
9655
9655
  var b, w;
9656
- const y = p === "y" ? "width" : "height", E = md.has(on(o)), S = s.reference[h] - s.floating[y] + (E && ((b = i.offset) == null ? void 0 : b[h]) || 0) + (E ? 0 : m.crossAxis), C = s.reference[h] + s.reference[y] + (E ? 0 : ((w = i.offset) == null ? void 0 : w[h]) || 0) - (E ? m.crossAxis : 0);
9656
+ const y = p === "y" ? "width" : "height", R = md.has(on(o)), S = s.reference[h] - s.floating[y] + (R && ((b = i.offset) == null ? void 0 : b[h]) || 0) + (R ? 0 : m.crossAxis), C = s.reference[h] + s.reference[y] + (R ? 0 : ((w = i.offset) == null ? void 0 : w[h]) || 0) - (R ? m.crossAxis : 0);
9657
9657
  g < S ? g = S : g > C && (g = C);
9658
9658
  }
9659
9659
  return {
@@ -9677,22 +9677,22 @@ const qw = function(e) {
9677
9677
  apply: c = () => {
9678
9678
  },
9679
9679
  ...u
9680
- } = rn(e, t), d = await Er(t, u), h = on(o), p = sr(o), x = Xt(o) === "y", {
9680
+ } = rn(e, t), d = await Rr(t, u), h = on(o), p = sr(o), x = qt(o) === "y", {
9681
9681
  width: g,
9682
9682
  height: v
9683
9683
  } = s.floating;
9684
9684
  let m, b;
9685
9685
  h === "top" || h === "bottom" ? (m = h, b = p === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (b = h, m = p === "end" ? "top" : "bottom");
9686
- const w = v - d.top - d.bottom, y = g - d.left - d.right, E = dn(v - d[m], w), S = dn(g - d[b], y), C = !t.middlewareData.shift;
9687
- let R = E, I = S;
9688
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = y), (r = t.middlewareData.shift) != null && r.enabled.y && (R = w), C && !p) {
9686
+ const w = v - d.top - d.bottom, y = g - d.left - d.right, R = dn(v - d[m], w), S = dn(g - d[b], y), C = !t.middlewareData.shift;
9687
+ let E = R, I = S;
9688
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = y), (r = t.middlewareData.shift) != null && r.enabled.y && (E = w), C && !p) {
9689
9689
  const k = wt(d.left, 0), M = wt(d.right, 0), W = wt(d.top, 0), G = wt(d.bottom, 0);
9690
- x ? I = g - 2 * (k !== 0 || M !== 0 ? k + M : wt(d.left, d.right)) : R = v - 2 * (W !== 0 || G !== 0 ? W + G : wt(d.top, d.bottom));
9690
+ x ? I = g - 2 * (k !== 0 || M !== 0 ? k + M : wt(d.left, d.right)) : E = v - 2 * (W !== 0 || G !== 0 ? W + G : wt(d.top, d.bottom));
9691
9691
  }
9692
9692
  await c({
9693
9693
  ...t,
9694
9694
  availableWidth: I,
9695
- availableHeight: R
9695
+ availableHeight: E
9696
9696
  });
9697
9697
  const A = await i.getDimensions(a.floating);
9698
9698
  return g !== A.width || v !== A.height ? {
@@ -9833,7 +9833,7 @@ function fa(e) {
9833
9833
  function Kn(e) {
9834
9834
  const t = fa(e);
9835
9835
  if (!Jt(t))
9836
- return qt(1);
9836
+ return Xt(1);
9837
9837
  const n = t.getBoundingClientRect(), {
9838
9838
  width: r,
9839
9839
  height: o,
@@ -9845,7 +9845,7 @@ function Kn(e) {
9845
9845
  y: a
9846
9846
  };
9847
9847
  }
9848
- const cy = /* @__PURE__ */ qt(0);
9848
+ const cy = /* @__PURE__ */ Xt(0);
9849
9849
  function bd(e) {
9850
9850
  const t = Ct(e);
9851
9851
  return !da() || !t.visualViewport ? cy : {
@@ -9859,16 +9859,16 @@ function uy(e, t, n) {
9859
9859
  function jn(e, t, n, r) {
9860
9860
  t === void 0 && (t = !1), n === void 0 && (n = !1);
9861
9861
  const o = e.getBoundingClientRect(), s = fa(e);
9862
- let i = qt(1);
9862
+ let i = Xt(1);
9863
9863
  t && (r ? Ht(r) && (i = Kn(r)) : i = Kn(e));
9864
- const a = uy(s, n, r) ? bd(s) : qt(0);
9864
+ const a = uy(s, n, r) ? bd(s) : Xt(0);
9865
9865
  let c = (o.left + a.x) / i.x, u = (o.top + a.y) / i.y, d = o.width / i.x, h = o.height / i.y;
9866
9866
  if (s) {
9867
9867
  const p = Ct(s), x = r && Ht(r) ? Ct(r) : r;
9868
9868
  let g = p, v = xi(g);
9869
9869
  for (; v && r && x !== g; ) {
9870
- const m = Kn(v), b = v.getBoundingClientRect(), w = $t(v), y = b.left + (v.clientLeft + parseFloat(w.paddingLeft)) * m.x, E = b.top + (v.clientTop + parseFloat(w.paddingTop)) * m.y;
9871
- c *= m.x, u *= m.y, d *= m.x, h *= m.y, c += y, u += E, g = Ct(v), v = xi(g);
9870
+ const m = Kn(v), b = v.getBoundingClientRect(), w = $t(v), y = b.left + (v.clientLeft + parseFloat(w.paddingLeft)) * m.x, R = b.top + (v.clientTop + parseFloat(w.paddingTop)) * m.y;
9871
+ c *= m.x, u *= m.y, d *= m.x, h *= m.y, c += y, u += R, g = Ct(v), v = xi(g);
9872
9872
  }
9873
9873
  }
9874
9874
  return Po({
@@ -9902,13 +9902,13 @@ function dy(e) {
9902
9902
  let c = {
9903
9903
  scrollLeft: 0,
9904
9904
  scrollTop: 0
9905
- }, u = qt(1);
9906
- const d = qt(0), h = Jt(r);
9905
+ }, u = Xt(1);
9906
+ const d = Xt(0), h = Jt(r);
9907
9907
  if ((h || !h && !s) && ((ir(r) !== "body" || $r(i)) && (c = ls(r)), Jt(r))) {
9908
9908
  const x = jn(r);
9909
9909
  u = Kn(r), d.x = x.x + r.clientLeft, d.y = x.y + r.clientTop;
9910
9910
  }
9911
- const p = i && !h && !s ? wd(i, c) : qt(0);
9911
+ const p = i && !h && !s ? wd(i, c) : Xt(0);
9912
9912
  return {
9913
9913
  width: n.width * u.x,
9914
9914
  height: n.height * u.y,
@@ -9953,7 +9953,7 @@ function py(e, t) {
9953
9953
  }
9954
9954
  const my = /* @__PURE__ */ new Set(["absolute", "fixed"]);
9955
9955
  function gy(e, t) {
9956
- const n = jn(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = Jt(e) ? Kn(e) : qt(1), i = e.clientWidth * s.x, a = e.clientHeight * s.y, c = o * s.x, u = r * s.y;
9956
+ const n = jn(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = Jt(e) ? Kn(e) : Xt(1), i = e.clientWidth * s.x, a = e.clientHeight * s.y, c = o * s.x, u = r * s.y;
9957
9957
  return {
9958
9958
  width: i,
9959
9959
  height: a,
@@ -10031,7 +10031,7 @@ function wy(e, t, n) {
10031
10031
  scrollLeft: 0,
10032
10032
  scrollTop: 0
10033
10033
  };
10034
- const c = qt(0);
10034
+ const c = Xt(0);
10035
10035
  function u() {
10036
10036
  c.x = cs(o);
10037
10037
  }
@@ -10041,7 +10041,7 @@ function wy(e, t, n) {
10041
10041
  c.x = x.x + t.clientLeft, c.y = x.y + t.clientTop;
10042
10042
  } else o && u();
10043
10043
  s && !r && o && u();
10044
- const d = o && !r && !s ? wd(o, a) : qt(0), h = i.left + a.scrollLeft - c.x - d.x, p = i.top + a.scrollTop - c.y - d.y;
10044
+ const d = o && !r && !s ? wd(o, a) : Xt(0), h = i.left + a.scrollLeft - c.x - d.x, p = i.top + a.scrollTop - c.y - d.y;
10045
10045
  return {
10046
10046
  x: h,
10047
10047
  y: p,
@@ -10129,17 +10129,17 @@ function Ty(e, t) {
10129
10129
  rootMargin: -g + "px " + -v + "px " + -m + "px " + -b + "px",
10130
10130
  threshold: wt(0, dn(1, c)) || 1
10131
10131
  };
10132
- let E = !0;
10132
+ let R = !0;
10133
10133
  function S(C) {
10134
- const R = C[0].intersectionRatio;
10135
- if (R !== c) {
10136
- if (!E)
10134
+ const E = C[0].intersectionRatio;
10135
+ if (E !== c) {
10136
+ if (!R)
10137
10137
  return i();
10138
- R ? i(!1, R) : r = setTimeout(() => {
10138
+ E ? i(!1, E) : r = setTimeout(() => {
10139
10139
  i(!1, 1e-7);
10140
10140
  }, 1e3);
10141
10141
  }
10142
- R === 1 && !Cd(u, e.getBoundingClientRect()) && i(), E = !1;
10142
+ E === 1 && !Cd(u, e.getBoundingClientRect()) && i(), R = !1;
10143
10143
  }
10144
10144
  try {
10145
10145
  n = new IntersectionObserver(S, {
@@ -10154,7 +10154,7 @@ function Ty(e, t) {
10154
10154
  }
10155
10155
  return i(!0), s;
10156
10156
  }
10157
- function Ry(e, t, n, r) {
10157
+ function Ey(e, t, n, r) {
10158
10158
  r === void 0 && (r = {});
10159
10159
  const {
10160
10160
  ancestorScroll: o = !0,
@@ -10190,7 +10190,7 @@ function Ry(e, t, n, r) {
10190
10190
  }), h == null || h(), (b = x) == null || b.disconnect(), x = null, c && cancelAnimationFrame(g);
10191
10191
  };
10192
10192
  }
10193
- const Ey = qw, Iy = Jw, Ny = Kw, jy = Qw, Ay = Yw, ic = Gw, ky = Zw, Py = (e, t, n) => {
10193
+ const Ry = Xw, Iy = Jw, Ny = Kw, jy = Qw, Ay = Yw, ic = Gw, ky = Zw, Py = (e, t, n) => {
10194
10194
  const r = /* @__PURE__ */ new Map(), o = {
10195
10195
  platform: Cy,
10196
10196
  ...n
@@ -10274,16 +10274,16 @@ function My(e) {
10274
10274
  const [g, v] = f.useState(null), [m, b] = f.useState(null), w = f.useCallback((O) => {
10275
10275
  O !== C.current && (C.current = O, v(O));
10276
10276
  }, []), y = f.useCallback((O) => {
10277
- O !== R.current && (R.current = O, b(O));
10278
- }, []), E = s || g, S = i || m, C = f.useRef(null), R = f.useRef(null), I = f.useRef(d), A = c != null, k = Gs(c), M = Gs(o), W = Gs(u), G = f.useCallback(() => {
10279
- if (!C.current || !R.current)
10277
+ O !== E.current && (E.current = O, b(O));
10278
+ }, []), R = s || g, S = i || m, C = f.useRef(null), E = f.useRef(null), I = f.useRef(d), A = c != null, k = Gs(c), M = Gs(o), W = Gs(u), G = f.useCallback(() => {
10279
+ if (!C.current || !E.current)
10280
10280
  return;
10281
10281
  const O = {
10282
10282
  placement: t,
10283
10283
  strategy: n,
10284
10284
  middleware: p
10285
10285
  };
10286
- M.current && (O.platform = M.current), Py(C.current, R.current, O).then((_) => {
10286
+ M.current && (O.platform = M.current), Py(C.current, E.current, O).then((_) => {
10287
10287
  const z = {
10288
10288
  ..._,
10289
10289
  // The floating element's position may be recomputed while it's closed
@@ -10307,21 +10307,21 @@ function My(e) {
10307
10307
  go(() => (N.current = !0, () => {
10308
10308
  N.current = !1;
10309
10309
  }), []), go(() => {
10310
- if (E && (C.current = E), S && (R.current = S), E && S) {
10310
+ if (R && (C.current = R), S && (E.current = S), R && S) {
10311
10311
  if (k.current)
10312
- return k.current(E, S, G);
10312
+ return k.current(R, S, G);
10313
10313
  G();
10314
10314
  }
10315
- }, [E, S, G, k, A]);
10315
+ }, [R, S, G, k, A]);
10316
10316
  const $ = f.useMemo(() => ({
10317
10317
  reference: C,
10318
- floating: R,
10318
+ floating: E,
10319
10319
  setReference: w,
10320
10320
  setFloating: y
10321
10321
  }), [w, y]), L = f.useMemo(() => ({
10322
- reference: E,
10322
+ reference: R,
10323
10323
  floating: S
10324
- }), [E, S]), X = f.useMemo(() => {
10324
+ }), [R, S]), q = f.useMemo(() => {
10325
10325
  const O = {
10326
10326
  position: n,
10327
10327
  left: 0,
@@ -10347,8 +10347,8 @@ function My(e) {
10347
10347
  update: G,
10348
10348
  refs: $,
10349
10349
  elements: L,
10350
- floatingStyles: X
10351
- }), [d, G, $, L, X]);
10350
+ floatingStyles: q
10351
+ }), [d, G, $, L, q]);
10352
10352
  }
10353
10353
  const Dy = (e) => {
10354
10354
  function t(n) {
@@ -10372,7 +10372,7 @@ const Dy = (e) => {
10372
10372
  }
10373
10373
  };
10374
10374
  }, Ly = (e, t) => ({
10375
- ...Ey(e),
10375
+ ...Ry(e),
10376
10376
  options: [e, t]
10377
10377
  }), Fy = (e, t) => ({
10378
10378
  ...Iy(e),
@@ -10393,7 +10393,7 @@ const Dy = (e) => {
10393
10393
  ...Dy(e),
10394
10394
  options: [e, t]
10395
10395
  });
10396
- var Wy = "Arrow", Rd = f.forwardRef((e, t) => {
10396
+ var Wy = "Arrow", Ed = f.forwardRef((e, t) => {
10397
10397
  const { children: n, width: r = 10, height: o = 5, ...s } = e;
10398
10398
  return /* @__PURE__ */ l.jsx(
10399
10399
  me.svg,
@@ -10408,9 +10408,9 @@ var Wy = "Arrow", Rd = f.forwardRef((e, t) => {
10408
10408
  }
10409
10409
  );
10410
10410
  });
10411
- Rd.displayName = Wy;
10412
- var Vy = Rd;
10413
- function Ed(e) {
10411
+ Ed.displayName = Wy;
10412
+ var Vy = Ed;
10413
+ function Rd(e) {
10414
10414
  const [t, n] = f.useState(void 0);
10415
10415
  return tt(() => {
10416
10416
  if (e) {
@@ -10465,16 +10465,16 @@ var pa = "PopperContent", [Ky, Yy] = Id(pa), Pd = f.forwardRef(
10465
10465
  updatePositionStrategy: x = "optimized",
10466
10466
  onPlaced: g,
10467
10467
  ...v
10468
- } = e, m = Nd(pa, n), [b, w] = f.useState(null), y = Te(t, (Pe) => w(Pe)), [E, S] = f.useState(null), C = Ed(E), R = (C == null ? void 0 : C.width) ?? 0, I = (C == null ? void 0 : C.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), k = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, M = Array.isArray(u) ? u : [u], W = M.length > 0, G = {
10468
+ } = e, m = Nd(pa, n), [b, w] = f.useState(null), y = Te(t, (Pe) => w(Pe)), [R, S] = f.useState(null), C = Rd(R), E = (C == null ? void 0 : C.width) ?? 0, I = (C == null ? void 0 : C.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), k = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, M = Array.isArray(u) ? u : [u], W = M.length > 0, G = {
10469
10469
  padding: k,
10470
- boundary: M.filter(qy),
10470
+ boundary: M.filter(Xy),
10471
10471
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
10472
10472
  altBoundary: W
10473
- }, { refs: N, floatingStyles: $, placement: L, isPositioned: X, middlewareData: O } = My({
10473
+ }, { refs: N, floatingStyles: $, placement: L, isPositioned: q, middlewareData: O } = My({
10474
10474
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
10475
10475
  strategy: "fixed",
10476
10476
  placement: A,
10477
- whileElementsMounted: (...Pe) => Ry(...Pe, {
10477
+ whileElementsMounted: (...Pe) => Ey(...Pe, {
10478
10478
  animationFrame: x === "always"
10479
10479
  }),
10480
10480
  elements: {
@@ -10496,14 +10496,14 @@ var pa = "PopperContent", [Ky, Yy] = Id(pa), Pd = f.forwardRef(
10496
10496
  H.setProperty("--radix-popper-available-width", `${Le}px`), H.setProperty("--radix-popper-available-height", `${ce}px`), H.setProperty("--radix-popper-anchor-width", `${Ae}px`), H.setProperty("--radix-popper-anchor-height", `${ve}px`);
10497
10497
  }
10498
10498
  }),
10499
- E && Uy({ element: E, padding: a }),
10500
- Jy({ arrowWidth: R, arrowHeight: I }),
10499
+ R && Uy({ element: R, padding: a }),
10500
+ Jy({ arrowWidth: E, arrowHeight: I }),
10501
10501
  p && zy({ strategy: "referenceHidden", ...G })
10502
10502
  ]
10503
- }), [_, z] = Md(L), q = ot(g);
10503
+ }), [_, z] = Md(L), X = ot(g);
10504
10504
  tt(() => {
10505
- X && (q == null || q());
10506
- }, [X, q]);
10505
+ q && (X == null || X());
10506
+ }, [q, X]);
10507
10507
  const oe = (Y = O.arrow) == null ? void 0 : Y.x, F = (P = O.arrow) == null ? void 0 : P.y, Q = ((Z = O.arrow) == null ? void 0 : Z.centerOffset) !== 0, [de, be] = f.useState();
10508
10508
  return tt(() => {
10509
10509
  b && be(window.getComputedStyle(b).zIndex);
@@ -10514,7 +10514,7 @@ var pa = "PopperContent", [Ky, Yy] = Id(pa), Pd = f.forwardRef(
10514
10514
  "data-radix-popper-content-wrapper": "",
10515
10515
  style: {
10516
10516
  ...$,
10517
- transform: X ? $.transform : "translate(0, -200%)",
10517
+ transform: q ? $.transform : "translate(0, -200%)",
10518
10518
  // keep off the page when measuring
10519
10519
  minWidth: "max-content",
10520
10520
  zIndex: de,
@@ -10551,7 +10551,7 @@ var pa = "PopperContent", [Ky, Yy] = Id(pa), Pd = f.forwardRef(
10551
10551
  ...v.style,
10552
10552
  // if the PopperContent hasn't been placed yet (not all measurements done)
10553
10553
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
10554
- animation: X ? void 0 : "none"
10554
+ animation: q ? void 0 : "none"
10555
10555
  }
10556
10556
  }
10557
10557
  )
@@ -10562,13 +10562,13 @@ var pa = "PopperContent", [Ky, Yy] = Id(pa), Pd = f.forwardRef(
10562
10562
  }
10563
10563
  );
10564
10564
  Pd.displayName = pa;
10565
- var _d = "PopperArrow", Xy = {
10565
+ var _d = "PopperArrow", qy = {
10566
10566
  top: "bottom",
10567
10567
  right: "left",
10568
10568
  bottom: "top",
10569
10569
  left: "right"
10570
10570
  }, Od = f.forwardRef(function(t, n) {
10571
- const { __scopePopper: r, ...o } = t, s = Yy(_d, r), i = Xy[s.placedSide];
10571
+ const { __scopePopper: r, ...o } = t, s = Yy(_d, r), i = qy[s.placedSide];
10572
10572
  return (
10573
10573
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
10574
10574
  // doesn't report size as we'd expect on SVG elements.
@@ -10613,7 +10613,7 @@ var _d = "PopperArrow", Xy = {
10613
10613
  );
10614
10614
  });
10615
10615
  Od.displayName = _d;
10616
- function qy(e) {
10616
+ function Xy(e) {
10617
10617
  return e !== null;
10618
10618
  }
10619
10619
  var Jy = (e) => ({
@@ -10654,7 +10654,7 @@ var rS = f.forwardRef((e, t) => {
10654
10654
  defaultProp: a ?? null,
10655
10655
  onChange: c,
10656
10656
  caller: zr
10657
- }), [b, w] = f.useState(!1), y = ot(u), E = Dd(n), S = f.useRef(!1), [C, R] = f.useState(0);
10657
+ }), [b, w] = f.useState(!1), y = ot(u), R = Dd(n), S = f.useRef(!1), [C, E] = f.useState(0);
10658
10658
  return f.useEffect(() => {
10659
10659
  const I = p.current;
10660
10660
  if (I)
@@ -10673,11 +10673,11 @@ var rS = f.forwardRef((e, t) => {
10673
10673
  ),
10674
10674
  onItemShiftTab: f.useCallback(() => w(!0), []),
10675
10675
  onFocusableItemAdd: f.useCallback(
10676
- () => R((I) => I + 1),
10676
+ () => E((I) => I + 1),
10677
10677
  []
10678
10678
  ),
10679
10679
  onFocusableItemRemove: f.useCallback(
10680
- () => R((I) => I - 1),
10680
+ () => E((I) => I - 1),
10681
10681
  []
10682
10682
  ),
10683
10683
  children: /* @__PURE__ */ l.jsx(
@@ -10696,7 +10696,7 @@ var rS = f.forwardRef((e, t) => {
10696
10696
  if (I.target === I.currentTarget && A && !b) {
10697
10697
  const k = new CustomEvent(Ks, Zy);
10698
10698
  if (I.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
10699
- const M = E().filter((L) => L.focusable), W = M.find((L) => L.active), G = M.find((L) => L.id === v), $ = [W, G, ...M].filter(
10699
+ const M = R().filter((L) => L.focusable), W = M.find((L) => L.active), G = M.find((L) => L.id === v), $ = [W, G, ...M].filter(
10700
10700
  Boolean
10701
10701
  ).map((L) => L.ref.current);
10702
10702
  $d($, d);
@@ -10750,12 +10750,12 @@ var rS = f.forwardRef((e, t) => {
10750
10750
  if (b !== void 0) {
10751
10751
  if (m.metaKey || m.ctrlKey || m.altKey || m.shiftKey) return;
10752
10752
  m.preventDefault();
10753
- let y = p().filter((E) => E.focusable).map((E) => E.ref.current);
10753
+ let y = p().filter((R) => R.focusable).map((R) => R.ref.current);
10754
10754
  if (b === "last") y.reverse();
10755
10755
  else if (b === "prev" || b === "next") {
10756
10756
  b === "prev" && y.reverse();
10757
- const E = y.indexOf(m.currentTarget);
10758
- y = d.loop ? aS(y, E + 1) : y.slice(E + 1);
10757
+ const R = y.indexOf(m.currentTarget);
10758
+ y = d.loop ? aS(y, R + 1) : y.slice(R + 1);
10759
10759
  }
10760
10760
  setTimeout(() => $d(y));
10761
10761
  }
@@ -10891,7 +10891,7 @@ var jt = "MenuContent", [wS, ya] = On(jt), Yd = f.forwardRef(
10891
10891
  onDismiss: () => n.onOpenChange(!1)
10892
10892
  }
10893
10893
  );
10894
- }), CS = Xn("MenuContent.ScrollLock"), Sa = f.forwardRef(
10894
+ }), CS = qn("MenuContent.ScrollLock"), Sa = f.forwardRef(
10895
10895
  (e, t) => {
10896
10896
  const {
10897
10897
  __scopeMenu: n,
@@ -10908,17 +10908,17 @@ var jt = "MenuContent", [wS, ya] = On(jt), Yd = f.forwardRef(
10908
10908
  onDismiss: x,
10909
10909
  disableOutsideScroll: g,
10910
10910
  ...v
10911
- } = e, m = Mn(jt, n), b = Wr(jt, n), w = us(n), y = Wd(n), E = pS(n), [S, C] = f.useState(null), R = f.useRef(null), I = Te(t, R, m.onContentChange), A = f.useRef(0), k = f.useRef(""), M = f.useRef(0), W = f.useRef(null), G = f.useRef("right"), N = f.useRef(0), $ = g ? es : f.Fragment, L = g ? { as: CS, allowPinchZoom: !0 } : void 0, X = (_) => {
10911
+ } = e, m = Mn(jt, n), b = Wr(jt, n), w = us(n), y = Wd(n), R = pS(n), [S, C] = f.useState(null), E = f.useRef(null), I = Te(t, E, m.onContentChange), A = f.useRef(0), k = f.useRef(""), M = f.useRef(0), W = f.useRef(null), G = f.useRef("right"), N = f.useRef(0), $ = g ? es : f.Fragment, L = g ? { as: CS, allowPinchZoom: !0 } : void 0, q = (_) => {
10912
10912
  var Y, P;
10913
- const z = k.current + _, q = E().filter((Z) => !Z.disabled), oe = document.activeElement, F = (Y = q.find((Z) => Z.ref.current === oe)) == null ? void 0 : Y.textValue, Q = q.map((Z) => Z.textValue), de = MS(Q, z, F), be = (P = q.find((Z) => Z.textValue === de)) == null ? void 0 : P.ref.current;
10913
+ const z = k.current + _, X = R().filter((Z) => !Z.disabled), oe = document.activeElement, F = (Y = X.find((Z) => Z.ref.current === oe)) == null ? void 0 : Y.textValue, Q = X.map((Z) => Z.textValue), de = MS(Q, z, F), be = (P = X.find((Z) => Z.textValue === de)) == null ? void 0 : P.ref.current;
10914
10914
  (function Z(ne) {
10915
10915
  k.current = ne, window.clearTimeout(A.current), ne !== "" && (A.current = window.setTimeout(() => Z(""), 1e3));
10916
10916
  })(z), be && setTimeout(() => be.focus());
10917
10917
  };
10918
10918
  f.useEffect(() => () => window.clearTimeout(A.current), []), ta();
10919
10919
  const O = f.useCallback((_) => {
10920
- var q, oe;
10921
- return G.current === ((q = W.current) == null ? void 0 : q.side) && LS(_, (oe = W.current) == null ? void 0 : oe.area);
10920
+ var X, oe;
10921
+ return G.current === ((X = W.current) == null ? void 0 : X.side) && LS(_, (oe = W.current) == null ? void 0 : oe.area);
10922
10922
  }, []);
10923
10923
  return /* @__PURE__ */ l.jsx(
10924
10924
  wS,
@@ -10934,7 +10934,7 @@ var jt = "MenuContent", [wS, ya] = On(jt), Yd = f.forwardRef(
10934
10934
  onItemLeave: f.useCallback(
10935
10935
  (_) => {
10936
10936
  var z;
10937
- O(_) || ((z = R.current) == null || z.focus(), C(null));
10937
+ O(_) || ((z = E.current) == null || z.focus(), C(null));
10938
10938
  },
10939
10939
  [O]
10940
10940
  ),
@@ -10955,7 +10955,7 @@ var jt = "MenuContent", [wS, ya] = On(jt), Yd = f.forwardRef(
10955
10955
  trapped: o,
10956
10956
  onMountAutoFocus: ee(s, (_) => {
10957
10957
  var z;
10958
- _.preventDefault(), (z = R.current) == null || z.focus({ preventScroll: !0 });
10958
+ _.preventDefault(), (z = E.current) == null || z.focus({ preventScroll: !0 });
10959
10959
  }),
10960
10960
  onUnmountAutoFocus: i,
10961
10961
  children: /* @__PURE__ */ l.jsx(
@@ -10995,12 +10995,12 @@ var jt = "MenuContent", [wS, ya] = On(jt), Yd = f.forwardRef(
10995
10995
  ref: I,
10996
10996
  style: { outline: "none", ...v.style },
10997
10997
  onKeyDown: ee(v.onKeyDown, (_) => {
10998
- const q = _.target.closest("[data-radix-menu-content]") === _.currentTarget, oe = _.ctrlKey || _.altKey || _.metaKey, F = _.key.length === 1;
10999
- q && (_.key === "Tab" && _.preventDefault(), !oe && F && X(_.key));
11000
- const Q = R.current;
10998
+ const X = _.target.closest("[data-radix-menu-content]") === _.currentTarget, oe = _.ctrlKey || _.altKey || _.metaKey, F = _.key.length === 1;
10999
+ X && (_.key === "Tab" && _.preventDefault(), !oe && F && q(_.key));
11000
+ const Q = E.current;
11001
11001
  if (_.target !== Q || !dS.includes(_.key)) return;
11002
11002
  _.preventDefault();
11003
- const be = E().filter((Y) => !Y.disabled).map((Y) => Y.ref.current);
11003
+ const be = R().filter((Y) => !Y.disabled).map((Y) => Y.ref.current);
11004
11004
  zd.includes(_.key) && be.reverse(), _S(be);
11005
11005
  }),
11006
11006
  onBlur: ee(e.onBlur, (_) => {
@@ -11009,8 +11009,8 @@ var jt = "MenuContent", [wS, ya] = On(jt), Yd = f.forwardRef(
11009
11009
  onPointerMove: ee(
11010
11010
  e.onPointerMove,
11011
11011
  jr((_) => {
11012
- const z = _.target, q = N.current !== _.clientX;
11013
- if (_.currentTarget.contains(z) && q) {
11012
+ const z = _.target, X = N.current !== _.clientX;
11013
+ if (_.currentTarget.contains(z) && X) {
11014
11014
  const oe = _.clientX > N.current ? "right" : "left";
11015
11015
  G.current = oe, N.current = _.clientX;
11016
11016
  }
@@ -11036,24 +11036,24 @@ var TS = "MenuGroup", Ca = f.forwardRef(
11036
11036
  }
11037
11037
  );
11038
11038
  Ca.displayName = TS;
11039
- var RS = "MenuLabel", Xd = f.forwardRef(
11039
+ var ES = "MenuLabel", qd = f.forwardRef(
11040
11040
  (e, t) => {
11041
11041
  const { __scopeMenu: n, ...r } = e;
11042
11042
  return /* @__PURE__ */ l.jsx(me.div, { ...r, ref: t });
11043
11043
  }
11044
11044
  );
11045
- Xd.displayName = RS;
11045
+ qd.displayName = ES;
11046
11046
  var Oo = "MenuItem", lc = "menu.itemSelect", ds = f.forwardRef(
11047
11047
  (e, t) => {
11048
11048
  const { disabled: n = !1, onSelect: r, ...o } = e, s = f.useRef(null), i = Wr(Oo, e.__scopeMenu), a = ya(Oo, e.__scopeMenu), c = Te(t, s), u = f.useRef(!1), d = () => {
11049
11049
  const h = s.current;
11050
11050
  if (!n && h) {
11051
11051
  const p = new CustomEvent(lc, { bubbles: !0, cancelable: !0 });
11052
- h.addEventListener(lc, (x) => r == null ? void 0 : r(x), { once: !0 }), Ru(h, p), p.defaultPrevented ? u.current = !1 : i.onClose();
11052
+ h.addEventListener(lc, (x) => r == null ? void 0 : r(x), { once: !0 }), Eu(h, p), p.defaultPrevented ? u.current = !1 : i.onClose();
11053
11053
  }
11054
11054
  };
11055
11055
  return /* @__PURE__ */ l.jsx(
11056
- qd,
11056
+ Xd,
11057
11057
  {
11058
11058
  ...o,
11059
11059
  ref: c,
@@ -11076,7 +11076,7 @@ var Oo = "MenuItem", lc = "menu.itemSelect", ds = f.forwardRef(
11076
11076
  }
11077
11077
  );
11078
11078
  ds.displayName = Oo;
11079
- var qd = f.forwardRef(
11079
+ var Xd = f.forwardRef(
11080
11080
  (e, t) => {
11081
11081
  const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = ya(Oo, n), a = Wd(n), c = f.useRef(null), u = Te(t, c), [d, h] = f.useState(!1), [p, x] = f.useState("");
11082
11082
  return f.useEffect(() => {
@@ -11114,7 +11114,7 @@ var qd = f.forwardRef(
11114
11114
  }
11115
11115
  );
11116
11116
  }
11117
- ), ES = "MenuCheckboxItem", Jd = f.forwardRef(
11117
+ ), RS = "MenuCheckboxItem", Jd = f.forwardRef(
11118
11118
  (e, t) => {
11119
11119
  const { checked: n = !1, onCheckedChange: r, ...o } = e;
11120
11120
  return /* @__PURE__ */ l.jsx(nf, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ l.jsx(
@@ -11124,7 +11124,7 @@ var qd = f.forwardRef(
11124
11124
  "aria-checked": Mo(n) ? "mixed" : n,
11125
11125
  ...o,
11126
11126
  ref: t,
11127
- "data-state": Ra(n),
11127
+ "data-state": Ea(n),
11128
11128
  onSelect: ee(
11129
11129
  o.onSelect,
11130
11130
  () => r == null ? void 0 : r(Mo(n) ? !0 : !n),
@@ -11134,7 +11134,7 @@ var qd = f.forwardRef(
11134
11134
  ) });
11135
11135
  }
11136
11136
  );
11137
- Jd.displayName = ES;
11137
+ Jd.displayName = RS;
11138
11138
  var Zd = "MenuRadioGroup", [IS, NS] = On(
11139
11139
  Zd,
11140
11140
  { value: void 0, onValueChange: () => {
@@ -11156,7 +11156,7 @@ var ef = "MenuRadioItem", tf = f.forwardRef(
11156
11156
  "aria-checked": s,
11157
11157
  ...r,
11158
11158
  ref: t,
11159
- "data-state": Ra(s),
11159
+ "data-state": Ea(s),
11160
11160
  onSelect: ee(
11161
11161
  r.onSelect,
11162
11162
  () => {
@@ -11185,7 +11185,7 @@ var Ta = "MenuItemIndicator", [nf, jS] = On(
11185
11185
  {
11186
11186
  ...o,
11187
11187
  ref: t,
11188
- "data-state": Ra(s.checked)
11188
+ "data-state": Ea(s.checked)
11189
11189
  }
11190
11190
  )
11191
11191
  }
@@ -11215,7 +11215,7 @@ var kS = "MenuArrow", sf = f.forwardRef(
11215
11215
  }
11216
11216
  );
11217
11217
  sf.displayName = kS;
11218
- var PS = "MenuSub", [eR, af] = On(PS), mr = "MenuSubTrigger", lf = f.forwardRef(
11218
+ var PS = "MenuSub", [eE, af] = On(PS), mr = "MenuSubTrigger", lf = f.forwardRef(
11219
11219
  (e, t) => {
11220
11220
  const n = Mn(mr, e.__scopeMenu), r = Wr(mr, e.__scopeMenu), o = af(mr, e.__scopeMenu), s = ya(mr, e.__scopeMenu), i = f.useRef(null), { pointerGraceTimerRef: a, onPointerGraceIntentChange: c } = s, u = { __scopeMenu: e.__scopeMenu }, d = f.useCallback(() => {
11221
11221
  i.current && window.clearTimeout(i.current), i.current = null;
@@ -11226,7 +11226,7 @@ var PS = "MenuSub", [eR, af] = On(PS), mr = "MenuSubTrigger", lf = f.forwardRef(
11226
11226
  window.clearTimeout(h), c(null);
11227
11227
  };
11228
11228
  }, [a, c]), /* @__PURE__ */ l.jsx(ba, { asChild: !0, ...u, children: /* @__PURE__ */ l.jsx(
11229
- qd,
11229
+ Xd,
11230
11230
  {
11231
11231
  id: o.triggerId,
11232
11232
  "aria-haspopup": "menu",
@@ -11234,7 +11234,7 @@ var PS = "MenuSub", [eR, af] = On(PS), mr = "MenuSubTrigger", lf = f.forwardRef(
11234
11234
  "aria-controls": o.contentId,
11235
11235
  "data-state": df(n.open),
11236
11236
  ...e,
11237
- ref: qi(t, o.onTriggerChange),
11237
+ ref: Xi(t, o.onTriggerChange),
11238
11238
  onClick: (h) => {
11239
11239
  var p;
11240
11240
  (p = e.onClick) == null || p.call(e, h), !(e.disabled || h.defaultPrevented) && (h.currentTarget.focus(), n.open || n.onOpenChange(!0));
@@ -11328,7 +11328,7 @@ function df(e) {
11328
11328
  function Mo(e) {
11329
11329
  return e === "indeterminate";
11330
11330
  }
11331
- function Ra(e) {
11331
+ function Ea(e) {
11332
11332
  return Mo(e) ? "indeterminate" : e ? "checked" : "unchecked";
11333
11333
  }
11334
11334
  function _S(e) {
@@ -11365,7 +11365,7 @@ function LS(e, t) {
11365
11365
  function jr(e) {
11366
11366
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
11367
11367
  }
11368
- var FS = Vd, BS = ba, HS = Kd, $S = Yd, zS = Ca, US = Xd, WS = ds, VS = Jd, GS = Qd, KS = tf, YS = rf, XS = of, qS = sf, JS = lf, ZS = uf, fs = "DropdownMenu", [QS, tR] = Ut(
11368
+ var FS = Vd, BS = ba, HS = Kd, $S = Yd, zS = Ca, US = qd, WS = ds, VS = Jd, GS = Qd, KS = tf, YS = rf, qS = of, XS = sf, JS = lf, ZS = uf, fs = "DropdownMenu", [QS, tE] = Ut(
11369
11369
  fs,
11370
11370
  [Ud]
11371
11371
  ), ht = Ud(), [e0, ff] = QS(fs), hf = (e) => {
@@ -11414,7 +11414,7 @@ var pf = "DropdownMenuTrigger", mf = f.forwardRef(
11414
11414
  "data-disabled": r ? "" : void 0,
11415
11415
  disabled: r,
11416
11416
  ...o,
11417
- ref: qi(t, s.triggerRef),
11417
+ ref: Xi(t, s.triggerRef),
11418
11418
  onPointerDown: ee(e.onPointerDown, (a) => {
11419
11419
  !r && a.button === 0 && a.ctrlKey === !1 && (s.onOpenToggle(), s.open || a.preventDefault());
11420
11420
  }),
@@ -11506,22 +11506,22 @@ var u0 = "DropdownMenuItemIndicator", Cf = f.forwardRef((e, t) => {
11506
11506
  Cf.displayName = u0;
11507
11507
  var d0 = "DropdownMenuSeparator", Tf = f.forwardRef((e, t) => {
11508
11508
  const { __scopeDropdownMenu: n, ...r } = e, o = ht(n);
11509
- return /* @__PURE__ */ l.jsx(XS, { ...o, ...r, ref: t });
11509
+ return /* @__PURE__ */ l.jsx(qS, { ...o, ...r, ref: t });
11510
11510
  });
11511
11511
  Tf.displayName = d0;
11512
11512
  var f0 = "DropdownMenuArrow", h0 = f.forwardRef(
11513
11513
  (e, t) => {
11514
11514
  const { __scopeDropdownMenu: n, ...r } = e, o = ht(n);
11515
- return /* @__PURE__ */ l.jsx(qS, { ...o, ...r, ref: t });
11515
+ return /* @__PURE__ */ l.jsx(XS, { ...o, ...r, ref: t });
11516
11516
  }
11517
11517
  );
11518
11518
  h0.displayName = f0;
11519
- var p0 = "DropdownMenuSubTrigger", Rf = f.forwardRef((e, t) => {
11519
+ var p0 = "DropdownMenuSubTrigger", Ef = f.forwardRef((e, t) => {
11520
11520
  const { __scopeDropdownMenu: n, ...r } = e, o = ht(n);
11521
11521
  return /* @__PURE__ */ l.jsx(JS, { ...o, ...r, ref: t });
11522
11522
  });
11523
- Rf.displayName = p0;
11524
- var m0 = "DropdownMenuSubContent", Ef = f.forwardRef((e, t) => {
11523
+ Ef.displayName = p0;
11524
+ var m0 = "DropdownMenuSubContent", Rf = f.forwardRef((e, t) => {
11525
11525
  const { __scopeDropdownMenu: n, ...r } = e, o = ht(n);
11526
11526
  return /* @__PURE__ */ l.jsx(
11527
11527
  ZS,
@@ -11540,8 +11540,8 @@ var m0 = "DropdownMenuSubContent", Ef = f.forwardRef((e, t) => {
11540
11540
  }
11541
11541
  );
11542
11542
  });
11543
- Ef.displayName = m0;
11544
- var g0 = hf, v0 = mf, x0 = gf, If = xf, Nf = bf, jf = wf, Af = yf, kf = Sf, Pf = Cf, _f = Tf, Of = Rf, Mf = Ef;
11543
+ Rf.displayName = m0;
11544
+ var g0 = hf, v0 = mf, x0 = gf, If = xf, Nf = bf, jf = wf, Af = yf, kf = Sf, Pf = Cf, _f = Tf, Of = Ef, Mf = Rf;
11545
11545
  const b0 = g0, w0 = v0, y0 = f.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ l.jsxs(
11546
11546
  Of,
11547
11547
  {
@@ -11630,7 +11630,7 @@ const T0 = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
11630
11630
  }
11631
11631
  ));
11632
11632
  T0.displayName = kf.displayName;
11633
- const R0 = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ l.jsx(
11633
+ const E0 = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ l.jsx(
11634
11634
  Nf,
11635
11635
  {
11636
11636
  ref: r,
@@ -11642,8 +11642,8 @@ const R0 = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
11642
11642
  ...n
11643
11643
  }
11644
11644
  ));
11645
- R0.displayName = Nf.displayName;
11646
- const E0 = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
11645
+ E0.displayName = Nf.displayName;
11646
+ const R0 = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
11647
11647
  _f,
11648
11648
  {
11649
11649
  ref: n,
@@ -11651,7 +11651,7 @@ const E0 = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
11651
11651
  ...t
11652
11652
  }
11653
11653
  ));
11654
- E0.displayName = _f.displayName;
11654
+ R0.displayName = _f.displayName;
11655
11655
  function vo({
11656
11656
  className: e = "",
11657
11657
  placeholder: t = "Type your message...",
@@ -11675,14 +11675,14 @@ function vo({
11675
11675
  send: b,
11676
11676
  stop: w,
11677
11677
  lastCheckpointId: y,
11678
- listCheckpoints: E,
11678
+ listCheckpoints: R,
11679
11679
  navigateToCheckpoint: S,
11680
11680
  returnToLatest: C,
11681
- hasMoreHistory: R,
11681
+ hasMoreHistory: E,
11682
11682
  isLoadingHistory: I,
11683
11683
  loadOlderMessages: A,
11684
11684
  api: k
11685
- } = Li(), [M, W] = fe(null), [G, N] = fe(""), [$, L] = fe(null), [X, O] = fe([]), [_, z] = fe(!1), [q, oe] = fe(null), [F, Q] = fe(null), [de, be] = fe(!1), [Y, P] = fe(null), [Z, ne] = fe([]), [le, ie] = fe(null);
11685
+ } = Li(), [M, W] = fe(null), [G, N] = fe(""), [$, L] = fe(null), [q, O] = fe([]), [_, z] = fe(!1), [X, oe] = fe(null), [F, Q] = fe(null), [de, be] = fe(!1), [Y, P] = fe(null), [Z, ne] = fe([]), [le, ie] = fe(null);
11686
11686
  bt(null);
11687
11687
  const Pe = bt(null), Fe = bt(null), Le = bt(null), ce = bt(!1), Ae = bt(!0), ve = bt(0), H = bt(null), [ae, Be] = fe("desktop");
11688
11688
  Ve(() => {
@@ -11702,7 +11702,7 @@ function vo({
11702
11702
  checkpointId: y ?? null
11703
11703
  }, Ce = H.current;
11704
11704
  if (!(Ce && Ce.threadId === se.threadId && Ce.checkpointId === se.checkpointId))
11705
- return E(p).then((Ne) => {
11705
+ return R(p).then((Ne) => {
11706
11706
  if (J) return;
11707
11707
  const _t = ((Ne == null ? void 0 : Ne.checkpoints) ?? []).slice().sort((Ot, Ln) => new Date(Ln.createdAt).getTime() - new Date(Ot.createdAt).getTime());
11708
11708
  ne(_t), ie((Ot) => {
@@ -11714,11 +11714,11 @@ function vo({
11714
11714
  }), () => {
11715
11715
  J = !0;
11716
11716
  };
11717
- }, [p, y, E]), Ve(() => {
11717
+ }, [p, y, R]), Ve(() => {
11718
11718
  y && ie(y);
11719
11719
  }, [y]);
11720
11720
  const nt = Ye(async () => {
11721
- if (!R || I) return;
11721
+ if (!E || I) return;
11722
11722
  const J = Le.current;
11723
11723
  if (!J) return;
11724
11724
  const se = J.scrollHeight, Ce = J.scrollTop;
@@ -11740,7 +11740,7 @@ function vo({
11740
11740
  Ae.current = Ot <= 32, ce.current = !1;
11741
11741
  });
11742
11742
  }
11743
- }, [R, I, A]);
11743
+ }, [E, I, A]);
11744
11744
  Ve(() => {
11745
11745
  x.length < ve.current && (Ae.current = !0), ve.current = x.length;
11746
11746
  }, [x.length]), Ve(() => {
@@ -11776,7 +11776,7 @@ function vo({
11776
11776
  }
11777
11777
  }, Qe = async (J) => {
11778
11778
  const se = J.trim();
11779
- if (!(!se && X.length === 0)) {
11779
+ if (!(!se && q.length === 0)) {
11780
11780
  if (se) {
11781
11781
  const Ce = ut(se);
11782
11782
  if (Ce) {
@@ -11785,7 +11785,7 @@ function vo({
11785
11785
  }
11786
11786
  }
11787
11787
  try {
11788
- await b(se, { checkpointId: le || y || void 0, payloadExtras: M ? { edit: !0, originalMessageId: M } : void 0, attachments: X }), u == null || u(se), L(null), O([]), W(null), N("");
11788
+ await b(se, { checkpointId: le || y || void 0, payloadExtras: M ? { edit: !0, originalMessageId: M } : void 0, attachments: q }), u == null || u(se), L(null), O([]), W(null), N("");
11789
11789
  } catch (Ce) {
11790
11790
  const Ne = (Ce == null ? void 0 : Ce.message) || "Failed to send message";
11791
11791
  L(Ne), h == null || h(Ne);
@@ -11953,7 +11953,7 @@ function vo({
11953
11953
  className: "hidden"
11954
11954
  }
11955
11955
  ),
11956
- X.length > 0 && /* @__PURE__ */ l.jsx("div", { className: "flex flex-wrap gap-2", children: X.map((J, se) => /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
11956
+ q.length > 0 && /* @__PURE__ */ l.jsx("div", { className: "flex flex-wrap gap-2", children: q.map((J, se) => /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
11957
11957
  /* @__PURE__ */ l.jsx(Ua, { size: 14 }),
11958
11958
  /* @__PURE__ */ l.jsx("span", { className: "truncate max-w-[150px]", children: J.name }),
11959
11959
  /* @__PURE__ */ l.jsx(
@@ -11985,7 +11985,7 @@ function vo({
11985
11985
  " Uploading Excel file..."
11986
11986
  ] }),
11987
11987
  F && !_ && /* @__PURE__ */ l.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: F }),
11988
- q && !_ && /* @__PURE__ */ l.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: q })
11988
+ X && !_ && /* @__PURE__ */ l.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: X })
11989
11989
  ] })
11990
11990
  ] }),
11991
11991
  $ && /* @__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: $ }),
@@ -12039,7 +12039,7 @@ function vo({
12039
12039
  onSend: Qe,
12040
12040
  onCancelEdit: We,
12041
12041
  onStop: w,
12042
- allowEmptySend: X.length > 0,
12042
+ allowEmptySend: q.length > 0,
12043
12043
  textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${M ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${$ ? "border-red-400" : ""} ${c.textarea || ""}`
12044
12044
  }
12045
12045
  ) })
@@ -12068,7 +12068,7 @@ function Si(e, [t, n]) {
12068
12068
  function I0(e, t) {
12069
12069
  return f.useReducer((n, r) => t[n][r] ?? n, e);
12070
12070
  }
12071
- var Ea = "ScrollArea", [Lf, nR] = Ut(Ea), [N0, kt] = Lf(Ea), Ff = f.forwardRef(
12071
+ var Ra = "ScrollArea", [Lf, nE] = Ut(Ra), [N0, kt] = Lf(Ra), Ff = f.forwardRef(
12072
12072
  (e, t) => {
12073
12073
  const {
12074
12074
  __scopeScrollArea: n,
@@ -12076,7 +12076,7 @@ var Ea = "ScrollArea", [Lf, nR] = Ut(Ea), [N0, kt] = Lf(Ea), Ff = f.forwardRef(
12076
12076
  dir: o,
12077
12077
  scrollHideDelay: s = 600,
12078
12078
  ...i
12079
- } = e, [a, c] = f.useState(null), [u, d] = f.useState(null), [h, p] = f.useState(null), [x, g] = f.useState(null), [v, m] = f.useState(null), [b, w] = f.useState(0), [y, E] = f.useState(0), [S, C] = f.useState(!1), [R, I] = f.useState(!1), A = Te(t, (M) => c(M)), k = ss(o);
12079
+ } = e, [a, c] = f.useState(null), [u, d] = f.useState(null), [h, p] = f.useState(null), [x, g] = f.useState(null), [v, m] = f.useState(null), [b, w] = f.useState(0), [y, R] = f.useState(0), [S, C] = f.useState(!1), [E, I] = f.useState(!1), A = Te(t, (M) => c(M)), k = ss(o);
12080
12080
  return /* @__PURE__ */ l.jsx(
12081
12081
  N0,
12082
12082
  {
@@ -12095,10 +12095,10 @@ var Ea = "ScrollArea", [Lf, nR] = Ut(Ea), [N0, kt] = Lf(Ea), Ff = f.forwardRef(
12095
12095
  onScrollbarXEnabledChange: C,
12096
12096
  scrollbarY: v,
12097
12097
  onScrollbarYChange: m,
12098
- scrollbarYEnabled: R,
12098
+ scrollbarYEnabled: E,
12099
12099
  onScrollbarYEnabledChange: I,
12100
12100
  onCornerWidthChange: w,
12101
- onCornerHeightChange: E,
12101
+ onCornerHeightChange: R,
12102
12102
  children: /* @__PURE__ */ l.jsx(
12103
12103
  me.div,
12104
12104
  {
@@ -12118,7 +12118,7 @@ var Ea = "ScrollArea", [Lf, nR] = Ut(Ea), [N0, kt] = Lf(Ea), Ff = f.forwardRef(
12118
12118
  );
12119
12119
  }
12120
12120
  );
12121
- Ff.displayName = Ea;
12121
+ Ff.displayName = Ra;
12122
12122
  var Bf = "ScrollAreaViewport", Hf = f.forwardRef(
12123
12123
  (e, t) => {
12124
12124
  const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = kt(Bf, n), a = f.useRef(null), c = Te(t, a, i.onViewportChange);
@@ -12398,7 +12398,7 @@ var j0 = f.forwardRef((e, t) => {
12398
12398
  onWheelScroll: d,
12399
12399
  onResize: h,
12400
12400
  ...p
12401
- } = e, x = kt(en, n), [g, v] = f.useState(null), m = Te(t, (A) => v(A)), b = f.useRef(null), w = f.useRef(""), y = x.viewport, E = r.content - r.viewport, S = ot(d), C = ot(c), R = ps(h, 10);
12401
+ } = e, x = kt(en, n), [g, v] = f.useState(null), m = Te(t, (A) => v(A)), b = f.useRef(null), w = f.useRef(""), y = x.viewport, R = r.content - r.viewport, S = ot(d), C = ot(c), E = ps(h, 10);
12402
12402
  function I(A) {
12403
12403
  if (b.current) {
12404
12404
  const k = A.clientX - b.current.left, M = A.clientY - b.current.top;
@@ -12408,10 +12408,10 @@ var j0 = f.forwardRef((e, t) => {
12408
12408
  return f.useEffect(() => {
12409
12409
  const A = (k) => {
12410
12410
  const M = k.target;
12411
- (g == null ? void 0 : g.contains(M)) && S(k, E);
12411
+ (g == null ? void 0 : g.contains(M)) && S(k, R);
12412
12412
  };
12413
12413
  return document.addEventListener("wheel", A, { passive: !1 }), () => document.removeEventListener("wheel", A, { passive: !1 });
12414
- }, [y, g, E, S]), f.useEffect(C, [r, C]), Zn(g, R), Zn(x.content, R), /* @__PURE__ */ l.jsx(
12414
+ }, [y, g, R, S]), f.useEffect(C, [r, C]), Zn(g, E), Zn(x.content, E), /* @__PURE__ */ l.jsx(
12415
12415
  _0,
12416
12416
  {
12417
12417
  scope: n,
@@ -12575,9 +12575,9 @@ function Zn(e, t) {
12575
12575
  }
12576
12576
  }, [e, n]);
12577
12577
  }
12578
- var Xf = Ff, F0 = Hf, B0 = Vf;
12579
- const qf = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ l.jsxs(
12580
- Xf,
12578
+ var qf = Ff, F0 = Hf, B0 = Vf;
12579
+ const Xf = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ l.jsxs(
12580
+ qf,
12581
12581
  {
12582
12582
  ref: r,
12583
12583
  className: D("relative overflow-hidden", e),
@@ -12589,7 +12589,7 @@ const qf = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
12589
12589
  ]
12590
12590
  }
12591
12591
  ));
12592
- qf.displayName = Xf.displayName;
12592
+ Xf.displayName = qf.displayName;
12593
12593
  const Jf = f.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r) => /* @__PURE__ */ l.jsx(
12594
12594
  Ia,
12595
12595
  {
@@ -12627,7 +12627,7 @@ function Ci({
12627
12627
  createThread: v,
12628
12628
  deleteThread: m,
12629
12629
  renameThread: b
12630
- } = Li(), [w, y] = fe(p ?? []), [E, S] = fe(!1), [C, R] = fe(null), [I, A] = fe(null), [k, M] = fe(""), [W, G] = fe(!1);
12630
+ } = Li(), [w, y] = fe(p ?? []), [R, S] = fe(!1), [C, E] = fe(null), [I, A] = fe(null), [k, M] = fe(""), [W, G] = fe(!1);
12631
12631
  Ve(() => {
12632
12632
  y(p ?? []);
12633
12633
  }, [p]);
@@ -12654,7 +12654,7 @@ function Ci({
12654
12654
  } catch (de) {
12655
12655
  console.error("Failed to delete thread:", de);
12656
12656
  }
12657
- }, X = (F, Q) => {
12657
+ }, q = (F, Q) => {
12658
12658
  Q.stopPropagation(), A(F.threadId), M(F.title || `Thread ${F.threadId.slice(0, 8)}`);
12659
12659
  }, O = async (F) => {
12660
12660
  if (k.trim())
@@ -12667,7 +12667,7 @@ function Ci({
12667
12667
  A(null), M("");
12668
12668
  }, z = (F, Q) => {
12669
12669
  F.key === "Enter" ? O(Q) : F.key === "Escape" && _();
12670
- }, q = (F) => {
12670
+ }, X = (F) => {
12671
12671
  if (!F) return "";
12672
12672
  try {
12673
12673
  const Q = new Date(F), be = (/* @__PURE__ */ new Date()).getTime() - Q.getTime(), Y = Math.floor(be / (1e3 * 60 * 60 * 24));
@@ -12681,7 +12681,7 @@ function Ci({
12681
12681
  ke,
12682
12682
  {
12683
12683
  onClick: $,
12684
- disabled: W || E,
12684
+ disabled: W || R,
12685
12685
  className: s.createButton || "p-2",
12686
12686
  size: "sm",
12687
12687
  variant: "ghost",
@@ -12690,11 +12690,11 @@ function Ci({
12690
12690
  }
12691
12691
  ) }),
12692
12692
  /* @__PURE__ */ l.jsx(
12693
- qf,
12693
+ Xf,
12694
12694
  {
12695
12695
  className: `flex-1 min-h-0 ${s.threadList || ""}`,
12696
12696
  style: o ? { maxHeight: o } : void 0,
12697
- children: /* @__PURE__ */ l.jsx("div", { className: "p-2 space-y-1 pb-4", children: E ? /* @__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: [
12697
+ 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: [
12698
12698
  /* @__PURE__ */ l.jsx(Kp, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
12699
12699
  /* @__PURE__ */ l.jsx("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
12700
12700
  ] }) : w.slice().sort((F, Q) => new Date(Q.updatedAt || Q.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ l.jsxs(
@@ -12712,11 +12712,11 @@ function Ci({
12712
12712
  /* @__PURE__ */ l.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: oe(F) }),
12713
12713
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
12714
12714
  /* @__PURE__ */ l.jsx(Yp, { size: 10 }),
12715
- /* @__PURE__ */ l.jsx("span", { children: q(F.updatedAt || F.createdAt) })
12715
+ /* @__PURE__ */ l.jsx("span", { children: X(F.updatedAt || F.createdAt) })
12716
12716
  ] })
12717
12717
  ] }) }),
12718
12718
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
12719
- r && I !== F.threadId && /* @__PURE__ */ l.jsx(ke, { variant: "ghost", size: "sm", onClick: (Q) => X(F, Q), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(xc, { size: 12 }) }),
12719
+ r && I !== F.threadId && /* @__PURE__ */ l.jsx(ke, { variant: "ghost", size: "sm", onClick: (Q) => q(F, Q), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(xc, { size: 12 }) }),
12720
12720
  n && /* @__PURE__ */ l.jsx(
12721
12721
  ke,
12722
12722
  {
@@ -12725,7 +12725,7 @@ function Ci({
12725
12725
  onClick: (Q) => L(F.threadId, Q),
12726
12726
  className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
12727
12727
  title: "Delete thread",
12728
- children: /* @__PURE__ */ l.jsx(Xp, { size: 12 })
12728
+ children: /* @__PURE__ */ l.jsx(qp, { size: 12 })
12729
12729
  }
12730
12730
  )
12731
12731
  ] })
@@ -12740,7 +12740,7 @@ function Ci({
12740
12740
  ] });
12741
12741
  }
12742
12742
  const Zf = pc(null);
12743
- function rR({ children: e, basePath: t = "/chat" }) {
12743
+ function rE({ children: e, basePath: t = "/chat" }) {
12744
12744
  const n = wn(() => t ? t === "/" ? "" : t.endsWith("/") ? t.slice(0, -1) : t : "/chat", [t]), r = {
12745
12745
  basePath: n,
12746
12746
  buildThreadPath: (o) => `${n}/${o}`,
@@ -12748,7 +12748,7 @@ function rR({ children: e, basePath: t = "/chat" }) {
12748
12748
  };
12749
12749
  return /* @__PURE__ */ l.jsx(Zf.Provider, { value: r, children: e });
12750
12750
  }
12751
- function oR() {
12751
+ function oE() {
12752
12752
  const e = mc(Zf);
12753
12753
  return e || {
12754
12754
  basePath: "/chat",
@@ -12792,9 +12792,9 @@ function $0() {
12792
12792
  return t && (e.baseUrl = t), n && (e.apiKey = n), e;
12793
12793
  }
12794
12794
  function z0() {
12795
- const e = $0(), t = En.getAuthToken(), n = Qf();
12795
+ const e = $0(), t = Rn.getAuthToken(), n = Qf();
12796
12796
  return {
12797
- apiBaseUrl: e.baseUrl || En.baseUrl || n || "http://localhost:8000",
12797
+ apiBaseUrl: e.baseUrl || Rn.baseUrl || n || "http://localhost:8000",
12798
12798
  apiKey: t || e.apiKey || eh() || "",
12799
12799
  model: "gpt-4",
12800
12800
  temperature: 0.7,
@@ -12820,24 +12820,24 @@ function U0() {
12820
12820
  }
12821
12821
  function W0(e) {
12822
12822
  try {
12823
- localStorage.setItem(th, JSON.stringify(e)), e.apiKey && En.setAuthToken(e.apiKey);
12823
+ localStorage.setItem(th, JSON.stringify(e)), e.apiKey && Rn.setAuthToken(e.apiKey);
12824
12824
  } catch (t) {
12825
12825
  console.error("Failed to save settings:", t);
12826
12826
  }
12827
12827
  }
12828
- function sR() {
12829
- const e = z0(), t = U0(), n = En.getAuthToken();
12828
+ function sE() {
12829
+ const e = z0(), t = U0(), n = Rn.getAuthToken();
12830
12830
  return {
12831
12831
  ...e,
12832
12832
  ...t,
12833
12833
  // Always use the current token from API client if available
12834
12834
  apiKey: n || t.apiKey || e.apiKey,
12835
12835
  // Always use the current base URL from API client
12836
- apiBaseUrl: En.baseUrl || t.apiBaseUrl || e.apiBaseUrl
12836
+ apiBaseUrl: Rn.baseUrl || t.apiBaseUrl || e.apiBaseUrl
12837
12837
  };
12838
12838
  }
12839
- function iR(e) {
12840
- e.apiKey && En.setAuthToken(e.apiKey), W0(e);
12839
+ function iE(e) {
12840
+ e.apiKey && Rn.setAuthToken(e.apiKey), W0(e);
12841
12841
  }
12842
12842
  const Ys = 768;
12843
12843
  function V0() {
@@ -12883,7 +12883,7 @@ const Aa = f.forwardRef(
12883
12883
  )
12884
12884
  );
12885
12885
  Aa.displayName = rh.displayName;
12886
- const oh = sd, X0 = fw, q0 = id, sh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
12886
+ const oh = sd, q0 = fw, X0 = id, sh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
12887
12887
  ns,
12888
12888
  {
12889
12889
  className: D(
@@ -12910,7 +12910,7 @@ const J0 = Pr(
12910
12910
  side: "right"
12911
12911
  }
12912
12912
  }
12913
- ), ka = f.forwardRef(({ side: e = "right", className: t, children: n, ...r }, o) => /* @__PURE__ */ l.jsxs(q0, { children: [
12913
+ ), ka = f.forwardRef(({ side: e = "right", className: t, children: n, ...r }, o) => /* @__PURE__ */ l.jsxs(X0, { children: [
12914
12914
  /* @__PURE__ */ l.jsx(sh, {}),
12915
12915
  /* @__PURE__ */ l.jsxs(
12916
12916
  rs,
@@ -12996,7 +12996,7 @@ var ch = Object.freeze({
12996
12996
  )
12997
12997
  );
12998
12998
  uh.displayName = Z0;
12999
- var Q0 = uh, [ms, aR] = Ut("Tooltip", [
12999
+ var Q0 = uh, [ms, aE] = Ut("Tooltip", [
13000
13000
  ar
13001
13001
  ]), gs = ar(), dh = "TooltipProvider", eC = 700, Ti = "tooltip.open", [tC, Pa] = ms(dh), fh = (e) => {
13002
13002
  const {
@@ -13046,11 +13046,11 @@ var kr = "Tooltip", [nC, vs] = ms(kr), hh = (e) => {
13046
13046
  } = e, c = Pa(kr, e.__scopeTooltip), u = gs(t), [d, h] = f.useState(null), p = Ft(), x = f.useRef(0), g = i ?? c.disableHoverableContent, v = a ?? c.delayDuration, m = f.useRef(!1), [b, w] = un({
13047
13047
  prop: r,
13048
13048
  defaultProp: o ?? !1,
13049
- onChange: (R) => {
13050
- R ? (c.onOpen(), document.dispatchEvent(new CustomEvent(Ti))) : c.onClose(), s == null || s(R);
13049
+ onChange: (E) => {
13050
+ E ? (c.onOpen(), document.dispatchEvent(new CustomEvent(Ti))) : c.onClose(), s == null || s(E);
13051
13051
  },
13052
13052
  caller: kr
13053
- }), y = f.useMemo(() => b ? m.current ? "delayed-open" : "instant-open" : "closed", [b]), E = f.useCallback(() => {
13053
+ }), y = f.useMemo(() => b ? m.current ? "delayed-open" : "instant-open" : "closed", [b]), R = f.useCallback(() => {
13054
13054
  window.clearTimeout(x.current), x.current = 0, m.current = !1, w(!0);
13055
13055
  }, [w]), S = f.useCallback(() => {
13056
13056
  window.clearTimeout(x.current), x.current = 0, w(!1);
@@ -13071,12 +13071,12 @@ var kr = "Tooltip", [nC, vs] = ms(kr), hh = (e) => {
13071
13071
  trigger: d,
13072
13072
  onTriggerChange: h,
13073
13073
  onTriggerEnter: f.useCallback(() => {
13074
- c.isOpenDelayedRef.current ? C() : E();
13075
- }, [c.isOpenDelayedRef, C, E]),
13074
+ c.isOpenDelayedRef.current ? C() : R();
13075
+ }, [c.isOpenDelayedRef, C, R]),
13076
13076
  onTriggerLeave: f.useCallback(() => {
13077
13077
  g ? S() : (window.clearTimeout(x.current), x.current = 0);
13078
13078
  }, [S, g]),
13079
- onOpen: E,
13079
+ onOpen: R,
13080
13080
  onClose: S,
13081
13081
  disableHoverableContent: g,
13082
13082
  children: n
@@ -13084,9 +13084,9 @@ var kr = "Tooltip", [nC, vs] = ms(kr), hh = (e) => {
13084
13084
  ) });
13085
13085
  };
13086
13086
  hh.displayName = kr;
13087
- var Ri = "TooltipTrigger", ph = f.forwardRef(
13087
+ var Ei = "TooltipTrigger", ph = f.forwardRef(
13088
13088
  (e, t) => {
13089
- const { __scopeTooltip: n, ...r } = e, o = vs(Ri, n), s = Pa(Ri, n), i = gs(n), a = f.useRef(null), c = Te(t, a, o.onTriggerChange), u = f.useRef(!1), d = f.useRef(!1), h = f.useCallback(() => u.current = !1, []);
13089
+ const { __scopeTooltip: n, ...r } = e, o = vs(Ei, n), s = Pa(Ei, n), i = gs(n), a = f.useRef(null), c = Te(t, a, o.onTriggerChange), u = f.useRef(!1), d = f.useRef(!1), h = f.useCallback(() => u.current = !1, []);
13090
13090
  return f.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ l.jsx(ga, { asChild: !0, ...i, children: /* @__PURE__ */ l.jsx(
13091
13091
  me.button,
13092
13092
  {
@@ -13112,8 +13112,8 @@ var Ri = "TooltipTrigger", ph = f.forwardRef(
13112
13112
  ) });
13113
13113
  }
13114
13114
  );
13115
- ph.displayName = Ri;
13116
- var rC = "TooltipPortal", [lR, oC] = ms(rC, {
13115
+ ph.displayName = Ei;
13116
+ var rC = "TooltipPortal", [lE, oC] = ms(rC, {
13117
13117
  forceMount: void 0
13118
13118
  }), Qn = "TooltipContent", mh = f.forwardRef(
13119
13119
  (e, t) => {
@@ -13125,7 +13125,7 @@ var rC = "TooltipPortal", [lR, oC] = ms(rC, {
13125
13125
  a(null), h(!1);
13126
13126
  }, [h]), x = f.useCallback(
13127
13127
  (g, v) => {
13128
- const m = g.currentTarget, b = { x: g.clientX, y: g.clientY }, w = uC(b, m.getBoundingClientRect()), y = dC(b, w), E = fC(v.getBoundingClientRect()), S = pC([...y, ...E]);
13128
+ const m = g.currentTarget, b = { x: g.clientX, y: g.clientY }, w = uC(b, m.getBoundingClientRect()), y = dC(b, w), R = fC(v.getBoundingClientRect()), S = pC([...y, ...R]);
13129
13129
  a(S), h(!0);
13130
13130
  },
13131
13131
  [h]
@@ -13315,7 +13315,7 @@ const bC = gC, wC = vC, yC = xC, bh = f.forwardRef(({ className: e, sideOffset:
13315
13315
  }
13316
13316
  ));
13317
13317
  bh.displayName = xh.displayName;
13318
- const SC = "sidebar:state", CC = 60 * 60 * 24 * 7, TC = "16rem", RC = "18rem", EC = "3rem", IC = "b", wh = f.createContext(null);
13318
+ const SC = "sidebar:state", CC = 60 * 60 * 24 * 7, TC = "16rem", EC = "18rem", RC = "3rem", IC = "b", wh = f.createContext(null);
13319
13319
  function xs() {
13320
13320
  const e = f.useContext(wh);
13321
13321
  if (!e)
@@ -13362,7 +13362,7 @@ const yh = f.forwardRef(
13362
13362
  {
13363
13363
  style: {
13364
13364
  "--sidebar-width": TC,
13365
- "--sidebar-width-icon": EC,
13365
+ "--sidebar-width-icon": RC,
13366
13366
  ...o
13367
13367
  },
13368
13368
  className: D(
@@ -13405,7 +13405,7 @@ const Sh = f.forwardRef(
13405
13405
  "data-mobile": "true",
13406
13406
  className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
13407
13407
  style: {
13408
- "--sidebar-width": RC
13408
+ "--sidebar-width": EC
13409
13409
  },
13410
13410
  side: e,
13411
13411
  children: /* @__PURE__ */ l.jsx("div", { className: "flex h-full w-full flex-col", children: o })
@@ -13473,7 +13473,7 @@ const Ch = f.forwardRef(({ className: e, onClick: t, ...n }, r) => {
13473
13473
  },
13474
13474
  ...n,
13475
13475
  children: [
13476
- /* @__PURE__ */ l.jsx(qp, {}),
13476
+ /* @__PURE__ */ l.jsx(Xp, {}),
13477
13477
  /* @__PURE__ */ l.jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
13478
13478
  ]
13479
13479
  }
@@ -13531,7 +13531,7 @@ const jC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13531
13531
  }
13532
13532
  ));
13533
13533
  jC.displayName = "SidebarInput";
13534
- const Rh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13534
+ const Eh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13535
13535
  "div",
13536
13536
  {
13537
13537
  ref: n,
@@ -13540,7 +13540,7 @@ const Rh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13540
13540
  ...t
13541
13541
  }
13542
13542
  ));
13543
- Rh.displayName = "SidebarHeader";
13543
+ Eh.displayName = "SidebarHeader";
13544
13544
  const AC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13545
13545
  "div",
13546
13546
  {
@@ -13561,7 +13561,7 @@ const kC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13561
13561
  }
13562
13562
  ));
13563
13563
  kC.displayName = "SidebarSeparator";
13564
- const Eh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13564
+ const Rh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13565
13565
  "div",
13566
13566
  {
13567
13567
  ref: n,
@@ -13573,7 +13573,7 @@ const Eh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13573
13573
  ...t
13574
13574
  }
13575
13575
  ));
13576
- Eh.displayName = "SidebarContent";
13576
+ Rh.displayName = "SidebarContent";
13577
13577
  const Ih = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13578
13578
  "div",
13579
13579
  {
@@ -13818,7 +13818,7 @@ const BC = f.forwardRef(({ asChild: e = !1, size: t = "md", isActive: n, classNa
13818
13818
  );
13819
13819
  });
13820
13820
  BC.displayName = "SidebarMenuSubButton";
13821
- function cR({
13821
+ function cE({
13822
13822
  header: e,
13823
13823
  sidebarTitle: t = "Threads",
13824
13824
  showThreads: n = !0,
@@ -13829,8 +13829,8 @@ function cR({
13829
13829
  }) {
13830
13830
  return /* @__PURE__ */ l.jsx(so, { ...i, children: /* @__PURE__ */ l.jsxs(yh, { className: `w-full ${r}`, children: [
13831
13831
  /* @__PURE__ */ l.jsxs(Sh, { className: `border-r ${o}`, children: [
13832
- /* @__PURE__ */ l.jsx(Rh, { children: /* @__PURE__ */ l.jsx(Ah, { children: /* @__PURE__ */ l.jsx(kh, { children: /* @__PURE__ */ l.jsx(Ph, { asChild: !0, size: "lg", children: /* @__PURE__ */ l.jsx("span", { className: "font-semibold", children: t }) }) }) }) }),
13833
- /* @__PURE__ */ l.jsx(Eh, { children: n && /* @__PURE__ */ l.jsxs(Ih, { children: [
13832
+ /* @__PURE__ */ l.jsx(Eh, { children: /* @__PURE__ */ l.jsx(Ah, { children: /* @__PURE__ */ l.jsx(kh, { children: /* @__PURE__ */ l.jsx(Ph, { asChild: !0, size: "lg", children: /* @__PURE__ */ l.jsx("span", { className: "font-semibold", children: t }) }) }) }) }),
13833
+ /* @__PURE__ */ l.jsx(Rh, { children: n && /* @__PURE__ */ l.jsxs(Ih, { children: [
13834
13834
  /* @__PURE__ */ l.jsx(Nh, { children: "Conversations" }),
13835
13835
  /* @__PURE__ */ l.jsx(jh, { children: /* @__PURE__ */ l.jsx("div", { className: "px-2 py-1", children: /* @__PURE__ */ l.jsx(
13836
13836
  Ci,
@@ -13868,7 +13868,7 @@ _h.displayName = HC;
13868
13868
  var Oh = _h;
13869
13869
  const $C = Pr(
13870
13870
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
13871
- ), Et = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13871
+ ), Rt = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13872
13872
  Oh,
13873
13873
  {
13874
13874
  ref: n,
@@ -13876,12 +13876,12 @@ const $C = Pr(
13876
13876
  ...t
13877
13877
  }
13878
13878
  ));
13879
- Et.displayName = Oh.displayName;
13879
+ Rt.displayName = Oh.displayName;
13880
13880
  function Mh(e) {
13881
13881
  const t = f.useRef({ value: e, previous: e });
13882
13882
  return f.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
13883
13883
  }
13884
- var bs = "Switch", [zC, uR] = Ut(bs), [UC, WC] = zC(bs), Dh = f.forwardRef(
13884
+ var bs = "Switch", [zC, uE] = Ut(bs), [UC, WC] = zC(bs), Dh = f.forwardRef(
13885
13885
  (e, t) => {
13886
13886
  const {
13887
13887
  __scopeSwitch: n,
@@ -13915,7 +13915,7 @@ var bs = "Switch", [zC, uR] = Ut(bs), [UC, WC] = zC(bs), Dh = f.forwardRef(
13915
13915
  ...h,
13916
13916
  ref: g,
13917
13917
  onClick: ee(e.onClick, (y) => {
13918
- w((E) => !E), m && (v.current = y.isPropagationStopped(), v.current || y.stopPropagation());
13918
+ w((R) => !R), m && (v.current = y.isPropagationStopped(), v.current || y.stopPropagation());
13919
13919
  })
13920
13920
  }
13921
13921
  ),
@@ -13960,7 +13960,7 @@ var VC = "SwitchBubbleInput", Bh = f.forwardRef(
13960
13960
  bubbles: r = !0,
13961
13961
  ...o
13962
13962
  }, s) => {
13963
- const i = f.useRef(null), a = Te(i, s), c = Mh(n), u = Ed(t);
13963
+ const i = f.useRef(null), a = Te(i, s), c = Mh(n), u = Rd(t);
13964
13964
  return f.useEffect(() => {
13965
13965
  const d = i.current;
13966
13966
  if (!d) return;
@@ -14018,10 +14018,10 @@ const an = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
14018
14018
  }
14019
14019
  ));
14020
14020
  an.displayName = $h.displayName;
14021
- var KC = [" ", "Enter", "ArrowUp", "ArrowDown"], YC = [" ", "Enter"], An = "Select", [ws, ys, XC] = ia(An), [lr, dR] = Ut(An, [
14022
- XC,
14021
+ var KC = [" ", "Enter", "ArrowUp", "ArrowDown"], YC = [" ", "Enter"], An = "Select", [ws, ys, qC] = ia(An), [lr, dE] = Ut(An, [
14022
+ qC,
14023
14023
  ar
14024
- ]), Ss = ar(), [qC, gn] = lr(An), [JC, ZC] = lr(An), zh = (e) => {
14024
+ ]), Ss = ar(), [XC, gn] = lr(An), [JC, ZC] = lr(An), zh = (e) => {
14025
14025
  const {
14026
14026
  __scopeSelect: t,
14027
14027
  children: n,
@@ -14037,7 +14037,7 @@ var KC = [" ", "Enter", "ArrowUp", "ArrowDown"], YC = [" ", "Enter"], An = "Sele
14037
14037
  disabled: p,
14038
14038
  required: x,
14039
14039
  form: g
14040
- } = e, v = Ss(t), [m, b] = f.useState(null), [w, y] = f.useState(null), [E, S] = f.useState(!1), C = ss(u), [R, I] = un({
14040
+ } = e, v = Ss(t), [m, b] = f.useState(null), [w, y] = f.useState(null), [R, S] = f.useState(!1), C = ss(u), [E, I] = un({
14041
14041
  prop: r,
14042
14042
  defaultProp: o ?? !1,
14043
14043
  onChange: s,
@@ -14049,7 +14049,7 @@ var KC = [" ", "Enter", "ArrowUp", "ArrowDown"], YC = [" ", "Enter"], An = "Sele
14049
14049
  caller: An
14050
14050
  }), M = f.useRef(null), W = m ? g || !!m.closest("form") : !0, [G, N] = f.useState(/* @__PURE__ */ new Set()), $ = Array.from(G).map((L) => L.props.value).join(";");
14051
14051
  return /* @__PURE__ */ l.jsx(ma, { ...v, children: /* @__PURE__ */ l.jsxs(
14052
- qC,
14052
+ XC,
14053
14053
  {
14054
14054
  required: x,
14055
14055
  scope: t,
@@ -14057,12 +14057,12 @@ var KC = [" ", "Enter", "ArrowUp", "ArrowDown"], YC = [" ", "Enter"], An = "Sele
14057
14057
  onTriggerChange: b,
14058
14058
  valueNode: w,
14059
14059
  onValueNodeChange: y,
14060
- valueNodeHasChildren: E,
14060
+ valueNodeHasChildren: R,
14061
14061
  onValueNodeHasChildrenChange: S,
14062
14062
  contentId: Ft(),
14063
14063
  value: A,
14064
14064
  onValueChange: k,
14065
- open: R,
14065
+ open: E,
14066
14066
  onOpenChange: I,
14067
14067
  dir: C,
14068
14068
  triggerPointerDownPosRef: M,
@@ -14073,11 +14073,11 @@ var KC = [" ", "Enter", "ArrowUp", "ArrowDown"], YC = [" ", "Enter"], An = "Sele
14073
14073
  {
14074
14074
  scope: e.__scopeSelect,
14075
14075
  onNativeOptionAdd: f.useCallback((L) => {
14076
- N((X) => new Set(X).add(L));
14076
+ N((q) => new Set(q).add(L));
14077
14077
  }, []),
14078
14078
  onNativeOptionRemove: f.useCallback((L) => {
14079
- N((X) => {
14080
- const O = new Set(X);
14079
+ N((q) => {
14080
+ const O = new Set(q);
14081
14081
  return O.delete(L), O;
14082
14082
  });
14083
14083
  }, []),
@@ -14178,7 +14178,7 @@ var QC = "SelectIcon", Kh = f.forwardRef(
14178
14178
  Kh.displayName = QC;
14179
14179
  var eT = "SelectPortal", Yh = (e) => /* @__PURE__ */ l.jsx(Zo, { asChild: !0, ...e });
14180
14180
  Yh.displayName = eT;
14181
- var kn = "SelectContent", Xh = f.forwardRef(
14181
+ var kn = "SelectContent", qh = f.forwardRef(
14182
14182
  (e, t) => {
14183
14183
  const n = gn(kn, e.__scopeSelect), [r, o] = f.useState();
14184
14184
  if (tt(() => {
@@ -14186,15 +14186,15 @@ var kn = "SelectContent", Xh = f.forwardRef(
14186
14186
  }, []), !n.open) {
14187
14187
  const s = r;
14188
14188
  return s ? Bo.createPortal(
14189
- /* @__PURE__ */ l.jsx(qh, { scope: e.__scopeSelect, children: /* @__PURE__ */ l.jsx(ws.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ l.jsx("div", { children: e.children }) }) }),
14189
+ /* @__PURE__ */ l.jsx(Xh, { scope: e.__scopeSelect, children: /* @__PURE__ */ l.jsx(ws.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ l.jsx("div", { children: e.children }) }) }),
14190
14190
  s
14191
14191
  ) : null;
14192
14192
  }
14193
14193
  return /* @__PURE__ */ l.jsx(Jh, { ...e, ref: t });
14194
14194
  }
14195
14195
  );
14196
- Xh.displayName = kn;
14197
- var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent.RemoveScroll"), Jh = f.forwardRef(
14196
+ qh.displayName = kn;
14197
+ var Dt = 10, [Xh, vn] = lr(kn), tT = "SelectContentImpl", nT = qn("SelectContent.RemoveScroll"), Jh = f.forwardRef(
14198
14198
  (e, t) => {
14199
14199
  const {
14200
14200
  __scopeSelect: n,
@@ -14216,7 +14216,7 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14216
14216
  avoidCollisions: m,
14217
14217
  //
14218
14218
  ...b
14219
- } = e, w = gn(kn, n), [y, E] = f.useState(null), [S, C] = f.useState(null), R = Te(t, (Y) => E(Y)), [I, A] = f.useState(null), [k, M] = f.useState(
14219
+ } = e, w = gn(kn, n), [y, R] = f.useState(null), [S, C] = f.useState(null), E = Te(t, (Y) => R(Y)), [I, A] = f.useState(null), [k, M] = f.useState(
14220
14220
  null
14221
14221
  ), W = ys(n), [G, N] = f.useState(!1), $ = f.useRef(!1);
14222
14222
  f.useEffect(() => {
@@ -14229,13 +14229,13 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14229
14229
  if (ie === le || (ie == null || ie.scrollIntoView({ block: "nearest" }), ie === P && S && (S.scrollTop = 0), ie === ne && S && (S.scrollTop = S.scrollHeight), ie == null || ie.focus(), document.activeElement !== le)) return;
14230
14230
  },
14231
14231
  [W, S]
14232
- ), X = f.useCallback(
14232
+ ), q = f.useCallback(
14233
14233
  () => L([I, y]),
14234
14234
  [L, I, y]
14235
14235
  );
14236
14236
  f.useEffect(() => {
14237
- G && X();
14238
- }, [G, X]);
14237
+ G && q();
14238
+ }, [G, q]);
14239
14239
  const { onOpenChange: O, triggerPointerDownPosRef: _ } = w;
14240
14240
  f.useEffect(() => {
14241
14241
  if (y) {
@@ -14259,7 +14259,7 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14259
14259
  window.removeEventListener("blur", Y), window.removeEventListener("resize", Y);
14260
14260
  };
14261
14261
  }, [O]);
14262
- const [z, q] = pp((Y) => {
14262
+ const [z, X] = pp((Y) => {
14263
14263
  const P = W().filter((le) => !le.disabled), Z = P.find((le) => le.ref.current === document.activeElement), ne = mp(P, Y, Z);
14264
14264
  ne && setTimeout(() => ne.ref.current.focus());
14265
14265
  }), oe = f.useCallback(
@@ -14274,7 +14274,7 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14274
14274
  (w.value !== void 0 && w.value === P || ne) && M(Y);
14275
14275
  },
14276
14276
  [w.value]
14277
- ), de = r === "popper" ? Ei : Zh, be = de === Ei ? {
14277
+ ), de = r === "popper" ? Ri : Zh, be = de === Ri ? {
14278
14278
  side: a,
14279
14279
  sideOffset: c,
14280
14280
  align: u,
@@ -14287,7 +14287,7 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14287
14287
  avoidCollisions: m
14288
14288
  } : {};
14289
14289
  return /* @__PURE__ */ l.jsx(
14290
- qh,
14290
+ Xh,
14291
14291
  {
14292
14292
  scope: n,
14293
14293
  content: y,
@@ -14297,7 +14297,7 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14297
14297
  selectedItem: I,
14298
14298
  onItemLeave: F,
14299
14299
  itemTextRefCallback: Q,
14300
- focusSelectedItem: X,
14300
+ focusSelectedItem: q,
14301
14301
  selectedItemText: k,
14302
14302
  position: r,
14303
14303
  isPositioned: G,
@@ -14334,7 +14334,7 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14334
14334
  ...b,
14335
14335
  ...be,
14336
14336
  onPlaced: () => N(!0),
14337
- ref: R,
14337
+ ref: E,
14338
14338
  style: {
14339
14339
  // flex layout so we can place the scroll buttons properly
14340
14340
  display: "flex",
@@ -14345,7 +14345,7 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14345
14345
  },
14346
14346
  onKeyDown: ee(b.onKeyDown, (Y) => {
14347
14347
  const P = Y.ctrlKey || Y.altKey || Y.metaKey;
14348
- if (Y.key === "Tab" && Y.preventDefault(), !P && Y.key.length === 1 && q(Y.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(Y.key)) {
14348
+ if (Y.key === "Tab" && Y.preventDefault(), !P && Y.key.length === 1 && X(Y.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(Y.key)) {
14349
14349
  let ne = W().filter((le) => !le.disabled).map((le) => le.ref.current);
14350
14350
  if (["ArrowUp", "End"].includes(Y.key) && (ne = ne.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(Y.key)) {
14351
14351
  const le = Y.target, ie = ne.indexOf(le);
@@ -14366,11 +14366,11 @@ var Dt = 10, [qh, vn] = lr(kn), tT = "SelectContentImpl", nT = Xn("SelectContent
14366
14366
  );
14367
14367
  Jh.displayName = tT;
14368
14368
  var rT = "SelectItemAlignedPosition", Zh = f.forwardRef((e, t) => {
14369
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = gn(kn, n), i = vn(kn, n), [a, c] = f.useState(null), [u, d] = f.useState(null), h = Te(t, (R) => d(R)), p = ys(n), x = f.useRef(!1), g = f.useRef(!0), { viewport: v, selectedItem: m, selectedItemText: b, focusSelectedItem: w } = i, y = f.useCallback(() => {
14369
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = gn(kn, n), i = vn(kn, n), [a, c] = f.useState(null), [u, d] = f.useState(null), h = Te(t, (E) => d(E)), p = ys(n), x = f.useRef(!1), g = f.useRef(!0), { viewport: v, selectedItem: m, selectedItemText: b, focusSelectedItem: w } = i, y = f.useCallback(() => {
14370
14370
  if (s.trigger && s.valueNode && a && u && v && m && b) {
14371
- const R = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), k = b.getBoundingClientRect();
14371
+ const E = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), k = b.getBoundingClientRect();
14372
14372
  if (s.dir !== "rtl") {
14373
- const le = k.left - I.left, ie = A.left - le, Pe = R.left - ie, Fe = R.width + Pe, Le = Math.max(Fe, I.width), ce = window.innerWidth - Dt, Ae = Si(ie, [
14373
+ const le = k.left - I.left, ie = A.left - le, Pe = E.left - ie, Fe = E.width + Pe, Le = Math.max(Fe, I.width), ce = window.innerWidth - Dt, Ae = Si(ie, [
14374
14374
  Dt,
14375
14375
  // Prevents the content from going off the starting edge of the
14376
14376
  // viewport. It may still go off the ending edge, but this can be
@@ -14381,20 +14381,20 @@ var rT = "SelectItemAlignedPosition", Zh = f.forwardRef((e, t) => {
14381
14381
  ]);
14382
14382
  a.style.minWidth = Fe + "px", a.style.left = Ae + "px";
14383
14383
  } else {
14384
- const le = I.right - k.right, ie = window.innerWidth - A.right - le, Pe = window.innerWidth - R.right - ie, Fe = R.width + Pe, Le = Math.max(Fe, I.width), ce = window.innerWidth - Dt, Ae = Si(ie, [
14384
+ const le = I.right - k.right, ie = window.innerWidth - A.right - le, Pe = window.innerWidth - E.right - ie, Fe = E.width + Pe, Le = Math.max(Fe, I.width), ce = window.innerWidth - Dt, Ae = Si(ie, [
14385
14385
  Dt,
14386
14386
  Math.max(Dt, ce - Le)
14387
14387
  ]);
14388
14388
  a.style.minWidth = Fe + "px", a.style.right = Ae + "px";
14389
14389
  }
14390
- const M = p(), W = window.innerHeight - Dt * 2, G = v.scrollHeight, N = window.getComputedStyle(u), $ = parseInt(N.borderTopWidth, 10), L = parseInt(N.paddingTop, 10), X = parseInt(N.borderBottomWidth, 10), O = parseInt(N.paddingBottom, 10), _ = $ + L + G + O + X, z = Math.min(m.offsetHeight * 5, _), q = window.getComputedStyle(v), oe = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), Q = R.top + R.height / 2 - Dt, de = W - Q, be = m.offsetHeight / 2, Y = m.offsetTop + be, P = $ + L + Y, Z = _ - P;
14390
+ const M = p(), W = window.innerHeight - Dt * 2, G = v.scrollHeight, N = window.getComputedStyle(u), $ = parseInt(N.borderTopWidth, 10), L = parseInt(N.paddingTop, 10), q = parseInt(N.borderBottomWidth, 10), O = parseInt(N.paddingBottom, 10), _ = $ + L + G + O + q, z = Math.min(m.offsetHeight * 5, _), X = window.getComputedStyle(v), oe = parseInt(X.paddingTop, 10), F = parseInt(X.paddingBottom, 10), Q = E.top + E.height / 2 - Dt, de = W - Q, be = m.offsetHeight / 2, Y = m.offsetTop + be, P = $ + L + Y, Z = _ - P;
14391
14391
  if (P <= Q) {
14392
14392
  const le = M.length > 0 && m === M[M.length - 1].ref.current;
14393
14393
  a.style.bottom = "0px";
14394
14394
  const ie = u.clientHeight - v.offsetTop - v.offsetHeight, Pe = Math.max(
14395
14395
  de,
14396
14396
  be + // viewport might have padding bottom, include it to avoid a scrollable viewport
14397
- (le ? F : 0) + ie + X
14397
+ (le ? F : 0) + ie + q
14398
14398
  ), Fe = P + Pe;
14399
14399
  a.style.height = Fe + "px";
14400
14400
  } else {
@@ -14422,13 +14422,13 @@ var rT = "SelectItemAlignedPosition", Zh = f.forwardRef((e, t) => {
14422
14422
  r
14423
14423
  ]);
14424
14424
  tt(() => y(), [y]);
14425
- const [E, S] = f.useState();
14425
+ const [R, S] = f.useState();
14426
14426
  tt(() => {
14427
14427
  u && S(window.getComputedStyle(u).zIndex);
14428
14428
  }, [u]);
14429
14429
  const C = f.useCallback(
14430
- (R) => {
14431
- R && g.current === !0 && (y(), w == null || w(), g.current = !1);
14430
+ (E) => {
14431
+ E && g.current === !0 && (y(), w == null || w(), g.current = !1);
14432
14432
  },
14433
14433
  [y, w]
14434
14434
  );
@@ -14447,7 +14447,7 @@ var rT = "SelectItemAlignedPosition", Zh = f.forwardRef((e, t) => {
14447
14447
  display: "flex",
14448
14448
  flexDirection: "column",
14449
14449
  position: "fixed",
14450
- zIndex: E
14450
+ zIndex: R
14451
14451
  },
14452
14452
  children: /* @__PURE__ */ l.jsx(
14453
14453
  me.div,
@@ -14470,7 +14470,7 @@ var rT = "SelectItemAlignedPosition", Zh = f.forwardRef((e, t) => {
14470
14470
  );
14471
14471
  });
14472
14472
  Zh.displayName = rT;
14473
- var oT = "SelectPopperPosition", Ei = f.forwardRef((e, t) => {
14473
+ var oT = "SelectPopperPosition", Ri = f.forwardRef((e, t) => {
14474
14474
  const {
14475
14475
  __scopeSelect: n,
14476
14476
  align: r = "start",
@@ -14498,7 +14498,7 @@ var oT = "SelectPopperPosition", Ei = f.forwardRef((e, t) => {
14498
14498
  }
14499
14499
  );
14500
14500
  });
14501
- Ei.displayName = oT;
14501
+ Ri.displayName = oT;
14502
14502
  var [sT, _a] = lr(kn, {}), Ii = "SelectViewport", Qh = f.forwardRef(
14503
14503
  (e, t) => {
14504
14504
  const { __scopeSelect: n, nonce: r, ...o } = e, s = vn(Ii, n), i = _a(Ii, n), a = Te(t, s.onViewportChange), c = f.useRef(0);
@@ -14539,8 +14539,8 @@ var [sT, _a] = lr(kn, {}), Ii = "SelectViewport", Qh = f.forwardRef(
14539
14539
  if (x > 0) {
14540
14540
  const g = window.innerHeight - Dt * 2, v = parseFloat(h.style.minHeight), m = parseFloat(h.style.height), b = Math.max(v, m);
14541
14541
  if (b < g) {
14542
- const w = b + x, y = Math.min(g, w), E = w - y;
14543
- h.style.height = y + "px", h.style.bottom === "0px" && (d.scrollTop = E > 0 ? E : 0, h.style.justifyContent = "flex-end");
14542
+ const w = b + x, y = Math.min(g, w), R = w - y;
14543
+ h.style.height = y + "px", h.style.bottom === "0px" && (d.scrollTop = R > 0 ? R : 0, h.style.justifyContent = "flex-end");
14544
14544
  }
14545
14545
  }
14546
14546
  }
@@ -14638,8 +14638,8 @@ var Fo = "SelectItem", [cT, rp] = lr(Fo), op = f.forwardRef(
14638
14638
  w.currentTarget === document.activeElement && ((y = c.onItemLeave) == null || y.call(c));
14639
14639
  }),
14640
14640
  onKeyDown: ee(i.onKeyDown, (w) => {
14641
- var E;
14642
- ((E = c.searchRef) == null ? void 0 : E.current) !== "" && w.key === " " || (YC.includes(w.key) && b(), w.key === " " && w.preventDefault());
14641
+ var R;
14642
+ ((R = c.searchRef) == null ? void 0 : R.current) !== "" && w.key === " " || (YC.includes(w.key) && b(), w.key === " " && w.preventDefault());
14643
14643
  })
14644
14644
  }
14645
14645
  )
@@ -14822,7 +14822,7 @@ function mp(e, t, n) {
14822
14822
  function hT(e, t) {
14823
14823
  return e.map((n, r) => e[(t + r) % e.length]);
14824
14824
  }
14825
- var pT = zh, gp = Wh, mT = Gh, gT = Kh, vT = Yh, vp = Xh, xT = Qh, xp = np, bp = op, bT = sp, wT = ap, wp = lp, yp = cp, Sp = dp;
14825
+ var pT = zh, gp = Wh, mT = Gh, gT = Kh, vT = Yh, vp = qh, xT = Qh, xp = np, bp = op, bT = sp, wT = ap, wp = lp, yp = cp, Sp = dp;
14826
14826
  const fc = pT, hc = mT, ki = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ l.jsxs(
14827
14827
  gp,
14828
14828
  {
@@ -14980,7 +14980,7 @@ const TT = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
14980
14980
  }
14981
14981
  ));
14982
14982
  TT.displayName = "CardFooter";
14983
- const RT = {
14983
+ const ET = {
14984
14984
  api: {
14985
14985
  baseUrl: "http://localhost:8000/api",
14986
14986
  authToken: "",
@@ -14999,7 +14999,7 @@ const RT = {
14999
14999
  showTypingIndicator: !0
15000
15000
  }
15001
15001
  };
15002
- function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15002
+ function fE({ settings: e, onSettingsChange: t, className: n = "" }) {
15003
15003
  const [r, o] = fe(!1), [s, i] = fe(!1), [a, c] = fe(e), [u, d] = fe(!1), { toast: h } = ea();
15004
15004
  Ve(() => {
15005
15005
  const m = JSON.stringify(a) !== JSON.stringify(e);
@@ -15013,7 +15013,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15013
15013
  description: "Your chat configuration has been updated successfully."
15014
15014
  });
15015
15015
  }, x = () => {
15016
- c(RT), d(!0), h({
15016
+ c(ET), d(!0), h({
15017
15017
  title: "Settings reset",
15018
15018
  description: "Configuration has been reset to defaults."
15019
15019
  });
@@ -15035,7 +15035,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15035
15035
  }
15036
15036
  };
15037
15037
  return /* @__PURE__ */ l.jsxs(oh, { open: r, onOpenChange: o, children: [
15038
- /* @__PURE__ */ l.jsx(X0, { asChild: !0, children: /* @__PURE__ */ l.jsxs(ke, { variant: "outline", size: "sm", className: n, children: [
15038
+ /* @__PURE__ */ l.jsx(q0, { asChild: !0, children: /* @__PURE__ */ l.jsxs(ke, { variant: "outline", size: "sm", className: n, children: [
15039
15039
  /* @__PURE__ */ l.jsx(Jp, { className: "h-4 w-4 mr-2" }),
15040
15040
  "Settings",
15041
15041
  u && /* @__PURE__ */ l.jsx(Tu, { variant: "destructive", className: "ml-2 h-4 w-4 p-0" })
@@ -15053,7 +15053,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15053
15053
  ] }) }),
15054
15054
  /* @__PURE__ */ l.jsxs(yo, { className: "space-y-4", children: [
15055
15055
  /* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
15056
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "api-url", children: "API Base URL" }),
15056
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "api-url", children: "API Base URL" }),
15057
15057
  /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2", children: [
15058
15058
  /* @__PURE__ */ l.jsx(
15059
15059
  Ar,
@@ -15071,7 +15071,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15071
15071
  ] })
15072
15072
  ] }),
15073
15073
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
15074
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "enable-auth", children: "Enable Authentication" }),
15074
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "enable-auth", children: "Enable Authentication" }),
15075
15075
  /* @__PURE__ */ l.jsx(
15076
15076
  an,
15077
15077
  {
@@ -15085,7 +15085,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15085
15085
  )
15086
15086
  ] }),
15087
15087
  a.api.enableAuth && /* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
15088
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "auth-token", children: "Authentication Token" }),
15088
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "auth-token", children: "Authentication Token" }),
15089
15089
  /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2", children: [
15090
15090
  /* @__PURE__ */ l.jsx(
15091
15091
  Ar,
@@ -15120,7 +15120,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15120
15120
  ] }) }),
15121
15121
  /* @__PURE__ */ l.jsxs(yo, { className: "space-y-4", children: [
15122
15122
  /* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
15123
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "layout", children: "Layout Style" }),
15123
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "layout", children: "Layout Style" }),
15124
15124
  /* @__PURE__ */ l.jsxs(
15125
15125
  fc,
15126
15126
  {
@@ -15141,7 +15141,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15141
15141
  )
15142
15142
  ] }),
15143
15143
  /* @__PURE__ */ l.jsxs("div", { className: "space-y-2", children: [
15144
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "theme", children: "Theme" }),
15144
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "theme", children: "Theme" }),
15145
15145
  /* @__PURE__ */ l.jsxs(
15146
15146
  fc,
15147
15147
  {
@@ -15164,7 +15164,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15164
15164
  /* @__PURE__ */ l.jsx(Aa, {}),
15165
15165
  /* @__PURE__ */ l.jsxs("div", { className: "space-y-3", children: [
15166
15166
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
15167
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
15167
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
15168
15168
  /* @__PURE__ */ l.jsx(
15169
15169
  an,
15170
15170
  {
@@ -15178,7 +15178,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15178
15178
  )
15179
15179
  ] }),
15180
15180
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
15181
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
15181
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
15182
15182
  /* @__PURE__ */ l.jsx(
15183
15183
  an,
15184
15184
  {
@@ -15192,7 +15192,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15192
15192
  )
15193
15193
  ] }),
15194
15194
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
15195
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "compact-messages", children: "Compact Messages" }),
15195
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "compact-messages", children: "Compact Messages" }),
15196
15196
  /* @__PURE__ */ l.jsx(
15197
15197
  an,
15198
15198
  {
@@ -15216,7 +15216,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15216
15216
  /* @__PURE__ */ l.jsxs(yo, { className: "space-y-4", children: [
15217
15217
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
15218
15218
  /* @__PURE__ */ l.jsxs("div", { children: [
15219
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
15219
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
15220
15220
  /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground", children: "Automatically save messages to threads" })
15221
15221
  ] }),
15222
15222
  /* @__PURE__ */ l.jsx(
@@ -15233,7 +15233,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15233
15233
  ] }),
15234
15234
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
15235
15235
  /* @__PURE__ */ l.jsxs("div", { children: [
15236
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "enable-streaming", children: "Enable Streaming" }),
15236
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "enable-streaming", children: "Enable Streaming" }),
15237
15237
  /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground", children: "Stream responses in real-time" })
15238
15238
  ] }),
15239
15239
  /* @__PURE__ */ l.jsx(
@@ -15250,7 +15250,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15250
15250
  ] }),
15251
15251
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
15252
15252
  /* @__PURE__ */ l.jsxs("div", { children: [
15253
- /* @__PURE__ */ l.jsx(Et, { htmlFor: "typing-indicator", children: "Typing Indicator" }),
15253
+ /* @__PURE__ */ l.jsx(Rt, { htmlFor: "typing-indicator", children: "Typing Indicator" }),
15254
15254
  /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground", children: "Show typing indicator during responses" })
15255
15255
  ] }),
15256
15256
  /* @__PURE__ */ l.jsx(
@@ -15270,7 +15270,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15270
15270
  ] }),
15271
15271
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between pt-6 border-t", children: [
15272
15272
  /* @__PURE__ */ l.jsxs(ke, { variant: "outline", onClick: x, children: [
15273
- /* @__PURE__ */ l.jsx(Xs, { className: "h-4 w-4 mr-2" }),
15273
+ /* @__PURE__ */ l.jsx(qs, { className: "h-4 w-4 mr-2" }),
15274
15274
  "Reset"
15275
15275
  ] }),
15276
15276
  /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2", children: [
@@ -15284,7 +15284,7 @@ function fR({ settings: e, onSettingsChange: t, className: n = "" }) {
15284
15284
  ] })
15285
15285
  ] });
15286
15286
  }
15287
- function hR({
15287
+ function hE({
15288
15288
  layout: e = "sidebar",
15289
15289
  layoutSize: t = "desktop",
15290
15290
  showThreads: n = !0,
@@ -15363,21 +15363,21 @@ export {
15363
15363
  $g as ApiClient,
15364
15364
  $g as ChatApi,
15365
15365
  vo as ChatInterface,
15366
- cR as ChatMainLayout,
15366
+ cE as ChatMainLayout,
15367
15367
  so as ChatProvider,
15368
- rR as ChatRoutingProvider,
15369
- fR as ChatSettings,
15370
- Xr as MarkdownContent,
15368
+ rE as ChatRoutingProvider,
15369
+ fE as ChatSettings,
15370
+ qr as MarkdownContent,
15371
15371
  xw as MessageComponent,
15372
15372
  Ci as ThreadManager,
15373
- En as apiClient,
15374
- iR as applySettings,
15375
- En as chatApiClient,
15376
- hR as default,
15373
+ Rn as apiClient,
15374
+ iE as applySettings,
15375
+ Rn as chatApiClient,
15376
+ hE as default,
15377
15377
  Hg as del,
15378
15378
  Mt as get,
15379
15379
  Lg as getChatToken,
15380
- sR as getCurrentSettings,
15380
+ sE as getCurrentSettings,
15381
15381
  $0 as getDefaultApiConfig,
15382
15382
  z0 as getDefaultChatSettings,
15383
15383
  Fg as onChatTokenChanged,
@@ -15385,7 +15385,7 @@ export {
15385
15385
  Bg as put,
15386
15386
  ul as setChatToken,
15387
15387
  Li as useChat,
15388
- oR as useChatRouting,
15388
+ oE as useChatRouting,
15389
15389
  zg as useChatStream,
15390
15390
  Kg as useMessagesReducer
15391
15391
  };