react-semaphor 0.0.382 → 0.0.383

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { c as H, p as Ot, u as O, a as Ze, b as De, d as Mt, e as Tt, B as L, P as Xe, f as Dt, g as It, h as Lt, i as ca, L as U, I as me, j as da, k as Ft, l as Vt, m as Et, n as ua, o as ha, q as cn, r as Zt, s as ee, C as ut, t as dn, v as p, w as un, x as hn, y as ma, F as pa, z as We, A as Ke, T as fa, E as mn, G as ga, S as ve, H as xe, J as Ne, K as Ce, M as ze, N as Se, O as te, Q as ba, R as ya, U as va, V as xa, W as Na, X as be, Y as pn, Z as fn, _ as Ca, $ as gn, a0 as bn, a1 as yn, a2 as Sa, a3 as Te, a4 as vn, a5 as He, a6 as St, a7 as Fe, a8 as _e, a9 as Oe, aa as xn, ab as Nn, ac as Cn, ad as Xt, ae as Sn, af as Ye, ag as wn, ah as kn, ai as zn, aj as On, ak as Mn, al as Nt, am as Tn, an as Dn, ao as Ee, ap as ie, aq as wa, ar as In, as as ht, at as Ln, au as Fn, av as Vn, aw as wt, ax as En, ay as An, az as rt, aA as ke, aB as it, aC as qn, aD as Rn, aE as jn, aF as _n, aG as Ct, aH as Hn, aI as Yt, aJ as Pn, aK as ea, aL as $n, aM as Un, aN as Bn, aO as Gn, aP as ka, aQ as Jn, aR as At, aS as za, aT as Wn, aU as Kn, aV as nt, aW as Qn, aX as Zn, aY as Oa, aZ as Xn, a_ as Yn, a$ as es, b0 as ts, b1 as as, b2 as mt, b3 as Ma, b4 as ns, b5 as Ta, b6 as Da, b7 as st, b8 as lt, b9 as ss, ba as ls, bb as rs, bc as is, bd as pt, be as ft, bf as gt, bg as os, bh as cs, bi as ds, bj as us, bk as hs, bl as ms, bm as ps, bn as bt, bo as Ve, bp as fs, bq as Be, br as qt, bs as Ia, bt as gs, bu as bs, bv as ot, bw as ys, bx as vs, by as xs, bz as Ns, bA as ta, bB as aa, bC as La, bD as Cs, bE as Ss, bF as ws, bG as ks, bH as zs, bI as Os, bJ as Ms, bK as Ts, bL as Ae, bM as Z, bN as X, bO as Rt, bP as Y, bQ as Ds, bR as Fa, bS as Is, bT as Ls, bU as Fs, bV as Vs, bW as Es, bX as As, bY as qs, bZ as Rs, b_ as js } from "./chunks/index-CJy7qM8X.js";
2
- import { D as Hr, c3 as Pr, c1 as $r, c1 as Ur, c5 as Br, c4 as Gr, c6 as Jr, c2 as Wr, b$ as Kr, c0 as Qr } from "./chunks/index-CJy7qM8X.js";
1
+ import { c as H, p as Mt, u as M, a as Ze, b as Te, d as Tt, e as Dt, B as L, P as Xe, f as Lt, g as Ft, h as Vt, i as da, L as U, I as me, j as ua, k as Et, l as At, m as qt, n as ha, o as ma, q as cn, r as Xt, s as ee, C as pt, t as dn, v as p, w as un, x as hn, y as pa, F as fa, z as We, A as Ke, T as ga, E as mn, G as ba, S as ve, H as xe, J as Ne, K as Ce, M as ze, N as Se, O as te, Q as ya, R as va, U as xa, V as Na, W as Ca, X as be, Y as pn, Z as fn, _ as Sa, $ as gn, a0 as bn, a1 as yn, a2 as wa, a3 as Me, a4 as vn, a5 as He, a6 as kt, a7 as Le, a8 as _e, a9 as Oe, aa as xn, ab as Nn, ac as Cn, ad as Yt, ae as Sn, af as Ye, ag as wn, ah as kn, ai as zn, aj as On, ak as In, al as St, am as Mn, an as Tn, ao as Ve, ap as ie, aq as ka, ar as Dn, as as ft, at as Ln, au as Fn, av as Vn, aw as zt, ax as En, ay as An, az as ct, aA as ke, aB as dt, aC as qn, aD as Rn, aE as jn, aF as _n, aG as wt, aH as Hn, aI as ea, aJ as Pn, aK as ta, aL as $n, aM as Un, aN as Bn, aO as Gn, aP as za, aQ as Jn, aR as Rt, aS as Oa, aT as Wn, aU as Kn, aV as rt, aW as Qn, aX as Zn, aY as Ia, aZ as Xn, a_ as Yn, a$ as es, b0 as ts, b1 as as, b2 as gt, b3 as Ma, b4 as ns, b5 as Ta, b6 as Da, b7 as it, b8 as ot, b9 as ss, ba as ls, bb as rs, bc as is, bd as bt, be as yt, bf as vt, bg as os, bh as cs, bi as ds, bj as us, bk as hs, bl as ms, bm as ps, bn as xt, bo as Fe, bp as fs, bq as Be, br as jt, bs as La, bt as gs, bu as bs, bv as ut, bw as ys, bx as vs, by as xs, bz as Ns, bA as aa, bB as na, bC as Fa, bD as Cs, bE as Ss, bF as ws, bG as ks, bH as zs, bI as Os, bJ as Is, bK as Ms, bL as Ee, bM as Z, bN as X, bO as _t, bP as Y, bQ as Ts, bR as Va, bS as Ds, bT as Ls, bU as Fs, bV as Vs, bW as Es, bX as As, bY as qs, bZ as Rs, b_ as js } from "./chunks/index-DzewT2eB.js";
2
+ import { D as Hr, c3 as Pr, c1 as $r, c1 as Ur, c5 as Br, c4 as Gr, c6 as Jr, c2 as Wr, b$ as Kr, c0 as Qr } from "./chunks/index-DzewT2eB.js";
3
3
  import { jsxs as n, jsx as e, Fragment as ae } from "react/jsx-runtime";
4
- import * as na from "react";
5
- import Me, { useState as _, useMemo as kt, useEffect as re, useRef as Ge, useCallback as Va, Suspense as _s } from "react";
4
+ import * as sa from "react";
5
+ import Ie, { useState as _, useMemo as Ot, useEffect as re, useRef as Ge, useCallback as Ea, Suspense as _s } from "react";
6
6
  import "react-dom";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
@@ -62,7 +62,7 @@ const $s = H("ChartArea", [
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
64
  */
65
- const jt = H("ChartColumnIncreasing", [
65
+ const Ht = H("ChartColumnIncreasing", [
66
66
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
67
67
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
68
68
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
@@ -74,7 +74,7 @@ const jt = H("ChartColumnIncreasing", [
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
76
  */
77
- const _t = H("ChartLine", [
77
+ const Pt = H("ChartLine", [
78
78
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
79
79
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
80
80
  ]);
@@ -84,7 +84,7 @@ const _t = H("ChartLine", [
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
86
  */
87
- const Ea = H("ChartNoAxesGantt", [
87
+ const Aa = H("ChartNoAxesGantt", [
88
88
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
89
89
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
90
90
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -95,7 +95,7 @@ const Ea = H("ChartNoAxesGantt", [
95
95
  * This source code is licensed under the ISC license.
96
96
  * See the LICENSE file in the root directory of this source tree.
97
97
  */
98
- const Aa = H("ChartPie", [
98
+ const qa = H("ChartPie", [
99
99
  [
100
100
  "path",
101
101
  {
@@ -111,7 +111,7 @@ const Aa = H("ChartPie", [
111
111
  * This source code is licensed under the ISC license.
112
112
  * See the LICENSE file in the root directory of this source tree.
113
113
  */
114
- const qa = H("ChartScatter", [
114
+ const Ra = H("ChartScatter", [
115
115
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
116
116
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
117
117
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -159,7 +159,7 @@ const Gs = H("Database", [
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
161
  */
162
- const Ht = H("EllipsisVertical", [
162
+ const $t = H("EllipsisVertical", [
163
163
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
164
164
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
165
165
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
@@ -341,7 +341,7 @@ const nl = H("Logs", [
341
341
  * This source code is licensed under the ISC license.
342
342
  * See the LICENSE file in the root directory of this source tree.
343
343
  */
344
- const Ra = H("Map", [
344
+ const ja = H("Map", [
345
345
  [
346
346
  "path",
347
347
  {
@@ -425,7 +425,7 @@ const ol = H("Save", [
425
425
  * This source code is licensed under the ISC license.
426
426
  * See the LICENSE file in the root directory of this source tree.
427
427
  */
428
- const ja = H("Shapes", [
428
+ const _a = H("Shapes", [
429
429
  [
430
430
  "path",
431
431
  {
@@ -474,7 +474,7 @@ const dl = H("Sigma", [
474
474
  * This source code is licensed under the ISC license.
475
475
  * See the LICENSE file in the root directory of this source tree.
476
476
  */
477
- const Pt = H("Table", [
477
+ const Ut = H("Table", [
478
478
  ["path", { d: "M12 3v18", key: "108xh3" }],
479
479
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
480
480
  ["path", { d: "M3 9h18", key: "1pudct" }],
@@ -529,12 +529,12 @@ const ml = H("ToggleLeft", [
529
529
  * This source code is licensed under the ISC license.
530
530
  * See the LICENSE file in the root directory of this source tree.
531
531
  */
532
- const $t = H("Type", [
532
+ const Bt = H("Type", [
533
533
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
534
534
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
535
535
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
536
536
  ]);
537
- function _a(t) {
537
+ function Ha(t) {
538
538
  var s;
539
539
  return {
540
540
  ...t,
@@ -591,18 +591,18 @@ async function gl(t, s, a, l) {
591
591
  if (!l)
592
592
  return null;
593
593
  const r = JSON.stringify(s);
594
- return await Ot("https://semaphor.cloud/api/v1/lens", l, {
594
+ return await Mt("https://semaphor.cloud/api/v1/lens", l, {
595
595
  name: t,
596
596
  template: r,
597
597
  filterValues: a,
598
598
  operation: "create"
599
599
  });
600
600
  }
601
- async function zt(t, s) {
601
+ async function It(t, s) {
602
602
  if (!s)
603
603
  return null;
604
604
  const { id: a, template: l, filterValues: r, isDefault: i, shared: o } = t;
605
- return await Ot("https://semaphor.cloud/api/v1/lens", s, {
605
+ return await Mt("https://semaphor.cloud/api/v1/lens", s, {
606
606
  lensId: a,
607
607
  template: l,
608
608
  filterValues: r,
@@ -612,16 +612,16 @@ async function zt(t, s) {
612
612
  });
613
613
  }
614
614
  async function bl(t, s) {
615
- return s ? await Ot("https://semaphor.cloud/api/v1/lens", s, {
615
+ return s ? await Mt("https://semaphor.cloud/api/v1/lens", s, {
616
616
  operation: "delete",
617
617
  lensId: t
618
618
  }) : null;
619
619
  }
620
620
  function yl() {
621
- const [t, s] = _(""), [a, l] = _(!1), r = O((b) => b.lenses), { setLenses: i, setSelectedLensId: o } = Ze(), [c, d] = _(!1), [h, f] = _(!1), v = O((b) => b.dashboard), x = O((b) => b.filterValues), { authToken: u } = De();
621
+ const [t, s] = _(""), [a, l] = _(!1), r = M((b) => b.lenses), { setLenses: i, setSelectedLensId: o } = Ze(), [c, d] = _(!1), [h, f] = _(!1), v = M((b) => b.dashboard), x = M((b) => b.filterValues), { authToken: u } = Te();
622
622
  async function g() {
623
623
  d(!0);
624
- const b = _a(
624
+ const b = Ha(
625
625
  v
626
626
  ), k = await gl(
627
627
  t,
@@ -631,8 +631,8 @@ function yl() {
631
631
  );
632
632
  k && (i([...r || [], k]), o(k.id), f(!1)), d(!1);
633
633
  }
634
- return /* @__PURE__ */ n(Mt, { open: h, onOpenChange: f, children: [
635
- /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ n(
634
+ return /* @__PURE__ */ n(Tt, { open: h, onOpenChange: f, children: [
635
+ /* @__PURE__ */ e(Dt, { asChild: !0, children: /* @__PURE__ */ n(
636
636
  L,
637
637
  {
638
638
  variant: "secondary",
@@ -644,10 +644,10 @@ function yl() {
644
644
  ]
645
645
  }
646
646
  ) }),
647
- /* @__PURE__ */ n(Dt, { className: "sm:max-w-[425px]", children: [
648
- /* @__PURE__ */ n(It, { children: [
649
- /* @__PURE__ */ e(Lt, { children: "Create Lens" }),
650
- /* @__PURE__ */ e(ca, { children: "Lenses are private by default and are only visible to you." })
647
+ /* @__PURE__ */ n(Lt, { className: "sm:max-w-[425px]", children: [
648
+ /* @__PURE__ */ n(Ft, { children: [
649
+ /* @__PURE__ */ e(Vt, { children: "Create Lens" }),
650
+ /* @__PURE__ */ e(da, { children: "Lenses are private by default and are only visible to you." })
651
651
  ] }),
652
652
  /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ n("div", { className: "grid grid-cols-8 items-center gap-4", children: [
653
653
  /* @__PURE__ */ e(U, { className: "text-right", children: "Name" }),
@@ -664,7 +664,7 @@ function yl() {
664
664
  )
665
665
  ] }) }),
666
666
  a && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
667
- /* @__PURE__ */ e(da, { children: /* @__PURE__ */ e(
667
+ /* @__PURE__ */ e(ua, { children: /* @__PURE__ */ e(
668
668
  L,
669
669
  {
670
670
  size: "sm",
@@ -679,7 +679,7 @@ function yl() {
679
679
  ] });
680
680
  }
681
681
  function vl() {
682
- const [t, s] = _(!1), a = O((f) => f.lenses), l = O((f) => f.selectedLensId), { setLenses: r, setSelectedLensId: i } = Ze(), { authToken: o } = De();
682
+ const [t, s] = _(!1), a = M((f) => f.lenses), l = M((f) => f.selectedLensId), { setLenses: r, setSelectedLensId: i } = Ze(), { authToken: o } = Te();
683
683
  async function c(f) {
684
684
  i(f);
685
685
  }
@@ -702,30 +702,30 @@ function vl() {
702
702
  ...f,
703
703
  isDefault: !f.isDefault
704
704
  };
705
- await zt(x, o == null ? void 0 : o.accessToken);
705
+ await It(x, o == null ? void 0 : o.accessToken);
706
706
  const u = a == null ? void 0 : a.find((g) => g.isDefault);
707
707
  if (u && u.id !== f.id) {
708
708
  const g = {
709
709
  ...u,
710
710
  isDefault: !1
711
711
  };
712
- await zt(g, o == null ? void 0 : o.accessToken);
712
+ await It(g, o == null ? void 0 : o.accessToken);
713
713
  }
714
714
  }
715
- return /* @__PURE__ */ n(Ft, { open: t, onOpenChange: s, children: [
716
- /* @__PURE__ */ e(Vt, { asChild: !0, children: /* @__PURE__ */ e(L, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e(Qs, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
717
- /* @__PURE__ */ n(Et, { align: "end", className: "w-60", children: [
718
- /* @__PURE__ */ e(ua, { className: "px-3", children: "Lenses" }),
719
- /* @__PURE__ */ e(ha, {}),
715
+ return /* @__PURE__ */ n(Et, { open: t, onOpenChange: s, children: [
716
+ /* @__PURE__ */ e(At, { asChild: !0, children: /* @__PURE__ */ e(L, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e(Qs, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
717
+ /* @__PURE__ */ n(qt, { align: "end", className: "w-60", children: [
718
+ /* @__PURE__ */ e(ha, { className: "px-3", children: "Lenses" }),
719
+ /* @__PURE__ */ e(ma, {}),
720
720
  /* @__PURE__ */ n(
721
721
  cn,
722
722
  {
723
723
  value: l,
724
724
  onValueChange: c,
725
725
  children: [
726
- /* @__PURE__ */ e(Zt, { value: "original", children: "Original" }),
726
+ /* @__PURE__ */ e(Xt, { value: "original", children: "Original" }),
727
727
  a == null ? void 0 : a.map((f) => /* @__PURE__ */ n(
728
- Zt,
728
+ Xt,
729
729
  {
730
730
  className: "group flex justify-between gap-2",
731
731
  value: f.id,
@@ -749,7 +749,7 @@ function vl() {
749
749
  }
750
750
  ),
751
751
  /* @__PURE__ */ e(
752
- ut,
752
+ pt,
753
753
  {
754
754
  onClick: (v) => {
755
755
  v.preventDefault(), d(f.id);
@@ -771,13 +771,13 @@ function vl() {
771
771
  }
772
772
  async function xl() {
773
773
  var u;
774
- const t = O.getState().authToken, s = O.getState().theme, a = O.getState().filterValues, l = (u = O.getState().dashboard) == null ? void 0 : u.title, r = O.getState().isDownloadingPdf, i = O.getState().selectedSheetId;
774
+ const t = M.getState().authToken, s = M.getState().theme, a = M.getState().filterValues, l = (u = M.getState().dashboard) == null ? void 0 : u.title, r = M.getState().isDownloadingPdf, i = M.getState().selectedSheetId;
775
775
  if (r)
776
776
  return;
777
777
  const o = new URLSearchParams();
778
778
  o.set("token", (t == null ? void 0 : t.accessToken) || ""), o.set("theme", s || "light"), o.set("filterValues", JSON.stringify(a)), o.set("selectedSheetId", i || "");
779
779
  const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`;
780
- O.setState({ isDownloadingPdf: !0 });
780
+ M.setState({ isDownloadingPdf: !0 });
781
781
  const f = (await (await fetch(c, {
782
782
  method: "GET",
783
783
  headers: {
@@ -786,17 +786,17 @@ async function xl() {
786
786
  })).json()).url, v = document.createElement("a");
787
787
  v.href = f;
788
788
  const x = `${l}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
789
- v.download = x, v.click(), O.setState({ isDownloadingPdf: !1 });
789
+ v.download = x, v.click(), M.setState({ isDownloadingPdf: !1 });
790
790
  }
791
791
  function Nl({
792
792
  iconClassName: t
793
793
  }) {
794
- const { authToken: s } = De();
795
- O((r) => {
794
+ const { authToken: s } = Te();
795
+ M((r) => {
796
796
  var i;
797
797
  return (i = r.dashboard) == null ? void 0 : i.title;
798
- }), O((r) => r.theme), O((r) => r.filterValues);
799
- const a = O((r) => r.isDownloadingPdf);
798
+ }), M((r) => r.theme), M((r) => r.filterValues);
799
+ const a = M((r) => r.isDownloadingPdf);
800
800
  async function l() {
801
801
  await xl();
802
802
  }
@@ -818,26 +818,26 @@ function Nl({
818
818
  );
819
819
  }
820
820
  function Cl() {
821
- const { authToken: t } = De();
822
- O((m) => m.theme);
823
- const s = O((m) => m.lenses), a = O((m) => m.selectedLensId), l = s == null ? void 0 : s.find((m) => m.id === a), r = O((m) => m.dashboard);
824
- O((m) => m.selectedSheetId);
825
- const i = O(
821
+ const { authToken: t } = Te();
822
+ M((m) => m.theme);
823
+ const s = M((m) => m.lenses), a = M((m) => m.selectedLensId), l = s == null ? void 0 : s.find((m) => m.id === a), r = M((m) => m.dashboard);
824
+ M((m) => m.selectedSheetId);
825
+ const i = M(
826
826
  (m) => m.isDashboardEditing
827
827
  ), o = p(
828
828
  (m) => m.selectedConnectionId
829
- ), [c, d] = _(!1), h = O((m) => m.filterValues), f = O((m) => m.isVisualEditing), v = O((m) => m.showFilters);
830
- O(
829
+ ), [c, d] = _(!1), h = M((m) => m.filterValues), f = M((m) => m.isVisualEditing), v = M((m) => m.showFilters);
830
+ M(
831
831
  (m) => m.showDashboardJSON
832
832
  );
833
- const x = O((m) => m.onSaveFunction), u = O(
833
+ const x = M((m) => m.onSaveFunction), u = M(
834
834
  (m) => m.actions.setShowFilters
835
- ), { addFrame: g, setSelectedFrameId: b } = O(
835
+ ), { addFrame: g, setSelectedFrameId: b } = M(
836
836
  (m) => m.actions
837
- ), { getSelectedSheet: k, setIsDashboardEditing: N, setShowDashboardJSON: E } = O((m) => m.actions), w = k(), { tenantId: T, endUserId: M } = kt(
837
+ ), { getSelectedSheet: k, setIsDashboardEditing: N, setShowDashboardJSON: V } = M((m) => m.actions), w = k(), { tenantId: T, endUserId: O } = Ot(
838
838
  () => un(t == null ? void 0 : t.accessToken),
839
839
  [t == null ? void 0 : t.accessToken]
840
- ), A = kt(() => T || M, [T, M]), P = () => {
840
+ ), E = Ot(() => T || O, [T, O]), P = () => {
841
841
  if (!i || !w) return;
842
842
  const m = {
843
843
  connectionId: o,
@@ -866,14 +866,14 @@ function Cl() {
866
866
  };
867
867
  async function $() {
868
868
  if (d(!0), !a || !l) return;
869
- const m = _a(
869
+ const m = Ha(
870
870
  r
871
871
  ), y = JSON.stringify(m), D = {
872
872
  ...l,
873
873
  template: y,
874
874
  filterValues: h
875
875
  };
876
- await zt(D, t == null ? void 0 : t.accessToken), Ke.success("Lens saved"), x == null || x(m), d(!1);
876
+ await It(D, t == null ? void 0 : t.accessToken), Ke.success("Lens saved"), x == null || x(m), d(!1);
877
877
  }
878
878
  return f ? null : /* @__PURE__ */ n(
879
879
  "div",
@@ -885,8 +885,8 @@ function Cl() {
885
885
  /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
886
886
  /* @__PURE__ */ e("button", { onClick: hn, children: /* @__PURE__ */ e(hl, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
887
887
  /* @__PURE__ */ e(Nl, {}),
888
- i && !f && A && /* @__PURE__ */ e(yl, {}),
889
- !f && A && /* @__PURE__ */ e(vl, {}),
888
+ i && !f && E && /* @__PURE__ */ e(yl, {}),
889
+ !f && E && /* @__PURE__ */ e(vl, {}),
890
890
  i && !f && /* @__PURE__ */ n(
891
891
  L,
892
892
  {
@@ -908,7 +908,7 @@ function Cl() {
908
908
  className: "h-7 p-2",
909
909
  onClick: j,
910
910
  size: "sm",
911
- children: /* @__PURE__ */ e(ma, { className: "h-4 w-4", strokeWidth: 1.5 })
911
+ children: /* @__PURE__ */ e(pa, { className: "h-4 w-4", strokeWidth: 1.5 })
912
912
  }
913
913
  ),
914
914
  i && !f && /* @__PURE__ */ e(
@@ -918,13 +918,13 @@ function Cl() {
918
918
  role: "close",
919
919
  className: "h-7 p-2",
920
920
  onClick: () => {
921
- N(!1), E(!1);
921
+ N(!1), V(!1);
922
922
  },
923
923
  size: "sm",
924
- children: /* @__PURE__ */ e(ut, { className: "h-4 w-4", strokeWidth: 1.5 })
924
+ children: /* @__PURE__ */ e(pt, { className: "h-4 w-4", strokeWidth: 1.5 })
925
925
  }
926
926
  ),
927
- i && !f && A && /* @__PURE__ */ e(
927
+ i && !f && E && /* @__PURE__ */ e(
928
928
  L,
929
929
  {
930
930
  className: "h-7 p-2",
@@ -942,7 +942,7 @@ function Cl() {
942
942
  variant: "ghost",
943
943
  onClick: () => u(!0),
944
944
  size: "sm",
945
- children: /* @__PURE__ */ e(pa, { className: "h-4 w-4", strokeWidth: 1.5 })
945
+ children: /* @__PURE__ */ e(fa, { className: "h-4 w-4", strokeWidth: 1.5 })
946
946
  }
947
947
  ),
948
948
  !f && i && !1,
@@ -975,14 +975,14 @@ function Ue({
975
975
  if (t === "Schema")
976
976
  return /* @__PURE__ */ e(ll, { className: "size-4" });
977
977
  if (t === "Table")
978
- return /* @__PURE__ */ e(Pt, { className: "size-4" });
978
+ return /* @__PURE__ */ e(Ut, { className: "size-4" });
979
979
  if (t === "Model")
980
980
  return /* @__PURE__ */ e(Hs, { className: "size-4" });
981
981
  }
982
982
  return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
983
- f && /* @__PURE__ */ e("div", { className: "shrink-0", children: o ? /* @__PURE__ */ n(fa, { children: [
983
+ f && /* @__PURE__ */ e("div", { className: "shrink-0", children: o ? /* @__PURE__ */ n(ga, { children: [
984
984
  /* @__PURE__ */ e(mn, { children: u() }),
985
- /* @__PURE__ */ e(ga, { className: "text-xs", align: "start", children: o })
985
+ /* @__PURE__ */ e(ba, { className: "text-xs", align: "start", children: o })
986
986
  ] }) : u() }),
987
987
  /* @__PURE__ */ n(ve, { disabled: v, value: x, onValueChange: c, children: [
988
988
  /* @__PURE__ */ e(
@@ -1025,21 +1025,21 @@ function Sl({ column: t }) {
1025
1025
  (g) => g.selectedSchemaName
1026
1026
  ), i = p(
1027
1027
  (g) => g.selectedDatamodelId
1028
- ), o = p((g) => g.sqlGen), { modelItems: c, connectionType: d } = qe(), h = p((g) => g.actions.setSqlGen), f = p((g) => g.actions.setCardSql), v = p((g) => g.actions.setRunSql);
1028
+ ), o = p((g) => g.sqlGen), { modelItems: c, connectionType: d } = Ae(), h = p((g) => g.actions.setSqlGen), f = p((g) => g.actions.setCardSql), v = p((g) => g.actions.setRunSql);
1029
1029
  function x(g, b) {
1030
1030
  var w;
1031
- const k = xa(g, o, b), N = (w = c == null ? void 0 : c.find(
1031
+ const k = Na(g, o, b), N = (w = c == null ? void 0 : c.find(
1032
1032
  (T) => T.id === i
1033
1033
  )) == null ? void 0 : w.name;
1034
1034
  h(k);
1035
- const E = Na(
1035
+ const V = Ca(
1036
1036
  k,
1037
1037
  be(r || ""),
1038
1038
  be(l),
1039
1039
  N,
1040
1040
  d
1041
1041
  );
1042
- E && (f(E), v(!0)), a(!1);
1042
+ V && (f(V), v(!0)), a(!1);
1043
1043
  }
1044
1044
  function u() {
1045
1045
  return /* @__PURE__ */ n("ul", { className: "text-xs", children: [
@@ -1085,10 +1085,10 @@ function Sl({ column: t }) {
1085
1085
  )
1086
1086
  ] });
1087
1087
  }
1088
- return /* @__PURE__ */ n(ba, { openDelay: 0, open: s, onOpenChange: a, children: [
1089
- /* @__PURE__ */ e(ya, { asChild: !0, children: /* @__PURE__ */ e(Ht, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1088
+ return /* @__PURE__ */ n(ya, { openDelay: 0, open: s, onOpenChange: a, children: [
1089
+ /* @__PURE__ */ e(va, { asChild: !0, children: /* @__PURE__ */ e($t, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1090
1090
  /* @__PURE__ */ e(
1091
- va,
1091
+ xa,
1092
1092
  {
1093
1093
  align: "center",
1094
1094
  className: "w-20 rounded-md p-0 shadow-none",
@@ -1097,10 +1097,10 @@ function Sl({ column: t }) {
1097
1097
  )
1098
1098
  ] });
1099
1099
  }
1100
- function Ha({ column: t }) {
1101
- return /* @__PURE__ */ n(fa, { children: [
1102
- /* @__PURE__ */ e(pn, { asChild: !0, children: fn(t.data_type) ? /* @__PURE__ */ e($t, { className: "size-3" }) : Ca(t.data_type) ? /* @__PURE__ */ e(Xs, { className: "size-3" }) : gn(t.data_type) ? /* @__PURE__ */ e(bn, { className: "size-3" }) : yn(t.data_type) ? /* @__PURE__ */ e(ml, { className: "size-3" }) : t.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e(Ps, { className: "size-3" }) : /* @__PURE__ */ e(cl, { className: "size-3" }) }),
1103
- /* @__PURE__ */ e(ga, { children: /* @__PURE__ */ e("p", { className: "font-mono text-xs", children: t.data_type }) })
1100
+ function Pa({ column: t }) {
1101
+ return /* @__PURE__ */ n(ga, { children: [
1102
+ /* @__PURE__ */ e(pn, { asChild: !0, children: fn(t.data_type) ? /* @__PURE__ */ e(Bt, { className: "size-3" }) : Sa(t.data_type) ? /* @__PURE__ */ e(Xs, { className: "size-3" }) : gn(t.data_type) ? /* @__PURE__ */ e(bn, { className: "size-3" }) : yn(t.data_type) ? /* @__PURE__ */ e(ml, { className: "size-3" }) : t.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e(Ps, { className: "size-3" }) : /* @__PURE__ */ e(cl, { className: "size-3" }) }),
1103
+ /* @__PURE__ */ e(ba, { children: /* @__PURE__ */ e("p", { className: "font-mono text-xs", children: t.data_type }) })
1104
1104
  ] });
1105
1105
  }
1106
1106
  function wl({
@@ -1117,27 +1117,27 @@ function wl({
1117
1117
  (m) => m.selectedSchemaName
1118
1118
  ), d = p((m) => m.selectedTableName), h = p(
1119
1119
  (m) => m.selectedDatamodelId
1120
- ), f = O(
1120
+ ), f = M(
1121
1121
  (m) => m.dashboard.aiScopeTables
1122
- ), { addToAIScope: v, removeFromAIScope: x } = Ze(), { setAIScopeTables: u } = O((m) => m.actions), g = p((m) => m.actions.setRunSql), b = p((m) => m.actions.setSqlGen), k = p(
1122
+ ), { addToAIScope: v, removeFromAIScope: x } = Ze(), { setAIScopeTables: u } = M((m) => m.actions), g = p((m) => m.actions.setRunSql), b = p((m) => m.actions.setSqlGen), k = p(
1123
1123
  (m) => m.actions.setIsShowingVisual
1124
- ), N = p((m) => m.actions.setCardSql), { connectionType: E, modelItems: w, selectedDatamodelName: T } = qe();
1125
- function M(m) {
1124
+ ), N = p((m) => m.actions.setCardSql), { connectionType: V, modelItems: w, selectedDatamodelName: T } = Ae();
1125
+ function O(m) {
1126
1126
  var q;
1127
- const y = xa(m, r);
1127
+ const y = Na(m, r);
1128
1128
  b(y);
1129
1129
  const D = (q = w == null ? void 0 : w.find(
1130
1130
  (B) => B.id === h
1131
- )) == null ? void 0 : q.name, C = Na(
1131
+ )) == null ? void 0 : q.name, C = Ca(
1132
1132
  y,
1133
1133
  be(t),
1134
1134
  be(s),
1135
1135
  D,
1136
- E
1136
+ V
1137
1137
  );
1138
1138
  C && (N(C), g(!0));
1139
1139
  }
1140
- function A() {
1140
+ function E() {
1141
1141
  return (f == null ? void 0 : f.find(
1142
1142
  (m) => m.connectionId === i && (m.tableName === d || m.datamodelName === T)
1143
1143
  )) !== void 0;
@@ -1145,7 +1145,7 @@ function wl({
1145
1145
  function P(m) {
1146
1146
  m === !0 && (d || T) && i ? (v({
1147
1147
  connectionId: i,
1148
- connectionType: E === "S3" || E === "API" ? "DuckDb" : E,
1148
+ connectionType: V === "S3" || V === "API" ? "DuckDb" : V,
1149
1149
  databaseName: o,
1150
1150
  schemaName: c,
1151
1151
  tableName: d,
@@ -1156,7 +1156,7 @@ function wl({
1156
1156
  richColors: !0
1157
1157
  })) : (x({
1158
1158
  connectionId: i || "",
1159
- connectionType: E || "",
1159
+ connectionType: V || "",
1160
1160
  tableName: d || "",
1161
1161
  datamodelName: T || ""
1162
1162
  }), Ke("Removed from Assistant Scope", {
@@ -1166,32 +1166,32 @@ function wl({
1166
1166
  }));
1167
1167
  }
1168
1168
  function j() {
1169
- const m = St({
1169
+ const m = kt({
1170
1170
  schemaName: t,
1171
1171
  tableName: s,
1172
1172
  modelName: T,
1173
- connectionType: E
1173
+ connectionType: V
1174
1174
  });
1175
1175
  k(!1);
1176
- const y = E === "MSSQL" ? `SELECT top 10 * FROM ${m}` : `SELECT * FROM ${m} LIMIT 10`;
1176
+ const y = V === "MSSQL" ? `SELECT top 10 * FROM ${m}` : `SELECT * FROM ${m} LIMIT 10`;
1177
1177
  N(y), g(!0);
1178
1178
  }
1179
1179
  function $() {
1180
- const m = St({
1180
+ const m = kt({
1181
1181
  schemaName: t,
1182
1182
  tableName: s,
1183
1183
  modelName: T,
1184
- connectionType: E
1184
+ connectionType: V
1185
1185
  });
1186
1186
  N(`SELECT COUNT(*) as count FROM ${m}`), g(!0);
1187
1187
  }
1188
1188
  return /* @__PURE__ */ n("div", { className: "flex grow flex-col space-y-4 px-4", children: [
1189
1189
  /* @__PURE__ */ n("div", { className: "mx-2 flex items-center justify-center gap-2", children: [
1190
1190
  /* @__PURE__ */ n(
1191
- Sa,
1191
+ wa,
1192
1192
  {
1193
- title: `${A() ? "Remove from" : "Add to"} Assistant Scope`,
1194
- pressed: A(),
1193
+ title: `${E() ? "Remove from" : "Add to"} Assistant Scope`,
1194
+ pressed: E(),
1195
1195
  onPressedChange: P,
1196
1196
  variant: "outline",
1197
1197
  className: ee("h-9 px-2", {
@@ -1202,8 +1202,8 @@ function wl({
1202
1202
  Xe,
1203
1203
  {
1204
1204
  className: ee("mr-1 size-4", {
1205
- "text-green-400": A(),
1206
- "text-muted-foreground": !A()
1205
+ "text-green-400": E(),
1206
+ "text-muted-foreground": !E()
1207
1207
  })
1208
1208
  }
1209
1209
  ),
@@ -1241,14 +1241,14 @@ function wl({
1241
1241
  )
1242
1242
  ] }),
1243
1243
  /* @__PURE__ */ n(
1244
- Te,
1244
+ Me,
1245
1245
  {
1246
1246
  className: "flex-1 basis-0 border-b border-t border-muted py-3",
1247
1247
  children: [
1248
1248
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-1", children: a == null ? void 0 : a.map((m) => /* @__PURE__ */ n(
1249
1249
  "div",
1250
1250
  {
1251
- onClick: () => M(m),
1251
+ onClick: () => O(m),
1252
1252
  className: ee(
1253
1253
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-1 text-sm transition-colors hover:bg-muted/50",
1254
1254
  {
@@ -1257,7 +1257,7 @@ function wl({
1257
1257
  ),
1258
1258
  children: [
1259
1259
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
1260
- /* @__PURE__ */ e(Ha, { column: m }),
1260
+ /* @__PURE__ */ e(Pa, { column: m }),
1261
1261
  /* @__PURE__ */ e("span", { children: m.column_name })
1262
1262
  ] }),
1263
1263
  /* @__PURE__ */ e(
@@ -1265,7 +1265,7 @@ function wl({
1265
1265
  {
1266
1266
  onClick: (y) => y.stopPropagation(),
1267
1267
  className: "flex items-center justify-end",
1268
- children: Ca(m.data_type) && /* @__PURE__ */ e(Sl, { column: m })
1268
+ children: Sa(m.data_type) && /* @__PURE__ */ e(Sl, { column: m })
1269
1269
  }
1270
1270
  )
1271
1271
  ]
@@ -1279,10 +1279,10 @@ function wl({
1279
1279
  )
1280
1280
  ] });
1281
1281
  }
1282
- function qe(t, s) {
1283
- var Bt, Gt, Jt, Wt, Kt, Qt;
1284
- let a = kt(() => [], []);
1285
- const l = De().authToken || t, r = p(
1282
+ function Ae(t, s) {
1283
+ var nt, Jt, Wt, Kt, Qt, Zt;
1284
+ let a = Ot(() => [], []);
1285
+ const l = Te().authToken || t, r = p(
1286
1286
  (S) => S.selectedConnectionId
1287
1287
  ), i = p(
1288
1288
  (S) => S.selectedDatamodelId
@@ -1314,11 +1314,11 @@ function qe(t, s) {
1314
1314
  return r && S ? !(S === "API" || S === "S3") : !1;
1315
1315
  }
1316
1316
  const {
1317
- refetch: E,
1317
+ refetch: V,
1318
1318
  data: w,
1319
1319
  isLoading: T,
1320
- isError: M
1321
- } = Fe({
1320
+ isError: O
1321
+ } = Le({
1322
1322
  queryKey: ["connections"],
1323
1323
  queryFn: () => _e(
1324
1324
  "https://semaphor.cloud/api/v1/connections",
@@ -1327,11 +1327,11 @@ function qe(t, s) {
1327
1327
  enabled: !!(l != null && l.accessToken)
1328
1328
  // Only fetch if authToken is present
1329
1329
  }), {
1330
- refetch: A,
1330
+ refetch: E,
1331
1331
  data: P,
1332
1332
  isLoading: j,
1333
1333
  isError: $
1334
- } = Fe({
1334
+ } = Le({
1335
1335
  queryKey: ["models", r],
1336
1336
  queryFn: () => _e(
1337
1337
  "https://semaphor.cloud/api/v1/datamodels",
@@ -1350,7 +1350,7 @@ function qe(t, s) {
1350
1350
  isFetching: B,
1351
1351
  isError: G,
1352
1352
  refetch: Q
1353
- } = Fe({
1353
+ } = Le({
1354
1354
  queryKey: ["databases", r],
1355
1355
  queryFn: () => _e(
1356
1356
  "https://semaphor.cloud/api/v1/databases",
@@ -1367,7 +1367,7 @@ function qe(t, s) {
1367
1367
  isFetching: ce,
1368
1368
  isError: K,
1369
1369
  refetch: R
1370
- } = Fe({
1370
+ } = Le({
1371
1371
  queryKey: ["schemas", r, o],
1372
1372
  queryFn: () => _e(
1373
1373
  "https://semaphor.cloud/api/v1/schemas",
@@ -1385,7 +1385,7 @@ function qe(t, s) {
1385
1385
  isFetching: ne,
1386
1386
  isError: ue,
1387
1387
  refetch: le
1388
- } = Fe({
1388
+ } = Le({
1389
1389
  queryKey: [
1390
1390
  "tables",
1391
1391
  r,
@@ -1406,9 +1406,9 @@ function qe(t, s) {
1406
1406
  data: se,
1407
1407
  isLoading: pe,
1408
1408
  isFetching: z,
1409
- isError: V,
1409
+ isError: A,
1410
1410
  refetch: J
1411
- } = Fe({
1411
+ } = Le({
1412
1412
  queryKey: [
1413
1413
  "columns",
1414
1414
  r,
@@ -1449,95 +1449,95 @@ function qe(t, s) {
1449
1449
  u,
1450
1450
  v
1451
1451
  ]);
1452
- const we = (m == null ? void 0 : m.type) === "API" ? (Bt = m == null ? void 0 : m.type) == null ? void 0 : Bt.toLowerCase() : d || "", je = D ? "" : c || "";
1453
- function Ie(S) {
1452
+ const we = (m == null ? void 0 : m.type) === "API" ? (nt = m == null ? void 0 : m.type) == null ? void 0 : nt.toLowerCase() : d || "", Re = D ? "" : c || "";
1453
+ function je(S) {
1454
1454
  u(S), g("");
1455
1455
  }
1456
- function I(S) {
1456
+ function et(S) {
1457
1457
  x(S === "none" ? "" : S), u(""), g(""), S !== "none" && S !== "" && v("");
1458
1458
  }
1459
- function he(S) {
1459
+ function tt(S) {
1460
1460
  f(S);
1461
1461
  }
1462
- function Le(S) {
1462
+ function I(S) {
1463
1463
  v(S === "none" ? "" : S), S !== "none" && S !== "" && x("");
1464
1464
  }
1465
- C && ((Gt = C == null ? void 0 : C.databases) == null ? void 0 : Gt.length) > 0, W && ((Jt = W == null ? void 0 : W.schemas) == null ? void 0 : Jt.length) > 0, se && ((Wt = se == null ? void 0 : se.columns) == null ? void 0 : Wt.length) > 0 && (a = se.columns.map((S) => ({
1465
+ C && ((Jt = C == null ? void 0 : C.databases) == null ? void 0 : Jt.length) > 0, W && ((Wt = W == null ? void 0 : W.schemas) == null ? void 0 : Wt.length) > 0, se && ((Kt = se == null ? void 0 : se.columns) == null ? void 0 : Kt.length) > 0 && (a = se.columns.map((S) => ({
1466
1466
  ...S,
1467
1467
  data_type: S.data_type.toLowerCase()
1468
- }))), G && (a = []), (V || M) && (a = []);
1469
- const fe = w == null ? void 0 : w.connections.map(
1468
+ }))), G && (a = []), (A || O) && (a = []);
1469
+ const he = w == null ? void 0 : w.connections.map(
1470
1470
  (S) => ({
1471
1471
  id: S.id,
1472
1472
  name: S.name,
1473
1473
  type: S.type
1474
1474
  })
1475
- ), $e = (Kt = P == null ? void 0 : P.datamodels) == null ? void 0 : Kt.map((S) => ({
1475
+ ), De = (Qt = P == null ? void 0 : P.datamodels) == null ? void 0 : Qt.map((S) => ({
1476
1476
  id: S.id,
1477
1477
  name: S.name
1478
- })), vt = C == null ? void 0 : C.databases.map((S) => ({
1478
+ })), fe = C == null ? void 0 : C.databases.map((S) => ({
1479
1479
  id: S.database_name,
1480
1480
  name: S.database_name
1481
- })), et = W == null ? void 0 : W.schemas.map((S) => ({
1481
+ })), $e = W == null ? void 0 : W.schemas.map((S) => ({
1482
1482
  id: S.schema_name,
1483
1483
  name: S.schema_name
1484
- })), xt = F == null ? void 0 : F.tables.map((S) => ({
1484
+ })), Ct = F == null ? void 0 : F.tables.map((S) => ({
1485
1485
  id: S.table_name,
1486
1486
  name: S.table_name
1487
- })), on = (Qt = P == null ? void 0 : P.datamodels.find(
1487
+ })), at = (Zt = P == null ? void 0 : P.datamodels.find(
1488
1488
  (S) => S.id === i
1489
- )) == null ? void 0 : Qt.name;
1489
+ )) == null ? void 0 : Zt.name;
1490
1490
  return {
1491
- connectionItems: fe,
1491
+ connectionItems: he,
1492
1492
  isConnectionsLoading: T,
1493
- isConnectionsError: M,
1494
- modelItems: $e,
1493
+ isConnectionsError: O,
1494
+ modelItems: De,
1495
1495
  selectedDatamodelId: i,
1496
- selectedDatamodelName: on,
1496
+ selectedDatamodelName: at,
1497
1497
  isModelsLoading: j,
1498
1498
  isModelsError: $,
1499
- databaseItems: vt,
1499
+ databaseItems: fe,
1500
1500
  isDatabasesLoadingOrFetching: q || B,
1501
1501
  isDatabaseError: G,
1502
- schemaItems: et,
1502
+ schemaItems: $e,
1503
1503
  isSchemaLoadingOrFetching: oe || ce,
1504
1504
  isSchemaError: K,
1505
- tableItems: xt,
1505
+ tableItems: Ct,
1506
1506
  isTableLoadingOrFetching: de || ne,
1507
1507
  isTableError: ue,
1508
1508
  columns: a,
1509
1509
  isColumnsLoadingOrFetching: pe || z,
1510
- isColumnsError: V,
1510
+ isColumnsError: A,
1511
1511
  isNonDbConnection: D,
1512
1512
  connectionType: y,
1513
1513
  tableName: we,
1514
- schemaName: je,
1515
- refetchConnections: E,
1516
- refetchModels: A,
1514
+ schemaName: Re,
1515
+ refetchConnections: V,
1516
+ refetchModels: E,
1517
1517
  refetchDatabases: Q,
1518
1518
  refetchSchemas: R,
1519
1519
  refetchTables: le,
1520
1520
  refetchColumns: J,
1521
- handleConnectionChange: he,
1522
- handleDatamodelChange: Le,
1523
- handleDatabaseChange: I,
1524
- handleSchemaChange: Ie
1521
+ handleConnectionChange: tt,
1522
+ handleDatamodelChange: I,
1523
+ handleDatabaseChange: et,
1524
+ handleSchemaChange: je
1525
1525
  };
1526
1526
  }
1527
- function Pa({
1527
+ function $a({
1528
1528
  ColumnsComponent: t
1529
1529
  }) {
1530
1530
  var z;
1531
1531
  const s = p(
1532
- (V) => V.selectedConnectionId
1532
+ (A) => A.selectedConnectionId
1533
1533
  ), a = p(
1534
- (V) => V.selectedDatamodelId
1534
+ (A) => A.selectedDatamodelId
1535
1535
  ), l = p(
1536
- (V) => V.selectedDatabaseName
1536
+ (A) => A.selectedDatabaseName
1537
1537
  ), r = p(
1538
- (V) => V.selectedSchemaName
1539
- ), i = p((V) => V.selectedTableName), o = p(
1540
- (V) => V.actions.setSelectedTableName
1538
+ (A) => A.selectedSchemaName
1539
+ ), i = p((A) => A.selectedTableName), o = p(
1540
+ (A) => A.actions.setSelectedTableName
1541
1541
  ), {
1542
1542
  connectionItems: c,
1543
1543
  modelItems: d,
@@ -1550,11 +1550,11 @@ function Pa({
1550
1550
  isConnectionsError: b,
1551
1551
  isModelsError: k,
1552
1552
  isDatabasesLoadingOrFetching: N,
1553
- isDatabaseError: E,
1553
+ isDatabaseError: V,
1554
1554
  isSchemaLoadingOrFetching: w,
1555
1555
  isSchemaError: T,
1556
- isColumnsError: M,
1557
- isColumnsLoadingOrFetching: A,
1556
+ isColumnsError: O,
1557
+ isColumnsLoadingOrFetching: E,
1558
1558
  isTableLoadingOrFetching: P,
1559
1559
  isTableError: j,
1560
1560
  connectionType: $,
@@ -1571,7 +1571,7 @@ function Pa({
1571
1571
  handleDatamodelChange: ce,
1572
1572
  tableName: K,
1573
1573
  schemaName: R
1574
- } = qe();
1574
+ } = Ae();
1575
1575
  function F() {
1576
1576
  return t ? t(R, K, x) : /* @__PURE__ */ e(
1577
1577
  wl,
@@ -1579,7 +1579,7 @@ function Pa({
1579
1579
  schemaName: R,
1580
1580
  tableName: K,
1581
1581
  columns: x,
1582
- status: A ? "Loading..." : M ? "Error" : "Success"
1582
+ status: E ? "Loading..." : O ? "Error" : "Success"
1583
1583
  }
1584
1584
  );
1585
1585
  }
@@ -1595,7 +1595,7 @@ function Pa({
1595
1595
  refetch: y,
1596
1596
  showNone: !0,
1597
1597
  onChange: W,
1598
- isError: E,
1598
+ isError: V,
1599
1599
  isLoading: N,
1600
1600
  items: f,
1601
1601
  value: l || "",
@@ -1643,11 +1643,11 @@ function Pa({
1643
1643
  );
1644
1644
  }
1645
1645
  function pe() {
1646
- function V() {
1646
+ function A() {
1647
1647
  let J = !1;
1648
1648
  return $ === "API" ? (J = !1, J) : (($ === "S3" || s && l && l !== "none" && r) && (J = !0), J);
1649
1649
  }
1650
- return V() ? /* @__PURE__ */ e(
1650
+ return A() ? /* @__PURE__ */ e(
1651
1651
  Ue,
1652
1652
  {
1653
1653
  refetch: q,
@@ -1673,7 +1673,7 @@ function Pa({
1673
1673
  isLoading: u,
1674
1674
  isError: b,
1675
1675
  connectionTooltip: ((z = c == null ? void 0 : c.find(
1676
- (V) => V.id === s
1676
+ (A) => A.id === s
1677
1677
  )) == null ? void 0 : z.type) || ""
1678
1678
  }
1679
1679
  ),
@@ -1715,42 +1715,26 @@ function kl(t) {
1715
1715
  return console.log("beforeClause", o), console.log("afterClause", c), c ? `${o} {{ filters | where }} ${c}` : `${o.replace(/;$/, "")} {{ filters | where }}`;
1716
1716
  }
1717
1717
  }
1718
- function zl({
1719
- sql: t,
1720
- error: s,
1721
- setShowAIDialog: a,
1722
- setUserInputforAI: l,
1723
- setTriggerAIRun: r
1724
- }) {
1725
- return !t && !s ? null : /* @__PURE__ */ n(ba, { openDelay: s ? 0 : 500, children: [
1726
- /* @__PURE__ */ e(ya, { asChild: !0, children: /* @__PURE__ */ e(L, { variant: "link", className: "h-5 p-0", children: s ? /* @__PURE__ */ e(Us, { className: "h-4 w-4 text-red-500" }) : /* @__PURE__ */ e(xn, { className: "h-4 w-4 text-muted-foreground" }) }) }),
1718
+ function zl({ sql: t, error: s, onClick: a }) {
1719
+ return !t && !s ? null : /* @__PURE__ */ n(ya, { openDelay: s ? 0 : 500, children: [
1720
+ /* @__PURE__ */ e(va, { asChild: !0, children: /* @__PURE__ */ e(L, { variant: "link", className: "h-5 p-0", children: s ? /* @__PURE__ */ e(Us, { className: "h-4 w-4 text-red-500" }) : /* @__PURE__ */ e(xn, { className: "h-4 w-4 text-muted-foreground" }) }) }),
1727
1721
  /* @__PURE__ */ e(
1728
- va,
1722
+ xa,
1729
1723
  {
1730
1724
  align: "start",
1731
1725
  className: "w-full min-w-fit max-w-[700px]",
1732
1726
  children: /* @__PURE__ */ e("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ n("div", { className: "flex grow flex-col space-y-2", children: [
1733
- /* @__PURE__ */ n(Te, { className: "max-h-[250px] min-h-0 overflow-scroll text-xs leading-relaxed text-foreground/80", children: [
1727
+ /* @__PURE__ */ n(Me, { className: "max-h-[250px] min-h-0 overflow-scroll text-xs leading-relaxed text-foreground/80", children: [
1734
1728
  s && s,
1735
1729
  t && /* @__PURE__ */ n("div", { className: "flex flex-col space-y-1.5", children: [
1736
1730
  /* @__PURE__ */ e("span", { className: "text-xs font-semibold", children: "Resolved SQL" }),
1737
1731
  /* @__PURE__ */ e("span", { className: "font-mono", children: t })
1738
1732
  ] })
1739
1733
  ] }),
1740
- s && /* @__PURE__ */ n(
1741
- L,
1742
- {
1743
- onClick: () => {
1744
- a(!0), l(s), r(!0);
1745
- },
1746
- size: "sm",
1747
- variant: "secondary",
1748
- children: [
1749
- /* @__PURE__ */ e(Zs, { className: "mr-2 h-4 w-4" }),
1750
- "Debug with Assistant"
1751
- ]
1752
- }
1753
- )
1734
+ s && /* @__PURE__ */ n(L, { onClick: a, size: "sm", variant: "secondary", children: [
1735
+ /* @__PURE__ */ e(Zs, { className: "mr-2 h-4 w-4" }),
1736
+ "Debug with Assistant"
1737
+ ] })
1754
1738
  ] }) })
1755
1739
  }
1756
1740
  )
@@ -1763,23 +1747,23 @@ function Ol({
1763
1747
  open: l,
1764
1748
  setOpen: r
1765
1749
  }) {
1766
- const i = Ge(null), o = Ge(null), [c, d] = _([]), [h, f] = _(""), [v, x] = _(null), { authToken: u } = De(), g = p((z) => {
1767
- var V;
1768
- return (V = z == null ? void 0 : z.card) == null ? void 0 : V.sql;
1750
+ const i = Ge(null), o = Ge(null), [c, d] = _([]), [h, f] = _(""), [v, x] = _(null), { authToken: u } = Te(), g = p((z) => {
1751
+ var A;
1752
+ return (A = z == null ? void 0 : z.card) == null ? void 0 : A.sql;
1769
1753
  }), b = p((z) => {
1770
- var V;
1771
- return (V = z == null ? void 0 : z.card) == null ? void 0 : V.python;
1772
- }), k = p((z) => z.actions.setCardSql), N = p((z) => z.actions.setRunSql), E = p(
1754
+ var A;
1755
+ return (A = z == null ? void 0 : z.card) == null ? void 0 : A.python;
1756
+ }), k = p((z) => z.actions.setCardSql), N = p((z) => z.actions.setRunSql), V = p(
1773
1757
  (z) => z.actions.switchCardType
1774
1758
  ), w = p(
1775
1759
  (z) => z.selectedDatabaseName
1776
- ), T = p((z) => z.selectedTableName), M = p(
1760
+ ), T = p((z) => z.selectedTableName), O = p(
1777
1761
  (z) => z.selectedConnectionId
1778
- ), A = p(
1762
+ ), E = p(
1779
1763
  (z) => z.selectedSchemaName
1780
- ), P = O(
1764
+ ), P = M(
1781
1765
  (z) => z.dashboard.aiScopeTables
1782
- ), { selectedDatamodelName: j, connectionType: $ } = qe(), {
1766
+ ), { selectedDatamodelName: j, connectionType: $ } = Ae(), {
1783
1767
  messages: m,
1784
1768
  setMessages: y,
1785
1769
  reload: D,
@@ -1801,8 +1785,8 @@ function Ol({
1801
1785
  maxSteps: 10,
1802
1786
  //maxToolRoundtrips: 5,
1803
1787
  onToolCall: F,
1804
- onFinish(z, V) {
1805
- K(V.usage), f(""), console.log("onFinish", z, V), V.finishReason === "stop" && f("");
1788
+ onFinish(z, A) {
1789
+ K(A.usage), f(""), console.log("onFinish", z, A), A.finishReason === "stop" && f("");
1806
1790
  }
1807
1791
  });
1808
1792
  re(() => {
@@ -1822,33 +1806,33 @@ function Ol({
1822
1806
  re(() => {
1823
1807
  const z = ce.current ? "smooth" : "auto";
1824
1808
  ce.current = l;
1825
- const V = setTimeout(() => {
1809
+ const A = setTimeout(() => {
1826
1810
  var J;
1827
1811
  o.current && (o.current.scroll({
1828
1812
  top: o.current.scrollHeight,
1829
1813
  behavior: z
1830
1814
  }), (J = i.current) == null || J.focus());
1831
1815
  }, 50);
1832
- return () => clearTimeout(V);
1816
+ return () => clearTimeout(A);
1833
1817
  }, [m, l]);
1834
1818
  function K(z) {
1835
- x((V) => V ? {
1836
- promptTokens: V.promptTokens + z.promptTokens,
1837
- completionTokens: V.completionTokens + z.completionTokens,
1838
- totalTokens: V.totalTokens + z.totalTokens
1819
+ x((A) => A ? {
1820
+ promptTokens: A.promptTokens + z.promptTokens,
1821
+ completionTokens: A.completionTokens + z.completionTokens,
1822
+ totalTokens: A.totalTokens + z.totalTokens
1839
1823
  } : z);
1840
1824
  }
1841
1825
  function R(z) {
1842
- const V = Cn(c, z);
1843
- ne(V);
1826
+ const A = Sn(c, z);
1827
+ ne(A);
1844
1828
  }
1845
1829
  async function F({
1846
1830
  toolCall: z
1847
1831
  }) {
1848
1832
  if (z.toolName === "createChart") {
1849
1833
  console.log("createChart", z.args);
1850
- const V = z.args.sql, J = z.args.chartType;
1851
- return E(J), k(V), N(!0), {
1834
+ const A = z.args.sql, J = z.args.chartType;
1835
+ return V(J), k(A), N(!0), {
1852
1836
  status: "success",
1853
1837
  message: "Let the user know that chart is created"
1854
1838
  // query: sql,
@@ -1865,6 +1849,11 @@ function Ol({
1865
1849
  status: "error",
1866
1850
  message: "No SQL found"
1867
1851
  };
1852
+ if (z.toolName === "getCurrentTableScope")
1853
+ return f("Getting table scope..."), le(), {
1854
+ status: "success",
1855
+ tables: c
1856
+ };
1868
1857
  f("Thinking...");
1869
1858
  }
1870
1859
  }
@@ -1875,41 +1864,41 @@ function Ol({
1875
1864
  }));
1876
1865
  }
1877
1866
  function ne(z) {
1878
- const V = de(z);
1879
- d(V), y((J) => [
1867
+ const A = de(z);
1868
+ d(A), y((J) => [
1880
1869
  ...J,
1881
1870
  {
1882
1871
  id: crypto.randomUUID(),
1883
1872
  role: "system",
1884
- content: `Current scope of tables | ${JSON.stringify(V)}`
1873
+ content: `Current scope of tables | ${JSON.stringify(A)}`
1885
1874
  }
1886
1875
  ]);
1887
1876
  }
1888
1877
  function ue() {
1889
1878
  const z = {
1890
1879
  databaseName: w || "",
1891
- schemaName: A || "",
1880
+ schemaName: E || "",
1892
1881
  tableName: T || "",
1893
1882
  datamodelName: j || "",
1894
- connectionId: M || "",
1883
+ connectionId: O || "",
1895
1884
  connectionType: $ || ""
1896
- }, V = Xt([...c, z]);
1897
- ne(V);
1885
+ }, A = Yt([...c, z]);
1886
+ ne(A);
1898
1887
  }
1899
1888
  function le() {
1900
1889
  const z = {
1901
1890
  databaseName: w || "",
1902
- schemaName: A || "",
1891
+ schemaName: E || "",
1903
1892
  tableName: T || "",
1904
1893
  datamodelName: j || "",
1905
- connectionId: M || "",
1894
+ connectionId: O || "",
1906
1895
  connectionType: $ || ""
1907
- }, V = Sn(
1896
+ };
1897
+ if (!Cn(
1908
1898
  [...P || [], ...c],
1909
1899
  z
1910
- );
1911
- if (console.log("isInScope", V), !V || c.length === 0) {
1912
- const J = Xt([
1900
+ ) || c.length === 0) {
1901
+ const J = Yt([
1913
1902
  ...P || [],
1914
1903
  ...c,
1915
1904
  z
@@ -1932,7 +1921,7 @@ function Ol({
1932
1921
  setInput: B,
1933
1922
  isLoading: pe,
1934
1923
  handleRun: se,
1935
- handleOpenDialogAndSetScope: le,
1924
+ handleSetAIScope: le,
1936
1925
  handleAddCurrentTableToScope: ue,
1937
1926
  removeFromCurrentSelections: R,
1938
1927
  currentScope: c,
@@ -1947,15 +1936,15 @@ function Ol({
1947
1936
  llmUsage: v
1948
1937
  };
1949
1938
  }
1950
- const Ml = !1;
1951
- function Tl({
1939
+ const Il = !1;
1940
+ function Ml({
1952
1941
  open: t,
1953
1942
  setOpen: s,
1954
1943
  userInput: a,
1955
1944
  triggerAIRun: l,
1956
1945
  setTriggerAIRun: r
1957
1946
  }) {
1958
- const [i, o] = _(!1), [c, d] = _(Ml), [h, f] = _(!1), {
1947
+ const [i, o] = _(!1), [c, d] = _(Il), [h, f] = _(!1), {
1959
1948
  messages: v,
1960
1949
  setMessages: x,
1961
1950
  reload: u,
@@ -1963,11 +1952,11 @@ function Tl({
1963
1952
  setInput: b,
1964
1953
  isLoading: k,
1965
1954
  handleRun: N,
1966
- handleOpenDialogAndSetScope: E,
1955
+ handleSetAIScope: V,
1967
1956
  handleAddCurrentTableToScope: w,
1968
1957
  removeFromCurrentSelections: T,
1969
- currentScope: M,
1970
- setCurrentScope: A,
1958
+ currentScope: O,
1959
+ setCurrentScope: E,
1971
1960
  containerRef: P,
1972
1961
  inputRef: j,
1973
1962
  handleInputChange: $,
@@ -1984,13 +1973,13 @@ function Tl({
1984
1973
  setOpen: s
1985
1974
  });
1986
1975
  function B() {
1987
- return /* @__PURE__ */ n(Ft, { children: [
1988
- /* @__PURE__ */ e(Vt, { children: /* @__PURE__ */ e(L, { className: "h-7 p-2", size: "sm", variant: "ghost", children: /* @__PURE__ */ e(Ht, { className: "size-3.5 text-muted-foreground/70 hover:text-muted-foreground" }) }) }),
1989
- /* @__PURE__ */ n(Et, { align: "end", children: [
1990
- /* @__PURE__ */ e(ua, { children: "Options" }),
1991
- /* @__PURE__ */ e(ha, {}),
1976
+ return /* @__PURE__ */ n(Et, { children: [
1977
+ /* @__PURE__ */ e(At, { children: /* @__PURE__ */ e(L, { className: "h-7 p-2", size: "sm", variant: "ghost", children: /* @__PURE__ */ e($t, { className: "size-3.5 text-muted-foreground/70 hover:text-muted-foreground" }) }) }),
1978
+ /* @__PURE__ */ n(qt, { align: "end", children: [
1979
+ /* @__PURE__ */ e(ha, { children: "Options" }),
1980
+ /* @__PURE__ */ e(ma, {}),
1992
1981
  /* @__PURE__ */ e(
1993
- Nt,
1982
+ St,
1994
1983
  {
1995
1984
  checked: i,
1996
1985
  onCheckedChange: o,
@@ -1998,7 +1987,7 @@ function Tl({
1998
1987
  }
1999
1988
  ),
2000
1989
  /* @__PURE__ */ e(
2001
- Nt,
1990
+ St,
2002
1991
  {
2003
1992
  checked: c,
2004
1993
  onCheckedChange: d,
@@ -2006,7 +1995,7 @@ function Tl({
2006
1995
  }
2007
1996
  ),
2008
1997
  /* @__PURE__ */ e(
2009
- Nt,
1998
+ St,
2010
1999
  {
2011
2000
  checked: h,
2012
2001
  onCheckedChange: f,
@@ -2016,29 +2005,29 @@ function Tl({
2016
2005
  ] })
2017
2006
  ] });
2018
2007
  }
2019
- return /* @__PURE__ */ n(Mt, { open: t, onOpenChange: s, children: [
2020
- /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ e(
2008
+ return /* @__PURE__ */ n(Tt, { open: t, onOpenChange: s, children: [
2009
+ /* @__PURE__ */ e(Dt, { asChild: !0, children: /* @__PURE__ */ e(
2021
2010
  L,
2022
2011
  {
2023
- onClick: E,
2012
+ onClick: V,
2024
2013
  size: "sm",
2025
2014
  className: "w-full cursor-text justify-start font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
2026
2015
  variant: "ghost",
2027
2016
  children: "Type your question..."
2028
2017
  }
2029
2018
  ) }),
2030
- /* @__PURE__ */ n(Dt, { className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[700px] md:min-w-[625px] [&>button]:hidden", children: [
2031
- /* @__PURE__ */ e(It, { children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-2", children: [
2019
+ /* @__PURE__ */ n(Lt, { className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[700px] md:min-w-[625px] [&>button]:hidden", children: [
2020
+ /* @__PURE__ */ e(Ft, { children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-2", children: [
2032
2021
  /* @__PURE__ */ n("div", { children: [
2033
- /* @__PURE__ */ e(Lt, { children: "Assistant" }),
2034
- M && M.length > 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
2022
+ /* @__PURE__ */ e(Vt, { children: "Assistant" }),
2023
+ O && O.length > 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
2035
2024
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Context:" }),
2036
- M == null ? void 0 : M.map((G, Q) => /* @__PURE__ */ n(
2025
+ O == null ? void 0 : O.map((G, Q) => /* @__PURE__ */ n(
2037
2026
  "div",
2038
2027
  {
2039
2028
  className: "flex items-center gap-2 rounded-md border border-border bg-muted px-2 py-1 text-xs",
2040
2029
  children: [
2041
- St({
2030
+ kt({
2042
2031
  schemaName: G.schemaName || "",
2043
2032
  tableName: G.tableName || "",
2044
2033
  modelName: G.datamodelName || "",
@@ -2058,7 +2047,7 @@ function Tl({
2058
2047
  Q
2059
2048
  ))
2060
2049
  ] }),
2061
- (M == null ? void 0 : M.length) === 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-2", children: [
2050
+ (O == null ? void 0 : O.length) === 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-2", children: [
2062
2051
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Context: None" }),
2063
2052
  /* @__PURE__ */ n(
2064
2053
  L,
@@ -2084,7 +2073,7 @@ function Tl({
2084
2073
  size: "sm",
2085
2074
  variant: "ghost",
2086
2075
  onClick: () => {
2087
- x([]), A([]), u();
2076
+ x([]), E([]), u();
2088
2077
  },
2089
2078
  children: /* @__PURE__ */ e(wn, { className: "size-3.5 text-muted-foreground" })
2090
2079
  }
@@ -2110,7 +2099,7 @@ function Tl({
2110
2099
  )
2111
2100
  ] }) }),
2112
2101
  /* @__PURE__ */ e(
2113
- Mn,
2102
+ In,
2114
2103
  {
2115
2104
  stop: y,
2116
2105
  ref: j,
@@ -2135,14 +2124,14 @@ function Tl({
2135
2124
  ] })
2136
2125
  ] });
2137
2126
  }
2138
- var $a = {
2127
+ var Ua = {
2139
2128
  color: void 0,
2140
2129
  size: void 0,
2141
2130
  className: void 0,
2142
2131
  style: void 0,
2143
2132
  attr: void 0
2144
- }, sa = Me.createContext && /* @__PURE__ */ Me.createContext($a), Dl = ["attr", "size", "title"];
2145
- function Il(t, s) {
2133
+ }, la = Ie.createContext && /* @__PURE__ */ Ie.createContext(Ua), Tl = ["attr", "size", "title"];
2134
+ function Dl(t, s) {
2146
2135
  if (t == null) return {};
2147
2136
  var a = Ll(t, s), l, r;
2148
2137
  if (Object.getOwnPropertySymbols) {
@@ -2162,17 +2151,17 @@ function Ll(t, s) {
2162
2151
  }
2163
2152
  return a;
2164
2153
  }
2165
- function ct() {
2166
- return ct = Object.assign ? Object.assign.bind() : function(t) {
2154
+ function ht() {
2155
+ return ht = Object.assign ? Object.assign.bind() : function(t) {
2167
2156
  for (var s = 1; s < arguments.length; s++) {
2168
2157
  var a = arguments[s];
2169
2158
  for (var l in a)
2170
2159
  Object.prototype.hasOwnProperty.call(a, l) && (t[l] = a[l]);
2171
2160
  }
2172
2161
  return t;
2173
- }, ct.apply(this, arguments);
2162
+ }, ht.apply(this, arguments);
2174
2163
  }
2175
- function la(t, s) {
2164
+ function ra(t, s) {
2176
2165
  var a = Object.keys(t);
2177
2166
  if (Object.getOwnPropertySymbols) {
2178
2167
  var l = Object.getOwnPropertySymbols(t);
@@ -2182,12 +2171,12 @@ function la(t, s) {
2182
2171
  }
2183
2172
  return a;
2184
2173
  }
2185
- function dt(t) {
2174
+ function mt(t) {
2186
2175
  for (var s = 1; s < arguments.length; s++) {
2187
2176
  var a = arguments[s] != null ? arguments[s] : {};
2188
- s % 2 ? la(Object(a), !0).forEach(function(l) {
2177
+ s % 2 ? ra(Object(a), !0).forEach(function(l) {
2189
2178
  Fl(t, l, a[l]);
2190
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : la(Object(a)).forEach(function(l) {
2179
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : ra(Object(a)).forEach(function(l) {
2191
2180
  Object.defineProperty(t, l, Object.getOwnPropertyDescriptor(a, l));
2192
2181
  });
2193
2182
  }
@@ -2210,15 +2199,15 @@ function El(t, s) {
2210
2199
  }
2211
2200
  return (s === "string" ? String : Number)(t);
2212
2201
  }
2213
- function Ua(t) {
2214
- return t && t.map((s, a) => /* @__PURE__ */ Me.createElement(s.tag, dt({
2202
+ function Ba(t) {
2203
+ return t && t.map((s, a) => /* @__PURE__ */ Ie.createElement(s.tag, mt({
2215
2204
  key: a
2216
- }, s.attr), Ua(s.child)));
2205
+ }, s.attr), Ba(s.child)));
2217
2206
  }
2218
2207
  function ge(t) {
2219
- return (s) => /* @__PURE__ */ Me.createElement(Al, ct({
2220
- attr: dt({}, t.attr)
2221
- }, s), Ua(t.child));
2208
+ return (s) => /* @__PURE__ */ Ie.createElement(Al, ht({
2209
+ attr: mt({}, t.attr)
2210
+ }, s), Ba(t.child));
2222
2211
  }
2223
2212
  function Al(t) {
2224
2213
  var s = (a) => {
@@ -2226,30 +2215,30 @@ function Al(t) {
2226
2215
  attr: l,
2227
2216
  size: r,
2228
2217
  title: i
2229
- } = t, o = Il(t, Dl), c = r || a.size || "1em", d;
2230
- return a.className && (d = a.className), t.className && (d = (d ? d + " " : "") + t.className), /* @__PURE__ */ Me.createElement("svg", ct({
2218
+ } = t, o = Dl(t, Tl), c = r || a.size || "1em", d;
2219
+ return a.className && (d = a.className), t.className && (d = (d ? d + " " : "") + t.className), /* @__PURE__ */ Ie.createElement("svg", ht({
2231
2220
  stroke: "currentColor",
2232
2221
  fill: "currentColor",
2233
2222
  strokeWidth: "0"
2234
2223
  }, a.attr, l, o, {
2235
2224
  className: d,
2236
- style: dt(dt({
2225
+ style: mt(mt({
2237
2226
  color: t.color || a.color
2238
2227
  }, a.style), t.style),
2239
2228
  height: c,
2240
2229
  width: c,
2241
2230
  xmlns: "http://www.w3.org/2000/svg"
2242
- }), i && /* @__PURE__ */ Me.createElement("title", null, i), t.children);
2231
+ }), i && /* @__PURE__ */ Ie.createElement("title", null, i), t.children);
2243
2232
  };
2244
- return sa !== void 0 ? /* @__PURE__ */ Me.createElement(sa.Consumer, null, (a) => s(a)) : s($a);
2233
+ return la !== void 0 ? /* @__PURE__ */ Ie.createElement(la.Consumer, null, (a) => s(a)) : s(Ua);
2245
2234
  }
2246
2235
  function ql(t) {
2247
2236
  return ge({ 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: [] }] })(t);
2248
2237
  }
2249
- function Ba(t) {
2250
- const { theme: s } = Tn(), a = O((b) => b.theme), l = p((b) => b.frame), r = p((b) => b.card), i = p((b) => b.activeTabCardId), o = Dn(), { refetch: c } = Ee(r), { updateCardTab: d, setRunSql: h } = ie(), f = Ge(), v = Ge({}), x = l.cards.find((b) => b.id === i), u = Va(() => {
2238
+ function Ga(t) {
2239
+ const { theme: s } = Mn(), a = M((b) => b.theme), l = p((b) => b.frame), r = p((b) => b.card), i = p((b) => b.activeTabCardId), o = Tn(), { refetch: c } = Ve(r), { updateCardTab: d, setRunSql: h } = ie(), f = Ge(), v = Ge({}), x = l.cards.find((b) => b.id === i), u = Ea(() => {
2251
2240
  let b = "";
2252
- return t === "python" && (b = (x == null ? void 0 : x.python) || wa), t === "sql" && (b = (x == null ? void 0 : x.sql) || ""), b;
2241
+ return t === "python" && (b = (x == null ? void 0 : x.python) || ka), t === "sql" && (b = (x == null ? void 0 : x.sql) || ""), b;
2253
2242
  }, [t, x]);
2254
2243
  re(() => {
2255
2244
  if (i && r.id && r.id !== i) {
@@ -2282,7 +2271,7 @@ function Ba(t) {
2282
2271
  inherit: !0,
2283
2272
  rules: [],
2284
2273
  colors: {
2285
- "editor.background": k === "light" ? "#ffffff" : In("240 10% 10%")
2274
+ "editor.background": k === "light" ? "#ffffff" : Dn("240 10% 10%")
2286
2275
  // 'editor.background':
2287
2276
  // activeTheme === 'light'
2288
2277
  // ? '#ffffff'
@@ -2300,20 +2289,20 @@ function Ba(t) {
2300
2289
  }, [o, c, r]);
2301
2290
  function g(b, k) {
2302
2291
  if (f.current = b, !v.current[r.id]) {
2303
- const N = b.getModel(), E = u();
2304
- v.current[r.id] = N || (k == null ? void 0 : k.editor.createModel(E, t)) || b.getModel();
2292
+ const N = b.getModel(), V = u();
2293
+ v.current[r.id] = N || (k == null ? void 0 : k.editor.createModel(V, t)) || b.getModel();
2305
2294
  }
2306
2295
  b.setModel(v.current[r.id]);
2307
2296
  }
2308
2297
  return { handleEditorDidMount: g };
2309
2298
  }
2310
2299
  function Rl() {
2311
- const t = p((o) => o.card.sql), s = p((o) => o.sqlGen), { setCardSql: a, setSqlGen: l } = ie(), { handleEditorDidMount: r } = Ba("sql");
2300
+ const t = p((o) => o.card.sql), s = p((o) => o.sqlGen), { setCardSql: a, setSqlGen: l } = ie(), { handleEditorDidMount: r } = Ga("sql");
2312
2301
  function i(o) {
2313
2302
  a(o), Ln(s) || l({});
2314
2303
  }
2315
2304
  return /* @__PURE__ */ e(
2316
- ht,
2305
+ ft,
2317
2306
  {
2318
2307
  theme: "default",
2319
2308
  className: "pt-3",
@@ -2337,17 +2326,17 @@ function Rl() {
2337
2326
  );
2338
2327
  }
2339
2328
  function jl() {
2340
- const t = p((r) => r.card.python), { setCardPython: s } = ie(), { handleEditorDidMount: a } = Ba("python");
2329
+ const t = p((r) => r.card.python), { setCardPython: s } = ie(), { handleEditorDidMount: a } = Ga("python");
2341
2330
  function l(r) {
2342
2331
  s(r);
2343
2332
  }
2344
2333
  return /* @__PURE__ */ e(
2345
- ht,
2334
+ ft,
2346
2335
  {
2347
2336
  className: "pt-3",
2348
2337
  theme: "default",
2349
2338
  onChange: l,
2350
- value: t || wa,
2339
+ value: t || ka,
2351
2340
  options: {
2352
2341
  minimap: {
2353
2342
  enabled: !1
@@ -2367,7 +2356,7 @@ function jl() {
2367
2356
  }
2368
2357
  function _l({ jsonString: t }) {
2369
2358
  return /* @__PURE__ */ e(
2370
- ht,
2359
+ ft,
2371
2360
  {
2372
2361
  theme: "default",
2373
2362
  defaultLanguage: "json",
@@ -2392,7 +2381,7 @@ function _l({ jsonString: t }) {
2392
2381
  );
2393
2382
  }
2394
2383
  function Hl() {
2395
- var Ie;
2384
+ var tt;
2396
2385
  const [t, s] = _({
2397
2386
  queryKey: [],
2398
2387
  queryData: null
@@ -2400,16 +2389,16 @@ function Hl() {
2400
2389
  (I) => I.selectedConnectionId
2401
2390
  ), N = p(
2402
2391
  (I) => I.selectedDatabaseName
2403
- ), E = p(
2392
+ ), V = p(
2404
2393
  (I) => I.selectedDatamodelId
2405
2394
  ), w = p(
2406
2395
  (I) => I.selectedSchemaName
2407
- ), T = p((I) => I.selectedTableName), M = p((I) => {
2396
+ ), T = p((I) => I.selectedTableName), O = p((I) => {
2408
2397
  var he;
2409
2398
  return (he = I == null ? void 0 : I.card) == null ? void 0 : he.sql;
2410
2399
  });
2411
2400
  p((I) => I.applyFilters);
2412
- const { sheetFilterValues: A } = Vn(), {
2401
+ const { sheetFilterValues: E } = Vn(), {
2413
2402
  setCardCustomCfg: P,
2414
2403
  setQueryResultColumns: j,
2415
2404
  setCardSql: $,
@@ -2429,13 +2418,13 @@ function Hl() {
2429
2418
  error: ue,
2430
2419
  queryKey: le,
2431
2420
  refetch: se
2432
- } = Ee(g);
2421
+ } = Ve(g);
2433
2422
  re(() => {
2434
2423
  if (K && (K.rowLimitExceeded && Ke.error("Row limit (10,000) exceeded. Refine your query.", {
2435
2424
  position: "top-center",
2436
2425
  richColors: !0
2437
2426
  }), m((K == null ? void 0 : K.output) || ""), K.records.length > 0)) {
2438
- const { dimensionKeys: I } = wt(K.records);
2427
+ const { dimensionKeys: I } = zt(K.records);
2439
2428
  j(I);
2440
2429
  }
2441
2430
  }, [K, j, m]), re(() => {
@@ -2465,41 +2454,41 @@ function Hl() {
2465
2454
  if (I.length === 0)
2466
2455
  return "";
2467
2456
  if (he) {
2468
- const Le = I.find((fe) => fe.id === he);
2469
- if (Le) {
2470
- const fe = Le.tabTitle;
2457
+ const De = I.find((fe) => fe.id === he);
2458
+ if (De) {
2459
+ const fe = De.tabTitle;
2471
2460
  if (fe == "All__Header")
2472
2461
  return I[0].id;
2473
2462
  if (fe && fe.endsWith("__Header")) {
2474
- const vt = fe.split("__")[0], et = I.find(
2475
- (xt) => xt.tabTitle === vt
2463
+ const Ct = fe.split("__")[0], at = I.find(
2464
+ (nt) => nt.tabTitle === Ct
2476
2465
  );
2477
- return et ? et.id : I[0].id;
2466
+ return at ? at.id : I[0].id;
2478
2467
  }
2479
2468
  return he;
2480
2469
  }
2481
2470
  }
2482
2471
  return I[0].id;
2483
2472
  }
2484
- function V() {
2485
- let I = M;
2486
- M && !M.includes("{{") && (I = kl(M), $(I));
2473
+ function A() {
2474
+ let I = O;
2475
+ O && !O.includes("{{") && (I = kl(O), $(I));
2487
2476
  const he = {
2488
2477
  ...g,
2489
2478
  lastSelectedSchema: w,
2490
- lastSelectedDatamodelId: E,
2479
+ lastSelectedDatamodelId: V,
2491
2480
  lastSelectedDatabase: N,
2492
2481
  lastSelectedTable: T,
2493
2482
  connectionId: k,
2494
2483
  type: b ? g.type : "table",
2495
2484
  sql: I,
2496
2485
  customCfg: b ? g.customCfg : null
2497
- }, Le = u.cards.map(
2486
+ }, De = u.cards.map(
2498
2487
  ($e) => $e.id === g.id ? he : $e
2499
2488
  ), fe = {
2500
2489
  ...u,
2501
- cards: Le,
2502
- activeCardId: z(Le, u.activeCardId)
2490
+ cards: De,
2491
+ activeCardId: z(De, u.activeCardId)
2503
2492
  };
2504
2493
  q == null || q(fe);
2505
2494
  }
@@ -2507,7 +2496,21 @@ function Hl() {
2507
2496
  const { queryKey: I, queryData: he } = t;
2508
2497
  I && he && a.setQueryData(I, he), G({}), B == null || B();
2509
2498
  }
2510
- function we() {
2499
+ async function we() {
2500
+ const I = `
2501
+ I have the following error:
2502
+
2503
+ ${et}
2504
+
2505
+ for the following sql query:
2506
+
2507
+ ${O}
2508
+
2509
+ Please help me debug the query in the current table scope.
2510
+ `;
2511
+ d(!0), f(I), x(!0);
2512
+ }
2513
+ function Re() {
2511
2514
  return /* @__PURE__ */ n(ae, { children: [
2512
2515
  i && /* @__PURE__ */ e(
2513
2516
  "div",
@@ -2517,25 +2520,25 @@ function Hl() {
2517
2520
  children: /* @__PURE__ */ e("div", { className: "mt-2 w-[99%]", children: /* @__PURE__ */ e(
2518
2521
  _l,
2519
2522
  {
2520
- jsonString: JSON.stringify(A, null, 2)
2523
+ jsonString: JSON.stringify(E, null, 2)
2521
2524
  }
2522
2525
  ) })
2523
2526
  }
2524
2527
  ),
2525
- A && A.length > 0 && /* @__PURE__ */ e(
2528
+ E && E.length > 0 && /* @__PURE__ */ e(
2526
2529
  L,
2527
2530
  {
2528
2531
  variant: "ghost",
2529
2532
  onClick: () => o(!i),
2530
2533
  className: "absolute bottom-0 right-6 size-7 p-1",
2531
- children: i ? /* @__PURE__ */ e(Ye, { className: "size-3.5 text-muted-foreground" }) : /* @__PURE__ */ e(pa, { className: "size-3.5 text-muted-foreground" })
2534
+ children: i ? /* @__PURE__ */ e(Ye, { className: "size-3.5 text-muted-foreground" }) : /* @__PURE__ */ e(fa, { className: "size-3.5 text-muted-foreground" })
2532
2535
  }
2533
2536
  )
2534
2537
  ] });
2535
2538
  }
2536
2539
  function je() {
2537
2540
  return /* @__PURE__ */ n(
2538
- rt,
2541
+ ct,
2539
2542
  {
2540
2543
  className: "flex grow pb-1",
2541
2544
  direction: "vertical",
@@ -2562,7 +2565,7 @@ function Hl() {
2562
2565
  }
2563
2566
  ),
2564
2567
  l && /* @__PURE__ */ n(ae, { children: [
2565
- /* @__PURE__ */ e(it, { withHandle: !0, className: "border" }),
2568
+ /* @__PURE__ */ e(dt, { withHandle: !0, className: "border" }),
2566
2569
  /* @__PURE__ */ n(
2567
2570
  ke,
2568
2571
  {
@@ -2588,6 +2591,7 @@ function Hl() {
2588
2591
  }
2589
2592
  );
2590
2593
  }
2594
+ const et = (ue == null ? void 0 : ue.message) || ((tt = K == null ? void 0 : K.error) == null ? void 0 : tt.message);
2591
2595
  return (
2592
2596
  // This is a tricky css, the pt-8 is to make sure the editor doesn't slide under the header
2593
2597
  /* @__PURE__ */ n(
@@ -2598,7 +2602,7 @@ function Hl() {
2598
2602
  children: [
2599
2603
  /* @__PURE__ */ n("div", { className: "relative flex grow justify-between overflow-y-scroll", children: [
2600
2604
  je(),
2601
- we()
2605
+ Re()
2602
2606
  ] }),
2603
2607
  /* @__PURE__ */ n(
2604
2608
  "div",
@@ -2627,10 +2631,8 @@ function Hl() {
2627
2631
  zl,
2628
2632
  {
2629
2633
  sql: K == null ? void 0 : K.sql,
2630
- error: (ue == null ? void 0 : ue.message) || ((Ie = K == null ? void 0 : K.error) == null ? void 0 : Ie.message),
2631
- setShowAIDialog: d,
2632
- setTriggerAIRun: x,
2633
- setUserInputforAI: f
2634
+ error: et,
2635
+ onClick: we
2634
2636
  }
2635
2637
  ),
2636
2638
  /* @__PURE__ */ n(
@@ -2647,7 +2649,7 @@ function Hl() {
2647
2649
  }
2648
2650
  ),
2649
2651
  /* @__PURE__ */ e(
2650
- Sa,
2652
+ wa,
2651
2653
  {
2652
2654
  pressed: l,
2653
2655
  onPressedChange: (I) => r(I),
@@ -2657,7 +2659,7 @@ function Hl() {
2657
2659
  }
2658
2660
  ),
2659
2661
  /* @__PURE__ */ e(
2660
- Tl,
2662
+ Ml,
2661
2663
  {
2662
2664
  open: c,
2663
2665
  setOpen: d,
@@ -2676,7 +2678,7 @@ function Hl() {
2676
2678
  size: "sm",
2677
2679
  variant: "secondary",
2678
2680
  children: [
2679
- /* @__PURE__ */ e(ut, { className: "mr-2 size-4" }),
2681
+ /* @__PURE__ */ e(pt, { className: "mr-2 size-4" }),
2680
2682
  "Close"
2681
2683
  ]
2682
2684
  }
@@ -2684,7 +2686,7 @@ function Hl() {
2684
2686
  /* @__PURE__ */ n(
2685
2687
  L,
2686
2688
  {
2687
- onClick: V,
2689
+ onClick: A,
2688
2690
  size: "sm",
2689
2691
  variant: "secondary",
2690
2692
  children: [
@@ -2704,7 +2706,7 @@ function Hl() {
2704
2706
  }
2705
2707
  function Pl({ data: t }) {
2706
2708
  var o;
2707
- const [s, a] = Me.useState([]), r = Object.keys(t[0]).map((c) => ({
2709
+ const [s, a] = Ie.useState([]), r = Object.keys(t[0]).map((c) => ({
2708
2710
  // header: key,
2709
2711
  accessorKey: c,
2710
2712
  header: ({ column: d }) => {
@@ -2734,11 +2736,11 @@ function Pl({ data: t }) {
2734
2736
  }
2735
2737
  });
2736
2738
  return /* @__PURE__ */ e("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ n("table", { className: "w-full", children: [
2737
- /* @__PURE__ */ e(_n, { children: i.getHeaderGroups().map((c) => /* @__PURE__ */ e(Ct, { children: c.headers.map((d) => /* @__PURE__ */ e(
2739
+ /* @__PURE__ */ e(_n, { children: i.getHeaderGroups().map((c) => /* @__PURE__ */ e(wt, { children: c.headers.map((d) => /* @__PURE__ */ e(
2738
2740
  Hn,
2739
2741
  {
2740
2742
  className: "sticky top-0 h-11 bg-muted font-semibold",
2741
- children: d.isPlaceholder ? null : Yt(
2743
+ children: d.isPlaceholder ? null : ea(
2742
2744
  d.column.columnDef.header,
2743
2745
  d.getContext()
2744
2746
  )
@@ -2746,25 +2748,25 @@ function Pl({ data: t }) {
2746
2748
  d.id
2747
2749
  )) }, c.id)) }),
2748
2750
  /* @__PURE__ */ e(Pn, { children: (o = i.getRowModel().rows) != null && o.length ? i.getRowModel().rows.map((c) => /* @__PURE__ */ e(
2749
- Ct,
2751
+ wt,
2750
2752
  {
2751
2753
  className: "whitespace-nowrap py-2",
2752
2754
  "data-state": c.getIsSelected() && "selected",
2753
- children: c.getVisibleCells().map((d) => /* @__PURE__ */ e(ea, { className: "py-3", children: Yt(d.column.columnDef.cell, d.getContext()) }, d.id))
2755
+ children: c.getVisibleCells().map((d) => /* @__PURE__ */ e(ta, { className: "py-3", children: ea(d.column.columnDef.cell, d.getContext()) }, d.id))
2754
2756
  },
2755
2757
  c.id
2756
- )) : /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ e(ea, { colSpan: r.length, className: "h-24 text-center", children: "No results." }) }) })
2758
+ )) : /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(ta, { colSpan: r.length, className: "h-24 text-center", children: "No results." }) }) })
2757
2759
  ] }) });
2758
2760
  }
2759
2761
  function $l({ card: t }) {
2760
- var E, w, T, M, A, P, j, $, m, y, D;
2762
+ var V, w, T, O, E, P, j, $, m, y, D;
2761
2763
  const [s, a] = _(!1), [l, r] = _(
2762
2764
  []
2763
- ), { authToken: i } = De(), o = Gn(i == null ? void 0 : i.accessToken), c = O((C) => C.themeStyle), d = {
2764
- colors: ((w = (E = c == null ? void 0 : c.chart) == null ? void 0 : E.dataset) == null ? void 0 : w.backgroundColor) || []
2765
+ ), { authToken: i } = Te(), o = Gn(i == null ? void 0 : i.accessToken), c = M((C) => C.themeStyle), d = {
2766
+ colors: ((w = (V = c == null ? void 0 : c.chart) == null ? void 0 : V.dataset) == null ? void 0 : w.backgroundColor) || []
2765
2767
  };
2766
2768
  (T = t.customCardPreferences) != null && T.inputData;
2767
- const { getCard: h } = ka(((M = t.customCardPreferences) == null ? void 0 : M.url) || ""), f = ((A = t.customCardPreferences) == null ? void 0 : A.visualType) || "single", v = p((C) => C.frame), { setCustomCardPreferences: x } = ie(), { data: u } = Ee(t), g = Va((C, q) => {
2769
+ const { getCard: h } = za(((O = t.customCardPreferences) == null ? void 0 : O.url) || ""), f = ((E = t.customCardPreferences) == null ? void 0 : E.visualType) || "single", v = p((C) => C.frame), { setCustomCardPreferences: x } = ie(), { data: u } = Ve(t), g = Ea((C, q) => {
2768
2770
  r((B) => ({
2769
2771
  ...B,
2770
2772
  [C]: q
@@ -2840,19 +2842,19 @@ function $l({ card: t }) {
2840
2842
  (D = t.customCardPreferences) == null ? void 0 : D.componentName
2841
2843
  ) });
2842
2844
  }
2843
- function Ga({
2845
+ function Ja({
2844
2846
  // card,
2845
2847
  // showCard,
2846
2848
  className: t,
2847
2849
  ...s
2848
2850
  }) {
2849
2851
  var k;
2850
- const a = p((N) => N.card), l = ((k = a.customCardPreferences) == null ? void 0 : k.showCardHeader) ?? !0, r = p((N) => N.frame), i = O((N) => N.dashboard.filters);
2852
+ const a = p((N) => N.card), l = ((k = a.customCardPreferences) == null ? void 0 : k.showCardHeader) ?? !0, r = p((N) => N.frame), i = M((N) => N.dashboard.filters);
2851
2853
  p((N) => N.actions.setRunSql);
2852
- const { updateFilter: o } = Ze(), c = i == null ? void 0 : i.find((N) => N.id === r.filterId), { data: d, isLoading: h, isFetching: f } = Ee(a), { setCard: v } = ie(), { data: x } = At(a);
2854
+ const { updateFilter: o } = Ze(), c = i == null ? void 0 : i.find((N) => N.id === r.filterId), { data: d, isLoading: h, isFetching: f } = Ve(a), { setCard: v } = ie(), { data: x } = Rt(a);
2853
2855
  if (!a.id) return null;
2854
2856
  let u;
2855
- d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (u = za({
2857
+ d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (u = Oa({
2856
2858
  data: d == null ? void 0 : d.records,
2857
2859
  cardType: a.type,
2858
2860
  cfg: a.cfg,
@@ -2881,7 +2883,7 @@ function Ga({
2881
2883
  JSON.stringify(u) + JSON.stringify(a.preferences) + ((N = a == null ? void 0 : a.preferences) == null ? void 0 : N.customVisualCode)
2882
2884
  );
2883
2885
  if (a.type === "table" && (d != null && d.records) && (d == null ? void 0 : d.records.length) > 0)
2884
- return /* @__PURE__ */ n(Te, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
2886
+ return /* @__PURE__ */ n(Me, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
2885
2887
  /* @__PURE__ */ e(ts, { card: a, data: d == null ? void 0 : d.records }),
2886
2888
  /* @__PURE__ */ e(He, { orientation: "horizontal" })
2887
2889
  ] });
@@ -2896,7 +2898,7 @@ function Ga({
2896
2898
  l && /* @__PURE__ */ n(Kn, { className: "flex flex-row items-start justify-between py-4", children: [
2897
2899
  /* @__PURE__ */ n("div", { children: [
2898
2900
  /* @__PURE__ */ e(
2899
- nt,
2901
+ rt,
2900
2902
  {
2901
2903
  text: a.title,
2902
2904
  onSave: (N) => v({ ...a, title: N }),
@@ -2905,7 +2907,7 @@ function Ga({
2905
2907
  a.title
2906
2908
  ),
2907
2909
  /* @__PURE__ */ e(
2908
- nt,
2910
+ rt,
2909
2911
  {
2910
2912
  text: a.description || "",
2911
2913
  onSave: (N) => v({ ...a, description: N }),
@@ -2916,7 +2918,7 @@ function Ga({
2916
2918
  ] }),
2917
2919
  c && /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
2918
2920
  /* @__PURE__ */ e(
2919
- nt,
2921
+ rt,
2920
2922
  {
2921
2923
  className: "my-1",
2922
2924
  text: c.title || c.column,
@@ -2924,7 +2926,7 @@ function Ga({
2924
2926
  children: /* @__PURE__ */ e(U, { children: c.title })
2925
2927
  }
2926
2928
  ),
2927
- /* @__PURE__ */ e(Oa, { filter: c })
2929
+ /* @__PURE__ */ e(Ia, { filter: c })
2928
2930
  ] })
2929
2931
  ] }),
2930
2932
  /* @__PURE__ */ e(Xn, { className: "flex grow flex-col", children: b() })
@@ -2932,8 +2934,8 @@ function Ga({
2932
2934
  }
2933
2935
  );
2934
2936
  }
2935
- const ra = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
2936
- ht,
2937
+ const ia = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
2938
+ ft,
2937
2939
  {
2938
2940
  className: "h-full w-full overflow-hidden text-xs",
2939
2941
  theme: "default",
@@ -2952,9 +2954,9 @@ const ra = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
2952
2954
  value: s,
2953
2955
  onChange: a
2954
2956
  }
2955
- ), Ul = () => /* @__PURE__ */ n(It, { children: [
2956
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(Lt, { children: "Customize Card" }) }),
2957
- /* @__PURE__ */ n(ca, { children: [
2957
+ ), Ul = () => /* @__PURE__ */ n(Ft, { children: [
2958
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(Vt, { children: "Customize Card" }) }),
2959
+ /* @__PURE__ */ n(da, { children: [
2958
2960
  "See the configuration options and documentation",
2959
2961
  /* @__PURE__ */ e(
2960
2962
  "a",
@@ -2974,12 +2976,12 @@ const ra = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
2974
2976
  onCodeChange: r
2975
2977
  }) => /* @__PURE__ */ n(Ta, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2976
2978
  /* @__PURE__ */ n(Da, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2977
- /* @__PURE__ */ e(st, { value: "custom-config", children: a ? "Custom Config" : "Default Config" }),
2978
- /* @__PURE__ */ e(st, { value: "output", children: "Output" }),
2979
- /* @__PURE__ */ e(st, { value: "custom-code", children: "Custom Code" })
2979
+ /* @__PURE__ */ e(it, { value: "custom-config", children: a ? "Custom Config" : "Default Config" }),
2980
+ /* @__PURE__ */ e(it, { value: "output", children: "Output" }),
2981
+ /* @__PURE__ */ e(it, { value: "custom-code", children: "Custom Code" })
2980
2982
  ] }),
2981
2983
  /* @__PURE__ */ e(
2982
- lt,
2984
+ ot,
2983
2985
  {
2984
2986
  value: "output",
2985
2987
  className: "mt-0 grow rounded-b border border-t-0 p-2",
@@ -2994,12 +2996,12 @@ const ra = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
2994
2996
  }
2995
2997
  ),
2996
2998
  /* @__PURE__ */ e(
2997
- lt,
2999
+ ot,
2998
3000
  {
2999
3001
  value: "custom-config",
3000
3002
  className: "mt-0 grow rounded-b border border-t-0",
3001
3003
  children: /* @__PURE__ */ e(
3002
- ra,
3004
+ ia,
3003
3005
  {
3004
3006
  language: "json",
3005
3007
  value: a,
@@ -3009,12 +3011,12 @@ const ra = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
3009
3011
  }
3010
3012
  ),
3011
3013
  /* @__PURE__ */ e(
3012
- lt,
3014
+ ot,
3013
3015
  {
3014
3016
  value: "custom-code",
3015
3017
  className: "mt-0 grow rounded-b border border-t-0",
3016
3018
  children: /* @__PURE__ */ e(
3017
- ra,
3019
+ ia,
3018
3020
  {
3019
3021
  language: "javascript",
3020
3022
  value: s,
@@ -3029,22 +3031,22 @@ const ra = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
3029
3031
  onReset: a,
3030
3032
  onApply: l,
3031
3033
  onClose: r
3032
- }) => /* @__PURE__ */ n(da, { className: "flex items-center", children: [
3034
+ }) => /* @__PURE__ */ n(ua, { className: "flex items-center", children: [
3033
3035
  /* @__PURE__ */ e(U, { className: "mr-2 text-red-500", children: t }),
3034
3036
  /* @__PURE__ */ e(L, { disabled: !s, onClick: a, variant: "outline", children: "Reset" }),
3035
3037
  /* @__PURE__ */ e(L, { onClick: l, variant: "outline", children: "Apply" }),
3036
3038
  /* @__PURE__ */ e(L, { onClick: r, variant: "outline", children: "Close" })
3037
3039
  ] });
3038
3040
  function Jl() {
3039
- const [t, s] = _(!1), [a, l] = _(""), [r, i] = _(""), [o, c] = _(""), [d, h] = _(""), f = p((w) => w.card), v = p((w) => w.card.customCfg), { data: x } = Ee(f), { data: u } = At(f), { setCardCustomCfg: g, setCustomVisualCode: b } = ie(), k = (w) => {
3040
- var T, M;
3041
+ const [t, s] = _(!1), [a, l] = _(""), [r, i] = _(""), [o, c] = _(""), [d, h] = _(""), f = p((w) => w.card), v = p((w) => w.card.customCfg), { data: x } = Ve(f), { data: u } = Rt(f), { setCardCustomCfg: g, setCustomVisualCode: b } = ie(), k = (w) => {
3042
+ var T, O;
3041
3043
  return JSON.stringify(
3042
3044
  {
3043
3045
  ...w,
3044
3046
  data: {
3045
3047
  ...w.data,
3046
- datasets: (M = (T = w.data) == null ? void 0 : T.datasets) == null ? void 0 : M.map((A) => ({
3047
- ...A,
3048
+ datasets: (O = (T = w.data) == null ? void 0 : T.datasets) == null ? void 0 : O.map((E) => ({
3049
+ ...E,
3048
3050
  data: []
3049
3051
  }))
3050
3052
  }
@@ -3053,14 +3055,14 @@ function Jl() {
3053
3055
  2
3054
3056
  );
3055
3057
  };
3056
- return /* @__PURE__ */ n(Mt, { open: t, onOpenChange: s, children: [
3057
- /* @__PURE__ */ e(Tt, { asChild: !0, children: /* @__PURE__ */ e(
3058
+ return /* @__PURE__ */ n(Tt, { open: t, onOpenChange: s, children: [
3059
+ /* @__PURE__ */ e(Dt, { asChild: !0, children: /* @__PURE__ */ e(
3058
3060
  L,
3059
3061
  {
3060
3062
  onClick: () => {
3061
- var T, M;
3063
+ var T, O;
3062
3064
  if (!((T = x == null ? void 0 : x.records) != null && T.length)) return;
3063
- const w = za({
3065
+ const w = Oa({
3064
3066
  data: x.records,
3065
3067
  cardType: f.type,
3066
3068
  cfg: f.cfg,
@@ -3068,9 +3070,9 @@ function Jl() {
3068
3070
  topoJson: u
3069
3071
  });
3070
3072
  if (w) {
3071
- l(k(w)), c(((M = f.preferences) == null ? void 0 : M.customVisualCode) || "");
3072
- const A = ns(w, v);
3073
- i(k(A));
3073
+ l(k(w)), c(((O = f.preferences) == null ? void 0 : O.customVisualCode) || "");
3074
+ const E = ns(w, v);
3075
+ i(k(E));
3074
3076
  }
3075
3077
  },
3076
3078
  size: "sm",
@@ -3079,10 +3081,10 @@ function Jl() {
3079
3081
  children: /* @__PURE__ */ e(as, { className: "h-4 w-4" })
3080
3082
  }
3081
3083
  ) }),
3082
- /* @__PURE__ */ n(Dt, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
3084
+ /* @__PURE__ */ n(Lt, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
3083
3085
  /* @__PURE__ */ e(Ul, {}),
3084
3086
  /* @__PURE__ */ n("div", { className: "flex grow gap-2", children: [
3085
- /* @__PURE__ */ e(mt, { FallbackComponent: Ma, children: /* @__PURE__ */ e(Ga, { className: "w-1/2 rounded shadow-none" }) }),
3087
+ /* @__PURE__ */ e(gt, { FallbackComponent: Ma, children: /* @__PURE__ */ e(Ja, { className: "w-1/2 rounded shadow-none" }) }),
3086
3088
  /* @__PURE__ */ e(
3087
3089
  Bl,
3088
3090
  {
@@ -3123,39 +3125,39 @@ function Jl() {
3123
3125
  ] })
3124
3126
  ] });
3125
3127
  }
3126
- function Ja(t) {
3128
+ function Wa(t) {
3127
3129
  return ge({ 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: [] }] })(t);
3128
3130
  }
3129
- function Wa(t) {
3131
+ function Ka(t) {
3130
3132
  return ge({ 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: [] }] })(t);
3131
3133
  }
3132
- function Ka(t) {
3134
+ function Qa(t) {
3133
3135
  return ge({ 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: [] }] })(t);
3134
3136
  }
3135
3137
  function Wl(t) {
3136
3138
  return ge({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M48,180c0,11,7.18,20,16,20a14.24,14.24,0,0,0,10.22-4.66A8,8,0,0,1,85.78,206.4,30.06,30.06,0,0,1,64,216c-17.65,0-32-16.15-32-36s14.35-36,32-36a30.06,30.06,0,0,1,21.78,9.6,8,8,0,0,1-11.56,11.06A14.24,14.24,0,0,0,64,160C55.18,160,48,169,48,180Zm79.6-8.69c-4-1.16-8.14-2.35-10.45-3.84-1.25-.81-1.23-1-1.12-1.9a4.57,4.57,0,0,1,2-3.67c4.6-3.12,15.34-1.73,19.82-.56A8,8,0,0,0,142,145.86c-2.12-.55-21-5.22-32.84,2.76a20.58,20.58,0,0,0-9,14.95c-2,15.88,13.65,20.41,23,23.11,12.06,3.49,13.12,4.92,12.78,7.59-.31,2.41-1.26,3.34-2.14,3.93-4.6,3.06-15.17,1.56-19.55.36A8,8,0,0,0,109.94,214a61.34,61.34,0,0,0,15.19,2c5.82,0,12.3-1,17.49-4.46a20.82,20.82,0,0,0,9.19-15.23C154,179,137.49,174.17,127.6,171.31Zm83.09-26.84a8,8,0,0,0-10.23,4.84L188,184.21l-12.47-34.9a8,8,0,0,0-15.07,5.38l20,56a8,8,0,0,0,15.07,0l20-56A8,8,0,0,0,210.69,144.47ZM216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-27.31-8L160,51.31V80Z" }, child: [] }] })(t);
3137
3139
  }
3138
- function Qa(t) {
3140
+ function Za(t) {
3139
3141
  return ge({ 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: [] }] })(t);
3140
3142
  }
3141
- function Za(t) {
3143
+ function Xa(t) {
3142
3144
  return ge({ 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: [] }] })(t);
3143
3145
  }
3144
- function Xa(t) {
3146
+ function Ya(t) {
3145
3147
  return ge({ 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: [] }] })(t);
3146
3148
  }
3147
- function Ya(t) {
3149
+ function en(t) {
3148
3150
  return ge({ 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: [] }] })(t);
3149
3151
  }
3150
- function en(t) {
3152
+ function tn(t) {
3151
3153
  return ge({ 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: [] }] })(t);
3152
3154
  }
3153
- function tn(t) {
3155
+ function an(t) {
3154
3156
  const [s, a] = _(null);
3155
3157
  return s;
3156
3158
  }
3157
- function an() {
3158
- const { authToken: t } = De(), { data: s, isLoading: a, isFetching: l, isError: r } = Fe({
3159
+ function nn() {
3160
+ const { authToken: t } = Te(), { data: s, isLoading: a, isFetching: l, isError: r } = Le({
3159
3161
  queryKey: ["plugins", t == null ? void 0 : t.accessToken],
3160
3162
  queryFn: () => rs(t == null ? void 0 : t.accessToken)
3161
3163
  // staleTime: Infinity,
@@ -3165,7 +3167,7 @@ function an() {
3165
3167
  function Kl({
3166
3168
  onChartTypeChange: t
3167
3169
  }) {
3168
- const [s, a] = _([]), { data: l } = an();
3170
+ const [s, a] = _([]), { data: l } = nn();
3169
3171
  return re(() => {
3170
3172
  (async () => {
3171
3173
  var i;
@@ -3198,7 +3200,7 @@ const Ql = ({
3198
3200
  icon: s,
3199
3201
  onClick: a
3200
3202
  }) => {
3201
- const l = tn(), r = t.charAt(0).toUpperCase();
3203
+ const l = an(), r = t.charAt(0).toUpperCase();
3202
3204
  return /* @__PURE__ */ e(L, { onClick: a, title: t, variant: "ghost", children: l ? /* @__PURE__ */ e(l, { className: "h-4 w-4" }) : r });
3203
3205
  };
3204
3206
  function Zl() {
@@ -3213,8 +3215,8 @@ function Zl() {
3213
3215
  icon: u.icon
3214
3216
  }), s(!1);
3215
3217
  }
3216
- return /* @__PURE__ */ n(pt, { open: t, onOpenChange: s, children: [
3217
- /* @__PURE__ */ e(ft, { asChild: !0, children: /* @__PURE__ */ e(L, { size: "sm", variant: "outline", children: /* @__PURE__ */ e(
3218
+ return /* @__PURE__ */ n(bt, { open: t, onOpenChange: s, children: [
3219
+ /* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ e(L, { size: "sm", variant: "outline", children: /* @__PURE__ */ e(
3218
3220
  Xl,
3219
3221
  {
3220
3222
  className: "h-4 w-4",
@@ -3223,7 +3225,7 @@ function Zl() {
3223
3225
  componentName: (v = a.customCardPreferences) == null ? void 0 : v.componentName
3224
3226
  }
3225
3227
  ) }) }),
3226
- /* @__PURE__ */ n(gt, { className: "w-50", children: [
3228
+ /* @__PURE__ */ n(vt, { className: "w-50", children: [
3227
3229
  /* @__PURE__ */ n("div", { className: "grid grid-cols-4 place-items-center", children: [
3228
3230
  /* @__PURE__ */ e(
3229
3231
  L,
@@ -3231,7 +3233,7 @@ function Zl() {
3231
3233
  onClick: () => h("bar"),
3232
3234
  className: "font-normal",
3233
3235
  variant: "ghost",
3234
- children: /* @__PURE__ */ e(jt, { className: "size-5" })
3236
+ children: /* @__PURE__ */ e(Ht, { className: "size-5" })
3235
3237
  }
3236
3238
  ),
3237
3239
  /* @__PURE__ */ e(
@@ -3239,7 +3241,7 @@ function Zl() {
3239
3241
  {
3240
3242
  onClick: () => h("line"),
3241
3243
  variant: "ghost",
3242
- children: /* @__PURE__ */ e(_t, { className: "size-5" })
3244
+ children: /* @__PURE__ */ e(Pt, { className: "size-5" })
3243
3245
  }
3244
3246
  ),
3245
3247
  /* @__PURE__ */ e(
@@ -3247,7 +3249,7 @@ function Zl() {
3247
3249
  {
3248
3250
  onClick: () => h("stackedBar"),
3249
3251
  variant: "ghost",
3250
- children: /* @__PURE__ */ e(Xa, { className: "size-5", strokeWidth: 0 })
3252
+ children: /* @__PURE__ */ e(Ya, { className: "size-5", strokeWidth: 0 })
3251
3253
  }
3252
3254
  ),
3253
3255
  /* @__PURE__ */ e(
@@ -3255,7 +3257,7 @@ function Zl() {
3255
3257
  {
3256
3258
  onClick: () => h("stackedLine"),
3257
3259
  variant: "ghost",
3258
- children: /* @__PURE__ */ e(Za, { className: "size-5", strokeWidth: 0 })
3260
+ children: /* @__PURE__ */ e(Xa, { className: "size-5", strokeWidth: 0 })
3259
3261
  }
3260
3262
  ),
3261
3263
  /* @__PURE__ */ e(
@@ -3263,7 +3265,7 @@ function Zl() {
3263
3265
  {
3264
3266
  onClick: () => h("scatter"),
3265
3267
  variant: "ghost",
3266
- children: /* @__PURE__ */ e(qa, { className: "size-5" })
3268
+ children: /* @__PURE__ */ e(Ra, { className: "size-5" })
3267
3269
  }
3268
3270
  ),
3269
3271
  /* @__PURE__ */ e(
@@ -3271,7 +3273,7 @@ function Zl() {
3271
3273
  {
3272
3274
  onClick: () => h("bubble"),
3273
3275
  variant: "ghost",
3274
- children: /* @__PURE__ */ e(Qa, { className: "size-4" })
3276
+ children: /* @__PURE__ */ e(Za, { className: "size-4" })
3275
3277
  }
3276
3278
  ),
3277
3279
  /* @__PURE__ */ e(
@@ -3279,7 +3281,7 @@ function Zl() {
3279
3281
  {
3280
3282
  onClick: () => h("pie"),
3281
3283
  variant: "ghost",
3282
- children: /* @__PURE__ */ e(Aa, { className: "size-5" })
3284
+ children: /* @__PURE__ */ e(qa, { className: "size-5" })
3283
3285
  }
3284
3286
  ),
3285
3287
  /* @__PURE__ */ e(
@@ -3287,7 +3289,7 @@ function Zl() {
3287
3289
  {
3288
3290
  onClick: () => h("doughnut"),
3289
3291
  variant: "ghost",
3290
- children: /* @__PURE__ */ e(Wa, { className: "size-5", strokeWidth: 1 })
3292
+ children: /* @__PURE__ */ e(Ka, { className: "size-5", strokeWidth: 1 })
3291
3293
  }
3292
3294
  ),
3293
3295
  /* @__PURE__ */ e(
@@ -3296,7 +3298,7 @@ function Zl() {
3296
3298
  onClick: () => h("radar"),
3297
3299
  variant: "ghost",
3298
3300
  children: /* @__PURE__ */ e(
3299
- Ja,
3301
+ Wa,
3300
3302
  {
3301
3303
  className: "size-5 font-extralight",
3302
3304
  strokeWidth: 0.5
@@ -3309,7 +3311,7 @@ function Zl() {
3309
3311
  {
3310
3312
  onClick: () => h("polarArea"),
3311
3313
  variant: "ghost",
3312
- children: /* @__PURE__ */ e(Ka, { className: "size-5" })
3314
+ children: /* @__PURE__ */ e(Qa, { className: "size-5" })
3313
3315
  }
3314
3316
  ),
3315
3317
  /* @__PURE__ */ e(
@@ -3317,7 +3319,7 @@ function Zl() {
3317
3319
  {
3318
3320
  onClick: () => h("pyramid"),
3319
3321
  variant: "ghost",
3320
- children: /* @__PURE__ */ e(en, { className: "size-5" })
3322
+ children: /* @__PURE__ */ e(tn, { className: "size-5" })
3321
3323
  }
3322
3324
  ),
3323
3325
  /* @__PURE__ */ e(
@@ -3325,7 +3327,7 @@ function Zl() {
3325
3327
  {
3326
3328
  onClick: () => h("range"),
3327
3329
  variant: "ghost",
3328
- children: /* @__PURE__ */ e(Ea, { className: "size-5" })
3330
+ children: /* @__PURE__ */ e(Aa, { className: "size-5" })
3329
3331
  }
3330
3332
  ),
3331
3333
  /* @__PURE__ */ e(
@@ -3333,7 +3335,7 @@ function Zl() {
3333
3335
  {
3334
3336
  onClick: () => h("table"),
3335
3337
  variant: "ghost",
3336
- children: /* @__PURE__ */ e(Pt, { className: "size-5" })
3338
+ children: /* @__PURE__ */ e(Ut, { className: "size-5" })
3337
3339
  }
3338
3340
  ),
3339
3341
  /* @__PURE__ */ e(
@@ -3341,7 +3343,7 @@ function Zl() {
3341
3343
  {
3342
3344
  onClick: () => h("kpi"),
3343
3345
  variant: "ghost",
3344
- children: /* @__PURE__ */ e(Ya, { className: "size-6" })
3346
+ children: /* @__PURE__ */ e(en, { className: "size-6" })
3345
3347
  }
3346
3348
  ),
3347
3349
  /* @__PURE__ */ e(
@@ -3349,7 +3351,7 @@ function Zl() {
3349
3351
  {
3350
3352
  onClick: () => h("text"),
3351
3353
  variant: "ghost",
3352
- children: /* @__PURE__ */ e($t, { className: "size-4" })
3354
+ children: /* @__PURE__ */ e(Bt, { className: "size-4" })
3353
3355
  }
3354
3356
  ),
3355
3357
  /* @__PURE__ */ e(
@@ -3357,7 +3359,7 @@ function Zl() {
3357
3359
  {
3358
3360
  onClick: () => h("map"),
3359
3361
  variant: "ghost",
3360
- children: /* @__PURE__ */ e(Ra, { className: "size-4" })
3362
+ children: /* @__PURE__ */ e(ja, { className: "size-4" })
3361
3363
  }
3362
3364
  ),
3363
3365
  /* @__PURE__ */ e(
@@ -3365,7 +3367,7 @@ function Zl() {
3365
3367
  {
3366
3368
  onClick: () => h("custom"),
3367
3369
  variant: "ghost",
3368
- children: /* @__PURE__ */ e(ja, { className: "size-4" })
3370
+ children: /* @__PURE__ */ e(_a, { className: "size-4" })
3369
3371
  }
3370
3372
  )
3371
3373
  ] }),
@@ -3379,42 +3381,42 @@ function Xl({
3379
3381
  customIcon: a,
3380
3382
  componentName: l
3381
3383
  }) {
3382
- const r = tn();
3384
+ const r = an();
3383
3385
  switch (t) {
3384
3386
  case "bar":
3385
- return /* @__PURE__ */ e(jt, { className: s });
3387
+ return /* @__PURE__ */ e(Ht, { className: s });
3386
3388
  case "line":
3387
- return /* @__PURE__ */ e(_t, { className: s });
3389
+ return /* @__PURE__ */ e(Pt, { className: s });
3388
3390
  case "pie":
3389
- return /* @__PURE__ */ e(Aa, { className: s });
3391
+ return /* @__PURE__ */ e(qa, { className: s });
3390
3392
  case "radar":
3391
- return /* @__PURE__ */ e(Ja, { className: s });
3393
+ return /* @__PURE__ */ e(Wa, { className: s });
3392
3394
  case "scatter":
3393
- return /* @__PURE__ */ e(qa, { className: s });
3395
+ return /* @__PURE__ */ e(Ra, { className: s });
3394
3396
  case "bubble":
3395
- return /* @__PURE__ */ e(Qa, { className: s });
3397
+ return /* @__PURE__ */ e(Za, { className: s });
3396
3398
  case "doughnut":
3397
- return /* @__PURE__ */ e(Wa, { className: s });
3399
+ return /* @__PURE__ */ e(Ka, { className: s });
3398
3400
  case "stackedBar":
3399
- return /* @__PURE__ */ e(Xa, { className: "size-4 text-foreground/70" });
3401
+ return /* @__PURE__ */ e(Ya, { className: "size-4 text-foreground/70" });
3400
3402
  case "stackedLine":
3401
- return /* @__PURE__ */ e(Za, { className: "size-4 text-foreground/70" });
3403
+ return /* @__PURE__ */ e(Xa, { className: "size-4 text-foreground/70" });
3402
3404
  case "polarArea":
3403
- return /* @__PURE__ */ e(Ka, { className: s });
3405
+ return /* @__PURE__ */ e(Qa, { className: s });
3404
3406
  case "pyramid":
3405
- return /* @__PURE__ */ e(en, { className: s });
3407
+ return /* @__PURE__ */ e(tn, { className: s });
3406
3408
  case "range":
3407
- return /* @__PURE__ */ e(Ea, { className: s });
3409
+ return /* @__PURE__ */ e(Aa, { className: s });
3408
3410
  case "kpi":
3409
- return /* @__PURE__ */ e(Ya, { className: s });
3411
+ return /* @__PURE__ */ e(en, { className: s });
3410
3412
  case "text":
3411
- return /* @__PURE__ */ e($t, { className: s });
3413
+ return /* @__PURE__ */ e(Bt, { className: s });
3412
3414
  case "map":
3413
- return /* @__PURE__ */ e(Ra, { className: s });
3415
+ return /* @__PURE__ */ e(ja, { className: s });
3414
3416
  case "custom":
3415
- return a && r ? /* @__PURE__ */ e(r, { className: s }) : l ? l == null ? void 0 : l.charAt(0).toUpperCase() : /* @__PURE__ */ e(ja, { className: s });
3417
+ return a && r ? /* @__PURE__ */ e(r, { className: s }) : l ? l == null ? void 0 : l.charAt(0).toUpperCase() : /* @__PURE__ */ e(_a, { className: s });
3416
3418
  default:
3417
- return /* @__PURE__ */ e(Pt, { className: s });
3419
+ return /* @__PURE__ */ e(Ut, { className: s });
3418
3420
  }
3419
3421
  }
3420
3422
  function Yl() {
@@ -3422,9 +3424,9 @@ function Yl() {
3422
3424
  const t = p((l) => l.card);
3423
3425
  (a = t.customCardPreferences) == null || a.showCardHeader;
3424
3426
  const { setCustomCardPreferences: s } = ie();
3425
- return /* @__PURE__ */ n(Ft, { children: [
3426
- /* @__PURE__ */ e(Vt, { asChild: !0, children: /* @__PURE__ */ e(Ht, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3427
- /* @__PURE__ */ e(Et, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ n(
3427
+ return /* @__PURE__ */ n(Et, { children: [
3428
+ /* @__PURE__ */ e(At, { asChild: !0, children: /* @__PURE__ */ e($t, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3429
+ /* @__PURE__ */ e(qt, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ n(
3428
3430
  os,
3429
3431
  {
3430
3432
  onClick: () => {
@@ -3439,11 +3441,11 @@ function Yl() {
3439
3441
  ) })
3440
3442
  ] });
3441
3443
  }
3442
- function ia() {
3444
+ function oa() {
3443
3445
  var m;
3444
3446
  const t = p((y) => y.frame), s = p((y) => y.card), a = p((y) => y.isShowingVisual), l = p((y) => y.isSqlRunning), r = p((y) => y.pythonStdOut);
3445
3447
  p((y) => y.actions.setRunSql);
3446
- const { setFrame: i, setCard: o, updateCardInFrame: c, setActiveTabCardId: d } = ie(), { data: h, isLoading: f, isFetching: v, error: x } = Ee(s);
3448
+ const { setFrame: i, setCard: o, updateCardInFrame: c, setActiveTabCardId: d } = ie(), { data: h, isLoading: f, isFetching: v, error: x } = Ve(s);
3447
3449
  if (!s) return /* @__PURE__ */ e(ae, { children: "No Active Card" });
3448
3450
  function u() {
3449
3451
  const y = {
@@ -3494,7 +3496,7 @@ function ia() {
3494
3496
  function N(y) {
3495
3497
  d(y);
3496
3498
  }
3497
- const E = (y, D) => {
3499
+ const V = (y, D) => {
3498
3500
  console.log("handleDragStart", D), y.dataTransfer.setData("tabIndex", D.toString());
3499
3501
  }, w = (y) => {
3500
3502
  y.preventDefault();
@@ -3504,7 +3506,7 @@ function ia() {
3504
3506
  const q = Array.from(t.cards), [B] = q.splice(parseInt(C), 1);
3505
3507
  q.splice(D, 0, B), i({ ...t, cards: q });
3506
3508
  };
3507
- function M(y, D) {
3509
+ function O(y, D) {
3508
3510
  return y.cards.length === 1 && (D.displayTab === !0 || D.displayTab === void 0) || y.activeCardId !== D.id && (D.displayTab === !0 || D.displayTab === void 0) ? null : /* @__PURE__ */ e(
3509
3511
  "div",
3510
3512
  {
@@ -3519,7 +3521,7 @@ function ia() {
3519
3521
  }
3520
3522
  );
3521
3523
  }
3522
- function A() {
3524
+ function E() {
3523
3525
  return /* @__PURE__ */ n(
3524
3526
  Ta,
3525
3527
  {
@@ -3527,26 +3529,26 @@ function ia() {
3527
3529
  value: t.activeCardId,
3528
3530
  className: "flex grow flex-col",
3529
3531
  children: [
3530
- t.cards.map((y) => /* @__PURE__ */ e(lt, { className: "mt-0 grow", value: y.id, children: P() }, y.id)),
3532
+ t.cards.map((y) => /* @__PURE__ */ e(ot, { className: "mt-0 grow", value: y.id, children: P() }, y.id)),
3531
3533
  /* @__PURE__ */ e(Da, { className: "group mx-6 justify-between", children: /* @__PURE__ */ n("div", { className: "flex items-center", children: [
3532
3534
  t.cards.map((y, D) => /* @__PURE__ */ e(
3533
- nt,
3535
+ rt,
3534
3536
  {
3535
3537
  text: y.tabTitle || y.title,
3536
3538
  onSave: (C) => {
3537
3539
  o({ ...s, tabTitle: C }), c({ ...s, tabTitle: C });
3538
3540
  },
3539
3541
  children: /* @__PURE__ */ n(
3540
- st,
3542
+ it,
3541
3543
  {
3542
3544
  draggable: !0,
3543
- onDragStart: (C) => E(C, D),
3545
+ onDragStart: (C) => V(C, D),
3544
3546
  onDragOver: w,
3545
3547
  onDrop: (C) => T(C, D),
3546
3548
  className: "",
3547
3549
  value: y.id,
3548
3550
  children: [
3549
- M(t, y),
3551
+ O(t, y),
3550
3552
  y.tabTitle || y.title,
3551
3553
  t.activeCardId === y.id && t.cards.length > 1 && /* @__PURE__ */ e(
3552
3554
  Ye,
@@ -3585,14 +3587,14 @@ function ia() {
3585
3587
  );
3586
3588
  }
3587
3589
  function P() {
3588
- return s.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(us, { card: s, data: h == null ? void 0 : h.records }) }) }) : s.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Te, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
3590
+ return s.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(us, { card: s, data: h == null ? void 0 : h.records }) }) }) : s.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Me, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
3589
3591
  hs,
3590
3592
  {
3591
3593
  isLoading: l,
3592
3594
  card: s,
3593
3595
  data: h == null ? void 0 : h.records
3594
3596
  }
3595
- ) }) }) }) : /* @__PURE__ */ e(mt, { FallbackComponent: Ma, children: /* @__PURE__ */ e(Ga, { className: "grow border-none shadow-none" }) });
3597
+ ) }) }) }) : /* @__PURE__ */ e(gt, { FallbackComponent: Ma, children: /* @__PURE__ */ e(Ja, { className: "grow border-none shadow-none" }) });
3596
3598
  }
3597
3599
  function j() {
3598
3600
  const y = JSON.stringify(h == null ? void 0 : h.records, null, 2), D = new Blob([y], { type: "application/json" }), C = URL.createObjectURL(D), q = document.createElement("a");
@@ -3647,8 +3649,8 @@ function ia() {
3647
3649
  ] }),
3648
3650
  /* @__PURE__ */ e(tr, {})
3649
3651
  ] }),
3650
- a ? A() : /* @__PURE__ */ n(
3651
- rt,
3652
+ a ? E() : /* @__PURE__ */ n(
3653
+ ct,
3652
3654
  {
3653
3655
  className: "px-6",
3654
3656
  direction: "horizontal",
@@ -3665,7 +3667,7 @@ function ia() {
3665
3667
  children: r && /* @__PURE__ */ e(er, {})
3666
3668
  }
3667
3669
  ),
3668
- /* @__PURE__ */ e(it, {})
3670
+ /* @__PURE__ */ e(dt, {})
3669
3671
  ] }),
3670
3672
  /* @__PURE__ */ e(
3671
3673
  ke,
@@ -3674,7 +3676,7 @@ function ia() {
3674
3676
  order: 2,
3675
3677
  minSize: 10,
3676
3678
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3677
- children: /* @__PURE__ */ n(Te, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
3679
+ children: /* @__PURE__ */ n(Me, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
3678
3680
  (h == null ? void 0 : h.records) && (h == null ? void 0 : h.records.length) > 0 && /* @__PURE__ */ e(Pl, { data: (h == null ? void 0 : h.records) || [] }),
3679
3681
  (x || (h == null ? void 0 : h.error)) && /* @__PURE__ */ e("span", { className: "font-mono text-xs", children: (x == null ? void 0 : x.message) || ((m = h == null ? void 0 : h.error) == null ? void 0 : m.message) }),
3680
3682
  /* @__PURE__ */ e(He, { orientation: "horizontal" })
@@ -3692,7 +3694,7 @@ function er() {
3692
3694
  const s = t.replace(/\n/g, "<br>");
3693
3695
  return /* @__PURE__ */ n("div", { className: "relative flex w-full flex-col border-r", children: [
3694
3696
  /* @__PURE__ */ e("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" }),
3695
- /* @__PURE__ */ n(Te, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
3697
+ /* @__PURE__ */ n(Me, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
3696
3698
  /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: s } }),
3697
3699
  /* @__PURE__ */ e(He, { orientation: "horizontal" })
3698
3700
  ] })
@@ -3721,14 +3723,14 @@ function ar({
3721
3723
  onValueChange: a
3722
3724
  }) {
3723
3725
  return /* @__PURE__ */ e(
3724
- bt,
3726
+ xt,
3725
3727
  {
3726
3728
  value: s,
3727
3729
  onValueChange: a,
3728
3730
  className: "flex gap-4",
3729
3731
  defaultValue: t[0].value,
3730
3732
  children: t.map((l) => /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
3731
- /* @__PURE__ */ e(Ve, { value: l.value, id: l.value }),
3733
+ /* @__PURE__ */ e(Fe, { value: l.value, id: l.value }),
3732
3734
  /* @__PURE__ */ e("label", { className: "text-sm", htmlFor: l.value, children: l.label })
3733
3735
  ] }, l.value))
3734
3736
  }
@@ -3780,17 +3782,17 @@ function nr() {
3780
3782
  var b, k;
3781
3783
  const t = p(
3782
3784
  (N) => N.card.customCardPreferences
3783
- ), { data: s } = an(), a = (s == null ? void 0 : s.plugins) || [], l = p((N) => N.card), r = p((N) => N.frame), i = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: o } = ie(), { components: c, manifest: d } = ka(
3785
+ ), { data: s } = nn(), a = (s == null ? void 0 : s.plugins) || [], l = p((N) => N.card), r = p((N) => N.frame), i = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: o } = ie(), { components: c, manifest: d } = za(
3784
3786
  (t == null ? void 0 : t.url) || ""
3785
3787
  ), h = (b = d == null ? void 0 : d.visuals) == null ? void 0 : b.find(
3786
3788
  (N) => N.name === (t == null ? void 0 : t.componentName)
3787
3789
  );
3788
- function f(N, E) {
3790
+ function f(N, V) {
3789
3791
  if (!t) return;
3790
3792
  const T = {
3791
3793
  ...(t == null ? void 0 : t.dataInputCardIds) || {},
3792
3794
  [N]: {
3793
- cardId: E,
3795
+ cardId: V,
3794
3796
  hookRef: null
3795
3797
  }
3796
3798
  };
@@ -3801,74 +3803,74 @@ function nr() {
3801
3803
  }
3802
3804
  function v(N) {
3803
3805
  var w, T;
3804
- const E = (w = r == null ? void 0 : r.cards) == null ? void 0 : w.filter((M) => {
3805
- var A;
3806
- return ((A = M == null ? void 0 : M.customCardPreferences) == null ? void 0 : A.visualType) !== "multiple";
3807
- }).map((M) => ({
3808
- value: M.id,
3809
- label: M.tabTitle || M.title
3806
+ const V = (w = r == null ? void 0 : r.cards) == null ? void 0 : w.filter((O) => {
3807
+ var E;
3808
+ return ((E = O == null ? void 0 : O.customCardPreferences) == null ? void 0 : E.visualType) !== "multiple";
3809
+ }).map((O) => ({
3810
+ value: O.id,
3811
+ label: O.tabTitle || O.title
3810
3812
  }));
3811
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: (T = N == null ? void 0 : N.dataInputs) == null ? void 0 : T.map((M, A) => {
3813
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: (T = N == null ? void 0 : N.dataInputs) == null ? void 0 : T.map((O, E) => {
3812
3814
  var P, j;
3813
3815
  return /* @__PURE__ */ n(
3814
3816
  "div",
3815
3817
  {
3816
3818
  className: "grid grid-cols-10 gap-2",
3817
3819
  children: [
3818
- /* @__PURE__ */ e("div", { className: "col-span-4 flex items-center", children: M }),
3820
+ /* @__PURE__ */ e("div", { className: "col-span-4 flex items-center", children: O }),
3819
3821
  /* @__PURE__ */ e(
3820
3822
  ye,
3821
3823
  {
3822
3824
  className: "col-span-6 h-8 w-full justify-between",
3823
3825
  label: "",
3824
- options: E || [],
3825
- value: ((j = (P = t == null ? void 0 : t.dataInputCardIds) == null ? void 0 : P[A]) == null ? void 0 : j.cardId) || "",
3826
- onValueChange: ($) => f(A, $)
3826
+ options: V || [],
3827
+ value: ((j = (P = t == null ? void 0 : t.dataInputCardIds) == null ? void 0 : P[E]) == null ? void 0 : j.cardId) || "",
3828
+ onValueChange: ($) => f(E, $)
3827
3829
  }
3828
3830
  )
3829
3831
  ]
3830
3832
  },
3831
- A + Math.random()
3833
+ E + Math.random()
3832
3834
  );
3833
3835
  }) });
3834
3836
  }
3835
- function x(N, E, w = []) {
3836
- var T, M;
3837
+ function x(N, V, w = []) {
3838
+ var T, O;
3837
3839
  return t ? N === "input" ? /* @__PURE__ */ e(
3838
3840
  me,
3839
3841
  {
3840
3842
  className: `h-8 w-full ${Be}`,
3841
- value: ((T = t == null ? void 0 : t.settings) == null ? void 0 : T[E]) || "",
3842
- onChange: (A) => {
3843
+ value: ((T = t == null ? void 0 : t.settings) == null ? void 0 : T[V]) || "",
3844
+ onChange: (E) => {
3843
3845
  o({
3844
3846
  ...t,
3845
3847
  settings: {
3846
3848
  ...t == null ? void 0 : t.settings,
3847
- [E]: A.target.value
3849
+ [V]: E.target.value
3848
3850
  }
3849
3851
  });
3850
3852
  }
3851
3853
  },
3852
- E
3854
+ V
3853
3855
  ) : N === "select" ? /* @__PURE__ */ e(
3854
3856
  ye,
3855
3857
  {
3856
3858
  className: "h-8 w-full",
3857
3859
  label: "",
3858
3860
  options: w,
3859
- value: ((M = t == null ? void 0 : t.settings) == null ? void 0 : M[E]) || "",
3860
- onValueChange: (A) => {
3861
+ value: ((O = t == null ? void 0 : t.settings) == null ? void 0 : O[V]) || "",
3862
+ onValueChange: (E) => {
3861
3863
  o({
3862
3864
  ...t,
3863
- settings: { ...t == null ? void 0 : t.settings, [E]: A }
3865
+ settings: { ...t == null ? void 0 : t.settings, [V]: E }
3864
3866
  });
3865
3867
  }
3866
3868
  }
3867
3869
  ) : null : null;
3868
3870
  }
3869
3871
  function u(N) {
3870
- const E = Object.entries((N == null ? void 0 : N.settings) || {});
3871
- return /* @__PURE__ */ e("div", { className: "space-y-3", children: E.map(([w, T]) => /* @__PURE__ */ n("div", { className: "space-y-2", children: [
3872
+ const V = Object.entries((N == null ? void 0 : N.settings) || {});
3873
+ return /* @__PURE__ */ e("div", { className: "space-y-3", children: V.map(([w, T]) => /* @__PURE__ */ n("div", { className: "space-y-2", children: [
3872
3874
  /* @__PURE__ */ e(U, { children: T.title }),
3873
3875
  x(
3874
3876
  T.ui,
@@ -3953,7 +3955,7 @@ function nr() {
3953
3955
  }
3954
3956
  );
3955
3957
  }
3956
- function Re() {
3958
+ function qe() {
3957
3959
  const [t, s] = _([]);
3958
3960
  p(
3959
3961
  (f) => f.card.cfg
@@ -4034,7 +4036,7 @@ function Re() {
4034
4036
  children: /* @__PURE__ */ n("div", { className: "grow", children: [
4035
4037
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2 py-2", children: [
4036
4038
  /* @__PURE__ */ e(
4037
- qt,
4039
+ jt,
4038
4040
  {
4039
4041
  checked: !!((x = a == null ? void 0 : a.onClickFilter) != null && x.find(
4040
4042
  (g) => g.columnIndex === v
@@ -4052,7 +4054,7 @@ function Re() {
4052
4054
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: ((u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find(
4053
4055
  (g) => g.columnIndex === v
4054
4056
  )) && /* @__PURE__ */ e(
4055
- ma,
4057
+ pa,
4056
4058
  {
4057
4059
  onClick: () => {
4058
4060
  s((g) => {
@@ -4072,7 +4074,7 @@ function Re() {
4072
4074
  })
4073
4075
  ] });
4074
4076
  }
4075
- function yt() {
4077
+ function Nt() {
4076
4078
  var o, c, d;
4077
4079
  const t = p((h) => h.card.preferences), s = p(
4078
4080
  (h) => h.card.cfg
@@ -4082,7 +4084,7 @@ function yt() {
4082
4084
  r(h);
4083
4085
  }
4084
4086
  return /* @__PURE__ */ n(
4085
- bt,
4087
+ xt,
4086
4088
  {
4087
4089
  value: ((c = t == null ? void 0 : t.chartOptions) == null ? void 0 : c.indexAxis) || ((d = s == null ? void 0 : s.options) == null ? void 0 : d.indexAxis) || "x",
4088
4090
  onValueChange: i,
@@ -4090,24 +4092,24 @@ function yt() {
4090
4092
  defaultValue: "x",
4091
4093
  children: [
4092
4094
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
4093
- /* @__PURE__ */ e(Ve, { value: "x", id: "r1" }),
4095
+ /* @__PURE__ */ e(Fe, { value: "x", id: "r1" }),
4094
4096
  /* @__PURE__ */ e("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
4095
4097
  ] }),
4096
4098
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
4097
- /* @__PURE__ */ e(Ve, { value: "y", id: "r2" }),
4099
+ /* @__PURE__ */ e(Fe, { value: "y", id: "r2" }),
4098
4100
  /* @__PURE__ */ e("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
4099
4101
  ] })
4100
4102
  ]
4101
4103
  }
4102
4104
  );
4103
4105
  }
4104
- const tt = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
4105
- function oa(t, s) {
4106
+ const st = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
4107
+ function ca(t, s) {
4106
4108
  var l, r, i;
4107
- const a = Ia(t, s);
4109
+ const a = La(t, s);
4108
4110
  return ((i = (r = (l = t == null ? void 0 : t.chartOptions) == null ? void 0 : l.scales) == null ? void 0 : r[a]) == null ? void 0 : i.type) || "linear";
4109
4111
  }
4110
- function nn() {
4112
+ function sn() {
4111
4113
  var G, Q, W, oe, ce, K;
4112
4114
  const [t, s] = _(!1), a = p((R) => {
4113
4115
  var F;
@@ -4115,32 +4117,32 @@ function nn() {
4115
4117
  }), l = p((R) => {
4116
4118
  var F;
4117
4119
  return (F = R.card) == null ? void 0 : F.cfg;
4118
- }), r = Ia(a, l), [i, o] = _(
4119
- oa(a)
4120
+ }), r = La(a, l), [i, o] = _(
4121
+ ca(a)
4120
4122
  ), [c, d] = _(
4121
4123
  ((W = (Q = (G = a == null ? void 0 : a.chartOptions) == null ? void 0 : G.scales) == null ? void 0 : Q[r]) == null ? void 0 : W.min) || ""
4122
4124
  ), [h, f] = _(
4123
4125
  ((K = (ce = (oe = a == null ? void 0 : a.chartOptions) == null ? void 0 : oe.scales) == null ? void 0 : ce[r]) == null ? void 0 : K.max) || ""
4124
- ), [v, x] = _(c || h ? "custom" : "auto"), [u, g] = _(""), [b, k] = _(0), [N, E] = _(""), [w, T] = _(""), [M, A] = _(""), P = p(
4126
+ ), [v, x] = _(c || h ? "custom" : "auto"), [u, g] = _(""), [b, k] = _(0), [N, V] = _(""), [w, T] = _(""), [O, E] = _(""), P = p(
4125
4127
  (R) => R.actions.setCardPreferences
4126
4128
  ), { updateCardInFrame: j } = ie(), $ = p((R) => R.card), m = p((R) => {
4127
4129
  var F;
4128
4130
  return (F = R.card) == null ? void 0 : F.type;
4129
4131
  }), y = ["pie", "doughnut", "polarArea"].includes(m);
4130
4132
  re(() => {
4131
- var R, F, de, ne, ue, le, se, pe, z, V, J, we, je, Ie;
4132
- o(oa(a)), d(
4133
+ var R, F, de, ne, ue, le, se, pe, z, A, J, we, Re, je;
4134
+ o(ca(a)), d(
4133
4135
  ((de = (F = (R = a == null ? void 0 : a.chartOptions) == null ? void 0 : R.scales) == null ? void 0 : F[r]) == null ? void 0 : de.min) === 0 ? 0 : ""
4134
4136
  ), f(((le = (ue = (ne = a == null ? void 0 : a.chartOptions) == null ? void 0 : ne.scales) == null ? void 0 : ue[r]) == null ? void 0 : le.max) || ""), g(
4135
- ((V = (z = (pe = (se = a == null ? void 0 : a.chartOptions) == null ? void 0 : se.scales) == null ? void 0 : pe[r]) == null ? void 0 : z.ticks) == null ? void 0 : V.stepSize) || ""
4136
- ), k(((J = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : J.decimalPlaces) || 0), E(((we = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : we.suffix) || ""), T(((je = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : je.currency) || ""), A(((Ie = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ie.locale) || "");
4137
+ ((A = (z = (pe = (se = a == null ? void 0 : a.chartOptions) == null ? void 0 : se.scales) == null ? void 0 : pe[r]) == null ? void 0 : z.ticks) == null ? void 0 : A.stepSize) || ""
4138
+ ), k(((J = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : J.decimalPlaces) || 0), V(((we = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : we.suffix) || ""), T(((Re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Re.currency) || ""), E(((je = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : je.locale) || "");
4137
4139
  }, [t, a, r]);
4138
4140
  function D(R, F) {
4139
4141
  return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(R);
4140
4142
  }
4141
4143
  function C() {
4142
4144
  const R = [
4143
- ...new Set(ot.map((F) => F.currency))
4145
+ ...new Set(ut.map((F) => F.currency))
4144
4146
  ];
4145
4147
  return /* @__PURE__ */ n(ae, { children: [
4146
4148
  /* @__PURE__ */ n("div", { className: "grid grid-cols-6 items-center gap-2", children: [
@@ -4174,7 +4176,7 @@ function nn() {
4174
4176
  ]
4175
4177
  }
4176
4178
  ),
4177
- /* @__PURE__ */ n(ve, { value: M, onValueChange: (F) => A(F), children: [
4179
+ /* @__PURE__ */ n(ve, { value: O, onValueChange: (F) => E(F), children: [
4178
4180
  /* @__PURE__ */ e(
4179
4181
  xe,
4180
4182
  {
@@ -4184,7 +4186,7 @@ function nn() {
4184
4186
  ),
4185
4187
  /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ze, { children: [
4186
4188
  /* @__PURE__ */ e(Se, { children: "Locale" }),
4187
- ot.map((F) => /* @__PURE__ */ e(te, { value: F.locale, children: F.locale }, F.locale))
4189
+ ut.map((F) => /* @__PURE__ */ e(te, { value: F.locale, children: F.locale }, F.locale))
4188
4190
  ] }) })
4189
4191
  ] })
4190
4192
  ] }),
@@ -4196,7 +4198,7 @@ function nn() {
4196
4198
  value: b,
4197
4199
  onChange: (F) => k(Number(F.target.value)),
4198
4200
  id: "format",
4199
- className: `col-span-6 h-8 w-full tracking-wide ${tt}`
4201
+ className: `col-span-6 h-8 w-full tracking-wide ${st}`
4200
4202
  }
4201
4203
  )
4202
4204
  ] })
@@ -4212,7 +4214,7 @@ function nn() {
4212
4214
  id: "min",
4213
4215
  value: c,
4214
4216
  onChange: (R) => d((F) => D(F, R.target.value)),
4215
- className: `col-span-1 h-8 w-full ${tt}`
4217
+ className: `col-span-1 h-8 w-full ${st}`
4216
4218
  }
4217
4219
  ),
4218
4220
  /* @__PURE__ */ e(
@@ -4221,7 +4223,7 @@ function nn() {
4221
4223
  value: h,
4222
4224
  onChange: (R) => f((F) => D(F, R.target.value)),
4223
4225
  id: "max",
4224
- className: `col-span-1 h-8 w-full ${tt}`
4226
+ className: `col-span-1 h-8 w-full ${st}`
4225
4227
  }
4226
4228
  )
4227
4229
  ] }),
@@ -4233,7 +4235,7 @@ function nn() {
4233
4235
  value: u,
4234
4236
  onChange: (R) => g((F) => D(F, R.target.value)),
4235
4237
  id: "step-size",
4236
- className: `col-span-1 h-8 w-full ${tt}`
4238
+ className: `col-span-1 h-8 w-full ${st}`
4237
4239
  }
4238
4240
  )
4239
4241
  ] })
@@ -4266,7 +4268,7 @@ function nn() {
4266
4268
  decimalPlaces: b,
4267
4269
  suffix: N,
4268
4270
  currency: w,
4269
- locale: M
4271
+ locale: O
4270
4272
  }
4271
4273
  };
4272
4274
  console.log(F), P(F);
@@ -4276,9 +4278,9 @@ function nn() {
4276
4278
  };
4277
4279
  j(de);
4278
4280
  }
4279
- return /* @__PURE__ */ n(pt, { onOpenChange: (R) => s(R), children: [
4280
- /* @__PURE__ */ e(ft, { asChild: !0, children: /* @__PURE__ */ e(gs, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4281
- /* @__PURE__ */ e(gt, { align: "center", className: "max-w-65", children: /* @__PURE__ */ n("div", { className: "grid gap-4", children: [
4281
+ return /* @__PURE__ */ n(bt, { onOpenChange: (R) => s(R), children: [
4282
+ /* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ e(gs, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
4283
+ /* @__PURE__ */ e(vt, { align: "center", className: "max-w-65", children: /* @__PURE__ */ n("div", { className: "grid gap-4", children: [
4282
4284
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
4283
4285
  /* @__PURE__ */ e("h4", { className: "font-medium leading-none", children: "Scale Options" }),
4284
4286
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
@@ -4306,7 +4308,7 @@ function nn() {
4306
4308
  i == "linear" && /* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
4307
4309
  /* @__PURE__ */ e(U, { htmlFor: "scale-option", children: "Setup" }),
4308
4310
  /* @__PURE__ */ n(
4309
- bt,
4311
+ xt,
4310
4312
  {
4311
4313
  disabled: y,
4312
4314
  id: "scale-option",
@@ -4316,11 +4318,11 @@ function nn() {
4316
4318
  defaultValue: "x",
4317
4319
  children: [
4318
4320
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
4319
- /* @__PURE__ */ e(Ve, { value: "auto", id: "r1" }),
4321
+ /* @__PURE__ */ e(Fe, { value: "auto", id: "r1" }),
4320
4322
  /* @__PURE__ */ e("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
4321
4323
  ] }),
4322
4324
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
4323
- /* @__PURE__ */ e(Ve, { value: "custom", id: "r2" }),
4325
+ /* @__PURE__ */ e(Fe, { value: "custom", id: "r2" }),
4324
4326
  /* @__PURE__ */ e("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
4325
4327
  ] })
4326
4328
  ]
@@ -4387,9 +4389,9 @@ function sr({ idx: t }) {
4387
4389
  });
4388
4390
  }
4389
4391
  }
4390
- return /* @__PURE__ */ n(pt, { children: [
4391
- /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(ul, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4392
- /* @__PURE__ */ e(gt, { className: "w-fit p-1", children: /* @__PURE__ */ n("div", { className: "flex gap-1", children: [
4392
+ return /* @__PURE__ */ n(bt, { children: [
4393
+ /* @__PURE__ */ e(yt, { children: /* @__PURE__ */ e(ul, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4394
+ /* @__PURE__ */ e(vt, { className: "w-fit p-1", children: /* @__PURE__ */ n("div", { className: "flex gap-1", children: [
4393
4395
  /* @__PURE__ */ e(
4394
4396
  L,
4395
4397
  {
@@ -4454,17 +4456,17 @@ function sr({ idx: t }) {
4454
4456
  ] }) })
4455
4457
  ] });
4456
4458
  }
4457
- function sn() {
4459
+ function ln() {
4458
4460
  const t = p((h) => h.card), s = p(
4459
4461
  (h) => {
4460
4462
  var f, v, x;
4461
4463
  return (x = (v = (f = h == null ? void 0 : h.card) == null ? void 0 : f.preferences) == null ? void 0 : v.chartOptions) == null ? void 0 : x.indexAxis;
4462
4464
  }
4463
- ), { data: a } = Ee(t), l = s === "y" ? "Y axis" : "X axis", r = s === "y" ? "X axis" : "Y axis", {
4465
+ ), { data: a } = Ve(t), l = s === "y" ? "Y axis" : "X axis", r = s === "y" ? "X axis" : "Y axis", {
4464
4466
  keys: i,
4465
4467
  metricKeys: o,
4466
4468
  dimensionKeys: c
4467
- } = wt((a == null ? void 0 : a.records) || []);
4469
+ } = zt((a == null ? void 0 : a.records) || []);
4468
4470
  let d = o;
4469
4471
  if (["stackedBar", "stackedLine"].includes(t.type)) {
4470
4472
  const h = xs({
@@ -4472,24 +4474,24 @@ function sn() {
4472
4474
  groupKey: c[0],
4473
4475
  pivotKey: c[1],
4474
4476
  valueKey: d[0]
4475
- }), { metricKeys: f } = wt(h);
4477
+ }), { metricKeys: f } = zt(h);
4476
4478
  d = f;
4477
4479
  }
4478
4480
  return i.length === 0 ? null : /* @__PURE__ */ n("div", { className: "space-y-4", children: [
4479
4481
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
4480
4482
  /* @__PURE__ */ e(U, { children: l }),
4481
- /* @__PURE__ */ e("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e("div", { className: "rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: /* @__PURE__ */ e("p", { title: c[0], children: ln(c[0]) }) }) })
4483
+ /* @__PURE__ */ e("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e("div", { className: "rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: /* @__PURE__ */ e("p", { title: c[0], children: rn(c[0]) }) }) })
4482
4484
  ] }),
4483
4485
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
4484
4486
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-5", children: [
4485
4487
  /* @__PURE__ */ e(U, { children: r }),
4486
- /* @__PURE__ */ e(nn, {})
4488
+ /* @__PURE__ */ e(sn, {})
4487
4489
  ] }),
4488
4490
  /* @__PURE__ */ e("div", { className: "my-1 max-h-[125px] space-y-1 overflow-y-auto", children: d.map((h, f) => /* @__PURE__ */ e(lr, { col: h, idx: f }, h)) })
4489
4491
  ] })
4490
4492
  ] });
4491
4493
  }
4492
- function ln(t, s = 30) {
4494
+ function rn(t, s = 30) {
4493
4495
  return t.length > s ? t.slice(0, s) + "..." : t;
4494
4496
  }
4495
4497
  function lr({ col: t, idx: s }) {
@@ -4528,17 +4530,17 @@ function lr({ col: t, idx: s }) {
4528
4530
  }
4529
4531
  }
4530
4532
  return /* @__PURE__ */ n("div", { className: "group flex items-center justify-between gap-5 rounded-md bg-muted/70 px-3 py-2 hover:bg-muted", children: [
4531
- /* @__PURE__ */ e("p", { title: t, children: ln(t) }),
4533
+ /* @__PURE__ */ e("p", { title: t, children: rn(t) }),
4532
4534
  /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
4533
4535
  /* @__PURE__ */ e(
4534
- jt,
4536
+ Ht,
4535
4537
  {
4536
4538
  onClick: () => o("bar"),
4537
4539
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4538
4540
  }
4539
4541
  ),
4540
4542
  /* @__PURE__ */ e(
4541
- _t,
4543
+ Pt,
4542
4544
  {
4543
4545
  onClick: () => o("line"),
4544
4546
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
@@ -4555,25 +4557,25 @@ function lr({ col: t, idx: s }) {
4555
4557
  ] })
4556
4558
  ] });
4557
4559
  }
4558
- function rn() {
4559
- const t = p((u) => u.selectedConnectionId), s = p((u) => u.selectedDatamodelId), a = p((u) => u.selectedDatabaseName), l = p((u) => u.selectedSchemaName), r = p((u) => u.selectedTableName), i = O((u) => u.dashboard.filters) || [], o = O((u) => u.actions.addFilter), c = O((u) => u.actions.removeFilter), { removeFilterValues: d } = Ze(), { modelItems: h, tableName: f, connectionType: v } = qe();
4560
+ function on() {
4561
+ const t = p((u) => u.selectedConnectionId), s = p((u) => u.selectedDatamodelId), a = p((u) => u.selectedDatabaseName), l = p((u) => u.selectedSchemaName), r = p((u) => u.selectedTableName), i = M((u) => u.dashboard.filters) || [], o = M((u) => u.actions.addFilter), c = M((u) => u.actions.removeFilter), { removeFilterValues: d } = Ze(), { modelItems: h, tableName: f, connectionType: v } = Ae();
4560
4562
  function x(u, g = "dashboard") {
4561
4563
  var P;
4562
- const b = be(u.column_name), k = be(a || ""), N = be(l || ""), E = be(f);
4564
+ const b = be(u.column_name), k = be(a || ""), N = be(l || ""), V = be(f);
4563
4565
  let w = Ns(
4564
4566
  N,
4565
- E,
4567
+ V,
4566
4568
  v
4567
4569
  ), T = `${w}.${b}`;
4568
- const M = (P = h == null ? void 0 : h.find(
4570
+ const O = (P = h == null ? void 0 : h.find(
4569
4571
  (j) => j.id === s
4570
4572
  )) == null ? void 0 : P.name;
4571
- s && s !== "none" && (T = `${aa}.${M}.${b}`, w = `${aa}.${M}`);
4572
- const A = i == null ? void 0 : i.find(
4573
- (j) => j.column === T && j.table === E && (j.database === k || j.database === a)
4573
+ s && s !== "none" && (T = `${na}.${O}.${b}`, w = `${na}.${O}`);
4574
+ const E = i == null ? void 0 : i.find(
4575
+ (j) => j.column === T && j.table === V && (j.database === k || j.database === a)
4574
4576
  );
4575
- if (A)
4576
- d(A.id), c(A.id);
4577
+ if (E)
4578
+ d(E.id), c(E.id);
4577
4579
  else {
4578
4580
  const j = We();
4579
4581
  return f === "api" && t ? (o({
@@ -4588,7 +4590,7 @@ function rn() {
4588
4590
  // database: 'NA',
4589
4591
  connectionId: t,
4590
4592
  operation: "in",
4591
- sql: ta(
4593
+ sql: aa(
4592
4594
  u.data_type,
4593
4595
  w,
4594
4596
  b
@@ -4606,7 +4608,7 @@ function rn() {
4606
4608
  database: a || "",
4607
4609
  connectionId: t || "",
4608
4610
  operation: "in",
4609
- sql: ta(
4611
+ sql: aa(
4610
4612
  u.data_type,
4611
4613
  w,
4612
4614
  b
@@ -4618,9 +4620,9 @@ function rn() {
4618
4620
  return { assignFilter: x };
4619
4621
  }
4620
4622
  function Pe() {
4621
- const t = O(
4623
+ const t = M(
4622
4624
  (c) => c.dashboard.filters
4623
- ), s = p((c) => c.frame), { setFrame: a } = ie(), { columns: l } = qe(), { assignFilter: r } = rn();
4625
+ ), s = p((c) => c.frame), { setFrame: a } = ie(), { columns: l } = Ae(), { assignFilter: r } = on();
4624
4626
  function i(c) {
4625
4627
  const d = r(c, "frame");
4626
4628
  a({ ...s, filterId: d });
@@ -4629,7 +4631,7 @@ function Pe() {
4629
4631
  return /* @__PURE__ */ n("div", { className: "space-y-3", children: [
4630
4632
  /* @__PURE__ */ e(U, { children: "Card Filter" }),
4631
4633
  /* @__PURE__ */ e(rr, { onSelect: i, columns: l }),
4632
- o && /* @__PURE__ */ e(La, { filter: o })
4634
+ o && /* @__PURE__ */ e(Fa, { filter: o })
4633
4635
  ] });
4634
4636
  }
4635
4637
  function rr({
@@ -4637,9 +4639,9 @@ function rr({
4637
4639
  onSelect: s
4638
4640
  }) {
4639
4641
  var o;
4640
- const [a, l] = na.useState(!1), [r, i] = na.useState("");
4641
- return /* @__PURE__ */ n(pt, { open: a, onOpenChange: l, children: [
4642
- /* @__PURE__ */ e(ft, { asChild: !0, children: /* @__PURE__ */ n(
4642
+ const [a, l] = sa.useState(!1), [r, i] = sa.useState("");
4643
+ return /* @__PURE__ */ n(bt, { open: a, onOpenChange: l, children: [
4644
+ /* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ n(
4643
4645
  L,
4644
4646
  {
4645
4647
  size: "sm",
@@ -4653,12 +4655,12 @@ function rr({
4653
4655
  ]
4654
4656
  }
4655
4657
  ) }),
4656
- /* @__PURE__ */ e(gt, { className: "w-[200px] p-0", children: /* @__PURE__ */ n(Ss, { children: [
4658
+ /* @__PURE__ */ e(vt, { className: "w-[200px] p-0", children: /* @__PURE__ */ n(Ss, { children: [
4657
4659
  /* @__PURE__ */ e(ws, { placeholder: "Search column", className: "h-9" }),
4658
4660
  /* @__PURE__ */ n(ks, { children: [
4659
4661
  /* @__PURE__ */ e(zs, { children: "No framework found." }),
4660
4662
  /* @__PURE__ */ e(Os, { children: t.map((c) => /* @__PURE__ */ n(
4661
- Ms,
4663
+ Is,
4662
4664
  {
4663
4665
  value: c.column_name,
4664
4666
  onSelect: (d) => {
@@ -4668,7 +4670,7 @@ function rr({
4668
4670
  children: [
4669
4671
  c.column_name,
4670
4672
  /* @__PURE__ */ e(
4671
- Ts,
4673
+ Ms,
4672
4674
  {
4673
4675
  className: ee(
4674
4676
  "ml-auto h-4 w-4",
@@ -4687,9 +4689,9 @@ function rr({
4687
4689
  function ir({
4688
4690
  cardType: t
4689
4691
  }) {
4690
- return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ae, { defaultValue: ["item-2"], type: "multiple", children: [
4692
+ return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
4691
4693
  /* @__PURE__ */ n(Z, { value: "item-1", children: [
4692
- /* @__PURE__ */ e(X, { children: `${Rt(t)} Chart` }),
4694
+ /* @__PURE__ */ e(X, { children: `${_t(t)} Chart` }),
4693
4695
  /* @__PURE__ */ n(Y, { className: "space-y-4 font-mono text-xs", children: [
4694
4696
  /* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
4695
4697
  /* @__PURE__ */ n("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -4716,20 +4718,20 @@ function ir({
4716
4718
  /* @__PURE__ */ n(Z, { value: "item-2", children: [
4717
4719
  /* @__PURE__ */ e(X, { children: "Settings" }),
4718
4720
  /* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
4719
- /* @__PURE__ */ e(yt, {}),
4720
- /* @__PURE__ */ e(sn, {})
4721
+ /* @__PURE__ */ e(Nt, {}),
4722
+ /* @__PURE__ */ e(ln, {})
4721
4723
  ] })
4722
4724
  ] }),
4723
4725
  /* @__PURE__ */ n(Z, { value: "item-3", children: [
4724
4726
  /* @__PURE__ */ e(X, { children: "Filters" }),
4725
4727
  /* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
4726
- /* @__PURE__ */ e(Re, {}),
4728
+ /* @__PURE__ */ e(qe, {}),
4727
4729
  /* @__PURE__ */ e(Pe, {})
4728
4730
  ] })
4729
4731
  ] })
4730
4732
  ] }) });
4731
4733
  }
4732
- function Ut() {
4734
+ function Gt() {
4733
4735
  var r, i, o;
4734
4736
  const t = p(
4735
4737
  (c) => c.card.cfg
@@ -4758,7 +4760,7 @@ function Ut() {
4758
4760
  return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
4759
4761
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
4760
4762
  /* @__PURE__ */ e("label", { className: "font-medium", children: "Data Labels" }),
4761
- !["pyramid"].includes(a) && /* @__PURE__ */ e(nn, {})
4763
+ !["pyramid"].includes(a) && /* @__PURE__ */ e(sn, {})
4762
4764
  ] }),
4763
4765
  /* @__PURE__ */ n(
4764
4766
  ve,
@@ -4809,19 +4811,19 @@ function or({
4809
4811
  ] })
4810
4812
  ] });
4811
4813
  }
4812
- return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ae, { defaultValue: ["item-2"], type: "multiple", children: [
4814
+ return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
4813
4815
  /* @__PURE__ */ n(Z, { value: "item-1", children: [
4814
- /* @__PURE__ */ e(X, { children: `${Rt(t)} Chart` }),
4816
+ /* @__PURE__ */ e(X, { children: `${_t(t)} Chart` }),
4815
4817
  /* @__PURE__ */ e(Y, { className: "space-y-4 font-mono text-xs", children: s(t) })
4816
4818
  ] }),
4817
4819
  /* @__PURE__ */ n(Z, { value: "item-2", children: [
4818
4820
  /* @__PURE__ */ e(X, { children: "Settings" }),
4819
- /* @__PURE__ */ e(Y, { className: "px-2", children: /* @__PURE__ */ e(Ut, {}) })
4821
+ /* @__PURE__ */ e(Y, { className: "px-2", children: /* @__PURE__ */ e(Gt, {}) })
4820
4822
  ] }),
4821
4823
  /* @__PURE__ */ n(Z, { value: "item-3", children: [
4822
4824
  /* @__PURE__ */ e(X, { children: "Filters" }),
4823
4825
  /* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
4824
- /* @__PURE__ */ e(Re, {}),
4826
+ /* @__PURE__ */ e(qe, {}),
4825
4827
  /* @__PURE__ */ e(Pe, {})
4826
4828
  ] })
4827
4829
  ] })
@@ -4854,7 +4856,7 @@ function ur() {
4854
4856
  const t = p((s) => s.card.type);
4855
4857
  return /* @__PURE__ */ n("div", { className: "space-y-6 p-6", children: [
4856
4858
  /* @__PURE__ */ e(
4857
- Ae,
4859
+ Ee,
4858
4860
  {
4859
4861
  className: " ",
4860
4862
  type: "single",
@@ -4862,10 +4864,10 @@ function ur() {
4862
4864
  children: hr(t)
4863
4865
  }
4864
4866
  ),
4865
- /* @__PURE__ */ e("section", { className: "", children: ["line", "bar"].includes(t) && /* @__PURE__ */ e(yt, {}) }),
4867
+ /* @__PURE__ */ e("section", { className: "", children: ["line", "bar"].includes(t) && /* @__PURE__ */ e(Nt, {}) }),
4866
4868
  !["kpi"].includes(t) && /* @__PURE__ */ n("div", { className: "space-y-4", children: [
4867
- /* @__PURE__ */ e(Ut, {}),
4868
- /* @__PURE__ */ e(Re, {}),
4869
+ /* @__PURE__ */ e(Gt, {}),
4870
+ /* @__PURE__ */ e(qe, {}),
4869
4871
  /* @__PURE__ */ e(Pe, {})
4870
4872
  ] })
4871
4873
  ] });
@@ -5001,11 +5003,11 @@ function mr() {
5001
5003
  }
5002
5004
  ) || [], o = p(
5003
5005
  (u) => u.actions.setColorRanges
5004
- ), c = [...new Set(ot.map((u) => u.currency))];
5006
+ ), c = [...new Set(ut.map((u) => u.currency))];
5005
5007
  return /* @__PURE__ */ n("div", { children: [
5006
5008
  /* @__PURE__ */ n("div", { className: "mb-3 flex items-center gap-2", children: [
5007
5009
  /* @__PURE__ */ e(
5008
- qt,
5010
+ jt,
5009
5011
  {
5010
5012
  checked: !!((d = t == null ? void 0 : t.formatNumber) != null && d.enabled),
5011
5013
  onCheckedChange: (u) => {
@@ -5044,7 +5046,7 @@ function mr() {
5044
5046
  /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ze, { children: [
5045
5047
  /* @__PURE__ */ e(Se, { children: "Format" }),
5046
5048
  /* @__PURE__ */ e(te, { value: "none", children: "None" }, "none"),
5047
- ot.map((u) => /* @__PURE__ */ e(te, { value: u.locale, children: u.locale }, u.locale))
5049
+ ut.map((u) => /* @__PURE__ */ e(te, { value: u.locale, children: u.locale }, u.locale))
5048
5050
  ] }) })
5049
5051
  ]
5050
5052
  }
@@ -5124,7 +5126,7 @@ function mr() {
5124
5126
  ] }) }),
5125
5127
  /* @__PURE__ */ e(Oe, { className: "my-3" }),
5126
5128
  /* @__PURE__ */ e(
5127
- Ds,
5129
+ Ts,
5128
5130
  {
5129
5131
  colorRanges: i,
5130
5132
  setColorRanges: o
@@ -5135,7 +5137,7 @@ function mr() {
5135
5137
  }
5136
5138
  function pr() {
5137
5139
  return /* @__PURE__ */ n("div", { className: "space-y-6 px-6 py-2", children: [
5138
- /* @__PURE__ */ e(Ae, { type: "single", collapsible: !0, children: /* @__PURE__ */ n(Z, { value: "item-1", children: [
5140
+ /* @__PURE__ */ e(Ee, { type: "single", collapsible: !0, children: /* @__PURE__ */ n(Z, { value: "item-1", children: [
5139
5141
  /* @__PURE__ */ e(X, { className: "", children: "KPI Query" }),
5140
5142
  /* @__PURE__ */ n(Y, { className: "font-mono", children: [
5141
5143
  /* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
@@ -5265,10 +5267,10 @@ const fr = [
5265
5267
  value: t
5266
5268
  }));
5267
5269
  function yr() {
5268
- var d, h, f, v, x, u, g, b, k, N, E, w, T, M, A, P, j, $;
5270
+ var d, h, f, v, x, u, g, b, k, N, V, w, T, O, E, P, j, $;
5269
5271
  const t = p((m) => m.card), s = (h = (d = t == null ? void 0 : t.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : h.topoJsonUrl, [a, l] = _(
5270
5272
  ((v = (f = t == null ? void 0 : t.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : v.customTopoJsonUrl) || ""
5271
- ), { setCardPreferences: r } = ie(), { data: i } = At(t), o = Object.keys((i == null ? void 0 : i.objects) || {}).map((m) => ({
5273
+ ), { setCardPreferences: r } = ie(), { data: i } = Rt(t), o = Object.keys((i == null ? void 0 : i.objects) || {}).map((m) => ({
5272
5274
  label: m,
5273
5275
  value: m
5274
5276
  })) || [];
@@ -5405,7 +5407,7 @@ function yr() {
5405
5407
  className: `h-9 w-full ${Be}`,
5406
5408
  type: "number",
5407
5409
  step: 0.1,
5408
- value: ((w = (E = t.preferences) == null ? void 0 : E.mapVisualOptions) == null ? void 0 : w.projectionScale) || 1,
5410
+ value: ((w = (V = t.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : w.projectionScale) || 1,
5409
5411
  onChange: (m) => {
5410
5412
  var y;
5411
5413
  r({
@@ -5425,7 +5427,7 @@ function yr() {
5425
5427
  className: `h-9 w-full ${Be}`,
5426
5428
  type: "number",
5427
5429
  step: 10,
5428
- value: ((A = (M = (T = t.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : M.projectionOffset) == null ? void 0 : A[0]) || 0,
5430
+ value: ((E = (O = (T = t.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : O.projectionOffset) == null ? void 0 : E[0]) || 0,
5429
5431
  onChange: (m) => {
5430
5432
  var y, D, C, q;
5431
5433
  r({
@@ -5466,7 +5468,7 @@ function yr() {
5466
5468
  )
5467
5469
  ] }) }),
5468
5470
  /* @__PURE__ */ e(Oe, { className: "my-4" }),
5469
- /* @__PURE__ */ e(Re, {})
5471
+ /* @__PURE__ */ e(qe, {})
5470
5472
  ] });
5471
5473
  }
5472
5474
  function vr() {
@@ -5482,7 +5484,7 @@ function vr() {
5482
5484
  });
5483
5485
  }
5484
5486
  return /* @__PURE__ */ n(
5485
- bt,
5487
+ xt,
5486
5488
  {
5487
5489
  value: (l = t == null ? void 0 : t.textVisualOptions) != null && l.isDynamicText ? "dynamic" : "static",
5488
5490
  onValueChange: a,
@@ -5490,25 +5492,25 @@ function vr() {
5490
5492
  defaultValue: "x",
5491
5493
  children: [
5492
5494
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
5493
- /* @__PURE__ */ e(Ve, { value: "static", id: "r1" }),
5495
+ /* @__PURE__ */ e(Fe, { value: "static", id: "r1" }),
5494
5496
  /* @__PURE__ */ e("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
5495
5497
  ] }),
5496
5498
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
5497
- /* @__PURE__ */ e(Ve, { value: "dynamic", id: "r2" }),
5499
+ /* @__PURE__ */ e(Fe, { value: "dynamic", id: "r2" }),
5498
5500
  /* @__PURE__ */ e("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
5499
5501
  ] })
5500
5502
  ]
5501
5503
  }
5502
5504
  );
5503
5505
  }
5504
- function at({
5506
+ function lt({
5505
5507
  cardType: t,
5506
5508
  docContent: s,
5507
5509
  suffix: a = "Chart"
5508
5510
  }) {
5509
- return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ae, { defaultValue: ["item-2"], type: "multiple", children: [
5511
+ return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
5510
5512
  /* @__PURE__ */ n(Z, { value: "item-1", children: [
5511
- /* @__PURE__ */ e(X, { children: `${Rt(t)} ${a}` }),
5513
+ /* @__PURE__ */ e(X, { children: `${_t(t)} ${a}` }),
5512
5514
  /* @__PURE__ */ e(Y, { children: s || /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs", children: [
5513
5515
  /* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
5514
5516
  /* @__PURE__ */ n("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -5534,15 +5536,15 @@ function at({
5534
5536
  /* @__PURE__ */ n(Z, { value: "item-2", children: [
5535
5537
  /* @__PURE__ */ e(X, { children: "Settings" }),
5536
5538
  /* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
5537
- t === "range" && /* @__PURE__ */ e(yt, {}),
5538
- t !== "text" && /* @__PURE__ */ e(Ut, {}),
5539
+ t === "range" && /* @__PURE__ */ e(Nt, {}),
5540
+ t !== "text" && /* @__PURE__ */ e(Gt, {}),
5539
5541
  t === "text" && /* @__PURE__ */ e(vr, {})
5540
5542
  ] })
5541
5543
  ] }),
5542
5544
  !["range", "text"].includes(t) && /* @__PURE__ */ n(Z, { value: "item-3", children: [
5543
5545
  /* @__PURE__ */ e(X, { children: "Filters" }),
5544
5546
  /* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
5545
- /* @__PURE__ */ e(Re, {}),
5547
+ /* @__PURE__ */ e(qe, {}),
5546
5548
  /* @__PURE__ */ e(Pe, {})
5547
5549
  ] })
5548
5550
  ] })
@@ -5585,7 +5587,7 @@ function xr() {
5585
5587
  )
5586
5588
  ] });
5587
5589
  }
5588
- return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ae, { defaultValue: ["item-2"], type: "multiple", children: [
5590
+ return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
5589
5591
  /* @__PURE__ */ n(Z, { value: "item-1", children: [
5590
5592
  /* @__PURE__ */ e(X, { children: "Stacked Chart" }),
5591
5593
  /* @__PURE__ */ n(Y, { className: "space-y-4 font-mono text-xs", children: [
@@ -5614,15 +5616,15 @@ function xr() {
5614
5616
  /* @__PURE__ */ n(Z, { value: "item-2", children: [
5615
5617
  /* @__PURE__ */ e(X, { children: "Settings" }),
5616
5618
  /* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
5617
- /* @__PURE__ */ e(yt, {}),
5619
+ /* @__PURE__ */ e(Nt, {}),
5618
5620
  a(),
5619
- /* @__PURE__ */ e(sn, {})
5621
+ /* @__PURE__ */ e(ln, {})
5620
5622
  ] })
5621
5623
  ] }),
5622
5624
  /* @__PURE__ */ n(Z, { value: "item-3", children: [
5623
5625
  /* @__PURE__ */ e(X, { children: "Filters" }),
5624
5626
  /* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
5625
- /* @__PURE__ */ e(Re, {}),
5627
+ /* @__PURE__ */ e(qe, {}),
5626
5628
  /* @__PURE__ */ e(Pe, {})
5627
5629
  ] })
5628
5630
  ] })
@@ -5636,15 +5638,15 @@ function Nr({}) {
5636
5638
  (l) => l.actions.setCardPreferences
5637
5639
  );
5638
5640
  return /* @__PURE__ */ n("div", { className: "space-y-6 px-6 py-2", children: [
5639
- /* @__PURE__ */ e(Ae, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ n(Z, { value: "item-3", children: [
5641
+ /* @__PURE__ */ e(Ee, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ n(Z, { value: "item-3", children: [
5640
5642
  /* @__PURE__ */ e(X, { children: "Filters" }),
5641
5643
  /* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
5642
- /* @__PURE__ */ e(Re, {}),
5644
+ /* @__PURE__ */ e(qe, {}),
5643
5645
  /* @__PURE__ */ e(Pe, {})
5644
5646
  ] })
5645
5647
  ] }) }),
5646
5648
  /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
5647
- /* @__PURE__ */ e(qt, { onCheckedChange: (l) => {
5649
+ /* @__PURE__ */ e(jt, { onCheckedChange: (l) => {
5648
5650
  s({
5649
5651
  ...t,
5650
5652
  allowDownload: l
@@ -5718,19 +5720,19 @@ function kr() {
5718
5720
  case "stackedLine":
5719
5721
  return /* @__PURE__ */ e(xr, {});
5720
5722
  case "pyramid":
5721
- return /* @__PURE__ */ e(at, { docContent: Cr, cardType: a });
5723
+ return /* @__PURE__ */ e(lt, { docContent: Cr, cardType: a });
5722
5724
  case "kpi":
5723
5725
  return /* @__PURE__ */ e(pr, {});
5724
5726
  case "line":
5725
5727
  case "bar":
5726
5728
  return /* @__PURE__ */ e(ir, { cardType: a });
5727
5729
  case "range":
5728
- return /* @__PURE__ */ e(at, { docContent: Sr, cardType: a });
5730
+ return /* @__PURE__ */ e(lt, { docContent: Sr, cardType: a });
5729
5731
  case "pie":
5730
5732
  case "doughnut":
5731
5733
  case "polarArea":
5732
5734
  case "radar":
5733
- return /* @__PURE__ */ e(at, { cardType: a });
5735
+ return /* @__PURE__ */ e(lt, { cardType: a });
5734
5736
  case "bubble":
5735
5737
  case "scatter":
5736
5738
  return /* @__PURE__ */ e(or, { cardType: a });
@@ -5738,7 +5740,7 @@ function kr() {
5738
5740
  return /* @__PURE__ */ e(Nr, { cardType: a });
5739
5741
  case "text":
5740
5742
  return /* @__PURE__ */ e(
5741
- at,
5743
+ lt,
5742
5744
  {
5743
5745
  docContent: wr,
5744
5746
  cardType: a,
@@ -5753,7 +5755,7 @@ function kr() {
5753
5755
  return /* @__PURE__ */ e(ur, {});
5754
5756
  }
5755
5757
  }
5756
- return /* @__PURE__ */ n(Te, { className: "h-full w-full text-sm", children: [
5758
+ return /* @__PURE__ */ n(Me, { className: "h-full w-full text-sm", children: [
5757
5759
  s(t),
5758
5760
  /* @__PURE__ */ e(He, { orientation: "horizontal" })
5759
5761
  ] });
@@ -5761,7 +5763,7 @@ function kr() {
5761
5763
  function zr() {
5762
5764
  const t = p((s) => s.isShowingVisual);
5763
5765
  return /* @__PURE__ */ n(
5764
- rt,
5766
+ ct,
5765
5767
  {
5766
5768
  direction: "vertical",
5767
5769
  className: "min-h-[250px] min-w-full max-w-lg",
@@ -5776,7 +5778,7 @@ function zr() {
5776
5778
  children: /* @__PURE__ */ e(Hl, {})
5777
5779
  }
5778
5780
  ),
5779
- /* @__PURE__ */ e(it, { withHandle: !0, className: "border" }),
5781
+ /* @__PURE__ */ e(dt, { withHandle: !0, className: "border" }),
5780
5782
  /* @__PURE__ */ e(
5781
5783
  ke,
5782
5784
  {
@@ -5784,7 +5786,7 @@ function zr() {
5784
5786
  role: "visual-section",
5785
5787
  minSize: 0,
5786
5788
  defaultSize: 60,
5787
- children: t ? /* @__PURE__ */ n(rt, { direction: "horizontal", children: [
5789
+ children: t ? /* @__PURE__ */ n(ct, { direction: "horizontal", children: [
5788
5790
  /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
5789
5791
  ke,
5790
5792
  {
@@ -5795,9 +5797,9 @@ function zr() {
5795
5797
  children: /* @__PURE__ */ e(kr, {})
5796
5798
  }
5797
5799
  ) }),
5798
- /* @__PURE__ */ e(it, { className: "border" }),
5799
- /* @__PURE__ */ e(ke, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e(ia, {}) })
5800
- ] }) : /* @__PURE__ */ e(ia, {})
5800
+ /* @__PURE__ */ e(dt, { className: "border" }),
5801
+ /* @__PURE__ */ e(ke, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e(oa, {}) })
5802
+ ] }) : /* @__PURE__ */ e(oa, {})
5801
5803
  }
5802
5804
  )
5803
5805
  ]
@@ -5805,14 +5807,14 @@ function zr() {
5805
5807
  );
5806
5808
  }
5807
5809
  function Or({ authToken: t, onSave: s, onClose: a }) {
5808
- O((o) => o.themeStyle);
5809
- const l = p((o) => o.actions.setOnSave), r = p((o) => o.actions.setOnClose), i = O((o) => o.actions.setAuthToken);
5810
+ M((o) => o.themeStyle);
5811
+ const l = p((o) => o.actions.setOnSave), r = p((o) => o.actions.setOnClose), i = M((o) => o.actions.setAuthToken);
5810
5812
  return re(() => {
5811
5813
  s && l(s), a && r(a);
5812
5814
  }, [s, l, a, r]), re(() => {
5813
5815
  t && t.accessToken && i(t);
5814
- }, [t, i]), /* @__PURE__ */ e(mt, { FallbackComponent: Fa, children: /* @__PURE__ */ n(
5815
- Is,
5816
+ }, [t, i]), /* @__PURE__ */ e(gt, { FallbackComponent: Va, children: /* @__PURE__ */ n(
5817
+ Ds,
5816
5818
  {
5817
5819
  style: {
5818
5820
  // borderRadius: currentStyle?.chart?.options?.borderRadius,
@@ -5821,15 +5823,15 @@ function Or({ authToken: t, onSave: s, onClose: a }) {
5821
5823
  className: "rounded-none",
5822
5824
  role: "editor-panel",
5823
5825
  children: [
5824
- /* @__PURE__ */ e(Ls, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e(Pa, {}) }),
5826
+ /* @__PURE__ */ e(Ls, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e($a, {}) }),
5825
5827
  /* @__PURE__ */ e(Fs, { children: /* @__PURE__ */ e(zr, {}) })
5826
5828
  ]
5827
5829
  }
5828
5830
  ) });
5829
5831
  }
5830
- function Mr() {
5831
- O((o) => o.selectedCardId);
5832
- const t = O((o) => o.selectedSheetId), { setIsVisualEditing: s } = O((o) => o.actions), a = O((o) => o.isVisualEditing), l = O((o) => o.actions.updateFrame);
5832
+ function Ir() {
5833
+ M((o) => o.selectedCardId);
5834
+ const t = M((o) => o.selectedSheetId), { setIsVisualEditing: s } = M((o) => o.actions), a = M((o) => o.isVisualEditing), l = M((o) => o.actions.updateFrame);
5833
5835
  function r(o) {
5834
5836
  t && (l(t, o), s(!1));
5835
5837
  }
@@ -5847,9 +5849,9 @@ function Mr() {
5847
5849
  }
5848
5850
  );
5849
5851
  }
5850
- function Tr() {
5851
- const t = p((i) => i.selectedDatabaseName), s = p((i) => i.selectedTableName), a = O((i) => i.dashboard.filters) || [], { columns: l } = qe(), { assignFilter: r } = rn();
5852
- return /* @__PURE__ */ e(Te, { className: "flex-1 basis-0 flex-col px-3", children: l == null ? void 0 : l.map((i) => {
5852
+ function Mr() {
5853
+ const t = p((i) => i.selectedDatabaseName), s = p((i) => i.selectedTableName), a = M((i) => i.dashboard.filters) || [], { columns: l } = Ae(), { assignFilter: r } = on();
5854
+ return /* @__PURE__ */ e(Me, { className: "flex-1 basis-0 flex-col px-3", children: l == null ? void 0 : l.map((i) => {
5853
5855
  const o = a == null ? void 0 : a.find(
5854
5856
  (c) => c.column === be(i.column_name) && c.table === s && c.database === t
5855
5857
  );
@@ -5864,7 +5866,7 @@ function Tr() {
5864
5866
  }
5865
5867
  ),
5866
5868
  children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
5867
- /* @__PURE__ */ e(Ha, { column: i }),
5869
+ /* @__PURE__ */ e(Pa, { column: i }),
5868
5870
  /* @__PURE__ */ e("span", { children: i.column_name })
5869
5871
  ] })
5870
5872
  },
@@ -5872,9 +5874,9 @@ function Tr() {
5872
5874
  );
5873
5875
  }) });
5874
5876
  }
5875
- function Dr() {
5876
- O((s) => s.showFilters);
5877
- const t = O(
5877
+ function Tr() {
5878
+ M((s) => s.showFilters);
5879
+ const t = M(
5878
5880
  (s) => s.actions.setShowFilters
5879
5881
  );
5880
5882
  return /* @__PURE__ */ n("section", { className: "relative flex min-w-[320px] grow flex-col border-l px-1", children: [
@@ -5886,17 +5888,17 @@ function Dr() {
5886
5888
  onClick: () => t(!1),
5887
5889
  className: "h-7 w-7 p-0",
5888
5890
  variant: "ghost",
5889
- children: /* @__PURE__ */ e(ut, {})
5891
+ children: /* @__PURE__ */ e(pt, {})
5890
5892
  }
5891
5893
  )
5892
5894
  ] }),
5893
5895
  /* @__PURE__ */ e("div", { className: "flex grow", children: /* @__PURE__ */ e(
5894
- Pa,
5896
+ $a,
5895
5897
  {
5896
5898
  ColumnsComponent: () => (
5897
5899
  // schemaName, tableName, columns
5898
5900
  /* @__PURE__ */ e(
5899
- Tr,
5901
+ Mr,
5900
5902
  {}
5901
5903
  )
5902
5904
  )
@@ -5904,8 +5906,8 @@ function Dr() {
5904
5906
  ) })
5905
5907
  ] });
5906
5908
  }
5907
- function Ir() {
5908
- const t = O((l) => l.dashboard.filters), s = O((l) => l.theme), a = t == null ? void 0 : t.filter((l) => l.hide);
5909
+ function Dr() {
5910
+ const t = M((l) => l.dashboard.filters), s = M((l) => l.theme), a = t == null ? void 0 : t.filter((l) => l.hide);
5909
5911
  return a != null && a.length ? /* @__PURE__ */ e(
5910
5912
  "div",
5911
5913
  {
@@ -5918,8 +5920,8 @@ function Ir() {
5918
5920
  {
5919
5921
  className: "flex min-w-[250px] max-w-fit flex-col gap-1 p-2",
5920
5922
  children: [
5921
- /* @__PURE__ */ e(La, { filter: l }),
5922
- /* @__PURE__ */ e(Oa, { filter: l })
5923
+ /* @__PURE__ */ e(Fa, { filter: l }),
5924
+ /* @__PURE__ */ e(Ia, { filter: l })
5923
5925
  ]
5924
5926
  },
5925
5927
  l.id
@@ -5928,7 +5930,7 @@ function Ir() {
5928
5930
  ) : null;
5929
5931
  }
5930
5932
  function Lr() {
5931
- const t = O((l) => l.showFilters), s = O((l) => l.isVisualEditing), a = O(
5933
+ const t = M((l) => l.showFilters), s = M((l) => l.isVisualEditing), a = M(
5932
5934
  (l) => l.isDashboardEditing
5933
5935
  );
5934
5936
  return /* @__PURE__ */ n(
@@ -5943,18 +5945,18 @@ function Lr() {
5943
5945
  }),
5944
5946
  children: [
5945
5947
  /* @__PURE__ */ n("section", { className: "flex grow flex-col", children: [
5946
- a && /* @__PURE__ */ e(Ir, {}),
5948
+ a && /* @__PURE__ */ e(Dr, {}),
5947
5949
  /* @__PURE__ */ e(Vs, {})
5948
5950
  ] }),
5949
- t && /* @__PURE__ */ e("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e(Dr, {}) })
5951
+ t && /* @__PURE__ */ e("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e(Tr, {}) })
5950
5952
  ]
5951
5953
  }
5952
5954
  );
5953
5955
  }
5954
5956
  function Fr() {
5955
- const t = O((r) => r.dashboard), s = O((r) => r.actions.setDashboard), a = O(
5957
+ const t = M((r) => r.dashboard), s = M((r) => r.actions.setDashboard), a = M(
5956
5958
  (r) => r.showDashboardJSON
5957
- ), l = O(
5959
+ ), l = M(
5958
5960
  (r) => r.actions.setShowDashboardJSON
5959
5961
  );
5960
5962
  return /* @__PURE__ */ n(
@@ -6015,13 +6017,13 @@ function Rr({
6015
6017
  showFooter: s = !0,
6016
6018
  ...a
6017
6019
  }) {
6018
- return /* @__PURE__ */ e(mt, { FallbackComponent: Fa, children: /* @__PURE__ */ n(As, { dashboardProps: a, children: [
6020
+ return /* @__PURE__ */ e(gt, { FallbackComponent: Va, children: /* @__PURE__ */ n(As, { dashboardProps: a, children: [
6019
6021
  /* @__PURE__ */ e(qs, {}),
6020
6022
  /* @__PURE__ */ n(Rs, { children: [
6021
6023
  /* @__PURE__ */ e(Fr, {}),
6022
6024
  /* @__PURE__ */ n(js, { ...a, children: [
6023
6025
  t && /* @__PURE__ */ e(Cl, {}),
6024
- /* @__PURE__ */ e(Mr, {}),
6026
+ /* @__PURE__ */ e(Ir, {}),
6025
6027
  /* @__PURE__ */ e(Lr, {})
6026
6028
  ] })
6027
6029
  ] })
@@ -6035,28 +6037,28 @@ export {
6035
6037
  Ur as SemaphorQueryClient,
6036
6038
  Rr as Surfboard,
6037
6039
  pl as cleanCard,
6038
- xa as createSqlGenConfig,
6040
+ Na as createSqlGenConfig,
6039
6041
  xl as downloadPdf,
6040
6042
  be as fmt,
6041
6043
  Br as getColumnDataType,
6042
- _a as getDashbaordStateWithoutData,
6044
+ Ha as getDashbaordStateWithoutData,
6043
6045
  Gr as getFilterValueType,
6044
- St as getFormattedTableNameForQuery,
6046
+ kt as getFormattedTableNameForQuery,
6045
6047
  Ns as getQualifiedTableName,
6046
- Na as getSql,
6048
+ Ca as getSql,
6047
6049
  hn as invalidateToken,
6048
6050
  yn as isBooleanDataType,
6049
6051
  vn as isColumnInSqlGen,
6050
6052
  gn as isDateDataType,
6051
- Ca as isNumberDataType,
6053
+ Sa as isNumberDataType,
6052
6054
  fn as isTextDataType,
6053
6055
  Jr as resolveDataType,
6054
6056
  Wr as useCard,
6055
6057
  Ze as useDashboardActions,
6056
- O as useDashboardStore,
6058
+ M as useDashboardStore,
6057
6059
  Kr as useDateFilterHook,
6058
6060
  ie as useEditorActions,
6059
- qe as useEditorAside,
6061
+ Ae as useEditorAside,
6060
6062
  p as useEditorStore,
6061
6063
  Qr as useTextFilterHook
6062
6064
  };