@pstdio/ui 0.14.0 → 0.15.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-CatfVUxA.js → MermaidComponent-DBJsTOmj.js} +3 -3
- package/dist/{MermaidComponent-CatfVUxA.js.map → MermaidComponent-DBJsTOmj.js.map} +1 -1
- package/dist/chat-ui.js +441 -442
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/bubble-button.d.ts +1 -1
- package/dist/components/data-renderer/data-renderer-enum-helpers.d.ts +3 -3
- package/dist/components/data-renderer/data-renderer-helpers.d.ts +2 -0
- package/dist/components/diff-viewer/diff-viewer-options-menu.d.ts +16 -0
- package/dist/components/icon-color-picker.d.ts +2 -6
- package/dist/components/list-row/list-row.types.d.ts +1 -1
- package/dist/components/notification-center/index.d.ts +2 -0
- package/dist/components/notification-center/notification-center.d.ts +2 -0
- package/dist/components/notification-center/notification-center.types.d.ts +37 -0
- package/dist/components/search-modal-content.d.ts +20 -0
- package/dist/components/style-guide-data.d.ts +0 -6
- package/dist/components/tab-strip/tab-visibility-filter.d.ts +4 -2
- package/dist/components/tree-list/tree-list-visibility-filter.d.ts +11 -3
- package/dist/components/tree-list/tree-list.types.d.ts +7 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +4471 -4328
- package/dist/index.js.map +1 -1
- package/dist/mermaid-renderer-CPGj6vsb.js +570 -0
- package/dist/mermaid-renderer-CPGj6vsb.js.map +1 -0
- package/dist/{resource-badge-D33IFv74.js → resource-badge-CeJTOn8F.js} +41 -41
- package/dist/resource-badge-CeJTOn8F.js.map +1 -0
- package/dist/{rich-message-BFtvH9H7.js → rich-message-DNSEhxXh.js} +4 -4
- package/dist/{rich-message-BFtvH9H7.js.map → rich-message-DNSEhxXh.js.map} +1 -1
- package/dist/rich-text.js +405 -399
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/shadowless-default-config.d.ts +2 -0
- package/dist/{theme-C5qHTCU9.js → theme-25P7ij4C.js} +209 -239
- package/dist/theme-25P7ij4C.js.map +1 -0
- package/dist/theme.js +1 -1
- package/package.json +1 -1
- package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -7
- package/dist/mermaid-renderer-DYEiYmYQ.js +0 -411
- package/dist/mermaid-renderer-DYEiYmYQ.js.map +0 -1
- package/dist/resource-badge-D33IFv74.js.map +0 -1
- package/dist/theme/tokens/shadows.d.ts +0 -64
- package/dist/theme-C5qHTCU9.js.map +0 -1
package/dist/chat-ui.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as a, jsxs as k, Fragment as
|
|
1
|
+
import { jsx as a, jsxs as k, Fragment as Ot } from "react/jsx-runtime";
|
|
2
2
|
import { c as T } from "react/compiler-runtime";
|
|
3
|
-
import { chakra as
|
|
4
|
-
import { ArrowDownIcon as
|
|
5
|
-
import { StickToBottom as
|
|
6
|
-
import { S as ht, R as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { i as
|
|
3
|
+
import { chakra as Fn, AbsoluteCenter as zn, IconButton as $t, defineSlotRecipe as qn, createSlotRecipeContext as Hn, Text as X, Code as jt, Button as Ze, HStack as Me, Box as I, Flex as Re, Stack as Y, Textarea as Qn, Tooltip as dt, Portal as Wn, Kbd as Nn, Spacer as Vn, Timeline as jn, Span as Je, Avatar as We, Card as ue, Link as sn, Spinner as Ft, Image as Un, Skeleton as Kn } from "@chakra-ui/react";
|
|
4
|
+
import { ArrowDownIcon as Gn, ShieldX as Xn, ShieldCheck as Yn, Check as rn, Square as Jn, ArrowUp as Zn, Copy as eo, Move as to, FileDown as no, FileUp as oo, FileDiff as so, Trash2 as ro, FilePen as io, FileText as lo, ListTree as ao, Terminal as ln, ListTodo as co, CircleQuestionMark as uo, File as fo, Globe as po, Search as mo, AlertTriangle as an, DotIcon as ho, ChevronUpIcon as go, MessageCircleIcon as bo } from "lucide-react";
|
|
5
|
+
import { StickToBottom as yo, useStickToBottomContext as mt } from "use-stick-to-bottom";
|
|
6
|
+
import { S as ht, R as zt, T as cn } from "./resource-badge-CeJTOn8F.js";
|
|
7
|
+
import { Fragment as xo, useRef as Ne, useEffect as Ae, useState as G } from "react";
|
|
8
|
+
import { i as Mt, P as So, h as To, R as un } from "./rich-message-DNSEhxXh.js";
|
|
9
9
|
import "@lexical/react/LexicalCollaborationContext";
|
|
10
10
|
import "@lexical/react/LexicalCollaborationPlugin";
|
|
11
11
|
import "@lexical/react/LexicalComposer";
|
|
@@ -30,17 +30,18 @@ import "@lexical/markdown";
|
|
|
30
30
|
import "@lexical/react/LexicalAutoFocusPlugin";
|
|
31
31
|
import "@lexical/react/LexicalCheckListPlugin";
|
|
32
32
|
import "@lexical/react/LexicalHistoryPlugin";
|
|
33
|
+
import "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
33
34
|
import "@lexical/react/LexicalOnChangePlugin";
|
|
34
35
|
import "@lexical/react/LexicalTreeView";
|
|
35
36
|
import "@lexical/react/LexicalClickableLinkPlugin";
|
|
36
|
-
import { C as
|
|
37
|
-
import { useVirtualizer as
|
|
38
|
-
const
|
|
37
|
+
import { C as dn, R as wo, a as ko, D as Co, b as fn, A as Ut, E as Ao } from "./radio-DJtQY9po.js";
|
|
38
|
+
import { useVirtualizer as _o } from "@tanstack/react-virtual";
|
|
39
|
+
const Ro = {
|
|
39
40
|
"aria-roledescription": "conversation",
|
|
40
41
|
initial: "instant",
|
|
41
42
|
resize: "instant",
|
|
42
43
|
role: "log"
|
|
43
|
-
},
|
|
44
|
+
}, Io = Fn(yo, {
|
|
44
45
|
base: {
|
|
45
46
|
position: "relative",
|
|
46
47
|
flex: 1,
|
|
@@ -49,8 +50,8 @@ const Io = {
|
|
|
49
50
|
}
|
|
50
51
|
}, {
|
|
51
52
|
forwardProps: ["initial", "resize"],
|
|
52
|
-
defaultProps:
|
|
53
|
-
}),
|
|
53
|
+
defaultProps: Ro
|
|
54
|
+
}), Po = (t) => {
|
|
54
55
|
const e = T(10);
|
|
55
56
|
let n, s;
|
|
56
57
|
e[0] !== t ? ({
|
|
@@ -71,22 +72,22 @@ const Io = {
|
|
|
71
72
|
}, e[3] = c, e[4] = u) : (c = e[3], u = e[4]);
|
|
72
73
|
let d;
|
|
73
74
|
return e[5] !== n || e[6] !== s || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ a(ht, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: c, contentProps: u, children: n }), e[5] = n, e[6] = s, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
|
|
74
|
-
},
|
|
75
|
+
}, Mo = {
|
|
75
76
|
axis: "horizontal",
|
|
76
77
|
bottom: "md",
|
|
77
78
|
zIndex: 2
|
|
78
|
-
},
|
|
79
|
+
}, Eo = (t) => {
|
|
79
80
|
const e = T(4), {
|
|
80
81
|
isAtBottom: n,
|
|
81
82
|
scrollToBottom: s
|
|
82
83
|
} = mt();
|
|
83
84
|
let o;
|
|
84
|
-
return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ a(
|
|
85
|
-
},
|
|
86
|
-
Root:
|
|
87
|
-
Viewport:
|
|
88
|
-
ScrollToBottom:
|
|
89
|
-
},
|
|
85
|
+
return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ a(zn, { ...Mo, children: /* @__PURE__ */ a($t, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ a(Gn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
|
|
86
|
+
}, Et = {
|
|
87
|
+
Root: Io,
|
|
88
|
+
Viewport: Po,
|
|
89
|
+
ScrollToBottom: Eo
|
|
90
|
+
}, vo = qn({
|
|
90
91
|
className: "ai-message",
|
|
91
92
|
slots: ["root", "content"],
|
|
92
93
|
base: {
|
|
@@ -196,14 +197,14 @@ const Io = {
|
|
|
196
197
|
shape: "rounded"
|
|
197
198
|
}
|
|
198
199
|
}), {
|
|
199
|
-
withProvider:
|
|
200
|
-
withContext:
|
|
201
|
-
} =
|
|
202
|
-
recipe:
|
|
203
|
-
}),
|
|
204
|
-
Root:
|
|
205
|
-
Content:
|
|
206
|
-
},
|
|
200
|
+
withProvider: Lo,
|
|
201
|
+
withContext: Do
|
|
202
|
+
} = Hn({
|
|
203
|
+
recipe: vo
|
|
204
|
+
}), Bo = Lo("div", "root"), Oo = Do("div", "content"), _e = {
|
|
205
|
+
Root: Bo,
|
|
206
|
+
Content: Oo
|
|
207
|
+
}, $o = (t) => {
|
|
207
208
|
if (t == null) return null;
|
|
208
209
|
const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
|
|
209
210
|
return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
|
|
@@ -215,25 +216,25 @@ const Io = {
|
|
|
215
216
|
onDeny: r
|
|
216
217
|
} = t;
|
|
217
218
|
let i;
|
|
218
|
-
e[0] !== s ? (i =
|
|
219
|
+
e[0] !== s ? (i = $o(s), e[0] = s, e[1] = i) : i = e[1];
|
|
219
220
|
const l = i;
|
|
220
221
|
let c;
|
|
221
222
|
e[2] !== n ? (c = /* @__PURE__ */ k(X, { textStyle: "label/S/medium", color: "fg", children: [
|
|
222
223
|
"Allow ",
|
|
223
|
-
/* @__PURE__ */ a(
|
|
224
|
+
/* @__PURE__ */ a(jt, { size: "sm", children: n }),
|
|
224
225
|
"?"
|
|
225
226
|
] }), e[2] = n, e[3] = c) : c = e[3];
|
|
226
227
|
let u;
|
|
227
|
-
e[4] !== l ? (u = l ? /* @__PURE__ */ a(ht, { maxH: "6rem", children: /* @__PURE__ */ a(
|
|
228
|
+
e[4] !== l ? (u = l ? /* @__PURE__ */ a(ht, { maxH: "6rem", children: /* @__PURE__ */ a(jt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
|
|
228
229
|
let d;
|
|
229
|
-
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ a(
|
|
230
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ a(Xn, { size: 14 }), e[6] = d) : d = e[6];
|
|
230
231
|
let f;
|
|
231
232
|
e[7] !== r ? (f = /* @__PURE__ */ k(Ze, { size: "xs", variant: "outline", onClick: r, children: [
|
|
232
233
|
d,
|
|
233
234
|
"Deny"
|
|
234
235
|
] }), e[7] = r, e[8] = f) : f = e[8];
|
|
235
236
|
let m;
|
|
236
|
-
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ a(
|
|
237
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ a(Yn, { size: 14 }), e[9] = m) : m = e[9];
|
|
237
238
|
let p;
|
|
238
239
|
e[10] !== o ? (p = /* @__PURE__ */ k(Ze, { size: "xs", colorPalette: "green", onClick: o, children: [
|
|
239
240
|
m,
|
|
@@ -250,7 +251,7 @@ const Io = {
|
|
|
250
251
|
u,
|
|
251
252
|
h
|
|
252
253
|
] }) }), e[15] = c, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
|
|
253
|
-
},
|
|
254
|
+
}, Fo = "md", zo = "neutral", ul = (t) => {
|
|
254
255
|
const e = T(17), {
|
|
255
256
|
attachments: n,
|
|
256
257
|
onSelect: s,
|
|
@@ -261,7 +262,7 @@ const Io = {
|
|
|
261
262
|
} = t;
|
|
262
263
|
let c;
|
|
263
264
|
e[0] !== n ? (c = n === void 0 ? [] : n, e[0] = n, e[1] = c) : c = e[1];
|
|
264
|
-
const u = c, d = i === void 0 ?
|
|
265
|
+
const u = c, d = i === void 0 ? Fo : i, f = l === void 0 ? zo : l;
|
|
265
266
|
if (u.length === 0)
|
|
266
267
|
return null;
|
|
267
268
|
let m;
|
|
@@ -277,22 +278,22 @@ const Io = {
|
|
|
277
278
|
size: d,
|
|
278
279
|
tone: f
|
|
279
280
|
});
|
|
280
|
-
return /* @__PURE__ */ a(
|
|
281
|
+
return /* @__PURE__ */ a(xo, { children: x }, g);
|
|
281
282
|
}
|
|
282
|
-
return /* @__PURE__ */ a(
|
|
283
|
+
return /* @__PURE__ */ a(zt, { fileName: g, onSelect: y, onRemove: b, size: d, tone: f }, g);
|
|
283
284
|
}, e[9] = o, e[10] = s, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], m = u.map(h), e[2] = u, e[3] = o, e[4] = s, e[5] = r, e[6] = d, e[7] = f, e[8] = m;
|
|
284
285
|
} else
|
|
285
286
|
m = e[8];
|
|
286
287
|
let p;
|
|
287
288
|
return e[15] !== m ? (p = /* @__PURE__ */ a(Y, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: m }), e[15] = m, e[16] = p) : p = e[16], p;
|
|
288
|
-
},
|
|
289
|
+
}, qo = (t) => {
|
|
289
290
|
const {
|
|
290
291
|
previousUserMessageCount: e,
|
|
291
292
|
userMessageCount: n
|
|
292
293
|
} = t;
|
|
293
294
|
return e === 0 ? !1 : n > e;
|
|
294
295
|
};
|
|
295
|
-
function
|
|
296
|
+
function Ho(t) {
|
|
296
297
|
const e = T(4), {
|
|
297
298
|
userMessageCount: n
|
|
298
299
|
} = t, {
|
|
@@ -300,28 +301,28 @@ function Qo(t) {
|
|
|
300
301
|
} = mt(), o = Ne(n);
|
|
301
302
|
let r, i;
|
|
302
303
|
return e[0] !== s || e[1] !== n ? (r = () => {
|
|
303
|
-
|
|
304
|
+
qo({
|
|
304
305
|
previousUserMessageCount: o.current,
|
|
305
306
|
userMessageCount: n
|
|
306
307
|
}) && s(), o.current = n;
|
|
307
308
|
}, i = [n, s], e[0] = s, e[1] = n, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), Ae(r, i), null;
|
|
308
309
|
}
|
|
309
|
-
const
|
|
310
|
+
const pn = (t) => t.trim().length > 0, Qo = (t) => {
|
|
310
311
|
const {
|
|
311
312
|
isDisabled: e,
|
|
312
313
|
streaming: n,
|
|
313
314
|
text: s
|
|
314
315
|
} = t;
|
|
315
|
-
return e || n || !
|
|
316
|
-
},
|
|
316
|
+
return e || n || !pn(s) ? "none" : "submit";
|
|
317
|
+
}, Wo = (t) => {
|
|
317
318
|
const {
|
|
318
319
|
canInterrupt: e,
|
|
319
320
|
isDisabled: n,
|
|
320
321
|
streaming: s,
|
|
321
322
|
text: o
|
|
322
323
|
} = t;
|
|
323
|
-
return n ? "none" : s ? e ? "interrupt" : "none" :
|
|
324
|
-
},
|
|
324
|
+
return n ? "none" : s ? e ? "interrupt" : "none" : pn(o) ? "submit" : "none";
|
|
325
|
+
}, mn = 200, No = (t, e = mn) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, Vo = (t) => {
|
|
325
326
|
const {
|
|
326
327
|
onAttachFiles: e,
|
|
327
328
|
onAttachText: n,
|
|
@@ -342,12 +343,12 @@ const mn = (t) => t.trim().length > 0, Wo = (t) => {
|
|
|
342
343
|
return;
|
|
343
344
|
}
|
|
344
345
|
const u = l.clipboardData.getData("text/plain");
|
|
345
|
-
n &&
|
|
346
|
+
n && No(u, s) && (l.preventDefault(), n(u));
|
|
346
347
|
}
|
|
347
348
|
};
|
|
348
|
-
},
|
|
349
|
+
}, jo = (t) => {
|
|
349
350
|
t.preventDefault();
|
|
350
|
-
},
|
|
351
|
+
}, hn = (t) => {
|
|
351
352
|
const e = T(7), {
|
|
352
353
|
option: n
|
|
353
354
|
} = t;
|
|
@@ -360,7 +361,7 @@ const mn = (t) => t.trim().length > 0, Wo = (t) => {
|
|
|
360
361
|
s,
|
|
361
362
|
o
|
|
362
363
|
] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
|
|
363
|
-
},
|
|
364
|
+
}, Uo = (t) => {
|
|
364
365
|
const e = T(12), {
|
|
365
366
|
option: n,
|
|
366
367
|
name: s,
|
|
@@ -374,10 +375,10 @@ const mn = (t) => t.trim().length > 0, Wo = (t) => {
|
|
|
374
375
|
}, e[0] = r, e[1] = u) : u = e[1];
|
|
375
376
|
const d = r ? i : void 0;
|
|
376
377
|
let f;
|
|
377
|
-
e[2] !== n ? (f = /* @__PURE__ */ a(
|
|
378
|
+
e[2] !== n ? (f = /* @__PURE__ */ a(hn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
|
|
378
379
|
let m;
|
|
379
|
-
return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== c || e[8] !== u || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ a(
|
|
380
|
-
},
|
|
380
|
+
return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== c || e[8] !== u || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ a(dn, { name: s, checked: o, readOnly: l, "aria-readonly": c, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = l, e[7] = c, e[8] = u, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
|
|
381
|
+
}, Ko = (t) => {
|
|
381
382
|
const e = T(17), {
|
|
382
383
|
question: n,
|
|
383
384
|
questionIndex: s,
|
|
@@ -393,22 +394,22 @@ const mn = (t) => t.trim().length > 0, Wo = (t) => {
|
|
|
393
394
|
let m;
|
|
394
395
|
if (e[5] !== i || e[6] !== n.options) {
|
|
395
396
|
let h;
|
|
396
|
-
e[8] !== i ? (h = (g) => /* @__PURE__ */ a(
|
|
397
|
+
e[8] !== i ? (h = (g) => /* @__PURE__ */ a(wo, { value: g.label, inputProps: i ? void 0 : {
|
|
397
398
|
tabIndex: -1
|
|
398
|
-
}, alignItems: "flex-start", children: /* @__PURE__ */ a(
|
|
399
|
+
}, alignItems: "flex-start", children: /* @__PURE__ */ a(hn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], m = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = m;
|
|
399
400
|
} else
|
|
400
401
|
m = e[7];
|
|
401
402
|
let p;
|
|
402
|
-
return e[10] !== o || e[11] !== c || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ a(
|
|
403
|
-
},
|
|
403
|
+
return e[10] !== o || e[11] !== c || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ a(ko, { name: o, value: c, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = o, e[11] = c, e[12] = u, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
|
|
404
|
+
}, Go = (t) => {
|
|
404
405
|
const e = T(4), {
|
|
405
406
|
items: n
|
|
406
407
|
} = t;
|
|
407
408
|
let s;
|
|
408
|
-
e[0] !== n ? (s = n.map(
|
|
409
|
+
e[0] !== n ? (s = n.map(Xo), e[0] = n, e[1] = s) : s = e[1];
|
|
409
410
|
let o;
|
|
410
411
|
return e[2] !== s ? (o = /* @__PURE__ */ a(Y, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
|
|
411
|
-
},
|
|
412
|
+
}, gn = (t) => {
|
|
412
413
|
const e = T(19), {
|
|
413
414
|
questions: n,
|
|
414
415
|
editable: s,
|
|
@@ -430,21 +431,21 @@ const mn = (t) => t.trim().length > 0, Wo = (t) => {
|
|
|
430
431
|
const x = y.id ?? `question-${b}`, C = y.multiple ? "checkbox" : "radio", A = d[x] ?? [];
|
|
431
432
|
return /* @__PURE__ */ k(Y, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
|
|
432
433
|
/* @__PURE__ */ a(X, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: y.question }),
|
|
433
|
-
C === "radio" ? /* @__PURE__ */ a(
|
|
434
|
-
y.allowCustomAnswer ? /* @__PURE__ */ a(
|
|
434
|
+
C === "radio" ? /* @__PURE__ */ a(Ko, { question: y, questionIndex: b, name: x, selectedOption: A[0], editable: c, onToggleOption: i }) : y.options.map((w) => /* @__PURE__ */ a(Uo, { option: w, name: x, checked: A.includes(w.label), editable: c, onToggle: () => i?.(y, b, w.label) }, w.label)),
|
|
435
|
+
y.allowCustomAnswer ? /* @__PURE__ */ a(Qn, { readOnly: !c, "aria-readonly": c ? void 0 : "true", value: m[x] ?? "", placeholder: c ? "Answer..." : "Custom answer", "aria-label": y.question, rows: 2, borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "xs", resize: c ? "vertical" : "none", color: "fg", onChange: (w) => l?.(y, b, w.currentTarget.value) }) : null
|
|
435
436
|
] }, x);
|
|
436
437
|
}, e[11] = m, e[12] = c, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = c, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
|
|
437
438
|
} else
|
|
438
439
|
p = e[10];
|
|
439
440
|
let h;
|
|
440
|
-
return e[17] !== p ? (h = /* @__PURE__ */ a(Y, { as: "form", gap: "sm", onSubmit:
|
|
441
|
+
return e[17] !== p ? (h = /* @__PURE__ */ a(Y, { as: "form", gap: "sm", onSubmit: jo, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
|
|
441
442
|
};
|
|
442
|
-
function
|
|
443
|
-
return /* @__PURE__ */ a(I, { as: "li", children: /* @__PURE__ */ a(
|
|
443
|
+
function Xo(t, e) {
|
|
444
|
+
return /* @__PURE__ */ a(I, { as: "li", children: /* @__PURE__ */ a(dn, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
|
|
444
445
|
tabIndex: -1
|
|
445
446
|
}, size: "xs", children: /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
|
|
446
447
|
}
|
|
447
|
-
const de = (t, e) => t.id ?? `question-${e}`,
|
|
448
|
+
const de = (t, e) => t.id ?? `question-${e}`, Dt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
|
|
448
449
|
id: de(e, n),
|
|
449
450
|
question: e.question,
|
|
450
451
|
multiple: !!e.multiple,
|
|
@@ -454,15 +455,15 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
454
455
|
label: s.label,
|
|
455
456
|
description: s.description ?? ""
|
|
456
457
|
}))
|
|
457
|
-
}))) : "",
|
|
458
|
+
}))) : "", Yo = (t, e, n) => {
|
|
458
459
|
const s = [];
|
|
459
460
|
for (let o = 0; o < t.questions.length; o += 1) {
|
|
460
461
|
const r = t.questions[o], i = de(r, o), l = e[i] ?? [], c = n[i]?.trim(), u = c ? [...l, c] : l;
|
|
461
462
|
u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
|
|
462
463
|
}
|
|
463
464
|
return s;
|
|
464
|
-
},
|
|
465
|
-
if (
|
|
465
|
+
}, Jo = (t) => typeof t != "string", qt = (t, e) => {
|
|
466
|
+
if (Jo(e)) return e;
|
|
466
467
|
const n = e.trim();
|
|
467
468
|
if (n.length === 0) return {};
|
|
468
469
|
const s = {};
|
|
@@ -471,20 +472,20 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
471
472
|
r.allowCustomAnswer && (s[de(r, o)] = n);
|
|
472
473
|
}
|
|
473
474
|
return s;
|
|
474
|
-
},
|
|
475
|
+
}, Zo = (t, e, n) => {
|
|
475
476
|
if (!t) return typeof n == "string" ? n.trim() : "";
|
|
476
|
-
const s =
|
|
477
|
+
const s = qt(t, n), o = Yo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
|
|
477
478
|
return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
|
|
478
479
|
`);
|
|
479
|
-
},
|
|
480
|
-
const s =
|
|
480
|
+
}, es = (t, e, n) => {
|
|
481
|
+
const s = qt(t, n);
|
|
481
482
|
return t.questions.map((o, r) => {
|
|
482
483
|
const i = de(o, r), l = e[i] ?? [], c = s[i]?.trim();
|
|
483
484
|
return c ? [...l, c] : l;
|
|
484
485
|
});
|
|
485
|
-
},
|
|
486
|
+
}, ts = (t, e, n) => {
|
|
486
487
|
if (!t) return !1;
|
|
487
|
-
const s =
|
|
488
|
+
const s = qt(t, n);
|
|
488
489
|
for (let o = 0; o < t.questions.length; o += 1) {
|
|
489
490
|
const r = t.questions[o];
|
|
490
491
|
if (!r.required) continue;
|
|
@@ -493,17 +494,17 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
493
494
|
return !0;
|
|
494
495
|
}
|
|
495
496
|
return !1;
|
|
496
|
-
},
|
|
497
|
+
}, ns = (t) => t.questions.map((e, n) => ({
|
|
497
498
|
id: de(e, n),
|
|
498
499
|
question: e.question,
|
|
499
500
|
options: e.options,
|
|
500
501
|
multiple: !!e.multiple,
|
|
501
502
|
required: !!e.required,
|
|
502
503
|
allowCustomAnswer: !!e.allowCustomAnswer
|
|
503
|
-
})),
|
|
504
|
+
})), os = (t, e, n, s) => {
|
|
504
505
|
const o = de(t, e);
|
|
505
506
|
return (n[o] ?? []).length > 0 || !!s[o]?.trim();
|
|
506
|
-
},
|
|
507
|
+
}, ss = (t) => {
|
|
507
508
|
const e = T(22), {
|
|
508
509
|
question: n,
|
|
509
510
|
sourceQuestion: s,
|
|
@@ -514,17 +515,17 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
514
515
|
onSelectStep: c
|
|
515
516
|
} = t;
|
|
516
517
|
let u;
|
|
517
|
-
e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u =
|
|
518
|
+
e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u = os(s, o, i, l), e[0] = l, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
|
|
518
519
|
const d = u, f = d ? "answered" : "not answered", m = r ? "outline" : "ghost", p = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
|
|
519
520
|
let y;
|
|
520
521
|
e[5] !== c || e[6] !== o ? (y = () => c(o), e[5] = c, e[6] = o, e[7] = y) : y = e[7];
|
|
521
522
|
let b;
|
|
522
|
-
e[8] !== d || e[9] !== o ? (b = d ? /* @__PURE__ */ a(
|
|
523
|
+
e[8] !== d || e[9] !== o ? (b = d ? /* @__PURE__ */ a(rn, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = b) : b = e[10];
|
|
523
524
|
let x;
|
|
524
525
|
e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== y || e[16] !== b || e[17] !== m ? (x = /* @__PURE__ */ a(Ze, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: y, children: b }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = y, e[16] = b, e[17] = m, e[18] = x) : x = e[18];
|
|
525
526
|
let C;
|
|
526
|
-
return e[19] !== n.question || e[20] !== x ? (C = /* @__PURE__ */ a(
|
|
527
|
-
},
|
|
527
|
+
return e[19] !== n.question || e[20] !== x ? (C = /* @__PURE__ */ a(cn, { content: n.question, showArrow: !0, children: x }), e[19] = n.question, e[20] = x, e[21] = C) : C = e[21], C;
|
|
528
|
+
}, rs = (t) => {
|
|
528
529
|
const e = T(31), {
|
|
529
530
|
questionPrompt: n,
|
|
530
531
|
selectedOptionsByQuestion: s,
|
|
@@ -535,7 +536,7 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
535
536
|
questions: l
|
|
536
537
|
} = t, [c, u] = G(0), d = Math.min(c, l.length - 1), f = l[d], m = l.length > 1;
|
|
537
538
|
let p;
|
|
538
|
-
e[0] !== o || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (p = m ? /* @__PURE__ */ a(Me, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((M, P) => /* @__PURE__ */ a(
|
|
539
|
+
e[0] !== o || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (p = m ? /* @__PURE__ */ a(Me, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((M, P) => /* @__PURE__ */ a(ss, { question: M, sourceQuestion: n.questions[P], questionIndex: P, isActive: P === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, M.id)) }) : null, e[0] = o, e[1] = m, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = s, e[6] = p) : p = e[6];
|
|
539
540
|
const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, y = m ? `question-step-tab-${f.id}` : void 0;
|
|
540
541
|
let b;
|
|
541
542
|
e[7] !== f ? (b = [f], e[7] = f, e[8] = b) : b = e[8];
|
|
@@ -548,7 +549,7 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
548
549
|
i(n.questions[d], d, v);
|
|
549
550
|
}, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = C) : C = e[16];
|
|
550
551
|
let A;
|
|
551
|
-
e[17] !== o || e[18] !== s || e[19] !== b || e[20] !== x || e[21] !== C ? (A = /* @__PURE__ */ a(
|
|
552
|
+
e[17] !== o || e[18] !== s || e[19] !== b || e[20] !== x || e[21] !== C ? (A = /* @__PURE__ */ a(gn, { questions: b, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: x, onCustomAnswerChange: C }), e[17] = o, e[18] = s, e[19] = b, e[20] = x, e[21] = C, e[22] = A) : A = e[22];
|
|
552
553
|
let w;
|
|
553
554
|
e[23] !== h || e[24] !== g || e[25] !== y || e[26] !== A ? (w = /* @__PURE__ */ a(Y, { id: h, role: g, "aria-labelledby": y, gap: "0", children: A }), e[23] = h, e[24] = g, e[25] = y, e[26] = A, e[27] = w) : w = e[27];
|
|
554
555
|
let _;
|
|
@@ -556,19 +557,19 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
556
557
|
p,
|
|
557
558
|
w
|
|
558
559
|
] }), e[28] = p, e[29] = w, e[30] = _) : _ = e[30], _;
|
|
559
|
-
},
|
|
560
|
+
}, is = (t) => {
|
|
560
561
|
const e = T(8), {
|
|
561
562
|
questionPrompt: n
|
|
562
563
|
} = t;
|
|
563
564
|
let s;
|
|
564
|
-
e[0] !== n ? (s =
|
|
565
|
+
e[0] !== n ? (s = ns(n), e[0] = n, e[1] = s) : s = e[1];
|
|
565
566
|
const o = s;
|
|
566
567
|
let r;
|
|
567
|
-
e[2] !== n ? (r =
|
|
568
|
+
e[2] !== n ? (r = Dt(n), e[2] = n, e[3] = r) : r = e[3];
|
|
568
569
|
const i = r;
|
|
569
570
|
let l;
|
|
570
|
-
return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ a(
|
|
571
|
-
},
|
|
571
|
+
return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ a(rs, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = l) : l = e[7], l;
|
|
572
|
+
}, ls = (t) => {
|
|
572
573
|
const e = T(22);
|
|
573
574
|
let n, s, o, r;
|
|
574
575
|
e[0] !== t ? ({
|
|
@@ -579,23 +580,23 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
579
580
|
} = 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]);
|
|
580
581
|
const i = s["aria-label"] ?? r;
|
|
581
582
|
let l;
|
|
582
|
-
e[5] !== n ? (l = n ? /* @__PURE__ */ a(
|
|
583
|
+
e[5] !== n ? (l = n ? /* @__PURE__ */ a(Jn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ a(Zn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
|
|
583
584
|
const c = l;
|
|
584
585
|
let u;
|
|
585
|
-
e[7] !== i || e[8] !== c || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ a(
|
|
586
|
+
e[7] !== i || e[8] !== c || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ a($t, { "data-testid": "send-message-button", size: "sm", variant: "primary", borderRadius: "full", "aria-label": i, title: r, ...s, children: c }), e[7] = i, e[8] = c, e[9] = s, e[10] = r, e[11] = u) : u = e[11];
|
|
586
587
|
const d = u;
|
|
587
588
|
if (r) {
|
|
588
589
|
let f;
|
|
589
|
-
e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k(
|
|
590
|
+
e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k(Ot, { children: [
|
|
590
591
|
r,
|
|
591
592
|
" ",
|
|
592
|
-
/* @__PURE__ */ a(
|
|
593
|
+
/* @__PURE__ */ a(Nn, { fontSize: "xs", children: o })
|
|
593
594
|
] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
|
|
594
595
|
const m = f;
|
|
595
596
|
let p;
|
|
596
597
|
e[15] !== d ? (p = /* @__PURE__ */ a(dt.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
|
|
597
598
|
let h;
|
|
598
|
-
e[17] !== m ? (h = /* @__PURE__ */ a(
|
|
599
|
+
e[17] !== m ? (h = /* @__PURE__ */ a(Wn, { children: /* @__PURE__ */ a(dt.Positioner, { children: /* @__PURE__ */ a(dt.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
|
|
599
600
|
let g;
|
|
600
601
|
return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ k(dt.Root, { closeDelay: 50, openDelay: 100, children: [
|
|
601
602
|
p,
|
|
@@ -603,7 +604,7 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
603
604
|
] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
|
|
604
605
|
}
|
|
605
606
|
return d;
|
|
606
|
-
},
|
|
607
|
+
}, as = (t) => {
|
|
607
608
|
const e = T(2), {
|
|
608
609
|
placeholder: n
|
|
609
610
|
} = t;
|
|
@@ -611,8 +612,8 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
611
612
|
return null;
|
|
612
613
|
let s;
|
|
613
614
|
return e[0] !== n ? (s = /* @__PURE__ */ a(X, { 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;
|
|
614
|
-
},
|
|
615
|
-
const e = T(
|
|
615
|
+
}, cs = (t) => {
|
|
616
|
+
const e = T(100), {
|
|
616
617
|
defaultState: n,
|
|
617
618
|
onSubmit: s,
|
|
618
619
|
onInterrupt: o,
|
|
@@ -630,12 +631,12 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
630
631
|
attachedToTop: y,
|
|
631
632
|
questionPrompt: b,
|
|
632
633
|
autoFocus: x
|
|
633
|
-
} = t, C = s === void 0 ?
|
|
634
|
+
} = t, C = s === void 0 ? us : s, A = l === void 0 ? mn : l, w = c === void 0 ? !1 : c;
|
|
634
635
|
let _;
|
|
635
636
|
e[0] !== u ? (_ = u === void 0 ? [] : u, e[0] = u, e[1] = _) : _ = e[1];
|
|
636
|
-
const M = _, P = f === void 0 ? !1 : f, v = y === void 0 ? !1 : y, L = x === void 0 ? !1 : x, [
|
|
637
|
+
const M = _, P = f === void 0 ? !1 : f, v = y === void 0 ? !1 : y, L = x === void 0 ? !1 : x, [H, J] = G(!1), [B, ve] = G(n), [je, Le] = G(0);
|
|
637
638
|
let he;
|
|
638
|
-
e[2] !== n ? (he = () =>
|
|
639
|
+
e[2] !== n ? (he = () => Mt(n), e[2] = n, e[3] = he) : he = e[3];
|
|
639
640
|
const [F, z] = G(he);
|
|
640
641
|
let ee;
|
|
641
642
|
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = {}, e[4] = ee) : ee = e[4];
|
|
@@ -644,7 +645,7 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
644
645
|
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = {}, e[5] = be) : be = e[5];
|
|
645
646
|
const [O, De] = G(be), Ue = Ne(null), Ke = Ne(m);
|
|
646
647
|
let Be;
|
|
647
|
-
e[6] !== b ? (Be =
|
|
648
|
+
e[6] !== b ? (Be = Dt(b), e[6] = b, e[7] = Be) : Be = e[7];
|
|
648
649
|
const Ie = Ne(Be);
|
|
649
650
|
let te, Ge;
|
|
650
651
|
e[8] !== m ? (te = () => {
|
|
@@ -652,11 +653,11 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
652
653
|
}, Ge = [m], e[8] = m, e[9] = te, e[10] = Ge) : (te = e[9], Ge = e[10]), Ae(te, Ge);
|
|
653
654
|
let ye, ne;
|
|
654
655
|
e[11] !== n ? (ye = () => {
|
|
655
|
-
const R =
|
|
656
|
-
ve(n), Le(
|
|
656
|
+
const R = Mt(n);
|
|
657
|
+
ve(n), Le(ds), z(R), ge({}), De({}), Ke.current?.(R);
|
|
657
658
|
}, ne = [n], e[11] = n, e[12] = ye, e[13] = ne) : (ye = e[12], ne = e[13]), Ae(ye, ne);
|
|
658
659
|
let xe;
|
|
659
|
-
e[14] !== b ? (xe =
|
|
660
|
+
e[14] !== b ? (xe = Dt(b), e[14] = b, e[15] = xe) : xe = e[15];
|
|
660
661
|
const oe = xe;
|
|
661
662
|
let se, re;
|
|
662
663
|
e[16] !== oe ? (se = () => {
|
|
@@ -686,8 +687,8 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
686
687
|
let N;
|
|
687
688
|
e[24] !== n ? (N = (R) => {
|
|
688
689
|
const ke = R === void 0 ? !1 : R;
|
|
689
|
-
ve(n), Le(
|
|
690
|
-
const ce =
|
|
690
|
+
ve(n), Le(fs);
|
|
691
|
+
const ce = Mt(n);
|
|
691
692
|
z(ce), ge({}), De({}), Ke.current?.(ce), ke && requestAnimationFrame(() => {
|
|
692
693
|
ie();
|
|
693
694
|
});
|
|
@@ -695,14 +696,14 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
695
696
|
const Z = N, V = w && !!o;
|
|
696
697
|
let $, D, j;
|
|
697
698
|
if (e[26] !== V || e[27] !== O || e[28] !== P || e[29] !== b || e[30] !== E || e[31] !== w || e[32] !== F) {
|
|
698
|
-
D = b ?
|
|
699
|
-
const R =
|
|
699
|
+
D = b ? Zo(b, E, O) : F.trim();
|
|
700
|
+
const R = ts(b, E, O);
|
|
700
701
|
$ = {
|
|
701
702
|
canInterrupt: V,
|
|
702
703
|
isDisabled: P || R,
|
|
703
704
|
streaming: w,
|
|
704
705
|
text: D
|
|
705
|
-
}, j =
|
|
706
|
+
}, j = Wo($), e[26] = V, e[27] = O, e[28] = P, e[29] = b, e[30] = E, e[31] = w, e[32] = F, e[33] = $, e[34] = D, e[35] = j;
|
|
706
707
|
} else
|
|
707
708
|
$ = e[33], D = e[34], j = e[35];
|
|
708
709
|
const U = j;
|
|
@@ -711,28 +712,28 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
711
712
|
if (!D)
|
|
712
713
|
return;
|
|
713
714
|
const R = b ? {
|
|
714
|
-
answers:
|
|
715
|
+
answers: es(b, E, O)
|
|
715
716
|
} : void 0;
|
|
716
717
|
C(D, M, R), Z(!0), d?.();
|
|
717
718
|
}, e[36] = M, e[37] = O, e[38] = d, e[39] = C, e[40] = b, e[41] = Z, e[42] = D, e[43] = E, e[44] = le) : le = e[44];
|
|
718
|
-
const
|
|
719
|
+
const q = le;
|
|
719
720
|
let we;
|
|
720
|
-
e[45] !== o || e[46] !==
|
|
721
|
+
e[45] !== o || e[46] !== q ? (we = (R) => {
|
|
721
722
|
if (R === "interrupt") {
|
|
722
723
|
o?.();
|
|
723
724
|
return;
|
|
724
725
|
}
|
|
725
|
-
R === "submit" &&
|
|
726
|
-
}, e[45] = o, e[46] =
|
|
726
|
+
R === "submit" && q();
|
|
727
|
+
}, e[45] = o, e[46] = q, e[47] = we) : we = e[47];
|
|
727
728
|
const K = we;
|
|
728
729
|
let nt;
|
|
729
|
-
e[48] !== $ || e[49] !== K ? (nt = () => K(
|
|
730
|
+
e[48] !== $ || e[49] !== K ? (nt = () => K(Qo($)), e[48] = $, e[49] = K, e[50] = nt) : nt = e[50];
|
|
730
731
|
const xt = nt;
|
|
731
732
|
let ot;
|
|
732
733
|
e[51] !== U || e[52] !== K ? (ot = () => K(U), e[51] = U, e[52] = K, e[53] = ot) : ot = e[53];
|
|
733
734
|
const St = ot;
|
|
734
735
|
let st;
|
|
735
|
-
e[54] !== r || e[55] !== i || e[56] !== A ? (st =
|
|
736
|
+
e[54] !== r || e[55] !== i || e[56] !== A ? (st = Vo({
|
|
736
737
|
onAttachFiles: r,
|
|
737
738
|
onAttachText: i,
|
|
738
739
|
textAttachmentPasteLineThreshold: A
|
|
@@ -742,17 +743,17 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
742
743
|
e[58] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (rt = (R, ke, ce) => {
|
|
743
744
|
const Xe = de(R, ke);
|
|
744
745
|
ge((Ye) => {
|
|
745
|
-
const
|
|
746
|
+
const Pt = Ye[Xe] ?? [], Vt = Pt.includes(ce);
|
|
746
747
|
return R.multiple ? {
|
|
747
748
|
...Ye,
|
|
748
|
-
[Xe]:
|
|
749
|
+
[Xe]: Vt ? Pt.filter(($n) => $n !== ce) : [...Pt, ce]
|
|
749
750
|
} : {
|
|
750
751
|
...Ye,
|
|
751
|
-
[Xe]:
|
|
752
|
+
[Xe]: Vt ? [] : [ce]
|
|
752
753
|
};
|
|
753
754
|
});
|
|
754
755
|
}, e[58] = rt) : rt = e[58];
|
|
755
|
-
const
|
|
756
|
+
const Bn = rt;
|
|
756
757
|
let it;
|
|
757
758
|
e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (it = (R, ke, ce) => {
|
|
758
759
|
const Xe = de(R, ke);
|
|
@@ -761,17 +762,15 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
761
762
|
[Xe]: ce
|
|
762
763
|
}));
|
|
763
764
|
}, e[59] = it) : it = e[59];
|
|
764
|
-
const
|
|
765
|
+
const On = it, Tt = v ? "-1px" : void 0, wt = v ? "0" : void 0, kt = H ? "blue.border" : "border.muted", Ct = H ? 1 : 0, At = H ? "blue.border" : "border";
|
|
765
766
|
let $e;
|
|
766
|
-
e[60] !==
|
|
767
|
-
borderColor:
|
|
768
|
-
boxShadow: "mid",
|
|
767
|
+
e[60] !== At ? ($e = {
|
|
768
|
+
borderColor: At,
|
|
769
769
|
zIndex: 1
|
|
770
|
-
}, e[60] =
|
|
770
|
+
}, e[60] = At, e[61] = $e) : $e = e[61];
|
|
771
771
|
let lt;
|
|
772
772
|
e[62] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (lt = {
|
|
773
773
|
borderColor: "blue.border",
|
|
774
|
-
boxShadow: "mid",
|
|
775
774
|
zIndex: 1
|
|
776
775
|
}, e[62] = lt) : lt = e[62];
|
|
777
776
|
let at;
|
|
@@ -779,16 +778,16 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
779
778
|
let Fe;
|
|
780
779
|
e[64] !== h ? (Fe = h ? /* @__PURE__ */ a(I, { mb: "xs", children: h }) : null, e[64] = h, e[65] = Fe) : Fe = e[65];
|
|
781
780
|
let ze;
|
|
782
|
-
e[66] !== O || e[67] !== je || e[68] !== B || e[69] !== xt || e[70] !== P || e[71] !== m || e[72] !== p || e[73] !== b || e[74] !== E ? (ze = b ? /* @__PURE__ */ a(
|
|
781
|
+
e[66] !== O || e[67] !== je || e[68] !== B || e[69] !== xt || e[70] !== P || e[71] !== m || e[72] !== p || e[73] !== b || e[74] !== E ? (ze = b ? /* @__PURE__ */ a(is, { questionPrompt: b, selectedOptionsByQuestion: E, customAnswersByQuestion: O, onToggleOption: Bn, onCustomAnswerChange: On }) : /* @__PURE__ */ a(ht, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
|
|
783
782
|
pr: "2xs"
|
|
784
|
-
}, children: /* @__PURE__ */ a(
|
|
783
|
+
}, children: /* @__PURE__ */ a(So, { defaultState: B, isEditable: !P, placeholder: /* @__PURE__ */ a(as, { placeholder: p }), onChange: (R) => {
|
|
785
784
|
z(R), m?.(R);
|
|
786
785
|
}, onSubmit: xt }, je) }), e[66] = O, e[67] = je, e[68] = B, e[69] = xt, e[70] = P, e[71] = m, e[72] = p, e[73] = b, e[74] = E, e[75] = ze) : ze = e[75];
|
|
787
786
|
let ct;
|
|
788
|
-
e[76] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ct = /* @__PURE__ */ a(
|
|
789
|
-
const
|
|
787
|
+
e[76] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ct = /* @__PURE__ */ a(Vn, {}), e[76] = ct) : ct = e[76];
|
|
788
|
+
const _t = V ? "Stop Response" : "Message Sending", Rt = w ? void 0 : "Enter", It = U === "none";
|
|
790
789
|
let qe;
|
|
791
|
-
e[77] !== V || e[78] !== St || e[79] !==
|
|
790
|
+
e[77] !== V || e[78] !== St || e[79] !== _t || e[80] !== Rt || e[81] !== It ? (qe = /* @__PURE__ */ a(ls, { canInterrupt: V, title: _t, shortcut: Rt, onClick: St, disabled: It }), e[77] = V, e[78] = St, e[79] = _t, e[80] = Rt, e[81] = It, e[82] = qe) : qe = e[82];
|
|
792
791
|
let He;
|
|
793
792
|
e[83] !== g || e[84] !== qe ? (He = /* @__PURE__ */ k(Me, { gap: "1", mt: "md", children: [
|
|
794
793
|
g,
|
|
@@ -802,49 +801,49 @@ const de = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.q
|
|
|
802
801
|
He
|
|
803
802
|
] }), e[86] = Fe, e[87] = ze, e[88] = He, e[89] = Qe) : Qe = e[89];
|
|
804
803
|
let ut;
|
|
805
|
-
return e[90] !== ae.onDragOver || e[91] !== ae.onDropCapture || e[92] !== ae.onPasteCapture || e[93] !== Tt || e[94] !== wt || e[95] !== kt || e[96] !== Ct || e[97] !==
|
|
804
|
+
return e[90] !== ae.onDragOver || e[91] !== ae.onDropCapture || e[92] !== ae.onPasteCapture || e[93] !== Tt || e[94] !== wt || e[95] !== kt || e[96] !== Ct || e[97] !== $e || e[98] !== Qe ? (ut = /* @__PURE__ */ a(I, { ref: Ue, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: Tt, bg: "bg", borderRadius: "xs", borderTopRadius: wt, borderWidth: "1px", borderStyle: "solid", borderColor: kt, zIndex: Ct, transition: "border-color 0.2s ease-in-out", _hover: $e, _focusWithin: lt, onPasteCapture: ae.onPasteCapture, onDropCapture: ae.onDropCapture, onDragOver: ae.onDragOver, onClick: Te, onBlur: at, children: Qe }), e[90] = ae.onDragOver, e[91] = ae.onDropCapture, e[92] = ae.onPasteCapture, e[93] = Tt, e[94] = wt, e[95] = kt, e[96] = Ct, e[97] = $e, e[98] = Qe, e[99] = ut) : ut = e[99], ut;
|
|
806
805
|
};
|
|
807
|
-
function
|
|
806
|
+
function us() {
|
|
808
807
|
}
|
|
809
|
-
function
|
|
808
|
+
function ds(t) {
|
|
810
809
|
return t + 1;
|
|
811
810
|
}
|
|
812
|
-
function
|
|
811
|
+
function fs(t) {
|
|
813
812
|
return t + 1;
|
|
814
813
|
}
|
|
815
|
-
const
|
|
814
|
+
const ps = (t = "") => JSON.stringify(To(t)), ms = 360, hs = 4, gs = "min(10vh, 4rem)", bn = "min(70dvh, calc(100dvh - 12rem), 22rem)", vt = 1, bs = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
|
|
816
815
|
lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
|
|
817
816
|
textLength: e.textLength + n.text.length
|
|
818
817
|
}, {
|
|
819
818
|
lineCount: 0,
|
|
820
819
|
textLength: 0
|
|
821
|
-
}),
|
|
820
|
+
}), ys = (t) => {
|
|
822
821
|
if (t.role !== "user") return !1;
|
|
823
822
|
const {
|
|
824
823
|
lineCount: e,
|
|
825
824
|
textLength: n
|
|
826
|
-
} =
|
|
827
|
-
return n >
|
|
828
|
-
},
|
|
825
|
+
} = bs(t);
|
|
826
|
+
return n > ms || e > hs;
|
|
827
|
+
}, xs = (t, e) => {
|
|
829
828
|
const n = Math.max(0, t.scrollHeight - t.clientHeight);
|
|
830
|
-
return e === 0 || n <=
|
|
831
|
-
},
|
|
829
|
+
return e === 0 || n <= vt ? !1 : e < 0 ? t.scrollTop > vt : t.scrollTop < n - vt;
|
|
830
|
+
}, Ss = (t) => t.type === "text", Ts = (t) => (t.parts ?? []).filter(Ss).map((e) => e.text.trim()).filter(Boolean).join(`
|
|
832
831
|
|
|
833
|
-
`),
|
|
832
|
+
`), ws = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
|
|
834
833
|
hour: "numeric",
|
|
835
834
|
minute: "2-digit",
|
|
836
835
|
timeZone: n
|
|
837
|
-
}).format(new Date(t.createdAt)) : "",
|
|
836
|
+
}).format(new Date(t.createdAt)) : "", Bt = (t) => {
|
|
838
837
|
const e = T(20), {
|
|
839
838
|
message: n,
|
|
840
839
|
alwaysVisible: s,
|
|
841
840
|
copyAlwaysVisible: o
|
|
842
841
|
} = t, r = s === void 0 ? !1 : s, i = o === void 0 ? r : o, [l, c] = G(!1), u = Ne(null);
|
|
843
842
|
let d;
|
|
844
|
-
e[0] !== n ? (d =
|
|
843
|
+
e[0] !== n ? (d = Ts(n), e[0] = n, e[1] = d) : d = e[1];
|
|
845
844
|
const f = d;
|
|
846
845
|
let m;
|
|
847
|
-
e[2] !== n ? (m =
|
|
846
|
+
e[2] !== n ? (m = ws(n), e[2] = n, e[3] = m) : m = e[3];
|
|
848
847
|
const p = m;
|
|
849
848
|
let h, g;
|
|
850
849
|
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
|
|
@@ -866,13 +865,13 @@ const ms = (t = "") => JSON.stringify(wo(t)), hs = 360, gs = 4, bs = "min(10vh,
|
|
|
866
865
|
let A;
|
|
867
866
|
e[8] !== p ? (A = p ? /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: p }) : null, e[8] = p, e[9] = A) : A = e[9];
|
|
868
867
|
let w;
|
|
869
|
-
e[10] !== i || e[11] !== b || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ a(I, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css:
|
|
868
|
+
e[10] !== i || e[11] !== b || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ a(I, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Kt, children: /* @__PURE__ */ a(cn, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ a($t, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: b, children: l ? /* @__PURE__ */ a(rn, { size: 12 }) : /* @__PURE__ */ a(eo, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = b, e[12] = f, e[13] = l, e[14] = w) : w = e[14];
|
|
870
869
|
let _;
|
|
871
|
-
return e[15] !== w || e[16] !== x || e[17] !== C || e[18] !== A ? (_ = /* @__PURE__ */ k(Me, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: C, transition: "opacity 120ms ease", css:
|
|
870
|
+
return e[15] !== w || e[16] !== x || e[17] !== C || e[18] !== A ? (_ = /* @__PURE__ */ k(Me, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: C, transition: "opacity 120ms ease", css: Kt, children: [
|
|
872
871
|
A,
|
|
873
872
|
w
|
|
874
873
|
] }), e[15] = w, e[16] = x, e[17] = C, e[18] = A, e[19] = _) : _ = e[19], _;
|
|
875
|
-
},
|
|
874
|
+
}, Kt = {
|
|
876
875
|
"[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
|
|
877
876
|
opacity: 1,
|
|
878
877
|
pointerEvents: "auto"
|
|
@@ -885,7 +884,7 @@ const ms = (t = "") => JSON.stringify(wo(t)), hs = 360, gs = 4, bs = "min(10vh,
|
|
|
885
884
|
opacity: 1,
|
|
886
885
|
pointerEvents: "auto"
|
|
887
886
|
}
|
|
888
|
-
},
|
|
887
|
+
}, ks = (t) => {
|
|
889
888
|
const e = T(8);
|
|
890
889
|
let n, s;
|
|
891
890
|
e[0] !== t ? ({
|
|
@@ -893,36 +892,36 @@ const ms = (t = "") => JSON.stringify(wo(t)), hs = 360, gs = 4, bs = "min(10vh,
|
|
|
893
892
|
...s
|
|
894
893
|
} = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
|
|
895
894
|
let o;
|
|
896
|
-
e[3] !== n ? (o = /* @__PURE__ */ a(
|
|
895
|
+
e[3] !== n ? (o = /* @__PURE__ */ a(un, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
|
|
897
896
|
let r;
|
|
898
897
|
return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ a(I, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
|
|
899
|
-
},
|
|
898
|
+
}, Cs = ks, gt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), As = (t) => {
|
|
900
899
|
const e = gt(t), n = e.replace(/_/g, "");
|
|
901
900
|
return [.../* @__PURE__ */ new Set([t, e, n])];
|
|
902
|
-
},
|
|
903
|
-
shell:
|
|
904
|
-
ls:
|
|
905
|
-
read_file:
|
|
906
|
-
write_file:
|
|
907
|
-
delete_file:
|
|
908
|
-
patch:
|
|
909
|
-
upload_files:
|
|
910
|
-
download_file:
|
|
911
|
-
move_file:
|
|
912
|
-
},
|
|
913
|
-
dot:
|
|
914
|
-
danger:
|
|
915
|
-
search:
|
|
916
|
-
browser:
|
|
917
|
-
file:
|
|
918
|
-
question:
|
|
919
|
-
todo:
|
|
920
|
-
terminal:
|
|
921
|
-
...
|
|
922
|
-
},
|
|
923
|
-
if (!t) return
|
|
901
|
+
}, yn = {
|
|
902
|
+
shell: ln,
|
|
903
|
+
ls: ao,
|
|
904
|
+
read_file: lo,
|
|
905
|
+
write_file: io,
|
|
906
|
+
delete_file: ro,
|
|
907
|
+
patch: so,
|
|
908
|
+
upload_files: oo,
|
|
909
|
+
download_file: no,
|
|
910
|
+
move_file: to
|
|
911
|
+
}, _s = {
|
|
912
|
+
dot: ho,
|
|
913
|
+
danger: an,
|
|
914
|
+
search: mo,
|
|
915
|
+
browser: po,
|
|
916
|
+
file: fo,
|
|
917
|
+
question: uo,
|
|
918
|
+
todo: co,
|
|
919
|
+
terminal: ln,
|
|
920
|
+
...yn
|
|
921
|
+
}, Gt = "dot", Rs = (t) => Object.hasOwn(yn, t), Is = (t) => _s[t], xn = (t) => {
|
|
922
|
+
if (!t) return Gt;
|
|
924
923
|
const e = gt(t);
|
|
925
|
-
if (
|
|
924
|
+
if (Rs(e)) return e;
|
|
926
925
|
const n = e.replace(/_/g, "");
|
|
927
926
|
switch (e) {
|
|
928
927
|
case "read":
|
|
@@ -949,10 +948,10 @@ const ms = (t = "") => JSON.stringify(wo(t)), hs = 360, gs = 4, bs = "min(10vh,
|
|
|
949
948
|
case "file":
|
|
950
949
|
return "file";
|
|
951
950
|
default:
|
|
952
|
-
return n === "todowrite" || n === "todo" ? "todo" :
|
|
951
|
+
return n === "todowrite" || n === "todo" ? "todo" : Gt;
|
|
953
952
|
}
|
|
954
953
|
};
|
|
955
|
-
function
|
|
954
|
+
function Ht(t) {
|
|
956
955
|
const e = t.lastIndexOf("/");
|
|
957
956
|
return e >= 0 ? t.slice(e + 1) : t;
|
|
958
957
|
}
|
|
@@ -963,38 +962,38 @@ function ft(t) {
|
|
|
963
962
|
let n = e;
|
|
964
963
|
return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
|
|
965
964
|
}
|
|
966
|
-
const bt = (t) => t.startsWith("--- "),
|
|
965
|
+
const bt = (t) => t.startsWith("--- "), Qt = (t) => t.startsWith("+++ "), Wt = (t) => t.startsWith("@@"), Ps = (t) => t.startsWith("+") && !(Qt(t) || t === "+++"), Ms = (t) => t.startsWith("-") && !(bt(t) || t === "---"), Es = (t, e) => {
|
|
967
966
|
t.has(e) || t.set(e, {
|
|
968
967
|
additions: 0,
|
|
969
968
|
deletions: 0
|
|
970
969
|
});
|
|
971
|
-
},
|
|
970
|
+
}, vs = (t, e) => {
|
|
972
971
|
const n = t.get(e);
|
|
973
972
|
n && (n.additions += 1);
|
|
974
|
-
},
|
|
973
|
+
}, Ls = (t, e) => {
|
|
975
974
|
const n = t.get(e);
|
|
976
975
|
n && (n.deletions += 1);
|
|
977
|
-
},
|
|
976
|
+
}, Ds = (t, e, n) => {
|
|
978
977
|
if (bt(t))
|
|
979
978
|
return {
|
|
980
979
|
...e,
|
|
981
980
|
lastMinusHeader: ft(t.slice(4)),
|
|
982
981
|
inHunk: !1
|
|
983
982
|
};
|
|
984
|
-
if (
|
|
983
|
+
if (Qt(t)) {
|
|
985
984
|
const o = ft(t.slice(4)) ?? e.lastMinusHeader;
|
|
986
|
-
return o &&
|
|
985
|
+
return o && Es(n, o), {
|
|
987
986
|
...e,
|
|
988
987
|
currentPath: o,
|
|
989
988
|
inHunk: !1
|
|
990
989
|
};
|
|
991
990
|
}
|
|
992
|
-
return e.currentPath ?
|
|
991
|
+
return e.currentPath ? Wt(t) ? {
|
|
993
992
|
...e,
|
|
994
993
|
inHunk: !0
|
|
995
|
-
} : e.inHunk ?
|
|
994
|
+
} : e.inHunk ? Ps(t) ? (vs(n, e.currentPath), e) : (Ms(t) && Ls(n, e.currentPath), e) : e : e;
|
|
996
995
|
};
|
|
997
|
-
function
|
|
996
|
+
function Sn(t) {
|
|
998
997
|
if (!t || typeof t != "string") return [];
|
|
999
998
|
const e = /* @__PURE__ */ new Map();
|
|
1000
999
|
let n = {
|
|
@@ -1004,7 +1003,7 @@ function Tn(t) {
|
|
|
1004
1003
|
};
|
|
1005
1004
|
const s = t.split(/\r?\n/);
|
|
1006
1005
|
for (const o of s)
|
|
1007
|
-
n =
|
|
1006
|
+
n = Ds(o, n, e);
|
|
1008
1007
|
return Array.from(e.entries()).map(([o, {
|
|
1009
1008
|
additions: r,
|
|
1010
1009
|
deletions: i
|
|
@@ -1014,19 +1013,19 @@ function Tn(t) {
|
|
|
1014
1013
|
deletions: i
|
|
1015
1014
|
}));
|
|
1016
1015
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return
|
|
1016
|
+
function Bs(t) {
|
|
1017
|
+
return Sn(t).map((e) => ({
|
|
1019
1018
|
kind: "diff",
|
|
1020
|
-
fileName:
|
|
1019
|
+
fileName: Ht(e.filePath),
|
|
1021
1020
|
filePath: e.filePath,
|
|
1022
1021
|
additions: e.additions,
|
|
1023
1022
|
deletions: e.deletions
|
|
1024
1023
|
}));
|
|
1025
1024
|
}
|
|
1026
|
-
function
|
|
1027
|
-
return
|
|
1025
|
+
function Os(t) {
|
|
1026
|
+
return Sn(t).map((e) => e.filePath);
|
|
1028
1027
|
}
|
|
1029
|
-
const
|
|
1028
|
+
const Tn = (t) => bt(t) || t.startsWith("diff --git "), $s = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Fs = (t, e, n) => {
|
|
1030
1029
|
if (t.startsWith(" ")) {
|
|
1031
1030
|
const s = t.slice(1);
|
|
1032
1031
|
e.push(s), n.push(s);
|
|
@@ -1037,30 +1036,30 @@ const wn = (t) => bt(t) || t.startsWith("diff --git "), Fs = (t) => t.startsWith
|
|
|
1037
1036
|
return;
|
|
1038
1037
|
}
|
|
1039
1038
|
t.startsWith("+") && n.push(t.slice(1));
|
|
1040
|
-
},
|
|
1039
|
+
}, zs = (t, e, n, s) => {
|
|
1041
1040
|
let o = e;
|
|
1042
1041
|
for (; o < t.length; ) {
|
|
1043
1042
|
const r = t[o] || "";
|
|
1044
|
-
if (
|
|
1043
|
+
if (Tn(r) || Wt(r) || $s(r))
|
|
1045
1044
|
break;
|
|
1046
|
-
|
|
1045
|
+
Fs(r, n, s), o += 1;
|
|
1047
1046
|
}
|
|
1048
1047
|
return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
|
|
1049
|
-
},
|
|
1048
|
+
}, qs = (t, e) => {
|
|
1050
1049
|
const n = ft((t[e] || "").slice(4)), s = t[e + 1] || "";
|
|
1051
|
-
if (!
|
|
1050
|
+
if (!Qt(s)) return {
|
|
1052
1051
|
nextIndex: e + 1
|
|
1053
1052
|
};
|
|
1054
1053
|
const r = ft(s.slice(4)) ?? n ?? "", i = [], l = [];
|
|
1055
1054
|
let c = e + 2;
|
|
1056
1055
|
for (; c < t.length; ) {
|
|
1057
1056
|
const u = t[c] || "";
|
|
1058
|
-
if (
|
|
1059
|
-
if (!
|
|
1057
|
+
if (Tn(u)) break;
|
|
1058
|
+
if (!Wt(u)) {
|
|
1060
1059
|
c += 1;
|
|
1061
1060
|
continue;
|
|
1062
1061
|
}
|
|
1063
|
-
c =
|
|
1062
|
+
c = zs(t, c + 1, i, l);
|
|
1064
1063
|
}
|
|
1065
1064
|
return {
|
|
1066
1065
|
nextIndex: c,
|
|
@@ -1073,7 +1072,7 @@ const wn = (t) => bt(t) || t.startsWith("diff --git "), Fs = (t) => t.startsWith
|
|
|
1073
1072
|
}
|
|
1074
1073
|
};
|
|
1075
1074
|
};
|
|
1076
|
-
function
|
|
1075
|
+
function Hs(t) {
|
|
1077
1076
|
if (!t || typeof t != "string") return [];
|
|
1078
1077
|
const e = t.split(/\r?\n/), n = [];
|
|
1079
1078
|
let s = 0;
|
|
@@ -1086,12 +1085,12 @@ function Qs(t) {
|
|
|
1086
1085
|
const {
|
|
1087
1086
|
nextIndex: r,
|
|
1088
1087
|
preview: i
|
|
1089
|
-
} =
|
|
1088
|
+
} = qs(e, s);
|
|
1090
1089
|
i && n.push(i), s = Math.max(r, s + 1);
|
|
1091
1090
|
}
|
|
1092
1091
|
return n;
|
|
1093
1092
|
}
|
|
1094
|
-
const
|
|
1093
|
+
const Qs = {
|
|
1095
1094
|
apply_patch: "Apply patch",
|
|
1096
1095
|
bash: "Run command",
|
|
1097
1096
|
edit: "Edit file",
|
|
@@ -1100,7 +1099,7 @@ const Ws = {
|
|
|
1100
1099
|
read: "Read file",
|
|
1101
1100
|
skill: "Load skill",
|
|
1102
1101
|
todowrite: "Update todos"
|
|
1103
|
-
},
|
|
1102
|
+
}, Xt = {
|
|
1104
1103
|
pending: "queued",
|
|
1105
1104
|
error: "failed",
|
|
1106
1105
|
"output-error": "failed",
|
|
@@ -1109,27 +1108,27 @@ const Ws = {
|
|
|
1109
1108
|
running: "running",
|
|
1110
1109
|
completed: "completed",
|
|
1111
1110
|
failed: "failed"
|
|
1112
|
-
},
|
|
1113
|
-
const e =
|
|
1114
|
-
return
|
|
1115
|
-
},
|
|
1111
|
+
}, wn = (t) => t.replace(/^tool-/, "").toLowerCase(), Ws = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ns = (t) => wn(t.tool ?? "tool"), Vs = (t) => {
|
|
1112
|
+
const e = wn(t);
|
|
1113
|
+
return Qs[e] ?? Ws(e.replace(/_/g, " "));
|
|
1114
|
+
}, js = (t) => {
|
|
1116
1115
|
const e = t.state?.status ?? t.status;
|
|
1117
1116
|
if (!e || typeof e != "string") return null;
|
|
1118
1117
|
const n = e.replace(/-/g, "_");
|
|
1119
|
-
return
|
|
1120
|
-
},
|
|
1118
|
+
return Xt[n] ? Xt[n] : n.includes("stream") ? "running" : null;
|
|
1119
|
+
}, kn = (t) => {
|
|
1121
1120
|
const e = t.state?.status ?? t.status;
|
|
1122
1121
|
return e === "error" || e === "output-error" || e === "failed";
|
|
1123
|
-
}, fe = (t) =>
|
|
1122
|
+
}, fe = (t) => kn(t) ? {
|
|
1124
1123
|
type: "icon",
|
|
1125
1124
|
icon: "danger"
|
|
1126
1125
|
} : {
|
|
1127
1126
|
type: "icon",
|
|
1128
|
-
icon:
|
|
1127
|
+
icon: xn(Ns(t))
|
|
1129
1128
|
}, pe = (t, e, n) => {
|
|
1130
1129
|
const o = [{
|
|
1131
1130
|
kind: "text",
|
|
1132
|
-
text: n ??
|
|
1131
|
+
text: n ?? Vs(t.tool ?? "tool"),
|
|
1133
1132
|
bold: !0
|
|
1134
1133
|
}];
|
|
1135
1134
|
e && o.push({
|
|
@@ -1137,7 +1136,7 @@ const Ws = {
|
|
|
1137
1136
|
text: e,
|
|
1138
1137
|
muted: !0
|
|
1139
1138
|
});
|
|
1140
|
-
const r =
|
|
1139
|
+
const r = js(t);
|
|
1141
1140
|
return r && r !== "completed" && o.push({
|
|
1142
1141
|
kind: "text",
|
|
1143
1142
|
text: r,
|
|
@@ -1149,86 +1148,86 @@ const Ws = {
|
|
|
1149
1148
|
}, et = (t) => {
|
|
1150
1149
|
const e = t.state?.output;
|
|
1151
1150
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
1152
|
-
}, S = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, pt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t,
|
|
1151
|
+
}, S = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, pt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Us = (t, e) => {
|
|
1153
1152
|
const n = pt(t.state);
|
|
1154
1153
|
return n ? pt(n[e]) : null;
|
|
1155
|
-
},
|
|
1154
|
+
}, Ks = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Gs = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), Cn = (t) => {
|
|
1156
1155
|
const e = et(t);
|
|
1157
|
-
return [
|
|
1158
|
-
},
|
|
1156
|
+
return [Us(t, "metadata"), pt(e?.metadata)].filter(Boolean);
|
|
1157
|
+
}, Xs = (t) => {
|
|
1159
1158
|
const e = pt(t);
|
|
1160
1159
|
if (!e) return null;
|
|
1161
1160
|
const n = S(e.filePath) ?? S(e.relativePath) ?? S(e.path);
|
|
1162
1161
|
return n ? {
|
|
1163
|
-
filePath:
|
|
1162
|
+
filePath: Ks(n),
|
|
1164
1163
|
additions: typeof e.additions == "number" ? e.additions : 0,
|
|
1165
1164
|
deletions: typeof e.deletions == "number" ? e.deletions : 0,
|
|
1166
1165
|
diff: S(e.diff) ?? void 0,
|
|
1167
1166
|
before: S(e.before) ?? void 0,
|
|
1168
1167
|
after: S(e.after) ?? void 0
|
|
1169
1168
|
} : null;
|
|
1170
|
-
},
|
|
1169
|
+
}, An = (t) => {
|
|
1171
1170
|
const e = [];
|
|
1172
|
-
for (const n of
|
|
1171
|
+
for (const n of Cn(t)) {
|
|
1173
1172
|
const s = Array.isArray(n.files) ? n.files : [];
|
|
1174
1173
|
for (const o of s) {
|
|
1175
|
-
const r =
|
|
1174
|
+
const r = Xs(o);
|
|
1176
1175
|
r && e.push(r);
|
|
1177
1176
|
}
|
|
1178
1177
|
}
|
|
1179
1178
|
return e;
|
|
1180
|
-
},
|
|
1179
|
+
}, Ys = (t) => {
|
|
1181
1180
|
const e = Ee(t), n = S(e?.diff);
|
|
1182
1181
|
if (n) return n;
|
|
1183
|
-
for (const r of
|
|
1182
|
+
for (const r of Cn(t)) {
|
|
1184
1183
|
const i = S(r.diff);
|
|
1185
1184
|
if (i) return i;
|
|
1186
1185
|
}
|
|
1187
|
-
const s =
|
|
1186
|
+
const s = An(t).map((r) => r.diff).filter((r) => !!r);
|
|
1188
1187
|
if (s.length > 0) return s.join(`
|
|
1189
1188
|
`);
|
|
1190
1189
|
const o = S(e?.patchText);
|
|
1191
|
-
return o &&
|
|
1192
|
-
},
|
|
1190
|
+
return o && Gs(o) ? o : null;
|
|
1191
|
+
}, Js = (t) => {
|
|
1193
1192
|
const e = /* @__PURE__ */ new Set(), n = [];
|
|
1194
1193
|
for (const s of t)
|
|
1195
1194
|
e.has(s.filePath) || (e.add(s.filePath), n.push({
|
|
1196
1195
|
kind: "diff",
|
|
1197
|
-
fileName:
|
|
1196
|
+
fileName: Ht(s.filePath),
|
|
1198
1197
|
filePath: s.filePath,
|
|
1199
1198
|
additions: s.additions,
|
|
1200
1199
|
deletions: s.deletions
|
|
1201
1200
|
}));
|
|
1202
1201
|
return n;
|
|
1203
|
-
},
|
|
1202
|
+
}, Zs = (t) => Array.from(new Set(t.map((e) => e.filePath))), yt = (t) => {
|
|
1204
1203
|
const e = et(t);
|
|
1205
1204
|
return S(t.state?.output) ?? S(e?.returnDisplay) ?? S(e?.preview) ?? S(e?.stdout) ?? S(e?.content);
|
|
1206
|
-
},
|
|
1205
|
+
}, er = (t) => {
|
|
1207
1206
|
const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
|
|
1208
1207
|
return e ? {
|
|
1209
1208
|
skillName: S(e[1]) ?? void 0,
|
|
1210
1209
|
content: S(e[2]) ?? ""
|
|
1211
1210
|
} : null;
|
|
1212
|
-
},
|
|
1211
|
+
}, tr = (t) => {
|
|
1213
1212
|
const e = Ee(t);
|
|
1214
1213
|
return S(e?.name) ?? S(e?.skillName) ?? S(e?.skill) ?? S(e?.skill_name) ?? void 0;
|
|
1215
|
-
},
|
|
1214
|
+
}, _n = (t) => ({
|
|
1216
1215
|
kind: "link",
|
|
1217
|
-
text:
|
|
1216
|
+
text: Ht(t),
|
|
1218
1217
|
filePath: t
|
|
1219
|
-
}), me = (t, e) => !
|
|
1218
|
+
}), me = (t, e) => !kn(t) || !t.state?.errorText ? e : [{
|
|
1220
1219
|
type: "comment",
|
|
1221
1220
|
text: t.state.errorText
|
|
1222
|
-
}, ...e],
|
|
1221
|
+
}, ...e], Rn = (t) => Hs(t ?? void 0).map((e) => ({
|
|
1223
1222
|
type: "diff",
|
|
1224
1223
|
language: "diff",
|
|
1225
1224
|
original: e.original,
|
|
1226
1225
|
modified: e.modified,
|
|
1227
1226
|
sideBySide: !1
|
|
1228
|
-
})),
|
|
1229
|
-
const e =
|
|
1230
|
-
o.length > 0 ? s.push(...o) : s.push(...
|
|
1231
|
-
const r = [...
|
|
1227
|
+
})), nr = (t) => Bs(t ?? void 0), or = (t) => Os(t ?? void 0), sr = (t) => {
|
|
1228
|
+
const e = Ys(t), n = An(t), s = pe(t, void 0, "Apply patch"), o = nr(e);
|
|
1229
|
+
o.length > 0 ? s.push(...o) : s.push(...Js(n));
|
|
1230
|
+
const r = [...Rn(e)];
|
|
1232
1231
|
if (r.length === 0)
|
|
1233
1232
|
for (const i of n)
|
|
1234
1233
|
!i.before && !i.after || r.push({
|
|
@@ -1239,8 +1238,8 @@ const Ws = {
|
|
|
1239
1238
|
sideBySide: !1
|
|
1240
1239
|
});
|
|
1241
1240
|
if (r.length === 0) {
|
|
1242
|
-
const i =
|
|
1243
|
-
i.length === 0 && i.push(...
|
|
1241
|
+
const i = or(e);
|
|
1242
|
+
i.length === 0 && i.push(...Zs(n)), i.length > 0 && r.push({
|
|
1244
1243
|
type: "references",
|
|
1245
1244
|
references: i
|
|
1246
1245
|
});
|
|
@@ -1250,29 +1249,29 @@ const Ws = {
|
|
|
1250
1249
|
title: s,
|
|
1251
1250
|
blocks: me(t, r)
|
|
1252
1251
|
};
|
|
1253
|
-
},
|
|
1252
|
+
}, rr = (t, e) => [{
|
|
1254
1253
|
type: "diff",
|
|
1255
1254
|
language: "text",
|
|
1256
1255
|
original: t,
|
|
1257
1256
|
modified: e,
|
|
1258
1257
|
sideBySide: !1
|
|
1259
|
-
}],
|
|
1258
|
+
}], ir = (t) => {
|
|
1260
1259
|
const e = Ee(t), n = et(t), s = S(e?.filePath) ?? S(e?.file_path) ?? S(n?.filePath) ?? void 0, o = S(n?.oldString) ?? S(e?.old_string) ?? void 0, r = S(n?.newString) ?? S(e?.new_string) ?? void 0, i = pe(t, void 0, "Edit file");
|
|
1261
|
-
s && i.push(
|
|
1262
|
-
const l = o !== void 0 && r !== void 0 ?
|
|
1260
|
+
s && i.push(_n(s));
|
|
1261
|
+
const l = o !== void 0 && r !== void 0 ? rr(o, r) : Rn(S(n?.diff));
|
|
1263
1262
|
return {
|
|
1264
1263
|
indicator: fe(t),
|
|
1265
1264
|
title: i,
|
|
1266
1265
|
blocks: me(t, l)
|
|
1267
1266
|
};
|
|
1268
|
-
}, tt = (t) => typeof t == "object" && t !== null && !Array.isArray(t),
|
|
1267
|
+
}, tt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), lr = (t) => {
|
|
1269
1268
|
try {
|
|
1270
1269
|
const e = JSON.parse(t);
|
|
1271
1270
|
return tt(e) ? e : null;
|
|
1272
1271
|
} catch {
|
|
1273
1272
|
return null;
|
|
1274
1273
|
}
|
|
1275
|
-
},
|
|
1274
|
+
}, ar = (t) => tt(t) ? t : typeof t == "string" && t.trim().length > 0 ? lr(t) : null, Ve = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Pe = (t) => {
|
|
1276
1275
|
const e = Ve(t);
|
|
1277
1276
|
if (e) return e;
|
|
1278
1277
|
if (Array.isArray(t)) {
|
|
@@ -1281,7 +1280,7 @@ const Ws = {
|
|
|
1281
1280
|
`) : null;
|
|
1282
1281
|
}
|
|
1283
1282
|
return tt(t) ? Pe(t.response) ?? Pe(t.answer) ?? Pe(t.text) ?? Pe(t.answers) : null;
|
|
1284
|
-
},
|
|
1283
|
+
}, cr = (t) => {
|
|
1285
1284
|
if (typeof t == "string" && t.trim().length > 0)
|
|
1286
1285
|
return {
|
|
1287
1286
|
label: t,
|
|
@@ -1293,11 +1292,11 @@ const Ws = {
|
|
|
1293
1292
|
label: e,
|
|
1294
1293
|
description: Ve(t.description) ?? void 0
|
|
1295
1294
|
} : null;
|
|
1296
|
-
},
|
|
1295
|
+
}, ur = (t, e) => {
|
|
1297
1296
|
if (!tt(t)) return null;
|
|
1298
1297
|
const n = Ve(t.question);
|
|
1299
1298
|
if (!n) return null;
|
|
1300
|
-
const s = Array.isArray(t.options) ? t.options.map(
|
|
1299
|
+
const s = Array.isArray(t.options) ? t.options.map(cr).filter((i) => i !== null) : [], o = Ve(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o === "freeform" || o === "text";
|
|
1301
1300
|
return s.length === 0 && !r ? null : {
|
|
1302
1301
|
id: Ve(t.id) ?? `question-${e}`,
|
|
1303
1302
|
question: n,
|
|
@@ -1306,22 +1305,22 @@ const Ws = {
|
|
|
1306
1305
|
required: typeof t.required == "boolean" ? t.required : !1,
|
|
1307
1306
|
allowCustomAnswer: r
|
|
1308
1307
|
};
|
|
1309
|
-
},
|
|
1310
|
-
const e =
|
|
1308
|
+
}, dr = (t) => {
|
|
1309
|
+
const e = ar(t);
|
|
1311
1310
|
if (!e || !Array.isArray(e.questions)) return null;
|
|
1312
|
-
const n = e.questions.map(
|
|
1311
|
+
const n = e.questions.map(ur).filter((s) => s !== null);
|
|
1313
1312
|
return n.length === 0 ? null : {
|
|
1314
1313
|
type: "question-form",
|
|
1315
1314
|
questions: n
|
|
1316
1315
|
};
|
|
1317
|
-
},
|
|
1316
|
+
}, fr = (t) => {
|
|
1318
1317
|
const {
|
|
1319
1318
|
buildBaseTitle: e,
|
|
1320
1319
|
buildIndicator: n,
|
|
1321
1320
|
prependErrorBlock: s
|
|
1322
1321
|
} = t;
|
|
1323
1322
|
return (o) => {
|
|
1324
|
-
const r = Pe(o.state?.output) ?? Pe(o.state?.metadata), i =
|
|
1323
|
+
const r = Pe(o.state?.output) ?? Pe(o.state?.metadata), i = dr(o.state?.input);
|
|
1325
1324
|
if (!r && !i) return null;
|
|
1326
1325
|
const l = i ? `${i.questions.length} field${i.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [i];
|
|
1327
1326
|
return {
|
|
@@ -1331,14 +1330,14 @@ const Ws = {
|
|
|
1331
1330
|
expandable: !1
|
|
1332
1331
|
};
|
|
1333
1332
|
};
|
|
1334
|
-
},
|
|
1333
|
+
}, pr = (t) => {
|
|
1335
1334
|
const e = Ee(t), n = et(t), s = S(e?.filePath) ?? S(e?.file_path) ?? S(e?.file) ?? S(n?.filePath) ?? S(n?.file) ?? S(n?.path) ?? void 0, o = pe(t, void 0, "Read file");
|
|
1336
|
-
return s && o.push(
|
|
1335
|
+
return s && o.push(_n(s)), {
|
|
1337
1336
|
indicator: fe(t),
|
|
1338
1337
|
title: o,
|
|
1339
1338
|
blocks: me(t, [])
|
|
1340
1339
|
};
|
|
1341
|
-
},
|
|
1340
|
+
}, mr = (t) => {
|
|
1342
1341
|
const e = Ee(t), n = et(t), s = S(e?.command) ?? void 0, o = pe(t, s, "Run command"), r = [], i = yt(t);
|
|
1343
1342
|
i && r.push({
|
|
1344
1343
|
type: "code",
|
|
@@ -1358,7 +1357,7 @@ const Ws = {
|
|
|
1358
1357
|
title: o,
|
|
1359
1358
|
blocks: me(t, r)
|
|
1360
1359
|
};
|
|
1361
|
-
},
|
|
1360
|
+
}, hr = (t) => {
|
|
1362
1361
|
const e = Ee(t), n = yt(t), s = S(e?.pattern) ?? void 0, o = pe(t, s, "Search files"), r = n ? [{
|
|
1363
1362
|
type: "code",
|
|
1364
1363
|
language: "text",
|
|
@@ -1369,7 +1368,7 @@ const Ws = {
|
|
|
1369
1368
|
title: o,
|
|
1370
1369
|
blocks: me(t, r)
|
|
1371
1370
|
};
|
|
1372
|
-
},
|
|
1371
|
+
}, gr = (t) => {
|
|
1373
1372
|
const e = Ee(t), n = yt(t), s = S(e?.pattern) ?? void 0, o = pe(t, s, "Find files"), r = [];
|
|
1374
1373
|
if (n) {
|
|
1375
1374
|
const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
|
|
@@ -1383,8 +1382,8 @@ const Ws = {
|
|
|
1383
1382
|
title: o,
|
|
1384
1383
|
blocks: me(t, r)
|
|
1385
1384
|
};
|
|
1386
|
-
},
|
|
1387
|
-
const e = yt(t), n = e ?
|
|
1385
|
+
}, br = (t) => {
|
|
1386
|
+
const e = yt(t), n = e ? er(e) : null, s = tr(t) ?? n?.skillName, o = pe(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
|
|
1388
1387
|
type: "code",
|
|
1389
1388
|
language: "markdown",
|
|
1390
1389
|
code: r
|
|
@@ -1394,41 +1393,41 @@ const Ws = {
|
|
|
1394
1393
|
title: o,
|
|
1395
1394
|
blocks: me(t, i)
|
|
1396
1395
|
};
|
|
1397
|
-
},
|
|
1398
|
-
const e =
|
|
1396
|
+
}, Lt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, In = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, yr = (t) => {
|
|
1397
|
+
const e = In(t);
|
|
1399
1398
|
if (!e) return null;
|
|
1400
|
-
const n =
|
|
1399
|
+
const n = Lt(e.content) ?? Lt(e.title);
|
|
1401
1400
|
if (!n) return null;
|
|
1402
|
-
const s =
|
|
1401
|
+
const s = Lt(e.status);
|
|
1403
1402
|
return {
|
|
1404
1403
|
label: n,
|
|
1405
1404
|
checked: s === "completed"
|
|
1406
1405
|
};
|
|
1407
|
-
},
|
|
1406
|
+
}, Yt = (t) => {
|
|
1408
1407
|
if (!t) return {
|
|
1409
1408
|
items: [],
|
|
1410
1409
|
explicit: !1
|
|
1411
1410
|
};
|
|
1412
1411
|
const e = (() => {
|
|
1413
1412
|
if (Array.isArray(t)) return t;
|
|
1414
|
-
const n =
|
|
1413
|
+
const n = In(t);
|
|
1415
1414
|
return !n || !Array.isArray(n.todos) ? null : n.todos;
|
|
1416
1415
|
})();
|
|
1417
1416
|
return e ? {
|
|
1418
|
-
items: e.map(
|
|
1417
|
+
items: e.map(yr).filter((n) => n !== null),
|
|
1419
1418
|
explicit: !0
|
|
1420
1419
|
} : {
|
|
1421
1420
|
items: [],
|
|
1422
1421
|
explicit: !1
|
|
1423
1422
|
};
|
|
1424
|
-
},
|
|
1423
|
+
}, xr = (t) => {
|
|
1425
1424
|
const {
|
|
1426
1425
|
buildBaseTitle: e,
|
|
1427
1426
|
buildIndicator: n,
|
|
1428
1427
|
prependErrorBlock: s
|
|
1429
1428
|
} = t;
|
|
1430
1429
|
return (o) => {
|
|
1431
|
-
const r =
|
|
1430
|
+
const r = Yt(o.state?.input), i = Yt(o.state?.output), l = i.explicit ? i : r;
|
|
1432
1431
|
if (!l.explicit) return null;
|
|
1433
1432
|
const c = l.items, u = `${c.length} item${c.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
|
|
1434
1433
|
if (c.length === 0)
|
|
@@ -1450,41 +1449,41 @@ const Ws = {
|
|
|
1450
1449
|
blocks: s(o, f)
|
|
1451
1450
|
};
|
|
1452
1451
|
};
|
|
1453
|
-
},
|
|
1452
|
+
}, Sr = fr({
|
|
1454
1453
|
buildBaseTitle: pe,
|
|
1455
1454
|
buildIndicator: fe,
|
|
1456
1455
|
prependErrorBlock: me
|
|
1457
|
-
}),
|
|
1456
|
+
}), Jt = xr({
|
|
1458
1457
|
buildBaseTitle: pe,
|
|
1459
1458
|
buildIndicator: fe,
|
|
1460
1459
|
prependErrorBlock: me
|
|
1461
|
-
}),
|
|
1462
|
-
apply_patch:
|
|
1463
|
-
bash:
|
|
1464
|
-
edit:
|
|
1465
|
-
glob:
|
|
1466
|
-
grep:
|
|
1467
|
-
question:
|
|
1468
|
-
read:
|
|
1469
|
-
skill:
|
|
1470
|
-
todo_write:
|
|
1471
|
-
todowrite:
|
|
1472
|
-
}),
|
|
1460
|
+
}), Zt = () => ({
|
|
1461
|
+
apply_patch: sr,
|
|
1462
|
+
bash: mr,
|
|
1463
|
+
edit: ir,
|
|
1464
|
+
glob: gr,
|
|
1465
|
+
grep: hr,
|
|
1466
|
+
question: Sr,
|
|
1467
|
+
read: pr,
|
|
1468
|
+
skill: br,
|
|
1469
|
+
todo_write: Jt,
|
|
1470
|
+
todowrite: Jt
|
|
1471
|
+
}), en = {
|
|
1473
1472
|
pending: "queued",
|
|
1474
1473
|
error: "failed",
|
|
1475
1474
|
"output-error": "failed",
|
|
1476
1475
|
"input-streaming": "running",
|
|
1477
1476
|
"input-available": "queued"
|
|
1478
|
-
},
|
|
1477
|
+
}, Tr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), wr = (t) => {
|
|
1479
1478
|
const e = gt(t ?? "tool").replace(/_/g, " ");
|
|
1480
|
-
return
|
|
1481
|
-
},
|
|
1479
|
+
return Tr(e);
|
|
1480
|
+
}, Pn = (t) => t === "error" || t === "output-error", kr = (t) => Pn(t.state?.status) ? {
|
|
1482
1481
|
type: "icon",
|
|
1483
1482
|
icon: "danger"
|
|
1484
1483
|
} : {
|
|
1485
1484
|
type: "icon",
|
|
1486
|
-
icon:
|
|
1487
|
-
},
|
|
1485
|
+
icon: xn(t.tool ?? "tool")
|
|
1486
|
+
}, Cr = (t) => !t || typeof t != "string" ? null : en[t] ? en[t] : t.includes("stream") ? "running" : null, tn = (t) => {
|
|
1488
1487
|
if (typeof t == "string") return t;
|
|
1489
1488
|
if (t == null) return null;
|
|
1490
1489
|
try {
|
|
@@ -1492,64 +1491,64 @@ const Ws = {
|
|
|
1492
1491
|
} catch {
|
|
1493
1492
|
return null;
|
|
1494
1493
|
}
|
|
1495
|
-
},
|
|
1494
|
+
}, Ar = (t) => {
|
|
1496
1495
|
const e = [];
|
|
1497
|
-
|
|
1496
|
+
Pn(t.state?.status) && t.state?.errorText && e.push({
|
|
1498
1497
|
type: "comment",
|
|
1499
1498
|
text: t.state.errorText
|
|
1500
1499
|
});
|
|
1501
|
-
const n =
|
|
1500
|
+
const n = tn(t.state?.input);
|
|
1502
1501
|
n && e.push({
|
|
1503
1502
|
type: "code",
|
|
1504
1503
|
language: "json",
|
|
1505
1504
|
code: n
|
|
1506
1505
|
});
|
|
1507
|
-
const s =
|
|
1506
|
+
const s = tn(t.state?.output);
|
|
1508
1507
|
return s && e.push({
|
|
1509
1508
|
type: "code",
|
|
1510
1509
|
language: "json",
|
|
1511
1510
|
code: s
|
|
1512
1511
|
}), e;
|
|
1513
|
-
},
|
|
1512
|
+
}, _r = (t) => {
|
|
1514
1513
|
const e = [{
|
|
1515
1514
|
kind: "text",
|
|
1516
|
-
text:
|
|
1515
|
+
text: wr(t.tool),
|
|
1517
1516
|
bold: !0
|
|
1518
|
-
}], n =
|
|
1517
|
+
}], n = Cr(t.state?.status);
|
|
1519
1518
|
return n && e.push({
|
|
1520
1519
|
kind: "text",
|
|
1521
1520
|
text: n,
|
|
1522
1521
|
muted: !0
|
|
1523
1522
|
}), {
|
|
1524
|
-
indicator:
|
|
1523
|
+
indicator: kr(t),
|
|
1525
1524
|
title: e,
|
|
1526
|
-
blocks:
|
|
1525
|
+
blocks: Ar(t)
|
|
1527
1526
|
};
|
|
1528
|
-
},
|
|
1529
|
-
...
|
|
1527
|
+
}, Rr = (t) => t ? {
|
|
1528
|
+
...Zt(),
|
|
1530
1529
|
...t
|
|
1531
|
-
} :
|
|
1530
|
+
} : Zt(), Ir = (t, e) => {
|
|
1532
1531
|
const n = t.tool ?? "tool";
|
|
1533
|
-
for (const s of
|
|
1532
|
+
for (const s of As(n)) {
|
|
1534
1533
|
const o = e[s];
|
|
1535
1534
|
if (o) return o;
|
|
1536
1535
|
}
|
|
1537
|
-
},
|
|
1538
|
-
const s =
|
|
1536
|
+
}, Pr = (t, e, n) => {
|
|
1537
|
+
const s = Ir(t, e);
|
|
1539
1538
|
if (s) {
|
|
1540
1539
|
const o = s(t, n);
|
|
1541
1540
|
if (o) return o;
|
|
1542
1541
|
}
|
|
1543
|
-
return
|
|
1544
|
-
},
|
|
1545
|
-
const n =
|
|
1542
|
+
return _r(t);
|
|
1543
|
+
}, Mr = (t, e) => {
|
|
1544
|
+
const n = Rr(e?.toolRenderers);
|
|
1546
1545
|
return {
|
|
1547
|
-
items: t.map((o) =>
|
|
1546
|
+
items: t.map((o) => Pr(o, n, e))
|
|
1548
1547
|
};
|
|
1549
|
-
}, Ce =
|
|
1548
|
+
}, Ce = jn, Mn = (t, e, n, s = !1) => {
|
|
1550
1549
|
s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
|
|
1551
1550
|
};
|
|
1552
|
-
function
|
|
1551
|
+
function Er(t) {
|
|
1553
1552
|
const e = T(6), {
|
|
1554
1553
|
seg: n
|
|
1555
1554
|
} = t;
|
|
@@ -1563,7 +1562,7 @@ function vr(t) {
|
|
|
1563
1562
|
o
|
|
1564
1563
|
] }), e[4] = s, e[5] = r) : r = e[5], r;
|
|
1565
1564
|
}
|
|
1566
|
-
function
|
|
1565
|
+
function vr(t) {
|
|
1567
1566
|
const e = T(9), {
|
|
1568
1567
|
seg: n,
|
|
1569
1568
|
onOpenFile: s
|
|
@@ -1574,15 +1573,15 @@ function Lr(t) {
|
|
|
1574
1573
|
s?.(c);
|
|
1575
1574
|
}, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
|
|
1576
1575
|
let l;
|
|
1577
|
-
return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ a(
|
|
1576
|
+
return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ a(fn, { 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;
|
|
1578
1577
|
}
|
|
1579
|
-
function
|
|
1578
|
+
function Lr(t) {
|
|
1580
1579
|
const e = T(13), {
|
|
1581
1580
|
seg: n,
|
|
1582
1581
|
onOpenFile: s
|
|
1583
1582
|
} = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), c = r ? "pointer" : "default";
|
|
1584
1583
|
let u;
|
|
1585
|
-
e[0] !== s || e[1] !== n ? (u = (p) =>
|
|
1584
|
+
e[0] !== s || e[1] !== n ? (u = (p) => Mn(p, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
|
|
1586
1585
|
const d = n.muted ? "fg.muted" : "fg.blue-dark";
|
|
1587
1586
|
let f;
|
|
1588
1587
|
e[3] !== d ? (f = {
|
|
@@ -1590,15 +1589,15 @@ function Dr(t) {
|
|
|
1590
1589
|
color: d
|
|
1591
1590
|
}, e[3] = d, e[4] = f) : f = e[4];
|
|
1592
1591
|
let m;
|
|
1593
|
-
return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== c || e[10] !== u || e[11] !== f ? (m = /* @__PURE__ */ a(
|
|
1592
|
+
return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== c || e[10] !== u || e[11] !== f ? (m = /* @__PURE__ */ a(sn, { href: i, fontWeight: o, color: l, textDecoration: "none", cursor: c, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = l, e[9] = c, e[10] = u, e[11] = f, e[12] = m) : m = e[12], m;
|
|
1594
1593
|
}
|
|
1595
|
-
function
|
|
1594
|
+
function Dr(t) {
|
|
1596
1595
|
const e = T(12), {
|
|
1597
1596
|
seg: n,
|
|
1598
1597
|
onOpenFile: s
|
|
1599
1598
|
} = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
|
|
1600
1599
|
let l;
|
|
1601
|
-
e[0] !== s || e[1] !== n ? (l = (f) =>
|
|
1600
|
+
e[0] !== s || e[1] !== n ? (l = (f) => Mn(f, n, s), e[0] = s, e[1] = n, e[2] = l) : l = e[2];
|
|
1602
1601
|
const c = n.muted ? "fg.muted" : "accent.primary";
|
|
1603
1602
|
let u;
|
|
1604
1603
|
e[3] !== c ? (u = {
|
|
@@ -1606,9 +1605,9 @@ function Br(t) {
|
|
|
1606
1605
|
textDecoration: "underline"
|
|
1607
1606
|
}, e[3] = c, e[4] = u) : u = e[4];
|
|
1608
1607
|
let d;
|
|
1609
|
-
return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ a(
|
|
1608
|
+
return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ a(sn, { 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;
|
|
1610
1609
|
}
|
|
1611
|
-
function
|
|
1610
|
+
function Br(t) {
|
|
1612
1611
|
const e = T(6), {
|
|
1613
1612
|
seg: n,
|
|
1614
1613
|
isClickable: s
|
|
@@ -1620,7 +1619,7 @@ function Or(t) {
|
|
|
1620
1619
|
let l;
|
|
1621
1620
|
return e[2] !== n.text || e[3] !== o || e[4] !== i ? (l = /* @__PURE__ */ a(Je, { fontWeight: o, color: "fg.muted", _groupHover: i, children: n.text }), e[2] = n.text, e[3] = o, e[4] = i, e[5] = l) : l = e[5], l;
|
|
1622
1621
|
}
|
|
1623
|
-
function
|
|
1622
|
+
function Or(t) {
|
|
1624
1623
|
const e = T(11), {
|
|
1625
1624
|
seg: n,
|
|
1626
1625
|
isClickable: s,
|
|
@@ -1629,25 +1628,25 @@ function $r(t) {
|
|
|
1629
1628
|
switch (n.kind) {
|
|
1630
1629
|
case "avatar": {
|
|
1631
1630
|
let r;
|
|
1632
|
-
return e[0] !== n ? (r = /* @__PURE__ */ a(
|
|
1631
|
+
return e[0] !== n ? (r = /* @__PURE__ */ a(Er, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
|
|
1633
1632
|
}
|
|
1634
1633
|
case "diff": {
|
|
1635
1634
|
let r;
|
|
1636
|
-
return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ a(
|
|
1635
|
+
return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ a(vr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
|
|
1637
1636
|
}
|
|
1638
1637
|
case "link": {
|
|
1639
1638
|
let r;
|
|
1640
|
-
return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ a(
|
|
1639
|
+
return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ a(Lr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ a(Dr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
|
|
1641
1640
|
}
|
|
1642
1641
|
case "text": {
|
|
1643
1642
|
let r;
|
|
1644
|
-
return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ a(
|
|
1643
|
+
return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ a(Br, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
|
|
1645
1644
|
}
|
|
1646
1645
|
default:
|
|
1647
1646
|
return null;
|
|
1648
1647
|
}
|
|
1649
1648
|
}
|
|
1650
|
-
function
|
|
1649
|
+
function $r(t) {
|
|
1651
1650
|
const e = T(10), {
|
|
1652
1651
|
ind: n
|
|
1653
1652
|
} = t;
|
|
@@ -1655,10 +1654,10 @@ function Fr(t) {
|
|
|
1655
1654
|
return null;
|
|
1656
1655
|
if (n.type === "icon") {
|
|
1657
1656
|
let i;
|
|
1658
|
-
e[0] !== n.icon ? (i =
|
|
1657
|
+
e[0] !== n.icon ? (i = Is(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
|
|
1659
1658
|
const l = i;
|
|
1660
1659
|
let c;
|
|
1661
|
-
return e[2] !== l ? (c = /* @__PURE__ */ a(Ce.Indicator, { outline: "none",
|
|
1660
|
+
return e[2] !== l ? (c = /* @__PURE__ */ a(Ce.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ a(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = c) : c = e[3], c;
|
|
1662
1661
|
}
|
|
1663
1662
|
let s;
|
|
1664
1663
|
e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ a(We.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
|
|
@@ -1670,7 +1669,7 @@ function Fr(t) {
|
|
|
1670
1669
|
o
|
|
1671
1670
|
] }) }), e[8] = s, e[9] = r) : r = e[9], r;
|
|
1672
1671
|
}
|
|
1673
|
-
function
|
|
1672
|
+
function Fr(t) {
|
|
1674
1673
|
const e = T(5), {
|
|
1675
1674
|
code: n,
|
|
1676
1675
|
language: s
|
|
@@ -1680,7 +1679,7 @@ function zr(t) {
|
|
|
1680
1679
|
let i;
|
|
1681
1680
|
return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ a(ht, { background: "bg.code", color: "fg", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ a(I, { as: "pre", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", whiteSpace: "pre", "aria-label": o, children: r }) }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
|
|
1682
1681
|
}
|
|
1683
|
-
function
|
|
1682
|
+
function zr(t) {
|
|
1684
1683
|
const e = T(30), {
|
|
1685
1684
|
b: n,
|
|
1686
1685
|
onOpenFile: s
|
|
@@ -1702,12 +1701,12 @@ function qr(t) {
|
|
|
1702
1701
|
}
|
|
1703
1702
|
case "code": {
|
|
1704
1703
|
let o;
|
|
1705
|
-
return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(
|
|
1704
|
+
return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(Fr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
|
|
1706
1705
|
}
|
|
1707
1706
|
case "diff": {
|
|
1708
1707
|
const o = n.sideBySide ?? !1;
|
|
1709
1708
|
let r;
|
|
1710
|
-
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(I, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ a(
|
|
1709
|
+
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(I, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ a(Co, { 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;
|
|
1711
1710
|
}
|
|
1712
1711
|
case "text": {
|
|
1713
1712
|
let o;
|
|
@@ -1715,15 +1714,15 @@ function qr(t) {
|
|
|
1715
1714
|
}
|
|
1716
1715
|
case "todo-list": {
|
|
1717
1716
|
let o;
|
|
1718
|
-
return e[17] !== n.items ? (o = /* @__PURE__ */ a(
|
|
1717
|
+
return e[17] !== n.items ? (o = /* @__PURE__ */ a(Go, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
|
|
1719
1718
|
}
|
|
1720
1719
|
case "question-form": {
|
|
1721
1720
|
let o;
|
|
1722
|
-
return e[19] !== n.questions ? (o = /* @__PURE__ */ a(
|
|
1721
|
+
return e[19] !== n.questions ? (o = /* @__PURE__ */ a(gn, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
|
|
1723
1722
|
}
|
|
1724
1723
|
case "references": {
|
|
1725
1724
|
let o;
|
|
1726
|
-
e[21] !== n.references ? (o = n.references.map(
|
|
1725
|
+
e[21] !== n.references ? (o = n.references.map(qr), e[21] = n.references, e[22] = o) : o = e[22];
|
|
1727
1726
|
let r;
|
|
1728
1727
|
return e[23] !== o ? (r = /* @__PURE__ */ a(Y, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
|
|
1729
1728
|
}
|
|
@@ -1733,14 +1732,14 @@ function qr(t) {
|
|
|
1733
1732
|
onOpenFile: s
|
|
1734
1733
|
}), e[25] = n, e[26] = s, e[27] = o) : o = e[27];
|
|
1735
1734
|
let r;
|
|
1736
|
-
return e[28] !== o ? (r = /* @__PURE__ */ a(
|
|
1735
|
+
return e[28] !== o ? (r = /* @__PURE__ */ a(Ot, { children: o }), e[28] = o, e[29] = r) : r = e[29], r;
|
|
1737
1736
|
}
|
|
1738
1737
|
}
|
|
1739
1738
|
}
|
|
1740
|
-
function
|
|
1741
|
-
return /* @__PURE__ */ a(
|
|
1739
|
+
function qr(t) {
|
|
1740
|
+
return /* @__PURE__ */ a(zt, { fileName: t }, t);
|
|
1742
1741
|
}
|
|
1743
|
-
function
|
|
1742
|
+
function Hr(t) {
|
|
1744
1743
|
const e = T(23), {
|
|
1745
1744
|
item: n,
|
|
1746
1745
|
itemKey: s,
|
|
@@ -1755,18 +1754,18 @@ function Qr(t) {
|
|
|
1755
1754
|
let d;
|
|
1756
1755
|
e[1] !== n.indicator ? (d = /* @__PURE__ */ k(Ce.Connector, { children: [
|
|
1757
1756
|
u,
|
|
1758
|
-
/* @__PURE__ */ a(
|
|
1757
|
+
/* @__PURE__ */ a($r, { ind: n.indicator })
|
|
1759
1758
|
] }), e[1] = n.indicator, e[2] = d) : d = e[2];
|
|
1760
1759
|
const f = o ? "auto" : "20px";
|
|
1761
1760
|
let m;
|
|
1762
1761
|
e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== c || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ a(Ce.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k(Je, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
|
|
1763
|
-
/* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((y, b) => /* @__PURE__ */ a(
|
|
1762
|
+
/* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((y, b) => /* @__PURE__ */ a(Or, { seg: y, isClickable: r, onOpenFile: c }, b)) }),
|
|
1764
1763
|
r ? /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
|
|
1765
1764
|
color: "fg"
|
|
1766
|
-
}, children: /* @__PURE__ */ a(
|
|
1765
|
+
}, children: /* @__PURE__ */ a(go, { size: 12 }) }) : null
|
|
1767
1766
|
] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = c, e[8] = l, e[9] = m) : m = e[9];
|
|
1768
1767
|
let p;
|
|
1769
|
-
e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== c ? (p = i ? /* @__PURE__ */ a(I, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ a(I, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((y, b) => /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(
|
|
1768
|
+
e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== c ? (p = i ? /* @__PURE__ */ a(I, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ a(I, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((y, b) => /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(zr, { b: y, onOpenFile: c }) }, b)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = c, e[14] = p) : p = e[14];
|
|
1770
1769
|
let h;
|
|
1771
1770
|
e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ k(Ce.Content, { pb: "xs", h: f, overflow: "hidden", children: [
|
|
1772
1771
|
m,
|
|
@@ -1778,14 +1777,14 @@ function Qr(t) {
|
|
|
1778
1777
|
h
|
|
1779
1778
|
] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
|
|
1780
1779
|
}
|
|
1781
|
-
function
|
|
1780
|
+
function Qr(t) {
|
|
1782
1781
|
const e = T(11), {
|
|
1783
1782
|
data: n,
|
|
1784
1783
|
onOpenFile: s
|
|
1785
1784
|
} = t;
|
|
1786
1785
|
let o;
|
|
1787
1786
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
|
|
1788
|
-
const [r, i] = G(o), l =
|
|
1787
|
+
const [r, i] = G(o), l = Wr;
|
|
1789
1788
|
let c;
|
|
1790
1789
|
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = (m) => {
|
|
1791
1790
|
i((p) => ({
|
|
@@ -1799,21 +1798,21 @@ function Wr(t) {
|
|
|
1799
1798
|
let m;
|
|
1800
1799
|
e[6] !== r || e[7] !== s ? (m = (p, h) => {
|
|
1801
1800
|
const g = l(p, h), y = (p.blocks?.length ?? 0) > 0, b = (p.expandable ?? !0) && y, x = b ? r[g] ?? !1 : y;
|
|
1802
|
-
return /* @__PURE__ */ a(
|
|
1801
|
+
return /* @__PURE__ */ a(Hr, { item: p, itemKey: g, isOpen: x, canExpand: b, hasBlocks: y, onToggle: u, onOpenFile: s }, g);
|
|
1803
1802
|
}, e[6] = r, e[7] = s, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
|
|
1804
1803
|
} else
|
|
1805
1804
|
d = e[5];
|
|
1806
1805
|
let f;
|
|
1807
1806
|
return e[9] !== d ? (f = /* @__PURE__ */ a(Ce.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
|
|
1808
1807
|
}
|
|
1809
|
-
function
|
|
1808
|
+
function Wr(t, e) {
|
|
1810
1809
|
return t.id ? `id:${t.id}` : `idx:${e}`;
|
|
1811
1810
|
}
|
|
1812
|
-
const
|
|
1811
|
+
const Nr = (t) => gt(t.tool ?? "").replace(/_/g, "") === "question", Vr = (t) => {
|
|
1813
1812
|
const e = t.state?.output;
|
|
1814
1813
|
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;
|
|
1815
1814
|
};
|
|
1816
|
-
function
|
|
1815
|
+
function jr(t) {
|
|
1817
1816
|
const e = T(8), {
|
|
1818
1817
|
invocations: n,
|
|
1819
1818
|
labeledBlocks: s,
|
|
@@ -1824,12 +1823,12 @@ function Ur(t) {
|
|
|
1824
1823
|
if (e[0] !== i || e[1] !== n || e[2] !== s) {
|
|
1825
1824
|
c = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
1826
1825
|
e: {
|
|
1827
|
-
const f = i ? n.filter(
|
|
1826
|
+
const f = i ? n.filter(Ur) : n;
|
|
1828
1827
|
if (f.length === 0) {
|
|
1829
1828
|
c = null;
|
|
1830
1829
|
break e;
|
|
1831
1830
|
}
|
|
1832
|
-
l =
|
|
1831
|
+
l = Mr(f, {
|
|
1833
1832
|
labeledBlocks: s
|
|
1834
1833
|
});
|
|
1835
1834
|
}
|
|
@@ -1840,18 +1839,18 @@ function Ur(t) {
|
|
|
1840
1839
|
return c;
|
|
1841
1840
|
const u = l;
|
|
1842
1841
|
let d;
|
|
1843
|
-
return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ a(
|
|
1842
|
+
return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ a(Qr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
|
|
1844
1843
|
}
|
|
1845
|
-
function
|
|
1846
|
-
return !
|
|
1844
|
+
function Ur(t) {
|
|
1845
|
+
return !Nr(t) || Vr(t);
|
|
1847
1846
|
}
|
|
1848
|
-
const
|
|
1847
|
+
const Kr = (t) => t.type === "tool", Nt = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", Gr = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, Xr = (t) => t.mediaType?.startsWith("image/") || Gr.test(Nt(t)), Yr = (t) => Xr(t) ? /* @__PURE__ */ a(Un, { src: t.url, alt: `${Nt(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, Jr = (t, e) => {
|
|
1849
1848
|
if (e) {
|
|
1850
1849
|
e(t.url);
|
|
1851
1850
|
return;
|
|
1852
1851
|
}
|
|
1853
1852
|
typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
|
|
1854
|
-
},
|
|
1853
|
+
}, Zr = (t) => {
|
|
1855
1854
|
if (t.message && t.message.trim().length > 0)
|
|
1856
1855
|
return t.message;
|
|
1857
1856
|
const {
|
|
@@ -1867,18 +1866,18 @@ const Gr = (t) => t.type === "tool", Vt = (t) => t.filename ?? t.url.split("/").
|
|
|
1867
1866
|
default:
|
|
1868
1867
|
return "An error occurred.";
|
|
1869
1868
|
}
|
|
1870
|
-
},
|
|
1869
|
+
}, ei = {
|
|
1871
1870
|
info: "blue",
|
|
1872
1871
|
warning: "orange",
|
|
1873
1872
|
error: "red",
|
|
1874
1873
|
success: "green",
|
|
1875
1874
|
loading: "blue"
|
|
1876
|
-
},
|
|
1875
|
+
}, ti = (t, e) => {
|
|
1877
1876
|
const n = [];
|
|
1878
1877
|
let s = e;
|
|
1879
1878
|
for (; s < t.length; ) {
|
|
1880
1879
|
const o = t[s];
|
|
1881
|
-
if (!
|
|
1880
|
+
if (!Kr(o)) break;
|
|
1882
1881
|
n.push(o), s += 1;
|
|
1883
1882
|
}
|
|
1884
1883
|
return {
|
|
@@ -1886,13 +1885,13 @@ const Gr = (t) => t.type === "tool", Vt = (t) => t.filename ?? t.url.split("/").
|
|
|
1886
1885
|
nextIndex: s - 1
|
|
1887
1886
|
};
|
|
1888
1887
|
};
|
|
1889
|
-
function
|
|
1888
|
+
function En(t) {
|
|
1890
1889
|
const e = T(8), {
|
|
1891
1890
|
message: n,
|
|
1892
1891
|
hideQuestionForms: s,
|
|
1893
1892
|
onOpenFile: o,
|
|
1894
1893
|
toolInvocationTimeline: r
|
|
1895
|
-
} = t, i = s === void 0 ? !1 : s, l = r ??
|
|
1894
|
+
} = t, i = s === void 0 ? !1 : s, l = r ?? jr;
|
|
1896
1895
|
let c;
|
|
1897
1896
|
e[0] !== n.parts ? (c = n.parts ?? [], e[0] = n.parts, e[1] = c) : c = e[1];
|
|
1898
1897
|
const u = c;
|
|
@@ -1903,7 +1902,7 @@ function vn(t) {
|
|
|
1903
1902
|
const p = u[m], h = `${n.id}-${m}`;
|
|
1904
1903
|
e: switch (p.type) {
|
|
1905
1904
|
case "text": {
|
|
1906
|
-
f.push(/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
1905
|
+
f.push(/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(Cs, { children: p.text }) }, h));
|
|
1907
1906
|
break e;
|
|
1908
1907
|
}
|
|
1909
1908
|
case "reasoning": {
|
|
@@ -1913,48 +1912,48 @@ function vn(t) {
|
|
|
1913
1912
|
fontSize: ".75rem !important",
|
|
1914
1913
|
fontWeight: "normal !important"
|
|
1915
1914
|
}
|
|
1916
|
-
}, children: /* @__PURE__ */ a(
|
|
1915
|
+
}, children: /* @__PURE__ */ a(un, { defaultState: p.text, fullWidth: !0 }) }, h));
|
|
1917
1916
|
break e;
|
|
1918
1917
|
}
|
|
1919
1918
|
case "tool": {
|
|
1920
1919
|
const {
|
|
1921
1920
|
invocations: g,
|
|
1922
1921
|
nextIndex: y
|
|
1923
|
-
} =
|
|
1922
|
+
} = ti(u, m);
|
|
1924
1923
|
m = y, f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
|
|
1925
1924
|
break e;
|
|
1926
1925
|
}
|
|
1927
1926
|
case "file": {
|
|
1928
|
-
f.push(/* @__PURE__ */ a(I, { width: "fit-content", children: /* @__PURE__ */ a(
|
|
1927
|
+
f.push(/* @__PURE__ */ a(I, { width: "fit-content", children: /* @__PURE__ */ a(zt, { fileName: Nt(p), size: "sm", tone: "neutral", icon: Yr(p), onSelect: () => Jr(p, o) }) }, h));
|
|
1929
1928
|
break e;
|
|
1930
1929
|
}
|
|
1931
1930
|
case "error": {
|
|
1932
|
-
f.push(/* @__PURE__ */ a(I, { py: "2", width: "full", children: /* @__PURE__ */ a(
|
|
1931
|
+
f.push(/* @__PURE__ */ a(I, { py: "2", width: "full", children: /* @__PURE__ */ a(Ut, { borderRadius: "xs", status: "error", colorPalette: "red", title: Zr(p), size: "sm" }) }, h));
|
|
1933
1932
|
break e;
|
|
1934
1933
|
}
|
|
1935
1934
|
case "token_usage":
|
|
1936
1935
|
break e;
|
|
1937
1936
|
case "alert": {
|
|
1938
|
-
f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(
|
|
1937
|
+
f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(Ut, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: ei[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ a(Ft, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
|
|
1939
1938
|
break e;
|
|
1940
1939
|
}
|
|
1941
1940
|
default:
|
|
1942
1941
|
f.push(null);
|
|
1943
1942
|
}
|
|
1944
1943
|
}
|
|
1945
|
-
d = /* @__PURE__ */ a(
|
|
1944
|
+
d = /* @__PURE__ */ a(Ot, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
|
|
1946
1945
|
} else
|
|
1947
1946
|
d = e[7];
|
|
1948
1947
|
return d;
|
|
1949
1948
|
}
|
|
1950
|
-
const
|
|
1949
|
+
const ni = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", oi = (t) => {
|
|
1951
1950
|
const e = t.parts ?? [];
|
|
1952
1951
|
return e.length === 0 || e.some((s) => s.type === "text" && "text" in s) ? !1 : e.some((s) => s.type === "reasoning" || s.type === "tool");
|
|
1953
|
-
},
|
|
1952
|
+
}, si = (t) => {
|
|
1954
1953
|
const e = [];
|
|
1955
1954
|
for (const n of t) {
|
|
1956
1955
|
const s = e[e.length - 1];
|
|
1957
|
-
if (s && s.role === n.role &&
|
|
1956
|
+
if (s && s.role === n.role && oi(n)) {
|
|
1958
1957
|
s.parts = [...s.parts ?? [], ...n.parts ?? []];
|
|
1959
1958
|
continue;
|
|
1960
1959
|
}
|
|
@@ -1964,7 +1963,7 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
1964
1963
|
});
|
|
1965
1964
|
}
|
|
1966
1965
|
return e;
|
|
1967
|
-
},
|
|
1966
|
+
}, ri = (t) => {
|
|
1968
1967
|
const e = [], n = [];
|
|
1969
1968
|
for (const s of t)
|
|
1970
1969
|
s.role === "user" ? e.push({
|
|
@@ -1975,7 +1974,7 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
1975
1974
|
groups: e,
|
|
1976
1975
|
leadingResponses: n
|
|
1977
1976
|
};
|
|
1978
|
-
},
|
|
1977
|
+
}, vn = 720, ii = 1, li = 3, ai = 20, nn = 1, ci = 4, Ln = 8, ui = (t, e) => [...t.map((n) => ({
|
|
1979
1978
|
type: "leading-response",
|
|
1980
1979
|
key: n.id,
|
|
1981
1980
|
message: n
|
|
@@ -1984,14 +1983,14 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
1984
1983
|
key: n.userMessage.id,
|
|
1985
1984
|
group: n,
|
|
1986
1985
|
groupIndex: s
|
|
1987
|
-
}))],
|
|
1986
|
+
}))], di = (t, e) => {
|
|
1988
1987
|
if (t === 0) return 0;
|
|
1989
|
-
const n = t *
|
|
1988
|
+
const n = t * vn + (t - 1) * Ln;
|
|
1990
1989
|
return Math.max(n - e, 0);
|
|
1991
|
-
},
|
|
1990
|
+
}, fi = (t) => t?.clientHeight || ii, pi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= nn && Math.abs(t.totalSize - e.totalSize) <= nn, mi = (t, e) => ({
|
|
1992
1991
|
scrollTop: t?.scrollTop ?? 0,
|
|
1993
1992
|
totalSize: e
|
|
1994
|
-
}),
|
|
1993
|
+
}), hi = (t) => {
|
|
1995
1994
|
const e = T(8), {
|
|
1996
1995
|
itemCount: n,
|
|
1997
1996
|
onReady: s,
|
|
@@ -2011,8 +2010,8 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2011
2010
|
let f = 0, m = 0, p = 0, h = null;
|
|
2012
2011
|
const g = () => {
|
|
2013
2012
|
m = m + 1;
|
|
2014
|
-
const y =
|
|
2015
|
-
if (p = h &&
|
|
2013
|
+
const y = mi(o.current, r);
|
|
2014
|
+
if (p = h && pi(y, h) ? p + 1 : 0, h = y, p >= li || m >= ai) {
|
|
2016
2015
|
i.current?.();
|
|
2017
2016
|
return;
|
|
2018
2017
|
}
|
|
@@ -2020,7 +2019,7 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2020
2019
|
};
|
|
2021
2020
|
return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
|
|
2022
2021
|
}, 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]), Ae(u, d);
|
|
2023
|
-
},
|
|
2022
|
+
}, gi = (t) => {
|
|
2024
2023
|
const e = T(7), {
|
|
2025
2024
|
label: n,
|
|
2026
2025
|
onClick: s,
|
|
@@ -2033,21 +2032,21 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2033
2032
|
o,
|
|
2034
2033
|
i
|
|
2035
2034
|
] }), e[3] = o, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
|
|
2036
|
-
},
|
|
2037
|
-
const s =
|
|
2035
|
+
}, Dn = (t, e, n = !1) => {
|
|
2036
|
+
const s = ni(t.role);
|
|
2038
2037
|
return /* @__PURE__ */ a(_e.Root, { from: s, children: /* @__PURE__ */ k(_e.Content, { from: s, children: [
|
|
2039
|
-
/* @__PURE__ */ a(
|
|
2040
|
-
s === "assistant" || s === "user" ? /* @__PURE__ */ a(
|
|
2038
|
+
/* @__PURE__ */ a(En, { message: t, streaming: e, hideQuestionForms: n }),
|
|
2039
|
+
s === "assistant" || s === "user" ? /* @__PURE__ */ a(Bt, { message: t, alwaysVisible: s === "user", copyAlwaysVisible: s !== "user" }) : null
|
|
2041
2040
|
] }) });
|
|
2042
|
-
},
|
|
2043
|
-
|
|
2044
|
-
},
|
|
2041
|
+
}, bi = (t) => {
|
|
2042
|
+
xs(t.currentTarget, t.deltaY) && t.stopPropagation();
|
|
2043
|
+
}, yi = (t, e) => {
|
|
2045
2044
|
if (t)
|
|
2046
|
-
return e ?
|
|
2047
|
-
},
|
|
2045
|
+
return e ? bn : gs;
|
|
2046
|
+
}, xi = (t) => {
|
|
2048
2047
|
if (t)
|
|
2049
|
-
return
|
|
2050
|
-
},
|
|
2048
|
+
return bn;
|
|
2049
|
+
}, Si = (t) => {
|
|
2051
2050
|
const e = T(43), {
|
|
2052
2051
|
group: n,
|
|
2053
2052
|
streaming: s,
|
|
@@ -2056,20 +2055,20 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2056
2055
|
onToggleStickyMessage: i
|
|
2057
2056
|
} = t;
|
|
2058
2057
|
let l, c, u;
|
|
2059
|
-
e[0] !== n.userMessage || e[1] !== r ? (l =
|
|
2058
|
+
e[0] !== n.userMessage || e[1] !== r ? (l = ys(n.userMessage), c = l && r, u = yi(l, r), e[0] = n.userMessage, e[1] = r, e[2] = l, e[3] = c, e[4] = u) : (l = e[2], c = e[3], u = e[4]);
|
|
2060
2059
|
const d = u;
|
|
2061
2060
|
let f;
|
|
2062
2061
|
e[5] !== n.userMessage.id || e[6] !== i ? (f = () => i(n.userMessage.id), e[5] = n.userMessage.id, e[6] = i, e[7] = f) : f = e[7];
|
|
2063
2062
|
const m = f, p = l ? "0" : void 0, h = l ? "relative" : void 0, g = l ? r ? "expanded" : "collapsed" : void 0;
|
|
2064
2063
|
let y;
|
|
2065
|
-
e[8] !== c ? (y =
|
|
2066
|
-
const b = c ? "auto" : "visible", x = l ? "xs" : void 0, C = l ? "xs" : void 0, A = c ? "3rem" : void 0, w = c ?
|
|
2064
|
+
e[8] !== c ? (y = xi(c), e[8] = c, e[9] = y) : y = e[9];
|
|
2065
|
+
const b = c ? "auto" : "visible", x = l ? "xs" : void 0, C = l ? "xs" : void 0, A = c ? "3rem" : void 0, w = c ? bi : void 0;
|
|
2067
2066
|
let _;
|
|
2068
|
-
e[10] !== n.userMessage || e[11] !== s ? (_ = /* @__PURE__ */ a(
|
|
2067
|
+
e[10] !== n.userMessage || e[11] !== s ? (_ = /* @__PURE__ */ a(En, { message: n.userMessage, streaming: s }), e[10] = n.userMessage, e[11] = s, e[12] = _) : _ = e[12];
|
|
2069
2068
|
let M;
|
|
2070
2069
|
e[13] !== w || e[14] !== _ || e[15] !== g || e[16] !== y || e[17] !== b || e[18] !== x || e[19] !== C || e[20] !== A ? (M = /* @__PURE__ */ a(I, { "data-sticky-user-message-content": g, display: "flex", flexDirection: "column", gap: "sm", maxH: y, minH: "0", overflowY: b, px: x, py: C, pb: A, onWheel: w, children: _ }), e[13] = w, e[14] = _, e[15] = g, e[16] = y, e[17] = b, e[18] = x, e[19] = C, e[20] = A, e[21] = M) : M = e[21];
|
|
2071
2070
|
let P;
|
|
2072
|
-
e[22] !== n.userMessage || e[23] !== l || e[24] !== r || e[25] !== m ? (P = l ? /* @__PURE__ */ a(
|
|
2071
|
+
e[22] !== n.userMessage || e[23] !== l || e[24] !== r || e[25] !== m ? (P = l ? /* @__PURE__ */ a(gi, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ a(Bt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ a(Bt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[22] = n.userMessage, e[23] = l, e[24] = r, e[25] = m, e[26] = P) : P = e[26];
|
|
2073
2072
|
let v;
|
|
2074
2073
|
e[27] !== d || e[28] !== M || e[29] !== P || e[30] !== p || e[31] !== h ? (v = /* @__PURE__ */ a(I, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ k(_e.Content, { from: "user", maxH: d, overflow: "hidden", p, position: h, children: [
|
|
2075
2074
|
M,
|
|
@@ -2078,15 +2077,15 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2078
2077
|
let L;
|
|
2079
2078
|
if (e[33] !== n.responses || e[34] !== o || e[35] !== s) {
|
|
2080
2079
|
let J;
|
|
2081
|
-
e[37] !== o || e[38] !== s ? (J = (B) => /* @__PURE__ */ a(I, { children:
|
|
2080
|
+
e[37] !== o || e[38] !== s ? (J = (B) => /* @__PURE__ */ a(I, { children: Dn(B, s, o) }, B.id), e[37] = o, e[38] = s, e[39] = J) : J = e[39], L = n.responses.map(J), e[33] = n.responses, e[34] = o, e[35] = s, e[36] = L;
|
|
2082
2081
|
} else
|
|
2083
2082
|
L = e[36];
|
|
2084
|
-
let
|
|
2085
|
-
return e[40] !== v || e[41] !== L ? (
|
|
2083
|
+
let H;
|
|
2084
|
+
return e[40] !== v || e[41] !== L ? (H = /* @__PURE__ */ k(I, { children: [
|
|
2086
2085
|
v,
|
|
2087
2086
|
L
|
|
2088
|
-
] }), e[40] = v, e[41] = L, e[42] =
|
|
2089
|
-
},
|
|
2087
|
+
] }), e[40] = v, e[41] = L, e[42] = H) : H = e[42], H;
|
|
2088
|
+
}, Ti = (t, e) => {
|
|
2090
2089
|
const {
|
|
2091
2090
|
groups: n,
|
|
2092
2091
|
streaming: s,
|
|
@@ -2094,8 +2093,8 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2094
2093
|
expandedStickyMessageIds: r,
|
|
2095
2094
|
onToggleStickyMessage: i
|
|
2096
2095
|
} = e;
|
|
2097
|
-
return t.type === "leading-response" ?
|
|
2098
|
-
},
|
|
2096
|
+
return t.type === "leading-response" ? Dn(t.message, s, n.length > 0 || o) : /* @__PURE__ */ a(Si, { group: t.group, streaming: s, hideQuestionForms: t.groupIndex < n.length - 1 || o, isExpanded: r.has(t.group.userMessage.id), onToggleStickyMessage: i });
|
|
2097
|
+
}, wi = (t) => {
|
|
2099
2098
|
const {
|
|
2100
2099
|
leadingResponses: e,
|
|
2101
2100
|
groups: n,
|
|
@@ -2106,20 +2105,20 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2106
2105
|
onReady: l
|
|
2107
2106
|
} = t, {
|
|
2108
2107
|
scrollRef: c
|
|
2109
|
-
} = mt(), u =
|
|
2108
|
+
} = mt(), u = ui(e, n), d = fi(c.current), f = _o({
|
|
2110
2109
|
count: u.length,
|
|
2111
2110
|
getScrollElement: () => c.current,
|
|
2112
|
-
estimateSize: () =>
|
|
2111
|
+
estimateSize: () => vn,
|
|
2113
2112
|
getItemKey: (p) => u[p]?.key ?? p,
|
|
2114
|
-
overscan:
|
|
2115
|
-
gap:
|
|
2113
|
+
overscan: ci,
|
|
2114
|
+
gap: Ln,
|
|
2116
2115
|
initialRect: {
|
|
2117
2116
|
width: 0,
|
|
2118
2117
|
height: d
|
|
2119
2118
|
},
|
|
2120
|
-
initialOffset: () =>
|
|
2119
|
+
initialOffset: () => di(u.length, d)
|
|
2121
2120
|
}), m = f.getTotalSize();
|
|
2122
|
-
return
|
|
2121
|
+
return hi({
|
|
2123
2122
|
itemCount: u.length,
|
|
2124
2123
|
onReady: l,
|
|
2125
2124
|
scrollRef: c,
|
|
@@ -2130,7 +2129,7 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2130
2129
|
const h = u[p.index];
|
|
2131
2130
|
return h ? /* @__PURE__ */ a(I, { ref: f.measureElement, "data-index": p.index, "data-chat-message-list-item": h.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
|
|
2132
2131
|
top: p.start
|
|
2133
|
-
}, children:
|
|
2132
|
+
}, children: Ti(h, {
|
|
2134
2133
|
groups: n,
|
|
2135
2134
|
streaming: s,
|
|
2136
2135
|
hideActiveQuestionForms: o,
|
|
@@ -2165,58 +2164,58 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2165
2164
|
workspaceInitializing: P,
|
|
2166
2165
|
inputDisabled: v,
|
|
2167
2166
|
chatInputQuestionPrompt: L,
|
|
2168
|
-
chatInputAutoFocus:
|
|
2169
|
-
} = t, J = o === void 0 ? !1 : o, B = r === void 0 ? !1 : r, ve = f === void 0 ? "" : f, je = P === void 0 ? !1 : P, Le = v === void 0 ? !1 : v, he =
|
|
2167
|
+
chatInputAutoFocus: H
|
|
2168
|
+
} = t, J = o === void 0 ? !1 : o, B = r === void 0 ? !1 : r, ve = f === void 0 ? "" : f, je = P === void 0 ? !1 : P, Le = v === void 0 ? !1 : v, he = H === void 0 ? !1 : H;
|
|
2170
2169
|
let F, z, ee, E;
|
|
2171
2170
|
if (e[0] !== n || e[1] !== s) {
|
|
2172
|
-
const
|
|
2173
|
-
F =
|
|
2174
|
-
const we = n ??
|
|
2175
|
-
z = F ? we ?? "active-conversation" : null, E =
|
|
2171
|
+
const q = si(s);
|
|
2172
|
+
F = q.length > 0;
|
|
2173
|
+
const we = n ?? q[0]?.id;
|
|
2174
|
+
z = F ? we ?? "active-conversation" : null, E = q.reduce(ki, 0), ee = ri(q), e[0] = n, e[1] = s, e[2] = F, e[3] = z, e[4] = ee, e[5] = E;
|
|
2176
2175
|
} else
|
|
2177
2176
|
F = e[2], z = e[3], ee = e[4], E = e[5];
|
|
2178
2177
|
const {
|
|
2179
2178
|
groups: ge,
|
|
2180
2179
|
leadingResponses: be
|
|
2181
|
-
} = ee, [O, De] = G(
|
|
2180
|
+
} = ee, [O, De] = G(Ci), [Ue, Ke] = G(null), Be = !F && J;
|
|
2182
2181
|
let Ie;
|
|
2183
|
-
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = /* @__PURE__ */ a(
|
|
2182
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = /* @__PURE__ */ a(bo, { size: 48, strokeWidth: 1.5 }), e[6] = Ie) : Ie = e[6];
|
|
2184
2183
|
let te;
|
|
2185
|
-
e[7] !== l || e[8] !== i ? (te = /* @__PURE__ */ a(
|
|
2184
|
+
e[7] !== l || e[8] !== i ? (te = /* @__PURE__ */ a(Ao, { icon: Ie, title: i, description: l }), e[7] = l, e[8] = i, e[9] = te) : te = e[9];
|
|
2186
2185
|
const ye = Be ? u : c ?? te, ne = !!M, xe = !!L, oe = B && F && !je, se = !z || Ue === z;
|
|
2187
2186
|
let re;
|
|
2188
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (re = (
|
|
2187
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (re = (q) => {
|
|
2189
2188
|
De((we) => {
|
|
2190
2189
|
const K = new Set(we);
|
|
2191
|
-
return K.has(
|
|
2190
|
+
return K.has(q) ? K.delete(q) : K.add(q), K;
|
|
2192
2191
|
});
|
|
2193
2192
|
}, e[10] = re) : re = e[10];
|
|
2194
2193
|
const Oe = re;
|
|
2195
2194
|
let ie;
|
|
2196
|
-
e[11] !== E ? (ie = /* @__PURE__ */ a(
|
|
2195
|
+
e[11] !== E ? (ie = /* @__PURE__ */ a(Ho, { userMessageCount: E }), e[11] = E, e[12] = ie) : ie = e[12];
|
|
2197
2196
|
const Se = se ? "visible" : "hidden";
|
|
2198
2197
|
let Q;
|
|
2199
|
-
e[13] !== ye || e[14] !== O || e[15] !== ge || e[16] !== F || e[17] !== xe || e[18] !== be || e[19] !== z || e[20] !== B ? (Q = F ? /* @__PURE__ */ a(
|
|
2198
|
+
e[13] !== ye || e[14] !== O || e[15] !== ge || e[16] !== F || e[17] !== xe || e[18] !== be || e[19] !== z || e[20] !== B ? (Q = F ? /* @__PURE__ */ a(wi, { leadingResponses: be, groups: ge, streaming: B, hideActiveQuestionForms: xe, expandedStickyMessageIds: O, onToggleStickyMessage: Oe, onReady: () => Ke(z) }, z) : ye, e[13] = ye, e[14] = O, e[15] = ge, e[16] = F, e[17] = xe, e[18] = be, e[19] = z, e[20] = B, e[21] = Q) : Q = e[21];
|
|
2200
2199
|
let W;
|
|
2201
|
-
e[22] !== Se || e[23] !== Q ? (W = /* @__PURE__ */ a(
|
|
2200
|
+
e[22] !== Se || e[23] !== Q ? (W = /* @__PURE__ */ a(Et.Viewport, { visibility: Se, children: Q }), e[22] = Se, e[23] = Q, e[24] = W) : W = e[24];
|
|
2202
2201
|
let Te;
|
|
2203
|
-
e[25] !== se ? (Te = se ? /* @__PURE__ */ a(
|
|
2202
|
+
e[25] !== se ? (Te = se ? /* @__PURE__ */ a(Et.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[25] = se, e[26] = Te) : Te = e[26];
|
|
2204
2203
|
let N;
|
|
2205
|
-
e[27] !== ie || e[28] !== W || e[29] !== Te ? (N = /* @__PURE__ */ k(
|
|
2204
|
+
e[27] !== ie || e[28] !== W || e[29] !== Te ? (N = /* @__PURE__ */ k(Et.Root, { children: [
|
|
2206
2205
|
ie,
|
|
2207
2206
|
W,
|
|
2208
2207
|
Te
|
|
2209
2208
|
] }), e[27] = ie, e[28] = W, e[29] = Te, e[30] = N) : N = e[30];
|
|
2210
2209
|
let Z;
|
|
2211
2210
|
e[31] !== oe ? (Z = oe ? /* @__PURE__ */ k(Me, { gap: "xs", px: "sm", py: "2xs", children: [
|
|
2212
|
-
/* @__PURE__ */ a(
|
|
2211
|
+
/* @__PURE__ */ a(Ft, { size: "xs", color: "fg.muted" }),
|
|
2213
2212
|
/* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
|
|
2214
2213
|
] }) : null, e[31] = oe, e[32] = Z) : Z = e[32];
|
|
2215
2214
|
const V = ne ? "0" : "xs";
|
|
2216
2215
|
let $;
|
|
2217
|
-
e[33] !== ve ? ($ =
|
|
2216
|
+
e[33] !== ve ? ($ = ps(ve), e[33] = ve, e[34] = $) : $ = e[34];
|
|
2218
2217
|
let D;
|
|
2219
|
-
e[35] !== b || e[36] !== C || e[37] !== w || e[38] !== he || e[39] !== d || e[40] !== L || e[41] !== ne || e[42] !== Le || e[43] !== h || e[44] !== g || e[45] !== y || e[46] !== A || e[47] !== p || e[48] !== m || e[49] !== B || e[50] !== $ ? (D = /* @__PURE__ */ a(
|
|
2218
|
+
e[35] !== b || e[36] !== C || e[37] !== w || e[38] !== he || e[39] !== d || e[40] !== L || e[41] !== ne || e[42] !== Le || e[43] !== h || e[44] !== g || e[45] !== y || e[46] !== A || e[47] !== p || e[48] !== m || e[49] !== B || e[50] !== $ ? (D = /* @__PURE__ */ a(cs, { placeholder: d, defaultState: $, streaming: B, onSubmit: m, onInterrupt: p, onAttachFiles: h, onAttachText: g, onChange: y, actions: b, attachedResources: C, onClearAttachments: A, attachmentList: w, isDisabled: Le, attachedToTop: ne, questionPrompt: L, autoFocus: he }), e[35] = b, e[36] = C, e[37] = w, e[38] = he, e[39] = d, e[40] = L, e[41] = ne, e[42] = Le, e[43] = h, e[44] = g, e[45] = y, e[46] = A, e[47] = p, e[48] = m, e[49] = B, e[50] = $, e[51] = D) : D = e[51];
|
|
2220
2219
|
let j;
|
|
2221
2220
|
e[52] !== V || e[53] !== D || e[54] !== M ? (j = /* @__PURE__ */ k(Y, { px: "xs", gap: V, children: [
|
|
2222
2221
|
M,
|
|
@@ -2233,20 +2232,20 @@ const oi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
2233
2232
|
U
|
|
2234
2233
|
] }), e[58] = _, e[59] = N, e[60] = Z, e[61] = j, e[62] = U, e[63] = le) : le = e[63], le;
|
|
2235
2234
|
};
|
|
2236
|
-
function
|
|
2235
|
+
function ki(t, e) {
|
|
2237
2236
|
return t + (e.role === "user" ? 1 : 0);
|
|
2238
2237
|
}
|
|
2239
|
-
function
|
|
2238
|
+
function Ci() {
|
|
2240
2239
|
return /* @__PURE__ */ new Set();
|
|
2241
2240
|
}
|
|
2242
|
-
const
|
|
2241
|
+
const on = (t) => /* @__PURE__ */ a(Y, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ a(Kn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), fl = () => {
|
|
2243
2242
|
const t = T(2);
|
|
2244
2243
|
let e;
|
|
2245
|
-
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ a(_e.Content, { from: "user", children:
|
|
2244
|
+
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ a(_e.Content, { from: "user", children: on(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
|
|
2246
2245
|
let n;
|
|
2247
2246
|
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(Y, { minH: "full", py: "xs", gap: "0", children: [
|
|
2248
2247
|
e,
|
|
2249
|
-
/* @__PURE__ */ a(_e.Root, { from: "assistant", children: /* @__PURE__ */ a(_e.Content, { from: "assistant", children:
|
|
2248
|
+
/* @__PURE__ */ a(_e.Root, { from: "assistant", children: /* @__PURE__ */ a(_e.Content, { from: "assistant", children: on(["76%", "62%", "40%"]) }) })
|
|
2250
2249
|
] }), t[1] = n) : n = t[1], n;
|
|
2251
2250
|
}, pl = (t) => {
|
|
2252
2251
|
const e = T(14), {
|
|
@@ -2259,12 +2258,12 @@ const sn = (t) => /* @__PURE__ */ a(Y, { gap: "xs", w: "full", children: t.map((
|
|
|
2259
2258
|
} = t, c = i === void 0 ? "ready" : i, u = s > 0 || o > 0, d = c === "error" ? "border.error" : "border.muted", f = c === "error" ? "bg.error" : "bg.subtle";
|
|
2260
2259
|
let m;
|
|
2261
2260
|
e[0] !== s || e[1] !== n || e[2] !== o || e[3] !== u || e[4] !== c || e[5] !== l ? (m = c === "loading" ? /* @__PURE__ */ k(Me, { gap: "xs", minW: "0", children: [
|
|
2262
|
-
/* @__PURE__ */ a(
|
|
2261
|
+
/* @__PURE__ */ a(Ft, { size: "xs", color: "fg.muted" }),
|
|
2263
2262
|
/* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: l ?? "Setting up workspace..." })
|
|
2264
2263
|
] }) : c === "error" ? /* @__PURE__ */ k(Me, { gap: "xs", minW: "0", children: [
|
|
2265
|
-
/* @__PURE__ */ a(
|
|
2264
|
+
/* @__PURE__ */ a(an, { size: 14, color: "var(--chakra-colors-fg-error)" }),
|
|
2266
2265
|
/* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: l ?? "Workspace setup failed" })
|
|
2267
|
-
] }) : u ? /* @__PURE__ */ a(
|
|
2266
|
+
] }) : u ? /* @__PURE__ */ a(fn, { label: n, additions: s, deletions: o, variant: "ghost", size: "small", _hover: {
|
|
2268
2267
|
background: "transparent"
|
|
2269
2268
|
} }) : /* @__PURE__ */ a(Re, { flex: "1" }), e[0] = s, e[1] = n, e[2] = o, e[3] = u, e[4] = c, e[5] = l, e[6] = m) : m = e[6];
|
|
2270
2269
|
let p;
|
|
@@ -2278,14 +2277,14 @@ const sn = (t) => /* @__PURE__ */ a(Y, { gap: "xs", w: "full", children: t.map((
|
|
|
2278
2277
|
export {
|
|
2279
2278
|
cl as ApprovalPrompt,
|
|
2280
2279
|
ul as AttachmentList,
|
|
2281
|
-
|
|
2282
|
-
|
|
2280
|
+
Ho as AutoScroll,
|
|
2281
|
+
cs as ChatInput,
|
|
2283
2282
|
_e as ChatMessage,
|
|
2284
2283
|
dl as ChatPanel,
|
|
2285
|
-
|
|
2284
|
+
Et as ChatPrimitives,
|
|
2286
2285
|
fl as ChatSkeleton,
|
|
2287
2286
|
pl as ChatWorkspaceHub,
|
|
2288
|
-
|
|
2289
|
-
|
|
2287
|
+
ls as SendButton,
|
|
2288
|
+
ps as createSerializedPromptState
|
|
2290
2289
|
};
|
|
2291
2290
|
//# sourceMappingURL=chat-ui.js.map
|