teodor-new-chat-ui 4.3.41 → 4.3.42
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 +89 -89
- package/dist/index.umd.js +9 -9
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -324,7 +324,7 @@ function pg() {
|
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var
|
|
327
|
+
var _e = Object.prototype.hasOwnProperty, Ue = {}, tt = y.ReactDebugCurrentFrame;
|
|
328
328
|
function Qe(w) {
|
|
329
329
|
if (w) {
|
|
330
330
|
var j = w._owner, z = Ze(w.type, w._source, j ? j.type : null);
|
|
@@ -334,7 +334,7 @@ function pg() {
|
|
|
334
334
|
}
|
|
335
335
|
function je(w, j, z, oe, Te) {
|
|
336
336
|
{
|
|
337
|
-
var Fe = Function.call.bind(
|
|
337
|
+
var Fe = Function.call.bind(_e);
|
|
338
338
|
for (var Me in w)
|
|
339
339
|
if (Fe(w, Me)) {
|
|
340
340
|
var ke = void 0;
|
|
@@ -382,15 +382,15 @@ function pg() {
|
|
|
382
382
|
__source: !0
|
|
383
383
|
}, X, ge;
|
|
384
384
|
function ue(w) {
|
|
385
|
-
if (
|
|
385
|
+
if (_e.call(w, "ref")) {
|
|
386
386
|
var j = Object.getOwnPropertyDescriptor(w, "ref").get;
|
|
387
387
|
if (j && j.isReactWarning)
|
|
388
388
|
return !1;
|
|
389
389
|
}
|
|
390
390
|
return w.ref !== void 0;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
if (
|
|
392
|
+
function Ne(w) {
|
|
393
|
+
if (_e.call(w, "key")) {
|
|
394
394
|
var j = Object.getOwnPropertyDescriptor(w, "key").get;
|
|
395
395
|
if (j && j.isReactWarning)
|
|
396
396
|
return !1;
|
|
@@ -454,9 +454,9 @@ function pg() {
|
|
|
454
454
|
function dt(w, j, z, oe, Te) {
|
|
455
455
|
{
|
|
456
456
|
var Fe, Me = {}, ke = null, Nt = null;
|
|
457
|
-
z !== void 0 && (ze(z), ke = "" + z),
|
|
457
|
+
z !== void 0 && (ze(z), ke = "" + z), Ne(j) && (ze(j.key), ke = "" + j.key), ue(j) && (Nt = j.ref, Le(j, Te));
|
|
458
458
|
for (Fe in j)
|
|
459
|
-
|
|
459
|
+
_e.call(j, Fe) && !St.hasOwnProperty(Fe) && (Me[Fe] = j[Fe]);
|
|
460
460
|
if (w && w.defaultProps) {
|
|
461
461
|
var ft = w.defaultProps;
|
|
462
462
|
for (Fe in ft)
|
|
@@ -607,7 +607,7 @@ Check the top-level render call using <` + z + ">.");
|
|
|
607
607
|
else
|
|
608
608
|
vn(Ht, w);
|
|
609
609
|
}
|
|
610
|
-
if (
|
|
610
|
+
if (_e.call(j, "key")) {
|
|
611
611
|
var Gt = H(w), jt = Object.keys(j).filter(function(wi) {
|
|
612
612
|
return wi !== "key";
|
|
613
613
|
}), Zr = jt.length > 0 ? "{key: someKey, " + jt.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
@@ -3389,13 +3389,13 @@ function Sy(e = {}) {
|
|
|
3389
3389
|
credentials: i
|
|
3390
3390
|
});
|
|
3391
3391
|
if (!be.ok || !be.body) {
|
|
3392
|
-
const
|
|
3392
|
+
const _e = await be.text().catch(() => "");
|
|
3393
3393
|
throw console.debug(
|
|
3394
3394
|
"[use-chat] non-OK response",
|
|
3395
3395
|
be.status,
|
|
3396
|
-
|
|
3396
|
+
_e == null ? void 0 : _e.slice(0, 500)
|
|
3397
3397
|
), new Error(
|
|
3398
|
-
`stream ${be.status}${
|
|
3398
|
+
`stream ${be.status}${_e ? ": " + _e : ""}`
|
|
3399
3399
|
);
|
|
3400
3400
|
}
|
|
3401
3401
|
b(!0);
|
|
@@ -3405,8 +3405,8 @@ function Sy(e = {}) {
|
|
|
3405
3405
|
let Z = 0, ee = null;
|
|
3406
3406
|
const he = () => {
|
|
3407
3407
|
if (D.length) {
|
|
3408
|
-
const
|
|
3409
|
-
D = [], k.current && h((Ue) => Ue +
|
|
3408
|
+
const _e = D.join("");
|
|
3409
|
+
D = [], k.current && h((Ue) => Ue + _e);
|
|
3410
3410
|
}
|
|
3411
3411
|
ee = null;
|
|
3412
3412
|
}, se = () => {
|
|
@@ -3414,14 +3414,14 @@ function Sy(e = {}) {
|
|
|
3414
3414
|
};
|
|
3415
3415
|
let ae = Date.now();
|
|
3416
3416
|
const He = setInterval(() => {
|
|
3417
|
-
var
|
|
3417
|
+
var _e;
|
|
3418
3418
|
if (Date.now() - ae > 6e4) {
|
|
3419
3419
|
const Ue = "Stream idle timeout";
|
|
3420
|
-
d(Ue), H.abort(), (
|
|
3420
|
+
d(Ue), H.abort(), (_e = L == null ? void 0 : L.onError) == null || _e.call(L, Ue);
|
|
3421
3421
|
}
|
|
3422
3422
|
}, 5e3), Ze = 1024 * 1024;
|
|
3423
3423
|
try {
|
|
3424
|
-
const
|
|
3424
|
+
const _e = be.headers.get("X-Thread-Id") || be.headers.get("x-thread-id"), Ue = be.headers.get("X-Thread-Created") || be.headers.get("x-thread-created"), tt = _e ?? null, Qe = String(Ue ?? "").toLowerCase() === "true";
|
|
3425
3425
|
for ((F = L == null ? void 0 : L.onOpen) == null || F.call(L, { threadId: tt, created: Qe }); ; ) {
|
|
3426
3426
|
const { value: je, done: kt } = await me.read();
|
|
3427
3427
|
if (kt) break;
|
|
@@ -3467,9 +3467,9 @@ function Sy(e = {}) {
|
|
|
3467
3467
|
}
|
|
3468
3468
|
}
|
|
3469
3469
|
he();
|
|
3470
|
-
} catch (
|
|
3471
|
-
if (
|
|
3472
|
-
const Ue =
|
|
3470
|
+
} catch (_e) {
|
|
3471
|
+
if (_e.name !== "AbortError") {
|
|
3472
|
+
const Ue = _e.message || String(_e);
|
|
3473
3473
|
d(Ue), (ie = L == null ? void 0 : L.onError) == null || ie.call(L, Ue);
|
|
3474
3474
|
}
|
|
3475
3475
|
} finally {
|
|
@@ -3884,7 +3884,7 @@ function Wy({
|
|
|
3884
3884
|
state: ae,
|
|
3885
3885
|
dispatch: He,
|
|
3886
3886
|
seed: Ze,
|
|
3887
|
-
prepend:
|
|
3887
|
+
prepend: _e,
|
|
3888
3888
|
pushUser: Ue,
|
|
3889
3889
|
onEvent: tt,
|
|
3890
3890
|
reset: Qe
|
|
@@ -3892,7 +3892,7 @@ function Wy({
|
|
|
3892
3892
|
mt(() => {
|
|
3893
3893
|
je.current = T;
|
|
3894
3894
|
}, [T]);
|
|
3895
|
-
const kt = Ke(!1), Et = Ke([]), It = Ke(null), at = Ke(null), nt = Ke(/* @__PURE__ */ new Map()), ze = Ke(T), ut = Ke(!1), St = Ke(null), X = Ke(/* @__PURE__ */ new Map()), ge = Ke(/* @__PURE__ */ new Map()), ue = Ke(/* @__PURE__ */ new Map()),
|
|
3895
|
+
const kt = Ke(!1), Et = Ke([]), It = Ke(null), at = Ke(null), nt = Ke(/* @__PURE__ */ new Map()), ze = Ke(T), ut = Ke(!1), St = Ke(null), X = Ke(/* @__PURE__ */ new Map()), ge = Ke(/* @__PURE__ */ new Map()), ue = Ke(/* @__PURE__ */ new Map()), Ne = Ke(/* @__PURE__ */ new Map()), Le = Ce(
|
|
3896
3896
|
(E) => {
|
|
3897
3897
|
if (!E) {
|
|
3898
3898
|
$([]);
|
|
@@ -3914,7 +3914,7 @@ function Wy({
|
|
|
3914
3914
|
}, [T, Le]);
|
|
3915
3915
|
const rt = Ce(() => {
|
|
3916
3916
|
var te;
|
|
3917
|
-
const E =
|
|
3917
|
+
const E = Ne.current;
|
|
3918
3918
|
if (E.size <= gc) return;
|
|
3919
3919
|
const I = Array.from(E.entries()).sort((le, Q) => le[1].timestamp - Q[1].timestamp), q = E.size - gc;
|
|
3920
3920
|
for (let le = 0; le < q; le++) {
|
|
@@ -3964,10 +3964,10 @@ function Wy({
|
|
|
3964
3964
|
(E, I) => {
|
|
3965
3965
|
const { threadId: q, checkpointId: te = null, checkpointNs: le = null } = E, Q = xc(q, te, le);
|
|
3966
3966
|
if (I != null && I.force)
|
|
3967
|
-
ue.current.delete(Q),
|
|
3967
|
+
ue.current.delete(Q), Ne.current.delete(Q);
|
|
3968
3968
|
else {
|
|
3969
3969
|
if (I != null && I.preferCache) {
|
|
3970
|
-
const Xe =
|
|
3970
|
+
const Xe = Ne.current.get(Q);
|
|
3971
3971
|
if (Xe)
|
|
3972
3972
|
return Promise.resolve(Xe.payload);
|
|
3973
3973
|
}
|
|
@@ -3979,7 +3979,7 @@ function Wy({
|
|
|
3979
3979
|
threadId: q,
|
|
3980
3980
|
checkpointId: te ?? void 0,
|
|
3981
3981
|
checkpointNs: le ?? void 0
|
|
3982
|
-
}).then((De) => (
|
|
3982
|
+
}).then((De) => (Ne.current.set(Q, { payload: De, timestamp: Date.now() }), rt(), De)).finally(() => {
|
|
3983
3983
|
ue.current.get(Q) === We && ue.current.delete(Q);
|
|
3984
3984
|
});
|
|
3985
3985
|
return ue.current.set(Q, We), We;
|
|
@@ -4107,7 +4107,7 @@ function Wy({
|
|
|
4107
4107
|
snapshot: rn(eo, { cloneMessages: !0 })
|
|
4108
4108
|
}), !Be)
|
|
4109
4109
|
return;
|
|
4110
|
-
wn.length &&
|
|
4110
|
+
wn.length && _e(wn);
|
|
4111
4111
|
const Sn = E && Object.prototype.hasOwnProperty.call(E, "checkpointId") ? E.checkpointId : void 0, to = E && Object.prototype.hasOwnProperty.call(E, "checkpointNs") ? E.checkpointNs : void 0, Cn = E && Object.prototype.hasOwnProperty.call(E, "nextCursor") ? E.nextCursor : void 0, Si = E && Object.prototype.hasOwnProperty.call(E, "nextCursorNs") ? E.nextCursorNs : void 0;
|
|
4112
4112
|
xe(
|
|
4113
4113
|
(At) => Cn !== void 0 ? Cn ?? At ?? null : At ?? null
|
|
@@ -4121,7 +4121,7 @@ function Wy({
|
|
|
4121
4121
|
(At) => Si !== void 0 ? Si ?? void 0 : At
|
|
4122
4122
|
);
|
|
4123
4123
|
},
|
|
4124
|
-
[
|
|
4124
|
+
[_e, Ze, ne]
|
|
4125
4125
|
), qn = Ce(
|
|
4126
4126
|
(E) => {
|
|
4127
4127
|
if (E.threadId != null && E.threadId !== je.current)
|
|
@@ -4140,8 +4140,8 @@ function Wy({
|
|
|
4140
4140
|
const I = `${E}__`;
|
|
4141
4141
|
for (const q of ue.current.keys())
|
|
4142
4142
|
q.startsWith(I) && ue.current.delete(q);
|
|
4143
|
-
for (const q of
|
|
4144
|
-
q.startsWith(I) &&
|
|
4143
|
+
for (const q of Ne.current.keys())
|
|
4144
|
+
q.startsWith(I) && Ne.current.delete(q);
|
|
4145
4145
|
ze.current === E && (ze.current = null);
|
|
4146
4146
|
}, [x]), bn = Ce(() => {
|
|
4147
4147
|
const E = je.current;
|
|
@@ -4235,7 +4235,7 @@ function Wy({
|
|
|
4235
4235
|
};
|
|
4236
4236
|
I(E);
|
|
4237
4237
|
const q = (te = l.onTokenChange) == null ? void 0 : te.call(l, (le) => {
|
|
4238
|
-
oe(le), g(), ue.current.clear(),
|
|
4238
|
+
oe(le), g(), ue.current.clear(), Ne.current.clear(), I(le);
|
|
4239
4239
|
});
|
|
4240
4240
|
return () => {
|
|
4241
4241
|
q == null || q();
|
|
@@ -4322,7 +4322,7 @@ function Wy({
|
|
|
4322
4322
|
E,
|
|
4323
4323
|
I ?? null,
|
|
4324
4324
|
q ?? null
|
|
4325
|
-
), We =
|
|
4325
|
+
), We = Ne.current.get(Be), De = !te && !I && !q && We && Date.now() - We.timestamp < zy, Xe = !te && !I && !q;
|
|
4326
4326
|
let vt = !1;
|
|
4327
4327
|
if (Xe) {
|
|
4328
4328
|
const Ot = nt.current.get(E);
|
|
@@ -7226,7 +7226,7 @@ const zv = /* @__PURE__ */ Ye(() => {
|
|
|
7226
7226
|
([e, t]) => ({ ...e, ...t }),
|
|
7227
7227
|
ct(Ld, zv)
|
|
7228
7228
|
), Hv = ({ height: e }) => /* @__PURE__ */ c.jsx("div", { style: { height: e } }), Uv = { overflowAnchor: "none", position: Qa(), zIndex: 1 }, Ud = { overflowAnchor: "none" }, Wv = { ...Ud, display: "inline-block", height: "100%" }, _c = /* @__PURE__ */ V.memo(function({ showTopList: e = !1 }) {
|
|
7229
|
-
const t =
|
|
7229
|
+
const t = Ae("listState"), n = on("sizeRanges"), r = Ae("useWindowScroll"), o = Ae("customScrollParent"), s = on("windowScrollContainerState"), i = on("scrollContainerState"), a = o || r ? s : i, l = Ae("itemContent"), u = Ae("context"), d = Ae("groupContent"), f = Ae("trackItemSizes"), h = Ae("itemSize"), p = Ae("log"), v = on("gap"), x = Ae("horizontalDirection"), { callbackRef: g } = sv(
|
|
7230
7230
|
n,
|
|
7231
7231
|
h,
|
|
7232
7232
|
f,
|
|
@@ -7235,12 +7235,12 @@ const zv = /* @__PURE__ */ Ye(() => {
|
|
|
7235
7235
|
v,
|
|
7236
7236
|
o,
|
|
7237
7237
|
x,
|
|
7238
|
-
|
|
7238
|
+
Ae("skipAnimationFrameInResizeObserver")
|
|
7239
7239
|
), [y, b] = V.useState(0);
|
|
7240
7240
|
tl("deviation", (M) => {
|
|
7241
7241
|
y !== M && b(M);
|
|
7242
7242
|
});
|
|
7243
|
-
const S =
|
|
7243
|
+
const S = Ae("EmptyPlaceholder"), k = Ae("ScrollSeekPlaceholder") || Hv, C = Ae("ListComponent"), T = Ae("ItemComponent"), R = Ae("GroupComponent"), N = Ae("computeItemKey"), _ = Ae("isSeeking"), A = Ae("groupIndices").length > 0, B = Ae("alignToBottom"), L = Ae("initialItemFinalLocationReached"), H = e ? {} : {
|
|
7244
7244
|
boxSizing: "border-box",
|
|
7245
7245
|
...x ? {
|
|
7246
7246
|
display: "inline-block",
|
|
@@ -7333,7 +7333,7 @@ function Gv(e, t) {
|
|
|
7333
7333
|
return { item: typeof e == "string" ? void 0 : t };
|
|
7334
7334
|
}
|
|
7335
7335
|
const Yv = /* @__PURE__ */ V.memo(function() {
|
|
7336
|
-
const e =
|
|
7336
|
+
const e = Ae("HeaderComponent"), t = on("headerHeight"), n = Ae("HeaderFooterTag"), r = Cr(
|
|
7337
7337
|
V.useMemo(
|
|
7338
7338
|
() => (s) => {
|
|
7339
7339
|
t(Xn(s, "height"));
|
|
@@ -7341,11 +7341,11 @@ const Yv = /* @__PURE__ */ V.memo(function() {
|
|
|
7341
7341
|
[t]
|
|
7342
7342
|
),
|
|
7343
7343
|
!0,
|
|
7344
|
-
|
|
7345
|
-
), o =
|
|
7344
|
+
Ae("skipAnimationFrameInResizeObserver")
|
|
7345
|
+
), o = Ae("context");
|
|
7346
7346
|
return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...zt(e, o) }) }) : null;
|
|
7347
7347
|
}), Xv = /* @__PURE__ */ V.memo(function() {
|
|
7348
|
-
const e =
|
|
7348
|
+
const e = Ae("FooterComponent"), t = on("footerHeight"), n = Ae("HeaderFooterTag"), r = Cr(
|
|
7349
7349
|
V.useMemo(
|
|
7350
7350
|
() => (s) => {
|
|
7351
7351
|
t(Xn(s, "height"));
|
|
@@ -7353,8 +7353,8 @@ const Yv = /* @__PURE__ */ V.memo(function() {
|
|
|
7353
7353
|
[t]
|
|
7354
7354
|
),
|
|
7355
7355
|
!0,
|
|
7356
|
-
|
|
7357
|
-
), o =
|
|
7356
|
+
Ae("skipAnimationFrameInResizeObserver")
|
|
7357
|
+
), o = Ae("context");
|
|
7358
7358
|
return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...zt(e, o) }) }) : null;
|
|
7359
7359
|
});
|
|
7360
7360
|
function Wd({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
@@ -7410,27 +7410,27 @@ function Vd({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
7410
7410
|
});
|
|
7411
7411
|
}
|
|
7412
7412
|
const Jv = ({ children: e }) => {
|
|
7413
|
-
const t = V.useContext($d), n = on("viewportHeight"), r = on("fixedItemHeight"), o =
|
|
7413
|
+
const t = V.useContext($d), n = on("viewportHeight"), r = on("fixedItemHeight"), o = Ae("alignToBottom"), s = Ae("horizontalDirection"), i = V.useMemo(
|
|
7414
7414
|
() => gd(n, (l) => Xn(l, s ? "width" : "height")),
|
|
7415
7415
|
[n, s]
|
|
7416
|
-
), a = Cr(i, !0,
|
|
7416
|
+
), a = Cr(i, !0, Ae("skipAnimationFrameInResizeObserver"));
|
|
7417
7417
|
return V.useEffect(() => {
|
|
7418
7418
|
t && (n(t.viewportHeight), r(t.itemHeight));
|
|
7419
7419
|
}, [t, n, r]), /* @__PURE__ */ c.jsx("div", { "data-viewport-type": "element", ref: a, style: Gs(o), children: e });
|
|
7420
7420
|
}, Zv = ({ children: e }) => {
|
|
7421
|
-
const t = V.useContext($d), n = on("windowViewportRect"), r = on("fixedItemHeight"), o =
|
|
7421
|
+
const t = V.useContext($d), n = on("windowViewportRect"), r = on("fixedItemHeight"), o = Ae("customScrollParent"), s = yd(
|
|
7422
7422
|
n,
|
|
7423
7423
|
o,
|
|
7424
|
-
|
|
7425
|
-
), i =
|
|
7424
|
+
Ae("skipAnimationFrameInResizeObserver")
|
|
7425
|
+
), i = Ae("alignToBottom");
|
|
7426
7426
|
return V.useEffect(() => {
|
|
7427
7427
|
t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
|
|
7428
7428
|
}, [t, n, r]), /* @__PURE__ */ c.jsx("div", { "data-viewport-type": "window", ref: s, style: Gs(i), children: e });
|
|
7429
7429
|
}, Qv = ({ children: e }) => {
|
|
7430
|
-
const t =
|
|
7430
|
+
const t = Ae("TopItemListComponent") || "div", n = Ae("headerHeight"), r = { ...qv, marginTop: `${n}px` }, o = Ae("context");
|
|
7431
7431
|
return /* @__PURE__ */ c.jsx(t, { style: r, ...zt(t, o), children: e });
|
|
7432
7432
|
}, eb = /* @__PURE__ */ V.memo(function(e) {
|
|
7433
|
-
const t =
|
|
7433
|
+
const t = Ae("useWindowScroll"), n = Ae("topItemsIndexes").length > 0, r = Ae("customScrollParent"), o = Ae("context");
|
|
7434
7434
|
return /* @__PURE__ */ c.jsxs(r || t ? rb : nb, { ...e, context: o, children: [
|
|
7435
7435
|
n && /* @__PURE__ */ c.jsx(Qv, { children: /* @__PURE__ */ c.jsx(_c, { showTopList: !0 }) }),
|
|
7436
7436
|
/* @__PURE__ */ c.jsxs(r || t ? Zv : Jv, { children: [
|
|
@@ -7442,7 +7442,7 @@ const Jv = ({ children: e }) => {
|
|
|
7442
7442
|
}), {
|
|
7443
7443
|
Component: tb,
|
|
7444
7444
|
useEmitter: tl,
|
|
7445
|
-
useEmitterValue:
|
|
7445
|
+
useEmitterValue: Ae,
|
|
7446
7446
|
usePublisher: on
|
|
7447
7447
|
} = /* @__PURE__ */ Fd(
|
|
7448
7448
|
Bv,
|
|
@@ -7503,7 +7503,7 @@ const Jv = ({ children: e }) => {
|
|
|
7503
7503
|
}
|
|
7504
7504
|
},
|
|
7505
7505
|
eb
|
|
7506
|
-
), nb = /* @__PURE__ */ Wd({ useEmitter: tl, useEmitterValue:
|
|
7506
|
+
), nb = /* @__PURE__ */ Wd({ useEmitter: tl, useEmitterValue: Ae, usePublisher: on }), rb = /* @__PURE__ */ Vd({ useEmitter: tl, useEmitterValue: Ae, usePublisher: on }), ob = tb, sb = /* @__PURE__ */ Ye(() => {
|
|
7507
7507
|
const e = J((u) => /* @__PURE__ */ c.jsxs("td", { children: [
|
|
7508
7508
|
"Item $",
|
|
7509
7509
|
u
|
|
@@ -7670,19 +7670,19 @@ const cb = /* @__PURE__ */ Ye(
|
|
|
7670
7670
|
He,
|
|
7671
7671
|
Ze,
|
|
7672
7672
|
,
|
|
7673
|
-
|
|
7673
|
+
_e,
|
|
7674
7674
|
Ue
|
|
7675
7675
|
]) => {
|
|
7676
7676
|
const { column: tt, row: Qe } = he, { height: je, width: kt } = se, { width: Et } = ae;
|
|
7677
7677
|
if (Ze === 0 && (D === 0 || Et === 0))
|
|
7678
7678
|
return jc;
|
|
7679
7679
|
if (kt === 0) {
|
|
7680
|
-
const ue = Xa(Ue, D),
|
|
7681
|
-
return ab(Mc(ue,
|
|
7680
|
+
const ue = Xa(Ue, D), Ne = ue + Math.max(Ze - 1, 0);
|
|
7681
|
+
return ab(Mc(ue, Ne, He));
|
|
7682
7682
|
}
|
|
7683
7683
|
const It = Kd(Et, kt, tt);
|
|
7684
7684
|
let at, nt;
|
|
7685
|
-
|
|
7685
|
+
_e ? Z === 0 && ee === 0 && Ze > 0 ? (at = 0, nt = Ze - 1) : (at = It * ws((Z + Qe) / (je + Qe)), nt = It * Pc((ee + Qe) / (je + Qe)) - 1, nt = Fi(D - 1, fo(nt, It - 1)), at = Fi(nt, fo(0, at))) : (at = 0, nt = -1);
|
|
7686
7686
|
const ze = Mc(at, nt, He), { bottom: ut, top: St } = Dc(ae, he, se, ze), X = Pc(D / It), ge = X * je + (X - 1) * Qe - ut;
|
|
7687
7687
|
return { bottom: ut, itemHeight: je, items: ze, itemWidth: kt, offsetBottom: ge, offsetTop: St, top: St };
|
|
7688
7688
|
}
|
|
@@ -7754,11 +7754,11 @@ const cb = /* @__PURE__ */ Ye(
|
|
|
7754
7754
|
B,
|
|
7755
7755
|
$e(_, A, T, G),
|
|
7756
7756
|
de(([D, Z, ee, he, se]) => {
|
|
7757
|
-
const ae = Nd(D), { align: He, behavior: Ze, offset:
|
|
7757
|
+
const ae = Nd(D), { align: He, behavior: Ze, offset: _e } = ae;
|
|
7758
7758
|
let Ue = ae.index;
|
|
7759
7759
|
Ue === "LAST" && (Ue = he - 1), Ue = fo(0, Ue, Fi(he - 1, Ue));
|
|
7760
7760
|
let tt = xa(Z, se, ee, Ue);
|
|
7761
|
-
return He === "end" ? tt = Oc(tt - Z.height + ee.height) : He === "center" && (tt = Oc(tt - Z.height / 2 + ee.height / 2)),
|
|
7761
|
+
return He === "end" ? tt = Oc(tt - Z.height + ee.height) : He === "center" && (tt = Oc(tt - Z.height / 2 + ee.height / 2)), _e && (tt += _e), { behavior: Ze, top: tt };
|
|
7762
7762
|
})
|
|
7763
7763
|
),
|
|
7764
7764
|
l
|
|
@@ -11625,9 +11625,9 @@ const N0 = V.memo(function({
|
|
|
11625
11625
|
), he = (b == null ? void 0 : b.id) ?? (b == null ? void 0 : b.interrupt_id), se = Jo(he), ae = b == null ? void 0 : b.value, He = ot(() => k0(t.content), [t.content]);
|
|
11626
11626
|
ot(() => R0(t.content), [t.content]);
|
|
11627
11627
|
const Ze = ot(() => He.length <= lr ? He : `${He.slice(0, lr)}
|
|
11628
|
-
… [truncated ${He.length - lr} chars]`, [He]),
|
|
11628
|
+
… [truncated ${He.length - lr} chars]`, [He]), _e = V.useCallback(async (X = "all") => {
|
|
11629
11629
|
const ue = X === "visible" && ce ? Ze : ce ? He : xe;
|
|
11630
|
-
async function
|
|
11630
|
+
async function Ne(Le) {
|
|
11631
11631
|
try {
|
|
11632
11632
|
await navigator.clipboard.writeText(Le);
|
|
11633
11633
|
} catch {
|
|
@@ -11640,7 +11640,7 @@ const N0 = V.memo(function({
|
|
|
11640
11640
|
}
|
|
11641
11641
|
}
|
|
11642
11642
|
try {
|
|
11643
|
-
await
|
|
11643
|
+
await Ne(ue), R(!0), setTimeout(() => R(!1), 2e3), y == null || y(ue);
|
|
11644
11644
|
} catch (Le) {
|
|
11645
11645
|
console.error("Failed to copy:", Le);
|
|
11646
11646
|
}
|
|
@@ -11660,14 +11660,14 @@ const N0 = V.memo(function({
|
|
|
11660
11660
|
return;
|
|
11661
11661
|
}
|
|
11662
11662
|
try {
|
|
11663
|
-
const
|
|
11663
|
+
const Ne = String(ge.url ?? ""), Le = Ne.match(/\/chat\/files\/([^/]+)(?:\/(view|download))?/);
|
|
11664
11664
|
if (Le) {
|
|
11665
11665
|
X.preventDefault();
|
|
11666
11666
|
const rt = Le[1], xt = ge.name || `file_${rt}`, et = ge.mimeType || "application/octet-stream";
|
|
11667
11667
|
ie({ id: rt, name: xt, mimeType: et }), F(!0);
|
|
11668
11668
|
return;
|
|
11669
11669
|
}
|
|
11670
|
-
if (
|
|
11670
|
+
if (Ne.startsWith("data:")) {
|
|
11671
11671
|
X.preventDefault(), U((et) => ({ ...et, [ue]: !0 }));
|
|
11672
11672
|
const rt = `${ge.name}_${ge.size}_${Date.now()}`, xt = M({ title: "Fetching file...", description: "", open: !0 });
|
|
11673
11673
|
try {
|
|
@@ -11696,8 +11696,8 @@ const N0 = V.memo(function({
|
|
|
11696
11696
|
U((et) => ({ ...et, [ue]: !1 }));
|
|
11697
11697
|
}
|
|
11698
11698
|
}
|
|
11699
|
-
} catch (
|
|
11700
|
-
console.error("File click error:",
|
|
11699
|
+
} catch (Ne) {
|
|
11700
|
+
console.error("File click error:", Ne), U((Le) => ({ ...Le, [ue]: !1 }));
|
|
11701
11701
|
}
|
|
11702
11702
|
}, [be, G, M, L]), je = V.useCallback(() => {
|
|
11703
11703
|
const ge = re(O ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", me);
|
|
@@ -11791,10 +11791,10 @@ const N0 = V.memo(function({
|
|
|
11791
11791
|
}
|
|
11792
11792
|
}, [S, C, k, H]), nt = V.useCallback(({ part: X, i: ge }) => {
|
|
11793
11793
|
if (X.type === "text") {
|
|
11794
|
-
const ue = X.text ?? "",
|
|
11795
|
-
return Le && Y !== "tool" ? /* @__PURE__ */ c.jsx(A0, { data: Le }, ge) : Y === "user" && f &&
|
|
11796
|
-
/* @__PURE__ */ c.jsx("div", { className: re("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: A ? /* @__PURE__ */ c.jsx(qc, { content:
|
|
11797
|
-
|
|
11794
|
+
const ue = X.text ?? "", Ne = ue.trim(), Le = lu(Ne);
|
|
11795
|
+
return Le && Y !== "tool" ? /* @__PURE__ */ c.jsx(A0, { data: Le }, ge) : Y === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs($c, { open: A, onOpenChange: B, children: [
|
|
11796
|
+
/* @__PURE__ */ c.jsx("div", { className: re("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: A ? /* @__PURE__ */ c.jsx(qc, { content: Ne, allowHtml: !1 }) : /* @__PURE__ */ c.jsxs("pre", { className: re("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
|
|
11797
|
+
Ne.substring(0, h),
|
|
11798
11798
|
"..."
|
|
11799
11799
|
] }) }),
|
|
11800
11800
|
/* @__PURE__ */ c.jsx(zc, { asChild: !0, children: /* @__PURE__ */ c.jsx(
|
|
@@ -11809,7 +11809,7 @@ const N0 = V.memo(function({
|
|
|
11809
11809
|
] }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
|
11810
11810
|
/* @__PURE__ */ c.jsx(Pr, { className: "h-3 w-3 mr-1" }),
|
|
11811
11811
|
" Show more (",
|
|
11812
|
-
|
|
11812
|
+
Ne.length - h,
|
|
11813
11813
|
" chars)"
|
|
11814
11814
|
] })
|
|
11815
11815
|
}
|
|
@@ -11829,7 +11829,7 @@ const N0 = V.memo(function({
|
|
|
11829
11829
|
) }, ge);
|
|
11830
11830
|
}
|
|
11831
11831
|
if (X.type === "file") {
|
|
11832
|
-
const ue = X,
|
|
11832
|
+
const ue = X, Ne = ue.name || "file";
|
|
11833
11833
|
return /* @__PURE__ */ c.jsxs(
|
|
11834
11834
|
"a",
|
|
11835
11835
|
{
|
|
@@ -11840,7 +11840,7 @@ const N0 = V.memo(function({
|
|
|
11840
11840
|
children: [
|
|
11841
11841
|
G[ge] ? /* @__PURE__ */ c.jsx(Iu, { className: "h-4 w-4 animate-spin" }) : null,
|
|
11842
11842
|
/* @__PURE__ */ c.jsxs("span", { className: "truncate max-w-[180px]", children: [
|
|
11843
|
-
|
|
11843
|
+
Ne,
|
|
11844
11844
|
G[ge] ? " (processing)" : ""
|
|
11845
11845
|
] })
|
|
11846
11846
|
]
|
|
@@ -11849,9 +11849,9 @@ const N0 = V.memo(function({
|
|
|
11849
11849
|
);
|
|
11850
11850
|
}
|
|
11851
11851
|
if (X.type === "interrupt") {
|
|
11852
|
-
const ue = X,
|
|
11852
|
+
const ue = X, Ne = Jo(
|
|
11853
11853
|
(ue == null ? void 0 : ue.id) ?? (ue == null ? void 0 : ue.interrupt_id)
|
|
11854
|
-
), Le = se
|
|
11854
|
+
), Le = !!(se && Ne && Ne === se), rt = Le ? ae ?? (ue == null ? void 0 : ue.value) : ue == null ? void 0 : ue.value, xt = Ne ? { ...ue, id: Ne, interrupt_id: Ne } : ue;
|
|
11855
11855
|
return /* @__PURE__ */ c.jsx(
|
|
11856
11856
|
j0,
|
|
11857
11857
|
{
|
|
@@ -11894,13 +11894,13 @@ const N0 = V.memo(function({
|
|
|
11894
11894
|
return /* @__PURE__ */ c.jsx(P0, { data: ue });
|
|
11895
11895
|
}
|
|
11896
11896
|
if (ce && K.name === "get_issues") {
|
|
11897
|
-
const ge = t.content.find((Le) => Le.type === "tool_end"), ue = (ge == null ? void 0 : ge.output) ?? He,
|
|
11898
|
-
if (
|
|
11897
|
+
const ge = t.content.find((Le) => Le.type === "tool_end"), ue = (ge == null ? void 0 : ge.output) ?? He, Ne = Wf(ue);
|
|
11898
|
+
if (Ne) return /* @__PURE__ */ c.jsx(O0, { issues: Ne });
|
|
11899
11899
|
}
|
|
11900
11900
|
if (ce) {
|
|
11901
11901
|
const ge = T0(t.content);
|
|
11902
11902
|
if (ge.length > 0)
|
|
11903
|
-
return /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: ge.map((ue,
|
|
11903
|
+
return /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: ge.map((ue, Ne) => {
|
|
11904
11904
|
const Le = typeof ue.output == "string" ? ue.output : ks(ue.output), rt = Le.length > lr ? `${Le.slice(0, lr)}
|
|
11905
11905
|
… [truncated ${Le.length - lr} chars]` : Le, xt = N === "expanded";
|
|
11906
11906
|
return /* @__PURE__ */ c.jsxs($c, { open: xt, onOpenChange: (et) => _(et ? "expanded" : "preview"), children: [
|
|
@@ -11914,11 +11914,11 @@ const N0 = V.memo(function({
|
|
|
11914
11914
|
/* @__PURE__ */ c.jsx(Pr, { className: "h-3 w-3 mr-1" }),
|
|
11915
11915
|
" Show more"
|
|
11916
11916
|
] }) }) })
|
|
11917
|
-
] }, ue.toolCallId ??
|
|
11917
|
+
] }, ue.toolCallId ?? Ne);
|
|
11918
11918
|
}) });
|
|
11919
11919
|
}
|
|
11920
11920
|
if (!ce) {
|
|
11921
|
-
const ge = /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: t.content.map((ue,
|
|
11921
|
+
const ge = /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: t.content.map((ue, Ne) => /* @__PURE__ */ c.jsx(nt, { part: ue, i: Ne }, Ne)) });
|
|
11922
11922
|
return r ? /* @__PURE__ */ c.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
11923
11923
|
ge,
|
|
11924
11924
|
/* @__PURE__ */ c.jsx(I0, { className: me })
|
|
@@ -12016,7 +12016,7 @@ const N0 = V.memo(function({
|
|
|
12016
12016
|
{
|
|
12017
12017
|
variant: "ghost",
|
|
12018
12018
|
size: "sm",
|
|
12019
|
-
onClick: () =>
|
|
12019
|
+
onClick: () => _e(ce ? "visible" : "all"),
|
|
12020
12020
|
className: re("h-6 w-6 p-0 hover:bg-foreground/10", me, O && "h-5 w-5"),
|
|
12021
12021
|
"aria-label": ce ? "Copy visible" : "Copy message",
|
|
12022
12022
|
title: ce ? "Copy visible portion" : "Copy message",
|
|
@@ -12028,7 +12028,7 @@ const N0 = V.memo(function({
|
|
|
12028
12028
|
{
|
|
12029
12029
|
variant: "ghost",
|
|
12030
12030
|
size: "sm",
|
|
12031
|
-
onClick: () =>
|
|
12031
|
+
onClick: () => _e("all"),
|
|
12032
12032
|
className: re("h-6 px-1 text-xs hover:bg-foreground/10", me),
|
|
12033
12033
|
"aria-label": "Copy all (may be large)",
|
|
12034
12034
|
title: "Copy all (may be large)",
|
|
@@ -12090,7 +12090,7 @@ const N0 = V.memo(function({
|
|
|
12090
12090
|
{
|
|
12091
12091
|
variant: "ghost",
|
|
12092
12092
|
size: "sm",
|
|
12093
|
-
onClick: () =>
|
|
12093
|
+
onClick: () => _e(),
|
|
12094
12094
|
className: re("h-6 w-6 p-0 hover:bg-background/50 text-current", O && "h-5 w-5"),
|
|
12095
12095
|
children: /* @__PURE__ */ c.jsx($l, { className: re(T ? "text-success" : "text-current", O ? "h-3 w-3" : "h-4 w-4") })
|
|
12096
12096
|
}
|
|
@@ -13906,9 +13906,9 @@ var Sl = "PopperContent", [ZS, QS] = sh(Sl), uh = m.forwardRef(
|
|
|
13906
13906
|
l && VS({ ...H }),
|
|
13907
13907
|
KS({
|
|
13908
13908
|
...H,
|
|
13909
|
-
apply: ({ elements: ae, rects: He, availableWidth: Ze, availableHeight:
|
|
13909
|
+
apply: ({ elements: ae, rects: He, availableWidth: Ze, availableHeight: _e }) => {
|
|
13910
13910
|
const { width: Ue, height: tt } = He.reference, Qe = ae.floating.style;
|
|
13911
|
-
Qe.setProperty("--radix-popper-available-width", `${Ze}px`), Qe.setProperty("--radix-popper-available-height", `${
|
|
13911
|
+
Qe.setProperty("--radix-popper-available-width", `${Ze}px`), Qe.setProperty("--radix-popper-available-height", `${_e}px`), Qe.setProperty("--radix-popper-anchor-width", `${Ue}px`), Qe.setProperty("--radix-popper-anchor-height", `${tt}px`);
|
|
13912
13912
|
}
|
|
13913
13913
|
}),
|
|
13914
13914
|
k && GS({ element: k, padding: a }),
|
|
@@ -15121,7 +15121,7 @@ function Ji({
|
|
|
15121
15121
|
Y(!0);
|
|
15122
15122
|
}, []), be = Ce(() => {
|
|
15123
15123
|
Y(!1);
|
|
15124
|
-
}, []), me = !!ie || O, [xe, K] = ye(null), [D, Z] = ye(""), [ee, he] = ye(null), [se, ae] = ye([]), [He, Ze] = ye(0), [
|
|
15124
|
+
}, []), me = !!ie || O, [xe, K] = ye(null), [D, Z] = ye(""), [ee, he] = ye(null), [se, ae] = ye([]), [He, Ze] = ye(0), [_e, Ue] = ye(0), [tt, Qe] = ye(!1), [je, kt] = ye(null), [Et, It] = ye(null), [at, nt] = ye(!1), [ze, ut] = ye(null), [St, X] = ye(!1), ge = Ke(!1), [ue, Ne] = ye(!1), Le = Ce(
|
|
15125
15125
|
(w, j) => {
|
|
15126
15126
|
if (!w || typeof w != "object") return null;
|
|
15127
15127
|
const z = w[j];
|
|
@@ -15282,7 +15282,7 @@ function Ji({
|
|
|
15282
15282
|
return Number.isNaN(j) ? w : new Date(j).toLocaleString();
|
|
15283
15283
|
}, bn = async (w) => {
|
|
15284
15284
|
if (x) {
|
|
15285
|
-
|
|
15285
|
+
Ne(!0);
|
|
15286
15286
|
try {
|
|
15287
15287
|
if (!w) {
|
|
15288
15288
|
await R();
|
|
@@ -15291,7 +15291,7 @@ function Ji({
|
|
|
15291
15291
|
const j = xt.find((oe) => oe.checkpointId === w), z = (j == null ? void 0 : j.checkpointNs) ?? null;
|
|
15292
15292
|
await T(w, z);
|
|
15293
15293
|
} finally {
|
|
15294
|
-
|
|
15294
|
+
Ne(!1);
|
|
15295
15295
|
}
|
|
15296
15296
|
}
|
|
15297
15297
|
}, ar = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${d.container || ""}`, Jr = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${d.messagesArea || ""}`, Nr = `flex-shrink-0 w-full border-t p-4 bg-transparent ${d.inputArea || ""}`;
|
|
@@ -15439,7 +15439,7 @@ function Ji({
|
|
|
15439
15439
|
onChange: qn,
|
|
15440
15440
|
className: "hidden"
|
|
15441
15441
|
},
|
|
15442
|
-
|
|
15442
|
+
_e
|
|
15443
15443
|
),
|
|
15444
15444
|
tt && /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
15445
15445
|
/* @__PURE__ */ c.jsx(ea, { className: "h-4 w-4 animate-spin" }),
|
|
@@ -16849,20 +16849,20 @@ var gk = "SelectItemAlignedPosition", rm = m.forwardRef((e, t) => {
|
|
|
16849
16849
|
if (s.trigger && s.valueNode && a && u && x && g && y) {
|
|
16850
16850
|
const R = s.trigger.getBoundingClientRect(), N = u.getBoundingClientRect(), _ = s.valueNode.getBoundingClientRect(), A = y.getBoundingClientRect();
|
|
16851
16851
|
if (s.dir !== "rtl") {
|
|
16852
|
-
const he = A.left - N.left, se = _.left - he, ae = R.left - se, He = R.width + ae, Ze = Math.max(He, N.width),
|
|
16852
|
+
const he = A.left - N.left, se = _.left - he, ae = R.left - se, He = R.width + ae, Ze = Math.max(He, N.width), _e = window.innerWidth - fn, Ue = Ea(se, [
|
|
16853
16853
|
fn,
|
|
16854
16854
|
// Prevents the content from going off the starting edge of the
|
|
16855
16855
|
// viewport. It may still go off the ending edge, but this can be
|
|
16856
16856
|
// controlled by the user since they may want to manage overflow in a
|
|
16857
16857
|
// specific way.
|
|
16858
16858
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
16859
|
-
Math.max(fn,
|
|
16859
|
+
Math.max(fn, _e - Ze)
|
|
16860
16860
|
]);
|
|
16861
16861
|
a.style.minWidth = He + "px", a.style.left = Ue + "px";
|
|
16862
16862
|
} else {
|
|
16863
|
-
const he = N.right - A.right, se = window.innerWidth - _.right - he, ae = window.innerWidth - R.right - se, He = R.width + ae, Ze = Math.max(He, N.width),
|
|
16863
|
+
const he = N.right - A.right, se = window.innerWidth - _.right - he, ae = window.innerWidth - R.right - se, He = R.width + ae, Ze = Math.max(He, N.width), _e = window.innerWidth - fn, Ue = Ea(se, [
|
|
16864
16864
|
fn,
|
|
16865
|
-
Math.max(fn,
|
|
16865
|
+
Math.max(fn, _e - Ze)
|
|
16866
16866
|
]);
|
|
16867
16867
|
a.style.minWidth = He + "px", a.style.right = Ue + "px";
|
|
16868
16868
|
}
|