teodor-new-chat-ui 4.1.32 → 4.1.34

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
@@ -72,10 +72,10 @@ function pm() {
72
72
  Se.unshift("Warning: " + N), Function.prototype.apply.call(console[b], console, Se);
73
73
  }
74
74
  }
75
- var R = !1, C = !1, T = !1, k = !1, I = !1, A;
75
+ var R = !1, C = !1, T = !1, E = !1, I = !1, A;
76
76
  A = Symbol.for("react.module.reference");
77
77
  function _(b) {
78
- return !!(typeof b == "string" || typeof b == "function" || b === r || b === s || I || b === o || b === u || b === d || k || b === p || R || C || T || typeof b == "object" && b !== null && (b.$$typeof === h || b.$$typeof === f || b.$$typeof === i || b.$$typeof === a || b.$$typeof === l || // This needs to include all possible module reference object
78
+ return !!(typeof b == "string" || typeof b == "function" || b === r || b === s || I || b === o || b === u || b === d || E || b === p || R || C || T || typeof b == "object" && b !== null && (b.$$typeof === h || b.$$typeof === f || b.$$typeof === i || b.$$typeof === a || b.$$typeof === l || // This needs to include all possible module reference object
79
79
  // types supported by any Flight configuration anywhere since
80
80
  // we don't know which Flight build this will end up being used
81
81
  // with.
@@ -615,8 +615,8 @@ Check the top-level render call using <` + M + ">.");
615
615
  function $n(b, N, M) {
616
616
  return xt(b, N, M, !1);
617
617
  }
618
- var ar = $n, E = Vt;
619
- Ar.Fragment = r, Ar.jsx = ar, Ar.jsxs = E;
618
+ var ar = $n, k = Vt;
619
+ Ar.Fragment = r, Ar.jsx = ar, Ar.jsxs = k;
620
620
  }()), Ar;
621
621
  }
622
622
  process.env.NODE_ENV === "production" ? wi.exports = hm() : wi.exports = pm();
@@ -655,7 +655,7 @@ const xm = is("string"), Rt = is("function"), zc = is("number"), Qr = (e) => e !
655
655
  let t;
656
656
  return e && (typeof FormData == "function" && e instanceof FormData || Rt(e.append) && ((t = ss(e)) === "formdata" || // detect form-data instance
657
657
  t === "object" && Rt(e.toString) && e.toString() === "[object FormData]"));
658
- }, km = Jt("URLSearchParams"), [Em, Im, Nm, Am] = ["ReadableStream", "Request", "Response", "Headers"].map(Jt), _m = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
658
+ }, Em = Jt("URLSearchParams"), [km, Im, Nm, Am] = ["ReadableStream", "Request", "Response", "Headers"].map(Jt), _m = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
659
659
  function eo(e, t, { allOwnKeys: n = !1 } = {}) {
660
660
  if (e === null || typeof e > "u")
661
661
  return;
@@ -811,7 +811,7 @@ const Ym = (e) => {
811
811
  isObject: Qr,
812
812
  isPlainObject: yo,
813
813
  isEmptyObject: wm,
814
- isReadableStream: Em,
814
+ isReadableStream: km,
815
815
  isRequest: Im,
816
816
  isResponse: Nm,
817
817
  isHeaders: Am,
@@ -822,7 +822,7 @@ const Ym = (e) => {
822
822
  isRegExp: Um,
823
823
  isFunction: Rt,
824
824
  isStream: Tm,
825
- isURLSearchParams: km,
825
+ isURLSearchParams: Em,
826
826
  isTypedArray: $m,
827
827
  isFileList: Cm,
828
828
  forEach: eo,
@@ -1295,7 +1295,7 @@ function yg(e, t) {
1295
1295
  });
1296
1296
  });
1297
1297
  }
1298
- let kt = class {
1298
+ let Et = class {
1299
1299
  constructor(t) {
1300
1300
  t && this.set(t);
1301
1301
  }
@@ -1421,8 +1421,8 @@ let kt = class {
1421
1421
  return j.isArray(t) ? t.forEach(s) : s(t), this;
1422
1422
  }
1423
1423
  };
1424
- kt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1425
- j.reduceDescriptors(kt.prototype, ({ value: e }, t) => {
1424
+ Et.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1425
+ j.reduceDescriptors(Et.prototype, ({ value: e }, t) => {
1426
1426
  let n = t[0].toUpperCase() + t.slice(1);
1427
1427
  return {
1428
1428
  get: () => e,
@@ -1431,9 +1431,9 @@ j.reduceDescriptors(kt.prototype, ({ value: e }, t) => {
1431
1431
  }
1432
1432
  };
1433
1433
  });
1434
- j.freezeMethods(kt);
1434
+ j.freezeMethods(Et);
1435
1435
  function Hs(e, t) {
1436
- const n = this || to, r = t || n, o = kt.from(r.headers);
1436
+ const n = this || to, r = t || n, o = Et.from(r.headers);
1437
1437
  let s = r.data;
1438
1438
  return j.forEach(e, function(a) {
1439
1439
  s = a.call(n, s, o.normalize(), t ? t.status : void 0);
@@ -1519,7 +1519,7 @@ const Do = (e, t, n = 3) => {
1519
1519
  }, ll = (e) => (...t) => j.asap(() => e(...t)), Rg = wt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, wt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1520
1520
  new URL(wt.origin),
1521
1521
  wt.navigator && /(msie|trident)/i.test(wt.navigator.userAgent)
1522
- ) : () => !0, kg = wt.hasStandardBrowserEnv ? (
1522
+ ) : () => !0, Eg = wt.hasStandardBrowserEnv ? (
1523
1523
  // Standard browser envs support document.cookie
1524
1524
  {
1525
1525
  write(e, t, n, r, o, s) {
@@ -1546,17 +1546,17 @@ const Do = (e, t, n = 3) => {
1546
1546
  }
1547
1547
  }
1548
1548
  );
1549
- function Eg(e) {
1549
+ function kg(e) {
1550
1550
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1551
1551
  }
1552
1552
  function Ig(e, t) {
1553
1553
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1554
1554
  }
1555
1555
  function eu(e, t, n) {
1556
- let r = !Eg(t);
1556
+ let r = !kg(t);
1557
1557
  return e && (r || n == !1) ? Ig(e, t) : t;
1558
1558
  }
1559
- const cl = (e) => e instanceof kt ? { ...e } : e;
1559
+ const cl = (e) => e instanceof Et ? { ...e } : e;
1560
1560
  function Vn(e, t) {
1561
1561
  t = t || {};
1562
1562
  const n = {};
@@ -1624,7 +1624,7 @@ function Vn(e, t) {
1624
1624
  const tu = (e) => {
1625
1625
  const t = Vn({}, e);
1626
1626
  let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
1627
- if (t.headers = i = kt.from(i), t.url = Yc(eu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1627
+ if (t.headers = i = Et.from(i), t.url = Yc(eu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1628
1628
  "Authorization",
1629
1629
  "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1630
1630
  ), j.isFormData(n)) {
@@ -1638,7 +1638,7 @@ const tu = (e) => {
1638
1638
  }
1639
1639
  }
1640
1640
  if (wt.hasStandardBrowserEnv && (r && j.isFunction(r) && (r = r(t)), r || r !== !1 && Rg(t.url))) {
1641
- const l = o && s && kg.read(s);
1641
+ const l = o && s && Eg.read(s);
1642
1642
  l && i.set(o, l);
1643
1643
  }
1644
1644
  return t;
@@ -1646,7 +1646,7 @@ const tu = (e) => {
1646
1646
  return new Promise(function(n, r) {
1647
1647
  const o = tu(e);
1648
1648
  let s = o.data;
1649
- const i = kt.from(o.headers).normalize();
1649
+ const i = Et.from(o.headers).normalize();
1650
1650
  let { responseType: a, onUploadProgress: l, onDownloadProgress: u } = o, d, f, h, p, w;
1651
1651
  function v() {
1652
1652
  p && p(), w && w(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
@@ -1656,7 +1656,7 @@ const tu = (e) => {
1656
1656
  function x() {
1657
1657
  if (!g)
1658
1658
  return;
1659
- const S = kt.from(
1659
+ const S = Et.from(
1660
1660
  "getAllResponseHeaders" in g && g.getAllResponseHeaders()
1661
1661
  ), C = {
1662
1662
  data: !a || a === "text" || a === "json" ? g.responseText : g.response,
@@ -1666,10 +1666,10 @@ const tu = (e) => {
1666
1666
  config: e,
1667
1667
  request: g
1668
1668
  };
1669
- Qc(function(k) {
1670
- n(k), v();
1671
- }, function(k) {
1672
- r(k), v();
1669
+ Qc(function(E) {
1670
+ n(E), v();
1671
+ }, function(E) {
1672
+ r(E), v();
1673
1673
  }, C), g = null;
1674
1674
  }
1675
1675
  "onloadend" in g ? g.onloadend = x : g.onreadystatechange = function() {
@@ -1848,12 +1848,12 @@ const tu = (e) => {
1848
1848
  timeout: R,
1849
1849
  onDownloadProgress: C,
1850
1850
  onUploadProgress: T,
1851
- responseType: k,
1851
+ responseType: E,
1852
1852
  headers: I,
1853
1853
  withCredentials: A = "same-origin",
1854
1854
  fetchOptions: _
1855
1855
  } = tu(w), D = t || fetch;
1856
- k = k ? (k + "").toLowerCase() : "text";
1856
+ E = E ? (E + "").toLowerCase() : "text";
1857
1857
  let L = _g([y, S && S.toAbortSignal()], R), W = null;
1858
1858
  const P = L && L.unsubscribe && (() => {
1859
1859
  L.unsubscribe();
@@ -1886,7 +1886,7 @@ const tu = (e) => {
1886
1886
  };
1887
1887
  W = s && new n(v, J);
1888
1888
  let z = await (s ? D(W, _) : D(v, J));
1889
- const $ = d && (k === "stream" || k === "response");
1889
+ const $ = d && (E === "stream" || E === "response");
1890
1890
  if (d && (C || $ && P)) {
1891
1891
  const B = {};
1892
1892
  ["status", "statusText", "headers"].forEach((Ie) => {
@@ -1903,12 +1903,12 @@ const tu = (e) => {
1903
1903
  B
1904
1904
  );
1905
1905
  }
1906
- k = k || "text";
1907
- let F = await f[j.findKey(f, k) || "text"](z, w);
1906
+ E = E || "text";
1907
+ let F = await f[j.findKey(f, E) || "text"](z, w);
1908
1908
  return !$ && P && P(), await new Promise((B, pe) => {
1909
1909
  Qc(B, pe, {
1910
1910
  data: F,
1911
- headers: kt.from(z.headers),
1911
+ headers: Et.from(z.headers),
1912
1912
  status: z.status,
1913
1913
  statusText: z.statusText,
1914
1914
  config: w,
@@ -1989,7 +1989,7 @@ function Us(e) {
1989
1989
  throw new Cr(null, e);
1990
1990
  }
1991
1991
  function gl(e) {
1992
- return Us(e), e.headers = kt.from(e.headers), e.data = Hs.call(
1992
+ return Us(e), e.headers = Et.from(e.headers), e.data = Hs.call(
1993
1993
  e,
1994
1994
  e.transformRequest
1995
1995
  ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), ru.getAdapter(e.adapter || to.adapter, e)(e).then(function(r) {
@@ -1997,13 +1997,13 @@ function gl(e) {
1997
1997
  e,
1998
1998
  e.transformResponse,
1999
1999
  r
2000
- ), r.headers = kt.from(r.headers), r;
2000
+ ), r.headers = Et.from(r.headers), r;
2001
2001
  }, function(r) {
2002
2002
  return Zc(r) || (Us(e), r && r.response && (r.response.data = Hs.call(
2003
2003
  e,
2004
2004
  e.transformResponse,
2005
2005
  r.response
2006
- ), r.response.headers = kt.from(r.response.headers))), Promise.reject(r);
2006
+ ), r.response.headers = Et.from(r.response.headers))), Promise.reject(r);
2007
2007
  });
2008
2008
  }
2009
2009
  const ou = "1.12.2", ls = {};
@@ -2112,7 +2112,7 @@ let Un = class {
2112
2112
  (w) => {
2113
2113
  delete s[w];
2114
2114
  }
2115
- ), n.headers = kt.concat(i, s);
2115
+ ), n.headers = Et.concat(i, s);
2116
2116
  const a = [];
2117
2117
  let l = !0;
2118
2118
  this.interceptors.request.forEach(function(v) {
@@ -2349,7 +2349,7 @@ ut.all = function(t) {
2349
2349
  ut.spread = Bg;
2350
2350
  ut.isAxiosError = Hg;
2351
2351
  ut.mergeConfig = Vn;
2352
- ut.AxiosHeaders = kt;
2352
+ ut.AxiosHeaders = Et;
2353
2353
  ut.formToJSON = (e) => Jc(j.isHTMLForm(e) ? new FormData(e) : e);
2354
2354
  ut.getAdapter = ru.getAdapter;
2355
2355
  ut.HttpStatusCode = Ti;
@@ -2845,23 +2845,20 @@ function ox(e, t) {
2845
2845
  if (!s) continue;
2846
2846
  if ((o == null ? void 0 : o.type) === "text") {
2847
2847
  const i = o, a = i.text ?? "";
2848
- if (!a) {
2848
+ if (console.debug("[MessageReducer] mergeParts", { incomingLength: s.length, previousLength: a.length, incomingSnippet: s.slice(0, 100), previousSnippet: a.slice(-100) }), !a) {
2849
2849
  i.text = s;
2850
2850
  continue;
2851
2851
  }
2852
2852
  if (s.startsWith(a)) {
2853
- i.text = s;
2853
+ console.debug("[MessageReducer] incoming startsWith previous - replacing", { incomingLength: s.length, previousLength: a.length }), i.text = s;
2854
2854
  continue;
2855
2855
  }
2856
- const l = 3, u = /^[^\w\s]+$/.test(s);
2857
- if (a.includes(s) && s.length <= l && !u)
2856
+ if (a.includes(s) && s.length <= 3) {
2857
+ console.debug("[MessageReducer] previous includes incoming - skipping trivial incoming", { incomingLength: s.length, previousLength: a.length });
2858
2858
  continue;
2859
- const d = sx(a, s);
2860
- if (d) {
2861
- const f = d.length / Math.max(1, s.length);
2862
- d.length > 0 && f <= 0.6 ? i.text = a + d : i.text = s;
2863
- } else
2864
- i.text = a + s;
2859
+ }
2860
+ const u = sx(a, s);
2861
+ u ? (console.debug("[MessageReducer] suffix computed", { suffixLength: u.length }), i.text = a + u) : (console.debug("[MessageReducer] no overlap detected - appending incoming", { incomingLength: s.length }), i.text = a + s);
2865
2862
  } else
2866
2863
  n.push({ type: "text", text: s });
2867
2864
  } else
@@ -2894,7 +2891,7 @@ function ax(e) {
2894
2891
  function lx(e = {}) {
2895
2892
  const t = at(() => gn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = xe(e.token ?? null), s = Ge(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = xe(!1), [u, d] = xe(null), [f, h] = xe(""), [p, w] = xe(null), [v, g] = xe(0), [x, y] = xe(!1), S = Ge(null), R = Ge(!0), C = Ge(0), T = Me((_) => {
2896
2893
  o(_);
2897
- }, []), k = Me(() => {
2894
+ }, []), E = Me(() => {
2898
2895
  var _;
2899
2896
  (_ = S.current) == null || _.abort(), S.current = null, l(!1), y(!1), C.current = 0, g(0);
2900
2897
  }, []), I = Me(() => {
@@ -3068,7 +3065,7 @@ function lx(e = {}) {
3068
3065
  lastSeq: v,
3069
3066
  connected: x,
3070
3067
  stream: A,
3071
- stop: k,
3068
+ stop: E,
3072
3069
  clear: I,
3073
3070
  setToken: T
3074
3071
  };
@@ -3147,7 +3144,7 @@ function dx({
3147
3144
  [h, l, u, d, f]
3148
3145
  );
3149
3146
  }
3150
- const cu = Jr(null), uu = Jr(null), du = Jr(null), fx = Jr(!1), hx = 20, px = "cachedThreads", mx = "v1", To = 300, ki = 200;
3147
+ const cu = Jr(null), uu = Jr(null), du = Jr(null), fx = Jr(!1), hx = 20, px = "cachedThreads", mx = "v1", To = 300, Ei = 200;
3151
3148
  function Cl(e) {
3152
3149
  if (typeof window < "u" && "requestIdleCallback" in window)
3153
3150
  try {
@@ -3219,7 +3216,7 @@ function vx(e) {
3219
3216
  return [];
3220
3217
  }
3221
3218
  }
3222
- function Ei(e, t) {
3219
+ function ki(e, t) {
3223
3220
  try {
3224
3221
  fu(e, JSON.stringify(t));
3225
3222
  } catch {
@@ -3231,7 +3228,7 @@ function Tl(e) {
3231
3228
  const n = gx();
3232
3229
  if (n.length > 0)
3233
3230
  try {
3234
- Ei(e, n.slice(0, ki));
3231
+ ki(e, n.slice(0, Ei));
3235
3232
  } catch {
3236
3233
  }
3237
3234
  return n;
@@ -3261,9 +3258,9 @@ function wx({
3261
3258
  } catch {
3262
3259
  return "unknown";
3263
3260
  }
3264
- }, [u]), h = at(() => `threadPayload:${mx}:${f}:`, [f]), p = Me((E) => `${h}${E}`, [h]), w = Me((E) => {
3265
- if (!E || typeof E != "object") return null;
3266
- const b = E;
3261
+ }, [u]), h = at(() => `threadPayload:${mx}:${f}:`, [f]), p = Me((k) => `${h}${k}`, [h]), w = Me((k) => {
3262
+ if (!k || typeof k != "object") return null;
3263
+ const b = k;
3267
3264
  return typeof b.threadId != "string" || !Array.isArray(b.messages) ? null : {
3268
3265
  threadId: b.threadId,
3269
3266
  messages: b.messages,
@@ -3272,8 +3269,8 @@ function wx({
3272
3269
  checkpointId: b.checkpointId ?? null,
3273
3270
  checkpointNs: b.checkpointNs ?? null
3274
3271
  };
3275
- }, []), v = Me((E) => {
3276
- const b = na(p(E));
3272
+ }, []), v = Me((k) => {
3273
+ const b = na(p(k));
3277
3274
  if (!b) return null;
3278
3275
  try {
3279
3276
  const N = JSON.parse(b);
@@ -3281,39 +3278,39 @@ function wx({
3281
3278
  } catch {
3282
3279
  return null;
3283
3280
  }
3284
- }, [p, w]), g = Me((E, b = 100) => {
3281
+ }, [p, w]), g = Me((k, b = 100) => {
3285
3282
  const N = {
3286
- ...E,
3287
- messages: Array.isArray(E.messages) ? E.messages.slice(-b) : []
3283
+ ...k,
3284
+ messages: Array.isArray(k.messages) ? k.messages.slice(-b) : []
3288
3285
  };
3289
3286
  try {
3290
- fu(p(E.threadId), JSON.stringify(N));
3287
+ fu(p(k.threadId), JSON.stringify(N));
3291
3288
  } catch {
3292
3289
  }
3293
- }, [p]), x = Me((E) => {
3294
- qs(p(E));
3290
+ }, [p]), x = Me((k) => {
3291
+ qs(p(k));
3295
3292
  }, [p]), y = Me(() => {
3296
3293
  if (hr())
3297
3294
  try {
3298
- const E = h;
3295
+ const k = h;
3299
3296
  for (let b = 0; b < window.localStorage.length; b++) {
3300
3297
  const N = window.localStorage.key(b);
3301
- N && N.startsWith(E) && window.localStorage.removeItem(N);
3298
+ N && N.startsWith(k) && window.localStorage.removeItem(N);
3302
3299
  }
3303
3300
  } catch {
3304
3301
  }
3305
3302
  }, [h]), [S, R] = xe(
3306
3303
  () => {
3307
- var E;
3308
- return Gs(f, (E = l.getAuthToken) == null ? void 0 : E.call(l));
3304
+ var k;
3305
+ return Gs(f, (k = l.getAuthToken) == null ? void 0 : k.call(l));
3309
3306
  }
3310
3307
  ), [C, T] = xe(() => {
3311
3308
  var b;
3312
- const E = Tl(
3309
+ const k = Tl(
3313
3310
  Gs(f, (b = l.getAuthToken) == null ? void 0 : b.call(l))
3314
3311
  );
3315
- return Ys(E);
3316
- }), k = at(() => Xs(C), [C]), [I, A] = xe(t), [_, D] = xe(!1), [L, W] = xe(!1), [P, Y] = xe(!1), [K, J] = xe(!1), [z, $] = xe(null), [F, B] = xe(void 0), [pe, ue] = xe(void 0), {
3312
+ return Ys(k);
3313
+ }), E = at(() => Xs(C), [C]), [I, A] = xe(t), [_, D] = xe(!1), [L, W] = xe(!1), [P, Y] = xe(!1), [K, J] = xe(!1), [z, $] = xe(null), [F, B] = xe(void 0), [pe, ue] = xe(void 0), {
3317
3314
  state: ee,
3318
3315
  seed: Ie,
3319
3316
  prepend: Ce,
@@ -3324,11 +3321,11 @@ function wx({
3324
3321
  ct(() => {
3325
3322
  q.current = I;
3326
3323
  }, [I]);
3327
- const ce = Ge(!1), ie = Ge([]), $e = Ge(null), Ke = Ge(null), We = Ge(/* @__PURE__ */ new Map()), Te = Ge(I), Pe = Ge(!1), et = Ge(null), Fe = Me((E, b) => new Promise((N, M) => {
3324
+ const ce = Ge(!1), ie = Ge([]), $e = Ge(null), Ke = Ge(null), We = Ge(/* @__PURE__ */ new Map()), Te = Ge(I), Pe = Ge(!1), et = Ge(null), Fe = Me((k, b) => new Promise((N, M) => {
3328
3325
  const H = async () => {
3329
3326
  ce.current = !0;
3330
3327
  try {
3331
- await E(), N();
3328
+ await k(), N();
3332
3329
  } catch (X) {
3333
3330
  M(X);
3334
3331
  } finally {
@@ -3341,13 +3338,13 @@ function wx({
3341
3338
  ce.current ? ie.current.push(H) : H().catch((X) => {
3342
3339
  M(X);
3343
3340
  });
3344
- }), []), it = Ge(k.length), [ft, ne] = xe(!1), ae = Ge(!1);
3341
+ }), []), it = Ge(E.length), [ft, ne] = xe(!1), ae = Ge(!1);
3345
3342
  ct(() => {
3346
- it.current = k.length;
3347
- }, [k.length]);
3343
+ it.current = E.length;
3344
+ }, [E.length]);
3348
3345
  const de = Me(async () => {
3349
- const E = it.current > 0;
3350
- E || D(!0);
3346
+ const k = it.current > 0;
3347
+ k || D(!0);
3351
3348
  try {
3352
3349
  const b = await l.listThreads();
3353
3350
  zs(() => {
@@ -3359,14 +3356,14 @@ function wx({
3359
3356
  } catch (b) {
3360
3357
  i == null || i(String(b)), console.error("[ChatSessionProvider] Failed to refresh threads:", b);
3361
3358
  } finally {
3362
- E || D(!1);
3359
+ k || D(!1);
3363
3360
  }
3364
3361
  }, [l, i]), Ne = Ge(!1), he = Ge(null), me = Ge(null), He = Ge(""), Oe = Me(
3365
- (E, b) => {
3362
+ (k, b) => {
3366
3363
  if (!hr()) return;
3367
3364
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3368
- const N = E.map((H) => `${H.threadId}:${H.updatedAt ?? ""}:${H.messageCount ?? ""}`).join("|");
3369
- if (E.length === 0) {
3365
+ const N = k.map((H) => `${H.threadId}:${H.updatedAt ?? ""}:${H.messageCount ?? ""}`).join("|");
3366
+ if (k.length === 0) {
3370
3367
  try {
3371
3368
  qs(S);
3372
3369
  } catch {
@@ -3378,8 +3375,8 @@ function wx({
3378
3375
  return;
3379
3376
  const M = () => {
3380
3377
  try {
3381
- const H = E.slice(0, ki);
3382
- Ei(S, H), He.current = N;
3378
+ const H = k.slice(0, Ei);
3379
+ ki(S, H), He.current = N;
3383
3380
  } catch {
3384
3381
  } finally {
3385
3382
  me.current = null;
@@ -3395,23 +3392,23 @@ function wx({
3395
3392
  },
3396
3393
  [S]
3397
3394
  ), ot = Me(
3398
- (E, b, N) => {
3399
- const M = Array.isArray(E == null ? void 0 : E.messages) ? E.messages : [], H = N ?? (E == null ? void 0 : E.threadId) ?? q.current;
3395
+ (k, b, N) => {
3396
+ const M = Array.isArray(k == null ? void 0 : k.messages) ? k.messages : [], H = N ?? (k == null ? void 0 : k.threadId) ?? q.current;
3400
3397
  if (b === "replace") {
3401
3398
  if (H) {
3402
3399
  const X = {
3403
3400
  threadId: H,
3404
3401
  messages: M.slice(),
3405
- hasMore: !!(E != null && E.hasMore),
3406
- nextCursor: (E == null ? void 0 : E.nextCursor) ?? null,
3407
- checkpointId: (E == null ? void 0 : E.checkpointId) ?? null,
3408
- checkpointNs: (E == null ? void 0 : E.checkpointNs) ?? null
3402
+ hasMore: !!(k != null && k.hasMore),
3403
+ nextCursor: (k == null ? void 0 : k.nextCursor) ?? null,
3404
+ checkpointId: (k == null ? void 0 : k.checkpointId) ?? null,
3405
+ checkpointNs: (k == null ? void 0 : k.checkpointNs) ?? null
3409
3406
  };
3410
3407
  We.current.set(H, X), Te.current = H;
3411
3408
  }
3412
3409
  Ie(M, {
3413
- checkpointId: (E == null ? void 0 : E.checkpointId) ?? null,
3414
- checkpointNs: (E == null ? void 0 : E.checkpointNs) ?? null
3410
+ checkpointId: (k == null ? void 0 : k.checkpointId) ?? null,
3411
+ checkpointNs: (k == null ? void 0 : k.checkpointNs) ?? null
3415
3412
  });
3416
3413
  } else if (b === "prepend" && M.length && H) {
3417
3414
  const X = We.current.get(H), Se = (X == null ? void 0 : X.messages) ?? [], we = /* @__PURE__ */ new Set(), ge = [...M, ...Se].filter((Je) => {
@@ -3420,49 +3417,49 @@ function wx({
3420
3417
  }), qe = {
3421
3418
  threadId: H,
3422
3419
  messages: ge,
3423
- hasMore: (E == null ? void 0 : E.hasMore) ?? (X == null ? void 0 : X.hasMore) ?? !1,
3424
- nextCursor: (E == null ? void 0 : E.nextCursor) ?? (X == null ? void 0 : X.nextCursor) ?? null,
3425
- checkpointId: (X == null ? void 0 : X.checkpointId) ?? (E == null ? void 0 : E.checkpointId) ?? null,
3426
- checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? (E == null ? void 0 : E.checkpointNs) ?? null
3420
+ hasMore: (k == null ? void 0 : k.hasMore) ?? (X == null ? void 0 : X.hasMore) ?? !1,
3421
+ nextCursor: (k == null ? void 0 : k.nextCursor) ?? (X == null ? void 0 : X.nextCursor) ?? null,
3422
+ checkpointId: (X == null ? void 0 : X.checkpointId) ?? (k == null ? void 0 : k.checkpointId) ?? null,
3423
+ checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? (k == null ? void 0 : k.checkpointNs) ?? null
3427
3424
  };
3428
3425
  We.current.set(H, qe), Ce(M);
3429
3426
  } else b === "prepend" && M.length && Ce(M);
3430
- b === "replace" ? ($((E == null ? void 0 : E.nextCursor) ?? null), Y(!!(E != null && E.hasMore)), B((E == null ? void 0 : E.checkpointId) ?? void 0), ue((E == null ? void 0 : E.checkpointNs) ?? void 0)) : ($((X) => (E == null ? void 0 : E.nextCursor) ?? X ?? null), Y((X) => (E == null ? void 0 : E.hasMore) !== void 0 ? !!(E != null && E.hasMore) : X), B((X) => (E == null ? void 0 : E.checkpointId) ?? X ?? void 0), ue((X) => (E == null ? void 0 : E.checkpointNs) ?? X ?? void 0));
3427
+ b === "replace" ? ($((k == null ? void 0 : k.nextCursor) ?? null), Y(!!(k != null && k.hasMore)), B((k == null ? void 0 : k.checkpointId) ?? void 0), ue((k == null ? void 0 : k.checkpointNs) ?? void 0)) : ($((X) => (k == null ? void 0 : k.nextCursor) ?? X ?? null), Y((X) => (k == null ? void 0 : k.hasMore) !== void 0 ? !!(k != null && k.hasMore) : X), B((X) => (k == null ? void 0 : k.checkpointId) ?? X ?? void 0), ue((X) => (k == null ? void 0 : k.checkpointNs) ?? X ?? void 0));
3431
3428
  },
3432
3429
  [Ce, Ie]
3433
3430
  ), gt = Me(
3434
- (E) => {
3435
- Ie(E.messages, {
3436
- checkpointId: E.checkpointId,
3437
- checkpointNs: E.checkpointNs
3438
- }), $(E.nextCursor), Y(E.hasMore), B(E.checkpointId ?? void 0), ue(E.checkpointNs ?? void 0), Te.current = E.threadId;
3431
+ (k) => {
3432
+ Ie(k.messages, {
3433
+ checkpointId: k.checkpointId,
3434
+ checkpointNs: k.checkpointNs
3435
+ }), $(k.nextCursor), Y(k.hasMore), B(k.checkpointId ?? void 0), ue(k.checkpointNs ?? void 0), Te.current = k.threadId;
3439
3436
  },
3440
3437
  [Ie]
3441
- ), It = Me((E) => {
3442
- E && (We.current.delete(E), x(E), Te.current === E && (Te.current = null));
3438
+ ), It = Me((k) => {
3439
+ k && (We.current.delete(k), x(k), Te.current === k && (Te.current = null));
3443
3440
  }, [x]), Qt = Me(() => {
3444
- const E = q.current;
3445
- E && It(E), Q([]), Y(!1), J(!1), $(null), B(void 0), ue(void 0);
3446
- }, [It, Q]), On = Me(({ from: E, to: b }) => {
3441
+ const k = q.current;
3442
+ k && It(k), Q([]), Y(!1), J(!1), $(null), B(void 0), ue(void 0);
3443
+ }, [It, Q]), On = Me(({ from: k, to: b }) => {
3447
3444
  const N = q.current;
3448
3445
  N && console.warn(
3449
- `[ChatSessionProvider] Stream sequence gap detected (${E} -> ${b}) for thread ${N}`
3446
+ `[ChatSessionProvider] Stream sequence gap detected (${k} -> ${b}) for thread ${N}`
3450
3447
  );
3451
3448
  }, []), or = Me(
3452
- (E) => {
3453
- const b = E.threadId;
3449
+ (k) => {
3450
+ const b = k.threadId;
3454
3451
  console.log("[ChatSessionProvider] 📥 Handling thread_info event:", {
3455
3452
  threadId: b,
3456
- title: E.title,
3457
- created: E.created,
3458
- currentThreads: k.length
3453
+ title: k.title,
3454
+ created: k.created,
3455
+ currentThreads: E.length
3459
3456
  });
3460
3457
  const N = {
3461
3458
  threadId: b,
3462
- title: E.title || `Thread ${b.slice(0, 8)}`,
3463
- createdAt: E.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3464
- updatedAt: E.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3465
- messageCount: E.messageCount || 0
3459
+ title: k.title || `Thread ${b.slice(0, 8)}`,
3460
+ createdAt: k.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3461
+ updatedAt: k.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3462
+ messageCount: k.messageCount || 0
3466
3463
  };
3467
3464
  q.current !== b && (!q.current && ee.messages.length <= 1 && (Ke.current = b), A(b)), zs(() => {
3468
3465
  T((M) => {
@@ -3482,8 +3479,8 @@ function wx({
3482
3479
  baseUrl: d,
3483
3480
  onThreadInfo: or,
3484
3481
  onMessageEvent: O,
3485
- onUnhandledEvent: (E) => {
3486
- console.warn(`[ChatSessionProvider] Unhandled stream event: ${E.type}`, E);
3482
+ onUnhandledEvent: (k) => {
3483
+ console.warn(`[ChatSessionProvider] Unhandled stream event: ${k.type}`, k);
3487
3484
  },
3488
3485
  onSequenceGap: On
3489
3486
  });
@@ -3492,8 +3489,8 @@ function wx({
3492
3489
  }, [en]), ct(() => {
3493
3490
  if (!hr()) return;
3494
3491
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3495
- const E = k.map((N) => `${N.threadId}:${N.updatedAt ?? ""}:${N.messageCount ?? ""}`).join("|");
3496
- if (k.length === 0) {
3492
+ const k = E.map((N) => `${N.threadId}:${N.updatedAt ?? ""}:${N.messageCount ?? ""}`).join("|");
3493
+ if (E.length === 0) {
3497
3494
  try {
3498
3495
  qs(S);
3499
3496
  } catch {
@@ -3501,12 +3498,12 @@ function wx({
3501
3498
  He.current = "";
3502
3499
  return;
3503
3500
  }
3504
- if (E === He.current)
3501
+ if (k === He.current)
3505
3502
  return;
3506
3503
  const b = () => {
3507
3504
  try {
3508
- const N = k.slice(0, ki);
3509
- Ei(S, N), He.current = E;
3505
+ const N = E.slice(0, Ei);
3506
+ ki(S, N), He.current = k;
3510
3507
  } catch {
3511
3508
  } finally {
3512
3509
  me.current = null;
@@ -3517,10 +3514,10 @@ function wx({
3517
3514
  }, To), () => {
3518
3515
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3519
3516
  };
3520
- }, [k, Oe]), ct(() => {
3517
+ }, [E, Oe]), ct(() => {
3521
3518
  var M;
3522
- const E = l.getAuthToken();
3523
- Mt(E);
3519
+ const k = l.getAuthToken();
3520
+ Mt(k);
3524
3521
  const b = (H) => {
3525
3522
  const X = Gs(f, H);
3526
3523
  et.current !== X && (et.current = X, Pe.current = !1), R(X);
@@ -3530,7 +3527,7 @@ function wx({
3530
3527
  }), Pe.current || (Pe.current = !0, de().catch(() => {
3531
3528
  }));
3532
3529
  };
3533
- b(E);
3530
+ b(k);
3534
3531
  const N = (M = l.onTokenChange) == null ? void 0 : M.call(l, (H) => {
3535
3532
  Mt(H), y(), b(H);
3536
3533
  });
@@ -3539,10 +3536,10 @@ function wx({
3539
3536
  };
3540
3537
  }, [l, f, Mt, y, de]);
3541
3538
  const bn = Me(
3542
- async (E) => {
3539
+ async (k) => {
3543
3540
  const b = `temp-${Date.now()}`, N = {
3544
3541
  threadId: b,
3545
- title: E || "New Chat",
3542
+ title: k || "New Chat",
3546
3543
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3547
3544
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
3548
3545
  messageCount: 0
@@ -3552,7 +3549,7 @@ function wx({
3552
3549
  order: [b, ...M.order]
3553
3550
  })), A(b);
3554
3551
  try {
3555
- const M = await l.createThread(E), H = typeof M == "string" ? M : M.threadId;
3552
+ const M = await l.createThread(k), H = typeof M == "string" ? M : M.threadId;
3556
3553
  return T((X) => {
3557
3554
  const Se = X.byId[b];
3558
3555
  if (!Se) return X;
@@ -3573,25 +3570,25 @@ function wx({
3573
3570
  },
3574
3571
  [l, de]
3575
3572
  ), yn = Me(
3576
- async (E) => {
3577
- await l.deleteThread(E);
3573
+ async (k) => {
3574
+ await l.deleteThread(k);
3578
3575
  let b = null;
3579
3576
  T((N) => {
3580
- if (!N.byId[E]) return N;
3577
+ if (!N.byId[k]) return N;
3581
3578
  const M = { ...N.byId };
3582
- delete M[E];
3583
- const H = N.order.filter((Se) => Se !== E), X = { byId: M, order: H };
3579
+ delete M[k];
3580
+ const H = N.order.filter((Se) => Se !== k), X = { byId: M, order: H };
3584
3581
  return b = Xs(X), X;
3585
- }), b && Oe(b, { immediate: !0 }), It(E), q.current === E && (Ke.current = E, A(null), q.current = null, Te.current = null, Qt()), await de();
3582
+ }), b && Oe(b, { immediate: !0 }), It(k), q.current === k && (Ke.current = k, A(null), q.current = null, Te.current = null, Qt()), await de();
3586
3583
  },
3587
3584
  [l, Qt, It, de, Oe]
3588
3585
  ), Dn = Me(
3589
- async (E, b) => {
3586
+ async (k, b) => {
3590
3587
  try {
3591
- await l.updateThread(E, b), T((N) => {
3592
- const M = N.byId[E];
3588
+ await l.updateThread(k, b), T((N) => {
3589
+ const M = N.byId[k];
3593
3590
  return M ? {
3594
- byId: { ...N.byId, [E]: { ...M, title: b } },
3591
+ byId: { ...N.byId, [k]: { ...M, title: b } },
3595
3592
  order: N.order
3596
3593
  } : N;
3597
3594
  });
@@ -3601,35 +3598,35 @@ function wx({
3601
3598
  },
3602
3599
  [l, de]
3603
3600
  ), Dt = Me(
3604
- async (E, b, N, M = !1) => {
3601
+ async (k, b, N, M = !1) => {
3605
3602
  await Fe(async () => {
3606
- if (Ke.current === E && !M) {
3603
+ if (Ke.current === k && !M) {
3607
3604
  Ke.current = null;
3608
3605
  return;
3609
3606
  }
3610
- if ($e.current === E && !M)
3607
+ if ($e.current === k && !M)
3611
3608
  return;
3612
- A((ge) => ge === E ? ge : E), q.current = E;
3609
+ A((ge) => ge === k ? ge : k), q.current = k;
3613
3610
  const H = !M && !b && !N;
3614
3611
  let X = !1;
3615
3612
  if (H) {
3616
- const ge = We.current.get(E);
3613
+ const ge = We.current.get(k);
3617
3614
  if (ge)
3618
3615
  gt(ge), X = !0;
3619
3616
  else {
3620
- const qe = v(E);
3621
- qe && (We.current.set(E, qe), gt(qe), X = !0);
3617
+ const qe = v(k);
3618
+ qe && (We.current.set(k, qe), gt(qe), X = !0);
3622
3619
  }
3623
3620
  }
3624
3621
  const Se = M || !X || !!b || !!N, we = async (ge) => {
3625
- ge && W(!0), $e.current = E;
3622
+ ge && W(!0), $e.current = k;
3626
3623
  try {
3627
3624
  const qe = await l.getMessages({
3628
- threadId: E,
3625
+ threadId: k,
3629
3626
  checkpointId: b,
3630
3627
  checkpointNs: N
3631
3628
  });
3632
- ot(qe, "replace", E);
3629
+ ot(qe, "replace", k);
3633
3630
  } catch (qe) {
3634
3631
  throw (!X || M || ge) && (i == null || i(String(qe))), qe;
3635
3632
  } finally {
@@ -3639,13 +3636,13 @@ function wx({
3639
3636
  Se ? await we(!0) : H && X && we(!1).catch((ge) => {
3640
3637
  console.warn("[ChatSessionProvider] Background refresh failed:", ge);
3641
3638
  });
3642
- }, `loadThread-${E}`);
3639
+ }, `loadThread-${k}`);
3643
3640
  },
3644
3641
  [l, gt, ot, Fe, i]
3645
3642
  ), Ln = Me(async () => {
3646
3643
  await Fe(async () => {
3647
- const E = q.current;
3648
- E && It(E), Ke.current = null, A(null), q.current = null, Te.current = null, Qt(), B(void 0), ue(void 0);
3644
+ const k = q.current;
3645
+ k && It(k), Ke.current = null, A(null), q.current = null, Te.current = null, Qt(), B(void 0), ue(void 0);
3649
3646
  try {
3650
3647
  localStorage.removeItem("lastThreadId");
3651
3648
  } catch (b) {
@@ -3653,22 +3650,22 @@ function wx({
3653
3650
  }
3654
3651
  }, "clearCurrentThread");
3655
3652
  }, [Qt, It, Fe]), ir = Me(
3656
- async (E) => {
3657
- const b = await l.listCheckpoints(E);
3658
- return Yg(b, E);
3653
+ async (k) => {
3654
+ const b = await l.listCheckpoints(k);
3655
+ return Yg(b, k);
3659
3656
  },
3660
3657
  [l]
3661
3658
  ), re = Me(
3662
- async (E, b) => {
3659
+ async (k, b) => {
3663
3660
  if (!q.current) throw new Error("No active thread");
3664
- await Dt(q.current, E, b ?? void 0, !0);
3661
+ await Dt(q.current, k, b ?? void 0, !0);
3665
3662
  },
3666
3663
  [Dt]
3667
3664
  ), ve = Me(async () => {
3668
3665
  if (!q.current) throw new Error("No active thread");
3669
3666
  await Dt(q.current, void 0, void 0, !0);
3670
3667
  }, [Dt]), Le = Me(
3671
- async (E) => {
3668
+ async (k) => {
3672
3669
  if (!q.current) throw new Error("No active thread");
3673
3670
  if (K || !P) return;
3674
3671
  const b = z;
@@ -3679,7 +3676,7 @@ function wx({
3679
3676
  threadId: N,
3680
3677
  checkpointId: F,
3681
3678
  checkpointNs: pe,
3682
- limit: (E == null ? void 0 : E.limit) ?? hx,
3679
+ limit: (k == null ? void 0 : k.limit) ?? hx,
3683
3680
  beforeId: b
3684
3681
  });
3685
3682
  ot(M, "prepend", N ?? void 0);
@@ -3698,7 +3695,7 @@ function wx({
3698
3695
  K
3699
3696
  ]
3700
3697
  ), Xe = Me(
3701
- async (E, b) => {
3698
+ async (k, b) => {
3702
3699
  var St;
3703
3700
  const N = q.current;
3704
3701
  !N && !(b != null && b.payloadExtras) && console.warn("[ChatSessionProvider] No thread ID - message will create new thread");
@@ -3706,7 +3703,7 @@ function wx({
3706
3703
  l,
3707
3704
  M
3708
3705
  ), Se = [...H];
3709
- E && E.trim() && Se.push({ type: "text", text: E.trim() });
3706
+ k && k.trim() && Se.push({ type: "text", text: k.trim() });
3710
3707
  const we = {
3711
3708
  id: ((St = crypto.randomUUID) == null ? void 0 : St.call(crypto)) || `user-${Date.now()}`,
3712
3709
  role: "user",
@@ -3751,7 +3748,7 @@ function wx({
3751
3748
  wn
3752
3749
  ]
3753
3750
  ), xt = Me(
3754
- async (E, b, N) => {
3751
+ async (k, b, N) => {
3755
3752
  const M = q.current;
3756
3753
  if (!M)
3757
3754
  throw new Error("No active thread to handle interrupt");
@@ -3759,7 +3756,7 @@ function wx({
3759
3756
  const H = b ? N ?? !0 : !1;
3760
3757
  await l.resume({ threadId: M, value: H });
3761
3758
  } catch (H) {
3762
- throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${E}:`, H), H;
3759
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${k}:`, H), H;
3763
3760
  }
3764
3761
  },
3765
3762
  [l]
@@ -3768,8 +3765,8 @@ function wx({
3768
3765
  if (a == null || a(I), I)
3769
3766
  try {
3770
3767
  localStorage.setItem("lastThreadId", I);
3771
- } catch (E) {
3772
- console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", E);
3768
+ } catch (k) {
3769
+ console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", k);
3773
3770
  }
3774
3771
  }, [I, a]), ct(() => ((async () => {
3775
3772
  try {
@@ -3788,20 +3785,20 @@ function wx({
3788
3785
  }
3789
3786
  })(), () => {
3790
3787
  }), []), ct(() => {
3791
- const E = q.current;
3792
- if (!E || Te.current !== E) return;
3788
+ const k = q.current;
3789
+ if (!k || Te.current !== k) return;
3793
3790
  const b = {
3794
- threadId: E,
3791
+ threadId: k,
3795
3792
  messages: ee.messages.slice(),
3796
3793
  hasMore: P,
3797
3794
  nextCursor: z,
3798
3795
  checkpointId: ee.lastCheckpointId ?? null,
3799
3796
  checkpointNs: ee.lastCheckpointNs ?? null
3800
- }, N = We.current.get(E);
3797
+ }, N = We.current.get(k);
3801
3798
  (!N || N.messages.length !== b.messages.length || N.messages.some((H, X) => {
3802
3799
  var Se;
3803
3800
  return (H == null ? void 0 : H.id) !== ((Se = b.messages[X]) == null ? void 0 : Se.id);
3804
- }) || (N == null ? void 0 : N.hasMore) !== b.hasMore || (N == null ? void 0 : N.nextCursor) !== b.nextCursor || (N == null ? void 0 : N.checkpointId) !== b.checkpointId || (N == null ? void 0 : N.checkpointNs) !== b.checkpointNs) && (We.current.set(E, b), he.current && window.clearTimeout(he.current), he.current = window.setTimeout(() => {
3801
+ }) || (N == null ? void 0 : N.hasMore) !== b.hasMore || (N == null ? void 0 : N.nextCursor) !== b.nextCursor || (N == null ? void 0 : N.checkpointId) !== b.checkpointId || (N == null ? void 0 : N.checkpointNs) !== b.checkpointNs) && (We.current.set(k, b), he.current && window.clearTimeout(he.current), he.current = window.setTimeout(() => {
3805
3802
  try {
3806
3803
  g(b, 100);
3807
3804
  } catch (H) {
@@ -3817,7 +3814,7 @@ function wx({
3817
3814
  ]);
3818
3815
  const Vt = at(
3819
3816
  () => ({
3820
- threads: k,
3817
+ threads: E,
3821
3818
  currentThreadId: I,
3822
3819
  isLoadingThreads: _,
3823
3820
  isLoadingThread: L,
@@ -3845,7 +3842,7 @@ function wx({
3845
3842
  de,
3846
3843
  Dn,
3847
3844
  ve,
3848
- k
3845
+ E
3849
3846
  ]
3850
3847
  ), $n = at(
3851
3848
  () => ({
@@ -4035,7 +4032,7 @@ function Sx({
4035
4032
  I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), y()) : I.key === "Escape" && t && (I.preventDefault(), a == null || a());
4036
4033
  },
4037
4034
  [y, t, a]
4038
- ), k = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
4035
+ ), E = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
4039
4036
  return /* @__PURE__ */ c.jsx("form", { onSubmit: (I) => void y(I), className: `w-full ${u}`, children: /* @__PURE__ */ c.jsxs("div", { className: "flex items-end gap-2", children: [
4040
4037
  /* @__PURE__ */ c.jsx("div", { className: "flex-1", children: /* @__PURE__ */ c.jsx(
4041
4038
  pu,
@@ -4045,7 +4042,7 @@ function Sx({
4045
4042
  onChange: S,
4046
4043
  onKeyDown: R,
4047
4044
  placeholder: t ? "Edit your message..." : n,
4048
- className: k,
4045
+ className: E,
4049
4046
  disabled: o,
4050
4047
  maxLength: s,
4051
4048
  rows: 1,
@@ -4090,7 +4087,7 @@ function Tx(e) {
4090
4087
  function gu(e, t) {
4091
4088
  return (n) => e(t(n));
4092
4089
  }
4093
- function kl(e, t) {
4090
+ function El(e, t) {
4094
4091
  return () => e(t);
4095
4092
  }
4096
4093
  function Rx(e, t) {
@@ -4099,7 +4096,7 @@ function Rx(e, t) {
4099
4096
  function oa(e) {
4100
4097
  return e !== void 0;
4101
4098
  }
4102
- function kx(...e) {
4099
+ function Ex(...e) {
4103
4100
  return () => {
4104
4101
  e.map(Tx);
4105
4102
  };
@@ -4109,7 +4106,7 @@ function Rr() {
4109
4106
  function us(e, t) {
4110
4107
  return t(e), e;
4111
4108
  }
4112
- function Ex(e, t) {
4109
+ function kx(e, t) {
4113
4110
  return t(e);
4114
4111
  }
4115
4112
  function rt(...e) {
@@ -4136,7 +4133,7 @@ function qt(e, t) {
4136
4133
  });
4137
4134
  return n;
4138
4135
  }
4139
- function El(e) {
4136
+ function kl(e) {
4140
4137
  let t, n;
4141
4138
  return (r) => (o) => {
4142
4139
  t = o, n && clearTimeout(n), n = setTimeout(() => {
@@ -4153,7 +4150,7 @@ function nt(e = xu) {
4153
4150
  e(t, r) || (t = r, n(r));
4154
4151
  };
4155
4152
  }
4156
- function ke(e) {
4153
+ function Ee(e) {
4157
4154
  return (t) => (n) => {
4158
4155
  e(n) && t(n);
4159
4156
  };
@@ -4214,7 +4211,7 @@ function De(...e) {
4214
4211
  };
4215
4212
  }
4216
4213
  function Ix(...e) {
4217
- return (t) => e.reduceRight(Ex, t);
4214
+ return (t) => e.reduceRight(kx, t);
4218
4215
  }
4219
4216
  function Nx(e) {
4220
4217
  let t, n;
@@ -4320,11 +4317,11 @@ function Ii(...e) {
4320
4317
  case Tr:
4321
4318
  return;
4322
4319
  case Nn:
4323
- return kx(...e.map((r) => Ye(r, n)));
4320
+ return Ex(...e.map((r) => Ye(r, n)));
4324
4321
  }
4325
4322
  };
4326
4323
  }
4327
- var Et = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(Et || {});
4324
+ var kt = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(kt || {});
4328
4325
  const jx = {
4329
4326
  0: "debug",
4330
4327
  3: "error",
@@ -4405,7 +4402,7 @@ function Mx(e, t, n, r) {
4405
4402
  if (a.dataset.index === void 0)
4406
4403
  continue;
4407
4404
  const l = parseInt(a.dataset.index), u = parseFloat(a.dataset.knownSize), d = t(a, n);
4408
- if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, Et.ERROR), d === u)
4405
+ if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, kt.ERROR), d === u)
4409
4406
  continue;
4410
4407
  const f = s[s.length - 1];
4411
4408
  s.length === 0 || f.size !== d || f.endIndex !== l - 1 ? s.push({ endIndex: l, size: d, startIndex: l }) : s[s.length - 1].endIndex++;
@@ -4413,7 +4410,7 @@ function Mx(e, t, n, r) {
4413
4410
  return s;
4414
4411
  }
4415
4412
  function Il(e, t, n) {
4416
- return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Et.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
4413
+ return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
4417
4414
  }
4418
4415
  function vu(e, t, n) {
4419
4416
  const r = V.useRef(null), o = V.useCallback(
@@ -4719,7 +4716,7 @@ function Wr(e, t, n) {
4719
4716
  const { index: r, offset: o, size: s } = Ru(t, e, la), i = e - r, a = s * i + (i - 1) * n + o;
4720
4717
  return a > 0 ? a + n : a;
4721
4718
  }
4722
- function ku(e, t) {
4719
+ function Eu(e, t) {
4723
4720
  if (!fs(t))
4724
4721
  return e;
4725
4722
  let n = 0;
@@ -4727,12 +4724,12 @@ function ku(e, t) {
4727
4724
  n++;
4728
4725
  return e + n;
4729
4726
  }
4730
- function Eu(e, t, n) {
4727
+ function ku(e, t, n) {
4731
4728
  if (zx(e))
4732
4729
  return t.groupIndices[e.groupIndex] + 1;
4733
4730
  {
4734
4731
  const r = e.index === "LAST" ? n : e.index;
4735
- let o = ku(r, t);
4732
+ let o = Eu(r, t);
4736
4733
  return o = Math.max(0, o, Math.min(n, o)), o;
4737
4734
  }
4738
4735
  }
@@ -4740,7 +4737,7 @@ function Hx(e, t, n, r = 0) {
4740
4737
  return r > 0 && (t = Math.max(t, Ru(e, r, la).offset)), wu(Lx(e, t, n, Bx), Vx);
4741
4738
  }
4742
4739
  function Ux(e, [t, n, r, o]) {
4743
- t.length > 0 && r("received item sizes", t, Et.DEBUG);
4740
+ t.length > 0 && r("received item sizes", t, kt.DEBUG);
4744
4741
  const s = e.sizeTree;
4745
4742
  let i = s, a = 0;
4746
4743
  if (n.length > 0 && Ze(s) && t.length === 2) {
@@ -4826,10 +4823,10 @@ const qx = {
4826
4823
  fe(
4827
4824
  U(
4828
4825
  l,
4829
- ke((C) => C.length > 0),
4826
+ Ee((C) => C.length > 0),
4830
4827
  De(v, p),
4831
- oe(([C, T, k]) => {
4832
- const I = C.reduce((A, _, D) => _t(A, _, Wr(_, T.offsetTree, k) || D), pr());
4828
+ oe(([C, T, E]) => {
4829
+ const I = C.reduce((A, _, D) => _t(A, _, Wr(_, T.offsetTree, E) || D), pr());
4833
4830
  return {
4834
4831
  ...T,
4835
4832
  groupIndices: C,
@@ -4842,11 +4839,11 @@ const qx = {
4842
4839
  U(
4843
4840
  r,
4844
4841
  De(v),
4845
- ke(([C, { lastIndex: T }]) => C < T),
4846
- oe(([C, { lastIndex: T, lastSize: k }]) => [
4842
+ Ee(([C, { lastIndex: T }]) => C < T),
4843
+ oe(([C, { lastIndex: T, lastSize: E }]) => [
4847
4844
  {
4848
4845
  endIndex: T,
4849
- size: k,
4846
+ size: E,
4850
4847
  startIndex: C
4851
4848
  }
4852
4849
  ])
@@ -4863,7 +4860,7 @@ const qx = {
4863
4860
  fe(
4864
4861
  U(
4865
4862
  d,
4866
- ke((C) => C !== void 0 && Ze(lt(v).sizeTree)),
4863
+ Ee((C) => C !== void 0 && Ze(lt(v).sizeTree)),
4867
4864
  oe((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
4868
4865
  ),
4869
4866
  n
@@ -4873,9 +4870,9 @@ const qx = {
4873
4870
  n,
4874
4871
  De(v),
4875
4872
  sn(
4876
- ({ sizes: C }, [T, k]) => ({
4877
- changed: k !== C,
4878
- sizes: k
4873
+ ({ sizes: C }, [T, E]) => ({
4874
+ changed: E !== C,
4875
+ sizes: E
4879
4876
  }),
4880
4877
  { changed: !1, sizes: w }
4881
4878
  ),
@@ -4896,15 +4893,15 @@ const qx = {
4896
4893
  if (C > 0)
4897
4894
  je(t, !0), je(s, C + Al(C, T));
4898
4895
  else if (C < 0) {
4899
- const k = lt(g);
4900
- k.length > 0 && (C -= Al(-C, k)), je(i, C);
4896
+ const E = lt(g);
4897
+ E.length > 0 && (C -= Al(-C, E)), je(i, C);
4901
4898
  }
4902
4899
  }
4903
4900
  ), Ye(U(a, De(e)), ([C, T]) => {
4904
4901
  C < 0 && T(
4905
4902
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
4906
4903
  { firstItemIndex: a },
4907
- Et.ERROR
4904
+ kt.ERROR
4908
4905
  );
4909
4906
  });
4910
4907
  const S = jt(s);
@@ -4913,8 +4910,8 @@ const qx = {
4913
4910
  s,
4914
4911
  De(v),
4915
4912
  oe(([C, T]) => {
4916
- const k = T.groupIndices.length > 0, I = [], A = T.lastSize;
4917
- if (k) {
4913
+ const E = T.groupIndices.length > 0, I = [], A = T.lastSize;
4914
+ if (E) {
4918
4915
  const _ = Hr(T.sizeTree, 0);
4919
4916
  let D = 0, L = 0;
4920
4917
  for (; D < C; ) {
@@ -4973,9 +4970,9 @@ const qx = {
4973
4970
  U(
4974
4971
  i,
4975
4972
  De(v, p),
4976
- oe(([C, { offsetTree: T }, k]) => {
4973
+ oe(([C, { offsetTree: T }, E]) => {
4977
4974
  const I = -C;
4978
- return Wr(I, T, k);
4975
+ return Wr(I, T, E);
4979
4976
  })
4980
4977
  )
4981
4978
  );
@@ -4983,7 +4980,7 @@ const qx = {
4983
4980
  U(
4984
4981
  i,
4985
4982
  De(v, p),
4986
- oe(([C, T, k]) => {
4983
+ oe(([C, T, E]) => {
4987
4984
  if (T.groupIndices.length > 0) {
4988
4985
  if (Ze(T.sizeTree))
4989
4986
  return T;
@@ -5004,14 +5001,14 @@ const qx = {
5004
5001
  return {
5005
5002
  ...T,
5006
5003
  sizeTree: I,
5007
- ...ji(T.offsetTree, 0, I, k)
5004
+ ...ji(T.offsetTree, 0, I, E)
5008
5005
  };
5009
5006
  } else {
5010
5007
  const I = Hn(T.sizeTree).reduce((A, { k: _, v: D }) => _t(A, Math.max(0, _ + C), D), pr());
5011
5008
  return {
5012
5009
  ...T,
5013
5010
  sizeTree: I,
5014
- ...ji(T.offsetTree, 0, I, k)
5011
+ ...ji(T.offsetTree, 0, I, E)
5015
5012
  };
5016
5013
  }
5017
5014
  })
@@ -5069,7 +5066,7 @@ const Iu = Ve(
5069
5066
  ), fe(
5070
5067
  U(
5071
5068
  dt(o, t, r),
5072
- ke(([l, u]) => fs(u)),
5069
+ Ee(([l, u]) => fs(u)),
5073
5070
  oe(([l, u, d]) => Gt(u.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
5074
5071
  nt(),
5075
5072
  oe((l) => [l])
@@ -5083,12 +5080,12 @@ const Iu = Ve(
5083
5080
  const t = Z(!1), n = jt(
5084
5081
  U(
5085
5082
  t,
5086
- ke((r) => r),
5083
+ Ee((r) => r),
5087
5084
  nt()
5088
5085
  )
5089
5086
  );
5090
5087
  return Ye(t, (r) => {
5091
- r && lt(e)("props updated", {}, Et.DEBUG);
5088
+ r && lt(e)("props updated", {}, kt.DEBUG);
5092
5089
  }), { didMount: n, propsReady: t };
5093
5090
  },
5094
5091
  rt(An),
@@ -5125,16 +5122,16 @@ const no = Ve(
5125
5122
  De(e, s, o),
5126
5123
  oe(
5127
5124
  ([
5128
- [R, C, T, k, I, A, _, D],
5125
+ [R, C, T, E, I, A, _, D],
5129
5126
  L,
5130
5127
  W,
5131
5128
  P
5132
5129
  ]) => {
5133
- const Y = Nu(R), { align: K, behavior: J, offset: z } = Y, $ = k - 1, F = Eu(Y, C, $);
5130
+ const Y = Nu(R), { align: K, behavior: J, offset: z } = Y, $ = E - 1, F = ku(Y, C, $);
5134
5131
  let B = Wr(F, C.offsetTree, L) + A;
5135
5132
  K === "end" ? (B += W + Gt(C.sizeTree, F)[1] - T + P, F === $ && (B += _)) : K === "center" ? B += (W + Gt(C.sizeTree, F)[1] - T + P) / 2 : B -= I, z && (B += z);
5136
5133
  const pe = (ue) => {
5137
- S(), ue ? (D("retrying to scroll to", { location: R }, Et.DEBUG), je(p, R)) : (je(w, !0), D("list did not change, scroll successful", {}, Et.DEBUG));
5134
+ S(), ue ? (D("retrying to scroll to", { location: R }, kt.DEBUG), je(p, R)) : (je(w, !0), D("list did not change, scroll successful", {}, kt.DEBUG));
5138
5135
  };
5139
5136
  if (S(), J === "smooth") {
5140
5137
  let ue = !1;
@@ -5147,7 +5144,7 @@ const no = Ve(
5147
5144
  g = qt(U(t, Xx(150)), pe);
5148
5145
  return x = setTimeout(() => {
5149
5146
  S();
5150
- }, 1200), je(l, !0), D("scrolling from index to", { behavior: J, index: F, top: B }, Et.DEBUG), { behavior: J, top: B };
5147
+ }, 1200), je(l, !0), D("scrolling from index to", { behavior: J, index: F, top: B }, kt.DEBUG), { behavior: J, top: B };
5151
5148
  }
5152
5149
  )
5153
5150
  ),
@@ -5187,7 +5184,7 @@ const ro = Ve(
5187
5184
  U(
5188
5185
  i,
5189
5186
  De(l),
5190
- ke(([d, f]) => !!f),
5187
+ Ee(([d, f]) => !!f),
5191
5188
  rn(!1)
5192
5189
  ),
5193
5190
  a
@@ -5195,7 +5192,7 @@ const ro = Ve(
5195
5192
  U(
5196
5193
  i,
5197
5194
  De(l),
5198
- ke(([d, f]) => !!f),
5195
+ Ee(([d, f]) => !!f),
5199
5196
  rn(!1)
5200
5197
  ),
5201
5198
  u
@@ -5203,7 +5200,7 @@ const ro = Ve(
5203
5200
  U(
5204
5201
  dt(t, i),
5205
5202
  De(a, n, e, u),
5206
- ke(([[, d], f, { sizeTree: h }, p, w]) => d && (!Ze(h) || oa(p)) && !f && !w),
5203
+ Ee(([[, d], f, { sizeTree: h }, p, w]) => d && (!Ze(h) || oa(p)) && !f && !w),
5207
5204
  De(l)
5208
5205
  ),
5209
5206
  ([, d]) => {
@@ -5239,12 +5236,12 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5239
5236
  }, Qx = 0, oo = Ve(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
5240
5237
  const i = Z(!1), a = Z(!0), l = Be(), u = Be(), d = Z(4), f = Z(Qx), h = yt(
5241
5238
  U(
5242
- Ii(U(Re(o), qn(1), rn(!0)), U(Re(o), qn(1), rn(!1), El(100))),
5239
+ Ii(U(Re(o), qn(1), rn(!0)), U(Re(o), qn(1), rn(!1), kl(100))),
5243
5240
  nt()
5244
5241
  ),
5245
5242
  !1
5246
5243
  ), p = yt(
5247
- U(Ii(U(n, rn(!0)), U(n, rn(!1), El(200))), nt()),
5244
+ U(Ii(U(n, rn(!0)), U(n, rn(!1), kl(200))), nt()),
5248
5245
  !1
5249
5246
  );
5250
5247
  fe(
@@ -5258,7 +5255,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5258
5255
  const w = jt(
5259
5256
  U(
5260
5257
  dt(r, Re(s), Re(t), Re(e), Re(d)),
5261
- sn((y, [{ scrollHeight: S, scrollTop: R }, C, T, k, I]) => {
5258
+ sn((y, [{ scrollHeight: S, scrollTop: R }, C, T, E, I]) => {
5262
5259
  const A = R + C - S > -I, _ = {
5263
5260
  scrollHeight: S,
5264
5261
  scrollTop: R,
@@ -5311,7 +5308,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5311
5308
  },
5312
5309
  { changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
5313
5310
  ),
5314
- ke((y) => y.changed),
5311
+ Ee((y) => y.changed),
5315
5312
  oe((y) => y.jump)
5316
5313
  ),
5317
5314
  0
@@ -5341,7 +5338,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5341
5338
  return fe(
5342
5339
  U(
5343
5340
  h,
5344
- ke((y) => !y),
5341
+ Ee((y) => !y),
5345
5342
  rn(0)
5346
5343
  ),
5347
5344
  x
@@ -5350,7 +5347,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5350
5347
  o,
5351
5348
  mn(100),
5352
5349
  De(h),
5353
- ke(([y, S]) => !!S),
5350
+ Ee(([y, S]) => !!S),
5354
5351
  sn(([y, S], [R]) => [S, R], [0, 0]),
5355
5352
  oe(([y, S]) => S - y)
5356
5353
  ),
@@ -5404,15 +5401,15 @@ const da = Ve(
5404
5401
  S
5405
5402
  ]) => {
5406
5403
  const R = d - y, C = g + x, T = Math.max(h - R, 0);
5407
- let k = _l;
5404
+ let E = _l;
5408
5405
  const I = Pl(S, Fo), A = Pl(S, zo);
5409
- return p -= y, p += h + x, w += h + x, w -= y, p > d + C - I && (k = Vr), w < d - T + f + A && (k = Mr), k !== _l ? [
5410
- Math.max(R - h - jl(v, Fo, k) - I, 0),
5411
- R - T - x + f + jl(v, zo, k) + A
5406
+ return p -= y, p += h + x, w += h + x, w -= y, p > d + C - I && (E = Vr), w < d - T + f + A && (E = Mr), E !== _l ? [
5407
+ Math.max(R - h - jl(v, Fo, E) - I, 0),
5408
+ R - T - x + f + jl(v, zo, E) + A
5412
5409
  ] : null;
5413
5410
  }
5414
5411
  ),
5415
- ke((d) => d != null),
5412
+ Ee((d) => d != null),
5416
5413
  nt(Ur)
5417
5414
  ),
5418
5415
  [0, 0]
@@ -5432,7 +5429,7 @@ const da = Ve(
5432
5429
  );
5433
5430
  function ev(e, t, n) {
5434
5431
  if (fs(t)) {
5435
- const r = ku(e, t);
5432
+ const r = Eu(e, t);
5436
5433
  return [
5437
5434
  { index: Gt(t.groupOffsetTree, r)[0], offset: 0, size: 0 },
5438
5435
  { data: n == null ? void 0 : n[0], index: r, offset: 0, size: 0 }
@@ -5451,7 +5448,7 @@ const Qs = {
5451
5448
  topListHeight: 0,
5452
5449
  totalCount: 0
5453
5450
  };
5454
- function ko(e, t, n, r, o, s) {
5451
+ function Eo(e, t, n, r, o, s) {
5455
5452
  const { lastIndex: i, lastOffset: a, lastSize: l } = o;
5456
5453
  let u = 0, d = 0;
5457
5454
  if (e.length > 0) {
@@ -5486,7 +5483,7 @@ function _u(e, t, n, r, o, s) {
5486
5483
  offset: 0,
5487
5484
  size: 0
5488
5485
  }));
5489
- return ko(u, [], a, o, n, r);
5486
+ return Eo(u, [], a, o, n, r);
5490
5487
  }
5491
5488
  function Ol(e, t, n) {
5492
5489
  if (e.length === 0)
@@ -5542,15 +5539,15 @@ const er = Ve(
5542
5539
  Re(n),
5543
5540
  e
5544
5541
  ),
5545
- ke(([T, k, , I, , , , , , , A]) => {
5542
+ Ee(([T, E, , I, , , , , , , A]) => {
5546
5543
  const _ = A && A.length !== I;
5547
- return T && !k && !_;
5544
+ return T && !E && !_;
5548
5545
  }),
5549
5546
  oe(
5550
5547
  ([
5551
5548
  ,
5552
5549
  ,
5553
- [T, k],
5550
+ [T, E],
5554
5551
  I,
5555
5552
  A,
5556
5553
  _,
@@ -5563,10 +5560,10 @@ const er = Ve(
5563
5560
  const K = A, { offsetTree: J, sizeTree: z } = K, $ = lt(g);
5564
5561
  if (I === 0)
5565
5562
  return { ...Qs, totalCount: I };
5566
- if (T === 0 && k === 0)
5563
+ if (T === 0 && E === 0)
5567
5564
  return $ === 0 ? { ...Qs, totalCount: I } : _u($, _, A, W, P, Y || []);
5568
5565
  if (Ze(z))
5569
- return $ > 0 ? null : ko(
5566
+ return $ > 0 ? null : Eo(
5570
5567
  ev(ua(_, I), K, Y),
5571
5568
  [],
5572
5569
  I,
@@ -5585,8 +5582,8 @@ const er = Ve(
5585
5582
  }
5586
5583
  }
5587
5584
  if (!D)
5588
- return ko([], F, I, P, K, W);
5589
- const B = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = Hx(J, T, k, B);
5585
+ return Eo([], F, I, P, K, W);
5586
+ const B = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = Hx(J, T, E, B);
5590
5587
  if (pe.length === 0)
5591
5588
  return null;
5592
5589
  const ue = I - 1, ee = us([], (Ie) => {
@@ -5601,15 +5598,15 @@ const er = Ve(
5601
5598
  }
5602
5599
  Q < B && (O += (B - Q) * q, Q = B);
5603
5600
  const ce = Math.min(Ce.end, ue);
5604
- for (let ie = Q; ie <= ce && !(O >= k); ie++)
5601
+ for (let ie = Q; ie <= ce && !(O >= E); ie++)
5605
5602
  Ie.push({ data: Y == null ? void 0 : Y[ie], index: ie, offset: O, size: q }), O += q + P;
5606
5603
  }
5607
5604
  });
5608
- return ko(ee, F, I, P, K, W);
5605
+ return Eo(ee, F, I, P, K, W);
5609
5606
  }
5610
5607
  ),
5611
5608
  //@ts-expect-error filter needs to be fixed
5612
- ke((T) => T !== null),
5609
+ Ee((T) => T !== null),
5613
5610
  nt()
5614
5611
  ),
5615
5612
  Qs
@@ -5617,7 +5614,7 @@ const er = Ve(
5617
5614
  fe(
5618
5615
  U(
5619
5616
  e,
5620
- ke(oa),
5617
+ Ee(oa),
5621
5618
  oe((T) => T == null ? void 0 : T.length)
5622
5619
  ),
5623
5620
  o
@@ -5643,10 +5640,10 @@ const er = Ve(
5643
5640
  const S = jt(
5644
5641
  U(
5645
5642
  y,
5646
- ke(({ items: T }) => T.length > 0),
5643
+ Ee(({ items: T }) => T.length > 0),
5647
5644
  De(o, e),
5648
- ke(([{ items: T }, k]) => T[T.length - 1].originalIndex === k - 1),
5649
- oe(([, T, k]) => [T - 1, k]),
5645
+ Ee(([{ items: T }, E]) => T[T.length - 1].originalIndex === E - 1),
5646
+ oe(([, T, E]) => [T - 1, E]),
5650
5647
  nt(Ur),
5651
5648
  oe(([T]) => T)
5652
5649
  )
@@ -5654,23 +5651,23 @@ const er = Ve(
5654
5651
  U(
5655
5652
  y,
5656
5653
  mn(200),
5657
- ke(({ items: T, topItems: k }) => T.length > 0 && T[0].originalIndex === k.length),
5654
+ Ee(({ items: T, topItems: E }) => T.length > 0 && T[0].originalIndex === E.length),
5658
5655
  oe(({ items: T }) => T[0].index),
5659
5656
  nt()
5660
5657
  )
5661
5658
  ), C = jt(
5662
5659
  U(
5663
5660
  y,
5664
- ke(({ items: T }) => T.length > 0),
5661
+ Ee(({ items: T }) => T.length > 0),
5665
5662
  oe(({ items: T }) => {
5666
- let k = 0, I = T.length - 1;
5667
- for (; T[k].type === "group" && k < I; )
5668
- k++;
5669
- for (; T[I].type === "group" && I > k; )
5663
+ let E = 0, I = T.length - 1;
5664
+ for (; T[E].type === "group" && E < I; )
5665
+ E++;
5666
+ for (; T[I].type === "group" && I > E; )
5670
5667
  I--;
5671
5668
  return {
5672
5669
  endIndex: T[I].index,
5673
- startIndex: T[k].index
5670
+ startIndex: T[E].index
5674
5671
  };
5675
5672
  }),
5676
5673
  nt(Tu)
@@ -5707,7 +5704,7 @@ const er = Ve(
5707
5704
  const n = Z(!1), r = yt(
5708
5705
  U(
5709
5706
  dt(n, e, t),
5710
- ke(([o]) => o),
5707
+ Ee(([o]) => o),
5711
5708
  oe(([, o, s]) => Math.max(0, o - s)),
5712
5709
  mn(0),
5713
5710
  nt()
@@ -5739,25 +5736,25 @@ const er = Ve(
5739
5736
  De(t, l, n, s, o, r, a),
5740
5737
  De(e),
5741
5738
  oe(([[f, h, p, w, v, g, x, y], S]) => {
5742
- const { align: R, behavior: C, calculateViewLocation: T = nv, done: k, ...I } = f, A = Eu(f, h, w - 1), _ = Wr(A, h.offsetTree, S) + v + g, D = _ + Gt(h.sizeTree, A)[1], L = y + g, W = y + p - x, P = T({
5739
+ const { align: R, behavior: C, calculateViewLocation: T = nv, done: E, ...I } = f, A = ku(f, h, w - 1), _ = Wr(A, h.offsetTree, S) + v + g, D = _ + Gt(h.sizeTree, A)[1], L = y + g, W = y + p - x, P = T({
5743
5740
  itemBottom: D,
5744
5741
  itemTop: _,
5745
5742
  locationParams: { align: R, behavior: C, ...I },
5746
5743
  viewportBottom: W,
5747
5744
  viewportTop: L
5748
5745
  });
5749
- return P ? k && qt(
5746
+ return P ? E && qt(
5750
5747
  U(
5751
5748
  i,
5752
- ke((Y) => !Y),
5749
+ Ee((Y) => !Y),
5753
5750
  // skips the initial publish of false, and the cleanup call.
5754
5751
  // but if scrollingInProgress is true, we skip the initial publish.
5755
5752
  qn(lt(i) ? 1 : 2)
5756
5753
  ),
5757
- k
5758
- ) : k && k(), P;
5754
+ E
5755
+ ) : E && E(), P;
5759
5756
  }),
5760
- ke((f) => f !== null)
5757
+ Ee((f) => f !== null)
5761
5758
  ),
5762
5759
  u
5763
5760
  ), {
@@ -5795,35 +5792,35 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5795
5792
  U(
5796
5793
  dt(U(Re(t), qn(1)), l),
5797
5794
  De(Re(w), s, a, f),
5798
- oe(([[C, T], k, I, A, _]) => {
5795
+ oe(([[C, T], E, I, A, _]) => {
5799
5796
  let D = T && A, L = "auto";
5800
- return D && (L = rv(k, I || _), D = D && !!L), { followOutputBehavior: L, shouldFollow: D, totalCount: C };
5797
+ return D && (L = rv(E, I || _), D = D && !!L), { followOutputBehavior: L, shouldFollow: D, totalCount: C };
5801
5798
  }),
5802
- ke(({ shouldFollow: C }) => C)
5799
+ Ee(({ shouldFollow: C }) => C)
5803
5800
  ),
5804
5801
  ({ followOutputBehavior: C, totalCount: T }) => {
5805
5802
  g && (g(), g = null), lt(n) ? requestAnimationFrame(() => {
5806
- lt(d)("following output to ", { totalCount: T }, Et.DEBUG), x(C);
5803
+ lt(d)("following output to ", { totalCount: T }, kt.DEBUG), x(C);
5807
5804
  }) : g = qt(e, () => {
5808
- lt(d)("following output to ", { totalCount: T }, Et.DEBUG), x(C), g = null;
5805
+ lt(d)("following output to ", { totalCount: T }, kt.DEBUG), x(C), g = null;
5809
5806
  });
5810
5807
  }
5811
5808
  );
5812
5809
  function y(C) {
5813
- const T = qt(o, (k) => {
5814
- C && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !g && (lt(d)("scrolling to bottom due to increased size", {}, Et.DEBUG), x("auto"));
5810
+ const T = qt(o, (E) => {
5811
+ C && !E.atBottom && E.notAtBottomBecause === "SIZE_INCREASED" && !g && (lt(d)("scrolling to bottom due to increased size", {}, kt.DEBUG), x("auto"));
5815
5812
  });
5816
5813
  setTimeout(T, 100);
5817
5814
  }
5818
5815
  Ye(
5819
5816
  U(
5820
5817
  dt(Re(w), t, u),
5821
- ke(([C, , T]) => C && T),
5818
+ Ee(([C, , T]) => C && T),
5822
5819
  sn(
5823
5820
  ({ value: C }, [, T]) => ({ refreshed: C === T, value: T }),
5824
5821
  { refreshed: !1, value: 0 }
5825
5822
  ),
5826
- ke(({ refreshed: C }) => C),
5823
+ Ee(({ refreshed: C }) => C),
5827
5824
  De(w, t)
5828
5825
  ),
5829
5826
  ([, C]) => {
@@ -5851,8 +5848,8 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5851
5848
  U(
5852
5849
  dt(U(R, qn(1)), l),
5853
5850
  De(Re(S), a, f, h),
5854
- oe(([[C, T], k, I, A, _]) => T && I && (k == null ? void 0 : k({ context: _, totalCount: C, scrollingInProgress: A }))),
5855
- ke((C) => !!C),
5851
+ oe(([[C, T], E, I, A, _]) => T && I && (E == null ? void 0 : E({ context: _, totalCount: C, scrollingInProgress: A }))),
5852
+ Ee((C) => !!C),
5856
5853
  mn(0)
5857
5854
  ),
5858
5855
  (C) => {
@@ -5880,7 +5877,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5880
5877
  U(
5881
5878
  a,
5882
5879
  De(s),
5883
- ke(([, l]) => l !== 0),
5880
+ Ee(([, l]) => l !== 0),
5884
5881
  De(o, r, t, n, e),
5885
5882
  oe(([[, l], u, d, f, h, p = []]) => _u(l, u, d, f, h, p))
5886
5883
  ),
@@ -5895,7 +5892,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5895
5892
  U(
5896
5893
  e,
5897
5894
  De(r),
5898
- ke(([, o]) => o !== 0),
5895
+ Ee(([, o]) => o !== 0),
5899
5896
  oe(([, o]) => ({ top: o }))
5900
5897
  ),
5901
5898
  (o) => {
@@ -5903,7 +5900,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5903
5900
  U(
5904
5901
  n,
5905
5902
  qn(1),
5906
- ke((s) => s.items.length > 1)
5903
+ Ee((s) => s.items.length > 1)
5907
5904
  ),
5908
5905
  () => {
5909
5906
  requestAnimationFrame(() => {
@@ -5925,7 +5922,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5925
5922
  U(
5926
5923
  e,
5927
5924
  De(r, t, n),
5928
- ke(([o, s]) => !!s),
5925
+ Ee(([o, s]) => !!s),
5929
5926
  oe(([o, s, i, a]) => {
5930
5927
  const { enter: l, exit: u } = s;
5931
5928
  if (i) {
@@ -5997,11 +5994,11 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5997
5994
  const R = Wx(w.sizeTree);
5998
5995
  g && x !== null && y !== null && (v = x.scrollTop - y.offsetTop), v -= S, p({ ranges: R, scrollTop: v });
5999
5996
  }
6000
- ), fe(U(d, ke(oa), oe(lv)), o), fe(
5997
+ ), fe(U(d, Ee(oa), oe(lv)), o), fe(
6001
5998
  U(
6002
5999
  s,
6003
6000
  De(d),
6004
- ke(([, p]) => p !== void 0),
6001
+ Ee(([, p]) => p !== void 0),
6005
6002
  nt(),
6006
6003
  oe(([, p]) => p.ranges)
6007
6004
  ),
@@ -6021,7 +6018,7 @@ const cv = Ve(([{ topItemsIndexes: e }]) => {
6021
6018
  return fe(
6022
6019
  U(
6023
6020
  t,
6024
- ke((n) => n >= 0),
6021
+ Ee((n) => n >= 0),
6025
6022
  oe((n) => Array.from({ length: n }).map((r, o) => o))
6026
6023
  ),
6027
6024
  e
@@ -6045,17 +6042,17 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6045
6042
  l,
6046
6043
  De(i),
6047
6044
  sn(
6048
- ([, x, y, S], [{ bottom: R, items: C, offsetBottom: T, totalCount: k }, I]) => {
6045
+ ([, x, y, S], [{ bottom: R, items: C, offsetBottom: T, totalCount: E }, I]) => {
6049
6046
  const A = R + T;
6050
6047
  let _ = 0;
6051
- return y === k && x.length > 0 && C.length > 0 && (C[0].originalIndex === 0 && x[0].originalIndex === 0 || (_ = A - S, _ !== 0 && (_ += I))), [_, C, k, A];
6048
+ return y === E && x.length > 0 && C.length > 0 && (C[0].originalIndex === 0 && x[0].originalIndex === 0 || (_ = A - S, _ !== 0 && (_ += I))), [_, C, E, A];
6052
6049
  },
6053
6050
  [0, [], 0, 0]
6054
6051
  ),
6055
- ke(([x]) => x !== 0),
6052
+ Ee(([x]) => x !== 0),
6056
6053
  De(r, a, n, o, p, w),
6057
- ke(([, x, y, S, , , R]) => !R && !S && x !== 0 && y === Vr),
6058
- oe(([[x], , , , , y]) => (y("Upward scrolling compensation", { amount: x }, Et.DEBUG), x))
6054
+ Ee(([, x, y, S, , , R]) => !R && !S && x !== 0 && y === Vr),
6055
+ oe(([[x], , , , , y]) => (y("Upward scrolling compensation", { amount: x }, kt.DEBUG), x))
6059
6056
  )
6060
6057
  );
6061
6058
  function g(x) {
@@ -6066,7 +6063,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6066
6063
  }), Ye(
6067
6064
  U(
6068
6065
  dt(yt(s, !1), e, w),
6069
- ke(([x, y, S]) => !x && !S && y !== 0),
6066
+ Ee(([x, y, S]) => !x && !S && y !== 0),
6070
6067
  oe(([x, y]) => y),
6071
6068
  mn(1)
6072
6069
  ),
@@ -6082,21 +6079,21 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6082
6079
  u,
6083
6080
  De(h, d),
6084
6081
  oe(([x, { groupIndices: y, lastSize: S, sizeTree: R }, C]) => {
6085
- function T(k) {
6086
- return k * (S + C);
6082
+ function T(E) {
6083
+ return E * (S + C);
6087
6084
  }
6088
6085
  if (y.length === 0)
6089
6086
  return T(x);
6090
6087
  {
6091
- let k = 0;
6088
+ let E = 0;
6092
6089
  const I = Hr(R, 0);
6093
6090
  let A = 0, _ = 0;
6094
6091
  for (; A < x; ) {
6095
- A++, k += I;
6092
+ A++, E += I;
6096
6093
  let D = y.length === _ + 1 ? 1 / 0 : y[_ + 1] - y[_] - 1;
6097
- A + D > x && (k -= I, D = x - A + 1), A += D, k += T(D), _++;
6094
+ A + D > x && (E -= I, D = x - A + 1), A += D, E += T(D), _++;
6098
6095
  }
6099
- return k;
6096
+ return E;
6100
6097
  }
6101
6098
  })
6102
6099
  ),
@@ -6172,7 +6169,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6172
6169
  { listState: y, topItemsIndexes: S, ...R },
6173
6170
  { scrollToIndex: C },
6174
6171
  T,
6175
- { topItemCount: k },
6172
+ { topItemCount: E },
6176
6173
  { groupCounts: I },
6177
6174
  A
6178
6175
  ]) => (fe(R.rangeChanged, A.scrollSeekRangeChanged), fe(
@@ -6192,7 +6189,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6192
6189
  initialTopMostItemIndex: p,
6193
6190
  scrolledToInitialItem: w,
6194
6191
  sizeRanges: a,
6195
- topItemCount: k,
6192
+ topItemCount: E,
6196
6193
  topItemsIndexes: S,
6197
6194
  // input
6198
6195
  totalCount: d,
@@ -6262,12 +6259,12 @@ function $u(e, t, n) {
6262
6259
  return i.reduce((x, y) => (x[y] = Nx(g[t.events[y]]), x), {});
6263
6260
  }
6264
6261
  const f = V.forwardRef((g, x) => {
6265
- const { children: y, ...S } = g, [R] = V.useState(() => us(_x(e), (k) => {
6266
- l(k, S);
6267
- })), [C] = V.useState(kl(d, R));
6262
+ const { children: y, ...S } = g, [R] = V.useState(() => us(_x(e), (E) => {
6263
+ l(E, S);
6264
+ })), [C] = V.useState(El(d, R));
6268
6265
  uo(() => {
6269
- for (const k of i)
6270
- k in S && Ye(C[k], S[k]);
6266
+ for (const E of i)
6267
+ E in S && Ye(C[E], S[E]);
6271
6268
  return () => {
6272
6269
  Object.values(C).map(sa);
6273
6270
  };
@@ -6295,7 +6292,7 @@ function $u(e, t, n) {
6295
6292
  () => lt(x)
6296
6293
  );
6297
6294
  }, w = (g) => {
6298
- const x = V.useContext(a)[g], [y, S] = V.useState(kl(lt, x));
6295
+ const x = V.useContext(a)[g], [y, S] = V.useState(El(lt, x));
6299
6296
  return uo(
6300
6297
  () => Ye(x, (R) => {
6301
6298
  R !== y && S(Rl(R));
@@ -6424,7 +6421,7 @@ const mv = /* @__PURE__ */ Ve(() => {
6424
6421
  ma("deviation", (P) => {
6425
6422
  x !== P && y(P);
6426
6423
  });
6427
- const S = Ae("EmptyPlaceholder"), R = Ae("ScrollSeekPlaceholder") || xv, C = Ae("ListComponent"), T = Ae("ItemComponent"), k = Ae("GroupComponent"), I = Ae("computeItemKey"), A = Ae("isSeeking"), _ = Ae("groupIndices").length > 0, D = Ae("alignToBottom"), L = Ae("initialItemFinalLocationReached"), W = e ? {} : {
6424
+ const S = Ae("EmptyPlaceholder"), R = Ae("ScrollSeekPlaceholder") || xv, C = Ae("ListComponent"), T = Ae("ItemComponent"), E = Ae("GroupComponent"), I = Ae("computeItemKey"), A = Ae("isSeeking"), _ = Ae("groupIndices").length > 0, D = Ae("alignToBottom"), L = Ae("initialItemFinalLocationReached"), W = e ? {} : {
6428
6425
  boxSizing: "border-box",
6429
6426
  ...v ? {
6430
6427
  display: "inline-block",
@@ -6460,9 +6457,9 @@ const mv = /* @__PURE__ */ Ve(() => {
6460
6457
  ...P.type === "group" ? {} : { groupIndex: P.groupIndex }
6461
6458
  }
6462
6459
  ) : P.type === "group" ? /* @__PURE__ */ bo(
6463
- k,
6460
+ E,
6464
6461
  {
6465
- ...bt(k, u),
6462
+ ...bt(E, u),
6466
6463
  "data-index": Y,
6467
6464
  "data-item-index": P.index,
6468
6465
  "data-known-size": P.size,
@@ -6593,7 +6590,7 @@ function Vu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
6593
6590
  );
6594
6591
  });
6595
6592
  }
6596
- const kv = ({ children: e }) => {
6593
+ const Ev = ({ children: e }) => {
6597
6594
  const t = V.useContext(Fu), n = zt("viewportHeight"), r = zt("fixedItemHeight"), o = Ae("alignToBottom"), s = Ae("horizontalDirection"), i = V.useMemo(
6598
6595
  () => gu(n, (l) => Tn(l, s ? "width" : "height")),
6599
6596
  [n, s]
@@ -6601,7 +6598,7 @@ const kv = ({ children: e }) => {
6601
6598
  return V.useEffect(() => {
6602
6599
  t && (n(t.viewportHeight), r(t.itemHeight));
6603
6600
  }, [t, n, r]), /* @__PURE__ */ c.jsx("div", { "data-viewport-type": "element", ref: a, style: hs(o), children: e });
6604
- }, Ev = ({ children: e }) => {
6601
+ }, kv = ({ children: e }) => {
6605
6602
  const t = V.useContext(Fu), n = zt("windowViewportRect"), r = zt("fixedItemHeight"), o = Ae("customScrollParent"), s = vu(
6606
6603
  n,
6607
6604
  o,
@@ -6617,7 +6614,7 @@ const kv = ({ children: e }) => {
6617
6614
  const t = Ae("useWindowScroll"), n = Ae("topItemsIndexes").length > 0, r = Ae("customScrollParent"), o = Ae("context");
6618
6615
  return /* @__PURE__ */ c.jsxs(r || t ? jv : _v, { ...e, context: o, children: [
6619
6616
  n && /* @__PURE__ */ c.jsx(Iv, { children: /* @__PURE__ */ c.jsx(Ll, { showTopList: !0 }) }),
6620
- /* @__PURE__ */ c.jsxs(r || t ? Ev : kv, { children: [
6617
+ /* @__PURE__ */ c.jsxs(r || t ? kv : Ev, { children: [
6621
6618
  /* @__PURE__ */ c.jsx(Tv, {}),
6622
6619
  /* @__PURE__ */ c.jsx(Ll, {}),
6623
6620
  /* @__PURE__ */ c.jsx(Rv, {})
@@ -6767,12 +6764,12 @@ const $v = /* @__PURE__ */ Ve(
6767
6764
  { customScrollParent: g, useWindowScroll: x, windowScrollContainerState: y, windowScrollTo: S, windowViewportRect: R },
6768
6765
  C
6769
6766
  ]) => {
6770
- const T = Z(0), k = Z(0), I = Z($l), A = Z({ height: 0, width: 0 }), _ = Z({ height: 0, width: 0 }), D = Be(), L = Be(), W = Z(0), P = Z(null), Y = Z({ column: 0, row: 0 }), K = Be(), J = Be(), z = Z(!1), $ = Z(0), F = Z(!0), B = Z(!1), pe = Z(!1);
6767
+ const T = Z(0), E = Z(0), I = Z($l), A = Z({ height: 0, width: 0 }), _ = Z({ height: 0, width: 0 }), D = Be(), L = Be(), W = Z(0), P = Z(null), Y = Z({ column: 0, row: 0 }), K = Be(), J = Be(), z = Z(!1), $ = Z(0), F = Z(!0), B = Z(!1), pe = Z(!1);
6771
6768
  Ye(
6772
6769
  U(
6773
6770
  w,
6774
6771
  De($),
6775
- ke(([O, Q]) => !!Q)
6772
+ Ee(([O, Q]) => !!Q)
6776
6773
  ),
6777
6774
  () => {
6778
6775
  je(F, !1);
@@ -6780,7 +6777,7 @@ const $v = /* @__PURE__ */ Ve(
6780
6777
  ), Ye(
6781
6778
  U(
6782
6779
  dt(w, F, _, A, $, B),
6783
- ke(([O, Q, q, ce, , ie]) => O && !Q && q.height !== 0 && ce.height !== 0 && !ie)
6780
+ Ee(([O, Q, q, ce, , ie]) => O && !Q && q.height !== 0 && ce.height !== 0 && !ie)
6784
6781
  ),
6785
6782
  ([, , , , O]) => {
6786
6783
  je(B, !0), ca(1, () => {
@@ -6792,15 +6789,15 @@ const $v = /* @__PURE__ */ Ve(
6792
6789
  ), fe(
6793
6790
  U(
6794
6791
  J,
6795
- ke((O) => O != null && O.scrollTop > 0),
6792
+ Ee((O) => O != null && O.scrollTop > 0),
6796
6793
  rn(0)
6797
6794
  ),
6798
- k
6795
+ E
6799
6796
  ), Ye(
6800
6797
  U(
6801
6798
  w,
6802
6799
  De(J),
6803
- ke(([, O]) => O != null)
6800
+ Ee(([, O]) => O != null)
6804
6801
  ),
6805
6802
  ([, O]) => {
6806
6803
  O && (je(A, O.viewport), je(_, O.item), je(Y, O.gap), O.scrollTop > 0 && (je(z, !0), qt(U(u, qn(1)), (Q) => {
@@ -6838,12 +6835,12 @@ const $v = /* @__PURE__ */ Ve(
6838
6835
  Re(_, fo),
6839
6836
  Re(A, fo),
6840
6837
  Re(P),
6841
- Re(k),
6838
+ Re(E),
6842
6839
  Re(z),
6843
6840
  Re(F),
6844
6841
  Re($)
6845
6842
  ),
6846
- ke(([, , , , , , , O]) => !O),
6843
+ Ee(([, , , , , , , O]) => !O),
6847
6844
  oe(
6848
6845
  ([
6849
6846
  O,
@@ -6876,14 +6873,14 @@ const $v = /* @__PURE__ */ Ve(
6876
6873
  ), fe(
6877
6874
  U(
6878
6875
  P,
6879
- ke((O) => O !== null),
6876
+ Ee((O) => O !== null),
6880
6877
  oe((O) => O.length)
6881
6878
  ),
6882
6879
  T
6883
6880
  ), fe(
6884
6881
  U(
6885
6882
  dt(A, _, I, Y),
6886
- ke(([O, Q, { items: q }]) => q.length > 0 && Q.height !== 0 && O.height !== 0),
6883
+ Ee(([O, Q, { items: q }]) => q.length > 0 && Q.height !== 0 && O.height !== 0),
6887
6884
  oe(([O, Q, { items: q }, ce]) => {
6888
6885
  const { bottom: ie, top: $e } = Hl(O, ce, Q, q);
6889
6886
  return [$e, ie];
@@ -6904,9 +6901,9 @@ const $v = /* @__PURE__ */ Ve(
6904
6901
  const ee = jt(
6905
6902
  U(
6906
6903
  dt(I, T),
6907
- ke(([{ items: O }]) => O.length > 0),
6904
+ Ee(([{ items: O }]) => O.length > 0),
6908
6905
  De(ue),
6909
- ke(([[O, Q], q]) => {
6906
+ Ee(([[O, Q], q]) => {
6910
6907
  const ce = O.items[O.items.length - 1].index === Q - 1;
6911
6908
  return (q || O.bottom > 0 && O.itemHeight > 0 && O.offsetBottom === 0 && O.items.length === Q) && ce;
6912
6909
  }),
@@ -6916,7 +6913,7 @@ const $v = /* @__PURE__ */ Ve(
6916
6913
  ), Ie = jt(
6917
6914
  U(
6918
6915
  Re(I),
6919
- ke(({ items: O }) => O.length > 0 && O[0].index === 0),
6916
+ Ee(({ items: O }) => O.length > 0 && O[0].index === 0),
6920
6917
  rn(0),
6921
6918
  nt()
6922
6919
  )
@@ -6924,7 +6921,7 @@ const $v = /* @__PURE__ */ Ve(
6924
6921
  U(
6925
6922
  Re(I),
6926
6923
  De(z),
6927
- ke(([{ items: O }, Q]) => O.length > 0 && !Q),
6924
+ Ee(([{ items: O }, Q]) => O.length > 0 && !Q),
6928
6925
  oe(([{ items: O }]) => ({
6929
6926
  endIndex: O[O.length - 1].index,
6930
6927
  startIndex: O[0].index
@@ -6969,7 +6966,7 @@ const $v = /* @__PURE__ */ Ve(
6969
6966
  gap: Y,
6970
6967
  headerHeight: s,
6971
6968
  increaseViewportBy: e,
6972
- initialItemCount: k,
6969
+ initialItemCount: E,
6973
6970
  itemDimensions: _,
6974
6971
  overscan: n,
6975
6972
  restoreStateFrom: J,
@@ -7200,7 +7197,7 @@ const Fv = /* @__PURE__ */ Ve(() => {
7200
7197
  Kv
7201
7198
  ), qv = /* @__PURE__ */ Wu({ useEmitter: qu, useEmitterValue: st, usePublisher: Bt }), Gv = /* @__PURE__ */ Vu({ useEmitter: qu, useEmitterValue: st, usePublisher: Bt });
7202
7199
  function Ul(e, t, n) {
7203
- return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Et.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
7200
+ return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
7204
7201
  }
7205
7202
  const Yv = ns(
7206
7203
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
@@ -7383,7 +7380,7 @@ var tw = [
7383
7380
  "span",
7384
7381
  "svg",
7385
7382
  "ul"
7386
- ], Ee = tw.reduce((e, t) => {
7383
+ ], ke = tw.reduce((e, t) => {
7387
7384
  const n = vr(`Primitive.${t}`), r = m.forwardRef((o, s) => {
7388
7385
  const { asChild: i, ...a } = o, l = i ? n : t;
7389
7386
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ c.jsx(l, { ...a, ref: s });
@@ -7490,7 +7487,7 @@ var ps = "Collapsible", [aw, WT] = fn(ps), [lw, xa] = aw(ps), Yu = m.forwardRef(
7490
7487
  open: l,
7491
7488
  onOpenToggle: m.useCallback(() => u((d) => !d), [u]),
7492
7489
  children: /* @__PURE__ */ c.jsx(
7493
- Ee.div,
7490
+ ke.div,
7494
7491
  {
7495
7492
  "data-state": wa(l),
7496
7493
  "data-disabled": s ? "" : void 0,
@@ -7507,7 +7504,7 @@ var Xu = "CollapsibleTrigger", Ju = m.forwardRef(
7507
7504
  (e, t) => {
7508
7505
  const { __scopeCollapsible: n, ...r } = e, o = xa(Xu, n);
7509
7506
  return /* @__PURE__ */ c.jsx(
7510
- Ee.button,
7507
+ ke.button,
7511
7508
  {
7512
7509
  type: "button",
7513
7510
  "aria-controls": o.contentId,
@@ -7546,7 +7543,7 @@ var uw = m.forwardRef((e, t) => {
7546
7543
  f.current = S.height, p.current = S.width, g.current || (y.style.transitionDuration = x.current.transitionDuration, y.style.animationName = x.current.animationName), l(r);
7547
7544
  }
7548
7545
  }, [i.open, r]), /* @__PURE__ */ c.jsx(
7549
- Ee.div,
7546
+ ke.div,
7550
7547
  {
7551
7548
  "data-state": wa(i.open),
7552
7549
  "data-disabled": i.disabled ? "" : void 0,
@@ -7609,8 +7606,8 @@ const Zu = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
7609
7606
  }
7610
7607
  ));
7611
7608
  Zu.displayName = "CardDescription";
7612
- const Eo = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: te("p-6 pt-0", e), ...t }));
7613
- Eo.displayName = "CardContent";
7609
+ const ko = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: te("p-6 pt-0", e), ...t }));
7610
+ ko.displayName = "CardContent";
7614
7611
  const Qu = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
7615
7612
  "div",
7616
7613
  {
@@ -7782,7 +7779,7 @@ function Jl(e, t, n, r) {
7782
7779
  text: vt(i)
7783
7780
  };
7784
7781
  }
7785
- function kw(e, t) {
7782
+ function Ew(e, t) {
7786
7783
  const n = e.match(/^(\s+)(?:```)/);
7787
7784
  if (n === null)
7788
7785
  return t;
@@ -7825,7 +7822,7 @@ class ba {
7825
7822
  fences(t) {
7826
7823
  const n = this.rules.block.fences.exec(t);
7827
7824
  if (n) {
7828
- const r = n[0], o = kw(r, n[3] || "");
7825
+ const r = n[0], o = Ew(r, n[3] || "");
7829
7826
  return {
7830
7827
  type: "code",
7831
7828
  raw: r,
@@ -7892,14 +7889,14 @@ class ba {
7892
7889
  `, 1)[0].replace(/^\t+/, (R) => " ".repeat(3 * R.length)), f = t.split(`
7893
7890
  `, 1)[0], this.options.pedantic ? (i = 2, p = d.trimLeft()) : (i = n[2].search(/[^ ]/), i = i > 4 ? 1 : i, p = d.slice(i), i += n[1].length), l = !1, !d && /^ *$/.test(f) && (r += f + `
7894
7891
  `, t = t.substring(f.length + 1), w = !0), !w) {
7895
- const R = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), k = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
7892
+ const R = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), E = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
7896
7893
  for (; t && (h = t.split(`
7897
- `, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(T.test(f) || k.test(f) || R.test(f) || C.test(t))); ) {
7894
+ `, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(T.test(f) || E.test(f) || R.test(f) || C.test(t))); ) {
7898
7895
  if (f.search(/[^ ]/) >= i || !f.trim())
7899
7896
  p += `
7900
7897
  ` + f.slice(i);
7901
7898
  else {
7902
- if (l || d.search(/[^ ]/) >= 4 || T.test(d) || k.test(d) || C.test(d))
7899
+ if (l || d.search(/[^ ]/) >= 4 || T.test(d) || E.test(d) || C.test(d))
7903
7900
  break;
7904
7901
  p += `
7905
7902
  ` + f;
@@ -8338,7 +8335,7 @@ se.breaks = {
8338
8335
  br: Qe(se.br).replace("{2,}", "*").getRegex(),
8339
8336
  text: Qe(se.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
8340
8337
  };
8341
- function Ew(e) {
8338
+ function kw(e) {
8342
8339
  return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
8343
8340
  }
8344
8341
  function Zl(e) {
@@ -8552,7 +8549,7 @@ class Rn {
8552
8549
  h = p.call({ lexer: this }, f), typeof h == "number" && h >= 0 && (d = Math.min(d, h));
8553
8550
  }), d < 1 / 0 && d >= 0 && (s = t.substring(0, d + 1));
8554
8551
  }
8555
- if (r = this.tokenizer.inlineText(s, Ew)) {
8552
+ if (r = this.tokenizer.inlineText(s, kw)) {
8556
8553
  t = t.substring(r.raw.length), r.raw.slice(-1) !== "_" && (u = r.raw.slice(-1)), l = !0, o = n[n.length - 1], o && o.type === "text" ? (o.raw += r.raw, o.text += r.text) : n.push(r);
8557
8554
  continue;
8558
8555
  }
@@ -8781,7 +8778,7 @@ class sd {
8781
8778
  return this.getNextSafeSlug(r, n.dryrun);
8782
8779
  }
8783
8780
  }
8784
- class kn {
8781
+ class En {
8785
8782
  constructor(t) {
8786
8783
  this.options = t || tr, this.options.renderer = this.options.renderer || new ya(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new od(), this.slugger = new sd();
8787
8784
  }
@@ -8789,21 +8786,21 @@ class kn {
8789
8786
  * Static Parse Method
8790
8787
  */
8791
8788
  static parse(t, n) {
8792
- return new kn(n).parse(t);
8789
+ return new En(n).parse(t);
8793
8790
  }
8794
8791
  /**
8795
8792
  * Static Parse Inline Method
8796
8793
  */
8797
8794
  static parseInline(t, n) {
8798
- return new kn(n).parseInline(t);
8795
+ return new En(n).parseInline(t);
8799
8796
  }
8800
8797
  /**
8801
8798
  * Parse Loop
8802
8799
  */
8803
8800
  parse(t, n = !0) {
8804
8801
  let r = "", o, s, i, a, l, u, d, f, h, p, w, v, g, x, y, S, R, C, T;
8805
- const k = t.length;
8806
- for (o = 0; o < k; o++) {
8802
+ const E = t.length;
8803
+ for (o = 0; o < E; o++) {
8807
8804
  if (p = t[o], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[p.type] && (T = this.options.extensions.renderers[p.type].call({ parser: this }, p), T !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(p.type))) {
8808
8805
  r += T || "";
8809
8806
  continue;
@@ -8871,7 +8868,7 @@ class kn {
8871
8868
  continue;
8872
8869
  }
8873
8870
  case "text": {
8874
- for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 < k && t[o + 1].type === "text"; )
8871
+ for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 < E && t[o + 1].type === "text"; )
8875
8872
  p = t[++o], h += `
8876
8873
  ` + (p.tokens ? this.parseInline(p.tokens) : p.text);
8877
8874
  r += n ? this.renderer.paragraph(h) : h;
@@ -9053,7 +9050,7 @@ function id(e, t) {
9053
9050
  };
9054
9051
  }
9055
9052
  function be(e, t, n) {
9056
- return id(Rn.lex, kn.parse)(e, t, n);
9053
+ return id(Rn.lex, En.parse)(e, t, n);
9057
9054
  }
9058
9055
  be.options = be.setOptions = function(e) {
9059
9056
  return be.defaults = { ...be.defaults, ...e }, fw(be.defaults), be;
@@ -9151,9 +9148,9 @@ be.walkTokens = function(e, t) {
9151
9148
  }
9152
9149
  return n;
9153
9150
  };
9154
- be.parseInline = id(Rn.lexInline, kn.parseInline);
9155
- be.Parser = kn;
9156
- be.parser = kn.parse;
9151
+ be.parseInline = id(Rn.lexInline, En.parseInline);
9152
+ be.Parser = En;
9153
+ be.parser = En.parse;
9157
9154
  be.Renderer = ya;
9158
9155
  be.TextRenderer = od;
9159
9156
  be.Lexer = Rn;
@@ -9167,7 +9164,7 @@ be.setOptions;
9167
9164
  be.use;
9168
9165
  be.walkTokens;
9169
9166
  be.parseInline;
9170
- kn.parse;
9167
+ En.parse;
9171
9168
  Rn.lex;
9172
9169
  function Ql({
9173
9170
  content: e,
@@ -9347,15 +9344,15 @@ var Lw = "DismissableLayer", Mi = "dismissableLayer.update", $w = "dismissableLa
9347
9344
  onInteractOutside: i,
9348
9345
  onDismiss: a,
9349
9346
  ...l
9350
- } = e, u = m.useContext(ld), [d, f] = m.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = m.useState({}), w = ze(t, (k) => f(k)), v = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(g), y = d ? v.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, R = y >= x, C = Hw((k) => {
9351
- const I = k.target, A = [...u.branches].some((_) => _.contains(I));
9352
- !R || A || (o == null || o(k), i == null || i(k), k.defaultPrevented || a == null || a());
9353
- }, h), T = Uw((k) => {
9354
- const I = k.target;
9355
- [...u.branches].some((_) => _.contains(I)) || (s == null || s(k), i == null || i(k), k.defaultPrevented || a == null || a());
9347
+ } = e, u = m.useContext(ld), [d, f] = m.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = m.useState({}), w = ze(t, (E) => f(E)), v = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(g), y = d ? v.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, R = y >= x, C = Hw((E) => {
9348
+ const I = E.target, A = [...u.branches].some((_) => _.contains(I));
9349
+ !R || A || (o == null || o(E), i == null || i(E), E.defaultPrevented || a == null || a());
9350
+ }, h), T = Uw((E) => {
9351
+ const I = E.target;
9352
+ [...u.branches].some((_) => _.contains(I)) || (s == null || s(E), i == null || i(E), E.defaultPrevented || a == null || a());
9356
9353
  }, h);
9357
- return Dw((k) => {
9358
- y === u.layers.size - 1 && (r == null || r(k), !k.defaultPrevented && a && (k.preventDefault(), a()));
9354
+ return Dw((E) => {
9355
+ y === u.layers.size - 1 && (r == null || r(E), !E.defaultPrevented && a && (E.preventDefault(), a()));
9359
9356
  }, h), m.useEffect(() => {
9360
9357
  if (d)
9361
9358
  return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (nc = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), rc(), () => {
@@ -9364,10 +9361,10 @@ var Lw = "DismissableLayer", Mi = "dismissableLayer.update", $w = "dismissableLa
9364
9361
  }, [d, h, n, u]), m.useEffect(() => () => {
9365
9362
  d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), rc());
9366
9363
  }, [d, u]), m.useEffect(() => {
9367
- const k = () => p({});
9368
- return document.addEventListener(Mi, k), () => document.removeEventListener(Mi, k);
9364
+ const E = () => p({});
9365
+ return document.addEventListener(Mi, E), () => document.removeEventListener(Mi, E);
9369
9366
  }, []), /* @__PURE__ */ c.jsx(
9370
- Ee.div,
9367
+ ke.div,
9371
9368
  {
9372
9369
  ...l,
9373
9370
  ref: w,
@@ -9394,7 +9391,7 @@ var zw = "DismissableLayerBranch", Bw = m.forwardRef((e, t) => {
9394
9391
  return n.branches.add(s), () => {
9395
9392
  n.branches.delete(s);
9396
9393
  };
9397
- }, [n.branches]), /* @__PURE__ */ c.jsx(Ee.div, { ...e, ref: o });
9394
+ }, [n.branches]), /* @__PURE__ */ c.jsx(ke.div, { ...e, ref: o });
9398
9395
  });
9399
9396
  Bw.displayName = zw;
9400
9397
  function Hw(e, t = globalThis == null ? void 0 : globalThis.document) {
@@ -9513,7 +9510,7 @@ var si = "focusScope.autoFocusOnMount", ii = "focusScope.autoFocusOnUnmount", oc
9513
9510
  },
9514
9511
  [n, r, p.paused]
9515
9512
  );
9516
- return /* @__PURE__ */ c.jsx(Ee.div, { tabIndex: -1, ...i, ref: h, onKeyDown: w });
9513
+ return /* @__PURE__ */ c.jsx(ke.div, { tabIndex: -1, ...i, ref: h, onKeyDown: w });
9517
9514
  });
9518
9515
  gs.displayName = Ww;
9519
9516
  function Vw(e, { select: t = !1 } = {}) {
@@ -9583,7 +9580,7 @@ var Jw = "Portal", xs = m.forwardRef((e, t) => {
9583
9580
  const { container: n, ...r } = e, [o, s] = m.useState(!1);
9584
9581
  pt(() => s(!0), []);
9585
9582
  const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
9586
- return i ? Dc.createPortal(/* @__PURE__ */ c.jsx(Ee.div, { ...r, ref: t }), i) : null;
9583
+ return i ? Dc.createPortal(/* @__PURE__ */ c.jsx(ke.div, { ...r, ref: t }), i) : null;
9587
9584
  });
9588
9585
  xs.displayName = Jw;
9589
9586
  var ai = 0;
@@ -9748,12 +9745,12 @@ var hd = ib(), ci = function() {
9748
9745
  onScrollCapture: ci,
9749
9746
  onWheelCapture: ci,
9750
9747
  onTouchMoveCapture: ci
9751
- }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, u = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, w = e.noIsolation, v = e.inert, g = e.allowPinchZoom, x = e.as, y = x === void 0 ? "div" : x, S = e.gapMode, R = dd(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, T = rb([n, t]), k = on(on({}, R), o);
9748
+ }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, u = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, w = e.noIsolation, v = e.inert, g = e.allowPinchZoom, x = e.as, y = x === void 0 ? "div" : x, S = e.gapMode, R = dd(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, T = rb([n, t]), E = on(on({}, R), o);
9752
9749
  return m.createElement(
9753
9750
  m.Fragment,
9754
9751
  null,
9755
9752
  d && m.createElement(C, { sideCar: hd, removeScrollBar: u, shards: f, noRelative: p, noIsolation: w, inert: v, setCallbacks: s, allowPinchZoom: !!g, lockRef: n, gapMode: S }),
9756
- i ? m.cloneElement(m.Children.only(a), on(on({}, k), { ref: T })) : m.createElement(y, on({}, k, { className: l, ref: T }), a)
9753
+ i ? m.cloneElement(m.Children.only(a), on(on({}, E), { ref: T })) : m.createElement(y, on({}, E, { className: l, ref: T }), a)
9757
9754
  );
9758
9755
  });
9759
9756
  vs.defaultProps = {
@@ -9948,10 +9945,10 @@ var lr = Di ? { passive: !1 } : !1, yb = function(e) {
9948
9945
  return e === "v" ? Sb(t) : Cb(t);
9949
9946
  }, xd = function(e, t) {
9950
9947
  return e === "v" ? Tb(t) : Rb(t);
9951
- }, kb = function(e, t) {
9948
+ }, Eb = function(e, t) {
9952
9949
  return e === "h" && t === "rtl" ? -1 : 1;
9953
- }, Eb = function(e, t, n, r, o) {
9954
- var s = kb(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), u = !1, d = i > 0, f = 0, h = 0;
9950
+ }, kb = function(e, t, n, r, o) {
9951
+ var s = Eb(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), u = !1, d = i > 0, f = 0, h = 0;
9955
9952
  do {
9956
9953
  if (!a)
9957
9954
  break;
@@ -9999,18 +9996,18 @@ function _b(e) {
9999
9996
  var a = m.useCallback(function(v, g) {
10000
9997
  if ("touches" in v && v.touches.length === 2 || v.type === "wheel" && v.ctrlKey)
10001
9998
  return !i.current.allowPinchZoom;
10002
- var x = go(v), y = n.current, S = "deltaX" in v ? v.deltaX : y[0] - x[0], R = "deltaY" in v ? v.deltaY : y[1] - x[1], C, T = v.target, k = Math.abs(S) > Math.abs(R) ? "h" : "v";
10003
- if ("touches" in v && k === "h" && T.type === "range")
9999
+ var x = go(v), y = n.current, S = "deltaX" in v ? v.deltaX : y[0] - x[0], R = "deltaY" in v ? v.deltaY : y[1] - x[1], C, T = v.target, E = Math.abs(S) > Math.abs(R) ? "h" : "v";
10000
+ if ("touches" in v && E === "h" && T.type === "range")
10004
10001
  return !1;
10005
- var I = dc(k, T);
10002
+ var I = dc(E, T);
10006
10003
  if (!I)
10007
10004
  return !0;
10008
- if (I ? C = k : (C = k === "v" ? "h" : "v", I = dc(k, T)), !I)
10005
+ if (I ? C = E : (C = E === "v" ? "h" : "v", I = dc(E, T)), !I)
10009
10006
  return !1;
10010
10007
  if (!r.current && "changedTouches" in v && (S || R) && (r.current = C), !C)
10011
10008
  return !0;
10012
10009
  var A = r.current || C;
10013
- return Eb(A, g, v, A === "h" ? S : R);
10010
+ return kb(A, g, v, A === "h" ? S : R);
10014
10011
  }, []), l = m.useCallback(function(v) {
10015
10012
  var g = v;
10016
10013
  if (!(!cr.length || cr[cr.length - 1] !== s)) {
@@ -10155,13 +10152,13 @@ var yd = "DialogTrigger", Sd = m.forwardRef(
10155
10152
  (e, t) => {
10156
10153
  const { __scopeDialog: n, ...r } = e, o = Zt(yd, n), s = ze(t, o.triggerRef);
10157
10154
  return /* @__PURE__ */ c.jsx(
10158
- Ee.button,
10155
+ ke.button,
10159
10156
  {
10160
10157
  type: "button",
10161
10158
  "aria-haspopup": "dialog",
10162
10159
  "aria-expanded": o.open,
10163
10160
  "aria-controls": o.contentId,
10164
- "data-state": Ea(o.open),
10161
+ "data-state": ka(o.open),
10165
10162
  ...r,
10166
10163
  ref: s,
10167
10164
  onClick: le(e.onClick, o.onOpenToggle)
@@ -10191,9 +10188,9 @@ var Fb = vr("DialogOverlay.RemoveScroll"), zb = m.forwardRef(
10191
10188
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
10192
10189
  // ie. when `Overlay` and `Content` are siblings
10193
10190
  /* @__PURE__ */ c.jsx(ws, { as: Fb, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ c.jsx(
10194
- Ee.div,
10191
+ ke.div,
10195
10192
  {
10196
- "data-state": Ea(o.open),
10193
+ "data-state": ka(o.open),
10197
10194
  ...r,
10198
10195
  ref: t,
10199
10196
  style: { pointerEvents: "auto", ...r.style }
@@ -10201,13 +10198,13 @@ var Fb = vr("DialogOverlay.RemoveScroll"), zb = m.forwardRef(
10201
10198
  ) })
10202
10199
  );
10203
10200
  }
10204
- ), Yn = "DialogContent", kd = m.forwardRef(
10201
+ ), Yn = "DialogContent", Ed = m.forwardRef(
10205
10202
  (e, t) => {
10206
10203
  const n = Cd(Yn, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Zt(Yn, e.__scopeDialog);
10207
10204
  return /* @__PURE__ */ c.jsx(Ot, { present: r || s.open, children: s.modal ? /* @__PURE__ */ c.jsx(Bb, { ...o, ref: t }) : /* @__PURE__ */ c.jsx(Hb, { ...o, ref: t }) });
10208
10205
  }
10209
10206
  );
10210
- kd.displayName = Yn;
10207
+ Ed.displayName = Yn;
10211
10208
  var Bb = m.forwardRef(
10212
10209
  (e, t) => {
10213
10210
  const n = Zt(Yn, e.__scopeDialog), r = m.useRef(null), o = ze(t, n.contentRef, r);
@@ -10215,7 +10212,7 @@ var Bb = m.forwardRef(
10215
10212
  const s = r.current;
10216
10213
  if (s) return Ta(s);
10217
10214
  }, []), /* @__PURE__ */ c.jsx(
10218
- Ed,
10215
+ kd,
10219
10216
  {
10220
10217
  ...e,
10221
10218
  ref: o,
@@ -10240,7 +10237,7 @@ var Bb = m.forwardRef(
10240
10237
  (e, t) => {
10241
10238
  const n = Zt(Yn, e.__scopeDialog), r = m.useRef(!1), o = m.useRef(!1);
10242
10239
  return /* @__PURE__ */ c.jsx(
10243
- Ed,
10240
+ kd,
10244
10241
  {
10245
10242
  ...e,
10246
10243
  ref: t,
@@ -10259,7 +10256,7 @@ var Bb = m.forwardRef(
10259
10256
  }
10260
10257
  );
10261
10258
  }
10262
- ), Ed = m.forwardRef(
10259
+ ), kd = m.forwardRef(
10263
10260
  (e, t) => {
10264
10261
  const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = Zt(Yn, n), l = m.useRef(null), u = ze(t, l);
10265
10262
  return Ca(), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
@@ -10278,7 +10275,7 @@ var Bb = m.forwardRef(
10278
10275
  id: a.contentId,
10279
10276
  "aria-describedby": a.descriptionId,
10280
10277
  "aria-labelledby": a.titleId,
10281
- "data-state": Ea(a.open),
10278
+ "data-state": ka(a.open),
10282
10279
  ...i,
10283
10280
  ref: u,
10284
10281
  onDismiss: () => a.onOpenChange(!1)
@@ -10292,17 +10289,17 @@ var Bb = m.forwardRef(
10292
10289
  ] })
10293
10290
  ] });
10294
10291
  }
10295
- ), ka = "DialogTitle", Id = m.forwardRef(
10292
+ ), Ea = "DialogTitle", Id = m.forwardRef(
10296
10293
  (e, t) => {
10297
- const { __scopeDialog: n, ...r } = e, o = Zt(ka, n);
10298
- return /* @__PURE__ */ c.jsx(Ee.h2, { id: o.titleId, ...r, ref: t });
10294
+ const { __scopeDialog: n, ...r } = e, o = Zt(Ea, n);
10295
+ return /* @__PURE__ */ c.jsx(ke.h2, { id: o.titleId, ...r, ref: t });
10299
10296
  }
10300
10297
  );
10301
- Id.displayName = ka;
10298
+ Id.displayName = Ea;
10302
10299
  var Nd = "DialogDescription", Ad = m.forwardRef(
10303
10300
  (e, t) => {
10304
10301
  const { __scopeDialog: n, ...r } = e, o = Zt(Nd, n);
10305
- return /* @__PURE__ */ c.jsx(Ee.p, { id: o.descriptionId, ...r, ref: t });
10302
+ return /* @__PURE__ */ c.jsx(ke.p, { id: o.descriptionId, ...r, ref: t });
10306
10303
  }
10307
10304
  );
10308
10305
  Ad.displayName = Nd;
@@ -10310,7 +10307,7 @@ var _d = "DialogClose", jd = m.forwardRef(
10310
10307
  (e, t) => {
10311
10308
  const { __scopeDialog: n, ...r } = e, o = Zt(_d, n);
10312
10309
  return /* @__PURE__ */ c.jsx(
10313
- Ee.button,
10310
+ ke.button,
10314
10311
  {
10315
10312
  type: "button",
10316
10313
  ...r,
@@ -10321,12 +10318,12 @@ var _d = "DialogClose", jd = m.forwardRef(
10321
10318
  }
10322
10319
  );
10323
10320
  jd.displayName = _d;
10324
- function Ea(e) {
10321
+ function ka(e) {
10325
10322
  return e ? "open" : "closed";
10326
10323
  }
10327
10324
  var Pd = "DialogTitleWarning", [KT, Od] = Xv(Pd, {
10328
10325
  contentName: Yn,
10329
- titleName: ka,
10326
+ titleName: Ea,
10330
10327
  docsSlug: "dialog"
10331
10328
  }), Ub = ({ titleId: e }) => {
10332
10329
  const t = Od(Pd), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
@@ -10344,7 +10341,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
10344
10341
  const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
10345
10342
  t && o && (document.getElementById(t) || console.warn(r));
10346
10343
  }, [r, e, t]), null;
10347
- }, Md = bd, Kb = Sd, Dd = Td, ys = Rd, Ss = kd, Wn = Id, Cs = Ad, Ld = jd;
10344
+ }, Md = bd, Kb = Sd, Dd = Td, ys = Rd, Ss = Ed, Wn = Id, Cs = Ad, Ld = jd;
10348
10345
  const qb = Md, Gb = Dd, $d = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
10349
10346
  ys,
10350
10347
  {
@@ -10750,7 +10747,7 @@ const oy = V.memo(function({
10750
10747
  onCancelEdit: g,
10751
10748
  onCopy: x
10752
10749
  }) {
10753
- const [y, S] = xe(!1), [R, C] = xe("collapsed"), [T, k] = xe(!1), { currentThreadId: I } = ra(), { handleInterrupt: A } = hu(), { toast: _ } = Sa(), [D, L] = xe({}), [W, P] = xe(!1), [Y, K] = xe(null), J = l === "phone" || l === "half-screen", z = t.role, $ = z === "tool", F = !(r && z !== "user"), B = V.useMemo(() => {
10750
+ const [y, S] = xe(!1), [R, C] = xe("collapsed"), [T, E] = xe(!1), { currentThreadId: I } = ra(), { handleInterrupt: A } = hu(), { toast: _ } = Sa(), [D, L] = xe({}), [W, P] = xe(!1), [Y, K] = xe(null), J = l === "phone" || l === "half-screen", z = t.role, $ = z === "tool", F = !(r && z !== "user"), B = V.useMemo(() => {
10754
10751
  switch (z) {
10755
10752
  case "user":
10756
10753
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -10922,7 +10919,7 @@ const oy = V.memo(function({
10922
10919
  }, [A]), et = V.useCallback(({ part: ne, i: ae }) => {
10923
10920
  if (ne.type === "text") {
10924
10921
  const de = ne.text ?? "", Ne = de.trim(), he = pc(Ne);
10925
- return he && z !== "tool" ? /* @__PURE__ */ c.jsx(sy, { data: he }, ae) : z === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs(Vl, { open: T, onOpenChange: k, children: [
10922
+ return he && z !== "tool" ? /* @__PURE__ */ c.jsx(sy, { data: he }, ae) : z === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs(Vl, { open: T, onOpenChange: E, children: [
10926
10923
  /* @__PURE__ */ c.jsx("div", { className: te("text-sm text-[hsl(var(--chat-bubble-user-text))]", J && "text-xs"), children: T ? /* @__PURE__ */ c.jsx(Ql, { content: Ne, allowHtml: !1 }) : /* @__PURE__ */ c.jsxs("pre", { className: te("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", J && "text-xs"), children: [
10927
10924
  Ne.substring(0, h),
10928
10925
  "..."
@@ -11397,8 +11394,8 @@ const gc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Wd = V.forwa
11397
11394
  onScrollAway: g,
11398
11395
  onAtBottom: x
11399
11396
  }, y) => {
11400
- const S = Ge(null), R = Ge(null), C = Ge(!1), [T, k] = xe(!0), I = Me((D) => {
11401
- k(D), g && g(!D), x && x(D);
11397
+ const S = Ge(null), R = Ge(null), C = Ge(!1), [T, E] = xe(!0), I = Me((D) => {
11398
+ E(D), g && g(!D), x && x(D);
11402
11399
  }, [g, x]), A = at(() => {
11403
11400
  if (a)
11404
11401
  return async () => {
@@ -11540,7 +11537,7 @@ function Ia(e) {
11540
11537
  if (!y) return [];
11541
11538
  const S = Array.from(y.querySelectorAll(`[${f}]`));
11542
11539
  return Array.from(g.itemMap.values()).sort(
11543
- (T, k) => S.indexOf(T.ref.current) - S.indexOf(k.ref.current)
11540
+ (T, E) => S.indexOf(T.ref.current) - S.indexOf(E.ref.current)
11544
11541
  );
11545
11542
  }, [g.collectionRef, g.itemMap]);
11546
11543
  }
@@ -11555,7 +11552,7 @@ function Ts(e) {
11555
11552
  const t = m.useContext(hy);
11556
11553
  return e || t || "ltr";
11557
11554
  }
11558
- const py = ["top", "right", "bottom", "left"], En = Math.min, At = Math.max, Vo = Math.round, wo = Math.floor, cn = (e) => ({
11555
+ const py = ["top", "right", "bottom", "left"], kn = Math.min, At = Math.max, Vo = Math.round, wo = Math.floor, cn = (e) => ({
11559
11556
  x: e,
11560
11557
  y: e
11561
11558
  }), my = {
@@ -11568,7 +11565,7 @@ const py = ["top", "right", "bottom", "left"], En = Math.min, At = Math.max, Vo
11568
11565
  end: "start"
11569
11566
  };
11570
11567
  function $i(e, t, n) {
11571
- return At(e, En(t, n));
11568
+ return At(e, kn(t, n));
11572
11569
  }
11573
11570
  function xn(e, t) {
11574
11571
  return typeof e == "function" ? e(t) : e;
@@ -11576,7 +11573,7 @@ function xn(e, t) {
11576
11573
  function vn(e) {
11577
11574
  return e.split("-")[0];
11578
11575
  }
11579
- function kr(e) {
11576
+ function Er(e) {
11580
11577
  return e.split("-")[1];
11581
11578
  }
11582
11579
  function Na(e) {
@@ -11594,7 +11591,7 @@ function _a(e) {
11594
11591
  }
11595
11592
  function vy(e, t, n) {
11596
11593
  n === void 0 && (n = !1);
11597
- const r = kr(e), o = _a(e), s = Aa(o);
11594
+ const r = Er(e), o = _a(e), s = Aa(o);
11598
11595
  let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
11599
11596
  return t.reference[s] > t.floating[s] && (i = Ko(i)), [i, Ko(i)];
11600
11597
  }
@@ -11619,7 +11616,7 @@ function Sy(e, t, n) {
11619
11616
  }
11620
11617
  }
11621
11618
  function Cy(e, t, n, r) {
11622
- const o = kr(e);
11619
+ const o = Er(e);
11623
11620
  let s = Sy(vn(e), n === "start", r);
11624
11621
  return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Fi)))), s;
11625
11622
  }
@@ -11699,7 +11696,7 @@ function wc(e, t, n) {
11699
11696
  y: r.y
11700
11697
  };
11701
11698
  }
11702
- switch (kr(t)) {
11699
+ switch (Er(t)) {
11703
11700
  case "start":
11704
11701
  p[i] -= h * (n && u ? -1 : 1);
11705
11702
  break;
@@ -11815,7 +11812,7 @@ async function qr(e, t) {
11815
11812
  right: (C.right - x.right + w.right) / R.x
11816
11813
  };
11817
11814
  }
11818
- const ky = (e) => ({
11815
+ const Ey = (e) => ({
11819
11816
  name: "arrow",
11820
11817
  options: e,
11821
11818
  async fn(t) {
@@ -11837,9 +11834,9 @@ const ky = (e) => ({
11837
11834
  x: n,
11838
11835
  y: r
11839
11836
  }, p = _a(o), w = Aa(p), v = await i.getDimensions(u), g = p === "y", x = g ? "top" : "left", y = g ? "bottom" : "right", S = g ? "clientHeight" : "clientWidth", R = s.reference[w] + s.reference[p] - h[p] - s.floating[w], C = h[p] - s.reference[p], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
11840
- let k = T ? T[S] : 0;
11841
- (!k || !await (i.isElement == null ? void 0 : i.isElement(T))) && (k = a.floating[S] || s.floating[w]);
11842
- const I = R / 2 - C / 2, A = k / 2 - v[w] / 2 - 1, _ = En(f[x], A), D = En(f[y], A), L = _, W = k - v[w] - D, P = k / 2 - v[w] / 2 + I, Y = $i(L, P, W), K = !l.arrow && kr(o) != null && P !== Y && s.reference[w] / 2 - (P < L ? _ : D) - v[w] / 2 < 0, J = K ? P < L ? P - L : P - W : 0;
11837
+ let E = T ? T[S] : 0;
11838
+ (!E || !await (i.isElement == null ? void 0 : i.isElement(T))) && (E = a.floating[S] || s.floating[w]);
11839
+ const I = R / 2 - C / 2, A = E / 2 - v[w] / 2 - 1, _ = kn(f[x], A), D = kn(f[y], A), L = _, W = E - v[w] - D, P = E / 2 - v[w] / 2 + I, Y = $i(L, P, W), K = !l.arrow && Er(o) != null && P !== Y && s.reference[w] / 2 - (P < L ? _ : D) - v[w] / 2 < 0, J = K ? P < L ? P - L : P - W : 0;
11843
11840
  return {
11844
11841
  [p]: h[p] + J,
11845
11842
  data: {
@@ -11852,7 +11849,7 @@ const ky = (e) => ({
11852
11849
  reset: K
11853
11850
  };
11854
11851
  }
11855
- }), Ey = function(e) {
11852
+ }), ky = function(e) {
11856
11853
  return e === void 0 && (e = {}), {
11857
11854
  name: "flip",
11858
11855
  options: e,
@@ -11878,7 +11875,7 @@ const ky = (e) => ({
11878
11875
  return {};
11879
11876
  const x = vn(o), y = an(a), S = vn(a) === a, R = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), C = h || (S || !v ? [Ko(a)] : wy(a)), T = w !== "none";
11880
11877
  !h && T && C.push(...Cy(a, v, w, R));
11881
- const k = [a, ...C], I = await qr(t, g), A = [];
11878
+ const E = [a, ...C], I = await qr(t, g), A = [];
11882
11879
  let _ = ((r = s.flip) == null ? void 0 : r.overflows) || [];
11883
11880
  if (d && A.push(I[x]), f) {
11884
11881
  const P = vy(o, i, R);
@@ -11889,7 +11886,7 @@ const ky = (e) => ({
11889
11886
  overflows: A
11890
11887
  }], !A.every((P) => P <= 0)) {
11891
11888
  var D, L;
11892
- const P = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, Y = k[P];
11889
+ const P = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, Y = E[P];
11893
11890
  if (Y && (!(f === "alignment" ? y !== an(Y) : !1) || // We leave the current main axis only if every placement on that axis
11894
11891
  // overflows the main axis.
11895
11892
  _.every((z) => an(z.placement) === y ? z.overflows[0] > 0 : !0)))
@@ -11992,7 +11989,7 @@ async function Ny(e, t) {
11992
11989
  placement: n,
11993
11990
  platform: r,
11994
11991
  elements: o
11995
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = vn(n), a = kr(n), l = an(n) === "y", u = Kd.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = xn(t, e);
11992
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = vn(n), a = Er(n), l = an(n) === "y", u = Kd.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = xn(t, e);
11996
11993
  let {
11997
11994
  mainAxis: h,
11998
11995
  crossAxis: p,
@@ -12149,22 +12146,22 @@ const Ay = function(e) {
12149
12146
  apply: l = () => {
12150
12147
  },
12151
12148
  ...u
12152
- } = xn(e, t), d = await qr(t, u), f = vn(o), h = kr(o), p = an(o) === "y", {
12149
+ } = xn(e, t), d = await qr(t, u), f = vn(o), h = Er(o), p = an(o) === "y", {
12153
12150
  width: w,
12154
12151
  height: v
12155
12152
  } = s.floating;
12156
12153
  let g, x;
12157
12154
  f === "top" || f === "bottom" ? (g = f, x = h === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (x = f, g = h === "end" ? "top" : "bottom");
12158
- const y = v - d.top - d.bottom, S = w - d.left - d.right, R = En(v - d[g], y), C = En(w - d[x], S), T = !t.middlewareData.shift;
12159
- let k = R, I = C;
12160
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = S), (r = t.middlewareData.shift) != null && r.enabled.y && (k = y), T && !h) {
12155
+ const y = v - d.top - d.bottom, S = w - d.left - d.right, R = kn(v - d[g], y), C = kn(w - d[x], S), T = !t.middlewareData.shift;
12156
+ let E = R, I = C;
12157
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = S), (r = t.middlewareData.shift) != null && r.enabled.y && (E = y), T && !h) {
12161
12158
  const _ = At(d.left, 0), D = At(d.right, 0), L = At(d.top, 0), W = At(d.bottom, 0);
12162
- p ? I = w - 2 * (_ !== 0 || D !== 0 ? _ + D : At(d.left, d.right)) : k = v - 2 * (L !== 0 || W !== 0 ? L + W : At(d.top, d.bottom));
12159
+ p ? I = w - 2 * (_ !== 0 || D !== 0 ? _ + D : At(d.left, d.right)) : E = v - 2 * (L !== 0 || W !== 0 ? L + W : At(d.top, d.bottom));
12163
12160
  }
12164
12161
  await l({
12165
12162
  ...t,
12166
12163
  availableWidth: I,
12167
- availableHeight: k
12164
+ availableHeight: E
12168
12165
  });
12169
12166
  const A = await i.getDimensions(a.floating);
12170
12167
  return w !== A.width || v !== A.height ? {
@@ -12178,7 +12175,7 @@ const Ay = function(e) {
12178
12175
  function Rs() {
12179
12176
  return typeof window < "u";
12180
12177
  }
12181
- function Er(e) {
12178
+ function kr(e) {
12182
12179
  return qd(e) ? (e.nodeName || "").toLowerCase() : "#document";
12183
12180
  }
12184
12181
  function Pt(e) {
@@ -12213,10 +12210,10 @@ function so(e) {
12213
12210
  }
12214
12211
  const My = /* @__PURE__ */ new Set(["table", "td", "th"]);
12215
12212
  function Dy(e) {
12216
- return My.has(Er(e));
12213
+ return My.has(kr(e));
12217
12214
  }
12218
12215
  const Ly = [":popover-open", ":modal"];
12219
- function ks(e) {
12216
+ function Es(e) {
12220
12217
  return Ly.some((t) => {
12221
12218
  try {
12222
12219
  return e.matches(t);
@@ -12235,7 +12232,7 @@ function By(e) {
12235
12232
  for (; un(t) && !br(t); ) {
12236
12233
  if (ja(t))
12237
12234
  return t;
12238
- if (ks(t))
12235
+ if (Es(t))
12239
12236
  return null;
12240
12237
  t = In(t);
12241
12238
  }
@@ -12246,12 +12243,12 @@ function Pa() {
12246
12243
  }
12247
12244
  const Hy = /* @__PURE__ */ new Set(["html", "body", "#document"]);
12248
12245
  function br(e) {
12249
- return Hy.has(Er(e));
12246
+ return Hy.has(kr(e));
12250
12247
  }
12251
12248
  function Xt(e) {
12252
12249
  return Pt(e).getComputedStyle(e);
12253
12250
  }
12254
- function Es(e) {
12251
+ function ks(e) {
12255
12252
  return Yt(e) ? {
12256
12253
  scrollLeft: e.scrollLeft,
12257
12254
  scrollTop: e.scrollTop
@@ -12261,7 +12258,7 @@ function Es(e) {
12261
12258
  };
12262
12259
  }
12263
12260
  function In(e) {
12264
- if (Er(e) === "html")
12261
+ if (kr(e) === "html")
12265
12262
  return e;
12266
12263
  const t = (
12267
12264
  // Step into the shadow DOM of the parent of a slotted node.
@@ -12351,7 +12348,7 @@ function Xn(e, t, n, r) {
12351
12348
  });
12352
12349
  }
12353
12350
  function Is(e, t) {
12354
- const n = Es(e).scrollLeft;
12351
+ const n = ks(e).scrollLeft;
12355
12352
  return t ? t.left + n : Xn(hn(e)).left + n;
12356
12353
  }
12357
12354
  function Jd(e, t) {
@@ -12368,7 +12365,7 @@ function Vy(e) {
12368
12365
  offsetParent: r,
12369
12366
  strategy: o
12370
12367
  } = e;
12371
- const s = o === "fixed", i = hn(r), a = t ? ks(t.floating) : !1;
12368
+ const s = o === "fixed", i = hn(r), a = t ? Es(t.floating) : !1;
12372
12369
  if (r === i || a && s)
12373
12370
  return n;
12374
12371
  let l = {
@@ -12376,7 +12373,7 @@ function Vy(e) {
12376
12373
  scrollTop: 0
12377
12374
  }, u = cn(1);
12378
12375
  const d = cn(0), f = un(r);
12379
- if ((f || !f && !s) && ((Er(r) !== "body" || so(i)) && (l = Es(r)), un(r))) {
12376
+ if ((f || !f && !s) && ((kr(r) !== "body" || so(i)) && (l = ks(r)), un(r))) {
12380
12377
  const p = Xn(r);
12381
12378
  u = gr(r), d.x = p.x + r.clientLeft, d.y = p.y + r.clientTop;
12382
12379
  }
@@ -12392,7 +12389,7 @@ function Ky(e) {
12392
12389
  return Array.from(e.getClientRects());
12393
12390
  }
12394
12391
  function qy(e) {
12395
- const t = hn(e), n = Es(e), r = e.ownerDocument.body, o = At(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = At(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
12392
+ const t = hn(e), n = ks(e), r = e.ownerDocument.body, o = At(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = At(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
12396
12393
  let i = -n.scrollLeft + Is(e);
12397
12394
  const a = -n.scrollTop;
12398
12395
  return Xt(r).direction === "rtl" && (i += At(t.clientWidth, r.clientWidth) - o), {
@@ -12460,7 +12457,7 @@ function Jy(e, t) {
12460
12457
  const n = t.get(e);
12461
12458
  if (n)
12462
12459
  return n;
12463
- let r = Gr(e, [], !1).filter((a) => Yt(a) && Er(a) !== "body"), o = null;
12460
+ let r = Gr(e, [], !1).filter((a) => Yt(a) && kr(a) !== "body"), o = null;
12464
12461
  const s = Xt(e).position === "fixed";
12465
12462
  let i = s ? In(e) : e;
12466
12463
  for (; Yt(i) && !br(i); ) {
@@ -12476,9 +12473,9 @@ function Zy(e) {
12476
12473
  rootBoundary: r,
12477
12474
  strategy: o
12478
12475
  } = e;
12479
- const i = [...n === "clippingAncestors" ? ks(t) ? [] : Jy(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((u, d) => {
12476
+ const i = [...n === "clippingAncestors" ? Es(t) ? [] : Jy(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((u, d) => {
12480
12477
  const f = Tc(t, d, o);
12481
- return u.top = At(f.top, u.top), u.right = En(f.right, u.right), u.bottom = En(f.bottom, u.bottom), u.left = At(f.left, u.left), u;
12478
+ return u.top = At(f.top, u.top), u.right = kn(f.right, u.right), u.bottom = kn(f.bottom, u.bottom), u.left = At(f.left, u.left), u;
12482
12479
  }, Tc(t, a, o));
12483
12480
  return {
12484
12481
  width: l.right - l.left,
@@ -12508,7 +12505,7 @@ function e0(e, t, n) {
12508
12505
  l.x = Is(o);
12509
12506
  }
12510
12507
  if (r || !r && !s)
12511
- if ((Er(t) !== "body" || so(o)) && (a = Es(t)), r) {
12508
+ if ((kr(t) !== "body" || so(o)) && (a = ks(t)), r) {
12512
12509
  const p = Xn(t, !0, s, t);
12513
12510
  l.x = p.x + t.clientLeft, l.y = p.y + t.clientTop;
12514
12511
  } else o && u();
@@ -12534,7 +12531,7 @@ function Rc(e, t) {
12534
12531
  }
12535
12532
  function Qd(e, t) {
12536
12533
  const n = Pt(e);
12537
- if (ks(e))
12534
+ if (Es(e))
12538
12535
  return n;
12539
12536
  if (!un(e)) {
12540
12537
  let o = In(e);
@@ -12599,19 +12596,19 @@ function o0(e, t) {
12599
12596
  return;
12600
12597
  const w = wo(f), v = wo(o.clientWidth - (d + h)), g = wo(o.clientHeight - (f + p)), x = wo(d), S = {
12601
12598
  rootMargin: -w + "px " + -v + "px " + -g + "px " + -x + "px",
12602
- threshold: At(0, En(1, l)) || 1
12599
+ threshold: At(0, kn(1, l)) || 1
12603
12600
  };
12604
12601
  let R = !0;
12605
12602
  function C(T) {
12606
- const k = T[0].intersectionRatio;
12607
- if (k !== l) {
12603
+ const E = T[0].intersectionRatio;
12604
+ if (E !== l) {
12608
12605
  if (!R)
12609
12606
  return i();
12610
- k ? i(!1, k) : r = setTimeout(() => {
12607
+ E ? i(!1, E) : r = setTimeout(() => {
12611
12608
  i(!1, 1e-7);
12612
12609
  }, 1e3);
12613
12610
  }
12614
- k === 1 && !ef(u, e.getBoundingClientRect()) && i(), R = !1;
12611
+ E === 1 && !ef(u, e.getBoundingClientRect()) && i(), R = !1;
12615
12612
  }
12616
12613
  try {
12617
12614
  n = new IntersectionObserver(C, {
@@ -12662,7 +12659,7 @@ function s0(e, t, n, r) {
12662
12659
  }), f == null || f(), (x = p) == null || x.disconnect(), p = null, l && cancelAnimationFrame(w);
12663
12660
  };
12664
12661
  }
12665
- const i0 = Ay, a0 = _y, l0 = Ey, c0 = Py, u0 = Iy, kc = ky, d0 = jy, f0 = (e, t, n) => {
12662
+ const i0 = Ay, a0 = _y, l0 = ky, c0 = Py, u0 = Iy, Ec = Ey, d0 = jy, f0 = (e, t, n) => {
12666
12663
  const r = /* @__PURE__ */ new Map(), o = {
12667
12664
  platform: r0,
12668
12665
  ...n
@@ -12710,7 +12707,7 @@ function Go(e, t) {
12710
12707
  function tf(e) {
12711
12708
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
12712
12709
  }
12713
- function Ec(e, t) {
12710
+ function kc(e, t) {
12714
12711
  const n = tf(e);
12715
12712
  return Math.round(t * n) / n;
12716
12713
  }
@@ -12746,16 +12743,16 @@ function m0(e) {
12746
12743
  const [w, v] = m.useState(null), [g, x] = m.useState(null), y = m.useCallback((z) => {
12747
12744
  z !== T.current && (T.current = z, v(z));
12748
12745
  }, []), S = m.useCallback((z) => {
12749
- z !== k.current && (k.current = z, x(z));
12750
- }, []), R = s || w, C = i || g, T = m.useRef(null), k = m.useRef(null), I = m.useRef(d), A = l != null, _ = hi(l), D = hi(o), L = hi(u), W = m.useCallback(() => {
12751
- if (!T.current || !k.current)
12746
+ z !== E.current && (E.current = z, x(z));
12747
+ }, []), R = s || w, C = i || g, T = m.useRef(null), E = m.useRef(null), I = m.useRef(d), A = l != null, _ = hi(l), D = hi(o), L = hi(u), W = m.useCallback(() => {
12748
+ if (!T.current || !E.current)
12752
12749
  return;
12753
12750
  const z = {
12754
12751
  placement: t,
12755
12752
  strategy: n,
12756
12753
  middleware: h
12757
12754
  };
12758
- D.current && (z.platform = D.current), f0(T.current, k.current, z).then(($) => {
12755
+ D.current && (z.platform = D.current), f0(T.current, E.current, z).then(($) => {
12759
12756
  const F = {
12760
12757
  ...$,
12761
12758
  // The floating element's position may be recomputed while it's closed
@@ -12779,7 +12776,7 @@ function m0(e) {
12779
12776
  Mo(() => (P.current = !0, () => {
12780
12777
  P.current = !1;
12781
12778
  }), []), Mo(() => {
12782
- if (R && (T.current = R), C && (k.current = C), R && C) {
12779
+ if (R && (T.current = R), C && (E.current = C), R && C) {
12783
12780
  if (_.current)
12784
12781
  return _.current(R, C, W);
12785
12782
  W();
@@ -12787,7 +12784,7 @@ function m0(e) {
12787
12784
  }, [R, C, W, _, A]);
12788
12785
  const Y = m.useMemo(() => ({
12789
12786
  reference: T,
12790
- floating: k,
12787
+ floating: E,
12791
12788
  setReference: y,
12792
12789
  setFloating: S
12793
12790
  }), [y, S]), K = m.useMemo(() => ({
@@ -12801,7 +12798,7 @@ function m0(e) {
12801
12798
  };
12802
12799
  if (!K.floating)
12803
12800
  return z;
12804
- const $ = Ec(K.floating, d.x), F = Ec(K.floating, d.y);
12801
+ const $ = kc(K.floating, d.x), F = kc(K.floating, d.y);
12805
12802
  return a ? {
12806
12803
  ...z,
12807
12804
  transform: "translate(" + $ + "px, " + F + "px)",
@@ -12834,10 +12831,10 @@ const g0 = (e) => {
12834
12831
  element: r,
12835
12832
  padding: o
12836
12833
  } = typeof e == "function" ? e(n) : e;
12837
- return r && t(r) ? r.current != null ? kc({
12834
+ return r && t(r) ? r.current != null ? Ec({
12838
12835
  element: r.current,
12839
12836
  padding: o
12840
- }).fn(n) : {} : r ? kc({
12837
+ }).fn(n) : {} : r ? Ec({
12841
12838
  element: r,
12842
12839
  padding: o
12843
12840
  }).fn(n) : {};
@@ -12868,7 +12865,7 @@ const g0 = (e) => {
12868
12865
  var T0 = "Arrow", nf = m.forwardRef((e, t) => {
12869
12866
  const { children: n, width: r = 10, height: o = 5, ...s } = e;
12870
12867
  return /* @__PURE__ */ c.jsx(
12871
- Ee.svg,
12868
+ ke.svg,
12872
12869
  {
12873
12870
  ...s,
12874
12871
  ref: t,
@@ -12904,9 +12901,9 @@ function rf(e) {
12904
12901
  n(void 0);
12905
12902
  }, [e]), t;
12906
12903
  }
12907
- var Ma = "Popper", [of, Ns] = fn(Ma), [k0, sf] = of(Ma), af = (e) => {
12904
+ var Ma = "Popper", [of, Ns] = fn(Ma), [E0, sf] = of(Ma), af = (e) => {
12908
12905
  const { __scopePopper: t, children: n } = e, [r, o] = m.useState(null);
12909
- return /* @__PURE__ */ c.jsx(k0, { scope: t, anchor: r, onAnchorChange: o, children: n });
12906
+ return /* @__PURE__ */ c.jsx(E0, { scope: t, anchor: r, onAnchorChange: o, children: n });
12910
12907
  };
12911
12908
  af.displayName = Ma;
12912
12909
  var lf = "PopperAnchor", cf = m.forwardRef(
@@ -12915,11 +12912,11 @@ var lf = "PopperAnchor", cf = m.forwardRef(
12915
12912
  return m.useEffect(() => {
12916
12913
  const u = l.current;
12917
12914
  l.current = (r == null ? void 0 : r.current) || i.current, u !== l.current && s.onAnchorChange(l.current);
12918
- }), r ? null : /* @__PURE__ */ c.jsx(Ee.div, { ...o, ref: a });
12915
+ }), r ? null : /* @__PURE__ */ c.jsx(ke.div, { ...o, ref: a });
12919
12916
  }
12920
12917
  );
12921
12918
  cf.displayName = lf;
12922
- var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
12919
+ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
12923
12920
  (e, t) => {
12924
12921
  var G, O, Q, q, ce, ie;
12925
12922
  const {
@@ -12937,7 +12934,7 @@ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
12937
12934
  updatePositionStrategy: p = "optimized",
12938
12935
  onPlaced: w,
12939
12936
  ...v
12940
- } = e, g = sf(Da, n), [x, y] = m.useState(null), S = ze(t, ($e) => y($e)), [R, C] = m.useState(null), T = rf(R), k = (T == null ? void 0 : T.width) ?? 0, I = (T == null ? void 0 : T.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, D = Array.isArray(u) ? u : [u], L = D.length > 0, W = {
12937
+ } = e, g = sf(Da, n), [x, y] = m.useState(null), S = ze(t, ($e) => y($e)), [R, C] = m.useState(null), T = rf(R), E = (T == null ? void 0 : T.width) ?? 0, I = (T == null ? void 0 : T.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, D = Array.isArray(u) ? u : [u], L = D.length > 0, W = {
12941
12938
  padding: _,
12942
12939
  boundary: D.filter(A0),
12943
12940
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -12969,7 +12966,7 @@ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
12969
12966
  }
12970
12967
  }),
12971
12968
  R && C0({ element: R, padding: a }),
12972
- _0({ arrowWidth: k, arrowHeight: I }),
12969
+ _0({ arrowWidth: E, arrowHeight: I }),
12973
12970
  h && S0({ strategy: "referenceHidden", ...W })
12974
12971
  ]
12975
12972
  }), [$, F] = hf(K), B = mt(w);
@@ -13004,7 +13001,7 @@ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
13004
13001
  },
13005
13002
  dir: e.dir,
13006
13003
  children: /* @__PURE__ */ c.jsx(
13007
- E0,
13004
+ k0,
13008
13005
  {
13009
13006
  scope: n,
13010
13007
  placedSide: $,
@@ -13013,7 +13010,7 @@ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
13013
13010
  arrowY: ue,
13014
13011
  shouldHideArrow: ee,
13015
13012
  children: /* @__PURE__ */ c.jsx(
13016
- Ee.div,
13013
+ ke.div,
13017
13014
  {
13018
13015
  "data-side": $,
13019
13016
  "data-align": F,
@@ -13126,7 +13123,7 @@ var L0 = m.forwardRef((e, t) => {
13126
13123
  defaultProp: a ?? null,
13127
13124
  onChange: l,
13128
13125
  caller: io
13129
- }), [x, y] = m.useState(!1), S = mt(u), R = vf(n), C = m.useRef(!1), [T, k] = m.useState(0);
13126
+ }), [x, y] = m.useState(!1), S = mt(u), R = vf(n), C = m.useRef(!1), [T, E] = m.useState(0);
13130
13127
  return m.useEffect(() => {
13131
13128
  const I = h.current;
13132
13129
  if (I)
@@ -13145,15 +13142,15 @@ var L0 = m.forwardRef((e, t) => {
13145
13142
  ),
13146
13143
  onItemShiftTab: m.useCallback(() => y(!0), []),
13147
13144
  onFocusableItemAdd: m.useCallback(
13148
- () => k((I) => I + 1),
13145
+ () => E((I) => I + 1),
13149
13146
  []
13150
13147
  ),
13151
13148
  onFocusableItemRemove: m.useCallback(
13152
- () => k((I) => I - 1),
13149
+ () => E((I) => I - 1),
13153
13150
  []
13154
13151
  ),
13155
13152
  children: /* @__PURE__ */ c.jsx(
13156
- Ee.div,
13153
+ ke.div,
13157
13154
  {
13158
13155
  tabIndex: x || T === 0 ? -1 : 0,
13159
13156
  "data-orientation": r,
@@ -13202,7 +13199,7 @@ var L0 = m.forwardRef((e, t) => {
13202
13199
  focusable: r,
13203
13200
  active: o,
13204
13201
  children: /* @__PURE__ */ c.jsx(
13205
- Ee.span,
13202
+ ke.span,
13206
13203
  {
13207
13204
  tabIndex: f ? 0 : -1,
13208
13205
  "data-orientation": d.orientation,
@@ -13276,7 +13273,7 @@ var H0 = bf, U0 = Sf, Hi = ["Enter", " "], W0 = ["ArrowDown", "PageUp", "Home"],
13276
13273
  Y0,
13277
13274
  Ns,
13278
13275
  wf
13279
- ]), As = Ns(), kf = wf(), [X0, rr] = nr(ao), [J0, lo] = nr(ao), Ef = (e) => {
13276
+ ]), As = Ns(), Ef = wf(), [X0, rr] = nr(ao), [J0, lo] = nr(ao), kf = (e) => {
13280
13277
  const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = As(t), [l, u] = m.useState(null), d = m.useRef(!1), f = mt(s), h = Ts(o);
13281
13278
  return m.useEffect(() => {
13282
13279
  const p = () => {
@@ -13307,7 +13304,7 @@ var H0 = bf, U0 = Sf, Hi = ["Enter", " "], W0 = ["ArrowDown", "PageUp", "Home"],
13307
13304
  }
13308
13305
  ) });
13309
13306
  };
13310
- Ef.displayName = ao;
13307
+ kf.displayName = ao;
13311
13308
  var Z0 = "MenuAnchor", La = m.forwardRef(
13312
13309
  (e, t) => {
13313
13310
  const { __scopeMenu: n, ...r } = e, o = As(n);
@@ -13380,7 +13377,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13380
13377
  onDismiss: p,
13381
13378
  disableOutsideScroll: w,
13382
13379
  ...v
13383
- } = e, g = rr(Ht, n), x = lo(Ht, n), y = As(n), S = kf(n), R = G0(n), [C, T] = m.useState(null), k = m.useRef(null), I = ze(t, k, g.onContentChange), A = m.useRef(0), _ = m.useRef(""), D = m.useRef(0), L = m.useRef(null), W = m.useRef("right"), P = m.useRef(0), Y = w ? ws : m.Fragment, K = w ? { as: rS, allowPinchZoom: !0 } : void 0, J = ($) => {
13380
+ } = e, g = rr(Ht, n), x = lo(Ht, n), y = As(n), S = Ef(n), R = G0(n), [C, T] = m.useState(null), E = m.useRef(null), I = ze(t, E, g.onContentChange), A = m.useRef(0), _ = m.useRef(""), D = m.useRef(0), L = m.useRef(null), W = m.useRef("right"), P = m.useRef(0), Y = w ? ws : m.Fragment, K = w ? { as: rS, allowPinchZoom: !0 } : void 0, J = ($) => {
13384
13381
  var G, O;
13385
13382
  const F = _.current + $, B = R().filter((Q) => !Q.disabled), pe = document.activeElement, ue = (G = B.find((Q) => Q.ref.current === pe)) == null ? void 0 : G.textValue, ee = B.map((Q) => Q.textValue), Ie = mS(ee, F, ue), Ce = (O = B.find((Q) => Q.textValue === Ie)) == null ? void 0 : O.ref.current;
13386
13383
  (function Q(q) {
@@ -13406,7 +13403,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13406
13403
  onItemLeave: m.useCallback(
13407
13404
  ($) => {
13408
13405
  var F;
13409
- z($) || ((F = k.current) == null || F.focus(), T(null));
13406
+ z($) || ((F = E.current) == null || F.focus(), T(null));
13410
13407
  },
13411
13408
  [z]
13412
13409
  ),
@@ -13427,7 +13424,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13427
13424
  trapped: o,
13428
13425
  onMountAutoFocus: le(s, ($) => {
13429
13426
  var F;
13430
- $.preventDefault(), (F = k.current) == null || F.focus({ preventScroll: !0 });
13427
+ $.preventDefault(), (F = E.current) == null || F.focus({ preventScroll: !0 });
13431
13428
  }),
13432
13429
  onUnmountAutoFocus: i,
13433
13430
  children: /* @__PURE__ */ c.jsx(
@@ -13469,7 +13466,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13469
13466
  onKeyDown: le(v.onKeyDown, ($) => {
13470
13467
  const B = $.target.closest("[data-radix-menu-content]") === $.currentTarget, pe = $.ctrlKey || $.altKey || $.metaKey, ue = $.key.length === 1;
13471
13468
  B && ($.key === "Tab" && $.preventDefault(), !pe && ue && J($.key));
13472
- const ee = k.current;
13469
+ const ee = E.current;
13473
13470
  if ($.target !== ee || !V0.includes($.key)) return;
13474
13471
  $.preventDefault();
13475
13472
  const Ce = R().filter((G) => !G.disabled).map((G) => G.ref.current);
@@ -13504,14 +13501,14 @@ Af.displayName = Ht;
13504
13501
  var oS = "MenuGroup", Ba = m.forwardRef(
13505
13502
  (e, t) => {
13506
13503
  const { __scopeMenu: n, ...r } = e;
13507
- return /* @__PURE__ */ c.jsx(Ee.div, { role: "group", ...r, ref: t });
13504
+ return /* @__PURE__ */ c.jsx(ke.div, { role: "group", ...r, ref: t });
13508
13505
  }
13509
13506
  );
13510
13507
  Ba.displayName = oS;
13511
13508
  var sS = "MenuLabel", _f = m.forwardRef(
13512
13509
  (e, t) => {
13513
13510
  const { __scopeMenu: n, ...r } = e;
13514
- return /* @__PURE__ */ c.jsx(Ee.div, { ...r, ref: t });
13511
+ return /* @__PURE__ */ c.jsx(ke.div, { ...r, ref: t });
13515
13512
  }
13516
13513
  );
13517
13514
  _f.displayName = sS;
@@ -13550,7 +13547,7 @@ var Yo = "MenuItem", Ic = "menu.itemSelect", _s = m.forwardRef(
13550
13547
  _s.displayName = Yo;
13551
13548
  var jf = m.forwardRef(
13552
13549
  (e, t) => {
13553
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Fa(Yo, n), a = kf(n), l = m.useRef(null), u = ze(t, l), [d, f] = m.useState(!1), [h, p] = m.useState("");
13550
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Fa(Yo, n), a = Ef(n), l = m.useRef(null), u = ze(t, l), [d, f] = m.useState(!1), [h, p] = m.useState("");
13554
13551
  return m.useEffect(() => {
13555
13552
  const w = l.current;
13556
13553
  w && p((w.textContent ?? "").trim());
@@ -13561,7 +13558,7 @@ var jf = m.forwardRef(
13561
13558
  disabled: r,
13562
13559
  textValue: o ?? h,
13563
13560
  children: /* @__PURE__ */ c.jsx(U0, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ c.jsx(
13564
- Ee.div,
13561
+ ke.div,
13565
13562
  {
13566
13563
  role: "menuitem",
13567
13564
  "data-highlighted": d ? "" : void 0,
@@ -13653,7 +13650,7 @@ var Ha = "MenuItemIndicator", [$f, cS] = nr(
13653
13650
  {
13654
13651
  present: r || Xo(s.checked) || s.checked === !0,
13655
13652
  children: /* @__PURE__ */ c.jsx(
13656
- Ee.span,
13653
+ ke.span,
13657
13654
  {
13658
13655
  ...o,
13659
13656
  ref: t,
@@ -13669,7 +13666,7 @@ var uS = "MenuSeparator", zf = m.forwardRef(
13669
13666
  (e, t) => {
13670
13667
  const { __scopeMenu: n, ...r } = e;
13671
13668
  return /* @__PURE__ */ c.jsx(
13672
- Ee.div,
13669
+ ke.div,
13673
13670
  {
13674
13671
  role: "separator",
13675
13672
  "aria-orientation": "horizontal",
@@ -13837,7 +13834,7 @@ function xS(e, t) {
13837
13834
  function Xr(e) {
13838
13835
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
13839
13836
  }
13840
- var vS = Ef, wS = La, bS = Nf, yS = Af, SS = Ba, CS = _f, TS = _s, RS = Pf, kS = Mf, ES = Lf, IS = Ff, NS = zf, AS = Bf, _S = Uf, jS = Vf, js = "DropdownMenu", [PS, GT] = fn(
13837
+ var vS = kf, wS = La, bS = Nf, yS = Af, SS = Ba, CS = _f, TS = _s, RS = Pf, ES = Mf, kS = Lf, IS = Ff, NS = zf, AS = Bf, _S = Uf, jS = Vf, js = "DropdownMenu", [PS, GT] = fn(
13841
13838
  js,
13842
13839
  [Rf]
13843
13840
  ), Tt = Rf(), [OS, qf] = PS(js), Gf = (e) => {
@@ -13875,7 +13872,7 @@ var Yf = "DropdownMenuTrigger", Xf = m.forwardRef(
13875
13872
  (e, t) => {
13876
13873
  const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = qf(Yf, n), i = Tt(n);
13877
13874
  return /* @__PURE__ */ c.jsx(wS, { asChild: !0, ...i, children: /* @__PURE__ */ c.jsx(
13878
- Ee.button,
13875
+ ke.button,
13879
13876
  {
13880
13877
  type: "button",
13881
13878
  id: s.triggerId,
@@ -13963,12 +13960,12 @@ var zS = "DropdownMenuCheckboxItem", nh = m.forwardRef((e, t) => {
13963
13960
  nh.displayName = zS;
13964
13961
  var BS = "DropdownMenuRadioGroup", HS = m.forwardRef((e, t) => {
13965
13962
  const { __scopeDropdownMenu: n, ...r } = e, o = Tt(n);
13966
- return /* @__PURE__ */ c.jsx(kS, { ...o, ...r, ref: t });
13963
+ return /* @__PURE__ */ c.jsx(ES, { ...o, ...r, ref: t });
13967
13964
  });
13968
13965
  HS.displayName = BS;
13969
13966
  var US = "DropdownMenuRadioItem", rh = m.forwardRef((e, t) => {
13970
13967
  const { __scopeDropdownMenu: n, ...r } = e, o = Tt(n);
13971
- return /* @__PURE__ */ c.jsx(ES, { ...o, ...r, ref: t });
13968
+ return /* @__PURE__ */ c.jsx(kS, { ...o, ...r, ref: t });
13972
13969
  });
13973
13970
  rh.displayName = US;
13974
13971
  var WS = "DropdownMenuItemIndicator", oh = m.forwardRef((e, t) => {
@@ -14150,7 +14147,7 @@ function mi({
14150
14147
  messages: R,
14151
14148
  hasMoreHistory: C,
14152
14149
  isLoadingHistory: T,
14153
- send: k,
14150
+ send: E,
14154
14151
  stop: I,
14155
14152
  loadOlderMessages: A
14156
14153
  } = hu(), {
@@ -14185,11 +14182,11 @@ function mi({
14185
14182
  }, Le = me.current;
14186
14183
  if (!(Le && Le.threadId === ve.threadId && Le.checkpointId === ve.checkpointId && Le.checkpointNs === ve.checkpointNs))
14187
14184
  return x(v).then((Xe) => {
14188
- var E;
14185
+ var k;
14189
14186
  if (re) return;
14190
14187
  const xt = ((Xe == null ? void 0 : Xe.checkpoints) ?? []).slice().sort((b, N) => new Date(N.createdAt).getTime() - new Date(b.createdAt).getTime());
14191
14188
  et(xt);
14192
- const Vt = Fe, $n = Vt && xt.some((b) => b.checkpointId === Vt) ? Vt : ((E = xt[0]) == null ? void 0 : E.checkpointId) ?? null;
14189
+ const Vt = Fe, $n = Vt && xt.some((b) => b.checkpointId === Vt) ? Vt : ((k = xt[0]) == null ? void 0 : k.checkpointId) ?? null;
14193
14190
  let ar = null;
14194
14191
  if ($n) {
14195
14192
  const b = xt.find((N) => N.checkpointId === $n);
@@ -14247,7 +14244,7 @@ function mi({
14247
14244
  }
14248
14245
  }
14249
14246
  try {
14250
- await k(ve || "", {
14247
+ await E(ve || "", {
14251
14248
  checkpointId: Fe ?? W ?? void 0,
14252
14249
  checkpointNs: ft ?? P ?? void 0,
14253
14250
  payloadExtras: Y ? { edit: !0, originalMessageId: Y } : void 0,
@@ -14277,13 +14274,13 @@ function mi({
14277
14274
  for (let Le = re - 1; Le >= 0; Le--)
14278
14275
  if (R[Le].role === "user") {
14279
14276
  const Xe = ve(R[Le]);
14280
- Xe && k(Xe, {
14277
+ Xe && E(Xe, {
14281
14278
  checkpointId: Fe ?? W ?? void 0,
14282
14279
  checkpointNs: ft ?? P ?? void 0
14283
14280
  });
14284
14281
  break;
14285
14282
  }
14286
- }, [R, k, Fe, ft, W, P]), Mn = (re) => {
14283
+ }, [R, E, Fe, ft, W, P]), Mn = (re) => {
14287
14284
  const ve = Array.from(re.target.files || []);
14288
14285
  pe((Le) => [...Le, ...ve]), re.target.value = "";
14289
14286
  }, Mt = (re) => {
@@ -14296,7 +14293,7 @@ function mi({
14296
14293
  if (ve) {
14297
14294
  q(null), ie(null), O(!0);
14298
14295
  try {
14299
- await k("", {
14296
+ await E("", {
14300
14297
  checkpointId: Fe ?? W ?? void 0,
14301
14298
  checkpointNs: ft ?? P ?? void 0,
14302
14299
  attachments: [ve]
@@ -14555,7 +14552,7 @@ var Wa = "ScrollArea", [vh, YT] = fn(Wa), [lC, Wt] = vh(Wa), wh = m.forwardRef(
14555
14552
  dir: o,
14556
14553
  scrollHideDelay: s = 600,
14557
14554
  ...i
14558
- } = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, w] = m.useState(null), [v, g] = m.useState(null), [x, y] = m.useState(0), [S, R] = m.useState(0), [C, T] = m.useState(!1), [k, I] = m.useState(!1), A = ze(t, (D) => l(D)), _ = Ts(o);
14555
+ } = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, w] = m.useState(null), [v, g] = m.useState(null), [x, y] = m.useState(0), [S, R] = m.useState(0), [C, T] = m.useState(!1), [E, I] = m.useState(!1), A = ze(t, (D) => l(D)), _ = Ts(o);
14559
14556
  return /* @__PURE__ */ c.jsx(
14560
14557
  lC,
14561
14558
  {
@@ -14574,12 +14571,12 @@ var Wa = "ScrollArea", [vh, YT] = fn(Wa), [lC, Wt] = vh(Wa), wh = m.forwardRef(
14574
14571
  onScrollbarXEnabledChange: T,
14575
14572
  scrollbarY: v,
14576
14573
  onScrollbarYChange: g,
14577
- scrollbarYEnabled: k,
14574
+ scrollbarYEnabled: E,
14578
14575
  onScrollbarYEnabledChange: I,
14579
14576
  onCornerWidthChange: y,
14580
14577
  onCornerHeightChange: R,
14581
14578
  children: /* @__PURE__ */ c.jsx(
14582
- Ee.div,
14579
+ ke.div,
14583
14580
  {
14584
14581
  dir: _,
14585
14582
  ...i,
@@ -14612,7 +14609,7 @@ var bh = "ScrollAreaViewport", yh = m.forwardRef(
14612
14609
  }
14613
14610
  ),
14614
14611
  /* @__PURE__ */ c.jsx(
14615
- Ee.div,
14612
+ ke.div,
14616
14613
  {
14617
14614
  "data-radix-scroll-area-viewport": "",
14618
14615
  ...s,
@@ -14736,7 +14733,7 @@ var cC = m.forwardRef((e, t) => {
14736
14733
  content: 0,
14737
14734
  viewport: 0,
14738
14735
  scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
14739
- }), u = Eh(a.viewport, a.content), d = {
14736
+ }), u = kh(a.viewport, a.content), d = {
14740
14737
  ...r,
14741
14738
  sizes: a,
14742
14739
  onSizesChange: l,
@@ -14877,7 +14874,7 @@ var cC = m.forwardRef((e, t) => {
14877
14874
  onWheelScroll: d,
14878
14875
  onResize: f,
14879
14876
  ...h
14880
- } = e, p = Wt(pn, n), [w, v] = m.useState(null), g = ze(t, (A) => v(A)), x = m.useRef(null), y = m.useRef(""), S = p.viewport, R = r.content - r.viewport, C = mt(d), T = mt(l), k = Os(f, 10);
14877
+ } = e, p = Wt(pn, n), [w, v] = m.useState(null), g = ze(t, (A) => v(A)), x = m.useRef(null), y = m.useRef(""), S = p.viewport, R = r.content - r.viewport, C = mt(d), T = mt(l), E = Os(f, 10);
14881
14878
  function I(A) {
14882
14879
  if (x.current) {
14883
14880
  const _ = A.clientX - x.current.left, D = A.clientY - x.current.top;
@@ -14890,7 +14887,7 @@ var cC = m.forwardRef((e, t) => {
14890
14887
  (w == null ? void 0 : w.contains(D)) && C(_, R);
14891
14888
  };
14892
14889
  return document.addEventListener("wheel", A, { passive: !1 }), () => document.removeEventListener("wheel", A, { passive: !1 });
14893
- }, [S, w, R, C]), m.useEffect(T, [r, T]), yr(w, k), yr(p.content, k), /* @__PURE__ */ c.jsx(
14890
+ }, [S, w, R, C]), m.useEffect(T, [r, T]), yr(w, E), yr(p.content, E), /* @__PURE__ */ c.jsx(
14894
14891
  hC,
14895
14892
  {
14896
14893
  scope: n,
@@ -14901,7 +14898,7 @@ var cC = m.forwardRef((e, t) => {
14901
14898
  onThumbPositionChange: T,
14902
14899
  onThumbPointerDown: mt(a),
14903
14900
  children: /* @__PURE__ */ c.jsx(
14904
- Ee.div,
14901
+ ke.div,
14905
14902
  {
14906
14903
  ...h,
14907
14904
  ref: g,
@@ -14943,7 +14940,7 @@ var cC = m.forwardRef((e, t) => {
14943
14940
  return a(), f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
14944
14941
  }
14945
14942
  }, [s.viewport, d, a]), /* @__PURE__ */ c.jsx(
14946
- Ee.div,
14943
+ ke.div,
14947
14944
  {
14948
14945
  "data-state": i.hasThumb ? "visible" : "hidden",
14949
14946
  ...o,
@@ -14963,13 +14960,13 @@ var cC = m.forwardRef((e, t) => {
14963
14960
  }
14964
14961
  );
14965
14962
  Rh.displayName = Zo;
14966
- var qa = "ScrollAreaCorner", kh = m.forwardRef(
14963
+ var qa = "ScrollAreaCorner", Eh = m.forwardRef(
14967
14964
  (e, t) => {
14968
14965
  const n = Wt(qa, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
14969
14966
  return n.type !== "scroll" && r ? /* @__PURE__ */ c.jsx(mC, { ...e, ref: t }) : null;
14970
14967
  }
14971
14968
  );
14972
- kh.displayName = qa;
14969
+ Eh.displayName = qa;
14973
14970
  var mC = m.forwardRef((e, t) => {
14974
14971
  const { __scopeScrollArea: n, ...r } = e, o = Wt(qa, n), [s, i] = m.useState(0), [a, l] = m.useState(0), u = !!(s && a);
14975
14972
  return yr(o.scrollbarX, () => {
@@ -14981,7 +14978,7 @@ var mC = m.forwardRef((e, t) => {
14981
14978
  const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
14982
14979
  o.onCornerWidthChange(d), i(d);
14983
14980
  }), u ? /* @__PURE__ */ c.jsx(
14984
- Ee.div,
14981
+ ke.div,
14985
14982
  {
14986
14983
  ...r,
14987
14984
  ref: t,
@@ -15000,12 +14997,12 @@ var mC = m.forwardRef((e, t) => {
15000
14997
  function Qo(e) {
15001
14998
  return e ? parseInt(e, 10) : 0;
15002
14999
  }
15003
- function Eh(e, t) {
15000
+ function kh(e, t) {
15004
15001
  const n = e / t;
15005
15002
  return isNaN(n) ? 0 : n;
15006
15003
  }
15007
15004
  function Ps(e) {
15008
- const t = Eh(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
15005
+ const t = kh(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
15009
15006
  return Math.max(r, 18);
15010
15007
  }
15011
15008
  function gC(e, t, n, r = "ltr") {
@@ -15054,7 +15051,7 @@ function yr(e, t) {
15054
15051
  }
15055
15052
  }, [e, n]);
15056
15053
  }
15057
- var Ah = wh, vC = yh, wC = kh;
15054
+ var Ah = wh, vC = yh, wC = Eh;
15058
15055
  const _h = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
15059
15056
  Ah,
15060
15057
  {
@@ -15106,7 +15103,7 @@ function Ac({
15106
15103
  deleteThread: v,
15107
15104
  renameThread: g,
15108
15105
  isLoadingThreads: x
15109
- } = ra(), [y, S] = xe(Array.isArray(h) ? h : []), R = Ge(y.length > 0), [C, T] = xe(null), [k, I] = xe(""), [A, _] = xe(!1);
15106
+ } = ra(), [y, S] = xe(Array.isArray(h) ? h : []), R = Ge(y.length > 0), [C, T] = xe(null), [E, I] = xe(""), [A, _] = xe(!1);
15110
15107
  ct(() => {
15111
15108
  const F = Array.isArray(h) ? h : [];
15112
15109
  if (F.length > 0) {
@@ -15141,9 +15138,9 @@ function Ac({
15141
15138
  }, P = (F, B) => {
15142
15139
  B.stopPropagation(), T(F.threadId), I(F.title || `Thread ${F.threadId.slice(0, 8)}`);
15143
15140
  }, Y = async (F) => {
15144
- if (k.trim())
15141
+ if (E.trim())
15145
15142
  try {
15146
- await g(F, k.trim()), T(null), I("");
15143
+ await g(F, E.trim()), T(null), I("");
15147
15144
  } catch (B) {
15148
15145
  console.error("Failed to update title:", B);
15149
15146
  }
@@ -15192,7 +15189,7 @@ function Ac({
15192
15189
  children: [
15193
15190
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
15194
15191
  /* @__PURE__ */ c.jsx("div", { className: "flex-1 min-w-0", children: C === F.threadId ? /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", onClick: (B) => B.stopPropagation(), children: [
15195
- /* @__PURE__ */ c.jsx(Jo, { value: k, onChange: (B) => I(B.target.value), onKeyDown: (B) => J(B, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15192
+ /* @__PURE__ */ c.jsx(Jo, { value: E, onChange: (B) => I(B.target.value), onKeyDown: (B) => J(B, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15196
15193
  /* @__PURE__ */ c.jsx(Ue, { variant: "ghost", size: "sm", onClick: () => Y(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(Zi, { size: 12 }) }),
15197
15194
  /* @__PURE__ */ c.jsx(Ue, { variant: "ghost", size: "sm", onClick: K, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(fr, { size: 12 }) })
15198
15195
  ] }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
@@ -15331,7 +15328,7 @@ function JT(e) {
15331
15328
  }), TC(e);
15332
15329
  }
15333
15330
  var RC = "Label", Lh = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
15334
- Ee.label,
15331
+ ke.label,
15335
15332
  {
15336
15333
  ...e,
15337
15334
  ref: t,
@@ -15343,13 +15340,13 @@ var RC = "Label", Lh = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
15343
15340
  ));
15344
15341
  Lh.displayName = RC;
15345
15342
  var $h = Lh;
15346
- const kC = ns(
15343
+ const EC = ns(
15347
15344
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
15348
15345
  ), $t = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15349
15346
  $h,
15350
15347
  {
15351
15348
  ref: n,
15352
- className: te(kC(), e),
15349
+ className: te(EC(), e),
15353
15350
  ...t
15354
15351
  }
15355
15352
  ));
@@ -15358,7 +15355,7 @@ function Fh(e) {
15358
15355
  const t = m.useRef({ value: e, previous: e });
15359
15356
  return m.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
15360
15357
  }
15361
- var Ms = "Switch", [EC, ZT] = fn(Ms), [IC, NC] = EC(Ms), zh = m.forwardRef(
15358
+ var Ms = "Switch", [kC, ZT] = fn(Ms), [IC, NC] = kC(Ms), zh = m.forwardRef(
15362
15359
  (e, t) => {
15363
15360
  const {
15364
15361
  __scopeSwitch: n,
@@ -15379,7 +15376,7 @@ var Ms = "Switch", [EC, ZT] = fn(Ms), [IC, NC] = EC(Ms), zh = m.forwardRef(
15379
15376
  });
15380
15377
  return /* @__PURE__ */ c.jsxs(IC, { scope: n, checked: x, disabled: a, children: [
15381
15378
  /* @__PURE__ */ c.jsx(
15382
- Ee.button,
15379
+ ke.button,
15383
15380
  {
15384
15381
  type: "button",
15385
15382
  role: "switch",
@@ -15418,7 +15415,7 @@ var Bh = "SwitchThumb", Hh = m.forwardRef(
15418
15415
  (e, t) => {
15419
15416
  const { __scopeSwitch: n, ...r } = e, o = NC(Bh, n);
15420
15417
  return /* @__PURE__ */ c.jsx(
15421
- Ee.span,
15418
+ ke.span,
15422
15419
  {
15423
15420
  "data-state": Wh(o.checked),
15424
15421
  "data-disabled": o.disabled ? "" : void 0,
@@ -15509,7 +15506,7 @@ var Kh = Object.freeze({
15509
15506
  wordWrap: "normal"
15510
15507
  }), jC = "VisuallyHidden", PC = m.forwardRef(
15511
15508
  (e, t) => /* @__PURE__ */ c.jsx(
15512
- Ee.span,
15509
+ ke.span,
15513
15510
  {
15514
15511
  ...e,
15515
15512
  ref: t,
@@ -15537,7 +15534,7 @@ var OC = [" ", "Enter", "ArrowUp", "ArrowDown"], MC = [" ", "Enter"], Jn = "Sele
15537
15534
  disabled: h,
15538
15535
  required: p,
15539
15536
  form: w
15540
- } = e, v = $s(t), [g, x] = m.useState(null), [y, S] = m.useState(null), [R, C] = m.useState(!1), T = Ts(u), [k, I] = Gn({
15537
+ } = e, v = $s(t), [g, x] = m.useState(null), [y, S] = m.useState(null), [R, C] = m.useState(!1), T = Ts(u), [E, I] = Gn({
15541
15538
  prop: r,
15542
15539
  defaultProp: o ?? !1,
15543
15540
  onChange: s,
@@ -15562,7 +15559,7 @@ var OC = [" ", "Enter", "ArrowUp", "ArrowDown"], MC = [" ", "Enter"], Jn = "Sele
15562
15559
  contentId: ln(),
15563
15560
  value: A,
15564
15561
  onValueChange: _,
15565
- open: k,
15562
+ open: E,
15566
15563
  onOpenChange: I,
15567
15564
  dir: T,
15568
15565
  triggerPointerDownPosRef: D,
@@ -15620,7 +15617,7 @@ var Gh = "SelectTrigger", Yh = m.forwardRef(
15620
15617
  });
15621
15618
  };
15622
15619
  return /* @__PURE__ */ c.jsx(mf, { asChild: !0, ...s, children: /* @__PURE__ */ c.jsx(
15623
- Ee.button,
15620
+ ke.button,
15624
15621
  {
15625
15622
  type: "button",
15626
15623
  role: "combobox",
@@ -15658,7 +15655,7 @@ var Xh = "SelectValue", Jh = m.forwardRef(
15658
15655
  return pt(() => {
15659
15656
  u(d);
15660
15657
  }, [u, d]), /* @__PURE__ */ c.jsx(
15661
- Ee.span,
15658
+ ke.span,
15662
15659
  {
15663
15660
  ...a,
15664
15661
  ref: f,
@@ -15672,7 +15669,7 @@ Jh.displayName = Xh;
15672
15669
  var zC = "SelectIcon", Zh = m.forwardRef(
15673
15670
  (e, t) => {
15674
15671
  const { __scopeSelect: n, children: r, ...o } = e;
15675
- return /* @__PURE__ */ c.jsx(Ee.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
15672
+ return /* @__PURE__ */ c.jsx(ke.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
15676
15673
  }
15677
15674
  );
15678
15675
  Zh.displayName = zC;
@@ -15716,7 +15713,7 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15716
15713
  avoidCollisions: g,
15717
15714
  //
15718
15715
  ...x
15719
- } = e, y = jn(Zn, n), [S, R] = m.useState(null), [C, T] = m.useState(null), k = ze(t, (G) => R(G)), [I, A] = m.useState(null), [_, D] = m.useState(
15716
+ } = e, y = jn(Zn, n), [S, R] = m.useState(null), [C, T] = m.useState(null), E = ze(t, (G) => R(G)), [I, A] = m.useState(null), [_, D] = m.useState(
15720
15717
  null
15721
15718
  ), L = Ls(n), [W, P] = m.useState(!1), Y = m.useRef(!1);
15722
15719
  m.useEffect(() => {
@@ -15834,7 +15831,7 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15834
15831
  ...x,
15835
15832
  ...Ce,
15836
15833
  onPlaced: () => P(!0),
15837
- ref: k,
15834
+ ref: E,
15838
15835
  style: {
15839
15836
  // flex layout so we can place the scroll buttons properly
15840
15837
  display: "flex",
@@ -15866,11 +15863,11 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15866
15863
  );
15867
15864
  np.displayName = HC;
15868
15865
  var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15869
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = jn(Zn, n), i = Pn(Zn, n), [a, l] = m.useState(null), [u, d] = m.useState(null), f = ze(t, (k) => d(k)), h = Ls(n), p = m.useRef(!1), w = m.useRef(!0), { viewport: v, selectedItem: g, selectedItemText: x, focusSelectedItem: y } = i, S = m.useCallback(() => {
15866
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = jn(Zn, n), i = Pn(Zn, n), [a, l] = m.useState(null), [u, d] = m.useState(null), f = ze(t, (E) => d(E)), h = Ls(n), p = m.useRef(!1), w = m.useRef(!0), { viewport: v, selectedItem: g, selectedItemText: x, focusSelectedItem: y } = i, S = m.useCallback(() => {
15870
15867
  if (s.trigger && s.valueNode && a && u && v && g && x) {
15871
- const k = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
15868
+ const E = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
15872
15869
  if (s.dir !== "rtl") {
15873
- const ce = _.left - I.left, ie = A.left - ce, $e = k.left - ie, Ke = k.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15870
+ const ce = _.left - I.left, ie = A.left - ce, $e = E.left - ie, Ke = E.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15874
15871
  Kt,
15875
15872
  // Prevents the content from going off the starting edge of the
15876
15873
  // viewport. It may still go off the ending edge, but this can be
@@ -15881,13 +15878,13 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15881
15878
  ]);
15882
15879
  a.style.minWidth = Ke + "px", a.style.left = Pe + "px";
15883
15880
  } else {
15884
- const ce = I.right - _.right, ie = window.innerWidth - A.right - ce, $e = window.innerWidth - k.right - ie, Ke = k.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15881
+ const ce = I.right - _.right, ie = window.innerWidth - A.right - ce, $e = window.innerWidth - E.right - ie, Ke = E.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15885
15882
  Kt,
15886
15883
  Math.max(Kt, Te - We)
15887
15884
  ]);
15888
15885
  a.style.minWidth = Ke + "px", a.style.right = Pe + "px";
15889
15886
  }
15890
- const D = h(), L = window.innerHeight - Kt * 2, W = v.scrollHeight, P = window.getComputedStyle(u), Y = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), J = parseInt(P.borderBottomWidth, 10), z = parseInt(P.paddingBottom, 10), $ = Y + K + W + z + J, F = Math.min(g.offsetHeight * 5, $), B = window.getComputedStyle(v), pe = parseInt(B.paddingTop, 10), ue = parseInt(B.paddingBottom, 10), ee = k.top + k.height / 2 - Kt, Ie = L - ee, Ce = g.offsetHeight / 2, G = g.offsetTop + Ce, O = Y + K + G, Q = $ - O;
15887
+ const D = h(), L = window.innerHeight - Kt * 2, W = v.scrollHeight, P = window.getComputedStyle(u), Y = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), J = parseInt(P.borderBottomWidth, 10), z = parseInt(P.paddingBottom, 10), $ = Y + K + W + z + J, F = Math.min(g.offsetHeight * 5, $), B = window.getComputedStyle(v), pe = parseInt(B.paddingTop, 10), ue = parseInt(B.paddingBottom, 10), ee = E.top + E.height / 2 - Kt, Ie = L - ee, Ce = g.offsetHeight / 2, G = g.offsetTop + Ce, O = Y + K + G, Q = $ - O;
15891
15888
  if (O <= ee) {
15892
15889
  const ce = D.length > 0 && g === D[D.length - 1].ref.current;
15893
15890
  a.style.bottom = "0px";
@@ -15927,8 +15924,8 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15927
15924
  u && C(window.getComputedStyle(u).zIndex);
15928
15925
  }, [u]);
15929
15926
  const T = m.useCallback(
15930
- (k) => {
15931
- k && w.current === !0 && (S(), y == null || y(), w.current = !1);
15927
+ (E) => {
15928
+ E && w.current === !0 && (S(), y == null || y(), w.current = !1);
15932
15929
  },
15933
15930
  [S, y]
15934
15931
  );
@@ -15950,7 +15947,7 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15950
15947
  zIndex: R
15951
15948
  },
15952
15949
  children: /* @__PURE__ */ c.jsx(
15953
- Ee.div,
15950
+ ke.div,
15954
15951
  {
15955
15952
  ...o,
15956
15953
  ref: f,
@@ -16013,7 +16010,7 @@ var [KC, Ga] = Ir(Zn, {}), Ki = "SelectViewport", op = m.forwardRef(
16013
16010
  }
16014
16011
  ),
16015
16012
  /* @__PURE__ */ c.jsx(Ds.Slot, { scope: n, children: /* @__PURE__ */ c.jsx(
16016
- Ee.div,
16013
+ ke.div,
16017
16014
  {
16018
16015
  "data-radix-select-viewport": "",
16019
16016
  role: "presentation",
@@ -16055,14 +16052,14 @@ op.displayName = Ki;
16055
16052
  var sp = "SelectGroup", [qC, GC] = Ir(sp), YC = m.forwardRef(
16056
16053
  (e, t) => {
16057
16054
  const { __scopeSelect: n, ...r } = e, o = ln();
16058
- return /* @__PURE__ */ c.jsx(qC, { scope: n, id: o, children: /* @__PURE__ */ c.jsx(Ee.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16055
+ return /* @__PURE__ */ c.jsx(qC, { scope: n, id: o, children: /* @__PURE__ */ c.jsx(ke.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16059
16056
  }
16060
16057
  );
16061
16058
  YC.displayName = sp;
16062
16059
  var ip = "SelectLabel", ap = m.forwardRef(
16063
16060
  (e, t) => {
16064
16061
  const { __scopeSelect: n, ...r } = e, o = GC(ip, n);
16065
- return /* @__PURE__ */ c.jsx(Ee.div, { id: o.id, ...r, ref: t });
16062
+ return /* @__PURE__ */ c.jsx(ke.div, { id: o.id, ...r, ref: t });
16066
16063
  }
16067
16064
  );
16068
16065
  ap.displayName = ip;
@@ -16106,7 +16103,7 @@ var es = "SelectItem", [XC, lp] = Ir(es), cp = m.forwardRef(
16106
16103
  disabled: o,
16107
16104
  textValue: d,
16108
16105
  children: /* @__PURE__ */ c.jsx(
16109
- Ee.div,
16106
+ ke.div,
16110
16107
  {
16111
16108
  role: "option",
16112
16109
  "aria-labelledby": v,
@@ -16165,7 +16162,7 @@ var Or = "SelectItemText", up = m.forwardRef(
16165
16162
  [l.disabled, l.value, p]
16166
16163
  ), { onNativeOptionAdd: v, onNativeOptionRemove: g } = u;
16167
16164
  return pt(() => (v(w), () => g(w)), [v, g, w]), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
16168
- /* @__PURE__ */ c.jsx(Ee.span, { id: l.textId, ...s, ref: h }),
16165
+ /* @__PURE__ */ c.jsx(ke.span, { id: l.textId, ...s, ref: h }),
16169
16166
  l.isSelected && i.valueNode && !i.valueNodeHasChildren ? rs.createPortal(s.children, i.valueNode) : null
16170
16167
  ] });
16171
16168
  }
@@ -16174,7 +16171,7 @@ up.displayName = Or;
16174
16171
  var dp = "SelectItemIndicator", fp = m.forwardRef(
16175
16172
  (e, t) => {
16176
16173
  const { __scopeSelect: n, ...r } = e;
16177
- return lp(dp, n).isSelected ? /* @__PURE__ */ c.jsx(Ee.span, { "aria-hidden": !0, ...r, ref: t }) : null;
16174
+ return lp(dp, n).isSelected ? /* @__PURE__ */ c.jsx(ke.span, { "aria-hidden": !0, ...r, ref: t }) : null;
16178
16175
  }
16179
16176
  );
16180
16177
  fp.displayName = dp;
@@ -16235,7 +16232,7 @@ var mp = m.forwardRef((e, t) => {
16235
16232
  const u = a().find((f) => f.ref.current === document.activeElement);
16236
16233
  (d = u == null ? void 0 : u.ref.current) == null || d.scrollIntoView({ block: "nearest" });
16237
16234
  }, [a]), /* @__PURE__ */ c.jsx(
16238
- Ee.div,
16235
+ ke.div,
16239
16236
  {
16240
16237
  "aria-hidden": !0,
16241
16238
  ...o,
@@ -16256,7 +16253,7 @@ var mp = m.forwardRef((e, t) => {
16256
16253
  }), JC = "SelectSeparator", gp = m.forwardRef(
16257
16254
  (e, t) => {
16258
16255
  const { __scopeSelect: n, ...r } = e;
16259
- return /* @__PURE__ */ c.jsx(Ee.div, { "aria-hidden": !0, ...r, ref: t });
16256
+ return /* @__PURE__ */ c.jsx(ke.div, { "aria-hidden": !0, ...r, ref: t });
16260
16257
  }
16261
16258
  );
16262
16259
  gp.displayName = JC;
@@ -16282,7 +16279,7 @@ var QC = "SelectBubbleInput", xp = m.forwardRef(
16282
16279
  d.call(a, t), a.dispatchEvent(f);
16283
16280
  }
16284
16281
  }, [i, t]), /* @__PURE__ */ c.jsx(
16285
- Ee.select,
16282
+ ke.select,
16286
16283
  {
16287
16284
  ...n,
16288
16285
  style: { ...Kh, ...n.style },
@@ -16322,7 +16319,7 @@ function bp(e, t, n) {
16322
16319
  function eT(e, t) {
16323
16320
  return e.map((n, r) => e[(t + r) % e.length]);
16324
16321
  }
16325
- var tT = qh, yp = Yh, nT = Jh, rT = Zh, oT = Qh, Sp = ep, sT = op, Cp = ap, Tp = cp, iT = up, aT = fp, Rp = hp, kp = pp, Ep = gp;
16322
+ var tT = qh, yp = Yh, nT = Jh, rT = Zh, oT = Qh, Sp = ep, sT = op, Cp = ap, Tp = cp, iT = up, aT = fp, Rp = hp, Ep = pp, kp = gp;
16326
16323
  const _c = tT, jc = nT, Xi = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
16327
16324
  yp,
16328
16325
  {
@@ -16353,7 +16350,7 @@ const Ip = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16353
16350
  ));
16354
16351
  Ip.displayName = Rp.displayName;
16355
16352
  const Np = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16356
- kp,
16353
+ Ep,
16357
16354
  {
16358
16355
  ref: n,
16359
16356
  className: te(
@@ -16364,7 +16361,7 @@ const Np = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16364
16361
  children: /* @__PURE__ */ c.jsx(dr, { className: "h-4 w-4" })
16365
16362
  }
16366
16363
  ));
16367
- Np.displayName = kp.displayName;
16364
+ Np.displayName = Ep.displayName;
16368
16365
  const Ji = m.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c.jsx(oT, { children: /* @__PURE__ */ c.jsxs(
16369
16366
  Sp,
16370
16367
  {
@@ -16419,18 +16416,18 @@ const zn = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
16419
16416
  ));
16420
16417
  zn.displayName = Tp.displayName;
16421
16418
  const cT = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16422
- Ep,
16419
+ kp,
16423
16420
  {
16424
16421
  ref: n,
16425
16422
  className: te("-mx-1 my-1 h-px bg-muted", e),
16426
16423
  ...t
16427
16424
  }
16428
16425
  ));
16429
- cT.displayName = Ep.displayName;
16426
+ cT.displayName = kp.displayName;
16430
16427
  var uT = "Separator", Pc = "horizontal", dT = ["horizontal", "vertical"], Ap = m.forwardRef((e, t) => {
16431
16428
  const { decorative: n, orientation: r = Pc, ...o } = e, s = fT(r) ? r : Pc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
16432
16429
  return /* @__PURE__ */ c.jsx(
16433
- Ee.div,
16430
+ ke.div,
16434
16431
  {
16435
16432
  "data-orientation": s,
16436
16433
  ...a,
@@ -16610,7 +16607,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16610
16607
  /* @__PURE__ */ c.jsx(om, { className: "h-5 w-5" }),
16611
16608
  "API Configuration"
16612
16609
  ] }) }),
16613
- /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16610
+ /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16614
16611
  /* @__PURE__ */ c.jsxs("div", { className: "space-y-2", children: [
16615
16612
  /* @__PURE__ */ c.jsx($t, { htmlFor: "api-url", children: "API Base URL" }),
16616
16613
  /* @__PURE__ */ c.jsxs("div", { className: "flex gap-2", children: [
@@ -16677,7 +16674,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16677
16674
  /* @__PURE__ */ c.jsx(am, { className: "h-5 w-5" }),
16678
16675
  "Interface Settings"
16679
16676
  ] }) }),
16680
- /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16677
+ /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16681
16678
  /* @__PURE__ */ c.jsxs("div", { className: "space-y-2", children: [
16682
16679
  /* @__PURE__ */ c.jsx($t, { htmlFor: "layout", children: "Layout Style" }),
16683
16680
  /* @__PURE__ */ c.jsxs(
@@ -16772,7 +16769,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16772
16769
  /* @__PURE__ */ c.jsx(lm, { className: "h-5 w-5" }),
16773
16770
  "Behavior Settings"
16774
16771
  ] }) }),
16775
- /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16772
+ /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16776
16773
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
16777
16774
  /* @__PURE__ */ c.jsxs("div", { children: [
16778
16775
  /* @__PURE__ */ c.jsx($t, { htmlFor: "auto-save", children: "Auto-save Conversations" }),