teodor-new-chat-ui 3.0.144 → 3.0.145

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
@@ -263,14 +263,14 @@ function gm() {
263
263
  } catch (bt) {
264
264
  if (bt && xe && typeof bt.stack == "string") {
265
265
  for (var Ie = bt.stack.split(`
266
- `), mt = xe.stack.split(`
267
- `), Xe = Ie.length - 1, tt = mt.length - 1; Xe >= 1 && tt >= 0 && Ie[Xe] !== mt[tt]; )
266
+ `), pt = xe.stack.split(`
267
+ `), Xe = Ie.length - 1, tt = pt.length - 1; Xe >= 1 && tt >= 0 && Ie[Xe] !== pt[tt]; )
268
268
  tt--;
269
269
  for (; Xe >= 1 && tt >= 0; Xe--, tt--)
270
- if (Ie[Xe] !== mt[tt]) {
270
+ if (Ie[Xe] !== pt[tt]) {
271
271
  if (Xe !== 1 || tt !== 1)
272
272
  do
273
- if (Xe--, tt--, tt < 0 || Ie[Xe] !== mt[tt]) {
273
+ if (Xe--, tt--, tt < 0 || Ie[Xe] !== pt[tt]) {
274
274
  var kt = `
275
275
  ` + Ie[Xe].replace(" at new ", " at ");
276
276
  return T.displayName && kt.includes("<anonymous>") && (kt = kt.replace("<anonymous>", T.displayName)), typeof T == "function" && J.set(T, kt), kt;
@@ -337,8 +337,8 @@ function gm() {
337
337
  var Ie = void 0;
338
338
  try {
339
339
  if (typeof T[Pe] != "function") {
340
- var mt = Error((xe || "React class") + ": " + ne + " type `" + Pe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[Pe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
341
- throw mt.name = "Invariant Violation", mt;
340
+ var pt = Error((xe || "React class") + ": " + ne + " type `" + Pe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[Pe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
341
+ throw pt.name = "Invariant Violation", pt;
342
342
  }
343
343
  Ie = T[Pe](z, Pe, xe, ne, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
344
344
  } catch (Xe) {
@@ -358,7 +358,7 @@ function gm() {
358
358
  return ne;
359
359
  }
360
360
  }
361
- function xt(T) {
361
+ function vt(T) {
362
362
  try {
363
363
  return it(T), !1;
364
364
  } catch {
@@ -369,7 +369,7 @@ function gm() {
369
369
  return "" + T;
370
370
  }
371
371
  function an(T) {
372
- if (xt(T))
372
+ if (vt(T))
373
373
  return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(T)), it(T);
374
374
  }
375
375
  var V = g.ReactCurrentOwner, ae = {
@@ -386,7 +386,7 @@ function gm() {
386
386
  }
387
387
  return T.ref !== void 0;
388
388
  }
389
- function ht(T) {
389
+ function xt(T) {
390
390
  if (ie.call(T, "key")) {
391
391
  var z = Object.getOwnPropertyDescriptor(T, "key").get;
392
392
  if (z && z.isReactWarning)
@@ -450,8 +450,8 @@ function gm() {
450
450
  };
451
451
  function at(T, z, ne, xe, Le) {
452
452
  {
453
- var He, Pe = {}, Ie = null, mt = null;
454
- ne !== void 0 && (an(ne), Ie = "" + ne), ht(z) && (an(z.key), Ie = "" + z.key), Re(z) && (mt = z.ref, jt(z, Le));
453
+ var He, Pe = {}, Ie = null, pt = null;
454
+ ne !== void 0 && (an(ne), Ie = "" + ne), xt(z) && (an(z.key), Ie = "" + z.key), Re(z) && (pt = z.ref, jt(z, Le));
455
455
  for (He in z)
456
456
  ie.call(z, He) && !ae.hasOwnProperty(He) && (Pe[He] = z[He]);
457
457
  if (T && T.defaultProps) {
@@ -459,14 +459,14 @@ function gm() {
459
459
  for (He in Xe)
460
460
  Pe[He] === void 0 && (Pe[He] = Xe[He]);
461
461
  }
462
- if (Ie || mt) {
462
+ if (Ie || pt) {
463
463
  var tt = typeof T == "function" ? T.displayName || T.name || "Unknown" : T;
464
- Ie && En(Pe, tt), mt && lt(Pe, tt);
464
+ Ie && En(Pe, tt), pt && lt(Pe, tt);
465
465
  }
466
- return Tt(T, Ie, mt, Le, xe, V.current, Pe);
466
+ return Tt(T, Ie, pt, Le, xe, V.current, Pe);
467
467
  }
468
468
  }
469
- var pt = g.ReactCurrentOwner, cn = g.ReactDebugCurrentFrame;
469
+ var ht = g.ReactCurrentOwner, cn = g.ReactDebugCurrentFrame;
470
470
  function Yt(T) {
471
471
  if (T) {
472
472
  var z = T._owner, ne = je(T.type, T._source, z ? z.type : null);
@@ -481,8 +481,8 @@ function gm() {
481
481
  }
482
482
  function le() {
483
483
  {
484
- if (pt.current) {
485
- var T = G(pt.current.type);
484
+ if (ht.current) {
485
+ var T = G(ht.current.type);
486
486
  if (T)
487
487
  return `
488
488
 
@@ -517,7 +517,7 @@ Check the top-level render call using <` + ne + ">.");
517
517
  return;
518
518
  Ye[ne] = !0;
519
519
  var xe = "";
520
- T && T._owner && T._owner !== pt.current && (xe = " It was passed a child from " + G(T._owner.type) + "."), Yt(T), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ne, xe), Yt(null);
520
+ T && T._owner && T._owner !== ht.current && (xe = " It was passed a child from " + G(T._owner.type) + "."), Yt(T), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ne, xe), Yt(null);
521
521
  }
522
522
  }
523
523
  function Gn(T, z) {
@@ -583,8 +583,8 @@ Check the top-level render call using <` + ne + ">.");
583
583
  if (!Pe) {
584
584
  var Ie = "";
585
585
  (T === void 0 || typeof T == "object" && T !== null && Object.keys(T).length === 0) && (Ie += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
- var mt = Oe();
587
- mt ? Ie += mt : Ie += le();
586
+ var pt = Oe();
587
+ pt ? Ie += pt : Ie += le();
588
588
  var Xe;
589
589
  T === null ? Xe = "null" : ot(T) ? Xe = "array" : T !== void 0 && T.$$typeof === t ? (Xe = "<" + (G(T.type) || "Unknown") + " />", Ie = " Did you accidentally export a JSX literal instead of a component?") : Xe = typeof T, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Xe, Ie);
590
590
  }
@@ -2999,7 +2999,7 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2999
2999
  async (V) => {
3000
3000
  const ae = (V == null ? void 0 : V.maxAttempts) ?? 5, $e = (V == null ? void 0 : V.baseDelayMs) ?? 500, qe = (V == null ? void 0 : V.timeoutMs) ?? 2e3;
3001
3001
  if (!l.baseUrl) return !1;
3002
- const Re = l.baseUrl.replace(/\/+$/, ""), ht = [
3002
+ const Re = l.baseUrl.replace(/\/+$/, ""), xt = [
3003
3003
  "/health",
3004
3004
  "/api/health",
3005
3005
  "/",
@@ -3008,25 +3008,25 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3008
3008
  "/api/v2/chat/health"
3009
3009
  ], jt = async (lt) => {
3010
3010
  try {
3011
- const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), pt = await fetch(lt, { method: "GET", signal: Tt.signal });
3012
- return clearTimeout(at), pt.ok;
3011
+ const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), ht = await fetch(lt, { method: "GET", signal: Tt.signal });
3012
+ return clearTimeout(at), ht.ok;
3013
3013
  } catch {
3014
3014
  return !1;
3015
3015
  }
3016
3016
  }, En = async (lt) => {
3017
3017
  try {
3018
- const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), pt = await fetch(lt, { method: "HEAD", signal: Tt.signal });
3019
- return clearTimeout(at), pt.ok;
3018
+ const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), ht = await fetch(lt, { method: "HEAD", signal: Tt.signal });
3019
+ return clearTimeout(at), ht.ok;
3020
3020
  } catch {
3021
3021
  return !1;
3022
3022
  }
3023
3023
  };
3024
3024
  for (let lt = 0; lt < ae; lt++) {
3025
3025
  console.debug(`[ChatProvider] health-check attempt ${lt + 1}/${ae}`);
3026
- for (const at of ht) {
3027
- let pt = at;
3028
- Re.endsWith("/api") && at.startsWith("/api") && (pt = at.replace(/^\/api/, "") || "/");
3029
- const cn = pt === "/" ? Re + "/" : Re + pt;
3026
+ for (const at of xt) {
3027
+ let ht = at;
3028
+ Re.endsWith("/api") && at.startsWith("/api") && (ht = at.replace(/^\/api/, "") || "/");
3029
+ const cn = ht === "/" ? Re + "/" : Re + ht;
3030
3030
  if (console.debug(`[ChatProvider] checking ${cn}`), await jt(cn) || at === "/" && await En(Re + "/"))
3031
3031
  return ce(!0), !0;
3032
3032
  }
@@ -3098,11 +3098,11 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3098
3098
  limit: E
3099
3099
  });
3100
3100
  A(V);
3101
- const ht = Array.isArray(Re == null ? void 0 : Re.messages) ? Re.messages : [];
3102
- ht.length > 0 && (console.log("[ChatProvider] Loading thread with", ht.length, "messages"), b(ht, {
3101
+ const xt = Array.isArray(Re == null ? void 0 : Re.messages) ? Re.messages : [];
3102
+ console.log("[ChatProvider] Loading thread with", xt.length, "messages"), b(xt, {
3103
3103
  checkpointId: (Re == null ? void 0 : Re.checkpointId) ?? null,
3104
3104
  checkpointNs: (Re == null ? void 0 : Re.checkpointNs) ?? null
3105
- })), G((Re == null ? void 0 : Re.nextCursor) ?? null), I(!!(Re != null && Re.hasMore)), Y((jt) => (Re == null ? void 0 : Re.checkpointId) ?? jt ?? void 0), oe((jt) => (Re == null ? void 0 : Re.checkpointNs) ?? jt ?? void 0);
3105
+ }), G((Re == null ? void 0 : Re.nextCursor) ?? null), I(!!(Re != null && Re.hasMore)), Y((jt) => (Re == null ? void 0 : Re.checkpointId) ?? jt ?? void 0), oe((jt) => (Re == null ? void 0 : Re.checkpointNs) ?? jt ?? void 0);
3106
3106
  } finally {
3107
3107
  _e.current = null;
3108
3108
  }
@@ -3150,18 +3150,18 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3150
3150
  await l.deleteThread(V), await H(), F === V && (A(null), C([]), I(!1), G(null), Y(void 0), oe(void 0));
3151
3151
  }, [l, H, F, C]), et = Ue(async (V, ae) => {
3152
3152
  await l.updateThread(V, ae), await H();
3153
- }, [l, H]), xt = Ue(async (V, ae) => {
3153
+ }, [l, H]), vt = Ue(async (V, ae) => {
3154
3154
  var hn;
3155
3155
  const $e = (ae == null ? void 0 : ae.attachments) || [], { contentParts: qe, filesInfo: Re } = await uv(
3156
3156
  l,
3157
3157
  $e,
3158
3158
  t == null ? void 0 : t.uploadPath
3159
- ), ht = [];
3160
- V && V.trim() && ht.push({ type: "text", text: V.trim() });
3159
+ ), xt = [];
3160
+ V && V.trim() && xt.push({ type: "text", text: V.trim() });
3161
3161
  const jt = {
3162
3162
  id: ((hn = crypto.randomUUID) == null ? void 0 : hn.call(crypto)) || `user-${Date.now()}`,
3163
3163
  role: "user",
3164
- content: ht,
3164
+ content: xt,
3165
3165
  // ← No empty text parts
3166
3166
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3167
3167
  checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? g.lastCheckpointId ?? void 0,
@@ -3171,9 +3171,9 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3171
3171
  const En = {
3172
3172
  ...jt,
3173
3173
  // No need to filter - messageContent already only contains text
3174
- content: ht
3174
+ content: xt
3175
3175
  // ← Clean content without empty parts
3176
- }, lt = { ...(ae == null ? void 0 : ae.payloadExtras) ?? {} }, Tt = !!lt.edit, at = lt.originalMessageId, pt = typeof at == "string" ? at : void 0, cn = $e && $e.length > 0, Yt = {
3176
+ }, lt = { ...(ae == null ? void 0 : ae.payloadExtras) ?? {} }, Tt = !!lt.edit, at = lt.originalMessageId, ht = typeof at == "string" ? at : void 0, cn = $e && $e.length > 0, Yt = {
3177
3177
  ...F ? { threadId: F } : {},
3178
3178
  payload: {
3179
3179
  messages: [En],
@@ -3187,7 +3187,7 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3187
3187
  nodeFilter: ae == null ? void 0 : ae.nodeFilter,
3188
3188
  config: ae == null ? void 0 : ae.config,
3189
3189
  edit: Tt,
3190
- originalMessageId: pt
3190
+ originalMessageId: ht
3191
3191
  };
3192
3192
  h(
3193
3193
  Yt,
@@ -3250,7 +3250,7 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3250
3250
  deleteThread: ot,
3251
3251
  renameThread: et,
3252
3252
  loadThread: ie,
3253
- send: xt,
3253
+ send: vt,
3254
3254
  stop: m
3255
3255
  };
3256
3256
  return /* @__PURE__ */ c.jsx(Jl.Provider, { value: an, children: e });
@@ -3786,7 +3786,7 @@ function nu(e, t, n) {
3786
3786
  }
3787
3787
  }, [a, t, i]), s;
3788
3788
  }
3789
- const gt = Me(
3789
+ const mt = Me(
3790
3790
  () => {
3791
3791
  const e = ke(), t = ke(), n = X(0), r = ke(), o = X(0), s = ke(), i = ke(), a = X(0), l = X(0), u = X(0), d = X(0), h = ke(), m = ke(), w = X(!1), x = X(!1), v = X(!1);
3792
3792
  return de(
@@ -4405,7 +4405,7 @@ const fu = Me(
4405
4405
  i
4406
4406
  ), { groupCounts: s, topItemsIndexes: i };
4407
4407
  },
4408
- Ve(rn, gt)
4408
+ Ve(rn, mt)
4409
4409
  ), Cn = Me(
4410
4410
  ([{ log: e }]) => {
4411
4411
  const t = X(!1), n = Nt(
@@ -4486,7 +4486,7 @@ const qr = Me(
4486
4486
  topListHeight: v
4487
4487
  };
4488
4488
  },
4489
- Ve(rn, gt, Sn),
4489
+ Ve(rn, mt, Sn),
4490
4490
  { singleton: !0 }
4491
4491
  );
4492
4492
  function $v(e) {
@@ -4549,7 +4549,7 @@ const Xr = Me(
4549
4549
  scrolledToInitialItem: a
4550
4550
  };
4551
4551
  },
4552
- Ve(rn, gt, qr, Cn),
4552
+ Ve(rn, mt, qr, Cn),
4553
4553
  { singleton: !0 }
4554
4554
  );
4555
4555
  function pu(e, t) {
@@ -4696,7 +4696,7 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4696
4696
  scrollDirection: p,
4697
4697
  scrollVelocity: g
4698
4698
  };
4699
- }, Ve(gt)), Fo = "top", Bo = "bottom", Ec = "none";
4699
+ }, Ve(mt)), Fo = "top", Bo = "bottom", Ec = "none";
4700
4700
  function Nc(e, t, n) {
4701
4701
  return typeof e == "number" ? n === Lr && t === Fo || n === Nr && t === Bo ? e : 0 : n === Lr ? t === Fo ? e.main : e.reverse : t === Bo ? e.main : e.reverse;
4702
4702
  }
@@ -4755,7 +4755,7 @@ const na = Me(
4755
4755
  visibleRange: u
4756
4756
  };
4757
4757
  },
4758
- Ve(gt),
4758
+ Ve(mt),
4759
4759
  { singleton: !0 }
4760
4760
  );
4761
4761
  function Wv(e, t, n) {
@@ -5028,7 +5028,7 @@ const zn = Me(
5028
5028
  );
5029
5029
  return de(me(i), s), { totalListHeight: i, totalListHeightChanged: s };
5030
5030
  },
5031
- Ve(gt, zn),
5031
+ Ve(mt, zn),
5032
5032
  { singleton: !0 }
5033
5033
  ), Vv = Me(
5034
5034
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
@@ -5044,7 +5044,7 @@ const zn = Me(
5044
5044
  );
5045
5045
  return { alignToBottom: n, paddingTopAddition: r };
5046
5046
  },
5047
- Ve(gt, gu),
5047
+ Ve(mt, gu),
5048
5048
  { singleton: !0 }
5049
5049
  ), vu = Me(() => ({
5050
5050
  context: X(null)
@@ -5092,7 +5092,7 @@ const zn = Me(
5092
5092
  scrollIntoView: d
5093
5093
  };
5094
5094
  },
5095
- Ve(rn, gt, qr, zn, Sn),
5095
+ Ve(rn, mt, qr, zn, Sn),
5096
5096
  { singleton: !0 }
5097
5097
  );
5098
5098
  function kc(e) {
@@ -5199,7 +5199,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5199
5199
  Xr,
5200
5200
  Cn,
5201
5201
  Sn,
5202
- gt,
5202
+ mt,
5203
5203
  vu,
5204
5204
  xu
5205
5205
  )
@@ -5244,7 +5244,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5244
5244
  initialScrollTop: r
5245
5245
  };
5246
5246
  },
5247
- Ve(Cn, gt, zn),
5247
+ Ve(Cn, mt, zn),
5248
5248
  { singleton: !0 }
5249
5249
  ), bu = Me(
5250
5250
  ([{ scrollVelocity: e }]) => {
@@ -5307,7 +5307,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5307
5307
  windowScrollTo: o,
5308
5308
  windowViewportRect: r
5309
5309
  };
5310
- }, Ve(gt)), Jv = Me(
5310
+ }, Ve(mt)), Jv = Me(
5311
5311
  ([
5312
5312
  { sizeRanges: e, sizes: t },
5313
5313
  { headerHeight: n, scrollTop: r },
@@ -5339,7 +5339,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5339
5339
  restoreStateFrom: d
5340
5340
  };
5341
5341
  },
5342
- Ve(rn, gt, Xr, Cn, ra)
5342
+ Ve(rn, mt, Xr, Cn, ra)
5343
5343
  );
5344
5344
  function Zv(e) {
5345
5345
  return { align: "start", index: 0, offset: e.scrollTop };
@@ -5437,7 +5437,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5437
5437
  }
5438
5438
  ), { deviation: e };
5439
5439
  },
5440
- Ve(gt, Jr, zn, rn, Sn, Zi)
5440
+ Ve(mt, Jr, zn, rn, Sn, Zi)
5441
5441
  ), nx = Me(
5442
5442
  ([
5443
5443
  e,
@@ -5543,7 +5543,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5543
5543
  Ve(
5544
5544
  rn,
5545
5545
  Xr,
5546
- gt,
5546
+ mt,
5547
5547
  Jv,
5548
5548
  Yv,
5549
5549
  zn,
@@ -6189,13 +6189,13 @@ const Ix = /* @__PURE__ */ Me(
6189
6189
  if (je === 0 && (A === 0 || ot === 0))
6190
6190
  return _c;
6191
6191
  if (Be === 0) {
6192
- const Re = ta(Ne, A), ht = Re + Math.max(je - 1, 0);
6193
- return Ex(Dc(Re, ht, _e));
6192
+ const Re = ta(Ne, A), xt = Re + Math.max(je - 1, 0);
6193
+ return Ex(Dc(Re, xt, _e));
6194
6194
  }
6195
6195
  const et = ku(ot, Be, Se);
6196
- let xt, it;
6197
- ie ? H === 0 && J === 0 && je > 0 ? (xt = 0, it = je - 1) : (xt = et * $o((H + fe) / (Ce + fe)), it = et * Oc((J + fe) / (Ce + fe)) - 1, it = Vs(A - 1, Ir(it, et - 1)), xt = Vs(it, Ir(0, xt))) : (xt = 0, it = -1);
6198
- const an = Dc(xt, it, _e), { bottom: V, top: ae } = Lc(Ae, ce, se, an), $e = Oc(A / et), qe = $e * Ce + ($e - 1) * fe - V;
6196
+ let vt, it;
6197
+ ie ? H === 0 && J === 0 && je > 0 ? (vt = 0, it = je - 1) : (vt = et * $o((H + fe) / (Ce + fe)), it = et * Oc((J + fe) / (Ce + fe)) - 1, it = Vs(A - 1, Ir(it, et - 1)), vt = Vs(it, Ir(0, vt))) : (vt = 0, it = -1);
6198
+ const an = Dc(vt, it, _e), { bottom: V, top: ae } = Lc(Ae, ce, se, an), $e = Oc(A / et), qe = $e * Ce + ($e - 1) * fe - V;
6199
6199
  return { bottom: V, itemHeight: Ce, items: an, itemWidth: Be, offsetBottom: qe, offsetTop: ae, top: ae };
6200
6200
  }
6201
6201
  )
@@ -6330,7 +6330,7 @@ const Ix = /* @__PURE__ */ Me(
6330
6330
  ...S
6331
6331
  };
6332
6332
  },
6333
- Ve(na, gt, Jr, bu, Cn, ra, Sn)
6333
+ Ve(na, mt, Jr, bu, Cn, ra, Sn)
6334
6334
  );
6335
6335
  function ku(e, t, n) {
6336
6336
  return Ir(1, $o((e + n) / ($o(t) + n)));
@@ -8794,12 +8794,12 @@ const _w = q.memo(function({
8794
8794
  );
8795
8795
  })(),
8796
8796
  Ne && /* @__PURE__ */ c.jsx("div", { className: "mt-2 grid grid-cols-2 gap-2", children: Z.map((fe, Ce) => {
8797
- const Be = fe, ot = typeof Be.width == "number" ? Be.width : void 0, et = typeof Be.height == "number" ? Be.height : void 0, xt = ot && et && et > 0 ? `${ot} / ${et}` : "4 / 3", it = ot && et && et > 0 ? Math.max(120, Math.round(et / ot * 140)) : 160;
8797
+ const Be = fe, ot = typeof Be.width == "number" ? Be.width : void 0, et = typeof Be.height == "number" ? Be.height : void 0, vt = ot && et && et > 0 ? `${ot} / ${et}` : "4 / 3", it = ot && et && et > 0 ? Math.max(120, Math.round(et / ot * 140)) : 160;
8798
8798
  return /* @__PURE__ */ c.jsxs(
8799
8799
  "div",
8800
8800
  {
8801
8801
  className: "relative border rounded overflow-hidden bg-gray-100 dark:bg-gray-900/40",
8802
- style: { aspectRatio: xt, minHeight: it },
8802
+ style: { aspectRatio: vt, minHeight: it },
8803
8803
  "data-placeholder-height": it,
8804
8804
  children: [
8805
8805
  /* @__PURE__ */ c.jsx(
@@ -11686,7 +11686,7 @@ function Hr(e) {
11686
11686
  var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS = lf, cS = df, lS = hf, uS = pf, dS = mf, fS = vf, hS = bf, Ts = "DropdownMenu", [pS, gR] = Gt(
11687
11687
  Ts,
11688
11688
  [Zd]
11689
- ), vt = Zd(), [mS, yf] = pS(Ts), Sf = (e) => {
11689
+ ), gt = Zd(), [mS, yf] = pS(Ts), Sf = (e) => {
11690
11690
  const {
11691
11691
  __scopeDropdownMenu: t,
11692
11692
  children: n,
@@ -11695,7 +11695,7 @@ var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS =
11695
11695
  defaultOpen: s,
11696
11696
  onOpenChange: i,
11697
11697
  modal: a = !0
11698
- } = e, l = vt(t), u = f.useRef(null), [d, h] = xn({
11698
+ } = e, l = gt(t), u = f.useRef(null), [d, h] = xn({
11699
11699
  prop: o,
11700
11700
  defaultProp: s ?? !1,
11701
11701
  onChange: i,
@@ -11719,7 +11719,7 @@ var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS =
11719
11719
  Sf.displayName = Ts;
11720
11720
  var Cf = "DropdownMenuTrigger", Tf = f.forwardRef(
11721
11721
  (e, t) => {
11722
- const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = yf(Cf, n), i = vt(n);
11722
+ const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = yf(Cf, n), i = gt(n);
11723
11723
  return /* @__PURE__ */ c.jsx(eS, { asChild: !0, ...i, children: /* @__PURE__ */ c.jsx(
11724
11724
  ve.button,
11725
11725
  {
@@ -11745,13 +11745,13 @@ var Cf = "DropdownMenuTrigger", Tf = f.forwardRef(
11745
11745
  );
11746
11746
  Tf.displayName = Cf;
11747
11747
  var gS = "DropdownMenuPortal", Rf = (e) => {
11748
- const { __scopeDropdownMenu: t, ...n } = e, r = vt(t);
11748
+ const { __scopeDropdownMenu: t, ...n } = e, r = gt(t);
11749
11749
  return /* @__PURE__ */ c.jsx(tS, { ...r, ...n });
11750
11750
  };
11751
11751
  Rf.displayName = gS;
11752
11752
  var Ef = "DropdownMenuContent", Nf = f.forwardRef(
11753
11753
  (e, t) => {
11754
- const { __scopeDropdownMenu: n, ...r } = e, o = yf(Ef, n), s = vt(n), i = f.useRef(!1);
11754
+ const { __scopeDropdownMenu: n, ...r } = e, o = yf(Ef, n), s = gt(n), i = f.useRef(!1);
11755
11755
  return /* @__PURE__ */ c.jsx(
11756
11756
  nS,
11757
11757
  {
@@ -11783,64 +11783,64 @@ var Ef = "DropdownMenuContent", Nf = f.forwardRef(
11783
11783
  Nf.displayName = Ef;
11784
11784
  var vS = "DropdownMenuGroup", xS = f.forwardRef(
11785
11785
  (e, t) => {
11786
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11786
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11787
11787
  return /* @__PURE__ */ c.jsx(rS, { ...o, ...r, ref: t });
11788
11788
  }
11789
11789
  );
11790
11790
  xS.displayName = vS;
11791
11791
  var bS = "DropdownMenuLabel", If = f.forwardRef(
11792
11792
  (e, t) => {
11793
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11793
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11794
11794
  return /* @__PURE__ */ c.jsx(oS, { ...o, ...r, ref: t });
11795
11795
  }
11796
11796
  );
11797
11797
  If.displayName = bS;
11798
11798
  var wS = "DropdownMenuItem", jf = f.forwardRef(
11799
11799
  (e, t) => {
11800
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11800
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11801
11801
  return /* @__PURE__ */ c.jsx(sS, { ...o, ...r, ref: t });
11802
11802
  }
11803
11803
  );
11804
11804
  jf.displayName = wS;
11805
11805
  var yS = "DropdownMenuCheckboxItem", kf = f.forwardRef((e, t) => {
11806
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11806
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11807
11807
  return /* @__PURE__ */ c.jsx(iS, { ...o, ...r, ref: t });
11808
11808
  });
11809
11809
  kf.displayName = yS;
11810
11810
  var SS = "DropdownMenuRadioGroup", CS = f.forwardRef((e, t) => {
11811
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11811
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11812
11812
  return /* @__PURE__ */ c.jsx(aS, { ...o, ...r, ref: t });
11813
11813
  });
11814
11814
  CS.displayName = SS;
11815
11815
  var TS = "DropdownMenuRadioItem", Af = f.forwardRef((e, t) => {
11816
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11816
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11817
11817
  return /* @__PURE__ */ c.jsx(cS, { ...o, ...r, ref: t });
11818
11818
  });
11819
11819
  Af.displayName = TS;
11820
11820
  var RS = "DropdownMenuItemIndicator", Pf = f.forwardRef((e, t) => {
11821
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11821
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11822
11822
  return /* @__PURE__ */ c.jsx(lS, { ...o, ...r, ref: t });
11823
11823
  });
11824
11824
  Pf.displayName = RS;
11825
11825
  var ES = "DropdownMenuSeparator", _f = f.forwardRef((e, t) => {
11826
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11826
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11827
11827
  return /* @__PURE__ */ c.jsx(uS, { ...o, ...r, ref: t });
11828
11828
  });
11829
11829
  _f.displayName = ES;
11830
11830
  var NS = "DropdownMenuArrow", IS = f.forwardRef(
11831
11831
  (e, t) => {
11832
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11832
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11833
11833
  return /* @__PURE__ */ c.jsx(dS, { ...o, ...r, ref: t });
11834
11834
  }
11835
11835
  );
11836
11836
  IS.displayName = NS;
11837
11837
  var jS = "DropdownMenuSubTrigger", Of = f.forwardRef((e, t) => {
11838
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11838
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11839
11839
  return /* @__PURE__ */ c.jsx(fS, { ...o, ...r, ref: t });
11840
11840
  });
11841
11841
  Of.displayName = jS;
11842
11842
  var kS = "DropdownMenuSubContent", Mf = f.forwardRef((e, t) => {
11843
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11843
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11844
11844
  return /* @__PURE__ */ c.jsx(
11845
11845
  hS,
11846
11846
  {
@@ -12004,7 +12004,7 @@ function ko({
12004
12004
  loadOlderMessages: B,
12005
12005
  isPostStreamFetch: G,
12006
12006
  api: _
12007
- } = Yi(), [Y, U] = ue(null), [oe, O] = ue(""), [D, K] = ue(null), [W, ee] = ue([]), [L, Z] = ue(!1), [pe, he] = ue(null), [F, A] = ue(null), [H, J] = ue(!1), [ce, se] = ue(null), [Ae, _e] = ue([]), [je, ie] = ue(null), [Ne, Se] = ue(null), [fe, Ce] = ue(!1), Be = Ke(null), ot = Ke(null), et = Ke(null), [xt, it] = ue("desktop");
12007
+ } = Yi(), [Y, U] = ue(null), [oe, O] = ue(""), [D, K] = ue(null), [W, ee] = ue([]), [L, Z] = ue(!1), [pe, he] = ue(null), [F, A] = ue(null), [H, J] = ue(!1), [ce, se] = ue(null), [Ae, _e] = ue([]), [je, ie] = ue(null), [Ne, Se] = ue(null), [fe, Ce] = ue(!1), Be = Ke(null), ot = Ke(null), et = Ke(null), [vt, it] = ue("desktop");
12008
12008
  Ze(() => {
12009
12009
  const te = () => {
12010
12010
  const le = window.innerWidth;
@@ -12105,7 +12105,7 @@ function ko({
12105
12105
  u && (U(te), O(le), K(null));
12106
12106
  }, [u]), Re = q.useCallback(() => {
12107
12107
  U(null), O(""), K(null);
12108
- }, []), ht = Ue((te, le) => {
12108
+ }, []), xt = Ue((te, le) => {
12109
12109
  qe(te, le);
12110
12110
  }, [qe]), jt = Ue((te) => {
12111
12111
  for (let le = te - 1; le >= 0; le--)
@@ -12143,7 +12143,7 @@ function ko({
12143
12143
  if (!te) return "Unknown";
12144
12144
  const le = Date.parse(te);
12145
12145
  return Number.isNaN(le) ? te : new Date(le).toLocaleString();
12146
- }, pt = async (te) => {
12146
+ }, ht = async (te) => {
12147
12147
  if (x) {
12148
12148
  Ce(!0);
12149
12149
  try {
@@ -12182,7 +12182,7 @@ function ko({
12182
12182
  value: je ?? "",
12183
12183
  onChange: (te) => {
12184
12184
  const le = te.target.value || null;
12185
- pt(le);
12185
+ ht(le);
12186
12186
  },
12187
12187
  children: [
12188
12188
  /* @__PURE__ */ c.jsx("option", { value: "", children: "Latest" }),
@@ -12204,13 +12204,13 @@ function ko({
12204
12204
  streamingAssistantId: g,
12205
12205
  streamingDebounceMs: typeof s == "number" ? s : o,
12206
12206
  followNewMessages: i,
12207
- layoutSize: xt,
12207
+ layoutSize: vt,
12208
12208
  enableMessageEditing: u,
12209
12209
  editingMessageId: Y,
12210
12210
  onStartReached: () => {
12211
12211
  an();
12212
12212
  },
12213
- onEdit: ht,
12213
+ onEdit: xt,
12214
12214
  onRegenerate: jt,
12215
12215
  onCancelEdit: Re,
12216
12216
  emptyMessage: ce ?? void 0,