@epam/ai-dial-conversation-stages 1.3.0-dev.98 → 1.4.0-dev.5

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