@epam/ai-dial-conversation-stages 1.3.0-dev.98 → 1.3.0-rc.1
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/components/CollapsedGroup/CollapsedGroup.d.ts.map +1 -1
- package/components/StageItem/StageItem.d.ts +5 -1
- package/components/StageItem/StageItem.d.ts.map +1 -1
- package/components/StageList/StageList.d.ts +4 -0
- package/components/StageList/StageList.d.ts.map +1 -1
- package/components/StageMarkdownContent/StageMarkdownContent.d.ts +3 -1
- package/components/StageMarkdownContent/StageMarkdownContent.d.ts.map +1 -1
- package/components/StagesPanel/StagesPanel.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +511 -482
- package/models/collapsed-group.d.ts +6 -2
- package/models/collapsed-group.d.ts.map +1 -1
- package/models/stages-props.d.ts +11 -2
- package/models/stages-props.d.ts.map +1 -1
- package/package.json +5 -5
- package/utils/stage-attachments.d.ts +4 -2
- package/utils/stage-attachments.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { AttachmentErrorReason as e, AttachmentType as t,
|
|
2
|
-
import { Accordion as
|
|
3
|
-
import { IconAlertCircle as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { Fragment as
|
|
1
|
+
import { AttachmentErrorReason as e, AttachmentType as t, MIMEType as n, MIME_TYPE_EXT_MAP as r, MarkdownCodeBlock as i, MarkdownRenderer as a, RequestStatus as o, StageStatus as s, buildCssVars as c, mergeClasses as l, messageAttachmentsToDisplayAttachments as u, normalizeMimeType as d, useIsVerticallyClamped as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { Accordion as p, DIAL_ICON_SIZE as m, DIAL_KIT_ICON_STROKE as h, DialItemType as g, ElementSize as _, EllipsisTooltip as v, FileIcon as y, Highlight as b, LiveRegion as x, LiveRegionElement as S, Skeleton as C, SkeletonVariant as ee, Spinner as w, StaticIconButton as T, Tooltip as E } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconAlertCircle as D, IconCheck as O, IconClipboard as k, IconDownload as A, IconExternalLink as j, IconFile as M, IconFileTypeBmp as N, IconFileTypeCss as P, IconFileTypeCsv as F, IconFileTypeDoc as te, IconFileTypeDocx as I, IconFileTypeHtml as L, IconFileTypeJpg as R, IconFileTypeJs as z, IconFileTypeJsx as B, IconFileTypePdf as V, IconFileTypePhp as H, IconFileTypePng as U, IconFileTypePpt as ne, IconFileTypeRs as re, IconFileTypeSql as ie, IconFileTypeSvg as ae, IconFileTypeTs as oe, IconFileTypeTsx as se, IconFileTypeTxt as W, IconFileTypeVue as ce, IconFileTypeXls as le, IconFileTypeXml as ue, IconFileTypeZip as G, IconMusic as de, IconPhoto as fe, IconReload as pe, IconTerminal2 as me, IconVideo as he, IconX as ge } from "@tabler/icons-react";
|
|
4
|
+
import { memo as _e, useCallback as K, useEffect as ve, useId as ye, useMemo as q, useRef as be, useState as xe } from "react";
|
|
5
|
+
import { Fragment as Se, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
6
6
|
//#region src/constants/public-class-names.ts
|
|
7
|
-
var
|
|
7
|
+
var Ce = {
|
|
8
8
|
panel: "dial-conversation-stages-panel",
|
|
9
9
|
group: "dial-conversation-stages-group",
|
|
10
10
|
groupToggle: "dial-conversation-stages-group-toggle"
|
|
11
|
-
},
|
|
12
|
-
let [e, t] =
|
|
11
|
+
}, we = () => {
|
|
12
|
+
let [e, t] = xe(() => /* @__PURE__ */ new Set()), n = K((e, n) => {
|
|
13
13
|
t((t) => {
|
|
14
14
|
if (t.has(e) === n) return t;
|
|
15
15
|
let r = new Set(t);
|
|
16
16
|
return n ? r.add(e) : r.delete(e), r;
|
|
17
17
|
});
|
|
18
|
-
}, []), r =
|
|
18
|
+
}, []), r = K(() => {
|
|
19
19
|
t((e) => e.size ? /* @__PURE__ */ new Set() : e);
|
|
20
20
|
}, []);
|
|
21
|
-
return
|
|
21
|
+
return q(() => ({
|
|
22
22
|
isExpanded: (t) => e.has(t),
|
|
23
23
|
onToggle: n,
|
|
24
24
|
reset: r
|
|
@@ -27,30 +27,30 @@ var ve = {
|
|
|
27
27
|
n,
|
|
28
28
|
r
|
|
29
29
|
]);
|
|
30
|
-
},
|
|
30
|
+
}, Te = /[([][^()[\]]*[)\]]/g, Ee = /(\d+(?:\.\d+)?)\s*s\b/, De = (e) => {
|
|
31
31
|
let t = e.trimEnd();
|
|
32
32
|
return t.endsWith(":") ? t.slice(0, -1) : t;
|
|
33
|
-
},
|
|
34
|
-
|
|
33
|
+
}, Oe = (e) => {
|
|
34
|
+
Te.lastIndex = 0;
|
|
35
35
|
let t;
|
|
36
|
-
for (; t =
|
|
37
|
-
let e = t[0].slice(1, -1), n =
|
|
36
|
+
for (; t = Te.exec(e);) {
|
|
37
|
+
let e = t[0].slice(1, -1), n = Ee.exec(e);
|
|
38
38
|
if (n) return {
|
|
39
39
|
durationLabel: `${n[1]}s`,
|
|
40
40
|
groupIndex: t.index,
|
|
41
41
|
groupLength: t[0].length
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
},
|
|
45
|
-
let t = e ?? "", n =
|
|
44
|
+
}, ke = (e) => {
|
|
45
|
+
let t = e ?? "", n = Oe(t);
|
|
46
46
|
return {
|
|
47
|
-
name:
|
|
47
|
+
name: De(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
|
|
48
48
|
durationLabel: n?.durationLabel
|
|
49
49
|
};
|
|
50
|
-
},
|
|
50
|
+
}, Ae = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), je = (e) => [...e].reverse().find((e) => e.status == null), Me = (e, t) => {
|
|
51
51
|
let n = e.parent_stage_index;
|
|
52
52
|
if (!(n == null || !Number.isInteger(n) || n < 0 || n >= e.index)) return t.get(n);
|
|
53
|
-
},
|
|
53
|
+
}, Ne = (e) => {
|
|
54
54
|
let t = e.map((e) => ({
|
|
55
55
|
stage: e,
|
|
56
56
|
children: []
|
|
@@ -58,15 +58,15 @@ var ve = {
|
|
|
58
58
|
for (let e of t) n.has(e.stage.index) || n.set(e.stage.index, e);
|
|
59
59
|
let r = [];
|
|
60
60
|
for (let e of t) {
|
|
61
|
-
let t =
|
|
61
|
+
let t = Me(e.stage, n);
|
|
62
62
|
t ? t.children.push(e) : r.push(e);
|
|
63
63
|
}
|
|
64
64
|
return r;
|
|
65
|
-
},
|
|
65
|
+
}, Pe = (e) => `stage:${e}`, Fe = (e) => `group:${e}`, Ie = "min-w-0 overflow-visible py-0", Le = "min-w-0 justify-start gap-2 rounded-lg px-2 py-1.5 text-start mobile:min-h-11", Re = (e) => {
|
|
66
66
|
let t = [], n = 0;
|
|
67
67
|
for (; n < e.length;) {
|
|
68
|
-
let r = e[n], i =
|
|
69
|
-
for (; a < e.length &&
|
|
68
|
+
let r = e[n], i = ke(r.stage.name).name, a = n + 1;
|
|
69
|
+
for (; a < e.length && ke(e[a].stage.name).name === i;) a += 1;
|
|
70
70
|
let o = e.slice(n, a);
|
|
71
71
|
o.length > 1 ? t.push({
|
|
72
72
|
key: r.stage.index,
|
|
@@ -79,121 +79,115 @@ var ve = {
|
|
|
79
79
|
}
|
|
80
80
|
return t;
|
|
81
81
|
}, X = {
|
|
82
|
-
panel: "
|
|
83
|
-
row: "
|
|
84
|
-
collapseButton: "
|
|
85
|
-
stageHeader: "
|
|
86
|
-
stageRegion: "
|
|
87
|
-
stageName: "
|
|
88
|
-
stageNameFailed: "
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
size: f.MD,
|
|
82
|
+
panel: "_panel_msss2_1",
|
|
83
|
+
row: "_row_msss2_5",
|
|
84
|
+
collapseButton: "_collapseButton_msss2_9",
|
|
85
|
+
stageHeader: "_stageHeader_msss2_18",
|
|
86
|
+
stageRegion: "_stageRegion_msss2_27",
|
|
87
|
+
stageName: "_stageName_msss2_31",
|
|
88
|
+
stageNameFailed: "_stageNameFailed_msss2_35",
|
|
89
|
+
tag: "_tag_msss2_39",
|
|
90
|
+
count: "_count_msss2_43",
|
|
91
|
+
duration: "_duration_msss2_48",
|
|
92
|
+
iconSecondary: "_iconSecondary_msss2_53",
|
|
93
|
+
iconCompleted: "_iconCompleted_msss2_58",
|
|
94
|
+
iconError: "_iconError_msss2_62",
|
|
95
|
+
stageContent: "_stageContent_msss2_66",
|
|
96
|
+
codeBlock: "_codeBlock_msss2_70",
|
|
97
|
+
codeInline: "_codeInline_msss2_76",
|
|
98
|
+
blockquote: "_blockquote_msss2_82",
|
|
99
|
+
tableCell: "_tableCell_msss2_87"
|
|
100
|
+
}, ze = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === s.Failed ? /* @__PURE__ */ Y(Se, { children: [/* @__PURE__ */ J(D, {
|
|
101
|
+
size: m.MD,
|
|
103
102
|
className: X.iconError,
|
|
104
103
|
"aria-hidden": !0,
|
|
105
|
-
stroke:
|
|
104
|
+
stroke: h
|
|
106
105
|
}), /* @__PURE__ */ J("span", {
|
|
107
106
|
className: "sr-only",
|
|
108
107
|
children: r
|
|
109
|
-
})] }) : e ===
|
|
110
|
-
size:
|
|
108
|
+
})] }) : e === s.Completed ? /* @__PURE__ */ J(O, {
|
|
109
|
+
size: m.SM,
|
|
111
110
|
className: X.iconCompleted,
|
|
112
111
|
"aria-hidden": !0,
|
|
113
|
-
stroke:
|
|
114
|
-
}) : t ? /* @__PURE__ */ J(
|
|
112
|
+
stroke: h
|
|
113
|
+
}) : t ? /* @__PURE__ */ J(w, {
|
|
115
114
|
size: 16,
|
|
116
115
|
ariaLabel: n
|
|
117
|
-
}) : null,
|
|
116
|
+
}) : null, Be = (e) => {
|
|
118
117
|
if (e == null) return "";
|
|
119
118
|
let t = e.lastIndexOf(".");
|
|
120
119
|
return t > 0 ? e.slice(0, t) : e;
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
case "text/x-rustsrc": return ee;
|
|
159
|
-
case "text/x-vue": return H;
|
|
160
|
-
default: return O;
|
|
161
|
-
}
|
|
162
|
-
}, Le = (e) => {
|
|
120
|
+
}, Ve = () => ({
|
|
121
|
+
[n.JPEG]: R,
|
|
122
|
+
[n.PNG]: U,
|
|
123
|
+
[n.SVG]: ae,
|
|
124
|
+
[n.BMP]: N
|
|
125
|
+
}), He = () => ({
|
|
126
|
+
[n.PDF]: V,
|
|
127
|
+
[n.DOC]: te,
|
|
128
|
+
[n.DOCX]: I,
|
|
129
|
+
[n.PPT]: ne,
|
|
130
|
+
[n.PPTX]: ne,
|
|
131
|
+
[n.XLS]: le,
|
|
132
|
+
[n.XLSX]: le,
|
|
133
|
+
[n.ZIP]: G,
|
|
134
|
+
[n.RAR]: G,
|
|
135
|
+
[n.SevenZip]: G,
|
|
136
|
+
[n.GZIP]: G,
|
|
137
|
+
[n.TAR]: G,
|
|
138
|
+
[n.CSV]: F,
|
|
139
|
+
[n.Plain]: W,
|
|
140
|
+
[n.HTML]: L,
|
|
141
|
+
[n.XHTML]: L,
|
|
142
|
+
[n.XML]: ue,
|
|
143
|
+
[n.SQL]: ie,
|
|
144
|
+
[n.JavaScript]: z,
|
|
145
|
+
[n.JSX]: B,
|
|
146
|
+
[n.TypeScript]: oe,
|
|
147
|
+
[n.TSX]: se,
|
|
148
|
+
[n.CSS]: P,
|
|
149
|
+
[n.PHP]: H,
|
|
150
|
+
[n.Rust]: re,
|
|
151
|
+
[n.Vue]: ce
|
|
152
|
+
}), Ue, We, Ge = (e) => {
|
|
153
|
+
if (!e) return M;
|
|
154
|
+
let t = d(e);
|
|
155
|
+
return t.startsWith("image/") ? (Ue ??= Ve(), Ue[t] ?? fe) : t.startsWith("video/") ? he : t.startsWith("audio/") ? de : (We ??= He(), We[t] ?? M);
|
|
156
|
+
}, Ke = (e) => {
|
|
163
157
|
let { type: n, contentType: r } = e;
|
|
164
|
-
return n === t.Prompt ?
|
|
165
|
-
},
|
|
166
|
-
let t =
|
|
167
|
-
if (
|
|
158
|
+
return n === t.Prompt ? me : n === t.Pasted ? k : n === t.Image ? fe : Ge(r ?? "");
|
|
159
|
+
}, qe = (e) => {
|
|
160
|
+
let t = d(e), n = r[t];
|
|
161
|
+
if (n) return n;
|
|
168
162
|
let i = t.split("/")[1];
|
|
169
163
|
if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
|
|
170
|
-
},
|
|
164
|
+
}, Je = (e) => {
|
|
171
165
|
let { name: t, contentType: n } = e;
|
|
172
166
|
if (n) {
|
|
173
|
-
let e =
|
|
167
|
+
let e = qe(n);
|
|
174
168
|
if (e) return e;
|
|
175
169
|
}
|
|
176
170
|
if (t == null) return;
|
|
177
171
|
let r = t.lastIndexOf(".");
|
|
178
172
|
if (r > 0 && r < t.length - 1) return t.slice(r + 1).toLowerCase();
|
|
179
|
-
},
|
|
173
|
+
}, Ye = (e) => e.type !== t.Prompt && e.type !== t.Pasted, Xe = (e, n) => {
|
|
180
174
|
let { type: r, name: i } = e;
|
|
181
175
|
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
182
176
|
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
183
177
|
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
184
|
-
let a =
|
|
178
|
+
let a = Je(e);
|
|
185
179
|
return a ? `.${a}` : i ?? "";
|
|
186
|
-
},
|
|
187
|
-
let { type: r, status: i, previewUrl:
|
|
180
|
+
}, Ze = (e, n = {}) => {
|
|
181
|
+
let { type: r, status: i, previewUrl: a, url: s } = e, c = i === o.Loading, l = i === o.Error, u = r === t.Image && !!(a ?? s) && !l, d = r === t.Link && !l;
|
|
188
182
|
return {
|
|
189
183
|
isLoading: c,
|
|
190
184
|
isError: l,
|
|
191
185
|
isImage: u,
|
|
192
186
|
isLink: d,
|
|
193
|
-
BottomIcon: d ? null :
|
|
194
|
-
typeLabel: d ? null :
|
|
187
|
+
BottomIcon: d ? null : Ke(e),
|
|
188
|
+
typeLabel: d ? null : Xe(e, n)
|
|
195
189
|
};
|
|
196
|
-
},
|
|
190
|
+
}, Qe = "flex size-[100px] items-center justify-center rounded-xl border", $e = "outline-offset-1 focus-visible:outline-1", Z = {
|
|
197
191
|
tray: "dial-ai-attachment-tray",
|
|
198
192
|
trayItem: "dial-ai-attachment-tray-item",
|
|
199
193
|
tile: "dial-ai-attachment-tile",
|
|
@@ -202,168 +196,176 @@ var ve = {
|
|
|
202
196
|
tileType: "dial-ai-attachment-tile-type",
|
|
203
197
|
tileAction: "dial-ai-attachment-tile-action"
|
|
204
198
|
}, Q = {
|
|
205
|
-
tile: "
|
|
206
|
-
hovered: "
|
|
207
|
-
selected: "
|
|
208
|
-
tileError: "
|
|
209
|
-
nameText: "
|
|
210
|
-
typeText: "
|
|
211
|
-
placeholderIcon: "
|
|
212
|
-
retryIcon: "
|
|
213
|
-
track: "
|
|
214
|
-
actionButton: "
|
|
215
|
-
loading: "
|
|
216
|
-
imageActionButton: "
|
|
217
|
-
|
|
218
|
-
|
|
199
|
+
tile: "_tile_hb2mo_12",
|
|
200
|
+
hovered: "_hovered_hb2mo_18",
|
|
201
|
+
selected: "_selected_hb2mo_28",
|
|
202
|
+
tileError: "_tileError_hb2mo_33",
|
|
203
|
+
nameText: "_nameText_hb2mo_38",
|
|
204
|
+
typeText: "_typeText_hb2mo_42",
|
|
205
|
+
placeholderIcon: "_placeholderIcon_hb2mo_46",
|
|
206
|
+
retryIcon: "_retryIcon_hb2mo_50",
|
|
207
|
+
track: "_track_hb2mo_54",
|
|
208
|
+
actionButton: "_actionButton_hb2mo_65",
|
|
209
|
+
loading: "_loading_hb2mo_86",
|
|
210
|
+
imageActionButton: "_imageActionButton_hb2mo_87",
|
|
211
|
+
tileAction: "_tileAction_hb2mo_99",
|
|
212
|
+
proxyFocus: "_proxyFocus_hb2mo_108"
|
|
213
|
+
}, et = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o, isAlwaysVisible: s }) => /* @__PURE__ */ J(T, {
|
|
219
214
|
icon: a,
|
|
220
|
-
size:
|
|
221
|
-
className:
|
|
215
|
+
size: _.Small,
|
|
216
|
+
className: l(s ? "opacity-100" : "opacity-0 group-hover/attachment-tile:opacity-100 group-focus-visible/attachment-tile:opacity-100 group-has-focus-visible/attachment-tile:opacity-100", Q.actionButton, o, Z.tileAction),
|
|
222
217
|
"aria-label": e,
|
|
223
218
|
"aria-describedby": t ? n : void 0,
|
|
224
219
|
onClick: (e) => {
|
|
225
220
|
e.stopPropagation(), r(i);
|
|
226
221
|
}
|
|
227
|
-
}),
|
|
228
|
-
icon: /* @__PURE__ */ J(
|
|
229
|
-
size:
|
|
222
|
+
}), tt = ({ ...e }) => /* @__PURE__ */ J(et, {
|
|
223
|
+
icon: /* @__PURE__ */ J(pe, {
|
|
224
|
+
size: m.SM,
|
|
230
225
|
"aria-hidden": !0,
|
|
231
|
-
stroke:
|
|
226
|
+
stroke: h
|
|
232
227
|
}),
|
|
233
228
|
className: Q.retryIcon,
|
|
234
229
|
...e
|
|
235
|
-
}),
|
|
236
|
-
icon: /* @__PURE__ */ J(
|
|
237
|
-
size:
|
|
230
|
+
}), nt = ({ ...e }) => /* @__PURE__ */ J(et, {
|
|
231
|
+
icon: /* @__PURE__ */ J(A, {
|
|
232
|
+
size: m.SM,
|
|
238
233
|
"aria-hidden": !0,
|
|
239
|
-
stroke:
|
|
234
|
+
stroke: h
|
|
240
235
|
}),
|
|
241
236
|
...e
|
|
242
|
-
}),
|
|
243
|
-
icon: /* @__PURE__ */ J(
|
|
244
|
-
size:
|
|
237
|
+
}), rt = ({ ...e }) => /* @__PURE__ */ J(et, {
|
|
238
|
+
icon: /* @__PURE__ */ J(j, {
|
|
239
|
+
size: m.SM,
|
|
245
240
|
"aria-hidden": !0,
|
|
246
|
-
stroke:
|
|
241
|
+
stroke: h
|
|
247
242
|
}),
|
|
248
243
|
...e
|
|
249
|
-
}),
|
|
250
|
-
icon: /* @__PURE__ */ J(
|
|
251
|
-
size:
|
|
244
|
+
}), it = ({ className: e, ...t }) => /* @__PURE__ */ J(et, {
|
|
245
|
+
icon: /* @__PURE__ */ J(ge, {
|
|
246
|
+
size: m.SM,
|
|
252
247
|
"aria-hidden": !0,
|
|
253
|
-
stroke:
|
|
248
|
+
stroke: h
|
|
254
249
|
}),
|
|
255
|
-
className:
|
|
250
|
+
className: l("mobile:opacity-100", e),
|
|
256
251
|
...t
|
|
257
|
-
}),
|
|
252
|
+
}), at = {
|
|
258
253
|
[e.Network]: "Upload failed · network error",
|
|
259
254
|
[e.UnsupportedType]: "Upload failed · unsupported file type",
|
|
260
255
|
[e.FileTooLarge]: "Upload failed · file too large"
|
|
261
|
-
},
|
|
262
|
-
let { clickLabel:
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ce());
|
|
266
|
-
}, U = K(() => Fe(F), [F]), ue = W(() => {
|
|
256
|
+
}, ot = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: a, styles: s, onDownload: c, isLink: u, cssVars: d, onExpand: p, isExpandable: _, onRemove: v, isSelected: C }) => {
|
|
257
|
+
let { clickLabel: ee = "Download attachment", expandLabel: T = "Expand pasted text", downloadLabel: D = "Download attachment", retryLabel: O = "Retry upload", removeLabel: k = "Remove attachment", openInNewTabLabel: A = "Open in new tab", sizeLabel: j, uploadingLabel: M = "Uploading", errorReasonLabels: N, genericErrorLabel: P = "Upload failed" } = a ?? {}, { typography: F, className: te } = s ?? {}, { id: I, name: L, status: R, errorReason: z } = t, B = R === o.Loading, V = R === o.Error, H = ye(), U = V ? z && (N?.[z] ?? at[z]) || P : "", { BottomIcon: ne, typeLabel: re } = Ze(t), ie = Ye(t), ae = !V && !B && c && !u, oe = V && !!i && z !== e.UnsupportedType && z !== e.FileTooLarge, se = !!_ && p !== void 0, W = se || r !== void 0, ce = Number(!!ae) + Number(!!oe) + Number(!!u) + Number(!!v), le = !W && ce === 1, ue = () => {
|
|
258
|
+
se ? p(I) : r?.(I);
|
|
259
|
+
}, G = q(() => Be(L), [L]), { ref: de, isClamped: fe } = f(G), pe = K(() => {
|
|
267
260
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
268
|
-
}, [t]),
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
261
|
+
}, [t]), me = l(Qe, "group/attachment-tile relative flex-col justify-between items-start gap-2 overflow-hidden p-3", Q.tile, W && !V && !B && Q.hovered, B && Q.loading, C && Q.selected, V && Q.tileError, le && Q.proxyFocus, Z.tile, C && Z.tileSelected), he = /* @__PURE__ */ J("div", {
|
|
262
|
+
ref: de,
|
|
263
|
+
title: G,
|
|
264
|
+
className: l(F?.nameClassName ?? "dial-tiny-text", "line-clamp-2 w-full min-w-0 wrap-break-word", Q.nameText, Z.tileName),
|
|
265
|
+
children: n ? /* @__PURE__ */ J(b, {
|
|
266
|
+
text: G,
|
|
273
267
|
query: n,
|
|
274
268
|
maxLines: 2
|
|
275
|
-
}) :
|
|
276
|
-
}),
|
|
277
|
-
className:
|
|
278
|
-
children: [
|
|
279
|
-
type:
|
|
280
|
-
name:
|
|
281
|
-
fileExtension:
|
|
282
|
-
size:
|
|
269
|
+
}) : G
|
|
270
|
+
}), ge = ne && /* @__PURE__ */ Y("div", {
|
|
271
|
+
className: l("flex w-full items-end gap-1", Z.tileType),
|
|
272
|
+
children: [ie ? /* @__PURE__ */ J(y, {
|
|
273
|
+
type: g.File,
|
|
274
|
+
name: L ?? "",
|
|
275
|
+
fileExtension: Je(t),
|
|
276
|
+
size: m.MD,
|
|
283
277
|
decorative: !0
|
|
284
|
-
}) : /* @__PURE__ */ J(
|
|
285
|
-
size:
|
|
278
|
+
}) : /* @__PURE__ */ J(ne, {
|
|
279
|
+
size: m.MD,
|
|
286
280
|
className: Q.typeText,
|
|
287
|
-
stroke:
|
|
281
|
+
stroke: h,
|
|
288
282
|
"aria-hidden": !0
|
|
289
283
|
}), /* @__PURE__ */ J("span", {
|
|
290
|
-
className:
|
|
291
|
-
children:
|
|
284
|
+
className: l(F?.metaClassName ?? "dial-tiny-text", "min-w-0 flex-1 truncate", Q.typeText),
|
|
285
|
+
children: j ? `${re} · ${j}` : re
|
|
292
286
|
})]
|
|
293
|
-
}),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
287
|
+
}), _e = /* @__PURE__ */ Y(Se, { children: [
|
|
288
|
+
he,
|
|
289
|
+
ge,
|
|
290
|
+
W && /* @__PURE__ */ J(E, {
|
|
291
|
+
tooltip: L,
|
|
292
|
+
hideTooltip: !fe,
|
|
293
|
+
triggerClassName: "absolute inset-0",
|
|
294
|
+
children: /* @__PURE__ */ J("button", {
|
|
295
|
+
type: "button",
|
|
296
|
+
"aria-label": se ? T : ee,
|
|
297
|
+
"aria-pressed": !se && r !== void 0 ? C : void 0,
|
|
298
|
+
onClick: ue,
|
|
299
|
+
className: l("absolute inset-0 cursor-pointer rounded-[11px]", Q.tileAction)
|
|
300
|
+
})
|
|
301
|
+
}),
|
|
302
|
+
B && /* @__PURE__ */ J("div", {
|
|
303
303
|
role: "progressbar",
|
|
304
|
-
"aria-label":
|
|
305
|
-
className:
|
|
306
|
-
children: /* @__PURE__ */ J(
|
|
304
|
+
"aria-label": M,
|
|
305
|
+
className: l("absolute inset-0 flex items-center justify-center rounded-[11px]", Q.track),
|
|
306
|
+
children: /* @__PURE__ */ J("span", {
|
|
307
|
+
"aria-hidden": !0,
|
|
308
|
+
className: "flex",
|
|
309
|
+
children: /* @__PURE__ */ J(w, { size: 32 })
|
|
310
|
+
})
|
|
307
311
|
}),
|
|
308
312
|
/* @__PURE__ */ Y("div", {
|
|
309
|
-
className: "absolute
|
|
313
|
+
className: "absolute inset-e-1 top-1 flex",
|
|
310
314
|
children: [
|
|
311
|
-
|
|
312
|
-
ariaLabel:
|
|
313
|
-
errorTitle:
|
|
314
|
-
errorDescId:
|
|
315
|
-
onClick:
|
|
316
|
-
id:
|
|
315
|
+
ae && /* @__PURE__ */ J(nt, {
|
|
316
|
+
ariaLabel: D,
|
|
317
|
+
errorTitle: U,
|
|
318
|
+
errorDescId: H,
|
|
319
|
+
onClick: c,
|
|
320
|
+
id: I
|
|
317
321
|
}),
|
|
318
|
-
|
|
319
|
-
ariaLabel:
|
|
320
|
-
errorTitle:
|
|
321
|
-
errorDescId:
|
|
322
|
+
oe && /* @__PURE__ */ J(tt, {
|
|
323
|
+
ariaLabel: O,
|
|
324
|
+
errorTitle: U,
|
|
325
|
+
errorDescId: H,
|
|
322
326
|
onClick: i,
|
|
323
|
-
id:
|
|
327
|
+
id: I
|
|
324
328
|
}),
|
|
325
|
-
u && /* @__PURE__ */ J(
|
|
326
|
-
ariaLabel:
|
|
327
|
-
errorTitle:
|
|
328
|
-
errorDescId:
|
|
329
|
-
onClick:
|
|
329
|
+
u && /* @__PURE__ */ J(rt, {
|
|
330
|
+
ariaLabel: A,
|
|
331
|
+
errorTitle: U,
|
|
332
|
+
errorDescId: H,
|
|
333
|
+
onClick: pe
|
|
330
334
|
}),
|
|
331
|
-
|
|
332
|
-
ariaLabel:
|
|
333
|
-
errorTitle:
|
|
334
|
-
errorDescId:
|
|
335
|
-
onClick:
|
|
336
|
-
id:
|
|
337
|
-
isAlwaysVisible:
|
|
335
|
+
v && /* @__PURE__ */ J(it, {
|
|
336
|
+
ariaLabel: k,
|
|
337
|
+
errorTitle: U,
|
|
338
|
+
errorDescId: H,
|
|
339
|
+
onClick: v,
|
|
340
|
+
id: I,
|
|
341
|
+
isAlwaysVisible: B
|
|
338
342
|
})
|
|
339
343
|
]
|
|
340
344
|
}),
|
|
341
|
-
|
|
342
|
-
id:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
children: V
|
|
345
|
+
/* @__PURE__ */ J(x, {
|
|
346
|
+
id: H,
|
|
347
|
+
visuallyHidden: !0,
|
|
348
|
+
as: S.Span,
|
|
349
|
+
children: V ? U : ""
|
|
347
350
|
})
|
|
348
351
|
] });
|
|
349
352
|
return /* @__PURE__ */ J("div", {
|
|
350
353
|
style: d,
|
|
351
|
-
className:
|
|
354
|
+
className: l("inline-flex", te),
|
|
352
355
|
children: /* @__PURE__ */ J("div", {
|
|
353
|
-
|
|
354
|
-
"aria-busy": R,
|
|
356
|
+
"aria-busy": B,
|
|
355
357
|
style: d,
|
|
356
|
-
className:
|
|
357
|
-
children:
|
|
358
|
+
className: l(me, W && "cursor-pointer", $e),
|
|
359
|
+
children: _e
|
|
358
360
|
})
|
|
359
361
|
});
|
|
360
|
-
},
|
|
362
|
+
}, st = /* @__PURE__ */ function(e) {
|
|
361
363
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
362
|
-
}({}),
|
|
363
|
-
let n =
|
|
364
|
-
return
|
|
364
|
+
}({}), ct = ({ enabled: e, src: t }) => {
|
|
365
|
+
let n = be(null), [r, i] = xe("idle");
|
|
366
|
+
return ve(() => {
|
|
365
367
|
i(e && t ? "loading" : "idle");
|
|
366
|
-
}, [e, t]),
|
|
368
|
+
}, [e, t]), ve(() => {
|
|
367
369
|
let r = n.current;
|
|
368
370
|
if (!r || !e || !t) return;
|
|
369
371
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -374,76 +376,78 @@ var ve = {
|
|
|
374
376
|
imageRef: n,
|
|
375
377
|
imageLoadStatus: r
|
|
376
378
|
};
|
|
377
|
-
},
|
|
378
|
-
let { clickLabel: d = "Open attachment", expandLabel:
|
|
379
|
-
enabled:
|
|
380
|
-
src:
|
|
381
|
-
}),
|
|
382
|
-
|
|
383
|
-
},
|
|
384
|
-
role: "button",
|
|
385
|
-
tabIndex: 0,
|
|
386
|
-
"aria-label": T ? m : d,
|
|
387
|
-
onClick: F,
|
|
388
|
-
onKeyDown: (e) => {
|
|
389
|
-
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), F());
|
|
390
|
-
}
|
|
391
|
-
} : {};
|
|
379
|
+
}, lt = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: u }) => {
|
|
380
|
+
let { clickLabel: d = "Open attachment", expandLabel: f = "Expand pasted text", removeLabel: p = "Remove attachment", downloadLabel: g = "Download attachment", uploadingLabel: _ = "Uploading" } = i ?? {}, { className: v } = c ?? {}, { id: y, name: b } = e, x = e.previewUrl ?? e.url, S = e.type === t.Pasted && n !== void 0, { isLoading: T, isError: E, isImage: D } = q(() => Ze(e), [e]), O = r !== void 0 && !S && !T && !E, k = S || O, A = !!s && !T, j = !k && Number(!!a) + Number(A) === 1, { imageRef: M, imageLoadStatus: N } = ct({
|
|
381
|
+
enabled: D,
|
|
382
|
+
src: x
|
|
383
|
+
}), P = () => {
|
|
384
|
+
S && n ? n(y) : O && r && r(y);
|
|
385
|
+
}, F = l(Qe, "group/attachment-tile", k && "cursor-pointer", Q.tile, u && Q.selected, T && Q.loading, j && Q.proxyFocus, $e, v, Z.tile, u && Z.tileSelected);
|
|
392
386
|
return /* @__PURE__ */ J("div", {
|
|
393
|
-
className:
|
|
394
|
-
|
|
395
|
-
"aria-busy": E,
|
|
387
|
+
className: F,
|
|
388
|
+
"aria-busy": T,
|
|
396
389
|
style: o,
|
|
397
390
|
children: /* @__PURE__ */ Y("div", {
|
|
398
391
|
className: "relative h-full w-full overflow-hidden",
|
|
399
392
|
children: [
|
|
400
393
|
/* @__PURE__ */ Y("div", {
|
|
401
|
-
className: "absolute
|
|
402
|
-
children: [a && /* @__PURE__ */ J(
|
|
403
|
-
ariaLabel:
|
|
394
|
+
className: "absolute inset-e-1 top-1 z-10 flex",
|
|
395
|
+
children: [a && /* @__PURE__ */ J(it, {
|
|
396
|
+
ariaLabel: p,
|
|
404
397
|
onClick: a,
|
|
405
|
-
id:
|
|
398
|
+
id: y,
|
|
406
399
|
className: Q.imageActionButton,
|
|
407
|
-
isAlwaysVisible:
|
|
408
|
-
}),
|
|
400
|
+
isAlwaysVisible: T
|
|
401
|
+
}), A && /* @__PURE__ */ J(nt, {
|
|
409
402
|
ariaLabel: g,
|
|
410
403
|
onClick: s,
|
|
411
|
-
id:
|
|
404
|
+
id: y,
|
|
412
405
|
className: Q.imageActionButton
|
|
413
406
|
})]
|
|
414
407
|
}),
|
|
415
|
-
|
|
416
|
-
variant:
|
|
408
|
+
N !== st.Loaded && /* @__PURE__ */ J(C, {
|
|
409
|
+
variant: ee.Rectangular,
|
|
417
410
|
width: "100%",
|
|
418
411
|
height: "100%",
|
|
419
|
-
active:
|
|
420
|
-
overlay: /* @__PURE__ */ J(
|
|
421
|
-
size:
|
|
412
|
+
active: N === st.Loading,
|
|
413
|
+
overlay: /* @__PURE__ */ J(fe, {
|
|
414
|
+
size: m.LG,
|
|
422
415
|
className: Q.placeholderIcon,
|
|
423
416
|
"aria-hidden": !0,
|
|
424
|
-
stroke:
|
|
417
|
+
stroke: h
|
|
425
418
|
}),
|
|
426
419
|
className: "absolute inset-0 rounded-xl"
|
|
427
420
|
}),
|
|
428
421
|
/* @__PURE__ */ J("img", {
|
|
429
|
-
ref:
|
|
430
|
-
src:
|
|
431
|
-
alt:
|
|
422
|
+
ref: M,
|
|
423
|
+
src: x,
|
|
424
|
+
alt: b,
|
|
432
425
|
loading: "lazy",
|
|
433
426
|
decoding: "async",
|
|
434
|
-
className:
|
|
427
|
+
className: l("h-full w-full rounded-xl object-cover transition-opacity duration-200", N === st.Loaded ? "opacity-100" : "opacity-0")
|
|
428
|
+
}),
|
|
429
|
+
k && /* @__PURE__ */ J("button", {
|
|
430
|
+
type: "button",
|
|
431
|
+
"aria-label": S ? f : d,
|
|
432
|
+
"aria-pressed": O ? u : void 0,
|
|
433
|
+
onClick: P,
|
|
434
|
+
className: l("absolute inset-0 cursor-pointer rounded-xl", Q.tileAction)
|
|
435
435
|
}),
|
|
436
|
-
|
|
436
|
+
T && /* @__PURE__ */ J("div", {
|
|
437
437
|
role: "progressbar",
|
|
438
438
|
"aria-label": _,
|
|
439
|
-
className:
|
|
440
|
-
children: /* @__PURE__ */ J(
|
|
439
|
+
className: l("absolute inset-0 flex items-center justify-center rounded-xl", Q.track),
|
|
440
|
+
children: /* @__PURE__ */ J("span", {
|
|
441
|
+
"aria-hidden": !0,
|
|
442
|
+
className: "flex",
|
|
443
|
+
children: /* @__PURE__ */ J(w, { size: 32 })
|
|
444
|
+
})
|
|
441
445
|
})
|
|
442
446
|
]
|
|
443
447
|
})
|
|
444
448
|
});
|
|
445
|
-
},
|
|
446
|
-
let { colors: f } = u ?? {}, p = e.type === t.Pasted && a !== void 0, m =
|
|
449
|
+
}, ut = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: l, styles: u, isSelected: d }) => {
|
|
450
|
+
let { colors: f } = u ?? {}, p = e.type === t.Pasted && a !== void 0, m = c({
|
|
447
451
|
"--ai-tile-bg": f?.background,
|
|
448
452
|
"--ai-tile-border": f?.border,
|
|
449
453
|
"--ai-tile-bg-hover": f?.backgroundHover,
|
|
@@ -460,8 +464,8 @@ var ve = {
|
|
|
460
464
|
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
461
465
|
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
462
466
|
"--ai-tile-progress-track": f?.trackBackground
|
|
463
|
-
}), { isImage: h, isLink: g } =
|
|
464
|
-
return h ? /* @__PURE__ */ J(
|
|
467
|
+
}), { isImage: h, isLink: g } = q(() => Ze(e), [e]);
|
|
468
|
+
return h ? /* @__PURE__ */ J(lt, {
|
|
465
469
|
attachment: e,
|
|
466
470
|
labels: l,
|
|
467
471
|
onClick: o,
|
|
@@ -469,15 +473,15 @@ var ve = {
|
|
|
469
473
|
styles: u,
|
|
470
474
|
onRemove: r,
|
|
471
475
|
cssVars: m,
|
|
472
|
-
onDownload:
|
|
476
|
+
onDownload: s,
|
|
473
477
|
isSelected: d
|
|
474
|
-
}) : /* @__PURE__ */ J(
|
|
478
|
+
}) : /* @__PURE__ */ J(ot, {
|
|
475
479
|
attachment: e,
|
|
476
480
|
searchQuery: n,
|
|
477
481
|
onClick: o,
|
|
478
482
|
onRetry: i,
|
|
479
483
|
onRemove: r,
|
|
480
|
-
onDownload:
|
|
484
|
+
onDownload: s,
|
|
481
485
|
isLink: g,
|
|
482
486
|
styles: u,
|
|
483
487
|
labels: l,
|
|
@@ -486,64 +490,76 @@ var ve = {
|
|
|
486
490
|
isExpandable: p,
|
|
487
491
|
isSelected: d
|
|
488
492
|
});
|
|
489
|
-
},
|
|
490
|
-
let
|
|
491
|
-
if (!e?.length) return
|
|
492
|
-
let
|
|
493
|
+
}, dt = (e, t) => {
|
|
494
|
+
let n = u(e, t);
|
|
495
|
+
if (!e?.length) return n;
|
|
496
|
+
let r = /* @__PURE__ */ new Map();
|
|
493
497
|
for (let t of e) {
|
|
494
498
|
let e = t.url ?? t.data ?? t.title;
|
|
495
|
-
|
|
499
|
+
r.has(e) || r.set(e, t.type);
|
|
496
500
|
}
|
|
497
|
-
return
|
|
498
|
-
let t =
|
|
501
|
+
return n.map((e) => {
|
|
502
|
+
let t = r.get(e.id);
|
|
499
503
|
return t ? {
|
|
500
504
|
...e,
|
|
501
505
|
contentType: t
|
|
502
506
|
} : e;
|
|
503
507
|
});
|
|
504
|
-
},
|
|
505
|
-
|
|
506
|
-
value: typeof e == "string" ? e : String(e ?? ""),
|
|
507
|
-
codeClassName: n,
|
|
508
|
-
containerClassName: c(X.codeBlock, n),
|
|
509
|
-
copyLabel: i,
|
|
510
|
-
copiedLabel: a,
|
|
511
|
-
hideDownload: !0
|
|
512
|
-
}), it = me(({ content: e, typography: t, copyAriaLabel: n = "Copy", copiedLabel: r, tableScrollRegionAriaLabel: a, mathScrollRegionAriaLabel: o }) => {
|
|
513
|
-
let s = "mb-1.5 last:mb-0", l = c(t?.headingClassName ?? "dial-small-semi-text", X.stageContent, s);
|
|
508
|
+
}, ft = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: r, copiedLabel: a }) => {
|
|
509
|
+
let o = t?.replace(/^language-/, "") ?? "";
|
|
514
510
|
return /* @__PURE__ */ J(i, {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
ul: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, s),
|
|
527
|
-
ol: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent, s),
|
|
528
|
-
strong: c(t?.strongClassName ?? t?.contentClassName ?? "dial-tiny-text", X.stageContent),
|
|
529
|
-
codeInline: X.codeInline,
|
|
530
|
-
blockquote: c(t?.contentClassName ?? "dial-tiny-text", X.blockquote, s),
|
|
531
|
-
link: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent),
|
|
532
|
-
tableCell: c(t?.contentClassName ?? "dial-tiny-text", X.tableCell)
|
|
533
|
-
},
|
|
534
|
-
components: { code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */ J(rt, {
|
|
511
|
+
language: o,
|
|
512
|
+
value: typeof e == "string" ? e : String(e ?? ""),
|
|
513
|
+
codeClassName: n,
|
|
514
|
+
containerClassName: l(X.codeBlock, n),
|
|
515
|
+
copyLabel: r,
|
|
516
|
+
copiedLabel: a,
|
|
517
|
+
hideDownload: !0
|
|
518
|
+
});
|
|
519
|
+
}, pt = _e(({ content: e, typography: t, copyAriaLabel: n = "Copy", copiedLabel: r, tableScrollRegionAriaLabel: i, mathScrollRegionAriaLabel: o, renderCitation: s }) => {
|
|
520
|
+
let c = "mb-1.5 last:mb-0", u = l(t?.headingClassName ?? "dial-small-semi-text", X.stageContent, c), d = q(() => ({
|
|
521
|
+
code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */ J(ft, {
|
|
535
522
|
codeClassName: i,
|
|
536
523
|
blockClassName: t?.codeBlockClassName,
|
|
537
524
|
copyAriaLabel: n,
|
|
538
525
|
copiedLabel: r,
|
|
539
526
|
children: e
|
|
540
527
|
}) : /* @__PURE__ */ J("code", {
|
|
541
|
-
className:
|
|
528
|
+
className: l("px-1 py-0.5", t?.codeClassName ?? "dial-tiny-code-text rounded-md", X.codeInline),
|
|
542
529
|
children: e
|
|
543
|
-
})
|
|
530
|
+
}),
|
|
531
|
+
...s != null && { cit: (e) => s(e["data-id"], e.children) }
|
|
532
|
+
}), [
|
|
533
|
+
t?.codeClassName,
|
|
534
|
+
t?.codeBlockClassName,
|
|
535
|
+
n,
|
|
536
|
+
r,
|
|
537
|
+
s
|
|
538
|
+
]);
|
|
539
|
+
return /* @__PURE__ */ J(a, {
|
|
540
|
+
content: e,
|
|
541
|
+
tableScrollRegionAriaLabel: i,
|
|
542
|
+
mathScrollRegionAriaLabel: o,
|
|
543
|
+
classNames: {
|
|
544
|
+
h1: u,
|
|
545
|
+
h2: u,
|
|
546
|
+
h3: u,
|
|
547
|
+
h4: u,
|
|
548
|
+
h5: u,
|
|
549
|
+
h6: u,
|
|
550
|
+
p: l(t?.contentClassName ?? "dial-tiny-text", X.stageContent, "mb-1.5"),
|
|
551
|
+
ul: l(t?.contentClassName ?? "dial-tiny-text", X.stageContent, c),
|
|
552
|
+
ol: l(t?.contentClassName ?? "dial-tiny-text", X.stageContent, c),
|
|
553
|
+
strong: l(t?.strongClassName ?? t?.contentClassName ?? "dial-tiny-text", X.stageContent),
|
|
554
|
+
codeInline: X.codeInline,
|
|
555
|
+
blockquote: l(t?.contentClassName ?? "dial-tiny-text", X.blockquote, c),
|
|
556
|
+
link: l(t?.contentClassName ?? "dial-tiny-text", X.stageContent),
|
|
557
|
+
tableCell: l(t?.contentClassName ?? "dial-tiny-text", X.tableCell)
|
|
558
|
+
},
|
|
559
|
+
components: d
|
|
544
560
|
});
|
|
545
|
-
}),
|
|
546
|
-
let r =
|
|
561
|
+
}), mt = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
|
|
562
|
+
let r = K((t) => {
|
|
547
563
|
let r = e.find((e) => e.id === t);
|
|
548
564
|
r && n?.(r);
|
|
549
565
|
}, [e, n]);
|
|
@@ -552,195 +568,204 @@ var ve = {
|
|
|
552
568
|
className: "flex flex-wrap gap-2",
|
|
553
569
|
children: e.map((e) => /* @__PURE__ */ J("div", {
|
|
554
570
|
role: "listitem",
|
|
555
|
-
children: /* @__PURE__ */ J(
|
|
571
|
+
children: /* @__PURE__ */ J(ut, {
|
|
556
572
|
attachment: e,
|
|
557
573
|
onClick: n && r,
|
|
558
574
|
labels: { clickLabel: t }
|
|
559
575
|
})
|
|
560
576
|
}, e.id))
|
|
561
577
|
});
|
|
562
|
-
},
|
|
563
|
-
let [
|
|
564
|
-
|
|
565
|
-
}, [
|
|
578
|
+
}, ht = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a, attachmentDisplayResolvers: o, renderCitation: c, childList: u, isExpanded: d, onToggle: f }) => {
|
|
579
|
+
let [m, h] = xe(!1), g = d ?? m, _ = K((e) => {
|
|
580
|
+
d === void 0 && h(e), f?.(e);
|
|
581
|
+
}, [d, f]), { copyAriaLabel: y = "Copy stage content", codeBlockCopiedLabel: b, tableScrollRegionAriaLabel: x, mathScrollRegionAriaLabel: S, runningAriaLabel: C, failedAriaLabel: ee, attachmentClickLabel: w = "Preview search result" } = r ?? {}, T = q(() => dt(e.attachments, o), [e.attachments, o]), { name: E, durationLabel: D } = ke(e.name), O = i ?? E, k = !i && Ae(E), A = e.status === s.Failed, j = !!e.content || !!e.attachments?.length, M = j || u != null, N = /* @__PURE__ */ Y(Se, { children: [
|
|
566
582
|
/* @__PURE__ */ J("span", {
|
|
567
583
|
className: "flex flex-none items-center",
|
|
568
|
-
children: /* @__PURE__ */ J(
|
|
584
|
+
children: /* @__PURE__ */ J(ze, {
|
|
569
585
|
status: e.status,
|
|
570
586
|
isLive: t,
|
|
571
|
-
runningLabel:
|
|
572
|
-
failedLabel:
|
|
587
|
+
runningLabel: C,
|
|
588
|
+
failedLabel: ee
|
|
573
589
|
})
|
|
574
590
|
}),
|
|
575
591
|
/* @__PURE__ */ J("span", {
|
|
576
|
-
className:
|
|
577
|
-
children: /* @__PURE__ */ J(
|
|
592
|
+
className: l("max-w-88 min-w-0 truncate", k ? n?.monoFontClassName ?? "dial-code-text" : n?.fontClassName ?? "dial-small-text", X.stageName, A && X.stageNameFailed),
|
|
593
|
+
children: /* @__PURE__ */ J(v, { text: O || e.status || "" })
|
|
578
594
|
}),
|
|
579
595
|
e.tag && /* @__PURE__ */ J("span", {
|
|
580
|
-
className:
|
|
596
|
+
className: l("flex-none", n?.tagClassName ?? "dial-tiny-lead-text", X.tag),
|
|
581
597
|
children: e.tag
|
|
582
598
|
}),
|
|
583
|
-
|
|
584
|
-
className:
|
|
585
|
-
children:
|
|
599
|
+
D && /* @__PURE__ */ J("span", {
|
|
600
|
+
className: l("flex-none", n?.countFontClassName ?? "dial-tiny-text", X.duration),
|
|
601
|
+
children: D
|
|
586
602
|
})
|
|
587
603
|
] });
|
|
588
|
-
return
|
|
589
|
-
expanded:
|
|
590
|
-
onToggle:
|
|
604
|
+
return M ? /* @__PURE__ */ Y(p, {
|
|
605
|
+
expanded: g,
|
|
606
|
+
onToggle: _,
|
|
591
607
|
title: /* @__PURE__ */ J("span", {
|
|
592
608
|
className: "flex min-w-0 items-center gap-2",
|
|
593
|
-
children:
|
|
609
|
+
children: N
|
|
594
610
|
}),
|
|
595
|
-
className:
|
|
596
|
-
headerClassName:
|
|
597
|
-
contentClassName:
|
|
598
|
-
children: [
|
|
611
|
+
className: Ie,
|
|
612
|
+
headerClassName: l(Le, X.row, X.stageHeader),
|
|
613
|
+
contentClassName: l("-mt-1 flex min-w-0 flex-col gap-3 px-0 py-1", X.stageRegion),
|
|
614
|
+
children: [g && j && /* @__PURE__ */ Y("div", {
|
|
599
615
|
className: "flex min-w-0 flex-col gap-3 ps-8",
|
|
600
616
|
children: [e.content && /* @__PURE__ */ J("div", {
|
|
601
617
|
className: "max-h-[300px] min-w-0 overflow-y-auto",
|
|
602
|
-
children: /* @__PURE__ */ J(
|
|
618
|
+
children: /* @__PURE__ */ J(pt, {
|
|
603
619
|
content: e.content,
|
|
604
620
|
typography: n,
|
|
605
|
-
copyAriaLabel:
|
|
606
|
-
copiedLabel:
|
|
607
|
-
tableScrollRegionAriaLabel:
|
|
608
|
-
mathScrollRegionAriaLabel:
|
|
621
|
+
copyAriaLabel: y,
|
|
622
|
+
copiedLabel: b,
|
|
623
|
+
tableScrollRegionAriaLabel: x,
|
|
624
|
+
mathScrollRegionAriaLabel: S,
|
|
625
|
+
renderCitation: c
|
|
609
626
|
})
|
|
610
|
-
}),
|
|
611
|
-
attachments:
|
|
612
|
-
clickLabel:
|
|
627
|
+
}), T.length > 0 && /* @__PURE__ */ J(mt, {
|
|
628
|
+
attachments: T,
|
|
629
|
+
clickLabel: w,
|
|
613
630
|
onAttachmentClick: a
|
|
614
631
|
})]
|
|
615
|
-
}),
|
|
632
|
+
}), g && u]
|
|
616
633
|
}) : /* @__PURE__ */ J("div", {
|
|
617
|
-
className:
|
|
618
|
-
children:
|
|
634
|
+
className: l("flex w-full items-center gap-2 px-2 py-1.5", X.row),
|
|
635
|
+
children: N
|
|
619
636
|
});
|
|
620
|
-
},
|
|
621
|
-
let
|
|
622
|
-
return /* @__PURE__ */ J(
|
|
637
|
+
}, gt = (e) => e <= 3 ? "ps-4" : "ps-0", _t = (e) => e <= 3 ? "ps-6" : "ps-0", vt = ({ node: e, depth: t, nameOverride: n, isStreaming: r, expansion: i, typography: a, labels: o, onAttachmentClick: s, attachmentDisplayResolvers: c, renderCitation: l }) => {
|
|
638
|
+
let u = Pe(e.stage.index), d = t + 1;
|
|
639
|
+
return /* @__PURE__ */ J(ht, {
|
|
623
640
|
stage: e.stage,
|
|
624
641
|
nameOverride: n,
|
|
625
642
|
isLive: r && e.stage.status == null,
|
|
626
643
|
typography: a,
|
|
627
644
|
labels: o,
|
|
628
645
|
onAttachmentClick: s,
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
646
|
+
attachmentDisplayResolvers: c,
|
|
647
|
+
renderCitation: l,
|
|
648
|
+
isExpanded: i.isExpanded(u),
|
|
649
|
+
onToggle: (e) => i.onToggle(u, e),
|
|
650
|
+
childList: e.children.length > 0 ? /* @__PURE__ */ J(bt, {
|
|
632
651
|
nodes: e.children,
|
|
633
|
-
depth:
|
|
634
|
-
className:
|
|
652
|
+
depth: d,
|
|
653
|
+
className: gt(d),
|
|
635
654
|
isStreaming: r,
|
|
636
655
|
expansion: i,
|
|
637
656
|
typography: a,
|
|
638
657
|
labels: o,
|
|
639
|
-
onAttachmentClick: s
|
|
658
|
+
onAttachmentClick: s,
|
|
659
|
+
attachmentDisplayResolvers: c,
|
|
660
|
+
renderCitation: l
|
|
640
661
|
}) : void 0
|
|
641
662
|
});
|
|
642
|
-
},
|
|
643
|
-
let { runningAriaLabel:
|
|
644
|
-
|
|
645
|
-
let
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
/* @__PURE__ */ J(
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
runningLabel: l,
|
|
656
|
-
failedLabel: u
|
|
657
|
-
})
|
|
658
|
-
}),
|
|
659
|
-
/* @__PURE__ */ J("span", {
|
|
660
|
-
className: c("max-w-[22rem] min-w-0 truncate", i?.fontClassName ?? "dial-small-text", X.stageName, h && X.stageNameFailed),
|
|
661
|
-
children: /* @__PURE__ */ J(g, { text: e.name })
|
|
662
|
-
}),
|
|
663
|
-
/* @__PURE__ */ Y("span", {
|
|
664
|
-
className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text", X.count),
|
|
665
|
-
children: ["×", p.length]
|
|
663
|
+
}, yt = ({ row: e, depth: t, isStreaming: n, expansion: r, typography: i, labels: a, onAttachmentClick: o, attachmentDisplayResolvers: c, renderCitation: u }) => {
|
|
664
|
+
let { runningAriaLabel: d, failedAriaLabel: f, attemptLabel: m = (e) => `Attempt ${e}` } = a ?? {}, h = e.attempts ?? [], g = h.some((e) => e.stage.status == null), _ = h.some((e) => e.stage.status === s.Failed), y = s.Completed;
|
|
665
|
+
g ? y = null : _ && (y = s.Failed);
|
|
666
|
+
let b = Fe(e.key), x = r.isExpanded(b), S = t + 1, C = /* @__PURE__ */ Y("span", {
|
|
667
|
+
className: "flex min-w-0 items-center gap-2",
|
|
668
|
+
children: [
|
|
669
|
+
/* @__PURE__ */ J("span", {
|
|
670
|
+
className: "flex flex-none items-center",
|
|
671
|
+
children: /* @__PURE__ */ J(ze, {
|
|
672
|
+
status: y,
|
|
673
|
+
isLive: n && g,
|
|
674
|
+
runningLabel: d,
|
|
675
|
+
failedLabel: f
|
|
666
676
|
})
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
677
|
+
}),
|
|
678
|
+
/* @__PURE__ */ J("span", {
|
|
679
|
+
className: l("max-w-88 min-w-0 truncate", i?.fontClassName ?? "dial-small-text", X.stageName, _ && X.stageNameFailed),
|
|
680
|
+
children: /* @__PURE__ */ J(v, { text: e.name })
|
|
681
|
+
}),
|
|
682
|
+
/* @__PURE__ */ Y("span", {
|
|
683
|
+
className: l("flex-none", i?.countFontClassName ?? "dial-tiny-text", X.count),
|
|
684
|
+
children: ["×", h.length]
|
|
685
|
+
})
|
|
686
|
+
]
|
|
687
|
+
});
|
|
688
|
+
return /* @__PURE__ */ J(p, {
|
|
689
|
+
title: C,
|
|
690
|
+
expanded: x,
|
|
691
|
+
onToggle: (e) => r.onToggle(b, e),
|
|
692
|
+
className: Ie,
|
|
693
|
+
headerClassName: l(Le, X.collapseButton, X.row, X.stageHeader),
|
|
694
|
+
contentClassName: l("-mt-2 min-w-0 px-0", _t(S), X.stageRegion),
|
|
674
695
|
children: /* @__PURE__ */ J("ul", {
|
|
675
696
|
role: "list",
|
|
676
697
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
677
|
-
children:
|
|
698
|
+
children: x && h.map((e, t) => /* @__PURE__ */ J("li", {
|
|
678
699
|
role: "listitem",
|
|
679
700
|
className: "min-w-0",
|
|
680
|
-
children: /* @__PURE__ */ J(
|
|
701
|
+
children: /* @__PURE__ */ J(vt, {
|
|
681
702
|
node: e,
|
|
682
|
-
depth:
|
|
683
|
-
nameOverride:
|
|
703
|
+
depth: S,
|
|
704
|
+
nameOverride: m(t + 1),
|
|
684
705
|
isStreaming: n,
|
|
685
706
|
expansion: r,
|
|
686
707
|
typography: i,
|
|
687
708
|
labels: a,
|
|
688
|
-
onAttachmentClick:
|
|
709
|
+
onAttachmentClick: o,
|
|
710
|
+
attachmentDisplayResolvers: c,
|
|
711
|
+
renderCitation: u
|
|
689
712
|
})
|
|
690
713
|
}, e.stage.index))
|
|
691
714
|
})
|
|
692
715
|
});
|
|
693
|
-
},
|
|
716
|
+
}, bt = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */ J("ul", {
|
|
694
717
|
role: "list",
|
|
695
|
-
className:
|
|
696
|
-
children:
|
|
718
|
+
className: l("flex min-w-0 flex-col gap-0.5", n),
|
|
719
|
+
children: Re(e).map((e) => /* @__PURE__ */ J("li", {
|
|
697
720
|
role: "listitem",
|
|
698
721
|
className: "min-w-0",
|
|
699
|
-
children: e.node ? /* @__PURE__ */ J(
|
|
722
|
+
children: e.node ? /* @__PURE__ */ J(vt, {
|
|
700
723
|
node: e.node,
|
|
701
724
|
depth: t,
|
|
702
725
|
...r
|
|
703
|
-
}) : /* @__PURE__ */ J(
|
|
726
|
+
}) : /* @__PURE__ */ J(yt, {
|
|
704
727
|
row: e,
|
|
705
728
|
depth: t,
|
|
706
729
|
...r
|
|
707
730
|
})
|
|
708
731
|
}, e.key))
|
|
709
|
-
}),
|
|
710
|
-
let { colors:
|
|
711
|
-
"--cs-text":
|
|
712
|
-
"--cs-row-hover":
|
|
713
|
-
"--cs-button-bg":
|
|
714
|
-
"--cs-stage-text":
|
|
715
|
-
"--cs-failed-text":
|
|
716
|
-
"--cs-tag-text":
|
|
717
|
-
"--cs-count-text":
|
|
718
|
-
"--cs-duration-text":
|
|
719
|
-
"--cs-icon-secondary":
|
|
720
|
-
"--cs-icon-completed":
|
|
721
|
-
"--cs-icon-error":
|
|
722
|
-
"--cs-code-bg":
|
|
723
|
-
"--cs-code-border":
|
|
724
|
-
"--cs-code-text":
|
|
725
|
-
"--cs-border":
|
|
726
|
-
}),
|
|
732
|
+
}), xt = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a, attachmentDisplayResolvers: o, renderCitation: s, expansion: u }) => {
|
|
733
|
+
let { colors: d, typography: f } = r ?? {}, p = c({
|
|
734
|
+
"--cs-text": d?.text,
|
|
735
|
+
"--cs-row-hover": d?.rowHoverColor,
|
|
736
|
+
"--cs-button-bg": d?.collapsedButtonBg,
|
|
737
|
+
"--cs-stage-text": d?.stageTextColor,
|
|
738
|
+
"--cs-failed-text": d?.failedColor,
|
|
739
|
+
"--cs-tag-text": d?.tagTextColor,
|
|
740
|
+
"--cs-count-text": d?.countTextColor,
|
|
741
|
+
"--cs-duration-text": d?.durationTextColor,
|
|
742
|
+
"--cs-icon-secondary": d?.iconSecondaryColor,
|
|
743
|
+
"--cs-icon-completed": d?.iconCompletedColor,
|
|
744
|
+
"--cs-icon-error": d?.iconErrorColor,
|
|
745
|
+
"--cs-code-bg": d?.codeBg,
|
|
746
|
+
"--cs-code-border": d?.codeBorderColor,
|
|
747
|
+
"--cs-code-text": d?.codeTextColor,
|
|
748
|
+
"--cs-border": d?.borderColor
|
|
749
|
+
}), m = q(() => Ne(e), [e]);
|
|
727
750
|
return /* @__PURE__ */ J("div", {
|
|
728
|
-
style:
|
|
729
|
-
className:
|
|
730
|
-
children: /* @__PURE__ */ J(
|
|
731
|
-
nodes:
|
|
751
|
+
style: p,
|
|
752
|
+
className: l("w-full min-w-0", X.panel, n, Ce.panel),
|
|
753
|
+
children: /* @__PURE__ */ J(bt, {
|
|
754
|
+
nodes: m,
|
|
732
755
|
depth: 0,
|
|
733
756
|
className: "w-full ps-5",
|
|
734
757
|
isStreaming: t,
|
|
735
|
-
expansion:
|
|
736
|
-
typography:
|
|
758
|
+
expansion: u,
|
|
759
|
+
typography: f,
|
|
737
760
|
labels: i,
|
|
738
|
-
onAttachmentClick: a
|
|
761
|
+
onAttachmentClick: a,
|
|
762
|
+
attachmentDisplayResolvers: o,
|
|
763
|
+
renderCitation: s
|
|
739
764
|
})
|
|
740
765
|
});
|
|
741
|
-
},
|
|
742
|
-
let t =
|
|
743
|
-
return /* @__PURE__ */ J(
|
|
766
|
+
}, St = (e) => {
|
|
767
|
+
let t = we();
|
|
768
|
+
return /* @__PURE__ */ J(xt, {
|
|
744
769
|
...e,
|
|
745
770
|
expansion: t
|
|
746
771
|
});
|
|
@@ -751,141 +776,145 @@ var ve = {
|
|
|
751
776
|
doneIcon: "_doneIcon_16fae_36",
|
|
752
777
|
failedText: "_failedText_16fae_40",
|
|
753
778
|
liveName: "_liveName_16fae_44"
|
|
754
|
-
},
|
|
755
|
-
let { executedLabel:
|
|
756
|
-
|
|
757
|
-
|
|
779
|
+
}, Ct = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a, attachmentDisplayResolvers: o, renderCitation: u }) => {
|
|
780
|
+
let { executedLabel: d = "Executed", stepsLabel: f = () => "steps", failedCountLabel: g = (e) => `${e} failed`, runningAriaLabel: _ = "Running", copyAriaLabel: y, codeBlockCopiedLabel: b, tableScrollRegionAriaLabel: x, mathScrollRegionAriaLabel: S, failedAriaLabel: C, attemptLabel: ee, attachmentClickLabel: T } = n ?? {}, [E, D] = xe(t), k = we(), { reset: A } = k, j = e.length > 1;
|
|
781
|
+
ve(() => {
|
|
782
|
+
j && !E && A();
|
|
758
783
|
}, [
|
|
759
|
-
|
|
784
|
+
j,
|
|
760
785
|
E,
|
|
761
|
-
|
|
786
|
+
A
|
|
762
787
|
]);
|
|
763
|
-
let
|
|
764
|
-
|
|
765
|
-
|
|
788
|
+
let M = be(t);
|
|
789
|
+
ve(() => {
|
|
790
|
+
M.current && !t && D(!1), M.current = t;
|
|
766
791
|
}, [t]);
|
|
767
|
-
let { colors:
|
|
768
|
-
"--cs-cg-label":
|
|
769
|
-
"--cs-cg-label-hover":
|
|
770
|
-
"--cs-cg-done":
|
|
771
|
-
"--cs-cg-failed":
|
|
772
|
-
"--cs-text":
|
|
773
|
-
"--cs-row-hover":
|
|
774
|
-
"--cs-button-bg":
|
|
775
|
-
"--cs-stage-text":
|
|
776
|
-
"--cs-failed-text":
|
|
777
|
-
"--cs-tag-text":
|
|
778
|
-
"--cs-count-text":
|
|
779
|
-
"--cs-duration-text":
|
|
780
|
-
"--cs-icon-secondary":
|
|
781
|
-
"--cs-icon-completed":
|
|
782
|
-
"--cs-icon-error":
|
|
783
|
-
"--cs-code-bg":
|
|
784
|
-
"--cs-code-border":
|
|
785
|
-
"--cs-code-text":
|
|
786
|
-
"--cs-border":
|
|
792
|
+
let { colors: N, panel: P } = i ?? {}, F = i?.typography ?? { fontClassName: "dial-small-text" }, te = c({
|
|
793
|
+
"--cs-cg-label": N?.labelColor,
|
|
794
|
+
"--cs-cg-label-hover": N?.labelHoverColor,
|
|
795
|
+
"--cs-cg-done": N?.doneColor,
|
|
796
|
+
"--cs-cg-failed": N?.failedColor,
|
|
797
|
+
"--cs-text": P?.text,
|
|
798
|
+
"--cs-row-hover": P?.rowHoverColor,
|
|
799
|
+
"--cs-button-bg": P?.collapsedButtonBg,
|
|
800
|
+
"--cs-stage-text": P?.stageTextColor,
|
|
801
|
+
"--cs-failed-text": P?.failedColor,
|
|
802
|
+
"--cs-tag-text": P?.tagTextColor,
|
|
803
|
+
"--cs-count-text": P?.countTextColor,
|
|
804
|
+
"--cs-duration-text": P?.durationTextColor,
|
|
805
|
+
"--cs-icon-secondary": P?.iconSecondaryColor,
|
|
806
|
+
"--cs-icon-completed": P?.iconCompletedColor,
|
|
807
|
+
"--cs-icon-error": P?.iconErrorColor,
|
|
808
|
+
"--cs-code-bg": P?.codeBg,
|
|
809
|
+
"--cs-code-border": P?.codeBorderColor,
|
|
810
|
+
"--cs-code-text": P?.codeTextColor,
|
|
811
|
+
"--cs-border": P?.borderColor
|
|
787
812
|
});
|
|
788
813
|
if (e.length === 0) return null;
|
|
789
814
|
let I = {
|
|
790
|
-
copyAriaLabel:
|
|
791
|
-
codeBlockCopiedLabel:
|
|
792
|
-
tableScrollRegionAriaLabel:
|
|
793
|
-
mathScrollRegionAriaLabel:
|
|
794
|
-
runningAriaLabel:
|
|
795
|
-
failedAriaLabel:
|
|
796
|
-
attemptLabel:
|
|
815
|
+
copyAriaLabel: y,
|
|
816
|
+
codeBlockCopiedLabel: b,
|
|
817
|
+
tableScrollRegionAriaLabel: x,
|
|
818
|
+
mathScrollRegionAriaLabel: S,
|
|
819
|
+
runningAriaLabel: _,
|
|
820
|
+
failedAriaLabel: C,
|
|
821
|
+
attemptLabel: ee,
|
|
797
822
|
attachmentClickLabel: T
|
|
798
823
|
};
|
|
799
|
-
if (e.length === 1) return /* @__PURE__ */ J(
|
|
824
|
+
if (e.length === 1) return /* @__PURE__ */ J(xt, {
|
|
800
825
|
stages: e,
|
|
801
826
|
isStreaming: t,
|
|
802
|
-
expansion:
|
|
827
|
+
expansion: k,
|
|
803
828
|
className: r,
|
|
804
829
|
styles: {
|
|
805
|
-
colors:
|
|
830
|
+
colors: P,
|
|
806
831
|
typography: i?.typography
|
|
807
832
|
},
|
|
808
833
|
labels: I,
|
|
809
|
-
onAttachmentClick: a
|
|
834
|
+
onAttachmentClick: a,
|
|
835
|
+
attachmentDisplayResolvers: o,
|
|
836
|
+
renderCitation: u
|
|
810
837
|
});
|
|
811
|
-
let L = e.some((e) => e.status ===
|
|
838
|
+
let L = e.some((e) => e.status === s.Failed), R;
|
|
812
839
|
if (t) {
|
|
813
|
-
let t =
|
|
840
|
+
let t = ke((je(e) ?? e[e.length - 1]).name).name;
|
|
814
841
|
R = /* @__PURE__ */ Y("span", {
|
|
815
842
|
role: "status",
|
|
816
843
|
"aria-live": "polite",
|
|
817
844
|
className: "flex min-w-0 items-center gap-2",
|
|
818
845
|
children: [/* @__PURE__ */ J("span", {
|
|
819
846
|
className: "flex flex-none items-center",
|
|
820
|
-
children: /* @__PURE__ */ J(
|
|
847
|
+
children: /* @__PURE__ */ J(w, {
|
|
821
848
|
size: 14,
|
|
822
|
-
ariaLabel:
|
|
849
|
+
ariaLabel: _
|
|
823
850
|
})
|
|
824
851
|
}), t && /* @__PURE__ */ J("span", {
|
|
825
|
-
className:
|
|
826
|
-
children: /* @__PURE__ */ J(
|
|
852
|
+
className: l("max-w-88 min-w-0 truncate", F.fontClassName, $.liveName),
|
|
853
|
+
children: /* @__PURE__ */ J(v, { text: t })
|
|
827
854
|
})]
|
|
828
855
|
});
|
|
829
856
|
} else if (L) {
|
|
830
|
-
let t = e.filter((e) => e.status ===
|
|
857
|
+
let t = e.filter((e) => e.status === s.Failed).length;
|
|
831
858
|
R = /* @__PURE__ */ Y("span", {
|
|
832
859
|
className: "inline-flex items-center gap-1",
|
|
833
860
|
children: [/* @__PURE__ */ Y("span", {
|
|
834
|
-
className:
|
|
861
|
+
className: l(F.fontClassName, $.executedLabel),
|
|
835
862
|
children: [
|
|
836
|
-
|
|
863
|
+
d,
|
|
837
864
|
" ",
|
|
838
865
|
e.length,
|
|
839
866
|
" ",
|
|
840
|
-
|
|
867
|
+
f(e.length)
|
|
841
868
|
]
|
|
842
869
|
}), /* @__PURE__ */ J("span", {
|
|
843
|
-
className:
|
|
844
|
-
children:
|
|
870
|
+
className: l(F.fontClassName, $.failedText),
|
|
871
|
+
children: g(t)
|
|
845
872
|
})]
|
|
846
873
|
});
|
|
847
874
|
} else R = /* @__PURE__ */ Y("span", {
|
|
848
875
|
className: "inline-flex items-center gap-1",
|
|
849
|
-
children: [/* @__PURE__ */ J(
|
|
850
|
-
size:
|
|
876
|
+
children: [/* @__PURE__ */ J(O, {
|
|
877
|
+
size: m.SM,
|
|
851
878
|
className: $.doneIcon,
|
|
852
879
|
"aria-hidden": !0,
|
|
853
|
-
stroke:
|
|
880
|
+
stroke: h
|
|
854
881
|
}), /* @__PURE__ */ Y("span", {
|
|
855
|
-
className:
|
|
882
|
+
className: l(F.fontClassName, $.executedLabel),
|
|
856
883
|
children: [
|
|
857
|
-
|
|
884
|
+
d,
|
|
858
885
|
" ",
|
|
859
886
|
e.length,
|
|
860
887
|
" ",
|
|
861
|
-
|
|
888
|
+
f(e.length)
|
|
862
889
|
]
|
|
863
890
|
})]
|
|
864
891
|
});
|
|
865
892
|
return /* @__PURE__ */ J("div", {
|
|
866
|
-
style:
|
|
867
|
-
className:
|
|
868
|
-
children: /* @__PURE__ */ J(
|
|
893
|
+
style: te,
|
|
894
|
+
className: l("flex w-full flex-col gap-1", r, Ce.group),
|
|
895
|
+
children: /* @__PURE__ */ J(p, {
|
|
869
896
|
title: R,
|
|
870
897
|
expanded: E,
|
|
871
898
|
onToggle: D,
|
|
872
899
|
className: "overflow-visible py-0",
|
|
873
|
-
headerClassName:
|
|
874
|
-
contentClassName:
|
|
875
|
-
children: E && /* @__PURE__ */ J(
|
|
900
|
+
headerClassName: l("justify-start gap-1 rounded-none px-0", $.toggleButton, Ce.groupToggle),
|
|
901
|
+
contentClassName: l("-mt-2 px-0", $.groupRegion),
|
|
902
|
+
children: E && /* @__PURE__ */ J(xt, {
|
|
876
903
|
stages: e,
|
|
877
904
|
isStreaming: t,
|
|
878
|
-
expansion:
|
|
905
|
+
expansion: k,
|
|
879
906
|
styles: {
|
|
880
|
-
colors:
|
|
907
|
+
colors: P,
|
|
881
908
|
typography: i?.typography
|
|
882
909
|
},
|
|
883
910
|
labels: I,
|
|
884
911
|
className: "pt-1",
|
|
885
|
-
onAttachmentClick: a
|
|
912
|
+
onAttachmentClick: a,
|
|
913
|
+
attachmentDisplayResolvers: o,
|
|
914
|
+
renderCitation: u
|
|
886
915
|
})
|
|
887
916
|
})
|
|
888
917
|
});
|
|
889
918
|
};
|
|
890
919
|
//#endregion
|
|
891
|
-
export {
|
|
920
|
+
export { Ce as CONVERSATION_STAGES_CLASS, Ct as CollapsedGroup, St as StagesPanel };
|