teodor-new-chat-ui 4.3.260 → 4.3.262
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 +383 -375
- package/dist/index.umd.js +13 -13
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Zh = Object.defineProperty;
|
|
|
2
2
|
var Qh = (e, t, n) => t in e ? Zh(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var sl = (e, t, n) => Qh(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import * as v from "react";
|
|
5
|
-
import
|
|
5
|
+
import H, { createContext as ao, useContext as ms, useMemo as it, useState as ve, useRef as Je, useCallback as ke, useEffect as Ct, useReducer as em, useLayoutEffect as tm, createElement as Oo, useImperativeHandle as nm } from "react";
|
|
6
6
|
import { Square as rm, Send as om, ChevronRight as Kc, Check as ia, Circle as sm, X as gr, ExternalLink as im, Download as am, Image as lm, FileText as il, Loader as aa, Bot as ni, Wrench as cm, User as um, Paperclip as Ii, ChevronUp as la, ChevronDown as gs, ChevronLeft as dm, Copy as al, Edit as ll, RotateCcw as Ni, Info as fm, Loader2 as $r, Edit3 as qc, Plus as pm, FileSpreadsheet as hm, MessageSquarePlus as mm, MessageSquare as gm, Calendar as xm, Trash2 as ym, Settings as vm, Server as wm, EyeOff as bm, Eye as Sm, Layout as Cm, MessageCircle as Tm, Save as km } from "lucide-react";
|
|
7
7
|
import { Slot as Rm, createSlot as br } from "@radix-ui/react-slot";
|
|
8
8
|
import { cva as xs } from "class-variance-authority";
|
|
@@ -24,7 +24,7 @@ var cl;
|
|
|
24
24
|
function Nm() {
|
|
25
25
|
if (cl) return Mr;
|
|
26
26
|
cl = 1;
|
|
27
|
-
var e =
|
|
27
|
+
var e = H, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
28
28
|
function i(a, l, c) {
|
|
29
29
|
var d, f = {}, p = null, h = null;
|
|
30
30
|
c !== void 0 && (p = "" + c), l.key !== void 0 && (p = "" + l.key), l.ref !== void 0 && (h = l.ref);
|
|
@@ -47,7 +47,7 @@ var Dr = {};
|
|
|
47
47
|
var ul;
|
|
48
48
|
function Am() {
|
|
49
49
|
return ul || (ul = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
-
var e =
|
|
50
|
+
var e = H, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), m = Symbol.iterator, y = "@@iterator";
|
|
51
51
|
function x(R) {
|
|
52
52
|
if (R === null || typeof R != "object")
|
|
53
53
|
return null;
|
|
@@ -198,30 +198,30 @@ function Am() {
|
|
|
198
198
|
F < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
var ne = g.ReactCurrentDispatcher,
|
|
201
|
+
var ne = g.ReactCurrentDispatcher, B;
|
|
202
202
|
function M(R, V, oe) {
|
|
203
203
|
{
|
|
204
|
-
if (
|
|
204
|
+
if (B === void 0)
|
|
205
205
|
try {
|
|
206
206
|
throw Error();
|
|
207
207
|
} catch (Xe) {
|
|
208
208
|
var Ce = Xe.stack.trim().match(/\n( *(at )?)/);
|
|
209
|
-
|
|
209
|
+
B = Ce && Ce[1] || "";
|
|
210
210
|
}
|
|
211
211
|
return `
|
|
212
|
-
` +
|
|
212
|
+
` + B + R;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
var U = !1,
|
|
215
|
+
var U = !1, ee;
|
|
216
216
|
{
|
|
217
217
|
var te = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
-
|
|
218
|
+
ee = new te();
|
|
219
219
|
}
|
|
220
220
|
function se(R, V) {
|
|
221
221
|
if (!R || U)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var oe =
|
|
224
|
+
var oe = ee.get(R);
|
|
225
225
|
if (oe !== void 0)
|
|
226
226
|
return oe;
|
|
227
227
|
}
|
|
@@ -276,7 +276,7 @@ function Am() {
|
|
|
276
276
|
if (vt--, wt--, wt < 0 || Be[vt] !== _t[wt]) {
|
|
277
277
|
var Ht = `
|
|
278
278
|
` + Be[vt].replace(" at new ", " at ");
|
|
279
|
-
return R.displayName && Ht.includes("<anonymous>") && (Ht = Ht.replace("<anonymous>", R.displayName)), typeof R == "function" &&
|
|
279
|
+
return R.displayName && Ht.includes("<anonymous>") && (Ht = Ht.replace("<anonymous>", R.displayName)), typeof R == "function" && ee.set(R, Ht), Ht;
|
|
280
280
|
}
|
|
281
281
|
while (vt >= 1 && wt >= 0);
|
|
282
282
|
break;
|
|
@@ -286,7 +286,7 @@ function Am() {
|
|
|
286
286
|
U = !1, ne.current = st, Y(), Error.prepareStackTrace = Xe;
|
|
287
287
|
}
|
|
288
288
|
var Dn = R ? R.displayName || R.name : "", Rn = Dn ? M(Dn) : "";
|
|
289
|
-
return typeof R == "function" &&
|
|
289
|
+
return typeof R == "function" && ee.set(R, Rn), Rn;
|
|
290
290
|
}
|
|
291
291
|
function Ne(R, V, oe) {
|
|
292
292
|
return se(R, !1);
|
|
@@ -610,15 +610,15 @@ Check the top-level render call using <` + oe + ">.");
|
|
|
610
610
|
if (Ve.call(V, "key")) {
|
|
611
611
|
var Rn = z(R), Ot = Object.keys(V).filter(function(he) {
|
|
612
612
|
return he !== "key";
|
|
613
|
-
}),
|
|
614
|
-
if (!Yn[Rn +
|
|
613
|
+
}), Q = Ot.length > 0 ? "{key: someKey, " + Ot.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
614
|
+
if (!Yn[Rn + Q]) {
|
|
615
615
|
var pe = Ot.length > 0 ? "{" + Ot.join(": ..., ") + ": ...}" : "{}";
|
|
616
616
|
w(`A props object containing a "key" prop is being spread into JSX:
|
|
617
617
|
let props = %s;
|
|
618
618
|
<%s {...props} />
|
|
619
619
|
React keys must be passed directly to JSX without using spread:
|
|
620
620
|
let props = %s;
|
|
621
|
-
<%s key={someKey} {...props} />`,
|
|
621
|
+
<%s key={someKey} {...props} />`, Q, Rn, pe, Rn), Yn[Rn + Q] = !0;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
return R === r ? On(wt) : Tt(wt), wt;
|
|
@@ -3012,7 +3012,7 @@ function Ox(e = {}) {
|
|
|
3012
3012
|
threadId: A.threadId ?? null,
|
|
3013
3013
|
headers: {}
|
|
3014
3014
|
}, (async () => {
|
|
3015
|
-
var ge, Se, Te, Y, ne,
|
|
3015
|
+
var ge, Se, Te, Y, ne, B, M, U, ee, te, se, Ne, He, Ze, Ve, X, de, Pe;
|
|
3016
3016
|
const G = (De) => {
|
|
3017
3017
|
var Ge;
|
|
3018
3018
|
try {
|
|
@@ -3107,7 +3107,7 @@ function Ox(e = {}) {
|
|
|
3107
3107
|
for (S.current && !S.current.threadId && (S.current = {
|
|
3108
3108
|
...S.current,
|
|
3109
3109
|
threadId: Le
|
|
3110
|
-
}), (
|
|
3110
|
+
}), (B = _ == null ? void 0 : _.onOpen) == null || B.call(_, { threadId: Le, created: tt }); ; ) {
|
|
3111
3111
|
const { value: $, done: fe } = await et.read();
|
|
3112
3112
|
if (fe) break;
|
|
3113
3113
|
gt += Et.decode($, { stream: !0 }), gt.length > xe && (gt = "", console.warn("Stream buffer reset: exceeded 1MB"));
|
|
@@ -3179,7 +3179,7 @@ function Ox(e = {}) {
|
|
|
3179
3179
|
m(Ue.checkpointId);
|
|
3180
3180
|
else if (Ue.type === "error") {
|
|
3181
3181
|
const at = Ue;
|
|
3182
|
-
if (d(at.message), P = "error", D = at.message, at.error_type === "auth_error" || at.code === "TOKEN_EXPIRED" || ((
|
|
3182
|
+
if (d(at.message), P = "error", D = at.message, at.error_type === "auth_error" || at.code === "TOKEN_EXPIRED" || ((ee = at.message) == null ? void 0 : ee.includes("token")) || ((te = at.message) == null ? void 0 : te.includes("401")) || ((se = at.message) == null ? void 0 : se.includes("unauthorized")) || ((Ne = at.message) == null ? void 0 : Ne.includes("Unauthorized"))) {
|
|
3183
3183
|
console.error("[use-chat] Auth error detected:", at.message);
|
|
3184
3184
|
try {
|
|
3185
3185
|
(He = _ == null ? void 0 : _.onAuthError) == null || He.call(_, at.message);
|
|
@@ -3921,11 +3921,11 @@ function qx({
|
|
|
3921
3921
|
onThreadChange: a,
|
|
3922
3922
|
checkpointMetadataCache: l
|
|
3923
3923
|
}) {
|
|
3924
|
-
const { api: c, baseUrl: d } = wu(), f = it(() => An(d), [d]), [p, h] = ve([]), [m, y] = ve(t), [x, g] = ve(!1), [w, b] = ve(null), [T, C] = ve(!1), [S, k] = ve(null), { state: E, seed: N, prepend: I, pushUser: j, onEvent: L } = zx(), [z, A] = ve(!1), [F, _] = ve(!1), [K, P] = ve(null), [D, q] = ve([]), [G, ge] = ve([]), [Se, Te] = ve(!1), Y = l ?? Kx(), { setCacheForThread: ne } = Y,
|
|
3924
|
+
const { api: c, baseUrl: d } = wu(), f = it(() => An(d), [d]), [p, h] = ve([]), [m, y] = ve(t), [x, g] = ve(!1), [w, b] = ve(null), [T, C] = ve(!1), [S, k] = ve(null), { state: E, seed: N, prepend: I, pushUser: j, onEvent: L } = zx(), [z, A] = ve(!1), [F, _] = ve(!1), [K, P] = ve(null), [D, q] = ve([]), [G, ge] = ve([]), [Se, Te] = ve(!1), Y = l ?? Kx(), { setCacheForThread: ne } = Y, B = Je(m), M = Je(null), U = Je(null);
|
|
3925
3925
|
Ct(() => {
|
|
3926
|
-
|
|
3926
|
+
B.current = m;
|
|
3927
3927
|
}, [m]);
|
|
3928
|
-
const
|
|
3928
|
+
const ee = Je(), te = ke(async () => {
|
|
3929
3929
|
g(!0), b(null);
|
|
3930
3930
|
try {
|
|
3931
3931
|
const re = await c.listThreads();
|
|
@@ -3947,7 +3947,7 @@ function qx({
|
|
|
3947
3947
|
};
|
|
3948
3948
|
h((ce) => ce.some((Le) => Le.threadId === xe.threadId) ? (console.debug("[ChatSessionProvider] thread_info: thread already in list", xe.threadId), ce) : (console.debug("[ChatSessionProvider] thread_info: adding thread to list", xe.threadId), [xe, ...ce]));
|
|
3949
3949
|
}, []), Ne = ke((re) => {
|
|
3950
|
-
console.log("[ChatSessionProvider] 🎯 Received thread_info:", re.threadId), se(re),
|
|
3950
|
+
console.log("[ChatSessionProvider] 🎯 Received thread_info:", re.threadId), se(re), B.current !== re.threadId && (!B.current && E.messages.length <= 1 && (U.current = re.threadId), y(re.threadId));
|
|
3951
3951
|
}, [se, E.messages.length]), { startStream: He, stop: Ze, isStreaming: Ve, error: X, setAuthToken: de } = Vx({
|
|
3952
3952
|
baseUrl: f,
|
|
3953
3953
|
onThreadInfo: Ne,
|
|
@@ -3969,7 +3969,7 @@ function qx({
|
|
|
3969
3969
|
), De = ke(
|
|
3970
3970
|
async (re) => {
|
|
3971
3971
|
try {
|
|
3972
|
-
await c.deleteThread(re),
|
|
3972
|
+
await c.deleteThread(re), B.current === re && (y(null), N([], {})), await te();
|
|
3973
3973
|
} catch (xe) {
|
|
3974
3974
|
s == null || s(String(xe));
|
|
3975
3975
|
}
|
|
@@ -4005,8 +4005,8 @@ function qx({
|
|
|
4005
4005
|
checkpointId: xe || void 0
|
|
4006
4006
|
// Let backend pick latest if not specified
|
|
4007
4007
|
});
|
|
4008
|
-
if (
|
|
4009
|
-
console.log(`[ChatSessionProvider] Thread changed during load (was ${ce}, now ${
|
|
4008
|
+
if (B.current !== ce) {
|
|
4009
|
+
console.log(`[ChatSessionProvider] Thread changed during load (was ${ce}, now ${B.current}), discarding stale data`);
|
|
4010
4010
|
return;
|
|
4011
4011
|
}
|
|
4012
4012
|
const { checkpoints: Le, timeline: tt } = Br(ie);
|
|
@@ -4017,7 +4017,7 @@ function qx({
|
|
|
4017
4017
|
checkpointNs: ($ == null ? void 0 : $.checkpointNs) ?? null
|
|
4018
4018
|
}), ge(tt), q(Le), A(!!($ != null && $.nextCursor)), P(($ == null ? void 0 : $.nextCursor) ?? null);
|
|
4019
4019
|
} catch (ie) {
|
|
4020
|
-
if (
|
|
4020
|
+
if (B.current === ce) {
|
|
4021
4021
|
const Le = String(ie);
|
|
4022
4022
|
k(Le), s == null || s(Le);
|
|
4023
4023
|
}
|
|
@@ -4028,11 +4028,11 @@ function qx({
|
|
|
4028
4028
|
[c, N, s, Ye]
|
|
4029
4029
|
);
|
|
4030
4030
|
Ct(() => {
|
|
4031
|
-
|
|
4031
|
+
ee.current = Ae;
|
|
4032
4032
|
}, [Ae]);
|
|
4033
4033
|
const ze = ke(
|
|
4034
4034
|
async (re, xe) => {
|
|
4035
|
-
const ce =
|
|
4035
|
+
const ce = B.current;
|
|
4036
4036
|
if (!ce) return;
|
|
4037
4037
|
const ie = ce;
|
|
4038
4038
|
Te(!0);
|
|
@@ -4042,8 +4042,8 @@ function qx({
|
|
|
4042
4042
|
checkpointId: re,
|
|
4043
4043
|
checkpointNs: xe ?? void 0
|
|
4044
4044
|
});
|
|
4045
|
-
if (
|
|
4046
|
-
console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${ie}, now ${
|
|
4045
|
+
if (B.current !== ie) {
|
|
4046
|
+
console.log(`[ChatSessionProvider] Thread changed during checkpoint navigation (was ${ie}, now ${B.current}), discarding stale data`);
|
|
4047
4047
|
return;
|
|
4048
4048
|
}
|
|
4049
4049
|
const { checkpoints: tt, timeline: $ } = Br(Le);
|
|
@@ -4060,7 +4060,7 @@ function qx({
|
|
|
4060
4060
|
checkpointNs: fe.checkpointNs ?? null
|
|
4061
4061
|
});
|
|
4062
4062
|
} catch (Le) {
|
|
4063
|
-
|
|
4063
|
+
B.current === ie && (s == null || s(String(Le)));
|
|
4064
4064
|
} finally {
|
|
4065
4065
|
Te(!1);
|
|
4066
4066
|
}
|
|
@@ -4075,18 +4075,18 @@ function qx({
|
|
|
4075
4075
|
},
|
|
4076
4076
|
[N, E.messages]
|
|
4077
4077
|
), Et = ke(async () => {
|
|
4078
|
-
|
|
4078
|
+
B.current && await Ae(B.current);
|
|
4079
4079
|
}, [Ae]), gt = ke(async () => {
|
|
4080
|
-
if (!
|
|
4081
|
-
const re =
|
|
4080
|
+
if (!B.current || !K) return;
|
|
4081
|
+
const re = B.current;
|
|
4082
4082
|
_(!0);
|
|
4083
4083
|
try {
|
|
4084
4084
|
const xe = await c.getStateHistory({
|
|
4085
4085
|
threadId: re,
|
|
4086
4086
|
checkpointId: K
|
|
4087
4087
|
});
|
|
4088
|
-
if (
|
|
4089
|
-
console.log(`[ChatSessionProvider] Thread changed during history load (was ${re}, now ${
|
|
4088
|
+
if (B.current !== re) {
|
|
4089
|
+
console.log(`[ChatSessionProvider] Thread changed during history load (was ${re}, now ${B.current}), discarding stale data`);
|
|
4090
4090
|
return;
|
|
4091
4091
|
}
|
|
4092
4092
|
const { checkpoints: ce } = Br(xe);
|
|
@@ -4095,12 +4095,12 @@ function qx({
|
|
|
4095
4095
|
I((ie == null ? void 0 : ie.messages) ?? []), A(!!(ie != null && ie.nextCursor)), P((ie == null ? void 0 : ie.nextCursor) ?? null);
|
|
4096
4096
|
}
|
|
4097
4097
|
} catch (xe) {
|
|
4098
|
-
|
|
4098
|
+
B.current === re && (s == null || s(String(xe)));
|
|
4099
4099
|
} finally {
|
|
4100
4100
|
_(!1);
|
|
4101
4101
|
}
|
|
4102
4102
|
}, [c, K, I, s]), xt = ke(async () => {
|
|
4103
|
-
N([], {}), y(null), Ze(), q([]), ge([]), A(!1), P(null), C(!1), Te(!1), _(!1), k(null);
|
|
4103
|
+
B.current, N([], {}), y(null), Ze(), q([]), ge([]), A(!1), P(null), C(!1), Te(!1), _(!1), k(null);
|
|
4104
4104
|
try {
|
|
4105
4105
|
await c.getAgent("default");
|
|
4106
4106
|
} catch (re) {
|
|
@@ -4108,7 +4108,7 @@ function qx({
|
|
|
4108
4108
|
}
|
|
4109
4109
|
}, [N, Ze, c]), dt = ke(
|
|
4110
4110
|
async (re, xe, ce) => {
|
|
4111
|
-
const ie =
|
|
4111
|
+
const ie = B.current;
|
|
4112
4112
|
if (!ie)
|
|
4113
4113
|
throw new Error("No active thread to handle interrupt");
|
|
4114
4114
|
const Le = xe ? ce ?? !0 : !1;
|
|
@@ -4130,20 +4130,28 @@ function qx({
|
|
|
4130
4130
|
Ct(() => {
|
|
4131
4131
|
te();
|
|
4132
4132
|
}, [te]), Ct(() => {
|
|
4133
|
-
var
|
|
4134
|
-
if (!
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
M.current !== m && (M.current = m, n ? (console.log("[ChatSessionProvider] Loading thread with checkpoint:", n), (re = Z.current) == null || re.call(Z, m, n)) : (console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (xe = Z.current) == null || xe.call(Z, m)));
|
|
4133
|
+
var xe;
|
|
4134
|
+
if (!o || !m || T)
|
|
4135
|
+
return;
|
|
4136
|
+
if (U.current === m) {
|
|
4137
|
+
U.current = null;
|
|
4138
|
+
return;
|
|
4140
4139
|
}
|
|
4140
|
+
if (M.current === m)
|
|
4141
|
+
return;
|
|
4142
|
+
M.current = m;
|
|
4143
|
+
const re = n ?? void 0;
|
|
4144
|
+
re ? console.log(
|
|
4145
|
+
"[ChatSessionProvider] Loading thread with checkpoint:",
|
|
4146
|
+
re,
|
|
4147
|
+
r ? `(ns: ${r})` : ""
|
|
4148
|
+
) : console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (xe = ee.current) == null || xe.call(ee, m, re);
|
|
4141
4149
|
}, [o, m, T, n, r]), Ct(() => {
|
|
4142
4150
|
a == null || a(m);
|
|
4143
4151
|
}, [m, a]);
|
|
4144
4152
|
const ut = ke(
|
|
4145
4153
|
async (re, xe) => {
|
|
4146
|
-
let ce =
|
|
4154
|
+
let ce = B.current;
|
|
4147
4155
|
const ie = (re == null ? void 0 : re.text) ?? "";
|
|
4148
4156
|
if (!ce && !ie) return;
|
|
4149
4157
|
if (!ce && ie) {
|
|
@@ -4291,7 +4299,7 @@ function ci({
|
|
|
4291
4299
|
}
|
|
4292
4300
|
) });
|
|
4293
4301
|
}
|
|
4294
|
-
function
|
|
4302
|
+
function Z(...e) {
|
|
4295
4303
|
return Im(Em(e));
|
|
4296
4304
|
}
|
|
4297
4305
|
const Yx = xs(
|
|
@@ -4324,7 +4332,7 @@ const Yx = xs(
|
|
|
4324
4332
|
return /* @__PURE__ */ u.jsx(
|
|
4325
4333
|
i,
|
|
4326
4334
|
{
|
|
4327
|
-
className:
|
|
4335
|
+
className: Z(Yx({ variant: t, size: n, className: e })),
|
|
4328
4336
|
ref: s,
|
|
4329
4337
|
...o
|
|
4330
4338
|
}
|
|
@@ -4336,7 +4344,7 @@ const Nu = v.forwardRef(
|
|
|
4336
4344
|
({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
4337
4345
|
"textarea",
|
|
4338
4346
|
{
|
|
4339
|
-
className:
|
|
4347
|
+
className: Z(
|
|
4340
4348
|
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
4341
4349
|
e
|
|
4342
4350
|
),
|
|
@@ -4362,23 +4370,23 @@ function Xx({
|
|
|
4362
4370
|
textareaClassName: p = "",
|
|
4363
4371
|
allowEmptySend: h = !1
|
|
4364
4372
|
}) {
|
|
4365
|
-
const m = i !== void 0, [y, x] =
|
|
4366
|
-
|
|
4373
|
+
const m = i !== void 0, [y, x] = H.useState(e), g = (m ? i : y) ?? "", [w, b] = H.useTransition(), T = H.useRef(null), C = H.useRef(0), S = H.useRef(null);
|
|
4374
|
+
H.useEffect(() => {
|
|
4367
4375
|
m || (x(e ?? ""), S.current = null, T.current && (T.current.style.height = "auto", T.current.style.height = `${T.current.scrollHeight}px`));
|
|
4368
4376
|
}, [e, t, m]);
|
|
4369
|
-
const k =
|
|
4377
|
+
const k = H.useCallback(() => {
|
|
4370
4378
|
const F = T.current;
|
|
4371
4379
|
F && (F.style.height = "auto", F.style.height = `${F.scrollHeight}px`);
|
|
4372
4380
|
}, []);
|
|
4373
|
-
|
|
4381
|
+
H.useEffect(() => {
|
|
4374
4382
|
k();
|
|
4375
4383
|
}, [k, g]);
|
|
4376
|
-
const E =
|
|
4384
|
+
const E = H.useCallback(
|
|
4377
4385
|
(F, { fromUser: _ }) => {
|
|
4378
4386
|
m || x(F), _ && (a == null || a(F));
|
|
4379
4387
|
},
|
|
4380
4388
|
[m, a]
|
|
4381
|
-
), N =
|
|
4389
|
+
), N = H.useCallback(
|
|
4382
4390
|
async (F) => {
|
|
4383
4391
|
F && F.preventDefault();
|
|
4384
4392
|
const _ = (g ?? "").trim();
|
|
@@ -4405,10 +4413,10 @@ function Xx({
|
|
|
4405
4413
|
});
|
|
4406
4414
|
},
|
|
4407
4415
|
[g, l, h, m, a]
|
|
4408
|
-
), I =
|
|
4416
|
+
), I = H.useCallback((F) => {
|
|
4409
4417
|
const _ = F.target.value;
|
|
4410
4418
|
E(_, { fromUser: !0 }), S.current && (S.current.shouldClear = !1), T.current && (T.current.style.height = "auto", T.current.style.height = `${T.current.scrollHeight}px`);
|
|
4411
|
-
}, [E]), j =
|
|
4419
|
+
}, [E]), j = H.useCallback(
|
|
4412
4420
|
(F) => {
|
|
4413
4421
|
F.key === "Enter" && !F.shiftKey ? (F.preventDefault(), N()) : F.key === "Escape" && t && (F.preventDefault(), c == null || c());
|
|
4414
4422
|
},
|
|
@@ -4458,7 +4466,7 @@ function Xx({
|
|
|
4458
4466
|
) })
|
|
4459
4467
|
] }) });
|
|
4460
4468
|
}
|
|
4461
|
-
const Jx =
|
|
4469
|
+
const Jx = H.memo(Xx);
|
|
4462
4470
|
function ue(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
4463
4471
|
return function(o) {
|
|
4464
4472
|
if (e == null || e(o), n === !1 || !o.defaultPrevented)
|
|
@@ -4636,27 +4644,27 @@ function xa(e) {
|
|
|
4636
4644
|
t,
|
|
4637
4645
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
4638
4646
|
), i = (y) => {
|
|
4639
|
-
const { scope: x, children: g } = y, w =
|
|
4647
|
+
const { scope: x, children: g } = y, w = H.useRef(null), b = H.useRef(/* @__PURE__ */ new Map()).current;
|
|
4640
4648
|
return /* @__PURE__ */ u.jsx(o, { scope: x, itemMap: b, collectionRef: w, children: g });
|
|
4641
4649
|
};
|
|
4642
4650
|
i.displayName = t;
|
|
4643
|
-
const a = e + "CollectionSlot", l = br(a), c =
|
|
4651
|
+
const a = e + "CollectionSlot", l = br(a), c = H.forwardRef(
|
|
4644
4652
|
(y, x) => {
|
|
4645
4653
|
const { scope: g, children: w } = y, b = s(a, g), T = qe(x, b.collectionRef);
|
|
4646
4654
|
return /* @__PURE__ */ u.jsx(l, { ref: T, children: w });
|
|
4647
4655
|
}
|
|
4648
4656
|
);
|
|
4649
4657
|
c.displayName = a;
|
|
4650
|
-
const d = e + "CollectionItemSlot", f = "data-radix-collection-item", p = br(d), h =
|
|
4658
|
+
const d = e + "CollectionItemSlot", f = "data-radix-collection-item", p = br(d), h = H.forwardRef(
|
|
4651
4659
|
(y, x) => {
|
|
4652
|
-
const { scope: g, children: w, ...b } = y, T =
|
|
4653
|
-
return
|
|
4660
|
+
const { scope: g, children: w, ...b } = y, T = H.useRef(null), C = qe(x, T), S = s(d, g);
|
|
4661
|
+
return H.useEffect(() => (S.itemMap.set(T, { ref: T, ...b }), () => void S.itemMap.delete(T))), /* @__PURE__ */ u.jsx(p, { [f]: "", ref: C, children: w });
|
|
4654
4662
|
}
|
|
4655
4663
|
);
|
|
4656
4664
|
h.displayName = d;
|
|
4657
4665
|
function m(y) {
|
|
4658
4666
|
const x = s(e + "CollectionConsumer", y);
|
|
4659
|
-
return
|
|
4667
|
+
return H.useCallback(() => {
|
|
4660
4668
|
const w = x.collectionRef.current;
|
|
4661
4669
|
if (!w) return [];
|
|
4662
4670
|
const b = Array.from(w.querySelectorAll(`[${f}]`));
|
|
@@ -6326,7 +6334,7 @@ var Xu = "PopperAnchor", Ju = v.forwardRef(
|
|
|
6326
6334
|
Ju.displayName = Xu;
|
|
6327
6335
|
var Ra = "PopperContent", [Mv, Dv] = qu(Ra), Zu = v.forwardRef(
|
|
6328
6336
|
(e, t) => {
|
|
6329
|
-
var
|
|
6337
|
+
var B, M, U, ee, te, se;
|
|
6330
6338
|
const {
|
|
6331
6339
|
__scopePopper: n,
|
|
6332
6340
|
side: r = "bottom",
|
|
@@ -6381,7 +6389,7 @@ var Ra = "PopperContent", [Mv, Dv] = qu(Ra), Zu = v.forwardRef(
|
|
|
6381
6389
|
Pt(() => {
|
|
6382
6390
|
K && (G == null || G());
|
|
6383
6391
|
}, [K, G]);
|
|
6384
|
-
const ge = (
|
|
6392
|
+
const ge = (B = P.arrow) == null ? void 0 : B.x, Se = (M = P.arrow) == null ? void 0 : M.y, Te = ((U = P.arrow) == null ? void 0 : U.centerOffset) !== 0, [Y, ne] = v.useState();
|
|
6385
6393
|
return Pt(() => {
|
|
6386
6394
|
g && ne(window.getComputedStyle(g).zIndex);
|
|
6387
6395
|
}, [g]), /* @__PURE__ */ u.jsx(
|
|
@@ -6396,7 +6404,7 @@ var Ra = "PopperContent", [Mv, Dv] = qu(Ra), Zu = v.forwardRef(
|
|
|
6396
6404
|
minWidth: "max-content",
|
|
6397
6405
|
zIndex: Y,
|
|
6398
6406
|
"--radix-popper-transform-origin": [
|
|
6399
|
-
(
|
|
6407
|
+
(ee = P.transformOrigin) == null ? void 0 : ee.x,
|
|
6400
6408
|
(te = P.transformOrigin) == null ? void 0 : te.y
|
|
6401
6409
|
].join(" "),
|
|
6402
6410
|
// hide the content if using the hide middleware and should be hidden
|
|
@@ -7379,10 +7387,10 @@ var rn = "MenuContent", [Jw, Aa] = lr(rn), Rd = v.forwardRef(
|
|
|
7379
7387
|
disableOutsideScroll: m,
|
|
7380
7388
|
...y
|
|
7381
7389
|
} = e, x = cr(rn, n), g = go(rn, n), w = Ms(n), b = Sd(n), T = Vw(n), [C, S] = v.useState(null), k = v.useRef(null), E = qe(t, k, x.onContentChange), N = v.useRef(0), I = v.useRef(""), j = v.useRef(0), L = v.useRef(null), z = v.useRef("right"), A = v.useRef(0), F = m ? Os : v.Fragment, _ = m ? { as: eb, allowPinchZoom: !0 } : void 0, K = (D) => {
|
|
7382
|
-
var
|
|
7383
|
-
const q = I.current + D, G = T().filter((U) => !U.disabled), ge = document.activeElement, Se = (
|
|
7384
|
-
(function U(
|
|
7385
|
-
I.current =
|
|
7390
|
+
var B, M;
|
|
7391
|
+
const q = I.current + D, G = T().filter((U) => !U.disabled), ge = document.activeElement, Se = (B = G.find((U) => U.ref.current === ge)) == null ? void 0 : B.textValue, Te = G.map((U) => U.textValue), Y = fb(Te, q, Se), ne = (M = G.find((U) => U.textValue === Y)) == null ? void 0 : M.ref.current;
|
|
7392
|
+
(function U(ee) {
|
|
7393
|
+
I.current = ee, window.clearTimeout(N.current), ee !== "" && (N.current = window.setTimeout(() => U(""), 1e3));
|
|
7386
7394
|
})(q), ne && setTimeout(() => ne.focus());
|
|
7387
7395
|
};
|
|
7388
7396
|
v.useEffect(() => () => window.clearTimeout(N.current), []), ya();
|
|
@@ -7470,7 +7478,7 @@ var rn = "MenuContent", [Jw, Aa] = lr(rn), Rd = v.forwardRef(
|
|
|
7470
7478
|
const Te = k.current;
|
|
7471
7479
|
if (D.target !== Te || !Hw.includes(D.key)) return;
|
|
7472
7480
|
D.preventDefault();
|
|
7473
|
-
const ne = T().filter((
|
|
7481
|
+
const ne = T().filter((B) => !B.disabled).map((B) => B.ref.current);
|
|
7474
7482
|
wd.includes(D.key) && ne.reverse(), ub(ne);
|
|
7475
7483
|
}),
|
|
7476
7484
|
onBlur: ue(e.onBlur, (D) => {
|
|
@@ -8016,7 +8024,7 @@ const Xb = qb, Jb = Gb, Zb = v.forwardRef(({ className: e, inset: t, children: n
|
|
|
8016
8024
|
ff,
|
|
8017
8025
|
{
|
|
8018
8026
|
ref: o,
|
|
8019
|
-
className:
|
|
8027
|
+
className: Z(
|
|
8020
8028
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
8021
8029
|
t && "pl-8",
|
|
8022
8030
|
e
|
|
@@ -8033,7 +8041,7 @@ const Qb = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
8033
8041
|
pf,
|
|
8034
8042
|
{
|
|
8035
8043
|
ref: n,
|
|
8036
|
-
className:
|
|
8044
|
+
className: Z(
|
|
8037
8045
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8038
8046
|
e
|
|
8039
8047
|
),
|
|
@@ -8046,7 +8054,7 @@ const hf = v.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
|
|
|
8046
8054
|
{
|
|
8047
8055
|
ref: r,
|
|
8048
8056
|
sideOffset: t,
|
|
8049
|
-
className:
|
|
8057
|
+
className: Z(
|
|
8050
8058
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8051
8059
|
e
|
|
8052
8060
|
),
|
|
@@ -8058,7 +8066,7 @@ const Vi = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
8058
8066
|
af,
|
|
8059
8067
|
{
|
|
8060
8068
|
ref: r,
|
|
8061
|
-
className:
|
|
8069
|
+
className: Z(
|
|
8062
8070
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8063
8071
|
t && "pl-8",
|
|
8064
8072
|
e
|
|
@@ -8071,7 +8079,7 @@ const e0 = v.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
|
|
|
8071
8079
|
lf,
|
|
8072
8080
|
{
|
|
8073
8081
|
ref: o,
|
|
8074
|
-
className:
|
|
8082
|
+
className: Z(
|
|
8075
8083
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8076
8084
|
e
|
|
8077
8085
|
),
|
|
@@ -8088,7 +8096,7 @@ const t0 = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
8088
8096
|
cf,
|
|
8089
8097
|
{
|
|
8090
8098
|
ref: r,
|
|
8091
|
-
className:
|
|
8099
|
+
className: Z(
|
|
8092
8100
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8093
8101
|
e
|
|
8094
8102
|
),
|
|
@@ -8104,7 +8112,7 @@ const n0 = v.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
|
|
|
8104
8112
|
sf,
|
|
8105
8113
|
{
|
|
8106
8114
|
ref: r,
|
|
8107
|
-
className:
|
|
8115
|
+
className: Z(
|
|
8108
8116
|
"px-2 py-1.5 text-sm font-semibold",
|
|
8109
8117
|
t && "pl-8",
|
|
8110
8118
|
e
|
|
@@ -8117,7 +8125,7 @@ const r0 = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
8117
8125
|
df,
|
|
8118
8126
|
{
|
|
8119
8127
|
ref: n,
|
|
8120
|
-
className:
|
|
8128
|
+
className: Z("-mx-1 my-1 h-px bg-muted", e),
|
|
8121
8129
|
...t
|
|
8122
8130
|
}
|
|
8123
8131
|
));
|
|
@@ -8439,10 +8447,10 @@ function ur(e, t, n) {
|
|
|
8439
8447
|
return La(e, t, n).callbackRef;
|
|
8440
8448
|
}
|
|
8441
8449
|
function La(e, t, n) {
|
|
8442
|
-
const r =
|
|
8450
|
+
const r = H.useRef(null);
|
|
8443
8451
|
let o = (i) => {
|
|
8444
8452
|
};
|
|
8445
|
-
const s =
|
|
8453
|
+
const s = H.useMemo(() => typeof ResizeObserver < "u" ? new ResizeObserver((i) => {
|
|
8446
8454
|
const a = () => {
|
|
8447
8455
|
const l = i[0].target;
|
|
8448
8456
|
l.offsetParent !== null && e(l);
|
|
@@ -8454,7 +8462,7 @@ function La(e, t, n) {
|
|
|
8454
8462
|
}, { callbackRef: o, ref: r };
|
|
8455
8463
|
}
|
|
8456
8464
|
function x0(e, t, n, r, o, s, i, a, l) {
|
|
8457
|
-
const c =
|
|
8465
|
+
const c = H.useCallback(
|
|
8458
8466
|
(d) => {
|
|
8459
8467
|
const f = y0(d.children, t, a ? "offsetWidth" : "offsetHeight", o);
|
|
8460
8468
|
let p = d.parentElement;
|
|
@@ -8497,7 +8505,7 @@ function fc(e, t, n) {
|
|
|
8497
8505
|
return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
|
|
8498
8506
|
}
|
|
8499
8507
|
function yf(e, t, n) {
|
|
8500
|
-
const r =
|
|
8508
|
+
const r = H.useRef(null), o = H.useCallback(
|
|
8501
8509
|
(l) => {
|
|
8502
8510
|
if (!(l != null && l.offsetParent))
|
|
8503
8511
|
return;
|
|
@@ -8518,10 +8526,10 @@ function yf(e, t, n) {
|
|
|
8518
8526
|
},
|
|
8519
8527
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8520
8528
|
[e, t]
|
|
8521
|
-
), { callbackRef: s, ref: i } = La(o, !0, n), a =
|
|
8529
|
+
), { callbackRef: s, ref: i } = La(o, !0, n), a = H.useCallback(() => {
|
|
8522
8530
|
o(i.current);
|
|
8523
8531
|
}, [o, i]);
|
|
8524
|
-
return
|
|
8532
|
+
return H.useEffect(() => {
|
|
8525
8533
|
var l;
|
|
8526
8534
|
if (t) {
|
|
8527
8535
|
t.addEventListener("scroll", a);
|
|
@@ -9658,11 +9666,11 @@ const dr = Qe(
|
|
|
9658
9666
|
const q = [];
|
|
9659
9667
|
if (L.length > 0) {
|
|
9660
9668
|
const Y = L[0], ne = L[L.length - 1];
|
|
9661
|
-
let
|
|
9669
|
+
let B = 0;
|
|
9662
9670
|
for (const M of zs(P, Y, ne)) {
|
|
9663
|
-
const U = M.value,
|
|
9664
|
-
for (let se =
|
|
9665
|
-
q.push({ data: F == null ? void 0 : F[se], index: se, offset:
|
|
9671
|
+
const U = M.value, ee = Math.max(M.start, Y), te = Math.min(M.end, ne);
|
|
9672
|
+
for (let se = ee; se <= te; se++)
|
|
9673
|
+
q.push({ data: F == null ? void 0 : F[se], index: se, offset: B, size: U }), B += U;
|
|
9666
9674
|
}
|
|
9667
9675
|
}
|
|
9668
9676
|
if (!j)
|
|
@@ -9672,18 +9680,18 @@ const dr = Qe(
|
|
|
9672
9680
|
return null;
|
|
9673
9681
|
const Se = E - 1, Te = Fs([], (Y) => {
|
|
9674
9682
|
for (const ne of ge) {
|
|
9675
|
-
const
|
|
9676
|
-
let M =
|
|
9677
|
-
const
|
|
9678
|
-
if (
|
|
9679
|
-
U += Math.floor((S -
|
|
9683
|
+
const B = ne.value;
|
|
9684
|
+
let M = B.offset, U = ne.start;
|
|
9685
|
+
const ee = B.size;
|
|
9686
|
+
if (B.offset < S) {
|
|
9687
|
+
U += Math.floor((S - B.offset + A) / (ee + A));
|
|
9680
9688
|
const se = U - ne.start;
|
|
9681
|
-
M += se *
|
|
9689
|
+
M += se * ee + se * A;
|
|
9682
9690
|
}
|
|
9683
|
-
U < G && (M += (G - U) *
|
|
9691
|
+
U < G && (M += (G - U) * ee, U = G);
|
|
9684
9692
|
const te = Math.min(ne.end, Se);
|
|
9685
9693
|
for (let se = U; se <= te && !(M >= k); se++)
|
|
9686
|
-
Y.push({ data: F == null ? void 0 : F[se], index: se, offset: M, size:
|
|
9694
|
+
Y.push({ data: F == null ? void 0 : F[se], index: se, offset: M, size: ee }), M += ee + A;
|
|
9687
9695
|
}
|
|
9688
9696
|
});
|
|
9689
9697
|
return Wo(Te, q, E, A, _, z);
|
|
@@ -10317,9 +10325,9 @@ function X0(e, t) {
|
|
|
10317
10325
|
Object.hasOwn(r, i) || (n[i] = t[i]);
|
|
10318
10326
|
return n;
|
|
10319
10327
|
}
|
|
10320
|
-
const Ao = typeof document < "u" ?
|
|
10328
|
+
const Ao = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
|
|
10321
10329
|
function $f(e, t, n) {
|
|
10322
|
-
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a =
|
|
10330
|
+
const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = H.createContext({});
|
|
10323
10331
|
function l(x, g) {
|
|
10324
10332
|
x.propsReady && Oe(x.propsReady, !1);
|
|
10325
10333
|
for (const w of r) {
|
|
@@ -10342,10 +10350,10 @@ function $f(e, t, n) {
|
|
|
10342
10350
|
function d(x) {
|
|
10343
10351
|
return i.reduce((g, w) => (g[w] = f0(x[t.events[w]]), g), {});
|
|
10344
10352
|
}
|
|
10345
|
-
const f =
|
|
10346
|
-
const { children: w, ...b } = x, [T] =
|
|
10353
|
+
const f = H.forwardRef((x, g) => {
|
|
10354
|
+
const { children: w, ...b } = x, [T] = H.useState(() => Fs(h0(e), (k) => {
|
|
10347
10355
|
l(k, b);
|
|
10348
|
-
})), [C] =
|
|
10356
|
+
})), [C] = H.useState(uc(d, T));
|
|
10349
10357
|
Ao(() => {
|
|
10350
10358
|
for (const k of i)
|
|
10351
10359
|
k in b && rt(C[k], b[k]);
|
|
@@ -10354,47 +10362,47 @@ function $f(e, t, n) {
|
|
|
10354
10362
|
};
|
|
10355
10363
|
}, [b, C, T]), Ao(() => {
|
|
10356
10364
|
l(T, b);
|
|
10357
|
-
}),
|
|
10365
|
+
}), H.useImperativeHandle(g, cc(c(T)));
|
|
10358
10366
|
const S = n;
|
|
10359
10367
|
return /* @__PURE__ */ u.jsx(a.Provider, { value: T, children: n ? /* @__PURE__ */ u.jsx(S, { ...X0([...r, ...o, ...i], b), children: w }) : w });
|
|
10360
10368
|
}), p = (x) => {
|
|
10361
|
-
const g =
|
|
10362
|
-
return
|
|
10369
|
+
const g = H.useContext(a);
|
|
10370
|
+
return H.useCallback(
|
|
10363
10371
|
(w) => {
|
|
10364
10372
|
Oe(g[x], w);
|
|
10365
10373
|
},
|
|
10366
10374
|
[g, x]
|
|
10367
10375
|
);
|
|
10368
10376
|
}, h = (x) => {
|
|
10369
|
-
const g =
|
|
10377
|
+
const g = H.useContext(a)[x], w = H.useCallback(
|
|
10370
10378
|
(b) => rt(g, b),
|
|
10371
10379
|
[g]
|
|
10372
10380
|
);
|
|
10373
|
-
return
|
|
10381
|
+
return H.useSyncExternalStore(
|
|
10374
10382
|
w,
|
|
10375
10383
|
() => kt(g),
|
|
10376
10384
|
() => kt(g)
|
|
10377
10385
|
);
|
|
10378
10386
|
}, m = (x) => {
|
|
10379
|
-
const g =
|
|
10387
|
+
const g = H.useContext(a)[x], [w, b] = H.useState(uc(kt, g));
|
|
10380
10388
|
return Ao(
|
|
10381
10389
|
() => rt(g, (T) => {
|
|
10382
10390
|
T !== w && b(cc(T));
|
|
10383
10391
|
}),
|
|
10384
10392
|
[g, w]
|
|
10385
10393
|
), w;
|
|
10386
|
-
}, y =
|
|
10394
|
+
}, y = H.version.startsWith("18") ? h : m;
|
|
10387
10395
|
return {
|
|
10388
10396
|
Component: f,
|
|
10389
10397
|
useEmitter: (x, g) => {
|
|
10390
|
-
const w =
|
|
10398
|
+
const w = H.useContext(a)[x];
|
|
10391
10399
|
Ao(() => rt(w, g), [g, w]);
|
|
10392
10400
|
},
|
|
10393
10401
|
useEmitterValue: y,
|
|
10394
10402
|
usePublisher: p
|
|
10395
10403
|
};
|
|
10396
10404
|
}
|
|
10397
|
-
const Ff =
|
|
10405
|
+
const Ff = H.createContext(void 0), zf = H.createContext(void 0), Bf = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
|
|
10398
10406
|
function Si(e) {
|
|
10399
10407
|
return "self" in e;
|
|
10400
10408
|
}
|
|
@@ -10402,7 +10410,7 @@ function J0(e) {
|
|
|
10402
10410
|
return "body" in e;
|
|
10403
10411
|
}
|
|
10404
10412
|
function Hf(e, t, n, r = _r, o, s) {
|
|
10405
|
-
const i =
|
|
10413
|
+
const i = H.useRef(null), a = H.useRef(null), l = H.useRef(null), c = H.useCallback(
|
|
10406
10414
|
(p) => {
|
|
10407
10415
|
let h, m, y;
|
|
10408
10416
|
const x = p.target;
|
|
@@ -10422,7 +10430,7 @@ function Hf(e, t, n, r = _r, o, s) {
|
|
|
10422
10430
|
},
|
|
10423
10431
|
[e, t, s]
|
|
10424
10432
|
);
|
|
10425
|
-
|
|
10433
|
+
H.useEffect(() => {
|
|
10426
10434
|
const p = o || i.current;
|
|
10427
10435
|
return r(o || i.current), c({ suppressFlushSync: !0, target: p }), p.addEventListener("scroll", c, { passive: !0 }), () => {
|
|
10428
10436
|
r(null), p.removeEventListener("scroll", c);
|
|
@@ -10490,7 +10498,7 @@ const Z0 = /* @__PURE__ */ Qe(() => {
|
|
|
10490
10498
|
}), Q0 = /* @__PURE__ */ Qe(
|
|
10491
10499
|
([e, t]) => ({ ...e, ...t }),
|
|
10492
10500
|
pt(Lf, Z0)
|
|
10493
|
-
), eS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), tS = { overflowAnchor: "none", position: Wa(), zIndex: 1 }, Uf = { overflowAnchor: "none" }, nS = { ...Uf, display: "inline-block", height: "100%" }, bc = /* @__PURE__ */
|
|
10501
|
+
), eS = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), tS = { overflowAnchor: "none", position: Wa(), zIndex: 1 }, Uf = { overflowAnchor: "none" }, nS = { ...Uf, display: "inline-block", height: "100%" }, bc = /* @__PURE__ */ H.memo(function({ showTopList: e = !1 }) {
|
|
10494
10502
|
const t = Ie("listState"), n = tn("sizeRanges"), r = Ie("useWindowScroll"), o = Ie("customScrollParent"), s = tn("windowScrollContainerState"), i = tn("scrollContainerState"), a = o || r ? s : i, l = Ie("itemContent"), c = Ie("context"), d = Ie("groupContent"), f = Ie("trackItemSizes"), p = Ie("itemSize"), h = Ie("log"), m = tn("gap"), y = Ie("horizontalDirection"), { callbackRef: x } = x0(
|
|
10495
10503
|
n,
|
|
10496
10504
|
p,
|
|
@@ -10501,7 +10509,7 @@ const Z0 = /* @__PURE__ */ Qe(() => {
|
|
|
10501
10509
|
o,
|
|
10502
10510
|
y,
|
|
10503
10511
|
Ie("skipAnimationFrameInResizeObserver")
|
|
10504
|
-
), [g, w] =
|
|
10512
|
+
), [g, w] = H.useState(0);
|
|
10505
10513
|
Ka("deviation", (A) => {
|
|
10506
10514
|
g !== A && w(A);
|
|
10507
10515
|
});
|
|
@@ -10597,9 +10605,9 @@ function Lt(e, t) {
|
|
|
10597
10605
|
function iS(e, t) {
|
|
10598
10606
|
return { item: typeof e == "string" ? void 0 : t };
|
|
10599
10607
|
}
|
|
10600
|
-
const aS = /* @__PURE__ */
|
|
10608
|
+
const aS = /* @__PURE__ */ H.memo(function() {
|
|
10601
10609
|
const e = Ie("HeaderComponent"), t = tn("headerHeight"), n = Ie("HeaderFooterTag"), r = ur(
|
|
10602
|
-
|
|
10610
|
+
H.useMemo(
|
|
10603
10611
|
() => (s) => {
|
|
10604
10612
|
t(Bn(s, "height"));
|
|
10605
10613
|
},
|
|
@@ -10609,9 +10617,9 @@ const aS = /* @__PURE__ */ B.memo(function() {
|
|
|
10609
10617
|
Ie("skipAnimationFrameInResizeObserver")
|
|
10610
10618
|
), o = Ie("context");
|
|
10611
10619
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
|
|
10612
|
-
}), lS = /* @__PURE__ */
|
|
10620
|
+
}), lS = /* @__PURE__ */ H.memo(function() {
|
|
10613
10621
|
const e = Ie("FooterComponent"), t = tn("footerHeight"), n = Ie("HeaderFooterTag"), r = ur(
|
|
10614
|
-
|
|
10622
|
+
H.useMemo(
|
|
10615
10623
|
() => (s) => {
|
|
10616
10624
|
t(Bn(s, "height"));
|
|
10617
10625
|
},
|
|
@@ -10623,7 +10631,7 @@ const aS = /* @__PURE__ */ B.memo(function() {
|
|
|
10623
10631
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
|
|
10624
10632
|
});
|
|
10625
10633
|
function Wf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
10626
|
-
return
|
|
10634
|
+
return H.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
10627
10635
|
const a = n("scrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("scrollerRef"), f = t("horizontalDirection") || !1, { scrollByCallback: p, scrollerRef: h, scrollToCallback: m } = Hf(
|
|
10628
10636
|
a,
|
|
10629
10637
|
c,
|
|
@@ -10648,8 +10656,8 @@ function Wf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10648
10656
|
});
|
|
10649
10657
|
}
|
|
10650
10658
|
function Vf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
10651
|
-
return
|
|
10652
|
-
const a = n("windowScrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("totalListHeight"), f = t("deviation"), p = t("customScrollParent"), h =
|
|
10659
|
+
return H.memo(function({ children: r, style: o, context: s, ...i }) {
|
|
10660
|
+
const a = n("windowScrollContainerState"), l = t("ScrollerComponent"), c = n("smoothScrollTargetReached"), d = t("totalListHeight"), f = t("deviation"), p = t("customScrollParent"), h = H.useRef(null), m = t("scrollerRef"), { scrollByCallback: y, scrollerRef: x, scrollToCallback: g } = Hf(
|
|
10653
10661
|
a,
|
|
10654
10662
|
c,
|
|
10655
10663
|
l,
|
|
@@ -10675,26 +10683,26 @@ function Vf({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
|
|
|
10675
10683
|
});
|
|
10676
10684
|
}
|
|
10677
10685
|
const cS = ({ children: e }) => {
|
|
10678
|
-
const t =
|
|
10686
|
+
const t = H.useContext(Ff), n = tn("viewportHeight"), r = tn("fixedItemHeight"), o = Ie("alignToBottom"), s = Ie("horizontalDirection"), i = H.useMemo(
|
|
10679
10687
|
() => gf(n, (l) => Bn(l, s ? "width" : "height")),
|
|
10680
10688
|
[n, s]
|
|
10681
10689
|
), a = ur(i, !0, Ie("skipAnimationFrameInResizeObserver"));
|
|
10682
|
-
return
|
|
10690
|
+
return H.useEffect(() => {
|
|
10683
10691
|
t && (n(t.viewportHeight), r(t.itemHeight));
|
|
10684
10692
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "element", ref: a, style: Hs(o), children: e });
|
|
10685
10693
|
}, uS = ({ children: e }) => {
|
|
10686
|
-
const t =
|
|
10694
|
+
const t = H.useContext(Ff), n = tn("windowViewportRect"), r = tn("fixedItemHeight"), o = Ie("customScrollParent"), s = yf(
|
|
10687
10695
|
n,
|
|
10688
10696
|
o,
|
|
10689
10697
|
Ie("skipAnimationFrameInResizeObserver")
|
|
10690
10698
|
), i = Ie("alignToBottom");
|
|
10691
|
-
return
|
|
10699
|
+
return H.useEffect(() => {
|
|
10692
10700
|
t && (r(t.itemHeight), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: 100 }));
|
|
10693
10701
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { "data-viewport-type": "window", ref: s, style: Hs(i), children: e });
|
|
10694
10702
|
}, dS = ({ children: e }) => {
|
|
10695
10703
|
const t = Ie("TopItemListComponent") || "div", n = Ie("headerHeight"), r = { ...sS, marginTop: `${n}px` }, o = Ie("context");
|
|
10696
10704
|
return /* @__PURE__ */ u.jsx(t, { style: r, ...Lt(t, o), children: e });
|
|
10697
|
-
}, fS = /* @__PURE__ */
|
|
10705
|
+
}, fS = /* @__PURE__ */ H.memo(function(e) {
|
|
10698
10706
|
const t = Ie("useWindowScroll"), n = Ie("topItemsIndexes").length > 0, r = Ie("customScrollParent"), o = Ie("context");
|
|
10699
10707
|
return /* @__PURE__ */ u.jsxs(r || t ? mS : hS, { ...e, context: o, children: [
|
|
10700
10708
|
n && /* @__PURE__ */ u.jsx(dS, { children: /* @__PURE__ */ u.jsx(bc, { showTopList: !0 }) }),
|
|
@@ -10861,7 +10869,7 @@ const bS = /* @__PURE__ */ Qe(
|
|
|
10861
10869
|
), rt(
|
|
10862
10870
|
W(
|
|
10863
10871
|
It(m, q, I, N, D, G),
|
|
10864
|
-
Ee(([M, U,
|
|
10872
|
+
Ee(([M, U, ee, te, , se]) => M && !U && ee.height !== 0 && te.height !== 0 && !se)
|
|
10865
10873
|
),
|
|
10866
10874
|
([, , , , M]) => {
|
|
10867
10875
|
Oe(G, !0), za(1, () => {
|
|
@@ -10902,8 +10910,8 @@ const bS = /* @__PURE__ */ Qe(
|
|
|
10902
10910
|
Re(F, (M, U) => M && M.column === U.column && M.row === U.row),
|
|
10903
10911
|
Re(c)
|
|
10904
10912
|
),
|
|
10905
|
-
ae(([M, U,
|
|
10906
|
-
gap:
|
|
10913
|
+
ae(([M, U, ee, te]) => ({
|
|
10914
|
+
gap: ee,
|
|
10907
10915
|
item: U,
|
|
10908
10916
|
scrollTop: te,
|
|
10909
10917
|
viewport: M
|
|
@@ -10928,7 +10936,7 @@ const bS = /* @__PURE__ */ Qe(
|
|
|
10928
10936
|
ae(
|
|
10929
10937
|
([
|
|
10930
10938
|
M,
|
|
10931
|
-
[U,
|
|
10939
|
+
[U, ee],
|
|
10932
10940
|
te,
|
|
10933
10941
|
se,
|
|
10934
10942
|
Ne,
|
|
@@ -10947,7 +10955,7 @@ const bS = /* @__PURE__ */ Qe(
|
|
|
10947
10955
|
}
|
|
10948
10956
|
const Ae = Kf(Ye, Ge, de);
|
|
10949
10957
|
let ze, et;
|
|
10950
|
-
Ve ? U === 0 &&
|
|
10958
|
+
Ve ? U === 0 && ee === 0 && Ze > 0 ? (ze = 0, et = Ze - 1) : (ze = Ae * ss((U + Pe) / (De + Pe)), et = Ae * Cc((ee + Pe) / (De + Pe)) - 1, et = Ti(M - 1, Wr(et, Ae - 1)), ze = Ti(et, Wr(0, ze))) : (ze = 0, et = -1);
|
|
10951
10959
|
const Et = kc(ze, et, He), { bottom: gt, top: xt } = Rc(Ne, te, se, Et), dt = Cc(M / Ae), ut = dt * De + (dt - 1) * Pe - gt;
|
|
10952
10960
|
return { bottom: gt, itemHeight: De, items: Et, itemWidth: Ge, offsetBottom: ut, offsetTop: xt, top: xt };
|
|
10953
10961
|
}
|
|
@@ -10964,9 +10972,9 @@ const bS = /* @__PURE__ */ Qe(
|
|
|
10964
10972
|
), ye(
|
|
10965
10973
|
W(
|
|
10966
10974
|
It(N, I, E, F),
|
|
10967
|
-
Ee(([M, U, { items:
|
|
10968
|
-
ae(([M, U, { items:
|
|
10969
|
-
const { bottom: se, top: Ne } = Rc(M, te, U,
|
|
10975
|
+
Ee(([M, U, { items: ee }]) => ee.length > 0 && U.height !== 0 && M.height !== 0),
|
|
10976
|
+
ae(([M, U, { items: ee }, te]) => {
|
|
10977
|
+
const { bottom: se, top: Ne } = Rc(M, te, U, ee);
|
|
10970
10978
|
return [Ne, se];
|
|
10971
10979
|
}),
|
|
10972
10980
|
ft(no)
|
|
@@ -10987,9 +10995,9 @@ const bS = /* @__PURE__ */ Qe(
|
|
|
10987
10995
|
It(E, S),
|
|
10988
10996
|
Ee(([{ items: M }]) => M.length > 0),
|
|
10989
10997
|
Fe(Se),
|
|
10990
|
-
Ee(([[M, U],
|
|
10998
|
+
Ee(([[M, U], ee]) => {
|
|
10991
10999
|
const te = M.items[M.items.length - 1].index === U - 1;
|
|
10992
|
-
return (
|
|
11000
|
+
return (ee || M.bottom > 0 && M.itemHeight > 0 && M.offsetBottom === 0 && M.items.length === U) && te;
|
|
10993
11001
|
}),
|
|
10994
11002
|
ae(([[, M]]) => M - 1),
|
|
10995
11003
|
ft()
|
|
@@ -11018,17 +11026,17 @@ const bS = /* @__PURE__ */ Qe(
|
|
|
11018
11026
|
W(
|
|
11019
11027
|
j,
|
|
11020
11028
|
Fe(N, I, S, F),
|
|
11021
|
-
ae(([M, U,
|
|
11029
|
+
ae(([M, U, ee, te, se]) => {
|
|
11022
11030
|
const Ne = Nf(M), { align: He, behavior: Ze, offset: Ve } = Ne;
|
|
11023
11031
|
let X = Ne.index;
|
|
11024
11032
|
X === "LAST" && (X = te - 1), X = Wr(0, X, Ti(te - 1, X));
|
|
11025
|
-
let de = Ji(U, se,
|
|
11026
|
-
return He === "end" ? de = Tc(de - U.height +
|
|
11033
|
+
let de = Ji(U, se, ee, X);
|
|
11034
|
+
return He === "end" ? de = Tc(de - U.height + ee.height) : He === "center" && (de = Tc(de - U.height / 2 + ee.height / 2)), Ve && (de += Ve), { behavior: Ze, top: de };
|
|
11027
11035
|
})
|
|
11028
11036
|
),
|
|
11029
11037
|
l
|
|
11030
11038
|
);
|
|
11031
|
-
const
|
|
11039
|
+
const B = $t(
|
|
11032
11040
|
W(
|
|
11033
11041
|
E,
|
|
11034
11042
|
ae((M) => M.offsetBottom + M.bottom)
|
|
@@ -11072,7 +11080,7 @@ const bS = /* @__PURE__ */ Qe(
|
|
|
11072
11080
|
gridState: E,
|
|
11073
11081
|
horizontalDirection: ge,
|
|
11074
11082
|
initialTopMostItemIndex: D,
|
|
11075
|
-
totalListHeight:
|
|
11083
|
+
totalListHeight: B,
|
|
11076
11084
|
...p,
|
|
11077
11085
|
endReached: Te,
|
|
11078
11086
|
propsReady: y,
|
|
@@ -11129,9 +11137,9 @@ const SS = /* @__PURE__ */ Qe(() => {
|
|
|
11129
11137
|
}), CS = /* @__PURE__ */ Qe(
|
|
11130
11138
|
([e, t]) => ({ ...e, ...t }),
|
|
11131
11139
|
pt(bS, SS)
|
|
11132
|
-
), TS = /* @__PURE__ */
|
|
11140
|
+
), TS = /* @__PURE__ */ H.memo(function() {
|
|
11133
11141
|
const e = ht("gridState"), t = ht("listClassName"), n = ht("itemClassName"), r = ht("itemContent"), o = ht("computeItemKey"), s = ht("isSeeking"), i = nn("scrollHeight"), a = ht("ItemComponent"), l = ht("ListComponent"), c = ht("ScrollSeekPlaceholder"), d = ht("context"), f = nn("itemDimensions"), p = nn("gap"), h = ht("log"), m = ht("stateRestoreInProgress"), y = nn("reportReadyState"), x = ur(
|
|
11134
|
-
|
|
11142
|
+
H.useMemo(
|
|
11135
11143
|
() => (g) => {
|
|
11136
11144
|
const w = g.parentElement.parentElement.scrollHeight;
|
|
11137
11145
|
i(w);
|
|
@@ -11184,9 +11192,9 @@ const SS = /* @__PURE__ */ Qe(() => {
|
|
|
11184
11192
|
})
|
|
11185
11193
|
}
|
|
11186
11194
|
);
|
|
11187
|
-
}), kS =
|
|
11195
|
+
}), kS = H.memo(function() {
|
|
11188
11196
|
const e = ht("HeaderComponent"), t = nn("headerHeight"), n = ht("headerFooterTag"), r = ur(
|
|
11189
|
-
|
|
11197
|
+
H.useMemo(
|
|
11190
11198
|
() => (s) => {
|
|
11191
11199
|
t(Bn(s, "height"));
|
|
11192
11200
|
},
|
|
@@ -11196,9 +11204,9 @@ const SS = /* @__PURE__ */ Qe(() => {
|
|
|
11196
11204
|
!1
|
|
11197
11205
|
), o = ht("context");
|
|
11198
11206
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
|
|
11199
|
-
}), RS =
|
|
11207
|
+
}), RS = H.memo(function() {
|
|
11200
11208
|
const e = ht("FooterComponent"), t = nn("footerHeight"), n = ht("headerFooterTag"), r = ur(
|
|
11201
|
-
|
|
11209
|
+
H.useMemo(
|
|
11202
11210
|
() => (s) => {
|
|
11203
11211
|
t(Bn(s, "height"));
|
|
11204
11212
|
},
|
|
@@ -11209,8 +11217,8 @@ const SS = /* @__PURE__ */ Qe(() => {
|
|
|
11209
11217
|
), o = ht("context");
|
|
11210
11218
|
return e ? /* @__PURE__ */ u.jsx(n, { ref: r, children: /* @__PURE__ */ u.jsx(e, { ...Lt(e, o) }) }) : null;
|
|
11211
11219
|
}), ES = ({ children: e }) => {
|
|
11212
|
-
const t =
|
|
11213
|
-
|
|
11220
|
+
const t = H.useContext(zf), n = nn("itemDimensions"), r = nn("viewportDimensions"), o = ur(
|
|
11221
|
+
H.useMemo(
|
|
11214
11222
|
() => (s) => {
|
|
11215
11223
|
r(s.getBoundingClientRect());
|
|
11216
11224
|
},
|
|
@@ -11219,15 +11227,15 @@ const SS = /* @__PURE__ */ Qe(() => {
|
|
|
11219
11227
|
!0,
|
|
11220
11228
|
!1
|
|
11221
11229
|
);
|
|
11222
|
-
return
|
|
11230
|
+
return H.useEffect(() => {
|
|
11223
11231
|
t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
|
|
11224
11232
|
}, [t, r, n]), /* @__PURE__ */ u.jsx("div", { ref: o, style: Hs(!1), children: e });
|
|
11225
11233
|
}, IS = ({ children: e }) => {
|
|
11226
|
-
const t =
|
|
11227
|
-
return
|
|
11234
|
+
const t = H.useContext(zf), n = nn("windowViewportRect"), r = nn("itemDimensions"), o = ht("customScrollParent"), s = yf(n, o, !1);
|
|
11235
|
+
return H.useEffect(() => {
|
|
11228
11236
|
t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
|
|
11229
11237
|
}, [t, n, r]), /* @__PURE__ */ u.jsx("div", { ref: s, style: Hs(!1), children: e });
|
|
11230
|
-
}, NS = /* @__PURE__ */
|
|
11238
|
+
}, NS = /* @__PURE__ */ H.memo(function({ ...e }) {
|
|
11231
11239
|
const t = ht("useWindowScroll"), n = ht("customScrollParent"), r = n || t ? _S : AS, o = n || t ? IS : ES, s = ht("context");
|
|
11232
11240
|
return /* @__PURE__ */ u.jsx(r, { ...e, ...Lt(r, s), children: /* @__PURE__ */ u.jsxs(o, { children: [
|
|
11233
11241
|
/* @__PURE__ */ u.jsx(kS, {}),
|
|
@@ -11300,13 +11308,13 @@ const jS = xs(
|
|
|
11300
11308
|
}
|
|
11301
11309
|
);
|
|
11302
11310
|
function Gf({ className: e, variant: t, ...n }) {
|
|
11303
|
-
return /* @__PURE__ */ u.jsx("div", { className:
|
|
11311
|
+
return /* @__PURE__ */ u.jsx("div", { className: Z(jS({ variant: t }), e), ...n });
|
|
11304
11312
|
}
|
|
11305
11313
|
const Vr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
11306
11314
|
"div",
|
|
11307
11315
|
{
|
|
11308
11316
|
ref: n,
|
|
11309
|
-
className:
|
|
11317
|
+
className: Z(
|
|
11310
11318
|
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
11311
11319
|
e
|
|
11312
11320
|
),
|
|
@@ -11318,7 +11326,7 @@ const Kr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11318
11326
|
"div",
|
|
11319
11327
|
{
|
|
11320
11328
|
ref: n,
|
|
11321
|
-
className:
|
|
11329
|
+
className: Z("flex flex-col space-y-1.5 p-6", e),
|
|
11322
11330
|
...t
|
|
11323
11331
|
}
|
|
11324
11332
|
));
|
|
@@ -11327,7 +11335,7 @@ const qr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11327
11335
|
"h3",
|
|
11328
11336
|
{
|
|
11329
11337
|
ref: n,
|
|
11330
|
-
className:
|
|
11338
|
+
className: Z(
|
|
11331
11339
|
"text-2xl font-semibold leading-none tracking-tight",
|
|
11332
11340
|
e
|
|
11333
11341
|
),
|
|
@@ -11339,18 +11347,18 @@ const Yf = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11339
11347
|
"p",
|
|
11340
11348
|
{
|
|
11341
11349
|
ref: n,
|
|
11342
|
-
className:
|
|
11350
|
+
className: Z("text-sm text-muted-foreground", e),
|
|
11343
11351
|
...t
|
|
11344
11352
|
}
|
|
11345
11353
|
));
|
|
11346
11354
|
Yf.displayName = "CardDescription";
|
|
11347
|
-
const Gr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className:
|
|
11355
|
+
const Gr = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx("div", { ref: n, className: Z("p-6 pt-0", e), ...t }));
|
|
11348
11356
|
Gr.displayName = "CardContent";
|
|
11349
11357
|
const Xf = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
11350
11358
|
"div",
|
|
11351
11359
|
{
|
|
11352
11360
|
ref: n,
|
|
11353
|
-
className:
|
|
11361
|
+
className: Z("flex items-center p-6 pt-0", e),
|
|
11354
11362
|
...t
|
|
11355
11363
|
}
|
|
11356
11364
|
));
|
|
@@ -11793,7 +11801,7 @@ const ZS = mp, QS = gp, yp = v.forwardRef(({ className: e, ...t }, n) => /* @__P
|
|
|
11793
11801
|
Ws,
|
|
11794
11802
|
{
|
|
11795
11803
|
ref: n,
|
|
11796
|
-
className:
|
|
11804
|
+
className: Z(
|
|
11797
11805
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
11798
11806
|
e
|
|
11799
11807
|
),
|
|
@@ -11823,7 +11831,7 @@ const vp = v.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
|
11823
11831
|
Vs,
|
|
11824
11832
|
{
|
|
11825
11833
|
ref: r,
|
|
11826
|
-
className:
|
|
11834
|
+
className: Z(
|
|
11827
11835
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
11828
11836
|
e
|
|
11829
11837
|
),
|
|
@@ -11847,7 +11855,7 @@ const wp = ({
|
|
|
11847
11855
|
}) => /* @__PURE__ */ u.jsx(
|
|
11848
11856
|
"div",
|
|
11849
11857
|
{
|
|
11850
|
-
className:
|
|
11858
|
+
className: Z(
|
|
11851
11859
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
11852
11860
|
e
|
|
11853
11861
|
),
|
|
@@ -11859,7 +11867,7 @@ const bp = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11859
11867
|
er,
|
|
11860
11868
|
{
|
|
11861
11869
|
ref: n,
|
|
11862
|
-
className:
|
|
11870
|
+
className: Z(
|
|
11863
11871
|
"text-lg font-semibold leading-none tracking-tight",
|
|
11864
11872
|
e
|
|
11865
11873
|
),
|
|
@@ -11871,13 +11879,13 @@ const eC = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
11871
11879
|
Ks,
|
|
11872
11880
|
{
|
|
11873
11881
|
ref: n,
|
|
11874
|
-
className:
|
|
11882
|
+
className: Z("text-sm text-muted-foreground", e),
|
|
11875
11883
|
...t
|
|
11876
11884
|
}
|
|
11877
11885
|
));
|
|
11878
11886
|
eC.displayName = Ks.displayName;
|
|
11879
11887
|
function tC({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
|
|
11880
|
-
const [s, i] = ve(!1), [a, l] = ve(null), [c, d] = ve(null), { toast: f } = qa(), p =
|
|
11888
|
+
const [s, i] = ve(!1), [a, l] = ve(null), [c, d] = ve(null), { toast: f } = qa(), p = H.useCallback(async () => {
|
|
11881
11889
|
if (n) {
|
|
11882
11890
|
i(!0), d(null), l(null);
|
|
11883
11891
|
try {
|
|
@@ -13580,7 +13588,7 @@ function us({
|
|
|
13580
13588
|
return /* @__PURE__ */ u.jsx(
|
|
13581
13589
|
"div",
|
|
13582
13590
|
{
|
|
13583
|
-
className:
|
|
13591
|
+
className: Z(
|
|
13584
13592
|
"markdown prose prose-sm max-w-none break-words",
|
|
13585
13593
|
// In dark mode, use prose-invert for better contrast in dark bubbles
|
|
13586
13594
|
"dark:prose-invert",
|
|
@@ -13659,7 +13667,7 @@ function CC({ className: e }) {
|
|
|
13659
13667
|
"span",
|
|
13660
13668
|
{
|
|
13661
13669
|
"aria-live": "polite",
|
|
13662
|
-
className:
|
|
13670
|
+
className: Z("inline-block text-xs opacity-70 ml-1", e),
|
|
13663
13671
|
children: [
|
|
13664
13672
|
"Is thinking",
|
|
13665
13673
|
".".repeat(t)
|
|
@@ -13667,7 +13675,7 @@ function CC({ className: e }) {
|
|
|
13667
13675
|
}
|
|
13668
13676
|
);
|
|
13669
13677
|
}
|
|
13670
|
-
const Lc =
|
|
13678
|
+
const Lc = H.memo(function({
|
|
13671
13679
|
message: t,
|
|
13672
13680
|
messageIndex: n,
|
|
13673
13681
|
isStreamingMessage: r = !1,
|
|
@@ -13698,9 +13706,9 @@ const Lc = B.memo(function({
|
|
|
13698
13706
|
uploadingFiles: Te,
|
|
13699
13707
|
handleFileClick: Y,
|
|
13700
13708
|
fileViewerOpen: ne,
|
|
13701
|
-
currentFileInfo:
|
|
13709
|
+
currentFileInfo: B,
|
|
13702
13710
|
closeFileViewer: M
|
|
13703
|
-
} = kC({ allowFileOpen: Se, currentThreadId: _ }), U =
|
|
13711
|
+
} = kC({ allowFileOpen: Se, currentThreadId: _ }), U = H.useMemo(() => {
|
|
13704
13712
|
switch (D) {
|
|
13705
13713
|
case "user":
|
|
13706
13714
|
return "text-[hsl(var(--chat-bubble-user-text))]";
|
|
@@ -13713,7 +13721,7 @@ const Lc = B.memo(function({
|
|
|
13713
13721
|
default:
|
|
13714
13722
|
return "text-[hsl(var(--chat-bubble-ai-text))]";
|
|
13715
13723
|
}
|
|
13716
|
-
}, [D]),
|
|
13724
|
+
}, [D]), ee = it(() => G ? "" : wC(t.content), [G, t]), te = it(() => G ? {} : Np(t), [G, t]), se = it(
|
|
13717
13725
|
() => G ? [] : t.content.filter(($) => $.type === "image_url"),
|
|
13718
13726
|
[G, t]
|
|
13719
13727
|
), Ne = it(
|
|
@@ -13722,8 +13730,8 @@ const Lc = B.memo(function({
|
|
|
13722
13730
|
), He = it(
|
|
13723
13731
|
() => G ? [] : t.content.filter(($) => $.type === "interrupt"),
|
|
13724
13732
|
[G, t]
|
|
13725
|
-
), Ze = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), Ve = Po(Ze), X = g == null ? void 0 : g.value, de = it(() => G ? "" : bC(t.content), [G, t]), Pe =
|
|
13726
|
-
const $ = q ? de :
|
|
13733
|
+
), Ze = (g == null ? void 0 : g.id) ?? (g == null ? void 0 : g.interrupt_id), Ve = Po(Ze), X = g == null ? void 0 : g.value, de = it(() => G ? "" : bC(t.content), [G, t]), Pe = H.useCallback(async () => {
|
|
13734
|
+
const $ = q ? de : ee;
|
|
13727
13735
|
async function fe(me) {
|
|
13728
13736
|
if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
|
|
13729
13737
|
await navigator.clipboard.writeText(me);
|
|
@@ -13745,17 +13753,17 @@ const Lc = B.memo(function({
|
|
|
13745
13753
|
} catch (me) {
|
|
13746
13754
|
console.error("Failed to copy:", me);
|
|
13747
13755
|
}
|
|
13748
|
-
}, [q, de,
|
|
13756
|
+
}, [q, de, ee, x]), De = H.useCallback(() => {
|
|
13749
13757
|
if (!h) return;
|
|
13750
|
-
const $ = q ? de :
|
|
13758
|
+
const $ = q ? de : ee, fe = "type" in t && t.type === "default_message" ? void 0 : {
|
|
13751
13759
|
checkpointId: t.checkpointId ?? null,
|
|
13752
13760
|
checkpointNs: t.checkpointNs ?? null
|
|
13753
13761
|
};
|
|
13754
13762
|
h(t.id, $, fe);
|
|
13755
|
-
}, [h, t.id, q, de,
|
|
13763
|
+
}, [h, t.id, q, de, ee, t]), Ge = H.useCallback(() => {
|
|
13756
13764
|
m == null || m(n);
|
|
13757
|
-
}, [m, n]), Ye =
|
|
13758
|
-
const fe =
|
|
13765
|
+
}, [m, n]), Ye = H.useCallback(() => {
|
|
13766
|
+
const fe = Z(P ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", U);
|
|
13759
13767
|
switch (D) {
|
|
13760
13768
|
case "user":
|
|
13761
13769
|
return /* @__PURE__ */ u.jsx(um, { className: fe });
|
|
@@ -13766,25 +13774,25 @@ const Lc = B.memo(function({
|
|
|
13766
13774
|
default:
|
|
13767
13775
|
return /* @__PURE__ */ u.jsx(ni, { className: fe });
|
|
13768
13776
|
}
|
|
13769
|
-
}, [P, U, D]), Ae =
|
|
13777
|
+
}, [P, U, D]), Ae = H.useCallback(() => {
|
|
13770
13778
|
const $ = "group relative mb-4 flex w-full";
|
|
13771
13779
|
switch (D) {
|
|
13772
13780
|
case "user":
|
|
13773
|
-
return
|
|
13781
|
+
return Z($, "justify-end");
|
|
13774
13782
|
case "assistant":
|
|
13775
13783
|
case "tool":
|
|
13776
13784
|
case "system":
|
|
13777
|
-
return
|
|
13785
|
+
return Z($, "justify-start");
|
|
13778
13786
|
default:
|
|
13779
13787
|
return $;
|
|
13780
13788
|
}
|
|
13781
|
-
}, [D]), ze =
|
|
13782
|
-
const $ =
|
|
13789
|
+
}, [D]), ze = H.useCallback(() => {
|
|
13790
|
+
const $ = Z(
|
|
13783
13791
|
"rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
|
|
13784
13792
|
P && "px-3 py-2 text-sm"
|
|
13785
13793
|
);
|
|
13786
13794
|
if (ge)
|
|
13787
|
-
return
|
|
13795
|
+
return Z(
|
|
13788
13796
|
$,
|
|
13789
13797
|
"w-full",
|
|
13790
13798
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
@@ -13792,25 +13800,25 @@ const Lc = B.memo(function({
|
|
|
13792
13800
|
);
|
|
13793
13801
|
switch (D) {
|
|
13794
13802
|
case "user":
|
|
13795
|
-
return
|
|
13803
|
+
return Z(
|
|
13796
13804
|
$,
|
|
13797
13805
|
"w-full md:max-w-[95%]",
|
|
13798
13806
|
"bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
|
|
13799
13807
|
"border border-transparent"
|
|
13800
13808
|
);
|
|
13801
13809
|
case "assistant":
|
|
13802
|
-
return
|
|
13810
|
+
return Z(
|
|
13803
13811
|
$,
|
|
13804
13812
|
"w-full md:max-w-[95%]",
|
|
13805
13813
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
13806
13814
|
"border border-border/60 dark:border-border/40"
|
|
13807
13815
|
);
|
|
13808
13816
|
case "tool":
|
|
13809
|
-
return
|
|
13817
|
+
return Z($, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
|
|
13810
13818
|
case "system":
|
|
13811
|
-
return
|
|
13819
|
+
return Z($, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
|
|
13812
13820
|
default:
|
|
13813
|
-
return
|
|
13821
|
+
return Z(
|
|
13814
13822
|
$,
|
|
13815
13823
|
"w-full md:max-w-[95%]",
|
|
13816
13824
|
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
@@ -13819,9 +13827,9 @@ const Lc = B.memo(function({
|
|
|
13819
13827
|
}
|
|
13820
13828
|
}, [P, ge, D]);
|
|
13821
13829
|
if (ge && G)
|
|
13822
|
-
return /* @__PURE__ */ u.jsx("div", { className:
|
|
13830
|
+
return /* @__PURE__ */ u.jsx("div", { className: Z(Ae(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Z(ze(), p.content), children: [
|
|
13823
13831
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
|
|
13824
|
-
/* @__PURE__ */ u.jsx(ni, { className:
|
|
13832
|
+
/* @__PURE__ */ u.jsx(ni, { className: Z("h-4 w-4", U) }),
|
|
13825
13833
|
a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
|
|
13826
13834
|
] }),
|
|
13827
13835
|
/* @__PURE__ */ u.jsx(
|
|
@@ -13832,7 +13840,7 @@ const Lc = B.memo(function({
|
|
|
13832
13840
|
}
|
|
13833
13841
|
)
|
|
13834
13842
|
] }) });
|
|
13835
|
-
const et =
|
|
13843
|
+
const et = H.useCallback(async ($) => {
|
|
13836
13844
|
if (w)
|
|
13837
13845
|
return;
|
|
13838
13846
|
const fe = Po(
|
|
@@ -13849,7 +13857,7 @@ const Lc = B.memo(function({
|
|
|
13849
13857
|
} finally {
|
|
13850
13858
|
T == null || T();
|
|
13851
13859
|
}
|
|
13852
|
-
}, [w, T, b, K]), Et =
|
|
13860
|
+
}, [w, T, b, K]), Et = H.useCallback(async ($) => {
|
|
13853
13861
|
if (w)
|
|
13854
13862
|
return;
|
|
13855
13863
|
const fe = Po(
|
|
@@ -13866,7 +13874,7 @@ const Lc = B.memo(function({
|
|
|
13866
13874
|
} finally {
|
|
13867
13875
|
T == null || T();
|
|
13868
13876
|
}
|
|
13869
|
-
}, [w, T, b, K]), gt =
|
|
13877
|
+
}, [w, T, b, K]), gt = H.useCallback(({ part: $, i: fe }) => {
|
|
13870
13878
|
if ($.type === "text") {
|
|
13871
13879
|
const me = $.text ?? "", ot = me.trim(), yt = Ga(ot);
|
|
13872
13880
|
return yt && D !== "tool" ? /* @__PURE__ */ u.jsx(Ap, { data: yt }, fe) : D === "user" && c && ot.length > d ? /* @__PURE__ */ u.jsx(
|
|
@@ -13946,11 +13954,11 @@ const Lc = B.memo(function({
|
|
|
13946
13954
|
g,
|
|
13947
13955
|
w,
|
|
13948
13956
|
He
|
|
13949
|
-
]), xt =
|
|
13957
|
+
]), xt = H.useCallback(() => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 p-2 bg-muted/30 rounded", children: [
|
|
13950
13958
|
/* @__PURE__ */ u.jsx(Ii, { className: "h-4 w-4 text-muted-foreground" }),
|
|
13951
13959
|
/* @__PURE__ */ u.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
|
|
13952
|
-
] }), []), dt =
|
|
13953
|
-
const $ =
|
|
13960
|
+
] }), []), dt = H.useCallback(() => {
|
|
13961
|
+
const $ = ee.trim().length > 0 || se.length > 0 || Ne.length > 0 || He.length > 0;
|
|
13954
13962
|
if (!q && Ne.length > 0 && !r)
|
|
13955
13963
|
return xt();
|
|
13956
13964
|
if (!q && !$ && !r)
|
|
@@ -13972,7 +13980,7 @@ const Lc = B.memo(function({
|
|
|
13972
13980
|
] }) : me;
|
|
13973
13981
|
}
|
|
13974
13982
|
}, [
|
|
13975
|
-
|
|
13983
|
+
ee,
|
|
13976
13984
|
se.length,
|
|
13977
13985
|
Ne.length,
|
|
13978
13986
|
He.length,
|
|
@@ -13981,17 +13989,17 @@ const Lc = B.memo(function({
|
|
|
13981
13989
|
L,
|
|
13982
13990
|
xt,
|
|
13983
13991
|
U
|
|
13984
|
-
]), ut = it(() => G ? "Assistant" : SC(t), [G, t]), Me =
|
|
13992
|
+
]), ut = it(() => G ? "Assistant" : SC(t), [G, t]), Me = H.useMemo(() => G ? [] : Array.isArray(C) ? C : [], [C, G]), At = H.useMemo(() => {
|
|
13985
13993
|
var $;
|
|
13986
13994
|
return Me.length ? E && Me.some((fe) => fe.id === E) ? E : (($ = Me[0]) == null ? void 0 : $.id) ?? null : null;
|
|
13987
|
-
}, [E, Me]), re =
|
|
13995
|
+
}, [E, Me]), re = H.useMemo(() => !Me.length || !S ? null : Me.some(($) => $.id === S) ? S : null, [S, Me]) ?? At, xe = D === "user" && Me.length > 0 && typeof k == "function", ce = H.useCallback(
|
|
13988
13996
|
($) => {
|
|
13989
13997
|
if (!k) return;
|
|
13990
13998
|
const fe = ($ == null ? void 0 : $.id) ?? null, me = ($ == null ? void 0 : $.parentId) ?? N ?? null;
|
|
13991
13999
|
k(fe, me);
|
|
13992
14000
|
},
|
|
13993
14001
|
[N, k]
|
|
13994
|
-
), ie =
|
|
14002
|
+
), ie = H.useMemo(() => re ? Me.findIndex(($) => $.id === re) : -1, [re, Me]), Le = H.useMemo(() => ie < 0 ? null : Me[ie] ?? null, [ie, Me]), tt = H.useCallback(($) => {
|
|
13995
14003
|
const fe = [];
|
|
13996
14004
|
if ($.step !== null && fe.push(`Step ${$.step}`), $.source && fe.push($.source), !$.createdAt)
|
|
13997
14005
|
return fe.length ? fe.join(" • ") : $.id.slice(0, 8);
|
|
@@ -14008,11 +14016,11 @@ const Lc = B.memo(function({
|
|
|
14008
14016
|
return `${me}`;
|
|
14009
14017
|
}, []);
|
|
14010
14018
|
return q && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
|
14011
|
-
/* @__PURE__ */ u.jsx("div", { className:
|
|
14019
|
+
/* @__PURE__ */ u.jsx("div", { className: Z(Ae(), p.container), children: /* @__PURE__ */ u.jsxs("div", { className: Z(ze(), p.content), children: [
|
|
14012
14020
|
(i || a || q) && /* @__PURE__ */ u.jsxs(
|
|
14013
14021
|
"div",
|
|
14014
14022
|
{
|
|
14015
|
-
className:
|
|
14023
|
+
className: Z(
|
|
14016
14024
|
"flex items-center justify-between mb-2 pb-2 border-b border-current/10",
|
|
14017
14025
|
P && "mb-1 pb-1",
|
|
14018
14026
|
U,
|
|
@@ -14021,12 +14029,12 @@ const Lc = B.memo(function({
|
|
|
14021
14029
|
children: [
|
|
14022
14030
|
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
14023
14031
|
Ye(),
|
|
14024
|
-
a && ut && /* @__PURE__ */ u.jsx("span", { className:
|
|
14032
|
+
a && ut && /* @__PURE__ */ u.jsx("span", { className: Z("font-medium", P ? "text-xs" : "text-sm"), children: ut }),
|
|
14025
14033
|
q && /* @__PURE__ */ u.jsxs(
|
|
14026
14034
|
Gf,
|
|
14027
14035
|
{
|
|
14028
14036
|
variant: "outline",
|
|
14029
|
-
className:
|
|
14037
|
+
className: Z(
|
|
14030
14038
|
"text-xs flex items-center gap-1 cursor-pointer select-none",
|
|
14031
14039
|
U,
|
|
14032
14040
|
"border border-current/40",
|
|
@@ -14053,7 +14061,7 @@ const Lc = B.memo(function({
|
|
|
14053
14061
|
"button",
|
|
14054
14062
|
{
|
|
14055
14063
|
type: "button",
|
|
14056
|
-
className:
|
|
14064
|
+
className: Z(
|
|
14057
14065
|
"flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
|
|
14058
14066
|
ie > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
14059
14067
|
),
|
|
@@ -14079,7 +14087,7 @@ const Lc = B.memo(function({
|
|
|
14079
14087
|
"button",
|
|
14080
14088
|
{
|
|
14081
14089
|
type: "button",
|
|
14082
|
-
className:
|
|
14090
|
+
className: Z(
|
|
14083
14091
|
"flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
|
|
14084
14092
|
ie < Me.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
|
|
14085
14093
|
),
|
|
@@ -14097,7 +14105,7 @@ const Lc = B.memo(function({
|
|
|
14097
14105
|
i && t.createdAt && /* @__PURE__ */ u.jsx(
|
|
14098
14106
|
"time",
|
|
14099
14107
|
{
|
|
14100
|
-
className:
|
|
14108
|
+
className: Z("text-xs opacity-60", U, P && "text-xs"),
|
|
14101
14109
|
dateTime: new Date(t.createdAt).toISOString(),
|
|
14102
14110
|
title: new Date(t.createdAt).toLocaleString(),
|
|
14103
14111
|
children: new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit" }).format(new Date(t.createdAt))
|
|
@@ -14106,7 +14114,7 @@ const Lc = B.memo(function({
|
|
|
14106
14114
|
s && !o && /* @__PURE__ */ u.jsxs(
|
|
14107
14115
|
"div",
|
|
14108
14116
|
{
|
|
14109
|
-
className:
|
|
14117
|
+
className: Z(
|
|
14110
14118
|
"opacity-0 group-hover:opacity-100 transition-opacity",
|
|
14111
14119
|
"flex items-center gap-1",
|
|
14112
14120
|
p.actions
|
|
@@ -14118,10 +14126,10 @@ const Lc = B.memo(function({
|
|
|
14118
14126
|
variant: "ghost",
|
|
14119
14127
|
size: "sm",
|
|
14120
14128
|
onClick: () => Pe(),
|
|
14121
|
-
className:
|
|
14129
|
+
className: Z("h-6 w-6 p-0 hover:bg-foreground/10", U, P && "h-5 w-5"),
|
|
14122
14130
|
"aria-label": "Copy message",
|
|
14123
14131
|
title: "Copy message",
|
|
14124
|
-
children: /* @__PURE__ */ u.jsx(al, { className:
|
|
14132
|
+
children: /* @__PURE__ */ u.jsx(al, { className: Z(I ? "text-success" : U, P ? "h-3 w-3" : "h-4 w-4") })
|
|
14125
14133
|
}
|
|
14126
14134
|
) }),
|
|
14127
14135
|
D === "user" && h && /* @__PURE__ */ u.jsx(
|
|
@@ -14130,9 +14138,9 @@ const Lc = B.memo(function({
|
|
|
14130
14138
|
variant: "ghost",
|
|
14131
14139
|
size: "sm",
|
|
14132
14140
|
onClick: De,
|
|
14133
|
-
className:
|
|
14141
|
+
className: Z("h-6 w-6 p-0 hover:bg-foreground/10", U, P && "h-5 w-5"),
|
|
14134
14142
|
"aria-label": "Edit message",
|
|
14135
|
-
children: /* @__PURE__ */ u.jsx(ll, { className:
|
|
14143
|
+
children: /* @__PURE__ */ u.jsx(ll, { className: Z(U, P ? "h-3 w-3" : "h-4 w-4") })
|
|
14136
14144
|
}
|
|
14137
14145
|
),
|
|
14138
14146
|
D === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
@@ -14141,9 +14149,9 @@ const Lc = B.memo(function({
|
|
|
14141
14149
|
variant: "ghost",
|
|
14142
14150
|
size: "sm",
|
|
14143
14151
|
onClick: Ge,
|
|
14144
|
-
className:
|
|
14152
|
+
className: Z("h-6 w-6 p-0 hover:bg-foreground/10", U, P && "h-5 w-5"),
|
|
14145
14153
|
"aria-label": "Regenerate response",
|
|
14146
|
-
children: /* @__PURE__ */ u.jsx(Ni, { className:
|
|
14154
|
+
children: /* @__PURE__ */ u.jsx(Ni, { className: Z(U, P ? "h-3 w-3" : "h-4 w-4") })
|
|
14147
14155
|
}
|
|
14148
14156
|
)
|
|
14149
14157
|
]
|
|
@@ -14154,7 +14162,7 @@ const Lc = B.memo(function({
|
|
|
14154
14162
|
}
|
|
14155
14163
|
),
|
|
14156
14164
|
/* @__PURE__ */ u.jsx("div", { className: "relative", children: dt() }),
|
|
14157
|
-
q && L === "expanded" && (te.toolCallId || te.name) && /* @__PURE__ */ u.jsxs("div", { className:
|
|
14165
|
+
q && L === "expanded" && (te.toolCallId || te.name) && /* @__PURE__ */ u.jsxs("div", { className: Z("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", P && "text-xs"), children: [
|
|
14158
14166
|
te.name && /* @__PURE__ */ u.jsxs("div", { children: [
|
|
14159
14167
|
"Function: ",
|
|
14160
14168
|
te.name
|
|
@@ -14167,7 +14175,7 @@ const Lc = B.memo(function({
|
|
|
14167
14175
|
!(i || a || q) && s && !o && /* @__PURE__ */ u.jsxs(
|
|
14168
14176
|
"div",
|
|
14169
14177
|
{
|
|
14170
|
-
className:
|
|
14178
|
+
className: Z(
|
|
14171
14179
|
"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
14172
14180
|
"flex items-center gap-1",
|
|
14173
14181
|
p.actions
|
|
@@ -14179,8 +14187,8 @@ const Lc = B.memo(function({
|
|
|
14179
14187
|
variant: "ghost",
|
|
14180
14188
|
size: "sm",
|
|
14181
14189
|
onClick: () => Pe(),
|
|
14182
|
-
className:
|
|
14183
|
-
children: /* @__PURE__ */ u.jsx(al, { className:
|
|
14190
|
+
className: Z("h-6 w-6 p-0 hover:bg-background/50 text-current", P && "h-5 w-5"),
|
|
14191
|
+
children: /* @__PURE__ */ u.jsx(al, { className: Z(I ? "text-success" : "text-current", P ? "h-3 w-3" : "h-4 w-4") })
|
|
14184
14192
|
}
|
|
14185
14193
|
),
|
|
14186
14194
|
D === "user" && h && /* @__PURE__ */ u.jsx(
|
|
@@ -14189,8 +14197,8 @@ const Lc = B.memo(function({
|
|
|
14189
14197
|
variant: "ghost",
|
|
14190
14198
|
size: "sm",
|
|
14191
14199
|
onClick: De,
|
|
14192
|
-
className:
|
|
14193
|
-
children: /* @__PURE__ */ u.jsx(ll, { className:
|
|
14200
|
+
className: Z("h-6 w-6 p-0 hover:bg-background/50 text-current", P && "h-5 w-5"),
|
|
14201
|
+
children: /* @__PURE__ */ u.jsx(ll, { className: Z("text-current", P ? "h-3 w-3" : "h-4 w-4") })
|
|
14194
14202
|
}
|
|
14195
14203
|
),
|
|
14196
14204
|
D === "assistant" && m && /* @__PURE__ */ u.jsx(
|
|
@@ -14199,22 +14207,22 @@ const Lc = B.memo(function({
|
|
|
14199
14207
|
variant: "ghost",
|
|
14200
14208
|
size: "sm",
|
|
14201
14209
|
onClick: Ge,
|
|
14202
|
-
className:
|
|
14203
|
-
children: /* @__PURE__ */ u.jsx(Ni, { className:
|
|
14210
|
+
className: Z("h-6 w-6 p-0 hover:bg-background/50 text-current", P && "h-5 w-5"),
|
|
14211
|
+
children: /* @__PURE__ */ u.jsx(Ni, { className: Z("text-current", P ? "h-3 w-3" : "h-4 w-4") })
|
|
14204
14212
|
}
|
|
14205
14213
|
)
|
|
14206
14214
|
]
|
|
14207
14215
|
}
|
|
14208
14216
|
)
|
|
14209
14217
|
] }) }),
|
|
14210
|
-
|
|
14218
|
+
B && /* @__PURE__ */ u.jsx(
|
|
14211
14219
|
tC,
|
|
14212
14220
|
{
|
|
14213
14221
|
isOpen: ne,
|
|
14214
14222
|
onClose: M,
|
|
14215
|
-
fileId:
|
|
14216
|
-
fileName:
|
|
14217
|
-
mimeType:
|
|
14223
|
+
fileId: B.id,
|
|
14224
|
+
fileName: B.name,
|
|
14225
|
+
mimeType: B.mimeType
|
|
14218
14226
|
}
|
|
14219
14227
|
)
|
|
14220
14228
|
] });
|
|
@@ -14257,7 +14265,7 @@ function TC({
|
|
|
14257
14265
|
return /* @__PURE__ */ u.jsxs(
|
|
14258
14266
|
Vr,
|
|
14259
14267
|
{
|
|
14260
|
-
className:
|
|
14268
|
+
className: Z(
|
|
14261
14269
|
"border-blue-200 dark:border-blue-800 bg-blue-50/50 dark:bg-blue-950/10 transition-shadow",
|
|
14262
14270
|
o ? "shadow-md ring-1 ring-blue-300 dark:ring-blue-500/70" : "opacity-80"
|
|
14263
14271
|
),
|
|
@@ -14295,11 +14303,11 @@ function TC({
|
|
|
14295
14303
|
);
|
|
14296
14304
|
}
|
|
14297
14305
|
function kC(e) {
|
|
14298
|
-
const { allowFileOpen: t, currentThreadId: n } = e, { toast: r } = qa(), [o, s] = ve({}), [i, a] = ve(null), [l, c] = ve(!1), d =
|
|
14306
|
+
const { allowFileOpen: t, currentThreadId: n } = e, { toast: r } = qa(), [o, s] = ve({}), [i, a] = ve(null), [l, c] = ve(!1), d = H.useCallback(() => {
|
|
14299
14307
|
c(!1), a(null);
|
|
14300
|
-
}, []), f =
|
|
14308
|
+
}, []), f = H.useCallback((h) => {
|
|
14301
14309
|
a(h), c(!0);
|
|
14302
|
-
}, []), p =
|
|
14310
|
+
}, []), p = H.useCallback(
|
|
14303
14311
|
async (h, m, y) => {
|
|
14304
14312
|
var x, g;
|
|
14305
14313
|
if (!t) {
|
|
@@ -14375,10 +14383,10 @@ function RC({
|
|
|
14375
14383
|
}) {
|
|
14376
14384
|
const s = Math.max(e.length - r, 0), i = e.substring(0, r);
|
|
14377
14385
|
return /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
14378
|
-
/* @__PURE__ */ u.jsx("div", { className:
|
|
14386
|
+
/* @__PURE__ */ u.jsx("div", { className: Z("text-sm text-[hsl(var(--chat-bubble-user-text))]", o && "text-xs"), children: t ? /* @__PURE__ */ u.jsx(us, { content: e, allowHtml: !1 }) : /* @__PURE__ */ u.jsxs(
|
|
14379
14387
|
"pre",
|
|
14380
14388
|
{
|
|
14381
|
-
className:
|
|
14389
|
+
className: Z(
|
|
14382
14390
|
"font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]",
|
|
14383
14391
|
o && "text-xs"
|
|
14384
14392
|
),
|
|
@@ -14453,7 +14461,7 @@ function EC({ message: e, viewMode: t }) {
|
|
|
14453
14461
|
const $c = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, IC = (e) => {
|
|
14454
14462
|
const t = e.additionalKwargs ?? {}, n = e.responseMetadata ?? {}, r = t.originalMessageId ?? n.originalMessageId ?? t.original_message_id ?? n.original_message_id;
|
|
14455
14463
|
return typeof r == "string" && r.trim() ? r.trim() : e.id;
|
|
14456
|
-
}, _p =
|
|
14464
|
+
}, _p = H.forwardRef(({
|
|
14457
14465
|
messages: e,
|
|
14458
14466
|
isStreaming: t,
|
|
14459
14467
|
streamingAssistantId: n,
|
|
@@ -14544,7 +14552,7 @@ const $c = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, IC = (e) =>
|
|
|
14544
14552
|
}
|
|
14545
14553
|
}
|
|
14546
14554
|
};
|
|
14547
|
-
}, [a]),
|
|
14555
|
+
}, [a]), B = it(() => !m || y ? !1 : K ? "auto" : !1, [K, m, y]), M = j ?? [], U = it(
|
|
14548
14556
|
() => [...M].reverse(),
|
|
14549
14557
|
[M]
|
|
14550
14558
|
);
|
|
@@ -14555,7 +14563,7 @@ const $c = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, IC = (e) =>
|
|
|
14555
14563
|
M.map((X) => ({ id: X.id, step: X.step, label: X.label }))
|
|
14556
14564
|
);
|
|
14557
14565
|
}, [M]);
|
|
14558
|
-
const
|
|
14566
|
+
const ee = N ?? (M.length ? M[M.length - 1].id : null), te = M.length > 0, se = it(() => {
|
|
14559
14567
|
if (typeof h != "string") return null;
|
|
14560
14568
|
const X = h.trim();
|
|
14561
14569
|
return X ? {
|
|
@@ -14583,7 +14591,7 @@ const $c = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, IC = (e) =>
|
|
|
14583
14591
|
] }),
|
|
14584
14592
|
/* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute left-5 top-0 bottom-0 w-px bg-border/50" }),
|
|
14585
14593
|
/* @__PURE__ */ u.jsx("div", { className: "flex flex-col gap-4", children: U.map((X) => {
|
|
14586
|
-
const de =
|
|
14594
|
+
const de = ee === X.id;
|
|
14587
14595
|
return /* @__PURE__ */ u.jsxs(
|
|
14588
14596
|
"button",
|
|
14589
14597
|
{
|
|
@@ -14675,7 +14683,7 @@ const $c = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, IC = (e) =>
|
|
|
14675
14683
|
F.current = X instanceof HTMLDivElement ? X : null;
|
|
14676
14684
|
},
|
|
14677
14685
|
data: Te,
|
|
14678
|
-
followOutput:
|
|
14686
|
+
followOutput: B,
|
|
14679
14687
|
overscan: 200,
|
|
14680
14688
|
increaseViewportBy: { top: 100, bottom: 200 },
|
|
14681
14689
|
defaultItemHeight: 80,
|
|
@@ -14791,26 +14799,26 @@ function Ei({
|
|
|
14791
14799
|
}, [Se]);
|
|
14792
14800
|
const ne = ke(() => {
|
|
14793
14801
|
Y(!0);
|
|
14794
|
-
}, []),
|
|
14802
|
+
}, []), B = ke(() => {
|
|
14795
14803
|
Y(!1);
|
|
14796
|
-
}, []), M = !!Se || Te, [U,
|
|
14797
|
-
Fc.value =
|
|
14804
|
+
}, []), M = !!Se || Te, [U, ee] = ve(null), [te, se] = ve(""), [Ne, He] = ve(null), [Ze, Ve] = ve(null), [X, de] = ve([]), [Pe, De] = ve(0), [Ge, Ye] = ve(0), [Ae, ze] = ve(!1), [et, Et] = ve(null), [gt, xt] = ve(null), [dt, ut] = ve(!1), [Me, At] = ve(null), [Ft, re] = ve(!1), xe = Je(!1), [ce, ie] = ve(() => Fc.value), Le = Je(ce), tt = Je(null), $ = ke((Q) => {
|
|
14805
|
+
Fc.value = Q, ie(Q);
|
|
14798
14806
|
}, []), [fe, me] = ve(!1), ot = Je(null), yt = ke(
|
|
14799
|
-
(
|
|
14800
|
-
if (!
|
|
14801
|
-
const he =
|
|
14807
|
+
(Q, pe) => {
|
|
14808
|
+
if (!Q || typeof Q != "object") return null;
|
|
14809
|
+
const he = Q[pe];
|
|
14802
14810
|
return typeof he == "number" ? he : null;
|
|
14803
14811
|
},
|
|
14804
14812
|
[]
|
|
14805
14813
|
), qt = ke(
|
|
14806
|
-
(
|
|
14807
|
-
if (!
|
|
14808
|
-
const he =
|
|
14814
|
+
(Q, pe) => {
|
|
14815
|
+
if (!Q || typeof Q != "object") return null;
|
|
14816
|
+
const he = Q[pe];
|
|
14809
14817
|
return typeof he == "string" && he.trim() ? he : null;
|
|
14810
14818
|
},
|
|
14811
14819
|
[]
|
|
14812
14820
|
), Ue = it(() => {
|
|
14813
|
-
const
|
|
14821
|
+
const Q = ($e) => {
|
|
14814
14822
|
if (!Array.isArray($e) || $e.length === 0)
|
|
14815
14823
|
return null;
|
|
14816
14824
|
const bt = $e.map((St) => {
|
|
@@ -14825,7 +14833,7 @@ function Ei({
|
|
|
14825
14833
|
}).filter((St) => !!(St && St.length));
|
|
14826
14834
|
return bt.length ? bt.join(", ") : null;
|
|
14827
14835
|
}, pe = Array.isArray(I) ? I.map(($e) => {
|
|
14828
|
-
const bt =
|
|
14836
|
+
const bt = Q($e.next);
|
|
14829
14837
|
return bt ? {
|
|
14830
14838
|
...$e,
|
|
14831
14839
|
metadata: {
|
|
@@ -14842,7 +14850,7 @@ function Ei({
|
|
|
14842
14850
|
return Number.isNaN(Pr) || Number.isNaN(Or) ? 0 : Or - Pr;
|
|
14843
14851
|
}), pe;
|
|
14844
14852
|
}, [I, yt]), { checkpointMetaById: Gt, checkpointIndexByKey: at } = it(() => {
|
|
14845
|
-
const
|
|
14853
|
+
const Q = /* @__PURE__ */ new Map(), pe = /* @__PURE__ */ new Map();
|
|
14846
14854
|
for (const he of Ue) {
|
|
14847
14855
|
const $e = he.checkpointId ?? null;
|
|
14848
14856
|
if (!$e) continue;
|
|
@@ -14854,7 +14862,7 @@ function Ei({
|
|
|
14854
14862
|
namespace: he.checkpointNs ?? null,
|
|
14855
14863
|
parentId: he.parentId ?? null
|
|
14856
14864
|
};
|
|
14857
|
-
if (
|
|
14865
|
+
if (Q.set($e, En), bt !== null && St) {
|
|
14858
14866
|
const Pr = `${bt}:${St}`, Or = pe.get(Pr) ?? [];
|
|
14859
14867
|
Or.push(En), pe.set(Pr, Or);
|
|
14860
14868
|
}
|
|
@@ -14864,12 +14872,12 @@ function Ei({
|
|
|
14864
14872
|
const St = $e.createdAt ?? "";
|
|
14865
14873
|
return (bt.createdAt ?? "").localeCompare(St);
|
|
14866
14874
|
});
|
|
14867
|
-
return { checkpointMetaById:
|
|
14875
|
+
return { checkpointMetaById: Q, checkpointIndexByKey: pe };
|
|
14868
14876
|
}, [Ue, yt, qt]), Tt = z ?? [], On = Je(null), Yn = Je(null), Mn = ke(() => {
|
|
14869
|
-
On.current && (On.current.value = ""), Yn.current && (Yn.current.value = ""), De((
|
|
14877
|
+
On.current && (On.current.value = ""), Yn.current && (Yn.current.value = ""), De((Q) => Q + 1), Ye((Q) => Q + 1);
|
|
14870
14878
|
}, []), Qs = ke(
|
|
14871
|
-
(
|
|
14872
|
-
$(
|
|
14879
|
+
(Q) => {
|
|
14880
|
+
$(Q);
|
|
14873
14881
|
},
|
|
14874
14882
|
[$]
|
|
14875
14883
|
), wo = Je(!1);
|
|
@@ -14878,11 +14886,11 @@ function Ei({
|
|
|
14878
14886
|
}, [A, Mn]);
|
|
14879
14887
|
const [ei, ti] = ve("desktop");
|
|
14880
14888
|
Ct(() => {
|
|
14881
|
-
const
|
|
14889
|
+
const Q = () => {
|
|
14882
14890
|
const pe = window.innerWidth;
|
|
14883
14891
|
ti(pe < 640 ? "phone" : pe < 1024 ? "tablet" : "desktop");
|
|
14884
14892
|
};
|
|
14885
|
-
return
|
|
14893
|
+
return Q(), window.addEventListener("resize", Q), () => window.removeEventListener("resize", Q);
|
|
14886
14894
|
}, []), Ct(() => {
|
|
14887
14895
|
re(!1), xe.current = !1;
|
|
14888
14896
|
}, [D]), Ct(() => {
|
|
@@ -14898,8 +14906,8 @@ function Ei({
|
|
|
14898
14906
|
if (!(!b || T || !Ft))
|
|
14899
14907
|
try {
|
|
14900
14908
|
await S();
|
|
14901
|
-
} catch (
|
|
14902
|
-
console.warn("loadOlder failed",
|
|
14909
|
+
} catch (Q) {
|
|
14910
|
+
console.warn("loadOlder failed", Q);
|
|
14903
14911
|
}
|
|
14904
14912
|
}, [b, Ft, T, S]);
|
|
14905
14913
|
Ct(() => {
|
|
@@ -14918,16 +14926,16 @@ function Ei({
|
|
|
14918
14926
|
}, [y.baseUrl]), Ct(() => {
|
|
14919
14927
|
F && !dt && (m == null || m(F));
|
|
14920
14928
|
}, [F, dt, m]);
|
|
14921
|
-
const V = (
|
|
14922
|
-
if (
|
|
14923
|
-
return `Message too long (${
|
|
14929
|
+
const V = (Q) => {
|
|
14930
|
+
if (Q.length > Ho)
|
|
14931
|
+
return `Message too long (${Q.length}/${Ho} characters)`;
|
|
14924
14932
|
try {
|
|
14925
|
-
return i0(
|
|
14933
|
+
return i0(Q), null;
|
|
14926
14934
|
} catch (pe) {
|
|
14927
14935
|
return (pe == null ? void 0 : pe.message) || "Invalid message";
|
|
14928
14936
|
}
|
|
14929
|
-
}, oe = async (
|
|
14930
|
-
const pe =
|
|
14937
|
+
}, oe = async (Q) => {
|
|
14938
|
+
const pe = Q.trim();
|
|
14931
14939
|
if (!(!pe && X.length === 0)) {
|
|
14932
14940
|
if (pe) {
|
|
14933
14941
|
const he = V(pe);
|
|
@@ -14953,29 +14961,29 @@ function Ei({
|
|
|
14953
14961
|
checkpointId: he,
|
|
14954
14962
|
checkpointNs: $e
|
|
14955
14963
|
}
|
|
14956
|
-
), p == null || p(pe), $(""), Ve(null), de([]), Mn(),
|
|
14964
|
+
), p == null || p(pe), $(""), Ve(null), de([]), Mn(), ee(null), se(""), He(null);
|
|
14957
14965
|
} catch (he) {
|
|
14958
14966
|
const $e = (he == null ? void 0 : he.message) || "Failed to send message";
|
|
14959
14967
|
Ve($e), m == null || m($e);
|
|
14960
14968
|
}
|
|
14961
14969
|
}
|
|
14962
|
-
}, Ce =
|
|
14963
|
-
(
|
|
14964
|
-
c && (tt.current = ce,
|
|
14970
|
+
}, Ce = H.useCallback(
|
|
14971
|
+
(Q, pe, he) => {
|
|
14972
|
+
c && (tt.current = ce, ee(Q), se(pe), $(pe), Ve(null), He({
|
|
14965
14973
|
checkpointId: (he == null ? void 0 : he.checkpointId) ?? null,
|
|
14966
14974
|
checkpointNs: (he == null ? void 0 : he.checkpointNs) ?? null
|
|
14967
14975
|
}));
|
|
14968
14976
|
},
|
|
14969
14977
|
[ce, c, $]
|
|
14970
|
-
), Xe =
|
|
14971
|
-
|
|
14978
|
+
), Xe = H.useCallback(() => {
|
|
14979
|
+
ee(null), se(""), He(null), Ve(null), $(tt.current ?? ce), tt.current = null;
|
|
14972
14980
|
}, [ce, $]), st = ke(
|
|
14973
|
-
(
|
|
14974
|
-
Ce(
|
|
14981
|
+
(Q, pe, he) => {
|
|
14982
|
+
Ce(Q, pe, he);
|
|
14975
14983
|
},
|
|
14976
14984
|
[Ce]
|
|
14977
|
-
), We = ke((
|
|
14978
|
-
for (let pe =
|
|
14985
|
+
), We = ke((Q) => {
|
|
14986
|
+
for (let pe = Q - 1; pe >= 0; pe--)
|
|
14979
14987
|
if (w[pe].role === "user") {
|
|
14980
14988
|
const he = w[pe].content || [], bt = he.filter((St) => St.type === "text").map((St) => St.text).join("") || (() => {
|
|
14981
14989
|
try {
|
|
@@ -14993,16 +15001,16 @@ function Ei({
|
|
|
14993
15001
|
);
|
|
14994
15002
|
break;
|
|
14995
15003
|
}
|
|
14996
|
-
}, [w, K, q, G]), Be = (
|
|
14997
|
-
const pe = Array.from(
|
|
14998
|
-
de((he) => [...he, ...pe]),
|
|
14999
|
-
}, _t = (
|
|
15004
|
+
}, [w, K, q, G]), Be = (Q) => {
|
|
15005
|
+
const pe = Array.from(Q.target.files || []);
|
|
15006
|
+
de((he) => [...he, ...pe]), Q.target.value = "";
|
|
15007
|
+
}, _t = (Q) => {
|
|
15000
15008
|
de((pe) => {
|
|
15001
|
-
const he = pe.filter(($e, bt) =>
|
|
15009
|
+
const he = pe.filter(($e, bt) => Q !== bt);
|
|
15002
15010
|
return he.length === 0 && Mn(), he;
|
|
15003
15011
|
});
|
|
15004
|
-
}, vt = async (
|
|
15005
|
-
const pe = (
|
|
15012
|
+
}, vt = async (Q) => {
|
|
15013
|
+
const pe = (Q.target.files || [])[0];
|
|
15006
15014
|
if (pe) {
|
|
15007
15015
|
Et(null), xt(null), ze(!0);
|
|
15008
15016
|
try {
|
|
@@ -15019,22 +15027,22 @@ function Ei({
|
|
|
15019
15027
|
const $e = he instanceof Error ? he.message : "Failed to upload Excel file";
|
|
15020
15028
|
console.error("Excel upload failed", he), Et($e), m == null || m($e);
|
|
15021
15029
|
} finally {
|
|
15022
|
-
ze(!1),
|
|
15030
|
+
ze(!1), Q.target.value = "", Mn();
|
|
15023
15031
|
}
|
|
15024
15032
|
}
|
|
15025
|
-
}, wt = async (
|
|
15033
|
+
}, wt = async (Q) => {
|
|
15026
15034
|
if (x) {
|
|
15027
15035
|
me(!0);
|
|
15028
15036
|
try {
|
|
15029
|
-
if (!
|
|
15037
|
+
if (!Q) {
|
|
15030
15038
|
await E(), re(!1), requestAnimationFrame(() => {
|
|
15031
15039
|
var $e;
|
|
15032
15040
|
($e = ot.current) == null || $e.scrollToLatest();
|
|
15033
15041
|
});
|
|
15034
15042
|
return;
|
|
15035
15043
|
}
|
|
15036
|
-
const pe = Ue.find(($e) => $e.checkpointId ===
|
|
15037
|
-
await k(
|
|
15044
|
+
const pe = Ue.find(($e) => $e.checkpointId === Q), he = (pe == null ? void 0 : pe.checkpointNs) ?? null;
|
|
15045
|
+
await k(Q, he), re(!0), requestAnimationFrame(() => {
|
|
15038
15046
|
var $e;
|
|
15039
15047
|
($e = ot.current) == null || $e.scrollToTop();
|
|
15040
15048
|
});
|
|
@@ -15043,18 +15051,18 @@ function Ei({
|
|
|
15043
15051
|
}
|
|
15044
15052
|
}
|
|
15045
15053
|
}, Ht = ke(
|
|
15046
|
-
async (
|
|
15047
|
-
await wt(
|
|
15054
|
+
async (Q) => {
|
|
15055
|
+
await wt(Q);
|
|
15048
15056
|
},
|
|
15049
15057
|
[wt]
|
|
15050
15058
|
), Dn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${f.container || ""}`, Rn = `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 ${f.messagesArea || ""}`, Ot = `flex-shrink-0 w-full border-t p-4 bg-transparent ${f.inputArea || ""}`;
|
|
15051
15059
|
return ke(
|
|
15052
|
-
(
|
|
15053
|
-
if (!
|
|
15060
|
+
(Q) => {
|
|
15061
|
+
if (!Q)
|
|
15054
15062
|
return "Latest";
|
|
15055
15063
|
const pe = [];
|
|
15056
|
-
|
|
15057
|
-
const he =
|
|
15064
|
+
Q.step !== null && pe.push(`Step ${Q.step}`), Q.source && pe.push(Q.source);
|
|
15065
|
+
const he = Q.createdAt ? new Date(Q.createdAt) : null, $e = he && !Number.isNaN(he.getTime()) ? he.toLocaleString() : Q.createdAt ?? Q.id, bt = pe.length ? ` — ${pe.join(" • ")}` : "";
|
|
15058
15066
|
return `${$e}${bt}`;
|
|
15059
15067
|
},
|
|
15060
15068
|
[]
|
|
@@ -15096,12 +15104,12 @@ function Ei({
|
|
|
15096
15104
|
onStartReached: () => {
|
|
15097
15105
|
Ft && R();
|
|
15098
15106
|
},
|
|
15099
|
-
onScrollAway: (
|
|
15107
|
+
onScrollAway: (Q) => {
|
|
15100
15108
|
if (!xe.current) {
|
|
15101
15109
|
xe.current = !0;
|
|
15102
15110
|
return;
|
|
15103
15111
|
}
|
|
15104
|
-
|
|
15112
|
+
Q && re(!0);
|
|
15105
15113
|
},
|
|
15106
15114
|
onEdit: st,
|
|
15107
15115
|
onRegenerate: We,
|
|
@@ -15111,7 +15119,7 @@ function Ei({
|
|
|
15111
15119
|
activeInterrupt: Se,
|
|
15112
15120
|
disableInterruptActions: Te,
|
|
15113
15121
|
onInterruptActionStart: ne,
|
|
15114
|
-
onInterruptActionEnd:
|
|
15122
|
+
onInterruptActionEnd: B,
|
|
15115
15123
|
showToolMessages: d,
|
|
15116
15124
|
checkpointMetaById: Gt,
|
|
15117
15125
|
checkpointIndexByKey: at,
|
|
@@ -15161,14 +15169,14 @@ function Ei({
|
|
|
15161
15169
|
ref: On,
|
|
15162
15170
|
type: "file",
|
|
15163
15171
|
multiple: !0,
|
|
15164
|
-
onChange: (
|
|
15172
|
+
onChange: (Q) => Be(Q),
|
|
15165
15173
|
className: "hidden"
|
|
15166
15174
|
},
|
|
15167
15175
|
Pe
|
|
15168
15176
|
),
|
|
15169
|
-
X.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: X.map((
|
|
15177
|
+
X.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: X.map((Q, pe) => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
|
|
15170
15178
|
/* @__PURE__ */ u.jsx(Ii, { size: 14 }),
|
|
15171
|
-
/* @__PURE__ */ u.jsx("span", { className: "truncate max-w-[150px]", children:
|
|
15179
|
+
/* @__PURE__ */ u.jsx("span", { className: "truncate max-w-[150px]", children: Q.name }),
|
|
15172
15180
|
/* @__PURE__ */ u.jsx(
|
|
15173
15181
|
nt,
|
|
15174
15182
|
{
|
|
@@ -15176,7 +15184,7 @@ function Ei({
|
|
|
15176
15184
|
size: "sm",
|
|
15177
15185
|
onClick: () => _t(pe),
|
|
15178
15186
|
className: "h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400",
|
|
15179
|
-
"aria-label": `Remove ${
|
|
15187
|
+
"aria-label": `Remove ${Q.name}`,
|
|
15180
15188
|
children: /* @__PURE__ */ u.jsx(gr, { size: 12 })
|
|
15181
15189
|
}
|
|
15182
15190
|
)
|
|
@@ -15219,8 +15227,8 @@ function Ei({
|
|
|
15219
15227
|
) }),
|
|
15220
15228
|
/* @__PURE__ */ u.jsxs(hf, { align: "start", sideOffset: 6, className: "w-52", children: [
|
|
15221
15229
|
a && /* @__PURE__ */ u.jsxs(Vi, { onClick: () => {
|
|
15222
|
-
var
|
|
15223
|
-
return (
|
|
15230
|
+
var Q;
|
|
15231
|
+
return (Q = On.current) == null ? void 0 : Q.click();
|
|
15224
15232
|
}, className: "cursor-pointer", children: [
|
|
15225
15233
|
/* @__PURE__ */ u.jsx(Ii, { className: "h-4 w-4 mr-2" }),
|
|
15226
15234
|
" Attach files or images"
|
|
@@ -15229,8 +15237,8 @@ function Ei({
|
|
|
15229
15237
|
Vi,
|
|
15230
15238
|
{
|
|
15231
15239
|
onClick: () => {
|
|
15232
|
-
var
|
|
15233
|
-
Ae || (
|
|
15240
|
+
var Q;
|
|
15241
|
+
Ae || (Q = Yn.current) == null || Q.click();
|
|
15234
15242
|
},
|
|
15235
15243
|
className: `cursor-pointer ${Ae ? "opacity-60 pointer-events-none" : ""}`,
|
|
15236
15244
|
children: [
|
|
@@ -15268,7 +15276,7 @@ const ds = v.forwardRef(
|
|
|
15268
15276
|
"input",
|
|
15269
15277
|
{
|
|
15270
15278
|
type: t,
|
|
15271
|
-
className:
|
|
15279
|
+
className: Z(
|
|
15272
15280
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
15273
15281
|
e
|
|
15274
15282
|
),
|
|
@@ -15796,7 +15804,7 @@ const Vp = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
15796
15804
|
Wp,
|
|
15797
15805
|
{
|
|
15798
15806
|
ref: r,
|
|
15799
|
-
className:
|
|
15807
|
+
className: Z("relative overflow-hidden", e),
|
|
15800
15808
|
...n,
|
|
15801
15809
|
children: [
|
|
15802
15810
|
/* @__PURE__ */ u.jsx(zC, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
|
|
@@ -15811,7 +15819,7 @@ const Kp = v.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
|
|
|
15811
15819
|
{
|
|
15812
15820
|
ref: r,
|
|
15813
15821
|
orientation: t,
|
|
15814
|
-
className:
|
|
15822
|
+
className: Z(
|
|
15815
15823
|
"flex touch-none select-none transition-colors",
|
|
15816
15824
|
t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
15817
15825
|
t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
@@ -15856,13 +15864,13 @@ function Hc({
|
|
|
15856
15864
|
"[data-radix-scroll-area-viewport]"
|
|
15857
15865
|
);
|
|
15858
15866
|
if (!Y) return;
|
|
15859
|
-
let ne = null,
|
|
15867
|
+
let ne = null, B = null;
|
|
15860
15868
|
return ne = requestAnimationFrame(() => {
|
|
15861
|
-
|
|
15869
|
+
B = requestAnimationFrame(() => {
|
|
15862
15870
|
Y.scrollTop = E.current;
|
|
15863
15871
|
});
|
|
15864
15872
|
}), () => {
|
|
15865
|
-
ne !== null && cancelAnimationFrame(ne),
|
|
15873
|
+
ne !== null && cancelAnimationFrame(ne), B !== null && cancelAnimationFrame(B);
|
|
15866
15874
|
};
|
|
15867
15875
|
}, [T]);
|
|
15868
15876
|
const F = async (Y) => {
|
|
@@ -15884,13 +15892,13 @@ function Hc({
|
|
|
15884
15892
|
}, K = async (Y, ne) => {
|
|
15885
15893
|
if (ne.stopPropagation(), !!confirm("Delete this thread?")) {
|
|
15886
15894
|
if (k.current) {
|
|
15887
|
-
const
|
|
15888
|
-
|
|
15895
|
+
const B = k.current.querySelector("[data-radix-scroll-area-viewport]");
|
|
15896
|
+
B && (E.current = B.scrollTop);
|
|
15889
15897
|
}
|
|
15890
15898
|
try {
|
|
15891
15899
|
await w(Y), d == null || d(Y);
|
|
15892
|
-
} catch (
|
|
15893
|
-
console.error("Failed to delete thread:",
|
|
15900
|
+
} catch (B) {
|
|
15901
|
+
console.error("Failed to delete thread:", B);
|
|
15894
15902
|
}
|
|
15895
15903
|
}
|
|
15896
15904
|
}, P = (Y, ne) => {
|
|
@@ -16106,7 +16114,7 @@ const GC = xs(
|
|
|
16106
16114
|
Zp,
|
|
16107
16115
|
{
|
|
16108
16116
|
ref: n,
|
|
16109
|
-
className:
|
|
16117
|
+
className: Z(GC(), e),
|
|
16110
16118
|
...t
|
|
16111
16119
|
}
|
|
16112
16120
|
));
|
|
@@ -16235,7 +16243,7 @@ var sh = eh, QC = nh;
|
|
|
16235
16243
|
const $n = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
16236
16244
|
sh,
|
|
16237
16245
|
{
|
|
16238
|
-
className:
|
|
16246
|
+
className: Z(
|
|
16239
16247
|
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
16240
16248
|
e
|
|
16241
16249
|
),
|
|
@@ -16244,7 +16252,7 @@ const $n = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
16244
16252
|
children: /* @__PURE__ */ u.jsx(
|
|
16245
16253
|
QC,
|
|
16246
16254
|
{
|
|
16247
|
-
className:
|
|
16255
|
+
className: Z(
|
|
16248
16256
|
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
16249
16257
|
)
|
|
16250
16258
|
}
|
|
@@ -16473,17 +16481,17 @@ var ln = 10, [mh, Gn] = jr(ar), uT = "SelectContentImpl", dT = br("SelectContent
|
|
|
16473
16481
|
avoidCollisions: x,
|
|
16474
16482
|
//
|
|
16475
16483
|
...g
|
|
16476
|
-
} = e, w = qn(ar, n), [b, T] = v.useState(null), [C, S] = v.useState(null), k = qe(t, (
|
|
16484
|
+
} = e, w = qn(ar, n), [b, T] = v.useState(null), [C, S] = v.useState(null), k = qe(t, (B) => T(B)), [E, N] = v.useState(null), [I, j] = v.useState(
|
|
16477
16485
|
null
|
|
16478
16486
|
), L = Js(n), [z, A] = v.useState(!1), F = v.useRef(!1);
|
|
16479
16487
|
v.useEffect(() => {
|
|
16480
16488
|
if (b) return Ea(b);
|
|
16481
16489
|
}, [b]), ya();
|
|
16482
16490
|
const _ = v.useCallback(
|
|
16483
|
-
(
|
|
16484
|
-
const [M, ...U] = L().map((se) => se.ref.current), [
|
|
16485
|
-
for (const se of
|
|
16486
|
-
if (se === te || (se == null || se.scrollIntoView({ block: "nearest" }), se === M && C && (C.scrollTop = 0), se ===
|
|
16491
|
+
(B) => {
|
|
16492
|
+
const [M, ...U] = L().map((se) => se.ref.current), [ee] = U.slice(-1), te = document.activeElement;
|
|
16493
|
+
for (const se of B)
|
|
16494
|
+
if (se === te || (se == null || se.scrollIntoView({ block: "nearest" }), se === M && C && (C.scrollTop = 0), se === ee && C && (C.scrollTop = C.scrollHeight), se == null || se.focus(), document.activeElement !== te)) return;
|
|
16487
16495
|
},
|
|
16488
16496
|
[L, C]
|
|
16489
16497
|
), K = v.useCallback(
|
|
@@ -16496,39 +16504,39 @@ var ln = 10, [mh, Gn] = jr(ar), uT = "SelectContentImpl", dT = br("SelectContent
|
|
|
16496
16504
|
const { onOpenChange: P, triggerPointerDownPosRef: D } = w;
|
|
16497
16505
|
v.useEffect(() => {
|
|
16498
16506
|
if (b) {
|
|
16499
|
-
let
|
|
16500
|
-
const M = (
|
|
16507
|
+
let B = { x: 0, y: 0 };
|
|
16508
|
+
const M = (ee) => {
|
|
16501
16509
|
var te, se;
|
|
16502
|
-
|
|
16503
|
-
x: Math.abs(Math.round(
|
|
16504
|
-
y: Math.abs(Math.round(
|
|
16510
|
+
B = {
|
|
16511
|
+
x: Math.abs(Math.round(ee.pageX) - (((te = D.current) == null ? void 0 : te.x) ?? 0)),
|
|
16512
|
+
y: Math.abs(Math.round(ee.pageY) - (((se = D.current) == null ? void 0 : se.y) ?? 0))
|
|
16505
16513
|
};
|
|
16506
|
-
}, U = (
|
|
16507
|
-
|
|
16514
|
+
}, U = (ee) => {
|
|
16515
|
+
B.x <= 10 && B.y <= 10 ? ee.preventDefault() : b.contains(ee.target) || P(!1), document.removeEventListener("pointermove", M), D.current = null;
|
|
16508
16516
|
};
|
|
16509
16517
|
return D.current !== null && (document.addEventListener("pointermove", M), document.addEventListener("pointerup", U, { capture: !0, once: !0 })), () => {
|
|
16510
16518
|
document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", U, { capture: !0 });
|
|
16511
16519
|
};
|
|
16512
16520
|
}
|
|
16513
16521
|
}, [b, P, D]), v.useEffect(() => {
|
|
16514
|
-
const
|
|
16515
|
-
return window.addEventListener("blur",
|
|
16516
|
-
window.removeEventListener("blur",
|
|
16522
|
+
const B = () => P(!1);
|
|
16523
|
+
return window.addEventListener("blur", B), window.addEventListener("resize", B), () => {
|
|
16524
|
+
window.removeEventListener("blur", B), window.removeEventListener("resize", B);
|
|
16517
16525
|
};
|
|
16518
16526
|
}, [P]);
|
|
16519
|
-
const [q, G] = Ph((
|
|
16520
|
-
const M = L().filter((te) => !te.disabled), U = M.find((te) => te.ref.current === document.activeElement),
|
|
16521
|
-
|
|
16527
|
+
const [q, G] = Ph((B) => {
|
|
16528
|
+
const M = L().filter((te) => !te.disabled), U = M.find((te) => te.ref.current === document.activeElement), ee = Oh(M, B, U);
|
|
16529
|
+
ee && setTimeout(() => ee.ref.current.focus());
|
|
16522
16530
|
}), ge = v.useCallback(
|
|
16523
|
-
(
|
|
16524
|
-
const
|
|
16525
|
-
(w.value !== void 0 && w.value === M ||
|
|
16531
|
+
(B, M, U) => {
|
|
16532
|
+
const ee = !F.current && !U;
|
|
16533
|
+
(w.value !== void 0 && w.value === M || ee) && (N(B), ee && (F.current = !0));
|
|
16526
16534
|
},
|
|
16527
16535
|
[w.value]
|
|
16528
16536
|
), Se = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Te = v.useCallback(
|
|
16529
|
-
(
|
|
16530
|
-
const
|
|
16531
|
-
(w.value !== void 0 && w.value === M ||
|
|
16537
|
+
(B, M, U) => {
|
|
16538
|
+
const ee = !F.current && !U;
|
|
16539
|
+
(w.value !== void 0 && w.value === M || ee) && j(B);
|
|
16532
16540
|
},
|
|
16533
16541
|
[w.value]
|
|
16534
16542
|
), Y = r === "popper" ? Qi : xh, ne = Y === Qi ? {
|
|
@@ -16564,12 +16572,12 @@ var ln = 10, [mh, Gn] = jr(ar), uT = "SelectContentImpl", dT = br("SelectContent
|
|
|
16564
16572
|
{
|
|
16565
16573
|
asChild: !0,
|
|
16566
16574
|
trapped: w.open,
|
|
16567
|
-
onMountAutoFocus: (
|
|
16568
|
-
|
|
16575
|
+
onMountAutoFocus: (B) => {
|
|
16576
|
+
B.preventDefault();
|
|
16569
16577
|
},
|
|
16570
|
-
onUnmountAutoFocus: ue(o, (
|
|
16578
|
+
onUnmountAutoFocus: ue(o, (B) => {
|
|
16571
16579
|
var M;
|
|
16572
|
-
(M = w.trigger) == null || M.focus({ preventScroll: !0 }),
|
|
16580
|
+
(M = w.trigger) == null || M.focus({ preventScroll: !0 }), B.preventDefault();
|
|
16573
16581
|
}),
|
|
16574
16582
|
children: /* @__PURE__ */ u.jsx(
|
|
16575
16583
|
ks,
|
|
@@ -16578,7 +16586,7 @@ var ln = 10, [mh, Gn] = jr(ar), uT = "SelectContentImpl", dT = br("SelectContent
|
|
|
16578
16586
|
disableOutsidePointerEvents: !0,
|
|
16579
16587
|
onEscapeKeyDown: s,
|
|
16580
16588
|
onPointerDownOutside: i,
|
|
16581
|
-
onFocusOutside: (
|
|
16589
|
+
onFocusOutside: (B) => B.preventDefault(),
|
|
16582
16590
|
onDismiss: () => w.onOpenChange(!1),
|
|
16583
16591
|
children: /* @__PURE__ */ u.jsx(
|
|
16584
16592
|
Y,
|
|
@@ -16587,7 +16595,7 @@ var ln = 10, [mh, Gn] = jr(ar), uT = "SelectContentImpl", dT = br("SelectContent
|
|
|
16587
16595
|
id: w.contentId,
|
|
16588
16596
|
"data-state": w.open ? "open" : "closed",
|
|
16589
16597
|
dir: w.dir,
|
|
16590
|
-
onContextMenu: (
|
|
16598
|
+
onContextMenu: (B) => B.preventDefault(),
|
|
16591
16599
|
...g,
|
|
16592
16600
|
...ne,
|
|
16593
16601
|
onPlaced: () => A(!0),
|
|
@@ -16600,15 +16608,15 @@ var ln = 10, [mh, Gn] = jr(ar), uT = "SelectContentImpl", dT = br("SelectContent
|
|
|
16600
16608
|
outline: "none",
|
|
16601
16609
|
...g.style
|
|
16602
16610
|
},
|
|
16603
|
-
onKeyDown: ue(g.onKeyDown, (
|
|
16604
|
-
const M =
|
|
16605
|
-
if (
|
|
16606
|
-
let
|
|
16607
|
-
if (["ArrowUp", "End"].includes(
|
|
16608
|
-
const te =
|
|
16609
|
-
|
|
16611
|
+
onKeyDown: ue(g.onKeyDown, (B) => {
|
|
16612
|
+
const M = B.ctrlKey || B.altKey || B.metaKey;
|
|
16613
|
+
if (B.key === "Tab" && B.preventDefault(), !M && B.key.length === 1 && G(B.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(B.key)) {
|
|
16614
|
+
let ee = L().filter((te) => !te.disabled).map((te) => te.ref.current);
|
|
16615
|
+
if (["ArrowUp", "End"].includes(B.key) && (ee = ee.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(B.key)) {
|
|
16616
|
+
const te = B.target, se = ee.indexOf(te);
|
|
16617
|
+
ee = ee.slice(se + 1);
|
|
16610
16618
|
}
|
|
16611
|
-
setTimeout(() => _(
|
|
16619
|
+
setTimeout(() => _(ee)), B.preventDefault();
|
|
16612
16620
|
}
|
|
16613
16621
|
})
|
|
16614
16622
|
}
|
|
@@ -16644,7 +16652,7 @@ var fT = "SelectItemAlignedPosition", xh = v.forwardRef((e, t) => {
|
|
|
16644
16652
|
]);
|
|
16645
16653
|
a.style.minWidth = He + "px", a.style.right = X + "px";
|
|
16646
16654
|
}
|
|
16647
|
-
const j = p(), L = window.innerHeight - ln * 2, z = y.scrollHeight, A = window.getComputedStyle(c), F = parseInt(A.borderTopWidth, 10), _ = parseInt(A.paddingTop, 10), K = parseInt(A.borderBottomWidth, 10), P = parseInt(A.paddingBottom, 10), D = F + _ + z + P + K, q = Math.min(x.offsetHeight * 5, D), G = window.getComputedStyle(y), ge = parseInt(G.paddingTop, 10), Se = parseInt(G.paddingBottom, 10), Te = k.top + k.height / 2 - ln, Y = L - Te, ne = x.offsetHeight / 2,
|
|
16655
|
+
const j = p(), L = window.innerHeight - ln * 2, z = y.scrollHeight, A = window.getComputedStyle(c), F = parseInt(A.borderTopWidth, 10), _ = parseInt(A.paddingTop, 10), K = parseInt(A.borderBottomWidth, 10), P = parseInt(A.paddingBottom, 10), D = F + _ + z + P + K, q = Math.min(x.offsetHeight * 5, D), G = window.getComputedStyle(y), ge = parseInt(G.paddingTop, 10), Se = parseInt(G.paddingBottom, 10), Te = k.top + k.height / 2 - ln, Y = L - Te, ne = x.offsetHeight / 2, B = x.offsetTop + ne, M = F + _ + B, U = D - M;
|
|
16648
16656
|
if (M <= Te) {
|
|
16649
16657
|
const te = j.length > 0 && x === j[j.length - 1].ref.current;
|
|
16650
16658
|
a.style.bottom = "0px";
|
|
@@ -17084,7 +17092,7 @@ const Uc = CT, Wc = TT, oa = v.forwardRef(({ className: e, children: t, ...n },
|
|
|
17084
17092
|
Mh,
|
|
17085
17093
|
{
|
|
17086
17094
|
ref: r,
|
|
17087
|
-
className:
|
|
17095
|
+
className: Z(
|
|
17088
17096
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
17089
17097
|
e
|
|
17090
17098
|
),
|
|
@@ -17100,7 +17108,7 @@ const Hh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17100
17108
|
Fh,
|
|
17101
17109
|
{
|
|
17102
17110
|
ref: n,
|
|
17103
|
-
className:
|
|
17111
|
+
className: Z(
|
|
17104
17112
|
"flex cursor-default items-center justify-center py-1",
|
|
17105
17113
|
e
|
|
17106
17114
|
),
|
|
@@ -17113,7 +17121,7 @@ const Uh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17113
17121
|
zh,
|
|
17114
17122
|
{
|
|
17115
17123
|
ref: n,
|
|
17116
|
-
className:
|
|
17124
|
+
className: Z(
|
|
17117
17125
|
"flex cursor-default items-center justify-center py-1",
|
|
17118
17126
|
e
|
|
17119
17127
|
),
|
|
@@ -17126,7 +17134,7 @@ const sa = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
17126
17134
|
Dh,
|
|
17127
17135
|
{
|
|
17128
17136
|
ref: o,
|
|
17129
|
-
className:
|
|
17137
|
+
className: Z(
|
|
17130
17138
|
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
17131
17139
|
n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
17132
17140
|
e
|
|
@@ -17138,7 +17146,7 @@ const sa = v.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
17138
17146
|
/* @__PURE__ */ u.jsx(
|
|
17139
17147
|
ET,
|
|
17140
17148
|
{
|
|
17141
|
-
className:
|
|
17149
|
+
className: Z(
|
|
17142
17150
|
"p-1",
|
|
17143
17151
|
n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
17144
17152
|
),
|
|
@@ -17154,7 +17162,7 @@ const AT = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17154
17162
|
Lh,
|
|
17155
17163
|
{
|
|
17156
17164
|
ref: n,
|
|
17157
|
-
className:
|
|
17165
|
+
className: Z("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
17158
17166
|
...t
|
|
17159
17167
|
}
|
|
17160
17168
|
));
|
|
@@ -17163,7 +17171,7 @@ const Xn = v.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
17163
17171
|
$h,
|
|
17164
17172
|
{
|
|
17165
17173
|
ref: r,
|
|
17166
|
-
className:
|
|
17174
|
+
className: Z(
|
|
17167
17175
|
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
17168
17176
|
e
|
|
17169
17177
|
),
|
|
@@ -17179,7 +17187,7 @@ const _T = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17179
17187
|
Bh,
|
|
17180
17188
|
{
|
|
17181
17189
|
ref: n,
|
|
17182
|
-
className:
|
|
17190
|
+
className: Z("-mx-1 my-1 h-px bg-muted", e),
|
|
17183
17191
|
...t
|
|
17184
17192
|
}
|
|
17185
17193
|
));
|
|
@@ -17208,7 +17216,7 @@ const Kh = v.forwardRef(
|
|
|
17208
17216
|
ref: o,
|
|
17209
17217
|
decorative: n,
|
|
17210
17218
|
orientation: t,
|
|
17211
|
-
className:
|
|
17219
|
+
className: Z(
|
|
17212
17220
|
"shrink-0 bg-border",
|
|
17213
17221
|
t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
17214
17222
|
e
|
|
@@ -17221,7 +17229,7 @@ Kh.displayName = Vh.displayName;
|
|
|
17221
17229
|
const MT = mp, DT = JS, LT = gp, qh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
17222
17230
|
Ws,
|
|
17223
17231
|
{
|
|
17224
|
-
className:
|
|
17232
|
+
className: Z(
|
|
17225
17233
|
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
17226
17234
|
e
|
|
17227
17235
|
),
|
|
@@ -17251,7 +17259,7 @@ const $T = xs(
|
|
|
17251
17259
|
Vs,
|
|
17252
17260
|
{
|
|
17253
17261
|
ref: o,
|
|
17254
|
-
className:
|
|
17262
|
+
className: Z($T({ side: e }), t),
|
|
17255
17263
|
...r,
|
|
17256
17264
|
children: [
|
|
17257
17265
|
n,
|
|
@@ -17270,7 +17278,7 @@ const Yh = ({
|
|
|
17270
17278
|
}) => /* @__PURE__ */ u.jsx(
|
|
17271
17279
|
"div",
|
|
17272
17280
|
{
|
|
17273
|
-
className:
|
|
17281
|
+
className: Z(
|
|
17274
17282
|
"flex flex-col space-y-2 text-center sm:text-left",
|
|
17275
17283
|
e
|
|
17276
17284
|
),
|
|
@@ -17282,7 +17290,7 @@ const Xh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17282
17290
|
er,
|
|
17283
17291
|
{
|
|
17284
17292
|
ref: n,
|
|
17285
|
-
className:
|
|
17293
|
+
className: Z("text-lg font-semibold text-foreground", e),
|
|
17286
17294
|
...t
|
|
17287
17295
|
}
|
|
17288
17296
|
));
|
|
@@ -17291,7 +17299,7 @@ const Jh = v.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
|
|
|
17291
17299
|
Ks,
|
|
17292
17300
|
{
|
|
17293
17301
|
ref: n,
|
|
17294
|
-
className:
|
|
17302
|
+
className: Z("text-sm text-muted-foreground", e),
|
|
17295
17303
|
...t
|
|
17296
17304
|
}
|
|
17297
17305
|
));
|
|
@@ -17625,7 +17633,7 @@ function Sk({
|
|
|
17625
17633
|
"--chat-sidebar-width": c === "phone" ? "100%" : c === "tablet" ? "280px" : c === "half-screen" ? "240px" : "320px",
|
|
17626
17634
|
"--chat-message-max-width": c === "phone" ? "95%" : c === "tablet" ? "90%" : c === "half-screen" ? "85%" : "80%",
|
|
17627
17635
|
"--chat-input-height": c === "phone" ? "120px" : "100px"
|
|
17628
|
-
}), l =
|
|
17636
|
+
}), l = H.useCallback((c) => {
|
|
17629
17637
|
var d;
|
|
17630
17638
|
(d = s.onThreadChange) == null || d.call(s, c);
|
|
17631
17639
|
}, [s]);
|