@epam/ai-dial-conversation-stages 1.2.0-dev.285 → 1.2.0-dev.287
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CollapsedGroup/CollapsedGroup.d.ts.map +1 -1
- package/components/StageList/StageList.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +264 -314
- package/models/collapsed-group.d.ts +0 -2
- package/models/collapsed-group.d.ts.map +1 -1
- package/package.json +3 -3
- package/utils/stage-name.d.ts +0 -6
- package/utils/stage-name.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAGxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AAGxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAMxE,gJAAgJ;AAChJ,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA8MlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageList.d.ts","sourceRoot":"","sources":["../../../src/components/StageList/StageList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAO3B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"StageList.d.ts","sourceRoot":"","sources":["../../../src/components/StageList/StageList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAO3B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAUnC,+DAA+D;AAC/D,UAAU,eAAe;IACvB,iFAAiF;IACjF,WAAW,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,SAAS,EAAE,cAAc,CAAC;IAC1B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gHAAgH;IAChH,iBAAiB,CAAC,EAAE,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;CAC3D;AAED,mCAAmC;AACnC,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,mDAAmD;IACnD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwKD,mGAAmG;AACnG,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAoBxC,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
._panel_w65is_2{color:var(--cs-text,var(--text-primary,#161b2d))}._row_w65is_6:hover{background:var(--cs-row-hover,var(--bg-layer-sunken,#eef1f7))}._collapseButton_w65is_10{background:var(--cs-button-bg,transparent)}._stageHeader_w65is_19._stageHeader_w65is_19:hover{background:var(--cs-row-hover,var(--bg-layer-sunken,#eef1f7))}._stageHeader_w65is_19._stageHeader_w65is_19>svg{color:var(--cs-icon-secondary,var(--text-secondary,#57647a));opacity:.7}._stageRegion_w65is_28._stageRegion_w65is_28{color:inherit}._stageName_w65is_32{color:var(--cs-stage-text,var(--text-secondary,#57647a))}._stageNameFailed_w65is_36{color:var(--cs-failed-text,var(--text-warning,#7f6300))}._monoName_w65is_40{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}._tag_w65is_44{color:var(--cs-tag-text,var(--text-tertiary,#848e9c))}._count_w65is_48{color:var(--cs-count-text,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._duration_w65is_53{color:var(--cs-duration-text,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._iconSecondary_w65is_58{color:var(--cs-icon-secondary,var(--text-secondary,#57647a));opacity:.7}._iconCompleted_w65is_63{color:var(--cs-icon-completed,var(--text-success,#007274))}._iconError_w65is_67{color:var(--cs-icon-error,var(--text-warning,#7f6300))}._stageContent_w65is_71{color:var(--cs-stage-text,var(--text-secondary,#57647a))}._codeBlock_w65is_75{background:var(--cs-code-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._codeInline_w65is_84{font-family:var(--theme-font-mono,var(--font-fira-code,"Fira Code"), ui-monospace, monospace);background:var(--cs-code-bg,var(--bg-layer-raised,#fcfcfc));border:1px solid var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._blockquote_w65is_91{border-color:var(--cs-stage-text,var(--text-secondary,#57647a));color:var(--cs-stage-text,var(--text-secondary,#57647a))}._tableCell_w65is_96{border-color:var(--cs-border,var(--stroke-secondary,#d1dbea));color:var(--cs-stage-text,var(--text-secondary,#57647a))}.
|
|
1
|
+
._panel_w65is_2{color:var(--cs-text,var(--text-primary,#161b2d))}._row_w65is_6:hover{background:var(--cs-row-hover,var(--bg-layer-sunken,#eef1f7))}._collapseButton_w65is_10{background:var(--cs-button-bg,transparent)}._stageHeader_w65is_19._stageHeader_w65is_19:hover{background:var(--cs-row-hover,var(--bg-layer-sunken,#eef1f7))}._stageHeader_w65is_19._stageHeader_w65is_19>svg{color:var(--cs-icon-secondary,var(--text-secondary,#57647a));opacity:.7}._stageRegion_w65is_28._stageRegion_w65is_28{color:inherit}._stageName_w65is_32{color:var(--cs-stage-text,var(--text-secondary,#57647a))}._stageNameFailed_w65is_36{color:var(--cs-failed-text,var(--text-warning,#7f6300))}._monoName_w65is_40{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}._tag_w65is_44{color:var(--cs-tag-text,var(--text-tertiary,#848e9c))}._count_w65is_48{color:var(--cs-count-text,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._duration_w65is_53{color:var(--cs-duration-text,var(--text-tertiary,#848e9c));font-variant-numeric:tabular-nums}._iconSecondary_w65is_58{color:var(--cs-icon-secondary,var(--text-secondary,#57647a));opacity:.7}._iconCompleted_w65is_63{color:var(--cs-icon-completed,var(--text-success,#007274))}._iconError_w65is_67{color:var(--cs-icon-error,var(--text-warning,#7f6300))}._stageContent_w65is_71{color:var(--cs-stage-text,var(--text-secondary,#57647a))}._codeBlock_w65is_75{background:var(--cs-code-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._codeInline_w65is_84{font-family:var(--theme-font-mono,var(--font-fira-code,"Fira Code"), ui-monospace, monospace);background:var(--cs-code-bg,var(--bg-layer-raised,#fcfcfc));border:1px solid var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._blockquote_w65is_91{border-color:var(--cs-stage-text,var(--text-secondary,#57647a));color:var(--cs-stage-text,var(--text-secondary,#57647a))}._tableCell_w65is_96{border-color:var(--cs-border,var(--stroke-secondary,#d1dbea));color:var(--cs-stage-text,var(--text-secondary,#57647a))}._toggleButton_16fae_7._toggleButton_16fae_7{color:var(--cs-cg-label,var(--text-secondary,#57647a));text-align:start;width:100%;min-width:0}._toggleButton_16fae_7._toggleButton_16fae_7:hover{color:var(--cs-cg-label-hover,var(--text-primary,#161b2d));background:0 0}._toggleButton_16fae_7._toggleButton_16fae_7>svg{width:12px;height:12px;color:inherit}._toggleButton_16fae_7._toggleButton_16fae_7>span>span{white-space:normal}._groupRegion_16fae_28._groupRegion_16fae_28{color:inherit}._executedLabel_16fae_32{color:var(--cs-cg-label,var(--text-secondary,#57647a))}._doneIcon_16fae_36{color:var(--cs-cg-done,var(--text-success,#007274))}._failedText_16fae_40{color:var(--cs-cg-failed,var(--text-warning,#7f6300))}._liveName_16fae_44{color:var(--cs-cg-label,var(--text-primary,#161b2d))}
|
|
2
2
|
/*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.collapse{visibility:collapse}.-mt-1{margin-top:-.25rem}.-mt-2{margin-top:-.5rem}.mb-1\.5{margin-bottom:.375rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.max-h-\[300px\]{max-height:300px}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[22rem\]{max-width:22rem}.flex-none{flex:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-start{justify-content:flex-start}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-0{padding-bottom:0;padding-top:0}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\.5{padding-bottom:.375rem;padding-top:.375rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.ps-0{padding-inline-start:0}.ps-4{padding-inline-start:1rem}.ps-5{padding-inline-start:1.25rem}.ps-6{padding-inline-start:1.5rem}.ps-8{padding-inline-start:2rem}.pt-1{padding-top:.25rem}.text-start{text-align:start}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.last\:mb-0:last-child{margin-bottom:0}@media (max-width:1279px){.mobile\:min-h-11{min-height:2.75rem}}
|
package/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, MarkdownCodeBlock as r, MarkdownRenderer as i, RequestStatus as a, StageStatus as o, buildCssVars as s, mergeClasses as c, messageAttachmentsToDisplayAttachments as l, normalizeMimeType as u } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { Accordion as d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, ElementSize as m, EllipsisTooltip as h, Highlight as g, Skeleton as _, SkeletonVariant as v, Spinner as y, StaticIconButton as b } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconAlertCircle as x, IconCheck as S, IconClipboard as C, IconDownload as w, IconExternalLink as T, IconFile as E, IconFileTypeBmp as D, IconFileTypeCss as O, IconFileTypeCsv as k, IconFileTypeDoc as A, IconFileTypeDocx as j, IconFileTypeHtml as M, IconFileTypeJpg as N, IconFileTypeJs as P, IconFileTypeJsx as F, IconFileTypePdf as I, IconFileTypePhp as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { IconAlertCircle as x, IconCheck as S, IconClipboard as C, IconDownload as w, IconExternalLink as T, IconFile as E, IconFileTypeBmp as D, IconFileTypeCss as O, IconFileTypeCsv as k, IconFileTypeDoc as A, IconFileTypeDocx as j, IconFileTypeHtml as M, IconFileTypeJpg as N, IconFileTypeJs as P, IconFileTypeJsx as F, IconFileTypePdf as I, IconFileTypePhp as ee, IconFileTypePng as te, IconFileTypePpt as L, IconFileTypeRs as ne, IconFileTypeSql as re, IconFileTypeSvg as ie, IconFileTypeTs as ae, IconFileTypeTsx as R, IconFileTypeTxt as oe, IconFileTypeVue as se, IconFileTypeXls as ce, IconFileTypeXml as le, IconFileTypeZip as ue, 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 z, useEffect as B, useId as ve, useMemo as V, useRef as ye, useState as H } from "react";
|
|
5
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
6
6
|
//#region src/constants/public-class-names.ts
|
|
7
|
-
var
|
|
7
|
+
var K = {
|
|
8
8
|
panel: "dial-conversation-stages-panel",
|
|
9
9
|
group: "dial-conversation-stages-group",
|
|
10
10
|
groupToggle: "dial-conversation-stages-group-toggle"
|
|
11
|
-
},
|
|
12
|
-
let [e, t] =
|
|
11
|
+
}, be = () => {
|
|
12
|
+
let [e, t] = H(() => /* @__PURE__ */ new Set()), n = z((e, n) => {
|
|
13
13
|
t((t) => {
|
|
14
14
|
if (t.has(e) === n) return t;
|
|
15
15
|
let r = new Set(t);
|
|
16
16
|
return n ? r.add(e) : r.delete(e), r;
|
|
17
17
|
});
|
|
18
|
-
}, []), r =
|
|
18
|
+
}, []), r = z(() => {
|
|
19
19
|
t((e) => e.size ? /* @__PURE__ */ new Set() : e);
|
|
20
20
|
}, []);
|
|
21
|
-
return
|
|
21
|
+
return V(() => ({
|
|
22
22
|
isExpanded: (t) => e.has(t),
|
|
23
23
|
onToggle: n,
|
|
24
24
|
reset: r
|
|
@@ -27,60 +27,30 @@ var q = {
|
|
|
27
27
|
n,
|
|
28
28
|
r
|
|
29
29
|
]);
|
|
30
|
-
},
|
|
30
|
+
}, xe = /[([][^()[\]]*[)\]]/g, Se = /(\d+(?:\.\d+)?)\s*s\b/, Ce = (e) => {
|
|
31
31
|
let t = e.trimEnd();
|
|
32
32
|
return t.endsWith(":") ? t.slice(0, -1) : t;
|
|
33
|
-
}, we =
|
|
34
|
-
|
|
35
|
-
if (!t) return;
|
|
36
|
-
let n = Number(t[1]);
|
|
37
|
-
if (!(n > 23)) return n * 60 * 60 + Number(t[2]) * 60 + Number(t[3]);
|
|
38
|
-
}, De = (e) => {
|
|
39
|
-
be.lastIndex = 0;
|
|
33
|
+
}, we = (e) => {
|
|
34
|
+
xe.lastIndex = 0;
|
|
40
35
|
let t;
|
|
41
|
-
for (; t =
|
|
42
|
-
let e = t[0].slice(1, -1), n =
|
|
36
|
+
for (; t = xe.exec(e);) {
|
|
37
|
+
let e = t[0].slice(1, -1), n = Se.exec(e);
|
|
43
38
|
if (n) return {
|
|
44
39
|
durationLabel: `${n[1]}s`,
|
|
45
40
|
groupIndex: t.index,
|
|
46
|
-
groupLength: t[0].length
|
|
47
|
-
startTimeSeconds: Ee(e)
|
|
41
|
+
groupLength: t[0].length
|
|
48
42
|
};
|
|
49
43
|
}
|
|
50
|
-
},
|
|
51
|
-
let t = e ?? "", n =
|
|
44
|
+
}, q = (e) => {
|
|
45
|
+
let t = e ?? "", n = we(t);
|
|
52
46
|
return {
|
|
53
47
|
name: Ce(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
|
|
54
48
|
durationLabel: n?.durationLabel
|
|
55
49
|
};
|
|
56
|
-
},
|
|
57
|
-
if (!e) return;
|
|
58
|
-
let t = /^(\d+(?:\.\d+)?)s$/.exec(e);
|
|
59
|
-
return t ? parseFloat(t[1]) : void 0;
|
|
60
|
-
}, je = (e) => {
|
|
61
|
-
let t = e.flatMap((e) => {
|
|
62
|
-
let t = De(e ?? ""), n = Ae(t?.durationLabel);
|
|
63
|
-
return n == null ? [] : [{
|
|
64
|
-
durationSeconds: n,
|
|
65
|
-
startTimeSeconds: t?.startTimeSeconds
|
|
66
|
-
}];
|
|
67
|
-
});
|
|
68
|
-
if (t.length === 0) return 0;
|
|
69
|
-
if (t.some(({ startTimeSeconds: e }) => e == null)) return t.reduce((e, { durationSeconds: t }) => e + t, 0);
|
|
70
|
-
let n = 0, r, i = t.flatMap(({ durationSeconds: e, startTimeSeconds: t }) => {
|
|
71
|
-
if (t == null) return [];
|
|
72
|
-
let i = t + n;
|
|
73
|
-
return r != null && r - i > Te && (n += we, i += we), r = i, {
|
|
74
|
-
start: i,
|
|
75
|
-
end: i + e
|
|
76
|
-
};
|
|
77
|
-
}).sort((e, t) => e.start - t.start), a = 0, o = i[0].start, s = i[0].end;
|
|
78
|
-
for (let e of i.slice(1)) e.start <= s ? s = Math.max(s, e.end) : (a += s - o, o = e.start, s = e.end);
|
|
79
|
-
return a + s - o;
|
|
80
|
-
}, Me = (e) => [...e].reverse().find((e) => e.status == null), Ne = (e, t) => {
|
|
50
|
+
}, Te = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), Ee = (e) => [...e].reverse().find((e) => e.status == null), De = (e, t) => {
|
|
81
51
|
let n = e.parent_stage_index;
|
|
82
52
|
if (!(n == null || !Number.isInteger(n) || n < 0 || n >= e.index)) return t.get(n);
|
|
83
|
-
},
|
|
53
|
+
}, Oe = (e) => {
|
|
84
54
|
let t = e.map((e) => ({
|
|
85
55
|
stage: e,
|
|
86
56
|
children: []
|
|
@@ -88,15 +58,15 @@ var q = {
|
|
|
88
58
|
for (let e of t) n.has(e.stage.index) || n.set(e.stage.index, e);
|
|
89
59
|
let r = [];
|
|
90
60
|
for (let e of t) {
|
|
91
|
-
let t =
|
|
61
|
+
let t = De(e.stage, n);
|
|
92
62
|
t ? t.children.push(e) : r.push(e);
|
|
93
63
|
}
|
|
94
64
|
return r;
|
|
95
|
-
},
|
|
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) => {
|
|
96
66
|
let t = [], n = 0;
|
|
97
67
|
for (; n < e.length;) {
|
|
98
|
-
let r = e[n], i =
|
|
99
|
-
for (; a < e.length &&
|
|
68
|
+
let r = e[n], i = q(r.stage.name).name, a = n + 1;
|
|
69
|
+
for (; a < e.length && q(e[a].stage.name).name === i;) a += 1;
|
|
100
70
|
let o = e.slice(n, a);
|
|
101
71
|
o.length > 1 ? t.push({
|
|
102
72
|
key: r.stage.index,
|
|
@@ -108,7 +78,7 @@ var q = {
|
|
|
108
78
|
}), n = a;
|
|
109
79
|
}
|
|
110
80
|
return t;
|
|
111
|
-
},
|
|
81
|
+
}, J = {
|
|
112
82
|
panel: "_panel_w65is_2",
|
|
113
83
|
row: "_row_w65is_6",
|
|
114
84
|
collapseButton: "_collapseButton_w65is_10",
|
|
@@ -128,98 +98,98 @@ var q = {
|
|
|
128
98
|
codeInline: "_codeInline_w65is_84",
|
|
129
99
|
blockquote: "_blockquote_w65is_91",
|
|
130
100
|
tableCell: "_tableCell_w65is_96"
|
|
131
|
-
},
|
|
101
|
+
}, Pe = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === o.Failed ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(x, {
|
|
132
102
|
size: f.MD,
|
|
133
|
-
className:
|
|
103
|
+
className: J.iconError,
|
|
134
104
|
"aria-hidden": !0,
|
|
135
105
|
stroke: p
|
|
136
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ W("span", {
|
|
137
107
|
className: "sr-only",
|
|
138
108
|
children: r
|
|
139
|
-
})] }) : e === o.Completed ? /* @__PURE__ */
|
|
109
|
+
})] }) : e === o.Completed ? /* @__PURE__ */ W(S, {
|
|
140
110
|
size: f.SM,
|
|
141
|
-
className:
|
|
111
|
+
className: J.iconCompleted,
|
|
142
112
|
"aria-hidden": !0,
|
|
143
113
|
stroke: p
|
|
144
|
-
}) : t ? /* @__PURE__ */
|
|
114
|
+
}) : t ? /* @__PURE__ */ W(y, {
|
|
145
115
|
size: 16,
|
|
146
116
|
ariaLabel: n
|
|
147
|
-
}) : null,
|
|
117
|
+
}) : null, Fe = (e) => {
|
|
148
118
|
if (e == null) return "";
|
|
149
119
|
let t = e.lastIndexOf(".");
|
|
150
120
|
return t > 0 ? e.slice(0, t) : e;
|
|
151
|
-
},
|
|
121
|
+
}, Ie = (e) => {
|
|
152
122
|
if (!e) return E;
|
|
153
123
|
let t = u(e);
|
|
154
124
|
if (t.startsWith("image/")) switch (t) {
|
|
155
125
|
case "image/jpeg": return N;
|
|
156
|
-
case "image/png": return
|
|
157
|
-
case "image/svg+xml": return
|
|
126
|
+
case "image/png": return te;
|
|
127
|
+
case "image/svg+xml": return ie;
|
|
158
128
|
case "image/bmp": return D;
|
|
159
|
-
default: return
|
|
129
|
+
default: return fe;
|
|
160
130
|
}
|
|
161
|
-
if (t.startsWith("video/")) return
|
|
162
|
-
if (t.startsWith("audio/")) return
|
|
131
|
+
if (t.startsWith("video/")) return he;
|
|
132
|
+
if (t.startsWith("audio/")) return de;
|
|
163
133
|
switch (t) {
|
|
164
134
|
case "application/pdf": return I;
|
|
165
135
|
case "application/msword": return A;
|
|
166
136
|
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return j;
|
|
167
|
-
case "application/vnd.ms-powerpoint": return
|
|
168
|
-
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return
|
|
169
|
-
case "application/vnd.ms-excel": return
|
|
170
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return
|
|
137
|
+
case "application/vnd.ms-powerpoint": return L;
|
|
138
|
+
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return L;
|
|
139
|
+
case "application/vnd.ms-excel": return ce;
|
|
140
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return ce;
|
|
171
141
|
case "application/zip":
|
|
172
142
|
case "application/vnd.rar":
|
|
173
143
|
case "application/x-7z-compressed":
|
|
174
144
|
case "application/gzip":
|
|
175
|
-
case "application/x-tar": return
|
|
145
|
+
case "application/x-tar": return ue;
|
|
176
146
|
case "text/csv": return k;
|
|
177
|
-
case "text/plain": return
|
|
147
|
+
case "text/plain": return oe;
|
|
178
148
|
case "text/html":
|
|
179
149
|
case "application/xhtml+xml": return M;
|
|
180
|
-
case "application/xml": return
|
|
181
|
-
case "application/sql": return
|
|
150
|
+
case "application/xml": return le;
|
|
151
|
+
case "application/sql": return re;
|
|
182
152
|
case "text/javascript": return P;
|
|
183
153
|
case "text/jsx": return F;
|
|
184
|
-
case "text/typescript": return
|
|
185
|
-
case "text/tsx": return
|
|
154
|
+
case "text/typescript": return ae;
|
|
155
|
+
case "text/tsx": return R;
|
|
186
156
|
case "text/css": return O;
|
|
187
|
-
case "text/x-php": return
|
|
188
|
-
case "text/x-rustsrc": return
|
|
189
|
-
case "text/x-vue": return
|
|
157
|
+
case "text/x-php": return ee;
|
|
158
|
+
case "text/x-rustsrc": return ne;
|
|
159
|
+
case "text/x-vue": return se;
|
|
190
160
|
default: return E;
|
|
191
161
|
}
|
|
192
|
-
},
|
|
162
|
+
}, Le = (e) => {
|
|
193
163
|
let { type: n, contentType: r } = e;
|
|
194
|
-
return n === t.Prompt ?
|
|
195
|
-
},
|
|
164
|
+
return n === t.Prompt ? me : n === t.Pasted ? C : n === t.Image ? fe : Ie(r ?? "");
|
|
165
|
+
}, Re = (e) => {
|
|
196
166
|
let t = u(e), r = n[t];
|
|
197
167
|
if (r) return r;
|
|
198
168
|
let i = t.split("/")[1];
|
|
199
169
|
if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
|
|
200
|
-
},
|
|
170
|
+
}, ze = (e, n) => {
|
|
201
171
|
let { type: r, name: i, contentType: a } = e;
|
|
202
172
|
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
203
173
|
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
204
174
|
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
205
175
|
if (a) {
|
|
206
|
-
let e =
|
|
176
|
+
let e = Re(a);
|
|
207
177
|
if (e) return `.${e}`;
|
|
208
178
|
}
|
|
209
179
|
if (i == null) return "";
|
|
210
180
|
let o = i.lastIndexOf(".");
|
|
211
181
|
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
212
|
-
},
|
|
182
|
+
}, Be = (e, n = {}) => {
|
|
213
183
|
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;
|
|
214
184
|
return {
|
|
215
185
|
isLoading: c,
|
|
216
186
|
isError: l,
|
|
217
187
|
isImage: u,
|
|
218
188
|
isLink: d,
|
|
219
|
-
BottomIcon: d ? null :
|
|
220
|
-
typeLabel: d ? null :
|
|
189
|
+
BottomIcon: d ? null : Le(e),
|
|
190
|
+
typeLabel: d ? null : ze(e, n)
|
|
221
191
|
};
|
|
222
|
-
},
|
|
192
|
+
}, Ve = "flex size-[84px] items-center justify-center rounded-xl border", Y = {
|
|
223
193
|
tray: "dial-ai-attachment-tray",
|
|
224
194
|
trayItem: "dial-ai-attachment-tray-item",
|
|
225
195
|
tile: "dial-ai-attachment-tile",
|
|
@@ -227,7 +197,7 @@ var q = {
|
|
|
227
197
|
tileName: "dial-ai-attachment-tile-name",
|
|
228
198
|
tileType: "dial-ai-attachment-tile-type",
|
|
229
199
|
tileAction: "dial-ai-attachment-tile-action"
|
|
230
|
-
},
|
|
200
|
+
}, X = {
|
|
231
201
|
tile: "_tile_s2es2_12",
|
|
232
202
|
hovered: "_hovered_s2es2_18",
|
|
233
203
|
selected: "_selected_s2es2_28",
|
|
@@ -238,106 +208,106 @@ var q = {
|
|
|
238
208
|
track: "_track_s2es2_50",
|
|
239
209
|
actionButton: "_actionButton_s2es2_56",
|
|
240
210
|
imageActionButton: "_imageActionButton_s2es2_60"
|
|
241
|
-
},
|
|
211
|
+
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ W(b, {
|
|
242
212
|
icon: a,
|
|
243
213
|
size: m.Small,
|
|
244
|
-
className: c("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100",
|
|
214
|
+
className: c("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", X.actionButton, o, Y.tileAction),
|
|
245
215
|
"aria-label": e,
|
|
246
216
|
"aria-describedby": t ? n : void 0,
|
|
247
217
|
onClick: (e) => {
|
|
248
218
|
e.stopPropagation(), r(i);
|
|
249
219
|
}
|
|
250
|
-
}),
|
|
251
|
-
icon: /* @__PURE__ */
|
|
220
|
+
}), He = ({ ...e }) => /* @__PURE__ */ W(Z, {
|
|
221
|
+
icon: /* @__PURE__ */ W(pe, {
|
|
252
222
|
size: f.SM,
|
|
253
223
|
"aria-hidden": !0,
|
|
254
224
|
stroke: p
|
|
255
225
|
}),
|
|
256
|
-
className:
|
|
226
|
+
className: X.retryIcon,
|
|
257
227
|
...e
|
|
258
|
-
}),
|
|
259
|
-
icon: /* @__PURE__ */
|
|
228
|
+
}), Ue = ({ ...e }) => /* @__PURE__ */ W(Z, {
|
|
229
|
+
icon: /* @__PURE__ */ W(w, {
|
|
260
230
|
size: f.SM,
|
|
261
231
|
"aria-hidden": !0,
|
|
262
232
|
stroke: p
|
|
263
233
|
}),
|
|
264
234
|
...e
|
|
265
|
-
}),
|
|
266
|
-
icon: /* @__PURE__ */
|
|
235
|
+
}), We = ({ ...e }) => /* @__PURE__ */ W(Z, {
|
|
236
|
+
icon: /* @__PURE__ */ W(T, {
|
|
267
237
|
size: f.SM,
|
|
268
238
|
"aria-hidden": !0,
|
|
269
239
|
stroke: p
|
|
270
240
|
}),
|
|
271
241
|
...e
|
|
272
|
-
}),
|
|
273
|
-
icon: /* @__PURE__ */
|
|
242
|
+
}), Ge = ({ ...e }) => /* @__PURE__ */ W(Z, {
|
|
243
|
+
icon: /* @__PURE__ */ W(ge, {
|
|
274
244
|
size: f.SM,
|
|
275
245
|
"aria-hidden": !0,
|
|
276
246
|
stroke: p
|
|
277
247
|
}),
|
|
278
248
|
...e
|
|
279
|
-
}),
|
|
249
|
+
}), Ke = {
|
|
280
250
|
[e.Network]: "Upload failed · network error",
|
|
281
251
|
[e.UnsupportedType]: "Upload failed · unsupported file type",
|
|
282
252
|
[e.FileTooLarge]: "Upload failed · file too large"
|
|
283
|
-
},
|
|
284
|
-
let { clickLabel: v = "Download attachment", retryLabel: b = "Retry upload", removeLabel: x = "Remove attachment", openInNewTabLabel: S = "Open in new tab", sizeLabel: C, uploadingLabel: w = "Uploading", errorReasonLabels: T, genericErrorLabel: E = "Upload failed" } = o ?? {}, { typography: D, className: O } = s ?? {}, { id: k, name: A, status: j, errorReason: M } = t, N = j === a.Loading, P = j === a.Error, F =
|
|
253
|
+
}, qe = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: o, styles: s, onDownload: l, isPasted: u, isLink: d, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: _ }) => {
|
|
254
|
+
let { clickLabel: v = "Download attachment", retryLabel: b = "Retry upload", removeLabel: x = "Remove attachment", openInNewTabLabel: S = "Open in new tab", sizeLabel: C, uploadingLabel: w = "Uploading", errorReasonLabels: T, genericErrorLabel: E = "Upload failed" } = o ?? {}, { typography: D, className: O } = s ?? {}, { id: k, name: A, status: j, errorReason: M } = t, N = j === a.Loading, P = j === a.Error, F = ve(), I = P ? M && (T?.[M] ?? Ke[M]) || E : "", { BottomIcon: ee, typeLabel: te } = Be(t), L = !P && !N && l && !d, ne = P && !!i && M !== e.UnsupportedType && M !== e.FileTooLarge, re = Number(!!L) + Number(!!ne) + Number(!!d) + Number(!!h), ie = re > 1 ? "pe-11" : re === 1 ? "pe-5" : void 0, ae = (e) => {
|
|
285
255
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
|
|
286
|
-
},
|
|
256
|
+
}, R = V(() => u ? A : Fe(A), [u, A]), oe = z(() => {
|
|
287
257
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
288
|
-
}, [t]),
|
|
289
|
-
title:
|
|
290
|
-
className: c(D?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words",
|
|
291
|
-
children: n ? /* @__PURE__ */
|
|
292
|
-
text:
|
|
258
|
+
}, [t]), se = c(Ve, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !P && X.hovered, _ && X.selected, P && X.tileError, Y.tile, _ && Y.tileSelected), ce = /* @__PURE__ */ W("div", {
|
|
259
|
+
title: R,
|
|
260
|
+
className: c(D?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words", X.nameText, !P && ie, Y.tileName),
|
|
261
|
+
children: n ? /* @__PURE__ */ W(g, {
|
|
262
|
+
text: R,
|
|
293
263
|
query: n,
|
|
294
264
|
maxLines: 2
|
|
295
|
-
}) :
|
|
296
|
-
}),
|
|
297
|
-
className: c("flex w-full items-center gap-1", P &&
|
|
298
|
-
children: [/* @__PURE__ */
|
|
265
|
+
}) : R
|
|
266
|
+
}), le = ee && /* @__PURE__ */ G("div", {
|
|
267
|
+
className: c("flex w-full items-center gap-1", P && ie, Y.tileType),
|
|
268
|
+
children: [/* @__PURE__ */ W(ee, {
|
|
299
269
|
size: 16,
|
|
300
|
-
className:
|
|
270
|
+
className: X.typeText,
|
|
301
271
|
"aria-hidden": !0
|
|
302
|
-
}), /* @__PURE__ */
|
|
303
|
-
className: c(D?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate",
|
|
304
|
-
children: C ? `${
|
|
272
|
+
}), /* @__PURE__ */ W("span", {
|
|
273
|
+
className: c(D?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", X.typeText),
|
|
274
|
+
children: C ? `${te} · ${C}` : te
|
|
305
275
|
})]
|
|
306
|
-
}),
|
|
276
|
+
}), ue = () => {
|
|
307
277
|
m && p ? p(k) : r && r(k);
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
N && /* @__PURE__ */
|
|
278
|
+
}, de = /* @__PURE__ */ G(U, { children: [
|
|
279
|
+
ce,
|
|
280
|
+
le,
|
|
281
|
+
N && /* @__PURE__ */ W("div", {
|
|
312
282
|
role: "progressbar",
|
|
313
283
|
"aria-label": w,
|
|
314
|
-
className: c("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded",
|
|
315
|
-
children: /* @__PURE__ */
|
|
284
|
+
className: c("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded", X.track),
|
|
285
|
+
children: /* @__PURE__ */ W(y, { size: 32 })
|
|
316
286
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ G("div", {
|
|
318
288
|
className: "absolute end-1 top-1 flex gap-1",
|
|
319
289
|
children: [
|
|
320
|
-
|
|
290
|
+
L && /* @__PURE__ */ W(Ue, {
|
|
321
291
|
ariaLabel: v,
|
|
322
292
|
errorTitle: I,
|
|
323
293
|
errorDescId: F,
|
|
324
294
|
onClick: l,
|
|
325
295
|
id: k
|
|
326
296
|
}),
|
|
327
|
-
|
|
297
|
+
ne && /* @__PURE__ */ W(He, {
|
|
328
298
|
ariaLabel: b,
|
|
329
299
|
errorTitle: I,
|
|
330
300
|
errorDescId: F,
|
|
331
301
|
onClick: i,
|
|
332
302
|
id: k
|
|
333
303
|
}),
|
|
334
|
-
d && /* @__PURE__ */
|
|
304
|
+
d && /* @__PURE__ */ W(We, {
|
|
335
305
|
ariaLabel: S,
|
|
336
306
|
errorTitle: I,
|
|
337
307
|
errorDescId: F,
|
|
338
|
-
onClick:
|
|
308
|
+
onClick: oe
|
|
339
309
|
}),
|
|
340
|
-
h && /* @__PURE__ */
|
|
310
|
+
h && /* @__PURE__ */ W(Ge, {
|
|
341
311
|
ariaLabel: x,
|
|
342
312
|
errorTitle: I,
|
|
343
313
|
errorDescId: F,
|
|
@@ -346,7 +316,7 @@ var q = {
|
|
|
346
316
|
})
|
|
347
317
|
]
|
|
348
318
|
}),
|
|
349
|
-
P && /* @__PURE__ */
|
|
319
|
+
P && /* @__PURE__ */ W("span", {
|
|
350
320
|
id: F,
|
|
351
321
|
role: "status",
|
|
352
322
|
"aria-live": "polite",
|
|
@@ -354,28 +324,28 @@ var q = {
|
|
|
354
324
|
children: I
|
|
355
325
|
})
|
|
356
326
|
] });
|
|
357
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ W("div", {
|
|
358
328
|
style: f,
|
|
359
329
|
className: c("inline-flex", O),
|
|
360
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ W("div", {
|
|
361
331
|
role: "button",
|
|
362
332
|
tabIndex: 0,
|
|
363
333
|
"aria-label": v,
|
|
364
334
|
"aria-busy": N,
|
|
365
|
-
onClick:
|
|
366
|
-
onKeyDown:
|
|
335
|
+
onClick: ue,
|
|
336
|
+
onKeyDown: ae,
|
|
367
337
|
style: f,
|
|
368
|
-
className: c(
|
|
369
|
-
children:
|
|
338
|
+
className: c(se, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
339
|
+
children: de
|
|
370
340
|
})
|
|
371
341
|
});
|
|
372
|
-
},
|
|
342
|
+
}, Je = /* @__PURE__ */ function(e) {
|
|
373
343
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
374
|
-
}({}),
|
|
375
|
-
let n =
|
|
376
|
-
return
|
|
344
|
+
}({}), Ye = ({ enabled: e, src: t }) => {
|
|
345
|
+
let n = ye(null), [r, i] = H("idle");
|
|
346
|
+
return B(() => {
|
|
377
347
|
i(e && t ? "loading" : "idle");
|
|
378
|
-
}, [e, t]),
|
|
348
|
+
}, [e, t]), B(() => {
|
|
379
349
|
let r = n.current;
|
|
380
350
|
if (!r || !e || !t) return;
|
|
381
351
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -386,15 +356,15 @@ var q = {
|
|
|
386
356
|
imageRef: n,
|
|
387
357
|
imageLoadStatus: r
|
|
388
358
|
};
|
|
389
|
-
},
|
|
390
|
-
let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment" } = i ?? {}, { className: y } = l ?? {}, { id: b, name: x } = e, S = e.previewUrl ?? e.url, C = e.type === t.Pasted && n !== void 0, { isLoading: w, isError: T, isImage: E } =
|
|
359
|
+
}, Xe = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: l, isSelected: u }) => {
|
|
360
|
+
let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment" } = i ?? {}, { className: y } = l ?? {}, { id: b, name: x } = e, S = e.previewUrl ?? e.url, C = e.type === t.Pasted && n !== void 0, { isLoading: w, isError: T, isImage: E } = V(() => Be(e), [e]), D = r !== void 0 && !C && !w && !T, { imageRef: O, imageLoadStatus: k } = Ye({
|
|
391
361
|
enabled: E,
|
|
392
362
|
src: S
|
|
393
363
|
}), A = () => {
|
|
394
364
|
C && n ? n(b) : D && r && r(b);
|
|
395
365
|
};
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
className: c(
|
|
366
|
+
return /* @__PURE__ */ W("div", {
|
|
367
|
+
className: c(Ve, "group/attachment-tile", D && "cursor-pointer", X.tile, u && X.selected, y, Y.tile, u && Y.tileSelected),
|
|
398
368
|
onClick: A,
|
|
399
369
|
onKeyDown: (e) => {
|
|
400
370
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), A());
|
|
@@ -403,48 +373,48 @@ var q = {
|
|
|
403
373
|
role: "button",
|
|
404
374
|
style: o,
|
|
405
375
|
"aria-label": D ? d : C ? m : void 0,
|
|
406
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ G("div", {
|
|
407
377
|
className: "relative h-full w-full overflow-hidden",
|
|
408
378
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ G("div", {
|
|
410
380
|
className: "absolute end-1 top-1 z-10 flex gap-1",
|
|
411
|
-
children: [a && /* @__PURE__ */
|
|
381
|
+
children: [a && /* @__PURE__ */ W(Ge, {
|
|
412
382
|
ariaLabel: h,
|
|
413
383
|
onClick: a,
|
|
414
384
|
id: b,
|
|
415
|
-
className:
|
|
416
|
-
}), s && /* @__PURE__ */
|
|
385
|
+
className: X.imageActionButton
|
|
386
|
+
}), s && /* @__PURE__ */ W(Ue, {
|
|
417
387
|
ariaLabel: g,
|
|
418
388
|
onClick: s,
|
|
419
389
|
id: b,
|
|
420
|
-
className:
|
|
390
|
+
className: X.imageActionButton
|
|
421
391
|
})]
|
|
422
392
|
}),
|
|
423
|
-
k !==
|
|
393
|
+
k !== Je.Loaded && /* @__PURE__ */ W(_, {
|
|
424
394
|
variant: v.Rectangular,
|
|
425
395
|
width: "100%",
|
|
426
396
|
height: "100%",
|
|
427
|
-
active: k ===
|
|
428
|
-
overlay: /* @__PURE__ */
|
|
397
|
+
active: k === Je.Loading,
|
|
398
|
+
overlay: /* @__PURE__ */ W(fe, {
|
|
429
399
|
size: f.LG,
|
|
430
|
-
className:
|
|
400
|
+
className: X.typeText,
|
|
431
401
|
"aria-hidden": !0,
|
|
432
402
|
stroke: p
|
|
433
403
|
}),
|
|
434
404
|
className: "absolute inset-0 rounded-xl"
|
|
435
405
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ W("img", {
|
|
437
407
|
ref: O,
|
|
438
408
|
src: S,
|
|
439
409
|
alt: x,
|
|
440
410
|
loading: "lazy",
|
|
441
411
|
decoding: "async",
|
|
442
|
-
className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200", k ===
|
|
412
|
+
className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200", k === Je.Loaded ? "opacity-100" : "opacity-0")
|
|
443
413
|
})
|
|
444
414
|
]
|
|
445
415
|
})
|
|
446
416
|
});
|
|
447
|
-
},
|
|
417
|
+
}, Ze = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: c, labels: l, styles: u, isSelected: d }) => {
|
|
448
418
|
let { colors: f } = u ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = s({
|
|
449
419
|
"--ai-tile-bg": f?.background,
|
|
450
420
|
"--ai-tile-border": f?.border,
|
|
@@ -461,8 +431,8 @@ var q = {
|
|
|
461
431
|
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
462
432
|
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
463
433
|
"--ai-tile-progress-track": f?.trackBackground
|
|
464
|
-
}), { isImage: g, isLink: _ } =
|
|
465
|
-
return g ? /* @__PURE__ */
|
|
434
|
+
}), { isImage: g, isLink: _ } = V(() => Be(e), [e]);
|
|
435
|
+
return g ? /* @__PURE__ */ W(Xe, {
|
|
466
436
|
attachment: e,
|
|
467
437
|
labels: l,
|
|
468
438
|
onClick: o,
|
|
@@ -472,7 +442,7 @@ var q = {
|
|
|
472
442
|
cssVars: h,
|
|
473
443
|
onDownload: c,
|
|
474
444
|
isSelected: d
|
|
475
|
-
}) : /* @__PURE__ */
|
|
445
|
+
}) : /* @__PURE__ */ W(qe, {
|
|
476
446
|
attachment: e,
|
|
477
447
|
searchQuery: n,
|
|
478
448
|
onClick: o,
|
|
@@ -488,7 +458,7 @@ var q = {
|
|
|
488
458
|
isExpandable: m,
|
|
489
459
|
isSelected: d
|
|
490
460
|
});
|
|
491
|
-
},
|
|
461
|
+
}, Qe = (e) => {
|
|
492
462
|
let t = l(e);
|
|
493
463
|
if (!e?.length) return t;
|
|
494
464
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -503,16 +473,16 @@ var q = {
|
|
|
503
473
|
contentType: t
|
|
504
474
|
} : e;
|
|
505
475
|
});
|
|
506
|
-
},
|
|
476
|
+
}, $e = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i }) => /* @__PURE__ */ W(r, {
|
|
507
477
|
language: t?.replace(/^language-/, "") ?? "",
|
|
508
478
|
value: typeof e == "string" ? e : String(e ?? ""),
|
|
509
479
|
codeClassName: n,
|
|
510
|
-
containerClassName: c(
|
|
480
|
+
containerClassName: c(J.codeBlock, n),
|
|
511
481
|
copyLabel: i,
|
|
512
482
|
hideDownload: !0
|
|
513
|
-
}),
|
|
514
|
-
let r = "mb-1.5 last:mb-0", a = c(t?.headingClassName ?? "dial-small-semi-text",
|
|
515
|
-
return /* @__PURE__ */
|
|
483
|
+
}), et = _e(({ content: e, typography: t, copyAriaLabel: n = "Copy" }) => {
|
|
484
|
+
let r = "mb-1.5 last:mb-0", a = c(t?.headingClassName ?? "dial-small-semi-text", J.stageContent, r);
|
|
485
|
+
return /* @__PURE__ */ W(i, {
|
|
516
486
|
content: e,
|
|
517
487
|
classNames: {
|
|
518
488
|
h1: a,
|
|
@@ -521,100 +491,100 @@ var q = {
|
|
|
521
491
|
h4: a,
|
|
522
492
|
h5: a,
|
|
523
493
|
h6: a,
|
|
524
|
-
p: c(t?.contentClassName ?? "dial-tiny-text",
|
|
525
|
-
ul: c(t?.contentClassName ?? "dial-tiny-text",
|
|
526
|
-
ol: c(t?.contentClassName ?? "dial-tiny-text",
|
|
527
|
-
strong: c(t?.strongClassName ?? t?.contentClassName ?? "dial-tiny-text",
|
|
528
|
-
codeInline:
|
|
529
|
-
blockquote: c(t?.contentClassName ?? "dial-tiny-text",
|
|
530
|
-
link: c(t?.contentClassName ?? "dial-tiny-text",
|
|
531
|
-
tableCell: c(t?.contentClassName ?? "dial-tiny-text",
|
|
494
|
+
p: c(t?.contentClassName ?? "dial-tiny-text", J.stageContent, "mb-1.5"),
|
|
495
|
+
ul: c(t?.contentClassName ?? "dial-tiny-text", J.stageContent, r),
|
|
496
|
+
ol: c(t?.contentClassName ?? "dial-tiny-text", J.stageContent, r),
|
|
497
|
+
strong: c(t?.strongClassName ?? t?.contentClassName ?? "dial-tiny-text", J.stageContent),
|
|
498
|
+
codeInline: J.codeInline,
|
|
499
|
+
blockquote: c(t?.contentClassName ?? "dial-tiny-text", J.blockquote, r),
|
|
500
|
+
link: c(t?.contentClassName ?? "dial-tiny-text", J.stageContent),
|
|
501
|
+
tableCell: c(t?.contentClassName ?? "dial-tiny-text", J.tableCell)
|
|
532
502
|
},
|
|
533
|
-
components: { code: ({ children: e, className: r }) => r?.includes("language-") ? /* @__PURE__ */
|
|
503
|
+
components: { code: ({ children: e, className: r }) => r?.includes("language-") ? /* @__PURE__ */ W($e, {
|
|
534
504
|
codeClassName: r,
|
|
535
505
|
blockClassName: t?.codeBlockClassName,
|
|
536
506
|
copyAriaLabel: n,
|
|
537
507
|
children: e
|
|
538
|
-
}) : /* @__PURE__ */
|
|
539
|
-
className: c("px-1 py-0.5", t?.codeClassName ?? "dial-tiny-text rounded-md",
|
|
508
|
+
}) : /* @__PURE__ */ W("code", {
|
|
509
|
+
className: c("px-1 py-0.5", t?.codeClassName ?? "dial-tiny-text rounded-md", J.codeInline),
|
|
540
510
|
children: e
|
|
541
511
|
}) }
|
|
542
512
|
});
|
|
543
|
-
}),
|
|
544
|
-
let r =
|
|
513
|
+
}), tt = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
|
|
514
|
+
let r = z((t) => {
|
|
545
515
|
let r = e.find((e) => e.id === t);
|
|
546
516
|
r && n?.(r);
|
|
547
517
|
}, [e, n]);
|
|
548
|
-
return /* @__PURE__ */
|
|
518
|
+
return /* @__PURE__ */ W("div", {
|
|
549
519
|
role: "list",
|
|
550
520
|
className: "flex flex-wrap gap-3",
|
|
551
|
-
children: e.map((e) => /* @__PURE__ */
|
|
521
|
+
children: e.map((e) => /* @__PURE__ */ W("div", {
|
|
552
522
|
role: "listitem",
|
|
553
|
-
children: /* @__PURE__ */
|
|
523
|
+
children: /* @__PURE__ */ W(Ze, {
|
|
554
524
|
attachment: e,
|
|
555
525
|
onClick: n && r,
|
|
556
526
|
labels: { clickLabel: t }
|
|
557
527
|
})
|
|
558
528
|
}, e.id))
|
|
559
529
|
});
|
|
560
|
-
},
|
|
561
|
-
let [f, p] =
|
|
530
|
+
}, nt = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a, childList: s, isExpanded: l, onToggle: u }) => {
|
|
531
|
+
let [f, p] = H(!1), m = l ?? f, g = z((e) => {
|
|
562
532
|
l === void 0 && p(e), u?.(e);
|
|
563
|
-
}, [l, u]), { copyAriaLabel: _ = "Copy stage content", runningAriaLabel: v, failedAriaLabel: y, attachmentClickLabel: b = "Preview search result" } = r ?? {}, x =
|
|
564
|
-
/* @__PURE__ */
|
|
533
|
+
}, [l, u]), { copyAriaLabel: _ = "Copy stage content", runningAriaLabel: v, failedAriaLabel: y, attachmentClickLabel: b = "Preview search result" } = r ?? {}, x = V(() => Qe(e.attachments), [e.attachments]), { name: S, durationLabel: C } = q(e.name), w = i ?? S, T = !i && Te(S), E = e.status === o.Failed, D = !!e.content || !!e.attachments?.length, O = D || s != null, k = /* @__PURE__ */ G(U, { children: [
|
|
534
|
+
/* @__PURE__ */ W("span", {
|
|
565
535
|
className: "flex flex-none items-center",
|
|
566
|
-
children: /* @__PURE__ */
|
|
536
|
+
children: /* @__PURE__ */ W(Pe, {
|
|
567
537
|
status: e.status,
|
|
568
538
|
isLive: t,
|
|
569
539
|
runningLabel: v,
|
|
570
540
|
failedLabel: y
|
|
571
541
|
})
|
|
572
542
|
}),
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
className: c("min-w-0 max-w-[22rem] truncate", n?.fontClassName ?? "dial-small-text",
|
|
575
|
-
children: /* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ W("span", {
|
|
544
|
+
className: c("min-w-0 max-w-[22rem] truncate", n?.fontClassName ?? "dial-small-text", J.stageName, E && J.stageNameFailed, T && J.monoName),
|
|
545
|
+
children: /* @__PURE__ */ W(h, { text: w || e.status || "" })
|
|
576
546
|
}),
|
|
577
|
-
e.tag && /* @__PURE__ */
|
|
578
|
-
className: c("flex-none", n?.tagClassName ?? "dial-tiny-lead-text",
|
|
547
|
+
e.tag && /* @__PURE__ */ W("span", {
|
|
548
|
+
className: c("flex-none", n?.tagClassName ?? "dial-tiny-lead-text", J.tag),
|
|
579
549
|
children: e.tag
|
|
580
550
|
}),
|
|
581
|
-
C && /* @__PURE__ */
|
|
582
|
-
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text",
|
|
551
|
+
C && /* @__PURE__ */ W("span", {
|
|
552
|
+
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", J.duration),
|
|
583
553
|
children: C
|
|
584
554
|
})
|
|
585
555
|
] });
|
|
586
|
-
return O ? /* @__PURE__ */
|
|
556
|
+
return O ? /* @__PURE__ */ G(d, {
|
|
587
557
|
expanded: m,
|
|
588
558
|
onToggle: g,
|
|
589
|
-
title: /* @__PURE__ */
|
|
559
|
+
title: /* @__PURE__ */ W("span", {
|
|
590
560
|
className: "flex min-w-0 items-center gap-2",
|
|
591
561
|
children: k
|
|
592
562
|
}),
|
|
593
|
-
className:
|
|
594
|
-
headerClassName: c(
|
|
595
|
-
contentClassName: c("-mt-1 flex min-w-0 flex-col gap-3 px-0 py-1",
|
|
596
|
-
children: [m && D && /* @__PURE__ */
|
|
563
|
+
className: je,
|
|
564
|
+
headerClassName: c(Me, J.row, J.stageHeader),
|
|
565
|
+
contentClassName: c("-mt-1 flex min-w-0 flex-col gap-3 px-0 py-1", J.stageRegion),
|
|
566
|
+
children: [m && D && /* @__PURE__ */ G("div", {
|
|
597
567
|
className: "flex min-w-0 flex-col gap-3 ps-8",
|
|
598
|
-
children: [e.content && /* @__PURE__ */
|
|
568
|
+
children: [e.content && /* @__PURE__ */ W("div", {
|
|
599
569
|
className: "max-h-[300px] min-w-0 overflow-y-auto",
|
|
600
|
-
children: /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ W(et, {
|
|
601
571
|
content: e.content,
|
|
602
572
|
typography: n,
|
|
603
573
|
copyAriaLabel: _
|
|
604
574
|
})
|
|
605
|
-
}), x.length > 0 && /* @__PURE__ */
|
|
575
|
+
}), x.length > 0 && /* @__PURE__ */ W(tt, {
|
|
606
576
|
attachments: x,
|
|
607
577
|
clickLabel: b,
|
|
608
578
|
onAttachmentClick: a
|
|
609
579
|
})]
|
|
610
580
|
}), m && s]
|
|
611
|
-
}) : /* @__PURE__ */
|
|
612
|
-
className: c("flex w-full items-center gap-2 px-2 py-1.5",
|
|
581
|
+
}) : /* @__PURE__ */ W("div", {
|
|
582
|
+
className: c("flex w-full items-center gap-2 px-2 py-1.5", J.row),
|
|
613
583
|
children: k
|
|
614
584
|
});
|
|
615
|
-
},
|
|
616
|
-
let c =
|
|
617
|
-
return /* @__PURE__ */
|
|
585
|
+
}, rt = (e) => e <= 3 ? "ps-4" : "ps-0", it = (e) => e <= 3 ? "ps-6" : "ps-0", at = ({ node: e, depth: t, nameOverride: n, isStreaming: r, expansion: i, typography: a, labels: o, onAttachmentClick: s }) => {
|
|
586
|
+
let c = ke(e.stage.index), l = t + 1;
|
|
587
|
+
return /* @__PURE__ */ W(nt, {
|
|
618
588
|
stage: e.stage,
|
|
619
589
|
nameOverride: n,
|
|
620
590
|
isLive: r && e.stage.status == null,
|
|
@@ -623,10 +593,10 @@ var q = {
|
|
|
623
593
|
onAttachmentClick: s,
|
|
624
594
|
isExpanded: i.isExpanded(c),
|
|
625
595
|
onToggle: (e) => i.onToggle(c, e),
|
|
626
|
-
childList: e.children.length > 0 ? /* @__PURE__ */
|
|
596
|
+
childList: e.children.length > 0 ? /* @__PURE__ */ W(st, {
|
|
627
597
|
nodes: e.children,
|
|
628
598
|
depth: l,
|
|
629
|
-
className:
|
|
599
|
+
className: rt(l),
|
|
630
600
|
isStreaming: r,
|
|
631
601
|
expansion: i,
|
|
632
602
|
typography: a,
|
|
@@ -634,51 +604,47 @@ var q = {
|
|
|
634
604
|
onAttachmentClick: s
|
|
635
605
|
}) : void 0
|
|
636
606
|
});
|
|
637
|
-
},
|
|
607
|
+
}, ot = ({ row: e, depth: t, isStreaming: n, expansion: r, typography: i, labels: a, onAttachmentClick: s }) => {
|
|
638
608
|
let { runningAriaLabel: l, failedAriaLabel: u, attemptLabel: f = (e) => `Attempt ${e}` } = a ?? {}, p = e.attempts ?? [], m = p.some((e) => e.stage.status == null), g = p.some((e) => e.stage.status === o.Failed), _ = o.Completed;
|
|
639
609
|
m ? _ = null : g && (_ = o.Failed);
|
|
640
|
-
let v =
|
|
641
|
-
return /* @__PURE__ */
|
|
642
|
-
title: /* @__PURE__ */
|
|
610
|
+
let v = Ae(e.key), y = r.isExpanded(v), b = t + 1;
|
|
611
|
+
return /* @__PURE__ */ W(d, {
|
|
612
|
+
title: /* @__PURE__ */ G("span", {
|
|
643
613
|
className: "flex min-w-0 items-center gap-2",
|
|
644
614
|
children: [
|
|
645
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ W("span", {
|
|
646
616
|
className: "flex flex-none items-center",
|
|
647
|
-
children: /* @__PURE__ */
|
|
617
|
+
children: /* @__PURE__ */ W(Pe, {
|
|
648
618
|
status: _,
|
|
649
619
|
isLive: n && m,
|
|
650
620
|
runningLabel: l,
|
|
651
621
|
failedLabel: u
|
|
652
622
|
})
|
|
653
623
|
}),
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
className: c("min-w-0 max-w-[22rem] truncate", i?.fontClassName ?? "dial-small-text",
|
|
656
|
-
children: /* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ W("span", {
|
|
625
|
+
className: c("min-w-0 max-w-[22rem] truncate", i?.fontClassName ?? "dial-small-text", J.stageName, g && J.stageNameFailed),
|
|
626
|
+
children: /* @__PURE__ */ W(h, { text: e.name })
|
|
657
627
|
}),
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text",
|
|
628
|
+
/* @__PURE__ */ G("span", {
|
|
629
|
+
className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text", J.count),
|
|
660
630
|
children: ["×", p.length]
|
|
661
|
-
}),
|
|
662
|
-
y && /* @__PURE__ */ G("span", {
|
|
663
|
-
className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text", Y.duration),
|
|
664
|
-
children: y
|
|
665
631
|
})
|
|
666
632
|
]
|
|
667
633
|
}),
|
|
668
|
-
expanded:
|
|
669
|
-
onToggle: (e) => r.onToggle(
|
|
670
|
-
className:
|
|
671
|
-
headerClassName: c(
|
|
672
|
-
contentClassName: c("-mt-2 min-w-0 px-0",
|
|
673
|
-
children: /* @__PURE__ */
|
|
634
|
+
expanded: y,
|
|
635
|
+
onToggle: (e) => r.onToggle(v, e),
|
|
636
|
+
className: je,
|
|
637
|
+
headerClassName: c(Me, J.collapseButton, J.row, J.stageHeader),
|
|
638
|
+
contentClassName: c("-mt-2 min-w-0 px-0", it(b), J.stageRegion),
|
|
639
|
+
children: /* @__PURE__ */ W("ul", {
|
|
674
640
|
role: "list",
|
|
675
641
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
676
|
-
children:
|
|
642
|
+
children: y && p.map((e, t) => /* @__PURE__ */ W("li", {
|
|
677
643
|
role: "listitem",
|
|
678
644
|
className: "min-w-0",
|
|
679
|
-
children: /* @__PURE__ */
|
|
645
|
+
children: /* @__PURE__ */ W(at, {
|
|
680
646
|
node: e,
|
|
681
|
-
depth:
|
|
647
|
+
depth: b,
|
|
682
648
|
nameOverride: f(t + 1),
|
|
683
649
|
isStreaming: n,
|
|
684
650
|
expansion: r,
|
|
@@ -689,23 +655,23 @@ var q = {
|
|
|
689
655
|
}, e.stage.index))
|
|
690
656
|
})
|
|
691
657
|
});
|
|
692
|
-
},
|
|
658
|
+
}, st = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */ W("ul", {
|
|
693
659
|
role: "list",
|
|
694
660
|
className: c("flex min-w-0 flex-col gap-0.5", n),
|
|
695
|
-
children:
|
|
661
|
+
children: Ne(e).map((e) => /* @__PURE__ */ W("li", {
|
|
696
662
|
role: "listitem",
|
|
697
663
|
className: "min-w-0",
|
|
698
|
-
children: e.node ? /* @__PURE__ */
|
|
664
|
+
children: e.node ? /* @__PURE__ */ W(at, {
|
|
699
665
|
node: e.node,
|
|
700
666
|
depth: t,
|
|
701
667
|
...r
|
|
702
|
-
}) : /* @__PURE__ */
|
|
668
|
+
}) : /* @__PURE__ */ W(ot, {
|
|
703
669
|
row: e,
|
|
704
670
|
depth: t,
|
|
705
671
|
...r
|
|
706
672
|
})
|
|
707
673
|
}, e.key))
|
|
708
|
-
}),
|
|
674
|
+
}), Q = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a, expansion: o }) => {
|
|
709
675
|
let { colors: l, typography: u } = r ?? {}, d = s({
|
|
710
676
|
"--cs-text": l?.text,
|
|
711
677
|
"--cs-row-hover": l?.rowHoverColor,
|
|
@@ -722,11 +688,11 @@ var q = {
|
|
|
722
688
|
"--cs-code-border": l?.codeBorderColor,
|
|
723
689
|
"--cs-code-text": l?.codeTextColor,
|
|
724
690
|
"--cs-border": l?.borderColor
|
|
725
|
-
}), f =
|
|
726
|
-
return /* @__PURE__ */
|
|
691
|
+
}), f = V(() => Oe(e), [e]);
|
|
692
|
+
return /* @__PURE__ */ W("div", {
|
|
727
693
|
style: d,
|
|
728
|
-
className: c("w-full min-w-0",
|
|
729
|
-
children: /* @__PURE__ */
|
|
694
|
+
className: c("w-full min-w-0", J.panel, n, K.panel),
|
|
695
|
+
children: /* @__PURE__ */ W(st, {
|
|
730
696
|
nodes: f,
|
|
731
697
|
depth: 0,
|
|
732
698
|
className: "w-full ps-5",
|
|
@@ -737,37 +703,35 @@ var q = {
|
|
|
737
703
|
onAttachmentClick: a
|
|
738
704
|
})
|
|
739
705
|
});
|
|
740
|
-
},
|
|
741
|
-
let t =
|
|
742
|
-
return /* @__PURE__ */
|
|
706
|
+
}, ct = (e) => {
|
|
707
|
+
let t = be();
|
|
708
|
+
return /* @__PURE__ */ W(Q, {
|
|
743
709
|
...e,
|
|
744
710
|
expansion: t
|
|
745
711
|
});
|
|
746
712
|
}, $ = {
|
|
747
|
-
toggleButton: "
|
|
748
|
-
groupRegion: "
|
|
749
|
-
executedLabel: "
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
H(() => {
|
|
713
|
+
toggleButton: "_toggleButton_16fae_7",
|
|
714
|
+
groupRegion: "_groupRegion_16fae_28",
|
|
715
|
+
executedLabel: "_executedLabel_16fae_32",
|
|
716
|
+
doneIcon: "_doneIcon_16fae_36",
|
|
717
|
+
failedText: "_failedText_16fae_40",
|
|
718
|
+
liveName: "_liveName_16fae_44"
|
|
719
|
+
}, lt = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a }) => {
|
|
720
|
+
let { executedLabel: l = "Executed", stepsLabel: u = () => "steps", failedCountLabel: m = (e) => `${e} failed`, runningAriaLabel: g = "Running", copyAriaLabel: _, failedAriaLabel: v, attemptLabel: b, attachmentClickLabel: x } = n ?? {}, [C, w] = H(t), T = be(), { reset: E } = T, D = e.length > 1;
|
|
721
|
+
B(() => {
|
|
757
722
|
D && !C && E();
|
|
758
723
|
}, [
|
|
759
724
|
D,
|
|
760
725
|
C,
|
|
761
726
|
E
|
|
762
727
|
]);
|
|
763
|
-
let O =
|
|
764
|
-
|
|
728
|
+
let O = ye(t);
|
|
729
|
+
B(() => {
|
|
765
730
|
O.current && !t && w(!1), O.current = t;
|
|
766
731
|
}, [t]);
|
|
767
732
|
let { colors: k, panel: A } = i ?? {}, j = i?.typography ?? { fontClassName: "dial-small-text" }, M = s({
|
|
768
733
|
"--cs-cg-label": k?.labelColor,
|
|
769
734
|
"--cs-cg-label-hover": k?.labelHoverColor,
|
|
770
|
-
"--cs-cg-steps-count": k?.stepsCountColor,
|
|
771
735
|
"--cs-cg-done": k?.doneColor,
|
|
772
736
|
"--cs-cg-failed": k?.failedColor,
|
|
773
737
|
"--cs-text": A?.text,
|
|
@@ -794,7 +758,7 @@ var q = {
|
|
|
794
758
|
attemptLabel: b,
|
|
795
759
|
attachmentClickLabel: x
|
|
796
760
|
};
|
|
797
|
-
if (e.length === 1) return /* @__PURE__ */
|
|
761
|
+
if (e.length === 1) return /* @__PURE__ */ W(Q, {
|
|
798
762
|
stages: e,
|
|
799
763
|
isStreaming: t,
|
|
800
764
|
expansion: T,
|
|
@@ -806,59 +770,29 @@ var q = {
|
|
|
806
770
|
labels: N,
|
|
807
771
|
onAttachmentClick: a
|
|
808
772
|
});
|
|
809
|
-
let P = e.some((e) => e.status === o.Failed), F
|
|
773
|
+
let P = e.some((e) => e.status === o.Failed), F;
|
|
810
774
|
if (t) {
|
|
811
|
-
let t =
|
|
812
|
-
|
|
775
|
+
let t = q((Ee(e) ?? e[e.length - 1]).name).name;
|
|
776
|
+
F = /* @__PURE__ */ G("span", {
|
|
813
777
|
role: "status",
|
|
814
778
|
"aria-live": "polite",
|
|
815
779
|
className: "flex min-w-0 items-center gap-2",
|
|
816
|
-
children: [/* @__PURE__ */
|
|
780
|
+
children: [/* @__PURE__ */ W("span", {
|
|
817
781
|
className: "flex flex-none items-center",
|
|
818
|
-
children: /* @__PURE__ */
|
|
782
|
+
children: /* @__PURE__ */ W(y, {
|
|
819
783
|
size: 14,
|
|
820
784
|
ariaLabel: g
|
|
821
785
|
})
|
|
822
|
-
}), t && /* @__PURE__ */
|
|
786
|
+
}), t && /* @__PURE__ */ W("span", {
|
|
823
787
|
className: c("min-w-0 max-w-[22rem] truncate", j.fontClassName, $.liveName),
|
|
824
|
-
children: /* @__PURE__ */
|
|
788
|
+
children: /* @__PURE__ */ W(h, { text: t })
|
|
825
789
|
})]
|
|
826
790
|
});
|
|
827
791
|
} else if (P) {
|
|
828
792
|
let t = e.filter((e) => e.status === o.Failed).length;
|
|
829
|
-
|
|
793
|
+
F = /* @__PURE__ */ G("span", {
|
|
830
794
|
className: "inline-flex items-center gap-1",
|
|
831
|
-
children: [
|
|
832
|
-
/* @__PURE__ */ K("span", {
|
|
833
|
-
className: c(j.fontClassName, $.executedLabel),
|
|
834
|
-
children: [
|
|
835
|
-
l,
|
|
836
|
-
" ",
|
|
837
|
-
e.length,
|
|
838
|
-
" ",
|
|
839
|
-
u(e.length)
|
|
840
|
-
]
|
|
841
|
-
}),
|
|
842
|
-
/* @__PURE__ */ G("span", {
|
|
843
|
-
className: c(j.fontClassName, $.failedText),
|
|
844
|
-
children: m(t)
|
|
845
|
-
}),
|
|
846
|
-
I && /* @__PURE__ */ G("span", {
|
|
847
|
-
className: c(j.fontClassName, $.stepsCount),
|
|
848
|
-
children: I
|
|
849
|
-
})
|
|
850
|
-
]
|
|
851
|
-
});
|
|
852
|
-
} else L = /* @__PURE__ */ K("span", {
|
|
853
|
-
className: "inline-flex items-center gap-1",
|
|
854
|
-
children: [
|
|
855
|
-
/* @__PURE__ */ G(S, {
|
|
856
|
-
size: f.SM,
|
|
857
|
-
className: $.doneIcon,
|
|
858
|
-
"aria-hidden": !0,
|
|
859
|
-
stroke: p
|
|
860
|
-
}),
|
|
861
|
-
/* @__PURE__ */ K("span", {
|
|
795
|
+
children: [/* @__PURE__ */ G("span", {
|
|
862
796
|
className: c(j.fontClassName, $.executedLabel),
|
|
863
797
|
children: [
|
|
864
798
|
l,
|
|
@@ -867,24 +801,40 @@ var q = {
|
|
|
867
801
|
" ",
|
|
868
802
|
u(e.length)
|
|
869
803
|
]
|
|
870
|
-
}),
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
804
|
+
}), /* @__PURE__ */ W("span", {
|
|
805
|
+
className: c(j.fontClassName, $.failedText),
|
|
806
|
+
children: m(t)
|
|
807
|
+
})]
|
|
808
|
+
});
|
|
809
|
+
} else F = /* @__PURE__ */ G("span", {
|
|
810
|
+
className: "inline-flex items-center gap-1",
|
|
811
|
+
children: [/* @__PURE__ */ W(S, {
|
|
812
|
+
size: f.SM,
|
|
813
|
+
className: $.doneIcon,
|
|
814
|
+
"aria-hidden": !0,
|
|
815
|
+
stroke: p
|
|
816
|
+
}), /* @__PURE__ */ G("span", {
|
|
817
|
+
className: c(j.fontClassName, $.executedLabel),
|
|
818
|
+
children: [
|
|
819
|
+
l,
|
|
820
|
+
" ",
|
|
821
|
+
e.length,
|
|
822
|
+
" ",
|
|
823
|
+
u(e.length)
|
|
824
|
+
]
|
|
825
|
+
})]
|
|
876
826
|
});
|
|
877
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ W("div", {
|
|
878
828
|
style: M,
|
|
879
|
-
className: c("flex w-full flex-col gap-1", r,
|
|
880
|
-
children: /* @__PURE__ */
|
|
881
|
-
title:
|
|
829
|
+
className: c("flex w-full flex-col gap-1", r, K.group),
|
|
830
|
+
children: /* @__PURE__ */ W(d, {
|
|
831
|
+
title: F,
|
|
882
832
|
expanded: C,
|
|
883
833
|
onToggle: w,
|
|
884
834
|
className: "overflow-visible py-0",
|
|
885
|
-
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton,
|
|
835
|
+
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton, K.groupToggle),
|
|
886
836
|
contentClassName: c("-mt-2 px-0", $.groupRegion),
|
|
887
|
-
children: C && /* @__PURE__ */
|
|
837
|
+
children: C && /* @__PURE__ */ W(Q, {
|
|
888
838
|
stages: e,
|
|
889
839
|
isStreaming: t,
|
|
890
840
|
expansion: T,
|
|
@@ -900,4 +850,4 @@ var q = {
|
|
|
900
850
|
});
|
|
901
851
|
};
|
|
902
852
|
//#endregion
|
|
903
|
-
export {
|
|
853
|
+
export { K as CONVERSATION_STAGES_CLASS, lt as CollapsedGroup, ct as StagesPanel };
|
|
@@ -6,8 +6,6 @@ export interface CollapsedGroupColors {
|
|
|
6
6
|
labelColor?: string;
|
|
7
7
|
/** Color of the toggle button label and icon on hover. */
|
|
8
8
|
labelHoverColor?: string;
|
|
9
|
-
/** Color of the execution time. */
|
|
10
|
-
stepsCountColor?: string;
|
|
11
9
|
/** Color of the leading check icon in the finished-and-successful summary. */
|
|
12
10
|
doneColor?: string;
|
|
13
11
|
/** Color of the "N failed" text in the failed summary. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsed-group.d.ts","sourceRoot":"","sources":["../../src/models/collapsed-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,
|
|
1
|
+
{"version":3,"file":"collapsed-group.d.ts","sourceRoot":"","sources":["../../src/models/collapsed-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IACvC,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,8CAA8C;IAC9C,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,4DAA4D;IAC5D,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACnD,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mHAAmH;IACnH,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,sHAAsH;IACtH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,8FAA8F;IAC9F,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,gHAAgH;IAChH,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-stages",
|
|
3
3
|
"description": "Panel for displaying agent processing stages during LLM response streaming",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.287",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-attachment-input": "1.2.0-dev.
|
|
21
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.287"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^19.2.8",
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.287",
|
|
26
26
|
"@epam/ai-dial-ui-kit": "^0.15.0-dev.36"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
package/utils/stage-name.d.ts
CHANGED
|
@@ -9,11 +9,5 @@ interface CleanedStageName {
|
|
|
9
9
|
export declare const cleanStageName: (rawName: string) => CleanedStageName;
|
|
10
10
|
/** Returns true if the name looks like a raw identifier: no whitespace and contains an underscore. */
|
|
11
11
|
export declare const isIdentifierLike: (name: string) => boolean;
|
|
12
|
-
/** Formats a total duration in seconds as `'Xm Ys'` when >= 60s, otherwise `'X.Xs'`. */
|
|
13
|
-
export declare const formatTotalDuration: (totalSeconds: number) => string;
|
|
14
|
-
/** Parses a duration label produced by {@link cleanStageName} (e.g. `'3.99s'`) back into seconds. */
|
|
15
|
-
export declare const parseDurationSeconds: (durationLabel: string | undefined) => number | undefined;
|
|
16
|
-
/** Returns the elapsed duration represented by stage names, without double-counting overlapping timed stages. */
|
|
17
|
-
export declare const calculateStagesDurationSeconds: (stageNames: string[]) => number;
|
|
18
12
|
export {};
|
|
19
13
|
//# sourceMappingURL=stage-name.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage-name.d.ts","sourceRoot":"","sources":["../../src/utils/stage-name.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stage-name.d.ts","sourceRoot":"","sources":["../../src/utils/stage-name.ts"],"names":[],"mappings":"AA+BA,+DAA+D;AAC/D,UAAU,gBAAgB;IACxB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAuBD,0HAA0H;AAC1H,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,gBAiBhD,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OACW,CAAC"}
|