react-semaphor 0.0.357 → 0.0.358

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,6 +1,6 @@
1
- import { c as H, u as vs, v as D, w as is, x as Ne, y as e, z as Cs, A as Ns, H as M, o as Ss, J as ws, K as ks, M as zs, N as Os, O as $, Q as ie, R as ta, V as na, W as la, Y as ra, Z as st, _ as at, $ as tt, a0 as Gs, a1 as W, a2 as Be, i as nt, a3 as u, a4 as lt, a5 as rt, P as ia, F as oa, a6 as Ue, a7 as Ge, a8 as Ms, a9 as ca, aa as Ds, ab as ue, ac as he, ad as me, ae as xe, af as ye, ag as pe, ah as Z, T as Is, ai as Ts, aj as Fs, ak as Ls, al as da, am as ua, an as ce, ao as it, ap as ot, aq as ha, ar as ct, C as dt, as as ut, at as ma, B as ht, au as fe, av as mt, aw as Ke, ax as xa, ay as gs, az as je, aA as ze, aB as ve, aC as pa, aD as xt, aE as pt, aF as ft, aG as gt, l as jt, aH as bt, aI as yt, aJ as Me, aK as ae, aL as fa, aM as vt, aN as os, aO as Ct, aP as Nt, aQ as js, a as St, aR as ss, aS as be, aT as as, aU as wt, aV as kt, aW as zt, aX as Ot, aY as fs, aZ as Mt, a_ as Ks, a$ as Dt, b0 as Qs, b1 as It, b2 as Tt, b3 as Ft, b4 as Lt, b5 as ga, b6 as Et, b7 as Es, b8 as ja, b9 as Vt, ba as At, bb as Xe, bc as qt, bd as Rt, be as ba, bf as _t, s as Ht, bg as $t, bh as Pt, r as Bt, bi as cs, bj as ya, bk as va, bl as Ca, bm as Ze, bn as Na, bo as es, bp as Js, bq as Ut, br as Gt, bs as ds, bt as us, bu as hs, bv as Kt, I as Qt, X as Sa, bw as Jt, bx as Wt, by as Yt, E as Xt, bz as ms, bA as Oe, f as Zt, bB as $e, bC as Vs, bD as wa, bE as en, bF as sn, bG as ts, bH as an, bI as tn, bJ as nn, bK as Ws, bL as ka, bM as ln, bN as rn, bO as on, bP as cn, bQ as dn, bR as un, bS as hn, bT as De, bU as K, bV as Q, bW as As, bX as J, bY as mn, bZ as za, b_ as xn, b$ as pn, c0 as fn, c1 as gn, c2 as jn, c3 as bn, c4 as yn, c5 as vn, c6 as Cn } from "./index-DeRfYbqz.js";
1
+ import { c as H, u as Cs, v as T, w as os, x as Se, y as e, z as Ns, A as Ss, H as I, o as ws, J as ks, K as zs, M as Os, N as Ms, O as $, Q as ie, R as ta, V as na, W as la, Y as ra, Z as et, _ as st, $ as at, a0 as Ks, a1 as W, a2 as Ue, i as tt, a3 as d, a4 as nt, a5 as lt, P as ia, F as oa, a6 as Ge, a7 as Ke, a8 as Ds, a9 as ca, aa as Is, ab as ue, ac as he, ad as me, ae as xe, af as ve, ag as pe, ah as Z, T as Ts, ai as Fs, aj as Ls, ak as Es, al as da, am as ua, an as ce, ao as rt, ap as it, aq as ha, ar as ot, C as ct, as as dt, at as ma, B as ut, au as fe, av as ht, aw as Qe, ax as xa, ay as js, az as be, aA as Oe, aB as Ce, aC as pa, aD as mt, aE as xt, aF as pt, aG as ft, l as gt, aH as jt, aI as bt, aJ as De, aK as ae, aL as fa, aM as yt, aN as cs, aO as vt, aP as Ct, aQ as bs, a as Nt, aR as as, aS as ye, aT as ts, aU as St, aV as wt, aW as kt, aX as zt, aY as gs, aZ as Ot, a_ as Qs, a$ as Mt, b0 as Js, b1 as Dt, b2 as It, b3 as Tt, b4 as Ft, b5 as ga, b6 as Lt, b7 as Vs, b8 as ja, b9 as Et, ba as Vt, bb as Ze, bc as At, bd as qt, be as ba, bf as Rt, s as _t, bg as Ht, bh as $t, r as Pt, bi as ds, bj as ya, bk as va, bl as Ca, bm as es, bn as ss, bo as je, bp as Bt, bq as Ut, br as us, bs as hs, bt as ms, bu as Gt, I as Kt, X as Na, bv as Qt, bw as Jt, bx as Wt, E as Yt, by as xs, bz as Me, f as Xt, bA as Pe, bB as As, bC as Sa, bD as Zt, bE as en, bF as ns, bG as sn, bH as an, bI as tn, bJ as Ws, bK as wa, bL as nn, bM as ln, bN as rn, bO as on, bP as cn, bQ as dn, bR as un, bS as hn, bT as Ie, bU as K, bV as Q, bW as qs, bX as J, bY as mn, bZ as ka, b_ as xn, b$ as pn, c0 as fn, c1 as gn, c2 as jn, c3 as bn, c4 as yn, c5 as vn, c6 as Cn } from "./index-l4bsL81E.js";
2
2
  import * as Ys from "react";
3
- import Ce, { useState as _, useMemo as bs, useEffect as se, useRef as ns, useCallback as Oa, Suspense as Nn } from "react";
3
+ import Ne, { useState as _, useMemo as ys, useEffect as se, useRef as ls, useCallback as za, Suspense as Nn } from "react";
4
4
  import "react-dom";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
@@ -60,7 +60,7 @@ const kn = H("ChartArea", [
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
62
  */
63
- const qs = H("ChartColumnIncreasing", [
63
+ const Rs = H("ChartColumnIncreasing", [
64
64
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
65
65
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
66
66
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
@@ -72,7 +72,7 @@ const qs = H("ChartColumnIncreasing", [
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
74
  */
75
- const Rs = H("ChartLine", [
75
+ const _s = H("ChartLine", [
76
76
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
77
77
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
78
78
  ]);
@@ -82,7 +82,7 @@ const Rs = H("ChartLine", [
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
84
  */
85
- const Ma = H("ChartNoAxesGantt", [
85
+ const Oa = H("ChartNoAxesGantt", [
86
86
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
87
87
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
88
88
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -93,7 +93,7 @@ const Ma = H("ChartNoAxesGantt", [
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
95
  */
96
- const Da = H("ChartPie", [
96
+ const Ma = H("ChartPie", [
97
97
  [
98
98
  "path",
99
99
  {
@@ -109,7 +109,7 @@ const Da = H("ChartPie", [
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
111
  */
112
- const Ia = H("ChartScatter", [
112
+ const Da = H("ChartScatter", [
113
113
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
114
114
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
115
115
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -157,7 +157,7 @@ const Mn = H("Database", [
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
159
  */
160
- const Ta = H("EllipsisVertical", [
160
+ const Ia = H("EllipsisVertical", [
161
161
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
162
162
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
163
163
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
@@ -306,7 +306,7 @@ const Rn = H("ListX", [
306
306
  * This source code is licensed under the ISC license.
307
307
  * See the LICENSE file in the root directory of this source tree.
308
308
  */
309
- const Ae = H("LoaderCircle", [
309
+ const qe = H("LoaderCircle", [
310
310
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
311
311
  ]);
312
312
  /**
@@ -315,7 +315,7 @@ const Ae = H("LoaderCircle", [
315
315
  * This source code is licensed under the ISC license.
316
316
  * See the LICENSE file in the root directory of this source tree.
317
317
  */
318
- const Fa = H("Map", [
318
+ const Ta = H("Map", [
319
319
  [
320
320
  "path",
321
321
  {
@@ -396,7 +396,7 @@ const Bn = H("Save", [
396
396
  * This source code is licensed under the ISC license.
397
397
  * See the LICENSE file in the root directory of this source tree.
398
398
  */
399
- const La = H("Shapes", [
399
+ const Fa = H("Shapes", [
400
400
  [
401
401
  "path",
402
402
  {
@@ -506,7 +506,7 @@ const Wn = H("ToggleLeft", [
506
506
  * This source code is licensed under the ISC license.
507
507
  * See the LICENSE file in the root directory of this source tree.
508
508
  */
509
- const _s = H("Type", [
509
+ const Hs = H("Type", [
510
510
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
511
511
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
512
512
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -521,7 +521,7 @@ const Yn = H("User", [
521
521
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
522
522
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
523
523
  ]);
524
- function Ea(s) {
524
+ function La(s) {
525
525
  var n;
526
526
  return {
527
527
  ...s,
@@ -578,18 +578,18 @@ async function el(s, n, a, t) {
578
578
  if (!t)
579
579
  return null;
580
580
  const l = JSON.stringify(n);
581
- return await vs("https://semaphor.cloud/api/v1/lens", t, {
581
+ return await Cs("https://semaphor.cloud/api/v1/lens", t, {
582
582
  name: s,
583
583
  template: l,
584
584
  filterValues: a,
585
585
  operation: "create"
586
586
  });
587
587
  }
588
- async function ys(s, n) {
588
+ async function vs(s, n) {
589
589
  if (!n)
590
590
  return null;
591
591
  const { id: a, template: t, filterValues: l, isDefault: r, shared: i } = s;
592
- return await vs("https://semaphor.cloud/api/v1/lens", n, {
592
+ return await Cs("https://semaphor.cloud/api/v1/lens", n, {
593
593
  lensId: a,
594
594
  template: t,
595
595
  filterValues: l,
@@ -599,42 +599,42 @@ async function ys(s, n) {
599
599
  });
600
600
  }
601
601
  async function sl(s, n) {
602
- return n ? await vs("https://semaphor.cloud/api/v1/lens", n, {
602
+ return n ? await Cs("https://semaphor.cloud/api/v1/lens", n, {
603
603
  operation: "delete",
604
604
  lensId: s
605
605
  }) : null;
606
606
  }
607
607
  function al() {
608
- const [s, n] = _(""), [a, t] = _(!1), l = D((p) => p.lenses), { setLenses: r, setSelectedLensId: i } = is(), [o, c] = _(!1), [h, d] = _(!1), j = D((p) => p.dashboard), f = D((p) => p.filterValues), { authToken: m } = Ne();
608
+ const [s, n] = _(""), [a, t] = _(!1), l = T((p) => p.lenses), { setLenses: r, setSelectedLensId: i } = os(), [o, c] = _(!1), [u, h] = _(!1), b = T((p) => p.dashboard), f = T((p) => p.filterValues), { authToken: m } = Se();
609
609
  async function g() {
610
610
  c(!0);
611
- const p = Ea(
612
- j
611
+ const p = La(
612
+ b
613
613
  ), N = await el(
614
614
  s,
615
615
  p,
616
616
  f,
617
617
  m == null ? void 0 : m.accessToken
618
618
  );
619
- N && (r([...l || [], N]), i(N.id), d(!1)), c(!1);
619
+ N && (r([...l || [], N]), i(N.id), h(!1)), c(!1);
620
620
  }
621
- return /* @__PURE__ */ e.jsxs(Cs, { open: h, onOpenChange: d, children: [
622
- /* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
623
- M,
621
+ return /* @__PURE__ */ e.jsxs(Ns, { open: u, onOpenChange: h, children: [
622
+ /* @__PURE__ */ e.jsx(Ss, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
623
+ I,
624
624
  {
625
625
  variant: "secondary",
626
626
  className: "h-7 p-2",
627
627
  size: "sm",
628
628
  children: [
629
- /* @__PURE__ */ e.jsx(Ss, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
629
+ /* @__PURE__ */ e.jsx(ws, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
630
630
  "Lens"
631
631
  ]
632
632
  }
633
633
  ) }),
634
- /* @__PURE__ */ e.jsxs(ws, { className: "sm:max-w-[425px]", children: [
635
- /* @__PURE__ */ e.jsxs(ks, { children: [
636
- /* @__PURE__ */ e.jsx(zs, { children: "Create Lens" }),
637
- /* @__PURE__ */ e.jsx(Os, { children: "Lenses are private by default and are only visible to you." })
634
+ /* @__PURE__ */ e.jsxs(ks, { className: "sm:max-w-[425px]", children: [
635
+ /* @__PURE__ */ e.jsxs(zs, { children: [
636
+ /* @__PURE__ */ e.jsx(Os, { children: "Create Lens" }),
637
+ /* @__PURE__ */ e.jsx(Ms, { children: "Lenses are private by default and are only visible to you." })
638
638
  ] }),
639
639
  /* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
640
640
  /* @__PURE__ */ e.jsx($, { className: "text-right", children: "Name" }),
@@ -652,7 +652,7 @@ function al() {
652
652
  ] }) }),
653
653
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
654
654
  /* @__PURE__ */ e.jsx(ta, { children: /* @__PURE__ */ e.jsx(
655
- M,
655
+ I,
656
656
  {
657
657
  size: "sm",
658
658
  variant: "outline",
@@ -666,80 +666,80 @@ function al() {
666
666
  ] });
667
667
  }
668
668
  function tl() {
669
- const [s, n] = _(!1), a = D((d) => d.lenses), t = D((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: r } = is(), { authToken: i } = Ne();
670
- async function o(d) {
671
- r(d);
669
+ const [s, n] = _(!1), a = T((h) => h.lenses), t = T((h) => h.selectedLensId), { setLenses: l, setSelectedLensId: r } = os(), { authToken: i } = Se();
670
+ async function o(h) {
671
+ r(h);
672
672
  }
673
- async function c(d) {
674
- if (await sl(d, i == null ? void 0 : i.accessToken)) {
675
- const f = a == null ? void 0 : a.filter((m) => m.id !== d);
673
+ async function c(h) {
674
+ if (await sl(h, i == null ? void 0 : i.accessToken)) {
675
+ const f = a == null ? void 0 : a.filter((m) => m.id !== h);
676
676
  l(f || []), r("original");
677
677
  }
678
678
  }
679
- async function h(d) {
680
- const j = a == null ? void 0 : a.map((g) => g.id === d.id ? {
679
+ async function u(h) {
680
+ const b = a == null ? void 0 : a.map((g) => g.id === h.id ? {
681
681
  ...g,
682
- isDefault: !d.isDefault
682
+ isDefault: !h.isDefault
683
683
  } : {
684
684
  ...g,
685
685
  isDefault: !1
686
686
  });
687
- l(j || []);
687
+ l(b || []);
688
688
  const f = {
689
- ...d,
690
- isDefault: !d.isDefault
689
+ ...h,
690
+ isDefault: !h.isDefault
691
691
  };
692
- await ys(f, i == null ? void 0 : i.accessToken);
692
+ await vs(f, i == null ? void 0 : i.accessToken);
693
693
  const m = a == null ? void 0 : a.find((g) => g.isDefault);
694
- if (m && m.id !== d.id) {
694
+ if (m && m.id !== h.id) {
695
695
  const g = {
696
696
  ...m,
697
697
  isDefault: !1
698
698
  };
699
- await ys(g, i == null ? void 0 : i.accessToken);
699
+ await vs(g, i == null ? void 0 : i.accessToken);
700
700
  }
701
701
  }
702
702
  return /* @__PURE__ */ e.jsxs(na, { open: s, onOpenChange: n, children: [
703
- /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
703
+ /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(I, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
704
704
  /* @__PURE__ */ e.jsxs(ra, { align: "end", className: "w-60", children: [
705
- /* @__PURE__ */ e.jsx(st, { className: "px-3", children: "Lenses" }),
706
- /* @__PURE__ */ e.jsx(at, {}),
705
+ /* @__PURE__ */ e.jsx(et, { className: "px-3", children: "Lenses" }),
706
+ /* @__PURE__ */ e.jsx(st, {}),
707
707
  /* @__PURE__ */ e.jsxs(
708
- tt,
708
+ at,
709
709
  {
710
710
  value: t,
711
711
  onValueChange: o,
712
712
  children: [
713
- /* @__PURE__ */ e.jsx(Gs, { value: "original", children: "Original" }),
714
- a == null ? void 0 : a.map((d) => /* @__PURE__ */ e.jsxs(
715
- Gs,
713
+ /* @__PURE__ */ e.jsx(Ks, { value: "original", children: "Original" }),
714
+ a == null ? void 0 : a.map((h) => /* @__PURE__ */ e.jsxs(
715
+ Ks,
716
716
  {
717
717
  className: "group flex justify-between gap-2",
718
- value: d.id,
718
+ value: h.id,
719
719
  children: [
720
- /* @__PURE__ */ e.jsx("p", { children: d.name }),
720
+ /* @__PURE__ */ e.jsx("p", { children: h.name }),
721
721
  /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
722
722
  /* @__PURE__ */ e.jsx(
723
723
  En,
724
724
  {
725
- onClick: (j) => {
726
- j.preventDefault(), h(d);
725
+ onClick: (b) => {
726
+ b.preventDefault(), u(h);
727
727
  },
728
728
  className: W(
729
729
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
730
730
  {
731
- invisible: !d.isDefault,
732
- "text-green-500": d.isDefault
731
+ invisible: !h.isDefault,
732
+ "text-green-500": h.isDefault
733
733
  }
734
734
  ),
735
735
  strokeWidth: 1.5
736
736
  }
737
737
  ),
738
738
  /* @__PURE__ */ e.jsx(
739
- Be,
739
+ Ue,
740
740
  {
741
- onClick: (j) => {
742
- j.preventDefault(), c(d.id);
741
+ onClick: (b) => {
742
+ b.preventDefault(), c(h.id);
743
743
  },
744
744
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
745
745
  strokeWidth: 1.5
@@ -748,7 +748,7 @@ function tl() {
748
748
  ] })
749
749
  ]
750
750
  },
751
- d.id
751
+ h.id
752
752
  ))
753
753
  ]
754
754
  }
@@ -759,30 +759,30 @@ function tl() {
759
759
  function nl({
760
760
  iconClassName: s
761
761
  }) {
762
- const [n, a] = _(!1), { authToken: t } = Ne(), l = D((o) => o.theme), r = D((o) => o.filterValues);
762
+ const [n, a] = _(!1), { authToken: t } = Se(), l = T((o) => o.theme), r = T((o) => o.filterValues);
763
763
  async function i() {
764
764
  {
765
765
  a(!0);
766
766
  const o = new URLSearchParams();
767
767
  o.set("token", (t == null ? void 0 : t.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(r));
768
- const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, d = await (await fetch(c, {
768
+ const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, h = await (await fetch(c, {
769
769
  method: "GET",
770
770
  headers: {
771
771
  Authorization: `Bearer ${t == null ? void 0 : t.accessToken}`
772
772
  }
773
- })).blob(), j = URL.createObjectURL(d);
774
- window.open(j, "_blank"), a(!1);
773
+ })).blob(), b = URL.createObjectURL(h);
774
+ window.open(b, "_blank"), a(!1);
775
775
  }
776
776
  }
777
777
  return /* @__PURE__ */ e.jsx(
778
- M,
778
+ I,
779
779
  {
780
780
  variant: "link",
781
781
  className: "group h-7 p-2",
782
782
  size: "sm",
783
783
  onClick: i,
784
- children: n ? /* @__PURE__ */ e.jsx(Ae, { className: W("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
785
- nt,
784
+ children: n ? /* @__PURE__ */ e.jsx(qe, { className: W("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
785
+ tt,
786
786
  {
787
787
  className: W("size-3.5", s),
788
788
  strokeWidth: 1.5
@@ -792,30 +792,30 @@ function nl({
792
792
  );
793
793
  }
794
794
  function ll() {
795
- const { authToken: s } = Ne();
796
- D((x) => x.theme);
797
- const n = D((x) => x.lenses), a = D((x) => x.selectedLensId), t = n == null ? void 0 : n.find((x) => x.id === a), l = D((x) => x.dashboard);
798
- D((x) => x.selectedSheetId);
799
- const r = D(
795
+ const { authToken: s } = Se();
796
+ T((x) => x.theme);
797
+ const n = T((x) => x.lenses), a = T((x) => x.selectedLensId), t = n == null ? void 0 : n.find((x) => x.id === a), l = T((x) => x.dashboard);
798
+ T((x) => x.selectedSheetId);
799
+ const r = T(
800
800
  (x) => x.isDashboardEditing
801
- ), i = u(
801
+ ), i = d(
802
802
  (x) => x.selectedConnectionId
803
- ), [o, c] = _(!1), h = D((x) => x.filterValues), d = D((x) => x.isVisualEditing), j = D((x) => x.showFilters);
804
- D(
803
+ ), [o, c] = _(!1), u = T((x) => x.filterValues), h = T((x) => x.isVisualEditing), b = T((x) => x.showFilters);
804
+ T(
805
805
  (x) => x.showDashboardJSON
806
806
  );
807
- const f = D((x) => x.onSaveFunction), m = D(
807
+ const f = T((x) => x.onSaveFunction), m = T(
808
808
  (x) => x.actions.setShowFilters
809
- ), { addFrame: g, setSelectedFrameId: p } = D(
809
+ ), { addFrame: g, setSelectedFrameId: p } = T(
810
810
  (x) => x.actions
811
- ), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON: A } = D((x) => x.actions), I = N(), { tenantId: O, endUserId: T } = bs(
812
- () => lt(s == null ? void 0 : s.accessToken),
811
+ ), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON: q } = T((x) => x.actions), F = N(), { tenantId: M, endUserId: O } = ys(
812
+ () => nt(s == null ? void 0 : s.accessToken),
813
813
  [s == null ? void 0 : s.accessToken]
814
- ), F = bs(() => O || T, [O, T]), R = () => {
815
- if (!r || !I) return;
814
+ ), D = ys(() => M || O, [M, O]), A = () => {
815
+ if (!r || !F) return;
816
816
  const x = {
817
817
  connectionId: i,
818
- id: Ue(),
818
+ id: Ge(),
819
819
  title: "Title",
820
820
  description: "Description",
821
821
  preferences: {
@@ -830,53 +830,53 @@ function ll() {
830
830
  sql: "select COUNT(*) from YOUR_TABLE",
831
831
  data: []
832
832
  }, k = {
833
- id: Ue(),
833
+ id: Ge(),
834
834
  cards: [x],
835
835
  activeCardId: x.id
836
836
  };
837
- g(I.id, k), p(k.id);
837
+ g(F.id, k), p(k.id);
838
838
  }, v = () => {
839
839
  y(!0);
840
840
  };
841
- async function b() {
841
+ async function j() {
842
842
  if (c(!0), !a || !t) return;
843
- const x = Ea(
843
+ const x = La(
844
844
  l
845
845
  ), k = JSON.stringify(x), S = {
846
846
  ...t,
847
847
  template: k,
848
- filterValues: h
848
+ filterValues: u
849
849
  };
850
- await ys(S, s == null ? void 0 : s.accessToken), Ge.success("Lens saved"), f == null || f(x), c(!1);
850
+ await vs(S, s == null ? void 0 : s.accessToken), Ke.success("Lens saved"), f == null || f(x), c(!1);
851
851
  }
852
- return d ? null : /* @__PURE__ */ e.jsxs(
852
+ return h ? null : /* @__PURE__ */ e.jsxs(
853
853
  "div",
854
854
  {
855
855
  className: "flex items-center justify-between gap-2 border-b bg-muted/50 py-2 pl-3 pr-2",
856
856
  role: "dashboard-controls",
857
857
  children: [
858
- !d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx($, { children: t == null ? void 0 : t.name }) }),
858
+ !h && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx($, { children: t == null ? void 0 : t.name }) }),
859
859
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
860
- /* @__PURE__ */ e.jsx("button", { onClick: rt, children: /* @__PURE__ */ e.jsx(Jn, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
860
+ /* @__PURE__ */ e.jsx("button", { onClick: lt, children: /* @__PURE__ */ e.jsx(Jn, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
861
861
  /* @__PURE__ */ e.jsx(nl, {}),
862
- r && !d && F && /* @__PURE__ */ e.jsx(al, {}),
863
- !d && F && /* @__PURE__ */ e.jsx(tl, {}),
864
- r && !d && /* @__PURE__ */ e.jsxs(
865
- M,
862
+ r && !h && D && /* @__PURE__ */ e.jsx(al, {}),
863
+ !h && D && /* @__PURE__ */ e.jsx(tl, {}),
864
+ r && !h && /* @__PURE__ */ e.jsxs(
865
+ I,
866
866
  {
867
867
  variant: "secondary",
868
868
  className: "h-7 p-2",
869
869
  size: "sm",
870
870
  disabled: !r,
871
- onClick: R,
871
+ onClick: A,
872
872
  children: [
873
- /* @__PURE__ */ e.jsx(Ss, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
873
+ /* @__PURE__ */ e.jsx(ws, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
874
874
  "Frame"
875
875
  ]
876
876
  }
877
877
  ),
878
878
  !r && /* @__PURE__ */ e.jsx(
879
- M,
879
+ I,
880
880
  {
881
881
  variant: "ghost",
882
882
  className: "h-7 p-2",
@@ -885,32 +885,32 @@ function ll() {
885
885
  children: /* @__PURE__ */ e.jsx(ia, { className: "h-4 w-4", strokeWidth: 1.5 })
886
886
  }
887
887
  ),
888
- r && !d && /* @__PURE__ */ e.jsx(
889
- M,
888
+ r && !h && /* @__PURE__ */ e.jsx(
889
+ I,
890
890
  {
891
891
  variant: "ghost",
892
892
  role: "close",
893
893
  className: "h-7 p-2",
894
894
  onClick: () => {
895
- y(!1), A(!1);
895
+ y(!1), q(!1);
896
896
  },
897
897
  size: "sm",
898
- children: /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4", strokeWidth: 1.5 })
898
+ children: /* @__PURE__ */ e.jsx(Ue, { className: "h-4 w-4", strokeWidth: 1.5 })
899
899
  }
900
900
  ),
901
- r && !d && F && /* @__PURE__ */ e.jsx(
902
- M,
901
+ r && !h && D && /* @__PURE__ */ e.jsx(
902
+ I,
903
903
  {
904
904
  className: "h-7 p-2",
905
905
  variant: "ghost",
906
906
  disabled: o,
907
- onClick: b,
907
+ onClick: j,
908
908
  size: "sm",
909
909
  children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", strokeWidth: 1.5 })
910
910
  }
911
911
  ),
912
- !j && !d && r && /* @__PURE__ */ e.jsx(
913
- M,
912
+ !b && !h && r && /* @__PURE__ */ e.jsx(
913
+ I,
914
914
  {
915
915
  className: "h-7 p-2",
916
916
  variant: "ghost",
@@ -919,14 +919,14 @@ function ll() {
919
919
  children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
920
920
  }
921
921
  ),
922
- !d && r && !1,
923
- !d && !1
922
+ !h && r && !1,
923
+ !h && !1
924
924
  ] })
925
925
  ]
926
926
  }
927
927
  );
928
928
  }
929
- function He({
929
+ function $e({
930
930
  title: s,
931
931
  items: n,
932
932
  value: a,
@@ -936,10 +936,10 @@ function He({
936
936
  onChange: i,
937
937
  showNone: o = !1,
938
938
  className: c,
939
- showIcon: h = !0,
940
- disabled: d = !1
939
+ showIcon: u = !0,
940
+ disabled: h = !1
941
941
  }) {
942
- const j = t ? "Loading..." : l ? "Error" : a;
942
+ const b = t ? "Loading..." : l ? "Error" : a;
943
943
  function f() {
944
944
  if (s === "Connection")
945
945
  return /* @__PURE__ */ e.jsx(Pn, { className: "size-4 rotate-90" });
@@ -948,16 +948,16 @@ function He({
948
948
  if (s === "Schema")
949
949
  return /* @__PURE__ */ e.jsx(Hn, { className: "size-4" });
950
950
  if (s === "Table")
951
- return /* @__PURE__ */ e.jsx(Is, { className: "size-4" });
951
+ return /* @__PURE__ */ e.jsx(Ts, { className: "size-4" });
952
952
  if (s === "Model")
953
953
  return /* @__PURE__ */ e.jsx(Sn, { className: "size-4" });
954
954
  }
955
955
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
956
- h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(Ms, { children: [
956
+ u && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(Ds, { children: [
957
957
  /* @__PURE__ */ e.jsx(ca, { children: f() }),
958
- /* @__PURE__ */ e.jsx(Ds, { className: "text-xs", align: "start", children: r })
958
+ /* @__PURE__ */ e.jsx(Is, { className: "text-xs", align: "start", children: r })
959
959
  ] }) : f() }),
960
- /* @__PURE__ */ e.jsxs(ue, { disabled: d, value: j, onValueChange: i, children: [
960
+ /* @__PURE__ */ e.jsxs(ue, { disabled: h, value: b, onValueChange: i, children: [
961
961
  /* @__PURE__ */ e.jsx(
962
962
  he,
963
963
  {
@@ -973,28 +973,28 @@ function He({
973
973
  )
974
974
  }
975
975
  ),
976
- /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
976
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
977
977
  t ? /* @__PURE__ */ e.jsx(pe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(pe, { children: s }),
978
978
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
979
979
  o && /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
980
980
  n && n.map((m, g) => /* @__PURE__ */ e.jsx(Z, { value: m.id, children: m.name }, g))
981
981
  ] }),
982
- (t || l) && /* @__PURE__ */ e.jsx(Z, { value: j, children: j })
982
+ (t || l) && /* @__PURE__ */ e.jsx(Z, { value: b, children: b })
983
983
  ] }) })
984
984
  ] })
985
985
  ] });
986
986
  }
987
987
  function rl({ column: s }) {
988
- const [n, a] = _(!1), t = u((m) => m.selectedTableName), l = u(
988
+ const [n, a] = _(!1), t = d((m) => m.selectedTableName), l = d(
989
989
  (m) => m.selectedSchemaName
990
- ), r = u(
990
+ ), r = d(
991
991
  (m) => m.selectedDatamodelId
992
- ), i = u((m) => m.sqlGen), { modelItems: o } = qe(), c = u((m) => m.actions.setSqlGen), h = u((m) => m.actions.setCardSql), d = u((m) => m.actions.setRunSql);
993
- function j(m, g) {
994
- var A;
995
- const p = da(m, i, g), N = (A = o == null ? void 0 : o.find(
996
- (I) => I.id === r
997
- )) == null ? void 0 : A.name;
992
+ ), i = d((m) => m.sqlGen), { modelItems: o } = Re(), c = d((m) => m.actions.setSqlGen), u = d((m) => m.actions.setCardSql), h = d((m) => m.actions.setRunSql);
993
+ function b(m, g) {
994
+ var q;
995
+ const p = da(m, i, g), N = (q = o == null ? void 0 : o.find(
996
+ (F) => F.id === r
997
+ )) == null ? void 0 : q.name;
998
998
  c(p);
999
999
  const y = ua(
1000
1000
  p,
@@ -1002,14 +1002,14 @@ function rl({ column: s }) {
1002
1002
  ce(t),
1003
1003
  N
1004
1004
  );
1005
- y && (h(y), d(!0)), a(!1);
1005
+ y && (u(y), h(!0)), a(!1);
1006
1006
  }
1007
1007
  function f() {
1008
1008
  return /* @__PURE__ */ e.jsxs("ul", { className: "text-xs", children: [
1009
1009
  /* @__PURE__ */ e.jsx(
1010
1010
  "li",
1011
1011
  {
1012
- onClick: () => j(s, "COUNT"),
1012
+ onClick: () => b(s, "COUNT"),
1013
1013
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1014
1014
  children: "Count"
1015
1015
  }
@@ -1017,7 +1017,7 @@ function rl({ column: s }) {
1017
1017
  /* @__PURE__ */ e.jsx(
1018
1018
  "li",
1019
1019
  {
1020
- onClick: () => j(s, "AVG"),
1020
+ onClick: () => b(s, "AVG"),
1021
1021
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1022
1022
  children: "Avg"
1023
1023
  }
@@ -1025,7 +1025,7 @@ function rl({ column: s }) {
1025
1025
  /* @__PURE__ */ e.jsx(
1026
1026
  "li",
1027
1027
  {
1028
- onClick: () => j(s, "SUM"),
1028
+ onClick: () => b(s, "SUM"),
1029
1029
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1030
1030
  children: "Sum"
1031
1031
  }
@@ -1033,7 +1033,7 @@ function rl({ column: s }) {
1033
1033
  /* @__PURE__ */ e.jsx(
1034
1034
  "li",
1035
1035
  {
1036
- onClick: () => j(s, "MAX"),
1036
+ onClick: () => b(s, "MAX"),
1037
1037
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1038
1038
  children: "Max"
1039
1039
  }
@@ -1041,17 +1041,17 @@ function rl({ column: s }) {
1041
1041
  /* @__PURE__ */ e.jsx(
1042
1042
  "li",
1043
1043
  {
1044
- onClick: () => j(s, "MIN"),
1044
+ onClick: () => b(s, "MIN"),
1045
1045
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1046
1046
  children: "Min"
1047
1047
  }
1048
1048
  )
1049
1049
  ] });
1050
1050
  }
1051
- return /* @__PURE__ */ e.jsxs(Ts, { openDelay: 0, open: n, onOpenChange: a, children: [
1052
- /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ta, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1051
+ return /* @__PURE__ */ e.jsxs(Fs, { openDelay: 0, open: n, onOpenChange: a, children: [
1052
+ /* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ia, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1053
1053
  /* @__PURE__ */ e.jsx(
1054
- Ls,
1054
+ Es,
1055
1055
  {
1056
1056
  align: "center",
1057
1057
  className: "w-20 rounded-md p-0 shadow-none",
@@ -1060,10 +1060,10 @@ function rl({ column: s }) {
1060
1060
  )
1061
1061
  ] });
1062
1062
  }
1063
- function Va({ column: s }) {
1064
- return /* @__PURE__ */ e.jsxs(Ms, { children: [
1065
- /* @__PURE__ */ e.jsx(it, { asChild: !0, children: ot(s.data_type) ? /* @__PURE__ */ e.jsx(_s, { className: "size-3" }) : ha(s.data_type) ? /* @__PURE__ */ e.jsx(Ln, { className: "size-3" }) : ct(s.data_type) ? /* @__PURE__ */ e.jsx(dt, { className: "size-3" }) : ut(s.data_type) ? /* @__PURE__ */ e.jsx(Wn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(wn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Un, { className: "size-3" }) }),
1066
- /* @__PURE__ */ e.jsx(Ds, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1063
+ function Ea({ column: s }) {
1064
+ return /* @__PURE__ */ e.jsxs(Ds, { children: [
1065
+ /* @__PURE__ */ e.jsx(rt, { asChild: !0, children: it(s.data_type) ? /* @__PURE__ */ e.jsx(Hs, { className: "size-3" }) : ha(s.data_type) ? /* @__PURE__ */ e.jsx(Ln, { className: "size-3" }) : ot(s.data_type) ? /* @__PURE__ */ e.jsx(ct, { className: "size-3" }) : dt(s.data_type) ? /* @__PURE__ */ e.jsx(Wn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(wn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Un, { className: "size-3" }) }),
1066
+ /* @__PURE__ */ e.jsx(Is, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1067
1067
  ] });
1068
1068
  }
1069
1069
  function il({
@@ -1072,80 +1072,80 @@ function il({
1072
1072
  columns: a,
1073
1073
  status: t
1074
1074
  }) {
1075
- const l = u((v) => v.sqlGen), r = u(
1075
+ const l = d((v) => v.sqlGen), r = d(
1076
1076
  (v) => v.selectedConnectionId
1077
- ), i = u(
1077
+ ), i = d(
1078
1078
  (v) => v.selectedDatabaseName
1079
- ), o = u(
1079
+ ), o = d(
1080
1080
  (v) => v.selectedSchemaName
1081
- ), c = u((v) => v.selectedTableName), h = u(
1081
+ ), c = d((v) => v.selectedTableName), u = d(
1082
1082
  (v) => v.selectedDatamodelId
1083
- ), d = D(
1083
+ ), h = T(
1084
1084
  (v) => v.dashboard.aiScopeTables
1085
- ), { setAIScopeTables: j } = D((v) => v.actions), f = u((v) => v.actions.setRunSql), m = u((v) => v.actions.setSqlGen), g = u(
1085
+ ), { setAIScopeTables: b } = T((v) => v.actions), f = d((v) => v.actions.setRunSql), m = d((v) => v.actions.setSqlGen), g = d(
1086
1086
  (v) => v.actions.setIsShowingVisual
1087
- ), p = u((v) => v.actions.setCardSql), { connectionType: N, modelItems: y } = qe();
1088
- function A(v) {
1087
+ ), p = d((v) => v.actions.setCardSql), { connectionType: N, modelItems: y } = Re();
1088
+ function q(v) {
1089
1089
  var S;
1090
- const b = da(v, l);
1091
- m(b);
1090
+ const j = da(v, l);
1091
+ m(j);
1092
1092
  const x = (S = y == null ? void 0 : y.find(
1093
- (q) => q.id === h
1094
- )) == null ? void 0 : S.name, k = ua(b, ce(s), ce(n), x);
1093
+ (R) => R.id === u
1094
+ )) == null ? void 0 : S.name, k = ua(j, ce(s), ce(n), x);
1095
1095
  k && (p(k), f(!0));
1096
1096
  }
1097
- function I() {
1098
- return (d == null ? void 0 : d.find(
1097
+ function F() {
1098
+ return (h == null ? void 0 : h.find(
1099
1099
  (v) => v.connectinonId === r && v.tableName === c
1100
1100
  )) !== void 0;
1101
1101
  }
1102
- function O(v) {
1102
+ function M(v) {
1103
1103
  if (v === !0 && c && r) {
1104
- const b = {
1104
+ const j = {
1105
1105
  connectinonId: r,
1106
1106
  connectionType: N,
1107
1107
  databaseName: i,
1108
1108
  schemaName: o,
1109
1109
  tableName: c
1110
- }, k = [...d || [], b].filter(
1111
- (S, q, P) => P.findIndex(
1110
+ }, k = [...h || [], j].filter(
1111
+ (S, R, P) => P.findIndex(
1112
1112
  (G) => G.connectinonId === S.connectinonId && G.tableName === S.tableName
1113
- ) === q
1113
+ ) === R
1114
1114
  );
1115
- j(k), Ge.success(`Added '${c}' to AI Scope`, {
1115
+ b(k), Ke.success(`Added '${c}' to AI Scope`, {
1116
1116
  position: "top-right",
1117
1117
  duration: 2500,
1118
1118
  richColors: !0
1119
1119
  });
1120
1120
  } else {
1121
- const b = (d || []).filter(
1121
+ const j = (h || []).filter(
1122
1122
  (x) => x.connectinonId !== r && x.tableName !== c
1123
1123
  );
1124
- j(b), Ge(`Removed '${c}' from AI Scope`, {
1124
+ b(j), Ke(`Removed '${c}' from AI Scope`, {
1125
1125
  position: "top-right",
1126
1126
  duration: 2e3,
1127
1127
  richColors: !0
1128
1128
  });
1129
1129
  }
1130
1130
  }
1131
- function T() {
1131
+ function O() {
1132
1132
  var S;
1133
1133
  let v = xa(s, n);
1134
- const b = (S = y == null ? void 0 : y.find(
1135
- (q) => q.id === h
1134
+ const j = (S = y == null ? void 0 : y.find(
1135
+ (R) => R.id === u
1136
1136
  )) == null ? void 0 : S.name;
1137
- h && h !== "none" && (v = `${gs}.${b}`);
1137
+ u && u !== "none" && (v = `${js}.${j}`);
1138
1138
  let x = v;
1139
- return ((q) => /[A-Z]/.test(q))(n) && (x = x.split(".").map((P) => `"${P}"`).join(".")), x;
1139
+ return ((R) => /[A-Z]/.test(R))(n) && (x = x.split(".").map((P) => `"${P}"`).join(".")), x;
1140
1140
  }
1141
- function F() {
1142
- const v = T();
1141
+ function D() {
1142
+ const v = O();
1143
1143
  g(!1);
1144
- const b = N === "MSSQL" ? `SELECT top 10 * FROM ${v}` : `SELECT * FROM ${v} LIMIT 10`;
1145
- p(b), f(!0);
1144
+ const j = N === "MSSQL" ? `SELECT top 10 * FROM ${v}` : `SELECT * FROM ${v} LIMIT 10`;
1145
+ p(j), f(!0);
1146
1146
  }
1147
- function R() {
1148
- const v = T();
1147
+ function A() {
1148
+ const v = O();
1149
1149
  p(`SELECT COUNT(*) as count FROM ${v}`), f(!0);
1150
1150
  }
1151
1151
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
@@ -1153,46 +1153,46 @@ function il({
1153
1153
  /* @__PURE__ */ e.jsx(
1154
1154
  ma,
1155
1155
  {
1156
- title: `${I() ? "Remove from" : "Add to"} AI Scope`,
1157
- pressed: I(),
1158
- onPressedChange: O,
1156
+ title: `${F() ? "Remove from" : "Add to"} AI Scope`,
1157
+ pressed: F(),
1158
+ onPressedChange: M,
1159
1159
  variant: "outline",
1160
1160
  className: "h-9 px-2",
1161
1161
  children: /* @__PURE__ */ e.jsx(
1162
- ht,
1162
+ ut,
1163
1163
  {
1164
1164
  className: W("size-4", {
1165
- "text-primary": I(),
1166
- "text-muted-foreground": !I()
1165
+ "text-primary": F(),
1166
+ "text-muted-foreground": !F()
1167
1167
  })
1168
1168
  }
1169
1169
  )
1170
1170
  }
1171
1171
  ),
1172
1172
  /* @__PURE__ */ e.jsxs(
1173
- M,
1173
+ I,
1174
1174
  {
1175
1175
  disabled: t !== "Success",
1176
- onClick: F,
1176
+ onClick: D,
1177
1177
  size: "sm",
1178
1178
  variant: "secondary",
1179
1179
  className: "flex",
1180
1180
  children: [
1181
- t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Kn, { className: "mr-2 size-4" }),
1181
+ t !== "Success" ? /* @__PURE__ */ e.jsx(qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Kn, { className: "mr-2 size-4" }),
1182
1182
  "Top 10"
1183
1183
  ]
1184
1184
  }
1185
1185
  ),
1186
1186
  /* @__PURE__ */ e.jsxs(
1187
- M,
1187
+ I,
1188
1188
  {
1189
1189
  disabled: t !== "Success",
1190
- onClick: R,
1190
+ onClick: A,
1191
1191
  size: "sm",
1192
1192
  variant: "secondary",
1193
1193
  className: "flex",
1194
1194
  children: [
1195
- t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
1195
+ t !== "Success" ? /* @__PURE__ */ e.jsx(qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
1196
1196
  "Count"
1197
1197
  ]
1198
1198
  }
@@ -1206,22 +1206,22 @@ function il({
1206
1206
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-1", children: a == null ? void 0 : a.map((v) => /* @__PURE__ */ e.jsxs(
1207
1207
  "div",
1208
1208
  {
1209
- onClick: () => A(v),
1209
+ onClick: () => q(v),
1210
1210
  className: W(
1211
1211
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-1 text-sm transition-colors hover:bg-muted/50",
1212
1212
  {
1213
- "border border-dashed border-muted-foreground bg-muted": mt(v, l)
1213
+ "border border-dashed border-muted-foreground bg-muted": ht(v, l)
1214
1214
  }
1215
1215
  ),
1216
1216
  children: [
1217
1217
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
1218
- /* @__PURE__ */ e.jsx(Va, { column: v }),
1218
+ /* @__PURE__ */ e.jsx(Ea, { column: v }),
1219
1219
  /* @__PURE__ */ e.jsx("span", { children: v.column_name })
1220
1220
  ] }),
1221
1221
  /* @__PURE__ */ e.jsx(
1222
1222
  "div",
1223
1223
  {
1224
- onClick: (b) => b.stopPropagation(),
1224
+ onClick: (j) => j.stopPropagation(),
1225
1225
  className: "flex items-center justify-end",
1226
1226
  children: ha(v.data_type) && /* @__PURE__ */ e.jsx(rl, { column: v })
1227
1227
  }
@@ -1230,65 +1230,65 @@ function il({
1230
1230
  },
1231
1231
  v.column_name
1232
1232
  )) }),
1233
- /* @__PURE__ */ e.jsx(Ke, { orientation: "vertical" }),
1234
- /* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
1233
+ /* @__PURE__ */ e.jsx(Qe, { orientation: "vertical" }),
1234
+ /* @__PURE__ */ e.jsx(Qe, { orientation: "horizontal" })
1235
1235
  ]
1236
1236
  }
1237
1237
  )
1238
1238
  ] });
1239
1239
  }
1240
- function qe(s, n) {
1241
- var Je, $s, Ps, Bs, Us;
1242
- let a = bs(() => [], []);
1243
- const t = Ne().authToken || s, l = u(
1240
+ function Re(s, n) {
1241
+ var We, Ps, Bs, Us, Gs;
1242
+ let a = ys(() => [], []);
1243
+ const t = Se().authToken || s, l = d(
1244
1244
  (C) => C.selectedConnectionId
1245
- ), r = u(
1245
+ ), r = d(
1246
1246
  (C) => C.selectedDatamodelId
1247
- ), i = u(
1247
+ ), i = d(
1248
1248
  (C) => C.selectedDatabaseName
1249
- ), o = u(
1249
+ ), o = d(
1250
1250
  (C) => C.selectedSchemaName
1251
- ), c = u((C) => C.selectedTableName), h = u(
1251
+ ), c = d((C) => C.selectedTableName), u = d(
1252
1252
  (C) => C.actions.setCurrentColumns
1253
- ), d = u(
1253
+ ), h = d(
1254
1254
  (C) => C.actions.setSelectedConnectionId
1255
- ), j = u(
1255
+ ), b = d(
1256
1256
  (C) => C.actions.setSelectedDatamodelId
1257
- ), f = u(
1257
+ ), f = d(
1258
1258
  (C) => C.actions.setSelectedDatabaseName
1259
- ), m = u(
1259
+ ), m = d(
1260
1260
  (C) => C.actions.setSelectedSchemaName
1261
- ), g = u(
1261
+ ), g = d(
1262
1262
  (C) => C.actions.setSelectedTableName
1263
- ), p = u((C) => C.actions.setCardSql);
1263
+ ), p = d((C) => C.actions.setCardSql);
1264
1264
  function N(C) {
1265
1265
  return l && i && o && i !== "NA" ? !0 : l && C === "API" ? !1 : !!(l && C === "S3");
1266
1266
  }
1267
1267
  function y(C) {
1268
1268
  return !!(l && i && i !== "NA" && o && c || l && (C === "S3" || C === "API") || r && r);
1269
1269
  }
1270
- function A(C) {
1270
+ function q(C) {
1271
1271
  return l && C ? !(C === "API" || C === "S3") : !1;
1272
1272
  }
1273
1273
  const {
1274
- data: I,
1275
- isLoading: O,
1276
- isError: T
1277
- } = je({
1274
+ data: F,
1275
+ isLoading: M,
1276
+ isError: O
1277
+ } = be({
1278
1278
  queryKey: ["connections"],
1279
- queryFn: () => ze(
1279
+ queryFn: () => Oe(
1280
1280
  "https://semaphor.cloud/api/v1/connections",
1281
1281
  (t == null ? void 0 : t.accessToken) || ""
1282
1282
  ),
1283
1283
  enabled: !!(t != null && t.accessToken)
1284
1284
  // Only fetch if authToken is present
1285
1285
  }), {
1286
- data: F,
1287
- isLoading: R,
1286
+ data: D,
1287
+ isLoading: A,
1288
1288
  isError: v
1289
- } = je({
1289
+ } = be({
1290
1290
  queryKey: ["models", l],
1291
- queryFn: () => ze(
1291
+ queryFn: () => Oe(
1292
1292
  "https://semaphor.cloud/api/v1/datamodels",
1293
1293
  (t == null ? void 0 : t.accessToken) || "",
1294
1294
  {
@@ -1297,24 +1297,24 @@ function qe(s, n) {
1297
1297
  ),
1298
1298
  enabled: !!(t != null && t.accessToken) && !!l
1299
1299
  // Only fetch if authToken is present
1300
- }), b = I == null ? void 0 : I.connections.find(
1300
+ }), j = F == null ? void 0 : F.connections.find(
1301
1301
  (C) => C.id === l
1302
- ), x = b == null ? void 0 : b.type, k = (b == null ? void 0 : b.type) === "API" || (b == null ? void 0 : b.type) === "S3", {
1302
+ ), x = j == null ? void 0 : j.type, k = (j == null ? void 0 : j.type) === "API" || (j == null ? void 0 : j.type) === "S3", {
1303
1303
  data: S,
1304
- isLoading: q,
1304
+ isLoading: R,
1305
1305
  isFetching: P,
1306
1306
  isError: G,
1307
1307
  refetch: ee
1308
- } = je({
1308
+ } = be({
1309
1309
  queryKey: ["databases", l],
1310
- queryFn: () => ze(
1310
+ queryFn: () => Oe(
1311
1311
  "https://semaphor.cloud/api/v1/databases",
1312
1312
  (t == null ? void 0 : t.accessToken) || "",
1313
1313
  {
1314
1314
  connection_id: l
1315
1315
  }
1316
1316
  ),
1317
- enabled: A(x)
1317
+ enabled: q(x)
1318
1318
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1319
1319
  }), {
1320
1320
  data: U,
@@ -1322,9 +1322,9 @@ function qe(s, n) {
1322
1322
  isFetching: z,
1323
1323
  isError: E,
1324
1324
  refetch: Y
1325
- } = je({
1325
+ } = be({
1326
1326
  queryKey: ["schemas", l, i],
1327
- queryFn: () => ze(
1327
+ queryFn: () => Oe(
1328
1328
  "https://semaphor.cloud/api/v1/schemas",
1329
1329
  (t == null ? void 0 : t.accessToken) || "",
1330
1330
  {
@@ -1340,14 +1340,14 @@ function qe(s, n) {
1340
1340
  isFetching: ne,
1341
1341
  isError: B,
1342
1342
  refetch: X
1343
- } = je({
1343
+ } = be({
1344
1344
  queryKey: [
1345
1345
  "tables",
1346
1346
  l,
1347
1347
  i,
1348
1348
  o
1349
1349
  ],
1350
- queryFn: () => ze(
1350
+ queryFn: () => Oe(
1351
1351
  "https://semaphor.cloud/api/v1/tables",
1352
1352
  (t == null ? void 0 : t.accessToken) || "",
1353
1353
  {
@@ -1359,10 +1359,10 @@ function qe(s, n) {
1359
1359
  enabled: N(x)
1360
1360
  }), {
1361
1361
  data: le,
1362
- isLoading: Te,
1363
- isFetching: Fe,
1364
- isError: Se
1365
- } = je({
1362
+ isLoading: Fe,
1363
+ isFetching: Le,
1364
+ isError: we
1365
+ } = be({
1366
1366
  queryKey: [
1367
1367
  "columns",
1368
1368
  l,
@@ -1371,7 +1371,7 @@ function qe(s, n) {
1371
1371
  o,
1372
1372
  c
1373
1373
  ],
1374
- queryFn: () => ze(
1374
+ queryFn: () => Oe(
1375
1375
  "https://semaphor.cloud/api/v1/columns",
1376
1376
  (t == null ? void 0 : t.accessToken) || "",
1377
1377
  {
@@ -1393,123 +1393,123 @@ function qe(s, n) {
1393
1393
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1394
1394
  });
1395
1395
  se(() => {
1396
- h(a);
1397
- }, [le, h, a]), se(() => {
1396
+ u(a);
1397
+ }, [le, u, a]), se(() => {
1398
1398
  }, [
1399
1399
  k,
1400
1400
  p,
1401
1401
  g,
1402
1402
  m,
1403
1403
  f,
1404
- b
1404
+ j
1405
1405
  ]);
1406
- const Le = (b == null ? void 0 : b.type) === "API" ? (Je = b == null ? void 0 : b.type) == null ? void 0 : Je.toLowerCase() : c || "", Ee = k ? "" : o || "";
1407
- function Ve(C) {
1406
+ const Ee = (j == null ? void 0 : j.type) === "API" ? (We = j == null ? void 0 : j.type) == null ? void 0 : We.toLowerCase() : c || "", Ve = k ? "" : o || "";
1407
+ function Ae(C) {
1408
1408
  m(C), g("");
1409
1409
  }
1410
- function we(C) {
1411
- f(C === "none" ? "" : C), m(""), g(""), C !== "none" && C !== "" && j("");
1410
+ function ke(C) {
1411
+ f(C === "none" ? "" : C), m(""), g(""), C !== "none" && C !== "" && b("");
1412
1412
  }
1413
1413
  function w(C) {
1414
- d(C);
1414
+ h(C);
1415
1415
  }
1416
1416
  function re(C) {
1417
- j(C === "none" ? "" : C), C !== "none" && C !== "" && f("");
1417
+ b(C === "none" ? "" : C), C !== "none" && C !== "" && f("");
1418
1418
  }
1419
- S && (($s = S == null ? void 0 : S.databases) == null ? void 0 : $s.length) > 0, U && ((Ps = U == null ? void 0 : U.schemas) == null ? void 0 : Ps.length) > 0, le && ((Bs = le == null ? void 0 : le.columns) == null ? void 0 : Bs.length) > 0 && (a = le.columns.map((C) => ({
1419
+ S && ((Ps = S == null ? void 0 : S.databases) == null ? void 0 : Ps.length) > 0, U && ((Bs = U == null ? void 0 : U.schemas) == null ? void 0 : Bs.length) > 0, le && ((Us = le == null ? void 0 : le.columns) == null ? void 0 : Us.length) > 0 && (a = le.columns.map((C) => ({
1420
1420
  ...C,
1421
1421
  data_type: C.data_type.toLowerCase()
1422
- }))), G && (a = []), (Se || T) && (a = []);
1423
- const ke = I == null ? void 0 : I.connections.map(
1422
+ }))), G && (a = []), (we || O) && (a = []);
1423
+ const ze = F == null ? void 0 : F.connections.map(
1424
1424
  (C) => ({
1425
1425
  id: C.id,
1426
1426
  name: C.name,
1427
1427
  type: C.type
1428
1428
  })
1429
- ), oe = (Us = F == null ? void 0 : F.datamodels) == null ? void 0 : Us.map((C) => ({
1429
+ ), oe = (Gs = D == null ? void 0 : D.datamodels) == null ? void 0 : Gs.map((C) => ({
1430
1430
  id: C.id,
1431
1431
  name: C.name
1432
- })), _e = S == null ? void 0 : S.databases.map((C) => ({
1432
+ })), He = S == null ? void 0 : S.databases.map((C) => ({
1433
1433
  id: C.database_name,
1434
1434
  name: C.database_name
1435
- })), ps = U == null ? void 0 : U.schemas.map((C) => ({
1435
+ })), fs = U == null ? void 0 : U.schemas.map((C) => ({
1436
1436
  id: C.schema_name,
1437
1437
  name: C.schema_name
1438
- })), Qe = V == null ? void 0 : V.tables.map((C) => ({
1438
+ })), Je = V == null ? void 0 : V.tables.map((C) => ({
1439
1439
  id: C.table_name,
1440
1440
  name: C.table_name
1441
1441
  }));
1442
1442
  return {
1443
- connectionItems: ke,
1444
- isConnectionsLoading: O,
1445
- isConnectionsError: T,
1443
+ connectionItems: ze,
1444
+ isConnectionsLoading: M,
1445
+ isConnectionsError: O,
1446
1446
  modelItems: oe,
1447
- isModelsLoading: R,
1447
+ isModelsLoading: A,
1448
1448
  isModelsError: v,
1449
- databaseItems: _e,
1450
- isDatabasesLoadingOrFetching: q || P,
1449
+ databaseItems: He,
1450
+ isDatabasesLoadingOrFetching: R || P,
1451
1451
  isDatabaseError: G,
1452
- schemaItems: ps,
1452
+ schemaItems: fs,
1453
1453
  isSchemaLoadingOrFetching: te || z,
1454
1454
  isSchemaError: E,
1455
- tableItems: Qe,
1455
+ tableItems: Je,
1456
1456
  isTableLoadingOrFetching: L || ne,
1457
1457
  isTableError: B,
1458
1458
  columns: a,
1459
- isColumnsLoadingOrFetching: Te || Fe,
1460
- isColumnsError: Se,
1459
+ isColumnsLoadingOrFetching: Fe || Le,
1460
+ isColumnsError: we,
1461
1461
  isNonDbConnection: k,
1462
1462
  connectionType: x,
1463
- tableName: Le,
1464
- schemaName: Ee,
1463
+ tableName: Ee,
1464
+ schemaName: Ve,
1465
1465
  handleConnectionChange: w,
1466
1466
  handleDatamodelChange: re,
1467
- handleDatabaseChange: we,
1468
- handleSchemaChange: Ve
1467
+ handleDatabaseChange: ke,
1468
+ handleSchemaChange: Ae
1469
1469
  };
1470
1470
  }
1471
- function Aa({
1471
+ function Va({
1472
1472
  ColumnsComponent: s
1473
1473
  }) {
1474
1474
  var ne;
1475
- const n = u(
1475
+ const n = d(
1476
1476
  (B) => B.selectedConnectionId
1477
- ), a = u(
1477
+ ), a = d(
1478
1478
  (B) => B.selectedDatamodelId
1479
- ), t = u(
1479
+ ), t = d(
1480
1480
  (B) => B.selectedDatabaseName
1481
- ), l = u(
1481
+ ), l = d(
1482
1482
  (B) => B.selectedSchemaName
1483
- ), r = u((B) => B.selectedTableName), i = u(
1483
+ ), r = d((B) => B.selectedTableName), i = d(
1484
1484
  (B) => B.actions.setSelectedTableName
1485
1485
  ), {
1486
1486
  connectionItems: o,
1487
1487
  modelItems: c,
1488
- schemaItems: h,
1489
- databaseItems: d,
1490
- tableItems: j,
1488
+ schemaItems: u,
1489
+ databaseItems: h,
1490
+ tableItems: b,
1491
1491
  columns: f,
1492
1492
  isConnectionsLoading: m,
1493
1493
  isModelsLoading: g,
1494
1494
  isConnectionsError: p,
1495
1495
  isModelsError: N,
1496
1496
  isDatabasesLoadingOrFetching: y,
1497
- isDatabaseError: A,
1498
- isSchemaLoadingOrFetching: I,
1499
- isSchemaError: O,
1500
- isColumnsError: T,
1501
- isColumnsLoadingOrFetching: F,
1502
- isTableLoadingOrFetching: R,
1497
+ isDatabaseError: q,
1498
+ isSchemaLoadingOrFetching: F,
1499
+ isSchemaError: M,
1500
+ isColumnsError: O,
1501
+ isColumnsLoadingOrFetching: D,
1502
+ isTableLoadingOrFetching: A,
1503
1503
  isTableError: v,
1504
- connectionType: b,
1504
+ connectionType: j,
1505
1505
  isNonDbConnection: x,
1506
1506
  handleConnectionChange: k,
1507
1507
  handleDatabaseChange: S,
1508
- handleSchemaChange: q,
1508
+ handleSchemaChange: R,
1509
1509
  handleDatamodelChange: P,
1510
1510
  tableName: G,
1511
1511
  schemaName: ee
1512
- } = qe();
1512
+ } = Re();
1513
1513
  function U() {
1514
1514
  return s ? s(ee, G, f) : /* @__PURE__ */ e.jsx(
1515
1515
  il,
@@ -1517,7 +1517,7 @@ function Aa({
1517
1517
  schemaName: ee,
1518
1518
  tableName: G,
1519
1519
  columns: f,
1520
- status: F ? "Loading..." : T ? "Error" : "Success"
1520
+ status: D ? "Loading..." : O ? "Error" : "Success"
1521
1521
  }
1522
1522
  );
1523
1523
  }
@@ -1525,16 +1525,16 @@ function Aa({
1525
1525
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1526
1526
  }
1527
1527
  function z() {
1528
- if (!n || b === "S3" || b === "API") return null;
1528
+ if (!n || j === "S3" || j === "API") return null;
1529
1529
  if (!a || a === "none")
1530
1530
  return /* @__PURE__ */ e.jsx(
1531
- He,
1531
+ $e,
1532
1532
  {
1533
1533
  showNone: !0,
1534
1534
  onChange: S,
1535
- isError: A,
1535
+ isError: q,
1536
1536
  isLoading: y,
1537
- items: d,
1537
+ items: h,
1538
1538
  value: t || "",
1539
1539
  title: "Database"
1540
1540
  }
@@ -1543,16 +1543,16 @@ function Aa({
1543
1543
  function E() {
1544
1544
  if (n && !x && (!t || t === "none") && (!a || a === "none"))
1545
1545
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1546
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ve, {}) }),
1546
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ce, {}) }),
1547
1547
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx($, { children: "OR" }) }),
1548
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ve, {}) })
1548
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ce, {}) })
1549
1549
  ] });
1550
1550
  }
1551
1551
  function Y() {
1552
- if (!n || b === "S3" || b === "API") return null;
1552
+ if (!n || j === "S3" || j === "API") return null;
1553
1553
  if (!t || t === "none")
1554
1554
  return /* @__PURE__ */ e.jsx(
1555
- He,
1555
+ $e,
1556
1556
  {
1557
1557
  showNone: !0,
1558
1558
  onChange: P,
@@ -1565,13 +1565,13 @@ function Aa({
1565
1565
  );
1566
1566
  }
1567
1567
  function V() {
1568
- return !n || b === "S3" || b === "API" || !t || t === "none" ? null : /* @__PURE__ */ e.jsx(
1569
- He,
1568
+ return !n || j === "S3" || j === "API" || !t || t === "none" ? null : /* @__PURE__ */ e.jsx(
1569
+ $e,
1570
1570
  {
1571
- onChange: q,
1572
- isError: O,
1573
- isLoading: I,
1574
- items: h,
1571
+ onChange: R,
1572
+ isError: M,
1573
+ isLoading: F,
1574
+ items: u,
1575
1575
  value: l || "",
1576
1576
  title: "Schema"
1577
1577
  }
@@ -1580,15 +1580,15 @@ function Aa({
1580
1580
  function L() {
1581
1581
  function B() {
1582
1582
  let X = !1;
1583
- return b === "API" ? (X = !1, X) : ((b === "S3" || n && t && t !== "none" && l) && (X = !0), X);
1583
+ return j === "API" ? (X = !1, X) : ((j === "S3" || n && t && t !== "none" && l) && (X = !0), X);
1584
1584
  }
1585
1585
  return B() ? /* @__PURE__ */ e.jsx(
1586
- He,
1586
+ $e,
1587
1587
  {
1588
1588
  onChange: i,
1589
1589
  isError: v,
1590
- items: j,
1591
- isLoading: R,
1590
+ items: b,
1591
+ isLoading: A,
1592
1592
  value: r || "",
1593
1593
  title: "Table"
1594
1594
  }
@@ -1597,7 +1597,7 @@ function Aa({
1597
1597
  return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
1598
1598
  /* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
1599
1599
  /* @__PURE__ */ e.jsx(
1600
- He,
1600
+ $e,
1601
1601
  {
1602
1602
  items: o,
1603
1603
  title: "Connection",
@@ -1618,7 +1618,7 @@ function Aa({
1618
1618
  ] }),
1619
1619
  U(),
1620
1620
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1621
- M,
1621
+ I,
1622
1622
  {
1623
1623
  onClick: te,
1624
1624
  size: "sm",
@@ -1654,17 +1654,17 @@ function cl({
1654
1654
  setUserInputforAI: a,
1655
1655
  setTriggerAIRun: t
1656
1656
  }) {
1657
- return /* @__PURE__ */ e.jsxs(Ts, { openDelay: 0, children: [
1658
- /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4 text-red-500" }) }) }),
1657
+ return /* @__PURE__ */ e.jsxs(Fs, { openDelay: 0, children: [
1658
+ /* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(I, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(zn, { className: "h-4 w-4 text-red-500" }) }) }),
1659
1659
  /* @__PURE__ */ e.jsx(
1660
- Ls,
1660
+ Es,
1661
1661
  {
1662
1662
  align: "start",
1663
1663
  className: "w-full min-w-fit max-w-[700px]",
1664
1664
  children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
1665
1665
  /* @__PURE__ */ e.jsx(fe, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
1666
1666
  /* @__PURE__ */ e.jsxs(
1667
- M,
1667
+ I,
1668
1668
  {
1669
1669
  onClick: () => {
1670
1670
  n(!0), a(s), t(!0);
@@ -1737,21 +1737,21 @@ function ul({
1737
1737
  triggerAIRun: l,
1738
1738
  setTriggerAIRun: r
1739
1739
  }) {
1740
- const i = ns(null), o = ns(null), { authToken: c } = Ne(), [h, d] = _(!1), j = u((z) => z.actions.setCardSql), f = D((z) => z.dashboard.baseQueries), m = u((z) => z.actions.setRunSql), g = u((z) => z.actions.setCardType), [p, N] = _([]), y = u((z) => z.currentColumns), A = u((z) => z.card.sql), I = u((z) => z.selectedTableName), O = `
1740
+ const i = ls(null), o = ls(null), { authToken: c } = Se(), [u, h] = _(!1), b = d((z) => z.actions.setCardSql), f = T((z) => z.dashboard.baseQueries), m = d((z) => z.actions.setRunSql), g = d((z) => z.actions.setCardType), [p, N] = _([]), y = d((z) => z.currentColumns), q = d((z) => z.card.sql), F = d((z) => z.selectedTableName), M = `
1741
1741
  ${a}
1742
1742
 
1743
- Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
1744
- Table Name: ${I}
1743
+ Database Query Dialect: ${F === "api" || F === "s3" ? "DuckDb" : ""}
1744
+ Table Name: ${F}
1745
1745
  Table Columns: ${y == null ? void 0 : y.map((z) => `${z.column_name} | ${z.data_type}`).join(", ")}
1746
- User SQL: ${A}
1747
- ${f && `Base Queries: ${JSON.stringify(f)} `}`, T = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1748
- Visual Query Syntax: ${dl}`, { data: F, isLoading: R, isFetching: v, isError: b, refetch: x } = je({
1746
+ User SQL: ${q}
1747
+ ${f && `Base Queries: ${JSON.stringify(f)} `}`, O = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1748
+ Visual Query Syntax: ${dl}`, { data: D, isLoading: A, isFetching: v, isError: j, refetch: x } = be({
1749
1749
  queryKey: ["ai-query"],
1750
- queryFn: () => ze(
1750
+ queryFn: () => Oe(
1751
1751
  "https://semaphor.cloud/api/v1/ai",
1752
1752
  (c == null ? void 0 : c.accessToken) || "",
1753
1753
  {
1754
- user_content: `userContent: ${O} ${h ? T : ""}`
1754
+ user_content: `userContent: ${M} ${u ? O : ""}`
1755
1755
  }
1756
1756
  ),
1757
1757
  enabled: !1
@@ -1779,8 +1779,8 @@ function ul({
1779
1779
  return !0;
1780
1780
  }
1781
1781
  se(() => {
1782
- F && N((z) => [...z, { role: "ai", content: F.response }]);
1783
- }, [F]), se(() => {
1782
+ D && N((z) => [...z, { role: "ai", content: D.response }]);
1783
+ }, [D]), se(() => {
1784
1784
  const z = setTimeout(() => {
1785
1785
  var E;
1786
1786
  o.current && (o.current.scroll({
@@ -1791,12 +1791,12 @@ function ul({
1791
1791
  return () => clearTimeout(z);
1792
1792
  }, [p]);
1793
1793
  function S() {
1794
- a && (N((z) => [...z, { role: "user", content: a }]), k(a) && d(!0), t(""), x());
1794
+ a && (N((z) => [...z, { role: "user", content: a }]), k(a) && h(!0), t(""), x());
1795
1795
  }
1796
1796
  se(() => {
1797
1797
  l && (S(), r(!1));
1798
1798
  }, [l, r]);
1799
- const q = {
1799
+ const R = {
1800
1800
  //seleect a darker color
1801
1801
  // color: '#000',
1802
1802
  fontFamily: "Arial, sans-serif",
@@ -1823,22 +1823,22 @@ function ul({
1823
1823
  listStyleType: "disc"
1824
1824
  }, ee = {
1825
1825
  // Override how paragraphs are rendered
1826
- p: ({ node: z, ...E }) => /* @__PURE__ */ e.jsx("p", { style: q, ...E }),
1826
+ p: ({ node: z, ...E }) => /* @__PURE__ */ e.jsx("p", { style: R, ...E }),
1827
1827
  code: ({ node: z, ...E }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...E }),
1828
1828
  pre: ({ node: z, ...E }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
1829
1829
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: E.children }),
1830
1830
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1831
- /* @__PURE__ */ e.jsx(M, { onClick: U, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ft, {}) }),
1831
+ /* @__PURE__ */ e.jsx(I, { onClick: U, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(pt, {}) }),
1832
1832
  /* @__PURE__ */ e.jsx(
1833
- M,
1833
+ I,
1834
1834
  {
1835
1835
  onClick: (Y) => {
1836
1836
  const V = U(Y);
1837
- V && (n(!1), j(V), m(!0));
1837
+ V && (n(!1), b(V), m(!0));
1838
1838
  },
1839
1839
  size: "sm",
1840
1840
  variant: "outline",
1841
- children: /* @__PURE__ */ e.jsx(gt, {})
1841
+ children: /* @__PURE__ */ e.jsx(ft, {})
1842
1842
  }
1843
1843
  )
1844
1844
  ] })
@@ -1864,18 +1864,18 @@ function ul({
1864
1864
  },
1865
1865
  E
1866
1866
  ) : z.role === "ai" ? /* @__PURE__ */ e.jsx(
1867
- pt,
1867
+ xt,
1868
1868
  {
1869
1869
  className: "w-full overflow-auto py-1",
1870
1870
  components: ee,
1871
- children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
1871
+ children: D == null ? void 0 : D.response.replace(/DuckDB/gi, "Semaphor")
1872
1872
  },
1873
1873
  E
1874
1874
  ) : /* @__PURE__ */ e.jsx("div", {}, E));
1875
1875
  }
1876
- return /* @__PURE__ */ e.jsxs(Cs, { open: s, onOpenChange: n, children: [
1877
- /* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1878
- M,
1876
+ return /* @__PURE__ */ e.jsxs(Ns, { open: s, onOpenChange: n, children: [
1877
+ /* @__PURE__ */ e.jsx(Ss, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1878
+ I,
1879
1879
  {
1880
1880
  size: "sm",
1881
1881
  className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
@@ -1884,13 +1884,13 @@ function ul({
1884
1884
  }
1885
1885
  ) }),
1886
1886
  /* @__PURE__ */ e.jsxs(
1887
- ws,
1887
+ ks,
1888
1888
  {
1889
1889
  className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
1890
1890
  children: [
1891
- /* @__PURE__ */ e.jsxs(ks, { children: [
1892
- /* @__PURE__ */ e.jsx(zs, { children: "Assistant" }),
1893
- /* @__PURE__ */ e.jsx(Os, { children: "What can I help you with?" })
1891
+ /* @__PURE__ */ e.jsxs(zs, { children: [
1892
+ /* @__PURE__ */ e.jsx(Os, { children: "Assistant" }),
1893
+ /* @__PURE__ */ e.jsx(Ms, { children: "What can I help you with?" })
1894
1894
  ] }),
1895
1895
  /* @__PURE__ */ e.jsx(
1896
1896
  "div",
@@ -1920,20 +1920,20 @@ function ul({
1920
1920
  className: W(
1921
1921
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1922
1922
  ),
1923
- disabled: R || v,
1923
+ disabled: A || v,
1924
1924
  value: a,
1925
1925
  onChange: (z) => t(z.target.value)
1926
1926
  }
1927
1927
  ),
1928
1928
  " ",
1929
1929
  /* @__PURE__ */ e.jsx(
1930
- M,
1930
+ I,
1931
1931
  {
1932
1932
  className: "h-8",
1933
1933
  size: "sm",
1934
1934
  variant: "ghost",
1935
1935
  onClick: S,
1936
- children: !R && !v ? /* @__PURE__ */ e.jsx(xt, {}) : /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1936
+ children: !A && !v ? /* @__PURE__ */ e.jsx(mt, {}) : /* @__PURE__ */ e.jsx(qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1937
1937
  }
1938
1938
  )
1939
1939
  ] })
@@ -1944,13 +1944,13 @@ function ul({
1944
1944
  )
1945
1945
  ] });
1946
1946
  }
1947
- var qa = {
1947
+ var Aa = {
1948
1948
  color: void 0,
1949
1949
  size: void 0,
1950
1950
  className: void 0,
1951
1951
  style: void 0,
1952
1952
  attr: void 0
1953
- }, Xs = Ce.createContext && /* @__PURE__ */ Ce.createContext(qa), hl = ["attr", "size", "title"];
1953
+ }, Xs = Ne.createContext && /* @__PURE__ */ Ne.createContext(Aa), hl = ["attr", "size", "title"];
1954
1954
  function ml(s, n) {
1955
1955
  if (s == null) return {};
1956
1956
  var a = xl(s, n), t, l;
@@ -1971,15 +1971,15 @@ function xl(s, n) {
1971
1971
  }
1972
1972
  return a;
1973
1973
  }
1974
- function ls() {
1975
- return ls = Object.assign ? Object.assign.bind() : function(s) {
1974
+ function rs() {
1975
+ return rs = Object.assign ? Object.assign.bind() : function(s) {
1976
1976
  for (var n = 1; n < arguments.length; n++) {
1977
1977
  var a = arguments[n];
1978
1978
  for (var t in a)
1979
1979
  Object.prototype.hasOwnProperty.call(a, t) && (s[t] = a[t]);
1980
1980
  }
1981
1981
  return s;
1982
- }, ls.apply(this, arguments);
1982
+ }, rs.apply(this, arguments);
1983
1983
  }
1984
1984
  function Zs(s, n) {
1985
1985
  var a = Object.keys(s);
@@ -1991,7 +1991,7 @@ function Zs(s, n) {
1991
1991
  }
1992
1992
  return a;
1993
1993
  }
1994
- function rs(s) {
1994
+ function is(s) {
1995
1995
  for (var n = 1; n < arguments.length; n++) {
1996
1996
  var a = arguments[n] != null ? arguments[n] : {};
1997
1997
  n % 2 ? Zs(Object(a), !0).forEach(function(t) {
@@ -2019,15 +2019,15 @@ function gl(s, n) {
2019
2019
  }
2020
2020
  return (n === "string" ? String : Number)(s);
2021
2021
  }
2022
- function Ra(s) {
2023
- return s && s.map((n, a) => /* @__PURE__ */ Ce.createElement(n.tag, rs({
2022
+ function qa(s) {
2023
+ return s && s.map((n, a) => /* @__PURE__ */ Ne.createElement(n.tag, is({
2024
2024
  key: a
2025
- }, n.attr), Ra(n.child)));
2025
+ }, n.attr), qa(n.child)));
2026
2026
  }
2027
2027
  function ge(s) {
2028
- return (n) => /* @__PURE__ */ Ce.createElement(jl, ls({
2029
- attr: rs({}, s.attr)
2030
- }, n), Ra(s.child));
2028
+ return (n) => /* @__PURE__ */ Ne.createElement(jl, rs({
2029
+ attr: is({}, s.attr)
2030
+ }, n), qa(s.child));
2031
2031
  }
2032
2032
  function jl(s) {
2033
2033
  var n = (a) => {
@@ -2036,30 +2036,30 @@ function jl(s) {
2036
2036
  size: l,
2037
2037
  title: r
2038
2038
  } = s, i = ml(s, hl), o = l || a.size || "1em", c;
2039
- return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ Ce.createElement("svg", ls({
2039
+ return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ Ne.createElement("svg", rs({
2040
2040
  stroke: "currentColor",
2041
2041
  fill: "currentColor",
2042
2042
  strokeWidth: "0"
2043
2043
  }, a.attr, t, i, {
2044
2044
  className: c,
2045
- style: rs(rs({
2045
+ style: is(is({
2046
2046
  color: s.color || a.color
2047
2047
  }, a.style), s.style),
2048
2048
  height: o,
2049
2049
  width: o,
2050
2050
  xmlns: "http://www.w3.org/2000/svg"
2051
- }), r && /* @__PURE__ */ Ce.createElement("title", null, r), s.children);
2051
+ }), r && /* @__PURE__ */ Ne.createElement("title", null, r), s.children);
2052
2052
  };
2053
- return Xs !== void 0 ? /* @__PURE__ */ Ce.createElement(Xs.Consumer, null, (a) => n(a)) : n(qa);
2053
+ return Xs !== void 0 ? /* @__PURE__ */ Ne.createElement(Xs.Consumer, null, (a) => n(a)) : n(Aa);
2054
2054
  }
2055
2055
  function bl(s) {
2056
2056
  return ge({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
2057
2057
  }
2058
2058
  function yl({ sql: s }) {
2059
- return /* @__PURE__ */ e.jsxs(Ts, { children: [
2060
- /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(jt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2059
+ return /* @__PURE__ */ e.jsxs(Fs, { children: [
2060
+ /* @__PURE__ */ e.jsx(Ls, { asChild: !0, children: /* @__PURE__ */ e.jsx(I, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(gt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2061
2061
  /* @__PURE__ */ e.jsx(
2062
- Ls,
2062
+ Es,
2063
2063
  {
2064
2064
  align: "end",
2065
2065
  className: "w-full min-w-fit max-w-[700px] p-3 pt-2",
@@ -2071,31 +2071,31 @@ function yl({ sql: s }) {
2071
2071
  )
2072
2072
  ] });
2073
2073
  }
2074
- function _a(s) {
2075
- const { theme: n } = bt(), a = D((p) => p.theme), t = u((p) => p.frame), l = u((p) => p.card), r = u((p) => p.activeTabCardId), i = yt(), { refetch: o } = Me(l), { updateCardTab: c, setRunSql: h } = ae(), d = ns(), j = ns({}), f = t.cards.find((p) => p.id === r), m = Oa(() => {
2074
+ function Ra(s) {
2075
+ const { theme: n } = jt(), a = T((p) => p.theme), t = d((p) => p.frame), l = d((p) => p.card), r = d((p) => p.activeTabCardId), i = bt(), { refetch: o } = De(l), { updateCardTab: c, setRunSql: u } = ae(), h = ls(), b = ls({}), f = t.cards.find((p) => p.id === r), m = za(() => {
2076
2076
  let p = "";
2077
2077
  return s === "python" && (p = (f == null ? void 0 : f.python) || fa), s === "sql" && (p = (f == null ? void 0 : f.sql) || ""), p;
2078
2078
  }, [s, f]);
2079
2079
  se(() => {
2080
2080
  if (r && l.id && l.id !== r) {
2081
- if (d.current && i) {
2082
- const p = d.current.getModel();
2083
- p && (j.current[l.id] = p);
2084
- let N = j.current[r];
2081
+ if (h.current && i) {
2082
+ const p = h.current.getModel();
2083
+ p && (b.current[l.id] = p);
2084
+ let N = b.current[r];
2085
2085
  if (!N) {
2086
2086
  const y = m();
2087
- N = i.editor.createModel(y, s), j.current[r] = N;
2087
+ N = i.editor.createModel(y, s), b.current[r] = N;
2088
2088
  }
2089
- d.current.setModel(N);
2089
+ h.current.setModel(N);
2090
2090
  }
2091
- c(r, l), h(!0);
2091
+ c(r, l), u(!0);
2092
2092
  }
2093
2093
  }, [
2094
2094
  r,
2095
2095
  l,
2096
2096
  c,
2097
2097
  i,
2098
- h,
2098
+ u,
2099
2099
  s,
2100
2100
  m
2101
2101
  ]), se(() => {
@@ -2107,7 +2107,7 @@ function _a(s) {
2107
2107
  inherit: !0,
2108
2108
  rules: [],
2109
2109
  colors: {
2110
- "editor.background": N === "light" ? "#ffffff" : vt("240 10% 10%")
2110
+ "editor.background": N === "light" ? "#ffffff" : yt("240 10% 10%")
2111
2111
  // 'editor.background':
2112
2112
  // activeTheme === 'light'
2113
2113
  // ? '#ffffff'
@@ -2115,7 +2115,7 @@ function _a(s) {
2115
2115
  }
2116
2116
  }), i.editor.setTheme("default");
2117
2117
  }, [n, a, i]), se(() => {
2118
- const p = d.current;
2118
+ const p = h.current;
2119
2119
  p && i && l && p.addCommand(
2120
2120
  i.KeyMod.Shift | i.KeyCode.Enter,
2121
2121
  function() {
@@ -2124,21 +2124,21 @@ function _a(s) {
2124
2124
  );
2125
2125
  }, [i, o, l]);
2126
2126
  function g(p, N) {
2127
- if (d.current = p, !j.current[l.id]) {
2128
- const y = p.getModel(), A = m();
2129
- j.current[l.id] = y || (N == null ? void 0 : N.editor.createModel(A, s)) || p.getModel();
2127
+ if (h.current = p, !b.current[l.id]) {
2128
+ const y = p.getModel(), q = m();
2129
+ b.current[l.id] = y || (N == null ? void 0 : N.editor.createModel(q, s)) || p.getModel();
2130
2130
  }
2131
- p.setModel(j.current[l.id]);
2131
+ p.setModel(b.current[l.id]);
2132
2132
  }
2133
2133
  return { handleEditorDidMount: g };
2134
2134
  }
2135
2135
  function vl() {
2136
- const s = u((i) => i.card.sql), n = u((i) => i.sqlGen), { setCardSql: a, setSqlGen: t } = ae(), { handleEditorDidMount: l } = _a("sql");
2136
+ const s = d((i) => i.card.sql), n = d((i) => i.sqlGen), { setCardSql: a, setSqlGen: t } = ae(), { handleEditorDidMount: l } = Ra("sql");
2137
2137
  function r(i) {
2138
- a(i), Ct(n) || t({});
2138
+ a(i), vt(n) || t({});
2139
2139
  }
2140
2140
  return /* @__PURE__ */ e.jsx(
2141
- os,
2141
+ cs,
2142
2142
  {
2143
2143
  theme: "default",
2144
2144
  className: "pt-3",
@@ -2162,12 +2162,12 @@ function vl() {
2162
2162
  );
2163
2163
  }
2164
2164
  function Cl() {
2165
- const s = u((l) => l.card.python), { setCardPython: n } = ae(), { handleEditorDidMount: a } = _a("python");
2165
+ const s = d((l) => l.card.python), { setCardPython: n } = ae(), { handleEditorDidMount: a } = Ra("python");
2166
2166
  function t(l) {
2167
2167
  n(l);
2168
2168
  }
2169
2169
  return /* @__PURE__ */ e.jsx(
2170
- os,
2170
+ cs,
2171
2171
  {
2172
2172
  className: "pt-3",
2173
2173
  theme: "default",
@@ -2191,13 +2191,13 @@ function Cl() {
2191
2191
  );
2192
2192
  }
2193
2193
  function Nl() {
2194
- const s = D((r) => r.dashboard.filters), n = D((r) => r.filterValues), a = D((r) => r.selectedSheetId), t = s == null ? void 0 : s.filter(
2194
+ const s = T((r) => r.dashboard.filters), n = T((r) => r.filterValues), a = T((r) => r.selectedSheetId), t = s == null ? void 0 : s.filter(
2195
2195
  (r) => r.sheetId === a || !r.sheetId
2196
2196
  ), l = n == null ? void 0 : n.filter(
2197
2197
  (r) => (t == null ? void 0 : t.some((i) => i.id === r.filterId)) || r.filterId.endsWith(a)
2198
2198
  );
2199
2199
  return /* @__PURE__ */ e.jsx(
2200
- os,
2200
+ cs,
2201
2201
  {
2202
2202
  theme: "default",
2203
2203
  defaultLanguage: "json",
@@ -2222,30 +2222,30 @@ function Nl() {
2222
2222
  );
2223
2223
  }
2224
2224
  function Sl() {
2225
- var we;
2225
+ var ke;
2226
2226
  const [s, n] = _({
2227
2227
  queryKey: [],
2228
2228
  queryData: null
2229
- }), a = Nt(), [t, l] = _(!1), [r, i] = _(!1), [o, c] = _(!1), [h, d] = _(""), [j, f] = _(!1), m = u((w) => w.frame), g = u((w) => w.card), p = u((w) => w.isShowingVisual), N = u(
2229
+ }), a = Ct(), [t, l] = _(!1), [r, i] = _(!1), [o, c] = _(!1), [u, h] = _(""), [b, f] = _(!1), m = d((w) => w.frame), g = d((w) => w.card), p = d((w) => w.isShowingVisual), N = d(
2230
2230
  (w) => w.selectedConnectionId
2231
- ), y = u(
2231
+ ), y = d(
2232
2232
  (w) => w.selectedDatabaseName
2233
- ), A = u(
2233
+ ), q = d(
2234
2234
  (w) => w.selectedDatamodelId
2235
- ), I = u(
2235
+ ), F = d(
2236
2236
  (w) => w.selectedSchemaName
2237
- ), O = u((w) => w.selectedTableName), T = u((w) => {
2237
+ ), M = d((w) => w.selectedTableName), O = d((w) => {
2238
2238
  var re;
2239
2239
  return (re = w == null ? void 0 : w.card) == null ? void 0 : re.sql;
2240
- }), F = u((w) => w.applyFilters), {
2241
- setCardCustomCfg: R,
2240
+ }), D = d((w) => w.applyFilters), {
2241
+ setCardCustomCfg: A,
2242
2242
  setQueryResultColumns: v,
2243
- setCardSql: b,
2243
+ setCardSql: j,
2244
2244
  // setQueryError,
2245
2245
  setPythonStdOut: x,
2246
2246
  setCardPreferences: k,
2247
2247
  setCardType: S
2248
- } = ae(), q = u((w) => w.onSave), P = u((w) => w.onClose), G = u((w) => w.actions.setSqlGen), ee = u((w) => w.runSql), U = u((w) => w.actions.setRunSql), te = u((w) => w.actions.setCardCfg), z = u(
2248
+ } = ae(), R = d((w) => w.onSave), P = d((w) => w.onClose), G = d((w) => w.actions.setSqlGen), ee = d((w) => w.runSql), U = d((w) => w.actions.setRunSql), te = d((w) => w.actions.setCardCfg), z = d(
2249
2249
  (w) => w.actions.setIsSqlRunning
2250
2250
  ), {
2251
2251
  data: E,
@@ -2256,13 +2256,13 @@ function Sl() {
2256
2256
  error: B,
2257
2257
  queryKey: X,
2258
2258
  refetch: le
2259
- } = Me(g);
2259
+ } = De(g);
2260
2260
  se(() => {
2261
- if (E && (E.rowLimitExceeded && Ge.error("Row limit (10,000) exceeded. Refine your query.", {
2261
+ if (E && (E.rowLimitExceeded && Ke.error("Row limit (10,000) exceeded. Refine your query.", {
2262
2262
  position: "top-center",
2263
2263
  richColors: !0
2264
2264
  }), x((E == null ? void 0 : E.output) || ""), E.records.length > 0)) {
2265
- const { dimensionKeys: w } = js(E.records);
2265
+ const { dimensionKeys: w } = bs(E.records);
2266
2266
  v(w);
2267
2267
  }
2268
2268
  }, [E, v, x]), se(() => {
@@ -2281,60 +2281,60 @@ function Sl() {
2281
2281
  ]), se(() => {
2282
2282
  ee && (a.getQueryData(X) || le(), U(!1));
2283
2283
  }, [ee, le, U, X, a]);
2284
- function Te() {
2284
+ function Fe() {
2285
2285
  const w = a.getQueryData(X);
2286
2286
  s.queryData || n({
2287
2287
  queryKey: X,
2288
2288
  queryData: w
2289
- }), a.setQueryData(X, null), a.removeQueries({ queryKey: X, exact: !0 }), b(""), G({}), te(void 0), R(""), k({}), S("bar");
2289
+ }), a.setQueryData(X, null), a.removeQueries({ queryKey: X, exact: !0 }), j(""), G({}), te(void 0), A(""), k({}), S("bar");
2290
2290
  }
2291
- function Fe(w, re) {
2291
+ function Le(w, re) {
2292
2292
  if (w.length === 0)
2293
2293
  return "";
2294
2294
  if (re) {
2295
- const ke = w.find((oe) => oe.id === re);
2296
- if (ke) {
2297
- const oe = ke.tabTitle;
2295
+ const ze = w.find((oe) => oe.id === re);
2296
+ if (ze) {
2297
+ const oe = ze.tabTitle;
2298
2298
  if (oe == "All__Header")
2299
2299
  return w[0].id;
2300
2300
  if (oe && oe.endsWith("__Header")) {
2301
- const ps = oe.split("__")[0], Qe = w.find(
2302
- (Je) => Je.tabTitle === ps
2301
+ const fs = oe.split("__")[0], Je = w.find(
2302
+ (We) => We.tabTitle === fs
2303
2303
  );
2304
- return Qe ? Qe.id : w[0].id;
2304
+ return Je ? Je.id : w[0].id;
2305
2305
  }
2306
2306
  return re;
2307
2307
  }
2308
2308
  }
2309
2309
  return w[0].id;
2310
2310
  }
2311
- function Se() {
2312
- let w = T;
2313
- T && !T.includes("{{") && (w = ol(T), b(w));
2311
+ function we() {
2312
+ let w = O;
2313
+ O && !O.includes("{{") && (w = ol(O), j(w));
2314
2314
  const re = {
2315
2315
  ...g,
2316
- lastSelectedSchema: I,
2317
- lastSelectedDatamodelId: A,
2316
+ lastSelectedSchema: F,
2317
+ lastSelectedDatamodelId: q,
2318
2318
  lastSelectedDatabase: y,
2319
- lastSelectedTable: O,
2319
+ lastSelectedTable: M,
2320
2320
  connectionId: N,
2321
2321
  type: p ? g.type : "table",
2322
2322
  sql: w,
2323
2323
  customCfg: p ? g.customCfg : null
2324
- }, ke = m.cards.map(
2325
- (_e) => _e.id === g.id ? re : _e
2324
+ }, ze = m.cards.map(
2325
+ (He) => He.id === g.id ? re : He
2326
2326
  ), oe = {
2327
2327
  ...m,
2328
- cards: ke,
2329
- activeCardId: Fe(ke, m.activeCardId)
2328
+ cards: ze,
2329
+ activeCardId: Le(ze, m.activeCardId)
2330
2330
  };
2331
- q == null || q(oe);
2331
+ R == null || R(oe);
2332
2332
  }
2333
- function Le() {
2333
+ function Ee() {
2334
2334
  const { queryKey: w, queryData: re } = s;
2335
2335
  w && re && a.setQueryData(w, re), G({}), P == null || P();
2336
2336
  }
2337
- function Ee() {
2337
+ function Ve() {
2338
2338
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2339
2339
  r && /* @__PURE__ */ e.jsx(
2340
2340
  "div",
@@ -2345,7 +2345,7 @@ function Sl() {
2345
2345
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
2346
2346
  /* @__PURE__ */ e.jsx($, { className: "ml-6 text-xs font-semibold", children: "Filters" }),
2347
2347
  r && /* @__PURE__ */ e.jsx(
2348
- Be,
2348
+ Ue,
2349
2349
  {
2350
2350
  onClick: () => i(!1),
2351
2351
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
@@ -2363,23 +2363,23 @@ function Sl() {
2363
2363
  className: W(
2364
2364
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
2365
2365
  {
2366
- "font-bold text-red-800": F
2366
+ "font-bold text-red-800": D
2367
2367
  }
2368
2368
  )
2369
2369
  }
2370
2370
  )
2371
2371
  ] });
2372
2372
  }
2373
- function Ve() {
2373
+ function Ae() {
2374
2374
  return /* @__PURE__ */ e.jsxs(
2375
- ss,
2375
+ as,
2376
2376
  {
2377
2377
  className: "flex grow pb-1",
2378
2378
  direction: "vertical",
2379
2379
  role: "editor-resizable-group",
2380
2380
  children: [
2381
2381
  /* @__PURE__ */ e.jsxs(
2382
- be,
2382
+ ye,
2383
2383
  {
2384
2384
  id: "1",
2385
2385
  order: 1,
@@ -2399,9 +2399,9 @@ function Sl() {
2399
2399
  }
2400
2400
  ),
2401
2401
  t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2402
- /* @__PURE__ */ e.jsx(as, { withHandle: !0, className: "border" }),
2402
+ /* @__PURE__ */ e.jsx(ts, { withHandle: !0, className: "border" }),
2403
2403
  /* @__PURE__ */ e.jsxs(
2404
- be,
2404
+ ye,
2405
2405
  {
2406
2406
  id: "2",
2407
2407
  order: 2,
@@ -2434,8 +2434,8 @@ function Sl() {
2434
2434
  className: "flex grow flex-col justify-end",
2435
2435
  children: [
2436
2436
  /* @__PURE__ */ e.jsxs("div", { className: "relative flex grow justify-between overflow-y-scroll", children: [
2437
- Ve(),
2438
- Ee()
2437
+ Ae(),
2438
+ Ve()
2439
2439
  ] }),
2440
2440
  /* @__PURE__ */ e.jsxs(
2441
2441
  "div",
@@ -2445,7 +2445,7 @@ function Sl() {
2445
2445
  children: [
2446
2446
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2447
2447
  /* @__PURE__ */ e.jsxs(
2448
- M,
2448
+ I,
2449
2449
  {
2450
2450
  title: "Shift + Enter",
2451
2451
  disabled: Y || V,
@@ -2456,7 +2456,7 @@ function Sl() {
2456
2456
  size: "sm",
2457
2457
  variant: "outline",
2458
2458
  children: [
2459
- Y || V ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx($n, { className: "mr-2 h-4 w-4" }),
2459
+ Y || V ? /* @__PURE__ */ e.jsx(qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx($n, { className: "mr-2 h-4 w-4" }),
2460
2460
  "Run"
2461
2461
  ]
2462
2462
  }
@@ -2464,16 +2464,16 @@ function Sl() {
2464
2464
  (ne || (E == null ? void 0 : E.error)) && /* @__PURE__ */ e.jsx(
2465
2465
  cl,
2466
2466
  {
2467
- error: (B == null ? void 0 : B.message) || ((we = E == null ? void 0 : E.error) == null ? void 0 : we.message),
2467
+ error: (B == null ? void 0 : B.message) || ((ke = E == null ? void 0 : E.error) == null ? void 0 : ke.message),
2468
2468
  setShowAIDialog: c,
2469
2469
  setTriggerAIRun: f,
2470
- setUserInputforAI: d
2470
+ setUserInputforAI: h
2471
2471
  }
2472
2472
  ),
2473
2473
  /* @__PURE__ */ e.jsxs(
2474
- M,
2474
+ I,
2475
2475
  {
2476
- onClick: Te,
2476
+ onClick: Fe,
2477
2477
  className: "",
2478
2478
  size: "sm",
2479
2479
  variant: "outline",
@@ -2499,36 +2499,36 @@ function Sl() {
2499
2499
  {
2500
2500
  open: o,
2501
2501
  setOpen: c,
2502
- userInput: h,
2503
- triggerAIRun: j,
2502
+ userInput: u,
2503
+ triggerAIRun: b,
2504
2504
  setTriggerAIRun: f,
2505
- setUserInput: (w) => d(w)
2505
+ setUserInput: (w) => h(w)
2506
2506
  }
2507
2507
  )
2508
2508
  ] }),
2509
2509
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2510
2510
  (E == null ? void 0 : E.sql) && /* @__PURE__ */ e.jsx(yl, { sql: E.sql }),
2511
2511
  /* @__PURE__ */ e.jsxs(
2512
- M,
2512
+ I,
2513
2513
  {
2514
- onClick: Le,
2514
+ onClick: Ee,
2515
2515
  className: "w-full",
2516
2516
  size: "sm",
2517
2517
  variant: "outline",
2518
2518
  children: [
2519
- /* @__PURE__ */ e.jsx(Be, { className: "mr-2 size-4" }),
2519
+ /* @__PURE__ */ e.jsx(Ue, { className: "mr-2 size-4" }),
2520
2520
  "Close"
2521
2521
  ]
2522
2522
  }
2523
2523
  ),
2524
2524
  /* @__PURE__ */ e.jsxs(
2525
- M,
2525
+ I,
2526
2526
  {
2527
- onClick: Se,
2527
+ onClick: we,
2528
2528
  size: "sm",
2529
2529
  variant: "outline",
2530
2530
  children: [
2531
- /* @__PURE__ */ e.jsx(St, { className: "mr-2 size-4 font-bold text-green-600" }),
2531
+ /* @__PURE__ */ e.jsx(Nt, { className: "mr-2 size-4 font-bold text-green-600" }),
2532
2532
  "Accept"
2533
2533
  ]
2534
2534
  }
@@ -2544,11 +2544,11 @@ function Sl() {
2544
2544
  }
2545
2545
  function wl({ data: s }) {
2546
2546
  var i;
2547
- const [n, a] = Ce.useState([]), l = Object.keys(s[0]).map((o) => ({
2547
+ const [n, a] = Ne.useState([]), l = Object.keys(s[0]).map((o) => ({
2548
2548
  // header: key,
2549
2549
  accessorKey: o,
2550
2550
  header: ({ column: c }) => {
2551
- const h = c.getIsSorted();
2551
+ const u = c.getIsSorted();
2552
2552
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2553
2553
  "div",
2554
2554
  {
@@ -2556,66 +2556,66 @@ function wl({ data: s }) {
2556
2556
  onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
2557
2557
  children: [
2558
2558
  o,
2559
- h === "asc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : h === "desc" ? /* @__PURE__ */ e.jsx(kt, { className: "ml-2 h-5 w-5" }) : null
2559
+ u === "asc" ? /* @__PURE__ */ e.jsx(St, { className: "ml-2 h-5 w-5" }) : u === "desc" ? /* @__PURE__ */ e.jsx(wt, { className: "ml-2 h-5 w-5" }) : null
2560
2560
  ]
2561
2561
  }
2562
2562
  ) });
2563
2563
  }
2564
- })), r = zt({
2564
+ })), r = kt({
2565
2565
  data: s,
2566
2566
  columns: l,
2567
- getCoreRowModel: It(),
2568
- getPaginationRowModel: Tt(),
2567
+ getCoreRowModel: Dt(),
2568
+ getPaginationRowModel: It(),
2569
2569
  onSortingChange: a,
2570
- getSortedRowModel: Ft(),
2570
+ getSortedRowModel: Tt(),
2571
2571
  manualPagination: !0,
2572
2572
  state: {
2573
2573
  sorting: n
2574
2574
  }
2575
2575
  });
2576
2576
  return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
2577
- /* @__PURE__ */ e.jsx(Ot, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(fs, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
2578
- Mt,
2577
+ /* @__PURE__ */ e.jsx(zt, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(gs, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
2578
+ Ot,
2579
2579
  {
2580
2580
  className: "sticky top-0 h-11 bg-muted font-semibold",
2581
- children: c.isPlaceholder ? null : Ks(
2581
+ children: c.isPlaceholder ? null : Qs(
2582
2582
  c.column.columnDef.header,
2583
2583
  c.getContext()
2584
2584
  )
2585
2585
  },
2586
2586
  c.id
2587
2587
  )) }, o.id)) }),
2588
- /* @__PURE__ */ e.jsx(Dt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2589
- fs,
2588
+ /* @__PURE__ */ e.jsx(Mt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2589
+ gs,
2590
2590
  {
2591
2591
  className: "whitespace-nowrap py-2",
2592
2592
  "data-state": o.getIsSelected() && "selected",
2593
- children: o.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Qs, { className: "py-3", children: Ks(c.column.columnDef.cell, c.getContext()) }, c.id))
2593
+ children: o.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(Js, { className: "py-3", children: Qs(c.column.columnDef.cell, c.getContext()) }, c.id))
2594
2594
  },
2595
2595
  o.id
2596
- )) : /* @__PURE__ */ e.jsx(fs, { children: /* @__PURE__ */ e.jsx(Qs, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2596
+ )) : /* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsx(Js, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2597
2597
  ] }) });
2598
2598
  }
2599
2599
  function kl({ card: s }) {
2600
- var y, A, I, O, T, F, R, v, b, x, k;
2600
+ var y, q, F, M, O, D, A, v, j, x, k;
2601
2601
  const [n, a] = _(!1), [t, l] = _(
2602
2602
  []
2603
- ), { authToken: r } = Ne(), i = Lt(r == null ? void 0 : r.accessToken), o = D((S) => S.themeStyle), c = {
2604
- colors: ((A = (y = o == null ? void 0 : o.chart) == null ? void 0 : y.dataset) == null ? void 0 : A.backgroundColor) || []
2603
+ ), { authToken: r } = Se(), i = Ft(r == null ? void 0 : r.accessToken), o = T((S) => S.themeStyle), c = {
2604
+ colors: ((q = (y = o == null ? void 0 : o.chart) == null ? void 0 : y.dataset) == null ? void 0 : q.backgroundColor) || []
2605
2605
  };
2606
- (I = s.customCardPreferences) != null && I.inputData;
2607
- const { getCard: h } = ga(((O = s.customCardPreferences) == null ? void 0 : O.url) || ""), d = ((T = s.customCardPreferences) == null ? void 0 : T.visualType) || "single", j = u((S) => S.frame);
2606
+ (F = s.customCardPreferences) != null && F.inputData;
2607
+ const { getCard: u } = ga(((M = s.customCardPreferences) == null ? void 0 : M.url) || ""), h = ((O = s.customCardPreferences) == null ? void 0 : O.visualType) || "single", b = d((S) => S.frame);
2608
2608
  ae();
2609
- const { data: f } = Me(s), m = Oa((S, q) => {
2609
+ const { data: f } = De(s), m = za((S, R) => {
2610
2610
  l((P) => ({
2611
2611
  ...P,
2612
- [S]: q
2612
+ [S]: R
2613
2613
  }));
2614
2614
  }, []);
2615
- if (!((F = s.customCardPreferences) != null && F.componentName))
2615
+ if (!((D = s.customCardPreferences) != null && D.componentName))
2616
2616
  return null;
2617
- const g = h(
2618
- (R = s.customCardPreferences) == null ? void 0 : R.componentName
2617
+ const g = u(
2618
+ (A = s.customCardPreferences) == null ? void 0 : A.componentName
2619
2619
  );
2620
2620
  function p(S) {
2621
2621
  a(S);
@@ -2624,7 +2624,7 @@ function kl({ card: s }) {
2624
2624
  ((v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) || {}
2625
2625
  ).map((S) => {
2626
2626
  var G, ee, U;
2627
- const q = (ee = (G = s.customCardPreferences) == null ? void 0 : G.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (U = j == null ? void 0 : j.cards) == null ? void 0 : U.find((te) => te.id === q);
2627
+ const R = (ee = (G = s.customCardPreferences) == null ? void 0 : G.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (U = b == null ? void 0 : b.cards) == null ? void 0 : U.find((te) => te.id === R);
2628
2628
  return P || null;
2629
2629
  });
2630
2630
  return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
@@ -2632,27 +2632,27 @@ function kl({ card: s }) {
2632
2632
  {
2633
2633
  fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
2634
2634
  children: [
2635
- g && d === "single" && /* @__PURE__ */ e.jsx(
2635
+ g && h === "single" && /* @__PURE__ */ e.jsx(
2636
2636
  g,
2637
2637
  {
2638
2638
  params: i,
2639
2639
  theme: c,
2640
- settings: (b = s.customCardPreferences) == null ? void 0 : b.settings,
2640
+ settings: (j = s.customCardPreferences) == null ? void 0 : j.settings,
2641
2641
  onDataChange: m,
2642
2642
  data: (f == null ? void 0 : f.records) || []
2643
2643
  }
2644
2644
  ),
2645
- g && d === "multiple" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2645
+ g && h === "multiple" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2646
2646
  Object.keys(
2647
2647
  ((x = s.customCardPreferences) == null ? void 0 : x.dataInputCardIds) || {}
2648
2648
  ).map((S) => {
2649
2649
  var G, ee, U;
2650
- const q = (ee = (G = s.customCardPreferences) == null ? void 0 : G.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (U = j == null ? void 0 : j.cards) == null ? void 0 : U.find(
2651
- (te) => te.id === q
2650
+ const R = (ee = (G = s.customCardPreferences) == null ? void 0 : G.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (U = b == null ? void 0 : b.cards) == null ? void 0 : U.find(
2651
+ (te) => te.id === R
2652
2652
  );
2653
2653
  if (P)
2654
2654
  return /* @__PURE__ */ e.jsx(
2655
- Et,
2655
+ Lt,
2656
2656
  {
2657
2657
  onLoadingStatus: p,
2658
2658
  onDataChange: m,
@@ -2669,8 +2669,8 @@ function kl({ card: s }) {
2669
2669
  onDataChange: m,
2670
2670
  settings: N.map(
2671
2671
  (S) => {
2672
- var q;
2673
- return (q = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : q.settings;
2672
+ var R;
2673
+ return (R = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : R.settings;
2674
2674
  }
2675
2675
  ),
2676
2676
  data: N.map((S) => S != null && S.id ? t == null ? void 0 : t[S.id] : [])
@@ -2682,16 +2682,16 @@ function kl({ card: s }) {
2682
2682
  (k = s.customCardPreferences) == null ? void 0 : k.componentName
2683
2683
  ) });
2684
2684
  }
2685
- function Ha({
2685
+ function _a({
2686
2686
  // card,
2687
2687
  // showCard,
2688
2688
  className: s,
2689
2689
  ...n
2690
2690
  }) {
2691
2691
  var N;
2692
- const a = u((y) => y.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = u((y) => y.frame), r = D((y) => y.dashboard.filters);
2693
- u((y) => y.actions.setRunSql);
2694
- const { updateFilter: i } = is(), o = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: c, isLoading: h, isFetching: d } = Me(a), { setCard: j } = ae(), { data: f } = Es(a);
2692
+ const a = d((y) => y.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = d((y) => y.frame), r = T((y) => y.dashboard.filters);
2693
+ d((y) => y.actions.setRunSql);
2694
+ const { updateFilter: i } = os(), o = r == null ? void 0 : r.find((y) => y.id === l.filterId), { data: c, isLoading: u, isFetching: h } = De(a), { setCard: b } = ae(), { data: f } = Vs(a);
2695
2695
  if (!a.id) return null;
2696
2696
  let m;
2697
2697
  c != null && c.records && (c == null ? void 0 : c.records.length) > 0 && (m = ja({
@@ -2707,16 +2707,16 @@ function Ha({
2707
2707
  }
2708
2708
  function p() {
2709
2709
  var y;
2710
- if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !h && !d)
2710
+ if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !u && !h)
2711
2711
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
2712
- /* @__PURE__ */ e.jsx(Ht, { className: "size-8 text-muted-foreground" }),
2712
+ /* @__PURE__ */ e.jsx(_t, { className: "size-8 text-muted-foreground" }),
2713
2713
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
2714
2714
  ] });
2715
2715
  if (a.type === "custom")
2716
2716
  return g(a);
2717
2717
  if (!["table", "custom"].includes(a.type) && m)
2718
2718
  return /* @__PURE__ */ e.jsx(
2719
- $t,
2719
+ Ht,
2720
2720
  {
2721
2721
  cfg: m
2722
2722
  },
@@ -2724,41 +2724,41 @@ function Ha({
2724
2724
  );
2725
2725
  if (a.type === "table" && (c != null && c.records) && (c == null ? void 0 : c.records.length) > 0)
2726
2726
  return /* @__PURE__ */ e.jsxs(fe, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
2727
- /* @__PURE__ */ e.jsx(Pt, { card: a, data: c == null ? void 0 : c.records }),
2728
- /* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
2727
+ /* @__PURE__ */ e.jsx($t, { card: a, data: c == null ? void 0 : c.records }),
2728
+ /* @__PURE__ */ e.jsx(Qe, { orientation: "horizontal" })
2729
2729
  ] });
2730
2730
  }
2731
2731
  return /* @__PURE__ */ e.jsxs(
2732
- Vt,
2732
+ Et,
2733
2733
  {
2734
2734
  role: "editor-visual-card",
2735
2735
  className: W("relative flex h-full flex-col rounded-none", s),
2736
2736
  ...n,
2737
2737
  children: [
2738
- t && /* @__PURE__ */ e.jsxs(At, { className: "flex flex-row items-start justify-between py-4", children: [
2738
+ t && /* @__PURE__ */ e.jsxs(Vt, { className: "flex flex-row items-start justify-between py-4", children: [
2739
2739
  /* @__PURE__ */ e.jsxs("div", { children: [
2740
2740
  /* @__PURE__ */ e.jsx(
2741
- Xe,
2741
+ Ze,
2742
2742
  {
2743
2743
  text: a.title,
2744
- onSave: (y) => j({ ...a, title: y }),
2745
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(qt, { className: "text-base", children: a.title || "Edit title..." }) })
2744
+ onSave: (y) => b({ ...a, title: y }),
2745
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(At, { className: "text-base", children: a.title || "Edit title..." }) })
2746
2746
  },
2747
2747
  a.title
2748
2748
  ),
2749
2749
  /* @__PURE__ */ e.jsx(
2750
- Xe,
2750
+ Ze,
2751
2751
  {
2752
2752
  text: a.description || "",
2753
- onSave: (y) => j({ ...a, description: y }),
2754
- children: /* @__PURE__ */ e.jsx(Rt, { children: a.description || "Edit description..." })
2753
+ onSave: (y) => b({ ...a, description: y }),
2754
+ children: /* @__PURE__ */ e.jsx(qt, { children: a.description || "Edit description..." })
2755
2755
  },
2756
2756
  a.description
2757
2757
  )
2758
2758
  ] }),
2759
2759
  o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
2760
2760
  /* @__PURE__ */ e.jsx(
2761
- Xe,
2761
+ Ze,
2762
2762
  {
2763
2763
  className: "my-1",
2764
2764
  text: o.title || o.column,
@@ -2769,13 +2769,13 @@ function Ha({
2769
2769
  /* @__PURE__ */ e.jsx(ba, { filter: o })
2770
2770
  ] })
2771
2771
  ] }),
2772
- /* @__PURE__ */ e.jsx(_t, { className: "flex grow flex-col", children: p() })
2772
+ /* @__PURE__ */ e.jsx(Rt, { className: "flex grow flex-col", children: p() })
2773
2773
  ]
2774
2774
  }
2775
2775
  );
2776
2776
  }
2777
2777
  const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2778
- os,
2778
+ cs,
2779
2779
  {
2780
2780
  className: "h-full w-full overflow-hidden",
2781
2781
  theme: "default",
@@ -2793,10 +2793,10 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2793
2793
  value: n,
2794
2794
  onChange: a
2795
2795
  }
2796
- ), zl = ({ card: s }) => /* @__PURE__ */ e.jsxs(ks, { children: [
2796
+ ), zl = ({ card: s }) => /* @__PURE__ */ e.jsxs(zs, { children: [
2797
2797
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2798
- /* @__PURE__ */ e.jsx(zs, { children: "Customize Card" }),
2799
- /* @__PURE__ */ e.jsxs(Ms, { children: [
2798
+ /* @__PURE__ */ e.jsx(Os, { children: "Customize Card" }),
2799
+ /* @__PURE__ */ e.jsxs(Ds, { children: [
2800
2800
  /* @__PURE__ */ e.jsx(ca, { children: /* @__PURE__ */ e.jsx(
2801
2801
  Vn,
2802
2802
  {
@@ -2804,10 +2804,10 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2804
2804
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
2805
2805
  }
2806
2806
  ) }),
2807
- /* @__PURE__ */ e.jsx(Ds, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2807
+ /* @__PURE__ */ e.jsx(Is, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2808
2808
  ] })
2809
2809
  ] }),
2810
- /* @__PURE__ */ e.jsxs(Os, { children: [
2810
+ /* @__PURE__ */ e.jsxs(Ms, { children: [
2811
2811
  "See the configuration options and documentation",
2812
2812
  /* @__PURE__ */ e.jsx(
2813
2813
  "a",
@@ -2827,15 +2827,12 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2827
2827
  onCodeChange: l
2828
2828
  }) => /* @__PURE__ */ e.jsxs(va, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2829
2829
  /* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2830
- /* @__PURE__ */ e.jsxs(Ze, { value: "custom-config", children: [
2831
- a && /* @__PURE__ */ e.jsx(Na, { className: "mr-1 h-5 w-5 text-green-600" }),
2832
- a ? "Custom Config" : "Default Config"
2833
- ] }),
2834
- /* @__PURE__ */ e.jsx(Ze, { value: "output", children: "Output" }),
2835
- /* @__PURE__ */ e.jsx(Ze, { value: "custom-code", children: "Custom Code" })
2830
+ /* @__PURE__ */ e.jsx(es, { value: "custom-config", children: a ? "Custom Config" : "Default Config" }),
2831
+ /* @__PURE__ */ e.jsx(es, { value: "output", children: "Output" }),
2832
+ /* @__PURE__ */ e.jsx(es, { value: "custom-code", children: "Custom Code" })
2836
2833
  ] }),
2837
2834
  /* @__PURE__ */ e.jsx(
2838
- es,
2835
+ ss,
2839
2836
  {
2840
2837
  value: "output",
2841
2838
  className: "mt-0 grow rounded-b border border-t-0 p-2",
@@ -2850,7 +2847,7 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2850
2847
  }
2851
2848
  ),
2852
2849
  /* @__PURE__ */ e.jsx(
2853
- es,
2850
+ ss,
2854
2851
  {
2855
2852
  value: "custom-config",
2856
2853
  className: "mt-0 grow rounded-b border border-t-0",
@@ -2865,7 +2862,7 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2865
2862
  }
2866
2863
  ),
2867
2864
  /* @__PURE__ */ e.jsx(
2868
- es,
2865
+ ss,
2869
2866
  {
2870
2867
  value: "custom-code",
2871
2868
  className: "mt-0 grow rounded-b border border-t-0",
@@ -2887,20 +2884,29 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2887
2884
  onClose: l
2888
2885
  }) => /* @__PURE__ */ e.jsxs(ta, { className: "flex items-center", children: [
2889
2886
  /* @__PURE__ */ e.jsx($, { className: "mr-2 text-red-500", children: s }),
2890
- /* @__PURE__ */ e.jsx(M, { disabled: !n, onClick: a, variant: "outline", children: "Reset" }),
2891
- /* @__PURE__ */ e.jsx(M, { onClick: t, variant: "outline", children: "Apply" }),
2892
- /* @__PURE__ */ e.jsx(M, { onClick: l, variant: "outline", children: "Close" })
2887
+ /* @__PURE__ */ e.jsx(I, { disabled: !n, onClick: a, variant: "outline", children: "Reset" }),
2888
+ /* @__PURE__ */ e.jsx(I, { onClick: t, variant: "outline", children: "Apply" }),
2889
+ /* @__PURE__ */ e.jsx(I, { onClick: l, variant: "outline", children: "Close" })
2893
2890
  ] });
2894
2891
  function Dl() {
2895
- const [s, n] = _(!1), [a, t] = _(""), [l, r] = _(""), [i, o] = _(""), [c, h] = _(""), d = u((O) => O.card), j = u((O) => O.card.customCfg), { data: f } = Me(d), { data: m } = Es(d), { setCardCustomCfg: g, setCustomVisualCode: p } = ae(), N = (O) => {
2896
- var T, F;
2892
+ const [s, n] = _(!1), [a, t] = _(""), [l, r] = _(""), [i, o] = _(""), [c, u] = _(""), h = d((M) => M.card), b = d((M) => M.card.customCfg), { data: f } = De(h), { data: m } = Vs(h), { setCardCustomCfg: g, setCustomVisualCode: p } = ae(), N = (M, O) => je.transform(M, (D, A, v) => {
2893
+ if (!je.isEqual(A, O[v]))
2894
+ if (je.isArray(A) && je.isArray(O[v]))
2895
+ D[v] = O[v];
2896
+ else if (je.isObject(A) && je.isObject(O[v])) {
2897
+ const j = N(A, O[v]);
2898
+ je.isEmpty(j) || (D[v] = j);
2899
+ } else
2900
+ D[v] = O[v];
2901
+ }), y = (M) => {
2902
+ var O, D;
2897
2903
  return JSON.stringify(
2898
2904
  {
2899
- ...O,
2905
+ ...M,
2900
2906
  data: {
2901
- ...O.data,
2902
- datasets: (F = (T = O.data) == null ? void 0 : T.datasets) == null ? void 0 : F.map((R) => ({
2903
- ...R,
2907
+ ...M.data,
2908
+ datasets: (D = (O = M.data) == null ? void 0 : O.datasets) == null ? void 0 : D.map((A) => ({
2909
+ ...A,
2904
2910
  data: []
2905
2911
  }))
2906
2912
  }
@@ -2908,58 +2914,59 @@ function Dl() {
2908
2914
  null,
2909
2915
  2
2910
2916
  );
2911
- }, y = () => {
2912
- var T, F;
2913
- if (!((T = f == null ? void 0 : f.records) != null && T.length)) return;
2914
- const O = ja({
2917
+ }, q = () => {
2918
+ var O, D;
2919
+ if (!((O = f == null ? void 0 : f.records) != null && O.length)) return;
2920
+ const M = ja({
2915
2921
  data: f.records,
2916
- cardType: d.type,
2917
- cfg: d.cfg,
2918
- preferences: d.preferences,
2922
+ cardType: h.type,
2923
+ cfg: h.cfg,
2924
+ preferences: h.preferences,
2919
2925
  topoJson: m
2920
2926
  });
2921
- O && (t(N(O)), o(((F = d.preferences) == null ? void 0 : F.customVisualCode) || ""), r(
2922
- j ? JSON.stringify(j, null, 2) : ""
2923
- ));
2924
- }, A = () => {
2927
+ if (M) {
2928
+ t(y(M)), o(((D = h.preferences) == null ? void 0 : D.customVisualCode) || "");
2929
+ const A = je.merge(M, b);
2930
+ r(y(A));
2931
+ }
2932
+ }, F = () => {
2925
2933
  try {
2926
2934
  if (i && p(i), l) {
2927
- const O = JSON.parse(l);
2928
- g(O), h("");
2935
+ const M = JSON.parse(
2936
+ l
2937
+ ), O = N(
2938
+ JSON.parse(a),
2939
+ M
2940
+ );
2941
+ g(O), u("");
2929
2942
  }
2930
2943
  } catch {
2931
- h("Invalid JSON configuration");
2932
- }
2933
- }, I = () => {
2934
- if (j) {
2935
- const O = Js.merge(Js.cloneDeep(d.cfg), j);
2936
- return N(O);
2944
+ u("Invalid JSON configuration");
2937
2945
  }
2938
- return a ? N(JSON.parse(a)) : "";
2939
2946
  };
2940
- return /* @__PURE__ */ e.jsxs(Cs, { open: s, onOpenChange: n, children: [
2941
- /* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2942
- M,
2947
+ return /* @__PURE__ */ e.jsxs(Ns, { open: s, onOpenChange: n, children: [
2948
+ /* @__PURE__ */ e.jsx(Ss, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2949
+ I,
2943
2950
  {
2944
- onClick: y,
2951
+ onClick: q,
2945
2952
  size: "sm",
2946
2953
  variant: "outline",
2947
- className: j ? "border-foreground/50 dark:border-foreground/70" : "",
2948
- children: /* @__PURE__ */ e.jsx(Bt, { className: "h-4 w-4" })
2954
+ className: b ? "border-foreground/50 dark:border-foreground/70" : "",
2955
+ children: /* @__PURE__ */ e.jsx(Pt, { className: "h-4 w-4" })
2949
2956
  }
2950
2957
  ) }),
2951
- /* @__PURE__ */ e.jsxs(ws, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
2952
- /* @__PURE__ */ e.jsx(zl, { card: d }),
2958
+ /* @__PURE__ */ e.jsxs(ks, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
2959
+ /* @__PURE__ */ e.jsx(zl, { card: h }),
2953
2960
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2954
- /* @__PURE__ */ e.jsx(cs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ha, { className: "w-1/2 rounded shadow-none" }) }),
2961
+ /* @__PURE__ */ e.jsx(ds, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(_a, { className: "w-1/2 rounded shadow-none" }) }),
2955
2962
  /* @__PURE__ */ e.jsx(
2956
2963
  Ol,
2957
2964
  {
2958
2965
  defaultConfig: a,
2959
2966
  customCode: i,
2960
- customConfig: I(),
2961
- onConfigChange: (O) => r(O ?? ""),
2962
- onCodeChange: (O) => o(O ?? "")
2967
+ customConfig: l,
2968
+ onConfigChange: (M) => r(M ?? ""),
2969
+ onCodeChange: (M) => o(M ?? "")
2963
2970
  }
2964
2971
  )
2965
2972
  ] }),
@@ -2967,54 +2974,54 @@ function Dl() {
2967
2974
  Ml,
2968
2975
  {
2969
2976
  error: c,
2970
- hasCustomConfig: !!j,
2977
+ hasCustomConfig: !!b,
2971
2978
  onReset: () => {
2972
- r(""), g(null);
2979
+ r(a), g(null);
2973
2980
  },
2974
- onApply: A,
2981
+ onApply: F,
2975
2982
  onClose: () => n(!1)
2976
2983
  }
2977
2984
  )
2978
2985
  ] })
2979
2986
  ] });
2980
2987
  }
2981
- function $a(s) {
2988
+ function Ha(s) {
2982
2989
  return ge({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
2983
2990
  }
2984
- function Pa(s) {
2991
+ function $a(s) {
2985
2992
  return ge({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z" }, child: [] }] })(s);
2986
2993
  }
2987
- function Ba(s) {
2994
+ function Pa(s) {
2988
2995
  return ge({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
2989
2996
  }
2990
- function Ua(s) {
2997
+ function Ba(s) {
2991
2998
  return ge({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
2992
2999
  }
2993
- function Ga(s) {
3000
+ function Ua(s) {
2994
3001
  return ge({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
2995
3002
  }
2996
- function Ka(s) {
3003
+ function Ga(s) {
2997
3004
  return ge({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
2998
3005
  }
2999
- function Qa(s) {
3006
+ function Ka(s) {
3000
3007
  return ge({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
3001
3008
  }
3002
- function Ja(s) {
3009
+ function Qa(s) {
3003
3010
  return ge({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
3004
3011
  }
3005
- function Wa(s) {
3012
+ function Ja(s) {
3006
3013
  const [n, a] = _(null);
3007
3014
  return se(() => {
3008
3015
  s && (async () => {
3009
- const r = (await import("./lucide-react-Cxoe-V4k.js"))[s];
3016
+ const r = (await import("./lucide-react-C5jk7GIc.js"))[s];
3010
3017
  a(r);
3011
3018
  })();
3012
3019
  }, [s]), n;
3013
3020
  }
3014
- function Ya() {
3015
- const { authToken: s } = Ne(), { data: n, isLoading: a, isFetching: t, isError: l } = je({
3021
+ function Wa() {
3022
+ const { authToken: s } = Se(), { data: n, isLoading: a, isFetching: t, isError: l } = be({
3016
3023
  queryKey: ["plugins", s == null ? void 0 : s.accessToken],
3017
- queryFn: () => Ut(s == null ? void 0 : s.accessToken)
3024
+ queryFn: () => Bt(s == null ? void 0 : s.accessToken)
3018
3025
  // staleTime: Infinity,
3019
3026
  });
3020
3027
  return { data: n, isLoading: a, isFetching: t, isError: l };
@@ -3022,15 +3029,15 @@ function Ya() {
3022
3029
  function Il({
3023
3030
  onChartTypeChange: s
3024
3031
  }) {
3025
- const [n, a] = _([]), { data: t } = Ya();
3032
+ const [n, a] = _([]), { data: t } = Wa();
3026
3033
  return se(() => {
3027
3034
  (async () => {
3028
3035
  var r;
3029
3036
  if (t) {
3030
3037
  const o = (await Promise.all(
3031
- (r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (c) => (await Gt(c.value)).visuals.map((j) => ({
3032
- name: j.name,
3033
- icon: j.icon,
3038
+ (r = t == null ? void 0 : t.plugins) == null ? void 0 : r.map(async (c) => (await Ut(c.value)).visuals.map((b) => ({
3039
+ name: b.name,
3040
+ icon: b.icon,
3034
3041
  url: c.value
3035
3042
  })))
3036
3043
  )).flat();
@@ -3038,7 +3045,7 @@ function Il({
3038
3045
  }
3039
3046
  })();
3040
3047
  }, [t]), n.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3041
- /* @__PURE__ */ e.jsx(ve, { className: "my-2" }),
3048
+ /* @__PURE__ */ e.jsx(Ce, { className: "my-2" }),
3042
3049
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: n.map((l, r) => /* @__PURE__ */ e.jsx(
3043
3050
  Tl,
3044
3051
  {
@@ -3055,13 +3062,13 @@ const Tl = ({
3055
3062
  icon: n,
3056
3063
  onClick: a
3057
3064
  }) => {
3058
- const t = Wa(n || ""), l = s.charAt(0).toUpperCase();
3059
- return /* @__PURE__ */ e.jsx(M, { onClick: a, title: s, variant: "ghost", children: t ? /* @__PURE__ */ e.jsx(t, { className: "h-4 w-4" }) : l });
3065
+ const t = Ja(n || ""), l = s.charAt(0).toUpperCase();
3066
+ return /* @__PURE__ */ e.jsx(I, { onClick: a, title: s, variant: "ghost", children: t ? /* @__PURE__ */ e.jsx(t, { className: "h-4 w-4" }) : l });
3060
3067
  };
3061
3068
  function Fl() {
3062
- var d, j;
3063
- const [s, n] = _(!1), a = u((f) => f.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = u((f) => f.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = ae();
3064
- function h(f, m) {
3069
+ var h, b;
3070
+ const [s, n] = _(!1), a = d((f) => f.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = d((f) => f.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = ae();
3071
+ function u(f, m) {
3065
3072
  o(null), r({}), l(f), m && c({
3066
3073
  type: "component",
3067
3074
  visualType: "single",
@@ -3070,90 +3077,90 @@ function Fl() {
3070
3077
  icon: m.icon
3071
3078
  }), n(!1);
3072
3079
  }
3073
- return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
3074
- /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(M, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3080
+ return /* @__PURE__ */ e.jsxs(us, { open: s, onOpenChange: n, children: [
3081
+ /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(I, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3075
3082
  Ll,
3076
3083
  {
3077
3084
  className: "h-4 w-4",
3078
3085
  chartType: t,
3079
- customIcon: (d = a.customCardPreferences) == null ? void 0 : d.icon,
3080
- componentName: (j = a.customCardPreferences) == null ? void 0 : j.componentName
3086
+ customIcon: (h = a.customCardPreferences) == null ? void 0 : h.icon,
3087
+ componentName: (b = a.customCardPreferences) == null ? void 0 : b.componentName
3081
3088
  }
3082
3089
  ) }) }),
3083
- /* @__PURE__ */ e.jsxs(hs, { className: "w-50", children: [
3090
+ /* @__PURE__ */ e.jsxs(ms, { className: "w-50", children: [
3084
3091
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
3085
3092
  /* @__PURE__ */ e.jsx(
3086
- M,
3093
+ I,
3087
3094
  {
3088
- onClick: () => h("bar"),
3095
+ onClick: () => u("bar"),
3089
3096
  className: "font-normal",
3090
3097
  variant: "ghost",
3091
- children: /* @__PURE__ */ e.jsx(qs, { className: "size-5" })
3098
+ children: /* @__PURE__ */ e.jsx(Rs, { className: "size-5" })
3092
3099
  }
3093
3100
  ),
3094
3101
  /* @__PURE__ */ e.jsx(
3095
- M,
3102
+ I,
3096
3103
  {
3097
- onClick: () => h("line"),
3104
+ onClick: () => u("line"),
3098
3105
  variant: "ghost",
3099
- children: /* @__PURE__ */ e.jsx(Rs, { className: "size-5" })
3106
+ children: /* @__PURE__ */ e.jsx(_s, { className: "size-5" })
3100
3107
  }
3101
3108
  ),
3102
3109
  /* @__PURE__ */ e.jsx(
3103
- M,
3110
+ I,
3104
3111
  {
3105
- onClick: () => h("stackedBar"),
3112
+ onClick: () => u("stackedBar"),
3106
3113
  variant: "ghost",
3107
- children: /* @__PURE__ */ e.jsx(Ka, { className: "size-5", strokeWidth: 0 })
3114
+ children: /* @__PURE__ */ e.jsx(Ga, { className: "size-5", strokeWidth: 0 })
3108
3115
  }
3109
3116
  ),
3110
3117
  /* @__PURE__ */ e.jsx(
3111
- M,
3118
+ I,
3112
3119
  {
3113
- onClick: () => h("stackedLine"),
3120
+ onClick: () => u("stackedLine"),
3114
3121
  variant: "ghost",
3115
- children: /* @__PURE__ */ e.jsx(Ga, { className: "size-5", strokeWidth: 0 })
3122
+ children: /* @__PURE__ */ e.jsx(Ua, { className: "size-5", strokeWidth: 0 })
3116
3123
  }
3117
3124
  ),
3118
3125
  /* @__PURE__ */ e.jsx(
3119
- M,
3126
+ I,
3120
3127
  {
3121
- onClick: () => h("scatter"),
3128
+ onClick: () => u("scatter"),
3122
3129
  variant: "ghost",
3123
- children: /* @__PURE__ */ e.jsx(Ia, { className: "size-5" })
3130
+ children: /* @__PURE__ */ e.jsx(Da, { className: "size-5" })
3124
3131
  }
3125
3132
  ),
3126
3133
  /* @__PURE__ */ e.jsx(
3127
- M,
3134
+ I,
3128
3135
  {
3129
- onClick: () => h("bubble"),
3136
+ onClick: () => u("bubble"),
3130
3137
  variant: "ghost",
3131
- children: /* @__PURE__ */ e.jsx(Ua, { className: "size-4" })
3138
+ children: /* @__PURE__ */ e.jsx(Ba, { className: "size-4" })
3132
3139
  }
3133
3140
  ),
3134
3141
  /* @__PURE__ */ e.jsx(
3135
- M,
3142
+ I,
3136
3143
  {
3137
- onClick: () => h("pie"),
3144
+ onClick: () => u("pie"),
3138
3145
  variant: "ghost",
3139
- children: /* @__PURE__ */ e.jsx(Da, { className: "size-5" })
3146
+ children: /* @__PURE__ */ e.jsx(Ma, { className: "size-5" })
3140
3147
  }
3141
3148
  ),
3142
3149
  /* @__PURE__ */ e.jsx(
3143
- M,
3150
+ I,
3144
3151
  {
3145
- onClick: () => h("doughnut"),
3152
+ onClick: () => u("doughnut"),
3146
3153
  variant: "ghost",
3147
- children: /* @__PURE__ */ e.jsx(Pa, { className: "size-5", strokeWidth: 1 })
3154
+ children: /* @__PURE__ */ e.jsx($a, { className: "size-5", strokeWidth: 1 })
3148
3155
  }
3149
3156
  ),
3150
3157
  /* @__PURE__ */ e.jsx(
3151
- M,
3158
+ I,
3152
3159
  {
3153
- onClick: () => h("radar"),
3160
+ onClick: () => u("radar"),
3154
3161
  variant: "ghost",
3155
3162
  children: /* @__PURE__ */ e.jsx(
3156
- $a,
3163
+ Ha,
3157
3164
  {
3158
3165
  className: "size-5 font-extralight",
3159
3166
  strokeWidth: 0.5
@@ -3162,71 +3169,71 @@ function Fl() {
3162
3169
  }
3163
3170
  ),
3164
3171
  /* @__PURE__ */ e.jsx(
3165
- M,
3172
+ I,
3166
3173
  {
3167
- onClick: () => h("polarArea"),
3174
+ onClick: () => u("polarArea"),
3168
3175
  variant: "ghost",
3169
- children: /* @__PURE__ */ e.jsx(Ba, { className: "size-5" })
3176
+ children: /* @__PURE__ */ e.jsx(Pa, { className: "size-5" })
3170
3177
  }
3171
3178
  ),
3172
3179
  /* @__PURE__ */ e.jsx(
3173
- M,
3180
+ I,
3174
3181
  {
3175
- onClick: () => h("pyramid"),
3182
+ onClick: () => u("pyramid"),
3176
3183
  variant: "ghost",
3177
- children: /* @__PURE__ */ e.jsx(Ja, { className: "size-5" })
3184
+ children: /* @__PURE__ */ e.jsx(Qa, { className: "size-5" })
3178
3185
  }
3179
3186
  ),
3180
3187
  /* @__PURE__ */ e.jsx(
3181
- M,
3188
+ I,
3182
3189
  {
3183
- onClick: () => h("range"),
3190
+ onClick: () => u("range"),
3184
3191
  variant: "ghost",
3185
- children: /* @__PURE__ */ e.jsx(Ma, { className: "size-5" })
3192
+ children: /* @__PURE__ */ e.jsx(Oa, { className: "size-5" })
3186
3193
  }
3187
3194
  ),
3188
3195
  /* @__PURE__ */ e.jsx(
3189
- M,
3196
+ I,
3190
3197
  {
3191
- onClick: () => h("table"),
3198
+ onClick: () => u("table"),
3192
3199
  variant: "ghost",
3193
- children: /* @__PURE__ */ e.jsx(Is, { className: "size-5" })
3200
+ children: /* @__PURE__ */ e.jsx(Ts, { className: "size-5" })
3194
3201
  }
3195
3202
  ),
3196
3203
  /* @__PURE__ */ e.jsx(
3197
- M,
3204
+ I,
3198
3205
  {
3199
- onClick: () => h("kpi"),
3206
+ onClick: () => u("kpi"),
3200
3207
  variant: "ghost",
3201
- children: /* @__PURE__ */ e.jsx(Qa, { className: "size-6" })
3208
+ children: /* @__PURE__ */ e.jsx(Ka, { className: "size-6" })
3202
3209
  }
3203
3210
  ),
3204
3211
  /* @__PURE__ */ e.jsx(
3205
- M,
3212
+ I,
3206
3213
  {
3207
- onClick: () => h("text"),
3214
+ onClick: () => u("text"),
3208
3215
  variant: "ghost",
3209
- children: /* @__PURE__ */ e.jsx(_s, { className: "size-4" })
3216
+ children: /* @__PURE__ */ e.jsx(Hs, { className: "size-4" })
3210
3217
  }
3211
3218
  ),
3212
3219
  /* @__PURE__ */ e.jsx(
3213
- M,
3220
+ I,
3214
3221
  {
3215
- onClick: () => h("map"),
3222
+ onClick: () => u("map"),
3216
3223
  variant: "ghost",
3217
- children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4" })
3224
+ children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4" })
3218
3225
  }
3219
3226
  ),
3220
3227
  /* @__PURE__ */ e.jsx(
3221
- M,
3228
+ I,
3222
3229
  {
3223
- onClick: () => h("custom"),
3230
+ onClick: () => u("custom"),
3224
3231
  variant: "ghost",
3225
- children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
3232
+ children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4" })
3226
3233
  }
3227
3234
  )
3228
3235
  ] }),
3229
- /* @__PURE__ */ e.jsx(Il, { onChartTypeChange: h })
3236
+ /* @__PURE__ */ e.jsx(Il, { onChartTypeChange: u })
3230
3237
  ] })
3231
3238
  ] });
3232
3239
  }
@@ -3236,58 +3243,58 @@ function Ll({
3236
3243
  customIcon: a,
3237
3244
  componentName: t
3238
3245
  }) {
3239
- const l = Wa(a || "");
3246
+ const l = Ja(a || "");
3240
3247
  switch (s) {
3241
3248
  case "bar":
3242
- return /* @__PURE__ */ e.jsx(qs, { className: n });
3243
- case "line":
3244
3249
  return /* @__PURE__ */ e.jsx(Rs, { className: n });
3250
+ case "line":
3251
+ return /* @__PURE__ */ e.jsx(_s, { className: n });
3245
3252
  case "pie":
3246
- return /* @__PURE__ */ e.jsx(Da, { className: n });
3253
+ return /* @__PURE__ */ e.jsx(Ma, { className: n });
3247
3254
  case "radar":
3248
- return /* @__PURE__ */ e.jsx($a, { className: n });
3255
+ return /* @__PURE__ */ e.jsx(Ha, { className: n });
3249
3256
  case "scatter":
3250
- return /* @__PURE__ */ e.jsx(Ia, { className: n });
3257
+ return /* @__PURE__ */ e.jsx(Da, { className: n });
3251
3258
  case "bubble":
3252
- return /* @__PURE__ */ e.jsx(Ua, { className: n });
3259
+ return /* @__PURE__ */ e.jsx(Ba, { className: n });
3253
3260
  case "doughnut":
3254
- return /* @__PURE__ */ e.jsx(Pa, { className: n });
3261
+ return /* @__PURE__ */ e.jsx($a, { className: n });
3255
3262
  case "stackedBar":
3256
- return /* @__PURE__ */ e.jsx(Ka, { className: "size-4 text-foreground/70" });
3257
- case "stackedLine":
3258
3263
  return /* @__PURE__ */ e.jsx(Ga, { className: "size-4 text-foreground/70" });
3264
+ case "stackedLine":
3265
+ return /* @__PURE__ */ e.jsx(Ua, { className: "size-4 text-foreground/70" });
3259
3266
  case "polarArea":
3260
- return /* @__PURE__ */ e.jsx(Ba, { className: n });
3267
+ return /* @__PURE__ */ e.jsx(Pa, { className: n });
3261
3268
  case "pyramid":
3262
- return /* @__PURE__ */ e.jsx(Ja, { className: n });
3269
+ return /* @__PURE__ */ e.jsx(Qa, { className: n });
3263
3270
  case "range":
3264
- return /* @__PURE__ */ e.jsx(Ma, { className: n });
3271
+ return /* @__PURE__ */ e.jsx(Oa, { className: n });
3265
3272
  case "kpi":
3266
- return /* @__PURE__ */ e.jsx(Qa, { className: n });
3273
+ return /* @__PURE__ */ e.jsx(Ka, { className: n });
3267
3274
  case "text":
3268
- return /* @__PURE__ */ e.jsx(_s, { className: n });
3275
+ return /* @__PURE__ */ e.jsx(Hs, { className: n });
3269
3276
  case "map":
3270
- return /* @__PURE__ */ e.jsx(Fa, { className: n });
3277
+ return /* @__PURE__ */ e.jsx(Ta, { className: n });
3271
3278
  case "custom":
3272
- return a && l ? /* @__PURE__ */ e.jsx(l, { className: n }) : t ? t == null ? void 0 : t.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(La, { className: n });
3279
+ return a && l ? /* @__PURE__ */ e.jsx(l, { className: n }) : t ? t == null ? void 0 : t.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(Fa, { className: n });
3273
3280
  default:
3274
- return /* @__PURE__ */ e.jsx(Is, { className: n });
3281
+ return /* @__PURE__ */ e.jsx(Ts, { className: n });
3275
3282
  }
3276
3283
  }
3277
3284
  function El() {
3278
3285
  var n;
3279
- const s = u((a) => a.card);
3286
+ const s = d((a) => a.card);
3280
3287
  return (n = s.customCardPreferences) == null || n.showCardHeader, ae(), /* @__PURE__ */ e.jsxs(na, { children: [
3281
- /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3288
+ /* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ia, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3282
3289
  /* @__PURE__ */ e.jsx(ra, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
3283
- Kt,
3290
+ Gt,
3284
3291
  {
3285
3292
  onClick: () => {
3286
- navigator.clipboard.writeText(s.id), Ge.success("Card ID copied to clipboard");
3293
+ navigator.clipboard.writeText(s.id), Ke.success("Card ID copied to clipboard");
3287
3294
  },
3288
3295
  className: "cursor-pointer space-x-2",
3289
3296
  children: [
3290
- /* @__PURE__ */ e.jsx(Qt, { className: "size-5" }),
3297
+ /* @__PURE__ */ e.jsx(Kt, { className: "size-5" }),
3291
3298
  /* @__PURE__ */ e.jsx("span", { children: "Copy Card ID" })
3292
3299
  ]
3293
3300
  }
@@ -3296,14 +3303,14 @@ function El() {
3296
3303
  }
3297
3304
  function sa() {
3298
3305
  var v;
3299
- const s = u((b) => b.frame), n = u((b) => b.card), a = u((b) => b.isShowingVisual), t = u((b) => b.isSqlRunning), l = u((b) => b.pythonStdOut);
3300
- u((b) => b.actions.setRunSql);
3301
- const { setFrame: r, setCard: i, updateCardInFrame: o, setActiveTabCardId: c } = ae(), { data: h, isLoading: d, isFetching: j, error: f } = Me(n);
3306
+ const s = d((j) => j.frame), n = d((j) => j.card), a = d((j) => j.isShowingVisual), t = d((j) => j.isSqlRunning), l = d((j) => j.pythonStdOut);
3307
+ d((j) => j.actions.setRunSql);
3308
+ const { setFrame: r, setCard: i, updateCardInFrame: o, setActiveTabCardId: c } = ae(), { data: u, isLoading: h, isFetching: b, error: f } = De(n);
3302
3309
  if (!n) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3303
3310
  function m() {
3304
- const b = {
3311
+ const j = {
3305
3312
  connectionId: n.connectionId,
3306
- id: Ue(),
3313
+ id: Ge(),
3307
3314
  title: "Title",
3308
3315
  description: "Description",
3309
3316
  preferences: {
@@ -3318,27 +3325,27 @@ function sa() {
3318
3325
  sql: "",
3319
3326
  data: []
3320
3327
  };
3321
- g(b);
3328
+ g(j);
3322
3329
  }
3323
- function g(b) {
3330
+ function g(j) {
3324
3331
  const x = {
3325
3332
  ...s,
3326
- cards: [...s.cards, b],
3327
- activeCardId: b.id
3333
+ cards: [...s.cards, j],
3334
+ activeCardId: j.id
3328
3335
  };
3329
- r(x), c(b.id);
3336
+ r(x), c(j.id);
3330
3337
  }
3331
3338
  function p() {
3332
- const b = {
3339
+ const j = {
3333
3340
  ...n,
3334
- id: Ue(),
3341
+ id: Ge(),
3335
3342
  title: `${n.title} Copy`,
3336
3343
  tabTitle: `${n.tabTitle || n.title} Copy`
3337
3344
  };
3338
- g(b);
3345
+ g(j);
3339
3346
  }
3340
- function N(b) {
3341
- const x = s.cards.filter((q) => q.id !== b), k = x[0], S = {
3347
+ function N(j) {
3348
+ const x = s.cards.filter((R) => R.id !== j), k = x[0], S = {
3342
3349
  ...s,
3343
3350
  cards: x,
3344
3351
  // update the active card to the first card in the frame
@@ -3346,21 +3353,21 @@ function sa() {
3346
3353
  };
3347
3354
  r(S), c(k.id), i(k);
3348
3355
  }
3349
- function y(b) {
3350
- c(b);
3356
+ function y(j) {
3357
+ c(j);
3351
3358
  }
3352
- const A = (b, x) => {
3353
- console.log("handleDragStart", x), b.dataTransfer.setData("tabIndex", x.toString());
3354
- }, I = (b) => {
3355
- b.preventDefault();
3356
- }, O = (b, x) => {
3357
- const k = b.dataTransfer.getData("tabIndex");
3359
+ const q = (j, x) => {
3360
+ console.log("handleDragStart", x), j.dataTransfer.setData("tabIndex", x.toString());
3361
+ }, F = (j) => {
3362
+ j.preventDefault();
3363
+ }, M = (j, x) => {
3364
+ const k = j.dataTransfer.getData("tabIndex");
3358
3365
  if (k === x.toString()) return;
3359
- const S = Array.from(s.cards), [q] = S.splice(parseInt(k), 1);
3360
- S.splice(x, 0, q), r({ ...s, cards: S });
3366
+ const S = Array.from(s.cards), [R] = S.splice(parseInt(k), 1);
3367
+ S.splice(x, 0, R), r({ ...s, cards: S });
3361
3368
  };
3362
- function T(b, x) {
3363
- return b.cards.length === 1 && (x.displayTab === !0 || x.displayTab === void 0) || b.activeCardId !== x.id && (x.displayTab === !0 || x.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3369
+ function O(j, x) {
3370
+ return j.cards.length === 1 && (x.displayTab === !0 || x.displayTab === void 0) || j.activeCardId !== x.id && (x.displayTab === !0 || x.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3364
3371
  "div",
3365
3372
  {
3366
3373
  onClick: () => {
@@ -3370,11 +3377,11 @@ function sa() {
3370
3377
  displayTab: k
3371
3378
  });
3372
3379
  },
3373
- children: x.displayTab === !0 || x.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Xt, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3380
+ children: x.displayTab === !0 || x.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Yt, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(In, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3374
3381
  }
3375
3382
  );
3376
3383
  }
3377
- function F() {
3384
+ function D() {
3378
3385
  return /* @__PURE__ */ e.jsxs(
3379
3386
  va,
3380
3387
  {
@@ -3382,51 +3389,51 @@ function sa() {
3382
3389
  value: s.activeCardId,
3383
3390
  className: "flex grow flex-col",
3384
3391
  children: [
3385
- s.cards.map((b) => /* @__PURE__ */ e.jsx(es, { className: "mt-0 grow", value: b.id, children: R() }, b.id)),
3392
+ s.cards.map((j) => /* @__PURE__ */ e.jsx(ss, { className: "mt-0 grow", value: j.id, children: A() }, j.id)),
3386
3393
  /* @__PURE__ */ e.jsx(Ca, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3387
- s.cards.map((b, x) => /* @__PURE__ */ e.jsx(
3388
- Xe,
3394
+ s.cards.map((j, x) => /* @__PURE__ */ e.jsx(
3395
+ Ze,
3389
3396
  {
3390
- text: b.tabTitle || b.title,
3397
+ text: j.tabTitle || j.title,
3391
3398
  onSave: (k) => {
3392
3399
  i({ ...n, tabTitle: k }), o({ ...n, tabTitle: k });
3393
3400
  },
3394
3401
  children: /* @__PURE__ */ e.jsxs(
3395
- Ze,
3402
+ es,
3396
3403
  {
3397
3404
  draggable: !0,
3398
- onDragStart: (k) => A(k, x),
3399
- onDragOver: I,
3400
- onDrop: (k) => O(k, x),
3405
+ onDragStart: (k) => q(k, x),
3406
+ onDragOver: F,
3407
+ onDrop: (k) => M(k, x),
3401
3408
  className: "",
3402
- value: b.id,
3409
+ value: j.id,
3403
3410
  children: [
3404
- T(s, b),
3405
- b.tabTitle || b.title,
3406
- s.activeCardId === b.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3407
- Sa,
3411
+ O(s, j),
3412
+ j.tabTitle || j.title,
3413
+ s.activeCardId === j.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
3414
+ Na,
3408
3415
  {
3409
3416
  className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
3410
- onClick: () => N(b.id)
3417
+ onClick: () => N(j.id)
3411
3418
  }
3412
3419
  )
3413
3420
  ]
3414
3421
  }
3415
3422
  )
3416
3423
  },
3417
- b.id
3424
+ j.id
3418
3425
  )),
3419
3426
  /* @__PURE__ */ e.jsx(
3420
- M,
3427
+ I,
3421
3428
  {
3422
3429
  className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
3423
3430
  variant: "outline",
3424
3431
  onClick: m,
3425
- children: /* @__PURE__ */ e.jsx(Ss, { className: "h-4 w-4" })
3432
+ children: /* @__PURE__ */ e.jsx(ws, { className: "h-4 w-4" })
3426
3433
  }
3427
3434
  ),
3428
3435
  /* @__PURE__ */ e.jsx(
3429
- M,
3436
+ I,
3430
3437
  {
3431
3438
  className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
3432
3439
  variant: "outline",
@@ -3439,18 +3446,18 @@ function sa() {
3439
3446
  }
3440
3447
  );
3441
3448
  }
3442
- function R() {
3443
- return n.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Jt, { card: n, data: h == null ? void 0 : h.records }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(fe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3444
- Wt,
3449
+ function A() {
3450
+ return n.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Qt, { card: n, data: u == null ? void 0 : u.records }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(fe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3451
+ Jt,
3445
3452
  {
3446
3453
  isLoading: t,
3447
3454
  card: n,
3448
- data: h == null ? void 0 : h.records
3455
+ data: u == null ? void 0 : u.records
3449
3456
  }
3450
- ) }) }) }) : /* @__PURE__ */ e.jsx(cs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ha, { className: "grow border-none shadow-none" }) });
3457
+ ) }) }) }) : /* @__PURE__ */ e.jsx(ds, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(_a, { className: "grow border-none shadow-none" }) });
3451
3458
  }
3452
3459
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
3453
- (d || j) && /* @__PURE__ */ e.jsx("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e.jsx(Ae, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
3460
+ (h || b) && /* @__PURE__ */ e.jsx("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e.jsx(qe, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
3454
3461
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3455
3462
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3456
3463
  /* @__PURE__ */ e.jsx(Fl, {}),
@@ -3459,15 +3466,15 @@ function sa() {
3459
3466
  ] }),
3460
3467
  /* @__PURE__ */ e.jsx(Al, {})
3461
3468
  ] }),
3462
- a ? F() : /* @__PURE__ */ e.jsxs(
3463
- ss,
3469
+ a ? D() : /* @__PURE__ */ e.jsxs(
3470
+ as,
3464
3471
  {
3465
3472
  className: "px-6",
3466
3473
  direction: "horizontal",
3467
3474
  children: [
3468
3475
  l && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3469
3476
  /* @__PURE__ */ e.jsx(
3470
- be,
3477
+ ye,
3471
3478
  {
3472
3479
  id: "1",
3473
3480
  order: 1,
@@ -3477,19 +3484,19 @@ function sa() {
3477
3484
  children: l && /* @__PURE__ */ e.jsx(Vl, {})
3478
3485
  }
3479
3486
  ),
3480
- /* @__PURE__ */ e.jsx(as, {})
3487
+ /* @__PURE__ */ e.jsx(ts, {})
3481
3488
  ] }),
3482
3489
  /* @__PURE__ */ e.jsx(
3483
- be,
3490
+ ye,
3484
3491
  {
3485
3492
  id: "2",
3486
3493
  order: 2,
3487
3494
  minSize: 10,
3488
3495
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3489
3496
  children: /* @__PURE__ */ e.jsxs(fe, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
3490
- (h == null ? void 0 : h.records) && (h == null ? void 0 : h.records.length) > 0 && /* @__PURE__ */ e.jsx(wl, { data: (h == null ? void 0 : h.records) || [] }),
3491
- (f || (h == null ? void 0 : h.error)) && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: (f == null ? void 0 : f.message) || ((v = h == null ? void 0 : h.error) == null ? void 0 : v.message) }),
3492
- /* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
3497
+ (u == null ? void 0 : u.records) && (u == null ? void 0 : u.records.length) > 0 && /* @__PURE__ */ e.jsx(wl, { data: (u == null ? void 0 : u.records) || [] }),
3498
+ (f || (u == null ? void 0 : u.error)) && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: (f == null ? void 0 : f.message) || ((v = u == null ? void 0 : u.error) == null ? void 0 : v.message) }),
3499
+ /* @__PURE__ */ e.jsx(Qe, { orientation: "horizontal" })
3493
3500
  ] })
3494
3501
  }
3495
3502
  )
@@ -3499,25 +3506,25 @@ function sa() {
3499
3506
  ] });
3500
3507
  }
3501
3508
  function Vl() {
3502
- const s = u((a) => a.pythonStdOut);
3509
+ const s = d((a) => a.pythonStdOut);
3503
3510
  if (!s) return null;
3504
3511
  const n = s.replace(/\n/g, "<br>");
3505
3512
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full flex-col border-r", children: [
3506
3513
  /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center border-b bg-muted px-3 font-mono text-xs font-semibold text-foreground/70", children: "Python Output" }),
3507
3514
  /* @__PURE__ */ e.jsxs(fe, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
3508
3515
  /* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: n } }),
3509
- /* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
3516
+ /* @__PURE__ */ e.jsx(Qe, { orientation: "horizontal" })
3510
3517
  ] })
3511
3518
  ] });
3512
3519
  }
3513
3520
  function Al() {
3514
- const s = u((a) => a.isShowingVisual), n = u(
3521
+ const s = d((a) => a.isShowingVisual), n = d(
3515
3522
  (a) => a.actions.setIsShowingVisual
3516
3523
  );
3517
3524
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3518
3525
  /* @__PURE__ */ e.jsx($, { htmlFor: "visualize", children: "Chart" }),
3519
3526
  /* @__PURE__ */ e.jsx(
3520
- Yt,
3527
+ Wt,
3521
3528
  {
3522
3529
  checked: s,
3523
3530
  onCheckedChange: () => n(!s),
@@ -3533,14 +3540,14 @@ function ql({
3533
3540
  onValueChange: a
3534
3541
  }) {
3535
3542
  return /* @__PURE__ */ e.jsx(
3536
- ms,
3543
+ xs,
3537
3544
  {
3538
3545
  value: n,
3539
3546
  onValueChange: a,
3540
3547
  className: "flex gap-4",
3541
3548
  defaultValue: s[0].value,
3542
3549
  children: s.map((t) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3543
- /* @__PURE__ */ e.jsx(Oe, { value: t.value, id: t.value }),
3550
+ /* @__PURE__ */ e.jsx(Me, { value: t.value, id: t.value }),
3544
3551
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: t.value, children: t.label })
3545
3552
  ] }, t.value))
3546
3553
  }
@@ -3561,13 +3568,13 @@ function de({
3561
3568
  children: /* @__PURE__ */ e.jsx(me, { placeholder: s })
3562
3569
  }
3563
3570
  ),
3564
- /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
3571
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3565
3572
  /* @__PURE__ */ e.jsx(pe, { children: s }),
3566
3573
  n.map((r) => /* @__PURE__ */ e.jsx(Z, { value: r.value, children: r.label }, r.value))
3567
3574
  ] }) })
3568
3575
  ] });
3569
3576
  }
3570
- function Pe({
3577
+ function Be({
3571
3578
  children: s,
3572
3579
  summary: n,
3573
3580
  open: a,
@@ -3581,7 +3588,7 @@ function Pe({
3581
3588
  children: [
3582
3589
  /* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
3583
3590
  /* @__PURE__ */ e.jsx($, { children: n }),
3584
- /* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4" })
3591
+ /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4" })
3585
3592
  ] }),
3586
3593
  /* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
3587
3594
  ]
@@ -3590,104 +3597,104 @@ function Pe({
3590
3597
  }
3591
3598
  function Rl() {
3592
3599
  var p, N;
3593
- const s = u(
3600
+ const s = d(
3594
3601
  (y) => y.card.customCardPreferences
3595
- ), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((y) => y.card), l = u((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ae(), { components: o, manifest: c } = ga(
3602
+ ), { data: n } = Wa(), a = (n == null ? void 0 : n.plugins) || [], t = d((y) => y.card), l = d((y) => y.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ae(), { components: o, manifest: c } = ga(
3596
3603
  (s == null ? void 0 : s.url) || ""
3597
- ), h = (p = c == null ? void 0 : c.visuals) == null ? void 0 : p.find(
3604
+ ), u = (p = c == null ? void 0 : c.visuals) == null ? void 0 : p.find(
3598
3605
  (y) => y.name === (s == null ? void 0 : s.componentName)
3599
3606
  );
3600
- function d(y, A) {
3607
+ function h(y, q) {
3601
3608
  if (!s) return;
3602
- const O = {
3609
+ const M = {
3603
3610
  ...(s == null ? void 0 : s.dataInputCardIds) || {},
3604
3611
  [y]: {
3605
- cardId: A,
3612
+ cardId: q,
3606
3613
  hookRef: null
3607
3614
  }
3608
3615
  };
3609
3616
  i({
3610
3617
  ...s,
3611
- dataInputCardIds: O
3618
+ dataInputCardIds: M
3612
3619
  });
3613
3620
  }
3614
- function j(y) {
3615
- var I, O;
3616
- const A = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((T) => {
3617
- var F;
3618
- return ((F = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : F.visualType) !== "multiple";
3619
- }).map((T) => ({
3620
- value: T.id,
3621
- label: T.tabTitle || T.title
3621
+ function b(y) {
3622
+ var F, M;
3623
+ const q = (F = l == null ? void 0 : l.cards) == null ? void 0 : F.filter((O) => {
3624
+ var D;
3625
+ return ((D = O == null ? void 0 : O.customCardPreferences) == null ? void 0 : D.visualType) !== "multiple";
3626
+ }).map((O) => ({
3627
+ value: O.id,
3628
+ label: O.tabTitle || O.title
3622
3629
  }));
3623
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (O = y == null ? void 0 : y.dataInputs) == null ? void 0 : O.map((T, F) => {
3624
- var R, v;
3630
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (M = y == null ? void 0 : y.dataInputs) == null ? void 0 : M.map((O, D) => {
3631
+ var A, v;
3625
3632
  return /* @__PURE__ */ e.jsxs(
3626
3633
  "div",
3627
3634
  {
3628
3635
  className: "grid grid-cols-10 gap-2",
3629
3636
  children: [
3630
- /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: T }),
3637
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: O }),
3631
3638
  /* @__PURE__ */ e.jsx(
3632
3639
  de,
3633
3640
  {
3634
3641
  className: "col-span-6 h-8 w-full justify-between",
3635
3642
  label: "",
3636
- options: A || [],
3637
- value: ((v = (R = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : R[F]) == null ? void 0 : v.cardId) || "",
3638
- onValueChange: (b) => d(F, b)
3643
+ options: q || [],
3644
+ value: ((v = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[D]) == null ? void 0 : v.cardId) || "",
3645
+ onValueChange: (j) => h(D, j)
3639
3646
  }
3640
3647
  )
3641
3648
  ]
3642
3649
  },
3643
- F + Math.random()
3650
+ D + Math.random()
3644
3651
  );
3645
3652
  }) });
3646
3653
  }
3647
- function f(y, A, I = []) {
3648
- var O, T;
3654
+ function f(y, q, F = []) {
3655
+ var M, O;
3649
3656
  return s ? y === "input" ? /* @__PURE__ */ e.jsx(
3650
3657
  ie,
3651
3658
  {
3652
- className: `h-8 w-full ${$e}`,
3653
- value: ((O = s == null ? void 0 : s.settings) == null ? void 0 : O[A]) || "",
3654
- onChange: (F) => {
3659
+ className: `h-8 w-full ${Pe}`,
3660
+ value: ((M = s == null ? void 0 : s.settings) == null ? void 0 : M[q]) || "",
3661
+ onChange: (D) => {
3655
3662
  i({
3656
3663
  ...s,
3657
3664
  settings: {
3658
3665
  ...s == null ? void 0 : s.settings,
3659
- [A]: F.target.value
3666
+ [q]: D.target.value
3660
3667
  }
3661
3668
  });
3662
3669
  }
3663
3670
  },
3664
- A
3671
+ q
3665
3672
  ) : y === "select" ? /* @__PURE__ */ e.jsx(
3666
3673
  de,
3667
3674
  {
3668
3675
  className: "h-8 w-full",
3669
3676
  label: "",
3670
- options: I,
3671
- value: ((T = s == null ? void 0 : s.settings) == null ? void 0 : T[A]) || "",
3672
- onValueChange: (F) => {
3677
+ options: F,
3678
+ value: ((O = s == null ? void 0 : s.settings) == null ? void 0 : O[q]) || "",
3679
+ onValueChange: (D) => {
3673
3680
  i({
3674
3681
  ...s,
3675
- settings: { ...s == null ? void 0 : s.settings, [A]: F }
3682
+ settings: { ...s == null ? void 0 : s.settings, [q]: D }
3676
3683
  });
3677
3684
  }
3678
3685
  }
3679
3686
  ) : null : null;
3680
3687
  }
3681
3688
  function m(y) {
3682
- const A = Object.entries((y == null ? void 0 : y.settings) || {});
3683
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: A.map(([I, O]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3684
- /* @__PURE__ */ e.jsx($, { children: O.title }),
3689
+ const q = Object.entries((y == null ? void 0 : y.settings) || {});
3690
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: q.map(([F, M]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3691
+ /* @__PURE__ */ e.jsx($, { children: M.title }),
3685
3692
  f(
3686
- O.ui,
3687
- I,
3688
- O.options
3693
+ M.ui,
3694
+ F,
3695
+ M.options
3689
3696
  )
3690
- ] }, I)) });
3697
+ ] }, F)) });
3691
3698
  }
3692
3699
  function g(y) {
3693
3700
  s && i({
@@ -3701,7 +3708,7 @@ function Rl() {
3701
3708
  {
3702
3709
  className: "p-6",
3703
3710
  children: [
3704
- /* @__PURE__ */ e.jsx(Pe, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
3711
+ /* @__PURE__ */ e.jsx(Be, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
3705
3712
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
3706
3713
  de,
3707
3714
  {
@@ -3753,42 +3760,42 @@ function Rl() {
3753
3760
  ) })
3754
3761
  ] }) })
3755
3762
  ] }) }) }),
3756
- /* @__PURE__ */ e.jsx(ve, { className: "my-4" }),
3757
- ((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs(Pe, { summary: "Component Settings", children: [
3758
- h && h.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3763
+ /* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
3764
+ ((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs(Be, { summary: "Component Settings", children: [
3765
+ u && u.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3759
3766
  /* @__PURE__ */ e.jsx($, { children: "Input Mapping" }),
3760
- /* @__PURE__ */ e.jsx("div", { className: "px-2", children: j(h) })
3767
+ /* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(u) })
3761
3768
  ] }),
3762
- h && h.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: m(h) }) })
3769
+ u && u.settings && /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: m(u) }) })
3763
3770
  ] })
3764
3771
  ]
3765
3772
  }
3766
3773
  );
3767
3774
  }
3768
- function Ie() {
3775
+ function Te() {
3769
3776
  const [s, n] = _([]);
3770
- u(
3771
- (d) => d.card.cfg
3777
+ d(
3778
+ (h) => h.card.cfg
3772
3779
  );
3773
- const a = u((d) => d.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: r } = u((d) => d.actions), i = u(
3774
- (d) => d.queryResultColumns
3780
+ const a = d((h) => h.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: r } = d((h) => h.actions), i = d(
3781
+ (h) => h.queryResultColumns
3775
3782
  );
3776
- u(
3777
- (d) => {
3778
- var j;
3779
- return (j = d.card.preferences) == null ? void 0 : j.filterOnClickColumnIndex;
3783
+ d(
3784
+ (h) => {
3785
+ var b;
3786
+ return (b = h.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
3780
3787
  }
3781
3788
  ), se(() => {
3782
3789
  i && n(new Array(i.length).fill(!1));
3783
3790
  }, [i]);
3784
- function o(d, j) {
3791
+ function o(h, b) {
3785
3792
  var f, m;
3786
- j ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ? r({
3793
+ b ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ? r({
3787
3794
  ...a,
3788
3795
  onClickFilter: [
3789
3796
  ...a.onClickFilter,
3790
3797
  {
3791
- columnIndex: d,
3798
+ columnIndex: h,
3792
3799
  expression: ""
3793
3800
  }
3794
3801
  ]
@@ -3796,39 +3803,39 @@ function Ie() {
3796
3803
  ...a,
3797
3804
  onClickFilter: [
3798
3805
  {
3799
- columnIndex: d,
3806
+ columnIndex: h,
3800
3807
  expression: ""
3801
3808
  }
3802
3809
  ]
3803
3810
  }) : (r({
3804
3811
  ...a,
3805
3812
  onClickFilter: (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.filter(
3806
- (g) => g.columnIndex !== d
3813
+ (g) => g.columnIndex !== h
3807
3814
  )
3808
3815
  }), n((g) => {
3809
3816
  const p = [...g];
3810
- return p[d] = !1, p;
3817
+ return p[h] = !1, p;
3811
3818
  }));
3812
3819
  }
3813
- function c(d, j) {
3820
+ function c(h, b) {
3814
3821
  var m;
3815
- const f = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.map((g) => g.columnIndex === d ? {
3822
+ const f = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.map((g) => g.columnIndex === h ? {
3816
3823
  ...g,
3817
- expression: j.target.value
3824
+ expression: b.target.value
3818
3825
  } : g);
3819
3826
  r({
3820
3827
  ...a,
3821
3828
  onClickFilter: f
3822
3829
  });
3823
3830
  }
3824
- function h(d) {
3825
- var j, f, m, g;
3826
- if (s != null && s[d] || (f = (j = a == null ? void 0 : a.onClickFilter) == null ? void 0 : j.find((p) => p.columnIndex === d)) != null && f.expression)
3831
+ function u(h) {
3832
+ var b, f, m, g;
3833
+ if (s != null && s[h] || (f = (b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.find((p) => p.columnIndex === h)) != null && f.expression)
3827
3834
  return /* @__PURE__ */ e.jsx(
3828
3835
  ie,
3829
3836
  {
3830
- value: (g = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find((p) => p.columnIndex === d)) == null ? void 0 : g.expression,
3831
- onChange: (p) => c(d, p),
3837
+ value: (g = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find((p) => p.columnIndex === h)) == null ? void 0 : g.expression,
3838
+ onChange: (p) => c(h, p),
3832
3839
  type: "text",
3833
3840
  className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3834
3841
  placeholder: "Expression"
@@ -3837,7 +3844,7 @@ function Ie() {
3837
3844
  }
3838
3845
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3839
3846
  /* @__PURE__ */ e.jsx($, { children: "On Click" }),
3840
- i == null ? void 0 : i.map((d, j) => {
3847
+ i == null ? void 0 : i.map((h, b) => {
3841
3848
  var f, m;
3842
3849
  return /* @__PURE__ */ e.jsx(
3843
3850
  "div",
@@ -3846,55 +3853,55 @@ function Ie() {
3846
3853
  children: /* @__PURE__ */ e.jsxs("div", { className: "grow", children: [
3847
3854
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 py-2", children: [
3848
3855
  /* @__PURE__ */ e.jsx(
3849
- Vs,
3856
+ As,
3850
3857
  {
3851
3858
  checked: !!((f = a == null ? void 0 : a.onClickFilter) != null && f.find(
3852
- (g) => g.columnIndex === j
3859
+ (g) => g.columnIndex === b
3853
3860
  )),
3854
- onCheckedChange: (g) => o(j, g)
3861
+ onCheckedChange: (g) => o(b, g)
3855
3862
  }
3856
3863
  ),
3857
3864
  /* @__PURE__ */ e.jsx(
3858
3865
  "label",
3859
3866
  {
3860
3867
  className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
3861
- children: d
3868
+ children: h
3862
3869
  }
3863
3870
  ),
3864
3871
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find(
3865
- (g) => g.columnIndex === j
3872
+ (g) => g.columnIndex === b
3866
3873
  )) && /* @__PURE__ */ e.jsx(
3867
3874
  ia,
3868
3875
  {
3869
3876
  onClick: () => {
3870
3877
  n((g) => {
3871
3878
  const p = [...g];
3872
- return p[j] = !g[j], p;
3879
+ return p[b] = !g[b], p;
3873
3880
  });
3874
3881
  },
3875
3882
  className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
3876
3883
  }
3877
3884
  ) })
3878
3885
  ] }),
3879
- h(j)
3886
+ u(b)
3880
3887
  ] })
3881
3888
  },
3882
- d
3889
+ h
3883
3890
  );
3884
3891
  })
3885
3892
  ] });
3886
3893
  }
3887
- function xs() {
3894
+ function ps() {
3888
3895
  var i, o, c;
3889
- const s = u((h) => h.card.preferences), n = u(
3890
- (h) => h.card.cfg
3891
- ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = u((h) => h.actions);
3896
+ const s = d((u) => u.card.preferences), n = d(
3897
+ (u) => u.card.cfg
3898
+ ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = d((u) => u.actions);
3892
3899
  (i = n == null ? void 0 : n.options) != null && i.indexAxis;
3893
- function r(h) {
3894
- l(h);
3900
+ function r(u) {
3901
+ l(u);
3895
3902
  }
3896
3903
  return /* @__PURE__ */ e.jsxs(
3897
- ms,
3904
+ xs,
3898
3905
  {
3899
3906
  value: ((o = s == null ? void 0 : s.chartOptions) == null ? void 0 : o.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
3900
3907
  onValueChange: r,
@@ -3902,57 +3909,57 @@ function xs() {
3902
3909
  defaultValue: "x",
3903
3910
  children: [
3904
3911
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3905
- /* @__PURE__ */ e.jsx(Oe, { value: "x", id: "r1" }),
3912
+ /* @__PURE__ */ e.jsx(Me, { value: "x", id: "r1" }),
3906
3913
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
3907
3914
  ] }),
3908
3915
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3909
- /* @__PURE__ */ e.jsx(Oe, { value: "y", id: "r2" }),
3916
+ /* @__PURE__ */ e.jsx(Me, { value: "y", id: "r2" }),
3910
3917
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
3911
3918
  ] })
3912
3919
  ]
3913
3920
  }
3914
3921
  );
3915
3922
  }
3916
- const We = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
3923
+ const Ye = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
3917
3924
  function aa(s, n) {
3918
3925
  var t, l, r;
3919
- const a = wa(s, n);
3926
+ const a = Sa(s, n);
3920
3927
  return ((r = (l = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : l[a]) == null ? void 0 : r.type) || "linear";
3921
3928
  }
3922
- function Xa() {
3929
+ function Ya() {
3923
3930
  var ee, U, te, z, E, Y;
3924
- const [s, n] = _(!1), a = u((V) => {
3931
+ const [s, n] = _(!1), a = d((V) => {
3925
3932
  var L;
3926
3933
  return (L = V.card) == null ? void 0 : L.preferences;
3927
- }), t = u((V) => {
3934
+ }), t = d((V) => {
3928
3935
  var L;
3929
3936
  return (L = V.card) == null ? void 0 : L.cfg;
3930
- }), l = wa(a, t), [r, i] = _(
3937
+ }), l = Sa(a, t), [r, i] = _(
3931
3938
  aa(a)
3932
3939
  ), [o, c] = _(
3933
3940
  ((te = (U = (ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : U[l]) == null ? void 0 : te.min) || ""
3934
- ), [h, d] = _(
3941
+ ), [u, h] = _(
3935
3942
  ((Y = (E = (z = a == null ? void 0 : a.chartOptions) == null ? void 0 : z.scales) == null ? void 0 : E[l]) == null ? void 0 : Y.max) || ""
3936
- ), [j, f] = _(o || h ? "custom" : "auto"), [m, g] = _(""), [p, N] = _(0), [y, A] = _(""), [I, O] = _(""), [T, F] = _(""), R = u(
3943
+ ), [b, f] = _(o || u ? "custom" : "auto"), [m, g] = _(""), [p, N] = _(0), [y, q] = _(""), [F, M] = _(""), [O, D] = _(""), A = d(
3937
3944
  (V) => V.actions.setCardPreferences
3938
- ), { updateCardInFrame: v } = ae(), b = u((V) => V.card), x = u((V) => {
3945
+ ), { updateCardInFrame: v } = ae(), j = d((V) => V.card), x = d((V) => {
3939
3946
  var L;
3940
3947
  return (L = V.card) == null ? void 0 : L.type;
3941
3948
  }), k = ["pie", "doughnut", "polarArea"].includes(x);
3942
3949
  se(() => {
3943
- var V, L, ne, B, X, le, Te, Fe, Se, Le, Ee, Ve, we, w;
3950
+ var V, L, ne, B, X, le, Fe, Le, we, Ee, Ve, Ae, ke, w;
3944
3951
  i(aa(a)), c(
3945
3952
  ((ne = (L = (V = a == null ? void 0 : a.chartOptions) == null ? void 0 : V.scales) == null ? void 0 : L[l]) == null ? void 0 : ne.min) === 0 ? 0 : ""
3946
- ), d(((le = (X = (B = a == null ? void 0 : a.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : X[l]) == null ? void 0 : le.max) || ""), g(
3947
- ((Le = (Se = (Fe = (Te = a == null ? void 0 : a.chartOptions) == null ? void 0 : Te.scales) == null ? void 0 : Fe[l]) == null ? void 0 : Se.ticks) == null ? void 0 : Le.stepSize) || ""
3948
- ), N(((Ee = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ee.decimalPlaces) || 0), A(((Ve = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ve.suffix) || ""), O(((we = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : we.currency) || ""), F(((w = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : w.locale) || "");
3953
+ ), h(((le = (X = (B = a == null ? void 0 : a.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : X[l]) == null ? void 0 : le.max) || ""), g(
3954
+ ((Ee = (we = (Le = (Fe = a == null ? void 0 : a.chartOptions) == null ? void 0 : Fe.scales) == null ? void 0 : Le[l]) == null ? void 0 : we.ticks) == null ? void 0 : Ee.stepSize) || ""
3955
+ ), N(((Ve = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ve.decimalPlaces) || 0), q(((Ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ae.suffix) || ""), M(((ke = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ke.currency) || ""), D(((w = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : w.locale) || "");
3949
3956
  }, [s, a, l]);
3950
3957
  function S(V, L) {
3951
3958
  return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(V);
3952
3959
  }
3953
- function q() {
3960
+ function R() {
3954
3961
  const V = [
3955
- ...new Set(ts.map((L) => L.currency))
3962
+ ...new Set(ns.map((L) => L.currency))
3956
3963
  ];
3957
3964
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3958
3965
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
@@ -3974,11 +3981,11 @@ function Xa() {
3974
3981
  /* @__PURE__ */ e.jsxs(
3975
3982
  ue,
3976
3983
  {
3977
- value: I || "none",
3978
- onValueChange: (L) => O(L === "none" ? "" : L),
3984
+ value: F || "none",
3985
+ onValueChange: (L) => M(L === "none" ? "" : L),
3979
3986
  children: [
3980
3987
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
3981
- /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
3988
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3982
3989
  /* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
3983
3990
  /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }),
3984
3991
  V.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L, children: L }, L))
@@ -3986,7 +3993,7 @@ function Xa() {
3986
3993
  ]
3987
3994
  }
3988
3995
  ),
3989
- /* @__PURE__ */ e.jsxs(ue, { value: T, onValueChange: (L) => F(L), children: [
3996
+ /* @__PURE__ */ e.jsxs(ue, { value: O, onValueChange: (L) => D(L), children: [
3990
3997
  /* @__PURE__ */ e.jsx(
3991
3998
  he,
3992
3999
  {
@@ -3994,9 +4001,9 @@ function Xa() {
3994
4001
  children: /* @__PURE__ */ e.jsx(me, {})
3995
4002
  }
3996
4003
  ),
3997
- /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
4004
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
3998
4005
  /* @__PURE__ */ e.jsx(pe, { children: "Locale" }),
3999
- ts.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L.locale, children: L.locale }, L.locale))
4006
+ ns.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L.locale, children: L.locale }, L.locale))
4000
4007
  ] }) })
4001
4008
  ] })
4002
4009
  ] }),
@@ -4008,7 +4015,7 @@ function Xa() {
4008
4015
  value: p,
4009
4016
  onChange: (L) => N(Number(L.target.value)),
4010
4017
  id: "format",
4011
- className: `col-span-6 h-8 w-full tracking-wide ${We}`
4018
+ className: `col-span-6 h-8 w-full tracking-wide ${Ye}`
4012
4019
  }
4013
4020
  )
4014
4021
  ] })
@@ -4024,16 +4031,16 @@ function Xa() {
4024
4031
  id: "min",
4025
4032
  value: o,
4026
4033
  onChange: (V) => c((L) => S(L, V.target.value)),
4027
- className: `col-span-1 h-8 w-full ${We}`
4034
+ className: `col-span-1 h-8 w-full ${Ye}`
4028
4035
  }
4029
4036
  ),
4030
4037
  /* @__PURE__ */ e.jsx(
4031
4038
  ie,
4032
4039
  {
4033
- value: h,
4034
- onChange: (V) => d((L) => S(L, V.target.value)),
4040
+ value: u,
4041
+ onChange: (V) => h((L) => S(L, V.target.value)),
4035
4042
  id: "max",
4036
- className: `col-span-1 h-8 w-full ${We}`
4043
+ className: `col-span-1 h-8 w-full ${Ye}`
4037
4044
  }
4038
4045
  )
4039
4046
  ] }),
@@ -4045,7 +4052,7 @@ function Xa() {
4045
4052
  value: m,
4046
4053
  onChange: (V) => g((L) => S(L, V.target.value)),
4047
4054
  id: "step-size",
4048
- className: `col-span-1 h-8 w-full ${We}`
4055
+ className: `col-span-1 h-8 w-full ${Ye}`
4049
4056
  }
4050
4057
  )
4051
4058
  ] })
@@ -4054,9 +4061,9 @@ function Xa() {
4054
4061
  function G() {
4055
4062
  var B;
4056
4063
  let V = {};
4057
- j === "custom" && (V = {
4064
+ b === "custom" && (V = {
4058
4065
  min: o,
4059
- max: h,
4066
+ max: u,
4060
4067
  ticks: {
4061
4068
  stepSize: m
4062
4069
  }
@@ -4077,20 +4084,20 @@ function Xa() {
4077
4084
  numberAxisFormat: {
4078
4085
  decimalPlaces: p,
4079
4086
  suffix: y,
4080
- currency: I,
4081
- locale: T
4087
+ currency: F,
4088
+ locale: O
4082
4089
  }
4083
4090
  };
4084
- console.log(L), R(L);
4091
+ console.log(L), A(L);
4085
4092
  const ne = {
4086
- ...b,
4093
+ ...j,
4087
4094
  preferences: L
4088
4095
  };
4089
4096
  v(ne);
4090
4097
  }
4091
- return /* @__PURE__ */ e.jsxs(ds, { onOpenChange: (V) => n(V), children: [
4092
- /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(en, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4093
- /* @__PURE__ */ e.jsx(hs, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
4098
+ return /* @__PURE__ */ e.jsxs(us, { onOpenChange: (V) => n(V), children: [
4099
+ /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Zt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4100
+ /* @__PURE__ */ e.jsx(ms, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
4094
4101
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4095
4102
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
4096
4103
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
@@ -4106,7 +4113,7 @@ function Xa() {
4106
4113
  onValueChange: (V) => i(V),
4107
4114
  children: [
4108
4115
  /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4109
- /* @__PURE__ */ e.jsx(xe, { id: "type", children: /* @__PURE__ */ e.jsxs(ye, { children: [
4116
+ /* @__PURE__ */ e.jsx(xe, { id: "type", children: /* @__PURE__ */ e.jsxs(ve, { children: [
4110
4117
  /* @__PURE__ */ e.jsx(pe, { children: "Option" }),
4111
4118
  /* @__PURE__ */ e.jsx(Z, { value: "linear", children: "Linear" }),
4112
4119
  /* @__PURE__ */ e.jsx(Z, { value: "logarithmic", children: "Logarithmic" })
@@ -4118,32 +4125,32 @@ function Xa() {
4118
4125
  r == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
4119
4126
  /* @__PURE__ */ e.jsx($, { htmlFor: "scale-option", children: "Setup" }),
4120
4127
  /* @__PURE__ */ e.jsxs(
4121
- ms,
4128
+ xs,
4122
4129
  {
4123
4130
  disabled: k,
4124
4131
  id: "scale-option",
4125
- value: j,
4132
+ value: b,
4126
4133
  onValueChange: (V) => f(V),
4127
4134
  className: "col-span-2 flex gap-3",
4128
4135
  defaultValue: "x",
4129
4136
  children: [
4130
4137
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4131
- /* @__PURE__ */ e.jsx(Oe, { value: "auto", id: "r1" }),
4138
+ /* @__PURE__ */ e.jsx(Me, { value: "auto", id: "r1" }),
4132
4139
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
4133
4140
  ] }),
4134
4141
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4135
- /* @__PURE__ */ e.jsx(Oe, { value: "custom", id: "r2" }),
4142
+ /* @__PURE__ */ e.jsx(Me, { value: "custom", id: "r2" }),
4136
4143
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
4137
4144
  ] })
4138
4145
  ]
4139
4146
  }
4140
4147
  )
4141
4148
  ] }),
4142
- j === "custom" && r == "linear" && P(),
4143
- q(),
4144
- /* @__PURE__ */ e.jsx(sn, {}),
4149
+ b === "custom" && r == "linear" && P(),
4150
+ R(),
4151
+ /* @__PURE__ */ e.jsx(en, {}),
4145
4152
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
4146
- M,
4153
+ I,
4147
4154
  {
4148
4155
  onClick: G,
4149
4156
  variant: "secondary",
@@ -4157,20 +4164,20 @@ function Xa() {
4157
4164
  }
4158
4165
  function _l({ idx: s }) {
4159
4166
  var o;
4160
- const n = u((c) => {
4161
- var h;
4162
- return (h = c.card) == null ? void 0 : h.preferences;
4163
- }), a = u(
4167
+ const n = d((c) => {
4168
+ var u;
4169
+ return (u = c.card) == null ? void 0 : u.preferences;
4170
+ }), a = d(
4164
4171
  (c) => {
4165
- var h;
4166
- return (h = c.card.preferences) == null ? void 0 : h.datasetOptions;
4172
+ var u;
4173
+ return (u = c.card.preferences) == null ? void 0 : u.datasetOptions;
4167
4174
  }
4168
- ), t = u(
4175
+ ), t = d(
4169
4176
  (c) => c.actions.setCardPreferences
4170
4177
  ), l = (o = n == null ? void 0 : n.chartOptions) == null ? void 0 : o.indexAxis, r = a == null ? void 0 : a.find((c) => c.idx === s);
4171
- function i(c, h) {
4172
- (c === "end" || c === "start") && an(tn());
4173
- const d = {
4178
+ function i(c, u) {
4179
+ (c === "end" || c === "start") && sn(an());
4180
+ const h = {
4174
4181
  display: c !== "none",
4175
4182
  align: c,
4176
4183
  anchor: c,
@@ -4182,16 +4189,16 @@ function _l({ idx: s }) {
4182
4189
  datasetOptions: [
4183
4190
  ...a || [],
4184
4191
  {
4185
- idx: h,
4186
- datalabels: d
4192
+ idx: u,
4193
+ datalabels: h
4187
4194
  }
4188
4195
  ]
4189
4196
  });
4190
4197
  else {
4191
- const j = { ...r };
4192
- j.datalabels = d;
4198
+ const b = { ...r };
4199
+ b.datalabels = h;
4193
4200
  const f = a == null ? void 0 : a.map(
4194
- (m) => m.idx === h ? j : m
4201
+ (m) => m.idx === u ? b : m
4195
4202
  );
4196
4203
  t({
4197
4204
  ...n,
@@ -4199,21 +4206,21 @@ function _l({ idx: s }) {
4199
4206
  });
4200
4207
  }
4201
4208
  }
4202
- return /* @__PURE__ */ e.jsxs(ds, { children: [
4203
- /* @__PURE__ */ e.jsx(us, { children: /* @__PURE__ */ e.jsx(Qn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4204
- /* @__PURE__ */ e.jsx(hs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4209
+ return /* @__PURE__ */ e.jsxs(us, { children: [
4210
+ /* @__PURE__ */ e.jsx(hs, { children: /* @__PURE__ */ e.jsx(Qn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4211
+ /* @__PURE__ */ e.jsx(ms, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4205
4212
  /* @__PURE__ */ e.jsx(
4206
- M,
4213
+ I,
4207
4214
  {
4208
4215
  onClick: () => i("none", s),
4209
4216
  size: "sm",
4210
4217
  variant: "secondary",
4211
4218
  className: "h-7 p-1 text-xs font-normal",
4212
- children: /* @__PURE__ */ e.jsx(Sa, { className: "size-4" })
4219
+ children: /* @__PURE__ */ e.jsx(Na, { className: "size-4" })
4213
4220
  }
4214
4221
  ),
4215
4222
  /* @__PURE__ */ e.jsx(
4216
- M,
4223
+ I,
4217
4224
  {
4218
4225
  onClick: () => i("start", s),
4219
4226
  size: "sm",
@@ -4230,7 +4237,7 @@ function _l({ idx: s }) {
4230
4237
  }
4231
4238
  ),
4232
4239
  /* @__PURE__ */ e.jsx(
4233
- M,
4240
+ I,
4234
4241
  {
4235
4242
  onClick: () => i("center", s),
4236
4243
  size: "sm",
@@ -4247,7 +4254,7 @@ function _l({ idx: s }) {
4247
4254
  }
4248
4255
  ),
4249
4256
  /* @__PURE__ */ e.jsx(
4250
- M,
4257
+ I,
4251
4258
  {
4252
4259
  onClick: () => i("end", s),
4253
4260
  size: "sm",
@@ -4266,26 +4273,26 @@ function _l({ idx: s }) {
4266
4273
  ] }) })
4267
4274
  ] });
4268
4275
  }
4269
- function Za() {
4270
- const s = u((h) => h.card), n = u(
4271
- (h) => {
4272
- var d, j, f;
4273
- return (f = (j = (d = h == null ? void 0 : h.card) == null ? void 0 : d.preferences) == null ? void 0 : j.chartOptions) == null ? void 0 : f.indexAxis;
4276
+ function Xa() {
4277
+ const s = d((u) => u.card), n = d(
4278
+ (u) => {
4279
+ var h, b, f;
4280
+ return (f = (b = (h = u == null ? void 0 : u.card) == null ? void 0 : h.preferences) == null ? void 0 : b.chartOptions) == null ? void 0 : f.indexAxis;
4274
4281
  }
4275
- ), { data: a } = Me(s), t = n === "y" ? "Y axis" : "X axis", l = n === "y" ? "X axis" : "Y axis", {
4282
+ ), { data: a } = De(s), t = n === "y" ? "Y axis" : "X axis", l = n === "y" ? "X axis" : "Y axis", {
4276
4283
  keys: r,
4277
4284
  metricKeys: i,
4278
4285
  dimensionKeys: o
4279
- } = js((a == null ? void 0 : a.records) || []);
4286
+ } = bs((a == null ? void 0 : a.records) || []);
4280
4287
  let c = i;
4281
4288
  if (["stackedBar", "stackedLine"].includes(s.type)) {
4282
- const h = nn({
4289
+ const u = tn({
4283
4290
  dataArray: (a == null ? void 0 : a.records) || [],
4284
4291
  groupKey: o[0],
4285
4292
  pivotKey: o[1],
4286
4293
  valueKey: c[0]
4287
- }), { metricKeys: d } = js(h);
4288
- c = d;
4294
+ }), { metricKeys: h } = bs(u);
4295
+ c = h;
4289
4296
  }
4290
4297
  return r.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4291
4298
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
@@ -4295,22 +4302,22 @@ function Za() {
4295
4302
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4296
4303
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
4297
4304
  /* @__PURE__ */ e.jsx($, { children: l }),
4298
- /* @__PURE__ */ e.jsx(Xa, {})
4305
+ /* @__PURE__ */ e.jsx(Ya, {})
4299
4306
  ] }),
4300
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((h, d) => /* @__PURE__ */ e.jsx(Hl, { col: h, idx: d }, h)) })
4307
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((u, h) => /* @__PURE__ */ e.jsx(Hl, { col: u, idx: h }, u)) })
4301
4308
  ] })
4302
4309
  ] });
4303
4310
  }
4304
4311
  function Hl({ col: s, idx: n }) {
4305
- const a = u((o) => {
4312
+ const a = d((o) => {
4306
4313
  var c;
4307
4314
  return (c = o.card) == null ? void 0 : c.preferences;
4308
- }), t = u(
4315
+ }), t = d(
4309
4316
  (o) => {
4310
4317
  var c;
4311
4318
  return (c = o.card.preferences) == null ? void 0 : c.datasetOptions;
4312
4319
  }
4313
- ), l = t == null ? void 0 : t.find((o) => o.idx === n), { setCardPreferences: r } = u((o) => o.actions);
4320
+ ), l = t == null ? void 0 : t.find((o) => o.idx === n), { setCardPreferences: r } = d((o) => o.actions);
4314
4321
  function i(o) {
4315
4322
  if (!l)
4316
4323
  r({
@@ -4327,12 +4334,12 @@ function Hl({ col: s, idx: n }) {
4327
4334
  else {
4328
4335
  const c = { ...l };
4329
4336
  c.type = o === "area" ? "line" : o, c.fill = o === "area" ? "origin" : "";
4330
- const h = t == null ? void 0 : t.map(
4331
- (d) => d.idx === n ? c : d
4337
+ const u = t == null ? void 0 : t.map(
4338
+ (h) => h.idx === n ? c : h
4332
4339
  );
4333
4340
  r({
4334
4341
  ...a,
4335
- datasetOptions: h
4342
+ datasetOptions: u
4336
4343
  });
4337
4344
  }
4338
4345
  }
@@ -4340,14 +4347,14 @@ function Hl({ col: s, idx: n }) {
4340
4347
  /* @__PURE__ */ e.jsx("p", { children: s }),
4341
4348
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
4342
4349
  /* @__PURE__ */ e.jsx(
4343
- qs,
4350
+ Rs,
4344
4351
  {
4345
4352
  onClick: () => i("bar"),
4346
4353
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4347
4354
  }
4348
4355
  ),
4349
4356
  /* @__PURE__ */ e.jsx(
4350
- Rs,
4357
+ _s,
4351
4358
  {
4352
4359
  onClick: () => i("line"),
4353
4360
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
@@ -4364,31 +4371,31 @@ function Hl({ col: s, idx: n }) {
4364
4371
  ] })
4365
4372
  ] });
4366
4373
  }
4367
- function et() {
4368
- const s = u((f) => f.selectedConnectionId), n = u((f) => f.selectedDatamodelId), a = u((f) => f.selectedDatabaseName), t = u((f) => f.selectedSchemaName), l = u((f) => f.selectedTableName), r = D((f) => f.dashboard.filters) || [], i = D((f) => f.actions.addFilter), o = D((f) => f.actions.removeFilter), { removeFilterValues: c } = is(), { modelItems: h, tableName: d } = qe();
4369
- function j(f, m = "dashboard") {
4370
- var F;
4371
- const g = ce(f.column_name), p = ce(a || ""), N = ce(t || ""), y = ce(d);
4372
- let A = xa(
4374
+ function Za() {
4375
+ const s = d((f) => f.selectedConnectionId), n = d((f) => f.selectedDatamodelId), a = d((f) => f.selectedDatabaseName), t = d((f) => f.selectedSchemaName), l = d((f) => f.selectedTableName), r = T((f) => f.dashboard.filters) || [], i = T((f) => f.actions.addFilter), o = T((f) => f.actions.removeFilter), { removeFilterValues: c } = os(), { modelItems: u, tableName: h } = Re();
4376
+ function b(f, m = "dashboard") {
4377
+ var D;
4378
+ const g = ce(f.column_name), p = ce(a || ""), N = ce(t || ""), y = ce(h);
4379
+ let q = xa(
4373
4380
  N,
4374
4381
  y
4375
- ), I = `${A}.${g}`;
4376
- const O = (F = h == null ? void 0 : h.find(
4377
- (R) => R.id === n
4378
- )) == null ? void 0 : F.name;
4379
- n && n !== "none" && (I = `${gs}.${O}.${g}`, A = `${gs}.${O}`);
4380
- const T = r == null ? void 0 : r.find(
4381
- (R) => R.column === I && R.table === y && (R.database === p || R.database === a)
4382
+ ), F = `${q}.${g}`;
4383
+ const M = (D = u == null ? void 0 : u.find(
4384
+ (A) => A.id === n
4385
+ )) == null ? void 0 : D.name;
4386
+ n && n !== "none" && (F = `${js}.${M}.${g}`, q = `${js}.${M}`);
4387
+ const O = r == null ? void 0 : r.find(
4388
+ (A) => A.column === F && A.table === y && (A.database === p || A.database === a)
4382
4389
  );
4383
- if (T)
4384
- c(T.id), o(T.id);
4390
+ if (O)
4391
+ c(O.id), o(O.id);
4385
4392
  else {
4386
- const R = Ue();
4387
- return d === "api" && s ? (i({
4393
+ const A = Ge();
4394
+ return h === "api" && s ? (i({
4388
4395
  location: m,
4389
- id: R,
4396
+ id: A,
4390
4397
  //uuidv4(),
4391
- column: I,
4398
+ column: F,
4392
4399
  title: f.column_name,
4393
4400
  dataType: f.data_type,
4394
4401
  table: "api",
@@ -4398,15 +4405,15 @@ function et() {
4398
4405
  operation: "in",
4399
4406
  sql: Ws(
4400
4407
  f.data_type,
4401
- A,
4408
+ q,
4402
4409
  g
4403
4410
  )
4404
4411
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4405
- }), R) : (i({
4406
- id: R,
4412
+ }), A) : (i({
4413
+ id: A,
4407
4414
  //uuidv4(),
4408
4415
  location: m,
4409
- column: I,
4416
+ column: F,
4410
4417
  //columnName, //`${qualifiedTableName}.${formattedColumnName}`,
4411
4418
  title: f.column_name,
4412
4419
  dataType: f.data_type,
@@ -4416,19 +4423,19 @@ function et() {
4416
4423
  operation: "in",
4417
4424
  sql: Ws(
4418
4425
  f.data_type,
4419
- A,
4426
+ q,
4420
4427
  g
4421
4428
  )
4422
4429
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4423
- }), R);
4430
+ }), A);
4424
4431
  }
4425
4432
  }
4426
- return { assignFilter: j };
4433
+ return { assignFilter: b };
4427
4434
  }
4428
- function Re() {
4429
- const s = D(
4435
+ function _e() {
4436
+ const s = T(
4430
4437
  (o) => o.dashboard.filters
4431
- ), n = u((o) => o.frame), { setFrame: a } = ae(), { columns: t } = qe(), { assignFilter: l } = et();
4438
+ ), n = d((o) => o.frame), { setFrame: a } = ae(), { columns: t } = Re(), { assignFilter: l } = Za();
4432
4439
  function r(o) {
4433
4440
  const c = l(o, "frame");
4434
4441
  a({ ...n, filterId: c });
@@ -4437,7 +4444,7 @@ function Re() {
4437
4444
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4438
4445
  /* @__PURE__ */ e.jsx($, { children: "Card Filter" }),
4439
4446
  /* @__PURE__ */ e.jsx($l, { onSelect: r, columns: t }),
4440
- i && /* @__PURE__ */ e.jsx(ka, { filter: i })
4447
+ i && /* @__PURE__ */ e.jsx(wa, { filter: i })
4441
4448
  ] });
4442
4449
  }
4443
4450
  function $l({
@@ -4446,9 +4453,9 @@ function $l({
4446
4453
  }) {
4447
4454
  var i;
4448
4455
  const [a, t] = Ys.useState(!1), [l, r] = Ys.useState("");
4449
- return /* @__PURE__ */ e.jsxs(ds, { open: a, onOpenChange: t, children: [
4450
- /* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
4451
- M,
4456
+ return /* @__PURE__ */ e.jsxs(us, { open: a, onOpenChange: t, children: [
4457
+ /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
4458
+ I,
4452
4459
  {
4453
4460
  size: "sm",
4454
4461
  variant: "outline",
@@ -4457,26 +4464,26 @@ function $l({
4457
4464
  className: "w-full justify-between font-normal",
4458
4465
  children: [
4459
4466
  l ? (i = s.find((o) => o.column_name === l)) == null ? void 0 : i.column_name : "Select Column...",
4460
- /* @__PURE__ */ e.jsx(ln, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4467
+ /* @__PURE__ */ e.jsx(nn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
4461
4468
  ]
4462
4469
  }
4463
4470
  ) }),
4464
- /* @__PURE__ */ e.jsx(hs, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(rn, { children: [
4465
- /* @__PURE__ */ e.jsx(on, { placeholder: "Search column", className: "h-9" }),
4466
- /* @__PURE__ */ e.jsxs(cn, { children: [
4467
- /* @__PURE__ */ e.jsx(dn, { children: "No framework found." }),
4468
- /* @__PURE__ */ e.jsx(un, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
4469
- hn,
4471
+ /* @__PURE__ */ e.jsx(ms, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(ln, { children: [
4472
+ /* @__PURE__ */ e.jsx(rn, { placeholder: "Search column", className: "h-9" }),
4473
+ /* @__PURE__ */ e.jsxs(on, { children: [
4474
+ /* @__PURE__ */ e.jsx(cn, { children: "No framework found." }),
4475
+ /* @__PURE__ */ e.jsx(dn, { children: s.map((o) => /* @__PURE__ */ e.jsxs(
4476
+ un,
4470
4477
  {
4471
4478
  value: o.column_name,
4472
4479
  onSelect: (c) => {
4473
- const h = c === l ? "" : c;
4474
- r(h), t(!1), h && n(o);
4480
+ const u = c === l ? "" : c;
4481
+ r(u), t(!1), u && n(o);
4475
4482
  },
4476
4483
  children: [
4477
4484
  o.column_name,
4478
4485
  /* @__PURE__ */ e.jsx(
4479
- Na,
4486
+ hn,
4480
4487
  {
4481
4488
  className: W(
4482
4489
  "ml-auto h-4 w-4",
@@ -4495,9 +4502,9 @@ function $l({
4495
4502
  function Pl({
4496
4503
  cardType: s
4497
4504
  }) {
4498
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
4505
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ie, { defaultValue: ["item-2"], type: "multiple", children: [
4499
4506
  /* @__PURE__ */ e.jsxs(K, { value: "item-1", children: [
4500
- /* @__PURE__ */ e.jsx(Q, { children: `${As(s)} Chart` }),
4507
+ /* @__PURE__ */ e.jsx(Q, { children: `${qs(s)} Chart` }),
4501
4508
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 font-mono text-xs", children: [
4502
4509
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
4503
4510
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -4524,26 +4531,26 @@ function Pl({
4524
4531
  /* @__PURE__ */ e.jsxs(K, { value: "item-2", children: [
4525
4532
  /* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
4526
4533
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
4527
- /* @__PURE__ */ e.jsx(xs, {}),
4528
- /* @__PURE__ */ e.jsx(Za, {})
4534
+ /* @__PURE__ */ e.jsx(ps, {}),
4535
+ /* @__PURE__ */ e.jsx(Xa, {})
4529
4536
  ] })
4530
4537
  ] }),
4531
4538
  /* @__PURE__ */ e.jsxs(K, { value: "item-3", children: [
4532
4539
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
4533
4540
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
4534
- /* @__PURE__ */ e.jsx(Ie, {}),
4535
- /* @__PURE__ */ e.jsx(Re, {})
4541
+ /* @__PURE__ */ e.jsx(Te, {}),
4542
+ /* @__PURE__ */ e.jsx(_e, {})
4536
4543
  ] })
4537
4544
  ] })
4538
4545
  ] }) });
4539
4546
  }
4540
- function Hs() {
4547
+ function $s() {
4541
4548
  var l, r, i;
4542
- const s = u(
4549
+ const s = d(
4543
4550
  (o) => o.card.cfg
4544
- ), n = u((o) => o.actions.setCardCfg), a = u((o) => o.card.type);
4551
+ ), n = d((o) => o.actions.setCardCfg), a = d((o) => o.card.type);
4545
4552
  function t(o) {
4546
- var d;
4553
+ var h;
4547
4554
  const c = {
4548
4555
  datalabels: {
4549
4556
  display: o !== "none",
@@ -4551,22 +4558,22 @@ function Hs() {
4551
4558
  anchor: o,
4552
4559
  clamp: !0
4553
4560
  }
4554
- }, h = {
4561
+ }, u = {
4555
4562
  ...s,
4556
4563
  options: {
4557
4564
  ...s == null ? void 0 : s.options,
4558
4565
  plugins: {
4559
- ...(d = s == null ? void 0 : s.options) == null ? void 0 : d.plugins,
4566
+ ...(h = s == null ? void 0 : s.options) == null ? void 0 : h.plugins,
4560
4567
  ...c
4561
4568
  }
4562
4569
  }
4563
4570
  };
4564
- n(h), console.log(o);
4571
+ n(u), console.log(o);
4565
4572
  }
4566
4573
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
4567
4574
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
4568
4575
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
4569
- !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Xa, {})
4576
+ !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Ya, {})
4570
4577
  ] }),
4571
4578
  /* @__PURE__ */ e.jsxs(
4572
4579
  ue,
@@ -4576,7 +4583,7 @@ function Hs() {
4576
4583
  defaultValue: "none",
4577
4584
  children: [
4578
4585
  /* @__PURE__ */ e.jsx(he, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, { placeholder: "Select position" }) }),
4579
- /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
4586
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4580
4587
  /* @__PURE__ */ e.jsx(pe, { children: "Data Labels" }),
4581
4588
  /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }),
4582
4589
  a !== "pyramid" && /* @__PURE__ */ e.jsx(Z, { value: "start", children: "Start" }),
@@ -4617,20 +4624,20 @@ function Bl({
4617
4624
  ] })
4618
4625
  ] });
4619
4626
  }
4620
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
4627
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ie, { defaultValue: ["item-2"], type: "multiple", children: [
4621
4628
  /* @__PURE__ */ e.jsxs(K, { value: "item-1", children: [
4622
- /* @__PURE__ */ e.jsx(Q, { children: `${As(s)} Chart` }),
4629
+ /* @__PURE__ */ e.jsx(Q, { children: `${qs(s)} Chart` }),
4623
4630
  /* @__PURE__ */ e.jsx(J, { className: "space-y-4 font-mono text-xs", children: n(s) })
4624
4631
  ] }),
4625
4632
  /* @__PURE__ */ e.jsxs(K, { value: "item-2", children: [
4626
4633
  /* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
4627
- /* @__PURE__ */ e.jsx(J, { className: "px-2", children: /* @__PURE__ */ e.jsx(Hs, {}) })
4634
+ /* @__PURE__ */ e.jsx(J, { className: "px-2", children: /* @__PURE__ */ e.jsx($s, {}) })
4628
4635
  ] }),
4629
4636
  /* @__PURE__ */ e.jsxs(K, { value: "item-3", children: [
4630
4637
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
4631
4638
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
4632
- /* @__PURE__ */ e.jsx(Ie, {}),
4633
- /* @__PURE__ */ e.jsx(Re, {})
4639
+ /* @__PURE__ */ e.jsx(Te, {}),
4640
+ /* @__PURE__ */ e.jsx(_e, {})
4634
4641
  ] })
4635
4642
  ] })
4636
4643
  ] }) });
@@ -4659,10 +4666,10 @@ const Ul = {
4659
4666
  ]
4660
4667
  };
4661
4668
  function Kl() {
4662
- const s = u((n) => n.card.type);
4669
+ const s = d((n) => n.card.type);
4663
4670
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4664
4671
  /* @__PURE__ */ e.jsx(
4665
- De,
4672
+ Ie,
4666
4673
  {
4667
4674
  className: " ",
4668
4675
  type: "single",
@@ -4670,11 +4677,11 @@ function Kl() {
4670
4677
  children: Ql(s)
4671
4678
  }
4672
4679
  ),
4673
- /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(xs, {}) }),
4680
+ /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(ps, {}) }),
4674
4681
  !["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4675
- /* @__PURE__ */ e.jsx(Hs, {}),
4676
- /* @__PURE__ */ e.jsx(Ie, {}),
4677
- /* @__PURE__ */ e.jsx(Re, {})
4682
+ /* @__PURE__ */ e.jsx($s, {}),
4683
+ /* @__PURE__ */ e.jsx(Te, {}),
4684
+ /* @__PURE__ */ e.jsx(_e, {})
4678
4685
  ] })
4679
4686
  ] });
4680
4687
  }
@@ -4776,44 +4783,44 @@ function Ql(s) {
4776
4783
  ] }) });
4777
4784
  }
4778
4785
  function Jl() {
4779
- var c, h, d, j, f;
4780
- const s = u((m) => m.card.preferences), n = u(
4786
+ var c, u, h, b, f;
4787
+ const s = d((m) => m.card.preferences), n = d(
4781
4788
  (m) => m.actions.setCardPreferences
4782
- ), a = u(
4789
+ ), a = d(
4783
4790
  (m) => m.actions.setNumberFormat
4784
4791
  );
4785
- u(
4792
+ d(
4786
4793
  (m) => {
4787
4794
  var g, p;
4788
4795
  return (p = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : p.decimalPlaces;
4789
4796
  }
4790
4797
  );
4791
- const t = u(
4798
+ const t = d(
4792
4799
  (m) => {
4793
4800
  var g, p;
4794
4801
  return (p = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : p.locale;
4795
4802
  }
4796
- ), l = u(
4803
+ ), l = d(
4797
4804
  (m) => {
4798
4805
  var g, p;
4799
4806
  return (p = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : p.currency;
4800
4807
  }
4801
4808
  );
4802
- u(
4809
+ d(
4803
4810
  (m) => m.actions.setFilterOnClickField
4804
4811
  );
4805
- const r = u(
4812
+ const r = d(
4806
4813
  (m) => {
4807
4814
  var g, p;
4808
4815
  return (p = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : p.colorRanges;
4809
4816
  }
4810
- ) || [], i = u(
4817
+ ) || [], i = d(
4811
4818
  (m) => m.actions.setColorRanges
4812
- ), o = [...new Set(ts.map((m) => m.currency))];
4819
+ ), o = [...new Set(ns.map((m) => m.currency))];
4813
4820
  return /* @__PURE__ */ e.jsxs("div", { children: [
4814
4821
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
4815
4822
  /* @__PURE__ */ e.jsx(
4816
- Vs,
4823
+ As,
4817
4824
  {
4818
4825
  checked: !!((c = s == null ? void 0 : s.formatNumber) != null && c.enabled),
4819
4826
  onCheckedChange: (m) => {
@@ -4829,7 +4836,7 @@ function Jl() {
4829
4836
  ),
4830
4837
  /* @__PURE__ */ e.jsx($, { children: "Format Number" })
4831
4838
  ] }),
4832
- ((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4839
+ ((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
4833
4840
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
4834
4841
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4835
4842
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
@@ -4849,10 +4856,10 @@ function Jl() {
4849
4856
  },
4850
4857
  children: [
4851
4858
  /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4852
- /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
4859
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4853
4860
  /* @__PURE__ */ e.jsx(pe, { children: "Format" }),
4854
4861
  /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
4855
- ts.map((m) => /* @__PURE__ */ e.jsx(Z, { value: m.locale, children: m.locale }, m.locale))
4862
+ ns.map((m) => /* @__PURE__ */ e.jsx(Z, { value: m.locale, children: m.locale }, m.locale))
4856
4863
  ] }) })
4857
4864
  ]
4858
4865
  }
@@ -4875,7 +4882,7 @@ function Jl() {
4875
4882
  },
4876
4883
  children: [
4877
4884
  /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
4878
- /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
4885
+ /* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
4879
4886
  /* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
4880
4887
  /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
4881
4888
  o.map((m) => /* @__PURE__ */ e.jsx(Z, { value: m, children: m }, m))
@@ -4891,7 +4898,7 @@ function Jl() {
4891
4898
  /* @__PURE__ */ e.jsxs(
4892
4899
  ue,
4893
4900
  {
4894
- value: ((j = (d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.decimalPlaces) == null ? void 0 : j.toString()) || "0",
4901
+ value: ((b = (h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.decimalPlaces) == null ? void 0 : b.toString()) || "0",
4895
4902
  onValueChange: (m) => {
4896
4903
  var g, p, N;
4897
4904
  return a(
@@ -4930,7 +4937,7 @@ function Jl() {
4930
4937
  ] })
4931
4938
  ] })
4932
4939
  ] }) }),
4933
- /* @__PURE__ */ e.jsx(ve, { className: "my-3" }),
4940
+ /* @__PURE__ */ e.jsx(Ce, { className: "my-3" }),
4934
4941
  /* @__PURE__ */ e.jsx(
4935
4942
  mn,
4936
4943
  {
@@ -4943,7 +4950,7 @@ function Jl() {
4943
4950
  }
4944
4951
  function Wl() {
4945
4952
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4946
- /* @__PURE__ */ e.jsx(De, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(K, { value: "item-1", children: [
4953
+ /* @__PURE__ */ e.jsx(Ie, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(K, { value: "item-1", children: [
4947
4954
  /* @__PURE__ */ e.jsx(Q, { className: "", children: "KPI Query" }),
4948
4955
  /* @__PURE__ */ e.jsxs(J, { className: "font-mono", children: [
4949
4956
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
@@ -5073,10 +5080,10 @@ const Yl = [
5073
5080
  value: s
5074
5081
  }));
5075
5082
  function er() {
5076
- var c, h, d, j, f, m, g, p, N, y, A, I, O, T, F, R, v, b;
5077
- const s = u((x) => x.card), n = (h = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : h.topoJsonUrl, [a, t] = _(
5078
- ((j = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : j.customTopoJsonUrl) || ""
5079
- ), { setCardPreferences: l } = ae(), { data: r } = Es(s), i = Object.keys((r == null ? void 0 : r.objects) || {}).map((x) => ({
5083
+ var c, u, h, b, f, m, g, p, N, y, q, F, M, O, D, A, v, j;
5084
+ const s = d((x) => x.card), n = (u = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : u.topoJsonUrl, [a, t] = _(
5085
+ ((b = (h = s == null ? void 0 : s.preferences) == null ? void 0 : h.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
5086
+ ), { setCardPreferences: l } = ae(), { data: r } = Vs(s), i = Object.keys((r == null ? void 0 : r.objects) || {}).map((x) => ({
5080
5087
  label: x,
5081
5088
  value: x
5082
5089
  })) || [], o = [
@@ -5094,9 +5101,9 @@ function er() {
5094
5101
  }
5095
5102
  ];
5096
5103
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
5097
- /* @__PURE__ */ e.jsx(Pe, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
5098
- /* @__PURE__ */ e.jsx(ve, { className: "my-4" }),
5099
- /* @__PURE__ */ e.jsx(Pe, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5104
+ /* @__PURE__ */ e.jsx(Be, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
5105
+ /* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
5106
+ /* @__PURE__ */ e.jsx(Be, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5100
5107
  /* @__PURE__ */ e.jsx(
5101
5108
  de,
5102
5109
  {
@@ -5132,7 +5139,7 @@ function er() {
5132
5139
  });
5133
5140
  },
5134
5141
  value: a,
5135
- className: `h-9 w-full ${$e}`,
5142
+ className: `h-9 w-full ${Pe}`,
5136
5143
  placeholder: "Custom URL"
5137
5144
  }
5138
5145
  ),
@@ -5205,15 +5212,15 @@ function er() {
5205
5212
  ] })
5206
5213
  ] })
5207
5214
  ] }) }),
5208
- /* @__PURE__ */ e.jsx(ve, { className: "my-4" }),
5209
- /* @__PURE__ */ e.jsx(Pe, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5215
+ /* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
5216
+ /* @__PURE__ */ e.jsx(Be, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5210
5217
  /* @__PURE__ */ e.jsx(
5211
5218
  ie,
5212
5219
  {
5213
- className: `h-9 w-full ${$e}`,
5220
+ className: `h-9 w-full ${Pe}`,
5214
5221
  type: "number",
5215
5222
  step: 0.1,
5216
- value: ((I = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
5223
+ value: ((F = (q = s.preferences) == null ? void 0 : q.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
5217
5224
  onChange: (x) => {
5218
5225
  var k;
5219
5226
  l({
@@ -5230,19 +5237,19 @@ function er() {
5230
5237
  /* @__PURE__ */ e.jsx(
5231
5238
  ie,
5232
5239
  {
5233
- className: `h-9 w-full ${$e}`,
5240
+ className: `h-9 w-full ${Pe}`,
5234
5241
  type: "number",
5235
5242
  step: 10,
5236
- value: ((F = (T = (O = s.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : T.projectionOffset) == null ? void 0 : F[0]) || 0,
5243
+ value: ((D = (O = (M = s.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : O.projectionOffset) == null ? void 0 : D[0]) || 0,
5237
5244
  onChange: (x) => {
5238
- var k, S, q, P;
5245
+ var k, S, R, P;
5239
5246
  l({
5240
5247
  ...s.preferences,
5241
5248
  mapVisualOptions: {
5242
5249
  ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5243
5250
  projectionOffset: [
5244
5251
  Number(x.target.value),
5245
- ((P = (q = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : q.projectionOffset) == null ? void 0 : P[1]) || 0
5252
+ ((P = (R = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : R.projectionOffset) == null ? void 0 : P[1]) || 0
5246
5253
  ]
5247
5254
  }
5248
5255
  });
@@ -5253,18 +5260,18 @@ function er() {
5253
5260
  /* @__PURE__ */ e.jsx(
5254
5261
  ie,
5255
5262
  {
5256
- className: `h-9 w-full ${$e}`,
5263
+ className: `h-9 w-full ${Pe}`,
5257
5264
  type: "number",
5258
5265
  step: 10,
5259
- value: ((b = (v = (R = s.preferences) == null ? void 0 : R.mapVisualOptions) == null ? void 0 : v.projectionOffset) == null ? void 0 : b[1]) || 0,
5266
+ value: ((j = (v = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : v.projectionOffset) == null ? void 0 : j[1]) || 0,
5260
5267
  onChange: (x) => {
5261
- var k, S, q, P;
5268
+ var k, S, R, P;
5262
5269
  l({
5263
5270
  ...s.preferences,
5264
5271
  mapVisualOptions: {
5265
5272
  ...(k = s.preferences) == null ? void 0 : k.mapVisualOptions,
5266
5273
  projectionOffset: [
5267
- ((P = (q = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : q.projectionOffset) == null ? void 0 : P[0]) || 0,
5274
+ ((P = (R = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : R.projectionOffset) == null ? void 0 : P[0]) || 0,
5268
5275
  Number(x.target.value)
5269
5276
  ]
5270
5277
  }
@@ -5273,13 +5280,13 @@ function er() {
5273
5280
  }
5274
5281
  )
5275
5282
  ] }) }),
5276
- /* @__PURE__ */ e.jsx(ve, { className: "my-4" }),
5277
- /* @__PURE__ */ e.jsx(Ie, {})
5283
+ /* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
5284
+ /* @__PURE__ */ e.jsx(Te, {})
5278
5285
  ] });
5279
5286
  }
5280
5287
  function sr() {
5281
5288
  var t;
5282
- const s = u((l) => l.card.preferences), { setCardPreferences: n } = u((l) => l.actions);
5289
+ const s = d((l) => l.card.preferences), { setCardPreferences: n } = d((l) => l.actions);
5283
5290
  function a(l) {
5284
5291
  n({
5285
5292
  ...s,
@@ -5290,7 +5297,7 @@ function sr() {
5290
5297
  });
5291
5298
  }
5292
5299
  return /* @__PURE__ */ e.jsxs(
5293
- ms,
5300
+ xs,
5294
5301
  {
5295
5302
  value: (t = s == null ? void 0 : s.textVisualOptions) != null && t.isDynamicText ? "dynamic" : "static",
5296
5303
  onValueChange: a,
@@ -5298,26 +5305,26 @@ function sr() {
5298
5305
  defaultValue: "x",
5299
5306
  children: [
5300
5307
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5301
- /* @__PURE__ */ e.jsx(Oe, { value: "static", id: "r1" }),
5308
+ /* @__PURE__ */ e.jsx(Me, { value: "static", id: "r1" }),
5302
5309
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
5303
5310
  ] }),
5304
5311
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5305
- /* @__PURE__ */ e.jsx(Oe, { value: "dynamic", id: "r2" }),
5312
+ /* @__PURE__ */ e.jsx(Me, { value: "dynamic", id: "r2" }),
5306
5313
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
5307
5314
  ] })
5308
5315
  ]
5309
5316
  }
5310
5317
  );
5311
5318
  }
5312
- function Ye({
5319
+ function Xe({
5313
5320
  cardType: s,
5314
5321
  docContent: n,
5315
5322
  suffix: a = "Chart"
5316
5323
  }) {
5317
5324
  let t = "pie-chart";
5318
- return s === "radar" && (t = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
5325
+ return s === "radar" && (t = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ie, { defaultValue: ["item-2"], type: "multiple", children: [
5319
5326
  /* @__PURE__ */ e.jsxs(K, { value: "item-1", children: [
5320
- /* @__PURE__ */ e.jsx(Q, { children: `${As(s)} ${a}` }),
5327
+ /* @__PURE__ */ e.jsx(Q, { children: `${qs(s)} ${a}` }),
5321
5328
  /* @__PURE__ */ e.jsx(J, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5322
5329
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
5323
5330
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -5343,22 +5350,22 @@ function Ye({
5343
5350
  /* @__PURE__ */ e.jsxs(K, { value: "item-2", children: [
5344
5351
  /* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
5345
5352
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5346
- s === "range" && /* @__PURE__ */ e.jsx(xs, {}),
5347
- s !== "text" && /* @__PURE__ */ e.jsx(Hs, {}),
5353
+ s === "range" && /* @__PURE__ */ e.jsx(ps, {}),
5354
+ s !== "text" && /* @__PURE__ */ e.jsx($s, {}),
5348
5355
  s === "text" && /* @__PURE__ */ e.jsx(sr, {})
5349
5356
  ] })
5350
5357
  ] }),
5351
5358
  !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(K, { value: "item-3", children: [
5352
5359
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
5353
5360
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5354
- /* @__PURE__ */ e.jsx(Ie, {}),
5355
- /* @__PURE__ */ e.jsx(Re, {})
5361
+ /* @__PURE__ */ e.jsx(Te, {}),
5362
+ /* @__PURE__ */ e.jsx(_e, {})
5356
5363
  ] })
5357
5364
  ] })
5358
5365
  ] }) });
5359
5366
  }
5360
5367
  function ar() {
5361
- const s = u(
5368
+ const s = d(
5362
5369
  (t) => {
5363
5370
  var l, r;
5364
5371
  return (r = (l = t == null ? void 0 : t.card) == null ? void 0 : l.preferences) == null ? void 0 : r.sortChart;
@@ -5394,7 +5401,7 @@ function ar() {
5394
5401
  )
5395
5402
  ] });
5396
5403
  }
5397
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
5404
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ie, { defaultValue: ["item-2"], type: "multiple", children: [
5398
5405
  /* @__PURE__ */ e.jsxs(K, { value: "item-1", children: [
5399
5406
  /* @__PURE__ */ e.jsx(Q, { children: "Stacked Chart" }),
5400
5407
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 font-mono text-xs", children: [
@@ -5423,25 +5430,25 @@ function ar() {
5423
5430
  /* @__PURE__ */ e.jsxs(K, { value: "item-2", children: [
5424
5431
  /* @__PURE__ */ e.jsx(Q, { children: "Settings" }),
5425
5432
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5426
- /* @__PURE__ */ e.jsx(xs, {}),
5433
+ /* @__PURE__ */ e.jsx(ps, {}),
5427
5434
  a(),
5428
- /* @__PURE__ */ e.jsx(Za, {})
5435
+ /* @__PURE__ */ e.jsx(Xa, {})
5429
5436
  ] })
5430
5437
  ] }),
5431
5438
  /* @__PURE__ */ e.jsxs(K, { value: "item-3", children: [
5432
5439
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
5433
5440
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5434
- /* @__PURE__ */ e.jsx(Ie, {}),
5435
- /* @__PURE__ */ e.jsx(Re, {})
5441
+ /* @__PURE__ */ e.jsx(Te, {}),
5442
+ /* @__PURE__ */ e.jsx(_e, {})
5436
5443
  ] })
5437
5444
  ] })
5438
5445
  ] }) });
5439
5446
  }
5440
5447
  function tr({}) {
5441
- const s = u((t) => {
5448
+ const s = d((t) => {
5442
5449
  var l;
5443
5450
  return (l = t.card) == null ? void 0 : l.preferences;
5444
- }), n = u(
5451
+ }), n = d(
5445
5452
  (t) => t.actions.setCardPreferences
5446
5453
  ), a = (t) => {
5447
5454
  n({
@@ -5450,15 +5457,15 @@ function tr({}) {
5450
5457
  });
5451
5458
  };
5452
5459
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
5453
- /* @__PURE__ */ e.jsx(De, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(K, { value: "item-3", children: [
5460
+ /* @__PURE__ */ e.jsx(Ie, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(K, { value: "item-3", children: [
5454
5461
  /* @__PURE__ */ e.jsx(Q, { children: "Filters" }),
5455
5462
  /* @__PURE__ */ e.jsxs(J, { className: "space-y-4 px-2", children: [
5456
- /* @__PURE__ */ e.jsx(Ie, {}),
5457
- /* @__PURE__ */ e.jsx(Re, {})
5463
+ /* @__PURE__ */ e.jsx(Te, {}),
5464
+ /* @__PURE__ */ e.jsx(_e, {})
5458
5465
  ] })
5459
5466
  ] }) }),
5460
5467
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5461
- /* @__PURE__ */ e.jsx(Vs, { onCheckedChange: a, id: "allow-download" }),
5468
+ /* @__PURE__ */ e.jsx(As, { onCheckedChange: a, id: "allow-download" }),
5462
5469
  /* @__PURE__ */ e.jsx(
5463
5470
  "label",
5464
5471
  {
@@ -5520,26 +5527,26 @@ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5520
5527
  ] })
5521
5528
  ] });
5522
5529
  function ir() {
5523
- const s = u((a) => a.card.type);
5530
+ const s = d((a) => a.card.type);
5524
5531
  function n(a) {
5525
5532
  switch (a) {
5526
5533
  case "stackedBar":
5527
5534
  case "stackedLine":
5528
5535
  return /* @__PURE__ */ e.jsx(ar, {});
5529
5536
  case "pyramid":
5530
- return /* @__PURE__ */ e.jsx(Ye, { docContent: nr, cardType: a });
5537
+ return /* @__PURE__ */ e.jsx(Xe, { docContent: nr, cardType: a });
5531
5538
  case "kpi":
5532
5539
  return /* @__PURE__ */ e.jsx(Wl, {});
5533
5540
  case "line":
5534
5541
  case "bar":
5535
5542
  return /* @__PURE__ */ e.jsx(Pl, { cardType: a });
5536
5543
  case "range":
5537
- return /* @__PURE__ */ e.jsx(Ye, { docContent: lr, cardType: a });
5544
+ return /* @__PURE__ */ e.jsx(Xe, { docContent: lr, cardType: a });
5538
5545
  case "pie":
5539
5546
  case "doughnut":
5540
5547
  case "polarArea":
5541
5548
  case "radar":
5542
- return /* @__PURE__ */ e.jsx(Ye, { cardType: a });
5549
+ return /* @__PURE__ */ e.jsx(Xe, { cardType: a });
5543
5550
  case "bubble":
5544
5551
  case "scatter":
5545
5552
  return /* @__PURE__ */ e.jsx(Bl, { cardType: a });
@@ -5547,7 +5554,7 @@ function ir() {
5547
5554
  return /* @__PURE__ */ e.jsx(tr, { cardType: a });
5548
5555
  case "text":
5549
5556
  return /* @__PURE__ */ e.jsx(
5550
- Ye,
5557
+ Xe,
5551
5558
  {
5552
5559
  docContent: rr,
5553
5560
  cardType: a,
@@ -5565,15 +5572,15 @@ function ir() {
5565
5572
  return /* @__PURE__ */ e.jsx(fe, { className: "h-full w-full text-sm", children: n(s) });
5566
5573
  }
5567
5574
  function or() {
5568
- const s = u((n) => n.isShowingVisual);
5575
+ const s = d((n) => n.isShowingVisual);
5569
5576
  return /* @__PURE__ */ e.jsxs(
5570
- ss,
5577
+ as,
5571
5578
  {
5572
5579
  direction: "vertical",
5573
5580
  className: "min-h-[250px] min-w-full max-w-lg",
5574
5581
  children: [
5575
5582
  /* @__PURE__ */ e.jsx(
5576
- be,
5583
+ ye,
5577
5584
  {
5578
5585
  role: "query-section",
5579
5586
  className: "flex",
@@ -5582,17 +5589,17 @@ function or() {
5582
5589
  children: /* @__PURE__ */ e.jsx(Sl, {})
5583
5590
  }
5584
5591
  ),
5585
- /* @__PURE__ */ e.jsx(as, { withHandle: !0, className: "border" }),
5592
+ /* @__PURE__ */ e.jsx(ts, { withHandle: !0, className: "border" }),
5586
5593
  /* @__PURE__ */ e.jsx(
5587
- be,
5594
+ ye,
5588
5595
  {
5589
5596
  className: "pb-1",
5590
5597
  role: "visual-section",
5591
5598
  minSize: 0,
5592
5599
  defaultSize: 60,
5593
- children: s ? /* @__PURE__ */ e.jsxs(ss, { direction: "horizontal", children: [
5600
+ children: s ? /* @__PURE__ */ e.jsxs(as, { direction: "horizontal", children: [
5594
5601
  /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
5595
- be,
5602
+ ye,
5596
5603
  {
5597
5604
  className: "flex min-w-[275px]",
5598
5605
  minSize: 20,
@@ -5601,8 +5608,8 @@ function or() {
5601
5608
  children: /* @__PURE__ */ e.jsx(ir, {})
5602
5609
  }
5603
5610
  ) }),
5604
- /* @__PURE__ */ e.jsx(as, { className: "border" }),
5605
- /* @__PURE__ */ e.jsx(be, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(sa, {}) })
5611
+ /* @__PURE__ */ e.jsx(ts, { className: "border" }),
5612
+ /* @__PURE__ */ e.jsx(ye, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(sa, {}) })
5606
5613
  ] }) : /* @__PURE__ */ e.jsx(sa, {})
5607
5614
  }
5608
5615
  )
@@ -5611,13 +5618,13 @@ function or() {
5611
5618
  );
5612
5619
  }
5613
5620
  function cr({ authToken: s, onSave: n, onClose: a }) {
5614
- D((i) => i.themeStyle);
5615
- const t = u((i) => i.actions.setOnSave), l = u((i) => i.actions.setOnClose), r = D((i) => i.actions.setAuthToken);
5621
+ T((i) => i.themeStyle);
5622
+ const t = d((i) => i.actions.setOnSave), l = d((i) => i.actions.setOnClose), r = T((i) => i.actions.setAuthToken);
5616
5623
  return se(() => {
5617
5624
  n && t(n), a && l(a);
5618
5625
  }, [n, t, a, l]), se(() => {
5619
5626
  s && s.accessToken && r(s);
5620
- }, [s, r]), /* @__PURE__ */ e.jsx(cs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(
5627
+ }, [s, r]), /* @__PURE__ */ e.jsx(ds, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(
5621
5628
  xn,
5622
5629
  {
5623
5630
  style: {
@@ -5627,15 +5634,15 @@ function cr({ authToken: s, onSave: n, onClose: a }) {
5627
5634
  className: "rounded-none",
5628
5635
  role: "editor-panel",
5629
5636
  children: [
5630
- /* @__PURE__ */ e.jsx(pn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
5637
+ /* @__PURE__ */ e.jsx(pn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Va, {}) }),
5631
5638
  /* @__PURE__ */ e.jsx(fn, { children: /* @__PURE__ */ e.jsx(or, {}) })
5632
5639
  ]
5633
5640
  }
5634
5641
  ) });
5635
5642
  }
5636
5643
  function dr() {
5637
- D((i) => i.selectedCardId);
5638
- const s = D((i) => i.selectedSheetId), { setIsVisualEditing: n } = D((i) => i.actions), a = D((i) => i.isVisualEditing), t = D((i) => i.actions.updateFrame);
5644
+ T((i) => i.selectedCardId);
5645
+ const s = T((i) => i.selectedSheetId), { setIsVisualEditing: n } = T((i) => i.actions), a = T((i) => i.isVisualEditing), t = T((i) => i.actions.updateFrame);
5639
5646
  function l(i) {
5640
5647
  s && (t(s, i), n(!1));
5641
5648
  }
@@ -5654,7 +5661,7 @@ function dr() {
5654
5661
  );
5655
5662
  }
5656
5663
  function ur() {
5657
- const s = u((r) => r.selectedDatabaseName), n = u((r) => r.selectedTableName), a = D((r) => r.dashboard.filters) || [], { columns: t } = qe(), { assignFilter: l } = et();
5664
+ const s = d((r) => r.selectedDatabaseName), n = d((r) => r.selectedTableName), a = T((r) => r.dashboard.filters) || [], { columns: t } = Re(), { assignFilter: l } = Za();
5658
5665
  return /* @__PURE__ */ e.jsx(fe, { className: "flex-1 basis-0 flex-col px-3", children: t == null ? void 0 : t.map((r) => {
5659
5666
  const i = a == null ? void 0 : a.find(
5660
5667
  (o) => o.column === ce(r.column_name) && o.table === n && o.database === s
@@ -5670,7 +5677,7 @@ function ur() {
5670
5677
  }
5671
5678
  ),
5672
5679
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
5673
- /* @__PURE__ */ e.jsx(Va, { column: r }),
5680
+ /* @__PURE__ */ e.jsx(Ea, { column: r }),
5674
5681
  /* @__PURE__ */ e.jsx("span", { children: r.column_name })
5675
5682
  ] })
5676
5683
  },
@@ -5679,25 +5686,25 @@ function ur() {
5679
5686
  }) });
5680
5687
  }
5681
5688
  function hr() {
5682
- D((n) => n.showFilters);
5683
- const s = D(
5689
+ T((n) => n.showFilters);
5690
+ const s = T(
5684
5691
  (n) => n.actions.setShowFilters
5685
5692
  );
5686
5693
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex min-w-72 grow flex-col border-l px-1", children: [
5687
5694
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
5688
5695
  /* @__PURE__ */ e.jsx($, { className: "px-2 text-lg", children: "Filters" }),
5689
5696
  /* @__PURE__ */ e.jsx(
5690
- M,
5697
+ I,
5691
5698
  {
5692
5699
  onClick: () => s(!1),
5693
5700
  className: "h-7 w-7 p-0",
5694
5701
  variant: "ghost",
5695
- children: /* @__PURE__ */ e.jsx(Be, {})
5702
+ children: /* @__PURE__ */ e.jsx(Ue, {})
5696
5703
  }
5697
5704
  )
5698
5705
  ] }),
5699
5706
  /* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
5700
- Aa,
5707
+ Va,
5701
5708
  {
5702
5709
  ColumnsComponent: () => (
5703
5710
  // schemaName, tableName, columns
@@ -5711,7 +5718,7 @@ function hr() {
5711
5718
  ] });
5712
5719
  }
5713
5720
  function mr() {
5714
- const s = D((t) => t.dashboard.filters), n = D((t) => t.theme), a = s == null ? void 0 : s.filter((t) => t.hide);
5721
+ const s = T((t) => t.dashboard.filters), n = T((t) => t.theme), a = s == null ? void 0 : s.filter((t) => t.hide);
5715
5722
  return a != null && a.length ? /* @__PURE__ */ e.jsx(
5716
5723
  "div",
5717
5724
  {
@@ -5724,7 +5731,7 @@ function mr() {
5724
5731
  {
5725
5732
  className: "flex min-w-[250px] max-w-fit flex-col gap-1 p-2",
5726
5733
  children: [
5727
- /* @__PURE__ */ e.jsx(ka, { filter: t }),
5734
+ /* @__PURE__ */ e.jsx(wa, { filter: t }),
5728
5735
  /* @__PURE__ */ e.jsx(ba, { filter: t })
5729
5736
  ]
5730
5737
  },
@@ -5734,7 +5741,7 @@ function mr() {
5734
5741
  ) : null;
5735
5742
  }
5736
5743
  function xr() {
5737
- const s = D((t) => t.showFilters), n = D((t) => t.isVisualEditing), a = D(
5744
+ const s = T((t) => t.showFilters), n = T((t) => t.isVisualEditing), a = T(
5738
5745
  (t) => t.isDashboardEditing
5739
5746
  );
5740
5747
  return /* @__PURE__ */ e.jsxs(
@@ -5756,10 +5763,10 @@ function xr() {
5756
5763
  );
5757
5764
  }
5758
5765
  function pr() {
5759
- const s = D((t) => t.dashboard), n = D((t) => t.actions.setDashboard), a = D(
5766
+ const s = T((t) => t.dashboard), n = T((t) => t.actions.setDashboard), a = T(
5760
5767
  (t) => t.showDashboardJSON
5761
5768
  );
5762
- return D(
5769
+ return T(
5763
5770
  (t) => t.actions.setShowDashboardJSON
5764
5771
  ), /* @__PURE__ */ e.jsx(
5765
5772
  "div",
@@ -5804,7 +5811,7 @@ function br({
5804
5811
  showFooter: n = !0,
5805
5812
  ...a
5806
5813
  }) {
5807
- return /* @__PURE__ */ e.jsx(cs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(bn, { dashboardProps: a, children: [
5814
+ return /* @__PURE__ */ e.jsx(ds, { FallbackComponent: ka, children: /* @__PURE__ */ e.jsxs(bn, { dashboardProps: a, children: [
5808
5815
  /* @__PURE__ */ e.jsx(yn, {}),
5809
5816
  /* @__PURE__ */ e.jsxs(vn, { children: [
5810
5817
  /* @__PURE__ */ e.jsx(pr, {}),
@@ -5817,29 +5824,29 @@ function br({
5817
5824
  ] }) });
5818
5825
  }
5819
5826
  export {
5820
- He as A,
5827
+ $e as A,
5821
5828
  Sn as B,
5822
5829
  kn as C,
5823
5830
  br as D,
5824
- Ta as E,
5825
- Ea as F,
5831
+ Ia as E,
5832
+ La as F,
5826
5833
  Tn as G,
5827
5834
  Fn as H,
5828
5835
  Xn as I,
5829
5836
  Vn as K,
5830
5837
  An as L,
5831
- Fa as M,
5838
+ Ta as M,
5832
5839
  Hn as N,
5833
5840
  $n as P,
5834
5841
  Bn as S,
5835
5842
  Qn as T,
5836
5843
  Yn as U,
5837
5844
  wn as a,
5838
- qs as b,
5839
- Rs as c,
5840
- Ma as d,
5841
- Da as e,
5842
- Ia as f,
5845
+ Rs as b,
5846
+ _s as c,
5847
+ Oa as d,
5848
+ Ma as e,
5849
+ Da as f,
5843
5850
  zn as g,
5844
5851
  On as h,
5845
5852
  Mn as i,
@@ -5849,15 +5856,15 @@ export {
5849
5856
  En as m,
5850
5857
  qn as n,
5851
5858
  Rn as o,
5852
- Ae as p,
5859
+ qe as p,
5853
5860
  _n as q,
5854
5861
  Pn as r,
5855
- La as s,
5862
+ Fa as s,
5856
5863
  Un as t,
5857
5864
  Gn as u,
5858
5865
  Kn as v,
5859
5866
  Jn as w,
5860
5867
  Wn as x,
5861
- _s as y,
5862
- qe as z
5868
+ Hs as y,
5869
+ Re as z
5863
5870
  };