@object-ui/plugin-charts 17.7.0 → 18.0.0

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/index.js CHANGED
@@ -1,80 +1,85 @@
1
- import { ComponentRegistry as e, FilterOperatorError as t, buildCategoryRank as n, buildChartSeries as r, buildOptionColorMap as i, chartMeasureKey as a, chartRowBucketId as o, chartTypeIgnoresCompareTo as s, compareToTrendLabelKey as c, composeDrillFilter as l, computeDrillFilter as u, deriveDimensionLabelMaps as d, dimensionOptionTranslator as f, elementDataSourceBlock as p, extractRecords as m, humanizeLabel as h, isDrillEnabled as ee, isRealCalendarDate as te, isStructuredGroupBy as ne, loadDimensionFieldMeta as re, localizeFieldOptions as ie, objectAggregateSpecQuery as ae, relabelDimensions as oe, resolveContextTokens as se, resolveDrillTitle as ce, resolveFilterPlaceholders as g, shiftFilterByCompareTo as le, toDateInputValue as ue, toDisplayDate as de } from "@object-ui/core";
2
- import * as _ from "react";
3
- import v, { Suspense as y, useCallback as b, useContext as x, useEffect as S, useMemo as C, useState as w } from "react";
4
- import { Button as fe, ChartSkeleton as pe, DataEmptyState as me, Dialog as he, DialogContent as ge, DialogHeader as _e, DialogTitle as ve, RefreshIndicator as ye, Sheet as be, SheetContent as xe, SheetHeader as Se, SheetTitle as Ce, Skeleton as we } from "@object-ui/components";
5
- import { builtinAggregateLabels as Te, pickLocalized as Ee, useDisplayLocale as De, useObjectTranslation as Oe, useSafeFieldLabel as ke, useSafeTranslate as Ae } from "@object-ui/i18n";
1
+ import { ComponentRegistry as e, FilterOperatorError as t, buildCategoryRank as n, buildChartSeries as r, buildOptionColorMap as i, chartMeasureKey as a, chartRowBucketId as o, chartTypeIgnoresCompareTo as s, compareToTrendLabelKey as c, composeDrillFilter as l, computeDrillFilter as u, deriveDimensionLabelMaps as d, dimensionOptionTranslator as f, elementDataSourceBlock as p, extractRecords as m, humanizeLabel as h, isDrillEnabled as ee, isIntegerAggregate as te, isRealCalendarDate as ne, isStructuredGroupBy as re, loadDimensionFieldMeta as ie, localizeFieldOptions as ae, objectAggregateSpecQuery as oe, relabelDimensions as se, resolveContextTokens as ce, resolveDrillTitle as g, resolveFilterPlaceholders as le, shiftFilterByCompareTo as _, toDateInputValue as ue, toDisplayDate as de } from "@object-ui/core";
2
+ import * as v from "react";
3
+ import y, { Suspense as b, useCallback as x, useContext as S, useEffect as fe, useMemo as C, useState as w } from "react";
4
+ import { Button as pe, ChartSkeleton as me, DataEmptyState as he, Dialog as ge, DialogContent as _e, DialogHeader as ve, DialogTitle as ye, RefreshIndicator as be, Sheet as xe, SheetContent as Se, SheetHeader as Ce, SheetTitle as we, Skeleton as Te } from "@object-ui/components";
5
+ import { builtinAggregateLabels as Ee, pickLocalized as De, useDisplayLocale as Oe, useObjectTranslation as ke, useSafeFieldLabel as Ae, useSafeTranslate as je } from "@object-ui/i18n";
6
6
  import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
7
- import { Area as je, AreaChart as Me, Bar as Ne, BarChart as Pe, Brush as Fe, CartesianGrid as O, Cell as Ie, ComposedChart as Le, Funnel as Re, FunnelChart as k, LabelList as ze, Legend as Be, Line as Ve, LineChart as He, Pie as Ue, PieChart as We, PolarAngleAxis as Ge, PolarGrid as Ke, PolarRadiusAxis as qe, Radar as Je, RadarChart as Ye, ReferenceArea as Xe, ReferenceLine as Ze, ResponsiveContainer as Qe, Sankey as $e, Scatter as A, ScatterChart as j, Tooltip as M, Treemap as et, XAxis as N, YAxis as P } from "recharts";
8
- import { ElementDataSourceGate as tt, SchemaRenderer as nt, SchemaRendererContext as rt, useDataInvalidation as F, useDataScope as I, useDrillNavigation as L, useFilterScope as R } from "@object-ui/react";
9
- import { AlertCircle as z, ArrowUpRight as it, Inbox as at } from "lucide-react";
7
+ import { Area as Me, AreaChart as Ne, Bar as Pe, BarChart as O, Brush as Fe, CartesianGrid as Ie, Cell as Le, ComposedChart as Re, Funnel as k, FunnelChart as ze, LabelList as Be, Legend as Ve, Line as He, LineChart as Ue, Pie as We, PieChart as Ge, PolarAngleAxis as Ke, PolarGrid as qe, PolarRadiusAxis as Je, Radar as Ye, RadarChart as Xe, ReferenceArea as Ze, ReferenceLine as Qe, ResponsiveContainer as $e, Sankey as et, Scatter as tt, ScatterChart as nt, Tooltip as A, Treemap as j, XAxis as M, YAxis as N } from "recharts";
8
+ import { ElementDataSourceGate as rt, SchemaRenderer as it, SchemaRendererContext as at, useDataInvalidation as ot, useDataScope as st, useDrillNavigation as ct, useFilterScope as P } from "@object-ui/react";
9
+ import { AlertCircle as F, ArrowUpRight as I, Inbox as L } from "lucide-react";
10
10
  //#region \0rolldown/runtime.js
11
- var B = Object.defineProperty, V = (e, t, n) => () => {
11
+ var R = Object.defineProperty, z = (e, t, n) => () => {
12
12
  if (n) throw n[0];
13
13
  try {
14
14
  return e && (t = e(e = 0)), t;
15
15
  } catch (e) {
16
16
  throw n = [e], e;
17
17
  }
18
- }, ot = (e, t) => {
18
+ }, B = (e, t) => {
19
19
  let n = {};
20
- for (var r in e) B(n, r, {
20
+ for (var r in e) R(n, r, {
21
21
  get: e[r],
22
22
  enumerable: !0
23
23
  });
24
- return t || B(n, Symbol.toStringTag, { value: "Module" }), n;
24
+ return t || R(n, Symbol.toStringTag, { value: "Module" }), n;
25
25
  };
26
26
  //#endregion
27
27
  //#region src/normalizeChartSchema.ts
28
- function H(e) {
28
+ function lt(e) {
29
29
  if (!e) return;
30
- let t = e.startsWith(K) ? e.slice(14) : e;
31
- return vt.get(t);
30
+ let t = e.startsWith(St) ? e.slice(14) : e;
31
+ return xt.get(t);
32
32
  }
33
- function U(e, t) {
34
- if (typeof e == "string" || q(e)) return Ee(e, t) || void 0;
33
+ function ut(e) {
34
+ return e.length > 0 && e.every((e) => te(e.aggregate));
35
+ }
36
+ function V(e, t) {
37
+ if (typeof e == "string" || G(e)) return De(e, t) || void 0;
35
38
  }
36
- function st(e, t) {
37
- if (!q(e)) return;
38
- let n = {}, r = J(e.field);
39
+ function H(e, t) {
40
+ if (!G(e)) return;
41
+ let n = {}, r = K(e.field);
39
42
  r && (n.field = r);
40
- let i = J(e.format);
43
+ let i = K(e.format);
41
44
  i && (n.format = i);
42
- let a = Y(e.min);
45
+ let a = q(e.min);
43
46
  a !== void 0 && (n.min = a);
44
- let o = Y(e.max);
47
+ let o = q(e.max);
45
48
  o !== void 0 && (n.max = o);
46
- let s = Y(e.stepSize);
49
+ let s = q(e.stepSize);
47
50
  s !== void 0 && s > 0 && (n.stepSize = s), typeof e.showGridLines == "boolean" && (n.showGridLines = e.showGridLines), typeof e.logarithmic == "boolean" && (n.logarithmic = e.logarithmic);
48
- let c = J(e.position);
51
+ let c = K(e.position);
49
52
  (c === "left" || c === "right" || c === "top" || c === "bottom") && (n.position = c);
50
- let l = U(e.title, t);
53
+ let l = V(e.title, t);
51
54
  return l && (n.title = l), n;
52
55
  }
53
- function ct(e, t) {
54
- if (!q(e)) {
55
- let t = J(e);
56
+ function dt(e, t) {
57
+ if (!G(e)) {
58
+ let t = K(e);
56
59
  return t ? { dataKey: t } : void 0;
57
60
  }
58
- let n = J(e.dataKey) ?? J(e.name);
61
+ let n = K(e.dataKey) ?? K(e.name);
59
62
  if (!n) return;
60
- let r = { dataKey: n }, i = U(e.label, t);
63
+ let r = { dataKey: n }, i = V(e.label, t);
61
64
  i && (r.label = i);
62
- let a = J(e.chartType) ?? J(e.type);
65
+ let a = K(e.chartType) ?? K(e.type);
63
66
  (a === "bar" || a === "line" || a === "area") && (r.chartType = a);
64
- let o = J(e.variant);
67
+ let o = K(e.variant);
65
68
  (o === "comparison" || o === "current" || o === "primary") && (r.variant = o);
66
- let s = Y(e.opacity);
69
+ let s = q(e.opacity);
67
70
  s !== void 0 && (r.opacity = s);
68
- let c = J(e.dashArray);
71
+ let c = K(e.dashArray);
69
72
  c && (r.dashArray = c);
70
- let l = J(e.stack);
73
+ let l = K(e.stack);
71
74
  l && (r.stack = l);
72
- let u = J(e.yAxis);
75
+ let u = K(e.yAxis);
73
76
  (u === "left" || u === "right") && (r.yAxis = u);
74
- let d = J(e.color);
75
- return d && (r.color = d), r;
77
+ let d = K(e.color);
78
+ d && (r.color = d);
79
+ let f = K(e.aggregate);
80
+ return f && (r.aggregate = f), r;
76
81
  }
77
- function lt(e, t) {
82
+ function ft(e, t) {
78
83
  let n = t === "horizontal-bar", r = t === "scatter" ? 1 : 2, i = (e ?? []).slice(0, r), a = [], o = (e) => n ? e === "bottom" ? "left" : e === "top" ? "right" : void 0 : e === "left" || e === "right" ? e : void 0, s = (e) => e === "left" ? "right" : "left", c = i.map((e) => o(e.position)), l = [];
79
84
  if (i.length === 1) l.push(c[0] ?? "left");
80
85
  else if (i.length === 2) {
@@ -106,19 +111,19 @@ function lt(e, t) {
106
111
  d[e] = t;
107
112
  }), d;
108
113
  }
109
- function ut(e, t) {
110
- if (!q(e)) return {};
111
- let n = {}, r = J(e.type), i = J(e.chartType) ?? J(e.specType) ?? (r && _t.has(r) ? r : void 0) ?? H(r);
114
+ function U(e, t) {
115
+ if (!G(e)) return {};
116
+ let n = {}, r = K(e.type), i = K(e.chartType) ?? K(e.specType) ?? (r && bt.has(r) ? r : void 0) ?? lt(r);
112
117
  i && (n.chartType = i);
113
- let a = e.xAxis, o = st(a, t);
118
+ let a = e.xAxis, o = H(a, t);
114
119
  o && Object.keys(o).some((e) => e !== "field") && (n.xAxis = o);
115
- let s = J(e.xAxisKey) ?? o?.field ?? J(a);
120
+ let s = K(e.xAxisKey) ?? o?.field ?? K(a);
116
121
  s && (n.xAxisKey = s);
117
- let c = (Array.isArray(e.yAxis) ? e.yAxis : e.yAxis === void 0 ? [] : [e.yAxis]).map((e) => st(e, t) ?? (J(e) ? { field: J(e) } : void 0)).filter((e) => !!e);
122
+ let c = (Array.isArray(e.yAxis) ? e.yAxis : e.yAxis === void 0 ? [] : [e.yAxis]).map((e) => H(e, t) ?? (K(e) ? { field: K(e) } : void 0)).filter((e) => !!e);
118
123
  c.length && (n.yAxes = c);
119
- let l = (Array.isArray(e.series) ? e.series : Array.isArray(e.categories) ? e.categories : void 0)?.map((e) => ct(e, t)).filter((e) => !!e);
124
+ let l = (Array.isArray(e.series) ? e.series : Array.isArray(e.categories) ? e.categories : void 0)?.map((e) => dt(e, t)).filter((e) => !!e);
120
125
  if (!l?.length) {
121
- let e = lt(c, i), t = [...e.slotOf, ...e.undrawn.map((e) => e.boundTo)], n = c.map((e, n) => ({
126
+ let e = ft(c, i), t = [...e.slotOf, ...e.undrawn.map((e) => e.boundTo)], n = c.map((e, n) => ({
122
127
  a: e,
123
128
  slot: t[n],
124
129
  i: n
@@ -130,23 +135,23 @@ function ut(e, t) {
130
135
  n.length && (l = n);
131
136
  }
132
137
  l?.length && (n.series = l), typeof e.showLegend == "boolean" && (n.showLegend = e.showLegend), typeof e.showDataLabels == "boolean" && (n.showDataLabels = e.showDataLabels);
133
- let u = U(e.title, t);
138
+ let u = V(e.title, t);
134
139
  u && (n.title = u);
135
- let d = U(e.subtitle, t);
140
+ let d = V(e.subtitle, t);
136
141
  d && (n.subtitle = d);
137
- let f = U(e.description, t);
142
+ let f = V(e.description, t);
138
143
  f && (n.description = f);
139
- let p = Y(e.height);
140
- return p !== void 0 && p > 0 && (n.height = p), Array.isArray(e.annotations) && e.annotations.length && (n.annotations = e.annotations.filter(q)), q(e.interaction) && (n.interaction = e.interaction), n;
144
+ let p = q(e.height);
145
+ return p !== void 0 && p > 0 && (n.height = p), Array.isArray(e.annotations) && e.annotations.length && (n.annotations = e.annotations.filter(G)), G(e.interaction) && (n.interaction = e.interaction), n;
141
146
  }
142
- function dt(e) {
147
+ function pt(e) {
143
148
  if (e === "bar" || e === "column") return "bar";
144
149
  if (e === "line") return "line";
145
150
  if (e === "area") return "area";
146
151
  }
147
- function ft(e, t) {
152
+ function mt(e, t) {
148
153
  if (e === "combo") return "combo";
149
- let n = dt(e);
154
+ let n = pt(e);
150
155
  if (!n || !t || t.length < 2) return e;
151
156
  let r = t.map((e) => e.chartType ?? n);
152
157
  return new Set(r).size > 1 ? "combo" : e;
@@ -176,24 +181,24 @@ function W(e, t) {
176
181
  }
177
182
  };
178
183
  }
179
- function pt(e, t) {
184
+ function ht(e, t) {
180
185
  let n = e?.stepSize;
181
186
  if (!n || n <= 0) return;
182
187
  let r = t.filter((e) => Number.isFinite(e)), i = r.length ? Math.min(...r) : void 0, a = r.length ? Math.max(...r) : void 0, o = e.min ?? Math.min(0, i ?? 0), s = e.max ?? a;
183
188
  if (s === void 0 || !Number.isFinite(o) || !Number.isFinite(s) || s < o) return;
184
189
  let c = Math.floor(o / n) * n, l = e.max === void 0 ? Math.ceil(s / n) * n : e.max, u = Math.floor((l - c) / n + 1e-9) + 1;
185
- if (u < 1 || u > yt) return;
190
+ if (u < 1 || u > Ct) return;
186
191
  let d = [];
187
192
  for (let e = 0; e < u; e++) d.push(Number((c + e * n).toPrecision(12)));
188
193
  return e.max !== void 0 && d[d.length - 1] < e.max && d.push(e.max), d;
189
194
  }
190
- function G(e) {
195
+ function gt(e) {
191
196
  if (!e) return;
192
197
  let { min: t, max: n } = e;
193
198
  if (t !== void 0 || n !== void 0) return [t ?? "auto", n ?? "auto"];
194
199
  }
195
- var mt, ht, gt, _t, vt, K, q, J, Y, yt, bt = V((() => {
196
- mt = /* @__PURE__ */ new Set([
200
+ var _t, vt, yt, bt, xt, St, G, K, q, Ct, wt = z((() => {
201
+ _t = /* @__PURE__ */ new Set([
197
202
  "bar",
198
203
  "column",
199
204
  "horizontal-bar",
@@ -207,23 +212,23 @@ var mt, ht, gt, _t, vt, K, q, J, Y, yt, bt = V((() => {
207
212
  "treemap",
208
213
  "sankey",
209
214
  "combo"
210
- ]), ht = /* @__PURE__ */ new Set([
215
+ ]), vt = /* @__PURE__ */ new Set([
211
216
  "gauge",
212
217
  "solid-gauge",
213
218
  "metric",
214
219
  "kpi",
215
220
  "bullet"
216
- ]), gt = /* @__PURE__ */ new Set(["table", "pivot"]), _t = /* @__PURE__ */ new Set([
217
- ...mt,
218
- ...ht,
219
- ...gt
220
- ]), vt = /* @__PURE__ */ new Map([["chart:bar", "bar"]]), K = "plugin-charts:", q = (e) => !!e && typeof e == "object" && !Array.isArray(e), J = (e) => typeof e == "string" && e ? e : void 0, Y = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, yt = 200;
221
- })), xt = /* @__PURE__ */ ot({ default: () => wt });
222
- function St(e, t = 14) {
221
+ ]), yt = /* @__PURE__ */ new Set(["table", "pivot"]), bt = /* @__PURE__ */ new Set([
222
+ ..._t,
223
+ ...vt,
224
+ ...yt
225
+ ]), xt = /* @__PURE__ */ new Map([["chart:bar", "bar"]]), St = "plugin-charts:", G = (e) => !!e && typeof e == "object" && !Array.isArray(e), K = (e) => typeof e == "string" && e ? e : void 0, q = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, Ct = 200;
226
+ })), J = /* @__PURE__ */ B({ default: () => Dt });
227
+ function Tt(e, t = 14) {
223
228
  return e.length > t ? `${e.slice(0, t - 1)}…` : e;
224
229
  }
225
- function Ct({ x: e, y: t, payload: n }) {
226
- let r = String(n?.value ?? ""), i = St(r);
230
+ function Et({ x: e, y: t, payload: n }) {
231
+ let r = String(n?.value ?? ""), i = Tt(r);
227
232
  return /* @__PURE__ */ E("g", {
228
233
  transform: `translate(${e},${t})`,
229
234
  children: /* @__PURE__ */ D("text", {
@@ -237,14 +242,14 @@ function Ct({ x: e, y: t, payload: n }) {
237
242
  })
238
243
  });
239
244
  }
240
- function wt({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height: r = 400, className: i = "", color: a = "hsl(var(--primary))" }) {
245
+ function Dt({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height: r = 400, className: i = "", color: a = "hsl(var(--primary))" }) {
241
246
  let o = e.map((e) => String(e?.[n] ?? "")), s = o.length > 4 || o.some((e) => e.length > 8);
242
247
  return /* @__PURE__ */ E("div", {
243
248
  className: `p-2 sm:p-3 md:p-4 rounded-xl border border-border bg-card/40 backdrop-blur-sm shadow-lg shadow-background/5 ${i}`,
244
- children: /* @__PURE__ */ E(Qe, {
249
+ children: /* @__PURE__ */ E($e, {
245
250
  width: "100%",
246
251
  height: r,
247
- children: /* @__PURE__ */ D(Pe, {
252
+ children: /* @__PURE__ */ D(O, {
248
253
  data: e,
249
254
  margin: {
250
255
  top: 10,
@@ -305,14 +310,14 @@ function wt({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
305
310
  /* @__PURE__ */ D("feMerge", { children: [/* @__PURE__ */ E("feMergeNode", { in: "offsetBlur" }), /* @__PURE__ */ E("feMergeNode", { in: "SourceGraphic" })] })
306
311
  ]
307
312
  })] }),
308
- /* @__PURE__ */ E(O, {
313
+ /* @__PURE__ */ E(Ie, {
309
314
  strokeDasharray: "3 3",
310
315
  stroke: "hsl(var(--border))",
311
316
  vertical: !1
312
317
  }),
313
- /* @__PURE__ */ E(N, {
318
+ /* @__PURE__ */ E(M, {
314
319
  dataKey: n,
315
- tick: s ? /* @__PURE__ */ E(Ct, {}) : {
320
+ tick: s ? /* @__PURE__ */ E(Et, {}) : {
316
321
  fill: "hsl(var(--muted-foreground))",
317
322
  fontSize: 12,
318
323
  fontFamily: "monospace"
@@ -323,7 +328,7 @@ function wt({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
323
328
  height: s ? 56 : void 0,
324
329
  dy: s ? void 0 : 10
325
330
  }),
326
- /* @__PURE__ */ E(P, {
331
+ /* @__PURE__ */ E(N, {
327
332
  tick: {
328
333
  fill: "hsl(var(--muted-foreground))",
329
334
  fontSize: 12,
@@ -332,7 +337,7 @@ function wt({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
332
337
  tickLine: !1,
333
338
  axisLine: !1
334
339
  }),
335
- /* @__PURE__ */ E(M, {
340
+ /* @__PURE__ */ E(A, {
336
341
  cursor: {
337
342
  fill: "hsl(var(--muted))",
338
343
  opacity: .2
@@ -347,11 +352,11 @@ function wt({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
347
352
  },
348
353
  itemStyle: { color: "hsl(var(--primary))" }
349
354
  }),
350
- /* @__PURE__ */ E(Be, { wrapperStyle: {
355
+ /* @__PURE__ */ E(Ve, { wrapperStyle: {
351
356
  paddingTop: "20px",
352
357
  fontFamily: "monospace"
353
358
  } }),
354
- /* @__PURE__ */ E(Ne, {
359
+ /* @__PURE__ */ E(Pe, {
355
360
  dataKey: t,
356
361
  fill: "url(#barGradient)",
357
362
  radius: [
@@ -368,17 +373,17 @@ function wt({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
368
373
  })
369
374
  });
370
375
  }
371
- var Tt = V((() => {}));
376
+ var Ot = z((() => {}));
372
377
  //#endregion
373
378
  //#region src/ChartContainerImpl.tsx
374
- function Et() {
375
- let e = _.useContext(Z);
379
+ function kt() {
380
+ let e = v.useContext(Pt);
376
381
  if (!e) throw Error("useChart must be used within a <ChartContainer />");
377
382
  return e;
378
383
  }
379
- function Dt({ id: e, className: t, children: n, config: r, disableSettleRemount: i, style: a, ...o }) {
380
- let s = _.useId(), c = `chart-${e || s.replace(/:/g, "")}`, l = _.useRef(null), [u, d] = _.useState(0);
381
- _.useEffect(() => {
384
+ function At({ id: e, className: t, children: n, config: r, disableSettleRemount: i, style: a, ...o }) {
385
+ let s = v.useId(), c = `chart-${e || s.replace(/:/g, "")}`, l = v.useRef(null), [u, d] = v.useState(0);
386
+ v.useEffect(() => {
382
387
  if (i) return;
383
388
  let e = l.current;
384
389
  if (e == null || typeof ResizeObserver > "u") return;
@@ -394,40 +399,40 @@ function Dt({ id: e, className: t, children: n, config: r, disableSettleRemount:
394
399
  };
395
400
  }, [i]);
396
401
  let f = a?.height != null || a?.minHeight != null, p = a?.width != null || a?.minWidth != null, m = {
397
- ...f ? {} : { minHeight: Mt },
402
+ ...f ? {} : { minHeight: Ft },
398
403
  ...p ? {} : { minWidth: 0 },
399
404
  ...a
400
405
  };
401
- return /* @__PURE__ */ E(Z.Provider, {
406
+ return /* @__PURE__ */ E(Pt.Provider, {
402
407
  value: { config: r },
403
408
  children: /* @__PURE__ */ D("div", {
404
409
  ref: l,
405
410
  "data-slot": "chart",
406
411
  "data-chart": c,
407
- className: X("block w-full h-[350px] text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground", t),
412
+ className: Y("block w-full h-[350px] text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground", t),
408
413
  style: m,
409
414
  ...o,
410
- children: [/* @__PURE__ */ E(Nt, {
415
+ children: [/* @__PURE__ */ E(It, {
411
416
  id: c,
412
417
  config: r
413
- }), /* @__PURE__ */ E(Qe, {
418
+ }), /* @__PURE__ */ E($e, {
414
419
  width: "100%",
415
420
  height: "100%",
416
- ...f ? {} : { minHeight: Mt },
421
+ ...f ? {} : { minHeight: Ft },
417
422
  children: n
418
423
  }, u)]
419
424
  })
420
425
  });
421
426
  }
422
- function Ot({ active: e, payload: t, className: n, indicator: r = "dot", hideLabel: i = !1, hideIndicator: a = !1, label: o, labelFormatter: s, labelClassName: c, formatter: l, color: u, nameKey: d, labelKey: f }) {
423
- let { config: p } = Et(), m = De(), h = _.useMemo(() => {
427
+ function jt({ active: e, payload: t, className: n, indicator: r = "dot", hideLabel: i = !1, hideIndicator: a = !1, label: o, labelFormatter: s, labelClassName: c, formatter: l, color: u, nameKey: d, labelKey: f }) {
428
+ let { config: p } = kt(), m = Oe(), h = v.useMemo(() => {
424
429
  if (i || !t?.length) return null;
425
- let [e] = t, n = `${f || e?.dataKey || e?.name || "value"}`, r = At(p, e, n), a = !f && typeof o == "string" ? p[o]?.label || o : r?.label;
430
+ let [e] = t, n = `${f || e?.dataKey || e?.name || "value"}`, r = Nt(p, e, n), a = !f && typeof o == "string" ? p[o]?.label || o : r?.label;
426
431
  return s ? /* @__PURE__ */ E("div", {
427
- className: X("font-medium", c),
432
+ className: Y("font-medium", c),
428
433
  children: s(a, t)
429
434
  }) : a ? /* @__PURE__ */ E("div", {
430
- className: X("font-medium", c),
435
+ className: Y("font-medium", c),
431
436
  children: a
432
437
  }) : null;
433
438
  }, [
@@ -442,21 +447,21 @@ function Ot({ active: e, payload: t, className: n, indicator: r = "dot", hideLab
442
447
  if (!e || !t?.length) return null;
443
448
  let ee = t.length === 1 && r !== "dot";
444
449
  return /* @__PURE__ */ D("div", {
445
- className: X("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", n),
450
+ className: Y("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", n),
446
451
  children: [ee ? null : h, /* @__PURE__ */ E("div", {
447
452
  className: "grid gap-1.5",
448
453
  children: t.filter((e) => e.type !== "none").map((e, t) => {
449
- let n = `${d || e.name || e.dataKey || "value"}`, i = At(p, e, n), o = u || e.payload.fill || e.color;
454
+ let n = `${d || e.name || e.dataKey || "value"}`, i = Nt(p, e, n), o = u || e.payload.fill || e.color;
450
455
  return /* @__PURE__ */ E("div", {
451
- className: X("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", r === "dot" ? "items-center" : ""),
456
+ className: Y("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", r === "dot" ? "items-center" : ""),
452
457
  children: l && e?.value !== void 0 && e.name ? l(e.value, e.name, e, t, e.payload) : /* @__PURE__ */ D(T, { children: [i?.icon ? /* @__PURE__ */ E(i.icon, {}) : !a && /* @__PURE__ */ E("div", {
453
- className: X("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", r === "dot" ? "h-2.5 w-2.5" : "", r === "line" ? "w-1" : "", r === "dashed" ? "w-0 border-[1.5px] border-dashed bg-transparent" : "", ee && r === "dashed" ? "my-0.5" : ""),
458
+ className: Y("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", r === "dot" ? "h-2.5 w-2.5" : "", r === "line" ? "w-1" : "", r === "dashed" ? "w-0 border-[1.5px] border-dashed bg-transparent" : "", ee && r === "dashed" ? "my-0.5" : ""),
454
459
  style: {
455
460
  "--color-bg": o,
456
461
  "--color-border": o
457
462
  }
458
463
  }), /* @__PURE__ */ D("div", {
459
- className: X("flex flex-1 justify-between leading-none", ee ? "items-end" : "items-center"),
464
+ className: Y("flex flex-1 justify-between leading-none", ee ? "items-end" : "items-center"),
460
465
  children: [/* @__PURE__ */ D("div", {
461
466
  className: "grid gap-1.5",
462
467
  children: [ee ? h : null, /* @__PURE__ */ E("span", {
@@ -473,14 +478,14 @@ function Ot({ active: e, payload: t, className: n, indicator: r = "dot", hideLab
473
478
  })]
474
479
  });
475
480
  }
476
- function kt({ className: e, hideIcon: t = !1, payload: n, verticalAlign: r = "bottom", nameKey: i }) {
477
- let { config: a } = Et();
481
+ function Mt({ className: e, hideIcon: t = !1, payload: n, verticalAlign: r = "bottom", nameKey: i }) {
482
+ let { config: a } = kt();
478
483
  return n?.length ? /* @__PURE__ */ E("div", {
479
- className: X("flex items-center justify-center gap-4", r === "top" ? "pb-3" : "pt-3", e),
484
+ className: Y("flex items-center justify-center gap-4", r === "top" ? "pb-3" : "pt-3", e),
480
485
  children: n.filter((e) => e.type !== "none").map((e) => {
481
- let n = `${i || e.dataKey || "value"}`, r = At(a, e, n);
486
+ let n = `${i || e.dataKey || "value"}`, r = Nt(a, e, n);
482
487
  return /* @__PURE__ */ D("div", {
483
- className: X("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
488
+ className: Y("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
484
489
  children: [r?.icon && !t ? /* @__PURE__ */ E(r.icon, {}) : /* @__PURE__ */ E("div", {
485
490
  className: "h-2 w-2 shrink-0 rounded-[2px] bg-(--color-bg)",
486
491
  style: { "--color-bg": e.color }
@@ -489,18 +494,18 @@ function kt({ className: e, hideIcon: t = !1, payload: n, verticalAlign: r = "bo
489
494
  })
490
495
  }) : null;
491
496
  }
492
- function At(e, t, n) {
497
+ function Nt(e, t, n) {
493
498
  if (typeof t != "object" || !t) return;
494
499
  let r = "payload" in t && typeof t.payload == "object" && t.payload !== null ? t.payload : void 0, i = n;
495
500
  return r && n in r && typeof r[n] == "string" ? i = r[n] : n in t && typeof t[n] == "string" && (i = t[n]), i in e ? e[i] : e[n];
496
501
  }
497
- var X, jt, Z, Mt, Nt, Pt, Ft, It = V((() => {
498
- X = (...e) => e.filter(Boolean).join(" "), jt = {
502
+ var Y, X, Pt, Ft, It, Lt, Rt, zt = z((() => {
503
+ Y = (...e) => e.filter(Boolean).join(" "), X = {
499
504
  light: "",
500
505
  dark: ".dark"
501
- }, Z = _.createContext(null), Mt = 280, Nt = ({ id: e, config: t }) => {
506
+ }, Pt = v.createContext(null), Ft = 280, It = ({ id: e, config: t }) => {
502
507
  let n = Object.entries(t).filter(([, e]) => e.theme || e.color);
503
- return n.length ? /* @__PURE__ */ E("style", { dangerouslySetInnerHTML: { __html: Object.entries(jt).map(([t, r]) => `
508
+ return n.length ? /* @__PURE__ */ E("style", { dangerouslySetInnerHTML: { __html: Object.entries(X).map(([t, r]) => `
504
509
  ${r} [data-chart=${e}] {
505
510
  ${n.map(([e, n]) => {
506
511
  let r = n.theme?.[t] || n.color;
@@ -508,55 +513,69 @@ ${n.map(([e, n]) => {
508
513
  }).join("\n")}
509
514
  }
510
515
  `).join("\n") } }) : null;
511
- }, Pt = M, Ft = Be;
516
+ }, Lt = A, Rt = Ve;
512
517
  }));
513
518
  //#endregion
514
519
  //#region src/chartDrillEvents.ts
515
- function Lt(e) {
520
+ function Bt(e) {
516
521
  return e?.[0]?.dataKey || "value";
517
522
  }
518
- function Rt(e, t, n) {
523
+ function Vt(e, t, n) {
519
524
  if (!e) return null;
520
525
  let r = e.payload ?? e, i = r?.[t];
521
526
  if (i == null) return null;
522
- let a = Lt(n);
527
+ let a = Bt(n);
523
528
  return {
524
529
  category: String(i),
525
530
  series: a,
526
531
  value: typeof r?.[a] == "number" ? r[a] : void 0
527
532
  };
528
533
  }
529
- function zt(e, t) {
534
+ function Ht(e, t) {
530
535
  if (!e) return null;
531
536
  let n = e.name ?? e.payload?.name ?? e.root?.name;
532
537
  if (n == null) return null;
533
538
  let r = e.value ?? e.size ?? e.payload?.size;
534
539
  return {
535
540
  category: String(n),
536
- series: Lt(t),
541
+ series: Bt(t),
537
542
  value: typeof r == "number" ? r : void 0
538
543
  };
539
544
  }
540
- function Bt(e, t) {
545
+ function Ut(e, t) {
541
546
  if (!e) return null;
542
547
  let n = e.payload ?? e, r = n?.name;
543
548
  return r == null || n?.depth === 0 ? null : {
544
549
  category: String(r),
545
- series: Lt(t),
550
+ series: Bt(t),
546
551
  value: typeof n?.value == "number" ? n.value : void 0
547
552
  };
548
553
  }
549
- var Vt = V((() => {})), Ht = /* @__PURE__ */ ot({ default: () => Tn });
550
- function Ut(e) {
551
- return e === "top" ? Vn : Bn;
554
+ var Wt = z((() => {})), Gt = /* @__PURE__ */ B({ default: () => jn });
555
+ function Kt(e) {
556
+ let t = 0;
557
+ for (let n of e) t += Kn.test(n) ? 1 : Gn;
558
+ return t * Wn;
559
+ }
560
+ function qt(e, t) {
561
+ if (e.length === 0 || t <= 0) return !1;
562
+ let n = t / e.length;
563
+ return e.reduce((e, t) => Math.max(e, Kt(t)), 0) + Yn <= n;
564
+ }
565
+ function Jt(e) {
566
+ let t = Hn * Math.PI / 180, n = e.reduce((e, t) => Math.max(e, Kt(t)), 0);
567
+ return Math.ceil(16 + Wn * Math.cos(t) + n * Math.sin(t));
568
+ }
569
+ function Yt(e) {
570
+ return e === "top" ? tr : er;
552
571
  }
553
- function Wt(e) {
554
- return e === "right" ? Hn : zn;
572
+ function Xt(e) {
573
+ return e === "right" ? nr : $n;
555
574
  }
556
- function Gt(e, t) {
575
+ function Zt(e, t) {
557
576
  return e ? t ? e === "left" || e === "right" ? { down: e } : { refused: e } : e === "top" || e === "bottom" ? { across: e } : { refused: e } : {};
558
577
  }
559
- function Kt(e, t) {
578
+ function Qt(e, t) {
560
579
  return e ? /* @__PURE__ */ D("p", {
561
580
  role: "note",
562
581
  "data-chart-note": "x-axis-position",
@@ -578,20 +597,20 @@ function Kt(e, t) {
578
597
  ]
579
598
  }) : null;
580
599
  }
581
- function qt(e, t) {
600
+ function $t(e, t) {
582
601
  return t ? e === "left" ? "bottom" : "top" : e;
583
602
  }
584
- function Jt(e) {
603
+ function en(e) {
585
604
  return e === "left" || e === "right" ? `on the ${e}` : `at the ${e}`;
586
605
  }
587
- function Yt(e, t) {
588
- return e ? t ? Gn : Wn : Un;
606
+ function tn(e, t) {
607
+ return e ? t ? ar : ir : rr;
589
608
  }
590
- function Xt(e, t) {
609
+ function nn(e, t) {
591
610
  if (e.notes.length === 0) return null;
592
611
  let n = t ? "this chart's value axes run across it, so each sits at the bottom or the top." : "this chart's value axes run up its side, so each sits on the left or the right.";
593
- return Qt(...e.notes.map((e) => {
594
- let r = Jt(qt(e.drawn, t));
612
+ return an(...e.notes.map((e) => {
613
+ let r = en($t(e.drawn, t));
595
614
  return /* @__PURE__ */ D("p", {
596
615
  role: "note",
597
616
  "data-chart-note": "y-axis-position",
@@ -620,7 +639,7 @@ function Xt(e, t) {
620
639
  children: "yAxis[0]"
621
640
  }),
622
641
  " already sits ",
623
- Jt(e.position),
642
+ en(e.position),
624
643
  ", so this axis is drawn ",
625
644
  r,
626
645
  "."
@@ -629,10 +648,10 @@ function Xt(e, t) {
629
648
  }, e.index);
630
649
  }));
631
650
  }
632
- function Zt(e, t, n) {
651
+ function rn(e, t, n) {
633
652
  if (e.undrawn.length === 0) return null;
634
653
  let r = e.slotOf.length === 1, i = n ? "one at the bottom and one at the top" : "one on each side";
635
- return Qt(...e.undrawn.map((a) => {
654
+ return an(...e.undrawn.map((a) => {
636
655
  let o = e[a.boundTo];
637
656
  if (r) return /* @__PURE__ */ D("p", {
638
657
  role: "note",
@@ -683,7 +702,7 @@ function Zt(e, t, n) {
683
702
  children: s
684
703
  }),
685
704
  " is plotted against the axis ",
686
- Jt(qt(a.boundTo, n)),
705
+ en($t(a.boundTo, n)),
687
706
  o === void 0 ? null : /* @__PURE__ */ D(T, { children: [", ", /* @__PURE__ */ E("code", {
688
707
  className: "font-mono",
689
708
  children: `yAxis[${o}]`
@@ -694,13 +713,13 @@ function Zt(e, t, n) {
694
713
  }, a.index);
695
714
  }));
696
715
  }
697
- function Qt(...e) {
716
+ function an(...e) {
698
717
  let t = e.filter((e) => e != null && e !== !1);
699
- return t.length <= 1 ? t[0] ?? null : /* @__PURE__ */ E(T, { children: t.map((e, t) => /* @__PURE__ */ E(_.Fragment, { children: e }, t)) });
718
+ return t.length <= 1 ? t[0] ?? null : /* @__PURE__ */ E(T, { children: t.map((e, t) => /* @__PURE__ */ E(v.Fragment, { children: e }, t)) });
700
719
  }
701
- function $t(e, t, n) {
720
+ function on(e, t, n) {
702
721
  if (!e) return {};
703
- let r = G(e), i = pt(e, t);
722
+ let r = gt(e), i = ht(e, t);
704
723
  return {
705
724
  ...i ? { ticks: i } : {},
706
725
  ...r ? { domain: r } : {},
@@ -715,7 +734,7 @@ function $t(e, t, n) {
715
734
  } } : {}
716
735
  };
717
736
  }
718
- function en(e) {
737
+ function sn(e) {
719
738
  let { x: t, y: n, width: r, height: i, name: a, fill: o } = e;
720
739
  return r <= 0 || i <= 0 ? null : /* @__PURE__ */ D("g", { children: [/* @__PURE__ */ E("rect", {
721
740
  x: t,
@@ -734,7 +753,7 @@ function en(e) {
734
753
  children: a
735
754
  }) : null] });
736
755
  }
737
- function tn({ title: e, subtitle: t, children: n }) {
756
+ function cn({ title: e, subtitle: t, children: n }) {
738
757
  return !e && !t ? /* @__PURE__ */ E(T, { children: n }) : /* @__PURE__ */ D("div", {
739
758
  className: "flex h-full w-full flex-col",
740
759
  children: [/* @__PURE__ */ D("div", {
@@ -752,7 +771,7 @@ function tn({ title: e, subtitle: t, children: n }) {
752
771
  })]
753
772
  });
754
773
  }
755
- function nn({ note: e, children: t }) {
774
+ function ln({ note: e, children: t }) {
756
775
  return e ? /* @__PURE__ */ D("div", {
757
776
  className: "flex h-full w-full flex-col",
758
777
  children: [/* @__PURE__ */ E("div", {
@@ -764,7 +783,7 @@ function nn({ note: e, children: t }) {
764
783
  })]
765
784
  }) : /* @__PURE__ */ E(T, { children: t });
766
785
  }
767
- function rn(e, t) {
786
+ function un(e, t) {
768
787
  let n = 0;
769
788
  for (let r of e) {
770
789
  let e = Number(r?.[t]);
@@ -775,8 +794,8 @@ function rn(e, t) {
775
794
  total: e.length
776
795
  };
777
796
  }
778
- function an({ dataKey: e, className: t }) {
779
- return /* @__PURE__ */ D(Q, {
797
+ function dn({ dataKey: e, className: t }) {
798
+ return /* @__PURE__ */ D(Z, {
780
799
  code: "no-positive-magnitude",
781
800
  className: t,
782
801
  children: [
@@ -790,7 +809,7 @@ function an({ dataKey: e, className: t }) {
790
809
  ]
791
810
  });
792
811
  }
793
- function on(e, t, n) {
812
+ function fn(e, t, n) {
794
813
  let r = t - e;
795
814
  return r <= 0 ? null : /* @__PURE__ */ D("p", {
796
815
  role: "note",
@@ -815,22 +834,22 @@ function on(e, t, n) {
815
834
  ]
816
835
  });
817
836
  }
818
- function sn(e) {
837
+ function pn(e) {
819
838
  return e != null && Number.isFinite(Number(e));
820
839
  }
821
- function cn(e, t, n) {
840
+ function mn(e, t, n) {
822
841
  let r = 0;
823
842
  for (let i of e) {
824
843
  let e = i;
825
- sn(e?.[t]) && sn(e?.[n]) && (r += 1);
844
+ pn(e?.[t]) && pn(e?.[n]) && (r += 1);
826
845
  }
827
846
  return {
828
847
  plottable: r,
829
848
  total: e.length
830
849
  };
831
850
  }
832
- function ln({ xKey: e, yKey: t, className: n }) {
833
- return /* @__PURE__ */ D(Q, {
851
+ function hn({ xKey: e, yKey: t, className: n }) {
852
+ return /* @__PURE__ */ D(Z, {
834
853
  code: "no-plottable-points",
835
854
  className: n,
836
855
  children: [
@@ -850,27 +869,27 @@ function ln({ xKey: e, yKey: t, className: n }) {
850
869
  ]
851
870
  });
852
871
  }
853
- function un(e) {
854
- return typeof e == "boolean" ? !1 : Array.isArray(e) ? dn(e[0]) && dn(e[1]) : dn(e);
872
+ function gn(e) {
873
+ return typeof e == "boolean" ? !1 : Array.isArray(e) ? _n(e[0]) && _n(e[1]) : _n(e);
855
874
  }
856
- function dn(e) {
875
+ function _n(e) {
857
876
  return typeof e == "number" || e instanceof Number || typeof e == "string" || e instanceof Date ? Number.isFinite(Number(e)) : !1;
858
877
  }
859
- function fn(e) {
878
+ function vn(e) {
860
879
  let t = (e) => typeof e == "number" && Number.isFinite(e);
861
880
  return t(e?.min) && t(e?.max) || t(e?.stepSize);
862
881
  }
863
- function pn(e, t) {
864
- return e.some((e) => un(e?.[t]));
882
+ function yn(e, t) {
883
+ return e.some((e) => gn(e?.[t]));
865
884
  }
866
- function mn(e, t, n) {
885
+ function bn(e, t, n) {
867
886
  let r = t[n];
868
887
  if (!r?.stack) return "none";
869
- let i = ft(e, t), a = i === "combo" ? r.chartType || dt(e) || (n === 0 ? "bar" : "line") : i;
888
+ let i = mt(e, t), a = i === "combo" ? r.chartType || pt(e) || (n === 0 ? "bar" : "line") : i;
870
889
  return a === "line" ? "none" : a === "area" ? "area" : "bar";
871
890
  }
872
- function hn({ keys: e, total: t, className: n }) {
873
- return /* @__PURE__ */ D(Q, {
891
+ function xn({ keys: e, total: t, className: n }) {
892
+ return /* @__PURE__ */ D(Z, {
874
893
  code: "no-numeric-value",
875
894
  className: n,
876
895
  children: [
@@ -879,7 +898,7 @@ function hn({ keys: e, total: t, className: n }) {
879
898
  t === 1 ? "its only row has no" : `none of the ${t} rows has a`,
880
899
  " numeric value for",
881
900
  " ",
882
- e.map((e, t) => /* @__PURE__ */ D(_.Fragment, { children: [t > 0 ? " or " : "", /* @__PURE__ */ E("code", {
901
+ e.map((e, t) => /* @__PURE__ */ D(v.Fragment, { children: [t > 0 ? " or " : "", /* @__PURE__ */ E("code", {
883
902
  className: "font-mono",
884
903
  children: e
885
904
  })] }, `${t}-${e}`)),
@@ -887,22 +906,22 @@ function hn({ keys: e, total: t, className: n }) {
887
906
  ]
888
907
  });
889
908
  }
890
- function gn({ seriesKeys: e, className: t }) {
891
- let n = Ae();
892
- return /* @__PURE__ */ D(Q, {
909
+ function Sn({ seriesKeys: e, className: t }) {
910
+ let n = je();
911
+ return /* @__PURE__ */ D(Z, {
893
912
  code: "scatter-multi-series",
894
913
  className: t,
895
914
  children: [
896
915
  n("chart.scatterOneMeasure", "A scatter plots one measure. Keep exactly one series:"),
897
916
  " ",
898
- e.map((e, t) => /* @__PURE__ */ D(_.Fragment, { children: [t > 0 ? ", " : "", /* @__PURE__ */ E("code", {
917
+ e.map((e, t) => /* @__PURE__ */ D(v.Fragment, { children: [t > 0 ? ", " : "", /* @__PURE__ */ E("code", {
899
918
  className: "font-mono",
900
919
  children: e
901
920
  })] }, `${t}-${e}`))
902
921
  ]
903
922
  });
904
923
  }
905
- function _n(e, t, n, r) {
924
+ function Cn(e, t, n, r) {
906
925
  let i = t - e;
907
926
  return i <= 0 ? null : /* @__PURE__ */ D("p", {
908
927
  role: "note",
@@ -933,96 +952,105 @@ function _n(e, t, n, r) {
933
952
  ]
934
953
  });
935
954
  }
936
- function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name", series: a = [], className: s = "", colors: c, categoryColors: l, categoryOrder: u, onChartClick: d, isAnimationActive: f, xAxis: p, yAxes: m, showLegend: h, showDataLabels: ee, title: ne, subtitle: re, description: ie, height: ae, annotations: oe, interaction: se }) {
937
- let ce = e === "column" ? "bar" : e, g = ft(ce, a), le = dt(ce), v = Array.isArray(t) ? t : [], y = De(), b = f === !1 ? { isAnimationActive: !1 } : {}, x = {
955
+ function wn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name", series: a = [], className: s = "", colors: c, categoryColors: l, categoryOrder: u, onChartClick: d, isAnimationActive: f, xAxis: p, yAxes: m, showLegend: h, showDataLabels: ee, title: te, subtitle: re, description: ie, height: ae, annotations: oe, interaction: se }) {
956
+ let ce = e === "column" ? "bar" : e, g = mt(ce, a), le = pt(ce), _ = Array.isArray(t) ? t : [], y = Oe(), b = f === !1 ? { isAnimationActive: !1 } : {}, x = {
938
957
  ...f === !1 ? { disableSettleRemount: !0 } : {},
939
958
  ...ae ? { style: { height: ae } } : {},
940
959
  ...ie ? {
941
960
  role: "img",
942
961
  "aria-label": ie
943
962
  } : {}
944
- }, [S, C] = _.useState(!1), w = _.useRef(null), fe = _.useCallback((e) => (...t) => {
945
- let n = jn(t);
946
- n !== void 0 && (w.current = {
963
+ }, [S, fe] = v.useState(!1), [C, w] = v.useState(null), [pe, me] = v.useState(void 0);
964
+ v.useEffect(() => {
965
+ if (C == null || typeof ResizeObserver > "u") return;
966
+ let e = new ResizeObserver((e) => {
967
+ let t = e[0]?.contentRect.width;
968
+ t != null && t > 0 && me(Math.round(t));
969
+ });
970
+ return e.observe(C), () => e.disconnect();
971
+ }, [C]);
972
+ let he = v.useRef(null), ge = v.useCallback((e) => (...t) => {
973
+ let n = Ln(t);
974
+ n !== void 0 && (he.current = {
947
975
  gesture: n,
948
976
  dataKey: String(e.dataKey)
949
977
  });
950
- }, []), pe = d ? (e) => ({ onClick: fe(e) }) : () => ({}), me = _.useCallback((e, t, n) => {
978
+ }, []), _e = d ? (e) => ({ onClick: ge(e) }) : () => ({}), ve = v.useCallback((e, t, n) => {
951
979
  if (!d || !e) return;
952
- let r = e.activeTooltipIndex ?? e.activeIndex, i = r == null ? NaN : Number(r), s = Number.isInteger(i) && i >= 0 ? v[i] : void 0, c = w.current;
953
- w.current = null;
954
- let l = An(t), u = c != null && l !== void 0 && c.gesture === l;
980
+ let r = e.activeTooltipIndex ?? e.activeIndex, i = r == null ? NaN : Number(r), s = Number.isInteger(i) && i >= 0 ? _[i] : void 0, c = he.current;
981
+ he.current = null;
982
+ let l = In(t), u = c != null && l !== void 0 && c.gesture === l;
955
983
  if (n && !u) return;
956
- let f = u ? c.dataKey : kn(e.activeDataKey, a), p = f != null && s ? s[f] : void 0;
984
+ let f = u ? c.dataKey : Fn(e.activeDataKey, a), p = f != null && s ? s[f] : void 0;
957
985
  d({
958
986
  category: e.activeLabel == null ? void 0 : String(e.activeLabel),
959
987
  categoryId: o(s),
960
988
  series: f,
961
- seriesLabel: Mn(f, a),
989
+ seriesLabel: Rn(f, a),
962
990
  value: typeof p == "number" ? p : void 0
963
991
  });
964
992
  }, [
965
993
  d,
966
- v,
994
+ _,
967
995
  a
968
- ]), he = _.useCallback((e, t) => {
969
- me(e, t, !1);
970
- }, [me]), ge = _.useCallback((e, t) => {
971
- me(e, t, !0);
972
- }, [me]), _e = _.useCallback((e) => {
996
+ ]), ye = v.useCallback((e, t) => {
997
+ ve(e, t, !1);
998
+ }, [ve]), be = v.useCallback((e, t) => {
999
+ ve(e, t, !0);
1000
+ }, [ve]), xe = v.useCallback((e) => {
973
1001
  if (!d || !e) return;
974
1002
  let t = e.payload?.[i], n = a[0]?.dataKey || "value";
975
1003
  d({
976
1004
  category: t == null ? void 0 : String(t),
977
1005
  categoryId: o(e.payload),
978
1006
  series: n,
979
- seriesLabel: Mn(n, a),
1007
+ seriesLabel: Rn(n, a),
980
1008
  value: typeof e.payload?.[n] == "number" ? e.payload[n] : void 0
981
1009
  });
982
1010
  }, [
983
1011
  d,
984
1012
  i,
985
1013
  a
986
- ]), ve = d ? {
987
- onClick: he,
1014
+ ]), Se = d ? {
1015
+ onClick: ye,
988
1016
  style: { cursor: "pointer" }
989
- } : {}, ye = d ? { onClick: ge } : {}, be = d ? (e) => ({
990
- ...pe(e),
1017
+ } : {}, Ce = d ? { onClick: be } : {}, we = d ? (e) => ({
1018
+ ..._e(e),
991
1019
  cursor: "pointer"
992
- }) : () => ({}), xe = d ? {
993
- onClick: _e,
1020
+ }) : () => ({}), Te = d ? {
1021
+ onClick: xe,
994
1022
  style: { cursor: "pointer" }
995
- } : {}, Se = _.useCallback((e, t, n) => l && l[e == null ? "" : String(e)] || n[t % n.length], [l]), Ce = _.useCallback((e) => {
1023
+ } : {}, Ee = v.useCallback((e, t, n) => l && l[e == null ? "" : String(e)] || n[t % n.length], [l]), De = v.useCallback((e) => {
996
1024
  if (!d) return;
997
- let t = Rt(e, i, a);
1025
+ let t = Vt(e, i, a);
998
1026
  t && d(t);
999
1027
  }, [
1000
1028
  d,
1001
1029
  i,
1002
1030
  a
1003
- ]), we = _.useCallback((e) => {
1031
+ ]), ke = v.useCallback((e) => {
1004
1032
  if (!d) return;
1005
- let t = zt(e, a);
1033
+ let t = Ht(e, a);
1006
1034
  t && d(t);
1007
- }, [d, a]), Te = _.useCallback((e) => {
1035
+ }, [d, a]), Ae = v.useCallback((e) => {
1008
1036
  if (!d) return;
1009
- let t = Bt(e, a);
1037
+ let t = Ut(e, a);
1010
1038
  t && d(t);
1011
- }, [d, a]), Ee = d ? {
1012
- onClick: Ce,
1039
+ }, [d, a]), je = d ? {
1040
+ onClick: De,
1013
1041
  cursor: "pointer"
1014
- } : {}, Oe = d ? {
1015
- onClick: we,
1042
+ } : {}, Ve = d ? {
1043
+ onClick: ke,
1016
1044
  style: { cursor: "pointer" }
1017
- } : {}, ke = d ? {
1018
- onClick: Te,
1045
+ } : {}, $e = d ? {
1046
+ onClick: Ae,
1019
1047
  style: { cursor: "pointer" }
1020
1048
  } : {};
1021
- _.useEffect(() => {
1022
- let e = () => C(window.innerWidth < 640);
1049
+ v.useEffect(() => {
1050
+ let e = () => fe(window.innerWidth < 640);
1023
1051
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
1024
1052
  }, []);
1025
- let Ae = _.useCallback((e) => {
1053
+ let rt = v.useCallback((e) => {
1026
1054
  if (e == null || e === "") return "";
1027
1055
  let t = r?.[String(e)]?.label;
1028
1056
  if (t != null) return String(t);
@@ -1030,7 +1058,7 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1030
1058
  if (/^\d{4}-\d{2}-\d{2}/.test(n)) {
1031
1059
  let e = de(n);
1032
1060
  if (!Number.isNaN(e.getTime())) {
1033
- let t = (v.length > 1 ? Math.abs(new Date(String(v[v.length - 1][i] ?? "")).getTime() - new Date(String(v[0][i] ?? "")).getTime()) : 0) / 864e5;
1061
+ let t = (_.length > 1 ? Math.abs(new Date(String(_[_.length - 1][i] ?? "")).getTime() - new Date(String(_[0][i] ?? "")).getTime()) : 0) / 864e5;
1034
1062
  try {
1035
1063
  return t <= 62 ? e.toLocaleDateString(y, {
1036
1064
  month: "short",
@@ -1040,24 +1068,24 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1040
1068
  year: "numeric"
1041
1069
  });
1042
1070
  } catch {
1043
- return te(n) ? ue(e) : e.toISOString().slice(0, 10);
1071
+ return ne(n) ? ue(e) : e.toISOString().slice(0, 10);
1044
1072
  }
1045
1073
  }
1046
1074
  }
1047
1075
  return S && n.length > 8 ? n.slice(0, 8) + "…" : n;
1048
1076
  }, [
1049
- v,
1077
+ _,
1050
1078
  i,
1051
1079
  S,
1052
1080
  r,
1053
1081
  y
1054
- ]), Be = _.useMemo(() => v.some((e) => String(e[i] || "").length > 5), [v, i]), Qe = v.length > 0 && v.length <= Pn, tt = (Qe || !S) && Be, nt = () => Array.isArray(c) && c.length > 0 ? c : [
1082
+ ]), it = v.useMemo(() => _.some((e) => String(e[i] || "").length > 5), [_, i]), at = _.length > 0 && _.length <= Bn, ot = () => Array.isArray(c) && c.length > 0 ? c : [
1055
1083
  "hsl(var(--chart-1))",
1056
1084
  "hsl(var(--chart-2))",
1057
1085
  "hsl(var(--chart-3))",
1058
1086
  "hsl(var(--chart-4))",
1059
1087
  "hsl(var(--chart-5))"
1060
- ], rt = _.useCallback((e) => {
1088
+ ], st = v.useCallback((e) => {
1061
1089
  if (e == null || e === "") return "";
1062
1090
  let t = typeof e == "number" ? e : Number(e);
1063
1091
  if (!Number.isFinite(t)) return String(e);
@@ -1069,52 +1097,47 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1069
1097
  } catch {
1070
1098
  return String(t);
1071
1099
  }
1072
- }, [y]), F = m?.[0], I = g === "horizontal-bar", L = lt(m, g), R = L.left === void 0 ? void 0 : m?.[L.left], z = L.right === void 0 ? void 0 : m?.[L.right], it = !!R && !!z, at = g === "combo" || it, B = L.slotOf[0] ?? "left", V = Qt(Xt(L, I), Zt(L, m, I)), ot = (e) => it ? e.yAxis === "right" ? z : R : F, H = _.useMemo(() => W(p?.format, y) ?? Ae, [
1100
+ }, [y]), ct = m?.[0], P = g === "horizontal-bar", F = ft(m, g), I = F.left === void 0 ? void 0 : m?.[F.left], L = F.right === void 0 ? void 0 : m?.[F.right], R = !!I && !!L, z = g === "combo" || R, B = F.slotOf[0] ?? "left", lt = an(nn(F, P), rn(F, m, P)), V = (e) => R ? e.yAxis === "right" ? L : I : ct, H = v.useMemo(() => W(p?.format, y) ?? rt, [
1073
1101
  p?.format,
1074
1102
  y,
1075
- Ae
1076
- ]), U = _.useMemo(() => !Qe || !tt ? H : (e) => {
1103
+ rt
1104
+ ]), dt = pe === void 0 ? void 0 : qt(_.map((e) => String(H(e?.[i]) ?? "")), pe - qn - (g === "combo" || R ? 2 : 1) * Jn), U = (at || !S) && it && dt !== !0, ht = v.useMemo(() => U ? (e) => {
1077
1105
  let t = String(H(e) ?? "");
1078
- return t.length > Fn ? `${t.slice(0, 11)}…` : t;
1079
- }, [
1080
- Qe,
1081
- tt,
1082
- H
1083
- ]), st = _.useMemo(() => W(F?.format, y) ?? rt, [
1084
- F?.format,
1106
+ return t.length > Vn ? `${t.slice(0, 11)}…` : t;
1107
+ } : H, [U, H]), gt = U ? Jt(_.map((e) => String(ht(e?.[i]) ?? ""))) : void 0, bt = v.useMemo(() => W(ct?.format, y) ?? st, [
1108
+ ct?.format,
1085
1109
  y,
1086
- rt
1087
- ]), ct = _.useMemo(() => W(R?.format, y) ?? rt, [
1088
- R?.format,
1110
+ st
1111
+ ]), xt = v.useMemo(() => W(I?.format, y) ?? st, [
1112
+ I?.format,
1089
1113
  y,
1090
- rt
1091
- ]), ut = _.useMemo(() => W(z?.format, y) ?? rt, [
1092
- z?.format,
1114
+ st
1115
+ ]), St = v.useMemo(() => W(L?.format, y) ?? st, [
1116
+ L?.format,
1093
1117
  y,
1094
- rt
1095
- ]), pt = _.useCallback((e) => {
1096
- let t = a.filter((t) => !it || (t.yAxis === "right" ? "right" : "left") === e).map((e) => e.dataKey), n = [];
1097
- for (let e of v) for (let r of t) {
1118
+ st
1119
+ ]), G = v.useCallback((e) => a.filter((t) => !R || (t.yAxis === "right" ? "right" : "left") === e), [a, R]), K = v.useCallback((e) => {
1120
+ let t = G(e).map((e) => e.dataKey), n = [];
1121
+ for (let e of _) for (let r of t) {
1098
1122
  let t = Number(e?.[r]);
1099
1123
  Number.isFinite(t) && n.push(t);
1100
1124
  }
1101
1125
  return n;
1102
- }, [
1103
- v,
1104
- a,
1105
- it
1106
- ]), G = _.useCallback((e, t = "left", n) => $t(e, pt(t), n ?? Wt(t)), [pt]), _t = F?.showGridLines !== !1, vt = {
1126
+ }, [_, G]), q = v.useCallback((e, t = "left", n) => ({
1127
+ ...ut(G(t)) ? { allowDecimals: !1 } : {},
1128
+ ...on(e, K(t), n ?? Xt(t))
1129
+ }), [K, G]), Ct = ct?.showGridLines !== !1, wt = {
1107
1130
  vertical: p?.showGridLines === !0,
1108
- horizontal: _t
1109
- }, { across: K, down: q, refused: J } = Gt(p?.position, I), Y = Kt(J, I), yt = h !== !1, bt = _.useMemo(() => {
1131
+ horizontal: Ct
1132
+ }, { across: J, down: Tt, refused: Et } = Zt(p?.position, P), Dt = Qt(Et, P), Ot = h !== !1, kt = v.useMemo(() => {
1110
1133
  if (!Array.isArray(oe) || oe.length === 0) return null;
1111
1134
  let e = {
1112
1135
  solid: void 0,
1113
1136
  dashed: "4 4",
1114
1137
  dotted: "1 4"
1115
- }, t = Yt(at, I);
1138
+ }, t = tn(z, P);
1116
1139
  return oe.map((n, r) => {
1117
- let i = n?.axis === "x", a = $(String(n?.color || "hsl(var(--muted-foreground))")), o = e[String(n?.style ?? "dashed")], s = typeof n?.label == "string" ? n.label : void 0, c = s ? { label: {
1140
+ let i = n?.axis === "x", a = Q(String(n?.color || "hsl(var(--muted-foreground))")), o = e[String(n?.style ?? "dashed")], s = typeof n?.label == "string" ? n.label : void 0, c = s ? { label: {
1118
1141
  value: s,
1119
1142
  position: "insideTopRight",
1120
1143
  fill: a,
@@ -1128,7 +1151,7 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1128
1151
  y1: n.value,
1129
1152
  y2: n.endValue
1130
1153
  };
1131
- return /* @__PURE__ */ E(Xe, {
1154
+ return /* @__PURE__ */ E(Ze, {
1132
1155
  ...e,
1133
1156
  ...t,
1134
1157
  fill: a,
@@ -1138,7 +1161,7 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1138
1161
  ...c
1139
1162
  }, `ann-${r}`);
1140
1163
  }
1141
- return /* @__PURE__ */ E(Ze, {
1164
+ return /* @__PURE__ */ E(Qe, {
1142
1165
  ...i ? { x: n?.value } : { y: n?.value },
1143
1166
  ...t,
1144
1167
  stroke: a,
@@ -1148,46 +1171,48 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1148
1171
  });
1149
1172
  }, [
1150
1173
  oe,
1151
- at,
1152
- I
1153
- ]), xt = se?.tooltips !== !1, St = se?.brush === !0 ? /* @__PURE__ */ E(Fe, {
1174
+ z,
1175
+ P
1176
+ ]), Nt = se?.tooltips !== !1, Y = se?.brush === !0 ? /* @__PURE__ */ E(Fe, {
1154
1177
  dataKey: i,
1155
1178
  height: 24,
1156
1179
  travellerWidth: 8,
1157
1180
  stroke: "hsl(var(--muted-foreground))"
1158
- }) : null, Ct = (e) => ee ? /* @__PURE__ */ E(ze, {
1181
+ }) : null, X = (e) => ee ? /* @__PURE__ */ E(Be, {
1159
1182
  position: "top",
1160
1183
  className: "fill-foreground",
1161
1184
  fontSize: 11,
1162
1185
  ...e ? { formatter: e } : {}
1163
- }) : null, wt = _.useMemo(() => ({
1186
+ }) : null, Pt = v.useMemo(() => ({
1187
+ tick: $,
1164
1188
  tickLine: !1,
1165
- tickMargin: 10,
1189
+ tickMargin: Un,
1166
1190
  axisLine: !1,
1167
- ...Qe ? { interval: 0 } : {
1191
+ ...at ? { interval: 0 } : {
1168
1192
  interval: "preserveStartEnd",
1169
1193
  minTickGap: 0
1170
1194
  },
1171
- tickFormatter: U,
1172
- ...K ? { orientation: K } : {},
1195
+ tickFormatter: ht,
1196
+ ...J ? { orientation: J } : {},
1173
1197
  ...p?.title ? { label: {
1174
1198
  value: p.title,
1175
- ...Ut(K)
1199
+ ...Yt(J)
1176
1200
  } } : {},
1177
- ...tt && {
1178
- angle: K === "top" ? 35 : -35,
1201
+ ...U && {
1202
+ angle: J === "top" ? Hn : -35,
1179
1203
  textAnchor: "end",
1180
- height: 60
1204
+ height: gt
1181
1205
  }
1182
1206
  }), [
1183
- Qe,
1184
- tt,
1207
+ at,
1185
1208
  U,
1209
+ ht,
1186
1210
  p?.title,
1187
- K
1211
+ J,
1212
+ gt
1188
1213
  ]);
1189
- if (g && ht.has(g)) {
1190
- let e = a[0]?.dataKey || "value", t = v[0]?.[e], n = typeof t == "number" ? t : Number(t), i = a[0]?.label ?? r?.[e]?.label ?? e;
1214
+ if (g && vt.has(g)) {
1215
+ let e = a[0]?.dataKey || "value", t = _[0]?.[e], n = typeof t == "number" ? t : Number(t), i = a[0]?.label ?? r?.[e]?.label ?? e;
1191
1216
  return /* @__PURE__ */ E("div", {
1192
1217
  className: s,
1193
1218
  "data-testid": "advanced-chart-single-value",
@@ -1203,7 +1228,7 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1203
1228
  })
1204
1229
  });
1205
1230
  }
1206
- if (g && gt.has(g)) return /* @__PURE__ */ D("div", {
1231
+ if (g && yt.has(g)) return /* @__PURE__ */ D("div", {
1207
1232
  className: `rounded-md border border-dashed bg-muted/20 px-3 py-2 text-xs text-muted-foreground ${s ?? ""}`,
1208
1233
  "data-testid": "advanced-chart-tabular-notice",
1209
1234
  role: "note",
@@ -1213,7 +1238,7 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1213
1238
  "” is tabular — render it with the data-table / pivot components; a chart block draws series charts."
1214
1239
  ]
1215
1240
  });
1216
- if (!g || !mt.has(g)) return /* @__PURE__ */ E("div", {
1241
+ if (!g || !_t.has(g)) return /* @__PURE__ */ E("div", {
1217
1242
  className: `rounded-md border border-dashed bg-muted/20 px-3 py-2 text-xs text-muted-foreground ${s ?? ""}`,
1218
1243
  "data-testid": "advanced-chart-unknown-type",
1219
1244
  role: "note",
@@ -1223,47 +1248,47 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1223
1248
  "” is not a spec chart type — nothing was drawn."
1224
1249
  ] }) : /* @__PURE__ */ E(T, { children: "This chart names no chart type — nothing was drawn." })
1225
1250
  });
1226
- let Tt = {
1227
- bar: Pe,
1228
- "horizontal-bar": Pe,
1229
- line: He,
1230
- area: Me,
1231
- pie: We,
1232
- donut: We,
1233
- radar: Ye,
1234
- scatter: j,
1235
- funnel: k,
1236
- combo: Le,
1237
- treemap: Pe,
1238
- sankey: Pe
1239
- }[g] || Pe;
1251
+ let Ft = {
1252
+ bar: O,
1253
+ "horizontal-bar": O,
1254
+ line: Ue,
1255
+ area: Ne,
1256
+ pie: Ge,
1257
+ donut: Ge,
1258
+ radar: Xe,
1259
+ scatter: nt,
1260
+ funnel: ze,
1261
+ combo: Re,
1262
+ treemap: O,
1263
+ sankey: O
1264
+ }[g] || O;
1240
1265
  if (g === "pie" || g === "donut") {
1241
- let e = g === "donut" ? "52%" : 0, t = nt(), n = a[0]?.dataKey || "value", o = rn(v, n);
1242
- if (o.total > 0 && o.sizable === 0) return /* @__PURE__ */ E(an, {
1266
+ let e = g === "donut" ? "52%" : 0, t = ot(), n = a[0]?.dataKey || "value", o = un(_, n);
1267
+ if (o.total > 0 && o.sizable === 0) return /* @__PURE__ */ E(dn, {
1243
1268
  dataKey: n,
1244
1269
  className: s
1245
1270
  });
1246
1271
  let c = { ...r };
1247
- v.forEach((e, n) => {
1272
+ _.forEach((e, n) => {
1248
1273
  let r = e?.[i];
1249
1274
  if (r == null || r === "") return;
1250
1275
  let a = String(r);
1251
1276
  c[a] || (c[a] = {
1252
1277
  label: a,
1253
- color: Se(r, n, t)
1278
+ color: Ee(r, n, t)
1254
1279
  });
1255
1280
  });
1256
- let l = /* @__PURE__ */ E(Dt, {
1281
+ let l = /* @__PURE__ */ E(At, {
1257
1282
  config: c,
1258
1283
  className: s,
1259
1284
  ...x,
1260
- children: /* @__PURE__ */ D(We, { children: [
1261
- /* @__PURE__ */ E(Pt, {
1285
+ children: /* @__PURE__ */ D(Ge, { children: [
1286
+ /* @__PURE__ */ E(Lt, {
1262
1287
  cursor: !1,
1263
- content: /* @__PURE__ */ E(Ot, { hideLabel: !0 })
1288
+ content: /* @__PURE__ */ E(jt, { hideLabel: !0 })
1264
1289
  }),
1265
- /* @__PURE__ */ E(Ue, {
1266
- data: v,
1290
+ /* @__PURE__ */ E(We, {
1291
+ data: _,
1267
1292
  dataKey: n,
1268
1293
  nameKey: i || "name",
1269
1294
  innerRadius: e,
@@ -1271,33 +1296,33 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1271
1296
  paddingAngle: 2,
1272
1297
  outerRadius: "85%",
1273
1298
  ...b,
1274
- ...xe,
1275
- children: v.map((e, n) => {
1276
- let r = Se(e?.[i], n, t);
1277
- return /* @__PURE__ */ E(Ie, { fill: $(r) }, `cell-${n}`);
1299
+ ...Te,
1300
+ children: _.map((e, n) => {
1301
+ let r = Ee(e?.[i], n, t);
1302
+ return /* @__PURE__ */ E(Le, { fill: Q(r) }, `cell-${n}`);
1278
1303
  })
1279
1304
  }),
1280
- yt ? /* @__PURE__ */ E(Ft, {
1305
+ Ot ? /* @__PURE__ */ E(Rt, {
1281
1306
  verticalAlign: "bottom",
1282
1307
  wrapperStyle: {
1283
1308
  fontSize: S ? "11px" : "12px",
1284
1309
  paddingTop: "8px"
1285
1310
  },
1286
- content: /* @__PURE__ */ E(kt, {
1311
+ content: /* @__PURE__ */ E(Mt, {
1287
1312
  nameKey: i,
1288
1313
  className: "flex-wrap"
1289
1314
  })
1290
1315
  }) : null
1291
1316
  ] })
1292
1317
  });
1293
- return /* @__PURE__ */ E(nn, {
1294
- note: on(o.sizable, o.total, n),
1318
+ return /* @__PURE__ */ E(ln, {
1319
+ note: fn(o.sizable, o.total, n),
1295
1320
  children: l
1296
1321
  });
1297
1322
  }
1298
1323
  if (g === "funnel") {
1299
- let e = a[0]?.dataKey || "value", t = nt(), c = rn(v, e);
1300
- if (c.total > 0 && c.sizable === 0) return /* @__PURE__ */ E(an, {
1324
+ let e = a[0]?.dataKey || "value", t = ot(), c = un(_, e);
1325
+ if (c.total > 0 && c.sizable === 0) return /* @__PURE__ */ E(dn, {
1301
1326
  dataKey: e,
1302
1327
  className: s
1303
1328
  });
@@ -1310,68 +1335,68 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1310
1335
  } : void 0, f = l ? {
1311
1336
  onClick: l,
1312
1337
  style: { cursor: "pointer" }
1313
- } : {}, p = n(u), m = p ? [...v].sort((e, t) => (p.get(String(e?.[i] ?? "")) ?? 2 ** 53 - 1) - (p.get(String(t?.[i] ?? "")) ?? 2 ** 53 - 1)) : [...v].sort((t, n) => {
1338
+ } : {}, p = n(u), m = p ? [..._].sort((e, t) => (p.get(String(e?.[i] ?? "")) ?? 2 ** 53 - 1) - (p.get(String(t?.[i] ?? "")) ?? 2 ** 53 - 1)) : [..._].sort((t, n) => {
1314
1339
  let r = Number(t?.[e] ?? 0);
1315
1340
  return Number(n?.[e] ?? 0) - r;
1316
- }), h = /* @__PURE__ */ E(Dt, {
1341
+ }), h = /* @__PURE__ */ E(At, {
1317
1342
  config: r,
1318
1343
  className: s,
1319
1344
  ...x,
1320
- children: /* @__PURE__ */ D(k, { children: [/* @__PURE__ */ E(Pt, { content: /* @__PURE__ */ E(Ot, {}) }), /* @__PURE__ */ D(Re, {
1345
+ children: /* @__PURE__ */ D(ze, { children: [/* @__PURE__ */ E(Lt, { content: /* @__PURE__ */ E(jt, {}) }), /* @__PURE__ */ D(k, {
1321
1346
  dataKey: e,
1322
1347
  data: m,
1323
1348
  nameKey: i,
1324
1349
  ...b,
1325
1350
  ...f,
1326
- children: [/* @__PURE__ */ E(ze, {
1351
+ children: [/* @__PURE__ */ E(Be, {
1327
1352
  position: "right",
1328
1353
  fill: "hsl(var(--foreground))",
1329
1354
  stroke: "none",
1330
1355
  dataKey: i
1331
- }), m.map((e, n) => /* @__PURE__ */ E(Ie, { fill: $(t[n % t.length]) }, `funnel-cell-${n}`))]
1356
+ }), m.map((e, n) => /* @__PURE__ */ E(Le, { fill: Q(t[n % t.length]) }, `funnel-cell-${n}`))]
1332
1357
  })] })
1333
1358
  });
1334
- return /* @__PURE__ */ E(nn, {
1335
- note: on(c.sizable, c.total, e),
1359
+ return /* @__PURE__ */ E(ln, {
1360
+ note: fn(c.sizable, c.total, e),
1336
1361
  children: h
1337
1362
  });
1338
1363
  }
1339
1364
  if (g === "treemap") {
1340
- let e = a[0]?.dataKey || "value", t = nt(), n = rn(v, e);
1341
- if (n.total > 0 && n.sizable === 0) return /* @__PURE__ */ E(an, {
1365
+ let e = a[0]?.dataKey || "value", t = ot(), n = un(_, e);
1366
+ if (n.total > 0 && n.sizable === 0) return /* @__PURE__ */ E(dn, {
1342
1367
  dataKey: e,
1343
1368
  className: s
1344
1369
  });
1345
- let o = v.map((n, r) => ({
1370
+ let o = _.map((n, r) => ({
1346
1371
  name: String(n?.[i] ?? ""),
1347
1372
  size: Number(n?.[e]) || 0,
1348
- fill: $(t[r % t.length])
1349
- })), c = /* @__PURE__ */ E(Dt, {
1373
+ fill: Q(t[r % t.length])
1374
+ })), c = /* @__PURE__ */ E(At, {
1350
1375
  config: r,
1351
1376
  className: s,
1352
1377
  ...x,
1353
- children: /* @__PURE__ */ E(et, {
1378
+ children: /* @__PURE__ */ E(j, {
1354
1379
  data: o,
1355
1380
  dataKey: "size",
1356
1381
  nameKey: "name",
1357
1382
  ...b,
1358
- content: /* @__PURE__ */ E(en, {}),
1359
- ...Oe,
1360
- children: /* @__PURE__ */ E(M, {})
1383
+ content: /* @__PURE__ */ E(sn, {}),
1384
+ ...Ve,
1385
+ children: /* @__PURE__ */ E(A, {})
1361
1386
  })
1362
1387
  });
1363
- return /* @__PURE__ */ E(nn, {
1364
- note: on(n.sizable, n.total, e),
1388
+ return /* @__PURE__ */ E(ln, {
1389
+ note: fn(n.sizable, n.total, e),
1365
1390
  children: c
1366
1391
  });
1367
1392
  }
1368
1393
  if (g === "sankey") {
1369
- let e = a[0]?.dataKey || "value", t = a[0]?.label || e, n = v.filter((t) => (Number(t?.[e]) || 0) > 0), o = [{ name: t }, ...n.map((e) => ({ name: String(e?.[i] ?? "") }))], c = n.map((t, n) => ({
1394
+ let e = a[0]?.dataKey || "value", t = a[0]?.label || e, n = _.filter((t) => (Number(t?.[e]) || 0) > 0), o = [{ name: t }, ...n.map((e) => ({ name: String(e?.[i] ?? "") }))], c = n.map((t, n) => ({
1370
1395
  source: 0,
1371
1396
  target: n + 1,
1372
1397
  value: Number(t?.[e]) || 0
1373
1398
  }));
1374
- if (c.length === 0) return v.length === 0 ? /* @__PURE__ */ E("div", { className: s }) : /* @__PURE__ */ D(Q, {
1399
+ if (c.length === 0) return _.length === 0 ? /* @__PURE__ */ E("div", { className: s }) : /* @__PURE__ */ D(Z, {
1375
1400
  code: "no-positive-flow",
1376
1401
  className: s,
1377
1402
  children: [
@@ -1384,8 +1409,8 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1384
1409
  " is above zero."
1385
1410
  ]
1386
1411
  });
1387
- let l = v.length - n.length;
1388
- return /* @__PURE__ */ E(nn, {
1412
+ let l = _.length - n.length;
1413
+ return /* @__PURE__ */ E(ln, {
1389
1414
  note: l > 0 ? /* @__PURE__ */ D("p", {
1390
1415
  role: "note",
1391
1416
  "data-chart-note": "omitted-rows",
@@ -1394,7 +1419,7 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1394
1419
  "Showing ",
1395
1420
  n.length,
1396
1421
  " of ",
1397
- v.length,
1422
+ _.length,
1398
1423
  " rows — ",
1399
1424
  l,
1400
1425
  " ",
@@ -1408,11 +1433,11 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1408
1433
  " above zero, which a flow cannot draw."
1409
1434
  ]
1410
1435
  }) : null,
1411
- children: /* @__PURE__ */ E(Dt, {
1436
+ children: /* @__PURE__ */ E(At, {
1412
1437
  config: r,
1413
1438
  className: s,
1414
1439
  ...x,
1415
- children: /* @__PURE__ */ E($e, {
1440
+ children: /* @__PURE__ */ E(et, {
1416
1441
  data: {
1417
1442
  nodes: o,
1418
1443
  links: c
@@ -1423,25 +1448,28 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1423
1448
  strokeOpacity: .25
1424
1449
  },
1425
1450
  node: { fill: "hsl(var(--chart-1))" },
1426
- ...ke,
1427
- children: /* @__PURE__ */ E(M, {})
1451
+ ...$e,
1452
+ children: /* @__PURE__ */ E(A, {})
1428
1453
  })
1429
1454
  })
1430
1455
  });
1431
1456
  }
1432
- if (g === "radar") return /* @__PURE__ */ E(Dt, {
1457
+ if (g === "radar") return /* @__PURE__ */ E(At, {
1433
1458
  config: r,
1434
1459
  className: s,
1435
1460
  ...x,
1436
- children: /* @__PURE__ */ D(Ye, {
1437
- data: v,
1461
+ children: /* @__PURE__ */ D(Xe, {
1462
+ data: _,
1438
1463
  children: [
1439
- /* @__PURE__ */ E(Ke, {}),
1440
- /* @__PURE__ */ E(Ge, { dataKey: i }),
1441
1464
  /* @__PURE__ */ E(qe, {}),
1442
- /* @__PURE__ */ E(Pt, { content: /* @__PURE__ */ E(Ot, {}) }),
1443
- /* @__PURE__ */ E(Ft, {
1444
- content: /* @__PURE__ */ E(kt, {}),
1465
+ /* @__PURE__ */ E(Ke, {
1466
+ dataKey: i,
1467
+ tick: $
1468
+ }),
1469
+ /* @__PURE__ */ E(Je, { tick: $ }),
1470
+ /* @__PURE__ */ E(Lt, { content: /* @__PURE__ */ E(jt, {}) }),
1471
+ /* @__PURE__ */ E(Rt, {
1472
+ content: /* @__PURE__ */ E(Mt, {}),
1445
1473
  ...S && {
1446
1474
  verticalAlign: "bottom",
1447
1475
  wrapperStyle: {
@@ -1451,8 +1479,8 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1451
1479
  }
1452
1480
  }),
1453
1481
  a.map((e) => {
1454
- let t = $(r[e.dataKey]?.color || En), n = On(e, "radar");
1455
- return /* @__PURE__ */ E(Je, {
1482
+ let t = Q(r[e.dataKey]?.color || Mn), n = Pn(e, "radar");
1483
+ return /* @__PURE__ */ E(Ye, {
1456
1484
  dataKey: e.dataKey,
1457
1485
  stroke: t,
1458
1486
  fill: t,
@@ -1466,59 +1494,61 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1466
1494
  })
1467
1495
  });
1468
1496
  if (g === "scatter") {
1469
- if (a.length > 1) return /* @__PURE__ */ E(gn, {
1497
+ if (a.length > 1) return /* @__PURE__ */ E(Sn, {
1470
1498
  seriesKeys: a.map((e) => String(e.dataKey)),
1471
1499
  className: s
1472
1500
  });
1473
- let e = a[0]?.dataKey || "value", t = cn(v, i, e), n = v.map((e) => Number(e?.[i])).filter((e) => Number.isFinite(e)), o = W(p?.format, y);
1474
- if (t.total > 0 && t.plottable === 0) return /* @__PURE__ */ E(ln, {
1501
+ let e = a[0]?.dataKey || "value", t = mn(_, i, e), n = _.map((e) => Number(e?.[i])).filter((e) => Number.isFinite(e)), o = W(p?.format, y);
1502
+ if (t.total > 0 && t.plottable === 0) return /* @__PURE__ */ E(hn, {
1475
1503
  xKey: i,
1476
1504
  yKey: e,
1477
1505
  className: s
1478
1506
  });
1479
1507
  if (t.total > 0) {
1480
- let n = [[i, p], [e, m?.[0]]].filter(([e, t]) => !fn(t) && !pn(v, e)).map(([e]) => e).filter((e, t, n) => n.indexOf(e) === t);
1481
- if (n.length > 0) return /* @__PURE__ */ E(hn, {
1508
+ let n = [[i, p], [e, m?.[0]]].filter(([e, t]) => !vn(t) && !yn(_, e)).map(([e]) => e).filter((e, t, n) => n.indexOf(e) === t);
1509
+ if (n.length > 0) return /* @__PURE__ */ E(xn, {
1482
1510
  keys: n,
1483
1511
  total: t.total,
1484
1512
  className: s
1485
1513
  });
1486
1514
  }
1487
- return /* @__PURE__ */ E(nn, {
1488
- note: Qt(_n(t.plottable, t.total, i, e), Y, V),
1489
- children: /* @__PURE__ */ E(Dt, {
1515
+ return /* @__PURE__ */ E(ln, {
1516
+ note: an(Cn(t.plottable, t.total, i, e), Dt, lt),
1517
+ children: /* @__PURE__ */ E(At, {
1490
1518
  config: r,
1491
1519
  className: s,
1492
1520
  ...x,
1493
- children: /* @__PURE__ */ D(j, { children: [
1494
- /* @__PURE__ */ E(O, { ...vt }),
1495
- /* @__PURE__ */ E(N, {
1521
+ children: /* @__PURE__ */ D(nt, { children: [
1522
+ /* @__PURE__ */ E(Ie, { ...wt }),
1523
+ /* @__PURE__ */ E(M, {
1496
1524
  type: "number",
1497
1525
  dataKey: i,
1498
1526
  name: String(r[i]?.label || i),
1527
+ tick: $,
1499
1528
  tickLine: !1,
1500
1529
  axisLine: !1,
1501
1530
  minTickGap: S ? 32 : 48,
1502
- padding: Ln,
1531
+ padding: Zn,
1503
1532
  ...o ? { tickFormatter: o } : {},
1504
- ...K ? { orientation: K } : {},
1505
- ...$t(p, n, Ut(K))
1533
+ ...J ? { orientation: J } : {},
1534
+ ...on(p, n, Yt(J))
1506
1535
  }),
1507
- /* @__PURE__ */ E(P, {
1536
+ /* @__PURE__ */ E(N, {
1508
1537
  type: "number",
1509
1538
  dataKey: e,
1510
1539
  name: String(r[a[0]?.dataKey]?.label || a[0]?.dataKey),
1540
+ tick: $,
1511
1541
  tickLine: !1,
1512
1542
  axisLine: !1,
1513
- tickFormatter: st,
1543
+ tickFormatter: bt,
1514
1544
  width: 48,
1515
- padding: Rn,
1545
+ padding: Qn,
1516
1546
  ...B === "right" ? { orientation: "right" } : {},
1517
- ...G(F, B)
1547
+ ...q(ct, B)
1518
1548
  }),
1519
- /* @__PURE__ */ E(Pt, { content: /* @__PURE__ */ E(Ot, {}) }),
1520
- /* @__PURE__ */ E(Ft, {
1521
- content: /* @__PURE__ */ E(kt, { nameKey: e }),
1549
+ /* @__PURE__ */ E(Lt, { content: /* @__PURE__ */ E(jt, {}) }),
1550
+ /* @__PURE__ */ E(Rt, {
1551
+ content: /* @__PURE__ */ E(Mt, { nameKey: e }),
1522
1552
  ...S && {
1523
1553
  verticalAlign: "bottom",
1524
1554
  wrapperStyle: {
@@ -1528,63 +1558,66 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1528
1558
  }
1529
1559
  }),
1530
1560
  a.map((e, t) => {
1531
- let n = nt(), i = $(r[e.dataKey]?.color || n[t % n.length]), a = On(e, "scatter");
1532
- return /* @__PURE__ */ E(A, {
1561
+ let n = ot(), i = Q(r[e.dataKey]?.color || n[t % n.length]), a = Pn(e, "scatter");
1562
+ return /* @__PURE__ */ E(tt, {
1533
1563
  name: r[e.dataKey]?.label || e.dataKey,
1534
- data: v,
1564
+ data: _,
1535
1565
  fill: i,
1536
1566
  fillOpacity: a.fillOpacity,
1537
1567
  strokeOpacity: a.strokeOpacity,
1538
1568
  strokeDasharray: a.strokeDasharray,
1539
1569
  ...b,
1540
- ...Ee
1570
+ ...je
1541
1571
  }, e.dataKey);
1542
1572
  })
1543
1573
  ] })
1544
1574
  })
1545
1575
  });
1546
1576
  }
1547
- if (g === "combo") return /* @__PURE__ */ E(tn, {
1548
- title: ne,
1577
+ if (g === "combo") return /* @__PURE__ */ E(cn, {
1578
+ title: te,
1549
1579
  subtitle: re,
1550
- children: /* @__PURE__ */ E(nn, {
1551
- note: Qt(Y, V),
1552
- children: /* @__PURE__ */ E(Dt, {
1580
+ children: /* @__PURE__ */ E(ln, {
1581
+ note: an(Dt, lt),
1582
+ children: /* @__PURE__ */ E(At, {
1553
1583
  config: r,
1554
1584
  className: s,
1555
1585
  ...x,
1556
- children: /* @__PURE__ */ D(Le, {
1557
- data: v,
1558
- ...ye,
1586
+ children: /* @__PURE__ */ D(Re, {
1587
+ ref: w,
1588
+ data: _,
1589
+ ...Ce,
1559
1590
  children: [
1560
- /* @__PURE__ */ E(O, {
1561
- ...vt,
1562
- ...Yt(at, I)
1591
+ /* @__PURE__ */ E(Ie, {
1592
+ ...wt,
1593
+ ...tn(z, P)
1563
1594
  }),
1564
- /* @__PURE__ */ E(N, {
1595
+ /* @__PURE__ */ E(M, {
1565
1596
  dataKey: i,
1566
- ...wt
1597
+ ...Pt
1567
1598
  }),
1568
- /* @__PURE__ */ E(P, {
1599
+ /* @__PURE__ */ E(N, {
1569
1600
  yAxisId: "left",
1601
+ tick: $,
1570
1602
  tickLine: !1,
1571
1603
  axisLine: !1,
1572
- tickFormatter: ct,
1604
+ tickFormatter: xt,
1573
1605
  width: 48,
1574
- ...G(R, "left")
1606
+ ...q(I, "left")
1575
1607
  }),
1576
- /* @__PURE__ */ E(P, {
1608
+ /* @__PURE__ */ E(N, {
1577
1609
  yAxisId: "right",
1578
1610
  orientation: "right",
1611
+ tick: $,
1579
1612
  tickLine: !1,
1580
1613
  axisLine: !1,
1581
- tickFormatter: ut,
1614
+ tickFormatter: St,
1582
1615
  width: 48,
1583
- ...G(z, "right")
1616
+ ...q(L, "right")
1584
1617
  }),
1585
- xt ? /* @__PURE__ */ E(Pt, { content: /* @__PURE__ */ E(Ot, {}) }) : null,
1586
- yt ? /* @__PURE__ */ E(Ft, {
1587
- content: /* @__PURE__ */ E(kt, {}),
1618
+ Nt ? /* @__PURE__ */ E(Lt, { content: /* @__PURE__ */ E(jt, {}) }) : null,
1619
+ Ot ? /* @__PURE__ */ E(Rt, {
1620
+ content: /* @__PURE__ */ E(Mt, {}),
1588
1621
  ...S && {
1589
1622
  verticalAlign: "bottom",
1590
1623
  wrapperStyle: {
@@ -1593,11 +1626,11 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1593
1626
  }
1594
1627
  }
1595
1628
  }) : null,
1596
- bt,
1597
- St,
1629
+ kt,
1630
+ Y,
1598
1631
  a.map((e, t) => {
1599
- let n = $(r[e.dataKey]?.color || En), i = e.chartType || le || (t === 0 ? "bar" : "line"), a = e.yAxis === "right" || e.yAxis === "left" ? e.yAxis : le || i === "bar" ? "left" : "right", o = On(e, i), s = e.stack ? { stackId: String(e.stack) } : {}, c = W((a === "right" ? z : R)?.format, y);
1600
- return i === "line" ? /* @__PURE__ */ E(Ve, {
1632
+ let n = Q(r[e.dataKey]?.color || Mn), i = e.chartType || le || (t === 0 ? "bar" : "line"), a = e.yAxis === "right" || e.yAxis === "left" ? e.yAxis : le || i === "bar" ? "left" : "right", o = Pn(e, i), s = e.stack ? { stackId: String(e.stack) } : {}, c = W((a === "right" ? L : I)?.format, y);
1633
+ return i === "line" ? /* @__PURE__ */ E(He, {
1601
1634
  yAxisId: a,
1602
1635
  type: "monotone",
1603
1636
  dataKey: e.dataKey,
@@ -1607,9 +1640,9 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1607
1640
  strokeOpacity: o.strokeOpacity,
1608
1641
  strokeDasharray: o.strokeDasharray,
1609
1642
  ...b,
1610
- ...be(e),
1611
- children: Ct(c)
1612
- }, e.dataKey) : i === "area" ? /* @__PURE__ */ E(je, {
1643
+ ...we(e),
1644
+ children: X(c)
1645
+ }, e.dataKey) : i === "area" ? /* @__PURE__ */ E(Me, {
1613
1646
  yAxisId: a,
1614
1647
  type: "monotone",
1615
1648
  dataKey: e.dataKey,
@@ -1620,9 +1653,9 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1620
1653
  strokeDasharray: o.strokeDasharray,
1621
1654
  ...s,
1622
1655
  ...b,
1623
- ...be(e),
1624
- children: Ct(c)
1625
- }, e.dataKey) : /* @__PURE__ */ E(Ne, {
1656
+ ...we(e),
1657
+ children: X(c)
1658
+ }, e.dataKey) : /* @__PURE__ */ E(Pe, {
1626
1659
  yAxisId: a,
1627
1660
  dataKey: e.dataKey,
1628
1661
  fill: n,
@@ -1632,8 +1665,8 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1632
1665
  strokeDasharray: o.strokeDasharray,
1633
1666
  ...s,
1634
1667
  ...b,
1635
- ...be(e),
1636
- children: Ct(c)
1668
+ ...we(e),
1669
+ children: X(c)
1637
1670
  }, e.dataKey);
1638
1671
  })
1639
1672
  ]
@@ -1641,27 +1674,28 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1641
1674
  })
1642
1675
  })
1643
1676
  });
1644
- let Et = g === "horizontal-bar", At = nt(), X = l ? Object.values(l).map((e) => $(String(e))) : [], jt = Array.from(/* @__PURE__ */ new Set([
1645
- ...At,
1646
- ...X,
1647
- ...a.map((e, t) => $(r[e.dataKey]?.color || At[t % At.length] || En))
1648
- ])), Z = (e) => "g" + e.replace(/[^a-zA-Z0-9]/g, "");
1649
- return /* @__PURE__ */ E(tn, {
1650
- title: ne,
1677
+ let It = g === "horizontal-bar", zt = ot(), Bt = l ? Object.values(l).map((e) => Q(String(e))) : [], Wt = Array.from(/* @__PURE__ */ new Set([
1678
+ ...zt,
1679
+ ...Bt,
1680
+ ...a.map((e, t) => Q(r[e.dataKey]?.color || zt[t % zt.length] || Mn))
1681
+ ])), Gt = (e) => "g" + e.replace(/[^a-zA-Z0-9]/g, "");
1682
+ return /* @__PURE__ */ E(cn, {
1683
+ title: te,
1651
1684
  subtitle: re,
1652
- children: /* @__PURE__ */ E(nn, {
1653
- note: Qt(Y, V),
1654
- children: /* @__PURE__ */ E(Dt, {
1685
+ children: /* @__PURE__ */ E(ln, {
1686
+ note: an(Dt, lt),
1687
+ children: /* @__PURE__ */ E(At, {
1655
1688
  config: r,
1656
1689
  className: s,
1657
1690
  ...x,
1658
- children: /* @__PURE__ */ D(Tt, {
1659
- data: v,
1660
- layout: Et ? "vertical" : "horizontal",
1661
- ...ve,
1691
+ children: /* @__PURE__ */ D(Ft, {
1692
+ ref: w,
1693
+ data: _,
1694
+ layout: It ? "vertical" : "horizontal",
1695
+ ...Se,
1662
1696
  children: [
1663
- /* @__PURE__ */ E("defs", { children: jt.map((e) => /* @__PURE__ */ D(_.Fragment, { children: [/* @__PURE__ */ D("linearGradient", {
1664
- id: `bg-${Z(e)}`,
1697
+ /* @__PURE__ */ E("defs", { children: Wt.map((e) => /* @__PURE__ */ D(v.Fragment, { children: [/* @__PURE__ */ D("linearGradient", {
1698
+ id: `bg-${Gt(e)}`,
1665
1699
  x1: "0",
1666
1700
  y1: "0",
1667
1701
  x2: "0",
@@ -1676,7 +1710,7 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1676
1710
  stopOpacity: .5
1677
1711
  })]
1678
1712
  }), /* @__PURE__ */ D("linearGradient", {
1679
- id: `ag-${Z(e)}`,
1713
+ id: `ag-${Gt(e)}`,
1680
1714
  x1: "0",
1681
1715
  y1: "0",
1682
1716
  x2: "0",
@@ -1690,74 +1724,81 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1690
1724
  style: { stopColor: e },
1691
1725
  stopOpacity: .05
1692
1726
  })]
1693
- })] }, Z(e))) }),
1694
- /* @__PURE__ */ E(O, {
1695
- ...vt,
1696
- ...Yt(at, I)
1727
+ })] }, Gt(e))) }),
1728
+ /* @__PURE__ */ E(Ie, {
1729
+ ...wt,
1730
+ ...tn(z, P)
1697
1731
  }),
1698
- Et ? /* @__PURE__ */ D(T, { children: [it ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(N, {
1732
+ It ? /* @__PURE__ */ D(T, { children: [R ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(M, {
1699
1733
  xAxisId: "left",
1700
1734
  type: "number",
1735
+ tick: $,
1701
1736
  tickLine: !1,
1702
1737
  axisLine: !1,
1703
- tickFormatter: ct,
1704
- ...G(R, "left", Bn)
1705
- }), /* @__PURE__ */ E(N, {
1738
+ tickFormatter: xt,
1739
+ ...q(I, "left", er)
1740
+ }), /* @__PURE__ */ E(M, {
1706
1741
  xAxisId: "right",
1707
1742
  orientation: "top",
1708
1743
  type: "number",
1744
+ tick: $,
1709
1745
  tickLine: !1,
1710
1746
  axisLine: !1,
1711
- tickFormatter: ut,
1712
- ...G(z, "right", Vn)
1713
- })] }) : /* @__PURE__ */ E(N, {
1747
+ tickFormatter: St,
1748
+ ...q(L, "right", tr)
1749
+ })] }) : /* @__PURE__ */ E(M, {
1714
1750
  type: "number",
1751
+ tick: $,
1715
1752
  tickLine: !1,
1716
1753
  axisLine: !1,
1717
- tickFormatter: st,
1754
+ tickFormatter: bt,
1718
1755
  ...B === "right" ? { orientation: "top" } : {},
1719
- ...G(F, B, Ut(B === "right" ? "top" : "bottom"))
1720
- }), /* @__PURE__ */ E(P, {
1756
+ ...q(ct, B, Yt(B === "right" ? "top" : "bottom"))
1757
+ }), /* @__PURE__ */ E(N, {
1721
1758
  type: "category",
1722
1759
  dataKey: i,
1760
+ tick: $,
1723
1761
  tickLine: !1,
1724
1762
  axisLine: !1,
1725
- width: Math.min(140, Math.max(60, Math.max(...v.map((e) => String(e[i] ?? "").length)) * 7)),
1763
+ width: Math.min(140, Math.max(60, Math.max(..._.map((e) => String(e[i] ?? "").length)) * 7)),
1726
1764
  tickFormatter: H,
1727
- ...q ? { orientation: q } : {},
1765
+ ...Tt ? { orientation: Tt } : {},
1728
1766
  ...p?.title ? { label: {
1729
1767
  value: p.title,
1730
- ...Wt(q)
1768
+ ...Xt(Tt)
1731
1769
  } } : {}
1732
- })] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(N, {
1770
+ })] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(M, {
1733
1771
  dataKey: i,
1734
- ...wt
1735
- }), it ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(P, {
1772
+ ...Pt
1773
+ }), R ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(N, {
1736
1774
  yAxisId: "left",
1775
+ tick: $,
1737
1776
  tickLine: !1,
1738
1777
  axisLine: !1,
1739
- tickFormatter: ct,
1778
+ tickFormatter: xt,
1740
1779
  width: 48,
1741
- ...G(R, "left")
1742
- }), /* @__PURE__ */ E(P, {
1780
+ ...q(I, "left")
1781
+ }), /* @__PURE__ */ E(N, {
1743
1782
  yAxisId: "right",
1744
1783
  orientation: "right",
1784
+ tick: $,
1745
1785
  tickLine: !1,
1746
1786
  axisLine: !1,
1747
- tickFormatter: ut,
1787
+ tickFormatter: St,
1748
1788
  width: 48,
1749
- ...G(z, "right")
1750
- })] }) : /* @__PURE__ */ E(P, {
1789
+ ...q(L, "right")
1790
+ })] }) : /* @__PURE__ */ E(N, {
1791
+ tick: $,
1751
1792
  tickLine: !1,
1752
1793
  axisLine: !1,
1753
- tickFormatter: st,
1794
+ tickFormatter: bt,
1754
1795
  width: 48,
1755
1796
  ...B === "right" ? { orientation: "right" } : {},
1756
- ...G(F, B)
1797
+ ...q(ct, B)
1757
1798
  })] }),
1758
- xt ? /* @__PURE__ */ E(Pt, { content: /* @__PURE__ */ E(Ot, {}) }) : null,
1759
- yt ? /* @__PURE__ */ E(Ft, {
1760
- content: /* @__PURE__ */ E(kt, {}),
1799
+ Nt ? /* @__PURE__ */ E(Lt, { content: /* @__PURE__ */ E(jt, {}) }) : null,
1800
+ Ot ? /* @__PURE__ */ E(Rt, {
1801
+ content: /* @__PURE__ */ E(Mt, {}),
1761
1802
  ...S && {
1762
1803
  verticalAlign: "bottom",
1763
1804
  wrapperStyle: {
@@ -1766,15 +1807,15 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1766
1807
  }
1767
1808
  }
1768
1809
  }) : null,
1769
- bt,
1770
- St,
1810
+ kt,
1811
+ Y,
1771
1812
  a.map((e, t) => {
1772
- let n = nt(), o = e.variant === "comparison", s = o ? a.slice(0, t).find((e) => e.variant !== "comparison") || a[0] : e, c = o ? a.indexOf(s) : t, l = $(r[s.dataKey]?.color || n[c % n.length] || En), u = e.yAxis === "right" ? "right" : "left", d = it ? Et ? { xAxisId: u } : { yAxisId: u } : {}, f = e.stack ? { stackId: String(e.stack) } : {}, p = W(ot(e)?.format, y);
1813
+ let n = ot(), o = e.variant === "comparison", s = o ? a.slice(0, t).find((e) => e.variant !== "comparison") || a[0] : e, c = o ? a.indexOf(s) : t, l = Q(r[s.dataKey]?.color || n[c % n.length] || Mn), u = e.yAxis === "right" ? "right" : "left", d = R ? It ? { xAxisId: u } : { yAxisId: u } : {}, f = e.stack ? { stackId: String(e.stack) } : {}, p = W(V(e)?.format, y);
1773
1814
  if (g === "bar" || g === "horizontal-bar") {
1774
- let t = a.filter((e) => e.variant !== "comparison").length === 1 && !o && a.length === 1 && v.length > 1, r = On(e, "bar");
1775
- return /* @__PURE__ */ D(Ne, {
1815
+ let t = a.filter((e) => e.variant !== "comparison").length === 1 && !o && a.length === 1 && _.length > 1, r = Pn(e, "bar");
1816
+ return /* @__PURE__ */ D(Pe, {
1776
1817
  dataKey: e.dataKey,
1777
- fill: `url(#bg-${Z(l)})`,
1818
+ fill: `url(#bg-${Gt(l)})`,
1778
1819
  radius: 4,
1779
1820
  fillOpacity: r.fillOpacity,
1780
1821
  strokeOpacity: r.strokeOpacity,
@@ -1782,13 +1823,13 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1782
1823
  ...f,
1783
1824
  ...d,
1784
1825
  ...b,
1785
- ...pe(e),
1786
- children: [t && v.map((e, t) => /* @__PURE__ */ E(Ie, { fill: `url(#bg-${Z($(Se(e?.[i], t, n)))})` }, `cell-${t}`)), Ct(p)]
1826
+ ..._e(e),
1827
+ children: [t && _.map((e, t) => /* @__PURE__ */ E(Le, { fill: `url(#bg-${Gt(Q(Ee(e?.[i], t, n)))})` }, `cell-${t}`)), X(p)]
1787
1828
  }, e.dataKey);
1788
1829
  }
1789
1830
  if (g === "line") {
1790
- let t = On(e, "line");
1791
- return /* @__PURE__ */ E(Ve, {
1831
+ let t = Pn(e, "line");
1832
+ return /* @__PURE__ */ E(He, {
1792
1833
  type: "monotone",
1793
1834
  dataKey: e.dataKey,
1794
1835
  stroke: l,
@@ -1798,16 +1839,16 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1798
1839
  strokeDasharray: t.strokeDasharray,
1799
1840
  ...d,
1800
1841
  ...b,
1801
- ...pe(e),
1802
- children: Ct(p)
1842
+ ..._e(e),
1843
+ children: X(p)
1803
1844
  }, e.dataKey);
1804
1845
  }
1805
1846
  if (g === "area") {
1806
- let t = On(e, "area");
1807
- return /* @__PURE__ */ E(je, {
1847
+ let t = Pn(e, "area");
1848
+ return /* @__PURE__ */ E(Me, {
1808
1849
  type: "monotone",
1809
1850
  dataKey: e.dataKey,
1810
- fill: `url(#ag-${Z(l)})`,
1851
+ fill: `url(#ag-${Gt(l)})`,
1811
1852
  stroke: l,
1812
1853
  strokeWidth: 2,
1813
1854
  fillOpacity: t.fillOpacity ?? 1,
@@ -1816,8 +1857,8 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1816
1857
  ...f,
1817
1858
  ...d,
1818
1859
  ...b,
1819
- ...pe(e),
1820
- children: Ct(p)
1860
+ ..._e(e),
1861
+ children: X(p)
1821
1862
  }, e.dataKey);
1822
1863
  }
1823
1864
  return null;
@@ -1828,39 +1869,39 @@ function vn({ chartType: e, data: t = [], config: r = {}, xAxisKey: i = "name",
1828
1869
  })
1829
1870
  });
1830
1871
  }
1831
- function yn(e) {
1872
+ function Tn(e) {
1832
1873
  return e.chartType === "column" ? "bar" : e.chartType;
1833
1874
  }
1834
- function bn(e) {
1835
- let t = yn(e), n = Array.isArray(e.data) ? e.data : [], r = e.xAxisKey ?? "name";
1836
- return t !== void 0 && Nn.has(t) && n.length > 0 && !n.some((e) => typeof e == "object" && !!e && r in e);
1875
+ function En(e) {
1876
+ let t = Tn(e), n = Array.isArray(e.data) ? e.data : [], r = e.xAxisKey ?? "name";
1877
+ return t !== void 0 && zn.has(t) && n.length > 0 && !n.some((e) => typeof e == "object" && !!e && r in e);
1837
1878
  }
1838
- function xn(e) {
1839
- let t = yn(e), n = Array.isArray(e.data) ? e.data : [];
1840
- return t === void 0 || !Kn.has(t) || n.length === 0 ? null : e.series === void 0 ? "undeclared" : Array.isArray(e.series) && e.series.length === 0 ? "empty" : null;
1879
+ function Dn(e) {
1880
+ let t = Tn(e), n = Array.isArray(e.data) ? e.data : [];
1881
+ return t === void 0 || !or.has(t) || n.length === 0 ? null : e.series === void 0 ? "undeclared" : Array.isArray(e.series) && e.series.length === 0 ? "empty" : null;
1841
1882
  }
1842
- function Sn(e) {
1843
- let t = yn(e), n = Array.isArray(e.data) ? e.data : [], r = Array.isArray(e.series) ? e.series : [];
1844
- if (t === void 0 || !Kn.has(t) || n.length === 0 || r.length === 0) return null;
1883
+ function On(e) {
1884
+ let t = Tn(e), n = Array.isArray(e.data) ? e.data : [], r = Array.isArray(e.series) ? e.series : [];
1885
+ if (t === void 0 || !or.has(t) || n.length === 0 || r.length === 0) return null;
1845
1886
  let i = Array.from(new Set(r.map((e) => String(e.dataKey))));
1846
1887
  if (!i.every((e) => n.some((t) => typeof t == "object" && !!t && Object.prototype.hasOwnProperty.call(t, e)))) return null;
1847
- let a = Array.isArray(e.yAxes) ? e.yAxes : [], o = lt(a, t), s = o.left === void 0 ? void 0 : a[o.left], c = o.right === void 0 ? void 0 : a[o.right], l = !!s && !!c, u = (e) => fn(s) || (!l || e.yAxis !== "left") && fn(c);
1848
- return r.some((e, i) => mn(t, r, i) !== "none" || u(e) || pn(n, String(e.dataKey))) ? null : i;
1888
+ let a = Array.isArray(e.yAxes) ? e.yAxes : [], o = ft(a, t), s = o.left === void 0 ? void 0 : a[o.left], c = o.right === void 0 ? void 0 : a[o.right], l = !!s && !!c, u = (e) => vn(s) || (!l || e.yAxis !== "left") && vn(c);
1889
+ return r.some((e, i) => bn(t, r, i) !== "none" || u(e) || yn(n, String(e.dataKey))) ? null : i;
1849
1890
  }
1850
- function Cn(e) {
1851
- let t = yn(e), n = Array.isArray(e.data) ? e.data : [], r = Array.isArray(e.series) ? e.series : [];
1852
- if (t === void 0 || !Kn.has(t) || n.length === 0 || r.length === 0) return null;
1891
+ function kn(e) {
1892
+ let t = Tn(e), n = Array.isArray(e.data) ? e.data : [], r = Array.isArray(e.series) ? e.series : [];
1893
+ if (t === void 0 || !or.has(t) || n.length === 0 || r.length === 0) return null;
1853
1894
  let i = Array.from(new Set(r.map((e) => e.dataKey)));
1854
1895
  return i.every((e) => typeof e == "string" && /^[^.[]+$/.test(e) && !n.some((t) => typeof t == "object" && !!t && e in t)) ? i : null;
1855
1896
  }
1856
- function wn({ keys: e, className: t }) {
1857
- return /* @__PURE__ */ D(Q, {
1897
+ function An({ keys: e, className: t }) {
1898
+ return /* @__PURE__ */ D(Z, {
1858
1899
  code: "missing-series-key",
1859
1900
  className: t,
1860
1901
  children: [
1861
1902
  "This chart cannot plot its series: no row has a",
1862
1903
  " ",
1863
- e.map((e, t) => /* @__PURE__ */ D(_.Fragment, { children: [t > 0 ? " or " : "", /* @__PURE__ */ E("code", {
1904
+ e.map((e, t) => /* @__PURE__ */ D(v.Fragment, { children: [t > 0 ? " or " : "", /* @__PURE__ */ E("code", {
1864
1905
  className: "font-mono",
1865
1906
  children: e
1866
1907
  })] }, `${t}-${e}`)),
@@ -1869,7 +1910,7 @@ function wn({ keys: e, className: t }) {
1869
1910
  ]
1870
1911
  });
1871
1912
  }
1872
- function Q({ code: e, className: t, children: n }) {
1913
+ function Z({ code: e, className: t, children: n }) {
1873
1914
  return /* @__PURE__ */ E("div", {
1874
1915
  className: `flex h-full min-h-[120px] w-full items-center justify-center p-4 text-center text-sm text-muted-foreground ${t ?? ""}`,
1875
1916
  role: "status",
@@ -1877,15 +1918,15 @@ function Q({ code: e, className: t, children: n }) {
1877
1918
  children: /* @__PURE__ */ E("span", { children: n })
1878
1919
  });
1879
1920
  }
1880
- function Tn(e) {
1881
- let t = bn(e), n = t ? null : xn(e), r = t || n ? null : Cn(e), i = t || n || r ? null : Sn(e), a = e.xAxisKey ?? "name", o = _.useMemo(() => Object.keys((Array.isArray(e.data) ? e.data[0] : void 0) ?? {}), [e.data]), s = r ? JSON.stringify(r) : null, c = JSON.stringify(o);
1882
- return _.useEffect(() => {
1921
+ function jn(e) {
1922
+ let t = En(e), n = t ? null : Dn(e), r = t || n ? null : kn(e), i = t || n || r ? null : On(e), a = e.xAxisKey ?? "name", o = v.useMemo(() => Object.keys((Array.isArray(e.data) ? e.data[0] : void 0) ?? {}), [e.data]), s = r ? JSON.stringify(r) : null, c = JSON.stringify(o);
1923
+ return v.useEffect(() => {
1883
1924
  t && console.warn(`[chart] no row has the category key "${a}" — rendering an explanatory placeholder instead of an empty axis. Row keys: ${JSON.stringify(o)}. A dataset query must PROJECT the dimension it groups by (framework#4033).`);
1884
1925
  }, [
1885
1926
  t,
1886
1927
  a,
1887
1928
  o
1888
- ]), _.useEffect(() => {
1929
+ ]), v.useEffect(() => {
1889
1930
  if (n) {
1890
1931
  if (n === "undeclared") {
1891
1932
  console.warn(`[chart] no series binding was declared for the category axis "${a}" — rendering an explanatory placeholder instead of an empty frame. Row keys: ${JSON.stringify(o)}. A bar / line / area / combo chart draws only the columns its \`series\` (or \`categories\`, or a y-axis \`field\`) names (objectui#4695).`);
@@ -1897,9 +1938,9 @@ function Tn(e) {
1897
1938
  n,
1898
1939
  a,
1899
1940
  o
1900
- ]), _.useEffect(() => {
1941
+ ]), v.useEffect(() => {
1901
1942
  s && console.warn(`[chart] no row has the series key(s) ${s} — rendering an explanatory placeholder instead of an empty frame. Row keys: ${c}. A series \`dataKey\` must name a column the rows carry (objectui#10396).`);
1902
- }, [s, c]), t ? /* @__PURE__ */ D(Q, {
1943
+ }, [s, c]), t ? /* @__PURE__ */ D(Z, {
1903
1944
  code: "missing-category-key",
1904
1945
  className: e.className,
1905
1946
  children: [
@@ -1911,7 +1952,7 @@ function Tn(e) {
1911
1952
  }),
1912
1953
  " field."
1913
1954
  ]
1914
- }) : n === "undeclared" ? /* @__PURE__ */ D(Q, {
1955
+ }) : n === "undeclared" ? /* @__PURE__ */ D(Z, {
1915
1956
  code: "no-plottable-series",
1916
1957
  className: e.className,
1917
1958
  children: [
@@ -1923,7 +1964,7 @@ function Tn(e) {
1923
1964
  }),
1924
1965
  " axis."
1925
1966
  ]
1926
- }) : n === "empty" ? /* @__PURE__ */ D(Q, {
1967
+ }) : n === "empty" ? /* @__PURE__ */ D(Z, {
1927
1968
  code: "no-plottable-series",
1928
1969
  className: e.className,
1929
1970
  children: [
@@ -1935,17 +1976,17 @@ function Tn(e) {
1935
1976
  }),
1936
1977
  " axis."
1937
1978
  ]
1938
- }) : r ? /* @__PURE__ */ E(wn, {
1979
+ }) : r ? /* @__PURE__ */ E(An, {
1939
1980
  keys: r,
1940
1981
  className: e.className
1941
- }) : i ? /* @__PURE__ */ E(hn, {
1982
+ }) : i ? /* @__PURE__ */ E(xn, {
1942
1983
  keys: i,
1943
1984
  total: Array.isArray(e.data) ? e.data.length : 0,
1944
1985
  className: e.className
1945
- }) : /* @__PURE__ */ E(vn, { ...e });
1986
+ }) : /* @__PURE__ */ E(wn, { ...e });
1946
1987
  }
1947
- var En, Dn, $, On, kn, An, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, Wn, Gn, Kn, qn = V((() => {
1948
- It(), Vt(), bt(), En = "hsl(var(--primary))", Dn = {
1988
+ var Mn, Nn, Q, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, $, Wn, Gn, Kn, qn, Jn, Yn, Xn, Zn, Qn, $n, er, tr, nr, rr, ir, ar, or, sr = z((() => {
1989
+ zt(), Wt(), wt(), Mn = "hsl(var(--primary))", Nn = {
1949
1990
  slate: "#64748b",
1950
1991
  gray: "#6b7280",
1951
1992
  zinc: "#71717a",
@@ -1968,14 +2009,14 @@ var En, Dn, $, On, kn, An, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, W
1968
2009
  fuchsia: "#d946ef",
1969
2010
  pink: "#ec4899",
1970
2011
  rose: "#f43f5e"
1971
- }, $ = (e) => Dn[e] || e, On = (e, t) => {
2012
+ }, Q = (e) => Nn[e] || e, Pn = (e, t) => {
1972
2013
  let n = e?.variant === "comparison", r = t === "area" || t === "radar", i = typeof e?.opacity == "number" ? e.opacity : void 0;
1973
2014
  return {
1974
2015
  strokeOpacity: i ?? (n ? t === "line" ? .5 : r ? .6 : void 0 : void 0),
1975
2016
  fillOpacity: i ?? (n ? t === "bar" ? .4 : r ? .2 : .5 : void 0),
1976
2017
  strokeDasharray: e?.dashArray ?? (n && (t === "line" || r) ? "4 4" : void 0)
1977
2018
  };
1978
- }, kn = (e, t) => {
2019
+ }, Fn = (e, t) => {
1979
2020
  if (typeof e == "string" || typeof e == "number") {
1980
2021
  let t = String(e);
1981
2022
  if (t !== "") return t;
@@ -1984,18 +2025,18 @@ var En, Dn, $, On, kn, An, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, W
1984
2025
  let e = t[0]?.dataKey;
1985
2026
  if (e != null && String(e) !== "") return String(e);
1986
2027
  }
1987
- }, An = (e) => {
2028
+ }, In = (e) => {
1988
2029
  if (e && typeof e == "object" && "nativeEvent" in e) return e.nativeEvent;
1989
- }, jn = (e) => {
2030
+ }, Ln = (e) => {
1990
2031
  for (let t = e.length - 1; t >= 0; --t) {
1991
- let n = An(e[t]);
2032
+ let n = In(e[t]);
1992
2033
  if (n !== void 0) return n;
1993
2034
  }
1994
- }, Mn = (e, t) => {
2035
+ }, Rn = (e, t) => {
1995
2036
  if (e == null) return;
1996
2037
  let n = t.find((t) => String(t.dataKey) === e);
1997
2038
  return typeof n?.label == "string" ? n.label : void 0;
1998
- }, Nn = /* @__PURE__ */ new Set([
2039
+ }, zn = /* @__PURE__ */ new Set([
1999
2040
  "bar",
2000
2041
  "horizontal-bar",
2001
2042
  "line",
@@ -2005,25 +2046,25 @@ var En, Dn, $, On, kn, An, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, W
2005
2046
  "radar",
2006
2047
  "funnel",
2007
2048
  "combo"
2008
- ]), Pn = 5, Fn = 12, In = Math.ceil(Math.sqrt(400 / Math.PI)), Ln = {
2009
- left: In,
2010
- right: In
2011
- }, Rn = {
2012
- top: In,
2013
- bottom: In
2014
- }, zn = {
2049
+ ]), Bn = 5, Vn = 12, Hn = 35, Un = 10, $ = { fill: "hsl(var(--muted-foreground))" }, Wn = 12, Gn = .65, Kn = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\u3000-\u303f\uff00-\uffef]/u, qn = 10, Jn = 48, Yn = 8, Xn = Math.ceil(Math.sqrt(400 / Math.PI)), Zn = {
2050
+ left: Xn,
2051
+ right: Xn
2052
+ }, Qn = {
2053
+ top: Xn,
2054
+ bottom: Xn
2055
+ }, $n = {
2015
2056
  angle: -90,
2016
2057
  position: "insideLeft"
2017
- }, Bn = {
2058
+ }, er = {
2018
2059
  position: "insideBottom",
2019
2060
  offset: -4
2020
- }, Vn = {
2061
+ }, tr = {
2021
2062
  position: "insideTop",
2022
2063
  offset: -4
2023
- }, Hn = {
2064
+ }, nr = {
2024
2065
  angle: 90,
2025
2066
  position: "insideRight"
2026
- }, Un = {}, Wn = { yAxisId: "left" }, Gn = { xAxisId: "left" }, Kn = /* @__PURE__ */ new Set([
2067
+ }, rr = {}, ir = { yAxisId: "left" }, ar = { xAxisId: "left" }, or = /* @__PURE__ */ new Set([
2027
2068
  "bar",
2028
2069
  "horizontal-bar",
2029
2070
  "line",
@@ -2033,10 +2074,10 @@ var En, Dn, $, On, kn, An, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, W
2033
2074
  }));
2034
2075
  //#endregion
2035
2076
  //#region src/ChartRenderer.tsx
2036
- bt();
2037
- var Jn = v.lazy(() => Promise.resolve().then(() => (Tt(), xt))), Yn = v.lazy(() => Promise.resolve().then(() => (qn(), Ht))), Xn = ({ schema: e }) => /* @__PURE__ */ E(y, {
2038
- fallback: /* @__PURE__ */ E(we, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }),
2039
- children: /* @__PURE__ */ E(Jn, {
2077
+ wt();
2078
+ var cr = y.lazy(() => Promise.resolve().then(() => (Ot(), J))), lr = y.lazy(() => Promise.resolve().then(() => (sr(), Gt))), ur = ({ schema: e }) => /* @__PURE__ */ E(b, {
2079
+ fallback: /* @__PURE__ */ E(Te, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }),
2080
+ children: /* @__PURE__ */ E(cr, {
2040
2081
  data: e.data,
2041
2082
  dataKey: e.dataKey,
2042
2083
  xAxisKey: e.xAxisKey,
@@ -2044,9 +2085,9 @@ var Jn = v.lazy(() => Promise.resolve().then(() => (Tt(), xt))), Yn = v.lazy(()
2044
2085
  className: e.className,
2045
2086
  color: e.color
2046
2087
  })
2047
- }), Zn = ({ schema: e, onChartClick: t }) => {
2048
- let { language: n } = Oe(), r = v.useMemo(() => {
2049
- let t = ut(e, n), r = Array.isArray(e.series) ? e.series : void 0, i = t.series ?? r, a = e.xAxisKey ?? t.xAxisKey, o = e.config;
2088
+ }), dr = ({ schema: e, onChartClick: t }) => {
2089
+ let { language: n } = ke(), r = y.useMemo(() => {
2090
+ let t = U(e, n), r = Array.isArray(e.series) ? e.series : void 0, i = t.series ?? r, a = e.xAxisKey ?? t.xAxisKey, o = e.config;
2050
2091
  if (!o && i) {
2051
2092
  let t = e.colors || [
2052
2093
  "hsl(var(--chart-1))",
@@ -2070,9 +2111,9 @@ var Jn = v.lazy(() => Promise.resolve().then(() => (Tt(), xt))), Yn = v.lazy(()
2070
2111
  spec: t
2071
2112
  };
2072
2113
  }, [e, n]);
2073
- return /* @__PURE__ */ E(y, {
2074
- fallback: /* @__PURE__ */ E(we, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }),
2075
- children: /* @__PURE__ */ E(Yn, {
2114
+ return /* @__PURE__ */ E(b, {
2115
+ fallback: /* @__PURE__ */ E(Te, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }),
2116
+ children: /* @__PURE__ */ E(lr, {
2076
2117
  chartType: r.chartType,
2077
2118
  data: r.data,
2078
2119
  config: r.config,
@@ -2099,30 +2140,30 @@ var Jn = v.lazy(() => Promise.resolve().then(() => (Tt(), xt))), Yn = v.lazy(()
2099
2140
  };
2100
2141
  //#endregion
2101
2142
  //#region src/ObjectChart.tsx
2102
- bt();
2103
- function Qn(e) {
2143
+ wt();
2144
+ function fr(e) {
2104
2145
  return a(e, e.function || "count");
2105
2146
  }
2106
- var $n = [
2147
+ var pr = [
2107
2148
  "aggregate.groupBy",
2108
2149
  "xAxisKey",
2109
2150
  "xAxis.field"
2110
2151
  ];
2111
- function er(e) {
2152
+ function mr(e) {
2112
2153
  let t = e?.aggregate?.groupBy;
2113
2154
  if (t && typeof t == "object" && !Array.isArray(t)) {
2114
2155
  let e = t.field;
2115
2156
  return typeof e == "string" && e ? e : void 0;
2116
2157
  }
2117
- return typeof t == "string" && t ? t : ut(e).xAxisKey;
2158
+ return typeof t == "string" && t ? t : U(e).xAxisKey;
2118
2159
  }
2119
- var tr = "__comparison";
2120
- function nr(e) {
2160
+ var hr = "__comparison";
2161
+ function gr(e) {
2121
2162
  let t = e?.groupBy;
2122
2163
  return t && typeof t == "object" && !Array.isArray(t) ? t.alias || t.field : typeof t == "string" ? t : void 0;
2123
2164
  }
2124
- function rr(e, t) {
2125
- let { field: n, function: r, groupBy: i } = t, a = Qn(t), o = {};
2165
+ function _r(e, t) {
2166
+ let { field: n, function: r, groupBy: i } = t, a = fr(t), o = {};
2126
2167
  for (let t of e) {
2127
2168
  let e = String(t[i] ?? "Unknown");
2128
2169
  o[e] || (o[e] = []), o[e].push(t);
@@ -2150,7 +2191,7 @@ function rr(e, t) {
2150
2191
  };
2151
2192
  });
2152
2193
  }
2153
- async function ir(e, t, n, r, i) {
2194
+ async function vr(e, t, n, r, i) {
2154
2195
  if (!e.length || !t) return e;
2155
2196
  let a = i || ((e, t) => t), o = `__raw_${t}`, s = n?.fields?.[t];
2156
2197
  if (!s) {
@@ -2236,8 +2277,8 @@ async function ir(e, t, n, r, i) {
2236
2277
  };
2237
2278
  });
2238
2279
  }
2239
- var ar = (e) => {
2240
- let { schema: n } = e, a = e.onSegmentClick, o = x(rt), p = e.dataSource || o?.dataSource, h = o?.apiFetch, te = I(n.bind), { fieldOptionLabel: ue } = ke(), [de, _] = w([]), [y, we] = w(null), [De, T] = w(void 0), [je, Me] = w(() => !(Array.isArray(n.data) && n.data.length > 0) && (!!n.objectName || !!n.dataset)), [Ne, Pe] = w(null), [Fe, O] = w(null), [Ie, Le] = w(null), { openRecordList: Re } = L(), k = Ae(), { t: ze, language: Be } = Oe(), Ve = C(() => ut(n, Be).chartType, [n, Be]), He = C(() => n.aggregate ? JSON.stringify(n.aggregate) : "", [n.aggregate]), Ue = C(() => n.filter ? JSON.stringify(n.filter) : "", [n.filter]), We = C(() => n.compareTo ? JSON.stringify(n.compareTo) : "", [n.compareTo]), Ge = C(() => n.dataset ? JSON.stringify({
2280
+ var yr = (e) => {
2281
+ let { schema: n } = e, a = e.onSegmentClick, o = S(at), p = e.dataSource || o?.dataSource, h = o?.apiFetch, te = st(n.bind), { fieldOptionLabel: ne } = Ae(), [ue, de] = w([]), [v, b] = w(null), [Te, Oe] = w(void 0), [T, Me] = w(() => !(Array.isArray(n.data) && n.data.length > 0) && (!!n.objectName || !!n.dataset)), [Ne, Pe] = w(null), [O, Fe] = w(null), [Ie, Le] = w(null), { openRecordList: Re } = ct(), k = je(), { t: ze, language: Be } = ke(), Ve = C(() => U(n, Be).chartType, [n, Be]), He = C(() => n.aggregate ? JSON.stringify(n.aggregate) : "", [n.aggregate]), Ue = C(() => n.filter ? JSON.stringify(n.filter) : "", [n.filter]), We = C(() => n.compareTo ? JSON.stringify(n.compareTo) : "", [n.compareTo]), Ge = C(() => n.dataset ? JSON.stringify({
2241
2282
  d: n.dataset,
2242
2283
  dim: n.dimensions ?? [],
2243
2284
  val: n.values ?? []
@@ -2246,7 +2287,7 @@ var ar = (e) => {
2246
2287
  n.dimensions,
2247
2288
  n.values
2248
2289
  ]);
2249
- S(() => {
2290
+ fe(() => {
2250
2291
  let e = !1;
2251
2292
  return (async () => {
2252
2293
  try {
@@ -2254,7 +2295,7 @@ var ar = (e) => {
2254
2295
  headers: { accept: "application/json" },
2255
2296
  credentials: "include"
2256
2297
  }, i = n.objectName, a, o = null;
2257
- if (i) a = er(n);
2298
+ if (i) a = mr(n);
2258
2299
  else if (n.dataset) {
2259
2300
  let e = Array.isArray(n.dimensions) && n.dimensions.length ? n.dimensions[0] : void 0, s = await (await t(`/api/v1/meta/dataset/${encodeURIComponent(n.dataset)}`, r)).json().catch(() => null);
2260
2301
  o = s?.item ?? s?.data ?? s, i = o?.object, a = ((o?.dimensions || []).find((t) => t?.name === e) ?? (o?.dimensions || [])[0])?.field ?? e;
@@ -2263,12 +2304,12 @@ var ar = (e) => {
2263
2304
  e || Le(null);
2264
2305
  return;
2265
2306
  }
2266
- let s = async (e) => {
2307
+ let s = typeof p?.getObjectSchema == "function" ? (e) => p.getObjectSchema(e) : async (e) => {
2267
2308
  let n = await (await t(`/api/v1/meta/object/${encodeURIComponent(e)}`, r)).json().catch(() => null);
2268
2309
  return n?.item ?? n?.data ?? n;
2269
2310
  }, c = {};
2270
2311
  if (n.dataset && Array.isArray(n.dimensions)) for (let e of n.dimensions) c[e] = (o?.dimensions || []).find((t) => t?.name === e)?.field ?? e;
2271
- let l = await re(s, i, [a, ...Object.values(c)]);
2312
+ let l = await ie(s, i, [a, ...Object.values(c)]);
2272
2313
  e || Le({
2273
2314
  metaByPath: l,
2274
2315
  colorPath: a,
@@ -2286,26 +2327,27 @@ var ar = (e) => {
2286
2327
  Ge,
2287
2328
  He,
2288
2329
  n.xAxisKey,
2289
- h
2330
+ h,
2331
+ p
2290
2332
  ]);
2291
2333
  let { fieldOptionColors: Ke, dimensionLabels: qe } = C(() => {
2292
2334
  if (!Ie) return {
2293
2335
  fieldOptionColors: null,
2294
2336
  dimensionLabels: null
2295
2337
  };
2296
- let { metaByPath: e, colorPath: t, fieldByDim: n } = Ie, r = ie(e[t]?.options, f(e[t], ue)), a = d(e, n ? Object.entries(n).map(([e, t]) => ({
2338
+ let { metaByPath: e, colorPath: t, fieldByDim: n } = Ie, r = ae(e[t]?.options, f(e[t], ne)), a = d(e, n ? Object.entries(n).map(([e, t]) => ({
2297
2339
  dim: e,
2298
2340
  path: t
2299
- })) : null, ue);
2341
+ })) : null, ne);
2300
2342
  return {
2301
2343
  fieldOptionColors: i(r),
2302
2344
  dimensionLabels: a
2303
2345
  };
2304
- }, [Ie, ue]), Je = b(async (e, t) => {
2346
+ }, [Ie, ne]), Je = x(async (e, t) => {
2305
2347
  if (n.aggregate && typeof e.aggregate == "function") {
2306
2348
  let r = n.aggregate.groupBy;
2307
- if (ne(r)) {
2308
- let i = await e.aggregate(n.objectName, ae(n.aggregate, r, t));
2349
+ if (re(r)) {
2350
+ let i = await e.aggregate(n.objectName, oe(n.aggregate, r, t));
2309
2351
  return Array.isArray(i) ? i : [];
2310
2352
  }
2311
2353
  let i = await e.aggregate(n.objectName, {
@@ -2317,14 +2359,14 @@ var ar = (e) => {
2317
2359
  return Array.isArray(i) ? i : [];
2318
2360
  }
2319
2361
  if (typeof e.find == "function") {
2320
- let r = await e.find(n.objectName, { $filter: t }), i = m(r), a = nr(n.aggregate);
2321
- return n.aggregate && a && i.length > 0 && (i = rr(i, {
2362
+ let r = await e.find(n.objectName, { $filter: t }), i = m(r), a = gr(n.aggregate);
2363
+ return n.aggregate && a && i.length > 0 && (i = _r(i, {
2322
2364
  ...n.aggregate,
2323
2365
  groupBy: a
2324
2366
  })), i;
2325
2367
  }
2326
2368
  return [];
2327
- }, [n.objectName, He]), Ye = R(), Xe = b(async (e, t) => {
2369
+ }, [n.objectName, He]), Ye = P(), Xe = x(async (e, t) => {
2328
2370
  if (!e || !n.objectName && !n.dataset) {
2329
2371
  t.current && Me(!1);
2330
2372
  return;
@@ -2332,17 +2374,17 @@ var ar = (e) => {
2332
2374
  t.current && (Me(!0), Pe(null));
2333
2375
  try {
2334
2376
  if (n.dataset && typeof e.queryDataset == "function") {
2335
- let r = g(n.filter, Ye), i = await e.queryDataset(n.dataset, {
2377
+ let r = le(n.filter, Ye), i = await e.queryDataset(n.dataset, {
2336
2378
  dimensions: Array.isArray(n.dimensions) ? n.dimensions : [],
2337
2379
  measures: Array.isArray(n.values) ? n.values : [],
2338
2380
  ...r ? { runtimeFilter: r } : {}
2339
2381
  });
2340
- t.current && (_(Array.isArray(i?.rows) ? i.rows : []), we(Array.isArray(i?.fields) ? i.fields : null), T(typeof i?.object == "string" && i.object ? i.object : void 0));
2382
+ t.current && (de(Array.isArray(i?.rows) ? i.rows : []), b(Array.isArray(i?.fields) ? i.fields : null), Oe(typeof i?.object == "string" && i.object ? i.object : void 0));
2341
2383
  return;
2342
2384
  }
2343
- let r = g(n.filter, Ye), i = n.compareTo, a = !!i && !s(Ve), o = a ? se(le(n.filter, i), Ye) : null, [c, l] = await Promise.all([Je(e, r), o ? Je(e, o) : Promise.resolve([])]), u = c, d = nr(n.aggregate) || n.xAxisKey;
2385
+ let r = le(n.filter, Ye), i = n.compareTo, a = !!i && !s(Ve), o = a ? ce(_(n.filter, i), Ye) : null, [c, l] = await Promise.all([Je(e, r), o ? Je(e, o) : Promise.resolve([])]), u = c, d = gr(n.aggregate) || n.xAxisKey;
2344
2386
  if (a && l.length > 0 && n.aggregate) {
2345
- let e = n.aggregate.field, t = n.aggregate.function, r = Qn(n.aggregate), i = (n) => {
2387
+ let e = n.aggregate.field, t = n.aggregate.function, r = fr(n.aggregate), i = (n) => {
2346
2388
  if (n == null) return null;
2347
2389
  if (e) {
2348
2390
  let r = `${e}_${t}`;
@@ -2350,7 +2392,7 @@ var ar = (e) => {
2350
2392
  if (t === "count" && `${e}_count` in n) return Number(n[`${e}_count`]);
2351
2393
  }
2352
2394
  return r in n ? Number(n[r]) : "value" in n ? Number(n.value) : "count" in n ? Number(n.count) : null;
2353
- }, a = `${r}${tr}`, o = d;
2395
+ }, a = `${r}${hr}`, o = d;
2354
2396
  if (o && u.some((e) => e[o] != null) && l.some((e) => e[o] != null)) {
2355
2397
  let e = /* @__PURE__ */ new Map();
2356
2398
  for (let t of l) {
@@ -2388,10 +2430,10 @@ var ar = (e) => {
2388
2430
  let t = n.objectName;
2389
2431
  try {
2390
2432
  let n = await e.getObjectSchema(t);
2391
- u = await ir(u, d, n, e, (e, n) => ue(t, d, e, n));
2433
+ u = await vr(u, d, n, e, (e, n) => ne(t, d, e, n));
2392
2434
  } catch {}
2393
2435
  }
2394
- t.current && _(u);
2436
+ t.current && de(u);
2395
2437
  } catch (e) {
2396
2438
  console.error("[ObjectChart] Fetch error:", e), t.current && Pe(e instanceof Error ? e.message : "Failed to load chart data");
2397
2439
  } finally {
@@ -2407,11 +2449,11 @@ var ar = (e) => {
2407
2449
  Ve,
2408
2450
  Je,
2409
2451
  Ye,
2410
- ue
2411
- ]), Ze = !!(n.objectName || n.dataset) && !te && !n.data, Qe = F(Ze ? n.dataset ? De : n.objectName : void 0);
2412
- S(() => {
2452
+ ne
2453
+ ]), Ze = !!te || Array.isArray(n.data), Qe = !!n.objectName && !n.dataset && !Ze, $e = Qe && !mr(n), et = !!(n.objectName || n.dataset) && !te && !n.data && !$e, tt = ot(et ? n.dataset ? Te : n.objectName : void 0);
2454
+ fe(() => {
2413
2455
  let e = { current: !0 };
2414
- return Ze ? Xe(p, e) : e.current && Me(!1), () => {
2456
+ return et ? Xe(p, e) : e.current && Me(!1), () => {
2415
2457
  e.current = !1;
2416
2458
  };
2417
2459
  }, [
@@ -2424,9 +2466,10 @@ var ar = (e) => {
2424
2466
  He,
2425
2467
  We,
2426
2468
  Xe,
2427
- Qe
2469
+ tt,
2470
+ et
2428
2471
  ]);
2429
- let $e = te || n.data || de, A = Array.isArray($e) ? $e : [], j = n.drillDown, M = nr(n.aggregate) || n.xAxisKey, et = C(() => {
2472
+ let nt = te || n.data || ue, A = Array.isArray(nt) ? nt : [], j = n.drillDown, M = gr(n.aggregate) || n.xAxisKey, N = C(() => {
2430
2473
  if (!M) return /* @__PURE__ */ new Map();
2431
2474
  let e = /* @__PURE__ */ new Map(), t = `__raw_${M}`;
2432
2475
  for (let n of A) {
@@ -2436,11 +2479,11 @@ var ar = (e) => {
2436
2479
  e.set(String(r), i);
2437
2480
  }
2438
2481
  return e;
2439
- }, [A, M]), N = C(() => {
2440
- if (Fe) try {
2482
+ }, [A, M]), rt = C(() => {
2483
+ if (O) try {
2441
2484
  return {
2442
2485
  ok: !0,
2443
- filter: l(n.filter, u(j, Fe, { groupByField: M }))
2486
+ filter: l(n.filter, u(j, O, { groupByField: M }))
2444
2487
  };
2445
2488
  } catch (e) {
2446
2489
  if (!(e instanceof t)) throw e;
@@ -2450,79 +2493,79 @@ var ar = (e) => {
2450
2493
  };
2451
2494
  }
2452
2495
  }, [
2453
- Fe,
2496
+ O,
2454
2497
  j,
2455
2498
  M,
2456
2499
  Ue
2457
- ]), P = N?.ok ? N.filter : void 0, tt = N?.ok === !1, B = N?.ok === !1 ? N.refusal.message : void 0;
2458
- S(() => {
2500
+ ]), R = rt?.ok ? rt.filter : void 0, z = rt?.ok === !1, B = rt?.ok === !1 ? rt.refusal.message : void 0;
2501
+ fe(() => {
2459
2502
  B && console.warn(`[ObjectChart] drill-down refused — the drilled list cannot be scoped: ${B}`);
2460
2503
  }, [B]);
2461
- let V = !a && !!Fe && !tt && !!n.objectName && j?.target === "navigate" && !!Re;
2462
- S(() => {
2463
- V && (Re(n.objectName, P), O(null));
2464
- }, [V]);
2465
- let ot = n.compareTo, H = n.aggregate ? Qn(n.aggregate) : void 0, U = H ? `${H}${tr}` : void 0, st = !!ot && !s(Ve) && !!U && A.some((e) => e[U] != null), ct = C(() => {
2504
+ let lt = !a && !!O && !z && !!n.objectName && j?.target === "navigate" && !!Re;
2505
+ fe(() => {
2506
+ lt && (Re(n.objectName, R), Fe(null));
2507
+ }, [lt]);
2508
+ let ut = n.compareTo, V = n.aggregate ? fr(n.aggregate) : void 0, H = V ? `${V}${hr}` : void 0, dt = !!ut && !s(Ve) && !!H && A.some((e) => e[H] != null), ft = C(() => {
2466
2509
  let e = Array.isArray(n.series) ? n.series : null;
2467
- if (!st) return e;
2468
- let t = e || [{ dataKey: H }], r = {
2510
+ if (!dt) return e;
2511
+ let t = e || [{ dataKey: V }], r = {
2469
2512
  vsLastWeek: "Previous week",
2470
2513
  vsLastMonth: "Previous month",
2471
2514
  vsLastQuarter: "Previous quarter",
2472
2515
  vsLastYear: "Previous year",
2473
2516
  vsYesterday: "Yesterday",
2474
2517
  vsPreviousPeriod: "Previous period"
2475
- }[c(ot, n.filter)] || "Previous period";
2518
+ }[c(ut, n.filter)] || "Previous period";
2476
2519
  return [...t.map((e) => ({
2477
2520
  ...e,
2478
2521
  variant: e.variant || "current"
2479
2522
  })), {
2480
- dataKey: U,
2523
+ dataKey: H,
2481
2524
  label: r,
2482
2525
  variant: "comparison"
2483
2526
  }];
2484
2527
  }, [
2485
- st,
2528
+ dt,
2486
2529
  n.series,
2530
+ V,
2487
2531
  H,
2488
- U,
2489
2532
  n.filter,
2490
- ot
2491
- ]), lt = n.dataset ? r(oe(A, qe), n.dimensions, n.values, y, {
2533
+ ut
2534
+ ]), pt = n.dataset ? r(se(A, qe), n.dimensions, n.values, v, {
2492
2535
  nullCategoryLabel: k("chart.nullCategory", "(None)"),
2493
- builtinAggregateLabels: Te(k)
2494
- }) : null, dt = !!te || Array.isArray(n.data), ft = !!n.objectName && !n.dataset && !dt, W = ft && !ut(n, Be).xAxisKey ? nr(n.aggregate) : void 0, pt = lt ? {
2536
+ builtinAggregateLabels: Ee(k)
2537
+ }) : null, mt = Qe && !U(n, Be).xAxisKey ? gr(n.aggregate) : void 0, W = pt ? {
2495
2538
  ...n,
2496
- data: lt.data,
2497
- xAxisKey: lt.xAxisKey,
2498
- series: lt.series
2539
+ data: pt.data,
2540
+ xAxisKey: pt.xAxisKey,
2541
+ series: pt.series
2499
2542
  } : {
2500
2543
  ...n,
2501
2544
  data: A,
2502
- ...W ? { xAxisKey: W } : {},
2503
- ...ct ? { series: ct } : {}
2504
- }, G = n.colors && !Array.isArray(n.colors) && typeof n.colors == "object" ? n.colors : null, mt = Array.isArray(n.colors) ? n.colors : void 0, ht = Ke || G ? {
2545
+ ...mt ? { xAxisKey: mt } : {},
2546
+ ...ft ? { series: ft } : {}
2547
+ }, ht = n.colors && !Array.isArray(n.colors) && typeof n.colors == "object" ? n.colors : null, gt = Array.isArray(n.colors) ? n.colors : void 0, _t = Ke || ht ? {
2505
2548
  ...Ke || {},
2506
- ...G || {}
2507
- } : void 0, gt = {
2508
- ...pt,
2509
- colors: mt,
2510
- ...ht ? { categoryColors: ht } : {}
2549
+ ...ht || {}
2550
+ } : void 0, vt = {
2551
+ ...W,
2552
+ colors: gt,
2553
+ ..._t ? { categoryColors: _t } : {}
2511
2554
  };
2512
- if (ft && !er(n)) return /* @__PURE__ */ D("div", {
2555
+ if ($e) return /* @__PURE__ */ D("div", {
2513
2556
  className: "p-4 text-destructive " + (n.className || ""),
2514
2557
  "data-testid": "chart-missing-category-axis",
2515
2558
  role: "alert",
2516
2559
  children: [
2517
2560
  k("chart.unconfigured.noCategoryAxis", "Chart category axis required — an object-bound chart will not invent one. Declare one of:"),
2518
2561
  " ",
2519
- $n.map((e, t) => /* @__PURE__ */ D(v.Fragment, { children: [t > 0 ? ", " : "", /* @__PURE__ */ E("code", {
2562
+ pr.map((e, t) => /* @__PURE__ */ D(y.Fragment, { children: [t > 0 ? ", " : "", /* @__PURE__ */ E("code", {
2520
2563
  className: "font-mono",
2521
2564
  children: e
2522
2565
  })] }, e))
2523
2566
  ]
2524
2567
  });
2525
- if (je && A.length === 0) return /* @__PURE__ */ D("div", {
2568
+ if (T && A.length === 0) return /* @__PURE__ */ D("div", {
2526
2569
  className: "p-2 " + (n.className || ""),
2527
2570
  "data-testid": "chart-loading",
2528
2571
  role: "status",
@@ -2531,14 +2574,14 @@ var ar = (e) => {
2531
2574
  children: [/* @__PURE__ */ E("span", {
2532
2575
  className: "sr-only",
2533
2576
  children: "Loading chart data…"
2534
- }), /* @__PURE__ */ E(pe, { className: "h-full" })]
2577
+ }), /* @__PURE__ */ E(me, { className: "h-full" })]
2535
2578
  });
2536
2579
  if (Ne) return /* @__PURE__ */ D("div", {
2537
2580
  className: "flex flex-col items-center justify-center gap-2 p-4 " + (n.className || ""),
2538
2581
  "data-testid": "chart-error",
2539
2582
  role: "alert",
2540
2583
  children: [
2541
- /* @__PURE__ */ E(z, { className: "h-6 w-6 text-destructive opacity-60" }),
2584
+ /* @__PURE__ */ E(F, { className: "h-6 w-6 text-destructive opacity-60" }),
2542
2585
  /* @__PURE__ */ E("p", {
2543
2586
  className: "text-xs text-destructive font-medium",
2544
2587
  children: "Failed to load chart data"
@@ -2558,11 +2601,11 @@ var ar = (e) => {
2558
2601
  "”"
2559
2602
  ]
2560
2603
  });
2561
- if ((n.objectName || n.dataset) && !te && !n.data && A.length === 0) return /* @__PURE__ */ E(me, {
2604
+ if ((n.objectName || n.dataset) && !te && !n.data && A.length === 0) return /* @__PURE__ */ E(he, {
2562
2605
  role: "status",
2563
2606
  "data-testid": "chart-empty-state",
2564
2607
  className: "h-full w-full gap-2 p-4 [&>h3]:text-sm [&>h3]:font-medium [&>p]:text-xs " + (n.className || ""),
2565
- icon: /* @__PURE__ */ E(at, { className: "h-5 w-5 text-muted-foreground/70" }),
2608
+ icon: /* @__PURE__ */ E(L, { className: "h-5 w-5 text-muted-foreground/70" }),
2566
2609
  iconWrapperClassName: "flex size-9 items-center justify-center rounded-lg bg-muted",
2567
2610
  title: k("dashboard.empty.title", "No data yet"),
2568
2611
  description: k("dashboard.empty.message", "This widget loaded successfully and its query returned no records yet."),
@@ -2579,16 +2622,16 @@ var ar = (e) => {
2579
2622
  ]
2580
2623
  })
2581
2624
  });
2582
- let _t = ee(j) ? (e) => {
2583
- let t = e.category, n = t != null && et.has(String(t)) ? et.get(String(t)) : t;
2584
- O({
2625
+ let yt = ee(j) ? (e) => {
2626
+ let t = e.category, n = t != null && N.has(String(t)) ? N.get(String(t)) : t;
2627
+ Fe({
2585
2628
  ...e,
2586
2629
  category: n,
2587
2630
  categoryLabel: t,
2588
2631
  scope: "cell"
2589
2632
  });
2590
- } : void 0, vt = a ?? _t, K = !a && Fe && !tt && n.objectName && !V ? (() => {
2591
- let e = P ?? {}, t = ce(j, Fe, Ee(n.title, Be) || "Details"), r = j?.target ?? "drawer", i = {
2633
+ } : void 0, bt = a ?? yt, xt = !a && O && !z && n.objectName && !lt ? (() => {
2634
+ let e = R ?? {}, t = g(j, O, De(n.title, Be) || "Details"), r = j?.target ?? "drawer", i = {
2592
2635
  type: "object-data-table",
2593
2636
  objectName: n.objectName,
2594
2637
  filter: e,
@@ -2606,39 +2649,39 @@ var ar = (e) => {
2606
2649
  }, a = /* @__PURE__ */ E("div", {
2607
2650
  className: "overflow-auto",
2608
2651
  "data-testid": "chart-drill-body",
2609
- children: /* @__PURE__ */ E(nt, {
2652
+ children: /* @__PURE__ */ E(it, {
2610
2653
  schema: i,
2611
2654
  dataSource: p
2612
2655
  })
2613
- }), o = Re && n.objectName ? /* @__PURE__ */ D(fe, {
2656
+ }), o = Re && n.objectName ? /* @__PURE__ */ D(pe, {
2614
2657
  type: "button",
2615
2658
  variant: "ghost",
2616
2659
  size: "sm",
2617
2660
  "data-testid": "drill-open-in-list",
2618
2661
  onClick: () => {
2619
- Re(n.objectName, e), O(null);
2662
+ Re(n.objectName, e), Fe(null);
2620
2663
  },
2621
- children: [k("dashboard.openInList", "Open in list"), /* @__PURE__ */ E(it, { className: "ml-1 h-3.5 w-3.5" })]
2664
+ children: [k("dashboard.openInList", "Open in list"), /* @__PURE__ */ E(I, { className: "ml-1 h-3.5 w-3.5" })]
2622
2665
  }) : null;
2623
- return r === "dialog" ? /* @__PURE__ */ E(he, {
2666
+ return r === "dialog" ? /* @__PURE__ */ E(ge, {
2624
2667
  open: !0,
2625
- onOpenChange: (e) => !e && O(null),
2626
- children: /* @__PURE__ */ D(ge, {
2668
+ onOpenChange: (e) => !e && Fe(null),
2669
+ children: /* @__PURE__ */ D(_e, {
2627
2670
  className: "max-w-4xl",
2628
- children: [/* @__PURE__ */ D(_e, {
2671
+ children: [/* @__PURE__ */ D(ve, {
2629
2672
  className: "flex-row items-center justify-between gap-4 pr-8",
2630
- children: [/* @__PURE__ */ E(ve, { children: t }), o]
2673
+ children: [/* @__PURE__ */ E(ye, { children: t }), o]
2631
2674
  }), a]
2632
2675
  })
2633
- }) : /* @__PURE__ */ E(be, {
2676
+ }) : /* @__PURE__ */ E(xe, {
2634
2677
  open: !0,
2635
- onOpenChange: (e) => !e && O(null),
2636
- children: /* @__PURE__ */ D(xe, {
2678
+ onOpenChange: (e) => !e && Fe(null),
2679
+ children: /* @__PURE__ */ D(Se, {
2637
2680
  side: "right",
2638
2681
  className: "w-full sm:max-w-2xl md:max-w-3xl lg:max-w-4xl flex flex-col",
2639
- children: [/* @__PURE__ */ D(Se, {
2682
+ children: [/* @__PURE__ */ D(Ce, {
2640
2683
  className: "flex-row items-center justify-between gap-4 pr-8",
2641
- children: [/* @__PURE__ */ E(Ce, { children: t }), o]
2684
+ children: [/* @__PURE__ */ E(we, { children: t }), o]
2642
2685
  }), /* @__PURE__ */ E("div", {
2643
2686
  className: "flex-1 overflow-hidden mt-2",
2644
2687
  children: a
@@ -2649,32 +2692,36 @@ var ar = (e) => {
2649
2692
  return /* @__PURE__ */ D("div", {
2650
2693
  className: "relative h-full",
2651
2694
  children: [
2652
- /* @__PURE__ */ E(ye, {
2653
- active: je && A.length > 0,
2695
+ /* @__PURE__ */ E(be, {
2696
+ active: T && A.length > 0,
2654
2697
  ariaLabel: ze("chart.refreshing")
2655
2698
  }),
2656
- /* @__PURE__ */ E(Zn, {
2699
+ /* @__PURE__ */ E(dr, {
2657
2700
  ...e,
2658
- schema: gt,
2659
- onChartClick: vt
2701
+ schema: vt,
2702
+ onChartClick: bt
2660
2703
  }),
2661
- K
2704
+ xt
2662
2705
  ]
2663
2706
  });
2664
- }, or = { filter: !0 }, sr = p((e) => /* @__PURE__ */ E(tt, {
2665
- schema: e.schema,
2666
- mapping: or,
2667
- dataSource: e.dataSource,
2668
- testId: "object-chart",
2669
- errorTitle: "This chart’s data source could not be resolved",
2670
- children: (t) => /* @__PURE__ */ E(ar, {
2671
- ...e,
2672
- schema: t
2673
- })
2674
- }));
2707
+ }, br = { filter: !0 }, xr = (e) => e.data == null && e.bind == null && Reflect.get(e, "dataset") == null, Sr = p((e) => {
2708
+ let { t } = ke();
2709
+ return /* @__PURE__ */ E(rt, {
2710
+ schema: e.schema,
2711
+ mapping: br,
2712
+ dataSource: e.dataSource,
2713
+ testId: "object-chart",
2714
+ errorTitle: t("element.chart.sourceUnresolved", { defaultValue: "This chart’s data source could not be resolved" }),
2715
+ requiresObject: xr(e.schema),
2716
+ children: (t) => /* @__PURE__ */ E(yr, {
2717
+ ...e,
2718
+ schema: t
2719
+ })
2720
+ });
2721
+ });
2675
2722
  //#endregion
2676
2723
  //#region src/index.tsx
2677
- e.register("object-chart", sr, {
2724
+ e.register("object-chart", Sr, {
2678
2725
  namespace: "plugin-charts",
2679
2726
  label: "Object Chart",
2680
2727
  category: "view",
@@ -2682,7 +2729,7 @@ e.register("object-chart", sr, {
2682
2729
  {
2683
2730
  name: "objectName",
2684
2731
  type: "string",
2685
- required: !0
2732
+ description: "Object this chart aggregates. Not required: the node's `dataSource` binding can name the object instead, and `dataSource.object` lands on this key, outranking an authored value. With neither, and no inline `data`, the chart shows a hint naming this key instead of an empty frame."
2686
2733
  },
2687
2734
  {
2688
2735
  name: "data",
@@ -2704,12 +2751,12 @@ e.register("object-chart", sr, {
2704
2751
  description: "Segment drill config: { enabled?, filter?, title?, target?: 'drawer' | 'dialog', columns?, maxRows? }. Present = on; {} is enough. Clicking a segment opens the underlying records filtered by the clicked category."
2705
2752
  }
2706
2753
  ]
2707
- }), bt();
2708
- var cr = {
2709
- "bar-chart": Xn,
2710
- chart: Zn
2754
+ }), wt();
2755
+ var Cr = {
2756
+ "bar-chart": ur,
2757
+ chart: dr
2711
2758
  };
2712
- e.register("bar-chart", Xn, {
2759
+ e.register("bar-chart", ur, {
2713
2760
  namespace: "plugin-charts",
2714
2761
  label: "Bar Chart",
2715
2762
  category: "plugin",
@@ -2764,7 +2811,7 @@ e.register("bar-chart", Xn, {
2764
2811
  height: 400,
2765
2812
  color: "#8884d8"
2766
2813
  }
2767
- }), e.register("chart", sr, {
2814
+ }), e.register("chart", Sr, {
2768
2815
  namespace: "view",
2769
2816
  category: "view",
2770
2817
  label: "Chart",
@@ -2773,7 +2820,7 @@ e.register("bar-chart", Xn, {
2773
2820
  {
2774
2821
  name: "objectName",
2775
2822
  type: "string",
2776
- required: !0
2823
+ description: "Object this chart aggregates. Not required: the node's `dataSource` binding can name the object instead, and `dataSource.object` lands on this key, outranking an authored value. With neither, and no inline `data`, the chart shows a hint naming this key instead of an empty frame."
2777
2824
  },
2778
2825
  {
2779
2826
  name: "type",
@@ -2788,7 +2835,7 @@ e.register("bar-chart", Xn, {
2788
2835
  type: "string"
2789
2836
  }
2790
2837
  ]
2791
- }), e.register("chart", Zn, {
2838
+ }), e.register("chart", dr, {
2792
2839
  namespace: "plugin-charts",
2793
2840
  label: "Chart",
2794
2841
  category: "plugin",
@@ -2892,10 +2939,10 @@ e.register("bar-chart", Xn, {
2892
2939
  xAxisKey: "name",
2893
2940
  series: [{ dataKey: "sales" }, { dataKey: "revenue" }]
2894
2941
  }
2895
- }), e.register("chart:bar", Zn, {
2942
+ }), e.register("chart:bar", dr, {
2896
2943
  namespace: "plugin-charts",
2897
2944
  label: "Bar Chart (Alias)",
2898
2945
  category: "plugin"
2899
2946
  });
2900
2947
  //#endregion
2901
- export { Xn as ChartBarRenderer, Zn as ChartRenderer, ar as ObjectChart, sr as ObjectChartBlock, cr as chartComponents, ut as normalizeChartSchema };
2948
+ export { ur as ChartBarRenderer, dr as ChartRenderer, yr as ObjectChart, Sr as ObjectChartBlock, Cr as chartComponents, U as normalizeChartSchema };