teodor-new-chat-ui 4.3.303 → 4.3.304

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 Jh = Object.defineProperty;
2
2
  var Zh = (e, t, n) => t in e ? Jh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var ol = (e, t, n) => Zh(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as v from "react";
5
- import B, { createContext as so, useContext as ps, useMemo as rt, useState as we, useRef as Ue, useCallback as Me, useEffect as Et, useReducer as Qh, useLayoutEffect as em, createElement as jo, useImperativeHandle as tm } from "react";
5
+ import B, { createContext as so, useContext as ps, useMemo as rt, useState as we, useRef as Ue, useCallback as Me, useEffect as Rt, useReducer as Qh, useLayoutEffect as em, createElement as jo, useImperativeHandle as tm } from "react";
6
6
  import { Square as nm, Send as rm, ChevronRight as Vc, Check as sa, Circle as om, X as hr, ExternalLink as sm, Download as im, Image as am, FileText as sl, Loader as ia, Bot as ti, Wrench as lm, User as cm, Paperclip as Ei, ChevronUp as aa, ChevronDown as hs, ChevronLeft as um, Copy as il, Edit as al, RotateCcw as Ii, Info as dm, Loader2 as Lr, Edit3 as Kc, Plus as fm, FileSpreadsheet as pm, MessageSquarePlus as hm, MessageSquare as mm, Calendar as gm, Trash2 as xm, Settings as ym, Server as vm, EyeOff as bm, Eye as wm, Layout as Sm, MessageCircle as Cm, Save as Tm } from "lucide-react";
7
7
  import { Slot as km, createSlot as vr } from "@radix-ui/react-slot";
8
8
  import { cva as ms } from "class-variance-authority";
@@ -91,7 +91,7 @@ function Nm() {
91
91
  function M(R) {
92
92
  return R.displayName || "Context";
93
93
  }
94
- function $(R) {
94
+ function F(R) {
95
95
  if (R == null)
96
96
  return null;
97
97
  if (typeof R.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof R == "function")
@@ -124,11 +124,11 @@ function Nm() {
124
124
  return j(R, R.render, "ForwardRef");
125
125
  case f:
126
126
  var Te = R.displayName || null;
127
- return Te !== null ? Te : $(R.type) || "Memo";
127
+ return Te !== null ? Te : F(R.type) || "Memo";
128
128
  case p: {
129
129
  var Qe = R, lt = Qe._payload, Ve = Qe._init;
130
130
  try {
131
- return $(Ve(lt));
131
+ return F(Ve(lt));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -136,13 +136,13 @@ function Nm() {
136
136
  }
137
137
  return null;
138
138
  }
139
- var I = Object.assign, F = 0, A, K, z, _, X, J, se;
139
+ var I = Object.assign, $ = 0, A, K, z, _, X, J, se;
140
140
  function ye() {
141
141
  }
142
142
  ye.__reactDisabledLog = !0;
143
143
  function Pe() {
144
144
  {
145
- if (F === 0) {
145
+ if ($ === 0) {
146
146
  A = console.log, K = console.info, z = console.warn, _ = console.error, X = console.group, J = console.groupCollapsed, se = console.groupEnd;
147
147
  var R = {
148
148
  configurable: !0,
@@ -160,12 +160,12 @@ function Nm() {
160
160
  groupEnd: R
161
161
  });
162
162
  }
163
- F++;
163
+ $++;
164
164
  }
165
165
  }
166
166
  function q() {
167
167
  {
168
- if (F--, F === 0) {
168
+ if ($--, $ === 0) {
169
169
  var R = {
170
170
  configurable: !0,
171
171
  enumerable: !0,
@@ -195,7 +195,7 @@ function Nm() {
195
195
  })
196
196
  });
197
197
  }
198
- F < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
198
+ $ < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
199
199
  }
200
200
  }
201
201
  var H = g.ReactCurrentDispatcher, Z;
@@ -266,19 +266,19 @@ function Nm() {
266
266
  } catch (ae) {
267
267
  if (ae && Te && typeof ae.stack == "string") {
268
268
  for (var ze = ae.stack.split(`
269
- `), Ot = Te.stack.split(`
270
- `), Ct = ze.length - 1, kt = Ot.length - 1; Ct >= 1 && kt >= 0 && ze[Ct] !== Ot[kt]; )
271
- kt--;
272
- for (; Ct >= 1 && kt >= 0; Ct--, kt--)
273
- if (ze[Ct] !== Ot[kt]) {
274
- if (Ct !== 1 || kt !== 1)
269
+ `), Pt = Te.stack.split(`
270
+ `), Ct = ze.length - 1, Tt = Pt.length - 1; Ct >= 1 && Tt >= 0 && ze[Ct] !== Pt[Tt]; )
271
+ Tt--;
272
+ for (; Ct >= 1 && Tt >= 0; Ct--, Tt--)
273
+ if (ze[Ct] !== Pt[Tt]) {
274
+ if (Ct !== 1 || Tt !== 1)
275
275
  do
276
- if (Ct--, kt--, kt < 0 || ze[Ct] !== Ot[kt]) {
276
+ if (Ct--, Tt--, Tt < 0 || ze[Ct] !== Pt[Tt]) {
277
277
  var Wt = `
278
278
  ` + ze[Ct].replace(" at new ", " at ");
279
279
  return R.displayName && Wt.includes("<anonymous>") && (Wt = Wt.replace("<anonymous>", R.displayName)), typeof R == "function" && Q.set(R, Wt), Wt;
280
280
  }
281
- while (Ct >= 1 && kt >= 0);
281
+ while (Ct >= 1 && Tt >= 0);
282
282
  break;
283
283
  }
284
284
  }
@@ -295,7 +295,7 @@ function Nm() {
295
295
  var U = R.prototype;
296
296
  return !!(U && U.isReactComponent);
297
297
  }
298
- function $e(R, U, ce) {
298
+ function Fe(R, U, ce) {
299
299
  if (R == null)
300
300
  return "";
301
301
  if (typeof R == "function")
@@ -313,11 +313,11 @@ function Nm() {
313
313
  case l:
314
314
  return Ee(R.render);
315
315
  case f:
316
- return $e(R.type, U, ce);
316
+ return Fe(R.type, U, ce);
317
317
  case p: {
318
318
  var Te = R, Qe = Te._payload, lt = Te._init;
319
319
  try {
320
- return $e(lt(Qe), U, ce);
320
+ return Fe(lt(Qe), U, ce);
321
321
  } catch {
322
322
  }
323
323
  }
@@ -327,7 +327,7 @@ function Nm() {
327
327
  var Ze = Object.prototype.hasOwnProperty, ie = {}, ve = g.ReactDebugCurrentFrame;
328
328
  function Ie(R) {
329
329
  if (R) {
330
- var U = R._owner, ce = $e(R.type, R._source, U ? U.type : null);
330
+ var U = R._owner, ce = Fe(R.type, R._source, U ? U.type : null);
331
331
  ve.setExtraStackFrame(ce);
332
332
  } else
333
333
  ve.setExtraStackFrame(null);
@@ -340,8 +340,8 @@ function Nm() {
340
340
  var ze = void 0;
341
341
  try {
342
342
  if (typeof R[Ve] != "function") {
343
- var Ot = Error((Te || "React class") + ": " + ce + " type `" + Ve + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ve] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
- throw Ot.name = "Invariant Violation", Ot;
343
+ var Pt = Error((Te || "React class") + ": " + ce + " type `" + Ve + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ve] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
+ throw Pt.name = "Invariant Violation", Pt;
345
345
  }
346
346
  ze = R[Ve](U, Ve, Te, ce, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (Ct) {
@@ -355,7 +355,7 @@ function Nm() {
355
355
  function Ye(R) {
356
356
  return We(R);
357
357
  }
358
- function Fe(R) {
358
+ function $e(R) {
359
359
  {
360
360
  var U = typeof Symbol == "function" && Symbol.toStringTag, ce = U && R[Symbol.toStringTag] || R.constructor.name || "Object";
361
361
  return ce;
@@ -371,9 +371,9 @@ function Nm() {
371
371
  function tt(R) {
372
372
  return "" + R;
373
373
  }
374
- function Nt(R) {
374
+ function It(R) {
375
375
  if (He(R))
376
- return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Fe(R)), tt(R);
376
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", $e(R)), tt(R);
377
377
  }
378
378
  var xt = g.ReactCurrentOwner, dt = {
379
379
  key: !0,
@@ -389,7 +389,7 @@ function Nm() {
389
389
  }
390
390
  return R.ref !== void 0;
391
391
  }
392
- function _t(R) {
392
+ function At(R) {
393
393
  if (Ze.call(R, "key")) {
394
394
  var U = Object.getOwnPropertyDescriptor(R, "key").get;
395
395
  if (U && U.isReactWarning)
@@ -400,7 +400,7 @@ function Nm() {
400
400
  function Xe(R, U) {
401
401
  typeof R.ref == "string" && xt.current;
402
402
  }
403
- function Pt(R, U) {
403
+ function jt(R, U) {
404
404
  {
405
405
  var ce = function() {
406
406
  ft || (ft = !0, b("%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)", U));
@@ -453,8 +453,8 @@ function Nm() {
453
453
  };
454
454
  function ot(R, U, ce, Te, Qe) {
455
455
  {
456
- var lt, Ve = {}, ze = null, Ot = null;
457
- ce !== void 0 && (Nt(ce), ze = "" + ce), _t(U) && (Nt(U.key), ze = "" + U.key), yt(U) && (Ot = U.ref, Xe(U, Qe));
456
+ var lt, Ve = {}, ze = null, Pt = null;
457
+ ce !== void 0 && (It(ce), ze = "" + ce), At(U) && (It(U.key), ze = "" + U.key), yt(U) && (Pt = U.ref, Xe(U, Qe));
458
458
  for (lt in U)
459
459
  Ze.call(U, lt) && !dt.hasOwnProperty(lt) && (Ve[lt] = U[lt]);
460
460
  if (R && R.defaultProps) {
@@ -462,17 +462,17 @@ function Nm() {
462
462
  for (lt in Ct)
463
463
  Ve[lt] === void 0 && (Ve[lt] = Ct[lt]);
464
464
  }
465
- if (ze || Ot) {
466
- var kt = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
- ze && Pt(Ve, kt), Ot && mn(Ve, kt);
465
+ if (ze || Pt) {
466
+ var Tt = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
+ ze && jt(Ve, Tt), Pt && mn(Ve, Tt);
468
468
  }
469
- return nt(R, ze, Ot, Qe, Te, xt.current, Ve);
469
+ return nt(R, ze, Pt, Qe, Te, xt.current, Ve);
470
470
  }
471
471
  }
472
472
  var St = g.ReactCurrentOwner, V = g.ReactDebugCurrentFrame;
473
473
  function le(R) {
474
474
  if (R) {
475
- var U = R._owner, ce = $e(R.type, R._source, U ? U.type : null);
475
+ var U = R._owner, ce = Fe(R.type, R._source, U ? U.type : null);
476
476
  V.setExtraStackFrame(ce);
477
477
  } else
478
478
  V.setExtraStackFrame(null);
@@ -485,7 +485,7 @@ function Nm() {
485
485
  function Y() {
486
486
  {
487
487
  if (St.current) {
488
- var R = $(St.current.type);
488
+ var R = F(St.current.type);
489
489
  if (R)
490
490
  return `
491
491
 
@@ -520,7 +520,7 @@ Check the top-level render call using <` + ce + ">.");
520
520
  return;
521
521
  Oe[ce] = !0;
522
522
  var Te = "";
523
- R && R._owner && R._owner !== St.current && (Te = " It was passed a child from " + $(R._owner.type) + "."), le(R), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ce, Te), le(null);
523
+ R && R._owner && R._owner !== St.current && (Te = " It was passed a child from " + F(R._owner.type) + "."), le(R), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ce, Te), le(null);
524
524
  }
525
525
  }
526
526
  function ge(R, U) {
@@ -557,11 +557,11 @@ Check the top-level render call using <` + ce + ">.");
557
557
  else
558
558
  return;
559
559
  if (ce) {
560
- var Te = $(U);
560
+ var Te = F(U);
561
561
  Ne(ce, R.props, "prop", Te, R);
562
562
  } else if (U.PropTypes !== void 0 && !Ce) {
563
563
  Ce = !0;
564
- var Qe = $(U);
564
+ var Qe = F(U);
565
565
  b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Qe || "Unknown");
566
566
  }
567
567
  typeof U.getDefaultProps == "function" && !U.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
@@ -586,14 +586,14 @@ Check the top-level render call using <` + ce + ">.");
586
586
  if (!Ve) {
587
587
  var ze = "";
588
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
- var Ot = ne();
590
- Ot ? ze += Ot : ze += Y();
589
+ var Pt = ne();
590
+ Pt ? ze += Pt : ze += Y();
591
591
  var Ct;
592
- R === null ? Ct = "null" : Ye(R) ? Ct = "array" : R !== void 0 && R.$$typeof === t ? (Ct = "<" + ($(R.type) || "Unknown") + " />", ze = " Did you accidentally export a JSX literal instead of a component?") : Ct = typeof R, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Ct, ze);
592
+ R === null ? Ct = "null" : Ye(R) ? Ct = "array" : R !== void 0 && R.$$typeof === t ? (Ct = "<" + (F(R.type) || "Unknown") + " />", ze = " Did you accidentally export a JSX literal instead of a component?") : Ct = typeof R, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Ct, ze);
593
593
  }
594
- var kt = ot(R, U, ce, Qe, lt);
595
- if (kt == null)
596
- return kt;
594
+ var Tt = ot(R, U, ce, Qe, lt);
595
+ if (Tt == null)
596
+ return Tt;
597
597
  if (Ve) {
598
598
  var Wt = U.children;
599
599
  if (Wt !== void 0)
@@ -608,7 +608,7 @@ Check the top-level render call using <` + ce + ">.");
608
608
  ge(Wt, R);
609
609
  }
610
610
  if (Ze.call(U, "key")) {
611
- var fe = $(R), ae = Object.keys(U).filter(function(vt) {
611
+ var fe = F(R), ae = Object.keys(U).filter(function(vt) {
612
612
  return vt !== "key";
613
613
  }), _e = ae.length > 0 ? "{key: someKey, " + ae.join(": ..., ") + ": ...}" : "{key: someKey}";
614
614
  if (!yo[fe + _e]) {
@@ -621,7 +621,7 @@ React keys must be passed directly to JSX without using spread:
621
621
  <%s key={someKey} {...props} />`, _e, fe, ht, fe), yo[fe + _e] = !0;
622
622
  }
623
623
  }
624
- return R === r ? Rn(kt) : at(kt), kt;
624
+ return R === r ? Rn(Tt) : at(Tt), Tt;
625
625
  }
626
626
  }
627
627
  function Js(R, U, ce) {
@@ -666,7 +666,7 @@ const jm = vs("string"), Vt = vs("function"), Jc = vs("number"), ao = (e) => e !
666
666
  } catch {
667
667
  return !1;
668
668
  }
669
- }, Mm = pn("Date"), Dm = pn("File"), Lm = pn("Blob"), $m = pn("FileList"), Fm = (e) => ao(e) && Vt(e.pipe), zm = (e) => {
669
+ }, Mm = pn("Date"), Dm = pn("File"), Lm = pn("Blob"), Fm = pn("FileList"), $m = (e) => ao(e) && Vt(e.pipe), zm = (e) => {
670
670
  let t;
671
671
  return e && (typeof FormData == "function" && e instanceof FormData || Vt(e.append) && ((t = ys(e)) === "formdata" || // detect form-data instance
672
672
  t === "object" && Vt(e.toString) && e.toString() === "[object FormData]"));
@@ -836,10 +836,10 @@ const ug = (e) => {
836
836
  isBlob: Lm,
837
837
  isRegExp: og,
838
838
  isFunction: Vt,
839
- isStream: Fm,
839
+ isStream: $m,
840
840
  isURLSearchParams: Bm,
841
841
  isTypedArray: Qm,
842
- isFileList: $m,
842
+ isFileList: Fm,
843
843
  forEach: lo,
844
844
  merge: Ai,
845
845
  extend: qm,
@@ -1128,14 +1128,14 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", kg
1128
1128
  hasStandardBrowserWebWorkerEnv: Tg,
1129
1129
  navigator: ji,
1130
1130
  origin: kg
1131
- }, Symbol.toStringTag, { value: "Module" })), $t = {
1131
+ }, Symbol.toStringTag, { value: "Module" })), Ft = {
1132
1132
  ...Rg,
1133
1133
  ...Sg
1134
1134
  };
1135
1135
  function Eg(e, t) {
1136
- return bs(e, new $t.classes.URLSearchParams(), {
1136
+ return bs(e, new Ft.classes.URLSearchParams(), {
1137
1137
  visitor: function(n, r, o, s) {
1138
- return $t.isNode && O.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1138
+ return Ft.isNode && O.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1139
1139
  },
1140
1140
  ...t
1141
1141
  });
@@ -1230,8 +1230,8 @@ const co = {
1230
1230
  maxContentLength: -1,
1231
1231
  maxBodyLength: -1,
1232
1232
  env: {
1233
- FormData: $t.classes.FormData,
1234
- Blob: $t.classes.Blob
1233
+ FormData: Ft.classes.FormData,
1234
+ Blob: Ft.classes.Blob
1235
1235
  },
1236
1236
  validateStatus: function(t) {
1237
1237
  return t >= 200 && t < 300;
@@ -1477,7 +1477,7 @@ function Lg(e) {
1477
1477
  const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
1478
1478
  return t && t[1] || "";
1479
1479
  }
1480
- function $g(e, t) {
1480
+ function Fg(e, t) {
1481
1481
  e = e || 10;
1482
1482
  const n = new Array(e), r = new Array(e);
1483
1483
  let o = 0, s = 0, i;
@@ -1493,7 +1493,7 @@ function $g(e, t) {
1493
1493
  return h ? Math.round(p * 1e3 / h) : void 0;
1494
1494
  };
1495
1495
  }
1496
- function Fg(e, t) {
1496
+ function $g(e, t) {
1497
1497
  let n = 0, r = 1e3 / t, o, s;
1498
1498
  const i = (c, d = Date.now()) => {
1499
1499
  n = d, o = null, s && (clearTimeout(s), s = null), e(...c);
@@ -1507,8 +1507,8 @@ function Fg(e, t) {
1507
1507
  }
1508
1508
  const Ko = (e, t, n = 3) => {
1509
1509
  let r = 0;
1510
- const o = $g(50, 250);
1511
- return Fg((s) => {
1510
+ const o = Fg(50, 250);
1511
+ return $g((s) => {
1512
1512
  const i = s.loaded, a = s.lengthComputable ? s.total : void 0, l = i - r, c = o(l), d = i <= a;
1513
1513
  r = i;
1514
1514
  const f = {
@@ -1531,10 +1531,10 @@ const Ko = (e, t, n = 3) => {
1531
1531
  total: e,
1532
1532
  loaded: r
1533
1533
  }), t[1]];
1534
- }, gl = (e) => (...t) => O.asap(() => e(...t)), zg = $t.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, $t.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1535
- new URL($t.origin),
1536
- $t.navigator && /(msie|trident)/i.test($t.navigator.userAgent)
1537
- ) : () => !0, Bg = $t.hasStandardBrowserEnv ? (
1534
+ }, gl = (e) => (...t) => O.asap(() => e(...t)), zg = Ft.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, Ft.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1535
+ new URL(Ft.origin),
1536
+ Ft.navigator && /(msie|trident)/i.test(Ft.navigator.userAgent)
1537
+ ) : () => !0, Bg = Ft.hasStandardBrowserEnv ? (
1538
1538
  // Standard browser envs support document.cookie
1539
1539
  {
1540
1540
  write(e, t, n, r, o, s) {
@@ -1643,7 +1643,7 @@ const fu = (e) => {
1643
1643
  "Authorization",
1644
1644
  "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1645
1645
  ), O.isFormData(n)) {
1646
- if ($t.hasStandardBrowserEnv || $t.hasStandardBrowserWebWorkerEnv)
1646
+ if (Ft.hasStandardBrowserEnv || Ft.hasStandardBrowserWebWorkerEnv)
1647
1647
  i.setContentType(void 0);
1648
1648
  else if (O.isFunction(n.getHeaders)) {
1649
1649
  const l = n.getHeaders(), c = ["content-type", "content-length"];
@@ -1652,7 +1652,7 @@ const fu = (e) => {
1652
1652
  });
1653
1653
  }
1654
1654
  }
1655
- if ($t.hasStandardBrowserEnv && (r && O.isFunction(r) && (r = r(t)), r || r !== !1 && zg(t.url))) {
1655
+ if (Ft.hasStandardBrowserEnv && (r && O.isFunction(r) && (r = r(t)), r || r !== !1 && zg(t.url))) {
1656
1656
  const l = o && s && Bg.read(s);
1657
1657
  l && i.set(o, l);
1658
1658
  }
@@ -1709,7 +1709,7 @@ const fu = (e) => {
1709
1709
  y && (r(!w || w.type ? new kr(null, e, y) : w), y.abort(), y = null);
1710
1710
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
1711
1711
  const b = Lg(o.url);
1712
- if (b && $t.protocols.indexOf(b) === -1) {
1712
+ if (b && Ft.protocols.indexOf(b) === -1) {
1713
1713
  r(new De("Unsupported protocol " + b + ":", De.ERR_BAD_REQUEST, e));
1714
1714
  return;
1715
1715
  }
@@ -1816,7 +1816,7 @@ const fu = (e) => {
1816
1816
  return !1;
1817
1817
  const a = o && vo(bl), l = o && (typeof wl == "function" ? /* @__PURE__ */ ((x) => (m) => x.encode(m))(new wl()) : async (x) => new Uint8Array(await new n(x).arrayBuffer())), c = s && a && Sl(() => {
1818
1818
  let x = !1;
1819
- const m = new n($t.origin, {
1819
+ const m = new n(Ft.origin, {
1820
1820
  body: new bl(),
1821
1821
  method: "POST",
1822
1822
  get duplex() {
@@ -1841,7 +1841,7 @@ const fu = (e) => {
1841
1841
  if (O.isBlob(x))
1842
1842
  return x.size;
1843
1843
  if (O.isSpecCompliantForm(x))
1844
- return (await new n($t.origin, {
1844
+ return (await new n(Ft.origin, {
1845
1845
  method: "POST",
1846
1846
  body: x
1847
1847
  }).arrayBuffer()).byteLength;
@@ -1869,13 +1869,13 @@ const fu = (e) => {
1869
1869
  fetchOptions: L
1870
1870
  } = fu(x), j = t || fetch;
1871
1871
  k = k ? (k + "").toLowerCase() : "text";
1872
- let M = Kg([b, w && w.toAbortSignal()], T), $ = null;
1872
+ let M = Kg([b, w && w.toAbortSignal()], T), F = null;
1873
1873
  const I = M && M.unsubscribe && (() => {
1874
1874
  M.unsubscribe();
1875
1875
  });
1876
- let F;
1876
+ let $;
1877
1877
  try {
1878
- if (C && c && y !== "get" && y !== "head" && (F = await h(E, g)) !== 0) {
1878
+ if (C && c && y !== "get" && y !== "head" && ($ = await h(E, g)) !== 0) {
1879
1879
  let J = new n(m, {
1880
1880
  method: "POST",
1881
1881
  body: g,
@@ -1883,7 +1883,7 @@ const fu = (e) => {
1883
1883
  }), se;
1884
1884
  if (O.isFormData(g) && (se = J.headers.get("content-type")) && E.setContentType(se), J.body) {
1885
1885
  const [ye, Pe] = ml(
1886
- F,
1886
+ $,
1887
1887
  Ko(gl(C))
1888
1888
  );
1889
1889
  g = yl(J.body, vl, ye, Pe);
@@ -1899,8 +1899,8 @@ const fu = (e) => {
1899
1899
  duplex: "half",
1900
1900
  credentials: A ? N : void 0
1901
1901
  };
1902
- $ = s && new n(m, K);
1903
- let z = await (s ? j($, L) : j(m, K));
1902
+ F = s && new n(m, K);
1903
+ let z = await (s ? j(F, L) : j(m, K));
1904
1904
  const _ = d && (k === "stream" || k === "response");
1905
1905
  if (d && (S || _ && I)) {
1906
1906
  const J = {};
@@ -1927,16 +1927,16 @@ const fu = (e) => {
1927
1927
  status: z.status,
1928
1928
  statusText: z.statusText,
1929
1929
  config: x,
1930
- request: $
1930
+ request: F
1931
1931
  });
1932
1932
  });
1933
1933
  } catch (A) {
1934
1934
  throw I && I(), A && A.name === "TypeError" && /Load failed|fetch/i.test(A.message) ? Object.assign(
1935
- new De("Network Error", De.ERR_NETWORK, x, $),
1935
+ new De("Network Error", De.ERR_NETWORK, x, F),
1936
1936
  {
1937
1937
  cause: A.cause || A
1938
1938
  }
1939
- ) : De.from(A, A && A.code, x, $);
1939
+ ) : De.from(A, A && A.code, x, F);
1940
1940
  }
1941
1941
  };
1942
1942
  }, Zg = /* @__PURE__ */ new Map(), pu = (e) => {
@@ -2349,26 +2349,26 @@ function xu(e) {
2349
2349
  return xu(Jn(e, o));
2350
2350
  }, n;
2351
2351
  }
2352
- const It = xu(co);
2353
- It.Axios = Yn;
2354
- It.CanceledError = kr;
2355
- It.CancelToken = tx;
2356
- It.isCancel = cu;
2357
- It.VERSION = mu;
2358
- It.toFormData = bs;
2359
- It.AxiosError = De;
2360
- It.Cancel = It.CanceledError;
2361
- It.all = function(t) {
2352
+ const Et = xu(co);
2353
+ Et.Axios = Yn;
2354
+ Et.CanceledError = kr;
2355
+ Et.CancelToken = tx;
2356
+ Et.isCancel = cu;
2357
+ Et.VERSION = mu;
2358
+ Et.toFormData = bs;
2359
+ Et.AxiosError = De;
2360
+ Et.Cancel = Et.CanceledError;
2361
+ Et.all = function(t) {
2362
2362
  return Promise.all(t);
2363
2363
  };
2364
- It.spread = nx;
2365
- It.isAxiosError = rx;
2366
- It.mergeConfig = Jn;
2367
- It.AxiosHeaders = Kt;
2368
- It.formToJSON = (e) => lu(O.isHTMLForm(e) ? new FormData(e) : e);
2369
- It.getAdapter = hu.getAdapter;
2370
- It.HttpStatusCode = Oi;
2371
- It.default = It;
2364
+ Et.spread = nx;
2365
+ Et.isAxiosError = rx;
2366
+ Et.mergeConfig = Jn;
2367
+ Et.AxiosHeaders = Kt;
2368
+ Et.formToJSON = (e) => lu(O.isHTMLForm(e) ? new FormData(e) : e);
2369
+ Et.getAdapter = hu.getAdapter;
2370
+ Et.HttpStatusCode = Oi;
2371
+ Et.default = Et;
2372
2372
  const {
2373
2373
  Axios: ck,
2374
2374
  AxiosError: uk,
@@ -2386,7 +2386,7 @@ const {
2386
2386
  formToJSON: Sk,
2387
2387
  getAdapter: Ck,
2388
2388
  mergeConfig: Tk
2389
- } = It, Rl = typeof window < "u" ? window.__API_BASE_URL__ : void 0, El = Rl ? An(Rl) : void 0;
2389
+ } = Et, Rl = typeof window < "u" ? window.__API_BASE_URL__ : void 0, El = Rl ? An(Rl) : void 0;
2390
2390
  function An(e) {
2391
2391
  const n = (e != null && e.trim() ? e.trim() : "/api/chat").replace(/\/+$/, "");
2392
2392
  return n ? n.endsWith("/chat") ? n : `${n}/chat` : "/api/chat";
@@ -2402,7 +2402,7 @@ function Di(e) {
2402
2402
  function sx(e) {
2403
2403
  return Mi.add(e), () => Mi.delete(e);
2404
2404
  }
2405
- const ix = 3e4, ax = 9e4, rn = It.create({
2405
+ const ix = 3e4, ax = 9e4, rn = Et.create({
2406
2406
  // Only set baseURL when configured — do NOT fall back to localhost. Falling back causes
2407
2407
  // noisy network requests to the frontend Dev server when the backend isn't configured.
2408
2408
  ...El ? { baseURL: El } : {},
@@ -2595,7 +2595,7 @@ function gx() {
2595
2595
  function xx() {
2596
2596
  return typeof window > "u" ? !1 : window.__ARTIFACT_DEBUG__ === !0;
2597
2597
  }
2598
- function Tt() {
2598
+ function Ot() {
2599
2599
  return gx() || xx();
2600
2600
  }
2601
2601
  const yx = {
@@ -2888,7 +2888,7 @@ function _x(e, t) {
2888
2888
  role: i,
2889
2889
  content: x
2890
2890
  };
2891
- f && (m.createdAt = f), typeof o.name == "string" && o.name.trim() && (m.name = o.name), typeof (d == null ? void 0 : d.model_name) == "string" && (m.model = String(d.model_name)), !m.model && typeof o.model == "string" && (m.model = o.model), p && (m.checkpointId = p), h && (m.checkpointNs = h), Tt() && console.debug("[historyUtils.convertHistoryMessage] Starting artifact check:", {
2891
+ f && (m.createdAt = f), typeof o.name == "string" && o.name.trim() && (m.name = o.name), typeof (d == null ? void 0 : d.model_name) == "string" && (m.model = String(d.model_name)), !m.model && typeof o.model == "string" && (m.model = o.model), p && (m.checkpointId = p), h && (m.checkpointNs = h), Ot() && console.debug("[historyUtils.convertHistoryMessage] Starting artifact check:", {
2892
2892
  id: l,
2893
2893
  role: i,
2894
2894
  hasDataArtifact: !!o.artifact,
@@ -2903,17 +2903,17 @@ function _x(e, t) {
2903
2903
  o.artifact ?? r.artifact ?? o.artifacts ?? r.artifacts
2904
2904
  )
2905
2905
  );
2906
- y ? (m.artifact = y, Tt() && console.debug("[historyUtils.convertHistoryMessage] ✅ Artifact set on message:", {
2906
+ y ? (m.artifact = y, Ot() && console.debug("[historyUtils.convertHistoryMessage] ✅ Artifact set on message:", {
2907
2907
  id: l,
2908
2908
  role: i,
2909
2909
  artifactPlotsCount: ((T = y.plots) == null ? void 0 : T.length) ?? 0
2910
- })) : Tt() && (o.artifact || r.artifact) && console.debug("[historyUtils.convertHistoryMessage] ⚠️ Artifact candidate was null/undefined:", {
2910
+ })) : Ot() && (o.artifact || r.artifact) && console.debug("[historyUtils.convertHistoryMessage] ⚠️ Artifact candidate was null/undefined:", {
2911
2911
  id: l,
2912
2912
  role: i,
2913
2913
  hadDataArtifact: !!o.artifact,
2914
2914
  hadFallbackArtifact: !!r.artifact
2915
2915
  });
2916
- const g = Fx(c, [
2916
+ const g = $x(c, [
2917
2917
  "createdAt",
2918
2918
  "created_at",
2919
2919
  "checkpointId",
@@ -2986,7 +2986,7 @@ function Su(e, t) {
2986
2986
  var s;
2987
2987
  const n = wt(e, ["id", "call_id"]) ?? t, r = wt(e, ["name"]) ?? wt(Bt(e.function), ["name"]);
2988
2988
  if (!n || !r) return null;
2989
- const o = $x(e.args ?? e.arguments ?? ((s = Bt(e.function)) == null ? void 0 : s.arguments));
2989
+ const o = Fx(e.args ?? e.arguments ?? ((s = Bt(e.function)) == null ? void 0 : s.arguments));
2990
2990
  return { type: "tool_call", id: n, name: r, args: o };
2991
2991
  }
2992
2992
  function Px(e) {
@@ -3004,35 +3004,12 @@ function Ox(e, t) {
3004
3004
  }
3005
3005
  function Mx(e) {
3006
3006
  if (!e) {
3007
- Tt() && console.debug("[historyUtils] normalizeArtifactCandidate: no candidate");
3008
- return;
3009
- }
3010
- Tt() && console.debug("[historyUtils] normalizeArtifactCandidate input:", {
3011
- candidateKeys: Object.keys(e),
3012
- candidateJSON: JSON.stringify(e).substring(0, 200),
3013
- plots: Array.isArray(e.plots) ? `array[${e.plots.length}]` : typeof e.plots
3014
- });
3015
- const t = Dx(e.plots);
3016
- if (Tt() && console.debug("[historyUtils] normalizeArtifactCandidate result:", {
3017
- inputPlotsType: Array.isArray(e.plots) ? `array[${e.plots.length}]` : typeof e.plots,
3018
- normalizedCount: t.length,
3019
- plots: t.length > 0 ? t.map((r) => {
3020
- var o;
3021
- return {
3022
- hasBase64: !!r.content_base64,
3023
- base64Len: (o = r.content_base64) == null ? void 0 : o.length,
3024
- hasUrl: !!r.url,
3025
- format: r.format
3026
- };
3027
- }) : []
3028
- }), t.length === 0) {
3029
- Tt() && console.debug("[historyUtils] normalizeArtifactCandidate: no plots found, returning undefined");
3007
+ Ot() && console.debug("[historyUtils] normalizeArtifactCandidate: no candidate");
3030
3008
  return;
3031
3009
  }
3032
- const n = {
3033
- plots: t
3010
+ return {
3011
+ plots: Dx(e.plots)
3034
3012
  };
3035
- return Tt() && console.debug("[historyUtils] normalizeArtifactCandidate: artifact created with", t.length, "plots"), n;
3036
3013
  }
3037
3014
  function Dx(e) {
3038
3015
  return Array.isArray(e) ? e.map((t) => Lx(t)).filter((t) => !!t) : [];
@@ -3041,7 +3018,7 @@ function Lx(e) {
3041
3018
  if (!e || typeof e != "object")
3042
3019
  return null;
3043
3020
  const t = e, n = typeof t.content_base64 == "string" && t.content_base64.trim() || void 0, r = typeof t.url == "string" && t.url.trim() || void 0, o = (typeof t.format == "string" ? t.format.trim() : void 0) || (typeof t.mimeType == "string" ? t.mimeType.trim() : void 0) || (typeof t.mime_type == "string" ? t.mime_type.trim() : void 0), s = typeof t.plotId == "string" && t.plotId.trim() || void 0, i = typeof t.artifactId == "string" && t.artifactId.trim() || void 0;
3044
- if (Tt() && console.debug("[historyUtils.normalizePlotEntry]", {
3021
+ Ot() && console.debug("[historyUtils.normalizePlotEntry]", {
3045
3022
  plotKeys: Object.keys(t),
3046
3023
  hasContent_base64: !!n,
3047
3024
  content_base64_length: n == null ? void 0 : n.length,
@@ -3051,14 +3028,11 @@ function Lx(e) {
3051
3028
  artifactId: i,
3052
3029
  plot: t
3053
3030
  // Log full plot for inspection
3054
- }), !n && !r)
3055
- return Tt() && console.debug("[historyUtils.normalizePlotEntry] Invalid plot - no base64 or URL:", t), null;
3031
+ });
3056
3032
  const a = {};
3057
- return n && (a.content_base64 = n), r && (a.url = r), o && (a.format = o), s && (a.plotId = s), i && (a.artifactId = i), Tt() && console.debug("[historyUtils.normalizePlotEntry] Normalized:", {
3058
- normalized: a
3059
- }), a;
3033
+ return n && (a.content_base64 = n), r && (a.url = r), o && (a.format = o), s && (a.plotId = s), i && (a.artifactId = i), a;
3060
3034
  }
3061
- function $x(e) {
3035
+ function Fx(e) {
3062
3036
  if (!e) return {};
3063
3037
  if (typeof e == "string")
3064
3038
  try {
@@ -3081,7 +3055,7 @@ function wt(e, t) {
3081
3055
  return r;
3082
3056
  }
3083
3057
  }
3084
- function Fx(e, t) {
3058
+ function $x(e, t) {
3085
3059
  if (!e) return;
3086
3060
  const n = {};
3087
3061
  let r = !1;
@@ -3135,8 +3109,8 @@ function Ux(e = {}) {
3135
3109
  }, []), M = Me(() => {
3136
3110
  var I;
3137
3111
  console.debug("[use-chat] stop() invoked - aborting stream"), (I = w.current) == null || I.abort(), w.current = null, C.current = null, l(!1), b(!1), S.current = 0, y(0);
3138
- }, []), $ = Me(
3139
- (I, F, A) => {
3112
+ }, []), F = Me(
3113
+ (I, $, A) => {
3140
3114
  w.current && (w.current.abort(), w.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && p(""), x(null), k.current = null, E.current = null, N.current = null;
3141
3115
  const K = new AbortController();
3142
3116
  w.current = K;
@@ -3145,14 +3119,14 @@ function Ux(e = {}) {
3145
3119
  threadId: I.threadId ?? null,
3146
3120
  headers: {}
3147
3121
  }, (async () => {
3148
- var se, ye, Pe, q, H, Z, D, G, Q, ue, oe, Ee, Ge, $e, Ze, ie, ve, Ie;
3122
+ var se, ye, Pe, q, H, Z, D, G, Q, ue, oe, Ee, Ge, Fe, Ze, ie, ve, Ie;
3149
3123
  const J = (Ne) => {
3150
3124
  var We;
3151
3125
  try {
3152
3126
  const Ye = JSON.parse(JSON.stringify(Ne));
3153
- return (We = Ye == null ? void 0 : Ye.payload) != null && We.files_info && Array.isArray(Ye.payload.files_info) && (Ye.payload.files_info = Ye.payload.files_info.map((Fe) => ({
3154
- ...Fe,
3155
- data: Fe != null && Fe.data ? `<base64 ${String(Fe.data).length} chars>` : Fe == null ? void 0 : Fe.data
3127
+ return (We = Ye == null ? void 0 : Ye.payload) != null && We.files_info && Array.isArray(Ye.payload.files_info) && (Ye.payload.files_info = Ye.payload.files_info.map(($e) => ({
3128
+ ...$e,
3129
+ data: $e != null && $e.data ? `<base64 ${String($e.data).length} chars>` : $e == null ? void 0 : $e.data
3156
3130
  }))), Ye;
3157
3131
  } catch {
3158
3132
  return Ne;
@@ -3192,13 +3166,13 @@ function Ux(e = {}) {
3192
3166
  ...Ne,
3193
3167
  ...We,
3194
3168
  ...s.current
3195
- }, Fe = {
3169
+ }, $e = {
3196
3170
  "Content-Type": "application/json",
3197
3171
  Accept: "text/event-stream",
3198
3172
  ...Ye
3199
3173
  }, He = await fetch(t + n, {
3200
3174
  method: "POST",
3201
- headers: Fe,
3175
+ headers: $e,
3202
3176
  body: JSON.stringify(I),
3203
3177
  signal: K.signal,
3204
3178
  credentials: i
@@ -3214,7 +3188,7 @@ function Ux(e = {}) {
3214
3188
  throw (H = A == null ? void 0 : A.onConnectionError) == null || H.call(A, ot), X = !0, z = "error", _ = ot, new Error(ot);
3215
3189
  }
3216
3190
  b(!0);
3217
- const tt = He.body.getReader(), Nt = new TextDecoder();
3191
+ const tt = He.body.getReader(), It = new TextDecoder();
3218
3192
  let xt = "", dt = [];
3219
3193
  S.current = 0, y(0);
3220
3194
  let ft = 0, pt = null;
@@ -3224,11 +3198,11 @@ function Ux(e = {}) {
3224
3198
  dt = [], T.current && p((ot) => ot + nt);
3225
3199
  }
3226
3200
  pt = null;
3227
- }, _t = () => {
3201
+ }, At = () => {
3228
3202
  typeof window < "u" && pt == null && (pt = requestAnimationFrame(yt));
3229
3203
  };
3230
3204
  let Xe = Date.now();
3231
- const Pt = setInterval(() => {
3205
+ const jt = setInterval(() => {
3232
3206
  var nt;
3233
3207
  if (Date.now() - Xe > 18e5) {
3234
3208
  const ot = "Stream idle timeout";
@@ -3243,7 +3217,7 @@ function Ux(e = {}) {
3243
3217
  }), (Z = A == null ? void 0 : A.onOpen) == null || Z.call(A, { threadId: St, created: V }); ; ) {
3244
3218
  const { value: le, done: Ce } = await tt.read();
3245
3219
  if (Ce) break;
3246
- xt += Nt.decode(le, { stream: !0 }), xt.length > mn && (xt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3220
+ xt += It.decode(le, { stream: !0 }), xt.length > mn && (xt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3247
3221
  let P;
3248
3222
  for (; (P = xt.indexOf(`
3249
3223
 
@@ -3292,15 +3266,15 @@ function Ux(e = {}) {
3292
3266
  }
3293
3267
  }
3294
3268
  try {
3295
- F == null || F(me);
3269
+ $ == null || $(me);
3296
3270
  } catch (ge) {
3297
3271
  console.error("[use-chat] Error in onEvent callback:", ge, "for event:", me.type);
3298
3272
  }
3299
3273
  if (me.type === "token" && e.autoAppendAssistant !== !1)
3300
- dt.push(me.content), _t();
3274
+ dt.push(me.content), At();
3301
3275
  else if (me.type === "message_delta") {
3302
3276
  const ge = me.delta.filter((at) => at.type === "text").map((at) => at.text).join("");
3303
- ge && e.autoAppendAssistant !== !1 && (dt.push(ge), _t());
3277
+ ge && e.autoAppendAssistant !== !1 && (dt.push(ge), At());
3304
3278
  } else if (me.type === "heartbeat") {
3305
3279
  console.debug("[use-chat] heartbeat received");
3306
3280
  try {
@@ -3330,7 +3304,7 @@ function Ux(e = {}) {
3330
3304
  z = z ?? "aborted";
3331
3305
  else {
3332
3306
  const ot = nt.message || String(nt);
3333
- z = "error", _ = ot, d(ot), ($e = A == null ? void 0 : A.onError) == null || $e.call(A, ot);
3307
+ z = "error", _ = ot, d(ot), (Fe = A == null ? void 0 : A.onError) == null || Fe.call(A, ot);
3334
3308
  }
3335
3309
  } finally {
3336
3310
  try {
@@ -3339,7 +3313,7 @@ function Ux(e = {}) {
3339
3313
  } finally {
3340
3314
  (Ze = tt.releaseLock) == null || Ze.call(tt);
3341
3315
  }
3342
- pt !== null && typeof window < "u" && window.cancelAnimationFrame(pt), clearInterval(Pt);
3316
+ pt !== null && typeof window < "u" && window.cancelAnimationFrame(pt), clearInterval(jt);
3343
3317
  }
3344
3318
  } catch (Ne) {
3345
3319
  if (Ne.name === "AbortError")
@@ -3349,14 +3323,14 @@ function Ux(e = {}) {
3349
3323
  z = "error", _ = We, d(We), (ie = A == null ? void 0 : A.onError) == null || ie.call(A, We), X || ((ve = A == null ? void 0 : A.onConnectionError) == null || ve.call(A, We), X = !0);
3350
3324
  }
3351
3325
  } finally {
3352
- const Ne = S.current, We = k.current, Ye = E.current, Fe = N.current, He = z ?? (K.signal.aborted ? "aborted" : _ ? "error" : "complete");
3326
+ const Ne = S.current, We = k.current, Ye = E.current, $e = N.current, He = z ?? (K.signal.aborted ? "aborted" : _ ? "error" : "complete");
3353
3327
  try {
3354
3328
  (Ie = A == null ? void 0 : A.onClosed) == null || Ie.call(A, {
3355
3329
  reason: He,
3356
3330
  lastSeq: Ne,
3357
3331
  lastCheckpointId: We,
3358
3332
  lastCheckpointNs: Ye,
3359
- lastStateHistory: Fe,
3333
+ lastStateHistory: $e,
3360
3334
  error: _
3361
3335
  });
3362
3336
  } catch (tt) {
@@ -3368,7 +3342,7 @@ function Ux(e = {}) {
3368
3342
  },
3369
3343
  [t, n, r, e.autoAppendAssistant]
3370
3344
  );
3371
- return Et(() => () => {
3345
+ return Rt(() => () => {
3372
3346
  var I;
3373
3347
  T.current = !1, (I = w.current) == null || I.abort();
3374
3348
  }, []), {
@@ -3378,7 +3352,7 @@ function Ux(e = {}) {
3378
3352
  lastCheckpointId: h,
3379
3353
  lastSeq: m,
3380
3354
  connected: g,
3381
- stream: $,
3355
+ stream: F,
3382
3356
  stop: M,
3383
3357
  clear: j,
3384
3358
  setToken: L
@@ -3467,7 +3441,7 @@ function Yx(e = []) {
3467
3441
  }, [i]), l = Me((d) => {
3468
3442
  r.current.push(d), a();
3469
3443
  }, [a]);
3470
- Et(() => () => {
3444
+ Rt(() => () => {
3471
3445
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
3472
3446
  }, []);
3473
3447
  const c = rt(() => ({
@@ -3833,8 +3807,8 @@ function ey({
3833
3807
  }, []), y = Me(
3834
3808
  (j, M) => {
3835
3809
  if (!j) return;
3836
- const $ = p.current.get(j) ?? [], I = m(M), F = $.length >= Dl ? [...$.slice($.length - Dl + 1), I] : [...$, I];
3837
- p.current.set(j, F);
3810
+ const F = p.current.get(j) ?? [], I = m(M), $ = F.length >= Dl ? [...F.slice(F.length - Dl + 1), I] : [...F, I];
3811
+ p.current.set(j, $);
3838
3812
  },
3839
3813
  [m]
3840
3814
  ), g = Me((j) => {
@@ -3843,19 +3817,19 @@ function ey({
3843
3817
  (j) => {
3844
3818
  const M = j ?? f.current;
3845
3819
  if (!M) return;
3846
- const $ = p.current.get(M);
3847
- $ != null && $.length && $.forEach((I) => {
3820
+ const F = p.current.get(M);
3821
+ F != null && F.length && F.forEach((I) => {
3848
3822
  try {
3849
3823
  n(I);
3850
- } catch (F) {
3851
- console.error("[useChatStreamingService] Failed to replay buffered event", F);
3824
+ } catch ($) {
3825
+ console.error("[useChatStreamingService] Failed to replay buffered event", $);
3852
3826
  }
3853
3827
  });
3854
3828
  },
3855
3829
  [n]
3856
3830
  ), w = Me(
3857
3831
  (j) => {
3858
- var I, F, A, K, z;
3832
+ var I, $, A, K, z;
3859
3833
  const M = j.seq ?? null;
3860
3834
  if (M !== null) {
3861
3835
  const _ = d.current;
@@ -3885,7 +3859,7 @@ function ey({
3885
3859
  }
3886
3860
  if (j.type === "error") {
3887
3861
  const _ = j;
3888
- if (_.error_type === "auth_error" || _.code === "TOKEN_EXPIRED" || ((I = _.message) == null ? void 0 : I.includes("token")) || ((F = _.message) == null ? void 0 : F.includes("401")) || ((A = _.message) == null ? void 0 : A.includes("unauthorized")) || ((K = _.message) == null ? void 0 : K.includes("Unauthorized"))) {
3862
+ if (_.error_type === "auth_error" || _.code === "TOKEN_EXPIRED" || ((I = _.message) == null ? void 0 : I.includes("token")) || (($ = _.message) == null ? void 0 : $.includes("401")) || ((A = _.message) == null ? void 0 : A.includes("unauthorized")) || ((K = _.message) == null ? void 0 : K.includes("Unauthorized"))) {
3889
3863
  console.error("[useChatStreamingService] Auth error event detected:", _.message);
3890
3864
  try {
3891
3865
  l == null || l(_.message);
@@ -3894,9 +3868,9 @@ function ey({
3894
3868
  }
3895
3869
  }
3896
3870
  }
3897
- const $ = j.threadId ?? (j.type === "state_history" ? j.threadId : void 0) ?? f.current ?? ((z = h.current) == null ? void 0 : z.threadIdGuess) ?? null;
3871
+ const F = j.threadId ?? (j.type === "state_history" ? j.threadId : void 0) ?? f.current ?? ((z = h.current) == null ? void 0 : z.threadIdGuess) ?? null;
3898
3872
  if (j.type === "state_history") {
3899
- f.current = $ ?? f.current;
3873
+ f.current = F ?? f.current;
3900
3874
  try {
3901
3875
  r == null || r(j);
3902
3876
  } catch (_) {
@@ -3904,7 +3878,7 @@ function ey({
3904
3878
  }
3905
3879
  }
3906
3880
  if (Kx(j)) {
3907
- j.type === "checkpoint" || j.type === "state_history" ? g($ ?? null) : y($ ?? null, j);
3881
+ j.type === "checkpoint" || j.type === "state_history" ? g(F ?? null) : y(F ?? null, j);
3908
3882
  try {
3909
3883
  n(j);
3910
3884
  } catch (_) {
@@ -3934,39 +3908,39 @@ function ey({
3934
3908
  w,
3935
3909
  {
3936
3910
  onOpen: M == null ? void 0 : M.onOpen,
3937
- onError: ($) => {
3911
+ onError: (F) => {
3938
3912
  var I;
3939
- (I = M == null ? void 0 : M.onError) == null || I.call(M, $);
3913
+ (I = M == null ? void 0 : M.onError) == null || I.call(M, F);
3940
3914
  },
3941
3915
  onGap: (M == null ? void 0 : M.onGap) ?? s,
3942
- onConnectionError: ($) => {
3916
+ onConnectionError: (F) => {
3943
3917
  var I;
3944
- a == null || a($), (I = M == null ? void 0 : M.onConnectionError) == null || I.call(M, $);
3918
+ a == null || a(F), (I = M == null ? void 0 : M.onConnectionError) == null || I.call(M, F);
3945
3919
  },
3946
- onAuthError: ($) => {
3920
+ onAuthError: (F) => {
3947
3921
  var I;
3948
- l == null || l($), (I = M == null ? void 0 : M.onAuthError) == null || I.call(M, $);
3922
+ l == null || l(F), (I = M == null ? void 0 : M.onAuthError) == null || I.call(M, F);
3949
3923
  },
3950
- onHeartbeat: ($) => {
3924
+ onHeartbeat: (F) => {
3951
3925
  var I;
3952
3926
  try {
3953
- c == null || c($);
3954
- } catch (F) {
3955
- console.warn("[useChatStreamingService] onHeartbeat handler failed", F);
3927
+ c == null || c(F);
3928
+ } catch ($) {
3929
+ console.warn("[useChatStreamingService] onHeartbeat handler failed", $);
3956
3930
  }
3957
3931
  try {
3958
- (I = M == null ? void 0 : M.onHeartbeat) == null || I.call(M, $);
3959
- } catch (F) {
3960
- console.warn("[useChatStreamingService] downstream onHeartbeat handler failed", F);
3932
+ (I = M == null ? void 0 : M.onHeartbeat) == null || I.call(M, F);
3933
+ } catch ($) {
3934
+ console.warn("[useChatStreamingService] downstream onHeartbeat handler failed", $);
3961
3935
  }
3962
3936
  },
3963
- onClosed: ($) => {
3937
+ onClosed: (F) => {
3964
3938
  var K, z, _, X;
3965
- const I = ((K = h.current) == null ? void 0 : K.manualStop) ?? !1, F = f.current ?? ((z = h.current) == null ? void 0 : z.threadIdGuess) ?? ((_ = $.lastStateHistory) == null ? void 0 : _.threadId) ?? null;
3966
- ($.reason === "complete" || $.reason === "aborted" && I) && g(F);
3939
+ const I = ((K = h.current) == null ? void 0 : K.manualStop) ?? !1, $ = f.current ?? ((z = h.current) == null ? void 0 : z.threadIdGuess) ?? ((_ = F.lastStateHistory) == null ? void 0 : _.threadId) ?? null;
3940
+ (F.reason === "complete" || F.reason === "aborted" && I) && g($);
3967
3941
  const A = {
3968
- ...$,
3969
- threadId: F,
3942
+ ...F,
3943
+ threadId: $,
3970
3944
  threadInfo: x.current,
3971
3945
  // ✅ Include thread_info for recovery
3972
3946
  manualStop: I
@@ -4023,14 +3997,14 @@ function ty({
4023
3997
  onAuthError: i,
4024
3998
  onThreadChange: a
4025
3999
  }) {
4026
- const { api: l, baseUrl: c } = vu(), d = rt(() => An(c), [c]), [f, p] = we([]), [h, x] = we(t), [m, y] = we(!1), [g, b] = we(null), [w, T] = we(!1), [S, C] = we(null), { state: k, seed: E, prepend: N, pushUser: L, onEvent: j } = Yx(), [M, $] = we(!1), [I, F] = we(!1), [A, K] = we(null), [z, _] = we([]), [X, J] = we([]), [se, ye] = we(!1), Pe = rt(
4000
+ const { api: l, baseUrl: c } = vu(), d = rt(() => An(c), [c]), [f, p] = we([]), [h, x] = we(t), [m, y] = we(!1), [g, b] = we(null), [w, T] = we(!1), [S, C] = we(null), { state: k, seed: E, prepend: N, pushUser: L, onEvent: j } = Yx(), [M, F] = we(!1), [I, $] = we(!1), [A, K] = we(null), [z, _] = we([]), [X, J] = we([]), [se, ye] = we(!1), Pe = rt(
4027
4001
  () => z.flatMap((V) => V.messages ?? []),
4028
4002
  [z]
4029
4003
  ), q = rt(() => Hx(Pe), [Pe]), H = Ue(h), Z = Ue(null), D = Ue(null), G = Ue(null), Q = Ue(null), ue = Ue(!1), oe = Ue(null), Ee = Ue(/* @__PURE__ */ new Map()), Ge = Ue(/* @__PURE__ */ new Map());
4030
- Et(() => {
4004
+ Rt(() => {
4031
4005
  H.current = h;
4032
4006
  }, [h]);
4033
- const $e = Me(async () => {
4007
+ const Fe = Me(async () => {
4034
4008
  y(!0), b(null);
4035
4009
  try {
4036
4010
  const V = await l.listThreads();
@@ -4063,12 +4037,12 @@ function ty({
4063
4037
  E((Y == null ? void 0 : Y.messages) ?? [], {
4064
4038
  checkpointId: (Y == null ? void 0 : Y.checkpointId) ?? null,
4065
4039
  checkpointNs: (Y == null ? void 0 : Y.checkpointNs) ?? null
4066
- }), J(P), _(Ce), $(!!(Y != null && Y.nextCursor)), K((Y == null ? void 0 : Y.nextCursor) ?? null), oe.current = `${le}:latest`, D.current = null, G.current = null;
4040
+ }), J(P), _(Ce), F(!!(Y != null && Y.nextCursor)), K((Y == null ? void 0 : Y.nextCursor) ?? null), oe.current = `${le}:latest`, D.current = null, G.current = null;
4067
4041
  },
4068
4042
  [E]
4069
4043
  ), ve = Me((V) => {
4070
4044
  console.log("[ChatSessionProvider] 🎯 Received thread_info:", V.threadId), Ze(V), H.current !== V.threadId && ((V.created ?? !H.current) && (D.current = V.threadId), G.current = V.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), x(V.threadId));
4071
- }, [Ze]), { startStream: Ie, stop: Ne, isStreaming: We, error: Ye, setAuthToken: Fe } = ey({
4045
+ }, [Ze]), { startStream: Ie, stop: Ne, isStreaming: We, error: Ye, setAuthToken: $e } = ey({
4072
4046
  baseUrl: d,
4073
4047
  onThreadInfo: ve,
4074
4048
  onMessageEvent: j,
@@ -4081,12 +4055,12 @@ function ty({
4081
4055
  async (V) => {
4082
4056
  try {
4083
4057
  const le = await l.createThread(V);
4084
- return x(le.threadId), await $e(), le.threadId;
4058
+ return x(le.threadId), await Fe(), le.threadId;
4085
4059
  } catch (le) {
4086
4060
  return s == null || s(String(le)), null;
4087
4061
  }
4088
4062
  },
4089
- [l, $e, s]
4063
+ [l, Fe, s]
4090
4064
  ), tt = Me(
4091
4065
  async (V) => {
4092
4066
  const le = f;
@@ -4102,15 +4076,15 @@ function ty({
4102
4076
  }
4103
4077
  },
4104
4078
  [f, l, E, s]
4105
- ), Nt = Me(
4079
+ ), It = Me(
4106
4080
  async (V, le) => {
4107
4081
  try {
4108
- await l.updateThread(V, le), await $e();
4082
+ await l.updateThread(V, le), await Fe();
4109
4083
  } catch (Ce) {
4110
4084
  s == null || s(String(Ce));
4111
4085
  }
4112
4086
  },
4113
- [l, $e, s]
4087
+ [l, Fe, s]
4114
4088
  ), xt = Me(
4115
4089
  async (V, le) => {
4116
4090
  if (!V) return;
@@ -4133,7 +4107,7 @@ function ty({
4133
4107
  E((ge == null ? void 0 : ge.messages) ?? [], {
4134
4108
  checkpointId: (ge == null ? void 0 : ge.checkpointId) ?? null,
4135
4109
  checkpointNs: (ge == null ? void 0 : ge.checkpointNs) ?? null
4136
- }), J(Je), _(me), $(!!(ge != null && ge.nextCursor)), K((ge == null ? void 0 : ge.nextCursor) ?? null);
4110
+ }), J(Je), _(me), F(!!(ge != null && ge.nextCursor)), K((ge == null ? void 0 : ge.nextCursor) ?? null);
4137
4111
  } catch (Oe) {
4138
4112
  if (H.current === ne) {
4139
4113
  const me = String(Oe);
@@ -4163,7 +4137,7 @@ function ty({
4163
4137
  },
4164
4138
  [xt]
4165
4139
  );
4166
- Et(() => {
4140
+ Rt(() => {
4167
4141
  if (!o || !h || w || We)
4168
4142
  return;
4169
4143
  if (D.current === h) {
@@ -4244,10 +4218,10 @@ function ty({
4244
4218
  [E, k.messages]
4245
4219
  ), yt = Me(async () => {
4246
4220
  H.current && await dt(H.current);
4247
- }, [dt]), _t = Me(async () => {
4221
+ }, [dt]), At = Me(async () => {
4248
4222
  if (!H.current || !A) return;
4249
4223
  const V = H.current;
4250
- F(!0);
4224
+ $(!0);
4251
4225
  try {
4252
4226
  const le = await l.getStateHistory({
4253
4227
  threadId: V,
@@ -4260,21 +4234,21 @@ function ty({
4260
4234
  const { checkpoints: Ce } = fr(le);
4261
4235
  if (Ce.length > 0) {
4262
4236
  const P = Ce[Ce.length - 1];
4263
- N((P == null ? void 0 : P.messages) ?? []), $(!!(P != null && P.nextCursor)), K((P == null ? void 0 : P.nextCursor) ?? null);
4237
+ N((P == null ? void 0 : P.messages) ?? []), F(!!(P != null && P.nextCursor)), K((P == null ? void 0 : P.nextCursor) ?? null);
4264
4238
  }
4265
4239
  } catch (le) {
4266
4240
  H.current === V && (s == null || s(String(le)));
4267
4241
  } finally {
4268
- F(!1);
4242
+ $(!1);
4269
4243
  }
4270
4244
  }, [l, A, N, s]), Xe = Me(async () => {
4271
- E([], {}), x(null), Ne(), _([]), J([]), $(!1), K(null), T(!1), ye(!1), F(!1), C(null);
4245
+ E([], {}), x(null), Ne(), _([]), J([]), F(!1), K(null), T(!1), ye(!1), $(!1), C(null);
4272
4246
  try {
4273
4247
  await l.getAgent("default");
4274
4248
  } catch (V) {
4275
4249
  console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:", V);
4276
4250
  }
4277
- }, [E, Ne, l]), Pt = Me(
4251
+ }, [E, Ne, l]), jt = Me(
4278
4252
  async (V, le, Ce) => {
4279
4253
  const P = H.current;
4280
4254
  if (!P)
@@ -4295,9 +4269,9 @@ function ty({
4295
4269
  },
4296
4270
  [k.lastCheckpointId, k.lastCheckpointNs, Ie]
4297
4271
  );
4298
- Et(() => {
4299
- $e();
4300
- }, [$e]), Et(() => {
4272
+ Rt(() => {
4273
+ Fe();
4274
+ }, [Fe]), Rt(() => {
4301
4275
  a == null || a(h);
4302
4276
  }, [h, a]);
4303
4277
  const mn = Me(
@@ -4345,11 +4319,11 @@ function ty({
4345
4319
  actions: {
4346
4320
  createThread: He,
4347
4321
  deleteThread: tt,
4348
- renameThread: Nt,
4349
- refreshThreads: $e
4322
+ renameThread: It,
4323
+ refreshThreads: Fe
4350
4324
  }
4351
4325
  }),
4352
- [f, h, m, g, He, tt, Nt, $e]
4326
+ [f, h, m, g, He, tt, It, Fe]
4353
4327
  ), ot = rt(
4354
4328
  () => ({
4355
4329
  threadId: h,
@@ -4367,14 +4341,14 @@ function ty({
4367
4341
  isLoadingCheckpoint: se,
4368
4342
  error: S,
4369
4343
  hasMore: M,
4370
- loadOlder: _t,
4344
+ loadOlder: At,
4371
4345
  clearState: Xe,
4372
4346
  navigateToCheckpoint: ft,
4373
4347
  setCurrentCheckpointId: pt,
4374
4348
  returnToLatest: yt,
4375
4349
  loadThread: dt,
4376
4350
  clearThread: Xe,
4377
- respondToInterrupt: Pt,
4351
+ respondToInterrupt: jt,
4378
4352
  messagePreviews: q
4379
4353
  }),
4380
4354
  [
@@ -4387,13 +4361,13 @@ function ty({
4387
4361
  se,
4388
4362
  S,
4389
4363
  M,
4390
- _t,
4364
+ At,
4391
4365
  Xe,
4392
4366
  ft,
4393
4367
  pt,
4394
4368
  yt,
4395
4369
  dt,
4396
- Pt,
4370
+ jt,
4397
4371
  q
4398
4372
  ]
4399
4373
  ), St = rt(
@@ -4404,9 +4378,9 @@ function ty({
4404
4378
  submit: mn,
4405
4379
  send: mn,
4406
4380
  stop: Ne,
4407
- setAuthToken: Fe
4381
+ setAuthToken: $e
4408
4382
  }),
4409
- [We, Ye, mn, Ne, Fe]
4383
+ [We, Ye, mn, Ne, $e]
4410
4384
  );
4411
4385
  return /* @__PURE__ */ u.jsx(ku.Provider, { value: nt, children: /* @__PURE__ */ u.jsx(Ru.Provider, { value: ot, children: /* @__PURE__ */ u.jsx(Eu.Provider, { value: St, children: e }) }) });
4412
4386
  }
@@ -4526,20 +4500,20 @@ function oy({
4526
4500
  x || (y(e ?? ""), C.current = null, T.current && (T.current.style.height = "auto", T.current.style.height = `${T.current.scrollHeight}px`));
4527
4501
  }, [e, t, x]);
4528
4502
  const k = B.useCallback(() => {
4529
- const F = T.current;
4530
- F && (F.style.height = "auto", F.style.height = `${F.scrollHeight}px`);
4503
+ const $ = T.current;
4504
+ $ && ($.style.height = "auto", $.style.height = `${$.scrollHeight}px`);
4531
4505
  }, []);
4532
4506
  B.useEffect(() => {
4533
4507
  k();
4534
4508
  }, [k, g]);
4535
4509
  const E = B.useCallback(
4536
- (F, { fromUser: A }) => {
4537
- x || y(F), A && (a == null || a(F));
4510
+ ($, { fromUser: A }) => {
4511
+ x || y($), A && (a == null || a($));
4538
4512
  },
4539
4513
  [x, a]
4540
4514
  ), N = B.useCallback(
4541
- async (F) => {
4542
- F && F.preventDefault();
4515
+ async ($) => {
4516
+ $ && $.preventDefault();
4543
4517
  const A = (g ?? "").trim();
4544
4518
  if (!A && !h)
4545
4519
  return;
@@ -4564,16 +4538,16 @@ function oy({
4564
4538
  });
4565
4539
  },
4566
4540
  [g, l, h, x, a]
4567
- ), L = B.useCallback((F) => {
4568
- const A = F.target.value;
4541
+ ), L = B.useCallback(($) => {
4542
+ const A = $.target.value;
4569
4543
  E(A, { fromUser: !0 }), C.current && (C.current.shouldClear = !1), T.current && (T.current.style.height = "auto", T.current.style.height = `${T.current.scrollHeight}px`);
4570
4544
  }, [E]), j = B.useCallback(
4571
- (F) => {
4572
- F.key === "Enter" && !F.shiftKey ? (F.preventDefault(), N()) : F.key === "Escape" && t && (F.preventDefault(), c == null || c());
4545
+ ($) => {
4546
+ $.key === "Enter" && !$.shiftKey ? ($.preventDefault(), N()) : $.key === "Escape" && t && ($.preventDefault(), c == null || c());
4573
4547
  },
4574
4548
  [N, t, c]
4575
4549
  ), I = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${p}`;
4576
- return /* @__PURE__ */ u.jsx("form", { onSubmit: (F) => void N(F), className: `w-full ${f}`, children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
4550
+ return /* @__PURE__ */ u.jsx("form", { onSubmit: ($) => void N($), className: `w-full ${f}`, children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
4577
4551
  /* @__PURE__ */ u.jsx("div", { className: "flex-1", children: /* @__PURE__ */ u.jsx(
4578
4552
  Iu,
4579
4553
  {
@@ -4853,7 +4827,7 @@ function py(e, t = globalThis == null ? void 0 : globalThis.document) {
4853
4827
  return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
4854
4828
  }, [n, t]);
4855
4829
  }
4856
- var hy = "DismissableLayer", Li = "dismissableLayer.update", my = "dismissableLayer.pointerDownOutside", gy = "dismissableLayer.focusOutside", $l, Au = v.createContext({
4830
+ var hy = "DismissableLayer", Li = "dismissableLayer.update", my = "dismissableLayer.pointerDownOutside", gy = "dismissableLayer.focusOutside", Fl, Au = v.createContext({
4857
4831
  layers: /* @__PURE__ */ new Set(),
4858
4832
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
4859
4833
  branches: /* @__PURE__ */ new Set()
@@ -4878,11 +4852,11 @@ var hy = "DismissableLayer", Li = "dismissableLayer.update", my = "dismissableLa
4878
4852
  b === c.layers.size - 1 && (r == null || r(k), !k.defaultPrevented && a && (k.preventDefault(), a()));
4879
4853
  }, p), v.useEffect(() => {
4880
4854
  if (d)
4881
- return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && ($l = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), Fl(), () => {
4882
- n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = $l);
4855
+ return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Fl = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), $l(), () => {
4856
+ n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = Fl);
4883
4857
  };
4884
4858
  }, [d, p, n, c]), v.useEffect(() => () => {
4885
- d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Fl());
4859
+ d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), $l());
4886
4860
  }, [d, c]), v.useEffect(() => {
4887
4861
  const k = () => h({});
4888
4862
  return document.addEventListener(Li, k), () => document.removeEventListener(Li, k);
@@ -4961,7 +4935,7 @@ function by(e, t = globalThis == null ? void 0 : globalThis.document) {
4961
4935
  onBlurCapture: () => r.current = !1
4962
4936
  };
4963
4937
  }
4964
- function Fl() {
4938
+ function $l() {
4965
4939
  const e = new CustomEvent(Li);
4966
4940
  document.dispatchEvent(e);
4967
4941
  }
@@ -5131,7 +5105,7 @@ const Ay = ["top", "right", "bottom", "left"], Dn = Math.min, Gt = Math.max, Go
5131
5105
  start: "end",
5132
5106
  end: "start"
5133
5107
  };
5134
- function $i(e, t, n) {
5108
+ function Fi(e, t, n) {
5135
5109
  return Gt(e, Dn(t, n));
5136
5110
  }
5137
5111
  function _n(e, t) {
@@ -5164,13 +5138,13 @@ function Oy(e, t, n) {
5164
5138
  }
5165
5139
  function My(e) {
5166
5140
  const t = Yo(e);
5167
- return [Fi(e), t, Fi(t)];
5141
+ return [$i(e), t, $i(t)];
5168
5142
  }
5169
- function Fi(e) {
5143
+ function $i(e) {
5170
5144
  return e.replace(/start|end/g, (t) => jy[t]);
5171
5145
  }
5172
5146
  const Vl = ["left", "right"], Kl = ["right", "left"], Dy = ["top", "bottom"], Ly = ["bottom", "top"];
5173
- function $y(e, t, n) {
5147
+ function Fy(e, t, n) {
5174
5148
  switch (e) {
5175
5149
  case "top":
5176
5150
  case "bottom":
@@ -5182,10 +5156,10 @@ function $y(e, t, n) {
5182
5156
  return [];
5183
5157
  }
5184
5158
  }
5185
- function Fy(e, t, n, r) {
5159
+ function $y(e, t, n, r) {
5186
5160
  const o = Rr(e);
5187
- let s = $y(jn(e), n === "start", r);
5188
- return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Fi)))), s;
5161
+ let s = Fy(jn(e), n === "start", r);
5162
+ return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map($i)))), s;
5189
5163
  }
5190
5164
  function Yo(e) {
5191
5165
  return e.replace(/left|right|bottom|top/g, (t) => _y[t]);
@@ -5403,12 +5377,12 @@ const Hy = (e) => ({
5403
5377
  }, h = ba(o), x = va(h), m = await i.getDimensions(c), y = h === "y", g = y ? "top" : "left", b = y ? "bottom" : "right", w = y ? "clientHeight" : "clientWidth", T = s.reference[x] + s.reference[h] - p[h] - s.floating[x], S = p[h] - s.reference[h], C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c));
5404
5378
  let k = C ? C[w] : 0;
5405
5379
  (!k || !await (i.isElement == null ? void 0 : i.isElement(C))) && (k = a.floating[w] || s.floating[x]);
5406
- const E = T / 2 - S / 2, N = k / 2 - m[x] / 2 - 1, L = Dn(f[g], N), j = Dn(f[b], N), M = L, $ = k - m[x] - j, I = k / 2 - m[x] / 2 + E, F = $i(M, I, $), A = !l.arrow && Rr(o) != null && I !== F && s.reference[x] / 2 - (I < M ? L : j) - m[x] / 2 < 0, K = A ? I < M ? I - M : I - $ : 0;
5380
+ const E = T / 2 - S / 2, N = k / 2 - m[x] / 2 - 1, L = Dn(f[g], N), j = Dn(f[b], N), M = L, F = k - m[x] - j, I = k / 2 - m[x] / 2 + E, $ = Fi(M, I, F), A = !l.arrow && Rr(o) != null && I !== $ && s.reference[x] / 2 - (I < M ? L : j) - m[x] / 2 < 0, K = A ? I < M ? I - M : I - F : 0;
5407
5381
  return {
5408
5382
  [h]: p[h] + K,
5409
5383
  data: {
5410
- [h]: F,
5411
- centerOffset: I - F - K,
5384
+ [h]: $,
5385
+ centerOffset: I - $ - K,
5412
5386
  ...A && {
5413
5387
  alignmentOffset: K
5414
5388
  }
@@ -5441,7 +5415,7 @@ const Hy = (e) => ({
5441
5415
  if ((n = s.arrow) != null && n.alignmentOffset)
5442
5416
  return {};
5443
5417
  const g = jn(o), b = vn(a), w = jn(a) === a, T = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), S = p || (w || !m ? [Yo(a)] : My(a)), C = x !== "none";
5444
- !p && C && S.push(...Fy(a, m, x, T));
5418
+ !p && C && S.push(...$y(a, m, x, T));
5445
5419
  const k = [a, ...S], E = await Gr(t, y), N = [];
5446
5420
  let L = ((r = s.flip) == null ? void 0 : r.overflows) || [];
5447
5421
  if (d && N.push(E[g]), f) {
@@ -5453,8 +5427,8 @@ const Hy = (e) => ({
5453
5427
  overflows: N
5454
5428
  }], !N.every((I) => I <= 0)) {
5455
5429
  var j, M;
5456
- const I = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, F = k[I];
5457
- if (F && (!(f === "alignment" ? b !== vn(F) : !1) || // We leave the current main axis only if every placement on that axis
5430
+ const I = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, $ = k[I];
5431
+ if ($ && (!(f === "alignment" ? b !== vn($) : !1) || // We leave the current main axis only if every placement on that axis
5458
5432
  // overflows the main axis.
5459
5433
  L.every((z) => vn(z.placement) === b ? z.overflows[0] > 0 : !0)))
5460
5434
  return {
@@ -5463,15 +5437,15 @@ const Hy = (e) => ({
5463
5437
  overflows: L
5464
5438
  },
5465
5439
  reset: {
5466
- placement: F
5440
+ placement: $
5467
5441
  }
5468
5442
  };
5469
5443
  let A = (M = L.filter((K) => K.overflows[0] <= 0).sort((K, z) => K.overflows[1] - z.overflows[1])[0]) == null ? void 0 : M.placement;
5470
5444
  if (!A)
5471
5445
  switch (h) {
5472
5446
  case "bestFit": {
5473
- var $;
5474
- const K = ($ = L.filter((z) => {
5447
+ var F;
5448
+ const K = (F = L.filter((z) => {
5475
5449
  if (C) {
5476
5450
  const _ = vn(z.placement);
5477
5451
  return _ === b || // Create a bias to the `y` side axis due to horizontal
@@ -5479,7 +5453,7 @@ const Hy = (e) => ({
5479
5453
  _ === "y";
5480
5454
  }
5481
5455
  return !0;
5482
- }).map((z) => [z.placement, z.overflows.filter((_) => _ > 0).reduce((_, X) => _ + X, 0)]).sort((z, _) => z[1] - _[1])[0]) == null ? void 0 : $[0];
5456
+ }).map((z) => [z.placement, z.overflows.filter((_) => _ > 0).reduce((_, X) => _ + X, 0)]).sort((z, _) => z[1] - _[1])[0]) == null ? void 0 : F[0];
5483
5457
  K && (A = K);
5484
5458
  break;
5485
5459
  }
@@ -5632,11 +5606,11 @@ const Ky = function(e) {
5632
5606
  let h = c[p], x = c[f];
5633
5607
  if (s) {
5634
5608
  const y = p === "y" ? "top" : "left", g = p === "y" ? "bottom" : "right", b = h + d[y], w = h - d[g];
5635
- h = $i(b, h, w);
5609
+ h = Fi(b, h, w);
5636
5610
  }
5637
5611
  if (i) {
5638
5612
  const y = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", b = x + d[y], w = x - d[g];
5639
- x = $i(b, x, w);
5613
+ x = Fi(b, x, w);
5640
5614
  }
5641
5615
  const m = a.fn({
5642
5616
  ...t,
@@ -5722,8 +5696,8 @@ const Ky = function(e) {
5722
5696
  const b = m - d.top - d.bottom, w = x - d.left - d.right, T = Dn(m - d[y], b), S = Dn(x - d[g], w), C = !t.middlewareData.shift;
5723
5697
  let k = T, E = S;
5724
5698
  if ((n = t.middlewareData.shift) != null && n.enabled.x && (E = w), (r = t.middlewareData.shift) != null && r.enabled.y && (k = b), C && !p) {
5725
- const L = Gt(d.left, 0), j = Gt(d.right, 0), M = Gt(d.top, 0), $ = Gt(d.bottom, 0);
5726
- h ? E = x - 2 * (L !== 0 || j !== 0 ? L + j : Gt(d.left, d.right)) : k = m - 2 * (M !== 0 || $ !== 0 ? M + $ : Gt(d.top, d.bottom));
5699
+ const L = Gt(d.left, 0), j = Gt(d.right, 0), M = Gt(d.top, 0), F = Gt(d.bottom, 0);
5700
+ h ? E = x - 2 * (L !== 0 || j !== 0 ? L + j : Gt(d.left, d.right)) : k = m - 2 * (M !== 0 || F !== 0 ? M + F : Gt(d.top, d.bottom));
5727
5701
  }
5728
5702
  await l({
5729
5703
  ...t,
@@ -5882,7 +5856,7 @@ function mr(e) {
5882
5856
  };
5883
5857
  }
5884
5858
  const sv = /* @__PURE__ */ wn(0);
5885
- function $u(e) {
5859
+ function Fu(e) {
5886
5860
  const t = Xt(e);
5887
5861
  return !Sa() || !t.visualViewport ? sv : {
5888
5862
  x: t.visualViewport.offsetLeft,
@@ -5897,7 +5871,7 @@ function Qn(e, t, n, r) {
5897
5871
  const o = e.getBoundingClientRect(), s = Ca(e);
5898
5872
  let i = wn(1);
5899
5873
  t && (r ? un(r) && (i = mr(r)) : i = mr(e));
5900
- const a = iv(s, n, r) ? $u(s) : wn(0);
5874
+ const a = iv(s, n, r) ? Fu(s) : wn(0);
5901
5875
  let l = (o.left + a.x) / i.x, c = (o.top + a.y) / i.y, d = o.width / i.x, f = o.height / i.y;
5902
5876
  if (s) {
5903
5877
  const p = Xt(s), h = r && un(r) ? Xt(r) : r;
@@ -5918,7 +5892,7 @@ function Is(e, t) {
5918
5892
  const n = Es(e).scrollLeft;
5919
5893
  return t ? t.left + n : Qn(Cn(e)).left + n;
5920
5894
  }
5921
- function Fu(e, t) {
5895
+ function $u(e, t) {
5922
5896
  const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - Is(e, n), o = n.top + t.scrollTop;
5923
5897
  return {
5924
5898
  x: r,
@@ -5944,7 +5918,7 @@ function av(e) {
5944
5918
  const h = Qn(r);
5945
5919
  c = mr(r), d.x = h.x + r.clientLeft, d.y = h.y + r.clientTop;
5946
5920
  }
5947
- const p = i && !f && !s ? Fu(i, l) : wn(0);
5921
+ const p = i && !f && !s ? $u(i, l) : wn(0);
5948
5922
  return {
5949
5923
  width: n.width * c.x,
5950
5924
  height: n.height * c.y,
@@ -6006,7 +5980,7 @@ function Zl(e, t, n) {
6006
5980
  else if (un(t))
6007
5981
  r = fv(t, n);
6008
5982
  else {
6009
- const o = $u(e);
5983
+ const o = Fu(e);
6010
5984
  r = {
6011
5985
  x: t.x - o.x,
6012
5986
  y: t.y - o.y,
@@ -6077,7 +6051,7 @@ function gv(e, t, n) {
6077
6051
  l.x = h.x + t.clientLeft, l.y = h.y + t.clientTop;
6078
6052
  } else o && c();
6079
6053
  s && !r && o && c();
6080
- const d = o && !r && !s ? Fu(o, a) : wn(0), f = i.left + a.scrollLeft - l.x - d.x, p = i.top + a.scrollTop - l.y - d.y;
6054
+ const d = o && !r && !s ? $u(o, a) : wn(0), f = i.left + a.scrollLeft - l.x - d.x, p = i.top + a.scrollTop - l.y - d.y;
6081
6055
  return {
6082
6056
  x: f,
6083
6057
  y: p,
@@ -6311,7 +6285,7 @@ function _v(e) {
6311
6285
  z !== C.current && (C.current = z, m(z));
6312
6286
  }, []), w = v.useCallback((z) => {
6313
6287
  z !== k.current && (k.current = z, g(z));
6314
- }, []), T = s || x, S = i || y, C = v.useRef(null), k = v.useRef(null), E = v.useRef(d), N = l != null, L = pi(l), j = pi(o), M = pi(c), $ = v.useCallback(() => {
6288
+ }, []), T = s || x, S = i || y, C = v.useRef(null), k = v.useRef(null), E = v.useRef(d), N = l != null, L = pi(l), j = pi(o), M = pi(c), F = v.useCallback(() => {
6315
6289
  if (!C.current || !k.current)
6316
6290
  return;
6317
6291
  const z = {
@@ -6345,11 +6319,11 @@ function _v(e) {
6345
6319
  }), []), Lo(() => {
6346
6320
  if (T && (C.current = T), S && (k.current = S), T && S) {
6347
6321
  if (L.current)
6348
- return L.current(T, S, $);
6349
- $();
6322
+ return L.current(T, S, F);
6323
+ F();
6350
6324
  }
6351
- }, [T, S, $, L, N]);
6352
- const F = v.useMemo(() => ({
6325
+ }, [T, S, F, L, N]);
6326
+ const $ = v.useMemo(() => ({
6353
6327
  reference: C,
6354
6328
  floating: k,
6355
6329
  setReference: b,
@@ -6380,11 +6354,11 @@ function _v(e) {
6380
6354
  }, [n, a, A.floating, d.x, d.y]);
6381
6355
  return v.useMemo(() => ({
6382
6356
  ...d,
6383
- update: $,
6384
- refs: F,
6357
+ update: F,
6358
+ refs: $,
6385
6359
  elements: A,
6386
6360
  floatingStyles: K
6387
- }), [d, $, F, A, K]);
6361
+ }), [d, F, $, A, K]);
6388
6362
  }
6389
6363
  const jv = (e) => {
6390
6364
  function t(n) {
@@ -6422,10 +6396,10 @@ const jv = (e) => {
6422
6396
  }), Lv = (e, t) => ({
6423
6397
  ...kv(e),
6424
6398
  options: [e, t]
6425
- }), $v = (e, t) => ({
6399
+ }), Fv = (e, t) => ({
6426
6400
  ...Rv(e),
6427
6401
  options: [e, t]
6428
- }), Fv = (e, t) => ({
6402
+ }), $v = (e, t) => ({
6429
6403
  ...jv(e),
6430
6404
  options: [e, t]
6431
6405
  });
@@ -6501,12 +6475,12 @@ var ka = "PopperContent", [Uv, Wv] = Ku(ka), Ju = v.forwardRef(
6501
6475
  updatePositionStrategy: h = "optimized",
6502
6476
  onPlaced: x,
6503
6477
  ...m
6504
- } = e, y = qu(ka, n), [g, b] = v.useState(null), w = qe(t, (Ee) => b(Ee)), [T, S] = v.useState(null), C = Vu(T), k = (C == null ? void 0 : C.width) ?? 0, E = (C == null ? void 0 : C.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""), L = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(c) ? c : [c], M = j.length > 0, $ = {
6478
+ } = e, y = qu(ka, n), [g, b] = v.useState(null), w = qe(t, (Ee) => b(Ee)), [T, S] = v.useState(null), C = Vu(T), k = (C == null ? void 0 : C.width) ?? 0, E = (C == null ? void 0 : C.height) ?? 0, N = r + (s !== "center" ? "-" + s : ""), L = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(c) ? c : [c], M = j.length > 0, F = {
6505
6479
  padding: L,
6506
6480
  boundary: j.filter(Kv),
6507
6481
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
6508
6482
  altBoundary: M
6509
- }, { refs: I, floatingStyles: F, placement: A, isPositioned: K, middlewareData: z } = _v({
6483
+ }, { refs: I, floatingStyles: $, placement: A, isPositioned: K, middlewareData: z } = _v({
6510
6484
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
6511
6485
  strategy: "fixed",
6512
6486
  placement: N,
@@ -6522,19 +6496,19 @@ var ka = "PopperContent", [Uv, Wv] = Ku(ka), Ju = v.forwardRef(
6522
6496
  mainAxis: !0,
6523
6497
  crossAxis: !1,
6524
6498
  limiter: f === "partial" ? Mv() : void 0,
6525
- ...$
6499
+ ...F
6526
6500
  }),
6527
- l && Dv({ ...$ }),
6501
+ l && Dv({ ...F }),
6528
6502
  Lv({
6529
- ...$,
6530
- apply: ({ elements: Ee, rects: Ge, availableWidth: $e, availableHeight: Ze }) => {
6503
+ ...F,
6504
+ apply: ({ elements: Ee, rects: Ge, availableWidth: Fe, availableHeight: Ze }) => {
6531
6505
  const { width: ie, height: ve } = Ge.reference, Ie = Ee.floating.style;
6532
- Ie.setProperty("--radix-popper-available-width", `${$e}px`), Ie.setProperty("--radix-popper-available-height", `${Ze}px`), Ie.setProperty("--radix-popper-anchor-width", `${ie}px`), Ie.setProperty("--radix-popper-anchor-height", `${ve}px`);
6506
+ Ie.setProperty("--radix-popper-available-width", `${Fe}px`), Ie.setProperty("--radix-popper-available-height", `${Ze}px`), Ie.setProperty("--radix-popper-anchor-width", `${ie}px`), Ie.setProperty("--radix-popper-anchor-height", `${ve}px`);
6533
6507
  }
6534
6508
  }),
6535
- T && Fv({ element: T, padding: a }),
6509
+ T && $v({ element: T, padding: a }),
6536
6510
  qv({ arrowWidth: k, arrowHeight: E }),
6537
- p && $v({ strategy: "referenceHidden", ...$ })
6511
+ p && Fv({ strategy: "referenceHidden", ...F })
6538
6512
  ]
6539
6513
  }), [_, X] = ed(A), J = Mt(x);
6540
6514
  Dt(() => {
@@ -6549,8 +6523,8 @@ var ka = "PopperContent", [Uv, Wv] = Ku(ka), Ju = v.forwardRef(
6549
6523
  ref: I.setFloating,
6550
6524
  "data-radix-popper-content-wrapper": "",
6551
6525
  style: {
6552
- ...F,
6553
- transform: K ? F.transform : "translate(0, -200%)",
6526
+ ...$,
6527
+ transform: K ? $.transform : "translate(0, -200%)",
6554
6528
  // keep off the page when measuring
6555
6529
  minWidth: "max-content",
6556
6530
  zIndex: q,
@@ -6805,10 +6779,10 @@ var rb = v.forwardRef((e, t) => {
6805
6779
  if (E.target === E.currentTarget && N && !g) {
6806
6780
  const L = new CustomEvent(hi, Zv);
6807
6781
  if (E.currentTarget.dispatchEvent(L), !L.defaultPrevented) {
6808
- const j = T().filter((A) => A.focusable), M = j.find((A) => A.active), $ = j.find((A) => A.id === m), F = [M, $, ...j].filter(
6782
+ const j = T().filter((A) => A.focusable), M = j.find((A) => A.active), F = j.find((A) => A.id === m), $ = [M, F, ...j].filter(
6809
6783
  Boolean
6810
6784
  ).map((A) => A.ref.current);
6811
- ud(F, d);
6785
+ ud($, d);
6812
6786
  }
6813
6787
  }
6814
6788
  S.current = !1;
@@ -6973,7 +6947,7 @@ function pb(e, t, n) {
6973
6947
  (s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
6974
6948
  return e.concat(s || Array.prototype.slice.call(t));
6975
6949
  }
6976
- var $o = "right-scroll-bar-position", Fo = "width-before-scroll-bar", hb = "with-scroll-bars-hidden", mb = "--removed-body-scroll-bar-size";
6950
+ var Fo = "right-scroll-bar-position", $o = "width-before-scroll-bar", hb = "with-scroll-bars-hidden", mb = "--removed-body-scroll-bar-size";
6977
6951
  function gi(e, t) {
6978
6952
  return typeof e == "function" ? e(t) : e && (e.current = t), e;
6979
6953
  }
@@ -7114,8 +7088,8 @@ _s.defaultProps = {
7114
7088
  inert: !1
7115
7089
  };
7116
7090
  _s.classNames = {
7117
- fullWidth: Fo,
7118
- zeroRight: $o
7091
+ fullWidth: $o,
7092
+ zeroRight: Fo
7119
7093
  };
7120
7094
  var Cb = function() {
7121
7095
  if (typeof __webpack_nonce__ < "u")
@@ -7205,19 +7179,19 @@ var Eb = function() {
7205
7179
  ].filter(Boolean).join(""), `
7206
7180
  }
7207
7181
 
7208
- .`).concat($o, ` {
7182
+ .`).concat(Fo, ` {
7209
7183
  right: `).concat(a, "px ").concat(r, `;
7210
7184
  }
7211
7185
 
7212
- .`).concat(Fo, ` {
7186
+ .`).concat($o, ` {
7213
7187
  margin-right: `).concat(a, "px ").concat(r, `;
7214
7188
  }
7215
7189
 
7216
- .`).concat($o, " .").concat($o, ` {
7190
+ .`).concat(Fo, " .").concat(Fo, ` {
7217
7191
  right: 0 `).concat(r, `;
7218
7192
  }
7219
7193
 
7220
- .`).concat(Fo, " .").concat(Fo, ` {
7194
+ .`).concat($o, " .").concat($o, ` {
7221
7195
  margin-right: 0 `).concat(r, `;
7222
7196
  }
7223
7197
 
@@ -7267,7 +7241,7 @@ var ur = Hi ? { passive: !1 } : !1, Db = function(e) {
7267
7241
  );
7268
7242
  }, Lb = function(e) {
7269
7243
  return gd(e, "overflowY");
7270
- }, $b = function(e) {
7244
+ }, Fb = function(e) {
7271
7245
  return gd(e, "overflowX");
7272
7246
  }, oc = function(e, t) {
7273
7247
  var n = t.ownerDocument, r = t;
@@ -7282,7 +7256,7 @@ var ur = Hi ? { passive: !1 } : !1, Db = function(e) {
7282
7256
  r = r.parentNode;
7283
7257
  } while (r && r !== n.body);
7284
7258
  return !1;
7285
- }, Fb = function(e) {
7259
+ }, $b = function(e) {
7286
7260
  var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
7287
7261
  return [
7288
7262
  t,
@@ -7297,9 +7271,9 @@ var ur = Hi ? { passive: !1 } : !1, Db = function(e) {
7297
7271
  r
7298
7272
  ];
7299
7273
  }, xd = function(e, t) {
7300
- return e === "v" ? Lb(t) : $b(t);
7274
+ return e === "v" ? Lb(t) : Fb(t);
7301
7275
  }, yd = function(e, t) {
7302
- return e === "v" ? Fb(t) : zb(t);
7276
+ return e === "v" ? $b(t) : zb(t);
7303
7277
  }, Bb = function(e, t) {
7304
7278
  return e === "h" && t === "rtl" ? -1 : 1;
7305
7279
  }, Hb = function(e, t, n, r, o) {
@@ -7537,7 +7511,7 @@ var nn = "MenuContent", [sw, Na] = or(nn), kd = v.forwardRef(
7537
7511
  onDismiss: h,
7538
7512
  disableOutsideScroll: x,
7539
7513
  ...m
7540
- } = e, y = sr(nn, n), g = ho(nn, n), b = Ps(n), w = wd(n), T = Qb(n), [S, C] = v.useState(null), k = v.useRef(null), E = qe(t, k, y.onContentChange), N = v.useRef(0), L = v.useRef(""), j = v.useRef(0), M = v.useRef(null), $ = v.useRef("right"), I = v.useRef(0), F = x ? js : v.Fragment, A = x ? { as: lw, allowPinchZoom: !0 } : void 0, K = (_) => {
7514
+ } = e, y = sr(nn, n), g = ho(nn, n), b = Ps(n), w = wd(n), T = Qb(n), [S, C] = v.useState(null), k = v.useRef(null), E = qe(t, k, y.onContentChange), N = v.useRef(0), L = v.useRef(""), j = v.useRef(0), M = v.useRef(null), F = v.useRef("right"), I = v.useRef(0), $ = x ? js : v.Fragment, A = x ? { as: lw, allowPinchZoom: !0 } : void 0, K = (_) => {
7541
7515
  var Z, D;
7542
7516
  const X = L.current + _, J = T().filter((G) => !G.disabled), se = document.activeElement, ye = (Z = J.find((G) => G.ref.current === se)) == null ? void 0 : Z.textValue, Pe = J.map((G) => G.textValue), q = bw(Pe, X, ye), H = (D = J.find((G) => G.textValue === q)) == null ? void 0 : D.ref.current;
7543
7517
  (function G(Q) {
@@ -7547,7 +7521,7 @@ var nn = "MenuContent", [sw, Na] = or(nn), kd = v.forwardRef(
7547
7521
  v.useEffect(() => () => window.clearTimeout(N.current), []), xa();
7548
7522
  const z = v.useCallback((_) => {
7549
7523
  var J, se;
7550
- return $.current === ((J = M.current) == null ? void 0 : J.side) && Sw(_, (se = M.current) == null ? void 0 : se.area);
7524
+ return F.current === ((J = M.current) == null ? void 0 : J.side) && Sw(_, (se = M.current) == null ? void 0 : se.area);
7551
7525
  }, []);
7552
7526
  return /* @__PURE__ */ u.jsx(
7553
7527
  sw,
@@ -7577,7 +7551,7 @@ var nn = "MenuContent", [sw, Na] = or(nn), kd = v.forwardRef(
7577
7551
  onPointerGraceIntentChange: v.useCallback((_) => {
7578
7552
  M.current = _;
7579
7553
  }, []),
7580
- children: /* @__PURE__ */ u.jsx(F, { ...A, children: /* @__PURE__ */ u.jsx(
7554
+ children: /* @__PURE__ */ u.jsx($, { ...A, children: /* @__PURE__ */ u.jsx(
7581
7555
  Ts,
7582
7556
  {
7583
7557
  asChild: !0,
@@ -7641,7 +7615,7 @@ var nn = "MenuContent", [sw, Na] = or(nn), kd = v.forwardRef(
7641
7615
  const X = _.target, J = I.current !== _.clientX;
7642
7616
  if (_.currentTarget.contains(X) && J) {
7643
7617
  const se = _.clientX > I.current ? "right" : "left";
7644
- $.current = se, I.current = _.clientX;
7618
+ F.current = se, I.current = _.clientX;
7645
7619
  }
7646
7620
  })
7647
7621
  )
@@ -7844,9 +7818,9 @@ var gw = "MenuArrow", Dd = v.forwardRef(
7844
7818
  }
7845
7819
  );
7846
7820
  Dd.displayName = gw;
7847
- var xw = "MenuSub", [kk, Ld] = or(xw), $r = "MenuSubTrigger", $d = v.forwardRef(
7821
+ var xw = "MenuSub", [kk, Ld] = or(xw), Fr = "MenuSubTrigger", Fd = v.forwardRef(
7848
7822
  (e, t) => {
7849
- const n = sr($r, e.__scopeMenu), r = ho($r, e.__scopeMenu), o = Ld($r, e.__scopeMenu), s = Na($r, e.__scopeMenu), i = v.useRef(null), { pointerGraceTimerRef: a, onPointerGraceIntentChange: l } = s, c = { __scopeMenu: e.__scopeMenu }, d = v.useCallback(() => {
7823
+ const n = sr(Fr, e.__scopeMenu), r = ho(Fr, e.__scopeMenu), o = Ld(Fr, e.__scopeMenu), s = Na(Fr, e.__scopeMenu), i = v.useRef(null), { pointerGraceTimerRef: a, onPointerGraceIntentChange: l } = s, c = { __scopeMenu: e.__scopeMenu }, d = v.useCallback(() => {
7850
7824
  i.current && window.clearTimeout(i.current), i.current = null;
7851
7825
  }, []);
7852
7826
  return v.useEffect(() => d, [d]), v.useEffect(() => {
@@ -7914,10 +7888,10 @@ var xw = "MenuSub", [kk, Ld] = or(xw), $r = "MenuSubTrigger", $d = v.forwardRef(
7914
7888
  ) });
7915
7889
  }
7916
7890
  );
7917
- $d.displayName = $r;
7918
- var Fd = "MenuSubContent", zd = v.forwardRef(
7891
+ Fd.displayName = Fr;
7892
+ var $d = "MenuSubContent", zd = v.forwardRef(
7919
7893
  (e, t) => {
7920
- const n = Cd(nn, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = sr(nn, e.__scopeMenu), i = ho(nn, e.__scopeMenu), a = Ld(Fd, e.__scopeMenu), l = v.useRef(null), c = qe(t, l);
7894
+ const n = Cd(nn, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = sr(nn, e.__scopeMenu), i = ho(nn, e.__scopeMenu), a = Ld($d, e.__scopeMenu), l = v.useRef(null), c = qe(t, l);
7921
7895
  return /* @__PURE__ */ u.jsx(Xr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(on, { present: r || s.open, children: /* @__PURE__ */ u.jsx(Xr.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(
7922
7896
  Aa,
7923
7897
  {
@@ -7950,7 +7924,7 @@ var Fd = "MenuSubContent", zd = v.forwardRef(
7950
7924
  ) }) }) });
7951
7925
  }
7952
7926
  );
7953
- zd.displayName = Fd;
7927
+ zd.displayName = $d;
7954
7928
  function Bd(e) {
7955
7929
  return e ? "open" : "closed";
7956
7930
  }
@@ -7994,10 +7968,10 @@ function Sw(e, t) {
7994
7968
  function Jr(e) {
7995
7969
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
7996
7970
  }
7997
- var Cw = Sd, Tw = Ea, kw = Td, Rw = kd, Ew = _a, Iw = Rd, Nw = Os, Aw = Id, _w = Ad, jw = jd, Pw = Od, Ow = Md, Mw = Dd, Dw = $d, Lw = zd, Ms = "DropdownMenu", [$w, Rk] = Pn(
7971
+ var Cw = Sd, Tw = Ea, kw = Td, Rw = kd, Ew = _a, Iw = Rd, Nw = Os, Aw = Id, _w = Ad, jw = jd, Pw = Od, Ow = Md, Mw = Dd, Dw = Fd, Lw = zd, Ms = "DropdownMenu", [Fw, Rk] = Pn(
7998
7972
  Ms,
7999
7973
  [bd]
8000
- ), Ht = bd(), [Fw, Hd] = $w(Ms), Ud = (e) => {
7974
+ ), Ht = bd(), [$w, Hd] = Fw(Ms), Ud = (e) => {
8001
7975
  const {
8002
7976
  __scopeDropdownMenu: t,
8003
7977
  children: n,
@@ -8013,7 +7987,7 @@ var Cw = Sd, Tw = Ea, kw = Td, Rw = kd, Ew = _a, Iw = Rd, Nw = Os, Aw = Id, _w =
8013
7987
  caller: Ms
8014
7988
  });
8015
7989
  return /* @__PURE__ */ u.jsx(
8016
- Fw,
7990
+ $w,
8017
7991
  {
8018
7992
  scope: t,
8019
7993
  triggerId: Nn(),
@@ -8364,7 +8338,7 @@ function Le(e, t) {
8364
8338
  function Ma(e) {
8365
8339
  e(Ir);
8366
8340
  }
8367
- function Rt(e) {
8341
+ function kt(e) {
8368
8342
  return e(hf);
8369
8343
  }
8370
8344
  function xe(e, t) {
@@ -8531,7 +8505,7 @@ function S0(e) {
8531
8505
  };
8532
8506
  return n(e);
8533
8507
  }
8534
- function At(...e) {
8508
+ function Nt(...e) {
8535
8509
  const t = Ke(), n = new Array(e.length);
8536
8510
  let r = 0;
8537
8511
  const o = Math.pow(2, e.length) - 1;
@@ -8579,7 +8553,7 @@ const C0 = {
8579
8553
  return {
8580
8554
  log: ee((t, n, r = 1) => {
8581
8555
  var o;
8582
- const s = (o = T0().VIRTUOSO_LOG_LEVEL) != null ? o : Rt(e);
8556
+ const s = (o = T0().VIRTUOSO_LOG_LEVEL) != null ? o : kt(e);
8583
8557
  r >= s && console[C0[r]](
8584
8558
  "%creact-virtuoso: %c%s %o",
8585
8559
  "color: #0253b3; font-weight: bold",
@@ -8769,12 +8743,12 @@ function fn(e, t, n = "k") {
8769
8743
  return fn(e.l, t, n);
8770
8744
  }
8771
8745
  function Yt(e, t, n) {
8772
- return ct(e) ? wf(t, n, 1) : t === e.k ? jt(e, { k: t, v: n }) : t < e.k ? fc(jt(e, { l: Yt(e.l, t, n) })) : fc(jt(e, { r: Yt(e.r, t, n) }));
8746
+ return ct(e) ? wf(t, n, 1) : t === e.k ? _t(e, { k: t, v: n }) : t < e.k ? fc(_t(e, { l: Yt(e.l, t, n) })) : fc(_t(e, { r: Yt(e.r, t, n) }));
8773
8747
  }
8774
8748
  function xr() {
8775
8749
  return Zr;
8776
8750
  }
8777
- function $s(e, t, n) {
8751
+ function Fs(e, t, n) {
8778
8752
  if (ct(e))
8779
8753
  return [];
8780
8754
  const r = fn(e, t)[0];
@@ -8790,9 +8764,9 @@ function Ki(e, t) {
8790
8764
  return r;
8791
8765
  {
8792
8766
  const [s, i] = bf(r);
8793
- return Bo(jt(e, { k: s, l: vf(r), v: i }));
8767
+ return Bo(_t(e, { k: s, l: vf(r), v: i }));
8794
8768
  }
8795
- } else return t < n ? Bo(jt(e, { l: Ki(r, t) })) : Bo(jt(e, { r: Ki(o, t) }));
8769
+ } else return t < n ? Bo(_t(e, { l: Ki(r, t) })) : Bo(_t(e, { r: Ki(o, t) }));
8796
8770
  }
8797
8771
  function Gn(e) {
8798
8772
  return ct(e) ? [] : [...Gn(e.l), { k: e.k, v: e.v }, ...Gn(e.r)];
@@ -8810,12 +8784,12 @@ function Bo(e) {
8810
8784
  return e;
8811
8785
  if (n > r.lvl + 1) {
8812
8786
  if (vi(t))
8813
- return Sf(jt(e, { lvl: n - 1 }));
8787
+ return Sf(_t(e, { lvl: n - 1 }));
8814
8788
  if (!ct(t) && !ct(t.r))
8815
- return jt(t.r, {
8816
- l: jt(t, { r: t.r.l }),
8789
+ return _t(t.r, {
8790
+ l: _t(t, { r: t.r.l }),
8817
8791
  lvl: n,
8818
- r: jt(e, {
8792
+ r: _t(e, {
8819
8793
  l: t.r.r,
8820
8794
  lvl: n - 1
8821
8795
  })
@@ -8823,22 +8797,22 @@ function Bo(e) {
8823
8797
  throw new Error("Unexpected empty nodes");
8824
8798
  } else {
8825
8799
  if (vi(e))
8826
- return Gi(jt(e, { lvl: n - 1 }));
8800
+ return Gi(_t(e, { lvl: n - 1 }));
8827
8801
  if (!ct(r) && !ct(r.l)) {
8828
8802
  const o = r.l, s = vi(o) ? r.lvl - 1 : r.lvl;
8829
- return jt(o, {
8830
- l: jt(e, {
8803
+ return _t(o, {
8804
+ l: _t(e, {
8831
8805
  lvl: n - 1,
8832
8806
  r: o.l
8833
8807
  }),
8834
8808
  lvl: o.lvl + 1,
8835
- r: Gi(jt(r, { l: o.r, lvl: s }))
8809
+ r: Gi(_t(r, { l: o.r, lvl: s }))
8836
8810
  });
8837
8811
  } else
8838
8812
  throw new Error("Unexpected empty nodes");
8839
8813
  }
8840
8814
  }
8841
- function jt(e, t) {
8815
+ function _t(e, t) {
8842
8816
  return wf(
8843
8817
  t.k !== void 0 ? t.k : e.k,
8844
8818
  t.v !== void 0 ? t.v : e.v,
@@ -8848,7 +8822,7 @@ function jt(e, t) {
8848
8822
  );
8849
8823
  }
8850
8824
  function vf(e) {
8851
- return ct(e.r) ? e.l : Bo(jt(e, { r: vf(e.r) }));
8825
+ return ct(e.r) ? e.l : Bo(_t(e, { r: vf(e.r) }));
8852
8826
  }
8853
8827
  function vi(e) {
8854
8828
  return ct(e) || e.lvl > e.r.lvl;
@@ -8864,11 +8838,11 @@ function fc(e) {
8864
8838
  }
8865
8839
  function Sf(e) {
8866
8840
  const { l: t } = e;
8867
- return !ct(t) && t.lvl === e.lvl ? jt(t, { r: jt(e, { l: t.r }) }) : e;
8841
+ return !ct(t) && t.lvl === e.lvl ? _t(t, { r: _t(e, { l: t.r }) }) : e;
8868
8842
  }
8869
8843
  function Gi(e) {
8870
8844
  const { lvl: t, r: n } = e;
8871
- return !ct(n) && !ct(n.r) && n.lvl === t && n.r.lvl === t ? jt(n, { l: jt(e, { r: n.l }), lvl: t + 1 }) : e;
8845
+ return !ct(n) && !ct(n.r) && n.lvl === t && n.r.lvl === t ? _t(n, { l: _t(e, { r: n.l }), lvl: t + 1 }) : e;
8872
8846
  }
8873
8847
  function E0(e) {
8874
8848
  return yf(e, ({ k: t, v: n }) => ({ index: t, value: n }));
@@ -8909,13 +8883,13 @@ function I0(e, t, n, r) {
8909
8883
  const o = es(e, t, r), s = es(e, n, r, o);
8910
8884
  return e.slice(o, s + 1);
8911
8885
  }
8912
- function $n(e, t) {
8886
+ function Fn(e, t) {
8913
8887
  return Math.round(e.getBoundingClientRect()[t]);
8914
8888
  }
8915
- function Fs(e) {
8889
+ function $s(e) {
8916
8890
  return !ct(e.groupOffsetTree);
8917
8891
  }
8918
- function $a({ index: e }, t) {
8892
+ function Fa({ index: e }, t) {
8919
8893
  return t === e ? 0 : t < e ? -1 : 1;
8920
8894
  }
8921
8895
  function N0() {
@@ -8937,7 +8911,7 @@ function A0(e, t) {
8937
8911
  e = Yt(e, 0, s);
8938
8912
  continue;
8939
8913
  }
8940
- const a = $s(e, i - 1, o + 1);
8914
+ const a = Fs(e, i - 1, o + 1);
8941
8915
  if (a.some(L0(r)))
8942
8916
  continue;
8943
8917
  let l = !1, c = !1;
@@ -8956,11 +8930,11 @@ function j0({ offset: e }, t) {
8956
8930
  function to(e, t, n) {
8957
8931
  if (t.length === 0)
8958
8932
  return 0;
8959
- const { index: r, offset: o, size: s } = Tf(t, e, $a), i = e - r, a = s * i + (i - 1) * n + o;
8933
+ const { index: r, offset: o, size: s } = Tf(t, e, Fa), i = e - r, a = s * i + (i - 1) * n + o;
8960
8934
  return a > 0 ? a + n : a;
8961
8935
  }
8962
8936
  function kf(e, t) {
8963
- if (!Fs(t))
8937
+ if (!$s(t))
8964
8938
  return e;
8965
8939
  let n = 0;
8966
8940
  for (; t.groupIndices[n] <= e + n; )
@@ -8977,7 +8951,7 @@ function Rf(e, t, n) {
8977
8951
  }
8978
8952
  }
8979
8953
  function P0(e, t, n, r = 0) {
8980
- return r > 0 && (t = Math.max(t, Tf(e, r, $a).offset)), yf(I0(e, t, n, j0), D0);
8954
+ return r > 0 && (t = Math.max(t, Tf(e, r, Fa).offset)), yf(I0(e, t, n, j0), D0);
8981
8955
  }
8982
8956
  function O0(e, [t, n, r, o]) {
8983
8957
  t.length > 0 && r("received item sizes", t, qt.DEBUG);
@@ -9016,12 +8990,12 @@ function pc(e, t) {
9016
8990
  function Yi(e, t, n, r) {
9017
8991
  let o = e, s = 0, i = 0, a = 0, l = 0;
9018
8992
  if (t !== 0) {
9019
- l = es(o, t - 1, $a), a = o[l].offset;
8993
+ l = es(o, t - 1, Fa), a = o[l].offset;
9020
8994
  const c = fn(n, t - 1);
9021
8995
  s = c[0], i = c[1], o.length && o[l].size === fn(n, t)[1] && (l -= 1), o = o.slice(0, l + 1);
9022
8996
  } else
9023
8997
  o = [];
9024
- for (const { start: c, value: d } of $s(n, t, 1 / 0)) {
8998
+ for (const { start: c, value: d } of Fs(n, t, 1 / 0)) {
9025
8999
  const f = c - s, p = f * i + a + f * r;
9026
9000
  o.push({
9027
9001
  index: c,
@@ -9043,12 +9017,12 @@ function L0(e) {
9043
9017
  const { endIndex: t, size: n, startIndex: r } = e;
9044
9018
  return (o) => o.start === r && (o.end === t || o.end === 1 / 0) && o.value === n;
9045
9019
  }
9046
- const $0 = {
9020
+ const F0 = {
9047
9021
  offsetHeight: "height",
9048
9022
  offsetWidth: "width"
9049
9023
  }, Tn = et(
9050
9024
  ([{ log: e }, { recalcInProgress: t }]) => {
9051
- const n = Ke(), r = Ke(), o = zt(r, 0), s = Ke(), i = Ke(), a = ee(0), l = ee([]), c = ee(void 0), d = ee(void 0), f = ee((S, C) => $n(S, $0[C])), p = ee(void 0), h = ee(0), x = N0(), m = zt(
9025
+ const n = Ke(), r = Ke(), o = zt(r, 0), s = Ke(), i = Ke(), a = ee(0), l = ee([]), c = ee(void 0), d = ee(void 0), f = ee((S, C) => Fn(S, F0[C])), p = ee(void 0), h = ee(0), x = N0(), m = zt(
9052
9026
  W(n, Be(l, e, h), bn(O0, x), mt()),
9053
9027
  x
9054
9028
  ), y = zt(
@@ -9103,7 +9077,7 @@ const $0 = {
9103
9077
  xe(
9104
9078
  W(
9105
9079
  d,
9106
- Re((S) => S !== void 0 && ct(Rt(m).sizeTree)),
9080
+ Re((S) => S !== void 0 && ct(kt(m).sizeTree)),
9107
9081
  de((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
9108
9082
  ),
9109
9083
  n
@@ -9132,11 +9106,11 @@ const $0 = {
9132
9106
  de((S) => S.diff)
9133
9107
  ),
9134
9108
  (S) => {
9135
- const { groupIndices: C } = Rt(m);
9109
+ const { groupIndices: C } = kt(m);
9136
9110
  if (S > 0)
9137
9111
  Le(t, !0), Le(s, S + pc(S, C));
9138
9112
  else if (S < 0) {
9139
- const k = Rt(y);
9113
+ const k = kt(y);
9140
9114
  k.length > 0 && (S -= pc(-S, k)), Le(i, S);
9141
9115
  }
9142
9116
  }
@@ -9158,30 +9132,30 @@ const $0 = {
9158
9132
  const L = Qr(C.sizeTree, 0);
9159
9133
  let j = 0, M = 0;
9160
9134
  for (; j < S; ) {
9161
- const I = C.groupIndices[M], F = C.groupIndices.length === M + 1 ? 1 / 0 : C.groupIndices[M + 1] - I - 1;
9135
+ const I = C.groupIndices[M], $ = C.groupIndices.length === M + 1 ? 1 / 0 : C.groupIndices[M + 1] - I - 1;
9162
9136
  E.push({
9163
9137
  endIndex: I,
9164
9138
  size: L,
9165
9139
  startIndex: I
9166
9140
  }), E.push({
9167
- endIndex: I + 1 + F - 1,
9141
+ endIndex: I + 1 + $ - 1,
9168
9142
  size: N,
9169
9143
  startIndex: I + 1
9170
- }), M++, j += F + 1;
9144
+ }), M++, j += $ + 1;
9171
9145
  }
9172
- const $ = Gn(C.sizeTree);
9173
- return j !== S && $.shift(), $.reduce(
9174
- (I, { k: F, v: A }) => {
9146
+ const F = Gn(C.sizeTree);
9147
+ return j !== S && F.shift(), F.reduce(
9148
+ (I, { k: $, v: A }) => {
9175
9149
  let K = I.ranges;
9176
9150
  return I.prevSize !== 0 && (K = [
9177
9151
  ...I.ranges,
9178
9152
  {
9179
- endIndex: F + S - 1,
9153
+ endIndex: $ + S - 1,
9180
9154
  size: I.prevSize,
9181
9155
  startIndex: I.prevIndex
9182
9156
  }
9183
9157
  ]), {
9184
- prevIndex: F + S,
9158
+ prevIndex: $ + S,
9185
9159
  prevSize: A,
9186
9160
  ranges: K
9187
9161
  };
@@ -9228,16 +9202,16 @@ const $0 = {
9228
9202
  if (ct(C.sizeTree))
9229
9203
  return C;
9230
9204
  let E = xr();
9231
- const N = Rt(y);
9205
+ const N = kt(y);
9232
9206
  let L = 0, j = 0, M = 0;
9233
9207
  for (; L < -S; ) {
9234
9208
  M = N[j];
9235
- const $ = N[j + 1] - M - 1;
9236
- j++, L += $ + 1;
9209
+ const F = N[j + 1] - M - 1;
9210
+ j++, L += F + 1;
9237
9211
  }
9238
- if (E = Gn(C.sizeTree).reduce(($, { k: I, v: F }) => Yt($, Math.max(0, I + S), F), E), L !== -S) {
9239
- const $ = Qr(C.sizeTree, M);
9240
- E = Yt(E, 0, $);
9212
+ if (E = Gn(C.sizeTree).reduce((F, { k: I, v: $ }) => Yt(F, Math.max(0, I + S), $), E), L !== -S) {
9213
+ const F = Qr(C.sizeTree, M);
9214
+ E = Yt(E, 0, F);
9241
9215
  const I = fn(C.sizeTree, -S + 1)[1];
9242
9216
  E = Yt(E, 1, I);
9243
9217
  }
@@ -9282,7 +9256,7 @@ const $0 = {
9282
9256
  gt(Hn, La),
9283
9257
  { singleton: !0 }
9284
9258
  );
9285
- function F0(e) {
9259
+ function $0(e) {
9286
9260
  return e.reduce(
9287
9261
  (t, n) => (t.groupIndices.push(t.totalCount), t.totalCount += n + 1, t),
9288
9262
  {
@@ -9293,7 +9267,7 @@ function F0(e) {
9293
9267
  }
9294
9268
  const Ef = et(
9295
9269
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
9296
- const s = Ke(), i = Ke(), a = Jt(W(s, de(F0)));
9270
+ const s = Ke(), i = Ke(), a = Jt(W(s, de($0)));
9297
9271
  return xe(
9298
9272
  W(
9299
9273
  a,
@@ -9308,8 +9282,8 @@ const Ef = et(
9308
9282
  e
9309
9283
  ), xe(
9310
9284
  W(
9311
- At(o, t, r),
9312
- Re(([l, c]) => Fs(c)),
9285
+ Nt(o, t, r),
9286
+ Re(([l, c]) => $s(c)),
9313
9287
  de(([l, c, d]) => fn(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
9314
9288
  mt(),
9315
9289
  de((l) => [l])
@@ -9328,7 +9302,7 @@ const Ef = et(
9328
9302
  )
9329
9303
  );
9330
9304
  return it(t, (r) => {
9331
- r && Rt(e)("props updated", {}, qt.DEBUG);
9305
+ r && kt(e)("props updated", {}, qt.DEBUG);
9332
9306
  }), { didMount: n, propsReady: t };
9333
9307
  },
9334
9308
  gt(Hn),
@@ -9367,12 +9341,12 @@ const mo = et(
9367
9341
  ([
9368
9342
  [T, S, C, k, E, N, L, j],
9369
9343
  M,
9370
- $,
9344
+ F,
9371
9345
  I
9372
9346
  ]) => {
9373
- const F = If(T), { align: A, behavior: K, offset: z } = F, _ = k - 1, X = Rf(F, S, _);
9347
+ const $ = If(T), { align: A, behavior: K, offset: z } = $, _ = k - 1, X = Rf($, S, _);
9374
9348
  let J = to(X, S.offsetTree, M) + N;
9375
- A === "end" ? (J += $ + fn(S.sizeTree, X)[1] - C + I, X === _ && (J += L)) : A === "center" ? J += ($ + fn(S.sizeTree, X)[1] - C + I) / 2 : J -= E, z && (J += z);
9349
+ A === "end" ? (J += F + fn(S.sizeTree, X)[1] - C + I, X === _ && (J += L)) : A === "center" ? J += (F + fn(S.sizeTree, X)[1] - C + I) / 2 : J -= E, z && (J += z);
9376
9350
  const se = (ye) => {
9377
9351
  w(), ye ? (j("retrying to scroll to", { location: T }, qt.DEBUG), Le(h, T)) : (Le(x, !0), j("list did not change, scroll successful", {}, qt.DEBUG));
9378
9352
  };
@@ -9411,9 +9385,9 @@ function B0(e) {
9411
9385
  };
9412
9386
  };
9413
9387
  }
9414
- function Fa(e, t) {
9388
+ function $a(e, t) {
9415
9389
  e == 0 ? t() : requestAnimationFrame(() => {
9416
- Fa(e - 1, t);
9390
+ $a(e - 1, t);
9417
9391
  });
9418
9392
  }
9419
9393
  function za(e, t) {
@@ -9441,7 +9415,7 @@ const go = et(
9441
9415
  c
9442
9416
  ), it(
9443
9417
  W(
9444
- At(t, i),
9418
+ Nt(t, i),
9445
9419
  Be(a, n, e, c),
9446
9420
  Re(([[, d], f, { sizeTree: p }, h, x]) => d && (!ct(p) || Oa(h)) && !f && !x),
9447
9421
  Be(l)
@@ -9449,7 +9423,7 @@ const go = et(
9449
9423
  ([, d]) => {
9450
9424
  cn(o, () => {
9451
9425
  Le(c, !0);
9452
- }), Fa(4, () => {
9426
+ }), $a(4, () => {
9453
9427
  cn(r, () => {
9454
9428
  Le(a, !0);
9455
9429
  }), Le(s, d);
@@ -9489,7 +9463,7 @@ const no = "up", Br = "down", H0 = "none", U0 = {
9489
9463
  );
9490
9464
  xe(
9491
9465
  W(
9492
- At(ke(o), ke(f)),
9466
+ Nt(ke(o), ke(f)),
9493
9467
  de(([b, w]) => b <= w),
9494
9468
  mt()
9495
9469
  ),
@@ -9497,7 +9471,7 @@ const no = "up", Br = "down", H0 = "none", U0 = {
9497
9471
  ), xe(W(a, In(50)), c);
9498
9472
  const x = Jt(
9499
9473
  W(
9500
- At(r, ke(s), ke(t), ke(e), ke(d)),
9474
+ Nt(r, ke(s), ke(t), ke(e), ke(d)),
9501
9475
  bn((b, [{ scrollHeight: w, scrollTop: T }, S, C, k, E]) => {
9502
9476
  const N = T + S - w > -E, L = {
9503
9477
  scrollHeight: w,
@@ -9505,11 +9479,11 @@ const no = "up", Br = "down", H0 = "none", U0 = {
9505
9479
  viewportHeight: S
9506
9480
  };
9507
9481
  if (N) {
9508
- let M, $;
9509
- return T > b.state.scrollTop ? (M = "SCROLLED_DOWN", $ = b.state.scrollTop - T) : (M = "SIZE_DECREASED", $ = b.state.scrollTop - T || b.scrollTopDelta), {
9482
+ let M, F;
9483
+ return T > b.state.scrollTop ? (M = "SCROLLED_DOWN", F = b.state.scrollTop - T) : (M = "SIZE_DECREASED", F = b.state.scrollTop - T || b.scrollTopDelta), {
9510
9484
  atBottom: !0,
9511
9485
  atBottomBecause: M,
9512
- scrollTopDelta: $,
9486
+ scrollTopDelta: F,
9513
9487
  state: L
9514
9488
  };
9515
9489
  }
@@ -9570,7 +9544,7 @@ const no = "up", Br = "down", H0 = "none", U0 = {
9570
9544
  de(({ scrollTop: b }) => b),
9571
9545
  mt(),
9572
9546
  bn(
9573
- (b, w) => Rt(h) ? { direction: b.direction, prevScrollTop: w } : { direction: w < b.prevScrollTop ? no : Br, prevScrollTop: w },
9547
+ (b, w) => kt(h) ? { direction: b.direction, prevScrollTop: w } : { direction: w < b.prevScrollTop ? no : Br, prevScrollTop: w },
9574
9548
  { direction: Br, prevScrollTop: 0 }
9575
9549
  ),
9576
9550
  de((b) => b.direction)
@@ -9620,7 +9594,7 @@ const Ba = et(
9620
9594
  ([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
9621
9595
  const s = Ke(), i = ee(0), a = ee(0), l = ee(0), c = zt(
9622
9596
  W(
9623
- At(
9597
+ Nt(
9624
9598
  ke(r),
9625
9599
  ke(o),
9626
9600
  ke(n),
@@ -9671,7 +9645,7 @@ const Ba = et(
9671
9645
  { singleton: !0 }
9672
9646
  );
9673
9647
  function V0(e, t, n) {
9674
- if (Fs(t)) {
9648
+ if ($s(t)) {
9675
9649
  const r = kf(e, t);
9676
9650
  return [
9677
9651
  { index: fn(t.groupOffsetTree, r)[0], offset: 0, size: 0 },
@@ -9731,9 +9705,9 @@ function Af(e, t, n, r, o, s) {
9731
9705
  function xc(e, t, n) {
9732
9706
  if (e.length === 0)
9733
9707
  return [];
9734
- if (!Fs(t))
9708
+ if (!$s(t))
9735
9709
  return e.map((c) => ({ ...c, index: c.index + n, originalIndex: c.index }));
9736
- const r = e[0].index, o = e[e.length - 1].index, s = [], i = $s(t.groupOffsetTree, r, o);
9710
+ const r = e[0].index, o = e[e.length - 1].index, s = [], i = Fs(t.groupOffsetTree, r, o);
9737
9711
  let a, l = 0;
9738
9712
  for (const c of e) {
9739
9713
  (!a || a.end < c.index) && (a = i.shift(), l = t.groupIndices.indexOf(a.start));
@@ -9769,7 +9743,7 @@ const ar = et(
9769
9743
  xe(s.topItemsIndexes, m);
9770
9744
  const b = zt(
9771
9745
  W(
9772
- At(
9746
+ Nt(
9773
9747
  h,
9774
9748
  x,
9775
9749
  ke(l, eo),
@@ -9796,36 +9770,36 @@ const ar = et(
9796
9770
  L,
9797
9771
  j,
9798
9772
  M,
9799
- $,
9773
+ F,
9800
9774
  I,
9801
- F
9775
+ $
9802
9776
  ]) => {
9803
- const A = N, { offsetTree: K, sizeTree: z } = A, _ = Rt(y);
9777
+ const A = N, { offsetTree: K, sizeTree: z } = A, _ = kt(y);
9804
9778
  if (E === 0)
9805
9779
  return { ...bi, totalCount: E };
9806
9780
  if (C === 0 && k === 0)
9807
- return _ === 0 ? { ...bi, totalCount: E } : Af(_, L, N, $, I, F || []);
9781
+ return _ === 0 ? { ...bi, totalCount: E } : Af(_, L, N, F, I, $ || []);
9808
9782
  if (ct(z))
9809
9783
  return _ > 0 ? null : Ho(
9810
- V0(za(L, E), A, F),
9784
+ V0(za(L, E), A, $),
9811
9785
  [],
9812
9786
  E,
9813
9787
  I,
9814
9788
  A,
9815
- $
9789
+ F
9816
9790
  );
9817
9791
  const X = [];
9818
9792
  if (M.length > 0) {
9819
9793
  const q = M[0], H = M[M.length - 1];
9820
9794
  let Z = 0;
9821
- for (const D of $s(z, q, H)) {
9795
+ for (const D of Fs(z, q, H)) {
9822
9796
  const G = D.value, Q = Math.max(D.start, q), ue = Math.min(D.end, H);
9823
9797
  for (let oe = Q; oe <= ue; oe++)
9824
- X.push({ data: F == null ? void 0 : F[oe], index: oe, offset: Z, size: G }), Z += G;
9798
+ X.push({ data: $ == null ? void 0 : $[oe], index: oe, offset: Z, size: G }), Z += G;
9825
9799
  }
9826
9800
  }
9827
9801
  if (!j)
9828
- return Ho([], X, E, I, A, $);
9802
+ return Ho([], X, E, I, A, F);
9829
9803
  const J = M.length > 0 ? M[M.length - 1] + 1 : 0, se = P0(K, C, k, J);
9830
9804
  if (se.length === 0)
9831
9805
  return null;
@@ -9842,10 +9816,10 @@ const ar = et(
9842
9816
  G < J && (D += (J - G) * Q, G = J);
9843
9817
  const ue = Math.min(H.end, ye);
9844
9818
  for (let oe = G; oe <= ue && !(D >= k); oe++)
9845
- q.push({ data: F == null ? void 0 : F[oe], index: oe, offset: D, size: Q }), D += Q + I;
9819
+ q.push({ data: $ == null ? void 0 : $[oe], index: oe, offset: D, size: Q }), D += Q + I;
9846
9820
  }
9847
9821
  });
9848
- return Ho(Pe, X, E, I, A, $);
9822
+ return Ho(Pe, X, E, I, A, F);
9849
9823
  }
9850
9824
  ),
9851
9825
  //@ts-expect-error filter needs to be fixed
@@ -9933,7 +9907,7 @@ const ar = et(
9933
9907
  ([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
9934
9908
  const s = Ke(), i = zt(
9935
9909
  W(
9936
- At(n, e, r, t, o),
9910
+ Nt(n, e, r, t, o),
9937
9911
  de(([a, l, c, d, f]) => a + l + c + d + f.offsetBottom + f.bottom)
9938
9912
  ),
9939
9913
  0
@@ -9946,7 +9920,7 @@ const ar = et(
9946
9920
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
9947
9921
  const n = ee(!1), r = zt(
9948
9922
  W(
9949
- At(n, e, t),
9923
+ Nt(n, e, t),
9950
9924
  Re(([o]) => o),
9951
9925
  de(([, o, s]) => Math.max(0, o - s)),
9952
9926
  In(0),
@@ -9979,20 +9953,20 @@ const ar = et(
9979
9953
  Be(t, l, n, s, o, r, a),
9980
9954
  Be(e),
9981
9955
  de(([[f, p, h, x, m, y, g, b], w]) => {
9982
- const { align: T, behavior: S, calculateViewLocation: C = q0, done: k, ...E } = f, N = Rf(f, p, x - 1), L = to(N, p.offsetTree, w) + m + y, j = L + fn(p.sizeTree, N)[1], M = b + y, $ = b + h - g, I = C({
9956
+ const { align: T, behavior: S, calculateViewLocation: C = q0, done: k, ...E } = f, N = Rf(f, p, x - 1), L = to(N, p.offsetTree, w) + m + y, j = L + fn(p.sizeTree, N)[1], M = b + y, F = b + h - g, I = C({
9983
9957
  itemBottom: j,
9984
9958
  itemTop: L,
9985
9959
  locationParams: { align: T, behavior: S, ...E },
9986
- viewportBottom: $,
9960
+ viewportBottom: F,
9987
9961
  viewportTop: M
9988
9962
  });
9989
9963
  return I ? k && cn(
9990
9964
  W(
9991
9965
  i,
9992
- Re((F) => !F),
9966
+ Re(($) => !$),
9993
9967
  // skips the initial publish of false, and the cleanup call.
9994
9968
  // but if scrollingInProgress is true, we skip the initial publish.
9995
- er(Rt(i) ? 1 : 2)
9969
+ er(kt(i) ? 1 : 2)
9996
9970
  ),
9997
9971
  k
9998
9972
  ) : k && k(), I;
@@ -10033,7 +10007,7 @@ const G0 = (e, t) => typeof e == "function" ? yc(e(t)) : t && yc(e), Y0 = et(
10033
10007
  }
10034
10008
  it(
10035
10009
  W(
10036
- At(W(ke(t), er(1)), l),
10010
+ Nt(W(ke(t), er(1)), l),
10037
10011
  Be(ke(x), s, a, f),
10038
10012
  de(([[S, C], k, E, N, L]) => {
10039
10013
  let j = C && N, M = "auto";
@@ -10042,22 +10016,22 @@ const G0 = (e, t) => typeof e == "function" ? yc(e(t)) : t && yc(e), Y0 = et(
10042
10016
  Re(({ shouldFollow: S }) => S)
10043
10017
  ),
10044
10018
  ({ followOutputBehavior: S, totalCount: C }) => {
10045
- y && (y(), y = null), Rt(n) ? requestAnimationFrame(() => {
10046
- Rt(d)("following output to ", { totalCount: C }, qt.DEBUG), g(S);
10019
+ y && (y(), y = null), kt(n) ? requestAnimationFrame(() => {
10020
+ kt(d)("following output to ", { totalCount: C }, qt.DEBUG), g(S);
10047
10021
  }) : y = cn(e, () => {
10048
- Rt(d)("following output to ", { totalCount: C }, qt.DEBUG), g(S), y = null;
10022
+ kt(d)("following output to ", { totalCount: C }, qt.DEBUG), g(S), y = null;
10049
10023
  });
10050
10024
  }
10051
10025
  );
10052
10026
  function b(S) {
10053
10027
  const C = cn(o, (k) => {
10054
- S && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !y && (Rt(d)("scrolling to bottom due to increased size", {}, qt.DEBUG), g("auto"));
10028
+ S && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !y && (kt(d)("scrolling to bottom due to increased size", {}, qt.DEBUG), g("auto"));
10055
10029
  });
10056
10030
  setTimeout(C, 100);
10057
10031
  }
10058
10032
  it(
10059
10033
  W(
10060
- At(ke(x), t, c),
10034
+ Nt(ke(x), t, c),
10061
10035
  Re(([S, , C]) => S && C),
10062
10036
  bn(
10063
10037
  ({ value: S }, [, C]) => ({ refreshed: S === C, value: C }),
@@ -10067,11 +10041,11 @@ const G0 = (e, t) => typeof e == "function" ? yc(e(t)) : t && yc(e), Y0 = et(
10067
10041
  Be(x, t)
10068
10042
  ),
10069
10043
  ([, S]) => {
10070
- Rt(a) && b(S !== !1);
10044
+ kt(a) && b(S !== !1);
10071
10045
  }
10072
10046
  ), it(m, () => {
10073
- b(Rt(x) !== !1);
10074
- }), it(At(ke(x), o), ([S, C]) => {
10047
+ b(kt(x) !== !1);
10048
+ }), it(Nt(ke(x), o), ([S, C]) => {
10075
10049
  S && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
10076
10050
  });
10077
10051
  const w = ee(null), T = Ke();
@@ -10089,17 +10063,17 @@ const G0 = (e, t) => typeof e == "function" ? yc(e(t)) : t && yc(e), Y0 = et(
10089
10063
  T
10090
10064
  ), it(
10091
10065
  W(
10092
- At(W(T, er(1)), l),
10066
+ Nt(W(T, er(1)), l),
10093
10067
  Be(ke(w), a, f, p),
10094
10068
  de(([[S, C], k, E, N, L]) => C && E && (k == null ? void 0 : k({ context: L, totalCount: S, scrollingInProgress: N }))),
10095
10069
  Re((S) => !!S),
10096
10070
  In(0)
10097
10071
  ),
10098
10072
  (S) => {
10099
- y && (y(), y = null), Rt(n) ? requestAnimationFrame(() => {
10100
- Rt(d)("scrolling into view", {}), Le(h, S);
10073
+ y && (y(), y = null), kt(n) ? requestAnimationFrame(() => {
10074
+ kt(d)("scrolling into view", {}), Le(h, S);
10101
10075
  }) : y = cn(e, () => {
10102
- Rt(d)("scrolling into view", {}), Le(h, S), y = null;
10076
+ kt(d)("scrolling into view", {}), Le(h, S), y = null;
10103
10077
  });
10104
10078
  }
10105
10079
  ), { autoscrollToBottom: m, followOutput: x, scrollIntoViewOnChange: w };
@@ -10179,7 +10153,7 @@ const G0 = (e, t) => typeof e == "function" ? yc(e(t)) : t && yc(e), Y0 = et(
10179
10153
  ),
10180
10154
  t
10181
10155
  ), it(
10182
- W(At(t, e, n), Be(r)),
10156
+ W(Nt(t, e, n), Be(r)),
10183
10157
  ([[o, s, i], a]) => {
10184
10158
  o && a && a.change && a.change(s, i);
10185
10159
  }
@@ -10191,7 +10165,7 @@ const G0 = (e, t) => typeof e == "function" ? yc(e(t)) : t && yc(e), Y0 = et(
10191
10165
  const n = Ke(), r = Ke(), o = Ke(), s = ee(!1), i = ee(void 0);
10192
10166
  return xe(
10193
10167
  W(
10194
- At(n, r),
10168
+ Nt(n, r),
10195
10169
  de(([{ scrollHeight: a, scrollTop: l, viewportHeight: c }, { offsetTop: d }]) => ({
10196
10170
  scrollHeight: a,
10197
10171
  scrollTop: Math.max(0, l - d),
@@ -10305,7 +10279,7 @@ const tS = Mf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10305
10279
  w && tS() ? Le(e, b - g) : y(-g);
10306
10280
  }), it(
10307
10281
  W(
10308
- At(zt(s, !1), e, x),
10282
+ Nt(zt(s, !1), e, x),
10309
10283
  Re(([g, b, w]) => !g && !w && b !== 0),
10310
10284
  de(([g, b]) => b),
10311
10285
  In(1)
@@ -10531,11 +10505,11 @@ function Lf(e, t, n) {
10531
10505
  );
10532
10506
  return B.useSyncExternalStore(
10533
10507
  b,
10534
- () => Rt(g),
10535
- () => Rt(g)
10508
+ () => kt(g),
10509
+ () => kt(g)
10536
10510
  );
10537
10511
  }, x = (y) => {
10538
- const g = B.useContext(a)[y], [b, w] = B.useState(cc(Rt, g));
10512
+ const g = B.useContext(a)[y], [b, w] = B.useState(cc(kt, g));
10539
10513
  return Io(
10540
10514
  () => it(g, (T) => {
10541
10515
  T !== b && w(lc(T));
@@ -10553,7 +10527,7 @@ function Lf(e, t, n) {
10553
10527
  usePublisher: p
10554
10528
  };
10555
10529
  }
10556
- const $f = B.createContext(void 0), Ff = B.createContext(void 0), zf = typeof document < "u" ? B.useLayoutEffect : B.useEffect;
10530
+ const Ff = B.createContext(void 0), $f = B.createContext(void 0), zf = typeof document < "u" ? B.useLayoutEffect : B.useEffect;
10557
10531
  function wi(e) {
10558
10532
  return "self" in e;
10559
10533
  }
@@ -10594,9 +10568,9 @@ function Bf(e, t, n, r = Nr, o, s) {
10594
10568
  const x = p.behavior === "smooth";
10595
10569
  let m, y, g;
10596
10570
  wi(h) ? (y = Math.max(
10597
- $n(h.document.documentElement, s ? "width" : "height"),
10571
+ Fn(h.document.documentElement, s ? "width" : "height"),
10598
10572
  s ? h.document.documentElement.scrollWidth : h.document.documentElement.scrollHeight
10599
- ), m = s ? h.innerWidth : h.innerHeight, g = s ? window.scrollX : window.scrollY) : (y = h[s ? "scrollWidth" : "scrollHeight"], m = $n(h, s ? "width" : "height"), g = h[s ? "scrollLeft" : "scrollTop"]);
10573
+ ), m = s ? h.innerWidth : h.innerHeight, g = s ? window.scrollX : window.scrollY) : (y = h[s ? "scrollWidth" : "scrollHeight"], m = Fn(h, s ? "width" : "height"), g = h[s ? "scrollLeft" : "scrollTop"]);
10600
10574
  const b = y - m;
10601
10575
  if (p.top = Math.ceil(Math.max(Math.min(b, p.top), 0)), Nf(m, y) || p.top === g) {
10602
10576
  e({ scrollHeight: y, scrollTop: g, viewportHeight: m }), x && t(!0);
@@ -10664,7 +10638,7 @@ const iS = /* @__PURE__ */ et(() => {
10664
10638
  Va("deviation", (I) => {
10665
10639
  g !== I && b(I);
10666
10640
  });
10667
- const w = Ae("EmptyPlaceholder"), T = Ae("ScrollSeekPlaceholder") || lS, S = Ae("ListComponent"), C = Ae("ItemComponent"), k = Ae("GroupComponent"), E = Ae("computeItemKey"), N = Ae("isSeeking"), L = Ae("groupIndices").length > 0, j = Ae("alignToBottom"), M = Ae("initialItemFinalLocationReached"), $ = e ? {} : {
10641
+ const w = Ae("EmptyPlaceholder"), T = Ae("ScrollSeekPlaceholder") || lS, S = Ae("ListComponent"), C = Ae("ItemComponent"), k = Ae("GroupComponent"), E = Ae("computeItemKey"), N = Ae("isSeeking"), L = Ae("groupIndices").length > 0, j = Ae("alignToBottom"), M = Ae("initialItemFinalLocationReached"), F = e ? {} : {
10668
10642
  boxSizing: "border-box",
10669
10643
  ...m ? {
10670
10644
  display: "inline-block",
@@ -10680,19 +10654,19 @@ const iS = /* @__PURE__ */ et(() => {
10680
10654
  },
10681
10655
  ...M ? {} : { visibility: "hidden" }
10682
10656
  };
10683
- return !e && t.totalCount === 0 && w ? /* @__PURE__ */ u.jsx(w, { ...Ft(w, c) }) : /* @__PURE__ */ u.jsx(
10657
+ return !e && t.totalCount === 0 && w ? /* @__PURE__ */ u.jsx(w, { ...$t(w, c) }) : /* @__PURE__ */ u.jsx(
10684
10658
  S,
10685
10659
  {
10686
- ...Ft(S, c),
10660
+ ...$t(S, c),
10687
10661
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
10688
10662
  ref: y,
10689
- style: $,
10663
+ style: F,
10690
10664
  children: (e ? t.topItems : t.items).map((I) => {
10691
- const F = I.originalIndex, A = E(F + t.firstItemIndex, I.data, c);
10665
+ const $ = I.originalIndex, A = E($ + t.firstItemIndex, I.data, c);
10692
10666
  return N ? /* @__PURE__ */ jo(
10693
10667
  T,
10694
10668
  {
10695
- ...Ft(T, c),
10669
+ ...$t(T, c),
10696
10670
  height: I.size,
10697
10671
  index: I.index,
10698
10672
  key: A,
@@ -10702,8 +10676,8 @@ const iS = /* @__PURE__ */ et(() => {
10702
10676
  ) : I.type === "group" ? /* @__PURE__ */ jo(
10703
10677
  k,
10704
10678
  {
10705
- ...Ft(k, c),
10706
- "data-index": F,
10679
+ ...$t(k, c),
10680
+ "data-index": $,
10707
10681
  "data-item-index": I.index,
10708
10682
  "data-known-size": I.size,
10709
10683
  key: A,
@@ -10713,9 +10687,9 @@ const iS = /* @__PURE__ */ et(() => {
10713
10687
  ) : /* @__PURE__ */ jo(
10714
10688
  C,
10715
10689
  {
10716
- ...Ft(C, c),
10690
+ ...$t(C, c),
10717
10691
  ...hS(C, I.data),
10718
- "data-index": F,
10692
+ "data-index": $,
10719
10693
  "data-item-group-index": I.groupIndex,
10720
10694
  "data-item-index": I.index,
10721
10695
  "data-known-size": I.size,
@@ -10749,7 +10723,7 @@ const iS = /* @__PURE__ */ et(() => {
10749
10723
  width: "100%",
10750
10724
  zIndex: 1
10751
10725
  };
10752
- function Ft(e, t) {
10726
+ function $t(e, t) {
10753
10727
  if (typeof e != "string")
10754
10728
  return { context: t };
10755
10729
  }
@@ -10760,26 +10734,26 @@ const mS = /* @__PURE__ */ B.memo(function() {
10760
10734
  const e = Ae("HeaderComponent"), t = en("headerHeight"), n = Ae("HeaderFooterTag"), r = ir(
10761
10735
  B.useMemo(
10762
10736
  () => (s) => {
10763
- t($n(s, "height"));
10737
+ t(Fn(s, "height"));
10764
10738
  },
10765
10739
  [t]
10766
10740
  ),
10767
10741
  !0,
10768
10742
  Ae("skipAnimationFrameInResizeObserver")
10769
10743
  ), o = Ae("context");
10770
- return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ft(e, o) }) }) : null;
10744
+ return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...$t(e, o) }) }) : null;
10771
10745
  }), gS = /* @__PURE__ */ B.memo(function() {
10772
10746
  const e = Ae("FooterComponent"), t = en("footerHeight"), n = Ae("HeaderFooterTag"), r = ir(
10773
10747
  B.useMemo(
10774
10748
  () => (s) => {
10775
- t($n(s, "height"));
10749
+ t(Fn(s, "height"));
10776
10750
  },
10777
10751
  [t]
10778
10752
  ),
10779
10753
  !0,
10780
10754
  Ae("skipAnimationFrameInResizeObserver")
10781
10755
  ), o = Ae("context");
10782
- return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ft(e, o) }) }) : null;
10756
+ return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...$t(e, o) }) }) : null;
10783
10757
  });
10784
10758
  function Uf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10785
10759
  return B.memo(function({ children: r, style: o, context: s, ...i }) {
@@ -10800,7 +10774,7 @@ function Uf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10800
10774
  style: { ...f ? fS : dS, ...o },
10801
10775
  tabIndex: 0,
10802
10776
  ...i,
10803
- ...Ft(l, s),
10777
+ ...$t(l, s),
10804
10778
  children: r
10805
10779
  }
10806
10780
  );
@@ -10827,22 +10801,22 @@ function Wf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10827
10801
  "data-virtuoso-scroller": !0,
10828
10802
  style: { position: "relative", ...o, ...d !== 0 ? { height: d + f } : {} },
10829
10803
  ...i,
10830
- ...Ft(l, s),
10804
+ ...$t(l, s),
10831
10805
  children: r
10832
10806
  }
10833
10807
  );
10834
10808
  });
10835
10809
  }
10836
10810
  const xS = ({ children: e }) => {
10837
- const t = B.useContext($f), n = en("viewportHeight"), r = en("fixedItemHeight"), o = Ae("alignToBottom"), s = Ae("horizontalDirection"), i = B.useMemo(
10838
- () => mf(n, (l) => $n(l, s ? "width" : "height")),
10811
+ const t = B.useContext(Ff), n = en("viewportHeight"), r = en("fixedItemHeight"), o = Ae("alignToBottom"), s = Ae("horizontalDirection"), i = B.useMemo(
10812
+ () => mf(n, (l) => Fn(l, s ? "width" : "height")),
10839
10813
  [n, s]
10840
10814
  ), a = ir(i, !0, Ae("skipAnimationFrameInResizeObserver"));
10841
10815
  return B.useEffect(() => {
10842
10816
  t && (n(t.viewportHeight), r(t.itemHeight));
10843
10817
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: zs(o), children: e });
10844
10818
  }, yS = ({ children: e }) => {
10845
- const t = B.useContext($f), n = en("windowViewportRect"), r = en("fixedItemHeight"), o = Ae("customScrollParent"), s = xf(
10819
+ const t = B.useContext(Ff), n = en("windowViewportRect"), r = en("fixedItemHeight"), o = Ae("customScrollParent"), s = xf(
10846
10820
  n,
10847
10821
  o,
10848
10822
  Ae("skipAnimationFrameInResizeObserver")
@@ -10852,7 +10826,7 @@ const xS = ({ children: e }) => {
10852
10826
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: zs(i), children: e });
10853
10827
  }, vS = ({ children: e }) => {
10854
10828
  const t = Ae("TopItemListComponent") || "div", n = Ae("headerHeight"), r = { ...pS, marginTop: `${n}px` }, o = Ae("context");
10855
- return /* @__PURE__ */ u.jsx(t, { style: r, ...Ft(t, o), children: e });
10829
+ return /* @__PURE__ */ u.jsx(t, { style: r, ...$t(t, o), children: e });
10856
10830
  }, bS = /* @__PURE__ */ B.memo(function(e) {
10857
10831
  const t = Ae("useWindowScroll"), n = Ae("topItemsIndexes").length > 0, r = Ae("customScrollParent"), o = Ae("context");
10858
10832
  return /* @__PURE__ */ u.jsxs(r || t ? CS : SS, { ...e, context: o, children: [
@@ -11007,7 +10981,7 @@ const NS = /* @__PURE__ */ et(
11007
10981
  { customScrollParent: y, useWindowScroll: g, windowScrollContainerState: b, windowScrollTo: w, windowViewportRect: T },
11008
10982
  S
11009
10983
  ]) => {
11010
- const C = ee(0), k = ee(0), E = ee(wc), N = ee({ height: 0, width: 0 }), L = ee({ height: 0, width: 0 }), j = Ke(), M = Ke(), $ = ee(0), I = ee(null), F = ee({ column: 0, row: 0 }), A = Ke(), K = Ke(), z = ee(!1), _ = ee(0), X = ee(!0), J = ee(!1), se = ee(!1);
10984
+ const C = ee(0), k = ee(0), E = ee(wc), N = ee({ height: 0, width: 0 }), L = ee({ height: 0, width: 0 }), j = Ke(), M = Ke(), F = ee(0), I = ee(null), $ = ee({ column: 0, row: 0 }), A = Ke(), K = Ke(), z = ee(!1), _ = ee(0), X = ee(!0), J = ee(!1), se = ee(!1);
11011
10985
  it(
11012
10986
  W(
11013
10987
  x,
@@ -11019,11 +10993,11 @@ const NS = /* @__PURE__ */ et(
11019
10993
  }
11020
10994
  ), it(
11021
10995
  W(
11022
- At(x, X, L, N, _, J),
10996
+ Nt(x, X, L, N, _, J),
11023
10997
  Re(([D, G, Q, ue, , oe]) => D && !G && Q.height !== 0 && ue.height !== 0 && !oe)
11024
10998
  ),
11025
10999
  ([, , , , D]) => {
11026
- Le(J, !0), Fa(1, () => {
11000
+ Le(J, !0), $a(1, () => {
11027
11001
  Le(j, D);
11028
11002
  }), cn(W(c), () => {
11029
11003
  Le(t, [0, 0]), Le(X, !0);
@@ -11043,7 +11017,7 @@ const NS = /* @__PURE__ */ et(
11043
11017
  Re(([, D]) => D != null)
11044
11018
  ),
11045
11019
  ([, D]) => {
11046
- D && (Le(N, D.viewport), Le(L, D.item), Le(F, D.gap), D.scrollTop > 0 && (Le(z, !0), cn(W(c, er(1)), (G) => {
11020
+ D && (Le(N, D.viewport), Le(L, D.item), Le($, D.gap), D.scrollTop > 0 && (Le(z, !0), cn(W(c, er(1)), (G) => {
11047
11021
  Le(z, !1);
11048
11022
  }), Le(l, { top: D.scrollTop })));
11049
11023
  }
@@ -11055,10 +11029,10 @@ const NS = /* @__PURE__ */ et(
11055
11029
  f
11056
11030
  ), xe(
11057
11031
  W(
11058
- At(
11032
+ Nt(
11059
11033
  ke(N, No),
11060
11034
  ke(L, No),
11061
- ke(F, (D, G) => D && D.column === G.column && D.row === G.row),
11035
+ ke($, (D, G) => D && D.column === G.column && D.row === G.row),
11062
11036
  ke(c)
11063
11037
  ),
11064
11038
  de(([D, G, Q, ue]) => ({
@@ -11071,10 +11045,10 @@ const NS = /* @__PURE__ */ et(
11071
11045
  A
11072
11046
  ), xe(
11073
11047
  W(
11074
- At(
11048
+ Nt(
11075
11049
  ke(C),
11076
11050
  r,
11077
- ke(F, IS),
11051
+ ke($, IS),
11078
11052
  ke(L, No),
11079
11053
  ke(N, No),
11080
11054
  ke(I),
@@ -11092,23 +11066,23 @@ const NS = /* @__PURE__ */ et(
11092
11066
  oe,
11093
11067
  Ee,
11094
11068
  Ge,
11095
- $e,
11069
+ Fe,
11096
11070
  ,
11097
11071
  Ze,
11098
11072
  ie
11099
11073
  ]) => {
11100
11074
  const { column: ve, row: Ie } = ue, { height: Ne, width: We } = oe, { width: Ye } = Ee;
11101
- if ($e === 0 && (D === 0 || Ye === 0))
11075
+ if (Fe === 0 && (D === 0 || Ye === 0))
11102
11076
  return wc;
11103
11077
  if (We === 0) {
11104
- const yt = za(ie, D), _t = yt + Math.max($e - 1, 0);
11105
- return ES(Tc(yt, _t, Ge));
11078
+ const yt = za(ie, D), At = yt + Math.max(Fe - 1, 0);
11079
+ return ES(Tc(yt, At, Ge));
11106
11080
  }
11107
- const Fe = Vf(Ye, We, ve);
11081
+ const $e = Vf(Ye, We, ve);
11108
11082
  let He, tt;
11109
- Ze ? G === 0 && Q === 0 && $e > 0 ? (He = 0, tt = $e - 1) : (He = Fe * rs((G + Ie) / (Ne + Ie)), tt = Fe * Sc((Q + Ie) / (Ne + Ie)) - 1, tt = Ci(D - 1, Hr(tt, Fe - 1)), He = Ci(tt, Hr(0, He))) : (He = 0, tt = -1);
11110
- const Nt = Tc(He, tt, Ge), { bottom: xt, top: dt } = kc(Ee, ue, oe, Nt), ft = Sc(D / Fe), pt = ft * Ne + (ft - 1) * Ie - xt;
11111
- return { bottom: xt, itemHeight: Ne, items: Nt, itemWidth: We, offsetBottom: pt, offsetTop: dt, top: dt };
11083
+ Ze ? G === 0 && Q === 0 && Fe > 0 ? (He = 0, tt = Fe - 1) : (He = $e * rs((G + Ie) / (Ne + Ie)), tt = $e * Sc((Q + Ie) / (Ne + Ie)) - 1, tt = Ci(D - 1, Hr(tt, $e - 1)), He = Ci(tt, Hr(0, He))) : (He = 0, tt = -1);
11084
+ const It = Tc(He, tt, Ge), { bottom: xt, top: dt } = kc(Ee, ue, oe, It), ft = Sc(D / $e), pt = ft * Ne + (ft - 1) * Ie - xt;
11085
+ return { bottom: xt, itemHeight: Ne, items: It, itemWidth: We, offsetBottom: pt, offsetTop: dt, top: dt };
11112
11086
  }
11113
11087
  )
11114
11088
  ),
@@ -11122,7 +11096,7 @@ const NS = /* @__PURE__ */ et(
11122
11096
  C
11123
11097
  ), xe(
11124
11098
  W(
11125
- At(N, L, E, F),
11099
+ Nt(N, L, E, $),
11126
11100
  Re(([D, G, { items: Q }]) => Q.length > 0 && G.height !== 0 && D.height !== 0),
11127
11101
  de(([D, G, { items: Q }, ue]) => {
11128
11102
  const { bottom: oe, top: Ee } = kc(D, ue, G, Q);
@@ -11143,7 +11117,7 @@ const NS = /* @__PURE__ */ et(
11143
11117
  );
11144
11118
  const Pe = Jt(
11145
11119
  W(
11146
- At(E, C),
11120
+ Nt(E, C),
11147
11121
  Re(([{ items: D }]) => D.length > 0),
11148
11122
  Be(ye),
11149
11123
  Re(([[D, G], Q]) => {
@@ -11176,13 +11150,13 @@ const NS = /* @__PURE__ */ et(
11176
11150
  xe(H, h.scrollSeekRangeChanged), xe(
11177
11151
  W(
11178
11152
  j,
11179
- Be(N, L, C, F),
11153
+ Be(N, L, C, $),
11180
11154
  de(([D, G, Q, ue, oe]) => {
11181
- const Ee = If(D), { align: Ge, behavior: $e, offset: Ze } = Ee;
11155
+ const Ee = If(D), { align: Ge, behavior: Fe, offset: Ze } = Ee;
11182
11156
  let ie = Ee.index;
11183
11157
  ie === "LAST" && (ie = ue - 1), ie = Hr(0, ie, Ci(ue - 1, ie));
11184
11158
  let ve = Xi(G, oe, Q, ie);
11185
- return Ge === "end" ? ve = Cc(ve - G.height + Q.height) : Ge === "center" && (ve = Cc(ve - G.height / 2 + Q.height / 2)), Ze && (ve += Ze), { behavior: $e, top: ve };
11159
+ return Ge === "end" ? ve = Cc(ve - G.height + Q.height) : Ge === "center" && (ve = Cc(ve - G.height / 2 + Q.height / 2)), Ze && (ve += Ze), { behavior: Fe, top: ve };
11186
11160
  })
11187
11161
  ),
11188
11162
  l
@@ -11204,9 +11178,9 @@ const NS = /* @__PURE__ */ et(
11204
11178
  customScrollParent: y,
11205
11179
  // input
11206
11180
  data: I,
11207
- deviation: $,
11181
+ deviation: F,
11208
11182
  footerHeight: o,
11209
- gap: F,
11183
+ gap: $,
11210
11184
  headerHeight: s,
11211
11185
  increaseViewportBy: e,
11212
11186
  initialItemCount: k,
@@ -11316,7 +11290,7 @@ const AS = /* @__PURE__ */ et(() => {
11316
11290
  {
11317
11291
  className: t,
11318
11292
  ref: y,
11319
- ...Ft(l, d),
11293
+ ...$t(l, d),
11320
11294
  "data-testid": "virtuoso-item-list",
11321
11295
  style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
11322
11296
  children: e.items.map((g) => {
@@ -11324,7 +11298,7 @@ const AS = /* @__PURE__ */ et(() => {
11324
11298
  return s ? /* @__PURE__ */ u.jsx(
11325
11299
  c,
11326
11300
  {
11327
- ...Ft(c, d),
11301
+ ...$t(c, d),
11328
11302
  height: e.itemHeight,
11329
11303
  index: g.index,
11330
11304
  width: e.itemWidth
@@ -11333,7 +11307,7 @@ const AS = /* @__PURE__ */ et(() => {
11333
11307
  ) : /* @__PURE__ */ jo(
11334
11308
  a,
11335
11309
  {
11336
- ...Ft(a, d),
11310
+ ...$t(a, d),
11337
11311
  className: n,
11338
11312
  "data-index": g.index,
11339
11313
  key: b
@@ -11347,28 +11321,28 @@ const AS = /* @__PURE__ */ et(() => {
11347
11321
  const e = bt("HeaderComponent"), t = tn("headerHeight"), n = bt("headerFooterTag"), r = ir(
11348
11322
  B.useMemo(
11349
11323
  () => (s) => {
11350
- t($n(s, "height"));
11324
+ t(Fn(s, "height"));
11351
11325
  },
11352
11326
  [t]
11353
11327
  ),
11354
11328
  !0,
11355
11329
  !1
11356
11330
  ), o = bt("context");
11357
- return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ft(e, o) }) }) : null;
11331
+ return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...$t(e, o) }) }) : null;
11358
11332
  }), OS = B.memo(function() {
11359
11333
  const e = bt("FooterComponent"), t = tn("footerHeight"), n = bt("headerFooterTag"), r = ir(
11360
11334
  B.useMemo(
11361
11335
  () => (s) => {
11362
- t($n(s, "height"));
11336
+ t(Fn(s, "height"));
11363
11337
  },
11364
11338
  [t]
11365
11339
  ),
11366
11340
  !0,
11367
11341
  !1
11368
11342
  ), o = bt("context");
11369
- return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ft(e, o) }) }) : null;
11343
+ return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...$t(e, o) }) }) : null;
11370
11344
  }), MS = ({ children: e }) => {
11371
- const t = B.useContext(Ff), n = tn("itemDimensions"), r = tn("viewportDimensions"), o = ir(
11345
+ const t = B.useContext($f), n = tn("itemDimensions"), r = tn("viewportDimensions"), o = ir(
11372
11346
  B.useMemo(
11373
11347
  () => (s) => {
11374
11348
  r(s.getBoundingClientRect());
@@ -11382,13 +11356,13 @@ const AS = /* @__PURE__ */ et(() => {
11382
11356
  t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
11383
11357
  }, [t, r, n]), /* @__PURE__ */ u.jsx("div", { ref: o, style: zs(!1), children: e });
11384
11358
  }, DS = ({ children: e }) => {
11385
- const t = B.useContext(Ff), n = tn("windowViewportRect"), r = tn("itemDimensions"), o = bt("customScrollParent"), s = xf(n, o, !1);
11359
+ const t = B.useContext($f), n = tn("windowViewportRect"), r = tn("itemDimensions"), o = bt("customScrollParent"), s = xf(n, o, !1);
11386
11360
  return B.useEffect(() => {
11387
11361
  t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
11388
11362
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { ref: s, style: zs(!1), children: e });
11389
11363
  }, LS = /* @__PURE__ */ B.memo(function({ ...e }) {
11390
- const t = bt("useWindowScroll"), n = bt("customScrollParent"), r = n || t ? FS : $S, o = n || t ? DS : MS, s = bt("context");
11391
- return /* @__PURE__ */ u.jsx(r, { ...e, ...Ft(r, s), children: /* @__PURE__ */ u.jsxs(o, { children: [
11364
+ const t = bt("useWindowScroll"), n = bt("customScrollParent"), r = n || t ? $S : FS, o = n || t ? DS : MS, s = bt("context");
11365
+ return /* @__PURE__ */ u.jsx(r, { ...e, ...$t(r, s), children: /* @__PURE__ */ u.jsxs(o, { children: [
11392
11366
  /* @__PURE__ */ u.jsx(PS, {}),
11393
11367
  /* @__PURE__ */ u.jsx(jS, {}),
11394
11368
  /* @__PURE__ */ u.jsx(OS, {})
@@ -11438,7 +11412,7 @@ const AS = /* @__PURE__ */ et(() => {
11438
11412
  }
11439
11413
  },
11440
11414
  LS
11441
- ), $S = /* @__PURE__ */ Uf({ useEmitter: Kf, useEmitterValue: bt, usePublisher: tn }), FS = /* @__PURE__ */ Wf({ useEmitter: Kf, useEmitterValue: bt, usePublisher: tn });
11415
+ ), FS = /* @__PURE__ */ Uf({ useEmitter: Kf, useEmitterValue: bt, usePublisher: tn }), $S = /* @__PURE__ */ Wf({ useEmitter: Kf, useEmitterValue: bt, usePublisher: tn });
11442
11416
  function Rc(e, t, n) {
11443
11417
  return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, qt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
11444
11418
  }
@@ -12049,7 +12023,7 @@ function cC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
12049
12023
  }
12050
12024
  }
12051
12025
  }, [n]);
12052
- Et(() => {
12026
+ Rt(() => {
12053
12027
  e && n && p();
12054
12028
  }, [e, n, p]);
12055
12029
  const h = async () => {
@@ -12871,7 +12845,7 @@ function Oc(e) {
12871
12845
  r = e.charCodeAt(n), Math.random() > 0.5 && (r = "x" + r.toString(16)), t += "&#" + r + ";";
12872
12846
  return t;
12873
12847
  }
12874
- class Fn {
12848
+ class $n {
12875
12849
  constructor(t) {
12876
12850
  this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || lr, this.options.tokenizer = this.options.tokenizer || new Ja(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
12877
12851
  inLink: !1,
@@ -12897,13 +12871,13 @@ class Fn {
12897
12871
  * Static Lex Method
12898
12872
  */
12899
12873
  static lex(t, n) {
12900
- return new Fn(n).lex(t);
12874
+ return new $n(n).lex(t);
12901
12875
  }
12902
12876
  /**
12903
12877
  * Static Lex Inline Method
12904
12878
  */
12905
12879
  static lexInline(t, n) {
12906
- return new Fn(n).inlineTokens(t);
12880
+ return new $n(n).inlineTokens(t);
12907
12881
  }
12908
12882
  /**
12909
12883
  * Preprocessing
@@ -13576,7 +13550,7 @@ function Ep(e, t) {
13576
13550
  };
13577
13551
  }
13578
13552
  function be(e, t, n) {
13579
- return Ep(Fn.lex, zn.parse)(e, t, n);
13553
+ return Ep($n.lex, zn.parse)(e, t, n);
13580
13554
  }
13581
13555
  be.options = be.setOptions = function(e) {
13582
13556
  return be.defaults = { ...be.defaults, ...e }, uC(be.defaults), be;
@@ -13674,13 +13648,13 @@ be.walkTokens = function(e, t) {
13674
13648
  }
13675
13649
  return n;
13676
13650
  };
13677
- be.parseInline = Ep(Fn.lexInline, zn.parseInline);
13651
+ be.parseInline = Ep($n.lexInline, zn.parseInline);
13678
13652
  be.Parser = zn;
13679
13653
  be.parser = zn.parse;
13680
13654
  be.Renderer = Za;
13681
13655
  be.TextRenderer = kp;
13682
- be.Lexer = Fn;
13683
- be.lexer = Fn.lex;
13656
+ be.Lexer = $n;
13657
+ be.lexer = $n.lex;
13684
13658
  be.Tokenizer = Ja;
13685
13659
  be.Slugger = Rp;
13686
13660
  be.Hooks = as;
@@ -13691,7 +13665,7 @@ be.use;
13691
13665
  be.walkTokens;
13692
13666
  be.parseInline;
13693
13667
  zn.parse;
13694
- Fn.lex;
13668
+ $n.lex;
13695
13669
  function ls({
13696
13670
  content: e,
13697
13671
  className: t = "",
@@ -13828,23 +13802,23 @@ function PC({
13828
13802
  extras: r
13829
13803
  }) {
13830
13804
  const o = typeof e == "string" && e.length > 0, s = typeof t == "string" && t.length > 0;
13831
- if (Tt() && console.debug("[createArtifactPreviewFromSource] Input check:", {
13805
+ if (Ot() && console.debug("[createArtifactPreviewFromSource] Input check:", {
13832
13806
  hasBase64: o,
13833
13807
  base64Len: e == null ? void 0 : e.length,
13834
13808
  hasUrl: s,
13835
13809
  urlPreview: t == null ? void 0 : t.substring(0, 50),
13836
13810
  formatHint: n
13837
13811
  }), !o && !s)
13838
- return Tt() && console.debug("[createArtifactPreviewFromSource] ❌ No base64 or URL, returning null"), null;
13812
+ return Ot() && console.debug("[createArtifactPreviewFromSource] ❌ No base64 or URL, returning null"), null;
13839
13813
  const i = _C(n), a = o ? `data:${i};base64,${e}` : t;
13840
- Tt() && console.debug("[createArtifactPreviewFromSource] ✅ Created preview source:", {
13814
+ Ot() && console.debug("[createArtifactPreviewFromSource] ✅ Created preview source:", {
13841
13815
  srcType: o ? "data-uri" : "url",
13842
13816
  srcLength: a.length,
13843
13817
  srcPreview: a.substring(0, 80),
13844
13818
  mimeType: i
13845
13819
  });
13846
13820
  const l = jC(r), c = l.length ? l.join(" / ") : void 0, d = c ? `${c} artifact` : "artifact image";
13847
- return Tt() && console.debug("[createArtifactPreviewFromSource] Final preview object:", {
13821
+ return Ot() && console.debug("[createArtifactPreviewFromSource] Final preview object:", {
13848
13822
  src: a.substring(0, 100),
13849
13823
  alt: d,
13850
13824
  label: c
@@ -13852,7 +13826,7 @@ function PC({
13852
13826
  }
13853
13827
  function OC(e) {
13854
13828
  var s, i;
13855
- Tt() && console.debug("[createArtifactPreviewFromPlot] Input plot:", {
13829
+ Ot() && console.debug("[createArtifactPreviewFromPlot] Input plot:", {
13856
13830
  plotKeys: Object.keys(e),
13857
13831
  content_base64_len: typeof e.content_base64 == "string" ? e.content_base64.length : "N/A",
13858
13832
  format: e.format,
@@ -13861,7 +13835,7 @@ function OC(e) {
13861
13835
  url: typeof e.url == "string" ? e.url.substring(0, 50) : "N/A"
13862
13836
  });
13863
13837
  const t = ((s = e.content_base64) == null ? void 0 : s.trim()) || void 0, n = ((i = e.url) == null ? void 0 : i.trim()) || void 0, r = e.format || e.mimeType || e.mime_type;
13864
- Tt() && console.debug("[createArtifactPreviewFromPlot] Extracted values:", {
13838
+ Ot() && console.debug("[createArtifactPreviewFromPlot] Extracted values:", {
13865
13839
  hasBase64: !!t,
13866
13840
  base64Length: t == null ? void 0 : t.length,
13867
13841
  hasUrl: !!n,
@@ -13878,7 +13852,7 @@ function OC(e) {
13878
13852
  artifactId: e.artifactId
13879
13853
  }
13880
13854
  });
13881
- return Tt() && console.debug("[createArtifactPreviewFromPlot] Result:", {
13855
+ return Ot() && console.debug("[createArtifactPreviewFromPlot] Result:", {
13882
13856
  created: !!o,
13883
13857
  srcLength: (o == null ? void 0 : o.src.length) ?? 0,
13884
13858
  alt: o == null ? void 0 : o.alt,
@@ -13887,7 +13861,7 @@ function OC(e) {
13887
13861
  }
13888
13862
  function MC({ className: e }) {
13889
13863
  const [t, n] = we(0);
13890
- return Et(() => {
13864
+ return Rt(() => {
13891
13865
  const r = setInterval(() => n((o) => (o + 1) % 4), 500);
13892
13866
  return () => clearInterval(r);
13893
13867
  }, []), /* @__PURE__ */ u.jsxs(
@@ -13930,7 +13904,7 @@ const Dc = B.memo(function({
13930
13904
  defaultCheckpointId: N = null,
13931
13905
  messageParentCheckpointId: L = null
13932
13906
  }) {
13933
- const [j, M] = we(!1), [$, I] = we("preview"), [F, A] = we(!1), { currentThreadId: K } = pa(), { respondToInterrupt: z } = ha(), _ = l === "phone" || l === "half-screen", X = t.role, J = X === "tool", se = rt(() => "type" in t && t.type === "default_message" ? t : null, [t]), ye = !!se, Pe = !(r && X !== "user"), {
13907
+ const [j, M] = we(!1), [F, I] = we("preview"), [$, A] = we(!1), { currentThreadId: K } = pa(), { respondToInterrupt: z } = ha(), _ = l === "phone" || l === "half-screen", X = t.role, J = X === "tool", se = rt(() => "type" in t && t.type === "default_message" ? t : null, [t]), ye = !!se, Pe = !(r && X !== "user"), {
13934
13908
  uploadingFiles: q,
13935
13909
  handleFileClick: H,
13936
13910
  fileViewerOpen: Z,
@@ -13955,14 +13929,14 @@ const Dc = B.memo(function({
13955
13929
  ), Ge = rt(
13956
13930
  () => se ? [] : t.content.filter((P) => P.type === "file"),
13957
13931
  [se, t]
13958
- ), $e = rt(
13932
+ ), Fe = rt(
13959
13933
  () => se ? [] : t.content.filter((P) => P.type === "interrupt"),
13960
13934
  [se, t]
13961
13935
  ), Ze = (b == null ? void 0 : b.id) ?? (b == null ? void 0 : b.interrupt_id), ie = _o(Ze), ve = b == null ? void 0 : b.value, Ie = rt(() => se ? "" : NC(t.content), [se, t]), Ne = B.useMemo(() => {
13962
13936
  var me;
13963
13937
  if (se || !p) return [];
13964
13938
  const P = t, Y = P.artifact;
13965
- if (Tt() && console.debug("[MessageComponent] Artifact check:", {
13939
+ if (Ot() && console.debug("[MessageComponent] Artifact check:", {
13966
13940
  messageId: P.id,
13967
13941
  messageRole: P.role,
13968
13942
  hasArtifact: !!Y,
@@ -13972,7 +13946,7 @@ const Dc = B.memo(function({
13972
13946
  const ne = [], Oe = [
13973
13947
  ...Array.isArray(Y.plots) ? Y.plots : []
13974
13948
  ];
13975
- Tt() && console.debug("[MessageComponent] Artifact processing:", {
13949
+ Ot() && console.debug("[MessageComponent] Artifact processing:", {
13976
13950
  artifactPlots: ((me = Y.plots) == null ? void 0 : me.length) ?? 0,
13977
13951
  totalPlots: Oe.length,
13978
13952
  plotEntries: Oe.map((Je) => {
@@ -13988,7 +13962,7 @@ const Dc = B.memo(function({
13988
13962
  const ge = OC(Je);
13989
13963
  ge && ne.push(ge);
13990
13964
  }
13991
- return Tt() && console.debug("[MessageComponent] Artifact previews result:", {
13965
+ return Ot() && console.debug("[MessageComponent] Artifact previews result:", {
13992
13966
  inputPlots: Oe.length,
13993
13967
  outputPreviews: ne.length,
13994
13968
  previews: ne.map((Je) => {
@@ -14026,7 +14000,7 @@ const Dc = B.memo(function({
14026
14000
  checkpointNs: t.checkpointNs ?? null
14027
14001
  };
14028
14002
  x(t.id, P, Y);
14029
- }, [x, t.id, J, Ie, ue, t]), Fe = B.useCallback(() => {
14003
+ }, [x, t.id, J, Ie, ue, t]), $e = B.useCallback(() => {
14030
14004
  m == null || m(n);
14031
14005
  }, [m, n]), He = B.useCallback(() => {
14032
14006
  const Y = te(_ ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", Q);
@@ -14052,7 +14026,7 @@ const Dc = B.memo(function({
14052
14026
  default:
14053
14027
  return P;
14054
14028
  }
14055
- }, [X]), Nt = B.useCallback(() => {
14029
+ }, [X]), It = B.useCallback(() => {
14056
14030
  const P = te(
14057
14031
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
14058
14032
  _ && "px-3 py-2 text-sm"
@@ -14093,7 +14067,7 @@ const Dc = B.memo(function({
14093
14067
  }
14094
14068
  }, [_, ye, X]);
14095
14069
  if (ye && se)
14096
- return /* @__PURE__ */ u.jsx("div", { className: te(tt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(Nt(), h.content), children: [
14070
+ return /* @__PURE__ */ u.jsx("div", { className: te(tt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(It(), h.content), children: [
14097
14071
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
14098
14072
  /* @__PURE__ */ u.jsx(ti, { className: te("h-4 w-4", Q) }),
14099
14073
  a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
@@ -14144,10 +14118,10 @@ const Dc = B.memo(function({
14144
14118
  if (P.type === "text") {
14145
14119
  const ne = P.text ?? "", Oe = ne.trim(), me = qa(Oe);
14146
14120
  return me && X !== "tool" ? /* @__PURE__ */ u.jsx(Np, { data: me }, Y) : X === "user" && c && Oe.length > d ? /* @__PURE__ */ u.jsx(
14147
- $C,
14121
+ FC,
14148
14122
  {
14149
14123
  text: Oe,
14150
- expanded: F,
14124
+ expanded: $,
14151
14125
  onExpandedChange: A,
14152
14126
  previewLength: d,
14153
14127
  isCompact: _
@@ -14213,28 +14187,28 @@ const Dc = B.memo(function({
14213
14187
  X,
14214
14188
  c,
14215
14189
  d,
14216
- F,
14190
+ $,
14217
14191
  _,
14218
14192
  ie,
14219
14193
  ve,
14220
14194
  b,
14221
14195
  w,
14222
- $e
14196
+ Fe
14223
14197
  ]), pt = B.useCallback(() => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 p-2 bg-muted/30 rounded", children: [
14224
14198
  /* @__PURE__ */ u.jsx(Ei, { className: "h-4 w-4 text-muted-foreground" }),
14225
14199
  /* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
14226
14200
  ] }), []), yt = B.useCallback(() => {
14227
- const P = ue.trim().length > 0 || Ee.length > 0 || Ge.length > 0 || $e.length > 0;
14201
+ const P = ue.trim().length > 0 || Ee.length > 0 || Ge.length > 0 || Fe.length > 0;
14228
14202
  if (!J && Ge.length > 0 && !r)
14229
14203
  return pt();
14230
14204
  if (!J && !P && !r)
14231
14205
  return null;
14232
14206
  if (J)
14233
14207
  return !f && Ne.length > 0 ? null : f ? /* @__PURE__ */ u.jsx(
14234
- FC,
14208
+ $C,
14235
14209
  {
14236
14210
  message: t,
14237
- viewMode: $
14211
+ viewMode: F
14238
14212
  },
14239
14213
  t.id
14240
14214
  ) : null;
@@ -14249,18 +14223,18 @@ const Dc = B.memo(function({
14249
14223
  ue,
14250
14224
  Ee.length,
14251
14225
  Ge.length,
14252
- $e.length,
14226
+ Fe.length,
14253
14227
  r,
14254
14228
  J,
14255
- $,
14229
+ F,
14256
14230
  f,
14257
14231
  Ne.length,
14258
14232
  pt,
14259
14233
  Q
14260
- ]), _t = rt(() => se ? "Assistant" : AC(t), [se, t]), Xe = B.useMemo(() => se ? [] : Array.isArray(C) ? C : [], [C, se]), Pt = B.useMemo(() => {
14234
+ ]), At = rt(() => se ? "Assistant" : AC(t), [se, t]), Xe = B.useMemo(() => se ? [] : Array.isArray(C) ? C : [], [C, se]), jt = B.useMemo(() => {
14261
14235
  var P;
14262
14236
  return Xe.length ? N && Xe.some((Y) => Y.id === N) ? N : ((P = Xe[0]) == null ? void 0 : P.id) ?? null : null;
14263
- }, [N, Xe]), nt = B.useMemo(() => !Xe.length || !k ? null : Xe.some((P) => P.id === k) ? k : null, [k, Xe]) ?? Pt, ot = X === "user" && Xe.length > 0 && typeof E == "function", St = B.useCallback(
14237
+ }, [N, Xe]), nt = B.useMemo(() => !Xe.length || !k ? null : Xe.some((P) => P.id === k) ? k : null, [k, Xe]) ?? jt, ot = X === "user" && Xe.length > 0 && typeof E == "function", St = B.useCallback(
14264
14238
  (P) => {
14265
14239
  if (!E) return;
14266
14240
  const Y = (P == null ? void 0 : P.id) ?? null, ne = (P == null ? void 0 : P.parentId) ?? L ?? null;
@@ -14284,7 +14258,7 @@ const Dc = B.memo(function({
14284
14258
  return `${ne}`;
14285
14259
  }, []);
14286
14260
  return J && !f && Ne.length === 0 ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
14287
- /* @__PURE__ */ u.jsx("div", { className: te(tt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(Nt(), h.content), children: [
14261
+ /* @__PURE__ */ u.jsx("div", { className: te(tt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(It(), h.content), children: [
14288
14262
  (i || a || J) && /* @__PURE__ */ u.jsxs(
14289
14263
  "div",
14290
14264
  {
@@ -14297,7 +14271,7 @@ const Dc = B.memo(function({
14297
14271
  children: [
14298
14272
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
14299
14273
  He(),
14300
- a && _t && /* @__PURE__ */ u.jsx("span", { className: te("font-medium", _ ? "text-xs" : "text-sm"), children: _t }),
14274
+ a && At && /* @__PURE__ */ u.jsx("span", { className: te("font-medium", _ ? "text-xs" : "text-sm"), children: At }),
14301
14275
  J && /* @__PURE__ */ u.jsxs(
14302
14276
  qf,
14303
14277
  {
@@ -14310,7 +14284,7 @@ const Dc = B.memo(function({
14310
14284
  ),
14311
14285
  role: "button",
14312
14286
  tabIndex: 0,
14313
- "aria-expanded": $ === "expanded",
14287
+ "aria-expanded": F === "expanded",
14314
14288
  onClick: () => I((P) => P === "expanded" ? "preview" : "expanded"),
14315
14289
  onKeyDown: (P) => {
14316
14290
  (P.key === "Enter" || P.key === " ") && (P.preventDefault(), I((Y) => Y === "expanded" ? "preview" : "expanded"));
@@ -14318,7 +14292,7 @@ const Dc = B.memo(function({
14318
14292
  children: [
14319
14293
  /* @__PURE__ */ u.jsx("span", { children: oe.name ?? "Tool Output" }),
14320
14294
  oe.toolCallId && /* @__PURE__ */ u.jsx("span", { className: "opacity-70", children: oe.toolCallId.slice(0, 8) }),
14321
- $ === "expanded" ? /* @__PURE__ */ u.jsx(aa, { className: "h-3 w-3" }) : /* @__PURE__ */ u.jsx(hs, { className: "h-3 w-3" })
14295
+ F === "expanded" ? /* @__PURE__ */ u.jsx(aa, { className: "h-3 w-3" }) : /* @__PURE__ */ u.jsx(hs, { className: "h-3 w-3" })
14322
14296
  ]
14323
14297
  }
14324
14298
  )
@@ -14416,7 +14390,7 @@ const Dc = B.memo(function({
14416
14390
  {
14417
14391
  variant: "ghost",
14418
14392
  size: "sm",
14419
- onClick: Fe,
14393
+ onClick: $e,
14420
14394
  className: te("h-6 w-6 p-0 hover:bg-foreground/10", Q, _ && "h-5 w-5"),
14421
14395
  "aria-label": "Regenerate response",
14422
14396
  children: /* @__PURE__ */ u.jsx(Ii, { className: te(Q, _ ? "h-3 w-3" : "h-4 w-4") })
@@ -14432,7 +14406,7 @@ const Dc = B.memo(function({
14432
14406
  /* @__PURE__ */ u.jsxs("div", { className: "relative", children: [
14433
14407
  yt(),
14434
14408
  p && Ne.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "mt-3 space-y-4", children: Ne.map((P, Y) => (B.useEffect(() => {
14435
- Tt() && console.debug(`[MessageComponent] Preview ${Y} mounted:`, {
14409
+ Ot() && console.debug(`[MessageComponent] Preview ${Y} mounted:`, {
14436
14410
  src: P.src.substring(0, 100),
14437
14411
  alt: P.alt,
14438
14412
  label: P.label
@@ -14451,7 +14425,7 @@ const Dc = B.memo(function({
14451
14425
  loading: "lazy",
14452
14426
  className: "h-auto max-h-[420px] w-full rounded object-contain",
14453
14427
  onLoad: () => {
14454
- Tt() && console.debug(`[MessageComponent] ✅ Image loaded for artifact ${Y}:`, {
14428
+ Ot() && console.debug(`[MessageComponent] ✅ Image loaded for artifact ${Y}:`, {
14455
14429
  alt: P.alt,
14456
14430
  label: P.label
14457
14431
  });
@@ -14467,7 +14441,7 @@ const Dc = B.memo(function({
14467
14441
  ) })
14468
14442
  ] }, `artifact-${Y}`))) })
14469
14443
  ] }),
14470
- J && $ === "expanded" && (oe.toolCallId || oe.name) && /* @__PURE__ */ u.jsxs("div", { className: te("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", _ && "text-xs"), children: [
14444
+ J && F === "expanded" && (oe.toolCallId || oe.name) && /* @__PURE__ */ u.jsxs("div", { className: te("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", _ && "text-xs"), children: [
14471
14445
  oe.name && /* @__PURE__ */ u.jsxs("div", { children: [
14472
14446
  "Function: ",
14473
14447
  oe.name
@@ -14511,7 +14485,7 @@ const Dc = B.memo(function({
14511
14485
  {
14512
14486
  variant: "ghost",
14513
14487
  size: "sm",
14514
- onClick: Fe,
14488
+ onClick: $e,
14515
14489
  className: te("h-6 w-6 p-0 hover:bg-background/50 text-current", _ && "h-5 w-5"),
14516
14490
  children: /* @__PURE__ */ u.jsx(Ii, { className: te("text-current", _ ? "h-3 w-3" : "h-4 w-4") })
14517
14491
  }
@@ -14679,7 +14653,7 @@ function LC(e) {
14679
14653
  closeFileViewer: d
14680
14654
  };
14681
14655
  }
14682
- function $C({
14656
+ function FC({
14683
14657
  text: e,
14684
14658
  expanded: t,
14685
14659
  onExpandedChange: n,
@@ -14722,7 +14696,7 @@ function $C({
14722
14696
  )
14723
14697
  ] });
14724
14698
  }
14725
- function FC({ message: e, viewMode: t }) {
14699
+ function $C({ message: e, viewMode: t }) {
14726
14700
  const r = Ip(e).name || "tool", o = (c) => {
14727
14701
  if (c == null) return null;
14728
14702
  const d = typeof c == "string" ? qa(c) ?? c : c;
@@ -14770,7 +14744,7 @@ const zC = ({
14770
14744
  messagePreviews: r
14771
14745
  }) => {
14772
14746
  const o = e ?? [], s = o.length > 0, i = rt(() => s ? [...o].reverse() : [], [o, s]), a = t ?? (o.length ? o[o.length - 1].id : null);
14773
- return Et(() => {
14747
+ return Rt(() => {
14774
14748
  console.debug("[TimelineColumn] entries:", o.length);
14775
14749
  }, [o.length]), s ? /* @__PURE__ */ u.jsxs("div", { className: "w-32 flex-shrink-0 flex-col border-r border-border/40 pr-2 flex", children: [
14776
14750
  /* @__PURE__ */ u.jsxs("div", { className: "relative flex-1 overflow-y-auto pt-4 pb-2 pr-1", children: [
@@ -14870,9 +14844,9 @@ const zC = ({
14870
14844
  activeCheckpointId: L,
14871
14845
  onSelectCheckpoint: j,
14872
14846
  timelineCheckpoints: M,
14873
- messagePreviews: $,
14847
+ messagePreviews: F,
14874
14848
  createSyntheticThinkingMessage: I = !1
14875
- }, F) => {
14849
+ }, $) => {
14876
14850
  const A = Ue(null), K = Ue(null), z = Ue(!1), [_, X] = we(!0), J = rt(() => b ? e.some((ie) => "type" in ie && ie.type === "default_message" ? !1 : Array.isArray(ie == null ? void 0 : ie.content) && ie.content.some(
14877
14851
  (ve) => ve && ve.type === "interrupt" && (ve.id ?? ve.interrupt_id) === b.id
14878
14852
  )) : !1, [b, e]), se = rt(() => {
@@ -14949,9 +14923,9 @@ const zC = ({
14949
14923
  timelineEntries: Q,
14950
14924
  activeCheckpointId: L ?? null,
14951
14925
  onSelectCheckpoint: j,
14952
- messagePreviews: $
14926
+ messagePreviews: F
14953
14927
  }
14954
- ) : null, Ge = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), $e = () => oe ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
14928
+ ) : null, Ge = ["flex h-full flex-col md:flex-row", f].filter(Boolean).join(" "), Fe = () => oe ? /* @__PURE__ */ u.jsx("div", { className: "p-6 h-full overflow-y-auto", children: /* @__PURE__ */ u.jsx("div", { className: "w-full max-w-full", children: /* @__PURE__ */ u.jsx(
14955
14929
  Dc,
14956
14930
  {
14957
14931
  message: oe,
@@ -14971,7 +14945,7 @@ const zC = ({
14971
14945
  }
14972
14946
  ) }) }) : /* @__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!" }), Ze = H.length > 0;
14973
14947
  return tm(
14974
- F,
14948
+ $,
14975
14949
  () => ({
14976
14950
  scrollToLatest: () => {
14977
14951
  var ie, ve;
@@ -15021,20 +14995,20 @@ const zC = ({
15021
14995
  itemContent: (ie, ve) => {
15022
14996
  var dt;
15023
14997
  const Ie = Lc(ve, ie), Ne = "type" in ve && ve.type === "default_message";
15024
- let We = [], Ye = null, Fe = {}, He = {}, tt = null, Nt = null;
14998
+ let We = [], Ye = null, $e = {}, He = {}, tt = null, It = null;
15025
14999
  if (!Ne) {
15026
15000
  const ft = ve, pt = ft.checkpointId ?? null;
15027
- Fe = ft.additionalKwargs ?? {}, He = ft.responseMetadata ?? {};
15001
+ $e = ft.additionalKwargs ?? {}, He = ft.responseMetadata ?? {};
15028
15002
  const yt = pt && E ? E.get(pt) ?? null : null;
15029
- tt = typeof Fe.step == "number" ? Fe.step : typeof He.step == "number" ? He.step : (yt == null ? void 0 : yt.step) ?? null;
15030
- const _t = typeof Fe.source == "string" ? Fe.source : typeof He.source == "string" ? He.source : (yt == null ? void 0 : yt.source) ?? null;
15031
- Nt = _t ? String(_t) : null;
15032
- const Xe = tt !== null && Nt ? `${tt}:${Nt}` : null;
15003
+ tt = typeof $e.step == "number" ? $e.step : typeof He.step == "number" ? He.step : (yt == null ? void 0 : yt.step) ?? null;
15004
+ const At = typeof $e.source == "string" ? $e.source : typeof He.source == "string" ? He.source : (yt == null ? void 0 : yt.source) ?? null;
15005
+ It = At ? String(At) : null;
15006
+ const Xe = tt !== null && It ? `${tt}:${It}` : null;
15033
15007
  Xe && (N != null && N.has(Xe)) ? We = N.get(Xe) ?? [] : pt && yt && (We = [yt]), Ye = pt ?? ((dt = We[0]) == null ? void 0 : dt.id) ?? null;
15034
15008
  }
15035
15009
  const xt = (() => {
15036
- if (typeof Fe.parentCheckpointId == "string")
15037
- return Fe.parentCheckpointId;
15010
+ if (typeof $e.parentCheckpointId == "string")
15011
+ return $e.parentCheckpointId;
15038
15012
  if (typeof He.parentCheckpointId == "string")
15039
15013
  return He.parentCheckpointId;
15040
15014
  })();
@@ -15079,11 +15053,11 @@ const zC = ({
15079
15053
  );
15080
15054
  }
15081
15055
  }
15082
- ) : $e() })
15056
+ ) : Fe() })
15083
15057
  ] });
15084
15058
  });
15085
15059
  Ap.displayName = "MessageList";
15086
- const $c = {
15060
+ const Fc = {
15087
15061
  value: ""
15088
15062
  };
15089
15063
  function Ri({
@@ -15116,17 +15090,17 @@ function Ri({
15116
15090
  interrupt: L,
15117
15091
  metadata: j,
15118
15092
  timelineCheckpoints: M,
15119
- messagePreviews: $
15120
- } = ha(), { isStreaming: I, error: F, connectionState: A, submit: K, stop: z } = ny(), _ = b ?? g ?? null, X = (E == null ? void 0 : E.id) ?? null, J = (E == null ? void 0 : E.namespace) ?? null, se = (j == null ? void 0 : j.assemblingMessageId) ?? null, ye = L, [Pe, q] = we(!1);
15121
- Et(() => {
15093
+ messagePreviews: F
15094
+ } = ha(), { isStreaming: I, error: $, connectionState: A, submit: K, stop: z } = ny(), _ = b ?? g ?? null, X = (E == null ? void 0 : E.id) ?? null, J = (E == null ? void 0 : E.namespace) ?? null, se = (j == null ? void 0 : j.assemblingMessageId) ?? null, ye = L, [Pe, q] = we(!1);
15095
+ Rt(() => {
15122
15096
  ye || q(!1);
15123
15097
  }, [ye]);
15124
15098
  const H = Me(() => {
15125
15099
  q(!0);
15126
15100
  }, []), Z = Me(() => {
15127
15101
  q(!1);
15128
- }, []), D = !!ye || Pe, [G, Q] = we(null), [ue, oe] = we(""), [Ee, Ge] = we(null), [$e, Ze] = we(null), [ie, ve] = we([]), [Ie, Ne] = we(0), [We, Ye] = we(0), [Fe, He] = we(!1), [tt, Nt] = we(null), [xt, dt] = we(null), [ft, pt] = we(!1), [yt, _t] = we(null), Xe = Ue(!1), [Pt, mn] = we(() => $c.value), nt = Ue(Pt), ot = Ue(null), St = Me((re) => {
15129
- $c.value = re, mn(re);
15102
+ }, []), D = !!ye || Pe, [G, Q] = we(null), [ue, oe] = we(""), [Ee, Ge] = we(null), [Fe, Ze] = we(null), [ie, ve] = we([]), [Ie, Ne] = we(0), [We, Ye] = we(0), [$e, He] = we(!1), [tt, It] = we(null), [xt, dt] = we(null), [ft, pt] = we(!1), [yt, At] = we(null), Xe = Ue(!1), [jt, mn] = we(() => Fc.value), nt = Ue(jt), ot = Ue(null), St = Me((re) => {
15103
+ Fc.value = re, mn(re);
15130
15104
  }, []), [V, le] = we(!1), Ce = Ue(null), P = Me(
15131
15105
  (re, fe) => {
15132
15106
  if (!re || typeof re != "object") return null;
@@ -15205,42 +15179,42 @@ function Ri({
15205
15179
  },
15206
15180
  [St]
15207
15181
  ), _r = Ue(!1);
15208
- Et(() => {
15182
+ Rt(() => {
15209
15183
  _r.current && !I && (ve([]), Rn()), _r.current = I;
15210
15184
  }, [I, Rn]);
15211
15185
  const [Js, Zs] = we("desktop");
15212
- Et(() => {
15186
+ Rt(() => {
15213
15187
  const re = () => {
15214
15188
  const fe = window.innerWidth;
15215
15189
  Zs(fe < 640 ? "phone" : fe < 1024 ? "tablet" : "desktop");
15216
15190
  };
15217
15191
  return re(), window.addEventListener("resize", re), () => window.removeEventListener("resize", re);
15218
- }, []), Et(() => {
15192
+ }, []), Rt(() => {
15219
15193
  Xe.current = !1;
15220
- }, [_]), Et(() => {
15221
- nt.current = Pt;
15222
- }, [Pt]), Et(() => {
15194
+ }, [_]), Rt(() => {
15195
+ nt.current = jt;
15196
+ }, [jt]), Rt(() => {
15223
15197
  if (!G) {
15224
15198
  ot.current = null;
15225
15199
  return;
15226
15200
  }
15227
15201
  ot.current === null && (ot.current = nt.current), St(ue ?? "");
15228
- }, [ue, G, St]), Et(() => {
15202
+ }, [ue, G, St]), Rt(() => {
15229
15203
  (async () => {
15230
15204
  if (!y.baseUrl) {
15231
- _t(null);
15205
+ At(null);
15232
15206
  return;
15233
15207
  }
15234
15208
  try {
15235
15209
  const ae = (await y.getAgent("default")).uiDefaultMessage || "";
15236
- _t(ae || null);
15210
+ At(ae || null);
15237
15211
  } catch (fe) {
15238
- console.warn("Failed to fetch default message:", fe), _t(null);
15212
+ console.warn("Failed to fetch default message:", fe), At(null);
15239
15213
  }
15240
15214
  })();
15241
- }, [y.baseUrl]), Et(() => {
15242
- F && !ft && (m == null || m(F));
15243
- }, [F, ft, m]);
15215
+ }, [y.baseUrl]), Rt(() => {
15216
+ $ && !ft && (m == null || m($));
15217
+ }, [$, ft, m]);
15244
15218
  const Qs = (re) => {
15245
15219
  if (re.length > zo)
15246
15220
  return `Message too long (${re.length}/${zo} characters)`;
@@ -15284,15 +15258,15 @@ function Ri({
15284
15258
  }
15285
15259
  }, R = B.useCallback(
15286
15260
  (re, fe, ae) => {
15287
- c && (ot.current = Pt, Q(re), oe(fe), St(fe), Ze(null), Ge({
15261
+ c && (ot.current = jt, Q(re), oe(fe), St(fe), Ze(null), Ge({
15288
15262
  checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? null,
15289
15263
  checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? null
15290
15264
  }));
15291
15265
  },
15292
- [Pt, c, St]
15266
+ [jt, c, St]
15293
15267
  ), U = B.useCallback(() => {
15294
- Q(null), oe(""), Ge(null), Ze(null), St(ot.current ?? Pt), ot.current = null;
15295
- }, [Pt, St]), ce = Me(
15268
+ Q(null), oe(""), Ge(null), Ze(null), St(ot.current ?? jt), ot.current = null;
15269
+ }, [jt, St]), ce = Me(
15296
15270
  (re, fe, ae) => {
15297
15271
  R(re, fe, ae);
15298
15272
  },
@@ -15327,7 +15301,7 @@ function Ri({
15327
15301
  }, Ve = async (re) => {
15328
15302
  const fe = (re.target.files || [])[0];
15329
15303
  if (fe) {
15330
- Nt(null), dt(null), He(!0);
15304
+ It(null), dt(null), He(!0);
15331
15305
  try {
15332
15306
  await K(
15333
15307
  { attachments: [fe] },
@@ -15340,7 +15314,7 @@ function Ri({
15340
15314
  dt(ae);
15341
15315
  } catch (ae) {
15342
15316
  const _e = ae instanceof Error ? ae.message : "Failed to upload Excel file";
15343
- console.error("Excel upload failed", ae), Nt(_e), m == null || m(_e);
15317
+ console.error("Excel upload failed", ae), It(_e), m == null || m(_e);
15344
15318
  } finally {
15345
15319
  He(!1), re.target.value = "", Rn();
15346
15320
  }
@@ -15365,12 +15339,12 @@ function Ri({
15365
15339
  le(!1);
15366
15340
  }
15367
15341
  }
15368
- }, Ot = Me(
15342
+ }, Pt = Me(
15369
15343
  async (re) => {
15370
15344
  await ze(re);
15371
15345
  },
15372
15346
  [ze]
15373
- ), Ct = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${p.container || ""}`, kt = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${p.messagesArea || ""}`, Wt = `flex-shrink-0 w-full border-t p-4 bg-transparent ${p.inputArea || ""}`;
15347
+ ), Ct = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${p.container || ""}`, Tt = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${p.messagesArea || ""}`, Wt = `flex-shrink-0 w-full border-t p-4 bg-transparent ${p.inputArea || ""}`;
15374
15348
  return Me(
15375
15349
  (re) => {
15376
15350
  if (!re)
@@ -15382,8 +15356,8 @@ function Ri({
15382
15356
  },
15383
15357
  []
15384
15358
  ), /* @__PURE__ */ u.jsxs("div", { className: Ct, children: [
15385
- !!F && !ft && /* @__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: [
15386
- /* @__PURE__ */ u.jsx("span", { children: F }),
15359
+ !!$ && !ft && /* @__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: [
15360
+ /* @__PURE__ */ u.jsx("span", { children: $ }),
15387
15361
  /* @__PURE__ */ u.jsx(
15388
15362
  st,
15389
15363
  {
@@ -15399,7 +15373,7 @@ function Ri({
15399
15373
  /* @__PURE__ */ u.jsxs(
15400
15374
  "div",
15401
15375
  {
15402
- className: `relative ${kt}`,
15376
+ className: `relative ${Tt}`,
15403
15377
  style: r ? { maxHeight: r } : void 0,
15404
15378
  children: [
15405
15379
  /* @__PURE__ */ u.jsx(
@@ -15430,9 +15404,9 @@ function Ri({
15430
15404
  checkpointMetaById: Oe,
15431
15405
  checkpointIndexByKey: me,
15432
15406
  activeCheckpointId: X,
15433
- onSelectCheckpoint: Ot,
15407
+ onSelectCheckpoint: Pt,
15434
15408
  timelineCheckpoints: Je,
15435
- messagePreviews: $
15409
+ messagePreviews: F
15436
15410
  }
15437
15411
  ),
15438
15412
  (A === "reconnecting" || A === "connecting") && /* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute top-3 right-3 z-20 rounded-full bg-muted/80 px-3 py-1 text-xs font-medium text-foreground shadow-sm backdrop-blur-sm dark:bg-muted/60", children: /* @__PURE__ */ u.jsxs("span", { className: "flex items-center gap-2", children: [
@@ -15509,15 +15483,15 @@ function Ri({
15509
15483
  },
15510
15484
  We
15511
15485
  ),
15512
- Fe && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15486
+ $e && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15513
15487
  /* @__PURE__ */ u.jsx(Lr, { className: "h-4 w-4 animate-spin" }),
15514
15488
  " Uploading Excel file..."
15515
15489
  ] }),
15516
- xt && !Fe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: xt }),
15517
- tt && !Fe && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: tt })
15490
+ xt && !$e && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: xt }),
15491
+ tt && !$e && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: tt })
15518
15492
  ] })
15519
15493
  ] }),
15520
- $e && /* @__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: $e }),
15494
+ Fe && /* @__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: Fe }),
15521
15495
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
15522
15496
  (a || l) && /* @__PURE__ */ u.jsxs(o0, { children: [
15523
15497
  /* @__PURE__ */ u.jsx(s0, { asChild: !0, children: /* @__PURE__ */ u.jsx(
@@ -15545,9 +15519,9 @@ function Ri({
15545
15519
  {
15546
15520
  onClick: () => {
15547
15521
  var re;
15548
- Fe || (re = at.current) == null || re.click();
15522
+ $e || (re = at.current) == null || re.click();
15549
15523
  },
15550
- className: `cursor-pointer ${Fe ? "opacity-60 pointer-events-none" : ""}`,
15524
+ className: `cursor-pointer ${$e ? "opacity-60 pointer-events-none" : ""}`,
15551
15525
  children: [
15552
15526
  /* @__PURE__ */ u.jsx(pm, { className: "h-4 w-4 mr-2" }),
15553
15527
  " Upload Excel file"
@@ -15561,7 +15535,7 @@ function Ri({
15561
15535
  {
15562
15536
  initialValue: ue,
15563
15537
  editingMessageId: G,
15564
- value: Pt,
15538
+ value: jt,
15565
15539
  onValueChange: yo,
15566
15540
  placeholder: G ? "Edit your message..." : t,
15567
15541
  isStreaming: I,
@@ -15571,7 +15545,7 @@ function Ri({
15571
15545
  onCancelEdit: U,
15572
15546
  onStop: z,
15573
15547
  allowEmptySend: ie.length > 0,
15574
- textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${G ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${$e ? "border-red-400" : ""} ${p.textarea || ""}`
15548
+ textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${G ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${Fe ? "border-red-400" : ""} ${p.textarea || ""}`
15575
15549
  }
15576
15550
  ) })
15577
15551
  ] })
@@ -15807,7 +15781,7 @@ var WC = v.forwardRef((e, t) => {
15807
15781
  ref: t,
15808
15782
  onThumbPositionChange: () => {
15809
15783
  if (o.viewport && s.current) {
15810
- const p = o.viewport.scrollLeft, h = Fc(p, a, o.dir);
15784
+ const p = o.viewport.scrollLeft, h = $c(p, a, o.dir);
15811
15785
  s.current.style.transform = `translate3d(${h}px, 0, 0)`;
15812
15786
  }
15813
15787
  },
@@ -15825,7 +15799,7 @@ var WC = v.forwardRef((e, t) => {
15825
15799
  ref: t,
15826
15800
  onThumbPositionChange: () => {
15827
15801
  if (o.viewport && s.current) {
15828
- const p = o.viewport.scrollTop, h = Fc(p, a);
15802
+ const p = o.viewport.scrollTop, h = $c(p, a);
15829
15803
  s.current.style.transform = `translate3d(0, ${h}px, 0)`;
15830
15804
  }
15831
15805
  },
@@ -15970,7 +15944,7 @@ var WC = v.forwardRef((e, t) => {
15970
15944
  )
15971
15945
  }
15972
15946
  );
15973
- }), us = "ScrollAreaThumb", $p = v.forwardRef(
15947
+ }), us = "ScrollAreaThumb", Fp = v.forwardRef(
15974
15948
  (e, t) => {
15975
15949
  const { forceMount: n, ...r } = e, o = Dp(us, e.__scopeScrollArea);
15976
15950
  return /* @__PURE__ */ u.jsx(on, { present: n || o.hasThumb, children: /* @__PURE__ */ u.jsx(YC, { ref: t, ...r }) });
@@ -16014,14 +15988,14 @@ var WC = v.forwardRef((e, t) => {
16014
15988
  );
16015
15989
  }
16016
15990
  );
16017
- $p.displayName = us;
16018
- var nl = "ScrollAreaCorner", Fp = v.forwardRef(
15991
+ Fp.displayName = us;
15992
+ var nl = "ScrollAreaCorner", $p = v.forwardRef(
16019
15993
  (e, t) => {
16020
15994
  const n = sn(nl, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
16021
15995
  return n.type !== "scroll" && r ? /* @__PURE__ */ u.jsx(XC, { ...e, ref: t }) : null;
16022
15996
  }
16023
15997
  );
16024
- Fp.displayName = nl;
15998
+ $p.displayName = nl;
16025
15999
  var XC = v.forwardRef((e, t) => {
16026
16000
  const { __scopeScrollArea: n, ...r } = e, o = sn(nl, n), [s, i] = v.useState(0), [a, l] = v.useState(0), c = !!(s && a);
16027
16001
  return Cr(o.scrollbarX, () => {
@@ -16064,7 +16038,7 @@ function JC(e, t, n, r = "ltr") {
16064
16038
  const o = Vs(n), s = o / 2, i = t || s, a = o - i, l = n.scrollbar.paddingStart + i, c = n.scrollbar.size - n.scrollbar.paddingEnd - a, d = n.content - n.viewport, f = r === "ltr" ? [0, d] : [d * -1, 0];
16065
16039
  return Bp([l, c], f)(e);
16066
16040
  }
16067
- function Fc(e, t, n = "ltr") {
16041
+ function $c(e, t, n = "ltr") {
16068
16042
  const r = Vs(t), o = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, s = t.scrollbar.size - o, i = t.content - t.viewport, a = s - r, l = n === "ltr" ? [0, i] : [i * -1, 0], c = Ji(e, l);
16069
16043
  return Bp([0, i], [0, a])(c);
16070
16044
  }
@@ -16106,7 +16080,7 @@ function Cr(e, t) {
16106
16080
  }
16107
16081
  }, [e, n]);
16108
16082
  }
16109
- var Up = jp, QC = Op, eT = Fp;
16083
+ var Up = jp, QC = Op, eT = $p;
16110
16084
  const Wp = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ u.jsxs(
16111
16085
  Up,
16112
16086
  {
@@ -16133,7 +16107,7 @@ const Vp = v.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
16133
16107
  e
16134
16108
  ),
16135
16109
  ...n,
16136
- children: /* @__PURE__ */ u.jsx($p, { className: "relative flex-1 rounded-full bg-border" })
16110
+ children: /* @__PURE__ */ u.jsx(Fp, { className: "relative flex-1 rounded-full bg-border" })
16137
16111
  }
16138
16112
  ));
16139
16113
  Vp.displayName = el.displayName;
@@ -16157,15 +16131,15 @@ function Bc({
16157
16131
  setCurrentThreadId: h,
16158
16132
  isLoading: x,
16159
16133
  actions: m
16160
- } = pa(), { loadThread: y } = ha(), { createThread: g, deleteThread: b, renameThread: w } = m, [T, S] = we(Array.isArray(f) ? f : []), C = Ue(T.length > 0), k = Ue(null), E = Ue(0), [N, L] = we(null), [j, M] = we(""), [$, I] = we(!1);
16161
- Et(() => {
16134
+ } = pa(), { loadThread: y } = ha(), { createThread: g, deleteThread: b, renameThread: w } = m, [T, S] = we(Array.isArray(f) ? f : []), C = Ue(T.length > 0), k = Ue(null), E = Ue(0), [N, L] = we(null), [j, M] = we(""), [F, I] = we(!1);
16135
+ Rt(() => {
16162
16136
  const q = Array.isArray(f) ? f : [];
16163
16137
  if (q.length > 0) {
16164
16138
  C.current = !0, S(q);
16165
16139
  return;
16166
16140
  }
16167
16141
  x || (C.current = !1, S(q));
16168
- }, [f, x]), Et(() => {
16142
+ }, [f, x]), Rt(() => {
16169
16143
  if (!k.current) return;
16170
16144
  const q = k.current.querySelector(
16171
16145
  "[data-radix-scroll-area-viewport]"
@@ -16180,7 +16154,7 @@ function Bc({
16180
16154
  H !== null && cancelAnimationFrame(H), Z !== null && cancelAnimationFrame(Z);
16181
16155
  };
16182
16156
  }, [T]);
16183
- const F = async (q) => {
16157
+ const $ = async (q) => {
16184
16158
  try {
16185
16159
  h(q), await y(q), a == null || a(q), l == null || l(q);
16186
16160
  } catch (H) {
@@ -16238,11 +16212,11 @@ function Bc({
16238
16212
  st,
16239
16213
  {
16240
16214
  onClick: A,
16241
- disabled: $ || x,
16215
+ disabled: F || x,
16242
16216
  className: s.createButton || "p-2",
16243
16217
  size: "sm",
16244
16218
  variant: "ghost",
16245
- title: $ ? "Creating..." : "New Chat",
16219
+ title: F ? "Creating..." : "New Chat",
16246
16220
  children: /* @__PURE__ */ u.jsx(hm, { size: 20 })
16247
16221
  }
16248
16222
  ) }),
@@ -16261,7 +16235,7 @@ function Bc({
16261
16235
  ] }) : T.slice().sort((q, H) => new Date(H.updatedAt || H.createdAt || "").getTime() - new Date(q.updatedAt || q.createdAt || "").getTime()).map((q) => /* @__PURE__ */ u.jsxs(
16262
16236
  "div",
16263
16237
  {
16264
- onClick: () => F(q.threadId),
16238
+ onClick: () => $(q.threadId),
16265
16239
  className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? p) === q.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
16266
16240
  children: [
16267
16241
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
@@ -16619,7 +16593,7 @@ var mT = [" ", "Enter", "ArrowUp", "ArrowDown"], gT = [" ", "Enter"], nr = "Sele
16619
16593
  defaultProp: a,
16620
16594
  onChange: l,
16621
16595
  caller: nr
16622
- }), j = v.useRef(null), M = y ? x || !!y.closest("form") : !0, [$, I] = v.useState(/* @__PURE__ */ new Set()), F = Array.from($).map((A) => A.props.value).join(";");
16596
+ }), j = v.useRef(null), M = y ? x || !!y.closest("form") : !0, [F, I] = v.useState(/* @__PURE__ */ new Set()), $ = Array.from(F).map((A) => A.props.value).join(";");
16623
16597
  return /* @__PURE__ */ u.jsx(td, { ...m, children: /* @__PURE__ */ u.jsxs(
16624
16598
  yT,
16625
16599
  {
@@ -16670,10 +16644,10 @@ var mT = [" ", "Enter", "ArrowUp", "ArrowDown"], gT = [" ", "Enter"], nr = "Sele
16670
16644
  form: x,
16671
16645
  children: [
16672
16646
  N === void 0 ? /* @__PURE__ */ u.jsx("option", { value: "" }) : null,
16673
- Array.from($)
16647
+ Array.from(F)
16674
16648
  ]
16675
16649
  },
16676
- F
16650
+ $
16677
16651
  ) : null
16678
16652
  ]
16679
16653
  }
@@ -16790,7 +16764,7 @@ var an = 10, [hh, Vn] = Ar(rr), CT = "SelectContentImpl", TT = vr("SelectContent
16790
16764
  ...g
16791
16765
  } = e, b = Wn(rr, n), [w, T] = v.useState(null), [S, C] = v.useState(null), k = qe(t, (Z) => T(Z)), [E, N] = v.useState(null), [L, j] = v.useState(
16792
16766
  null
16793
- ), M = Ys(n), [$, I] = v.useState(!1), F = v.useRef(!1);
16767
+ ), M = Ys(n), [F, I] = v.useState(!1), $ = v.useRef(!1);
16794
16768
  v.useEffect(() => {
16795
16769
  if (w) return Ra(w);
16796
16770
  }, [w]), xa();
@@ -16806,8 +16780,8 @@ var an = 10, [hh, Vn] = Ar(rr), CT = "SelectContentImpl", TT = vr("SelectContent
16806
16780
  [A, E, w]
16807
16781
  );
16808
16782
  v.useEffect(() => {
16809
- $ && K();
16810
- }, [$, K]);
16783
+ F && K();
16784
+ }, [F, K]);
16811
16785
  const { onOpenChange: z, triggerPointerDownPosRef: _ } = b;
16812
16786
  v.useEffect(() => {
16813
16787
  if (w) {
@@ -16836,13 +16810,13 @@ var an = 10, [hh, Vn] = Ar(rr), CT = "SelectContentImpl", TT = vr("SelectContent
16836
16810
  Q && setTimeout(() => Q.ref.current.focus());
16837
16811
  }), se = v.useCallback(
16838
16812
  (Z, D, G) => {
16839
- const Q = !F.current && !G;
16840
- (b.value !== void 0 && b.value === D || Q) && (N(Z), Q && (F.current = !0));
16813
+ const Q = !$.current && !G;
16814
+ (b.value !== void 0 && b.value === D || Q) && (N(Z), Q && ($.current = !0));
16841
16815
  },
16842
16816
  [b.value]
16843
16817
  ), ye = v.useCallback(() => w == null ? void 0 : w.focus(), [w]), Pe = v.useCallback(
16844
16818
  (Z, D, G) => {
16845
- const Q = !F.current && !G;
16819
+ const Q = !$.current && !G;
16846
16820
  (b.value !== void 0 && b.value === D || Q) && j(Z);
16847
16821
  },
16848
16822
  [b.value]
@@ -16872,7 +16846,7 @@ var an = 10, [hh, Vn] = Ar(rr), CT = "SelectContentImpl", TT = vr("SelectContent
16872
16846
  focusSelectedItem: K,
16873
16847
  selectedItemText: L,
16874
16848
  position: r,
16875
- isPositioned: $,
16849
+ isPositioned: F,
16876
16850
  searchRef: X,
16877
16851
  children: /* @__PURE__ */ u.jsx(js, { as: TT, allowPinchZoom: !0, children: /* @__PURE__ */ u.jsx(
16878
16852
  Ts,
@@ -16942,24 +16916,24 @@ var kT = "SelectItemAlignedPosition", gh = v.forwardRef((e, t) => {
16942
16916
  if (s.trigger && s.valueNode && a && c && m && y && g) {
16943
16917
  const k = s.trigger.getBoundingClientRect(), E = c.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), L = g.getBoundingClientRect();
16944
16918
  if (s.dir !== "rtl") {
16945
- const ue = L.left - E.left, oe = N.left - ue, Ee = k.left - oe, Ge = k.width + Ee, $e = Math.max(Ge, E.width), Ze = window.innerWidth - an, ie = Ji(oe, [
16919
+ const ue = L.left - E.left, oe = N.left - ue, Ee = k.left - oe, Ge = k.width + Ee, Fe = Math.max(Ge, E.width), Ze = window.innerWidth - an, ie = Ji(oe, [
16946
16920
  an,
16947
16921
  // Prevents the content from going off the starting edge of the
16948
16922
  // viewport. It may still go off the ending edge, but this can be
16949
16923
  // controlled by the user since they may want to manage overflow in a
16950
16924
  // specific way.
16951
16925
  // https://github.com/radix-ui/primitives/issues/2049
16952
- Math.max(an, Ze - $e)
16926
+ Math.max(an, Ze - Fe)
16953
16927
  ]);
16954
16928
  a.style.minWidth = Ge + "px", a.style.left = ie + "px";
16955
16929
  } else {
16956
- const ue = E.right - L.right, oe = window.innerWidth - N.right - ue, Ee = window.innerWidth - k.right - oe, Ge = k.width + Ee, $e = Math.max(Ge, E.width), Ze = window.innerWidth - an, ie = Ji(oe, [
16930
+ const ue = E.right - L.right, oe = window.innerWidth - N.right - ue, Ee = window.innerWidth - k.right - oe, Ge = k.width + Ee, Fe = Math.max(Ge, E.width), Ze = window.innerWidth - an, ie = Ji(oe, [
16957
16931
  an,
16958
- Math.max(an, Ze - $e)
16932
+ Math.max(an, Ze - Fe)
16959
16933
  ]);
16960
16934
  a.style.minWidth = Ge + "px", a.style.right = ie + "px";
16961
16935
  }
16962
- const j = p(), M = window.innerHeight - an * 2, $ = m.scrollHeight, I = window.getComputedStyle(c), F = parseInt(I.borderTopWidth, 10), A = parseInt(I.paddingTop, 10), K = parseInt(I.borderBottomWidth, 10), z = parseInt(I.paddingBottom, 10), _ = F + A + $ + z + K, X = Math.min(y.offsetHeight * 5, _), J = window.getComputedStyle(m), se = parseInt(J.paddingTop, 10), ye = parseInt(J.paddingBottom, 10), Pe = k.top + k.height / 2 - an, q = M - Pe, H = y.offsetHeight / 2, Z = y.offsetTop + H, D = F + A + Z, G = _ - D;
16936
+ const j = p(), M = window.innerHeight - an * 2, F = m.scrollHeight, I = window.getComputedStyle(c), $ = parseInt(I.borderTopWidth, 10), A = parseInt(I.paddingTop, 10), K = parseInt(I.borderBottomWidth, 10), z = parseInt(I.paddingBottom, 10), _ = $ + A + F + z + K, X = Math.min(y.offsetHeight * 5, _), J = window.getComputedStyle(m), se = parseInt(J.paddingTop, 10), ye = parseInt(J.paddingBottom, 10), Pe = k.top + k.height / 2 - an, q = M - Pe, H = y.offsetHeight / 2, Z = y.offsetTop + H, D = $ + A + Z, G = _ - D;
16963
16937
  if (D <= Pe) {
16964
16938
  const ue = j.length > 0 && y === j[j.length - 1].ref.current;
16965
16939
  a.style.bottom = "0px";
@@ -16974,7 +16948,7 @@ var kT = "SelectItemAlignedPosition", gh = v.forwardRef((e, t) => {
16974
16948
  a.style.top = "0px";
16975
16949
  const Ee = Math.max(
16976
16950
  Pe,
16977
- F + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
16951
+ $ + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
16978
16952
  (ue ? se : 0) + H
16979
16953
  ) + G;
16980
16954
  a.style.height = Ee + "px", m.scrollTop = D - Pe + m.offsetTop;
@@ -17222,9 +17196,9 @@ var fs = "SelectItem", [_T, wh] = Ar(fs), Sh = v.forwardRef(
17222
17196
  }
17223
17197
  );
17224
17198
  Sh.displayName = fs;
17225
- var Fr = "SelectItemText", Ch = v.forwardRef(
17199
+ var $r = "SelectItemText", Ch = v.forwardRef(
17226
17200
  (e, t) => {
17227
- const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Wn(Fr, n), a = Vn(Fr, n), l = wh(Fr, n), c = bT(Fr, n), [d, f] = v.useState(null), p = qe(
17201
+ const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Wn($r, n), a = Vn($r, n), l = wh($r, n), c = bT($r, n), [d, f] = v.useState(null), p = qe(
17228
17202
  t,
17229
17203
  (g) => f(g),
17230
17204
  l.onItemTextChange,
@@ -17242,7 +17216,7 @@ var Fr = "SelectItemText", Ch = v.forwardRef(
17242
17216
  ] });
17243
17217
  }
17244
17218
  );
17245
- Ch.displayName = Fr;
17219
+ Ch.displayName = $r;
17246
17220
  var Th = "SelectItemIndicator", kh = v.forwardRef(
17247
17221
  (e, t) => {
17248
17222
  const { __scopeSelect: n, ...r } = e;
@@ -17394,7 +17368,7 @@ function Ph(e, t, n) {
17394
17368
  function MT(e, t) {
17395
17369
  return e.map((n, r) => e[(t + r) % e.length]);
17396
17370
  }
17397
- var DT = ih, Oh = lh, LT = uh, $T = dh, FT = fh, Mh = ph, zT = xh, Dh = bh, Lh = Sh, BT = Ch, HT = kh, $h = Rh, Fh = Eh, zh = Nh;
17371
+ var DT = ih, Oh = lh, LT = uh, FT = dh, $T = fh, Mh = ph, zT = xh, Dh = bh, Lh = Sh, BT = Ch, HT = kh, Fh = Rh, $h = Eh, zh = Nh;
17398
17372
  const Hc = DT, Uc = LT, ra = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ u.jsxs(
17399
17373
  Oh,
17400
17374
  {
@@ -17406,13 +17380,13 @@ const Hc = DT, Uc = LT, ra = v.forwardRef(({ className: e, children: t, ...n },
17406
17380
  ...n,
17407
17381
  children: [
17408
17382
  t,
17409
- /* @__PURE__ */ u.jsx($T, { asChild: !0, children: /* @__PURE__ */ u.jsx(hs, { className: "h-4 w-4 opacity-50" }) })
17383
+ /* @__PURE__ */ u.jsx(FT, { asChild: !0, children: /* @__PURE__ */ u.jsx(hs, { className: "h-4 w-4 opacity-50" }) })
17410
17384
  ]
17411
17385
  }
17412
17386
  ));
17413
17387
  ra.displayName = Oh.displayName;
17414
17388
  const Bh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17415
- $h,
17389
+ Fh,
17416
17390
  {
17417
17391
  ref: n,
17418
17392
  className: te(
@@ -17423,9 +17397,9 @@ const Bh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17423
17397
  children: /* @__PURE__ */ u.jsx(aa, { className: "h-4 w-4" })
17424
17398
  }
17425
17399
  ));
17426
- Bh.displayName = $h.displayName;
17400
+ Bh.displayName = Fh.displayName;
17427
17401
  const Hh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17428
- Fh,
17402
+ $h,
17429
17403
  {
17430
17404
  ref: n,
17431
17405
  className: te(
@@ -17436,8 +17410,8 @@ const Hh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17436
17410
  children: /* @__PURE__ */ u.jsx(hs, { className: "h-4 w-4" })
17437
17411
  }
17438
17412
  ));
17439
- Hh.displayName = Fh.displayName;
17440
- const oa = v.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ u.jsx(FT, { children: /* @__PURE__ */ u.jsxs(
17413
+ Hh.displayName = $h.displayName;
17414
+ const oa = v.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ u.jsx($T, { children: /* @__PURE__ */ u.jsxs(
17441
17415
  Mh,
17442
17416
  {
17443
17417
  ref: o,
@@ -17632,10 +17606,10 @@ const ZT = {
17632
17606
  };
17633
17607
  function Ok({ settings: e, onSettingsChange: t, className: n = "" }) {
17634
17608
  const [r, o] = we(!1), [s, i] = we(!1), [a, l] = we(e), [c, d] = we(!1), { toast: f } = Ka();
17635
- Et(() => {
17609
+ Rt(() => {
17636
17610
  const y = JSON.stringify(a) !== JSON.stringify(e);
17637
17611
  d(y);
17638
- }, [a, e]), Et(() => {
17612
+ }, [a, e]), Rt(() => {
17639
17613
  l(e);
17640
17614
  }, [e]);
17641
17615
  const p = () => {