teodor-new-chat-ui 4.1.75 → 4.1.77
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 +62 -52
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var xm = Object.defineProperty;
|
|
|
2
2
|
var vm = (e, t, n) => t in e ? xm(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var ml = (e, t, n) => vm(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as g from "react";
|
|
5
|
-
import q, { createContext as co, useContext as vs, useReducer as wm, useRef as We, useCallback as Ne, useEffect as
|
|
5
|
+
import q, { createContext as co, useContext as vs, useReducer as wm, useRef as We, useCallback as Ne, useEffect as ot, useMemo as dt, useState as ye, startTransition as ru, createElement as Mo, useLayoutEffect as ym } from "react";
|
|
6
6
|
import { Square as bm, Send as Sm, X as Cr, ExternalLink as Cm, Download as km, Image as Tm, FileText as gl, Loader as ou, Bot as xl, Wrench as Im, User as Rm, ChevronUp as Wr, ChevronDown as Sr, Paperclip as ji, Copy as vl, Edit as wl, RotateCcw as Pi, ChevronRight as Em, Check as ha, Circle as Nm, Loader2 as Oi, Edit3 as su, Plus as Am, FileSpreadsheet as _m, MessageSquarePlus as jm, MessageSquare as Pm, Calendar as Om, Trash2 as Mm, Settings as Dm, Server as Lm, EyeOff as Fm, Eye as $m, Layout as zm, MessageCircle as Bm, Save as Hm } from "lucide-react";
|
|
7
7
|
import { Slot as Um, createSlot as Er } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as ws } from "class-variance-authority";
|
|
@@ -324,13 +324,13 @@ function qm() {
|
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var Oe = Object.prototype.hasOwnProperty, $e = {},
|
|
327
|
+
var Oe = Object.prototype.hasOwnProperty, $e = {}, st = v.ReactDebugCurrentFrame;
|
|
328
328
|
function Je(m) {
|
|
329
329
|
if (m) {
|
|
330
330
|
var I = m._owner, j = Ue(m.type, m._source, I ? I.type : null);
|
|
331
|
-
|
|
331
|
+
st.setExtraStackFrame(j);
|
|
332
332
|
} else
|
|
333
|
-
|
|
333
|
+
st.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
335
|
function _e(m, I, j, U, ee) {
|
|
336
336
|
{
|
|
@@ -2741,7 +2741,7 @@ function Ox(e = []) {
|
|
|
2741
2741
|
}, [i]), l = Ne((d) => {
|
|
2742
2742
|
r.current.push(d), a();
|
|
2743
2743
|
}, [a]);
|
|
2744
|
-
|
|
2744
|
+
ot(() => () => {
|
|
2745
2745
|
o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
|
|
2746
2746
|
}, []);
|
|
2747
2747
|
const u = dt(() => ({
|
|
@@ -3061,14 +3061,14 @@ function Fx(e = {}) {
|
|
|
3061
3061
|
if (r)
|
|
3062
3062
|
ce = { Authorization: `Bearer ${r}` };
|
|
3063
3063
|
else if (typeof window < "u") {
|
|
3064
|
-
const $e = window.__AUTH_TOKEN__,
|
|
3064
|
+
const $e = window.__AUTH_TOKEN__, st = ((B = window.localStorage) == null ? void 0 : B.getItem("authToken")) || null;
|
|
3065
3065
|
let Je = null;
|
|
3066
3066
|
try {
|
|
3067
3067
|
const pt = (z = window.localStorage) == null ? void 0 : z.getItem("chat-settings");
|
|
3068
3068
|
pt && (Je = ((H = JSON.parse(pt)) == null ? void 0 : H.apiKey) || null);
|
|
3069
3069
|
} catch {
|
|
3070
3070
|
}
|
|
3071
|
-
const _e = $e ||
|
|
3071
|
+
const _e = $e || st || Je || null;
|
|
3072
3072
|
_e && (ce = { Authorization: `Bearer ${_e}` });
|
|
3073
3073
|
}
|
|
3074
3074
|
} catch {
|
|
@@ -3123,8 +3123,8 @@ function Fx(e = {}) {
|
|
|
3123
3123
|
}
|
|
3124
3124
|
}, 5e3), Ue = 1024 * 1024;
|
|
3125
3125
|
try {
|
|
3126
|
-
const Oe = we.headers.get("X-Thread-Id") || we.headers.get("x-thread-id"), $e = we.headers.get("X-Thread-Created") || we.headers.get("x-thread-created"),
|
|
3127
|
-
for ((M = F == null ? void 0 : F.onOpen) == null || M.call(F, { threadId:
|
|
3126
|
+
const Oe = we.headers.get("X-Thread-Id") || we.headers.get("x-thread-id"), $e = we.headers.get("X-Thread-Created") || we.headers.get("x-thread-created"), st = Oe ?? null, Je = String($e ?? "").toLowerCase() === "true";
|
|
3127
|
+
for ((M = F == null ? void 0 : F.onOpen) == null || M.call(F, { threadId: st, created: Je }); ; ) {
|
|
3128
3128
|
const { value: _e, done: pt } = await Ce.read();
|
|
3129
3129
|
if (pt) break;
|
|
3130
3130
|
K += de.decode(_e, { stream: !0 }), K.length > Ue && (K = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
@@ -3195,7 +3195,7 @@ function Fx(e = {}) {
|
|
|
3195
3195
|
},
|
|
3196
3196
|
[t, n, r, e.autoAppendAssistant]
|
|
3197
3197
|
);
|
|
3198
|
-
return
|
|
3198
|
+
return ot(() => () => {
|
|
3199
3199
|
var O;
|
|
3200
3200
|
T.current = !1, (O = S.current) == null || O.abort();
|
|
3201
3201
|
}, []), {
|
|
@@ -3641,7 +3641,7 @@ function Qx(e) {
|
|
|
3641
3641
|
);
|
|
3642
3642
|
return To(N);
|
|
3643
3643
|
}), u = dt(() => fi(a), [a]), [d, f] = ye(o), [h, p] = ye(!1), [y, w] = ye(null), x = We(u.length), v = We(!1), b = We(null), S = We(""), T = We(!1), C = We(null);
|
|
3644
|
-
|
|
3644
|
+
ot(() => {
|
|
3645
3645
|
x.current = u.length;
|
|
3646
3646
|
}, [u.length]);
|
|
3647
3647
|
const k = Ne(() => {
|
|
@@ -3767,12 +3767,12 @@ function Qx(e) {
|
|
|
3767
3767
|
},
|
|
3768
3768
|
[t, A]
|
|
3769
3769
|
);
|
|
3770
|
-
|
|
3770
|
+
ot(() => {
|
|
3771
3771
|
if (Ar())
|
|
3772
3772
|
return R(u), () => {
|
|
3773
3773
|
b.current !== null && (window.clearTimeout(b.current), b.current = null);
|
|
3774
3774
|
};
|
|
3775
|
-
}, [u, R]),
|
|
3775
|
+
}, [u, R]), ot(() => {
|
|
3776
3776
|
var H, M, D;
|
|
3777
3777
|
const N = (X) => {
|
|
3778
3778
|
const _ = ui(n, X ?? null);
|
|
@@ -3907,16 +3907,20 @@ function tv({
|
|
|
3907
3907
|
initialThreadId: t,
|
|
3908
3908
|
clearAllMessageCaches: b,
|
|
3909
3909
|
onAuthTokenChange: (m) => S.current(m ?? null)
|
|
3910
|
-
})
|
|
3910
|
+
});
|
|
3911
|
+
ot(() => {
|
|
3912
|
+
T.length > 0 && console.log("[ChatSessionProvider] After useThreadList - threads.length:", T.length, "threads:", T);
|
|
3913
|
+
}, [T]);
|
|
3914
|
+
const [z, H] = ye(!1), [M, D] = ye(null), [X, _] = ye(null), [G, ce] = ye(!1), [we, Ce] = ye(!1), [de, K] = ye([]), [$, Y] = ye([]), J = We([]), [me, oe] = ye(null), {
|
|
3911
3915
|
state: te,
|
|
3912
3916
|
dispatch: Xe,
|
|
3913
3917
|
seed: Ue,
|
|
3914
3918
|
prepend: Oe,
|
|
3915
3919
|
pushUser: $e,
|
|
3916
|
-
onEvent:
|
|
3920
|
+
onEvent: st,
|
|
3917
3921
|
reset: Je
|
|
3918
3922
|
} = Ox(), _e = We(C);
|
|
3919
|
-
|
|
3923
|
+
ot(() => {
|
|
3920
3924
|
_e.current = C;
|
|
3921
3925
|
}, [C]);
|
|
3922
3926
|
const pt = We(!1), ne = We([]), ae = We(null), he = We(null), be = We(/* @__PURE__ */ new Map()), pe = We(C), Ie = We({ threadId: null, checkpointId: null, checkpointNs: null }), Ze = Ne((m, I) => new Promise((j, U) => {
|
|
@@ -3937,7 +3941,7 @@ function tv({
|
|
|
3937
3941
|
U(se);
|
|
3938
3942
|
});
|
|
3939
3943
|
}), []);
|
|
3940
|
-
|
|
3944
|
+
ot(() => {
|
|
3941
3945
|
var ee;
|
|
3942
3946
|
const m = _e.current;
|
|
3943
3947
|
if (!m) {
|
|
@@ -4073,7 +4077,7 @@ function tv({
|
|
|
4073
4077
|
J
|
|
4074
4078
|
]
|
|
4075
4079
|
);
|
|
4076
|
-
|
|
4080
|
+
ot(() => {
|
|
4077
4081
|
if (!_e.current || !de.length) return;
|
|
4078
4082
|
const m = {
|
|
4079
4083
|
checkpointId: te.lastCheckpointId ?? null,
|
|
@@ -4147,17 +4151,17 @@ function tv({
|
|
|
4147
4151
|
), { startStream: hr, stop: In, isStreaming: on, error: Pt, setAuthToken: sn } = Bx({
|
|
4148
4152
|
baseUrl: d,
|
|
4149
4153
|
onThreadInfo: zr,
|
|
4150
|
-
onMessageEvent:
|
|
4154
|
+
onMessageEvent: st,
|
|
4151
4155
|
onUnhandledEvent: (m) => {
|
|
4152
4156
|
console.warn(`[ChatSessionProvider] Unhandled stream event: ${m.type}`, m);
|
|
4153
4157
|
},
|
|
4154
4158
|
onSequenceGap: Hn
|
|
4155
4159
|
});
|
|
4156
|
-
|
|
4160
|
+
ot(() => {
|
|
4157
4161
|
ze.current = on;
|
|
4158
|
-
}, [on]),
|
|
4162
|
+
}, [on]), ot(() => {
|
|
4159
4163
|
S.current = (m) => sn(m ?? null);
|
|
4160
|
-
}, [sn]),
|
|
4164
|
+
}, [sn]), ot(() => {
|
|
4161
4165
|
var m;
|
|
4162
4166
|
S.current(((m = l.getAuthToken) == null ? void 0 : m.call(l)) ?? null);
|
|
4163
4167
|
}, [l]);
|
|
@@ -4480,14 +4484,14 @@ function tv({
|
|
|
4480
4484
|
(m) => xe(m.interruptId, m.approved, m.value),
|
|
4481
4485
|
[xe]
|
|
4482
4486
|
);
|
|
4483
|
-
|
|
4487
|
+
ot(() => {
|
|
4484
4488
|
if (a == null || a(C), C)
|
|
4485
4489
|
try {
|
|
4486
4490
|
localStorage.setItem("lastThreadId", C);
|
|
4487
4491
|
} catch (m) {
|
|
4488
4492
|
console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", m);
|
|
4489
4493
|
}
|
|
4490
|
-
}, [C, a]),
|
|
4494
|
+
}, [C, a]), ot(() => ((async () => {
|
|
4491
4495
|
try {
|
|
4492
4496
|
if (A().catch((I) => {
|
|
4493
4497
|
console.error("[ChatSessionProvider] Failed to refresh threads (background):", I), i == null || i(String(I));
|
|
@@ -4503,7 +4507,7 @@ function tv({
|
|
|
4503
4507
|
console.error("[ChatSessionProvider] Initialization failed:", I), i == null || i(String(I));
|
|
4504
4508
|
}
|
|
4505
4509
|
})(), () => {
|
|
4506
|
-
}), []),
|
|
4510
|
+
}), []), ot(() => {
|
|
4507
4511
|
const m = _e.current;
|
|
4508
4512
|
if (!m || pe.current !== m) return;
|
|
4509
4513
|
const I = {
|
|
@@ -7588,14 +7592,14 @@ const yw = /* @__PURE__ */ qe(
|
|
|
7588
7592
|
Oe,
|
|
7589
7593
|
$e
|
|
7590
7594
|
]) => {
|
|
7591
|
-
const { column:
|
|
7595
|
+
const { column: st, row: Je } = me, { height: _e, width: pt } = oe, { width: ne } = te;
|
|
7592
7596
|
if (Ue === 0 && ($ === 0 || ne === 0))
|
|
7593
7597
|
return ac;
|
|
7594
7598
|
if (pt === 0) {
|
|
7595
7599
|
const ft = Na($e, $), Et = ft + Math.max(Ue - 1, 0);
|
|
7596
7600
|
return vw(uc(ft, Et, Xe));
|
|
7597
7601
|
}
|
|
7598
|
-
const ae = Td(ne, pt,
|
|
7602
|
+
const ae = Td(ne, pt, st);
|
|
7599
7603
|
let he, be;
|
|
7600
7604
|
Oe ? Y === 0 && J === 0 && Ue > 0 ? (he = 0, be = Ue - 1) : (he = ae * os((Y + Je) / (_e + Je)), be = ae * lc((J + Je) / (_e + Je)) - 1, be = vi($ - 1, Gr(be, ae - 1)), he = vi(be, Gr(0, he))) : (he = 0, be = -1);
|
|
7601
7605
|
const pe = uc(he, be, Xe), { bottom: Ie, top: Ze } = dc(te, me, oe, pe), ze = lc($ / ae), nt = ze * _e + (ze - 1) * Je - Ie;
|
|
@@ -7672,8 +7676,8 @@ const yw = /* @__PURE__ */ qe(
|
|
|
7672
7676
|
const te = ld($), { align: Xe, behavior: Ue, offset: Oe } = te;
|
|
7673
7677
|
let $e = te.index;
|
|
7674
7678
|
$e === "LAST" && ($e = me - 1), $e = Gr(0, $e, vi(me - 1, $e));
|
|
7675
|
-
let
|
|
7676
|
-
return Xe === "end" ?
|
|
7679
|
+
let st = Gi(Y, oe, J, $e);
|
|
7680
|
+
return Xe === "end" ? st = cc(st - Y.height + J.height) : Xe === "center" && (st = cc(st - Y.height / 2 + J.height / 2)), Oe && (st += Oe), { behavior: Ue, top: st };
|
|
7677
7681
|
})
|
|
7678
7682
|
),
|
|
7679
7683
|
l
|
|
@@ -11202,7 +11206,7 @@ function jb({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
|
11202
11206
|
}
|
|
11203
11207
|
}
|
|
11204
11208
|
}, [n]);
|
|
11205
|
-
|
|
11209
|
+
ot(() => {
|
|
11206
11210
|
e && n && h();
|
|
11207
11211
|
}, [e, n, h]);
|
|
11208
11212
|
const p = async () => {
|
|
@@ -11472,7 +11476,7 @@ function Fc(e) {
|
|
|
11472
11476
|
}
|
|
11473
11477
|
function $b({ className: e }) {
|
|
11474
11478
|
const [t, n] = ye(0);
|
|
11475
|
-
return
|
|
11479
|
+
return ot(() => {
|
|
11476
11480
|
const r = setInterval(() => n((o) => (o + 1) % 4), 500);
|
|
11477
11481
|
return () => clearInterval(r);
|
|
11478
11482
|
}, []), /* @__PURE__ */ c.jsxs(
|
|
@@ -11683,7 +11687,7 @@ const zb = q.memo(function({
|
|
|
11683
11687
|
} catch (ae) {
|
|
11684
11688
|
console.error("Failed to reject interrupt:", ae);
|
|
11685
11689
|
}
|
|
11686
|
-
}, [A]),
|
|
11690
|
+
}, [A]), st = q.useCallback(({ part: ne, i: ae }) => {
|
|
11687
11691
|
if (ne.type === "text") {
|
|
11688
11692
|
const he = ne.text ?? "", be = he.trim(), pe = Lc(be);
|
|
11689
11693
|
return pe && M !== "tool" ? /* @__PURE__ */ c.jsx(Bb, { data: pe }, ae) : M === "user" && f && be.length > h ? /* @__PURE__ */ c.jsxs(pc, { open: k, onOpenChange: R, children: [
|
|
@@ -11798,7 +11802,7 @@ const zb = q.memo(function({
|
|
|
11798
11802
|
}) });
|
|
11799
11803
|
}
|
|
11800
11804
|
if (!D) {
|
|
11801
|
-
const ae = /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: t.content.map((he, be) => /* @__PURE__ */ c.jsx(
|
|
11805
|
+
const ae = /* @__PURE__ */ c.jsx("div", { className: "space-y-2", children: t.content.map((he, be) => /* @__PURE__ */ c.jsx(st, { part: he, i: be }, be)) });
|
|
11802
11806
|
return r ? /* @__PURE__ */ c.jsxs("div", { "aria-busy": "true", role: "status", children: [
|
|
11803
11807
|
ae,
|
|
11804
11808
|
/* @__PURE__ */ c.jsx($b, { className: _ })
|
|
@@ -13728,8 +13732,8 @@ var tl = "PopperContent", [cS, uS] = Ff(tl), Uf = g.forwardRef(
|
|
|
13728
13732
|
rS({
|
|
13729
13733
|
...V,
|
|
13730
13734
|
apply: ({ elements: te, rects: Xe, availableWidth: Ue, availableHeight: Oe }) => {
|
|
13731
|
-
const { width: $e, height:
|
|
13732
|
-
Je.setProperty("--radix-popper-available-width", `${Ue}px`), Je.setProperty("--radix-popper-available-height", `${Oe}px`), Je.setProperty("--radix-popper-anchor-width", `${$e}px`), Je.setProperty("--radix-popper-anchor-height", `${
|
|
13735
|
+
const { width: $e, height: st } = Xe.reference, Je = te.floating.style;
|
|
13736
|
+
Je.setProperty("--radix-popper-available-width", `${Ue}px`), Je.setProperty("--radix-popper-available-height", `${Oe}px`), Je.setProperty("--radix-popper-anchor-width", `${$e}px`), Je.setProperty("--radix-popper-anchor-height", `${st}px`);
|
|
13733
13737
|
}
|
|
13734
13738
|
}),
|
|
13735
13739
|
T && sS({ element: T, padding: a }),
|
|
@@ -14917,20 +14921,20 @@ function _i({
|
|
|
14917
14921
|
checkpoint: A,
|
|
14918
14922
|
respondToInterrupt: O,
|
|
14919
14923
|
metadata: L
|
|
14920
|
-
} = Sa(), { isStreaming: F, error: V, submit: N, stop: B } = nv(), z = x ?? w ?? null, H = (A == null ? void 0 : A.id) ?? null, M = (A == null ? void 0 : A.namespace) ?? null, D = (L == null ? void 0 : L.assemblingMessageId) ?? null, [X, _] = ye(null), [G, ce] = ye(""), [we, Ce] = ye(null), [de, K] = ye([]), [$, Y] = ye(0), [J, me] = ye(0), [oe, te] = ye(!1), [Xe, Ue] = ye(null), [Oe, $e] = ye(null), [
|
|
14924
|
+
} = Sa(), { isStreaming: F, error: V, submit: N, stop: B } = nv(), z = x ?? w ?? null, H = (A == null ? void 0 : A.id) ?? null, M = (A == null ? void 0 : A.namespace) ?? null, D = (L == null ? void 0 : L.assemblingMessageId) ?? null, [X, _] = ye(null), [G, ce] = ye(""), [we, Ce] = ye(null), [de, K] = ye([]), [$, Y] = ye(0), [J, me] = ye(0), [oe, te] = ye(!1), [Xe, Ue] = ye(null), [Oe, $e] = ye(null), [st, Je] = ye(!1), [_e, pt] = ye(null), [ne, ae] = ye([]), [he, be] = ye(null), [pe, Ie] = ye(null), [Ze, ze] = ye(!1), nt = We(null), ft = We(null), Et = Ne(() => {
|
|
14921
14925
|
nt.current && (nt.current.value = ""), ft.current && (ft.current.value = ""), Y((ie) => ie + 1), me((ie) => ie + 1);
|
|
14922
14926
|
}, []), Gt = We(!1);
|
|
14923
|
-
|
|
14927
|
+
ot(() => {
|
|
14924
14928
|
Gt.current && !F && (K([]), Et()), Gt.current = F;
|
|
14925
14929
|
}, [F, Et]);
|
|
14926
14930
|
const [rn, Hn] = ye("desktop");
|
|
14927
|
-
|
|
14931
|
+
ot(() => {
|
|
14928
14932
|
const ie = () => {
|
|
14929
14933
|
const xe = window.innerWidth;
|
|
14930
14934
|
Hn(xe < 640 ? "phone" : xe < 1024 ? "tablet" : "desktop");
|
|
14931
14935
|
};
|
|
14932
14936
|
return ie(), window.addEventListener("resize", ie), () => window.removeEventListener("resize", ie);
|
|
14933
|
-
}, []),
|
|
14937
|
+
}, []), ot(() => {
|
|
14934
14938
|
if (!z) {
|
|
14935
14939
|
ae([]), be(null), Ie(null);
|
|
14936
14940
|
return;
|
|
@@ -14944,7 +14948,7 @@ function _i({
|
|
|
14944
14948
|
const xe = ie[0], Me = xe ? Yn(xe) : { checkpointId: null, checkpointNs: null };
|
|
14945
14949
|
be(Me.checkpointId), Ie(Me.checkpointNs);
|
|
14946
14950
|
}
|
|
14947
|
-
}, [he, z, k]),
|
|
14951
|
+
}, [he, z, k]), ot(() => {
|
|
14948
14952
|
H && (be(H), Ie(M ?? null));
|
|
14949
14953
|
}, [H, M]);
|
|
14950
14954
|
const zr = Ne(async () => {
|
|
@@ -14955,7 +14959,7 @@ function _i({
|
|
|
14955
14959
|
console.warn("loadOlder failed", ie);
|
|
14956
14960
|
}
|
|
14957
14961
|
}, [b, S, C]);
|
|
14958
|
-
|
|
14962
|
+
ot(() => {
|
|
14959
14963
|
(async () => {
|
|
14960
14964
|
if (!y.baseUrl) {
|
|
14961
14965
|
pt(null);
|
|
@@ -14968,9 +14972,9 @@ function _i({
|
|
|
14968
14972
|
console.warn("Failed to fetch default message:", xe), pt(null);
|
|
14969
14973
|
}
|
|
14970
14974
|
})();
|
|
14971
|
-
}, [y]),
|
|
14972
|
-
V && !
|
|
14973
|
-
}, [V,
|
|
14975
|
+
}, [y]), ot(() => {
|
|
14976
|
+
V && !st && (p == null || p(V));
|
|
14977
|
+
}, [V, st, p]);
|
|
14974
14978
|
const hr = (ie) => {
|
|
14975
14979
|
if (ie.length > Xo)
|
|
14976
14980
|
return `Message too long (${ie.length}/${Xo} characters)`;
|
|
@@ -15083,7 +15087,7 @@ function _i({
|
|
|
15083
15087
|
}
|
|
15084
15088
|
}, Vn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${d.container || ""}`, gr = `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 || ""}`, xr = `flex-shrink-0 w-full border-t p-4 bg-transparent ${d.inputArea || ""}`;
|
|
15085
15089
|
return /* @__PURE__ */ c.jsxs("div", { className: Vn, children: [
|
|
15086
|
-
!!V && !
|
|
15090
|
+
!!V && !st && /* @__PURE__ */ c.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: [
|
|
15087
15091
|
/* @__PURE__ */ c.jsx("span", { children: V }),
|
|
15088
15092
|
/* @__PURE__ */ c.jsx(
|
|
15089
15093
|
Ve,
|
|
@@ -15858,14 +15862,20 @@ function Qc({
|
|
|
15858
15862
|
currentThreadId: h,
|
|
15859
15863
|
isLoading: p,
|
|
15860
15864
|
actions: y
|
|
15861
|
-
} = ba(), { loadThread: w } = Sa(), { createThread: x, deleteThread: v, renameThread: b } = y
|
|
15862
|
-
|
|
15865
|
+
} = ba(), { loadThread: w } = Sa(), { createThread: x, deleteThread: v, renameThread: b } = y;
|
|
15866
|
+
f && f.length > 0 && console.log("[ThreadManager] useThreads() returned ctxThreads.length:", f.length);
|
|
15867
|
+
const [S, T] = ye(Array.isArray(f) ? f : []), C = We(S.length > 0), [k, R] = ye(null), [E, A] = ye(""), [O, L] = ye(!1);
|
|
15868
|
+
ot(() => {
|
|
15863
15869
|
const _ = Array.isArray(f) ? f : [];
|
|
15864
15870
|
if (_.length > 0) {
|
|
15865
|
-
C.current = !0, T(_);
|
|
15871
|
+
console.log("[ThreadManager] useEffect sync - setting threads from context, length:", _.length), C.current = !0, T(_);
|
|
15872
|
+
return;
|
|
15873
|
+
}
|
|
15874
|
+
if (p) {
|
|
15875
|
+
console.log("[ThreadManager] useEffect - context empty but loading, keeping previous");
|
|
15866
15876
|
return;
|
|
15867
15877
|
}
|
|
15868
|
-
|
|
15878
|
+
C.current = !1, T(_);
|
|
15869
15879
|
}, [f, p]);
|
|
15870
15880
|
const F = async (_) => {
|
|
15871
15881
|
try {
|
|
@@ -15912,7 +15922,7 @@ function Qc({
|
|
|
15912
15922
|
return "";
|
|
15913
15923
|
}
|
|
15914
15924
|
}, X = (_) => _.title || `Thread ${_.threadId.slice(0, 8)}`;
|
|
15915
|
-
return /* @__PURE__ */ c.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
15925
|
+
return S.length > 0 ? console.log("[ThreadManager] Rendering with threads.length:", S.length, "isLoadingThreads:", p) : console.log("[ThreadManager] Rendering with NO threads - isLoadingThreads:", p), /* @__PURE__ */ c.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
|
|
15916
15926
|
t && /* @__PURE__ */ c.jsx("div", { className: s.header || "flex-shrink-0 p-2 border-b bg-slate-800 border-slate-700 text-slate-100 flex justify-end", children: /* @__PURE__ */ c.jsx(
|
|
15917
15927
|
Ve,
|
|
15918
15928
|
{
|
|
@@ -17312,10 +17322,10 @@ const Qk = {
|
|
|
17312
17322
|
};
|
|
17313
17323
|
function DT({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
17314
17324
|
const [r, o] = ye(!1), [s, i] = ye(!1), [a, l] = ye(e), [u, d] = ye(!1), { toast: f } = Ba();
|
|
17315
|
-
|
|
17325
|
+
ot(() => {
|
|
17316
17326
|
const x = JSON.stringify(a) !== JSON.stringify(e);
|
|
17317
17327
|
d(x);
|
|
17318
|
-
}, [a, e]),
|
|
17328
|
+
}, [a, e]), ot(() => {
|
|
17319
17329
|
l(e);
|
|
17320
17330
|
}, [e]);
|
|
17321
17331
|
const h = () => {
|