teodor-new-chat-ui 4.3.494 → 4.3.496

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
@@ -671,12 +671,12 @@ function Cx() {
671
671
  if (De(R))
672
672
  return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ue(R)), Le(R);
673
673
  }
674
- var Be = b.ReactCurrentOwner, ut = {
674
+ var Be = b.ReactCurrentOwner, ct = {
675
675
  key: !0,
676
676
  ref: !0,
677
677
  __self: !0,
678
678
  __source: !0
679
- }, _t, dt;
679
+ }, _t, ut;
680
680
  function At(R) {
681
681
  if (Oe.call(R, "ref")) {
682
682
  var X = Object.getOwnPropertyDescriptor(R, "ref").get;
@@ -696,7 +696,7 @@ function Cx() {
696
696
  function Rt(R, X) {
697
697
  typeof R.ref == "string" && Be.current;
698
698
  }
699
- function ft(R, X) {
699
+ function dt(R, X) {
700
700
  {
701
701
  var oe = function() {
702
702
  _t || (_t = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", X));
@@ -710,7 +710,7 @@ function Cx() {
710
710
  function Ut(R, X) {
711
711
  {
712
712
  var oe = function() {
713
- dt || (dt = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", X));
713
+ ut || (ut = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", X));
714
714
  };
715
715
  oe.isReactWarning = !0, Object.defineProperty(R, "ref", {
716
716
  get: oe,
@@ -752,7 +752,7 @@ function Cx() {
752
752
  var ot, Ye = {}, ze = null, Bt = null;
753
753
  oe !== void 0 && (Te(oe), ze = "" + oe), gt(X) && (Te(X.key), ze = "" + X.key), At(X) && (Bt = X.ref, Rt(X, Ie));
754
754
  for (ot in X)
755
- Oe.call(X, ot) && !ut.hasOwnProperty(ot) && (Ye[ot] = X[ot]);
755
+ Oe.call(X, ot) && !ct.hasOwnProperty(ot) && (Ye[ot] = X[ot]);
756
756
  if (R && R.defaultProps) {
757
757
  var yt = R.defaultProps;
758
758
  for (ot in yt)
@@ -760,7 +760,7 @@ function Cx() {
760
760
  }
761
761
  if (ze || Bt) {
762
762
  var Et = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
763
- ze && ft(Ye, Et), Bt && Ut(Ye, Et);
763
+ ze && dt(Ye, Et), Bt && Ut(Ye, Et);
764
764
  }
765
765
  return jt(R, ze, Bt, Ie, ge, Be.current, Ye);
766
766
  }
@@ -875,7 +875,7 @@ Check the top-level render call using <` + oe + ">.");
875
875
  R.ref !== null && (qe(R), w("Invalid attribute `ref` supplied to `React.Fragment`."), qe(null));
876
876
  }
877
877
  }
878
- var it = {};
878
+ var ft = {};
879
879
  function ye(R, X, oe, ge, Ie, ot) {
880
880
  {
881
881
  var Ye = D(R);
@@ -907,14 +907,14 @@ Check the top-level render call using <` + oe + ">.");
907
907
  var Gn = Y(R), Wt = Object.keys(X).filter(function(_g) {
908
908
  return _g !== "key";
909
909
  }), wa = Wt.length > 0 ? "{key: someKey, " + Wt.join(": ..., ") + ": ...}" : "{key: someKey}";
910
- if (!it[Gn + wa]) {
910
+ if (!ft[Gn + wa]) {
911
911
  var Pg = Wt.length > 0 ? "{" + Wt.join(": ..., ") + ": ...}" : "{}";
912
912
  w(`A props object containing a "key" prop is being spread into JSX:
913
913
  let props = %s;
914
914
  <%s {...props} />
915
915
  React keys must be passed directly to JSX without using spread:
916
916
  let props = %s;
917
- <%s key={someKey} {...props} />`, wa, Gn, Pg, Gn), it[Gn + wa] = !0;
917
+ <%s key={someKey} {...props} />`, wa, Gn, Pg, Gn), ft[Gn + wa] = !0;
918
918
  }
919
919
  }
920
920
  return R === r ? We(Et) : Re(Et), Et;
@@ -3202,18 +3202,18 @@ function pw(e = {}) {
3202
3202
  throw (q = k == null ? void 0 : k.onConnectionError) == null || q.call(k, qe), K = !0, J = "error", P = qe, new Error(qe);
3203
3203
  }
3204
3204
  w(!0);
3205
- const ut = Be.body.getReader(), _t = new TextDecoder();
3206
- let dt = "", At = [];
3205
+ const ct = Be.body.getReader(), _t = new TextDecoder();
3206
+ let ut = "", At = [];
3207
3207
  E.current = 0, x(0);
3208
3208
  let gt = 0, Rt = null;
3209
- const ft = () => {
3209
+ const dt = () => {
3210
3210
  if (At.length) {
3211
3211
  const Ke = At.join("");
3212
3212
  At = [], T.current && m((qe) => qe + Ke);
3213
3213
  }
3214
3214
  Rt = null;
3215
3215
  }, Ut = () => {
3216
- typeof window < "u" && Rt == null && (Rt = requestAnimationFrame(ft));
3216
+ typeof window < "u" && Rt == null && (Rt = requestAnimationFrame(dt));
3217
3217
  };
3218
3218
  let jt = Date.now();
3219
3219
  const Mt = setInterval(() => {
@@ -3229,15 +3229,15 @@ function pw(e = {}) {
3229
3229
  ...I.current,
3230
3230
  threadId: It
3231
3231
  }), (Z = k == null ? void 0 : k.onOpen) == null || Z.call(k, { threadId: It, created: te }); ; ) {
3232
- const { value: he, done: nt } = await ut.read();
3232
+ const { value: he, done: nt } = await ct.read();
3233
3233
  if (nt) break;
3234
- dt += _t.decode(he, { stream: !0 }), dt.length > bt && (dt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3234
+ ut += _t.decode(he, { stream: !0 }), ut.length > bt && (ut = "", console.warn("Stream buffer reset: exceeded 1MB"));
3235
3235
  let de;
3236
- for (; (de = dt.indexOf(`
3236
+ for (; (de = ut.indexOf(`
3237
3237
 
3238
3238
  `)) >= 0; ) {
3239
- const Ce = dt.slice(0, de);
3240
- dt = dt.slice(de + 2);
3239
+ const Ce = ut.slice(0, de);
3240
+ ut = ut.slice(de + 2);
3241
3241
  const Ge = Ce.split(/\r?\n/), xt = [];
3242
3242
  for (const Ze of Ge)
3243
3243
  if (!(!Ze || Ze.startsWith(":")) && Ze.startsWith("data:")) {
@@ -3254,12 +3254,12 @@ function pw(e = {}) {
3254
3254
  console.debug("[use-chat] malformed SSE:", Re.slice(0, 200));
3255
3255
  continue;
3256
3256
  }
3257
- const it = cw(We) ? We.data : We;
3258
- if (!it) {
3257
+ const ft = cw(We) ? We.data : We;
3258
+ if (!ft) {
3259
3259
  console.warn("[use-chat] dropped envelope event without payload", We);
3260
3260
  continue;
3261
3261
  }
3262
- const ye = it;
3262
+ const ye = ft;
3263
3263
  jt = Date.now();
3264
3264
  const vt = ye.seq;
3265
3265
  if (vt !== void 0) {
@@ -3325,7 +3325,7 @@ function pw(e = {}) {
3325
3325
  } catch (Ze) {
3326
3326
  console.warn("[use-chat] heartbeat callback failed", Ze);
3327
3327
  }
3328
- } else if (Rt !== null && cancelAnimationFrame(Rt), ft(), ye.type === "checkpoint")
3328
+ } else if (Rt !== null && cancelAnimationFrame(Rt), dt(), ye.type === "checkpoint")
3329
3329
  v(ye.checkpointId);
3330
3330
  else if (ye.type === "error") {
3331
3331
  const Ze = ye;
@@ -3341,7 +3341,7 @@ function pw(e = {}) {
3341
3341
  }
3342
3342
  }
3343
3343
  }
3344
- ft(), J === null && !U.signal.aborted && (J = "complete");
3344
+ dt(), J === null && !U.signal.aborted && (J = "complete");
3345
3345
  } catch (Ke) {
3346
3346
  if (Ke.name === "AbortError")
3347
3347
  J = J ?? "aborted";
@@ -3351,10 +3351,10 @@ function pw(e = {}) {
3351
3351
  }
3352
3352
  } finally {
3353
3353
  try {
3354
- await ut.cancel();
3354
+ await ct.cancel();
3355
3355
  } catch {
3356
3356
  } finally {
3357
- (Fe = ut.releaseLock) == null || Fe.call(ut);
3357
+ (Fe = ct.releaseLock) == null || Fe.call(ct);
3358
3358
  }
3359
3359
  Rt !== null && typeof window < "u" && window.cancelAnimationFrame(Rt), clearInterval(Mt);
3360
3360
  }
@@ -3376,8 +3376,8 @@ function pw(e = {}) {
3376
3376
  lastStateHistory: Te,
3377
3377
  error: P
3378
3378
  });
3379
- } catch (ut) {
3380
- console.warn("[use-chat] onClosed callback failed", ut);
3379
+ } catch (ct) {
3380
+ console.warn("[use-chat] onClosed callback failed", ct);
3381
3381
  }
3382
3382
  l(!1), w(!1), y.current = null, E.current = 0, x(0), I.current = null;
3383
3383
  }
@@ -4615,11 +4615,17 @@ function Hw({
4615
4615
  const U = p.current;
4616
4616
  if (!U)
4617
4617
  throw new Error("No active thread to handle interrupt");
4618
- const J = O ? k ?? !0 : !1, P = B.current, K = {
4618
+ const J = V ? O ?? !0 : !1, P = B.current, K = {
4619
4619
  threadId: U,
4620
4620
  checkpointId: P.id ?? void 0,
4621
4621
  checkpointNs: P.namespace ?? void 0,
4622
- command: { kind: "resume", value: J }
4622
+ command: { kind: "resume", value: J },
4623
+ payload: k == null ? void 0 : k.payload,
4624
+ config: k == null ? void 0 : k.config,
4625
+ nodeFilter: k == null ? void 0 : k.nodeFilter,
4626
+ branchLabel: k == null ? void 0 : k.branchLabel,
4627
+ active_agent: k == null ? void 0 : k.active_agent,
4628
+ timelineCheckpoints: k == null ? void 0 : k.timelineCheckpoints
4623
4629
  };
4624
4630
  F(K);
4625
4631
  },
@@ -8931,7 +8937,7 @@ function ta(e, t) {
8931
8937
  function dT(e, t) {
8932
8938
  return t(e);
8933
8939
  }
8934
- function ct(...e) {
8940
+ function lt(...e) {
8935
8941
  return e;
8936
8942
  }
8937
8943
  function et(e, t) {
@@ -8966,7 +8972,7 @@ function eu(e) {
8966
8972
  function hp(e, t) {
8967
8973
  return e === t;
8968
8974
  }
8969
- function lt(e = hp) {
8975
+ function it(e = hp) {
8970
8976
  let t;
8971
8977
  return (n) => (r) => {
8972
8978
  e(t, r) || (t = r, n(r));
@@ -9131,7 +9137,7 @@ function kt(...e) {
9131
9137
  };
9132
9138
  }
9133
9139
  function be(e, t = hp) {
9134
- return Q(e, lt(t));
9140
+ return Q(e, it(t));
9135
9141
  }
9136
9142
  function li(...e) {
9137
9143
  return function(t, n) {
@@ -9628,12 +9634,12 @@ const jT = {
9628
9634
  }, Rn = Je(
9629
9635
  ([{ log: e }, { recalcInProgress: t }]) => {
9630
9636
  const n = Ve(), r = Ve(), o = $t(r, 0), s = Ve(), a = Ve(), i = ne(0), l = ne([]), c = ne(void 0), d = ne(void 0), f = ne((y, T) => Fn(y, jT[T])), m = ne(void 0), p = ne(0), v = ST(), g = $t(
9631
- Q(n, _e(l, e, p), Tn(RT, v), lt()),
9637
+ Q(n, _e(l, e, p), Tn(RT, v), it()),
9632
9638
  v
9633
9639
  ), x = $t(
9634
9640
  Q(
9635
9641
  l,
9636
- lt(),
9642
+ it(),
9637
9643
  Tn((y, T) => ({ current: T, prev: y.current }), {
9638
9644
  current: [],
9639
9645
  prev: []
@@ -9858,7 +9864,7 @@ const jT = {
9858
9864
  unshiftWith: s
9859
9865
  };
9860
9866
  },
9861
- ct(Wn, hl),
9867
+ lt(Wn, hl),
9862
9868
  { singleton: !0 }
9863
9869
  );
9864
9870
  function PT(e) {
@@ -9890,27 +9896,27 @@ const Ep = Je(
9890
9896
  kt(o, t, r),
9891
9897
  Se(([l, c]) => ra(c)),
9892
9898
  le(([l, c, d]) => mn(c.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
9893
- lt(),
9899
+ it(),
9894
9900
  le((l) => [l])
9895
9901
  ),
9896
9902
  a
9897
9903
  ), { groupCounts: s, topItemsIndexes: a };
9898
9904
  },
9899
- ct(Rn, Ht)
9905
+ lt(Rn, Ht)
9900
9906
  ), Vn = Je(
9901
9907
  ([{ log: e }]) => {
9902
9908
  const t = ne(!1), n = tn(
9903
9909
  Q(
9904
9910
  t,
9905
9911
  Se((r) => r),
9906
- lt()
9912
+ it()
9907
9913
  )
9908
9914
  );
9909
9915
  return et(t, (r) => {
9910
9916
  r && St(e)("props updated", {}, Yt.DEBUG);
9911
9917
  }), { didMount: n, propsReady: t };
9912
9918
  },
9913
- ct(Wn),
9919
+ lt(Wn),
9914
9920
  { singleton: !0 }
9915
9921
  ), _T = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
9916
9922
  function kp(e) {
@@ -9977,7 +9983,7 @@ const Mo = Je(
9977
9983
  topListHeight: g
9978
9984
  };
9979
9985
  },
9980
- ct(Rn, Ht, Wn),
9986
+ lt(Rn, Ht, Wn),
9981
9987
  { singleton: !0 }
9982
9988
  );
9983
9989
  function MT(e) {
@@ -10040,7 +10046,7 @@ const Oo = Je(
10040
10046
  scrolledToInitialItem: i
10041
10047
  };
10042
10048
  },
10043
- ct(Rn, Ht, Mo, Vn),
10049
+ lt(Rn, Ht, Mo, Vn),
10044
10050
  { singleton: !0 }
10045
10051
  );
10046
10052
  function Rp(e, t) {
@@ -10059,18 +10065,18 @@ const xo = "up", ro = "down", OT = "none", DT = {
10059
10065
  const a = ne(!1), i = ne(!0), l = Ve(), c = Ve(), d = ne(4), f = ne(LT), m = $t(
10060
10066
  Q(
10061
10067
  li(Q(be(o), ar(1), bn(!0)), Q(be(o), ar(1), bn(!1), eu(100))),
10062
- lt()
10068
+ it()
10063
10069
  ),
10064
10070
  !1
10065
10071
  ), p = $t(
10066
- Q(li(Q(n, bn(!0)), Q(n, bn(!1), eu(200))), lt()),
10072
+ Q(li(Q(n, bn(!0)), Q(n, bn(!1), eu(200))), it()),
10067
10073
  !1
10068
10074
  );
10069
10075
  pe(
10070
10076
  Q(
10071
10077
  kt(be(o), be(f)),
10072
10078
  le(([w, S]) => w <= S),
10073
- lt()
10079
+ it()
10074
10080
  ),
10075
10081
  i
10076
10082
  ), pe(Q(i, Nn(50)), c);
@@ -10099,7 +10105,7 @@ const xo = "up", ro = "down", OT = "none", DT = {
10099
10105
  state: D
10100
10106
  };
10101
10107
  }, DT),
10102
- lt((w, S) => w && w.atBottom === S.atBottom)
10108
+ it((w, S) => w && w.atBottom === S.atBottom)
10103
10109
  )
10104
10110
  ), g = $t(
10105
10111
  Q(
@@ -10147,7 +10153,7 @@ const xo = "up", ro = "down", OT = "none", DT = {
10147
10153
  Q(
10148
10154
  r,
10149
10155
  le(({ scrollTop: w }) => w),
10150
- lt(),
10156
+ it(),
10151
10157
  Tn(
10152
10158
  (w, S) => St(p) ? { direction: w.direction, prevScrollTop: S } : { direction: S < w.prevScrollTop ? xo : ro, prevScrollTop: S },
10153
10159
  { direction: ro, prevScrollTop: 0 }
@@ -10187,7 +10193,7 @@ const xo = "up", ro = "down", OT = "none", DT = {
10187
10193
  scrollDirection: x,
10188
10194
  scrollVelocity: b
10189
10195
  };
10190
- }, ct(Ht)), Ts = "top", Cs = "bottom", ou = "none";
10196
+ }, lt(Ht)), Ts = "top", Cs = "bottom", ou = "none";
10191
10197
  function su(e, t, n) {
10192
10198
  return typeof e == "number" ? n === xo && t === Ts || n === ro && t === Cs ? e : 0 : n === xo ? t === Ts ? e.main : e.reverse : t === Cs ? e.main : e.reverse;
10193
10199
  }
@@ -10232,7 +10238,7 @@ const vl = Je(
10232
10238
  }
10233
10239
  ),
10234
10240
  Se((d) => d != null),
10235
- lt(mo)
10241
+ it(mo)
10236
10242
  ),
10237
10243
  [0, 0]
10238
10244
  );
@@ -10246,7 +10252,7 @@ const vl = Je(
10246
10252
  visibleRange: c
10247
10253
  };
10248
10254
  },
10249
- ct(Ht),
10255
+ lt(Ht),
10250
10256
  { singleton: !0 }
10251
10257
  );
10252
10258
  function $T(e, t, n) {
@@ -10429,7 +10435,7 @@ const hr = Je(
10429
10435
  ),
10430
10436
  //@ts-expect-error filter needs to be fixed
10431
10437
  Se((T) => T !== null),
10432
- lt()
10438
+ it()
10433
10439
  ),
10434
10440
  La
10435
10441
  );
@@ -10466,7 +10472,7 @@ const hr = Je(
10466
10472
  _e(o, e),
10467
10473
  Se(([{ items: T }, E]) => T[T.length - 1].originalIndex === E - 1),
10468
10474
  le(([, T, E]) => [T - 1, E]),
10469
- lt(mo),
10475
+ it(mo),
10470
10476
  le(([T]) => T)
10471
10477
  )
10472
10478
  ), C = tn(
@@ -10475,7 +10481,7 @@ const hr = Je(
10475
10481
  Nn(200),
10476
10482
  Se(({ items: T, topItems: E }) => T.length > 0 && T[0].originalIndex === E.length),
10477
10483
  le(({ items: T }) => T[0].index),
10478
- lt()
10484
+ it()
10479
10485
  )
10480
10486
  ), y = tn(
10481
10487
  Q(
@@ -10492,12 +10498,12 @@ const hr = Je(
10492
10498
  startIndex: T[E].index
10493
10499
  };
10494
10500
  }),
10495
- lt(yp)
10501
+ it(yp)
10496
10502
  )
10497
10503
  );
10498
10504
  return { endReached: S, initialItemCount: x, itemsRendered: b, listState: w, rangeChanged: y, startReached: C, topItemsIndexes: g, ...m };
10499
10505
  },
10500
- ct(
10506
+ lt(
10501
10507
  Rn,
10502
10508
  Ep,
10503
10509
  vl,
@@ -10519,7 +10525,7 @@ const hr = Je(
10519
10525
  );
10520
10526
  return pe(be(a), s), { totalListHeight: a, totalListHeightChanged: s };
10521
10527
  },
10522
- ct(Ht, hr),
10528
+ lt(Ht, hr),
10523
10529
  { singleton: !0 }
10524
10530
  ), FT = Je(
10525
10531
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
@@ -10529,13 +10535,13 @@ const hr = Je(
10529
10535
  Se(([o]) => o),
10530
10536
  le(([, o, s]) => Math.max(0, o - s)),
10531
10537
  Nn(0),
10532
- lt()
10538
+ it()
10533
10539
  ),
10534
10540
  0
10535
10541
  );
10536
10542
  return { alignToBottom: n, paddingTopAddition: r };
10537
10543
  },
10538
- ct(Ht, Np),
10544
+ lt(Ht, Np),
10539
10545
  { singleton: !0 }
10540
10546
  ), Ap = Je(() => ({
10541
10547
  context: ne(null)
@@ -10583,7 +10589,7 @@ const hr = Je(
10583
10589
  scrollIntoView: d
10584
10590
  };
10585
10591
  },
10586
- ct(Rn, Ht, Mo, hr, Wn),
10592
+ lt(Rn, Ht, Mo, hr, Wn),
10587
10593
  { singleton: !0 }
10588
10594
  );
10589
10595
  function lu(e) {
@@ -10683,7 +10689,7 @@ const zT = (e, t) => typeof e == "function" ? lu(e(t)) : t && lu(e), HT = Je(
10683
10689
  }
10684
10690
  ), { autoscrollToBottom: g, followOutput: v, scrollIntoViewOnChange: S };
10685
10691
  },
10686
- ct(
10692
+ lt(
10687
10693
  Rn,
10688
10694
  Do,
10689
10695
  Mo,
@@ -10705,7 +10711,7 @@ const zT = (e, t) => typeof e == "function" ? lu(e(t)) : t && lu(e), HT = Je(
10705
10711
  ),
10706
10712
  a
10707
10713
  ), {}),
10708
- ct(Rn, Oo, hr, Vn),
10714
+ lt(Rn, Oo, hr, Vn),
10709
10715
  { singleton: !0 }
10710
10716
  ), WT = Je(
10711
10717
  ([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
@@ -10735,7 +10741,7 @@ const zT = (e, t) => typeof e == "function" ? lu(e(t)) : t && lu(e), HT = Je(
10735
10741
  initialScrollTop: r
10736
10742
  };
10737
10743
  },
10738
- ct(Vn, Ht, hr),
10744
+ lt(Vn, Ht, hr),
10739
10745
  { singleton: !0 }
10740
10746
  ), Pp = Je(
10741
10747
  ([{ scrollVelocity: e }]) => {
@@ -10754,7 +10760,7 @@ const zT = (e, t) => typeof e == "function" ? lu(e(t)) : t && lu(e), HT = Je(
10754
10760
  return !0;
10755
10761
  return a;
10756
10762
  }),
10757
- lt()
10763
+ it()
10758
10764
  ),
10759
10765
  t
10760
10766
  ), et(
@@ -10764,7 +10770,7 @@ const zT = (e, t) => typeof e == "function" ? lu(e(t)) : t && lu(e), HT = Je(
10764
10770
  }
10765
10771
  ), { isSeeking: t, scrollSeekConfiguration: r, scrollSeekRangeChanged: n, scrollVelocity: e };
10766
10772
  },
10767
- ct(Do),
10773
+ lt(Do),
10768
10774
  { singleton: !0 }
10769
10775
  ), wl = Je(([{ scrollContainerState: e, scrollTo: t }]) => {
10770
10776
  const n = Ve(), r = Ve(), o = Ve(), s = ne(!1), a = ne(void 0);
@@ -10798,7 +10804,7 @@ const zT = (e, t) => typeof e == "function" ? lu(e(t)) : t && lu(e), HT = Je(
10798
10804
  windowScrollTo: o,
10799
10805
  windowViewportRect: r
10800
10806
  };
10801
- }, ct(Ht)), VT = Je(
10807
+ }, lt(Ht)), VT = Je(
10802
10808
  ([
10803
10809
  { sizeRanges: e, sizes: t },
10804
10810
  { headerHeight: n, scrollTop: r },
@@ -10821,7 +10827,7 @@ const zT = (e, t) => typeof e == "function" ? lu(e(t)) : t && lu(e), HT = Je(
10821
10827
  s,
10822
10828
  _e(d),
10823
10829
  Se(([, p]) => p !== void 0),
10824
- lt(),
10830
+ it(),
10825
10831
  le(([, p]) => p.ranges)
10826
10832
  ),
10827
10833
  e
@@ -10830,7 +10836,7 @@ const zT = (e, t) => typeof e == "function" ? lu(e(t)) : t && lu(e), HT = Je(
10830
10836
  restoreStateFrom: d
10831
10837
  };
10832
10838
  },
10833
- ct(Rn, Ht, Oo, Vn, wl)
10839
+ lt(Rn, Ht, Oo, Vn, wl)
10834
10840
  );
10835
10841
  function KT(e) {
10836
10842
  return { align: "start", index: 0, offset: e.scrollTop };
@@ -10845,7 +10851,7 @@ const qT = Je(([{ topItemsIndexes: e }]) => {
10845
10851
  ),
10846
10852
  e
10847
10853
  ), { topItemCount: t };
10848
- }, ct(hr));
10854
+ }, lt(hr));
10849
10855
  function _p(e) {
10850
10856
  let t = !1, n;
10851
10857
  return () => (t || (t = !0, n = e()), n);
@@ -10928,7 +10934,7 @@ const GT = _p(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10928
10934
  }
10929
10935
  ), { deviation: e };
10930
10936
  },
10931
- ct(Ht, Do, hr, Rn, Wn, hl)
10937
+ lt(Ht, Do, hr, Rn, Wn, hl)
10932
10938
  ), XT = Je(
10933
10939
  ([
10934
10940
  e,
@@ -10955,7 +10961,7 @@ const GT = _p(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10955
10961
  ...c,
10956
10962
  ...d
10957
10963
  }),
10958
- ct(
10964
+ lt(
10959
10965
  vl,
10960
10966
  UT,
10961
10967
  Vn,
@@ -11031,7 +11037,7 @@ const GT = _p(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
11031
11037
  sizes: l,
11032
11038
  ...x
11033
11039
  }),
11034
- ct(
11040
+ lt(
11035
11041
  Rn,
11036
11042
  Oo,
11037
11043
  Ht,
@@ -11204,7 +11210,7 @@ const QT = /* @__PURE__ */ Je(() => {
11204
11210
  Q(
11205
11211
  n,
11206
11212
  le((c) => c[i]),
11207
- lt()
11213
+ it()
11208
11214
  ),
11209
11215
  l
11210
11216
  );
@@ -11227,7 +11233,7 @@ const QT = /* @__PURE__ */ Je(() => {
11227
11233
  };
11228
11234
  }), eC = /* @__PURE__ */ Je(
11229
11235
  ([e, t]) => ({ ...e, ...t }),
11230
- ct(Mp, QT)
11236
+ lt(Mp, QT)
11231
11237
  ), tC = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), nC = { overflowAnchor: "none", position: bl(), zIndex: 1 }, Bp = { overflowAnchor: "none" }, rC = { ...Bp, display: "inline-block", height: "100%" }, uu = /* @__PURE__ */ L.memo(function({ showTopList: e = !1 }) {
11232
11238
  const t = Ee("listState"), n = on("sizeRanges"), r = Ee("useWindowScroll"), o = Ee("customScrollParent"), s = on("windowScrollContainerState"), a = on("scrollContainerState"), i = o || r ? s : a, l = Ee("itemContent"), c = Ee("context"), d = Ee("groupContent"), f = Ee("trackItemSizes"), m = Ee("itemSize"), p = Ee("log"), v = on("gap"), g = Ee("horizontalDirection"), { callbackRef: x } = vT(
11233
11239
  n,
@@ -11517,7 +11523,7 @@ const uC = ({ children: e }) => {
11517
11523
  Q(
11518
11524
  s,
11519
11525
  le((f) => f[c]),
11520
- lt()
11526
+ it()
11521
11527
  ),
11522
11528
  d
11523
11529
  );
@@ -11542,7 +11548,7 @@ const uC = ({ children: e }) => {
11542
11548
  GroupComponent: l("Group", "tr")
11543
11549
  };
11544
11550
  });
11545
- ct(Mp, vC);
11551
+ lt(Mp, vC);
11546
11552
  bl();
11547
11553
  const du = {
11548
11554
  bottom: 0,
@@ -11686,8 +11692,8 @@ const SC = /* @__PURE__ */ Je(
11686
11692
  const Ue = Up(wt, tt, $e);
11687
11693
  let De, Le;
11688
11694
  Oe ? q === 0 && Z === 0 && Pe > 0 ? (De = 0, Le = Pe - 1) : (De = Ue * Es((q + Fe) / (mt + Fe)), Le = Ue * fu((Z + Fe) / (mt + Fe)) - 1, Le = Ba(j - 1, oo(Le, Ue - 1)), De = Ba(Le, oo(0, De))) : (De = 0, Le = -1);
11689
- const Te = hu(De, Le, we), { bottom: Be, top: ut } = mu(ve, re, ae, Te), _t = fu(j / Ue), dt = _t * mt + (_t - 1) * Fe - Be;
11690
- return { bottom: Be, itemHeight: mt, items: Te, itemWidth: tt, offsetBottom: dt, offsetTop: ut, top: ut };
11695
+ const Te = hu(De, Le, we), { bottom: Be, top: ct } = mu(ve, re, ae, Te), _t = fu(j / Ue), ut = _t * mt + (_t - 1) * Fe - Be;
11696
+ return { bottom: Be, itemHeight: mt, items: Te, itemWidth: tt, offsetBottom: ut, offsetTop: ct, top: ct };
11691
11697
  }
11692
11698
  )
11693
11699
  ),
@@ -11707,7 +11713,7 @@ const SC = /* @__PURE__ */ Je(
11707
11713
  const { bottom: ae, top: ve } = mu(j, re, q, Z);
11708
11714
  return [ve, ae];
11709
11715
  }),
11710
- lt(mo)
11716
+ it(mo)
11711
11717
  ),
11712
11718
  t
11713
11719
  );
@@ -11730,14 +11736,14 @@ const SC = /* @__PURE__ */ Je(
11730
11736
  return (Z || j.bottom > 0 && j.itemHeight > 0 && j.offsetBottom === 0 && j.items.length === q) && re;
11731
11737
  }),
11732
11738
  le(([[, j]]) => j - 1),
11733
- lt()
11739
+ it()
11734
11740
  )
11735
11741
  ), $ = tn(
11736
11742
  Q(
11737
11743
  be(I),
11738
11744
  Se(({ items: j }) => j.length > 0 && j[0].index === 0),
11739
11745
  bn(0),
11740
- lt()
11746
+ it()
11741
11747
  )
11742
11748
  ), z = tn(
11743
11749
  Q(
@@ -11748,7 +11754,7 @@ const SC = /* @__PURE__ */ Je(
11748
11754
  endIndex: j[j.length - 1].index,
11749
11755
  startIndex: j[0].index
11750
11756
  })),
11751
- lt(yp),
11757
+ it(yp),
11752
11758
  Nn(0)
11753
11759
  )
11754
11760
  );
@@ -11821,7 +11827,7 @@ const SC = /* @__PURE__ */ Je(
11821
11827
  ...y
11822
11828
  };
11823
11829
  },
11824
- ct(vl, Ht, Do, Pp, Vn, wl, Wn)
11830
+ lt(vl, Ht, Do, Pp, Vn, wl, Wn)
11825
11831
  );
11826
11832
  function Up(e, t, n) {
11827
11833
  return oo(1, Es((e + n) / (Es(t) + n)));
@@ -11842,7 +11848,7 @@ const TC = /* @__PURE__ */ Je(() => {
11842
11848
  Q(
11843
11849
  t,
11844
11850
  le((p) => p[f]),
11845
- lt()
11851
+ it()
11846
11852
  ),
11847
11853
  m
11848
11854
  ), c = ne(!1), d = ne(!1);
@@ -11866,7 +11872,7 @@ const TC = /* @__PURE__ */ Je(() => {
11866
11872
  };
11867
11873
  }), CC = /* @__PURE__ */ Je(
11868
11874
  ([e, t]) => ({ ...e, ...t }),
11869
- ct(SC, TC)
11875
+ lt(SC, TC)
11870
11876
  ), EC = /* @__PURE__ */ L.memo(function() {
11871
11877
  const e = ht("gridState"), t = ht("listClassName"), n = ht("itemClassName"), r = ht("itemContent"), o = ht("computeItemKey"), s = ht("isSeeking"), a = sn("scrollHeight"), i = ht("ItemComponent"), l = ht("ListComponent"), c = ht("ScrollSeekPlaceholder"), d = ht("context"), f = sn("itemDimensions"), m = sn("gap"), p = ht("log"), v = ht("stateRestoreInProgress"), g = sn("reportReadyState"), x = pr(
11872
11878
  L.useMemo(
@@ -15212,13 +15218,13 @@ const Ml = $g(function({
15212
15218
  interruptParts: wt
15213
15219
  } = we, Ue = b ?? g !== 0, De = He(() => wt.length ? wt[0] : null, [wt]), Le = ie(async () => {
15214
15220
  const Re = P ? mt : $e;
15215
- async function We(it) {
15221
+ async function We(ft) {
15216
15222
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
15217
- await navigator.clipboard.writeText(it);
15223
+ await navigator.clipboard.writeText(ft);
15218
15224
  return;
15219
15225
  }
15220
15226
  if (navigator.clipboard && typeof navigator.clipboard.write == "function" && typeof ClipboardItem < "u") {
15221
- const ye = new Blob([it], { type: "text/plain" });
15227
+ const ye = new Blob([ft], { type: "text/plain" });
15222
15228
  await navigator.clipboard.write([
15223
15229
  new ClipboardItem({
15224
15230
  "text/plain": ye
@@ -15230,21 +15236,20 @@ const Ml = $g(function({
15230
15236
  }
15231
15237
  try {
15232
15238
  await We(Re), D(!0), setTimeout(() => D(!1), 2e3), C == null || C(Re);
15233
- } catch (it) {
15234
- console.error("Failed to copy:", it);
15239
+ } catch (ft) {
15240
+ console.error("Failed to copy:", ft);
15235
15241
  }
15236
15242
  }, [P, mt, $e, C]), Te = ie(
15237
15243
  async (Re, We) => {
15238
15244
  if (!De)
15239
15245
  return;
15240
- const it = wd(De.id);
15241
- if (!it) {
15246
+ if (!wd(De.id)) {
15242
15247
  console.warn("Interrupt part missing id", De);
15243
15248
  return;
15244
15249
  }
15245
15250
  O(!0);
15246
15251
  try {
15247
- await H(it, Re, We);
15252
+ await H(Re, We);
15248
15253
  } catch (ye) {
15249
15254
  console.error("Failed to respond to interrupt:", ye);
15250
15255
  } finally {
@@ -15255,21 +15260,21 @@ const Ml = $g(function({
15255
15260
  ), Be = ie(
15256
15261
  () => Te(!0),
15257
15262
  [Te]
15258
- ), ut = ie(
15263
+ ), ct = ie(
15259
15264
  () => Te(!1),
15260
15265
  [Te]
15261
15266
  ), _t = ie(
15262
15267
  (Re, We) => {
15263
15268
  if (!We)
15264
15269
  return;
15265
- const it = {
15270
+ const ft = {
15266
15271
  alternativeId: We.id ?? We.label ?? void 0,
15267
15272
  alternativeLabel: We.label
15268
15273
  };
15269
- Te(!0, it);
15274
+ Te(!0, ft);
15270
15275
  },
15271
15276
  [Te]
15272
- ), dt = ie(() => {
15277
+ ), ut = ie(() => {
15273
15278
  if (!w || !t.id) return;
15274
15279
  const Re = (P ? mt : $e) ?? "", We = "type" in t && t.type === "default_message" ? void 0 : {
15275
15280
  checkpointId: t.checkpointId ?? null,
@@ -15376,7 +15381,7 @@ const Ml = $g(function({
15376
15381
  toolArtifactRenderers: p,
15377
15382
  interruptPart: De,
15378
15383
  handleInterruptApprove: Be,
15379
- handleInterruptReject: ut,
15384
+ handleInterruptReject: ct,
15380
15385
  handleInterruptAlternative: _t,
15381
15386
  disableInterruptActions: V,
15382
15387
  isInterruptMessage: J
@@ -15420,7 +15425,7 @@ const Ml = $g(function({
15420
15425
  toolMeta: Fe,
15421
15426
  onToggleToolView: Rt,
15422
15427
  onCopy: Le,
15423
- onEdit: dt,
15428
+ onEdit: ut,
15424
15429
  onRegenerate: At,
15425
15430
  showCheckpointControls: he,
15426
15431
  attemptCount: y,
@@ -15466,7 +15471,7 @@ const Ml = $g(function({
15466
15471
  {
15467
15472
  variant: "ghost",
15468
15473
  size: "sm",
15469
- onClick: dt,
15474
+ onClick: ut,
15470
15475
  className: ee("h-6 w-6 p-0 hover:bg-background/50 text-current", k && "h-5 w-5"),
15471
15476
  children: /* @__PURE__ */ u.jsx($u, { className: ee("text-current", k ? "h-3 w-3" : "h-4 w-4") })
15472
15477
  }
@@ -15741,14 +15746,14 @@ function ao({
15741
15746
  return;
15742
15747
  }
15743
15748
  try {
15744
- we(), await V(j, je, R);
15749
+ we(), await V(je, R);
15745
15750
  } catch (X) {
15746
15751
  console.error("Failed to respond to interrupt:", X);
15747
15752
  } finally {
15748
15753
  Pe();
15749
15754
  }
15750
15755
  },
15751
- [j, Pe, we, V]
15756
+ [Pe, we, V]
15752
15757
  ), Xe = ie(
15753
15758
  () => Oe(!0),
15754
15759
  [Oe]
@@ -15758,7 +15763,7 @@ function ao({
15758
15763
  ), Fe = ie(
15759
15764
  (je, R) => Oe(!0, R),
15760
15765
  [Oe]
15761
- ), mt = !!N || Z, [tt, wt] = ue(null), [Ue, De] = ue(""), [Le, Te] = ue(null), [Be, ut] = ue(null), [_t, dt] = ue(!1), [At, gt] = ue(null), Rt = Ae(!1), [ft, Ut] = ue(() => Eu.value), jt = Ae(ft), Mt = Ae(null), bt = ie((je) => {
15766
+ ), mt = !!N || Z, [tt, wt] = ue(null), [Ue, De] = ue(""), [Le, Te] = ue(null), [Be, ct] = ue(null), [_t, ut] = ue(!1), [At, gt] = ue(null), Rt = Ae(!1), [dt, Ut] = ue(() => Eu.value), jt = Ae(dt), Mt = Ae(null), bt = ie((je) => {
15762
15767
  Eu.value = je, Ut(je);
15763
15768
  }, []), [Ke, qe] = ue(!1), It = Ae(null), te = ie(
15764
15769
  (je) => {
@@ -15781,8 +15786,8 @@ function ao({
15781
15786
  }, []), Qe(() => {
15782
15787
  Rt.current = !1;
15783
15788
  }, [K]), Qe(() => {
15784
- jt.current = ft;
15785
- }, [ft]), Qe(() => {
15789
+ jt.current = dt;
15790
+ }, [dt]), Qe(() => {
15786
15791
  if (!tt) {
15787
15792
  Mt.current = null;
15788
15793
  return;
@@ -15825,10 +15830,10 @@ function ao({
15825
15830
  edit: !!tt,
15826
15831
  originalMessageId: tt ?? void 0
15827
15832
  }
15828
- ), x == null || x(X), ve(!0), bt(""), ut(null), wt(null), De(""), Te(null);
15833
+ ), x == null || x(X), ve(!0), bt(""), ct(null), wt(null), De(""), Te(null);
15829
15834
  } catch (oe) {
15830
15835
  const ge = (oe == null ? void 0 : oe.message) || "Failed to send message";
15831
- ut(ge), w == null || w(ge), ve(!1);
15836
+ ct(ge), w == null || w(ge), ve(!1);
15832
15837
  }
15833
15838
  }, Ce = ie(
15834
15839
  async (je) => {
@@ -15843,15 +15848,15 @@ function ao({
15843
15848
  [A, $, p, b, J]
15844
15849
  ), Ge = L.useCallback(
15845
15850
  (je, R, X) => {
15846
- c && (Mt.current = ft, wt(je), De(R), bt(R), ut(null), Te({
15851
+ c && (Mt.current = dt, wt(je), De(R), bt(R), ct(null), Te({
15847
15852
  checkpointId: (X == null ? void 0 : X.checkpointId) ?? null,
15848
15853
  checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? null
15849
15854
  }));
15850
15855
  },
15851
- [ft, c, bt]
15856
+ [dt, c, bt]
15852
15857
  ), xt = L.useCallback(() => {
15853
- wt(null), De(""), Te(null), ut(null), bt(Mt.current ?? ft), Mt.current = null;
15854
- }, [ft, bt]), Re = ie(
15858
+ wt(null), De(""), Te(null), ct(null), bt(Mt.current ?? dt), Mt.current = null;
15859
+ }, [dt, bt]), Re = ie(
15855
15860
  (je, R, X) => {
15856
15861
  Ge(je, R, X);
15857
15862
  },
@@ -15880,7 +15885,7 @@ function ao({
15880
15885
  originalMessageId: R.id
15881
15886
  }
15882
15887
  );
15883
- }, [I, J, A, $, p]), it = ie(
15888
+ }, [I, J, A, $, p]), ft = ie(
15884
15889
  async (je) => {
15885
15890
  if (T) {
15886
15891
  qe(!0);
@@ -15911,9 +15916,9 @@ function ao({
15911
15916
  ]
15912
15917
  ), ye = ie(
15913
15918
  async (je, R, X) => {
15914
- await it(X ? null : je);
15919
+ await ft(X ? null : je);
15915
15920
  },
15916
- [it]
15921
+ [ft]
15917
15922
  ), vt = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${v.container || ""}`, Ze = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 ${N ? "pb-32" : ""} bg-transparent ${v.messagesArea || ""}`, pt = `relative flex-shrink-0 w-full border-t p-4 bg-transparent ${v.inputArea || ""}`;
15918
15923
  return /* @__PURE__ */ u.jsxs("div", { className: vt, children: [
15919
15924
  !!k && !_t && /* @__PURE__ */ u.jsxs("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
@@ -15923,7 +15928,7 @@ function ao({
15923
15928
  {
15924
15929
  variant: "ghost",
15925
15930
  size: "sm",
15926
- onClick: () => dt(!0),
15931
+ onClick: () => ut(!0),
15927
15932
  className: "text-red-800 hover:bg-red-100",
15928
15933
  "aria-label": "Dismiss error",
15929
15934
  children: /* @__PURE__ */ u.jsx(rr, { size: 16 })
@@ -16015,7 +16020,7 @@ function ao({
16015
16020
  /* @__PURE__ */ u.jsx(
16016
16021
  iT,
16017
16022
  {
16018
- composerValue: ft,
16023
+ composerValue: dt,
16019
16024
  onComposerChange: te,
16020
16025
  onSend: de,
16021
16026
  onCancelEdit: xt,
@@ -17178,7 +17183,7 @@ function wi({
17178
17183
  ), Te = He(() => {
17179
17184
  const te = b ?? [], he = Pe.trim().toLowerCase();
17180
17185
  return he ? S ? te.filter((nt) => S(nt, he)) : te.filter((nt) => `${nt.label} ${nt.secondaryLabel ?? ""}`.toLowerCase().includes(he)) : te;
17181
- }, [b, Pe, S]), Be = mt === "shared", ut = Be ? y : U, _t = Be ? _ : I, dt = Be ? "No shared conversations yet" : "No conversations yet", At = (te) => {
17186
+ }, [b, Pe, S]), Be = mt === "shared", ct = Be ? y : U, _t = Be ? _ : I, ut = Be ? "No shared conversations yet" : "No conversations yet", At = (te) => {
17182
17187
  const he = te.sharedAt ? ` • ${Ke(te.sharedAt)}` : "";
17183
17188
  return `Shared by ${te.sharedByUserId}${he}`;
17184
17189
  }, gt = (te) => "sharedByUserId" in te;
@@ -17210,7 +17215,7 @@ function wi({
17210
17215
  } catch (he) {
17211
17216
  console.error("Failed to select thread:", he);
17212
17217
  }
17213
- }, ft = async () => {
17218
+ }, dt = async () => {
17214
17219
  try {
17215
17220
  Z(!0);
17216
17221
  const te = await M();
@@ -17264,7 +17269,7 @@ function wi({
17264
17269
  t && /* @__PURE__ */ u.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ u.jsxs(
17265
17270
  rt,
17266
17271
  {
17267
- onClick: ft,
17272
+ onClick: dt,
17268
17273
  disabled: q || I,
17269
17274
  className: s.createButton || "px-3 py-2 gap-1",
17270
17275
  size: "sm",
@@ -17316,10 +17321,10 @@ function wi({
17316
17321
  children: /* @__PURE__ */ u.jsx("div", { className: "p-2 space-y-1 pb-4", children: _t ? /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-center justify-center gap-2 py-8 text-slate-400", children: [
17317
17322
  /* @__PURE__ */ u.jsx(Zn, { className: "h-5 w-5 animate-spin" }),
17318
17323
  /* @__PURE__ */ u.jsx("span", { className: "text-sm", children: "Loading threads…" })
17319
- ] }) : ut.length === 0 ? /* @__PURE__ */ u.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
17324
+ ] }) : ct.length === 0 ? /* @__PURE__ */ u.jsxs("div", { className: "text-center py-8 text-slate-400", children: [
17320
17325
  /* @__PURE__ */ u.jsx(zu, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
17321
- /* @__PURE__ */ u.jsx("p", { className: "text-sm text-slate-500", children: dt })
17322
- ] }) : ut.slice().sort((te, he) => new Date(he.updatedAt || he.createdAt || "").getTime() - new Date(te.updatedAt || te.createdAt || "").getTime()).map((te) => /* @__PURE__ */ u.jsx(
17326
+ /* @__PURE__ */ u.jsx("p", { className: "text-sm text-slate-500", children: ut })
17327
+ ] }) : ct.slice().sort((te, he) => new Date(he.updatedAt || he.createdAt || "").getTime() - new Date(te.updatedAt || te.createdAt || "").getTime()).map((te) => /* @__PURE__ */ u.jsx(
17323
17328
  Tk,
17324
17329
  {
17325
17330
  thread: te,
@@ -19760,11 +19765,11 @@ function UI(e) {
19760
19765
  }
19761
19766
  var WI = (e) => {
19762
19767
  var t, n, r, o, s, a, i, l, c, d, f;
19763
- let { invert: m, toast: p, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: S, toasts: C, expanded: y, removeToast: T, defaultRichColors: E, closeButton: I, style: _, cancelButtonStyle: D, actionButtonStyle: F, className: B = "", descriptionClassName: Y = "", duration: M, position: G, gap: H, loadingIcon: V, expandByDefault: O, classNames: k, icons: U, closeButtonAriaLabel: J = "Close toast", pauseWhenPageIsHidden: P } = e, [K, A] = L.useState(null), [$, z] = L.useState(null), [N, j] = L.useState(!1), [q, Z] = L.useState(!1), [re, ae] = L.useState(!1), [ve, we] = L.useState(!1), [Pe, Oe] = L.useState(!1), [Xe, $e] = L.useState(0), [Fe, mt] = L.useState(0), tt = L.useRef(p.duration || M || _u), wt = L.useRef(null), Ue = L.useRef(null), De = S === 0, Le = S + 1 <= b, Te = p.type, Be = p.dismissible !== !1, ut = p.className || "", _t = p.descriptionClassName || "", dt = L.useMemo(() => w.findIndex((de) => de.toastId === p.id) || 0, [w, p.id]), At = L.useMemo(() => {
19768
+ let { invert: m, toast: p, unstyled: v, interacting: g, setHeights: x, visibleToasts: b, heights: w, index: S, toasts: C, expanded: y, removeToast: T, defaultRichColors: E, closeButton: I, style: _, cancelButtonStyle: D, actionButtonStyle: F, className: B = "", descriptionClassName: Y = "", duration: M, position: G, gap: H, loadingIcon: V, expandByDefault: O, classNames: k, icons: U, closeButtonAriaLabel: J = "Close toast", pauseWhenPageIsHidden: P } = e, [K, A] = L.useState(null), [$, z] = L.useState(null), [N, j] = L.useState(!1), [q, Z] = L.useState(!1), [re, ae] = L.useState(!1), [ve, we] = L.useState(!1), [Pe, Oe] = L.useState(!1), [Xe, $e] = L.useState(0), [Fe, mt] = L.useState(0), tt = L.useRef(p.duration || M || _u), wt = L.useRef(null), Ue = L.useRef(null), De = S === 0, Le = S + 1 <= b, Te = p.type, Be = p.dismissible !== !1, ct = p.className || "", _t = p.descriptionClassName || "", ut = L.useMemo(() => w.findIndex((de) => de.toastId === p.id) || 0, [w, p.id]), At = L.useMemo(() => {
19764
19769
  var de;
19765
19770
  return (de = p.closeButton) != null ? de : I;
19766
- }, [p.closeButton, I]), gt = L.useMemo(() => p.duration || M || _u, [p.duration, M]), Rt = L.useRef(0), ft = L.useRef(0), Ut = L.useRef(0), jt = L.useRef(null), [Mt, bt] = G.split("-"), Ke = L.useMemo(() => w.reduce((de, Ce, Ge) => Ge >= dt ? de : de + Ce.height, 0), [w, dt]), qe = II(), It = p.invert || m, te = Te === "loading";
19767
- ft.current = L.useMemo(() => dt * H + Ke, [dt, Ke]), L.useEffect(() => {
19771
+ }, [p.closeButton, I]), gt = L.useMemo(() => p.duration || M || _u, [p.duration, M]), Rt = L.useRef(0), dt = L.useRef(0), Ut = L.useRef(0), jt = L.useRef(null), [Mt, bt] = G.split("-"), Ke = L.useMemo(() => w.reduce((de, Ce, Ge) => Ge >= ut ? de : de + Ce.height, 0), [w, ut]), qe = II(), It = p.invert || m, te = Te === "loading";
19772
+ dt.current = L.useMemo(() => ut * H + Ke, [ut, Ke]), L.useEffect(() => {
19768
19773
  tt.current = gt;
19769
19774
  }, [gt]), L.useEffect(() => {
19770
19775
  j(!0);
@@ -19782,10 +19787,10 @@ var WI = (e) => {
19782
19787
  de.style.height = Ce, mt(Ge), x((xt) => xt.find((Re) => Re.toastId === p.id) ? xt.map((Re) => Re.toastId === p.id ? { ...Re, height: Ge } : Re) : [{ toastId: p.id, height: Ge, position: p.position }, ...xt]);
19783
19788
  }, [N, p.title, p.description, x, p.id]);
19784
19789
  let he = L.useCallback(() => {
19785
- Z(!0), $e(ft.current), x((de) => de.filter((Ce) => Ce.toastId !== p.id)), setTimeout(() => {
19790
+ Z(!0), $e(dt.current), x((de) => de.filter((Ce) => Ce.toastId !== p.id)), setTimeout(() => {
19786
19791
  T(p);
19787
19792
  }, HI);
19788
- }, [p, T, x, ft]);
19793
+ }, [p, T, x, dt]);
19789
19794
  L.useEffect(() => {
19790
19795
  if (p.promise && Te === "loading" || p.duration === 1 / 0 || p.type === "loading") return;
19791
19796
  let de;
@@ -19806,27 +19811,27 @@ var WI = (e) => {
19806
19811
  var de, Ce, Ge;
19807
19812
  return U != null && U.loading ? L.createElement("div", { className: un(k == null ? void 0 : k.loader, (de = p == null ? void 0 : p.classNames) == null ? void 0 : de.loader, "sonner-loader"), "data-visible": Te === "loading" }, U.loading) : V ? L.createElement("div", { className: un(k == null ? void 0 : k.loader, (Ce = p == null ? void 0 : p.classNames) == null ? void 0 : Ce.loader, "sonner-loader"), "data-visible": Te === "loading" }, V) : L.createElement(SI, { className: un(k == null ? void 0 : k.loader, (Ge = p == null ? void 0 : p.classNames) == null ? void 0 : Ge.loader), visible: Te === "loading" });
19808
19813
  }
19809
- return L.createElement("li", { tabIndex: 0, ref: Ue, className: un(B, ut, k == null ? void 0 : k.toast, (t = p == null ? void 0 : p.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[Te], (n = p == null ? void 0 : p.classNames) == null ? void 0 : n[Te]), "data-sonner-toast": "", "data-rich-colors": (r = p.richColors) != null ? r : E, "data-styled": !(p.jsx || p.unstyled || v), "data-mounted": N, "data-promise": !!p.promise, "data-swiped": Pe, "data-removed": q, "data-visible": Le, "data-y-position": Mt, "data-x-position": bt, "data-index": S, "data-front": De, "data-swiping": re, "data-dismissible": Be, "data-type": Te, "data-invert": It, "data-swipe-out": ve, "data-swipe-direction": $, "data-expanded": !!(y || O && N), style: { "--index": S, "--toasts-before": S, "--z-index": C.length - S, "--offset": `${q ? Xe : ft.current}px`, "--initial-height": O ? "auto" : `${Fe}px`, ..._, ...p.style }, onDragEnd: () => {
19814
+ return L.createElement("li", { tabIndex: 0, ref: Ue, className: un(B, ct, k == null ? void 0 : k.toast, (t = p == null ? void 0 : p.classNames) == null ? void 0 : t.toast, k == null ? void 0 : k.default, k == null ? void 0 : k[Te], (n = p == null ? void 0 : p.classNames) == null ? void 0 : n[Te]), "data-sonner-toast": "", "data-rich-colors": (r = p.richColors) != null ? r : E, "data-styled": !(p.jsx || p.unstyled || v), "data-mounted": N, "data-promise": !!p.promise, "data-swiped": Pe, "data-removed": q, "data-visible": Le, "data-y-position": Mt, "data-x-position": bt, "data-index": S, "data-front": De, "data-swiping": re, "data-dismissible": Be, "data-type": Te, "data-invert": It, "data-swipe-out": ve, "data-swipe-direction": $, "data-expanded": !!(y || O && N), style: { "--index": S, "--toasts-before": S, "--z-index": C.length - S, "--offset": `${q ? Xe : dt.current}px`, "--initial-height": O ? "auto" : `${Fe}px`, ..._, ...p.style }, onDragEnd: () => {
19810
19815
  ae(!1), A(null), jt.current = null;
19811
19816
  }, onPointerDown: (de) => {
19812
- te || !Be || (wt.current = /* @__PURE__ */ new Date(), $e(ft.current), de.target.setPointerCapture(de.pointerId), de.target.tagName !== "BUTTON" && (ae(!0), jt.current = { x: de.clientX, y: de.clientY }));
19817
+ te || !Be || (wt.current = /* @__PURE__ */ new Date(), $e(dt.current), de.target.setPointerCapture(de.pointerId), de.target.tagName !== "BUTTON" && (ae(!0), jt.current = { x: de.clientX, y: de.clientY }));
19813
19818
  }, onPointerUp: () => {
19814
19819
  var de, Ce, Ge, xt;
19815
19820
  if (ve || !Be) return;
19816
19821
  jt.current = null;
19817
- let Re = Number(((de = Ue.current) == null ? void 0 : de.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), We = Number(((Ce = Ue.current) == null ? void 0 : Ce.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), it = (/* @__PURE__ */ new Date()).getTime() - ((Ge = wt.current) == null ? void 0 : Ge.getTime()), ye = K === "x" ? Re : We, vt = Math.abs(ye) / it;
19822
+ let Re = Number(((de = Ue.current) == null ? void 0 : de.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), We = Number(((Ce = Ue.current) == null ? void 0 : Ce.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), ft = (/* @__PURE__ */ new Date()).getTime() - ((Ge = wt.current) == null ? void 0 : Ge.getTime()), ye = K === "x" ? Re : We, vt = Math.abs(ye) / ft;
19818
19823
  if (Math.abs(ye) >= zI || vt > 0.11) {
19819
- $e(ft.current), (xt = p.onDismiss) == null || xt.call(p, p), z(K === "x" ? Re > 0 ? "right" : "left" : We > 0 ? "down" : "up"), he(), we(!0), Oe(!1);
19824
+ $e(dt.current), (xt = p.onDismiss) == null || xt.call(p, p), z(K === "x" ? Re > 0 ? "right" : "left" : We > 0 ? "down" : "up"), he(), we(!0), Oe(!1);
19820
19825
  return;
19821
19826
  }
19822
19827
  ae(!1), A(null);
19823
19828
  }, onPointerMove: (de) => {
19824
19829
  var Ce, Ge, xt, Re;
19825
19830
  if (!jt.current || !Be || ((Ce = window.getSelection()) == null ? void 0 : Ce.toString().length) > 0) return;
19826
- let We = de.clientY - jt.current.y, it = de.clientX - jt.current.x, ye = (Ge = e.swipeDirections) != null ? Ge : UI(G);
19827
- !K && (Math.abs(it) > 1 || Math.abs(We) > 1) && A(Math.abs(it) > Math.abs(We) ? "x" : "y");
19831
+ let We = de.clientY - jt.current.y, ft = de.clientX - jt.current.x, ye = (Ge = e.swipeDirections) != null ? Ge : UI(G);
19832
+ !K && (Math.abs(ft) > 1 || Math.abs(We) > 1) && A(Math.abs(ft) > Math.abs(We) ? "x" : "y");
19828
19833
  let vt = { x: 0, y: 0 };
19829
- K === "y" ? (ye.includes("top") || ye.includes("bottom")) && (ye.includes("top") && We < 0 || ye.includes("bottom") && We > 0) && (vt.y = We) : K === "x" && (ye.includes("left") || ye.includes("right")) && (ye.includes("left") && it < 0 || ye.includes("right") && it > 0) && (vt.x = it), (Math.abs(vt.x) > 0 || Math.abs(vt.y) > 0) && Oe(!0), (xt = Ue.current) == null || xt.style.setProperty("--swipe-amount-x", `${vt.x}px`), (Re = Ue.current) == null || Re.style.setProperty("--swipe-amount-y", `${vt.y}px`);
19834
+ K === "y" ? (ye.includes("top") || ye.includes("bottom")) && (ye.includes("top") && We < 0 || ye.includes("bottom") && We > 0) && (vt.y = We) : K === "x" && (ye.includes("left") || ye.includes("right")) && (ye.includes("left") && ft < 0 || ye.includes("right") && ft > 0) && (vt.x = ft), (Math.abs(vt.x) > 0 || Math.abs(vt.y) > 0) && Oe(!0), (xt = Ue.current) == null || xt.style.setProperty("--swipe-amount-x", `${vt.x}px`), (Re = Ue.current) == null || Re.style.setProperty("--swipe-amount-y", `${vt.y}px`);
19830
19835
  } }, At && !p.jsx ? L.createElement("button", { "aria-label": J, "data-disabled": te, "data-close-button": !0, onClick: te || !Be ? () => {
19831
19836
  } : () => {
19832
19837
  var de;