teodor-new-chat-ui 4.3.333 → 4.3.334

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
@@ -136,14 +136,14 @@ function Em() {
136
136
  }
137
137
  return null;
138
138
  }
139
- var E = Object.assign, F = 0, j, Z, B, A, K, G, oe;
139
+ var E = Object.assign, F = 0, j, Z, B, A, W, G, oe;
140
140
  function ve() {
141
141
  }
142
142
  ve.__reactDisabledLog = !0;
143
143
  function je() {
144
144
  {
145
145
  if (F === 0) {
146
- j = console.log, Z = console.info, B = console.warn, A = console.error, K = console.group, G = console.groupCollapsed, oe = console.groupEnd;
146
+ j = console.log, Z = console.info, B = console.warn, A = console.error, W = console.group, G = console.groupCollapsed, oe = console.groupEnd;
147
147
  var k = {
148
148
  configurable: !0,
149
149
  enumerable: !0,
@@ -185,7 +185,7 @@ function Em() {
185
185
  value: A
186
186
  }),
187
187
  group: E({}, k, {
188
- value: K
188
+ value: W
189
189
  }),
190
190
  groupCollapsed: E({}, k, {
191
191
  value: G
@@ -212,13 +212,13 @@ function Em() {
212
212
  ` + Y + k;
213
213
  }
214
214
  }
215
- var W = !1, J;
215
+ var V = !1, J;
216
216
  {
217
217
  var ae = typeof WeakMap == "function" ? WeakMap : Map;
218
218
  J = new ae();
219
219
  }
220
220
  function re(k, H) {
221
- if (!k || W)
221
+ if (!k || V)
222
222
  return "";
223
223
  {
224
224
  var se = J.get(k);
@@ -226,7 +226,7 @@ function Em() {
226
226
  return se;
227
227
  }
228
228
  var we;
229
- W = !0;
229
+ V = !0;
230
230
  var Je = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
232
232
  var it;
@@ -283,7 +283,7 @@ function Em() {
283
283
  }
284
284
  }
285
285
  } finally {
286
- W = !1, z.current = it, q(), Error.prepareStackTrace = Je;
286
+ V = !1, z.current = it, q(), Error.prepareStackTrace = Je;
287
287
  }
288
288
  var Se = k ? k.displayName || k.name : "", Ie = Se ? D(Se) : "";
289
289
  return typeof k == "function" && J.set(k, Ie), Ie;
@@ -470,7 +470,7 @@ function Em() {
470
470
  }
471
471
  }
472
472
  var pt = g.ReactCurrentOwner, lt = g.ReactDebugCurrentFrame;
473
- function V(k) {
473
+ function K(k) {
474
474
  if (k) {
475
475
  var H = k._owner, se = Oe(k.type, k._source, H ? H.type : null);
476
476
  lt.setExtraStackFrame(se);
@@ -520,7 +520,7 @@ Check the top-level render call using <` + se + ">.");
520
520
  return;
521
521
  Re[se] = !0;
522
522
  var we = "";
523
- k && k._owner && k._owner !== pt.current && (we = " It was passed a child from " + $(k._owner.type) + "."), V(k), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', se, we), V(null);
523
+ k && k._owner && k._owner !== pt.current && (we = " It was passed a child from " + $(k._owner.type) + "."), K(k), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', se, we), K(null);
524
524
  }
525
525
  }
526
526
  function Me(k, H) {
@@ -572,15 +572,15 @@ Check the top-level render call using <` + se + ">.");
572
572
  for (var H = Object.keys(k.props), se = 0; se < H.length; se++) {
573
573
  var we = H[se];
574
574
  if (we !== "children" && we !== "key") {
575
- V(k), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", we), V(null);
575
+ K(k), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", we), K(null);
576
576
  break;
577
577
  }
578
578
  }
579
- k.ref !== null && (V(k), w("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
579
+ k.ref !== null && (K(k), w("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
580
580
  }
581
581
  }
582
582
  var Tn = {};
583
- function _n(k, H, se, we, Je, it) {
583
+ function Vn(k, H, se, we, Je, it) {
584
584
  {
585
585
  var Be = L(k);
586
586
  if (!Be) {
@@ -610,28 +610,28 @@ Check the top-level render call using <` + se + ">.");
610
610
  if (Ye.call(H, "key")) {
611
611
  var Ie = $(k), Ge = Object.keys(H).filter(function(Gh) {
612
612
  return Gh !== "key";
613
- }), Pn = Ge.length > 0 ? "{key: someKey, " + Ge.join(": ..., ") + ": ...}" : "{key: someKey}";
614
- if (!Tn[Ie + Pn]) {
613
+ }), jn = Ge.length > 0 ? "{key: someKey, " + Ge.join(": ..., ") + ": ...}" : "{key: someKey}";
614
+ if (!Tn[Ie + jn]) {
615
615
  var Yt = Ge.length > 0 ? "{" + Ge.join(": ..., ") + ": ...}" : "{}";
616
616
  w(`A props object containing a "key" prop is being spread into JSX:
617
617
  let props = %s;
618
618
  <%s {...props} />
619
619
  React keys must be passed directly to JSX without using spread:
620
620
  let props = %s;
621
- <%s key={someKey} {...props} />`, Pn, Ie, Yt, Ie), Tn[Ie + Pn] = !0;
621
+ <%s key={someKey} {...props} />`, jn, Ie, Yt, Ie), Tn[Ie + jn] = !0;
622
622
  }
623
623
  }
624
624
  return k === r ? Wt(wt) : Ee(wt), wt;
625
625
  }
626
626
  }
627
- function Kn(k, H, se) {
628
- return _n(k, H, se, !0);
627
+ function ur(k, H, se) {
628
+ return Vn(k, H, se, !0);
629
629
  }
630
630
  function Pr(k, H, se) {
631
- return _n(k, H, se, !1);
631
+ return Vn(k, H, se, !1);
632
632
  }
633
- var jn = Pr, qn = Kn;
634
- Or.Fragment = r, Or.jsx = jn, Or.jsxs = qn;
633
+ var _n = Pr, Kn = ur;
634
+ Or.Fragment = r, Or.jsx = _n, Or.jsxs = Kn;
635
635
  }()), Or;
636
636
  }
637
637
  process.env.NODE_ENV === "production" ? Ii.exports = Rm() : Ii.exports = Em();
@@ -698,7 +698,7 @@ function qc(e, t) {
698
698
  return o;
699
699
  return null;
700
700
  }
701
- const Yn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Gc = (e) => !Sr(e) && e !== Yn;
701
+ const Gn = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Gc = (e) => !Sr(e) && e !== Gn;
702
702
  function ki() {
703
703
  const { caseless: e, skipUndefined: t } = Gc(this) && this || {}, n = {}, r = (o, s) => {
704
704
  const i = e && qc(n, s) || s;
@@ -807,14 +807,14 @@ const cg = (e) => {
807
807
  return r;
808
808
  };
809
809
  return n(e, 0);
810
- }, ug = dn("AsyncFunction"), dg = (e) => e && (ao(e) || zt(e)) && zt(e.then) && zt(e.catch), Xc = ((e, t) => e ? setImmediate : t ? ((n, r) => (Yn.addEventListener("message", ({ source: o, data: s }) => {
811
- o === Yn && s === n && r.length && r.shift()();
810
+ }, ug = dn("AsyncFunction"), dg = (e) => e && (ao(e) || zt(e)) && zt(e.then) && zt(e.catch), Xc = ((e, t) => e ? setImmediate : t ? ((n, r) => (Gn.addEventListener("message", ({ source: o, data: s }) => {
811
+ o === Gn && s === n && r.length && r.shift()();
812
812
  }, !1), (o) => {
813
- r.push(o), Yn.postMessage(n, "*");
813
+ r.push(o), Gn.postMessage(n, "*");
814
814
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
815
815
  typeof setImmediate == "function",
816
- zt(Yn.postMessage)
817
- ), fg = typeof queueMicrotask < "u" ? queueMicrotask.bind(Yn) : typeof process < "u" && process.nextTick || Xc, pg = (e) => e != null && zt(e[xs]), O = {
816
+ zt(Gn.postMessage)
817
+ ), fg = typeof queueMicrotask < "u" ? queueMicrotask.bind(Gn) : typeof process < "u" && process.nextTick || Xc, pg = (e) => e != null && zt(e[xs]), O = {
818
818
  isArray: kr,
819
819
  isArrayBuffer: Vc,
820
820
  isBuffer: io,
@@ -864,7 +864,7 @@ const cg = (e) => {
864
864
  noop: ig,
865
865
  toFiniteNumber: ag,
866
866
  findKey: qc,
867
- global: Yn,
867
+ global: Gn,
868
868
  isContextDefined: Gc,
869
869
  isSpecCompliantForm: lg,
870
870
  toJSONObject: cg,
@@ -1572,7 +1572,7 @@ function iu(e, t, n) {
1572
1572
  return e && (r || n == !1) ? Hg(e, t) : t;
1573
1573
  }
1574
1574
  const hl = (e) => e instanceof Ht ? { ...e } : e;
1575
- function Qn(e, t) {
1575
+ function Zn(e, t) {
1576
1576
  t = t || {};
1577
1577
  const n = {};
1578
1578
  function r(c, d, f, p) {
@@ -1637,7 +1637,7 @@ function Qn(e, t) {
1637
1637
  }), n;
1638
1638
  }
1639
1639
  const au = (e) => {
1640
- const t = Qn({}, e);
1640
+ const t = Zn({}, e);
1641
1641
  let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
1642
1642
  if (t.headers = i = Ht.from(i), t.url = tu(iu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1643
1643
  "Authorization",
@@ -1919,10 +1919,10 @@ const au = (e) => {
1919
1919
  );
1920
1920
  }
1921
1921
  I = I || "text";
1922
- let K = await f[O.findKey(f, I) || "text"](B, x);
1922
+ let W = await f[O.findKey(f, I) || "text"](B, x);
1923
1923
  return !A && E && E(), await new Promise((G, oe) => {
1924
1924
  su(G, oe, {
1925
- data: K,
1925
+ data: W,
1926
1926
  headers: Ht.from(B.headers),
1927
1927
  status: B.status,
1928
1928
  statusText: B.statusText,
@@ -2070,7 +2070,7 @@ const Mo = {
2070
2070
  assertOptions: Qg,
2071
2071
  validators: bs
2072
2072
  }, hn = Mo.validators;
2073
- let Jn = class {
2073
+ let Xn = class {
2074
2074
  constructor(t) {
2075
2075
  this.defaults = t || {}, this.interceptors = {
2076
2076
  request: new ul(),
@@ -2103,7 +2103,7 @@ let Jn = class {
2103
2103
  }
2104
2104
  }
2105
2105
  _request(t, n) {
2106
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = Qn(this.defaults, n);
2106
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = Zn(this.defaults, n);
2107
2107
  const { transitional: r, paramsSerializer: o, headers: s } = n;
2108
2108
  r !== void 0 && Mo.assertOptions(r, {
2109
2109
  silentJSONParsing: hn.transitional(hn.boolean),
@@ -2165,14 +2165,14 @@ let Jn = class {
2165
2165
  return d;
2166
2166
  }
2167
2167
  getUri(t) {
2168
- t = Qn(this.defaults, t);
2168
+ t = Zn(this.defaults, t);
2169
2169
  const n = iu(t.baseURL, t.url, t.allowAbsoluteUrls);
2170
2170
  return tu(n, t.params, t.paramsSerializer);
2171
2171
  }
2172
2172
  };
2173
2173
  O.forEach(["delete", "get", "head", "options"], function(t) {
2174
- Jn.prototype[t] = function(n, r) {
2175
- return this.request(Qn(r || {}, {
2174
+ Xn.prototype[t] = function(n, r) {
2175
+ return this.request(Zn(r || {}, {
2176
2176
  method: t,
2177
2177
  url: n,
2178
2178
  data: (r || {}).data
@@ -2182,7 +2182,7 @@ O.forEach(["delete", "get", "head", "options"], function(t) {
2182
2182
  O.forEach(["post", "put", "patch"], function(t) {
2183
2183
  function n(r) {
2184
2184
  return function(s, i, a) {
2185
- return this.request(Qn(a || {}, {
2185
+ return this.request(Zn(a || {}, {
2186
2186
  method: t,
2187
2187
  headers: r ? {
2188
2188
  "Content-Type": "multipart/form-data"
@@ -2192,7 +2192,7 @@ O.forEach(["post", "put", "patch"], function(t) {
2192
2192
  }));
2193
2193
  };
2194
2194
  }
2195
- Jn.prototype[t] = n(), Jn.prototype[t + "Form"] = n(!0);
2195
+ Xn.prototype[t] = n(), Xn.prototype[t + "Form"] = n(!0);
2196
2196
  });
2197
2197
  let ex = class du {
2198
2198
  constructor(t) {
@@ -2344,13 +2344,13 @@ Object.entries(Ni).forEach(([e, t]) => {
2344
2344
  Ni[t] = e;
2345
2345
  });
2346
2346
  function fu(e) {
2347
- const t = new Jn(e), n = Uc(Jn.prototype.request, t);
2348
- return O.extend(n, Jn.prototype, t, { allOwnKeys: !0 }), O.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2349
- return fu(Qn(e, o));
2347
+ const t = new Xn(e), n = Uc(Xn.prototype.request, t);
2348
+ return O.extend(n, Xn.prototype, t, { allOwnKeys: !0 }), O.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2349
+ return fu(Zn(e, o));
2350
2350
  }, n;
2351
2351
  }
2352
2352
  const Ct = fu(co);
2353
- Ct.Axios = Jn;
2353
+ Ct.Axios = Xn;
2354
2354
  Ct.CanceledError = Rr;
2355
2355
  Ct.CancelToken = ex;
2356
2356
  Ct.isCancel = ou;
@@ -2363,7 +2363,7 @@ Ct.all = function(t) {
2363
2363
  };
2364
2364
  Ct.spread = tx;
2365
2365
  Ct.isAxiosError = nx;
2366
- Ct.mergeConfig = Qn;
2366
+ Ct.mergeConfig = Zn;
2367
2367
  Ct.AxiosHeaders = Ht;
2368
2368
  Ct.formToJSON = (e) => ru(O.isHTMLForm(e) ? new FormData(e) : e);
2369
2369
  Ct.getAdapter = cu.getAdapter;
@@ -2530,9 +2530,9 @@ class cx {
2530
2530
  return (r == null ? void 0 : r.items) ?? [];
2531
2531
  }
2532
2532
  }
2533
- const er = new cx(), pu = so(null);
2533
+ const Qn = new cx(), pu = so(null);
2534
2534
  function ux({ children: e, apiConfig: t }) {
2535
- const n = er;
2535
+ const n = Qn;
2536
2536
  if (t) {
2537
2537
  const o = n.baseUrl, s = n.getAuthToken();
2538
2538
  t.baseUrl && t.baseUrl !== o && n.updateConfig({
@@ -3061,12 +3061,12 @@ function $x(e = {}) {
3061
3061
  b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && p(""), x(null), I.current = null, R.current = null, _.current = null;
3062
3062
  const Z = new AbortController();
3063
3063
  b.current = Z;
3064
- let B = null, A = null, K = !1;
3064
+ let B = null, A = null, W = !1;
3065
3065
  return C.current = {
3066
3066
  threadId: E.threadId ?? null,
3067
3067
  headers: {}
3068
3068
  }, (async () => {
3069
- var oe, ve, je, q, z, Y, D, W, J, ae, re, Ne, He, Oe, Ye, qe, tt, Xe;
3069
+ var oe, ve, je, q, z, Y, D, V, J, ae, re, Ne, He, Oe, Ye, qe, tt, Xe;
3070
3070
  const G = (ie) => {
3071
3071
  var xe;
3072
3072
  try {
@@ -3092,8 +3092,8 @@ function $x(e = {}) {
3092
3092
  N && (lt = ((je = JSON.parse(N)) == null ? void 0 : je.apiKey) || null);
3093
3093
  } catch {
3094
3094
  }
3095
- const V = et || pt || lt || null;
3096
- V && (ie = { Authorization: `Bearer ${V}` });
3095
+ const K = et || pt || lt || null;
3096
+ K && (ie = { Authorization: `Bearer ${K}` });
3097
3097
  }
3098
3098
  } catch {
3099
3099
  }
@@ -3132,7 +3132,7 @@ function $x(e = {}) {
3132
3132
  Qe == null ? void 0 : Qe.slice(0, 500)
3133
3133
  );
3134
3134
  const et = `stream ${st.status}${Qe ? ": " + Qe : ""}`;
3135
- throw (z = j == null ? void 0 : j.onConnectionError) == null || z.call(j, et), K = !0, B = "error", A = et, new Error(et);
3135
+ throw (z = j == null ? void 0 : j.onConnectionError) == null || z.call(j, et), W = !0, B = "error", A = et, new Error(et);
3136
3136
  }
3137
3137
  w(!0);
3138
3138
  const at = st.body.getReader(), _t = new TextDecoder();
@@ -3162,9 +3162,9 @@ function $x(e = {}) {
3162
3162
  ...C.current,
3163
3163
  threadId: pt
3164
3164
  }), (Y = j == null ? void 0 : j.onOpen) == null || Y.call(j, { threadId: pt, created: lt }); ; ) {
3165
- const { value: V, done: N } = await at.read();
3165
+ const { value: K, done: N } = await at.read();
3166
3166
  if (N) break;
3167
- vt += _t.decode(V, { stream: !0 }), vt.length > pn && (vt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3167
+ vt += _t.decode(K, { stream: !0 }), vt.length > pn && (vt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3168
3168
  let X;
3169
3169
  for (; (X = vt.indexOf(`
3170
3170
 
@@ -3225,7 +3225,7 @@ function $x(e = {}) {
3225
3225
  } else if (be.type === "heartbeat") {
3226
3226
  console.debug("[use-chat] heartbeat received");
3227
3227
  try {
3228
- (W = j == null ? void 0 : j.onHeartbeat) == null || W.call(j, be);
3228
+ (V = j == null ? void 0 : j.onHeartbeat) == null || V.call(j, be);
3229
3229
  } catch (Me) {
3230
3230
  console.warn("[use-chat] heartbeat callback failed", Me);
3231
3231
  }
@@ -3267,7 +3267,7 @@ function $x(e = {}) {
3267
3267
  B = B ?? "aborted";
3268
3268
  else {
3269
3269
  const xe = ie.message || String(ie);
3270
- B = "error", A = xe, d(xe), (qe = j == null ? void 0 : j.onError) == null || qe.call(j, xe), K || ((tt = j == null ? void 0 : j.onConnectionError) == null || tt.call(j, xe), K = !0);
3270
+ B = "error", A = xe, d(xe), (qe = j == null ? void 0 : j.onError) == null || qe.call(j, xe), W || ((tt = j == null ? void 0 : j.onConnectionError) == null || tt.call(j, xe), W = !0);
3271
3271
  }
3272
3272
  } finally {
3273
3273
  const ie = S.current, xe = I.current, Ue = R.current, We = _.current, st = B ?? (Z.signal.aborted ? "aborted" : A ? "error" : "complete");
@@ -3882,7 +3882,7 @@ function Yx({
3882
3882
  }
3883
3883
  },
3884
3884
  onClosed: ($) => {
3885
- var Z, B, A, K;
3885
+ var Z, B, A, W;
3886
3886
  const E = ((Z = h.current) == null ? void 0 : Z.manualStop) ?? !1, F = f.current ?? ((B = h.current) == null ? void 0 : B.threadIdGuess) ?? ((A = $.lastStateHistory) == null ? void 0 : A.threadId) ?? null;
3887
3887
  ($.reason === "complete" || $.reason === "aborted" && E) && g(F);
3888
3888
  const j = {
@@ -3898,7 +3898,7 @@ function Yx({
3898
3898
  console.warn("[useChatStreamingService] onStreamClosed handler failed", G);
3899
3899
  }
3900
3900
  try {
3901
- (K = M == null ? void 0 : M.onClosed) == null || K.call(M, j);
3901
+ (W = M == null ? void 0 : M.onClosed) == null || W.call(M, j);
3902
3902
  } catch (G) {
3903
3903
  console.warn("[useChatStreamingService] downstream onClosed handler failed", G);
3904
3904
  }
@@ -3944,64 +3944,64 @@ function Xx({
3944
3944
  onAuthError: i,
3945
3945
  onThreadChange: a
3946
3946
  }) {
3947
- const { api: l, baseUrl: c } = hu(), d = De(() => Rn(c), [c]), [f, p] = me([]), [h, x] = me(t), [m, y] = me(!1), [g, w] = me(null), [b, T] = me(!1), [S, C] = me(null), { state: I, seed: R, prepend: _, pushUser: L, onEvent: P } = Wx(), [M, $] = me(!1), [E, F] = me(!1), [j, Z] = me(null), [B, A] = me([]), [K, G] = me([]), [oe, ve] = me(!1), je = De(
3948
- () => B.flatMap((V) => V.messages ?? []),
3947
+ const { api: l, baseUrl: c } = hu(), d = De(() => Rn(c), [c]), [f, p] = me([]), [h, x] = me(t), [m, y] = me(!1), [g, w] = me(null), [b, T] = me(!1), [S, C] = me(null), { state: I, seed: R, prepend: _, pushUser: L, onEvent: P } = Wx(), [M, $] = me(!1), [E, F] = me(!1), [j, Z] = me(null), [B, A] = me([]), [W, G] = me([]), [oe, ve] = me(!1), je = De(
3948
+ () => B.flatMap((K) => K.messages ?? []),
3949
3949
  [B]
3950
- ), q = De(() => Lx(je), [je]), z = Le(h), Y = Le(null), D = Le(null), W = Le(null), J = Le(null), ae = Le(!1), re = Le(null), Ne = Le(/* @__PURE__ */ new Map()), He = Le(/* @__PURE__ */ new Map());
3950
+ ), q = De(() => Lx(je), [je]), z = Le(h), Y = Le(null), D = Le(null), V = Le(null), J = Le(null), ae = Le(!1), re = Le(null), Ne = Le(/* @__PURE__ */ new Map()), He = Le(/* @__PURE__ */ new Map());
3951
3951
  yt(() => {
3952
3952
  z.current = h;
3953
3953
  }, [h]);
3954
3954
  const Oe = ge(async () => {
3955
3955
  y(!0), w(null);
3956
3956
  try {
3957
- const V = await l.listThreads();
3958
- p(V ?? []);
3959
- } catch (V) {
3960
- const N = String(V);
3957
+ const K = await l.listThreads();
3958
+ p(K ?? []);
3959
+ } catch (K) {
3960
+ const N = String(K);
3961
3961
  w(N), s == null || s(N);
3962
3962
  } finally {
3963
3963
  y(!1);
3964
3964
  }
3965
- }, [l, s]), Ye = ge((V) => {
3966
- if (!(V != null && V.threadId)) return;
3965
+ }, [l, s]), Ye = ge((K) => {
3966
+ if (!(K != null && K.threadId)) return;
3967
3967
  const N = {
3968
- threadId: V.threadId,
3969
- title: V.title || `Thread ${V.threadId.slice(0, 8)}`,
3970
- createdAt: V.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3971
- updatedAt: V.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3972
- messageCount: V.messageCount ?? 1
3968
+ threadId: K.threadId,
3969
+ title: K.title || `Thread ${K.threadId.slice(0, 8)}`,
3970
+ createdAt: K.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3971
+ updatedAt: K.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3972
+ messageCount: K.messageCount ?? 1
3973
3973
  };
3974
3974
  p((X) => X.some((fe) => fe.threadId === N.threadId) ? (console.debug("[ChatSessionProvider] thread_info: thread already in list", N.threadId), X) : (console.debug("[ChatSessionProvider] thread_info: adding thread to list", N.threadId), [N, ...X]));
3975
3975
  }, []), qe = ge(
3976
- (V) => {
3977
- const N = V.threadId ?? z.current;
3976
+ (K) => {
3977
+ const N = K.threadId ?? z.current;
3978
3978
  if (!N || z.current && z.current !== N)
3979
3979
  return;
3980
- const { checkpoints: X, timeline: ne } = hr(V);
3980
+ const { checkpoints: X, timeline: ne } = hr(K);
3981
3981
  if (!X.length)
3982
3982
  return;
3983
3983
  const fe = X.find((Re) => Re.messages && Re.messages.length > 0) ?? X.find((Re) => !!Re.checkpointId) ?? X[0];
3984
3984
  R((fe == null ? void 0 : fe.messages) ?? [], {
3985
3985
  checkpointId: (fe == null ? void 0 : fe.checkpointId) ?? null,
3986
3986
  checkpointNs: (fe == null ? void 0 : fe.checkpointNs) ?? null
3987
- }), G(ne), A(X), $(!!(fe != null && fe.nextCursor)), Z((fe == null ? void 0 : fe.nextCursor) ?? null), re.current = `${N}:latest`, D.current = null, W.current = null;
3987
+ }), G(ne), A(X), $(!!(fe != null && fe.nextCursor)), Z((fe == null ? void 0 : fe.nextCursor) ?? null), re.current = `${N}:latest`, D.current = null, V.current = null;
3988
3988
  },
3989
3989
  [R]
3990
- ), tt = ge((V) => {
3991
- console.log("[ChatSessionProvider] 🎯 Received thread_info:", V.threadId), Ye(V), z.current !== V.threadId && ((V.created ?? !z.current) && (D.current = V.threadId), W.current = V.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), x(V.threadId));
3990
+ ), tt = ge((K) => {
3991
+ console.log("[ChatSessionProvider] 🎯 Received thread_info:", K.threadId), Ye(K), z.current !== K.threadId && ((K.created ?? !z.current) && (D.current = K.threadId), V.current = K.threadId, console.log("[ChatSessionProvider] thread_info: marking to skip auto-load for new thread"), x(K.threadId));
3992
3992
  }, [Ye]), { startStream: Xe, stop: ie, isStreaming: xe, error: Ue, setAuthToken: We } = Yx({
3993
3993
  baseUrl: d,
3994
3994
  onThreadInfo: tt,
3995
3995
  onMessageEvent: P,
3996
3996
  onStateHistory: qe,
3997
- onUnhandledEvent: (V) => {
3998
- console.warn("[ChatSessionProvider] Unhandled event:", V.type);
3997
+ onUnhandledEvent: (K) => {
3998
+ console.warn("[ChatSessionProvider] Unhandled event:", K.type);
3999
3999
  },
4000
4000
  onAuthError: i
4001
4001
  }), st = ge(
4002
- async (V) => {
4002
+ async (K) => {
4003
4003
  try {
4004
- const N = await l.createThread(V);
4004
+ const N = await l.createThread(K);
4005
4005
  return x(N.threadId), await Oe(), N.threadId;
4006
4006
  } catch (N) {
4007
4007
  return s == null || s(String(N)), null;
@@ -4009,37 +4009,37 @@ function Xx({
4009
4009
  },
4010
4010
  [l, Oe, s]
4011
4011
  ), at = ge(
4012
- async (V) => {
4012
+ async (K) => {
4013
4013
  const N = f;
4014
- p((ne) => ne.filter((fe) => fe.threadId !== V));
4014
+ p((ne) => ne.filter((fe) => fe.threadId !== K));
4015
4015
  const X = new AbortController();
4016
- He.current.set(V, X);
4016
+ He.current.set(K, X);
4017
4017
  try {
4018
- await l.deleteThread(V), z.current === V && (x(null), R([], {})), console.log("[ChatSessionProvider] Thread deleted successfully:", V);
4018
+ await l.deleteThread(K), z.current === K && (x(null), R([], {})), console.log("[ChatSessionProvider] Thread deleted successfully:", K);
4019
4019
  } catch (ne) {
4020
- console.error("[ChatSessionProvider] Delete failed, restoring thread:", V, ne), p(N), s == null || s(`Failed to delete thread: ${String(ne)}`);
4020
+ console.error("[ChatSessionProvider] Delete failed, restoring thread:", K, ne), p(N), s == null || s(`Failed to delete thread: ${String(ne)}`);
4021
4021
  } finally {
4022
- He.current.delete(V);
4022
+ He.current.delete(K);
4023
4023
  }
4024
4024
  },
4025
4025
  [f, l, R, s]
4026
4026
  ), _t = ge(
4027
- async (V, N) => {
4027
+ async (K, N) => {
4028
4028
  try {
4029
- await l.updateThread(V, N), await Oe();
4029
+ await l.updateThread(K, N), await Oe();
4030
4030
  } catch (X) {
4031
4031
  s == null || s(String(X));
4032
4032
  }
4033
4033
  },
4034
4034
  [l, Oe, s]
4035
4035
  ), vt = ge(
4036
- async (V, N) => {
4037
- if (!V) return;
4038
- const X = `${V}:${N ?? "latest"}`, ne = Ne.current.get(X);
4036
+ async (K, N) => {
4037
+ if (!K) return;
4038
+ const X = `${K}:${N ?? "latest"}`, ne = Ne.current.get(X);
4039
4039
  if (ne)
4040
4040
  return ne;
4041
4041
  const fe = (async () => {
4042
- const Re = V;
4042
+ const Re = K;
4043
4043
  T(!0), C(null);
4044
4044
  try {
4045
4045
  const be = await l.getStateHistory({
@@ -4070,16 +4070,16 @@ function Xx({
4070
4070
  } finally {
4071
4071
  Ne.current.delete(X);
4072
4072
  }
4073
- return z.current === V && (re.current = X), fe;
4073
+ return z.current === K && (re.current = X), fe;
4074
4074
  },
4075
4075
  [l, R, s]
4076
4076
  ), gt = ge(
4077
- async (V, N) => {
4078
- J.current = V;
4077
+ async (K, N) => {
4078
+ J.current = K;
4079
4079
  try {
4080
- await vt(V, N);
4080
+ await vt(K, N);
4081
4081
  } finally {
4082
- J.current === V && (J.current = null);
4082
+ J.current === K && (J.current = null);
4083
4083
  }
4084
4084
  },
4085
4085
  [vt]
@@ -4091,7 +4091,7 @@ function Xx({
4091
4091
  D.current = null, Y.current = h;
4092
4092
  return;
4093
4093
  }
4094
- if (W.current === h) {
4094
+ if (V.current === h) {
4095
4095
  Y.current = h;
4096
4096
  return;
4097
4097
  }
@@ -4102,9 +4102,9 @@ function Xx({
4102
4102
  if (Y.current === h)
4103
4103
  return;
4104
4104
  Y.current = h;
4105
- const V = !ae.current && !!n && h === t;
4105
+ const K = !ae.current && !!n && h === t;
4106
4106
  let N;
4107
- V && n ? (N = n, ae.current = !0, console.log(
4107
+ K && n ? (N = n, ae.current = !0, console.log(
4108
4108
  "[ChatSessionProvider] Loading thread with checkpoint:",
4109
4109
  N,
4110
4110
  r ? `(ns: ${r})` : ""
@@ -4122,7 +4122,7 @@ function Xx({
4122
4122
  gt
4123
4123
  ]);
4124
4124
  const bt = ge(
4125
- async (V, N) => {
4125
+ async (K, N) => {
4126
4126
  const X = z.current;
4127
4127
  if (!X) return;
4128
4128
  const ne = X;
@@ -4130,7 +4130,7 @@ function Xx({
4130
4130
  try {
4131
4131
  const fe = await l.getStateHistory({
4132
4132
  threadId: ne,
4133
- checkpointId: V,
4133
+ checkpointId: K,
4134
4134
  checkpointNs: N ?? void 0
4135
4135
  });
4136
4136
  if (z.current !== ne) {
@@ -4138,10 +4138,10 @@ function Xx({
4138
4138
  return;
4139
4139
  }
4140
4140
  const { checkpoints: Re, timeline: be } = hr(fe), ze = Re.find(
4141
- (Me) => Me.checkpointId === V && (N ? Me.checkpointNs === N : !0)
4141
+ (Me) => Me.checkpointId === K && (N ? Me.checkpointNs === N : !0)
4142
4142
  );
4143
4143
  if (!ze) {
4144
- console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: V, checkpointNs: N });
4144
+ console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: K, checkpointNs: N });
4145
4145
  return;
4146
4146
  }
4147
4147
  G(be), A(Re), R(ze.messages ?? [], {
@@ -4156,9 +4156,9 @@ function Xx({
4156
4156
  },
4157
4157
  [l, R, s]
4158
4158
  ), Tt = ge(
4159
- (V, N) => {
4159
+ (K, N) => {
4160
4160
  R(I.messages, {
4161
- checkpointId: V ?? null,
4161
+ checkpointId: K ?? null,
4162
4162
  checkpointNs: N ?? null
4163
4163
  });
4164
4164
  },
@@ -4167,14 +4167,14 @@ function Xx({
4167
4167
  z.current && await gt(z.current);
4168
4168
  }, [gt]), jt = ge(async () => {
4169
4169
  if (!z.current || !j) return;
4170
- const V = z.current;
4170
+ const K = z.current;
4171
4171
  F(!0);
4172
4172
  try {
4173
4173
  const N = await l.getStateHistory({
4174
- threadId: V,
4174
+ threadId: K,
4175
4175
  checkpointId: j
4176
4176
  });
4177
- if (z.current !== V)
4177
+ if (z.current !== K)
4178
4178
  return;
4179
4179
  const { checkpoints: X } = hr(N);
4180
4180
  if (X.length > 0) {
@@ -4182,7 +4182,7 @@ function Xx({
4182
4182
  _((ne == null ? void 0 : ne.messages) ?? []), $(!!(ne != null && ne.nextCursor)), Z((ne == null ? void 0 : ne.nextCursor) ?? null);
4183
4183
  }
4184
4184
  } catch (N) {
4185
- z.current === V && (s == null || s(String(N)));
4185
+ z.current === K && (s == null || s(String(N)));
4186
4186
  } finally {
4187
4187
  F(!1);
4188
4188
  }
@@ -4190,11 +4190,11 @@ function Xx({
4190
4190
  R([], {}), x(null), ie(), A([]), G([]), $(!1), Z(null), T(!1), ve(!1), F(!1), C(null);
4191
4191
  try {
4192
4192
  await l.getAgent("default");
4193
- } catch (V) {
4194
- console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:", V);
4193
+ } catch (K) {
4194
+ console.warn("[ChatSessionProvider] Failed to refetch agent after clearing thread:", K);
4195
4195
  }
4196
4196
  }, [R, ie, l]), Rt = ge(
4197
- async (V, N, X) => {
4197
+ async (K, N, X) => {
4198
4198
  const ne = z.current;
4199
4199
  if (!ne)
4200
4200
  throw new Error("No active thread to handle interrupt");
@@ -4209,7 +4209,7 @@ function Xx({
4209
4209
  };
4210
4210
  Xe(Re);
4211
4211
  } catch (Re) {
4212
- throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${V}:`, Re), Re;
4212
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${K}:`, Re), Re;
4213
4213
  }
4214
4214
  },
4215
4215
  [I.lastCheckpointId, I.lastCheckpointNs, Xe]
@@ -4220,9 +4220,9 @@ function Xx({
4220
4220
  a == null || a(h);
4221
4221
  }, [h, a]);
4222
4222
  const pn = ge(
4223
- async (V, N) => {
4223
+ async (K, N) => {
4224
4224
  let X = z.current;
4225
- const ne = (V == null ? void 0 : V.text) ?? "", fe = (V == null ? void 0 : V.attachments) ?? [], Re = (ne == null ? void 0 : ne.trim()) ?? "", be = { ...(V == null ? void 0 : V.payload) ?? {} }, ze = Array.isArray(be.messages) ? be.messages : void 0;
4225
+ const ne = (K == null ? void 0 : K.text) ?? "", fe = (K == null ? void 0 : K.attachments) ?? [], Re = (ne == null ? void 0 : ne.trim()) ?? "", be = { ...(K == null ? void 0 : K.payload) ?? {} }, ze = Array.isArray(be.messages) ? be.messages : void 0;
4226
4226
  ze && delete be.messages;
4227
4227
  const Me = !!(ze && ze.length);
4228
4228
  if (!X && !Re && fe.length === 0 && !Me) return;
@@ -4238,30 +4238,30 @@ function Xx({
4238
4238
  fe
4239
4239
  ), Tn = [...Ee];
4240
4240
  Re && Tn.push({ type: "text", text: ne });
4241
- const _n = N == null ? void 0 : N.originalMessageId, Kn = !!(N != null && N.edit && _n), Pr = !Me && Tn.length > 0;
4242
- let jn = null;
4243
- Pr && (jn = {
4244
- id: Kn ? _n : `msg-${Date.now()}`,
4241
+ const Vn = N == null ? void 0 : N.originalMessageId, ur = !!(N != null && N.edit && Vn), Pr = !Me && Tn.length > 0;
4242
+ let _n = null;
4243
+ Pr && (_n = {
4244
+ id: ur ? Vn : `msg-${Date.now()}`,
4245
4245
  role: "user",
4246
4246
  content: Tn,
4247
4247
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4248
- }, Kn || L(jn));
4249
- const qn = Me ? ze : jn ? [jn] : [], k = {
4248
+ }, ur || L(_n));
4249
+ const Kn = Me ? ze : _n ? [_n] : [], k = {
4250
4250
  ...be,
4251
4251
  ...Wt.length ? { files_info: Wt } : {}
4252
4252
  };
4253
- qn.length ? k.messages = qn : "messages" in k || (k.messages = []);
4253
+ Kn.length ? k.messages = Kn : "messages" in k || (k.messages = []);
4254
4254
  const H = {
4255
4255
  threadId: X,
4256
4256
  payload: k,
4257
4257
  checkpointId: (N == null ? void 0 : N.checkpointId) ?? I.lastCheckpointId ?? void 0,
4258
4258
  checkpointNs: (N == null ? void 0 : N.checkpointNs) ?? I.lastCheckpointNs ?? void 0,
4259
4259
  edit: !!(N != null && N.edit),
4260
- originalMessageId: Kn ? _n : void 0
4260
+ timelineCheckpoints: W
4261
4261
  };
4262
4262
  Xe(H);
4263
4263
  },
4264
- [l, L, I, Xe]
4264
+ [l, L, I, Xe, W]
4265
4265
  ), Qe = De(
4266
4266
  () => ({
4267
4267
  threads: f,
@@ -4278,8 +4278,8 @@ function Xx({
4278
4278
  }),
4279
4279
  [f, h, m, g, st, at, _t, Oe]
4280
4280
  ), et = De(() => {
4281
- const V = I.assemblingId ?? null;
4282
- return V ? { assemblingMessageId: V } : null;
4281
+ const K = I.assemblingId ?? null;
4282
+ return K ? { assemblingMessageId: K } : null;
4283
4283
  }, [I.assemblingId]), pt = De(
4284
4284
  () => ({
4285
4285
  threadId: h,
@@ -4290,7 +4290,7 @@ function Xx({
4290
4290
  namespace: I.lastCheckpointNs ?? null
4291
4291
  },
4292
4292
  checkpoints: B,
4293
- timelineCheckpoints: K,
4293
+ timelineCheckpoints: W,
4294
4294
  metadata: et,
4295
4295
  isLoading: b,
4296
4296
  isHistoryLoading: E,
@@ -4311,7 +4311,7 @@ function Xx({
4311
4311
  h,
4312
4312
  I,
4313
4313
  B,
4314
- K,
4314
+ W,
4315
4315
  b,
4316
4316
  E,
4317
4317
  oe,
@@ -4479,7 +4479,7 @@ function Qx({
4479
4479
  id: Z,
4480
4480
  shouldClear: !0
4481
4481
  }, b(() => {
4482
- var B, A, K;
4482
+ var B, A, W;
4483
4483
  try {
4484
4484
  const G = l(j);
4485
4485
  G && typeof G.then == "function" ? G.then(() => {
@@ -4490,7 +4490,7 @@ function Qx({
4490
4490
  ((oe = C.current) == null ? void 0 : oe.id) === Z && (C.current = null);
4491
4491
  }) : (((B = C.current) == null ? void 0 : B.id) === Z && C.current.shouldClear && (x || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((A = C.current) == null ? void 0 : A.id) === Z && (C.current = null));
4492
4492
  } catch {
4493
- ((K = C.current) == null ? void 0 : K.id) === Z && (C.current = null);
4493
+ ((W = C.current) == null ? void 0 : W.id) === Z && (C.current = null);
4494
4494
  }
4495
4495
  });
4496
4496
  },
@@ -4934,15 +4934,15 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", $l
4934
4934
  let m = function(b) {
4935
4935
  if (h.paused || !a) return;
4936
4936
  const T = b.target;
4937
- a.contains(T) ? f.current = T : Mn(f.current, { select: !0 });
4937
+ a.contains(T) ? f.current = T : Pn(f.current, { select: !0 });
4938
4938
  }, y = function(b) {
4939
4939
  if (h.paused || !a) return;
4940
4940
  const T = b.relatedTarget;
4941
- T !== null && (a.contains(T) || Mn(f.current, { select: !0 }));
4941
+ T !== null && (a.contains(T) || Pn(f.current, { select: !0 }));
4942
4942
  }, g = function(b) {
4943
4943
  if (document.activeElement === document.body)
4944
4944
  for (const S of b)
4945
- S.removedNodes.length > 0 && Mn(a);
4945
+ S.removedNodes.length > 0 && Pn(a);
4946
4946
  };
4947
4947
  document.addEventListener("focusin", m), document.addEventListener("focusout", y);
4948
4948
  const w = new MutationObserver(g);
@@ -4956,12 +4956,12 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", $l
4956
4956
  const m = document.activeElement;
4957
4957
  if (!a.contains(m)) {
4958
4958
  const g = new CustomEvent(ii, $l);
4959
- a.addEventListener(ii, c), a.dispatchEvent(g), g.defaultPrevented || (xy(Sy(Ru(a)), { select: !0 }), document.activeElement === m && Mn(a));
4959
+ a.addEventListener(ii, c), a.dispatchEvent(g), g.defaultPrevented || (xy(Sy(Ru(a)), { select: !0 }), document.activeElement === m && Pn(a));
4960
4960
  }
4961
4961
  return () => {
4962
4962
  a.removeEventListener(ii, c), setTimeout(() => {
4963
4963
  const g = new CustomEvent(ai, $l);
4964
- a.addEventListener(ai, d), a.dispatchEvent(g), g.defaultPrevented || Mn(m ?? document.body, { select: !0 }), a.removeEventListener(ai, d), Bl.remove(h);
4964
+ a.addEventListener(ai, d), a.dispatchEvent(g), g.defaultPrevented || Pn(m ?? document.body, { select: !0 }), a.removeEventListener(ai, d), Bl.remove(h);
4965
4965
  }, 0);
4966
4966
  };
4967
4967
  }
@@ -4972,7 +4972,7 @@ var ii = "focusScope.autoFocusOnMount", ai = "focusScope.autoFocusOnUnmount", $l
4972
4972
  const y = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, g = document.activeElement;
4973
4973
  if (y && g) {
4974
4974
  const w = m.currentTarget, [b, T] = yy(w);
4975
- b && T ? !m.shiftKey && g === T ? (m.preventDefault(), n && Mn(b, { select: !0 })) : m.shiftKey && g === b && (m.preventDefault(), n && Mn(T, { select: !0 })) : g === w && m.preventDefault();
4975
+ b && T ? !m.shiftKey && g === T ? (m.preventDefault(), n && Pn(b, { select: !0 })) : m.shiftKey && g === b && (m.preventDefault(), n && Pn(T, { select: !0 })) : g === w && m.preventDefault();
4976
4976
  }
4977
4977
  },
4978
4978
  [n, r, h.paused]
@@ -4983,7 +4983,7 @@ Ts.displayName = gy;
4983
4983
  function xy(e, { select: t = !1 } = {}) {
4984
4984
  const n = document.activeElement;
4985
4985
  for (const r of e)
4986
- if (Mn(r, { select: t }), document.activeElement !== n) return;
4986
+ if (Pn(r, { select: t }), document.activeElement !== n) return;
4987
4987
  }
4988
4988
  function yy(e) {
4989
4989
  const t = Ru(e), n = Fl(t, e), r = Fl(t.reverse(), e);
@@ -5015,7 +5015,7 @@ function vy(e, { upTo: t }) {
5015
5015
  function wy(e) {
5016
5016
  return e instanceof HTMLInputElement && "select" in e;
5017
5017
  }
5018
- function Mn(e, { select: t = !1 } = {}) {
5018
+ function Pn(e, { select: t = !1 } = {}) {
5019
5019
  if (e && e.focus) {
5020
5020
  const n = document.activeElement;
5021
5021
  e.focus({ preventScroll: !0 }), e !== n && wy(e) && t && e.select();
@@ -5050,7 +5050,7 @@ function kn(e) {
5050
5050
  n((r) => r ?? String(Ty++));
5051
5051
  }, [e]), t ? `radix-${t}` : "";
5052
5052
  }
5053
- const Iy = ["top", "right", "bottom", "left"], Dn = Math.min, Vt = Math.max, Go = Math.round, bo = Math.floor, vn = (e) => ({
5053
+ const Iy = ["top", "right", "bottom", "left"], On = Math.min, Vt = Math.max, Go = Math.round, bo = Math.floor, vn = (e) => ({
5054
5054
  x: e,
5055
5055
  y: e
5056
5056
  }), ky = {
@@ -5063,7 +5063,7 @@ const Iy = ["top", "right", "bottom", "left"], Dn = Math.min, Vt = Math.max, Go
5063
5063
  end: "start"
5064
5064
  };
5065
5065
  function Mi(e, t, n) {
5066
- return Vt(e, Dn(t, n));
5066
+ return Vt(e, On(t, n));
5067
5067
  }
5068
5068
  function En(e, t) {
5069
5069
  return typeof e == "function" ? e(t) : e;
@@ -5334,7 +5334,7 @@ const Ly = (e) => ({
5334
5334
  }, h = ga(o), x = ma(h), m = await i.getDimensions(c), y = h === "y", g = y ? "top" : "left", w = y ? "bottom" : "right", b = 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));
5335
5335
  let I = C ? C[b] : 0;
5336
5336
  (!I || !await (i.isElement == null ? void 0 : i.isElement(C))) && (I = a.floating[b] || s.floating[x]);
5337
- const R = T / 2 - S / 2, _ = I / 2 - m[x] / 2 - 1, L = Dn(f[g], _), P = Dn(f[w], _), M = L, $ = I - m[x] - P, E = I / 2 - m[x] / 2 + R, F = Mi(M, E, $), j = !l.arrow && Er(o) != null && E !== F && s.reference[x] / 2 - (E < M ? L : P) - m[x] / 2 < 0, Z = j ? E < M ? E - M : E - $ : 0;
5337
+ const R = T / 2 - S / 2, _ = I / 2 - m[x] / 2 - 1, L = On(f[g], _), P = On(f[w], _), M = L, $ = I - m[x] - P, E = I / 2 - m[x] / 2 + R, F = Mi(M, E, $), j = !l.arrow && Er(o) != null && E !== F && s.reference[x] / 2 - (E < M ? L : P) - m[x] / 2 < 0, Z = j ? E < M ? E - M : E - $ : 0;
5338
5338
  return {
5339
5339
  [h]: p[h] + Z,
5340
5340
  data: {
@@ -5410,7 +5410,7 @@ const Ly = (e) => ({
5410
5410
  A === "y";
5411
5411
  }
5412
5412
  return !0;
5413
- }).map((B) => [B.placement, B.overflows.filter((A) => A > 0).reduce((A, K) => A + K, 0)]).sort((B, A) => B[1] - A[1])[0]) == null ? void 0 : $[0];
5413
+ }).map((B) => [B.placement, B.overflows.filter((A) => A > 0).reduce((A, W) => A + W, 0)]).sort((B, A) => B[1] - A[1])[0]) == null ? void 0 : $[0];
5414
5414
  Z && (j = Z);
5415
5415
  break;
5416
5416
  }
@@ -5650,7 +5650,7 @@ const zy = function(e) {
5650
5650
  } = s.floating;
5651
5651
  let y, g;
5652
5652
  f === "top" || f === "bottom" ? (y = f, g = p === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (g = f, y = p === "end" ? "top" : "bottom");
5653
- const w = m - d.top - d.bottom, b = x - d.left - d.right, T = Dn(m - d[y], w), S = Dn(x - d[g], b), C = !t.middlewareData.shift;
5653
+ const w = m - d.top - d.bottom, b = x - d.left - d.right, T = On(m - d[y], w), S = On(x - d[g], b), C = !t.middlewareData.shift;
5654
5654
  let I = T, R = S;
5655
5655
  if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = b), (r = t.middlewareData.shift) != null && r.enabled.y && (I = w), C && !p) {
5656
5656
  const L = Vt(d.left, 0), P = Vt(d.right, 0), M = Vt(d.top, 0), $ = Vt(d.bottom, 0);
@@ -5726,13 +5726,13 @@ function xa(e) {
5726
5726
  return Yy.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || Xy.some((r) => (n.willChange || "").includes(r)) || Jy.some((r) => (n.contain || "").includes(r));
5727
5727
  }
5728
5728
  function Zy(e) {
5729
- let t = Ln(e);
5729
+ let t = Dn(e);
5730
5730
  for (; wn(t) && !Tr(t); ) {
5731
5731
  if (xa(t))
5732
5732
  return t;
5733
5733
  if (ks(t))
5734
5734
  return null;
5735
- t = Ln(t);
5735
+ t = Dn(t);
5736
5736
  }
5737
5737
  return null;
5738
5738
  }
@@ -5755,7 +5755,7 @@ function Rs(e) {
5755
5755
  scrollTop: e.scrollY
5756
5756
  };
5757
5757
  }
5758
- function Ln(e) {
5758
+ function Dn(e) {
5759
5759
  if (Ar(e) === "html")
5760
5760
  return e;
5761
5761
  const t = (
@@ -5768,7 +5768,7 @@ function Ln(e) {
5768
5768
  return ql(t) ? t.host : t;
5769
5769
  }
5770
5770
  function _u(e) {
5771
- const t = Ln(e);
5771
+ const t = Dn(e);
5772
5772
  return Tr(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : wn(t) && uo(t) ? t : _u(t);
5773
5773
  }
5774
5774
  function Yr(e, t, n) {
@@ -5823,7 +5823,7 @@ function Pu(e) {
5823
5823
  function tv(e, t, n) {
5824
5824
  return t === void 0 && (t = !1), !n || t && n !== qt(e) ? !1 : t;
5825
5825
  }
5826
- function tr(e, t, n, r) {
5826
+ function er(e, t, n, r) {
5827
5827
  t === void 0 && (t = !1), n === void 0 && (n = !1);
5828
5828
  const o = e.getBoundingClientRect(), s = va(e);
5829
5829
  let i = vn(1);
@@ -5847,7 +5847,7 @@ function tr(e, t, n, r) {
5847
5847
  }
5848
5848
  function Es(e, t) {
5849
5849
  const n = Rs(e).scrollLeft;
5850
- return t ? t.left + n : tr(bn(e)).left + n;
5850
+ return t ? t.left + n : er(bn(e)).left + n;
5851
5851
  }
5852
5852
  function Mu(e, t) {
5853
5853
  const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - Es(e, n), o = n.top + t.scrollTop;
@@ -5872,7 +5872,7 @@ function nv(e) {
5872
5872
  }, c = vn(1);
5873
5873
  const d = vn(0), f = wn(r);
5874
5874
  if ((f || !f && !s) && ((Ar(r) !== "body" || uo(i)) && (l = Rs(r)), wn(r))) {
5875
- const h = tr(r);
5875
+ const h = er(r);
5876
5876
  c = xr(r), d.x = h.x + r.clientLeft, d.y = h.y + r.clientTop;
5877
5877
  }
5878
5878
  const p = i && !f && !s ? Mu(i, l) : vn(0);
@@ -5920,7 +5920,7 @@ function sv(e, t) {
5920
5920
  }
5921
5921
  const iv = /* @__PURE__ */ new Set(["absolute", "fixed"]);
5922
5922
  function av(e, t) {
5923
- const n = tr(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = wn(e) ? xr(e) : vn(1), i = e.clientWidth * s.x, a = e.clientHeight * s.y, l = o * s.x, c = r * s.y;
5923
+ const n = er(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = wn(e) ? xr(e) : vn(1), i = e.clientWidth * s.x, a = e.clientHeight * s.y, l = o * s.x, c = r * s.y;
5924
5924
  return {
5925
5925
  width: i,
5926
5926
  height: a,
@@ -5948,7 +5948,7 @@ function Yl(e, t, n) {
5948
5948
  return Xo(r);
5949
5949
  }
5950
5950
  function Ou(e, t) {
5951
- const n = Ln(e);
5951
+ const n = Dn(e);
5952
5952
  return n === t || !ln(n) || Tr(n) ? !1 : cn(n).position === "fixed" || Ou(n, t);
5953
5953
  }
5954
5954
  function lv(e, t) {
@@ -5957,10 +5957,10 @@ function lv(e, t) {
5957
5957
  return n;
5958
5958
  let r = Yr(e, [], !1).filter((a) => ln(a) && Ar(a) !== "body"), o = null;
5959
5959
  const s = cn(e).position === "fixed";
5960
- let i = s ? Ln(e) : e;
5960
+ let i = s ? Dn(e) : e;
5961
5961
  for (; ln(i) && !Tr(i); ) {
5962
5962
  const a = cn(i), l = xa(i);
5963
- !l && a.position === "fixed" && (o = null), (s ? !l && !o : !l && a.position === "static" && !!o && iv.has(o.position) || uo(i) && !l && Ou(e, i)) ? r = r.filter((d) => d !== i) : o = a, i = Ln(i);
5963
+ !l && a.position === "fixed" && (o = null), (s ? !l && !o : !l && a.position === "static" && !!o && iv.has(o.position) || uo(i) && !l && Ou(e, i)) ? r = r.filter((d) => d !== i) : o = a, i = Dn(i);
5964
5964
  }
5965
5965
  return t.set(e, r), r;
5966
5966
  }
@@ -5973,7 +5973,7 @@ function cv(e) {
5973
5973
  } = e;
5974
5974
  const i = [...n === "clippingAncestors" ? ks(t) ? [] : lv(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((c, d) => {
5975
5975
  const f = Yl(t, d, o);
5976
- return c.top = Vt(f.top, c.top), c.right = Dn(f.right, c.right), c.bottom = Dn(f.bottom, c.bottom), c.left = Vt(f.left, c.left), c;
5976
+ return c.top = Vt(f.top, c.top), c.right = On(f.right, c.right), c.bottom = On(f.bottom, c.bottom), c.left = Vt(f.left, c.left), c;
5977
5977
  }, Yl(t, a, o));
5978
5978
  return {
5979
5979
  width: l.right - l.left,
@@ -5993,7 +5993,7 @@ function uv(e) {
5993
5993
  };
5994
5994
  }
5995
5995
  function dv(e, t, n) {
5996
- const r = wn(t), o = bn(t), s = n === "fixed", i = tr(e, !0, s, t);
5996
+ const r = wn(t), o = bn(t), s = n === "fixed", i = er(e, !0, s, t);
5997
5997
  let a = {
5998
5998
  scrollLeft: 0,
5999
5999
  scrollTop: 0
@@ -6004,7 +6004,7 @@ function dv(e, t, n) {
6004
6004
  }
6005
6005
  if (r || !r && !s)
6006
6006
  if ((Ar(t) !== "body" || uo(o)) && (a = Rs(t)), r) {
6007
- const h = tr(t, !0, s, t);
6007
+ const h = er(t, !0, s, t);
6008
6008
  l.x = h.x + t.clientLeft, l.y = h.y + t.clientTop;
6009
6009
  } else o && c();
6010
6010
  s && !r && o && c();
@@ -6032,11 +6032,11 @@ function Du(e, t) {
6032
6032
  if (ks(e))
6033
6033
  return n;
6034
6034
  if (!wn(e)) {
6035
- let o = Ln(e);
6035
+ let o = Dn(e);
6036
6036
  for (; o && !Tr(o); ) {
6037
6037
  if (ln(o) && !li(o))
6038
6038
  return o;
6039
- o = Ln(o);
6039
+ o = Dn(o);
6040
6040
  }
6041
6041
  return n;
6042
6042
  }
@@ -6094,7 +6094,7 @@ function mv(e, t) {
6094
6094
  return;
6095
6095
  const x = bo(f), m = bo(o.clientWidth - (d + p)), y = bo(o.clientHeight - (f + h)), g = bo(d), b = {
6096
6096
  rootMargin: -x + "px " + -m + "px " + -y + "px " + -g + "px",
6097
- threshold: Vt(0, Dn(1, l)) || 1
6097
+ threshold: Vt(0, On(1, l)) || 1
6098
6098
  };
6099
6099
  let T = !0;
6100
6100
  function S(C) {
@@ -6144,10 +6144,10 @@ function gv(e, t, n, r) {
6144
6144
  (b = h) == null || b.observe(t);
6145
6145
  })), n();
6146
6146
  }), c && !l && h.observe(c), h.observe(t));
6147
- let x, m = l ? tr(e) : null;
6147
+ let x, m = l ? er(e) : null;
6148
6148
  l && y();
6149
6149
  function y() {
6150
- const g = tr(e);
6150
+ const g = er(e);
6151
6151
  m && !Lu(m, g) && n(), m = g, x = requestAnimationFrame(y);
6152
6152
  }
6153
6153
  return n(), () => {
@@ -6251,7 +6251,7 @@ function kv(e) {
6251
6251
  middleware: p
6252
6252
  };
6253
6253
  P.current && (B.platform = P.current), Cv(C.current, I.current, B).then((A) => {
6254
- const K = {
6254
+ const W = {
6255
6255
  ...A,
6256
6256
  // The floating element's position may be recomputed while it's closed
6257
6257
  // but still mounted (such as when transitioning out). To ensure
@@ -6259,8 +6259,8 @@ function kv(e) {
6259
6259
  // setting it to `true` when `open === false` (must be specified).
6260
6260
  isPositioned: M.current !== !1
6261
6261
  };
6262
- E.current && !Jo(R.current, K) && (R.current = K, gs.flushSync(() => {
6263
- f(K);
6262
+ E.current && !Jo(R.current, W) && (R.current = W, gs.flushSync(() => {
6263
+ f(W);
6264
6264
  }));
6265
6265
  });
6266
6266
  }, [p, t, n, P, M]);
@@ -6296,17 +6296,17 @@ function kv(e) {
6296
6296
  };
6297
6297
  if (!j.floating)
6298
6298
  return B;
6299
- const A = Zl(j.floating, d.x), K = Zl(j.floating, d.y);
6299
+ const A = Zl(j.floating, d.x), W = Zl(j.floating, d.y);
6300
6300
  return a ? {
6301
6301
  ...B,
6302
- transform: "translate(" + A + "px, " + K + "px)",
6302
+ transform: "translate(" + A + "px, " + W + "px)",
6303
6303
  ...$u(j.floating) >= 1.5 && {
6304
6304
  willChange: "transform"
6305
6305
  }
6306
6306
  } : {
6307
6307
  position: n,
6308
6308
  left: A,
6309
- top: K
6309
+ top: W
6310
6310
  };
6311
6311
  }, [n, a, j.floating, d.x, d.y]);
6312
6312
  return v.useMemo(() => ({
@@ -6416,7 +6416,7 @@ var Wu = "PopperAnchor", Vu = v.forwardRef(
6416
6416
  Vu.displayName = Wu;
6417
6417
  var ba = "PopperContent", [$v, Fv] = zu(ba), Ku = v.forwardRef(
6418
6418
  (e, t) => {
6419
- var Y, D, W, J, ae, re;
6419
+ var Y, D, V, J, ae, re;
6420
6420
  const {
6421
6421
  __scopePopper: n,
6422
6422
  side: r = "bottom",
@@ -6467,11 +6467,11 @@ var ba = "PopperContent", [$v, Fv] = zu(ba), Ku = v.forwardRef(
6467
6467
  Hv({ arrowWidth: I, arrowHeight: R }),
6468
6468
  p && Pv({ strategy: "referenceHidden", ...$ })
6469
6469
  ]
6470
- }), [A, K] = Yu(j), G = At(x);
6470
+ }), [A, W] = Yu(j), G = At(x);
6471
6471
  Nt(() => {
6472
6472
  Z && (G == null || G());
6473
6473
  }, [Z, G]);
6474
- const oe = (Y = B.arrow) == null ? void 0 : Y.x, ve = (D = B.arrow) == null ? void 0 : D.y, je = ((W = B.arrow) == null ? void 0 : W.centerOffset) !== 0, [q, z] = v.useState();
6474
+ const oe = (Y = B.arrow) == null ? void 0 : Y.x, ve = (D = B.arrow) == null ? void 0 : D.y, je = ((V = B.arrow) == null ? void 0 : V.centerOffset) !== 0, [q, z] = v.useState();
6475
6475
  return Nt(() => {
6476
6476
  g && z(window.getComputedStyle(g).zIndex);
6477
6477
  }, [g]), /* @__PURE__ */ u.jsx(
@@ -6511,7 +6511,7 @@ var ba = "PopperContent", [$v, Fv] = zu(ba), Ku = v.forwardRef(
6511
6511
  Ae.div,
6512
6512
  {
6513
6513
  "data-side": A,
6514
- "data-align": K,
6514
+ "data-align": W,
6515
6515
  ...m,
6516
6516
  ref: b,
6517
6517
  style: {
@@ -7360,11 +7360,11 @@ var Fi = ["Enter", " "], Ww = ["ArrowDown", "PageUp", "Home"], hd = ["ArrowUp",
7360
7360
  }, qw = {
7361
7361
  ltr: ["ArrowLeft"],
7362
7362
  rtl: ["ArrowRight"]
7363
- }, po = "Menu", [Xr, Gw, Yw] = fa(po), [ir, md] = Nn(po, [
7363
+ }, po = "Menu", [Xr, Gw, Yw] = fa(po), [sr, md] = Nn(po, [
7364
7364
  Yw,
7365
7365
  As,
7366
7366
  td
7367
- ]), Ps = As(), gd = td(), [Xw, ar] = ir(po), [Jw, ho] = ir(po), xd = (e) => {
7367
+ ]), Ps = As(), gd = td(), [Xw, ir] = sr(po), [Jw, ho] = sr(po), xd = (e) => {
7368
7368
  const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = Ps(t), [l, c] = v.useState(null), d = v.useRef(!1), f = At(s), p = Ss(o);
7369
7369
  return v.useEffect(() => {
7370
7370
  const h = () => {
@@ -7403,21 +7403,21 @@ var Zw = "MenuAnchor", Ca = v.forwardRef(
7403
7403
  }
7404
7404
  );
7405
7405
  Ca.displayName = Zw;
7406
- var Ta = "MenuPortal", [Qw, yd] = ir(Ta, {
7406
+ var Ta = "MenuPortal", [Qw, yd] = sr(Ta, {
7407
7407
  forceMount: void 0
7408
7408
  }), vd = (e) => {
7409
- const { __scopeMenu: t, forceMount: n, children: r, container: o } = e, s = ar(Ta, t);
7409
+ const { __scopeMenu: t, forceMount: n, children: r, container: o } = e, s = ir(Ta, t);
7410
7410
  return /* @__PURE__ */ u.jsx(Qw, { scope: t, forceMount: n, children: /* @__PURE__ */ u.jsx(nn, { present: n || s.open, children: /* @__PURE__ */ u.jsx(Ns, { asChild: !0, container: o, children: r }) }) });
7411
7411
  };
7412
7412
  vd.displayName = Ta;
7413
- var en = "MenuContent", [eb, Ia] = ir(en), wd = v.forwardRef(
7413
+ var en = "MenuContent", [eb, Ia] = sr(en), wd = v.forwardRef(
7414
7414
  (e, t) => {
7415
- const n = yd(en, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = ar(en, e.__scopeMenu), i = ho(en, e.__scopeMenu);
7415
+ const n = yd(en, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = ir(en, e.__scopeMenu), i = ho(en, e.__scopeMenu);
7416
7416
  return /* @__PURE__ */ u.jsx(Xr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(nn, { present: r || s.open, children: /* @__PURE__ */ u.jsx(Xr.Slot, { scope: e.__scopeMenu, children: i.modal ? /* @__PURE__ */ u.jsx(tb, { ...o, ref: t }) : /* @__PURE__ */ u.jsx(nb, { ...o, ref: t }) }) }) });
7417
7417
  }
7418
7418
  ), tb = v.forwardRef(
7419
7419
  (e, t) => {
7420
- const n = ar(en, e.__scopeMenu), r = v.useRef(null), o = Ke(t, r);
7420
+ const n = ir(en, e.__scopeMenu), r = v.useRef(null), o = Ke(t, r);
7421
7421
  return v.useEffect(() => {
7422
7422
  const s = r.current;
7423
7423
  if (s) return Sa(s);
@@ -7439,7 +7439,7 @@ var en = "MenuContent", [eb, Ia] = ir(en), wd = v.forwardRef(
7439
7439
  );
7440
7440
  }
7441
7441
  ), nb = v.forwardRef((e, t) => {
7442
- const n = ar(en, e.__scopeMenu);
7442
+ const n = ir(en, e.__scopeMenu);
7443
7443
  return /* @__PURE__ */ u.jsx(
7444
7444
  ka,
7445
7445
  {
@@ -7468,12 +7468,12 @@ var en = "MenuContent", [eb, Ia] = ir(en), wd = v.forwardRef(
7468
7468
  onDismiss: h,
7469
7469
  disableOutsideScroll: x,
7470
7470
  ...m
7471
- } = e, y = ar(en, n), g = ho(en, n), w = Ps(n), b = gd(n), T = Gw(n), [S, C] = v.useState(null), I = v.useRef(null), R = Ke(t, I, y.onContentChange), _ = v.useRef(0), L = v.useRef(""), P = v.useRef(0), M = v.useRef(null), $ = v.useRef("right"), E = v.useRef(0), F = x ? js : v.Fragment, j = x ? { as: rb, allowPinchZoom: !0 } : void 0, Z = (A) => {
7471
+ } = e, y = ir(en, n), g = ho(en, n), w = Ps(n), b = gd(n), T = Gw(n), [S, C] = v.useState(null), I = v.useRef(null), R = Ke(t, I, y.onContentChange), _ = v.useRef(0), L = v.useRef(""), P = v.useRef(0), M = v.useRef(null), $ = v.useRef("right"), E = v.useRef(0), F = x ? js : v.Fragment, j = x ? { as: rb, allowPinchZoom: !0 } : void 0, Z = (A) => {
7472
7472
  var Y, D;
7473
- const K = L.current + A, G = T().filter((W) => !W.disabled), oe = document.activeElement, ve = (Y = G.find((W) => W.ref.current === oe)) == null ? void 0 : Y.textValue, je = G.map((W) => W.textValue), q = mb(je, K, ve), z = (D = G.find((W) => W.textValue === q)) == null ? void 0 : D.ref.current;
7474
- (function W(J) {
7475
- L.current = J, window.clearTimeout(_.current), J !== "" && (_.current = window.setTimeout(() => W(""), 1e3));
7476
- })(K), z && setTimeout(() => z.focus());
7473
+ const W = L.current + A, G = T().filter((V) => !V.disabled), oe = document.activeElement, ve = (Y = G.find((V) => V.ref.current === oe)) == null ? void 0 : Y.textValue, je = G.map((V) => V.textValue), q = mb(je, W, ve), z = (D = G.find((V) => V.textValue === q)) == null ? void 0 : D.ref.current;
7474
+ (function V(J) {
7475
+ L.current = J, window.clearTimeout(_.current), J !== "" && (_.current = window.setTimeout(() => V(""), 1e3));
7476
+ })(W), z && setTimeout(() => z.focus());
7477
7477
  };
7478
7478
  v.useEffect(() => () => window.clearTimeout(_.current), []), pa();
7479
7479
  const B = v.useCallback((A) => {
@@ -7493,8 +7493,8 @@ var en = "MenuContent", [eb, Ia] = ir(en), wd = v.forwardRef(
7493
7493
  ),
7494
7494
  onItemLeave: v.useCallback(
7495
7495
  (A) => {
7496
- var K;
7497
- B(A) || ((K = I.current) == null || K.focus(), C(null));
7496
+ var W;
7497
+ B(A) || ((W = I.current) == null || W.focus(), C(null));
7498
7498
  },
7499
7499
  [B]
7500
7500
  ),
@@ -7514,8 +7514,8 @@ var en = "MenuContent", [eb, Ia] = ir(en), wd = v.forwardRef(
7514
7514
  asChild: !0,
7515
7515
  trapped: o,
7516
7516
  onMountAutoFocus: ue(s, (A) => {
7517
- var K;
7518
- A.preventDefault(), (K = I.current) == null || K.focus({ preventScroll: !0 });
7517
+ var W;
7518
+ A.preventDefault(), (W = I.current) == null || W.focus({ preventScroll: !0 });
7519
7519
  }),
7520
7520
  onUnmountAutoFocus: i,
7521
7521
  children: /* @__PURE__ */ u.jsx(
@@ -7569,8 +7569,8 @@ var en = "MenuContent", [eb, Ia] = ir(en), wd = v.forwardRef(
7569
7569
  onPointerMove: ue(
7570
7570
  e.onPointerMove,
7571
7571
  Jr((A) => {
7572
- const K = A.target, G = E.current !== A.clientX;
7573
- if (A.currentTarget.contains(K) && G) {
7572
+ const W = A.target, G = E.current !== A.clientX;
7573
+ if (A.currentTarget.contains(W) && G) {
7574
7574
  const oe = A.clientX > E.current ? "right" : "left";
7575
7575
  $.current = oe, E.current = A.clientX;
7576
7576
  }
@@ -7695,7 +7695,7 @@ var Sd = v.forwardRef(
7695
7695
  }
7696
7696
  );
7697
7697
  Cd.displayName = ib;
7698
- var Td = "MenuRadioGroup", [ab, lb] = ir(
7698
+ var Td = "MenuRadioGroup", [ab, lb] = sr(
7699
7699
  Td,
7700
7700
  { value: void 0, onValueChange: () => {
7701
7701
  } }
@@ -7730,7 +7730,7 @@ var kd = "MenuRadioItem", Rd = v.forwardRef(
7730
7730
  }
7731
7731
  );
7732
7732
  Rd.displayName = kd;
7733
- var Ea = "MenuItemIndicator", [Ed, cb] = ir(
7733
+ var Ea = "MenuItemIndicator", [Ed, cb] = sr(
7734
7734
  Ea,
7735
7735
  { checked: !1 }
7736
7736
  ), Ad = v.forwardRef(
@@ -7775,9 +7775,9 @@ var db = "MenuArrow", _d = v.forwardRef(
7775
7775
  }
7776
7776
  );
7777
7777
  _d.displayName = db;
7778
- var fb = "MenuSub", [PI, jd] = ir(fb), $r = "MenuSubTrigger", Pd = v.forwardRef(
7778
+ var fb = "MenuSub", [PI, jd] = sr(fb), $r = "MenuSubTrigger", Pd = v.forwardRef(
7779
7779
  (e, t) => {
7780
- const n = ar($r, e.__scopeMenu), r = ho($r, e.__scopeMenu), o = jd($r, e.__scopeMenu), s = Ia($r, e.__scopeMenu), i = v.useRef(null), { pointerGraceTimerRef: a, onPointerGraceIntentChange: l } = s, c = { __scopeMenu: e.__scopeMenu }, d = v.useCallback(() => {
7780
+ const n = ir($r, e.__scopeMenu), r = ho($r, e.__scopeMenu), o = jd($r, e.__scopeMenu), s = Ia($r, e.__scopeMenu), i = v.useRef(null), { pointerGraceTimerRef: a, onPointerGraceIntentChange: l } = s, c = { __scopeMenu: e.__scopeMenu }, d = v.useCallback(() => {
7781
7781
  i.current && window.clearTimeout(i.current), i.current = null;
7782
7782
  }, []);
7783
7783
  return v.useEffect(() => d, [d]), v.useEffect(() => {
@@ -7848,7 +7848,7 @@ var fb = "MenuSub", [PI, jd] = ir(fb), $r = "MenuSubTrigger", Pd = v.forwardRef(
7848
7848
  Pd.displayName = $r;
7849
7849
  var Md = "MenuSubContent", Od = v.forwardRef(
7850
7850
  (e, t) => {
7851
- const n = yd(en, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = ar(en, e.__scopeMenu), i = ho(en, e.__scopeMenu), a = jd(Md, e.__scopeMenu), l = v.useRef(null), c = Ke(t, l);
7851
+ const n = yd(en, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, s = ir(en, e.__scopeMenu), i = ho(en, e.__scopeMenu), a = jd(Md, e.__scopeMenu), l = v.useRef(null), c = Ke(t, l);
7852
7852
  return /* @__PURE__ */ u.jsx(Xr.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(nn, { present: r || s.open, children: /* @__PURE__ */ u.jsx(Xr.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u.jsx(
7853
7853
  ka,
7854
7854
  {
@@ -8441,7 +8441,7 @@ function g0(e) {
8441
8441
  let t;
8442
8442
  return typeof e == "string" ? t = e : typeof e == "object" && e !== null ? t = JSON.stringify(e) : t = String(e), m0(t), h0(t);
8443
8443
  }
8444
- const Ds = 0, zn = 1, Nr = 2, cf = 4;
8444
+ const Ds = 0, Bn = 1, Nr = 2, cf = 4;
8445
8445
  function sc(e) {
8446
8446
  return () => e;
8447
8447
  }
@@ -8477,7 +8477,7 @@ function ft(...e) {
8477
8477
  return e;
8478
8478
  }
8479
8479
  function ot(e, t) {
8480
- return e(zn, t);
8480
+ return e(Bn, t);
8481
8481
  }
8482
8482
  function Pe(e, t) {
8483
8483
  e(Ds, t);
@@ -8492,7 +8492,7 @@ function pe(e, t) {
8492
8492
  return ot(e, y0(t, Ds));
8493
8493
  }
8494
8494
  function an(e, t) {
8495
- const n = e(zn, (r) => {
8495
+ const n = e(Bn, (r) => {
8496
8496
  n(), t(r);
8497
8497
  });
8498
8498
  return n;
@@ -8534,7 +8534,7 @@ function U(e, ...t) {
8534
8534
  case Nr:
8535
8535
  _a(e);
8536
8536
  return;
8537
- case zn:
8537
+ case Bn:
8538
8538
  return ot(e, n(o));
8539
8539
  }
8540
8540
  };
@@ -8544,7 +8544,7 @@ function yn(e, t) {
8544
8544
  n(t = e(t, r));
8545
8545
  };
8546
8546
  }
8547
- function nr(e) {
8547
+ function tr(e) {
8548
8548
  return (t) => (n) => {
8549
8549
  e > 0 ? e-- : t(n);
8550
8550
  };
@@ -8582,7 +8582,7 @@ function S0(e) {
8582
8582
  const r = () => t == null ? void 0 : t();
8583
8583
  return function(o, s) {
8584
8584
  switch (o) {
8585
- case zn:
8585
+ case Bn:
8586
8586
  return s ? n === s ? void 0 : (r(), n = s, t = ot(e, s), t) : (r(), _r);
8587
8587
  case Nr:
8588
8588
  r(), n = null;
@@ -8598,7 +8598,7 @@ function ee(e) {
8598
8598
  case Ds:
8599
8599
  t = o;
8600
8600
  break;
8601
- case zn: {
8601
+ case Bn: {
8602
8602
  o(t);
8603
8603
  break;
8604
8604
  }
@@ -8623,7 +8623,7 @@ function Ve() {
8623
8623
  case Nr:
8624
8624
  e.splice(0, e.length);
8625
8625
  return;
8626
- case zn:
8626
+ case Bn:
8627
8627
  return e.push(n), () => {
8628
8628
  const r = e.indexOf(n);
8629
8629
  r > -1 && e.splice(r, 1);
@@ -8667,7 +8667,7 @@ function It(...e) {
8667
8667
  _a(t);
8668
8668
  return;
8669
8669
  }
8670
- case zn:
8670
+ case Bn:
8671
8671
  return r === o && i(n), ot(t, i);
8672
8672
  }
8673
8673
  };
@@ -8680,7 +8680,7 @@ function zi(...e) {
8680
8680
  switch (t) {
8681
8681
  case Nr:
8682
8682
  return;
8683
- case zn:
8683
+ case Bn:
8684
8684
  return v0(...e.map((r) => ot(r, n)));
8685
8685
  }
8686
8686
  };
@@ -8691,7 +8691,7 @@ const I0 = {
8691
8691
  3: "error",
8692
8692
  1: "log",
8693
8693
  2: "warn"
8694
- }, k0 = () => typeof globalThis > "u" ? window : globalThis, Hn = Ze(
8694
+ }, k0 = () => typeof globalThis > "u" ? window : globalThis, zn = Ze(
8695
8695
  () => {
8696
8696
  const e = ee(
8697
8697
  3
@@ -8715,7 +8715,7 @@ const I0 = {
8715
8715
  [],
8716
8716
  { singleton: !0 }
8717
8717
  );
8718
- function lr(e, t, n) {
8718
+ function ar(e, t, n) {
8719
8719
  return ja(e, t, n).callbackRef;
8720
8720
  }
8721
8721
  function ja(e, t, n) {
@@ -8915,8 +8915,8 @@ function Hi(e, t) {
8915
8915
  }
8916
8916
  } else return t < n ? zo(kt(e, { l: Hi(r, t) })) : zo(kt(e, { r: Hi(o, t) }));
8917
8917
  }
8918
- function Xn(e) {
8919
- return ct(e) ? [] : [...Xn(e.l), { k: e.k, v: e.v }, ...Xn(e.r)];
8918
+ function Yn(e) {
8919
+ return ct(e) ? [] : [...Yn(e.l), { k: e.k, v: e.v }, ...Yn(e.r)];
8920
8920
  }
8921
8921
  function Ui(e, t, n) {
8922
8922
  if (ct(e))
@@ -9030,7 +9030,7 @@ function N0(e, t, n, r) {
9030
9030
  const o = es(e, t, r), s = es(e, n, r, o);
9031
9031
  return e.slice(o, s + 1);
9032
9032
  }
9033
- function $n(e, t) {
9033
+ function Ln(e, t) {
9034
9034
  return Math.round(e.getBoundingClientRect()[t]);
9035
9035
  }
9036
9036
  function Fs(e) {
@@ -9123,7 +9123,7 @@ function D0(e, [t, n, r, o]) {
9123
9123
  };
9124
9124
  }
9125
9125
  function L0(e) {
9126
- return Xn(e).map(({ k: t, v: n }, r, o) => {
9126
+ return Yn(e).map(({ k: t, v: n }, r, o) => {
9127
9127
  const s = o[r + 1];
9128
9128
  return { endIndex: s ? s.k - 1 : 1 / 0, size: n, startIndex: t };
9129
9129
  });
@@ -9169,7 +9169,7 @@ const B0 = {
9169
9169
  offsetWidth: "width"
9170
9170
  }, Sn = Ze(
9171
9171
  ([{ log: e }, { recalcInProgress: t }]) => {
9172
- const n = Ve(), r = Ve(), o = Dt(r, 0), s = Ve(), i = Ve(), a = ee(0), l = ee([]), c = ee(void 0), d = ee(void 0), f = ee((S, C) => $n(S, B0[C])), p = ee(void 0), h = ee(0), x = _0(), m = Dt(
9172
+ const n = Ve(), r = Ve(), o = Dt(r, 0), s = Ve(), i = Ve(), a = ee(0), l = ee([]), c = ee(void 0), d = ee(void 0), f = ee((S, C) => Ln(S, B0[C])), p = ee(void 0), h = ee(0), x = _0(), m = Dt(
9173
9173
  U(n, $e(l, e, h), yn(D0, x), dt()),
9174
9174
  x
9175
9175
  ), y = Dt(
@@ -9290,7 +9290,7 @@ const B0 = {
9290
9290
  startIndex: E + 1
9291
9291
  }), M++, P += F + 1;
9292
9292
  }
9293
- const $ = Xn(C.sizeTree);
9293
+ const $ = Yn(C.sizeTree);
9294
9294
  return P !== S && $.shift(), $.reduce(
9295
9295
  (E, { k: F, v: j }) => {
9296
9296
  let Z = E.ranges;
@@ -9314,7 +9314,7 @@ const B0 = {
9314
9314
  }
9315
9315
  ).ranges;
9316
9316
  }
9317
- return Xn(C.sizeTree).reduce(
9317
+ return Yn(C.sizeTree).reduce(
9318
9318
  (L, { k: P, v: M }) => ({
9319
9319
  prevIndex: P + S,
9320
9320
  prevSize: M,
@@ -9356,7 +9356,7 @@ const B0 = {
9356
9356
  const $ = _[P + 1] - M - 1;
9357
9357
  P++, L += $ + 1;
9358
9358
  }
9359
- if (R = Xn(C.sizeTree).reduce(($, { k: E, v: F }) => Kt($, Math.max(0, E + S), F), R), L !== -S) {
9359
+ if (R = Yn(C.sizeTree).reduce(($, { k: E, v: F }) => Kt($, Math.max(0, E + S), F), R), L !== -S) {
9360
9360
  const $ = Qr(C.sizeTree, M);
9361
9361
  R = Kt(R, 0, $);
9362
9362
  const E = un(C.sizeTree, -S + 1)[1];
@@ -9368,7 +9368,7 @@ const B0 = {
9368
9368
  ...Vi(C.offsetTree, 0, R, I)
9369
9369
  };
9370
9370
  } else {
9371
- const R = Xn(C.sizeTree).reduce((_, { k: L, v: P }) => Kt(_, Math.max(0, L + S), P), vr());
9371
+ const R = Yn(C.sizeTree).reduce((_, { k: L, v: P }) => Kt(_, Math.max(0, L + S), P), vr());
9372
9372
  return {
9373
9373
  ...C,
9374
9374
  sizeTree: R,
@@ -9400,7 +9400,7 @@ const B0 = {
9400
9400
  unshiftWith: s
9401
9401
  };
9402
9402
  },
9403
- ft(Hn, Pa),
9403
+ ft(zn, Pa),
9404
9404
  { singleton: !0 }
9405
9405
  );
9406
9406
  function z0(e) {
@@ -9439,7 +9439,7 @@ const Sf = Ze(
9439
9439
  ), { groupCounts: s, topItemsIndexes: i };
9440
9440
  },
9441
9441
  ft(Sn, Bt)
9442
- ), Un = Ze(
9442
+ ), Hn = Ze(
9443
9443
  ([{ log: e }]) => {
9444
9444
  const t = ee(!1), n = Gt(
9445
9445
  U(
@@ -9452,7 +9452,7 @@ const Sf = Ze(
9452
9452
  r && St(e)("props updated", {}, Ut.DEBUG);
9453
9453
  }), { didMount: n, propsReady: t };
9454
9454
  },
9455
- ft(Hn),
9455
+ ft(zn),
9456
9456
  { singleton: !0 }
9457
9457
  ), H0 = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
9458
9458
  function Cf(e) {
@@ -9491,9 +9491,9 @@ const mo = Ze(
9491
9491
  $,
9492
9492
  E
9493
9493
  ]) => {
9494
- const F = Cf(T), { align: j, behavior: Z, offset: B } = F, A = I - 1, K = bf(F, S, A);
9495
- let G = to(K, S.offsetTree, M) + _;
9496
- j === "end" ? (G += $ + un(S.sizeTree, K)[1] - C + E, K === A && (G += L)) : j === "center" ? G += ($ + un(S.sizeTree, K)[1] - C + E) / 2 : G -= R, B && (G += B);
9494
+ const F = Cf(T), { align: j, behavior: Z, offset: B } = F, A = I - 1, W = bf(F, S, A);
9495
+ let G = to(W, S.offsetTree, M) + _;
9496
+ j === "end" ? (G += $ + un(S.sizeTree, W)[1] - C + E, W === A && (G += L)) : j === "center" ? G += ($ + un(S.sizeTree, W)[1] - C + E) / 2 : G -= R, B && (G += B);
9497
9497
  const oe = (ve) => {
9498
9498
  b(), ve ? (P("retrying to scroll to", { location: T }, Ut.DEBUG), Pe(h, T)) : (Pe(x, !0), P("list did not change, scroll successful", {}, Ut.DEBUG));
9499
9499
  };
@@ -9508,7 +9508,7 @@ const mo = Ze(
9508
9508
  y = an(U(t, U0(150)), oe);
9509
9509
  return g = setTimeout(() => {
9510
9510
  b();
9511
- }, 1200), Pe(l, !0), P("scrolling from index to", { behavior: Z, index: K, top: G }, Ut.DEBUG), { behavior: Z, top: G };
9511
+ }, 1200), Pe(l, !0), P("scrolling from index to", { behavior: Z, index: W, top: G }, Ut.DEBUG), { behavior: Z, top: G };
9512
9512
  }
9513
9513
  )
9514
9514
  ),
@@ -9519,7 +9519,7 @@ const mo = Ze(
9519
9519
  topListHeight: m
9520
9520
  };
9521
9521
  },
9522
- ft(Sn, Bt, Hn),
9522
+ ft(Sn, Bt, zn),
9523
9523
  { singleton: !0 }
9524
9524
  );
9525
9525
  function U0(e) {
@@ -9582,7 +9582,7 @@ const go = Ze(
9582
9582
  scrolledToInitialItem: a
9583
9583
  };
9584
9584
  },
9585
- ft(Sn, Bt, mo, Un),
9585
+ ft(Sn, Bt, mo, Hn),
9586
9586
  { singleton: !0 }
9587
9587
  );
9588
9588
  function Tf(e, t) {
@@ -9600,7 +9600,7 @@ const no = "up", zr = "down", W0 = "none", V0 = {
9600
9600
  }, K0 = 0, xo = Ze(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
9601
9601
  const i = ee(!1), a = ee(!0), l = Ve(), c = Ve(), d = ee(4), f = ee(K0), p = Dt(
9602
9602
  U(
9603
- zi(U(Ce(o), nr(1), mn(!0)), U(Ce(o), nr(1), mn(!1), ac(100))),
9603
+ zi(U(Ce(o), tr(1), mn(!0)), U(Ce(o), tr(1), mn(!1), ac(100))),
9604
9604
  dt()
9605
9605
  ),
9606
9606
  !1
@@ -9875,7 +9875,7 @@ function hc(e, t, n) {
9875
9875
  }
9876
9876
  return s;
9877
9877
  }
9878
- const cr = Ze(
9878
+ const lr = Ze(
9879
9879
  ([
9880
9880
  { data: e, firstItemIndex: t, gap: n, sizes: r, totalCount: o },
9881
9881
  s,
@@ -9935,38 +9935,38 @@ const cr = Ze(
9935
9935
  j,
9936
9936
  $
9937
9937
  );
9938
- const K = [];
9938
+ const W = [];
9939
9939
  if (M.length > 0) {
9940
9940
  const q = M[0], z = M[M.length - 1];
9941
9941
  let Y = 0;
9942
9942
  for (const D of $s(B, q, z)) {
9943
- const W = D.value, J = Math.max(D.start, q), ae = Math.min(D.end, z);
9943
+ const V = D.value, J = Math.max(D.start, q), ae = Math.min(D.end, z);
9944
9944
  for (let re = J; re <= ae; re++)
9945
- K.push({ data: F == null ? void 0 : F[re], index: re, offset: Y, size: W }), Y += W;
9945
+ W.push({ data: F == null ? void 0 : F[re], index: re, offset: Y, size: V }), Y += V;
9946
9946
  }
9947
9947
  }
9948
9948
  if (!P)
9949
- return Ho([], K, R, E, j, $);
9949
+ return Ho([], W, R, E, j, $);
9950
9950
  const G = M.length > 0 ? M[M.length - 1] + 1 : 0, oe = O0(Z, C, I, G);
9951
9951
  if (oe.length === 0)
9952
9952
  return null;
9953
9953
  const ve = R - 1, je = Ls([], (q) => {
9954
9954
  for (const z of oe) {
9955
9955
  const Y = z.value;
9956
- let D = Y.offset, W = z.start;
9956
+ let D = Y.offset, V = z.start;
9957
9957
  const J = Y.size;
9958
9958
  if (Y.offset < C) {
9959
- W += Math.floor((C - Y.offset + E) / (J + E));
9960
- const re = W - z.start;
9959
+ V += Math.floor((C - Y.offset + E) / (J + E));
9960
+ const re = V - z.start;
9961
9961
  D += re * J + re * E;
9962
9962
  }
9963
- W < G && (D += (G - W) * J, W = G);
9963
+ V < G && (D += (G - V) * J, V = G);
9964
9964
  const ae = Math.min(z.end, ve);
9965
- for (let re = W; re <= ae && !(D >= I); re++)
9965
+ for (let re = V; re <= ae && !(D >= I); re++)
9966
9966
  q.push({ data: F == null ? void 0 : F[re], index: re, offset: D, size: J }), D += J + E;
9967
9967
  }
9968
9968
  });
9969
- return Ho(je, K, R, E, j, $);
9969
+ return Ho(je, W, R, E, j, $);
9970
9970
  }
9971
9971
  ),
9972
9972
  //@ts-expect-error filter needs to be fixed
@@ -10046,7 +10046,7 @@ const cr = Ze(
10046
10046
  go,
10047
10047
  mo,
10048
10048
  xo,
10049
- Un,
10049
+ Hn,
10050
10050
  Pa
10051
10051
  ),
10052
10052
  { singleton: !0 }
@@ -10061,7 +10061,7 @@ const cr = Ze(
10061
10061
  );
10062
10062
  return pe(Ce(i), s), { totalListHeight: i, totalListHeightChanged: s };
10063
10063
  },
10064
- ft(Bt, cr),
10064
+ ft(Bt, lr),
10065
10065
  { singleton: !0 }
10066
10066
  ), G0 = Ze(
10067
10067
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
@@ -10113,7 +10113,7 @@ const cr = Ze(
10113
10113
  Te((F) => !F),
10114
10114
  // skips the initial publish of false, and the cleanup call.
10115
10115
  // but if scrollingInProgress is true, we skip the initial publish.
10116
- nr(St(i) ? 1 : 2)
10116
+ tr(St(i) ? 1 : 2)
10117
10117
  ),
10118
10118
  I
10119
10119
  ) : I && I(), E;
@@ -10125,7 +10125,7 @@ const cr = Ze(
10125
10125
  scrollIntoView: d
10126
10126
  };
10127
10127
  },
10128
- ft(Sn, Bt, mo, cr, Hn),
10128
+ ft(Sn, Bt, mo, lr, zn),
10129
10129
  { singleton: !0 }
10130
10130
  );
10131
10131
  function mc(e) {
@@ -10154,7 +10154,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10154
10154
  }
10155
10155
  ot(
10156
10156
  U(
10157
- It(U(Ce(t), nr(1)), l),
10157
+ It(U(Ce(t), tr(1)), l),
10158
10158
  $e(Ce(x), s, a, f),
10159
10159
  le(([[S, C], I, R, _, L]) => {
10160
10160
  let P = C && _, M = "auto";
@@ -10210,7 +10210,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10210
10210
  T
10211
10211
  ), ot(
10212
10212
  U(
10213
- It(U(T, nr(1)), l),
10213
+ It(U(T, tr(1)), l),
10214
10214
  $e(Ce(b), a, f, p),
10215
10215
  le(([[S, C], I, R, _, L]) => C && R && (I == null ? void 0 : I({ context: L, totalCount: S, scrollingInProgress: _ }))),
10216
10216
  Te((S) => !!S),
@@ -10230,8 +10230,8 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10230
10230
  xo,
10231
10231
  mo,
10232
10232
  go,
10233
- Un,
10234
10233
  Hn,
10234
+ zn,
10235
10235
  Bt,
10236
10236
  Rf,
10237
10237
  Ef
@@ -10247,7 +10247,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10247
10247
  ),
10248
10248
  i
10249
10249
  ), {}),
10250
- ft(Sn, go, cr, Un),
10250
+ ft(Sn, go, lr, Hn),
10251
10251
  { singleton: !0 }
10252
10252
  ), Q0 = Ze(
10253
10253
  ([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
@@ -10263,7 +10263,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10263
10263
  an(
10264
10264
  U(
10265
10265
  n,
10266
- nr(1),
10266
+ tr(1),
10267
10267
  Te((s) => s.items.length > 1)
10268
10268
  ),
10269
10269
  () => {
@@ -10277,7 +10277,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10277
10277
  initialScrollTop: r
10278
10278
  };
10279
10279
  },
10280
- ft(Un, Bt, cr),
10280
+ ft(Hn, Bt, lr),
10281
10281
  { singleton: !0 }
10282
10282
  ), Af = Ze(
10283
10283
  ([{ scrollVelocity: e }]) => {
@@ -10372,7 +10372,7 @@ const X0 = (e, t) => typeof e == "function" ? mc(e(t)) : t && mc(e), J0 = Ze(
10372
10372
  restoreStateFrom: d
10373
10373
  };
10374
10374
  },
10375
- ft(Sn, Bt, go, Un, $a)
10375
+ ft(Sn, Bt, go, Hn, $a)
10376
10376
  );
10377
10377
  function tS(e) {
10378
10378
  return { align: "start", index: 0, offset: e.scrollTop };
@@ -10387,7 +10387,7 @@ const nS = Ze(([{ topItemsIndexes: e }]) => {
10387
10387
  ),
10388
10388
  e
10389
10389
  ), { topItemCount: t };
10390
- }, ft(cr));
10390
+ }, ft(lr));
10391
10391
  function Nf(e) {
10392
10392
  let t = !1, n;
10393
10393
  return () => (t || (t = !0, n = e()), n);
@@ -10470,7 +10470,7 @@ const rS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10470
10470
  }
10471
10471
  ), { deviation: e };
10472
10472
  },
10473
- ft(Bt, xo, cr, Sn, Hn, Pa)
10473
+ ft(Bt, xo, lr, Sn, zn, Pa)
10474
10474
  ), sS = Ze(
10475
10475
  ([
10476
10476
  e,
@@ -10500,14 +10500,14 @@ const rS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10500
10500
  ft(
10501
10501
  La,
10502
10502
  Z0,
10503
- Un,
10503
+ Hn,
10504
10504
  Af,
10505
10505
  kf,
10506
10506
  Q0,
10507
10507
  G0,
10508
10508
  $a,
10509
10509
  Ef,
10510
- Hn,
10510
+ zn,
10511
10511
  Rf
10512
10512
  )
10513
10513
  ), _f = Ze(
@@ -10579,7 +10579,7 @@ const rS = Nf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10579
10579
  Bt,
10580
10580
  eS,
10581
10581
  J0,
10582
- cr,
10582
+ lr,
10583
10583
  mo,
10584
10584
  oS,
10585
10585
  nS,
@@ -10715,9 +10715,9 @@ function Df(e, t, n, r = _r, o, s) {
10715
10715
  const x = p.behavior === "smooth";
10716
10716
  let m, y, g;
10717
10717
  xi(h) ? (y = Math.max(
10718
- $n(h.document.documentElement, s ? "width" : "height"),
10718
+ Ln(h.document.documentElement, s ? "width" : "height"),
10719
10719
  s ? h.document.documentElement.scrollWidth : h.document.documentElement.scrollHeight
10720
- ), 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"]);
10720
+ ), m = s ? h.innerWidth : h.innerHeight, g = s ? window.scrollX : window.scrollY) : (y = h[s ? "scrollWidth" : "scrollHeight"], m = Ln(h, s ? "width" : "height"), g = h[s ? "scrollLeft" : "scrollTop"]);
10721
10721
  const w = y - m;
10722
10722
  if (p.top = Math.ceil(Math.max(Math.min(w, p.top), 0)), Tf(m, y) || p.top === g) {
10723
10723
  e({ scrollHeight: y, scrollTop: g, viewportHeight: m }), x && t(!0);
@@ -10878,10 +10878,10 @@ function gS(e, t) {
10878
10878
  return { item: typeof e == "string" ? void 0 : t };
10879
10879
  }
10880
10880
  const xS = /* @__PURE__ */ Q.memo(function() {
10881
- const e = ke("HeaderComponent"), t = Zt("headerHeight"), n = ke("HeaderFooterTag"), r = lr(
10881
+ const e = ke("HeaderComponent"), t = Zt("headerHeight"), n = ke("HeaderFooterTag"), r = ar(
10882
10882
  Q.useMemo(
10883
10883
  () => (s) => {
10884
- t($n(s, "height"));
10884
+ t(Ln(s, "height"));
10885
10885
  },
10886
10886
  [t]
10887
10887
  ),
@@ -10890,10 +10890,10 @@ const xS = /* @__PURE__ */ Q.memo(function() {
10890
10890
  ), o = ke("context");
10891
10891
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
10892
10892
  }), yS = /* @__PURE__ */ Q.memo(function() {
10893
- const e = ke("FooterComponent"), t = Zt("footerHeight"), n = ke("HeaderFooterTag"), r = lr(
10893
+ const e = ke("FooterComponent"), t = Zt("footerHeight"), n = ke("HeaderFooterTag"), r = ar(
10894
10894
  Q.useMemo(
10895
10895
  () => (s) => {
10896
- t($n(s, "height"));
10896
+ t(Ln(s, "height"));
10897
10897
  },
10898
10898
  [t]
10899
10899
  ),
@@ -10956,9 +10956,9 @@ function Ff({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
10956
10956
  }
10957
10957
  const vS = ({ children: e }) => {
10958
10958
  const t = Q.useContext(Pf), n = Zt("viewportHeight"), r = Zt("fixedItemHeight"), o = ke("alignToBottom"), s = ke("horizontalDirection"), i = Q.useMemo(
10959
- () => uf(n, (l) => $n(l, s ? "width" : "height")),
10959
+ () => uf(n, (l) => Ln(l, s ? "width" : "height")),
10960
10960
  [n, s]
10961
- ), a = lr(i, !0, ke("skipAnimationFrameInResizeObserver"));
10961
+ ), a = ar(i, !0, ke("skipAnimationFrameInResizeObserver"));
10962
10962
  return Q.useEffect(() => {
10963
10963
  t && (n(t.viewportHeight), r(t.itemHeight));
10964
10964
  }, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: Bs(o), children: e });
@@ -11128,26 +11128,26 @@ const _S = /* @__PURE__ */ Ze(
11128
11128
  { customScrollParent: y, useWindowScroll: g, windowScrollContainerState: w, windowScrollTo: b, windowViewportRect: T },
11129
11129
  S
11130
11130
  ]) => {
11131
- const C = ee(0), I = ee(0), R = ee(yc), _ = ee({ height: 0, width: 0 }), L = ee({ height: 0, width: 0 }), P = Ve(), M = Ve(), $ = ee(0), E = ee(null), F = ee({ column: 0, row: 0 }), j = Ve(), Z = Ve(), B = ee(!1), A = ee(0), K = ee(!0), G = ee(!1), oe = ee(!1);
11131
+ const C = ee(0), I = ee(0), R = ee(yc), _ = ee({ height: 0, width: 0 }), L = ee({ height: 0, width: 0 }), P = Ve(), M = Ve(), $ = ee(0), E = ee(null), F = ee({ column: 0, row: 0 }), j = Ve(), Z = Ve(), B = ee(!1), A = ee(0), W = ee(!0), G = ee(!1), oe = ee(!1);
11132
11132
  ot(
11133
11133
  U(
11134
11134
  x,
11135
11135
  $e(A),
11136
- Te(([D, W]) => !!W)
11136
+ Te(([D, V]) => !!V)
11137
11137
  ),
11138
11138
  () => {
11139
- Pe(K, !1);
11139
+ Pe(W, !1);
11140
11140
  }
11141
11141
  ), ot(
11142
11142
  U(
11143
- It(x, K, L, _, A, G),
11144
- Te(([D, W, J, ae, , re]) => D && !W && J.height !== 0 && ae.height !== 0 && !re)
11143
+ It(x, W, L, _, A, G),
11144
+ Te(([D, V, J, ae, , re]) => D && !V && J.height !== 0 && ae.height !== 0 && !re)
11145
11145
  ),
11146
11146
  ([, , , , D]) => {
11147
11147
  Pe(G, !0), Oa(1, () => {
11148
11148
  Pe(P, D);
11149
11149
  }), an(U(c), () => {
11150
- Pe(t, [0, 0]), Pe(K, !0);
11150
+ Pe(t, [0, 0]), Pe(W, !0);
11151
11151
  });
11152
11152
  }
11153
11153
  ), pe(
@@ -11164,7 +11164,7 @@ const _S = /* @__PURE__ */ Ze(
11164
11164
  Te(([, D]) => D != null)
11165
11165
  ),
11166
11166
  ([, D]) => {
11167
- D && (Pe(_, D.viewport), Pe(L, D.item), Pe(F, D.gap), D.scrollTop > 0 && (Pe(B, !0), an(U(c, nr(1)), (W) => {
11167
+ D && (Pe(_, D.viewport), Pe(L, D.item), Pe(F, D.gap), D.scrollTop > 0 && (Pe(B, !0), an(U(c, tr(1)), (V) => {
11168
11168
  Pe(B, !1);
11169
11169
  }), Pe(l, { top: D.scrollTop })));
11170
11170
  }
@@ -11179,12 +11179,12 @@ const _S = /* @__PURE__ */ Ze(
11179
11179
  It(
11180
11180
  Ce(_, Eo),
11181
11181
  Ce(L, Eo),
11182
- Ce(F, (D, W) => D && D.column === W.column && D.row === W.row),
11182
+ Ce(F, (D, V) => D && D.column === V.column && D.row === V.row),
11183
11183
  Ce(c)
11184
11184
  ),
11185
- le(([D, W, J, ae]) => ({
11185
+ le(([D, V, J, ae]) => ({
11186
11186
  gap: J,
11187
- item: W,
11187
+ item: V,
11188
11188
  scrollTop: ae,
11189
11189
  viewport: D
11190
11190
  }))
@@ -11201,14 +11201,14 @@ const _S = /* @__PURE__ */ Ze(
11201
11201
  Ce(E),
11202
11202
  Ce(I),
11203
11203
  Ce(B),
11204
- Ce(K),
11204
+ Ce(W),
11205
11205
  Ce(A)
11206
11206
  ),
11207
11207
  Te(([, , , , , , , D]) => !D),
11208
11208
  le(
11209
11209
  ([
11210
11210
  D,
11211
- [W, J],
11211
+ [V, J],
11212
11212
  ae,
11213
11213
  re,
11214
11214
  Ne,
@@ -11227,7 +11227,7 @@ const _S = /* @__PURE__ */ Ze(
11227
11227
  }
11228
11228
  const We = Bf(Ue, xe, tt);
11229
11229
  let st, at;
11230
- Ye ? W === 0 && J === 0 && Oe > 0 ? (st = 0, at = Oe - 1) : (st = We * rs((W + Xe) / (ie + Xe)), at = We * vc((J + Xe) / (ie + Xe)) - 1, at = vi(D - 1, Hr(at, We - 1)), st = vi(at, Hr(0, st))) : (st = 0, at = -1);
11230
+ Ye ? V === 0 && J === 0 && Oe > 0 ? (st = 0, at = Oe - 1) : (st = We * rs((V + Xe) / (ie + Xe)), at = We * vc((J + Xe) / (ie + Xe)) - 1, at = vi(D - 1, Hr(at, We - 1)), st = vi(at, Hr(0, st))) : (st = 0, at = -1);
11231
11231
  const _t = bc(st, at, He), { bottom: vt, top: gt } = Sc(Ne, ae, re, _t), bt = vc(D / We), Tt = bt * ie + (bt - 1) * Xe - vt;
11232
11232
  return { bottom: vt, itemHeight: ie, items: _t, itemWidth: xe, offsetBottom: Tt, offsetTop: gt, top: gt };
11233
11233
  }
@@ -11244,9 +11244,9 @@ const _S = /* @__PURE__ */ Ze(
11244
11244
  ), pe(
11245
11245
  U(
11246
11246
  It(_, L, R, F),
11247
- Te(([D, W, { items: J }]) => J.length > 0 && W.height !== 0 && D.height !== 0),
11248
- le(([D, W, { items: J }, ae]) => {
11249
- const { bottom: re, top: Ne } = Sc(D, ae, W, J);
11247
+ Te(([D, V, { items: J }]) => J.length > 0 && V.height !== 0 && D.height !== 0),
11248
+ le(([D, V, { items: J }, ae]) => {
11249
+ const { bottom: re, top: Ne } = Sc(D, ae, V, J);
11250
11250
  return [Ne, re];
11251
11251
  }),
11252
11252
  dt(eo)
@@ -11258,7 +11258,7 @@ const _S = /* @__PURE__ */ Ze(
11258
11258
  U(
11259
11259
  c,
11260
11260
  $e(ve),
11261
- le(([D, W]) => W || D !== 0)
11261
+ le(([D, V]) => V || D !== 0)
11262
11262
  ),
11263
11263
  ve
11264
11264
  );
@@ -11267,9 +11267,9 @@ const _S = /* @__PURE__ */ Ze(
11267
11267
  It(R, C),
11268
11268
  Te(([{ items: D }]) => D.length > 0),
11269
11269
  $e(ve),
11270
- Te(([[D, W], J]) => {
11271
- const ae = D.items[D.items.length - 1].index === W - 1;
11272
- return (J || D.bottom > 0 && D.itemHeight > 0 && D.offsetBottom === 0 && D.items.length === W) && ae;
11270
+ Te(([[D, V], J]) => {
11271
+ const ae = D.items[D.items.length - 1].index === V - 1;
11272
+ return (J || D.bottom > 0 && D.itemHeight > 0 && D.offsetBottom === 0 && D.items.length === V) && ae;
11273
11273
  }),
11274
11274
  le(([[, D]]) => D - 1),
11275
11275
  dt()
@@ -11285,7 +11285,7 @@ const _S = /* @__PURE__ */ Ze(
11285
11285
  U(
11286
11286
  Ce(R),
11287
11287
  $e(B),
11288
- Te(([{ items: D }, W]) => D.length > 0 && !W),
11288
+ Te(([{ items: D }, V]) => D.length > 0 && !V),
11289
11289
  le(([{ items: D }]) => ({
11290
11290
  endIndex: D[D.length - 1].index,
11291
11291
  startIndex: D[0].index
@@ -11298,12 +11298,12 @@ const _S = /* @__PURE__ */ Ze(
11298
11298
  U(
11299
11299
  P,
11300
11300
  $e(_, L, C, F),
11301
- le(([D, W, J, ae, re]) => {
11301
+ le(([D, V, J, ae, re]) => {
11302
11302
  const Ne = Cf(D), { align: He, behavior: Oe, offset: Ye } = Ne;
11303
11303
  let qe = Ne.index;
11304
11304
  qe === "LAST" && (qe = ae - 1), qe = Hr(0, qe, vi(ae - 1, qe));
11305
- let tt = Ki(W, re, J, qe);
11306
- return He === "end" ? tt = wc(tt - W.height + J.height) : He === "center" && (tt = wc(tt - W.height / 2 + J.height / 2)), Ye && (tt += Ye), { behavior: Oe, top: tt };
11305
+ let tt = Ki(V, re, J, qe);
11306
+ return He === "end" ? tt = wc(tt - V.height + J.height) : He === "center" && (tt = wc(tt - V.height / 2 + J.height / 2)), Ye && (tt += Ye), { behavior: Oe, top: tt };
11307
11307
  })
11308
11308
  ),
11309
11309
  l
@@ -11363,7 +11363,7 @@ const _S = /* @__PURE__ */ Ze(
11363
11363
  ...S
11364
11364
  };
11365
11365
  },
11366
- ft(La, Bt, xo, Af, Un, $a, Hn)
11366
+ ft(La, Bt, xo, Af, Hn, $a, zn)
11367
11367
  );
11368
11368
  function Bf(e, t, n) {
11369
11369
  return Hr(1, rs((e + n) / (rs(t) + n)));
@@ -11410,7 +11410,7 @@ const jS = /* @__PURE__ */ Ze(() => {
11410
11410
  ([e, t]) => ({ ...e, ...t }),
11411
11411
  ft(_S, jS)
11412
11412
  ), MS = /* @__PURE__ */ Q.memo(function() {
11413
- const e = ht("gridState"), t = ht("listClassName"), n = ht("itemClassName"), r = ht("itemContent"), o = ht("computeItemKey"), s = ht("isSeeking"), i = Qt("scrollHeight"), a = ht("ItemComponent"), l = ht("ListComponent"), c = ht("ScrollSeekPlaceholder"), d = ht("context"), f = Qt("itemDimensions"), p = Qt("gap"), h = ht("log"), x = ht("stateRestoreInProgress"), m = Qt("reportReadyState"), y = lr(
11413
+ const e = ht("gridState"), t = ht("listClassName"), n = ht("itemClassName"), r = ht("itemContent"), o = ht("computeItemKey"), s = ht("isSeeking"), i = Qt("scrollHeight"), a = ht("ItemComponent"), l = ht("ListComponent"), c = ht("ScrollSeekPlaceholder"), d = ht("context"), f = Qt("itemDimensions"), p = Qt("gap"), h = ht("log"), x = ht("stateRestoreInProgress"), m = Qt("reportReadyState"), y = ar(
11414
11414
  Q.useMemo(
11415
11415
  () => (g) => {
11416
11416
  const w = g.parentElement.parentElement.scrollHeight;
@@ -11465,10 +11465,10 @@ const jS = /* @__PURE__ */ Ze(() => {
11465
11465
  }
11466
11466
  );
11467
11467
  }), OS = Q.memo(function() {
11468
- const e = ht("HeaderComponent"), t = Qt("headerHeight"), n = ht("headerFooterTag"), r = lr(
11468
+ const e = ht("HeaderComponent"), t = Qt("headerHeight"), n = ht("headerFooterTag"), r = ar(
11469
11469
  Q.useMemo(
11470
11470
  () => (s) => {
11471
- t($n(s, "height"));
11471
+ t(Ln(s, "height"));
11472
11472
  },
11473
11473
  [t]
11474
11474
  ),
@@ -11477,10 +11477,10 @@ const jS = /* @__PURE__ */ Ze(() => {
11477
11477
  ), o = ht("context");
11478
11478
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
11479
11479
  }), DS = Q.memo(function() {
11480
- const e = ht("FooterComponent"), t = Qt("footerHeight"), n = ht("headerFooterTag"), r = lr(
11480
+ const e = ht("FooterComponent"), t = Qt("footerHeight"), n = ht("headerFooterTag"), r = ar(
11481
11481
  Q.useMemo(
11482
11482
  () => (s) => {
11483
- t($n(s, "height"));
11483
+ t(Ln(s, "height"));
11484
11484
  },
11485
11485
  [t]
11486
11486
  ),
@@ -11489,7 +11489,7 @@ const jS = /* @__PURE__ */ Ze(() => {
11489
11489
  ), o = ht("context");
11490
11490
  return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Ot(e, o) }) }) : null;
11491
11491
  }), LS = ({ children: e }) => {
11492
- const t = Q.useContext(Mf), n = Qt("itemDimensions"), r = Qt("viewportDimensions"), o = lr(
11492
+ const t = Q.useContext(Mf), n = Qt("itemDimensions"), r = Qt("viewportDimensions"), o = ar(
11493
11493
  Q.useMemo(
11494
11494
  () => (s) => {
11495
11495
  r(s.getBoundingClientRect());
@@ -11866,16 +11866,16 @@ var nC = br("DialogOverlay.RemoveScroll"), rC = v.forwardRef(
11866
11866
  ) })
11867
11867
  );
11868
11868
  }
11869
- ), rr = "DialogContent", Qf = v.forwardRef(
11869
+ ), nr = "DialogContent", Qf = v.forwardRef(
11870
11870
  (e, t) => {
11871
- const n = Xf(rr, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = fn(rr, e.__scopeDialog);
11871
+ const n = Xf(nr, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = fn(nr, e.__scopeDialog);
11872
11872
  return /* @__PURE__ */ u.jsx(nn, { present: r || s.open, children: s.modal ? /* @__PURE__ */ u.jsx(oC, { ...o, ref: t }) : /* @__PURE__ */ u.jsx(sC, { ...o, ref: t }) });
11873
11873
  }
11874
11874
  );
11875
- Qf.displayName = rr;
11875
+ Qf.displayName = nr;
11876
11876
  var oC = v.forwardRef(
11877
11877
  (e, t) => {
11878
- const n = fn(rr, e.__scopeDialog), r = v.useRef(null), o = Ke(t, n.contentRef, r);
11878
+ const n = fn(nr, e.__scopeDialog), r = v.useRef(null), o = Ke(t, n.contentRef, r);
11879
11879
  return v.useEffect(() => {
11880
11880
  const s = r.current;
11881
11881
  if (s) return Sa(s);
@@ -11903,7 +11903,7 @@ var oC = v.forwardRef(
11903
11903
  }
11904
11904
  ), sC = v.forwardRef(
11905
11905
  (e, t) => {
11906
- const n = fn(rr, e.__scopeDialog), r = v.useRef(!1), o = v.useRef(!1);
11906
+ const n = fn(nr, e.__scopeDialog), r = v.useRef(!1), o = v.useRef(!1);
11907
11907
  return /* @__PURE__ */ u.jsx(
11908
11908
  ep,
11909
11909
  {
@@ -11926,7 +11926,7 @@ var oC = v.forwardRef(
11926
11926
  }
11927
11927
  ), ep = v.forwardRef(
11928
11928
  (e, t) => {
11929
- const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = fn(rr, n), l = v.useRef(null), c = Ke(t, l);
11929
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = fn(nr, n), l = v.useRef(null), c = Ke(t, l);
11930
11930
  return pa(), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
11931
11931
  /* @__PURE__ */ u.jsx(
11932
11932
  Ts,
@@ -11990,7 +11990,7 @@ function Va(e) {
11990
11990
  return e ? "open" : "closed";
11991
11991
  }
11992
11992
  var ip = "DialogTitleWarning", [DI, ap] = ty(ip, {
11993
- contentName: rr,
11993
+ contentName: nr,
11994
11994
  titleName: Wa,
11995
11995
  docsSlug: "dialog"
11996
11996
  }), iC = ({ titleId: e }) => {
@@ -12009,7 +12009,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
12009
12009
  const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
12010
12010
  t && o && (document.getElementById(t) || console.warn(r));
12011
12011
  }, [r, e, t]), null;
12012
- }, lp = qf, cC = Yf, cp = Jf, Hs = Zf, Us = Qf, Zn = tp, Ws = rp, up = sp;
12012
+ }, lp = qf, cC = Yf, cp = Jf, Hs = Zf, Us = Qf, Jn = tp, Ws = rp, up = sp;
12013
12013
  const uC = lp, dC = cp, dp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
12014
12014
  Hs,
12015
12015
  {
@@ -12029,7 +12029,7 @@ const fp = v.forwardRef(({ className: e, children: t, ...n }, r) => {
12029
12029
  v.Children.forEach(a, (l) => {
12030
12030
  if (s || !v.isValidElement(l)) return;
12031
12031
  const c = l.type;
12032
- if (c === Zn || (c == null ? void 0 : c.displayName) === Zn.displayName || (c == null ? void 0 : c.name) === "DialogTitle") {
12032
+ if (c === Jn || (c == null ? void 0 : c.displayName) === Jn.displayName || (c == null ? void 0 : c.name) === "DialogTitle") {
12033
12033
  s = !0;
12034
12034
  return;
12035
12035
  }
@@ -12050,7 +12050,7 @@ const fp = v.forwardRef(({ className: e, children: t, ...n }, r) => {
12050
12050
  ),
12051
12051
  ...n,
12052
12052
  children: [
12053
- !o && /* @__PURE__ */ u.jsx(Zn, { className: "sr-only", children: "Dialog" }),
12053
+ !o && /* @__PURE__ */ u.jsx(Jn, { className: "sr-only", children: "Dialog" }),
12054
12054
  t,
12055
12055
  /* @__PURE__ */ u.jsxs(up, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
12056
12056
  /* @__PURE__ */ u.jsx(gr, { className: "h-4 w-4" }),
@@ -12077,7 +12077,7 @@ const pp = ({
12077
12077
  );
12078
12078
  pp.displayName = "DialogHeader";
12079
12079
  const hp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
12080
- Zn,
12080
+ Jn,
12081
12081
  {
12082
12082
  ref: n,
12083
12083
  className: te(
@@ -12087,7 +12087,7 @@ const hp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
12087
12087
  ...t
12088
12088
  }
12089
12089
  ));
12090
- hp.displayName = Zn.displayName;
12090
+ hp.displayName = Jn.displayName;
12091
12091
  const fC = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
12092
12092
  Ws,
12093
12093
  {
@@ -12320,9 +12320,9 @@ function mp() {
12320
12320
  xhtml: !1
12321
12321
  };
12322
12322
  }
12323
- let ur = mp();
12323
+ let cr = mp();
12324
12324
  function vC(e) {
12325
- ur = e;
12325
+ cr = e;
12326
12326
  }
12327
12327
  const gp = /[&<>"']/, wC = new RegExp(gp.source, "g"), xp = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, bC = new RegExp(xp.source, "g"), SC = {
12328
12328
  "&": "&amp;",
@@ -12475,7 +12475,7 @@ function PC(e, t) {
12475
12475
  }
12476
12476
  class qa {
12477
12477
  constructor(t) {
12478
- this.options = t || ur;
12478
+ this.options = t || cr;
12479
12479
  }
12480
12480
  space(t) {
12481
12481
  const n = this.rules.block.newline.exec(t);
@@ -13024,9 +13024,9 @@ function jc(e) {
13024
13024
  r = e.charCodeAt(n), Math.random() > 0.5 && (r = "x" + r.toString(16)), t += "&#" + r + ";";
13025
13025
  return t;
13026
13026
  }
13027
- class Fn {
13027
+ class $n {
13028
13028
  constructor(t) {
13029
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || ur, this.options.tokenizer = this.options.tokenizer || new qa(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
13029
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || cr, this.options.tokenizer = this.options.tokenizer || new qa(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
13030
13030
  inLink: !1,
13031
13031
  inRawBlock: !1,
13032
13032
  top: !0
@@ -13050,13 +13050,13 @@ class Fn {
13050
13050
  * Static Lex Method
13051
13051
  */
13052
13052
  static lex(t, n) {
13053
- return new Fn(n).lex(t);
13053
+ return new $n(n).lex(t);
13054
13054
  }
13055
13055
  /**
13056
13056
  * Static Lex Inline Method
13057
13057
  */
13058
13058
  static lexInline(t, n) {
13059
- return new Fn(n).inlineTokens(t);
13059
+ return new $n(n).inlineTokens(t);
13060
13060
  }
13061
13061
  /**
13062
13062
  * Preprocessing
@@ -13246,7 +13246,7 @@ class Fn {
13246
13246
  }
13247
13247
  class Ga {
13248
13248
  constructor(t) {
13249
- this.options = t || ur;
13249
+ this.options = t || cr;
13250
13250
  }
13251
13251
  code(t, n, r) {
13252
13252
  const o = (n || "").match(/\S*/)[0];
@@ -13457,21 +13457,21 @@ class wp {
13457
13457
  return this.getNextSafeSlug(r, n.dryrun);
13458
13458
  }
13459
13459
  }
13460
- class Bn {
13460
+ class Fn {
13461
13461
  constructor(t) {
13462
- this.options = t || ur, this.options.renderer = this.options.renderer || new Ga(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new vp(), this.slugger = new wp();
13462
+ this.options = t || cr, this.options.renderer = this.options.renderer || new Ga(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new vp(), this.slugger = new wp();
13463
13463
  }
13464
13464
  /**
13465
13465
  * Static Parse Method
13466
13466
  */
13467
13467
  static parse(t, n) {
13468
- return new Bn(n).parse(t);
13468
+ return new Fn(n).parse(t);
13469
13469
  }
13470
13470
  /**
13471
13471
  * Static Parse Inline Method
13472
13472
  */
13473
13473
  static parseInline(t, n) {
13474
- return new Bn(n).parseInline(t);
13474
+ return new Fn(n).parseInline(t);
13475
13475
  }
13476
13476
  /**
13477
13477
  * Parse Loop
@@ -13633,7 +13633,7 @@ class Bn {
13633
13633
  }
13634
13634
  class as {
13635
13635
  constructor(t) {
13636
- this.options = t || ur;
13636
+ this.options = t || cr;
13637
13637
  }
13638
13638
  /**
13639
13639
  * Process markdown before marked
@@ -13729,13 +13729,13 @@ function bp(e, t) {
13729
13729
  };
13730
13730
  }
13731
13731
  function he(e, t, n) {
13732
- return bp(Fn.lex, Bn.parse)(e, t, n);
13732
+ return bp($n.lex, Fn.parse)(e, t, n);
13733
13733
  }
13734
13734
  he.options = he.setOptions = function(e) {
13735
13735
  return he.defaults = { ...he.defaults, ...e }, vC(he.defaults), he;
13736
13736
  };
13737
13737
  he.getDefaults = mp;
13738
- he.defaults = ur;
13738
+ he.defaults = cr;
13739
13739
  he.use = function(...e) {
13740
13740
  const t = he.defaults.extensions || { renderers: {}, childTokens: {} };
13741
13741
  e.forEach((n) => {
@@ -13827,13 +13827,13 @@ he.walkTokens = function(e, t) {
13827
13827
  }
13828
13828
  return n;
13829
13829
  };
13830
- he.parseInline = bp(Fn.lexInline, Bn.parseInline);
13831
- he.Parser = Bn;
13832
- he.parser = Bn.parse;
13830
+ he.parseInline = bp($n.lexInline, Fn.parseInline);
13831
+ he.Parser = Fn;
13832
+ he.parser = Fn.parse;
13833
13833
  he.Renderer = Ga;
13834
13834
  he.TextRenderer = vp;
13835
- he.Lexer = Fn;
13836
- he.lexer = Fn.lex;
13835
+ he.Lexer = $n;
13836
+ he.lexer = $n.lex;
13837
13837
  he.Tokenizer = qa;
13838
13838
  he.Slugger = wp;
13839
13839
  he.Hooks = as;
@@ -13843,8 +13843,8 @@ he.setOptions;
13843
13843
  he.use;
13844
13844
  he.walkTokens;
13845
13845
  he.parseInline;
13846
- Bn.parse;
13847
- Fn.lex;
13846
+ Fn.parse;
13847
+ $n.lex;
13848
13848
  function ls({
13849
13849
  content: e,
13850
13850
  className: t = "",
@@ -14276,14 +14276,14 @@ const Ya = Qh(function({
14276
14276
  defaultCheckpointId: _ = null,
14277
14277
  messageParentCheckpointId: L = null
14278
14278
  }) {
14279
- const [P, M] = me(!1), [$, E] = me("preview"), [F, j] = me(!1), { currentThreadId: Z } = ca(), { respondToInterrupt: B } = ua(), A = l === "phone" || l === "half-screen", K = t.role, G = K === "tool", oe = De(() => "type" in t && t.type === "default_message" ? t : null, [t]), ve = !!oe, je = !(r && K !== "user"), {
14279
+ const [P, M] = me(!1), [$, E] = me("preview"), [F, j] = me(!1), { currentThreadId: Z } = ca(), { respondToInterrupt: B } = ua(), A = l === "phone" || l === "half-screen", W = t.role, G = W === "tool", oe = De(() => "type" in t && t.type === "default_message" ? t : null, [t]), ve = !!oe, je = !(r && W !== "user"), {
14280
14280
  uploadingFiles: q,
14281
14281
  handleFileClick: z,
14282
14282
  fileViewerOpen: Y,
14283
14283
  currentFileInfo: D,
14284
- closeFileViewer: W
14284
+ closeFileViewer: V
14285
14285
  } = WC({ allowFileOpen: je, currentThreadId: Z }), J = De(() => {
14286
- switch (K) {
14286
+ switch (W) {
14287
14287
  case "user":
14288
14288
  return "text-[hsl(var(--chat-bubble-user-text))]";
14289
14289
  case "assistant":
@@ -14295,7 +14295,7 @@ const Ya = Qh(function({
14295
14295
  default:
14296
14296
  return "text-[hsl(var(--chat-bubble-ai-text))]";
14297
14297
  }
14298
- }, [K]), ae = De(() => {
14298
+ }, [W]), ae = De(() => {
14299
14299
  if (oe)
14300
14300
  return "";
14301
14301
  const N = t.content;
@@ -14380,7 +14380,7 @@ const Ya = Qh(function({
14380
14380
  m == null || m(n);
14381
14381
  }, [m, n]), st = ge(() => {
14382
14382
  const X = te(A ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", J);
14383
- switch (K) {
14383
+ switch (W) {
14384
14384
  case "user":
14385
14385
  return /* @__PURE__ */ u.jsx(lm, { className: X });
14386
14386
  case "assistant":
@@ -14390,9 +14390,9 @@ const Ya = Qh(function({
14390
14390
  default:
14391
14391
  return /* @__PURE__ */ u.jsx(Js, { className: X });
14392
14392
  }
14393
- }, [A, J, K]), at = ge(() => {
14393
+ }, [A, J, W]), at = ge(() => {
14394
14394
  const N = "group relative mb-4 flex w-full";
14395
- switch (K) {
14395
+ switch (W) {
14396
14396
  case "user":
14397
14397
  return te(N, "justify-end");
14398
14398
  case "assistant":
@@ -14402,7 +14402,7 @@ const Ya = Qh(function({
14402
14402
  default:
14403
14403
  return N;
14404
14404
  }
14405
- }, [K]), _t = ge(() => {
14405
+ }, [W]), _t = ge(() => {
14406
14406
  const N = te(
14407
14407
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
14408
14408
  A && "px-3 py-2 text-sm"
@@ -14414,7 +14414,7 @@ const Ya = Qh(function({
14414
14414
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
14415
14415
  "border border-border/60 dark:border-border/40 shadow-sm"
14416
14416
  );
14417
- switch (K) {
14417
+ switch (W) {
14418
14418
  case "user":
14419
14419
  return te(
14420
14420
  N,
@@ -14441,7 +14441,7 @@ const Ya = Qh(function({
14441
14441
  "border border-border/60 dark:border-border/40"
14442
14442
  );
14443
14443
  }
14444
- }, [A, ve, K]), vt = ge(async (N) => {
14444
+ }, [A, ve, W]), vt = ge(async (N) => {
14445
14445
  if (b)
14446
14446
  return;
14447
14447
  const X = Ao(
@@ -14478,7 +14478,7 @@ const Ya = Qh(function({
14478
14478
  }, [b, S, T, B]), bt = ge(({ part: N, i: X }) => {
14479
14479
  if (N.type === "text") {
14480
14480
  const ne = N.text ?? "", fe = ne.trim(), Re = Ha(fe);
14481
- return Re && K !== "tool" ? /* @__PURE__ */ u.jsx(Sp, { data: Re }, X) : K === "user" && c && fe.length > d ? /* @__PURE__ */ u.jsx(
14481
+ return Re && W !== "tool" ? /* @__PURE__ */ u.jsx(Sp, { data: Re }, X) : W === "user" && c && fe.length > d ? /* @__PURE__ */ u.jsx(
14482
14482
  VC,
14483
14483
  {
14484
14484
  text: fe,
@@ -14545,7 +14545,7 @@ const Ya = Qh(function({
14545
14545
  q,
14546
14546
  vt,
14547
14547
  gt,
14548
- K,
14548
+ W,
14549
14549
  c,
14550
14550
  d,
14551
14551
  F,
@@ -14595,14 +14595,14 @@ const Ya = Qh(function({
14595
14595
  ]), jt = De(() => oe ? "Assistant" : qS(t), [oe, t]), nt = De(() => oe ? [] : Array.isArray(C) ? C : [], [C, oe]), Rt = De(() => {
14596
14596
  var N;
14597
14597
  return nt.length ? _ && nt.some((X) => X.id === _) ? _ : ((N = nt[0]) == null ? void 0 : N.id) ?? null : null;
14598
- }, [_, nt]), Qe = De(() => !nt.length || !I ? null : nt.some((N) => N.id === I) ? I : null, [I, nt]) ?? Rt, et = K === "user" && nt.length > 0 && typeof R == "function", pt = ge(
14598
+ }, [_, nt]), Qe = De(() => !nt.length || !I ? null : nt.some((N) => N.id === I) ? I : null, [I, nt]) ?? Rt, et = W === "user" && nt.length > 0 && typeof R == "function", pt = ge(
14599
14599
  (N, X = !1) => {
14600
14600
  if (!R) return;
14601
14601
  const ne = (N == null ? void 0 : N.id) ?? null, fe = (N == null ? void 0 : N.parentId) ?? L ?? null;
14602
14602
  R(ne, fe, X);
14603
14603
  },
14604
14604
  [L, R]
14605
- ), lt = De(() => Qe ? nt.findIndex((N) => N.id === Qe) : -1, [Qe, nt]), V = De(() => lt < 0 ? null : nt[lt] ?? null, [lt, nt]);
14605
+ ), lt = De(() => Qe ? nt.findIndex((N) => N.id === Qe) : -1, [Qe, nt]), K = De(() => lt < 0 ? null : nt[lt] ?? null, [lt, nt]);
14606
14606
  return G && !f && ie.length === 0 ? null : ve && oe ? /* @__PURE__ */ u.jsx("div", { className: te(at(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(_t(), h.content), children: [
14607
14607
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
14608
14608
  /* @__PURE__ */ u.jsx(Js, { className: te("h-4 w-4", J) }),
@@ -14656,7 +14656,7 @@ const Ya = Qh(function({
14656
14656
  )
14657
14657
  ] }),
14658
14658
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
14659
- et && V && lt >= 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
14659
+ et && K && lt >= 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
14660
14660
  /* @__PURE__ */ u.jsx(
14661
14661
  "button",
14662
14662
  {
@@ -14733,7 +14733,7 @@ const Ya = Qh(function({
14733
14733
  children: /* @__PURE__ */ u.jsx(rl, { className: te(P ? "text-success" : J, A ? "h-3 w-3" : "h-4 w-4") })
14734
14734
  }
14735
14735
  ) }),
14736
- K === "user" && x && /* @__PURE__ */ u.jsx(
14736
+ W === "user" && x && /* @__PURE__ */ u.jsx(
14737
14737
  rt,
14738
14738
  {
14739
14739
  variant: "ghost",
@@ -14744,7 +14744,7 @@ const Ya = Qh(function({
14744
14744
  children: /* @__PURE__ */ u.jsx(ol, { className: te(J, A ? "h-3 w-3" : "h-4 w-4") })
14745
14745
  }
14746
14746
  ),
14747
- K === "assistant" && m && /* @__PURE__ */ u.jsx(
14747
+ W === "assistant" && m && /* @__PURE__ */ u.jsx(
14748
14748
  rt,
14749
14749
  {
14750
14750
  variant: "ghost",
@@ -14795,7 +14795,7 @@ const Ya = Qh(function({
14795
14795
  children: /* @__PURE__ */ u.jsx(rl, { className: te(P ? "text-success" : "text-current", A ? "h-3 w-3" : "h-4 w-4") })
14796
14796
  }
14797
14797
  ),
14798
- K === "user" && x && /* @__PURE__ */ u.jsx(
14798
+ W === "user" && x && /* @__PURE__ */ u.jsx(
14799
14799
  rt,
14800
14800
  {
14801
14801
  variant: "ghost",
@@ -14805,7 +14805,7 @@ const Ya = Qh(function({
14805
14805
  children: /* @__PURE__ */ u.jsx(ol, { className: te("text-current", A ? "h-3 w-3" : "h-4 w-4") })
14806
14806
  }
14807
14807
  ),
14808
- K === "assistant" && m && /* @__PURE__ */ u.jsx(
14808
+ W === "assistant" && m && /* @__PURE__ */ u.jsx(
14809
14809
  rt,
14810
14810
  {
14811
14811
  variant: "ghost",
@@ -14823,7 +14823,7 @@ const Ya = Qh(function({
14823
14823
  yC,
14824
14824
  {
14825
14825
  isOpen: Y,
14826
- onClose: W,
14826
+ onClose: V,
14827
14827
  fileId: D.id,
14828
14828
  fileName: D.name,
14829
14829
  mimeType: D.mimeType
@@ -15102,7 +15102,7 @@ const Rp = Q.forwardRef(({
15102
15102
  messagePreviews: F,
15103
15103
  createSyntheticThinkingMessage: j = !1
15104
15104
  }, Z) => {
15105
- const B = Le(null), A = Le(null), K = Le(!1), G = Le(!1), [oe, ve] = me(!0), je = De(() => w ? e.some((ie) => "type" in ie && ie.type === "default_message" ? !1 : Array.isArray(ie == null ? void 0 : ie.content) && ie.content.some(
15105
+ const B = Le(null), A = Le(null), W = Le(!1), G = Le(!1), [oe, ve] = me(!0), je = De(() => w ? e.some((ie) => "type" in ie && ie.type === "default_message" ? !1 : Array.isArray(ie == null ? void 0 : ie.content) && ie.content.some(
15106
15106
  (xe) => xe && xe.type === "interrupt" && (xe.id ?? xe.interrupt_id) === w.id
15107
15107
  )) : !1, [w, e]), q = De(() => {
15108
15108
  if (!w || je)
@@ -15135,17 +15135,17 @@ const Rp = Q.forwardRef(({
15135
15135
  content: [],
15136
15136
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
15137
15137
  }
15138
- ] : z, [z, t, j]), D = De(() => C ? Y : Y.filter((ie) => (ie == null ? void 0 : ie.role) !== "tool"), [Y, C]), W = ge((ie) => {
15138
+ ] : z, [z, t, j]), D = De(() => C ? Y : Y.filter((ie) => (ie == null ? void 0 : ie.role) !== "tool"), [Y, C]), V = ge((ie) => {
15139
15139
  ve(ie), y && y(!ie), g && g(ie);
15140
15140
  }, [y, g]), J = De(() => {
15141
15141
  if (a)
15142
15142
  return async () => {
15143
- if (!K.current) {
15144
- K.current = !0;
15143
+ if (!W.current) {
15144
+ W.current = !0;
15145
15145
  try {
15146
15146
  await a();
15147
15147
  } finally {
15148
- K.current = !1;
15148
+ W.current = !1;
15149
15149
  }
15150
15150
  }
15151
15151
  };
@@ -15237,7 +15237,7 @@ const Rp = Q.forwardRef(({
15237
15237
  startReached: () => {
15238
15238
  J && J();
15239
15239
  },
15240
- atBottomStateChange: W,
15240
+ atBottomStateChange: V,
15241
15241
  style: { height: "100%", overscrollBehavior: "contain" },
15242
15242
  computeItemKey: (ie, xe) => Ip(xe, ie),
15243
15243
  itemContent: (ie, xe) => /* @__PURE__ */ u.jsx(
@@ -15307,7 +15307,7 @@ function Si({
15307
15307
  metadata: P,
15308
15308
  timelineCheckpoints: M,
15309
15309
  messagePreviews: $
15310
- } = ua(), { isStreaming: E, error: F, connectionState: j, submit: Z, stop: B } = Jx(), A = w ?? g ?? null, K = (R == null ? void 0 : R.id) ?? null, G = (R == null ? void 0 : R.namespace) ?? null, oe = (P == null ? void 0 : P.assemblingMessageId) ?? null, ve = L, [je, q] = me(!1);
15310
+ } = ua(), { isStreaming: E, error: F, connectionState: j, submit: Z, stop: B } = Jx(), A = w ?? g ?? null, W = (R == null ? void 0 : R.id) ?? null, G = (R == null ? void 0 : R.namespace) ?? null, oe = (P == null ? void 0 : P.assemblingMessageId) ?? null, ve = L, [je, q] = me(!1);
15311
15311
  yt(() => {
15312
15312
  ve || q(!1);
15313
15313
  }, [ve]);
@@ -15315,9 +15315,9 @@ function Si({
15315
15315
  q(!0);
15316
15316
  }, []), Y = ge(() => {
15317
15317
  q(!1);
15318
- }, []), D = !!ve || je, [W, J] = me(null), [ae, re] = me(""), [Ne, He] = me(null), [Oe, Ye] = me(null), [qe, tt] = me([]), [Xe, ie] = me(0), [xe, Ue] = me(0), [We, st] = me(!1), [at, _t] = me(null), [vt, gt] = me(null), [bt, Tt] = me(!1), [Lt, jt] = me(null), nt = Le(!1), [Rt, pn] = me(() => Pc.value), Qe = Le(Rt), et = Le(null), pt = ge((de) => {
15318
+ }, []), D = !!ve || je, [V, J] = me(null), [ae, re] = me(""), [Ne, He] = me(null), [Oe, Ye] = me(null), [qe, tt] = me([]), [Xe, ie] = me(0), [xe, Ue] = me(0), [We, st] = me(!1), [at, _t] = me(null), [vt, gt] = me(null), [bt, Tt] = me(!1), [Lt, jt] = me(null), nt = Le(!1), [Rt, pn] = me(() => Pc.value), Qe = Le(Rt), et = Le(null), pt = ge((de) => {
15319
15319
  Pc.value = de, pn(de);
15320
- }, []), [lt, V] = me(!1), N = Le(null), { checkpointMetaById: X, checkpointIndexByKey: ne, attemptMetaById: fe, userMessageIdToAttempts: Re } = p0(_), be = M ?? [], ze = Le(null), Me = Le(null), Ee = ge(() => {
15320
+ }, []), [lt, K] = me(!1), N = Le(null), { checkpointMetaById: X, checkpointIndexByKey: ne, attemptMetaById: fe, userMessageIdToAttempts: Re } = p0(_), be = M ?? [], ze = Le(null), Me = Le(null), Ee = ge(() => {
15321
15321
  ze.current && (ze.current.value = ""), Me.current && (Me.current.value = ""), ie((de) => de + 1), Ue((de) => de + 1);
15322
15322
  }, []), Wt = ge(
15323
15323
  (de) => {
@@ -15328,11 +15328,11 @@ function Si({
15328
15328
  yt(() => {
15329
15329
  Tn.current && !E && (tt([]), Ee()), Tn.current = E;
15330
15330
  }, [E, Ee]);
15331
- const [_n, Kn] = me("desktop");
15331
+ const [Vn, ur] = me("desktop");
15332
15332
  yt(() => {
15333
15333
  const de = () => {
15334
15334
  const Se = window.innerWidth;
15335
- Kn(Se < 640 ? "phone" : Se < 1024 ? "tablet" : "desktop");
15335
+ ur(Se < 640 ? "phone" : Se < 1024 ? "tablet" : "desktop");
15336
15336
  };
15337
15337
  return de(), window.addEventListener("resize", de), () => window.removeEventListener("resize", de);
15338
15338
  }, []), yt(() => {
@@ -15340,12 +15340,12 @@ function Si({
15340
15340
  }, [A]), yt(() => {
15341
15341
  Qe.current = Rt;
15342
15342
  }, [Rt]), yt(() => {
15343
- if (!W) {
15343
+ if (!V) {
15344
15344
  et.current = null;
15345
15345
  return;
15346
15346
  }
15347
15347
  et.current === null && (et.current = Qe.current), pt(ae ?? "");
15348
- }, [ae, W, pt]), yt(() => {
15348
+ }, [ae, V, pt]), yt(() => {
15349
15349
  (async () => {
15350
15350
  if (!y.baseUrl) {
15351
15351
  jt(null);
@@ -15369,7 +15369,7 @@ function Si({
15369
15369
  } catch (Se) {
15370
15370
  return (Se == null ? void 0 : Se.message) || "Invalid message";
15371
15371
  }
15372
- }, jn = async (de) => {
15372
+ }, _n = async (de) => {
15373
15373
  const Se = de.trim();
15374
15374
  if (!(!Se && qe.length === 0)) {
15375
15375
  if (Se) {
@@ -15380,7 +15380,7 @@ function Si({
15380
15380
  }
15381
15381
  }
15382
15382
  try {
15383
- const Ie = W ? (Ne == null ? void 0 : Ne.checkpointId) ?? K ?? void 0 : K ?? void 0, Ge = W ? (Ne == null ? void 0 : Ne.checkpointNs) ?? G ?? void 0 : G ?? void 0;
15383
+ const Ie = V ? (Ne == null ? void 0 : Ne.checkpointId) ?? W ?? void 0 : W ?? void 0, Ge = V ? (Ne == null ? void 0 : Ne.checkpointNs) ?? G ?? void 0 : G ?? void 0;
15384
15384
  await Z(
15385
15385
  {
15386
15386
  text: Se || "",
@@ -15389,8 +15389,8 @@ function Si({
15389
15389
  {
15390
15390
  checkpointId: Ie,
15391
15391
  checkpointNs: Ge,
15392
- edit: !!W,
15393
- originalMessageId: W ?? void 0
15392
+ edit: !!V,
15393
+ originalMessageId: V ?? void 0
15394
15394
  }
15395
15395
  ), h == null || h(Se), pt(""), Ye(null), tt([]), Ee(), J(null), re(""), He(null);
15396
15396
  } catch (Ie) {
@@ -15398,7 +15398,7 @@ function Si({
15398
15398
  Ye(Ge), m == null || m(Ge);
15399
15399
  }
15400
15400
  }
15401
- }, qn = Q.useCallback(
15401
+ }, Kn = Q.useCallback(
15402
15402
  (de, Se, Ie) => {
15403
15403
  c && (et.current = Rt, J(de), re(Se), pt(Se), Ye(null), He({
15404
15404
  checkpointId: (Ie == null ? void 0 : Ie.checkpointId) ?? null,
@@ -15410,9 +15410,9 @@ function Si({
15410
15410
  J(null), re(""), He(null), Ye(null), pt(et.current ?? Rt), et.current = null;
15411
15411
  }, [Rt, pt]), H = ge(
15412
15412
  (de, Se, Ie) => {
15413
- qn(de, Se, Ie);
15413
+ Kn(de, Se, Ie);
15414
15414
  },
15415
- [qn]
15415
+ [Kn]
15416
15416
  ), se = ge((de) => {
15417
15417
  let Se = null;
15418
15418
  for (let Yt = de - 1; Yt >= 0; Yt--)
@@ -15421,28 +15421,28 @@ function Si({
15421
15421
  break;
15422
15422
  }
15423
15423
  if (!Se) return;
15424
- const Ie = Array.isArray(Se.content) ? Se.content : [], Pn = Ie.filter((Yt) => (Yt == null ? void 0 : Yt.type) === "text").map((Yt) => Yt.text).join("") || (() => {
15424
+ const Ie = Array.isArray(Se.content) ? Se.content : [], jn = Ie.filter((Yt) => (Yt == null ? void 0 : Yt.type) === "text").map((Yt) => Yt.text).join("") || (() => {
15425
15425
  try {
15426
15426
  return JSON.stringify(Ie, null, 2);
15427
15427
  } catch {
15428
15428
  return String(Ie);
15429
15429
  }
15430
15430
  })();
15431
- Pn && Z(
15432
- { text: Pn },
15431
+ jn && Z(
15432
+ { text: jn },
15433
15433
  {
15434
- checkpointId: K ?? void 0,
15434
+ checkpointId: W ?? void 0,
15435
15435
  checkpointNs: G ?? void 0,
15436
15436
  edit: !0,
15437
15437
  originalMessageId: Se.id
15438
15438
  }
15439
15439
  );
15440
- }, [b, Z, K, G]), we = (de) => {
15440
+ }, [b, Z, W, G]), we = (de) => {
15441
15441
  const Se = Array.from(de.target.files || []);
15442
15442
  tt((Ie) => [...Ie, ...Se]), de.target.value = "";
15443
15443
  }, Je = (de) => {
15444
15444
  tt((Se) => {
15445
- const Ie = Se.filter((Ge, Pn) => de !== Pn);
15445
+ const Ie = Se.filter((Ge, jn) => de !== jn);
15446
15446
  return Ie.length === 0 && Ee(), Ie;
15447
15447
  });
15448
15448
  }, it = async (de) => {
@@ -15453,7 +15453,7 @@ function Si({
15453
15453
  await Z(
15454
15454
  { attachments: [Se] },
15455
15455
  {
15456
- checkpointId: K ?? void 0,
15456
+ checkpointId: W ?? void 0,
15457
15457
  checkpointNs: G ?? void 0
15458
15458
  }
15459
15459
  );
@@ -15468,7 +15468,7 @@ function Si({
15468
15468
  }
15469
15469
  }, Be = async (de) => {
15470
15470
  if (g) {
15471
- V(!0);
15471
+ K(!0);
15472
15472
  try {
15473
15473
  if (!de) {
15474
15474
  await I(), requestAnimationFrame(() => {
@@ -15483,7 +15483,7 @@ function Si({
15483
15483
  (Ge = N.current) == null || Ge.scrollToTop();
15484
15484
  });
15485
15485
  } finally {
15486
- V(!1);
15486
+ K(!1);
15487
15487
  }
15488
15488
  }
15489
15489
  }, Fe = ge(
@@ -15524,9 +15524,9 @@ function Si({
15524
15524
  streamingAssistantId: oe,
15525
15525
  streamingDebounceMs: typeof s == "number" ? s : o,
15526
15526
  followNewMessages: i,
15527
- layoutSize: _n,
15527
+ layoutSize: Vn,
15528
15528
  enableMessageEditing: c,
15529
- editingMessageId: W,
15529
+ editingMessageId: V,
15530
15530
  onEdit: H,
15531
15531
  onRegenerate: se,
15532
15532
  onCancelEdit: k,
@@ -15542,7 +15542,7 @@ function Si({
15542
15542
  checkpointIndexByKey: ne,
15543
15543
  attemptMetaById: fe,
15544
15544
  userMessageIdToAttempts: Re,
15545
- activeCheckpointId: K,
15545
+ activeCheckpointId: W,
15546
15546
  onSelectCheckpoint: Fe,
15547
15547
  timelineCheckpoints: be,
15548
15548
  messagePreviews: $
@@ -15565,7 +15565,7 @@ function Si({
15565
15565
  }
15566
15566
  ),
15567
15567
  /* @__PURE__ */ u.jsxs("div", { className: wt, children: [
15568
- W && /* @__PURE__ */ u.jsx("div", { className: "mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
15568
+ V && /* @__PURE__ */ u.jsx("div", { className: "mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
15569
15569
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
15570
15570
  /* @__PURE__ */ u.jsx(zc, { size: 16, className: "text-blue-600" }),
15571
15571
  /* @__PURE__ */ u.jsx("span", { className: "text-sm font-medium text-blue-800", children: "Editing message" })
@@ -15673,18 +15673,18 @@ function Si({
15673
15673
  ey,
15674
15674
  {
15675
15675
  initialValue: ae,
15676
- editingMessageId: W,
15676
+ editingMessageId: V,
15677
15677
  value: Rt,
15678
15678
  onValueChange: Wt,
15679
- placeholder: W ? "Edit your message..." : t,
15679
+ placeholder: V ? "Edit your message..." : t,
15680
15680
  isStreaming: E,
15681
15681
  disabled: D,
15682
15682
  maxLength: Bo,
15683
- onSend: jn,
15683
+ onSend: _n,
15684
15684
  onCancelEdit: k,
15685
15685
  onStop: B,
15686
15686
  allowEmptySend: qe.length > 0,
15687
- textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${W ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${Oe ? "border-red-400" : ""} ${p.textarea || ""}`
15687
+ textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${V ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${Oe ? "border-red-400" : ""} ${p.textarea || ""}`
15688
15688
  }
15689
15689
  ) })
15690
15690
  ] })
@@ -16330,15 +16330,15 @@ function Dc({
16330
16330
  } catch (z) {
16331
16331
  console.error("Failed to update title:", z);
16332
16332
  }
16333
- }, K = () => {
16333
+ }, W = () => {
16334
16334
  L(null), M("");
16335
16335
  }, G = (q, z) => {
16336
- q.key === "Enter" ? A(z) : q.key === "Escape" && K();
16336
+ q.key === "Enter" ? A(z) : q.key === "Escape" && W();
16337
16337
  }, oe = (q) => {
16338
16338
  if (!q) return "";
16339
16339
  try {
16340
- const z = new Date(q), D = (/* @__PURE__ */ new Date()).getTime() - z.getTime(), W = Math.floor(D / (1e3 * 60 * 60 * 24));
16341
- return W === 0 ? z.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : W === 1 ? "Yesterday" : W < 7 ? `${W} days ago` : z.toLocaleDateString();
16340
+ const z = new Date(q), D = (/* @__PURE__ */ new Date()).getTime() - z.getTime(), V = Math.floor(D / (1e3 * 60 * 60 * 24));
16341
+ return V === 0 ? z.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : V === 1 ? "Yesterday" : V < 7 ? `${V} days ago` : z.toLocaleDateString();
16342
16342
  } catch {
16343
16343
  return "";
16344
16344
  }
@@ -16381,7 +16381,7 @@ function Dc({
16381
16381
  /* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: _ === q.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (z) => z.stopPropagation(), children: [
16382
16382
  /* @__PURE__ */ u.jsx(cs, { value: P, onChange: (z) => M(z.target.value), onKeyDown: (z) => G(z, q.threadId), className: "h-6 text-sm", autoFocus: !0 }),
16383
16383
  /* @__PURE__ */ u.jsx(rt, { variant: "ghost", size: "sm", onClick: () => A(q.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(ta, { size: 12 }) }),
16384
- /* @__PURE__ */ u.jsx(rt, { variant: "ghost", size: "sm", onClick: K, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(gr, { size: 12 }) })
16384
+ /* @__PURE__ */ u.jsx(rt, { variant: "ghost", size: "sm", onClick: W, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(gr, { size: 12 }) })
16385
16385
  ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
16386
16386
  /* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: je(q) }),
16387
16387
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
@@ -16455,11 +16455,11 @@ function uT() {
16455
16455
  return t && (e.baseUrl = t), n && (e.apiKey = n), e;
16456
16456
  }
16457
16457
  function dT() {
16458
- const e = uT(), t = er.getAuthToken(), n = Up();
16458
+ const e = uT(), t = Qn.getAuthToken(), n = Up();
16459
16459
  return {
16460
16460
  apiBaseUrl: Vp(
16461
16461
  e.baseUrl,
16462
- er.baseUrl,
16462
+ Qn.baseUrl,
16463
16463
  n
16464
16464
  ),
16465
16465
  apiKey: t || e.apiKey || Wp() || "",
@@ -16489,13 +16489,13 @@ function pT(e) {
16489
16489
  ...e,
16490
16490
  apiBaseUrl: Rn(e.apiBaseUrl)
16491
16491
  };
16492
- localStorage.setItem(Kp, JSON.stringify(t)), t.apiKey && er.setAuthToken(t.apiKey);
16492
+ localStorage.setItem(Kp, JSON.stringify(t)), t.apiKey && Qn.setAuthToken(t.apiKey);
16493
16493
  } catch (t) {
16494
16494
  console.error("Failed to save settings:", t);
16495
16495
  }
16496
16496
  }
16497
16497
  function $I() {
16498
- const e = dT(), t = fT(), n = er.getAuthToken(), r = typeof t.apiBaseUrl == "string" ? t.apiBaseUrl : void 0;
16498
+ const e = dT(), t = fT(), n = Qn.getAuthToken(), r = typeof t.apiBaseUrl == "string" ? t.apiBaseUrl : void 0;
16499
16499
  return {
16500
16500
  ...e,
16501
16501
  ...t,
@@ -16503,14 +16503,14 @@ function $I() {
16503
16503
  apiKey: n || t.apiKey || e.apiKey,
16504
16504
  // Always use the current base URL from API client
16505
16505
  apiBaseUrl: Vp(
16506
- er.baseUrl,
16506
+ Qn.baseUrl,
16507
16507
  r,
16508
16508
  e.apiBaseUrl
16509
16509
  )
16510
16510
  };
16511
16511
  }
16512
16512
  function FI(e) {
16513
- er.updateConfig({
16513
+ Qn.updateConfig({
16514
16514
  baseUrl: e.apiBaseUrl,
16515
16515
  authToken: e.apiKey ?? void 0
16516
16516
  }), pT(e);
@@ -16566,10 +16566,10 @@ var Xp = Object.freeze({
16566
16566
  )
16567
16567
  );
16568
16568
  xT.displayName = gT;
16569
- var yT = [" ", "Enter", "ArrowUp", "ArrowDown"], vT = [" ", "Enter"], or = "Select", [qs, Gs, wT] = fa(or), [jr, BI] = Nn(or, [
16569
+ var yT = [" ", "Enter", "ArrowUp", "ArrowDown"], vT = [" ", "Enter"], rr = "Select", [qs, Gs, wT] = fa(rr), [jr, BI] = Nn(rr, [
16570
16570
  wT,
16571
16571
  As
16572
- ]), Ys = As(), [bT, Wn] = jr(or), [ST, CT] = jr(or), Jp = (e) => {
16572
+ ]), Ys = As(), [bT, Un] = jr(rr), [ST, CT] = jr(rr), Jp = (e) => {
16573
16573
  const {
16574
16574
  __scopeSelect: t,
16575
16575
  children: n,
@@ -16589,12 +16589,12 @@ var yT = [" ", "Enter", "ArrowUp", "ArrowDown"], vT = [" ", "Enter"], or = "Sele
16589
16589
  prop: r,
16590
16590
  defaultProp: o ?? !1,
16591
16591
  onChange: s,
16592
- caller: or
16592
+ caller: rr
16593
16593
  }), [_, L] = Cr({
16594
16594
  prop: i,
16595
16595
  defaultProp: a,
16596
16596
  onChange: l,
16597
- caller: or
16597
+ caller: rr
16598
16598
  }), P = v.useRef(null), M = y ? x || !!y.closest("form") : !0, [$, E] = v.useState(/* @__PURE__ */ new Set()), F = Array.from($).map((j) => j.props.value).join(";");
16599
16599
  return /* @__PURE__ */ u.jsx(Xu, { ...m, children: /* @__PURE__ */ u.jsxs(
16600
16600
  bT,
@@ -16655,10 +16655,10 @@ var yT = [" ", "Enter", "ArrowUp", "ArrowDown"], vT = [" ", "Enter"], or = "Sele
16655
16655
  }
16656
16656
  ) });
16657
16657
  };
16658
- Jp.displayName = or;
16658
+ Jp.displayName = rr;
16659
16659
  var Zp = "SelectTrigger", Qp = v.forwardRef(
16660
16660
  (e, t) => {
16661
- const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ys(n), i = Wn(Zp, n), a = i.disabled || r, l = Ke(t, i.onTriggerChange), c = Gs(n), d = v.useRef("touch"), [f, p, h] = Ch((m) => {
16661
+ const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ys(n), i = Un(Zp, n), a = i.disabled || r, l = Ke(t, i.onTriggerChange), c = Gs(n), d = v.useRef("touch"), [f, p, h] = Ch((m) => {
16662
16662
  const y = c().filter((b) => !b.disabled), g = y.find((b) => b.value === i.value), w = Th(y, m, g);
16663
16663
  w !== void 0 && i.onValueChange(w.value);
16664
16664
  }), x = (m) => {
@@ -16702,7 +16702,7 @@ var Zp = "SelectTrigger", Qp = v.forwardRef(
16702
16702
  Qp.displayName = Zp;
16703
16703
  var eh = "SelectValue", th = v.forwardRef(
16704
16704
  (e, t) => {
16705
- const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, l = Wn(eh, n), { onValueNodeHasChildrenChange: c } = l, d = s !== void 0, f = Ke(t, l.onValueNodeChange);
16705
+ const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, l = Un(eh, n), { onValueNodeHasChildrenChange: c } = l, d = s !== void 0, f = Ke(t, l.onValueNodeChange);
16706
16706
  return Nt(() => {
16707
16707
  c(d);
16708
16708
  }, [c, d]), /* @__PURE__ */ u.jsx(
@@ -16726,9 +16726,9 @@ var TT = "SelectIcon", nh = v.forwardRef(
16726
16726
  nh.displayName = TT;
16727
16727
  var IT = "SelectPortal", rh = (e) => /* @__PURE__ */ u.jsx(Ns, { asChild: !0, ...e });
16728
16728
  rh.displayName = IT;
16729
- var sr = "SelectContent", oh = v.forwardRef(
16729
+ var or = "SelectContent", oh = v.forwardRef(
16730
16730
  (e, t) => {
16731
- const n = Wn(sr, e.__scopeSelect), [r, o] = v.useState();
16731
+ const n = Un(or, e.__scopeSelect), [r, o] = v.useState();
16732
16732
  if (Nt(() => {
16733
16733
  o(new DocumentFragment());
16734
16734
  }, []), !n.open) {
@@ -16741,8 +16741,8 @@ var sr = "SelectContent", oh = v.forwardRef(
16741
16741
  return /* @__PURE__ */ u.jsx(ih, { ...e, ref: t });
16742
16742
  }
16743
16743
  );
16744
- oh.displayName = sr;
16745
- var on = 10, [sh, Vn] = jr(sr), kT = "SelectContentImpl", RT = br("SelectContent.RemoveScroll"), ih = v.forwardRef(
16744
+ oh.displayName = or;
16745
+ var on = 10, [sh, Wn] = jr(or), kT = "SelectContentImpl", RT = br("SelectContent.RemoveScroll"), ih = v.forwardRef(
16746
16746
  (e, t) => {
16747
16747
  const {
16748
16748
  __scopeSelect: n,
@@ -16764,7 +16764,7 @@ var on = 10, [sh, Vn] = jr(sr), kT = "SelectContentImpl", RT = br("SelectContent
16764
16764
  avoidCollisions: y,
16765
16765
  //
16766
16766
  ...g
16767
- } = e, w = Wn(sr, n), [b, T] = v.useState(null), [S, C] = v.useState(null), I = Ke(t, (Y) => T(Y)), [R, _] = v.useState(null), [L, P] = v.useState(
16767
+ } = e, w = Un(or, n), [b, T] = v.useState(null), [S, C] = v.useState(null), I = Ke(t, (Y) => T(Y)), [R, _] = v.useState(null), [L, P] = v.useState(
16768
16768
  null
16769
16769
  ), M = Gs(n), [$, E] = v.useState(!1), F = v.useRef(!1);
16770
16770
  v.useEffect(() => {
@@ -16772,7 +16772,7 @@ var on = 10, [sh, Vn] = jr(sr), kT = "SelectContentImpl", RT = br("SelectContent
16772
16772
  }, [b]), pa();
16773
16773
  const j = v.useCallback(
16774
16774
  (Y) => {
16775
- const [D, ...W] = M().map((re) => re.ref.current), [J] = W.slice(-1), ae = document.activeElement;
16775
+ const [D, ...V] = M().map((re) => re.ref.current), [J] = V.slice(-1), ae = document.activeElement;
16776
16776
  for (const re of Y)
16777
16777
  if (re === ae || (re == null || re.scrollIntoView({ block: "nearest" }), re === D && S && (S.scrollTop = 0), re === J && S && (S.scrollTop = S.scrollHeight), re == null || re.focus(), document.activeElement !== ae)) return;
16778
16778
  },
@@ -16794,11 +16794,11 @@ var on = 10, [sh, Vn] = jr(sr), kT = "SelectContentImpl", RT = br("SelectContent
16794
16794
  x: Math.abs(Math.round(J.pageX) - (((ae = A.current) == null ? void 0 : ae.x) ?? 0)),
16795
16795
  y: Math.abs(Math.round(J.pageY) - (((re = A.current) == null ? void 0 : re.y) ?? 0))
16796
16796
  };
16797
- }, W = (J) => {
16797
+ }, V = (J) => {
16798
16798
  Y.x <= 10 && Y.y <= 10 ? J.preventDefault() : b.contains(J.target) || B(!1), document.removeEventListener("pointermove", D), A.current = null;
16799
16799
  };
16800
- return A.current !== null && (document.addEventListener("pointermove", D), document.addEventListener("pointerup", W, { capture: !0, once: !0 })), () => {
16801
- document.removeEventListener("pointermove", D), document.removeEventListener("pointerup", W, { capture: !0 });
16800
+ return A.current !== null && (document.addEventListener("pointermove", D), document.addEventListener("pointerup", V, { capture: !0, once: !0 })), () => {
16801
+ document.removeEventListener("pointermove", D), document.removeEventListener("pointerup", V, { capture: !0 });
16802
16802
  };
16803
16803
  }
16804
16804
  }, [b, B, A]), v.useEffect(() => {
@@ -16807,18 +16807,18 @@ var on = 10, [sh, Vn] = jr(sr), kT = "SelectContentImpl", RT = br("SelectContent
16807
16807
  window.removeEventListener("blur", Y), window.removeEventListener("resize", Y);
16808
16808
  };
16809
16809
  }, [B]);
16810
- const [K, G] = Ch((Y) => {
16811
- const D = M().filter((ae) => !ae.disabled), W = D.find((ae) => ae.ref.current === document.activeElement), J = Th(D, Y, W);
16810
+ const [W, G] = Ch((Y) => {
16811
+ const D = M().filter((ae) => !ae.disabled), V = D.find((ae) => ae.ref.current === document.activeElement), J = Th(D, Y, V);
16812
16812
  J && setTimeout(() => J.ref.current.focus());
16813
16813
  }), oe = v.useCallback(
16814
- (Y, D, W) => {
16815
- const J = !F.current && !W;
16814
+ (Y, D, V) => {
16815
+ const J = !F.current && !V;
16816
16816
  (w.value !== void 0 && w.value === D || J) && (_(Y), J && (F.current = !0));
16817
16817
  },
16818
16818
  [w.value]
16819
16819
  ), ve = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), je = v.useCallback(
16820
- (Y, D, W) => {
16821
- const J = !F.current && !W;
16820
+ (Y, D, V) => {
16821
+ const J = !F.current && !V;
16822
16822
  (w.value !== void 0 && w.value === D || J) && P(Y);
16823
16823
  },
16824
16824
  [w.value]
@@ -16849,7 +16849,7 @@ var on = 10, [sh, Vn] = jr(sr), kT = "SelectContentImpl", RT = br("SelectContent
16849
16849
  selectedItemText: L,
16850
16850
  position: r,
16851
16851
  isPositioned: $,
16852
- searchRef: K,
16852
+ searchRef: W,
16853
16853
  children: /* @__PURE__ */ u.jsx(js, { as: RT, allowPinchZoom: !0, children: /* @__PURE__ */ u.jsx(
16854
16854
  Ts,
16855
16855
  {
@@ -16914,7 +16914,7 @@ var on = 10, [sh, Vn] = jr(sr), kT = "SelectContentImpl", RT = br("SelectContent
16914
16914
  );
16915
16915
  ih.displayName = kT;
16916
16916
  var ET = "SelectItemAlignedPosition", ah = v.forwardRef((e, t) => {
16917
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Wn(sr, n), i = Vn(sr, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = Ke(t, (I) => d(I)), p = Gs(n), h = v.useRef(!1), x = v.useRef(!0), { viewport: m, selectedItem: y, selectedItemText: g, focusSelectedItem: w } = i, b = v.useCallback(() => {
16917
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = Un(or, n), i = Wn(or, n), [a, l] = v.useState(null), [c, d] = v.useState(null), f = Ke(t, (I) => d(I)), p = Gs(n), h = v.useRef(!1), x = v.useRef(!0), { viewport: m, selectedItem: y, selectedItemText: g, focusSelectedItem: w } = i, b = v.useCallback(() => {
16918
16918
  if (s.trigger && s.valueNode && a && c && m && y && g) {
16919
16919
  const I = s.trigger.getBoundingClientRect(), R = c.getBoundingClientRect(), _ = s.valueNode.getBoundingClientRect(), L = g.getBoundingClientRect();
16920
16920
  if (s.dir !== "rtl") {
@@ -16935,7 +16935,7 @@ var ET = "SelectItemAlignedPosition", ah = v.forwardRef((e, t) => {
16935
16935
  ]);
16936
16936
  a.style.minWidth = He + "px", a.style.right = qe + "px";
16937
16937
  }
16938
- const P = p(), M = window.innerHeight - on * 2, $ = m.scrollHeight, E = window.getComputedStyle(c), F = parseInt(E.borderTopWidth, 10), j = parseInt(E.paddingTop, 10), Z = parseInt(E.borderBottomWidth, 10), B = parseInt(E.paddingBottom, 10), A = F + j + $ + B + Z, K = Math.min(y.offsetHeight * 5, A), G = window.getComputedStyle(m), oe = parseInt(G.paddingTop, 10), ve = parseInt(G.paddingBottom, 10), je = I.top + I.height / 2 - on, q = M - je, z = y.offsetHeight / 2, Y = y.offsetTop + z, D = F + j + Y, W = A - D;
16938
+ const P = p(), M = window.innerHeight - on * 2, $ = m.scrollHeight, E = window.getComputedStyle(c), F = parseInt(E.borderTopWidth, 10), j = parseInt(E.paddingTop, 10), Z = parseInt(E.borderBottomWidth, 10), B = parseInt(E.paddingBottom, 10), A = F + j + $ + B + Z, W = Math.min(y.offsetHeight * 5, A), G = window.getComputedStyle(m), oe = parseInt(G.paddingTop, 10), ve = parseInt(G.paddingBottom, 10), je = I.top + I.height / 2 - on, q = M - je, z = y.offsetHeight / 2, Y = y.offsetTop + z, D = F + j + Y, V = A - D;
16939
16939
  if (D <= je) {
16940
16940
  const ae = P.length > 0 && y === P[P.length - 1].ref.current;
16941
16941
  a.style.bottom = "0px";
@@ -16952,10 +16952,10 @@ var ET = "SelectItemAlignedPosition", ah = v.forwardRef((e, t) => {
16952
16952
  je,
16953
16953
  F + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
16954
16954
  (ae ? oe : 0) + z
16955
- ) + W;
16955
+ ) + V;
16956
16956
  a.style.height = Ne + "px", m.scrollTop = D - je + m.offsetTop;
16957
16957
  }
16958
- a.style.margin = `${on}px 0`, a.style.minHeight = K + "px", a.style.maxHeight = M + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
16958
+ a.style.margin = `${on}px 0`, a.style.minHeight = W + "px", a.style.maxHeight = M + "px", r == null || r(), requestAnimationFrame(() => h.current = !0);
16959
16959
  }
16960
16960
  }, [
16961
16961
  p,
@@ -17047,9 +17047,9 @@ var AT = "SelectPopperPosition", Gi = v.forwardRef((e, t) => {
17047
17047
  );
17048
17048
  });
17049
17049
  Gi.displayName = AT;
17050
- var [NT, el] = jr(sr, {}), Yi = "SelectViewport", lh = v.forwardRef(
17050
+ var [NT, el] = jr(or, {}), Yi = "SelectViewport", lh = v.forwardRef(
17051
17051
  (e, t) => {
17052
- const { __scopeSelect: n, nonce: r, ...o } = e, s = Vn(Yi, n), i = el(Yi, n), a = Ke(t, s.onViewportChange), l = v.useRef(0);
17052
+ const { __scopeSelect: n, nonce: r, ...o } = e, s = Wn(Yi, n), i = el(Yi, n), a = Ke(t, s.onViewportChange), l = v.useRef(0);
17053
17053
  return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
17054
17054
  /* @__PURE__ */ u.jsx(
17055
17055
  "style",
@@ -17122,7 +17122,7 @@ var fs = "SelectItem", [MT, fh] = jr(fs), ph = v.forwardRef(
17122
17122
  disabled: o = !1,
17123
17123
  textValue: s,
17124
17124
  ...i
17125
- } = e, a = Wn(fs, n), l = Vn(fs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [p, h] = v.useState(!1), x = Ke(
17125
+ } = e, a = Un(fs, n), l = Wn(fs, n), c = a.value === r, [d, f] = v.useState(s ?? ""), [p, h] = v.useState(!1), x = Ke(
17126
17126
  t,
17127
17127
  (w) => {
17128
17128
  var b;
@@ -17200,7 +17200,7 @@ var fs = "SelectItem", [MT, fh] = jr(fs), ph = v.forwardRef(
17200
17200
  ph.displayName = fs;
17201
17201
  var Fr = "SelectItemText", hh = v.forwardRef(
17202
17202
  (e, t) => {
17203
- const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Wn(Fr, n), a = Vn(Fr, n), l = fh(Fr, n), c = CT(Fr, n), [d, f] = v.useState(null), p = Ke(
17203
+ const { __scopeSelect: n, className: r, style: o, ...s } = e, i = Un(Fr, n), a = Wn(Fr, n), l = fh(Fr, n), c = CT(Fr, n), [d, f] = v.useState(null), p = Ke(
17204
17204
  t,
17205
17205
  (g) => f(g),
17206
17206
  l.onItemTextChange,
@@ -17227,7 +17227,7 @@ var mh = "SelectItemIndicator", gh = v.forwardRef(
17227
17227
  );
17228
17228
  gh.displayName = mh;
17229
17229
  var Xi = "SelectScrollUpButton", xh = v.forwardRef((e, t) => {
17230
- const n = Vn(Xi, e.__scopeSelect), r = el(Xi, e.__scopeSelect), [o, s] = v.useState(!1), i = Ke(t, r.onScrollButtonChange);
17230
+ const n = Wn(Xi, e.__scopeSelect), r = el(Xi, e.__scopeSelect), [o, s] = v.useState(!1), i = Ke(t, r.onScrollButtonChange);
17231
17231
  return Nt(() => {
17232
17232
  if (n.viewport && n.isPositioned) {
17233
17233
  let a = function() {
@@ -17251,7 +17251,7 @@ var Xi = "SelectScrollUpButton", xh = v.forwardRef((e, t) => {
17251
17251
  });
17252
17252
  xh.displayName = Xi;
17253
17253
  var Ji = "SelectScrollDownButton", yh = v.forwardRef((e, t) => {
17254
- const n = Vn(Ji, e.__scopeSelect), r = el(Ji, e.__scopeSelect), [o, s] = v.useState(!1), i = Ke(t, r.onScrollButtonChange);
17254
+ const n = Wn(Ji, e.__scopeSelect), r = el(Ji, e.__scopeSelect), [o, s] = v.useState(!1), i = Ke(t, r.onScrollButtonChange);
17255
17255
  return Nt(() => {
17256
17256
  if (n.viewport && n.isPositioned) {
17257
17257
  let a = function() {
@@ -17275,7 +17275,7 @@ var Ji = "SelectScrollDownButton", yh = v.forwardRef((e, t) => {
17275
17275
  });
17276
17276
  yh.displayName = Ji;
17277
17277
  var vh = v.forwardRef((e, t) => {
17278
- const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = Vn("SelectScrollButton", n), i = v.useRef(null), a = Gs(n), l = v.useCallback(() => {
17278
+ const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = Wn("SelectScrollButton", n), i = v.useRef(null), a = Gs(n), l = v.useCallback(() => {
17279
17279
  i.current !== null && (window.clearInterval(i.current), i.current = null);
17280
17280
  }, []);
17281
17281
  return v.useEffect(() => () => l(), [l]), Nt(() => {
@@ -17310,7 +17310,7 @@ var vh = v.forwardRef((e, t) => {
17310
17310
  wh.displayName = OT;
17311
17311
  var Zi = "SelectArrow", DT = v.forwardRef(
17312
17312
  (e, t) => {
17313
- const { __scopeSelect: n, ...r } = e, o = Ys(n), s = Wn(Zi, n), i = Vn(Zi, n);
17313
+ const { __scopeSelect: n, ...r } = e, o = Ys(n), s = Un(Zi, n), i = Wn(Zi, n);
17314
17314
  return s.open && i.position === "popper" ? /* @__PURE__ */ u.jsx(Qu, { ...o, ...r, ref: t }) : null;
17315
17315
  }
17316
17316
  );
@@ -17450,7 +17450,7 @@ const KT = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17450
17450
  }
17451
17451
  ));
17452
17452
  KT.displayName = Rh.displayName;
17453
- const Gn = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ u.jsxs(
17453
+ const qn = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ u.jsxs(
17454
17454
  Eh,
17455
17455
  {
17456
17456
  ref: r,
@@ -17465,7 +17465,7 @@ const Gn = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
17465
17465
  ]
17466
17466
  }
17467
17467
  ));
17468
- Gn.displayName = Eh.displayName;
17468
+ qn.displayName = Eh.displayName;
17469
17469
  const qT = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17470
17470
  _h,
17471
17471
  {
@@ -17570,14 +17570,14 @@ const Fh = ({
17570
17570
  );
17571
17571
  Fh.displayName = "SheetHeader";
17572
17572
  const Bh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17573
- Zn,
17573
+ Jn,
17574
17574
  {
17575
17575
  ref: n,
17576
17576
  className: te("text-lg font-semibold text-foreground", e),
17577
17577
  ...t
17578
17578
  }
17579
17579
  ));
17580
- Bh.displayName = Zn.displayName;
17580
+ Bh.displayName = Jn.displayName;
17581
17581
  const zh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17582
17582
  Ws,
17583
17583
  {
@@ -17704,7 +17704,7 @@ function Kh(e) {
17704
17704
  return e ? "checked" : "unchecked";
17705
17705
  }
17706
17706
  var qh = Hh, sI = Wh;
17707
- const On = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17707
+ const Mn = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17708
17708
  qh,
17709
17709
  {
17710
17710
  className: te(
@@ -17723,7 +17723,7 @@ const On = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
17723
17723
  )
17724
17724
  }
17725
17725
  ));
17726
- On.displayName = qh.displayName;
17726
+ Mn.displayName = qh.displayName;
17727
17727
  const iI = {
17728
17728
  api: {
17729
17729
  baseUrl: "http://localhost:8000/api",
@@ -17817,7 +17817,7 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17817
17817
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
17818
17818
  /* @__PURE__ */ u.jsx(Jt, { htmlFor: "enable-auth", children: "Enable Authentication" }),
17819
17819
  /* @__PURE__ */ u.jsx(
17820
- On,
17820
+ Mn,
17821
17821
  {
17822
17822
  id: "enable-auth",
17823
17823
  checked: a.api.enableAuth,
@@ -17876,9 +17876,9 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17876
17876
  children: [
17877
17877
  /* @__PURE__ */ u.jsx(Qi, { children: /* @__PURE__ */ u.jsx($c, {}) }),
17878
17878
  /* @__PURE__ */ u.jsxs(ea, { children: [
17879
- /* @__PURE__ */ u.jsx(Gn, { value: "sidebar", children: "Sidebar Layout" }),
17880
- /* @__PURE__ */ u.jsx(Gn, { value: "fullscreen", children: "Fullscreen" }),
17881
- /* @__PURE__ */ u.jsx(Gn, { value: "tabs", children: "Tabbed Interface" })
17879
+ /* @__PURE__ */ u.jsx(qn, { value: "sidebar", children: "Sidebar Layout" }),
17880
+ /* @__PURE__ */ u.jsx(qn, { value: "fullscreen", children: "Fullscreen" }),
17881
+ /* @__PURE__ */ u.jsx(qn, { value: "tabs", children: "Tabbed Interface" })
17882
17882
  ] })
17883
17883
  ]
17884
17884
  }
@@ -17897,9 +17897,9 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17897
17897
  children: [
17898
17898
  /* @__PURE__ */ u.jsx(Qi, { children: /* @__PURE__ */ u.jsx($c, {}) }),
17899
17899
  /* @__PURE__ */ u.jsxs(ea, { children: [
17900
- /* @__PURE__ */ u.jsx(Gn, { value: "light", children: "Light" }),
17901
- /* @__PURE__ */ u.jsx(Gn, { value: "dark", children: "Dark" }),
17902
- /* @__PURE__ */ u.jsx(Gn, { value: "system", children: "System" })
17900
+ /* @__PURE__ */ u.jsx(qn, { value: "light", children: "Light" }),
17901
+ /* @__PURE__ */ u.jsx(qn, { value: "dark", children: "Dark" }),
17902
+ /* @__PURE__ */ u.jsx(qn, { value: "system", children: "System" })
17903
17903
  ] })
17904
17904
  ]
17905
17905
  }
@@ -17910,7 +17910,7 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17910
17910
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
17911
17911
  /* @__PURE__ */ u.jsx(Jt, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
17912
17912
  /* @__PURE__ */ u.jsx(
17913
- On,
17913
+ Mn,
17914
17914
  {
17915
17915
  id: "show-timestamps",
17916
17916
  checked: a.ui.showTimestamps,
@@ -17924,7 +17924,7 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17924
17924
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
17925
17925
  /* @__PURE__ */ u.jsx(Jt, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
17926
17926
  /* @__PURE__ */ u.jsx(
17927
- On,
17927
+ Mn,
17928
17928
  {
17929
17929
  id: "show-agent-names",
17930
17930
  checked: a.ui.showAgentNames,
@@ -17938,7 +17938,7 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17938
17938
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
17939
17939
  /* @__PURE__ */ u.jsx(Jt, { htmlFor: "compact-messages", children: "Compact Messages" }),
17940
17940
  /* @__PURE__ */ u.jsx(
17941
- On,
17941
+ Mn,
17942
17942
  {
17943
17943
  id: "compact-messages",
17944
17944
  checked: a.ui.compactMessages,
@@ -17964,7 +17964,7 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17964
17964
  /* @__PURE__ */ u.jsx("p", { className: "text-sm text-muted-foreground", children: "Automatically save messages to threads" })
17965
17965
  ] }),
17966
17966
  /* @__PURE__ */ u.jsx(
17967
- On,
17967
+ Mn,
17968
17968
  {
17969
17969
  id: "auto-save",
17970
17970
  checked: a.behavior.autoSave,
@@ -17981,7 +17981,7 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17981
17981
  /* @__PURE__ */ u.jsx("p", { className: "text-sm text-muted-foreground", children: "Stream responses in real-time" })
17982
17982
  ] }),
17983
17983
  /* @__PURE__ */ u.jsx(
17984
- On,
17984
+ Mn,
17985
17985
  {
17986
17986
  id: "enable-streaming",
17987
17987
  checked: a.behavior.enableStreaming,
@@ -17998,7 +17998,7 @@ function HI({ settings: e, onSettingsChange: t, className: n = "" }) {
17998
17998
  /* @__PURE__ */ u.jsx("p", { className: "text-sm text-muted-foreground", children: "Show typing indicator during responses" })
17999
17999
  ] }),
18000
18000
  /* @__PURE__ */ u.jsx(
18001
- On,
18001
+ Mn,
18002
18002
  {
18003
18003
  id: "typing-indicator",
18004
18004
  checked: a.behavior.showTypingIndicator,
@@ -18114,7 +18114,7 @@ export {
18114
18114
  Dc as ThreadManager,
18115
18115
  FI as applySettings,
18116
18116
  Lx as buildMessagePreviewMap,
18117
- er as chatApiClient,
18117
+ Qn as chatApiClient,
18118
18118
  UI as default,
18119
18119
  lx as del,
18120
18120
  sn as get,