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