@pstdio/ui 0.24.1 → 0.25.0
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/{MermaidComponent-BTgLnpLA.js → MermaidComponent-BVdDqDRU.js} +2 -2
- package/dist/{MermaidComponent-BTgLnpLA.js.map → MermaidComponent-BVdDqDRU.js.map} +1 -1
- package/dist/chat-ui.js +1326 -1414
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/activity/activity-comment.d.ts +10 -2
- package/dist/components/activity/index.d.ts +3 -1
- package/dist/components/activity/resource-activity-feed.d.ts +58 -0
- package/dist/components/chat-ui/components/chat-input.d.ts +1 -1
- package/dist/components/chat-ui/components/chat-panel.d.ts +1 -1
- package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +1 -1
- package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
- package/dist/components/tab-strip/window-tabs.d.ts +1 -0
- package/dist/data-table.js +5 -5
- package/dist/diff.js +2 -2
- package/dist/{edit-mode-data-table-BrydKuMM.js → edit-mode-data-table-B8UpWb7i.js} +4 -4
- package/dist/{edit-mode-data-table-BrydKuMM.js.map → edit-mode-data-table-B8UpWb7i.js.map} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2047 -1735
- package/dist/index.js.map +1 -1
- package/dist/{kanban-renderer-toolbar-ebqlG13w.js → kanban-renderer-toolbar-DzY6THJY.js} +3 -3
- package/dist/{kanban-renderer-toolbar-ebqlG13w.js.map → kanban-renderer-toolbar-DzY6THJY.js.map} +1 -1
- package/dist/kanban-renderer.js +5 -5
- package/dist/{lazy-markdown-editor-Obb0M8xc.js → lazy-markdown-editor-ClZPZuaU.js} +2 -2
- package/dist/{lazy-markdown-editor-Obb0M8xc.js.map → lazy-markdown-editor-ClZPZuaU.js.map} +1 -1
- package/dist/{list-row-CRi3Luog.js → list-row-BDoV_iMV.js} +3 -3
- package/dist/list-row-BDoV_iMV.js.map +1 -0
- package/dist/{markdown-editor-Bj_QX4oN.js → markdown-editor-CAVqJ9yR.js} +2 -2
- package/dist/{markdown-editor-Bj_QX4oN.js.map → markdown-editor-CAVqJ9yR.js.map} +1 -1
- package/dist/{markdown-kuU19Oh3.js → markdown-gNucAjnF.js} +9 -9
- package/dist/{markdown-kuU19Oh3.js.map → markdown-gNucAjnF.js.map} +1 -1
- package/dist/{param-editor-DhoxgwGd.js → param-editor-CTx3mDxQ.js} +2 -2
- package/dist/{param-editor-DhoxgwGd.js.map → param-editor-CTx3mDxQ.js.map} +1 -1
- package/dist/{param-editor-field-DurcyLuw.js → param-editor-field-DteDEyeU.js} +3 -3
- package/dist/{param-editor-field-DurcyLuw.js.map → param-editor-field-DteDEyeU.js.map} +1 -1
- package/dist/prompt-input-DNpRL5tI.js +564 -0
- package/dist/prompt-input-DNpRL5tI.js.map +1 -0
- package/dist/rich-message-CuPiKxKX.js +78 -0
- package/dist/rich-message-CuPiKxKX.js.map +1 -0
- package/dist/rich-text.js +24 -23
- package/dist/rich-text.js.map +1 -1
- package/dist/theme/primitives/colors.d.ts +0 -23
- package/dist/theme/recipes/activity-comment.d.ts +36 -0
- package/dist/theme/recipes/alert.d.ts +1 -1
- package/dist/theme/recipes/dialog.d.ts +1 -1
- package/dist/theme/recipes/drawer.d.ts +1 -1
- package/dist/theme/recipes/menu.d.ts +1 -1
- package/dist/theme/recipes/popover.d.ts +1 -1
- package/dist/theme/recipes/progress-circle.d.ts +3 -3
- package/dist/theme/recipes/switch.d.ts +1 -1
- package/dist/theme/recipes/timeline.d.ts +1 -1
- package/dist/theme/recipes/tooltip.d.ts +1 -1
- package/dist/theme/recipes/window-title-bar.d.ts +4 -1
- package/dist/{theme-Ca-KyNoi.js → theme-Dc7hVvMC.js} +120 -801
- package/dist/theme-Dc7hVvMC.js.map +1 -0
- package/dist/theme.js +1 -1
- package/dist/{tree-list-DXwHWodb.js → tree-list-CZvcg3_6.js} +2 -2
- package/dist/{tree-list-DXwHWodb.js.map → tree-list-CZvcg3_6.js.map} +1 -1
- package/package.json +2 -2
- package/dist/list-row-CRi3Luog.js.map +0 -1
- package/dist/rich-message-dNYvLDd4.js +0 -628
- package/dist/rich-message-dNYvLDd4.js.map +0 -1
- package/dist/theme/recipes/landing-story.d.ts +0 -10
- package/dist/theme/recipes/landing-tool-demo.d.ts +0 -1
- package/dist/theme/recipes/landing.d.ts +0 -23
- package/dist/theme-Ca-KyNoi.js.map +0 -1
package/dist/chat-ui.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
1
|
+
import { jsx as c, jsxs as k, Fragment as At } from "react/jsx-runtime";
|
|
2
2
|
import { c as A } from "react/compiler-runtime";
|
|
3
|
-
import { AbsoluteCenter as
|
|
4
|
-
import { ArrowDownIcon as
|
|
5
|
-
import { useStickToBottomContext as
|
|
6
|
-
import { S as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { R as
|
|
9
|
-
import { a as
|
|
10
|
-
import { R as
|
|
11
|
-
import { E as
|
|
12
|
-
import { useVirtualizer as
|
|
13
|
-
import {
|
|
14
|
-
|
|
3
|
+
import { AbsoluteCenter as zn, IconButton as Pe, chakra as Gt, createSlotRecipeContext as Qn, defineSlotRecipe as qn, Text as U, Code as Bt, Button as Oe, HStack as Z, Box as P, Flex as be, Stack as j, Textarea as Wn, Tooltip as Ke, Portal as Yt, Kbd as Hn, Spacer as Vn, Link as Jt, Span as $e, Avatar as Ee, Timeline as Nn, Image as Zt, Card as Y, Spinner as kt, Badge as Un, Icon as dt, Skeleton as jn } from "@chakra-ui/react";
|
|
4
|
+
import { ArrowDownIcon as Kn, ShieldX as Xn, ShieldCheck as Gn, Check as en, Pause as Yn, ArrowUp as Jn, Copy as Zn, Move as es, FileDown as ts, FileUp as ns, FileDiff as ss, Trash2 as tn, FilePen as os, FileText as rs, ListTree as is, Terminal as nn, ListTodo as ls, CircleQuestionMark as as, File as cs, Globe as us, Search as ds, AlertTriangle as sn, DotIcon as fs, ChevronUpIcon as ps, GripVertical as ms, Pencil as hs, MessageCircleIcon as gs } from "lucide-react";
|
|
5
|
+
import { useStickToBottomContext as Ge, StickToBottom as bs } from "use-stick-to-bottom";
|
|
6
|
+
import { S as Ye, T as Ct } from "./browser-storage-DPtOQJx0.js";
|
|
7
|
+
import { Fragment as ys, useRef as ie, useEffect as J, useState as V } from "react";
|
|
8
|
+
import { R as It, C as on } from "./lazy-markdown-editor-ClZPZuaU.js";
|
|
9
|
+
import { a as ft, P as xs, g as Ss } from "./prompt-input-DNpRL5tI.js";
|
|
10
|
+
import { R as ws, a as Ts, A as Ft } from "./radio-cLMEBBZk.js";
|
|
11
|
+
import { E as As } from "./empty-state-Bo4HVrgr.js";
|
|
12
|
+
import { useVirtualizer as ks } from "@tanstack/react-virtual";
|
|
13
|
+
import { RichMessage as rn } from "./rich-message-CuPiKxKX.js";
|
|
14
|
+
import { a as Cs, D as Is } from "./diff-bubble-DvUPRnfB.js";
|
|
15
|
+
const _s = {
|
|
15
16
|
"aria-roledescription": "conversation",
|
|
16
17
|
initial: "instant",
|
|
17
18
|
resize: "instant",
|
|
18
19
|
role: "log"
|
|
19
|
-
},
|
|
20
|
+
}, Rs = Gt(bs, {
|
|
20
21
|
base: {
|
|
21
22
|
position: "relative",
|
|
22
23
|
flex: 1,
|
|
@@ -25,18 +26,18 @@ const ro = {
|
|
|
25
26
|
}
|
|
26
27
|
}, {
|
|
27
28
|
forwardProps: ["initial", "resize"],
|
|
28
|
-
defaultProps:
|
|
29
|
-
}),
|
|
29
|
+
defaultProps: _s
|
|
30
|
+
}), vs = (t) => {
|
|
30
31
|
const e = A(10);
|
|
31
|
-
let n,
|
|
32
|
+
let n, s;
|
|
32
33
|
e[0] !== t ? ({
|
|
33
34
|
children: n,
|
|
34
|
-
...
|
|
35
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
35
|
+
...s
|
|
36
|
+
} = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
|
|
36
37
|
const {
|
|
37
|
-
contentRef:
|
|
38
|
+
contentRef: o,
|
|
38
39
|
scrollRef: r
|
|
39
|
-
} =
|
|
40
|
+
} = Ge(), i = r, l = o;
|
|
40
41
|
let a, u;
|
|
41
42
|
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
42
43
|
zIndex: 2
|
|
@@ -46,23 +47,23 @@ const ro = {
|
|
|
46
47
|
role: "list"
|
|
47
48
|
}, e[3] = a, e[4] = u) : (a = e[3], u = e[4]);
|
|
48
49
|
let d;
|
|
49
|
-
return e[5] !== n || e[6] !==
|
|
50
|
-
},
|
|
50
|
+
return e[5] !== n || e[6] !== s || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ c(Ye, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: a, contentProps: u, children: n }), e[5] = n, e[6] = s, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
|
|
51
|
+
}, Ms = {
|
|
51
52
|
axis: "horizontal",
|
|
52
53
|
bottom: "md",
|
|
53
54
|
zIndex: 2
|
|
54
|
-
},
|
|
55
|
+
}, Ps = (t) => {
|
|
55
56
|
const e = A(4), {
|
|
56
57
|
isAtBottom: n,
|
|
57
|
-
scrollToBottom:
|
|
58
|
-
} =
|
|
59
|
-
let
|
|
60
|
-
return e[0] !== n || e[1] !== t || e[2] !==
|
|
61
|
-
},
|
|
62
|
-
Root:
|
|
63
|
-
Viewport:
|
|
64
|
-
ScrollToBottom:
|
|
65
|
-
},
|
|
58
|
+
scrollToBottom: s
|
|
59
|
+
} = Ge();
|
|
60
|
+
let o;
|
|
61
|
+
return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ c(zn, { ...Ms, children: /* @__PURE__ */ c(Pe, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ c(Kn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
|
|
62
|
+
}, pt = {
|
|
63
|
+
Root: Rs,
|
|
64
|
+
Viewport: vs,
|
|
65
|
+
ScrollToBottom: Ps
|
|
66
|
+
}, Es = qn({
|
|
66
67
|
className: "ai-message",
|
|
67
68
|
slots: ["root", "content"],
|
|
68
69
|
base: {
|
|
@@ -169,102 +170,102 @@ const ro = {
|
|
|
169
170
|
shape: "rounded"
|
|
170
171
|
}
|
|
171
172
|
}), {
|
|
172
|
-
withProvider:
|
|
173
|
-
withContext:
|
|
174
|
-
} =
|
|
175
|
-
recipe:
|
|
176
|
-
}),
|
|
177
|
-
Root:
|
|
178
|
-
Content:
|
|
179
|
-
},
|
|
173
|
+
withProvider: Ds,
|
|
174
|
+
withContext: Bs
|
|
175
|
+
} = Qn({
|
|
176
|
+
recipe: Es
|
|
177
|
+
}), Fs = Ds("div", "root"), Ls = Bs("div", "content"), ge = {
|
|
178
|
+
Root: Fs,
|
|
179
|
+
Content: Ls
|
|
180
|
+
}, $s = (t) => {
|
|
180
181
|
if (t == null) return null;
|
|
181
182
|
const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
|
|
182
183
|
return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
|
|
183
|
-
},
|
|
184
|
+
}, yl = (t) => {
|
|
184
185
|
const e = A(19), {
|
|
185
186
|
toolName: n,
|
|
186
|
-
toolInput:
|
|
187
|
-
onApprove:
|
|
187
|
+
toolInput: s,
|
|
188
|
+
onApprove: o,
|
|
188
189
|
onDeny: r
|
|
189
190
|
} = t;
|
|
190
191
|
let i;
|
|
191
|
-
e[0] !==
|
|
192
|
+
e[0] !== s ? (i = $s(s), e[0] = s, e[1] = i) : i = e[1];
|
|
192
193
|
const l = i;
|
|
193
194
|
let a;
|
|
194
|
-
e[2] !== n ? (a = /* @__PURE__ */
|
|
195
|
+
e[2] !== n ? (a = /* @__PURE__ */ k(U, { textStyle: "label/S/medium", color: "fg", children: [
|
|
195
196
|
"Allow ",
|
|
196
|
-
/* @__PURE__ */ c(
|
|
197
|
+
/* @__PURE__ */ c(Bt, { size: "sm", children: n }),
|
|
197
198
|
"?"
|
|
198
199
|
] }), e[2] = n, e[3] = a) : a = e[3];
|
|
199
200
|
let u;
|
|
200
|
-
e[4] !== l ? (u = l ? /* @__PURE__ */ c(
|
|
201
|
+
e[4] !== l ? (u = l ? /* @__PURE__ */ c(Ye, { maxH: "6rem", children: /* @__PURE__ */ c(Bt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
|
|
201
202
|
let d;
|
|
202
|
-
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(
|
|
203
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(Xn, { size: 14 }), e[6] = d) : d = e[6];
|
|
203
204
|
let f;
|
|
204
|
-
e[7] !== r ? (f = /* @__PURE__ */
|
|
205
|
+
e[7] !== r ? (f = /* @__PURE__ */ k(Oe, { size: "xs", variant: "outline", onClick: r, children: [
|
|
205
206
|
d,
|
|
206
207
|
"Deny"
|
|
207
208
|
] }), e[7] = r, e[8] = f) : f = e[8];
|
|
208
|
-
let m;
|
|
209
|
-
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ c(vs, { size: 14 }), e[9] = m) : m = e[9];
|
|
210
209
|
let p;
|
|
211
|
-
e[
|
|
212
|
-
|
|
210
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ c(Gn, { size: 14 }), e[9] = p) : p = e[9];
|
|
211
|
+
let m;
|
|
212
|
+
e[10] !== o ? (m = /* @__PURE__ */ k(Oe, { size: "xs", colorPalette: "green", onClick: o, children: [
|
|
213
|
+
p,
|
|
213
214
|
"Allow"
|
|
214
|
-
] }), e[10] =
|
|
215
|
+
] }), e[10] = o, e[11] = m) : m = e[11];
|
|
215
216
|
let h;
|
|
216
|
-
e[12] !== f || e[13] !==
|
|
217
|
+
e[12] !== f || e[13] !== m ? (h = /* @__PURE__ */ k(Z, { gap: "xs", justifyContent: "flex-end", children: [
|
|
217
218
|
f,
|
|
218
|
-
|
|
219
|
-
] }), e[12] = f, e[13] =
|
|
219
|
+
m
|
|
220
|
+
] }), e[12] = f, e[13] = m, e[14] = h) : h = e[14];
|
|
220
221
|
let g;
|
|
221
|
-
return e[15] !== a || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ c(
|
|
222
|
+
return e[15] !== a || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ c(P, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(be, { direction: "column", gap: "xs", children: [
|
|
222
223
|
a,
|
|
223
224
|
u,
|
|
224
225
|
h
|
|
225
226
|
] }) }), e[15] = a, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
|
|
226
|
-
},
|
|
227
|
+
}, Os = "md", zs = "neutral", xl = (t) => {
|
|
227
228
|
const e = A(17), {
|
|
228
229
|
attachments: n,
|
|
229
|
-
onSelect:
|
|
230
|
-
onRemove:
|
|
230
|
+
onSelect: s,
|
|
231
|
+
onRemove: o,
|
|
231
232
|
renderBadge: r,
|
|
232
233
|
size: i,
|
|
233
234
|
tone: l
|
|
234
235
|
} = t;
|
|
235
236
|
let a;
|
|
236
237
|
e[0] !== n ? (a = n === void 0 ? [] : n, e[0] = n, e[1] = a) : a = e[1];
|
|
237
|
-
const u = a, d = i === void 0 ?
|
|
238
|
+
const u = a, d = i === void 0 ? Os : i, f = l === void 0 ? zs : l;
|
|
238
239
|
if (u.length === 0)
|
|
239
240
|
return null;
|
|
240
|
-
let
|
|
241
|
-
if (e[2] !== u || e[3] !==
|
|
241
|
+
let p;
|
|
242
|
+
if (e[2] !== u || e[3] !== o || e[4] !== s || e[5] !== r || e[6] !== d || e[7] !== f) {
|
|
242
243
|
let h;
|
|
243
|
-
e[9] !==
|
|
244
|
-
const b =
|
|
244
|
+
e[9] !== o || e[10] !== s || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
|
|
245
|
+
const b = s ? () => s(g) : void 0, x = o ? () => o(g) : void 0;
|
|
245
246
|
if (r) {
|
|
246
|
-
const
|
|
247
|
+
const y = r({
|
|
247
248
|
attachmentId: g,
|
|
248
249
|
onSelect: b,
|
|
249
|
-
onRemove:
|
|
250
|
+
onRemove: x,
|
|
250
251
|
size: d,
|
|
251
252
|
tone: f
|
|
252
253
|
});
|
|
253
|
-
return /* @__PURE__ */ c(
|
|
254
|
+
return /* @__PURE__ */ c(ys, { children: y }, g);
|
|
254
255
|
}
|
|
255
|
-
return /* @__PURE__ */ c(
|
|
256
|
-
}, e[9] =
|
|
256
|
+
return /* @__PURE__ */ c(It, { fileName: g, onSelect: b, onRemove: x, size: d, tone: f }, g);
|
|
257
|
+
}, e[9] = o, e[10] = s, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], p = u.map(h), e[2] = u, e[3] = o, e[4] = s, e[5] = r, e[6] = d, e[7] = f, e[8] = p;
|
|
257
258
|
} else
|
|
258
|
-
|
|
259
|
-
let
|
|
260
|
-
return e[15] !==
|
|
261
|
-
},
|
|
259
|
+
p = e[8];
|
|
260
|
+
let m;
|
|
261
|
+
return e[15] !== p ? (m = /* @__PURE__ */ c(j, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: p }), e[15] = p, e[16] = m) : m = e[16], m;
|
|
262
|
+
}, Qs = (t) => {
|
|
262
263
|
const {
|
|
263
264
|
previousUserMessageCount: e,
|
|
264
265
|
userMessageCount: n
|
|
265
266
|
} = t;
|
|
266
267
|
return e === 0 ? !1 : n > e;
|
|
267
|
-
},
|
|
268
|
+
}, qs = (t) => {
|
|
268
269
|
const e = t.conversationKey ?? null;
|
|
269
270
|
return t.state.conversationKey !== e ? {
|
|
270
271
|
shouldScroll: !1,
|
|
@@ -273,7 +274,7 @@ const ro = {
|
|
|
273
274
|
userMessageCount: t.userMessageCount
|
|
274
275
|
}
|
|
275
276
|
} : {
|
|
276
|
-
shouldScroll:
|
|
277
|
+
shouldScroll: Qs({
|
|
277
278
|
previousUserMessageCount: t.state.userMessageCount,
|
|
278
279
|
userMessageCount: t.userMessageCount
|
|
279
280
|
}),
|
|
@@ -282,58 +283,56 @@ const ro = {
|
|
|
282
283
|
userMessageCount: Math.max(t.state.userMessageCount, t.userMessageCount)
|
|
283
284
|
}
|
|
284
285
|
};
|
|
285
|
-
},
|
|
286
|
-
const e =
|
|
286
|
+
}, Ws = (t) => {
|
|
287
|
+
const e = qs(t);
|
|
287
288
|
return e.shouldScroll && t.scrollToBottom("instant"), e;
|
|
288
289
|
};
|
|
289
|
-
function
|
|
290
|
+
function Hs(t) {
|
|
290
291
|
const e = A(8), {
|
|
291
292
|
conversationKey: n,
|
|
292
|
-
userMessageCount:
|
|
293
|
+
userMessageCount: s
|
|
293
294
|
} = t, {
|
|
294
|
-
scrollToBottom:
|
|
295
|
-
} =
|
|
295
|
+
scrollToBottom: o
|
|
296
|
+
} = Ge(), r = n ?? null;
|
|
296
297
|
let i;
|
|
297
|
-
e[0] !== r || e[1] !==
|
|
298
|
+
e[0] !== r || e[1] !== s ? (i = {
|
|
298
299
|
conversationKey: r,
|
|
299
|
-
userMessageCount:
|
|
300
|
-
}, e[0] = r, e[1] =
|
|
301
|
-
const l =
|
|
300
|
+
userMessageCount: s
|
|
301
|
+
}, e[0] = r, e[1] = s, e[2] = i) : i = e[2];
|
|
302
|
+
const l = ie(i);
|
|
302
303
|
let a, u;
|
|
303
|
-
return e[3] !== n || e[4] !==
|
|
304
|
-
const d =
|
|
304
|
+
return e[3] !== n || e[4] !== o || e[5] !== s ? (a = () => {
|
|
305
|
+
const d = Ws({
|
|
305
306
|
state: l.current,
|
|
306
307
|
conversationKey: n,
|
|
307
|
-
userMessageCount:
|
|
308
|
-
scrollToBottom:
|
|
308
|
+
userMessageCount: s,
|
|
309
|
+
scrollToBottom: o
|
|
309
310
|
});
|
|
310
311
|
l.current = d.state;
|
|
311
|
-
}, u = [n,
|
|
312
|
+
}, u = [n, s, o], e[3] = n, e[4] = o, e[5] = s, e[6] = a, e[7] = u) : (a = e[6], u = e[7]), J(a, u), null;
|
|
312
313
|
}
|
|
313
|
-
const
|
|
314
|
+
const ln = (t) => t.trim().length > 0, Vs = (t) => {
|
|
314
315
|
const {
|
|
315
316
|
canSubmit: e,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
streaming: s,
|
|
319
|
-
text: r
|
|
317
|
+
isDisabled: n,
|
|
318
|
+
text: s
|
|
320
319
|
} = t;
|
|
321
|
-
return
|
|
322
|
-
},
|
|
320
|
+
return n || !e || !ln(s) ? "none" : "submit";
|
|
321
|
+
}, Ns = (t) => {
|
|
323
322
|
const {
|
|
324
323
|
canInterrupt: e,
|
|
325
324
|
canSubmit: n,
|
|
326
|
-
hasQuestionPrompt:
|
|
327
|
-
isDisabled:
|
|
325
|
+
hasQuestionPrompt: s,
|
|
326
|
+
isDisabled: o,
|
|
328
327
|
streaming: r,
|
|
329
328
|
text: i
|
|
330
329
|
} = t;
|
|
331
|
-
return
|
|
332
|
-
},
|
|
330
|
+
return o ? "none" : n && ln(i) ? "submit" : r && !s && e ? "interrupt" : "none";
|
|
331
|
+
}, an = 200, Us = (t, e = an) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, js = (t) => {
|
|
333
332
|
const {
|
|
334
333
|
onAttachFiles: e,
|
|
335
334
|
onAttachText: n,
|
|
336
|
-
textAttachmentPasteLineThreshold:
|
|
335
|
+
textAttachmentPasteLineThreshold: s
|
|
337
336
|
} = t;
|
|
338
337
|
return {
|
|
339
338
|
onDragOver: (l) => {
|
|
@@ -350,29 +349,29 @@ const On = (t) => t.trim().length > 0, Ao = (t) => {
|
|
|
350
349
|
return;
|
|
351
350
|
}
|
|
352
351
|
const u = l.clipboardData.getData("text/plain");
|
|
353
|
-
n &&
|
|
352
|
+
n && Us(u, s) && (l.preventDefault(), n(u));
|
|
354
353
|
}
|
|
355
354
|
};
|
|
356
|
-
},
|
|
355
|
+
}, Ks = (t) => {
|
|
357
356
|
t.preventDefault();
|
|
358
|
-
},
|
|
357
|
+
}, cn = (t) => {
|
|
359
358
|
const e = A(7), {
|
|
360
359
|
option: n
|
|
361
360
|
} = t;
|
|
362
|
-
let o;
|
|
363
|
-
e[0] !== n.label ? (o = /* @__PURE__ */ c(j, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
|
|
364
361
|
let s;
|
|
365
|
-
e[
|
|
362
|
+
e[0] !== n.label ? (s = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
|
|
363
|
+
let o;
|
|
364
|
+
e[2] !== n.description ? (o = n.description ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = o) : o = e[3];
|
|
366
365
|
let r;
|
|
367
|
-
return e[4] !==
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
] }), e[4] =
|
|
371
|
-
},
|
|
366
|
+
return e[4] !== s || e[5] !== o ? (r = /* @__PURE__ */ k(j, { gap: "0", minWidth: "0", children: [
|
|
367
|
+
s,
|
|
368
|
+
o
|
|
369
|
+
] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
|
|
370
|
+
}, Xs = (t) => {
|
|
372
371
|
const e = A(12), {
|
|
373
372
|
option: n,
|
|
374
|
-
name:
|
|
375
|
-
checked:
|
|
373
|
+
name: s,
|
|
374
|
+
checked: o,
|
|
376
375
|
editable: r,
|
|
377
376
|
onToggle: i
|
|
378
377
|
} = t, l = !r, a = r ? void 0 : "true";
|
|
@@ -382,521 +381,434 @@ const On = (t) => t.trim().length > 0, Ao = (t) => {
|
|
|
382
381
|
}, e[0] = r, e[1] = u) : u = e[1];
|
|
383
382
|
const d = r ? i : void 0;
|
|
384
383
|
let f;
|
|
385
|
-
e[2] !== n ? (f = /* @__PURE__ */ c(
|
|
386
|
-
let
|
|
387
|
-
return e[4] !==
|
|
388
|
-
},
|
|
384
|
+
e[2] !== n ? (f = /* @__PURE__ */ c(cn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
|
|
385
|
+
let p;
|
|
386
|
+
return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== d || e[10] !== f ? (p = /* @__PURE__ */ c(on, { name: s, checked: o, readOnly: l, "aria-readonly": a, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = l, e[7] = a, e[8] = u, e[9] = d, e[10] = f, e[11] = p) : p = e[11], p;
|
|
387
|
+
}, Gs = (t) => {
|
|
389
388
|
const e = A(17), {
|
|
390
389
|
question: n,
|
|
391
|
-
questionIndex:
|
|
392
|
-
name:
|
|
390
|
+
questionIndex: s,
|
|
391
|
+
name: o,
|
|
393
392
|
selectedOption: r,
|
|
394
393
|
editable: i,
|
|
395
394
|
onToggleOption: l
|
|
396
395
|
} = t, a = r ?? null, u = !i, d = i ? void 0 : "true";
|
|
397
396
|
let f;
|
|
398
|
-
e[0] !== i || e[1] !== l || e[2] !== n || e[3] !==
|
|
399
|
-
h.value && l?.(n,
|
|
400
|
-
} : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] =
|
|
401
|
-
let
|
|
397
|
+
e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== s ? (f = i ? (h) => {
|
|
398
|
+
h.value && l?.(n, s, h.value);
|
|
399
|
+
} : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = s, e[4] = f) : f = e[4];
|
|
400
|
+
let p;
|
|
402
401
|
if (e[5] !== i || e[6] !== n.options) {
|
|
403
402
|
let h;
|
|
404
|
-
e[8] !== i ? (h = (g) => /* @__PURE__ */ c(
|
|
403
|
+
e[8] !== i ? (h = (g) => /* @__PURE__ */ c(ws, { value: g.label, inputProps: i ? void 0 : {
|
|
405
404
|
tabIndex: -1
|
|
406
|
-
}, alignItems: "flex-start", children: /* @__PURE__ */ c(
|
|
405
|
+
}, alignItems: "flex-start", children: /* @__PURE__ */ c(cn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], p = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = p;
|
|
407
406
|
} else
|
|
408
|
-
|
|
409
|
-
let
|
|
410
|
-
return e[10] !==
|
|
411
|
-
},
|
|
407
|
+
p = e[7];
|
|
408
|
+
let m;
|
|
409
|
+
return e[10] !== o || e[11] !== a || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== p ? (m = /* @__PURE__ */ c(Ts, { name: o, value: a, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: p }), e[10] = o, e[11] = a, e[12] = u, e[13] = d, e[14] = f, e[15] = p, e[16] = m) : m = e[16], m;
|
|
410
|
+
}, Ys = (t) => {
|
|
412
411
|
const e = A(4), {
|
|
413
412
|
items: n
|
|
414
413
|
} = t;
|
|
415
|
-
let o;
|
|
416
|
-
e[0] !== n ? (o = n.map(Po), e[0] = n, e[1] = o) : o = e[1];
|
|
417
414
|
let s;
|
|
418
|
-
|
|
419
|
-
|
|
415
|
+
e[0] !== n ? (s = n.map(Js), e[0] = n, e[1] = s) : s = e[1];
|
|
416
|
+
let o;
|
|
417
|
+
return e[2] !== s ? (o = /* @__PURE__ */ c(j, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
|
|
418
|
+
}, un = (t) => {
|
|
420
419
|
const e = A(19), {
|
|
421
420
|
questions: n,
|
|
422
|
-
editable:
|
|
423
|
-
selectedOptionsByQuestion:
|
|
421
|
+
editable: s,
|
|
422
|
+
selectedOptionsByQuestion: o,
|
|
424
423
|
customAnswersByQuestion: r,
|
|
425
424
|
onToggleOption: i,
|
|
426
425
|
onCustomAnswerChange: l
|
|
427
|
-
} = t, a =
|
|
426
|
+
} = t, a = s === void 0 ? !1 : s;
|
|
428
427
|
let u;
|
|
429
|
-
e[0] !==
|
|
428
|
+
e[0] !== o ? (u = o === void 0 ? {} : o, e[0] = o, e[1] = u) : u = e[1];
|
|
430
429
|
const d = u;
|
|
431
430
|
let f;
|
|
432
431
|
e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
|
|
433
|
-
const
|
|
434
|
-
let
|
|
435
|
-
if (e[4] !==
|
|
432
|
+
const p = f;
|
|
433
|
+
let m;
|
|
434
|
+
if (e[4] !== p || e[5] !== a || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
|
|
436
435
|
let g;
|
|
437
|
-
e[11] !==
|
|
438
|
-
const
|
|
439
|
-
return /* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */ c(
|
|
441
|
-
|
|
442
|
-
b.allowCustomAnswer ? /* @__PURE__ */ c(
|
|
443
|
-
] },
|
|
444
|
-
}, e[11] =
|
|
436
|
+
e[11] !== p || e[12] !== a || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (b, x) => {
|
|
437
|
+
const y = b.id ?? `question-${x}`, T = b.multiple ? "checkbox" : "radio", S = d[y] ?? [];
|
|
438
|
+
return /* @__PURE__ */ k(j, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
|
|
439
|
+
/* @__PURE__ */ c(U, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
|
|
440
|
+
T === "radio" ? /* @__PURE__ */ c(Gs, { question: b, questionIndex: x, name: y, selectedOption: S[0], editable: a, onToggleOption: i }) : b.options.map((w) => /* @__PURE__ */ c(Xs, { option: w, name: y, checked: S.includes(w.label), editable: a, onToggle: () => i?.(b, x, w.label) }, w.label)),
|
|
441
|
+
b.allowCustomAnswer ? /* @__PURE__ */ c(Wn, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: p[y] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (w) => l?.(b, x, w.currentTarget.value) }) : null
|
|
442
|
+
] }, y);
|
|
443
|
+
}, e[11] = p, e[12] = a, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], m = n.map(g), e[4] = p, e[5] = a, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = m;
|
|
445
444
|
} else
|
|
446
|
-
|
|
445
|
+
m = e[10];
|
|
447
446
|
let h;
|
|
448
|
-
return e[17] !==
|
|
447
|
+
return e[17] !== m ? (h = /* @__PURE__ */ c(j, { as: "form", gap: "sm", onSubmit: Ks, "aria-label": "Question form", children: m }), e[17] = m, e[18] = h) : h = e[18], h;
|
|
449
448
|
};
|
|
450
|
-
function
|
|
451
|
-
return /* @__PURE__ */ c(
|
|
449
|
+
function Js(t, e) {
|
|
450
|
+
return /* @__PURE__ */ c(P, { as: "li", children: /* @__PURE__ */ c(on, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
|
|
452
451
|
tabIndex: -1
|
|
453
|
-
}, size: "xs", children: /* @__PURE__ */ c(
|
|
452
|
+
}, size: "xs", children: /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
|
|
454
453
|
}
|
|
455
|
-
const
|
|
456
|
-
const
|
|
454
|
+
const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
|
|
455
|
+
const o = le(e, n), r = t[o] ?? [], i = r.includes(s);
|
|
457
456
|
return e.multiple ? {
|
|
458
457
|
...t,
|
|
459
|
-
[
|
|
458
|
+
[o]: i ? r.filter((l) => l !== s) : [...r, s]
|
|
460
459
|
} : {
|
|
461
460
|
...t,
|
|
462
|
-
[
|
|
461
|
+
[o]: i ? [] : [s]
|
|
463
462
|
};
|
|
464
|
-
},
|
|
465
|
-
id:
|
|
463
|
+
}, bt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
|
|
464
|
+
id: le(e, n),
|
|
466
465
|
question: e.question,
|
|
467
466
|
multiple: !!e.multiple,
|
|
468
467
|
required: !!e.required,
|
|
469
468
|
allowCustomAnswer: !!e.allowCustomAnswer,
|
|
470
|
-
options: e.options.map((
|
|
471
|
-
label:
|
|
472
|
-
description:
|
|
469
|
+
options: e.options.map((s) => ({
|
|
470
|
+
label: s.label,
|
|
471
|
+
description: s.description ?? ""
|
|
473
472
|
}))
|
|
474
|
-
}))) : "",
|
|
475
|
-
const
|
|
476
|
-
for (let
|
|
477
|
-
const r = t.questions[
|
|
478
|
-
u.length !== 0 &&
|
|
473
|
+
}))) : "", eo = (t, e, n) => {
|
|
474
|
+
const s = [];
|
|
475
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
476
|
+
const r = t.questions[o], i = le(r, o), l = e[i] ?? [], a = n[i]?.trim(), u = a ? [...l, a] : l;
|
|
477
|
+
u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
|
|
479
478
|
}
|
|
480
|
-
return
|
|
481
|
-
},
|
|
482
|
-
if (
|
|
479
|
+
return s;
|
|
480
|
+
}, to = (t) => typeof t != "string", _t = (t, e) => {
|
|
481
|
+
if (to(e)) return e;
|
|
483
482
|
const n = e.trim();
|
|
484
483
|
if (n.length === 0) return {};
|
|
485
|
-
const
|
|
486
|
-
for (let
|
|
487
|
-
const r = t.questions[
|
|
488
|
-
r.allowCustomAnswer && (
|
|
484
|
+
const s = {};
|
|
485
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
486
|
+
const r = t.questions[o];
|
|
487
|
+
r.allowCustomAnswer && (s[le(r, o)] = n);
|
|
489
488
|
}
|
|
490
|
-
return
|
|
491
|
-
},
|
|
489
|
+
return s;
|
|
490
|
+
}, no = (t, e, n) => {
|
|
492
491
|
if (!t) return typeof n == "string" ? n.trim() : "";
|
|
493
|
-
const
|
|
494
|
-
return r.length > 0 && !i &&
|
|
492
|
+
const s = _t(t, n), o = eo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
|
|
493
|
+
return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
|
|
495
494
|
`);
|
|
496
|
-
},
|
|
497
|
-
const
|
|
498
|
-
return t.questions.map((
|
|
499
|
-
const i =
|
|
495
|
+
}, so = (t, e, n) => {
|
|
496
|
+
const s = _t(t, n);
|
|
497
|
+
return t.questions.map((o, r) => {
|
|
498
|
+
const i = le(o, r), l = e[i] ?? [], a = s[i]?.trim();
|
|
500
499
|
return a ? [...l, a] : l;
|
|
501
500
|
});
|
|
502
|
-
},
|
|
501
|
+
}, oo = (t, e, n) => {
|
|
503
502
|
if (!t) return !1;
|
|
504
|
-
const
|
|
505
|
-
for (let
|
|
506
|
-
const r = t.questions[
|
|
503
|
+
const s = _t(t, n);
|
|
504
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
505
|
+
const r = t.questions[o];
|
|
507
506
|
if (!r.required) continue;
|
|
508
|
-
const i =
|
|
509
|
-
if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer &&
|
|
507
|
+
const i = le(r, o);
|
|
508
|
+
if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && s[i]?.trim()))
|
|
510
509
|
return !0;
|
|
511
510
|
}
|
|
512
511
|
return !1;
|
|
513
|
-
},
|
|
514
|
-
id:
|
|
512
|
+
}, ro = (t) => t.questions.map((e, n) => ({
|
|
513
|
+
id: le(e, n),
|
|
515
514
|
question: e.question,
|
|
516
515
|
options: e.options,
|
|
517
516
|
multiple: !!e.multiple,
|
|
518
517
|
required: !!e.required,
|
|
519
518
|
allowCustomAnswer: !!e.allowCustomAnswer
|
|
520
|
-
})),
|
|
521
|
-
const
|
|
522
|
-
return (n[
|
|
523
|
-
},
|
|
519
|
+
})), io = (t, e, n, s) => {
|
|
520
|
+
const o = le(t, e);
|
|
521
|
+
return (n[o] ?? []).length > 0 || !!s[o]?.trim();
|
|
522
|
+
}, lo = (t) => {
|
|
524
523
|
const e = A(22), {
|
|
525
524
|
question: n,
|
|
526
|
-
sourceQuestion:
|
|
527
|
-
questionIndex:
|
|
525
|
+
sourceQuestion: s,
|
|
526
|
+
questionIndex: o,
|
|
528
527
|
isActive: r,
|
|
529
528
|
selectedOptionsByQuestion: i,
|
|
530
529
|
customAnswersByQuestion: l,
|
|
531
530
|
onSelectStep: a
|
|
532
531
|
} = t;
|
|
533
532
|
let u;
|
|
534
|
-
e[0] !== l || e[1] !==
|
|
535
|
-
const d = u, f = d ? "answered" : "not answered",
|
|
533
|
+
e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u = io(s, o, i, l), e[0] = l, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
|
|
534
|
+
const d = u, f = d ? "answered" : "not answered", p = r ? "outline" : "ghost", m = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
|
|
536
535
|
let b;
|
|
537
|
-
e[5] !== a || e[6] !==
|
|
538
|
-
let y;
|
|
539
|
-
e[8] !== d || e[9] !== s ? (y = d ? /* @__PURE__ */ c(Dn, { "aria-hidden": "true" }) : s + 1, e[8] = d, e[9] = s, e[10] = y) : y = e[10];
|
|
540
|
-
let w;
|
|
541
|
-
e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== y || e[17] !== m ? (w = /* @__PURE__ */ c(ft, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: b, children: y }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = b, e[16] = y, e[17] = m, e[18] = w) : w = e[18];
|
|
536
|
+
e[5] !== a || e[6] !== o ? (b = () => a(o), e[5] = a, e[6] = o, e[7] = b) : b = e[7];
|
|
542
537
|
let x;
|
|
543
|
-
|
|
544
|
-
|
|
538
|
+
e[8] !== d || e[9] !== o ? (x = d ? /* @__PURE__ */ c(en, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = x) : x = e[10];
|
|
539
|
+
let y;
|
|
540
|
+
e[11] !== r || e[12] !== m || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== x || e[17] !== p ? (y = /* @__PURE__ */ c(Oe, { id: m, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: p, minW: "8", onClick: b, children: x }), e[11] = r, e[12] = m, e[13] = h, e[14] = g, e[15] = b, e[16] = x, e[17] = p, e[18] = y) : y = e[18];
|
|
541
|
+
let T;
|
|
542
|
+
return e[19] !== n.question || e[20] !== y ? (T = /* @__PURE__ */ c(Ct, { content: n.question, children: y }), e[19] = n.question, e[20] = y, e[21] = T) : T = e[21], T;
|
|
543
|
+
}, ao = (t) => {
|
|
545
544
|
const e = A(31), {
|
|
546
545
|
questionPrompt: n,
|
|
547
|
-
selectedOptionsByQuestion:
|
|
548
|
-
customAnswersByQuestion:
|
|
546
|
+
selectedOptionsByQuestion: s,
|
|
547
|
+
customAnswersByQuestion: o,
|
|
549
548
|
onToggleOption: r,
|
|
550
549
|
onCustomAnswerChange: i
|
|
551
550
|
} = t, {
|
|
552
551
|
questions: l
|
|
553
|
-
} = t, [a, u] = V(0), d = Math.min(a, l.length - 1), f = l[d],
|
|
554
|
-
let
|
|
555
|
-
e[0] !==
|
|
556
|
-
const h = `question-step-panel-${f.id}`, g =
|
|
552
|
+
} = t, [a, u] = V(0), d = Math.min(a, l.length - 1), f = l[d], p = l.length > 1;
|
|
553
|
+
let m;
|
|
554
|
+
e[0] !== o || e[1] !== p || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (m = p ? /* @__PURE__ */ c(Z, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((_, R) => /* @__PURE__ */ c(lo, { question: _, sourceQuestion: n.questions[R], questionIndex: R, isActive: R === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, _.id)) }) : null, e[0] = o, e[1] = p, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = s, e[6] = m) : m = e[6];
|
|
555
|
+
const h = `question-step-panel-${f.id}`, g = p ? "tabpanel" : void 0, b = p ? `question-step-tab-${f.id}` : void 0;
|
|
556
|
+
let x;
|
|
557
|
+
e[7] !== f ? (x = [f], e[7] = f, e[8] = x) : x = e[8];
|
|
557
558
|
let y;
|
|
558
|
-
e[
|
|
559
|
-
let w;
|
|
560
|
-
e[9] !== r || e[10] !== n.questions || e[11] !== d ? (w = (I, v, L) => {
|
|
559
|
+
e[9] !== r || e[10] !== n.questions || e[11] !== d ? (y = (_, R, L) => {
|
|
561
560
|
r(n.questions[d], d, L);
|
|
562
|
-
}, e[9] = r, e[10] = n.questions, e[11] = d, e[12] =
|
|
563
|
-
let
|
|
564
|
-
e[13] !== i || e[14] !== n.questions || e[15] !== d ? (
|
|
561
|
+
}, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = y) : y = e[12];
|
|
562
|
+
let T;
|
|
563
|
+
e[13] !== i || e[14] !== n.questions || e[15] !== d ? (T = (_, R, L) => {
|
|
565
564
|
i(n.questions[d], d, L);
|
|
566
|
-
}, e[13] = i, e[14] = n.questions, e[15] = d, e[16] =
|
|
565
|
+
}, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = T) : T = e[16];
|
|
567
566
|
let S;
|
|
568
|
-
e[17] !==
|
|
569
|
-
let
|
|
570
|
-
e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== S ? (
|
|
571
|
-
let
|
|
572
|
-
return e[28] !==
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
] }), e[28] =
|
|
576
|
-
},
|
|
567
|
+
e[17] !== o || e[18] !== s || e[19] !== x || e[20] !== y || e[21] !== T ? (S = /* @__PURE__ */ c(un, { questions: x, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: y, onCustomAnswerChange: T }), e[17] = o, e[18] = s, e[19] = x, e[20] = y, e[21] = T, e[22] = S) : S = e[22];
|
|
568
|
+
let w;
|
|
569
|
+
e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== S ? (w = /* @__PURE__ */ c(j, { id: h, role: g, "aria-labelledby": b, gap: "0", children: S }), e[23] = h, e[24] = g, e[25] = b, e[26] = S, e[27] = w) : w = e[27];
|
|
570
|
+
let C;
|
|
571
|
+
return e[28] !== m || e[29] !== w ? (C = /* @__PURE__ */ k(j, { gap: "xs", pb: "sm", children: [
|
|
572
|
+
m,
|
|
573
|
+
w
|
|
574
|
+
] }), e[28] = m, e[29] = w, e[30] = C) : C = e[30], C;
|
|
575
|
+
}, co = (t) => {
|
|
577
576
|
const e = A(8), {
|
|
578
577
|
questionPrompt: n
|
|
579
578
|
} = t;
|
|
580
|
-
let
|
|
581
|
-
e[0] !== n ? (
|
|
582
|
-
const
|
|
579
|
+
let s;
|
|
580
|
+
e[0] !== n ? (s = ro(n), e[0] = n, e[1] = s) : s = e[1];
|
|
581
|
+
const o = s;
|
|
583
582
|
let r;
|
|
584
|
-
e[2] !== n ? (r =
|
|
583
|
+
e[2] !== n ? (r = bt(n), e[2] = n, e[3] = r) : r = e[3];
|
|
585
584
|
const i = r;
|
|
586
585
|
let l;
|
|
587
|
-
return e[4] !== t || e[5] !== i || e[6] !==
|
|
588
|
-
},
|
|
586
|
+
return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ c(ao, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = l) : l = e[7], l;
|
|
587
|
+
}, Lt = "7", uo = (t) => {
|
|
589
588
|
const e = A(22);
|
|
590
|
-
let n,
|
|
589
|
+
let n, s, o, r;
|
|
591
590
|
e[0] !== t ? ({
|
|
592
591
|
title: r,
|
|
593
|
-
shortcut:
|
|
592
|
+
shortcut: o,
|
|
594
593
|
canInterrupt: n,
|
|
595
|
-
...
|
|
596
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
597
|
-
const i =
|
|
594
|
+
...s
|
|
595
|
+
} = t, e[0] = t, e[1] = n, e[2] = s, e[3] = o, e[4] = r) : (n = e[1], s = e[2], o = e[3], r = e[4]);
|
|
596
|
+
const i = s["aria-label"] ?? r;
|
|
598
597
|
let l;
|
|
599
|
-
e[5] !== n ? (l = n ? /* @__PURE__ */ c(
|
|
598
|
+
e[5] !== n ? (l = n ? /* @__PURE__ */ c(Yn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ c(Jn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
|
|
600
599
|
const a = l;
|
|
601
600
|
let u;
|
|
602
|
-
e[7] !== i || e[8] !== a || e[9] !==
|
|
601
|
+
e[7] !== i || e[8] !== a || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ c(Pe, { "data-testid": "send-message-button", size: "xs", variant: "primary", "aria-label": i, title: r, ...s, children: a }), e[7] = i, e[8] = a, e[9] = s, e[10] = r, e[11] = u) : u = e[11];
|
|
603
602
|
const d = u;
|
|
604
603
|
if (r) {
|
|
605
604
|
let f;
|
|
606
|
-
e[12] !==
|
|
605
|
+
e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k(At, { children: [
|
|
607
606
|
r,
|
|
608
607
|
" ",
|
|
609
|
-
/* @__PURE__ */ c(
|
|
610
|
-
] }) : r, e[12] =
|
|
611
|
-
const
|
|
612
|
-
let
|
|
613
|
-
e[15] !== d ? (
|
|
608
|
+
/* @__PURE__ */ c(Hn, { fontSize: "xs", children: o })
|
|
609
|
+
] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
|
|
610
|
+
const p = f;
|
|
611
|
+
let m;
|
|
612
|
+
e[15] !== d ? (m = /* @__PURE__ */ c(Ke.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = m) : m = e[16];
|
|
614
613
|
let h;
|
|
615
|
-
e[17] !==
|
|
614
|
+
e[17] !== p ? (h = /* @__PURE__ */ c(Yt, { children: /* @__PURE__ */ c(Ke.Positioner, { children: /* @__PURE__ */ c(Ke.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
|
|
616
615
|
let g;
|
|
617
|
-
return e[19] !==
|
|
618
|
-
|
|
616
|
+
return e[19] !== m || e[20] !== h ? (g = /* @__PURE__ */ k(Ke.Root, { closeDelay: 50, openDelay: 100, children: [
|
|
617
|
+
m,
|
|
619
618
|
h
|
|
620
|
-
] }), e[19] =
|
|
619
|
+
] }), e[19] = m, e[20] = h, e[21] = g) : g = e[21], g;
|
|
621
620
|
}
|
|
622
621
|
return d;
|
|
623
|
-
},
|
|
622
|
+
}, fo = (t) => {
|
|
624
623
|
const e = A(2), {
|
|
625
624
|
placeholder: n
|
|
626
625
|
} = t;
|
|
627
626
|
if (!n)
|
|
628
627
|
return null;
|
|
629
|
-
let
|
|
630
|
-
return e[0] !== n ? (
|
|
631
|
-
},
|
|
628
|
+
let s;
|
|
629
|
+
return e[0] !== n ? (s = /* @__PURE__ */ c(U, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = s) : s = e[1], s;
|
|
630
|
+
}, mt = "border.accent-light", yt = (t) => {
|
|
632
631
|
const e = t?.querySelector('[contenteditable="true"]');
|
|
633
632
|
e instanceof HTMLElement && e.focus();
|
|
634
|
-
},
|
|
635
|
-
|
|
636
|
-
}),
|
|
637
|
-
const
|
|
638
|
-
defaultState:
|
|
639
|
-
onSubmit:
|
|
633
|
+
}, $t = (t, e) => requestAnimationFrame(() => {
|
|
634
|
+
yt(t), e?.();
|
|
635
|
+
}), po = (t) => {
|
|
636
|
+
const {
|
|
637
|
+
defaultState: e,
|
|
638
|
+
onSubmit: n = () => {
|
|
639
|
+
},
|
|
640
640
|
onInterrupt: s,
|
|
641
|
-
onAttachFiles:
|
|
642
|
-
onAttachText:
|
|
643
|
-
textAttachmentPasteLineThreshold:
|
|
644
|
-
streaming:
|
|
645
|
-
attachedResources:
|
|
646
|
-
onClearAttachments:
|
|
647
|
-
isDisabled:
|
|
648
|
-
submitDisabled:
|
|
641
|
+
onAttachFiles: o,
|
|
642
|
+
onAttachText: r,
|
|
643
|
+
textAttachmentPasteLineThreshold: i = an,
|
|
644
|
+
streaming: l = !1,
|
|
645
|
+
attachedResources: a = [],
|
|
646
|
+
onClearAttachments: u,
|
|
647
|
+
isDisabled: d = !1,
|
|
648
|
+
submitDisabled: f = !1,
|
|
649
649
|
onChange: p,
|
|
650
|
-
placeholder:
|
|
651
|
-
attachmentList:
|
|
652
|
-
actions:
|
|
653
|
-
attachedToTop:
|
|
654
|
-
recessed:
|
|
655
|
-
questionPrompt:
|
|
656
|
-
autoFocus:
|
|
657
|
-
focusSignal:
|
|
658
|
-
submitTitle:
|
|
659
|
-
references:
|
|
660
|
-
onAddReference:
|
|
661
|
-
} = t,
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
let Pe;
|
|
675
|
-
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Pe = {}, e[7] = Pe) : Pe = e[7];
|
|
676
|
-
const [J, je] = V(Pe), He = Te(null), lt = Te(p);
|
|
677
|
-
let Ke;
|
|
678
|
-
e[8] !== x ? (Ke = Xt(x), e[8] = x, e[9] = Ke) : Ke = e[9];
|
|
679
|
-
const Ve = Te(Ke);
|
|
680
|
-
let me, at;
|
|
681
|
-
e[10] !== p ? (me = () => {
|
|
682
|
-
lt.current = p;
|
|
683
|
-
}, at = [p], e[10] = p, e[11] = me, e[12] = at) : (me = e[11], at = e[12]), ae(me, at);
|
|
684
|
-
let De, Ee;
|
|
685
|
-
e[13] !== n ? (De = () => {
|
|
686
|
-
const q = Vt(n);
|
|
687
|
-
de(n), Ue(jo), fe(q), Me({}), je({}), lt.current?.(q);
|
|
688
|
-
}, Ee = [n], e[13] = n, e[14] = De, e[15] = Ee) : (De = e[14], Ee = e[15]), ae(De, Ee);
|
|
689
|
-
let he;
|
|
690
|
-
e[16] !== x ? (he = Xt(x), e[16] = x, e[17] = he) : he = e[17];
|
|
691
|
-
const se = he;
|
|
692
|
-
let Be, Fe;
|
|
693
|
-
e[18] !== se ? (Be = () => {
|
|
694
|
-
Ve.current !== se && (Ve.current = se, Me({}), je({}));
|
|
695
|
-
}, Fe = [se], e[18] = se, e[19] = Be, e[20] = Fe) : (Be = e[19], Fe = e[20]), ae(Be, Fe);
|
|
696
|
-
let ge, be;
|
|
697
|
-
e[21] !== z ? (ge = () => {
|
|
698
|
-
if (!z)
|
|
699
|
-
return;
|
|
700
|
-
const q = hn(He.current, () => _e(!0));
|
|
650
|
+
placeholder: m,
|
|
651
|
+
attachmentList: h,
|
|
652
|
+
actions: g,
|
|
653
|
+
attachedToTop: b = !1,
|
|
654
|
+
recessed: x = !1,
|
|
655
|
+
questionPrompt: y,
|
|
656
|
+
autoFocus: T = !1,
|
|
657
|
+
focusSignal: S = 0,
|
|
658
|
+
submitTitle: w,
|
|
659
|
+
references: C = [],
|
|
660
|
+
onAddReference: _
|
|
661
|
+
} = t, R = x ? "border.subtle" : "border", [L, E] = V(!1), [Q, M] = V(!1), [D, B] = V(e), [$, O] = V(0), [F, z] = V(() => ft(e)), [v, W] = V({}), [H, K] = V({}), oe = ie(null), xe = ie(p), Se = ie(bt(y));
|
|
662
|
+
J(() => {
|
|
663
|
+
xe.current = p;
|
|
664
|
+
}, [p]), J(() => {
|
|
665
|
+
const q = ft(e);
|
|
666
|
+
B(e), O((ne) => ne + 1), z(q), W({}), K({}), xe.current?.(q);
|
|
667
|
+
}, [e]);
|
|
668
|
+
const ee = bt(y);
|
|
669
|
+
J(() => {
|
|
670
|
+
Se.current !== ee && (Se.current = ee, W({}), K({}));
|
|
671
|
+
}, [ee]), J(() => {
|
|
672
|
+
if (!T) return;
|
|
673
|
+
const q = $t(oe.current, () => M(!0));
|
|
701
674
|
return () => cancelAnimationFrame(q);
|
|
702
|
-
},
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
if (R === 0)
|
|
706
|
-
return;
|
|
707
|
-
const q = hn(He.current, () => _e(!0));
|
|
675
|
+
}, [T]), J(() => {
|
|
676
|
+
if (S === 0) return;
|
|
677
|
+
const q = $t(oe.current, () => M(!0));
|
|
708
678
|
return () => cancelAnimationFrame(q);
|
|
709
|
-
},
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
const ut = q === void 0 ? !1 : q;
|
|
718
|
-
de(n), Ue(Ko);
|
|
719
|
-
const st = Vt(n);
|
|
720
|
-
fe(st), Me({}), je({}), lt.current?.(st), ut && requestAnimationFrame(() => {
|
|
721
|
-
Gt(He.current);
|
|
679
|
+
}, [S]);
|
|
680
|
+
const Te = () => {
|
|
681
|
+
M(!0), yt(oe.current);
|
|
682
|
+
}, Be = (q = !1) => {
|
|
683
|
+
B(e), O((se) => se + 1);
|
|
684
|
+
const ne = ft(e);
|
|
685
|
+
z(ne), W({}), K({}), xe.current?.(ne), q && requestAnimationFrame(() => {
|
|
686
|
+
yt(oe.current);
|
|
722
687
|
});
|
|
723
|
-
},
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
streaming: $,
|
|
735
|
-
text: K
|
|
736
|
-
}, re = Co(Z), e[30] = J, e[31] = P, e[32] = s, e[33] = x, e[34] = U, e[35] = $, e[36] = F, e[37] = ee, e[38] = Z, e[39] = K, e[40] = re;
|
|
737
|
-
} else
|
|
738
|
-
Z = e[38], K = e[39], re = e[40];
|
|
739
|
-
const te = re;
|
|
740
|
-
let ie;
|
|
741
|
-
e[41] !== M || e[42] !== J || e[43] !== d || e[44] !== L || e[45] !== x || e[46] !== Ne || e[47] !== K || e[48] !== U ? (ie = () => {
|
|
742
|
-
if (!K)
|
|
743
|
-
return;
|
|
744
|
-
const q = x ? {
|
|
745
|
-
answers: Lo(x, U, J)
|
|
688
|
+
}, X = y ? no(y, v, H) : F.trim(), G = oo(y, v, H), de = {
|
|
689
|
+
canInterrupt: l && !y && !!s,
|
|
690
|
+
canSubmit: !f,
|
|
691
|
+
hasQuestionPrompt: !!y,
|
|
692
|
+
isDisabled: d || L || G,
|
|
693
|
+
streaming: l,
|
|
694
|
+
text: X
|
|
695
|
+
}, te = Ns(de), fe = l && !y ? "Queue message" : "Send message", Fe = async () => {
|
|
696
|
+
if (!X) return;
|
|
697
|
+
const q = y ? {
|
|
698
|
+
answers: so(y, v, H)
|
|
746
699
|
} : void 0;
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
s?.();
|
|
754
|
-
return;
|
|
700
|
+
E(!0);
|
|
701
|
+
try {
|
|
702
|
+
await n(X, a, q), Be(!0), u?.();
|
|
703
|
+
} catch {
|
|
704
|
+
} finally {
|
|
705
|
+
E(!1);
|
|
755
706
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
textAttachmentPasteLineThreshold: D
|
|
770
|
-
}), e[59] = r, e[60] = i, e[61] = D, e[62] = bt) : bt = e[62];
|
|
771
|
-
const Se = bt;
|
|
772
|
-
let yt;
|
|
773
|
-
e[63] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (yt = (q, ut, st) => {
|
|
774
|
-
Me((Wt) => Do(Wt, q, ut, st));
|
|
775
|
-
}, e[63] = yt) : yt = e[63];
|
|
776
|
-
const ms = yt;
|
|
777
|
-
let xt;
|
|
778
|
-
e[64] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (xt = (q, ut, st) => {
|
|
779
|
-
const Wt = Ae(q, ut);
|
|
780
|
-
je((gs) => ({
|
|
781
|
-
...gs,
|
|
782
|
-
[Wt]: st
|
|
707
|
+
}, Ae = (q) => {
|
|
708
|
+
q === "interrupt" && s?.(), q === "submit" && Fe();
|
|
709
|
+
}, we = js({
|
|
710
|
+
onAttachFiles: o,
|
|
711
|
+
onAttachText: r,
|
|
712
|
+
textAttachmentPasteLineThreshold: i
|
|
713
|
+
}), nt = (q, ne, se) => {
|
|
714
|
+
W((pe) => Zs(pe, q, ne, se));
|
|
715
|
+
}, st = (q, ne, se) => {
|
|
716
|
+
const pe = le(q, ne);
|
|
717
|
+
K((Dt) => ({
|
|
718
|
+
...Dt,
|
|
719
|
+
[pe]: se
|
|
783
720
|
}));
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
e[65] !== $t ? (Ye = {
|
|
788
|
-
borderColor: $t,
|
|
721
|
+
};
|
|
722
|
+
return /* @__PURE__ */ c(P, { ref: oe, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: b ? "-1px" : void 0, bg: "bg", borderRadius: "xs", borderTopRadius: b ? "0" : void 0, borderWidth: "1px", borderStyle: "solid", borderColor: Q ? mt : R, zIndex: Q ? 1 : 0, transition: "border-color 0.2s ease-in-out", _hover: {
|
|
723
|
+
borderColor: Q ? mt : R,
|
|
789
724
|
zIndex: 1
|
|
790
|
-
},
|
|
791
|
-
|
|
792
|
-
e[67] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (St = {
|
|
793
|
-
borderColor: Ut,
|
|
725
|
+
}, _focusWithin: {
|
|
726
|
+
borderColor: mt,
|
|
794
727
|
zIndex: 1
|
|
795
|
-
},
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
Tt,
|
|
815
|
-
et
|
|
816
|
-
] }), e[90] = b, e[91] = et, e[92] = tt) : tt = e[92];
|
|
817
|
-
let nt;
|
|
818
|
-
e[93] !== Je || e[94] !== Ze || e[95] !== tt ? (nt = /* @__PURE__ */ C(Qe, { direction: "column", color: "fg", gap: "xs", children: [
|
|
819
|
-
Je,
|
|
820
|
-
Ze,
|
|
821
|
-
tt
|
|
822
|
-
] }), e[93] = Je, e[94] = Ze, e[95] = tt, e[96] = nt) : nt = e[96];
|
|
823
|
-
let At;
|
|
824
|
-
return e[97] !== Se.onDragOver || e[98] !== Se.onDropCapture || e[99] !== Se.onPasteCapture || e[100] !== Et || e[101] !== Bt || e[102] !== Ft || e[103] !== Lt || e[104] !== Ye || e[105] !== nt ? (At = /* @__PURE__ */ c(B, { ref: He, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: Et, bg: "bg", borderRadius: "xs", borderTopRadius: Bt, borderWidth: "1px", borderStyle: "solid", borderColor: Ft, zIndex: Lt, transition: "border-color 0.2s ease-in-out", _hover: Ye, _focusWithin: St, onPasteCapture: Se.onPasteCapture, onDropCapture: Se.onDropCapture, onDragOver: Se.onDragOver, onClick: ct, onBlur: wt, children: nt }), e[97] = Se.onDragOver, e[98] = Se.onDropCapture, e[99] = Se.onPasteCapture, e[100] = Et, e[101] = Bt, e[102] = Ft, e[103] = Lt, e[104] = Ye, e[105] = nt, e[106] = At) : At = e[106], At;
|
|
825
|
-
};
|
|
826
|
-
function Uo() {
|
|
827
|
-
}
|
|
828
|
-
function jo(t) {
|
|
829
|
-
return t + 1;
|
|
830
|
-
}
|
|
831
|
-
function Ko(t) {
|
|
832
|
-
return t + 1;
|
|
833
|
-
}
|
|
834
|
-
const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo = (t) => {
|
|
728
|
+
}, onPasteCapture: we.onPasteCapture, onDropCapture: we.onDropCapture, onDragOver: we.onDragOver, onClick: Te, onBlur: () => M(!1), children: /* @__PURE__ */ k(be, { direction: "column", color: "fg", gap: "xs", children: [
|
|
729
|
+
h ? /* @__PURE__ */ c(P, { children: h }) : null,
|
|
730
|
+
y ? /* @__PURE__ */ c(co, { questionPrompt: y, selectedOptionsByQuestion: v, customAnswersByQuestion: H, onToggleOption: nt, onCustomAnswerChange: st }) : (
|
|
731
|
+
// The editor is its own composer row: it centres a single line at the shared
|
|
732
|
+
// control height and grows with content, never shrinking below it, so the row
|
|
733
|
+
// aligns with the toolbar beneath it.
|
|
734
|
+
/* @__PURE__ */ c(Ye, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
|
|
735
|
+
pr: "2xs"
|
|
736
|
+
}, children: /* @__PURE__ */ c(be, { minH: Lt, align: "center", children: /* @__PURE__ */ c(xs, { defaultState: D, isEditable: !d && !L, placeholder: /* @__PURE__ */ c(fo, { placeholder: m }), onChange: (q) => {
|
|
737
|
+
z(q), p?.(q);
|
|
738
|
+
}, onSubmit: () => Ae(Vs(de)), references: C, onAddReference: _ }, $) }) })
|
|
739
|
+
),
|
|
740
|
+
/* @__PURE__ */ k(Z, { gap: "1", minH: Lt, align: "center", children: [
|
|
741
|
+
g,
|
|
742
|
+
/* @__PURE__ */ c(Vn, {}),
|
|
743
|
+
/* @__PURE__ */ c(uo, { canInterrupt: te === "interrupt", title: te === "interrupt" ? "Stop Response" : w ?? fe, shortcut: te === "submit" ? "Enter" : void 0, onClick: () => Ae(te), disabled: te === "none" })
|
|
744
|
+
] })
|
|
745
|
+
] }) });
|
|
746
|
+
}, Qe = (t) => typeof t == "object" && t !== null && !Array.isArray(t), mo = (t) => {
|
|
835
747
|
try {
|
|
836
748
|
const e = JSON.parse(t);
|
|
837
|
-
return
|
|
749
|
+
return Qe(e) ? e : null;
|
|
838
750
|
} catch {
|
|
839
751
|
return null;
|
|
840
752
|
}
|
|
841
|
-
},
|
|
842
|
-
const e =
|
|
753
|
+
}, ho = (t) => Qe(t) ? t : typeof t == "string" && t.trim().length > 0 ? mo(t) : null, De = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, re = (t) => {
|
|
754
|
+
const e = De(t);
|
|
843
755
|
if (e) return e;
|
|
844
756
|
if (Array.isArray(t)) {
|
|
845
|
-
const n = t.map(
|
|
757
|
+
const n = t.map(re).filter((s) => s !== null);
|
|
846
758
|
return n.length > 0 ? n.join(`
|
|
847
759
|
`) : null;
|
|
848
760
|
}
|
|
849
|
-
return
|
|
850
|
-
},
|
|
761
|
+
return Qe(t) ? re(t.response) ?? re(t.answer) ?? re(t.text) ?? re(t.answers) : null;
|
|
762
|
+
}, go = (t) => {
|
|
851
763
|
if (typeof t == "string" && t.trim().length > 0)
|
|
852
764
|
return {
|
|
853
765
|
label: t,
|
|
854
766
|
description: void 0
|
|
855
767
|
};
|
|
856
|
-
if (!
|
|
857
|
-
const e =
|
|
768
|
+
if (!Qe(t)) return null;
|
|
769
|
+
const e = De(t.label);
|
|
858
770
|
return e ? {
|
|
859
771
|
label: e,
|
|
860
|
-
description:
|
|
772
|
+
description: De(t.description) ?? void 0
|
|
861
773
|
} : null;
|
|
862
|
-
},
|
|
863
|
-
if (!
|
|
864
|
-
const n =
|
|
774
|
+
}, bo = (t, e) => {
|
|
775
|
+
if (!Qe(t)) return null;
|
|
776
|
+
const n = De(t.question);
|
|
865
777
|
if (!n) return null;
|
|
866
|
-
const
|
|
778
|
+
const s = Array.isArray(t.options) ? t.options.map(go).filter((i) => i !== null) : [], o = De(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : s.length === 0 || o === "freeform" || o === "text";
|
|
867
779
|
return {
|
|
868
|
-
id:
|
|
780
|
+
id: De(t.id) ?? `question-${e}`,
|
|
869
781
|
question: n,
|
|
870
|
-
options:
|
|
871
|
-
multiple: typeof t.multiple == "boolean" ? t.multiple :
|
|
782
|
+
options: s,
|
|
783
|
+
multiple: typeof t.multiple == "boolean" ? t.multiple : o === "multi_choice" || o === "multiple_choice",
|
|
872
784
|
required: typeof t.required == "boolean" ? t.required : !0,
|
|
873
785
|
allowCustomAnswer: r
|
|
874
786
|
};
|
|
875
|
-
},
|
|
876
|
-
const e =
|
|
787
|
+
}, dn = (t) => {
|
|
788
|
+
const e = ho(t);
|
|
877
789
|
if (!e || !Array.isArray(e.questions)) return null;
|
|
878
|
-
const n = e.questions.map(
|
|
790
|
+
const n = e.questions.map(bo).filter((s) => s !== null);
|
|
879
791
|
return n.length === 0 ? null : {
|
|
880
792
|
questions: n
|
|
881
793
|
};
|
|
882
|
-
},
|
|
794
|
+
}, yo = (t) => t.tool.toLowerCase() === "question", xo = (t) => {
|
|
883
795
|
for (let e = t.length - 1; e >= 0; e -= 1) {
|
|
884
796
|
const n = t[e];
|
|
885
797
|
if (n.role === "assistant")
|
|
886
|
-
for (let
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
889
|
-
return
|
|
798
|
+
for (let s = n.parts.length - 1; s >= 0; s -= 1) {
|
|
799
|
+
const o = n.parts[s];
|
|
800
|
+
if (o.type !== "tool" || !yo(o)) continue;
|
|
801
|
+
return re(o.state?.output) ?? re(o.state?.metadata) ? void 0 : dn(o.state?.input) ?? void 0;
|
|
890
802
|
}
|
|
891
803
|
}
|
|
892
|
-
},
|
|
804
|
+
}, So = (t = "") => JSON.stringify(Ss(t)), fn = {
|
|
893
805
|
animationName: "message-fade-in",
|
|
894
806
|
animationDuration: "200ms",
|
|
895
807
|
animationTimingFunction: "ease-out"
|
|
896
|
-
},
|
|
808
|
+
}, wo = (t) => {
|
|
897
809
|
const e = /* @__PURE__ */ new Set(), n = new Set(t.state.seenKeys);
|
|
898
|
-
for (const
|
|
899
|
-
t.state.initialized && !n.has(
|
|
810
|
+
for (const s of t.itemKeys)
|
|
811
|
+
t.state.initialized && !n.has(s) && e.add(s), n.add(s);
|
|
900
812
|
return {
|
|
901
813
|
animatedKeys: e,
|
|
902
814
|
state: {
|
|
@@ -904,47 +816,47 @@ const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo =
|
|
|
904
816
|
seenKeys: n
|
|
905
817
|
}
|
|
906
818
|
};
|
|
907
|
-
},
|
|
819
|
+
}, To = (t, e) => {
|
|
908
820
|
if (t.length !== e.length) return !1;
|
|
909
821
|
for (let n = 0; n < t.length; n += 1) if (t[n] !== e[n]) return !1;
|
|
910
822
|
return !0;
|
|
911
|
-
},
|
|
912
|
-
const e =
|
|
823
|
+
}, Ao = (t) => {
|
|
824
|
+
const e = ie({
|
|
913
825
|
initialized: !1,
|
|
914
826
|
seenKeys: /* @__PURE__ */ new Set()
|
|
915
|
-
}), n =
|
|
916
|
-
if (n.current &&
|
|
827
|
+
}), n = ie(null);
|
|
828
|
+
if (n.current && To(n.current.itemKeys, t))
|
|
917
829
|
return n.current.animatedKeys;
|
|
918
|
-
const
|
|
830
|
+
const s = wo({
|
|
919
831
|
itemKeys: t,
|
|
920
832
|
state: e.current
|
|
921
833
|
});
|
|
922
|
-
return e.current =
|
|
834
|
+
return e.current = s.state, n.current = {
|
|
923
835
|
itemKeys: [...t],
|
|
924
|
-
animatedKeys:
|
|
925
|
-
},
|
|
926
|
-
},
|
|
836
|
+
animatedKeys: s.animatedKeys
|
|
837
|
+
}, s.animatedKeys;
|
|
838
|
+
}, ko = (t) => t.type === "text", Co = (t) => (t.parts ?? []).filter(ko).map((e) => e.text.trim()).filter(Boolean).join(`
|
|
927
839
|
|
|
928
|
-
`),
|
|
840
|
+
`), Io = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
|
|
929
841
|
hour: "numeric",
|
|
930
842
|
minute: "2-digit",
|
|
931
843
|
timeZone: n
|
|
932
|
-
}).format(new Date(t.createdAt)) : "",
|
|
844
|
+
}).format(new Date(t.createdAt)) : "", xt = (t) => {
|
|
933
845
|
const e = A(20), {
|
|
934
846
|
message: n,
|
|
935
|
-
alwaysVisible:
|
|
936
|
-
copyAlwaysVisible:
|
|
937
|
-
} = t, r =
|
|
847
|
+
alwaysVisible: s,
|
|
848
|
+
copyAlwaysVisible: o
|
|
849
|
+
} = t, r = s === void 0 ? !1 : s, i = o === void 0 ? r : o, [l, a] = V(!1), u = ie(null);
|
|
938
850
|
let d;
|
|
939
|
-
e[0] !== n ? (d =
|
|
851
|
+
e[0] !== n ? (d = Co(n), e[0] = n, e[1] = d) : d = e[1];
|
|
940
852
|
const f = d;
|
|
941
|
-
let
|
|
942
|
-
e[2] !== n ? (
|
|
943
|
-
const
|
|
853
|
+
let p;
|
|
854
|
+
e[2] !== n ? (p = Io(n), e[2] = n, e[3] = p) : p = e[3];
|
|
855
|
+
const m = p;
|
|
944
856
|
let h, g;
|
|
945
857
|
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
|
|
946
858
|
u.current !== null && window.clearTimeout(u.current);
|
|
947
|
-
}, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]),
|
|
859
|
+
}, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), J(h, g);
|
|
948
860
|
let b;
|
|
949
861
|
e[6] !== f ? (b = async () => {
|
|
950
862
|
if (f)
|
|
@@ -954,20 +866,20 @@ const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo =
|
|
|
954
866
|
a(!1);
|
|
955
867
|
}
|
|
956
868
|
}, e[6] = f, e[7] = b) : b = e[7];
|
|
957
|
-
const
|
|
958
|
-
if (!f && !
|
|
869
|
+
const x = b;
|
|
870
|
+
if (!f && !m)
|
|
959
871
|
return null;
|
|
960
|
-
const
|
|
872
|
+
const y = r ? "1" : "0", T = r ? "auto" : "none";
|
|
961
873
|
let S;
|
|
962
|
-
e[8] !==
|
|
963
|
-
let
|
|
964
|
-
e[10] !== i || e[11] !==
|
|
965
|
-
let
|
|
966
|
-
return e[15] !==
|
|
874
|
+
e[8] !== m ? (S = m ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", children: m }) : null, e[8] = m, e[9] = S) : S = e[9];
|
|
875
|
+
let w;
|
|
876
|
+
e[10] !== i || e[11] !== x || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ c(P, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Ot, children: /* @__PURE__ */ c(Ct, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ c(Pe, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: x, children: l ? /* @__PURE__ */ c(en, { size: 12 }) : /* @__PURE__ */ c(Zn, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = x, e[12] = f, e[13] = l, e[14] = w) : w = e[14];
|
|
877
|
+
let C;
|
|
878
|
+
return e[15] !== w || e[16] !== y || e[17] !== T || e[18] !== S ? (C = /* @__PURE__ */ k(Z, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: y, pointerEvents: T, transition: "opacity 120ms ease", css: Ot, children: [
|
|
967
879
|
S,
|
|
968
|
-
|
|
969
|
-
] }), e[15] =
|
|
970
|
-
},
|
|
880
|
+
w
|
|
881
|
+
] }), e[15] = w, e[16] = y, e[17] = T, e[18] = S, e[19] = C) : C = e[19], C;
|
|
882
|
+
}, Ot = {
|
|
971
883
|
"[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
|
|
972
884
|
opacity: 1,
|
|
973
885
|
pointerEvents: "auto"
|
|
@@ -980,44 +892,44 @@ const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo =
|
|
|
980
892
|
opacity: 1,
|
|
981
893
|
pointerEvents: "auto"
|
|
982
894
|
}
|
|
983
|
-
},
|
|
895
|
+
}, _o = (t) => {
|
|
984
896
|
const e = A(8);
|
|
985
|
-
let n,
|
|
897
|
+
let n, s;
|
|
986
898
|
e[0] !== t ? ({
|
|
987
899
|
children: n,
|
|
988
|
-
...
|
|
989
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
990
|
-
let
|
|
991
|
-
e[3] !== n ? (
|
|
900
|
+
...s
|
|
901
|
+
} = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
|
|
902
|
+
let o;
|
|
903
|
+
e[3] !== n ? (o = /* @__PURE__ */ c(rn, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
|
|
992
904
|
let r;
|
|
993
|
-
return e[5] !==
|
|
994
|
-
},
|
|
995
|
-
const e =
|
|
905
|
+
return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ c(P, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
|
|
906
|
+
}, Ro = _o, Je = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), vo = (t) => {
|
|
907
|
+
const e = Je(t), n = e.replace(/_/g, "");
|
|
996
908
|
return [.../* @__PURE__ */ new Set([t, e, n])];
|
|
997
|
-
},
|
|
998
|
-
shell:
|
|
999
|
-
ls:
|
|
1000
|
-
read_file:
|
|
1001
|
-
write_file:
|
|
1002
|
-
delete_file:
|
|
1003
|
-
patch:
|
|
1004
|
-
upload_files:
|
|
1005
|
-
download_file:
|
|
1006
|
-
move_file:
|
|
1007
|
-
},
|
|
1008
|
-
dot:
|
|
1009
|
-
danger:
|
|
1010
|
-
search:
|
|
1011
|
-
browser:
|
|
1012
|
-
file:
|
|
1013
|
-
question:
|
|
1014
|
-
todo:
|
|
1015
|
-
terminal:
|
|
1016
|
-
...
|
|
1017
|
-
},
|
|
1018
|
-
if (!t) return
|
|
1019
|
-
const e =
|
|
1020
|
-
if (
|
|
909
|
+
}, pn = {
|
|
910
|
+
shell: nn,
|
|
911
|
+
ls: is,
|
|
912
|
+
read_file: rs,
|
|
913
|
+
write_file: os,
|
|
914
|
+
delete_file: tn,
|
|
915
|
+
patch: ss,
|
|
916
|
+
upload_files: ns,
|
|
917
|
+
download_file: ts,
|
|
918
|
+
move_file: es
|
|
919
|
+
}, Mo = {
|
|
920
|
+
dot: fs,
|
|
921
|
+
danger: sn,
|
|
922
|
+
search: ds,
|
|
923
|
+
browser: us,
|
|
924
|
+
file: cs,
|
|
925
|
+
question: as,
|
|
926
|
+
todo: ls,
|
|
927
|
+
terminal: nn,
|
|
928
|
+
...pn
|
|
929
|
+
}, zt = "dot", Po = (t) => Object.hasOwn(pn, t), Eo = (t) => Mo[t], mn = (t) => {
|
|
930
|
+
if (!t) return zt;
|
|
931
|
+
const e = Je(t);
|
|
932
|
+
if (Po(e)) return e;
|
|
1021
933
|
const n = e.replace(/_/g, "");
|
|
1022
934
|
switch (e) {
|
|
1023
935
|
case "read":
|
|
@@ -1044,52 +956,52 @@ const mt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Xo =
|
|
|
1044
956
|
case "file":
|
|
1045
957
|
return "file";
|
|
1046
958
|
default:
|
|
1047
|
-
return n === "todowrite" || n === "todo" ? "todo" :
|
|
959
|
+
return n === "todowrite" || n === "todo" ? "todo" : zt;
|
|
1048
960
|
}
|
|
1049
961
|
};
|
|
1050
|
-
function
|
|
962
|
+
function Rt(t) {
|
|
1051
963
|
const e = t.lastIndexOf("/");
|
|
1052
964
|
return e >= 0 ? t.slice(e + 1) : t;
|
|
1053
965
|
}
|
|
1054
|
-
function
|
|
966
|
+
function Xe(t) {
|
|
1055
967
|
if (!t) return null;
|
|
1056
968
|
const e = t.split(" ")[0].trim();
|
|
1057
969
|
if (e === "/dev/null") return null;
|
|
1058
970
|
let n = e;
|
|
1059
971
|
return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
|
|
1060
972
|
}
|
|
1061
|
-
const
|
|
973
|
+
const Ze = (t) => t.startsWith("--- "), vt = (t) => t.startsWith("+++ "), Mt = (t) => t.startsWith("@@"), Do = (t) => t.startsWith("+") && !(vt(t) || t === "+++"), Bo = (t) => t.startsWith("-") && !(Ze(t) || t === "---"), Fo = (t, e) => {
|
|
1062
974
|
t.has(e) || t.set(e, {
|
|
1063
975
|
additions: 0,
|
|
1064
976
|
deletions: 0
|
|
1065
977
|
});
|
|
1066
|
-
},
|
|
978
|
+
}, Lo = (t, e) => {
|
|
1067
979
|
const n = t.get(e);
|
|
1068
980
|
n && (n.additions += 1);
|
|
1069
|
-
},
|
|
981
|
+
}, $o = (t, e) => {
|
|
1070
982
|
const n = t.get(e);
|
|
1071
983
|
n && (n.deletions += 1);
|
|
1072
|
-
},
|
|
1073
|
-
if (
|
|
984
|
+
}, Oo = (t, e, n) => {
|
|
985
|
+
if (Ze(t))
|
|
1074
986
|
return {
|
|
1075
987
|
...e,
|
|
1076
|
-
lastMinusHeader:
|
|
988
|
+
lastMinusHeader: Xe(t.slice(4)),
|
|
1077
989
|
inHunk: !1
|
|
1078
990
|
};
|
|
1079
|
-
if (
|
|
1080
|
-
const
|
|
1081
|
-
return
|
|
991
|
+
if (vt(t)) {
|
|
992
|
+
const o = Xe(t.slice(4)) ?? e.lastMinusHeader;
|
|
993
|
+
return o && Fo(n, o), {
|
|
1082
994
|
...e,
|
|
1083
|
-
currentPath:
|
|
995
|
+
currentPath: o,
|
|
1084
996
|
inHunk: !1
|
|
1085
997
|
};
|
|
1086
998
|
}
|
|
1087
|
-
return e.currentPath ?
|
|
999
|
+
return e.currentPath ? Mt(t) ? {
|
|
1088
1000
|
...e,
|
|
1089
1001
|
inHunk: !0
|
|
1090
|
-
} : e.inHunk ?
|
|
1002
|
+
} : e.inHunk ? Do(t) ? (Lo(n, e.currentPath), e) : (Bo(t) && $o(n, e.currentPath), e) : e : e;
|
|
1091
1003
|
};
|
|
1092
|
-
function
|
|
1004
|
+
function hn(t) {
|
|
1093
1005
|
if (!t || typeof t != "string") return [];
|
|
1094
1006
|
const e = /* @__PURE__ */ new Map();
|
|
1095
1007
|
let n = {
|
|
@@ -1097,34 +1009,34 @@ function Un(t) {
|
|
|
1097
1009
|
lastMinusHeader: null,
|
|
1098
1010
|
inHunk: !1
|
|
1099
1011
|
};
|
|
1100
|
-
const
|
|
1101
|
-
for (const
|
|
1102
|
-
n =
|
|
1103
|
-
return Array.from(e.entries()).map(([
|
|
1012
|
+
const s = t.split(/\r?\n/);
|
|
1013
|
+
for (const o of s)
|
|
1014
|
+
n = Oo(o, n, e);
|
|
1015
|
+
return Array.from(e.entries()).map(([o, {
|
|
1104
1016
|
additions: r,
|
|
1105
1017
|
deletions: i
|
|
1106
1018
|
}]) => ({
|
|
1107
|
-
filePath:
|
|
1019
|
+
filePath: o,
|
|
1108
1020
|
additions: r,
|
|
1109
1021
|
deletions: i
|
|
1110
1022
|
}));
|
|
1111
1023
|
}
|
|
1112
|
-
function
|
|
1113
|
-
return
|
|
1024
|
+
function zo(t) {
|
|
1025
|
+
return hn(t).map((e) => ({
|
|
1114
1026
|
kind: "diff",
|
|
1115
|
-
fileName:
|
|
1027
|
+
fileName: Rt(e.filePath),
|
|
1116
1028
|
filePath: e.filePath,
|
|
1117
1029
|
additions: e.additions,
|
|
1118
1030
|
deletions: e.deletions
|
|
1119
1031
|
}));
|
|
1120
1032
|
}
|
|
1121
|
-
function
|
|
1122
|
-
return
|
|
1033
|
+
function Qo(t) {
|
|
1034
|
+
return hn(t).map((e) => e.filePath);
|
|
1123
1035
|
}
|
|
1124
|
-
const
|
|
1036
|
+
const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Wo = (t, e, n) => {
|
|
1125
1037
|
if (t.startsWith(" ")) {
|
|
1126
|
-
const
|
|
1127
|
-
e.push(
|
|
1038
|
+
const s = t.slice(1);
|
|
1039
|
+
e.push(s), n.push(s);
|
|
1128
1040
|
return;
|
|
1129
1041
|
}
|
|
1130
1042
|
if (t.startsWith("-")) {
|
|
@@ -1132,30 +1044,30 @@ const jn = (t) => Rt(t) || t.startsWith("diff --git "), Tr = (t) => t.startsWith
|
|
|
1132
1044
|
return;
|
|
1133
1045
|
}
|
|
1134
1046
|
t.startsWith("+") && n.push(t.slice(1));
|
|
1135
|
-
},
|
|
1136
|
-
let
|
|
1137
|
-
for (;
|
|
1138
|
-
const r = t[
|
|
1139
|
-
if (
|
|
1047
|
+
}, Ho = (t, e, n, s) => {
|
|
1048
|
+
let o = e;
|
|
1049
|
+
for (; o < t.length; ) {
|
|
1050
|
+
const r = t[o] || "";
|
|
1051
|
+
if (gn(r) || Mt(r) || qo(r))
|
|
1140
1052
|
break;
|
|
1141
|
-
|
|
1053
|
+
Wo(r, n, s), o += 1;
|
|
1142
1054
|
}
|
|
1143
|
-
return (n.length > 0 ||
|
|
1144
|
-
},
|
|
1145
|
-
const n =
|
|
1146
|
-
if (!
|
|
1055
|
+
return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
|
|
1056
|
+
}, Vo = (t, e) => {
|
|
1057
|
+
const n = Xe((t[e] || "").slice(4)), s = t[e + 1] || "";
|
|
1058
|
+
if (!vt(s)) return {
|
|
1147
1059
|
nextIndex: e + 1
|
|
1148
1060
|
};
|
|
1149
|
-
const r =
|
|
1061
|
+
const r = Xe(s.slice(4)) ?? n ?? "", i = [], l = [];
|
|
1150
1062
|
let a = e + 2;
|
|
1151
1063
|
for (; a < t.length; ) {
|
|
1152
1064
|
const u = t[a] || "";
|
|
1153
|
-
if (
|
|
1154
|
-
if (!
|
|
1065
|
+
if (gn(u)) break;
|
|
1066
|
+
if (!Mt(u)) {
|
|
1155
1067
|
a += 1;
|
|
1156
1068
|
continue;
|
|
1157
1069
|
}
|
|
1158
|
-
a =
|
|
1070
|
+
a = Ho(t, a + 1, i, l);
|
|
1159
1071
|
}
|
|
1160
1072
|
return {
|
|
1161
1073
|
nextIndex: a,
|
|
@@ -1168,25 +1080,25 @@ const jn = (t) => Rt(t) || t.startsWith("diff --git "), Tr = (t) => t.startsWith
|
|
|
1168
1080
|
}
|
|
1169
1081
|
};
|
|
1170
1082
|
};
|
|
1171
|
-
function
|
|
1083
|
+
function No(t) {
|
|
1172
1084
|
if (!t || typeof t != "string") return [];
|
|
1173
1085
|
const e = t.split(/\r?\n/), n = [];
|
|
1174
|
-
let
|
|
1175
|
-
for (;
|
|
1176
|
-
const
|
|
1177
|
-
if (!
|
|
1178
|
-
|
|
1086
|
+
let s = 0;
|
|
1087
|
+
for (; s < e.length; ) {
|
|
1088
|
+
const o = e[s] || "";
|
|
1089
|
+
if (!Ze(o)) {
|
|
1090
|
+
s += 1;
|
|
1179
1091
|
continue;
|
|
1180
1092
|
}
|
|
1181
1093
|
const {
|
|
1182
1094
|
nextIndex: r,
|
|
1183
1095
|
preview: i
|
|
1184
|
-
} =
|
|
1185
|
-
i && n.push(i),
|
|
1096
|
+
} = Vo(e, s);
|
|
1097
|
+
i && n.push(i), s = Math.max(r, s + 1);
|
|
1186
1098
|
}
|
|
1187
1099
|
return n;
|
|
1188
1100
|
}
|
|
1189
|
-
const
|
|
1101
|
+
const Uo = {
|
|
1190
1102
|
apply_patch: "Apply patch",
|
|
1191
1103
|
bash: "Run command",
|
|
1192
1104
|
edit: "Edit file",
|
|
@@ -1195,143 +1107,143 @@ const _r = {
|
|
|
1195
1107
|
read: "Read file",
|
|
1196
1108
|
skill: "Load skill",
|
|
1197
1109
|
todowrite: "Update todos"
|
|
1198
|
-
},
|
|
1110
|
+
}, Qt = {
|
|
1199
1111
|
error: "failed",
|
|
1200
1112
|
"output-error": "failed",
|
|
1201
1113
|
input_streaming: "running",
|
|
1202
1114
|
running: "running",
|
|
1203
1115
|
completed: "completed",
|
|
1204
1116
|
failed: "failed"
|
|
1205
|
-
},
|
|
1206
|
-
const e =
|
|
1207
|
-
return
|
|
1208
|
-
},
|
|
1117
|
+
}, bn = (t) => t.replace(/^tool-/, "").toLowerCase(), jo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ko = (t) => bn(t.tool ?? "tool"), Xo = (t) => {
|
|
1118
|
+
const e = bn(t);
|
|
1119
|
+
return Uo[e] ?? jo(e.replace(/_/g, " "));
|
|
1120
|
+
}, Go = (t) => {
|
|
1209
1121
|
const e = t.state?.status ?? t.status;
|
|
1210
1122
|
if (!e || typeof e != "string") return null;
|
|
1211
1123
|
const n = e.replace(/-/g, "_");
|
|
1212
|
-
return
|
|
1213
|
-
},
|
|
1124
|
+
return Qt[n] ? Qt[n] : n.includes("stream") ? "running" : null;
|
|
1125
|
+
}, yn = (t) => {
|
|
1214
1126
|
const e = t.state?.status ?? t.status;
|
|
1215
1127
|
return e === "error" || e === "output-error" || e === "failed";
|
|
1216
|
-
},
|
|
1128
|
+
}, ae = (t) => yn(t) ? {
|
|
1217
1129
|
type: "icon",
|
|
1218
1130
|
icon: "danger"
|
|
1219
1131
|
} : {
|
|
1220
1132
|
type: "icon",
|
|
1221
|
-
icon:
|
|
1222
|
-
},
|
|
1133
|
+
icon: mn(Ko(t))
|
|
1134
|
+
}, ce = (t, e, n, s) => {
|
|
1223
1135
|
const r = [{
|
|
1224
1136
|
kind: "text",
|
|
1225
|
-
text: n ??
|
|
1137
|
+
text: n ?? Xo(t.tool ?? "tool"),
|
|
1226
1138
|
bold: !0
|
|
1227
1139
|
}];
|
|
1228
1140
|
e && r.push({
|
|
1229
1141
|
kind: "text",
|
|
1230
1142
|
text: e,
|
|
1231
1143
|
muted: !0,
|
|
1232
|
-
...
|
|
1144
|
+
...s === "monospace" ? {
|
|
1233
1145
|
truncate: !0,
|
|
1234
1146
|
monospace: !0
|
|
1235
1147
|
} : {}
|
|
1236
1148
|
});
|
|
1237
|
-
const i =
|
|
1149
|
+
const i = Go(t);
|
|
1238
1150
|
return i && i !== "completed" && r.push({
|
|
1239
1151
|
kind: "text",
|
|
1240
1152
|
text: i,
|
|
1241
1153
|
muted: !0
|
|
1242
1154
|
}), r;
|
|
1243
|
-
},
|
|
1155
|
+
}, ye = (t) => {
|
|
1244
1156
|
const e = t.state?.input;
|
|
1245
1157
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
1246
|
-
},
|
|
1158
|
+
}, qe = (t) => {
|
|
1247
1159
|
const e = t.state?.output;
|
|
1248
1160
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
1249
|
-
},
|
|
1250
|
-
const n =
|
|
1251
|
-
return n ?
|
|
1252
|
-
},
|
|
1253
|
-
const e =
|
|
1254
|
-
return [
|
|
1255
|
-
},
|
|
1256
|
-
const e =
|
|
1161
|
+
}, I = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ze = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Yo = (t, e) => {
|
|
1162
|
+
const n = ze(t.state);
|
|
1163
|
+
return n ? ze(n[e]) : null;
|
|
1164
|
+
}, xn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Jo = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), Sn = (t) => {
|
|
1165
|
+
const e = qe(t);
|
|
1166
|
+
return [Yo(t, "metadata"), ze(e?.metadata)].filter(Boolean);
|
|
1167
|
+
}, Zo = (t) => {
|
|
1168
|
+
const e = ze(t);
|
|
1257
1169
|
if (!e) return null;
|
|
1258
|
-
const n =
|
|
1170
|
+
const n = I(e.filePath) ?? I(e.relativePath) ?? I(e.path);
|
|
1259
1171
|
return n ? {
|
|
1260
|
-
filePath:
|
|
1172
|
+
filePath: xn(n),
|
|
1261
1173
|
additions: typeof e.additions == "number" ? e.additions : 0,
|
|
1262
1174
|
deletions: typeof e.deletions == "number" ? e.deletions : 0,
|
|
1263
|
-
diff:
|
|
1264
|
-
before:
|
|
1265
|
-
after:
|
|
1175
|
+
diff: I(e.diff) ?? void 0,
|
|
1176
|
+
before: I(e.before) ?? void 0,
|
|
1177
|
+
after: I(e.after) ?? void 0
|
|
1266
1178
|
} : null;
|
|
1267
|
-
},
|
|
1179
|
+
}, wn = (t) => {
|
|
1268
1180
|
const e = [];
|
|
1269
|
-
for (const n of
|
|
1270
|
-
const
|
|
1271
|
-
for (const
|
|
1272
|
-
const r =
|
|
1181
|
+
for (const n of Sn(t)) {
|
|
1182
|
+
const s = Array.isArray(n.files) ? n.files : [];
|
|
1183
|
+
for (const o of s) {
|
|
1184
|
+
const r = Zo(o);
|
|
1273
1185
|
r && e.push(r);
|
|
1274
1186
|
}
|
|
1275
1187
|
}
|
|
1276
1188
|
return e;
|
|
1277
|
-
},
|
|
1278
|
-
const e =
|
|
1279
|
-
return Array.from(new Set(
|
|
1280
|
-
},
|
|
1281
|
-
const e =
|
|
1189
|
+
}, er = (t) => {
|
|
1190
|
+
const e = ye(t), s = (Array.isArray(e?.changes) ? e.changes : []).map((o) => I(ze(o)?.path)).filter((o) => !!o).map(xn);
|
|
1191
|
+
return Array.from(new Set(s));
|
|
1192
|
+
}, tr = (t) => {
|
|
1193
|
+
const e = ye(t), n = I(e?.diff);
|
|
1282
1194
|
if (n) return n;
|
|
1283
|
-
for (const r of
|
|
1284
|
-
const i =
|
|
1195
|
+
for (const r of Sn(t)) {
|
|
1196
|
+
const i = I(r.diff);
|
|
1285
1197
|
if (i) return i;
|
|
1286
1198
|
}
|
|
1287
|
-
const
|
|
1288
|
-
if (
|
|
1199
|
+
const s = wn(t).map((r) => r.diff).filter((r) => !!r);
|
|
1200
|
+
if (s.length > 0) return s.join(`
|
|
1289
1201
|
`);
|
|
1290
|
-
const
|
|
1291
|
-
return
|
|
1292
|
-
},
|
|
1202
|
+
const o = I(e?.patchText);
|
|
1203
|
+
return o && Jo(o) ? o : null;
|
|
1204
|
+
}, nr = (t) => {
|
|
1293
1205
|
const e = /* @__PURE__ */ new Set(), n = [];
|
|
1294
|
-
for (const
|
|
1295
|
-
e.has(
|
|
1206
|
+
for (const s of t)
|
|
1207
|
+
e.has(s.filePath) || (e.add(s.filePath), n.push({
|
|
1296
1208
|
kind: "diff",
|
|
1297
|
-
fileName:
|
|
1298
|
-
filePath:
|
|
1299
|
-
additions:
|
|
1300
|
-
deletions:
|
|
1209
|
+
fileName: Rt(s.filePath),
|
|
1210
|
+
filePath: s.filePath,
|
|
1211
|
+
additions: s.additions,
|
|
1212
|
+
deletions: s.deletions
|
|
1301
1213
|
}));
|
|
1302
1214
|
return n;
|
|
1303
|
-
},
|
|
1304
|
-
const e =
|
|
1305
|
-
return
|
|
1306
|
-
},
|
|
1215
|
+
}, sr = (t) => Array.from(new Set(t.map((e) => e.filePath))), et = (t) => {
|
|
1216
|
+
const e = qe(t);
|
|
1217
|
+
return I(t.state?.output) ?? I(e?.returnDisplay) ?? I(e?.preview) ?? I(e?.stdout) ?? I(e?.content);
|
|
1218
|
+
}, or = (t) => {
|
|
1307
1219
|
const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
|
|
1308
1220
|
return e ? {
|
|
1309
|
-
skillName:
|
|
1310
|
-
content:
|
|
1221
|
+
skillName: I(e[1]) ?? void 0,
|
|
1222
|
+
content: I(e[2]) ?? ""
|
|
1311
1223
|
} : null;
|
|
1312
|
-
},
|
|
1313
|
-
const e =
|
|
1314
|
-
return
|
|
1315
|
-
},
|
|
1224
|
+
}, rr = (t) => {
|
|
1225
|
+
const e = ye(t);
|
|
1226
|
+
return I(e?.name) ?? I(e?.skillName) ?? I(e?.skill) ?? I(e?.skill_name) ?? void 0;
|
|
1227
|
+
}, Pt = (t, e) => ({
|
|
1316
1228
|
kind: "link",
|
|
1317
|
-
text:
|
|
1229
|
+
text: Rt(t),
|
|
1318
1230
|
filePath: t,
|
|
1319
1231
|
...e ? {
|
|
1320
1232
|
variant: e
|
|
1321
1233
|
} : {}
|
|
1322
|
-
}),
|
|
1234
|
+
}), ue = (t, e) => !yn(t) || !t.state?.errorText ? e : [{
|
|
1323
1235
|
type: "comment",
|
|
1324
1236
|
text: t.state.errorText
|
|
1325
|
-
}, ...e],
|
|
1237
|
+
}, ...e], Tn = (t) => No(t ?? void 0).map((e) => ({
|
|
1326
1238
|
type: "diff",
|
|
1327
1239
|
language: "diff",
|
|
1328
1240
|
original: e.original,
|
|
1329
1241
|
modified: e.modified,
|
|
1330
1242
|
sideBySide: !1
|
|
1331
|
-
})),
|
|
1332
|
-
const e =
|
|
1333
|
-
r.length > 0 ?
|
|
1334
|
-
const i = [...
|
|
1243
|
+
})), ir = (t) => zo(t ?? void 0), lr = (t) => Qo(t ?? void 0), ar = (t) => {
|
|
1244
|
+
const e = tr(t), n = wn(t), s = er(t), o = ce(t, void 0, "Apply patch"), r = ir(e);
|
|
1245
|
+
r.length > 0 ? o.push(...r) : n.length > 0 ? o.push(...nr(n)) : o.push(...s.map((l) => Pt(l, "bubble")));
|
|
1246
|
+
const i = [...Tn(e)];
|
|
1335
1247
|
if (i.length === 0)
|
|
1336
1248
|
for (const l of n)
|
|
1337
1249
|
!l.before && !l.after || i.push({
|
|
@@ -1342,92 +1254,92 @@ const _r = {
|
|
|
1342
1254
|
sideBySide: !1
|
|
1343
1255
|
});
|
|
1344
1256
|
if (i.length === 0) {
|
|
1345
|
-
const l =
|
|
1346
|
-
l.length === 0 && l.push(...
|
|
1257
|
+
const l = lr(e);
|
|
1258
|
+
l.length === 0 && l.push(...sr(n)), l.length === 0 && l.push(...s), l.length > 0 && i.push({
|
|
1347
1259
|
type: "references",
|
|
1348
1260
|
references: l
|
|
1349
1261
|
});
|
|
1350
1262
|
}
|
|
1351
1263
|
return {
|
|
1352
|
-
indicator:
|
|
1353
|
-
title:
|
|
1354
|
-
blocks:
|
|
1264
|
+
indicator: ae(t),
|
|
1265
|
+
title: o,
|
|
1266
|
+
blocks: ue(t, i)
|
|
1355
1267
|
};
|
|
1356
|
-
},
|
|
1268
|
+
}, cr = (t, e) => [{
|
|
1357
1269
|
type: "diff",
|
|
1358
1270
|
language: "text",
|
|
1359
1271
|
original: t,
|
|
1360
1272
|
modified: e,
|
|
1361
1273
|
sideBySide: !1
|
|
1362
|
-
}],
|
|
1363
|
-
const e =
|
|
1364
|
-
|
|
1365
|
-
const l =
|
|
1274
|
+
}], ur = (t) => {
|
|
1275
|
+
const e = ye(t), n = qe(t), s = I(e?.filePath) ?? I(e?.file_path) ?? I(n?.filePath) ?? void 0, o = I(n?.oldString) ?? I(e?.old_string) ?? void 0, r = I(n?.newString) ?? I(e?.new_string) ?? void 0, i = ce(t, void 0, "Edit file");
|
|
1276
|
+
s && i.push(Pt(s));
|
|
1277
|
+
const l = o !== void 0 && r !== void 0 ? cr(o, r) : Tn(I(n?.diff));
|
|
1366
1278
|
return {
|
|
1367
|
-
indicator:
|
|
1279
|
+
indicator: ae(t),
|
|
1368
1280
|
title: i,
|
|
1369
|
-
blocks:
|
|
1281
|
+
blocks: ue(t, l)
|
|
1370
1282
|
};
|
|
1371
|
-
},
|
|
1283
|
+
}, dr = (t) => {
|
|
1372
1284
|
const {
|
|
1373
1285
|
buildBaseTitle: e,
|
|
1374
1286
|
buildIndicator: n,
|
|
1375
|
-
prependErrorBlock:
|
|
1287
|
+
prependErrorBlock: s
|
|
1376
1288
|
} = t;
|
|
1377
|
-
return (
|
|
1378
|
-
const r =
|
|
1289
|
+
return (o) => {
|
|
1290
|
+
const r = re(o.state?.output) ?? re(o.state?.metadata), i = dn(o.state?.input), l = i ? {
|
|
1379
1291
|
type: "question-form",
|
|
1380
1292
|
questions: i.questions
|
|
1381
1293
|
} : null;
|
|
1382
1294
|
if (!r && !l) return null;
|
|
1383
1295
|
const a = l ? `${l.questions.length} field${l.questions.length === 1 ? "" : "s"}` : void 0, u = r ? [] : [l];
|
|
1384
1296
|
return {
|
|
1385
|
-
indicator: n(
|
|
1386
|
-
title: e(
|
|
1387
|
-
blocks: o
|
|
1297
|
+
indicator: n(o),
|
|
1298
|
+
title: e(o, a, "Question"),
|
|
1299
|
+
blocks: s(o, u),
|
|
1388
1300
|
expandable: !1
|
|
1389
1301
|
};
|
|
1390
1302
|
};
|
|
1391
|
-
},
|
|
1392
|
-
const e =
|
|
1393
|
-
return
|
|
1394
|
-
indicator:
|
|
1395
|
-
title:
|
|
1396
|
-
blocks:
|
|
1303
|
+
}, fr = (t) => {
|
|
1304
|
+
const e = ye(t), n = qe(t), s = I(e?.filePath) ?? I(e?.file_path) ?? I(e?.file) ?? I(n?.filePath) ?? I(n?.file) ?? I(n?.path) ?? void 0, o = ce(t, void 0, "Read file");
|
|
1305
|
+
return s && o.push(Pt(s)), {
|
|
1306
|
+
indicator: ae(t),
|
|
1307
|
+
title: o,
|
|
1308
|
+
blocks: ue(t, [])
|
|
1397
1309
|
};
|
|
1398
|
-
},
|
|
1399
|
-
const n =
|
|
1310
|
+
}, An = (t, e) => {
|
|
1311
|
+
const n = ye(t), s = qe(t), o = I(n?.command) ?? void 0, r = ce(t, o, e, "monospace"), i = [], l = et(t);
|
|
1400
1312
|
l && i.push({
|
|
1401
1313
|
type: "code",
|
|
1402
1314
|
language: "text",
|
|
1403
1315
|
code: l
|
|
1404
1316
|
});
|
|
1405
|
-
const a =
|
|
1317
|
+
const a = I(s?.stderr);
|
|
1406
1318
|
return a && a !== l && i.push({
|
|
1407
1319
|
type: "code",
|
|
1408
1320
|
language: "text",
|
|
1409
1321
|
code: a
|
|
1410
|
-
}), typeof
|
|
1322
|
+
}), typeof s?.exitCode == "number" && i.push({
|
|
1411
1323
|
type: "text",
|
|
1412
|
-
text: `Exit code: ${
|
|
1324
|
+
text: `Exit code: ${s.exitCode}`
|
|
1413
1325
|
}), {
|
|
1414
|
-
indicator:
|
|
1326
|
+
indicator: ae(t),
|
|
1415
1327
|
title: r,
|
|
1416
|
-
blocks:
|
|
1328
|
+
blocks: ue(t, i)
|
|
1417
1329
|
};
|
|
1418
|
-
},
|
|
1419
|
-
const e =
|
|
1330
|
+
}, pr = (t) => An(t, "Run command"), mr = (t) => An(t, "Shell"), hr = (t) => {
|
|
1331
|
+
const e = ye(t), n = et(t), s = I(e?.pattern) ?? void 0, o = ce(t, s, "Search files"), r = n ? [{
|
|
1420
1332
|
type: "code",
|
|
1421
1333
|
language: "text",
|
|
1422
1334
|
code: n
|
|
1423
1335
|
}] : [];
|
|
1424
1336
|
return {
|
|
1425
|
-
indicator:
|
|
1426
|
-
title:
|
|
1427
|
-
blocks:
|
|
1337
|
+
indicator: ae(t),
|
|
1338
|
+
title: o,
|
|
1339
|
+
blocks: ue(t, r)
|
|
1428
1340
|
};
|
|
1429
|
-
},
|
|
1430
|
-
const e =
|
|
1341
|
+
}, gr = (t) => {
|
|
1342
|
+
const e = ye(t), n = et(t), s = I(e?.pattern) ?? void 0, o = ce(t, s, "Find files"), r = [];
|
|
1431
1343
|
if (n) {
|
|
1432
1344
|
const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
|
|
1433
1345
|
i.length > 0 && r.push({
|
|
@@ -1436,63 +1348,63 @@ const _r = {
|
|
|
1436
1348
|
});
|
|
1437
1349
|
}
|
|
1438
1350
|
return {
|
|
1439
|
-
indicator:
|
|
1440
|
-
title:
|
|
1441
|
-
blocks:
|
|
1351
|
+
indicator: ae(t),
|
|
1352
|
+
title: o,
|
|
1353
|
+
blocks: ue(t, r)
|
|
1442
1354
|
};
|
|
1443
|
-
},
|
|
1444
|
-
const e =
|
|
1355
|
+
}, br = (t) => {
|
|
1356
|
+
const e = et(t), n = e ? or(e) : null, s = rr(t) ?? n?.skillName, o = ce(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
|
|
1445
1357
|
type: "code",
|
|
1446
1358
|
language: "markdown",
|
|
1447
1359
|
code: r
|
|
1448
1360
|
}] : [];
|
|
1449
1361
|
return {
|
|
1450
|
-
indicator:
|
|
1451
|
-
title:
|
|
1452
|
-
blocks:
|
|
1362
|
+
indicator: ae(t),
|
|
1363
|
+
title: o,
|
|
1364
|
+
blocks: ue(t, i)
|
|
1453
1365
|
};
|
|
1454
|
-
},
|
|
1455
|
-
const e =
|
|
1366
|
+
}, ht = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, kn = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, yr = (t) => {
|
|
1367
|
+
const e = kn(t);
|
|
1456
1368
|
if (!e) return null;
|
|
1457
|
-
const n =
|
|
1369
|
+
const n = ht(e.content) ?? ht(e.title);
|
|
1458
1370
|
if (!n) return null;
|
|
1459
|
-
const
|
|
1371
|
+
const s = ht(e.status);
|
|
1460
1372
|
return {
|
|
1461
1373
|
label: n,
|
|
1462
|
-
checked:
|
|
1374
|
+
checked: s === "completed"
|
|
1463
1375
|
};
|
|
1464
|
-
},
|
|
1376
|
+
}, qt = (t) => {
|
|
1465
1377
|
if (!t) return {
|
|
1466
1378
|
items: [],
|
|
1467
1379
|
explicit: !1
|
|
1468
1380
|
};
|
|
1469
1381
|
const e = (() => {
|
|
1470
1382
|
if (Array.isArray(t)) return t;
|
|
1471
|
-
const n =
|
|
1383
|
+
const n = kn(t);
|
|
1472
1384
|
return !n || !Array.isArray(n.todos) ? null : n.todos;
|
|
1473
1385
|
})();
|
|
1474
1386
|
return e ? {
|
|
1475
|
-
items: e.map(
|
|
1387
|
+
items: e.map(yr).filter((n) => n !== null),
|
|
1476
1388
|
explicit: !0
|
|
1477
1389
|
} : {
|
|
1478
1390
|
items: [],
|
|
1479
1391
|
explicit: !1
|
|
1480
1392
|
};
|
|
1481
|
-
},
|
|
1393
|
+
}, xr = (t) => {
|
|
1482
1394
|
const {
|
|
1483
1395
|
buildBaseTitle: e,
|
|
1484
1396
|
buildIndicator: n,
|
|
1485
|
-
prependErrorBlock:
|
|
1397
|
+
prependErrorBlock: s
|
|
1486
1398
|
} = t;
|
|
1487
|
-
return (
|
|
1488
|
-
const r =
|
|
1399
|
+
return (o) => {
|
|
1400
|
+
const r = qt(o.state?.input), i = qt(o.state?.output), l = i.explicit ? i : r;
|
|
1489
1401
|
if (!l.explicit) return null;
|
|
1490
|
-
const a = l.items, u = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(
|
|
1402
|
+
const a = l.items, u = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
|
|
1491
1403
|
if (a.length === 0)
|
|
1492
1404
|
return {
|
|
1493
|
-
indicator: n(
|
|
1405
|
+
indicator: n(o),
|
|
1494
1406
|
title: d,
|
|
1495
|
-
blocks: o
|
|
1407
|
+
blocks: s(o, [{
|
|
1496
1408
|
type: "comment",
|
|
1497
1409
|
text: "No todos"
|
|
1498
1410
|
}])
|
|
@@ -1502,45 +1414,45 @@ const _r = {
|
|
|
1502
1414
|
items: a
|
|
1503
1415
|
}];
|
|
1504
1416
|
return {
|
|
1505
|
-
indicator: n(
|
|
1417
|
+
indicator: n(o),
|
|
1506
1418
|
title: d,
|
|
1507
|
-
blocks: o
|
|
1419
|
+
blocks: s(o, f)
|
|
1508
1420
|
};
|
|
1509
1421
|
};
|
|
1510
|
-
},
|
|
1511
|
-
buildBaseTitle:
|
|
1512
|
-
buildIndicator:
|
|
1513
|
-
prependErrorBlock:
|
|
1514
|
-
}),
|
|
1515
|
-
buildBaseTitle:
|
|
1516
|
-
buildIndicator:
|
|
1517
|
-
prependErrorBlock:
|
|
1518
|
-
}),
|
|
1519
|
-
apply_patch:
|
|
1520
|
-
bash:
|
|
1521
|
-
edit:
|
|
1522
|
-
glob:
|
|
1523
|
-
grep:
|
|
1524
|
-
question:
|
|
1525
|
-
read:
|
|
1526
|
-
shell:
|
|
1527
|
-
skill:
|
|
1528
|
-
todo_write:
|
|
1529
|
-
todowrite:
|
|
1530
|
-
}),
|
|
1422
|
+
}, Sr = dr({
|
|
1423
|
+
buildBaseTitle: ce,
|
|
1424
|
+
buildIndicator: ae,
|
|
1425
|
+
prependErrorBlock: ue
|
|
1426
|
+
}), Wt = xr({
|
|
1427
|
+
buildBaseTitle: ce,
|
|
1428
|
+
buildIndicator: ae,
|
|
1429
|
+
prependErrorBlock: ue
|
|
1430
|
+
}), Ht = () => ({
|
|
1431
|
+
apply_patch: ar,
|
|
1432
|
+
bash: pr,
|
|
1433
|
+
edit: ur,
|
|
1434
|
+
glob: gr,
|
|
1435
|
+
grep: hr,
|
|
1436
|
+
question: Sr,
|
|
1437
|
+
read: fr,
|
|
1438
|
+
shell: mr,
|
|
1439
|
+
skill: br,
|
|
1440
|
+
todo_write: Wt,
|
|
1441
|
+
todowrite: Wt
|
|
1442
|
+
}), Vt = {
|
|
1531
1443
|
error: "failed",
|
|
1532
1444
|
"output-error": "failed",
|
|
1533
1445
|
"input-streaming": "running"
|
|
1534
|
-
},
|
|
1535
|
-
const e =
|
|
1536
|
-
return
|
|
1537
|
-
},
|
|
1446
|
+
}, wr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Cn = (t) => {
|
|
1447
|
+
const e = Je(t ?? "tool").replace(/_/g, " ");
|
|
1448
|
+
return wr(e);
|
|
1449
|
+
}, In = (t) => t === "error" || t === "output-error", Tr = (t) => In(t.state?.status) ? {
|
|
1538
1450
|
type: "icon",
|
|
1539
1451
|
icon: "danger"
|
|
1540
1452
|
} : {
|
|
1541
1453
|
type: "icon",
|
|
1542
|
-
icon:
|
|
1543
|
-
},
|
|
1454
|
+
icon: mn(t.tool ?? "tool")
|
|
1455
|
+
}, Ar = (t) => !t || typeof t != "string" ? null : Vt[t] ? Vt[t] : t.includes("stream") ? "running" : null, kr = (t) => {
|
|
1544
1456
|
if (typeof t == "string") return t;
|
|
1545
1457
|
if (t == null) return null;
|
|
1546
1458
|
try {
|
|
@@ -1548,31 +1460,31 @@ const _r = {
|
|
|
1548
1460
|
} catch {
|
|
1549
1461
|
return null;
|
|
1550
1462
|
}
|
|
1551
|
-
},
|
|
1552
|
-
const n =
|
|
1463
|
+
}, St = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 || t.every(St) : typeof t == "object" ? Object.values(t).every(St) : !1, tt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, N = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Cr = (t) => N(t.mime_type) ?? N(t.mediaType) ?? N(t.mimeType), Nt = (t) => !!t?.startsWith("image/"), Ir = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, _n = (t, e) => {
|
|
1464
|
+
const n = tt(t);
|
|
1553
1465
|
if (!n) return null;
|
|
1554
|
-
const
|
|
1555
|
-
if (
|
|
1466
|
+
const s = Cr(n), o = N(n.data);
|
|
1467
|
+
if (o && Nt(s))
|
|
1556
1468
|
return {
|
|
1557
1469
|
type: "image",
|
|
1558
|
-
src: `data:${
|
|
1470
|
+
src: `data:${s};base64,${o}`,
|
|
1559
1471
|
alt: e
|
|
1560
1472
|
};
|
|
1561
1473
|
const r = N(n.url) ?? N(n.src);
|
|
1562
|
-
return r && (
|
|
1474
|
+
return r && (Nt(s) || Ir.test(r)) ? {
|
|
1563
1475
|
type: "image",
|
|
1564
1476
|
src: r,
|
|
1565
1477
|
alt: e
|
|
1566
1478
|
} : null;
|
|
1567
|
-
},
|
|
1568
|
-
const e =
|
|
1479
|
+
}, Rn = (t) => {
|
|
1480
|
+
const e = tt(t);
|
|
1569
1481
|
if (!e) return null;
|
|
1570
|
-
const n = N(e.path) ?? N(e.filePath) ?? N(e.filename),
|
|
1571
|
-
return !n ||
|
|
1482
|
+
const n = N(e.path) ?? N(e.filePath) ?? N(e.filename), s = N(e.content) ?? N(e.body) ?? N(e.text);
|
|
1483
|
+
return !n || s === null ? null : {
|
|
1572
1484
|
filePath: n,
|
|
1573
|
-
content:
|
|
1485
|
+
content: s
|
|
1574
1486
|
};
|
|
1575
|
-
},
|
|
1487
|
+
}, _r = {
|
|
1576
1488
|
css: "css",
|
|
1577
1489
|
html: "html",
|
|
1578
1490
|
js: "js",
|
|
@@ -1584,88 +1496,88 @@ const _r = {
|
|
|
1584
1496
|
tsx: "tsx",
|
|
1585
1497
|
yaml: "yaml",
|
|
1586
1498
|
yml: "yaml"
|
|
1587
|
-
},
|
|
1499
|
+
}, Rr = (t) => {
|
|
1588
1500
|
const e = t.split(".").pop()?.toLowerCase();
|
|
1589
|
-
return e ?
|
|
1590
|
-
},
|
|
1501
|
+
return e ? _r[e] ?? e : "text";
|
|
1502
|
+
}, Ut = (t, e) => e.length === 0 ? [] : [{
|
|
1591
1503
|
type: "text",
|
|
1592
1504
|
text: t
|
|
1593
|
-
}, ...e],
|
|
1505
|
+
}, ...e], vr = (t, e) => {
|
|
1594
1506
|
const n = [];
|
|
1595
|
-
for (const
|
|
1596
|
-
const
|
|
1507
|
+
for (const s of t) {
|
|
1508
|
+
const o = tt(s), r = N(o?.type);
|
|
1597
1509
|
if (r === "image") {
|
|
1598
|
-
const i =
|
|
1510
|
+
const i = _n(s, e);
|
|
1599
1511
|
i && n.push(i);
|
|
1600
1512
|
continue;
|
|
1601
1513
|
}
|
|
1602
1514
|
if (r === "text") {
|
|
1603
|
-
const i = N(
|
|
1515
|
+
const i = N(o?.text);
|
|
1604
1516
|
i && n.push({
|
|
1605
1517
|
type: "text",
|
|
1606
1518
|
text: i
|
|
1607
1519
|
});
|
|
1608
1520
|
continue;
|
|
1609
1521
|
}
|
|
1610
|
-
n.push(...
|
|
1522
|
+
n.push(...wt(s, e));
|
|
1611
1523
|
}
|
|
1612
1524
|
return n;
|
|
1613
|
-
},
|
|
1614
|
-
const e =
|
|
1525
|
+
}, Mr = (t) => {
|
|
1526
|
+
const e = Rn(t);
|
|
1615
1527
|
return e ? [{
|
|
1616
1528
|
type: "code",
|
|
1617
|
-
language:
|
|
1529
|
+
language: Rr(e.filePath),
|
|
1618
1530
|
code: e.content
|
|
1619
1531
|
}] : null;
|
|
1620
|
-
},
|
|
1621
|
-
const e =
|
|
1622
|
-
return !n && !
|
|
1532
|
+
}, Pr = (t) => {
|
|
1533
|
+
const e = tt(t), n = N(e?.attachment_name) ?? N(e?.attachmentName), s = N(e?.attachment_file_id) ?? N(e?.attachmentFileId);
|
|
1534
|
+
return !n && !s ? null : [{
|
|
1623
1535
|
type: "text",
|
|
1624
|
-
text: n ?? `Attachment ${
|
|
1536
|
+
text: n ?? `Attachment ${s}`
|
|
1625
1537
|
}];
|
|
1626
|
-
},
|
|
1627
|
-
if (
|
|
1628
|
-
const n =
|
|
1538
|
+
}, wt = (t, e) => {
|
|
1539
|
+
if (St(t)) return [];
|
|
1540
|
+
const n = _n(t, e);
|
|
1629
1541
|
if (n) return [n];
|
|
1630
|
-
if (Array.isArray(t)) return
|
|
1631
|
-
const
|
|
1632
|
-
if (o) return o;
|
|
1633
|
-
const s = fi(t);
|
|
1542
|
+
if (Array.isArray(t)) return vr(t, e);
|
|
1543
|
+
const s = Mr(t);
|
|
1634
1544
|
if (s) return s;
|
|
1635
|
-
const
|
|
1545
|
+
const o = Pr(t);
|
|
1546
|
+
if (o) return o;
|
|
1547
|
+
const r = kr(t);
|
|
1636
1548
|
return r?.trim() ? [{
|
|
1637
1549
|
type: "code",
|
|
1638
1550
|
language: typeof t == "string" ? "text" : "json",
|
|
1639
1551
|
code: r
|
|
1640
1552
|
}] : [];
|
|
1641
|
-
},
|
|
1642
|
-
const e = [], n =
|
|
1643
|
-
return
|
|
1553
|
+
}, Er = (t) => {
|
|
1554
|
+
const e = [], n = Cn(t.tool);
|
|
1555
|
+
return In(t.state?.status) && t.state?.errorText && e.push({
|
|
1644
1556
|
type: "comment",
|
|
1645
1557
|
text: t.state.errorText
|
|
1646
|
-
}), e.push(...
|
|
1647
|
-
},
|
|
1558
|
+
}), e.push(...Ut("Input", wt(t.state?.input, `${n} input`))), e.push(...Ut("Output", wt(t.state?.output, `${n} output`))), e;
|
|
1559
|
+
}, Dr = (t) => {
|
|
1648
1560
|
const e = [{
|
|
1649
1561
|
kind: "text",
|
|
1650
|
-
text:
|
|
1562
|
+
text: Cn(t.tool),
|
|
1651
1563
|
bold: !0
|
|
1652
|
-
}], n =
|
|
1564
|
+
}], n = Rn(t.state?.output);
|
|
1653
1565
|
n && e.push({
|
|
1654
1566
|
kind: "link",
|
|
1655
1567
|
text: n.filePath,
|
|
1656
1568
|
filePath: n.filePath
|
|
1657
1569
|
});
|
|
1658
|
-
const
|
|
1659
|
-
return
|
|
1570
|
+
const s = Ar(t.state?.status);
|
|
1571
|
+
return s && e.push({
|
|
1660
1572
|
kind: "text",
|
|
1661
|
-
text:
|
|
1573
|
+
text: s,
|
|
1662
1574
|
muted: !0
|
|
1663
1575
|
}), {
|
|
1664
|
-
indicator:
|
|
1576
|
+
indicator: Tr(t),
|
|
1665
1577
|
title: e,
|
|
1666
|
-
blocks:
|
|
1578
|
+
blocks: Er(t)
|
|
1667
1579
|
};
|
|
1668
|
-
},
|
|
1580
|
+
}, Br = (t) => t.kind === "text" || t.kind === "link" ? t.text.trim().length > 0 : t.kind === "diff" ? t.fileName.trim().length > 0 : !0, Fr = (t) => {
|
|
1669
1581
|
switch (t.type) {
|
|
1670
1582
|
case "comment":
|
|
1671
1583
|
case "code":
|
|
@@ -1685,83 +1597,83 @@ const _r = {
|
|
|
1685
1597
|
case "component":
|
|
1686
1598
|
return !0;
|
|
1687
1599
|
}
|
|
1688
|
-
},
|
|
1689
|
-
const e = t.title.some(
|
|
1600
|
+
}, Lr = (t) => {
|
|
1601
|
+
const e = t.title.some(Br), n = (t.blocks ?? []).some(Fr);
|
|
1690
1602
|
return e || n;
|
|
1691
|
-
},
|
|
1692
|
-
...
|
|
1603
|
+
}, $r = (t) => t ? {
|
|
1604
|
+
...Ht(),
|
|
1693
1605
|
...t
|
|
1694
|
-
} :
|
|
1606
|
+
} : Ht(), Or = (t, e) => {
|
|
1695
1607
|
const n = t.tool ?? "tool";
|
|
1696
|
-
for (const
|
|
1697
|
-
const
|
|
1698
|
-
if (
|
|
1608
|
+
for (const s of vo(n)) {
|
|
1609
|
+
const o = e[s];
|
|
1610
|
+
if (o) return o;
|
|
1699
1611
|
}
|
|
1700
|
-
},
|
|
1701
|
-
const
|
|
1702
|
-
if (
|
|
1703
|
-
const
|
|
1704
|
-
if (
|
|
1612
|
+
}, zr = (t, e, n) => {
|
|
1613
|
+
const s = Or(t, e);
|
|
1614
|
+
if (s) {
|
|
1615
|
+
const o = s(t, n);
|
|
1616
|
+
if (o) return o;
|
|
1705
1617
|
}
|
|
1706
|
-
return
|
|
1707
|
-
},
|
|
1708
|
-
const n =
|
|
1618
|
+
return Dr(t);
|
|
1619
|
+
}, Qr = (t, e) => {
|
|
1620
|
+
const n = $r(e?.toolRenderers);
|
|
1709
1621
|
return {
|
|
1710
|
-
items: t.map((
|
|
1622
|
+
items: t.map((o) => zr(o, n, e)).filter(Lr)
|
|
1711
1623
|
};
|
|
1712
|
-
},
|
|
1713
|
-
|
|
1624
|
+
}, vn = (t, e, n, s = !1) => {
|
|
1625
|
+
s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
|
|
1714
1626
|
};
|
|
1715
|
-
function
|
|
1627
|
+
function qr(t) {
|
|
1716
1628
|
const e = A(6), {
|
|
1717
1629
|
seg: n
|
|
1718
1630
|
} = t;
|
|
1719
|
-
let o;
|
|
1720
|
-
e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ c(rt.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
|
|
1721
1631
|
let s;
|
|
1722
|
-
e[
|
|
1632
|
+
e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
|
|
1633
|
+
let o;
|
|
1634
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = o) : o = e[3];
|
|
1723
1635
|
let r;
|
|
1724
|
-
return e[4] !==
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
] }), e[4] =
|
|
1636
|
+
return e[4] !== s ? (r = /* @__PURE__ */ k(Ee.Root, { width: "1.5rem", height: "1.5rem", children: [
|
|
1637
|
+
s,
|
|
1638
|
+
o
|
|
1639
|
+
] }), e[4] = s, e[5] = r) : r = e[5], r;
|
|
1728
1640
|
}
|
|
1729
|
-
function
|
|
1641
|
+
function Wr(t) {
|
|
1730
1642
|
const e = A(9), {
|
|
1731
1643
|
seg: n,
|
|
1732
|
-
onOpenFile:
|
|
1733
|
-
} = t,
|
|
1644
|
+
onOpenFile: s
|
|
1645
|
+
} = t, o = n.additions ?? 0, r = n.deletions ?? 0;
|
|
1734
1646
|
let i;
|
|
1735
|
-
e[0] !==
|
|
1647
|
+
e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
|
|
1736
1648
|
const a = n.filePath ?? n.fileName;
|
|
1737
|
-
|
|
1738
|
-
}, e[0] =
|
|
1649
|
+
s?.(a);
|
|
1650
|
+
}, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
|
|
1739
1651
|
let l;
|
|
1740
|
-
return e[4] !== n.fileName || e[5] !==
|
|
1652
|
+
return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ c(Cs, { fileName: n.fileName, additions: o, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = o, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
|
|
1741
1653
|
}
|
|
1742
|
-
function
|
|
1654
|
+
function Hr(t) {
|
|
1743
1655
|
const e = A(13), {
|
|
1744
1656
|
seg: n,
|
|
1745
|
-
onOpenFile:
|
|
1746
|
-
} = t,
|
|
1657
|
+
onOpenFile: s
|
|
1658
|
+
} = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
|
|
1747
1659
|
let u;
|
|
1748
|
-
e[0] !==
|
|
1660
|
+
e[0] !== s || e[1] !== n ? (u = (m) => vn(m, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
|
|
1749
1661
|
const d = n.muted ? "fg.muted" : "fg.blue-dark";
|
|
1750
1662
|
let f;
|
|
1751
1663
|
e[3] !== d ? (f = {
|
|
1752
1664
|
textDecoration: "underline",
|
|
1753
1665
|
color: d
|
|
1754
1666
|
}, e[3] = d, e[4] = f) : f = e[4];
|
|
1755
|
-
let
|
|
1756
|
-
return e[5] !==
|
|
1667
|
+
let p;
|
|
1668
|
+
return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== a || e[10] !== u || e[11] !== f ? (p = /* @__PURE__ */ c(Jt, { href: i, fontWeight: o, color: l, textDecoration: "none", cursor: a, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = l, e[9] = a, e[10] = u, e[11] = f, e[12] = p) : p = e[12], p;
|
|
1757
1669
|
}
|
|
1758
|
-
function
|
|
1670
|
+
function Vr(t) {
|
|
1759
1671
|
const e = A(12), {
|
|
1760
1672
|
seg: n,
|
|
1761
|
-
onOpenFile:
|
|
1762
|
-
} = t,
|
|
1673
|
+
onOpenFile: s
|
|
1674
|
+
} = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
|
|
1763
1675
|
let l;
|
|
1764
|
-
e[0] !==
|
|
1676
|
+
e[0] !== s || e[1] !== n ? (l = (f) => vn(f, n, s), e[0] = s, e[1] = n, e[2] = l) : l = e[2];
|
|
1765
1677
|
const a = n.muted ? "fg.muted" : "accent.primary";
|
|
1766
1678
|
let u;
|
|
1767
1679
|
e[3] !== a ? (u = {
|
|
@@ -1769,54 +1681,54 @@ function ki(t) {
|
|
|
1769
1681
|
textDecoration: "underline"
|
|
1770
1682
|
}, e[3] = a, e[4] = u) : u = e[4];
|
|
1771
1683
|
let d;
|
|
1772
|
-
return e[5] !==
|
|
1684
|
+
return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ c(Jt, { href: r, fontWeight: o, color: i, textDecoration: "underline", onClick: l, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = u, e[11] = d) : d = e[11], d;
|
|
1773
1685
|
}
|
|
1774
|
-
function
|
|
1686
|
+
function Nr(t) {
|
|
1775
1687
|
const e = A(14), {
|
|
1776
1688
|
seg: n,
|
|
1777
|
-
isClickable:
|
|
1778
|
-
} = t,
|
|
1689
|
+
isClickable: s
|
|
1690
|
+
} = t, o = n.bold ? "medium" : void 0, r = n.monospace ? "mono/XS" : void 0, i = n.truncate ? "0" : void 0, l = n.truncate ? "hidden" : void 0, a = n.truncate ? "ellipsis" : void 0, u = n.truncate ? "nowrap" : void 0, d = s && !n.muted ? "fg" : "fg.muted";
|
|
1779
1691
|
let f;
|
|
1780
1692
|
e[0] !== d ? (f = {
|
|
1781
1693
|
color: d
|
|
1782
1694
|
}, e[0] = d, e[1] = f) : f = e[1];
|
|
1783
|
-
let
|
|
1784
|
-
e[2] !== n.text || e[3] !==
|
|
1785
|
-
const
|
|
1695
|
+
let p;
|
|
1696
|
+
e[2] !== n.text || e[3] !== o || e[4] !== r || e[5] !== i || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== f ? (p = /* @__PURE__ */ c($e, { fontWeight: o, textStyle: r, color: "fg.muted", minW: i, overflow: l, textOverflow: a, whiteSpace: u, _groupHover: f, children: n.text }), e[2] = n.text, e[3] = o, e[4] = r, e[5] = i, e[6] = l, e[7] = a, e[8] = u, e[9] = f, e[10] = p) : p = e[10];
|
|
1697
|
+
const m = p;
|
|
1786
1698
|
if (!n.truncate)
|
|
1787
|
-
return
|
|
1699
|
+
return m;
|
|
1788
1700
|
let h;
|
|
1789
|
-
return e[11] !== n.text || e[12] !==
|
|
1701
|
+
return e[11] !== n.text || e[12] !== m ? (h = /* @__PURE__ */ c(Ct, { content: n.text, children: m }), e[11] = n.text, e[12] = m, e[13] = h) : h = e[13], h;
|
|
1790
1702
|
}
|
|
1791
|
-
function
|
|
1703
|
+
function Ur(t) {
|
|
1792
1704
|
const e = A(11), {
|
|
1793
1705
|
seg: n,
|
|
1794
|
-
isClickable:
|
|
1795
|
-
onOpenFile:
|
|
1706
|
+
isClickable: s,
|
|
1707
|
+
onOpenFile: o
|
|
1796
1708
|
} = t;
|
|
1797
1709
|
switch (n.kind) {
|
|
1798
1710
|
case "avatar": {
|
|
1799
1711
|
let r;
|
|
1800
|
-
return e[0] !== n ? (r = /* @__PURE__ */ c(
|
|
1712
|
+
return e[0] !== n ? (r = /* @__PURE__ */ c(qr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
|
|
1801
1713
|
}
|
|
1802
1714
|
case "diff": {
|
|
1803
1715
|
let r;
|
|
1804
|
-
return e[2] !==
|
|
1716
|
+
return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ c(Wr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
|
|
1805
1717
|
}
|
|
1806
1718
|
case "link": {
|
|
1807
1719
|
let r;
|
|
1808
|
-
return e[5] !==
|
|
1720
|
+
return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ c(Hr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ c(Vr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
|
|
1809
1721
|
}
|
|
1810
1722
|
case "text": {
|
|
1811
1723
|
let r;
|
|
1812
|
-
return e[8] !==
|
|
1724
|
+
return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ c(Nr, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
|
|
1813
1725
|
}
|
|
1814
1726
|
default:
|
|
1815
1727
|
return null;
|
|
1816
1728
|
}
|
|
1817
1729
|
}
|
|
1818
|
-
const
|
|
1819
|
-
function
|
|
1730
|
+
const he = Nn;
|
|
1731
|
+
function jr(t) {
|
|
1820
1732
|
const e = A(10), {
|
|
1821
1733
|
ind: n
|
|
1822
1734
|
} = t;
|
|
@@ -1824,216 +1736,216 @@ function vi(t) {
|
|
|
1824
1736
|
return null;
|
|
1825
1737
|
if (n.type === "icon") {
|
|
1826
1738
|
let i;
|
|
1827
|
-
e[0] !== n.icon ? (i =
|
|
1739
|
+
e[0] !== n.icon ? (i = Eo(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
|
|
1828
1740
|
const l = i;
|
|
1829
1741
|
let a;
|
|
1830
|
-
return e[2] !== l ? (a = /* @__PURE__ */ c(
|
|
1742
|
+
return e[2] !== l ? (a = /* @__PURE__ */ c(he.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ c(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = a) : a = e[3], a;
|
|
1831
1743
|
}
|
|
1832
|
-
let o;
|
|
1833
|
-
e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ c(rt.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
|
|
1834
1744
|
let s;
|
|
1835
|
-
e[
|
|
1745
|
+
e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
|
|
1746
|
+
let o;
|
|
1747
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = o) : o = e[7];
|
|
1836
1748
|
let r;
|
|
1837
|
-
return e[8] !==
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
] }) }), e[8] =
|
|
1749
|
+
return e[8] !== s ? (r = /* @__PURE__ */ c(he.Indicator, { children: /* @__PURE__ */ k(Ee.Root, { boxSize: "full", children: [
|
|
1750
|
+
s,
|
|
1751
|
+
o
|
|
1752
|
+
] }) }), e[8] = s, e[9] = r) : r = e[9], r;
|
|
1841
1753
|
}
|
|
1842
|
-
function
|
|
1754
|
+
function Kr(t) {
|
|
1843
1755
|
const e = A(5), {
|
|
1844
1756
|
code: n,
|
|
1845
|
-
language:
|
|
1846
|
-
} = t,
|
|
1757
|
+
language: s
|
|
1758
|
+
} = t, o = s ? `${s} code block` : "code block";
|
|
1847
1759
|
let r;
|
|
1848
|
-
e[0] !== n ? (r = /* @__PURE__ */ c(
|
|
1760
|
+
e[0] !== n ? (r = /* @__PURE__ */ c(P, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
|
|
1849
1761
|
let i;
|
|
1850
|
-
return e[2] !==
|
|
1762
|
+
return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ c(Ye, { background: "bg.code", color: "fg.muted", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ c(P, { as: "pre", padding: "sm", textStyle: "mono/XS", whiteSpace: "pre", "aria-label": o, children: r }) }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
|
|
1851
1763
|
}
|
|
1852
|
-
function
|
|
1764
|
+
function Xr(t) {
|
|
1853
1765
|
const e = A(38), {
|
|
1854
1766
|
b: n,
|
|
1855
|
-
onOpenFile:
|
|
1767
|
+
onOpenFile: s
|
|
1856
1768
|
} = t;
|
|
1857
1769
|
switch (n.type) {
|
|
1858
1770
|
case "comment": {
|
|
1859
|
-
let
|
|
1860
|
-
e[0] !== n.text ? (
|
|
1771
|
+
let o;
|
|
1772
|
+
e[0] !== n.text ? (o = /* @__PURE__ */ c(Y.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
|
|
1861
1773
|
let r;
|
|
1862
|
-
e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ c(
|
|
1774
|
+
e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ c(Y.Footer, { children: /* @__PURE__ */ k(Oe, { children: [
|
|
1863
1775
|
"👏 ",
|
|
1864
1776
|
n.reactions.clap
|
|
1865
1777
|
] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
|
|
1866
1778
|
let i;
|
|
1867
|
-
return e[4] !==
|
|
1868
|
-
|
|
1779
|
+
return e[4] !== o || e[5] !== r ? (i = /* @__PURE__ */ k(Y.Root, { children: [
|
|
1780
|
+
o,
|
|
1869
1781
|
r
|
|
1870
|
-
] }), e[4] =
|
|
1782
|
+
] }), e[4] = o, e[5] = r, e[6] = i) : i = e[6], i;
|
|
1871
1783
|
}
|
|
1872
1784
|
case "code": {
|
|
1873
|
-
let
|
|
1874
|
-
return e[7] !== n.code || e[8] !== n.language ? (
|
|
1785
|
+
let o;
|
|
1786
|
+
return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(Y.Body, { padding: "0", children: /* @__PURE__ */ c(Kr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
|
|
1875
1787
|
}
|
|
1876
1788
|
case "diff": {
|
|
1877
|
-
const
|
|
1789
|
+
const o = n.sideBySide ?? !1;
|
|
1878
1790
|
let r;
|
|
1879
|
-
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !==
|
|
1791
|
+
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(Y.Body, { padding: "0", children: /* @__PURE__ */ c(P, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ c(Is, { original: n.original, modified: n.modified, language: n.language, sideBySide: o, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = o, e[14] = r) : r = e[14], r;
|
|
1880
1792
|
}
|
|
1881
1793
|
case "text": {
|
|
1882
|
-
let
|
|
1883
|
-
return e[15] !== n.text ? (
|
|
1794
|
+
let o;
|
|
1795
|
+
return e[15] !== n.text ? (o = /* @__PURE__ */ c(Y.Root, { background: "transparent", children: /* @__PURE__ */ c(Y.Body, { padding: "sm", children: /* @__PURE__ */ c(U, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
|
|
1884
1796
|
}
|
|
1885
1797
|
case "todo-list": {
|
|
1886
|
-
let
|
|
1887
|
-
return e[17] !== n.items ? (
|
|
1798
|
+
let o;
|
|
1799
|
+
return e[17] !== n.items ? (o = /* @__PURE__ */ c(Ys, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
|
|
1888
1800
|
}
|
|
1889
1801
|
case "question-form": {
|
|
1890
|
-
let
|
|
1891
|
-
return e[19] !== n.questions ? (
|
|
1802
|
+
let o;
|
|
1803
|
+
return e[19] !== n.questions ? (o = /* @__PURE__ */ c(un, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
|
|
1892
1804
|
}
|
|
1893
1805
|
case "references": {
|
|
1894
|
-
let
|
|
1895
|
-
e[21] !== n.references ? (
|
|
1806
|
+
let o;
|
|
1807
|
+
e[21] !== n.references ? (o = n.references.map(Gr), e[21] = n.references, e[22] = o) : o = e[22];
|
|
1896
1808
|
let r;
|
|
1897
|
-
return e[23] !==
|
|
1809
|
+
return e[23] !== o ? (r = /* @__PURE__ */ c(j, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
|
|
1898
1810
|
}
|
|
1899
1811
|
case "image": {
|
|
1900
1812
|
if (!n.src.trim())
|
|
1901
1813
|
return null;
|
|
1902
|
-
let
|
|
1903
|
-
e[25] !== n.alt || e[26] !== n.src ? (
|
|
1814
|
+
let o;
|
|
1815
|
+
e[25] !== n.alt || e[26] !== n.src ? (o = /* @__PURE__ */ c(Zt, { src: n.src, alt: n.alt, maxH: "18rem", maxW: "full", objectFit: "contain", borderRadius: "sm", borderWidth: "1px", borderColor: "border.subtle" }), e[25] = n.alt, e[26] = n.src, e[27] = o) : o = e[27];
|
|
1904
1816
|
let r;
|
|
1905
|
-
e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ c(
|
|
1817
|
+
e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ c(U, { mt: "2xs", textStyle: "label/XS/regular", color: "fg.muted", children: n.caption }) : null, e[28] = n.caption, e[29] = r) : r = e[29];
|
|
1906
1818
|
let i;
|
|
1907
|
-
return e[30] !==
|
|
1908
|
-
|
|
1819
|
+
return e[30] !== o || e[31] !== r ? (i = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", background: "transparent", children: /* @__PURE__ */ k(Y.Body, { padding: "0", children: [
|
|
1820
|
+
o,
|
|
1909
1821
|
r
|
|
1910
|
-
] }) }), e[30] =
|
|
1822
|
+
] }) }), e[30] = o, e[31] = r, e[32] = i) : i = e[32], i;
|
|
1911
1823
|
}
|
|
1912
1824
|
case "component": {
|
|
1913
|
-
let
|
|
1914
|
-
e[33] !== n || e[34] !==
|
|
1915
|
-
onOpenFile:
|
|
1916
|
-
}), e[33] = n, e[34] =
|
|
1825
|
+
let o;
|
|
1826
|
+
e[33] !== n || e[34] !== s ? (o = n.render({
|
|
1827
|
+
onOpenFile: s
|
|
1828
|
+
}), e[33] = n, e[34] = s, e[35] = o) : o = e[35];
|
|
1917
1829
|
let r;
|
|
1918
|
-
return e[36] !==
|
|
1830
|
+
return e[36] !== o ? (r = /* @__PURE__ */ c(At, { children: o }), e[36] = o, e[37] = r) : r = e[37], r;
|
|
1919
1831
|
}
|
|
1920
1832
|
}
|
|
1921
1833
|
}
|
|
1922
|
-
function
|
|
1923
|
-
return /* @__PURE__ */ c(
|
|
1834
|
+
function Gr(t) {
|
|
1835
|
+
return /* @__PURE__ */ c(It, { fileName: t }, t);
|
|
1924
1836
|
}
|
|
1925
|
-
function
|
|
1837
|
+
function Yr(t) {
|
|
1926
1838
|
const e = A(23), {
|
|
1927
1839
|
item: n,
|
|
1928
|
-
itemKey:
|
|
1929
|
-
isOpen:
|
|
1840
|
+
itemKey: s,
|
|
1841
|
+
isOpen: o,
|
|
1930
1842
|
canExpand: r,
|
|
1931
1843
|
hasBlocks: i,
|
|
1932
1844
|
onToggle: l,
|
|
1933
1845
|
onOpenFile: a
|
|
1934
1846
|
} = t;
|
|
1935
1847
|
let u;
|
|
1936
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(
|
|
1848
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(he.Separator, {}), e[0] = u) : u = e[0];
|
|
1937
1849
|
let d;
|
|
1938
|
-
e[1] !== n.indicator ? (d = /* @__PURE__ */
|
|
1850
|
+
e[1] !== n.indicator ? (d = /* @__PURE__ */ k(he.Connector, { children: [
|
|
1939
1851
|
u,
|
|
1940
|
-
/* @__PURE__ */ c(
|
|
1852
|
+
/* @__PURE__ */ c(jr, { ind: n.indicator })
|
|
1941
1853
|
] }), e[1] = n.indicator, e[2] = d) : d = e[2];
|
|
1942
|
-
const f =
|
|
1943
|
-
let m;
|
|
1944
|
-
e[3] !== r || e[4] !== s || e[5] !== n.title || e[6] !== o || e[7] !== a || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ c(Oe.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(o) : void 0, children: /* @__PURE__ */ C(dt, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
|
|
1945
|
-
/* @__PURE__ */ c(dt, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, y) => /* @__PURE__ */ c(_i, { seg: b, isClickable: r, onOpenFile: a }, y)) }),
|
|
1946
|
-
r ? /* @__PURE__ */ c(dt, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: s ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
|
|
1947
|
-
color: "fg"
|
|
1948
|
-
}, children: /* @__PURE__ */ c(Ns, { size: 12 }) }) : null
|
|
1949
|
-
] }) }), e[3] = r, e[4] = s, e[5] = n.title, e[6] = o, e[7] = a, e[8] = l, e[9] = m) : m = e[9];
|
|
1854
|
+
const f = o ? "auto" : "20px";
|
|
1950
1855
|
let p;
|
|
1951
|
-
e[
|
|
1856
|
+
e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== a || e[8] !== l ? (p = n.title.length > 0 && /* @__PURE__ */ c(he.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k($e, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
|
|
1857
|
+
/* @__PURE__ */ c($e, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, x) => /* @__PURE__ */ c(Ur, { seg: b, isClickable: r, onOpenFile: a }, x)) }),
|
|
1858
|
+
r ? /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
|
|
1859
|
+
color: "fg"
|
|
1860
|
+
}, children: /* @__PURE__ */ c(ps, { size: 12 }) }) : null
|
|
1861
|
+
] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = a, e[8] = l, e[9] = p) : p = e[9];
|
|
1862
|
+
let m;
|
|
1863
|
+
e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== a ? (m = i ? /* @__PURE__ */ c(P, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ c(P, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, x) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Xr, { b, onOpenFile: a }) }, x)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = a, e[14] = m) : m = e[14];
|
|
1952
1864
|
let h;
|
|
1953
|
-
e[15] !== f || e[16] !==
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
] }), e[15] = f, e[16] =
|
|
1865
|
+
e[15] !== f || e[16] !== p || e[17] !== m ? (h = /* @__PURE__ */ k(he.Content, { h: f, children: [
|
|
1866
|
+
p,
|
|
1867
|
+
m
|
|
1868
|
+
] }), e[15] = f, e[16] = p, e[17] = m, e[18] = h) : h = e[18];
|
|
1957
1869
|
let g;
|
|
1958
|
-
return e[19] !==
|
|
1870
|
+
return e[19] !== s || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(he.Item, { gap: "xs", children: [
|
|
1959
1871
|
d,
|
|
1960
1872
|
h
|
|
1961
|
-
] },
|
|
1873
|
+
] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
|
|
1962
1874
|
}
|
|
1963
|
-
function
|
|
1875
|
+
function Jr(t) {
|
|
1964
1876
|
const e = A(11), {
|
|
1965
1877
|
data: n,
|
|
1966
|
-
onOpenFile:
|
|
1878
|
+
onOpenFile: s
|
|
1967
1879
|
} = t;
|
|
1968
|
-
let
|
|
1969
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1970
|
-
const [r, i] = V(
|
|
1880
|
+
let o;
|
|
1881
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
|
|
1882
|
+
const [r, i] = V(o), l = Zr;
|
|
1971
1883
|
let a;
|
|
1972
|
-
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (
|
|
1973
|
-
i((
|
|
1974
|
-
...
|
|
1975
|
-
[
|
|
1884
|
+
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (p) => {
|
|
1885
|
+
i((m) => ({
|
|
1886
|
+
...m,
|
|
1887
|
+
[p]: !m[p]
|
|
1976
1888
|
}));
|
|
1977
1889
|
}, e[1] = a) : a = e[1];
|
|
1978
1890
|
const u = a;
|
|
1979
1891
|
let d;
|
|
1980
|
-
if (e[2] !== n.items || e[3] !== r || e[4] !==
|
|
1981
|
-
let
|
|
1982
|
-
e[6] !== r || e[7] !==
|
|
1983
|
-
const g = l(
|
|
1984
|
-
return /* @__PURE__ */ c(
|
|
1985
|
-
}, e[6] = r, e[7] =
|
|
1892
|
+
if (e[2] !== n.items || e[3] !== r || e[4] !== s) {
|
|
1893
|
+
let p;
|
|
1894
|
+
e[6] !== r || e[7] !== s ? (p = (m, h) => {
|
|
1895
|
+
const g = l(m, h), b = (m.blocks?.length ?? 0) > 0, x = (m.expandable ?? !0) && b, y = x ? r[g] ?? !1 : b;
|
|
1896
|
+
return /* @__PURE__ */ c(Yr, { item: m, itemKey: g, isOpen: y, canExpand: x, hasBlocks: b, onToggle: u, onOpenFile: s }, g);
|
|
1897
|
+
}, e[6] = r, e[7] = s, e[8] = p) : p = e[8], d = n.items.map(p), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
|
|
1986
1898
|
} else
|
|
1987
1899
|
d = e[5];
|
|
1988
1900
|
let f;
|
|
1989
|
-
return e[9] !== d ? (f = /* @__PURE__ */ c(
|
|
1901
|
+
return e[9] !== d ? (f = /* @__PURE__ */ c(he.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
|
|
1990
1902
|
}
|
|
1991
|
-
function
|
|
1903
|
+
function Zr(t, e) {
|
|
1992
1904
|
return t.id ? `id:${t.id}` : `idx:${e}`;
|
|
1993
1905
|
}
|
|
1994
|
-
const
|
|
1906
|
+
const ei = (t) => Je(t.tool ?? "").replace(/_/g, "") === "question", ti = (t) => {
|
|
1995
1907
|
const e = t.state?.output;
|
|
1996
1908
|
return typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.length > 0 : e && typeof e == "object" ? Object.keys(e).length > 0 : e != null;
|
|
1997
1909
|
};
|
|
1998
|
-
function
|
|
1910
|
+
function ni(t) {
|
|
1999
1911
|
const e = A(8), {
|
|
2000
1912
|
invocations: n,
|
|
2001
|
-
labeledBlocks:
|
|
2002
|
-
hideQuestionForms:
|
|
1913
|
+
labeledBlocks: s,
|
|
1914
|
+
hideQuestionForms: o,
|
|
2003
1915
|
onOpenFile: r
|
|
2004
|
-
} = t, i =
|
|
1916
|
+
} = t, i = o === void 0 ? !1 : o;
|
|
2005
1917
|
let l, a;
|
|
2006
|
-
if (e[0] !== i || e[1] !== n || e[2] !==
|
|
1918
|
+
if (e[0] !== i || e[1] !== n || e[2] !== s) {
|
|
2007
1919
|
a = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
2008
1920
|
e: {
|
|
2009
|
-
const f = i ? n.filter(
|
|
1921
|
+
const f = i ? n.filter(si) : n;
|
|
2010
1922
|
if (f.length === 0) {
|
|
2011
1923
|
a = null;
|
|
2012
1924
|
break e;
|
|
2013
1925
|
}
|
|
2014
|
-
l =
|
|
2015
|
-
labeledBlocks:
|
|
1926
|
+
l = Qr(f, {
|
|
1927
|
+
labeledBlocks: s
|
|
2016
1928
|
});
|
|
2017
1929
|
}
|
|
2018
|
-
e[0] = i, e[1] = n, e[2] =
|
|
1930
|
+
e[0] = i, e[1] = n, e[2] = s, e[3] = l, e[4] = a;
|
|
2019
1931
|
} else
|
|
2020
1932
|
l = e[3], a = e[4];
|
|
2021
1933
|
if (a !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
2022
1934
|
return a;
|
|
2023
1935
|
const u = l;
|
|
2024
1936
|
let d;
|
|
2025
|
-
return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ c(
|
|
1937
|
+
return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ c(Jr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
|
|
2026
1938
|
}
|
|
2027
|
-
function
|
|
2028
|
-
return !
|
|
1939
|
+
function si(t) {
|
|
1940
|
+
return !ei(t) || ti(t);
|
|
2029
1941
|
}
|
|
2030
|
-
const
|
|
1942
|
+
const oi = (t) => t.type === "tool", Et = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", ri = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, ii = (t) => t.mediaType?.startsWith("image/") || ri.test(Et(t)), li = (t) => ii(t) ? /* @__PURE__ */ c(Zt, { src: t.url, alt: `${Et(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, ai = (t, e) => {
|
|
2031
1943
|
if (e) {
|
|
2032
1944
|
e(t.url);
|
|
2033
1945
|
return;
|
|
2034
1946
|
}
|
|
2035
1947
|
typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
|
|
2036
|
-
},
|
|
1948
|
+
}, ci = (t) => {
|
|
2037
1949
|
if (t.message && t.message.trim().length > 0)
|
|
2038
1950
|
return t.message;
|
|
2039
1951
|
const {
|
|
@@ -2049,371 +1961,371 @@ const zi = (t) => t.type === "tool", dn = (t) => t.filename ?? t.url.split("/").
|
|
|
2049
1961
|
default:
|
|
2050
1962
|
return "An error occurred.";
|
|
2051
1963
|
}
|
|
2052
|
-
},
|
|
1964
|
+
}, ui = {
|
|
2053
1965
|
info: "blue",
|
|
2054
1966
|
warning: "orange",
|
|
2055
1967
|
error: "red",
|
|
2056
1968
|
success: "green",
|
|
2057
1969
|
loading: "blue"
|
|
2058
|
-
},
|
|
1970
|
+
}, di = (t, e) => {
|
|
2059
1971
|
const n = [];
|
|
2060
|
-
let
|
|
2061
|
-
for (;
|
|
2062
|
-
const
|
|
2063
|
-
if (!
|
|
2064
|
-
n.push(
|
|
1972
|
+
let s = e;
|
|
1973
|
+
for (; s < t.length; ) {
|
|
1974
|
+
const o = t[s];
|
|
1975
|
+
if (!oi(o)) break;
|
|
1976
|
+
n.push(o), s += 1;
|
|
2065
1977
|
}
|
|
2066
1978
|
return {
|
|
2067
1979
|
invocations: n,
|
|
2068
|
-
nextIndex:
|
|
1980
|
+
nextIndex: s - 1
|
|
2069
1981
|
};
|
|
2070
1982
|
};
|
|
2071
|
-
function
|
|
1983
|
+
function Mn(t) {
|
|
2072
1984
|
const e = A(8), {
|
|
2073
1985
|
message: n,
|
|
2074
|
-
hideQuestionForms:
|
|
2075
|
-
onOpenFile:
|
|
1986
|
+
hideQuestionForms: s,
|
|
1987
|
+
onOpenFile: o,
|
|
2076
1988
|
toolInvocationTimeline: r
|
|
2077
|
-
} = t, i =
|
|
1989
|
+
} = t, i = s === void 0 ? !1 : s, l = r ?? ni;
|
|
2078
1990
|
let a;
|
|
2079
1991
|
e[0] !== n.parts ? (a = n.parts ?? [], e[0] = n.parts, e[1] = a) : a = e[1];
|
|
2080
1992
|
const u = a;
|
|
2081
1993
|
let d;
|
|
2082
|
-
if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !==
|
|
1994
|
+
if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== o || e[6] !== u) {
|
|
2083
1995
|
const f = [];
|
|
2084
|
-
for (let
|
|
2085
|
-
const
|
|
2086
|
-
e: switch (
|
|
1996
|
+
for (let p = 0; p < u.length; p = p + 1, p) {
|
|
1997
|
+
const m = u[p], h = `${n.id}-${p}`;
|
|
1998
|
+
e: switch (m.type) {
|
|
2087
1999
|
case "text": {
|
|
2088
|
-
f.push(/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
2000
|
+
f.push(/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(Ro, { children: m.text }) }, h));
|
|
2089
2001
|
break e;
|
|
2090
2002
|
}
|
|
2091
2003
|
case "reasoning": {
|
|
2092
|
-
f.push(/* @__PURE__ */ c(
|
|
2004
|
+
f.push(/* @__PURE__ */ c(P, { padding: "0", css: {
|
|
2093
2005
|
"& .rich-text, & .rich-text *": {
|
|
2094
2006
|
color: "fg.subtle !important",
|
|
2095
2007
|
fontSize: ".75rem !important",
|
|
2096
2008
|
fontWeight: "normal !important"
|
|
2097
2009
|
}
|
|
2098
|
-
}, children: /* @__PURE__ */ c(
|
|
2010
|
+
}, children: /* @__PURE__ */ c(rn, { defaultState: m.text, fullWidth: !0 }) }, h));
|
|
2099
2011
|
break e;
|
|
2100
2012
|
}
|
|
2101
2013
|
case "tool": {
|
|
2102
2014
|
const {
|
|
2103
2015
|
invocations: g,
|
|
2104
2016
|
nextIndex: b
|
|
2105
|
-
} =
|
|
2106
|
-
|
|
2017
|
+
} = di(u, p);
|
|
2018
|
+
p = b, f.push(/* @__PURE__ */ c(P, { width: "full", children: /* @__PURE__ */ c(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
|
|
2107
2019
|
break e;
|
|
2108
2020
|
}
|
|
2109
2021
|
case "file": {
|
|
2110
|
-
f.push(/* @__PURE__ */ c(
|
|
2022
|
+
f.push(/* @__PURE__ */ c(P, { width: "fit-content", children: /* @__PURE__ */ c(It, { fileName: Et(m), size: "sm", tone: "neutral", icon: li(m), onSelect: () => ai(m, o) }) }, h));
|
|
2111
2023
|
break e;
|
|
2112
2024
|
}
|
|
2113
2025
|
case "error": {
|
|
2114
|
-
f.push(/* @__PURE__ */ c(
|
|
2026
|
+
f.push(/* @__PURE__ */ c(P, { py: "2", width: "full", children: /* @__PURE__ */ c(Ft, { borderRadius: "xs", status: "error", colorPalette: "red", title: ci(m), size: "sm" }) }, h));
|
|
2115
2027
|
break e;
|
|
2116
2028
|
}
|
|
2117
2029
|
case "token_usage":
|
|
2118
2030
|
break e;
|
|
2119
2031
|
case "alert": {
|
|
2120
|
-
f.push(/* @__PURE__ */ c(
|
|
2032
|
+
f.push(/* @__PURE__ */ c(P, { width: "full", children: /* @__PURE__ */ c(Ft, { borderRadius: "xs", status: m.status === "loading" ? "info" : m.status, colorPalette: ui[m.status], title: m.title, icon: m.status === "loading" ? /* @__PURE__ */ c(kt, { size: "sm" }) : void 0, size: "sm", children: m.message }) }, h));
|
|
2121
2033
|
break e;
|
|
2122
2034
|
}
|
|
2123
2035
|
default:
|
|
2124
2036
|
f.push(null);
|
|
2125
2037
|
}
|
|
2126
2038
|
}
|
|
2127
|
-
d = /* @__PURE__ */ c(
|
|
2039
|
+
d = /* @__PURE__ */ c(At, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
|
|
2128
2040
|
} else
|
|
2129
2041
|
d = e[7];
|
|
2130
2042
|
return d;
|
|
2131
2043
|
}
|
|
2132
|
-
const
|
|
2044
|
+
const fi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Pn = (t) => t.text.trim().length > 0, pi = (t) => t.title.trim().length > 0 || !!t.message?.trim(), mi = (t) => {
|
|
2133
2045
|
switch (t.type) {
|
|
2134
2046
|
case "text":
|
|
2135
2047
|
case "reasoning":
|
|
2136
|
-
return
|
|
2048
|
+
return Pn(t);
|
|
2137
2049
|
case "tool":
|
|
2138
2050
|
case "file":
|
|
2139
2051
|
case "error":
|
|
2140
2052
|
return !0;
|
|
2141
2053
|
case "alert":
|
|
2142
|
-
return
|
|
2054
|
+
return pi(t);
|
|
2143
2055
|
default:
|
|
2144
2056
|
return !1;
|
|
2145
2057
|
}
|
|
2146
|
-
},
|
|
2058
|
+
}, hi = (t) => t.type === "reasoning" || t.type === "tool", gi = (t) => t.role === "user" || t.parts.length === 0 ? !1 : t.parts.every(hi), bi = (t) => {
|
|
2147
2059
|
if (t.length === 0) return null;
|
|
2148
2060
|
const [e, ...n] = t;
|
|
2149
2061
|
return e ? {
|
|
2150
2062
|
...e,
|
|
2151
2063
|
role: "assistant",
|
|
2152
|
-
parts: t.flatMap((
|
|
2064
|
+
parts: t.flatMap((s) => s.parts),
|
|
2153
2065
|
modelId: n.at(-1)?.modelId ?? e.modelId,
|
|
2154
2066
|
providerId: n.at(-1)?.providerId ?? e.providerId
|
|
2155
2067
|
} : null;
|
|
2156
|
-
},
|
|
2068
|
+
}, yi = (t, e = {}) => {
|
|
2157
2069
|
const n = [];
|
|
2158
|
-
let
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2070
|
+
let s = [];
|
|
2071
|
+
const o = () => {
|
|
2072
|
+
s = [];
|
|
2161
2073
|
};
|
|
2162
2074
|
for (const r of t) {
|
|
2163
|
-
const i = (r.parts ?? []).filter(
|
|
2075
|
+
const i = (r.parts ?? []).filter(mi);
|
|
2164
2076
|
if (i.length === 0) continue;
|
|
2165
2077
|
const l = {
|
|
2166
2078
|
...r,
|
|
2167
2079
|
parts: i
|
|
2168
2080
|
};
|
|
2169
2081
|
if (l.role === "user") {
|
|
2170
|
-
|
|
2082
|
+
o(), n.push(l);
|
|
2171
2083
|
continue;
|
|
2172
2084
|
}
|
|
2173
|
-
if (
|
|
2174
|
-
|
|
2085
|
+
if (gi(l)) {
|
|
2086
|
+
s.push(l);
|
|
2175
2087
|
continue;
|
|
2176
2088
|
}
|
|
2177
|
-
if (
|
|
2089
|
+
if (s.length > 0) {
|
|
2178
2090
|
n.push({
|
|
2179
2091
|
...l,
|
|
2180
|
-
parts: [...
|
|
2181
|
-
}),
|
|
2092
|
+
parts: [...s.flatMap((a) => a.parts), ...l.parts]
|
|
2093
|
+
}), o();
|
|
2182
2094
|
continue;
|
|
2183
2095
|
}
|
|
2184
2096
|
n.push(l);
|
|
2185
2097
|
}
|
|
2186
|
-
if (e.streaming &&
|
|
2187
|
-
const r =
|
|
2098
|
+
if (e.streaming && s.length > 0) {
|
|
2099
|
+
const r = bi(s);
|
|
2188
2100
|
r && n.push(r);
|
|
2189
2101
|
}
|
|
2190
2102
|
return n;
|
|
2191
|
-
},
|
|
2103
|
+
}, En = (t) => {
|
|
2192
2104
|
const e = t.at(-1);
|
|
2193
|
-
return e?.role !== "assistant" ? null : e.parts.some((
|
|
2194
|
-
},
|
|
2105
|
+
return e?.role !== "assistant" ? null : e.parts.some((s) => s.type === "text" && Pn(s)) ? e.id : null;
|
|
2106
|
+
}, xi = (t) => {
|
|
2195
2107
|
const e = [], n = [];
|
|
2196
|
-
for (const
|
|
2197
|
-
|
|
2198
|
-
userMessage:
|
|
2108
|
+
for (const s of t)
|
|
2109
|
+
s.role === "user" ? e.push({
|
|
2110
|
+
userMessage: s,
|
|
2199
2111
|
responses: []
|
|
2200
|
-
}) : e.length > 0 ? e[e.length - 1].responses.push(
|
|
2112
|
+
}) : e.length > 0 ? e[e.length - 1].responses.push(s) : n.push(s);
|
|
2201
2113
|
return {
|
|
2202
2114
|
groups: e,
|
|
2203
2115
|
leadingResponses: n
|
|
2204
2116
|
};
|
|
2205
|
-
},
|
|
2117
|
+
}, Dn = (t) => {
|
|
2206
2118
|
const e = A(18), {
|
|
2207
2119
|
message: n,
|
|
2208
|
-
streaming:
|
|
2209
|
-
hideQuestionForms:
|
|
2120
|
+
streaming: s,
|
|
2121
|
+
hideQuestionForms: o,
|
|
2210
2122
|
animate: r,
|
|
2211
2123
|
showAssistantActions: i
|
|
2212
|
-
} = t, l =
|
|
2124
|
+
} = t, l = o === void 0 ? !1 : o, a = r === void 0 ? !1 : r;
|
|
2213
2125
|
let u;
|
|
2214
|
-
e[0] !== n.role ? (u =
|
|
2215
|
-
const d = u, f = d === "user" || d === "assistant" && i,
|
|
2216
|
-
let
|
|
2217
|
-
e[2] !== l || e[3] !== n || e[4] !==
|
|
2126
|
+
e[0] !== n.role ? (u = fi(n.role), e[0] = n.role, e[1] = u) : u = e[1];
|
|
2127
|
+
const d = u, f = d === "user" || d === "assistant" && i, p = a ? fn : void 0;
|
|
2128
|
+
let m;
|
|
2129
|
+
e[2] !== l || e[3] !== n || e[4] !== s ? (m = /* @__PURE__ */ c(Mn, { message: n, streaming: s, hideQuestionForms: l }), e[2] = l, e[3] = n, e[4] = s, e[5] = m) : m = e[5];
|
|
2218
2130
|
let h;
|
|
2219
|
-
e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ c(
|
|
2131
|
+
e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ c(xt, { message: n, alwaysVisible: d === "user", copyAlwaysVisible: d !== "user" }) : null, e[6] = d, e[7] = n, e[8] = f, e[9] = h) : h = e[9];
|
|
2220
2132
|
let g;
|
|
2221
|
-
e[10] !== d || e[11] !==
|
|
2222
|
-
|
|
2133
|
+
e[10] !== d || e[11] !== m || e[12] !== h ? (g = /* @__PURE__ */ k(ge.Content, { from: d, children: [
|
|
2134
|
+
m,
|
|
2223
2135
|
h
|
|
2224
|
-
] }), e[10] = d, e[11] =
|
|
2136
|
+
] }), e[10] = d, e[11] = m, e[12] = h, e[13] = g) : g = e[13];
|
|
2225
2137
|
let b;
|
|
2226
|
-
return e[14] !== d || e[15] !==
|
|
2227
|
-
},
|
|
2138
|
+
return e[14] !== d || e[15] !== p || e[16] !== g ? (b = /* @__PURE__ */ c(ge.Root, { from: d, ...p, children: g }), e[14] = d, e[15] = p, e[16] = g, e[17] = b) : b = e[17], b;
|
|
2139
|
+
}, Si = (t) => {
|
|
2228
2140
|
const e = A(7), {
|
|
2229
2141
|
label: n,
|
|
2230
|
-
onClick:
|
|
2231
|
-
actionPanel:
|
|
2232
|
-
} = t, r =
|
|
2142
|
+
onClick: s,
|
|
2143
|
+
actionPanel: o
|
|
2144
|
+
} = t, r = o ? "space-between" : "flex-end";
|
|
2233
2145
|
let i;
|
|
2234
|
-
e[0] !== n || e[1] !==
|
|
2146
|
+
e[0] !== n || e[1] !== s ? (i = /* @__PURE__ */ c(Oe, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: s, children: n }), e[0] = n, e[1] = s, e[2] = i) : i = e[2];
|
|
2235
2147
|
let l;
|
|
2236
|
-
return e[3] !==
|
|
2237
|
-
|
|
2148
|
+
return e[3] !== o || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(be, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: r, alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", pointerEvents: "none", children: [
|
|
2149
|
+
o,
|
|
2238
2150
|
i
|
|
2239
|
-
] }), e[3] =
|
|
2240
|
-
},
|
|
2151
|
+
] }), e[3] = o, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
|
|
2152
|
+
}, wi = 360, Ti = 4, Ai = "min(10vh, 4rem)", Bn = "min(70dvh, calc(100dvh - 12rem), 22rem)", gt = 1, ki = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
|
|
2241
2153
|
lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
|
|
2242
2154
|
textLength: e.textLength + n.text.length
|
|
2243
2155
|
}, {
|
|
2244
2156
|
lineCount: 0,
|
|
2245
2157
|
textLength: 0
|
|
2246
|
-
}),
|
|
2158
|
+
}), Ci = (t) => {
|
|
2247
2159
|
if (t.role !== "user") return !1;
|
|
2248
2160
|
const {
|
|
2249
2161
|
lineCount: e,
|
|
2250
2162
|
textLength: n
|
|
2251
|
-
} =
|
|
2252
|
-
return n >
|
|
2253
|
-
},
|
|
2163
|
+
} = ki(t);
|
|
2164
|
+
return n > wi || e > Ti;
|
|
2165
|
+
}, Ii = (t, e) => {
|
|
2254
2166
|
const n = Math.max(0, t.scrollHeight - t.clientHeight);
|
|
2255
|
-
return e === 0 || n <=
|
|
2256
|
-
},
|
|
2257
|
-
const n =
|
|
2258
|
-
return [...t.map((
|
|
2167
|
+
return e === 0 || n <= gt ? !1 : e < 0 ? t.scrollTop > gt : t.scrollTop < n - gt;
|
|
2168
|
+
}, Fn = 720, _i = 1, Ri = 3, vi = 20, jt = 1, Mi = 4, Ln = 8, Pi = (t, e) => {
|
|
2169
|
+
const n = En(t);
|
|
2170
|
+
return [...t.map((s) => ({
|
|
2259
2171
|
type: "leading-response",
|
|
2260
|
-
key:
|
|
2261
|
-
message:
|
|
2262
|
-
showAssistantActions:
|
|
2263
|
-
})), ...e.map((
|
|
2172
|
+
key: s.id,
|
|
2173
|
+
message: s,
|
|
2174
|
+
showAssistantActions: s.id === n
|
|
2175
|
+
})), ...e.map((s, o) => ({
|
|
2264
2176
|
type: "group",
|
|
2265
|
-
key:
|
|
2266
|
-
group:
|
|
2267
|
-
groupIndex:
|
|
2177
|
+
key: s.userMessage.id,
|
|
2178
|
+
group: s,
|
|
2179
|
+
groupIndex: o
|
|
2268
2180
|
}))];
|
|
2269
|
-
},
|
|
2181
|
+
}, Ei = (t, e) => {
|
|
2270
2182
|
if (t === 0) return 0;
|
|
2271
|
-
const n = t *
|
|
2183
|
+
const n = t * Fn + (t - 1) * Ln;
|
|
2272
2184
|
return Math.max(n - e, 0);
|
|
2273
|
-
},
|
|
2185
|
+
}, Di = (t) => t?.clientHeight || _i, Bi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= jt && Math.abs(t.totalSize - e.totalSize) <= jt, Fi = (t, e) => ({
|
|
2274
2186
|
scrollTop: t?.scrollTop ?? 0,
|
|
2275
2187
|
totalSize: e
|
|
2276
|
-
}),
|
|
2188
|
+
}), Li = (t) => {
|
|
2277
2189
|
const e = A(8), {
|
|
2278
2190
|
itemCount: n,
|
|
2279
|
-
onReady:
|
|
2280
|
-
scrollRef:
|
|
2191
|
+
onReady: s,
|
|
2192
|
+
scrollRef: o,
|
|
2281
2193
|
totalSize: r
|
|
2282
|
-
} = t, i =
|
|
2194
|
+
} = t, i = ie(s);
|
|
2283
2195
|
let l, a;
|
|
2284
|
-
e[0] !==
|
|
2285
|
-
i.current =
|
|
2286
|
-
}, a = [
|
|
2196
|
+
e[0] !== s ? (l = () => {
|
|
2197
|
+
i.current = s;
|
|
2198
|
+
}, a = [s], e[0] = s, e[1] = l, e[2] = a) : (l = e[1], a = e[2]), J(l, a);
|
|
2287
2199
|
let u, d;
|
|
2288
|
-
e[3] !== n || e[4] !==
|
|
2200
|
+
e[3] !== n || e[4] !== o || e[5] !== r ? (u = () => {
|
|
2289
2201
|
if (n === 0 || typeof requestAnimationFrame > "u") {
|
|
2290
2202
|
i.current?.();
|
|
2291
2203
|
return;
|
|
2292
2204
|
}
|
|
2293
|
-
let f = 0,
|
|
2205
|
+
let f = 0, p = 0, m = 0, h = null;
|
|
2294
2206
|
const g = () => {
|
|
2295
|
-
|
|
2296
|
-
const b =
|
|
2297
|
-
if (
|
|
2207
|
+
p = p + 1;
|
|
2208
|
+
const b = Fi(o.current, r);
|
|
2209
|
+
if (m = h && Bi(b, h) ? m + 1 : 0, h = b, m >= Ri || p >= vi) {
|
|
2298
2210
|
i.current?.();
|
|
2299
2211
|
return;
|
|
2300
2212
|
}
|
|
2301
2213
|
f = requestAnimationFrame(g);
|
|
2302
2214
|
};
|
|
2303
2215
|
return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
|
|
2304
|
-
}, d = [n,
|
|
2305
|
-
},
|
|
2306
|
-
|
|
2307
|
-
},
|
|
2216
|
+
}, d = [n, o, r], e[3] = n, e[4] = o, e[5] = r, e[6] = u, e[7] = d) : (u = e[6], d = e[7]), J(u, d);
|
|
2217
|
+
}, $i = (t) => {
|
|
2218
|
+
Ii(t.currentTarget, t.deltaY) && t.stopPropagation();
|
|
2219
|
+
}, Oi = (t, e) => {
|
|
2308
2220
|
if (t)
|
|
2309
|
-
return e ?
|
|
2310
|
-
},
|
|
2221
|
+
return e ? Bn : Ai;
|
|
2222
|
+
}, zi = (t) => {
|
|
2311
2223
|
if (t)
|
|
2312
|
-
return
|
|
2313
|
-
},
|
|
2224
|
+
return Bn;
|
|
2225
|
+
}, Qi = (t) => {
|
|
2314
2226
|
const e = A(50), {
|
|
2315
2227
|
group: n,
|
|
2316
|
-
streaming:
|
|
2317
|
-
hideQuestionForms:
|
|
2228
|
+
streaming: s,
|
|
2229
|
+
hideQuestionForms: o,
|
|
2318
2230
|
isExpanded: r,
|
|
2319
2231
|
animate: i,
|
|
2320
2232
|
onToggleStickyMessage: l
|
|
2321
2233
|
} = t;
|
|
2322
2234
|
let a, u, d;
|
|
2323
|
-
e[0] !== n.userMessage || e[1] !== r ? (a =
|
|
2235
|
+
e[0] !== n.userMessage || e[1] !== r ? (a = Ci(n.userMessage), u = a && r, d = Oi(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = u, e[4] = d) : (a = e[2], u = e[3], d = e[4]);
|
|
2324
2236
|
const f = d;
|
|
2325
|
-
let
|
|
2326
|
-
e[5] !== n.userMessage.id || e[6] !== l ? (
|
|
2327
|
-
const
|
|
2237
|
+
let p;
|
|
2238
|
+
e[5] !== n.userMessage.id || e[6] !== l ? (p = () => l(n.userMessage.id), e[5] = n.userMessage.id, e[6] = l, e[7] = p) : p = e[7];
|
|
2239
|
+
const m = p;
|
|
2328
2240
|
let h;
|
|
2329
|
-
e[8] !== n.responses ? (h =
|
|
2330
|
-
const g = h, b = i ?
|
|
2241
|
+
e[8] !== n.responses ? (h = En(n.responses), e[8] = n.responses, e[9] = h) : h = e[9];
|
|
2242
|
+
const g = h, b = i ? fn : void 0, x = a ? "0" : void 0, y = a ? "relative" : void 0, T = a ? r ? "expanded" : "collapsed" : void 0;
|
|
2331
2243
|
let S;
|
|
2332
|
-
e[10] !== u ? (S =
|
|
2333
|
-
const
|
|
2334
|
-
let D;
|
|
2335
|
-
e[12] !== n.userMessage || e[13] !== o ? (D = /* @__PURE__ */ c(ls, { message: n.userMessage, streaming: o }), e[12] = n.userMessage, e[13] = o, e[14] = D) : D = e[14];
|
|
2336
|
-
let $;
|
|
2337
|
-
e[15] !== I || e[16] !== v || e[17] !== L || e[18] !== D || e[19] !== x || e[20] !== S || e[21] !== T || e[22] !== k ? ($ = /* @__PURE__ */ c(B, { "data-sticky-user-message-content": x, display: "flex", flexDirection: "column", gap: "sm", maxH: S, minH: "0", overflowY: T, px: k, py: I, pb: v, onWheel: L, children: D }), e[15] = I, e[16] = v, e[17] = L, e[18] = D, e[19] = x, e[20] = S, e[21] = T, e[22] = k, e[23] = $) : $ = e[23];
|
|
2244
|
+
e[10] !== u ? (S = zi(u), e[10] = u, e[11] = S) : S = e[11];
|
|
2245
|
+
const w = u ? "auto" : "visible", C = a ? "xs" : void 0, _ = a ? "xs" : void 0, R = u ? "3rem" : void 0, L = u ? $i : void 0;
|
|
2338
2246
|
let E;
|
|
2339
|
-
e[
|
|
2247
|
+
e[12] !== n.userMessage || e[13] !== s ? (E = /* @__PURE__ */ c(Mn, { message: n.userMessage, streaming: s }), e[12] = n.userMessage, e[13] = s, e[14] = E) : E = e[14];
|
|
2248
|
+
let Q;
|
|
2249
|
+
e[15] !== _ || e[16] !== R || e[17] !== L || e[18] !== E || e[19] !== T || e[20] !== S || e[21] !== w || e[22] !== C ? (Q = /* @__PURE__ */ c(P, { "data-sticky-user-message-content": T, display: "flex", flexDirection: "column", gap: "sm", maxH: S, minH: "0", overflowY: w, px: C, py: _, pb: R, onWheel: L, children: E }), e[15] = _, e[16] = R, e[17] = L, e[18] = E, e[19] = T, e[20] = S, e[21] = w, e[22] = C, e[23] = Q) : Q = e[23];
|
|
2340
2250
|
let M;
|
|
2341
|
-
e[
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
let
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2251
|
+
e[24] !== n.userMessage || e[25] !== a || e[26] !== r || e[27] !== m ? (M = a ? /* @__PURE__ */ c(Si, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ c(xt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ c(xt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[24] = n.userMessage, e[25] = a, e[26] = r, e[27] = m, e[28] = M) : M = e[28];
|
|
2252
|
+
let D;
|
|
2253
|
+
e[29] !== f || e[30] !== Q || e[31] !== M || e[32] !== x || e[33] !== y ? (D = /* @__PURE__ */ k(ge.Content, { from: "user", maxH: f, overflow: "hidden", p: x, position: y, children: [
|
|
2254
|
+
Q,
|
|
2255
|
+
M
|
|
2256
|
+
] }), e[29] = f, e[30] = Q, e[31] = M, e[32] = x, e[33] = y, e[34] = D) : D = e[34];
|
|
2257
|
+
let B;
|
|
2258
|
+
e[35] !== D || e[36] !== b ? (B = /* @__PURE__ */ c(P, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ c(ge.Root, { from: "user", ...b, children: D }) }), e[35] = D, e[36] = b, e[37] = B) : B = e[37];
|
|
2259
|
+
let $;
|
|
2260
|
+
if (e[38] !== g || e[39] !== n.responses || e[40] !== o || e[41] !== s) {
|
|
2261
|
+
let F;
|
|
2262
|
+
e[43] !== g || e[44] !== o || e[45] !== s ? (F = (z) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Dn, { message: z, streaming: s, hideQuestionForms: o, showAssistantActions: z.id === g }) }, z.id), e[43] = g, e[44] = o, e[45] = s, e[46] = F) : F = e[46], $ = n.responses.map(F), e[38] = g, e[39] = n.responses, e[40] = o, e[41] = s, e[42] = $;
|
|
2351
2263
|
} else
|
|
2352
|
-
|
|
2353
|
-
let
|
|
2354
|
-
return e[47] !==
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
] }), e[47] =
|
|
2358
|
-
},
|
|
2264
|
+
$ = e[42];
|
|
2265
|
+
let O;
|
|
2266
|
+
return e[47] !== B || e[48] !== $ ? (O = /* @__PURE__ */ k(P, { children: [
|
|
2267
|
+
B,
|
|
2268
|
+
$
|
|
2269
|
+
] }), e[47] = B, e[48] = $, e[49] = O) : O = e[49], O;
|
|
2270
|
+
}, qi = (t, e) => {
|
|
2359
2271
|
const {
|
|
2360
2272
|
groups: n,
|
|
2361
|
-
streaming:
|
|
2362
|
-
hideActiveQuestionForms:
|
|
2273
|
+
streaming: s,
|
|
2274
|
+
hideActiveQuestionForms: o,
|
|
2363
2275
|
expandedStickyMessageIds: r,
|
|
2364
2276
|
animatedItemKeys: i,
|
|
2365
2277
|
onToggleStickyMessage: l
|
|
2366
2278
|
} = e;
|
|
2367
|
-
return t.type === "leading-response" ? /* @__PURE__ */ c(
|
|
2368
|
-
},
|
|
2279
|
+
return t.type === "leading-response" ? /* @__PURE__ */ c(Dn, { message: t.message, streaming: s, hideQuestionForms: n.length > 0 || o, animate: i.has(t.key), showAssistantActions: t.showAssistantActions }) : /* @__PURE__ */ c(Qi, { group: t.group, streaming: s, hideQuestionForms: t.groupIndex < n.length - 1 || o, isExpanded: r.has(t.group.userMessage.id), animate: i.has(t.key), onToggleStickyMessage: l });
|
|
2280
|
+
}, Wi = (t) => {
|
|
2369
2281
|
const {
|
|
2370
2282
|
leadingResponses: e,
|
|
2371
2283
|
groups: n,
|
|
2372
|
-
streaming:
|
|
2373
|
-
hideActiveQuestionForms:
|
|
2284
|
+
streaming: s,
|
|
2285
|
+
hideActiveQuestionForms: o,
|
|
2374
2286
|
expandedStickyMessageIds: r,
|
|
2375
2287
|
onToggleStickyMessage: i,
|
|
2376
2288
|
onReady: l
|
|
2377
2289
|
} = t, {
|
|
2378
2290
|
scrollRef: a
|
|
2379
|
-
} =
|
|
2291
|
+
} = Ge(), u = Pi(e, n), d = Ao(u.map((h) => h.key)), f = Di(a.current), p = ks({
|
|
2380
2292
|
count: u.length,
|
|
2381
2293
|
getScrollElement: () => a.current,
|
|
2382
|
-
estimateSize: () =>
|
|
2294
|
+
estimateSize: () => Fn,
|
|
2383
2295
|
getItemKey: (h) => u[h]?.key ?? h,
|
|
2384
|
-
overscan:
|
|
2385
|
-
gap:
|
|
2296
|
+
overscan: Mi,
|
|
2297
|
+
gap: Ln,
|
|
2386
2298
|
initialRect: {
|
|
2387
2299
|
width: 0,
|
|
2388
2300
|
height: f
|
|
2389
2301
|
},
|
|
2390
|
-
initialOffset: () =>
|
|
2391
|
-
}),
|
|
2392
|
-
return
|
|
2302
|
+
initialOffset: () => Ei(u.length, f)
|
|
2303
|
+
}), m = p.getTotalSize();
|
|
2304
|
+
return Li({
|
|
2393
2305
|
itemCount: u.length,
|
|
2394
2306
|
onReady: l,
|
|
2395
2307
|
scrollRef: a,
|
|
2396
|
-
totalSize:
|
|
2397
|
-
}), /* @__PURE__ */ c(
|
|
2398
|
-
height:
|
|
2399
|
-
}, children:
|
|
2308
|
+
totalSize: m
|
|
2309
|
+
}), /* @__PURE__ */ c(P, { px: "xs", children: /* @__PURE__ */ c(P, { position: "relative", width: "100%", style: {
|
|
2310
|
+
height: m
|
|
2311
|
+
}, children: p.getVirtualItems().map((h) => {
|
|
2400
2312
|
const g = u[h.index];
|
|
2401
|
-
return g ? /* @__PURE__ */ c(
|
|
2313
|
+
return g ? /* @__PURE__ */ c(P, { ref: p.measureElement, "data-index": h.index, "data-chat-message-list-item": g.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
|
|
2402
2314
|
top: h.start
|
|
2403
|
-
}, children:
|
|
2315
|
+
}, children: qi(g, {
|
|
2404
2316
|
groups: n,
|
|
2405
|
-
streaming:
|
|
2406
|
-
hideActiveQuestionForms:
|
|
2317
|
+
streaming: s,
|
|
2318
|
+
hideActiveQuestionForms: o,
|
|
2407
2319
|
expandedStickyMessageIds: r,
|
|
2408
2320
|
animatedItemKeys: d,
|
|
2409
2321
|
onToggleStickyMessage: i
|
|
2410
2322
|
}) }, h.key) : null;
|
|
2411
2323
|
}) }) });
|
|
2412
|
-
},
|
|
2324
|
+
}, Hi = (t) => {
|
|
2413
2325
|
const e = A(48), {
|
|
2414
2326
|
item: n,
|
|
2415
|
-
index:
|
|
2416
|
-
isFirst:
|
|
2327
|
+
index: s,
|
|
2328
|
+
isFirst: o,
|
|
2417
2329
|
isLast: r,
|
|
2418
2330
|
isEditing: i,
|
|
2419
2331
|
isDragTarget: l,
|
|
@@ -2421,166 +2333,166 @@ const ji = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2421
2333
|
onRemove: u,
|
|
2422
2334
|
onDragStart: d,
|
|
2423
2335
|
onDragEnd: f,
|
|
2424
|
-
onDragOver:
|
|
2425
|
-
onDrop:
|
|
2426
|
-
} = t, h = !!a, g = !!u, b = !
|
|
2427
|
-
let
|
|
2428
|
-
e[0] !== n.id || e[1] !==
|
|
2429
|
-
let
|
|
2430
|
-
e[3] !== n.id || e[4] !==
|
|
2431
|
-
const
|
|
2432
|
-
let D;
|
|
2433
|
-
e[6] !== n.id || e[7] !== d ? (D = (H) => {
|
|
2434
|
-
H.dataTransfer.effectAllowed = "move", H.dataTransfer.setData("text/plain", n.id), d(n.id);
|
|
2435
|
-
}, e[6] = n.id, e[7] = d, e[8] = D) : D = e[8];
|
|
2436
|
-
let $;
|
|
2437
|
-
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ c(Ht, { as: Us, boxSize: "14px" }), e[9] = $) : $ = e[9];
|
|
2336
|
+
onDragOver: p,
|
|
2337
|
+
onDrop: m
|
|
2338
|
+
} = t, h = !!a, g = !!u, b = !o || !r, x = `Drag queued follow-up ${s + 1}`, y = o ? "0" : "1px", T = l ? "border.accent-light" : "border.subtle", S = o ? "0" : "2xs", w = i ? "bg.muted" : void 0;
|
|
2339
|
+
let C;
|
|
2340
|
+
e[0] !== n.id || e[1] !== p ? (C = (H) => p(H, n.id), e[0] = n.id, e[1] = p, e[2] = C) : C = e[2];
|
|
2341
|
+
let _;
|
|
2342
|
+
e[3] !== n.id || e[4] !== m ? (_ = (H) => m(H, n.id), e[3] = n.id, e[4] = m, e[5] = _) : _ = e[5];
|
|
2343
|
+
const R = b ? "grab" : "default", L = !b;
|
|
2438
2344
|
let E;
|
|
2439
|
-
e[
|
|
2345
|
+
e[6] !== n.id || e[7] !== d ? (E = (H) => {
|
|
2346
|
+
H.dataTransfer.effectAllowed = "move", H.dataTransfer.setData("text/plain", n.id), d(n.id);
|
|
2347
|
+
}, e[6] = n.id, e[7] = d, e[8] = E) : E = e[8];
|
|
2348
|
+
let Q;
|
|
2349
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ c(dt, { as: ms, boxSize: "14px" }), e[9] = Q) : Q = e[9];
|
|
2440
2350
|
let M;
|
|
2441
|
-
e[
|
|
2442
|
-
let
|
|
2443
|
-
e[
|
|
2351
|
+
e[10] !== b || e[11] !== x || e[12] !== f || e[13] !== R || e[14] !== L || e[15] !== E ? (M = /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", draggable: b, "aria-label": x, title: x, color: "fg.muted", cursor: R, disabled: L, onDragStart: E, onDragEnd: f, children: Q }), e[10] = b, e[11] = x, e[12] = f, e[13] = R, e[14] = L, e[15] = E, e[16] = M) : M = e[16];
|
|
2352
|
+
let D;
|
|
2353
|
+
e[17] !== n.prompt ? (D = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", lineClamp: 2, minWidth: "0", children: n.prompt }), e[17] = n.prompt, e[18] = D) : D = e[18];
|
|
2354
|
+
let B;
|
|
2355
|
+
e[19] !== n.attachments ? (B = n.attachments?.length ? /* @__PURE__ */ k(Un, { width: "fit-content", size: "sm", variant: "outline", colorPalette: "gray", children: [
|
|
2444
2356
|
n.attachments.length,
|
|
2445
2357
|
" attachments"
|
|
2446
|
-
] }) : null, e[19] = n.attachments, e[20] =
|
|
2447
|
-
let
|
|
2448
|
-
e[21] !==
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
] }), e[21] =
|
|
2452
|
-
let Q;
|
|
2453
|
-
e[24] !== h || e[25] !== n || e[26] !== a ? (Q = h ? /* @__PURE__ */ c(ot, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ c(Ht, { as: js, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = Q) : Q = e[27];
|
|
2358
|
+
] }) : null, e[19] = n.attachments, e[20] = B) : B = e[20];
|
|
2359
|
+
let $;
|
|
2360
|
+
e[21] !== D || e[22] !== B ? ($ = /* @__PURE__ */ k(j, { gap: "2xs", flex: "1", minWidth: "0", children: [
|
|
2361
|
+
D,
|
|
2362
|
+
B
|
|
2363
|
+
] }), e[21] = D, e[22] = B, e[23] = $) : $ = e[23];
|
|
2454
2364
|
let O;
|
|
2455
|
-
e[
|
|
2365
|
+
e[24] !== h || e[25] !== n || e[26] !== a ? (O = h ? /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ c(dt, { as: hs, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = O) : O = e[27];
|
|
2366
|
+
let F;
|
|
2367
|
+
e[28] !== g || e[29] !== n.id || e[30] !== u ? (F = g ? /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", "aria-label": "Remove queued follow-up", colorPalette: "red", onClick: () => u?.(n.id), children: /* @__PURE__ */ c(dt, { as: tn, boxSize: "14px" }) }) : null, e[28] = g, e[29] = n.id, e[30] = u, e[31] = F) : F = e[31];
|
|
2456
2368
|
let z;
|
|
2457
|
-
e[32] !==
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
] }), e[32] =
|
|
2461
|
-
let
|
|
2462
|
-
e[35] !==
|
|
2463
|
-
|
|
2464
|
-
|
|
2369
|
+
e[32] !== O || e[33] !== F ? (z = /* @__PURE__ */ k(Z, { gap: "2xs", flexShrink: 0, children: [
|
|
2370
|
+
O,
|
|
2371
|
+
F
|
|
2372
|
+
] }), e[32] = O, e[33] = F, e[34] = z) : z = e[34];
|
|
2373
|
+
let v;
|
|
2374
|
+
e[35] !== M || e[36] !== $ || e[37] !== z ? (v = /* @__PURE__ */ k(Z, { gap: "xs", alignItems: "flex-start", children: [
|
|
2375
|
+
M,
|
|
2376
|
+
$,
|
|
2465
2377
|
z
|
|
2466
|
-
] }), e[35] =
|
|
2378
|
+
] }), e[35] = M, e[36] = $, e[37] = z, e[38] = v) : v = e[38];
|
|
2467
2379
|
let W;
|
|
2468
|
-
return e[39] !== n.id || e[40] !==
|
|
2469
|
-
},
|
|
2380
|
+
return e[39] !== n.id || e[40] !== y || e[41] !== T || e[42] !== v || e[43] !== S || e[44] !== w || e[45] !== C || e[46] !== _ ? (W = /* @__PURE__ */ c(P, { minWidth: "0", borderTopWidth: y, borderColor: T, paddingTop: S, paddingBottom: "2xs", bg: w, onDragOver: C, onDrop: _, "data-queued-follow-up-id": n.id, children: v }), e[39] = n.id, e[40] = y, e[41] = T, e[42] = v, e[43] = S, e[44] = w, e[45] = C, e[46] = _, e[47] = W) : W = e[47], W;
|
|
2381
|
+
}, Vi = (t) => {
|
|
2470
2382
|
const e = A(24), {
|
|
2471
2383
|
items: n,
|
|
2472
|
-
editingItemId:
|
|
2473
|
-
onEdit:
|
|
2384
|
+
editingItemId: s,
|
|
2385
|
+
onEdit: o,
|
|
2474
2386
|
onRemove: r,
|
|
2475
2387
|
onMove: i
|
|
2476
2388
|
} = t, [l, a] = V(null), [u, d] = V(null);
|
|
2477
2389
|
if (n.length === 0)
|
|
2478
2390
|
return null;
|
|
2479
2391
|
let f;
|
|
2480
|
-
e[0] !== l ? (f = (
|
|
2481
|
-
!l || l ===
|
|
2392
|
+
e[0] !== l ? (f = (x, y) => {
|
|
2393
|
+
!l || l === y || (x.preventDefault(), x.dataTransfer.dropEffect = "move", d(y));
|
|
2482
2394
|
}, e[0] = l, e[1] = f) : f = e[1];
|
|
2483
|
-
const
|
|
2484
|
-
let
|
|
2485
|
-
e[2] !== l || e[3] !== n || e[4] !== i ? (
|
|
2486
|
-
|
|
2487
|
-
const
|
|
2488
|
-
if (a(null), d(null), !
|
|
2395
|
+
const p = f;
|
|
2396
|
+
let m;
|
|
2397
|
+
e[2] !== l || e[3] !== n || e[4] !== i ? (m = (x, y) => {
|
|
2398
|
+
x.preventDefault();
|
|
2399
|
+
const T = l ?? x.dataTransfer.getData("text/plain");
|
|
2400
|
+
if (a(null), d(null), !T || T === y)
|
|
2489
2401
|
return;
|
|
2490
|
-
const S = n.findIndex((
|
|
2491
|
-
if (S === -1 ||
|
|
2402
|
+
const S = n.findIndex((_) => _.id === T), w = n.findIndex((_) => _.id === y);
|
|
2403
|
+
if (S === -1 || w === -1 || S === w)
|
|
2492
2404
|
return;
|
|
2493
|
-
const
|
|
2494
|
-
i?.(
|
|
2495
|
-
}, e[2] = l, e[3] = n, e[4] = i, e[5] =
|
|
2496
|
-
const h =
|
|
2405
|
+
const C = w < S ? "up" : "down";
|
|
2406
|
+
i?.(T, C, Math.abs(w - S));
|
|
2407
|
+
}, e[2] = l, e[3] = n, e[4] = i, e[5] = m) : m = e[5];
|
|
2408
|
+
const h = m;
|
|
2497
2409
|
let g;
|
|
2498
|
-
if (e[6] !== u || e[7] !==
|
|
2499
|
-
let
|
|
2500
|
-
e[14] !== u || e[15] !==
|
|
2410
|
+
if (e[6] !== u || e[7] !== s || e[8] !== p || e[9] !== h || e[10] !== n || e[11] !== o || e[12] !== r) {
|
|
2411
|
+
let x;
|
|
2412
|
+
e[14] !== u || e[15] !== s || e[16] !== p || e[17] !== h || e[18] !== n.length || e[19] !== o || e[20] !== r ? (x = (y, T) => /* @__PURE__ */ c(Hi, { item: y, index: T, isFirst: T === 0, isLast: T === n.length - 1, isEditing: s === y.id, isDragTarget: u === y.id, onEdit: o, onRemove: r, onDragStart: a, onDragEnd: () => {
|
|
2501
2413
|
a(null), d(null);
|
|
2502
|
-
}, onDragOver:
|
|
2414
|
+
}, onDragOver: p, onDrop: h }, y.id), e[14] = u, e[15] = s, e[16] = p, e[17] = h, e[18] = n.length, e[19] = o, e[20] = r, e[21] = x) : x = e[21], g = n.map(x), e[6] = u, e[7] = s, e[8] = p, e[9] = h, e[10] = n, e[11] = o, e[12] = r, e[13] = g;
|
|
2503
2415
|
} else
|
|
2504
2416
|
g = e[13];
|
|
2505
2417
|
let b;
|
|
2506
|
-
return e[22] !== g ? (b = /* @__PURE__ */ c(
|
|
2507
|
-
},
|
|
2418
|
+
return e[22] !== g ? (b = /* @__PURE__ */ c(j, { gap: "2xs", paddingX: "0", paddingY: "xs", borderWidth: "1px", borderBottomWidth: "0", borderColor: "border", borderTopRadius: "xs", background: "bg", children: g }), e[22] = g, e[23] = b) : b = e[23], b;
|
|
2419
|
+
}, Ni = (t) => {
|
|
2508
2420
|
const e = Math.max(0, Math.floor(t));
|
|
2509
2421
|
if (e < 60) return `${e}s`;
|
|
2510
2422
|
const n = Math.floor(e / 60);
|
|
2511
2423
|
return n < 60 ? `${n}m ${String(e % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
|
|
2512
|
-
},
|
|
2424
|
+
}, Ui = (t) => {
|
|
2513
2425
|
const e = A(9), {
|
|
2514
2426
|
hidden: n
|
|
2515
|
-
} = t,
|
|
2427
|
+
} = t, s = n === void 0 ? !1 : n, [o, r] = V(0);
|
|
2516
2428
|
let i;
|
|
2517
2429
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = Date.now(), e[0] = i) : i = e[0];
|
|
2518
|
-
const l =
|
|
2430
|
+
const l = ie(i);
|
|
2519
2431
|
let a, u;
|
|
2520
|
-
if (e[1] !==
|
|
2521
|
-
if (
|
|
2432
|
+
if (e[1] !== s ? (a = () => {
|
|
2433
|
+
if (s)
|
|
2522
2434
|
return;
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2525
|
-
const h = setInterval(
|
|
2435
|
+
const m = () => r((Date.now() - l.current) / 1e3);
|
|
2436
|
+
m();
|
|
2437
|
+
const h = setInterval(m, 1e3);
|
|
2526
2438
|
return () => clearInterval(h);
|
|
2527
|
-
}, u = [
|
|
2439
|
+
}, u = [s], e[1] = s, e[2] = a, e[3] = u) : (a = e[2], u = e[3]), J(a, u), s)
|
|
2528
2440
|
return null;
|
|
2529
2441
|
let d;
|
|
2530
|
-
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(
|
|
2442
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
|
|
2531
2443
|
let f;
|
|
2532
|
-
e[5] !==
|
|
2533
|
-
let
|
|
2534
|
-
return e[7] !== f ? (
|
|
2444
|
+
e[5] !== o ? (f = Ni(o), e[5] = o, e[6] = f) : f = e[6];
|
|
2445
|
+
let p;
|
|
2446
|
+
return e[7] !== f ? (p = /* @__PURE__ */ k(Z, { gap: "2xs", px: "sm", py: "xs", children: [
|
|
2535
2447
|
d,
|
|
2536
|
-
/* @__PURE__ */ c(
|
|
2537
|
-
] }), e[7] = f, e[8] =
|
|
2538
|
-
},
|
|
2448
|
+
/* @__PURE__ */ c(U, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
|
|
2449
|
+
] }), e[7] = f, e[8] = p) : p = e[8], p;
|
|
2450
|
+
}, ji = (t) => {
|
|
2539
2451
|
const e = A(19), {
|
|
2540
2452
|
queuedFollowUps: n,
|
|
2541
|
-
defaultValue:
|
|
2542
|
-
onChange:
|
|
2453
|
+
defaultValue: s,
|
|
2454
|
+
onChange: o,
|
|
2543
2455
|
onSubmit: r,
|
|
2544
2456
|
onUpdate: i
|
|
2545
|
-
} = t, [l, a] = V(null), [u, d] = V(""), [f,
|
|
2457
|
+
} = t, [l, a] = V(null), [u, d] = V(""), [f, p] = V(0), m = l ? u : s;
|
|
2546
2458
|
let h, g;
|
|
2547
2459
|
e[0] !== l || e[1] !== n ? (h = () => {
|
|
2548
|
-
l && (n.some((
|
|
2549
|
-
}, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]),
|
|
2460
|
+
l && (n.some((R) => R.id === l) || (a(null), d("")));
|
|
2461
|
+
}, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]), J(h, g);
|
|
2550
2462
|
let b;
|
|
2551
|
-
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (
|
|
2552
|
-
a(
|
|
2463
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (R) => {
|
|
2464
|
+
a(R.id), d(R.prompt), p(Xi);
|
|
2553
2465
|
}, e[4] = b) : b = e[4];
|
|
2554
|
-
const
|
|
2555
|
-
let
|
|
2556
|
-
e[5] !== l || e[6] !==
|
|
2557
|
-
l ||
|
|
2558
|
-
}, e[5] = l, e[6] =
|
|
2559
|
-
const
|
|
2466
|
+
const x = b;
|
|
2467
|
+
let y;
|
|
2468
|
+
e[5] !== l || e[6] !== o ? (y = (R) => {
|
|
2469
|
+
l || o?.(R);
|
|
2470
|
+
}, e[5] = l, e[6] = o, e[7] = y) : y = e[7];
|
|
2471
|
+
const T = y;
|
|
2560
2472
|
let S;
|
|
2561
|
-
e[8] !== l || e[9] !== r || e[10] !== i ? (S = (
|
|
2473
|
+
e[8] !== l || e[9] !== r || e[10] !== i ? (S = (R, L, E) => {
|
|
2562
2474
|
if (l) {
|
|
2563
|
-
i?.(l,
|
|
2475
|
+
i?.(l, R), a(null), d("");
|
|
2564
2476
|
return;
|
|
2565
2477
|
}
|
|
2566
|
-
r?.(
|
|
2478
|
+
return r?.(R, L, E);
|
|
2567
2479
|
}, e[8] = l, e[9] = r, e[10] = i, e[11] = S) : S = e[11];
|
|
2568
|
-
const
|
|
2569
|
-
let
|
|
2570
|
-
return e[12] !==
|
|
2571
|
-
change:
|
|
2572
|
-
edit:
|
|
2480
|
+
const w = S, C = !!l;
|
|
2481
|
+
let _;
|
|
2482
|
+
return e[12] !== T || e[13] !== l || e[14] !== f || e[15] !== m || e[16] !== w || e[17] !== C ? (_ = {
|
|
2483
|
+
change: T,
|
|
2484
|
+
edit: x,
|
|
2573
2485
|
editingItemId: l,
|
|
2574
2486
|
focusSignal: f,
|
|
2575
|
-
inputValue:
|
|
2576
|
-
isEditing:
|
|
2577
|
-
submit:
|
|
2578
|
-
}, e[12] =
|
|
2579
|
-
},
|
|
2487
|
+
inputValue: m,
|
|
2488
|
+
isEditing: C,
|
|
2489
|
+
submit: w
|
|
2490
|
+
}, e[12] = T, e[13] = l, e[14] = f, e[15] = m, e[16] = w, e[17] = C, e[18] = _) : _ = e[18], _;
|
|
2491
|
+
}, Ki = (t) => {
|
|
2580
2492
|
const e = A(44), {
|
|
2581
2493
|
actions: n,
|
|
2582
|
-
attachedResources:
|
|
2583
|
-
attachmentList:
|
|
2494
|
+
attachedResources: s,
|
|
2495
|
+
attachmentList: o,
|
|
2584
2496
|
chatInputAutoFocus: r,
|
|
2585
2497
|
chatInputPlaceholder: i,
|
|
2586
2498
|
chatInputQuestionPrompt: l,
|
|
@@ -2588,39 +2500,39 @@ const ji = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2588
2500
|
hasWorkspaceHub: u,
|
|
2589
2501
|
inputDisabled: d,
|
|
2590
2502
|
submitDisabled: f,
|
|
2591
|
-
onAttachFiles:
|
|
2592
|
-
onAttachText:
|
|
2503
|
+
onAttachFiles: p,
|
|
2504
|
+
onAttachText: m,
|
|
2593
2505
|
onChatInputAddReference: h,
|
|
2594
2506
|
onClearAttachments: g,
|
|
2595
2507
|
onInterrupt: b,
|
|
2596
|
-
onQueuedFollowUpMove:
|
|
2597
|
-
onQueuedFollowUpRemove:
|
|
2598
|
-
onQueuedFollowUpUpdate:
|
|
2508
|
+
onQueuedFollowUpMove: x,
|
|
2509
|
+
onQueuedFollowUpRemove: y,
|
|
2510
|
+
onQueuedFollowUpUpdate: T,
|
|
2599
2511
|
queuedComposer: S,
|
|
2600
|
-
queuedFollowUps:
|
|
2601
|
-
streaming:
|
|
2602
|
-
workspaceHub:
|
|
2603
|
-
} = t,
|
|
2604
|
-
let
|
|
2605
|
-
e[0] !==
|
|
2512
|
+
queuedFollowUps: w,
|
|
2513
|
+
streaming: C,
|
|
2514
|
+
workspaceHub: _
|
|
2515
|
+
} = t, R = w.length > 0, L = u ? "2xs" : "xs", E = u ? "2xs" : "0", Q = u ? "2xs" : void 0, M = u ? "1px" : void 0, D = u ? "border" : void 0, B = u ? "sm" : void 0, $ = u ? "bg.subtle" : void 0, O = T ? S.edit : void 0;
|
|
2516
|
+
let F;
|
|
2517
|
+
e[0] !== x || e[1] !== y || e[2] !== S.editingItemId || e[3] !== w || e[4] !== O ? (F = /* @__PURE__ */ c(Vi, { items: w, editingItemId: S.editingItemId, onEdit: O, onRemove: y, onMove: x }), e[0] = x, e[1] = y, e[2] = S.editingItemId, e[3] = w, e[4] = O, e[5] = F) : F = e[5];
|
|
2606
2518
|
let z;
|
|
2607
|
-
e[6] !== S.inputValue ? (z =
|
|
2608
|
-
const
|
|
2519
|
+
e[6] !== S.inputValue ? (z = So(S.inputValue), e[6] = S.inputValue, e[7] = z) : z = e[7];
|
|
2520
|
+
const v = S.isEditing ? "Save queued follow-up" : void 0;
|
|
2609
2521
|
let W;
|
|
2610
|
-
e[8] !== n || e[9] !==
|
|
2522
|
+
e[8] !== n || e[9] !== s || e[10] !== o || e[11] !== r || e[12] !== i || e[13] !== l || e[14] !== a || e[15] !== R || e[16] !== u || e[17] !== d || e[18] !== p || e[19] !== m || e[20] !== h || e[21] !== g || e[22] !== b || e[23] !== S.change || e[24] !== S.focusSignal || e[25] !== S.submit || e[26] !== C || e[27] !== f || e[28] !== v || e[29] !== z ? (W = /* @__PURE__ */ c(po, { placeholder: i, defaultState: z, streaming: C, onSubmit: S.submit, onInterrupt: b, onAttachFiles: p, onAttachText: m, onChange: S.change, actions: n, attachedResources: s, onClearAttachments: g, attachmentList: o, isDisabled: d, submitDisabled: f, attachedToTop: R, recessed: u, questionPrompt: l, autoFocus: r, focusSignal: S.focusSignal, submitTitle: v, references: a, onAddReference: h }), e[8] = n, e[9] = s, e[10] = o, e[11] = r, e[12] = i, e[13] = l, e[14] = a, e[15] = R, e[16] = u, e[17] = d, e[18] = p, e[19] = m, e[20] = h, e[21] = g, e[22] = b, e[23] = S.change, e[24] = S.focusSignal, e[25] = S.submit, e[26] = C, e[27] = f, e[28] = v, e[29] = z, e[30] = W) : W = e[30];
|
|
2611
2523
|
let H;
|
|
2612
|
-
e[31] !==
|
|
2613
|
-
|
|
2614
|
-
|
|
2524
|
+
e[31] !== E || e[32] !== W || e[33] !== Q || e[34] !== M || e[35] !== D || e[36] !== B || e[37] !== $ || e[38] !== F || e[39] !== _ ? (H = /* @__PURE__ */ k(j, { gap: E, p: Q, borderWidth: M, borderColor: D, borderRadius: B, bg: $, children: [
|
|
2525
|
+
_,
|
|
2526
|
+
F,
|
|
2615
2527
|
W
|
|
2616
|
-
] }), e[31] =
|
|
2617
|
-
let
|
|
2618
|
-
return e[41] !== L || e[42] !== H ? (
|
|
2619
|
-
},
|
|
2528
|
+
] }), e[31] = E, e[32] = W, e[33] = Q, e[34] = M, e[35] = D, e[36] = B, e[37] = $, e[38] = F, e[39] = _, e[40] = H) : H = e[40];
|
|
2529
|
+
let K;
|
|
2530
|
+
return e[41] !== L || e[42] !== H ? (K = /* @__PURE__ */ c(j, { px: L, gap: "0", children: H }), e[41] = L, e[42] = H, e[43] = K) : K = e[43], K;
|
|
2531
|
+
}, Sl = (t) => {
|
|
2620
2532
|
const e = A(78), {
|
|
2621
2533
|
conversationKey: n,
|
|
2622
|
-
messages:
|
|
2623
|
-
loading:
|
|
2534
|
+
messages: s,
|
|
2535
|
+
loading: o,
|
|
2624
2536
|
streaming: r,
|
|
2625
2537
|
emptyStateTitle: i,
|
|
2626
2538
|
emptyStateDescription: l,
|
|
@@ -2628,158 +2540,158 @@ const ji = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2628
2540
|
loaderComponent: u,
|
|
2629
2541
|
chatInputPlaceholder: d,
|
|
2630
2542
|
chatInputDefaultValue: f,
|
|
2631
|
-
onSubmitMessage:
|
|
2632
|
-
onInterrupt:
|
|
2543
|
+
onSubmitMessage: p,
|
|
2544
|
+
onInterrupt: m,
|
|
2633
2545
|
onAttachFiles: h,
|
|
2634
2546
|
onAttachText: g,
|
|
2635
2547
|
onChatInputChange: b,
|
|
2636
|
-
actions:
|
|
2637
|
-
attachedResources:
|
|
2638
|
-
onClearAttachments:
|
|
2548
|
+
actions: x,
|
|
2549
|
+
attachedResources: y,
|
|
2550
|
+
onClearAttachments: T,
|
|
2639
2551
|
attachmentList: S,
|
|
2640
|
-
approvalPrompt:
|
|
2641
|
-
workspaceHub:
|
|
2642
|
-
workspaceInitializing:
|
|
2643
|
-
inputDisabled:
|
|
2552
|
+
approvalPrompt: w,
|
|
2553
|
+
workspaceHub: C,
|
|
2554
|
+
workspaceInitializing: _,
|
|
2555
|
+
inputDisabled: R,
|
|
2644
2556
|
submitDisabled: L,
|
|
2645
|
-
chatInputQuestionPrompt:
|
|
2646
|
-
chatInputAutoFocus:
|
|
2647
|
-
queuedFollowUps:
|
|
2648
|
-
onQueuedFollowUpUpdate:
|
|
2649
|
-
onQueuedFollowUpRemove:
|
|
2650
|
-
onQueuedFollowUpMove:
|
|
2651
|
-
chatInputReferences:
|
|
2652
|
-
onChatInputAddReference:
|
|
2653
|
-
} = t, z =
|
|
2654
|
-
let
|
|
2655
|
-
e[0] !==
|
|
2656
|
-
const
|
|
2657
|
-
let
|
|
2658
|
-
e[2] !==
|
|
2659
|
-
const
|
|
2660
|
-
let
|
|
2661
|
-
if (e[4] !== n || e[5] !==
|
|
2662
|
-
const
|
|
2663
|
-
streaming:
|
|
2557
|
+
chatInputQuestionPrompt: E,
|
|
2558
|
+
chatInputAutoFocus: Q,
|
|
2559
|
+
queuedFollowUps: M,
|
|
2560
|
+
onQueuedFollowUpUpdate: D,
|
|
2561
|
+
onQueuedFollowUpRemove: B,
|
|
2562
|
+
onQueuedFollowUpMove: $,
|
|
2563
|
+
chatInputReferences: O,
|
|
2564
|
+
onChatInputAddReference: F
|
|
2565
|
+
} = t, z = o === void 0 ? !1 : o, v = r === void 0 ? !1 : r, W = f === void 0 ? "" : f, H = _ === void 0 ? !1 : _, K = R === void 0 ? !1 : R, oe = L === void 0 ? !1 : L, xe = Q === void 0 ? !1 : Q;
|
|
2566
|
+
let Se;
|
|
2567
|
+
e[0] !== M ? (Se = M === void 0 ? [] : M, e[0] = M, e[1] = Se) : Se = e[1];
|
|
2568
|
+
const ee = Se;
|
|
2569
|
+
let Te;
|
|
2570
|
+
e[2] !== O ? (Te = O === void 0 ? [] : O, e[2] = O, e[3] = Te) : Te = e[3];
|
|
2571
|
+
const Be = Te;
|
|
2572
|
+
let X, G, de, te, fe;
|
|
2573
|
+
if (e[4] !== n || e[5] !== s || e[6] !== v) {
|
|
2574
|
+
const me = yi(s, {
|
|
2575
|
+
streaming: v
|
|
2664
2576
|
});
|
|
2665
|
-
|
|
2577
|
+
X = me.length > 0, de = n ?? me[0]?.id, G = X ? de ?? "active-conversation" : null, fe = me.reduce(Gi, 0), te = xi(me), e[4] = n, e[5] = s, e[6] = v, e[7] = X, e[8] = G, e[9] = de, e[10] = te, e[11] = fe;
|
|
2666
2578
|
} else
|
|
2667
|
-
|
|
2579
|
+
X = e[7], G = e[8], de = e[9], te = e[10], fe = e[11];
|
|
2668
2580
|
const {
|
|
2669
|
-
groups:
|
|
2670
|
-
leadingResponses:
|
|
2671
|
-
} =
|
|
2581
|
+
groups: Fe,
|
|
2582
|
+
leadingResponses: Ae
|
|
2583
|
+
} = te, [we, nt] = V(Yi), [st, q] = V(null), ne = !X && z;
|
|
2584
|
+
let se;
|
|
2585
|
+
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ c(gs, { size: 48, strokeWidth: 1.5 }), e[12] = se) : se = e[12];
|
|
2586
|
+
let pe;
|
|
2587
|
+
e[13] !== l || e[14] !== i ? (pe = /* @__PURE__ */ c(As, { icon: se, title: i, description: l }), e[13] = l, e[14] = i, e[15] = pe) : pe = e[15];
|
|
2588
|
+
const ot = ne ? u : a ?? pe, rt = !!C;
|
|
2589
|
+
let We;
|
|
2590
|
+
e[16] !== E || e[17] !== s ? (We = E ?? xo(s), e[16] = E, e[17] = s, e[18] = We) : We = e[18];
|
|
2591
|
+
const Le = We, it = !!Le, lt = v && X && !H && !Le, He = !G || st === G;
|
|
2672
2592
|
let Ve;
|
|
2673
|
-
e[
|
|
2674
|
-
|
|
2675
|
-
e[13] !== l || e[14] !== i ? (me = /* @__PURE__ */ c(to, { icon: Ve, title: i, description: l }), e[13] = l, e[14] = i, e[15] = me) : me = e[15];
|
|
2676
|
-
const De = Ke ? u : a ?? me, Ee = !!k;
|
|
2677
|
-
let he;
|
|
2678
|
-
e[16] !== D || e[17] !== o ? (he = D ?? er(o), e[16] = D, e[17] = o, e[18] = he) : he = e[18];
|
|
2679
|
-
const se = he, Be = !!se, Fe = R && Y && !H && !se, ge = !ee || He === ee;
|
|
2680
|
-
let be;
|
|
2681
|
-
e[19] !== W || e[20] !== b || e[21] !== M || e[22] !== m || e[23] !== de ? (be = {
|
|
2682
|
-
queuedFollowUps: de,
|
|
2593
|
+
e[19] !== W || e[20] !== b || e[21] !== D || e[22] !== p || e[23] !== ee ? (Ve = {
|
|
2594
|
+
queuedFollowUps: ee,
|
|
2683
2595
|
defaultValue: W,
|
|
2684
2596
|
onChange: b,
|
|
2685
|
-
onSubmit:
|
|
2686
|
-
onUpdate:
|
|
2687
|
-
}, e[19] = W, e[20] = b, e[21] =
|
|
2688
|
-
const
|
|
2689
|
-
let
|
|
2690
|
-
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
2691
|
-
|
|
2692
|
-
const
|
|
2693
|
-
return
|
|
2597
|
+
onSubmit: p,
|
|
2598
|
+
onUpdate: D
|
|
2599
|
+
}, e[19] = W, e[20] = b, e[21] = D, e[22] = p, e[23] = ee, e[24] = Ve) : Ve = e[24];
|
|
2600
|
+
const at = ji(Ve);
|
|
2601
|
+
let Ne;
|
|
2602
|
+
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ne = (me) => {
|
|
2603
|
+
nt((On) => {
|
|
2604
|
+
const je = new Set(On);
|
|
2605
|
+
return je.has(me) ? je.delete(me) : je.add(me), je;
|
|
2694
2606
|
});
|
|
2695
|
-
}, e[25] =
|
|
2696
|
-
const
|
|
2697
|
-
let
|
|
2698
|
-
e[26] !== ct || e[27] !==
|
|
2699
|
-
const
|
|
2700
|
-
let
|
|
2701
|
-
e[29] !==
|
|
2702
|
-
let
|
|
2703
|
-
e[38] !==
|
|
2704
|
-
let
|
|
2705
|
-
e[41] !==
|
|
2706
|
-
let
|
|
2707
|
-
e[43] !==
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
] }), e[43] =
|
|
2712
|
-
let
|
|
2713
|
-
e[47] !==
|
|
2714
|
-
let
|
|
2715
|
-
e[50] !==
|
|
2716
|
-
let
|
|
2717
|
-
return e[73] !==
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
] }), e[73] =
|
|
2607
|
+
}, e[25] = Ne) : Ne = e[25];
|
|
2608
|
+
const $n = Ne, ct = de ?? null;
|
|
2609
|
+
let ke;
|
|
2610
|
+
e[26] !== ct || e[27] !== fe ? (ke = /* @__PURE__ */ c(Hs, { conversationKey: ct, userMessageCount: fe }), e[26] = ct, e[27] = fe, e[28] = ke) : ke = e[28];
|
|
2611
|
+
const ut = He ? "visible" : "hidden";
|
|
2612
|
+
let Ce;
|
|
2613
|
+
e[29] !== ot || e[30] !== we || e[31] !== Fe || e[32] !== X || e[33] !== it || e[34] !== Ae || e[35] !== G || e[36] !== v ? (Ce = X ? /* @__PURE__ */ c(Wi, { leadingResponses: Ae, groups: Fe, streaming: v, hideActiveQuestionForms: it, expandedStickyMessageIds: we, onToggleStickyMessage: $n, onReady: () => q(G) }, G) : ot, e[29] = ot, e[30] = we, e[31] = Fe, e[32] = X, e[33] = it, e[34] = Ae, e[35] = G, e[36] = v, e[37] = Ce) : Ce = e[37];
|
|
2614
|
+
let Ie;
|
|
2615
|
+
e[38] !== ut || e[39] !== Ce ? (Ie = /* @__PURE__ */ c(pt.Viewport, { visibility: ut, children: Ce }), e[38] = ut, e[39] = Ce, e[40] = Ie) : Ie = e[40];
|
|
2616
|
+
let _e;
|
|
2617
|
+
e[41] !== He ? (_e = He ? /* @__PURE__ */ c(pt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[41] = He, e[42] = _e) : _e = e[42];
|
|
2618
|
+
let Re;
|
|
2619
|
+
e[43] !== ke || e[44] !== Ie || e[45] !== _e ? (Re = /* @__PURE__ */ k(pt.Root, { children: [
|
|
2620
|
+
ke,
|
|
2621
|
+
Ie,
|
|
2622
|
+
_e
|
|
2623
|
+
] }), e[43] = ke, e[44] = Ie, e[45] = _e, e[46] = Re) : Re = e[46];
|
|
2624
|
+
let ve;
|
|
2625
|
+
e[47] !== lt || e[48] !== v ? (ve = v ? /* @__PURE__ */ c(Ui, { hidden: !lt }) : null, e[47] = lt, e[48] = v, e[49] = ve) : ve = e[49];
|
|
2626
|
+
let Me;
|
|
2627
|
+
e[50] !== x || e[51] !== Le || e[52] !== y || e[53] !== S || e[54] !== xe || e[55] !== d || e[56] !== Be || e[57] !== rt || e[58] !== K || e[59] !== h || e[60] !== g || e[61] !== F || e[62] !== T || e[63] !== m || e[64] !== $ || e[65] !== B || e[66] !== D || e[67] !== at || e[68] !== ee || e[69] !== v || e[70] !== oe || e[71] !== C ? (Me = /* @__PURE__ */ c(Ki, { actions: x, attachedResources: y, attachmentList: S, chatInputAutoFocus: xe, chatInputPlaceholder: d, chatInputQuestionPrompt: Le, chatInputReferences: Be, hasWorkspaceHub: rt, inputDisabled: K, submitDisabled: oe, onAttachFiles: h, onAttachText: g, onChatInputAddReference: F, onClearAttachments: T, onInterrupt: m, onQueuedFollowUpMove: $, onQueuedFollowUpRemove: B, onQueuedFollowUpUpdate: D, queuedComposer: at, queuedFollowUps: ee, streaming: v, workspaceHub: C }), e[50] = x, e[51] = Le, e[52] = y, e[53] = S, e[54] = xe, e[55] = d, e[56] = Be, e[57] = rt, e[58] = K, e[59] = h, e[60] = g, e[61] = F, e[62] = T, e[63] = m, e[64] = $, e[65] = B, e[66] = D, e[67] = at, e[68] = ee, e[69] = v, e[70] = oe, e[71] = C, e[72] = Me) : Me = e[72];
|
|
2628
|
+
let Ue;
|
|
2629
|
+
return e[73] !== w || e[74] !== Re || e[75] !== ve || e[76] !== Me ? (Ue = /* @__PURE__ */ k(be, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
|
|
2630
|
+
Re,
|
|
2631
|
+
w,
|
|
2632
|
+
ve,
|
|
2633
|
+
Me
|
|
2634
|
+
] }), e[73] = w, e[74] = Re, e[75] = ve, e[76] = Me, e[77] = Ue) : Ue = e[77], Ue;
|
|
2723
2635
|
};
|
|
2724
|
-
function
|
|
2636
|
+
function Xi(t) {
|
|
2725
2637
|
return t + 1;
|
|
2726
2638
|
}
|
|
2727
|
-
function
|
|
2639
|
+
function Gi(t, e) {
|
|
2728
2640
|
return t + (e.role === "user" ? 1 : 0);
|
|
2729
2641
|
}
|
|
2730
|
-
function
|
|
2642
|
+
function Yi() {
|
|
2731
2643
|
return /* @__PURE__ */ new Set();
|
|
2732
2644
|
}
|
|
2733
|
-
const
|
|
2645
|
+
const Kt = (t) => /* @__PURE__ */ c(j, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ c(jn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), wl = () => {
|
|
2734
2646
|
const t = A(2);
|
|
2735
2647
|
let e;
|
|
2736
|
-
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ c(
|
|
2648
|
+
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ c(ge.Root, { from: "user", children: /* @__PURE__ */ c(ge.Content, { from: "user", children: Kt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
|
|
2737
2649
|
let n;
|
|
2738
|
-
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */
|
|
2650
|
+
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(j, { minH: "full", py: "xs", gap: "0", children: [
|
|
2739
2651
|
e,
|
|
2740
|
-
/* @__PURE__ */ c(
|
|
2652
|
+
/* @__PURE__ */ c(ge.Root, { from: "assistant", children: /* @__PURE__ */ c(ge.Content, { from: "assistant", children: Kt(["76%", "62%", "40%"]) }) })
|
|
2741
2653
|
] }), t[1] = n) : n = t[1], n;
|
|
2742
|
-
},
|
|
2654
|
+
}, Ji = 3, Xt = 10, Zi = 26, Tt = 4, el = (t, e) => {
|
|
2743
2655
|
if (e === null) return 0;
|
|
2744
2656
|
const n = Math.abs(t - e);
|
|
2745
|
-
return n >=
|
|
2746
|
-
},
|
|
2657
|
+
return n >= Tt ? 0 : (1 + Math.cos(Math.PI * n / Tt)) / 2;
|
|
2658
|
+
}, tl = (t, e) => {
|
|
2747
2659
|
if (e === null) return "fg.subtle";
|
|
2748
2660
|
const n = Math.abs(t - e);
|
|
2749
|
-
return n < 0.5 ? "fg" : n <
|
|
2750
|
-
},
|
|
2661
|
+
return n < 0.5 ? "fg" : n < Tt ? "fg.muted" : "fg.subtle";
|
|
2662
|
+
}, nl = (t) => {
|
|
2751
2663
|
const e = A(11), {
|
|
2752
2664
|
item: n,
|
|
2753
|
-
position:
|
|
2754
|
-
} = t,
|
|
2665
|
+
position: s
|
|
2666
|
+
} = t, o = `${s.left}px`, r = `${s.top}px`;
|
|
2755
2667
|
let i;
|
|
2756
|
-
e[0] !== n.message ? (i = /* @__PURE__ */ c(
|
|
2668
|
+
e[0] !== n.message ? (i = /* @__PURE__ */ c(U, { textStyle: "label/S/medium", color: "fg", lineClamp: 2, children: n.message }), e[0] = n.message, e[1] = i) : i = e[1];
|
|
2757
2669
|
let l;
|
|
2758
|
-
e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ c(
|
|
2670
|
+
e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", lineClamp: 2, children: n.reply }) : null, e[2] = n.reply, e[3] = l) : l = e[3];
|
|
2759
2671
|
let a;
|
|
2760
|
-
e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */
|
|
2672
|
+
e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ k(j, { gap: "1.5", p: "3", bg: "bg.elevated", borderWidth: "1px", borderColor: "border", borderRadius: "lg", children: [
|
|
2761
2673
|
i,
|
|
2762
2674
|
l
|
|
2763
2675
|
] }), e[4] = i, e[5] = l, e[6] = a) : a = e[6];
|
|
2764
2676
|
let u;
|
|
2765
|
-
return e[7] !==
|
|
2766
|
-
},
|
|
2677
|
+
return e[7] !== o || e[8] !== r || e[9] !== a ? (u = /* @__PURE__ */ c(Yt, { children: /* @__PURE__ */ c(P, { position: "fixed", left: o, ml: "2xs", top: r, transform: "translateY(-50%)", w: "80", maxW: "80", zIndex: "popover", pointerEvents: "none", children: a }) }), e[7] = o, e[8] = r, e[9] = a, e[10] = u) : u = e[10], u;
|
|
2678
|
+
}, Tl = (t) => {
|
|
2767
2679
|
const e = A(22), {
|
|
2768
2680
|
items: n,
|
|
2769
|
-
onSelect:
|
|
2770
|
-
floating:
|
|
2771
|
-
} = t, r =
|
|
2772
|
-
if (n.length <
|
|
2681
|
+
onSelect: s,
|
|
2682
|
+
floating: o
|
|
2683
|
+
} = t, r = o === void 0 ? !1 : o, [i, l] = V(null), [a, u] = V(null);
|
|
2684
|
+
if (n.length < Ji)
|
|
2773
2685
|
return null;
|
|
2774
2686
|
let d;
|
|
2775
2687
|
e[0] !== n.length ? (d = (S) => {
|
|
2776
|
-
const
|
|
2777
|
-
l(
|
|
2778
|
-
left:
|
|
2779
|
-
top:
|
|
2688
|
+
const w = S.currentTarget.getBoundingClientRect(), C = (S.clientY - w.top) / w.height, _ = Math.min(n.length - 1, Math.max(0, C * n.length - 0.5)), R = Math.round(_);
|
|
2689
|
+
l(_), u({
|
|
2690
|
+
left: w.right,
|
|
2691
|
+
top: w.top + (R + 0.5) / n.length * w.height
|
|
2780
2692
|
});
|
|
2781
2693
|
}, e[0] = n.length, e[1] = d) : d = e[1];
|
|
2782
|
-
const f = d,
|
|
2694
|
+
const f = d, p = i === null ? null : Math.round(i), m = p === null ? null : n[p];
|
|
2783
2695
|
let h;
|
|
2784
2696
|
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => l(null), e[2] = h) : h = e[2];
|
|
2785
2697
|
let g;
|
|
@@ -2791,100 +2703,100 @@ const In = (t) => /* @__PURE__ */ c(G, { gap: "xs", w: "full", children: t.map((
|
|
|
2791
2703
|
bg: "bg"
|
|
2792
2704
|
} : {}, e[3] = r, e[4] = g) : g = e[4];
|
|
2793
2705
|
let b;
|
|
2794
|
-
if (e[5] !== n || e[6] !==
|
|
2706
|
+
if (e[5] !== n || e[6] !== s || e[7] !== i) {
|
|
2795
2707
|
let S;
|
|
2796
|
-
e[9] !==
|
|
2708
|
+
e[9] !== s || e[10] !== i ? (S = (w, C) => /* @__PURE__ */ c(Gt.button, { type: "button", h: "2px", w: `${Xt + (Zi - Xt) * el(C, i)}px`, bg: tl(C, i), borderRadius: "1px", transition: "width 80ms linear, background-color 80ms linear", "aria-label": `Jump to message ${C + 1}`, onClick: () => s?.(w.id) }, w.id), e[9] = s, e[10] = i, e[11] = S) : S = e[11], b = n.map(S), e[5] = n, e[6] = s, e[7] = i, e[8] = b;
|
|
2797
2709
|
} else
|
|
2798
2710
|
b = e[8];
|
|
2799
|
-
let y;
|
|
2800
|
-
e[12] !== f || e[13] !== g || e[14] !== b ? (y = /* @__PURE__ */ c(Qe, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = y) : y = e[15];
|
|
2801
|
-
let w;
|
|
2802
|
-
e[16] !== p || e[17] !== a ? (w = p && a ? /* @__PURE__ */ c($l, { item: p, position: a }) : null, e[16] = p, e[17] = a, e[18] = w) : w = e[18];
|
|
2803
2711
|
let x;
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2712
|
+
e[12] !== f || e[13] !== g || e[14] !== b ? (x = /* @__PURE__ */ c(be, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = x) : x = e[15];
|
|
2713
|
+
let y;
|
|
2714
|
+
e[16] !== m || e[17] !== a ? (y = m && a ? /* @__PURE__ */ c(nl, { item: m, position: a }) : null, e[16] = m, e[17] = a, e[18] = y) : y = e[18];
|
|
2715
|
+
let T;
|
|
2716
|
+
return e[19] !== x || e[20] !== y ? (T = /* @__PURE__ */ k(P, { position: "relative", w: "10", flexShrink: 0, children: [
|
|
2717
|
+
x,
|
|
2718
|
+
y
|
|
2719
|
+
] }), e[19] = x, e[20] = y, e[21] = T) : T = e[21], T;
|
|
2720
|
+
}, sl = (t) => {
|
|
2809
2721
|
const e = A(13), {
|
|
2810
2722
|
status: n,
|
|
2811
|
-
statusLabel:
|
|
2812
|
-
additions:
|
|
2723
|
+
statusLabel: s,
|
|
2724
|
+
additions: o,
|
|
2813
2725
|
deletions: r
|
|
2814
2726
|
} = t;
|
|
2815
2727
|
if (n === "loading") {
|
|
2816
2728
|
let u;
|
|
2817
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(
|
|
2818
|
-
const d =
|
|
2729
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[0] = u) : u = e[0];
|
|
2730
|
+
const d = s ?? "Setting up workspace...";
|
|
2819
2731
|
let f;
|
|
2820
|
-
return e[1] !== d ? (f = /* @__PURE__ */
|
|
2732
|
+
return e[1] !== d ? (f = /* @__PURE__ */ k(Z, { gap: "2xs", minW: "0", children: [
|
|
2821
2733
|
u,
|
|
2822
|
-
/* @__PURE__ */ c(
|
|
2734
|
+
/* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", truncate: !0, children: d })
|
|
2823
2735
|
] }), e[1] = d, e[2] = f) : f = e[2], f;
|
|
2824
2736
|
}
|
|
2825
2737
|
if (n === "error") {
|
|
2826
2738
|
let u;
|
|
2827
|
-
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(
|
|
2828
|
-
const d =
|
|
2739
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(sn, { size: 14, color: "var(--chakra-colors-fg-error)" }), e[3] = u) : u = e[3];
|
|
2740
|
+
const d = s ?? "Workspace setup failed";
|
|
2829
2741
|
let f;
|
|
2830
|
-
return e[4] !== d ? (f = /* @__PURE__ */
|
|
2742
|
+
return e[4] !== d ? (f = /* @__PURE__ */ k(Z, { gap: "2xs", minW: "0", children: [
|
|
2831
2743
|
u,
|
|
2832
|
-
/* @__PURE__ */ c(
|
|
2744
|
+
/* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.error", truncate: !0, children: d })
|
|
2833
2745
|
] }), e[4] = d, e[5] = f) : f = e[5], f;
|
|
2834
2746
|
}
|
|
2835
|
-
if (
|
|
2747
|
+
if (o <= 0 && r <= 0)
|
|
2836
2748
|
return null;
|
|
2837
2749
|
let i;
|
|
2838
|
-
e[6] !==
|
|
2750
|
+
e[6] !== o ? (i = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.success", children: [
|
|
2839
2751
|
"+",
|
|
2840
|
-
|
|
2841
|
-
] }), e[6] =
|
|
2752
|
+
o
|
|
2753
|
+
] }), e[6] = o, e[7] = i) : i = e[7];
|
|
2842
2754
|
let l;
|
|
2843
|
-
e[8] !== r ? (l = /* @__PURE__ */
|
|
2755
|
+
e[8] !== r ? (l = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.error", children: [
|
|
2844
2756
|
"−",
|
|
2845
2757
|
r
|
|
2846
2758
|
] }), e[8] = r, e[9] = l) : l = e[9];
|
|
2847
2759
|
let a;
|
|
2848
|
-
return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */
|
|
2760
|
+
return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ k(Z, { gap: "2xs", children: [
|
|
2849
2761
|
i,
|
|
2850
2762
|
l
|
|
2851
2763
|
] }), e[10] = i, e[11] = l, e[12] = a) : a = e[12], a;
|
|
2852
|
-
},
|
|
2764
|
+
}, Al = (t) => {
|
|
2853
2765
|
const e = A(13), {
|
|
2854
2766
|
workspaceControl: n,
|
|
2855
|
-
additions:
|
|
2856
|
-
deletions:
|
|
2767
|
+
additions: s,
|
|
2768
|
+
deletions: o,
|
|
2857
2769
|
action: r,
|
|
2858
2770
|
status: i,
|
|
2859
2771
|
statusLabel: l
|
|
2860
2772
|
} = t, a = i === void 0 ? "ready" : i;
|
|
2861
2773
|
let u;
|
|
2862
|
-
e[0] !==
|
|
2774
|
+
e[0] !== s || e[1] !== o || e[2] !== a || e[3] !== l ? (u = /* @__PURE__ */ c(sl, { status: a, statusLabel: l, additions: s, deletions: o }), e[0] = s, e[1] = o, e[2] = a, e[3] = l, e[4] = u) : u = e[4];
|
|
2863
2775
|
let d;
|
|
2864
|
-
e[5] !== u || e[6] !== n ? (d = /* @__PURE__ */
|
|
2776
|
+
e[5] !== u || e[6] !== n ? (d = /* @__PURE__ */ k(Z, { gap: "sm", minW: "0", children: [
|
|
2865
2777
|
n,
|
|
2866
2778
|
u
|
|
2867
2779
|
] }), e[5] = u, e[6] = n, e[7] = d) : d = e[7];
|
|
2868
2780
|
let f;
|
|
2869
|
-
e[8] !== r ? (f = r ? /* @__PURE__ */ c(
|
|
2870
|
-
let
|
|
2871
|
-
return e[10] !== d || e[11] !== f ? (
|
|
2781
|
+
e[8] !== r ? (f = r ? /* @__PURE__ */ c(be, { flexShrink: 0, children: r }) : null, e[8] = r, e[9] = f) : f = e[9];
|
|
2782
|
+
let p;
|
|
2783
|
+
return e[10] !== d || e[11] !== f ? (p = /* @__PURE__ */ k(be, { align: "center", justify: "space-between", gap: "sm", minW: "0", pl: "xs", pr: "2xs", py: "2xs", children: [
|
|
2872
2784
|
d,
|
|
2873
2785
|
f
|
|
2874
|
-
] }), e[10] = d, e[11] = f, e[12] =
|
|
2786
|
+
] }), e[10] = d, e[11] = f, e[12] = p) : p = e[12], p;
|
|
2875
2787
|
};
|
|
2876
2788
|
export {
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2789
|
+
yl as ApprovalPrompt,
|
|
2790
|
+
xl as AttachmentList,
|
|
2791
|
+
Hs as AutoScroll,
|
|
2792
|
+
po as ChatInput,
|
|
2793
|
+
ge as ChatMessage,
|
|
2794
|
+
Sl as ChatPanel,
|
|
2795
|
+
pt as ChatPrimitives,
|
|
2796
|
+
wl as ChatSkeleton,
|
|
2797
|
+
Al as ChatWorkspaceHub,
|
|
2798
|
+
Tl as ConversationBrowse,
|
|
2799
|
+
uo as SendButton,
|
|
2800
|
+
So as createSerializedPromptState
|
|
2889
2801
|
};
|
|
2890
2802
|
//# sourceMappingURL=chat-ui.js.map
|