drizzle-cube 0.1.28 → 0.1.30

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.
@@ -1,34 +1,34 @@
1
- import { jsx as i, jsxs as b } from "react/jsx-runtime";
2
- import { useState as G } from "react";
3
- import { ResponsiveContainer as Ee, Tooltip as ut, BarChart as ft, CartesianGrid as he, XAxis as ye, YAxis as pe, Legend as B, Bar as mt, Cell as ke, LineChart as xt, Line as ht, AreaChart as yt, Area as pt, PieChart as vt, Pie as bt, ScatterChart as gt, Scatter as Re, RadarChart as wt, PolarGrid as Nt, PolarAngleAxis as At, PolarRadiusAxis as St, Radar as Mt, RadialBarChart as kt, RadialBar as $t, Treemap as Lt } from "recharts";
4
- import { u as K } from "./providers-B7MVnAAt.js";
5
- function U({ children: e, height: t = "100%" }) {
1
+ import { jsx as i, jsxs as w, Fragment as $e } from "react/jsx-runtime";
2
+ import { useState as O } from "react";
3
+ import { ResponsiveContainer as _e, Tooltip as yt, ComposedChart as st, CartesianGrid as ye, XAxis as pe, YAxis as ve, Legend as B, Bar as pt, Cell as Le, Line as q, LineChart as vt, Area as gt, PieChart as bt, Pie as wt, ScatterChart as Nt, Scatter as He, RadarChart as At, PolarGrid as St, PolarAngleAxis as kt, PolarRadiusAxis as Mt, Radar as $t, RadialBarChart as Lt, RadialBar as Tt, Treemap as Ft } from "recharts";
4
+ import { u as W } from "./providers-B7MVnAAt.js";
5
+ function G({ children: e, height: t = "100%" }) {
6
6
  try {
7
7
  if (t === "100%")
8
- return /* @__PURE__ */ i("div", { className: "w-full h-full flex-1 flex flex-col relative", style: { minHeight: "250px", overflow: "hidden" }, children: /* @__PURE__ */ i(Ee, { width: "100%", height: "100%", debounce: 50, style: { marginTop: "16px" }, children: e }) });
9
- const n = {
8
+ return /* @__PURE__ */ i("div", { className: "w-full h-full flex-1 flex flex-col relative", style: { minHeight: "250px", overflow: "hidden" }, children: /* @__PURE__ */ i(_e, { width: "100%", height: "100%", debounce: 50, style: { marginTop: "16px" }, children: e }) });
9
+ const r = {
10
10
  height: typeof t == "number" ? `${t}px` : t,
11
11
  width: "100%",
12
12
  minHeight: "200px"
13
13
  };
14
- return /* @__PURE__ */ i("div", { className: "w-full flex flex-col relative", style: { ...n, overflow: "hidden" }, children: /* @__PURE__ */ i(Ee, { width: "100%", height: "100%", debounce: 50, style: { marginTop: "16px" }, children: e }) });
15
- } catch (n) {
16
- return /* @__PURE__ */ b(
14
+ return /* @__PURE__ */ i("div", { className: "w-full flex flex-col relative", style: { ...r, overflow: "hidden" }, children: /* @__PURE__ */ i(_e, { width: "100%", height: "100%", debounce: 50, style: { marginTop: "16px" }, children: e }) });
15
+ } catch (r) {
16
+ return /* @__PURE__ */ w(
17
17
  "div",
18
18
  {
19
19
  className: "flex flex-col items-center justify-center w-full h-full p-4 text-center border-2 border-dashed border-yellow-300 rounded-lg bg-yellow-50",
20
20
  style: { height: t },
21
21
  children: [
22
22
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold text-yellow-600 mb-1", children: "Chart Container Error" }),
23
- /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: n instanceof Error ? n.message : "Failed to create responsive container" })
23
+ /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: r instanceof Error ? r.message : "Failed to create responsive container" })
24
24
  ]
25
25
  }
26
26
  );
27
27
  }
28
28
  }
29
- function q({ formatter: e, labelFormatter: t }) {
29
+ function V({ formatter: e, labelFormatter: t }) {
30
30
  return /* @__PURE__ */ i(
31
- ut,
31
+ yt,
32
32
  {
33
33
  formatter: e,
34
34
  labelFormatter: t,
@@ -44,7 +44,7 @@ function q({ formatter: e, labelFormatter: t }) {
44
44
  }
45
45
  );
46
46
  }
47
- const T = [
47
+ const L = [
48
48
  "#3b82f6",
49
49
  // blue
50
50
  "#10b981",
@@ -61,7 +61,7 @@ const T = [
61
61
  // cyan
62
62
  "#84cc16"
63
63
  // lime
64
- ], se = [
64
+ ], ie = [
65
65
  "#440154",
66
66
  // dark purple
67
67
  "#414487",
@@ -74,25 +74,25 @@ const T = [
74
74
  // green
75
75
  "#fde725"
76
76
  // yellow
77
- ], De = "#10b981", Tt = "#ef4444", ve = {
77
+ ], Oe = "#10b981", jt = "#ef4444", ge = {
78
78
  top: 5,
79
79
  right: 30,
80
80
  left: 20,
81
81
  bottom: 5
82
82
  };
83
- function we(e, t) {
83
+ function Ne(e, t) {
84
84
  return t[e] || e;
85
85
  }
86
86
  function R(e, t) {
87
87
  if (!e) return String(e || "Unknown");
88
- const n = String(e);
89
- if (n.match(/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}/)) {
90
- let r = n;
91
- n.includes(" ") && (r = n.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !r.endsWith("Z") && !r.includes("+") && (r = r + "Z");
92
- const s = new Date(r);
88
+ const r = String(e);
89
+ if (r.match(/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}/)) {
90
+ let n = r;
91
+ r.includes(" ") && (n = r.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !n.endsWith("Z") && !n.includes("+") && (n = n + "Z");
92
+ const s = new Date(n);
93
93
  if (isNaN(s.getTime()))
94
- return n;
95
- const a = s.getUTCFullYear(), l = String(s.getUTCMonth() + 1).padStart(2, "0"), c = String(s.getUTCDate()).padStart(2, "0"), d = s.getUTCHours(), o = s.getUTCMinutes();
94
+ return r;
95
+ const a = s.getUTCFullYear(), l = String(s.getUTCMonth() + 1).padStart(2, "0"), c = String(s.getUTCDate()).padStart(2, "0"), u = s.getUTCHours(), o = s.getUTCMinutes();
96
96
  if (t)
97
97
  switch (t.toLowerCase()) {
98
98
  case "year":
@@ -107,160 +107,202 @@ function R(e, t) {
107
107
  case "day":
108
108
  return `${a}-${l}-${c}`;
109
109
  case "hour":
110
- return `${a}-${l}-${c} ${String(d).padStart(2, "0")}:00`;
110
+ return `${a}-${l}-${c} ${String(u).padStart(2, "0")}:00`;
111
111
  case "minute":
112
- return `${a}-${l}-${c} ${String(d).padStart(2, "0")}:${String(o).padStart(2, "0")}`;
112
+ return `${a}-${l}-${c} ${String(u).padStart(2, "0")}:${String(o).padStart(2, "0")}`;
113
113
  }
114
- const u = s.getUTCSeconds(), f = s.getUTCMilliseconds();
115
- if (c === "01" && d === 0 && o === 0 && u === 0 && f === 0) {
114
+ const d = s.getUTCSeconds(), f = s.getUTCMilliseconds();
115
+ if (c === "01" && u === 0 && o === 0 && d === 0 && f === 0) {
116
116
  if (l === "01" || l === "04" || l === "07" || l === "10") {
117
117
  const m = Math.floor(s.getUTCMonth() / 3) + 1;
118
118
  return `${a}-Q${m}`;
119
119
  }
120
120
  return `${a}-${l}`;
121
121
  }
122
- return d === 0 && o === 0 && u === 0 && f === 0 ? `${a}-${l}-${c}` : o === 0 && u === 0 && f === 0 ? `${a}-${l}-${c} ${String(d).padStart(2, "0")}:00` : `${a}-${l}-${c} ${String(d).padStart(2, "0")}:${String(o).padStart(2, "0")}`;
122
+ return u === 0 && o === 0 && d === 0 && f === 0 ? `${a}-${l}-${c}` : o === 0 && d === 0 && f === 0 ? `${a}-${l}-${c} ${String(u).padStart(2, "0")}:00` : `${a}-${l}-${c} ${String(u).padStart(2, "0")}:${String(o).padStart(2, "0")}`;
123
123
  }
124
- return n;
124
+ return r;
125
125
  }
126
- function O(e, t) {
126
+ function H(e, t) {
127
127
  try {
128
128
  if (e != null && e.timeDimensions) {
129
- const r = e.timeDimensions.find((s) => t === s.dimension || t.startsWith(s.dimension.replace(".", "_")) || t === `${s.dimension}_${s.granularity}`);
130
- if (r != null && r.granularity)
131
- return r.granularity;
129
+ const n = e.timeDimensions.find((s) => t === s.dimension || t.startsWith(s.dimension.replace(".", "_")) || t === `${s.dimension}_${s.granularity}`);
130
+ if (n != null && n.granularity)
131
+ return n.granularity;
132
132
  }
133
- const n = t.match(/_([a-z]+)$/);
134
- if (n) {
135
- const r = n[1];
136
- if (["year", "quarter", "month", "week", "day", "hour", "minute", "second"].includes(r))
137
- return r;
133
+ const r = t.match(/_([a-z]+)$/);
134
+ if (r) {
135
+ const n = r[1];
136
+ if (["year", "quarter", "month", "week", "day", "hour", "minute", "second"].includes(n))
137
+ return n;
138
138
  }
139
139
  return;
140
140
  } catch {
141
141
  return;
142
142
  }
143
143
  }
144
- function Ft(e, t, n, r, s = {}) {
144
+ function zt(e, t, r, n, s = {}) {
145
145
  if (!e || e.length === 0) return [];
146
- const a = O(r, t);
146
+ const a = H(n, t);
147
147
  return e.map((l) => {
148
148
  const c = {
149
149
  name: R(l[t], a) || l[t] || "Unknown"
150
150
  };
151
- return n.forEach((d) => {
152
- const o = we(d, s);
153
- c[o] = typeof l[d] == "string" ? parseFloat(l[d]) : l[d] || 0;
151
+ return r.forEach((u) => {
152
+ const o = Ne(u, s);
153
+ c[o] = typeof l[u] == "string" ? parseFloat(l[u]) : l[u] || 0;
154
154
  }), c;
155
155
  });
156
156
  }
157
- function C(e, t, n, r, s, a = {}) {
158
- var w;
157
+ function ee(e, t, r, n, s, a = {}) {
158
+ var A;
159
159
  if (!e || e.length === 0)
160
160
  return { data: [], seriesKeys: [], hasDimensions: !1 };
161
- const l = r || {}, c = [
161
+ const l = n || {}, c = [
162
162
  ...l.dimensions || [],
163
- ...((w = l.timeDimensions) == null ? void 0 : w.map((x) => x.dimension)) || []
164
- ], d = l.measures || [], o = n.filter((x) => d.includes(x)), u = (s || []).filter((x) => c.includes(x));
165
- if (u.length > 0) {
163
+ ...((A = l.timeDimensions) == null ? void 0 : A.map((x) => x.dimension)) || []
164
+ ], u = l.measures || [], o = r.filter((x) => u.includes(x)), d = (s || []).filter((x) => c.includes(x));
165
+ if (d.length > 0) {
166
166
  const x = {};
167
167
  e.forEach((S) => {
168
- const k = O(r, t), h = R(S[t], k) || S[t] || "Unknown";
169
- x[h] || (x[h] = { name: String(h) }), o.forEach((y) => {
170
- const g = we(y, a);
171
- x[h][g] = (x[h][g] || 0) + (typeof S[y] == "string" ? parseFloat(S[y]) : S[y] || 0);
172
- }), u.forEach((y) => {
173
- const g = S[y];
174
- if (g != null) {
175
- const N = String(g), A = o[0] || d.find(
176
- ($) => $.includes("totalCost") || $.includes("count") || $.includes("sum")
177
- ) || d[0];
178
- if (A) {
179
- const $ = typeof S[A] == "string" ? parseFloat(S[A]) : S[A] || 0;
180
- x[h][N] = (x[h][N] || 0) + $;
168
+ const T = H(n, t), h = R(S[t], T) || S[t] || "Unknown";
169
+ x[h] || (x[h] = { name: String(h) }), o.forEach((b) => {
170
+ const y = Ne(b, a);
171
+ x[h][y] = (x[h][y] || 0) + (typeof S[b] == "string" ? parseFloat(S[b]) : S[b] || 0);
172
+ }), d.forEach((b) => {
173
+ const y = S[b];
174
+ if (y != null) {
175
+ const p = String(y), v = o[0] || u.find(
176
+ (k) => k.includes("totalCost") || k.includes("count") || k.includes("sum")
177
+ ) || u[0];
178
+ if (v) {
179
+ const k = typeof S[v] == "string" ? parseFloat(S[v]) : S[v] || 0;
180
+ x[h][p] = (x[h][p] || 0) + k;
181
181
  }
182
182
  }
183
183
  });
184
184
  });
185
- const v = Object.values(x), p = Array.from(new Set(
185
+ const N = Object.values(x), g = Array.from(new Set(
186
186
  e.flatMap(
187
- (S) => u.map((k) => {
188
- const h = S[k];
187
+ (S) => d.map((T) => {
188
+ const h = S[T];
189
189
  return h != null ? String(h) : null;
190
- }).filter((k) => k !== null)
190
+ }).filter((T) => T !== null)
191
191
  )
192
192
  ));
193
193
  return {
194
- data: v,
195
- seriesKeys: p,
194
+ data: N,
195
+ seriesKeys: g,
196
196
  hasDimensions: !0
197
197
  };
198
198
  }
199
- const f = Ft(e, t, n, r, a), m = n.map((x) => we(x, a));
199
+ const f = zt(e, t, r, n, a), m = r.map((x) => Ne(x, a));
200
200
  return {
201
201
  data: f,
202
202
  seriesKeys: m,
203
203
  hasDimensions: !1
204
204
  };
205
205
  }
206
- function qn({
206
+ function Te(e) {
207
+ if (!e || typeof e != "string")
208
+ return [];
209
+ const t = e.trim();
210
+ if (!t)
211
+ return [];
212
+ try {
213
+ const r = t.split(",").map((n) => n.trim()).filter((n) => n !== "").map((n) => {
214
+ const s = parseFloat(n);
215
+ if (isNaN(s))
216
+ throw new Error(`Invalid numeric value: ${n}`);
217
+ return s;
218
+ });
219
+ return r.length > 0 ? r : [];
220
+ } catch (r) {
221
+ return console.warn("Failed to parse target values:", r), [];
222
+ }
223
+ }
224
+ function Fe(e, t) {
225
+ if (e.length === 0 || t <= 0)
226
+ return [];
227
+ if (e.length === 1)
228
+ return new Array(t).fill(e[0]);
229
+ const r = [], n = Math.floor(t / e.length), s = t % e.length;
230
+ let a = 0;
231
+ for (let l = 0; l < e.length; l++) {
232
+ const c = n + (l < s ? 1 : 0);
233
+ for (let u = 0; u < c; u++)
234
+ r[a++] = e[l];
235
+ }
236
+ return r;
237
+ }
238
+ function Ur(e, t) {
239
+ return t === 0 ? e === 0 ? 0 : e > 0 ? 100 : -100 : (e - t) / t * 100;
240
+ }
241
+ function qr(e, t = 1) {
242
+ return `${e >= 0 ? "+" : ""}${e.toFixed(t)}%`;
243
+ }
244
+ function Kr({
207
245
  data: e,
208
246
  chartConfig: t,
209
- displayConfig: n = {},
210
- queryObject: r,
247
+ displayConfig: r = {},
248
+ queryObject: n,
211
249
  height: s = "100%",
212
250
  colorPalette: a
213
251
  }) {
214
- const [l, c] = G(null), { labelMap: d, getFieldLabel: o } = K();
252
+ const [l, c] = O(null), { labelMap: u, getFieldLabel: o } = W();
215
253
  try {
216
- const u = {
217
- showLegend: (n == null ? void 0 : n.showLegend) ?? !0,
218
- showGrid: (n == null ? void 0 : n.showGrid) ?? !0,
219
- showTooltip: (n == null ? void 0 : n.showTooltip) ?? !0,
220
- stacked: (n == null ? void 0 : n.stacked) ?? !1
254
+ const d = {
255
+ showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
256
+ showGrid: (r == null ? void 0 : r.showGrid) ?? !0,
257
+ showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0,
258
+ stacked: (r == null ? void 0 : r.stacked) ?? !1
221
259
  };
222
260
  if (!e || e.length === 0)
223
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
261
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
224
262
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
225
263
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data points to display in bar chart" })
226
264
  ] }) });
227
- let f, m, w = [];
265
+ let f, m, A = [];
228
266
  if (t != null && t.xAxis && (t != null && t.yAxis))
229
- f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], w = t.series || [];
267
+ f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], A = t.series || [];
230
268
  else if (t != null && t.x && (t != null && t.y))
231
269
  f = t.x, m = Array.isArray(t.y) ? t.y : [t.y];
232
270
  else
233
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
271
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
234
272
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
235
273
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
236
274
  ] }) });
237
275
  if (!f || !m || m.length === 0)
238
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
276
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
239
277
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
240
278
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
241
279
  ] }) });
242
- const { data: x, seriesKeys: v } = C(
280
+ const { data: x, seriesKeys: N } = ee(
243
281
  e,
244
282
  f,
245
283
  m,
246
- r,
247
- w,
248
- d
249
- ), p = u.stacked === !0, S = v.length === 1 && x.some((y) => {
250
- const g = y[v[0]];
251
- return typeof g == "number" && g < 0;
252
- }), k = u.showLegend, h = {
253
- ...ve,
284
+ n,
285
+ A,
286
+ u
287
+ ), g = d.stacked === !0, S = N.length === 1 && x.some((v) => {
288
+ const k = v[N[0]];
289
+ return typeof k == "number" && k < 0;
290
+ }), T = d.showLegend, h = {
291
+ ...ge,
254
292
  left: 40
255
293
  // Increased from 20 to 40 for Y-axis label space
256
- };
257
- return !x || x.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
294
+ }, b = Te((r == null ? void 0 : r.target) || ""), y = Fe(b, x.length);
295
+ let p = x;
296
+ return y.length > 0 && (p = x.map((v, k) => ({
297
+ ...v,
298
+ __target: y[k] || null
299
+ }))), !x || x.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
258
300
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
259
301
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No valid data points for bar chart after transformation" })
260
- ] }) }) : /* @__PURE__ */ i(U, { height: s, children: /* @__PURE__ */ b(ft, { data: x, margin: h, children: [
261
- u.showGrid && /* @__PURE__ */ i(he, { strokeDasharray: "3 3" }),
302
+ ] }) }) : /* @__PURE__ */ i(G, { height: s, children: /* @__PURE__ */ w(st, { data: p, margin: h, children: [
303
+ d.showGrid && /* @__PURE__ */ i(ye, { strokeDasharray: "3 3" }),
262
304
  /* @__PURE__ */ i(
263
- ye,
305
+ pe,
264
306
  {
265
307
  dataKey: "name",
266
308
  tick: { fontSize: 12 },
@@ -270,14 +312,19 @@ function qn({
270
312
  }
271
313
  ),
272
314
  /* @__PURE__ */ i(
273
- pe,
315
+ ve,
274
316
  {
275
317
  tick: { fontSize: 12 },
276
318
  label: { value: o(m[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
277
319
  }
278
320
  ),
279
- u.showTooltip && /* @__PURE__ */ i(q, {}),
280
- k && /* @__PURE__ */ i(
321
+ d.showTooltip && /* @__PURE__ */ i(
322
+ V,
323
+ {
324
+ formatter: (v, k) => k === "Target" ? [`${v}`, "Target Value"] : [v, k]
325
+ }
326
+ ),
327
+ T && /* @__PURE__ */ i(
281
328
  B,
282
329
  {
283
330
  wrapperStyle: { fontSize: "12px", paddingTop: "25px" },
@@ -286,94 +333,126 @@ function qn({
286
333
  layout: "horizontal",
287
334
  align: "center",
288
335
  verticalAlign: "bottom",
289
- onMouseEnter: (y) => c(String(y.dataKey || "")),
336
+ onMouseEnter: (v) => c(String(v.dataKey || "")),
290
337
  onMouseLeave: () => c(null)
291
338
  }
292
339
  ),
293
- v.map((y, g) => /* @__PURE__ */ i(
294
- mt,
340
+ N.map((v, k) => /* @__PURE__ */ i(
341
+ pt,
295
342
  {
296
- dataKey: y,
297
- stackId: p ? "stack" : void 0,
298
- fill: S ? De : (a == null ? void 0 : a.colors) && a.colors[g % a.colors.length] || T[g % T.length],
299
- fillOpacity: l ? l === y ? 1 : 0.3 : 1,
300
- children: S && x.map((N, A) => {
301
- const $ = N[y], L = typeof $ == "number" && $ < 0 ? Tt : De;
343
+ dataKey: v,
344
+ stackId: g ? "stack" : void 0,
345
+ fill: S ? Oe : (a == null ? void 0 : a.colors) && a.colors[k % a.colors.length] || L[k % L.length],
346
+ fillOpacity: l ? l === v ? 1 : 0.3 : 1,
347
+ children: S && x.map(($, F) => {
348
+ const M = $[v], E = typeof M == "number" && M < 0 ? jt : Oe;
302
349
  return /* @__PURE__ */ i(
303
- ke,
350
+ Le,
304
351
  {
305
- fill: L,
306
- fillOpacity: l ? l === y ? 1 : 0.3 : 1
352
+ fill: E,
353
+ fillOpacity: l ? l === v ? 1 : 0.3 : 1
307
354
  },
308
- `cell-${A}`
355
+ `cell-${F}`
309
356
  );
310
357
  })
311
358
  },
312
- y
313
- ))
359
+ v
360
+ )),
361
+ y.length > 0 && /* @__PURE__ */ w($e, { children: [
362
+ /* @__PURE__ */ i(
363
+ q,
364
+ {
365
+ type: "monotone",
366
+ dataKey: "__target",
367
+ stroke: "#ffffff",
368
+ strokeWidth: 2,
369
+ dot: !1,
370
+ activeDot: !1,
371
+ connectNulls: !1
372
+ }
373
+ ),
374
+ /* @__PURE__ */ i(
375
+ q,
376
+ {
377
+ type: "monotone",
378
+ dataKey: "__target",
379
+ name: "Target",
380
+ stroke: "#8B5CF6",
381
+ strokeWidth: 2,
382
+ strokeDasharray: "2 3",
383
+ dot: !1,
384
+ activeDot: !1,
385
+ connectNulls: !1
386
+ }
387
+ )
388
+ ] })
314
389
  ] }) });
315
- } catch (u) {
316
- return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
390
+ } catch (d) {
391
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
317
392
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Bar Chart Error" }),
318
- /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
393
+ /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
319
394
  /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
320
395
  ] }) });
321
396
  }
322
397
  }
323
- function Vn({
398
+ function Br({
324
399
  data: e,
325
400
  chartConfig: t,
326
- displayConfig: n = {},
327
- queryObject: r,
401
+ displayConfig: r = {},
402
+ queryObject: n,
328
403
  height: s = "100%",
329
404
  colorPalette: a
330
405
  }) {
331
- const [l, c] = G(null), { labelMap: d, getFieldLabel: o } = K();
406
+ const [l, c] = O(null), { labelMap: u, getFieldLabel: o } = W();
332
407
  try {
333
- const u = {
334
- showLegend: (n == null ? void 0 : n.showLegend) ?? !0,
335
- showGrid: (n == null ? void 0 : n.showGrid) ?? !0,
336
- showTooltip: (n == null ? void 0 : n.showTooltip) ?? !0
408
+ const d = {
409
+ showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
410
+ showGrid: (r == null ? void 0 : r.showGrid) ?? !0,
411
+ showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0
337
412
  };
338
413
  if (!e || e.length === 0)
339
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
414
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
340
415
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
341
416
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data points to display in line chart" })
342
417
  ] }) });
343
- let f, m, w = [];
418
+ let f, m, A = [];
344
419
  if (t != null && t.xAxis && (t != null && t.yAxis))
345
- f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], w = t.series || [];
420
+ f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], A = t.series || [];
346
421
  else if (t != null && t.x && (t != null && t.y))
347
422
  f = t.x, m = Array.isArray(t.y) ? t.y : [t.y];
348
423
  else
349
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
424
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
350
425
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
351
426
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
352
427
  ] }) });
353
428
  if (!f || !m || m.length === 0)
354
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
429
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
355
430
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
356
431
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
357
432
  ] }) });
358
- const { data: x, seriesKeys: v } = C(
433
+ const { data: x, seriesKeys: N } = ee(
359
434
  e,
360
435
  f,
361
436
  m,
362
- r,
363
- w,
364
- d
365
- ), p = u.showLegend, S = {
366
- ...ve,
437
+ n,
438
+ A,
439
+ u
440
+ ), g = d.showLegend, S = {
441
+ ...ge,
367
442
  left: 40
368
443
  // Increased from 20 to 40 for Y-axis label space
369
- };
370
- return !x || x.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
444
+ }, T = Te((r == null ? void 0 : r.target) || ""), h = Fe(T, x.length);
445
+ let b = x;
446
+ return h.length > 0 && (b = x.map((y, p) => ({
447
+ ...y,
448
+ __target: h[p] || null
449
+ }))), !x || x.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
371
450
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
372
451
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No valid data points for line chart after transformation" })
373
- ] }) }) : /* @__PURE__ */ i(U, { height: s, children: /* @__PURE__ */ b(xt, { data: x, margin: S, children: [
374
- u.showGrid && /* @__PURE__ */ i(he, { strokeDasharray: "3 3" }),
452
+ ] }) }) : /* @__PURE__ */ i(G, { height: s, children: /* @__PURE__ */ w(vt, { data: b, margin: S, children: [
453
+ d.showGrid && /* @__PURE__ */ i(ye, { strokeDasharray: "3 3" }),
375
454
  /* @__PURE__ */ i(
376
- ye,
455
+ pe,
377
456
  {
378
457
  dataKey: "name",
379
458
  tick: { fontSize: 12 },
@@ -383,14 +462,19 @@ function Vn({
383
462
  }
384
463
  ),
385
464
  /* @__PURE__ */ i(
386
- pe,
465
+ ve,
387
466
  {
388
467
  tick: { fontSize: 12 },
389
468
  label: { value: o(m[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
390
469
  }
391
470
  ),
392
- u.showTooltip && /* @__PURE__ */ i(q, {}),
393
- p && /* @__PURE__ */ i(
471
+ d.showTooltip && /* @__PURE__ */ i(
472
+ V,
473
+ {
474
+ formatter: (y, p) => p === "Target" ? [`${y}`, "Target Value"] : [y, p]
475
+ }
476
+ ),
477
+ g && /* @__PURE__ */ i(
394
478
  B,
395
479
  {
396
480
  wrapperStyle: { fontSize: "12px", paddingTop: "25px" },
@@ -399,87 +483,119 @@ function Vn({
399
483
  layout: "horizontal",
400
484
  align: "center",
401
485
  verticalAlign: "bottom",
402
- onMouseEnter: (k) => c(String(k.dataKey || "")),
486
+ onMouseEnter: (y) => c(String(y.dataKey || "")),
403
487
  onMouseLeave: () => c(null)
404
488
  }
405
489
  ),
406
- v.map((k, h) => /* @__PURE__ */ i(
407
- ht,
490
+ N.map((y, p) => /* @__PURE__ */ i(
491
+ q,
408
492
  {
409
493
  type: "monotone",
410
- dataKey: k,
411
- stroke: (a == null ? void 0 : a.colors) && a.colors[h % a.colors.length] || T[h % T.length],
494
+ dataKey: y,
495
+ stroke: (a == null ? void 0 : a.colors) && a.colors[p % a.colors.length] || L[p % L.length],
412
496
  strokeWidth: 2,
413
497
  dot: { r: 3 },
414
498
  activeDot: { r: 5 },
415
- strokeOpacity: l ? l === k ? 1 : 0.3 : 1
499
+ strokeOpacity: l ? l === y ? 1 : 0.3 : 1
416
500
  },
417
- k
418
- ))
501
+ y
502
+ )),
503
+ h.length > 0 && /* @__PURE__ */ w($e, { children: [
504
+ /* @__PURE__ */ i(
505
+ q,
506
+ {
507
+ type: "monotone",
508
+ dataKey: "__target",
509
+ stroke: "#ffffff",
510
+ strokeWidth: 2,
511
+ dot: !1,
512
+ activeDot: !1,
513
+ connectNulls: !1
514
+ }
515
+ ),
516
+ /* @__PURE__ */ i(
517
+ q,
518
+ {
519
+ type: "monotone",
520
+ dataKey: "__target",
521
+ name: "Target",
522
+ stroke: "#8B5CF6",
523
+ strokeWidth: 2,
524
+ strokeDasharray: "2 3",
525
+ dot: !1,
526
+ activeDot: !1,
527
+ connectNulls: !1
528
+ }
529
+ )
530
+ ] })
419
531
  ] }) });
420
- } catch (u) {
421
- return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
532
+ } catch (d) {
533
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
422
534
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Line Chart Error" }),
423
- /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
535
+ /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
424
536
  /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
425
537
  ] }) });
426
538
  }
427
539
  }
428
- function _n({
540
+ function Wr({
429
541
  data: e,
430
542
  chartConfig: t,
431
- displayConfig: n = {},
432
- queryObject: r,
543
+ displayConfig: r = {},
544
+ queryObject: n,
433
545
  height: s = "100%",
434
546
  colorPalette: a
435
547
  }) {
436
- const [l, c] = G(null), { labelMap: d, getFieldLabel: o } = K();
548
+ const [l, c] = O(null), { labelMap: u, getFieldLabel: o } = W();
437
549
  try {
438
- const u = {
439
- showLegend: (n == null ? void 0 : n.showLegend) ?? !0,
440
- showGrid: (n == null ? void 0 : n.showGrid) ?? !0,
441
- showTooltip: (n == null ? void 0 : n.showTooltip) ?? !0,
442
- stacked: (n == null ? void 0 : n.stacked) ?? !1
550
+ const d = {
551
+ showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
552
+ showGrid: (r == null ? void 0 : r.showGrid) ?? !0,
553
+ showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0,
554
+ stacked: (r == null ? void 0 : r.stacked) ?? !1
443
555
  };
444
556
  if (!e || e.length === 0)
445
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
557
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
446
558
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
447
559
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data points to display in area chart" })
448
560
  ] }) });
449
- let f, m, w = [];
561
+ let f, m, A = [];
450
562
  if (t != null && t.xAxis && (t != null && t.yAxis))
451
- f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], w = t.series || [];
563
+ f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], A = t.series || [];
452
564
  else if (t != null && t.x && (t != null && t.y))
453
565
  f = t.x, m = Array.isArray(t.y) ? t.y : [t.y];
454
566
  else
455
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
567
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
456
568
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
457
569
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
458
570
  ] }) });
459
571
  if (!f || !m || m.length === 0)
460
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
572
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
461
573
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
462
574
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
463
575
  ] }) });
464
- const { data: x, seriesKeys: v } = C(
576
+ const { data: x, seriesKeys: N } = ee(
465
577
  e,
466
578
  f,
467
579
  m,
468
- r,
469
- w,
470
- d
471
- ), p = u.showLegend, S = {
472
- ...ve,
580
+ n,
581
+ A,
582
+ u
583
+ ), g = d.showLegend, S = {
584
+ ...ge,
473
585
  left: 40
474
586
  // Increased from 20 to 40 for Y-axis label space
475
- };
476
- return !x || x.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
587
+ }, T = Te((r == null ? void 0 : r.target) || ""), h = Fe(T, x.length);
588
+ let b = x;
589
+ return h.length > 0 && (b = x.map((y, p) => ({
590
+ ...y,
591
+ __target: h[p] || null
592
+ }))), !x || x.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
477
593
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
478
594
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No valid data points for area chart after transformation" })
479
- ] }) }) : /* @__PURE__ */ i(U, { height: s, children: /* @__PURE__ */ b(yt, { data: x, margin: S, children: [
480
- u.showGrid && /* @__PURE__ */ i(he, { strokeDasharray: "3 3" }),
595
+ ] }) }) : /* @__PURE__ */ i(G, { height: s, children: /* @__PURE__ */ w(st, { data: b, margin: S, children: [
596
+ d.showGrid && /* @__PURE__ */ i(ye, { strokeDasharray: "3 3" }),
481
597
  /* @__PURE__ */ i(
482
- ye,
598
+ pe,
483
599
  {
484
600
  dataKey: "name",
485
601
  tick: { fontSize: 12 },
@@ -489,14 +605,19 @@ function _n({
489
605
  }
490
606
  ),
491
607
  /* @__PURE__ */ i(
492
- pe,
608
+ ve,
493
609
  {
494
610
  tick: { fontSize: 12 },
495
611
  label: { value: o(m[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
496
612
  }
497
613
  ),
498
- u.showTooltip && /* @__PURE__ */ i(q, {}),
499
- p && /* @__PURE__ */ i(
614
+ d.showTooltip && /* @__PURE__ */ i(
615
+ V,
616
+ {
617
+ formatter: (y, p) => p === "Target" ? [`${y}`, "Target Value"] : [y, p]
618
+ }
619
+ ),
620
+ g && /* @__PURE__ */ i(
500
621
  B,
501
622
  {
502
623
  wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
@@ -505,122 +626,150 @@ function _n({
505
626
  layout: "horizontal",
506
627
  align: "center",
507
628
  verticalAlign: "bottom",
508
- onMouseEnter: (k) => c(String(k.dataKey || "")),
629
+ onMouseEnter: (y) => c(String(y.dataKey || "")),
509
630
  onMouseLeave: () => c(null)
510
631
  }
511
632
  ),
512
- v.map((k, h) => /* @__PURE__ */ i(
513
- pt,
633
+ N.map((y, p) => /* @__PURE__ */ i(
634
+ gt,
514
635
  {
515
636
  type: "monotone",
516
- dataKey: k,
517
- stackId: u.stacked ? "stack" : void 0,
518
- stroke: (a == null ? void 0 : a.colors) && a.colors[h % a.colors.length] || T[h % T.length],
519
- fill: (a == null ? void 0 : a.colors) && a.colors[h % a.colors.length] || T[h % T.length],
520
- fillOpacity: l ? l === k ? 0.6 : 0.1 : 0.3,
637
+ dataKey: y,
638
+ stackId: d.stacked ? "stack" : void 0,
639
+ stroke: (a == null ? void 0 : a.colors) && a.colors[p % a.colors.length] || L[p % L.length],
640
+ fill: (a == null ? void 0 : a.colors) && a.colors[p % a.colors.length] || L[p % L.length],
641
+ fillOpacity: l ? l === y ? 0.6 : 0.1 : 0.3,
521
642
  strokeWidth: 2,
522
- strokeOpacity: l ? l === k ? 1 : 0.3 : 1
643
+ strokeOpacity: l ? l === y ? 1 : 0.3 : 1
523
644
  },
524
- k
525
- ))
645
+ y
646
+ )),
647
+ h.length > 0 && /* @__PURE__ */ w($e, { children: [
648
+ /* @__PURE__ */ i(
649
+ q,
650
+ {
651
+ type: "monotone",
652
+ dataKey: "__target",
653
+ stroke: "#ffffff",
654
+ strokeWidth: 2,
655
+ dot: !1,
656
+ activeDot: !1,
657
+ connectNulls: !1
658
+ }
659
+ ),
660
+ /* @__PURE__ */ i(
661
+ q,
662
+ {
663
+ type: "monotone",
664
+ dataKey: "__target",
665
+ name: "Target",
666
+ stroke: "#8B5CF6",
667
+ strokeWidth: 2,
668
+ strokeDasharray: "2 3",
669
+ dot: !1,
670
+ activeDot: !1,
671
+ connectNulls: !1
672
+ }
673
+ )
674
+ ] })
526
675
  ] }) });
527
- } catch (u) {
528
- return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
676
+ } catch (d) {
677
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
529
678
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Area Chart Error" }),
530
- /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
679
+ /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
531
680
  /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
532
681
  ] }) });
533
682
  }
534
683
  }
535
- function Bn({
684
+ function Yr({
536
685
  data: e,
537
686
  chartConfig: t,
538
- displayConfig: n = {},
539
- queryObject: r,
687
+ displayConfig: r = {},
688
+ queryObject: n,
540
689
  height: s = "100%",
541
690
  colorPalette: a
542
691
  }) {
543
- const [l, c] = G(null), { labelMap: d } = K();
692
+ const [l, c] = O(null), { labelMap: u } = W();
544
693
  try {
545
694
  const o = {
546
- showLegend: (n == null ? void 0 : n.showLegend) ?? !0,
547
- showTooltip: (n == null ? void 0 : n.showTooltip) ?? !0
695
+ showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
696
+ showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0
548
697
  };
549
698
  if (!e || e.length === 0)
550
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
699
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
551
700
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
552
701
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data points to display in pie chart" })
553
702
  ] }) });
554
- let u, f, m, w = [];
703
+ let d, f, m, A = [];
555
704
  if (t != null && t.xAxis && (t != null && t.yAxis))
556
- f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], w = t.series || [];
705
+ f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], A = t.series || [];
557
706
  else if (t != null && t.x && (t != null && t.y))
558
707
  f = t.x, m = Array.isArray(t.y) ? t.y : [t.y];
559
708
  else
560
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
709
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
561
710
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
562
711
  /* @__PURE__ */ i("div", { className: "text-xs", children: "chartConfig.x/y or chartConfig.xAxis/yAxis required for pie chart" })
563
712
  ] }) });
564
713
  if (!f || !m || m.length === 0)
565
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
714
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
566
715
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
567
716
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
568
717
  ] }) });
569
- if (w.length > 0) {
570
- const { data: v } = C(
718
+ if (A.length > 0) {
719
+ const { data: N } = ee(
571
720
  e,
572
721
  f,
573
722
  m,
574
- r,
575
- w,
576
- d
723
+ n,
724
+ A,
725
+ u
577
726
  );
578
- if (u = [], v.length > 0) {
579
- const p = v[0];
580
- Object.keys(p).forEach((S) => {
581
- S !== "name" && typeof p[S] == "number" && u.push({
727
+ if (d = [], N.length > 0) {
728
+ const g = N[0];
729
+ Object.keys(g).forEach((S) => {
730
+ S !== "name" && typeof g[S] == "number" && d.push({
582
731
  name: String(S),
583
- value: p[S]
732
+ value: g[S]
584
733
  });
585
734
  });
586
735
  }
587
736
  } else {
588
- const v = O(r, f);
589
- u = e.map((p) => {
590
- let S = R(p[f], v) || String(p[f]) || "Unknown";
591
- return typeof p[f] == "boolean" ? S = p[f] ? "Active" : "Inactive" : (S === "true" || S === "false") && (S = S === "true" ? "Active" : "Inactive"), {
737
+ const N = H(n, f);
738
+ d = e.map((g) => {
739
+ let S = R(g[f], N) || String(g[f]) || "Unknown";
740
+ return typeof g[f] == "boolean" ? S = g[f] ? "Active" : "Inactive" : (S === "true" || S === "false") && (S = S === "true" ? "Active" : "Inactive"), {
592
741
  name: S,
593
- value: typeof p[m[0]] == "string" ? parseFloat(p[m[0]]) : p[m[0]] || 0
742
+ value: typeof g[m[0]] == "string" ? parseFloat(g[m[0]]) : g[m[0]] || 0
594
743
  };
595
744
  });
596
745
  }
597
- const x = u.length;
598
- return u = u.filter(
599
- (v) => v.value != null && !isNaN(v.value) && v.value !== 0 && v.value > 0
600
- ), u.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
746
+ const x = d.length;
747
+ return d = d.filter(
748
+ (N) => N.value != null && !isNaN(N.value) && N.value !== 0 && N.value > 0
749
+ ), d.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
601
750
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
602
751
  /* @__PURE__ */ i("div", { className: "text-xs", children: x > 0 ? `Filtered out ${x} data points (zero or invalid values)` : "No data points to display in pie chart" })
603
- ] }) }) : /* @__PURE__ */ i(U, { height: s, children: /* @__PURE__ */ b(vt, { children: [
752
+ ] }) }) : /* @__PURE__ */ i(G, { height: s, children: /* @__PURE__ */ w(bt, { children: [
604
753
  /* @__PURE__ */ i(
605
- bt,
754
+ wt,
606
755
  {
607
- data: u,
756
+ data: d,
608
757
  cx: "50%",
609
758
  cy: "50%",
610
759
  outerRadius: "70%",
611
760
  dataKey: "value",
612
- label: o.showLegend ? void 0 : ({ name: v, percent: p }) => `${v} ${(p * 100).toFixed(0)}%`,
613
- children: u.map((v, p) => /* @__PURE__ */ i(
614
- ke,
761
+ label: o.showLegend ? void 0 : ({ name: N, percent: g }) => `${N} ${(g * 100).toFixed(0)}%`,
762
+ children: d.map((N, g) => /* @__PURE__ */ i(
763
+ Le,
615
764
  {
616
- fill: (a == null ? void 0 : a.colors) && a.colors[p % a.colors.length] || T[p % T.length],
617
- fillOpacity: l ? l === u[p].name ? 1 : 0.3 : 1
765
+ fill: (a == null ? void 0 : a.colors) && a.colors[g % a.colors.length] || L[g % L.length],
766
+ fillOpacity: l ? l === d[g].name ? 1 : 0.3 : 1
618
767
  },
619
- `cell-${p}`
768
+ `cell-${g}`
620
769
  ))
621
770
  }
622
771
  ),
623
- o.showTooltip && /* @__PURE__ */ i(q, {}),
772
+ o.showTooltip && /* @__PURE__ */ i(V, {}),
624
773
  o.showLegend && /* @__PURE__ */ i(
625
774
  B,
626
775
  {
@@ -630,112 +779,112 @@ function Bn({
630
779
  layout: "horizontal",
631
780
  align: "center",
632
781
  verticalAlign: "bottom",
633
- onMouseEnter: (v) => c(String(v.value || "")),
782
+ onMouseEnter: (N) => c(String(N.value || "")),
634
783
  onMouseLeave: () => c(null)
635
784
  }
636
785
  )
637
786
  ] }) });
638
787
  } catch (o) {
639
- return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
788
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
640
789
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Pie Chart Error" }),
641
790
  /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: o instanceof Error ? o.message : "Unknown rendering error" }),
642
791
  /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
643
792
  ] }) });
644
793
  }
645
794
  }
646
- function Kn({
795
+ function Xr({
647
796
  data: e,
648
797
  chartConfig: t,
649
- displayConfig: n = {},
650
- queryObject: r,
798
+ displayConfig: r = {},
799
+ queryObject: n,
651
800
  height: s = "100%",
652
801
  colorPalette: a
653
802
  }) {
654
- const [l, c] = G(null), { getFieldLabel: d } = K();
803
+ const [l, c] = O(null), { getFieldLabel: u } = W();
655
804
  try {
656
805
  const o = {
657
- showLegend: (n == null ? void 0 : n.showLegend) ?? !0,
658
- showGrid: (n == null ? void 0 : n.showGrid) ?? !0,
659
- showTooltip: (n == null ? void 0 : n.showTooltip) ?? !0
806
+ showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
807
+ showGrid: (r == null ? void 0 : r.showGrid) ?? !0,
808
+ showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0
660
809
  };
661
810
  if (!e || e.length === 0)
662
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
811
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
663
812
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
664
813
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data points to display in scatter chart" })
665
814
  ] }) });
666
- let u, f, m = [];
815
+ let d, f, m = [];
667
816
  if (t != null && t.xAxis && (t != null && t.yAxis))
668
- u = t.xAxis[0], f = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis, m = t.series || [];
817
+ d = t.xAxis[0], f = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis, m = t.series || [];
669
818
  else if (t != null && t.x && (t != null && t.y))
670
- u = t.x, f = Array.isArray(t.y) ? t.y[0] : t.y;
819
+ d = t.x, f = Array.isArray(t.y) ? t.y[0] : t.y;
671
820
  else
672
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
821
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
673
822
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
674
823
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
675
824
  ] }) });
676
- if (!u || !f)
677
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
825
+ if (!d || !f)
826
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
678
827
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
679
828
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
680
829
  ] }) });
681
- let w, x = {};
830
+ let A, x = {};
682
831
  if (m.length > 0) {
683
832
  const h = m[0];
684
- e.forEach((g) => {
685
- const N = String(g[h] || "Default");
686
- x[N] || (x[N] = []);
687
- const A = O(r, u), $ = R(g[u], A) || g[u], L = typeof g[f] == "string" ? parseFloat(g[f]) : g[f] || 0;
688
- x[N].push({
689
- x: typeof $ == "string" ? parseFloat($) || 0 : $,
690
- y: L,
691
- name: `${N} (${$}, ${L})`
833
+ e.forEach((y) => {
834
+ const p = String(y[h] || "Default");
835
+ x[p] || (x[p] = []);
836
+ const v = H(n, d), k = R(y[d], v) || y[d], $ = typeof y[f] == "string" ? parseFloat(y[f]) : y[f] || 0;
837
+ x[p].push({
838
+ x: typeof k == "string" ? parseFloat(k) || 0 : k,
839
+ y: $,
840
+ name: `${p} (${k}, ${$})`
692
841
  });
693
842
  });
694
- const y = Object.keys(x);
695
- w = x[y[0]] || [];
843
+ const b = Object.keys(x);
844
+ A = x[b[0]] || [];
696
845
  } else {
697
- const h = O(r, u);
698
- w = e.map((y) => {
699
- const g = R(y[u], h) || y[u], N = typeof y[f] == "string" ? parseFloat(y[f]) : y[f] || 0;
846
+ const h = H(n, d);
847
+ A = e.map((b) => {
848
+ const y = R(b[d], h) || b[d], p = typeof b[f] == "string" ? parseFloat(b[f]) : b[f] || 0;
700
849
  return {
701
- x: typeof g == "string" ? parseFloat(g) || 0 : g,
702
- y: N,
703
- name: `(${g}, ${N})`
850
+ x: typeof y == "string" ? parseFloat(y) || 0 : y,
851
+ y: p,
852
+ name: `(${y}, ${p})`
704
853
  };
705
854
  });
706
855
  }
707
- if (!w || w.length === 0)
708
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
856
+ if (!A || A.length === 0)
857
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
709
858
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
710
859
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No valid data points for scatter chart after transformation" })
711
860
  ] }) });
712
- const v = Object.keys(x), p = v.length > 1, S = o.showLegend && p, k = {
713
- ...ve,
861
+ const N = Object.keys(x), g = N.length > 1, S = o.showLegend && g, T = {
862
+ ...ge,
714
863
  left: 40
715
864
  // Increased from 20 to 40 for Y-axis label space
716
865
  };
717
- return /* @__PURE__ */ i(U, { height: s, children: /* @__PURE__ */ b(gt, { data: w, margin: k, children: [
718
- o.showGrid && /* @__PURE__ */ i(he, { strokeDasharray: "3 3" }),
866
+ return /* @__PURE__ */ i(G, { height: s, children: /* @__PURE__ */ w(Nt, { data: A, margin: T, children: [
867
+ o.showGrid && /* @__PURE__ */ i(ye, { strokeDasharray: "3 3" }),
719
868
  /* @__PURE__ */ i(
720
- ye,
869
+ pe,
721
870
  {
722
871
  type: "number",
723
872
  dataKey: "x",
724
- name: d(u),
873
+ name: u(d),
725
874
  tick: { fontSize: 12 }
726
875
  }
727
876
  ),
728
877
  /* @__PURE__ */ i(
729
- pe,
878
+ ve,
730
879
  {
731
880
  type: "number",
732
881
  dataKey: "y",
733
- name: d(f),
882
+ name: u(f),
734
883
  tick: { fontSize: 12 },
735
- label: { value: d(f), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
884
+ label: { value: u(f), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
736
885
  }
737
886
  ),
738
- o.showTooltip && /* @__PURE__ */ i(q, {}),
887
+ o.showTooltip && /* @__PURE__ */ i(V, {}),
739
888
  S && /* @__PURE__ */ i(
740
889
  B,
741
890
  {
@@ -749,14 +898,14 @@ function Kn({
749
898
  onMouseLeave: () => c(null)
750
899
  }
751
900
  ),
752
- p ? (
901
+ g ? (
753
902
  // Multiple series
754
- v.map((h, y) => /* @__PURE__ */ i(
755
- Re,
903
+ N.map((h, b) => /* @__PURE__ */ i(
904
+ He,
756
905
  {
757
906
  name: h,
758
907
  data: x[h],
759
- fill: (a == null ? void 0 : a.colors) && a.colors[y % a.colors.length] || T[y % T.length],
908
+ fill: (a == null ? void 0 : a.colors) && a.colors[b % a.colors.length] || L[b % L.length],
760
909
  fillOpacity: l ? l === h ? 1 : 0.3 : 1
761
910
  },
762
911
  h
@@ -764,88 +913,88 @@ function Kn({
764
913
  ) : (
765
914
  // Single series
766
915
  /* @__PURE__ */ i(
767
- Re,
916
+ He,
768
917
  {
769
918
  name: "Data",
770
- data: w,
771
- fill: (a == null ? void 0 : a.colors) && a.colors[0] || T[0]
919
+ data: A,
920
+ fill: (a == null ? void 0 : a.colors) && a.colors[0] || L[0]
772
921
  }
773
922
  )
774
923
  )
775
924
  ] }) });
776
925
  } catch (o) {
777
- return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
926
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
778
927
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Scatter Chart Error" }),
779
928
  /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: o instanceof Error ? o.message : "Unknown rendering error" }),
780
929
  /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
781
930
  ] }) });
782
931
  }
783
932
  }
784
- function Yn({
933
+ function Qr({
785
934
  data: e,
786
935
  chartConfig: t,
787
- displayConfig: n = {},
788
- queryObject: r,
936
+ displayConfig: r = {},
937
+ queryObject: n,
789
938
  height: s = "100%",
790
939
  colorPalette: a
791
940
  }) {
792
- const [l, c] = G(null);
941
+ const [l, c] = O(null);
793
942
  try {
794
- const d = {
795
- showLegend: (n == null ? void 0 : n.showLegend) ?? !0,
796
- showTooltip: (n == null ? void 0 : n.showTooltip) ?? !0,
797
- showGrid: (n == null ? void 0 : n.showGrid) ?? !0
943
+ const u = {
944
+ showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
945
+ showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0,
946
+ showGrid: (r == null ? void 0 : r.showGrid) ?? !0
798
947
  };
799
948
  if (!e || e.length === 0)
800
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
949
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
801
950
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
802
951
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data points to display in radar chart" })
803
952
  ] }) });
804
- let o, u = [];
953
+ let o, d = [];
805
954
  if (t != null && t.xAxis && (t != null && t.yAxis)) {
806
- const f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], w = t.series || [], { data: x, seriesKeys: v } = C(
955
+ const f = t.xAxis[0], m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], A = t.series || [], { data: x, seriesKeys: N } = ee(
807
956
  e,
808
957
  f,
809
958
  m,
810
- r,
811
- w
959
+ n,
960
+ A
812
961
  );
813
- o = x, u = v;
962
+ o = x, d = N;
814
963
  } else {
815
- const f = e[0], m = Object.keys(f), w = m.find(
816
- (v) => typeof f[v] == "string" || v.toLowerCase().includes("subject") || v.toLowerCase().includes("name") || v.toLowerCase().includes("category")
964
+ const f = e[0], m = Object.keys(f), A = m.find(
965
+ (N) => typeof f[N] == "string" || N.toLowerCase().includes("subject") || N.toLowerCase().includes("name") || N.toLowerCase().includes("category")
817
966
  ) || m[0], x = m.filter(
818
- (v) => typeof f[v] == "number" && v !== w
967
+ (N) => typeof f[N] == "number" && N !== A
819
968
  );
820
969
  if (x.length === 0)
821
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
970
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
822
971
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
823
972
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No numeric fields found for radar chart values" })
824
973
  ] }) });
825
- if (w) {
826
- const v = O(r, w);
827
- o = e.map((p) => {
974
+ if (A) {
975
+ const N = H(n, A);
976
+ o = e.map((g) => {
828
977
  const S = {
829
- name: R(p[w], v) || String(p[w]) || "Unknown"
978
+ name: R(g[A], N) || String(g[A]) || "Unknown"
830
979
  };
831
- return x.forEach((k) => {
832
- const h = k.split(".").pop() || k;
833
- S[h] = typeof p[k] == "string" ? parseFloat(p[k]) : p[k] || 0;
980
+ return x.forEach((T) => {
981
+ const h = T.split(".").pop() || T;
982
+ S[h] = typeof g[T] == "string" ? parseFloat(g[T]) : g[T] || 0;
834
983
  }), S;
835
- }), u = x.map((p) => p.split(".").pop() || p);
984
+ }), d = x.map((g) => g.split(".").pop() || g);
836
985
  } else
837
- o = e.map((v) => ({
838
- name: String(v[m[0]] || "Unknown"),
839
- value: typeof v[x[0]] == "string" ? parseFloat(v[x[0]]) : v[x[0]] || 0
840
- })), u = ["value"];
986
+ o = e.map((N) => ({
987
+ name: String(N[m[0]] || "Unknown"),
988
+ value: typeof N[x[0]] == "string" ? parseFloat(N[x[0]]) : N[x[0]] || 0
989
+ })), d = ["value"];
841
990
  }
842
- return !o || o.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
991
+ return !o || o.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
843
992
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
844
993
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No valid data points for radar chart after transformation" })
845
- ] }) }) : /* @__PURE__ */ i(U, { height: s, children: /* @__PURE__ */ b(wt, { data: o, margin: { top: 20, right: 80, bottom: 20, left: 80 }, children: [
846
- d.showGrid && /* @__PURE__ */ i(Nt, {}),
994
+ ] }) }) : /* @__PURE__ */ i(G, { height: s, children: /* @__PURE__ */ w(At, { data: o, margin: { top: 20, right: 80, bottom: 20, left: 80 }, children: [
995
+ u.showGrid && /* @__PURE__ */ i(St, {}),
847
996
  /* @__PURE__ */ i(
848
- At,
997
+ kt,
849
998
  {
850
999
  dataKey: "name",
851
1000
  tick: { fontSize: 12 },
@@ -853,14 +1002,14 @@ function Yn({
853
1002
  }
854
1003
  ),
855
1004
  /* @__PURE__ */ i(
856
- St,
1005
+ Mt,
857
1006
  {
858
1007
  tick: { fontSize: 10 },
859
1008
  className: "text-gray-600"
860
1009
  }
861
1010
  ),
862
- d.showTooltip && /* @__PURE__ */ i(q, {}),
863
- d.showLegend && u.length > 1 && /* @__PURE__ */ i(
1011
+ u.showTooltip && /* @__PURE__ */ i(V, {}),
1012
+ u.showLegend && d.length > 1 && /* @__PURE__ */ i(
864
1013
  B,
865
1014
  {
866
1015
  wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
@@ -873,13 +1022,13 @@ function Yn({
873
1022
  onMouseLeave: () => c(null)
874
1023
  }
875
1024
  ),
876
- u.map((f, m) => /* @__PURE__ */ i(
877
- Mt,
1025
+ d.map((f, m) => /* @__PURE__ */ i(
1026
+ $t,
878
1027
  {
879
1028
  name: f,
880
1029
  dataKey: f,
881
- stroke: (a == null ? void 0 : a.colors) && a.colors[m % a.colors.length] || T[m % T.length],
882
- fill: (a == null ? void 0 : a.colors) && a.colors[m % a.colors.length] || T[m % T.length],
1030
+ stroke: (a == null ? void 0 : a.colors) && a.colors[m % a.colors.length] || L[m % L.length],
1031
+ fill: (a == null ? void 0 : a.colors) && a.colors[m % a.colors.length] || L[m % L.length],
883
1032
  fillOpacity: l ? l === f ? 0.6 : 0.1 : 0.3,
884
1033
  strokeOpacity: l ? l === f ? 1 : 0.3 : 1,
885
1034
  strokeWidth: 2
@@ -887,74 +1036,74 @@ function Yn({
887
1036
  f
888
1037
  ))
889
1038
  ] }) });
890
- } catch (d) {
891
- return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
1039
+ } catch (u) {
1040
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
892
1041
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Radar Chart Error" }),
893
- /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
1042
+ /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
894
1043
  /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
895
1044
  ] }) });
896
1045
  }
897
1046
  }
898
- function Wn({
1047
+ function Zr({
899
1048
  data: e,
900
1049
  chartConfig: t,
901
- displayConfig: n = {},
902
- queryObject: r,
1050
+ displayConfig: r = {},
1051
+ queryObject: n,
903
1052
  height: s = "100%",
904
1053
  colorPalette: a
905
1054
  }) {
906
- const [l, c] = G(null);
1055
+ const [l, c] = O(null);
907
1056
  try {
908
- const d = {
909
- showLegend: (n == null ? void 0 : n.showLegend) ?? !0,
910
- showTooltip: (n == null ? void 0 : n.showTooltip) ?? !0
1057
+ const u = {
1058
+ showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
1059
+ showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0
911
1060
  };
912
1061
  if (!e || e.length === 0)
913
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
1062
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
914
1063
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
915
1064
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data points to display in radial bar chart" })
916
1065
  ] }) });
917
1066
  let o;
918
1067
  if (t != null && t.xAxis && (t != null && t.yAxis)) {
919
- const u = t.xAxis[0], f = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis, m = O(r, u);
920
- o = e.map((w, x) => ({
921
- name: R(w[u], m) || String(w[u]) || "Unknown",
922
- value: typeof w[f] == "string" ? parseFloat(w[f]) : w[f] || 0,
923
- fill: (a == null ? void 0 : a.colors) && a.colors[x % a.colors.length] || T[x % T.length]
1068
+ const d = t.xAxis[0], f = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis, m = H(n, d);
1069
+ o = e.map((A, x) => ({
1070
+ name: R(A[d], m) || String(A[d]) || "Unknown",
1071
+ value: typeof A[f] == "string" ? parseFloat(A[f]) : A[f] || 0,
1072
+ fill: (a == null ? void 0 : a.colors) && a.colors[x % a.colors.length] || L[x % L.length]
924
1073
  }));
925
1074
  } else {
926
- const u = e[0], f = Object.keys(u), m = f.find(
927
- (x) => typeof u[x] == "string" || x.toLowerCase().includes("name") || x.toLowerCase().includes("label") || x.toLowerCase().includes("category")
928
- ) || f[0], w = f.find(
929
- (x) => typeof u[x] == "number" && x !== m
1075
+ const d = e[0], f = Object.keys(d), m = f.find(
1076
+ (x) => typeof d[x] == "string" || x.toLowerCase().includes("name") || x.toLowerCase().includes("label") || x.toLowerCase().includes("category")
1077
+ ) || f[0], A = f.find(
1078
+ (x) => typeof d[x] == "number" && x !== m
930
1079
  ) || f[1];
931
- if (!w)
932
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
1080
+ if (!A)
1081
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
933
1082
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
934
1083
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No numeric field found for radial bar chart values" })
935
1084
  ] }) });
936
- o = e.map((x, v) => {
937
- let p = x[m];
938
- return typeof p == "boolean" ? p = p ? "Active" : "Inactive" : p === "true" || p === "false" ? p = p === "true" ? "Active" : "Inactive" : p = String(p), {
939
- name: p,
940
- value: typeof x[w] == "string" ? parseFloat(x[w]) : x[w] || 0,
941
- fill: (a == null ? void 0 : a.colors) && a.colors[v % a.colors.length] || T[v % T.length]
1085
+ o = e.map((x, N) => {
1086
+ let g = x[m];
1087
+ return typeof g == "boolean" ? g = g ? "Active" : "Inactive" : g === "true" || g === "false" ? g = g === "true" ? "Active" : "Inactive" : g = String(g), {
1088
+ name: g,
1089
+ value: typeof x[A] == "string" ? parseFloat(x[A]) : x[A] || 0,
1090
+ fill: (a == null ? void 0 : a.colors) && a.colors[N % a.colors.length] || L[N % L.length]
942
1091
  };
943
1092
  });
944
1093
  }
945
- return o = o.filter((u) => u.value != null && u.value !== 0), o.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
1094
+ return o = o.filter((d) => d.value != null && d.value !== 0), o.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
946
1095
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
947
1096
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No valid data points for radial bar chart after transformation" })
948
- ] }) }) : /* @__PURE__ */ i(U, { height: s, children: /* @__PURE__ */ b(
949
- kt,
1097
+ ] }) }) : /* @__PURE__ */ i(G, { height: s, children: /* @__PURE__ */ w(
1098
+ Lt,
950
1099
  {
951
1100
  data: o,
952
1101
  innerRadius: "10%",
953
1102
  outerRadius: "80%",
954
1103
  margin: { top: 20, right: 30, bottom: 20, left: 30 },
955
1104
  children: [
956
- d.showTooltip && /* @__PURE__ */ i(q, {}),
957
- d.showLegend && /* @__PURE__ */ i(
1105
+ u.showTooltip && /* @__PURE__ */ i(V, {}),
1106
+ u.showLegend && /* @__PURE__ */ i(
958
1107
  B,
959
1108
  {
960
1109
  wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
@@ -963,21 +1112,21 @@ function Wn({
963
1112
  layout: "horizontal",
964
1113
  align: "center",
965
1114
  verticalAlign: "bottom",
966
- onMouseEnter: (u) => c(String(u.value || "")),
1115
+ onMouseEnter: (d) => c(String(d.value || "")),
967
1116
  onMouseLeave: () => c(null)
968
1117
  }
969
1118
  ),
970
1119
  /* @__PURE__ */ i(
971
- $t,
1120
+ Tt,
972
1121
  {
973
1122
  dataKey: "value",
974
1123
  cornerRadius: 4,
975
1124
  label: { position: "insideStart", fill: "#fff", fontSize: 12 },
976
- children: o.map((u, f) => /* @__PURE__ */ i(
977
- ke,
1125
+ children: o.map((d, f) => /* @__PURE__ */ i(
1126
+ Le,
978
1127
  {
979
- fill: u.fill,
980
- fillOpacity: l ? l === u.name ? 1 : 0.3 : 1
1128
+ fill: d.fill,
1129
+ fillOpacity: l ? l === d.name ? 1 : 0.3 : 1
981
1130
  },
982
1131
  `cell-${f}`
983
1132
  ))
@@ -986,127 +1135,127 @@ function Wn({
986
1135
  ]
987
1136
  }
988
1137
  ) });
989
- } catch (d) {
990
- return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
1138
+ } catch (u) {
1139
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
991
1140
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Radial Bar Chart Error" }),
992
- /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
1141
+ /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
993
1142
  /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
994
1143
  ] }) });
995
1144
  }
996
1145
  }
997
- function oe(e, t) {
1146
+ function ce(e, t) {
998
1147
  return e == null || t == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
999
1148
  }
1000
- function jt(e, t) {
1149
+ function Et(e, t) {
1001
1150
  return e == null || t == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
1002
1151
  }
1003
- function et(e) {
1004
- let t, n, r;
1005
- e.length !== 2 ? (t = oe, n = (c, d) => oe(e(c), d), r = (c, d) => e(c) - d) : (t = e === oe || e === jt ? e : zt, n = e, r = e);
1006
- function s(c, d, o = 0, u = c.length) {
1007
- if (o < u) {
1008
- if (t(d, d) !== 0) return u;
1152
+ function it(e) {
1153
+ let t, r, n;
1154
+ e.length !== 2 ? (t = ce, r = (c, u) => ce(e(c), u), n = (c, u) => e(c) - u) : (t = e === ce || e === Et ? e : Dt, r = e, n = e);
1155
+ function s(c, u, o = 0, d = c.length) {
1156
+ if (o < d) {
1157
+ if (t(u, u) !== 0) return d;
1009
1158
  do {
1010
- const f = o + u >>> 1;
1011
- n(c[f], d) < 0 ? o = f + 1 : u = f;
1012
- } while (o < u);
1159
+ const f = o + d >>> 1;
1160
+ r(c[f], u) < 0 ? o = f + 1 : d = f;
1161
+ } while (o < d);
1013
1162
  }
1014
1163
  return o;
1015
1164
  }
1016
- function a(c, d, o = 0, u = c.length) {
1017
- if (o < u) {
1018
- if (t(d, d) !== 0) return u;
1165
+ function a(c, u, o = 0, d = c.length) {
1166
+ if (o < d) {
1167
+ if (t(u, u) !== 0) return d;
1019
1168
  do {
1020
- const f = o + u >>> 1;
1021
- n(c[f], d) <= 0 ? o = f + 1 : u = f;
1022
- } while (o < u);
1169
+ const f = o + d >>> 1;
1170
+ r(c[f], u) <= 0 ? o = f + 1 : d = f;
1171
+ } while (o < d);
1023
1172
  }
1024
1173
  return o;
1025
1174
  }
1026
- function l(c, d, o = 0, u = c.length) {
1027
- const f = s(c, d, o, u - 1);
1028
- return f > o && r(c[f - 1], d) > -r(c[f], d) ? f - 1 : f;
1175
+ function l(c, u, o = 0, d = c.length) {
1176
+ const f = s(c, u, o, d - 1);
1177
+ return f > o && n(c[f - 1], u) > -n(c[f], u) ? f - 1 : f;
1029
1178
  }
1030
1179
  return { left: s, center: l, right: a };
1031
1180
  }
1032
- function zt() {
1181
+ function Dt() {
1033
1182
  return 0;
1034
1183
  }
1035
- function Et(e) {
1184
+ function Rt(e) {
1036
1185
  return e === null ? NaN : +e;
1037
1186
  }
1038
- const Rt = et(oe), tt = Rt.right;
1039
- et(Et).center;
1040
- class He extends Map {
1041
- constructor(t, n = It) {
1042
- if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: n } }), t != null) for (const [r, s] of t) this.set(r, s);
1187
+ const It = it(ce), at = It.right;
1188
+ it(Rt).center;
1189
+ class Ge extends Map {
1190
+ constructor(t, r = Ot) {
1191
+ if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: r } }), t != null) for (const [n, s] of t) this.set(n, s);
1043
1192
  }
1044
1193
  get(t) {
1045
- return super.get(Ie(this, t));
1194
+ return super.get(Ve(this, t));
1046
1195
  }
1047
1196
  has(t) {
1048
- return super.has(Ie(this, t));
1197
+ return super.has(Ve(this, t));
1049
1198
  }
1050
- set(t, n) {
1051
- return super.set(Dt(this, t), n);
1199
+ set(t, r) {
1200
+ return super.set(_t(this, t), r);
1052
1201
  }
1053
1202
  delete(t) {
1054
1203
  return super.delete(Ht(this, t));
1055
1204
  }
1056
1205
  }
1057
- function Ie({ _intern: e, _key: t }, n) {
1058
- const r = t(n);
1059
- return e.has(r) ? e.get(r) : n;
1206
+ function Ve({ _intern: e, _key: t }, r) {
1207
+ const n = t(r);
1208
+ return e.has(n) ? e.get(n) : r;
1060
1209
  }
1061
- function Dt({ _intern: e, _key: t }, n) {
1062
- const r = t(n);
1063
- return e.has(r) ? e.get(r) : (e.set(r, n), n);
1210
+ function _t({ _intern: e, _key: t }, r) {
1211
+ const n = t(r);
1212
+ return e.has(n) ? e.get(n) : (e.set(n, r), r);
1064
1213
  }
1065
- function Ht({ _intern: e, _key: t }, n) {
1066
- const r = t(n);
1067
- return e.has(r) && (n = e.get(r), e.delete(r)), n;
1214
+ function Ht({ _intern: e, _key: t }, r) {
1215
+ const n = t(r);
1216
+ return e.has(n) && (r = e.get(n), e.delete(n)), r;
1068
1217
  }
1069
- function It(e) {
1218
+ function Ot(e) {
1070
1219
  return e !== null && typeof e == "object" ? e.valueOf() : e;
1071
1220
  }
1072
- const Ot = Math.sqrt(50), Gt = Math.sqrt(10), Ut = Math.sqrt(2);
1073
- function ce(e, t, n) {
1074
- const r = (t - e) / Math.max(0, n), s = Math.floor(Math.log10(r)), a = r / Math.pow(10, s), l = a >= Ot ? 10 : a >= Gt ? 5 : a >= Ut ? 2 : 1;
1075
- let c, d, o;
1076
- return s < 0 ? (o = Math.pow(10, -s) / l, c = Math.round(e * o), d = Math.round(t * o), c / o < e && ++c, d / o > t && --d, o = -o) : (o = Math.pow(10, s) * l, c = Math.round(e / o), d = Math.round(t / o), c * o < e && ++c, d * o > t && --d), d < c && 0.5 <= n && n < 2 ? ce(e, t, n * 2) : [c, d, o];
1221
+ const Gt = Math.sqrt(50), Vt = Math.sqrt(10), Ut = Math.sqrt(2);
1222
+ function ue(e, t, r) {
1223
+ const n = (t - e) / Math.max(0, r), s = Math.floor(Math.log10(n)), a = n / Math.pow(10, s), l = a >= Gt ? 10 : a >= Vt ? 5 : a >= Ut ? 2 : 1;
1224
+ let c, u, o;
1225
+ return s < 0 ? (o = Math.pow(10, -s) / l, c = Math.round(e * o), u = Math.round(t * o), c / o < e && ++c, u / o > t && --u, o = -o) : (o = Math.pow(10, s) * l, c = Math.round(e / o), u = Math.round(t / o), c * o < e && ++c, u * o > t && --u), u < c && 0.5 <= r && r < 2 ? ue(e, t, r * 2) : [c, u, o];
1077
1226
  }
1078
- function qt(e, t, n) {
1079
- if (t = +t, e = +e, n = +n, !(n > 0)) return [];
1227
+ function qt(e, t, r) {
1228
+ if (t = +t, e = +e, r = +r, !(r > 0)) return [];
1080
1229
  if (e === t) return [e];
1081
- const r = t < e, [s, a, l] = r ? ce(t, e, n) : ce(e, t, n);
1230
+ const n = t < e, [s, a, l] = n ? ue(t, e, r) : ue(e, t, r);
1082
1231
  if (!(a >= s)) return [];
1083
- const c = a - s + 1, d = new Array(c);
1084
- if (r)
1085
- if (l < 0) for (let o = 0; o < c; ++o) d[o] = (a - o) / -l;
1086
- else for (let o = 0; o < c; ++o) d[o] = (a - o) * l;
1087
- else if (l < 0) for (let o = 0; o < c; ++o) d[o] = (s + o) / -l;
1088
- else for (let o = 0; o < c; ++o) d[o] = (s + o) * l;
1089
- return d;
1232
+ const c = a - s + 1, u = new Array(c);
1233
+ if (n)
1234
+ if (l < 0) for (let o = 0; o < c; ++o) u[o] = (a - o) / -l;
1235
+ else for (let o = 0; o < c; ++o) u[o] = (a - o) * l;
1236
+ else if (l < 0) for (let o = 0; o < c; ++o) u[o] = (s + o) / -l;
1237
+ else for (let o = 0; o < c; ++o) u[o] = (s + o) * l;
1238
+ return u;
1090
1239
  }
1091
- function Ne(e, t, n) {
1092
- return t = +t, e = +e, n = +n, ce(e, t, n)[2];
1240
+ function Ae(e, t, r) {
1241
+ return t = +t, e = +e, r = +r, ue(e, t, r)[2];
1093
1242
  }
1094
- function Vt(e, t, n) {
1095
- t = +t, e = +e, n = +n;
1096
- const r = t < e, s = r ? Ne(t, e, n) : Ne(e, t, n);
1097
- return (r ? -1 : 1) * (s < 0 ? 1 / -s : s);
1243
+ function Kt(e, t, r) {
1244
+ t = +t, e = +e, r = +r;
1245
+ const n = t < e, s = n ? Ae(t, e, r) : Ae(e, t, r);
1246
+ return (n ? -1 : 1) * (s < 0 ? 1 / -s : s);
1098
1247
  }
1099
- function $e(e, t, n) {
1100
- e.prototype = t.prototype = n, n.constructor = e;
1248
+ function je(e, t, r) {
1249
+ e.prototype = t.prototype = r, r.constructor = e;
1101
1250
  }
1102
- function nt(e, t) {
1103
- var n = Object.create(e.prototype);
1104
- for (var r in t) n[r] = t[r];
1105
- return n;
1251
+ function lt(e, t) {
1252
+ var r = Object.create(e.prototype);
1253
+ for (var n in t) r[n] = t[n];
1254
+ return r;
1106
1255
  }
1107
- function ee() {
1256
+ function te() {
1108
1257
  }
1109
- var Z = 0.7, de = 1 / Z, X = "\\s*([+-]?\\d+)\\s*", J = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", D = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", _t = /^#([0-9a-f]{3,8})$/, Bt = new RegExp(`^rgb\\(${X},${X},${X}\\)$`), Kt = new RegExp(`^rgb\\(${D},${D},${D}\\)$`), Yt = new RegExp(`^rgba\\(${X},${X},${X},${J}\\)$`), Wt = new RegExp(`^rgba\\(${D},${D},${D},${J}\\)$`), Xt = new RegExp(`^hsl\\(${J},${D},${D}\\)$`), Qt = new RegExp(`^hsla\\(${J},${D},${D},${J}\\)$`), Oe = {
1258
+ var J = 0.7, de = 1 / J, Q = "\\s*([+-]?\\d+)\\s*", P = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", I = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Bt = /^#([0-9a-f]{3,8})$/, Wt = new RegExp(`^rgb\\(${Q},${Q},${Q}\\)$`), Yt = new RegExp(`^rgb\\(${I},${I},${I}\\)$`), Xt = new RegExp(`^rgba\\(${Q},${Q},${Q},${P}\\)$`), Qt = new RegExp(`^rgba\\(${I},${I},${I},${P}\\)$`), Zt = new RegExp(`^hsl\\(${P},${I},${I}\\)$`), Jt = new RegExp(`^hsla\\(${P},${I},${I},${P}\\)$`), Ue = {
1110
1259
  aliceblue: 15792383,
1111
1260
  antiquewhite: 16444375,
1112
1261
  aqua: 65535,
@@ -1256,280 +1405,280 @@ var Z = 0.7, de = 1 / Z, X = "\\s*([+-]?\\d+)\\s*", J = "\\s*([+-]?(?:\\d*\\.)?\
1256
1405
  yellow: 16776960,
1257
1406
  yellowgreen: 10145074
1258
1407
  };
1259
- $e(ee, P, {
1408
+ je(te, C, {
1260
1409
  copy(e) {
1261
1410
  return Object.assign(new this.constructor(), this, e);
1262
1411
  },
1263
1412
  displayable() {
1264
1413
  return this.rgb().displayable();
1265
1414
  },
1266
- hex: Ge,
1415
+ hex: qe,
1267
1416
  // Deprecated! Use color.formatHex.
1268
- formatHex: Ge,
1269
- formatHex8: Zt,
1270
- formatHsl: Jt,
1271
- formatRgb: Ue,
1272
- toString: Ue
1417
+ formatHex: qe,
1418
+ formatHex8: Pt,
1419
+ formatHsl: Ct,
1420
+ formatRgb: Ke,
1421
+ toString: Ke
1273
1422
  });
1274
- function Ge() {
1423
+ function qe() {
1275
1424
  return this.rgb().formatHex();
1276
1425
  }
1277
- function Zt() {
1426
+ function Pt() {
1278
1427
  return this.rgb().formatHex8();
1279
1428
  }
1280
- function Jt() {
1281
- return rt(this).formatHsl();
1429
+ function Ct() {
1430
+ return ot(this).formatHsl();
1282
1431
  }
1283
- function Ue() {
1432
+ function Ke() {
1284
1433
  return this.rgb().formatRgb();
1285
1434
  }
1286
- function P(e) {
1287
- var t, n;
1288
- return e = (e + "").trim().toLowerCase(), (t = _t.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? qe(t) : n === 3 ? new j(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? ie(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ie(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Bt.exec(e)) ? new j(t[1], t[2], t[3], 1) : (t = Kt.exec(e)) ? new j(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = Yt.exec(e)) ? ie(t[1], t[2], t[3], t[4]) : (t = Wt.exec(e)) ? ie(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Xt.exec(e)) ? Be(t[1], t[2] / 100, t[3] / 100, 1) : (t = Qt.exec(e)) ? Be(t[1], t[2] / 100, t[3] / 100, t[4]) : Oe.hasOwnProperty(e) ? qe(Oe[e]) : e === "transparent" ? new j(NaN, NaN, NaN, 0) : null;
1435
+ function C(e) {
1436
+ var t, r;
1437
+ return e = (e + "").trim().toLowerCase(), (t = Bt.exec(e)) ? (r = t[1].length, t = parseInt(t[1], 16), r === 6 ? Be(t) : r === 3 ? new j(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : r === 8 ? ae(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : r === 4 ? ae(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Wt.exec(e)) ? new j(t[1], t[2], t[3], 1) : (t = Yt.exec(e)) ? new j(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = Xt.exec(e)) ? ae(t[1], t[2], t[3], t[4]) : (t = Qt.exec(e)) ? ae(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Zt.exec(e)) ? Xe(t[1], t[2] / 100, t[3] / 100, 1) : (t = Jt.exec(e)) ? Xe(t[1], t[2] / 100, t[3] / 100, t[4]) : Ue.hasOwnProperty(e) ? Be(Ue[e]) : e === "transparent" ? new j(NaN, NaN, NaN, 0) : null;
1289
1438
  }
1290
- function qe(e) {
1439
+ function Be(e) {
1291
1440
  return new j(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
1292
1441
  }
1293
- function ie(e, t, n, r) {
1294
- return r <= 0 && (e = t = n = NaN), new j(e, t, n, r);
1442
+ function ae(e, t, r, n) {
1443
+ return n <= 0 && (e = t = r = NaN), new j(e, t, r, n);
1295
1444
  }
1296
- function Pt(e) {
1297
- return e instanceof ee || (e = P(e)), e ? (e = e.rgb(), new j(e.r, e.g, e.b, e.opacity)) : new j();
1445
+ function er(e) {
1446
+ return e instanceof te || (e = C(e)), e ? (e = e.rgb(), new j(e.r, e.g, e.b, e.opacity)) : new j();
1298
1447
  }
1299
- function Ae(e, t, n, r) {
1300
- return arguments.length === 1 ? Pt(e) : new j(e, t, n, r ?? 1);
1448
+ function Se(e, t, r, n) {
1449
+ return arguments.length === 1 ? er(e) : new j(e, t, r, n ?? 1);
1301
1450
  }
1302
- function j(e, t, n, r) {
1303
- this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
1451
+ function j(e, t, r, n) {
1452
+ this.r = +e, this.g = +t, this.b = +r, this.opacity = +n;
1304
1453
  }
1305
- $e(j, Ae, nt(ee, {
1454
+ je(j, Se, lt(te, {
1306
1455
  brighter(e) {
1307
1456
  return e = e == null ? de : Math.pow(de, e), new j(this.r * e, this.g * e, this.b * e, this.opacity);
1308
1457
  },
1309
1458
  darker(e) {
1310
- return e = e == null ? Z : Math.pow(Z, e), new j(this.r * e, this.g * e, this.b * e, this.opacity);
1459
+ return e = e == null ? J : Math.pow(J, e), new j(this.r * e, this.g * e, this.b * e, this.opacity);
1311
1460
  },
1312
1461
  rgb() {
1313
1462
  return this;
1314
1463
  },
1315
1464
  clamp() {
1316
- return new j(_(this.r), _(this.g), _(this.b), ue(this.opacity));
1465
+ return new j(K(this.r), K(this.g), K(this.b), fe(this.opacity));
1317
1466
  },
1318
1467
  displayable() {
1319
1468
  return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
1320
1469
  },
1321
- hex: Ve,
1470
+ hex: We,
1322
1471
  // Deprecated! Use color.formatHex.
1323
- formatHex: Ve,
1324
- formatHex8: Ct,
1325
- formatRgb: _e,
1326
- toString: _e
1472
+ formatHex: We,
1473
+ formatHex8: tr,
1474
+ formatRgb: Ye,
1475
+ toString: Ye
1327
1476
  }));
1328
- function Ve() {
1329
- return `#${V(this.r)}${V(this.g)}${V(this.b)}`;
1477
+ function We() {
1478
+ return `#${U(this.r)}${U(this.g)}${U(this.b)}`;
1330
1479
  }
1331
- function Ct() {
1332
- return `#${V(this.r)}${V(this.g)}${V(this.b)}${V((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
1480
+ function tr() {
1481
+ return `#${U(this.r)}${U(this.g)}${U(this.b)}${U((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
1333
1482
  }
1334
- function _e() {
1335
- const e = ue(this.opacity);
1336
- return `${e === 1 ? "rgb(" : "rgba("}${_(this.r)}, ${_(this.g)}, ${_(this.b)}${e === 1 ? ")" : `, ${e})`}`;
1483
+ function Ye() {
1484
+ const e = fe(this.opacity);
1485
+ return `${e === 1 ? "rgb(" : "rgba("}${K(this.r)}, ${K(this.g)}, ${K(this.b)}${e === 1 ? ")" : `, ${e})`}`;
1337
1486
  }
1338
- function ue(e) {
1487
+ function fe(e) {
1339
1488
  return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
1340
1489
  }
1341
- function _(e) {
1490
+ function K(e) {
1342
1491
  return Math.max(0, Math.min(255, Math.round(e) || 0));
1343
1492
  }
1344
- function V(e) {
1345
- return e = _(e), (e < 16 ? "0" : "") + e.toString(16);
1493
+ function U(e) {
1494
+ return e = K(e), (e < 16 ? "0" : "") + e.toString(16);
1346
1495
  }
1347
- function Be(e, t, n, r) {
1348
- return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new E(e, t, n, r);
1496
+ function Xe(e, t, r, n) {
1497
+ return n <= 0 ? e = t = r = NaN : r <= 0 || r >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new D(e, t, r, n);
1349
1498
  }
1350
- function rt(e) {
1351
- if (e instanceof E) return new E(e.h, e.s, e.l, e.opacity);
1352
- if (e instanceof ee || (e = P(e)), !e) return new E();
1353
- if (e instanceof E) return e;
1499
+ function ot(e) {
1500
+ if (e instanceof D) return new D(e.h, e.s, e.l, e.opacity);
1501
+ if (e instanceof te || (e = C(e)), !e) return new D();
1502
+ if (e instanceof D) return e;
1354
1503
  e = e.rgb();
1355
- var t = e.r / 255, n = e.g / 255, r = e.b / 255, s = Math.min(t, n, r), a = Math.max(t, n, r), l = NaN, c = a - s, d = (a + s) / 2;
1356
- return c ? (t === a ? l = (n - r) / c + (n < r) * 6 : n === a ? l = (r - t) / c + 2 : l = (t - n) / c + 4, c /= d < 0.5 ? a + s : 2 - a - s, l *= 60) : c = d > 0 && d < 1 ? 0 : l, new E(l, c, d, e.opacity);
1504
+ var t = e.r / 255, r = e.g / 255, n = e.b / 255, s = Math.min(t, r, n), a = Math.max(t, r, n), l = NaN, c = a - s, u = (a + s) / 2;
1505
+ return c ? (t === a ? l = (r - n) / c + (r < n) * 6 : r === a ? l = (n - t) / c + 2 : l = (t - r) / c + 4, c /= u < 0.5 ? a + s : 2 - a - s, l *= 60) : c = u > 0 && u < 1 ? 0 : l, new D(l, c, u, e.opacity);
1357
1506
  }
1358
- function en(e, t, n, r) {
1359
- return arguments.length === 1 ? rt(e) : new E(e, t, n, r ?? 1);
1507
+ function rr(e, t, r, n) {
1508
+ return arguments.length === 1 ? ot(e) : new D(e, t, r, n ?? 1);
1360
1509
  }
1361
- function E(e, t, n, r) {
1362
- this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
1510
+ function D(e, t, r, n) {
1511
+ this.h = +e, this.s = +t, this.l = +r, this.opacity = +n;
1363
1512
  }
1364
- $e(E, en, nt(ee, {
1513
+ je(D, rr, lt(te, {
1365
1514
  brighter(e) {
1366
- return e = e == null ? de : Math.pow(de, e), new E(this.h, this.s, this.l * e, this.opacity);
1515
+ return e = e == null ? de : Math.pow(de, e), new D(this.h, this.s, this.l * e, this.opacity);
1367
1516
  },
1368
1517
  darker(e) {
1369
- return e = e == null ? Z : Math.pow(Z, e), new E(this.h, this.s, this.l * e, this.opacity);
1518
+ return e = e == null ? J : Math.pow(J, e), new D(this.h, this.s, this.l * e, this.opacity);
1370
1519
  },
1371
1520
  rgb() {
1372
- var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, s = 2 * n - r;
1521
+ var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, r = this.l, n = r + (r < 0.5 ? r : 1 - r) * t, s = 2 * r - n;
1373
1522
  return new j(
1374
- be(e >= 240 ? e - 240 : e + 120, s, r),
1375
- be(e, s, r),
1376
- be(e < 120 ? e + 240 : e - 120, s, r),
1523
+ be(e >= 240 ? e - 240 : e + 120, s, n),
1524
+ be(e, s, n),
1525
+ be(e < 120 ? e + 240 : e - 120, s, n),
1377
1526
  this.opacity
1378
1527
  );
1379
1528
  },
1380
1529
  clamp() {
1381
- return new E(Ke(this.h), ae(this.s), ae(this.l), ue(this.opacity));
1530
+ return new D(Qe(this.h), le(this.s), le(this.l), fe(this.opacity));
1382
1531
  },
1383
1532
  displayable() {
1384
1533
  return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
1385
1534
  },
1386
1535
  formatHsl() {
1387
- const e = ue(this.opacity);
1388
- return `${e === 1 ? "hsl(" : "hsla("}${Ke(this.h)}, ${ae(this.s) * 100}%, ${ae(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
1536
+ const e = fe(this.opacity);
1537
+ return `${e === 1 ? "hsl(" : "hsla("}${Qe(this.h)}, ${le(this.s) * 100}%, ${le(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
1389
1538
  }
1390
1539
  }));
1391
- function Ke(e) {
1540
+ function Qe(e) {
1392
1541
  return e = (e || 0) % 360, e < 0 ? e + 360 : e;
1393
1542
  }
1394
- function ae(e) {
1543
+ function le(e) {
1395
1544
  return Math.max(0, Math.min(1, e || 0));
1396
1545
  }
1397
- function be(e, t, n) {
1398
- return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
1546
+ function be(e, t, r) {
1547
+ return (e < 60 ? t + (r - t) * e / 60 : e < 180 ? r : e < 240 ? t + (r - t) * (240 - e) / 60 : t) * 255;
1399
1548
  }
1400
- const Le = (e) => () => e;
1401
- function tn(e, t) {
1402
- return function(n) {
1403
- return e + n * t;
1549
+ const ze = (e) => () => e;
1550
+ function nr(e, t) {
1551
+ return function(r) {
1552
+ return e + r * t;
1404
1553
  };
1405
1554
  }
1406
- function nn(e, t, n) {
1407
- return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) {
1408
- return Math.pow(e + r * t, n);
1555
+ function sr(e, t, r) {
1556
+ return e = Math.pow(e, r), t = Math.pow(t, r) - e, r = 1 / r, function(n) {
1557
+ return Math.pow(e + n * t, r);
1409
1558
  };
1410
1559
  }
1411
- function rn(e) {
1412
- return (e = +e) == 1 ? st : function(t, n) {
1413
- return n - t ? nn(t, n, e) : Le(isNaN(t) ? n : t);
1560
+ function ir(e) {
1561
+ return (e = +e) == 1 ? ct : function(t, r) {
1562
+ return r - t ? sr(t, r, e) : ze(isNaN(t) ? r : t);
1414
1563
  };
1415
1564
  }
1416
- function st(e, t) {
1417
- var n = t - e;
1418
- return n ? tn(e, n) : Le(isNaN(e) ? t : e);
1565
+ function ct(e, t) {
1566
+ var r = t - e;
1567
+ return r ? nr(e, r) : ze(isNaN(e) ? t : e);
1419
1568
  }
1420
- const Ye = function e(t) {
1421
- var n = rn(t);
1422
- function r(s, a) {
1423
- var l = n((s = Ae(s)).r, (a = Ae(a)).r), c = n(s.g, a.g), d = n(s.b, a.b), o = st(s.opacity, a.opacity);
1424
- return function(u) {
1425
- return s.r = l(u), s.g = c(u), s.b = d(u), s.opacity = o(u), s + "";
1569
+ const Ze = function e(t) {
1570
+ var r = ir(t);
1571
+ function n(s, a) {
1572
+ var l = r((s = Se(s)).r, (a = Se(a)).r), c = r(s.g, a.g), u = r(s.b, a.b), o = ct(s.opacity, a.opacity);
1573
+ return function(d) {
1574
+ return s.r = l(d), s.g = c(d), s.b = u(d), s.opacity = o(d), s + "";
1426
1575
  };
1427
1576
  }
1428
- return r.gamma = e, r;
1577
+ return n.gamma = e, n;
1429
1578
  }(1);
1430
- function sn(e, t) {
1579
+ function ar(e, t) {
1431
1580
  t || (t = []);
1432
- var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), s;
1581
+ var r = e ? Math.min(t.length, e.length) : 0, n = t.slice(), s;
1433
1582
  return function(a) {
1434
- for (s = 0; s < n; ++s) r[s] = e[s] * (1 - a) + t[s] * a;
1435
- return r;
1583
+ for (s = 0; s < r; ++s) n[s] = e[s] * (1 - a) + t[s] * a;
1584
+ return n;
1436
1585
  };
1437
1586
  }
1438
- function an(e) {
1587
+ function lr(e) {
1439
1588
  return ArrayBuffer.isView(e) && !(e instanceof DataView);
1440
1589
  }
1441
- function ln(e, t) {
1442
- var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, s = new Array(r), a = new Array(n), l;
1443
- for (l = 0; l < r; ++l) s[l] = Te(e[l], t[l]);
1444
- for (; l < n; ++l) a[l] = t[l];
1590
+ function or(e, t) {
1591
+ var r = t ? t.length : 0, n = e ? Math.min(r, e.length) : 0, s = new Array(n), a = new Array(r), l;
1592
+ for (l = 0; l < n; ++l) s[l] = Ee(e[l], t[l]);
1593
+ for (; l < r; ++l) a[l] = t[l];
1445
1594
  return function(c) {
1446
- for (l = 0; l < r; ++l) a[l] = s[l](c);
1595
+ for (l = 0; l < n; ++l) a[l] = s[l](c);
1447
1596
  return a;
1448
1597
  };
1449
1598
  }
1450
- function on(e, t) {
1451
- var n = /* @__PURE__ */ new Date();
1452
- return e = +e, t = +t, function(r) {
1453
- return n.setTime(e * (1 - r) + t * r), n;
1599
+ function cr(e, t) {
1600
+ var r = /* @__PURE__ */ new Date();
1601
+ return e = +e, t = +t, function(n) {
1602
+ return r.setTime(e * (1 - n) + t * n), r;
1454
1603
  };
1455
1604
  }
1456
- function fe(e, t) {
1457
- return e = +e, t = +t, function(n) {
1458
- return e * (1 - n) + t * n;
1605
+ function me(e, t) {
1606
+ return e = +e, t = +t, function(r) {
1607
+ return e * (1 - r) + t * r;
1459
1608
  };
1460
1609
  }
1461
- function cn(e, t) {
1462
- var n = {}, r = {}, s;
1610
+ function ur(e, t) {
1611
+ var r = {}, n = {}, s;
1463
1612
  (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {});
1464
1613
  for (s in t)
1465
- s in e ? n[s] = Te(e[s], t[s]) : r[s] = t[s];
1614
+ s in e ? r[s] = Ee(e[s], t[s]) : n[s] = t[s];
1466
1615
  return function(a) {
1467
- for (s in n) r[s] = n[s](a);
1468
- return r;
1616
+ for (s in r) n[s] = r[s](a);
1617
+ return n;
1469
1618
  };
1470
1619
  }
1471
- var Se = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ge = new RegExp(Se.source, "g");
1472
- function dn(e) {
1620
+ var ke = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, we = new RegExp(ke.source, "g");
1621
+ function dr(e) {
1473
1622
  return function() {
1474
1623
  return e;
1475
1624
  };
1476
1625
  }
1477
- function un(e) {
1626
+ function fr(e) {
1478
1627
  return function(t) {
1479
1628
  return e(t) + "";
1480
1629
  };
1481
1630
  }
1482
- function fn(e, t) {
1483
- var n = Se.lastIndex = ge.lastIndex = 0, r, s, a, l = -1, c = [], d = [];
1484
- for (e = e + "", t = t + ""; (r = Se.exec(e)) && (s = ge.exec(t)); )
1485
- (a = s.index) > n && (a = t.slice(n, a), c[l] ? c[l] += a : c[++l] = a), (r = r[0]) === (s = s[0]) ? c[l] ? c[l] += s : c[++l] = s : (c[++l] = null, d.push({ i: l, x: fe(r, s) })), n = ge.lastIndex;
1486
- return n < t.length && (a = t.slice(n), c[l] ? c[l] += a : c[++l] = a), c.length < 2 ? d[0] ? un(d[0].x) : dn(t) : (t = d.length, function(o) {
1487
- for (var u = 0, f; u < t; ++u) c[(f = d[u]).i] = f.x(o);
1631
+ function mr(e, t) {
1632
+ var r = ke.lastIndex = we.lastIndex = 0, n, s, a, l = -1, c = [], u = [];
1633
+ for (e = e + "", t = t + ""; (n = ke.exec(e)) && (s = we.exec(t)); )
1634
+ (a = s.index) > r && (a = t.slice(r, a), c[l] ? c[l] += a : c[++l] = a), (n = n[0]) === (s = s[0]) ? c[l] ? c[l] += s : c[++l] = s : (c[++l] = null, u.push({ i: l, x: me(n, s) })), r = we.lastIndex;
1635
+ return r < t.length && (a = t.slice(r), c[l] ? c[l] += a : c[++l] = a), c.length < 2 ? u[0] ? fr(u[0].x) : dr(t) : (t = u.length, function(o) {
1636
+ for (var d = 0, f; d < t; ++d) c[(f = u[d]).i] = f.x(o);
1488
1637
  return c.join("");
1489
1638
  });
1490
1639
  }
1491
- function Te(e, t) {
1492
- var n = typeof t, r;
1493
- return t == null || n === "boolean" ? Le(t) : (n === "number" ? fe : n === "string" ? (r = P(t)) ? (t = r, Ye) : fn : t instanceof P ? Ye : t instanceof Date ? on : an(t) ? sn : Array.isArray(t) ? ln : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? cn : fe)(e, t);
1640
+ function Ee(e, t) {
1641
+ var r = typeof t, n;
1642
+ return t == null || r === "boolean" ? ze(t) : (r === "number" ? me : r === "string" ? (n = C(t)) ? (t = n, Ze) : mr : t instanceof C ? Ze : t instanceof Date ? cr : lr(t) ? ar : Array.isArray(t) ? or : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? ur : me)(e, t);
1494
1643
  }
1495
- function mn(e, t) {
1496
- return e = +e, t = +t, function(n) {
1497
- return Math.round(e * (1 - n) + t * n);
1644
+ function xr(e, t) {
1645
+ return e = +e, t = +t, function(r) {
1646
+ return Math.round(e * (1 - r) + t * r);
1498
1647
  };
1499
1648
  }
1500
- function xn(e) {
1649
+ function hr(e) {
1501
1650
  return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
1502
1651
  }
1503
- function me(e, t) {
1504
- if ((n = (e = t ? e.toExponential(t - 1) : e.toExponential()).indexOf("e")) < 0) return null;
1505
- var n, r = e.slice(0, n);
1652
+ function xe(e, t) {
1653
+ if ((r = (e = t ? e.toExponential(t - 1) : e.toExponential()).indexOf("e")) < 0) return null;
1654
+ var r, n = e.slice(0, r);
1506
1655
  return [
1507
- r.length > 1 ? r[0] + r.slice(2) : r,
1508
- +e.slice(n + 1)
1656
+ n.length > 1 ? n[0] + n.slice(2) : n,
1657
+ +e.slice(r + 1)
1509
1658
  ];
1510
1659
  }
1511
- function Q(e) {
1512
- return e = me(Math.abs(e)), e ? e[1] : NaN;
1660
+ function Z(e) {
1661
+ return e = xe(Math.abs(e)), e ? e[1] : NaN;
1513
1662
  }
1514
- function hn(e, t) {
1515
- return function(n, r) {
1516
- for (var s = n.length, a = [], l = 0, c = e[0], d = 0; s > 0 && c > 0 && (d + c + 1 > r && (c = Math.max(1, r - d)), a.push(n.substring(s -= c, s + c)), !((d += c + 1) > r)); )
1663
+ function yr(e, t) {
1664
+ return function(r, n) {
1665
+ for (var s = r.length, a = [], l = 0, c = e[0], u = 0; s > 0 && c > 0 && (u + c + 1 > n && (c = Math.max(1, n - u)), a.push(r.substring(s -= c, s + c)), !((u += c + 1) > n)); )
1517
1666
  c = e[l = (l + 1) % e.length];
1518
1667
  return a.reverse().join(t);
1519
1668
  };
1520
1669
  }
1521
- function yn(e) {
1670
+ function pr(e) {
1522
1671
  return function(t) {
1523
- return t.replace(/[0-9]/g, function(n) {
1524
- return e[+n];
1672
+ return t.replace(/[0-9]/g, function(r) {
1673
+ return e[+r];
1525
1674
  });
1526
1675
  };
1527
1676
  }
1528
- var pn = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
1529
- function xe(e) {
1530
- if (!(t = pn.exec(e))) throw new Error("invalid format: " + e);
1677
+ var vr = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
1678
+ function he(e) {
1679
+ if (!(t = vr.exec(e))) throw new Error("invalid format: " + e);
1531
1680
  var t;
1532
- return new Fe({
1681
+ return new De({
1533
1682
  fill: t[1],
1534
1683
  align: t[2],
1535
1684
  sign: t[3],
@@ -1542,98 +1691,98 @@ function xe(e) {
1542
1691
  type: t[10]
1543
1692
  });
1544
1693
  }
1545
- xe.prototype = Fe.prototype;
1546
- function Fe(e) {
1694
+ he.prototype = De.prototype;
1695
+ function De(e) {
1547
1696
  this.fill = e.fill === void 0 ? " " : e.fill + "", this.align = e.align === void 0 ? ">" : e.align + "", this.sign = e.sign === void 0 ? "-" : e.sign + "", this.symbol = e.symbol === void 0 ? "" : e.symbol + "", this.zero = !!e.zero, this.width = e.width === void 0 ? void 0 : +e.width, this.comma = !!e.comma, this.precision = e.precision === void 0 ? void 0 : +e.precision, this.trim = !!e.trim, this.type = e.type === void 0 ? "" : e.type + "";
1548
1697
  }
1549
- Fe.prototype.toString = function() {
1698
+ De.prototype.toString = function() {
1550
1699
  return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
1551
1700
  };
1552
- function vn(e) {
1553
- e: for (var t = e.length, n = 1, r = -1, s; n < t; ++n)
1554
- switch (e[n]) {
1701
+ function gr(e) {
1702
+ e: for (var t = e.length, r = 1, n = -1, s; r < t; ++r)
1703
+ switch (e[r]) {
1555
1704
  case ".":
1556
- r = s = n;
1705
+ n = s = r;
1557
1706
  break;
1558
1707
  case "0":
1559
- r === 0 && (r = n), s = n;
1708
+ n === 0 && (n = r), s = r;
1560
1709
  break;
1561
1710
  default:
1562
- if (!+e[n]) break e;
1563
- r > 0 && (r = 0);
1711
+ if (!+e[r]) break e;
1712
+ n > 0 && (n = 0);
1564
1713
  break;
1565
1714
  }
1566
- return r > 0 ? e.slice(0, r) + e.slice(s + 1) : e;
1567
- }
1568
- var it;
1569
- function bn(e, t) {
1570
- var n = me(e, t);
1571
- if (!n) return e + "";
1572
- var r = n[0], s = n[1], a = s - (it = Math.max(-8, Math.min(8, Math.floor(s / 3))) * 3) + 1, l = r.length;
1573
- return a === l ? r : a > l ? r + new Array(a - l + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + new Array(1 - a).join("0") + me(e, Math.max(0, t + a - 1))[0];
1574
- }
1575
- function We(e, t) {
1576
- var n = me(e, t);
1577
- if (!n) return e + "";
1578
- var r = n[0], s = n[1];
1579
- return s < 0 ? "0." + new Array(-s).join("0") + r : r.length > s + 1 ? r.slice(0, s + 1) + "." + r.slice(s + 1) : r + new Array(s - r.length + 2).join("0");
1580
- }
1581
- const Xe = {
1715
+ return n > 0 ? e.slice(0, n) + e.slice(s + 1) : e;
1716
+ }
1717
+ var ut;
1718
+ function br(e, t) {
1719
+ var r = xe(e, t);
1720
+ if (!r) return e + "";
1721
+ var n = r[0], s = r[1], a = s - (ut = Math.max(-8, Math.min(8, Math.floor(s / 3))) * 3) + 1, l = n.length;
1722
+ return a === l ? n : a > l ? n + new Array(a - l + 1).join("0") : a > 0 ? n.slice(0, a) + "." + n.slice(a) : "0." + new Array(1 - a).join("0") + xe(e, Math.max(0, t + a - 1))[0];
1723
+ }
1724
+ function Je(e, t) {
1725
+ var r = xe(e, t);
1726
+ if (!r) return e + "";
1727
+ var n = r[0], s = r[1];
1728
+ return s < 0 ? "0." + new Array(-s).join("0") + n : n.length > s + 1 ? n.slice(0, s + 1) + "." + n.slice(s + 1) : n + new Array(s - n.length + 2).join("0");
1729
+ }
1730
+ const Pe = {
1582
1731
  "%": (e, t) => (e * 100).toFixed(t),
1583
1732
  b: (e) => Math.round(e).toString(2),
1584
1733
  c: (e) => e + "",
1585
- d: xn,
1734
+ d: hr,
1586
1735
  e: (e, t) => e.toExponential(t),
1587
1736
  f: (e, t) => e.toFixed(t),
1588
1737
  g: (e, t) => e.toPrecision(t),
1589
1738
  o: (e) => Math.round(e).toString(8),
1590
- p: (e, t) => We(e * 100, t),
1591
- r: We,
1592
- s: bn,
1739
+ p: (e, t) => Je(e * 100, t),
1740
+ r: Je,
1741
+ s: br,
1593
1742
  X: (e) => Math.round(e).toString(16).toUpperCase(),
1594
1743
  x: (e) => Math.round(e).toString(16)
1595
1744
  };
1596
- function Qe(e) {
1745
+ function Ce(e) {
1597
1746
  return e;
1598
1747
  }
1599
- var Ze = Array.prototype.map, Je = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
1600
- function gn(e) {
1601
- var t = e.grouping === void 0 || e.thousands === void 0 ? Qe : hn(Ze.call(e.grouping, Number), e.thousands + ""), n = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", s = e.decimal === void 0 ? "." : e.decimal + "", a = e.numerals === void 0 ? Qe : yn(Ze.call(e.numerals, String)), l = e.percent === void 0 ? "%" : e.percent + "", c = e.minus === void 0 ? "−" : e.minus + "", d = e.nan === void 0 ? "NaN" : e.nan + "";
1748
+ var et = Array.prototype.map, tt = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
1749
+ function wr(e) {
1750
+ var t = e.grouping === void 0 || e.thousands === void 0 ? Ce : yr(et.call(e.grouping, Number), e.thousands + ""), r = e.currency === void 0 ? "" : e.currency[0] + "", n = e.currency === void 0 ? "" : e.currency[1] + "", s = e.decimal === void 0 ? "." : e.decimal + "", a = e.numerals === void 0 ? Ce : pr(et.call(e.numerals, String)), l = e.percent === void 0 ? "%" : e.percent + "", c = e.minus === void 0 ? "−" : e.minus + "", u = e.nan === void 0 ? "NaN" : e.nan + "";
1602
1751
  function o(f) {
1603
- f = xe(f);
1604
- var m = f.fill, w = f.align, x = f.sign, v = f.symbol, p = f.zero, S = f.width, k = f.comma, h = f.precision, y = f.trim, g = f.type;
1605
- g === "n" ? (k = !0, g = "g") : Xe[g] || (h === void 0 && (h = 12), y = !0, g = "g"), (p || m === "0" && w === "=") && (p = !0, m = "0", w = "=");
1606
- var N = v === "$" ? n : v === "#" && /[boxX]/.test(g) ? "0" + g.toLowerCase() : "", A = v === "$" ? r : /[%p]/.test(g) ? l : "", $ = Xe[g], L = /[defgprs%]/.test(g);
1607
- h = h === void 0 ? 6 : /[gprs]/.test(g) ? Math.max(1, Math.min(21, h)) : Math.max(0, Math.min(20, h));
1752
+ f = he(f);
1753
+ var m = f.fill, A = f.align, x = f.sign, N = f.symbol, g = f.zero, S = f.width, T = f.comma, h = f.precision, b = f.trim, y = f.type;
1754
+ y === "n" ? (T = !0, y = "g") : Pe[y] || (h === void 0 && (h = 12), b = !0, y = "g"), (g || m === "0" && A === "=") && (g = !0, m = "0", A = "=");
1755
+ var p = N === "$" ? r : N === "#" && /[boxX]/.test(y) ? "0" + y.toLowerCase() : "", v = N === "$" ? n : /[%p]/.test(y) ? l : "", k = Pe[y], $ = /[defgprs%]/.test(y);
1756
+ h = h === void 0 ? 6 : /[gprs]/.test(y) ? Math.max(1, Math.min(21, h)) : Math.max(0, Math.min(20, h));
1608
1757
  function F(M) {
1609
- var H = N, z = A, Y, ze, te;
1610
- if (g === "c")
1611
- z = $(M) + z, M = "";
1758
+ var E = p, z = v, Y, Ie, re;
1759
+ if (y === "c")
1760
+ z = k(M) + z, M = "";
1612
1761
  else {
1613
1762
  M = +M;
1614
1763
  var ne = M < 0 || 1 / M < 0;
1615
- if (M = isNaN(M) ? d : $(Math.abs(M), h), y && (M = vn(M)), ne && +M == 0 && x !== "+" && (ne = !1), H = (ne ? x === "(" ? x : c : x === "-" || x === "(" ? "" : x) + H, z = (g === "s" ? Je[8 + it / 3] : "") + z + (ne && x === "(" ? ")" : ""), L) {
1616
- for (Y = -1, ze = M.length; ++Y < ze; )
1617
- if (te = M.charCodeAt(Y), 48 > te || te > 57) {
1618
- z = (te === 46 ? s + M.slice(Y + 1) : M.slice(Y)) + z, M = M.slice(0, Y);
1764
+ if (M = isNaN(M) ? u : k(Math.abs(M), h), b && (M = gr(M)), ne && +M == 0 && x !== "+" && (ne = !1), E = (ne ? x === "(" ? x : c : x === "-" || x === "(" ? "" : x) + E, z = (y === "s" ? tt[8 + ut / 3] : "") + z + (ne && x === "(" ? ")" : ""), $) {
1765
+ for (Y = -1, Ie = M.length; ++Y < Ie; )
1766
+ if (re = M.charCodeAt(Y), 48 > re || re > 57) {
1767
+ z = (re === 46 ? s + M.slice(Y + 1) : M.slice(Y)) + z, M = M.slice(0, Y);
1619
1768
  break;
1620
1769
  }
1621
1770
  }
1622
1771
  }
1623
- k && !p && (M = t(M, 1 / 0));
1624
- var re = H.length + M.length + z.length, I = re < S ? new Array(S - re + 1).join(m) : "";
1625
- switch (k && p && (M = t(I + M, I.length ? S - z.length : 1 / 0), I = ""), w) {
1772
+ T && !g && (M = t(M, 1 / 0));
1773
+ var se = E.length + M.length + z.length, _ = se < S ? new Array(S - se + 1).join(m) : "";
1774
+ switch (T && g && (M = t(_ + M, _.length ? S - z.length : 1 / 0), _ = ""), A) {
1626
1775
  case "<":
1627
- M = H + M + z + I;
1776
+ M = E + M + z + _;
1628
1777
  break;
1629
1778
  case "=":
1630
- M = H + I + M + z;
1779
+ M = E + _ + M + z;
1631
1780
  break;
1632
1781
  case "^":
1633
- M = I.slice(0, re = I.length >> 1) + H + M + z + I.slice(re);
1782
+ M = _.slice(0, se = _.length >> 1) + E + M + z + _.slice(se);
1634
1783
  break;
1635
1784
  default:
1636
- M = I + H + M + z;
1785
+ M = _ + E + M + z;
1637
1786
  break;
1638
1787
  }
1639
1788
  return a(M);
@@ -1642,36 +1791,36 @@ function gn(e) {
1642
1791
  return f + "";
1643
1792
  }, F;
1644
1793
  }
1645
- function u(f, m) {
1646
- var w = o((f = xe(f), f.type = "f", f)), x = Math.max(-8, Math.min(8, Math.floor(Q(m) / 3))) * 3, v = Math.pow(10, -x), p = Je[8 + x / 3];
1794
+ function d(f, m) {
1795
+ var A = o((f = he(f), f.type = "f", f)), x = Math.max(-8, Math.min(8, Math.floor(Z(m) / 3))) * 3, N = Math.pow(10, -x), g = tt[8 + x / 3];
1647
1796
  return function(S) {
1648
- return w(v * S) + p;
1797
+ return A(N * S) + g;
1649
1798
  };
1650
1799
  }
1651
1800
  return {
1652
1801
  format: o,
1653
- formatPrefix: u
1802
+ formatPrefix: d
1654
1803
  };
1655
1804
  }
1656
- var le, at, lt;
1657
- wn({
1805
+ var oe, dt, ft;
1806
+ Nr({
1658
1807
  thousands: ",",
1659
1808
  grouping: [3],
1660
1809
  currency: ["$", ""]
1661
1810
  });
1662
- function wn(e) {
1663
- return le = gn(e), at = le.format, lt = le.formatPrefix, le;
1811
+ function Nr(e) {
1812
+ return oe = wr(e), dt = oe.format, ft = oe.formatPrefix, oe;
1664
1813
  }
1665
- function Nn(e) {
1666
- return Math.max(0, -Q(Math.abs(e)));
1814
+ function Ar(e) {
1815
+ return Math.max(0, -Z(Math.abs(e)));
1667
1816
  }
1668
- function An(e, t) {
1669
- return Math.max(0, Math.max(-8, Math.min(8, Math.floor(Q(t) / 3))) * 3 - Q(Math.abs(e)));
1817
+ function Sr(e, t) {
1818
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(Z(t) / 3))) * 3 - Z(Math.abs(e)));
1670
1819
  }
1671
- function Sn(e, t) {
1672
- return e = Math.abs(e), t = Math.abs(t) - e, Math.max(0, Q(t) - Q(e)) + 1;
1820
+ function kr(e, t) {
1821
+ return e = Math.abs(e), t = Math.abs(t) - e, Math.max(0, Z(t) - Z(e)) + 1;
1673
1822
  }
1674
- function je(e, t) {
1823
+ function Re(e, t) {
1675
1824
  switch (arguments.length) {
1676
1825
  case 0:
1677
1826
  break;
@@ -1684,292 +1833,292 @@ function je(e, t) {
1684
1833
  }
1685
1834
  return this;
1686
1835
  }
1687
- const Pe = Symbol("implicit");
1688
- function ot() {
1689
- var e = new He(), t = [], n = [], r = Pe;
1836
+ const rt = Symbol("implicit");
1837
+ function mt() {
1838
+ var e = new Ge(), t = [], r = [], n = rt;
1690
1839
  function s(a) {
1691
1840
  let l = e.get(a);
1692
1841
  if (l === void 0) {
1693
- if (r !== Pe) return r;
1842
+ if (n !== rt) return n;
1694
1843
  e.set(a, l = t.push(a) - 1);
1695
1844
  }
1696
- return n[l % n.length];
1845
+ return r[l % r.length];
1697
1846
  }
1698
1847
  return s.domain = function(a) {
1699
1848
  if (!arguments.length) return t.slice();
1700
- t = [], e = new He();
1849
+ t = [], e = new Ge();
1701
1850
  for (const l of a)
1702
1851
  e.has(l) || e.set(l, t.push(l) - 1);
1703
1852
  return s;
1704
1853
  }, s.range = function(a) {
1705
- return arguments.length ? (n = Array.from(a), s) : n.slice();
1854
+ return arguments.length ? (r = Array.from(a), s) : r.slice();
1706
1855
  }, s.unknown = function(a) {
1707
- return arguments.length ? (r = a, s) : r;
1856
+ return arguments.length ? (n = a, s) : n;
1708
1857
  }, s.copy = function() {
1709
- return ot(t, n).unknown(r);
1710
- }, je.apply(s, arguments), s;
1858
+ return mt(t, r).unknown(n);
1859
+ }, Re.apply(s, arguments), s;
1711
1860
  }
1712
- function Mn(e) {
1861
+ function Mr(e) {
1713
1862
  return function() {
1714
1863
  return e;
1715
1864
  };
1716
1865
  }
1717
- function kn(e) {
1866
+ function $r(e) {
1718
1867
  return +e;
1719
1868
  }
1720
- var Ce = [0, 1];
1721
- function W(e) {
1869
+ var nt = [0, 1];
1870
+ function X(e) {
1722
1871
  return e;
1723
1872
  }
1724
1873
  function Me(e, t) {
1725
- return (t -= e = +e) ? function(n) {
1726
- return (n - e) / t;
1727
- } : Mn(isNaN(t) ? NaN : 0.5);
1728
- }
1729
- function $n(e, t) {
1730
- var n;
1731
- return e > t && (n = e, e = t, t = n), function(r) {
1732
- return Math.max(e, Math.min(t, r));
1874
+ return (t -= e = +e) ? function(r) {
1875
+ return (r - e) / t;
1876
+ } : Mr(isNaN(t) ? NaN : 0.5);
1877
+ }
1878
+ function Lr(e, t) {
1879
+ var r;
1880
+ return e > t && (r = e, e = t, t = r), function(n) {
1881
+ return Math.max(e, Math.min(t, n));
1733
1882
  };
1734
1883
  }
1735
- function Ln(e, t, n) {
1736
- var r = e[0], s = e[1], a = t[0], l = t[1];
1737
- return s < r ? (r = Me(s, r), a = n(l, a)) : (r = Me(r, s), a = n(a, l)), function(c) {
1738
- return a(r(c));
1884
+ function Tr(e, t, r) {
1885
+ var n = e[0], s = e[1], a = t[0], l = t[1];
1886
+ return s < n ? (n = Me(s, n), a = r(l, a)) : (n = Me(n, s), a = r(a, l)), function(c) {
1887
+ return a(n(c));
1739
1888
  };
1740
1889
  }
1741
- function Tn(e, t, n) {
1742
- var r = Math.min(e.length, t.length) - 1, s = new Array(r), a = new Array(r), l = -1;
1743
- for (e[r] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++l < r; )
1744
- s[l] = Me(e[l], e[l + 1]), a[l] = n(t[l], t[l + 1]);
1890
+ function Fr(e, t, r) {
1891
+ var n = Math.min(e.length, t.length) - 1, s = new Array(n), a = new Array(n), l = -1;
1892
+ for (e[n] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++l < n; )
1893
+ s[l] = Me(e[l], e[l + 1]), a[l] = r(t[l], t[l + 1]);
1745
1894
  return function(c) {
1746
- var d = tt(e, c, 1, r) - 1;
1747
- return a[d](s[d](c));
1895
+ var u = at(e, c, 1, n) - 1;
1896
+ return a[u](s[u](c));
1748
1897
  };
1749
1898
  }
1750
- function Fn(e, t) {
1899
+ function jr(e, t) {
1751
1900
  return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
1752
1901
  }
1753
- function jn() {
1754
- var e = Ce, t = Ce, n = Te, r, s, a, l = W, c, d, o;
1755
- function u() {
1902
+ function zr() {
1903
+ var e = nt, t = nt, r = Ee, n, s, a, l = X, c, u, o;
1904
+ function d() {
1756
1905
  var m = Math.min(e.length, t.length);
1757
- return l !== W && (l = $n(e[0], e[m - 1])), c = m > 2 ? Tn : Ln, d = o = null, f;
1906
+ return l !== X && (l = Lr(e[0], e[m - 1])), c = m > 2 ? Fr : Tr, u = o = null, f;
1758
1907
  }
1759
1908
  function f(m) {
1760
- return m == null || isNaN(m = +m) ? a : (d || (d = c(e.map(r), t, n)))(r(l(m)));
1909
+ return m == null || isNaN(m = +m) ? a : (u || (u = c(e.map(n), t, r)))(n(l(m)));
1761
1910
  }
1762
1911
  return f.invert = function(m) {
1763
- return l(s((o || (o = c(t, e.map(r), fe)))(m)));
1912
+ return l(s((o || (o = c(t, e.map(n), me)))(m)));
1764
1913
  }, f.domain = function(m) {
1765
- return arguments.length ? (e = Array.from(m, kn), u()) : e.slice();
1914
+ return arguments.length ? (e = Array.from(m, $r), d()) : e.slice();
1766
1915
  }, f.range = function(m) {
1767
- return arguments.length ? (t = Array.from(m), u()) : t.slice();
1916
+ return arguments.length ? (t = Array.from(m), d()) : t.slice();
1768
1917
  }, f.rangeRound = function(m) {
1769
- return t = Array.from(m), n = mn, u();
1918
+ return t = Array.from(m), r = xr, d();
1770
1919
  }, f.clamp = function(m) {
1771
- return arguments.length ? (l = m ? !0 : W, u()) : l !== W;
1920
+ return arguments.length ? (l = m ? !0 : X, d()) : l !== X;
1772
1921
  }, f.interpolate = function(m) {
1773
- return arguments.length ? (n = m, u()) : n;
1922
+ return arguments.length ? (r = m, d()) : r;
1774
1923
  }, f.unknown = function(m) {
1775
1924
  return arguments.length ? (a = m, f) : a;
1776
- }, function(m, w) {
1777
- return r = m, s = w, u();
1925
+ }, function(m, A) {
1926
+ return n = m, s = A, d();
1778
1927
  };
1779
1928
  }
1780
- function zn() {
1781
- return jn()(W, W);
1929
+ function Er() {
1930
+ return zr()(X, X);
1782
1931
  }
1783
- function En(e, t, n, r) {
1784
- var s = Vt(e, t, n), a;
1785
- switch (r = xe(r ?? ",f"), r.type) {
1932
+ function Dr(e, t, r, n) {
1933
+ var s = Kt(e, t, r), a;
1934
+ switch (n = he(n ?? ",f"), n.type) {
1786
1935
  case "s": {
1787
1936
  var l = Math.max(Math.abs(e), Math.abs(t));
1788
- return r.precision == null && !isNaN(a = An(s, l)) && (r.precision = a), lt(r, l);
1937
+ return n.precision == null && !isNaN(a = Sr(s, l)) && (n.precision = a), ft(n, l);
1789
1938
  }
1790
1939
  case "":
1791
1940
  case "e":
1792
1941
  case "g":
1793
1942
  case "p":
1794
1943
  case "r": {
1795
- r.precision == null && !isNaN(a = Sn(s, Math.max(Math.abs(e), Math.abs(t)))) && (r.precision = a - (r.type === "e"));
1944
+ n.precision == null && !isNaN(a = kr(s, Math.max(Math.abs(e), Math.abs(t)))) && (n.precision = a - (n.type === "e"));
1796
1945
  break;
1797
1946
  }
1798
1947
  case "f":
1799
1948
  case "%": {
1800
- r.precision == null && !isNaN(a = Nn(s)) && (r.precision = a - (r.type === "%") * 2);
1949
+ n.precision == null && !isNaN(a = Ar(s)) && (n.precision = a - (n.type === "%") * 2);
1801
1950
  break;
1802
1951
  }
1803
1952
  }
1804
- return at(r);
1953
+ return dt(n);
1805
1954
  }
1806
- function ct(e) {
1955
+ function xt(e) {
1807
1956
  var t = e.domain;
1808
- return e.ticks = function(n) {
1809
- var r = t();
1810
- return qt(r[0], r[r.length - 1], n ?? 10);
1811
- }, e.tickFormat = function(n, r) {
1957
+ return e.ticks = function(r) {
1958
+ var n = t();
1959
+ return qt(n[0], n[n.length - 1], r ?? 10);
1960
+ }, e.tickFormat = function(r, n) {
1812
1961
  var s = t();
1813
- return En(s[0], s[s.length - 1], n ?? 10, r);
1814
- }, e.nice = function(n) {
1815
- n == null && (n = 10);
1816
- var r = t(), s = 0, a = r.length - 1, l = r[s], c = r[a], d, o, u = 10;
1817
- for (c < l && (o = l, l = c, c = o, o = s, s = a, a = o); u-- > 0; ) {
1818
- if (o = Ne(l, c, n), o === d)
1819
- return r[s] = l, r[a] = c, t(r);
1962
+ return Dr(s[0], s[s.length - 1], r ?? 10, n);
1963
+ }, e.nice = function(r) {
1964
+ r == null && (r = 10);
1965
+ var n = t(), s = 0, a = n.length - 1, l = n[s], c = n[a], u, o, d = 10;
1966
+ for (c < l && (o = l, l = c, c = o, o = s, s = a, a = o); d-- > 0; ) {
1967
+ if (o = Ae(l, c, r), o === u)
1968
+ return n[s] = l, n[a] = c, t(n);
1820
1969
  if (o > 0)
1821
1970
  l = Math.floor(l / o) * o, c = Math.ceil(c / o) * o;
1822
1971
  else if (o < 0)
1823
1972
  l = Math.ceil(l * o) / o, c = Math.floor(c * o) / o;
1824
1973
  else
1825
1974
  break;
1826
- d = o;
1975
+ u = o;
1827
1976
  }
1828
1977
  return e;
1829
1978
  }, e;
1830
1979
  }
1831
- function Rn() {
1832
- var e = zn();
1980
+ function Rr() {
1981
+ var e = Er();
1833
1982
  return e.copy = function() {
1834
- return Fn(e, Rn());
1835
- }, je.apply(e, arguments), ct(e);
1983
+ return jr(e, Rr());
1984
+ }, Re.apply(e, arguments), xt(e);
1836
1985
  }
1837
- function dt() {
1838
- var e = 0, t = 1, n = 1, r = [0.5], s = [0, 1], a;
1839
- function l(d) {
1840
- return d != null && d <= d ? s[tt(r, d, 0, n)] : a;
1986
+ function ht() {
1987
+ var e = 0, t = 1, r = 1, n = [0.5], s = [0, 1], a;
1988
+ function l(u) {
1989
+ return u != null && u <= u ? s[at(n, u, 0, r)] : a;
1841
1990
  }
1842
1991
  function c() {
1843
- var d = -1;
1844
- for (r = new Array(n); ++d < n; ) r[d] = ((d + 1) * t - (d - n) * e) / (n + 1);
1992
+ var u = -1;
1993
+ for (n = new Array(r); ++u < r; ) n[u] = ((u + 1) * t - (u - r) * e) / (r + 1);
1845
1994
  return l;
1846
1995
  }
1847
- return l.domain = function(d) {
1848
- return arguments.length ? ([e, t] = d, e = +e, t = +t, c()) : [e, t];
1849
- }, l.range = function(d) {
1850
- return arguments.length ? (n = (s = Array.from(d)).length - 1, c()) : s.slice();
1851
- }, l.invertExtent = function(d) {
1852
- var o = s.indexOf(d);
1853
- return o < 0 ? [NaN, NaN] : o < 1 ? [e, r[0]] : o >= n ? [r[n - 1], t] : [r[o - 1], r[o]];
1854
- }, l.unknown = function(d) {
1855
- return arguments.length && (a = d), l;
1996
+ return l.domain = function(u) {
1997
+ return arguments.length ? ([e, t] = u, e = +e, t = +t, c()) : [e, t];
1998
+ }, l.range = function(u) {
1999
+ return arguments.length ? (r = (s = Array.from(u)).length - 1, c()) : s.slice();
2000
+ }, l.invertExtent = function(u) {
2001
+ var o = s.indexOf(u);
2002
+ return o < 0 ? [NaN, NaN] : o < 1 ? [e, n[0]] : o >= r ? [n[r - 1], t] : [n[o - 1], n[o]];
2003
+ }, l.unknown = function(u) {
2004
+ return arguments.length && (a = u), l;
1856
2005
  }, l.thresholds = function() {
1857
- return r.slice();
2006
+ return n.slice();
1858
2007
  }, l.copy = function() {
1859
- return dt().domain([e, t]).range(s).unknown(a);
1860
- }, je.apply(ct(l), arguments);
2008
+ return ht().domain([e, t]).range(s).unknown(a);
2009
+ }, Re.apply(xt(l), arguments);
1861
2010
  }
1862
- function Xn({
2011
+ function Jr({
1863
2012
  data: e,
1864
2013
  chartConfig: t,
1865
- displayConfig: n = {},
1866
- queryObject: r,
2014
+ displayConfig: r = {},
2015
+ queryObject: n,
1867
2016
  height: s = "100%",
1868
2017
  colorPalette: a
1869
2018
  }) {
1870
- const [l, c] = G(null), { getFieldLabel: d } = K();
2019
+ const [l, c] = O(null), { getFieldLabel: u } = W();
1871
2020
  try {
1872
2021
  const o = {
1873
- showTooltip: (n == null ? void 0 : n.showTooltip) ?? !0,
1874
- showLegend: (n == null ? void 0 : n.showLegend) ?? !0
2022
+ showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0,
2023
+ showLegend: (r == null ? void 0 : r.showLegend) ?? !0
1875
2024
  };
1876
2025
  if (!e || e.length === 0)
1877
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
2026
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
1878
2027
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
1879
2028
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data points to display in treemap chart" })
1880
2029
  ] }) });
1881
- let u, f = !1, m;
2030
+ let d, f = !1, m;
1882
2031
  if (t != null && t.xAxis && (t != null && t.yAxis)) {
1883
- const h = t.xAxis[0], y = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis;
2032
+ const h = t.xAxis[0], b = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis;
1884
2033
  m = Array.isArray(t.series) ? t.series[0] : t.series;
1885
- const g = O(r, h);
2034
+ const y = H(n, h);
1886
2035
  if (m) {
1887
- const N = e.map((A) => {
1888
- const $ = A[m];
1889
- return typeof $ == "string" ? parseFloat($) : $;
1890
- }).filter((A) => !isNaN(A));
1891
- if (f = N.length === e.length && N.every((A) => typeof A == "number"), f) {
1892
- const A = Math.min(...N), $ = Math.max(...N), L = dt().domain([A, $]).range(se);
1893
- u = e.map((F) => {
1894
- const M = typeof F[m] == "string" ? parseFloat(F[m]) : F[m], H = L(M);
2036
+ const p = e.map((v) => {
2037
+ const k = v[m];
2038
+ return typeof k == "string" ? parseFloat(k) : k;
2039
+ }).filter((v) => !isNaN(v));
2040
+ if (f = p.length === e.length && p.every((v) => typeof v == "number"), f) {
2041
+ const v = Math.min(...p), k = Math.max(...p), $ = ht().domain([v, k]).range(ie);
2042
+ d = e.map((F) => {
2043
+ const M = typeof F[m] == "string" ? parseFloat(F[m]) : F[m], E = $(M);
1895
2044
  return {
1896
- name: R(F[h], g) || String(F[h]) || "Unknown",
1897
- size: typeof F[y] == "string" ? parseFloat(F[y]) : F[y] || 0,
1898
- fill: H,
2045
+ name: R(F[h], y) || String(F[h]) || "Unknown",
2046
+ size: typeof F[b] == "string" ? parseFloat(F[b]) : F[b] || 0,
2047
+ fill: E,
1899
2048
  series: String(F[m])
1900
2049
  };
1901
2050
  });
1902
2051
  } else {
1903
- const A = [...new Set(e.map((L) => String(L[m])))], $ = ot().domain(A).range((a == null ? void 0 : a.colors) || T);
1904
- u = e.map((L) => ({
1905
- name: R(L[h], g) || String(L[h]) || "Unknown",
1906
- size: typeof L[y] == "string" ? parseFloat(L[y]) : L[y] || 0,
1907
- fill: $(String(L[m])),
1908
- series: String(L[m])
2052
+ const v = [...new Set(e.map(($) => String($[m])))], k = mt().domain(v).range((a == null ? void 0 : a.colors) || L);
2053
+ d = e.map(($) => ({
2054
+ name: R($[h], y) || String($[h]) || "Unknown",
2055
+ size: typeof $[b] == "string" ? parseFloat($[b]) : $[b] || 0,
2056
+ fill: k(String($[m])),
2057
+ series: String($[m])
1909
2058
  }));
1910
2059
  }
1911
2060
  } else
1912
- u = e.map((N, A) => ({
1913
- name: R(N[h], g) || String(N[h]) || "Unknown",
1914
- size: typeof N[y] == "string" ? parseFloat(N[y]) : N[y] || 0,
1915
- fill: (a == null ? void 0 : a.colors) && a.colors[A % a.colors.length] || T[A % T.length]
2061
+ d = e.map((p, v) => ({
2062
+ name: R(p[h], y) || String(p[h]) || "Unknown",
2063
+ size: typeof p[b] == "string" ? parseFloat(p[b]) : p[b] || 0,
2064
+ fill: (a == null ? void 0 : a.colors) && a.colors[v % a.colors.length] || L[v % L.length]
1916
2065
  }));
1917
2066
  } else {
1918
- const h = e[0], y = Object.keys(h), g = y.find(
1919
- (A) => typeof h[A] == "string" || A.toLowerCase().includes("name") || A.toLowerCase().includes("label") || A.toLowerCase().includes("category")
1920
- ) || y[0], N = y.find((A) => A.toLowerCase().includes("size")) || y.find(
1921
- (A) => typeof h[A] == "number" && A !== g
1922
- ) || y[1];
1923
- if (!N)
1924
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
2067
+ const h = e[0], b = Object.keys(h), y = b.find(
2068
+ (v) => typeof h[v] == "string" || v.toLowerCase().includes("name") || v.toLowerCase().includes("label") || v.toLowerCase().includes("category")
2069
+ ) || b[0], p = b.find((v) => v.toLowerCase().includes("size")) || b.find(
2070
+ (v) => typeof h[v] == "number" && v !== y
2071
+ ) || b[1];
2072
+ if (!p)
2073
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
1925
2074
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
1926
2075
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No numeric field found for treemap chart size" })
1927
2076
  ] }) });
1928
- u = e.map((A, $) => {
1929
- let L = A[g];
1930
- return typeof L == "boolean" ? L = L ? "Active" : "Inactive" : L === "true" || L === "false" ? L = L === "true" ? "Active" : "Inactive" : L = String(L), {
1931
- name: L,
1932
- size: typeof A[N] == "string" ? parseFloat(A[N]) : A[N] || 0,
1933
- fill: (a == null ? void 0 : a.colors) && a.colors[$ % a.colors.length] || T[$ % T.length]
2077
+ d = e.map((v, k) => {
2078
+ let $ = v[y];
2079
+ return typeof $ == "boolean" ? $ = $ ? "Active" : "Inactive" : $ === "true" || $ === "false" ? $ = $ === "true" ? "Active" : "Inactive" : $ = String($), {
2080
+ name: $,
2081
+ size: typeof v[p] == "string" ? parseFloat(v[p]) : v[p] || 0,
2082
+ fill: (a == null ? void 0 : a.colors) && a.colors[k % a.colors.length] || L[k % L.length]
1934
2083
  };
1935
2084
  });
1936
2085
  }
1937
- if (u = u.filter((h) => h.size != null && h.size > 0), u.length === 0)
1938
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
2086
+ if (d = d.filter((h) => h.size != null && h.size > 0), d.length === 0)
2087
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
1939
2088
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
1940
2089
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No valid data points for treemap chart after transformation" })
1941
2090
  ] }) });
1942
- const w = (h) => {
2091
+ const A = (h) => {
1943
2092
  var M;
1944
- const { x: y, y: g, width: N, height: A, index: $, name: L, size: F } = h;
1945
- return N < 20 || A < 20 ? null : /* @__PURE__ */ b("g", { children: [
2093
+ const { x: b, y, width: p, height: v, index: k, name: $, size: F } = h;
2094
+ return p < 20 || v < 20 ? null : /* @__PURE__ */ w("g", { children: [
1946
2095
  /* @__PURE__ */ i(
1947
2096
  "rect",
1948
2097
  {
1949
- x: y,
1950
- y: g,
1951
- width: N,
1952
- height: A,
2098
+ x: b,
2099
+ y,
2100
+ width: p,
2101
+ height: v,
1953
2102
  style: {
1954
- fill: ((M = u[$]) == null ? void 0 : M.fill) || (a == null ? void 0 : a.colors) && a.colors[$ % a.colors.length] || T[$ % T.length],
1955
- fillOpacity: l !== null ? l === $ ? 1 : 0.6 : 0.8,
2103
+ fill: ((M = d[k]) == null ? void 0 : M.fill) || (a == null ? void 0 : a.colors) && a.colors[k % a.colors.length] || L[k % L.length],
2104
+ fillOpacity: l !== null ? l === k ? 1 : 0.6 : 0.8,
1956
2105
  stroke: "#fff",
1957
2106
  strokeWidth: 2,
1958
2107
  cursor: "pointer"
1959
2108
  },
1960
- onMouseEnter: () => c($),
2109
+ onMouseEnter: () => c(k),
1961
2110
  onMouseLeave: () => c(null)
1962
2111
  }
1963
2112
  ),
1964
2113
  /* @__PURE__ */ i(
1965
2114
  "foreignObject",
1966
2115
  {
1967
- x: y,
1968
- y: g,
1969
- width: N,
1970
- height: A,
2116
+ x: b,
2117
+ y,
2118
+ width: p,
2119
+ height: v,
1971
2120
  style: { pointerEvents: "none", overflow: "visible" },
1972
- children: /* @__PURE__ */ b(
2121
+ children: /* @__PURE__ */ w(
1973
2122
  "div",
1974
2123
  {
1975
2124
  style: {
@@ -1987,26 +2136,26 @@ function Xn({
1987
2136
  overflow: "hidden"
1988
2137
  },
1989
2138
  children: [
1990
- N > 40 && A > 30 && /* @__PURE__ */ i(
2139
+ p > 40 && v > 30 && /* @__PURE__ */ i(
1991
2140
  "div",
1992
2141
  {
1993
2142
  style: {
1994
- fontSize: `${Math.max(10, Math.min(N / 8, A / 8, 16))}px`,
2143
+ fontSize: `${Math.max(10, Math.min(p / 8, v / 8, 16))}px`,
1995
2144
  fontWeight: "600",
1996
2145
  textAlign: "center",
1997
2146
  lineHeight: "1.2",
1998
- marginBottom: N > 60 && A > 45 ? "4px" : "0",
2147
+ marginBottom: p > 60 && v > 45 ? "4px" : "0",
1999
2148
  wordBreak: "break-word",
2000
2149
  hyphens: "auto"
2001
2150
  },
2002
- children: L
2151
+ children: $
2003
2152
  }
2004
2153
  ),
2005
- N > 60 && A > 45 && /* @__PURE__ */ i(
2154
+ p > 60 && v > 45 && /* @__PURE__ */ i(
2006
2155
  "div",
2007
2156
  {
2008
2157
  style: {
2009
- fontSize: `${Math.max(8, Math.min(N / 10, A / 10, 14))}px`,
2158
+ fontSize: `${Math.max(8, Math.min(p / 10, v / 10, 14))}px`,
2010
2159
  textAlign: "center",
2011
2160
  opacity: 0.9
2012
2161
  },
@@ -2019,51 +2168,51 @@ function Xn({
2019
2168
  }
2020
2169
  )
2021
2170
  ] });
2022
- }, v = u.some((h) => "series" in h) ? [...new Set(u.map((h) => h.series).filter(Boolean))] : [];
2023
- let p = [];
2171
+ }, N = d.some((h) => "series" in h) ? [...new Set(d.map((h) => h.series).filter(Boolean))] : [];
2172
+ let g = [];
2024
2173
  if (o.showLegend && m)
2025
2174
  if (f) {
2026
- const h = Math.min(...e.map((g) => {
2027
- const N = g[m];
2028
- return typeof N == "string" ? parseFloat(N) : N;
2029
- })), y = Math.max(...e.map((g) => {
2030
- const N = g[m];
2031
- return typeof N == "string" ? parseFloat(N) : N;
2175
+ const h = Math.min(...e.map((y) => {
2176
+ const p = y[m];
2177
+ return typeof p == "string" ? parseFloat(p) : p;
2178
+ })), b = Math.max(...e.map((y) => {
2179
+ const p = y[m];
2180
+ return typeof p == "string" ? parseFloat(p) : p;
2032
2181
  }));
2033
- p = se.map((g, N) => {
2034
- const A = N / (se.length - 1);
2182
+ g = ie.map((y, p) => {
2183
+ const v = p / (ie.length - 1);
2035
2184
  return {
2036
- value: (h + (y - h) * A).toFixed(2),
2185
+ value: (h + (b - h) * v).toFixed(2),
2037
2186
  type: "rect",
2038
- color: g
2187
+ color: y
2039
2188
  };
2040
2189
  });
2041
- } else v.length > 1 && (p = v.map((h, y) => ({
2190
+ } else N.length > 1 && (g = N.map((h, b) => ({
2042
2191
  value: h,
2043
2192
  type: "rect",
2044
- color: T[y % T.length]
2193
+ color: L[b % L.length]
2045
2194
  })));
2046
- const S = o.showLegend && p.length > 0, k = S ? typeof s == "string" && s.includes("%") ? s : typeof s == "number" ? s + 60 : `calc(${s} + 60px)` : s;
2047
- return /* @__PURE__ */ b("div", { className: "w-full", style: { height: k }, children: [
2048
- /* @__PURE__ */ i(U, { height: S ? "calc(100% - 50px)" : "100%", children: /* @__PURE__ */ i(
2049
- Lt,
2195
+ const S = o.showLegend && g.length > 0, T = S ? typeof s == "string" && s.includes("%") ? s : typeof s == "number" ? s + 60 : `calc(${s} + 60px)` : s;
2196
+ return /* @__PURE__ */ w("div", { className: "w-full", style: { height: T }, children: [
2197
+ /* @__PURE__ */ i(G, { height: S ? "calc(100% - 50px)" : "100%", children: /* @__PURE__ */ i(
2198
+ Ft,
2050
2199
  {
2051
- data: u,
2200
+ data: d,
2052
2201
  dataKey: "size",
2053
2202
  aspectRatio: 4 / 3,
2054
2203
  stroke: "#fff",
2055
- content: /* @__PURE__ */ i(w, {}),
2056
- children: o.showTooltip && /* @__PURE__ */ i(q, {})
2204
+ content: /* @__PURE__ */ i(A, {}),
2205
+ children: o.showTooltip && /* @__PURE__ */ i(V, {})
2057
2206
  }
2058
2207
  ) }),
2059
2208
  S && /* @__PURE__ */ i("div", { className: "flex justify-center items-center mt-4 pb-2", children: f ? (
2060
2209
  // Gradient legend for numeric series
2061
- /* @__PURE__ */ b("div", { className: "flex flex-col items-center", children: [
2062
- /* @__PURE__ */ i("div", { className: "text-xs font-semibold text-gray-700 mb-2", children: m ? d(m) : "" }),
2063
- /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
2210
+ /* @__PURE__ */ w("div", { className: "flex flex-col items-center", children: [
2211
+ /* @__PURE__ */ i("div", { className: "text-xs font-semibold text-gray-700 mb-2", children: m ? u(m) : "" }),
2212
+ /* @__PURE__ */ w("div", { className: "flex items-center gap-2", children: [
2064
2213
  /* @__PURE__ */ i("span", { className: "text-xs text-gray-600", children: Math.min(...e.map((h) => {
2065
- const y = h[m];
2066
- return typeof y == "string" ? parseFloat(y) : y;
2214
+ const b = h[m];
2215
+ return typeof b == "string" ? parseFloat(b) : b;
2067
2216
  })).toFixed(2) }),
2068
2217
  /* @__PURE__ */ i(
2069
2218
  "div",
@@ -2071,19 +2220,19 @@ function Xn({
2071
2220
  className: "h-4 rounded",
2072
2221
  style: {
2073
2222
  width: "200px",
2074
- background: `linear-gradient(to right, ${se.join(", ")})`
2223
+ background: `linear-gradient(to right, ${ie.join(", ")})`
2075
2224
  }
2076
2225
  }
2077
2226
  ),
2078
2227
  /* @__PURE__ */ i("span", { className: "text-xs text-gray-600", children: Math.max(...e.map((h) => {
2079
- const y = h[m];
2080
- return typeof y == "string" ? parseFloat(y) : y;
2228
+ const b = h[m];
2229
+ return typeof b == "string" ? parseFloat(b) : b;
2081
2230
  })).toFixed(2) })
2082
2231
  ] })
2083
2232
  ] })
2084
2233
  ) : (
2085
2234
  // Discrete legend for categorical series
2086
- /* @__PURE__ */ i("div", { className: "flex flex-wrap justify-center gap-4", children: p.map((h, y) => /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
2235
+ /* @__PURE__ */ i("div", { className: "flex flex-wrap justify-center gap-4", children: g.map((h, b) => /* @__PURE__ */ w("div", { className: "flex items-center gap-2", children: [
2087
2236
  /* @__PURE__ */ i(
2088
2237
  "div",
2089
2238
  {
@@ -2092,95 +2241,95 @@ function Xn({
2092
2241
  }
2093
2242
  ),
2094
2243
  /* @__PURE__ */ i("span", { className: "text-xs text-gray-600", children: h.value })
2095
- ] }, y)) })
2244
+ ] }, b)) })
2096
2245
  ) })
2097
2246
  ] });
2098
2247
  } catch (o) {
2099
- return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
2248
+ return /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
2100
2249
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "TreeMap Chart Error" }),
2101
2250
  /* @__PURE__ */ i("div", { className: "text-xs mb-2", children: o instanceof Error ? o.message : "Unknown rendering error" }),
2102
2251
  /* @__PURE__ */ i("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
2103
2252
  ] }) });
2104
2253
  }
2105
2254
  }
2106
- function Qn({
2255
+ function Pr({
2107
2256
  data: e,
2108
2257
  chartConfig: t,
2109
- height: n = 300
2258
+ height: r = 300
2110
2259
  }) {
2111
- const { getFieldLabel: r } = K();
2260
+ const { getFieldLabel: n } = W();
2112
2261
  if (!e || e.length === 0)
2113
- return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: n }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
2262
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: r }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
2114
2263
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
2115
2264
  /* @__PURE__ */ i("div", { className: "text-xs", children: "No data to display in table" })
2116
2265
  ] }) });
2117
2266
  const s = Object.keys(e[0] || {}), a = t != null && t.xAxis && t.xAxis.length > 0 ? t.xAxis.filter((l) => s.includes(l)) : s;
2118
- return a.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: n }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
2267
+ return a.length === 0 ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: r }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
2119
2268
  /* @__PURE__ */ i("div", { className: "text-sm font-semibold mb-1", children: "No columns available" }),
2120
2269
  /* @__PURE__ */ i("div", { className: "text-xs", children: "Data structure is invalid" })
2121
- ] }) }) : /* @__PURE__ */ i("div", { className: "w-full overflow-auto", style: { height: n }, children: /* @__PURE__ */ b("table", { className: "min-w-full divide-y divide-gray-200", children: [
2270
+ ] }) }) : /* @__PURE__ */ i("div", { className: "w-full overflow-auto", style: { height: r }, children: /* @__PURE__ */ w("table", { className: "min-w-full divide-y divide-gray-200", children: [
2122
2271
  /* @__PURE__ */ i("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ i("tr", { children: a.map((l) => /* @__PURE__ */ i(
2123
2272
  "th",
2124
2273
  {
2125
2274
  className: "px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",
2126
- children: r(l)
2275
+ children: n(l)
2127
2276
  },
2128
2277
  l
2129
2278
  )) }) }),
2130
- /* @__PURE__ */ i("tbody", { className: "bg-white divide-y divide-gray-200", children: e.map((l, c) => /* @__PURE__ */ i("tr", { className: "hover:bg-gray-50", children: a.map((d) => /* @__PURE__ */ i(
2279
+ /* @__PURE__ */ i("tbody", { className: "bg-white divide-y divide-gray-200", children: e.map((l, c) => /* @__PURE__ */ i("tr", { className: "hover:bg-gray-50", children: a.map((u) => /* @__PURE__ */ i(
2131
2280
  "td",
2132
2281
  {
2133
2282
  className: "px-3 py-2 whitespace-nowrap text-sm text-gray-900",
2134
- children: Dn(l[d])
2283
+ children: Ir(l[u])
2135
2284
  },
2136
- d
2285
+ u
2137
2286
  )) }, c)) })
2138
2287
  ] }) });
2139
2288
  }
2140
- function Dn(e) {
2289
+ function Ir(e) {
2141
2290
  return e == null ? "" : typeof e == "number" ? e.toLocaleString() : typeof e == "boolean" ? e ? "Yes" : "No" : String(e);
2142
2291
  }
2143
- function Zn(e) {
2144
- const t = Hn(e);
2292
+ function Cr(e) {
2293
+ const t = _r(e);
2145
2294
  return {
2146
2295
  portlets: e,
2147
2296
  layouts: t
2148
2297
  };
2149
2298
  }
2150
- function Hn(e) {
2151
- const t = e.map((n) => ({
2152
- i: n.id,
2153
- x: n.x,
2154
- y: n.y,
2155
- w: n.w,
2156
- h: n.h,
2299
+ function _r(e) {
2300
+ const t = e.map((r) => ({
2301
+ i: r.id,
2302
+ x: r.x,
2303
+ y: r.y,
2304
+ w: r.w,
2305
+ h: r.h,
2157
2306
  minW: 3,
2158
2307
  minH: 3
2159
2308
  }));
2160
2309
  return {
2161
2310
  lg: t,
2162
- md: t.map((n) => ({ ...n, w: Math.min(n.w, 8) })),
2163
- sm: t.map((n) => ({ ...n, w: Math.min(n.w, 6) })),
2164
- xs: t.map((n) => ({ ...n, w: Math.min(n.w, 4) })),
2165
- xxs: t.map((n) => ({ ...n, w: 2 }))
2311
+ md: t.map((r) => ({ ...r, w: Math.min(r.w, 8) })),
2312
+ sm: t.map((r) => ({ ...r, w: Math.min(r.w, 6) })),
2313
+ xs: t.map((r) => ({ ...r, w: Math.min(r.w, 4) })),
2314
+ xxs: t.map((r) => ({ ...r, w: 2 }))
2166
2315
  };
2167
2316
  }
2168
- function Jn(e, t = {}) {
2169
- const { formatNumbers: n = !0, precision: r = 2 } = t;
2170
- return n ? e.map((s) => {
2317
+ function en(e, t = {}) {
2318
+ const { formatNumbers: r = !0, precision: n = 2 } = t;
2319
+ return r ? e.map((s) => {
2171
2320
  const a = {};
2172
2321
  for (const [l, c] of Object.entries(s))
2173
- typeof c == "number" ? a[l] = Number(c.toFixed(r)) : a[l] = c;
2322
+ typeof c == "number" ? a[l] = Number(c.toFixed(n)) : a[l] = c;
2174
2323
  return a;
2175
2324
  }) : e;
2176
2325
  }
2177
- function Pn() {
2326
+ function tn() {
2178
2327
  return `portlet-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
2179
2328
  }
2180
- function Cn(e, t = 6, n = 4) {
2329
+ function rn(e, t = 6, r = 4) {
2181
2330
  return e.length === 0 ? { x: 0, y: 0 } : { x: 0, y: Math.max(...e.map((s) => s.y + s.h)) };
2182
2331
  }
2183
- function er(e) {
2332
+ function nn(e) {
2184
2333
  try {
2185
2334
  const t = JSON.parse(e);
2186
2335
  return typeof t != "object" || t === null ? { valid: !1, error: "Query must be a JSON object" } : !t.measures && !t.dimensions ? { valid: !1, error: "Query must have at least measures or dimensions" } : { valid: !0, query: t };
@@ -2188,7 +2337,7 @@ function er(e) {
2188
2337
  return { valid: !1, error: "Invalid JSON format" };
2189
2338
  }
2190
2339
  }
2191
- function tr() {
2340
+ function sn() {
2192
2341
  return {
2193
2342
  title: "Sample Chart",
2194
2343
  query: JSON.stringify({
@@ -2212,41 +2361,44 @@ function tr() {
2212
2361
  };
2213
2362
  }
2214
2363
  export {
2215
- _n as A,
2216
- qn as B,
2217
- ve as C,
2218
- Qn as D,
2219
- Vn as L,
2220
- Tt as N,
2221
- Bn as P,
2222
- Yn as R,
2223
- Kn as S,
2224
- Xn as T,
2225
- Wn as a,
2226
- Ye as b,
2227
- Zn as c,
2228
- fn as d,
2229
- P as e,
2230
- Jn as f,
2231
- Fn as g,
2232
- je as h,
2233
- fe as i,
2234
- W as j,
2235
- O as k,
2236
- ct as l,
2364
+ Wr as A,
2365
+ Kr as B,
2366
+ ge as C,
2367
+ Pr as D,
2368
+ nn as E,
2369
+ sn as F,
2370
+ Oe as G,
2371
+ Br as L,
2372
+ jt as N,
2373
+ Yr as P,
2374
+ Qr as R,
2375
+ Xr as S,
2376
+ Jr as T,
2377
+ Zr as a,
2378
+ Ze as b,
2379
+ Cr as c,
2380
+ mr as d,
2381
+ C as e,
2382
+ en as f,
2383
+ jr as g,
2384
+ Re as h,
2385
+ me as i,
2386
+ X as j,
2387
+ H as k,
2388
+ xt as l,
2237
2389
  R as m,
2238
- Rn as n,
2239
- se as o,
2240
- ot as p,
2241
- dt as q,
2242
- T as r,
2243
- U as s,
2244
- jn as t,
2245
- Hn as u,
2246
- Pn as v,
2247
- Cn as w,
2248
- er as x,
2249
- tr as y,
2250
- De as z
2390
+ Rr as n,
2391
+ ie as o,
2392
+ mt as p,
2393
+ ht as q,
2394
+ L as r,
2395
+ G as s,
2396
+ zr as t,
2397
+ Te as u,
2398
+ qr as v,
2399
+ Ur as w,
2400
+ _r as x,
2401
+ tn as y,
2402
+ rn as z
2251
2403
  };
2252
- //# sourceMappingURL=charts-Dm25kuUn.js.map
2404
+ //# sourceMappingURL=charts-BM1k01Jw.js.map