teodor-new-chat-ui 4.3.231 → 4.3.233

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ var om = Object.defineProperty;
2
2
  var sm = (e, t, n) => t in e ? om(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var cl = (e, t, n) => sm(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as v from "react";
5
- import z, { createContext as co, useContext as xs, useRef as Je, useCallback as Ce, useReducer as im, useEffect as Et, useMemo as at, useState as ge, useLayoutEffect as am, createElement as Do, useImperativeHandle as lm } from "react";
5
+ import z, { createContext as co, useContext as xs, useRef as et, useCallback as Ce, useReducer as im, useEffect as Et, useMemo as lt, useState as ge, useLayoutEffect as am, createElement as Do, useImperativeHandle as lm } from "react";
6
6
  import { Square as cm, Send as um, ChevronRight as Xc, Check as ca, Circle as dm, X as vr, ExternalLink as fm, Download as pm, Image as hm, FileText as ul, Loader as ua, Bot as si, Wrench as mm, User as gm, Paperclip as ji, ChevronUp as da, ChevronDown as ys, ChevronLeft as xm, Copy as dl, Edit as fl, RotateCcw as _i, Info as ym, Loader2 as zr, Edit3 as Jc, Plus as vm, FileSpreadsheet as wm, MessageSquarePlus as bm, MessageSquare as Sm, Calendar as Cm, Trash2 as Tm, Settings as km, Server as Rm, EyeOff as Em, Eye as Im, Layout as Nm, MessageCircle as Am, Save as jm } from "lucide-react";
7
7
  import { Slot as _m, createSlot as Tr } from "@radix-ui/react-slot";
8
8
  import { cva as vs } from "class-variance-authority";
@@ -51,25 +51,25 @@ function Dm() {
51
51
  function y(R) {
52
52
  if (R === null || typeof R != "object")
53
53
  return null;
54
- var K = m && R[m] || R[x];
55
- return typeof K == "function" ? K : null;
54
+ var q = m && R[m] || R[x];
55
+ return typeof q == "function" ? q : null;
56
56
  }
57
57
  var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
58
  function w(R) {
59
59
  {
60
- for (var K = arguments.length, ie = new Array(K > 1 ? K - 1 : 0), we = 1; we < K; we++)
60
+ for (var q = arguments.length, ie = new Array(q > 1 ? q - 1 : 0), we = 1; we < q; we++)
61
61
  ie[we - 1] = arguments[we];
62
62
  b("error", R, ie);
63
63
  }
64
64
  }
65
- function b(R, K, ie) {
65
+ function b(R, q, ie) {
66
66
  {
67
- var we = g.ReactDebugCurrentFrame, Ge = we.getStackAddendum();
68
- Ge !== "" && (K += "%s", ie = ie.concat([Ge]));
69
- var it = ie.map(function(He) {
70
- return String(He);
67
+ var we = g.ReactDebugCurrentFrame, Je = we.getStackAddendum();
68
+ Je !== "" && (q += "%s", ie = ie.concat([Je]));
69
+ var at = ie.map(function(Ue) {
70
+ return String(Ue);
71
71
  });
72
- it.unshift("Warning: " + K), Function.prototype.apply.call(console[R], console, it);
72
+ at.unshift("Warning: " + q), Function.prototype.apply.call(console[R], console, at);
73
73
  }
74
74
  }
75
75
  var T = !1, C = !1, S = !1, k = !1, N = !1, E;
@@ -81,12 +81,12 @@ function Dm() {
81
81
  // with.
82
82
  R.$$typeof === E || R.getModuleId !== void 0));
83
83
  }
84
- function O(R, K, ie) {
84
+ function O(R, q, ie) {
85
85
  var we = R.displayName;
86
86
  if (we)
87
87
  return we;
88
- var Ge = K.displayName || K.name || "";
89
- return Ge !== "" ? ie + "(" + Ge + ")" : ie;
88
+ var Je = q.displayName || q.name || "";
89
+ return Je !== "" ? ie + "(" + Je + ")" : ie;
90
90
  }
91
91
  function L(R) {
92
92
  return R.displayName || "Context";
@@ -115,8 +115,8 @@ function Dm() {
115
115
  if (typeof R == "object")
116
116
  switch (R.$$typeof) {
117
117
  case a:
118
- var K = R;
119
- return L(K) + ".Consumer";
118
+ var q = R;
119
+ return L(q) + ".Consumer";
120
120
  case i:
121
121
  var ie = R;
122
122
  return L(ie._context) + ".Provider";
@@ -126,9 +126,9 @@ function Dm() {
126
126
  var we = R.displayName || null;
127
127
  return we !== null ? we : F(R.type) || "Memo";
128
128
  case p: {
129
- var Ge = R, it = Ge._payload, He = Ge._init;
129
+ var Je = R, at = Je._payload, Ue = Je._init;
130
130
  try {
131
- return F(He(it));
131
+ return F(Ue(at));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -198,18 +198,18 @@ function Dm() {
198
198
  $ < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
199
199
  }
200
200
  }
201
- var ee = g.ReactCurrentDispatcher, q;
202
- function P(R, K, ie) {
201
+ var ee = g.ReactCurrentDispatcher, U;
202
+ function P(R, q, ie) {
203
203
  {
204
- if (q === void 0)
204
+ if (U === void 0)
205
205
  try {
206
206
  throw Error();
207
- } catch (Ge) {
208
- var we = Ge.stack.trim().match(/\n( *(at )?)/);
209
- q = we && we[1] || "";
207
+ } catch (Je) {
208
+ var we = Je.stack.trim().match(/\n( *(at )?)/);
209
+ U = we && we[1] || "";
210
210
  }
211
211
  return `
212
- ` + q + R;
212
+ ` + U + R;
213
213
  }
214
214
  }
215
215
  var H = !1, te;
@@ -217,7 +217,7 @@ function Dm() {
217
217
  var se = typeof WeakMap == "function" ? WeakMap : Map;
218
218
  te = new se();
219
219
  }
220
- function ne(R, K) {
220
+ function ne(R, q) {
221
221
  if (!R || H)
222
222
  return "";
223
223
  {
@@ -227,33 +227,33 @@ function Dm() {
227
227
  }
228
228
  var we;
229
229
  H = !0;
230
- var Ge = Error.prepareStackTrace;
230
+ var Je = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
232
- var it;
233
- it = ee.current, ee.current = null, Ee();
232
+ var at;
233
+ at = ee.current, ee.current = null, Ee();
234
234
  try {
235
- if (K) {
236
- var He = function() {
235
+ if (q) {
236
+ var Ue = function() {
237
237
  throw Error();
238
238
  };
239
- if (Object.defineProperty(He.prototype, "props", {
239
+ if (Object.defineProperty(Ue.prototype, "props", {
240
240
  set: function() {
241
241
  throw Error();
242
242
  }
243
243
  }), typeof Reflect == "object" && Reflect.construct) {
244
244
  try {
245
- Reflect.construct(He, []);
245
+ Reflect.construct(Ue, []);
246
246
  } catch (Ft) {
247
247
  we = Ft;
248
248
  }
249
- Reflect.construct(R, [], He);
249
+ Reflect.construct(R, [], Ue);
250
250
  } else {
251
251
  try {
252
- He.call();
252
+ Ue.call();
253
253
  } catch (Ft) {
254
254
  we = Ft;
255
255
  }
256
- R.call(He.prototype);
256
+ R.call(Ue.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
@@ -265,17 +265,17 @@ function Dm() {
265
265
  }
266
266
  } catch (Ft) {
267
267
  if (Ft && we && typeof Ft.stack == "string") {
268
- for (var $e = Ft.stack.split(`
268
+ for (var ze = Ft.stack.split(`
269
269
  `), Ot = we.stack.split(`
270
- `), bt = $e.length - 1, vt = Ot.length - 1; bt >= 1 && vt >= 0 && $e[bt] !== Ot[vt]; )
270
+ `), bt = ze.length - 1, vt = Ot.length - 1; bt >= 1 && vt >= 0 && ze[bt] !== Ot[vt]; )
271
271
  vt--;
272
272
  for (; bt >= 1 && vt >= 0; bt--, vt--)
273
- if ($e[bt] !== Ot[vt]) {
273
+ if (ze[bt] !== Ot[vt]) {
274
274
  if (bt !== 1 || vt !== 1)
275
275
  do
276
- if (bt--, vt--, vt < 0 || $e[bt] !== Ot[vt]) {
276
+ if (bt--, vt--, vt < 0 || ze[bt] !== Ot[vt]) {
277
277
  var Kt = `
278
- ` + $e[bt].replace(" at new ", " at ");
278
+ ` + ze[bt].replace(" at new ", " at ");
279
279
  return R.displayName && Kt.includes("<anonymous>") && (Kt = Kt.replace("<anonymous>", R.displayName)), typeof R == "function" && te.set(R, Kt), Kt;
280
280
  }
281
281
  while (bt >= 1 && vt >= 0);
@@ -283,19 +283,19 @@ function Dm() {
283
283
  }
284
284
  }
285
285
  } finally {
286
- H = !1, ee.current = it, W(), Error.prepareStackTrace = Ge;
286
+ H = !1, ee.current = at, W(), Error.prepareStackTrace = Je;
287
287
  }
288
288
  var Fn = R ? R.displayName || R.name : "", Nn = Fn ? P(Fn) : "";
289
289
  return typeof R == "function" && te.set(R, Nn), Nn;
290
290
  }
291
- function Me(R, K, ie) {
291
+ function Le(R, q, ie) {
292
292
  return ne(R, !1);
293
293
  }
294
294
  function Y(R) {
295
- var K = R.prototype;
296
- return !!(K && K.isReactComponent);
295
+ var q = R.prototype;
296
+ return !!(q && q.isReactComponent);
297
297
  }
298
- function de(R, K, ie) {
298
+ function de(R, q, ie) {
299
299
  if (R == null)
300
300
  return "";
301
301
  if (typeof R == "function")
@@ -311,71 +311,71 @@ function Dm() {
311
311
  if (typeof R == "object")
312
312
  switch (R.$$typeof) {
313
313
  case l:
314
- return Me(R.render);
314
+ return Le(R.render);
315
315
  case f:
316
- return de(R.type, K, ie);
316
+ return de(R.type, q, ie);
317
317
  case p: {
318
- var we = R, Ge = we._payload, it = we._init;
318
+ var we = R, Je = we._payload, at = we._init;
319
319
  try {
320
- return de(it(Ge), K, ie);
320
+ return de(at(Je), q, ie);
321
321
  } catch {
322
322
  }
323
323
  }
324
324
  }
325
325
  return "";
326
326
  }
327
- var ke = Object.prototype.hasOwnProperty, Ne = {}, ze = g.ReactDebugCurrentFrame;
328
- function Be(R) {
327
+ var ke = Object.prototype.hasOwnProperty, Ne = {}, Be = g.ReactDebugCurrentFrame;
328
+ function He(R) {
329
329
  if (R) {
330
- var K = R._owner, ie = de(R.type, R._source, K ? K.type : null);
331
- ze.setExtraStackFrame(ie);
330
+ var q = R._owner, ie = de(R.type, R._source, q ? q.type : null);
331
+ Be.setExtraStackFrame(ie);
332
332
  } else
333
- ze.setExtraStackFrame(null);
333
+ Be.setExtraStackFrame(null);
334
334
  }
335
- function Ue(R, K, ie, we, Ge) {
335
+ function We(R, q, ie, we, Je) {
336
336
  {
337
- var it = Function.call.bind(ke);
338
- for (var He in R)
339
- if (it(R, He)) {
340
- var $e = void 0;
337
+ var at = Function.call.bind(ke);
338
+ for (var Ue in R)
339
+ if (at(R, Ue)) {
340
+ var ze = void 0;
341
341
  try {
342
- if (typeof R[He] != "function") {
343
- var Ot = Error((we || "React class") + ": " + ie + " type `" + He + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[He] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
342
+ if (typeof R[Ue] != "function") {
343
+ var Ot = Error((we || "React class") + ": " + ie + " type `" + Ue + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ue] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
344
  throw Ot.name = "Invariant Violation", Ot;
345
345
  }
346
- $e = R[He](K, He, we, ie, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ ze = R[Ue](q, Ue, we, ie, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (bt) {
348
- $e = bt;
348
+ ze = bt;
349
349
  }
350
- $e && !($e instanceof Error) && (Be(Ge), 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", ie, He, typeof $e), Be(null)), $e instanceof Error && !($e.message in Ne) && (Ne[$e.message] = !0, Be(Ge), w("Failed %s type: %s", ie, $e.message), Be(null));
350
+ ze && !(ze instanceof Error) && (He(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", ie, Ue, typeof ze), He(null)), ze instanceof Error && !(ze.message in Ne) && (Ne[ze.message] = !0, He(Je), w("Failed %s type: %s", ie, ze.message), He(null));
351
351
  }
352
352
  }
353
353
  }
354
- var Ke = Array.isArray;
355
- function qe(R) {
356
- return Ke(R);
354
+ var qe = Array.isArray;
355
+ function Ge(R) {
356
+ return qe(R);
357
357
  }
358
- function Ze(R) {
358
+ function tt(R) {
359
359
  {
360
- var K = typeof Symbol == "function" && Symbol.toStringTag, ie = K && R[Symbol.toStringTag] || R.constructor.name || "Object";
360
+ var q = typeof Symbol == "function" && Symbol.toStringTag, ie = q && R[Symbol.toStringTag] || R.constructor.name || "Object";
361
361
  return ie;
362
362
  }
363
363
  }
364
- function Xe(R) {
364
+ function Qe(R) {
365
365
  try {
366
- return rt(R), !1;
366
+ return ot(R), !1;
367
367
  } catch {
368
368
  return !0;
369
369
  }
370
370
  }
371
- function rt(R) {
371
+ function ot(R) {
372
372
  return "" + R;
373
373
  }
374
374
  function St(R) {
375
- if (Xe(R))
376
- return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ze(R)), rt(R);
375
+ if (Qe(R))
376
+ return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tt(R)), ot(R);
377
377
  }
378
- var mt = g.ReactCurrentOwner, lt = {
378
+ var mt = g.ReactCurrentOwner, ct = {
379
379
  key: !0,
380
380
  ref: !0,
381
381
  __self: !0,
@@ -383,27 +383,27 @@ function Dm() {
383
383
  }, Ct, ce;
384
384
  function re(R) {
385
385
  if (ke.call(R, "ref")) {
386
- var K = Object.getOwnPropertyDescriptor(R, "ref").get;
387
- if (K && K.isReactWarning)
386
+ var q = Object.getOwnPropertyDescriptor(R, "ref").get;
387
+ if (q && q.isReactWarning)
388
388
  return !1;
389
389
  }
390
390
  return R.ref !== void 0;
391
391
  }
392
- function Qe(R) {
392
+ function Ye(R) {
393
393
  if (ke.call(R, "key")) {
394
- var K = Object.getOwnPropertyDescriptor(R, "key").get;
395
- if (K && K.isReactWarning)
394
+ var q = Object.getOwnPropertyDescriptor(R, "key").get;
395
+ if (q && q.isReactWarning)
396
396
  return !1;
397
397
  }
398
398
  return R.key !== void 0;
399
399
  }
400
- function je(R, K) {
400
+ function De(R, q) {
401
401
  typeof R.ref == "string" && mt.current;
402
402
  }
403
- function De(R, K) {
403
+ function Xe(R, q) {
404
404
  {
405
405
  var ie = function() {
406
- Ct || (Ct = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
406
+ Ct || (Ct = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", q));
407
407
  };
408
408
  ie.isReactWarning = !0, Object.defineProperty(R, "key", {
409
409
  get: ie,
@@ -411,10 +411,10 @@ function Dm() {
411
411
  });
412
412
  }
413
413
  }
414
- function ut(R, K) {
414
+ function je(R, q) {
415
415
  {
416
416
  var ie = function() {
417
- ce || (ce = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
417
+ ce || (ce = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", q));
418
418
  };
419
419
  ie.isReactWarning = !0, Object.defineProperty(R, "ref", {
420
420
  get: ie,
@@ -422,57 +422,57 @@ function Dm() {
422
422
  });
423
423
  }
424
424
  }
425
- var et = function(R, K, ie, we, Ge, it, He) {
426
- var $e = {
425
+ var Fe = function(R, q, ie, we, Je, at, Ue) {
426
+ var ze = {
427
427
  // This tag allows us to uniquely identify this as a React Element
428
428
  $$typeof: t,
429
429
  // Built-in properties that belong on the element
430
430
  type: R,
431
- key: K,
431
+ key: q,
432
432
  ref: ie,
433
- props: He,
433
+ props: Ue,
434
434
  // Record the component responsible for creating this element.
435
- _owner: it
435
+ _owner: at
436
436
  };
437
- return $e._store = {}, Object.defineProperty($e._store, "validated", {
437
+ return ze._store = {}, Object.defineProperty(ze._store, "validated", {
438
438
  configurable: !1,
439
439
  enumerable: !1,
440
440
  writable: !0,
441
441
  value: !1
442
- }), Object.defineProperty($e, "_self", {
442
+ }), Object.defineProperty(ze, "_self", {
443
443
  configurable: !1,
444
444
  enumerable: !1,
445
445
  writable: !1,
446
446
  value: we
447
- }), Object.defineProperty($e, "_source", {
447
+ }), Object.defineProperty(ze, "_source", {
448
448
  configurable: !1,
449
449
  enumerable: !1,
450
450
  writable: !1,
451
- value: Ge
452
- }), Object.freeze && (Object.freeze($e.props), Object.freeze($e)), $e;
451
+ value: Je
452
+ }), Object.freeze && (Object.freeze(ze.props), Object.freeze(ze)), ze;
453
453
  };
454
- function Fe(R, K, ie, we, Ge) {
454
+ function Oe(R, q, ie, we, Je) {
455
455
  {
456
- var it, He = {}, $e = null, Ot = null;
457
- ie !== void 0 && (St(ie), $e = "" + ie), Qe(K) && (St(K.key), $e = "" + K.key), re(K) && (Ot = K.ref, je(K, Ge));
458
- for (it in K)
459
- ke.call(K, it) && !lt.hasOwnProperty(it) && (He[it] = K[it]);
456
+ var at, Ue = {}, ze = null, Ot = null;
457
+ ie !== void 0 && (St(ie), ze = "" + ie), Ye(q) && (St(q.key), ze = "" + q.key), re(q) && (Ot = q.ref, De(q, Je));
458
+ for (at in q)
459
+ ke.call(q, at) && !ct.hasOwnProperty(at) && (Ue[at] = q[at]);
460
460
  if (R && R.defaultProps) {
461
461
  var bt = R.defaultProps;
462
- for (it in bt)
463
- He[it] === void 0 && (He[it] = bt[it]);
462
+ for (at in bt)
463
+ Ue[at] === void 0 && (Ue[at] = bt[at]);
464
464
  }
465
- if ($e || Ot) {
465
+ if (ze || Ot) {
466
466
  var vt = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
- $e && De(He, vt), Ot && ut(He, vt);
467
+ ze && Xe(Ue, vt), Ot && je(Ue, vt);
468
468
  }
469
- return et(R, $e, Ot, Ge, we, mt.current, He);
469
+ return Fe(R, ze, Ot, Je, we, mt.current, Ue);
470
470
  }
471
471
  }
472
472
  var Pt = g.ReactCurrentOwner, jt = g.ReactDebugCurrentFrame;
473
- function V(R) {
473
+ function K(R) {
474
474
  if (R) {
475
- var K = R._owner, ie = de(R.type, R._source, K ? K.type : null);
475
+ var q = R._owner, ie = de(R.type, R._source, q ? q.type : null);
476
476
  jt.setExtraStackFrame(ie);
477
477
  } else
478
478
  jt.setExtraStackFrame(null);
@@ -500,115 +500,115 @@ Check the render method of \`` + R + "`.";
500
500
  var Tt = {};
501
501
  function _e(R) {
502
502
  {
503
- var K = ht();
504
- if (!K) {
503
+ var q = ht();
504
+ if (!q) {
505
505
  var ie = typeof R == "string" ? R : R.displayName || R.name;
506
- ie && (K = `
506
+ ie && (q = `
507
507
 
508
508
  Check the top-level render call using <` + ie + ">.");
509
509
  }
510
- return K;
510
+ return q;
511
511
  }
512
512
  }
513
- function Vt(R, K) {
513
+ function Vt(R, q) {
514
514
  {
515
515
  if (!R._store || R._store.validated || R.key != null)
516
516
  return;
517
517
  R._store.validated = !0;
518
- var ie = _e(K);
518
+ var ie = _e(q);
519
519
  if (Tt[ie])
520
520
  return;
521
521
  Tt[ie] = !0;
522
522
  var we = "";
523
- R && R._owner && R._owner !== Pt.current && (we = " It was passed a child from " + F(R._owner.type) + "."), V(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ie, we), V(null);
523
+ R && R._owner && R._owner !== Pt.current && (we = " It was passed a child from " + F(R._owner.type) + "."), K(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ie, we), K(null);
524
524
  }
525
525
  }
526
- function ct(R, K) {
526
+ function ut(R, q) {
527
527
  {
528
528
  if (typeof R != "object")
529
529
  return;
530
- if (qe(R))
530
+ if (Ge(R))
531
531
  for (var ie = 0; ie < R.length; ie++) {
532
532
  var we = R[ie];
533
- xe(we) && Vt(we, K);
533
+ xe(we) && Vt(we, q);
534
534
  }
535
535
  else if (xe(R))
536
536
  R._store && (R._store.validated = !0);
537
537
  else if (R) {
538
- var Ge = y(R);
539
- if (typeof Ge == "function" && Ge !== R.entries)
540
- for (var it = Ge.call(R), He; !(He = it.next()).done; )
541
- xe(He.value) && Vt(He.value, K);
538
+ var Je = y(R);
539
+ if (typeof Je == "function" && Je !== R.entries)
540
+ for (var at = Je.call(R), Ue; !(Ue = at.next()).done; )
541
+ xe(Ue.value) && Vt(Ue.value, q);
542
542
  }
543
543
  }
544
544
  }
545
545
  function kt(R) {
546
546
  {
547
- var K = R.type;
548
- if (K == null || typeof K == "string")
547
+ var q = R.type;
548
+ if (q == null || typeof q == "string")
549
549
  return;
550
550
  var ie;
551
- if (typeof K == "function")
552
- ie = K.propTypes;
553
- else if (typeof K == "object" && (K.$$typeof === l || // Note: Memo only checks outer props here.
551
+ if (typeof q == "function")
552
+ ie = q.propTypes;
553
+ else if (typeof q == "object" && (q.$$typeof === l || // Note: Memo only checks outer props here.
554
554
  // Inner props are checked in the reconciler.
555
- K.$$typeof === f))
556
- ie = K.propTypes;
555
+ q.$$typeof === f))
556
+ ie = q.propTypes;
557
557
  else
558
558
  return;
559
559
  if (ie) {
560
- var we = F(K);
561
- Ue(ie, R.props, "prop", we, R);
562
- } else if (K.PropTypes !== void 0 && !ve) {
560
+ var we = F(q);
561
+ We(ie, R.props, "prop", we, R);
562
+ } else if (q.PropTypes !== void 0 && !ve) {
563
563
  ve = !0;
564
- var Ge = F(K);
565
- w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Ge || "Unknown");
564
+ var Je = F(q);
565
+ w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Je || "Unknown");
566
566
  }
567
- typeof K.getDefaultProps == "function" && !K.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
567
+ typeof q.getDefaultProps == "function" && !q.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
568
568
  }
569
569
  }
570
570
  function Dn(R) {
571
571
  {
572
- for (var K = Object.keys(R.props), ie = 0; ie < K.length; ie++) {
573
- var we = K[ie];
572
+ for (var q = Object.keys(R.props), ie = 0; ie < q.length; ie++) {
573
+ var we = q[ie];
574
574
  if (we !== "children" && we !== "key") {
575
- V(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", we), V(null);
575
+ K(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", we), K(null);
576
576
  break;
577
577
  }
578
578
  }
579
- R.ref !== null && (V(R), w("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
579
+ R.ref !== null && (K(R), w("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
580
580
  }
581
581
  }
582
582
  var Jn = {};
583
- function Ln(R, K, ie, we, Ge, it) {
583
+ function Ln(R, q, ie, we, Je, at) {
584
584
  {
585
- var He = I(R);
586
- if (!He) {
587
- var $e = "";
588
- (R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && ($e += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
585
+ var Ue = I(R);
586
+ if (!Ue) {
587
+ var ze = "";
588
+ (R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (ze += " 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 Ot = gt();
590
- Ot ? $e += Ot : $e += ht();
590
+ Ot ? ze += Ot : ze += ht();
591
591
  var bt;
592
- R === null ? bt = "null" : qe(R) ? bt = "array" : R !== void 0 && R.$$typeof === t ? (bt = "<" + (F(R.type) || "Unknown") + " />", $e = " Did you accidentally export a JSX literal instead of a component?") : bt = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", bt, $e);
592
+ R === null ? bt = "null" : Ge(R) ? bt = "array" : R !== void 0 && R.$$typeof === t ? (bt = "<" + (F(R.type) || "Unknown") + " />", ze = " Did you accidentally export a JSX literal instead of a component?") : bt = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", bt, ze);
593
593
  }
594
- var vt = Fe(R, K, ie, Ge, it);
594
+ var vt = Oe(R, q, ie, Je, at);
595
595
  if (vt == null)
596
596
  return vt;
597
- if (He) {
598
- var Kt = K.children;
597
+ if (Ue) {
598
+ var Kt = q.children;
599
599
  if (Kt !== void 0)
600
600
  if (we)
601
- if (qe(Kt)) {
601
+ if (Ge(Kt)) {
602
602
  for (var Fn = 0; Fn < Kt.length; Fn++)
603
- ct(Kt[Fn], R);
603
+ ut(Kt[Fn], R);
604
604
  Object.freeze && Object.freeze(Kt);
605
605
  } else
606
606
  w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
607
607
  else
608
- ct(Kt, R);
608
+ ut(Kt, R);
609
609
  }
610
- if (ke.call(K, "key")) {
611
- var Nn = F(R), Ft = Object.keys(K).filter(function(oe) {
610
+ if (ke.call(q, "key")) {
611
+ var Nn = F(R), Ft = Object.keys(q).filter(function(oe) {
612
612
  return oe !== "key";
613
613
  }), Dr = Ft.length > 0 ? "{key: someKey, " + Ft.join(": ..., ") + ": ...}" : "{key: someKey}";
614
614
  if (!Jn[Nn + Dr]) {
@@ -624,11 +624,11 @@ React keys must be passed directly to JSX without using spread:
624
624
  return R === r ? Dn(vt) : kt(vt), vt;
625
625
  }
626
626
  }
627
- function ti(R, K, ie) {
628
- return Ln(R, K, ie, !0);
627
+ function ti(R, q, ie) {
628
+ return Ln(R, q, ie, !0);
629
629
  }
630
- function So(R, K, ie) {
631
- return Ln(R, K, ie, !1);
630
+ function So(R, q, ie) {
631
+ return Ln(R, q, ie, !1);
632
632
  }
633
633
  var ni = So, ri = ti;
634
634
  Fr.Fragment = r, Fr.jsx = ni, Fr.jsxs = ri;
@@ -2951,7 +2951,7 @@ function Dx(e, t) {
2951
2951
  return r ? Object.keys(n).length ? n : void 0 : e;
2952
2952
  }
2953
2953
  function Lx() {
2954
- const e = Je(/* @__PURE__ */ new Map()), t = Ce(
2954
+ const e = et(/* @__PURE__ */ new Map()), t = Ce(
2955
2955
  (a, l) => {
2956
2956
  const c = e.current.get(a), d = /* @__PURE__ */ new Map();
2957
2957
  c && c.forEach((f) => {
@@ -3052,7 +3052,7 @@ function zx(e, t) {
3052
3052
  }
3053
3053
  }
3054
3054
  function Bx(e = []) {
3055
- const [t, n] = im(zx, { ...$x, messages: e }), r = Je([]), o = Je(null), s = Je(null), i = Ce(() => {
3055
+ const [t, n] = im(zx, { ...$x, messages: e }), r = et([]), o = et(null), s = et(null), i = Ce(() => {
3056
3056
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
3057
3057
  const d = r.current;
3058
3058
  d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
@@ -3064,7 +3064,7 @@ function Bx(e = []) {
3064
3064
  Et(() => () => {
3065
3065
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
3066
3066
  }, []);
3067
- const c = at(() => ({
3067
+ const c = lt(() => ({
3068
3068
  reset: (d) => n({ type: "reset", payload: { messages: d } }),
3069
3069
  seed: (d, f) => n({ type: "seed", payload: { messages: d, ...f ?? {} } }),
3070
3070
  prepend: (d) => n({ type: "prepend", payload: { messages: d } }),
@@ -3398,7 +3398,7 @@ function Vx(e) {
3398
3398
  return t[t.length - 1] || null;
3399
3399
  }
3400
3400
  function Kx(e = {}) {
3401
- const t = at(() => _n(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ge(e.token ?? null), s = Je(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ge(!1), [c, d] = ge(null), [f, p] = ge(""), [h, m] = ge(null), [x, y] = ge(0), [g, w] = ge(!1), b = Je(null), T = Je(!0), C = Je(0), S = Je(null), k = Je(null), N = Je(null), E = Je(null), I = Ce((j) => {
3401
+ const t = lt(() => _n(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ge(e.token ?? null), s = et(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ge(!1), [c, d] = ge(null), [f, p] = ge(""), [h, m] = ge(null), [x, y] = ge(0), [g, w] = ge(!1), b = et(null), T = et(!0), C = et(0), S = et(null), k = et(null), N = et(null), E = et(null), I = Ce((j) => {
3402
3402
  o(j);
3403
3403
  }, []), O = Ce(() => {
3404
3404
  p(""), m(null), d(null), k.current = null, N.current = null, E.current = null;
@@ -3415,34 +3415,34 @@ function Kx(e = {}) {
3415
3415
  threadId: j.threadId ?? null,
3416
3416
  headers: {}
3417
3417
  }, (async () => {
3418
- var pe, Re, Ee, W, ee, q, P, H, te, se, ne, Me, Y, de, ke, Ne, ze, Be;
3419
- const J = (Ue) => {
3420
- var Ke;
3418
+ var pe, Re, Ee, W, ee, U, P, H, te, se, ne, Le, Y, de, ke, Ne, Be, He;
3419
+ const J = (We) => {
3420
+ var qe;
3421
3421
  try {
3422
- const qe = JSON.parse(JSON.stringify(Ue));
3423
- return (Ke = qe == null ? void 0 : qe.payload) != null && Ke.files_info && Array.isArray(qe.payload.files_info) && (qe.payload.files_info = qe.payload.files_info.map((Ze) => ({
3424
- ...Ze,
3425
- data: Ze != null && Ze.data ? `<base64 ${String(Ze.data).length} chars>` : Ze == null ? void 0 : Ze.data
3426
- }))), qe;
3422
+ const Ge = JSON.parse(JSON.stringify(We));
3423
+ return (qe = Ge == null ? void 0 : Ge.payload) != null && qe.files_info && Array.isArray(Ge.payload.files_info) && (Ge.payload.files_info = Ge.payload.files_info.map((tt) => ({
3424
+ ...tt,
3425
+ data: tt != null && tt.data ? `<base64 ${String(tt.data).length} chars>` : tt == null ? void 0 : tt.data
3426
+ }))), Ge;
3427
3427
  } catch {
3428
- return Ue;
3428
+ return We;
3429
3429
  }
3430
3430
  };
3431
3431
  try {
3432
- let Ue = {};
3432
+ let We = {};
3433
3433
  try {
3434
3434
  if (r)
3435
- Ue = { Authorization: `Bearer ${r}` };
3435
+ We = { Authorization: `Bearer ${r}` };
3436
3436
  else if (typeof window < "u") {
3437
- const Fe = window.__AUTH_TOKEN__, Pt = ((pe = window.localStorage) == null ? void 0 : pe.getItem("authToken")) || null;
3437
+ const Oe = window.__AUTH_TOKEN__, Pt = ((pe = window.localStorage) == null ? void 0 : pe.getItem("authToken")) || null;
3438
3438
  let jt = null;
3439
3439
  try {
3440
3440
  const ve = (Re = window.localStorage) == null ? void 0 : Re.getItem("chat-settings");
3441
3441
  ve && (jt = ((Ee = JSON.parse(ve)) == null ? void 0 : Ee.apiKey) || null);
3442
3442
  } catch {
3443
3443
  }
3444
- const V = Fe || Pt || jt || null;
3445
- V && (Ue = { Authorization: `Bearer ${V}` });
3444
+ const K = Oe || Pt || jt || null;
3445
+ K && (We = { Authorization: `Bearer ${K}` });
3446
3446
  }
3447
3447
  } catch {
3448
3448
  }
@@ -3451,69 +3451,69 @@ function Kx(e = {}) {
3451
3451
  t + n,
3452
3452
  J(j)
3453
3453
  );
3454
- let Ke = {};
3454
+ let qe = {};
3455
3455
  if (typeof window < "u")
3456
3456
  try {
3457
- const et = (W = window.localStorage) == null ? void 0 : W.getItem("authSessionId");
3458
- et && (Ke = { "X-Session-Id": et });
3457
+ const Fe = (W = window.localStorage) == null ? void 0 : W.getItem("authSessionId");
3458
+ Fe && (qe = { "X-Session-Id": Fe });
3459
3459
  } catch {
3460
3460
  }
3461
- const qe = {
3462
- ...Ue,
3463
- ...Ke,
3461
+ const Ge = {
3462
+ ...We,
3463
+ ...qe,
3464
3464
  ...s.current
3465
- }, Ze = {
3465
+ }, tt = {
3466
3466
  "Content-Type": "application/json",
3467
3467
  Accept: "text/event-stream",
3468
- ...qe
3469
- }, Xe = await fetch(t + n, {
3468
+ ...Ge
3469
+ }, Qe = await fetch(t + n, {
3470
3470
  method: "POST",
3471
- headers: Ze,
3471
+ headers: tt,
3472
3472
  body: JSON.stringify(j),
3473
3473
  signal: B.signal,
3474
3474
  credentials: i
3475
3475
  });
3476
- if (S.current && (S.current.headers = qe), !Xe.ok || !Xe.body) {
3477
- const et = await Xe.text().catch(() => "");
3476
+ if (S.current && (S.current.headers = Ge), !Qe.ok || !Qe.body) {
3477
+ const Fe = await Qe.text().catch(() => "");
3478
3478
  console.debug(
3479
3479
  "[use-chat] non-OK response",
3480
- Xe.status,
3481
- et == null ? void 0 : et.slice(0, 500)
3480
+ Qe.status,
3481
+ Fe == null ? void 0 : Fe.slice(0, 500)
3482
3482
  );
3483
- const Fe = `stream ${Xe.status}${et ? ": " + et : ""}`;
3484
- throw (ee = A == null ? void 0 : A.onConnectionError) == null || ee.call(A, Fe), Z = !0, D = "error", M = Fe, new Error(Fe);
3483
+ const Oe = `stream ${Qe.status}${Fe ? ": " + Fe : ""}`;
3484
+ throw (ee = A == null ? void 0 : A.onConnectionError) == null || ee.call(A, Oe), Z = !0, D = "error", M = Oe, new Error(Oe);
3485
3485
  }
3486
3486
  w(!0);
3487
- const rt = Xe.body.getReader(), St = new TextDecoder();
3488
- let mt = "", lt = [];
3487
+ const ot = Qe.body.getReader(), St = new TextDecoder();
3488
+ let mt = "", ct = [];
3489
3489
  C.current = 0, y(0);
3490
3490
  let Ct = 0, ce = null;
3491
3491
  const re = () => {
3492
- if (lt.length) {
3493
- const et = lt.join("");
3494
- lt = [], T.current && p((Fe) => Fe + et);
3492
+ if (ct.length) {
3493
+ const Fe = ct.join("");
3494
+ ct = [], T.current && p((Oe) => Oe + Fe);
3495
3495
  }
3496
3496
  ce = null;
3497
- }, Qe = () => {
3497
+ }, Ye = () => {
3498
3498
  typeof window < "u" && ce == null && (ce = requestAnimationFrame(re));
3499
3499
  };
3500
- let je = Date.now();
3501
- const De = setInterval(() => {
3502
- var et;
3503
- if (Date.now() - je > 18e5) {
3504
- const Fe = "Stream idle timeout";
3505
- d(Fe), D = "error", M = Fe, B.abort(), (et = A == null ? void 0 : A.onError) == null || et.call(A, Fe);
3500
+ let De = Date.now();
3501
+ const Xe = setInterval(() => {
3502
+ var Fe;
3503
+ if (Date.now() - De > 18e5) {
3504
+ const Oe = "Stream idle timeout";
3505
+ d(Oe), D = "error", M = Oe, B.abort(), (Fe = A == null ? void 0 : A.onError) == null || Fe.call(A, Oe);
3506
3506
  }
3507
- }, 5e3), ut = 1024 * 1024;
3507
+ }, 5e3), je = 1024 * 1024;
3508
3508
  try {
3509
- const et = Xe.headers.get("X-Thread-Id") || Xe.headers.get("x-thread-id"), Fe = Xe.headers.get("X-Thread-Created") || Xe.headers.get("x-thread-created"), Pt = et ?? null, jt = String(Fe ?? "").toLowerCase() === "true";
3509
+ const Fe = Qe.headers.get("X-Thread-Id") || Qe.headers.get("x-thread-id"), Oe = Qe.headers.get("X-Thread-Created") || Qe.headers.get("x-thread-created"), Pt = Fe ?? null, jt = String(Oe ?? "").toLowerCase() === "true";
3510
3510
  for (S.current && !S.current.threadId && (S.current = {
3511
3511
  ...S.current,
3512
3512
  threadId: Pt
3513
- }), (q = A == null ? void 0 : A.onOpen) == null || q.call(A, { threadId: Pt, created: jt }); ; ) {
3514
- const { value: V, done: ve } = await rt.read();
3513
+ }), (U = A == null ? void 0 : A.onOpen) == null || U.call(A, { threadId: Pt, created: jt }); ; ) {
3514
+ const { value: K, done: ve } = await ot.read();
3515
3515
  if (ve) break;
3516
- mt += St.decode(V, { stream: !0 }), mt.length > ut && (mt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3516
+ mt += St.decode(K, { stream: !0 }), mt.length > je && (mt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3517
3517
  let xe;
3518
3518
  for (; (xe = mt.indexOf(`
3519
3519
 
@@ -3530,7 +3530,7 @@ function Kx(e = {}) {
3530
3530
  continue;
3531
3531
  }
3532
3532
  const _e = qx(Tt) ? Tt.data : Tt;
3533
- je = Date.now();
3533
+ De = Date.now();
3534
3534
  const Vt = _e.seq;
3535
3535
  if (Vt !== void 0) {
3536
3536
  if (Vt <= Ct) {
@@ -3543,9 +3543,9 @@ function Kx(e = {}) {
3543
3543
  seq: _e.seq,
3544
3544
  type: _e.type,
3545
3545
  preview: (() => {
3546
- var ct;
3546
+ var ut;
3547
3547
  try {
3548
- return _e.type === "message_delta" ? { deltaTypes: (ct = _e.delta) == null ? void 0 : ct.map((kt) => kt.type), textLen: (_e.delta || []).filter((kt) => kt.type === "text").map((kt) => String(kt.text || "").length) } : _e.content || _e.delta ? { hasContent: !0 } : {};
3548
+ return _e.type === "message_delta" ? { deltaTypes: (ut = _e.delta) == null ? void 0 : ut.map((kt) => kt.type), textLen: (_e.delta || []).filter((kt) => kt.type === "text").map((kt) => String(kt.text || "").length) } : _e.content || _e.delta ? { hasContent: !0 } : {};
3549
3549
  } catch (kt) {
3550
3550
  return { err: String(kt) };
3551
3551
  }
@@ -3557,35 +3557,35 @@ function Kx(e = {}) {
3557
3557
  try {
3558
3558
  const kt = Ur(_e).latest;
3559
3559
  kt && (k.current = kt.checkpointId ?? null, N.current = kt.checkpointNs ?? null, m(kt.checkpointId ?? null));
3560
- } catch (ct) {
3561
- console.warn("[use-chat] Failed to hydrate state_history payload", ct);
3560
+ } catch (ut) {
3561
+ console.warn("[use-chat] Failed to hydrate state_history payload", ut);
3562
3562
  }
3563
3563
  }
3564
3564
  try {
3565
3565
  $ == null || $(_e);
3566
- } catch (ct) {
3567
- console.error("[use-chat] Error in onEvent callback:", ct, "for event:", _e.type);
3566
+ } catch (ut) {
3567
+ console.error("[use-chat] Error in onEvent callback:", ut, "for event:", _e.type);
3568
3568
  }
3569
3569
  if (_e.type === "token" && e.autoAppendAssistant !== !1)
3570
- lt.push(_e.content), Qe();
3570
+ ct.push(_e.content), Ye();
3571
3571
  else if (_e.type === "message_delta") {
3572
- const ct = _e.delta.filter((kt) => kt.type === "text").map((kt) => kt.text).join("");
3573
- ct && e.autoAppendAssistant !== !1 && (lt.push(ct), Qe());
3572
+ const ut = _e.delta.filter((kt) => kt.type === "text").map((kt) => kt.text).join("");
3573
+ ut && e.autoAppendAssistant !== !1 && (ct.push(ut), Ye());
3574
3574
  } else if (_e.type === "heartbeat") {
3575
3575
  console.debug("[use-chat] heartbeat received");
3576
3576
  try {
3577
3577
  (H = A == null ? void 0 : A.onHeartbeat) == null || H.call(A, _e);
3578
- } catch (ct) {
3579
- console.warn("[use-chat] heartbeat callback failed", ct);
3578
+ } catch (ut) {
3579
+ console.warn("[use-chat] heartbeat callback failed", ut);
3580
3580
  }
3581
3581
  } else if (ce !== null && cancelAnimationFrame(ce), re(), _e.type === "checkpoint")
3582
3582
  m(_e.checkpointId);
3583
3583
  else if (_e.type === "error") {
3584
- const ct = _e;
3585
- if (d(ct.message), D = "error", M = ct.message, ct.error_type === "auth_error" || ct.code === "TOKEN_EXPIRED" || ((te = ct.message) == null ? void 0 : te.includes("token")) || ((se = ct.message) == null ? void 0 : se.includes("401")) || ((ne = ct.message) == null ? void 0 : ne.includes("unauthorized")) || ((Me = ct.message) == null ? void 0 : Me.includes("Unauthorized"))) {
3586
- console.error("[use-chat] Auth error detected:", ct.message);
3584
+ const ut = _e;
3585
+ if (d(ut.message), D = "error", M = ut.message, ut.error_type === "auth_error" || ut.code === "TOKEN_EXPIRED" || ((te = ut.message) == null ? void 0 : te.includes("token")) || ((se = ut.message) == null ? void 0 : se.includes("401")) || ((ne = ut.message) == null ? void 0 : ne.includes("unauthorized")) || ((Le = ut.message) == null ? void 0 : Le.includes("Unauthorized"))) {
3586
+ console.error("[use-chat] Auth error detected:", ut.message);
3587
3587
  try {
3588
- (Y = A == null ? void 0 : A.onAuthError) == null || Y.call(A, ct.message);
3588
+ (Y = A == null ? void 0 : A.onAuthError) == null || Y.call(A, ut.message);
3589
3589
  } catch (Dn) {
3590
3590
  console.warn("[use-chat] onAuthError handler failed", Dn);
3591
3591
  }
@@ -3595,42 +3595,42 @@ function Kx(e = {}) {
3595
3595
  }
3596
3596
  }
3597
3597
  re(), D === null && !B.signal.aborted && (D = "complete");
3598
- } catch (et) {
3599
- if (et.name === "AbortError")
3598
+ } catch (Fe) {
3599
+ if (Fe.name === "AbortError")
3600
3600
  D = D ?? "aborted";
3601
3601
  else {
3602
- const Fe = et.message || String(et);
3603
- D = "error", M = Fe, d(Fe), (de = A == null ? void 0 : A.onError) == null || de.call(A, Fe);
3602
+ const Oe = Fe.message || String(Fe);
3603
+ D = "error", M = Oe, d(Oe), (de = A == null ? void 0 : A.onError) == null || de.call(A, Oe);
3604
3604
  }
3605
3605
  } finally {
3606
3606
  try {
3607
- await rt.cancel();
3607
+ await ot.cancel();
3608
3608
  } catch {
3609
3609
  } finally {
3610
- (ke = rt.releaseLock) == null || ke.call(rt);
3610
+ (ke = ot.releaseLock) == null || ke.call(ot);
3611
3611
  }
3612
- ce !== null && typeof window < "u" && window.cancelAnimationFrame(ce), clearInterval(De);
3612
+ ce !== null && typeof window < "u" && window.cancelAnimationFrame(ce), clearInterval(Xe);
3613
3613
  }
3614
- } catch (Ue) {
3615
- if (Ue.name === "AbortError")
3614
+ } catch (We) {
3615
+ if (We.name === "AbortError")
3616
3616
  D = D ?? "aborted";
3617
3617
  else {
3618
- const Ke = Ue.message || String(Ue);
3619
- D = "error", M = Ke, d(Ke), (Ne = A == null ? void 0 : A.onError) == null || Ne.call(A, Ke), Z || ((ze = A == null ? void 0 : A.onConnectionError) == null || ze.call(A, Ke), Z = !0);
3618
+ const qe = We.message || String(We);
3619
+ D = "error", M = qe, d(qe), (Ne = A == null ? void 0 : A.onError) == null || Ne.call(A, qe), Z || ((Be = A == null ? void 0 : A.onConnectionError) == null || Be.call(A, qe), Z = !0);
3620
3620
  }
3621
3621
  } finally {
3622
- const Ue = C.current, Ke = k.current, qe = N.current, Ze = E.current, Xe = D ?? (B.signal.aborted ? "aborted" : M ? "error" : "complete");
3622
+ const We = C.current, qe = k.current, Ge = N.current, tt = E.current, Qe = D ?? (B.signal.aborted ? "aborted" : M ? "error" : "complete");
3623
3623
  try {
3624
- (Be = A == null ? void 0 : A.onClosed) == null || Be.call(A, {
3625
- reason: Xe,
3626
- lastSeq: Ue,
3627
- lastCheckpointId: Ke,
3628
- lastCheckpointNs: qe,
3629
- lastStateHistory: Ze,
3624
+ (He = A == null ? void 0 : A.onClosed) == null || He.call(A, {
3625
+ reason: Qe,
3626
+ lastSeq: We,
3627
+ lastCheckpointId: qe,
3628
+ lastCheckpointNs: Ge,
3629
+ lastStateHistory: tt,
3630
3630
  error: M
3631
3631
  });
3632
- } catch (rt) {
3633
- console.warn("[use-chat] onClosed callback failed", rt);
3632
+ } catch (ot) {
3633
+ console.warn("[use-chat] onClosed callback failed", ot);
3634
3634
  }
3635
3635
  l(!1), w(!1), b.current = null, C.current = 0, y(0), S.current = null;
3636
3636
  }
@@ -3679,7 +3679,7 @@ function Yx({
3679
3679
  onAuthError: a,
3680
3680
  onHeartbeat: l
3681
3681
  }) {
3682
- const c = Je(null), d = Je(null), f = Je(/* @__PURE__ */ new Map()), p = Je(null), h = Ce((E) => {
3682
+ const c = et(null), d = et(null), f = et(/* @__PURE__ */ new Map()), p = et(null), h = Ce((E) => {
3683
3683
  try {
3684
3684
  const I = globalThis.structuredClone;
3685
3685
  if (typeof I == "function")
@@ -3850,7 +3850,7 @@ function Yx({
3850
3850
  ), N = Ce(() => {
3851
3851
  p.current && (p.current.manualStop = !0), b();
3852
3852
  }, [b]);
3853
- return at(
3853
+ return lt(
3854
3854
  () => ({
3855
3855
  startStream: k,
3856
3856
  stop: N,
@@ -3875,11 +3875,11 @@ function Xx({
3875
3875
  onThreadChange: a,
3876
3876
  checkpointMetadataCache: l
3877
3877
  }) {
3878
- const { api: c, baseUrl: d } = Tu(), f = at(() => _n(d), [d]), [p, h] = ge([]), [m, x] = ge(t), [y, g] = ge(!1), [w, b] = ge(null), [T, C] = ge(!1), [S, k] = ge(null), { state: N, seed: E, prepend: I, pushUser: O, onEvent: L } = Bx(), [F, j] = ge(!1), [$, A] = ge(!1), [B, D] = ge(null), [M, Z] = ge([]), [J, pe] = ge(!1), Re = l ?? Lx(), { setCacheForThread: Ee } = Re, W = Je(m), ee = Je(null), q = Je(!1);
3878
+ const { api: c, baseUrl: d } = Tu(), f = lt(() => _n(d), [d]), [p, h] = ge([]), [m, x] = ge(t), [y, g] = ge(!1), [w, b] = ge(null), [T, C] = ge(!1), [S, k] = ge(null), { state: N, seed: E, prepend: I, pushUser: O, onEvent: L } = Bx(), [F, j] = ge(!1), [$, A] = ge(!1), [B, D] = ge(null), [M, Z] = ge([]), [J, pe] = ge(!1), Re = l ?? Lx(), { setCacheForThread: Ee } = Re, W = et(m), ee = et(null), U = et(!1);
3879
3879
  Et(() => {
3880
3880
  W.current = m;
3881
3881
  }, [m]);
3882
- const P = Je(), { startStream: H, stop: te, isStreaming: se, error: ne, setAuthToken: Me } = Yx({
3882
+ const P = et(), { startStream: H, stop: te, isStreaming: se, error: ne, setAuthToken: Le } = Yx({
3883
3883
  baseUrl: f,
3884
3884
  onThreadInfo: (ce) => {
3885
3885
  if (console.log("[ChatSessionProvider] Thread info:", ce.threadId), W.current === null) {
@@ -3927,82 +3927,104 @@ function Xx({
3927
3927
  async (ce, re) => {
3928
3928
  try {
3929
3929
  await c.updateThread(ce, re), await Y();
3930
- } catch (Qe) {
3931
- s == null || s(String(Qe));
3930
+ } catch (Ye) {
3931
+ s == null || s(String(Ye));
3932
3932
  }
3933
3933
  },
3934
3934
  [c, Y, s]
3935
- ), ze = Ce(
3936
- (ce, re, Qe) => {
3937
- const je = re.filter((De) => De.checkpointId).map((De) => ({
3938
- checkpointId: De.checkpointId,
3939
- checkpointNs: De.checkpointNs ?? void 0,
3940
- createdAt: De.createdAt ?? ""
3935
+ ), Be = Ce(
3936
+ (ce, re, Ye) => {
3937
+ const De = re.filter((Xe) => Xe.checkpointId).map((Xe) => ({
3938
+ checkpointId: Xe.checkpointId,
3939
+ checkpointNs: Xe.checkpointNs ?? void 0,
3940
+ createdAt: Xe.createdAt ?? ""
3941
3941
  }));
3942
- console.log(`[ChatSessionProvider] Cached metadata for ${je.length} checkpoints from ${Qe}`), Ee(ce, je);
3942
+ console.log(`[ChatSessionProvider] Cached metadata for ${De.length} checkpoints from ${Ye}`), Ee(ce, De);
3943
3943
  },
3944
3944
  [Ee]
3945
- ), Be = Ce(
3945
+ ), He = Ce(
3946
3946
  async (ce, re) => {
3947
- if (ce) {
3948
- C(!0), k(null);
3949
- try {
3950
- const Qe = await c.getStateHistory({
3951
- threadId: ce,
3952
- checkpointId: re || void 0
3953
- // Let backend pick latest if not specified
3954
- }), { checkpoints: je } = Ur(Qe);
3955
- ze(ce, je, `thread load (requested: ${re})`);
3956
- const De = je.find((ut) => ut.messages && ut.messages.length > 0) ?? (re ? je.find((ut) => ut.checkpointId === re) : null) ?? je[0];
3957
- E((De == null ? void 0 : De.messages) ?? [], {
3958
- checkpointId: (De == null ? void 0 : De.checkpointId) ?? null,
3959
- checkpointNs: (De == null ? void 0 : De.checkpointNs) ?? null
3960
- }), Z(je), j(!!(De != null && De.nextCursor)), D((De == null ? void 0 : De.nextCursor) ?? null);
3961
- } catch (Qe) {
3962
- const je = String(Qe);
3963
- k(je), s == null || s(je);
3964
- } finally {
3965
- C(!1);
3947
+ if (!ce) return;
3948
+ if (U.current) {
3949
+ console.log("[ChatSessionProvider] Skipping thread load - cleanup in progress");
3950
+ return;
3951
+ }
3952
+ C(!0), k(null);
3953
+ let Ye = !0;
3954
+ try {
3955
+ const De = await c.getStateHistory({
3956
+ threadId: ce,
3957
+ checkpointId: re || void 0
3958
+ // Let backend pick latest if not specified
3959
+ });
3960
+ if (U.current) {
3961
+ console.log("[ChatSessionProvider] Discarding thread load - thread was cleared"), Ye = !1;
3962
+ return;
3963
+ }
3964
+ const { checkpoints: Xe } = Ur(De);
3965
+ Be(ce, Xe, `thread load (requested: ${re})`);
3966
+ const je = Xe.find((Fe) => Fe.messages && Fe.messages.length > 0) ?? (re ? Xe.find((Fe) => Fe.checkpointId === re) : null) ?? Xe[0];
3967
+ E((je == null ? void 0 : je.messages) ?? [], {
3968
+ checkpointId: (je == null ? void 0 : je.checkpointId) ?? null,
3969
+ checkpointNs: (je == null ? void 0 : je.checkpointNs) ?? null
3970
+ }), Z(Xe), j(!!(je != null && je.nextCursor)), D((je == null ? void 0 : je.nextCursor) ?? null);
3971
+ } catch (De) {
3972
+ if (U.current)
3973
+ console.log("[ChatSessionProvider] Error during thread load, but cleanup in progress - ignoring"), Ye = !1;
3974
+ else {
3975
+ const Xe = String(De);
3976
+ k(Xe), s == null || s(Xe);
3966
3977
  }
3978
+ } finally {
3979
+ Ye && C(!1);
3967
3980
  }
3968
3981
  },
3969
- [c, E, s, ze]
3982
+ [c, E, s, Be]
3970
3983
  );
3971
3984
  Et(() => {
3972
- P.current = Be;
3973
- }, [Be]);
3974
- const Ue = Ce(
3985
+ P.current = He;
3986
+ }, [He]);
3987
+ const We = Ce(
3975
3988
  async (ce, re) => {
3976
- const Qe = W.current;
3977
- if (Qe) {
3978
- pe(!0);
3979
- try {
3980
- const je = await c.getStateHistory({
3981
- threadId: Qe,
3982
- checkpointId: ce,
3983
- checkpointNs: re ?? void 0
3984
- }), { checkpoints: De } = Ur(je);
3985
- ze(Qe, De, "checkpoint navigation");
3986
- const ut = De.find(
3987
- (et) => et.checkpointId === ce && (re ? et.checkpointNs === re : !0)
3988
- );
3989
- if (!ut) {
3990
- console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: ce, checkpointNs: re });
3991
- return;
3992
- }
3993
- Z(De), E(ut.messages ?? [], {
3994
- checkpointId: ut.checkpointId ?? null,
3995
- checkpointNs: ut.checkpointNs ?? null
3996
- });
3997
- } catch (je) {
3998
- s == null || s(String(je));
3999
- } finally {
4000
- pe(!1);
3989
+ const Ye = W.current;
3990
+ if (!Ye) return;
3991
+ if (U.current) {
3992
+ console.log("[ChatSessionProvider] Skipping checkpoint navigation - cleanup in progress");
3993
+ return;
3994
+ }
3995
+ pe(!0);
3996
+ let De = !0;
3997
+ try {
3998
+ const Xe = await c.getStateHistory({
3999
+ threadId: Ye,
4000
+ checkpointId: ce,
4001
+ checkpointNs: re ?? void 0
4002
+ });
4003
+ if (U.current) {
4004
+ console.log("[ChatSessionProvider] Discarding checkpoint navigation - thread was cleared"), De = !1;
4005
+ return;
4006
+ }
4007
+ const { checkpoints: je } = Ur(Xe);
4008
+ Be(Ye, je, "checkpoint navigation");
4009
+ const Fe = je.find(
4010
+ (Oe) => Oe.checkpointId === ce && (re ? Oe.checkpointNs === re : !0)
4011
+ );
4012
+ if (!Fe) {
4013
+ console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: ce, checkpointNs: re });
4014
+ return;
4001
4015
  }
4016
+ Z(je), E(Fe.messages ?? [], {
4017
+ checkpointId: Fe.checkpointId ?? null,
4018
+ checkpointNs: Fe.checkpointNs ?? null
4019
+ });
4020
+ } catch (Xe) {
4021
+ U.current ? (console.log("[ChatSessionProvider] Error during checkpoint navigation, but cleanup in progress - ignoring"), De = !1) : s == null || s(String(Xe));
4022
+ } finally {
4023
+ De && pe(!1);
4002
4024
  }
4003
4025
  },
4004
- [c, E, s, ze]
4005
- ), Ke = Ce(
4026
+ [c, E, s, Be]
4027
+ ), qe = Ce(
4006
4028
  (ce, re) => {
4007
4029
  E(N.messages, {
4008
4030
  checkpointId: ce ?? null,
@@ -4010,11 +4032,11 @@ function Xx({
4010
4032
  });
4011
4033
  },
4012
4034
  [E, N.messages]
4013
- ), qe = Ce(async () => {
4014
- W.current && await Be(W.current);
4015
- }, [Be]), Ze = Ce(async () => {
4035
+ ), Ge = Ce(async () => {
4036
+ W.current && await He(W.current);
4037
+ }, [He]), tt = Ce(async () => {
4016
4038
  if (!W.current || !B) return;
4017
- if (q.current) {
4039
+ if (U.current) {
4018
4040
  console.log("[ChatSessionProvider] Skipping history load - thread cleanup in progress");
4019
4041
  return;
4020
4042
  }
@@ -4025,65 +4047,86 @@ function Xx({
4025
4047
  threadId: W.current,
4026
4048
  checkpointId: B
4027
4049
  });
4028
- if (q.current) {
4050
+ if (U.current) {
4029
4051
  console.log("[ChatSessionProvider] Discarding history fetch - thread was cleared"), ce = !1;
4030
4052
  return;
4031
4053
  }
4032
- const { checkpoints: Qe } = Ur(re);
4033
- if (Qe.length > 0) {
4034
- const je = Qe[Qe.length - 1];
4035
- I((je == null ? void 0 : je.messages) ?? []), j(!!(je != null && je.nextCursor)), D((je == null ? void 0 : je.nextCursor) ?? null);
4054
+ const { checkpoints: Ye } = Ur(re);
4055
+ if (Ye.length > 0) {
4056
+ const De = Ye[Ye.length - 1];
4057
+ I((De == null ? void 0 : De.messages) ?? []), j(!!(De != null && De.nextCursor)), D((De == null ? void 0 : De.nextCursor) ?? null);
4036
4058
  }
4037
4059
  } catch (re) {
4038
- q.current ? (console.log("[ChatSessionProvider] Error during history fetch, but cleanup in progress - ignoring"), ce = !1) : s == null || s(String(re));
4060
+ U.current ? (console.log("[ChatSessionProvider] Error during history fetch, but cleanup in progress - ignoring"), ce = !1) : s == null || s(String(re));
4039
4061
  } finally {
4040
4062
  ce && A(!1);
4041
4063
  }
4042
- }, [c, B, I, s]), Xe = Ce(async () => {
4043
- q.current = !0, te(), W.current = null, ee.current = null, E([], {}), Z([]), j(!1), D(null), x(null), await Promise.resolve(), q.current = !1;
4044
- }, [E, te]), rt = Ce(
4045
- async (ce, re) => {
4046
- console.log("[ChatSessionProvider] Interrupt:", ce, re);
4064
+ }, [c, B, I, s]), Qe = Ce(async () => {
4065
+ U.current = !0, te(), W.current = null, ee.current = null, E([], {}), Z([]), j(!1), D(null), x(null), C(!1), A(!1), pe(!1), await Promise.resolve(), await Promise.resolve(), U.current = !1;
4066
+ }, [E, te]), ot = Ce(
4067
+ async (ce, re, Ye) => {
4068
+ const De = W.current;
4069
+ if (!De)
4070
+ throw new Error("No active thread to handle interrupt");
4071
+ const Xe = re ? Ye ?? !0 : !1;
4072
+ try {
4073
+ const je = {
4074
+ threadId: De,
4075
+ checkpointId: N.lastCheckpointId ?? void 0,
4076
+ checkpointNs: N.lastCheckpointNs ?? void 0,
4077
+ // The command is the key: backend extracts this and routes to LangGraph
4078
+ command: { kind: "resume", value: Xe }
4079
+ };
4080
+ H(je);
4081
+ } catch (je) {
4082
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${ce}:`, je), je;
4083
+ }
4047
4084
  },
4048
- []
4085
+ [N.lastCheckpointId, N.lastCheckpointNs, H]
4049
4086
  );
4050
4087
  Et(() => {
4051
4088
  Y();
4052
4089
  }, [Y]), Et(() => {
4053
4090
  var ce, re;
4054
- !o || !m || T || ee.current !== m && (ee.current = m, n ? (console.log("[ChatSessionProvider] Loading thread with checkpoint:", n), (ce = P.current) == null || ce.call(P, m, n)) : (console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (re = P.current) == null || re.call(P, m)));
4091
+ if (!(!o || !m || T)) {
4092
+ if (U.current) {
4093
+ console.log("[ChatSessionProvider] Skipping load - cleanup in progress");
4094
+ return;
4095
+ }
4096
+ ee.current !== m && (ee.current = m, n ? (console.log("[ChatSessionProvider] Loading thread with checkpoint:", n), (ce = P.current) == null || ce.call(P, m, n)) : (console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (re = P.current) == null || re.call(P, m)));
4097
+ }
4055
4098
  }, [o, m, T, n, r]), Et(() => {
4056
4099
  a == null || a(m);
4057
4100
  }, [m, a]);
4058
4101
  const St = Ce(
4059
4102
  async (ce, re) => {
4060
- const Qe = W.current, je = (ce == null ? void 0 : ce.text) ?? "";
4061
- if (!Qe && !je) return;
4062
- if (!Qe) {
4103
+ const Ye = W.current, De = (ce == null ? void 0 : ce.text) ?? "";
4104
+ if (!Ye && !De) return;
4105
+ if (!Ye) {
4063
4106
  await de("New Chat");
4064
4107
  return;
4065
4108
  }
4066
- const { contentParts: De } = await wx(
4109
+ const { contentParts: Xe } = await wx(
4067
4110
  c,
4068
4111
  (ce == null ? void 0 : ce.attachments) ?? []
4069
- ), ut = [...De];
4070
- je != null && je.trim() && ut.push({ type: "text", text: je });
4071
- const et = {
4112
+ ), je = [...Xe];
4113
+ De != null && De.trim() && je.push({ type: "text", text: De });
4114
+ const Fe = {
4072
4115
  id: `msg-${Date.now()}`,
4073
4116
  role: "user",
4074
- content: ut,
4117
+ content: je,
4075
4118
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4076
4119
  };
4077
- O(et);
4078
- const Fe = {
4079
- threadId: Qe,
4120
+ O(Fe);
4121
+ const Oe = {
4122
+ threadId: Ye,
4080
4123
  checkpointId: (re == null ? void 0 : re.checkpointId) ?? N.lastCheckpointId ?? void 0,
4081
4124
  checkpointNs: (re == null ? void 0 : re.checkpointNs) ?? N.lastCheckpointNs ?? void 0
4082
4125
  };
4083
- H(Fe);
4126
+ H(Oe);
4084
4127
  },
4085
4128
  [c, de, O, N, H]
4086
- ), mt = at(
4129
+ ), mt = lt(
4087
4130
  () => ({
4088
4131
  threads: p,
4089
4132
  currentThreadId: m,
@@ -4098,7 +4141,7 @@ function Xx({
4098
4141
  }
4099
4142
  }),
4100
4143
  [p, m, y, w, de, ke, Ne, Y]
4101
- ), lt = at(
4144
+ ), ct = lt(
4102
4145
  () => ({
4103
4146
  threadId: m,
4104
4147
  messages: N.messages,
@@ -4114,14 +4157,14 @@ function Xx({
4114
4157
  isLoadingCheckpoint: J,
4115
4158
  error: S,
4116
4159
  hasMore: F,
4117
- loadOlder: Ze,
4118
- clearState: Xe,
4119
- navigateToCheckpoint: Ue,
4120
- setCurrentCheckpointId: Ke,
4121
- returnToLatest: qe,
4122
- loadThread: Be,
4123
- clearThread: Xe,
4124
- respondToInterrupt: rt
4160
+ loadOlder: tt,
4161
+ clearState: Qe,
4162
+ navigateToCheckpoint: We,
4163
+ setCurrentCheckpointId: qe,
4164
+ returnToLatest: Ge,
4165
+ loadThread: He,
4166
+ clearThread: Qe,
4167
+ respondToInterrupt: ot
4125
4168
  }),
4126
4169
  [
4127
4170
  m,
@@ -4132,15 +4175,15 @@ function Xx({
4132
4175
  J,
4133
4176
  S,
4134
4177
  F,
4135
- Ze,
4136
- Xe,
4137
- Ue,
4138
- Ke,
4178
+ tt,
4179
+ Qe,
4180
+ We,
4139
4181
  qe,
4140
- Be,
4141
- rt
4182
+ Ge,
4183
+ He,
4184
+ ot
4142
4185
  ]
4143
- ), Ct = at(
4186
+ ), Ct = lt(
4144
4187
  () => ({
4145
4188
  isStreaming: se,
4146
4189
  error: ne,
@@ -4148,11 +4191,11 @@ function Xx({
4148
4191
  submit: St,
4149
4192
  send: St,
4150
4193
  stop: te,
4151
- setAuthToken: Me
4194
+ setAuthToken: Le
4152
4195
  }),
4153
- [se, ne, St, te, Me]
4196
+ [se, ne, St, te, Le]
4154
4197
  );
4155
- return /* @__PURE__ */ u.jsx(Au.Provider, { value: mt, children: /* @__PURE__ */ u.jsx(ju.Provider, { value: lt, children: /* @__PURE__ */ u.jsx(_u.Provider, { value: Ct, children: e }) }) });
4198
+ return /* @__PURE__ */ u.jsx(Au.Provider, { value: mt, children: /* @__PURE__ */ u.jsx(ju.Provider, { value: ct, children: /* @__PURE__ */ u.jsx(_u.Provider, { value: Ct, children: e }) }) });
4156
4199
  }
4157
4200
  function xa() {
4158
4201
  const e = xs(Au);
@@ -4223,7 +4266,7 @@ const Zx = vs(
4223
4266
  size: "default"
4224
4267
  }
4225
4268
  }
4226
- ), ot = v.forwardRef(
4269
+ ), st = v.forwardRef(
4227
4270
  ({ className: e, variant: t, size: n, asChild: r = !1, ...o }, s) => {
4228
4271
  const i = r ? _m : "button";
4229
4272
  return /* @__PURE__ */ u.jsx(
@@ -4236,7 +4279,7 @@ const Zx = vs(
4236
4279
  );
4237
4280
  }
4238
4281
  );
4239
- ot.displayName = "Button";
4282
+ st.displayName = "Button";
4240
4283
  const Pu = v.forwardRef(
4241
4284
  ({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
4242
4285
  "textarea",
@@ -4337,7 +4380,7 @@ function Qx({
4337
4380
  }
4338
4381
  ) }),
4339
4382
  /* @__PURE__ */ u.jsx("div", { children: r ? /* @__PURE__ */ u.jsx(
4340
- ot,
4383
+ st,
4341
4384
  {
4342
4385
  type: "button",
4343
4386
  onClick: () => {
@@ -4351,7 +4394,7 @@ function Qx({
4351
4394
  children: /* @__PURE__ */ u.jsx(cm, { size: 16 })
4352
4395
  }
4353
4396
  ) : /* @__PURE__ */ u.jsx(
4354
- ot,
4397
+ st,
4355
4398
  {
4356
4399
  type: "submit",
4357
4400
  size: "icon",
@@ -4391,7 +4434,7 @@ function va(...e) {
4391
4434
  };
4392
4435
  };
4393
4436
  }
4394
- function Ve(...e) {
4437
+ function Ke(...e) {
4395
4438
  return v.useCallback(va(...e), e);
4396
4439
  }
4397
4440
  function ty(e, t) {
@@ -4547,14 +4590,14 @@ function wa(e) {
4547
4590
  i.displayName = t;
4548
4591
  const a = e + "CollectionSlot", l = Tr(a), c = z.forwardRef(
4549
4592
  (x, y) => {
4550
- const { scope: g, children: w } = x, b = s(a, g), T = Ve(y, b.collectionRef);
4593
+ const { scope: g, children: w } = x, b = s(a, g), T = Ke(y, b.collectionRef);
4551
4594
  return /* @__PURE__ */ u.jsx(l, { ref: T, children: w });
4552
4595
  }
4553
4596
  );
4554
4597
  c.displayName = a;
4555
4598
  const d = e + "CollectionItemSlot", f = "data-radix-collection-item", p = Tr(d), h = z.forwardRef(
4556
4599
  (x, y) => {
4557
- const { scope: g, children: w, ...b } = x, T = z.useRef(null), C = Ve(y, T), S = s(d, g);
4600
+ const { scope: g, children: w, ...b } = x, T = z.useRef(null), C = Ke(y, T), S = s(d, g);
4558
4601
  return z.useEffect(() => (S.itemMap.set(T, { ref: T, ...b }), () => void S.itemMap.delete(T))), /* @__PURE__ */ u.jsx(p, { [f]: "", ref: C, children: w });
4559
4602
  }
4560
4603
  );
@@ -4613,7 +4656,7 @@ var cy = "DismissableLayer", Bi = "dismissableLayer.update", uy = "dismissableLa
4613
4656
  onInteractOutside: i,
4614
4657
  onDismiss: a,
4615
4658
  ...l
4616
- } = e, c = v.useContext(Mu), [d, f] = v.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = v.useState({}), m = Ve(t, (k) => f(k)), x = Array.from(c.layers), [y] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), g = x.indexOf(y), w = d ? x.indexOf(d) : -1, b = c.layersWithOutsidePointerEventsDisabled.size > 0, T = w >= g, C = hy((k) => {
4659
+ } = e, c = v.useContext(Mu), [d, f] = v.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = v.useState({}), m = Ke(t, (k) => f(k)), x = Array.from(c.layers), [y] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), g = x.indexOf(y), w = d ? x.indexOf(d) : -1, b = c.layersWithOutsidePointerEventsDisabled.size > 0, T = w >= g, C = hy((k) => {
4617
4660
  const N = k.target, E = [...c.branches].some((I) => I.contains(N));
4618
4661
  !T || E || (o == null || o(k), i == null || i(k), k.defaultPrevented || a == null || a());
4619
4662
  }, p), S = my((k) => {
@@ -4653,7 +4696,7 @@ var cy = "DismissableLayer", Bi = "dismissableLayer.update", uy = "dismissableLa
4653
4696
  );
4654
4697
  Es.displayName = cy;
4655
4698
  var fy = "DismissableLayerBranch", py = v.forwardRef((e, t) => {
4656
- const n = v.useContext(Mu), r = v.useRef(null), o = Ve(t, r);
4699
+ const n = v.useContext(Mu), r = v.useRef(null), o = Ke(t, r);
4657
4700
  return v.useEffect(() => {
4658
4701
  const s = r.current;
4659
4702
  if (s)
@@ -4735,7 +4778,7 @@ var hi = "focusScope.autoFocusOnMount", mi = "focusScope.autoFocusOnUnmount", Kl
4735
4778
  onMountAutoFocus: o,
4736
4779
  onUnmountAutoFocus: s,
4737
4780
  ...i
4738
- } = e, [a, l] = v.useState(null), c = Dt(o), d = Dt(s), f = v.useRef(null), p = Ve(t, (x) => l(x)), h = v.useRef({
4781
+ } = e, [a, l] = v.useState(null), c = Dt(o), d = Dt(s), f = v.useRef(null), p = Ke(t, (x) => l(x)), h = v.useRef({
4739
4782
  paused: !1,
4740
4783
  pause() {
4741
4784
  this.paused = !0;
@@ -6221,7 +6264,7 @@ var Ia = "Popper", [Ju, Ps] = Mn(Ia), [Lv, Zu] = Ju(Ia), Qu = (e) => {
6221
6264
  Qu.displayName = Ia;
6222
6265
  var ed = "PopperAnchor", td = v.forwardRef(
6223
6266
  (e, t) => {
6224
- const { __scopePopper: n, virtualRef: r, ...o } = e, s = Zu(ed, n), i = v.useRef(null), a = Ve(t, i), l = v.useRef(null);
6267
+ const { __scopePopper: n, virtualRef: r, ...o } = e, s = Zu(ed, n), i = v.useRef(null), a = Ke(t, i), l = v.useRef(null);
6225
6268
  return v.useEffect(() => {
6226
6269
  const c = l.current;
6227
6270
  l.current = (r == null ? void 0 : r.current) || i.current, c !== l.current && s.onAnchorChange(l.current);
@@ -6231,7 +6274,7 @@ var ed = "PopperAnchor", td = v.forwardRef(
6231
6274
  td.displayName = ed;
6232
6275
  var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6233
6276
  (e, t) => {
6234
- var q, P, H, te, se, ne;
6277
+ var U, P, H, te, se, ne;
6235
6278
  const {
6236
6279
  __scopePopper: n,
6237
6280
  side: r = "bottom",
@@ -6247,7 +6290,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6247
6290
  updatePositionStrategy: h = "optimized",
6248
6291
  onPlaced: m,
6249
6292
  ...x
6250
- } = e, y = Zu(Na, n), [g, w] = v.useState(null), b = Ve(t, (Me) => w(Me)), [T, C] = v.useState(null), S = Xu(T), k = (S == null ? void 0 : S.width) ?? 0, N = (S == null ? void 0 : S.height) ?? 0, E = r + (s !== "center" ? "-" + s : ""), I = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, O = Array.isArray(c) ? c : [c], L = O.length > 0, F = {
6293
+ } = e, y = Zu(Na, n), [g, w] = v.useState(null), b = Ke(t, (Le) => w(Le)), [T, C] = v.useState(null), S = Xu(T), k = (S == null ? void 0 : S.width) ?? 0, N = (S == null ? void 0 : S.height) ?? 0, E = r + (s !== "center" ? "-" + s : ""), I = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, O = Array.isArray(c) ? c : [c], L = O.length > 0, F = {
6251
6294
  padding: I,
6252
6295
  boundary: O.filter(Bv),
6253
6296
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -6256,7 +6299,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6256
6299
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
6257
6300
  strategy: "fixed",
6258
6301
  placement: E,
6259
- whileElementsMounted: (...Me) => gv(...Me, {
6302
+ whileElementsMounted: (...Le) => gv(...Le, {
6260
6303
  animationFrame: h === "always"
6261
6304
  }),
6262
6305
  elements: {
@@ -6273,9 +6316,9 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6273
6316
  l && jv({ ...F }),
6274
6317
  _v({
6275
6318
  ...F,
6276
- apply: ({ elements: Me, rects: Y, availableWidth: de, availableHeight: ke }) => {
6277
- const { width: Ne, height: ze } = Y.reference, Be = Me.floating.style;
6278
- Be.setProperty("--radix-popper-available-width", `${de}px`), Be.setProperty("--radix-popper-available-height", `${ke}px`), Be.setProperty("--radix-popper-anchor-width", `${Ne}px`), Be.setProperty("--radix-popper-anchor-height", `${ze}px`);
6319
+ apply: ({ elements: Le, rects: Y, availableWidth: de, availableHeight: ke }) => {
6320
+ const { width: Ne, height: Be } = Y.reference, He = Le.floating.style;
6321
+ He.setProperty("--radix-popper-available-width", `${de}px`), He.setProperty("--radix-popper-available-height", `${ke}px`), He.setProperty("--radix-popper-anchor-width", `${Ne}px`), He.setProperty("--radix-popper-anchor-height", `${Be}px`);
6279
6322
  }
6280
6323
  }),
6281
6324
  T && Ov({ element: T, padding: a }),
@@ -6286,7 +6329,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6286
6329
  Lt(() => {
6287
6330
  B && (J == null || J());
6288
6331
  }, [B, J]);
6289
- const pe = (q = D.arrow) == null ? void 0 : q.x, Re = (P = D.arrow) == null ? void 0 : P.y, Ee = ((H = D.arrow) == null ? void 0 : H.centerOffset) !== 0, [W, ee] = v.useState();
6332
+ const pe = (U = D.arrow) == null ? void 0 : U.x, Re = (P = D.arrow) == null ? void 0 : P.y, Ee = ((H = D.arrow) == null ? void 0 : H.centerOffset) !== 0, [W, ee] = v.useState();
6290
6333
  return Lt(() => {
6291
6334
  g && ee(window.getComputedStyle(g).zIndex);
6292
6335
  }, [g]), /* @__PURE__ */ u.jsx(
@@ -6424,7 +6467,7 @@ function Wv(e, t) {
6424
6467
  return v.useReducer((n, r) => t[n][r] ?? n, e);
6425
6468
  }
6426
6469
  var cn = (e) => {
6427
- const { present: t, children: n } = e, r = Vv(t), o = typeof n == "function" ? n({ present: r.isPresent }) : v.Children.only(n), s = Ve(r.ref, Kv(o));
6470
+ const { present: t, children: n } = e, r = Vv(t), o = typeof n == "function" ? n({ present: r.isPresent }) : v.Children.only(n), s = Ke(r.ref, Kv(o));
6428
6471
  return typeof n == "function" || r.isPresent ? v.cloneElement(o, { ref: s }) : null;
6429
6472
  };
6430
6473
  cn.displayName = "Presence";
@@ -6504,7 +6547,7 @@ var Zv = v.forwardRef((e, t) => {
6504
6547
  onEntryFocus: c,
6505
6548
  preventScrollOnEntryFocus: d = !1,
6506
6549
  ...f
6507
- } = e, p = v.useRef(null), h = Ve(t, p), m = Rs(s), [x, y] = Rr({
6550
+ } = e, p = v.useRef(null), h = Ke(t, p), m = Rs(s), [x, y] = Rr({
6508
6551
  prop: i,
6509
6552
  defaultProp: a ?? null,
6510
6553
  onChange: l,
@@ -7232,7 +7275,7 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
7232
7275
  }
7233
7276
  ), tb = v.forwardRef(
7234
7277
  (e, t) => {
7235
- const n = fr(an, e.__scopeMenu), r = v.useRef(null), o = Ve(t, r);
7278
+ const n = fr(an, e.__scopeMenu), r = v.useRef(null), o = Ke(t, r);
7236
7279
  return v.useEffect(() => {
7237
7280
  const s = r.current;
7238
7281
  if (s) return Aa(s);
@@ -7283,9 +7326,9 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
7283
7326
  onDismiss: h,
7284
7327
  disableOutsideScroll: m,
7285
7328
  ...x
7286
- } = e, y = fr(an, n), g = yo(an, n), w = Ls(n), b = Rd(n), T = Gw(n), [C, S] = v.useState(null), k = v.useRef(null), N = Ve(t, k, y.onContentChange), E = v.useRef(0), I = v.useRef(""), O = v.useRef(0), L = v.useRef(null), F = v.useRef("right"), j = v.useRef(0), $ = m ? Ds : v.Fragment, A = m ? { as: rb, allowPinchZoom: !0 } : void 0, B = (M) => {
7287
- var q, P;
7288
- const Z = I.current + M, J = T().filter((H) => !H.disabled), pe = document.activeElement, Re = (q = J.find((H) => H.ref.current === pe)) == null ? void 0 : q.textValue, Ee = J.map((H) => H.textValue), W = mb(Ee, Z, Re), ee = (P = J.find((H) => H.textValue === W)) == null ? void 0 : P.ref.current;
7329
+ } = e, y = fr(an, n), g = yo(an, n), w = Ls(n), b = Rd(n), T = Gw(n), [C, S] = v.useState(null), k = v.useRef(null), N = Ke(t, k, y.onContentChange), E = v.useRef(0), I = v.useRef(""), O = v.useRef(0), L = v.useRef(null), F = v.useRef("right"), j = v.useRef(0), $ = m ? Ds : v.Fragment, A = m ? { as: rb, allowPinchZoom: !0 } : void 0, B = (M) => {
7330
+ var U, P;
7331
+ const Z = I.current + M, J = T().filter((H) => !H.disabled), pe = document.activeElement, Re = (U = J.find((H) => H.ref.current === pe)) == null ? void 0 : U.textValue, Ee = J.map((H) => H.textValue), W = mb(Ee, Z, Re), ee = (P = J.find((H) => H.textValue === W)) == null ? void 0 : P.ref.current;
7289
7332
  (function H(te) {
7290
7333
  I.current = te, window.clearTimeout(E.current), te !== "" && (E.current = window.setTimeout(() => H(""), 1e3));
7291
7334
  })(Z), ee && setTimeout(() => ee.focus());
@@ -7375,7 +7418,7 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
7375
7418
  const Ee = k.current;
7376
7419
  if (M.target !== Ee || !Vw.includes(M.key)) return;
7377
7420
  M.preventDefault();
7378
- const ee = T().filter((q) => !q.disabled).map((q) => q.ref.current);
7421
+ const ee = T().filter((U) => !U.disabled).map((U) => U.ref.current);
7379
7422
  Td.includes(M.key) && ee.reverse(), pb(ee);
7380
7423
  }),
7381
7424
  onBlur: fe(e.onBlur, (M) => {
@@ -7420,7 +7463,7 @@ var sb = "MenuLabel", jd = v.forwardRef(
7420
7463
  jd.displayName = sb;
7421
7464
  var ns = "MenuItem", fc = "menu.itemSelect", Fs = v.forwardRef(
7422
7465
  (e, t) => {
7423
- const { disabled: n = !1, onSelect: r, ...o } = e, s = v.useRef(null), i = yo(ns, e.__scopeMenu), a = Pa(ns, e.__scopeMenu), l = Ve(t, s), c = v.useRef(!1), d = () => {
7466
+ const { disabled: n = !1, onSelect: r, ...o } = e, s = v.useRef(null), i = yo(ns, e.__scopeMenu), a = Pa(ns, e.__scopeMenu), l = Ke(t, s), c = v.useRef(!1), d = () => {
7424
7467
  const f = s.current;
7425
7468
  if (!n && f) {
7426
7469
  const p = new CustomEvent(fc, { bubbles: !0, cancelable: !0 });
@@ -7453,7 +7496,7 @@ var ns = "MenuItem", fc = "menu.itemSelect", Fs = v.forwardRef(
7453
7496
  Fs.displayName = ns;
7454
7497
  var _d = v.forwardRef(
7455
7498
  (e, t) => {
7456
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Pa(ns, n), a = Rd(n), l = v.useRef(null), c = Ve(t, l), [d, f] = v.useState(!1), [p, h] = v.useState("");
7499
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Pa(ns, n), a = Rd(n), l = v.useRef(null), c = Ke(t, l), [d, f] = v.useState(!1), [p, h] = v.useState("");
7457
7500
  return v.useEffect(() => {
7458
7501
  const m = l.current;
7459
7502
  m && h((m.textContent ?? "").trim());
@@ -7663,7 +7706,7 @@ var fb = "MenuSub", [mk, Hd] = dr(fb), Br = "MenuSubTrigger", Ud = v.forwardRef(
7663
7706
  Ud.displayName = Br;
7664
7707
  var Wd = "MenuSubContent", Vd = v.forwardRef(
7665
7708
  (e, t) => {
7666
- const n = Id(an, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = fr(an, e.__scopeMenu), i = yo(an, e.__scopeMenu), a = Hd(Wd, e.__scopeMenu), l = v.useRef(null), c = Ve(t, l);
7709
+ const n = Id(an, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = fr(an, e.__scopeMenu), i = yo(an, e.__scopeMenu), a = Hd(Wd, e.__scopeMenu), l = v.useRef(null), c = Ke(t, l);
7667
7710
  return /* @__PURE__ */ u.jsx(eo.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(cn, { present: r || s.open, children: /* @__PURE__ */ u.jsx(eo.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(
7668
7711
  Oa,
7669
7712
  {
@@ -8101,10 +8144,10 @@ function p0(e, t) {
8101
8144
  function yt(...e) {
8102
8145
  return e;
8103
8146
  }
8104
- function st(e, t) {
8147
+ function it(e, t) {
8105
8148
  return e(Kn, t);
8106
8149
  }
8107
- function Oe(e, t) {
8150
+ function Me(e, t) {
8108
8151
  e(zs, t);
8109
8152
  }
8110
8153
  function $a(e) {
@@ -8114,7 +8157,7 @@ function Rt(e) {
8114
8157
  return e(vf);
8115
8158
  }
8116
8159
  function he(e, t) {
8117
- return st(e, d0(t, zs));
8160
+ return it(e, d0(t, zs));
8118
8161
  }
8119
8162
  function pn(e, t) {
8120
8163
  const n = e(Kn, (r) => {
@@ -8152,7 +8195,7 @@ function wn(e) {
8152
8195
  t(e);
8153
8196
  };
8154
8197
  }
8155
- function U(e, ...t) {
8198
+ function V(e, ...t) {
8156
8199
  const n = h0(...t);
8157
8200
  return (r, o) => {
8158
8201
  switch (r) {
@@ -8160,7 +8203,7 @@ function U(e, ...t) {
8160
8203
  $a(e);
8161
8204
  return;
8162
8205
  case Kn:
8163
- return st(e, n(o));
8206
+ return it(e, n(o));
8164
8207
  }
8165
8208
  };
8166
8209
  }
@@ -8182,13 +8225,13 @@ function An(e) {
8182
8225
  }, e));
8183
8226
  };
8184
8227
  }
8185
- function Le(...e) {
8228
+ function $e(...e) {
8186
8229
  const t = new Array(e.length);
8187
8230
  let n = 0, r = null;
8188
8231
  const o = Math.pow(2, e.length) - 1;
8189
8232
  return e.forEach((s, i) => {
8190
8233
  const a = Math.pow(2, i);
8191
- st(s, (l) => {
8234
+ it(s, (l) => {
8192
8235
  const c = n;
8193
8236
  n = n | a, t[i] = l, c !== o && n === o && r && (r(), r = null);
8194
8237
  });
@@ -8208,7 +8251,7 @@ function m0(e) {
8208
8251
  return function(o, s) {
8209
8252
  switch (o) {
8210
8253
  case Kn:
8211
- return s ? n === s ? void 0 : (r(), n = s, t = st(e, s), t) : (r(), Or);
8254
+ return s ? n === s ? void 0 : (r(), n = s, t = it(e, s), t) : (r(), Or);
8212
8255
  case Pr:
8213
8256
  r(), n = null;
8214
8257
  return;
@@ -8217,7 +8260,7 @@ function m0(e) {
8217
8260
  }
8218
8261
  function X(e) {
8219
8262
  let t = e;
8220
- const n = We();
8263
+ const n = Ve();
8221
8264
  return (r, o) => {
8222
8265
  switch (r) {
8223
8266
  case zs:
@@ -8236,7 +8279,7 @@ function X(e) {
8236
8279
  function Ht(e, t) {
8237
8280
  return Bs(X(t), (n) => he(e, n));
8238
8281
  }
8239
- function We() {
8282
+ function Ve() {
8240
8283
  const e = [];
8241
8284
  return (t, n) => {
8242
8285
  switch (t) {
@@ -8257,9 +8300,9 @@ function We() {
8257
8300
  };
8258
8301
  }
8259
8302
  function en(e) {
8260
- return Bs(We(), (t) => he(e, t));
8303
+ return Bs(Ve(), (t) => he(e, t));
8261
8304
  }
8262
- function tt(e, t = [], { singleton: n } = { singleton: !0 }) {
8305
+ function nt(e, t = [], { singleton: n } = { singleton: !0 }) {
8263
8306
  return {
8264
8307
  constructor: e,
8265
8308
  dependencies: t,
@@ -8278,13 +8321,13 @@ function x0(e) {
8278
8321
  return n(e);
8279
8322
  }
8280
8323
  function At(...e) {
8281
- const t = We(), n = new Array(e.length);
8324
+ const t = Ve(), n = new Array(e.length);
8282
8325
  let r = 0;
8283
8326
  const o = Math.pow(2, e.length) - 1;
8284
8327
  return e.forEach((s, i) => {
8285
8328
  const a = Math.pow(2, i);
8286
- st(s, (l) => {
8287
- n[i] = l, r = r | a, r === o && Oe(t, n);
8329
+ it(s, (l) => {
8330
+ n[i] = l, r = r | a, r === o && Me(t, n);
8288
8331
  });
8289
8332
  }), function(s, i) {
8290
8333
  switch (s) {
@@ -8293,12 +8336,12 @@ function At(...e) {
8293
8336
  return;
8294
8337
  }
8295
8338
  case Kn:
8296
- return r === o && i(n), st(t, i);
8339
+ return r === o && i(n), it(t, i);
8297
8340
  }
8298
8341
  };
8299
8342
  }
8300
8343
  function Se(e, t = bf) {
8301
- return U(e, xt(t));
8344
+ return V(e, xt(t));
8302
8345
  }
8303
8346
  function Yi(...e) {
8304
8347
  return function(t, n) {
@@ -8306,7 +8349,7 @@ function Yi(...e) {
8306
8349
  case Pr:
8307
8350
  return;
8308
8351
  case Kn:
8309
- return f0(...e.map((r) => st(r, n)));
8352
+ return f0(...e.map((r) => it(r, n)));
8310
8353
  }
8311
8354
  };
8312
8355
  }
@@ -8316,7 +8359,7 @@ const y0 = {
8316
8359
  3: "error",
8317
8360
  1: "log",
8318
8361
  2: "warn"
8319
- }, v0 = () => typeof globalThis > "u" ? window : globalThis, qn = tt(
8362
+ }, v0 = () => typeof globalThis > "u" ? window : globalThis, qn = nt(
8320
8363
  () => {
8321
8364
  const e = X(
8322
8365
  3
@@ -8444,17 +8487,17 @@ function Sf(e, t, n) {
8444
8487
  }
8445
8488
  }, [a, t, i]), s;
8446
8489
  }
8447
- const Wt = tt(
8490
+ const Wt = nt(
8448
8491
  () => {
8449
- const e = We(), t = We(), n = X(0), r = We(), o = X(0), s = We(), i = We(), a = X(0), l = X(0), c = X(0), d = X(0), f = We(), p = We(), h = X(!1), m = X(!1), x = X(!1);
8492
+ const e = Ve(), t = Ve(), n = X(0), r = Ve(), o = X(0), s = Ve(), i = Ve(), a = X(0), l = X(0), c = X(0), d = X(0), f = Ve(), p = Ve(), h = X(!1), m = X(!1), x = X(!1);
8450
8493
  return he(
8451
- U(
8494
+ V(
8452
8495
  e,
8453
8496
  le(({ scrollTop: y }) => y)
8454
8497
  ),
8455
8498
  t
8456
8499
  ), he(
8457
- U(
8500
+ V(
8458
8501
  e,
8459
8502
  le(({ scrollHeight: y }) => y)
8460
8503
  ),
@@ -8625,7 +8668,7 @@ function If(e, t) {
8625
8668
  function oo(e, t) {
8626
8669
  return !!(e && e[0] === t[0] && e[1] === t[1]);
8627
8670
  }
8628
- const Ba = tt(
8671
+ const Ba = nt(
8629
8672
  () => ({ recalcInProgress: X(!1) }),
8630
8673
  [],
8631
8674
  { singleton: !0 }
@@ -8792,13 +8835,13 @@ function _0(e) {
8792
8835
  const P0 = {
8793
8836
  offsetHeight: "height",
8794
8837
  offsetWidth: "width"
8795
- }, En = tt(
8838
+ }, En = nt(
8796
8839
  ([{ log: e }, { recalcInProgress: t }]) => {
8797
- const n = We(), r = We(), o = Ht(r, 0), s = We(), i = We(), a = X(0), l = X([]), c = X(void 0), d = X(void 0), f = X((C, S) => Un(C, P0[S])), p = X(void 0), h = X(0), m = T0(), x = Ht(
8798
- U(n, Le(l, e, h), Cn(N0, m), xt()),
8840
+ const n = Ve(), r = Ve(), o = Ht(r, 0), s = Ve(), i = Ve(), a = X(0), l = X([]), c = X(void 0), d = X(void 0), f = X((C, S) => Un(C, P0[S])), p = X(void 0), h = X(0), m = T0(), x = Ht(
8841
+ V(n, $e(l, e, h), Cn(N0, m), xt()),
8799
8842
  m
8800
8843
  ), y = Ht(
8801
- U(
8844
+ V(
8802
8845
  l,
8803
8846
  xt(),
8804
8847
  Cn((C, S) => ({ current: S, prev: C.current }), {
@@ -8810,10 +8853,10 @@ const P0 = {
8810
8853
  []
8811
8854
  );
8812
8855
  he(
8813
- U(
8856
+ V(
8814
8857
  l,
8815
8858
  Te((C) => C.length > 0),
8816
- Le(x, h),
8859
+ $e(x, h),
8817
8860
  le(([C, S, k]) => {
8818
8861
  const N = C.reduce((E, I, O) => Zt(E, I, so(I, S.offsetTree, k) || O), Sr());
8819
8862
  return {
@@ -8825,9 +8868,9 @@ const P0 = {
8825
8868
  ),
8826
8869
  x
8827
8870
  ), he(
8828
- U(
8871
+ V(
8829
8872
  r,
8830
- Le(x),
8873
+ $e(x),
8831
8874
  Te(([C, { lastIndex: S }]) => C < S),
8832
8875
  le(([C, { lastIndex: S, lastSize: k }]) => [
8833
8876
  {
@@ -8840,14 +8883,14 @@ const P0 = {
8840
8883
  n
8841
8884
  ), he(c, d);
8842
8885
  const g = Ht(
8843
- U(
8886
+ V(
8844
8887
  c,
8845
8888
  le((C) => C === void 0)
8846
8889
  ),
8847
8890
  !0
8848
8891
  );
8849
8892
  he(
8850
- U(
8893
+ V(
8851
8894
  d,
8852
8895
  Te((C) => C !== void 0 && ft(Rt(x).sizeTree)),
8853
8896
  le((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
@@ -8855,9 +8898,9 @@ const P0 = {
8855
8898
  n
8856
8899
  );
8857
8900
  const w = en(
8858
- U(
8901
+ V(
8859
8902
  n,
8860
- Le(x),
8903
+ $e(x),
8861
8904
  Cn(
8862
8905
  ({ sizes: C }, [S, k]) => ({
8863
8906
  changed: k !== C,
@@ -8868,8 +8911,8 @@ const P0 = {
8868
8911
  le((C) => C.changed)
8869
8912
  )
8870
8913
  );
8871
- st(
8872
- U(
8914
+ it(
8915
+ V(
8873
8916
  a,
8874
8917
  Cn(
8875
8918
  (C, S) => ({ diff: C.prev - S, prev: S }),
@@ -8880,13 +8923,13 @@ const P0 = {
8880
8923
  (C) => {
8881
8924
  const { groupIndices: S } = Rt(x);
8882
8925
  if (C > 0)
8883
- Oe(t, !0), Oe(s, C + yc(C, S));
8926
+ Me(t, !0), Me(s, C + yc(C, S));
8884
8927
  else if (C < 0) {
8885
8928
  const k = Rt(y);
8886
- k.length > 0 && (C -= yc(-C, k)), Oe(i, C);
8929
+ k.length > 0 && (C -= yc(-C, k)), Me(i, C);
8887
8930
  }
8888
8931
  }
8889
- ), st(U(a, Le(e)), ([C, S]) => {
8932
+ ), it(V(a, $e(e)), ([C, S]) => {
8890
8933
  C < 0 && S(
8891
8934
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
8892
8935
  { firstItemIndex: a },
@@ -8895,9 +8938,9 @@ const P0 = {
8895
8938
  });
8896
8939
  const b = en(s);
8897
8940
  he(
8898
- U(
8941
+ V(
8899
8942
  s,
8900
- Le(x),
8943
+ $e(x),
8901
8944
  le(([C, S]) => {
8902
8945
  const k = S.groupIndices.length > 0, N = [], E = S.lastSize;
8903
8946
  if (k) {
@@ -8956,9 +8999,9 @@ const P0 = {
8956
8999
  n
8957
9000
  );
8958
9001
  const T = en(
8959
- U(
9002
+ V(
8960
9003
  i,
8961
- Le(x, h),
9004
+ $e(x, h),
8962
9005
  le(([C, { offsetTree: S }, k]) => {
8963
9006
  const N = -C;
8964
9007
  return so(N, S, k);
@@ -8966,9 +9009,9 @@ const P0 = {
8966
9009
  )
8967
9010
  );
8968
9011
  return he(
8969
- U(
9012
+ V(
8970
9013
  i,
8971
- Le(x, h),
9014
+ $e(x, h),
8972
9015
  le(([C, S, k]) => {
8973
9016
  if (S.groupIndices.length > 0) {
8974
9017
  if (ft(S.sizeTree))
@@ -9037,23 +9080,23 @@ function O0(e) {
9037
9080
  }
9038
9081
  );
9039
9082
  }
9040
- const _f = tt(
9083
+ const _f = nt(
9041
9084
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
9042
- const s = We(), i = We(), a = en(U(s, le(O0)));
9085
+ const s = Ve(), i = Ve(), a = en(V(s, le(O0)));
9043
9086
  return he(
9044
- U(
9087
+ V(
9045
9088
  a,
9046
9089
  le((l) => l.totalCount)
9047
9090
  ),
9048
9091
  n
9049
9092
  ), he(
9050
- U(
9093
+ V(
9051
9094
  a,
9052
9095
  le((l) => l.groupIndices)
9053
9096
  ),
9054
9097
  e
9055
9098
  ), he(
9056
- U(
9099
+ V(
9057
9100
  At(o, t, r),
9058
9101
  Te(([l, c]) => Us(c)),
9059
9102
  le(([l, c, d]) => gn(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
@@ -9064,16 +9107,16 @@ const _f = tt(
9064
9107
  ), { groupCounts: s, topItemsIndexes: i };
9065
9108
  },
9066
9109
  yt(En, Wt)
9067
- ), Gn = tt(
9110
+ ), Gn = nt(
9068
9111
  ([{ log: e }]) => {
9069
9112
  const t = X(!1), n = en(
9070
- U(
9113
+ V(
9071
9114
  t,
9072
9115
  Te((r) => r),
9073
9116
  xt()
9074
9117
  )
9075
9118
  );
9076
- return st(t, (r) => {
9119
+ return it(t, (r) => {
9077
9120
  r && Rt(e)("props updated", {}, Xt.DEBUG);
9078
9121
  }), { didMount: n, propsReady: t };
9079
9122
  },
@@ -9084,7 +9127,7 @@ function Pf(e) {
9084
9127
  const t = typeof e == "number" ? { index: e } : e;
9085
9128
  return t.align || (t.align = "start"), (!t.behavior || !M0) && (t.behavior = "auto"), t.offset || (t.offset = 0), t;
9086
9129
  }
9087
- const vo = tt(
9130
+ const vo = nt(
9088
9131
  ([
9089
9132
  { gap: e, listRefresh: t, sizes: n, totalCount: r },
9090
9133
  {
@@ -9099,16 +9142,16 @@ const vo = tt(
9099
9142
  },
9100
9143
  { log: p }
9101
9144
  ]) => {
9102
- const h = We(), m = We(), x = X(0);
9145
+ const h = Ve(), m = Ve(), x = X(0);
9103
9146
  let y = null, g = null, w = null;
9104
9147
  function b() {
9105
- y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), Oe(l, !1);
9148
+ y && (y(), y = null), w && (w(), w = null), g && (clearTimeout(g), g = null), Me(l, !1);
9106
9149
  }
9107
9150
  return he(
9108
- U(
9151
+ V(
9109
9152
  h,
9110
- Le(n, f, r, x, a, i, p),
9111
- Le(e, s, o),
9153
+ $e(n, f, r, x, a, i, p),
9154
+ $e(e, s, o),
9112
9155
  le(
9113
9156
  ([
9114
9157
  [T, C, S, k, N, E, I, O],
@@ -9120,20 +9163,20 @@ const vo = tt(
9120
9163
  let J = so(Z, C.offsetTree, L) + E;
9121
9164
  A === "end" ? (J += F + gn(C.sizeTree, Z)[1] - S + j, Z === M && (J += I)) : A === "center" ? J += (F + gn(C.sizeTree, Z)[1] - S + j) / 2 : J -= N, D && (J += D);
9122
9165
  const pe = (Re) => {
9123
- b(), Re ? (O("retrying to scroll to", { location: T }, Xt.DEBUG), Oe(h, T)) : (Oe(m, !0), O("list did not change, scroll successful", {}, Xt.DEBUG));
9166
+ b(), Re ? (O("retrying to scroll to", { location: T }, Xt.DEBUG), Me(h, T)) : (Me(m, !0), O("list did not change, scroll successful", {}, Xt.DEBUG));
9124
9167
  };
9125
9168
  if (b(), B === "smooth") {
9126
9169
  let Re = !1;
9127
- w = st(t, (Ee) => {
9170
+ w = it(t, (Ee) => {
9128
9171
  Re = Re || Ee;
9129
9172
  }), y = pn(d, () => {
9130
9173
  pe(Re);
9131
9174
  });
9132
9175
  } else
9133
- y = pn(U(t, D0(150)), pe);
9176
+ y = pn(V(t, D0(150)), pe);
9134
9177
  return g = setTimeout(() => {
9135
9178
  b();
9136
- }, 1200), Oe(l, !0), O("scrolling from index to", { behavior: B, index: Z, top: J }, Xt.DEBUG), { behavior: B, top: J };
9179
+ }, 1200), Me(l, !0), O("scrolling from index to", { behavior: B, index: Z, top: J }, Xt.DEBUG), { behavior: B, top: J };
9137
9180
  }
9138
9181
  )
9139
9182
  ),
@@ -9166,39 +9209,39 @@ function Wa(e, t) {
9166
9209
  const n = t - 1;
9167
9210
  return typeof e == "number" ? e : e.index === "LAST" ? n : e.index;
9168
9211
  }
9169
- const wo = tt(
9212
+ const wo = nt(
9170
9213
  ([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
9171
9214
  const a = X(!0), l = X(0), c = X(!0);
9172
9215
  return he(
9173
- U(
9216
+ V(
9174
9217
  i,
9175
- Le(l),
9218
+ $e(l),
9176
9219
  Te(([d, f]) => !!f),
9177
9220
  wn(!1)
9178
9221
  ),
9179
9222
  a
9180
9223
  ), he(
9181
- U(
9224
+ V(
9182
9225
  i,
9183
- Le(l),
9226
+ $e(l),
9184
9227
  Te(([d, f]) => !!f),
9185
9228
  wn(!1)
9186
9229
  ),
9187
9230
  c
9188
- ), st(
9189
- U(
9231
+ ), it(
9232
+ V(
9190
9233
  At(t, i),
9191
- Le(a, n, e, c),
9234
+ $e(a, n, e, c),
9192
9235
  Te(([[, d], f, { sizeTree: p }, h, m]) => d && (!ft(p) || Fa(h)) && !f && !m),
9193
- Le(l)
9236
+ $e(l)
9194
9237
  ),
9195
9238
  ([, d]) => {
9196
9239
  pn(o, () => {
9197
- Oe(c, !0);
9240
+ Me(c, !0);
9198
9241
  }), Ua(4, () => {
9199
9242
  pn(r, () => {
9200
- Oe(a, !0);
9201
- }), Oe(s, d);
9243
+ Me(a, !0);
9244
+ }), Me(s, d);
9202
9245
  });
9203
9246
  }
9204
9247
  ), {
@@ -9222,27 +9265,27 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9222
9265
  scrollTop: 0,
9223
9266
  viewportHeight: 0
9224
9267
  }
9225
- }, $0 = 0, bo = tt(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
9226
- const i = X(!1), a = X(!0), l = We(), c = We(), d = X(4), f = X($0), p = Ht(
9227
- U(
9228
- Yi(U(Se(o), ar(1), wn(!0)), U(Se(o), ar(1), wn(!1), mc(100))),
9268
+ }, $0 = 0, bo = nt(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
9269
+ const i = X(!1), a = X(!0), l = Ve(), c = Ve(), d = X(4), f = X($0), p = Ht(
9270
+ V(
9271
+ Yi(V(Se(o), ar(1), wn(!0)), V(Se(o), ar(1), wn(!1), mc(100))),
9229
9272
  xt()
9230
9273
  ),
9231
9274
  !1
9232
9275
  ), h = Ht(
9233
- U(Yi(U(n, wn(!0)), U(n, wn(!1), mc(200))), xt()),
9276
+ V(Yi(V(n, wn(!0)), V(n, wn(!1), mc(200))), xt()),
9234
9277
  !1
9235
9278
  );
9236
9279
  he(
9237
- U(
9280
+ V(
9238
9281
  At(Se(o), Se(f)),
9239
9282
  le(([w, b]) => w <= b),
9240
9283
  xt()
9241
9284
  ),
9242
9285
  a
9243
- ), he(U(a, An(50)), c);
9286
+ ), he(V(a, An(50)), c);
9244
9287
  const m = en(
9245
- U(
9288
+ V(
9246
9289
  At(r, Se(s), Se(t), Se(e), Se(d)),
9247
9290
  Cn((w, [{ scrollHeight: b, scrollTop: T }, C, S, k, N]) => {
9248
9291
  const E = T + C - b > -N, I = {
@@ -9269,7 +9312,7 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9269
9312
  xt((w, b) => w && w.atBottom === b.atBottom)
9270
9313
  )
9271
9314
  ), x = Ht(
9272
- U(
9315
+ V(
9273
9316
  r,
9274
9317
  Cn(
9275
9318
  (w, { scrollHeight: b, scrollTop: T, viewportHeight: C }) => {
@@ -9303,15 +9346,15 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9303
9346
  0
9304
9347
  );
9305
9348
  he(
9306
- U(
9349
+ V(
9307
9350
  m,
9308
9351
  le((w) => w.atBottom)
9309
9352
  ),
9310
9353
  i
9311
- ), he(U(i, An(50)), l);
9354
+ ), he(V(i, An(50)), l);
9312
9355
  const y = X(Vr);
9313
9356
  he(
9314
- U(
9357
+ V(
9315
9358
  r,
9316
9359
  le(({ scrollTop: w }) => w),
9317
9360
  xt(),
@@ -9322,20 +9365,20 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9322
9365
  le((w) => w.direction)
9323
9366
  ),
9324
9367
  y
9325
- ), he(U(r, An(50), wn(L0)), y);
9368
+ ), he(V(r, An(50), wn(L0)), y);
9326
9369
  const g = X(0);
9327
9370
  return he(
9328
- U(
9371
+ V(
9329
9372
  p,
9330
9373
  Te((w) => !w),
9331
9374
  wn(0)
9332
9375
  ),
9333
9376
  g
9334
9377
  ), he(
9335
- U(
9378
+ V(
9336
9379
  o,
9337
9380
  An(100),
9338
- Le(p),
9381
+ $e(p),
9339
9382
  Te(([w, b]) => !!b),
9340
9383
  Cn(([w, b], [T]) => [b, T], [0, 0]),
9341
9384
  le(([w, b]) => b - w)
@@ -9362,10 +9405,10 @@ function bc(e, t) {
9362
9405
  var n;
9363
9406
  return typeof e == "number" ? e : (n = e[t]) != null ? n : 0;
9364
9407
  }
9365
- const Va = tt(
9408
+ const Va = nt(
9366
9409
  ([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
9367
- const s = We(), i = X(0), a = X(0), l = X(0), c = Ht(
9368
- U(
9410
+ const s = Ve(), i = X(0), a = X(0), l = X(0), c = Ht(
9411
+ V(
9369
9412
  At(
9370
9413
  Se(r),
9371
9414
  Se(o),
@@ -9500,7 +9543,7 @@ function Sc(e, t, n) {
9500
9543
  }
9501
9544
  return s;
9502
9545
  }
9503
- const hr = tt(
9546
+ const hr = nt(
9504
9547
  ([
9505
9548
  { data: e, firstItemIndex: t, gap: n, sizes: r, totalCount: o },
9506
9549
  s,
@@ -9511,10 +9554,10 @@ const hr = tt(
9511
9554
  { didMount: h },
9512
9555
  { recalcInProgress: m }
9513
9556
  ]) => {
9514
- const x = X([]), y = X(0), g = We();
9557
+ const x = X([]), y = X(0), g = Ve();
9515
9558
  he(s.topItemsIndexes, x);
9516
9559
  const w = Ht(
9517
- U(
9560
+ V(
9518
9561
  At(
9519
9562
  h,
9520
9563
  m,
@@ -9563,11 +9606,11 @@ const hr = tt(
9563
9606
  const Z = [];
9564
9607
  if (L.length > 0) {
9565
9608
  const W = L[0], ee = L[L.length - 1];
9566
- let q = 0;
9609
+ let U = 0;
9567
9610
  for (const P of Hs(D, W, ee)) {
9568
9611
  const H = P.value, te = Math.max(P.start, W), se = Math.min(P.end, ee);
9569
9612
  for (let ne = te; ne <= se; ne++)
9570
- Z.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: q, size: H }), q += H;
9613
+ Z.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: U, size: H }), U += H;
9571
9614
  }
9572
9615
  }
9573
9616
  if (!O)
@@ -9577,11 +9620,11 @@ const hr = tt(
9577
9620
  return null;
9578
9621
  const Re = N - 1, Ee = Bs([], (W) => {
9579
9622
  for (const ee of pe) {
9580
- const q = ee.value;
9581
- let P = q.offset, H = ee.start;
9582
- const te = q.size;
9583
- if (q.offset < S) {
9584
- H += Math.floor((S - q.offset + j) / (te + j));
9623
+ const U = ee.value;
9624
+ let P = U.offset, H = ee.start;
9625
+ const te = U.size;
9626
+ if (U.offset < S) {
9627
+ H += Math.floor((S - U.offset + j) / (te + j));
9585
9628
  const ne = H - ee.start;
9586
9629
  P += ne * te + ne * j;
9587
9630
  }
@@ -9601,43 +9644,43 @@ const hr = tt(
9601
9644
  Ti
9602
9645
  );
9603
9646
  he(
9604
- U(
9647
+ V(
9605
9648
  e,
9606
9649
  Te(Fa),
9607
9650
  le((S) => S == null ? void 0 : S.length)
9608
9651
  ),
9609
9652
  o
9610
9653
  ), he(
9611
- U(
9654
+ V(
9612
9655
  w,
9613
9656
  le((S) => S.topListHeight)
9614
9657
  ),
9615
9658
  f
9616
9659
  ), he(f, a), he(
9617
- U(
9660
+ V(
9618
9661
  w,
9619
9662
  le((S) => [S.top, S.bottom])
9620
9663
  ),
9621
9664
  i
9622
9665
  ), he(
9623
- U(
9666
+ V(
9624
9667
  w,
9625
9668
  le((S) => S.items)
9626
9669
  ),
9627
9670
  g
9628
9671
  );
9629
9672
  const b = en(
9630
- U(
9673
+ V(
9631
9674
  w,
9632
9675
  Te(({ items: S }) => S.length > 0),
9633
- Le(o, e),
9676
+ $e(o, e),
9634
9677
  Te(([{ items: S }, k]) => S[S.length - 1].originalIndex === k - 1),
9635
9678
  le(([, S, k]) => [S - 1, k]),
9636
9679
  xt(oo),
9637
9680
  le(([S]) => S)
9638
9681
  )
9639
9682
  ), T = en(
9640
- U(
9683
+ V(
9641
9684
  w,
9642
9685
  An(200),
9643
9686
  Te(({ items: S, topItems: k }) => S.length > 0 && S[0].originalIndex === k.length),
@@ -9645,7 +9688,7 @@ const hr = tt(
9645
9688
  xt()
9646
9689
  )
9647
9690
  ), C = en(
9648
- U(
9691
+ V(
9649
9692
  w,
9650
9693
  Te(({ items: S }) => S.length > 0),
9651
9694
  le(({ items: S }) => {
@@ -9675,10 +9718,10 @@ const hr = tt(
9675
9718
  Ba
9676
9719
  ),
9677
9720
  { singleton: !0 }
9678
- ), Df = tt(
9721
+ ), Df = nt(
9679
9722
  ([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
9680
- const s = We(), i = Ht(
9681
- U(
9723
+ const s = Ve(), i = Ht(
9724
+ V(
9682
9725
  At(n, e, r, t, o),
9683
9726
  le(([a, l, c, d, f]) => a + l + c + d + f.offsetBottom + f.bottom)
9684
9727
  ),
@@ -9688,10 +9731,10 @@ const hr = tt(
9688
9731
  },
9689
9732
  yt(Wt, hr),
9690
9733
  { singleton: !0 }
9691
- ), B0 = tt(
9734
+ ), B0 = nt(
9692
9735
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
9693
9736
  const n = X(!1), r = Ht(
9694
- U(
9737
+ V(
9695
9738
  At(n, e, t),
9696
9739
  Te(([o]) => o),
9697
9740
  le(([, o, s]) => Math.max(0, o - s)),
@@ -9704,7 +9747,7 @@ const hr = tt(
9704
9747
  },
9705
9748
  yt(Wt, Df),
9706
9749
  { singleton: !0 }
9707
- ), Lf = tt(() => ({
9750
+ ), Lf = nt(() => ({
9708
9751
  context: X(null)
9709
9752
  })), H0 = ({
9710
9753
  itemBottom: e,
@@ -9712,18 +9755,18 @@ const hr = tt(
9712
9755
  locationParams: { align: n, behavior: r, ...o },
9713
9756
  viewportBottom: s,
9714
9757
  viewportTop: i
9715
- }) => t < i ? { ...o, align: n ?? "start", behavior: r } : e > s ? { ...o, align: n ?? "end", behavior: r } : null, Ff = tt(
9758
+ }) => t < i ? { ...o, align: n ?? "start", behavior: r } : e > s ? { ...o, align: n ?? "end", behavior: r } : null, Ff = nt(
9716
9759
  ([
9717
9760
  { gap: e, sizes: t, totalCount: n },
9718
9761
  { fixedFooterHeight: r, fixedHeaderHeight: o, headerHeight: s, scrollingInProgress: i, scrollTop: a, viewportHeight: l },
9719
9762
  { scrollToIndex: c }
9720
9763
  ]) => {
9721
- const d = We();
9764
+ const d = Ve();
9722
9765
  return he(
9723
- U(
9766
+ V(
9724
9767
  d,
9725
- Le(t, l, n, s, o, r, a),
9726
- Le(e),
9768
+ $e(t, l, n, s, o, r, a),
9769
+ $e(e),
9727
9770
  le(([[f, p, h, m, x, y, g, w], b]) => {
9728
9771
  const { align: T, behavior: C, calculateViewLocation: S = H0, done: k, ...N } = f, E = jf(f, p, m - 1), I = so(E, p.offsetTree, b) + x + y, O = I + gn(p.sizeTree, E)[1], L = w + y, F = w + h - g, j = S({
9729
9772
  itemBottom: O,
@@ -9733,7 +9776,7 @@ const hr = tt(
9733
9776
  viewportTop: L
9734
9777
  });
9735
9778
  return j ? k && pn(
9736
- U(
9779
+ V(
9737
9780
  i,
9738
9781
  Te(($) => !$),
9739
9782
  // skips the initial publish of false, and the cleanup call.
@@ -9756,7 +9799,7 @@ const hr = tt(
9756
9799
  function Cc(e) {
9757
9800
  return e ? e === "smooth" ? "smooth" : "auto" : !1;
9758
9801
  }
9759
- const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9802
+ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = nt(
9760
9803
  ([
9761
9804
  { listRefresh: e, totalCount: t, fixedItemSize: n, data: r },
9762
9805
  { atBottomState: o, isAtBottom: s },
@@ -9768,19 +9811,19 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9768
9811
  { context: p },
9769
9812
  { scrollIntoView: h }
9770
9813
  ]) => {
9771
- const m = X(!1), x = We();
9814
+ const m = X(!1), x = Ve();
9772
9815
  let y = null;
9773
9816
  function g(C) {
9774
- Oe(i, {
9817
+ Me(i, {
9775
9818
  align: "end",
9776
9819
  behavior: C,
9777
9820
  index: "LAST"
9778
9821
  });
9779
9822
  }
9780
- st(
9781
- U(
9782
- At(U(Se(t), ar(1)), l),
9783
- Le(Se(m), s, a, f),
9823
+ it(
9824
+ V(
9825
+ At(V(Se(t), ar(1)), l),
9826
+ $e(Se(m), s, a, f),
9784
9827
  le(([[C, S], k, N, E, I]) => {
9785
9828
  let O = S && E, L = "auto";
9786
9829
  return O && (L = U0(k, N || I), O = O && !!L), { followOutputBehavior: L, shouldFollow: O, totalCount: C };
@@ -9801,8 +9844,8 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9801
9844
  });
9802
9845
  setTimeout(S, 100);
9803
9846
  }
9804
- st(
9805
- U(
9847
+ it(
9848
+ V(
9806
9849
  At(Se(m), t, c),
9807
9850
  Te(([C, , S]) => C && S),
9808
9851
  Cn(
@@ -9810,42 +9853,42 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9810
9853
  { refreshed: !1, value: 0 }
9811
9854
  ),
9812
9855
  Te(({ refreshed: C }) => C),
9813
- Le(m, t)
9856
+ $e(m, t)
9814
9857
  ),
9815
9858
  ([, C]) => {
9816
9859
  Rt(a) && w(C !== !1);
9817
9860
  }
9818
- ), st(x, () => {
9861
+ ), it(x, () => {
9819
9862
  w(Rt(m) !== !1);
9820
- }), st(At(Se(m), o), ([C, S]) => {
9863
+ }), it(At(Se(m), o), ([C, S]) => {
9821
9864
  C && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
9822
9865
  });
9823
- const b = X(null), T = We();
9866
+ const b = X(null), T = Ve();
9824
9867
  return he(
9825
9868
  Yi(
9826
- U(
9869
+ V(
9827
9870
  Se(r),
9828
9871
  le((C) => {
9829
9872
  var S;
9830
9873
  return (S = C == null ? void 0 : C.length) != null ? S : 0;
9831
9874
  })
9832
9875
  ),
9833
- U(Se(t))
9876
+ V(Se(t))
9834
9877
  ),
9835
9878
  T
9836
- ), st(
9837
- U(
9838
- At(U(T, ar(1)), l),
9839
- Le(Se(b), a, f, p),
9879
+ ), it(
9880
+ V(
9881
+ At(V(T, ar(1)), l),
9882
+ $e(Se(b), a, f, p),
9840
9883
  le(([[C, S], k, N, E, I]) => S && N && (k == null ? void 0 : k({ context: I, totalCount: C, scrollingInProgress: E }))),
9841
9884
  Te((C) => !!C),
9842
9885
  An(0)
9843
9886
  ),
9844
9887
  (C) => {
9845
9888
  y && (y(), y = null), Rt(n) ? requestAnimationFrame(() => {
9846
- Rt(d)("scrolling into view", {}), Oe(h, C);
9889
+ Rt(d)("scrolling into view", {}), Me(h, C);
9847
9890
  }) : y = pn(e, () => {
9848
- Rt(d)("scrolling into view", {}), Oe(h, C), y = null;
9891
+ Rt(d)("scrolling into view", {}), Me(h, C), y = null;
9849
9892
  });
9850
9893
  }
9851
9894
  ), { autoscrollToBottom: x, followOutput: m, scrollIntoViewOnChange: b };
@@ -9861,39 +9904,39 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9861
9904
  Lf,
9862
9905
  Ff
9863
9906
  )
9864
- ), V0 = tt(
9907
+ ), V0 = nt(
9865
9908
  ([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (he(
9866
- U(
9909
+ V(
9867
9910
  a,
9868
- Le(s),
9911
+ $e(s),
9869
9912
  Te(([, l]) => l !== 0),
9870
- Le(o, r, t, n, e),
9913
+ $e(o, r, t, n, e),
9871
9914
  le(([[, l], c, d, f, p, h = []]) => Mf(l, c, d, f, p, h))
9872
9915
  ),
9873
9916
  i
9874
9917
  ), {}),
9875
9918
  yt(En, wo, hr, Gn),
9876
9919
  { singleton: !0 }
9877
- ), K0 = tt(
9920
+ ), K0 = nt(
9878
9921
  ([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
9879
9922
  const r = X(0);
9880
- return st(
9881
- U(
9923
+ return it(
9924
+ V(
9882
9925
  e,
9883
- Le(r),
9926
+ $e(r),
9884
9927
  Te(([, o]) => o !== 0),
9885
9928
  le(([, o]) => ({ top: o }))
9886
9929
  ),
9887
9930
  (o) => {
9888
9931
  pn(
9889
- U(
9932
+ V(
9890
9933
  n,
9891
9934
  ar(1),
9892
9935
  Te((s) => s.items.length > 1)
9893
9936
  ),
9894
9937
  () => {
9895
9938
  requestAnimationFrame(() => {
9896
- Oe(t, o);
9939
+ Me(t, o);
9897
9940
  });
9898
9941
  }
9899
9942
  );
@@ -9904,13 +9947,13 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9904
9947
  },
9905
9948
  yt(Gn, Wt, hr),
9906
9949
  { singleton: !0 }
9907
- ), $f = tt(
9950
+ ), $f = nt(
9908
9951
  ([{ scrollVelocity: e }]) => {
9909
- const t = X(!1), n = We(), r = X(!1);
9952
+ const t = X(!1), n = Ve(), r = X(!1);
9910
9953
  return he(
9911
- U(
9954
+ V(
9912
9955
  e,
9913
- Le(r, t, n),
9956
+ $e(r, t, n),
9914
9957
  Te(([o, s]) => !!s),
9915
9958
  le(([o, s, i, a]) => {
9916
9959
  const { enter: l, exit: c } = s;
@@ -9924,8 +9967,8 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9924
9967
  xt()
9925
9968
  ),
9926
9969
  t
9927
- ), st(
9928
- U(At(t, e, n), Le(r)),
9970
+ ), it(
9971
+ V(At(t, e, n), $e(r)),
9929
9972
  ([[o, s, i], a]) => {
9930
9973
  o && a && a.change && a.change(s, i);
9931
9974
  }
@@ -9933,10 +9976,10 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9933
9976
  },
9934
9977
  yt(bo),
9935
9978
  { singleton: !0 }
9936
- ), Ka = tt(([{ scrollContainerState: e, scrollTo: t }]) => {
9937
- const n = We(), r = We(), o = We(), s = X(!1), i = X(void 0);
9979
+ ), Ka = nt(([{ scrollContainerState: e, scrollTo: t }]) => {
9980
+ const n = Ve(), r = Ve(), o = Ve(), s = X(!1), i = X(void 0);
9938
9981
  return he(
9939
- U(
9982
+ V(
9940
9983
  At(n, r),
9941
9984
  le(([{ scrollHeight: a, scrollTop: l, viewportHeight: c }, { offsetTop: d }]) => ({
9942
9985
  scrollHeight: a,
@@ -9946,9 +9989,9 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9946
9989
  ),
9947
9990
  e
9948
9991
  ), he(
9949
- U(
9992
+ V(
9950
9993
  t,
9951
- Le(r),
9994
+ $e(r),
9952
9995
  le(([a, { offsetTop: l }]) => ({
9953
9996
  ...a,
9954
9997
  top: a.top + l
@@ -9965,7 +10008,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9965
10008
  windowScrollTo: o,
9966
10009
  windowViewportRect: r
9967
10010
  };
9968
- }, yt(Wt)), q0 = tt(
10011
+ }, yt(Wt)), q0 = nt(
9969
10012
  ([
9970
10013
  { sizeRanges: e, sizes: t },
9971
10014
  { headerHeight: n, scrollTop: r },
@@ -9973,20 +10016,20 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9973
10016
  { didMount: s },
9974
10017
  { useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
9975
10018
  ]) => {
9976
- const c = We(), d = X(void 0), f = X(null), p = X(null);
9977
- return he(a, f), he(l, p), st(
9978
- U(
10019
+ const c = Ve(), d = X(void 0), f = X(null), p = X(null);
10020
+ return he(a, f), he(l, p), it(
10021
+ V(
9979
10022
  c,
9980
- Le(t, r, i, f, p, n)
10023
+ $e(t, r, i, f, p, n)
9981
10024
  ),
9982
10025
  ([h, m, x, y, g, w, b]) => {
9983
10026
  const T = A0(m.sizeTree);
9984
10027
  y && g !== null && w !== null && (x = g.scrollTop - w.offsetTop), x -= b, h({ ranges: T, scrollTop: x });
9985
10028
  }
9986
- ), he(U(d, Te(Fa), le(G0)), o), he(
9987
- U(
10029
+ ), he(V(d, Te(Fa), le(G0)), o), he(
10030
+ V(
9988
10031
  s,
9989
- Le(d),
10032
+ $e(d),
9990
10033
  Te(([, h]) => h !== void 0),
9991
10034
  xt(),
9992
10035
  le(([, h]) => h.ranges)
@@ -10002,10 +10045,10 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
10002
10045
  function G0(e) {
10003
10046
  return { align: "start", index: 0, offset: e.scrollTop };
10004
10047
  }
10005
- const Y0 = tt(([{ topItemsIndexes: e }]) => {
10048
+ const Y0 = nt(([{ topItemsIndexes: e }]) => {
10006
10049
  const t = X(0);
10007
10050
  return he(
10008
- U(
10051
+ V(
10009
10052
  t,
10010
10053
  Te((n) => n >= 0),
10011
10054
  le((n) => Array.from({ length: n }).map((r, o) => o))
@@ -10017,7 +10060,7 @@ function zf(e) {
10017
10060
  let t = !1, n;
10018
10061
  return () => (t || (t = !0, n = e()), n);
10019
10062
  }
10020
- const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), J0 = tt(
10063
+ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), J0 = nt(
10021
10064
  ([
10022
10065
  { deviation: e, scrollBy: t, scrollingInProgress: n, scrollTop: r },
10023
10066
  { isAtBottom: o, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: a },
@@ -10027,9 +10070,9 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10027
10070
  { recalcInProgress: m }
10028
10071
  ]) => {
10029
10072
  const x = en(
10030
- U(
10073
+ V(
10031
10074
  l,
10032
- Le(i),
10075
+ $e(i),
10033
10076
  Cn(
10034
10077
  ([, g, w, b], [{ bottom: T, items: C, offsetBottom: S, totalCount: k }, N]) => {
10035
10078
  const E = T + S;
@@ -10039,18 +10082,18 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10039
10082
  [0, [], 0, 0]
10040
10083
  ),
10041
10084
  Te(([g]) => g !== 0),
10042
- Le(r, a, n, o, h, m),
10085
+ $e(r, a, n, o, h, m),
10043
10086
  Te(([, g, w, b, , , T]) => !T && !b && g !== 0 && w === io),
10044
10087
  le(([[g], , , , , w]) => (w("Upward scrolling compensation", { amount: g }, Xt.DEBUG), g))
10045
10088
  )
10046
10089
  );
10047
10090
  function y(g) {
10048
- g > 0 ? (Oe(t, { behavior: "auto", top: -g }), Oe(e, 0)) : (Oe(e, 0), Oe(t, { behavior: "auto", top: -g }));
10091
+ g > 0 ? (Me(t, { behavior: "auto", top: -g }), Me(e, 0)) : (Me(e, 0), Me(t, { behavior: "auto", top: -g }));
10049
10092
  }
10050
- return st(U(x, Le(e, s)), ([g, w, b]) => {
10051
- b && X0() ? Oe(e, w - g) : y(-g);
10052
- }), st(
10053
- U(
10093
+ return it(V(x, $e(e, s)), ([g, w, b]) => {
10094
+ b && X0() ? Me(e, w - g) : y(-g);
10095
+ }), it(
10096
+ V(
10054
10097
  At(Ht(s, !1), e, m),
10055
10098
  Te(([g, w, b]) => !g && !b && w !== 0),
10056
10099
  le(([g, w]) => w),
@@ -10058,15 +10101,15 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10058
10101
  ),
10059
10102
  y
10060
10103
  ), he(
10061
- U(
10104
+ V(
10062
10105
  f,
10063
10106
  le((g) => ({ top: -g }))
10064
10107
  ),
10065
10108
  t
10066
- ), st(
10067
- U(
10109
+ ), it(
10110
+ V(
10068
10111
  c,
10069
- Le(p, d),
10112
+ $e(p, d),
10070
10113
  le(([g, { groupIndices: w, lastSize: b, sizeTree: T }, C]) => {
10071
10114
  function S(k) {
10072
10115
  return k * (b + C);
@@ -10087,16 +10130,16 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10087
10130
  })
10088
10131
  ),
10089
10132
  (g) => {
10090
- Oe(e, g), requestAnimationFrame(() => {
10091
- Oe(t, { top: g }), requestAnimationFrame(() => {
10092
- Oe(e, 0), Oe(m, !1);
10133
+ Me(e, g), requestAnimationFrame(() => {
10134
+ Me(t, { top: g }), requestAnimationFrame(() => {
10135
+ Me(e, 0), Me(m, !1);
10093
10136
  });
10094
10137
  });
10095
10138
  }
10096
10139
  ), { deviation: e };
10097
10140
  },
10098
10141
  yt(Wt, bo, hr, En, qn, Ba)
10099
- ), Z0 = tt(
10142
+ ), Z0 = nt(
10100
10143
  ([
10101
10144
  e,
10102
10145
  t,
@@ -10135,7 +10178,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10135
10178
  qn,
10136
10179
  Lf
10137
10180
  )
10138
- ), Bf = tt(
10181
+ ), Bf = nt(
10139
10182
  ([
10140
10183
  {
10141
10184
  data: e,
@@ -10162,7 +10205,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10162
10205
  { groupCounts: N },
10163
10206
  E
10164
10207
  ]) => (he(T.rangeChanged, E.scrollSeekRangeChanged), he(
10165
- U(
10208
+ V(
10166
10209
  E.windowViewportRect,
10167
10210
  le((I) => I.visibleHeight)
10168
10211
  ),
@@ -10226,22 +10269,22 @@ const _o = typeof document < "u" ? z.useLayoutEffect : z.useEffect;
10226
10269
  function Hf(e, t, n) {
10227
10270
  const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = z.createContext({});
10228
10271
  function l(y, g) {
10229
- y.propsReady && Oe(y.propsReady, !1);
10272
+ y.propsReady && Me(y.propsReady, !1);
10230
10273
  for (const w of r) {
10231
10274
  const b = y[t.required[w]];
10232
- Oe(b, g[w]);
10275
+ Me(b, g[w]);
10233
10276
  }
10234
10277
  for (const w of o)
10235
10278
  if (w in g) {
10236
10279
  const b = y[t.optional[w]];
10237
- Oe(b, g[w]);
10280
+ Me(b, g[w]);
10238
10281
  }
10239
- y.propsReady && Oe(y.propsReady, !0);
10282
+ y.propsReady && Me(y.propsReady, !0);
10240
10283
  }
10241
10284
  function c(y) {
10242
10285
  return s.reduce((g, w) => (g[w] = (b) => {
10243
10286
  const T = y[t.methods[w]];
10244
- Oe(T, b);
10287
+ Me(T, b);
10245
10288
  }, g), {});
10246
10289
  }
10247
10290
  function d(y) {
@@ -10253,7 +10296,7 @@ function Hf(e, t, n) {
10253
10296
  })), [C] = z.useState(hc(d, T));
10254
10297
  _o(() => {
10255
10298
  for (const k of i)
10256
- k in b && st(C[k], b[k]);
10299
+ k in b && it(C[k], b[k]);
10257
10300
  return () => {
10258
10301
  Object.values(C).map($a);
10259
10302
  };
@@ -10266,13 +10309,13 @@ function Hf(e, t, n) {
10266
10309
  const g = z.useContext(a);
10267
10310
  return z.useCallback(
10268
10311
  (w) => {
10269
- Oe(g[y], w);
10312
+ Me(g[y], w);
10270
10313
  },
10271
10314
  [g, y]
10272
10315
  );
10273
10316
  }, h = (y) => {
10274
10317
  const g = z.useContext(a)[y], w = z.useCallback(
10275
- (b) => st(g, b),
10318
+ (b) => it(g, b),
10276
10319
  [g]
10277
10320
  );
10278
10321
  return z.useSyncExternalStore(
@@ -10283,7 +10326,7 @@ function Hf(e, t, n) {
10283
10326
  }, m = (y) => {
10284
10327
  const g = z.useContext(a)[y], [w, b] = z.useState(hc(Rt, g));
10285
10328
  return _o(
10286
- () => st(g, (T) => {
10329
+ () => it(g, (T) => {
10287
10330
  T !== w && b(pc(T));
10288
10331
  }),
10289
10332
  [g, w]
@@ -10293,7 +10336,7 @@ function Hf(e, t, n) {
10293
10336
  Component: f,
10294
10337
  useEmitter: (y, g) => {
10295
10338
  const w = z.useContext(a)[y];
10296
- _o(() => st(w, g), [g, w]);
10339
+ _o(() => it(w, g), [g, w]);
10297
10340
  },
10298
10341
  useEmitterValue: x,
10299
10342
  usePublisher: p
@@ -10366,9 +10409,9 @@ const Ri = "-webkit-sticky", Tc = "sticky", qa = zf(() => {
10366
10409
  function Ga(e) {
10367
10410
  return e;
10368
10411
  }
10369
- const tS = /* @__PURE__ */ tt(() => {
10412
+ const tS = /* @__PURE__ */ nt(() => {
10370
10413
  const e = X((a) => `Item ${a}`), t = X((a) => `Group ${a}`), n = X({}), r = X(Ga), o = X("div"), s = X(Or), i = (a, l = null) => Ht(
10371
- U(
10414
+ V(
10372
10415
  n,
10373
10416
  le((c) => c[a]),
10374
10417
  xt()
@@ -10392,7 +10435,7 @@ const tS = /* @__PURE__ */ tt(() => {
10392
10435
  ScrollSeekPlaceholder: i("ScrollSeekPlaceholder"),
10393
10436
  TopItemListComponent: i("TopItemList")
10394
10437
  };
10395
- }), nS = /* @__PURE__ */ tt(
10438
+ }), nS = /* @__PURE__ */ nt(
10396
10439
  ([e, t]) => ({ ...e, ...t }),
10397
10440
  yt(Bf, tS)
10398
10441
  ), rS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), oS = { overflowAnchor: "none", position: qa(), zIndex: 1 }, qf = { overflowAnchor: "none" }, sS = { ...qf, display: "inline-block", height: "100%" }, kc = /* @__PURE__ */ z.memo(function({ showTopList: e = !1 }) {
@@ -10673,7 +10716,7 @@ const fS = ({ children: e }) => {
10673
10716
  }
10674
10717
  },
10675
10718
  mS
10676
- ), xS = /* @__PURE__ */ Gf({ useEmitter: Ya, useEmitterValue: Ie, usePublisher: on }), yS = /* @__PURE__ */ Yf({ useEmitter: Ya, useEmitterValue: Ie, usePublisher: on }), vS = gS, wS = /* @__PURE__ */ tt(() => {
10719
+ ), xS = /* @__PURE__ */ Gf({ useEmitter: Ya, useEmitterValue: Ie, usePublisher: on }), yS = /* @__PURE__ */ Yf({ useEmitter: Ya, useEmitterValue: Ie, usePublisher: on }), vS = gS, wS = /* @__PURE__ */ nt(() => {
10677
10720
  const e = X((c) => /* @__PURE__ */ u.jsxs("td", { children: [
10678
10721
  "Item $",
10679
10722
  c
@@ -10681,7 +10724,7 @@ const fS = ({ children: e }) => {
10681
10724
  "Group ",
10682
10725
  c
10683
10726
  ] })), r = X(null), o = X(null), s = X({}), i = X(Ga), a = X(Or), l = (c, d = null) => Ht(
10684
- U(
10727
+ V(
10685
10728
  s,
10686
10729
  le((f) => f[c]),
10687
10730
  xt()
@@ -10743,7 +10786,7 @@ function Po(e, t) {
10743
10786
  function CS(e, t) {
10744
10787
  return e && e.column === t.column && e.row === t.row;
10745
10788
  }
10746
- const TS = /* @__PURE__ */ tt(
10789
+ const TS = /* @__PURE__ */ nt(
10747
10790
  ([
10748
10791
  { increaseViewportBy: e, listBoundary: t, overscan: n, visibleRange: r },
10749
10792
  { footerHeight: o, headerHeight: s, scrollBy: i, scrollContainerState: a, scrollTo: l, scrollTop: c, smoothScrollTargetReached: d, viewportHeight: f },
@@ -10753,54 +10796,54 @@ const TS = /* @__PURE__ */ tt(
10753
10796
  { customScrollParent: y, useWindowScroll: g, windowScrollContainerState: w, windowScrollTo: b, windowViewportRect: T },
10754
10797
  C
10755
10798
  ]) => {
10756
- const S = X(0), k = X(0), N = X(Rc), E = X({ height: 0, width: 0 }), I = X({ height: 0, width: 0 }), O = We(), L = We(), F = X(0), j = X(null), $ = X({ column: 0, row: 0 }), A = We(), B = We(), D = X(!1), M = X(0), Z = X(!0), J = X(!1), pe = X(!1);
10757
- st(
10758
- U(
10799
+ const S = X(0), k = X(0), N = X(Rc), E = X({ height: 0, width: 0 }), I = X({ height: 0, width: 0 }), O = Ve(), L = Ve(), F = X(0), j = X(null), $ = X({ column: 0, row: 0 }), A = Ve(), B = Ve(), D = X(!1), M = X(0), Z = X(!0), J = X(!1), pe = X(!1);
10800
+ it(
10801
+ V(
10759
10802
  m,
10760
- Le(M),
10803
+ $e(M),
10761
10804
  Te(([P, H]) => !!H)
10762
10805
  ),
10763
10806
  () => {
10764
- Oe(Z, !1);
10807
+ Me(Z, !1);
10765
10808
  }
10766
- ), st(
10767
- U(
10809
+ ), it(
10810
+ V(
10768
10811
  At(m, Z, I, E, M, J),
10769
10812
  Te(([P, H, te, se, , ne]) => P && !H && te.height !== 0 && se.height !== 0 && !ne)
10770
10813
  ),
10771
10814
  ([, , , , P]) => {
10772
- Oe(J, !0), Ua(1, () => {
10773
- Oe(O, P);
10774
- }), pn(U(c), () => {
10775
- Oe(t, [0, 0]), Oe(Z, !0);
10815
+ Me(J, !0), Ua(1, () => {
10816
+ Me(O, P);
10817
+ }), pn(V(c), () => {
10818
+ Me(t, [0, 0]), Me(Z, !0);
10776
10819
  });
10777
10820
  }
10778
10821
  ), he(
10779
- U(
10822
+ V(
10780
10823
  B,
10781
10824
  Te((P) => P != null && P.scrollTop > 0),
10782
10825
  wn(0)
10783
10826
  ),
10784
10827
  k
10785
- ), st(
10786
- U(
10828
+ ), it(
10829
+ V(
10787
10830
  m,
10788
- Le(B),
10831
+ $e(B),
10789
10832
  Te(([, P]) => P != null)
10790
10833
  ),
10791
10834
  ([, P]) => {
10792
- P && (Oe(E, P.viewport), Oe(I, P.item), Oe($, P.gap), P.scrollTop > 0 && (Oe(D, !0), pn(U(c, ar(1)), (H) => {
10793
- Oe(D, !1);
10794
- }), Oe(l, { top: P.scrollTop })));
10835
+ P && (Me(E, P.viewport), Me(I, P.item), Me($, P.gap), P.scrollTop > 0 && (Me(D, !0), pn(V(c, ar(1)), (H) => {
10836
+ Me(D, !1);
10837
+ }), Me(l, { top: P.scrollTop })));
10795
10838
  }
10796
10839
  ), he(
10797
- U(
10840
+ V(
10798
10841
  E,
10799
10842
  le(({ height: P }) => P)
10800
10843
  ),
10801
10844
  f
10802
10845
  ), he(
10803
- U(
10846
+ V(
10804
10847
  At(
10805
10848
  Se(E, Po),
10806
10849
  Se(I, Po),
@@ -10816,7 +10859,7 @@ const TS = /* @__PURE__ */ tt(
10816
10859
  ),
10817
10860
  A
10818
10861
  ), he(
10819
- U(
10862
+ V(
10820
10863
  At(
10821
10864
  Se(S),
10822
10865
  r,
@@ -10836,43 +10879,43 @@ const TS = /* @__PURE__ */ tt(
10836
10879
  [H, te],
10837
10880
  se,
10838
10881
  ne,
10839
- Me,
10882
+ Le,
10840
10883
  Y,
10841
10884
  de,
10842
10885
  ,
10843
10886
  ke,
10844
10887
  Ne
10845
10888
  ]) => {
10846
- const { column: ze, row: Be } = se, { height: Ue, width: Ke } = ne, { width: qe } = Me;
10847
- if (de === 0 && (P === 0 || qe === 0))
10889
+ const { column: Be, row: He } = se, { height: We, width: qe } = ne, { width: Ge } = Le;
10890
+ if (de === 0 && (P === 0 || Ge === 0))
10848
10891
  return Rc;
10849
- if (Ke === 0) {
10850
- const re = Wa(Ne, P), Qe = re + Math.max(de - 1, 0);
10851
- return SS(Nc(re, Qe, Y));
10892
+ if (qe === 0) {
10893
+ const re = Wa(Ne, P), Ye = re + Math.max(de - 1, 0);
10894
+ return SS(Nc(re, Ye, Y));
10852
10895
  }
10853
- const Ze = Xf(qe, Ke, ze);
10854
- let Xe, rt;
10855
- ke ? H === 0 && te === 0 && de > 0 ? (Xe = 0, rt = de - 1) : (Xe = Ze * as((H + Be) / (Ue + Be)), rt = Ze * Ec((te + Be) / (Ue + Be)) - 1, rt = Ei(P - 1, Kr(rt, Ze - 1)), Xe = Ei(rt, Kr(0, Xe))) : (Xe = 0, rt = -1);
10856
- const St = Nc(Xe, rt, Y), { bottom: mt, top: lt } = Ac(Me, se, ne, St), Ct = Ec(P / Ze), ce = Ct * Ue + (Ct - 1) * Be - mt;
10857
- return { bottom: mt, itemHeight: Ue, items: St, itemWidth: Ke, offsetBottom: ce, offsetTop: lt, top: lt };
10896
+ const tt = Xf(Ge, qe, Be);
10897
+ let Qe, ot;
10898
+ ke ? H === 0 && te === 0 && de > 0 ? (Qe = 0, ot = de - 1) : (Qe = tt * as((H + He) / (We + He)), ot = tt * Ec((te + He) / (We + He)) - 1, ot = Ei(P - 1, Kr(ot, tt - 1)), Qe = Ei(ot, Kr(0, Qe))) : (Qe = 0, ot = -1);
10899
+ const St = Nc(Qe, ot, Y), { bottom: mt, top: ct } = Ac(Le, se, ne, St), Ct = Ec(P / tt), ce = Ct * We + (Ct - 1) * He - mt;
10900
+ return { bottom: mt, itemHeight: We, items: St, itemWidth: qe, offsetBottom: ce, offsetTop: ct, top: ct };
10858
10901
  }
10859
10902
  )
10860
10903
  ),
10861
10904
  N
10862
10905
  ), he(
10863
- U(
10906
+ V(
10864
10907
  j,
10865
10908
  Te((P) => P !== null),
10866
10909
  le((P) => P.length)
10867
10910
  ),
10868
10911
  S
10869
10912
  ), he(
10870
- U(
10913
+ V(
10871
10914
  At(E, I, N, $),
10872
10915
  Te(([P, H, { items: te }]) => te.length > 0 && H.height !== 0 && P.height !== 0),
10873
10916
  le(([P, H, { items: te }, se]) => {
10874
- const { bottom: ne, top: Me } = Ac(P, se, H, te);
10875
- return [Me, ne];
10917
+ const { bottom: ne, top: Le } = Ac(P, se, H, te);
10918
+ return [Le, ne];
10876
10919
  }),
10877
10920
  xt(oo)
10878
10921
  ),
@@ -10880,18 +10923,18 @@ const TS = /* @__PURE__ */ tt(
10880
10923
  );
10881
10924
  const Re = X(!1);
10882
10925
  he(
10883
- U(
10926
+ V(
10884
10927
  c,
10885
- Le(Re),
10928
+ $e(Re),
10886
10929
  le(([P, H]) => H || P !== 0)
10887
10930
  ),
10888
10931
  Re
10889
10932
  );
10890
10933
  const Ee = en(
10891
- U(
10934
+ V(
10892
10935
  At(N, S),
10893
10936
  Te(([{ items: P }]) => P.length > 0),
10894
- Le(Re),
10937
+ $e(Re),
10895
10938
  Te(([[P, H], te]) => {
10896
10939
  const se = P.items[P.items.length - 1].index === H - 1;
10897
10940
  return (te || P.bottom > 0 && P.itemHeight > 0 && P.offsetBottom === 0 && P.items.length === H) && se;
@@ -10900,16 +10943,16 @@ const TS = /* @__PURE__ */ tt(
10900
10943
  xt()
10901
10944
  )
10902
10945
  ), W = en(
10903
- U(
10946
+ V(
10904
10947
  Se(N),
10905
10948
  Te(({ items: P }) => P.length > 0 && P[0].index === 0),
10906
10949
  wn(0),
10907
10950
  xt()
10908
10951
  )
10909
10952
  ), ee = en(
10910
- U(
10953
+ V(
10911
10954
  Se(N),
10912
- Le(D),
10955
+ $e(D),
10913
10956
  Te(([{ items: P }, H]) => P.length > 0 && !H),
10914
10957
  le(([{ items: P }]) => ({
10915
10958
  endIndex: P[P.length - 1].index,
@@ -10920,28 +10963,28 @@ const TS = /* @__PURE__ */ tt(
10920
10963
  )
10921
10964
  );
10922
10965
  he(ee, h.scrollSeekRangeChanged), he(
10923
- U(
10966
+ V(
10924
10967
  O,
10925
- Le(E, I, S, $),
10968
+ $e(E, I, S, $),
10926
10969
  le(([P, H, te, se, ne]) => {
10927
- const Me = Pf(P), { align: Y, behavior: de, offset: ke } = Me;
10928
- let Ne = Me.index;
10970
+ const Le = Pf(P), { align: Y, behavior: de, offset: ke } = Le;
10971
+ let Ne = Le.index;
10929
10972
  Ne === "LAST" && (Ne = se - 1), Ne = Kr(0, Ne, Ei(se - 1, Ne));
10930
- let ze = ea(H, ne, te, Ne);
10931
- return Y === "end" ? ze = Ic(ze - H.height + te.height) : Y === "center" && (ze = Ic(ze - H.height / 2 + te.height / 2)), ke && (ze += ke), { behavior: de, top: ze };
10973
+ let Be = ea(H, ne, te, Ne);
10974
+ return Y === "end" ? Be = Ic(Be - H.height + te.height) : Y === "center" && (Be = Ic(Be - H.height / 2 + te.height / 2)), ke && (Be += ke), { behavior: de, top: Be };
10932
10975
  })
10933
10976
  ),
10934
10977
  l
10935
10978
  );
10936
- const q = Ht(
10937
- U(
10979
+ const U = Ht(
10980
+ V(
10938
10981
  N,
10939
10982
  le((P) => P.offsetBottom + P.bottom)
10940
10983
  ),
10941
10984
  0
10942
10985
  );
10943
10986
  return he(
10944
- U(
10987
+ V(
10945
10988
  T,
10946
10989
  le((P) => ({ height: P.visibleHeight, width: P.visibleWidth }))
10947
10990
  ),
@@ -10977,7 +11020,7 @@ const TS = /* @__PURE__ */ tt(
10977
11020
  gridState: N,
10978
11021
  horizontalDirection: pe,
10979
11022
  initialTopMostItemIndex: M,
10980
- totalListHeight: q,
11023
+ totalListHeight: U,
10981
11024
  ...p,
10982
11025
  endReached: Ee,
10983
11026
  propsReady: x,
@@ -11004,9 +11047,9 @@ function ea(e, t, n, r) {
11004
11047
  const o = Xf(e.width, n.width, t.column), s = as(r / o), i = s * n.height + Kr(0, s - 1) * t.row;
11005
11048
  return i > 0 ? i + t.row : i;
11006
11049
  }
11007
- const kS = /* @__PURE__ */ tt(() => {
11050
+ const kS = /* @__PURE__ */ nt(() => {
11008
11051
  const e = X((f) => `Item ${f}`), t = X({}), n = X(null), r = X("virtuoso-grid-item"), o = X("virtuoso-grid-list"), s = X(Ga), i = X("div"), a = X(Or), l = (f, p = null) => Ht(
11009
- U(
11052
+ V(
11010
11053
  t,
11011
11054
  le((h) => h[f]),
11012
11055
  xt()
@@ -11031,7 +11074,7 @@ const kS = /* @__PURE__ */ tt(() => {
11031
11074
  scrollerRef: a,
11032
11075
  ScrollSeekPlaceholder: l("ScrollSeekPlaceholder", "div")
11033
11076
  };
11034
- }), RS = /* @__PURE__ */ tt(
11077
+ }), RS = /* @__PURE__ */ nt(
11035
11078
  ([e, t]) => ({ ...e, ...t }),
11036
11079
  yt(TS, kS)
11037
11080
  ), ES = /* @__PURE__ */ z.memo(function() {
@@ -11502,7 +11545,7 @@ var Vs = "Dialog", [rp, xk] = Mn(Vs), [VS, yn] = rp(Vs), op = (e) => {
11502
11545
  op.displayName = Vs;
11503
11546
  var sp = "DialogTrigger", ip = v.forwardRef(
11504
11547
  (e, t) => {
11505
- const { __scopeDialog: n, ...r } = e, o = yn(sp, n), s = Ve(t, o.triggerRef);
11548
+ const { __scopeDialog: n, ...r } = e, o = yn(sp, n), s = Ke(t, o.triggerRef);
11506
11549
  return /* @__PURE__ */ u.jsx(
11507
11550
  Ae.button,
11508
11551
  {
@@ -11559,7 +11602,7 @@ var qS = Tr("DialogOverlay.RemoveScroll"), GS = v.forwardRef(
11559
11602
  up.displayName = lr;
11560
11603
  var YS = v.forwardRef(
11561
11604
  (e, t) => {
11562
- const n = yn(lr, e.__scopeDialog), r = v.useRef(null), o = Ve(t, n.contentRef, r);
11605
+ const n = yn(lr, e.__scopeDialog), r = v.useRef(null), o = Ke(t, n.contentRef, r);
11563
11606
  return v.useEffect(() => {
11564
11607
  const s = r.current;
11565
11608
  if (s) return Aa(s);
@@ -11610,7 +11653,7 @@ var YS = v.forwardRef(
11610
11653
  }
11611
11654
  ), dp = v.forwardRef(
11612
11655
  (e, t) => {
11613
- const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = yn(lr, n), l = v.useRef(null), c = Ve(t, l);
11656
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = yn(lr, n), l = v.useRef(null), c = Ke(t, l);
11614
11657
  return ba(), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
11615
11658
  /* @__PURE__ */ u.jsx(
11616
11659
  Is,
@@ -11819,7 +11862,7 @@ function oC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
11819
11862
  ] }) : c ? /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
11820
11863
  /* @__PURE__ */ u.jsx("div", { className: "text-red-500 mb-4", children: "⚠️" }),
11821
11864
  /* @__PURE__ */ u.jsx("p", { className: "text-red-600 mb-4", children: c }),
11822
- /* @__PURE__ */ u.jsx(ot, { onClick: p, variant: "outline", children: "Try Again" })
11865
+ /* @__PURE__ */ u.jsx(st, { onClick: p, variant: "outline", children: "Try Again" })
11823
11866
  ] }) : a ? o.startsWith("image/") ? /* @__PURE__ */ u.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ u.jsx(
11824
11867
  "img",
11825
11868
  {
@@ -11859,7 +11902,7 @@ function oC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
11859
11902
  ] }),
11860
11903
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
11861
11904
  /* @__PURE__ */ u.jsxs(
11862
- ot,
11905
+ st,
11863
11906
  {
11864
11907
  variant: "outline",
11865
11908
  size: "sm",
@@ -11872,7 +11915,7 @@ function oC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
11872
11915
  }
11873
11916
  ),
11874
11917
  /* @__PURE__ */ u.jsxs(
11875
- ot,
11918
+ st,
11876
11919
  {
11877
11920
  variant: "outline",
11878
11921
  size: "sm",
@@ -13444,7 +13487,7 @@ function fs({
13444
13487
  allowHtml: n = !1,
13445
13488
  style: r
13446
13489
  }) {
13447
- const o = at(() => {
13490
+ const o = lt(() => {
13448
13491
  try {
13449
13492
  if (!n) {
13450
13493
  const i = e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, "").replace(/javascript:/gi, "").replace(/on\w+\s*=/gi, "");
@@ -13454,7 +13497,7 @@ function fs({
13454
13497
  } catch (i) {
13455
13498
  return console.error("[MarkdownContent] parse error", i), `<pre class="font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words">Error rendering markdown: ${String(i)}</pre>`;
13456
13499
  }
13457
- }, [e, n]), s = at(() => {
13500
+ }, [e, n]), s = lt(() => {
13458
13501
  const i = {
13459
13502
  color: "currentColor",
13460
13503
  ...r
@@ -13599,11 +13642,11 @@ const Bc = z.memo(function({
13599
13642
  defaultCheckpointId: N = null,
13600
13643
  messageParentCheckpointId: E = null
13601
13644
  }) {
13602
- const [I, O] = ge(!1), [L, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), D = l === "phone" || l === "half-screen", M = t.role, Z = M === "tool", J = at(() => "type" in t && t.type === "default_message" ? t : null, [t]), pe = !!J, Re = !(r && M !== "user"), {
13645
+ const [I, O] = ge(!1), [L, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), D = l === "phone" || l === "half-screen", M = t.role, Z = M === "tool", J = lt(() => "type" in t && t.type === "default_message" ? t : null, [t]), pe = !!J, Re = !(r && M !== "user"), {
13603
13646
  uploadingFiles: Ee,
13604
13647
  handleFileClick: W,
13605
13648
  fileViewerOpen: ee,
13606
- currentFileInfo: q,
13649
+ currentFileInfo: U,
13607
13650
  closeFileViewer: P
13608
13651
  } = IC({ allowFileOpen: Re, currentThreadId: A }), H = z.useMemo(() => {
13609
13652
  switch (M) {
@@ -13618,17 +13661,17 @@ const Bc = z.memo(function({
13618
13661
  default:
13619
13662
  return "text-[hsl(var(--chat-bubble-ai-text))]";
13620
13663
  }
13621
- }, [M]), te = at(() => J ? "" : CC(t.content), [J, t]), se = at(() => J ? {} : Pp(t), [J, t]), ne = at(
13622
- () => J ? [] : t.content.filter((V) => V.type === "image_url"),
13664
+ }, [M]), te = lt(() => J ? "" : CC(t.content), [J, t]), se = lt(() => J ? {} : Pp(t), [J, t]), ne = lt(
13665
+ () => J ? [] : t.content.filter((K) => K.type === "image_url"),
13623
13666
  [J, t]
13624
- ), Me = at(
13625
- () => J ? [] : t.content.filter((V) => V.type === "file"),
13667
+ ), Le = lt(
13668
+ () => J ? [] : t.content.filter((K) => K.type === "file"),
13626
13669
  [J, t]
13627
- ), Y = at(
13628
- () => J ? [] : t.content.filter((V) => V.type === "interrupt"),
13670
+ ), Y = lt(
13671
+ () => J ? [] : t.content.filter((K) => K.type === "interrupt"),
13629
13672
  [J, t]
13630
- ), de = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), ke = Mo(de), Ne = g == null ? void 0 : g.value, ze = at(() => J ? "" : TC(t.content), [J, t]), Be = z.useCallback(async () => {
13631
- const V = Z ? ze : te;
13673
+ ), de = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), ke = Mo(de), Ne = g == null ? void 0 : g.value, Be = lt(() => J ? "" : TC(t.content), [J, t]), He = z.useCallback(async () => {
13674
+ const K = Z ? Be : te;
13632
13675
  async function ve(xe) {
13633
13676
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
13634
13677
  await navigator.clipboard.writeText(xe);
@@ -13646,20 +13689,20 @@ const Bc = z.memo(function({
13646
13689
  throw new Error("Clipboard API not supported in this context.");
13647
13690
  }
13648
13691
  try {
13649
- await ve(V), O(!0), setTimeout(() => O(!1), 2e3), y == null || y(V);
13692
+ await ve(K), O(!0), setTimeout(() => O(!1), 2e3), y == null || y(K);
13650
13693
  } catch (xe) {
13651
13694
  console.error("Failed to copy:", xe);
13652
13695
  }
13653
- }, [Z, ze, te, y]), Ue = z.useCallback(() => {
13696
+ }, [Z, Be, te, y]), We = z.useCallback(() => {
13654
13697
  if (!h) return;
13655
- const V = Z ? ze : te, ve = "type" in t && t.type === "default_message" ? void 0 : {
13698
+ const K = Z ? Be : te, ve = "type" in t && t.type === "default_message" ? void 0 : {
13656
13699
  checkpointId: t.checkpointId ?? null,
13657
13700
  checkpointNs: t.checkpointNs ?? null
13658
13701
  };
13659
- h(t.id, V, ve);
13660
- }, [h, t.id, Z, ze, te, t]), Ke = z.useCallback(() => {
13702
+ h(t.id, K, ve);
13703
+ }, [h, t.id, Z, Be, te, t]), qe = z.useCallback(() => {
13661
13704
  m == null || m(n);
13662
- }, [m, n]), qe = z.useCallback(() => {
13705
+ }, [m, n]), Ge = z.useCallback(() => {
13663
13706
  const ve = Q(D ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", H);
13664
13707
  switch (M) {
13665
13708
  case "user":
@@ -13671,26 +13714,26 @@ const Bc = z.memo(function({
13671
13714
  default:
13672
13715
  return /* @__PURE__ */ u.jsx(si, { className: ve });
13673
13716
  }
13674
- }, [D, H, M]), Ze = z.useCallback(() => {
13675
- const V = "group relative mb-4 flex w-full";
13717
+ }, [D, H, M]), tt = z.useCallback(() => {
13718
+ const K = "group relative mb-4 flex w-full";
13676
13719
  switch (M) {
13677
13720
  case "user":
13678
- return Q(V, "justify-end");
13721
+ return Q(K, "justify-end");
13679
13722
  case "assistant":
13680
13723
  case "tool":
13681
13724
  case "system":
13682
- return Q(V, "justify-start");
13725
+ return Q(K, "justify-start");
13683
13726
  default:
13684
- return V;
13727
+ return K;
13685
13728
  }
13686
- }, [M]), Xe = z.useCallback(() => {
13687
- const V = Q(
13729
+ }, [M]), Qe = z.useCallback(() => {
13730
+ const K = Q(
13688
13731
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
13689
13732
  D && "px-3 py-2 text-sm"
13690
13733
  );
13691
13734
  if (pe)
13692
13735
  return Q(
13693
- V,
13736
+ K,
13694
13737
  "w-full",
13695
13738
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
13696
13739
  "border border-border/60 dark:border-border/40 shadow-sm"
@@ -13698,25 +13741,25 @@ const Bc = z.memo(function({
13698
13741
  switch (M) {
13699
13742
  case "user":
13700
13743
  return Q(
13701
- V,
13744
+ K,
13702
13745
  "w-full md:max-w-[95%]",
13703
13746
  "bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
13704
13747
  "border border-transparent"
13705
13748
  );
13706
13749
  case "assistant":
13707
13750
  return Q(
13708
- V,
13751
+ K,
13709
13752
  "w-full md:max-w-[95%]",
13710
13753
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
13711
13754
  "border border-border/60 dark:border-border/40"
13712
13755
  );
13713
13756
  case "tool":
13714
- return Q(V, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
13757
+ return Q(K, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
13715
13758
  case "system":
13716
- return Q(V, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
13759
+ return Q(K, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
13717
13760
  default:
13718
13761
  return Q(
13719
- V,
13762
+ K,
13720
13763
  "w-full md:max-w-[95%]",
13721
13764
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
13722
13765
  "border border-border/60 dark:border-border/40"
@@ -13724,7 +13767,7 @@ const Bc = z.memo(function({
13724
13767
  }
13725
13768
  }, [D, pe, M]);
13726
13769
  if (pe && J)
13727
- return /* @__PURE__ */ u.jsx("div", { className: Q(Ze(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Xe(), p.content), children: [
13770
+ return /* @__PURE__ */ u.jsx("div", { className: Q(tt(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Qe(), p.content), children: [
13728
13771
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
13729
13772
  /* @__PURE__ */ u.jsx(si, { className: Q("h-4 w-4", H) }),
13730
13773
  a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
@@ -13737,14 +13780,14 @@ const Bc = z.memo(function({
13737
13780
  }
13738
13781
  )
13739
13782
  ] }) });
13740
- const rt = z.useCallback(async (V) => {
13783
+ const ot = z.useCallback(async (K) => {
13741
13784
  if (w)
13742
13785
  return;
13743
13786
  const ve = Mo(
13744
- (V == null ? void 0 : V.id) ?? (V == null ? void 0 : V.interrupt_id)
13787
+ (K == null ? void 0 : K.id) ?? (K == null ? void 0 : K.interrupt_id)
13745
13788
  );
13746
13789
  if (!ve) {
13747
- console.warn("Interrupt part missing id", V);
13790
+ console.warn("Interrupt part missing id", K);
13748
13791
  return;
13749
13792
  }
13750
13793
  try {
@@ -13754,14 +13797,14 @@ const Bc = z.memo(function({
13754
13797
  } finally {
13755
13798
  T == null || T();
13756
13799
  }
13757
- }, [w, T, b, B]), St = z.useCallback(async (V) => {
13800
+ }, [w, T, b, B]), St = z.useCallback(async (K) => {
13758
13801
  if (w)
13759
13802
  return;
13760
13803
  const ve = Mo(
13761
- (V == null ? void 0 : V.id) ?? (V == null ? void 0 : V.interrupt_id)
13804
+ (K == null ? void 0 : K.id) ?? (K == null ? void 0 : K.interrupt_id)
13762
13805
  );
13763
13806
  if (!ve) {
13764
- console.warn("Interrupt part missing id", V);
13807
+ console.warn("Interrupt part missing id", K);
13765
13808
  return;
13766
13809
  }
13767
13810
  try {
@@ -13771,9 +13814,9 @@ const Bc = z.memo(function({
13771
13814
  } finally {
13772
13815
  T == null || T();
13773
13816
  }
13774
- }, [w, T, b, B]), mt = z.useCallback(({ part: V, i: ve }) => {
13775
- if (V.type === "text") {
13776
- const xe = V.text ?? "", ht = xe.trim(), gt = Ja(ht);
13817
+ }, [w, T, b, B]), mt = z.useCallback(({ part: K, i: ve }) => {
13818
+ if (K.type === "text") {
13819
+ const xe = K.text ?? "", ht = xe.trim(), gt = Ja(ht);
13777
13820
  return gt && M !== "tool" ? /* @__PURE__ */ u.jsx(Op, { data: gt }, ve) : M === "user" && c && ht.length > d ? /* @__PURE__ */ u.jsx(
13778
13821
  NC,
13779
13822
  {
@@ -13786,8 +13829,8 @@ const Bc = z.memo(function({
13786
13829
  ve
13787
13830
  ) : /* @__PURE__ */ u.jsx(fs, { content: xe, allowHtml: !1 }, ve);
13788
13831
  }
13789
- if (V.type === "image_url") {
13790
- const xe = V;
13832
+ if (K.type === "image_url") {
13833
+ const xe = K;
13791
13834
  return /* @__PURE__ */ u.jsx("div", { className: "my-2", children: /* @__PURE__ */ u.jsx(
13792
13835
  "img",
13793
13836
  {
@@ -13798,8 +13841,8 @@ const Bc = z.memo(function({
13798
13841
  }
13799
13842
  ) }, ve);
13800
13843
  }
13801
- if (V.type === "file") {
13802
- const xe = V, ht = xe.name || "file";
13844
+ if (K.type === "file") {
13845
+ const xe = K, ht = xe.name || "file";
13803
13846
  return /* @__PURE__ */ u.jsxs(
13804
13847
  "a",
13805
13848
  {
@@ -13818,15 +13861,15 @@ const Bc = z.memo(function({
13818
13861
  ve
13819
13862
  );
13820
13863
  }
13821
- if (V.type === "interrupt") {
13822
- const xe = V, ht = Mo(
13864
+ if (K.type === "interrupt") {
13865
+ const xe = K, ht = Mo(
13823
13866
  (xe == null ? void 0 : xe.id) ?? (xe == null ? void 0 : xe.interrupt_id)
13824
13867
  ), gt = !!(ke && ht && ht === ke), Tt = gt ? Ne ?? (xe == null ? void 0 : xe.value) : xe == null ? void 0 : xe.value, _e = ht ? { ...xe, id: ht, interrupt_id: ht } : xe;
13825
13868
  return /* @__PURE__ */ u.jsx(
13826
13869
  EC,
13827
13870
  {
13828
13871
  interruptPart: _e,
13829
- onApprove: rt,
13872
+ onApprove: ot,
13830
13873
  onReject: St,
13831
13874
  disabled: w,
13832
13875
  isActive: gt,
@@ -13839,7 +13882,7 @@ const Bc = z.memo(function({
13839
13882
  }, [
13840
13883
  W,
13841
13884
  Ee,
13842
- rt,
13885
+ ot,
13843
13886
  St,
13844
13887
  M,
13845
13888
  c,
@@ -13851,14 +13894,14 @@ const Bc = z.memo(function({
13851
13894
  g,
13852
13895
  w,
13853
13896
  Y
13854
- ]), lt = z.useCallback(() => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 p-2 bg-muted/30 rounded", children: [
13897
+ ]), ct = z.useCallback(() => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 p-2 bg-muted/30 rounded", children: [
13855
13898
  /* @__PURE__ */ u.jsx(ji, { className: "h-4 w-4 text-muted-foreground" }),
13856
13899
  /* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
13857
13900
  ] }), []), Ct = z.useCallback(() => {
13858
- const V = te.trim().length > 0 || ne.length > 0 || Me.length > 0 || Y.length > 0;
13859
- if (!Z && Me.length > 0 && !r)
13860
- return lt();
13861
- if (!Z && !V && !r)
13901
+ const K = te.trim().length > 0 || ne.length > 0 || Le.length > 0 || Y.length > 0;
13902
+ if (!Z && Le.length > 0 && !r)
13903
+ return ct();
13904
+ if (!Z && !K && !r)
13862
13905
  return null;
13863
13906
  if (Z)
13864
13907
  return /* @__PURE__ */ u.jsx(
@@ -13879,30 +13922,30 @@ const Bc = z.memo(function({
13879
13922
  }, [
13880
13923
  te,
13881
13924
  ne.length,
13882
- Me.length,
13925
+ Le.length,
13883
13926
  Y.length,
13884
13927
  r,
13885
13928
  Z,
13886
13929
  L,
13887
- lt,
13930
+ ct,
13888
13931
  H
13889
- ]), ce = at(() => J ? "Assistant" : kC(t), [J, t]), re = z.useMemo(() => J ? [] : Array.isArray(C) ? C : [], [C, J]), Qe = z.useMemo(() => {
13890
- var V;
13891
- return re.length ? N && re.some((ve) => ve.id === N) ? N : ((V = re[0]) == null ? void 0 : V.id) ?? null : null;
13892
- }, [N, re]), De = z.useMemo(() => !re.length || !S ? null : re.some((V) => V.id === S) ? S : null, [S, re]) ?? Qe, ut = M === "user" && re.length > 0 && typeof k == "function", et = z.useCallback(
13893
- (V) => {
13932
+ ]), ce = lt(() => J ? "Assistant" : kC(t), [J, t]), re = z.useMemo(() => J ? [] : Array.isArray(C) ? C : [], [C, J]), Ye = z.useMemo(() => {
13933
+ var K;
13934
+ return re.length ? N && re.some((ve) => ve.id === N) ? N : ((K = re[0]) == null ? void 0 : K.id) ?? null : null;
13935
+ }, [N, re]), Xe = z.useMemo(() => !re.length || !S ? null : re.some((K) => K.id === S) ? S : null, [S, re]) ?? Ye, je = M === "user" && re.length > 0 && typeof k == "function", Fe = z.useCallback(
13936
+ (K) => {
13894
13937
  if (!k) return;
13895
- const ve = (V == null ? void 0 : V.id) ?? null, xe = (V == null ? void 0 : V.parentId) ?? E ?? null;
13938
+ const ve = (K == null ? void 0 : K.id) ?? null, xe = (K == null ? void 0 : K.parentId) ?? E ?? null;
13896
13939
  k(ve, xe);
13897
13940
  },
13898
13941
  [E, k]
13899
- ), Fe = z.useMemo(() => De ? re.findIndex((V) => V.id === De) : -1, [De, re]), Pt = z.useMemo(() => Fe < 0 ? null : re[Fe] ?? null, [Fe, re]), jt = z.useCallback((V) => {
13942
+ ), Oe = z.useMemo(() => Xe ? re.findIndex((K) => K.id === Xe) : -1, [Xe, re]), Pt = z.useMemo(() => Oe < 0 ? null : re[Oe] ?? null, [Oe, re]), jt = z.useCallback((K) => {
13900
13943
  const ve = [];
13901
- if (V.step !== null && ve.push(`Step ${V.step}`), V.source && ve.push(V.source), !V.createdAt)
13902
- return ve.length ? ve.join(" • ") : V.id.slice(0, 8);
13944
+ if (K.step !== null && ve.push(`Step ${K.step}`), K.source && ve.push(K.source), !K.createdAt)
13945
+ return ve.length ? ve.join(" • ") : K.id.slice(0, 8);
13903
13946
  let xe = "";
13904
13947
  try {
13905
- const ht = new Date(V.createdAt);
13948
+ const ht = new Date(K.createdAt);
13906
13949
  Number.isNaN(ht.getTime()) || (xe = new Intl.DateTimeFormat(void 0, {
13907
13950
  hour: "2-digit",
13908
13951
  minute: "2-digit"
@@ -13913,7 +13956,7 @@ const Bc = z.memo(function({
13913
13956
  return `${xe}`;
13914
13957
  }, []);
13915
13958
  return Z && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
13916
- /* @__PURE__ */ u.jsx("div", { className: Q(Ze(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Xe(), p.content), children: [
13959
+ /* @__PURE__ */ u.jsx("div", { className: Q(tt(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Q(Qe(), p.content), children: [
13917
13960
  (i || a || Z) && /* @__PURE__ */ u.jsxs(
13918
13961
  "div",
13919
13962
  {
@@ -13925,7 +13968,7 @@ const Bc = z.memo(function({
13925
13968
  ),
13926
13969
  children: [
13927
13970
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
13928
- qe(),
13971
+ Ge(),
13929
13972
  a && ce && /* @__PURE__ */ u.jsx("span", { className: Q("font-medium", D ? "text-xs" : "text-sm"), children: ce }),
13930
13973
  Z && /* @__PURE__ */ u.jsxs(
13931
13974
  Zf,
@@ -13940,9 +13983,9 @@ const Bc = z.memo(function({
13940
13983
  role: "button",
13941
13984
  tabIndex: 0,
13942
13985
  "aria-expanded": L === "expanded",
13943
- onClick: () => F((V) => V === "expanded" ? "preview" : "expanded"),
13944
- onKeyDown: (V) => {
13945
- (V.key === "Enter" || V.key === " ") && (V.preventDefault(), F((ve) => ve === "expanded" ? "preview" : "expanded"));
13986
+ onClick: () => F((K) => K === "expanded" ? "preview" : "expanded"),
13987
+ onKeyDown: (K) => {
13988
+ (K.key === "Enter" || K.key === " ") && (K.preventDefault(), F((ve) => ve === "expanded" ? "preview" : "expanded"));
13946
13989
  },
13947
13990
  children: [
13948
13991
  /* @__PURE__ */ u.jsx("span", { children: se.name ?? "Tool Output" }),
@@ -13953,28 +13996,28 @@ const Bc = z.memo(function({
13953
13996
  )
13954
13997
  ] }),
13955
13998
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
13956
- ut && Pt && Fe >= 0 && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
13999
+ je && Pt && Oe >= 0 && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
13957
14000
  /* @__PURE__ */ u.jsx(
13958
14001
  "button",
13959
14002
  {
13960
14003
  type: "button",
13961
14004
  className: Q(
13962
14005
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
13963
- Fe > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14006
+ Oe > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
13964
14007
  ),
13965
14008
  onClick: () => {
13966
- if (Fe <= 0) return;
13967
- const V = re[Fe - 1];
13968
- V && et(V);
14009
+ if (Oe <= 0) return;
14010
+ const K = re[Oe - 1];
14011
+ K && Fe(K);
13969
14012
  },
13970
14013
  "aria-label": "Previous checkpoint",
13971
- disabled: Fe <= 0,
14014
+ disabled: Oe <= 0,
13972
14015
  children: /* @__PURE__ */ u.jsx(xm, { className: "h-3 w-3" })
13973
14016
  }
13974
14017
  ),
13975
14018
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
13976
14019
  /* @__PURE__ */ u.jsxs("span", { className: "whitespace-nowrap", children: [
13977
- Fe + 1,
14020
+ Oe + 1,
13978
14021
  " / ",
13979
14022
  re.length
13980
14023
  ] }),
@@ -13986,15 +14029,15 @@ const Bc = z.memo(function({
13986
14029
  type: "button",
13987
14030
  className: Q(
13988
14031
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
13989
- Fe < re.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
14032
+ Oe < re.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
13990
14033
  ),
13991
14034
  onClick: () => {
13992
- if (Fe >= re.length - 1) return;
13993
- const V = re[Fe + 1];
13994
- V && et(V);
14035
+ if (Oe >= re.length - 1) return;
14036
+ const K = re[Oe + 1];
14037
+ K && Fe(K);
13995
14038
  },
13996
14039
  "aria-label": "Next checkpoint",
13997
- disabled: Fe >= re.length - 1,
14040
+ disabled: Oe >= re.length - 1,
13998
14041
  children: /* @__PURE__ */ u.jsx(Xc, { className: "h-3 w-3" })
13999
14042
  }
14000
14043
  )
@@ -14018,11 +14061,11 @@ const Bc = z.memo(function({
14018
14061
  ),
14019
14062
  children: [
14020
14063
  /* @__PURE__ */ u.jsx("div", { className: "relative", children: /* @__PURE__ */ u.jsx(
14021
- ot,
14064
+ st,
14022
14065
  {
14023
14066
  variant: "ghost",
14024
14067
  size: "sm",
14025
- onClick: () => Be(),
14068
+ onClick: () => He(),
14026
14069
  className: Q("h-6 w-6 p-0 hover:bg-foreground/10", H, D && "h-5 w-5"),
14027
14070
  "aria-label": "Copy message",
14028
14071
  title: "Copy message",
@@ -14030,22 +14073,22 @@ const Bc = z.memo(function({
14030
14073
  }
14031
14074
  ) }),
14032
14075
  M === "user" && h && /* @__PURE__ */ u.jsx(
14033
- ot,
14076
+ st,
14034
14077
  {
14035
14078
  variant: "ghost",
14036
14079
  size: "sm",
14037
- onClick: Ue,
14080
+ onClick: We,
14038
14081
  className: Q("h-6 w-6 p-0 hover:bg-foreground/10", H, D && "h-5 w-5"),
14039
14082
  "aria-label": "Edit message",
14040
14083
  children: /* @__PURE__ */ u.jsx(fl, { className: Q(H, D ? "h-3 w-3" : "h-4 w-4") })
14041
14084
  }
14042
14085
  ),
14043
14086
  M === "assistant" && m && /* @__PURE__ */ u.jsx(
14044
- ot,
14087
+ st,
14045
14088
  {
14046
14089
  variant: "ghost",
14047
14090
  size: "sm",
14048
- onClick: Ke,
14091
+ onClick: qe,
14049
14092
  className: Q("h-6 w-6 p-0 hover:bg-foreground/10", H, D && "h-5 w-5"),
14050
14093
  "aria-label": "Regenerate response",
14051
14094
  children: /* @__PURE__ */ u.jsx(_i, { className: Q(H, D ? "h-3 w-3" : "h-4 w-4") })
@@ -14079,31 +14122,31 @@ const Bc = z.memo(function({
14079
14122
  ),
14080
14123
  children: [
14081
14124
  /* @__PURE__ */ u.jsx(
14082
- ot,
14125
+ st,
14083
14126
  {
14084
14127
  variant: "ghost",
14085
14128
  size: "sm",
14086
- onClick: () => Be(),
14129
+ onClick: () => He(),
14087
14130
  className: Q("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
14088
14131
  children: /* @__PURE__ */ u.jsx(dl, { className: Q(I ? "text-success" : "text-current", D ? "h-3 w-3" : "h-4 w-4") })
14089
14132
  }
14090
14133
  ),
14091
14134
  M === "user" && h && /* @__PURE__ */ u.jsx(
14092
- ot,
14135
+ st,
14093
14136
  {
14094
14137
  variant: "ghost",
14095
14138
  size: "sm",
14096
- onClick: Ue,
14139
+ onClick: We,
14097
14140
  className: Q("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
14098
14141
  children: /* @__PURE__ */ u.jsx(fl, { className: Q("text-current", D ? "h-3 w-3" : "h-4 w-4") })
14099
14142
  }
14100
14143
  ),
14101
14144
  M === "assistant" && m && /* @__PURE__ */ u.jsx(
14102
- ot,
14145
+ st,
14103
14146
  {
14104
14147
  variant: "ghost",
14105
14148
  size: "sm",
14106
- onClick: Ke,
14149
+ onClick: qe,
14107
14150
  className: Q("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
14108
14151
  children: /* @__PURE__ */ u.jsx(_i, { className: Q("text-current", D ? "h-3 w-3" : "h-4 w-4") })
14109
14152
  }
@@ -14112,14 +14155,14 @@ const Bc = z.memo(function({
14112
14155
  }
14113
14156
  )
14114
14157
  ] }) }),
14115
- q && /* @__PURE__ */ u.jsx(
14158
+ U && /* @__PURE__ */ u.jsx(
14116
14159
  oC,
14117
14160
  {
14118
14161
  isOpen: ee,
14119
14162
  onClose: P,
14120
- fileId: q.id,
14121
- fileName: q.name,
14122
- mimeType: q.mimeType
14163
+ fileId: U.id,
14164
+ fileName: U.name,
14165
+ mimeType: U.mimeType
14123
14166
  }
14124
14167
  )
14125
14168
  ] });
@@ -14174,7 +14217,7 @@ function EC({
14174
14217
  a && /* @__PURE__ */ u.jsx(Xr, { className: "pt-0 pb-3", children: a }),
14175
14218
  /* @__PURE__ */ u.jsx(ep, { className: "pt-0", children: /* @__PURE__ */ u.jsxs("div", { className: "flex gap-2 ml-auto", children: [
14176
14219
  /* @__PURE__ */ u.jsx(
14177
- ot,
14220
+ st,
14178
14221
  {
14179
14222
  size: "sm",
14180
14223
  variant: "outline",
@@ -14185,7 +14228,7 @@ function EC({
14185
14228
  }
14186
14229
  ),
14187
14230
  /* @__PURE__ */ u.jsx(
14188
- ot,
14231
+ st,
14189
14232
  {
14190
14233
  size: "sm",
14191
14234
  onClick: () => t(e),
@@ -14294,7 +14337,7 @@ function NC({
14294
14337
  }
14295
14338
  ) }),
14296
14339
  /* @__PURE__ */ u.jsx(
14297
- ot,
14340
+ st,
14298
14341
  {
14299
14342
  type: "button",
14300
14343
  variant: "ghost",
@@ -14388,9 +14431,9 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14388
14431
  onSelectCheckpoint: I,
14389
14432
  timelineCheckpoints: O
14390
14433
  }, L) => {
14391
- const F = Je(null), j = Je(null), $ = Je(!1), [A, B] = ge(!0), D = at(() => w ? e.some((Y) => "type" in Y && Y.type === "default_message" ? !1 : Array.isArray(Y == null ? void 0 : Y.content) && Y.content.some(
14434
+ const F = et(null), j = et(null), $ = et(!1), [A, B] = ge(!0), D = lt(() => w ? e.some((Y) => "type" in Y && Y.type === "default_message" ? !1 : Array.isArray(Y == null ? void 0 : Y.content) && Y.content.some(
14392
14435
  (de) => de && de.type === "interrupt" && (de.id ?? de.interrupt_id) === w.id
14393
- )) : !1, [w, e]), M = at(() => {
14436
+ )) : !1, [w, e]), M = lt(() => {
14394
14437
  if (!w || D)
14395
14438
  return null;
14396
14439
  const Y = w.id && String(w.id).trim() ? String(w.id).trim() : "pending-interrupt";
@@ -14413,7 +14456,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14413
14456
  }
14414
14457
  ]
14415
14458
  };
14416
- }, [w, D]), Z = at(() => M ? [...e, M] : e, [e, M]), J = at(() => S ? Z : Z.filter((Y) => (Y == null ? void 0 : Y.role) !== "tool"), [Z, S]), pe = at(() => {
14459
+ }, [w, D]), Z = lt(() => M ? [...e, M] : e, [e, M]), J = lt(() => S ? Z : Z.filter((Y) => (Y == null ? void 0 : Y.role) !== "tool"), [Z, S]), pe = lt(() => {
14417
14460
  const Y = /* @__PURE__ */ new Set(), de = [];
14418
14461
  for (let ke = J.length - 1; ke >= 0; ke--) {
14419
14462
  const Ne = J[ke];
@@ -14422,13 +14465,13 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14422
14465
  de.push(Ne);
14423
14466
  continue;
14424
14467
  }
14425
- const ze = Ne, Be = jC(ze);
14426
- Y.has(Be) || (Y.add(Be), de.push(ze));
14468
+ const Be = Ne, He = jC(Be);
14469
+ Y.has(He) || (Y.add(He), de.push(Be));
14427
14470
  }
14428
14471
  return de.reverse();
14429
14472
  }, [J]), Re = Ce((Y) => {
14430
14473
  B(Y), y && y(!Y), g && g(Y);
14431
- }, [y, g]), Ee = at(() => {
14474
+ }, [y, g]), Ee = lt(() => {
14432
14475
  if (a)
14433
14476
  return async () => {
14434
14477
  if (!$.current) {
@@ -14440,7 +14483,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14440
14483
  }
14441
14484
  }
14442
14485
  };
14443
- }, [a]), W = at(() => !m || x ? !1 : A ? "auto" : !1, [A, m, x]), ee = at(() => O ?? [], [O]), q = E ?? (ee.length ? ee[ee.length - 1].id : null), P = ee.length > 0, H = at(() => {
14486
+ }, [a]), W = lt(() => !m || x ? !1 : A ? "auto" : !1, [A, m, x]), ee = lt(() => O ?? [], [O]), U = E ?? (ee.length ? ee[ee.length - 1].id : null), P = ee.length > 0, H = lt(() => {
14444
14487
  if (typeof h != "string") return null;
14445
14488
  const Y = h.trim();
14446
14489
  return Y ? {
@@ -14461,7 +14504,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14461
14504
  ] }),
14462
14505
  /* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute left-5 top-0 bottom-0 w-px bg-border/50" }),
14463
14506
  /* @__PURE__ */ u.jsx("div", { className: "flex flex-col gap-4", children: ee.map((Y) => {
14464
- const de = q === Y.id;
14507
+ const de = U === Y.id;
14465
14508
  return /* @__PURE__ */ u.jsxs(
14466
14509
  "button",
14467
14510
  {
@@ -14516,7 +14559,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14516
14559
  onCancelEdit: () => {
14517
14560
  }
14518
14561
  }
14519
- ) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), Me = pe.length > 0;
14562
+ ) }) }) : /* @__PURE__ */ u.jsx("div", { className: "flex h-full items-center justify-center py-8 text-center text-muted-foreground", children: h ?? "No messages yet. Start a conversation!" }), Le = pe.length > 0;
14520
14563
  return lm(
14521
14564
  L,
14522
14565
  () => ({
@@ -14543,7 +14586,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14543
14586
  [pe]
14544
14587
  ), /* @__PURE__ */ u.jsxs("div", { className: se, style: p, children: [
14545
14588
  te,
14546
- /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Me ? /* @__PURE__ */ u.jsx(
14589
+ /* @__PURE__ */ u.jsx("div", { className: "relative flex-1 min-h-0", children: Le ? /* @__PURE__ */ u.jsx(
14547
14590
  vS,
14548
14591
  {
14549
14592
  ref: (Y) => {
@@ -14566,24 +14609,24 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14566
14609
  style: { height: "100%", overscrollBehavior: "contain" },
14567
14610
  computeItemKey: (Y, de) => Hc(de, Y),
14568
14611
  itemContent: (Y, de) => {
14569
- var rt;
14612
+ var ot;
14570
14613
  const ke = Hc(de, Y), Ne = "type" in de && de.type === "default_message";
14571
- let ze = [], Be = null, Ue = {}, Ke = {}, qe = null, Ze = null;
14614
+ let Be = [], He = null, We = {}, qe = {}, Ge = null, tt = null;
14572
14615
  if (!Ne) {
14573
14616
  const St = de, mt = St.checkpointId ?? null;
14574
- Ue = St.additionalKwargs ?? {}, Ke = St.responseMetadata ?? {};
14575
- const lt = mt && k ? k.get(mt) ?? null : null;
14576
- qe = typeof Ue.step == "number" ? Ue.step : typeof Ke.step == "number" ? Ke.step : (lt == null ? void 0 : lt.step) ?? null;
14577
- const Ct = typeof Ue.source == "string" ? Ue.source : typeof Ke.source == "string" ? Ke.source : (lt == null ? void 0 : lt.source) ?? null;
14578
- Ze = Ct ? String(Ct) : null;
14579
- const ce = qe !== null && Ze ? `${qe}:${Ze}` : null;
14580
- ce && (N != null && N.has(ce)) ? ze = N.get(ce) ?? [] : mt && lt && (ze = [lt]), Be = mt ?? ((rt = ze[0]) == null ? void 0 : rt.id) ?? null;
14617
+ We = St.additionalKwargs ?? {}, qe = St.responseMetadata ?? {};
14618
+ const ct = mt && k ? k.get(mt) ?? null : null;
14619
+ Ge = typeof We.step == "number" ? We.step : typeof qe.step == "number" ? qe.step : (ct == null ? void 0 : ct.step) ?? null;
14620
+ const Ct = typeof We.source == "string" ? We.source : typeof qe.source == "string" ? qe.source : (ct == null ? void 0 : ct.source) ?? null;
14621
+ tt = Ct ? String(Ct) : null;
14622
+ const ce = Ge !== null && tt ? `${Ge}:${tt}` : null;
14623
+ ce && (N != null && N.has(ce)) ? Be = N.get(ce) ?? [] : mt && ct && (Be = [ct]), He = mt ?? ((ot = Be[0]) == null ? void 0 : ot.id) ?? null;
14581
14624
  }
14582
- const Xe = (() => {
14583
- if (typeof Ue.parentCheckpointId == "string")
14584
- return Ue.parentCheckpointId;
14585
- if (typeof Ke.parentCheckpointId == "string")
14586
- return Ke.parentCheckpointId;
14625
+ const Qe = (() => {
14626
+ if (typeof We.parentCheckpointId == "string")
14627
+ return We.parentCheckpointId;
14628
+ if (typeof qe.parentCheckpointId == "string")
14629
+ return qe.parentCheckpointId;
14587
14630
  })();
14588
14631
  return /* @__PURE__ */ u.jsx(
14589
14632
  "div",
@@ -14614,11 +14657,11 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14614
14657
  onInterruptActionStart: T,
14615
14658
  onInterruptActionEnd: C,
14616
14659
  showToolMessages: S,
14617
- checkpointCandidates: ze,
14660
+ checkpointCandidates: Be,
14618
14661
  activeCheckpointId: E ?? null,
14619
14662
  onSelectCheckpoint: I,
14620
- defaultCheckpointId: Be,
14621
- messageParentCheckpointId: Xe
14663
+ defaultCheckpointId: He,
14664
+ messageParentCheckpointId: Qe
14622
14665
  }
14623
14666
  )
14624
14667
  }
@@ -14670,15 +14713,15 @@ function Ai({
14670
14713
  Ee(!0);
14671
14714
  }, []), ee = Ce(() => {
14672
14715
  Ee(!1);
14673
- }, []), q = !!pe || Re, [P, H] = ge(null), [te, se] = ge(""), [ne, Me] = ge(null), [Y, de] = ge(null), [ke, Ne] = ge([]), [ze, Be] = ge(0), [Ue, Ke] = ge(0), [qe, Ze] = ge(!1), [Xe, rt] = ge(null), [St, mt] = ge(null), [lt, Ct] = ge(!1), [ce, re] = ge(null), [Qe, je] = ge(!1), De = Je(!1), [ut, et] = ge(() => Uc.value), Fe = Je(ut), Pt = Je(null), jt = Ce((G) => {
14674
- Uc.value = G, et(G);
14675
- }, []), [V, ve] = ge(!1), xe = Je(null), ht = Ce((G) => {
14716
+ }, []), U = !!pe || Re, [P, H] = ge(null), [te, se] = ge(""), [ne, Le] = ge(null), [Y, de] = ge(null), [ke, Ne] = ge([]), [Be, He] = ge(0), [We, qe] = ge(0), [Ge, tt] = ge(!1), [Qe, ot] = ge(null), [St, mt] = ge(null), [ct, Ct] = ge(!1), [ce, re] = ge(null), [Ye, De] = ge(!1), Xe = et(!1), [je, Fe] = ge(() => Uc.value), Oe = et(je), Pt = et(null), jt = Ce((G) => {
14717
+ Uc.value = G, Fe(G);
14718
+ }, []), [K, ve] = ge(!1), xe = et(null), ht = Ce((G) => {
14676
14719
  if (!Array.isArray(G))
14677
14720
  return { text: null, messageId: null };
14678
14721
  for (let oe = G.length - 1; oe >= 0; oe--) {
14679
14722
  const ae = G[oe];
14680
14723
  if (!ae || ae.role !== "user") continue;
14681
- const be = (ae.content ?? []).filter((Ye) => (Ye == null ? void 0 : Ye.type) === "text").map((Ye) => Ye.text).filter((Ye) => typeof Ye == "string" && Ye.trim().length > 0);
14724
+ const be = (ae.content ?? []).filter((Ze) => (Ze == null ? void 0 : Ze.type) === "text").map((Ze) => Ze.text).filter((Ze) => typeof Ze == "string" && Ze.trim().length > 0);
14682
14725
  return {
14683
14726
  text: be.length ? be.join(" ").trim() : null,
14684
14727
  messageId: ae.id ?? null
@@ -14699,20 +14742,20 @@ function Ai({
14699
14742
  return typeof ae == "string" && ae.trim() ? ae : null;
14700
14743
  },
14701
14744
  []
14702
- ), _e = at(() => {
14745
+ ), _e = lt(() => {
14703
14746
  const G = (be) => {
14704
14747
  if (!Array.isArray(be) || be.length === 0)
14705
14748
  return null;
14706
- const dt = be.map((Ye) => {
14707
- if (typeof Ye == "string")
14708
- return Ye.trim();
14709
- if (Ye && typeof Ye == "object" && "type" in Ye) {
14710
- const nt = Ye;
14711
- if (typeof nt.type == "string")
14712
- return nt.type;
14749
+ const dt = be.map((Ze) => {
14750
+ if (typeof Ze == "string")
14751
+ return Ze.trim();
14752
+ if (Ze && typeof Ze == "object" && "type" in Ze) {
14753
+ const rt = Ze;
14754
+ if (typeof rt.type == "string")
14755
+ return rt.type;
14713
14756
  }
14714
14757
  return null;
14715
- }).filter((Ye) => !!(Ye && Ye.length));
14758
+ }).filter((Ze) => !!(Ze && Ze.length));
14716
14759
  return dt.length ? dt.join(", ") : null;
14717
14760
  }, oe = Array.isArray(I) ? I.map((be) => {
14718
14761
  const dt = G(be.next);
@@ -14725,83 +14768,83 @@ function Ai({
14725
14768
  } : be;
14726
14769
  }) : [];
14727
14770
  return oe.some((be) => gt(be.metadata, "step") !== null) && oe.sort((be, dt) => {
14728
- const Ye = gt(be.metadata, "step"), nt = gt(dt.metadata, "step");
14729
- if (Ye !== null || nt !== null)
14730
- return (nt ?? Number.NEGATIVE_INFINITY) - (Ye ?? Number.NEGATIVE_INFINITY);
14771
+ const Ze = gt(be.metadata, "step"), rt = gt(dt.metadata, "step");
14772
+ if (Ze !== null || rt !== null)
14773
+ return (rt ?? Number.NEGATIVE_INFINITY) - (Ze ?? Number.NEGATIVE_INFINITY);
14731
14774
  const Mt = Date.parse(be.createdAt ?? ""), tn = Date.parse(dt.createdAt ?? "");
14732
14775
  return Number.isNaN(Mt) || Number.isNaN(tn) ? 0 : tn - Mt;
14733
14776
  }), oe;
14734
- }, [I, gt]), { checkpointMetaById: Vt, checkpointIndexByKey: ct } = at(() => {
14777
+ }, [I, gt]), { checkpointMetaById: Vt, checkpointIndexByKey: ut } = lt(() => {
14735
14778
  const G = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map();
14736
14779
  for (const ae of _e) {
14737
14780
  const be = ae.checkpointId ?? null;
14738
14781
  if (!be) continue;
14739
- const dt = gt(ae.metadata, "step"), Ye = Tt(ae.metadata, "source"), nt = {
14782
+ const dt = gt(ae.metadata, "step"), Ze = Tt(ae.metadata, "source"), rt = {
14740
14783
  id: be,
14741
14784
  step: dt,
14742
- source: Ye,
14785
+ source: Ze,
14743
14786
  createdAt: ae.createdAt ?? null,
14744
14787
  namespace: ae.checkpointNs ?? null,
14745
14788
  parentId: ae.parentId ?? null
14746
14789
  };
14747
- if (G.set(be, nt), dt !== null && Ye) {
14748
- const Mt = `${dt}:${Ye}`, tn = oe.get(Mt) ?? [];
14749
- tn.push(nt), oe.set(Mt, tn);
14790
+ if (G.set(be, rt), dt !== null && Ze) {
14791
+ const Mt = `${dt}:${Ze}`, tn = oe.get(Mt) ?? [];
14792
+ tn.push(rt), oe.set(Mt, tn);
14750
14793
  }
14751
14794
  }
14752
14795
  for (const ae of oe.values())
14753
14796
  ae.sort((be, dt) => {
14754
- const Ye = be.createdAt ?? "";
14755
- return (dt.createdAt ?? "").localeCompare(Ye);
14797
+ const Ze = be.createdAt ?? "";
14798
+ return (dt.createdAt ?? "").localeCompare(Ze);
14756
14799
  });
14757
14800
  return { checkpointMetaById: G, checkpointIndexByKey: oe };
14758
- }, [_e, gt, Tt]), kt = at(() => {
14759
- var Ye;
14801
+ }, [_e, gt, Tt]), kt = lt(() => {
14802
+ var Ze;
14760
14803
  if (!_e.length) return [];
14761
- const G = [..._e].reverse(), oe = (nt, Mt) => {
14762
- const tn = nt.checkpointId ?? null;
14804
+ const G = [..._e].reverse(), oe = (rt, Mt) => {
14805
+ const tn = rt.checkpointId ?? null;
14763
14806
  if (!tn) return null;
14764
- const Zn = Tt(nt.metadata, "source");
14765
- Tt(nt.metadata, "next");
14766
- const { text: ll, messageId: nm } = ht(nt.messages), oi = ll && ll.replace(/\s+/g, " ").trim() || Tt(nt.metadata, "title") || Tt(nt.metadata, "label") || Mt || Zn || "Checkpoint", rm = oi.length > 60 ? `${oi.slice(0, 57)}…` : oi;
14807
+ const Zn = Tt(rt.metadata, "source");
14808
+ Tt(rt.metadata, "next");
14809
+ const { text: ll, messageId: nm } = ht(rt.messages), oi = ll && ll.replace(/\s+/g, " ").trim() || Tt(rt.metadata, "title") || Tt(rt.metadata, "label") || Mt || Zn || "Checkpoint", rm = oi.length > 60 ? `${oi.slice(0, 57)}…` : oi;
14767
14810
  return {
14768
14811
  id: tn,
14769
14812
  label: rm,
14770
14813
  messageId: nm ?? null,
14771
- createdAt: nt.createdAt ?? null,
14772
- step: gt(nt.metadata, "step"),
14814
+ createdAt: rt.createdAt ?? null,
14815
+ step: gt(rt.metadata, "step"),
14773
14816
  source: Zn ?? null,
14774
- next: Tt(nt.metadata, "next")
14817
+ next: Tt(rt.metadata, "next")
14775
14818
  };
14776
14819
  }, ae = [], be = /* @__PURE__ */ new Set();
14777
- for (const nt of G) {
14778
- const Mt = ((Ye = Tt(nt.metadata, "source")) == null ? void 0 : Ye.toLowerCase()) ?? null;
14820
+ for (const rt of G) {
14821
+ const Mt = ((Ze = Tt(rt.metadata, "source")) == null ? void 0 : Ze.toLowerCase()) ?? null;
14779
14822
  if (!(Mt === "input" || Mt === "user_input" || Mt === "user")) continue;
14780
- const Zn = oe(nt, "User input");
14823
+ const Zn = oe(rt, "User input");
14781
14824
  Zn && !be.has(Zn.id) && (ae.push(Zn), be.add(Zn.id));
14782
14825
  }
14783
14826
  if (!ae.length)
14784
- for (const nt of G) {
14785
- const Mt = oe(nt);
14827
+ for (const rt of G) {
14828
+ const Mt = oe(rt);
14786
14829
  Mt && !be.has(Mt.id) && (ae.push(Mt), be.add(Mt.id));
14787
14830
  }
14788
- const dt = _e.find((nt) => {
14831
+ const dt = _e.find((rt) => {
14789
14832
  var tn;
14790
- return (((tn = Tt(nt.metadata, "source")) == null ? void 0 : tn.toLowerCase()) ?? null) === "loop";
14833
+ return (((tn = Tt(rt.metadata, "source")) == null ? void 0 : tn.toLowerCase()) ?? null) === "loop";
14791
14834
  });
14792
14835
  if (dt) {
14793
- const nt = oe(dt, "Latest loop");
14794
- nt && !be.has(nt.id) && (ae.push(nt), be.add(nt.id));
14836
+ const rt = oe(dt, "Latest loop");
14837
+ rt && !be.has(rt.id) && (ae.push(rt), be.add(rt.id));
14795
14838
  }
14796
14839
  return ae;
14797
- }, [_e, ht, gt, Tt]), Dn = Je(null), Jn = Je(null), Ln = Ce(() => {
14798
- Dn.current && (Dn.current.value = ""), Jn.current && (Jn.current.value = ""), Be((G) => G + 1), Ke((G) => G + 1);
14840
+ }, [_e, ht, gt, Tt]), Dn = et(null), Jn = et(null), Ln = Ce(() => {
14841
+ Dn.current && (Dn.current.value = ""), Jn.current && (Jn.current.value = ""), He((G) => G + 1), qe((G) => G + 1);
14799
14842
  }, []), ti = Ce(
14800
14843
  (G) => {
14801
14844
  jt(G);
14802
14845
  },
14803
14846
  [jt]
14804
- ), So = Je(!1);
14847
+ ), So = et(!1);
14805
14848
  Et(() => {
14806
14849
  So.current && !F && (Ne([]), Ln()), So.current = F;
14807
14850
  }, [F, Ln]);
@@ -14813,24 +14856,24 @@ function Ai({
14813
14856
  };
14814
14857
  return G(), window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
14815
14858
  }, []), Et(() => {
14816
- je(!1), De.current = !1;
14859
+ De(!1), Xe.current = !1;
14817
14860
  }, [D]), Et(() => {
14818
- Fe.current = ut;
14819
- }, [ut]), Et(() => {
14861
+ Oe.current = je;
14862
+ }, [je]), Et(() => {
14820
14863
  if (!P) {
14821
14864
  Pt.current = null;
14822
14865
  return;
14823
14866
  }
14824
- Pt.current === null && (Pt.current = Fe.current), jt(te ?? "");
14867
+ Pt.current === null && (Pt.current = Oe.current), jt(te ?? "");
14825
14868
  }, [te, P, jt]);
14826
14869
  const R = Ce(async () => {
14827
- if (!(!b || T || !Qe))
14870
+ if (!(!b || T || !Ye))
14828
14871
  try {
14829
14872
  await S();
14830
14873
  } catch (G) {
14831
14874
  console.warn("loadOlder failed", G);
14832
14875
  }
14833
- }, [b, Qe, T, S]);
14876
+ }, [b, Ye, T, S]);
14834
14877
  Et(() => {
14835
14878
  (async () => {
14836
14879
  if (!x.baseUrl) {
@@ -14845,9 +14888,9 @@ function Ai({
14845
14888
  }
14846
14889
  })();
14847
14890
  }, [x.baseUrl]), Et(() => {
14848
- j && !lt && (m == null || m(j));
14849
- }, [j, lt, m]);
14850
- const K = (G) => {
14891
+ j && !ct && (m == null || m(j));
14892
+ }, [j, ct, m]);
14893
+ const q = (G) => {
14851
14894
  if (G.length > Wo)
14852
14895
  return `Message too long (${G.length}/${Wo} characters)`;
14853
14896
  try {
@@ -14859,7 +14902,7 @@ function Ai({
14859
14902
  const oe = G.trim();
14860
14903
  if (!(!oe && ke.length === 0)) {
14861
14904
  if (oe) {
14862
- const ae = K(oe);
14905
+ const ae = q(oe);
14863
14906
  if (ae) {
14864
14907
  de(ae);
14865
14908
  return;
@@ -14882,7 +14925,7 @@ function Ai({
14882
14925
  checkpointId: ae,
14883
14926
  checkpointNs: be
14884
14927
  }
14885
- ), p == null || p(oe), jt(""), de(null), Ne([]), Ln(), H(null), se(""), Me(null);
14928
+ ), p == null || p(oe), jt(""), de(null), Ne([]), Ln(), H(null), se(""), Le(null);
14886
14929
  } catch (ae) {
14887
14930
  const be = (ae == null ? void 0 : ae.message) || "Failed to send message";
14888
14931
  de(be), m == null || m(be);
@@ -14890,23 +14933,23 @@ function Ai({
14890
14933
  }
14891
14934
  }, we = z.useCallback(
14892
14935
  (G, oe, ae) => {
14893
- c && (Pt.current = ut, H(G), se(oe), jt(oe), de(null), Me({
14936
+ c && (Pt.current = je, H(G), se(oe), jt(oe), de(null), Le({
14894
14937
  checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? null,
14895
14938
  checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? null
14896
14939
  }));
14897
14940
  },
14898
- [ut, c, jt]
14899
- ), Ge = z.useCallback(() => {
14900
- H(null), se(""), Me(null), de(null), jt(Pt.current ?? ut), Pt.current = null;
14901
- }, [ut, jt]), it = Ce(
14941
+ [je, c, jt]
14942
+ ), Je = z.useCallback(() => {
14943
+ H(null), se(""), Le(null), de(null), jt(Pt.current ?? je), Pt.current = null;
14944
+ }, [je, jt]), at = Ce(
14902
14945
  (G, oe, ae) => {
14903
14946
  we(G, oe, ae);
14904
14947
  },
14905
14948
  [we]
14906
- ), He = Ce((G) => {
14949
+ ), Ue = Ce((G) => {
14907
14950
  for (let oe = G - 1; oe >= 0; oe--)
14908
14951
  if (w[oe].role === "user") {
14909
- const ae = w[oe].content || [], dt = ae.filter((Ye) => Ye.type === "text").map((Ye) => Ye.text).join("") || (() => {
14952
+ const ae = w[oe].content || [], dt = ae.filter((Ze) => Ze.type === "text").map((Ze) => Ze.text).join("") || (() => {
14910
14953
  try {
14911
14954
  return JSON.stringify(ae, null, 2);
14912
14955
  } catch {
@@ -14922,7 +14965,7 @@ function Ai({
14922
14965
  );
14923
14966
  break;
14924
14967
  }
14925
- }, [w, A, M, Z]), $e = (G) => {
14968
+ }, [w, A, M, Z]), ze = (G) => {
14926
14969
  const oe = Array.from(G.target.files || []);
14927
14970
  Ne((ae) => [...ae, ...oe]), G.target.value = "";
14928
14971
  }, Ot = (G) => {
@@ -14933,7 +14976,7 @@ function Ai({
14933
14976
  }, bt = async (G) => {
14934
14977
  const oe = (G.target.files || [])[0];
14935
14978
  if (oe) {
14936
- rt(null), mt(null), Ze(!0);
14979
+ ot(null), mt(null), tt(!0);
14937
14980
  try {
14938
14981
  await A(
14939
14982
  { attachments: [oe] },
@@ -14946,9 +14989,9 @@ function Ai({
14946
14989
  mt(ae);
14947
14990
  } catch (ae) {
14948
14991
  const be = ae instanceof Error ? ae.message : "Failed to upload Excel file";
14949
- console.error("Excel upload failed", ae), rt(be), m == null || m(be);
14992
+ console.error("Excel upload failed", ae), ot(be), m == null || m(be);
14950
14993
  } finally {
14951
- Ze(!1), G.target.value = "", Ln();
14994
+ tt(!1), G.target.value = "", Ln();
14952
14995
  }
14953
14996
  }
14954
14997
  }, vt = async (G) => {
@@ -14956,14 +14999,14 @@ function Ai({
14956
14999
  ve(!0);
14957
15000
  try {
14958
15001
  if (!G) {
14959
- await N(), je(!1), requestAnimationFrame(() => {
15002
+ await N(), De(!1), requestAnimationFrame(() => {
14960
15003
  var be;
14961
15004
  (be = xe.current) == null || be.scrollToLatest();
14962
15005
  });
14963
15006
  return;
14964
15007
  }
14965
15008
  const oe = _e.find((be) => be.checkpointId === G), ae = (oe == null ? void 0 : oe.checkpointNs) ?? null;
14966
- await k(G, ae), je(!0), requestAnimationFrame(() => {
15009
+ await k(G, ae), De(!0), requestAnimationFrame(() => {
14967
15010
  var be;
14968
15011
  (be = xe.current) == null || be.scrollToTop();
14969
15012
  });
@@ -14988,10 +15031,10 @@ function Ai({
14988
15031
  []
14989
15032
  );
14990
15033
  return /* @__PURE__ */ u.jsxs("div", { className: Fn, children: [
14991
- !!j && !lt && /* @__PURE__ */ u.jsxs("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
15034
+ !!j && !ct && /* @__PURE__ */ u.jsxs("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
14992
15035
  /* @__PURE__ */ u.jsx("span", { children: j }),
14993
15036
  /* @__PURE__ */ u.jsx(
14994
- ot,
15037
+ st,
14995
15038
  {
14996
15039
  variant: "ghost",
14997
15040
  size: "sm",
@@ -15044,27 +15087,27 @@ function Ai({
15044
15087
  enableMessageEditing: c,
15045
15088
  editingMessageId: P,
15046
15089
  onStartReached: () => {
15047
- Qe && R();
15090
+ Ye && R();
15048
15091
  },
15049
15092
  onScrollAway: (G) => {
15050
- if (!De.current) {
15051
- De.current = !0;
15093
+ if (!Xe.current) {
15094
+ Xe.current = !0;
15052
15095
  return;
15053
15096
  }
15054
- G && je(!0);
15097
+ G && De(!0);
15055
15098
  },
15056
- onEdit: it,
15057
- onRegenerate: He,
15058
- onCancelEdit: Ge,
15099
+ onEdit: at,
15100
+ onRegenerate: Ue,
15101
+ onCancelEdit: Je,
15059
15102
  emptyMessage: ce ?? void 0,
15060
- isNavigatingCheckpoint: V,
15103
+ isNavigatingCheckpoint: K,
15061
15104
  activeInterrupt: pe,
15062
15105
  disableInterruptActions: Re,
15063
15106
  onInterruptActionStart: W,
15064
15107
  onInterruptActionEnd: ee,
15065
15108
  showToolMessages: d,
15066
15109
  checkpointMetaById: Vt,
15067
- checkpointIndexByKey: ct,
15110
+ checkpointIndexByKey: ut,
15068
15111
  activeCheckpointId: M,
15069
15112
  onSelectCheckpoint: Kt,
15070
15113
  timelineCheckpoints: kt
@@ -15079,7 +15122,7 @@ function Ai({
15079
15122
  /* @__PURE__ */ u.jsx(zr, { className: "h-6 w-6 animate-spin" }),
15080
15123
  /* @__PURE__ */ u.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide", children: "Loading messages…" })
15081
15124
  ] }),
15082
- (T || V) && /* @__PURE__ */ u.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground", children: [
15125
+ (T || K) && /* @__PURE__ */ u.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground", children: [
15083
15126
  /* @__PURE__ */ u.jsx(zr, { className: "h-6 w-6 animate-spin" }),
15084
15127
  /* @__PURE__ */ u.jsx("span", { className: "text-xs font-semibold uppercase tracking-wide", children: "Loading checkpoint…" })
15085
15128
  ] })
@@ -15093,11 +15136,11 @@ function Ai({
15093
15136
  /* @__PURE__ */ u.jsx("span", { className: "text-sm font-medium text-blue-800", children: "Editing message" })
15094
15137
  ] }),
15095
15138
  /* @__PURE__ */ u.jsx(
15096
- ot,
15139
+ st,
15097
15140
  {
15098
15141
  variant: "ghost",
15099
15142
  size: "sm",
15100
- onClick: Ge,
15143
+ onClick: Je,
15101
15144
  className: "text-blue-600 hover:bg-blue-100",
15102
15145
  children: /* @__PURE__ */ u.jsx(vr, { size: 16 })
15103
15146
  }
@@ -15111,16 +15154,16 @@ function Ai({
15111
15154
  ref: Dn,
15112
15155
  type: "file",
15113
15156
  multiple: !0,
15114
- onChange: (G) => $e(G),
15157
+ onChange: (G) => ze(G),
15115
15158
  className: "hidden"
15116
15159
  },
15117
- ze
15160
+ Be
15118
15161
  ),
15119
15162
  ke.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: ke.map((G, oe) => /* @__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: [
15120
15163
  /* @__PURE__ */ u.jsx(ji, { size: 14 }),
15121
15164
  /* @__PURE__ */ u.jsx("span", { className: "truncate max-w-[150px]", children: G.name }),
15122
15165
  /* @__PURE__ */ u.jsx(
15123
- ot,
15166
+ st,
15124
15167
  {
15125
15168
  variant: "ghost",
15126
15169
  size: "sm",
@@ -15142,26 +15185,26 @@ function Ai({
15142
15185
  onChange: bt,
15143
15186
  className: "hidden"
15144
15187
  },
15145
- Ue
15188
+ We
15146
15189
  ),
15147
- qe && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15190
+ Ge && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15148
15191
  /* @__PURE__ */ u.jsx(zr, { className: "h-4 w-4 animate-spin" }),
15149
15192
  " Uploading Excel file..."
15150
15193
  ] }),
15151
- St && !qe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: St }),
15152
- Xe && !qe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: Xe })
15194
+ St && !Ge && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: St }),
15195
+ Qe && !Ge && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: Qe })
15153
15196
  ] })
15154
15197
  ] }),
15155
15198
  Y && /* @__PURE__ */ u.jsx("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: Y }),
15156
15199
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
15157
15200
  (a || l) && /* @__PURE__ */ u.jsxs(Qb, { children: [
15158
15201
  /* @__PURE__ */ u.jsx(e0, { asChild: !0, children: /* @__PURE__ */ u.jsx(
15159
- ot,
15202
+ st,
15160
15203
  {
15161
15204
  type: "button",
15162
15205
  size: "icon",
15163
15206
  variant: "outline",
15164
- disabled: F || q,
15207
+ disabled: F || U,
15165
15208
  title: "More input actions",
15166
15209
  className: f.moreButton || "",
15167
15210
  children: /* @__PURE__ */ u.jsx(vm, { size: 16 })
@@ -15180,9 +15223,9 @@ function Ai({
15180
15223
  {
15181
15224
  onClick: () => {
15182
15225
  var G;
15183
- qe || (G = Jn.current) == null || G.click();
15226
+ Ge || (G = Jn.current) == null || G.click();
15184
15227
  },
15185
- className: `cursor-pointer ${qe ? "opacity-60 pointer-events-none" : ""}`,
15228
+ className: `cursor-pointer ${Ge ? "opacity-60 pointer-events-none" : ""}`,
15186
15229
  children: [
15187
15230
  /* @__PURE__ */ u.jsx(wm, { className: "h-4 w-4 mr-2" }),
15188
15231
  " Upload Excel file"
@@ -15196,14 +15239,14 @@ function Ai({
15196
15239
  {
15197
15240
  initialValue: te,
15198
15241
  editingMessageId: P,
15199
- value: ut,
15242
+ value: je,
15200
15243
  onValueChange: ti,
15201
15244
  placeholder: P ? "Edit your message..." : t,
15202
15245
  isStreaming: F,
15203
- disabled: q,
15246
+ disabled: U,
15204
15247
  maxLength: Wo,
15205
15248
  onSend: ie,
15206
- onCancelEdit: Ge,
15249
+ onCancelEdit: Je,
15207
15250
  onStop: B,
15208
15251
  allowEmptySend: ke.length > 0,
15209
15252
  textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${P ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${Y ? "border-red-400" : ""} ${f.textarea || ""}`
@@ -15242,7 +15285,7 @@ var rl = "ScrollArea", [Dp, vk] = Mn(rl), [PC, un] = Dp(rl), Lp = v.forwardRef(
15242
15285
  dir: o,
15243
15286
  scrollHideDelay: s = 600,
15244
15287
  ...i
15245
- } = e, [a, l] = v.useState(null), [c, d] = v.useState(null), [f, p] = v.useState(null), [h, m] = v.useState(null), [x, y] = v.useState(null), [g, w] = v.useState(0), [b, T] = v.useState(0), [C, S] = v.useState(!1), [k, N] = v.useState(!1), E = Ve(t, (O) => l(O)), I = Rs(o);
15288
+ } = e, [a, l] = v.useState(null), [c, d] = v.useState(null), [f, p] = v.useState(null), [h, m] = v.useState(null), [x, y] = v.useState(null), [g, w] = v.useState(0), [b, T] = v.useState(0), [C, S] = v.useState(!1), [k, N] = v.useState(!1), E = Ke(t, (O) => l(O)), I = Rs(o);
15246
15289
  return /* @__PURE__ */ u.jsx(
15247
15290
  PC,
15248
15291
  {
@@ -15287,7 +15330,7 @@ var rl = "ScrollArea", [Dp, vk] = Mn(rl), [PC, un] = Dp(rl), Lp = v.forwardRef(
15287
15330
  Lp.displayName = rl;
15288
15331
  var Fp = "ScrollAreaViewport", $p = v.forwardRef(
15289
15332
  (e, t) => {
15290
- const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = un(Fp, n), a = v.useRef(null), l = Ve(t, a, i.onViewportChange);
15333
+ const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, i = un(Fp, n), a = v.useRef(null), l = Ke(t, a, i.onViewportChange);
15291
15334
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
15292
15335
  /* @__PURE__ */ u.jsx(
15293
15336
  "style",
@@ -15473,7 +15516,7 @@ var OC = v.forwardRef((e, t) => {
15473
15516
  }
15474
15517
  ) : null;
15475
15518
  }), DC = v.forwardRef((e, t) => {
15476
- const { sizes: n, onSizesChange: r, ...o } = e, s = un(In, e.__scopeScrollArea), [i, a] = v.useState(), l = v.useRef(null), c = Ve(t, l, s.onScrollbarXChange);
15519
+ const { sizes: n, onSizesChange: r, ...o } = e, s = un(In, e.__scopeScrollArea), [i, a] = v.useState(), l = v.useRef(null), c = Ke(t, l, s.onScrollbarXChange);
15477
15520
  return v.useEffect(() => {
15478
15521
  l.current && a(getComputedStyle(l.current));
15479
15522
  }, [l]), /* @__PURE__ */ u.jsx(
@@ -15512,7 +15555,7 @@ var OC = v.forwardRef((e, t) => {
15512
15555
  }
15513
15556
  );
15514
15557
  }), LC = v.forwardRef((e, t) => {
15515
- const { sizes: n, onSizesChange: r, ...o } = e, s = un(In, e.__scopeScrollArea), [i, a] = v.useState(), l = v.useRef(null), c = Ve(t, l, s.onScrollbarYChange);
15558
+ const { sizes: n, onSizesChange: r, ...o } = e, s = un(In, e.__scopeScrollArea), [i, a] = v.useState(), l = v.useRef(null), c = Ke(t, l, s.onScrollbarYChange);
15516
15559
  return v.useEffect(() => {
15517
15560
  l.current && a(getComputedStyle(l.current));
15518
15561
  }, [l]), /* @__PURE__ */ u.jsx(
@@ -15564,7 +15607,7 @@ var OC = v.forwardRef((e, t) => {
15564
15607
  onWheelScroll: d,
15565
15608
  onResize: f,
15566
15609
  ...p
15567
- } = e, h = un(In, n), [m, x] = v.useState(null), y = Ve(t, (E) => x(E)), g = v.useRef(null), w = v.useRef(""), b = h.viewport, T = r.content - r.viewport, C = Dt(d), S = Dt(l), k = Xs(f, 10);
15610
+ } = e, h = un(In, n), [m, x] = v.useState(null), y = Ke(t, (E) => x(E)), g = v.useRef(null), w = v.useRef(""), b = h.viewport, T = r.content - r.viewport, C = Dt(d), S = Dt(l), k = Xs(f, 10);
15568
15611
  function N(E) {
15569
15612
  if (g.current) {
15570
15613
  const I = E.clientX - g.current.left, O = E.clientY - g.current.top;
@@ -15612,7 +15655,7 @@ var OC = v.forwardRef((e, t) => {
15612
15655
  }
15613
15656
  ), $C = v.forwardRef(
15614
15657
  (e, t) => {
15615
- const { __scopeScrollArea: n, style: r, ...o } = e, s = un(hs, n), i = Bp(hs, n), { onThumbPositionChange: a } = i, l = Ve(
15658
+ const { __scopeScrollArea: n, style: r, ...o } = e, s = un(hs, n), i = Bp(hs, n), { onThumbPositionChange: a } = i, l = Ke(
15616
15659
  t,
15617
15660
  (f) => i.onThumbChange(f)
15618
15661
  ), c = v.useRef(void 0), d = Xs(() => {
@@ -15792,7 +15835,7 @@ function Kc({
15792
15835
  setCurrentThreadId: h,
15793
15836
  isLoading: m,
15794
15837
  actions: x
15795
- } = xa(), { loadThread: y } = ya(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = ge(Array.isArray(f) ? f : []), S = Je(T.length > 0), k = Je(null), N = Je(0), [E, I] = ge(null), [O, L] = ge(""), [F, j] = ge(!1);
15838
+ } = xa(), { loadThread: y } = ya(), { createThread: g, deleteThread: w, renameThread: b } = x, [T, C] = ge(Array.isArray(f) ? f : []), S = et(T.length > 0), k = et(null), N = et(0), [E, I] = ge(null), [O, L] = ge(""), [F, j] = ge(!1);
15796
15839
  Et(() => {
15797
15840
  const W = Array.isArray(f) ? f : [];
15798
15841
  if (W.length > 0) {
@@ -15806,13 +15849,13 @@ function Kc({
15806
15849
  "[data-radix-scroll-area-viewport]"
15807
15850
  );
15808
15851
  if (!W) return;
15809
- let ee = null, q = null;
15852
+ let ee = null, U = null;
15810
15853
  return ee = requestAnimationFrame(() => {
15811
- q = requestAnimationFrame(() => {
15854
+ U = requestAnimationFrame(() => {
15812
15855
  W.scrollTop = N.current;
15813
15856
  });
15814
15857
  }), () => {
15815
- ee !== null && cancelAnimationFrame(ee), q !== null && cancelAnimationFrame(q);
15858
+ ee !== null && cancelAnimationFrame(ee), U !== null && cancelAnimationFrame(U);
15816
15859
  };
15817
15860
  }, [T]);
15818
15861
  const $ = async (W) => {
@@ -15834,13 +15877,13 @@ function Kc({
15834
15877
  }, B = async (W, ee) => {
15835
15878
  if (ee.stopPropagation(), !!confirm("Delete this thread?")) {
15836
15879
  if (k.current) {
15837
- const q = k.current.querySelector("[data-radix-scroll-area-viewport]");
15838
- q && (N.current = q.scrollTop);
15880
+ const U = k.current.querySelector("[data-radix-scroll-area-viewport]");
15881
+ U && (N.current = U.scrollTop);
15839
15882
  }
15840
15883
  try {
15841
15884
  await w(W), d == null || d(W);
15842
- } catch (q) {
15843
- console.error("Failed to delete thread:", q);
15885
+ } catch (U) {
15886
+ console.error("Failed to delete thread:", U);
15844
15887
  }
15845
15888
  }
15846
15889
  }, D = (W, ee) => {
@@ -15870,7 +15913,7 @@ function Kc({
15870
15913
  };
15871
15914
  return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
15872
15915
  t && /* @__PURE__ */ u.jsx("div", { className: s.header || "flex-shrink-0 p-2 border-b bg-slate-800 border-slate-700 text-slate-100 flex justify-end", children: /* @__PURE__ */ u.jsx(
15873
- ot,
15916
+ st,
15874
15917
  {
15875
15918
  onClick: A,
15876
15919
  disabled: F || m,
@@ -15902,8 +15945,8 @@ function Kc({
15902
15945
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
15903
15946
  /* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: E === W.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (ee) => ee.stopPropagation(), children: [
15904
15947
  /* @__PURE__ */ u.jsx(ps, { value: O, onChange: (ee) => L(ee.target.value), onKeyDown: (ee) => J(ee, W.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15905
- /* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: () => M(W.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ca, { size: 12 }) }),
15906
- /* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: Z, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(vr, { size: 12 }) })
15948
+ /* @__PURE__ */ u.jsx(st, { variant: "ghost", size: "sm", onClick: () => M(W.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ca, { size: 12 }) }),
15949
+ /* @__PURE__ */ u.jsx(st, { variant: "ghost", size: "sm", onClick: Z, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(vr, { size: 12 }) })
15907
15950
  ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
15908
15951
  /* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: Ee(W) }),
15909
15952
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
@@ -15912,9 +15955,9 @@ function Kc({
15912
15955
  ] })
15913
15956
  ] }) }),
15914
15957
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
15915
- r && E !== W.threadId && /* @__PURE__ */ u.jsx(ot, { variant: "ghost", size: "sm", onClick: (ee) => D(W, ee), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Jc, { size: 12 }) }),
15958
+ r && E !== W.threadId && /* @__PURE__ */ u.jsx(st, { variant: "ghost", size: "sm", onClick: (ee) => D(W, ee), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Jc, { size: 12 }) }),
15916
15959
  n && /* @__PURE__ */ u.jsx(
15917
- ot,
15960
+ st,
15918
15961
  {
15919
15962
  variant: "ghost",
15920
15963
  size: "sm",
@@ -16078,7 +16121,7 @@ var Js = "Switch", [ZC, Sk] = Mn(Js), [QC, eT] = ZC(Js), oh = v.forwardRef(
16078
16121
  onCheckedChange: c,
16079
16122
  form: d,
16080
16123
  ...f
16081
- } = e, [p, h] = v.useState(null), m = Ve(t, (b) => h(b)), x = v.useRef(!1), y = p ? d || !!p.closest("form") : !0, [g, w] = Rr({
16124
+ } = e, [p, h] = v.useState(null), m = Ke(t, (b) => h(b)), x = v.useRef(!1), y = p ? d || !!p.closest("form") : !0, [g, w] = Rr({
16082
16125
  prop: o,
16083
16126
  defaultProp: s ?? !1,
16084
16127
  onChange: c,
@@ -16144,7 +16187,7 @@ var tT = "SwitchBubbleInput", ah = v.forwardRef(
16144
16187
  bubbles: r = !0,
16145
16188
  ...o
16146
16189
  }, s) => {
16147
- const i = v.useRef(null), a = Ve(i, s), l = rh(n), c = Xu(t);
16190
+ const i = v.useRef(null), a = Ke(i, s), l = rh(n), c = Xu(t);
16148
16191
  return v.useEffect(() => {
16149
16192
  const d = i.current;
16150
16193
  if (!d) return;
@@ -16317,7 +16360,7 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], cr = "Sele
16317
16360
  dh.displayName = cr;
16318
16361
  var fh = "SelectTrigger", ph = v.forwardRef(
16319
16362
  (e, t) => {
16320
- const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = ei(n), i = Yn(fh, n), a = i.disabled || r, l = Ve(t, i.onTriggerChange), c = Qs(n), d = v.useRef("touch"), [f, p, h] = Lh((x) => {
16363
+ const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = ei(n), i = Yn(fh, n), a = i.disabled || r, l = Ke(t, i.onTriggerChange), c = Qs(n), d = v.useRef("touch"), [f, p, h] = Lh((x) => {
16321
16364
  const y = c().filter((b) => !b.disabled), g = y.find((b) => b.value === i.value), w = Fh(y, x, g);
16322
16365
  w !== void 0 && i.onValueChange(w.value);
16323
16366
  }), m = (x) => {
@@ -16361,7 +16404,7 @@ var fh = "SelectTrigger", ph = v.forwardRef(
16361
16404
  ph.displayName = fh;
16362
16405
  var hh = "SelectValue", mh = v.forwardRef(
16363
16406
  (e, t) => {
16364
- const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, l = Yn(hh, n), { onValueNodeHasChildrenChange: c } = l, d = s !== void 0, f = Ve(t, l.onValueNodeChange);
16407
+ const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, l = Yn(hh, n), { onValueNodeHasChildrenChange: c } = l, d = s !== void 0, f = Ke(t, l.onValueNodeChange);
16365
16408
  return Lt(() => {
16366
16409
  c(d);
16367
16410
  }, [c, d]), /* @__PURE__ */ u.jsx(
@@ -16423,16 +16466,16 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16423
16466
  avoidCollisions: y,
16424
16467
  //
16425
16468
  ...g
16426
- } = e, w = Yn(ur, n), [b, T] = v.useState(null), [C, S] = v.useState(null), k = Ve(t, (q) => T(q)), [N, E] = v.useState(null), [I, O] = v.useState(
16469
+ } = e, w = Yn(ur, n), [b, T] = v.useState(null), [C, S] = v.useState(null), k = Ke(t, (U) => T(U)), [N, E] = v.useState(null), [I, O] = v.useState(
16427
16470
  null
16428
16471
  ), L = Qs(n), [F, j] = v.useState(!1), $ = v.useRef(!1);
16429
16472
  v.useEffect(() => {
16430
16473
  if (b) return Aa(b);
16431
16474
  }, [b]), ba();
16432
16475
  const A = v.useCallback(
16433
- (q) => {
16476
+ (U) => {
16434
16477
  const [P, ...H] = L().map((ne) => ne.ref.current), [te] = H.slice(-1), se = document.activeElement;
16435
- for (const ne of q)
16478
+ for (const ne of U)
16436
16479
  if (ne === se || (ne == null || ne.scrollIntoView({ block: "nearest" }), ne === P && C && (C.scrollTop = 0), ne === te && C && (C.scrollTop = C.scrollHeight), ne == null || ne.focus(), document.activeElement !== se)) return;
16437
16480
  },
16438
16481
  [L, C]
@@ -16446,39 +16489,39 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16446
16489
  const { onOpenChange: D, triggerPointerDownPosRef: M } = w;
16447
16490
  v.useEffect(() => {
16448
16491
  if (b) {
16449
- let q = { x: 0, y: 0 };
16492
+ let U = { x: 0, y: 0 };
16450
16493
  const P = (te) => {
16451
16494
  var se, ne;
16452
- q = {
16495
+ U = {
16453
16496
  x: Math.abs(Math.round(te.pageX) - (((se = M.current) == null ? void 0 : se.x) ?? 0)),
16454
16497
  y: Math.abs(Math.round(te.pageY) - (((ne = M.current) == null ? void 0 : ne.y) ?? 0))
16455
16498
  };
16456
16499
  }, H = (te) => {
16457
- q.x <= 10 && q.y <= 10 ? te.preventDefault() : b.contains(te.target) || D(!1), document.removeEventListener("pointermove", P), M.current = null;
16500
+ U.x <= 10 && U.y <= 10 ? te.preventDefault() : b.contains(te.target) || D(!1), document.removeEventListener("pointermove", P), M.current = null;
16458
16501
  };
16459
16502
  return M.current !== null && (document.addEventListener("pointermove", P), document.addEventListener("pointerup", H, { capture: !0, once: !0 })), () => {
16460
16503
  document.removeEventListener("pointermove", P), document.removeEventListener("pointerup", H, { capture: !0 });
16461
16504
  };
16462
16505
  }
16463
16506
  }, [b, D, M]), v.useEffect(() => {
16464
- const q = () => D(!1);
16465
- return window.addEventListener("blur", q), window.addEventListener("resize", q), () => {
16466
- window.removeEventListener("blur", q), window.removeEventListener("resize", q);
16507
+ const U = () => D(!1);
16508
+ return window.addEventListener("blur", U), window.addEventListener("resize", U), () => {
16509
+ window.removeEventListener("blur", U), window.removeEventListener("resize", U);
16467
16510
  };
16468
16511
  }, [D]);
16469
- const [Z, J] = Lh((q) => {
16470
- const P = L().filter((se) => !se.disabled), H = P.find((se) => se.ref.current === document.activeElement), te = Fh(P, q, H);
16512
+ const [Z, J] = Lh((U) => {
16513
+ const P = L().filter((se) => !se.disabled), H = P.find((se) => se.ref.current === document.activeElement), te = Fh(P, U, H);
16471
16514
  te && setTimeout(() => te.ref.current.focus());
16472
16515
  }), pe = v.useCallback(
16473
- (q, P, H) => {
16516
+ (U, P, H) => {
16474
16517
  const te = !$.current && !H;
16475
- (w.value !== void 0 && w.value === P || te) && (E(q), te && ($.current = !0));
16518
+ (w.value !== void 0 && w.value === P || te) && (E(U), te && ($.current = !0));
16476
16519
  },
16477
16520
  [w.value]
16478
16521
  ), Re = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ee = v.useCallback(
16479
- (q, P, H) => {
16522
+ (U, P, H) => {
16480
16523
  const te = !$.current && !H;
16481
- (w.value !== void 0 && w.value === P || te) && O(q);
16524
+ (w.value !== void 0 && w.value === P || te) && O(U);
16482
16525
  },
16483
16526
  [w.value]
16484
16527
  ), W = r === "popper" ? na : bh, ee = W === na ? {
@@ -16514,12 +16557,12 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16514
16557
  {
16515
16558
  asChild: !0,
16516
16559
  trapped: w.open,
16517
- onMountAutoFocus: (q) => {
16518
- q.preventDefault();
16560
+ onMountAutoFocus: (U) => {
16561
+ U.preventDefault();
16519
16562
  },
16520
- onUnmountAutoFocus: fe(o, (q) => {
16563
+ onUnmountAutoFocus: fe(o, (U) => {
16521
16564
  var P;
16522
- (P = w.trigger) == null || P.focus({ preventScroll: !0 }), q.preventDefault();
16565
+ (P = w.trigger) == null || P.focus({ preventScroll: !0 }), U.preventDefault();
16523
16566
  }),
16524
16567
  children: /* @__PURE__ */ u.jsx(
16525
16568
  Es,
@@ -16528,7 +16571,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16528
16571
  disableOutsidePointerEvents: !0,
16529
16572
  onEscapeKeyDown: s,
16530
16573
  onPointerDownOutside: i,
16531
- onFocusOutside: (q) => q.preventDefault(),
16574
+ onFocusOutside: (U) => U.preventDefault(),
16532
16575
  onDismiss: () => w.onOpenChange(!1),
16533
16576
  children: /* @__PURE__ */ u.jsx(
16534
16577
  W,
@@ -16537,7 +16580,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16537
16580
  id: w.contentId,
16538
16581
  "data-state": w.open ? "open" : "closed",
16539
16582
  dir: w.dir,
16540
- onContextMenu: (q) => q.preventDefault(),
16583
+ onContextMenu: (U) => U.preventDefault(),
16541
16584
  ...g,
16542
16585
  ...ee,
16543
16586
  onPlaced: () => j(!0),
@@ -16550,15 +16593,15 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16550
16593
  outline: "none",
16551
16594
  ...g.style
16552
16595
  },
16553
- onKeyDown: fe(g.onKeyDown, (q) => {
16554
- const P = q.ctrlKey || q.altKey || q.metaKey;
16555
- if (q.key === "Tab" && q.preventDefault(), !P && q.key.length === 1 && J(q.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(q.key)) {
16596
+ onKeyDown: fe(g.onKeyDown, (U) => {
16597
+ const P = U.ctrlKey || U.altKey || U.metaKey;
16598
+ if (U.key === "Tab" && U.preventDefault(), !P && U.key.length === 1 && J(U.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(U.key)) {
16556
16599
  let te = L().filter((se) => !se.disabled).map((se) => se.ref.current);
16557
- if (["ArrowUp", "End"].includes(q.key) && (te = te.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(q.key)) {
16558
- const se = q.target, ne = te.indexOf(se);
16600
+ if (["ArrowUp", "End"].includes(U.key) && (te = te.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(U.key)) {
16601
+ const se = U.target, ne = te.indexOf(se);
16559
16602
  te = te.slice(ne + 1);
16560
16603
  }
16561
- setTimeout(() => A(te)), q.preventDefault();
16604
+ setTimeout(() => A(te)), U.preventDefault();
16562
16605
  }
16563
16606
  })
16564
16607
  }
@@ -16573,11 +16616,11 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16573
16616
  );
16574
16617
  wh.displayName = pT;
16575
16618
  var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
16576
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Yn(ur, n), i = Xn(ur, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = Ve(t, (k) => d(k)), p = Qs(n), h = v.useRef(!1), m = v.useRef(!0), { viewport: x, selectedItem: y, selectedItemText: g, focusSelectedItem: w } = i, b = v.useCallback(() => {
16619
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Yn(ur, n), i = Xn(ur, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = Ke(t, (k) => d(k)), p = Qs(n), h = v.useRef(!1), m = v.useRef(!0), { viewport: x, selectedItem: y, selectedItemText: g, focusSelectedItem: w } = i, b = v.useCallback(() => {
16577
16620
  if (s.trigger && s.valueNode && a && c && x && y && g) {
16578
16621
  const k = s.trigger.getBoundingClientRect(), N = c.getBoundingClientRect(), E = s.valueNode.getBoundingClientRect(), I = g.getBoundingClientRect();
16579
16622
  if (s.dir !== "rtl") {
16580
- const se = I.left - N.left, ne = E.left - se, Me = k.left - ne, Y = k.width + Me, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ne = ta(ne, [
16623
+ const se = I.left - N.left, ne = E.left - se, Le = k.left - ne, Y = k.width + Le, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ne = ta(ne, [
16581
16624
  dn,
16582
16625
  // Prevents the content from going off the starting edge of the
16583
16626
  // viewport. It may still go off the ending edge, but this can be
@@ -16588,31 +16631,31 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
16588
16631
  ]);
16589
16632
  a.style.minWidth = Y + "px", a.style.left = Ne + "px";
16590
16633
  } else {
16591
- const se = N.right - I.right, ne = window.innerWidth - E.right - se, Me = window.innerWidth - k.right - ne, Y = k.width + Me, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ne = ta(ne, [
16634
+ const se = N.right - I.right, ne = window.innerWidth - E.right - se, Le = window.innerWidth - k.right - ne, Y = k.width + Le, de = Math.max(Y, N.width), ke = window.innerWidth - dn, Ne = ta(ne, [
16592
16635
  dn,
16593
16636
  Math.max(dn, ke - de)
16594
16637
  ]);
16595
16638
  a.style.minWidth = Y + "px", a.style.right = Ne + "px";
16596
16639
  }
16597
- const O = p(), L = window.innerHeight - dn * 2, F = x.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), M = $ + A + F + D + B, Z = Math.min(y.offsetHeight * 5, M), J = window.getComputedStyle(x), pe = parseInt(J.paddingTop, 10), Re = parseInt(J.paddingBottom, 10), Ee = k.top + k.height / 2 - dn, W = L - Ee, ee = y.offsetHeight / 2, q = y.offsetTop + ee, P = $ + A + q, H = M - P;
16640
+ const O = p(), L = window.innerHeight - dn * 2, F = x.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), D = parseInt(j.paddingBottom, 10), M = $ + A + F + D + B, Z = Math.min(y.offsetHeight * 5, M), J = window.getComputedStyle(x), pe = parseInt(J.paddingTop, 10), Re = parseInt(J.paddingBottom, 10), Ee = k.top + k.height / 2 - dn, W = L - Ee, ee = y.offsetHeight / 2, U = y.offsetTop + ee, P = $ + A + U, H = M - P;
16598
16641
  if (P <= Ee) {
16599
16642
  const se = O.length > 0 && y === O[O.length - 1].ref.current;
16600
16643
  a.style.bottom = "0px";
16601
- const ne = c.clientHeight - x.offsetTop - x.offsetHeight, Me = Math.max(
16644
+ const ne = c.clientHeight - x.offsetTop - x.offsetHeight, Le = Math.max(
16602
16645
  W,
16603
16646
  ee + // viewport might have padding bottom, include it to avoid a scrollable viewport
16604
16647
  (se ? Re : 0) + ne + B
16605
- ), Y = P + Me;
16648
+ ), Y = P + Le;
16606
16649
  a.style.height = Y + "px";
16607
16650
  } else {
16608
16651
  const se = O.length > 0 && y === O[0].ref.current;
16609
16652
  a.style.top = "0px";
16610
- const Me = Math.max(
16653
+ const Le = Math.max(
16611
16654
  Ee,
16612
16655
  $ + x.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
16613
16656
  (se ? pe : 0) + ee
16614
16657
  ) + H;
16615
- a.style.height = Me + "px", x.scrollTop = P - Ee + x.offsetTop;
16658
+ a.style.height = Le + "px", x.scrollTop = P - Ee + x.offsetTop;
16616
16659
  }
16617
16660
  a.style.margin = `${dn}px 0`, a.style.minHeight = Z + "px", a.style.maxHeight = L + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
16618
16661
  }
@@ -16708,7 +16751,7 @@ var gT = "SelectPopperPosition", na = v.forwardRef((e, t) => {
16708
16751
  na.displayName = gT;
16709
16752
  var [xT, al] = Mr(ur, {}), ra = "SelectViewport", Sh = v.forwardRef(
16710
16753
  (e, t) => {
16711
- const { __scopeSelect: n, nonce: r, ...o } = e, s = Xn(ra, n), i = al(ra, n), a = Ve(t, s.onViewportChange), l = v.useRef(0);
16754
+ const { __scopeSelect: n, nonce: r, ...o } = e, s = Xn(ra, n), i = al(ra, n), a = Ke(t, s.onViewportChange), l = v.useRef(0);
16712
16755
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
16713
16756
  /* @__PURE__ */ u.jsx(
16714
16757
  "style",
@@ -16781,7 +16824,7 @@ var gs = "SelectItem", [bT, Rh] = Mr(gs), Eh = v.forwardRef(
16781
16824
  disabled: o = !1,
16782
16825
  textValue: s,
16783
16826
  ...i
16784
- } = e, a = Yn(gs, n), l = Xn(gs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [p, h] = v.useState(!1), m = Ve(
16827
+ } = e, a = Yn(gs, n), l = Xn(gs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [p, h] = v.useState(!1), m = Ke(
16785
16828
  t,
16786
16829
  (w) => {
16787
16830
  var b;
@@ -16859,7 +16902,7 @@ var gs = "SelectItem", [bT, Rh] = Mr(gs), Eh = v.forwardRef(
16859
16902
  Eh.displayName = gs;
16860
16903
  var Hr = "SelectItemText", Ih = v.forwardRef(
16861
16904
  (e, t) => {
16862
- const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Yn(Hr, n), a = Xn(Hr, n), l = Rh(Hr, n), c = uT(Hr, n), [d, f] = v.useState(null), p = Ve(
16905
+ const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Yn(Hr, n), a = Xn(Hr, n), l = Rh(Hr, n), c = uT(Hr, n), [d, f] = v.useState(null), p = Ke(
16863
16906
  t,
16864
16907
  (g) => f(g),
16865
16908
  l.onItemTextChange,
@@ -16886,7 +16929,7 @@ var Nh = "SelectItemIndicator", Ah = v.forwardRef(
16886
16929
  );
16887
16930
  Ah.displayName = Nh;
16888
16931
  var oa = "SelectScrollUpButton", jh = v.forwardRef((e, t) => {
16889
- const n = Xn(oa, e.__scopeSelect), r = al(oa, e.__scopeSelect), [o, s] = v.useState(!1), i = Ve(t, r.onScrollButtonChange);
16932
+ const n = Xn(oa, e.__scopeSelect), r = al(oa, e.__scopeSelect), [o, s] = v.useState(!1), i = Ke(t, r.onScrollButtonChange);
16890
16933
  return Lt(() => {
16891
16934
  if (n.viewport && n.isPositioned) {
16892
16935
  let a = function() {
@@ -16910,7 +16953,7 @@ var oa = "SelectScrollUpButton", jh = v.forwardRef((e, t) => {
16910
16953
  });
16911
16954
  jh.displayName = oa;
16912
16955
  var sa = "SelectScrollDownButton", _h = v.forwardRef((e, t) => {
16913
- const n = Xn(sa, e.__scopeSelect), r = al(sa, e.__scopeSelect), [o, s] = v.useState(!1), i = Ve(t, r.onScrollButtonChange);
16956
+ const n = Xn(sa, e.__scopeSelect), r = al(sa, e.__scopeSelect), [o, s] = v.useState(!1), i = Ke(t, r.onScrollButtonChange);
16914
16957
  return Lt(() => {
16915
16958
  if (n.viewport && n.isPositioned) {
16916
16959
  let a = function() {
@@ -16976,7 +17019,7 @@ var ia = "SelectArrow", CT = v.forwardRef(
16976
17019
  CT.displayName = ia;
16977
17020
  var TT = "SelectBubbleInput", Mh = v.forwardRef(
16978
17021
  ({ __scopeSelect: e, value: t, ...n }, r) => {
16979
- const o = v.useRef(null), s = Ve(r, o), i = rh(t);
17022
+ const o = v.useRef(null), s = Ke(r, o), i = rh(t);
16980
17023
  return v.useEffect(() => {
16981
17024
  const a = o.current;
16982
17025
  if (!a) return;
@@ -17301,7 +17344,7 @@ function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
17301
17344
  }
17302
17345
  };
17303
17346
  return /* @__PURE__ */ u.jsxs(FT, { open: r, onOpenChange: o, children: [
17304
- /* @__PURE__ */ u.jsx($T, { asChild: !0, children: /* @__PURE__ */ u.jsxs(ot, { variant: "outline", size: "sm", className: n, children: [
17347
+ /* @__PURE__ */ u.jsx($T, { asChild: !0, children: /* @__PURE__ */ u.jsxs(st, { variant: "outline", size: "sm", className: n, children: [
17305
17348
  /* @__PURE__ */ u.jsx(km, { className: "h-4 w-4 mr-2" }),
17306
17349
  "Settings",
17307
17350
  c && /* @__PURE__ */ u.jsx(Zf, { variant: "destructive", className: "ml-2 h-4 w-4 p-0" })
@@ -17333,7 +17376,7 @@ function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
17333
17376
  placeholder: "http://localhost:8000/api"
17334
17377
  }
17335
17378
  ),
17336
- /* @__PURE__ */ u.jsx(ot, { variant: "outline", onClick: x, children: "Test" })
17379
+ /* @__PURE__ */ u.jsx(st, { variant: "outline", onClick: x, children: "Test" })
17337
17380
  ] })
17338
17381
  ] }),
17339
17382
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
@@ -17367,7 +17410,7 @@ function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
17367
17410
  }
17368
17411
  ),
17369
17412
  /* @__PURE__ */ u.jsx(
17370
- ot,
17413
+ st,
17371
17414
  {
17372
17415
  variant: "outline",
17373
17416
  size: "icon",
@@ -17535,13 +17578,13 @@ function Tk({ settings: e, onSettingsChange: t, className: n = "" }) {
17535
17578
  ] })
17536
17579
  ] }),
17537
17580
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between pt-6 border-t", children: [
17538
- /* @__PURE__ */ u.jsxs(ot, { variant: "outline", onClick: h, children: [
17581
+ /* @__PURE__ */ u.jsxs(st, { variant: "outline", onClick: h, children: [
17539
17582
  /* @__PURE__ */ u.jsx(_i, { className: "h-4 w-4 mr-2" }),
17540
17583
  "Reset"
17541
17584
  ] }),
17542
17585
  /* @__PURE__ */ u.jsxs("div", { className: "flex gap-2", children: [
17543
- /* @__PURE__ */ u.jsx(ot, { variant: "outline", onClick: m, children: "Cancel" }),
17544
- /* @__PURE__ */ u.jsxs(ot, { onClick: p, disabled: !c, children: [
17586
+ /* @__PURE__ */ u.jsx(st, { variant: "outline", onClick: m, children: "Cancel" }),
17587
+ /* @__PURE__ */ u.jsxs(st, { onClick: p, disabled: !c, children: [
17545
17588
  /* @__PURE__ */ u.jsx(jm, { className: "h-4 w-4 mr-2" }),
17546
17589
  "Save Changes"
17547
17590
  ] })