@epam/ai-dial-conversation-stages 1.4.0-dev.132 → 1.4.0-dev.135

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.
Files changed (2) hide show
  1. package/index.js +253 -250
  2. 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 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";
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 Ce = {
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
- }, we = () => {
12
- let [e, t] = xe(() => /* @__PURE__ */ new Set()), n = K((e, n) => {
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
- }, Te = /[([][^()[\]]*[)\]]/g, Ee = /(\d+(?:\.\d+)?)\s*s\b/, De = (e) => {
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
- }, Oe = (e) => {
34
- Te.lastIndex = 0;
33
+ }, Ae = (e) => {
34
+ De.lastIndex = 0;
35
35
  let t;
36
- for (; t = Te.exec(e);) {
37
- let e = t[0].slice(1, -1), n = Ee.exec(e);
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
- }, ke = (e) => {
45
- let t = e ?? "", n = Oe(t);
44
+ }, je = (e) => {
45
+ let t = e ?? "", n = Ae(t);
46
46
  return {
47
- name: De(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
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
- }, Ae = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), je = (e) => [...e].reverse().find((e) => e.status == null), Me = (e, t) => {
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
- }, Ne = (e) => {
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 = Me(e.stage, n);
61
+ let t = Pe(e.stage, n);
62
62
  t ? t.children.push(e) : r.push(e);
63
63
  }
64
64
  return r;
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) => {
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 = ke(r.stage.name).name, a = n + 1;
69
- for (; a < e.length && ke(e[a].stage.name).name === i;) a += 1;
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
- }, ze = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === s.Failed ? /* @__PURE__ */ Y(Se, { children: [/* @__PURE__ */ J(D, {
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(O, {
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(w, {
113
+ }) : t ? /* @__PURE__ */ J(te, {
114
114
  size: 16,
115
115
  ariaLabel: n
116
- }) : null, Be = (e) => {
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
- }, 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,
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]: F,
138
+ [n.CSV]: P,
139
139
  [n.Plain]: W,
140
- [n.HTML]: L,
141
- [n.XHTML]: L,
140
+ [n.HTML]: I,
141
+ [n.XHTML]: I,
142
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,
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
- }), Ue, We, Ge = (e) => {
153
- if (!e) return M;
152
+ }), qe, Je, Ye = (e) => {
153
+ if (!e) return j;
154
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) => {
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 ? k : n === t.Image ? fe : Ge(r ?? "");
159
- }, qe = (e) => {
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
- }, Je = (e) => {
164
+ }, Qe = (e) => {
165
165
  let { name: t, contentType: n } = e;
166
166
  if (n) {
167
- let e = qe(n);
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
- }, Ye = (e) => e.type !== t.Prompt && e.type !== t.Pasted, Xe = (e, n) => {
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 = Je(e);
178
+ let a = Qe(e);
179
179
  return a ? `.${a}` : i ?? "";
180
- }, Ze = (e, n = {}) => {
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 : Ke(e),
188
- typeLabel: d ? null : Xe(e, n)
187
+ BottomIcon: d ? null : Xe(e),
188
+ typeLabel: d ? null : et(e, n)
189
189
  };
190
- }, Qe = "flex size-[100px] items-center justify-center rounded-xl border", $e = "outline-offset-1 focus-visible:outline-1", Z = {
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
- }, et = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o, isAlwaysVisible: s }) => /* @__PURE__ */ J(T, {
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
- }), tt = ({ ...e }) => /* @__PURE__ */ J(et, {
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
- }), nt = ({ ...e }) => /* @__PURE__ */ J(et, {
231
- icon: /* @__PURE__ */ J(A, {
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
- }), rt = ({ ...e }) => /* @__PURE__ */ J(et, {
238
- icon: /* @__PURE__ */ J(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
- }), it = ({ className: e, ...t }) => /* @__PURE__ */ J(et, {
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
- }), at = {
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
- }, 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(() => {
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(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", {
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(F?.nameClassName ?? "dial-tiny-text", "line-clamp-2 w-full min-w-0 wrap-break-word", Q.nameText, Z.tileName),
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 = ne && /* @__PURE__ */ Y("div", {
270
+ }), ge = re && /* @__PURE__ */ Y("div", {
271
271
  className: l("flex w-full items-end gap-1", Z.tileType),
272
- children: [ie ? /* @__PURE__ */ J(y, {
272
+ children: [ae ? /* @__PURE__ */ J(y, {
273
273
  type: g.File,
274
- name: L ?? "",
275
- fileExtension: Je(t),
274
+ name: I ?? "",
275
+ fileExtension: Qe(t),
276
276
  size: m.MD,
277
277
  decorative: !0
278
- }) : /* @__PURE__ */ J(ne, {
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(F?.metaClassName ?? "dial-tiny-text", "min-w-0 flex-1 truncate", Q.typeText),
285
- children: j ? `${re} · ${j}` : re
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(Se, { children: [
287
+ }), _e = /* @__PURE__ */ Y(we, { children: [
288
288
  he,
289
289
  ge,
290
- W && /* @__PURE__ */ J(E, {
291
- tooltip: L,
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": se ? T : ee,
297
- "aria-pressed": !se && r !== void 0 ? C : void 0,
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
- B && /* @__PURE__ */ J("div", {
302
+ z && /* @__PURE__ */ J("div", {
303
303
  role: "progressbar",
304
- "aria-label": M,
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(w, { size: 32 })
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
- ae && /* @__PURE__ */ J(nt, {
316
- ariaLabel: D,
317
- errorTitle: U,
318
- errorDescId: H,
315
+ oe && /* @__PURE__ */ J(ot, {
316
+ ariaLabel: E,
317
+ errorTitle: H,
318
+ errorDescId: V,
319
319
  onClick: c,
320
- id: I
320
+ id: F
321
321
  }),
322
- oe && /* @__PURE__ */ J(tt, {
323
- ariaLabel: O,
324
- errorTitle: U,
325
- errorDescId: H,
322
+ se && /* @__PURE__ */ J(at, {
323
+ ariaLabel: D,
324
+ errorTitle: H,
325
+ errorDescId: V,
326
326
  onClick: i,
327
- id: I
327
+ id: F
328
328
  }),
329
- u && /* @__PURE__ */ J(rt, {
330
- ariaLabel: A,
331
- errorTitle: U,
332
- errorDescId: H,
329
+ u && /* @__PURE__ */ J(st, {
330
+ ariaLabel: k,
331
+ errorTitle: H,
332
+ errorDescId: V,
333
333
  onClick: pe
334
334
  }),
335
- v && /* @__PURE__ */ J(it, {
336
- ariaLabel: k,
337
- errorTitle: U,
338
- errorDescId: H,
335
+ v && /* @__PURE__ */ J(ct, {
336
+ ariaLabel: O,
337
+ errorTitle: H,
338
+ errorDescId: V,
339
339
  onClick: v,
340
- id: I,
341
- isAlwaysVisible: B
340
+ id: F,
341
+ isAlwaysVisible: z
342
342
  })
343
343
  ]
344
344
  }),
345
345
  /* @__PURE__ */ J(x, {
346
- id: H,
346
+ id: V,
347
347
  visuallyHidden: !0,
348
348
  as: S.Span,
349
- children: V ? U : ""
349
+ children: B ? H : ""
350
350
  })
351
351
  ] });
352
352
  return /* @__PURE__ */ J("div", {
353
353
  style: d,
354
- className: l("inline-flex", te),
354
+ className: l("inline-flex", ne),
355
355
  children: /* @__PURE__ */ J("div", {
356
- "aria-busy": B,
356
+ "aria-busy": z,
357
357
  style: d,
358
- className: l(me, W && "cursor-pointer", $e),
358
+ className: l(me, W && "cursor-pointer", rt),
359
359
  children: _e
360
360
  })
361
361
  });
362
- }, st = /* @__PURE__ */ function(e) {
362
+ }, dt = /* @__PURE__ */ function(e) {
363
363
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
364
- }({}), ct = ({ enabled: e, src: t }) => {
365
- let n = be(null), [r, i] = xe("idle");
366
- return ve(() => {
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]), ve(() => {
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
- }, 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,
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
- }), 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);
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: F,
388
- "aria-busy": T,
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(it, {
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: T
401
- }), A && /* @__PURE__ */ J(nt, {
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
- N !== st.Loaded && /* @__PURE__ */ J(C, {
408
+ M !== dt.Loaded && /* @__PURE__ */ J(C, {
409
409
  variant: ee.Rectangular,
410
410
  width: "100%",
411
411
  height: "100%",
412
- active: N === st.Loading,
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: M,
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", N === st.Loaded ? "opacity-100" : "opacity-0")
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
- k && /* @__PURE__ */ J("button", {
429
+ O && /* @__PURE__ */ J("button", {
430
430
  type: "button",
431
431
  "aria-label": S ? f : d,
432
- "aria-pressed": O ? u : void 0,
433
- onClick: P,
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
- T && /* @__PURE__ */ J("div", {
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(w, { size: 32 })
443
+ children: /* @__PURE__ */ J(te, { size: 32 })
444
444
  })
445
445
  })
446
446
  ]
447
447
  })
448
448
  });
449
- }, ut = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: l, styles: u, isSelected: d }) => {
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(() => Ze(e), [e]);
468
- return h ? /* @__PURE__ */ J(lt, {
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(ot, {
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
- }, dt = (e, t) => {
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
- }, ft = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: r, copiedLabel: a }) => {
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
- }, pt = _e(({ content: e, typography: t, copyAriaLabel: n = "Copy", copiedLabel: r, tableScrollRegionAriaLabel: i, mathScrollRegionAriaLabel: o, renderCitation: s }) => {
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(ft, {
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
- }), mt = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
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(ut, {
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
- }, 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) => {
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: 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: [
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(ze, {
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", 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 || "" })
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
- D && /* @__PURE__ */ J("span", {
602
+ E && /* @__PURE__ */ J("span", {
600
603
  className: l("flex-none", n?.countFontClassName ?? "dial-tiny-text", X.duration),
601
- children: D
604
+ children: E
602
605
  })
603
606
  ] });
604
- return M ? /* @__PURE__ */ Y(p, {
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: N
612
+ children: M
610
613
  }),
611
- className: Ie,
612
- headerClassName: l(Le, X.row, X.stageHeader),
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 && j && /* @__PURE__ */ Y("div", {
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(pt, {
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
- }), T.length > 0 && /* @__PURE__ */ J(mt, {
628
- attachments: T,
629
- clickLabel: w,
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: N
638
+ children: M
636
639
  });
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, {
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(bt, {
653
+ childList: e.children.length > 0 ? /* @__PURE__ */ J(Tt, {
651
654
  nodes: e.children,
652
655
  depth: d,
653
- className: gt(d),
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
- }, yt = ({ row: e, depth: t, isStreaming: n, expansion: r, typography: i, labels: a, onAttachmentClick: o, attachmentDisplayResolvers: c, renderCitation: u }) => {
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 = Fe(e.key), x = r.isExpanded(b), S = t + 1, C = /* @__PURE__ */ Y("span", {
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(ze, {
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: 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),
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(vt, {
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
- }, bt = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */ J("ul", {
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: Re(e).map((e) => /* @__PURE__ */ J("li", {
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(vt, {
725
+ children: e.node ? /* @__PURE__ */ J(Ct, {
723
726
  node: e.node,
724
727
  depth: t,
725
728
  ...r
726
- }) : /* @__PURE__ */ J(yt, {
729
+ }) : /* @__PURE__ */ J(wt, {
727
730
  row: e,
728
731
  depth: t,
729
732
  ...r
730
733
  })
731
734
  }, e.key))
732
- }), xt = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a, attachmentDisplayResolvers: o, renderCitation: s, expansion: u }) => {
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(() => Ne(e), [e]);
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, Ce.panel),
753
- children: /* @__PURE__ */ J(bt, {
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
- }, St = (e) => {
767
- let t = we();
768
- return /* @__PURE__ */ J(xt, {
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
- }, 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();
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
- j,
785
- E,
786
- A
787
+ A,
788
+ T,
789
+ k
787
790
  ]);
788
- let M = be(t);
789
- ve(() => {
790
- M.current && !t && D(!1), M.current = t;
791
+ let j = Se(t);
792
+ be(() => {
793
+ j.current && !t && E(!1), j.current = t;
791
794
  }, [t]);
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
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 I = {
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: T
825
+ attachmentClickLabel: w
823
826
  };
824
- if (e.length === 1) return /* @__PURE__ */ J(xt, {
827
+ if (e.length === 1) return /* @__PURE__ */ J(Et, {
825
828
  stages: e,
826
829
  isStreaming: t,
827
- expansion: k,
830
+ expansion: O,
828
831
  className: r,
829
832
  styles: {
830
- colors: P,
833
+ colors: N,
831
834
  typography: i?.typography
832
835
  },
833
- labels: I,
836
+ labels: F,
834
837
  onAttachmentClick: a,
835
838
  attachmentDisplayResolvers: o,
836
839
  renderCitation: u
837
840
  });
838
- let L = e.some((e) => e.status === s.Failed), R;
841
+ let I = e.some((e) => e.status === s.Failed), L;
839
842
  if (t) {
840
- let t = ke((je(e) ?? e[e.length - 1]).name).name;
841
- R = /* @__PURE__ */ Y("span", {
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(w, {
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", F.fontClassName, $.liveName),
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 (L) {
859
+ } else if (I) {
857
860
  let t = e.filter((e) => e.status === s.Failed).length;
858
- R = /* @__PURE__ */ Y("span", {
861
+ L = /* @__PURE__ */ Y("span", {
859
862
  className: "inline-flex items-center gap-1",
860
863
  children: [/* @__PURE__ */ Y("span", {
861
- className: l(F.fontClassName, $.executedLabel),
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(F.fontClassName, $.failedText),
873
+ className: l(P.fontClassName, $.failedText),
871
874
  children: g(t)
872
875
  })]
873
876
  });
874
- } else R = /* @__PURE__ */ Y("span", {
877
+ } else L = /* @__PURE__ */ Y("span", {
875
878
  className: "inline-flex items-center gap-1",
876
- children: [/* @__PURE__ */ J(O, {
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(F.fontClassName, $.executedLabel),
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: te,
894
- className: l("flex w-full flex-col gap-1", r, Ce.group),
896
+ style: ne,
897
+ className: l("flex w-full flex-col gap-1", r, Te.group),
895
898
  children: /* @__PURE__ */ J(p, {
896
- title: R,
897
- expanded: E,
898
- onToggle: D,
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, Ce.groupToggle),
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: E && /* @__PURE__ */ J(xt, {
905
+ children: T && /* @__PURE__ */ J(Et, {
903
906
  stages: e,
904
907
  isStreaming: t,
905
- expansion: k,
908
+ expansion: O,
906
909
  styles: {
907
- colors: P,
910
+ colors: N,
908
911
  typography: i?.typography
909
912
  },
910
- labels: I,
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 { Ce as CONVERSATION_STAGES_CLASS, Ct as CollapsedGroup, St as StagesPanel };
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.132",
4
+ "version": "1.4.0-dev.135",
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.132"
25
+ "@epam/ai-dial-attachment-input": "1.4.0-dev.135"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^19.2.8",
29
- "@epam/ai-dial-chat-shared": "1.4.0-dev.132",
29
+ "@epam/ai-dial-chat-shared": "1.4.0-dev.135",
30
30
  "@epam/ai-dial-ui-kit": "^0.16.0"
31
31
  },
32
32
  "repository": {