teodor-new-chat-ui 4.3.334 → 4.3.336

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
@@ -57,14 +57,14 @@ function Em() {
57
57
  var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
58
  function w(k) {
59
59
  {
60
- for (var H = arguments.length, se = new Array(H > 1 ? H - 1 : 0), we = 1; we < H; we++)
61
- se[we - 1] = arguments[we];
60
+ for (var H = arguments.length, se = new Array(H > 1 ? H - 1 : 0), be = 1; be < H; be++)
61
+ se[be - 1] = arguments[be];
62
62
  b("error", k, se);
63
63
  }
64
64
  }
65
65
  function b(k, H, se) {
66
66
  {
67
- var we = g.ReactDebugCurrentFrame, Je = we.getStackAddendum();
67
+ var be = g.ReactDebugCurrentFrame, Je = be.getStackAddendum();
68
68
  Je !== "" && (H += "%s", se = se.concat([Je]));
69
69
  var it = se.map(function(Be) {
70
70
  return String(Be);
@@ -82,9 +82,9 @@ function Em() {
82
82
  k.$$typeof === _ || k.getModuleId !== void 0));
83
83
  }
84
84
  function P(k, H, se) {
85
- var we = k.displayName;
86
- if (we)
87
- return we;
85
+ var be = k.displayName;
86
+ if (be)
87
+ return be;
88
88
  var Je = H.displayName || H.name || "";
89
89
  return Je !== "" ? se + "(" + Je + ")" : se;
90
90
  }
@@ -123,8 +123,8 @@ function Em() {
123
123
  case l:
124
124
  return P(k, k.render, "ForwardRef");
125
125
  case f:
126
- var we = k.displayName || null;
127
- return we !== null ? we : $(k.type) || "Memo";
126
+ var be = k.displayName || null;
127
+ return be !== null ? be : $(k.type) || "Memo";
128
128
  case p: {
129
129
  var Je = k, it = Je._payload, Be = Je._init;
130
130
  try {
@@ -136,14 +136,14 @@ function Em() {
136
136
  }
137
137
  return null;
138
138
  }
139
- var E = Object.assign, F = 0, j, Z, B, A, W, G, oe;
139
+ var E = Object.assign, F = 0, j, Z, B, N, W, G, oe;
140
140
  function ve() {
141
141
  }
142
142
  ve.__reactDisabledLog = !0;
143
143
  function je() {
144
144
  {
145
145
  if (F === 0) {
146
- j = console.log, Z = console.info, B = console.warn, A = console.error, W = console.group, G = console.groupCollapsed, oe = console.groupEnd;
146
+ j = console.log, Z = console.info, B = console.warn, N = console.error, W = console.group, G = console.groupCollapsed, oe = console.groupEnd;
147
147
  var k = {
148
148
  configurable: !0,
149
149
  enumerable: !0,
@@ -182,7 +182,7 @@ function Em() {
182
182
  value: B
183
183
  }),
184
184
  error: E({}, k, {
185
- value: A
185
+ value: N
186
186
  }),
187
187
  group: E({}, k, {
188
188
  value: W
@@ -205,8 +205,8 @@ function Em() {
205
205
  try {
206
206
  throw Error();
207
207
  } catch (Je) {
208
- var we = Je.stack.trim().match(/\n( *(at )?)/);
209
- Y = we && we[1] || "";
208
+ var be = Je.stack.trim().match(/\n( *(at )?)/);
209
+ Y = be && be[1] || "";
210
210
  }
211
211
  return `
212
212
  ` + Y + k;
@@ -225,7 +225,7 @@ function Em() {
225
225
  if (se !== void 0)
226
226
  return se;
227
227
  }
228
- var we;
228
+ var be;
229
229
  V = !0;
230
230
  var Je = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
@@ -244,14 +244,14 @@ function Em() {
244
244
  try {
245
245
  Reflect.construct(Be, []);
246
246
  } catch (Ge) {
247
- we = Ge;
247
+ be = Ge;
248
248
  }
249
249
  Reflect.construct(k, [], Be);
250
250
  } else {
251
251
  try {
252
252
  Be.call();
253
253
  } catch (Ge) {
254
- we = Ge;
254
+ be = Ge;
255
255
  }
256
256
  k.call(Be.prototype);
257
257
  }
@@ -259,14 +259,14 @@ function Em() {
259
259
  try {
260
260
  throw Error();
261
261
  } catch (Ge) {
262
- we = Ge;
262
+ be = Ge;
263
263
  }
264
264
  k();
265
265
  }
266
266
  } catch (Ge) {
267
- if (Ge && we && typeof Ge.stack == "string") {
267
+ if (Ge && be && typeof Ge.stack == "string") {
268
268
  for (var Fe = Ge.stack.split(`
269
- `), Et = we.stack.split(`
269
+ `), Et = be.stack.split(`
270
270
  `), xt = Fe.length - 1, wt = Et.length - 1; xt >= 1 && wt >= 0 && Fe[xt] !== Et[wt]; )
271
271
  wt--;
272
272
  for (; xt >= 1 && wt >= 0; xt--, wt--)
@@ -285,8 +285,8 @@ function Em() {
285
285
  } finally {
286
286
  V = !1, z.current = it, q(), Error.prepareStackTrace = Je;
287
287
  }
288
- var Se = k ? k.displayName || k.name : "", Ie = Se ? D(Se) : "";
289
- return typeof k == "function" && J.set(k, Ie), Ie;
288
+ var Ce = k ? k.displayName || k.name : "", ke = Ce ? D(Ce) : "";
289
+ return typeof k == "function" && J.set(k, ke), ke;
290
290
  }
291
291
  function Ne(k, H, se) {
292
292
  return re(k, !1);
@@ -315,7 +315,7 @@ function Em() {
315
315
  case f:
316
316
  return Oe(k.type, H, se);
317
317
  case p: {
318
- var we = k, Je = we._payload, it = we._init;
318
+ var be = k, Je = be._payload, it = be._init;
319
319
  try {
320
320
  return Oe(it(Je), H, se);
321
321
  } catch {
@@ -332,7 +332,7 @@ function Em() {
332
332
  } else
333
333
  tt.setExtraStackFrame(null);
334
334
  }
335
- function ie(k, H, se, we, Je) {
335
+ function ie(k, H, se, be, Je) {
336
336
  {
337
337
  var it = Function.call.bind(Ye);
338
338
  for (var Be in k)
@@ -340,14 +340,14 @@ function Em() {
340
340
  var Fe = void 0;
341
341
  try {
342
342
  if (typeof k[Be] != "function") {
343
- var Et = Error((we || "React class") + ": " + se + " type `" + Be + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof k[Be] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
343
+ var Et = Error((be || "React class") + ": " + se + " type `" + Be + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof k[Be] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
344
  throw Et.name = "Invariant Violation", Et;
345
345
  }
346
- Fe = k[Be](H, Be, we, se, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ Fe = k[Be](H, Be, be, se, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (xt) {
348
348
  Fe = xt;
349
349
  }
350
- Fe && !(Fe instanceof Error) && (Xe(Je), 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).", we || "React class", se, Be, typeof Fe), Xe(null)), Fe instanceof Error && !(Fe.message in qe) && (qe[Fe.message] = !0, Xe(Je), w("Failed %s type: %s", se, Fe.message), Xe(null));
350
+ Fe && !(Fe instanceof Error) && (Xe(Je), 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).", be || "React class", se, Be, typeof Fe), Xe(null)), Fe instanceof Error && !(Fe.message in qe) && (qe[Fe.message] = !0, Xe(Je), w("Failed %s type: %s", se, Fe.message), Xe(null));
351
351
  }
352
352
  }
353
353
  }
@@ -422,7 +422,7 @@ function Em() {
422
422
  });
423
423
  }
424
424
  }
425
- var Qe = function(k, H, se, we, Je, it, Be) {
425
+ var Qe = function(k, H, se, be, Je, it, Be) {
426
426
  var Fe = {
427
427
  // This tag allows us to uniquely identify this as a React Element
428
428
  $$typeof: t,
@@ -443,7 +443,7 @@ function Em() {
443
443
  configurable: !1,
444
444
  enumerable: !1,
445
445
  writable: !1,
446
- value: we
446
+ value: be
447
447
  }), Object.defineProperty(Fe, "_source", {
448
448
  configurable: !1,
449
449
  enumerable: !1,
@@ -451,7 +451,7 @@ function Em() {
451
451
  value: Je
452
452
  }), Object.freeze && (Object.freeze(Fe.props), Object.freeze(Fe)), Fe;
453
453
  };
454
- function et(k, H, se, we, Je) {
454
+ function et(k, H, se, be, Je) {
455
455
  {
456
456
  var it, Be = {}, Fe = null, Et = null;
457
457
  se !== void 0 && (_t(se), Fe = "" + se), jt(H) && (_t(H.key), Fe = "" + H.key), Lt(H) && (Et = H.ref, nt(H, Je));
@@ -466,7 +466,7 @@ function Em() {
466
466
  var wt = typeof k == "function" ? k.displayName || k.name || "Unknown" : k;
467
467
  Fe && Rt(Be, wt), Et && pn(Be, wt);
468
468
  }
469
- return Qe(k, Fe, Et, Je, we, vt.current, Be);
469
+ return Qe(k, Fe, Et, Je, be, vt.current, Be);
470
470
  }
471
471
  }
472
472
  var pt = g.ReactCurrentOwner, lt = g.ReactDebugCurrentFrame;
@@ -477,12 +477,12 @@ function Em() {
477
477
  } else
478
478
  lt.setExtraStackFrame(null);
479
479
  }
480
- var N;
481
- N = !1;
480
+ var A;
481
+ A = !1;
482
482
  function X(k) {
483
483
  return typeof k == "object" && k !== null && k.$$typeof === t;
484
484
  }
485
- function ne() {
485
+ function te() {
486
486
  {
487
487
  if (pt.current) {
488
488
  var k = $(pt.current.type);
@@ -497,10 +497,10 @@ Check the render method of \`` + k + "`.";
497
497
  function fe(k) {
498
498
  return "";
499
499
  }
500
- var Re = {};
501
- function be(k) {
500
+ var we = {};
501
+ function Se(k) {
502
502
  {
503
- var H = ne();
503
+ var H = te();
504
504
  if (!H) {
505
505
  var se = typeof k == "string" ? k : k.displayName || k.name;
506
506
  se && (H = `
@@ -515,12 +515,12 @@ Check the top-level render call using <` + se + ">.");
515
515
  if (!k._store || k._store.validated || k.key != null)
516
516
  return;
517
517
  k._store.validated = !0;
518
- var se = be(H);
519
- if (Re[se])
518
+ var se = Se(H);
519
+ if (we[se])
520
520
  return;
521
- Re[se] = !0;
522
- var we = "";
523
- k && k._owner && k._owner !== pt.current && (we = " It was passed a child from " + $(k._owner.type) + "."), K(k), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', se, we), K(null);
521
+ we[se] = !0;
522
+ var be = "";
523
+ k && k._owner && k._owner !== pt.current && (be = " It was passed a child from " + $(k._owner.type) + "."), K(k), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', se, be), K(null);
524
524
  }
525
525
  }
526
526
  function Me(k, H) {
@@ -529,8 +529,8 @@ Check the top-level render call using <` + se + ">.");
529
529
  return;
530
530
  if (Ue(k))
531
531
  for (var se = 0; se < k.length; se++) {
532
- var we = k[se];
533
- X(we) && ze(we, H);
532
+ var be = k[se];
533
+ X(be) && ze(be, H);
534
534
  }
535
535
  else if (X(k))
536
536
  k._store && (k._store.validated = !0);
@@ -557,10 +557,10 @@ Check the top-level render call using <` + se + ">.");
557
557
  else
558
558
  return;
559
559
  if (se) {
560
- var we = $(H);
561
- ie(se, k.props, "prop", we, k);
562
- } else if (H.PropTypes !== void 0 && !N) {
563
- N = !0;
560
+ var be = $(H);
561
+ ie(se, k.props, "prop", be, k);
562
+ } else if (H.PropTypes !== void 0 && !A) {
563
+ A = !0;
564
564
  var Je = $(H);
565
565
  w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Je || "Unknown");
566
566
  }
@@ -570,9 +570,9 @@ Check the top-level render call using <` + se + ">.");
570
570
  function Wt(k) {
571
571
  {
572
572
  for (var H = Object.keys(k.props), se = 0; se < H.length; se++) {
573
- var we = H[se];
574
- if (we !== "children" && we !== "key") {
575
- K(k), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", we), K(null);
573
+ var be = H[se];
574
+ if (be !== "children" && be !== "key") {
575
+ K(k), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", be), K(null);
576
576
  break;
577
577
  }
578
578
  }
@@ -580,14 +580,14 @@ Check the top-level render call using <` + se + ">.");
580
580
  }
581
581
  }
582
582
  var Tn = {};
583
- function Vn(k, H, se, we, Je, it) {
583
+ function Vn(k, H, se, be, Je, it) {
584
584
  {
585
585
  var Be = L(k);
586
586
  if (!Be) {
587
587
  var Fe = "";
588
588
  (k === void 0 || typeof k == "object" && k !== null && Object.keys(k).length === 0) && (Fe += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
589
589
  var Et = fe();
590
- Et ? Fe += Et : Fe += ne();
590
+ Et ? Fe += Et : Fe += te();
591
591
  var xt;
592
592
  k === null ? xt = "null" : Ue(k) ? xt = "array" : k !== void 0 && k.$$typeof === t ? (xt = "<" + ($(k.type) || "Unknown") + " />", Fe = " Did you accidentally export a JSX literal instead of a component?") : xt = typeof k, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", xt, Fe);
593
593
  }
@@ -597,10 +597,10 @@ Check the top-level render call using <` + se + ">.");
597
597
  if (Be) {
598
598
  var de = H.children;
599
599
  if (de !== void 0)
600
- if (we)
600
+ if (be)
601
601
  if (Ue(de)) {
602
- for (var Se = 0; Se < de.length; Se++)
603
- Me(de[Se], k);
602
+ for (var Ce = 0; Ce < de.length; Ce++)
603
+ Me(de[Ce], k);
604
604
  Object.freeze && Object.freeze(de);
605
605
  } else
606
606
  w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
@@ -608,17 +608,17 @@ Check the top-level render call using <` + se + ">.");
608
608
  Me(de, k);
609
609
  }
610
610
  if (Ye.call(H, "key")) {
611
- var Ie = $(k), Ge = Object.keys(H).filter(function(Gh) {
611
+ var ke = $(k), Ge = Object.keys(H).filter(function(Gh) {
612
612
  return Gh !== "key";
613
613
  }), jn = Ge.length > 0 ? "{key: someKey, " + Ge.join(": ..., ") + ": ...}" : "{key: someKey}";
614
- if (!Tn[Ie + jn]) {
614
+ if (!Tn[ke + jn]) {
615
615
  var Yt = Ge.length > 0 ? "{" + Ge.join(": ..., ") + ": ...}" : "{}";
616
616
  w(`A props object containing a "key" prop is being spread into JSX:
617
617
  let props = %s;
618
618
  <%s {...props} />
619
619
  React keys must be passed directly to JSX without using spread:
620
620
  let props = %s;
621
- <%s key={someKey} {...props} />`, jn, Ie, Yt, Ie), Tn[Ie + jn] = !0;
621
+ <%s key={someKey} {...props} />`, jn, ke, Yt, ke), Tn[ke + jn] = !0;
622
622
  }
623
623
  }
624
624
  return k === r ? Wt(wt) : Ee(wt), wt;
@@ -1901,8 +1901,8 @@ const au = (e) => {
1901
1901
  };
1902
1902
  $ = s && new n(m, Z);
1903
1903
  let B = await (s ? P($, L) : P(m, Z));
1904
- const A = d && (I === "stream" || I === "response");
1905
- if (d && (S || A && E)) {
1904
+ const N = d && (I === "stream" || I === "response");
1905
+ if (d && (S || N && E)) {
1906
1906
  const G = {};
1907
1907
  ["status", "statusText", "headers"].forEach((q) => {
1908
1908
  G[q] = B[q];
@@ -1920,7 +1920,7 @@ const au = (e) => {
1920
1920
  }
1921
1921
  I = I || "text";
1922
1922
  let W = await f[O.findKey(f, I) || "text"](B, x);
1923
- return !A && E && E(), await new Promise((G, oe) => {
1923
+ return !N && E && E(), await new Promise((G, oe) => {
1924
1924
  su(G, oe, {
1925
1925
  data: W,
1926
1926
  headers: Ht.from(B.headers),
@@ -2680,7 +2680,8 @@ function xx(e) {
2680
2680
  step: l,
2681
2681
  source: c ?? null,
2682
2682
  createdAt: d,
2683
- next: h ?? void 0
2683
+ next: h ?? void 0,
2684
+ parentConfig: o.parentConfig ?? null
2684
2685
  });
2685
2686
  }
2686
2687
  return t;
@@ -3061,7 +3062,7 @@ function $x(e = {}) {
3061
3062
  b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && p(""), x(null), I.current = null, R.current = null, _.current = null;
3062
3063
  const Z = new AbortController();
3063
3064
  b.current = Z;
3064
- let B = null, A = null, W = !1;
3065
+ let B = null, N = null, W = !1;
3065
3066
  return C.current = {
3066
3067
  threadId: E.threadId ?? null,
3067
3068
  headers: {}
@@ -3088,8 +3089,8 @@ function $x(e = {}) {
3088
3089
  const et = window.__AUTH_TOKEN__, pt = ((oe = window.localStorage) == null ? void 0 : oe.getItem("authToken")) || null;
3089
3090
  let lt = null;
3090
3091
  try {
3091
- const N = (ve = window.localStorage) == null ? void 0 : ve.getItem("chat-settings");
3092
- N && (lt = ((je = JSON.parse(N)) == null ? void 0 : je.apiKey) || null);
3092
+ const A = (ve = window.localStorage) == null ? void 0 : ve.getItem("chat-settings");
3093
+ A && (lt = ((je = JSON.parse(A)) == null ? void 0 : je.apiKey) || null);
3093
3094
  } catch {
3094
3095
  }
3095
3096
  const K = et || pt || lt || null;
@@ -3132,7 +3133,7 @@ function $x(e = {}) {
3132
3133
  Qe == null ? void 0 : Qe.slice(0, 500)
3133
3134
  );
3134
3135
  const et = `stream ${st.status}${Qe ? ": " + Qe : ""}`;
3135
- throw (z = j == null ? void 0 : j.onConnectionError) == null || z.call(j, et), W = !0, B = "error", A = et, new Error(et);
3136
+ throw (z = j == null ? void 0 : j.onConnectionError) == null || z.call(j, et), W = !0, B = "error", N = et, new Error(et);
3136
3137
  }
3137
3138
  w(!0);
3138
3139
  const at = st.body.getReader(), _t = new TextDecoder();
@@ -3153,7 +3154,7 @@ function $x(e = {}) {
3153
3154
  var Qe;
3154
3155
  if (Date.now() - nt > 18e5) {
3155
3156
  const et = "Stream idle timeout";
3156
- d(et), B = "error", A = et, Z.abort(), (Qe = j == null ? void 0 : j.onError) == null || Qe.call(j, et);
3157
+ d(et), B = "error", N = et, Z.abort(), (Qe = j == null ? void 0 : j.onError) == null || Qe.call(j, et);
3157
3158
  }
3158
3159
  }, 5e3), pn = 1024 * 1024;
3159
3160
  try {
@@ -3162,78 +3163,78 @@ function $x(e = {}) {
3162
3163
  ...C.current,
3163
3164
  threadId: pt
3164
3165
  }), (Y = j == null ? void 0 : j.onOpen) == null || Y.call(j, { threadId: pt, created: lt }); ; ) {
3165
- const { value: K, done: N } = await at.read();
3166
- if (N) break;
3166
+ const { value: K, done: A } = await at.read();
3167
+ if (A) break;
3167
3168
  vt += _t.decode(K, { stream: !0 }), vt.length > pn && (vt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3168
3169
  let X;
3169
3170
  for (; (X = vt.indexOf(`
3170
3171
 
3171
3172
  `)) >= 0; ) {
3172
- const ne = vt.slice(0, X);
3173
+ const te = vt.slice(0, X);
3173
3174
  vt = vt.slice(X + 2);
3174
- const fe = Bx(ne);
3175
+ const fe = Bx(te);
3175
3176
  if (!fe) continue;
3176
- let Re;
3177
+ let we;
3177
3178
  try {
3178
- Re = JSON.parse(fe);
3179
+ we = JSON.parse(fe);
3179
3180
  } catch {
3180
3181
  console.debug("[use-chat] malformed SSE:", fe.slice(0, 200));
3181
3182
  continue;
3182
3183
  }
3183
- const be = Fx(Re) ? Re.data : Re;
3184
+ const Se = Fx(we) ? we.data : we;
3184
3185
  nt = Date.now();
3185
- const ze = be.seq;
3186
+ const ze = Se.seq;
3186
3187
  if (ze !== void 0) {
3187
3188
  if (ze <= bt) {
3188
- console.debug("[use-chat] drop duplicate/out-of-order event", { seq: ze, lastProcessedSeq: bt, type: be.type });
3189
+ console.debug("[use-chat] drop duplicate/out-of-order event", { seq: ze, lastProcessedSeq: bt, type: Se.type });
3189
3190
  continue;
3190
3191
  }
3191
3192
  bt > 0 && ze > bt + 1 && ((D = j == null ? void 0 : j.onGap) == null || D.call(j, { from: bt, to: ze })), bt = ze, S.current = ze, y(ze);
3192
3193
  }
3193
3194
  if (console.debug("[use-chat] received event", {
3194
- seq: be.seq,
3195
- type: be.type,
3195
+ seq: Se.seq,
3196
+ type: Se.type,
3196
3197
  preview: (() => {
3197
3198
  var Me;
3198
3199
  try {
3199
- return be.type === "message_delta" ? { deltaTypes: (Me = be.delta) == null ? void 0 : Me.map((Ee) => Ee.type), textLen: (be.delta || []).filter((Ee) => Ee.type === "text").map((Ee) => String(Ee.text || "").length) } : be.content || be.delta ? { hasContent: !0 } : {};
3200
+ return Se.type === "message_delta" ? { deltaTypes: (Me = Se.delta) == null ? void 0 : Me.map((Ee) => Ee.type), textLen: (Se.delta || []).filter((Ee) => Ee.type === "text").map((Ee) => String(Ee.text || "").length) } : Se.content || Se.delta ? { hasContent: !0 } : {};
3200
3201
  } catch (Ee) {
3201
3202
  return { err: String(Ee) };
3202
3203
  }
3203
3204
  })()
3204
- }), be.type === "checkpoint")
3205
- I.current = be.checkpointId ?? null, R.current = be.checkpointNs ?? null, x(be.checkpointId ?? null);
3206
- else if (be.type === "state_history") {
3207
- _.current = be;
3205
+ }), Se.type === "checkpoint")
3206
+ I.current = Se.checkpointId ?? null, R.current = Se.checkpointNs ?? null, x(Se.checkpointId ?? null);
3207
+ else if (Se.type === "state_history") {
3208
+ _.current = Se;
3208
3209
  try {
3209
- const Ee = hr(be).latest;
3210
+ const Ee = hr(Se).latest;
3210
3211
  Ee && (I.current = Ee.checkpointId ?? null, R.current = Ee.checkpointNs ?? null, x(Ee.checkpointId ?? null));
3211
3212
  } catch (Me) {
3212
3213
  console.warn("[use-chat] Failed to hydrate state_history payload", Me);
3213
3214
  }
3214
3215
  }
3215
3216
  try {
3216
- F == null || F(be);
3217
+ F == null || F(Se);
3217
3218
  } catch (Me) {
3218
- console.error("[use-chat] Error in onEvent callback:", Me, "for event:", be.type);
3219
+ console.error("[use-chat] Error in onEvent callback:", Me, "for event:", Se.type);
3219
3220
  }
3220
- if (be.type === "token" && e.autoAppendAssistant !== !1)
3221
- gt.push(be.content), jt();
3222
- else if (be.type === "message_delta") {
3223
- const Me = be.delta.filter((Ee) => Ee.type === "text").map((Ee) => Ee.text).join("");
3221
+ if (Se.type === "token" && e.autoAppendAssistant !== !1)
3222
+ gt.push(Se.content), jt();
3223
+ else if (Se.type === "message_delta") {
3224
+ const Me = Se.delta.filter((Ee) => Ee.type === "text").map((Ee) => Ee.text).join("");
3224
3225
  Me && e.autoAppendAssistant !== !1 && (gt.push(Me), jt());
3225
- } else if (be.type === "heartbeat") {
3226
+ } else if (Se.type === "heartbeat") {
3226
3227
  console.debug("[use-chat] heartbeat received");
3227
3228
  try {
3228
- (V = j == null ? void 0 : j.onHeartbeat) == null || V.call(j, be);
3229
+ (V = j == null ? void 0 : j.onHeartbeat) == null || V.call(j, Se);
3229
3230
  } catch (Me) {
3230
3231
  console.warn("[use-chat] heartbeat callback failed", Me);
3231
3232
  }
3232
- } else if (Tt !== null && cancelAnimationFrame(Tt), Lt(), be.type === "checkpoint")
3233
- x(be.checkpointId);
3234
- else if (be.type === "error") {
3235
- const Me = be;
3236
- if (d(Me.message), B = "error", A = Me.message, Me.error_type === "auth_error" || Me.code === "TOKEN_EXPIRED" || ((J = Me.message) == null ? void 0 : J.includes("token")) || ((ae = Me.message) == null ? void 0 : ae.includes("401")) || ((re = Me.message) == null ? void 0 : re.includes("unauthorized")) || ((Ne = Me.message) == null ? void 0 : Ne.includes("Unauthorized"))) {
3233
+ } else if (Tt !== null && cancelAnimationFrame(Tt), Lt(), Se.type === "checkpoint")
3234
+ x(Se.checkpointId);
3235
+ else if (Se.type === "error") {
3236
+ const Me = Se;
3237
+ if (d(Me.message), B = "error", N = Me.message, Me.error_type === "auth_error" || Me.code === "TOKEN_EXPIRED" || ((J = Me.message) == null ? void 0 : J.includes("token")) || ((ae = Me.message) == null ? void 0 : ae.includes("401")) || ((re = Me.message) == null ? void 0 : re.includes("unauthorized")) || ((Ne = Me.message) == null ? void 0 : Ne.includes("Unauthorized"))) {
3237
3238
  console.error("[use-chat] Auth error detected:", Me.message);
3238
3239
  try {
3239
3240
  (He = j == null ? void 0 : j.onAuthError) == null || He.call(j, Me.message);
@@ -3251,7 +3252,7 @@ function $x(e = {}) {
3251
3252
  B = B ?? "aborted";
3252
3253
  else {
3253
3254
  const et = Qe.message || String(Qe);
3254
- B = "error", A = et, d(et), (Oe = j == null ? void 0 : j.onError) == null || Oe.call(j, et);
3255
+ B = "error", N = et, d(et), (Oe = j == null ? void 0 : j.onError) == null || Oe.call(j, et);
3255
3256
  }
3256
3257
  } finally {
3257
3258
  try {
@@ -3267,10 +3268,10 @@ function $x(e = {}) {
3267
3268
  B = B ?? "aborted";
3268
3269
  else {
3269
3270
  const xe = ie.message || String(ie);
3270
- B = "error", A = xe, d(xe), (qe = j == null ? void 0 : j.onError) == null || qe.call(j, xe), W || ((tt = j == null ? void 0 : j.onConnectionError) == null || tt.call(j, xe), W = !0);
3271
+ B = "error", N = xe, d(xe), (qe = j == null ? void 0 : j.onError) == null || qe.call(j, xe), W || ((tt = j == null ? void 0 : j.onConnectionError) == null || tt.call(j, xe), W = !0);
3271
3272
  }
3272
3273
  } finally {
3273
- const ie = S.current, xe = I.current, Ue = R.current, We = _.current, st = B ?? (Z.signal.aborted ? "aborted" : A ? "error" : "complete");
3274
+ const ie = S.current, xe = I.current, Ue = R.current, We = _.current, st = B ?? (Z.signal.aborted ? "aborted" : N ? "error" : "complete");
3274
3275
  try {
3275
3276
  (Xe = j == null ? void 0 : j.onClosed) == null || Xe.call(j, {
3276
3277
  reason: st,
@@ -3278,7 +3279,7 @@ function $x(e = {}) {
3278
3279
  lastCheckpointId: xe,
3279
3280
  lastCheckpointNs: Ue,
3280
3281
  lastStateHistory: We,
3281
- error: A
3282
+ error: N
3282
3283
  });
3283
3284
  } catch (at) {
3284
3285
  console.warn("[use-chat] onClosed callback failed", at);
@@ -3779,11 +3780,11 @@ function Yx({
3779
3780
  var E, F, j, Z, B;
3780
3781
  const M = P.seq ?? null;
3781
3782
  if (M !== null) {
3782
- const A = d.current;
3783
- if (A !== null) {
3784
- if (M <= A)
3783
+ const N = d.current;
3784
+ if (N !== null) {
3785
+ if (M <= N)
3785
3786
  return;
3786
- M > A + 1 && (s == null || s({ from: A, to: M }));
3787
+ M > N + 1 && (s == null || s({ from: N, to: M }));
3787
3788
  }
3788
3789
  d.current = M;
3789
3790
  }
@@ -3791,25 +3792,25 @@ function Yx({
3791
3792
  f.current = P.threadId, h.current && (h.current.threadIdGuess = P.threadId), x.current = P, g(P.threadId), console.log("[useChatStreamingService] 🎯 Received thread_info event:", P);
3792
3793
  try {
3793
3794
  t(P);
3794
- } catch (A) {
3795
- console.error("[useChatStreamingService] Error in onThreadInfo handler:", A);
3795
+ } catch (N) {
3796
+ console.error("[useChatStreamingService] Error in onThreadInfo handler:", N);
3796
3797
  }
3797
3798
  return;
3798
3799
  }
3799
3800
  if (P.type === "heartbeat") {
3800
3801
  try {
3801
3802
  c == null || c(P);
3802
- } catch (A) {
3803
- console.error("[useChatStreamingService] Error in onHeartbeat handler:", A);
3803
+ } catch (N) {
3804
+ console.error("[useChatStreamingService] Error in onHeartbeat handler:", N);
3804
3805
  }
3805
3806
  return;
3806
3807
  }
3807
3808
  if (P.type === "error") {
3808
- const A = P;
3809
- if (A.error_type === "auth_error" || A.code === "TOKEN_EXPIRED" || ((E = A.message) == null ? void 0 : E.includes("token")) || ((F = A.message) == null ? void 0 : F.includes("401")) || ((j = A.message) == null ? void 0 : j.includes("unauthorized")) || ((Z = A.message) == null ? void 0 : Z.includes("Unauthorized"))) {
3810
- console.error("[useChatStreamingService] Auth error event detected:", A.message);
3809
+ const N = P;
3810
+ if (N.error_type === "auth_error" || N.code === "TOKEN_EXPIRED" || ((E = N.message) == null ? void 0 : E.includes("token")) || ((F = N.message) == null ? void 0 : F.includes("401")) || ((j = N.message) == null ? void 0 : j.includes("unauthorized")) || ((Z = N.message) == null ? void 0 : Z.includes("Unauthorized"))) {
3811
+ console.error("[useChatStreamingService] Auth error event detected:", N.message);
3811
3812
  try {
3812
- l == null || l(A.message);
3813
+ l == null || l(N.message);
3813
3814
  } catch (G) {
3814
3815
  console.warn("[useChatStreamingService] onAuthError handler failed", G);
3815
3816
  }
@@ -3820,23 +3821,23 @@ function Yx({
3820
3821
  f.current = $ ?? f.current;
3821
3822
  try {
3822
3823
  r == null || r(P);
3823
- } catch (A) {
3824
- console.error("[useChatStreamingService] onStateHistory handler failed", A);
3824
+ } catch (N) {
3825
+ console.error("[useChatStreamingService] onStateHistory handler failed", N);
3825
3826
  }
3826
3827
  }
3827
3828
  if (zx(P)) {
3828
3829
  P.type === "checkpoint" || P.type === "state_history" ? g($ ?? null) : y($ ?? null, P);
3829
3830
  try {
3830
3831
  n(P);
3831
- } catch (A) {
3832
- console.error("[useChatStreamingService] Error in onMessageEvent handler:", A);
3832
+ } catch (N) {
3833
+ console.error("[useChatStreamingService] Error in onMessageEvent handler:", N);
3833
3834
  }
3834
3835
  return;
3835
3836
  }
3836
3837
  try {
3837
3838
  o == null || o(P);
3838
- } catch (A) {
3839
- console.error("[useChatStreamingService] Error in onUnhandledEvent handler:", A);
3839
+ } catch (N) {
3840
+ console.error("[useChatStreamingService] Error in onUnhandledEvent handler:", N);
3840
3841
  }
3841
3842
  },
3842
3843
  [y, g, n, s, t, r, o]
@@ -3882,8 +3883,8 @@ function Yx({
3882
3883
  }
3883
3884
  },
3884
3885
  onClosed: ($) => {
3885
- var Z, B, A, W;
3886
- const E = ((Z = h.current) == null ? void 0 : Z.manualStop) ?? !1, F = f.current ?? ((B = h.current) == null ? void 0 : B.threadIdGuess) ?? ((A = $.lastStateHistory) == null ? void 0 : A.threadId) ?? null;
3886
+ var Z, B, N, W;
3887
+ const E = ((Z = h.current) == null ? void 0 : Z.manualStop) ?? !1, F = f.current ?? ((B = h.current) == null ? void 0 : B.threadIdGuess) ?? ((N = $.lastStateHistory) == null ? void 0 : N.threadId) ?? null;
3887
3888
  ($.reason === "complete" || $.reason === "aborted" && E) && g(F);
3888
3889
  const j = {
3889
3890
  ...$,
@@ -3944,7 +3945,7 @@ function Xx({
3944
3945
  onAuthError: i,
3945
3946
  onThreadChange: a
3946
3947
  }) {
3947
- const { api: l, baseUrl: c } = hu(), d = De(() => Rn(c), [c]), [f, p] = me([]), [h, x] = me(t), [m, y] = me(!1), [g, w] = me(null), [b, T] = me(!1), [S, C] = me(null), { state: I, seed: R, prepend: _, pushUser: L, onEvent: P } = Wx(), [M, $] = me(!1), [E, F] = me(!1), [j, Z] = me(null), [B, A] = me([]), [W, G] = me([]), [oe, ve] = me(!1), je = De(
3948
+ const { api: l, baseUrl: c } = hu(), d = De(() => Rn(c), [c]), [f, p] = me([]), [h, x] = me(t), [m, y] = me(!1), [g, w] = me(null), [b, T] = me(!1), [S, C] = me(null), { state: I, seed: R, prepend: _, pushUser: L, onEvent: P } = Wx(), [M, $] = me(!1), [E, F] = me(!1), [j, Z] = me(null), [B, N] = me([]), [W, G] = me([]), [oe, ve] = me(!1), je = De(
3948
3949
  () => B.flatMap((K) => K.messages ?? []),
3949
3950
  [B]
3950
3951
  ), q = De(() => Lx(je), [je]), z = Le(h), Y = Le(null), D = Le(null), V = Le(null), J = Le(null), ae = Le(!1), re = Le(null), Ne = Le(/* @__PURE__ */ new Map()), He = Le(/* @__PURE__ */ new Map());
@@ -3957,34 +3958,43 @@ function Xx({
3957
3958
  const K = await l.listThreads();
3958
3959
  p(K ?? []);
3959
3960
  } catch (K) {
3960
- const N = String(K);
3961
- w(N), s == null || s(N);
3961
+ const A = String(K);
3962
+ w(A), s == null || s(A);
3962
3963
  } finally {
3963
3964
  y(!1);
3964
3965
  }
3965
3966
  }, [l, s]), Ye = ge((K) => {
3966
3967
  if (!(K != null && K.threadId)) return;
3967
- const N = {
3968
+ const A = {
3968
3969
  threadId: K.threadId,
3969
3970
  title: K.title || `Thread ${K.threadId.slice(0, 8)}`,
3970
3971
  createdAt: K.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3971
3972
  updatedAt: K.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3972
3973
  messageCount: K.messageCount ?? 1
3973
3974
  };
3974
- p((X) => X.some((fe) => fe.threadId === N.threadId) ? (console.debug("[ChatSessionProvider] thread_info: thread already in list", N.threadId), X) : (console.debug("[ChatSessionProvider] thread_info: adding thread to list", N.threadId), [N, ...X]));
3975
+ p((X) => {
3976
+ let te = !1;
3977
+ const fe = X.map((we) => we.threadId === A.threadId ? (te = !0, console.debug("[ChatSessionProvider] thread_info: updating existing thread", A.threadId), {
3978
+ ...we,
3979
+ title: A.title ?? we.title,
3980
+ updatedAt: A.updatedAt ?? we.updatedAt,
3981
+ messageCount: A.messageCount ?? we.messageCount
3982
+ }) : we);
3983
+ return te ? fe : (console.debug("[ChatSessionProvider] thread_info: adding thread to list", A.threadId), [A, ...X]);
3984
+ });
3975
3985
  }, []), qe = ge(
3976
3986
  (K) => {
3977
- const N = K.threadId ?? z.current;
3978
- if (!N || z.current && z.current !== N)
3987
+ const A = K.threadId ?? z.current;
3988
+ if (!A || z.current && z.current !== A)
3979
3989
  return;
3980
- const { checkpoints: X, timeline: ne } = hr(K);
3990
+ const { checkpoints: X, timeline: te } = hr(K);
3981
3991
  if (!X.length)
3982
3992
  return;
3983
- const fe = X.find((Re) => Re.messages && Re.messages.length > 0) ?? X.find((Re) => !!Re.checkpointId) ?? X[0];
3993
+ const fe = X.find((we) => we.messages && we.messages.length > 0) ?? X.find((we) => !!we.checkpointId) ?? X[0];
3984
3994
  R((fe == null ? void 0 : fe.messages) ?? [], {
3985
3995
  checkpointId: (fe == null ? void 0 : fe.checkpointId) ?? null,
3986
3996
  checkpointNs: (fe == null ? void 0 : fe.checkpointNs) ?? null
3987
- }), G(ne), A(X), $(!!(fe != null && fe.nextCursor)), Z((fe == null ? void 0 : fe.nextCursor) ?? null), re.current = `${N}:latest`, D.current = null, V.current = null;
3997
+ }), G(te), N(X), $(!!(fe != null && fe.nextCursor)), Z((fe == null ? void 0 : fe.nextCursor) ?? null), re.current = `${A}:latest`, D.current = null, V.current = null;
3988
3998
  },
3989
3999
  [R]
3990
4000
  ), tt = ge((K) => {
@@ -4001,63 +4011,63 @@ function Xx({
4001
4011
  }), st = ge(
4002
4012
  async (K) => {
4003
4013
  try {
4004
- const N = await l.createThread(K);
4005
- return x(N.threadId), await Oe(), N.threadId;
4006
- } catch (N) {
4007
- return s == null || s(String(N)), null;
4014
+ const A = await l.createThread(K);
4015
+ return x(A.threadId), await Oe(), A.threadId;
4016
+ } catch (A) {
4017
+ return s == null || s(String(A)), null;
4008
4018
  }
4009
4019
  },
4010
4020
  [l, Oe, s]
4011
4021
  ), at = ge(
4012
4022
  async (K) => {
4013
- const N = f;
4014
- p((ne) => ne.filter((fe) => fe.threadId !== K));
4023
+ const A = f;
4024
+ p((te) => te.filter((fe) => fe.threadId !== K));
4015
4025
  const X = new AbortController();
4016
4026
  He.current.set(K, X);
4017
4027
  try {
4018
4028
  await l.deleteThread(K), z.current === K && (x(null), R([], {})), console.log("[ChatSessionProvider] Thread deleted successfully:", K);
4019
- } catch (ne) {
4020
- console.error("[ChatSessionProvider] Delete failed, restoring thread:", K, ne), p(N), s == null || s(`Failed to delete thread: ${String(ne)}`);
4029
+ } catch (te) {
4030
+ console.error("[ChatSessionProvider] Delete failed, restoring thread:", K, te), p(A), s == null || s(`Failed to delete thread: ${String(te)}`);
4021
4031
  } finally {
4022
4032
  He.current.delete(K);
4023
4033
  }
4024
4034
  },
4025
4035
  [f, l, R, s]
4026
4036
  ), _t = ge(
4027
- async (K, N) => {
4037
+ async (K, A) => {
4028
4038
  try {
4029
- await l.updateThread(K, N), await Oe();
4039
+ await l.updateThread(K, A), await Oe();
4030
4040
  } catch (X) {
4031
4041
  s == null || s(String(X));
4032
4042
  }
4033
4043
  },
4034
4044
  [l, Oe, s]
4035
4045
  ), vt = ge(
4036
- async (K, N) => {
4046
+ async (K, A) => {
4037
4047
  if (!K) return;
4038
- const X = `${K}:${N ?? "latest"}`, ne = Ne.current.get(X);
4039
- if (ne)
4040
- return ne;
4048
+ const X = `${K}:${A ?? "latest"}`, te = Ne.current.get(X);
4049
+ if (te)
4050
+ return te;
4041
4051
  const fe = (async () => {
4042
- const Re = K;
4052
+ const we = K;
4043
4053
  T(!0), C(null);
4044
4054
  try {
4045
- const be = await l.getStateHistory({
4046
- threadId: Re,
4047
- checkpointId: N || void 0
4055
+ const Se = await l.getStateHistory({
4056
+ threadId: we,
4057
+ checkpointId: A || void 0
4048
4058
  });
4049
- if (z.current !== Re) {
4050
- console.log(`[ChatSessionProvider] Thread changed during load (was ${Re}, now ${z.current}), discarding stale data`);
4059
+ if (z.current !== we) {
4060
+ console.log(`[ChatSessionProvider] Thread changed during load (was ${we}, now ${z.current}), discarding stale data`);
4051
4061
  return;
4052
4062
  }
4053
- const { checkpoints: ze, timeline: Me } = hr(be), Ee = ze.find((Wt) => Wt.messages && Wt.messages.length > 0) ?? (N ? ze.find((Wt) => Wt.checkpointId === N) : null) ?? ze[0];
4063
+ const { checkpoints: ze, timeline: Me } = hr(Se), Ee = ze.find((Wt) => Wt.messages && Wt.messages.length > 0) ?? (A ? ze.find((Wt) => Wt.checkpointId === A) : null) ?? ze[0];
4054
4064
  R((Ee == null ? void 0 : Ee.messages) ?? [], {
4055
4065
  checkpointId: (Ee == null ? void 0 : Ee.checkpointId) ?? null,
4056
4066
  checkpointNs: (Ee == null ? void 0 : Ee.checkpointNs) ?? null
4057
- }), G(Me), A(ze), $(!!(Ee != null && Ee.nextCursor)), Z((Ee == null ? void 0 : Ee.nextCursor) ?? null);
4058
- } catch (be) {
4059
- if (z.current === Re) {
4060
- const ze = String(be);
4067
+ }), G(Me), N(ze), $(!!(Ee != null && Ee.nextCursor)), Z((Ee == null ? void 0 : Ee.nextCursor) ?? null);
4068
+ } catch (Se) {
4069
+ if (z.current === we) {
4070
+ const ze = String(Se);
4061
4071
  C(ze), s == null || s(ze);
4062
4072
  }
4063
4073
  } finally {
@@ -4074,10 +4084,10 @@ function Xx({
4074
4084
  },
4075
4085
  [l, R, s]
4076
4086
  ), gt = ge(
4077
- async (K, N) => {
4087
+ async (K, A) => {
4078
4088
  J.current = K;
4079
4089
  try {
4080
- await vt(K, N);
4090
+ await vt(K, A);
4081
4091
  } finally {
4082
4092
  J.current === K && (J.current = null);
4083
4093
  }
@@ -4103,14 +4113,14 @@ function Xx({
4103
4113
  return;
4104
4114
  Y.current = h;
4105
4115
  const K = !ae.current && !!n && h === t;
4106
- let N;
4107
- K && n ? (N = n, ae.current = !0, console.log(
4116
+ let A;
4117
+ K && n ? (A = n, ae.current = !0, console.log(
4108
4118
  "[ChatSessionProvider] Loading thread with checkpoint:",
4109
- N,
4119
+ A,
4110
4120
  r ? `(ns: ${r})` : ""
4111
4121
  )) : console.log("[ChatSessionProvider] Loading thread with latest checkpoint");
4112
- const X = `${h}:${N ?? "latest"}`;
4113
- re.current !== X && gt(h, N);
4122
+ const X = `${h}:${A ?? "latest"}`;
4123
+ re.current !== X && gt(h, A);
4114
4124
  }, [
4115
4125
  o,
4116
4126
  h,
@@ -4122,44 +4132,44 @@ function Xx({
4122
4132
  gt
4123
4133
  ]);
4124
4134
  const bt = ge(
4125
- async (K, N) => {
4135
+ async (K, A) => {
4126
4136
  const X = z.current;
4127
4137
  if (!X) return;
4128
- const ne = X;
4138
+ const te = X;
4129
4139
  ve(!0);
4130
4140
  try {
4131
4141
  const fe = await l.getStateHistory({
4132
- threadId: ne,
4142
+ threadId: te,
4133
4143
  checkpointId: K,
4134
- checkpointNs: N ?? void 0
4144
+ checkpointNs: A ?? void 0
4135
4145
  });
4136
- if (z.current !== ne) {
4137
- console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${ne}, now ${z.current}), discarding stale data`);
4146
+ if (z.current !== te) {
4147
+ console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${te}, now ${z.current}), discarding stale data`);
4138
4148
  return;
4139
4149
  }
4140
- const { checkpoints: Re, timeline: be } = hr(fe), ze = Re.find(
4141
- (Me) => Me.checkpointId === K && (N ? Me.checkpointNs === N : !0)
4150
+ const { checkpoints: we, timeline: Se } = hr(fe), ze = we.find(
4151
+ (Me) => Me.checkpointId === K && (A ? Me.checkpointNs === A : !0)
4142
4152
  );
4143
4153
  if (!ze) {
4144
- console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: K, checkpointNs: N });
4154
+ console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: K, checkpointNs: A });
4145
4155
  return;
4146
4156
  }
4147
- G(be), A(Re), R(ze.messages ?? [], {
4157
+ G(Se), N(we), R(ze.messages ?? [], {
4148
4158
  checkpointId: ze.checkpointId ?? null,
4149
4159
  checkpointNs: ze.checkpointNs ?? null
4150
4160
  });
4151
4161
  } catch (fe) {
4152
- z.current === ne && (s == null || s(String(fe)));
4162
+ z.current === te && (s == null || s(String(fe)));
4153
4163
  } finally {
4154
4164
  ve(!1);
4155
4165
  }
4156
4166
  },
4157
4167
  [l, R, s]
4158
4168
  ), Tt = ge(
4159
- (K, N) => {
4169
+ (K, A) => {
4160
4170
  R(I.messages, {
4161
4171
  checkpointId: K ?? null,
4162
- checkpointNs: N ?? null
4172
+ checkpointNs: A ?? null
4163
4173
  });
4164
4174
  },
4165
4175
  [R, I.messages]
@@ -4170,46 +4180,46 @@ function Xx({
4170
4180
  const K = z.current;
4171
4181
  F(!0);
4172
4182
  try {
4173
- const N = await l.getStateHistory({
4183
+ const A = await l.getStateHistory({
4174
4184
  threadId: K,
4175
4185
  checkpointId: j
4176
4186
  });
4177
4187
  if (z.current !== K)
4178
4188
  return;
4179
- const { checkpoints: X } = hr(N);
4189
+ const { checkpoints: X } = hr(A);
4180
4190
  if (X.length > 0) {
4181
- const ne = X[X.length - 1];
4182
- _((ne == null ? void 0 : ne.messages) ?? []), $(!!(ne != null && ne.nextCursor)), Z((ne == null ? void 0 : ne.nextCursor) ?? null);
4191
+ const te = X[X.length - 1];
4192
+ _((te == null ? void 0 : te.messages) ?? []), $(!!(te != null && te.nextCursor)), Z((te == null ? void 0 : te.nextCursor) ?? null);
4183
4193
  }
4184
- } catch (N) {
4185
- z.current === K && (s == null || s(String(N)));
4194
+ } catch (A) {
4195
+ z.current === K && (s == null || s(String(A)));
4186
4196
  } finally {
4187
4197
  F(!1);
4188
4198
  }
4189
4199
  }, [l, j, _, s]), nt = ge(async () => {
4190
- R([], {}), x(null), ie(), A([]), G([]), $(!1), Z(null), T(!1), ve(!1), F(!1), C(null);
4200
+ R([], {}), x(null), ie(), N([]), G([]), $(!1), Z(null), T(!1), ve(!1), F(!1), C(null);
4191
4201
  try {
4192
4202
  await l.getAgent("default");
4193
4203
  } catch (K) {
4194
4204
  console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:", K);
4195
4205
  }
4196
4206
  }, [R, ie, l]), Rt = ge(
4197
- async (K, N, X) => {
4198
- const ne = z.current;
4199
- if (!ne)
4207
+ async (K, A, X) => {
4208
+ const te = z.current;
4209
+ if (!te)
4200
4210
  throw new Error("No active thread to handle interrupt");
4201
- const fe = N ? X ?? !0 : !1;
4211
+ const fe = A ? X ?? !0 : !1;
4202
4212
  try {
4203
- const Re = {
4204
- threadId: ne,
4213
+ const we = {
4214
+ threadId: te,
4205
4215
  checkpointId: I.lastCheckpointId ?? void 0,
4206
4216
  checkpointNs: I.lastCheckpointNs ?? void 0,
4207
4217
  // The command is the key: backend extracts this and routes to LangGraph
4208
4218
  command: { kind: "resume", value: fe }
4209
4219
  };
4210
- Xe(Re);
4211
- } catch (Re) {
4212
- throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${K}:`, Re), Re;
4220
+ Xe(we);
4221
+ } catch (we) {
4222
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${K}:`, we), we;
4213
4223
  }
4214
4224
  },
4215
4225
  [I.lastCheckpointId, I.lastCheckpointNs, Xe]
@@ -4220,25 +4230,25 @@ function Xx({
4220
4230
  a == null || a(h);
4221
4231
  }, [h, a]);
4222
4232
  const pn = ge(
4223
- async (K, N) => {
4233
+ async (K, A) => {
4224
4234
  let X = z.current;
4225
- const ne = (K == null ? void 0 : K.text) ?? "", fe = (K == null ? void 0 : K.attachments) ?? [], Re = (ne == null ? void 0 : ne.trim()) ?? "", be = { ...(K == null ? void 0 : K.payload) ?? {} }, ze = Array.isArray(be.messages) ? be.messages : void 0;
4226
- ze && delete be.messages;
4235
+ const te = (K == null ? void 0 : K.text) ?? "", fe = (K == null ? void 0 : K.attachments) ?? [], we = (te == null ? void 0 : te.trim()) ?? "", Se = { ...(K == null ? void 0 : K.payload) ?? {} }, ze = Array.isArray(Se.messages) ? Se.messages : void 0;
4236
+ ze && delete Se.messages;
4227
4237
  const Me = !!(ze && ze.length);
4228
- if (!X && !Re && fe.length === 0 && !Me) return;
4238
+ if (!X && !we && fe.length === 0 && !Me) return;
4229
4239
  if (!X) {
4230
- const se = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), we = Array.from(
4240
+ const se = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0"), be = Array.from(
4231
4241
  { length: 4 },
4232
4242
  () => Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0")
4233
4243
  ).join("").slice(0, 16);
4234
- X = `${se}${we}`, D.current = X, x(X);
4244
+ X = `${se}${be}`, D.current = X, x(X);
4235
4245
  }
4236
4246
  const { contentParts: Ee, filesInfo: Wt } = await fx(
4237
4247
  l,
4238
4248
  fe
4239
4249
  ), Tn = [...Ee];
4240
- Re && Tn.push({ type: "text", text: ne });
4241
- const Vn = N == null ? void 0 : N.originalMessageId, ur = !!(N != null && N.edit && Vn), Pr = !Me && Tn.length > 0;
4250
+ we && Tn.push({ type: "text", text: te });
4251
+ const Vn = A == null ? void 0 : A.originalMessageId, ur = !!(A != null && A.edit && Vn), Pr = !Me && Tn.length > 0;
4242
4252
  let _n = null;
4243
4253
  Pr && (_n = {
4244
4254
  id: ur ? Vn : `msg-${Date.now()}`,
@@ -4247,16 +4257,16 @@ function Xx({
4247
4257
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4248
4258
  }, ur || L(_n));
4249
4259
  const Kn = Me ? ze : _n ? [_n] : [], k = {
4250
- ...be,
4260
+ ...Se,
4251
4261
  ...Wt.length ? { files_info: Wt } : {}
4252
4262
  };
4253
4263
  Kn.length ? k.messages = Kn : "messages" in k || (k.messages = []);
4254
4264
  const H = {
4255
4265
  threadId: X,
4256
4266
  payload: k,
4257
- checkpointId: (N == null ? void 0 : N.checkpointId) ?? I.lastCheckpointId ?? void 0,
4258
- checkpointNs: (N == null ? void 0 : N.checkpointNs) ?? I.lastCheckpointNs ?? void 0,
4259
- edit: !!(N != null && N.edit),
4267
+ checkpointId: (A == null ? void 0 : A.checkpointId) ?? I.lastCheckpointId ?? void 0,
4268
+ checkpointNs: (A == null ? void 0 : A.checkpointNs) ?? I.lastCheckpointNs ?? void 0,
4269
+ edit: !!(A != null && A.edit),
4260
4270
  timelineCheckpoints: W
4261
4271
  };
4262
4272
  Xe(H);
@@ -4381,7 +4391,7 @@ function oi({
4381
4391
  }
4382
4392
  ) });
4383
4393
  }
4384
- function te(...e) {
4394
+ function ne(...e) {
4385
4395
  return km(Im(e));
4386
4396
  }
4387
4397
  const Zx = ms(
@@ -4414,7 +4424,7 @@ const Zx = ms(
4414
4424
  return /* @__PURE__ */ u.jsx(
4415
4425
  i,
4416
4426
  {
4417
- className: te(Zx({ variant: t, size: n, className: e })),
4427
+ className: ne(Zx({ variant: t, size: n, className: e })),
4418
4428
  ref: s,
4419
4429
  ...o
4420
4430
  }
@@ -4426,7 +4436,7 @@ const Cu = v.forwardRef(
4426
4436
  ({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
4427
4437
  "textarea",
4428
4438
  {
4429
- className: te(
4439
+ className: ne(
4430
4440
  "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
4431
4441
  e
4432
4442
  ),
@@ -4479,7 +4489,7 @@ function Qx({
4479
4489
  id: Z,
4480
4490
  shouldClear: !0
4481
4491
  }, b(() => {
4482
- var B, A, W;
4492
+ var B, N, W;
4483
4493
  try {
4484
4494
  const G = l(j);
4485
4495
  G && typeof G.then == "function" ? G.then(() => {
@@ -4488,7 +4498,7 @@ function Qx({
4488
4498
  }).catch(() => {
4489
4499
  var oe;
4490
4500
  ((oe = C.current) == null ? void 0 : oe.id) === Z && (C.current = null);
4491
- }) : (((B = C.current) == null ? void 0 : B.id) === Z && C.current.shouldClear && (x || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((A = C.current) == null ? void 0 : A.id) === Z && (C.current = null));
4501
+ }) : (((B = C.current) == null ? void 0 : B.id) === Z && C.current.shouldClear && (x || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((N = C.current) == null ? void 0 : N.id) === Z && (C.current = null));
4492
4502
  } catch {
4493
4503
  ((W = C.current) == null ? void 0 : W.id) === Z && (C.current = null);
4494
4504
  }
@@ -5404,13 +5414,13 @@ const Ly = (e) => ({
5404
5414
  var $;
5405
5415
  const Z = ($ = L.filter((B) => {
5406
5416
  if (C) {
5407
- const A = xn(B.placement);
5408
- return A === w || // Create a bias to the `y` side axis due to horizontal
5417
+ const N = xn(B.placement);
5418
+ return N === w || // Create a bias to the `y` side axis due to horizontal
5409
5419
  // reading directions favoring greater width.
5410
- A === "y";
5420
+ N === "y";
5411
5421
  }
5412
5422
  return !0;
5413
- }).map((B) => [B.placement, B.overflows.filter((A) => A > 0).reduce((A, W) => A + W, 0)]).sort((B, A) => B[1] - A[1])[0]) == null ? void 0 : $[0];
5423
+ }).map((B) => [B.placement, B.overflows.filter((N) => N > 0).reduce((N, W) => N + W, 0)]).sort((B, N) => B[1] - N[1])[0]) == null ? void 0 : $[0];
5414
5424
  Z && (j = Z);
5415
5425
  break;
5416
5426
  }
@@ -6250,9 +6260,9 @@ function kv(e) {
6250
6260
  strategy: n,
6251
6261
  middleware: p
6252
6262
  };
6253
- P.current && (B.platform = P.current), Cv(C.current, I.current, B).then((A) => {
6263
+ P.current && (B.platform = P.current), Cv(C.current, I.current, B).then((N) => {
6254
6264
  const W = {
6255
- ...A,
6265
+ ...N,
6256
6266
  // The floating element's position may be recomputed while it's closed
6257
6267
  // but still mounted (such as when transitioning out). To ensure
6258
6268
  // `isPositioned` will be `false` initially on the next open, avoid
@@ -6296,16 +6306,16 @@ function kv(e) {
6296
6306
  };
6297
6307
  if (!j.floating)
6298
6308
  return B;
6299
- const A = Zl(j.floating, d.x), W = Zl(j.floating, d.y);
6309
+ const N = Zl(j.floating, d.x), W = Zl(j.floating, d.y);
6300
6310
  return a ? {
6301
6311
  ...B,
6302
- transform: "translate(" + A + "px, " + W + "px)",
6312
+ transform: "translate(" + N + "px, " + W + "px)",
6303
6313
  ...$u(j.floating) >= 1.5 && {
6304
6314
  willChange: "transform"
6305
6315
  }
6306
6316
  } : {
6307
6317
  position: n,
6308
- left: A,
6318
+ left: N,
6309
6319
  top: W
6310
6320
  };
6311
6321
  }, [n, a, j.floating, d.x, d.y]);
@@ -6467,7 +6477,7 @@ var ba = "PopperContent", [$v, Fv] = zu(ba), Ku = v.forwardRef(
6467
6477
  Hv({ arrowWidth: I, arrowHeight: R }),
6468
6478
  p && Pv({ strategy: "referenceHidden", ...$ })
6469
6479
  ]
6470
- }), [A, W] = Yu(j), G = At(x);
6480
+ }), [N, W] = Yu(j), G = At(x);
6471
6481
  Nt(() => {
6472
6482
  Z && (G == null || G());
6473
6483
  }, [Z, G]);
@@ -6502,7 +6512,7 @@ var ba = "PopperContent", [$v, Fv] = zu(ba), Ku = v.forwardRef(
6502
6512
  $v,
6503
6513
  {
6504
6514
  scope: n,
6505
- placedSide: A,
6515
+ placedSide: N,
6506
6516
  onArrowChange: S,
6507
6517
  arrowX: oe,
6508
6518
  arrowY: ve,
@@ -6510,7 +6520,7 @@ var ba = "PopperContent", [$v, Fv] = zu(ba), Ku = v.forwardRef(
6510
6520
  children: /* @__PURE__ */ u.jsx(
6511
6521
  Ae.div,
6512
6522
  {
6513
- "data-side": A,
6523
+ "data-side": N,
6514
6524
  "data-align": W,
6515
6525
  ...m,
6516
6526
  ref: b,
@@ -7468,17 +7478,17 @@ var en = "MenuContent", [eb, Ia] = sr(en), wd = v.forwardRef(
7468
7478
  onDismiss: h,
7469
7479
  disableOutsideScroll: x,
7470
7480
  ...m
7471
- } = e, y = ir(en, n), g = ho(en, n), w = Ps(n), b = gd(n), T = Gw(n), [S, C] = v.useState(null), I = v.useRef(null), R = Ke(t, I, y.onContentChange), _ = v.useRef(0), L = v.useRef(""), P = v.useRef(0), M = v.useRef(null), $ = v.useRef("right"), E = v.useRef(0), F = x ? js : v.Fragment, j = x ? { as: rb, allowPinchZoom: !0 } : void 0, Z = (A) => {
7481
+ } = e, y = ir(en, n), g = ho(en, n), w = Ps(n), b = gd(n), T = Gw(n), [S, C] = v.useState(null), I = v.useRef(null), R = Ke(t, I, y.onContentChange), _ = v.useRef(0), L = v.useRef(""), P = v.useRef(0), M = v.useRef(null), $ = v.useRef("right"), E = v.useRef(0), F = x ? js : v.Fragment, j = x ? { as: rb, allowPinchZoom: !0 } : void 0, Z = (N) => {
7472
7482
  var Y, D;
7473
- const W = L.current + A, G = T().filter((V) => !V.disabled), oe = document.activeElement, ve = (Y = G.find((V) => V.ref.current === oe)) == null ? void 0 : Y.textValue, je = G.map((V) => V.textValue), q = mb(je, W, ve), z = (D = G.find((V) => V.textValue === q)) == null ? void 0 : D.ref.current;
7483
+ const W = L.current + N, G = T().filter((V) => !V.disabled), oe = document.activeElement, ve = (Y = G.find((V) => V.ref.current === oe)) == null ? void 0 : Y.textValue, je = G.map((V) => V.textValue), q = mb(je, W, ve), z = (D = G.find((V) => V.textValue === q)) == null ? void 0 : D.ref.current;
7474
7484
  (function V(J) {
7475
7485
  L.current = J, window.clearTimeout(_.current), J !== "" && (_.current = window.setTimeout(() => V(""), 1e3));
7476
7486
  })(W), z && setTimeout(() => z.focus());
7477
7487
  };
7478
7488
  v.useEffect(() => () => window.clearTimeout(_.current), []), pa();
7479
- const B = v.useCallback((A) => {
7489
+ const B = v.useCallback((N) => {
7480
7490
  var G, oe;
7481
- return $.current === ((G = M.current) == null ? void 0 : G.side) && xb(A, (oe = M.current) == null ? void 0 : oe.area);
7491
+ return $.current === ((G = M.current) == null ? void 0 : G.side) && xb(N, (oe = M.current) == null ? void 0 : oe.area);
7482
7492
  }, []);
7483
7493
  return /* @__PURE__ */ u.jsx(
7484
7494
  eb,
@@ -7486,36 +7496,36 @@ var en = "MenuContent", [eb, Ia] = sr(en), wd = v.forwardRef(
7486
7496
  scope: n,
7487
7497
  searchRef: L,
7488
7498
  onItemEnter: v.useCallback(
7489
- (A) => {
7490
- B(A) && A.preventDefault();
7499
+ (N) => {
7500
+ B(N) && N.preventDefault();
7491
7501
  },
7492
7502
  [B]
7493
7503
  ),
7494
7504
  onItemLeave: v.useCallback(
7495
- (A) => {
7505
+ (N) => {
7496
7506
  var W;
7497
- B(A) || ((W = I.current) == null || W.focus(), C(null));
7507
+ B(N) || ((W = I.current) == null || W.focus(), C(null));
7498
7508
  },
7499
7509
  [B]
7500
7510
  ),
7501
7511
  onTriggerLeave: v.useCallback(
7502
- (A) => {
7503
- B(A) && A.preventDefault();
7512
+ (N) => {
7513
+ B(N) && N.preventDefault();
7504
7514
  },
7505
7515
  [B]
7506
7516
  ),
7507
7517
  pointerGraceTimerRef: P,
7508
- onPointerGraceIntentChange: v.useCallback((A) => {
7509
- M.current = A;
7518
+ onPointerGraceIntentChange: v.useCallback((N) => {
7519
+ M.current = N;
7510
7520
  }, []),
7511
7521
  children: /* @__PURE__ */ u.jsx(F, { ...j, children: /* @__PURE__ */ u.jsx(
7512
7522
  Ts,
7513
7523
  {
7514
7524
  asChild: !0,
7515
7525
  trapped: o,
7516
- onMountAutoFocus: ue(s, (A) => {
7526
+ onMountAutoFocus: ue(s, (N) => {
7517
7527
  var W;
7518
- A.preventDefault(), (W = I.current) == null || W.focus({ preventScroll: !0 });
7528
+ N.preventDefault(), (W = I.current) == null || W.focus({ preventScroll: !0 });
7519
7529
  }),
7520
7530
  onUnmountAutoFocus: i,
7521
7531
  children: /* @__PURE__ */ u.jsx(
@@ -7538,8 +7548,8 @@ var en = "MenuContent", [eb, Ia] = sr(en), wd = v.forwardRef(
7538
7548
  loop: r,
7539
7549
  currentTabStopId: S,
7540
7550
  onCurrentTabStopIdChange: C,
7541
- onEntryFocus: ue(l, (A) => {
7542
- g.isUsingKeyboardRef.current || A.preventDefault();
7551
+ onEntryFocus: ue(l, (N) => {
7552
+ g.isUsingKeyboardRef.current || N.preventDefault();
7543
7553
  }),
7544
7554
  preventScrollOnEntryFocus: !0,
7545
7555
  children: /* @__PURE__ */ u.jsx(
@@ -7554,25 +7564,25 @@ var en = "MenuContent", [eb, Ia] = sr(en), wd = v.forwardRef(
7554
7564
  ...m,
7555
7565
  ref: R,
7556
7566
  style: { outline: "none", ...m.style },
7557
- onKeyDown: ue(m.onKeyDown, (A) => {
7558
- const G = A.target.closest("[data-radix-menu-content]") === A.currentTarget, oe = A.ctrlKey || A.altKey || A.metaKey, ve = A.key.length === 1;
7559
- G && (A.key === "Tab" && A.preventDefault(), !oe && ve && Z(A.key));
7567
+ onKeyDown: ue(m.onKeyDown, (N) => {
7568
+ const G = N.target.closest("[data-radix-menu-content]") === N.currentTarget, oe = N.ctrlKey || N.altKey || N.metaKey, ve = N.key.length === 1;
7569
+ G && (N.key === "Tab" && N.preventDefault(), !oe && ve && Z(N.key));
7560
7570
  const je = I.current;
7561
- if (A.target !== je || !Vw.includes(A.key)) return;
7562
- A.preventDefault();
7571
+ if (N.target !== je || !Vw.includes(N.key)) return;
7572
+ N.preventDefault();
7563
7573
  const z = T().filter((Y) => !Y.disabled).map((Y) => Y.ref.current);
7564
- hd.includes(A.key) && z.reverse(), pb(z);
7574
+ hd.includes(N.key) && z.reverse(), pb(z);
7565
7575
  }),
7566
- onBlur: ue(e.onBlur, (A) => {
7567
- A.currentTarget.contains(A.target) || (window.clearTimeout(_.current), L.current = "");
7576
+ onBlur: ue(e.onBlur, (N) => {
7577
+ N.currentTarget.contains(N.target) || (window.clearTimeout(_.current), L.current = "");
7568
7578
  }),
7569
7579
  onPointerMove: ue(
7570
7580
  e.onPointerMove,
7571
- Jr((A) => {
7572
- const W = A.target, G = E.current !== A.clientX;
7573
- if (A.currentTarget.contains(W) && G) {
7574
- const oe = A.clientX > E.current ? "right" : "left";
7575
- $.current = oe, E.current = A.clientX;
7581
+ Jr((N) => {
7582
+ const W = N.target, G = E.current !== N.clientX;
7583
+ if (N.currentTarget.contains(W) && G) {
7584
+ const oe = N.clientX > E.current ? "right" : "left";
7585
+ $.current = oe, E.current = N.clientX;
7576
7586
  }
7577
7587
  })
7578
7588
  )
@@ -8106,7 +8116,7 @@ const Qb = Xb, e0 = Jb, t0 = v.forwardRef(({ className: e, inset: t, children: n
8106
8116
  sf,
8107
8117
  {
8108
8118
  ref: o,
8109
- className: te(
8119
+ className: ne(
8110
8120
  "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
8111
8121
  t && "pl-8",
8112
8122
  e
@@ -8123,7 +8133,7 @@ const n0 = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
8123
8133
  af,
8124
8134
  {
8125
8135
  ref: n,
8126
- className: te(
8136
+ className: ne(
8127
8137
  "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
8128
8138
  e
8129
8139
  ),
@@ -8136,7 +8146,7 @@ const lf = v.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
8136
8146
  {
8137
8147
  ref: r,
8138
8148
  sideOffset: t,
8139
- className: te(
8149
+ className: ne(
8140
8150
  "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
8141
8151
  e
8142
8152
  ),
@@ -8148,7 +8158,7 @@ const Bi = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
8148
8158
  ef,
8149
8159
  {
8150
8160
  ref: r,
8151
- className: te(
8161
+ className: ne(
8152
8162
  "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
8153
8163
  t && "pl-8",
8154
8164
  e
@@ -8161,7 +8171,7 @@ const r0 = v.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
8161
8171
  tf,
8162
8172
  {
8163
8173
  ref: o,
8164
- className: te(
8174
+ className: ne(
8165
8175
  "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
8166
8176
  e
8167
8177
  ),
@@ -8178,7 +8188,7 @@ const o0 = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
8178
8188
  nf,
8179
8189
  {
8180
8190
  ref: r,
8181
- className: te(
8191
+ className: ne(
8182
8192
  "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
8183
8193
  e
8184
8194
  ),
@@ -8194,7 +8204,7 @@ const s0 = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
8194
8204
  Qd,
8195
8205
  {
8196
8206
  ref: r,
8197
- className: te(
8207
+ className: ne(
8198
8208
  "px-2 py-1.5 text-sm font-semibold",
8199
8209
  t && "pl-8",
8200
8210
  e
@@ -8207,7 +8217,7 @@ const i0 = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
8207
8217
  of,
8208
8218
  {
8209
8219
  ref: n,
8210
- className: te("-mx-1 my-1 h-px bg-muted", e),
8220
+ className: ne("-mx-1 my-1 h-px bg-muted", e),
8211
8221
  ...t
8212
8222
  }
8213
8223
  ));
@@ -8514,7 +8524,7 @@ function dt(e = df) {
8514
8524
  e(t, r) || (t = r, n(r));
8515
8525
  };
8516
8526
  }
8517
- function Te(e) {
8527
+ function Ie(e) {
8518
8528
  return (t) => (n) => {
8519
8529
  e(n) && t(n);
8520
8530
  };
@@ -8672,7 +8682,7 @@ function It(...e) {
8672
8682
  }
8673
8683
  };
8674
8684
  }
8675
- function Ce(e, t = df) {
8685
+ function Te(e, t = df) {
8676
8686
  return U(e, dt(t));
8677
8687
  }
8678
8688
  function zi(...e) {
@@ -9187,7 +9197,7 @@ const B0 = {
9187
9197
  pe(
9188
9198
  U(
9189
9199
  l,
9190
- Te((S) => S.length > 0),
9200
+ Ie((S) => S.length > 0),
9191
9201
  $e(m, h),
9192
9202
  le(([S, C, I]) => {
9193
9203
  const R = S.reduce((_, L, P) => Kt(_, L, to(L, C.offsetTree, I) || P), vr());
@@ -9203,7 +9213,7 @@ const B0 = {
9203
9213
  U(
9204
9214
  r,
9205
9215
  $e(m),
9206
- Te(([S, { lastIndex: C }]) => S < C),
9216
+ Ie(([S, { lastIndex: C }]) => S < C),
9207
9217
  le(([S, { lastIndex: C, lastSize: I }]) => [
9208
9218
  {
9209
9219
  endIndex: C,
@@ -9224,7 +9234,7 @@ const B0 = {
9224
9234
  pe(
9225
9235
  U(
9226
9236
  d,
9227
- Te((S) => S !== void 0 && ct(St(m).sizeTree)),
9237
+ Ie((S) => S !== void 0 && ct(St(m).sizeTree)),
9228
9238
  le((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
9229
9239
  ),
9230
9240
  n
@@ -9430,7 +9440,7 @@ const Sf = Ze(
9430
9440
  ), pe(
9431
9441
  U(
9432
9442
  It(o, t, r),
9433
- Te(([l, c]) => Fs(c)),
9443
+ Ie(([l, c]) => Fs(c)),
9434
9444
  le(([l, c, d]) => un(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
9435
9445
  dt(),
9436
9446
  le((l) => [l])
@@ -9444,7 +9454,7 @@ const Sf = Ze(
9444
9454
  const t = ee(!1), n = Gt(
9445
9455
  U(
9446
9456
  t,
9447
- Te((r) => r),
9457
+ Ie((r) => r),
9448
9458
  dt()
9449
9459
  )
9450
9460
  );
@@ -9491,9 +9501,9 @@ const mo = Ze(
9491
9501
  $,
9492
9502
  E
9493
9503
  ]) => {
9494
- const F = Cf(T), { align: j, behavior: Z, offset: B } = F, A = I - 1, W = bf(F, S, A);
9504
+ const F = Cf(T), { align: j, behavior: Z, offset: B } = F, N = I - 1, W = bf(F, S, N);
9495
9505
  let G = to(W, S.offsetTree, M) + _;
9496
- j === "end" ? (G += $ + un(S.sizeTree, W)[1] - C + E, W === A && (G += L)) : j === "center" ? G += ($ + un(S.sizeTree, W)[1] - C + E) / 2 : G -= R, B && (G += B);
9506
+ j === "end" ? (G += $ + un(S.sizeTree, W)[1] - C + E, W === N && (G += L)) : j === "center" ? G += ($ + un(S.sizeTree, W)[1] - C + E) / 2 : G -= R, B && (G += B);
9497
9507
  const oe = (ve) => {
9498
9508
  b(), ve ? (P("retrying to scroll to", { location: T }, Ut.DEBUG), Pe(h, T)) : (Pe(x, !0), P("list did not change, scroll successful", {}, Ut.DEBUG));
9499
9509
  };
@@ -9548,7 +9558,7 @@ const go = Ze(
9548
9558
  U(
9549
9559
  i,
9550
9560
  $e(l),
9551
- Te(([d, f]) => !!f),
9561
+ Ie(([d, f]) => !!f),
9552
9562
  mn(!1)
9553
9563
  ),
9554
9564
  a
@@ -9556,7 +9566,7 @@ const go = Ze(
9556
9566
  U(
9557
9567
  i,
9558
9568
  $e(l),
9559
- Te(([d, f]) => !!f),
9569
+ Ie(([d, f]) => !!f),
9560
9570
  mn(!1)
9561
9571
  ),
9562
9572
  c
@@ -9564,7 +9574,7 @@ const go = Ze(
9564
9574
  U(
9565
9575
  It(t, i),
9566
9576
  $e(a, n, e, c),
9567
- Te(([[, d], f, { sizeTree: p }, h, x]) => d && (!ct(p) || Na(h)) && !f && !x),
9577
+ Ie(([[, d], f, { sizeTree: p }, h, x]) => d && (!ct(p) || Na(h)) && !f && !x),
9568
9578
  $e(l)
9569
9579
  ),
9570
9580
  ([, d]) => {
@@ -9600,7 +9610,7 @@ const no = "up", zr = "down", W0 = "none", V0 = {
9600
9610
  }, K0 = 0, xo = Ze(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
9601
9611
  const i = ee(!1), a = ee(!0), l = Ve(), c = Ve(), d = ee(4), f = ee(K0), p = Dt(
9602
9612
  U(
9603
- zi(U(Ce(o), tr(1), mn(!0)), U(Ce(o), tr(1), mn(!1), ac(100))),
9613
+ zi(U(Te(o), tr(1), mn(!0)), U(Te(o), tr(1), mn(!1), ac(100))),
9604
9614
  dt()
9605
9615
  ),
9606
9616
  !1
@@ -9610,7 +9620,7 @@ const no = "up", zr = "down", W0 = "none", V0 = {
9610
9620
  );
9611
9621
  pe(
9612
9622
  U(
9613
- It(Ce(o), Ce(f)),
9623
+ It(Te(o), Te(f)),
9614
9624
  le(([w, b]) => w <= b),
9615
9625
  dt()
9616
9626
  ),
@@ -9618,7 +9628,7 @@ const no = "up", zr = "down", W0 = "none", V0 = {
9618
9628
  ), pe(U(a, In(50)), c);
9619
9629
  const x = Gt(
9620
9630
  U(
9621
- It(r, Ce(s), Ce(t), Ce(e), Ce(d)),
9631
+ It(r, Te(s), Te(t), Te(e), Te(d)),
9622
9632
  yn((w, [{ scrollHeight: b, scrollTop: T }, S, C, I, R]) => {
9623
9633
  const _ = T + S - b > -R, L = {
9624
9634
  scrollHeight: b,
@@ -9672,7 +9682,7 @@ const no = "up", zr = "down", W0 = "none", V0 = {
9672
9682
  },
9673
9683
  { changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
9674
9684
  ),
9675
- Te((w) => w.changed),
9685
+ Ie((w) => w.changed),
9676
9686
  le((w) => w.jump)
9677
9687
  ),
9678
9688
  0
@@ -9702,7 +9712,7 @@ const no = "up", zr = "down", W0 = "none", V0 = {
9702
9712
  return pe(
9703
9713
  U(
9704
9714
  p,
9705
- Te((w) => !w),
9715
+ Ie((w) => !w),
9706
9716
  mn(0)
9707
9717
  ),
9708
9718
  g
@@ -9711,7 +9721,7 @@ const no = "up", zr = "down", W0 = "none", V0 = {
9711
9721
  o,
9712
9722
  In(100),
9713
9723
  $e(p),
9714
- Te(([w, b]) => !!b),
9724
+ Ie(([w, b]) => !!b),
9715
9725
  yn(([w, b], [T]) => [b, T], [0, 0]),
9716
9726
  le(([w, b]) => b - w)
9717
9727
  ),
@@ -9742,15 +9752,15 @@ const La = Ze(
9742
9752
  const s = Ve(), i = ee(0), a = ee(0), l = ee(0), c = Dt(
9743
9753
  U(
9744
9754
  It(
9745
- Ce(r),
9746
- Ce(o),
9747
- Ce(n),
9748
- Ce(s, eo),
9749
- Ce(l),
9750
- Ce(i),
9751
- Ce(t),
9752
- Ce(e),
9753
- Ce(a)
9755
+ Te(r),
9756
+ Te(o),
9757
+ Te(n),
9758
+ Te(s, eo),
9759
+ Te(l),
9760
+ Te(i),
9761
+ Te(t),
9762
+ Te(e),
9763
+ Te(a)
9754
9764
  ),
9755
9765
  le(
9756
9766
  ([
@@ -9773,7 +9783,7 @@ const La = Ze(
9773
9783
  ] : null;
9774
9784
  }
9775
9785
  ),
9776
- Te((d) => d != null),
9786
+ Ie((d) => d != null),
9777
9787
  dt(eo)
9778
9788
  ),
9779
9789
  [0, 0]
@@ -9893,17 +9903,17 @@ const lr = Ze(
9893
9903
  It(
9894
9904
  h,
9895
9905
  x,
9896
- Ce(l, eo),
9897
- Ce(o),
9898
- Ce(r),
9899
- Ce(c),
9906
+ Te(l, eo),
9907
+ Te(o),
9908
+ Te(r),
9909
+ Te(c),
9900
9910
  d,
9901
- Ce(m),
9902
- Ce(t),
9903
- Ce(n),
9911
+ Te(m),
9912
+ Te(t),
9913
+ Te(n),
9904
9914
  e
9905
9915
  ),
9906
- Te(([C, I, , R, , , , , , , _]) => {
9916
+ Ie(([C, I, , R, , , , , , , _]) => {
9907
9917
  const L = _ && _.length !== R;
9908
9918
  return C && !I && !L;
9909
9919
  }),
@@ -9921,13 +9931,13 @@ const lr = Ze(
9921
9931
  E,
9922
9932
  F
9923
9933
  ]) => {
9924
- const j = _, { offsetTree: Z, sizeTree: B } = j, A = St(y);
9934
+ const j = _, { offsetTree: Z, sizeTree: B } = j, N = St(y);
9925
9935
  if (R === 0)
9926
9936
  return { ...gi, totalCount: R };
9927
9937
  if (C === 0 && I === 0)
9928
- return A === 0 ? { ...gi, totalCount: R } : If(A, L, _, $, E, F || []);
9938
+ return N === 0 ? { ...gi, totalCount: R } : If(N, L, _, $, E, F || []);
9929
9939
  if (ct(B))
9930
- return A > 0 ? null : Ho(
9940
+ return N > 0 ? null : Ho(
9931
9941
  q0(Da(L, R), j, F),
9932
9942
  [],
9933
9943
  R,
@@ -9970,7 +9980,7 @@ const lr = Ze(
9970
9980
  }
9971
9981
  ),
9972
9982
  //@ts-expect-error filter needs to be fixed
9973
- Te((C) => C !== null),
9983
+ Ie((C) => C !== null),
9974
9984
  dt()
9975
9985
  ),
9976
9986
  gi
@@ -9978,7 +9988,7 @@ const lr = Ze(
9978
9988
  pe(
9979
9989
  U(
9980
9990
  e,
9981
- Te(Na),
9991
+ Ie(Na),
9982
9992
  le((C) => C == null ? void 0 : C.length)
9983
9993
  ),
9984
9994
  o
@@ -10004,9 +10014,9 @@ const lr = Ze(
10004
10014
  const b = Gt(
10005
10015
  U(
10006
10016
  w,
10007
- Te(({ items: C }) => C.length > 0),
10017
+ Ie(({ items: C }) => C.length > 0),
10008
10018
  $e(o, e),
10009
- Te(([{ items: C }, I]) => C[C.length - 1].originalIndex === I - 1),
10019
+ Ie(([{ items: C }, I]) => C[C.length - 1].originalIndex === I - 1),
10010
10020
  le(([, C, I]) => [C - 1, I]),
10011
10021
  dt(eo),
10012
10022
  le(([C]) => C)
@@ -10015,14 +10025,14 @@ const lr = Ze(
10015
10025
  U(
10016
10026
  w,
10017
10027
  In(200),
10018
- Te(({ items: C, topItems: I }) => C.length > 0 && C[0].originalIndex === I.length),
10028
+ Ie(({ items: C, topItems: I }) => C.length > 0 && C[0].originalIndex === I.length),
10019
10029
  le(({ items: C }) => C[0].index),
10020
10030
  dt()
10021
10031
  )
10022
10032
  ), S = Gt(
10023
10033
  U(
10024
10034
  w,
10025
- Te(({ items: C }) => C.length > 0),
10035
+ Ie(({ items: C }) => C.length > 0),
10026
10036
  le(({ items: C }) => {
10027
10037
  let I = 0, R = C.length - 1;
10028
10038
  for (; C[I].type === "group" && I < R; )
@@ -10059,7 +10069,7 @@ const lr = Ze(
10059
10069
  ),
10060
10070
  0
10061
10071
  );
10062
- return pe(Ce(i), s), { totalListHeight: i, totalListHeightChanged: s };
10072
+ return pe(Te(i), s), { totalListHeight: i, totalListHeightChanged: s };
10063
10073
  },
10064
10074
  ft(Bt, lr),
10065
10075
  { singleton: !0 }
@@ -10068,7 +10078,7 @@ const lr = Ze(
10068
10078
  const n = ee(!1), r = Dt(
10069
10079
  U(
10070
10080
  It(n, e, t),
10071
- Te(([o]) => o),
10081
+ Ie(([o]) => o),
10072
10082
  le(([, o, s]) => Math.max(0, o - s)),
10073
10083
  In(0),
10074
10084
  dt()
@@ -10110,7 +10120,7 @@ const lr = Ze(
10110
10120
  return E ? I && an(
10111
10121
  U(
10112
10122
  i,
10113
- Te((F) => !F),
10123
+ Ie((F) => !F),
10114
10124
  // skips the initial publish of false, and the cleanup call.
10115
10125
  // but if scrollingInProgress is true, we skip the initial publish.
10116
10126
  tr(St(i) ? 1 : 2)
@@ -10118,7 +10128,7 @@ const lr = Ze(
10118
10128
  I
10119
10129
  ) : I && I(), E;
10120
10130
  }),
10121
- Te((f) => f !== null)
10131
+ Ie((f) => f !== null)
10122
10132
  ),
10123
10133
  c
10124
10134
  ), {
@@ -10154,13 +10164,13 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10154
10164
  }
10155
10165
  ot(
10156
10166
  U(
10157
- It(U(Ce(t), tr(1)), l),
10158
- $e(Ce(x), s, a, f),
10167
+ It(U(Te(t), tr(1)), l),
10168
+ $e(Te(x), s, a, f),
10159
10169
  le(([[S, C], I, R, _, L]) => {
10160
10170
  let P = C && _, M = "auto";
10161
10171
  return P && (M = X0(I, R || L), P = P && !!M), { followOutputBehavior: M, shouldFollow: P, totalCount: S };
10162
10172
  }),
10163
- Te(({ shouldFollow: S }) => S)
10173
+ Ie(({ shouldFollow: S }) => S)
10164
10174
  ),
10165
10175
  ({ followOutputBehavior: S, totalCount: C }) => {
10166
10176
  y && (y(), y = null), St(n) ? requestAnimationFrame(() => {
@@ -10178,13 +10188,13 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10178
10188
  }
10179
10189
  ot(
10180
10190
  U(
10181
- It(Ce(x), t, c),
10182
- Te(([S, , C]) => S && C),
10191
+ It(Te(x), t, c),
10192
+ Ie(([S, , C]) => S && C),
10183
10193
  yn(
10184
10194
  ({ value: S }, [, C]) => ({ refreshed: S === C, value: C }),
10185
10195
  { refreshed: !1, value: 0 }
10186
10196
  ),
10187
- Te(({ refreshed: S }) => S),
10197
+ Ie(({ refreshed: S }) => S),
10188
10198
  $e(x, t)
10189
10199
  ),
10190
10200
  ([, S]) => {
@@ -10192,28 +10202,28 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10192
10202
  }
10193
10203
  ), ot(m, () => {
10194
10204
  w(St(x) !== !1);
10195
- }), ot(It(Ce(x), o), ([S, C]) => {
10205
+ }), ot(It(Te(x), o), ([S, C]) => {
10196
10206
  S && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
10197
10207
  });
10198
10208
  const b = ee(null), T = Ve();
10199
10209
  return pe(
10200
10210
  zi(
10201
10211
  U(
10202
- Ce(r),
10212
+ Te(r),
10203
10213
  le((S) => {
10204
10214
  var C;
10205
10215
  return (C = S == null ? void 0 : S.length) != null ? C : 0;
10206
10216
  })
10207
10217
  ),
10208
- U(Ce(t))
10218
+ U(Te(t))
10209
10219
  ),
10210
10220
  T
10211
10221
  ), ot(
10212
10222
  U(
10213
10223
  It(U(T, tr(1)), l),
10214
- $e(Ce(b), a, f, p),
10224
+ $e(Te(b), a, f, p),
10215
10225
  le(([[S, C], I, R, _, L]) => C && R && (I == null ? void 0 : I({ context: L, totalCount: S, scrollingInProgress: _ }))),
10216
- Te((S) => !!S),
10226
+ Ie((S) => !!S),
10217
10227
  In(0)
10218
10228
  ),
10219
10229
  (S) => {
@@ -10241,7 +10251,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10241
10251
  U(
10242
10252
  a,
10243
10253
  $e(s),
10244
- Te(([, l]) => l !== 0),
10254
+ Ie(([, l]) => l !== 0),
10245
10255
  $e(o, r, t, n, e),
10246
10256
  le(([[, l], c, d, f, p, h = []]) => If(l, c, d, f, p, h))
10247
10257
  ),
@@ -10256,7 +10266,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10256
10266
  U(
10257
10267
  e,
10258
10268
  $e(r),
10259
- Te(([, o]) => o !== 0),
10269
+ Ie(([, o]) => o !== 0),
10260
10270
  le(([, o]) => ({ top: o }))
10261
10271
  ),
10262
10272
  (o) => {
@@ -10264,7 +10274,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10264
10274
  U(
10265
10275
  n,
10266
10276
  tr(1),
10267
- Te((s) => s.items.length > 1)
10277
+ Ie((s) => s.items.length > 1)
10268
10278
  ),
10269
10279
  () => {
10270
10280
  requestAnimationFrame(() => {
@@ -10286,7 +10296,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10286
10296
  U(
10287
10297
  e,
10288
10298
  $e(r, t, n),
10289
- Te(([o, s]) => !!s),
10299
+ Ie(([o, s]) => !!s),
10290
10300
  le(([o, s, i, a]) => {
10291
10301
  const { enter: l, exit: c } = s;
10292
10302
  if (i) {
@@ -10358,11 +10368,11 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10358
10368
  const T = L0(x.sizeTree);
10359
10369
  y && g !== null && w !== null && (m = g.scrollTop - w.offsetTop), m -= b, h({ ranges: T, scrollTop: m });
10360
10370
  }
10361
- ), pe(U(d, Te(Na), le(tS)), o), pe(
10371
+ ), pe(U(d, Ie(Na), le(tS)), o), pe(
10362
10372
  U(
10363
10373
  s,
10364
10374
  $e(d),
10365
- Te(([, h]) => h !== void 0),
10375
+ Ie(([, h]) => h !== void 0),
10366
10376
  dt(),
10367
10377
  le(([, h]) => h.ranges)
10368
10378
  ),
@@ -10382,7 +10392,7 @@ const nS = Ze(([{ topItemsIndexes: e }]) => {
10382
10392
  return pe(
10383
10393
  U(
10384
10394
  t,
10385
- Te((n) => n >= 0),
10395
+ Ie((n) => n >= 0),
10386
10396
  le((n) => Array.from({ length: n }).map((r, o) => o))
10387
10397
  ),
10388
10398
  e
@@ -10413,9 +10423,9 @@ const rS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10413
10423
  },
10414
10424
  [0, [], 0, 0]
10415
10425
  ),
10416
- Te(([g]) => g !== 0),
10426
+ Ie(([g]) => g !== 0),
10417
10427
  $e(r, a, n, o, h, x),
10418
- Te(([, g, w, b, , , T]) => !T && !b && g !== 0 && w === no),
10428
+ Ie(([, g, w, b, , , T]) => !T && !b && g !== 0 && w === no),
10419
10429
  le(([[g], , , , , w]) => (w("Upward scrolling compensation", { amount: g }, Ut.DEBUG), g))
10420
10430
  )
10421
10431
  );
@@ -10427,7 +10437,7 @@ const rS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10427
10437
  }), ot(
10428
10438
  U(
10429
10439
  It(Dt(s, !1), e, x),
10430
- Te(([g, w, b]) => !g && !b && w !== 0),
10440
+ Ie(([g, w, b]) => !g && !b && w !== 0),
10431
10441
  le(([g, w]) => w),
10432
10442
  In(1)
10433
10443
  ),
@@ -10771,7 +10781,7 @@ const lS = /* @__PURE__ */ Ze(() => {
10771
10781
  ([e, t]) => ({ ...e, ...t }),
10772
10782
  ft(_f, lS)
10773
10783
  ), uS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), dS = { overflowAnchor: "none", position: Fa(), zIndex: 1 }, Lf = { overflowAnchor: "none" }, fS = { ...Lf, display: "inline-block", height: "100%" }, xc = /* @__PURE__ */ Q.memo(function({ showTopList: e = !1 }) {
10774
- const t = ke("listState"), n = Zt("sizeRanges"), r = ke("useWindowScroll"), o = ke("customScrollParent"), s = Zt("windowScrollContainerState"), i = Zt("scrollContainerState"), a = o || r ? s : i, l = ke("itemContent"), c = ke("context"), d = ke("groupContent"), f = ke("trackItemSizes"), p = ke("itemSize"), h = ke("log"), x = Zt("gap"), m = ke("horizontalDirection"), { callbackRef: y } = R0(
10784
+ const t = Re("listState"), n = Zt("sizeRanges"), r = Re("useWindowScroll"), o = Re("customScrollParent"), s = Zt("windowScrollContainerState"), i = Zt("scrollContainerState"), a = o || r ? s : i, l = Re("itemContent"), c = Re("context"), d = Re("groupContent"), f = Re("trackItemSizes"), p = Re("itemSize"), h = Re("log"), x = Zt("gap"), m = Re("horizontalDirection"), { callbackRef: y } = R0(
10775
10785
  n,
10776
10786
  p,
10777
10787
  f,
@@ -10780,12 +10790,12 @@ const lS = /* @__PURE__ */ Ze(() => {
10780
10790
  x,
10781
10791
  o,
10782
10792
  m,
10783
- ke("skipAnimationFrameInResizeObserver")
10793
+ Re("skipAnimationFrameInResizeObserver")
10784
10794
  ), [g, w] = Q.useState(0);
10785
10795
  za("deviation", (E) => {
10786
10796
  g !== E && w(E);
10787
10797
  });
10788
- const b = ke("EmptyPlaceholder"), T = ke("ScrollSeekPlaceholder") || uS, S = ke("ListComponent"), C = ke("ItemComponent"), I = ke("GroupComponent"), R = ke("computeItemKey"), _ = ke("isSeeking"), L = ke("groupIndices").length > 0, P = ke("alignToBottom"), M = ke("initialItemFinalLocationReached"), $ = e ? {} : {
10798
+ const b = Re("EmptyPlaceholder"), T = Re("ScrollSeekPlaceholder") || uS, S = Re("ListComponent"), C = Re("ItemComponent"), I = Re("GroupComponent"), R = Re("computeItemKey"), _ = Re("isSeeking"), L = Re("groupIndices").length > 0, P = Re("alignToBottom"), M = Re("initialItemFinalLocationReached"), $ = e ? {} : {
10789
10799
  boxSizing: "border-box",
10790
10800
  ...m ? {
10791
10801
  display: "inline-block",
@@ -10878,7 +10888,7 @@ function gS(e, t) {
10878
10888
  return { item: typeof e == "string" ? void 0 : t };
10879
10889
  }
10880
10890
  const xS = /* @__PURE__ */ Q.memo(function() {
10881
- const e = ke("HeaderComponent"), t = Zt("headerHeight"), n = ke("HeaderFooterTag"), r = ar(
10891
+ const e = Re("HeaderComponent"), t = Zt("headerHeight"), n = Re("HeaderFooterTag"), r = ar(
10882
10892
  Q.useMemo(
10883
10893
  () => (s) => {
10884
10894
  t(Ln(s, "height"));
@@ -10886,11 +10896,11 @@ const xS = /* @__PURE__ */ Q.memo(function() {
10886
10896
  [t]
10887
10897
  ),
10888
10898
  !0,
10889
- ke("skipAnimationFrameInResizeObserver")
10890
- ), o = ke("context");
10899
+ Re("skipAnimationFrameInResizeObserver")
10900
+ ), o = Re("context");
10891
10901
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
10892
10902
  }), yS = /* @__PURE__ */ Q.memo(function() {
10893
- const e = ke("FooterComponent"), t = Zt("footerHeight"), n = ke("HeaderFooterTag"), r = ar(
10903
+ const e = Re("FooterComponent"), t = Zt("footerHeight"), n = Re("HeaderFooterTag"), r = ar(
10894
10904
  Q.useMemo(
10895
10905
  () => (s) => {
10896
10906
  t(Ln(s, "height"));
@@ -10898,8 +10908,8 @@ const xS = /* @__PURE__ */ Q.memo(function() {
10898
10908
  [t]
10899
10909
  ),
10900
10910
  !0,
10901
- ke("skipAnimationFrameInResizeObserver")
10902
- ), o = ke("context");
10911
+ Re("skipAnimationFrameInResizeObserver")
10912
+ ), o = Re("context");
10903
10913
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
10904
10914
  });
10905
10915
  function $f({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
@@ -10955,27 +10965,27 @@ function Ff({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10955
10965
  });
10956
10966
  }
10957
10967
  const vS = ({ children: e }) => {
10958
- const t = Q.useContext(Pf), n = Zt("viewportHeight"), r = Zt("fixedItemHeight"), o = ke("alignToBottom"), s = ke("horizontalDirection"), i = Q.useMemo(
10968
+ const t = Q.useContext(Pf), n = Zt("viewportHeight"), r = Zt("fixedItemHeight"), o = Re("alignToBottom"), s = Re("horizontalDirection"), i = Q.useMemo(
10959
10969
  () => uf(n, (l) => Ln(l, s ? "width" : "height")),
10960
10970
  [n, s]
10961
- ), a = ar(i, !0, ke("skipAnimationFrameInResizeObserver"));
10971
+ ), a = ar(i, !0, Re("skipAnimationFrameInResizeObserver"));
10962
10972
  return Q.useEffect(() => {
10963
10973
  t && (n(t.viewportHeight), r(t.itemHeight));
10964
10974
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: Bs(o), children: e });
10965
10975
  }, wS = ({ children: e }) => {
10966
- const t = Q.useContext(Pf), n = Zt("windowViewportRect"), r = Zt("fixedItemHeight"), o = ke("customScrollParent"), s = ff(
10976
+ const t = Q.useContext(Pf), n = Zt("windowViewportRect"), r = Zt("fixedItemHeight"), o = Re("customScrollParent"), s = ff(
10967
10977
  n,
10968
10978
  o,
10969
- ke("skipAnimationFrameInResizeObserver")
10970
- ), i = ke("alignToBottom");
10979
+ Re("skipAnimationFrameInResizeObserver")
10980
+ ), i = Re("alignToBottom");
10971
10981
  return Q.useEffect(() => {
10972
10982
  t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
10973
10983
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: Bs(i), children: e });
10974
10984
  }, bS = ({ children: e }) => {
10975
- const t = ke("TopItemListComponent") || "div", n = ke("headerHeight"), r = { ...mS, marginTop: `${n}px` }, o = ke("context");
10985
+ const t = Re("TopItemListComponent") || "div", n = Re("headerHeight"), r = { ...mS, marginTop: `${n}px` }, o = Re("context");
10976
10986
  return /* @__PURE__ */ u.jsx(t, { style: r, ...Ot(t, o), children: e });
10977
10987
  }, SS = /* @__PURE__ */ Q.memo(function(e) {
10978
- const t = ke("useWindowScroll"), n = ke("topItemsIndexes").length > 0, r = ke("customScrollParent"), o = ke("context");
10988
+ const t = Re("useWindowScroll"), n = Re("topItemsIndexes").length > 0, r = Re("customScrollParent"), o = Re("context");
10979
10989
  return /* @__PURE__ */ u.jsxs(r || t ? IS : TS, { ...e, context: o, children: [
10980
10990
  n && /* @__PURE__ */ u.jsx(bS, { children: /* @__PURE__ */ u.jsx(xc, { showTopList: !0 }) }),
10981
10991
  /* @__PURE__ */ u.jsxs(r || t ? wS : vS, { children: [
@@ -10987,7 +10997,7 @@ const vS = ({ children: e }) => {
10987
10997
  }), {
10988
10998
  Component: CS,
10989
10999
  useEmitter: za,
10990
- useEmitterValue: ke,
11000
+ useEmitterValue: Re,
10991
11001
  usePublisher: Zt
10992
11002
  } = /* @__PURE__ */ jf(
10993
11003
  cS,
@@ -11048,7 +11058,7 @@ const vS = ({ children: e }) => {
11048
11058
  }
11049
11059
  },
11050
11060
  SS
11051
- ), TS = /* @__PURE__ */ $f({ useEmitter: za, useEmitterValue: ke, usePublisher: Zt }), IS = /* @__PURE__ */ Ff({ useEmitter: za, useEmitterValue: ke, usePublisher: Zt }), kS = CS, RS = /* @__PURE__ */ Ze(() => {
11061
+ ), TS = /* @__PURE__ */ $f({ useEmitter: za, useEmitterValue: Re, usePublisher: Zt }), IS = /* @__PURE__ */ Ff({ useEmitter: za, useEmitterValue: Re, usePublisher: Zt }), kS = CS, RS = /* @__PURE__ */ Ze(() => {
11052
11062
  const e = ee((c) => /* @__PURE__ */ u.jsxs("td", { children: [
11053
11063
  "Item $",
11054
11064
  c
@@ -11128,20 +11138,20 @@ const _S = /* @__PURE__ */ Ze(
11128
11138
  { customScrollParent: y, useWindowScroll: g, windowScrollContainerState: w, windowScrollTo: b, windowViewportRect: T },
11129
11139
  S
11130
11140
  ]) => {
11131
- const C = ee(0), I = ee(0), R = ee(yc), _ = ee({ height: 0, width: 0 }), L = ee({ height: 0, width: 0 }), P = Ve(), M = Ve(), $ = ee(0), E = ee(null), F = ee({ column: 0, row: 0 }), j = Ve(), Z = Ve(), B = ee(!1), A = ee(0), W = ee(!0), G = ee(!1), oe = ee(!1);
11141
+ const C = ee(0), I = ee(0), R = ee(yc), _ = ee({ height: 0, width: 0 }), L = ee({ height: 0, width: 0 }), P = Ve(), M = Ve(), $ = ee(0), E = ee(null), F = ee({ column: 0, row: 0 }), j = Ve(), Z = Ve(), B = ee(!1), N = ee(0), W = ee(!0), G = ee(!1), oe = ee(!1);
11132
11142
  ot(
11133
11143
  U(
11134
11144
  x,
11135
- $e(A),
11136
- Te(([D, V]) => !!V)
11145
+ $e(N),
11146
+ Ie(([D, V]) => !!V)
11137
11147
  ),
11138
11148
  () => {
11139
11149
  Pe(W, !1);
11140
11150
  }
11141
11151
  ), ot(
11142
11152
  U(
11143
- It(x, W, L, _, A, G),
11144
- Te(([D, V, J, ae, , re]) => D && !V && J.height !== 0 && ae.height !== 0 && !re)
11153
+ It(x, W, L, _, N, G),
11154
+ Ie(([D, V, J, ae, , re]) => D && !V && J.height !== 0 && ae.height !== 0 && !re)
11145
11155
  ),
11146
11156
  ([, , , , D]) => {
11147
11157
  Pe(G, !0), Oa(1, () => {
@@ -11153,7 +11163,7 @@ const _S = /* @__PURE__ */ Ze(
11153
11163
  ), pe(
11154
11164
  U(
11155
11165
  Z,
11156
- Te((D) => D != null && D.scrollTop > 0),
11166
+ Ie((D) => D != null && D.scrollTop > 0),
11157
11167
  mn(0)
11158
11168
  ),
11159
11169
  I
@@ -11161,7 +11171,7 @@ const _S = /* @__PURE__ */ Ze(
11161
11171
  U(
11162
11172
  x,
11163
11173
  $e(Z),
11164
- Te(([, D]) => D != null)
11174
+ Ie(([, D]) => D != null)
11165
11175
  ),
11166
11176
  ([, D]) => {
11167
11177
  D && (Pe(_, D.viewport), Pe(L, D.item), Pe(F, D.gap), D.scrollTop > 0 && (Pe(B, !0), an(U(c, tr(1)), (V) => {
@@ -11177,10 +11187,10 @@ const _S = /* @__PURE__ */ Ze(
11177
11187
  ), pe(
11178
11188
  U(
11179
11189
  It(
11180
- Ce(_, Eo),
11181
- Ce(L, Eo),
11182
- Ce(F, (D, V) => D && D.column === V.column && D.row === V.row),
11183
- Ce(c)
11190
+ Te(_, Eo),
11191
+ Te(L, Eo),
11192
+ Te(F, (D, V) => D && D.column === V.column && D.row === V.row),
11193
+ Te(c)
11184
11194
  ),
11185
11195
  le(([D, V, J, ae]) => ({
11186
11196
  gap: J,
@@ -11193,18 +11203,18 @@ const _S = /* @__PURE__ */ Ze(
11193
11203
  ), pe(
11194
11204
  U(
11195
11205
  It(
11196
- Ce(C),
11206
+ Te(C),
11197
11207
  r,
11198
- Ce(F, NS),
11199
- Ce(L, Eo),
11200
- Ce(_, Eo),
11201
- Ce(E),
11202
- Ce(I),
11203
- Ce(B),
11204
- Ce(W),
11205
- Ce(A)
11208
+ Te(F, NS),
11209
+ Te(L, Eo),
11210
+ Te(_, Eo),
11211
+ Te(E),
11212
+ Te(I),
11213
+ Te(B),
11214
+ Te(W),
11215
+ Te(N)
11206
11216
  ),
11207
- Te(([, , , , , , , D]) => !D),
11217
+ Ie(([, , , , , , , D]) => !D),
11208
11218
  le(
11209
11219
  ([
11210
11220
  D,
@@ -11237,14 +11247,14 @@ const _S = /* @__PURE__ */ Ze(
11237
11247
  ), pe(
11238
11248
  U(
11239
11249
  E,
11240
- Te((D) => D !== null),
11250
+ Ie((D) => D !== null),
11241
11251
  le((D) => D.length)
11242
11252
  ),
11243
11253
  C
11244
11254
  ), pe(
11245
11255
  U(
11246
11256
  It(_, L, R, F),
11247
- Te(([D, V, { items: J }]) => J.length > 0 && V.height !== 0 && D.height !== 0),
11257
+ Ie(([D, V, { items: J }]) => J.length > 0 && V.height !== 0 && D.height !== 0),
11248
11258
  le(([D, V, { items: J }, ae]) => {
11249
11259
  const { bottom: re, top: Ne } = Sc(D, ae, V, J);
11250
11260
  return [Ne, re];
@@ -11265,9 +11275,9 @@ const _S = /* @__PURE__ */ Ze(
11265
11275
  const je = Gt(
11266
11276
  U(
11267
11277
  It(R, C),
11268
- Te(([{ items: D }]) => D.length > 0),
11278
+ Ie(([{ items: D }]) => D.length > 0),
11269
11279
  $e(ve),
11270
- Te(([[D, V], J]) => {
11280
+ Ie(([[D, V], J]) => {
11271
11281
  const ae = D.items[D.items.length - 1].index === V - 1;
11272
11282
  return (J || D.bottom > 0 && D.itemHeight > 0 && D.offsetBottom === 0 && D.items.length === V) && ae;
11273
11283
  }),
@@ -11276,16 +11286,16 @@ const _S = /* @__PURE__ */ Ze(
11276
11286
  )
11277
11287
  ), q = Gt(
11278
11288
  U(
11279
- Ce(R),
11280
- Te(({ items: D }) => D.length > 0 && D[0].index === 0),
11289
+ Te(R),
11290
+ Ie(({ items: D }) => D.length > 0 && D[0].index === 0),
11281
11291
  mn(0),
11282
11292
  dt()
11283
11293
  )
11284
11294
  ), z = Gt(
11285
11295
  U(
11286
- Ce(R),
11296
+ Te(R),
11287
11297
  $e(B),
11288
- Te(([{ items: D }, V]) => D.length > 0 && !V),
11298
+ Ie(([{ items: D }, V]) => D.length > 0 && !V),
11289
11299
  le(([{ items: D }]) => ({
11290
11300
  endIndex: D[D.length - 1].index,
11291
11301
  startIndex: D[0].index
@@ -11351,7 +11361,7 @@ const _S = /* @__PURE__ */ Ze(
11351
11361
  // output
11352
11362
  gridState: R,
11353
11363
  horizontalDirection: oe,
11354
- initialTopMostItemIndex: A,
11364
+ initialTopMostItemIndex: N,
11355
11365
  totalListHeight: Y,
11356
11366
  ...p,
11357
11367
  endReached: je,
@@ -11388,7 +11398,7 @@ const jS = /* @__PURE__ */ Ze(() => {
11388
11398
  ),
11389
11399
  p
11390
11400
  ), c = ee(!1), d = ee(!1);
11391
- return pe(Ce(d), c), {
11401
+ return pe(Te(d), c), {
11392
11402
  components: t,
11393
11403
  computeItemKey: s,
11394
11404
  context: n,
@@ -11580,7 +11590,7 @@ const HS = ms(
11580
11590
  }
11581
11591
  );
11582
11592
  function Hf({ className: e, variant: t, ...n }) {
11583
- return /* @__PURE__ */ u.jsx("div", { className: te(HS({ variant: t }), e), ...n });
11593
+ return /* @__PURE__ */ u.jsx("div", { className: ne(HS({ variant: t }), e), ...n });
11584
11594
  }
11585
11595
  function Ha(e) {
11586
11596
  const t = e == null ? void 0 : e.trim();
@@ -12014,7 +12024,7 @@ const uC = lp, dC = cp, dp = v.forwardRef(({ className: e, ...t }, n) => /* @__P
12014
12024
  Hs,
12015
12025
  {
12016
12026
  ref: n,
12017
- className: te(
12027
+ className: ne(
12018
12028
  "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
12019
12029
  e
12020
12030
  ),
@@ -12044,7 +12054,7 @@ const fp = v.forwardRef(({ className: e, children: t, ...n }, r) => {
12044
12054
  Us,
12045
12055
  {
12046
12056
  ref: r,
12047
- className: te(
12057
+ className: ne(
12048
12058
  "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
12049
12059
  e
12050
12060
  ),
@@ -12068,7 +12078,7 @@ const pp = ({
12068
12078
  }) => /* @__PURE__ */ u.jsx(
12069
12079
  "div",
12070
12080
  {
12071
- className: te(
12081
+ className: ne(
12072
12082
  "flex flex-col space-y-1.5 text-center sm:text-left",
12073
12083
  e
12074
12084
  ),
@@ -12080,7 +12090,7 @@ const hp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
12080
12090
  Jn,
12081
12091
  {
12082
12092
  ref: n,
12083
- className: te(
12093
+ className: ne(
12084
12094
  "text-lg font-semibold leading-none tracking-tight",
12085
12095
  e
12086
12096
  ),
@@ -12092,7 +12102,7 @@ const fC = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
12092
12102
  Ws,
12093
12103
  {
12094
12104
  ref: n,
12095
- className: te("text-sm text-muted-foreground", e),
12105
+ className: ne("text-sm text-muted-foreground", e),
12096
12106
  ...t
12097
12107
  }
12098
12108
  ));
@@ -13892,7 +13902,7 @@ function ls({
13892
13902
  return /* @__PURE__ */ u.jsx(
13893
13903
  "div",
13894
13904
  {
13895
- className: te(
13905
+ className: ne(
13896
13906
  "markdown prose prose-sm max-w-none break-words",
13897
13907
  // In dark mode, use prose-invert for better contrast in dark bubbles
13898
13908
  "dark:prose-invert",
@@ -13968,7 +13978,7 @@ const Wr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
13968
13978
  "div",
13969
13979
  {
13970
13980
  ref: n,
13971
- className: te(
13981
+ className: ne(
13972
13982
  "rounded-lg border bg-card text-card-foreground shadow-sm",
13973
13983
  e
13974
13984
  ),
@@ -13980,7 +13990,7 @@ const Vr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
13980
13990
  "div",
13981
13991
  {
13982
13992
  ref: n,
13983
- className: te("flex flex-col space-y-1.5 p-6", e),
13993
+ className: ne("flex flex-col space-y-1.5 p-6", e),
13984
13994
  ...t
13985
13995
  }
13986
13996
  ));
@@ -13989,7 +13999,7 @@ const Kr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
13989
13999
  "h3",
13990
14000
  {
13991
14001
  ref: n,
13992
- className: te(
14002
+ className: ne(
13993
14003
  "text-2xl font-semibold leading-none tracking-tight",
13994
14004
  e
13995
14005
  ),
@@ -14001,18 +14011,18 @@ const Cp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
14001
14011
  "p",
14002
14012
  {
14003
14013
  ref: n,
14004
- className: te("text-sm text-muted-foreground", e),
14014
+ className: ne("text-sm text-muted-foreground", e),
14005
14015
  ...t
14006
14016
  }
14007
14017
  ));
14008
14018
  Cp.displayName = "CardDescription";
14009
- const qr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className: te("p-6 pt-0", e), ...t }));
14019
+ const qr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className: ne("p-6 pt-0", e), ...t }));
14010
14020
  qr.displayName = "CardContent";
14011
14021
  const Tp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
14012
14022
  "div",
14013
14023
  {
14014
14024
  ref: n,
14015
- className: te("flex items-center p-6 pt-0", e),
14025
+ className: ne("flex items-center p-6 pt-0", e),
14016
14026
  ...t
14017
14027
  }
14018
14028
  ));
@@ -14038,7 +14048,7 @@ function UC({
14038
14048
  return /* @__PURE__ */ u.jsxs(
14039
14049
  Wr,
14040
14050
  {
14041
- className: te(
14051
+ className: ne(
14042
14052
  "border-blue-200 dark:border-blue-800 bg-blue-50/50 dark:bg-blue-950/10 transition-shadow",
14043
14053
  o ? "shadow-md ring-1 ring-blue-300 dark:ring-blue-500/70" : "opacity-80"
14044
14054
  ),
@@ -14156,10 +14166,10 @@ function VC({
14156
14166
  }) {
14157
14167
  const s = Math.max(e.length - r, 0), i = e.substring(0, r);
14158
14168
  return /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col gap-1", children: [
14159
- /* @__PURE__ */ u.jsx("div", { className: te("text-sm text-[hsl(var(--chat-bubble-user-text))]", o && "text-xs"), children: t ? /* @__PURE__ */ u.jsx(ls, { content: e, allowHtml: !1 }) : /* @__PURE__ */ u.jsxs(
14169
+ /* @__PURE__ */ u.jsx("div", { className: ne("text-sm text-[hsl(var(--chat-bubble-user-text))]", o && "text-xs"), children: t ? /* @__PURE__ */ u.jsx(ls, { content: e, allowHtml: !1 }) : /* @__PURE__ */ u.jsxs(
14160
14170
  "pre",
14161
14171
  {
14162
- className: te(
14172
+ className: ne(
14163
14173
  "font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]",
14164
14174
  o && "text-xs"
14165
14175
  ),
@@ -14240,7 +14250,7 @@ function qC({ className: e }) {
14240
14250
  "span",
14241
14251
  {
14242
14252
  "aria-live": "polite",
14243
- className: te("inline-block text-xs opacity-70 ml-1", e),
14253
+ className: ne("inline-block text-xs opacity-70 ml-1", e),
14244
14254
  children: [
14245
14255
  "Is thinking",
14246
14256
  ".".repeat(t)
@@ -14276,7 +14286,7 @@ const Ya = Qh(function({
14276
14286
  defaultCheckpointId: _ = null,
14277
14287
  messageParentCheckpointId: L = null
14278
14288
  }) {
14279
- const [P, M] = me(!1), [$, E] = me("preview"), [F, j] = me(!1), { currentThreadId: Z } = ca(), { respondToInterrupt: B } = ua(), A = l === "phone" || l === "half-screen", W = t.role, G = W === "tool", oe = De(() => "type" in t && t.type === "default_message" ? t : null, [t]), ve = !!oe, je = !(r && W !== "user"), {
14289
+ const [P, M] = me(!1), [$, E] = me("preview"), [F, j] = me(!1), { currentThreadId: Z } = ca(), { respondToInterrupt: B } = ua(), N = l === "phone" || l === "half-screen", W = t.role, G = W === "tool", oe = De(() => "type" in t && t.type === "default_message" ? t : null, [t]), ve = !!oe, je = !(r && W !== "user"), {
14280
14290
  uploadingFiles: q,
14281
14291
  handleFileClick: z,
14282
14292
  fileViewerOpen: Y,
@@ -14298,63 +14308,63 @@ const Ya = Qh(function({
14298
14308
  }, [W]), ae = De(() => {
14299
14309
  if (oe)
14300
14310
  return "";
14301
- const N = t.content;
14302
- return Array.isArray(N) ? VS(N) : "";
14311
+ const A = t.content;
14312
+ return Array.isArray(A) ? VS(A) : "";
14303
14313
  }, [oe, t]), re = De(() => {
14304
14314
  if (oe)
14305
14315
  return {};
14306
- const N = t.content;
14307
- return Array.isArray(N) ? Wf(t) : {};
14316
+ const A = t.content;
14317
+ return Array.isArray(A) ? Wf(t) : {};
14308
14318
  }, [oe, t]), Ne = De(
14309
14319
  () => {
14310
14320
  if (oe)
14311
14321
  return [];
14312
- const N = t.content;
14313
- return Array.isArray(N) ? N.filter((X) => X.type === "image_url") : [];
14322
+ const A = t.content;
14323
+ return Array.isArray(A) ? A.filter((X) => X.type === "image_url") : [];
14314
14324
  },
14315
14325
  [oe, t]
14316
14326
  ), He = De(
14317
14327
  () => {
14318
14328
  if (oe)
14319
14329
  return [];
14320
- const N = t.content;
14321
- return Array.isArray(N) ? N.filter((X) => X.type === "file") : [];
14330
+ const A = t.content;
14331
+ return Array.isArray(A) ? A.filter((X) => X.type === "file") : [];
14322
14332
  },
14323
14333
  [oe, t]
14324
14334
  ), Oe = De(
14325
14335
  () => {
14326
14336
  if (oe)
14327
14337
  return [];
14328
- const N = t.content;
14329
- return Array.isArray(N) ? N.filter((X) => X.type === "interrupt") : [];
14338
+ const A = t.content;
14339
+ return Array.isArray(A) ? A.filter((X) => X.type === "interrupt") : [];
14330
14340
  },
14331
14341
  [oe, t]
14332
14342
  ), Ye = (w == null ? void 0 : w.id) ?? (w == null ? void 0 : w.interrupt_id), qe = Ao(Ye), tt = w == null ? void 0 : w.value, Xe = De(() => {
14333
14343
  if (oe)
14334
14344
  return "";
14335
- const N = t.content;
14336
- return Array.isArray(N) ? KS(N) : "";
14345
+ const A = t.content;
14346
+ return Array.isArray(A) ? KS(A) : "";
14337
14347
  }, [oe, t]), ie = De(() => {
14338
14348
  if (oe || !p) return [];
14339
14349
  const X = t.artifact;
14340
14350
  if (!X) return [];
14341
- const ne = [], fe = [
14351
+ const te = [], fe = [
14342
14352
  ...Array.isArray(X.plots) ? X.plots : []
14343
14353
  ];
14344
- for (const Re of fe) {
14345
- const be = JS(Re);
14346
- be && ne.push(be);
14354
+ for (const we of fe) {
14355
+ const Se = JS(we);
14356
+ Se && te.push(Se);
14347
14357
  }
14348
- return ne;
14358
+ return te;
14349
14359
  }, [oe, t, p]), xe = ge(async () => {
14350
- const N = G ? Xe : ae;
14351
- async function X(ne) {
14360
+ const A = G ? Xe : ae;
14361
+ async function X(te) {
14352
14362
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
14353
- await navigator.clipboard.writeText(ne);
14363
+ await navigator.clipboard.writeText(te);
14354
14364
  return;
14355
14365
  }
14356
14366
  if (navigator.clipboard && typeof navigator.clipboard.write == "function" && typeof ClipboardItem < "u") {
14357
- const fe = new Blob([ne], { type: "text/plain" });
14367
+ const fe = new Blob([te], { type: "text/plain" });
14358
14368
  await navigator.clipboard.write([
14359
14369
  new ClipboardItem({
14360
14370
  "text/plain": fe
@@ -14365,21 +14375,21 @@ const Ya = Qh(function({
14365
14375
  throw new Error("Clipboard API not supported in this context.");
14366
14376
  }
14367
14377
  try {
14368
- await X(N), M(!0), setTimeout(() => M(!1), 2e3), g == null || g(N);
14369
- } catch (ne) {
14370
- console.error("Failed to copy:", ne);
14378
+ await X(A), M(!0), setTimeout(() => M(!1), 2e3), g == null || g(A);
14379
+ } catch (te) {
14380
+ console.error("Failed to copy:", te);
14371
14381
  }
14372
14382
  }, [G, Xe, ae, g]), Ue = ge(() => {
14373
14383
  if (!x) return;
14374
- const N = G ? Xe : ae, X = "type" in t && t.type === "default_message" ? void 0 : {
14384
+ const A = G ? Xe : ae, X = "type" in t && t.type === "default_message" ? void 0 : {
14375
14385
  checkpointId: t.checkpointId ?? null,
14376
14386
  checkpointNs: t.checkpointNs ?? null
14377
14387
  };
14378
- x(t.id, N, X);
14388
+ x(t.id, A, X);
14379
14389
  }, [x, t.id, G, Xe, ae, t]), We = ge(() => {
14380
14390
  m == null || m(n);
14381
14391
  }, [m, n]), st = ge(() => {
14382
- const X = te(A ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", J);
14392
+ const X = ne(N ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", J);
14383
14393
  switch (W) {
14384
14394
  case "user":
14385
14395
  return /* @__PURE__ */ u.jsx(lm, { className: X });
@@ -14390,125 +14400,125 @@ const Ya = Qh(function({
14390
14400
  default:
14391
14401
  return /* @__PURE__ */ u.jsx(Js, { className: X });
14392
14402
  }
14393
- }, [A, J, W]), at = ge(() => {
14394
- const N = "group relative mb-4 flex w-full";
14403
+ }, [N, J, W]), at = ge(() => {
14404
+ const A = "group relative mb-4 flex w-full";
14395
14405
  switch (W) {
14396
14406
  case "user":
14397
- return te(N, "justify-end");
14407
+ return ne(A, "justify-end");
14398
14408
  case "assistant":
14399
14409
  case "tool":
14400
14410
  case "system":
14401
- return te(N, "justify-start");
14411
+ return ne(A, "justify-start");
14402
14412
  default:
14403
- return N;
14413
+ return A;
14404
14414
  }
14405
14415
  }, [W]), _t = ge(() => {
14406
- const N = te(
14416
+ const A = ne(
14407
14417
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
14408
- A && "px-3 py-2 text-sm"
14418
+ N && "px-3 py-2 text-sm"
14409
14419
  );
14410
14420
  if (ve)
14411
- return te(
14412
- N,
14421
+ return ne(
14422
+ A,
14413
14423
  "w-full",
14414
14424
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
14415
14425
  "border border-border/60 dark:border-border/40 shadow-sm"
14416
14426
  );
14417
14427
  switch (W) {
14418
14428
  case "user":
14419
- return te(
14420
- N,
14429
+ return ne(
14430
+ A,
14421
14431
  "w-full md:max-w-[95%]",
14422
14432
  "bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
14423
14433
  "border border-transparent"
14424
14434
  );
14425
14435
  case "assistant":
14426
- return te(
14427
- N,
14436
+ return ne(
14437
+ A,
14428
14438
  "w-full md:max-w-[95%]",
14429
14439
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
14430
14440
  "border border-border/60 dark:border-border/40"
14431
14441
  );
14432
14442
  case "tool":
14433
- return te(N, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
14443
+ return ne(A, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
14434
14444
  case "system":
14435
- return te(N, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
14445
+ return ne(A, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
14436
14446
  default:
14437
- return te(
14438
- N,
14447
+ return ne(
14448
+ A,
14439
14449
  "w-full md:max-w-[95%]",
14440
14450
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
14441
14451
  "border border-border/60 dark:border-border/40"
14442
14452
  );
14443
14453
  }
14444
- }, [A, ve, W]), vt = ge(async (N) => {
14454
+ }, [N, ve, W]), vt = ge(async (A) => {
14445
14455
  if (b)
14446
14456
  return;
14447
14457
  const X = Ao(
14448
- (N == null ? void 0 : N.id) ?? (N == null ? void 0 : N.interrupt_id)
14458
+ (A == null ? void 0 : A.id) ?? (A == null ? void 0 : A.interrupt_id)
14449
14459
  );
14450
14460
  if (!X) {
14451
- console.warn("Interrupt part missing id", N);
14461
+ console.warn("Interrupt part missing id", A);
14452
14462
  return;
14453
14463
  }
14454
14464
  try {
14455
14465
  T == null || T(), await B(X, !0);
14456
- } catch (ne) {
14457
- console.error("Failed to approve interrupt:", ne);
14466
+ } catch (te) {
14467
+ console.error("Failed to approve interrupt:", te);
14458
14468
  } finally {
14459
14469
  S == null || S();
14460
14470
  }
14461
- }, [b, S, T, B]), gt = ge(async (N) => {
14471
+ }, [b, S, T, B]), gt = ge(async (A) => {
14462
14472
  if (b)
14463
14473
  return;
14464
14474
  const X = Ao(
14465
- (N == null ? void 0 : N.id) ?? (N == null ? void 0 : N.interrupt_id)
14475
+ (A == null ? void 0 : A.id) ?? (A == null ? void 0 : A.interrupt_id)
14466
14476
  );
14467
14477
  if (!X) {
14468
- console.warn("Interrupt part missing id", N);
14478
+ console.warn("Interrupt part missing id", A);
14469
14479
  return;
14470
14480
  }
14471
14481
  try {
14472
14482
  T == null || T(), await B(X, !1);
14473
- } catch (ne) {
14474
- console.error("Failed to reject interrupt:", ne);
14483
+ } catch (te) {
14484
+ console.error("Failed to reject interrupt:", te);
14475
14485
  } finally {
14476
14486
  S == null || S();
14477
14487
  }
14478
- }, [b, S, T, B]), bt = ge(({ part: N, i: X }) => {
14479
- if (N.type === "text") {
14480
- const ne = N.text ?? "", fe = ne.trim(), Re = Ha(fe);
14481
- return Re && W !== "tool" ? /* @__PURE__ */ u.jsx(Sp, { data: Re }, X) : W === "user" && c && fe.length > d ? /* @__PURE__ */ u.jsx(
14488
+ }, [b, S, T, B]), bt = ge(({ part: A, i: X }) => {
14489
+ if (A.type === "text") {
14490
+ const te = A.text ?? "", fe = te.trim(), we = Ha(fe);
14491
+ return we && W !== "tool" ? /* @__PURE__ */ u.jsx(Sp, { data: we }, X) : W === "user" && c && fe.length > d ? /* @__PURE__ */ u.jsx(
14482
14492
  VC,
14483
14493
  {
14484
14494
  text: fe,
14485
14495
  expanded: F,
14486
14496
  onExpandedChange: j,
14487
14497
  previewLength: d,
14488
- isCompact: A
14498
+ isCompact: N
14489
14499
  },
14490
14500
  X
14491
- ) : /* @__PURE__ */ u.jsx(ls, { content: ne, allowHtml: !1 }, X);
14501
+ ) : /* @__PURE__ */ u.jsx(ls, { content: te, allowHtml: !1 }, X);
14492
14502
  }
14493
- if (N.type === "image_url") {
14494
- const ne = N;
14503
+ if (A.type === "image_url") {
14504
+ const te = A;
14495
14505
  return /* @__PURE__ */ u.jsx("div", { className: "my-2", children: /* @__PURE__ */ u.jsx(
14496
14506
  "img",
14497
14507
  {
14498
- src: ne.url,
14499
- alt: ne.alt ?? "",
14508
+ src: te.url,
14509
+ alt: te.alt ?? "",
14500
14510
  loading: "lazy",
14501
14511
  className: "border rounded max-h-[420px] w-auto object-contain"
14502
14512
  }
14503
14513
  ) }, X);
14504
14514
  }
14505
- if (N.type === "file") {
14506
- const ne = N, fe = ne.name || "file";
14515
+ if (A.type === "file") {
14516
+ const te = A, fe = te.name || "file";
14507
14517
  return /* @__PURE__ */ u.jsxs(
14508
14518
  "a",
14509
14519
  {
14510
- href: ne.url,
14511
- onClick: (Re) => z(Re.nativeEvent, ne, X),
14520
+ href: te.url,
14521
+ onClick: (we) => z(we.nativeEvent, te, X),
14512
14522
  className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
14513
14523
  dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
14514
14524
  children: [
@@ -14522,10 +14532,10 @@ const Ya = Qh(function({
14522
14532
  X
14523
14533
  );
14524
14534
  }
14525
- if (N.type === "interrupt") {
14526
- const ne = N, fe = Ao(
14527
- (ne == null ? void 0 : ne.id) ?? (ne == null ? void 0 : ne.interrupt_id)
14528
- ), Re = !!(qe && fe && fe === qe), be = Re ? tt ?? (ne == null ? void 0 : ne.value) : ne == null ? void 0 : ne.value, ze = fe ? { ...ne, id: fe, interrupt_id: fe } : ne;
14535
+ if (A.type === "interrupt") {
14536
+ const te = A, fe = Ao(
14537
+ (te == null ? void 0 : te.id) ?? (te == null ? void 0 : te.interrupt_id)
14538
+ ), we = !!(qe && fe && fe === qe), Se = we ? tt ?? (te == null ? void 0 : te.value) : te == null ? void 0 : te.value, ze = fe ? { ...te, id: fe, interrupt_id: fe } : te;
14529
14539
  return /* @__PURE__ */ u.jsx(
14530
14540
  UC,
14531
14541
  {
@@ -14533,8 +14543,8 @@ const Ya = Qh(function({
14533
14543
  onApprove: vt,
14534
14544
  onReject: gt,
14535
14545
  disabled: b,
14536
- isActive: Re,
14537
- payload: be
14546
+ isActive: we,
14547
+ payload: Se
14538
14548
  },
14539
14549
  X
14540
14550
  );
@@ -14549,7 +14559,7 @@ const Ya = Qh(function({
14549
14559
  c,
14550
14560
  d,
14551
14561
  F,
14552
- A,
14562
+ N,
14553
14563
  qe,
14554
14564
  tt,
14555
14565
  w,
@@ -14559,10 +14569,10 @@ const Ya = Qh(function({
14559
14569
  /* @__PURE__ */ u.jsx(Ci, { className: "h-4 w-4 text-muted-foreground" }),
14560
14570
  /* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
14561
14571
  ] }), []), Lt = ge(() => {
14562
- const N = ae.trim().length > 0 || Ne.length > 0 || He.length > 0 || Oe.length > 0;
14572
+ const A = ae.trim().length > 0 || Ne.length > 0 || He.length > 0 || Oe.length > 0;
14563
14573
  if (!G && He.length > 0 && !r)
14564
14574
  return Tt();
14565
- if (!G && !N && !r)
14575
+ if (!G && !A && !r)
14566
14576
  return null;
14567
14577
  if (G)
14568
14578
  return !f && ie.length > 0 ? null : f ? /* @__PURE__ */ u.jsx(
@@ -14574,11 +14584,11 @@ const Ya = Qh(function({
14574
14584
  t.id
14575
14585
  ) : null;
14576
14586
  if (!G && !oe) {
14577
- const X = t, ne = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: X.content.map((fe, Re) => /* @__PURE__ */ u.jsx(bt, { part: fe, i: Re }, Re)) });
14587
+ const X = t, te = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: X.content.map((fe, we) => /* @__PURE__ */ u.jsx(bt, { part: fe, i: we }, we)) });
14578
14588
  return r ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
14579
- ne,
14589
+ te,
14580
14590
  /* @__PURE__ */ u.jsx(qC, { className: J })
14581
- ] }) : ne;
14591
+ ] }) : te;
14582
14592
  }
14583
14593
  }, [
14584
14594
  ae,
@@ -14593,19 +14603,19 @@ const Ya = Qh(function({
14593
14603
  Tt,
14594
14604
  J
14595
14605
  ]), jt = De(() => oe ? "Assistant" : qS(t), [oe, t]), nt = De(() => oe ? [] : Array.isArray(C) ? C : [], [C, oe]), Rt = De(() => {
14596
- var N;
14597
- return nt.length ? _ && nt.some((X) => X.id === _) ? _ : ((N = nt[0]) == null ? void 0 : N.id) ?? null : null;
14598
- }, [_, nt]), Qe = De(() => !nt.length || !I ? null : nt.some((N) => N.id === I) ? I : null, [I, nt]) ?? Rt, et = W === "user" && nt.length > 0 && typeof R == "function", pt = ge(
14599
- (N, X = !1) => {
14606
+ var A;
14607
+ return nt.length ? _ && nt.some((X) => X.id === _) ? _ : ((A = nt[0]) == null ? void 0 : A.id) ?? null : null;
14608
+ }, [_, nt]), Qe = De(() => !nt.length || !I ? null : nt.some((A) => A.id === I) ? I : null, [I, nt]) ?? Rt, et = W === "user" && nt.length > 0 && typeof R == "function", pt = ge(
14609
+ (A, X = !1) => {
14600
14610
  if (!R) return;
14601
- const ne = (N == null ? void 0 : N.id) ?? null, fe = (N == null ? void 0 : N.parentId) ?? L ?? null;
14602
- R(ne, fe, X);
14611
+ const te = (A == null ? void 0 : A.id) ?? null, fe = (A == null ? void 0 : A.parentId) ?? L ?? null;
14612
+ R(te, fe, X);
14603
14613
  },
14604
14614
  [L, R]
14605
- ), lt = De(() => Qe ? nt.findIndex((N) => N.id === Qe) : -1, [Qe, nt]), K = De(() => lt < 0 ? null : nt[lt] ?? null, [lt, nt]);
14606
- return G && !f && ie.length === 0 ? null : ve && oe ? /* @__PURE__ */ u.jsx("div", { className: te(at(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(_t(), h.content), children: [
14615
+ ), lt = De(() => Qe ? nt.findIndex((A) => A.id === Qe) : -1, [Qe, nt]), K = De(() => lt < 0 ? null : nt[lt] ?? null, [lt, nt]);
14616
+ return G && !f && ie.length === 0 ? null : ve && oe ? /* @__PURE__ */ u.jsx("div", { className: ne(at(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: ne(_t(), h.content), children: [
14607
14617
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
14608
- /* @__PURE__ */ u.jsx(Js, { className: te("h-4 w-4", J) }),
14618
+ /* @__PURE__ */ u.jsx(Js, { className: ne("h-4 w-4", J) }),
14609
14619
  a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
14610
14620
  ] }),
14611
14621
  /* @__PURE__ */ u.jsx(
@@ -14616,36 +14626,36 @@ const Ya = Qh(function({
14616
14626
  }
14617
14627
  )
14618
14628
  ] }) }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
14619
- /* @__PURE__ */ u.jsx("div", { className: te(at(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(_t(), h.content), children: [
14629
+ /* @__PURE__ */ u.jsx("div", { className: ne(at(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: ne(_t(), h.content), children: [
14620
14630
  (i || a || G) && /* @__PURE__ */ u.jsxs(
14621
14631
  "div",
14622
14632
  {
14623
- className: te(
14633
+ className: ne(
14624
14634
  "flex items-center justify-between mb-2 pb-2 border-b border-current/10",
14625
- A && "mb-1 pb-1",
14635
+ N && "mb-1 pb-1",
14626
14636
  J,
14627
14637
  h.header
14628
14638
  ),
14629
14639
  children: [
14630
14640
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
14631
14641
  st(),
14632
- a && jt && /* @__PURE__ */ u.jsx("span", { className: te("font-medium", A ? "text-xs" : "text-sm"), children: jt }),
14642
+ a && jt && /* @__PURE__ */ u.jsx("span", { className: ne("font-medium", N ? "text-xs" : "text-sm"), children: jt }),
14633
14643
  G && /* @__PURE__ */ u.jsxs(
14634
14644
  Hf,
14635
14645
  {
14636
14646
  variant: "outline",
14637
- className: te(
14647
+ className: ne(
14638
14648
  "text-xs flex items-center gap-1 cursor-pointer select-none",
14639
14649
  J,
14640
14650
  "border border-current/40",
14641
- A && "text-xs h-4"
14651
+ N && "text-xs h-4"
14642
14652
  ),
14643
14653
  role: "button",
14644
14654
  tabIndex: 0,
14645
14655
  "aria-expanded": $ === "expanded",
14646
- onClick: () => E((N) => N === "expanded" ? "preview" : "expanded"),
14647
- onKeyDown: (N) => {
14648
- (N.key === "Enter" || N.key === " ") && (N.preventDefault(), E((X) => X === "expanded" ? "preview" : "expanded"));
14656
+ onClick: () => E((A) => A === "expanded" ? "preview" : "expanded"),
14657
+ onKeyDown: (A) => {
14658
+ (A.key === "Enter" || A.key === " ") && (A.preventDefault(), E((X) => X === "expanded" ? "preview" : "expanded"));
14649
14659
  },
14650
14660
  children: [
14651
14661
  /* @__PURE__ */ u.jsx("span", { children: re.name ?? "Tool Output" }),
@@ -14661,14 +14671,14 @@ const Ya = Qh(function({
14661
14671
  "button",
14662
14672
  {
14663
14673
  type: "button",
14664
- className: te(
14674
+ className: ne(
14665
14675
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
14666
14676
  lt < nt.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14667
14677
  ),
14668
14678
  onClick: () => {
14669
14679
  if (lt >= nt.length - 1) return;
14670
- const N = nt[lt + 1];
14671
- N && pt(N);
14680
+ const A = nt[lt + 1];
14681
+ A && pt(A);
14672
14682
  },
14673
14683
  "aria-label": "Older checkpoint (back in time)",
14674
14684
  disabled: lt >= nt.length - 1,
@@ -14684,7 +14694,7 @@ const Ya = Qh(function({
14684
14694
  "button",
14685
14695
  {
14686
14696
  type: "button",
14687
- className: te(
14697
+ className: ne(
14688
14698
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
14689
14699
  lt > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14690
14700
  ),
@@ -14693,8 +14703,8 @@ const Ya = Qh(function({
14693
14703
  if (lt === 1)
14694
14704
  pt(null, !0);
14695
14705
  else {
14696
- const N = nt[lt - 1];
14697
- N && pt(N, !1);
14706
+ const A = nt[lt - 1];
14707
+ A && pt(A, !1);
14698
14708
  }
14699
14709
  },
14700
14710
  "aria-label": "Newer checkpoint (forward in time)",
@@ -14706,7 +14716,7 @@ const Ya = Qh(function({
14706
14716
  i && t.createdAt && /* @__PURE__ */ u.jsx(
14707
14717
  "time",
14708
14718
  {
14709
- className: te("text-xs opacity-60", J, A && "text-xs"),
14719
+ className: ne("text-xs opacity-60", J, N && "text-xs"),
14710
14720
  dateTime: new Date(t.createdAt).toISOString(),
14711
14721
  title: new Date(t.createdAt).toLocaleString(),
14712
14722
  children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(t.createdAt))
@@ -14715,7 +14725,7 @@ const Ya = Qh(function({
14715
14725
  s && !o && /* @__PURE__ */ u.jsxs(
14716
14726
  "div",
14717
14727
  {
14718
- className: te(
14728
+ className: ne(
14719
14729
  "opacity-0 group-hover:opacity-100 transition-opacity",
14720
14730
  "flex items-center gap-1",
14721
14731
  h.actions
@@ -14727,10 +14737,10 @@ const Ya = Qh(function({
14727
14737
  variant: "ghost",
14728
14738
  size: "sm",
14729
14739
  onClick: () => xe(),
14730
- className: te("h-6 w-6 p-0 hover:bg-foreground/10", J, A && "h-5 w-5"),
14740
+ className: ne("h-6 w-6 p-0 hover:bg-foreground/10", J, N && "h-5 w-5"),
14731
14741
  "aria-label": "Copy message",
14732
14742
  title: "Copy message",
14733
- children: /* @__PURE__ */ u.jsx(rl, { className: te(P ? "text-success" : J, A ? "h-3 w-3" : "h-4 w-4") })
14743
+ children: /* @__PURE__ */ u.jsx(rl, { className: ne(P ? "text-success" : J, N ? "h-3 w-3" : "h-4 w-4") })
14734
14744
  }
14735
14745
  ) }),
14736
14746
  W === "user" && x && /* @__PURE__ */ u.jsx(
@@ -14739,9 +14749,9 @@ const Ya = Qh(function({
14739
14749
  variant: "ghost",
14740
14750
  size: "sm",
14741
14751
  onClick: Ue,
14742
- className: te("h-6 w-6 p-0 hover:bg-foreground/10", J, A && "h-5 w-5"),
14752
+ className: ne("h-6 w-6 p-0 hover:bg-foreground/10", J, N && "h-5 w-5"),
14743
14753
  "aria-label": "Edit message",
14744
- children: /* @__PURE__ */ u.jsx(ol, { className: te(J, A ? "h-3 w-3" : "h-4 w-4") })
14754
+ children: /* @__PURE__ */ u.jsx(ol, { className: ne(J, N ? "h-3 w-3" : "h-4 w-4") })
14745
14755
  }
14746
14756
  ),
14747
14757
  W === "assistant" && m && /* @__PURE__ */ u.jsx(
@@ -14750,9 +14760,9 @@ const Ya = Qh(function({
14750
14760
  variant: "ghost",
14751
14761
  size: "sm",
14752
14762
  onClick: We,
14753
- className: te("h-6 w-6 p-0 hover:bg-foreground/10", J, A && "h-5 w-5"),
14763
+ className: ne("h-6 w-6 p-0 hover:bg-foreground/10", J, N && "h-5 w-5"),
14754
14764
  "aria-label": "Regenerate response",
14755
- children: /* @__PURE__ */ u.jsx(Ti, { className: te(J, A ? "h-3 w-3" : "h-4 w-4") })
14765
+ children: /* @__PURE__ */ u.jsx(Ti, { className: ne(J, N ? "h-3 w-3" : "h-4 w-4") })
14756
14766
  }
14757
14767
  )
14758
14768
  ]
@@ -14764,9 +14774,9 @@ const Ya = Qh(function({
14764
14774
  ),
14765
14775
  /* @__PURE__ */ u.jsxs("div", { className: "relative", children: [
14766
14776
  Lt(),
14767
- p && ie.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "mt-3 space-y-4", children: ie.map((N, X) => /* @__PURE__ */ u.jsx(zC, { preview: N, idx: X }, `artifact-${X}`)) })
14777
+ p && ie.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "mt-3 space-y-4", children: ie.map((A, X) => /* @__PURE__ */ u.jsx(zC, { preview: A, idx: X }, `artifact-${X}`)) })
14768
14778
  ] }),
14769
- G && $ === "expanded" && (re.toolCallId || re.name) && /* @__PURE__ */ u.jsxs("div", { className: te("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", A && "text-xs"), children: [
14779
+ G && $ === "expanded" && (re.toolCallId || re.name) && /* @__PURE__ */ u.jsxs("div", { className: ne("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", N && "text-xs"), children: [
14770
14780
  re.name && /* @__PURE__ */ u.jsxs("div", { children: [
14771
14781
  "Function: ",
14772
14782
  re.name
@@ -14779,7 +14789,7 @@ const Ya = Qh(function({
14779
14789
  !(i || a || G) && s && !o && /* @__PURE__ */ u.jsxs(
14780
14790
  "div",
14781
14791
  {
14782
- className: te(
14792
+ className: ne(
14783
14793
  "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
14784
14794
  "flex items-center gap-1",
14785
14795
  h.actions
@@ -14791,8 +14801,8 @@ const Ya = Qh(function({
14791
14801
  variant: "ghost",
14792
14802
  size: "sm",
14793
14803
  onClick: () => xe(),
14794
- className: te("h-6 w-6 p-0 hover:bg-background/50 text-current", A && "h-5 w-5"),
14795
- children: /* @__PURE__ */ u.jsx(rl, { className: te(P ? "text-success" : "text-current", A ? "h-3 w-3" : "h-4 w-4") })
14804
+ className: ne("h-6 w-6 p-0 hover:bg-background/50 text-current", N && "h-5 w-5"),
14805
+ children: /* @__PURE__ */ u.jsx(rl, { className: ne(P ? "text-success" : "text-current", N ? "h-3 w-3" : "h-4 w-4") })
14796
14806
  }
14797
14807
  ),
14798
14808
  W === "user" && x && /* @__PURE__ */ u.jsx(
@@ -14801,8 +14811,8 @@ const Ya = Qh(function({
14801
14811
  variant: "ghost",
14802
14812
  size: "sm",
14803
14813
  onClick: Ue,
14804
- className: te("h-6 w-6 p-0 hover:bg-background/50 text-current", A && "h-5 w-5"),
14805
- children: /* @__PURE__ */ u.jsx(ol, { className: te("text-current", A ? "h-3 w-3" : "h-4 w-4") })
14814
+ className: ne("h-6 w-6 p-0 hover:bg-background/50 text-current", N && "h-5 w-5"),
14815
+ children: /* @__PURE__ */ u.jsx(ol, { className: ne("text-current", N ? "h-3 w-3" : "h-4 w-4") })
14806
14816
  }
14807
14817
  ),
14808
14818
  W === "assistant" && m && /* @__PURE__ */ u.jsx(
@@ -14811,8 +14821,8 @@ const Ya = Qh(function({
14811
14821
  variant: "ghost",
14812
14822
  size: "sm",
14813
14823
  onClick: We,
14814
- className: te("h-6 w-6 p-0 hover:bg-background/50 text-current", A && "h-5 w-5"),
14815
- children: /* @__PURE__ */ u.jsx(Ti, { className: te("text-current", A ? "h-3 w-3" : "h-4 w-4") })
14824
+ className: ne("h-6 w-6 p-0 hover:bg-background/50 text-current", N && "h-5 w-5"),
14825
+ children: /* @__PURE__ */ u.jsx(Ti, { className: ne("text-current", N ? "h-3 w-3" : "h-4 w-4") })
14816
14826
  }
14817
14827
  )
14818
14828
  ]
@@ -15102,7 +15112,7 @@ const Rp = Q.forwardRef(({
15102
15112
  messagePreviews: F,
15103
15113
  createSyntheticThinkingMessage: j = !1
15104
15114
  }, Z) => {
15105
- const B = Le(null), A = Le(null), W = Le(!1), G = Le(!1), [oe, ve] = me(!0), je = De(() => w ? e.some((ie) => "type" in ie && ie.type === "default_message" ? !1 : Array.isArray(ie == null ? void 0 : ie.content) && ie.content.some(
15115
+ const B = Le(null), N = Le(null), W = Le(!1), G = Le(!1), [oe, ve] = me(!0), je = De(() => w ? e.some((ie) => "type" in ie && ie.type === "default_message" ? !1 : Array.isArray(ie == null ? void 0 : ie.content) && ie.content.some(
15106
15116
  (xe) => xe && xe.type === "interrupt" && (xe.id ?? xe.interrupt_id) === w.id
15107
15117
  )) : !1, [w, e]), q = De(() => {
15108
15118
  if (!w || je)
@@ -15192,7 +15202,7 @@ const Rp = Q.forwardRef(({
15192
15202
  G.current = !1;
15193
15203
  return;
15194
15204
  }
15195
- G.current || (G.current = !0, B.current ? (xe = (ie = B.current).scrollToIndex) == null || xe.call(ie, { index: 0, align: "start", behavior: "auto" }) : A.current && (A.current.scrollTop = 0));
15205
+ G.current || (G.current = !0, B.current ? (xe = (ie = B.current).scrollToIndex) == null || xe.call(ie, { index: 0, align: "start", behavior: "auto" }) : N.current && (N.current.scrollTop = 0));
15196
15206
  }, [tt]), em(
15197
15207
  Z,
15198
15208
  () => ({
@@ -15205,7 +15215,7 @@ const Rp = Q.forwardRef(({
15205
15215
  align: "end",
15206
15216
  behavior: "auto"
15207
15217
  });
15208
- } else A.current && (A.current.scrollTop = A.current.scrollHeight);
15218
+ } else N.current && (N.current.scrollTop = N.current.scrollHeight);
15209
15219
  },
15210
15220
  scrollToTop: () => {
15211
15221
  var ie, xe;
@@ -15213,7 +15223,7 @@ const Rp = Q.forwardRef(({
15213
15223
  index: 0,
15214
15224
  align: "start",
15215
15225
  behavior: "auto"
15216
- }) : A.current && (A.current.scrollTop = 0);
15226
+ }) : N.current && (N.current.scrollTop = 0);
15217
15227
  }
15218
15228
  }),
15219
15229
  [D]
@@ -15226,7 +15236,7 @@ const Rp = Q.forwardRef(({
15226
15236
  B.current = ie;
15227
15237
  },
15228
15238
  scrollerRef: (ie) => {
15229
- A.current = ie instanceof HTMLDivElement ? ie : null;
15239
+ N.current = ie instanceof HTMLDivElement ? ie : null;
15230
15240
  },
15231
15241
  data: D,
15232
15242
  followOutput: ae,
@@ -15307,7 +15317,7 @@ function Si({
15307
15317
  metadata: P,
15308
15318
  timelineCheckpoints: M,
15309
15319
  messagePreviews: $
15310
- } = ua(), { isStreaming: E, error: F, connectionState: j, submit: Z, stop: B } = Jx(), A = w ?? g ?? null, W = (R == null ? void 0 : R.id) ?? null, G = (R == null ? void 0 : R.namespace) ?? null, oe = (P == null ? void 0 : P.assemblingMessageId) ?? null, ve = L, [je, q] = me(!1);
15320
+ } = ua(), { isStreaming: E, error: F, connectionState: j, submit: Z, stop: B } = Jx(), N = w ?? g ?? null, W = (R == null ? void 0 : R.id) ?? null, G = (R == null ? void 0 : R.namespace) ?? null, oe = (P == null ? void 0 : P.assemblingMessageId) ?? null, ve = L, [je, q] = me(!1);
15311
15321
  yt(() => {
15312
15322
  ve || q(!1);
15313
15323
  }, [ve]);
@@ -15317,7 +15327,7 @@ function Si({
15317
15327
  q(!1);
15318
15328
  }, []), D = !!ve || je, [V, J] = me(null), [ae, re] = me(""), [Ne, He] = me(null), [Oe, Ye] = me(null), [qe, tt] = me([]), [Xe, ie] = me(0), [xe, Ue] = me(0), [We, st] = me(!1), [at, _t] = me(null), [vt, gt] = me(null), [bt, Tt] = me(!1), [Lt, jt] = me(null), nt = Le(!1), [Rt, pn] = me(() => Pc.value), Qe = Le(Rt), et = Le(null), pt = ge((de) => {
15319
15329
  Pc.value = de, pn(de);
15320
- }, []), [lt, K] = me(!1), N = Le(null), { checkpointMetaById: X, checkpointIndexByKey: ne, attemptMetaById: fe, userMessageIdToAttempts: Re } = p0(_), be = M ?? [], ze = Le(null), Me = Le(null), Ee = ge(() => {
15330
+ }, []), [lt, K] = me(!1), A = Le(null), { checkpointMetaById: X, checkpointIndexByKey: te, attemptMetaById: fe, userMessageIdToAttempts: we } = p0(_), Se = M ?? [], ze = Le(null), Me = Le(null), Ee = ge(() => {
15321
15331
  ze.current && (ze.current.value = ""), Me.current && (Me.current.value = ""), ie((de) => de + 1), Ue((de) => de + 1);
15322
15332
  }, []), Wt = ge(
15323
15333
  (de) => {
@@ -15331,13 +15341,13 @@ function Si({
15331
15341
  const [Vn, ur] = me("desktop");
15332
15342
  yt(() => {
15333
15343
  const de = () => {
15334
- const Se = window.innerWidth;
15335
- ur(Se < 640 ? "phone" : Se < 1024 ? "tablet" : "desktop");
15344
+ const Ce = window.innerWidth;
15345
+ ur(Ce < 640 ? "phone" : Ce < 1024 ? "tablet" : "desktop");
15336
15346
  };
15337
15347
  return de(), window.addEventListener("resize", de), () => window.removeEventListener("resize", de);
15338
15348
  }, []), yt(() => {
15339
15349
  nt.current = !1;
15340
- }, [A]), yt(() => {
15350
+ }, [N]), yt(() => {
15341
15351
  Qe.current = Rt;
15342
15352
  }, [Rt]), yt(() => {
15343
15353
  if (!V) {
@@ -15352,10 +15362,10 @@ function Si({
15352
15362
  return;
15353
15363
  }
15354
15364
  try {
15355
- const Ie = (await y.getAgent("default")).uiDefaultMessage || "";
15356
- jt(Ie || null);
15357
- } catch (Se) {
15358
- console.warn("Failed to fetch default message:", Se), jt(null);
15365
+ const ke = (await y.getAgent("default")).uiDefaultMessage || "";
15366
+ jt(ke || null);
15367
+ } catch (Ce) {
15368
+ console.warn("Failed to fetch default message:", Ce), jt(null);
15359
15369
  }
15360
15370
  })();
15361
15371
  }, [y.baseUrl]), yt(() => {
@@ -15366,66 +15376,66 @@ function Si({
15366
15376
  return `Message too long (${de.length}/${Bo} characters)`;
15367
15377
  try {
15368
15378
  return g0(de), null;
15369
- } catch (Se) {
15370
- return (Se == null ? void 0 : Se.message) || "Invalid message";
15379
+ } catch (Ce) {
15380
+ return (Ce == null ? void 0 : Ce.message) || "Invalid message";
15371
15381
  }
15372
15382
  }, _n = async (de) => {
15373
- const Se = de.trim();
15374
- if (!(!Se && qe.length === 0)) {
15375
- if (Se) {
15376
- const Ie = Pr(Se);
15377
- if (Ie) {
15378
- Ye(Ie);
15383
+ const Ce = de.trim();
15384
+ if (!(!Ce && qe.length === 0)) {
15385
+ if (Ce) {
15386
+ const ke = Pr(Ce);
15387
+ if (ke) {
15388
+ Ye(ke);
15379
15389
  return;
15380
15390
  }
15381
15391
  }
15382
15392
  try {
15383
- const Ie = V ? (Ne == null ? void 0 : Ne.checkpointId) ?? W ?? void 0 : W ?? void 0, Ge = V ? (Ne == null ? void 0 : Ne.checkpointNs) ?? G ?? void 0 : G ?? void 0;
15393
+ const ke = V ? (Ne == null ? void 0 : Ne.checkpointId) ?? W ?? void 0 : W ?? void 0, Ge = V ? (Ne == null ? void 0 : Ne.checkpointNs) ?? G ?? void 0 : G ?? void 0;
15384
15394
  await Z(
15385
15395
  {
15386
- text: Se || "",
15396
+ text: Ce || "",
15387
15397
  attachments: qe
15388
15398
  },
15389
15399
  {
15390
- checkpointId: Ie,
15400
+ checkpointId: ke,
15391
15401
  checkpointNs: Ge,
15392
15402
  edit: !!V,
15393
15403
  originalMessageId: V ?? void 0
15394
15404
  }
15395
- ), h == null || h(Se), pt(""), Ye(null), tt([]), Ee(), J(null), re(""), He(null);
15396
- } catch (Ie) {
15397
- const Ge = (Ie == null ? void 0 : Ie.message) || "Failed to send message";
15405
+ ), h == null || h(Ce), pt(""), Ye(null), tt([]), Ee(), J(null), re(""), He(null);
15406
+ } catch (ke) {
15407
+ const Ge = (ke == null ? void 0 : ke.message) || "Failed to send message";
15398
15408
  Ye(Ge), m == null || m(Ge);
15399
15409
  }
15400
15410
  }
15401
15411
  }, Kn = Q.useCallback(
15402
- (de, Se, Ie) => {
15403
- c && (et.current = Rt, J(de), re(Se), pt(Se), Ye(null), He({
15404
- checkpointId: (Ie == null ? void 0 : Ie.checkpointId) ?? null,
15405
- checkpointNs: (Ie == null ? void 0 : Ie.checkpointNs) ?? null
15412
+ (de, Ce, ke) => {
15413
+ c && (et.current = Rt, J(de), re(Ce), pt(Ce), Ye(null), He({
15414
+ checkpointId: (ke == null ? void 0 : ke.checkpointId) ?? null,
15415
+ checkpointNs: (ke == null ? void 0 : ke.checkpointNs) ?? null
15406
15416
  }));
15407
15417
  },
15408
15418
  [Rt, c, pt]
15409
15419
  ), k = Q.useCallback(() => {
15410
15420
  J(null), re(""), He(null), Ye(null), pt(et.current ?? Rt), et.current = null;
15411
15421
  }, [Rt, pt]), H = ge(
15412
- (de, Se, Ie) => {
15413
- Kn(de, Se, Ie);
15422
+ (de, Ce, ke) => {
15423
+ Kn(de, Ce, ke);
15414
15424
  },
15415
15425
  [Kn]
15416
15426
  ), se = ge((de) => {
15417
- let Se = null;
15427
+ let Ce = null;
15418
15428
  for (let Yt = de - 1; Yt >= 0; Yt--)
15419
15429
  if (b[Yt].role === "user") {
15420
- Se = b[Yt];
15430
+ Ce = b[Yt];
15421
15431
  break;
15422
15432
  }
15423
- if (!Se) return;
15424
- const Ie = Array.isArray(Se.content) ? Se.content : [], jn = Ie.filter((Yt) => (Yt == null ? void 0 : Yt.type) === "text").map((Yt) => Yt.text).join("") || (() => {
15433
+ if (!Ce) return;
15434
+ const ke = Array.isArray(Ce.content) ? Ce.content : [], jn = ke.filter((Yt) => (Yt == null ? void 0 : Yt.type) === "text").map((Yt) => Yt.text).join("") || (() => {
15425
15435
  try {
15426
- return JSON.stringify(Ie, null, 2);
15436
+ return JSON.stringify(ke, null, 2);
15427
15437
  } catch {
15428
- return String(Ie);
15438
+ return String(ke);
15429
15439
  }
15430
15440
  })();
15431
15441
  jn && Z(
@@ -15434,34 +15444,34 @@ function Si({
15434
15444
  checkpointId: W ?? void 0,
15435
15445
  checkpointNs: G ?? void 0,
15436
15446
  edit: !0,
15437
- originalMessageId: Se.id
15447
+ originalMessageId: Ce.id
15438
15448
  }
15439
15449
  );
15440
- }, [b, Z, W, G]), we = (de) => {
15441
- const Se = Array.from(de.target.files || []);
15442
- tt((Ie) => [...Ie, ...Se]), de.target.value = "";
15450
+ }, [b, Z, W, G]), be = (de) => {
15451
+ const Ce = Array.from(de.target.files || []);
15452
+ tt((ke) => [...ke, ...Ce]), de.target.value = "";
15443
15453
  }, Je = (de) => {
15444
- tt((Se) => {
15445
- const Ie = Se.filter((Ge, jn) => de !== jn);
15446
- return Ie.length === 0 && Ee(), Ie;
15454
+ tt((Ce) => {
15455
+ const ke = Ce.filter((Ge, jn) => de !== jn);
15456
+ return ke.length === 0 && Ee(), ke;
15447
15457
  });
15448
15458
  }, it = async (de) => {
15449
- const Se = (de.target.files || [])[0];
15450
- if (Se) {
15459
+ const Ce = (de.target.files || [])[0];
15460
+ if (Ce) {
15451
15461
  _t(null), gt(null), st(!0);
15452
15462
  try {
15453
15463
  await Z(
15454
- { attachments: [Se] },
15464
+ { attachments: [Ce] },
15455
15465
  {
15456
15466
  checkpointId: W ?? void 0,
15457
15467
  checkpointNs: G ?? void 0
15458
15468
  }
15459
15469
  );
15460
- const Ie = `Uploaded ${Se.name} - processing through chat stream`;
15461
- gt(Ie);
15462
- } catch (Ie) {
15463
- const Ge = Ie instanceof Error ? Ie.message : "Failed to upload Excel file";
15464
- console.error("Excel upload failed", Ie), _t(Ge), m == null || m(Ge);
15470
+ const ke = `Uploaded ${Ce.name} - processing through chat stream`;
15471
+ gt(ke);
15472
+ } catch (ke) {
15473
+ const Ge = ke instanceof Error ? ke.message : "Failed to upload Excel file";
15474
+ console.error("Excel upload failed", ke), _t(Ge), m == null || m(Ge);
15465
15475
  } finally {
15466
15476
  st(!1), de.target.value = "", Ee();
15467
15477
  }
@@ -15473,22 +15483,22 @@ function Si({
15473
15483
  if (!de) {
15474
15484
  await I(), requestAnimationFrame(() => {
15475
15485
  var Ge;
15476
- (Ge = N.current) == null || Ge.scrollToLatest();
15486
+ (Ge = A.current) == null || Ge.scrollToLatest();
15477
15487
  });
15478
15488
  return;
15479
15489
  }
15480
- const Se = _.find((Ge) => Ge.checkpointId === de), Ie = (Se == null ? void 0 : Se.checkpointNs) ?? null;
15481
- await C(de, Ie), requestAnimationFrame(() => {
15490
+ const Ce = _.find((Ge) => Ge.checkpointId === de), ke = (Ce == null ? void 0 : Ce.checkpointNs) ?? null;
15491
+ await C(de, ke), requestAnimationFrame(() => {
15482
15492
  var Ge;
15483
- (Ge = N.current) == null || Ge.scrollToTop();
15493
+ (Ge = A.current) == null || Ge.scrollToTop();
15484
15494
  });
15485
15495
  } finally {
15486
15496
  K(!1);
15487
15497
  }
15488
15498
  }
15489
15499
  }, Fe = ge(
15490
- async (de, Se, Ie) => {
15491
- await Be(Ie ? null : de);
15500
+ async (de, Ce, ke) => {
15501
+ await Be(ke ? null : de);
15492
15502
  },
15493
15503
  [Be]
15494
15504
  ), Et = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${p.container || ""}`, xt = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${p.messagesArea || ""}`, wt = `flex-shrink-0 w-full border-t p-4 bg-transparent ${p.inputArea || ""}`;
@@ -15516,7 +15526,7 @@ function Si({
15516
15526
  /* @__PURE__ */ u.jsx(
15517
15527
  Rp,
15518
15528
  {
15519
- ref: N,
15529
+ ref: A,
15520
15530
  className: "h-full",
15521
15531
  style: { height: "100%" },
15522
15532
  messages: b,
@@ -15539,12 +15549,12 @@ function Si({
15539
15549
  showToolMessages: d,
15540
15550
  showArtifactPreviews: f,
15541
15551
  checkpointMetaById: X,
15542
- checkpointIndexByKey: ne,
15552
+ checkpointIndexByKey: te,
15543
15553
  attemptMetaById: fe,
15544
- userMessageIdToAttempts: Re,
15554
+ userMessageIdToAttempts: we,
15545
15555
  activeCheckpointId: W,
15546
15556
  onSelectCheckpoint: Fe,
15547
- timelineCheckpoints: be,
15557
+ timelineCheckpoints: Se,
15548
15558
  messagePreviews: $
15549
15559
  }
15550
15560
  ),
@@ -15589,12 +15599,12 @@ function Si({
15589
15599
  ref: ze,
15590
15600
  type: "file",
15591
15601
  multiple: !0,
15592
- onChange: (de) => we(de),
15602
+ onChange: (de) => be(de),
15593
15603
  className: "hidden"
15594
15604
  },
15595
15605
  Xe
15596
15606
  ),
15597
- qe.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: qe.map((de, Se) => /* @__PURE__ */ u.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: [
15607
+ qe.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: qe.map((de, Ce) => /* @__PURE__ */ u.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: [
15598
15608
  /* @__PURE__ */ u.jsx(Ci, { size: 14 }),
15599
15609
  /* @__PURE__ */ u.jsx("span", { className: "truncate max-w-[150px]", children: de.name }),
15600
15610
  /* @__PURE__ */ u.jsx(
@@ -15602,13 +15612,13 @@ function Si({
15602
15612
  {
15603
15613
  variant: "ghost",
15604
15614
  size: "sm",
15605
- onClick: () => Je(Se),
15615
+ onClick: () => Je(Ce),
15606
15616
  className: "h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400",
15607
15617
  "aria-label": `Remove ${de.name}`,
15608
15618
  children: /* @__PURE__ */ u.jsx(gr, { size: 12 })
15609
15619
  }
15610
15620
  )
15611
- ] }, Se)) })
15621
+ ] }, Ce)) })
15612
15622
  ] }),
15613
15623
  l && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
15614
15624
  /* @__PURE__ */ u.jsx(
@@ -15696,7 +15706,7 @@ const cs = v.forwardRef(
15696
15706
  "input",
15697
15707
  {
15698
15708
  type: t,
15699
- className: te(
15709
+ className: ne(
15700
15710
  "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
15701
15711
  e
15702
15712
  ),
@@ -16224,7 +16234,7 @@ const zp = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
16224
16234
  Bp,
16225
16235
  {
16226
16236
  ref: r,
16227
- className: te("relative overflow-hidden", e),
16237
+ className: ne("relative overflow-hidden", e),
16228
16238
  ...n,
16229
16239
  children: [
16230
16240
  /* @__PURE__ */ u.jsx(aT, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
@@ -16239,7 +16249,7 @@ const Hp = v.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
16239
16249
  {
16240
16250
  ref: r,
16241
16251
  orientation: t,
16242
- className: te(
16252
+ className: ne(
16243
16253
  "flex touch-none select-none transition-colors",
16244
16254
  t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
16245
16255
  t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
@@ -16323,7 +16333,7 @@ function Dc({
16323
16333
  }
16324
16334
  }, B = (q, z) => {
16325
16335
  z.stopPropagation(), L(q.threadId), M(q.title || `Thread ${q.threadId.slice(0, 8)}`);
16326
- }, A = async (q) => {
16336
+ }, N = async (q) => {
16327
16337
  if (P.trim())
16328
16338
  try {
16329
16339
  await b(q, P.trim()), L(null), M("");
@@ -16333,7 +16343,7 @@ function Dc({
16333
16343
  }, W = () => {
16334
16344
  L(null), M("");
16335
16345
  }, G = (q, z) => {
16336
- q.key === "Enter" ? A(z) : q.key === "Escape" && W();
16346
+ q.key === "Enter" ? N(z) : q.key === "Escape" && W();
16337
16347
  }, oe = (q) => {
16338
16348
  if (!q) return "";
16339
16349
  try {
@@ -16380,7 +16390,7 @@ function Dc({
16380
16390
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
16381
16391
  /* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: _ === q.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (z) => z.stopPropagation(), children: [
16382
16392
  /* @__PURE__ */ u.jsx(cs, { value: P, onChange: (z) => M(z.target.value), onKeyDown: (z) => G(z, q.threadId), className: "h-6 text-sm", autoFocus: !0 }),
16383
- /* @__PURE__ */ u.jsx(rt, { variant: "ghost", size: "sm", onClick: () => A(q.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ta, { size: 12 }) }),
16393
+ /* @__PURE__ */ u.jsx(rt, { variant: "ghost", size: "sm", onClick: () => N(q.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ta, { size: 12 }) }),
16384
16394
  /* @__PURE__ */ u.jsx(rt, { variant: "ghost", size: "sm", onClick: W, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(gr, { size: 12 }) })
16385
16395
  ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
16386
16396
  /* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: je(q) }),
@@ -16534,7 +16544,7 @@ const mT = ms(
16534
16544
  Gp,
16535
16545
  {
16536
16546
  ref: n,
16537
- className: te(mT(), e),
16547
+ className: ne(mT(), e),
16538
16548
  ...t
16539
16549
  }
16540
16550
  ));
@@ -16784,24 +16794,24 @@ var on = 10, [sh, Wn] = jr(or), kT = "SelectContentImpl", RT = br("SelectContent
16784
16794
  v.useEffect(() => {
16785
16795
  $ && Z();
16786
16796
  }, [$, Z]);
16787
- const { onOpenChange: B, triggerPointerDownPosRef: A } = w;
16797
+ const { onOpenChange: B, triggerPointerDownPosRef: N } = w;
16788
16798
  v.useEffect(() => {
16789
16799
  if (b) {
16790
16800
  let Y = { x: 0, y: 0 };
16791
16801
  const D = (J) => {
16792
16802
  var ae, re;
16793
16803
  Y = {
16794
- x: Math.abs(Math.round(J.pageX) - (((ae = A.current) == null ? void 0 : ae.x) ?? 0)),
16795
- y: Math.abs(Math.round(J.pageY) - (((re = A.current) == null ? void 0 : re.y) ?? 0))
16804
+ x: Math.abs(Math.round(J.pageX) - (((ae = N.current) == null ? void 0 : ae.x) ?? 0)),
16805
+ y: Math.abs(Math.round(J.pageY) - (((re = N.current) == null ? void 0 : re.y) ?? 0))
16796
16806
  };
16797
16807
  }, V = (J) => {
16798
- Y.x <= 10 && Y.y <= 10 ? J.preventDefault() : b.contains(J.target) || B(!1), document.removeEventListener("pointermove", D), A.current = null;
16808
+ Y.x <= 10 && Y.y <= 10 ? J.preventDefault() : b.contains(J.target) || B(!1), document.removeEventListener("pointermove", D), N.current = null;
16799
16809
  };
16800
- return A.current !== null && (document.addEventListener("pointermove", D), document.addEventListener("pointerup", V, { capture: !0, once: !0 })), () => {
16810
+ return N.current !== null && (document.addEventListener("pointermove", D), document.addEventListener("pointerup", V, { capture: !0, once: !0 })), () => {
16801
16811
  document.removeEventListener("pointermove", D), document.removeEventListener("pointerup", V, { capture: !0 });
16802
16812
  };
16803
16813
  }
16804
- }, [b, B, A]), v.useEffect(() => {
16814
+ }, [b, B, N]), v.useEffect(() => {
16805
16815
  const Y = () => B(!1);
16806
16816
  return window.addEventListener("blur", Y), window.addEventListener("resize", Y), () => {
16807
16817
  window.removeEventListener("blur", Y), window.removeEventListener("resize", Y);
@@ -16935,7 +16945,7 @@ var ET = "SelectItemAlignedPosition", ah = v.forwardRef((e, t) => {
16935
16945
  ]);
16936
16946
  a.style.minWidth = He + "px", a.style.right = qe + "px";
16937
16947
  }
16938
- const P = p(), M = window.innerHeight - on * 2, $ = m.scrollHeight, E = window.getComputedStyle(c), F = parseInt(E.borderTopWidth, 10), j = parseInt(E.paddingTop, 10), Z = parseInt(E.borderBottomWidth, 10), B = parseInt(E.paddingBottom, 10), A = F + j + $ + B + Z, W = Math.min(y.offsetHeight * 5, A), G = window.getComputedStyle(m), oe = parseInt(G.paddingTop, 10), ve = parseInt(G.paddingBottom, 10), je = I.top + I.height / 2 - on, q = M - je, z = y.offsetHeight / 2, Y = y.offsetTop + z, D = F + j + Y, V = A - D;
16948
+ const P = p(), M = window.innerHeight - on * 2, $ = m.scrollHeight, E = window.getComputedStyle(c), F = parseInt(E.borderTopWidth, 10), j = parseInt(E.paddingTop, 10), Z = parseInt(E.borderBottomWidth, 10), B = parseInt(E.paddingBottom, 10), N = F + j + $ + B + Z, W = Math.min(y.offsetHeight * 5, N), G = window.getComputedStyle(m), oe = parseInt(G.paddingTop, 10), ve = parseInt(G.paddingBottom, 10), je = I.top + I.height / 2 - on, q = M - je, z = y.offsetHeight / 2, Y = y.offsetTop + z, D = F + j + Y, V = N - D;
16939
16949
  if (D <= je) {
16940
16950
  const ae = P.length > 0 && y === P[P.length - 1].ref.current;
16941
16951
  a.style.bottom = "0px";
@@ -17375,7 +17385,7 @@ const Lc = FT, $c = BT, Qi = v.forwardRef(({ className: e, children: t, ...n },
17375
17385
  Ih,
17376
17386
  {
17377
17387
  ref: r,
17378
- className: te(
17388
+ className: ne(
17379
17389
  "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
17380
17390
  e
17381
17391
  ),
@@ -17391,7 +17401,7 @@ const jh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17391
17401
  Ah,
17392
17402
  {
17393
17403
  ref: n,
17394
- className: te(
17404
+ className: ne(
17395
17405
  "flex cursor-default items-center justify-center py-1",
17396
17406
  e
17397
17407
  ),
@@ -17404,7 +17414,7 @@ const Ph = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17404
17414
  Nh,
17405
17415
  {
17406
17416
  ref: n,
17407
- className: te(
17417
+ className: ne(
17408
17418
  "flex cursor-default items-center justify-center py-1",
17409
17419
  e
17410
17420
  ),
@@ -17417,7 +17427,7 @@ const ea = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
17417
17427
  kh,
17418
17428
  {
17419
17429
  ref: o,
17420
- className: te(
17430
+ className: ne(
17421
17431
  "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
17422
17432
  n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
17423
17433
  e
@@ -17429,7 +17439,7 @@ const ea = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
17429
17439
  /* @__PURE__ */ u.jsx(
17430
17440
  UT,
17431
17441
  {
17432
- className: te(
17442
+ className: ne(
17433
17443
  "p-1",
17434
17444
  n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
17435
17445
  ),
@@ -17445,7 +17455,7 @@ const KT = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17445
17455
  Rh,
17446
17456
  {
17447
17457
  ref: n,
17448
- className: te("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
17458
+ className: ne("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
17449
17459
  ...t
17450
17460
  }
17451
17461
  ));
@@ -17454,7 +17464,7 @@ const qn = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
17454
17464
  Eh,
17455
17465
  {
17456
17466
  ref: r,
17457
- className: te(
17467
+ className: ne(
17458
17468
  "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
17459
17469
  e
17460
17470
  ),
@@ -17470,7 +17480,7 @@ const qT = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17470
17480
  _h,
17471
17481
  {
17472
17482
  ref: n,
17473
- className: te("-mx-1 my-1 h-px bg-muted", e),
17483
+ className: ne("-mx-1 my-1 h-px bg-muted", e),
17474
17484
  ...t
17475
17485
  }
17476
17486
  ));
@@ -17499,7 +17509,7 @@ const Dh = v.forwardRef(
17499
17509
  ref: o,
17500
17510
  decorative: n,
17501
17511
  orientation: t,
17502
- className: te(
17512
+ className: ne(
17503
17513
  "shrink-0 bg-border",
17504
17514
  t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
17505
17515
  e
@@ -17512,7 +17522,7 @@ Dh.displayName = Oh.displayName;
17512
17522
  const JT = lp, ZT = cC, QT = cp, Lh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17513
17523
  Hs,
17514
17524
  {
17515
- className: te(
17525
+ className: ne(
17516
17526
  "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
17517
17527
  e
17518
17528
  ),
@@ -17542,7 +17552,7 @@ const eI = ms(
17542
17552
  Us,
17543
17553
  {
17544
17554
  ref: o,
17545
- className: te(eI({ side: e }), t),
17555
+ className: ne(eI({ side: e }), t),
17546
17556
  ...r,
17547
17557
  children: [
17548
17558
  n,
@@ -17561,7 +17571,7 @@ const Fh = ({
17561
17571
  }) => /* @__PURE__ */ u.jsx(
17562
17572
  "div",
17563
17573
  {
17564
- className: te(
17574
+ className: ne(
17565
17575
  "flex flex-col space-y-2 text-center sm:text-left",
17566
17576
  e
17567
17577
  ),
@@ -17573,7 +17583,7 @@ const Bh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17573
17583
  Jn,
17574
17584
  {
17575
17585
  ref: n,
17576
- className: te("text-lg font-semibold text-foreground", e),
17586
+ className: ne("text-lg font-semibold text-foreground", e),
17577
17587
  ...t
17578
17588
  }
17579
17589
  ));
@@ -17582,7 +17592,7 @@ const zh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17582
17592
  Ws,
17583
17593
  {
17584
17594
  ref: n,
17585
- className: te("text-sm text-muted-foreground", e),
17595
+ className: ne("text-sm text-muted-foreground", e),
17586
17596
  ...t
17587
17597
  }
17588
17598
  ));
@@ -17707,7 +17717,7 @@ var qh = Hh, sI = Wh;
17707
17717
  const Mn = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17708
17718
  qh,
17709
17719
  {
17710
- className: te(
17720
+ className: ne(
17711
17721
  "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
17712
17722
  e
17713
17723
  ),
@@ -17716,7 +17726,7 @@ const Mn = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17716
17726
  children: /* @__PURE__ */ u.jsx(
17717
17727
  sI,
17718
17728
  {
17719
- className: te(
17729
+ className: ne(
17720
17730
  "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
17721
17731
  )
17722
17732
  }