chordia-ui 3.9.2 → 3.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/ChatMessage.cjs.js +5 -5
  2. package/dist/ChatMessage.cjs.js.map +1 -1
  3. package/dist/ChatMessage.es.js +583 -353
  4. package/dist/ChatMessage.es.js.map +1 -1
  5. package/dist/MessageThread.cjs.js +15 -0
  6. package/dist/MessageThread.cjs.js.map +1 -0
  7. package/dist/MessageThread.es.js +1868 -0
  8. package/dist/MessageThread.es.js.map +1 -0
  9. package/dist/PerformancePanel.cjs.js +1 -1
  10. package/dist/PerformancePanel.cjs.js.map +1 -1
  11. package/dist/PerformancePanel.es.js +587 -749
  12. package/dist/PerformancePanel.es.js.map +1 -1
  13. package/dist/components/chat.cjs.js +1 -27
  14. package/dist/components/chat.cjs.js.map +1 -1
  15. package/dist/components/chat.es.js +276 -1617
  16. package/dist/components/chat.es.js.map +1 -1
  17. package/dist/components/layout.cjs.js +2 -2
  18. package/dist/components/layout.cjs.js.map +1 -1
  19. package/dist/components/layout.es.js +289 -272
  20. package/dist/components/layout.es.js.map +1 -1
  21. package/dist/components/media.cjs.js +1 -1
  22. package/dist/components/media.cjs.js.map +1 -1
  23. package/dist/components/media.es.js +4 -4
  24. package/dist/components/media.es.js.map +1 -1
  25. package/dist/components/reports.cjs.js +2 -2
  26. package/dist/components/reports.cjs.js.map +1 -1
  27. package/dist/components/reports.es.js +18 -18
  28. package/dist/components/reports.es.js.map +1 -1
  29. package/dist/index.cjs.js +1 -1
  30. package/dist/index.es.js +8 -8
  31. package/package.json +1 -1
  32. package/src/components/chat/ChatHistoryPanel.jsx +740 -388
  33. package/src/components/chat/ChatInterface.jsx +3 -3
  34. package/src/components/chat/ChatMessage.jsx +338 -48
  35. package/src/components/chat/ChatWelcome.jsx +386 -0
  36. package/src/components/chat/ThinkingIndicator.jsx +121 -275
  37. package/src/components/chat/index.js +1 -0
  38. package/src/components/layout/SplitPane.jsx +21 -13
  39. package/src/components/media/InteractionSummaryCard.jsx +1 -1
  40. package/src/components/performance/PerformanceDetailsPage.jsx +51 -52
  41. package/src/components/performance/performanceRangeFormat.js +3 -2
  42. package/src/components/reports/ReportsDetails.jsx +2 -2
@@ -1,8 +1,8 @@
1
- import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
- import Z, { useRef as pt, useCallback as at, useState as gt } from "react";
3
- import { ResponsiveContainer as N, PieChart as ut, Pie as mt, Cell as nt, Tooltip as O, AreaChart as ft, CartesianGrid as q, XAxis as G, YAxis as V, Legend as J, Area as xt, LineChart as bt, Line as yt, BarChart as st, Bar as lt } from "recharts";
4
- import { Wrench as vt, Check as wt, Copy as St, PanelRightOpen as kt } from "lucide-react";
5
- const w = [
1
+ import { jsxs as y, jsx as e, Fragment as ye } from "react/jsx-runtime";
2
+ import re, { useRef as he, useCallback as ce, useState as G, useEffect as be } from "react";
3
+ import { ResponsiveContainer as N, PieChart as ve, Pie as we, Cell as ae, Tooltip as U, AreaChart as Se, CartesianGrid as Z, XAxis as J, YAxis as Q, Legend as ee, Area as ke, LineChart as Ce, Line as Ae, BarChart as de, Bar as pe } from "recharts";
4
+ import { Wrench as Re, Check as ge, Copy as ue, ThumbsUp as Be, ThumbsDown as ze, PanelRightOpen as Le } from "lucide-react";
5
+ const C = [
6
6
  "#5E88B0",
7
7
  // rail-discovery / rail-blue
8
8
  "#9B7AA8",
@@ -23,7 +23,7 @@ const w = [
23
23
  // rail-teal (warm gold)
24
24
  "#A8C76B"
25
25
  // green accent (complementary)
26
- ], ot = { fill: "var(--text-muted, #666)", fontSize: 12 }, I = { stroke: "var(--border, #e0e0e0)" }, Q = "var(--border, #e0e0e0)", F = {
26
+ ], se = { fill: "var(--text-muted, #666)", fontSize: 12 }, I = { stroke: "var(--border, #e0e0e0)" }, te = "var(--border, #e0e0e0)", X = {
27
27
  // pointerEvents: 'none' is critical — without it, the tooltip steals hover from chart elements
28
28
  // and flickers (especially noticeable on pie slices).
29
29
  // transition: 'none' disables Recharts' default position-slide animation, so the tooltip
@@ -34,7 +34,7 @@ const w = [
34
34
  outline: "none",
35
35
  transition: "none"
36
36
  }
37
- }, Ct = { color: "var(--text-ink, #1e2125)", fontSize: "12px" }, X = ({ active: d, payload: c, label: g }) => !d || !c || !c.length ? null : /* @__PURE__ */ y(
37
+ }, Te = { color: "var(--text-ink, #1e2125)", fontSize: "12px" }, K = ({ active: l, payload: d, label: c }) => !l || !d || !d.length ? null : /* @__PURE__ */ y(
38
38
  "div",
39
39
  {
40
40
  className: "chordia-chart-tooltip",
@@ -56,7 +56,7 @@ const w = [
56
56
  pointerEvents: "auto"
57
57
  },
58
58
  children: [
59
- /* @__PURE__ */ t("style", { children: `
59
+ /* @__PURE__ */ e("style", { children: `
60
60
  .chordia-chart-tooltip::-webkit-scrollbar { width: 8px; }
61
61
  .chordia-chart-tooltip::-webkit-scrollbar-track { background: transparent; }
62
62
  .chordia-chart-tooltip::-webkit-scrollbar-thumb {
@@ -67,7 +67,7 @@ const w = [
67
67
  background: rgba(52, 58, 64, 0.4);
68
68
  }
69
69
  ` }),
70
- g !== void 0 && g !== "" && /* @__PURE__ */ t(
70
+ c !== void 0 && c !== "" && /* @__PURE__ */ e(
71
71
  "div",
72
72
  {
73
73
  style: {
@@ -80,12 +80,12 @@ const w = [
80
80
  paddingBottom: 6,
81
81
  borderBottom: "1px solid rgba(52, 58, 64, 0.08)"
82
82
  },
83
- children: g
83
+ children: c
84
84
  }
85
85
  ),
86
- /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: c.map((a, i) => {
87
- var h;
88
- const u = a.color || ((h = a.payload) == null ? void 0 : h.fill) || "#9CA3AF";
86
+ /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: d.map((o, a) => {
87
+ var p;
88
+ const f = o.color || ((p = o.payload) == null ? void 0 : p.fill) || "#9CA3AF";
89
89
  return /* @__PURE__ */ y(
90
90
  "div",
91
91
  {
@@ -97,19 +97,19 @@ const w = [
97
97
  },
98
98
  children: [
99
99
  /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: [
100
- /* @__PURE__ */ t(
100
+ /* @__PURE__ */ e(
101
101
  "span",
102
102
  {
103
103
  style: {
104
104
  width: 8,
105
105
  height: 8,
106
106
  borderRadius: "50%",
107
- background: u,
107
+ background: f,
108
108
  flexShrink: 0
109
109
  }
110
110
  }
111
111
  ),
112
- /* @__PURE__ */ t(
112
+ /* @__PURE__ */ e(
113
113
  "span",
114
114
  {
115
115
  style: {
@@ -118,93 +118,93 @@ const w = [
118
118
  textOverflow: "ellipsis",
119
119
  whiteSpace: "nowrap"
120
120
  },
121
- children: a.name
121
+ children: o.name
122
122
  }
123
123
  )
124
124
  ] }),
125
- /* @__PURE__ */ t("span", { style: { color: "#111827", fontWeight: 600, marginLeft: 8 }, children: a.value })
125
+ /* @__PURE__ */ e("span", { style: { color: "#111827", fontWeight: 600, marginLeft: 8 }, children: o.value })
126
126
  ]
127
127
  },
128
- i
128
+ a
129
129
  );
130
130
  }) })
131
131
  ]
132
132
  }
133
- ), At = (d, c) => {
134
- if (!d)
133
+ ), Me = (l, d) => {
134
+ if (!l)
135
135
  return !1;
136
- const g = d.toLowerCase();
137
- return c.filter((i) => String(i).toLowerCase().includes(g)).length < c.length * 0.5;
138
- }, Bt = (d) => {
139
- const c = Array.from(d.querySelectorAll(".recharts-wrapper")), g = c.length ? c.reduce((h, k) => {
140
- const x = h.getBoundingClientRect(), o = k.getBoundingClientRect();
141
- return o.width * o.height > x.width * x.height ? k : h;
136
+ const c = l.toLowerCase();
137
+ return d.filter((a) => String(a).toLowerCase().includes(c)).length < d.length * 0.5;
138
+ }, $e = (l) => {
139
+ const d = Array.from(l.querySelectorAll(".recharts-wrapper")), c = d.length ? d.reduce((p, k) => {
140
+ const v = p.getBoundingClientRect(), g = k.getBoundingClientRect();
141
+ return g.width * g.height > v.width * v.height ? k : p;
142
142
  }) : null;
143
- if (g) {
144
- const h = g.querySelector("svg.recharts-surface");
145
- if (h) {
146
- const k = h.getBoundingClientRect();
143
+ if (c) {
144
+ const p = c.querySelector("svg.recharts-surface");
145
+ if (p) {
146
+ const k = p.getBoundingClientRect();
147
147
  if (k.width >= 100 && k.height >= 100)
148
- return h;
148
+ return p;
149
149
  }
150
150
  }
151
- const a = Array.from(d.querySelectorAll("svg"));
152
- if (!a.length)
151
+ const o = Array.from(l.querySelectorAll("svg"));
152
+ if (!o.length)
153
153
  return null;
154
- const i = a.reduce((h, k) => {
155
- const x = h.getBoundingClientRect(), o = k.getBoundingClientRect();
156
- return o.width * o.height > x.width * x.height ? k : h;
157
- }), u = i.getBoundingClientRect();
158
- return u.width < 100 || u.height < 100 ? null : i;
159
- }, Rt = (d) => String(d).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), Lt = ({ chartSvg: d, width: c, height: g, legendItems: a = [] }) => {
160
- const i = d.cloneNode(!0), u = 20, h = 16, x = c - 16, o = [];
161
- let l = [], n = 0;
162
- a.forEach(({ label: f, color: s }) => {
163
- const m = Math.max(40, String(f).length * 7 + 34);
164
- l.length && h + n + m > x && (o.push(l), l = [], n = 0), l.push({ label: f, color: s, itemWidth: m }), n += m;
165
- }), l.length && o.push(l);
166
- const e = o.length ? o.length * u + 20 : 0, r = g + e;
167
- i.setAttribute("width", c), i.setAttribute("height", g), i.setAttribute("x", 0), i.setAttribute("y", 0);
168
- const b = o.map((f, s) => {
169
- let m = h;
170
- const S = g + 20 + s * u;
171
- return f.map(({ label: B, color: L, itemWidth: D }) => {
172
- const T = `<line x1="${m}" y1="${S}" x2="${m + 10}" y2="${S}" stroke="${L}" stroke-width="2" />`, R = `<circle cx="${m + 5}" cy="${S}" r="2.5" fill="#fff" stroke="${L}" stroke-width="1.5" />`, z = `<text x="${m + 14}" y="${S + 4}" fill="#666" font-size="12">${Rt(B)}</text>`;
173
- return m += D, `${T}${R}${z}`;
154
+ const a = o.reduce((p, k) => {
155
+ const v = p.getBoundingClientRect(), g = k.getBoundingClientRect();
156
+ return g.width * g.height > v.width * v.height ? k : p;
157
+ }), f = a.getBoundingClientRect();
158
+ return f.width < 100 || f.height < 100 ? null : a;
159
+ }, We = (l) => String(l).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), De = ({ chartSvg: l, width: d, height: c, legendItems: o = [] }) => {
160
+ const a = l.cloneNode(!0), f = 20, p = 16, v = d - 16, g = [];
161
+ let s = [], n = 0;
162
+ o.forEach(({ label: b, color: h }) => {
163
+ const u = Math.max(40, String(b).length * 7 + 34);
164
+ s.length && p + n + u > v && (g.push(s), s = [], n = 0), s.push({ label: b, color: h, itemWidth: u }), n += u;
165
+ }), s.length && g.push(s);
166
+ const t = g.length ? g.length * f + 20 : 0, r = c + t;
167
+ a.setAttribute("width", d), a.setAttribute("height", c), a.setAttribute("x", 0), a.setAttribute("y", 0);
168
+ const x = g.map((b, h) => {
169
+ let u = p;
170
+ const w = c + 20 + h * f;
171
+ return b.map(({ label: i, color: L, itemWidth: A }) => {
172
+ const F = `<line x1="${u}" y1="${w}" x2="${u + 10}" y2="${w}" stroke="${L}" stroke-width="2" />`, R = `<circle cx="${u + 5}" cy="${w}" r="2.5" fill="#fff" stroke="${L}" stroke-width="1.5" />`, T = `<text x="${u + 14}" y="${w + 4}" fill="#666" font-size="12">${We(i)}</text>`;
173
+ return u += A, `${F}${R}${T}`;
174
174
  }).join("");
175
175
  }).join("");
176
176
  return [
177
- `<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${r}" viewBox="0 0 ${c} ${r}">`,
177
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${d}" height="${r}" viewBox="0 0 ${d} ${r}">`,
178
178
  '<style>text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }</style>',
179
179
  '<rect x="0" y="0" width="100%" height="100%" fill="#ffffff" />',
180
- new XMLSerializer().serializeToString(i),
181
- b,
180
+ new XMLSerializer().serializeToString(a),
181
+ x,
182
182
  "</svg>"
183
183
  ].join("");
184
- }, zt = async (d, c, g = []) => {
185
- const a = Bt(d);
186
- if (!a)
184
+ }, Ee = async (l, d, c = []) => {
185
+ const o = $e(l);
186
+ if (!o)
187
187
  return;
188
- const i = a.getBoundingClientRect(), u = i.width || a.clientWidth || Number(a.getAttribute("width")) || 600, h = i.height || a.clientHeight || Number(a.getAttribute("height")) || 300, k = Lt({ chartSvg: a, width: u, height: h, legendItems: g }), x = new Blob([k], { type: "image/svg+xml;charset=utf-8" }), o = URL.createObjectURL(x), l = new Image();
189
- l.onload = () => {
190
- const n = document.createElement("canvas"), e = 2;
191
- n.width = u * e, n.height = h * e;
188
+ const a = o.getBoundingClientRect(), f = a.width || o.clientWidth || Number(o.getAttribute("width")) || 600, p = a.height || o.clientHeight || Number(o.getAttribute("height")) || 300, k = De({ chartSvg: o, width: f, height: p, legendItems: c }), v = new Blob([k], { type: "image/svg+xml;charset=utf-8" }), g = URL.createObjectURL(v), s = new Image();
189
+ s.onload = () => {
190
+ const n = document.createElement("canvas"), t = 2;
191
+ n.width = f * t, n.height = p * t;
192
192
  const r = n.getContext("2d");
193
- r.fillStyle = "#ffffff", r.fillRect(0, 0, n.width, n.height), r.scale(e, e), r.drawImage(l, 0, 0, u, h), URL.revokeObjectURL(o);
194
- const b = document.createElement("a");
195
- b.download = `${(c || "chart").replace(/[^a-z0-9]+/gi, "_")}.png`, b.href = n.toDataURL("image/png"), b.click();
196
- }, l.src = o;
197
- }, Wt = (d, c) => {
198
- const g = ["", ...d.map((u) => u.name)].join(","), a = c.map((u) => {
199
- const h = d.map((k) => {
200
- const x = k.data.find((o) => o.x === u);
201
- return x ? x.y : "";
193
+ r.fillStyle = "#ffffff", r.fillRect(0, 0, n.width, n.height), r.scale(t, t), r.drawImage(s, 0, 0, f, p), URL.revokeObjectURL(g);
194
+ const x = document.createElement("a");
195
+ x.download = `${(d || "chart").replace(/[^a-z0-9]+/gi, "_")}.png`, x.href = n.toDataURL("image/png"), x.click();
196
+ }, s.src = g;
197
+ }, Ie = (l, d) => {
198
+ const c = ["", ...l.map((f) => f.name)].join(","), o = d.map((f) => {
199
+ const p = l.map((k) => {
200
+ const v = k.data.find((g) => g.x === f);
201
+ return v ? v.y : "";
202
202
  });
203
- return [u, ...h].join(",");
204
- }), i = [g, ...a].join(`
203
+ return [f, ...p].join(",");
204
+ }), a = [c, ...o].join(`
205
205
  `);
206
- navigator.clipboard.writeText(i);
207
- }, Dt = ({ onDownloadPng: d, onCopy: c, copied: g }) => /* @__PURE__ */ y("div", { style: {
206
+ navigator.clipboard.writeText(a);
207
+ }, Fe = ({ onDownloadPng: l, onCopy: d, copied: c }) => /* @__PURE__ */ y("div", { style: {
208
208
  display: "flex",
209
209
  gap: 6,
210
210
  justifyContent: "flex-end",
@@ -212,7 +212,7 @@ const w = [
212
212
  opacity: 0.7,
213
213
  transition: "opacity 0.15s"
214
214
  }, children: [
215
- /* @__PURE__ */ t("button", { onClick: c, title: "Copy data as CSV", style: {
215
+ /* @__PURE__ */ e("button", { onClick: d, title: "Copy data as CSV", style: {
216
216
  background: "none",
217
217
  border: "1px solid var(--border, #e0e0e0)",
218
218
  borderRadius: "var(--radius-sm, 4px)",
@@ -223,8 +223,8 @@ const w = [
223
223
  display: "flex",
224
224
  alignItems: "center",
225
225
  gap: 4
226
- }, children: g ? "✓ Copied" : "📋 CSV" }),
227
- /* @__PURE__ */ t("button", { onClick: d, title: "Download as PNG", style: {
226
+ }, children: c ? "✓ Copied" : "📋 CSV" }),
227
+ /* @__PURE__ */ e("button", { onClick: l, title: "Download as PNG", style: {
228
228
  background: "none",
229
229
  border: "1px solid var(--border, #e0e0e0)",
230
230
  borderRadius: "var(--radius-sm, 4px)",
@@ -236,154 +236,154 @@ const w = [
236
236
  alignItems: "center",
237
237
  gap: 4
238
238
  }, children: "📥 PNG" })
239
- ] }), Pt = ({ chartType: d, title: c, xLabel: g, yLabel: a, series: i, compact: u = !1 }) => {
240
- const h = pt(null), [k, x] = Z.useState(!1);
241
- if (!i || i.length === 0)
239
+ ] }), Ge = ({ chartType: l, title: d, xLabel: c, yLabel: o, series: a, compact: f = !1 }) => {
240
+ const p = he(null), [k, v] = re.useState(!1);
241
+ if (!a || a.length === 0)
242
242
  return null;
243
- const o = [...new Set(i.flatMap((p) => p.data.map((v) => v.x)))], l = o.map((p) => {
244
- const v = { x: p };
245
- return i.forEach((W) => {
246
- const C = W.data.find((M) => M.x === p);
247
- v[W.name] = C ? C.y : null;
248
- }), v;
249
- }), n = i.map((p) => p.name), e = n.length === 1, r = At(g, o), f = Math.max(...o.map((p) => String(p).length)) > 12 || o.length > 8, S = (f ? 40 : 5) + (r ? 25 : 0), A = e ? 0 : Math.max(1, Math.ceil(n.length / 4)), B = A > 0 ? A * 24 + (r ? 24 : 12) : 0, D = (u ? 240 : 300) + Math.max(0, (A - 1) * 28), R = { ...Ct, paddingTop: r ? 24 : 12, zIndex: 0 }, z = {
243
+ const g = [...new Set(a.flatMap((m) => m.data.map((S) => S.x)))], s = g.map((m) => {
244
+ const S = { x: m };
245
+ return a.forEach((M) => {
246
+ const z = M.data.find(($) => $.x === m);
247
+ S[M.name] = z ? z.y : null;
248
+ }), S;
249
+ }), n = a.map((m) => m.name), t = n.length === 1, r = Me(c, g), b = Math.max(...g.map((m) => String(m).length)) > 12 || g.length > 8, w = (b ? 40 : 5) + (r ? 25 : 0), B = t ? 0 : Math.max(1, Math.ceil(n.length / 4)), i = B > 0 ? B * 24 + (r ? 24 : 12) : 0, A = (f ? 240 : 300) + Math.max(0, (B - 1) * 28), R = { ...Te, paddingTop: r ? 24 : 12, zIndex: 0 }, T = {
250
250
  background: "var(--paper-elevated, #fff)",
251
251
  border: "1px solid var(--border, #e0e0e0)",
252
252
  borderRadius: "var(--radius-md, 8px)",
253
253
  padding: "16px",
254
254
  marginBottom: "16px"
255
- }, tt = {
255
+ }, ne = {
256
256
  color: "var(--text-strong, #1e2125)",
257
257
  fontSize: "14px",
258
258
  fontWeight: "600",
259
259
  marginBottom: "12px"
260
260
  }, j = {
261
261
  dataKey: "x",
262
- tick: f ? { fill: "var(--text-muted, #666)", fontSize: 11, angle: -35, textAnchor: "end" } : ot,
262
+ tick: b ? { fill: "var(--text-muted, #666)", fontSize: 11, angle: -35, textAnchor: "end" } : se,
263
263
  axisLine: I,
264
264
  tickLine: I,
265
265
  ...r ? {
266
266
  label: {
267
- value: g,
267
+ value: c,
268
268
  position: "insideBottom",
269
269
  // Push label below rotated ticks (which take ~40px) when present
270
- offset: f ? -45 : -10,
270
+ offset: b ? -45 : -10,
271
271
  style: { textAnchor: "middle", fill: "var(--text-muted, #666)" }
272
272
  }
273
273
  } : {}
274
- }, et = {
275
- tick: ot,
274
+ }, oe = {
275
+ tick: se,
276
276
  axisLine: I,
277
277
  tickLine: I,
278
- ...a ? {
278
+ ...o ? {
279
279
  width: 72,
280
280
  label: {
281
- value: a,
281
+ value: o,
282
282
  angle: -90,
283
283
  position: "insideLeft",
284
284
  offset: 10,
285
285
  style: { textAnchor: "middle", fill: "var(--text-muted, #666)" }
286
286
  }
287
287
  } : {}
288
- }, ct = () => {
289
- switch (d) {
288
+ }, fe = () => {
289
+ switch (l) {
290
290
  case "bar":
291
- return /* @__PURE__ */ t(N, { width: "100%", height: D, children: /* @__PURE__ */ y(st, { data: l, margin: { top: 5, right: 30, left: a ? 10 : 20, bottom: S }, children: [
292
- /* @__PURE__ */ t(q, { strokeDasharray: "3 3", stroke: Q }),
293
- /* @__PURE__ */ t(G, { ...j }),
294
- /* @__PURE__ */ t(V, { ...et }),
295
- !e && /* @__PURE__ */ t(J, { wrapperStyle: R, height: B }),
296
- n.map((p, v) => /* @__PURE__ */ t(lt, { dataKey: p, fill: w[v % w.length], radius: [2, 2, 0, 0], isAnimationActive: !1, children: e && l.map((W, C) => /* @__PURE__ */ t(nt, { fill: w[C % w.length] }, C)) }, p)),
297
- /* @__PURE__ */ t(O, { wrapperStyle: F.wrapperStyle, content: /* @__PURE__ */ t(X, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
291
+ return /* @__PURE__ */ e(N, { width: "100%", height: A, children: /* @__PURE__ */ y(de, { data: s, margin: { top: 5, right: 30, left: o ? 10 : 20, bottom: w }, children: [
292
+ /* @__PURE__ */ e(Z, { strokeDasharray: "3 3", stroke: te }),
293
+ /* @__PURE__ */ e(J, { ...j }),
294
+ /* @__PURE__ */ e(Q, { ...oe }),
295
+ !t && /* @__PURE__ */ e(ee, { wrapperStyle: R, height: i }),
296
+ n.map((m, S) => /* @__PURE__ */ e(pe, { dataKey: m, fill: C[S % C.length], radius: [2, 2, 0, 0], isAnimationActive: !1, children: t && s.map((M, z) => /* @__PURE__ */ e(ae, { fill: C[z % C.length] }, z)) }, m)),
297
+ /* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
298
298
  ] }) });
299
299
  case "horizontal_bar":
300
- return /* @__PURE__ */ t(N, { width: "100%", height: Math.max(u ? 240 : 300, l.length * (u ? 32 : 40)), children: /* @__PURE__ */ y(st, { data: l, layout: "vertical", margin: { top: 5, right: 30, left: 100, bottom: 5 }, children: [
301
- /* @__PURE__ */ t(q, { strokeDasharray: "3 3", stroke: Q }),
302
- /* @__PURE__ */ t(
303
- G,
300
+ return /* @__PURE__ */ e(N, { width: "100%", height: Math.max(f ? 240 : 300, s.length * (f ? 32 : 40)), children: /* @__PURE__ */ y(de, { data: s, layout: "vertical", margin: { top: 5, right: 30, left: 100, bottom: 5 }, children: [
301
+ /* @__PURE__ */ e(Z, { strokeDasharray: "3 3", stroke: te }),
302
+ /* @__PURE__ */ e(
303
+ J,
304
304
  {
305
305
  type: "number",
306
- tick: ot,
306
+ tick: se,
307
307
  axisLine: I,
308
308
  tickLine: I,
309
- ...a ? { label: { value: a, position: "insideBottom", offset: -5, style: { textAnchor: "middle", fill: "var(--text-muted, #666)" } } } : {}
309
+ ...o ? { label: { value: o, position: "insideBottom", offset: -5, style: { textAnchor: "middle", fill: "var(--text-muted, #666)" } } } : {}
310
310
  }
311
311
  ),
312
- /* @__PURE__ */ t(V, { type: "category", dataKey: "x", tick: { fill: "var(--text-muted, #666)", fontSize: 11 }, width: 90, axisLine: I, tickLine: I }),
313
- !e && /* @__PURE__ */ t(J, { wrapperStyle: R, height: B }),
314
- n.map((p, v) => /* @__PURE__ */ t(lt, { dataKey: p, fill: w[v % w.length], radius: [0, 2, 2, 0], isAnimationActive: !1, children: e && l.map((W, C) => /* @__PURE__ */ t(nt, { fill: w[C % w.length] }, C)) }, p)),
315
- /* @__PURE__ */ t(O, { wrapperStyle: F.wrapperStyle, content: /* @__PURE__ */ t(X, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
312
+ /* @__PURE__ */ e(Q, { type: "category", dataKey: "x", tick: { fill: "var(--text-muted, #666)", fontSize: 11 }, width: 90, axisLine: I, tickLine: I }),
313
+ !t && /* @__PURE__ */ e(ee, { wrapperStyle: R, height: i }),
314
+ n.map((m, S) => /* @__PURE__ */ e(pe, { dataKey: m, fill: C[S % C.length], radius: [0, 2, 2, 0], isAnimationActive: !1, children: t && s.map((M, z) => /* @__PURE__ */ e(ae, { fill: C[z % C.length] }, z)) }, m)),
315
+ /* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
316
316
  ] }) });
317
317
  case "line":
318
- return /* @__PURE__ */ t(N, { width: "100%", height: D, children: /* @__PURE__ */ y(bt, { data: l, margin: { top: 5, right: 30, left: a ? 10 : 20, bottom: S }, children: [
319
- /* @__PURE__ */ t(q, { strokeDasharray: "3 3", stroke: Q }),
320
- /* @__PURE__ */ t(G, { ...j }),
321
- /* @__PURE__ */ t(V, { ...et }),
322
- /* @__PURE__ */ t(J, { wrapperStyle: R, height: B }),
323
- n.map((p, v) => /* @__PURE__ */ t(
324
- yt,
318
+ return /* @__PURE__ */ e(N, { width: "100%", height: A, children: /* @__PURE__ */ y(Ce, { data: s, margin: { top: 5, right: 30, left: o ? 10 : 20, bottom: w }, children: [
319
+ /* @__PURE__ */ e(Z, { strokeDasharray: "3 3", stroke: te }),
320
+ /* @__PURE__ */ e(J, { ...j }),
321
+ /* @__PURE__ */ e(Q, { ...oe }),
322
+ /* @__PURE__ */ e(ee, { wrapperStyle: R, height: i }),
323
+ n.map((m, S) => /* @__PURE__ */ e(
324
+ Ae,
325
325
  {
326
326
  type: "monotone",
327
- dataKey: p,
328
- stroke: w[v % w.length],
327
+ dataKey: m,
328
+ stroke: C[S % C.length],
329
329
  strokeWidth: 2,
330
- dot: { r: 4, fill: w[v % w.length] },
331
- activeDot: { r: 6, fill: w[v % w.length] },
330
+ dot: { r: 4, fill: C[S % C.length] },
331
+ activeDot: { r: 6, fill: C[S % C.length] },
332
332
  isAnimationActive: !1
333
333
  },
334
- p
334
+ m
335
335
  )),
336
- /* @__PURE__ */ t(O, { wrapperStyle: F.wrapperStyle, content: /* @__PURE__ */ t(X, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
336
+ /* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
337
337
  ] }) });
338
338
  case "area":
339
- return /* @__PURE__ */ t(N, { width: "100%", height: D, children: /* @__PURE__ */ y(ft, { data: l, margin: { top: 5, right: 30, left: a ? 10 : 20, bottom: S }, children: [
340
- /* @__PURE__ */ t(q, { strokeDasharray: "3 3", stroke: Q }),
341
- /* @__PURE__ */ t(G, { ...j }),
342
- /* @__PURE__ */ t(V, { ...et }),
343
- /* @__PURE__ */ t(J, { wrapperStyle: R, height: B }),
344
- n.map((p, v) => /* @__PURE__ */ t(
345
- xt,
339
+ return /* @__PURE__ */ e(N, { width: "100%", height: A, children: /* @__PURE__ */ y(Se, { data: s, margin: { top: 5, right: 30, left: o ? 10 : 20, bottom: w }, children: [
340
+ /* @__PURE__ */ e(Z, { strokeDasharray: "3 3", stroke: te }),
341
+ /* @__PURE__ */ e(J, { ...j }),
342
+ /* @__PURE__ */ e(Q, { ...oe }),
343
+ /* @__PURE__ */ e(ee, { wrapperStyle: R, height: i }),
344
+ n.map((m, S) => /* @__PURE__ */ e(
345
+ ke,
346
346
  {
347
347
  type: "monotone",
348
- dataKey: p,
349
- stroke: w[v % w.length],
348
+ dataKey: m,
349
+ stroke: C[S % C.length],
350
350
  strokeWidth: 2,
351
- fill: w[v % w.length],
351
+ fill: C[S % C.length],
352
352
  fillOpacity: 0.15,
353
353
  isAnimationActive: !1
354
354
  },
355
- p
355
+ m
356
356
  )),
357
- /* @__PURE__ */ t(O, { wrapperStyle: F.wrapperStyle, content: /* @__PURE__ */ t(X, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
357
+ /* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
358
358
  ] }) });
359
359
  case "pie": {
360
- const p = i[0].data.map((C, M) => ({
361
- name: C.x,
362
- value: C.y,
363
- fill: w[M % w.length]
364
- })), v = Math.PI / 180;
365
- return /* @__PURE__ */ t(N, { width: "100%", height: u ? 260 : 320, children: /* @__PURE__ */ y(ut, { margin: { top: 16, right: 16, bottom: 16, left: 16 }, children: [
366
- /* @__PURE__ */ t(
367
- mt,
360
+ const m = a[0].data.map((z, $) => ({
361
+ name: z.x,
362
+ value: z.y,
363
+ fill: C[$ % C.length]
364
+ })), S = Math.PI / 180;
365
+ return /* @__PURE__ */ e(N, { width: "100%", height: f ? 260 : 320, children: /* @__PURE__ */ y(ve, { margin: { top: 16, right: 16, bottom: 16, left: 16 }, children: [
366
+ /* @__PURE__ */ e(
367
+ we,
368
368
  {
369
- data: p,
370
- cx: u ? "42%" : "38%",
369
+ data: m,
370
+ cx: f ? "42%" : "38%",
371
371
  cy: "50%",
372
- outerRadius: u ? 88 : 110,
372
+ outerRadius: f ? 88 : 110,
373
373
  dataKey: "value",
374
- label: ({ cx: C, cy: M, midAngle: E, innerRadius: P, outerRadius: rt, percent: H, name: _ }) => {
375
- const U = rt + 20, K = C + U * Math.cos(-E * v), Y = M + U * Math.sin(-E * v);
374
+ label: ({ cx: z, cy: $, midAngle: _, innerRadius: P, outerRadius: ie, percent: H, name: O }) => {
375
+ const Y = ie + 20, q = z + Y * Math.cos(-_ * S), V = $ + Y * Math.sin(-_ * S);
376
376
  return H < 0.04 ? null : /* @__PURE__ */ y(
377
377
  "text",
378
378
  {
379
- x: K,
380
- y: Y,
379
+ x: q,
380
+ y: V,
381
381
  fill: "var(--text-ink, #1e2125)",
382
382
  fontSize: 11,
383
- textAnchor: K > C ? "start" : "end",
383
+ textAnchor: q > z ? "start" : "end",
384
384
  dominantBaseline: "central",
385
385
  children: [
386
- _,
386
+ O,
387
387
  " (",
388
388
  (H * 100).toFixed(0),
389
389
  "%)"
@@ -393,78 +393,78 @@ const w = [
393
393
  },
394
394
  labelLine: { stroke: "var(--text-muted, #666)" },
395
395
  isAnimationActive: !1,
396
- children: p.map((C, M) => /* @__PURE__ */ t(nt, { fill: C.fill }, M))
396
+ children: m.map((z, $) => /* @__PURE__ */ e(ae, { fill: z.fill }, $))
397
397
  }
398
398
  ),
399
- /* @__PURE__ */ t(O, { wrapperStyle: F.wrapperStyle, content: /* @__PURE__ */ t(X, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
399
+ /* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
400
400
  ] }) });
401
401
  }
402
402
  case "metric": {
403
- const p = i[0], v = p.data[0], W = p.data.length > 1 ? p.data[1] : null, C = v.y, M = v.x || "", E = W !== null, P = E ? C - W.y : 0, rt = E && W.y !== 0 ? P / Math.abs(W.y) * 100 : 0, H = P > 0, _ = P < 0, U = H ? "#7BA89D" : _ ? "#D17B6B" : "var(--text-muted, #666)", K = H ? "↑" : _ ? "↓" : "→", Y = ($) => Number.isInteger($) && Math.abs($) >= 1e3 ? $.toLocaleString() : typeof $ == "number" ? $ % 1 === 0 ? $.toString() : $.toFixed($ < 10 ? 2 : 1) : String($);
403
+ const m = a[0], S = m.data[0], M = m.data.length > 1 ? m.data[1] : null, z = S.y, $ = S.x || "", _ = M !== null, P = _ ? z - M.y : 0, ie = _ && M.y !== 0 ? P / Math.abs(M.y) * 100 : 0, H = P > 0, O = P < 0, Y = H ? "#7BA89D" : O ? "#D17B6B" : "var(--text-muted, #666)", q = H ? "↑" : O ? "↓" : "→", V = (E) => Number.isInteger(E) && Math.abs(E) >= 1e3 ? E.toLocaleString() : typeof E == "number" ? E % 1 === 0 ? E.toString() : E.toFixed(E < 10 ? 2 : 1) : String(E);
404
404
  return /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "baseline", gap: 12, padding: "8px 0" }, children: [
405
- /* @__PURE__ */ t("div", { style: {
405
+ /* @__PURE__ */ e("div", { style: {
406
406
  fontSize: "36px",
407
407
  fontWeight: 700,
408
408
  lineHeight: 1,
409
409
  color: "var(--text-strong, #1e2125)",
410
410
  fontVariantNumeric: "tabular-nums"
411
- }, children: Y(C) }),
412
- M && /* @__PURE__ */ t("div", { style: { fontSize: "14px", color: "var(--text-muted, #666)", fontWeight: 500 }, children: M }),
413
- E && /* @__PURE__ */ y("div", { style: {
411
+ }, children: V(z) }),
412
+ $ && /* @__PURE__ */ e("div", { style: { fontSize: "14px", color: "var(--text-muted, #666)", fontWeight: 500 }, children: $ }),
413
+ _ && /* @__PURE__ */ y("div", { style: {
414
414
  display: "flex",
415
415
  alignItems: "center",
416
416
  gap: 4,
417
417
  fontSize: "13px",
418
418
  fontWeight: 600,
419
- color: U,
420
- background: H ? "rgba(123,168,157,0.12)" : _ ? "rgba(209,123,107,0.12)" : "rgba(128,128,128,0.08)",
419
+ color: Y,
420
+ background: H ? "rgba(123,168,157,0.12)" : O ? "rgba(209,123,107,0.12)" : "rgba(128,128,128,0.08)",
421
421
  padding: "3px 8px",
422
422
  borderRadius: "var(--radius-sm, 4px)"
423
423
  }, children: [
424
- /* @__PURE__ */ t("span", { children: K }),
424
+ /* @__PURE__ */ e("span", { children: q }),
425
425
  /* @__PURE__ */ y("span", { children: [
426
- Y(Math.abs(P)),
426
+ V(Math.abs(P)),
427
427
  " (",
428
- Math.abs(rt).toFixed(1),
428
+ Math.abs(ie).toFixed(1),
429
429
  "%)"
430
430
  ] })
431
431
  ] }),
432
- E && /* @__PURE__ */ y("div", { style: { fontSize: "11px", color: "var(--text-faint, #999)" }, children: [
432
+ _ && /* @__PURE__ */ y("div", { style: { fontSize: "11px", color: "var(--text-faint, #999)" }, children: [
433
433
  "vs ",
434
- W.x || "previous"
434
+ M.x || "previous"
435
435
  ] })
436
436
  ] });
437
437
  }
438
438
  default:
439
439
  return /* @__PURE__ */ y("div", { style: { color: "var(--text-muted)", fontSize: 12, padding: 8 }, children: [
440
440
  "Unsupported chart type: ",
441
- d
441
+ l
442
442
  ] });
443
443
  }
444
- }, it = d === "line" || d === "area" || (d === "bar" || d === "horizontal_bar") && !e ? n.map((p, v) => ({ label: p, color: w[v % w.length] })) : [], dt = at(() => {
445
- h.current && zt(h.current, c, it);
446
- }, [c, it]), ht = at(() => {
447
- Wt(i, o), x(!0), setTimeout(() => x(!1), 2e3);
448
- }, [i, o]);
449
- return /* @__PURE__ */ y("div", { style: z, children: [
450
- c && /* @__PURE__ */ t("div", { style: tt, children: c }),
451
- d !== "metric" && /* @__PURE__ */ t(Dt, { onDownloadPng: dt, onCopy: ht, copied: k }),
452
- /* @__PURE__ */ t("div", { ref: h, children: ct() })
444
+ }, le = l === "line" || l === "area" || (l === "bar" || l === "horizontal_bar") && !t ? n.map((m, S) => ({ label: m, color: C[S % C.length] })) : [], me = ce(() => {
445
+ p.current && Ee(p.current, d, le);
446
+ }, [d, le]), xe = ce(() => {
447
+ Ie(a, g), v(!0), setTimeout(() => v(!1), 2e3);
448
+ }, [a, g]);
449
+ return /* @__PURE__ */ y("div", { style: T, children: [
450
+ d && /* @__PURE__ */ e("div", { style: ne, children: d }),
451
+ l !== "metric" && /* @__PURE__ */ e(Fe, { onDownloadPng: me, onCopy: xe, copied: k }),
452
+ /* @__PURE__ */ e("div", { ref: p, children: fe() })
453
453
  ] });
454
- }, Mt = ({ content: d, onCodeBlockClick: c, onFilePathClick: g }) => {
455
- const [a, i] = gt(/* @__PURE__ */ new Set()), u = async (l, n) => {
454
+ }, _e = ({ content: l, onCodeBlockClick: d, onFilePathClick: c }) => {
455
+ const [o, a] = G(/* @__PURE__ */ new Set()), f = async (s, n) => {
456
456
  try {
457
- await navigator.clipboard.writeText(l), i((e) => /* @__PURE__ */ new Set([...e, n])), setTimeout(() => {
458
- i((e) => {
459
- const r = new Set(e);
457
+ await navigator.clipboard.writeText(s), a((t) => /* @__PURE__ */ new Set([...t, n])), setTimeout(() => {
458
+ a((t) => {
459
+ const r = new Set(t);
460
460
  return r.delete(n), r;
461
461
  });
462
462
  }, 2e3);
463
- } catch (e) {
464
- console.error("Failed to copy text:", e);
463
+ } catch (t) {
464
+ console.error("Failed to copy text:", t);
465
465
  }
466
- }, h = (l, n, e) => {
467
- const r = a.has(e);
466
+ }, p = (s, n, t) => {
467
+ const r = o.has(t);
468
468
  return /* @__PURE__ */ y(
469
469
  "div",
470
470
  {
@@ -485,7 +485,7 @@ const w = [
485
485
  background: "rgba(255,255,255,0.05)",
486
486
  borderBottom: "1px solid rgba(255,255,255,0.1)"
487
487
  }, children: [
488
- /* @__PURE__ */ t("span", { style: {
488
+ /* @__PURE__ */ e("span", { style: {
489
489
  fontSize: "11px",
490
490
  color: "rgba(255,255,255,0.7)",
491
491
  fontFamily: "var(--font-mono, monospace)",
@@ -495,7 +495,7 @@ const w = [
495
495
  /* @__PURE__ */ y(
496
496
  "button",
497
497
  {
498
- onClick: () => u(l, e),
498
+ onClick: () => f(s, t),
499
499
  style: {
500
500
  background: "none",
501
501
  border: "none",
@@ -509,22 +509,22 @@ const w = [
509
509
  fontSize: "11px",
510
510
  transition: "all 0.15s ease"
511
511
  },
512
- onMouseEnter: (b) => {
513
- b.target.style.background = "rgba(255,255,255,0.1)", b.target.style.color = "rgba(255,255,255,0.9)";
512
+ onMouseEnter: (x) => {
513
+ x.target.style.background = "rgba(255,255,255,0.1)", x.target.style.color = "rgba(255,255,255,0.9)";
514
514
  },
515
- onMouseLeave: (b) => {
516
- b.target.style.background = "none", b.target.style.color = "rgba(255,255,255,0.7)";
515
+ onMouseLeave: (x) => {
516
+ x.target.style.background = "none", x.target.style.color = "rgba(255,255,255,0.7)";
517
517
  },
518
518
  children: [
519
- r ? /* @__PURE__ */ t(wt, { size: 12 }) : /* @__PURE__ */ t(St, { size: 12 }),
519
+ r ? /* @__PURE__ */ e(ge, { size: 12 }) : /* @__PURE__ */ e(ue, { size: 12 }),
520
520
  r ? "Copied!" : "Copy"
521
521
  ]
522
522
  }
523
523
  ),
524
- c && /* @__PURE__ */ y(
524
+ d && /* @__PURE__ */ y(
525
525
  "button",
526
526
  {
527
- onClick: () => c({ code: l, language: n }),
527
+ onClick: () => d({ code: s, language: n }),
528
528
  style: {
529
529
  background: "none",
530
530
  border: "none",
@@ -538,20 +538,20 @@ const w = [
538
538
  fontSize: "11px",
539
539
  transition: "all 0.15s ease"
540
540
  },
541
- onMouseEnter: (b) => {
542
- b.currentTarget.style.background = "rgba(255,255,255,0.1)", b.currentTarget.style.color = "rgba(255,255,255,0.9)";
541
+ onMouseEnter: (x) => {
542
+ x.currentTarget.style.background = "rgba(255,255,255,0.1)", x.currentTarget.style.color = "rgba(255,255,255,0.9)";
543
543
  },
544
- onMouseLeave: (b) => {
545
- b.currentTarget.style.background = "none", b.currentTarget.style.color = "rgba(255,255,255,0.7)";
544
+ onMouseLeave: (x) => {
545
+ x.currentTarget.style.background = "none", x.currentTarget.style.color = "rgba(255,255,255,0.7)";
546
546
  },
547
547
  children: [
548
- /* @__PURE__ */ t(kt, { size: 12 }),
548
+ /* @__PURE__ */ e(Le, { size: 12 }),
549
549
  "Canvas"
550
550
  ]
551
551
  }
552
552
  )
553
553
  ] }),
554
- /* @__PURE__ */ t("pre", { style: {
554
+ /* @__PURE__ */ e("pre", { style: {
555
555
  margin: 0,
556
556
  padding: "12px",
557
557
  fontFamily: "var(--font-mono, monospace)",
@@ -561,46 +561,46 @@ const w = [
561
561
  overflow: "auto",
562
562
  whiteSpace: "pre-wrap",
563
563
  wordBreak: "break-word"
564
- }, children: l })
564
+ }, children: s })
565
565
  ]
566
566
  },
567
- e
567
+ t
568
568
  );
569
- }, k = (l) => {
570
- const n = [], e = l.split(`
569
+ }, k = (s) => {
570
+ const n = [], t = s.split(`
571
571
  `);
572
- let r = 0, b = 0;
573
- for (; r < e.length; ) {
574
- const f = e[r];
575
- if (f.trim().startsWith("```")) {
576
- const s = f.trim().slice(3);
577
- let m = [];
578
- for (r++; r < e.length && !e[r].trim().startsWith("```"); )
579
- m.push(e[r]), r++;
580
- r < e.length && r++, n.push(h(m.join(`
581
- `), s, `code-${b++}`));
572
+ let r = 0, x = 0;
573
+ for (; r < t.length; ) {
574
+ const b = t[r];
575
+ if (b.trim().startsWith("```")) {
576
+ const h = b.trim().slice(3);
577
+ let u = [];
578
+ for (r++; r < t.length && !t[r].trim().startsWith("```"); )
579
+ u.push(t[r]), r++;
580
+ r < t.length && r++, n.push(p(u.join(`
581
+ `), h, `code-${x++}`));
582
582
  continue;
583
583
  }
584
- if (f.startsWith("#")) {
585
- const s = f.match(/^#+/)[0].length, m = f.slice(s).trim(), S = s === 1 ? "h2" : s === 2 ? "h3" : s === 3 ? "h4" : "h5";
584
+ if (b.startsWith("#")) {
585
+ const h = b.match(/^#+/)[0].length, u = b.slice(h).trim(), w = h === 1 ? "h2" : h === 2 ? "h3" : h === 3 ? "h4" : "h5";
586
586
  n.push(
587
- Z.createElement(S, {
587
+ re.createElement(w, {
588
588
  key: `header-${r}`,
589
589
  style: {
590
- fontSize: s === 1 ? "18px" : s === 2 ? "16px" : "14px",
590
+ fontSize: h === 1 ? "18px" : h === 2 ? "16px" : "14px",
591
591
  fontWeight: 720,
592
592
  color: "var(--text-strong, rgba(30,33,37,0.92))",
593
593
  marginTop: n.length > 0 ? "20px" : "0",
594
594
  marginBottom: "8px",
595
595
  lineHeight: 1.3
596
596
  }
597
- }, m)
597
+ }, u)
598
598
  ), r++;
599
599
  continue;
600
600
  }
601
- if (f.trim() === "---" || f.trim() === "***") {
601
+ if (b.trim() === "---" || b.trim() === "***") {
602
602
  n.push(
603
- /* @__PURE__ */ t("hr", { style: {
603
+ /* @__PURE__ */ e("hr", { style: {
604
604
  border: "none",
605
605
  borderTop: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
606
606
  margin: "16px 0"
@@ -608,39 +608,39 @@ const w = [
608
608
  ), r++;
609
609
  continue;
610
610
  }
611
- if (f.match(/^(\s*)([-*+]|\d+\.)\s/)) {
612
- const s = [], m = /^\s*\d+\./.test(f);
613
- for (; r < e.length && (e[r].match(/^(\s*)([-*+]|\d+\.)\s/) || e[r].trim() === ""); ) {
614
- if (e[r].trim() !== "") {
615
- const A = e[r].match(/^(\s*)([-*+]|\d+\.)\s(.*)$/);
616
- A && s.push(A[3]);
611
+ if (b.match(/^(\s*)([-*+]|\d+\.)\s/)) {
612
+ const h = [], u = /^\s*\d+\./.test(b);
613
+ for (; r < t.length && (t[r].match(/^(\s*)([-*+]|\d+\.)\s/) || t[r].trim() === ""); ) {
614
+ if (t[r].trim() !== "") {
615
+ const B = t[r].match(/^(\s*)([-*+]|\d+\.)\s(.*)$/);
616
+ B && h.push(B[3]);
617
617
  }
618
618
  r++;
619
619
  }
620
- const S = m ? "ol" : "ul";
620
+ const w = u ? "ol" : "ul";
621
621
  n.push(
622
- Z.createElement(S, {
622
+ re.createElement(w, {
623
623
  key: `list-${r}`,
624
624
  style: {
625
625
  margin: "8px 0",
626
626
  paddingLeft: "20px",
627
627
  color: "var(--text-strong, rgba(30,33,37,0.92))"
628
628
  }
629
- }, s.map(
630
- (A, B) => Z.createElement("li", {
631
- key: `item-${B}`,
629
+ }, h.map(
630
+ (B, i) => re.createElement("li", {
631
+ key: `item-${i}`,
632
632
  style: { marginBottom: "4px" }
633
- }, o(A))
633
+ }, g(B))
634
634
  ))
635
635
  );
636
636
  continue;
637
637
  }
638
- if (f.trim().startsWith("|") && f.trim().endsWith("|")) {
639
- const s = [];
640
- for (; r < e.length && e[r].trim().startsWith("|") && e[r].trim().endsWith("|"); )
641
- s.push(e[r]), r++;
642
- if (s.length >= 2) {
643
- const m = (R) => R.trim().slice(1, -1).split("|").map((z) => z.trim()), S = m(s[0]), A = (R) => m(R).every((z) => /^[-:]+$/.test(z)), B = s.length >= 2 && A(s[1]), L = B ? 2 : 1, D = B ? m(s[1]).map((R) => R.startsWith(":") && R.endsWith(":") ? "center" : R.endsWith(":") ? "right" : "left") : S.map(() => "left"), T = {
638
+ if (b.trim().startsWith("|") && b.trim().endsWith("|")) {
639
+ const h = [];
640
+ for (; r < t.length && t[r].trim().startsWith("|") && t[r].trim().endsWith("|"); )
641
+ h.push(t[r]), r++;
642
+ if (h.length >= 2) {
643
+ const u = (R) => R.trim().slice(1, -1).split("|").map((T) => T.trim()), w = u(h[0]), B = (R) => u(R).every((T) => /^[-:]+$/.test(T)), i = h.length >= 2 && B(h[1]), L = i ? 2 : 1, A = i ? u(h[1]).map((R) => R.startsWith(":") && R.endsWith(":") ? "center" : R.endsWith(":") ? "right" : "left") : w.map(() => "left"), F = {
644
644
  padding: "6px 12px",
645
645
  borderBottom: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
646
646
  fontSize: "13px",
@@ -654,48 +654,48 @@ const w = [
654
654
  overflowWrap: "normal"
655
655
  };
656
656
  n.push(
657
- /* @__PURE__ */ t("div", { style: { overflowX: "auto", margin: "8px 0" }, children: /* @__PURE__ */ y("table", { style: {
657
+ /* @__PURE__ */ e("div", { style: { overflowX: "auto", margin: "8px 0" }, children: /* @__PURE__ */ y("table", { style: {
658
658
  borderCollapse: "collapse",
659
659
  width: "100%",
660
660
  border: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
661
661
  borderRadius: "6px",
662
662
  overflow: "hidden"
663
663
  }, children: [
664
- B && /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { style: { background: "var(--hover-warm-subtle, rgba(231,212,162,0.08))" }, children: S.map((R, z) => /* @__PURE__ */ t("th", { style: { ...T, fontWeight: 660, textAlign: D[z] || "left", whiteSpace: "nowrap" }, children: o(R) }, z)) }) }),
665
- /* @__PURE__ */ t("tbody", { children: (B ? s.slice(L) : s).map((R, z) => /* @__PURE__ */ t("tr", { style: { background: z % 2 === 1 ? "var(--hover-warm-subtle, rgba(231,212,162,0.04))" : "transparent" }, children: m(R).map((tt, j) => /* @__PURE__ */ t("td", { style: { ...T, textAlign: D[j] || "left" }, children: o(tt) }, j)) }, z)) })
664
+ i && /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { style: { background: "var(--hover-warm-subtle, rgba(231,212,162,0.08))" }, children: w.map((R, T) => /* @__PURE__ */ e("th", { style: { ...F, fontWeight: 660, textAlign: A[T] || "left", whiteSpace: "nowrap" }, children: g(R) }, T)) }) }),
665
+ /* @__PURE__ */ e("tbody", { children: (i ? h.slice(L) : h).map((R, T) => /* @__PURE__ */ e("tr", { style: { background: T % 2 === 1 ? "var(--hover-warm-subtle, rgba(231,212,162,0.04))" : "transparent" }, children: u(R).map((ne, j) => /* @__PURE__ */ e("td", { style: { ...F, textAlign: A[j] || "left" }, children: g(ne) }, j)) }, T)) })
666
666
  ] }) }, `table-${r}`)
667
667
  );
668
668
  }
669
669
  continue;
670
670
  }
671
- if (f.trim()) {
672
- const s = [];
673
- for (; r < e.length && e[r].trim() && !e[r].match(/^(#|```|---|\*\*\*|(\s*)([-*+]|\d+\.)\s)/) && !(e[r].trim().startsWith("|") && e[r].trim().endsWith("|")); )
674
- s.push(e[r]), r++;
675
- s.length > 0 && n.push(
676
- /* @__PURE__ */ t("p", { style: {
671
+ if (b.trim()) {
672
+ const h = [];
673
+ for (; r < t.length && t[r].trim() && !t[r].match(/^(#|```|---|\*\*\*|(\s*)([-*+]|\d+\.)\s)/) && !(t[r].trim().startsWith("|") && t[r].trim().endsWith("|")); )
674
+ h.push(t[r]), r++;
675
+ h.length > 0 && n.push(
676
+ /* @__PURE__ */ e("p", { style: {
677
677
  margin: "8px 0",
678
678
  lineHeight: 1.6,
679
679
  color: "var(--text-strong, rgba(30,33,37,0.92))"
680
- }, children: o(s.join(" ")) }, `p-${r}`)
680
+ }, children: g(h.join(" ")) }, `p-${r}`)
681
681
  );
682
682
  } else
683
683
  r++;
684
684
  }
685
685
  return n;
686
- }, x = (l) => {
686
+ }, v = (s) => {
687
687
  const n = [];
688
- let e = l, r = 0;
689
- for (; e.length > 0; ) {
690
- if (g) {
691
- const A = e.match(/^([^\s`*\[]+(?:\/src\/|\/components\/|\/packages\/)[^\s`*\[]*|[^\s`*\[]*\.(ts|tsx|js|jsx|py|css|scss|sass|json|md|yaml|yml|html|xml|sh|sql|go|rs|php|java|c|cpp|h|hpp)(?:\b|$))/);
692
- if (A) {
693
- const B = A[1];
688
+ let t = s, r = 0;
689
+ for (; t.length > 0; ) {
690
+ if (c) {
691
+ const i = t.match(/^([^\s`*\[]+(?:\/src\/|\/components\/|\/packages\/)[^\s`*\[]*|[^\s`*\[]*\.(ts|tsx|js|jsx|py|css|scss|sass|json|md|yaml|yml|html|xml|sh|sql|go|rs|php|java|c|cpp|h|hpp)(?:\b|$))/);
692
+ if (i) {
693
+ const L = i[1];
694
694
  n.push(
695
- /* @__PURE__ */ t(
695
+ /* @__PURE__ */ e(
696
696
  "span",
697
697
  {
698
- onClick: () => g(B),
698
+ onClick: () => c(L),
699
699
  style: {
700
700
  color: "var(--rail-discovery, #5E88B0)",
701
701
  textDecoration: "underline",
@@ -711,24 +711,24 @@ const w = [
711
711
  textDecorationStyle: "solid"
712
712
  }
713
713
  },
714
- onMouseEnter: (L) => {
715
- L.target.style.background = "var(--hover-warm-subtle, rgba(231,212,162,0.08))", L.target.style.textDecorationStyle = "solid";
714
+ onMouseEnter: (A) => {
715
+ A.target.style.background = "var(--hover-warm-subtle, rgba(231,212,162,0.08))", A.target.style.textDecorationStyle = "solid";
716
716
  },
717
- onMouseLeave: (L) => {
718
- L.target.style.background = "none", L.target.style.textDecorationStyle = "dotted";
717
+ onMouseLeave: (A) => {
718
+ A.target.style.background = "none", A.target.style.textDecorationStyle = "dotted";
719
719
  },
720
- children: B
720
+ children: L
721
721
  },
722
722
  `file-path-${r++}`
723
723
  )
724
- ), e = e.slice(A[0].length);
724
+ ), t = t.slice(i[0].length);
725
725
  continue;
726
726
  }
727
727
  }
728
- const b = e.match(/^`([^`]+)`/);
729
- if (b) {
728
+ const x = t.match(/^`([^`]+)`/);
729
+ if (x) {
730
730
  n.push(
731
- /* @__PURE__ */ t("code", { style: {
731
+ /* @__PURE__ */ e("code", { style: {
732
732
  background: "var(--hover-warm-subtle, rgba(231,212,162,0.08))",
733
733
  border: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
734
734
  borderRadius: "3px",
@@ -736,33 +736,55 @@ const w = [
736
736
  fontFamily: "var(--font-mono, monospace)",
737
737
  fontSize: "12px",
738
738
  color: "var(--text-strong, rgba(30,33,37,0.92))"
739
- }, children: b[1] }, `inline-code-${r++}`)
740
- ), e = e.slice(b[0].length);
739
+ }, children: x[1] }, `inline-code-${r++}`)
740
+ ), t = t.slice(x[0].length);
741
741
  continue;
742
742
  }
743
- const f = e.match(/^\*\*([^*]+)\*\*/);
744
- if (f) {
743
+ const b = t.match(/^\*\*([^*]+)\*\*/);
744
+ if (b) {
745
745
  n.push(
746
- /* @__PURE__ */ t("strong", { style: {
746
+ /* @__PURE__ */ e("strong", { style: {
747
747
  fontWeight: 720,
748
748
  color: "var(--text-strong, rgba(30,33,37,0.92))"
749
- }, children: f[1] }, `bold-${r++}`)
750
- ), e = e.slice(f[0].length);
749
+ }, children: b[1] }, `bold-${r++}`)
750
+ ), t = t.slice(b[0].length);
751
751
  continue;
752
752
  }
753
- const s = e.match(/^\*([^*]+)\*/);
754
- if (s) {
753
+ const h = t.match(/^\*([^*]+)\*/);
754
+ if (h) {
755
755
  n.push(
756
- /* @__PURE__ */ t("em", { style: {
756
+ /* @__PURE__ */ e("em", { style: {
757
757
  fontStyle: "italic",
758
758
  color: "var(--text-strong, rgba(30,33,37,0.92))"
759
- }, children: s[1] }, `italic-${r++}`)
760
- ), e = e.slice(s[0].length);
759
+ }, children: h[1] }, `italic-${r++}`)
760
+ ), t = t.slice(h[0].length);
761
+ continue;
762
+ }
763
+ const u = t.match(/^!\[([^\]]*)\]\(([^)]+)\)/);
764
+ if (u) {
765
+ const i = u[1] || u[2], L = u[2];
766
+ n.push(
767
+ /* @__PURE__ */ e(
768
+ "a",
769
+ {
770
+ href: L,
771
+ target: "_blank",
772
+ rel: "noopener noreferrer",
773
+ style: {
774
+ color: "var(--rail-discovery, #5E88B0)",
775
+ textDecoration: "underline",
776
+ textUnderlineOffset: "2px"
777
+ },
778
+ children: i
779
+ },
780
+ `img-link-${r++}`
781
+ )
782
+ ), t = t.slice(u[0].length);
761
783
  continue;
762
784
  }
763
- const m = e.match(/^\[([^\]]+)\]\(([^)]+)\)/);
764
- if (m) {
765
- const A = m[1], B = m[2], L = A === "View", D = {
785
+ const w = t.match(/^\[([^\]]+)\]\(([^)]+)\)/);
786
+ if (w) {
787
+ const i = w[1], L = w[2], A = i === "View", F = {
766
788
  display: "inline-flex",
767
789
  alignItems: "center",
768
790
  padding: "3px 10px",
@@ -774,83 +796,279 @@ const w = [
774
796
  fontWeight: 600,
775
797
  whiteSpace: "nowrap",
776
798
  cursor: "pointer"
777
- }, T = {
799
+ }, R = {
778
800
  color: "var(--rail-discovery, #5E88B0)",
779
801
  textDecoration: "underline",
780
802
  textUnderlineOffset: "2px"
781
803
  };
782
804
  n.push(
783
- /* @__PURE__ */ t(
805
+ /* @__PURE__ */ e(
784
806
  "a",
785
807
  {
786
- href: B,
808
+ href: L,
787
809
  target: "_blank",
788
810
  rel: "noopener noreferrer",
789
- style: L ? D : T,
790
- children: A
811
+ style: A ? F : R,
812
+ children: i
791
813
  },
792
814
  `link-${r++}`
793
815
  )
794
- ), e = e.slice(m[0].length);
816
+ ), t = t.slice(w[0].length);
795
817
  continue;
796
818
  }
797
- const S = e.search(/[`*\[]/);
798
- if (S === -1) {
799
- n.push(e);
819
+ const B = t.search(/[`*\[!]/);
820
+ if (B === -1) {
821
+ n.push(t);
800
822
  break;
801
823
  } else
802
- S === 0 ? (n.push(e[0]), e = e.slice(1)) : (n.push(e.slice(0, S)), e = e.slice(S));
824
+ B === 0 ? (n.push(t[0]), t = t.slice(1)) : (n.push(t.slice(0, B)), t = t.slice(B));
803
825
  }
804
826
  return n.length === 1 && typeof n[0] == "string" ? n[0] : n;
805
- }, o = (l) => x(l);
806
- return /* @__PURE__ */ t("div", { children: k(d) });
807
- };
808
- function _t({
809
- role: d,
810
- content: c,
811
- html: g,
812
- timestamp: a,
813
- toolBadges: i,
814
- isStreaming: u,
815
- onCodeBlockClick: h,
816
- onFilePathClick: k
827
+ }, g = (s) => v(s);
828
+ return /* @__PURE__ */ e("div", { children: k(l) });
829
+ }, D = "#808183", W = "#2e3236";
830
+ function je(l) {
831
+ return l ? l.replace(/```[a-zA-Z0-9]*\n?([\s\S]*?)```/g, "$1").replace(/`([^`]+)`/g, "$1").replace(
832
+ /!\[([^\]]*)\]\(([^)]*)\)/g,
833
+ (d, c, o) => c.trim() && c.trim() !== o.trim() ? `${c} (${o})` : o
834
+ ).replace(
835
+ /\[([^\]]+)\]\(([^)]*)\)/g,
836
+ (d, c, o) => c.trim() && c.trim() !== o.trim() ? `${c} (${o})` : o
837
+ ).replace(/(\*\*|__)(.*?)\1/g, "$2").replace(/(\*|_)(.*?)\1/g, "$2").replace(/~~(.*?)~~/g, "$1").replace(/^\s{0,3}#{1,6}\s+/gm, "").replace(/^\s{0,3}>\s?/gm, "").replace(/^\s*[-*+]\s+/gm, "• ").replace(/^\s*([-*_])\1{2,}\s*$/gm, "").trim() : "";
838
+ }
839
+ function He({ timestamp: l, content: d, showFeedback: c, align: o = "start", onFeedback: a, initialRating: f = null }) {
840
+ const [p, k] = G(!1), [v, g] = G(f), [s, n] = G(!1), [t, r] = G(""), x = he(null);
841
+ be(() => {
842
+ if (!s)
843
+ return;
844
+ const i = (A) => {
845
+ x.current && !x.current.contains(A.target) && n(!1);
846
+ }, L = (A) => {
847
+ A.key === "Escape" && n(!1);
848
+ };
849
+ return document.addEventListener("mousedown", i), document.addEventListener("keydown", L), () => {
850
+ document.removeEventListener("mousedown", i), document.removeEventListener("keydown", L);
851
+ };
852
+ }, [s]);
853
+ const b = async () => {
854
+ try {
855
+ await navigator.clipboard.writeText(je(d || "")), k(!0), setTimeout(() => k(!1), 1500);
856
+ } catch (i) {
857
+ console.error("Failed to copy message:", i);
858
+ }
859
+ }, h = () => {
860
+ n(!1), g("up"), a == null || a({ rating: "up" });
861
+ }, u = () => {
862
+ g("down"), n(!1), a == null || a({
863
+ rating: "down",
864
+ ...t.trim() ? { reason: t.trim() } : {}
865
+ });
866
+ }, w = {
867
+ display: "inline-flex",
868
+ alignItems: "center",
869
+ justifyContent: "center",
870
+ padding: 0,
871
+ background: "transparent",
872
+ border: "none",
873
+ cursor: "pointer",
874
+ color: D,
875
+ transition: "color 0.12s ease"
876
+ }, B = /* @__PURE__ */ e("span", { style: { fontSize: "13px", color: D, lineHeight: "normal" }, children: "•" });
877
+ return /* @__PURE__ */ y(
878
+ "div",
879
+ {
880
+ style: {
881
+ position: "relative",
882
+ display: "flex",
883
+ alignItems: "center",
884
+ gap: "8px",
885
+ marginTop: "8px",
886
+ justifyContent: o === "end" ? "flex-end" : "flex-start"
887
+ },
888
+ children: [
889
+ l && /* @__PURE__ */ e("span", { style: { fontSize: "13px", color: D, whiteSpace: "nowrap" }, children: l }),
890
+ l && B,
891
+ /* @__PURE__ */ e(
892
+ "button",
893
+ {
894
+ type: "button",
895
+ title: p ? "Copied" : "Copy",
896
+ onClick: b,
897
+ style: { ...w, color: p ? "#1f9d57" : D },
898
+ onMouseEnter: (i) => {
899
+ p || (i.currentTarget.style.color = W);
900
+ },
901
+ onMouseLeave: (i) => {
902
+ p || (i.currentTarget.style.color = D);
903
+ },
904
+ children: p ? /* @__PURE__ */ e(ge, { size: 16 }) : /* @__PURE__ */ e(ue, { size: 16 })
905
+ }
906
+ ),
907
+ c && /* @__PURE__ */ y(ye, { children: [
908
+ B,
909
+ /* @__PURE__ */ y("div", { style: { display: "inline-flex", alignItems: "center", gap: "16px" }, children: [
910
+ /* @__PURE__ */ e(
911
+ "button",
912
+ {
913
+ type: "button",
914
+ title: "Good response",
915
+ onClick: h,
916
+ style: { ...w, color: v === "up" ? W : D },
917
+ onMouseEnter: (i) => i.currentTarget.style.color = W,
918
+ onMouseLeave: (i) => i.currentTarget.style.color = v === "up" ? W : D,
919
+ children: /* @__PURE__ */ e(Be, { size: 16, fill: v === "up" ? "currentColor" : "none" })
920
+ }
921
+ ),
922
+ /* @__PURE__ */ e(
923
+ "button",
924
+ {
925
+ type: "button",
926
+ title: "Bad response",
927
+ onClick: () => n((i) => !i),
928
+ style: {
929
+ ...w,
930
+ color: v === "down" || s ? W : D
931
+ },
932
+ onMouseEnter: (i) => i.currentTarget.style.color = W,
933
+ onMouseLeave: (i) => i.currentTarget.style.color = v === "down" || s ? W : D,
934
+ children: /* @__PURE__ */ e(ze, { size: 16, fill: v === "down" ? "currentColor" : "none" })
935
+ }
936
+ )
937
+ ] })
938
+ ] }),
939
+ s && /* @__PURE__ */ y(
940
+ "div",
941
+ {
942
+ ref: x,
943
+ style: {
944
+ position: "absolute",
945
+ top: "calc(100% + 6px)",
946
+ [o === "end" ? "right" : "left"]: 0,
947
+ zIndex: 30,
948
+ width: "300px",
949
+ background: "#FFFFFF",
950
+ border: "1px solid #d9d9d9",
951
+ borderRadius: "10px",
952
+ boxShadow: "0 4px 16px rgba(0,0,0,0.12)",
953
+ padding: "12px",
954
+ display: "flex",
955
+ flexDirection: "column",
956
+ gap: "10px",
957
+ textAlign: "left"
958
+ },
959
+ children: [
960
+ /* @__PURE__ */ e("div", { style: { fontSize: "13px", fontWeight: 600, color: W }, children: "What was wrong with this response?" }),
961
+ /* @__PURE__ */ e(
962
+ "textarea",
963
+ {
964
+ value: t,
965
+ onChange: (i) => r(i.target.value),
966
+ placeholder: "Add details (optional)",
967
+ rows: 3,
968
+ style: {
969
+ width: "100%",
970
+ boxSizing: "border-box",
971
+ resize: "none",
972
+ border: "1px solid #d9d9d9",
973
+ borderRadius: "8px",
974
+ padding: "8px",
975
+ fontSize: "13px",
976
+ color: W,
977
+ fontFamily: "inherit",
978
+ outline: "none"
979
+ }
980
+ }
981
+ ),
982
+ /* @__PURE__ */ y("div", { style: { display: "flex", justifyContent: "flex-end", gap: "8px" }, children: [
983
+ /* @__PURE__ */ e(
984
+ "button",
985
+ {
986
+ type: "button",
987
+ onClick: () => n(!1),
988
+ style: {
989
+ padding: "6px 12px",
990
+ fontSize: "12px",
991
+ fontWeight: 600,
992
+ color: W,
993
+ background: "#FFFFFF",
994
+ border: "1px solid #d9d9d9",
995
+ borderRadius: "6px",
996
+ cursor: "pointer"
997
+ },
998
+ children: "Cancel"
999
+ }
1000
+ ),
1001
+ /* @__PURE__ */ e(
1002
+ "button",
1003
+ {
1004
+ type: "button",
1005
+ onClick: u,
1006
+ style: {
1007
+ padding: "6px 12px",
1008
+ fontSize: "12px",
1009
+ fontWeight: 600,
1010
+ color: "#f2f2f0",
1011
+ background: "#0B0B0B",
1012
+ border: "1px solid #0B0B0B",
1013
+ borderRadius: "6px",
1014
+ cursor: "pointer"
1015
+ },
1016
+ children: "Submit"
1017
+ }
1018
+ )
1019
+ ] })
1020
+ ]
1021
+ }
1022
+ )
1023
+ ]
1024
+ }
1025
+ );
1026
+ }
1027
+ function Ye({
1028
+ role: l,
1029
+ content: d,
1030
+ html: c,
1031
+ timestamp: o,
1032
+ toolBadges: a,
1033
+ isStreaming: f,
1034
+ onCodeBlockClick: p,
1035
+ onFilePathClick: k,
1036
+ onFeedback: v,
1037
+ feedbackRating: g,
1038
+ afterContent: s
817
1039
  }) {
818
- const x = d === "user";
1040
+ const n = l === "user";
819
1041
  return /* @__PURE__ */ y(
820
1042
  "div",
821
1043
  {
822
1044
  style: {
823
1045
  display: "flex",
824
1046
  flexDirection: "column",
825
- alignItems: x ? "flex-end" : "flex-start",
1047
+ alignItems: n ? "flex-end" : "flex-start",
826
1048
  marginBottom: "16px",
827
1049
  width: "100%",
828
1050
  maxWidth: "100%"
829
1051
  },
830
1052
  children: [
831
- /* @__PURE__ */ y(
1053
+ /* @__PURE__ */ e(
832
1054
  "div",
833
1055
  {
834
1056
  style: {
835
- fontSize: "var(--text-sm, 11px)",
836
- color: "var(--text-faint, rgba(30,33,37,0.36))",
837
- marginBottom: "6px",
838
- fontWeight: 650,
839
- letterSpacing: "0.02em"
1057
+ fontSize: "13px",
1058
+ fontWeight: 400,
1059
+ color: D,
1060
+ marginBottom: "6px"
840
1061
  },
841
- children: [
842
- x ? "You" : "Compass",
843
- u && !x && /* @__PURE__ */ t("span", { style: { marginLeft: "6px", color: "var(--rail-purple, #9B7AA8)" }, children: "●" })
844
- ]
1062
+ children: n ? "You" : "Compass"
845
1063
  }
846
1064
  ),
847
- i && i.length > 0 && /* @__PURE__ */ t("div", { style: {
1065
+ a && a.length > 0 && /* @__PURE__ */ e("div", { style: {
848
1066
  marginBottom: "8px",
849
1067
  display: "flex",
850
1068
  flexWrap: "wrap",
851
1069
  gap: "4px",
852
1070
  maxWidth: "75%"
853
- }, children: i.map((o, l) => /* @__PURE__ */ y(
1071
+ }, children: a.map((t, r) => /* @__PURE__ */ y(
854
1072
  "span",
855
1073
  {
856
1074
  style: {
@@ -859,51 +1077,63 @@ function _t({
859
1077
  padding: "2px 8px",
860
1078
  borderRadius: "6px",
861
1079
  background: "var(--paper-elevated, rgba(255,255,255,0.82))",
862
- border: `1px solid ${o.pending ? "var(--rail-discovery, #5A8CC0)" : o.success !== !1 ? "var(--state-present, #5CB85C)" : "var(--rail-signal-churn, #C98A5A)"}`,
863
- color: o.pending ? "var(--rail-discovery, #5A8CC0)" : o.success !== !1 ? "var(--state-present, #5CB85C)" : "var(--rail-signal-churn, #C98A5A)"
1080
+ border: `1px solid ${t.pending ? "var(--rail-discovery, #5A8CC0)" : t.success !== !1 ? "var(--state-present, #5CB85C)" : "var(--rail-signal-churn, #C98A5A)"}`,
1081
+ color: t.pending ? "var(--rail-discovery, #5A8CC0)" : t.success !== !1 ? "var(--state-present, #5CB85C)" : "var(--rail-signal-churn, #C98A5A)"
864
1082
  },
865
1083
  children: [
866
- /* @__PURE__ */ t(vt, { size: 10, style: { marginRight: 3, verticalAlign: "middle" } }),
867
- o.name,
868
- o.pending ? "..." : o.success !== !1 ? " ✓" : " ✗"
1084
+ /* @__PURE__ */ e(Re, { size: 10, style: { marginRight: 3, verticalAlign: "middle" } }),
1085
+ t.name,
1086
+ t.pending ? "..." : t.success !== !1 ? " ✓" : " ✗"
869
1087
  ]
870
1088
  },
871
- o.id || l
1089
+ t.id || r
872
1090
  )) }),
873
- /* @__PURE__ */ t(
1091
+ /* @__PURE__ */ e(
874
1092
  "div",
875
1093
  {
876
- style: {
1094
+ style: n ? {
1095
+ maxWidth: "85%",
1096
+ width: "fit-content",
1097
+ padding: "12px 16px",
1098
+ borderRadius: "8px",
1099
+ background: "#f3f7f7",
1100
+ // grey/hover
1101
+ fontSize: "14px",
1102
+ lineHeight: 1.6,
1103
+ color: "#2e3236",
1104
+ // grey/strong
1105
+ wordBreak: "break-word"
1106
+ } : {
877
1107
  width: "100%",
878
1108
  maxWidth: "100%",
879
- padding: "12px 16px",
880
- borderRadius: "var(--radius-lg, 12px)",
881
- background: x ? "var(--card-customer, rgba(94,136,176,0.08))" : "var(--paper-elevated, rgba(255,255,255,0.82))",
882
- border: x ? "1px solid var(--border-subtle, rgba(52,58,64,0.08))" : "1px solid var(--border, rgba(52,58,64,0.12))",
883
- fontSize: "var(--text-base, 14px)",
1109
+ padding: "20px 24px",
1110
+ border: "1px solid #e6e6e6",
1111
+ borderRadius: "14px",
1112
+ background: "#FFFFFF",
1113
+ fontSize: "14px",
884
1114
  lineHeight: 1.6,
885
- color: "var(--text-strong, rgba(30,33,37,0.92))",
1115
+ color: "#2e3236",
886
1116
  wordBreak: "break-word"
887
1117
  },
888
- children: g ? /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: g } }) : x ? (
1118
+ children: c ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: c } }) : n ? (
889
1119
  // User messages stay plain text
890
- /* @__PURE__ */ t("div", { style: { whiteSpace: "pre-wrap" }, children: c })
1120
+ /* @__PURE__ */ e("div", { style: { whiteSpace: "pre-wrap" }, children: d })
891
1121
  ) : (
892
1122
  // Assistant messages get markdown rendering
893
- /* @__PURE__ */ t(Mt, { content: c || "", onCodeBlockClick: h, onFilePathClick: k })
1123
+ /* @__PURE__ */ e(_e, { content: d || "", onCodeBlockClick: p, onFilePathClick: k })
894
1124
  )
895
1125
  }
896
1126
  ),
897
- a && /* @__PURE__ */ t(
898
- "div",
1127
+ s && /* @__PURE__ */ e("div", { style: { width: "100%", marginTop: "10px" }, children: s }),
1128
+ !(f && !n) && /* @__PURE__ */ e(
1129
+ He,
899
1130
  {
900
- style: {
901
- fontSize: "var(--text-xs-plus, 10.5px)",
902
- color: "var(--text-faint, rgba(30,33,37,0.36))",
903
- marginTop: "4px",
904
- fontFamily: "var(--font-mono, monospace)"
905
- },
906
- children: a
1131
+ timestamp: o,
1132
+ content: d,
1133
+ showFeedback: !n,
1134
+ align: n ? "end" : "start",
1135
+ onFeedback: v,
1136
+ initialRating: g
907
1137
  }
908
1138
  )
909
1139
  ]
@@ -911,7 +1141,7 @@ function _t({
911
1141
  );
912
1142
  }
913
1143
  export {
914
- _t as C,
915
- Pt as a
1144
+ Ye as C,
1145
+ Ge as a
916
1146
  };
917
1147
  //# sourceMappingURL=ChatMessage.es.js.map