@epam/ai-dial-conversation-stages 1.2.0-dev.321 → 1.2.0-dev.323
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/index.js +190 -191
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, MarkdownCodeBlock as r, MarkdownRenderer as i, RequestStatus as a, StageStatus as o, buildCssVars as s, mergeClasses as c, messageAttachmentsToDisplayAttachments as l, normalizeMimeType as u } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { Accordion as d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, ElementSize as m, EllipsisTooltip as h, Highlight as g, Skeleton as _, SkeletonVariant as v, Spinner as y, StaticIconButton as b } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconAlertCircle as x, IconCheck as S, IconClipboard as C, IconDownload as w, IconExternalLink as T, IconFile as E, IconFileTypeBmp as D, IconFileTypeCss as O, IconFileTypeCsv as k, IconFileTypeDoc as A, IconFileTypeDocx as j, IconFileTypeHtml as M, IconFileTypeJpg as N, IconFileTypeJs as P, IconFileTypeJsx as F, IconFileTypePdf as I, IconFileTypePhp as L, IconFileTypePng as R, IconFileTypePpt as z, IconFileTypeRs as ee, IconFileTypeSql as te, IconFileTypeSvg as ne, IconFileTypeTs as re, IconFileTypeTsx as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { IconAlertCircle as x, IconCheck as S, IconClipboard as C, IconDownload as w, IconExternalLink as T, IconFile as E, IconFileTypeBmp as D, IconFileTypeCss as O, IconFileTypeCsv as k, IconFileTypeDoc as A, IconFileTypeDocx as j, IconFileTypeHtml as M, IconFileTypeJpg as N, IconFileTypeJs as P, IconFileTypeJsx as F, IconFileTypePdf as I, IconFileTypePhp as L, IconFileTypePng as R, IconFileTypePpt as z, IconFileTypeRs as ee, IconFileTypeSql as te, IconFileTypeSvg as ne, IconFileTypeTs as re, IconFileTypeTsx as B, IconFileTypeTxt as ie, IconFileTypeVue as ae, IconFileTypeXls as oe, IconFileTypeXml as se, IconFileTypeZip as ce, IconMusic as le, IconPhoto as V, IconReload as ue, IconTerminal2 as de, IconVideo as fe, IconX as pe } from "@tabler/icons-react";
|
|
4
|
+
import { memo as me, useCallback as H, useEffect as U, useId as he, useMemo as W, useRef as ge, useState as G } from "react";
|
|
5
|
+
import { Fragment as _e, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
6
6
|
//#region src/constants/public-class-names.ts
|
|
7
|
-
var
|
|
7
|
+
var J = {
|
|
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
|
+
}, ve = () => {
|
|
12
|
+
let [e, t] = G(() => /* @__PURE__ */ new Set()), n = H((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 = H(() => {
|
|
19
19
|
t((e) => e.size ? /* @__PURE__ */ new Set() : e);
|
|
20
20
|
}, []);
|
|
21
|
-
return
|
|
21
|
+
return W(() => ({
|
|
22
22
|
isExpanded: (t) => e.has(t),
|
|
23
23
|
onToggle: n,
|
|
24
24
|
reset: r
|
|
@@ -27,24 +27,24 @@ var ge = {
|
|
|
27
27
|
n,
|
|
28
28
|
r
|
|
29
29
|
]);
|
|
30
|
-
},
|
|
30
|
+
}, ye = /[([][^()[\]]*[)\]]/g, be = /(\d+(?:\.\d+)?)\s*s\b/, xe = (e) => {
|
|
31
31
|
let t = e.trimEnd();
|
|
32
32
|
return t.endsWith(":") ? t.slice(0, -1) : t;
|
|
33
|
-
},
|
|
34
|
-
|
|
33
|
+
}, Se = (e) => {
|
|
34
|
+
ye.lastIndex = 0;
|
|
35
35
|
let t;
|
|
36
|
-
for (; t =
|
|
37
|
-
let e = t[0].slice(1, -1), n =
|
|
36
|
+
for (; t = ye.exec(e);) {
|
|
37
|
+
let e = t[0].slice(1, -1), n = be.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
|
+
}, Y = (e) => {
|
|
45
|
+
let t = e ?? "", n = Se(t);
|
|
46
46
|
return {
|
|
47
|
-
name:
|
|
47
|
+
name: xe(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
|
}, Ce = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), we = (e) => [...e].reverse().find((e) => e.status == null), Te = (e, t) => {
|
|
@@ -65,8 +65,8 @@ var ge = {
|
|
|
65
65
|
}, De = (e) => `stage:${e}`, Oe = (e) => `group:${e}`, ke = "min-w-0 overflow-visible py-0", Ae = "min-w-0 justify-start gap-2 rounded-lg px-2 py-1.5 text-start mobile:min-h-11", je = (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 = Y(r.stage.name).name, a = n + 1;
|
|
69
|
+
for (; a < e.length && Y(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,
|
|
@@ -98,20 +98,20 @@ var ge = {
|
|
|
98
98
|
codeInline: "_codeInline_w65is_84",
|
|
99
99
|
blockquote: "_blockquote_w65is_91",
|
|
100
100
|
tableCell: "_tableCell_w65is_96"
|
|
101
|
-
}, Me = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === o.Failed ? /* @__PURE__ */
|
|
101
|
+
}, Me = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === o.Failed ? /* @__PURE__ */ q(_e, { children: [/* @__PURE__ */ K(x, {
|
|
102
102
|
size: f.MD,
|
|
103
103
|
className: X.iconError,
|
|
104
104
|
"aria-hidden": !0,
|
|
105
105
|
stroke: p
|
|
106
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ K("span", {
|
|
107
107
|
className: "sr-only",
|
|
108
108
|
children: r
|
|
109
|
-
})] }) : e === o.Completed ? /* @__PURE__ */
|
|
109
|
+
})] }) : e === o.Completed ? /* @__PURE__ */ K(S, {
|
|
110
110
|
size: f.SM,
|
|
111
111
|
className: X.iconCompleted,
|
|
112
112
|
"aria-hidden": !0,
|
|
113
113
|
stroke: p
|
|
114
|
-
}) : t ? /* @__PURE__ */
|
|
114
|
+
}) : t ? /* @__PURE__ */ K(y, {
|
|
115
115
|
size: 16,
|
|
116
116
|
ariaLabel: n
|
|
117
117
|
}) : null, Ne = (e) => {
|
|
@@ -126,33 +126,33 @@ var ge = {
|
|
|
126
126
|
case "image/png": return R;
|
|
127
127
|
case "image/svg+xml": return ne;
|
|
128
128
|
case "image/bmp": return D;
|
|
129
|
-
default: return
|
|
129
|
+
default: return V;
|
|
130
130
|
}
|
|
131
|
-
if (t.startsWith("video/")) return
|
|
132
|
-
if (t.startsWith("audio/")) return
|
|
131
|
+
if (t.startsWith("video/")) return fe;
|
|
132
|
+
if (t.startsWith("audio/")) return le;
|
|
133
133
|
switch (t) {
|
|
134
134
|
case "application/pdf": return I;
|
|
135
135
|
case "application/msword": return A;
|
|
136
136
|
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return j;
|
|
137
137
|
case "application/vnd.ms-powerpoint": return z;
|
|
138
138
|
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return z;
|
|
139
|
-
case "application/vnd.ms-excel": return
|
|
140
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return
|
|
139
|
+
case "application/vnd.ms-excel": return oe;
|
|
140
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return oe;
|
|
141
141
|
case "application/zip":
|
|
142
142
|
case "application/vnd.rar":
|
|
143
143
|
case "application/x-7z-compressed":
|
|
144
144
|
case "application/gzip":
|
|
145
|
-
case "application/x-tar": return
|
|
145
|
+
case "application/x-tar": return ce;
|
|
146
146
|
case "text/csv": return k;
|
|
147
|
-
case "text/plain": return
|
|
147
|
+
case "text/plain": return ie;
|
|
148
148
|
case "text/html":
|
|
149
149
|
case "application/xhtml+xml": return M;
|
|
150
|
-
case "application/xml": return
|
|
150
|
+
case "application/xml": return se;
|
|
151
151
|
case "application/sql": return te;
|
|
152
152
|
case "text/javascript": return P;
|
|
153
153
|
case "text/jsx": return F;
|
|
154
154
|
case "text/typescript": return re;
|
|
155
|
-
case "text/tsx": return
|
|
155
|
+
case "text/tsx": return B;
|
|
156
156
|
case "text/css": return O;
|
|
157
157
|
case "text/x-php": return L;
|
|
158
158
|
case "text/x-rustsrc": return ee;
|
|
@@ -161,7 +161,7 @@ var ge = {
|
|
|
161
161
|
}
|
|
162
162
|
}, Fe = (e) => {
|
|
163
163
|
let { type: n, contentType: r } = e;
|
|
164
|
-
return n === t.Prompt ?
|
|
164
|
+
return n === t.Prompt ? de : n === t.Pasted ? C : n === t.Image ? V : Pe(r ?? "");
|
|
165
165
|
}, Ie = (e) => {
|
|
166
166
|
let t = u(e), r = n[t];
|
|
167
167
|
if (r) return r;
|
|
@@ -208,7 +208,7 @@ var ge = {
|
|
|
208
208
|
track: "_track_1tdbq_50",
|
|
209
209
|
actionButton: "_actionButton_1tdbq_56",
|
|
210
210
|
imageActionButton: "_imageActionButton_1tdbq_60"
|
|
211
|
-
}, Be = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */
|
|
211
|
+
}, Be = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ K(b, {
|
|
212
212
|
icon: a,
|
|
213
213
|
size: m.Small,
|
|
214
214
|
className: c("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Q.actionButton, o, Z.tileAction),
|
|
@@ -217,30 +217,30 @@ var ge = {
|
|
|
217
217
|
onClick: (e) => {
|
|
218
218
|
e.stopPropagation(), r(i);
|
|
219
219
|
}
|
|
220
|
-
}), Ve = ({ ...e }) => /* @__PURE__ */
|
|
221
|
-
icon: /* @__PURE__ */
|
|
220
|
+
}), Ve = ({ ...e }) => /* @__PURE__ */ K(Be, {
|
|
221
|
+
icon: /* @__PURE__ */ K(ue, {
|
|
222
222
|
size: f.SM,
|
|
223
223
|
"aria-hidden": !0,
|
|
224
224
|
stroke: p
|
|
225
225
|
}),
|
|
226
226
|
className: Q.retryIcon,
|
|
227
227
|
...e
|
|
228
|
-
}), He = ({ ...e }) => /* @__PURE__ */
|
|
229
|
-
icon: /* @__PURE__ */
|
|
228
|
+
}), He = ({ ...e }) => /* @__PURE__ */ K(Be, {
|
|
229
|
+
icon: /* @__PURE__ */ K(w, {
|
|
230
230
|
size: f.SM,
|
|
231
231
|
"aria-hidden": !0,
|
|
232
232
|
stroke: p
|
|
233
233
|
}),
|
|
234
234
|
...e
|
|
235
|
-
}), Ue = ({ ...e }) => /* @__PURE__ */
|
|
236
|
-
icon: /* @__PURE__ */
|
|
235
|
+
}), Ue = ({ ...e }) => /* @__PURE__ */ K(Be, {
|
|
236
|
+
icon: /* @__PURE__ */ K(T, {
|
|
237
237
|
size: f.SM,
|
|
238
238
|
"aria-hidden": !0,
|
|
239
239
|
stroke: p
|
|
240
240
|
}),
|
|
241
241
|
...e
|
|
242
|
-
}), We = ({ ...e }) => /* @__PURE__ */
|
|
243
|
-
icon: /* @__PURE__ */
|
|
242
|
+
}), We = ({ ...e }) => /* @__PURE__ */ K(Be, {
|
|
243
|
+
icon: /* @__PURE__ */ K(pe, {
|
|
244
244
|
size: f.SM,
|
|
245
245
|
"aria-hidden": !0,
|
|
246
246
|
stroke: p
|
|
@@ -250,104 +250,104 @@ var ge = {
|
|
|
250
250
|
[e.Network]: "Upload failed · network error",
|
|
251
251
|
[e.UnsupportedType]: "Upload failed · unsupported file type",
|
|
252
252
|
[e.FileTooLarge]: "Upload failed · file too large"
|
|
253
|
-
}, Ke = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: o, styles: s, onDownload: l,
|
|
254
|
-
let { clickLabel:
|
|
255
|
-
B ?
|
|
253
|
+
}, Ke = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: o, styles: s, onDownload: l, isLink: u, cssVars: d, onExpand: f, isExpandable: p, onRemove: m, isSelected: h }) => {
|
|
254
|
+
let { clickLabel: _ = "Download attachment", expandLabel: v = "Expand pasted text", downloadLabel: b = "Download attachment", retryLabel: x = "Retry upload", removeLabel: S = "Remove attachment", openInNewTabLabel: C = "Open in new tab", sizeLabel: w, uploadingLabel: T = "Uploading", errorReasonLabels: E, genericErrorLabel: D = "Upload failed" } = o ?? {}, { typography: O, className: k } = s ?? {}, { id: A, name: j, status: M, errorReason: N } = t, P = M === a.Loading, F = M === a.Error, I = he(), L = F ? N && (E?.[N] ?? Ge[N]) || D : "", { BottomIcon: R, typeLabel: z } = Re(t), ee = !F && !P && l && !u, te = F && !!i && N !== e.UnsupportedType && N !== e.FileTooLarge, ne = Number(!!ee) + Number(!!te) + Number(!!u) + Number(!!m), re = ne > 1 ? "pe-11" : ne === 1 ? "pe-5" : void 0, B = !!p && f !== void 0, ie = B || r !== void 0, ae = () => {
|
|
255
|
+
B ? f(A) : r?.(A);
|
|
256
256
|
}, oe = (e) => {
|
|
257
|
-
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
258
|
-
},
|
|
257
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ae());
|
|
258
|
+
}, se = W(() => Ne(j), [j]), ce = H(() => {
|
|
259
259
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
260
|
-
}, [t]),
|
|
261
|
-
title:
|
|
262
|
-
className: c(
|
|
263
|
-
children: n ? /* @__PURE__ */
|
|
264
|
-
text:
|
|
260
|
+
}, [t]), le = c(ze, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Q.tile, !F && Q.hovered, h && Q.selected, F && Q.tileError, Z.tile, h && Z.tileSelected), V = /* @__PURE__ */ K("div", {
|
|
261
|
+
title: se,
|
|
262
|
+
className: c(O?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words", Q.nameText, !F && re, Z.tileName),
|
|
263
|
+
children: n ? /* @__PURE__ */ K(g, {
|
|
264
|
+
text: se,
|
|
265
265
|
query: n,
|
|
266
266
|
maxLines: 2
|
|
267
|
-
}) :
|
|
268
|
-
}),
|
|
269
|
-
className: c("flex w-full items-center gap-1",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
267
|
+
}) : se
|
|
268
|
+
}), ue = R && /* @__PURE__ */ q("div", {
|
|
269
|
+
className: c("flex w-full items-center gap-1", F && re, Z.tileType),
|
|
270
|
+
children: [/* @__PURE__ */ K(R, {
|
|
271
271
|
size: 16,
|
|
272
272
|
className: Q.typeText,
|
|
273
273
|
"aria-hidden": !0
|
|
274
|
-
}), /* @__PURE__ */
|
|
275
|
-
className: c(
|
|
276
|
-
children:
|
|
274
|
+
}), /* @__PURE__ */ K("span", {
|
|
275
|
+
className: c(O?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Q.typeText),
|
|
276
|
+
children: w ? `${z} · ${w}` : z
|
|
277
277
|
})]
|
|
278
|
-
}),
|
|
278
|
+
}), de = ie ? {
|
|
279
279
|
role: "button",
|
|
280
280
|
tabIndex: 0,
|
|
281
|
-
"aria-label": B ?
|
|
282
|
-
onClick:
|
|
281
|
+
"aria-label": B ? v : _,
|
|
282
|
+
onClick: ae,
|
|
283
283
|
onKeyDown: oe
|
|
284
|
-
} : {},
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
} : {}, fe = /* @__PURE__ */ q(_e, { children: [
|
|
285
|
+
V,
|
|
286
|
+
ue,
|
|
287
|
+
P && /* @__PURE__ */ K("div", {
|
|
288
288
|
role: "progressbar",
|
|
289
|
-
"aria-label":
|
|
289
|
+
"aria-label": T,
|
|
290
290
|
className: c("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Q.track),
|
|
291
|
-
children: /* @__PURE__ */
|
|
291
|
+
children: /* @__PURE__ */ K(y, { size: 32 })
|
|
292
292
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ q("div", {
|
|
294
294
|
className: "absolute end-1 top-1 flex gap-1",
|
|
295
295
|
children: [
|
|
296
|
-
|
|
297
|
-
ariaLabel:
|
|
298
|
-
errorTitle:
|
|
299
|
-
errorDescId:
|
|
296
|
+
ee && /* @__PURE__ */ K(He, {
|
|
297
|
+
ariaLabel: b,
|
|
298
|
+
errorTitle: L,
|
|
299
|
+
errorDescId: I,
|
|
300
300
|
onClick: l,
|
|
301
|
-
id:
|
|
301
|
+
id: A
|
|
302
302
|
}),
|
|
303
|
-
|
|
304
|
-
ariaLabel:
|
|
305
|
-
errorTitle:
|
|
306
|
-
errorDescId:
|
|
303
|
+
te && /* @__PURE__ */ K(Ve, {
|
|
304
|
+
ariaLabel: x,
|
|
305
|
+
errorTitle: L,
|
|
306
|
+
errorDescId: I,
|
|
307
307
|
onClick: i,
|
|
308
|
-
id:
|
|
308
|
+
id: A
|
|
309
309
|
}),
|
|
310
|
-
|
|
311
|
-
ariaLabel: w,
|
|
312
|
-
errorTitle: R,
|
|
313
|
-
errorDescId: L,
|
|
314
|
-
onClick: se
|
|
315
|
-
}),
|
|
316
|
-
h && /* @__PURE__ */ J(We, {
|
|
310
|
+
u && /* @__PURE__ */ K(Ue, {
|
|
317
311
|
ariaLabel: C,
|
|
318
|
-
errorTitle:
|
|
319
|
-
errorDescId:
|
|
320
|
-
onClick:
|
|
321
|
-
|
|
312
|
+
errorTitle: L,
|
|
313
|
+
errorDescId: I,
|
|
314
|
+
onClick: ce
|
|
315
|
+
}),
|
|
316
|
+
m && /* @__PURE__ */ K(We, {
|
|
317
|
+
ariaLabel: S,
|
|
318
|
+
errorTitle: L,
|
|
319
|
+
errorDescId: I,
|
|
320
|
+
onClick: m,
|
|
321
|
+
id: A
|
|
322
322
|
})
|
|
323
323
|
]
|
|
324
324
|
}),
|
|
325
|
-
|
|
326
|
-
id:
|
|
325
|
+
F && /* @__PURE__ */ K("span", {
|
|
326
|
+
id: I,
|
|
327
327
|
role: "status",
|
|
328
328
|
"aria-live": "polite",
|
|
329
329
|
className: "sr-only",
|
|
330
|
-
children:
|
|
330
|
+
children: L
|
|
331
331
|
})
|
|
332
332
|
] });
|
|
333
|
-
return /* @__PURE__ */
|
|
334
|
-
style:
|
|
335
|
-
className: c("inline-flex",
|
|
336
|
-
children: /* @__PURE__ */
|
|
337
|
-
...
|
|
338
|
-
"aria-busy":
|
|
339
|
-
style:
|
|
340
|
-
className: c(
|
|
341
|
-
children:
|
|
333
|
+
return /* @__PURE__ */ K("div", {
|
|
334
|
+
style: d,
|
|
335
|
+
className: c("inline-flex", k),
|
|
336
|
+
children: /* @__PURE__ */ K("div", {
|
|
337
|
+
...de,
|
|
338
|
+
"aria-busy": P,
|
|
339
|
+
style: d,
|
|
340
|
+
className: c(le, ie && "cursor-pointer", "focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
341
|
+
children: fe
|
|
342
342
|
})
|
|
343
343
|
});
|
|
344
344
|
}, qe = /* @__PURE__ */ function(e) {
|
|
345
345
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
346
346
|
}({}), Je = ({ enabled: e, src: t }) => {
|
|
347
|
-
let n =
|
|
348
|
-
return
|
|
347
|
+
let n = ge(null), [r, i] = G("idle");
|
|
348
|
+
return U(() => {
|
|
349
349
|
i(e && t ? "loading" : "idle");
|
|
350
|
-
}, [e, t]),
|
|
350
|
+
}, [e, t]), U(() => {
|
|
351
351
|
let r = n.current;
|
|
352
352
|
if (!r || !e || !t) return;
|
|
353
353
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -359,7 +359,7 @@ var ge = {
|
|
|
359
359
|
imageLoadStatus: r
|
|
360
360
|
};
|
|
361
361
|
}, Ye = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: l, isSelected: u }) => {
|
|
362
|
-
let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment" } = i ?? {}, { className: y } = l ?? {}, { id: b, name: x } = e, S = e.previewUrl ?? e.url, C = e.type === t.Pasted && n !== void 0, { isLoading: w, isError: T, isImage: E } =
|
|
362
|
+
let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment" } = i ?? {}, { className: y } = l ?? {}, { id: b, name: x } = e, S = e.previewUrl ?? e.url, C = e.type === t.Pasted && n !== void 0, { isLoading: w, isError: T, isImage: E } = W(() => Re(e), [e]), D = r !== void 0 && !C && !w && !T, O = C || D, { imageRef: k, imageLoadStatus: A } = Je({
|
|
363
363
|
enabled: E,
|
|
364
364
|
src: S
|
|
365
365
|
}), j = () => {
|
|
@@ -373,33 +373,33 @@ var ge = {
|
|
|
373
373
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), j());
|
|
374
374
|
}
|
|
375
375
|
} : {};
|
|
376
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ K("div", {
|
|
377
377
|
className: c(ze, "group/attachment-tile", O && "cursor-pointer", Q.tile, u && Q.selected, y, Z.tile, u && Z.tileSelected),
|
|
378
378
|
...M,
|
|
379
379
|
style: o,
|
|
380
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ q("div", {
|
|
381
381
|
className: "relative h-full w-full overflow-hidden",
|
|
382
382
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ q("div", {
|
|
384
384
|
className: "absolute end-1 top-1 z-10 flex gap-1",
|
|
385
|
-
children: [a && /* @__PURE__ */
|
|
385
|
+
children: [a && /* @__PURE__ */ K(We, {
|
|
386
386
|
ariaLabel: h,
|
|
387
387
|
onClick: a,
|
|
388
388
|
id: b,
|
|
389
389
|
className: Q.imageActionButton
|
|
390
|
-
}), s && /* @__PURE__ */
|
|
390
|
+
}), s && /* @__PURE__ */ K(He, {
|
|
391
391
|
ariaLabel: g,
|
|
392
392
|
onClick: s,
|
|
393
393
|
id: b,
|
|
394
394
|
className: Q.imageActionButton
|
|
395
395
|
})]
|
|
396
396
|
}),
|
|
397
|
-
A !== qe.Loaded && /* @__PURE__ */
|
|
397
|
+
A !== qe.Loaded && /* @__PURE__ */ K(_, {
|
|
398
398
|
variant: v.Rectangular,
|
|
399
399
|
width: "100%",
|
|
400
400
|
height: "100%",
|
|
401
401
|
active: A === qe.Loading,
|
|
402
|
-
overlay: /* @__PURE__ */
|
|
402
|
+
overlay: /* @__PURE__ */ K(V, {
|
|
403
403
|
size: f.LG,
|
|
404
404
|
className: Q.typeText,
|
|
405
405
|
"aria-hidden": !0,
|
|
@@ -407,7 +407,7 @@ var ge = {
|
|
|
407
407
|
}),
|
|
408
408
|
className: "absolute inset-0 rounded-xl"
|
|
409
409
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ K("img", {
|
|
411
411
|
ref: k,
|
|
412
412
|
src: S,
|
|
413
413
|
alt: x,
|
|
@@ -419,7 +419,7 @@ var ge = {
|
|
|
419
419
|
})
|
|
420
420
|
});
|
|
421
421
|
}, Xe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: c, labels: l, styles: u, isSelected: d }) => {
|
|
422
|
-
let { colors: f } = u ?? {}, p = e.type === t.Pasted
|
|
422
|
+
let { colors: f } = u ?? {}, p = e.type === t.Pasted && a !== void 0, m = s({
|
|
423
423
|
"--ai-tile-bg": f?.background,
|
|
424
424
|
"--ai-tile-border": f?.border,
|
|
425
425
|
"--ai-tile-bg-hover": f?.backgroundHover,
|
|
@@ -435,31 +435,30 @@ var ge = {
|
|
|
435
435
|
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
436
436
|
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
437
437
|
"--ai-tile-progress-track": f?.trackBackground
|
|
438
|
-
}), { isImage:
|
|
439
|
-
return
|
|
438
|
+
}), { isImage: h, isLink: g } = W(() => Re(e), [e]);
|
|
439
|
+
return h ? /* @__PURE__ */ K(Ye, {
|
|
440
440
|
attachment: e,
|
|
441
441
|
labels: l,
|
|
442
442
|
onClick: o,
|
|
443
443
|
onExpand: a,
|
|
444
444
|
styles: u,
|
|
445
445
|
onRemove: r,
|
|
446
|
-
cssVars:
|
|
446
|
+
cssVars: m,
|
|
447
447
|
onDownload: c,
|
|
448
448
|
isSelected: d
|
|
449
|
-
}) : /* @__PURE__ */
|
|
449
|
+
}) : /* @__PURE__ */ K(Ke, {
|
|
450
450
|
attachment: e,
|
|
451
451
|
searchQuery: n,
|
|
452
452
|
onClick: o,
|
|
453
453
|
onRetry: i,
|
|
454
454
|
onRemove: r,
|
|
455
455
|
onDownload: c,
|
|
456
|
-
isLink:
|
|
457
|
-
isPasted: p,
|
|
456
|
+
isLink: g,
|
|
458
457
|
styles: u,
|
|
459
458
|
labels: l,
|
|
460
459
|
onExpand: a,
|
|
461
|
-
cssVars:
|
|
462
|
-
isExpandable:
|
|
460
|
+
cssVars: m,
|
|
461
|
+
isExpandable: p,
|
|
463
462
|
isSelected: d
|
|
464
463
|
});
|
|
465
464
|
}, Ze = (e) => {
|
|
@@ -477,7 +476,7 @@ var ge = {
|
|
|
477
476
|
contentType: t
|
|
478
477
|
} : e;
|
|
479
478
|
});
|
|
480
|
-
}, Qe = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i, copiedLabel: a }) => /* @__PURE__ */
|
|
479
|
+
}, Qe = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i, copiedLabel: a }) => /* @__PURE__ */ K(r, {
|
|
481
480
|
language: t?.replace(/^language-/, "") ?? "",
|
|
482
481
|
value: typeof e == "string" ? e : String(e ?? ""),
|
|
483
482
|
codeClassName: n,
|
|
@@ -485,9 +484,9 @@ var ge = {
|
|
|
485
484
|
copyLabel: i,
|
|
486
485
|
copiedLabel: a,
|
|
487
486
|
hideDownload: !0
|
|
488
|
-
}), $e =
|
|
487
|
+
}), $e = me(({ content: e, typography: t, copyAriaLabel: n = "Copy", copiedLabel: r, tableScrollRegionAriaLabel: a, mathScrollRegionAriaLabel: o }) => {
|
|
489
488
|
let s = "mb-1.5 last:mb-0", l = c(t?.headingClassName ?? "dial-small-semi-text", X.stageContent, s);
|
|
490
|
-
return /* @__PURE__ */
|
|
489
|
+
return /* @__PURE__ */ K(i, {
|
|
491
490
|
content: e,
|
|
492
491
|
tableScrollRegionAriaLabel: a,
|
|
493
492
|
mathScrollRegionAriaLabel: o,
|
|
@@ -507,28 +506,28 @@ var ge = {
|
|
|
507
506
|
link: c(t?.contentClassName ?? "dial-tiny-text", X.stageContent),
|
|
508
507
|
tableCell: c(t?.contentClassName ?? "dial-tiny-text", X.tableCell)
|
|
509
508
|
},
|
|
510
|
-
components: { code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */
|
|
509
|
+
components: { code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */ K(Qe, {
|
|
511
510
|
codeClassName: i,
|
|
512
511
|
blockClassName: t?.codeBlockClassName,
|
|
513
512
|
copyAriaLabel: n,
|
|
514
513
|
copiedLabel: r,
|
|
515
514
|
children: e
|
|
516
|
-
}) : /* @__PURE__ */
|
|
515
|
+
}) : /* @__PURE__ */ K("code", {
|
|
517
516
|
className: c("px-1 py-0.5", t?.codeClassName ?? "dial-tiny-text rounded-md", X.codeInline),
|
|
518
517
|
children: e
|
|
519
518
|
}) }
|
|
520
519
|
});
|
|
521
520
|
}), et = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
|
|
522
|
-
let r =
|
|
521
|
+
let r = H((t) => {
|
|
523
522
|
let r = e.find((e) => e.id === t);
|
|
524
523
|
r && n?.(r);
|
|
525
524
|
}, [e, n]);
|
|
526
|
-
return /* @__PURE__ */
|
|
525
|
+
return /* @__PURE__ */ K("div", {
|
|
527
526
|
role: "list",
|
|
528
527
|
className: "flex flex-wrap gap-3",
|
|
529
|
-
children: e.map((e) => /* @__PURE__ */
|
|
528
|
+
children: e.map((e) => /* @__PURE__ */ K("div", {
|
|
530
529
|
role: "listitem",
|
|
531
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ K(Xe, {
|
|
532
531
|
attachment: e,
|
|
533
532
|
onClick: n && r,
|
|
534
533
|
labels: { clickLabel: t }
|
|
@@ -536,46 +535,46 @@ var ge = {
|
|
|
536
535
|
}, e.id))
|
|
537
536
|
});
|
|
538
537
|
}, tt = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a, childList: s, isExpanded: l, onToggle: u }) => {
|
|
539
|
-
let [f, p] =
|
|
538
|
+
let [f, p] = G(!1), m = l ?? f, g = H((e) => {
|
|
540
539
|
l === void 0 && p(e), u?.(e);
|
|
541
|
-
}, [l, u]), { copyAriaLabel: _ = "Copy stage content", codeBlockCopiedLabel: v, tableScrollRegionAriaLabel: y, mathScrollRegionAriaLabel: b, runningAriaLabel: x, failedAriaLabel: S, attachmentClickLabel: C = "Preview search result" } = r ?? {}, w =
|
|
542
|
-
/* @__PURE__ */
|
|
540
|
+
}, [l, u]), { copyAriaLabel: _ = "Copy stage content", codeBlockCopiedLabel: v, tableScrollRegionAriaLabel: y, mathScrollRegionAriaLabel: b, runningAriaLabel: x, failedAriaLabel: S, attachmentClickLabel: C = "Preview search result" } = r ?? {}, w = W(() => Ze(e.attachments), [e.attachments]), { name: T, durationLabel: E } = Y(e.name), D = i ?? T, O = !i && Ce(T), k = e.status === o.Failed, A = !!e.content || !!e.attachments?.length, j = A || s != null, M = /* @__PURE__ */ q(_e, { children: [
|
|
541
|
+
/* @__PURE__ */ K("span", {
|
|
543
542
|
className: "flex flex-none items-center",
|
|
544
|
-
children: /* @__PURE__ */
|
|
543
|
+
children: /* @__PURE__ */ K(Me, {
|
|
545
544
|
status: e.status,
|
|
546
545
|
isLive: t,
|
|
547
546
|
runningLabel: x,
|
|
548
547
|
failedLabel: S
|
|
549
548
|
})
|
|
550
549
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ K("span", {
|
|
552
551
|
className: c("min-w-0 max-w-[22rem] truncate", n?.fontClassName ?? "dial-small-text", X.stageName, k && X.stageNameFailed, O && X.monoName),
|
|
553
|
-
children: /* @__PURE__ */
|
|
552
|
+
children: /* @__PURE__ */ K(h, { text: D || e.status || "" })
|
|
554
553
|
}),
|
|
555
|
-
e.tag && /* @__PURE__ */
|
|
554
|
+
e.tag && /* @__PURE__ */ K("span", {
|
|
556
555
|
className: c("flex-none", n?.tagClassName ?? "dial-tiny-lead-text", X.tag),
|
|
557
556
|
children: e.tag
|
|
558
557
|
}),
|
|
559
|
-
E && /* @__PURE__ */
|
|
558
|
+
E && /* @__PURE__ */ K("span", {
|
|
560
559
|
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", X.duration),
|
|
561
560
|
children: E
|
|
562
561
|
})
|
|
563
562
|
] });
|
|
564
|
-
return j ? /* @__PURE__ */
|
|
563
|
+
return j ? /* @__PURE__ */ q(d, {
|
|
565
564
|
expanded: m,
|
|
566
565
|
onToggle: g,
|
|
567
|
-
title: /* @__PURE__ */
|
|
566
|
+
title: /* @__PURE__ */ K("span", {
|
|
568
567
|
className: "flex min-w-0 items-center gap-2",
|
|
569
568
|
children: M
|
|
570
569
|
}),
|
|
571
570
|
className: ke,
|
|
572
571
|
headerClassName: c(Ae, X.row, X.stageHeader),
|
|
573
572
|
contentClassName: c("-mt-1 flex min-w-0 flex-col gap-3 px-0 py-1", X.stageRegion),
|
|
574
|
-
children: [m && A && /* @__PURE__ */
|
|
573
|
+
children: [m && A && /* @__PURE__ */ q("div", {
|
|
575
574
|
className: "flex min-w-0 flex-col gap-3 ps-8",
|
|
576
|
-
children: [e.content && /* @__PURE__ */
|
|
575
|
+
children: [e.content && /* @__PURE__ */ K("div", {
|
|
577
576
|
className: "max-h-[300px] min-w-0 overflow-y-auto",
|
|
578
|
-
children: /* @__PURE__ */
|
|
577
|
+
children: /* @__PURE__ */ K($e, {
|
|
579
578
|
content: e.content,
|
|
580
579
|
typography: n,
|
|
581
580
|
copyAriaLabel: _,
|
|
@@ -583,19 +582,19 @@ var ge = {
|
|
|
583
582
|
tableScrollRegionAriaLabel: y,
|
|
584
583
|
mathScrollRegionAriaLabel: b
|
|
585
584
|
})
|
|
586
|
-
}), w.length > 0 && /* @__PURE__ */
|
|
585
|
+
}), w.length > 0 && /* @__PURE__ */ K(et, {
|
|
587
586
|
attachments: w,
|
|
588
587
|
clickLabel: C,
|
|
589
588
|
onAttachmentClick: a
|
|
590
589
|
})]
|
|
591
590
|
}), m && s]
|
|
592
|
-
}) : /* @__PURE__ */
|
|
591
|
+
}) : /* @__PURE__ */ K("div", {
|
|
593
592
|
className: c("flex w-full items-center gap-2 px-2 py-1.5", X.row),
|
|
594
593
|
children: M
|
|
595
594
|
});
|
|
596
595
|
}, nt = (e) => e <= 3 ? "ps-4" : "ps-0", rt = (e) => e <= 3 ? "ps-6" : "ps-0", it = ({ node: e, depth: t, nameOverride: n, isStreaming: r, expansion: i, typography: a, labels: o, onAttachmentClick: s }) => {
|
|
597
596
|
let c = De(e.stage.index), l = t + 1;
|
|
598
|
-
return /* @__PURE__ */
|
|
597
|
+
return /* @__PURE__ */ K(tt, {
|
|
599
598
|
stage: e.stage,
|
|
600
599
|
nameOverride: n,
|
|
601
600
|
isLive: r && e.stage.status == null,
|
|
@@ -604,7 +603,7 @@ var ge = {
|
|
|
604
603
|
onAttachmentClick: s,
|
|
605
604
|
isExpanded: i.isExpanded(c),
|
|
606
605
|
onToggle: (e) => i.onToggle(c, e),
|
|
607
|
-
childList: e.children.length > 0 ? /* @__PURE__ */
|
|
606
|
+
childList: e.children.length > 0 ? /* @__PURE__ */ K(ot, {
|
|
608
607
|
nodes: e.children,
|
|
609
608
|
depth: l,
|
|
610
609
|
className: nt(l),
|
|
@@ -619,24 +618,24 @@ var ge = {
|
|
|
619
618
|
let { runningAriaLabel: l, failedAriaLabel: u, attemptLabel: f = (e) => `Attempt ${e}` } = a ?? {}, p = e.attempts ?? [], m = p.some((e) => e.stage.status == null), g = p.some((e) => e.stage.status === o.Failed), _ = o.Completed;
|
|
620
619
|
m ? _ = null : g && (_ = o.Failed);
|
|
621
620
|
let v = Oe(e.key), y = r.isExpanded(v), b = t + 1;
|
|
622
|
-
return /* @__PURE__ */
|
|
623
|
-
title: /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ K(d, {
|
|
622
|
+
title: /* @__PURE__ */ q("span", {
|
|
624
623
|
className: "flex min-w-0 items-center gap-2",
|
|
625
624
|
children: [
|
|
626
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ K("span", {
|
|
627
626
|
className: "flex flex-none items-center",
|
|
628
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ K(Me, {
|
|
629
628
|
status: _,
|
|
630
629
|
isLive: n && m,
|
|
631
630
|
runningLabel: l,
|
|
632
631
|
failedLabel: u
|
|
633
632
|
})
|
|
634
633
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ K("span", {
|
|
636
635
|
className: c("min-w-0 max-w-[22rem] truncate", i?.fontClassName ?? "dial-small-text", X.stageName, g && X.stageNameFailed),
|
|
637
|
-
children: /* @__PURE__ */
|
|
636
|
+
children: /* @__PURE__ */ K(h, { text: e.name })
|
|
638
637
|
}),
|
|
639
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ q("span", {
|
|
640
639
|
className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text", X.count),
|
|
641
640
|
children: ["×", p.length]
|
|
642
641
|
})
|
|
@@ -647,13 +646,13 @@ var ge = {
|
|
|
647
646
|
className: ke,
|
|
648
647
|
headerClassName: c(Ae, X.collapseButton, X.row, X.stageHeader),
|
|
649
648
|
contentClassName: c("-mt-2 min-w-0 px-0", rt(b), X.stageRegion),
|
|
650
|
-
children: /* @__PURE__ */
|
|
649
|
+
children: /* @__PURE__ */ K("ul", {
|
|
651
650
|
role: "list",
|
|
652
651
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
653
|
-
children: y && p.map((e, t) => /* @__PURE__ */
|
|
652
|
+
children: y && p.map((e, t) => /* @__PURE__ */ K("li", {
|
|
654
653
|
role: "listitem",
|
|
655
654
|
className: "min-w-0",
|
|
656
|
-
children: /* @__PURE__ */
|
|
655
|
+
children: /* @__PURE__ */ K(it, {
|
|
657
656
|
node: e,
|
|
658
657
|
depth: b,
|
|
659
658
|
nameOverride: f(t + 1),
|
|
@@ -666,17 +665,17 @@ var ge = {
|
|
|
666
665
|
}, e.stage.index))
|
|
667
666
|
})
|
|
668
667
|
});
|
|
669
|
-
}, ot = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */
|
|
668
|
+
}, ot = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */ K("ul", {
|
|
670
669
|
role: "list",
|
|
671
670
|
className: c("flex min-w-0 flex-col gap-0.5", n),
|
|
672
|
-
children: je(e).map((e) => /* @__PURE__ */
|
|
671
|
+
children: je(e).map((e) => /* @__PURE__ */ K("li", {
|
|
673
672
|
role: "listitem",
|
|
674
673
|
className: "min-w-0",
|
|
675
|
-
children: e.node ? /* @__PURE__ */
|
|
674
|
+
children: e.node ? /* @__PURE__ */ K(it, {
|
|
676
675
|
node: e.node,
|
|
677
676
|
depth: t,
|
|
678
677
|
...r
|
|
679
|
-
}) : /* @__PURE__ */
|
|
678
|
+
}) : /* @__PURE__ */ K(at, {
|
|
680
679
|
row: e,
|
|
681
680
|
depth: t,
|
|
682
681
|
...r
|
|
@@ -699,11 +698,11 @@ var ge = {
|
|
|
699
698
|
"--cs-code-border": l?.codeBorderColor,
|
|
700
699
|
"--cs-code-text": l?.codeTextColor,
|
|
701
700
|
"--cs-border": l?.borderColor
|
|
702
|
-
}), f =
|
|
703
|
-
return /* @__PURE__ */
|
|
701
|
+
}), f = W(() => Ee(e), [e]);
|
|
702
|
+
return /* @__PURE__ */ K("div", {
|
|
704
703
|
style: d,
|
|
705
|
-
className: c("w-full min-w-0", X.panel, n,
|
|
706
|
-
children: /* @__PURE__ */
|
|
704
|
+
className: c("w-full min-w-0", X.panel, n, J.panel),
|
|
705
|
+
children: /* @__PURE__ */ K(ot, {
|
|
707
706
|
nodes: f,
|
|
708
707
|
depth: 0,
|
|
709
708
|
className: "w-full ps-5",
|
|
@@ -715,8 +714,8 @@ var ge = {
|
|
|
715
714
|
})
|
|
716
715
|
});
|
|
717
716
|
}, ct = (e) => {
|
|
718
|
-
let t =
|
|
719
|
-
return /* @__PURE__ */
|
|
717
|
+
let t = ve();
|
|
718
|
+
return /* @__PURE__ */ K(st, {
|
|
720
719
|
...e,
|
|
721
720
|
expansion: t
|
|
722
721
|
});
|
|
@@ -728,16 +727,16 @@ var ge = {
|
|
|
728
727
|
failedText: "_failedText_16fae_40",
|
|
729
728
|
liveName: "_liveName_16fae_44"
|
|
730
729
|
}, lt = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a }) => {
|
|
731
|
-
let { executedLabel: l = "Executed", stepsLabel: u = () => "steps", failedCountLabel: m = (e) => `${e} failed`, runningAriaLabel: g = "Running", copyAriaLabel: _, codeBlockCopiedLabel: v, tableScrollRegionAriaLabel: b, mathScrollRegionAriaLabel: x, failedAriaLabel: C, attemptLabel: w, attachmentClickLabel: T } = n ?? {}, [E, D] =
|
|
732
|
-
|
|
730
|
+
let { executedLabel: l = "Executed", stepsLabel: u = () => "steps", failedCountLabel: m = (e) => `${e} failed`, runningAriaLabel: g = "Running", copyAriaLabel: _, codeBlockCopiedLabel: v, tableScrollRegionAriaLabel: b, mathScrollRegionAriaLabel: x, failedAriaLabel: C, attemptLabel: w, attachmentClickLabel: T } = n ?? {}, [E, D] = G(t), O = ve(), { reset: k } = O, A = e.length > 1;
|
|
731
|
+
U(() => {
|
|
733
732
|
A && !E && k();
|
|
734
733
|
}, [
|
|
735
734
|
A,
|
|
736
735
|
E,
|
|
737
736
|
k
|
|
738
737
|
]);
|
|
739
|
-
let j =
|
|
740
|
-
|
|
738
|
+
let j = ge(t);
|
|
739
|
+
U(() => {
|
|
741
740
|
j.current && !t && D(!1), j.current = t;
|
|
742
741
|
}, [t]);
|
|
743
742
|
let { colors: M, panel: N } = i ?? {}, P = i?.typography ?? { fontClassName: "dial-small-text" }, F = s({
|
|
@@ -772,7 +771,7 @@ var ge = {
|
|
|
772
771
|
attemptLabel: w,
|
|
773
772
|
attachmentClickLabel: T
|
|
774
773
|
};
|
|
775
|
-
if (e.length === 1) return /* @__PURE__ */
|
|
774
|
+
if (e.length === 1) return /* @__PURE__ */ K(st, {
|
|
776
775
|
stages: e,
|
|
777
776
|
isStreaming: t,
|
|
778
777
|
expansion: O,
|
|
@@ -786,27 +785,27 @@ var ge = {
|
|
|
786
785
|
});
|
|
787
786
|
let L = e.some((e) => e.status === o.Failed), R;
|
|
788
787
|
if (t) {
|
|
789
|
-
let t =
|
|
790
|
-
R = /* @__PURE__ */
|
|
788
|
+
let t = Y((we(e) ?? e[e.length - 1]).name).name;
|
|
789
|
+
R = /* @__PURE__ */ q("span", {
|
|
791
790
|
role: "status",
|
|
792
791
|
"aria-live": "polite",
|
|
793
792
|
className: "flex min-w-0 items-center gap-2",
|
|
794
|
-
children: [/* @__PURE__ */
|
|
793
|
+
children: [/* @__PURE__ */ K("span", {
|
|
795
794
|
className: "flex flex-none items-center",
|
|
796
|
-
children: /* @__PURE__ */
|
|
795
|
+
children: /* @__PURE__ */ K(y, {
|
|
797
796
|
size: 14,
|
|
798
797
|
ariaLabel: g
|
|
799
798
|
})
|
|
800
|
-
}), t && /* @__PURE__ */
|
|
799
|
+
}), t && /* @__PURE__ */ K("span", {
|
|
801
800
|
className: c("min-w-0 max-w-[22rem] truncate", P.fontClassName, $.liveName),
|
|
802
|
-
children: /* @__PURE__ */
|
|
801
|
+
children: /* @__PURE__ */ K(h, { text: t })
|
|
803
802
|
})]
|
|
804
803
|
});
|
|
805
804
|
} else if (L) {
|
|
806
805
|
let t = e.filter((e) => e.status === o.Failed).length;
|
|
807
|
-
R = /* @__PURE__ */
|
|
806
|
+
R = /* @__PURE__ */ q("span", {
|
|
808
807
|
className: "inline-flex items-center gap-1",
|
|
809
|
-
children: [/* @__PURE__ */
|
|
808
|
+
children: [/* @__PURE__ */ q("span", {
|
|
810
809
|
className: c(P.fontClassName, $.executedLabel),
|
|
811
810
|
children: [
|
|
812
811
|
l,
|
|
@@ -815,19 +814,19 @@ var ge = {
|
|
|
815
814
|
" ",
|
|
816
815
|
u(e.length)
|
|
817
816
|
]
|
|
818
|
-
}), /* @__PURE__ */
|
|
817
|
+
}), /* @__PURE__ */ K("span", {
|
|
819
818
|
className: c(P.fontClassName, $.failedText),
|
|
820
819
|
children: m(t)
|
|
821
820
|
})]
|
|
822
821
|
});
|
|
823
|
-
} else R = /* @__PURE__ */
|
|
822
|
+
} else R = /* @__PURE__ */ q("span", {
|
|
824
823
|
className: "inline-flex items-center gap-1",
|
|
825
|
-
children: [/* @__PURE__ */
|
|
824
|
+
children: [/* @__PURE__ */ K(S, {
|
|
826
825
|
size: f.SM,
|
|
827
826
|
className: $.doneIcon,
|
|
828
827
|
"aria-hidden": !0,
|
|
829
828
|
stroke: p
|
|
830
|
-
}), /* @__PURE__ */
|
|
829
|
+
}), /* @__PURE__ */ q("span", {
|
|
831
830
|
className: c(P.fontClassName, $.executedLabel),
|
|
832
831
|
children: [
|
|
833
832
|
l,
|
|
@@ -838,17 +837,17 @@ var ge = {
|
|
|
838
837
|
]
|
|
839
838
|
})]
|
|
840
839
|
});
|
|
841
|
-
return /* @__PURE__ */
|
|
840
|
+
return /* @__PURE__ */ K("div", {
|
|
842
841
|
style: F,
|
|
843
|
-
className: c("flex w-full flex-col gap-1", r,
|
|
844
|
-
children: /* @__PURE__ */
|
|
842
|
+
className: c("flex w-full flex-col gap-1", r, J.group),
|
|
843
|
+
children: /* @__PURE__ */ K(d, {
|
|
845
844
|
title: R,
|
|
846
845
|
expanded: E,
|
|
847
846
|
onToggle: D,
|
|
848
847
|
className: "overflow-visible py-0",
|
|
849
|
-
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton,
|
|
848
|
+
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton, J.groupToggle),
|
|
850
849
|
contentClassName: c("-mt-2 px-0", $.groupRegion),
|
|
851
|
-
children: E && /* @__PURE__ */
|
|
850
|
+
children: E && /* @__PURE__ */ K(st, {
|
|
852
851
|
stages: e,
|
|
853
852
|
isStreaming: t,
|
|
854
853
|
expansion: O,
|
|
@@ -864,4 +863,4 @@ var ge = {
|
|
|
864
863
|
});
|
|
865
864
|
};
|
|
866
865
|
//#endregion
|
|
867
|
-
export {
|
|
866
|
+
export { J as CONVERSATION_STAGES_CLASS, lt as CollapsedGroup, ct as StagesPanel };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-stages",
|
|
3
3
|
"description": "Panel for displaying agent processing stages during LLM response streaming",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.323",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-attachment-input": "1.2.0-dev.
|
|
21
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.323"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^19.2.8",
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
26
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.323",
|
|
26
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.51"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|