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