drizzle-cube 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
1
  import { jsxs as r, jsx as e, Fragment as ce } from "react/jsx-runtime";
2
2
  import * as $e from "react";
3
- import Ve, { Component as sr, forwardRef as _t, useState as q, useRef as xe, useEffect as oe, useMemo as De, useImperativeHandle as jt, useCallback as J, Suspense as nr, lazy as ar } from "react";
3
+ import Ve, { Component as sr, forwardRef as _t, useState as q, useRef as be, useEffect as oe, useMemo as De, useImperativeHandle as jt, useCallback as J, Suspense as nr, lazy as ar } from "react";
4
4
  import { useCubeQuery as lr, useDebounce as ir, useFilterValues as or, useResponsiveDashboard as cr } from "./hooks.js";
5
5
  import { useScrollContainer as dr, ScrollContainerProvider as Qt } from "./providers.js";
6
6
  import { a as M, f as ur, i as mr } from "./chunks/chart-activitygridchart-config-48WqIofo.js";
7
7
  import { L as fr } from "./chunks/chart-chartcontainer-CdwzIKP1.js";
8
8
  import { u as hr, i as Bt, L as it, b as Ut } from "./chunks/charts-DFbr7EGW.js";
9
9
  import { c as Qn, j as Bn, h as Un, e as zn, d as Jn, v as Hn } from "./chunks/charts-DFbr7EGW.js";
10
- import pr, { verticalCompactor as br } from "react-grid-layout";
10
+ import pr, { verticalCompactor as xr } from "react-grid-layout";
11
11
  import { u as Ye } from "./chunks/chart-activitygridchart-BzL97Vnm.js";
12
- import { barChartConfig as xr } from "./chunks/chart-barchart-config-DjRZBtLb.js";
12
+ import { barChartConfig as br } from "./chunks/chart-barchart-config-DjRZBtLb.js";
13
13
  import { lineChartConfig as gr } from "./chunks/chart-linechart-config-CVBVB7nS.js";
14
14
  import { areaChartConfig as yr } from "./chunks/chart-areachart-config-D8taXdn1.js";
15
15
  import { pieChartConfig as vr } from "./chunks/chart-piechart-config-Bdd31Gdi.js";
@@ -23,9 +23,9 @@ import { kpiNumberConfig as Tr } from "./chunks/chart-kpinumber-config-CVikHojM.
23
23
  import { kpiDeltaConfig as Ar } from "./chunks/chart-kpidelta-config-CnZfi_P2.js";
24
24
  import { kpiTextConfig as Er } from "./chunks/chart-kpitext-config-B2MovXSw.js";
25
25
  import { markdownConfig as Rr } from "./chunks/chart-markdownchart-config-Cq5Sxrgq.js";
26
- var ot = /* @__PURE__ */ new Map(), Ue = /* @__PURE__ */ new WeakMap(), xt = 0, Ir;
26
+ var ot = /* @__PURE__ */ new Map(), Ue = /* @__PURE__ */ new WeakMap(), bt = 0, Ir;
27
27
  function Fr(t) {
28
- return t ? (Ue.has(t) || (xt += 1, Ue.set(t, xt.toString())), Ue.get(t)) : "0";
28
+ return t ? (Ue.has(t) || (bt += 1, Ue.set(t, bt.toString())), Ue.get(t)) : "0";
29
29
  }
30
30
  function Or(t) {
31
31
  return Object.keys(t).sort().filter(
@@ -39,11 +39,11 @@ function $r(t) {
39
39
  const o = /* @__PURE__ */ new Map();
40
40
  let m;
41
41
  const c = new IntersectionObserver((f) => {
42
- f.forEach((x) => {
42
+ f.forEach((b) => {
43
43
  var l;
44
- const u = x.isIntersecting && m.some((d) => x.intersectionRatio >= d);
45
- t.trackVisibility && typeof x.isVisible > "u" && (x.isVisible = u), (l = o.get(x.target)) == null || l.forEach((d) => {
46
- d(u, x);
44
+ const u = b.isIntersecting && m.some((d) => b.intersectionRatio >= d);
45
+ t.trackVisibility && typeof b.isVisible > "u" && (b.isVisible = u), (l = o.get(b.target)) == null || l.forEach((d) => {
46
+ d(u, b);
47
47
  });
48
48
  });
49
49
  }, t);
@@ -69,9 +69,9 @@ function Lr(t, s, n = {}, o = Ir) {
69
69
  }), () => {
70
70
  };
71
71
  }
72
- const { id: m, observer: c, elements: f } = $r(n), x = f.get(t) || [];
73
- return f.has(t) || f.set(t, x), x.push(s), c.observe(t), function() {
74
- x.splice(x.indexOf(s), 1), x.length === 0 && (f.delete(t), c.unobserve(t)), f.size === 0 && (c.disconnect(), ot.delete(m));
72
+ const { id: m, observer: c, elements: f } = $r(n), b = f.get(t) || [];
73
+ return f.has(t) || f.set(t, b), b.push(s), c.observe(t), function() {
74
+ b.splice(b.indexOf(s), 1), b.length === 0 && (f.delete(t), c.unobserve(t)), f.size === 0 && (c.disconnect(), ot.delete(m));
75
75
  };
76
76
  }
77
77
  function Mr({
@@ -82,24 +82,24 @@ function Mr({
82
82
  root: m,
83
83
  triggerOnce: c,
84
84
  skip: f,
85
- initialInView: x,
85
+ initialInView: b,
86
86
  fallbackInView: l,
87
87
  onChange: u
88
88
  } = {}) {
89
89
  var d;
90
- const [p, i] = $e.useState(null), N = $e.useRef(u), g = $e.useRef(x), [w, C] = $e.useState({
91
- inView: !!x,
90
+ const [p, i] = $e.useState(null), N = $e.useRef(u), g = $e.useRef(b), [w, C] = $e.useState({
91
+ inView: !!b,
92
92
  entry: void 0
93
93
  });
94
94
  N.current = u, $e.useEffect(
95
95
  () => {
96
- if (g.current === void 0 && (g.current = x), f || !p) return;
96
+ if (g.current === void 0 && (g.current = b), f || !p) return;
97
97
  let E;
98
98
  return E = Lr(
99
99
  p,
100
100
  (O, a) => {
101
- const b = g.current;
102
- g.current = O, !(b === void 0 && !O) && (C({
101
+ const x = g.current;
102
+ g.current = O, !(x === void 0 && !O) && (C({
103
103
  inView: O,
104
104
  entry: a
105
105
  }), N.current && N.current(O, a), a.isIntersecting && c && E && (E(), E = void 0));
@@ -134,9 +134,9 @@ function Mr({
134
134
  );
135
135
  const I = (d = w.entry) == null ? void 0 : d.target, F = $e.useRef(void 0);
136
136
  !p && I && !c && !f && F.current !== I && (F.current = I, C({
137
- inView: !!x,
137
+ inView: !!b,
138
138
  entry: void 0
139
- }), g.current = x);
139
+ }), g.current = b);
140
140
  const V = [i, w.inView, w.entry];
141
141
  return V.ref = V[0], V.inView = V[1], V.entry = V[2], V;
142
142
  }
@@ -288,16 +288,16 @@ function gt(t) {
288
288
  function Qr(t, s, n) {
289
289
  if (!n || n.length === 0 || !s || s.length === 0)
290
290
  return n;
291
- const o = t?.filter((x) => x.isUniversalTime && s.includes(x.id))?.filter((x) => {
292
- if (!("member" in x.filter)) return !1;
293
- const l = x.filter;
291
+ const o = t?.filter((b) => b.isUniversalTime && s.includes(b.id))?.filter((b) => {
292
+ if (!("member" in b.filter)) return !1;
293
+ const l = b.filter;
294
294
  return gt(l) !== void 0;
295
295
  });
296
296
  if (!o || o.length === 0)
297
297
  return n;
298
298
  const c = o[0].filter, f = gt(c);
299
- return n.map((x) => ({
300
- ...x,
299
+ return n.map((b) => ({
300
+ ...b,
301
301
  dateRange: f
302
302
  }));
303
303
  }
@@ -309,7 +309,7 @@ const Ke = _t(({
309
309
  dashboardFilters: m,
310
310
  dashboardFilterMapping: c,
311
311
  eagerLoad: f = !1,
312
- isVisible: x,
312
+ isVisible: b,
313
313
  // Deprecated - visibility now handled internally via useInView
314
314
  height: l = 300,
315
315
  title: u,
@@ -317,7 +317,7 @@ const Ke = _t(({
317
317
  loadingComponent: p,
318
318
  onDebugDataReady: i
319
319
  }, N) => {
320
- const [g, w] = q(0), C = xe(i), I = dr(), { ref: F, inView: V } = Mr({
320
+ const [g, w] = q(0), C = be(i), I = dr(), { ref: F, inView: V } = Mr({
321
321
  root: I,
322
322
  rootMargin: "200px",
323
323
  // Start loading 200px before entering viewport
@@ -331,7 +331,7 @@ const Ke = _t(({
331
331
  oe(() => {
332
332
  C.current = i;
333
333
  }, [i]);
334
- const { config: O } = hr(s), a = O.skipQuery === !0, b = De(() => {
334
+ const { config: O } = hr(s), a = O.skipQuery === !0, x = De(() => {
335
335
  if (a)
336
336
  return null;
337
337
  try {
@@ -349,7 +349,7 @@ const Ke = _t(({
349
349
  } catch (R) {
350
350
  return console.error("AnalyticsPortlet: Invalid query JSON:", R), null;
351
351
  }
352
- }, [t, g, a, m, c]), h = !b || a || !f && !E, { resultSet: v, isLoading: y, error: k } = lr(b, {
352
+ }, [t, g, a, m, c]), h = !x || a || !f && !E, { resultSet: v, isLoading: y, error: k } = lr(x, {
353
353
  skip: h,
354
354
  resetResultSetOnChange: !0
355
355
  });
@@ -358,7 +358,7 @@ const Ke = _t(({
358
358
  w((R) => R + 1);
359
359
  }
360
360
  }), []), oe(() => {
361
- if (C.current && n && b && v && !k) {
361
+ if (C.current && n && x && v && !k) {
362
362
  const G = (() => {
363
363
  switch (s) {
364
364
  case "pie":
@@ -371,12 +371,12 @@ const Ke = _t(({
371
371
  G && C.current({
372
372
  chartConfig: n || {},
373
373
  displayConfig: o || {},
374
- queryObject: b,
374
+ queryObject: x,
375
375
  data: G,
376
376
  chartType: s
377
377
  });
378
378
  }
379
- }, [n, o, b, v, s, k]);
379
+ }, [n, o, x, v, s, k]);
380
380
  const z = !a && O.dropZones.some((R) => R.mandatory === !0);
381
381
  if (!n && z)
382
382
  return /* @__PURE__ */ e("div", { ref: F, className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: l }, children: /* @__PURE__ */ r("div", { className: "text-center", children: [
@@ -389,7 +389,7 @@ const Ke = _t(({
389
389
  /* @__PURE__ */ e("div", { className: "text-xs text-dc-text-secondary", children: "Scroll to load" })
390
390
  ] }) });
391
391
  if (!a) {
392
- if (y || b && !v && !k)
392
+ if (y || x && !v && !k)
393
393
  return /* @__PURE__ */ e("div", { ref: F, className: "flex items-center justify-center w-full", style: { height: l }, children: p || /* @__PURE__ */ e(fr, { size: "md" }) });
394
394
  if (k)
395
395
  return /* @__PURE__ */ r("div", { ref: F, className: "p-4 border rounded-sm", style: { height: l, borderColor: "var(--dc-border)", backgroundColor: "var(--dc-surface)" }, children: [
@@ -409,7 +409,7 @@ const Ke = _t(({
409
409
  /* @__PURE__ */ r("div", { className: "space-y-2 text-xs", children: [
410
410
  /* @__PURE__ */ r("details", { children: [
411
411
  /* @__PURE__ */ e("summary", { className: "cursor-pointer font-medium", style: { color: "var(--dc-text-secondary)" }, children: "Query (with filters applied)" }),
412
- /* @__PURE__ */ e("pre", { className: "mt-1 p-2 rounded-sm text-xs overflow-auto max-h-20", style: { backgroundColor: "rgba(var(--dc-primary-rgb), 0.1)" }, children: b ? JSON.stringify(b, null, 2) : t })
412
+ /* @__PURE__ */ e("pre", { className: "mt-1 p-2 rounded-sm text-xs overflow-auto max-h-20", style: { backgroundColor: "rgba(var(--dc-primary-rgb), 0.1)" }, children: x ? JSON.stringify(x, null, 2) : t })
413
413
  ] }),
414
414
  /* @__PURE__ */ r("details", { children: [
415
415
  /* @__PURE__ */ e("summary", { className: "cursor-pointer font-medium", style: { color: "var(--dc-text-secondary)" }, children: "Chart Config" }),
@@ -421,7 +421,7 @@ const Ke = _t(({
421
421
  ] })
422
422
  ] })
423
423
  ] });
424
- if (!v || !b)
424
+ if (!v || !x)
425
425
  return /* @__PURE__ */ e("div", { ref: F, className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: l }, children: /* @__PURE__ */ r("div", { className: "text-center", children: [
426
426
  /* @__PURE__ */ e("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
427
427
  /* @__PURE__ */ e("div", { className: "text-xs", children: "Invalid query or no results" })
@@ -461,7 +461,7 @@ const Ke = _t(({
461
461
  data: s === "markdown" ? [] : T,
462
462
  chartConfig: n,
463
463
  displayConfig: o,
464
- queryObject: b ?? void 0,
464
+ queryObject: x ?? void 0,
465
465
  height: R,
466
466
  colorPalette: d,
467
467
  fallback: /* @__PURE__ */ e(
@@ -496,7 +496,7 @@ const Xe = ({
496
496
  closeOnBackdropClick: m = !0,
497
497
  closeOnEscape: c = !0,
498
498
  showCloseButton: f = !0,
499
- children: x,
499
+ children: b,
500
500
  footer: l,
501
501
  noPadding: u = !1
502
502
  }) => {
@@ -556,7 +556,7 @@ const Xe = ({
556
556
  }
557
557
  )
558
558
  ] }),
559
- /* @__PURE__ */ e("div", { className: `flex-1 overflow-y-auto ${u ? "" : "px-6 py-4"}`, children: x }),
559
+ /* @__PURE__ */ e("div", { className: `flex-1 overflow-y-auto ${u ? "" : "px-6 py-4"}`, children: b }),
560
560
  l && /* @__PURE__ */ e("div", { className: "flex items-center justify-end space-x-3 px-6 py-4 border-t border-dc-border bg-dc-surface-secondary", children: l })
561
561
  ]
562
562
  }
@@ -578,11 +578,11 @@ const Br = ar(
578
578
  onFieldSelect: m,
579
579
  onFieldDeselect: c,
580
580
  onRetrySchema: f,
581
- onOpenSettings: x,
581
+ onOpenSettings: b,
582
582
  onViewTypeChange: l,
583
583
  isExpanded: u = !1
584
584
  }) => {
585
- const d = M("chevronDown"), p = M("chevronRight"), i = M("warning"), N = M("refresh"), g = M("settings"), w = M("measure"), C = M("dimension"), I = M("timeDimension"), F = M("segment"), V = M("menu"), { features: E } = Ye(), O = E?.showSchemaDiagram === !0, [a, b] = q(/* @__PURE__ */ new Set()), [h, v] = q(/* @__PURE__ */ new Set()), [y, k] = q(""), [z, L] = q("tree"), [T, H] = q(null), [R, G] = q(null);
585
+ const d = M("chevronDown"), p = M("chevronRight"), i = M("warning"), N = M("refresh"), g = M("settings"), w = M("measure"), C = M("dimension"), I = M("timeDimension"), F = M("segment"), V = M("menu"), { features: E } = Ye(), O = E?.showSchemaDiagram === !0, [a, x] = q(/* @__PURE__ */ new Set()), [h, v] = q(/* @__PURE__ */ new Set()), [y, k] = q(""), [z, L] = q("tree"), [T, H] = q(null), [R, G] = q(null);
586
586
  if (Ve.useEffect(() => {
587
587
  u && O && L("diagram");
588
588
  }, [u, O]), Ve.useEffect(() => {
@@ -602,9 +602,9 @@ const Br = ar(
602
602
  ).length > 0 && (X = !0, se.add(`${W.name}-timeDimensions`)), X && U.add(W.name);
603
603
  });
604
604
  const ne = /* @__PURE__ */ new Set([...T || [], ...U]), S = /* @__PURE__ */ new Set([...R || [], ...se]);
605
- b(ne), v(S);
605
+ x(ne), v(S);
606
606
  } else
607
- T !== null && R !== null && (b(T), v(R), H(null), G(null));
607
+ T !== null && R !== null && (x(T), v(R), H(null), G(null));
608
608
  }, [t, y, T, R]), s === "loading")
609
609
  return /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center text-dc-text-muted", children: /* @__PURE__ */ r("div", { className: "text-center", children: [
610
610
  /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 mx-auto mb-3", style: { borderBottomColor: "var(--dc-primary)" } }),
@@ -629,10 +629,10 @@ const Br = ar(
629
629
  ]
630
630
  }
631
631
  ),
632
- x && /* @__PURE__ */ r(
632
+ b && /* @__PURE__ */ r(
633
633
  "button",
634
634
  {
635
- onClick: x,
635
+ onClick: b,
636
636
  className: "w-full flex items-center justify-center space-x-2 px-3 py-2 text-sm font-medium text-dc-text-secondary bg-dc-surface border border-dc-border rounded-md hover:bg-dc-surface-hover focus:outline-hidden focus:ring-2 focus:ring-blue-500",
637
637
  children: [
638
638
  /* @__PURE__ */ e(g, { className: "w-4 h-4" }),
@@ -658,7 +658,7 @@ const Br = ar(
658
658
  ] }) });
659
659
  const Z = (B) => {
660
660
  const U = new Set(a);
661
- if (U.has(B) ? U.delete(B) : U.add(B), b(U), T !== null) {
661
+ if (U.has(B) ? U.delete(B) : U.add(B), x(U), T !== null) {
662
662
  const se = new Set(T);
663
663
  se.has(B) ? se.delete(B) : se.add(B), H(se);
664
664
  }
@@ -802,10 +802,10 @@ const Br = ar(
802
802
  /* @__PURE__ */ e("div", { className: "border-b border-dc-border", children: /* @__PURE__ */ r("div", { className: "p-3 pb-0", children: [
803
803
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-3", children: [
804
804
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("h3", { className: "text-base font-semibold text-dc-text", children: z === "diagram" ? "Schema Diagram" : "Schema Explorer" }) }),
805
- /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: x && /* @__PURE__ */ e(
805
+ /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: b && /* @__PURE__ */ e(
806
806
  "button",
807
807
  {
808
- onClick: x,
808
+ onClick: b,
809
809
  className: "p-1 text-dc-text-muted hover:text-dc-text-secondary transition-colors",
810
810
  title: "Open settings",
811
811
  children: /* @__PURE__ */ e(g, { className: "w-4 h-4" })
@@ -869,7 +869,7 @@ const Br = ar(
869
869
  {
870
870
  className: "h-full",
871
871
  onCubeClick: (B) => {
872
- u || (b((U) => /* @__PURE__ */ new Set([...U, B])), L("tree"));
872
+ u || (x((U) => /* @__PURE__ */ new Set([...U, B])), L("tree"));
873
873
  },
874
874
  onFieldClick: (B, U, se) => {
875
875
  let ne;
@@ -1270,7 +1270,7 @@ const Br = ar(
1270
1270
  onValuesChange: o,
1271
1271
  schema: m
1272
1272
  }) => {
1273
- const c = Gt[s], [f, x] = q(!1), [l, u] = q(""), [d, p] = q(!1), i = xe(null), N = xe(""), g = ir(l, 300), w = De(() => m ? m.cubes.some(
1273
+ const c = Gt[s], [f, b] = q(!1), [l, u] = q(""), [d, p] = q(!1), i = be(null), N = be(""), g = ir(l, 300), w = De(() => m ? m.cubes.some(
1274
1274
  (R) => R.dimensions.some((G) => G.name === t)
1275
1275
  ) : !1, [m, t]), C = De(() => m ? m.cubes.some(
1276
1276
  (R) => R.dimensions.some((G) => G.name === t && G.type === "time")
@@ -1285,7 +1285,7 @@ const Br = ar(
1285
1285
  } = or(t, I);
1286
1286
  oe(() => {
1287
1287
  const R = (G) => {
1288
- i.current && !i.current.contains(G.target) && x(!1);
1288
+ i.current && !i.current.contains(G.target) && b(!1);
1289
1289
  };
1290
1290
  return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
1291
1291
  }, []), oe(() => {
@@ -1293,14 +1293,14 @@ const Br = ar(
1293
1293
  }, [f, I, a]), oe(() => {
1294
1294
  d && I && a && g !== N.current && (N.current = g, a(g));
1295
1295
  }, [g, d, I, a]);
1296
- const b = J(() => {
1296
+ const x = J(() => {
1297
1297
  const R = !f;
1298
- x(R), R || (u(""), N.current = "");
1298
+ b(R), R || (u(""), N.current = "");
1299
1299
  }, [f]), h = J((R) => {
1300
1300
  const G = R.target.value;
1301
1301
  u(G);
1302
1302
  }, []), v = J((R) => {
1303
- c.supportsMultipleValues ? n.includes(R) || o([...n, R]) : (o([R]), x(!1)), u("");
1303
+ c.supportsMultipleValues ? n.includes(R) || o([...n, R]) : (o([R]), b(!1)), u("");
1304
1304
  }, [c.supportsMultipleValues, n, o]), y = J((R) => {
1305
1305
  o(n.filter((G) => G !== R));
1306
1306
  }, [n, o]), k = J((R) => {
@@ -1457,7 +1457,7 @@ const Br = ar(
1457
1457
  /* @__PURE__ */ r(
1458
1458
  "button",
1459
1459
  {
1460
- onClick: b,
1460
+ onClick: x,
1461
1461
  className: "w-full text-left text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface hover:bg-dc-surface-hover focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex items-center justify-between min-w-0",
1462
1462
  children: [
1463
1463
  /* @__PURE__ */ e("span", { className: "text-dc-text-muted truncate", children: E && !d ? "Loading values..." : "Select value..." }),
@@ -1722,13 +1722,13 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
1722
1722
  schema: m,
1723
1723
  query: c,
1724
1724
  hideFieldSelector: f = !1,
1725
- hideOperatorSelector: x = !1,
1725
+ hideOperatorSelector: b = !1,
1726
1726
  hideRemoveButton: l = !1
1727
1727
  }) => {
1728
- const [u, d] = q(!1), [p, i] = q(!1), [N, g] = q(!1), [w, C] = q(""), I = xe(null), F = xe(null), [V, E] = q("this_month"), [O, a] = q({
1728
+ const [u, d] = q(!1), [p, i] = q(!1), [N, g] = q(!1), [w, C] = q(""), I = be(null), F = be(null), [V, E] = q("this_month"), [O, a] = q({
1729
1729
  startDate: dt(/* @__PURE__ */ new Date()),
1730
1730
  endDate: dt(/* @__PURE__ */ new Date())
1731
- }), [b, h] = q(1);
1731
+ }), [x, h] = q(1);
1732
1732
  oe(() => {
1733
1733
  const S = (W) => {
1734
1734
  I.current && !I.current.contains(W.target) && (d(!1), i(!1));
@@ -1807,7 +1807,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
1807
1807
  pe(W);
1808
1808
  }
1809
1809
  } else if (Fe(S)) {
1810
- const W = Ie(S, b);
1810
+ const W = Ie(S, x);
1811
1811
  pe(W);
1812
1812
  } else {
1813
1813
  const W = Ie(S);
@@ -1917,7 +1917,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
1917
1917
  ] })
1918
1918
  ] }),
1919
1919
  L && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 flex-1 sm:flex-initial min-w-0", children: [
1920
- !x && /* @__PURE__ */ r("div", { className: "relative shrink-0", children: [
1920
+ !b && /* @__PURE__ */ r("div", { className: "relative shrink-0", children: [
1921
1921
  /* @__PURE__ */ r(
1922
1922
  "button",
1923
1923
  {
@@ -1994,7 +1994,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
1994
1994
  type: "number",
1995
1995
  min: "1",
1996
1996
  max: "1000",
1997
- value: b,
1997
+ value: x,
1998
1998
  onChange: (S) => se(Math.max(1, parseInt(S.target.value) || 1)),
1999
1999
  placeholder: "Number",
2000
2000
  className: "flex-1 min-w-0 text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text hover:bg-dc-surface-hover focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
@@ -2035,9 +2035,9 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2035
2035
  onGroupRemove: m,
2036
2036
  schema: c,
2037
2037
  query: f,
2038
- depth: x = 0
2038
+ depth: b = 0
2039
2039
  }) => {
2040
- const [l, u] = q(!1), d = t.type === "and", p = d ? "AND" : "OR", i = t.filters, N = x > 0 ? `ml-${Math.min(x * 4, 16)}` : "", g = "border-slate-200", w = "bg-slate-50", C = "text-slate-700", I = () => {
2040
+ const [l, u] = q(!1), d = t.type === "and", p = d ? "AND" : "OR", i = t.filters, N = b > 0 ? `ml-${Math.min(b * 4, 16)}` : "", g = "border-slate-200", w = "bg-slate-50", C = "text-slate-700", I = () => {
2041
2041
  if (d) {
2042
2042
  const v = Ee(i);
2043
2043
  n(s, v);
@@ -2073,7 +2073,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2073
2073
  }
2074
2074
  const k = t.type === "and" ? Te(y) : Ee(y);
2075
2075
  n(s, k);
2076
- }, b = (v, y) => {
2076
+ }, x = (v, y) => {
2077
2077
  const k = [...i];
2078
2078
  k[v] = y, d ? n(s, Te(k)) : n(s, Ee(k));
2079
2079
  }, h = (v) => {
@@ -2162,11 +2162,11 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2162
2162
  {
2163
2163
  group: v,
2164
2164
  index: y,
2165
- onGroupChange: b,
2165
+ onGroupChange: x,
2166
2166
  onGroupRemove: h,
2167
2167
  schema: c,
2168
2168
  query: f,
2169
- depth: x + 1
2169
+ depth: b + 1
2170
2170
  },
2171
2171
  y
2172
2172
  ) : null),
@@ -2190,8 +2190,8 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2190
2190
  onFiltersChange: o,
2191
2191
  hideFieldSelector: m = !1
2192
2192
  }) => {
2193
- const c = Kr(t), f = s ? ht(s) : [], x = f.length > 0, l = () => {
2194
- if (!x) return;
2193
+ const c = Kr(t), f = s ? ht(s) : [], b = f.length > 0, l = () => {
2194
+ if (!b) return;
2195
2195
  const w = f[0]?.name || "", C = Je(w, "equals", []);
2196
2196
  if (t.length === 0)
2197
2197
  o([C]);
@@ -2246,8 +2246,8 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2246
2246
  "button",
2247
2247
  {
2248
2248
  onClick: l,
2249
- disabled: !x,
2250
- className: `flex items-center space-x-1 px-2 py-1 text-xs font-medium rounded focus:outline-hidden focus:ring-2 ${x ? "text-purple-700 bg-purple-100 border border-purple-200 hover:bg-purple-200 focus:ring-purple-500" : "text-dc-text-muted bg-dc-surface-secondary border border-dc-border cursor-not-allowed"}`,
2249
+ disabled: !b,
2250
+ className: `flex items-center space-x-1 px-2 py-1 text-xs font-medium rounded focus:outline-hidden focus:ring-2 ${b ? "text-purple-700 bg-purple-100 border border-purple-200 hover:bg-purple-200 focus:ring-purple-500" : "text-dc-text-muted bg-dc-surface-secondary border border-dc-border cursor-not-allowed"}`,
2251
2251
  children: [
2252
2252
  /* @__PURE__ */ e(ds, { className: "w-3 h-3" }),
2253
2253
  /* @__PURE__ */ e("span", { children: "Add Filter" })
@@ -2284,7 +2284,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2284
2284
  C
2285
2285
  ) : null) })
2286
2286
  ] });
2287
- }, ms = M("close"), fs = M("timeDimension"), wt = M("chevronDown"), bt = ({
2287
+ }, ms = M("close"), fs = M("timeDimension"), wt = M("chevronDown"), xt = ({
2288
2288
  timeDimension: t,
2289
2289
  availableTimeDimensions: s,
2290
2290
  currentDateRange: n,
@@ -2292,7 +2292,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2292
2292
  onTimeDimensionChange: m,
2293
2293
  onRemove: c,
2294
2294
  hideFieldSelector: f = !1,
2295
- hideRemoveButton: x = !1
2295
+ hideRemoveButton: b = !1
2296
2296
  }) => {
2297
2297
  const l = () => {
2298
2298
  if (!n) return "this_month";
@@ -2319,7 +2319,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2319
2319
  if (!n || Array.isArray(n)) return 1;
2320
2320
  const L = n.match(/^last (\d+) (days|weeks|months|quarters|years)$/);
2321
2321
  return L && parseInt(L[1]) || 1;
2322
- }, [p, i] = q(l()), [N, g] = q(u()), [w, C] = q(d()), [I, F] = q(!1), [V, E] = q(!1), O = xe(null);
2322
+ }, [p, i] = q(l()), [N, g] = q(u()), [w, C] = q(d()), [I, F] = q(!1), [V, E] = q(!1), O = be(null);
2323
2323
  oe(() => {
2324
2324
  const L = (T) => {
2325
2325
  O.current && !O.current.contains(T.target) && (F(!1), E(!1));
@@ -2328,7 +2328,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2328
2328
  }, []);
2329
2329
  const a = () => {
2330
2330
  F(!1), E(!V);
2331
- }, b = () => {
2331
+ }, x = () => {
2332
2332
  E(!1), F(!I);
2333
2333
  }, h = (L) => {
2334
2334
  if (i(L), F(!1), L === "custom") {
@@ -2387,7 +2387,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2387
2387
  /* @__PURE__ */ r(
2388
2388
  "button",
2389
2389
  {
2390
- onClick: b,
2390
+ onClick: x,
2391
2391
  className: "w-full sm:w-40 flex items-center justify-between text-left text-sm border border-dc-border rounded-sm px-2 py-1 bg-dc-surface text-dc-text hover:bg-dc-surface-hover focus:ring-2 focus:ring-blue-500 focus:border-blue-500",
2392
2392
  children: [
2393
2393
  /* @__PURE__ */ e("span", { className: "truncate", children: z }),
@@ -2445,7 +2445,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2445
2445
  // Empty placeholder to maintain layout consistency
2446
2446
  /* @__PURE__ */ e("div", { className: "flex-1" })
2447
2447
  ),
2448
- !x && /* @__PURE__ */ e(
2448
+ !b && /* @__PURE__ */ e(
2449
2449
  "button",
2450
2450
  {
2451
2451
  onClick: () => c(t),
@@ -2456,7 +2456,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2456
2456
  )
2457
2457
  ] })
2458
2458
  ] }) });
2459
- }, hs = M("add"), ps = M("timeDimension"), bs = ({
2459
+ }, hs = M("add"), ps = M("timeDimension"), xs = ({
2460
2460
  timeDimensions: t,
2461
2461
  onDateRangeChange: s,
2462
2462
  onDateRangeRemove: n
@@ -2465,7 +2465,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2465
2465
  if (m.length === 0) return;
2466
2466
  const l = m[0];
2467
2467
  s(l.dimension, "this month");
2468
- }, x = () => {
2468
+ }, b = () => {
2469
2469
  Object.keys(o).forEach((l) => {
2470
2470
  n(l);
2471
2471
  });
@@ -2484,7 +2484,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2484
2484
  c > 0 && /* @__PURE__ */ e(
2485
2485
  "button",
2486
2486
  {
2487
- onClick: x,
2487
+ onClick: b,
2488
2488
  className: "text-xs text-dc-text-muted hover:text-red-600 focus:outline-hidden underline",
2489
2489
  children: "Clear all"
2490
2490
  }
@@ -2508,7 +2508,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2508
2508
  if (!l.dateRange) return null;
2509
2509
  const u = t.map((d) => d.dimension);
2510
2510
  return /* @__PURE__ */ e(
2511
- bt,
2511
+ xt,
2512
2512
  {
2513
2513
  timeDimension: l.dimension,
2514
2514
  availableTimeDimensions: u,
@@ -2527,7 +2527,7 @@ const ss = M("close"), ns = M("filter"), rt = M("chevronDown"), as = M("search")
2527
2527
  function Ct(t) {
2528
2528
  return t.replace(/_/g, " ");
2529
2529
  }
2530
- function xs(t) {
2530
+ function bs(t) {
2531
2531
  switch (t) {
2532
2532
  case "most_dimensions":
2533
2533
  return "bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300";
@@ -2542,7 +2542,7 @@ function xs(t) {
2542
2542
  }
2543
2543
  }
2544
2544
  const gs = ({ analysis: t }) => {
2545
- const s = M("info"), n = M("chevronRight"), o = M("warning"), m = M("table"), c = M("link"), f = M("success"), x = M("error");
2545
+ const s = M("info"), n = M("chevronRight"), o = M("warning"), m = M("table"), c = M("link"), f = M("success"), b = M("error");
2546
2546
  return /* @__PURE__ */ r("div", { className: "bg-dc-surface-secondary border border-dc-border rounded-lg p-4 space-y-4", children: [
2547
2547
  /* @__PURE__ */ r("div", { className: "border-b border-dc-border pb-3", children: [
2548
2548
  /* @__PURE__ */ r("h4", { className: "text-sm font-semibold text-dc-text mb-2 flex items-center", children: [
@@ -2576,7 +2576,7 @@ const gs = ({ analysis: t }) => {
2576
2576
  /* @__PURE__ */ r("div", { className: "bg-dc-surface p-3 rounded text-sm", children: [
2577
2577
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-2 flex-wrap", children: [
2578
2578
  /* @__PURE__ */ e("span", { className: "font-mono font-medium text-dc-primary", children: t.primaryCube.selectedCube }),
2579
- /* @__PURE__ */ e("span", { className: `text-xs px-2 py-0.5 rounded ${xs(t.primaryCube.reason)}`, children: Ct(t.primaryCube.reason) })
2579
+ /* @__PURE__ */ e("span", { className: `text-xs px-2 py-0.5 rounded ${bs(t.primaryCube.reason)}`, children: Ct(t.primaryCube.reason) })
2580
2580
  ] }),
2581
2581
  /* @__PURE__ */ e("p", { className: "text-dc-text-secondary text-xs", children: t.primaryCube.explanation }),
2582
2582
  t.primaryCube.candidates && t.primaryCube.candidates.length > 1 && /* @__PURE__ */ r("details", { className: "mt-2", children: [
@@ -2597,7 +2597,7 @@ const gs = ({ analysis: t }) => {
2597
2597
  /* @__PURE__ */ e(f, { className: "w-3 h-3" }),
2598
2598
  "reachable"
2599
2599
  ] }) : /* @__PURE__ */ r("span", { className: "text-red-600 dark:text-red-400 flex items-center gap-0.5", children: [
2600
- /* @__PURE__ */ e(x, { className: "w-3 h-3" }),
2600
+ /* @__PURE__ */ e(b, { className: "w-3 h-3" }),
2601
2601
  "cannot reach all"
2602
2602
  ] })
2603
2603
  ] }, u)) })
@@ -2692,7 +2692,7 @@ const gs = ({ analysis: t }) => {
2692
2692
  validationSql: m,
2693
2693
  validationAnalysis: c,
2694
2694
  onValidate: f,
2695
- onExecute: x,
2695
+ onExecute: b,
2696
2696
  onRemoveField: l,
2697
2697
  onTimeDimensionGranularityChange: u,
2698
2698
  onFiltersChange: d,
@@ -2708,7 +2708,7 @@ const gs = ({ analysis: t }) => {
2708
2708
  shareButtonState: E = "idle",
2709
2709
  isViewingShared: O = !1
2710
2710
  }) => {
2711
- const [a, b] = q(!1), [h, v] = q(!1), [y, k] = q(!1);
2711
+ const [a, x] = q(!1), [h, v] = q(!1), [y, k] = q(!1);
2712
2712
  oe(() => {
2713
2713
  (a || h) && typeof window < "u" && window.Prism && setTimeout(() => {
2714
2714
  try {
@@ -2791,7 +2791,7 @@ const gs = ({ analysis: t }) => {
2791
2791
  }
2792
2792
  else
2793
2793
  return `${fe} text-dc-text-muted hover:text-dc-text-secondary`;
2794
- }, be = ({ fieldName: $, fieldType: ae, icon: ee }) => /* @__PURE__ */ r("div", { className: `inline-flex items-center text-sm px-3 py-2 rounded-lg border w-full ${(() => {
2794
+ }, xe = ({ fieldName: $, fieldType: ae, icon: ee }) => /* @__PURE__ */ r("div", { className: `inline-flex items-center text-sm px-3 py-2 rounded-lg border w-full ${(() => {
2795
2795
  switch (ae) {
2796
2796
  case "measures":
2797
2797
  return "bg-dc-measure text-dc-measure border-dc-measure";
@@ -3023,7 +3023,7 @@ const gs = ({ analysis: t }) => {
3023
3023
  ")"
3024
3024
  ] }),
3025
3025
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: (t.dimensions || []).map(($) => /* @__PURE__ */ e(
3026
- be,
3026
+ xe,
3027
3027
  {
3028
3028
  label: $,
3029
3029
  fieldName: $,
@@ -3059,7 +3059,7 @@ const gs = ({ analysis: t }) => {
3059
3059
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: (t.measures || []).map(($) => {
3060
3060
  const ae = s ? Wt($, s) : void 0;
3061
3061
  return /* @__PURE__ */ e(
3062
- be,
3062
+ xe,
3063
3063
  {
3064
3064
  label: $,
3065
3065
  fieldName: $,
@@ -3072,7 +3072,7 @@ const gs = ({ analysis: t }) => {
3072
3072
  ] })
3073
3073
  ] }),
3074
3074
  ts(t) && /* @__PURE__ */ e("div", { className: "mt-6", children: /* @__PURE__ */ e(
3075
- bs,
3075
+ xs,
3076
3076
  {
3077
3077
  timeDimensions: t.timeDimensions || [],
3078
3078
  onDateRangeChange: p,
@@ -3102,7 +3102,7 @@ const gs = ({ analysis: t }) => {
3102
3102
  {
3103
3103
  onClick: () => {
3104
3104
  const $ = !a;
3105
- b($), $ && (v(!1), k(!1));
3105
+ x($), $ && (v(!1), k(!1));
3106
3106
  },
3107
3107
  className: "text-sm text-dc-text-secondary hover:text-dc-text focus:outline-hidden focus:underline",
3108
3108
  children: [
@@ -3116,7 +3116,7 @@ const gs = ({ analysis: t }) => {
3116
3116
  {
3117
3117
  onClick: () => {
3118
3118
  const $ = !h;
3119
- v($), $ && (b(!1), k(!1));
3119
+ v($), $ && (x(!1), k(!1));
3120
3120
  },
3121
3121
  className: "text-sm text-dc-text-secondary hover:text-dc-text focus:outline-hidden focus:underline",
3122
3122
  children: [
@@ -3130,7 +3130,7 @@ const gs = ({ analysis: t }) => {
3130
3130
  {
3131
3131
  onClick: () => {
3132
3132
  const $ = !y;
3133
- k($), $ && (b(!1), v(!1));
3133
+ k($), $ && (x(!1), v(!1));
3134
3134
  },
3135
3135
  className: "text-sm text-dc-text-secondary hover:text-dc-text focus:outline-hidden focus:underline",
3136
3136
  children: [
@@ -3186,7 +3186,7 @@ const gs = ({ analysis: t }) => {
3186
3186
  /* @__PURE__ */ r(
3187
3187
  "button",
3188
3188
  {
3189
- onClick: x,
3189
+ onClick: b,
3190
3190
  disabled: n !== "valid",
3191
3191
  className: `flex-1 flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md transition-colors ${n !== "valid" ? "bg-dc-surface-secondary text-dc-text-muted cursor-not-allowed border border-dc-border" : "text-white border border-green-700 hover:bg-green-700 focus:ring-2 focus:ring-green-500"}`,
3192
3192
  style: n === "valid" ? { backgroundColor: "var(--dc-primary)" } : void 0,
@@ -3199,7 +3199,7 @@ const gs = ({ analysis: t }) => {
3199
3199
  ] }) })
3200
3200
  ] });
3201
3201
  }, We = {
3202
- bar: xr,
3202
+ bar: br,
3203
3203
  line: gr,
3204
3204
  area: yr,
3205
3205
  pie: vr,
@@ -3314,17 +3314,17 @@ function Ns({
3314
3314
  onDragStart: m,
3315
3315
  onDragEnd: c,
3316
3316
  onDragOver: f,
3317
- getFieldStyling: x,
3317
+ getFieldStyling: b,
3318
3318
  onReorder: l,
3319
3319
  draggedItem: u
3320
3320
  }) {
3321
- const { key: d, label: p, description: i, mandatory: N, maxItems: g, emptyText: w, icon: C } = t, [I, F] = q(null), [V, E] = q(!1), [O, a] = q(!1), b = () => {
3321
+ const { key: d, label: p, description: i, mandatory: N, maxItems: g, emptyText: w, icon: C } = t, [I, F] = q(null), [V, E] = q(!1), [O, a] = q(!1), x = () => {
3322
3322
  let T = s.length;
3323
3323
  return u && u.fromAxis === d && (T = Math.max(0, s.length - 1)), !g || T < g;
3324
3324
  }, h = () => {
3325
3325
  let T = s.length;
3326
3326
  return u && u.fromAxis === d && (T = Math.max(0, s.length - 1)), g && T >= g;
3327
- }, v = b(), y = h();
3327
+ }, v = x(), y = h();
3328
3328
  Ve.useEffect(() => {
3329
3329
  const T = () => {
3330
3330
  F(null), E(!1), a(!1);
@@ -3390,7 +3390,7 @@ function Ns({
3390
3390
  v || g === 1 ? n(T, d) : T.preventDefault(), E(!1), a(!1);
3391
3391
  },
3392
3392
  children: s.length === 0 ? /* @__PURE__ */ e("div", { className: "text-xs text-dc-text-muted text-center w-full", children: y ? "Maximum items reached" : w || "Drop fields here" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: s.map((T, H) => {
3393
- const { IconComponent: R, baseClasses: G, hoverClasses: Z } = x(T), ie = I === H, ue = u && u.field === T && u.fromAxis === d;
3393
+ const { IconComponent: R, baseClasses: G, hoverClasses: Z } = b(T), ie = I === H, ue = u && u.field === T && u.fromAxis === d;
3394
3394
  return /* @__PURE__ */ r(
3395
3395
  "div",
3396
3396
  {
@@ -3445,12 +3445,12 @@ function ut({
3445
3445
  onChartConfigChange: c,
3446
3446
  onDisplayConfigChange: f
3447
3447
  }) {
3448
- const [x, l] = q(null), u = De(
3448
+ const [b, l] = q(null), u = De(
3449
3449
  () => Ut(t, We),
3450
3450
  [t]
3451
3451
  ), d = u.skipQuery === !0, p = (a) => {
3452
- const b = s[a];
3453
- return Array.isArray(b) ? b : typeof b == "string" ? [b] : [];
3452
+ const x = s[a];
3453
+ return Array.isArray(x) ? x : typeof x == "string" ? [x] : [];
3454
3454
  };
3455
3455
  oe(() => {
3456
3456
  if (!o) return;
@@ -3459,12 +3459,12 @@ function ut({
3459
3459
  ...o.timeDimensions,
3460
3460
  ...o.measures
3461
3461
  ];
3462
- let b = !1;
3462
+ let x = !1;
3463
3463
  const h = { ...s };
3464
3464
  u.dropZones.forEach((v) => {
3465
3465
  const y = p(v.key), k = y.filter((z) => a.includes(z));
3466
- k.length !== y.length && (b = !0, k.length === 0 ? delete h[v.key] : v.maxItems === 1 ? h[v.key] = k[0] : h[v.key] = k);
3467
- }), b && c(h);
3466
+ k.length !== y.length && (x = !0, k.length === 0 ? delete h[v.key] : v.maxItems === 1 ? h[v.key] = k[0] : h[v.key] = k);
3467
+ }), x && c(h);
3468
3468
  }, [o, s, u.dropZones, c]);
3469
3469
  const i = (a) => o ? o.measures.includes(a) ? "measure" : o.timeDimensions.includes(a) ? "timeDimension" : "dimension" : "dimension", N = (a) => {
3470
3470
  switch (i(a)) {
@@ -3487,46 +3487,46 @@ function ut({
3487
3487
  hoverClasses: "hover:opacity-80"
3488
3488
  };
3489
3489
  }
3490
- }, g = (a, b, h, v) => {
3491
- a.dataTransfer.setData("text/plain", JSON.stringify({ field: b, fromAxis: h, fromIndex: v })), l({ field: b, fromAxis: h, fromIndex: v });
3490
+ }, g = (a, x, h, v) => {
3491
+ a.dataTransfer.setData("text/plain", JSON.stringify({ field: x, fromAxis: h, fromIndex: v })), l({ field: x, fromAxis: h, fromIndex: v });
3492
3492
  }, w = (a) => {
3493
3493
  a.preventDefault();
3494
3494
  }, C = () => {
3495
3495
  l(null);
3496
- }, I = (a, b) => {
3496
+ }, I = (a, x) => {
3497
3497
  a.preventDefault();
3498
3498
  const h = JSON.parse(a.dataTransfer.getData("text/plain")), { field: v, fromAxis: y } = h, k = { ...s };
3499
- if (y !== "available" && y !== b) {
3499
+ if (y !== "available" && y !== x) {
3500
3500
  const T = k[y];
3501
3501
  if (Array.isArray(T)) {
3502
3502
  const H = T.filter((R) => R !== v);
3503
3503
  H.length === 0 ? delete k[y] : k[y] = H;
3504
3504
  } else T === v && delete k[y];
3505
3505
  }
3506
- const z = k[b];
3507
- u.dropZones.find((T) => T.key === b)?.maxItems === 1 ? k[b] = v : Array.isArray(z) ? z.includes(v) || (k[b] = [...z, v]) : k[b] = [v], l(null), c(k);
3508
- }, F = (a, b) => {
3509
- const h = { ...s }, v = h[b];
3506
+ const z = k[x];
3507
+ u.dropZones.find((T) => T.key === x)?.maxItems === 1 ? k[x] = v : Array.isArray(z) ? z.includes(v) || (k[x] = [...z, v]) : k[x] = [v], l(null), c(k);
3508
+ }, F = (a, x) => {
3509
+ const h = { ...s }, v = h[x];
3510
3510
  if (Array.isArray(v)) {
3511
3511
  const y = v.filter((k) => k !== a);
3512
- y.length === 0 ? delete h[b] : h[b] = y;
3513
- } else v === a && delete h[b];
3512
+ y.length === 0 ? delete h[x] : h[x] = y;
3513
+ } else v === a && delete h[x];
3514
3514
  c(h);
3515
- }, V = (a, b, h) => {
3515
+ }, V = (a, x, h) => {
3516
3516
  const v = { ...s }, y = v[h];
3517
- if (Array.isArray(y) && y.length > 1 && a !== b) {
3517
+ if (Array.isArray(y) && y.length > 1 && a !== x) {
3518
3518
  const k = [...y], [z] = k.splice(a, 1);
3519
- k.splice(b, 0, z), v[h] = k, l(null), c(v);
3519
+ k.splice(x, 0, z), v[h] = k, l(null), c(v);
3520
3520
  }
3521
3521
  }, O = (() => {
3522
3522
  if (!o) return { dimensions: [], timeDimensions: [], measures: [] };
3523
3523
  const a = /* @__PURE__ */ new Set();
3524
- return u.dropZones.forEach((b) => {
3525
- p(b.key).forEach((h) => a.add(h));
3526
- }), x && x.fromAxis !== "available" && a.add(x.field), {
3527
- dimensions: o.dimensions.filter((b) => !a.has(b)),
3528
- timeDimensions: o.timeDimensions.filter((b) => !a.has(b)),
3529
- measures: o.measures.filter((b) => !a.has(b))
3524
+ return u.dropZones.forEach((x) => {
3525
+ p(x.key).forEach((h) => a.add(h));
3526
+ }), b && b.fromAxis !== "available" && a.add(b.field), {
3527
+ dimensions: o.dimensions.filter((x) => !a.has(x)),
3528
+ timeDimensions: o.timeDimensions.filter((x) => !a.has(x)),
3529
+ measures: o.measures.filter((x) => !a.has(x))
3530
3530
  };
3531
3531
  })();
3532
3532
  return /* @__PURE__ */ r("div", { children: [
@@ -3540,14 +3540,14 @@ function ut({
3540
3540
  ] }),
3541
3541
  /* @__PURE__ */ r("div", { className: "space-y-1", children: [
3542
3542
  O.dimensions.map((a) => {
3543
- const b = x && x.field === a && x.fromAxis === "available";
3543
+ const x = b && b.field === a && b.fromAxis === "available";
3544
3544
  return /* @__PURE__ */ e(
3545
3545
  "div",
3546
3546
  {
3547
3547
  draggable: !0,
3548
3548
  onDragStart: (h) => g(h, a, "available"),
3549
3549
  onDragEnd: C,
3550
- className: `bg-dc-dimension text-dc-dimension border border-dc-dimension hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${b ? "opacity-50 cursor-grabbing" : ""}`,
3550
+ className: `bg-dc-dimension text-dc-dimension border border-dc-dimension hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${x ? "opacity-50 cursor-grabbing" : ""}`,
3551
3551
  title: a,
3552
3552
  children: a
3553
3553
  },
@@ -3564,14 +3564,14 @@ function ut({
3564
3564
  ] }),
3565
3565
  /* @__PURE__ */ r("div", { className: "space-y-1", children: [
3566
3566
  O.timeDimensions.map((a) => {
3567
- const b = x && x.field === a && x.fromAxis === "available";
3567
+ const x = b && b.field === a && b.fromAxis === "available";
3568
3568
  return /* @__PURE__ */ e(
3569
3569
  "div",
3570
3570
  {
3571
3571
  draggable: !0,
3572
3572
  onDragStart: (h) => g(h, a, "available"),
3573
3573
  onDragEnd: C,
3574
- className: `bg-dc-time-dimension text-dc-time-dimension border border-dc-time-dimension hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${b ? "opacity-50 cursor-grabbing" : ""}`,
3574
+ className: `bg-dc-time-dimension text-dc-time-dimension border border-dc-time-dimension hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${x ? "opacity-50 cursor-grabbing" : ""}`,
3575
3575
  title: a,
3576
3576
  children: a
3577
3577
  },
@@ -3588,14 +3588,14 @@ function ut({
3588
3588
  ] }),
3589
3589
  /* @__PURE__ */ r("div", { className: "space-y-1", children: [
3590
3590
  O.measures.map((a) => {
3591
- const b = x && x.field === a && x.fromAxis === "available";
3591
+ const x = b && b.field === a && b.fromAxis === "available";
3592
3592
  return /* @__PURE__ */ e(
3593
3593
  "div",
3594
3594
  {
3595
3595
  draggable: !0,
3596
3596
  onDragStart: (h) => g(h, a, "available"),
3597
3597
  onDragEnd: C,
3598
- className: `bg-dc-measure text-dc-measure border border-dc-measure hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${b ? "opacity-50 cursor-grabbing" : ""}`,
3598
+ className: `bg-dc-measure text-dc-measure border border-dc-measure hover:opacity-80 rounded-sm text-xs cursor-move px-3 py-2 sm:px-2 sm:py-1 truncate ${x ? "opacity-50 cursor-grabbing" : ""}`,
3599
3599
  title: a,
3600
3600
  children: a
3601
3601
  },
@@ -3621,7 +3621,7 @@ function ut({
3621
3621
  onDragOver: w,
3622
3622
  getFieldStyling: N,
3623
3623
  onReorder: V,
3624
- draggedItem: x
3624
+ draggedItem: b
3625
3625
  },
3626
3626
  a.key
3627
3627
  )) })
@@ -3716,9 +3716,9 @@ function ut({
3716
3716
  {
3717
3717
  type: "checkbox",
3718
3718
  checked: n[a.key] ?? a.defaultValue ?? !1,
3719
- onChange: (b) => f({
3719
+ onChange: (x) => f({
3720
3720
  ...n,
3721
- [a.key]: b.target.checked
3721
+ [a.key]: x.target.checked
3722
3722
  }),
3723
3723
  className: "rounded border-dc-border focus:ring-blue-500",
3724
3724
  style: { color: "var(--dc-primary)" }
@@ -3735,9 +3735,9 @@ function ut({
3735
3735
  "textarea",
3736
3736
  {
3737
3737
  value: n[a.key] ?? a.defaultValue ?? "",
3738
- onChange: (b) => f({
3738
+ onChange: (x) => f({
3739
3739
  ...n,
3740
- [a.key]: b.target.value
3740
+ [a.key]: x.target.value
3741
3741
  }),
3742
3742
  placeholder: a.placeholder,
3743
3743
  rows: 8,
@@ -3748,9 +3748,9 @@ function ut({
3748
3748
  {
3749
3749
  type: "text",
3750
3750
  value: n[a.key] ?? a.defaultValue ?? "",
3751
- onChange: (b) => f({
3751
+ onChange: (x) => f({
3752
3752
  ...n,
3753
- [a.key]: b.target.value
3753
+ [a.key]: x.target.value
3754
3754
  }),
3755
3755
  placeholder: a.placeholder,
3756
3756
  className: "w-full px-2 py-1 text-sm border border-dc-border rounded-sm focus:ring-blue-500 focus:border-blue-500 bg-dc-surface text-dc-text"
@@ -3760,7 +3760,7 @@ function ut({
3760
3760
  ] }),
3761
3761
  a.type === "paletteColor" && /* @__PURE__ */ r("div", { className: "space-y-1", children: [
3762
3762
  /* @__PURE__ */ e("label", { className: "text-sm text-dc-text-secondary", children: a.label }),
3763
- /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: m?.colors.map((b, h) => {
3763
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: m?.colors.map((x, h) => {
3764
3764
  const v = (n[a.key] ?? a.defaultValue ?? 0) === h;
3765
3765
  return /* @__PURE__ */ e(
3766
3766
  "button",
@@ -3772,10 +3772,10 @@ function ut({
3772
3772
  }),
3773
3773
  className: `w-8 h-8 rounded border-2 transition-all duration-200 hover:scale-110 focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 ${v ? "ring-2 ring-offset-1 scale-110" : "hover:border-dc-text-muted"}`,
3774
3774
  style: {
3775
- backgroundColor: b,
3775
+ backgroundColor: x,
3776
3776
  borderColor: v ? "var(--dc-primary)" : "var(--dc-border)"
3777
3777
  },
3778
- title: `Color ${h + 1}: ${b}`
3778
+ title: `Color ${h + 1}: ${x}`
3779
3779
  },
3780
3780
  h
3781
3781
  );
@@ -3809,9 +3809,9 @@ function ut({
3809
3809
  {
3810
3810
  type: "number",
3811
3811
  value: n[a.key] ?? a.defaultValue ?? 0,
3812
- onChange: (b) => f({
3812
+ onChange: (x) => f({
3813
3813
  ...n,
3814
- [a.key]: b.target.value === "" ? void 0 : Number(b.target.value)
3814
+ [a.key]: x.target.value === "" ? void 0 : Number(x.target.value)
3815
3815
  }),
3816
3816
  placeholder: a.placeholder,
3817
3817
  min: a.min,
@@ -3828,12 +3828,12 @@ function ut({
3828
3828
  "select",
3829
3829
  {
3830
3830
  value: n[a.key] ?? a.defaultValue ?? "",
3831
- onChange: (b) => f({
3831
+ onChange: (x) => f({
3832
3832
  ...n,
3833
- [a.key]: b.target.value
3833
+ [a.key]: x.target.value
3834
3834
  }),
3835
3835
  className: "w-full px-2 py-1 text-sm border border-dc-border rounded-sm focus:ring-blue-500 focus:border-blue-500 bg-dc-surface text-dc-text",
3836
- children: a.options?.map((b) => /* @__PURE__ */ e("option", { value: b.value, children: b.label }, b.value))
3836
+ children: a.options?.map((x) => /* @__PURE__ */ e("option", { value: x.value, children: x.label }, x.value))
3837
3837
  }
3838
3838
  ),
3839
3839
  a.description && /* @__PURE__ */ e("p", { className: "text-xs text-dc-text-muted", children: a.description })
@@ -3846,9 +3846,9 @@ function ut({
3846
3846
  {
3847
3847
  type: "color",
3848
3848
  value: n[a.key] ?? a.defaultValue ?? "#8884d8",
3849
- onChange: (b) => f({
3849
+ onChange: (x) => f({
3850
3850
  ...n,
3851
- [a.key]: b.target.value
3851
+ [a.key]: x.target.value
3852
3852
  }),
3853
3853
  className: "w-12 h-8 border border-dc-border rounded-sm cursor-pointer"
3854
3854
  }
@@ -3858,9 +3858,9 @@ function ut({
3858
3858
  {
3859
3859
  type: "text",
3860
3860
  value: n[a.key] ?? a.defaultValue ?? "#8884d8",
3861
- onChange: (b) => f({
3861
+ onChange: (x) => f({
3862
3862
  ...n,
3863
- [a.key]: b.target.value
3863
+ [a.key]: x.target.value
3864
3864
  }),
3865
3865
  placeholder: a.placeholder || "#8884d8",
3866
3866
  className: "flex-1 px-2 py-1 text-sm border border-dc-border rounded-sm focus:ring-blue-500 focus:border-blue-500 bg-dc-surface text-dc-text"
@@ -3882,7 +3882,7 @@ const ws = ({
3882
3882
  displayLimit: m = 10,
3883
3883
  onDisplayLimitChange: c,
3884
3884
  totalRowCount: f,
3885
- totalRowCountStatus: x,
3885
+ totalRowCountStatus: b,
3886
3886
  // Chart visualization props
3887
3887
  chartType: l = "table",
3888
3888
  chartConfig: u = {},
@@ -3895,7 +3895,7 @@ const ws = ({
3895
3895
  activeView: w = "table",
3896
3896
  onActiveViewChange: C
3897
3897
  }) => {
3898
- const I = M("error"), F = M("timeDimension"), V = M("success"), E = M("warning"), O = M("chevronDown"), a = M("chevronUp"), b = M("table"), h = M("measure"), v = M("adjustments"), [y, k] = q("table"), z = C ? w : y, L = C || k, [T, H] = q(!1), R = () => /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "text-center", children: [
3898
+ const I = M("error"), F = M("timeDimension"), V = M("success"), E = M("warning"), O = M("chevronDown"), a = M("chevronUp"), x = M("table"), h = M("measure"), v = M("adjustments"), [y, k] = q("table"), z = C ? w : y, L = C || k, [T, H] = q(!1), R = () => /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "text-center", children: [
3899
3899
  /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 mx-auto mb-4", style: { borderBottomColor: "var(--dc-primary)" } }),
3900
3900
  /* @__PURE__ */ e("div", { className: "text-sm font-semibold text-dc-text-secondary mb-1", children: "Executing Query..." }),
3901
3901
  /* @__PURE__ */ e("div", { className: "text-xs text-dc-text-muted", children: "Running your query against the cube API" })
@@ -3963,13 +3963,13 @@ const ws = ({
3963
3963
  s.length !== 1 ? "s" : "",
3964
3964
  " shown)"
3965
3965
  ] }),
3966
- x === "success" && f !== null && f !== void 0 && /* @__PURE__ */ r("span", { className: "text-xs text-dc-text-muted", children: [
3966
+ b === "success" && f !== null && f !== void 0 && /* @__PURE__ */ r("span", { className: "text-xs text-dc-text-muted", children: [
3967
3967
  "Total: ",
3968
3968
  f.toLocaleString(),
3969
3969
  " row",
3970
3970
  f !== 1 ? "s" : ""
3971
3971
  ] }),
3972
- x === "loading" && /* @__PURE__ */ e("span", { className: "text-xs text-dc-text-muted", children: "Counting total rows..." })
3972
+ b === "loading" && /* @__PURE__ */ e("span", { className: "text-xs text-dc-text-muted", children: "Counting total rows..." })
3973
3973
  ] })
3974
3974
  ] }),
3975
3975
  /* @__PURE__ */ r("div", { className: "flex items-center gap-3 flex-wrap", children: [
@@ -3980,7 +3980,7 @@ const ws = ({
3980
3980
  onClick: () => L("table"),
3981
3981
  className: `flex items-center gap-1 px-3 py-1.5 text-xs font-medium transition-colors ${z === "table" ? "bg-dc-primary text-white" : "text-dc-text-secondary hover:bg-dc-surface-hover"}`,
3982
3982
  children: [
3983
- /* @__PURE__ */ e(b, { className: "w-3.5 h-3.5" }),
3983
+ /* @__PURE__ */ e(x, { className: "w-3.5 h-3.5" }),
3984
3984
  "Table"
3985
3985
  ]
3986
3986
  }
@@ -4039,7 +4039,7 @@ const ws = ({
4039
4039
  }
4040
4040
  )
4041
4041
  ] }),
4042
- x === "success" && f !== null && f !== void 0 && f > 500 && /* @__PURE__ */ r("div", { className: "mt-3 bg-yellow-50 border border-yellow-200 rounded-lg p-3 flex items-start", children: [
4042
+ b === "success" && f !== null && f !== void 0 && f > 500 && /* @__PURE__ */ r("div", { className: "mt-3 bg-yellow-50 border border-yellow-200 rounded-lg p-3 flex items-start", children: [
4043
4043
  /* @__PURE__ */ e(E, { className: "w-5 h-5 text-yellow-600 mr-2 shrink-0 mt-0.5" }),
4044
4044
  /* @__PURE__ */ r("div", { className: "text-sm text-yellow-800", children: [
4045
4045
  /* @__PURE__ */ e("span", { className: "font-semibold", children: "Performance Warning:" }),
@@ -4080,7 +4080,7 @@ const ws = ({
4080
4080
  onConfigChange: o,
4081
4081
  onReset: m
4082
4082
  }) => {
4083
- const [c, f] = q(n), x = () => {
4083
+ const [c, f] = q(n), b = () => {
4084
4084
  o(c);
4085
4085
  }, l = () => {
4086
4086
  const i = {
@@ -4176,7 +4176,7 @@ const ws = ({
4176
4176
  /* @__PURE__ */ e(
4177
4177
  "button",
4178
4178
  {
4179
- onClick: x,
4179
+ onClick: b,
4180
4180
  className: "px-3 py-1.5 text-sm font-medium text-white border border-transparent rounded-md focus:outline-hidden focus:ring-2 focus:ring-blue-500",
4181
4181
  style: { backgroundColor: "var(--dc-primary)" },
4182
4182
  children: "Apply Changes"
@@ -4260,7 +4260,7 @@ async function Rs(t, s, n = "/api/ai/generate") {
4260
4260
  body: JSON.stringify(o)
4261
4261
  });
4262
4262
  if (console.log("📥 Client: Proxy response"), console.log(" Status:", c.status), console.log(" Status Text:", c.statusText), !c.ok) {
4263
- let x = `Failed to generate content: ${c.status} ${c.statusText}`;
4263
+ let b = `Failed to generate content: ${c.status} ${c.statusText}`;
4264
4264
  try {
4265
4265
  const l = await c.json();
4266
4266
  if (console.error("❌ Client: Proxy error:", l), c.status === 429 && l.error === "Daily quota exceeded")
@@ -4269,18 +4269,18 @@ async function Rs(t, s, n = "/api/ai/generate") {
4269
4269
 
4270
4270
  ${l.suggestion || "Add your own Gemini API key for unlimited access."}`
4271
4271
  );
4272
- l.error && (x = l.message || l.error, l.suggestion && (x += `
4272
+ l.error && (b = l.message || l.error, l.suggestion && (b += `
4273
4273
 
4274
4274
  💡 ${l.suggestion}`));
4275
4275
  } catch {
4276
4276
  try {
4277
4277
  const u = await c.text();
4278
- console.error("❌ Client: Proxy text error:", u), x = u || x;
4278
+ console.error("❌ Client: Proxy text error:", u), b = u || b;
4279
4279
  } catch {
4280
4280
  console.error("❌ Client: Could not parse error response");
4281
4281
  }
4282
4282
  }
4283
- throw new Error(x);
4283
+ throw new Error(b);
4284
4284
  }
4285
4285
  const f = await c.json();
4286
4286
  return console.log("✅ Client: Successfully generated content"), f;
@@ -4340,7 +4340,7 @@ const At = M("error"), st = M("success"), Et = M("sparkles"), Os = ({
4340
4340
  isSubmitting: !1,
4341
4341
  response: C
4342
4342
  })), setTimeout(() => {
4343
- x(C);
4343
+ b(C);
4344
4344
  }, 500);
4345
4345
  } catch (w) {
4346
4346
  c((C) => ({
@@ -4350,7 +4350,7 @@ const At = M("error"), st = M("success"), Et = M("sparkles"), Os = ({
4350
4350
  }));
4351
4351
  }
4352
4352
  }
4353
- }, x = async (g) => {
4353
+ }, b = async (g) => {
4354
4354
  if (!g) {
4355
4355
  console.log("AI Modal: No response text to validate");
4356
4356
  return;
@@ -4395,7 +4395,7 @@ const At = M("error"), st = M("success"), Et = M("sparkles"), Os = ({
4395
4395
  }));
4396
4396
  }
4397
4397
  }, l = async () => {
4398
- m.response && await x(m.response);
4398
+ m.response && await b(m.response);
4399
4399
  }, u = () => {
4400
4400
  if (!(!m.response || !n))
4401
4401
  try {
@@ -4538,10 +4538,10 @@ function $s() {
4538
4538
  }
4539
4539
  return c[l][u];
4540
4540
  }
4541
- var x = {
4541
+ var b = {
4542
4542
  compressToBase64: function(l) {
4543
4543
  if (l == null) return "";
4544
- var u = x._compress(l, 6, function(d) {
4544
+ var u = b._compress(l, 6, function(d) {
4545
4545
  return o.charAt(d);
4546
4546
  });
4547
4547
  switch (u.length % 4) {
@@ -4559,23 +4559,23 @@ function $s() {
4559
4559
  }
4560
4560
  },
4561
4561
  decompressFromBase64: function(l) {
4562
- return l == null ? "" : l == "" ? null : x._decompress(l.length, 32, function(u) {
4562
+ return l == null ? "" : l == "" ? null : b._decompress(l.length, 32, function(u) {
4563
4563
  return f(o, l.charAt(u));
4564
4564
  });
4565
4565
  },
4566
4566
  compressToUTF16: function(l) {
4567
- return l == null ? "" : x._compress(l, 15, function(u) {
4567
+ return l == null ? "" : b._compress(l, 15, function(u) {
4568
4568
  return n(u + 32);
4569
4569
  }) + " ";
4570
4570
  },
4571
4571
  decompressFromUTF16: function(l) {
4572
- return l == null ? "" : l == "" ? null : x._decompress(l.length, 16384, function(u) {
4572
+ return l == null ? "" : l == "" ? null : b._decompress(l.length, 16384, function(u) {
4573
4573
  return l.charCodeAt(u) - 32;
4574
4574
  });
4575
4575
  },
4576
4576
  //compress into uint8array (UCS-2 big endian format)
4577
4577
  compressToUint8Array: function(l) {
4578
- for (var u = x.compress(l), d = new Uint8Array(u.length * 2), p = 0, i = u.length; p < i; p++) {
4578
+ for (var u = b.compress(l), d = new Uint8Array(u.length * 2), p = 0, i = u.length; p < i; p++) {
4579
4579
  var N = u.charCodeAt(p);
4580
4580
  d[p * 2] = N >>> 8, d[p * 2 + 1] = N % 256;
4581
4581
  }
@@ -4584,34 +4584,34 @@ function $s() {
4584
4584
  //decompress from uint8array (UCS-2 big endian format)
4585
4585
  decompressFromUint8Array: function(l) {
4586
4586
  if (l == null)
4587
- return x.decompress(l);
4587
+ return b.decompress(l);
4588
4588
  for (var u = new Array(l.length / 2), d = 0, p = u.length; d < p; d++)
4589
4589
  u[d] = l[d * 2] * 256 + l[d * 2 + 1];
4590
4590
  var i = [];
4591
4591
  return u.forEach(function(N) {
4592
4592
  i.push(n(N));
4593
- }), x.decompress(i.join(""));
4593
+ }), b.decompress(i.join(""));
4594
4594
  },
4595
4595
  //compress into a string that is already URI encoded
4596
4596
  compressToEncodedURIComponent: function(l) {
4597
- return l == null ? "" : x._compress(l, 6, function(u) {
4597
+ return l == null ? "" : b._compress(l, 6, function(u) {
4598
4598
  return m.charAt(u);
4599
4599
  });
4600
4600
  },
4601
4601
  //decompress from an output of compressToEncodedURIComponent
4602
4602
  decompressFromEncodedURIComponent: function(l) {
4603
- return l == null ? "" : l == "" ? null : (l = l.replace(/ /g, "+"), x._decompress(l.length, 32, function(u) {
4603
+ return l == null ? "" : l == "" ? null : (l = l.replace(/ /g, "+"), b._decompress(l.length, 32, function(u) {
4604
4604
  return f(m, l.charAt(u));
4605
4605
  }));
4606
4606
  },
4607
4607
  compress: function(l) {
4608
- return x._compress(l, 16, function(u) {
4608
+ return b._compress(l, 16, function(u) {
4609
4609
  return n(u);
4610
4610
  });
4611
4611
  },
4612
4612
  _compress: function(l, u, d) {
4613
4613
  if (l == null) return "";
4614
- var p, i, N = {}, g = {}, w = "", C = "", I = "", F = 2, V = 3, E = 2, O = [], a = 0, b = 0, h;
4614
+ var p, i, N = {}, g = {}, w = "", C = "", I = "", F = 2, V = 3, E = 2, O = [], a = 0, x = 0, h;
4615
4615
  for (h = 0; h < l.length; h += 1)
4616
4616
  if (w = l.charAt(h), Object.prototype.hasOwnProperty.call(N, w) || (N[w] = V++, g[w] = !0), C = I + w, Object.prototype.hasOwnProperty.call(N, C))
4617
4617
  I = C;
@@ -4619,56 +4619,56 @@ function $s() {
4619
4619
  if (Object.prototype.hasOwnProperty.call(g, I)) {
4620
4620
  if (I.charCodeAt(0) < 256) {
4621
4621
  for (p = 0; p < E; p++)
4622
- a = a << 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++;
4622
+ a = a << 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++;
4623
4623
  for (i = I.charCodeAt(0), p = 0; p < 8; p++)
4624
- a = a << 1 | i & 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = i >> 1;
4624
+ a = a << 1 | i & 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = i >> 1;
4625
4625
  } else {
4626
4626
  for (i = 1, p = 0; p < E; p++)
4627
- a = a << 1 | i, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = 0;
4627
+ a = a << 1 | i, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = 0;
4628
4628
  for (i = I.charCodeAt(0), p = 0; p < 16; p++)
4629
- a = a << 1 | i & 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = i >> 1;
4629
+ a = a << 1 | i & 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = i >> 1;
4630
4630
  }
4631
4631
  F--, F == 0 && (F = Math.pow(2, E), E++), delete g[I];
4632
4632
  } else
4633
4633
  for (i = N[I], p = 0; p < E; p++)
4634
- a = a << 1 | i & 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = i >> 1;
4634
+ a = a << 1 | i & 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = i >> 1;
4635
4635
  F--, F == 0 && (F = Math.pow(2, E), E++), N[C] = V++, I = String(w);
4636
4636
  }
4637
4637
  if (I !== "") {
4638
4638
  if (Object.prototype.hasOwnProperty.call(g, I)) {
4639
4639
  if (I.charCodeAt(0) < 256) {
4640
4640
  for (p = 0; p < E; p++)
4641
- a = a << 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++;
4641
+ a = a << 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++;
4642
4642
  for (i = I.charCodeAt(0), p = 0; p < 8; p++)
4643
- a = a << 1 | i & 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = i >> 1;
4643
+ a = a << 1 | i & 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = i >> 1;
4644
4644
  } else {
4645
4645
  for (i = 1, p = 0; p < E; p++)
4646
- a = a << 1 | i, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = 0;
4646
+ a = a << 1 | i, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = 0;
4647
4647
  for (i = I.charCodeAt(0), p = 0; p < 16; p++)
4648
- a = a << 1 | i & 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = i >> 1;
4648
+ a = a << 1 | i & 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = i >> 1;
4649
4649
  }
4650
4650
  F--, F == 0 && (F = Math.pow(2, E), E++), delete g[I];
4651
4651
  } else
4652
4652
  for (i = N[I], p = 0; p < E; p++)
4653
- a = a << 1 | i & 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = i >> 1;
4653
+ a = a << 1 | i & 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = i >> 1;
4654
4654
  F--, F == 0 && (F = Math.pow(2, E), E++);
4655
4655
  }
4656
4656
  for (i = 2, p = 0; p < E; p++)
4657
- a = a << 1 | i & 1, b == u - 1 ? (b = 0, O.push(d(a)), a = 0) : b++, i = i >> 1;
4657
+ a = a << 1 | i & 1, x == u - 1 ? (x = 0, O.push(d(a)), a = 0) : x++, i = i >> 1;
4658
4658
  for (; ; )
4659
- if (a = a << 1, b == u - 1) {
4659
+ if (a = a << 1, x == u - 1) {
4660
4660
  O.push(d(a));
4661
4661
  break;
4662
- } else b++;
4662
+ } else x++;
4663
4663
  return O.join("");
4664
4664
  },
4665
4665
  decompress: function(l) {
4666
- return l == null ? "" : l == "" ? null : x._decompress(l.length, 32768, function(u) {
4666
+ return l == null ? "" : l == "" ? null : b._decompress(l.length, 32768, function(u) {
4667
4667
  return l.charCodeAt(u);
4668
4668
  });
4669
4669
  },
4670
4670
  _decompress: function(l, u, d) {
4671
- var p = [], i = 4, N = 4, g = 3, w = "", C = [], I, F, V, E, O, a, b, h = { val: d(0), position: u, index: 1 };
4671
+ var p = [], i = 4, N = 4, g = 3, w = "", C = [], I, F, V, E, O, a, x, h = { val: d(0), position: u, index: 1 };
4672
4672
  for (I = 0; I < 3; I += 1)
4673
4673
  p[I] = I;
4674
4674
  for (V = 0, O = Math.pow(2, 2), a = 1; a != O; )
@@ -4677,38 +4677,38 @@ function $s() {
4677
4677
  case 0:
4678
4678
  for (V = 0, O = Math.pow(2, 8), a = 1; a != O; )
4679
4679
  E = h.val & h.position, h.position >>= 1, h.position == 0 && (h.position = u, h.val = d(h.index++)), V |= (E > 0 ? 1 : 0) * a, a <<= 1;
4680
- b = n(V);
4680
+ x = n(V);
4681
4681
  break;
4682
4682
  case 1:
4683
4683
  for (V = 0, O = Math.pow(2, 16), a = 1; a != O; )
4684
4684
  E = h.val & h.position, h.position >>= 1, h.position == 0 && (h.position = u, h.val = d(h.index++)), V |= (E > 0 ? 1 : 0) * a, a <<= 1;
4685
- b = n(V);
4685
+ x = n(V);
4686
4686
  break;
4687
4687
  case 2:
4688
4688
  return "";
4689
4689
  }
4690
- for (p[3] = b, F = b, C.push(b); ; ) {
4690
+ for (p[3] = x, F = x, C.push(x); ; ) {
4691
4691
  if (h.index > l)
4692
4692
  return "";
4693
4693
  for (V = 0, O = Math.pow(2, g), a = 1; a != O; )
4694
4694
  E = h.val & h.position, h.position >>= 1, h.position == 0 && (h.position = u, h.val = d(h.index++)), V |= (E > 0 ? 1 : 0) * a, a <<= 1;
4695
- switch (b = V) {
4695
+ switch (x = V) {
4696
4696
  case 0:
4697
4697
  for (V = 0, O = Math.pow(2, 8), a = 1; a != O; )
4698
4698
  E = h.val & h.position, h.position >>= 1, h.position == 0 && (h.position = u, h.val = d(h.index++)), V |= (E > 0 ? 1 : 0) * a, a <<= 1;
4699
- p[N++] = n(V), b = N - 1, i--;
4699
+ p[N++] = n(V), x = N - 1, i--;
4700
4700
  break;
4701
4701
  case 1:
4702
4702
  for (V = 0, O = Math.pow(2, 16), a = 1; a != O; )
4703
4703
  E = h.val & h.position, h.position >>= 1, h.position == 0 && (h.position = u, h.val = d(h.index++)), V |= (E > 0 ? 1 : 0) * a, a <<= 1;
4704
- p[N++] = n(V), b = N - 1, i--;
4704
+ p[N++] = n(V), x = N - 1, i--;
4705
4705
  break;
4706
4706
  case 2:
4707
4707
  return C.join("");
4708
4708
  }
4709
- if (i == 0 && (i = Math.pow(2, g), g++), p[b])
4710
- w = p[b];
4711
- else if (b === N)
4709
+ if (i == 0 && (i = Math.pow(2, g), g++), p[x])
4710
+ w = p[x];
4711
+ else if (x === N)
4712
4712
  w = F + F.charAt(0);
4713
4713
  else
4714
4714
  return null;
@@ -4716,7 +4716,7 @@ function $s() {
4716
4716
  }
4717
4717
  }
4718
4718
  };
4719
- return x;
4719
+ return b;
4720
4720
  })();
4721
4721
  t != null ? t.exports = s : typeof angular < "u" && angular != null && angular.module("LZString", []).factory("LZString", function() {
4722
4722
  return s;
@@ -4836,7 +4836,7 @@ const _s = ({
4836
4836
  enableSharing: m = !1,
4837
4837
  onShare: c
4838
4838
  }, f) => {
4839
- const { cubeApi: x, updateApiConfig: l, features: u } = Ye(), d = () => {
4839
+ const { cubeApi: b, updateApiConfig: l, features: u } = Ye(), d = () => {
4840
4840
  if (!n)
4841
4841
  try {
4842
4842
  const A = localStorage.getItem(Ot);
@@ -4925,7 +4925,7 @@ const _s = ({
4925
4925
  displayConfig: { showLegend: !0, showGrid: !0, showTooltip: !0 },
4926
4926
  activeView: "table"
4927
4927
  };
4928
- })(), [F, V] = q(I.chartType), [E, O] = q(I.chartConfig), [a, b] = q(I.displayConfig), [h, v] = q(I.activeView), [y, k] = q(d()), [z, L] = q(!1), [T, H] = q(!1), [R, G] = q("tree"), [Z, ie] = q(!1), [ue, le] = q("idle"), [ve, he] = q(!1), [Ne, pe] = q({ size: 0, maxSize: 0 }), [B, U] = q(!1);
4928
+ })(), [F, V] = q(I.chartType), [E, O] = q(I.chartConfig), [a, x] = q(I.displayConfig), [h, v] = q(I.activeView), [y, k] = q(d()), [z, L] = q(!1), [T, H] = q(!1), [R, G] = q("tree"), [Z, ie] = q(!1), [ue, le] = q("idle"), [ve, he] = q(!1), [Ne, pe] = q({ size: 0, maxSize: 0 }), [B, U] = q(!1);
4929
4929
  oe(() => {
4930
4930
  s && JSON.stringify(s) !== JSON.stringify(i.query) && N((A) => ({
4931
4931
  ...A,
@@ -4942,7 +4942,7 @@ const _s = ({
4942
4942
  totalRowCountStatus: "idle"
4943
4943
  }));
4944
4944
  }, [s]);
4945
- const se = xe(""), [ne, S] = q(null), W = De(() => ne?.pivotQuery?.query ? {
4945
+ const se = be(""), [ne, S] = q(null), W = De(() => ne?.pivotQuery?.query ? {
4946
4946
  dimensions: ne.pivotQuery.query.dimensions || [],
4947
4947
  timeDimensions: ne.pivotQuery.query.timeDimensions?.map((A) => A.dimension) || [],
4948
4948
  measures: ne.pivotQuery.query.measures || []
@@ -4968,7 +4968,7 @@ const _s = ({
4968
4968
  schemaError: null
4969
4969
  }));
4970
4970
  try {
4971
- const P = await x.meta();
4971
+ const P = await b.meta();
4972
4972
  N((_) => ({
4973
4973
  ..._,
4974
4974
  schema: P,
@@ -5004,7 +5004,7 @@ const _s = ({
5004
5004
  } catch {
5005
5005
  }
5006
5006
  }, [y, n]);
5007
- const X = xe(!1);
5007
+ const X = be(!1);
5008
5008
  oe(() => {
5009
5009
  if (!m) return;
5010
5010
  const A = Ps();
@@ -5021,7 +5021,7 @@ const _s = ({
5021
5021
  executionError: null,
5022
5022
  totalRowCount: null,
5023
5023
  totalRowCountStatus: "idle"
5024
- })), P.chartType && V(P.chartType), P.chartConfig && O(P.chartConfig), P.displayConfig && b(P.displayConfig), P.activeView && v(P.activeView), U(!0), X.current = !0), Vs();
5024
+ })), P.chartType && V(P.chartType), P.chartConfig && O(P.chartConfig), P.displayConfig && x(P.displayConfig), P.activeView && v(P.activeView), U(!0), X.current = !0), Vs();
5025
5025
  }, [m]), oe(() => {
5026
5026
  i.executionStatus === "success" && Pe(i.query) && i.validationStatus === "valid" && ee();
5027
5027
  }, [g, h]);
@@ -5094,7 +5094,7 @@ const _s = ({
5094
5094
  };
5095
5095
  return Re(Q);
5096
5096
  });
5097
- }, [de]), be = J((A) => {
5097
+ }, [de]), xe = J((A) => {
5098
5098
  de((P) => {
5099
5099
  const _ = {
5100
5100
  ...P,
@@ -5142,7 +5142,7 @@ const _s = ({
5142
5142
  validationSql: null
5143
5143
  }));
5144
5144
  try {
5145
- const _ = await x.dryRun(A);
5145
+ const _ = await b.dryRun(A);
5146
5146
  S(_);
5147
5147
  const Q = !_.error && _.queryType && _.valid !== !1;
5148
5148
  Q && (se.current = P), N((Y) => ({
@@ -5159,7 +5159,7 @@ const _s = ({
5159
5159
  validationSql: null
5160
5160
  }));
5161
5161
  }
5162
- }, [i.query, x]);
5162
+ }, [i.query, b]);
5163
5163
  oe(() => {
5164
5164
  if (!Pe(i.query) || i.validationStatus !== "idle")
5165
5165
  return;
@@ -5179,8 +5179,8 @@ const _s = ({
5179
5179
  }));
5180
5180
  try {
5181
5181
  const A = Oe(i.query), P = h === "chart" ? void 0 : g, [_, Q] = await Promise.all([
5182
- x.load(P ? { ...A, limit: P } : A),
5183
- x.load(A)
5182
+ b.load(P ? { ...A, limit: P } : A),
5183
+ b.load(A)
5184
5184
  // No limit for total count
5185
5185
  ]), Y = _.tablePivot(), ke = Q.tablePivot().length;
5186
5186
  N((Qe) => ({
@@ -5202,7 +5202,7 @@ const _s = ({
5202
5202
  }));
5203
5203
  }
5204
5204
  }
5205
- }, [i.query, i.validationStatus, x, g, h]);
5205
+ }, [i.query, i.validationStatus, b, g, h]);
5206
5206
  oe(() => {
5207
5207
  X.current && i.validationStatus === "valid" && i.executionStatus === "idle" && (X.current = !1, ee());
5208
5208
  }, [i.validationStatus, i.executionStatus, ee]);
@@ -5277,7 +5277,7 @@ const _s = ({
5277
5277
  schemaError: null
5278
5278
  }));
5279
5279
  try {
5280
- const A = await x.meta();
5280
+ const A = await b.meta();
5281
5281
  N((P) => ({
5282
5282
  ...P,
5283
5283
  schema: A,
@@ -5293,7 +5293,7 @@ const _s = ({
5293
5293
  schemaError: P
5294
5294
  }));
5295
5295
  }
5296
- }, [x]), K = {
5296
+ }, [b]), K = {
5297
5297
  measures: i.query.measures || [],
5298
5298
  dimensions: i.query.dimensions || [],
5299
5299
  timeDimensions: (i.query.timeDimensions || []).map((A) => A.dimension)
@@ -5388,7 +5388,7 @@ const _s = ({
5388
5388
  onExecute: ee,
5389
5389
  onRemoveField: Se,
5390
5390
  onTimeDimensionGranularityChange: te,
5391
- onFiltersChange: be,
5391
+ onFiltersChange: xe,
5392
5392
  onDateRangeChange: me,
5393
5393
  onDateRangeRemove: Ae,
5394
5394
  onOrderChange: $,
@@ -5418,7 +5418,7 @@ const _s = ({
5418
5418
  availableFields: W,
5419
5419
  onChartTypeChange: V,
5420
5420
  onChartConfigChange: O,
5421
- onDisplayConfigChange: b,
5421
+ onDisplayConfigChange: x,
5422
5422
  activeView: h,
5423
5423
  onActiveViewChange: v
5424
5424
  }
@@ -5447,7 +5447,7 @@ const _s = ({
5447
5447
  })), setTimeout(async () => {
5448
5448
  const P = Oe(Le(A));
5449
5449
  try {
5450
- const _ = await x.dryRun(P), Q = !_.error && _.queryType && _.valid !== !1;
5450
+ const _ = await b.dryRun(P), Q = !_.error && _.queryType && _.valid !== !1;
5451
5451
  N((Y) => ({
5452
5452
  ...Y,
5453
5453
  validationStatus: Q ? "valid" : "invalid",
@@ -5543,7 +5543,7 @@ function $t({
5543
5543
  submitText: c,
5544
5544
  colorPalette: f
5545
5545
  }) {
5546
- const { cubeApi: x } = Ye(), [l, u] = q(""), [d, p] = q(""), [i, N] = q("bar"), [g, w] = q([]), [C, I] = q(!1), [F, V] = q(null), [E, O] = q(""), [a, b] = q(null), [h, v] = q({ xAxis: [], yAxis: [], series: [] }), [y, k] = q({ showLegend: !0, showGrid: !0, showTooltip: !0, stacked: !1 }), [z, L] = q(!1), [T, H] = q(null), R = xe(null), Z = Ut(i, We).skipQuery === !0, ie = (te) => {
5546
+ const { cubeApi: b } = Ye(), [l, u] = q(""), [d, p] = q(""), [i, N] = q("bar"), [g, w] = q([]), [C, I] = q(!1), [F, V] = q(null), [E, O] = q(""), [a, x] = q(null), [h, v] = q({ xAxis: [], yAxis: [], series: [] }), [y, k] = q({ showLegend: !0, showGrid: !0, showTooltip: !0, stacked: !1 }), [z, L] = q(!1), [T, H] = q(null), R = be(null), Z = Ut(i, We).skipQuery === !0, ie = (te) => {
5547
5547
  }, ue = 5, le = 4;
5548
5548
  oe(() => {
5549
5549
  if (t) {
@@ -5556,11 +5556,11 @@ function $t({
5556
5556
  return o.query;
5557
5557
  }
5558
5558
  })();
5559
- p(te), N(o.chartType), v(o.chartConfig || { xAxis: [], yAxis: [], series: [] }), k(o.displayConfig || {}), w(o.dashboardFilterMapping || []), O(te), V({ isValid: !0, message: "Loaded query (assumed valid)" }), b(null), Z || setTimeout(() => {
5559
+ p(te), N(o.chartType), v(o.chartConfig || { xAxis: [], yAxis: [], series: [] }), k(o.displayConfig || {}), w(o.dashboardFilterMapping || []), O(te), V({ isValid: !0, message: "Loaded query (assumed valid)" }), x(null), Z || setTimeout(() => {
5560
5560
  pe(te, !0, !0);
5561
5561
  }, 100);
5562
5562
  } else
5563
- u(""), p(""), N("bar"), v({ xAxis: [], yAxis: [], series: [] }), k({ showLegend: !0, showGrid: !0, showTooltip: !0, stacked: !1 }), w([]), O(""), V(null), b(null);
5563
+ u(""), p(""), N("bar"), v({ xAxis: [], yAxis: [], series: [] }), k({ showLegend: !0, showGrid: !0, showTooltip: !0, stacked: !1 }), w([]), O(""), V(null), x(null);
5564
5564
  I(!1);
5565
5565
  }
5566
5566
  }, [t, o]);
@@ -5582,11 +5582,11 @@ function $t({
5582
5582
  return;
5583
5583
  }
5584
5584
  }
5585
- const be = Z ? '{"measures":[]}' : d.trim();
5585
+ const xe = Z ? '{"measures":[]}' : d.trim();
5586
5586
  n(o ? {
5587
5587
  ...o,
5588
5588
  title: l.trim(),
5589
- query: be,
5589
+ query: xe,
5590
5590
  chartType: i,
5591
5591
  chartConfig: Object.keys(h).length > 0 ? h : void 0,
5592
5592
  displayConfig: y,
@@ -5595,7 +5595,7 @@ function $t({
5595
5595
  h: o.h || le
5596
5596
  } : {
5597
5597
  title: l.trim(),
5598
- query: be,
5598
+ query: xe,
5599
5599
  chartType: i,
5600
5600
  chartConfig: Object.keys(h).length > 0 ? h : void 0,
5601
5601
  displayConfig: y,
@@ -5604,33 +5604,33 @@ function $t({
5604
5604
  h: le
5605
5605
  });
5606
5606
  }, he = (te) => {
5607
- p(te), V(null), O(""), b(null), v({ xAxis: [], yAxis: [], series: [] });
5607
+ p(te), V(null), O(""), x(null), v({ xAxis: [], yAxis: [], series: [] });
5608
5608
  }, Ne = (te) => {
5609
- p(te), V(null), b(null), o || v({ xAxis: [], yAxis: [], series: [] });
5610
- }, pe = async (te, be = !1, me = !1) => {
5609
+ p(te), V(null), x(null), o || v({ xAxis: [], yAxis: [], series: [] });
5610
+ }, pe = async (te, xe = !1, me = !1) => {
5611
5611
  if (!te.trim()) {
5612
- be || V({ isValid: !1, message: "Query cannot be empty" });
5612
+ xe || V({ isValid: !1, message: "Query cannot be empty" });
5613
5613
  return;
5614
5614
  }
5615
5615
  let Ae;
5616
5616
  try {
5617
5617
  Ae = JSON.parse(te);
5618
5618
  } catch {
5619
- be || V({ isValid: !1, message: "Invalid JSON syntax" });
5619
+ xe || V({ isValid: !1, message: "Invalid JSON syntax" });
5620
5620
  return;
5621
5621
  }
5622
- be || (I(!0), V(null));
5622
+ xe || (I(!0), V(null));
5623
5623
  try {
5624
- const $ = await x.dryRun(Ae);
5624
+ const $ = await b.dryRun(Ae);
5625
5625
  if (!$.error && $.queryType) {
5626
- if (b($), !be) {
5626
+ if (x($), !xe) {
5627
5627
  const ee = [];
5628
5628
  $.pivotQuery?.query && ($.pivotQuery.query.measures?.length > 0 && ee.push(`${$.pivotQuery.query.measures.length} measure${$.pivotQuery.query.measures.length > 1 ? "s" : ""}`), $.pivotQuery.query.dimensions?.length > 0 && ee.push(`${$.pivotQuery.query.dimensions.length} dimension${$.pivotQuery.query.dimensions.length > 1 ? "s" : ""}`), $.pivotQuery.query.filters?.length > 0 && ee.push(`${$.pivotQuery.query.filters.length} filter${$.pivotQuery.query.filters.length > 1 ? "s" : ""}`), $.pivotQuery.query.timeDimensions?.length > 0 && ee.push(`${$.pivotQuery.query.timeDimensions.length} time dimension${$.pivotQuery.query.timeDimensions.length > 1 ? "s" : ""}`)), $.complexity && ee.push(`${$.complexity} complexity`), $.sql?.sql && ee.push("SQL generated"), $.cubesUsed?.length > 0 && ee.push(`Cubes: ${$.cubesUsed.join(", ")}`);
5629
5629
  const fe = ee.length > 0 ? `Query validated successfully (${ee.join(", ")})` : "Query validated successfully";
5630
5630
  V({ isValid: !0, message: fe }), O(te);
5631
5631
  }
5632
5632
  me || ie($);
5633
- } else if (!be) {
5633
+ } else if (!xe) {
5634
5634
  const ee = $.error || "Query validation failed", fe = $.details ? ` - ${Array.isArray($.details) ? $.details.join(", ") : $.details}` : "";
5635
5635
  V({
5636
5636
  isValid: !1,
@@ -5638,12 +5638,12 @@ function $t({
5638
5638
  }), O(te);
5639
5639
  }
5640
5640
  } catch ($) {
5641
- be || (V({
5641
+ xe || (V({
5642
5642
  isValid: !1,
5643
5643
  message: $ instanceof Error ? $.message : "Network error during validation"
5644
5644
  }), O(te));
5645
5645
  } finally {
5646
- be || I(!1);
5646
+ xe || I(!1);
5647
5647
  }
5648
5648
  }, B = async () => {
5649
5649
  await pe(d);
@@ -5658,15 +5658,15 @@ function $t({
5658
5658
  H(te), L(!0);
5659
5659
  }, se = (te) => {
5660
5660
  if (te?.preventDefault(), te?.stopPropagation(), !R.current) return;
5661
- const be = R.current.getCurrentQuery(), me = R.current.getValidationState(), Ae = R.current.getValidationResult(), $ = JSON.stringify(be, null, 2);
5661
+ const xe = R.current.getCurrentQuery(), me = R.current.getValidationState(), Ae = R.current.getValidationResult(), $ = JSON.stringify(xe, null, 2);
5662
5662
  p($), me?.status === "valid" && Ae ? (V({
5663
5663
  isValid: !0,
5664
5664
  message: "Query validated in Query Builder"
5665
- }), O($), b(Ae)) : (V(null), O(""), b(null)), L(!1);
5665
+ }), O($), x(Ae)) : (V(null), O(""), x(null)), L(!1);
5666
5666
  }, ne = () => {
5667
5667
  L(!1), H(null);
5668
5668
  }, S = () => {
5669
- u(""), p(""), N("bar"), v({ xAxis: [], yAxis: [], series: [] }), k({ showLegend: !0, showGrid: !0, showTooltip: !0, stacked: !1 }), V(null), I(!1), O(""), b(null), L(!1), H(null), s();
5669
+ u(""), p(""), N("bar"), v({ xAxis: [], yAxis: [], series: [] }), k({ showLegend: !0, showGrid: !0, showTooltip: !0, stacked: !1 }), V(null), I(!1), O(""), x(null), L(!1), H(null), s();
5670
5670
  }, W = !!o, X = d.trim() !== E.trim() && E !== "", de = F?.isValid && d.trim() === E.trim(), ge = a?.pivotQuery?.query ? {
5671
5671
  dimensions: a.pivotQuery.query.dimensions || [],
5672
5672
  timeDimensions: a.pivotQuery.query.timeDimensions?.map((te) => te.dimension) || [],
@@ -5855,7 +5855,7 @@ function $t({
5855
5855
  ] }) }),
5856
5856
  !W && /* @__PURE__ */ r("div", { children: [
5857
5857
  /* @__PURE__ */ e("label", { className: "block text-sm text-dc-text-muted mb-2", children: "Sample Queries (click to use)" }),
5858
- /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2 mb-2", children: js.map((te, be) => /* @__PURE__ */ e(
5858
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2 mb-2", children: js.map((te, xe) => /* @__PURE__ */ e(
5859
5859
  "button",
5860
5860
  {
5861
5861
  type: "button",
@@ -5863,7 +5863,7 @@ function $t({
5863
5863
  className: "px-2 py-1 text-xs text-dc-text-secondary bg-dc-surface-secondary border border-dc-border rounded-sm cursor-pointer transition-all duration-200 ease-in-out hover:bg-dc-surface-hover hover:border-dc-border m-0.5",
5864
5864
  children: te.name
5865
5865
  },
5866
- be
5866
+ xe
5867
5867
  )) })
5868
5868
  ] })
5869
5869
  ] })
@@ -5878,16 +5878,16 @@ function Qs({
5878
5878
  onSave: m,
5879
5879
  portletTitle: c
5880
5880
  }) {
5881
- const [f, x] = q(o);
5881
+ const [f, b] = q(o);
5882
5882
  oe(() => {
5883
- x(o);
5883
+ b(o);
5884
5884
  }, [o, t]);
5885
5885
  const l = (i) => {
5886
- x((N) => N.includes(i) ? N.filter((g) => g !== i) : [...N, i]);
5886
+ b((N) => N.includes(i) ? N.filter((g) => g !== i) : [...N, i]);
5887
5887
  }, u = () => {
5888
5888
  m(f), s();
5889
5889
  }, d = () => {
5890
- x(o), s();
5890
+ b(o), s();
5891
5891
  }, p = (i) => {
5892
5892
  if (!i.filter) return "";
5893
5893
  if ("member" in i.filter && i.filter.member) {
@@ -6022,22 +6022,22 @@ function tr({
6022
6022
  }) {
6023
6023
  const [c, f] = q(!1);
6024
6024
  return oe(() => {
6025
- const x = (l) => {
6025
+ const b = (l) => {
6026
6026
  l.key === "Escape" && c && f(!1);
6027
6027
  };
6028
- return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
6028
+ return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
6029
6029
  }, [c]), oe(() => {
6030
6030
  if (c && typeof window < "u" && window.Prism) {
6031
- const x = setTimeout(() => {
6031
+ const b = setTimeout(() => {
6032
6032
  window.Prism.highlightAll();
6033
6033
  }, 10);
6034
- return () => clearTimeout(x);
6034
+ return () => clearTimeout(b);
6035
6035
  }
6036
6036
  }, [c]), c ? /* @__PURE__ */ e(
6037
6037
  "div",
6038
6038
  {
6039
6039
  className: "absolute inset-0 bg-dc-surface border border-dc-border rounded-lg z-50 overflow-auto",
6040
- onClick: (x) => x.stopPropagation(),
6040
+ onClick: (b) => b.stopPropagation(),
6041
6041
  children: /* @__PURE__ */ r("div", { className: "p-4 h-full flex flex-col", children: [
6042
6042
  /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-4 shrink-0", children: [
6043
6043
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-dc-text", children: "Chart Debug Information" }),
@@ -7283,7 +7283,7 @@ function Us({
7283
7283
  onPaletteChange: s,
7284
7284
  className: n = ""
7285
7285
  }) {
7286
- const [o, m] = q(!1), c = xe(null), f = rr(t);
7286
+ const [o, m] = q(!1), c = be(null), f = rr(t);
7287
7287
  oe(() => {
7288
7288
  function l(u) {
7289
7289
  c.current && !c.current.contains(u.target) && m(!1);
@@ -7291,7 +7291,7 @@ function Us({
7291
7291
  if (o)
7292
7292
  return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
7293
7293
  }, [o]);
7294
- const x = (l) => {
7294
+ const b = (l) => {
7295
7295
  s(l), m(!1);
7296
7296
  };
7297
7297
  return /* @__PURE__ */ r("div", { className: `relative ${n}`, ref: c, children: [
@@ -7340,7 +7340,7 @@ function Us({
7340
7340
  "button",
7341
7341
  {
7342
7342
  type: "button",
7343
- onClick: () => x(l.name),
7343
+ onClick: () => b(l.name),
7344
7344
  className: `w-full px-3 py-2 text-left text-sm hover:bg-dc-surface-hover focus:outline-hidden focus:bg-dc-surface-hover ${l.name === t ? "bg-dc-surface-secondary" : "text-dc-text-secondary"}`,
7345
7345
  style: l.name === t ? { color: "var(--dc-primary)" } : void 0,
7346
7346
  children: /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
@@ -7379,7 +7379,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7379
7379
  onSave: m,
7380
7380
  onClose: c,
7381
7381
  onDelete: f,
7382
- convertToMetaResponse: x
7382
+ convertToMetaResponse: b
7383
7383
  }) => {
7384
7384
  const [l, u] = q(t.label), [d, p] = q(t.filter), [i, N] = q(!1);
7385
7385
  oe(() => {
@@ -7388,7 +7388,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7388
7388
  const g = De(() => jr(n), [n]), w = De(() => {
7389
7389
  if (!s) return null;
7390
7390
  if (i)
7391
- return x(s);
7391
+ return b(s);
7392
7392
  const h = s.cubes.map((y) => {
7393
7393
  const k = y.name, z = y.measures.filter((T) => {
7394
7394
  const H = T.name.includes(".") ? T.name : `${k}.${T.name}`;
@@ -7406,8 +7406,8 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7406
7406
  ...s,
7407
7407
  cubes: h
7408
7408
  };
7409
- return x(v);
7410
- }, [s, g, i, x]), C = De(() => "member" in d && d.member ? d.member : null, [d]), I = J((h) => {
7409
+ return b(v);
7410
+ }, [s, g, i, b]), C = De(() => "member" in d && d.member ? d.member : null, [d]), I = J((h) => {
7411
7411
  u(h);
7412
7412
  }, []), F = J((h) => {
7413
7413
  p(h[0] || d);
@@ -7441,137 +7441,151 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7441
7441
  } catch (y) {
7442
7442
  console.error("Failed to save filter:", y), alert("Failed to save filter. Please try again.");
7443
7443
  }
7444
- }, [t.id, t.isUniversalTime, l, d, O, m, c]), b = J(() => {
7444
+ }, [t.id, t.isUniversalTime, l, d, O, m, c]), x = J(() => {
7445
7445
  u(t.label), p(t.filter), c();
7446
7446
  }, [t, c]);
7447
- return /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-2", children: /* @__PURE__ */ r("div", { className: "rounded-lg shadow-xl max-w-7xl w-full h-[95vh] overflow-hidden flex flex-col bg-white dark:bg-gray-900", children: [
7448
- /* @__PURE__ */ r("div", { className: "px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between", children: [
7449
- /* @__PURE__ */ r("div", { className: "flex-1", children: [
7450
- /* @__PURE__ */ e("label", { className: "block text-sm font-medium mb-2 text-gray-900 dark:text-gray-100", children: "Filter Label" }),
7451
- /* @__PURE__ */ e(
7452
- "input",
7453
- {
7454
- type: "text",
7455
- value: l,
7456
- onChange: (h) => I(h.target.value),
7457
- className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100",
7458
- placeholder: "Enter filter label"
7459
- }
7460
- )
7461
- ] }),
7462
- /* @__PURE__ */ e(
7463
- "button",
7464
- {
7465
- onClick: b,
7466
- className: "ml-4 p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors text-gray-700 dark:text-gray-300",
7467
- children: /* @__PURE__ */ e(zs, { className: "w-5 h-5" })
7468
- }
7469
- )
7470
- ] }),
7471
- /* @__PURE__ */ r("div", { className: "flex-1 overflow-hidden flex", children: [
7472
- !t.isUniversalTime && /* @__PURE__ */ e("div", { className: "w-80 border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 overflow-auto", children: /* @__PURE__ */ r("div", { className: "p-4", children: [
7473
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-3", children: [
7474
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: "Available Fields" }),
7475
- /* @__PURE__ */ e(
7476
- "button",
7477
- {
7478
- onClick: () => N(!i),
7479
- className: "flex items-center gap-1 text-xs px-2 py-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400",
7480
- title: i ? "Show dashboard fields only" : "Show all fields",
7481
- children: i ? /* @__PURE__ */ r(ce, { children: [
7482
- /* @__PURE__ */ e(Hs, { className: "w-3.5 h-3.5" }),
7483
- /* @__PURE__ */ e("span", { children: "Dashboard" })
7484
- ] }) : /* @__PURE__ */ r(ce, { children: [
7485
- /* @__PURE__ */ e(Js, { className: "w-3.5 h-3.5" }),
7486
- /* @__PURE__ */ e("span", { children: "All" })
7487
- ] })
7488
- }
7489
- )
7490
- ] }),
7491
- !i && /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 dark:text-gray-400 mb-3 p-2 bg-blue-50 dark:bg-blue-900/20 rounded", children: "Showing only fields used in this dashboard" }),
7492
- w && w.cubes.length > 0 ? /* @__PURE__ */ e(
7493
- ct,
7494
- {
7495
- schema: w,
7496
- schemaStatus: "success",
7497
- schemaError: null,
7498
- selectedFields: {
7499
- measures: C ? [C] : [],
7500
- dimensions: C ? [C] : [],
7501
- timeDimensions: C ? [C] : []
7502
- },
7503
- onFieldSelect: (h) => V(h),
7504
- onFieldDeselect: () => {
7505
- }
7506
- }
7507
- ) : /* @__PURE__ */ e("div", { className: "text-center py-8 text-gray-500 dark:text-gray-400 text-sm", children: i ? /* @__PURE__ */ r("div", { children: [
7508
- /* @__PURE__ */ e("p", { className: "mb-2", children: "No schema available" }),
7509
- /* @__PURE__ */ e("p", { className: "text-xs", children: "Check your API connection" })
7510
- ] }) : /* @__PURE__ */ r("div", { children: [
7511
- /* @__PURE__ */ e("p", { className: "mb-2", children: "No fields used in dashboard" }),
7512
- /* @__PURE__ */ e("p", { className: "text-xs", children: "Add portlets to the dashboard first, or toggle to show all fields" })
7513
- ] }) })
7514
- ] }) }),
7515
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto px-6 py-4 bg-gray-50 dark:bg-gray-800", children: t.isUniversalTime ? (
7516
- /* Universal time filter - show DateRangeSelector */
7517
- /* @__PURE__ */ r("div", { children: [
7518
- /* @__PURE__ */ r("div", { className: "mb-4 p-3 rounded-md bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800", children: [
7519
- /* @__PURE__ */ e("div", { className: "text-sm font-medium text-blue-800 dark:text-blue-200 mb-1", children: "Universal Time Filter" }),
7520
- /* @__PURE__ */ e("div", { className: "text-xs text-blue-600 dark:text-blue-300", children: "This filter applies to all time dimensions in portlets it's mapped to. Select a date range below to filter data across all time-based charts." })
7521
- ] }),
7522
- /* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
7523
- bt,
7524
- {
7525
- timeDimension: "__universal_time__",
7526
- availableTimeDimensions: ["__universal_time__"],
7527
- currentDateRange: (() => {
7528
- const h = d;
7529
- if (h.dateRange) return h.dateRange;
7530
- if (h.values)
7531
- return Array.isArray(h.values) && h.values.length === 1 && typeof h.values[0] == "string" ? h.values[0] : h.values;
7532
- })(),
7533
- onDateRangeChange: E,
7534
- onTimeDimensionChange: () => {
7535
- },
7536
- onRemove: () => {
7537
- },
7538
- hideFieldSelector: !0,
7539
- hideRemoveButton: !0
7540
- }
7541
- ) })
7542
- ] })
7543
- ) : (
7544
- /* Regular filter - show FilterBuilder */
7545
- /* @__PURE__ */ e(
7546
- Kt,
7547
- {
7548
- filters: [d],
7549
- schema: x(s),
7550
- query: {},
7551
- onFiltersChange: F
7552
- }
7553
- )
7554
- ) })
7555
- ] }),
7556
- /* @__PURE__ */ r("div", { className: "px-6 py-4 border-t border-gray-200 dark:border-gray-700 flex items-center justify-between bg-white dark:bg-gray-900", children: [
7557
- /* @__PURE__ */ e(
7558
- "button",
7559
- {
7560
- onClick: f,
7561
- className: "px-4 py-2 text-sm font-medium text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-md transition-colors",
7562
- children: "Delete Filter"
7563
- }
7564
- ),
7565
- /* @__PURE__ */ e(
7566
- "button",
7447
+ return /* @__PURE__ */ e(
7448
+ "div",
7449
+ {
7450
+ className: "fixed inset-0 z-50 backdrop-blur-md flex items-center justify-center p-2",
7451
+ style: { backgroundColor: "var(--dc-overlay)" },
7452
+ children: /* @__PURE__ */ r(
7453
+ "div",
7567
7454
  {
7568
- onClick: a,
7569
- className: "px-4 py-2 text-sm font-medium rounded-md transition-colors bg-blue-600 hover:bg-blue-700 text-white",
7570
- children: "Done"
7455
+ className: "rounded-lg max-w-7xl w-full h-[95vh] overflow-hidden flex flex-col bg-dc-surface border border-dc-border",
7456
+ style: { boxShadow: "var(--dc-shadow-2xl)" },
7457
+ children: [
7458
+ /* @__PURE__ */ r("div", { className: "px-6 py-4 border-b border-dc-border flex items-center justify-between", children: [
7459
+ /* @__PURE__ */ r("div", { className: "flex-1", children: [
7460
+ /* @__PURE__ */ e("label", { className: "block text-sm font-medium mb-2 text-dc-text", children: "Filter Label" }),
7461
+ /* @__PURE__ */ e(
7462
+ "input",
7463
+ {
7464
+ type: "text",
7465
+ value: l,
7466
+ onChange: (h) => I(h.target.value),
7467
+ className: "w-full px-3 py-2 border border-dc-border rounded-md text-sm bg-dc-surface-secondary text-dc-text",
7468
+ placeholder: "Enter filter label"
7469
+ }
7470
+ )
7471
+ ] }),
7472
+ /* @__PURE__ */ e(
7473
+ "button",
7474
+ {
7475
+ onClick: x,
7476
+ className: "ml-4 p-2 hover:bg-dc-surface-hover rounded-md transition-colors text-dc-text-secondary",
7477
+ children: /* @__PURE__ */ e(zs, { className: "w-5 h-5" })
7478
+ }
7479
+ )
7480
+ ] }),
7481
+ /* @__PURE__ */ r("div", { className: "flex-1 overflow-hidden flex", children: [
7482
+ !t.isUniversalTime && /* @__PURE__ */ e("div", { className: "w-80 border-r border-dc-border bg-dc-surface overflow-auto", children: /* @__PURE__ */ r("div", { className: "p-4", children: [
7483
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-3", children: [
7484
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-dc-text", children: "Available Fields" }),
7485
+ /* @__PURE__ */ e(
7486
+ "button",
7487
+ {
7488
+ onClick: () => N(!i),
7489
+ className: "flex items-center gap-1 text-xs px-2 py-1 rounded hover:bg-dc-surface-hover text-dc-text-muted",
7490
+ title: i ? "Show dashboard fields only" : "Show all fields",
7491
+ children: i ? /* @__PURE__ */ r(ce, { children: [
7492
+ /* @__PURE__ */ e(Hs, { className: "w-3.5 h-3.5" }),
7493
+ /* @__PURE__ */ e("span", { children: "Dashboard" })
7494
+ ] }) : /* @__PURE__ */ r(ce, { children: [
7495
+ /* @__PURE__ */ e(Js, { className: "w-3.5 h-3.5" }),
7496
+ /* @__PURE__ */ e("span", { children: "All" })
7497
+ ] })
7498
+ }
7499
+ )
7500
+ ] }),
7501
+ !i && /* @__PURE__ */ e("div", { className: "text-xs text-dc-info mb-3 p-2 bg-dc-info-bg rounded border border-dc-info-border", children: "Showing only fields used in this dashboard" }),
7502
+ w && w.cubes.length > 0 ? /* @__PURE__ */ e(
7503
+ ct,
7504
+ {
7505
+ schema: w,
7506
+ schemaStatus: "success",
7507
+ schemaError: null,
7508
+ selectedFields: {
7509
+ measures: C ? [C] : [],
7510
+ dimensions: C ? [C] : [],
7511
+ timeDimensions: C ? [C] : []
7512
+ },
7513
+ onFieldSelect: (h) => V(h),
7514
+ onFieldDeselect: () => {
7515
+ }
7516
+ }
7517
+ ) : /* @__PURE__ */ e("div", { className: "text-center py-8 text-dc-text-muted text-sm", children: i ? /* @__PURE__ */ r("div", { children: [
7518
+ /* @__PURE__ */ e("p", { className: "mb-2", children: "No schema available" }),
7519
+ /* @__PURE__ */ e("p", { className: "text-xs", children: "Check your API connection" })
7520
+ ] }) : /* @__PURE__ */ r("div", { children: [
7521
+ /* @__PURE__ */ e("p", { className: "mb-2", children: "No fields used in dashboard" }),
7522
+ /* @__PURE__ */ e("p", { className: "text-xs", children: "Add portlets to the dashboard first, or toggle to show all fields" })
7523
+ ] }) })
7524
+ ] }) }),
7525
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto px-6 py-4 bg-dc-surface-secondary", children: t.isUniversalTime ? (
7526
+ /* Universal time filter - show DateRangeSelector */
7527
+ /* @__PURE__ */ r("div", { children: [
7528
+ /* @__PURE__ */ r("div", { className: "mb-4 p-3 rounded-md bg-dc-info-bg border border-dc-info-border", children: [
7529
+ /* @__PURE__ */ e("div", { className: "text-sm font-medium text-dc-info mb-1", children: "Universal Time Filter" }),
7530
+ /* @__PURE__ */ e("div", { className: "text-xs text-dc-text-secondary", children: "This filter applies to all time dimensions in portlets it's mapped to. Select a date range below to filter data across all time-based charts." })
7531
+ ] }),
7532
+ /* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
7533
+ xt,
7534
+ {
7535
+ timeDimension: "__universal_time__",
7536
+ availableTimeDimensions: ["__universal_time__"],
7537
+ currentDateRange: (() => {
7538
+ const h = d;
7539
+ if (h.dateRange) return h.dateRange;
7540
+ if (h.values)
7541
+ return Array.isArray(h.values) && h.values.length === 1 && typeof h.values[0] == "string" ? h.values[0] : h.values;
7542
+ })(),
7543
+ onDateRangeChange: E,
7544
+ onTimeDimensionChange: () => {
7545
+ },
7546
+ onRemove: () => {
7547
+ },
7548
+ hideFieldSelector: !0,
7549
+ hideRemoveButton: !0
7550
+ }
7551
+ ) })
7552
+ ] })
7553
+ ) : (
7554
+ /* Regular filter - show FilterBuilder */
7555
+ /* @__PURE__ */ e(
7556
+ Kt,
7557
+ {
7558
+ filters: [d],
7559
+ schema: b(s),
7560
+ query: {},
7561
+ onFiltersChange: F
7562
+ }
7563
+ )
7564
+ ) })
7565
+ ] }),
7566
+ /* @__PURE__ */ r("div", { className: "px-6 py-4 border-t border-dc-border flex items-center justify-between bg-dc-surface", children: [
7567
+ /* @__PURE__ */ e(
7568
+ "button",
7569
+ {
7570
+ onClick: f,
7571
+ className: "px-4 py-2 text-sm font-medium text-dc-danger hover:bg-dc-danger-bg rounded-md transition-colors",
7572
+ children: "Delete Filter"
7573
+ }
7574
+ ),
7575
+ /* @__PURE__ */ e(
7576
+ "button",
7577
+ {
7578
+ onClick: a,
7579
+ className: "px-4 py-2 text-sm font-medium rounded-md transition-colors bg-dc-primary hover:bg-dc-primary-hover text-dc-primary-content",
7580
+ children: "Done"
7581
+ }
7582
+ )
7583
+ ] })
7584
+ ]
7571
7585
  }
7572
7586
  )
7573
- ] })
7574
- ] }) });
7587
+ }
7588
+ );
7575
7589
  }, Ws = M("filter"), Ys = M("timeDimension"), Ks = ({
7576
7590
  dashboardFilters: t,
7577
7591
  schema: s,
@@ -7580,8 +7594,8 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7580
7594
  convertToMetaResponse: m,
7581
7595
  isTimeDimensionField: c
7582
7596
  }) => {
7583
- const f = J((x) => {
7584
- const { id: l, label: u, filter: d, isUniversalTime: p } = x;
7597
+ const f = J((b) => {
7598
+ const { id: l, label: u, filter: d, isUniversalTime: p } = b;
7585
7599
  if (!("member" in d))
7586
7600
  return null;
7587
7601
  const i = d, N = c(i.member);
@@ -7601,7 +7615,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7601
7615
  )
7602
7616
  ] }),
7603
7617
  /* @__PURE__ */ e(
7604
- bt,
7618
+ xt,
7605
7619
  {
7606
7620
  timeDimension: p ? "__universal_time__" : i.member,
7607
7621
  availableTimeDimensions: p ? ["__universal_time__"] : [i.member],
@@ -7634,7 +7648,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7634
7648
  index: 0,
7635
7649
  onFilterChange: (g, w) => {
7636
7650
  n(l, {
7637
- ...x,
7651
+ ...b,
7638
7652
  filter: w
7639
7653
  });
7640
7654
  },
@@ -7676,7 +7690,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7676
7690
  selectedFilterId: c,
7677
7691
  onFilterSelect: f
7678
7692
  }) => {
7679
- const [x, l] = Ve.useState(!1), u = (d) => {
7693
+ const [b, l] = Ve.useState(!1), u = (d) => {
7680
7694
  const { id: p, label: i, isUniversalTime: N } = d, g = c === p;
7681
7695
  return /* @__PURE__ */ r(
7682
7696
  "div",
@@ -7732,7 +7746,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7732
7746
  "div",
7733
7747
  {
7734
7748
  className: "px-4 py-2 flex items-center justify-between cursor-pointer",
7735
- onClick: () => l(!x),
7749
+ onClick: () => l(!b),
7736
7750
  children: [
7737
7751
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
7738
7752
  /* @__PURE__ */ e(lt, { className: "w-4 h-4 shrink-0", style: { color: "var(--dc-primary)" } }),
@@ -7751,7 +7765,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7751
7765
  /* @__PURE__ */ e(
7752
7766
  en,
7753
7767
  {
7754
- className: `w-4 h-4 transition-transform ${x ? "" : "rotate-180"}`,
7768
+ className: `w-4 h-4 transition-transform ${b ? "" : "rotate-180"}`,
7755
7769
  style: { color: "var(--dc-text-secondary)" }
7756
7770
  }
7757
7771
  )
@@ -7794,8 +7808,8 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7794
7808
  ]
7795
7809
  }
7796
7810
  ),
7797
- t.length > 0 && !x && /* @__PURE__ */ e("div", { className: "px-4 pb-2 flex flex-col gap-2", children: t.map(u) }),
7798
- t.length === 0 && !x && /* @__PURE__ */ e("div", { className: "px-4 pb-2", children: /* @__PURE__ */ e(
7811
+ t.length > 0 && !b && /* @__PURE__ */ e("div", { className: "px-4 pb-2 flex flex-col gap-2", children: t.map(u) }),
7812
+ t.length === 0 && !b && /* @__PURE__ */ e("div", { className: "px-4 pb-2", children: /* @__PURE__ */ e(
7799
7813
  "div",
7800
7814
  {
7801
7815
  className: "text-xs p-2 rounded-md text-center",
@@ -7878,7 +7892,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7878
7892
  onDashboardFiltersChange: m,
7879
7893
  onSaveFilters: c,
7880
7894
  selectedFilterId: f,
7881
- onFilterSelect: x,
7895
+ onFilterSelect: b,
7882
7896
  isEditMode: l = !1
7883
7897
  }) => {
7884
7898
  const [u, d] = q(null), [p, i] = q(!1), N = J((h) => h ? {
@@ -7973,7 +7987,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7973
7987
  (k) => k.id === h ? v : k
7974
7988
  );
7975
7989
  m(y);
7976
- }, [t, m]), b = J((h) => n ? n.cubes.some(
7990
+ }, [t, m]), x = J((h) => n ? n.cubes.some(
7977
7991
  (v) => v.dimensions.some((y) => y.name === h && y.type === "time")
7978
7992
  ) : !1, [n]);
7979
7993
  return !s || !l && t.length === 0 ? null : /* @__PURE__ */ r(
@@ -7995,7 +8009,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
7995
8009
  onEditFilter: I,
7996
8010
  onRemoveFilter: F,
7997
8011
  selectedFilterId: f,
7998
- onFilterSelect: x
8012
+ onFilterSelect: b
7999
8013
  }
8000
8014
  ) : (
8001
8015
  /* View Mode - Read-only interactive filters */
@@ -8007,7 +8021,7 @@ const zs = M("close"), Js = M("eye"), Hs = M("eyeOff"), Gs = ({
8007
8021
  onFilterChange: a,
8008
8022
  onDateRangeChange: O,
8009
8023
  convertToMetaResponse: N,
8010
- isTimeDimensionField: b
8024
+ isTimeDimensionField: x
8011
8025
  }
8012
8026
  )
8013
8027
  ),
@@ -8033,13 +8047,13 @@ function sn({
8033
8047
  designWidth: s,
8034
8048
  children: n
8035
8049
  }) {
8036
- const [o, m] = q(0), c = xe(null);
8050
+ const [o, m] = q(0), c = be(null);
8037
8051
  oe(() => {
8038
8052
  if (!c.current) return;
8039
- const x = new ResizeObserver((l) => {
8053
+ const b = new ResizeObserver((l) => {
8040
8054
  m(l[0]?.contentRect.height ?? 0);
8041
8055
  });
8042
- return x.observe(c.current), m(c.current.offsetHeight || 0), () => x.disconnect();
8056
+ return b.observe(c.current), m(c.current.offsetHeight || 0), () => b.disconnect();
8043
8057
  }, []);
8044
8058
  const f = o * t;
8045
8059
  return /* @__PURE__ */ e(
@@ -8086,8 +8100,8 @@ function ln({
8086
8100
  dashboardFilters: n,
8087
8101
  onPortletRefresh: o
8088
8102
  }) {
8089
- const m = xe({}), [c, f] = q(null), x = xe(null), l = J((p) => {
8090
- x.current = p, p && f(an(p));
8103
+ const m = be({}), [c, f] = q(null), b = be(null), l = J((p) => {
8104
+ b.current = p, p && f(an(p));
8091
8105
  }, []), u = De(() => [...t.portlets].sort((p, i) => p.y !== i.y ? p.y - i.y : p.x - i.x), [t.portlets]), d = (p) => {
8092
8106
  m.current[p]?.refresh(), o?.(p);
8093
8107
  };
@@ -8167,7 +8181,7 @@ function fn({
8167
8181
  onConfigChange: m,
8168
8182
  onPortletRefresh: c,
8169
8183
  onSave: f,
8170
- colorPalette: x,
8184
+ colorPalette: b,
8171
8185
  schema: l,
8172
8186
  onDashboardFiltersChange: u
8173
8187
  }) {
@@ -8178,13 +8192,13 @@ function fn({
8178
8192
  scaleFactor: N,
8179
8193
  isEditable: g,
8180
8194
  designWidth: w
8181
- } = cr(), [C, I] = q(null), F = xe(null);
8195
+ } = cr(), [C, I] = q(null), F = be(null);
8182
8196
  oe(() => {
8183
8197
  F.current && I(qt(F.current));
8184
8198
  }, []);
8185
8199
  const V = J((D) => {
8186
8200
  F.current = D, d(D), D && I(qt(D));
8187
- }, [d]), E = i === "desktop" ? p : w, O = xe({}), a = xe({}), [b, h] = q(!1), [v, y] = q([]), [k, z] = q(!1), [L, T] = q(null);
8201
+ }, [d]), E = i === "desktop" ? p : w, O = be({}), a = be({}), [x, h] = q(!1), [v, y] = q([]), [k, z] = q(!1), [L, T] = q(null);
8188
8202
  oe(() => {
8189
8203
  (!k || !g) && L && T(null);
8190
8204
  }, [k, g, L]), oe(() => {
@@ -8221,16 +8235,16 @@ function fn({
8221
8235
  };
8222
8236
  }, [L]);
8223
8237
  const U = J((D) => {
8224
- if (!b || v.length === 0) return !1;
8238
+ if (!x || v.length === 0) return !1;
8225
8239
  for (const K of D) {
8226
8240
  const re = v.find((j) => j.i === K.i);
8227
8241
  if (re && (re.x !== K.x || re.y !== K.y || re.w !== K.w || re.h !== K.h))
8228
8242
  return !0;
8229
8243
  }
8230
8244
  return !1;
8231
- }, [b, v]), se = J((D) => {
8245
+ }, [x, v]), se = J((D) => {
8232
8246
  }, []), ne = J(async (D, K, re, j, A, P) => {
8233
- if (!s || !k || !f || !b) return;
8247
+ if (!s || !k || !f || !x) return;
8234
8248
  const _ = [...D];
8235
8249
  if (!U(_))
8236
8250
  return;
@@ -8258,8 +8272,8 @@ function fn({
8258
8272
  } catch (Ce) {
8259
8273
  console.error("Auto-save failed after drag:", Ce);
8260
8274
  }
8261
- }, [t.portlets, t.layouts, s, k, m, f, b, U]), S = J(async (D, K, re, j, A, P) => {
8262
- if (!s || !k || !m || !b) return;
8275
+ }, [t.portlets, t.layouts, s, k, m, f, x, U]), S = J(async (D, K, re, j, A, P) => {
8276
+ if (!s || !k || !m || !x) return;
8263
8277
  const _ = [...D];
8264
8278
  if (!U(_))
8265
8279
  return;
@@ -8287,7 +8301,7 @@ function fn({
8287
8301
  } catch (Ce) {
8288
8302
  console.error("Auto-save failed after resize:", Ce);
8289
8303
  }
8290
- }, [t.portlets, t.layouts, s, k, m, f, b, U]), W = J((D) => {
8304
+ }, [t.portlets, t.layouts, s, k, m, f, x, U]), W = J((D) => {
8291
8305
  const K = a.current[D];
8292
8306
  K && K.refresh && K.refresh(), c && c(D);
8293
8307
  }, [c]), X = J(() => {
@@ -8393,7 +8407,7 @@ function fn({
8393
8407
  }, 300);
8394
8408
  }, 200);
8395
8409
  }, 200);
8396
- }, [t, m, f]), be = J(async (D) => {
8410
+ }, [t, m, f]), xe = J(async (D) => {
8397
8411
  if (!m) return;
8398
8412
  const K = {
8399
8413
  ...t,
@@ -8499,7 +8513,7 @@ function fn({
8499
8513
  portlet: ie,
8500
8514
  title: ie ? "Edit Portlet" : "Add New Portlet",
8501
8515
  submitText: ie ? "Update Portlet" : "Add Portlet",
8502
- colorPalette: x
8516
+ colorPalette: b
8503
8517
  }
8504
8518
  )
8505
8519
  ] });
@@ -8548,7 +8562,7 @@ function fn({
8548
8562
  }
8549
8563
  )
8550
8564
  },
8551
- compactor: br,
8565
+ compactor: xr,
8552
8566
  children: t.portlets.map((D) => {
8553
8567
  const K = L ? (D.dashboardFilterMapping || []).includes(L) : !1, re = !!L;
8554
8568
  return /* @__PURE__ */ r(
@@ -8698,7 +8712,7 @@ function fn({
8698
8712
  eagerLoad: D.eagerLoad ?? t.eagerLoad ?? !1,
8699
8713
  title: D.title,
8700
8714
  height: "100%",
8701
- colorPalette: x,
8715
+ colorPalette: b,
8702
8716
  loadingComponent: o,
8703
8717
  onDebugDataReady: (j) => {
8704
8718
  B((A) => ({
@@ -8752,7 +8766,7 @@ function fn({
8752
8766
  Us,
8753
8767
  {
8754
8768
  currentPalette: t.colorPalette,
8755
- onPaletteChange: be,
8769
+ onPaletteChange: xe,
8756
8770
  className: "shrink-0"
8757
8771
  }
8758
8772
  ),
@@ -8853,7 +8867,7 @@ function fn({
8853
8867
  ln,
8854
8868
  {
8855
8869
  config: t,
8856
- colorPalette: x,
8870
+ colorPalette: b,
8857
8871
  dashboardFilters: n,
8858
8872
  onPortletRefresh: W
8859
8873
  }
@@ -8869,7 +8883,7 @@ function fn({
8869
8883
  portlet: ie,
8870
8884
  title: ie ? "Edit Portlet" : "Add New Portlet",
8871
8885
  submitText: ie ? "Update Portlet" : "Add Portlet",
8872
- colorPalette: x
8886
+ colorPalette: b
8873
8887
  }
8874
8888
  ),
8875
8889
  /* @__PURE__ */ e(
@@ -8896,7 +8910,7 @@ function Pn({
8896
8910
  onSave: c,
8897
8911
  onDirtyStateChange: f
8898
8912
  }) {
8899
- const { meta: x } = Ye(), l = xe(t), u = xe(!1), d = De(() => {
8913
+ const { meta: b } = Ye(), l = be(t), u = be(!1), d = De(() => {
8900
8914
  const w = t.filters || [], C = n || [];
8901
8915
  if (C.length === 0)
8902
8916
  return w;
@@ -8948,7 +8962,7 @@ function Pn({
8948
8962
  onConfigChange: i,
8949
8963
  onSave: p,
8950
8964
  colorPalette: g,
8951
- schema: x,
8965
+ schema: b,
8952
8966
  onDashboardFiltersChange: N
8953
8967
  }
8954
8968
  ) });
@@ -9001,8 +9015,8 @@ function Vn({
9001
9015
  onClick: () => o?.(t.id),
9002
9016
  className: "p-1.5 rounded-sm text-dc-danger",
9003
9017
  style: { backgroundColor: "transparent" },
9004
- onMouseEnter: (x) => x.currentTarget.style.backgroundColor = "var(--dc-danger-bg)",
9005
- onMouseLeave: (x) => x.currentTarget.style.backgroundColor = "transparent",
9018
+ onMouseEnter: (b) => b.currentTarget.style.backgroundColor = "var(--dc-danger-bg)",
9019
+ onMouseLeave: (b) => b.currentTarget.style.backgroundColor = "transparent",
9006
9020
  title: "Delete",
9007
9021
  children: /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) })
9008
9022
  }
@@ -9018,8 +9032,8 @@ function Vn({
9018
9032
  displayConfig: t.displayConfig,
9019
9033
  title: t.title,
9020
9034
  height: "100%",
9021
- onDebugDataReady: (x) => {
9022
- f(x);
9035
+ onDebugDataReady: (b) => {
9036
+ f(b);
9023
9037
  }
9024
9038
  }
9025
9039
  ) })
@@ -9034,16 +9048,16 @@ function qn({
9034
9048
  initialName: c = "",
9035
9049
  initialDescription: f = ""
9036
9050
  }) {
9037
- const [x, l] = q(""), [u, d] = q(""), [p, i] = q(!1);
9051
+ const [b, l] = q(""), [u, d] = q(""), [p, i] = q(!1);
9038
9052
  oe(() => {
9039
9053
  t && (l(c), d(f));
9040
9054
  }, [t, c, f]);
9041
9055
  const N = async (C) => {
9042
- if (C.preventDefault(), !!x.trim()) {
9056
+ if (C.preventDefault(), !!b.trim()) {
9043
9057
  i(!0);
9044
9058
  try {
9045
9059
  await n({
9046
- name: x.trim(),
9060
+ name: b.trim(),
9047
9061
  description: u.trim() || void 0
9048
9062
  }), g();
9049
9063
  } catch {
@@ -9069,7 +9083,7 @@ function qn({
9069
9083
  {
9070
9084
  type: "submit",
9071
9085
  form: "dashboard-form",
9072
- disabled: p || !x.trim(),
9086
+ disabled: p || !b.trim(),
9073
9087
  className: "px-4 py-2 text-sm font-medium text-white bg-dc-primary border border-transparent rounded-md hover:bg-dc-primary-hover disabled:opacity-50 disabled:cursor-not-allowed",
9074
9088
  children: p ? "Saving..." : m
9075
9089
  }
@@ -9091,7 +9105,7 @@ function qn({
9091
9105
  {
9092
9106
  type: "text",
9093
9107
  id: "dashboard-name",
9094
- value: x,
9108
+ value: b,
9095
9109
  onChange: (C) => l(C.target.value),
9096
9110
  className: "w-full px-3 py-2 border border-dc-border rounded-md bg-dc-surface text-dc-text focus:outline-none focus:ring-2 focus:ring-dc-primary focus:border-dc-primary",
9097
9111
  placeholder: "Enter dashboard name...",