chordia-ui 3.7.0 → 3.7.2
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/dist/ChatMessage.cjs.js +15 -0
- package/dist/ChatMessage.cjs.js.map +1 -0
- package/dist/ChatMessage.es.js +915 -0
- package/dist/ChatMessage.es.js.map +1 -0
- package/dist/SideDrawer.cjs.js +2 -0
- package/dist/SideDrawer.cjs.js.map +1 -0
- package/dist/SideDrawer.es.js +358 -0
- package/dist/SideDrawer.es.js.map +1 -0
- package/dist/Toast.cjs.js +2 -2
- package/dist/Toast.cjs.js.map +1 -1
- package/dist/Toast.es.js +301 -671
- package/dist/Toast.es.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.cjs.js +4 -4
- package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
- package/dist/components/UpdatedInteractionDetails.es.js +652 -603
- package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
- package/dist/components/chat.cjs.js +5 -7
- package/dist/components/chat.cjs.js.map +1 -1
- package/dist/components/chat.es.js +393 -849
- package/dist/components/chat.es.js.map +1 -1
- package/dist/components/common.cjs.js +1 -1
- package/dist/components/common.es.js +28 -27
- package/dist/components/common.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +73 -72
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionContext.jsx +6 -2
- package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +190 -139
- package/src/components/chat/ChartRenderer.jsx +300 -49
- package/src/components/common/AskCompass.jsx +91 -87
- package/src/components/common/SideDrawer.jsx +7 -3
- package/dist/ChartRenderer.cjs.js +0 -3
- package/dist/ChartRenderer.cjs.js.map +0 -1
- package/dist/ChartRenderer.es.js +0 -304
- package/dist/ChartRenderer.es.js.map +0 -1
package/dist/ChartRenderer.es.js
DELETED
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import et, { useRef as nt, useCallback as Y } from "react";
|
|
3
|
-
import { ResponsiveContainer as R, PieChart as rt, Pie as at, Cell as G, Tooltip as D, AreaChart as ot, CartesianGrid as N, XAxis as P, YAxis as K, Legend as j, Area as it, LineChart as lt, Line as st, BarChart as H, Bar as q } from "recharts";
|
|
4
|
-
const r = [
|
|
5
|
-
"#5E88B0",
|
|
6
|
-
// rail-discovery / rail-blue
|
|
7
|
-
"#9B7AA8",
|
|
8
|
-
// rail-purple / rail-tone
|
|
9
|
-
"#C98A5A",
|
|
10
|
-
// rail-compliance / rail-orange
|
|
11
|
-
"#7BA89D",
|
|
12
|
-
// rail-signal-upsell (teal-green)
|
|
13
|
-
"#D17B6B",
|
|
14
|
-
// rail-coral / rail-signal-churn
|
|
15
|
-
"#6B7C93",
|
|
16
|
-
// rail-slate / rail-outcome
|
|
17
|
-
"#9B8E6F",
|
|
18
|
-
// rail-olive / rail-signal-satisfaction
|
|
19
|
-
"#8A9BAF",
|
|
20
|
-
// rail-quality
|
|
21
|
-
"#B8976A",
|
|
22
|
-
// rail-teal (warm gold)
|
|
23
|
-
"#A8C76B"
|
|
24
|
-
// green accent (complementary)
|
|
25
|
-
], V = { fill: "var(--text-muted, #666)", fontSize: 12 }, b = { stroke: "var(--border, #e0e0e0)" }, O = "var(--border, #e0e0e0)", z = {
|
|
26
|
-
contentStyle: {
|
|
27
|
-
backgroundColor: "var(--paper-elevated, #fff)",
|
|
28
|
-
border: "1px solid var(--border, #e0e0e0)",
|
|
29
|
-
borderRadius: "var(--radius-sm, 4px)",
|
|
30
|
-
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
31
|
-
color: "var(--text-ink, #1e2125)"
|
|
32
|
-
},
|
|
33
|
-
labelStyle: { color: "var(--text-strong, #1e2125)" }
|
|
34
|
-
}, U = { color: "var(--text-ink, #1e2125)", fontSize: "12px" }, ct = (l, s) => {
|
|
35
|
-
if (!l)
|
|
36
|
-
return !1;
|
|
37
|
-
const c = l.toLowerCase();
|
|
38
|
-
return s.filter((o) => String(o).toLowerCase().includes(c)).length < s.length * 0.5;
|
|
39
|
-
}, dt = async (l, s) => {
|
|
40
|
-
const c = l.querySelector("svg");
|
|
41
|
-
if (!c)
|
|
42
|
-
return;
|
|
43
|
-
const i = c.cloneNode(!0), o = c.clientWidth || 600, h = c.clientHeight || 300;
|
|
44
|
-
i.setAttribute("width", o), i.setAttribute("height", h), i.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
45
|
-
const w = document.createElement("style");
|
|
46
|
-
w.textContent = 'text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }', i.insertBefore(w, i.firstChild);
|
|
47
|
-
const k = new XMLSerializer().serializeToString(i), f = new Blob([k], { type: "image/svg+xml;charset=utf-8" }), p = URL.createObjectURL(f), x = new Image();
|
|
48
|
-
x.onload = () => {
|
|
49
|
-
const m = document.createElement("canvas"), S = 2;
|
|
50
|
-
m.width = o * S, m.height = h * S;
|
|
51
|
-
const y = m.getContext("2d");
|
|
52
|
-
y.fillStyle = "#ffffff", y.fillRect(0, 0, m.width, m.height), y.scale(S, S), y.drawImage(x, 0, 0, o, h), URL.revokeObjectURL(p);
|
|
53
|
-
const I = document.createElement("a");
|
|
54
|
-
I.download = `${(s || "chart").replace(/[^a-z0-9]+/gi, "_")}.png`, I.href = m.toDataURL("image/png"), I.click();
|
|
55
|
-
}, x.src = p;
|
|
56
|
-
}, ht = (l, s) => {
|
|
57
|
-
const c = ["", ...l.map((h) => h.name)].join(","), i = s.map((h) => {
|
|
58
|
-
const w = l.map((k) => {
|
|
59
|
-
const f = k.data.find((p) => p.x === h);
|
|
60
|
-
return f ? f.y : "";
|
|
61
|
-
});
|
|
62
|
-
return [h, ...w].join(",");
|
|
63
|
-
}), o = [c, ...i].join(`
|
|
64
|
-
`);
|
|
65
|
-
navigator.clipboard.writeText(o);
|
|
66
|
-
}, pt = ({ onDownload: l, onCopy: s, copied: c }) => /* @__PURE__ */ d("div", { style: {
|
|
67
|
-
display: "flex",
|
|
68
|
-
gap: 6,
|
|
69
|
-
justifyContent: "flex-end",
|
|
70
|
-
marginBottom: 8,
|
|
71
|
-
opacity: 0.7,
|
|
72
|
-
transition: "opacity 0.15s"
|
|
73
|
-
}, children: [
|
|
74
|
-
/* @__PURE__ */ t("button", { onClick: s, title: "Copy data as CSV", style: {
|
|
75
|
-
background: "none",
|
|
76
|
-
border: "1px solid var(--border, #e0e0e0)",
|
|
77
|
-
borderRadius: "var(--radius-sm, 4px)",
|
|
78
|
-
padding: "3px 8px",
|
|
79
|
-
fontSize: 11,
|
|
80
|
-
color: "var(--text-muted, #666)",
|
|
81
|
-
cursor: "pointer",
|
|
82
|
-
display: "flex",
|
|
83
|
-
alignItems: "center",
|
|
84
|
-
gap: 4
|
|
85
|
-
}, children: c ? "✓ Copied" : "📋 CSV" }),
|
|
86
|
-
/* @__PURE__ */ t("button", { onClick: l, title: "Download as PNG", style: {
|
|
87
|
-
background: "none",
|
|
88
|
-
border: "1px solid var(--border, #e0e0e0)",
|
|
89
|
-
borderRadius: "var(--radius-sm, 4px)",
|
|
90
|
-
padding: "3px 8px",
|
|
91
|
-
fontSize: 11,
|
|
92
|
-
color: "var(--text-muted, #666)",
|
|
93
|
-
cursor: "pointer",
|
|
94
|
-
display: "flex",
|
|
95
|
-
alignItems: "center",
|
|
96
|
-
gap: 4
|
|
97
|
-
}, children: "📥 PNG" })
|
|
98
|
-
] }), xt = ({ chartType: l, title: s, xLabel: c, yLabel: i, series: o }) => {
|
|
99
|
-
const h = nt(null), [w, k] = et.useState(!1);
|
|
100
|
-
if (!o || o.length === 0)
|
|
101
|
-
return null;
|
|
102
|
-
const f = [...new Set(o.flatMap((e) => e.data.map((n) => n.x)))], p = f.map((e) => {
|
|
103
|
-
const n = { x: e };
|
|
104
|
-
return o.forEach((u) => {
|
|
105
|
-
const a = u.data.find((g) => g.x === e);
|
|
106
|
-
n[u.name] = a ? a.y : null;
|
|
107
|
-
}), n;
|
|
108
|
-
}), x = o.map((e) => e.name), m = x.length === 1, S = ct(c, f), y = S ? 20 : 5, E = Math.max(...f.map((e) => String(e).length)) > 12 || f.length > 8, $ = {
|
|
109
|
-
background: "var(--paper-elevated, #fff)",
|
|
110
|
-
border: "1px solid var(--border, #e0e0e0)",
|
|
111
|
-
borderRadius: "var(--radius-md, 8px)",
|
|
112
|
-
padding: "16px",
|
|
113
|
-
marginBottom: "16px"
|
|
114
|
-
}, J = {
|
|
115
|
-
color: "var(--text-strong, #1e2125)",
|
|
116
|
-
fontSize: "14px",
|
|
117
|
-
fontWeight: "600",
|
|
118
|
-
marginBottom: "12px"
|
|
119
|
-
}, W = {
|
|
120
|
-
dataKey: "x",
|
|
121
|
-
tick: E ? { fill: "var(--text-muted, #666)", fontSize: 11, angle: -35, textAnchor: "end" } : V,
|
|
122
|
-
axisLine: b,
|
|
123
|
-
tickLine: b,
|
|
124
|
-
...S ? {
|
|
125
|
-
label: { value: c, position: "insideBottom", offset: -10, style: { textAnchor: "middle", fill: "var(--text-muted, #666)" } }
|
|
126
|
-
} : {}
|
|
127
|
-
}, X = {
|
|
128
|
-
tick: V,
|
|
129
|
-
axisLine: b,
|
|
130
|
-
tickLine: b,
|
|
131
|
-
...i ? {
|
|
132
|
-
label: { value: i, angle: -90, position: "insideLeft", style: { textAnchor: "middle", fill: "var(--text-muted, #666)" } }
|
|
133
|
-
} : {}
|
|
134
|
-
}, Q = () => {
|
|
135
|
-
switch (l) {
|
|
136
|
-
case "bar":
|
|
137
|
-
return /* @__PURE__ */ t(R, { width: "100%", height: 300, children: /* @__PURE__ */ d(H, { data: p, margin: { top: 5, right: 30, left: 20, bottom: E ? 40 : y }, children: [
|
|
138
|
-
/* @__PURE__ */ t(N, { strokeDasharray: "3 3", stroke: O }),
|
|
139
|
-
/* @__PURE__ */ t(P, { ...W }),
|
|
140
|
-
/* @__PURE__ */ t(K, { ...X }),
|
|
141
|
-
/* @__PURE__ */ t(D, { ...z }),
|
|
142
|
-
!m && /* @__PURE__ */ t(j, { wrapperStyle: U }),
|
|
143
|
-
x.map((e, n) => /* @__PURE__ */ t(q, { dataKey: e, fill: r[n % r.length], radius: [2, 2, 0, 0], isAnimationActive: !1, children: m && p.map((u, a) => /* @__PURE__ */ t(G, { fill: r[a % r.length] }, a)) }, e))
|
|
144
|
-
] }) });
|
|
145
|
-
case "horizontal_bar":
|
|
146
|
-
return /* @__PURE__ */ t(R, { width: "100%", height: Math.max(300, p.length * 40), children: /* @__PURE__ */ d(H, { data: p, layout: "vertical", margin: { top: 5, right: 30, left: 100, bottom: 5 }, children: [
|
|
147
|
-
/* @__PURE__ */ t(N, { strokeDasharray: "3 3", stroke: O }),
|
|
148
|
-
/* @__PURE__ */ t(
|
|
149
|
-
P,
|
|
150
|
-
{
|
|
151
|
-
type: "number",
|
|
152
|
-
tick: V,
|
|
153
|
-
axisLine: b,
|
|
154
|
-
tickLine: b,
|
|
155
|
-
...i ? { label: { value: i, position: "insideBottom", offset: -5, style: { textAnchor: "middle", fill: "var(--text-muted, #666)" } } } : {}
|
|
156
|
-
}
|
|
157
|
-
),
|
|
158
|
-
/* @__PURE__ */ t(K, { type: "category", dataKey: "x", tick: { fill: "var(--text-muted, #666)", fontSize: 11 }, width: 90, axisLine: b, tickLine: b }),
|
|
159
|
-
/* @__PURE__ */ t(D, { ...z }),
|
|
160
|
-
!m && /* @__PURE__ */ t(j, { wrapperStyle: U }),
|
|
161
|
-
x.map((e, n) => /* @__PURE__ */ t(q, { dataKey: e, fill: r[n % r.length], radius: [0, 2, 2, 0], isAnimationActive: !1, children: m && p.map((u, a) => /* @__PURE__ */ t(G, { fill: r[a % r.length] }, a)) }, e))
|
|
162
|
-
] }) });
|
|
163
|
-
case "line":
|
|
164
|
-
return /* @__PURE__ */ t(R, { width: "100%", height: 300, children: /* @__PURE__ */ d(lt, { data: p, margin: { top: 5, right: 30, left: 20, bottom: E ? 40 : y }, children: [
|
|
165
|
-
/* @__PURE__ */ t(N, { strokeDasharray: "3 3", stroke: O }),
|
|
166
|
-
/* @__PURE__ */ t(P, { ...W }),
|
|
167
|
-
/* @__PURE__ */ t(K, { ...X }),
|
|
168
|
-
/* @__PURE__ */ t(D, { ...z }),
|
|
169
|
-
/* @__PURE__ */ t(j, { wrapperStyle: U }),
|
|
170
|
-
x.map((e, n) => /* @__PURE__ */ t(
|
|
171
|
-
st,
|
|
172
|
-
{
|
|
173
|
-
type: "monotone",
|
|
174
|
-
dataKey: e,
|
|
175
|
-
stroke: r[n % r.length],
|
|
176
|
-
strokeWidth: 2,
|
|
177
|
-
dot: { r: 4, fill: r[n % r.length] },
|
|
178
|
-
activeDot: { r: 6, fill: r[n % r.length] },
|
|
179
|
-
isAnimationActive: !1
|
|
180
|
-
},
|
|
181
|
-
e
|
|
182
|
-
))
|
|
183
|
-
] }) });
|
|
184
|
-
case "area":
|
|
185
|
-
return /* @__PURE__ */ t(R, { width: "100%", height: 300, children: /* @__PURE__ */ d(ot, { data: p, margin: { top: 5, right: 30, left: 20, bottom: E ? 40 : y }, children: [
|
|
186
|
-
/* @__PURE__ */ t(N, { strokeDasharray: "3 3", stroke: O }),
|
|
187
|
-
/* @__PURE__ */ t(P, { ...W }),
|
|
188
|
-
/* @__PURE__ */ t(K, { ...X }),
|
|
189
|
-
/* @__PURE__ */ t(D, { ...z }),
|
|
190
|
-
/* @__PURE__ */ t(j, { wrapperStyle: U }),
|
|
191
|
-
x.map((e, n) => /* @__PURE__ */ t(
|
|
192
|
-
it,
|
|
193
|
-
{
|
|
194
|
-
type: "monotone",
|
|
195
|
-
dataKey: e,
|
|
196
|
-
stroke: r[n % r.length],
|
|
197
|
-
strokeWidth: 2,
|
|
198
|
-
fill: r[n % r.length],
|
|
199
|
-
fillOpacity: 0.15,
|
|
200
|
-
isAnimationActive: !1
|
|
201
|
-
},
|
|
202
|
-
e
|
|
203
|
-
))
|
|
204
|
-
] }) });
|
|
205
|
-
case "pie": {
|
|
206
|
-
const e = o[0].data.map((a, g) => ({
|
|
207
|
-
name: a.x,
|
|
208
|
-
value: a.y,
|
|
209
|
-
fill: r[g % r.length]
|
|
210
|
-
})), n = Math.PI / 180;
|
|
211
|
-
return /* @__PURE__ */ t(R, { width: "100%", height: 320, children: /* @__PURE__ */ d(rt, { children: [
|
|
212
|
-
/* @__PURE__ */ t(
|
|
213
|
-
at,
|
|
214
|
-
{
|
|
215
|
-
data: e,
|
|
216
|
-
cx: "50%",
|
|
217
|
-
cy: "50%",
|
|
218
|
-
outerRadius: 100,
|
|
219
|
-
dataKey: "value",
|
|
220
|
-
label: ({ cx: a, cy: g, midAngle: A, innerRadius: L, outerRadius: F, percent: C, name: B }) => {
|
|
221
|
-
const M = F + 20, T = a + M * Math.cos(-A * n), _ = g + M * Math.sin(-A * n);
|
|
222
|
-
return C < 0.04 ? null : /* @__PURE__ */ d(
|
|
223
|
-
"text",
|
|
224
|
-
{
|
|
225
|
-
x: T,
|
|
226
|
-
y: _,
|
|
227
|
-
fill: "var(--text-ink, #1e2125)",
|
|
228
|
-
fontSize: 11,
|
|
229
|
-
textAnchor: T > a ? "start" : "end",
|
|
230
|
-
dominantBaseline: "central",
|
|
231
|
-
children: [
|
|
232
|
-
B,
|
|
233
|
-
" (",
|
|
234
|
-
(C * 100).toFixed(0),
|
|
235
|
-
"%)"
|
|
236
|
-
]
|
|
237
|
-
}
|
|
238
|
-
);
|
|
239
|
-
},
|
|
240
|
-
labelLine: { stroke: "var(--text-muted, #666)" },
|
|
241
|
-
isAnimationActive: !1,
|
|
242
|
-
children: e.map((a, g) => /* @__PURE__ */ t(G, { fill: a.fill }, g))
|
|
243
|
-
}
|
|
244
|
-
),
|
|
245
|
-
/* @__PURE__ */ t(D, { ...z })
|
|
246
|
-
] }) });
|
|
247
|
-
}
|
|
248
|
-
case "metric": {
|
|
249
|
-
const e = o[0], n = e.data[0], u = e.data.length > 1 ? e.data[1] : null, a = n.y, g = n.x || "", A = u !== null, L = A ? a - u.y : 0, F = A && u.y !== 0 ? L / Math.abs(u.y) * 100 : 0, C = L > 0, B = L < 0, M = C ? "#7BA89D" : B ? "#D17B6B" : "var(--text-muted, #666)", T = C ? "↑" : B ? "↓" : "→", _ = (v) => Number.isInteger(v) && Math.abs(v) >= 1e3 ? v.toLocaleString() : typeof v == "number" ? v % 1 === 0 ? v.toString() : v.toFixed(v < 10 ? 2 : 1) : String(v);
|
|
250
|
-
return /* @__PURE__ */ d("div", { style: { display: "flex", alignItems: "baseline", gap: 12, padding: "8px 0" }, children: [
|
|
251
|
-
/* @__PURE__ */ t("div", { style: {
|
|
252
|
-
fontSize: "36px",
|
|
253
|
-
fontWeight: 700,
|
|
254
|
-
lineHeight: 1,
|
|
255
|
-
color: "var(--text-strong, #1e2125)",
|
|
256
|
-
fontVariantNumeric: "tabular-nums"
|
|
257
|
-
}, children: _(a) }),
|
|
258
|
-
g && /* @__PURE__ */ t("div", { style: { fontSize: "14px", color: "var(--text-muted, #666)", fontWeight: 500 }, children: g }),
|
|
259
|
-
A && /* @__PURE__ */ d("div", { style: {
|
|
260
|
-
display: "flex",
|
|
261
|
-
alignItems: "center",
|
|
262
|
-
gap: 4,
|
|
263
|
-
fontSize: "13px",
|
|
264
|
-
fontWeight: 600,
|
|
265
|
-
color: M,
|
|
266
|
-
background: C ? "rgba(123,168,157,0.12)" : B ? "rgba(209,123,107,0.12)" : "rgba(128,128,128,0.08)",
|
|
267
|
-
padding: "3px 8px",
|
|
268
|
-
borderRadius: "var(--radius-sm, 4px)"
|
|
269
|
-
}, children: [
|
|
270
|
-
/* @__PURE__ */ t("span", { children: T }),
|
|
271
|
-
/* @__PURE__ */ d("span", { children: [
|
|
272
|
-
_(Math.abs(L)),
|
|
273
|
-
" (",
|
|
274
|
-
Math.abs(F).toFixed(1),
|
|
275
|
-
"%)"
|
|
276
|
-
] })
|
|
277
|
-
] }),
|
|
278
|
-
A && /* @__PURE__ */ d("div", { style: { fontSize: "11px", color: "var(--text-faint, #999)" }, children: [
|
|
279
|
-
"vs ",
|
|
280
|
-
u.x || "previous"
|
|
281
|
-
] })
|
|
282
|
-
] });
|
|
283
|
-
}
|
|
284
|
-
default:
|
|
285
|
-
return /* @__PURE__ */ d("div", { style: { color: "var(--text-muted)", fontSize: 12, padding: 8 }, children: [
|
|
286
|
-
"Unsupported chart type: ",
|
|
287
|
-
l
|
|
288
|
-
] });
|
|
289
|
-
}
|
|
290
|
-
}, Z = Y(() => {
|
|
291
|
-
h.current && dt(h.current, s);
|
|
292
|
-
}, [s]), tt = Y(() => {
|
|
293
|
-
ht(o, f), k(!0), setTimeout(() => k(!1), 2e3);
|
|
294
|
-
}, [o, f]);
|
|
295
|
-
return /* @__PURE__ */ d("div", { style: $, children: [
|
|
296
|
-
s && /* @__PURE__ */ t("div", { style: J, children: s }),
|
|
297
|
-
l !== "metric" && /* @__PURE__ */ t(pt, { onDownload: Z, onCopy: tt, copied: w }),
|
|
298
|
-
/* @__PURE__ */ t("div", { ref: h, children: Q() })
|
|
299
|
-
] });
|
|
300
|
-
};
|
|
301
|
-
export {
|
|
302
|
-
xt as C
|
|
303
|
-
};
|
|
304
|
-
//# sourceMappingURL=ChartRenderer.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChartRenderer.es.js","sources":["../src/components/chat/ChartRenderer.jsx"],"sourcesContent":["\"use client\";\nimport React, { useRef, useCallback } from 'react';\nimport {\n ResponsiveContainer, BarChart, Bar, Cell, LineChart, Line,\n XAxis, YAxis, CartesianGrid, Tooltip, Legend,\n PieChart, Pie, AreaChart, Area,\n} from 'recharts';\n\n// Chordia design system rail colors — ordered for max visual distinction\nconst COLORS = [\n '#5E88B0', // rail-discovery / rail-blue\n '#9B7AA8', // rail-purple / rail-tone\n '#C98A5A', // rail-compliance / rail-orange\n '#7BA89D', // rail-signal-upsell (teal-green)\n '#D17B6B', // rail-coral / rail-signal-churn\n '#6B7C93', // rail-slate / rail-outcome\n '#9B8E6F', // rail-olive / rail-signal-satisfaction\n '#8A9BAF', // rail-quality\n '#B8976A', // rail-teal (warm gold)\n '#A8C76B', // green accent (complementary)\n];\n\n// Shared axis/tooltip/legend styling\nconst AXIS_TICK = { fill: 'var(--text-muted, #666)', fontSize: 12 };\nconst AXIS_LINE = { stroke: 'var(--border, #e0e0e0)' };\nconst GRID_STROKE = 'var(--border, #e0e0e0)';\nconst TOOLTIP_STYLE = {\n contentStyle: {\n backgroundColor: 'var(--paper-elevated, #fff)',\n border: '1px solid var(--border, #e0e0e0)',\n borderRadius: 'var(--radius-sm, 4px)',\n boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',\n color: 'var(--text-ink, #1e2125)',\n },\n labelStyle: { color: 'var(--text-strong, #1e2125)' },\n};\nconst LEGEND_STYLE = { color: 'var(--text-ink, #1e2125)', fontSize: '12px' };\n\n// Smart label: skip x_label if tick values already contain the label text\nconst shouldShowAxisLabel = (label, tickValues) => {\n if (!label) return false;\n const lower = label.toLowerCase();\n // If most ticks contain the label word, it's redundant\n const matches = tickValues.filter(v => String(v).toLowerCase().includes(lower));\n return matches.length < tickValues.length * 0.5;\n};\n\n// --- Export utilities ---\nconst downloadPng = async (containerEl, title) => {\n const svg = containerEl.querySelector('svg');\n if (!svg) return;\n const clone = svg.cloneNode(true);\n // Ensure dimensions\n const w = svg.clientWidth || 600;\n const h = svg.clientHeight || 300;\n clone.setAttribute('width', w);\n clone.setAttribute('height', h);\n clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n // Inline computed styles for export fidelity\n const styleEl = document.createElement('style');\n styleEl.textContent = `text { font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; }`;\n clone.insertBefore(styleEl, clone.firstChild);\n const xml = new XMLSerializer().serializeToString(clone);\n const blob = new Blob([xml], { type: 'image/svg+xml;charset=utf-8' });\n const url = URL.createObjectURL(blob);\n const img = new Image();\n img.onload = () => {\n const canvas = document.createElement('canvas');\n const scale = 2; // retina\n canvas.width = w * scale;\n canvas.height = h * scale;\n const ctx = canvas.getContext('2d');\n ctx.fillStyle = '#ffffff';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.scale(scale, scale);\n ctx.drawImage(img, 0, 0, w, h);\n URL.revokeObjectURL(url);\n const link = document.createElement('a');\n link.download = `${(title || 'chart').replace(/[^a-z0-9]+/gi, '_')}.png`;\n link.href = canvas.toDataURL('image/png');\n link.click();\n };\n img.src = url;\n};\n\nconst copyAsCsv = (series, allXValues) => {\n const header = ['', ...series.map(s => s.name)].join(',');\n const rows = allXValues.map(x => {\n const vals = series.map(s => {\n const match = s.data.find(d => d.x === x);\n return match ? match.y : '';\n });\n return [x, ...vals].join(',');\n });\n const csv = [header, ...rows].join('\\n');\n navigator.clipboard.writeText(csv);\n};\n\nconst ActionBar = ({ onDownload, onCopy, copied }) => (\n <div style={{\n display: 'flex', gap: 6, justifyContent: 'flex-end',\n marginBottom: 8, opacity: 0.7, transition: 'opacity 0.15s',\n }}>\n <button onClick={onCopy} title=\"Copy data as CSV\" style={{\n background: 'none', border: '1px solid var(--border, #e0e0e0)',\n borderRadius: 'var(--radius-sm, 4px)', padding: '3px 8px',\n fontSize: 11, color: 'var(--text-muted, #666)', cursor: 'pointer',\n display: 'flex', alignItems: 'center', gap: 4,\n }}>\n {copied ? '✓ Copied' : '📋 CSV'}\n </button>\n <button onClick={onDownload} title=\"Download as PNG\" style={{\n background: 'none', border: '1px solid var(--border, #e0e0e0)',\n borderRadius: 'var(--radius-sm, 4px)', padding: '3px 8px',\n fontSize: 11, color: 'var(--text-muted, #666)', cursor: 'pointer',\n display: 'flex', alignItems: 'center', gap: 4,\n }}>\n 📥 PNG\n </button>\n </div>\n);\n\nconst ChartRenderer = ({ chartType, title, xLabel, yLabel, series }) => {\n const chartRef = useRef(null);\n const [copied, setCopied] = React.useState(false);\n\n if (!series || series.length === 0) return null;\n\n // Transform: merge all series into [{x, series1: val, series2: val}, ...]\n const allXValues = [...new Set(series.flatMap(s => s.data.map(d => d.x)))];\n const chartData = allXValues.map(x => {\n const point = { x };\n series.forEach(s => {\n const match = s.data.find(d => d.x === x);\n point[s.name] = match ? match.y : null;\n });\n return point;\n });\n\n const seriesNames = series.map(s => s.name);\n const isSingleSeries = seriesNames.length === 1;\n\n // Determine if axis labels are redundant\n const showXLabel = shouldShowAxisLabel(xLabel, allXValues);\n const bottomMargin = showXLabel ? 20 : 5;\n\n // Check if x-axis labels are long (rotate them)\n const maxTickLen = Math.max(...allXValues.map(v => String(v).length));\n const rotateXTicks = maxTickLen > 12 || allXValues.length > 8;\n\n const containerStyle = {\n background: 'var(--paper-elevated, #fff)',\n border: '1px solid var(--border, #e0e0e0)',\n borderRadius: 'var(--radius-md, 8px)',\n padding: '16px',\n marginBottom: '16px',\n };\n\n const titleStyle = {\n color: 'var(--text-strong, #1e2125)',\n fontSize: '14px',\n fontWeight: '600',\n marginBottom: '12px',\n };\n\n const xAxisProps = {\n dataKey: 'x',\n tick: rotateXTicks\n ? { fill: 'var(--text-muted, #666)', fontSize: 11, angle: -35, textAnchor: 'end' }\n : AXIS_TICK,\n axisLine: AXIS_LINE,\n tickLine: AXIS_LINE,\n ...(showXLabel ? {\n label: { value: xLabel, position: 'insideBottom', offset: -10, style: { textAnchor: 'middle', fill: 'var(--text-muted, #666)' } }\n } : {}),\n };\n\n const yAxisProps = {\n tick: AXIS_TICK,\n axisLine: AXIS_LINE,\n tickLine: AXIS_LINE,\n ...(yLabel ? {\n label: { value: yLabel, angle: -90, position: 'insideLeft', style: { textAnchor: 'middle', fill: 'var(--text-muted, #666)' } }\n } : {}),\n };\n\n const renderChart = () => {\n switch (chartType) {\n case 'bar':\n return (\n <ResponsiveContainer width=\"100%\" height={300}>\n <BarChart data={chartData} margin={{ top: 5, right: 30, left: 20, bottom: rotateXTicks ? 40 : bottomMargin }}>\n <CartesianGrid strokeDasharray=\"3 3\" stroke={GRID_STROKE} />\n <XAxis {...xAxisProps} />\n <YAxis {...yAxisProps} />\n <Tooltip {...TOOLTIP_STYLE} />\n {!isSingleSeries && <Legend wrapperStyle={LEGEND_STYLE} />}\n {seriesNames.map((name, i) => (\n <Bar key={name} dataKey={name} fill={COLORS[i % COLORS.length]} radius={[2, 2, 0, 0]} isAnimationActive={false}>\n {isSingleSeries && chartData.map((_, idx) => (\n <Cell key={idx} fill={COLORS[idx % COLORS.length]} />\n ))}\n </Bar>\n ))}\n </BarChart>\n </ResponsiveContainer>\n );\n\n case 'horizontal_bar': {\n // Horizontal bar: swap X/Y, use YAxis for categories\n return (\n <ResponsiveContainer width=\"100%\" height={Math.max(300, chartData.length * 40)}>\n <BarChart data={chartData} layout=\"vertical\" margin={{ top: 5, right: 30, left: 100, bottom: 5 }}>\n <CartesianGrid strokeDasharray=\"3 3\" stroke={GRID_STROKE} />\n <XAxis type=\"number\" tick={AXIS_TICK} axisLine={AXIS_LINE} tickLine={AXIS_LINE}\n {...(yLabel ? { label: { value: yLabel, position: 'insideBottom', offset: -5, style: { textAnchor: 'middle', fill: 'var(--text-muted, #666)' } } } : {})}\n />\n <YAxis type=\"category\" dataKey=\"x\" tick={{ fill: 'var(--text-muted, #666)', fontSize: 11 }} width={90} axisLine={AXIS_LINE} tickLine={AXIS_LINE} />\n <Tooltip {...TOOLTIP_STYLE} />\n {!isSingleSeries && <Legend wrapperStyle={LEGEND_STYLE} />}\n {seriesNames.map((name, i) => (\n <Bar key={name} dataKey={name} fill={COLORS[i % COLORS.length]} radius={[0, 2, 2, 0]} isAnimationActive={false}>\n {isSingleSeries && chartData.map((_, idx) => (\n <Cell key={idx} fill={COLORS[idx % COLORS.length]} />\n ))}\n </Bar>\n ))}\n </BarChart>\n </ResponsiveContainer>\n );\n }\n\n case 'line':\n return (\n <ResponsiveContainer width=\"100%\" height={300}>\n <LineChart data={chartData} margin={{ top: 5, right: 30, left: 20, bottom: rotateXTicks ? 40 : bottomMargin }}>\n <CartesianGrid strokeDasharray=\"3 3\" stroke={GRID_STROKE} />\n <XAxis {...xAxisProps} />\n <YAxis {...yAxisProps} />\n <Tooltip {...TOOLTIP_STYLE} />\n <Legend wrapperStyle={LEGEND_STYLE} />\n {seriesNames.map((name, i) => (\n <Line key={name} type=\"monotone\" dataKey={name}\n stroke={COLORS[i % COLORS.length]} strokeWidth={2}\n dot={{ r: 4, fill: COLORS[i % COLORS.length] }}\n activeDot={{ r: 6, fill: COLORS[i % COLORS.length] }}\n isAnimationActive={false}\n />\n ))}\n </LineChart>\n </ResponsiveContainer>\n );\n\n case 'area':\n return (\n <ResponsiveContainer width=\"100%\" height={300}>\n <AreaChart data={chartData} margin={{ top: 5, right: 30, left: 20, bottom: rotateXTicks ? 40 : bottomMargin }}>\n <CartesianGrid strokeDasharray=\"3 3\" stroke={GRID_STROKE} />\n <XAxis {...xAxisProps} />\n <YAxis {...yAxisProps} />\n <Tooltip {...TOOLTIP_STYLE} />\n <Legend wrapperStyle={LEGEND_STYLE} />\n {seriesNames.map((name, i) => (\n <Area key={name} type=\"monotone\" dataKey={name}\n stroke={COLORS[i % COLORS.length]} strokeWidth={2}\n fill={COLORS[i % COLORS.length]} fillOpacity={0.15}\n isAnimationActive={false}\n />\n ))}\n </AreaChart>\n </ResponsiveContainer>\n );\n\n case 'pie': {\n // Pie uses first series only\n const pieData = series[0].data.map((d, i) => ({\n name: d.x,\n value: d.y,\n fill: COLORS[i % COLORS.length],\n }));\n const RADIAN = Math.PI / 180;\n const renderLabel = ({ cx, cy, midAngle, innerRadius, outerRadius, percent, name }) => {\n const radius = outerRadius + 20;\n const x = cx + radius * Math.cos(-midAngle * RADIAN);\n const y = cy + radius * Math.sin(-midAngle * RADIAN);\n if (percent < 0.04) return null;\n return (\n <text x={x} y={y} fill=\"var(--text-ink, #1e2125)\" fontSize={11}\n textAnchor={x > cx ? 'start' : 'end'} dominantBaseline=\"central\">\n {name} ({(percent * 100).toFixed(0)}%)\n </text>\n );\n };\n return (\n <ResponsiveContainer width=\"100%\" height={320}>\n <PieChart>\n <Pie data={pieData} cx=\"50%\" cy=\"50%\" outerRadius={100}\n dataKey=\"value\" label={renderLabel} labelLine={{ stroke: 'var(--text-muted, #666)' }}\n isAnimationActive={false}>\n {pieData.map((entry, i) => (\n <Cell key={i} fill={entry.fill} />\n ))}\n </Pie>\n <Tooltip {...TOOLTIP_STYLE} />\n </PieChart>\n </ResponsiveContainer>\n );\n }\n\n case 'metric': {\n const s = series[0];\n const current = s.data[0];\n const previous = s.data.length > 1 ? s.data[1] : null;\n const value = current.y;\n const unit = current.x || '';\n const hasTrend = previous !== null;\n const change = hasTrend ? value - previous.y : 0;\n const pctChange = hasTrend && previous.y !== 0 ? ((change / Math.abs(previous.y)) * 100) : 0;\n const isPositive = change > 0;\n const isNegative = change < 0;\n const trendColor = isPositive ? '#7BA89D' : isNegative ? '#D17B6B' : 'var(--text-muted, #666)';\n const trendArrow = isPositive ? '↑' : isNegative ? '↓' : '→';\n\n // Format large numbers nicely\n const fmt = (n) => {\n if (Number.isInteger(n) && Math.abs(n) >= 1000) return n.toLocaleString();\n if (typeof n === 'number') return n % 1 === 0 ? n.toString() : n.toFixed(n < 10 ? 2 : 1);\n return String(n);\n };\n\n return (\n <div style={{ display: 'flex', alignItems: 'baseline', gap: 12, padding: '8px 0' }}>\n <div style={{\n fontSize: '36px', fontWeight: 700, lineHeight: 1,\n color: 'var(--text-strong, #1e2125)',\n fontVariantNumeric: 'tabular-nums',\n }}>\n {fmt(value)}\n </div>\n {unit && (\n <div style={{ fontSize: '14px', color: 'var(--text-muted, #666)', fontWeight: 500 }}>\n {unit}\n </div>\n )}\n {hasTrend && (\n <div style={{\n display: 'flex', alignItems: 'center', gap: 4,\n fontSize: '13px', fontWeight: 600, color: trendColor,\n background: isPositive ? 'rgba(123,168,157,0.12)' : isNegative ? 'rgba(209,123,107,0.12)' : 'rgba(128,128,128,0.08)',\n padding: '3px 8px', borderRadius: 'var(--radius-sm, 4px)',\n }}>\n <span>{trendArrow}</span>\n <span>{fmt(Math.abs(change))} ({Math.abs(pctChange).toFixed(1)}%)</span>\n </div>\n )}\n {hasTrend && (\n <div style={{ fontSize: '11px', color: 'var(--text-faint, #999)' }}>\n vs {previous.x || 'previous'}\n </div>\n )}\n </div>\n );\n }\n\n default:\n return <div style={{ color: 'var(--text-muted)', fontSize: 12, padding: 8 }}>Unsupported chart type: {chartType}</div>;\n }\n };\n\n const handleDownload = useCallback(() => {\n if (chartRef.current) downloadPng(chartRef.current, title);\n }, [title]);\n\n const handleCopy = useCallback(() => {\n copyAsCsv(series, allXValues);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }, [series, allXValues]);\n\n const showActions = chartType !== 'metric';\n\n return (\n <div style={containerStyle}>\n {title && <div style={titleStyle}>{title}</div>}\n {showActions && <ActionBar onDownload={handleDownload} onCopy={handleCopy} copied={copied} />}\n <div ref={chartRef}>\n {renderChart()}\n </div>\n </div>\n );\n};\n\nexport default ChartRenderer;\n"],"names":["COLORS","AXIS_TICK","AXIS_LINE","GRID_STROKE","TOOLTIP_STYLE","LEGEND_STYLE","shouldShowAxisLabel","label","tickValues","lower","v","downloadPng","containerEl","title","svg","clone","w","styleEl","xml","blob","url","img","canvas","scale","ctx","link","copyAsCsv","series","allXValues","header","s","rows","x","vals","match","d","csv","ActionBar","onDownload","onCopy","copied","jsxs","jsx","ChartRenderer","chartType","xLabel","yLabel","chartRef","useRef","setCopied","React","chartData","point","seriesNames","isSingleSeries","showXLabel","bottomMargin","rotateXTicks","containerStyle","titleStyle","xAxisProps","yAxisProps","renderChart","ResponsiveContainer","BarChart","CartesianGrid","XAxis","YAxis","Tooltip","Legend","name","i","Bar","_","idx","Cell","LineChart","Line","AreaChart","Area","pieData","RADIAN","PieChart","Pie","cx","cy","midAngle","innerRadius","outerRadius","percent","radius","y","entry","current","previous","value","unit","hasTrend","change","pctChange","isPositive","isNegative","trendColor","trendArrow","fmt","n","handleDownload","useCallback","handleCopy"],"mappings":";;;AASA,MAAMA,IAAS;AAAA,EACb;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;A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