drizzle-cube 0.2.24 → 0.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/adapters/compiler-C6JQHGrF.cjs +22 -0
  2. package/dist/adapters/{compiler-DkzdLcxq.js → compiler-Ddwn99Ja.js} +1419 -1287
  3. package/dist/adapters/express/index.cjs +1 -1
  4. package/dist/adapters/express/index.d.ts +6 -1
  5. package/dist/adapters/express/index.js +22 -20
  6. package/dist/adapters/fastify/index.cjs +1 -1
  7. package/dist/adapters/fastify/index.d.ts +6 -1
  8. package/dist/adapters/fastify/index.js +18 -16
  9. package/dist/adapters/hono/index.cjs +1 -1
  10. package/dist/adapters/hono/index.d.ts +6 -1
  11. package/dist/adapters/hono/index.js +87 -85
  12. package/dist/adapters/nextjs/index.cjs +1 -1
  13. package/dist/adapters/nextjs/index.d.ts +6 -1
  14. package/dist/adapters/nextjs/index.js +64 -63
  15. package/dist/adapters/utils.d.ts +18 -0
  16. package/dist/client/charts.js +2 -2
  17. package/dist/client/chunks/{charts-DboFPJFN.js → charts-BsXrHSCm.js} +32 -32
  18. package/dist/client/chunks/{charts-DboFPJFN.js.map → charts-BsXrHSCm.js.map} +1 -1
  19. package/dist/client/chunks/{charts--hFH-bsu.js → charts-BvLb1eub.js} +710 -703
  20. package/dist/client/chunks/charts-BvLb1eub.js.map +1 -0
  21. package/dist/client/chunks/{components-D7wTB56l.js → components-DhA8GIUY.js} +6019 -5299
  22. package/dist/client/chunks/components-DhA8GIUY.js.map +1 -0
  23. package/dist/client/chunks/core-DcwgBEzv.js +6 -0
  24. package/dist/client/chunks/core-DcwgBEzv.js.map +1 -0
  25. package/dist/client/chunks/{index-yc7cf-yE.js → index-9x0R-Fme.js} +2 -2
  26. package/dist/client/chunks/{index-yc7cf-yE.js.map → index-9x0R-Fme.js.map} +1 -1
  27. package/dist/client/components/AnalysisBuilder/AnalysisQueryPanel.d.ts +3 -2
  28. package/dist/client/components/AnalysisBuilder/types.d.ts +63 -15
  29. package/dist/client/components/DashboardPortletCard.d.ts +12 -0
  30. package/dist/client/components/DebugModal.d.ts +7 -1
  31. package/dist/client/components.js +2 -2
  32. package/dist/client/hooks/useMultiCubeQuery.d.ts +36 -0
  33. package/dist/client/hooks.js +2 -2
  34. package/dist/client/icons.js +1 -1
  35. package/dist/client/index.d.ts +7 -1
  36. package/dist/client/index.js +70 -52
  37. package/dist/client/providers.js +1 -1
  38. package/dist/client/styles.css +1 -1
  39. package/dist/client/types.d.ts +32 -0
  40. package/dist/client/utils/multiQueryUtils.d.ts +86 -0
  41. package/dist/client/utils/multiQueryValidation.d.ts +69 -0
  42. package/dist/client/utils/shareUtils.d.ts +3 -3
  43. package/dist/client-bundle-stats.html +1 -1
  44. package/dist/server/index.cjs +17 -17
  45. package/dist/server/index.d.ts +326 -1
  46. package/dist/server/index.js +2429 -2148
  47. package/package.json +1 -1
  48. package/dist/adapters/compiler-BFqMax9M.cjs +0 -22
  49. package/dist/client/chunks/charts--hFH-bsu.js.map +0 -1
  50. package/dist/client/chunks/components-D7wTB56l.js.map +0 -1
  51. package/dist/client/chunks/core-PxWXpBbW.js +0 -6
  52. package/dist/client/chunks/core-PxWXpBbW.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as o, jsxs as k, Fragment as Vt } from "react/jsx-runtime";
2
- import de, { useContext as xt, createContext as Ot, useState as Z, useMemo as J, useCallback as Le, useRef as ye, useEffect as Te, useSyncExternalStore as pn, useLayoutEffect as Pt } from "react";
3
- import { ResponsiveContainer as Qt, Tooltip as Cr, ComposedChart as zr, CartesianGrid as yt, XAxis as gt, YAxis as Ie, Legend as Oe, Bar as xn, Cell as Ht, Line as Ee, LineChart as yn, Area as gn, PieChart as bn, Pie as vn, ScatterChart as wn, Scatter as Jt, RadarChart as Nn, PolarGrid as An, PolarAngleAxis as Sn, PolarRadiusAxis as kn, Radar as Tn, RadialBarChart as Fn, RadialBar as Mn, Treemap as _n } from "recharts";
4
- import { d as St, a as $n, b as er, c as tr, e as Dn, f as Cn, g as zn, h as rr, i as nr, j as Ln, k as Yt, l as En, m as Rn, n as In, o as Vn, p as On, q as Pn, r as Hn, s as Yn, t as jn, u as Un, v as Bn, w as Wn, x as Gn, y as Kn, z as Xn, A as qn, B as Zn, C as Qn, D as Jn, E as ei, F as ti, G as ri, H as ni, I as ii, J as si, K as ai, L as oi, M as li, N as ci, O as di, P as ui, Q as fi, R as mi, S as hi, T as pi, U as xi, V as yi, W as gi, X as bi, Y as vi, Z as wi, _ as Ni, $ as Ai, a0 as Si, a1 as ki, a2 as Ti, a3 as Fi, a4 as Mi, a5 as _i, a6 as $i, a7 as Di, a8 as Ci, a9 as zi, aa as Li, ab as Ei, ac as Ri, ad as at } from "./icons-DI4Xack3.js";
2
+ import de, { useContext as xt, createContext as Ot, useState as Q, useMemo as Z, useCallback as Le, useRef as ye, useEffect as Te, useSyncExternalStore as pn, useLayoutEffect as Pt } from "react";
3
+ import { ResponsiveContainer as Qt, Tooltip as Cr, ComposedChart as zr, CartesianGrid as yt, XAxis as gt, YAxis as Ie, Legend as Oe, Bar as xn, Cell as Ht, Line as Re, LineChart as yn, Area as gn, PieChart as bn, Pie as vn, ScatterChart as wn, Scatter as Jt, RadarChart as Nn, PolarGrid as An, PolarAngleAxis as Sn, PolarRadiusAxis as kn, Radar as Tn, RadialBarChart as Fn, RadialBar as Mn, Treemap as _n } from "recharts";
4
+ import { d as St, a as $n, b as er, c as tr, e as Dn, f as Cn, g as zn, h as rr, i as nr, j as Ln, k as Yt, l as Rn, m as En, n as In, o as Vn, p as On, q as Pn, r as Hn, s as Yn, t as jn, u as Un, v as Bn, w as Wn, x as Gn, y as Kn, z as Xn, A as qn, B as Zn, C as Qn, D as Jn, E as ei, F as ti, G as ri, H as ni, I as ii, J as si, K as ai, L as oi, M as li, N as ci, O as di, P as ui, Q as fi, R as mi, S as hi, T as pi, U as xi, V as yi, W as gi, X as bi, Y as vi, Z as wi, _ as Ni, $ as Ai, a0 as Si, a1 as ki, a2 as Ti, a3 as Fi, a4 as Mi, a5 as _i, a6 as $i, a7 as Di, a8 as Ci, a9 as zi, aa as Li, ab as Ri, ac as Ei, ad as at } from "./icons-DI4Xack3.js";
5
5
  class Ii {
6
6
  apiUrl;
7
7
  headers;
@@ -136,6 +136,13 @@ class kt {
136
136
  annotation() {
137
137
  return this.loadResponse.results && this.loadResponse.results[0] ? this.loadResponse.results[0].annotation || {} : this.loadResponse.annotation || {};
138
138
  }
139
+ /**
140
+ * Get cache metadata if result was served from cache
141
+ * Returns undefined if not a cache hit
142
+ */
143
+ cacheInfo() {
144
+ return this.loadResponse.results && this.loadResponse.results[0] ? this.loadResponse.results[0].cache : this.loadResponse.cache;
145
+ }
139
146
  }
140
147
  function Vi(e, t = {}) {
141
148
  return new Ii(e, t);
@@ -208,21 +215,21 @@ function Pi({
208
215
  batchDelayMs: i = 100,
209
216
  children: s
210
217
  }) {
211
- const [a, l] = Z({ apiOptions: e, token: t }), d = J(
218
+ const [a, l] = Q({ apiOptions: e, token: t }), d = Z(
212
219
  () => Vi(a.token, a.apiOptions),
213
220
  [a.apiOptions, a.token]
214
- ), c = J(() => n ? new Oi((h) => d.batchLoad(h), i) : null, [n, d, i]), u = Le((h, f) => {
215
- l({ apiOptions: h, token: f });
216
- }, []), m = J(() => ({
221
+ ), c = Z(() => n ? new Oi((h) => d.batchLoad(h), i) : null, [n, d, i]), f = Le((h, u) => {
222
+ l({ apiOptions: h, token: u });
223
+ }, []), m = Z(() => ({
217
224
  cubeApi: d,
218
225
  options: r,
219
- updateApiConfig: u,
226
+ updateApiConfig: f,
220
227
  batchCoordinator: c,
221
228
  enableBatching: n
222
- }), [d, r, u, c, n]);
229
+ }), [d, r, f, c, n]);
223
230
  return /* @__PURE__ */ o(Lr.Provider, { value: m, children: s });
224
231
  }
225
- function Er() {
232
+ function Rr() {
226
233
  const e = xt(Lr);
227
234
  if (!e)
228
235
  throw new Error("useCubeApi must be used within CubeApiProvider");
@@ -246,22 +253,22 @@ function ji() {
246
253
  return _e ? Date.now() - _e.timestamp < Hi : !1;
247
254
  }
248
255
  function Ui(e) {
249
- const [t, r] = Z(null), [n, i] = Z(!0), [s, a] = Z(null), l = ye({}), [d] = Z(() => ({})), c = Le(async () => {
256
+ const [t, r] = Q(null), [n, i] = Q(!0), [s, a] = Q(null), l = ye({}), [d] = Q(() => ({})), c = Le(async () => {
250
257
  if (ji() && _e) {
251
258
  r(_e.data), l.current = _e.labelMap, Object.keys(d).forEach((h) => delete d[h]), Object.assign(d, _e.labelMap), i(!1), a(null);
252
259
  return;
253
260
  }
254
261
  try {
255
262
  i(!0), a(null);
256
- const h = await e.meta(), f = Yi(h);
263
+ const h = await e.meta(), u = Yi(h);
257
264
  _e = {
258
265
  data: h,
259
- labelMap: f,
266
+ labelMap: u,
260
267
  timestamp: Date.now()
261
- }, l.current = f, Object.keys(d).forEach((w) => delete d[w]), Object.assign(d, f), r(h);
268
+ }, l.current = u, Object.keys(d).forEach((N) => delete d[N]), Object.assign(d, u), r(h);
262
269
  } catch (h) {
263
- const f = h instanceof Error ? h.message : "Failed to fetch metadata";
264
- a(f), console.error("Failed to fetch cube metadata:", h);
270
+ const u = h instanceof Error ? h.message : "Failed to fetch metadata";
271
+ a(u), console.error("Failed to fetch cube metadata:", h);
265
272
  } finally {
266
273
  i(!1);
267
274
  }
@@ -269,7 +276,7 @@ function Ui(e) {
269
276
  Te(() => {
270
277
  c();
271
278
  }, [c]);
272
- const u = Le((h) => l.current[h] || h, []), m = Le(() => {
279
+ const f = Le((h) => l.current[h] || h, []), m = Le(() => {
273
280
  _e = null, c();
274
281
  }, [c]);
275
282
  return {
@@ -279,19 +286,19 @@ function Ui(e) {
279
286
  loading: n,
280
287
  error: s,
281
288
  refetch: m,
282
- getFieldLabel: u
289
+ getFieldLabel: f
283
290
  };
284
291
  }
285
292
  const jt = Ot(null);
286
293
  function Bi({ children: e }) {
287
- const { cubeApi: t } = Er(), {
294
+ const { cubeApi: t } = Rr(), {
288
295
  meta: r,
289
296
  labelMap: n,
290
297
  loading: i,
291
298
  error: s,
292
299
  getFieldLabel: a,
293
300
  refetch: l
294
- } = Ui(t), d = J(() => ({
301
+ } = Ui(t), d = Z(() => ({
295
302
  meta: r,
296
303
  labelMap: n,
297
304
  metaLoading: i,
@@ -307,7 +314,7 @@ function Wi() {
307
314
  throw new Error("useCubeMeta must be used within CubeMetaProvider");
308
315
  return e;
309
316
  }
310
- const Rr = Ot(null), Gi = {
317
+ const Er = Ot(null), Gi = {
311
318
  enableAI: !0,
312
319
  aiEndpoint: "/api/ai/generate",
313
320
  showSchemaDiagram: !1,
@@ -320,20 +327,20 @@ function Ki({
320
327
  dashboardModes: t = ["rows", "grid"],
321
328
  children: r
322
329
  }) {
323
- const [n, i] = Z(() => ({
330
+ const [n, i] = Q(() => ({
324
331
  ...Gi,
325
332
  ...e
326
333
  })), s = Le((l) => {
327
334
  i((d) => ({ ...d, ...l }));
328
- }, []), a = J(() => ({
335
+ }, []), a = Z(() => ({
329
336
  features: n,
330
337
  dashboardModes: t,
331
338
  updateFeatures: s
332
339
  }), [n, t, s]);
333
- return /* @__PURE__ */ o(Rr.Provider, { value: a, children: r });
340
+ return /* @__PURE__ */ o(Er.Provider, { value: a, children: r });
334
341
  }
335
342
  function Xi() {
336
- const e = xt(Rr);
343
+ const e = xt(Er);
337
344
  if (!e)
338
345
  throw new Error("useCubeFeatures must be used within CubeFeaturesProvider");
339
346
  return e;
@@ -363,8 +370,8 @@ function lc({
363
370
  );
364
371
  }
365
372
  function qi() {
366
- const e = Er(), t = Wi(), r = Xi();
367
- return J(() => ({
373
+ const e = Rr(), t = Wi(), r = Xi();
374
+ return Z(() => ({
368
375
  ...e,
369
376
  ...t,
370
377
  features: r.features,
@@ -373,8 +380,8 @@ function qi() {
373
380
  }
374
381
  const Ir = {
375
382
  // Action icons
376
- close: { icon: Ri, category: "action" },
377
- add: { icon: Ei, category: "action" },
383
+ close: { icon: Ei, category: "action" },
384
+ add: { icon: Ri, category: "action" },
378
385
  edit: { icon: Li, category: "action" },
379
386
  delete: { icon: zi, category: "action" },
380
387
  refresh: { icon: St, category: "action" },
@@ -436,8 +443,8 @@ const Ir = {
436
443
  measureNumber: { icon: Vn, category: "measure" },
437
444
  // State icons
438
445
  success: { icon: In, category: "state" },
439
- warning: { icon: Rn, category: "state" },
440
- error: { icon: En, category: "state" },
446
+ warning: { icon: En, category: "state" },
447
+ error: { icon: Rn, category: "state" },
441
448
  info: { icon: Yt, category: "state" },
442
449
  loading: { icon: St, category: "state" },
443
450
  sparkles: { icon: Ln, category: "state" },
@@ -1447,53 +1454,53 @@ function W(e, t, r) {
1447
1454
  if (!t)
1448
1455
  return Vr(e);
1449
1456
  const { unit: s, abbreviate: a = !0, decimals: l, customPrefix: d, customSuffix: c } = t;
1450
- let u = n, m = "";
1457
+ let f = n, m = "";
1451
1458
  if (a) {
1452
- const f = Math.abs(n);
1453
- f >= 1e9 ? (u = n / 1e9, m = "B") : f >= 1e6 ? (u = n / 1e6, m = "M") : f >= 1e3 && (u = n / 1e3, m = "K");
1459
+ const u = Math.abs(n);
1460
+ u >= 1e9 ? (f = n / 1e9, m = "B") : u >= 1e6 ? (f = n / 1e6, m = "M") : u >= 1e3 && (f = n / 1e3, m = "K");
1454
1461
  }
1455
- const h = l !== void 0 ? l : Number.isInteger(u) ? 0 : 2;
1462
+ const h = l !== void 0 ? l : Number.isInteger(f) ? 0 : 2;
1456
1463
  switch (s) {
1457
1464
  case "currency": {
1458
- const f = ps(i);
1465
+ const u = ps(i);
1459
1466
  if (a && m) {
1460
- const w = new Intl.NumberFormat(i, {
1467
+ const N = new Intl.NumberFormat(i, {
1461
1468
  style: "currency",
1462
- currency: f,
1469
+ currency: u,
1463
1470
  minimumFractionDigits: h,
1464
1471
  maximumFractionDigits: h
1465
- }).format(u), N = new Intl.NumberFormat(i, {
1472
+ }).format(f), w = new Intl.NumberFormat(i, {
1466
1473
  style: "currency",
1467
- currency: f
1468
- }).formatToParts(u);
1469
- return N[N.length - 1]?.type === "currency" ? w.replace(/(\s*[^\d\s]+)$/, m + "$1") : w + m;
1474
+ currency: u
1475
+ }).formatToParts(f);
1476
+ return w[w.length - 1]?.type === "currency" ? N.replace(/(\s*[^\d\s]+)$/, m + "$1") : N + m;
1470
1477
  }
1471
1478
  return new Intl.NumberFormat(i, {
1472
1479
  style: "currency",
1473
- currency: f,
1480
+ currency: u,
1474
1481
  minimumFractionDigits: h,
1475
1482
  maximumFractionDigits: h
1476
- }).format(u);
1483
+ }).format(f);
1477
1484
  }
1478
1485
  case "percent": {
1479
- const f = Math.abs(u) <= 1 && !a ? u * 100 : u;
1486
+ const u = Math.abs(f) <= 1 && !a ? f * 100 : f;
1480
1487
  return new Intl.NumberFormat(i, {
1481
1488
  minimumFractionDigits: h,
1482
1489
  maximumFractionDigits: h
1483
- }).format(f) + m + "%";
1490
+ }).format(u) + m + "%";
1484
1491
  }
1485
1492
  case "custom": {
1486
- const f = d || "", w = c || "", N = new Intl.NumberFormat(i, {
1493
+ const u = d || "", N = c || "", w = new Intl.NumberFormat(i, {
1487
1494
  minimumFractionDigits: h,
1488
1495
  maximumFractionDigits: h
1489
- }).format(u);
1490
- return f + N + m + w;
1496
+ }).format(f);
1497
+ return u + w + m + N;
1491
1498
  }
1492
1499
  default:
1493
1500
  return new Intl.NumberFormat(i, {
1494
1501
  minimumFractionDigits: h,
1495
1502
  maximumFractionDigits: h
1496
- }).format(u) + m;
1503
+ }).format(f) + m;
1497
1504
  }
1498
1505
  }
1499
1506
  function ps(e) {
@@ -1572,15 +1579,15 @@ function ee(e, t) {
1572
1579
  case "minute":
1573
1580
  return `${s}-${a}-${l} ${String(d).padStart(2, "0")}:${String(c).padStart(2, "0")}`;
1574
1581
  }
1575
- const u = i.getUTCSeconds(), m = i.getUTCMilliseconds();
1576
- if (l === "01" && d === 0 && c === 0 && u === 0 && m === 0) {
1582
+ const f = i.getUTCSeconds(), m = i.getUTCMilliseconds();
1583
+ if (l === "01" && d === 0 && c === 0 && f === 0 && m === 0) {
1577
1584
  if (a === "01" || a === "04" || a === "07" || a === "10") {
1578
1585
  const h = Math.floor(i.getUTCMonth() / 3) + 1;
1579
1586
  return `${s}-Q${h}`;
1580
1587
  }
1581
1588
  return `${s}-${a}`;
1582
1589
  }
1583
- return d === 0 && c === 0 && u === 0 && m === 0 ? `${s}-${a}-${l}` : c === 0 && u === 0 && m === 0 ? `${s}-${a}-${l} ${String(d).padStart(2, "0")}:00` : `${s}-${a}-${l} ${String(d).padStart(2, "0")}:${String(c).padStart(2, "0")}`;
1590
+ return d === 0 && c === 0 && f === 0 && m === 0 ? `${s}-${a}-${l}` : c === 0 && f === 0 && m === 0 ? `${s}-${a}-${l} ${String(d).padStart(2, "0")}:00` : `${s}-${a}-${l} ${String(d).padStart(2, "0")}:${String(c).padStart(2, "0")}`;
1584
1591
  }
1585
1592
  return r;
1586
1593
  }
@@ -1620,49 +1627,49 @@ function Ze(e, t, r, n, i, s = (a) => a) {
1620
1627
  return { data: [], seriesKeys: [], hasDimensions: !1 };
1621
1628
  const a = n || {}, l = [
1622
1629
  ...a.dimensions || [],
1623
- ...a.timeDimensions?.map((f) => f.dimension) || []
1624
- ], d = a.measures || [], c = r.filter((f) => d.includes(f)), u = (i || []).filter((f) => l.includes(f));
1625
- if (u.length > 0) {
1626
- const f = {};
1630
+ ...a.timeDimensions?.map((u) => u.dimension) || []
1631
+ ], d = a.measures || [], c = r.filter((u) => d.includes(u)), f = (i || []).filter((u) => l.includes(u));
1632
+ if (f.length > 0) {
1633
+ const u = {};
1627
1634
  e.forEach((A) => {
1628
1635
  const p = pe(n, t), v = ee(A[t], p) || A[t] || "Unknown";
1629
- f[v] || (f[v] = { name: String(v) }), c.forEach((S) => {
1636
+ u[v] || (u[v] = { name: String(v) }), c.forEach((S) => {
1630
1637
  const g = s(S), b = Ve(A[S]);
1631
1638
  if (b !== null) {
1632
- const C = f[v][g];
1633
- f[v][g] = C == null ? b : C + b;
1634
- } else g in f[v] || (f[v][g] = null);
1635
- }), u.forEach((S) => {
1639
+ const D = u[v][g];
1640
+ u[v][g] = D == null ? b : D + b;
1641
+ } else g in u[v] || (u[v][g] = null);
1642
+ }), f.forEach((S) => {
1636
1643
  const g = A[S];
1637
1644
  if (g != null) {
1638
- const b = String(g), C = c[0] || d.find(
1645
+ const b = String(g), D = c[0] || d.find(
1639
1646
  (_) => _.includes("totalCost") || _.includes("count") || _.includes("sum")
1640
1647
  ) || d[0];
1641
- if (C) {
1642
- const _ = Ve(A[C]);
1648
+ if (D) {
1649
+ const _ = Ve(A[D]);
1643
1650
  if (_ !== null) {
1644
- const $ = f[v][b];
1645
- f[v][b] = $ == null ? _ : $ + _;
1646
- } else b in f[v] || (f[v][b] = null);
1651
+ const $ = u[v][b];
1652
+ u[v][b] = $ == null ? _ : $ + _;
1653
+ } else b in u[v] || (u[v][b] = null);
1647
1654
  }
1648
1655
  }
1649
1656
  });
1650
1657
  });
1651
- const w = Object.values(f), N = Array.from(new Set(
1658
+ const N = Object.values(u), w = Array.from(new Set(
1652
1659
  e.flatMap(
1653
- (A) => u.map((p) => {
1660
+ (A) => f.map((p) => {
1654
1661
  const v = A[p];
1655
1662
  return v != null ? String(v) : null;
1656
1663
  }).filter((p) => p !== null)
1657
1664
  )
1658
1665
  ));
1659
1666
  return {
1660
- data: w,
1661
- seriesKeys: N,
1667
+ data: N,
1668
+ seriesKeys: w,
1662
1669
  hasDimensions: !0
1663
1670
  };
1664
1671
  }
1665
- const m = xs(e, t, r, n, s), h = r.map((f) => s(f));
1672
+ const m = xs(e, t, r, n, s), h = r.map((u) => s(u));
1666
1673
  return {
1667
1674
  data: m,
1668
1675
  seriesKeys: h,
@@ -1730,7 +1737,7 @@ function Dc({
1730
1737
  axisLabel: r,
1731
1738
  previewValue: n = 125e4
1732
1739
  }) {
1733
- const i = e || {}, s = J(() => ys(), []), a = J(() => W(n, i), [n, i]), l = (c) => {
1740
+ const i = e || {}, s = Z(() => ys(), []), a = Z(() => W(n, i), [n, i]), l = (c) => {
1734
1741
  t({ ...i, ...c });
1735
1742
  }, d = [
1736
1743
  { value: "currency", label: s },
@@ -1858,7 +1865,7 @@ function ve() {
1858
1865
  const e = xt(jt);
1859
1866
  if (!e)
1860
1867
  throw new Error("useCubeFieldLabel must be used within CubeProvider");
1861
- return J(() => e.getFieldLabel, [e.getFieldLabel]);
1868
+ return Z(() => e.getFieldLabel, [e.getFieldLabel]);
1862
1869
  }
1863
1870
  function Cc(e) {
1864
1871
  return typeof window > "u" ? "" : getComputedStyle(document.documentElement).getPropertyValue(`--dc-${e}`).trim();
@@ -1892,7 +1899,7 @@ function Ye() {
1892
1899
  function vs(e) {
1893
1900
  typeof window > "u" || (document.documentElement.classList.remove("dark", "neon"), document.documentElement.setAttribute("data-theme", e), (e === "dark" || e === "neon") && document.documentElement.classList.add(e), localStorage.setItem("theme", e));
1894
1901
  }
1895
- function Ec() {
1902
+ function Rc() {
1896
1903
  const e = Ye();
1897
1904
  return e === "dark" || e === "neon";
1898
1905
  }
@@ -1911,7 +1918,7 @@ function Or(e) {
1911
1918
  t.disconnect(), r.removeEventListener("change", n);
1912
1919
  };
1913
1920
  }
1914
- const Rc = {
1921
+ const Ec = {
1915
1922
  light: {
1916
1923
  name: "light",
1917
1924
  colors: {
@@ -2173,19 +2180,19 @@ function $s(e, t) {
2173
2180
  function Ds(e, t, r, n) {
2174
2181
  const i = $s(e, t), s = Array.from(i.keys()), a = [], l = t.measures.length, d = s.length;
2175
2182
  return t.measures.forEach((c) => {
2176
- s.forEach((u, m) => {
2177
- const h = i.get(u), f = l > 1 ? `${c}|${u}` : u, w = {}, N = u === "__all__" ? [] : u.split("|");
2183
+ s.forEach((f, m) => {
2184
+ const h = i.get(f), u = l > 1 ? `${c}|${f}` : f, N = {}, w = f === "__all__" ? [] : f.split("|");
2178
2185
  t.dimensions.forEach((v, S) => {
2179
- w[v] = N[S] ?? "";
2180
- }), l > 1 && (w.__measure__ = n(c)), r.forEach((v) => {
2186
+ N[v] = w[S] ?? "";
2187
+ }), l > 1 && (N.__measure__ = n(c)), r.forEach((v) => {
2181
2188
  const S = h.get(v);
2182
- w[v] = S?.[c] ?? null;
2189
+ N[v] = S?.[c] ?? null;
2183
2190
  });
2184
2191
  const A = m === 0, p = A && l > 1 ? d : void 0;
2185
2192
  a.push({
2186
- id: f,
2193
+ id: u,
2187
2194
  measureField: c,
2188
- values: w,
2195
+ values: N,
2189
2196
  isFirstInGroup: A,
2190
2197
  dimensionRowSpan: p
2191
2198
  });
@@ -2226,14 +2233,14 @@ function Ls(e) {
2226
2233
  function it(e, t) {
2227
2234
  return t === 0 ? "Current" : "Prior";
2228
2235
  }
2229
- function Es(e, t, r) {
2236
+ function Rs(e, t, r) {
2230
2237
  if (e.length === 0) return [];
2231
2238
  const n = ["__period", "__periodIndex", "__periodDayIndex"], i = e[0], s = [];
2232
2239
  for (const a of Object.keys(i))
2233
2240
  !t.includes(a) && a !== r && !n.includes(a) && s.push(a);
2234
2241
  return s;
2235
2242
  }
2236
- function Rs(e, t) {
2243
+ function Es(e, t) {
2237
2244
  const r = /* @__PURE__ */ new Map();
2238
2245
  for (const n of t)
2239
2246
  r.set(n, /* @__PURE__ */ new Set());
@@ -2245,52 +2252,52 @@ function Rs(e, t) {
2245
2252
  function Is(e, t, r, n) {
2246
2253
  if (!vt(e))
2247
2254
  return { data: e, seriesKeys: t, xAxisKey: r };
2248
- const i = Hr(e), s = Ls(e), a = Es(e, t, r), l = a.length > 0, d = l ? Rs(e, a) : null, c = /* @__PURE__ */ new Map();
2255
+ const i = Hr(e), s = Ls(e), a = Rs(e, t, r), l = a.length > 0, d = l ? Es(e, a) : null, c = /* @__PURE__ */ new Map();
2249
2256
  for (const h of e) {
2250
- const f = h.__periodDayIndex, w = h.__periodIndex;
2251
- c.has(f) || c.set(f, {
2252
- __periodDayIndex: f,
2257
+ const u = h.__periodDayIndex, N = h.__periodIndex;
2258
+ c.has(u) || c.set(u, {
2259
+ __periodDayIndex: u,
2253
2260
  // Store the date from the first period (index 0) for reference
2254
- __displayDate: w === 0 ? h[r] : void 0
2261
+ __displayDate: N === 0 ? h[r] : void 0
2255
2262
  });
2256
- const N = c.get(f);
2257
- !N.__displayDate && h[r] && (N.__displayDate = h[r]);
2263
+ const w = c.get(u);
2264
+ !w.__displayDate && h[r] && (w.__displayDate = h[r]);
2258
2265
  let A = "";
2259
2266
  l && (A = a.map((S) => {
2260
2267
  const g = h[S];
2261
2268
  return n ? n(String(g)) : String(g);
2262
2269
  }).join(" / "));
2263
- const p = it(i[w] || "", w);
2270
+ const p = it(i[N] || "", N);
2264
2271
  for (const v of t) {
2265
2272
  const S = n ? n(v) : v, g = A ? `${A} - ${S} (${p})` : `${S} (${p})`;
2266
- N[g] = h[v];
2273
+ w[g] = h[v];
2267
2274
  }
2268
2275
  }
2269
- const u = Array.from(c.values()).sort((h, f) => h.__periodDayIndex - f.__periodDayIndex), m = [];
2276
+ const f = Array.from(c.values()).sort((h, u) => h.__periodDayIndex - u.__periodDayIndex), m = [];
2270
2277
  if (l && d) {
2271
2278
  const h = Vs(
2272
2279
  a,
2273
2280
  d,
2274
2281
  n
2275
2282
  );
2276
- for (const f of h)
2277
- for (const w of t) {
2278
- const N = n ? n(w) : w;
2283
+ for (const u of h)
2284
+ for (const N of t) {
2285
+ const w = n ? n(N) : N;
2279
2286
  for (let A = 0; A < s.length; A++) {
2280
2287
  const p = it(i[A] || "", A);
2281
- m.push(`${f} - ${N} (${p})`);
2288
+ m.push(`${u} - ${w} (${p})`);
2282
2289
  }
2283
2290
  }
2284
2291
  } else
2285
2292
  for (const h of t) {
2286
- const f = n ? n(h) : h;
2287
- for (let w = 0; w < s.length; w++) {
2288
- const N = it(i[w] || "", w);
2289
- m.push(`${f} (${N})`);
2293
+ const u = n ? n(h) : h;
2294
+ for (let N = 0; N < s.length; N++) {
2295
+ const w = it(i[N] || "", N);
2296
+ m.push(`${u} (${w})`);
2290
2297
  }
2291
2298
  }
2292
2299
  return {
2293
- data: u,
2300
+ data: f,
2294
2301
  seriesKeys: m,
2295
2302
  xAxisKey: "__periodDayIndex"
2296
2303
  };
@@ -2339,18 +2346,18 @@ function Ps(e = "dashed") {
2339
2346
  }
2340
2347
  }
2341
2348
  function $e({ children: e, height: t = "100%" }) {
2342
- const r = ye(null), [n, i] = Z(!1), [s, a] = Z({ width: 0, height: 0 });
2349
+ const r = ye(null), [n, i] = Q(!1), [s, a] = Q({ width: 0, height: 0 });
2343
2350
  Pt(() => {
2344
2351
  let l = !0, d = null;
2345
2352
  const c = () => {
2346
2353
  if (!l || !r.current) return;
2347
- const u = r.current.getBoundingClientRect(), m = Math.max(r.current.clientWidth, u.width), h = Math.max(r.current.clientHeight, u.height);
2354
+ const f = r.current.getBoundingClientRect(), m = Math.max(r.current.clientWidth, f.width), h = Math.max(r.current.clientHeight, f.height);
2348
2355
  m > 0 && h > 0 && (a({ width: m, height: h }), i(!0));
2349
2356
  };
2350
- return d = new ResizeObserver((u) => {
2351
- for (const m of u) {
2352
- const { width: h, height: f } = m.contentRect;
2353
- h > 0 && f > 0 && (a({ width: h, height: f }), n || i(!0));
2357
+ return d = new ResizeObserver((f) => {
2358
+ for (const m of f) {
2359
+ const { width: h, height: u } = m.contentRect;
2360
+ h > 0 && u > 0 && (a({ width: h, height: u }), n || i(!0));
2354
2361
  }
2355
2362
  }), r.current && (d.observe(r.current), c()), () => {
2356
2363
  l = !1, d?.disconnect();
@@ -2479,34 +2486,34 @@ const Us = de.memo(function({
2479
2486
  height: s = "100%",
2480
2487
  colorPalette: a
2481
2488
  }) {
2482
- const [l, d] = Z(null), c = ve(), u = n?.stackType ?? (n?.stacked ? "normal" : "none"), m = u !== "none", h = u === "percent", f = {
2489
+ const [l, d] = Q(null), c = ve(), f = n?.stackType ?? (n?.stacked ? "normal" : "none"), m = f !== "none", h = f === "percent", u = {
2483
2490
  showLegend: n?.showLegend ?? !0,
2484
2491
  showGrid: n?.showGrid ?? !0,
2485
2492
  showTooltip: n?.showTooltip ?? !0
2486
- }, w = n?.leftYAxisFormat, N = n?.rightYAxisFormat;
2493
+ }, N = n?.leftYAxisFormat, w = n?.rightYAxisFormat;
2487
2494
  let A, p = [], v = [], S = null;
2488
2495
  r?.xAxis && r?.yAxis ? (A = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, p = Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis], v = r.series || []) : r?.x && r?.y ? (A = r.x, p = Array.isArray(r.y) ? r.y : [r.y]) : S = "Invalid or missing chart axis configuration", !S && (!A || !p || p.length === 0) && (S = "Missing required X-axis or Y-axis fields");
2489
- const { data: g, seriesKeys: b } = J(() => S || !t || t.length === 0 || !A ? { data: [], seriesKeys: [] } : Ze(
2496
+ const { data: g, seriesKeys: b } = Z(() => S || !t || t.length === 0 || !A ? { data: [], seriesKeys: [] } : Ze(
2490
2497
  t,
2491
2498
  A,
2492
2499
  p,
2493
2500
  i,
2494
2501
  v,
2495
2502
  c
2496
- ), [t, A, p, i, v, c, S]), C = J(
2503
+ ), [t, A, p, i, v, c, S]), D = Z(
2497
2504
  () => r?.yAxisAssignment || {},
2498
2505
  [r?.yAxisAssignment]
2499
- ), _ = J(() => {
2500
- const D = {};
2506
+ ), _ = Z(() => {
2507
+ const C = {};
2501
2508
  return p.forEach((V) => {
2502
2509
  const P = c(V);
2503
- D[P] = V;
2504
- }), D;
2505
- }, [p, c]), $ = p.some((D) => C[D] === "right"), T = p.filter((D) => (C[D] || "left") === "left"), y = p.filter((D) => C[D] === "right"), { chartData: x, skippedCount: z } = J(() => {
2510
+ C[P] = V;
2511
+ }), C;
2512
+ }, [p, c]), $ = p.some((C) => D[C] === "right"), T = p.filter((C) => (D[C] || "left") === "left"), y = p.filter((C) => D[C] === "right"), { chartData: x, skippedCount: z } = Z(() => {
2506
2513
  if (g.length === 0 || b.length === 0)
2507
2514
  return { chartData: [], skippedCount: 0 };
2508
- const D = g.filter((P) => b.some((Y) => ot(P[Y]))), V = g.length - D.length;
2509
- return { chartData: D, skippedCount: V };
2515
+ const C = g.filter((P) => b.some((Y) => ot(P[Y]))), V = g.length - C.length;
2516
+ return { chartData: C, skippedCount: V };
2510
2517
  }, [g, b]);
2511
2518
  try {
2512
2519
  if (!t || t.length === 0)
@@ -2519,16 +2526,16 @@ const Us = de.memo(function({
2519
2526
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
2520
2527
  /* @__PURE__ */ o("div", { className: "text-xs", children: S })
2521
2528
  ] }) });
2522
- const D = m && !$, V = h && !$, P = V ? "expand" : void 0, Y = b.length === 1 && x.some((M) => {
2529
+ const C = m && !$, V = h && !$, P = V ? "expand" : void 0, Y = b.length === 1 && x.some((M) => {
2523
2530
  const U = M[b[0]];
2524
2531
  return typeof U == "number" && U < 0;
2525
- }), X = f.showLegend, F = {
2532
+ }), X = u.showLegend, F = {
2526
2533
  ...je,
2527
2534
  left: 40,
2528
2535
  // Space for left Y-axis label
2529
2536
  right: $ ? 40 : 20
2530
2537
  // Extra space for right Y-axis label if needed
2531
- }, L = wt(n?.target || ""), B = Ut(L, x.length);
2538
+ }, E = wt(n?.target || ""), B = Ut(E, x.length);
2532
2539
  let R = x;
2533
2540
  return B.length > 0 && (R = x.map((M, U) => ({
2534
2541
  ...M,
@@ -2538,7 +2545,7 @@ const Us = de.memo(function({
2538
2545
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for bar chart after transformation" })
2539
2546
  ] }) }) : /* @__PURE__ */ k("div", { className: "relative w-full", style: { height: s }, children: [
2540
2547
  /* @__PURE__ */ o($e, { height: z > 0 ? "calc(100% - 20px)" : "100%", children: /* @__PURE__ */ k(zr, { data: R, margin: F, stackOffset: P, children: [
2541
- f.showGrid && /* @__PURE__ */ o(yt, { strokeDasharray: "3 3" }),
2548
+ u.showGrid && /* @__PURE__ */ o(yt, { strokeDasharray: "3 3" }),
2542
2549
  /* @__PURE__ */ o(
2543
2550
  gt,
2544
2551
  {
@@ -2555,10 +2562,10 @@ const Us = de.memo(function({
2555
2562
  yAxisId: "left",
2556
2563
  orientation: "left",
2557
2564
  tick: { fontSize: 12 },
2558
- tickFormatter: V ? (M) => `${(M * 100).toFixed(0)}%` : w ? (M) => W(M, w) : void 0,
2565
+ tickFormatter: V ? (M) => `${(M * 100).toFixed(0)}%` : N ? (M) => W(M, N) : void 0,
2559
2566
  domain: V ? [0, 1] : void 0,
2560
2567
  label: V ? void 0 : T.length > 0 ? {
2561
- value: w?.label || c(T[0]),
2568
+ value: N?.label || c(T[0]),
2562
2569
  angle: -90,
2563
2570
  position: "left",
2564
2571
  style: { textAnchor: "middle", fontSize: "12px" }
@@ -2571,26 +2578,26 @@ const Us = de.memo(function({
2571
2578
  yAxisId: "right",
2572
2579
  orientation: "right",
2573
2580
  tick: { fontSize: 12 },
2574
- tickFormatter: N ? (M) => W(M, N) : void 0,
2581
+ tickFormatter: w ? (M) => W(M, w) : void 0,
2575
2582
  label: y.length > 0 ? {
2576
- value: N?.label || c(y[0]),
2583
+ value: w?.label || c(y[0]),
2577
2584
  angle: 90,
2578
2585
  position: "right",
2579
2586
  style: { textAnchor: "middle", fontSize: "12px" }
2580
2587
  } : void 0
2581
2588
  }
2582
2589
  ),
2583
- f.showTooltip && /* @__PURE__ */ o(
2590
+ u.showTooltip && /* @__PURE__ */ o(
2584
2591
  Pe,
2585
2592
  {
2586
2593
  formatter: (M, U) => {
2587
2594
  if (M == null)
2588
2595
  return ["No data", U];
2589
2596
  if (U === "Target")
2590
- return [W(M, w), "Target Value"];
2597
+ return [W(M, N), "Target Value"];
2591
2598
  if (V && typeof M == "number")
2592
2599
  return [`${(M * 100).toFixed(1)}%`, U];
2593
- const O = _[U], te = (O && C[O] === "right" ? "right" : "left") === "right" ? N : w;
2600
+ const O = _[U], te = (O && D[O] === "right" ? "right" : "left") === "right" ? w : N;
2594
2601
  return [W(M, te), U];
2595
2602
  }
2596
2603
  }
@@ -2609,13 +2616,13 @@ const Us = de.memo(function({
2609
2616
  }
2610
2617
  ),
2611
2618
  b.map((M, U) => {
2612
- const O = _[M], K = O && C[O] === "right" ? "right" : "left";
2619
+ const O = _[M], K = O && D[O] === "right" ? "right" : "left";
2613
2620
  return /* @__PURE__ */ o(
2614
2621
  xn,
2615
2622
  {
2616
2623
  dataKey: M,
2617
2624
  yAxisId: K,
2618
- stackId: D ? "stack" : void 0,
2625
+ stackId: C ? "stack" : void 0,
2619
2626
  fill: Y ? sr : a?.colors && a.colors[U % a.colors.length] || G[U % G.length],
2620
2627
  fillOpacity: l ? l === M ? 1 : 0.3 : 1,
2621
2628
  children: Y && x.map((te, fe) => {
@@ -2635,7 +2642,7 @@ const Us = de.memo(function({
2635
2642
  }),
2636
2643
  B.length > 0 && /* @__PURE__ */ k(Vt, { children: [
2637
2644
  /* @__PURE__ */ o(
2638
- Ee,
2645
+ Re,
2639
2646
  {
2640
2647
  type: "monotone",
2641
2648
  dataKey: "__target",
@@ -2648,7 +2655,7 @@ const Us = de.memo(function({
2648
2655
  }
2649
2656
  ),
2650
2657
  /* @__PURE__ */ o(
2651
- Ee,
2658
+ Re,
2652
2659
  {
2653
2660
  type: "monotone",
2654
2661
  dataKey: "__target",
@@ -2671,10 +2678,10 @@ const Us = de.memo(function({
2671
2678
  " with no values hidden"
2672
2679
  ] })
2673
2680
  ] });
2674
- } catch (D) {
2681
+ } catch (C) {
2675
2682
  return /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center w-full text-dc-error p-4", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
2676
2683
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Bar Chart Error" }),
2677
- /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: D instanceof Error ? D.message : "Unknown rendering error" }),
2684
+ /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: C instanceof Error ? C.message : "Unknown rendering error" }),
2678
2685
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
2679
2686
  ] }) });
2680
2687
  }
@@ -2689,76 +2696,76 @@ const Us = de.memo(function({
2689
2696
  height: s = "100%",
2690
2697
  colorPalette: a
2691
2698
  }) {
2692
- const [l, d] = Z(null), c = ve();
2699
+ const [l, d] = Q(null), c = ve(), f = Z(() => r?.yAxis ? Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis] : r?.y ? Array.isArray(r.y) ? r.y : [r.y] : [], [r?.yAxis, r?.y]), m = Z(
2700
+ () => r?.yAxisAssignment || {},
2701
+ [r?.yAxisAssignment]
2702
+ ), h = Z(() => {
2703
+ const u = {};
2704
+ return f.forEach((N) => {
2705
+ const w = c(N);
2706
+ u[w] = N;
2707
+ }), u;
2708
+ }, [f, c]);
2693
2709
  try {
2694
2710
  const u = {
2695
2711
  showLegend: n?.showLegend ?? !0,
2696
2712
  showGrid: n?.showGrid ?? !0,
2697
2713
  showTooltip: n?.showTooltip ?? !0,
2698
2714
  connectNulls: n?.connectNulls ?? !1
2699
- }, m = n?.leftYAxisFormat, h = n?.rightYAxisFormat;
2715
+ }, N = n?.leftYAxisFormat, w = n?.rightYAxisFormat;
2700
2716
  if (!t || t.length === 0)
2701
2717
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
2702
2718
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
2703
2719
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in line chart" })
2704
2720
  ] }) });
2705
- let f, w, N = [];
2721
+ let A, p = [];
2706
2722
  if (r?.xAxis && r?.yAxis)
2707
- f = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, w = Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis], N = r.series || [];
2723
+ A = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, p = r.series || [];
2708
2724
  else if (r?.x && r?.y)
2709
- f = r.x, w = Array.isArray(r.y) ? r.y : [r.y];
2725
+ A = r.x;
2710
2726
  else
2711
2727
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
2712
2728
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
2713
2729
  /* @__PURE__ */ o("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
2714
2730
  ] }) });
2715
- if (!f || !w || w.length === 0)
2731
+ if (!A || f.length === 0)
2716
2732
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
2717
2733
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
2718
2734
  /* @__PURE__ */ o("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
2719
2735
  ] }) });
2720
- const A = vt(t), p = n?.priorPeriodStyle || "dashed", v = n?.priorPeriodOpacity ?? 0.5, S = A ? Hr(t) : [];
2721
- let g, b, C = "name";
2722
- if (A) {
2723
- const F = Is(t, w, f, c);
2724
- g = F.data, b = F.seriesKeys, C = "__periodDayIndex";
2736
+ const v = vt(t), S = n?.priorPeriodStyle || "dashed", g = n?.priorPeriodOpacity ?? 0.5, b = v ? Hr(t) : [];
2737
+ let D, _, $ = "name";
2738
+ if (v) {
2739
+ const F = Is(t, f, A, c);
2740
+ D = F.data, _ = F.seriesKeys, $ = "__periodDayIndex";
2725
2741
  } else {
2726
2742
  const F = Ze(
2727
2743
  t,
2744
+ A,
2728
2745
  f,
2729
- w,
2730
2746
  i,
2731
- N,
2747
+ p,
2732
2748
  c
2733
2749
  );
2734
- g = F.data, b = F.seriesKeys;
2750
+ D = F.data, _ = F.seriesKeys;
2735
2751
  }
2736
- const _ = J(
2737
- () => r?.yAxisAssignment || {},
2738
- [r?.yAxisAssignment]
2739
- ), $ = J(() => {
2740
- const F = {};
2741
- return w.forEach((L) => {
2742
- const B = c(L);
2743
- F[B] = L;
2744
- }), F;
2745
- }, [w, c]), T = (F) => {
2746
- if ($[F])
2747
- return $[F];
2752
+ const T = (F) => {
2753
+ if (h[F])
2754
+ return h[F];
2748
2755
  const B = F.replace(/\s*\((Current|Prior)\)$/, "").split(" - "), R = B[B.length - 1];
2749
- return $[R];
2750
- }, y = w.some((F) => _[F] === "right"), x = w.filter((F) => (_[F] || "left") === "left"), z = w.filter((F) => _[F] === "right"), D = u.showLegend, V = {
2756
+ return h[R];
2757
+ }, y = f.some((F) => m[F] === "right"), x = f.filter((F) => (m[F] || "left") === "left"), z = f.filter((F) => m[F] === "right"), C = u.showLegend, V = {
2751
2758
  ...je,
2752
2759
  left: 40,
2753
2760
  // Space for left Y-axis label
2754
2761
  right: y ? 40 : 20
2755
2762
  // Extra space for right Y-axis label if needed
2756
- }, P = wt(n?.target || ""), Y = Ut(P, g.length);
2757
- let X = g;
2758
- return Y.length > 0 && (X = g.map((F, L) => ({
2763
+ }, P = wt(n?.target || ""), Y = Ut(P, D.length);
2764
+ let X = D;
2765
+ return Y.length > 0 && (X = D.map((F, E) => ({
2759
2766
  ...F,
2760
- __target: Y[L] || null
2761
- }))), !g || g.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
2767
+ __target: Y[E] || null
2768
+ }))), !D || D.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
2762
2769
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
2763
2770
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for line chart after transformation" })
2764
2771
  ] }) }) : /* @__PURE__ */ o($e, { height: s, children: /* @__PURE__ */ k(yn, { data: X, margin: V, children: [
@@ -2766,15 +2773,15 @@ const Us = de.memo(function({
2766
2773
  /* @__PURE__ */ o(
2767
2774
  gt,
2768
2775
  {
2769
- dataKey: C,
2776
+ dataKey: $,
2770
2777
  tick: { fontSize: 12 },
2771
2778
  angle: -45,
2772
2779
  textAnchor: "end",
2773
2780
  height: 60,
2774
- tickFormatter: A ? (F, L) => {
2775
- const B = g[L];
2781
+ tickFormatter: v ? (F, E) => {
2782
+ const B = D[E];
2776
2783
  if (B?.__displayDate) {
2777
- const R = pe(i, f);
2784
+ const R = pe(i, A);
2778
2785
  return ee(B.__displayDate, R);
2779
2786
  }
2780
2787
  return `Period ${F + 1}`;
@@ -2787,9 +2794,9 @@ const Us = de.memo(function({
2787
2794
  yAxisId: "left",
2788
2795
  orientation: "left",
2789
2796
  tick: { fontSize: 12 },
2790
- tickFormatter: m ? (F) => W(F, m) : void 0,
2797
+ tickFormatter: N ? (F) => W(F, N) : void 0,
2791
2798
  label: x.length > 0 ? {
2792
- value: m?.label || c(x[0]),
2799
+ value: N?.label || c(x[0]),
2793
2800
  angle: -90,
2794
2801
  position: "left",
2795
2802
  style: { textAnchor: "middle", fontSize: "12px" }
@@ -2802,9 +2809,9 @@ const Us = de.memo(function({
2802
2809
  yAxisId: "right",
2803
2810
  orientation: "right",
2804
2811
  tick: { fontSize: 12 },
2805
- tickFormatter: h ? (F) => W(F, h) : void 0,
2812
+ tickFormatter: w ? (F) => W(F, w) : void 0,
2806
2813
  label: z.length > 0 ? {
2807
- value: h?.label || c(z[0]),
2814
+ value: w?.label || c(z[0]),
2808
2815
  angle: 90,
2809
2816
  position: "right",
2810
2817
  style: { textAnchor: "middle", fontSize: "12px" }
@@ -2814,19 +2821,19 @@ const Us = de.memo(function({
2814
2821
  u.showTooltip && /* @__PURE__ */ o(
2815
2822
  Pe,
2816
2823
  {
2817
- formatter: (F, L) => {
2824
+ formatter: (F, E) => {
2818
2825
  if (F == null)
2819
- return ["No data", L];
2820
- if (L === "Target")
2821
- return [W(F, m), "Target Value"];
2822
- const B = T(L), M = (B && _[B] === "right" ? "right" : "left") === "right" ? h : m;
2823
- return [W(F, M), L];
2826
+ return ["No data", E];
2827
+ if (E === "Target")
2828
+ return [W(F, N), "Target Value"];
2829
+ const B = T(E), M = (B && m[B] === "right" ? "right" : "left") === "right" ? w : N;
2830
+ return [W(F, M), E];
2824
2831
  },
2825
- labelFormatter: A ? (F, L) => {
2826
- if (L && L.length > 0) {
2827
- const B = L[0]?.payload;
2832
+ labelFormatter: v ? (F, E) => {
2833
+ if (E && E.length > 0) {
2834
+ const B = E[0]?.payload;
2828
2835
  if (B?.__displayDate) {
2829
- const R = pe(i, f);
2836
+ const R = pe(i, A);
2830
2837
  return ee(B.__displayDate, R);
2831
2838
  }
2832
2839
  }
@@ -2834,7 +2841,7 @@ const Us = de.memo(function({
2834
2841
  } : void 0
2835
2842
  }
2836
2843
  ),
2837
- D && /* @__PURE__ */ o(
2844
+ C && /* @__PURE__ */ o(
2838
2845
  Oe,
2839
2846
  {
2840
2847
  wrapperStyle: { fontSize: "12px", paddingTop: "25px" },
@@ -2847,15 +2854,15 @@ const Us = de.memo(function({
2847
2854
  onMouseLeave: () => d(null)
2848
2855
  }
2849
2856
  ),
2850
- b.map((F, L) => {
2851
- const B = T(F), R = B && _[B] === "right" ? "right" : "left", M = A && Os(F, S), U = M ? Ps(p) : void 0, O = M ? v : 1;
2857
+ _.map((F, E) => {
2858
+ const B = T(F), R = B && m[B] === "right" ? "right" : "left", M = v && Os(F, b), U = M ? Ps(S) : void 0, O = M ? g : 1;
2852
2859
  return /* @__PURE__ */ o(
2853
- Ee,
2860
+ Re,
2854
2861
  {
2855
2862
  type: "monotone",
2856
2863
  dataKey: F,
2857
2864
  yAxisId: R,
2858
- stroke: a?.colors && a.colors[L % a.colors.length] || G[L % G.length],
2865
+ stroke: a?.colors && a.colors[E % a.colors.length] || G[E % G.length],
2859
2866
  strokeWidth: M ? 1.5 : 2,
2860
2867
  strokeDasharray: U,
2861
2868
  dot: M ? !1 : { r: 3 },
@@ -2868,7 +2875,7 @@ const Us = de.memo(function({
2868
2875
  }),
2869
2876
  Y.length > 0 && /* @__PURE__ */ k(Vt, { children: [
2870
2877
  /* @__PURE__ */ o(
2871
- Ee,
2878
+ Re,
2872
2879
  {
2873
2880
  type: "monotone",
2874
2881
  dataKey: "__target",
@@ -2881,7 +2888,7 @@ const Us = de.memo(function({
2881
2888
  }
2882
2889
  ),
2883
2890
  /* @__PURE__ */ o(
2884
- Ee,
2891
+ Re,
2885
2892
  {
2886
2893
  type: "monotone",
2887
2894
  dataKey: "__target",
@@ -2915,14 +2922,14 @@ const Us = de.memo(function({
2915
2922
  height: s = "100%",
2916
2923
  colorPalette: a
2917
2924
  }) {
2918
- const [l, d] = Z(null), c = ve();
2925
+ const [l, d] = Q(null), c = ve();
2919
2926
  try {
2920
- const u = n?.stackType ?? (n?.stacked ? "normal" : "none"), m = u !== "none", h = u === "percent", f = {
2927
+ const f = n?.stackType ?? (n?.stacked ? "normal" : "none"), m = f !== "none", h = f === "percent", u = {
2921
2928
  showLegend: n?.showLegend ?? !0,
2922
2929
  showGrid: n?.showGrid ?? !0,
2923
2930
  showTooltip: n?.showTooltip ?? !0,
2924
2931
  connectNulls: n?.connectNulls ?? !1
2925
- }, w = n?.leftYAxisFormat, N = n?.rightYAxisFormat;
2932
+ }, N = n?.leftYAxisFormat, w = n?.rightYAxisFormat;
2926
2933
  if (!t || t.length === 0)
2927
2934
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
2928
2935
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
@@ -2950,12 +2957,12 @@ const Us = de.memo(function({
2950
2957
  i,
2951
2958
  v,
2952
2959
  c
2953
- ), b = r?.yAxisAssignment || {}, C = {};
2960
+ ), b = r?.yAxisAssignment || {}, D = {};
2954
2961
  p.forEach((F) => {
2955
- const L = c(F);
2956
- C[L] = F;
2962
+ const E = c(F);
2963
+ D[E] = F;
2957
2964
  });
2958
- const _ = p.some((F) => b[F] === "right"), $ = p.filter((F) => (b[F] || "left") === "left"), T = p.filter((F) => b[F] === "right"), y = m && !_, x = h && !_, z = f.showLegend, D = {
2965
+ const _ = p.some((F) => b[F] === "right"), $ = p.filter((F) => (b[F] || "left") === "left"), T = p.filter((F) => b[F] === "right"), y = m && !_, x = h && !_, z = u.showLegend, C = {
2959
2966
  ...je,
2960
2967
  left: 40,
2961
2968
  // Space for left Y-axis label
@@ -2963,14 +2970,14 @@ const Us = de.memo(function({
2963
2970
  // Extra space for right Y-axis label if needed
2964
2971
  }, V = wt(n?.target || ""), P = Ut(V, S.length);
2965
2972
  let Y = S;
2966
- return P.length > 0 && (Y = S.map((F, L) => ({
2973
+ return P.length > 0 && (Y = S.map((F, E) => ({
2967
2974
  ...F,
2968
- __target: P[L] || null
2975
+ __target: P[E] || null
2969
2976
  }))), !S || S.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
2970
2977
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
2971
2978
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for area chart after transformation" })
2972
- ] }) }) : /* @__PURE__ */ o($e, { height: s, children: /* @__PURE__ */ k(zr, { data: Y, margin: D, stackOffset: x ? "expand" : void 0, children: [
2973
- f.showGrid && /* @__PURE__ */ o(yt, { strokeDasharray: "3 3" }),
2979
+ ] }) }) : /* @__PURE__ */ o($e, { height: s, children: /* @__PURE__ */ k(zr, { data: Y, margin: C, stackOffset: x ? "expand" : void 0, children: [
2980
+ u.showGrid && /* @__PURE__ */ o(yt, { strokeDasharray: "3 3" }),
2974
2981
  /* @__PURE__ */ o(gt, { dataKey: "name", tick: { fontSize: 12 }, angle: -45, textAnchor: "end", height: 60 }),
2975
2982
  /* @__PURE__ */ o(
2976
2983
  Ie,
@@ -2978,10 +2985,10 @@ const Us = de.memo(function({
2978
2985
  yAxisId: "left",
2979
2986
  orientation: "left",
2980
2987
  tick: { fontSize: 12 },
2981
- tickFormatter: x ? (F) => `${(F * 100).toFixed(0)}%` : w ? (F) => W(F, w) : void 0,
2988
+ tickFormatter: x ? (F) => `${(F * 100).toFixed(0)}%` : N ? (F) => W(F, N) : void 0,
2982
2989
  domain: x ? [0, 1] : void 0,
2983
2990
  label: x ? void 0 : $.length > 0 ? {
2984
- value: w?.label || c($[0]),
2991
+ value: N?.label || c($[0]),
2985
2992
  angle: -90,
2986
2993
  position: "left",
2987
2994
  style: { textAnchor: "middle", fontSize: "12px" }
@@ -2994,27 +3001,27 @@ const Us = de.memo(function({
2994
3001
  yAxisId: "right",
2995
3002
  orientation: "right",
2996
3003
  tick: { fontSize: 12 },
2997
- tickFormatter: N ? (F) => W(F, N) : void 0,
3004
+ tickFormatter: w ? (F) => W(F, w) : void 0,
2998
3005
  label: T.length > 0 ? {
2999
- value: N?.label || c(T[0]),
3006
+ value: w?.label || c(T[0]),
3000
3007
  angle: 90,
3001
3008
  position: "right",
3002
3009
  style: { textAnchor: "middle", fontSize: "12px" }
3003
3010
  } : void 0
3004
3011
  }
3005
3012
  ),
3006
- f.showTooltip && /* @__PURE__ */ o(
3013
+ u.showTooltip && /* @__PURE__ */ o(
3007
3014
  Pe,
3008
3015
  {
3009
- formatter: (F, L) => {
3016
+ formatter: (F, E) => {
3010
3017
  if (F == null)
3011
- return ["No data", L];
3012
- if (L === "Target")
3013
- return [W(F, w), "Target Value"];
3018
+ return ["No data", E];
3019
+ if (E === "Target")
3020
+ return [W(F, N), "Target Value"];
3014
3021
  if (x && typeof F == "number")
3015
- return [`${(F * 100).toFixed(1)}%`, L];
3016
- const B = C[L], M = (B && b[B] === "right" ? "right" : "left") === "right" ? N : w;
3017
- return [W(F, M), L];
3022
+ return [`${(F * 100).toFixed(1)}%`, E];
3023
+ const B = D[E], M = (B && b[B] === "right" ? "right" : "left") === "right" ? w : N;
3024
+ return [W(F, M), E];
3018
3025
  }
3019
3026
  }
3020
3027
  ),
@@ -3031,8 +3038,8 @@ const Us = de.memo(function({
3031
3038
  onMouseLeave: () => d(null)
3032
3039
  }
3033
3040
  ),
3034
- g.map((F, L) => {
3035
- const B = C[F], R = B && b[B] === "right" ? "right" : "left";
3041
+ g.map((F, E) => {
3042
+ const B = D[F], R = B && b[B] === "right" ? "right" : "left";
3036
3043
  return /* @__PURE__ */ o(
3037
3044
  gn,
3038
3045
  {
@@ -3040,19 +3047,19 @@ const Us = de.memo(function({
3040
3047
  dataKey: F,
3041
3048
  yAxisId: R,
3042
3049
  stackId: y ? "stack" : void 0,
3043
- stroke: a?.colors && a.colors[L % a.colors.length] || G[L % G.length],
3044
- fill: a?.colors && a.colors[L % a.colors.length] || G[L % G.length],
3050
+ stroke: a?.colors && a.colors[E % a.colors.length] || G[E % G.length],
3051
+ fill: a?.colors && a.colors[E % a.colors.length] || G[E % G.length],
3045
3052
  fillOpacity: l ? l === F ? 0.6 : 0.1 : 0.3,
3046
3053
  strokeWidth: 2,
3047
3054
  strokeOpacity: l ? l === F ? 1 : 0.3 : 1,
3048
- connectNulls: f.connectNulls
3055
+ connectNulls: u.connectNulls
3049
3056
  },
3050
3057
  F
3051
3058
  );
3052
3059
  }),
3053
3060
  P.length > 0 && /* @__PURE__ */ k(Vt, { children: [
3054
3061
  /* @__PURE__ */ o(
3055
- Ee,
3062
+ Re,
3056
3063
  {
3057
3064
  type: "monotone",
3058
3065
  dataKey: "__target",
@@ -3065,7 +3072,7 @@ const Us = de.memo(function({
3065
3072
  }
3066
3073
  ),
3067
3074
  /* @__PURE__ */ o(
3068
- Ee,
3075
+ Re,
3069
3076
  {
3070
3077
  type: "monotone",
3071
3078
  dataKey: "__target",
@@ -3081,10 +3088,10 @@ const Us = de.memo(function({
3081
3088
  )
3082
3089
  ] })
3083
3090
  ] }) });
3084
- } catch (u) {
3091
+ } catch (f) {
3085
3092
  return /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center w-full text-dc-error p-4", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3086
3093
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Area Chart Error" }),
3087
- /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
3094
+ /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: f instanceof Error ? f.message : "Unknown rendering error" }),
3088
3095
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
3089
3096
  ] }) });
3090
3097
  }
@@ -3099,9 +3106,9 @@ const Us = de.memo(function({
3099
3106
  height: s = "100%",
3100
3107
  colorPalette: a
3101
3108
  }) {
3102
- const [l, d] = Z(null), c = ve();
3109
+ const [l, d] = Q(null), c = ve();
3103
3110
  try {
3104
- const u = {
3111
+ const f = {
3105
3112
  showLegend: n?.showLegend ?? !0,
3106
3113
  showTooltip: n?.showTooltip ?? !0,
3107
3114
  leftYAxisFormat: n?.leftYAxisFormat
@@ -3111,28 +3118,28 @@ const Us = de.memo(function({
3111
3118
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
3112
3119
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in pie chart" })
3113
3120
  ] }) });
3114
- let m, h, f, w = [];
3121
+ let m, h, u, N = [];
3115
3122
  if (r?.xAxis && r?.yAxis)
3116
- h = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, f = Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis], w = r.series || [];
3123
+ h = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, u = Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis], N = r.series || [];
3117
3124
  else if (r?.x && r?.y)
3118
- h = r.x, f = Array.isArray(r.y) ? r.y : [r.y];
3125
+ h = r.x, u = Array.isArray(r.y) ? r.y : [r.y];
3119
3126
  else
3120
3127
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3121
3128
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
3122
3129
  /* @__PURE__ */ o("div", { className: "text-xs", children: "chartConfig.x/y or chartConfig.xAxis/yAxis required for pie chart" })
3123
3130
  ] }) });
3124
- if (!h || !f || f.length === 0)
3131
+ if (!h || !u || u.length === 0)
3125
3132
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3126
3133
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
3127
3134
  /* @__PURE__ */ o("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
3128
3135
  ] }) });
3129
- if (w.length > 0) {
3136
+ if (N.length > 0) {
3130
3137
  const { data: A } = Ze(
3131
3138
  t,
3132
3139
  h,
3133
- f,
3140
+ u,
3134
3141
  i,
3135
- w,
3142
+ N,
3136
3143
  c
3137
3144
  );
3138
3145
  if (m = [], A.length > 0) {
@@ -3150,16 +3157,16 @@ const Us = de.memo(function({
3150
3157
  let v = ee(p[h], A) || String(p[h]) || "Unknown";
3151
3158
  return typeof p[h] == "boolean" ? v = p[h] ? "Active" : "Inactive" : (v === "true" || v === "false") && (v = v === "true" ? "Active" : "Inactive"), {
3152
3159
  name: v,
3153
- value: typeof p[f[0]] == "string" ? parseFloat(p[f[0]]) : p[f[0]] || 0
3160
+ value: typeof p[u[0]] == "string" ? parseFloat(p[u[0]]) : p[u[0]] || 0
3154
3161
  };
3155
3162
  });
3156
3163
  }
3157
- const N = m.length;
3164
+ const w = m.length;
3158
3165
  return m = m.filter(
3159
3166
  (A) => A.value != null && !isNaN(A.value) && A.value !== 0 && A.value > 0
3160
3167
  ), m.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3161
3168
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
3162
- /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: N > 0 ? `Filtered out ${N} data points (zero or invalid values)` : "No data points to display in pie chart" })
3169
+ /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: w > 0 ? `Filtered out ${w} data points (zero or invalid values)` : "No data points to display in pie chart" })
3163
3170
  ] }) }) : /* @__PURE__ */ o($e, { height: s, children: /* @__PURE__ */ k(bn, { children: [
3164
3171
  /* @__PURE__ */ o(
3165
3172
  vn,
@@ -3169,7 +3176,7 @@ const Us = de.memo(function({
3169
3176
  cy: "50%",
3170
3177
  outerRadius: "70%",
3171
3178
  dataKey: "value",
3172
- label: u.showLegend ? void 0 : ({ name: A, percent: p }) => `${A} ${((p || 0) * 100).toFixed(0)}%`,
3179
+ label: f.showLegend ? void 0 : ({ name: A, percent: p }) => `${A} ${((p || 0) * 100).toFixed(0)}%`,
3173
3180
  children: m.map((A, p) => /* @__PURE__ */ o(
3174
3181
  Ht,
3175
3182
  {
@@ -3180,13 +3187,13 @@ const Us = de.memo(function({
3180
3187
  ))
3181
3188
  }
3182
3189
  ),
3183
- u.showTooltip && /* @__PURE__ */ o(
3190
+ f.showTooltip && /* @__PURE__ */ o(
3184
3191
  Pe,
3185
3192
  {
3186
- formatter: u.leftYAxisFormat ? (A, p) => [W(A, u.leftYAxisFormat), p] : void 0
3193
+ formatter: f.leftYAxisFormat ? (A, p) => [W(A, f.leftYAxisFormat), p] : void 0
3187
3194
  }
3188
3195
  ),
3189
- u.showLegend && /* @__PURE__ */ o(
3196
+ f.showLegend && /* @__PURE__ */ o(
3190
3197
  Oe,
3191
3198
  {
3192
3199
  wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
@@ -3200,10 +3207,10 @@ const Us = de.memo(function({
3200
3207
  }
3201
3208
  )
3202
3209
  ] }) });
3203
- } catch (u) {
3210
+ } catch (f) {
3204
3211
  return /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center w-full text-dc-error p-4", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3205
3212
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Pie Chart Error" }),
3206
- /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
3213
+ /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: f instanceof Error ? f.message : "Unknown rendering error" }),
3207
3214
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
3208
3215
  ] }) });
3209
3216
  }
@@ -3218,9 +3225,9 @@ const Us = de.memo(function({
3218
3225
  height: s = "100%",
3219
3226
  colorPalette: a
3220
3227
  }) {
3221
- const [l, d] = Z(null), c = ve();
3228
+ const [l, d] = Q(null), c = ve();
3222
3229
  try {
3223
- const u = {
3230
+ const f = {
3224
3231
  showLegend: n?.showLegend ?? !0,
3225
3232
  showGrid: n?.showGrid ?? !0,
3226
3233
  showTooltip: n?.showTooltip ?? !0
@@ -3230,37 +3237,37 @@ const Us = de.memo(function({
3230
3237
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
3231
3238
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in scatter chart" })
3232
3239
  ] }) });
3233
- let f, w, N = [];
3240
+ let u, N, w = [];
3234
3241
  if (r?.xAxis && r?.yAxis) {
3235
- f = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, w = Array.isArray(r.yAxis) ? r.yAxis[0] : r.yAxis;
3242
+ u = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, N = Array.isArray(r.yAxis) ? r.yAxis[0] : r.yAxis;
3236
3243
  const T = r.series;
3237
- N = T ? Array.isArray(T) ? T : [T] : [];
3244
+ w = T ? Array.isArray(T) ? T : [T] : [];
3238
3245
  } else if (r?.x && r?.y)
3239
- f = r.x, w = Array.isArray(r.y) ? r.y[0] : r.y;
3246
+ u = r.x, N = Array.isArray(r.y) ? r.y[0] : r.y;
3240
3247
  else
3241
3248
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3242
3249
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
3243
3250
  /* @__PURE__ */ o("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
3244
3251
  ] }) });
3245
- if (!f || !w)
3252
+ if (!u || !N)
3246
3253
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3247
3254
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
3248
3255
  /* @__PURE__ */ o("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
3249
3256
  ] }) });
3250
3257
  const p = (i?.timeDimensions || []).map((T) => T.dimension);
3251
3258
  let v, S = {};
3252
- if (N.length > 0) {
3253
- const T = N[0];
3259
+ if (w.length > 0) {
3260
+ const T = w[0];
3254
3261
  t.forEach((x) => {
3255
3262
  const z = String(x[T] || "Default");
3256
3263
  S[z] || (S[z] = []);
3257
- const D = pe(i, f), V = ee(x[f], D) || x[f], P = Ve(x[w]), Y = typeof V == "string" ? parseFloat(V) : V;
3264
+ const C = pe(i, u), V = ee(x[u], C) || x[u], P = Ve(x[N]), Y = typeof V == "string" ? parseFloat(V) : V;
3258
3265
  if (ot(Y) && P !== null) {
3259
3266
  const X = {};
3260
3267
  p.forEach((F) => {
3261
3268
  if (x[F]) {
3262
- const L = pe(i, F);
3263
- X[F] = ee(x[F], L);
3269
+ const E = pe(i, F);
3270
+ X[F] = ee(x[F], E);
3264
3271
  }
3265
3272
  }), S[z].push({
3266
3273
  x: Y,
@@ -3272,21 +3279,21 @@ const Us = de.memo(function({
3272
3279
  }
3273
3280
  }), v = Object.keys(S).flatMap((x) => S[x]);
3274
3281
  } else {
3275
- const T = pe(i, f);
3282
+ const T = pe(i, u);
3276
3283
  v = t.map((y) => {
3277
- const x = ee(y[f], T) || y[f], z = Ve(y[w]), D = typeof x == "string" ? parseFloat(x) : x, V = {};
3284
+ const x = ee(y[u], T) || y[u], z = Ve(y[N]), C = typeof x == "string" ? parseFloat(x) : x, V = {};
3278
3285
  return p.forEach((P) => {
3279
3286
  if (y[P]) {
3280
3287
  const Y = pe(i, P);
3281
3288
  V[P] = ee(y[P], Y);
3282
3289
  }
3283
3290
  }), {
3284
- x: D,
3291
+ x: C,
3285
3292
  y: z,
3286
3293
  name: "Point",
3287
3294
  timeValues: V,
3288
3295
  originalItem: y,
3289
- isValid: ot(D) && z !== null
3296
+ isValid: ot(C) && z !== null
3290
3297
  };
3291
3298
  }).filter((y) => y.isValid);
3292
3299
  }
@@ -3295,19 +3302,19 @@ const Us = de.memo(function({
3295
3302
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
3296
3303
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for scatter chart after transformation" })
3297
3304
  ] }) });
3298
- const g = Object.keys(S), C = g.length > 1 && g.length <= 20, _ = u.showLegend && C, $ = {
3305
+ const g = Object.keys(S), D = g.length > 1 && g.length <= 20, _ = f.showLegend && D, $ = {
3299
3306
  ...je,
3300
3307
  left: 40
3301
3308
  // Increased from 20 to 40 for Y-axis label space
3302
3309
  };
3303
3310
  return /* @__PURE__ */ o($e, { height: s, children: /* @__PURE__ */ k(wn, { margin: $, children: [
3304
- u.showGrid && /* @__PURE__ */ o(yt, { strokeDasharray: "3 3" }),
3311
+ f.showGrid && /* @__PURE__ */ o(yt, { strokeDasharray: "3 3" }),
3305
3312
  /* @__PURE__ */ o(
3306
3313
  gt,
3307
3314
  {
3308
3315
  type: "number",
3309
3316
  dataKey: "x",
3310
- name: m?.label || c(f),
3317
+ name: m?.label || c(u),
3311
3318
  tick: { fontSize: 12 },
3312
3319
  tickFormatter: m ? (T) => W(T, m) : void 0
3313
3320
  }
@@ -3317,13 +3324,13 @@ const Us = de.memo(function({
3317
3324
  {
3318
3325
  type: "number",
3319
3326
  dataKey: "y",
3320
- name: h?.label || c(w),
3327
+ name: h?.label || c(N),
3321
3328
  tick: { fontSize: 12 },
3322
3329
  tickFormatter: h ? (T) => W(T, h) : void 0,
3323
- label: { value: h?.label || c(w), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
3330
+ label: { value: h?.label || c(N), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
3324
3331
  }
3325
3332
  ),
3326
- u.showTooltip && /* @__PURE__ */ o(
3333
+ f.showTooltip && /* @__PURE__ */ o(
3327
3334
  Cr,
3328
3335
  {
3329
3336
  cursor: { strokeDasharray: "3 3" },
@@ -3340,18 +3347,18 @@ const Us = de.memo(function({
3340
3347
  padding: "8px 12px"
3341
3348
  }, children: [
3342
3349
  /* @__PURE__ */ o("div", { style: { fontWeight: 600, marginBottom: "4px" }, children: x.name }),
3343
- x.timeValues && Object.keys(x.timeValues).length > 0 && /* @__PURE__ */ o("div", { style: { marginBottom: "4px", color: "#6b7280" }, children: Object.entries(x.timeValues).map(([z, D]) => /* @__PURE__ */ k("div", { children: [
3350
+ x.timeValues && Object.keys(x.timeValues).length > 0 && /* @__PURE__ */ o("div", { style: { marginBottom: "4px", color: "#6b7280" }, children: Object.entries(x.timeValues).map(([z, C]) => /* @__PURE__ */ k("div", { children: [
3344
3351
  c(z),
3345
3352
  ": ",
3346
- D
3353
+ C
3347
3354
  ] }, z)) }),
3348
3355
  /* @__PURE__ */ k("div", { children: [
3349
- m?.label || c(f),
3356
+ m?.label || c(u),
3350
3357
  ": ",
3351
3358
  W(x.x, m)
3352
3359
  ] }),
3353
3360
  /* @__PURE__ */ k("div", { children: [
3354
- h?.label || c(w),
3361
+ h?.label || c(N),
3355
3362
  ": ",
3356
3363
  W(x.y, h)
3357
3364
  ] })
@@ -3372,7 +3379,7 @@ const Us = de.memo(function({
3372
3379
  onMouseLeave: () => d(null)
3373
3380
  }
3374
3381
  ),
3375
- C ? (
3382
+ D ? (
3376
3383
  // Multiple series
3377
3384
  g.map((T, y) => /* @__PURE__ */ o(
3378
3385
  Jt,
@@ -3396,10 +3403,10 @@ const Us = de.memo(function({
3396
3403
  )
3397
3404
  )
3398
3405
  ] }) });
3399
- } catch (u) {
3406
+ } catch (f) {
3400
3407
  return /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center w-full text-dc-error p-4", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3401
3408
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Scatter Chart Error" }),
3402
- /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
3409
+ /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: f instanceof Error ? f.message : "Unknown rendering error" }),
3403
3410
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
3404
3411
  ] }) });
3405
3412
  }
@@ -3414,7 +3421,7 @@ const Us = de.memo(function({
3414
3421
  height: s = "100%",
3415
3422
  colorPalette: a
3416
3423
  }) {
3417
- const [l, d] = Z(null);
3424
+ const [l, d] = Q(null);
3418
3425
  try {
3419
3426
  const c = {
3420
3427
  showLegend: n?.showLegend ?? !0,
@@ -3427,48 +3434,48 @@ const Us = de.memo(function({
3427
3434
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
3428
3435
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in radar chart" })
3429
3436
  ] }) });
3430
- let u, m = [];
3437
+ let f, m = [];
3431
3438
  if (r?.xAxis && r?.yAxis) {
3432
- const h = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, f = Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis], w = r.series || [], { data: N, seriesKeys: A } = Ze(
3439
+ const h = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, u = Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis], N = r.series || [], { data: w, seriesKeys: A } = Ze(
3433
3440
  t,
3434
3441
  h,
3435
- f,
3442
+ u,
3436
3443
  i,
3437
- w
3444
+ N
3438
3445
  );
3439
- u = N, m = A;
3446
+ f = w, m = A;
3440
3447
  } else {
3441
- const h = t[0], f = Object.keys(h), w = f.find(
3448
+ const h = t[0], u = Object.keys(h), N = u.find(
3442
3449
  (A) => typeof h[A] == "string" || A.toLowerCase().includes("subject") || A.toLowerCase().includes("name") || A.toLowerCase().includes("category")
3443
- ) || f[0], N = f.filter(
3444
- (A) => typeof h[A] == "number" && A !== w
3450
+ ) || u[0], w = u.filter(
3451
+ (A) => typeof h[A] == "number" && A !== N
3445
3452
  );
3446
- if (N.length === 0)
3453
+ if (w.length === 0)
3447
3454
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3448
3455
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
3449
3456
  /* @__PURE__ */ o("div", { className: "text-xs", children: "No numeric fields found for radar chart values" })
3450
3457
  ] }) });
3451
- if (w) {
3452
- const A = pe(i, w);
3453
- u = t.map((p) => {
3458
+ if (N) {
3459
+ const A = pe(i, N);
3460
+ f = t.map((p) => {
3454
3461
  const v = {
3455
- name: ee(p[w], A) || String(p[w]) || "Unknown"
3462
+ name: ee(p[N], A) || String(p[N]) || "Unknown"
3456
3463
  };
3457
- return N.forEach((S) => {
3464
+ return w.forEach((S) => {
3458
3465
  const g = S.split(".").pop() || S;
3459
3466
  v[g] = typeof p[S] == "string" ? parseFloat(p[S]) : p[S] || 0;
3460
3467
  }), v;
3461
- }), m = N.map((p) => p.split(".").pop() || p);
3468
+ }), m = w.map((p) => p.split(".").pop() || p);
3462
3469
  } else
3463
- u = t.map((A) => ({
3464
- name: String(A[f[0]] || "Unknown"),
3465
- value: typeof A[N[0]] == "string" ? parseFloat(A[N[0]]) : A[N[0]] || 0
3470
+ f = t.map((A) => ({
3471
+ name: String(A[u[0]] || "Unknown"),
3472
+ value: typeof A[w[0]] == "string" ? parseFloat(A[w[0]]) : A[w[0]] || 0
3466
3473
  })), m = ["value"];
3467
3474
  }
3468
- return !u || u.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3475
+ return !f || f.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3469
3476
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
3470
3477
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for radar chart after transformation" })
3471
- ] }) }) : /* @__PURE__ */ o($e, { height: s, children: /* @__PURE__ */ k(Nn, { data: u, margin: { top: 20, right: 80, bottom: 20, left: 80 }, children: [
3478
+ ] }) }) : /* @__PURE__ */ o($e, { height: s, children: /* @__PURE__ */ k(Nn, { data: f, margin: { top: 20, right: 80, bottom: 20, left: 80 }, children: [
3472
3479
  c.showGrid && /* @__PURE__ */ o(An, {}),
3473
3480
  /* @__PURE__ */ o(
3474
3481
  Sn,
@@ -3489,7 +3496,7 @@ const Us = de.memo(function({
3489
3496
  c.showTooltip && /* @__PURE__ */ o(
3490
3497
  Pe,
3491
3498
  {
3492
- formatter: c.leftYAxisFormat ? (h, f) => [W(h, c.leftYAxisFormat), f] : void 0
3499
+ formatter: c.leftYAxisFormat ? (h, u) => [W(h, c.leftYAxisFormat), u] : void 0
3493
3500
  }
3494
3501
  ),
3495
3502
  c.showLegend && m.length > 1 && /* @__PURE__ */ o(
@@ -3505,13 +3512,13 @@ const Us = de.memo(function({
3505
3512
  onMouseLeave: () => d(null)
3506
3513
  }
3507
3514
  ),
3508
- m.map((h, f) => /* @__PURE__ */ o(
3515
+ m.map((h, u) => /* @__PURE__ */ o(
3509
3516
  Tn,
3510
3517
  {
3511
3518
  name: h,
3512
3519
  dataKey: h,
3513
- stroke: a?.colors && a.colors[f % a.colors.length] || G[f % G.length],
3514
- fill: a?.colors && a.colors[f % a.colors.length] || G[f % G.length],
3520
+ stroke: a?.colors && a.colors[u % a.colors.length] || G[u % G.length],
3521
+ fill: a?.colors && a.colors[u % a.colors.length] || G[u % G.length],
3515
3522
  fillOpacity: l ? l === h ? 0.6 : 0.1 : 0.3,
3516
3523
  strokeOpacity: l ? l === h ? 1 : 0.3 : 1,
3517
3524
  strokeWidth: 2
@@ -3537,7 +3544,7 @@ const Us = de.memo(function({
3537
3544
  height: s = "100%",
3538
3545
  colorPalette: a
3539
3546
  }) {
3540
- const [l, d] = Z(null);
3547
+ const [l, d] = Q(null);
3541
3548
  try {
3542
3549
  const c = {
3543
3550
  showLegend: n?.showLegend ?? !0,
@@ -3549,41 +3556,41 @@ const Us = de.memo(function({
3549
3556
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
3550
3557
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in radial bar chart" })
3551
3558
  ] }) });
3552
- let u;
3559
+ let f;
3553
3560
  if (r?.xAxis && r?.yAxis) {
3554
- const m = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, h = Array.isArray(r.yAxis) ? r.yAxis[0] : r.yAxis, f = pe(i, m);
3555
- u = t.map((w, N) => ({
3556
- name: ee(w[m], f) || String(w[m]) || "Unknown",
3557
- value: typeof w[h] == "string" ? parseFloat(w[h]) : w[h] || 0,
3558
- fill: a?.colors && a.colors[N % a.colors.length] || G[N % G.length]
3561
+ const m = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, h = Array.isArray(r.yAxis) ? r.yAxis[0] : r.yAxis, u = pe(i, m);
3562
+ f = t.map((N, w) => ({
3563
+ name: ee(N[m], u) || String(N[m]) || "Unknown",
3564
+ value: typeof N[h] == "string" ? parseFloat(N[h]) : N[h] || 0,
3565
+ fill: a?.colors && a.colors[w % a.colors.length] || G[w % G.length]
3559
3566
  }));
3560
3567
  } else {
3561
- const m = t[0], h = Object.keys(m), f = h.find(
3562
- (N) => typeof m[N] == "string" || N.toLowerCase().includes("name") || N.toLowerCase().includes("label") || N.toLowerCase().includes("category")
3563
- ) || h[0], w = h.find(
3564
- (N) => typeof m[N] == "number" && N !== f
3568
+ const m = t[0], h = Object.keys(m), u = h.find(
3569
+ (w) => typeof m[w] == "string" || w.toLowerCase().includes("name") || w.toLowerCase().includes("label") || w.toLowerCase().includes("category")
3570
+ ) || h[0], N = h.find(
3571
+ (w) => typeof m[w] == "number" && w !== u
3565
3572
  ) || h[1];
3566
- if (!w)
3573
+ if (!N)
3567
3574
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3568
3575
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
3569
3576
  /* @__PURE__ */ o("div", { className: "text-xs", children: "No numeric field found for radial bar chart values" })
3570
3577
  ] }) });
3571
- u = t.map((N, A) => {
3572
- let p = N[f];
3578
+ f = t.map((w, A) => {
3579
+ let p = w[u];
3573
3580
  return typeof p == "boolean" ? p = p ? "Active" : "Inactive" : p === "true" || p === "false" ? p = p === "true" ? "Active" : "Inactive" : p = String(p), {
3574
3581
  name: p,
3575
- value: typeof N[w] == "string" ? parseFloat(N[w]) : N[w] || 0,
3582
+ value: typeof w[N] == "string" ? parseFloat(w[N]) : w[N] || 0,
3576
3583
  fill: a?.colors && a.colors[A % a.colors.length] || G[A % G.length]
3577
3584
  };
3578
3585
  });
3579
3586
  }
3580
- return u = u.filter((m) => m.value != null && m.value !== 0), u.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3587
+ return f = f.filter((m) => m.value != null && m.value !== 0), f.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
3581
3588
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
3582
3589
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for radial bar chart after transformation" })
3583
3590
  ] }) }) : /* @__PURE__ */ o($e, { height: s, children: /* @__PURE__ */ k(
3584
3591
  Fn,
3585
3592
  {
3586
- data: u,
3593
+ data: f,
3587
3594
  innerRadius: "10%",
3588
3595
  outerRadius: "80%",
3589
3596
  margin: { top: 20, right: 30, bottom: 20, left: 30 },
@@ -3618,7 +3625,7 @@ const Us = de.memo(function({
3618
3625
  fontSize: 12,
3619
3626
  formatter: c.leftYAxisFormat ? (m) => W(m, c.leftYAxisFormat) : void 0
3620
3627
  },
3621
- children: u.map((m, h) => /* @__PURE__ */ o(
3628
+ children: f.map((m, h) => /* @__PURE__ */ o(
3622
3629
  Ht,
3623
3630
  {
3624
3631
  fill: m.fill,
@@ -3651,28 +3658,28 @@ function Zs(e, t) {
3651
3658
  function Yr(e) {
3652
3659
  let t, r, n;
3653
3660
  e.length !== 2 ? (t = st, r = (l, d) => st(e(l), d), n = (l, d) => e(l) - d) : (t = e === st || e === Zs ? e : Qs, r = e, n = e);
3654
- function i(l, d, c = 0, u = l.length) {
3655
- if (c < u) {
3656
- if (t(d, d) !== 0) return u;
3661
+ function i(l, d, c = 0, f = l.length) {
3662
+ if (c < f) {
3663
+ if (t(d, d) !== 0) return f;
3657
3664
  do {
3658
- const m = c + u >>> 1;
3659
- r(l[m], d) < 0 ? c = m + 1 : u = m;
3660
- } while (c < u);
3665
+ const m = c + f >>> 1;
3666
+ r(l[m], d) < 0 ? c = m + 1 : f = m;
3667
+ } while (c < f);
3661
3668
  }
3662
3669
  return c;
3663
3670
  }
3664
- function s(l, d, c = 0, u = l.length) {
3665
- if (c < u) {
3666
- if (t(d, d) !== 0) return u;
3671
+ function s(l, d, c = 0, f = l.length) {
3672
+ if (c < f) {
3673
+ if (t(d, d) !== 0) return f;
3667
3674
  do {
3668
- const m = c + u >>> 1;
3669
- r(l[m], d) <= 0 ? c = m + 1 : u = m;
3670
- } while (c < u);
3675
+ const m = c + f >>> 1;
3676
+ r(l[m], d) <= 0 ? c = m + 1 : f = m;
3677
+ } while (c < f);
3671
3678
  }
3672
3679
  return c;
3673
3680
  }
3674
- function a(l, d, c = 0, u = l.length) {
3675
- const m = i(l, d, c, u - 1);
3681
+ function a(l, d, c = 0, f = l.length) {
3682
+ const m = i(l, d, c, f - 1);
3676
3683
  return m > c && n(l[m - 1], d) > -n(l[m], d) ? m - 1 : m;
3677
3684
  }
3678
3685
  return { left: i, center: a, right: s };
@@ -3800,40 +3807,40 @@ function ha() {
3800
3807
  return !this.__axis;
3801
3808
  }
3802
3809
  function Ur(e, t) {
3803
- var r = [], n = null, i = null, s = 6, a = 6, l = 3, d = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, c = e === Tt || e === We ? -1 : 1, u = e === We || e === Ft ? "x" : "y", m = e === Tt || e === Ct ? da : ua;
3804
- function h(f) {
3805
- var w = n ?? (t.ticks ? t.ticks.apply(t, r) : t.domain()), N = i ?? (t.tickFormat ? t.tickFormat.apply(t, r) : ca), A = Math.max(s, 0) + l, p = t.range(), v = +p[0] + d, S = +p[p.length - 1] + d, g = (t.bandwidth ? ma : fa)(t.copy(), d), b = f.selection ? f.selection() : f, C = b.selectAll(".domain").data([null]), _ = b.selectAll(".tick").data(w, t).order(), $ = _.exit(), T = _.enter().append("g").attr("class", "tick"), y = _.select("line"), x = _.select("text");
3806
- C = C.merge(C.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), _ = _.merge(T), y = y.merge(T.append("line").attr("stroke", "currentColor").attr(u + "2", c * s)), x = x.merge(T.append("text").attr("fill", "currentColor").attr(u, c * A).attr("dy", e === Tt ? "0em" : e === Ct ? "0.71em" : "0.32em")), f !== b && (C = C.transition(f), _ = _.transition(f), y = y.transition(f), x = x.transition(f), $ = $.transition(f).attr("opacity", dr).attr("transform", function(z) {
3810
+ var r = [], n = null, i = null, s = 6, a = 6, l = 3, d = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, c = e === Tt || e === We ? -1 : 1, f = e === We || e === Ft ? "x" : "y", m = e === Tt || e === Ct ? da : ua;
3811
+ function h(u) {
3812
+ var N = n ?? (t.ticks ? t.ticks.apply(t, r) : t.domain()), w = i ?? (t.tickFormat ? t.tickFormat.apply(t, r) : ca), A = Math.max(s, 0) + l, p = t.range(), v = +p[0] + d, S = +p[p.length - 1] + d, g = (t.bandwidth ? ma : fa)(t.copy(), d), b = u.selection ? u.selection() : u, D = b.selectAll(".domain").data([null]), _ = b.selectAll(".tick").data(N, t).order(), $ = _.exit(), T = _.enter().append("g").attr("class", "tick"), y = _.select("line"), x = _.select("text");
3813
+ D = D.merge(D.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), _ = _.merge(T), y = y.merge(T.append("line").attr("stroke", "currentColor").attr(f + "2", c * s)), x = x.merge(T.append("text").attr("fill", "currentColor").attr(f, c * A).attr("dy", e === Tt ? "0em" : e === Ct ? "0.71em" : "0.32em")), u !== b && (D = D.transition(u), _ = _.transition(u), y = y.transition(u), x = x.transition(u), $ = $.transition(u).attr("opacity", dr).attr("transform", function(z) {
3807
3814
  return isFinite(z = g(z)) ? m(z + d) : this.getAttribute("transform");
3808
3815
  }), T.attr("opacity", dr).attr("transform", function(z) {
3809
- var D = this.parentNode.__axis;
3810
- return m((D && isFinite(D = D(z)) ? D : g(z)) + d);
3811
- })), $.remove(), C.attr("d", e === We || e === Ft ? a ? "M" + c * a + "," + v + "H" + d + "V" + S + "H" + c * a : "M" + d + "," + v + "V" + S : a ? "M" + v + "," + c * a + "V" + d + "H" + S + "V" + c * a : "M" + v + "," + d + "H" + S), _.attr("opacity", 1).attr("transform", function(z) {
3816
+ var C = this.parentNode.__axis;
3817
+ return m((C && isFinite(C = C(z)) ? C : g(z)) + d);
3818
+ })), $.remove(), D.attr("d", e === We || e === Ft ? a ? "M" + c * a + "," + v + "H" + d + "V" + S + "H" + c * a : "M" + d + "," + v + "V" + S : a ? "M" + v + "," + c * a + "V" + d + "H" + S + "V" + c * a : "M" + v + "," + d + "H" + S), _.attr("opacity", 1).attr("transform", function(z) {
3812
3819
  return m(g(z) + d);
3813
- }), y.attr(u + "2", c * s), x.attr(u, c * A).text(N), b.filter(ha).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", e === Ft ? "start" : e === We ? "end" : "middle"), b.each(function() {
3820
+ }), y.attr(f + "2", c * s), x.attr(f, c * A).text(w), b.filter(ha).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", e === Ft ? "start" : e === We ? "end" : "middle"), b.each(function() {
3814
3821
  this.__axis = g;
3815
3822
  });
3816
3823
  }
3817
- return h.scale = function(f) {
3818
- return arguments.length ? (t = f, h) : t;
3824
+ return h.scale = function(u) {
3825
+ return arguments.length ? (t = u, h) : t;
3819
3826
  }, h.ticks = function() {
3820
3827
  return r = Array.from(arguments), h;
3821
- }, h.tickArguments = function(f) {
3822
- return arguments.length ? (r = f == null ? [] : Array.from(f), h) : r.slice();
3823
- }, h.tickValues = function(f) {
3824
- return arguments.length ? (n = f == null ? null : Array.from(f), h) : n && n.slice();
3825
- }, h.tickFormat = function(f) {
3826
- return arguments.length ? (i = f, h) : i;
3827
- }, h.tickSize = function(f) {
3828
- return arguments.length ? (s = a = +f, h) : s;
3829
- }, h.tickSizeInner = function(f) {
3830
- return arguments.length ? (s = +f, h) : s;
3831
- }, h.tickSizeOuter = function(f) {
3832
- return arguments.length ? (a = +f, h) : a;
3833
- }, h.tickPadding = function(f) {
3834
- return arguments.length ? (l = +f, h) : l;
3835
- }, h.offset = function(f) {
3836
- return arguments.length ? (d = +f, h) : d;
3828
+ }, h.tickArguments = function(u) {
3829
+ return arguments.length ? (r = u == null ? [] : Array.from(u), h) : r.slice();
3830
+ }, h.tickValues = function(u) {
3831
+ return arguments.length ? (n = u == null ? null : Array.from(u), h) : n && n.slice();
3832
+ }, h.tickFormat = function(u) {
3833
+ return arguments.length ? (i = u, h) : i;
3834
+ }, h.tickSize = function(u) {
3835
+ return arguments.length ? (s = a = +u, h) : s;
3836
+ }, h.tickSizeInner = function(u) {
3837
+ return arguments.length ? (s = +u, h) : s;
3838
+ }, h.tickSizeOuter = function(u) {
3839
+ return arguments.length ? (a = +u, h) : a;
3840
+ }, h.tickPadding = function(u) {
3841
+ return arguments.length ? (l = +u, h) : l;
3842
+ }, h.offset = function(u) {
3843
+ return arguments.length ? (d = +u, h) : d;
3837
3844
  }, h;
3838
3845
  }
3839
3846
  function ur(e) {
@@ -3879,8 +3886,8 @@ function Gr(e) {
3879
3886
  function ga(e) {
3880
3887
  typeof e != "function" && (e = Gr(e));
3881
3888
  for (var t = this._groups, r = t.length, n = new Array(r), i = 0; i < r; ++i)
3882
- for (var s = t[i], a = s.length, l = n[i] = new Array(a), d, c, u = 0; u < a; ++u)
3883
- (d = s[u]) && (c = e.call(d, d.__data__, u, s)) && ("__data__" in d && (c.__data__ = d.__data__), l[u] = c);
3889
+ for (var s = t[i], a = s.length, l = n[i] = new Array(a), d, c, f = 0; f < a; ++f)
3890
+ (d = s[f]) && (c = e.call(d, d.__data__, f, s)) && ("__data__" in d && (c.__data__ = d.__data__), l[f] = c);
3884
3891
  return new ge(n, this._parents);
3885
3892
  }
3886
3893
  function ba(e) {
@@ -3971,24 +3978,24 @@ ct.prototype = {
3971
3978
  return this._parent.querySelectorAll(e);
3972
3979
  }
3973
3980
  };
3974
- function Ea(e) {
3981
+ function Ra(e) {
3975
3982
  return function() {
3976
3983
  return e;
3977
3984
  };
3978
3985
  }
3979
- function Ra(e, t, r, n, i, s) {
3986
+ function Ea(e, t, r, n, i, s) {
3980
3987
  for (var a = 0, l, d = t.length, c = s.length; a < c; ++a)
3981
3988
  (l = t[a]) ? (l.__data__ = s[a], n[a] = l) : r[a] = new ct(e, s[a]);
3982
3989
  for (; a < d; ++a)
3983
3990
  (l = t[a]) && (i[a] = l);
3984
3991
  }
3985
3992
  function Ia(e, t, r, n, i, s, a) {
3986
- var l, d, c = /* @__PURE__ */ new Map(), u = t.length, m = s.length, h = new Array(u), f;
3987
- for (l = 0; l < u; ++l)
3988
- (d = t[l]) && (h[l] = f = a.call(d, d.__data__, l, t) + "", c.has(f) ? i[l] = d : c.set(f, d));
3993
+ var l, d, c = /* @__PURE__ */ new Map(), f = t.length, m = s.length, h = new Array(f), u;
3994
+ for (l = 0; l < f; ++l)
3995
+ (d = t[l]) && (h[l] = u = a.call(d, d.__data__, l, t) + "", c.has(u) ? i[l] = d : c.set(u, d));
3989
3996
  for (l = 0; l < m; ++l)
3990
- f = a.call(e, s[l], l, s) + "", (d = c.get(f)) ? (n[l] = d, d.__data__ = s[l], c.delete(f)) : r[l] = new ct(e, s[l]);
3991
- for (l = 0; l < u; ++l)
3997
+ u = a.call(e, s[l], l, s) + "", (d = c.get(u)) ? (n[l] = d, d.__data__ = s[l], c.delete(u)) : r[l] = new ct(e, s[l]);
3998
+ for (l = 0; l < f; ++l)
3992
3999
  (d = t[l]) && c.get(h[l]) === d && (i[l] = d);
3993
4000
  }
3994
4001
  function Va(e) {
@@ -3996,14 +4003,14 @@ function Va(e) {
3996
4003
  }
3997
4004
  function Oa(e, t) {
3998
4005
  if (!arguments.length) return Array.from(this, Va);
3999
- var r = t ? Ia : Ra, n = this._parents, i = this._groups;
4000
- typeof e != "function" && (e = Ea(e));
4006
+ var r = t ? Ia : Ea, n = this._parents, i = this._groups;
4007
+ typeof e != "function" && (e = Ra(e));
4001
4008
  for (var s = i.length, a = new Array(s), l = new Array(s), d = new Array(s), c = 0; c < s; ++c) {
4002
- var u = n[c], m = i[c], h = m.length, f = Pa(e.call(u, u && u.__data__, c, n)), w = f.length, N = l[c] = new Array(w), A = a[c] = new Array(w), p = d[c] = new Array(h);
4003
- r(u, m, N, A, p, f, t);
4004
- for (var v = 0, S = 0, g, b; v < w; ++v)
4005
- if (g = N[v]) {
4006
- for (v >= S && (S = v + 1); !(b = A[S]) && ++S < w; ) ;
4009
+ var f = n[c], m = i[c], h = m.length, u = Pa(e.call(f, f && f.__data__, c, n)), N = u.length, w = l[c] = new Array(N), A = a[c] = new Array(N), p = d[c] = new Array(h);
4010
+ r(f, m, w, A, p, u, t);
4011
+ for (var v = 0, S = 0, g, b; v < N; ++v)
4012
+ if (g = w[v]) {
4013
+ for (v >= S && (S = v + 1); !(b = A[S]) && ++S < N; ) ;
4007
4014
  g._next = b || null;
4008
4015
  }
4009
4016
  }
@@ -4021,8 +4028,8 @@ function Ya(e, t, r) {
4021
4028
  }
4022
4029
  function ja(e) {
4023
4030
  for (var t = e.selection ? e.selection() : e, r = this._groups, n = t._groups, i = r.length, s = n.length, a = Math.min(i, s), l = new Array(i), d = 0; d < a; ++d)
4024
- for (var c = r[d], u = n[d], m = c.length, h = l[d] = new Array(m), f, w = 0; w < m; ++w)
4025
- (f = c[w] || u[w]) && (h[w] = f);
4031
+ for (var c = r[d], f = n[d], m = c.length, h = l[d] = new Array(m), u, N = 0; N < m; ++N)
4032
+ (u = c[N] || f[N]) && (h[N] = u);
4026
4033
  for (; d < i; ++d)
4027
4034
  l[d] = r[d];
4028
4035
  return new ge(l, this._parents);
@@ -4039,8 +4046,8 @@ function Ba(e) {
4039
4046
  return m && h ? e(m.__data__, h.__data__) : !m - !h;
4040
4047
  }
4041
4048
  for (var r = this._groups, n = r.length, i = new Array(n), s = 0; s < n; ++s) {
4042
- for (var a = r[s], l = a.length, d = i[s] = new Array(l), c, u = 0; u < l; ++u)
4043
- (c = a[u]) && (d[u] = c);
4049
+ for (var a = r[s], l = a.length, d = i[s] = new Array(l), c, f = 0; f < l; ++f)
4050
+ (c = a[f]) && (d[f] = c);
4044
4051
  d.sort(t);
4045
4052
  }
4046
4053
  return new ge(i, this._parents).order();
@@ -4273,12 +4280,12 @@ function Lo(e, t) {
4273
4280
  return this.insertBefore(r.apply(this, arguments), n.apply(this, arguments) || null);
4274
4281
  });
4275
4282
  }
4276
- function Eo() {
4283
+ function Ro() {
4277
4284
  var e = this.parentNode;
4278
4285
  e && e.removeChild(this);
4279
4286
  }
4280
- function Ro() {
4281
- return this.each(Eo);
4287
+ function Eo() {
4288
+ return this.each(Ro);
4282
4289
  }
4283
4290
  function Io() {
4284
4291
  var e = this.cloneNode(!1), t = this.parentNode;
@@ -4333,10 +4340,10 @@ function Bo(e, t, r) {
4333
4340
  if (arguments.length < 2) {
4334
4341
  var l = this.node().__on;
4335
4342
  if (l) {
4336
- for (var d = 0, c = l.length, u; d < c; ++d)
4337
- for (i = 0, u = l[d]; i < s; ++i)
4338
- if ((a = n[i]).type === u.type && a.name === u.name)
4339
- return u.value;
4343
+ for (var d = 0, c = l.length, f; d < c; ++d)
4344
+ for (i = 0, f = l[d]; i < s; ++i)
4345
+ if ((a = n[i]).type === f.type && a.name === f.name)
4346
+ return f.value;
4340
4347
  }
4341
4348
  return;
4342
4349
  }
@@ -4403,7 +4410,7 @@ ge.prototype = {
4403
4410
  lower: Do,
4404
4411
  append: Co,
4405
4412
  insert: Lo,
4406
- remove: Ro,
4413
+ remove: Eo,
4407
4414
  clone: Oo,
4408
4415
  datum: Po,
4409
4416
  on: Bo,
@@ -4630,7 +4637,7 @@ Wt(he, Lt, rn(Qe, {
4630
4637
  return this;
4631
4638
  },
4632
4639
  clamp() {
4633
- return new he(Re(this.r), Re(this.g), Re(this.b), ut(this.opacity));
4640
+ return new he(Ee(this.r), Ee(this.g), Ee(this.b), ut(this.opacity));
4634
4641
  },
4635
4642
  displayable() {
4636
4643
  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;
@@ -4650,16 +4657,16 @@ function ll() {
4650
4657
  }
4651
4658
  function br() {
4652
4659
  const e = ut(this.opacity);
4653
- return `${e === 1 ? "rgb(" : "rgba("}${Re(this.r)}, ${Re(this.g)}, ${Re(this.b)}${e === 1 ? ")" : `, ${e})`}`;
4660
+ return `${e === 1 ? "rgb(" : "rgba("}${Ee(this.r)}, ${Ee(this.g)}, ${Ee(this.b)}${e === 1 ? ")" : `, ${e})`}`;
4654
4661
  }
4655
4662
  function ut(e) {
4656
4663
  return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
4657
4664
  }
4658
- function Re(e) {
4665
+ function Ee(e) {
4659
4666
  return Math.max(0, Math.min(255, Math.round(e) || 0));
4660
4667
  }
4661
4668
  function ze(e) {
4662
- return e = Re(e), (e < 16 ? "0" : "") + e.toString(16);
4669
+ return e = Ee(e), (e < 16 ? "0" : "") + e.toString(16);
4663
4670
  }
4664
4671
  function vr(e, t, r, n) {
4665
4672
  return n <= 0 ? e = t = r = NaN : r <= 0 || r >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new be(e, t, r, n);
@@ -4738,8 +4745,8 @@ const Nr = (function e(t) {
4738
4745
  var r = fl(t);
4739
4746
  function n(i, s) {
4740
4747
  var a = r((i = Lt(i)).r, (s = Lt(s)).r), l = r(i.g, s.g), d = r(i.b, s.b), c = sn(i.opacity, s.opacity);
4741
- return function(u) {
4742
- return i.r = a(u), i.g = l(u), i.b = d(u), i.opacity = c(u), i + "";
4748
+ return function(f) {
4749
+ return i.r = a(f), i.g = l(f), i.b = d(f), i.opacity = c(f), i + "";
4743
4750
  };
4744
4751
  }
4745
4752
  return n.gamma = e, n;
@@ -4785,7 +4792,7 @@ function yl(e, t) {
4785
4792
  return n;
4786
4793
  };
4787
4794
  }
4788
- var Et = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, _t = new RegExp(Et.source, "g");
4795
+ var Rt = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, _t = new RegExp(Rt.source, "g");
4789
4796
  function gl(e) {
4790
4797
  return function() {
4791
4798
  return e;
@@ -4797,11 +4804,11 @@ function bl(e) {
4797
4804
  };
4798
4805
  }
4799
4806
  function vl(e, t) {
4800
- var r = Et.lastIndex = _t.lastIndex = 0, n, i, s, a = -1, l = [], d = [];
4801
- for (e = e + "", t = t + ""; (n = Et.exec(e)) && (i = _t.exec(t)); )
4807
+ var r = Rt.lastIndex = _t.lastIndex = 0, n, i, s, a = -1, l = [], d = [];
4808
+ for (e = e + "", t = t + ""; (n = Rt.exec(e)) && (i = _t.exec(t)); )
4802
4809
  (s = i.index) > r && (s = t.slice(r, s), l[a] ? l[a] += s : l[++a] = s), (n = n[0]) === (i = i[0]) ? l[a] ? l[a] += i : l[++a] = i : (l[++a] = null, d.push({ i: a, x: ft(n, i) })), r = _t.lastIndex;
4803
4810
  return r < t.length && (s = t.slice(r), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? d[0] ? bl(d[0].x) : gl(t) : (t = d.length, function(c) {
4804
- for (var u = 0, m; u < t; ++u) l[(m = d[u]).i] = m.x(c);
4811
+ for (var f = 0, m; f < t; ++f) l[(m = d[f]).i] = m.x(c);
4805
4812
  return l.join("");
4806
4813
  });
4807
4814
  }
@@ -4918,39 +4925,39 @@ function Ml(e) {
4918
4925
  var t = e.grouping === void 0 || e.thousands === void 0 ? kr : Al(Tr.call(e.grouping, Number), e.thousands + ""), r = e.currency === void 0 ? "" : e.currency[0] + "", n = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", s = e.numerals === void 0 ? kr : Sl(Tr.call(e.numerals, String)), a = e.percent === void 0 ? "%" : e.percent + "", l = e.minus === void 0 ? "−" : e.minus + "", d = e.nan === void 0 ? "NaN" : e.nan + "";
4919
4926
  function c(m) {
4920
4927
  m = ht(m);
4921
- var h = m.fill, f = m.align, w = m.sign, N = m.symbol, A = m.zero, p = m.width, v = m.comma, S = m.precision, g = m.trim, b = m.type;
4922
- b === "n" ? (v = !0, b = "g") : Sr[b] || (S === void 0 && (S = 12), g = !0, b = "g"), (A || h === "0" && f === "=") && (A = !0, h = "0", f = "=");
4923
- var C = N === "$" ? r : N === "#" && /[boxX]/.test(b) ? "0" + b.toLowerCase() : "", _ = N === "$" ? n : /[%p]/.test(b) ? a : "", $ = Sr[b], T = /[defgprs%]/.test(b);
4928
+ var h = m.fill, u = m.align, N = m.sign, w = m.symbol, A = m.zero, p = m.width, v = m.comma, S = m.precision, g = m.trim, b = m.type;
4929
+ b === "n" ? (v = !0, b = "g") : Sr[b] || (S === void 0 && (S = 12), g = !0, b = "g"), (A || h === "0" && u === "=") && (A = !0, h = "0", u = "=");
4930
+ var D = w === "$" ? r : w === "#" && /[boxX]/.test(b) ? "0" + b.toLowerCase() : "", _ = w === "$" ? n : /[%p]/.test(b) ? a : "", $ = Sr[b], T = /[defgprs%]/.test(b);
4924
4931
  S = S === void 0 ? 6 : /[gprs]/.test(b) ? Math.max(1, Math.min(21, S)) : Math.max(0, Math.min(20, S));
4925
4932
  function y(x) {
4926
- var z = C, D = _, V, P, Y;
4933
+ var z = D, C = _, V, P, Y;
4927
4934
  if (b === "c")
4928
- D = $(x) + D, x = "";
4935
+ C = $(x) + C, x = "";
4929
4936
  else {
4930
4937
  x = +x;
4931
4938
  var X = x < 0 || 1 / x < 0;
4932
- if (x = isNaN(x) ? d : $(Math.abs(x), S), g && (x = Tl(x)), X && +x == 0 && w !== "+" && (X = !1), z = (X ? w === "(" ? w : l : w === "-" || w === "(" ? "" : w) + z, D = (b === "s" ? Fr[8 + an / 3] : "") + D + (X && w === "(" ? ")" : ""), T) {
4939
+ if (x = isNaN(x) ? d : $(Math.abs(x), S), g && (x = Tl(x)), X && +x == 0 && N !== "+" && (X = !1), z = (X ? N === "(" ? N : l : N === "-" || N === "(" ? "" : N) + z, C = (b === "s" ? Fr[8 + an / 3] : "") + C + (X && N === "(" ? ")" : ""), T) {
4933
4940
  for (V = -1, P = x.length; ++V < P; )
4934
4941
  if (Y = x.charCodeAt(V), 48 > Y || Y > 57) {
4935
- D = (Y === 46 ? i + x.slice(V + 1) : x.slice(V)) + D, x = x.slice(0, V);
4942
+ C = (Y === 46 ? i + x.slice(V + 1) : x.slice(V)) + C, x = x.slice(0, V);
4936
4943
  break;
4937
4944
  }
4938
4945
  }
4939
4946
  }
4940
4947
  v && !A && (x = t(x, 1 / 0));
4941
- var F = z.length + x.length + D.length, L = F < p ? new Array(p - F + 1).join(h) : "";
4942
- switch (v && A && (x = t(L + x, L.length ? p - D.length : 1 / 0), L = ""), f) {
4948
+ var F = z.length + x.length + C.length, E = F < p ? new Array(p - F + 1).join(h) : "";
4949
+ switch (v && A && (x = t(E + x, E.length ? p - C.length : 1 / 0), E = ""), u) {
4943
4950
  case "<":
4944
- x = z + x + D + L;
4951
+ x = z + x + C + E;
4945
4952
  break;
4946
4953
  case "=":
4947
- x = z + L + x + D;
4954
+ x = z + E + x + C;
4948
4955
  break;
4949
4956
  case "^":
4950
- x = L.slice(0, F = L.length >> 1) + z + x + D + L.slice(F);
4957
+ x = E.slice(0, F = E.length >> 1) + z + x + C + E.slice(F);
4951
4958
  break;
4952
4959
  default:
4953
- x = L + z + x + D;
4960
+ x = E + z + x + C;
4954
4961
  break;
4955
4962
  }
4956
4963
  return s(x);
@@ -4959,15 +4966,15 @@ function Ml(e) {
4959
4966
  return m + "";
4960
4967
  }, y;
4961
4968
  }
4962
- function u(m, h) {
4963
- var f = c((m = ht(m), m.type = "f", m)), w = Math.max(-8, Math.min(8, Math.floor(Ue(h) / 3))) * 3, N = Math.pow(10, -w), A = Fr[8 + w / 3];
4969
+ function f(m, h) {
4970
+ var u = c((m = ht(m), m.type = "f", m)), N = Math.max(-8, Math.min(8, Math.floor(Ue(h) / 3))) * 3, w = Math.pow(10, -N), A = Fr[8 + N / 3];
4964
4971
  return function(p) {
4965
- return f(N * p) + A;
4972
+ return u(w * p) + A;
4966
4973
  };
4967
4974
  }
4968
4975
  return {
4969
4976
  format: c,
4970
- formatPrefix: u
4977
+ formatPrefix: f
4971
4978
  };
4972
4979
  }
4973
4980
  var rt, on, ln;
@@ -5038,27 +5045,27 @@ var _r = [0, 1];
5038
5045
  function Se(e) {
5039
5046
  return e;
5040
5047
  }
5041
- function Rt(e, t) {
5048
+ function Et(e, t) {
5042
5049
  return (t -= e = +e) ? function(r) {
5043
5050
  return (r - e) / t;
5044
5051
  } : zl(isNaN(t) ? NaN : 0.5);
5045
5052
  }
5046
- function El(e, t) {
5053
+ function Rl(e, t) {
5047
5054
  var r;
5048
5055
  return e > t && (r = e, e = t, t = r), function(n) {
5049
5056
  return Math.max(e, Math.min(t, n));
5050
5057
  };
5051
5058
  }
5052
- function Rl(e, t, r) {
5059
+ function El(e, t, r) {
5053
5060
  var n = e[0], i = e[1], s = t[0], a = t[1];
5054
- return i < n ? (n = Rt(i, n), s = r(a, s)) : (n = Rt(n, i), s = r(s, a)), function(l) {
5061
+ return i < n ? (n = Et(i, n), s = r(a, s)) : (n = Et(n, i), s = r(s, a)), function(l) {
5055
5062
  return s(n(l));
5056
5063
  };
5057
5064
  }
5058
5065
  function Il(e, t, r) {
5059
5066
  var n = Math.min(e.length, t.length) - 1, i = new Array(n), s = new Array(n), a = -1;
5060
5067
  for (e[n] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++a < n; )
5061
- i[a] = Rt(e[a], e[a + 1]), s[a] = r(t[a], t[a + 1]);
5068
+ i[a] = Et(e[a], e[a + 1]), s[a] = r(t[a], t[a + 1]);
5062
5069
  return function(l) {
5063
5070
  var d = jr(e, l, 1, n) - 1;
5064
5071
  return s[d](i[d](l));
@@ -5069,9 +5076,9 @@ function cn(e, t) {
5069
5076
  }
5070
5077
  function dn() {
5071
5078
  var e = _r, t = _r, r = Kt, n, i, s, a = Se, l, d, c;
5072
- function u() {
5079
+ function f() {
5073
5080
  var h = Math.min(e.length, t.length);
5074
- return a !== Se && (a = El(e[0], e[h - 1])), l = h > 2 ? Il : Rl, d = c = null, m;
5081
+ return a !== Se && (a = Rl(e[0], e[h - 1])), l = h > 2 ? Il : El, d = c = null, m;
5075
5082
  }
5076
5083
  function m(h) {
5077
5084
  return h == null || isNaN(h = +h) ? s : (d || (d = l(e.map(n), t, r)))(n(a(h)));
@@ -5079,19 +5086,19 @@ function dn() {
5079
5086
  return m.invert = function(h) {
5080
5087
  return a(i((c || (c = l(t, e.map(n), ft)))(h)));
5081
5088
  }, m.domain = function(h) {
5082
- return arguments.length ? (e = Array.from(h, Ll), u()) : e.slice();
5089
+ return arguments.length ? (e = Array.from(h, Ll), f()) : e.slice();
5083
5090
  }, m.range = function(h) {
5084
- return arguments.length ? (t = Array.from(h), u()) : t.slice();
5091
+ return arguments.length ? (t = Array.from(h), f()) : t.slice();
5085
5092
  }, m.rangeRound = function(h) {
5086
- return t = Array.from(h), r = wl, u();
5093
+ return t = Array.from(h), r = wl, f();
5087
5094
  }, m.clamp = function(h) {
5088
- return arguments.length ? (a = h ? !0 : Se, u()) : a !== Se;
5095
+ return arguments.length ? (a = h ? !0 : Se, f()) : a !== Se;
5089
5096
  }, m.interpolate = function(h) {
5090
- return arguments.length ? (r = h, u()) : r;
5097
+ return arguments.length ? (r = h, f()) : r;
5091
5098
  }, m.unknown = function(h) {
5092
5099
  return arguments.length ? (s = h, m) : s;
5093
- }, function(h, f) {
5094
- return n = h, i = f, u();
5100
+ }, function(h, u) {
5101
+ return n = h, i = u, f();
5095
5102
  };
5096
5103
  }
5097
5104
  function Vl() {
@@ -5130,8 +5137,8 @@ function qt(e) {
5130
5137
  return Ol(i[0], i[i.length - 1], r ?? 10, n);
5131
5138
  }, e.nice = function(r) {
5132
5139
  r == null && (r = 10);
5133
- var n = t(), i = 0, s = n.length - 1, a = n[i], l = n[s], d, c, u = 10;
5134
- for (l < a && (c = a, a = l, l = c, c = i, i = s, s = c); u-- > 0; ) {
5140
+ var n = t(), i = 0, s = n.length - 1, a = n[i], l = n[s], d, c, f = 10;
5141
+ for (l < a && (c = a, a = l, l = c, c = i, i = s, s = c); f-- > 0; ) {
5135
5142
  if (c = $t(a, l, r), c === d)
5136
5143
  return n[i] = a, n[s] = l, t(n);
5137
5144
  if (c > 0)
@@ -5213,9 +5220,9 @@ const Ul = de.memo(function({
5213
5220
  height: s = "100%",
5214
5221
  colorPalette: a
5215
5222
  }) {
5216
- const [l, d] = Z(null), c = ve();
5223
+ const [l, d] = Q(null), c = ve();
5217
5224
  try {
5218
- const u = {
5225
+ const f = {
5219
5226
  showTooltip: n?.showTooltip ?? !0,
5220
5227
  showLegend: n?.showLegend ?? !0,
5221
5228
  leftYAxisFormat: n?.leftYAxisFormat
@@ -5225,47 +5232,47 @@ const Ul = de.memo(function({
5225
5232
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
5226
5233
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in treemap chart" })
5227
5234
  ] }) });
5228
- let m, h = !1, f;
5235
+ let m, h = !1, u;
5229
5236
  if (r?.xAxis && r?.yAxis) {
5230
5237
  const g = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, b = Array.isArray(r.yAxis) ? r.yAxis[0] : r.yAxis;
5231
- f = Array.isArray(r.series) ? r.series[0] : r.series;
5232
- const C = pe(i, g);
5233
- if (f) {
5238
+ u = Array.isArray(r.series) ? r.series[0] : r.series;
5239
+ const D = pe(i, g);
5240
+ if (u) {
5234
5241
  const _ = t.map(($) => {
5235
- const T = $[f];
5242
+ const T = $[u];
5236
5243
  return typeof T == "string" ? parseFloat(T) : T;
5237
5244
  }).filter(($) => !isNaN($));
5238
5245
  if (h = _.length === t.length && _.every(($) => typeof $ == "number"), h) {
5239
5246
  const $ = Math.min(..._), T = Math.max(..._), y = At().domain([$, T]).range(Ce);
5240
5247
  m = t.map((x) => {
5241
- const z = typeof x[f] == "string" ? parseFloat(x[f]) : x[f], D = y(z);
5248
+ const z = typeof x[u] == "string" ? parseFloat(x[u]) : x[u], C = y(z);
5242
5249
  return {
5243
- name: ee(x[g], C) || String(x[g]) || "Unknown",
5250
+ name: ee(x[g], D) || String(x[g]) || "Unknown",
5244
5251
  size: typeof x[b] == "string" ? parseFloat(x[b]) : x[b] || 0,
5245
- fill: D,
5246
- series: String(x[f])
5252
+ fill: C,
5253
+ series: String(x[u])
5247
5254
  };
5248
5255
  });
5249
5256
  } else {
5250
- const $ = [...new Set(t.map((y) => String(y[f])))], T = pt().domain($).range(a?.colors || G);
5257
+ const $ = [...new Set(t.map((y) => String(y[u])))], T = pt().domain($).range(a?.colors || G);
5251
5258
  m = t.map((y) => ({
5252
- name: ee(y[g], C) || String(y[g]) || "Unknown",
5259
+ name: ee(y[g], D) || String(y[g]) || "Unknown",
5253
5260
  size: typeof y[b] == "string" ? parseFloat(y[b]) : y[b] || 0,
5254
- fill: T(String(y[f])),
5255
- series: String(y[f])
5261
+ fill: T(String(y[u])),
5262
+ series: String(y[u])
5256
5263
  }));
5257
5264
  }
5258
5265
  } else
5259
5266
  m = t.map((_, $) => ({
5260
- name: ee(_[g], C) || String(_[g]) || "Unknown",
5267
+ name: ee(_[g], D) || String(_[g]) || "Unknown",
5261
5268
  size: typeof _[b] == "string" ? parseFloat(_[b]) : _[b] || 0,
5262
5269
  fill: a?.colors && a.colors[$ % a.colors.length] || G[$ % G.length]
5263
5270
  }));
5264
5271
  } else {
5265
- const g = t[0], b = Object.keys(g), C = b.find(
5272
+ const g = t[0], b = Object.keys(g), D = b.find(
5266
5273
  ($) => typeof g[$] == "string" || $.toLowerCase().includes("name") || $.toLowerCase().includes("label") || $.toLowerCase().includes("category")
5267
5274
  ) || b[0], _ = b.find(($) => $.toLowerCase().includes("size")) || b.find(
5268
- ($) => typeof g[$] == "number" && $ !== C
5275
+ ($) => typeof g[$] == "number" && $ !== D
5269
5276
  ) || b[1];
5270
5277
  if (!_)
5271
5278
  return /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-warning", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
@@ -5273,7 +5280,7 @@ const Ul = de.memo(function({
5273
5280
  /* @__PURE__ */ o("div", { className: "text-xs", children: "No numeric field found for treemap chart size" })
5274
5281
  ] }) });
5275
5282
  m = t.map(($, T) => {
5276
- let y = $[C];
5283
+ let y = $[D];
5277
5284
  return typeof y == "boolean" ? y = y ? "Active" : "Inactive" : y === "true" || y === "false" ? y = y === "true" ? "Active" : "Inactive" : y = String(y), {
5278
5285
  name: y,
5279
5286
  size: typeof $[_] == "string" ? parseFloat($[_]) : $[_] || 0,
@@ -5286,14 +5293,14 @@ const Ul = de.memo(function({
5286
5293
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
5287
5294
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for treemap chart after transformation" })
5288
5295
  ] }) });
5289
- const w = (g) => {
5290
- const { x: b, y: C, width: _, height: $, index: T, name: y, size: x } = g;
5296
+ const N = (g) => {
5297
+ const { x: b, y: D, width: _, height: $, index: T, name: y, size: x } = g;
5291
5298
  return _ < 20 || $ < 20 ? null : /* @__PURE__ */ k("g", { children: [
5292
5299
  /* @__PURE__ */ o(
5293
5300
  "rect",
5294
5301
  {
5295
5302
  x: b,
5296
- y: C,
5303
+ y: D,
5297
5304
  width: _,
5298
5305
  height: $,
5299
5306
  style: {
@@ -5311,7 +5318,7 @@ const Ul = de.memo(function({
5311
5318
  "foreignObject",
5312
5319
  {
5313
5320
  x: b,
5314
- y: C,
5321
+ y: D,
5315
5322
  width: _,
5316
5323
  height: $,
5317
5324
  style: { pointerEvents: "none", overflow: "visible" },
@@ -5356,7 +5363,7 @@ const Ul = de.memo(function({
5356
5363
  textAlign: "center",
5357
5364
  opacity: 0.9
5358
5365
  },
5359
- children: u.leftYAxisFormat ? W(x, u.leftYAxisFormat) : typeof x == "number" ? x.toLocaleString() : x
5366
+ children: f.leftYAxisFormat ? W(x, f.leftYAxisFormat) : typeof x == "number" ? x.toLocaleString() : x
5360
5367
  }
5361
5368
  )
5362
5369
  ]
@@ -5367,21 +5374,21 @@ const Ul = de.memo(function({
5367
5374
  ] });
5368
5375
  }, A = m.some((g) => "series" in g) ? [...new Set(m.map((g) => g.series).filter(Boolean))] : [];
5369
5376
  let p = [];
5370
- if (u.showLegend && f)
5377
+ if (f.showLegend && u)
5371
5378
  if (h) {
5372
- const g = Math.min(...t.map((C) => {
5373
- const _ = C[f];
5379
+ const g = Math.min(...t.map((D) => {
5380
+ const _ = D[u];
5374
5381
  return typeof _ == "string" ? parseFloat(_) : _;
5375
- })), b = Math.max(...t.map((C) => {
5376
- const _ = C[f];
5382
+ })), b = Math.max(...t.map((D) => {
5383
+ const _ = D[u];
5377
5384
  return typeof _ == "string" ? parseFloat(_) : _;
5378
5385
  }));
5379
- p = Ce.map((C, _) => {
5386
+ p = Ce.map((D, _) => {
5380
5387
  const $ = _ / (Ce.length - 1), T = g + (b - g) * $;
5381
5388
  return {
5382
- value: u.leftYAxisFormat ? W(T, u.leftYAxisFormat) : T.toFixed(2),
5389
+ value: f.leftYAxisFormat ? W(T, f.leftYAxisFormat) : T.toFixed(2),
5383
5390
  type: "rect",
5384
- color: C
5391
+ color: D
5385
5392
  };
5386
5393
  });
5387
5394
  } else A.length > 1 && (p = A.map((g, b) => ({
@@ -5389,7 +5396,7 @@ const Ul = de.memo(function({
5389
5396
  type: "rect",
5390
5397
  color: G[b % G.length]
5391
5398
  })));
5392
- const v = u.showLegend && p.length > 0, S = v ? typeof s == "string" && s.includes("%") ? s : typeof s == "number" ? s + 60 : `calc(${s} + 60px)` : s;
5399
+ const v = f.showLegend && p.length > 0, S = v ? typeof s == "string" && s.includes("%") ? s : typeof s == "number" ? s + 60 : `calc(${s} + 60px)` : s;
5393
5400
  return /* @__PURE__ */ k("div", { className: "w-full", style: { height: S }, children: [
5394
5401
  /* @__PURE__ */ o($e, { height: v ? "calc(100% - 50px)" : "100%", children: /* @__PURE__ */ o(
5395
5402
  _n,
@@ -5398,11 +5405,11 @@ const Ul = de.memo(function({
5398
5405
  dataKey: "size",
5399
5406
  aspectRatio: 4 / 3,
5400
5407
  stroke: "#fff",
5401
- content: /* @__PURE__ */ o(w, {}),
5402
- children: u.showTooltip && /* @__PURE__ */ o(
5408
+ content: /* @__PURE__ */ o(N, {}),
5409
+ children: f.showTooltip && /* @__PURE__ */ o(
5403
5410
  Pe,
5404
5411
  {
5405
- formatter: u.leftYAxisFormat ? (g, b) => [W(g, u.leftYAxisFormat), b] : void 0
5412
+ formatter: f.leftYAxisFormat ? (g, b) => [W(g, f.leftYAxisFormat), b] : void 0
5406
5413
  }
5407
5414
  )
5408
5415
  }
@@ -5410,13 +5417,13 @@ const Ul = de.memo(function({
5410
5417
  v && /* @__PURE__ */ o("div", { className: "flex justify-center items-center mt-4 pb-2", children: h ? (
5411
5418
  // Gradient legend for numeric series
5412
5419
  /* @__PURE__ */ k("div", { className: "flex flex-col items-center", children: [
5413
- /* @__PURE__ */ o("div", { className: "text-xs font-semibold text-dc-text-primary mb-2", children: f ? c(f) : "" }),
5420
+ /* @__PURE__ */ o("div", { className: "text-xs font-semibold text-dc-text-primary mb-2", children: u ? c(u) : "" }),
5414
5421
  /* @__PURE__ */ k("div", { className: "flex items-center gap-2", children: [
5415
- /* @__PURE__ */ o("span", { className: "text-xs text-dc-text-muted", children: u.leftYAxisFormat ? W(Math.min(...t.map((g) => {
5416
- const b = g[f];
5422
+ /* @__PURE__ */ o("span", { className: "text-xs text-dc-text-muted", children: f.leftYAxisFormat ? W(Math.min(...t.map((g) => {
5423
+ const b = g[u];
5417
5424
  return typeof b == "string" ? parseFloat(b) : b;
5418
- })), u.leftYAxisFormat) : Math.min(...t.map((g) => {
5419
- const b = g[f];
5425
+ })), f.leftYAxisFormat) : Math.min(...t.map((g) => {
5426
+ const b = g[u];
5420
5427
  return typeof b == "string" ? parseFloat(b) : b;
5421
5428
  })).toFixed(2) }),
5422
5429
  /* @__PURE__ */ o(
@@ -5429,11 +5436,11 @@ const Ul = de.memo(function({
5429
5436
  }
5430
5437
  }
5431
5438
  ),
5432
- /* @__PURE__ */ o("span", { className: "text-xs text-dc-text-muted", children: u.leftYAxisFormat ? W(Math.max(...t.map((g) => {
5433
- const b = g[f];
5439
+ /* @__PURE__ */ o("span", { className: "text-xs text-dc-text-muted", children: f.leftYAxisFormat ? W(Math.max(...t.map((g) => {
5440
+ const b = g[u];
5434
5441
  return typeof b == "string" ? parseFloat(b) : b;
5435
- })), u.leftYAxisFormat) : Math.max(...t.map((g) => {
5436
- const b = g[f];
5442
+ })), f.leftYAxisFormat) : Math.max(...t.map((g) => {
5443
+ const b = g[u];
5437
5444
  return typeof b == "string" ? parseFloat(b) : b;
5438
5445
  })).toFixed(2) })
5439
5446
  ] })
@@ -5452,10 +5459,10 @@ const Ul = de.memo(function({
5452
5459
  ] }, b)) })
5453
5460
  ) })
5454
5461
  ] });
5455
- } catch (u) {
5462
+ } catch (f) {
5456
5463
  return /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center w-full text-dc-error p-4", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
5457
5464
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "TreeMap Chart Error" }),
5458
- /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
5465
+ /* @__PURE__ */ o("div", { className: "text-xs mb-2", children: f instanceof Error ? f.message : "Unknown rendering error" }),
5459
5466
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
5460
5467
  ] }) });
5461
5468
  }
@@ -5470,7 +5477,7 @@ const Ul = de.memo(function({
5470
5477
  height: s = "100%",
5471
5478
  colorPalette: a
5472
5479
  }) {
5473
- const l = ye(null), d = ye(null), [c, u] = Z({ width: 0, height: 0 }), [m, h] = Z(!1), { theme: f } = ws(), w = ve(), N = J(() => ({
5480
+ const l = ye(null), d = ye(null), [c, f] = Q({ width: 0, height: 0 }), [m, h] = Q(!1), { theme: u } = ws(), N = ve(), w = Z(() => ({
5474
5481
  showLegend: n?.showLegend ?? !0,
5475
5482
  showGrid: n?.showGrid ?? !0,
5476
5483
  showTooltip: n?.showTooltip ?? !0,
@@ -5497,7 +5504,7 @@ const Ul = de.memo(function({
5497
5504
  if (d.current) {
5498
5505
  const { width: _, height: $ } = d.current.getBoundingClientRect();
5499
5506
  if (_ > 0 && $ > 0)
5500
- return u({ width: _, height: $ }), h(!0), !0;
5507
+ return f({ width: _, height: $ }), h(!0), !0;
5501
5508
  }
5502
5509
  return !1;
5503
5510
  };
@@ -5517,13 +5524,13 @@ const Ul = de.memo(function({
5517
5524
  const v = () => {
5518
5525
  if (d.current) {
5519
5526
  const { width: S, height: g } = d.current.getBoundingClientRect();
5520
- S > 0 && g > 0 && (u({ width: S, height: g }), m || h(!0));
5527
+ S > 0 && g > 0 && (f({ width: S, height: g }), m || h(!0));
5521
5528
  }
5522
5529
  };
5523
5530
  return d.current && (p = new ResizeObserver((S) => {
5524
5531
  for (const g of S) {
5525
- const { width: b, height: C } = g.contentRect;
5526
- b > 0 && C > 0 && (u({ width: b, height: C }), m || h(!0));
5532
+ const { width: b, height: D } = g.contentRect;
5533
+ b > 0 && D > 0 && (f({ width: b, height: D }), m || h(!0));
5527
5534
  }
5528
5535
  }), p.observe(d.current), v()), window.addEventListener("resize", v), () => {
5529
5536
  p && p.disconnect(), window.removeEventListener("resize", v);
@@ -5534,10 +5541,10 @@ const Ul = de.memo(function({
5534
5541
  const p = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, v = Array.isArray(r.yAxis) ? r.yAxis[0] : r.yAxis, S = Array.isArray(r.series) ? r.series[0] : r.series, g = Array.isArray(r.sizeField) ? r.sizeField[0] : r.sizeField || v, b = Array.isArray(r.colorField) ? r.colorField[0] : r.colorField;
5535
5542
  if (!p || !v || !S || !g)
5536
5543
  return;
5537
- const C = pe(i, p), _ = i?.timeDimensions?.some(
5538
- (E) => E.dimension === p
5539
- ) || !1, $ = t.map((E) => {
5540
- const I = E[p];
5544
+ const D = pe(i, p), _ = i?.timeDimensions?.some(
5545
+ (L) => L.dimension === p
5546
+ ) || !1, $ = t.map((L) => {
5547
+ const I = L[p];
5541
5548
  let q, ne;
5542
5549
  if (_ && I) {
5543
5550
  const re = String(I);
@@ -5547,12 +5554,12 @@ const Ul = de.memo(function({
5547
5554
  re.includes(" ") && (Ne = re.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !Ne.endsWith("Z") && !Ne.includes("+") && (Ne = Ne + "Z"), ce = new Date(Ne);
5548
5555
  } else
5549
5556
  ce = new Date(re);
5550
- q = isNaN(ce.getTime()) ? parseFloat(re) : ce.getTime(), ne = ee(I, C);
5557
+ q = isNaN(ce.getTime()) ? parseFloat(re) : ce.getTime(), ne = ee(I, D);
5551
5558
  } else {
5552
- const re = ee(I, C) || I;
5559
+ const re = ee(I, D) || I;
5553
5560
  q = typeof re == "string" ? parseFloat(re) : re, ne = String(re);
5554
5561
  }
5555
- const ie = Ve(E[v]), xe = Ve(E[g]), ae = E[S];
5562
+ const ie = Ve(L[v]), xe = Ve(L[g]), ae = L[S];
5556
5563
  return {
5557
5564
  x: q,
5558
5565
  xLabel: ne,
@@ -5561,49 +5568,49 @@ const Ul = de.memo(function({
5561
5568
  // Type assertion: filter below ensures this is never null
5562
5569
  size: xe !== null ? Math.abs(xe) : 0,
5563
5570
  // Ensure positive size
5564
- color: b ? E[b] : ae,
5571
+ color: b ? L[b] : ae,
5565
5572
  series: ae,
5566
5573
  label: `${ae || "Unknown"}`,
5567
5574
  isValid: ot(q) && ie !== null && xe !== null && xe > 0
5568
5575
  };
5569
- }).filter((E) => E.isValid && E.size > 0);
5576
+ }).filter((L) => L.isValid && L.size > 0);
5570
5577
  if ($.length === 0) return;
5571
5578
  const T = {
5572
5579
  ...je,
5573
5580
  left: je.left + 30,
5574
5581
  // Add extra 30px left margin for Y-axis label
5575
- bottom: N.showLegend && b ? 100 : 40
5582
+ bottom: w.showLegend && b ? 100 : 40
5576
5583
  // Add extra space for legend
5577
- }, y = c.width - T.left - T.right, x = c.height - T.top - T.bottom, z = Ae(l.current).attr("width", c.width).attr("height", c.height), D = z.append("g").attr("transform", `translate(${T.left},${T.top})`), V = It().domain(ar($, (E) => E.x)).range([0, y]).nice(), P = It().domain(ar($, (E) => E.y)).range([x, 0]).nice(), Y = jl().domain([0, Dt($, (E) => E.size)]).range([N.minBubbleSize, N.maxBubbleSize]);
5578
- let X, F = !1, L = [];
5584
+ }, y = c.width - T.left - T.right, x = c.height - T.top - T.bottom, z = Ae(l.current).attr("width", c.width).attr("height", c.height), C = z.append("g").attr("transform", `translate(${T.left},${T.top})`), V = It().domain(ar($, (L) => L.x)).range([0, y]).nice(), P = It().domain(ar($, (L) => L.y)).range([x, 0]).nice(), Y = jl().domain([0, Dt($, (L) => L.size)]).range([w.minBubbleSize, w.maxBubbleSize]);
5585
+ let X, F = !1, E = [];
5579
5586
  if (b && $.length > 0) {
5580
- const E = $.map((I) => {
5587
+ const L = $.map((I) => {
5581
5588
  const q = I.color;
5582
5589
  return typeof q == "string" ? parseFloat(q) : q;
5583
5590
  }).filter((I) => !isNaN(I));
5584
- if (F = E.length === $.length && E.every((I) => typeof I == "number"), F) {
5585
- const I = Math.min(...E), q = Math.max(...E);
5591
+ if (F = L.length === $.length && L.every((I) => typeof I == "number"), F) {
5592
+ const I = Math.min(...L), q = Math.max(...L);
5586
5593
  X = At().domain([I, q]).range(a?.gradient || Ce);
5587
5594
  } else
5588
- L = [...new Set($.map((I) => String(I.color)))], X = pt().domain(L).range(a?.colors || G);
5595
+ E = [...new Set($.map((I) => String(I.color)))], X = pt().domain(E).range(a?.colors || G);
5589
5596
  } else
5590
5597
  X = pt().domain(["default"]).range([G[0]]);
5591
- const B = (E, I) => getComputedStyle(document.documentElement).getPropertyValue(E).trim() || I, R = f !== "light", M = R ? B("--dc-text-muted", "#cbd5e1") : B("--dc-text-secondary", "#374151"), U = R ? B("--dc-border", "#475569") : "#9ca3af";
5592
- if (N.showGrid) {
5593
- const E = D.append("g").attr("class", "grid").attr("transform", `translate(0,${x})`).call(
5598
+ const B = (L, I) => getComputedStyle(document.documentElement).getPropertyValue(L).trim() || I, R = u !== "light", M = R ? B("--dc-text-muted", "#cbd5e1") : B("--dc-text-secondary", "#374151"), U = R ? B("--dc-border", "#475569") : "#9ca3af";
5599
+ if (w.showGrid) {
5600
+ const L = C.append("g").attr("class", "grid").attr("transform", `translate(0,${x})`).call(
5594
5601
  ur(V).tickSize(-x).tickFormat(() => "")
5595
5602
  );
5596
- E.selectAll("line").style("stroke", U).style("stroke-dasharray", "3,3").style("opacity", 0.3), E.select(".domain").style("stroke", "none");
5597
- const I = D.append("g").attr("class", "grid").call(
5603
+ L.selectAll("line").style("stroke", U).style("stroke-dasharray", "3,3").style("opacity", 0.3), L.select(".domain").style("stroke", "none");
5604
+ const I = C.append("g").attr("class", "grid").call(
5598
5605
  fr(P).tickSize(-y).tickFormat(() => "")
5599
5606
  );
5600
5607
  I.selectAll("line").style("stroke", U).style("stroke-dasharray", "3,3").style("opacity", 0.3), I.select(".domain").style("stroke", "none");
5601
5608
  }
5602
5609
  const O = ur(V);
5603
- _ ? O.tickFormat((E) => {
5604
- const I = new Date(E);
5605
- if (isNaN(I.getTime())) return String(E);
5606
- switch (C?.toLowerCase()) {
5610
+ _ ? O.tickFormat((L) => {
5611
+ const I = new Date(L);
5612
+ if (isNaN(I.getTime())) return String(L);
5613
+ switch (D?.toLowerCase()) {
5607
5614
  case "year":
5608
5615
  return String(I.getUTCFullYear());
5609
5616
  case "quarter": {
@@ -5620,49 +5627,49 @@ const Ul = de.memo(function({
5620
5627
  default:
5621
5628
  return `${I.getUTCFullYear()}-${String(I.getUTCMonth() + 1).padStart(2, "0")}`;
5622
5629
  }
5623
- }) : N.xAxisFormat && O.tickFormat((E) => W(E, N.xAxisFormat));
5624
- const K = D.append("g").attr("transform", `translate(0,${x})`).call(O);
5625
- K.selectAll("text").style("fill", M), K.selectAll("line, path").style("stroke", U), K.append("text").attr("x", y / 2).attr("y", 35).attr("fill", M).style("text-anchor", "middle").style("font-size", "12px").text(N.xAxisFormat?.label || w(p));
5630
+ }) : w.xAxisFormat && O.tickFormat((L) => W(L, w.xAxisFormat));
5631
+ const K = C.append("g").attr("transform", `translate(0,${x})`).call(O);
5632
+ K.selectAll("text").style("fill", M), K.selectAll("line, path").style("stroke", U), K.append("text").attr("x", y / 2).attr("y", 35).attr("fill", M).style("text-anchor", "middle").style("font-size", "12px").text(w.xAxisFormat?.label || N(p));
5626
5633
  const te = fr(P);
5627
- N.leftYAxisFormat && te.tickFormat((E) => W(E, N.leftYAxisFormat));
5628
- const fe = D.append("g").call(te);
5629
- fe.selectAll("text").style("fill", M), fe.selectAll("line, path").style("stroke", U), fe.append("text").attr("transform", "rotate(-90)").attr("y", -35).attr("x", -x / 2).attr("fill", M).style("text-anchor", "middle").style("font-size", "12px").text(N.leftYAxisFormat?.label || w(v));
5630
- const me = Ae("body").append("div").attr("class", "bubble-chart-tooltip").style("position", "absolute").style("padding", "8px").style("background", "rgba(0, 0, 0, 0.8)").style("color", "white").style("border-radius", "4px").style("font-size", "12px").style("pointer-events", "none").style("opacity", 0).style("z-index", 1e3), we = D.selectAll(".bubble").data($).enter().append("circle").attr("class", "bubble").attr("cx", (E) => V(E.x)).attr("cy", (E) => P(E.y)).attr("r", (E) => Y(E.size)).style("fill", (E) => b && E.color !== void 0 ? X(F ? E.color : String(E.color)) : G[0]).style("opacity", N.bubbleOpacity).style("stroke", "#fff").style("stroke-width", 1).style("cursor", "pointer");
5631
- if (N.showTooltip && we.on("mouseover", function(E, I) {
5634
+ w.leftYAxisFormat && te.tickFormat((L) => W(L, w.leftYAxisFormat));
5635
+ const fe = C.append("g").call(te);
5636
+ fe.selectAll("text").style("fill", M), fe.selectAll("line, path").style("stroke", U), fe.append("text").attr("transform", "rotate(-90)").attr("y", -35).attr("x", -x / 2).attr("fill", M).style("text-anchor", "middle").style("font-size", "12px").text(w.leftYAxisFormat?.label || N(v));
5637
+ const me = Ae("body").append("div").attr("class", "bubble-chart-tooltip").style("position", "absolute").style("padding", "8px").style("background", "rgba(0, 0, 0, 0.8)").style("color", "white").style("border-radius", "4px").style("font-size", "12px").style("pointer-events", "none").style("opacity", 0).style("z-index", 1e3), we = C.selectAll(".bubble").data($).enter().append("circle").attr("class", "bubble").attr("cx", (L) => V(L.x)).attr("cy", (L) => P(L.y)).attr("r", (L) => Y(L.size)).style("fill", (L) => b && L.color !== void 0 ? X(F ? L.color : String(L.color)) : G[0]).style("opacity", w.bubbleOpacity).style("stroke", "#fff").style("stroke-width", 1).style("cursor", "pointer");
5638
+ if (w.showTooltip && we.on("mouseover", function(L, I) {
5632
5639
  Ae(this).transition().duration(200).style("opacity", 1).attr("r", Y(I.size) * 1.1);
5633
5640
  const q = [
5634
5641
  `<strong>${I.series || "Unknown"}</strong>`,
5635
- `${w(p)}: ${I.xLabel || (N.xAxisFormat ? W(I.x, N.xAxisFormat) : I.x)}`,
5636
- `${w(v)}: ${N.leftYAxisFormat ? W(I.y, N.leftYAxisFormat) : I.y}`,
5637
- `${w(g)}: ${N.leftYAxisFormat ? W(I.size, N.leftYAxisFormat) : I.size}`,
5638
- b && I.color ? `${w(b)}: ${I.color}` : ""
5642
+ `${N(p)}: ${I.xLabel || (w.xAxisFormat ? W(I.x, w.xAxisFormat) : I.x)}`,
5643
+ `${N(v)}: ${w.leftYAxisFormat ? W(I.y, w.leftYAxisFormat) : I.y}`,
5644
+ `${N(g)}: ${w.leftYAxisFormat ? W(I.size, w.leftYAxisFormat) : I.size}`,
5645
+ b && I.color ? `${N(b)}: ${I.color}` : ""
5639
5646
  ].filter(Boolean).join("<br>");
5640
- me.html(q).style("left", E.pageX + 10 + "px").style("top", E.pageY - 10 + "px").transition().duration(200).style("opacity", 1);
5641
- }).on("mousemove", function(E) {
5642
- me.style("left", E.pageX + 10 + "px").style("top", E.pageY - 10 + "px");
5643
- }).on("mouseout", function(E, I) {
5644
- Ae(this).transition().duration(200).style("opacity", N.bubbleOpacity).attr("r", Y(I.size)), me.transition().duration(200).style("opacity", 0);
5645
- }), N.showLegend && b)
5647
+ me.html(q).style("left", L.pageX + 10 + "px").style("top", L.pageY - 10 + "px").transition().duration(200).style("opacity", 1);
5648
+ }).on("mousemove", function(L) {
5649
+ me.style("left", L.pageX + 10 + "px").style("top", L.pageY - 10 + "px");
5650
+ }).on("mouseout", function(L, I) {
5651
+ Ae(this).transition().duration(200).style("opacity", w.bubbleOpacity).attr("r", Y(I.size)), me.transition().duration(200).style("opacity", 0);
5652
+ }), w.showLegend && b)
5646
5653
  if (F) {
5647
- const q = Math.min(...$.map((ce) => ce.color)), ne = Math.max(...$.map((ce) => ce.color)), ie = D.append("g").attr("class", "color-legend").attr("transform", `translate(${y / 2 - 200 / 2}, ${x + 60})`), ae = z.append("defs").append("linearGradient").attr("id", "color-scale-gradient").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%"), re = a?.gradient || Ce;
5654
+ const q = Math.min(...$.map((ce) => ce.color)), ne = Math.max(...$.map((ce) => ce.color)), ie = C.append("g").attr("class", "color-legend").attr("transform", `translate(${y / 2 - 200 / 2}, ${x + 60})`), ae = z.append("defs").append("linearGradient").attr("id", "color-scale-gradient").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%"), re = a?.gradient || Ce;
5648
5655
  re.forEach((ce, Ne) => {
5649
5656
  ae.append("stop").attr("offset", `${Ne / (re.length - 1) * 100}%`).attr("stop-color", ce);
5650
- }), ie.append("rect").attr("width", 200).attr("height", 20).style("fill", "url(#color-scale-gradient)").style("stroke", "#ccc").style("stroke-width", 1), ie.append("text").attr("x", 0).attr("y", 35).attr("text-anchor", "start").style("font-size", "11px").style("fill", M).text(N.leftYAxisFormat ? W(q, N.leftYAxisFormat) : q.toFixed(2)), ie.append("text").attr("x", 200).attr("y", 35).attr("text-anchor", "end").style("font-size", "11px").style("fill", M).text(N.leftYAxisFormat ? W(ne, N.leftYAxisFormat) : ne.toFixed(2)), ie.append("text").attr("x", 200 / 2).attr("y", -5).attr("text-anchor", "middle").style("font-size", "12px").style("font-weight", "bold").style("fill", M).text(w(b));
5657
+ }), ie.append("rect").attr("width", 200).attr("height", 20).style("fill", "url(#color-scale-gradient)").style("stroke", "#ccc").style("stroke-width", 1), ie.append("text").attr("x", 0).attr("y", 35).attr("text-anchor", "start").style("font-size", "11px").style("fill", M).text(w.leftYAxisFormat ? W(q, w.leftYAxisFormat) : q.toFixed(2)), ie.append("text").attr("x", 200).attr("y", 35).attr("text-anchor", "end").style("font-size", "11px").style("fill", M).text(w.leftYAxisFormat ? W(ne, w.leftYAxisFormat) : ne.toFixed(2)), ie.append("text").attr("x", 200 / 2).attr("y", -5).attr("text-anchor", "middle").style("font-size", "12px").style("font-weight", "bold").style("fill", M).text(N(b));
5651
5658
  } else {
5652
- const E = L;
5653
- if (E.length > 0) {
5654
- const q = D.append("g").attr("class", "legend").attr("transform", `translate(${y / 2 - E.length * 80 / 2}, ${x + 60})`).selectAll(".legend-item").data(E).enter().append("g").attr("class", "legend-item").attr("transform", (ne, ie) => `translate(${ie * 80}, 0)`).style("cursor", "pointer");
5655
- q.append("circle").attr("cx", 5).attr("cy", 5).attr("r", 5).style("fill", (ne) => X(ne)).style("opacity", N.bubbleOpacity), q.append("text").attr("x", 15).attr("y", 5).attr("dy", ".35em").style("font-size", "11px").style("fill", M).text((ne) => String(ne)), q.on("mouseover", function(ne, ie) {
5659
+ const L = E;
5660
+ if (L.length > 0) {
5661
+ const q = C.append("g").attr("class", "legend").attr("transform", `translate(${y / 2 - L.length * 80 / 2}, ${x + 60})`).selectAll(".legend-item").data(L).enter().append("g").attr("class", "legend-item").attr("transform", (ne, ie) => `translate(${ie * 80}, 0)`).style("cursor", "pointer");
5662
+ q.append("circle").attr("cx", 5).attr("cy", 5).attr("r", 5).style("fill", (ne) => X(ne)).style("opacity", w.bubbleOpacity), q.append("text").attr("x", 15).attr("y", 5).attr("dy", ".35em").style("font-size", "11px").style("fill", M).text((ne) => String(ne)), q.on("mouseover", function(ne, ie) {
5656
5663
  we.transition().duration(200).style("opacity", (xe) => b && String(xe.color) === ie ? 1 : 0.2);
5657
5664
  }).on("mouseout", function() {
5658
- we.transition().duration(200).style("opacity", N.bubbleOpacity);
5665
+ we.transition().duration(200).style("opacity", w.bubbleOpacity);
5659
5666
  });
5660
5667
  }
5661
5668
  }
5662
5669
  return () => {
5663
5670
  me.remove();
5664
5671
  };
5665
- }, [t, r, N, i, c, m, a, f, w]), !t || t.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
5672
+ }, [t, r, w, i, c, m, a, u, N]), !t || t.length === 0 ? /* @__PURE__ */ o("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: s }, children: /* @__PURE__ */ k("div", { className: "text-center", children: [
5666
5673
  /* @__PURE__ */ o("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
5667
5674
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in bubble chart" })
5668
5675
  ] }) }) : r?.xAxis && r?.yAxis && r?.series ? /* @__PURE__ */ o("div", { className: "w-full flex-1 flex flex-col relative", style: { height: s, minHeight: "250px", overflow: "hidden" }, children: /* @__PURE__ */ k("div", { ref: d, className: "w-full h-full relative", children: [
@@ -5683,10 +5690,10 @@ const Ul = de.memo(function({
5683
5690
  queryObject: i,
5684
5691
  height: s = 300
5685
5692
  }) {
5686
- const { getFieldLabel: a, meta: l } = qi(), d = J(
5693
+ const { getFieldLabel: a, meta: l } = qi(), d = Z(
5687
5694
  () => Fs(i, r?.xAxis),
5688
5695
  [i, r?.xAxis]
5689
- ), c = n?.pivotTimeDimension !== !1, u = J(() => !d || !c ? null : Cs(t, d, a), [t, d, c, a, l]);
5696
+ ), c = n?.pivotTimeDimension !== !1, f = Z(() => !d || !c ? null : Cs(t, d, a), [t, d, c, a, l]);
5690
5697
  return !t || t.length === 0 ? /* @__PURE__ */ o(
5691
5698
  "div",
5692
5699
  {
@@ -5697,10 +5704,10 @@ const Ul = de.memo(function({
5697
5704
  /* @__PURE__ */ o("div", { className: "text-xs text-dc-text-secondary", children: "No data to display in table" })
5698
5705
  ] })
5699
5706
  }
5700
- ) : u?.isPivoted && u.columns.length > 0 ? /* @__PURE__ */ o(
5707
+ ) : f?.isPivoted && f.columns.length > 0 ? /* @__PURE__ */ o(
5701
5708
  Gl,
5702
5709
  {
5703
- pivotedData: u,
5710
+ pivotedData: f,
5704
5711
  height: s,
5705
5712
  meta: l,
5706
5713
  leftYAxisFormat: n?.leftYAxisFormat
@@ -5803,13 +5810,13 @@ function Xl({
5803
5810
  getFieldLabel: i,
5804
5811
  leftYAxisFormat: s
5805
5812
  }) {
5806
- const a = Object.keys(e[0] || {}), l = J(() => {
5813
+ const a = Object.keys(e[0] || {}), l = Z(() => {
5807
5814
  if (t?.xAxis && t.xAxis.length > 0)
5808
5815
  return t.xAxis.filter((c) => a.includes(c));
5809
5816
  const d = Ts(r);
5810
5817
  if (d.length > 0) {
5811
- const c = d.filter((m) => a.includes(m)), u = a.filter((m) => !c.includes(m));
5812
- return [...c, ...u];
5818
+ const c = d.filter((m) => a.includes(m)), f = a.filter((m) => !c.includes(m));
5819
+ return [...c, ...f];
5813
5820
  }
5814
5821
  return a;
5815
5822
  }, [t?.xAxis, r, a]);
@@ -5832,13 +5839,13 @@ function Xl({
5832
5839
  },
5833
5840
  d
5834
5841
  )) }) }),
5835
- /* @__PURE__ */ o("tbody", { className: "bg-dc-surface divide-y border-dc-border", children: e.map((d, c) => /* @__PURE__ */ o("tr", { className: "hover:bg-dc-surface-secondary", children: l.map((u) => /* @__PURE__ */ o(
5842
+ /* @__PURE__ */ o("tbody", { className: "bg-dc-surface divide-y border-dc-border", children: e.map((d, c) => /* @__PURE__ */ o("tr", { className: "hover:bg-dc-surface-secondary", children: l.map((f) => /* @__PURE__ */ o(
5836
5843
  "td",
5837
5844
  {
5838
5845
  className: "px-3 py-2 whitespace-nowrap text-sm text-dc-text",
5839
- children: ql(d[u], s)
5846
+ children: ql(d[f], s)
5840
5847
  },
5841
- u
5848
+ f
5842
5849
  )) }, c)) })
5843
5850
  ] }) });
5844
5851
  }
@@ -5856,9 +5863,9 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5856
5863
  height: s = "100%",
5857
5864
  colorPalette: a
5858
5865
  }) {
5859
- const l = ye(null), d = ye(null), [c, u] = Z({ width: 0, height: 0 }), [m, h] = Z(!1), [f, w] = Z("light"), N = ve();
5860
- Te(() => (w(Ye()), Or((y) => {
5861
- w(y);
5866
+ const l = ye(null), d = ye(null), [c, f] = Q({ width: 0, height: 0 }), [m, h] = Q(!1), [u, N] = Q("light"), w = ve();
5867
+ Te(() => (N(Ye()), Or((y) => {
5868
+ N(y);
5862
5869
  })), []);
5863
5870
  const A = {
5864
5871
  showTooltip: n?.showTooltip ?? !0,
@@ -5869,17 +5876,17 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5869
5876
  let T = 0;
5870
5877
  const y = 10;
5871
5878
  let x, z;
5872
- const D = () => {
5879
+ const C = () => {
5873
5880
  if (d.current) {
5874
5881
  const { width: P, height: Y } = d.current.getBoundingClientRect();
5875
5882
  if (P > 0 && Y > 0)
5876
- return u({ width: P, height: Y }), h(!0), !0;
5883
+ return f({ width: P, height: Y }), h(!0), !0;
5877
5884
  }
5878
5885
  return !1;
5879
5886
  };
5880
- if (!D() && T < y) {
5887
+ if (!C() && T < y) {
5881
5888
  const P = () => {
5882
- !D() && T < y && (T++, z = setTimeout(() => {
5889
+ !C() && T < y && (T++, z = setTimeout(() => {
5883
5890
  x = requestAnimationFrame(P);
5884
5891
  }, 50 * T));
5885
5892
  };
@@ -5893,7 +5900,7 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5893
5900
  const y = () => {
5894
5901
  if (d.current) {
5895
5902
  const { width: x, height: z } = d.current.getBoundingClientRect();
5896
- x > 0 && z > 0 && (u({ width: x, height: z }), m || h(!0));
5903
+ x > 0 && z > 0 && (f({ width: x, height: z }), m || h(!0));
5897
5904
  }
5898
5905
  };
5899
5906
  return d.current && (T = new ResizeObserver(() => y()), T.observe(d.current), y()), window.addEventListener("resize", y), () => {
@@ -5987,8 +5994,8 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5987
5994
  case "hour":
5988
5995
  return {
5989
5996
  extractX: (y) => {
5990
- const x = y.getFullYear(), z = y.getMonth() + 1, D = y.getDate();
5991
- return x * 1e4 + z * 100 + D;
5997
+ const x = y.getFullYear(), z = y.getMonth() + 1, C = y.getDate();
5998
+ return x * 1e4 + z * 100 + C;
5992
5999
  },
5993
6000
  extractY: (y) => Math.floor(y.getHours() / 3),
5994
6001
  // 0-7 for 8 three-hour blocks
@@ -6010,7 +6017,7 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6010
6017
  }, b = (T) => {
6011
6018
  const y = new Date(Date.UTC(T.getFullYear(), T.getMonth(), T.getDate())), x = y.getUTCDay() || 7;
6012
6019
  y.setUTCDate(y.getUTCDate() + 4 - x);
6013
- const z = y.getUTCFullYear(), D = new Date(Date.UTC(z, 0, 1)), V = Math.ceil(((y.getTime() - D.getTime()) / 864e5 + 1) / 7);
6020
+ const z = y.getUTCFullYear(), C = new Date(Date.UTC(z, 0, 1)), V = Math.ceil(((y.getTime() - C.getTime()) / 864e5 + 1) / 7);
6014
6021
  return { year: z, week: V };
6015
6022
  };
6016
6023
  if (Te(() => {
@@ -6023,17 +6030,17 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6023
6030
  if (!i?.timeDimensions || i.timeDimensions.length === 0)
6024
6031
  return "day";
6025
6032
  const H = i.timeDimensions.find(
6026
- (Q) => Q.dimension === T || Q.dimension.includes(T)
6033
+ (J) => J.dimension === T || J.dimension.includes(T)
6027
6034
  );
6028
6035
  if (H && H.granularity)
6029
6036
  return H.granularity;
6030
6037
  const j = i.timeDimensions[0];
6031
6038
  return j && j.granularity ? j.granularity : "day";
6032
- })(), D = g(z);
6033
- if (!D)
6039
+ })(), C = g(z);
6040
+ if (!C)
6034
6041
  return;
6035
6042
  const V = t.map((H) => {
6036
- const j = H[T], Q = typeof H[y] == "string" ? parseFloat(H[y]) : H[y] || 0;
6043
+ const j = H[T], J = typeof H[y] == "string" ? parseFloat(H[y]) : H[y] || 0;
6037
6044
  let se;
6038
6045
  if (typeof j == "string") {
6039
6046
  let oe = j;
@@ -6042,11 +6049,11 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6042
6049
  se = new Date(j);
6043
6050
  if (isNaN(se.getTime()))
6044
6051
  return null;
6045
- const Fe = D.extractX(se), Me = D.extractY(se);
6052
+ const Fe = C.extractX(se), Me = C.extractY(se);
6046
6053
  return {
6047
6054
  x: Fe,
6048
6055
  y: Me,
6049
- value: Q,
6056
+ value: J,
6050
6057
  date: se,
6051
6058
  label: ee(j, z)
6052
6059
  };
@@ -6055,40 +6062,40 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6055
6062
  const P = Dt(V, (H) => H.y) || 0, Y = cr(V, (H) => H.y) || 0, F = (() => {
6056
6063
  const H = [...new Set(V.map((j) => j.x))].sort();
6057
6064
  return H;
6058
- })(), L = F.length * D.cellWidth + (F.length - 1) * 4, B = (P - Y + 1) * D.cellHeight + (P - Y) * 4, R = {
6065
+ })(), E = F.length * C.cellWidth + (F.length - 1) * 4, B = (P - Y + 1) * C.cellHeight + (P - Y) * 4, R = {
6059
6066
  left: 60,
6060
6067
  // Space for Y-axis labels
6061
6068
  bottom: 10,
6062
6069
  // Reduced since labels are at top
6063
- top: D.hasHierarchicalLabels ? 40 : 25,
6070
+ top: C.hasHierarchicalLabels ? 40 : 25,
6064
6071
  // Extra space for hierarchical labels
6065
6072
  right: 10
6066
6073
  }, M = c.width - R.left - R.right, U = c.height - R.top - R.bottom;
6067
6074
  let O, K;
6068
6075
  if (A.fitToWidth) {
6069
- const H = M / L, j = U / B, Q = Math.min(H, j);
6070
- O = D.cellWidth * Q, K = D.cellHeight * Q;
6076
+ const H = M / E, j = U / B, J = Math.min(H, j);
6077
+ O = C.cellWidth * J, K = C.cellHeight * J;
6071
6078
  } else {
6072
- const j = { width: 16, height: 16 }, Q = 24, se = M / L, Fe = U / B, Me = Math.min(se, Fe);
6073
- O = Math.max(j.width, Math.min(Q, D.cellWidth * Me)), K = Math.max(j.height, Math.min(Q, D.cellHeight * Me)), z === "week" && O < j.width && (O = j.width);
6079
+ const j = { width: 16, height: 16 }, J = 24, se = M / E, Fe = U / B, Me = Math.min(se, Fe);
6080
+ O = Math.max(j.width, Math.min(J, C.cellWidth * Me)), K = Math.max(j.height, Math.min(J, C.cellHeight * Me)), z === "week" && O < j.width && (O = j.width);
6074
6081
  }
6075
- const te = F.length * O + (F.length - 1) * 4, me = te > M ? te + R.left + R.right : c.width, E = Ae(l.current).attr("width", me).attr("height", c.height).append("g").attr("transform", `translate(${R.left},${R.top})`), I = V.map((H) => H.value), q = cr(I) || 0, ne = Dt(I) || 1, ie = At().domain([q, ne]).range(a?.gradient || Ce), xe = /* @__PURE__ */ new Map();
6082
+ const te = F.length * O + (F.length - 1) * 4, me = te > M ? te + R.left + R.right : c.width, L = Ae(l.current).attr("width", me).attr("height", c.height).append("g").attr("transform", `translate(${R.left},${R.top})`), I = V.map((H) => H.value), q = cr(I) || 0, ne = Dt(I) || 1, ie = At().domain([q, ne]).range(a?.gradient || Ce), xe = /* @__PURE__ */ new Map();
6076
6083
  V.forEach((H) => {
6077
6084
  const j = `${H.x}-${H.y}`;
6078
6085
  xe.set(j, H);
6079
6086
  });
6080
- const ae = (H, j) => getComputedStyle(document.documentElement).getPropertyValue(H).trim() || j, re = f !== "light", ce = re ? ae("--dc-text-muted", "#cbd5e1") : ae("--dc-text-secondary", "#374151"), Ne = ae("--dc-border", "#e5e7eb"), mn = re ? ae("--dc-bg-secondary", "#1e293b") : ae("--dc-bg-secondary", "#f3f4f6"), Zt = re ? ae("--dc-border", "#334155") : ae("--dc-bg", "#ffffff"), Je = Ae("body").append("div").attr("class", "activity-grid-tooltip").style("position", "absolute").style("padding", "8px").style("background", "rgba(0, 0, 0, 0.8)").style("color", "white").style("border-radius", "4px").style("font-size", "12px").style("pointer-events", "none").style("opacity", 0).style("z-index", 1e3), Be = /* @__PURE__ */ new Map();
6087
+ const ae = (H, j) => getComputedStyle(document.documentElement).getPropertyValue(H).trim() || j, re = u !== "light", ce = re ? ae("--dc-text-muted", "#cbd5e1") : ae("--dc-text-secondary", "#374151"), Ne = ae("--dc-border", "#e5e7eb"), mn = re ? ae("--dc-bg-secondary", "#1e293b") : ae("--dc-bg-secondary", "#f3f4f6"), Zt = re ? ae("--dc-border", "#334155") : ae("--dc-bg", "#ffffff"), Je = Ae("body").append("div").attr("class", "activity-grid-tooltip").style("position", "absolute").style("padding", "8px").style("background", "rgba(0, 0, 0, 0.8)").style("color", "white").style("border-radius", "4px").style("font-size", "12px").style("pointer-events", "none").style("opacity", 0).style("z-index", 1e3), Be = /* @__PURE__ */ new Map();
6081
6088
  F.forEach((H, j) => {
6082
6089
  Be.set(H, j);
6083
6090
  });
6084
6091
  for (const H of F)
6085
6092
  for (let j = Y; j <= P; j++) {
6086
- const Q = `${H}-${j}`, se = xe.get(Q), Fe = Be.get(H) || 0, Me = E.append("rect").attr("x", Fe * (O + 4)).attr("y", (j - Y) * (K + 4)).attr("width", O).attr("height", K).attr("rx", 2).attr("ry", 2).style("fill", se ? ie(se.value) : mn).style("stroke", Zt).style("stroke-width", 1);
6093
+ const J = `${H}-${j}`, se = xe.get(J), Fe = Be.get(H) || 0, Me = L.append("rect").attr("x", Fe * (O + 4)).attr("y", (j - Y) * (K + 4)).attr("width", O).attr("height", K).attr("rx", 2).attr("ry", 2).style("fill", se ? ie(se.value) : mn).style("stroke", Zt).style("stroke-width", 1);
6087
6094
  A.showTooltip && Me.style("cursor", "pointer").on("mouseover", function(oe) {
6088
6095
  if (Ae(this).style("stroke", "#000").style("stroke-width", 2), se) {
6089
6096
  const De = [
6090
6097
  `<strong>${se.label}</strong>`,
6091
- `${N(y)}: ${se.value}`
6098
+ `${w(y)}: ${se.value}`
6092
6099
  ].join("<br>");
6093
6100
  Je.html(De).style("left", oe.pageX + 10 + "px").style("top", oe.pageY - 10 + "px").transition().duration(200).style("opacity", 1);
6094
6101
  }
@@ -6099,41 +6106,41 @@ const Wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6099
6106
  });
6100
6107
  }
6101
6108
  if (A.showLabels) {
6102
- if (D.hasHierarchicalLabels && D.getYearFromX) {
6109
+ if (C.hasHierarchicalLabels && C.getYearFromX) {
6103
6110
  const H = /* @__PURE__ */ new Map();
6104
6111
  for (const j of F) {
6105
- const Q = D.getYearFromX(j);
6106
- H.has(Q) || H.set(Q, []), H.get(Q).push(j);
6112
+ const J = C.getYearFromX(j);
6113
+ H.has(J) || H.set(J, []), H.get(J).push(j);
6107
6114
  }
6108
6115
  for (const j of F) {
6109
- const Q = Be.get(j) || 0;
6110
- E.append("text").attr("x", Q * (O + 4) + O / 2).attr("y", -8).attr("text-anchor", "middle").style("font-size", "10px").style("fill", ce).text(D.xFormat(j));
6116
+ const J = Be.get(j) || 0;
6117
+ L.append("text").attr("x", J * (O + 4) + O / 2).attr("y", -8).attr("text-anchor", "middle").style("font-size", "10px").style("fill", ce).text(C.xFormat(j));
6111
6118
  }
6112
- for (const [j, Q] of H)
6113
- if (Q.length > 0) {
6114
- const se = Math.min(...Q.map((De) => Be.get(De) || 0)), Fe = Math.max(...Q.map((De) => Be.get(De) || 0)), Me = (se + Fe) / 2;
6119
+ for (const [j, J] of H)
6120
+ if (J.length > 0) {
6121
+ const se = Math.min(...J.map((De) => Be.get(De) || 0)), Fe = Math.max(...J.map((De) => Be.get(De) || 0)), Me = (se + Fe) / 2;
6115
6122
  let oe = "";
6116
6123
  if (j > 9999) {
6117
6124
  const De = Math.floor(j / 100), hn = j % 100;
6118
6125
  oe = `${["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][hn - 1]} '${De.toString().slice(-2)}`;
6119
6126
  } else
6120
6127
  oe = `'${j.toString().slice(-2)}`;
6121
- E.append("text").attr("x", Me * (O + 4) + O / 2).attr("y", -25).attr("text-anchor", "middle").style("font-size", "12px").style("font-weight", "bold").style("fill", ce).text(oe), Q.length > 1 && E.append("line").attr("x1", se * (O + 4)).attr("x2", Fe * (O + 4) + O).attr("y1", -20).attr("y2", -20).style("stroke", Ne).style("stroke-width", 1).style("opacity", 0.3);
6128
+ L.append("text").attr("x", Me * (O + 4) + O / 2).attr("y", -25).attr("text-anchor", "middle").style("font-size", "12px").style("font-weight", "bold").style("fill", ce).text(oe), J.length > 1 && L.append("line").attr("x1", se * (O + 4)).attr("x2", Fe * (O + 4) + O).attr("y1", -20).attr("y2", -20).style("stroke", Ne).style("stroke-width", 1).style("opacity", 0.3);
6122
6129
  }
6123
6130
  } else {
6124
6131
  const H = Math.max(1, Math.floor(F.length / 10));
6125
6132
  for (let j = 0; j < F.length; j += H) {
6126
- const Q = F[j];
6127
- E.append("text").attr("x", j * (O + 4) + O / 2).attr("y", -8).attr("text-anchor", "middle").style("font-size", "10px").style("fill", ce).text(D.xFormat(Q));
6133
+ const J = F[j];
6134
+ L.append("text").attr("x", j * (O + 4) + O / 2).attr("y", -8).attr("text-anchor", "middle").style("font-size", "10px").style("fill", ce).text(C.xFormat(J));
6128
6135
  }
6129
6136
  }
6130
6137
  for (let H = Y; H <= P; H++)
6131
- E.append("text").attr("x", -8).attr("y", (H - Y) * (K + 4) + K / 2).attr("text-anchor", "end").attr("dy", ".35em").style("font-size", "10px").style("fill", ce).text(D.yFormat(H));
6138
+ L.append("text").attr("x", -8).attr("y", (H - Y) * (K + 4) + K / 2).attr("text-anchor", "end").attr("dy", ".35em").style("font-size", "10px").style("fill", ce).text(C.yFormat(H));
6132
6139
  }
6133
6140
  return () => {
6134
6141
  Je.remove();
6135
6142
  };
6136
- }, [t, r, n, i, c, m, A.showTooltip, A.showLabels, a, f]), !t || t.length === 0)
6143
+ }, [t, r, n, i, c, m, A.showTooltip, A.showLabels, a, u]), !t || t.length === 0)
6137
6144
  return /* @__PURE__ */ o(
6138
6145
  "div",
6139
6146
  {
@@ -6186,21 +6193,21 @@ function fn({
6186
6193
  color: n = "#1f2937",
6187
6194
  bucketCount: i = 12,
6188
6195
  height: s = 32,
6189
- formatValue: a = (u) => u.toString(),
6196
+ formatValue: a = (f) => f.toString(),
6190
6197
  width: l,
6191
6198
  showAverageIndicator: d = !0,
6192
6199
  targetValue: c
6193
6200
  }) {
6194
- const u = new Array(i).fill(0), m = r - t;
6201
+ const f = new Array(i).fill(0), m = r - t;
6195
6202
  e.forEach((A) => {
6196
6203
  if (m === 0)
6197
- u[Math.floor(i / 2)]++;
6204
+ f[Math.floor(i / 2)]++;
6198
6205
  else {
6199
6206
  let p = Math.floor((A - t) / m * (i - 1));
6200
- p = Math.max(0, Math.min(i - 1, p)), u[p]++;
6207
+ p = Math.max(0, Math.min(i - 1, p)), f[p]++;
6201
6208
  }
6202
6209
  });
6203
- const h = Math.max(...u), f = e.reduce((A, p) => A + p, 0) / e.length, w = m === 0 ? 50 : (f - t) / m * 100, N = c !== void 0 && m > 0 ? (c - t) / m * 100 : null;
6210
+ const h = Math.max(...f), u = e.reduce((A, p) => A + p, 0) / e.length, N = m === 0 ? 50 : (u - t) / m * 100, w = c !== void 0 && m > 0 ? (c - t) / m * 100 : null;
6204
6211
  return /* @__PURE__ */ k("div", { className: "flex flex-col items-center", children: [
6205
6212
  /* @__PURE__ */ k(
6206
6213
  "div",
@@ -6212,7 +6219,7 @@ function fn({
6212
6219
  minWidth: "200px"
6213
6220
  },
6214
6221
  children: [
6215
- u.map((A, p) => {
6222
+ f.map((A, p) => {
6216
6223
  const v = h > 0 ? A / h : 0, S = 0.1, g = A > 0 ? Math.max(S, v) : S;
6217
6224
  return /* @__PURE__ */ o(
6218
6225
  "div",
@@ -6234,14 +6241,14 @@ function fn({
6234
6241
  {
6235
6242
  className: "absolute top-0 bottom-0 pointer-events-none",
6236
6243
  style: {
6237
- left: `${w}%`,
6244
+ left: `${N}%`,
6238
6245
  transform: "translateX(-50%)",
6239
6246
  width: "2px",
6240
6247
  backgroundColor: "#ef4444",
6241
6248
  opacity: 0.8,
6242
6249
  zIndex: 10
6243
6250
  },
6244
- title: `Average: ${a(f)}`,
6251
+ title: `Average: ${a(u)}`,
6245
6252
  children: /* @__PURE__ */ o(
6246
6253
  "div",
6247
6254
  {
@@ -6259,12 +6266,12 @@ function fn({
6259
6266
  )
6260
6267
  }
6261
6268
  ),
6262
- N !== null && c !== void 0 && /* @__PURE__ */ o(
6269
+ w !== null && c !== void 0 && /* @__PURE__ */ o(
6263
6270
  "div",
6264
6271
  {
6265
6272
  className: "absolute top-0 bottom-0 pointer-events-none",
6266
6273
  style: {
6267
- left: `${Math.max(0, Math.min(100, N))}%`,
6274
+ left: `${Math.max(0, Math.min(100, w))}%`,
6268
6275
  transform: "translateX(-50%)",
6269
6276
  width: "2px",
6270
6277
  backgroundColor: "#10b981",
@@ -6321,17 +6328,17 @@ const Ql = de.memo(function({
6321
6328
  height: s = "100%",
6322
6329
  colorPalette: a
6323
6330
  }) {
6324
- const [l, d] = Z(32), [c, u] = Z(250), m = ye(null), h = ye(null), f = ve();
6331
+ const [l, d] = Q(32), [c, f] = Q(250), m = ye(null), h = ye(null), u = ve();
6325
6332
  if (Te(() => {
6326
6333
  const R = () => {
6327
6334
  if (m.current) {
6328
6335
  const K = m.current.getBoundingClientRect(), te = K.width, fe = K.height;
6329
6336
  if (te > 0 && fe > 0) {
6330
- const me = te / 5, we = fe / 4, E = Math.min(me, we), I = Math.max(24, Math.min(E, 120));
6337
+ const me = te / 5, we = fe / 4, L = Math.min(me, we), I = Math.max(24, Math.min(L, 120));
6331
6338
  d(I), setTimeout(() => {
6332
6339
  if (h.current) {
6333
6340
  const ne = h.current.getBoundingClientRect().width, ie = Math.max(ne, Math.min(te * 0.6, 300));
6334
- u(ie);
6341
+ f(ie);
6335
6342
  }
6336
6343
  }, 10);
6337
6344
  }
@@ -6357,8 +6364,8 @@ const Ql = de.memo(function({
6357
6364
  ] })
6358
6365
  }
6359
6366
  );
6360
- let w = [];
6361
- if (r?.yAxis && (typeof r.yAxis == "string" ? w = [r.yAxis] : Array.isArray(r.yAxis) && (w = r.yAxis)), w.length === 0)
6367
+ let N = [];
6368
+ if (r?.yAxis && (typeof r.yAxis == "string" ? N = [r.yAxis] : Array.isArray(r.yAxis) && (N = r.yAxis)), N.length === 0)
6362
6369
  return /* @__PURE__ */ o(
6363
6370
  "div",
6364
6371
  {
@@ -6376,7 +6383,7 @@ const Ql = de.memo(function({
6376
6383
  ] })
6377
6384
  }
6378
6385
  );
6379
- const N = w[0], A = i?.timeDimensions?.[0]?.dimension || void 0, p = J(() => {
6386
+ const w = N[0], A = i?.timeDimensions?.[0]?.dimension || void 0, p = Z(() => {
6380
6387
  let R = [...t];
6381
6388
  return A && (R = R.sort((M, U) => {
6382
6389
  const O = M[A], K = U[A];
@@ -6385,17 +6392,17 @@ const Ql = de.memo(function({
6385
6392
  }, [t, A]), { useLastCompletePeriod: v = !0, skipLastPeriod: S = !1 } = n, {
6386
6393
  filteredData: g,
6387
6394
  excludedIncompletePeriod: b,
6388
- skippedLastPeriod: C,
6395
+ skippedLastPeriod: D,
6389
6396
  granularity: _
6390
- } = J(() => Pr(p, A, i, v, S), [p, A, i, v, S]), $ = g, T = J(() => $.map((M) => {
6391
- if (M[N] !== void 0)
6392
- return M[N];
6397
+ } = Z(() => Pr(p, A, i, v, S), [p, A, i, v, S]), $ = g, T = Z(() => $.map((M) => {
6398
+ if (M[w] !== void 0)
6399
+ return M[w];
6393
6400
  const U = Object.keys(M).filter(
6394
6401
  (O) => typeof M[O] == "number" && !isNaN(M[O])
6395
6402
  );
6396
6403
  if (U.length > 0)
6397
6404
  return M[U[0]];
6398
- }).filter((M) => M != null && !isNaN(Number(M))).map((M) => Number(M)), [$, N]);
6405
+ }).filter((M) => M != null && !isNaN(Number(M))).map((M) => Number(M)), [$, w]);
6399
6406
  if (T.length === 0)
6400
6407
  return /* @__PURE__ */ k(
6401
6408
  "div",
@@ -6415,7 +6422,7 @@ const Ql = de.memo(function({
6415
6422
  fontSize: "14px",
6416
6423
  lineHeight: "1.2"
6417
6424
  },
6418
- children: f(N)
6425
+ children: u(w)
6419
6426
  }
6420
6427
  ),
6421
6428
  /* @__PURE__ */ o(
@@ -6432,10 +6439,10 @@ const Ql = de.memo(function({
6432
6439
  ]
6433
6440
  }
6434
6441
  );
6435
- const { avg: y, min: x, max: z } = J(() => {
6442
+ const { avg: y, min: x, max: z } = Z(() => {
6436
6443
  const M = T.reduce((K, te) => K + te, 0) / T.length, U = Math.min(...T), O = Math.max(...T);
6437
6444
  return { avg: M, min: U, max: O };
6438
- }, [T]), D = Le((R) => {
6445
+ }, [T]), C = Le((R) => {
6439
6446
  if (n.formatValue)
6440
6447
  return n.formatValue(R);
6441
6448
  if (R == null)
@@ -6443,23 +6450,23 @@ const Ql = de.memo(function({
6443
6450
  const M = n.decimals ?? 0, U = n.prefix ?? "";
6444
6451
  let O;
6445
6452
  return Math.abs(R) >= 1e9 ? O = (R / 1e9).toFixed(M) + "B" : Math.abs(R) >= 1e6 ? O = (R / 1e6).toFixed(M) + "M" : Math.abs(R) >= 1e3 ? O = (R / 1e3).toFixed(M) + "K" : O = R.toFixed(M), U + O;
6446
- }, [n.formatValue, n.decimals, n.prefix]), V = T.length === 1 ? T[0] : y, P = T.length > 1, Y = J(() => {
6453
+ }, [n.formatValue, n.decimals, n.prefix]), V = T.length === 1 ? T[0] : y, P = T.length > 1, Y = Z(() => {
6447
6454
  if (n.valueColorIndex !== void 0 && a?.colors) {
6448
6455
  const R = n.valueColorIndex;
6449
6456
  if (R >= 0 && R < a.colors.length)
6450
6457
  return a.colors[R];
6451
6458
  }
6452
6459
  return a?.colors?.[0] || "#1f2937";
6453
- }, [n.valueColorIndex, a?.colors]), X = J(() => wt(n?.target || ""), [n?.target]), F = X.length > 0 ? X[0] : null, L = F !== null ? Ys(V, F) : null, B = J(() => {
6454
- if (L === null) return "#6B7280";
6455
- if (L >= 0) {
6460
+ }, [n.valueColorIndex, a?.colors]), X = Z(() => wt(n?.target || ""), [n?.target]), F = X.length > 0 ? X[0] : null, E = F !== null ? Ys(V, F) : null, B = Z(() => {
6461
+ if (E === null) return "#6B7280";
6462
+ if (E >= 0) {
6456
6463
  const R = n.positiveColorIndex ?? 1;
6457
6464
  return a?.colors?.[R] || "#10B981";
6458
6465
  } else {
6459
6466
  const R = n.negativeColorIndex ?? 7;
6460
6467
  return a?.colors?.[R] || "#EF4444";
6461
6468
  }
6462
- }, [L, n.positiveColorIndex, n.negativeColorIndex, a?.colors]);
6469
+ }, [E, n.positiveColorIndex, n.negativeColorIndex, a?.colors]);
6463
6470
  return /* @__PURE__ */ k(
6464
6471
  "div",
6465
6472
  {
@@ -6480,13 +6487,13 @@ const Ql = de.memo(function({
6480
6487
  },
6481
6488
  children: [
6482
6489
  /* @__PURE__ */ o("span", { children: (() => {
6483
- const R = f(N);
6484
- return R && R.length > 1 ? R : N;
6490
+ const R = u(w);
6491
+ return R && R.length > 1 ? R : w;
6485
6492
  })() }),
6486
- (b || C) && /* @__PURE__ */ o(
6493
+ (b || D) && /* @__PURE__ */ o(
6487
6494
  "span",
6488
6495
  {
6489
- title: C ? `Excludes last ${_ || "period"}` : `Excludes current incomplete ${_}`,
6496
+ title: D ? `Excludes last ${_ || "period"}` : `Excludes current incomplete ${_}`,
6490
6497
  className: "cursor-help",
6491
6498
  children: /* @__PURE__ */ o(at, { icon: Yt, className: "w-4 h-4 text-dc-text-muted opacity-70" })
6492
6499
  }
@@ -6504,10 +6511,10 @@ const Ql = de.memo(function({
6504
6511
  fontSize: `${l}px`,
6505
6512
  color: Y
6506
6513
  },
6507
- children: D(V)
6514
+ children: C(V)
6508
6515
  }
6509
6516
  ),
6510
- F !== null && L !== null && /* @__PURE__ */ k("div", { className: "flex flex-col items-start", children: [
6517
+ F !== null && E !== null && /* @__PURE__ */ k("div", { className: "flex flex-col items-start", children: [
6511
6518
  /* @__PURE__ */ o(
6512
6519
  "div",
6513
6520
  {
@@ -6517,7 +6524,7 @@ const Ql = de.memo(function({
6517
6524
  color: B,
6518
6525
  lineHeight: "1.2"
6519
6526
  },
6520
- children: js(L, 1)
6527
+ children: js(E, 1)
6521
6528
  }
6522
6529
  ),
6523
6530
  /* @__PURE__ */ k(
@@ -6530,7 +6537,7 @@ const Ql = de.memo(function({
6530
6537
  },
6531
6538
  children: [
6532
6539
  "vs ",
6533
- D(F)
6540
+ C(F)
6534
6541
  ]
6535
6542
  }
6536
6543
  )
@@ -6555,7 +6562,7 @@ const Ql = de.memo(function({
6555
6562
  min: x,
6556
6563
  max: z,
6557
6564
  color: Y,
6558
- formatValue: D,
6565
+ formatValue: C,
6559
6566
  height: 24,
6560
6567
  width: c,
6561
6568
  targetValue: F || void 0
@@ -6577,8 +6584,8 @@ function Jl({
6577
6584
  width: s,
6578
6585
  height: a
6579
6586
  }) {
6580
- const l = Math.max(10, Math.floor(s / 10)), d = e.length > l ? e.slice(-l) : e, c = d.map((v) => v - t), u = Math.min(...c, 0), m = Math.max(...c, 0);
6581
- if (Math.max(Math.abs(u), Math.abs(m)) === 0 || c.length === 0)
6587
+ const l = Math.max(10, Math.floor(s / 10)), d = e.length > l ? e.slice(-l) : e, c = d.map((v) => v - t), f = Math.min(...c, 0), m = Math.max(...c, 0);
6588
+ if (Math.max(Math.abs(f), Math.abs(m)) === 0 || c.length === 0)
6582
6589
  return /* @__PURE__ */ o(
6583
6590
  "div",
6584
6591
  {
@@ -6587,7 +6594,7 @@ function Jl({
6587
6594
  children: /* @__PURE__ */ o("span", { className: "text-xs text-dc-text-muted", children: "No variance data" })
6588
6595
  }
6589
6596
  );
6590
- const f = 2, w = s - (d.length - 1) * f, N = Math.max(4, w / d.length), A = m - u, p = A > 0 ? m / A * 100 : 50;
6597
+ const u = 2, N = s - (d.length - 1) * u, w = Math.max(4, N / d.length), A = m - f, p = A > 0 ? m / A * 100 : 50;
6591
6598
  return /* @__PURE__ */ k("div", { className: "flex items-center space-x-2", children: [
6592
6599
  /* @__PURE__ */ k(
6593
6600
  "div",
@@ -6611,19 +6618,19 @@ function Jl({
6611
6618
  }
6612
6619
  ),
6613
6620
  c.map((v, S) => {
6614
- const g = Math.abs(v) / A, b = Math.max(2, g * (a - 4)), C = v >= 0, _ = S === d.length - 1, $ = C ? r : n, T = S * (N + f);
6621
+ const g = Math.abs(v) / A, b = Math.max(2, g * (a - 4)), D = v >= 0, _ = S === d.length - 1, $ = D ? r : n, T = S * (w + u);
6615
6622
  return /* @__PURE__ */ o(
6616
6623
  "div",
6617
6624
  {
6618
6625
  className: "absolute rounded-xs",
6619
6626
  style: {
6620
6627
  left: `${T}px`,
6621
- width: `${N}px`,
6628
+ width: `${w}px`,
6622
6629
  height: `${b}px`,
6623
6630
  backgroundColor: $,
6624
6631
  opacity: _ ? 1 : 0.6,
6625
6632
  // Position bar relative to zero line
6626
- ...C ? { bottom: `${100 - p}%` } : { top: `${p}%` },
6633
+ ...D ? { bottom: `${100 - p}%` } : { top: `${p}%` },
6627
6634
  zIndex: 2
6628
6635
  },
6629
6636
  title: `${i(d[S])}: ${v >= 0 ? "+" : ""}${i(v)} vs current`
@@ -6645,8 +6652,8 @@ function Jl({
6645
6652
  i(m)
6646
6653
  ] }),
6647
6654
  /* @__PURE__ */ k("span", { children: [
6648
- (u < 0, ""),
6649
- i(u)
6655
+ (f < 0, ""),
6656
+ i(f)
6650
6657
  ] })
6651
6658
  ]
6652
6659
  }
@@ -6661,20 +6668,20 @@ const ec = de.memo(function({
6661
6668
  height: s = "100%",
6662
6669
  colorPalette: a
6663
6670
  }) {
6664
- const [l, d] = Z(32), [c, u] = Z(250), m = ye(null), h = ye(null), f = ve();
6671
+ const [l, d] = Q(32), [c, f] = Q(250), m = ye(null), h = ye(null), u = ve();
6665
6672
  if (Te(() => {
6666
6673
  const M = () => {
6667
6674
  if (m.current) {
6668
6675
  const te = m.current.getBoundingClientRect(), fe = te.width, me = te.height;
6669
6676
  if (fe > 0 && me > 0) {
6670
- const we = fe / 4, E = me / 4, I = Math.min(we, E), q = Math.max(28, Math.min(I, 140));
6677
+ const we = fe / 4, L = me / 4, I = Math.min(we, L), q = Math.max(28, Math.min(I, 140));
6671
6678
  d(q), setTimeout(() => {
6672
6679
  if (h.current) {
6673
6680
  const ie = h.current.getBoundingClientRect().width, xe = fe - 100, ae = Math.max(
6674
6681
  ie,
6675
6682
  Math.min(xe, fe * 0.7)
6676
6683
  );
6677
- u(Math.max(100, ae));
6684
+ f(Math.max(100, ae));
6678
6685
  }
6679
6686
  }, 10);
6680
6687
  }
@@ -6700,8 +6707,8 @@ const ec = de.memo(function({
6700
6707
  ] })
6701
6708
  }
6702
6709
  );
6703
- let w = [], N = [];
6704
- if (r?.yAxis && (w = Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis]), r?.xAxis && (N = Array.isArray(r.xAxis) ? r.xAxis : [r.xAxis]), w.length === 0)
6710
+ let N = [], w = [];
6711
+ if (r?.yAxis && (N = Array.isArray(r.yAxis) ? r.yAxis : [r.yAxis]), r?.xAxis && (w = Array.isArray(r.xAxis) ? r.xAxis : [r.xAxis]), N.length === 0)
6705
6712
  return /* @__PURE__ */ o(
6706
6713
  "div",
6707
6714
  {
@@ -6719,7 +6726,7 @@ const ec = de.memo(function({
6719
6726
  ] })
6720
6727
  }
6721
6728
  );
6722
- const A = w[0], p = N[0];
6729
+ const A = N[0], p = w[0];
6723
6730
  let v = [...t];
6724
6731
  p && (v = v.sort((M, U) => {
6725
6732
  const O = M[p], K = U[p];
@@ -6727,7 +6734,7 @@ const ec = de.memo(function({
6727
6734
  }));
6728
6735
  const { useLastCompletePeriod: S = !0, skipLastPeriod: g = !1 } = n, {
6729
6736
  filteredData: b,
6730
- excludedIncompletePeriod: C,
6737
+ excludedIncompletePeriod: D,
6731
6738
  skippedLastPeriod: _,
6732
6739
  granularity: $
6733
6740
  } = Pr(
@@ -6759,7 +6766,7 @@ const ec = de.memo(function({
6759
6766
  ] })
6760
6767
  }
6761
6768
  );
6762
- const x = y[y.length - 1], z = y[y.length - 2], D = x - z, V = z !== 0 ? D / Math.abs(z) * 100 : 0, P = D >= 0, Y = (M) => {
6769
+ const x = y[y.length - 1], z = y[y.length - 2], C = x - z, V = z !== 0 ? C / Math.abs(z) * 100 : 0, P = C >= 0, Y = (M) => {
6763
6770
  if (n.formatValue)
6764
6771
  return n.formatValue(M);
6765
6772
  if (M == null)
@@ -6781,7 +6788,7 @@ const ec = de.memo(function({
6781
6788
  return a.colors[M];
6782
6789
  }
6783
6790
  return "#ef4444";
6784
- }, L = X(), B = F(), R = P ? L : B;
6791
+ }, E = X(), B = F(), R = P ? E : B;
6785
6792
  return /* @__PURE__ */ k(
6786
6793
  "div",
6787
6794
  {
@@ -6802,10 +6809,10 @@ const ec = de.memo(function({
6802
6809
  },
6803
6810
  children: [
6804
6811
  /* @__PURE__ */ o("span", { children: (() => {
6805
- const M = f(A);
6812
+ const M = u(A);
6806
6813
  return M && M.length > 1 ? M : A;
6807
6814
  })() }),
6808
- (C || _) && /* @__PURE__ */ o(
6815
+ (D || _) && /* @__PURE__ */ o(
6809
6816
  "span",
6810
6817
  {
6811
6818
  title: _ ? `Excludes last ${$ || "period"}` : `Excludes current incomplete ${$}`,
@@ -6859,7 +6866,7 @@ const ec = de.memo(function({
6859
6866
  },
6860
6867
  children: [
6861
6868
  P ? "+" : "",
6862
- Y(D)
6869
+ Y(C)
6863
6870
  ]
6864
6871
  }
6865
6872
  ),
@@ -6899,7 +6906,7 @@ const ec = de.memo(function({
6899
6906
  {
6900
6907
  values: y,
6901
6908
  lastValue: x,
6902
- positiveColor: L,
6909
+ positiveColor: E,
6903
6910
  negativeColor: B,
6904
6911
  formatValue: Y,
6905
6912
  width: c,
@@ -6919,13 +6926,13 @@ const ec = de.memo(function({
6919
6926
  height: i = "100%",
6920
6927
  colorPalette: s
6921
6928
  }) {
6922
- const [a, l] = Z(28), [d, c] = Z(0), u = ye(null), m = ye(null), h = ve();
6929
+ const [a, l] = Q(28), [d, c] = Q(0), f = ye(null), m = ye(null), h = ve();
6923
6930
  if (Te(() => {
6924
6931
  const x = () => {
6925
- if (u.current) {
6926
- const P = u.current.getBoundingClientRect(), Y = P.width, X = P.height;
6932
+ if (f.current) {
6933
+ const P = f.current.getBoundingClientRect(), Y = P.width, X = P.height;
6927
6934
  if (Y > 0 && X > 0) {
6928
- const F = Y / 8, L = X / 5, B = Math.min(F, L), R = Math.max(18, Math.min(B, 80));
6935
+ const F = Y / 8, E = X / 5, B = Math.min(F, E), R = Math.max(18, Math.min(B, 80));
6929
6936
  l(R);
6930
6937
  }
6931
6938
  }
@@ -6933,11 +6940,11 @@ const ec = de.memo(function({
6933
6940
  const V = m.current.getBoundingClientRect();
6934
6941
  c(V.width);
6935
6942
  }
6936
- }, z = setTimeout(x, 100), D = new ResizeObserver(() => {
6943
+ }, z = setTimeout(x, 100), C = new ResizeObserver(() => {
6937
6944
  clearTimeout(z), setTimeout(x, 50);
6938
6945
  });
6939
- return u.current && D.observe(u.current), () => {
6940
- clearTimeout(z), D.disconnect();
6946
+ return f.current && C.observe(f.current), () => {
6947
+ clearTimeout(z), C.disconnect();
6941
6948
  };
6942
6949
  }, [t, r]), !t || t.length === 0)
6943
6950
  return /* @__PURE__ */ o(
@@ -6954,8 +6961,8 @@ const ec = de.memo(function({
6954
6961
  ] })
6955
6962
  }
6956
6963
  );
6957
- let f = [];
6958
- if (r?.yAxis && (typeof r.yAxis == "string" ? f = [r.yAxis] : Array.isArray(r.yAxis) && (f = r.yAxis)), f.length === 0)
6964
+ let u = [];
6965
+ if (r?.yAxis && (typeof r.yAxis == "string" ? u = [r.yAxis] : Array.isArray(r.yAxis) && (u = r.yAxis)), u.length === 0)
6959
6966
  return /* @__PURE__ */ o(
6960
6967
  "div",
6961
6968
  {
@@ -6973,14 +6980,14 @@ const ec = de.memo(function({
6973
6980
  ] })
6974
6981
  }
6975
6982
  );
6976
- const w = f[0], N = t.map((x) => {
6977
- if (x[w] !== void 0)
6978
- return x[w];
6983
+ const N = u[0], w = t.map((x) => {
6984
+ if (x[N] !== void 0)
6985
+ return x[N];
6979
6986
  const z = Object.keys(x);
6980
6987
  if (z.length > 0)
6981
6988
  return x[z[0]];
6982
6989
  }).filter((x) => x != null);
6983
- if (N.length === 0)
6990
+ if (w.length === 0)
6984
6991
  return /* @__PURE__ */ o(
6985
6992
  "div",
6986
6993
  {
@@ -6998,9 +7005,9 @@ const ec = de.memo(function({
6998
7005
  ] })
6999
7006
  }
7000
7007
  );
7001
- const A = N.map((x) => Number(x)).filter((x) => !isNaN(x));
7008
+ const A = w.map((x) => Number(x)).filter((x) => !isNaN(x));
7002
7009
  let p, v = null, S = null, g = !1;
7003
- A.length > 0 ? N.length === 1 ? p = N[0] : (p = A.reduce((D, V) => D + V, 0) / A.length, v = Math.min(...A), S = Math.max(...A), g = !0) : p = N.length === 1 ? N[0] : N.join(", ");
7010
+ A.length > 0 ? w.length === 1 ? p = w[0] : (p = A.reduce((C, V) => C + V, 0) / A.length, v = Math.min(...A), S = Math.max(...A), g = !0) : p = w.length === 1 ? w[0] : w.join(", ");
7004
7011
  const b = (x) => {
7005
7012
  if (n.formatValue)
7006
7013
  return n.formatValue(x);
@@ -7008,22 +7015,22 @@ const ec = de.memo(function({
7008
7015
  return "—";
7009
7016
  const z = n.decimals ?? 2;
7010
7017
  return Math.abs(x) >= 1e9 ? (x / 1e9).toFixed(z) + "B" : Math.abs(x) >= 1e6 ? (x / 1e6).toFixed(z) + "M" : Math.abs(x) >= 1e3 ? (x / 1e3).toFixed(z) + "K" : x.toFixed(z);
7011
- }, C = (x, z) => {
7018
+ }, D = (x, z) => {
7012
7019
  try {
7013
- const D = {
7020
+ const C = {
7014
7021
  value: typeof z == "number" ? b(z) : String(z),
7015
7022
  rawValue: z,
7016
- field: w,
7017
- fieldLabel: h(w),
7023
+ field: N,
7024
+ fieldLabel: h(N),
7018
7025
  min: v !== null ? b(v) : "",
7019
7026
  max: S !== null ? b(S) : "",
7020
- count: N.length
7027
+ count: w.length
7021
7028
  };
7022
- return x.replace(/\$\{(\w+)\}/g, (V, P) => P in D ? String(D[P]) : V);
7029
+ return x.replace(/\$\{(\w+)\}/g, (V, P) => P in C ? String(C[P]) : V);
7023
7030
  } catch {
7024
7031
  return String(z);
7025
7032
  }
7026
- }, _ = n.template || "${fieldLabel}: ${value}", $ = C(_, p), y = (() => {
7033
+ }, _ = n.template || "${fieldLabel}: ${value}", $ = D(_, p), y = (() => {
7027
7034
  if (n.valueColorIndex !== void 0 && s?.colors) {
7028
7035
  const x = n.valueColorIndex;
7029
7036
  if (x >= 0 && x < s.colors.length)
@@ -7034,7 +7041,7 @@ const ec = de.memo(function({
7034
7041
  return /* @__PURE__ */ k(
7035
7042
  "div",
7036
7043
  {
7037
- ref: u,
7044
+ ref: f,
7038
7045
  className: "flex flex-col items-center justify-center w-full h-full p-4",
7039
7046
  style: {
7040
7047
  height: i === "100%" ? "100%" : i,
@@ -7056,7 +7063,7 @@ const ec = de.memo(function({
7056
7063
  g && v !== null && S !== null && /* @__PURE__ */ o("div", { className: "mt-4", children: /* @__PURE__ */ o(
7057
7064
  fn,
7058
7065
  {
7059
- values: N,
7066
+ values: w,
7060
7067
  min: v,
7061
7068
  max: S,
7062
7069
  color: y,
@@ -7076,7 +7083,7 @@ const ec = de.memo(function({
7076
7083
  height: r = "100%",
7077
7084
  colorPalette: n
7078
7085
  }) {
7079
- const i = t.content || "", s = t.accentColorIndex ?? 0, a = t.fontSize || "medium", l = t.alignment || "left", c = n?.colors && s < n.colors.length ? n.colors[s] : "#8884d8", u = {
7086
+ const i = t.content || "", s = t.accentColorIndex ?? 0, a = t.fontSize || "medium", l = t.alignment || "left", c = n?.colors && s < n.colors.length ? n.colors[s] : "#8884d8", f = {
7080
7087
  small: "text-sm",
7081
7088
  medium: "text-lg",
7082
7089
  large: "text-xl"
@@ -7089,12 +7096,12 @@ const ec = de.memo(function({
7089
7096
  `), S = [];
7090
7097
  let g = null;
7091
7098
  for (let b = 0; b < v.length; b++) {
7092
- const C = v[b].trim();
7093
- if (!C) {
7099
+ const D = v[b].trim();
7100
+ if (!D) {
7094
7101
  g && (S.push(g), g = null), S.push({ type: "break" });
7095
7102
  continue;
7096
7103
  }
7097
- const _ = C.match(/^(#{1,3})\s+(.*)$/);
7104
+ const _ = D.match(/^(#{1,3})\s+(.*)$/);
7098
7105
  if (_) {
7099
7106
  g && (S.push(g), g = null), S.push({
7100
7107
  type: "header",
@@ -7103,69 +7110,69 @@ const ec = de.memo(function({
7103
7110
  });
7104
7111
  continue;
7105
7112
  }
7106
- const $ = C.match(/^[-*+]\s+(.*)$/);
7113
+ const $ = D.match(/^[-*+]\s+(.*)$/);
7107
7114
  if ($) {
7108
7115
  (!g || g.ordered) && (g && S.push(g), g = { type: "list", ordered: !1, children: [] }), g.children.push({
7109
7116
  type: "listItem",
7110
- children: f($[1]),
7117
+ children: u($[1]),
7111
7118
  parentOrdered: !1
7112
7119
  });
7113
7120
  continue;
7114
7121
  }
7115
- const T = C.match(/^\d+\.\s+(.*)$/);
7122
+ const T = D.match(/^\d+\.\s+(.*)$/);
7116
7123
  if (T) {
7117
7124
  (!g || !g.ordered) && (g && S.push(g), g = { type: "list", ordered: !0, children: [] }), g.children.push({
7118
7125
  type: "listItem",
7119
- children: f(T[1]),
7126
+ children: u(T[1]),
7120
7127
  parentOrdered: !0
7121
7128
  });
7122
7129
  continue;
7123
7130
  }
7124
7131
  g && (S.push(g), g = null), S.push({
7125
7132
  type: "paragraph",
7126
- children: f(C)
7133
+ children: u(D)
7127
7134
  });
7128
7135
  }
7129
7136
  return g && S.push(g), S;
7130
- }, f = (p) => {
7137
+ }, u = (p) => {
7131
7138
  const v = [];
7132
7139
  let S = p;
7133
7140
  for (; S; ) {
7134
7141
  const g = S.match(/^(.*?)\[([^\]]+)\]\(([^)]+)\)(.*)$/);
7135
7142
  if (g) {
7136
- const [, b, C, _, $] = g;
7137
- b && v.push(...w(b)), v.push({
7143
+ const [, b, D, _, $] = g;
7144
+ b && v.push(...N(b)), v.push({
7138
7145
  type: "link",
7139
- content: C,
7146
+ content: D,
7140
7147
  url: _
7141
7148
  }), S = $;
7142
7149
  continue;
7143
7150
  }
7144
- v.push(...w(S));
7151
+ v.push(...N(S));
7145
7152
  break;
7146
7153
  }
7147
7154
  return v;
7148
- }, w = (p) => {
7155
+ }, N = (p) => {
7149
7156
  const v = [];
7150
7157
  let S = p;
7151
7158
  for (; S; ) {
7152
7159
  const g = S.match(/^(.*?)\*\*([^*]+)\*\*(.*)$/);
7153
7160
  if (g) {
7154
- const [, C, _, $] = g;
7155
- C && v.push({ type: "text", content: C }), v.push({ type: "bold", content: _ }), S = $;
7161
+ const [, D, _, $] = g;
7162
+ D && v.push({ type: "text", content: D }), v.push({ type: "bold", content: _ }), S = $;
7156
7163
  continue;
7157
7164
  }
7158
7165
  const b = S.match(/^(.*?)\*([^*]+)\*(.*)$/);
7159
7166
  if (b) {
7160
- const [, C, _, $] = b;
7161
- C && v.push({ type: "text", content: C }), v.push({ type: "italic", content: _ }), S = $;
7167
+ const [, D, _, $] = b;
7168
+ D && v.push({ type: "text", content: D }), v.push({ type: "italic", content: _ }), S = $;
7162
7169
  continue;
7163
7170
  }
7164
7171
  v.push({ type: "text", content: S });
7165
7172
  break;
7166
7173
  }
7167
7174
  return v;
7168
- }, N = (p, v, S) => {
7175
+ }, w = (p, v, S) => {
7169
7176
  switch (p.type) {
7170
7177
  case "text":
7171
7178
  return /* @__PURE__ */ o("span", { className: "text-dc-text", children: p.content }, v);
@@ -7187,14 +7194,14 @@ const ec = de.memo(function({
7187
7194
  v
7188
7195
  );
7189
7196
  case "header": {
7190
- const g = (C, _) => {
7197
+ const g = (D, _) => {
7191
7198
  const $ = "font-bold", T = {
7192
7199
  1: "mb-4",
7193
7200
  2: "mb-3",
7194
7201
  3: "mb-2"
7195
7202
  };
7196
7203
  let y = "";
7197
- return _ === "small" ? y = { 1: "text-lg", 2: "text-base", 3: "text-sm" }[C] || "text-sm" : _ === "large" ? y = { 1: "text-5xl", 2: "text-4xl", 3: "text-3xl" }[C] || "text-3xl" : y = { 1: "text-3xl", 2: "text-2xl", 3: "text-xl" }[C] || "text-xl", `${$} ${y} ${T[C]}`;
7204
+ return _ === "small" ? y = { 1: "text-lg", 2: "text-base", 3: "text-sm" }[D] || "text-sm" : _ === "large" ? y = { 1: "text-5xl", 2: "text-4xl", 3: "text-3xl" }[D] || "text-3xl" : y = { 1: "text-3xl", 2: "text-2xl", 3: "text-xl" }[D] || "text-xl", `${$} ${y} ${T[D]}`;
7198
7205
  }, b = `h${p.level}`;
7199
7206
  return /* @__PURE__ */ o(
7200
7207
  b,
@@ -7207,16 +7214,16 @@ const ec = de.memo(function({
7207
7214
  );
7208
7215
  }
7209
7216
  case "paragraph":
7210
- return /* @__PURE__ */ o("p", { className: "mb-3 leading-relaxed", children: p.children?.map((g, b) => N(g, b)) }, v);
7217
+ return /* @__PURE__ */ o("p", { className: "mb-3 leading-relaxed", children: p.children?.map((g, b) => w(g, b)) }, v);
7211
7218
  case "list": {
7212
7219
  const g = p.ordered ? "ol" : "ul";
7213
7220
  let b = "mb-3";
7214
- return l === "center" ? b += " list-none flex flex-col items-center" : l === "right" ? b += " list-none ml-auto max-w-max" : b += " list-none ml-6", /* @__PURE__ */ o(g, { className: b, children: p.children?.map((C, _) => N(C, _, p.ordered ? _ + 1 : void 0)) }, v);
7221
+ return l === "center" ? b += " list-none flex flex-col items-center" : l === "right" ? b += " list-none ml-auto max-w-max" : b += " list-none ml-6", /* @__PURE__ */ o(g, { className: b, children: p.children?.map((D, _) => w(D, _, p.ordered ? _ + 1 : void 0)) }, v);
7215
7222
  }
7216
7223
  case "listItem":
7217
7224
  if (p.children) {
7218
7225
  if (p.parentOrdered && S !== void 0) {
7219
- const g = u[a];
7226
+ const g = f[a];
7220
7227
  return l === "center" ? /* @__PURE__ */ k("li", { className: "mb-1 flex items-center justify-center", children: [
7221
7228
  /* @__PURE__ */ k(
7222
7229
  "span",
@@ -7229,9 +7236,9 @@ const ec = de.memo(function({
7229
7236
  ]
7230
7237
  }
7231
7238
  ),
7232
- /* @__PURE__ */ o("span", { className: "text-center", children: p.children.map((b, C) => N(b, C)) })
7239
+ /* @__PURE__ */ o("span", { className: "text-center", children: p.children.map((b, D) => w(b, D)) })
7233
7240
  ] }, v) : l === "right" ? /* @__PURE__ */ k("li", { className: "mb-1 flex items-start justify-end", children: [
7234
- /* @__PURE__ */ o("span", { className: "text-right", children: p.children.map((b, C) => N(b, C)) }),
7241
+ /* @__PURE__ */ o("span", { className: "text-right", children: p.children.map((b, D) => w(b, D)) }),
7235
7242
  /* @__PURE__ */ k(
7236
7243
  "span",
7237
7244
  {
@@ -7255,7 +7262,7 @@ const ec = de.memo(function({
7255
7262
  ]
7256
7263
  }
7257
7264
  ),
7258
- /* @__PURE__ */ o("span", { className: "flex-1", children: p.children.map((b, C) => N(b, C)) })
7265
+ /* @__PURE__ */ o("span", { className: "flex-1", children: p.children.map((b, D) => w(b, D)) })
7259
7266
  ] }, v);
7260
7267
  }
7261
7268
  return l === "center" ? /* @__PURE__ */ k("li", { className: "mb-1 flex items-center justify-center", children: [
@@ -7266,9 +7273,9 @@ const ec = de.memo(function({
7266
7273
  style: { backgroundColor: c }
7267
7274
  }
7268
7275
  ),
7269
- /* @__PURE__ */ o("span", { className: "text-center", children: p.children.map((g, b) => N(g, b)) })
7276
+ /* @__PURE__ */ o("span", { className: "text-center", children: p.children.map((g, b) => w(g, b)) })
7270
7277
  ] }, v) : l === "right" ? /* @__PURE__ */ k("li", { className: "mb-1 flex items-start justify-end", children: [
7271
- /* @__PURE__ */ o("span", { className: "text-right", children: p.children.map((g, b) => N(g, b)) }),
7278
+ /* @__PURE__ */ o("span", { className: "text-right", children: p.children.map((g, b) => w(g, b)) }),
7272
7279
  /* @__PURE__ */ o(
7273
7280
  "span",
7274
7281
  {
@@ -7284,7 +7291,7 @@ const ec = de.memo(function({
7284
7291
  style: { backgroundColor: c }
7285
7292
  }
7286
7293
  ),
7287
- /* @__PURE__ */ o("span", { className: "flex-1", children: p.children.map((g, b) => N(g, b)) })
7294
+ /* @__PURE__ */ o("span", { className: "flex-1", children: p.children.map((g, b) => w(g, b)) })
7288
7295
  ] }, v);
7289
7296
  }
7290
7297
  return null;
@@ -7313,12 +7320,12 @@ const ec = de.memo(function({
7313
7320
  return /* @__PURE__ */ o(
7314
7321
  "div",
7315
7322
  {
7316
- className: `p-4 w-full h-full overflow-auto ${u[a]} ${m[l]}`,
7323
+ className: `p-4 w-full h-full overflow-auto ${f[a]} ${m[l]}`,
7317
7324
  style: {
7318
7325
  height: r === "100%" ? "100%" : r,
7319
7326
  minHeight: r === "100%" ? "200px" : void 0
7320
7327
  },
7321
- children: A.map((p, v) => N(p, v))
7328
+ children: A.map((p, v) => w(p, v))
7322
7329
  }
7323
7330
  );
7324
7331
  }), Zc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -7346,7 +7353,7 @@ export {
7346
7353
  ms as Q,
7347
7354
  Xs as R,
7348
7355
  Ks as S,
7349
- Rc as T,
7356
+ Ec as T,
7350
7357
  fs as U,
7351
7358
  us as V,
7352
7359
  ds as W,
@@ -7354,7 +7361,7 @@ export {
7354
7361
  ls as Y,
7355
7362
  os as Z,
7356
7363
  as as _,
7357
- Er as a,
7364
+ Rr as a,
7358
7365
  is as a0,
7359
7366
  ns as a1,
7360
7367
  rs as a2,
@@ -7400,7 +7407,7 @@ export {
7400
7407
  zc as h,
7401
7408
  Ye as i,
7402
7409
  vs as j,
7403
- Ec as k,
7410
+ Rc as k,
7404
7411
  bt as l,
7405
7412
  dc as m,
7406
7413
  uc as n,
@@ -7417,4 +7424,4 @@ export {
7417
7424
  pc as y,
7418
7425
  Bs as z
7419
7426
  };
7420
- //# sourceMappingURL=charts--hFH-bsu.js.map
7427
+ //# sourceMappingURL=charts-BvLb1eub.js.map